commit f443e374ae131c168a065ea1748feac6b2e76613 Author: Linus Torvalds Date: Sun Mar 20 13:14:17 2022 -0700 Linux 5.17 Signed-off-by: Linus Torvalds commit 7445b2dcd77ae8385bd08bb6c2db20ea0cfa6230 Merge: 1e0e7a6a28f87 fe83f5eae432c Author: Linus Torvalds Date: Sun Mar 20 09:46:52 2022 -0700 Merge tag 'for-linus-5.17' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull kvm fix from Paolo Bonzini: "Fix for the SLS mitigation, which makes a 'SETcc/RET' pair grow to 'SETcc/RET/INT3'. This doesn't fit in 4 bytes any more, so the alignment has to change to 8 for this case" * tag 'for-linus-5.17' of git://git.kernel.org/pub/scm/virt/kvm/kvm: kvm/emulate: Fix SETcc emulation function offsets with SLS commit 1e0e7a6a28f877312b93cd12a1448c8d53733b55 Merge: 14702b3b2438e 5600f6986628d Author: Linus Torvalds Date: Sun Mar 20 09:27:52 2022 -0700 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Pull input fixes from Dmitry Torokhov: "Two driver fixes: - a fix for zinitix touchscreen to properly report contacts - a fix for aiptek tablet driver to be more resilient to devices with incorrect descriptors" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: aiptek - properly check endpoint type Input: zinitix - do not report shadow fingers commit fe83f5eae432ccc8e90082d6ed506d5233547473 Author: Borislav Petkov Date: Wed Mar 16 22:05:52 2022 +0100 kvm/emulate: Fix SETcc emulation function offsets with SLS The commit in Fixes started adding INT3 after RETs as a mitigation against straight-line speculation. The fastop SETcc implementation in kvm's insn emulator uses macro magic to generate all possible SETcc functions and to jump to them when emulating the respective instruction. However, it hardcodes the size and alignment of those functions to 4: a three-byte SETcc insn and a single-byte RET. BUT, with SLS, there's an INT3 that gets slapped after the RET, which brings the whole scheme out of alignment: 15: 0f 90 c0 seto %al 18: c3 ret 19: cc int3 1a: 0f 1f 00 nopl (%rax) 1d: 0f 91 c0 setno %al 20: c3 ret 21: cc int3 22: 0f 1f 00 nopl (%rax) 25: 0f 92 c0 setb %al 28: c3 ret 29: cc int3 and this explodes like this: int3: 0000 [#1] PREEMPT SMP PTI CPU: 0 PID: 2435 Comm: qemu-system-x86 Not tainted 5.17.0-rc8-sls #1 Hardware name: Dell Inc. Precision WorkStation T3400 /0TP412, BIOS A14 04/30/2012 RIP: 0010:setc+0x5/0x8 [kvm] Code: 00 00 0f 1f 00 0f b6 05 43 24 06 00 c3 cc 0f 1f 80 00 00 00 00 0f 90 c0 c3 cc 0f \ 1f 00 0f 91 c0 c3 cc 0f 1f 00 0f 92 c0 c3 cc <0f> 1f 00 0f 93 c0 c3 cc 0f 1f 00 \ 0f 94 c0 c3 cc 0f 1f 00 0f 95 c0 Call Trace: ? x86_emulate_insn [kvm] ? x86_emulate_instruction [kvm] ? vmx_handle_exit [kvm_intel] ? kvm_arch_vcpu_ioctl_run [kvm] ? kvm_vcpu_ioctl [kvm] ? __x64_sys_ioctl ? do_syscall_64 ? entry_SYSCALL_64_after_hwframe Raise the alignment value when SLS is enabled and use a macro for that instead of hard-coding naked numbers. Fixes: e463a09af2f0 ("x86: Add straight-line-speculation mitigation") Reported-by: Jamie Heilman Signed-off-by: Borislav Petkov Acked-by: Peter Zijlstra (Intel) Tested-by: Jamie Heilman Link: https://lore.kernel.org/r/YjGzJwjrvxg5YZ0Z@audible.transient.net [Add a comment and a bit of safety checking, since this is going to be changed again for IBT support. - Paolo] Signed-off-by: Paolo Bonzini commit 14702b3b2438e2f2d07ae93b5d695c166e5c83d1 Merge: f76da4d5ad516 1447c635802fd Author: Linus Torvalds Date: Sat Mar 19 16:36:32 2022 -0700 Merge tag 'soc-fixes-5.17-4' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC fix from Arnd Bergmann: "Here is one last regression fix for 5.17, reverting a patch that went into 5.16 as a cleanup that ended up breaking external interrupts on Layerscape chips. The revert makes it work again, but also reintroduces a build time warning about the nonstandard DT binding that will have to be dealt with in the future" * tag 'soc-fixes-5.17-4' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: Revert "arm64: dts: freescale: Fix 'interrupt-map' parent address cells" commit f76da4d5ad5168de58f0f5be1a12c1052a614663 Merge: 97e9c8eb4bb1d 733ab7e1b5d10 Author: Linus Torvalds Date: Sat Mar 19 15:56:43 2022 -0700 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fixes from James Bottomley: "Two small(ish) fixes, both in drivers" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: fnic: Finish scsi_cmnd before dropping the spinlock scsi: mpt3sas: Page fault in reply q processing commit 97e9c8eb4bb1dc57859acb1338dfddbd967d7484 Merge: ba6354f61472c 7bd1da15d211d Author: Linus Torvalds Date: Sat Mar 19 11:04:10 2022 -0700 Merge tag 'perf-tools-fixes-for-v5.17-2022-03-19' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux Pull perf tools fixes from Arnaldo Carvalho de Melo: - Avoid iterating empty evlist, fixing a segfault with 'perf stat --null' - Ignore case in topdown.slots check, fixing issue with Intel Icelake JSON metrics. - Fix symbol size calculation condition for fixing up corner case symbol end address obtained from Kallsyms. * tag 'perf-tools-fixes-for-v5.17-2022-03-19' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: perf parse-events: Ignore case in topdown.slots check perf evlist: Avoid iteration for empty evlist. perf symbols: Fix symbol size calculation condition commit ba6354f61472c5bc910c34ea1b368f62c3706692 Merge: 6aa61c12a43bb 01b44ef2bf6bc Author: Linus Torvalds Date: Sat Mar 19 10:21:34 2022 -0700 Merge tag 'char-misc-5.17-final' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull char/misc driver fix from Greg KH: "Here is a single driver fix for 5.17-final that has been submitted many times but I somehow missed it in my patch queue: - fix for counter sysfs code for reported problem This has been in linux-next all week with no reported issues" * tag 'char-misc-5.17-final' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: counter: Stop using dev_get_drvdata() to get the counter device commit 6aa61c12a43bb365296e72251e7346b661030b52 Merge: 34e047aa16c01 16b1941eac2bd Author: Linus Torvalds Date: Sat Mar 19 10:16:33 2022 -0700 Merge tag 'usb-5.17-final' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB fixes from Greg KH: "Here are some small remaining USB fixes for 5.17-final. They include: - two USB gadget driver fixes for reported problems - usbtmc driver fix for syzbot found issues - musb patch partial revert to resolve a reported regression. All of these have been in linux-next this week with no reported problems" * tag 'usb-5.17-final' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: usb: gadget: Fix use-after-free bug by not setting udc->dev.driver usb: usbtmc: Fix bug in pipe direction for control transfers partially Revert "usb: musb: Set the DT node on the child device" usb: gadget: rndis: prevent integer overflow in rndis_set_response() commit 7bd1da15d211d439d96eb7cc8a35ce694b71d120 Author: Ian Rogers Date: Thu Mar 17 15:43:09 2022 -0700 perf parse-events: Ignore case in topdown.slots check An issue with icelakex metrics: https://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git/tree/tools/perf/pmu-events/arch/x86/icelakex/icx-metrics.json?h=perf/core&id=65eab2bc7dab326ee892ec5a4c749470b368b51a#n48 That causes the slots not to be first. Fixes: 94dbfd6781a0e87b ("perf parse-events: Architecture specific leader override") Reported-by: Caleb Biggers Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Alexandre Torgue Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kan Liang Cc: Mark Rutland Cc: Maxime Coquelin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Zhengjun Xing Link: https://lore.kernel.org/r/20220317224309.543736-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 8b464eac9765dfc84d0327fa3f3668faa439d1ce Author: Ian Rogers Date: Thu Mar 17 16:16:43 2022 -0700 perf evlist: Avoid iteration for empty evlist. As seen with 'perf stat --null ..' and reported in: https://lore.kernel.org/lkml/YjCLcpcX2peeQVCH@kernel.org/ v2. Avoids setting evsel in the empty list case as suggested by Jiri Olsa. Committer testing: Before: $ perf stat --null sleep 1 Segmentation fault (core dumped) $ After: $ perf stat --null sleep 1 Performance counter stats for 'sleep 1': 1.010340646 seconds time elapsed 0.001420000 seconds user 0.000000000 seconds sys $ Fixes: 472832d2c000b961 ("perf evlist: Refactor evlist__for_each_cpu()") Reported-by: Arnaldo Carvalho de Melo Signed-off-by: Ian Rogers Tested-by: Arnaldo Carvalho de Melo Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Ian Rogers Cc: Namhyung Kim Link: https://lore.kernel.org/r/20220317231643.550902-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 3cf6a32f3f2a45944dd5be5c6ac4deb46bcd3bee Author: Michael Petlan Date: Thu Mar 17 14:55:36 2022 +0100 perf symbols: Fix symbol size calculation condition Before this patch, the symbol end address fixup to be called, needed two conditions being met: if (prev->end == prev->start && prev->end != curr->start) Where "prev->end == prev->start" means that prev is zero-long (and thus needs a fixup) and "prev->end != curr->start" means that fixup hasn't been applied yet However, this logic is incorrect in the following situation: *curr = {rb_node = {__rb_parent_color = 278218928, rb_right = 0x0, rb_left = 0x0}, start = 0xc000000000062354, end = 0xc000000000062354, namelen = 40, type = 2 '\002', binding = 0 '\000', idle = 0 '\000', ignore = 0 '\000', inlined = 0 '\000', arch_sym = 0 '\000', annotate2 = false, name = 0x1159739e "kprobe_optinsn_page\t[__builtin__kprobes]"} *prev = {rb_node = {__rb_parent_color = 278219041, rb_right = 0x109548b0, rb_left = 0x109547c0}, start = 0xc000000000062354, end = 0xc000000000062354, namelen = 12, type = 2 '\002', binding = 1 '\001', idle = 0 '\000', ignore = 0 '\000', inlined = 0 '\000', arch_sym = 0 '\000', annotate2 = false, name = 0x1095486e "optinsn_slot"} In this case, prev->start == prev->end == curr->start == curr->end, thus the condition above thinks that "we need a fixup due to zero length of prev symbol, but it has been probably done, since the prev->end == curr->start", which is wrong. After the patch, the execution path proceeds to arch__symbols__fixup_end function which fixes up the size of prev symbol by adding page_size to its end offset. Fixes: 3b01a413c196c910 ("perf symbols: Improve kallsyms symbol end addr calculation") Signed-off-by: Michael Petlan Cc: Athira Jajeev Cc: Jiri Olsa Cc: Kajol Jain Cc: Madhavan Srinivasan Link: http://lore.kernel.org/lkml/20220317135536.805-1-mpetlan@redhat.com Signed-off-by: Arnaldo Carvalho de Melo commit 34e047aa16c0123bbae8e2f6df33e5ecc1f56601 Merge: 6e4069881a7f9 316e46f65a549 Author: Linus Torvalds Date: Fri Mar 18 12:32:59 2022 -0700 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fixes from Catalin Marinas: "Fix two compiler warnings introduced by recent commits: pointer arithmetic and double initialisation of struct field" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: errata: avoid duplicate field initializer arm64: fix clang warning about TRAMP_VALIAS commit 6e4069881a7f9dceb6dfb97e436d55e3c7f43e81 Merge: 6c4bcd8140770 e3ee9fb22652f Author: Linus Torvalds Date: Fri Mar 18 12:22:15 2022 -0700 Merge tag '5.17-rc8-smb3-fix' of git://git.samba.org/sfrench/cifs-2.6 Pull cifs fix from Steve French: "Small fix for regression in multiuser mounts. The additional improvements suggested by Ronnie to make the server and session status handling code easier to read can wait for the 5.18 merge window." * tag '5.17-rc8-smb3-fix' of git://git.samba.org/sfrench/cifs-2.6: smb3: fix incorrect session setup check for multiuser mounts commit 6c4bcd8140770f8190a8e691aff0e3550069edb1 Merge: cced5148a1303 f6189589fa7cc Author: Linus Torvalds Date: Fri Mar 18 12:15:56 2022 -0700 Merge tag 'block-5.17-2022-03-18' of git://git.kernel.dk/linux-block Pull block fixes from Jens Axboe: - Revert of a nvme target feature (Hannes) - Fix a memory leak with rq-qos (Ming) * tag 'block-5.17-2022-03-18' of git://git.kernel.dk/linux-block: nvmet: revert "nvmet: make discovery NQN configurable" block: release rq qos structures for queue without disk commit cced5148a1303a2ec57d04a7745a560821b45280 Merge: 551acdc3c3d2b ca5a5761ac542 Author: Linus Torvalds Date: Fri Mar 18 12:01:19 2022 -0700 Merge tag 'drm-fixes-2022-03-18' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "A few minor changes to finish things off, one mgag200 regression, imx fix and couple of panel changes. imx: - Don't test bus flags in atomic check mgag200: - Fix PLL setup on some models panel: - Fix bpp settings on Innolux G070Y2-L01 - Fix DRM_PANEL_EDP Kconfig dependencies" * tag 'drm-fixes-2022-03-18' of git://anongit.freedesktop.org/drm/drm: drm: Don't make DRM_PANEL_BRIDGE dependent on DRM_KMS_HELPERS drm/panel: simple: Fix Innolux G070Y2-L01 BPP settings drm/imx: parallel-display: Remove bus flags check in imx_pd_bridge_atomic_check() drm/mgag200: Fix PLL setup for g200wb and g200ew commit 316e46f65a5497839857db08b6fbf60f568b165a Author: Arnd Bergmann Date: Wed Mar 16 19:37:45 2022 +0100 arm64: errata: avoid duplicate field initializer The '.type' field is initialized both in place and in the macro as reported by this W=1 warning: arch/arm64/include/asm/cpufeature.h:281:9: error: initialized field overwritten [-Werror=override-init] 281 | (ARM64_CPUCAP_SCOPE_LOCAL_CPU | ARM64_CPUCAP_OPTIONAL_FOR_LATE_CPU) | ^ arch/arm64/kernel/cpu_errata.c:136:17: note: in expansion of macro 'ARM64_CPUCAP_LOCAL_CPU_ERRATUM' 136 | .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM, \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/arm64/kernel/cpu_errata.c:145:9: note: in expansion of macro 'ERRATA_MIDR_RANGE' 145 | ERRATA_MIDR_RANGE(m, var, r_min, var, r_max) | ^~~~~~~~~~~~~~~~~ arch/arm64/kernel/cpu_errata.c:613:17: note: in expansion of macro 'ERRATA_MIDR_REV_RANGE' 613 | ERRATA_MIDR_REV_RANGE(MIDR_CORTEX_A510, 0, 0, 2), | ^~~~~~~~~~~~~~~~~~~~~ arch/arm64/include/asm/cpufeature.h:281:9: note: (near initialization for 'arm64_errata[18].type') 281 | (ARM64_CPUCAP_SCOPE_LOCAL_CPU | ARM64_CPUCAP_OPTIONAL_FOR_LATE_CPU) | ^ Remove the extranous initializer. Signed-off-by: Arnd Bergmann Fixes: 1dd498e5e26a ("KVM: arm64: Workaround Cortex-A510's single-step and PAC trap errata") Link: https://lore.kernel.org/r/20220316183800.1546731-1-arnd@kernel.org Signed-off-by: Catalin Marinas commit 7f34b43e07cb512b28543fdcb9f35d1fbfda9ebc Author: Arnd Bergmann Date: Wed Mar 16 19:38:18 2022 +0100 arm64: fix clang warning about TRAMP_VALIAS The newly introduced TRAMP_VALIAS definition causes a build warning with clang-14: arch/arm64/include/asm/vectors.h:66:31: error: arithmetic on a null pointer treated as a cast from integer to pointer is a GNU extension [-Werror,-Wnull-pointer-arithmetic] return (char *)TRAMP_VALIAS + SZ_2K * slot; Change the addition to something clang does not complain about. Fixes: bd09128d16fa ("arm64: Add percpu vectors for EL1") Signed-off-by: Arnd Bergmann Acked-by: James Morse Link: https://lore.kernel.org/r/20220316183833.1563139-1-arnd@kernel.org Signed-off-by: Catalin Marinas commit ca5a5761ac542691a6b3520b6c5c047cf63b4b8d Merge: 09688c0166e76 3c3384050d685 Author: Dave Airlie Date: Fri Mar 18 13:30:30 2022 +1000 Merge tag 'drm-misc-fixes-2022-03-17' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes * drm/imx: Don't test bus flags in atomic check * drm/mgag200: Fix PLL setup on some models * drm/panel: Fix bpp settings on Innolux G070Y2-L01; Fix DRM_PANEL_EDP Kconfig dependencies Signed-off-by: Dave Airlie From: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/YjMNcqOuDFDoe+EN@linux-uq9g commit 551acdc3c3d2b6bc97f11e31dcf960bc36343bfc Merge: c81801eb7f247 b04683ff8f082 Author: Linus Torvalds Date: Thu Mar 17 12:55:26 2022 -0700 Merge tag 'net-5.17-final' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Jakub Kicinski: "Including fixes from netfilter, ipsec, and wireless. A few last minute revert / disable and fix patches came down from our sub-trees. We're not waiting for any fixes at this point. Current release - regressions: - Revert "netfilter: nat: force port remap to prevent shadowing well-known ports", restore working conntrack on asymmetric paths - Revert "ath10k: drop beacon and probe response which leak from other channel", restore working AP and mesh mode on QCA9984 - eth: intel: fix hang during reboot/shutdown Current release - new code bugs: - netfilter: nf_tables: disable register tracking, it needs more work to cover all corner cases Previous releases - regressions: - ipv6: fix skb_over_panic in __ip6_append_data when (admin-only) extension headers get specified - esp6: fix ESP over TCP/UDP, interpret ipv6_skip_exthdr's return value more selectively - bnx2x: fix driver load failure when FW not present in initrd Previous releases - always broken: - vsock: stop destroying unrelated sockets in nested virtualization - packet: fix slab-out-of-bounds access in packet_recvmsg() Misc: - add Paolo Abeni to networking maintainers!" * tag 'net-5.17-final' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (26 commits) iavf: Fix hang during reboot/shutdown net: mscc: ocelot: fix backwards compatibility with single-chain tc-flower offload net: bcmgenet: skip invalid partial checksums bnx2x: fix built-in kernel driver load failure net: phy: mscc: Add MODULE_FIRMWARE macros net: dsa: Add missing of_node_put() in dsa_port_parse_of net: handle ARPHRD_PIMREG in dev_is_mac_header_xmit() Revert "ath10k: drop beacon and probe response which leak from other channel" hv_netvsc: Add check for kvmalloc_array iavf: Fix double free in iavf_reset_task ice: destroy flow director filter mutex after releasing VSIs ice: fix NULL pointer dereference in ice_update_vsi_tx_ring_stats() Add Paolo Abeni to networking maintainers atm: eni: Add check for dma_map_single net/packet: fix slab-out-of-bounds access in packet_recvmsg() net: mdio: mscc-miim: fix duplicate debugfs entry net: phy: marvell: Fix invalid comparison in the resume and suspend functions esp6: fix check on ipv6_skip_exthdr's return value net: dsa: microchip: add spi_device_id tables netfilter: nf_tables: disable register tracking ... commit c81801eb7f2476a25d8fb27449e01b0bef46908a Merge: 2ab99e54584e0 462ccc35a750f Author: Linus Torvalds Date: Thu Mar 17 12:40:59 2022 -0700 Merge tag 'acpi-5.17-rc9' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI fix from Rafael Wysocki: "Revert recent commit that caused multiple systems to misbehave due to firmware issues" * tag 'acpi-5.17-rc9' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: Revert "ACPI: scan: Do not add device IDs from _CID if _HID is not valid" commit 2ab99e54584e0048b9c0bea2d61053a61bae0bbc Merge: a46310bfae94c 1c4debc443ef7 Author: Linus Torvalds Date: Thu Mar 17 12:36:47 2022 -0700 Merge branch 'akpm' (patches from Andrew) Merge misc fixes from Andrew Morton: "Four patches. Subsystems affected by this patch series: mm/swap, kconfig, ocfs2, and selftests" * emailed patches from Andrew Morton : selftests: vm: fix clang build error multiple output files ocfs2: fix crash when initialize filecheck kobj fails configs/debug: restore DEBUG_INFO=y for overriding mm: swap: get rid of livelock in swapin readahead commit 1c4debc443ef7037dcb7c4f08c33b9caebd21d2e Author: Yosry Ahmed Date: Wed Mar 16 16:15:12 2022 -0700 selftests: vm: fix clang build error multiple output files When building the vm selftests using clang, some errors are seen due to having headers in the compilation command: clang -Wall -I ../../../../usr/include -no-pie gup_test.c ../../../../mm/gup_test.h -lrt -lpthread -o .../tools/testing/selftests/vm/gup_test clang: error: cannot specify -o when generating multiple output files make[1]: *** [../lib.mk:146: .../tools/testing/selftests/vm/gup_test] Error 1 Rework to add the header files to LOCAL_HDRS before including ../lib.mk, since the dependency is evaluated in '$(OUTPUT)/%:%.c $(LOCAL_HDRS)' in file lib.mk. Link: https://lkml.kernel.org/r/20220304000645.1888133-1-yosryahmed@google.com Signed-off-by: Yosry Ahmed Cc: Shuah Khan Cc: Nathan Chancellor Cc: Nick Desaulniers Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 7b0b1332cfdb94489836b67d088a779699f8e47e Author: Joseph Qi Date: Wed Mar 16 16:15:09 2022 -0700 ocfs2: fix crash when initialize filecheck kobj fails Once s_root is set, genric_shutdown_super() will be called if fill_super() fails. That means, we will call ocfs2_dismount_volume() twice in such case, which can lead to kernel crash. Fix this issue by initializing filecheck kobj before setting s_root. Link: https://lkml.kernel.org/r/20220310081930.86305-1-joseph.qi@linux.alibaba.com Fixes: 5f483c4abb50 ("ocfs2: add kobject for online file check") Signed-off-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 8208257d2d04d4953a8cb9f1426d245a95c4fea2 Author: Qian Cai Date: Wed Mar 16 16:15:06 2022 -0700 configs/debug: restore DEBUG_INFO=y for overriding Previously, I failed to realize that Kees' patch [1] has not been merged into the mainline yet, and dropped DEBUG_INFO=y too eagerly from the mainline. As the results, "make debug.config" won't be able to flip DEBUG_INFO=n from the existing .config. This should close the gaps of a few weeks before Kees' patch is there, and work regardless of their merging status anyway. Link: https://lore.kernel.org/all/20220125075126.891825-1-keescook@chromium.org/ [1] Link: https://lkml.kernel.org/r/20220308153524.8618-1-quic_qiancai@quicinc.com Signed-off-by: Qian Cai Reported-by: Daniel Thompson Reviewed-by: Daniel Thompson Cc: Kees Cook Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 029c4628b2eb2ca969e9bf979b05dc18d8d5575e Author: Guo Ziliang Date: Wed Mar 16 16:15:03 2022 -0700 mm: swap: get rid of livelock in swapin readahead In our testing, a livelock task was found. Through sysrq printing, same stack was found every time, as follows: __swap_duplicate+0x58/0x1a0 swapcache_prepare+0x24/0x30 __read_swap_cache_async+0xac/0x220 read_swap_cache_async+0x58/0xa0 swapin_readahead+0x24c/0x628 do_swap_page+0x374/0x8a0 __handle_mm_fault+0x598/0xd60 handle_mm_fault+0x114/0x200 do_page_fault+0x148/0x4d0 do_translation_fault+0xb0/0xd4 do_mem_abort+0x50/0xb0 The reason for the livelock is that swapcache_prepare() always returns EEXIST, indicating that SWAP_HAS_CACHE has not been cleared, so that it cannot jump out of the loop. We suspect that the task that clears the SWAP_HAS_CACHE flag never gets a chance to run. We try to lower the priority of the task stuck in a livelock so that the task that clears the SWAP_HAS_CACHE flag will run. The results show that the system returns to normal after the priority is lowered. In our testing, multiple real-time tasks are bound to the same core, and the task in the livelock is the highest priority task of the core, so the livelocked task cannot be preempted. Although cond_resched() is used by __read_swap_cache_async, it is an empty function in the preemptive system and cannot achieve the purpose of releasing the CPU. A high-priority task cannot release the CPU unless preempted by a higher-priority task. But when this task is already the highest priority task on this core, other tasks will not be able to be scheduled. So we think we should replace cond_resched() with schedule_timeout_uninterruptible(1), schedule_timeout_interruptible will call set_current_state first to set the task state, so the task will be removed from the running queue, so as to achieve the purpose of giving up the CPU and prevent it from running in kernel mode for too long. (akpm: ugly hack becomes uglier. But it fixes the issue in a backportable-to-stable fashion while we hopefully work on something better) Link: https://lkml.kernel.org/r/20220221111749.1928222-1-cgel.zte@gmail.com Signed-off-by: Guo Ziliang Reported-by: Zeal Robot Reviewed-by: Ran Xiaokai Reviewed-by: Jiang Xuexin Reviewed-by: Yang Yang Acked-by: Hugh Dickins Cc: Naoya Horiguchi Cc: Michal Hocko Cc: Minchan Kim Cc: Johannes Weiner Cc: Roger Quadros Cc: Ziliang Guo Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b04683ff8f0823b869c219c78ba0d974bddea0b5 Author: Ivan Vecera Date: Thu Mar 17 11:45:24 2022 +0100 iavf: Fix hang during reboot/shutdown Recent commit 974578017fc1 ("iavf: Add waiting so the port is initialized in remove") adds a wait-loop at the beginning of iavf_remove() to ensure that port initialization is finished prior unregistering net device. This causes a regression in reboot/shutdown scenario because in this case callback iavf_shutdown() is called and this callback detaches the device, makes it down if it is running and sets its state to __IAVF_REMOVE. Later shutdown callback of associated PF driver (e.g. ice_shutdown) is called. That callback calls among other things sriov_disable() that calls indirectly iavf_remove() (see stack trace below). As the adapter state is already __IAVF_REMOVE then the mentioned loop is end-less and shutdown process hangs. The patch fixes this by checking adapter's state at the beginning of iavf_remove() and skips the rest of the function if the adapter is already in remove state (shutdown is in progress). Reproducer: 1. Create VF on PF driven by ice or i40e driver 2. Ensure that the VF is bound to iavf driver 3. Reboot [52625.981294] sysrq: SysRq : Show Blocked State [52625.988377] task:reboot state:D stack: 0 pid:17359 ppid: 1 f2 [52625.996732] Call Trace: [52625.999187] __schedule+0x2d1/0x830 [52626.007400] schedule+0x35/0xa0 [52626.010545] schedule_hrtimeout_range_clock+0x83/0x100 [52626.020046] usleep_range+0x5b/0x80 [52626.023540] iavf_remove+0x63/0x5b0 [iavf] [52626.027645] pci_device_remove+0x3b/0xc0 [52626.031572] device_release_driver_internal+0x103/0x1f0 [52626.036805] pci_stop_bus_device+0x72/0xa0 [52626.040904] pci_stop_and_remove_bus_device+0xe/0x20 [52626.045870] pci_iov_remove_virtfn+0xba/0x120 [52626.050232] sriov_disable+0x2f/0xe0 [52626.053813] ice_free_vfs+0x7c/0x340 [ice] [52626.057946] ice_remove+0x220/0x240 [ice] [52626.061967] ice_shutdown+0x16/0x50 [ice] [52626.065987] pci_device_shutdown+0x34/0x60 [52626.070086] device_shutdown+0x165/0x1c5 [52626.074011] kernel_restart+0xe/0x30 [52626.077593] __do_sys_reboot+0x1d2/0x210 [52626.093815] do_syscall_64+0x5b/0x1a0 [52626.097483] entry_SYSCALL_64_after_hwframe+0x65/0xca Fixes: 974578017fc1 ("iavf: Add waiting so the port is initialized in remove") Signed-off-by: Ivan Vecera Link: https://lore.kernel.org/r/20220317104524.2802848-1-ivecera@redhat.com Signed-off-by: Jakub Kicinski commit 8e0341aefcc9133f3f48683873284b169581315b Author: Vladimir Oltean Date: Wed Mar 16 21:21:17 2022 +0200 net: mscc: ocelot: fix backwards compatibility with single-chain tc-flower offload ACL rules can be offloaded to VCAP IS2 either through chain 0, or, since the blamed commit, through a chain index whose number encodes a specific PAG (Policy Action Group) and lookup number. The chain number is translated through ocelot_chain_to_pag() into a PAG, and through ocelot_chain_to_lookup() into a lookup number. The problem with the blamed commit is that the above 2 functions don't have special treatment for chain 0. So ocelot_chain_to_pag(0) returns filter->pag = 224, which is in fact -32, but the "pag" field is an u8. So we end up programming the hardware with VCAP IS2 entries having a PAG of 224. But the way in which the PAG works is that it defines a subset of VCAP IS2 filters which should match on a packet. The default PAG is 0, and previous VCAP IS1 rules (which we offload using 'goto') can modify it. So basically, we are installing filters with a PAG on which no packet will ever match. This is the hardware equivalent of adding filters to a chain which has no 'goto' to it. Restore the previous functionality by making ACL filters offloaded to chain 0 go to PAG 0 and lookup number 0. The choice of PAG is clearly correct, but the choice of lookup number isn't "as before" (which was to leave the lookup a "don't care"). However, lookup 0 should be fine, since even though there are ACL actions (policers) which have a requirement to be used in a specific lookup, that lookup is 0. Fixes: 226e9cd82a96 ("net: mscc: ocelot: only install TCAM entries into a specific lookup and PAG") Signed-off-by: Vladimir Oltean Link: https://lore.kernel.org/r/20220316192117.2568261-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 0f643c88c8d240eba0ea25c2e095a46515ff46e9 Author: Doug Berger Date: Wed Mar 16 18:28:12 2022 -0700 net: bcmgenet: skip invalid partial checksums The RXCHK block will return a partial checksum of 0 if it encounters a problem while receiving a packet. Since a 1's complement sum can only produce this result if no bits are set in the received data stream it is fair to treat it as an invalid partial checksum and not pass it up the stack. Fixes: 810155397890 ("net: bcmgenet: use CHECKSUM_COMPLETE for NETIF_F_RXCSUM") Signed-off-by: Doug Berger Acked-by: Florian Fainelli Link: https://lore.kernel.org/r/20220317012812.1313196-1-opendmb@gmail.com Signed-off-by: Jakub Kicinski commit 424e7834e293936a54fcf05173f2884171adc5a3 Author: Manish Chopra Date: Wed Mar 16 14:46:13 2022 -0700 bnx2x: fix built-in kernel driver load failure Commit b7a49f73059f ("bnx2x: Utilize firmware 7.13.21.0") added request_firmware() logic in probe() which caused load failure when firmware file is not present in initrd (below), as access to firmware file is not feasible during probe. Direct firmware load for bnx2x/bnx2x-e2-7.13.15.0.fw failed with error -2 Direct firmware load for bnx2x/bnx2x-e2-7.13.21.0.fw failed with error -2 This patch fixes this issue by - 1. Removing request_firmware() logic from the probe() such that .ndo_open() handle it as it used to handle it earlier 2. Given request_firmware() is removed from probe(), so driver has to relax FW version comparisons a bit against the already loaded FW version (by some other PFs of same adapter) to allow different compatible/close enough FWs with which multiple PFs may run with (in different environments), as the given PF who is in probe flow has no idea now with which firmware file version it is going to initialize the device in ndo_open() Link: https://lore.kernel.org/all/46f2d9d9-ae7f-b332-ddeb-b59802be2bab@molgen.mpg.de/ Reported-by: Paul Menzel Tested-by: Paul Menzel Fixes: b7a49f73059f ("bnx2x: Utilize firmware 7.13.21.0") Signed-off-by: Manish Chopra Signed-off-by: Ariel Elior Link: https://lore.kernel.org/r/20220316214613.6884-1-manishc@marvell.com Signed-off-by: Jakub Kicinski commit f1858c277ba40172005b76a31e6bb931bfc19d9c Author: Juerg Haefliger Date: Wed Mar 16 16:18:35 2022 +0100 net: phy: mscc: Add MODULE_FIRMWARE macros The driver requires firmware so define MODULE_FIRMWARE so that modinfo provides the details. Fixes: fa164e40c53b ("net: phy: mscc: split the driver into separate files") Signed-off-by: Juerg Haefliger Link: https://lore.kernel.org/r/20220316151835.88765-1-juergh@canonical.com Signed-off-by: Jakub Kicinski commit cb0b430b4e3acc88c85e0ad2e25f2a25a5765262 Author: Miaoqian Lin Date: Wed Mar 16 08:26:02 2022 +0000 net: dsa: Add missing of_node_put() in dsa_port_parse_of The device_node pointer is returned by of_parse_phandle() with refcount incremented. We should use of_node_put() on it when done. Fixes: 6d4e5c570c2d ("net: dsa: get port type at parse time") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220316082602.10785-1-linmq006@gmail.com Signed-off-by: Paolo Abeni commit 3c3384050d68570f9de0fec9e58824decfefba7a Author: Thomas Zimmermann Date: Tue Mar 15 09:45:59 2022 +0100 drm: Don't make DRM_PANEL_BRIDGE dependent on DRM_KMS_HELPERS Fix a number of undefined references to drm_kms_helper.ko in drm_dp_helper.ko: arm-suse-linux-gnueabi-ld: drivers/gpu/drm/dp/drm_dp_mst_topology.o: in function `drm_dp_mst_duplicate_state': drm_dp_mst_topology.c:(.text+0x2df0): undefined reference to `__drm_atomic_helper_private_obj_duplicate_state' arm-suse-linux-gnueabi-ld: drivers/gpu/drm/dp/drm_dp_mst_topology.o: in function `drm_dp_delayed_destroy_work': drm_dp_mst_topology.c:(.text+0x370c): undefined reference to `drm_kms_helper_hotplug_event' arm-suse-linux-gnueabi-ld: drivers/gpu/drm/dp/drm_dp_mst_topology.o: in function `drm_dp_mst_up_req_work': drm_dp_mst_topology.c:(.text+0x7938): undefined reference to `drm_kms_helper_hotplug_event' arm-suse-linux-gnueabi-ld: drivers/gpu/drm/dp/drm_dp_mst_topology.o: in function `drm_dp_mst_link_probe_work': drm_dp_mst_topology.c:(.text+0x82e0): undefined reference to `drm_kms_helper_hotplug_event' This happens if panel-edp.ko has been configured with DRM_PANEL_EDP=y DRM_DP_HELPER=y DRM_KMS_HELPER=m which builds DP helpers into the kernel and KMS helpers sa a module. Making DRM_PANEL_EDP select DRM_KMS_HELPER resolves this problem. To avoid a resulting cyclic dependency with DRM_PANEL_BRIDGE, don't make the latter depend on DRM_KMS_HELPER and fix the one DRM bridge drivers that doesn't already select DRM_KMS_HELPER. As KMS helpers cannot be selected directly by the user, config symbols should avoid depending on it anyway. Signed-off-by: Thomas Zimmermann Fixes: 3755d35ee1d2 ("drm/panel: Select DRM_DP_HELPER for DRM_PANEL_EDP") Acked-by: Sam Ravnborg Tested-by: Brian Masney Reported-by: kernel test robot Cc: Thomas Zimmermann Cc: Naresh Kamboju Cc: Linux Kernel Functional Testing Cc: Lyude Paul Cc: Sam Ravnborg Cc: Daniel Vetter Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: dri-devel@lists.freedesktop.org Cc: Dave Airlie Cc: Thierry Reding Link: https://patchwork.freedesktop.org/patch/478296/ commit a8253684eb4b30abd3faf055bc475c23da748dc6 Merge: fc1b6ef7bfb3d 09688c0166e76 Author: Thomas Zimmermann Date: Thu Mar 17 11:03:28 2022 +0100 Merge drm/drm-fixes into drm-misc-fixes Backmerging drm/drm-fixes for commit 3755d35ee1d2 ("drm/panel: Select DRM_DP_HELPER for DRM_PANEL_EDP"). Signed-off-by: Thomas Zimmermann commit e3ee9fb22652f228225c352bd4fabec330cac5f0 Author: Steve French Date: Wed Mar 16 22:08:43 2022 -0500 smb3: fix incorrect session setup check for multiuser mounts A recent change to how the SMB3 server (socket) and session status is managed regressed multiuser mounts by changing the check for whether session setup is needed to the socket (TCP_Server_info) structure instead of the session struct (cifs_ses). Add additional check in cifs_setup_sesion to fix this. Fixes: 73f9bfbe3d81 ("cifs: maintain a state machine for tcp/smb/tcon sessions") Reported-by: Ronnie Sahlberg Acked-by: Ronnie Sahlberg Reviewed-by: Shyam Prasad N Signed-off-by: Steve French commit 4ee06de7729d795773145692e246a06448b1eb7a Author: Nicolas Dichtel Date: Tue Mar 15 10:20:08 2022 +0100 net: handle ARPHRD_PIMREG in dev_is_mac_header_xmit() This kind of interface doesn't have a mac header. This patch fixes bpf_redirect() to a PIM interface. Fixes: 27b29f63058d ("bpf: add bpf_redirect() helper") Signed-off-by: Nicolas Dichtel Link: https://lore.kernel.org/r/20220315092008.31423-1-nicolas.dichtel@6wind.com Signed-off-by: Jakub Kicinski commit a46310bfae94cfadf3d28a4d97b71e3e4dcc954c Merge: d34c58247f73c 9feaf8b387ee0 Author: Linus Torvalds Date: Wed Mar 16 11:57:46 2022 -0700 Merge tag 'efi-urgent-for-v5.17-3' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi Pull EFI fix from Ard Biesheuvel: "Avoid spurious warnings about unknown boot parameters" * tag 'efi-urgent-for-v5.17-3' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi: efi: fix return value of __setup handlers commit d34c58247f73c5358ceae1ae648fb9daa408ef23 Merge: 56e337f2cf132 a680b1832ced3 Author: Linus Torvalds Date: Wed Mar 16 11:50:35 2022 -0700 Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 Pull crypto fix from Herbert Xu: "This fixes a bug where qcom-rng can return a buffer that is not completely filled with random data" * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: qcom-rng - ensure buffer for generate is completely filled commit 1447c635802fd0f5e213ad5277753108d56a4db3 Author: Vladimir Oltean Date: Tue Dec 14 15:58:52 2021 +0200 Revert "arm64: dts: freescale: Fix 'interrupt-map' parent address cells" This reverts commit 869f0ec048dc8fd88c0b2003373bd985795179fb. That updated the expected device tree binding format for the ls-extirq driver, without also updating the parsing code (ls_extirq_parse_map) to the new format. The context is that the ls-extirq driver uses the standard "interrupt-map" OF property in a non-standard way, as suggested by Rob Herring during review: https://lore.kernel.org/lkml/20190927161118.GA19333@bogus/ This has turned out to be problematic, as Marc Zyngier discovered through commit 041284181226 ("of/irq: Allow matching of an interrupt-map local to an interrupt controller"), later fixed through commit de4adddcbcc2 ("of/irq: Add a quirk for controllers with their own definition of interrupt-map"). Marc's position, expressed on multiple opportunities, is that: (a) [ making private use of the reserved "interrupt-map" name in a driver ] "is wrong, by the very letter of what an interrupt-map means. If the interrupt map points to an interrupt controller, that's the target for the interrupt." https://lore.kernel.org/lkml/87k0g8jlmg.wl-maz@kernel.org/ (b) [ updating the driver's bindings to accept a non-reserved name for this property, as an alternative, is ] "is totally pointless. These machines have been in the wild for years, and existing DTs will be there *forever*." https://lore.kernel.org/lkml/87ilvrk1r0.wl-maz@kernel.org/ Considering the above, the Linux kernel has quirks in place to deal with the ls-extirq's non-standard use of the "interrupt-map". These quirks may be needed in other operating systems that consume this device tree, yet this is seen as the only viable solution. Therefore, the premise of the patch being reverted here is invalid. It doesn't matter whether the driver, in its non-standard use of the property, complies to the standard format or not, since this property isn't expected to be used for interrupt translation by the core. This change restores LS1088A, LS2088A/LS2085A and LX2160A to their previous bindings, which allows these systems to continue to use external interrupt lines with the correct polarity. Fixes: 869f0ec048dc ("arm64: dts: freescale: Fix 'interrupt-map' parent address cells") Signed-off-by: Vladimir Oltean Acked-by: Marc Zyngier Signed-off-by: Arnd Bergmann commit 186abea8a80b7699a05bbe6cbd661d64f887e1a0 Merge: 1bbdcbaeda445 4db4075f92af2 Author: Jakub Kicinski Date: Wed Mar 16 11:39:36 2022 -0700 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec Steffen Klassert says: ==================== pull request (net): ipsec 2022-03-16 1) Fix a kernel-info-leak in pfkey. From Haimin Zhang. 2) Fix an incorrect check of the return value of ipv6_skip_exthdr. From Sabrina Dubroca. * 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec: esp6: fix check on ipv6_skip_exthdr's return value af_key: add __GFP_ZERO flag for compose_sadb_supported in function pfkey_register ==================== Link: https://lore.kernel.org/r/20220316121142.3142336-1-steffen.klassert@secunet.com Signed-off-by: Jakub Kicinski commit 1bbdcbaeda445c76ca05f5d822c26fc7268c1ff5 Merge: dea2d93a8ba43 45b4eb7ee6aa1 Author: Jakub Kicinski Date: Wed Mar 16 11:08:09 2022 -0700 Merge tag 'wireless-2022-03-16' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless Kalle Valo says: ==================== wireless fixes for v5.17 Third set of fixes for v5.17. We have only one revert to fix an ath10k regression. * tag 'wireless-2022-03-16' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless: Revert "ath10k: drop beacon and probe response which leak from other channel" ==================== Link: https://lore.kernel.org/r/20220316130249.B5225C340EC@smtp.kernel.org Signed-off-by: Jakub Kicinski commit fc1b6ef7bfb3d1d4df868b1c3e0480cacda6cd81 Author: Marek Vasut Date: Sun Feb 20 05:07:18 2022 +0100 drm/panel: simple: Fix Innolux G070Y2-L01 BPP settings The Innolux G070Y2-L01 supports two modes of operation: 1) FRC=Low/NC ... MEDIA_BUS_FMT_RGB666_1X7X3_SPWG ... BPP=6 2) FRC=High ..... MEDIA_BUS_FMT_RGB888_1X7X4_SPWG ... BPP=8 Currently the panel description mixes both, BPP from 1) and bus format from 2), which triggers a warning at panel-simple.c:615. Pick the later, set bpp=8, fix the warning. Fixes: a5d2ade627dca ("drm/panel: simple: Add support for Innolux G070Y2-L01") Signed-off-by: Marek Vasut Cc: Christoph Fritz Cc: Laurent Pinchart Cc: Maxime Ripard Cc: Sam Ravnborg Cc: Thomas Zimmermann Reviewed-by: Laurent Pinchart Link: https://patchwork.freedesktop.org/patch/msgid/20220220040718.532866-1-marex@denx.de Signed-off-by: Maarten Lankhorst commit 6061806a863e8b65b109eb06a280041cc7525442 Author: Christoph Niedermaier Date: Tue Feb 1 12:36:43 2022 +0100 drm/imx: parallel-display: Remove bus flags check in imx_pd_bridge_atomic_check() If display timings were read from the devicetree using of_get_display_timing() and pixelclk-active is defined there, the flag DISPLAY_FLAGS_SYNC_POSEDGE/NEGEDGE is automatically generated. Through the function drm_bus_flags_from_videomode() e.g. called in the panel-simple driver this flag got into the bus flags, but then in imx_pd_bridge_atomic_check() the bus flag check failed and will not initialize the display. The original commit fe141cedc433 does not explain why this check was introduced. So remove the bus flags check, because it stops the initialization of the display with valid bus flags. Fixes: fe141cedc433 ("drm/imx: pd: Use bus format/flags provided by the bridge when available") Signed-off-by: Christoph Niedermaier Cc: Marek Vasut Cc: Boris Brezillon Cc: Philipp Zabel Cc: David Airlie Cc: Daniel Vetter Cc: Shawn Guo Cc: Sascha Hauer Cc: Pengutronix Kernel Team Cc: Fabio Estevam Cc: NXP Linux Team Cc: linux-arm-kernel@lists.infradead.org To: dri-devel@lists.freedesktop.org Tested-by: Max Krummenacher Acked-by: Boris Brezillon Signed-off-by: Marek Vasut Link: https://patchwork.freedesktop.org/patch/msgid/20220201113643.4638-1-cniedermaier@dh-electronics.com Signed-off-by: Maarten Lankhorst commit f6189589fa7cc4fb6b53f2929f69f0505123202f Merge: daaca3522a8e6 0c48645a7f398 Author: Jens Axboe Date: Wed Mar 16 05:43:25 2022 -0600 Merge tag 'nvme-5.17-2022-03-16' of git://git.infradead.org/nvme into block-5.17 Pull NVMe fix from Christoph: "nvme fix for Linux 5.17 - last minute revert of a nvmet feature added in Linux 5.16 (Hannes Reinecke)" * tag 'nvme-5.17-2022-03-16' of git://git.infradead.org/nvme: nvmet: revert "nvmet: make discovery NQN configurable" commit 45b4eb7ee6aa1a55a50831b328aa5f46ac3a7187 Author: Kalle Valo Date: Tue Mar 15 17:54:55 2022 +0200 Revert "ath10k: drop beacon and probe response which leak from other channel" This reverts commit 3bf2537ec2e33310b431b53fd84be8833736c256. I was reported privately that this commit breaks AP and mesh mode on QCA9984 (firmware 10.4-3.9.0.2-00156). So revert the commit to fix the regression. There was a conflict due to cfg80211 API changes but that was easy to fix. Fixes: 3bf2537ec2e3 ("ath10k: drop beacon and probe response which leak from other channel") Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220315155455.20446-1-kvalo@kernel.org commit 462ccc35a750f335c8456cde9120b8b593fff60f Author: Rafael J. Wysocki Date: Wed Mar 16 11:23:05 2022 +0100 Revert "ACPI: scan: Do not add device IDs from _CID if _HID is not valid" Revert commit e38f9ff63e6d ("ACPI: scan: Do not add device IDs from _CID if _HID is not valid"), because it has introduced regressions on multiple systems, even though it only has effect on clearly invalid firmware. Reported-by: Pierre-Louis Bossart Signed-off-by: Rafael J. Wysocki commit dea2d93a8ba437460c5f21bdfa4ada57fa1d2179 Merge: 886e44c9298a6 16b2dd8cdf6f4 Author: David S. Miller Date: Wed Mar 16 10:07:43 2022 +0000 Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue ==================== Intel Wired LAN Driver Updates 2022-03-15 This series contains updates to ice and iavf drivers. Maciej adjusts null check logic on Tx ring to prevent possible NULL pointer dereference for ice. Sudheer moves destruction of Flow Director lock as it was being accessed after destruction for ice. Przemyslaw removes an excess mutex unlock as it was being double unlocked for iavf. ==================== Signed-off-by: David S. Miller commit 886e44c9298a6b428ae046e2fa092ca52e822e6a Author: Jiasheng Jiang Date: Mon Mar 14 10:01:25 2022 +0800 hv_netvsc: Add check for kvmalloc_array As the potential failure of the kvmalloc_array(), it should be better to check and restore the 'data' if fails in order to avoid the dereference of the NULL pointer. Fixes: 6ae746711263 ("hv_netvsc: Add per-cpu ethtool stats for netvsc") Signed-off-by: Jiasheng Jiang Link: https://lore.kernel.org/r/20220314020125.2365084-1-jiasheng@iscas.ac.cn Signed-off-by: Jakub Kicinski commit 16b2dd8cdf6f4e0597c34899de74b4d012b78188 Author: Przemyslaw Patynowski Date: Wed Mar 9 16:37:39 2022 +0100 iavf: Fix double free in iavf_reset_task Fix double free possibility in iavf_disable_vf, as crit_lock is freed in caller, iavf_reset_task. Add kernel-doc for iavf_disable_vf. Remove mutex_unlock in iavf_disable_vf. Without this patch there is double free scenario, when calling iavf_reset_task. Fixes: e85ff9c631e1 ("iavf: Fix deadlock in iavf_reset_task") Signed-off-by: Przemyslaw Patynowski Suggested-by: Dan Carpenter Signed-off-by: Mateusz Palczewski Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit 1b4ae7d925c6569fff27313b4d84171b11510893 Author: Sudheer Mogilappagari Date: Thu Mar 10 10:46:52 2022 -0800 ice: destroy flow director filter mutex after releasing VSIs Currently fdir_fltr_lock is accessed in ice_vsi_release_all() function after it is destroyed. Instead destroy mutex after ice_vsi_release_all. Fixes: 40319796b732 ("ice: Add flow director support for channel mode") Signed-off-by: Sudheer Mogilappagari Tested-by: Bharathi Sreenivas Signed-off-by: Tony Nguyen commit f153546913bada41a811722f2c6d17c3243a0333 Author: Maciej Fijalkowski Date: Mon Mar 7 18:47:39 2022 +0100 ice: fix NULL pointer dereference in ice_update_vsi_tx_ring_stats() It is possible to do NULL pointer dereference in routine that updates Tx ring stats. Currently only stats and bytes are updated when ring pointer is valid, but later on ring is accessed to propagate gathered Tx stats onto VSI stats. Change the existing logic to move to next ring when ring is NULL. Fixes: e72bba21355d ("ice: split ice_ring onto Tx/Rx separate structs") Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Maciej Fijalkowski Acked-by: Alexander Lobakin Tested-by: Gurucharan G (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit e9c14b59ea2ec19afe22d60b07583b7e08c74290 Author: Jakub Kicinski Date: Mon Mar 14 15:28:19 2022 -0700 Add Paolo Abeni to networking maintainers Growing the network maintainers team from 2 to 3. Signed-off-by: David S. Miller Link: https://lore.kernel.org/r/20220314222819.958428-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 01b44ef2bf6bc83df8a4703029fd611fbfc31c60 Author: Uwe Kleine-König Date: Thu Mar 10 19:18:09 2022 -0500 counter: Stop using dev_get_drvdata() to get the counter device dev_get_drvdata() returns NULL since commit b56346ddbd82 ("counter: Use container_of instead of drvdata to track counter_device") which wrongly claimed there were no users of drvdata. Convert to container_of() to fix a null pointer dereference. Reported-by: Oleksij Rempel Fixes: b56346ddbd82 ("counter: Use container_of instead of drvdata to track counter_device") Signed-off-by: Uwe Kleine-König Tested-by: Jarkko Nikula Link: https://lore.kernel.org/all/20220204082556.370348-1-u.kleine-koenig@pengutronix.de/ Signed-off-by: William Breathitt Gray Link: https://lore.kernel.org/r/4a14311a3b935b62b33e665a97ecaaf2f078228a.1646957732.git.vilhelm.gray@gmail.com Signed-off-by: Greg Kroah-Hartman commit 733ab7e1b5d1041204c4ca7373f6e6f9d08e3283 Author: David Jeffery Date: Fri Mar 11 13:43:59 2022 -0500 scsi: fnic: Finish scsi_cmnd before dropping the spinlock When aborting a SCSI command through fnic, there is a race with the fnic interrupt handler which can result in the SCSI command and its request being completed twice. If the interrupt handler claims the command by setting CMD_SP to NULL first, the abort handler assumes the interrupt handler has completed the command and returns SUCCESS, causing the request for the scsi_cmnd to be re-queued. But the interrupt handler may not have finished the command yet. After it drops the spinlock protecting CMD_SP, it does memory cleanup before finally calling scsi_done() to complete the scsi_cmnd. If the call to scsi_done occurs after the abort handler finishes and re-queues the request, the completion of the scsi_cmnd will advance and try to double complete a request already queued for retry. This patch fixes the issue by moving scsi_done() and any other use of scsi_cmnd to before the spinlock is released by the interrupt handler. Link: https://lore.kernel.org/r/20220311184359.2345319-1-djeffery@redhat.com Reviewed-by: Laurence Oberman Reviewed-by: Ming Lei Signed-off-by: David Jeffery Signed-off-by: Martin K. Petersen commit 16b1941eac2bd499f065a6739a40ce0011a3d740 Author: Alan Stern Date: Sat Mar 5 21:47:22 2022 -0500 usb: gadget: Fix use-after-free bug by not setting udc->dev.driver The syzbot fuzzer found a use-after-free bug: BUG: KASAN: use-after-free in dev_uevent+0x712/0x780 drivers/base/core.c:2320 Read of size 8 at addr ffff88802b934098 by task udevd/3689 CPU: 2 PID: 3689 Comm: udevd Not tainted 5.17.0-rc4-syzkaller-00229-g4f12b742eb2b #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0x8d/0x303 mm/kasan/report.c:255 __kasan_report mm/kasan/report.c:442 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:459 dev_uevent+0x712/0x780 drivers/base/core.c:2320 uevent_show+0x1b8/0x380 drivers/base/core.c:2391 dev_attr_show+0x4b/0x90 drivers/base/core.c:2094 Although the bug manifested in the driver core, the real cause was a race with the gadget core. dev_uevent() does: if (dev->driver) add_uevent_var(env, "DRIVER=%s", dev->driver->name); and between the test and the dereference of dev->driver, the gadget core sets dev->driver to NULL. The race wouldn't occur if the gadget core registered its devices on a real bus, using the standard synchronization techniques of the driver core. However, it's not necessary to make such a large change in order to fix this bug; all we need to do is make sure that udc->dev.driver is always NULL. In fact, there is no reason for udc->dev.driver ever to be set to anything, let alone to the value it currently gets: the address of the gadget's driver. After all, a gadget driver only knows how to manage a gadget, not how to manage a UDC. This patch simply removes the statements in the gadget core that touch udc->dev.driver. Fixes: 2ccea03a8f7e ("usb: gadget: introduce UDC Class") CC: Reported-and-tested-by: syzbot+348b571beb5eeb70a582@syzkaller.appspotmail.com Signed-off-by: Alan Stern Link: https://lore.kernel.org/r/YiQgukfFFbBnwJ/9@rowland.harvard.edu Signed-off-by: Greg Kroah-Hartman commit e9b667a82cdcfe21d590344447d65daed52b353b Author: Alan Stern Date: Thu Mar 3 16:00:17 2022 -0500 usb: usbtmc: Fix bug in pipe direction for control transfers The syzbot fuzzer reported a minor bug in the usbtmc driver: usb 5-1: BOGUS control dir, pipe 80001e80 doesn't match bRequestType 0 WARNING: CPU: 0 PID: 3813 at drivers/usb/core/urb.c:412 usb_submit_urb+0x13a5/0x1970 drivers/usb/core/urb.c:410 Modules linked in: CPU: 0 PID: 3813 Comm: syz-executor122 Not tainted 5.17.0-rc5-syzkaller-00306-g2293be58d6a1 #0 ... Call Trace: usb_start_wait_urb+0x113/0x530 drivers/usb/core/message.c:58 usb_internal_control_msg drivers/usb/core/message.c:102 [inline] usb_control_msg+0x2a5/0x4b0 drivers/usb/core/message.c:153 usbtmc_ioctl_request drivers/usb/class/usbtmc.c:1947 [inline] The problem is that usbtmc_ioctl_request() uses usb_rcvctrlpipe() for all of its transfers, whether they are in or out. It's easy to fix. CC: Reported-and-tested-by: syzbot+a48e3d1a875240cab5de@syzkaller.appspotmail.com Signed-off-by: Alan Stern Link: https://lore.kernel.org/r/YiEsYTPEE6lOCOA5@rowland.harvard.edu Signed-off-by: Greg Kroah-Hartman commit 56e337f2cf1326323844927a04e9dbce9a244835 Author: Bartosz Golaszewski Date: Tue Mar 15 17:52:05 2022 +0100 Revert "gpio: Revert regression in sysfs-gpio (gpiolib.c)" This reverts commit fc328a7d1fcce263db0b046917a66f3aa6e68719. This commit - while attempting to fix a regression - has caused a number of other problems. As the fallout from it is more significant than the initial problem itself, revert it for now before we find a correct solution. Link: https://lore.kernel.org/all/20220314192522.GA3031157@roeck-us.net/ Link: https://lore.kernel.org/stable/20220314155509.552218-1-michael@walle.cc/ Link: https://lore.kernel.org/all/20211217153555.9413-1-marcelo.jimenez@gmail.com/ Signed-off-by: Bartosz Golaszewski Reported-and-bisected-by: Guenter Roeck Reported-by: Michael Walle Cc: Thorsten Leemhuis Cc: Marcelo Roberto Jimenez Signed-off-by: Linus Torvalds commit 239071064732bc4a30308cbba11014aa1aab550a Author: H. Nikolaus Schaller Date: Tue Mar 8 13:56:06 2022 +0100 partially Revert "usb: musb: Set the DT node on the child device" This reverts the omap2430 changes of commit cf081d009c44 ("usb: musb: Set the DT node on the child device") Since v5.17-rc1, musb is broken on the gta04 and openpandora devices (omap3530/dm3730). BeagleBone Black (am335x) seems to work. Symptoms of this bug are a) main symptom [ 21.336517] using random host ethernet address [ 21.341430] using host ethernet address: 32:70:05:18:ff:78 [ 21.341461] using self ethernet address: 46:10:3a:b3:af:d9 [ 21.358184] usb0: HOST MAC 32:70:05:18:ff:78 [ 21.376678] usb0: MAC 46:10:3a:b3:af:d9 [ 21.388305] using random self ethernet address [ 21.393371] using random host ethernet address [ 21.398162] g_ether gadget: Ethernet Gadget, version: Memorial Day 2008 [ 21.421081] g_ether gadget: g_ether ready [ 21.492156] musb-hdrc musb-hdrc.1.auto: Could not enable: -22 [ 21.691345] musb-hdrc musb-hdrc.1.auto: Could not enable: -22 [ 21.803192] musb-hdrc musb-hdrc.1.auto: Could not enable: -22 [ 21.819427] musb-hdrc musb-hdrc.1.auto: Could not enable: -22 [ 22.124450] musb-hdrc musb-hdrc.1.auto: Could not enable: -22 [ 22.168518] musb-hdrc musb-hdrc.1.auto: Could not enable: -22 [ 22.179382] musb-hdrc musb-hdrc.1.auto: Could not enable: -22 [ 23.213592] musb-hdrc musb-hdrc.1.auto: pm runtime get failed in musb_gadget_queue [ 23.221832] musb-hdrc musb-hdrc.1.auto: Could not enable: -22 [ 23.227905] musb-hdrc musb-hdrc.1.auto: Could not enable: -22 [ 23.239440] musb-hdrc musb-hdrc.1.auto: Could not enable: -22 [ 23.401000] musb-hdrc musb-hdrc.1.auto: Could not enable: -22 [ 23.407073] musb-hdrc musb-hdrc.1.auto: Could not enable: -22 [ 23.426361] musb-hdrc musb-hdrc.1.auto: Could not enable: -22 [ 23.734466] musb-hdrc musb-hdrc.1.auto: pm runtime get failed in musb_gadget_queue [ 23.742462] musb-hdrc musb-hdrc.1.auto: pm runtime get failed in musb_gadget_queue [ 23.750396] musb-hdrc musb-hdrc.1.auto: pm runtime get failed in musb_gadget_queue ... (repeats with high frequency) This stops if the USB cable is unplugged and restarts if it is plugged in again. b) also found in the log [ 6.498107] ------------[ cut here ]------------ [ 6.502960] WARNING: CPU: 0 PID: 868 at arch/arm/mach-omap2/omap_hwmod.c:1885 _enable+0x50/0x234 [ 6.512207] omap_hwmod: usb_otg_hs: enabled state can only be entered from initialized, idle, or disabled state [ 6.522766] Modules linked in: omap2430(+) bmp280_i2c bmp280 itg3200 at24 tsc2007 leds_tca6507 bma180 hmc5843_i2c hmc5843_core industrialio_triggered_buffer lis3lv02d_i2c kfifo_buf lis3lv02d phy_twl4030_usb snd_soc_omap_mcbsp snd_soc_ti_sdma musb_hdrc snd_soc_twl4030 gnss_sirf twl4030_vibra twl4030_madc twl4030_charger twl4030_pwrbutton gnss industrialio ehci_omap omapdrm drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops drm drm_panel_orientation_quirks cec [ 6.566436] CPU: 0 PID: 868 Comm: udevd Not tainted 5.16.0-rc5-letux+ #8251 [ 6.573730] Hardware name: Generic OMAP36xx (Flattened Device Tree) [ 6.580322] [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [ 6.588470] [] (show_stack) from [] (dump_stack_lvl+0x40/0x4c) [ 6.596405] [] (dump_stack_lvl) from [] (__warn+0xb4/0xdc) [ 6.604003] [] (__warn) from [] (warn_slowpath_fmt+0x70/0x9c) [ 6.611846] [] (warn_slowpath_fmt) from [] (_enable+0x50/0x234) [ 6.619903] [] (_enable) from [] (omap_hwmod_enable+0x28/0x40) [ 6.627838] [] (omap_hwmod_enable) from [] (omap_device_enable+0x4c/0x78) [ 6.636779] [] (omap_device_enable) from [] (_od_runtime_resume+0x10/0x3c) [ 6.645812] [] (_od_runtime_resume) from [] (__rpm_callback+0x3c/0xf4) [ 6.654510] [] (__rpm_callback) from [] (rpm_callback+0x50/0x54) [ 6.662628] [] (rpm_callback) from [] (rpm_resume+0x448/0x4e4) [ 6.670593] [] (rpm_resume) from [] (__pm_runtime_resume+0x38/0x50) [ 6.678985] [] (__pm_runtime_resume) from [] (musb_init_controller+0x350/0xa5c [musb_hdrc]) [ 6.689727] [] (musb_init_controller [musb_hdrc]) from [] (platform_probe+0x58/0xa8) [ 6.699737] [] (platform_probe) from [] (really_probe+0x170/0x2fc) [ 6.708068] [] (really_probe) from [] (__driver_probe_device+0xc4/0xd8) [ 6.716827] [] (__driver_probe_device) from [] (driver_probe_device+0x30/0xac) [ 6.726226] [] (driver_probe_device) from [] (__device_attach_driver+0x94/0xb4) [ 6.735717] [] (__device_attach_driver) from [] (bus_for_each_drv+0xa0/0xb4) [ 6.744934] [] (bus_for_each_drv) from [] (__device_attach+0xc0/0x134) [ 6.753631] [] (__device_attach) from [] (bus_probe_device+0x28/0x80) [ 6.762207] [] (bus_probe_device) from [] (device_add+0x5fc/0x788) [ 6.770507] [] (device_add) from [] (platform_device_add+0x70/0x1bc) [ 6.779022] [] (platform_device_add) from [] (omap2430_probe+0x260/0x2d4 [omap2430]) [ 6.789001] [] (omap2430_probe [omap2430]) from [] (platform_probe+0x58/0xa8) [ 6.798309] [] (platform_probe) from [] (really_probe+0x170/0x2fc) [ 6.806610] [] (really_probe) from [] (__driver_probe_device+0xc4/0xd8) [ 6.815399] [] (__driver_probe_device) from [] (driver_probe_device+0x30/0xac) [ 6.824798] [] (driver_probe_device) from [] (__driver_attach+0xc4/0xd8) [ 6.833648] [] (__driver_attach) from [] (bus_for_each_dev+0x64/0xa0) [ 6.842224] [] (bus_for_each_dev) from [] (bus_add_driver+0x148/0x1a4) [ 6.850891] [] (bus_add_driver) from [] (driver_register+0xb4/0xf8) [ 6.859313] [] (driver_register) from [] (do_one_initcall+0x90/0x1c8) [ 6.867889] [] (do_one_initcall) from [] (do_init_module+0x4c/0x204) [ 6.876373] [] (do_init_module) from [] (load_module+0x13f0/0x1928) [ 6.884796] [] (load_module) from [] (sys_finit_module+0xa0/0xc0) [ 6.893005] [] (sys_finit_module) from [] (ret_fast_syscall+0x0/0x54) [ 6.901580] Exception stack(0xc2807fa8 to 0xc2807ff0) [ 6.906890] 7fa0: b6e517d4 00052068 00000006 b6e509f8 00000000 b6e5131c [ 6.915466] 7fc0: b6e517d4 00052068 cd718000 0000017b 00020000 00037f78 00050048 00063368 [ 6.924011] 7fe0: bed8fef0 bed8fee0 b6e4ac4b b6f55a42 [ 6.929321] ---[ end trace d715ff121b58763c ]--- c) git bisect result on testing for "musb-hdrc" in the console log: cf081d009c447647c6b36aced535ca427dbebe72 is the first bad commit commit cf081d009c447647c6b36aced535ca427dbebe72 Author: Rob Herring Date: Wed Dec 15 17:07:57 2021 -0600 usb: musb: Set the DT node on the child device The musb glue drivers just copy the glue resources to the musb child device. Instead, set the musb child device's DT node pointer to the parent device's node so that platform_get_irq_byname() can find the resources in the DT. This removes the need for statically populating the IRQ resources from the DT which has been deprecated for some time. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211215230756.2009115-3-robh@kernel.org Signed-off-by: Greg Kroah-Hartman drivers/usb/musb/am35x.c | 2 ++ drivers/usb/musb/da8xx.c | 2 ++ drivers/usb/musb/jz4740.c | 1 + drivers/usb/musb/mediatek.c | 2 ++ drivers/usb/musb/omap2430.c | 1 + drivers/usb/musb/ux500.c | 1 + 6 files changed, 9 insertions(+) Reverting this patch makes musb work again as before. Fixes: cf081d009c44 ("usb: musb: Set the DT node on the child device") Cc: Rob Herring Signed-off-by: H. Nikolaus Schaller Link: https://lore.kernel.org/r/f62f5fc11f9ecae7e57f3fd66939e051bd3b11fc.1646744166.git.hns@goldelico.com Signed-off-by: Greg Kroah-Hartman commit 65f3324f4b6fed78b8761c3b74615ecf0ffa81fa Author: Dan Carpenter Date: Tue Mar 1 11:04:24 2022 +0300 usb: gadget: rndis: prevent integer overflow in rndis_set_response() If "BufOffset" is very large the "BufOffset + 8" operation can have an integer overflow. Cc: stable@kernel.org Fixes: 38ea1eac7d88 ("usb: gadget: rndis: check size of RNDIS_MSG_SET command") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20220301080424.GA17208@kili Signed-off-by: Greg Kroah-Hartman commit 0f74b29a4f53627376cf5a5fb7b0b3fa748a0b2b Author: Jiasheng Jiang Date: Mon Mar 14 09:34:48 2022 +0800 atm: eni: Add check for dma_map_single As the potential failure of the dma_map_single(), it should be better to check it and return error if fails. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Jiasheng Jiang Signed-off-by: David S. Miller commit 0c48645a7f3988a624767d025fa3275ae24b6ca1 Author: Hannes Reinecke Date: Tue Mar 15 10:14:36 2022 +0100 nvmet: revert "nvmet: make discovery NQN configurable" Revert commit 626851e9225d ("nvmet: make discovery NQN configurable"); the interface was deemed incorrect and will be replaced with a different one. Fixes: 626851e9225d ("nvmet: make discovery NQN configurable") Signed-off-by: Hannes Reinecke Signed-off-by: Christoph Hellwig commit c700525fcc06b05adfea78039de02628af79e07a Author: Eric Dumazet Date: Sat Mar 12 15:29:58 2022 -0800 net/packet: fix slab-out-of-bounds access in packet_recvmsg() syzbot found that when an AF_PACKET socket is using PACKET_COPY_THRESH and mmap operations, tpacket_rcv() is queueing skbs with garbage in skb->cb[], triggering a too big copy [1] Presumably, users of af_packet using mmap() already gets correct metadata from the mapped buffer, we can simply make sure to clear 12 bytes that might be copied to user space later. BUG: KASAN: stack-out-of-bounds in memcpy include/linux/fortify-string.h:225 [inline] BUG: KASAN: stack-out-of-bounds in packet_recvmsg+0x56c/0x1150 net/packet/af_packet.c:3489 Write of size 165 at addr ffffc9000385fb78 by task syz-executor233/3631 CPU: 0 PID: 3631 Comm: syz-executor233 Not tainted 5.17.0-rc7-syzkaller-02396-g0b3660695e80 #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_address_description.constprop.0.cold+0xf/0x336 mm/kasan/report.c:255 __kasan_report mm/kasan/report.c:442 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:459 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0x13d/0x180 mm/kasan/generic.c:189 memcpy+0x39/0x60 mm/kasan/shadow.c:66 memcpy include/linux/fortify-string.h:225 [inline] packet_recvmsg+0x56c/0x1150 net/packet/af_packet.c:3489 sock_recvmsg_nosec net/socket.c:948 [inline] sock_recvmsg net/socket.c:966 [inline] sock_recvmsg net/socket.c:962 [inline] ____sys_recvmsg+0x2c4/0x600 net/socket.c:2632 ___sys_recvmsg+0x127/0x200 net/socket.c:2674 __sys_recvmsg+0xe2/0x1a0 net/socket.c:2704 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:0x7fdfd5954c29 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:00007ffcf8e71e48 EFLAGS: 00000246 ORIG_RAX: 000000000000002f RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007fdfd5954c29 RDX: 0000000000000000 RSI: 0000000020000500 RDI: 0000000000000005 RBP: 0000000000000000 R08: 000000000000000d R09: 000000000000000d R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffcf8e71e60 R13: 00000000000f4240 R14: 000000000000c1ff R15: 00007ffcf8e71e54 addr ffffc9000385fb78 is located in stack of task syz-executor233/3631 at offset 32 in frame: ____sys_recvmsg+0x0/0x600 include/linux/uio.h:246 this frame has 1 object: [32, 160) 'addr' Memory state around the buggy address: ffffc9000385fa80: 00 04 f3 f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 ffffc9000385fb00: 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 >ffffc9000385fb80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f3 ^ ffffc9000385fc00: f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 f1 ffffc9000385fc80: f1 f1 f1 00 f2 f2 f2 00 f2 f2 f2 00 00 00 00 00 ================================================================== Fixes: 0fb375fb9b93 ("[AF_PACKET]: Allow for > 8 byte hardware addresses.") Signed-off-by: Eric Dumazet Reported-by: syzbot Link: https://lore.kernel.org/r/20220312232958.3535620-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit 0f8946ae704ac6880c590beb91bc3a732595a28a Author: Michael Walle Date: Sat Mar 12 23:41:40 2022 +0100 net: mdio: mscc-miim: fix duplicate debugfs entry This driver can have up to two regmaps. If the second one is registered its debugfs entry will have the same name as the first one and the following error will be printed: [ 3.833521] debugfs: Directory 'e200413c.mdio' with parent 'regmap' already present! Give the second regmap a name to avoid this. Fixes: a27a76282837 ("net: mdio: mscc-miim: convert to a regmap implementation") Signed-off-by: Michael Walle Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220312224140.4173930-1-michael@walle.cc Signed-off-by: Jakub Kicinski commit 69ad4ef868c1fc7609daa235dfa46d28ba7a3ba3 Author: Matt Lupfer Date: Tue Mar 8 15:27:02 2022 +0000 scsi: mpt3sas: Page fault in reply q processing A page fault was encountered in mpt3sas on a LUN reset error path: [ 145.763216] mpt3sas_cm1: Task abort tm failed: handle(0x0002),timeout(30) tr_method(0x0) smid(3) msix_index(0) [ 145.778932] scsi 1:0:0:0: task abort: FAILED scmd(0x0000000024ba29a2) [ 145.817307] scsi 1:0:0:0: attempting device reset! scmd(0x0000000024ba29a2) [ 145.827253] scsi 1:0:0:0: [sg1] tag#2 CDB: Receive Diagnostic 1c 01 01 ff fc 00 [ 145.837617] scsi target1:0:0: handle(0x0002), sas_address(0x500605b0000272b9), phy(0) [ 145.848598] scsi target1:0:0: enclosure logical id(0x500605b0000272b8), slot(0) [ 149.858378] mpt3sas_cm1: Poll ReplyDescriptor queues for completion of smid(0), task_type(0x05), handle(0x0002) [ 149.875202] BUG: unable to handle page fault for address: 00000007fffc445d [ 149.885617] #PF: supervisor read access in kernel mode [ 149.894346] #PF: error_code(0x0000) - not-present page [ 149.903123] PGD 0 P4D 0 [ 149.909387] Oops: 0000 [#1] PREEMPT SMP NOPTI [ 149.917417] CPU: 24 PID: 3512 Comm: scsi_eh_1 Kdump: loaded Tainted: G S O 5.10.89-altav-1 #1 [ 149.934327] Hardware name: DDN 200NVX2 /200NVX2-MB , BIOS ATHG2.2.02.01 09/10/2021 [ 149.951871] RIP: 0010:_base_process_reply_queue+0x4b/0x900 [mpt3sas] [ 149.961889] Code: 0f 84 22 02 00 00 8d 48 01 49 89 fd 48 8d 57 38 f0 0f b1 4f 38 0f 85 d8 01 00 00 49 8b 45 10 45 31 e4 41 8b 55 0c 48 8d 1c d0 <0f> b6 03 83 e0 0f 3c 0f 0f 85 a2 00 00 00 e9 e6 01 00 00 0f b7 ee [ 149.991952] RSP: 0018:ffffc9000f1ebcb8 EFLAGS: 00010246 [ 150.000937] RAX: 0000000000000055 RBX: 00000007fffc445d RCX: 000000002548f071 [ 150.011841] RDX: 00000000ffff8881 RSI: 0000000000000001 RDI: ffff888125ed50d8 [ 150.022670] RBP: 0000000000000000 R08: 0000000000000000 R09: c0000000ffff7fff [ 150.033445] R10: ffffc9000f1ebb68 R11: ffffc9000f1ebb60 R12: 0000000000000000 [ 150.044204] R13: ffff888125ed50d8 R14: 0000000000000080 R15: 34cdc00034cdea80 [ 150.054963] FS: 0000000000000000(0000) GS:ffff88dfaf200000(0000) knlGS:0000000000000000 [ 150.066715] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 150.076078] CR2: 00000007fffc445d CR3: 000000012448a006 CR4: 0000000000770ee0 [ 150.086887] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 150.097670] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 150.108323] PKRU: 55555554 [ 150.114690] Call Trace: [ 150.120497] ? printk+0x48/0x4a [ 150.127049] mpt3sas_scsih_issue_tm.cold.114+0x2e/0x2b3 [mpt3sas] [ 150.136453] mpt3sas_scsih_issue_locked_tm+0x86/0xb0 [mpt3sas] [ 150.145759] scsih_dev_reset+0xea/0x300 [mpt3sas] [ 150.153891] scsi_eh_ready_devs+0x541/0x9e0 [scsi_mod] [ 150.162206] ? __scsi_host_match+0x20/0x20 [scsi_mod] [ 150.170406] ? scsi_try_target_reset+0x90/0x90 [scsi_mod] [ 150.178925] ? blk_mq_tagset_busy_iter+0x45/0x60 [ 150.186638] ? scsi_try_target_reset+0x90/0x90 [scsi_mod] [ 150.195087] scsi_error_handler+0x3a5/0x4a0 [scsi_mod] [ 150.203206] ? __schedule+0x1e9/0x610 [ 150.209783] ? scsi_eh_get_sense+0x210/0x210 [scsi_mod] [ 150.217924] kthread+0x12e/0x150 [ 150.224041] ? kthread_worker_fn+0x130/0x130 [ 150.231206] ret_from_fork+0x1f/0x30 This is caused by mpt3sas_base_sync_reply_irqs() using an invalid reply_q pointer outside of the list_for_each_entry() loop. At the end of the full list traversal the pointer is invalid. Move the _base_process_reply_queue() call inside of the loop. Link: https://lore.kernel.org/r/d625deae-a958-0ace-2ba3-0888dd0a415b@ddn.com Fixes: 711a923c14d9 ("scsi: mpt3sas: Postprocessing of target and LUN reset") Cc: stable@vger.kernel.org Acked-by: Sreekanth Reddy Signed-off-by: Matt Lupfer Signed-off-by: Martin K. Petersen commit 5600f6986628dde8881734090588474f54a540a8 Author: Pavel Skripkin Date: Sun Mar 13 22:56:32 2022 -0700 Input: aiptek - properly check endpoint type Syzbot reported warning in usb_submit_urb() which is caused by wrong endpoint type. There was a check for the number of endpoints, but not for the type of endpoint. Fix it by replacing old desc.bNumEndpoints check with usb_find_common_endpoints() helper for finding endpoints Fail log: usb 5-1: BOGUS urb xfer, pipe 1 != type 3 WARNING: CPU: 2 PID: 48 at drivers/usb/core/urb.c:502 usb_submit_urb+0xed2/0x18a0 drivers/usb/core/urb.c:502 Modules linked in: CPU: 2 PID: 48 Comm: kworker/2:2 Not tainted 5.17.0-rc6-syzkaller-00226-g07ebd38a0da2 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 Workqueue: usb_hub_wq hub_event ... Call Trace: aiptek_open+0xd5/0x130 drivers/input/tablet/aiptek.c:830 input_open_device+0x1bb/0x320 drivers/input/input.c:629 kbd_connect+0xfe/0x160 drivers/tty/vt/keyboard.c:1593 Fixes: 8e20cf2bce12 ("Input: aiptek - fix crash on detecting device without endpoints") Reported-and-tested-by: syzbot+75cccf2b7da87fb6f84b@syzkaller.appspotmail.com Signed-off-by: Pavel Skripkin Link: https://lore.kernel.org/r/20220308194328.26220-1-paskripkin@gmail.com Signed-off-by: Dmitry Torokhov commit 15d703921f0618a212567d06bca767f3f1c25681 Merge: 837d9e49402ea ed5f85d422901 Author: Jakub Kicinski Date: Mon Mar 14 15:51:10 2022 -0700 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf Pablo Neira Ayuso says: ==================== Netfilter fixes for net The following patchset contains Netfilter fixes for net coming late in the 5.17-rc process: 1) Revert port remap to mitigate shadowing service ports, this is causing problems in existing setups and this mitigation can be achieved with explicit ruleset, eg. ... tcp sport < 16386 tcp dport >= 32768 masquerade random This patches provided a built-in policy similar to the one described above. 2) Disable register tracking infrastructure in nf_tables. Florian reported two issues: - Existing expressions with no implemented .reduce interface that causes data-store on register should cancel the tracking. - Register clobbering might be possible storing data on registers that are larger than 32-bits. This might lead to generating incorrect ruleset bytecode. These two issues are scheduled to be addressed in the next release cycle. * git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf: netfilter: nf_tables: disable register tracking Revert "netfilter: conntrack: tag conntracks picked up in local out hook" Revert "netfilter: nat: force port remap to prevent shadowing well-known ports" ==================== Link: https://lore.kernel.org/r/20220312220315.64531-1-pablo@netfilter.org Signed-off-by: Jakub Kicinski commit 837d9e49402eaf030db55a49f96fc51d73b4b441 Author: Kurt Cancemi Date: Sat Mar 12 15:15:13 2022 -0500 net: phy: marvell: Fix invalid comparison in the resume and suspend functions This bug resulted in only the current mode being resumed and suspended when the PHY supported both fiber and copper modes and when the PHY only supported copper mode the fiber mode would incorrectly be attempted to be resumed and suspended. Fixes: 3758be3dc162 ("Marvell phy: add functions to suspend and resume both interfaces: fiber and copper links.") Signed-off-by: Kurt Cancemi Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220312201512.326047-1-kurt@x64architecture.com Signed-off-by: Jakub Kicinski commit daaca3522a8e67c46e39ef09c1d542e866f85f3b Author: Ming Lei Date: Mon Mar 14 12:30:18 2022 +0800 block: release rq qos structures for queue without disk blkcg_init_queue() may add rq qos structures to request queue, previously blk_cleanup_queue() calls rq_qos_exit() to release them, but commit 8e141f9eb803 ("block: drain file system I/O on del_gendisk") moves rq_qos_exit() into del_gendisk(), so memory leak is caused because queues may not have disk, such as un-present scsi luns, nvme admin queue, ... Fixes the issue by adding rq_qos_exit() to blk_cleanup_queue() back. BTW, v5.18 won't need this patch any more since we move blkcg_init_queue()/blkcg_exit_queue() into disk allocation/release handler, and patches have been in for-5.18/block. Cc: Christoph Hellwig Cc: stable@vger.kernel.org Fixes: 8e141f9eb803 ("block: drain file system I/O on del_gendisk") Reported-by: syzbot+b42749a851a47a0f581b@syzkaller.appspotmail.com Signed-off-by: Ming Lei Reviewed-by: Bart Van Assche Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220314043018.177141-1-ming.lei@redhat.com Signed-off-by: Jens Axboe commit 6665ca15746dc34606b5d79fae278a101a368437 Merge: 09688c0166e76 95932ab2ea07b Author: Linus Torvalds Date: Mon Mar 14 11:21:52 2022 -0700 Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost Pull virtio fix from Michael Tsirkin: "A last minute regression fix. I thought we did a lot of testing, but a regression still managed to sneak in. The fix seems trivial" * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: vhost: allow batching hint without size commit 4db4075f92af2b28f415fc979ab626e6b37d67b6 Author: Sabrina Dubroca Date: Thu Mar 10 11:49:00 2022 +0100 esp6: fix check on ipv6_skip_exthdr's return value Commit 5f9c55c8066b ("ipv6: check return value of ipv6_skip_exthdr") introduced an incorrect check, which leads to all ESP packets over either TCPv6 or UDPv6 encapsulation being dropped. In this particular case, offset is negative, since skb->data points to the ESP header in the following chain of headers, while skb->network_header points to the IPv6 header: IPv6 | ext | ... | ext | UDP | ESP | ... That doesn't seem to be a problem, especially considering that if we reach esp6_input_done2, we're guaranteed to have a full set of headers available (otherwise the packet would have been dropped earlier in the stack). However, it means that the return value will (intentionally) be negative. We can make the test more specific, as the expected return value of ipv6_skip_exthdr will be the (negated) size of either a UDP header, or a TCP header with possible options. In the future, we should probably either make ipv6_skip_exthdr explicitly accept negative offsets (and adjust its return value for error cases), or make ipv6_skip_exthdr only take non-negative offsets (and audit all callers). Fixes: 5f9c55c8066b ("ipv6: check return value of ipv6_skip_exthdr") Reported-by: Xiumei Mu Signed-off-by: Sabrina Dubroca Signed-off-by: Steffen Klassert commit e981bc74aefc6a177b50c16cfa7023599799cf74 Author: Claudiu Beznea Date: Fri Mar 11 13:17:16 2022 +0200 net: dsa: microchip: add spi_device_id tables Add spi_device_id tables to avoid logs like "SPI driver ksz9477-switch has no spi_device_id". Signed-off-by: Claudiu Beznea Signed-off-by: David S. Miller commit a680b1832ced3b5fa7c93484248fd221ea0d614b Author: Brian Masney Date: Thu Mar 10 18:24:59 2022 -0500 crypto: qcom-rng - ensure buffer for generate is completely filled The generate function in struct rng_alg expects that the destination buffer is completely filled if the function returns 0. qcom_rng_read() can run into a situation where the buffer is partially filled with randomness and the remaining part of the buffer is zeroed since qcom_rng_generate() doesn't check the return value. This issue can be reproduced by running the following from libkcapi: kcapi-rng -b 9000000 > OUTFILE The generated OUTFILE will have three huge sections that contain all zeros, and this is caused by the code where the test 'val & PRNG_STATUS_DATA_AVAIL' fails. Let's fix this issue by ensuring that qcom_rng_read() always returns with a full buffer if the function returns success. Let's also have qcom_rng_generate() return the correct value. Here's some statistics from the ent project (https://www.fourmilab.ch/random/) that shows information about the quality of the generated numbers: $ ent -c qcom-random-before Value Char Occurrences Fraction 0 606748 0.067416 1 33104 0.003678 2 33001 0.003667 ... 253 � 32883 0.003654 254 � 33035 0.003671 255 � 33239 0.003693 Total: 9000000 1.000000 Entropy = 7.811590 bits per byte. Optimum compression would reduce the size of this 9000000 byte file by 2 percent. Chi square distribution for 9000000 samples is 9329962.81, and randomly would exceed this value less than 0.01 percent of the times. Arithmetic mean value of data bytes is 119.3731 (127.5 = random). Monte Carlo value for Pi is 3.197293333 (error 1.77 percent). Serial correlation coefficient is 0.159130 (totally uncorrelated = 0.0). Without this patch, the results of the chi-square test is 0.01%, and the numbers are certainly not random according to ent's project page. The results improve with this patch: $ ent -c qcom-random-after Value Char Occurrences Fraction 0 35432 0.003937 1 35127 0.003903 2 35424 0.003936 ... 253 � 35201 0.003911 254 � 34835 0.003871 255 � 35368 0.003930 Total: 9000000 1.000000 Entropy = 7.999979 bits per byte. Optimum compression would reduce the size of this 9000000 byte file by 0 percent. Chi square distribution for 9000000 samples is 258.77, and randomly would exceed this value 42.24 percent of the times. Arithmetic mean value of data bytes is 127.5006 (127.5 = random). Monte Carlo value for Pi is 3.141277333 (error 0.01 percent). Serial correlation coefficient is 0.000468 (totally uncorrelated = 0.0). This change was tested on a Nexus 5 phone (msm8974 SoC). Signed-off-by: Brian Masney Fixes: ceec5f5b5988 ("crypto: qcom-rng - Add Qcom prng driver") Cc: stable@vger.kernel.org # 4.19+ Reviewed-by: Bjorn Andersson Reviewed-by: Andrew Halaney Signed-off-by: Herbert Xu commit 09688c0166e76ce2fb85e86b9d99be8b0084cdf9 Author: Linus Torvalds Date: Sun Mar 13 13:23:37 2022 -0700 Linux 5.17-rc8 commit 40ce1121c1d76daf9048a86e36c83e469281b9fd Author: Jocelyn Falempe Date: Tue Mar 8 18:43:21 2022 +0100 drm/mgag200: Fix PLL setup for g200wb and g200ew commit f86c3ed55920 ("drm/mgag200: Split PLL setup into compute and update functions") introduced a regression for g200wb and g200ew. The PLLs are not set up properly, and VGA screen stays black, or displays "out of range" message. MGA1064_WB_PIX_PLLC_N/M/P was mistakenly replaced with MGA1064_PIX_PLLC_N/M/P which have different addresses. Patch tested on a Dell T310 with g200wb Fixes: f86c3ed55920 ("drm/mgag200: Split PLL setup into compute and update functions") Cc: stable@vger.kernel.org Signed-off-by: Jocelyn Falempe Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220308174321.225606-1-jfalempe@redhat.com commit f0e18b03fcafd8344539101f564ae358950ae892 Merge: aad611a868d16 08999b2489b4c Author: Linus Torvalds Date: Sun Mar 13 10:36:38 2022 -0700 Merge tag 'x86_urgent_for_v5.17_rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fixes from Borislav Petkov: - Free shmem backing storage for SGX enclave pages when those are swapped back into EPC memory - Prevent do_int3() from being kprobed, to avoid recursion - Remap setup_data and setup_indirect structures properly when accessing their members - Correct the alternatives patching order for modules too * tag 'x86_urgent_for_v5.17_rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/sgx: Free backing memory after faulting the enclave page x86/traps: Mark do_int3() NOKPROBE_SYMBOL x86/boot: Add setup_indirect support in early_memremap_is_setup_data() x86/boot: Fix memremap of setup_indirect structures x86/module: Fix the paravirt vs alternative order commit aad611a868d16cdc16a7d4a764cef955293e47e3 Merge: 1518a4f636b39 91c9923a473a6 Author: Linus Torvalds Date: Sat Mar 12 10:29:25 2022 -0800 Merge tag 'perf-tools-fixes-for-v5.17-2022-03-12' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux Pull perf tools fixes from Arnaldo Carvalho de Melo: - Fix event parser error for hybrid systems - Fix NULL check against wrong variable in 'perf bench' and in the parsing code - Update arm64 KVM headers from the kernel sources - Sync cpufeatures header with the kernel sources * tag 'perf-tools-fixes-for-v5.17-2022-03-12' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: perf parse: Fix event parser error for hybrid systems perf bench: Fix NULL check against wrong variable perf parse-events: Fix NULL check against wrong variable tools headers cpufeatures: Sync with the kernel sources tools kvm headers arm64: Update KVM headers from the kernel sources commit 1518a4f636b39718788c81154420d7abc62fd839 Merge: 68453767131a5 3755d35ee1d24 Author: Linus Torvalds Date: Sat Mar 12 10:22:43 2022 -0800 Merge tag 'drm-fixes-2022-03-12' of git://anongit.freedesktop.org/drm/drm Pull drm kconfig fix from Dave Airlie: "Thorsten pointed out this had fallen down the cracks and was in -next only, I've picked it out, fixed up it's Fixes: line. - fix regression in Kconfig" * tag 'drm-fixes-2022-03-12' of git://anongit.freedesktop.org/drm/drm: drm/panel: Select DRM_DP_HELPER for DRM_PANEL_EDP commit ed5f85d4229010235eab1e3d9acf6970d9304963 Author: Pablo Neira Ayuso Date: Sat Mar 12 11:05:46 2022 +0100 netfilter: nf_tables: disable register tracking The register tracking infrastructure is incomplete, it might lead to generating incorrect ruleset bytecode, disable it by now given we are late in the release process. Signed-off-by: Pablo Neira Ayuso commit 91c9923a473a694eb1c5c01ab778a77114969707 Author: Zhengjun Xing Date: Mon Mar 7 23:16:27 2022 +0800 perf parse: Fix event parser error for hybrid systems This bug happened on hybrid systems when both cpu_core and cpu_atom have the same event name such as "UOPS_RETIRED.MS" while their event terms are different, then during perf stat, the event for cpu_atom will parse fail and then no output for cpu_atom. UOPS_RETIRED.MS -> cpu_core/period=0x1e8483,umask=0x4,event=0xc2,frontend=0x8/ UOPS_RETIRED.MS -> cpu_atom/period=0x1e8483,umask=0x1,event=0xc2/ It is because event terms in the "head" of parse_events_multi_pmu_add will be changed to event terms for cpu_core after parsing UOPS_RETIRED.MS for cpu_core, then when parsing the same event for cpu_atom, it still uses the event terms for cpu_core, but event terms for cpu_atom are different with cpu_core, the event parses for cpu_atom will fail. This patch fixes it, the event terms should be parsed from the original event. This patch can work for the hybrid systems that have the same event in more than 2 PMUs. It also can work in non-hybrid systems. Before: # perf stat -v -e UOPS_RETIRED.MS -a sleep 1 Using CPUID GenuineIntel-6-97-1 UOPS_RETIRED.MS -> cpu_core/period=0x1e8483,umask=0x4,event=0xc2,frontend=0x8/ Control descriptor is not initialized UOPS_RETIRED.MS: 2737845 16068518485 16068518485 Performance counter stats for 'system wide': 2,737,845 cpu_core/UOPS_RETIRED.MS/ 1.002553850 seconds time elapsed After: # perf stat -v -e UOPS_RETIRED.MS -a sleep 1 Using CPUID GenuineIntel-6-97-1 UOPS_RETIRED.MS -> cpu_core/period=0x1e8483,umask=0x4,event=0xc2,frontend=0x8/ UOPS_RETIRED.MS -> cpu_atom/period=0x1e8483,umask=0x1,event=0xc2/ Control descriptor is not initialized UOPS_RETIRED.MS: 1977555 16076950711 16076950711 UOPS_RETIRED.MS: 568684 8038694234 8038694234 Performance counter stats for 'system wide': 1,977,555 cpu_core/UOPS_RETIRED.MS/ 568,684 cpu_atom/UOPS_RETIRED.MS/ 1.004758259 seconds time elapsed Fixes: fb0811535e92c6c1 ("perf parse-events: Allow config on kernel PMU events") Reviewed-by: Kan Liang Signed-off-by: Zhengjun Xing Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220307151627.30049-1-zhengjun.xing@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 073a15c3512f6b8d36c0c05992cf31e845f4dfe0 Author: Weiguo Li Date: Fri Mar 11 21:07:16 2022 +0800 perf bench: Fix NULL check against wrong variable We did a NULL check after "epollfdp = calloc(...)", but we checked "epollfd" instead of "epollfdp". Signed-off-by: Weiguo Li Acked-by: Davidlohr Bueso Cc: Alexander Shishkin Cc: Davidlohr Bueso Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/tencent_B5D64530EB9C7DBB8D2C88A0C790F1489D0A@qq.com Signed-off-by: Arnaldo Carvalho de Melo commit a7a72631f62445e3671b7cab5ad01f856c1aa90d Author: Weiguo Li Date: Fri Mar 11 21:06:57 2022 +0800 perf parse-events: Fix NULL check against wrong variable We did a null check after "tmp->symbol = strdup(...)", but we checked "list->symbol" other than "tmp->symbol". Reviewed-by: John Garry Signed-off-by: Weiguo Li Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/tencent_DF39269807EC9425E24787E6DB632441A405@qq.com Signed-off-by: Arnaldo Carvalho de Melo commit ec9d50ace39925f7fd0302bf0fad640e2c9826ea Author: Arnaldo Carvalho de Melo Date: Thu Jul 1 13:39:15 2021 -0300 tools headers cpufeatures: Sync with the kernel sources To pick the changes from: d45476d983240937 ("x86/speculation: Rename RETPOLINE_AMD to RETPOLINE_LFENCE") Its just a comment fixup. This only causes these perf files to be rebuilt: CC /tmp/build/perf/bench/mem-memcpy-x86-64-asm.o CC /tmp/build/perf/bench/mem-memset-x86-64-asm.o And addresses this perf build warning: Warning: Kernel ABI header at 'tools/arch/x86/include/asm/cpufeatures.h' differs from latest version at 'arch/x86/include/asm/cpufeatures.h' diff -u tools/arch/x86/include/asm/cpufeatures.h arch/x86/include/asm/cpufeatures.h Cc: Borislav Petkov Cc: Peter Zijlstra (Intel) Link: https://lore.kernel.org/lkml/YiyiHatGaJQM7l/Y@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 3ec94eeaff9ad58a76be2232068b4a2546b2f6bb Author: Arnaldo Carvalho de Melo Date: Mon Dec 21 12:53:44 2020 -0300 tools kvm headers arm64: Update KVM headers from the kernel sources To pick the changes from: a5905d6af492ee6a ("KVM: arm64: Allow SMCCC_ARCH_WORKAROUND_3 to be discovered and migrated") That don't causes any changes in tooling (when built on x86), only addresses this perf build warning: Warning: Kernel ABI header at 'tools/arch/arm64/include/uapi/asm/kvm.h' differs from latest version at 'arch/arm64/include/uapi/asm/kvm.h' diff -u tools/arch/arm64/include/uapi/asm/kvm.h arch/arm64/include/uapi/asm/kvm.h Cc: James Morse Link: https://lore.kernel.org/lkml/YiyhAK6sVPc83FaI@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 3755d35ee1d2454b20b8a1e20d790e56201678a4 Author: Thomas Zimmermann Date: Thu Feb 3 10:39:22 2022 +0100 drm/panel: Select DRM_DP_HELPER for DRM_PANEL_EDP As reported in [1], DRM_PANEL_EDP depends on DRM_DP_HELPER. Select the option to fix the build failure. The error message is shown below. arm-linux-gnueabihf-ld: drivers/gpu/drm/panel/panel-edp.o: in function `panel_edp_probe': panel-edp.c:(.text+0xb74): undefined reference to `drm_panel_dp_aux_backlight' make[1]: *** [/builds/linux/Makefile:1222: vmlinux] Error 1 The issue has been reported before, when DisplayPort helpers were hidden behind the option CONFIG_DRM_KMS_HELPER. [2] v2: * fix and expand commit description (Arnd) Signed-off-by: Thomas Zimmermann Fixes: 9d6366e743f3 ("drm: fb_helper: improve CONFIG_FB dependency") Reported-by: Naresh Kamboju Reported-by: Linux Kernel Functional Testing Reviewed-by: Lyude Paul Acked-by: Sam Ravnborg Link: https://lore.kernel.org/dri-devel/CA+G9fYvN0NyaVkRQmA1O6rX7H8PPaZrUAD7=RDy33QY9rUU-9g@mail.gmail.com/ # [1] Link: https://lore.kernel.org/all/20211117062704.14671-1-rdunlap@infradead.org/ # [2] Cc: Thomas Zimmermann Cc: Lyude Paul Cc: Daniel Vetter Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: dri-devel@lists.freedesktop.org Link: https://patchwork.freedesktop.org/patch/msgid/20220203093922.20754-1-tzimmermann@suse.de Signed-off-by: Dave Airlie commit 8e6ed963763fe21429eabfc76c69ce2b0163a3dd Author: Jiyong Park Date: Fri Mar 11 11:00:16 2022 +0900 vsock: each transport cycles only on its own sockets When iterating over sockets using vsock_for_each_connected_socket, make sure that a transport filters out sockets that don't belong to the transport. There actually was an issue caused by this; in a nested VM configuration, destroying the nested VM (which often involves the closing of /dev/vhost-vsock if there was h2g connections to the nested VM) kills not only the h2g connections, but also all existing g2h connections to the (outmost) host which are totally unrelated. Tested: Executed the following steps on Cuttlefish (Android running on a VM) [1]: (1) Enter into an `adb shell` session - to have a g2h connection inside the VM, (2) open and then close /dev/vhost-vsock by `exec 3< /dev/vhost-vsock && exec 3<&-`, (3) observe that the adb session is not reset. [1] https://android.googlesource.com/device/google/cuttlefish/ Fixes: c0cfa2d8a788 ("vsock: add multi-transports support") Reviewed-by: Stefano Garzarella Acked-by: Michael S. Tsirkin Signed-off-by: Jiyong Park Link: https://lore.kernel.org/r/20220311020017.1509316-1-jiyong@google.com Signed-off-by: Jakub Kicinski commit 46b348fd2d81a341b15fb3f3f986204b038f5c42 Author: Niels Dossche Date: Fri Mar 11 00:27:08 2022 +0100 alx: acquire mutex for alx_reinit in alx_change_mtu alx_reinit has a lockdep assertion that the alx->mtx mutex must be held. alx_reinit is called from two places: alx_reset and alx_change_mtu. alx_reset does acquire alx->mtx before calling alx_reinit. alx_change_mtu does not acquire this mutex, nor do its callers or any path towards alx_change_mtu. Acquire the mutex in alx_change_mtu. The issue was introduced when the fine-grained locking was introduced to the code to replace the RTNL. The same commit also introduced the lockdep assertion. Fixes: 4a5fe57e7751 ("alx: use fine-grained locking instead of RTNL") Signed-off-by: Niels Dossche Link: https://lore.kernel.org/r/20220310232707.44251-1-dossche.niels@gmail.com Signed-off-by: Jakub Kicinski commit 5e34af4142ffe68f01c8a9acae83300f8911e20c Author: Tadeusz Struk Date: Thu Mar 10 15:25:38 2022 -0800 net: ipv6: fix skb_over_panic in __ip6_append_data Syzbot found a kernel bug in the ipv6 stack: LINK: https://syzkaller.appspot.com/bug?id=205d6f11d72329ab8d62a610c44c5e7e25415580 The reproducer triggers it by sending a crafted message via sendmmsg() call, which triggers skb_over_panic, and crashes the kernel: skbuff: skb_over_panic: text:ffffffff84647fb4 len:65575 put:65575 head:ffff888109ff0000 data:ffff888109ff0088 tail:0x100af end:0xfec0 dev: Update the check that prevents an invalid packet with MTU equal to the fregment header size to eat up all the space for payload. The reproducer can be found here: LINK: https://syzkaller.appspot.com/text?tag=ReproC&x=1648c83fb00000 Reported-by: syzbot+e223cf47ec8ae183f2a0@syzkaller.appspotmail.com Signed-off-by: Tadeusz Struk Acked-by: Willem de Bruijn Link: https://lore.kernel.org/r/20220310232538.1044947-1-tadeusz.struk@linaro.org Signed-off-by: Jakub Kicinski commit 68453767131a5deec1e8f9ac92a9042f929e585d Author: Randy Dunlap Date: Fri Mar 11 11:49:12 2022 -0800 ARM: Spectre-BHB: provide empty stub for non-config When CONFIG_GENERIC_CPU_VULNERABILITIES is not set, references to spectre_v2_update_state() cause a build error, so provide an empty stub for that function when the Kconfig option is not set. Fixes this build error: arm-linux-gnueabi-ld: arch/arm/mm/proc-v7-bugs.o: in function `cpu_v7_bugs_init': proc-v7-bugs.c:(.text+0x52): undefined reference to `spectre_v2_update_state' arm-linux-gnueabi-ld: proc-v7-bugs.c:(.text+0x82): undefined reference to `spectre_v2_update_state' Fixes: b9baf5c8c5c3 ("ARM: Spectre-BHB workaround") Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Russell King Cc: Catalin Marinas Cc: linux-arm-kernel@lists.infradead.org Cc: patches@armlinux.org.uk Acked-by: Russell King (Oracle) Signed-off-by: Linus Torvalds commit 77fe1ba90241c2af6f14d53988bf0cd6b9586699 Merge: 878409ecde7c8 0966d385830de Author: Linus Torvalds Date: Fri Mar 11 12:28:21 2022 -0800 Merge tag 'riscv-for-linus-5.17-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull RISC-V fixes from Palmer Dabbelt: - prevent users from enabling the alternatives framework (and thus errata handling) on XIP kernels, where runtime code patching does not function correctly. - properly detect offset overflow for AUIPC-based relocations in modules. This may manifest as modules calling arbitrary invalid addresses, depending on the address allocated when a module is loaded. * tag 'riscv-for-linus-5.17-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: riscv: Fix auipc+jalr relocation range checks riscv: alternative only works on !XIP_KERNEL commit 878409ecde7c89c9f3db76ff1ef9486c6ceed02c Merge: 6c7cb60bff7ae 48015b632f770 Author: Linus Torvalds Date: Fri Mar 11 11:50:36 2022 -0800 Merge tag 'powerpc-5.17-6' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fix from Michael Ellerman: "Fix STACKTRACE=n build, in particular for skiroot_defconfig" * tag 'powerpc-5.17-6' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc: Fix STACKTRACE=n build commit 6c7cb60bff7aec24b834343ff433125f469886a3 Author: Russell King (Oracle) Date: Fri Mar 11 17:13:17 2022 +0000 ARM: fix Thumb2 regression with Spectre BHB When building for Thumb2, the vectors make use of a local label. Sadly, the Spectre BHB code also uses a local label with the same number which results in the Thumb2 reference pointing at the wrong place. Fix this by changing the number used for the Spectre BHB local label. Fixes: b9baf5c8c5c3 ("ARM: Spectre-BHB workaround") Tested-by: Nathan Chancellor Signed-off-by: Russell King (Oracle) Signed-off-by: Linus Torvalds commit 3977a3fb67703273fb3d6f8647bbca43b3471d4e Merge: 93ce93587d364 1760fdb6fe9f7 Author: Linus Torvalds Date: Fri Mar 11 11:24:58 2022 -0800 Merge tag 'mmc-v5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc Pull MMC fixes from Ulf Hansson: "MMC core: - Restore (mostly) the busy polling for MMC_SEND_OP_COND MMC host: - meson-gx: Fix DMA usage of meson_mmc_post_req()" * tag 'mmc-v5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: mmc: core: Restore (almost) the busy polling for MMC_SEND_OP_COND mmc: meson: Fix usage of meson_mmc_post_req() commit 08999b2489b4c9b939d7483dbd03702ee4576d96 Author: Jarkko Sakkinen Date: Fri Mar 4 00:38:58 2022 +0200 x86/sgx: Free backing memory after faulting the enclave page There is a limited amount of SGX memory (EPC) on each system. When that memory is used up, SGX has its own swapping mechanism which is similar in concept but totally separate from the core mm/* code. Instead of swapping to disk, SGX swaps from EPC to normal RAM. That normal RAM comes from a shared memory pseudo-file and can itself be swapped by the core mm code. There is a hierarchy like this: EPC <-> shmem <-> disk After data is swapped back in from shmem to EPC, the shmem backing storage needs to be freed. Currently, the backing shmem is not freed. This effectively wastes the shmem while the enclave is running. The memory is recovered when the enclave is destroyed and the backing storage freed. Sort this out by freeing memory with shmem_truncate_range(), as soon as a page is faulted back to the EPC. In addition, free the memory for PCMD pages as soon as all PCMD's in a page have been marked as unused by zeroing its contents. Cc: stable@vger.kernel.org Fixes: 1728ab54b4be ("x86/sgx: Add a page reclaimer") Reported-by: Dave Hansen Signed-off-by: Jarkko Sakkinen Signed-off-by: Dave Hansen Link: https://lkml.kernel.org/r/20220303223859.273187-1-jarkko@kernel.org commit 93ce93587d36493f2f86921fa79921b3cba63fbb Merge: 79b00034e9dcd 413a4a6b0b555 Author: Linus Torvalds Date: Fri Mar 11 10:28:32 2022 -0800 Merge branch 'davidh' (fixes from David Howells) Merge misc fixes from David Howells: "A set of patches for watch_queue filter issues noted by Jann. I've added in a cleanup patch from Christophe Jaillet to convert to using formal bitmap specifiers for the note allocation bitmap. Also two filesystem fixes (afs and cachefiles)" * emailed patches from David Howells : cachefiles: Fix volume coherency attribute afs: Fix potential thrashing in afs writeback watch_queue: Make comment about setting ->defunct more accurate watch_queue: Fix lack of barrier/sync/lock between post and read watch_queue: Free the alloc bitmap when the watch_queue is torn down watch_queue: Fix the alloc bitmap size to reflect notes allocated watch_queue: Use the bitmap API when applicable watch_queue: Fix to always request a pow-of-2 pipe ring size watch_queue: Fix to release page in ->release() watch_queue, pipe: Free watchqueue state after clearing pipe ring watch_queue: Fix filter limit check commit 413a4a6b0b5553f2423d210f65e98c211b99c3f8 Author: David Howells Date: Fri Mar 11 16:02:18 2022 +0000 cachefiles: Fix volume coherency attribute A network filesystem may set coherency data on a volume cookie, and if given, cachefiles will store this in an xattr on the directory in the cache corresponding to the volume. The function that sets the xattr just stores the contents of the volume coherency buffer directly into the xattr, with nothing added; the checking function, on the other hand, has a cut'n'paste error whereby it tries to interpret the xattr contents as would be the xattr on an ordinary file (using the cachefiles_xattr struct). This results in a failure to match the coherency data because the buffer ends up being shifted by 18 bytes. Fix this by defining a structure specifically for the volume xattr and making both the setting and checking functions use it. Since the volume coherency doesn't work if used, take the opportunity to insert a reserved field for future use, set it to 0 and check that it is 0. Log mismatch through the appropriate tracepoint. Note that this only affects cifs; 9p, afs, ceph and nfs don't use the volume coherency data at the moment. Fixes: 32e150037dce ("fscache, cachefiles: Store the volume coherency data") Reported-by: Rohith Surabattula Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: Steve French cc: linux-cifs@vger.kernel.org cc: linux-cachefs@redhat.com Signed-off-by: Linus Torvalds commit 173ce1ca47c489135b2799f70f550e1319ba36d8 Author: David Howells Date: Fri Mar 11 15:58:21 2022 +0000 afs: Fix potential thrashing in afs writeback In afs_writepages_region(), if the dirty page we find is undergoing writeback or write to cache, but the sync_mode is WB_SYNC_NONE, we go round the loop trying the same page again and again with no pausing or waiting unless and until another thread manages to clear the writeback and fscache flags. Fix this with three measures: (1) Advance start to after the page we found. (2) Break out of the loop and return if rescheduling is requested. (3) Arbitrarily give up after a maximum of 5 skips. Fixes: 31143d5d515e ("AFS: implement basic file write support") Reported-by: Marc Dionne Signed-off-by: David Howells Tested-by: Marc Dionne Acked-by: Marc Dionne Link: https://lore.kernel.org/r/164692725757.2097000.2060513769492301854.stgit@warthog.procyon.org.uk/ # v1 Signed-off-by: Linus Torvalds commit a365a65f9ca1ceb9cf1ac29db4a4f51df7c507ad Author: Li Huafei Date: Thu Mar 10 20:09:15 2022 +0800 x86/traps: Mark do_int3() NOKPROBE_SYMBOL Since kprobe_int3_handler() is called in do_int3(), probing do_int3() can cause a breakpoint recursion and crash the kernel. Therefore, do_int3() should be marked as NOKPROBE_SYMBOL. Fixes: 21e28290b317 ("x86/traps: Split int3 handler up") Signed-off-by: Li Huafei Signed-off-by: Borislav Petkov Acked-by: Masami Hiramatsu Cc: Link: https://lore.kernel.org/r/20220310120915.63349-1-lihuafei1@huawei.com commit 4edc0760412b0c4ecefc7e02cb855b310b122825 Author: David Howells Date: Fri Mar 11 13:24:47 2022 +0000 watch_queue: Make comment about setting ->defunct more accurate watch_queue_clear() has a comment stating that setting ->defunct to true preventing new additions as well as preventing notifications. Whilst the latter is true, the first bit is superfluous since at the time this function is called, the pipe cannot be accessed to add new event sources. Remove the "new additions" bit from the comment. Fixes: c73be61cede5 ("pipe: Add general notification queue support") Reported-by: Jann Horn Signed-off-by: David Howells Signed-off-by: Linus Torvalds commit 2ed147f015af2b48f41c6f0b6746aa9ea85c19f3 Author: David Howells Date: Fri Mar 11 13:24:36 2022 +0000 watch_queue: Fix lack of barrier/sync/lock between post and read There's nothing to synchronise post_one_notification() versus pipe_read(). Whilst posting is done under pipe->rd_wait.lock, the reader only takes pipe->mutex which cannot bar notification posting as that may need to be made from contexts that cannot sleep. Fix this by setting pipe->head with a barrier in post_one_notification() and reading pipe->head with a barrier in pipe_read(). If that's not sufficient, the rd_wait.lock will need to be taken, possibly in a ->confirm() op so that it only applies to notifications. The lock would, however, have to be dropped before copy_page_to_iter() is invoked. Fixes: c73be61cede5 ("pipe: Add general notification queue support") Reported-by: Jann Horn Signed-off-by: David Howells Signed-off-by: Linus Torvalds commit 7ea1a0124b6da246b5bc8c66cddaafd36acf3ecb Author: David Howells Date: Fri Mar 11 13:24:29 2022 +0000 watch_queue: Free the alloc bitmap when the watch_queue is torn down Free the watch_queue note allocation bitmap when the watch_queue is destroyed. Fixes: c73be61cede5 ("pipe: Add general notification queue support") Reported-by: Jann Horn Signed-off-by: David Howells Signed-off-by: Linus Torvalds commit 3b4c0371928c17af03e8397ac842346624017ce6 Author: David Howells Date: Fri Mar 11 13:24:22 2022 +0000 watch_queue: Fix the alloc bitmap size to reflect notes allocated Currently, watch_queue_set_size() sets the number of notes available in wqueue->nr_notes according to the number of notes allocated, but sets the size of the bitmap to the unrounded number of notes originally asked for. Fix this by setting the bitmap size to the number of notes we're actually going to make available (ie. the number allocated). Fixes: c73be61cede5 ("pipe: Add general notification queue support") Reported-by: Jann Horn Signed-off-by: David Howells Signed-off-by: Linus Torvalds commit a66bd7575b5f449ee0ba20cfd21c3bc5b04ef361 Author: Christophe JAILLET Date: Fri Mar 11 13:24:15 2022 +0000 watch_queue: Use the bitmap API when applicable Use bitmap_alloc() to simplify code, improve the semantic and reduce some open-coded arithmetic in allocator arguments. Also change a memset(0xff) into an equivalent bitmap_fill() to keep consistency. Signed-off-by: Christophe JAILLET Signed-off-by: David Howells Signed-off-by: Linus Torvalds commit 96a4d8912b28451cd62825fd7caa0e66e091d938 Author: David Howells Date: Fri Mar 11 13:24:08 2022 +0000 watch_queue: Fix to always request a pow-of-2 pipe ring size The pipe ring size must always be a power of 2 as the head and tail pointers are masked off by AND'ing with the size of the ring - 1. watch_queue_set_size(), however, lets you specify any number of notes between 1 and 511. This number is passed through to pipe_resize_ring() without checking/forcing its alignment. Fix this by rounding the number of slots required up to the nearest power of two. The request is meant to guarantee that at least that many notifications can be generated before the queue is full, so rounding down isn't an option, but, alternatively, it may be better to give an error if we aren't allowed to allocate that much ring space. Fixes: c73be61cede5 ("pipe: Add general notification queue support") Reported-by: Jann Horn Signed-off-by: David Howells Signed-off-by: Linus Torvalds commit c1853fbadcba1497f4907971e7107888e0714c81 Author: David Howells Date: Fri Mar 11 13:23:46 2022 +0000 watch_queue: Fix to release page in ->release() When a pipe ring descriptor points to a notification message, the refcount on the backing page is incremented by the generic get function, but the release function, which marks the bitmap, doesn't drop the page ref. Fix this by calling generic_pipe_buf_release() at the end of watch_queue_pipe_buf_release(). Fixes: c73be61cede5 ("pipe: Add general notification queue support") Reported-by: Jann Horn Signed-off-by: David Howells Signed-off-by: Linus Torvalds commit db8facfc9fafacefe8a835416a6b77c838088f8b Author: David Howells Date: Fri Mar 11 13:23:38 2022 +0000 watch_queue, pipe: Free watchqueue state after clearing pipe ring In free_pipe_info(), free the watchqueue state after clearing the pipe ring as each pipe ring descriptor has a release function, and in the case of a notification message, this is watch_queue_pipe_buf_release() which tries to mark the allocation bitmap that was previously released. Fix this by moving the put of the pipe's ref on the watch queue to after the ring has been cleared. We still need to call watch_queue_clear() before doing that to make sure that the pipe is disconnected from any notification sources first. Fixes: c73be61cede5 ("pipe: Add general notification queue support") Reported-by: Jann Horn Signed-off-by: David Howells Signed-off-by: Linus Torvalds commit c993ee0f9f81caf5767a50d1faeba39a0dc82af2 Author: David Howells Date: Fri Mar 11 13:23:31 2022 +0000 watch_queue: Fix filter limit check In watch_queue_set_filter(), there are a couple of places where we check that the filter type value does not exceed what the type_filter bitmap can hold. One place calculates the number of bits by: if (tf[i].type >= sizeof(wfilter->type_filter) * 8) which is fine, but the second does: if (tf[i].type >= sizeof(wfilter->type_filter) * BITS_PER_LONG) which is not. This can lead to a couple of out-of-bounds writes due to a too-large type: (1) __set_bit() on wfilter->type_filter (2) Writing more elements in wfilter->filters[] than we allocated. Fix this by just using the proper WATCH_TYPE__NR instead, which is the number of types we actually know about. The bug may cause an oops looking something like: BUG: KASAN: slab-out-of-bounds in watch_queue_set_filter+0x659/0x740 Write of size 4 at addr ffff88800d2c66bc by task watch_queue_oob/611 ... Call Trace: dump_stack_lvl+0x45/0x59 print_address_description.constprop.0+0x1f/0x150 ... kasan_report.cold+0x7f/0x11b ... watch_queue_set_filter+0x659/0x740 ... __x64_sys_ioctl+0x127/0x190 do_syscall_64+0x43/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae Allocated by task 611: kasan_save_stack+0x1e/0x40 __kasan_kmalloc+0x81/0xa0 watch_queue_set_filter+0x23a/0x740 __x64_sys_ioctl+0x127/0x190 do_syscall_64+0x43/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff88800d2c66a0 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 28 bytes inside of 32-byte region [ffff88800d2c66a0, ffff88800d2c66c0) Fixes: c73be61cede5 ("pipe: Add general notification queue support") Reported-by: Jann Horn Signed-off-by: David Howells Signed-off-by: Linus Torvalds commit 79b00034e9dcd2b065c1665c8b42f62b6b80a9be Merge: dda64ead7e82c 30eb13a26014c Author: Linus Torvalds Date: Thu Mar 10 21:15:42 2022 -0800 Merge tag 'drm-fixes-2022-03-11' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "As expected at this stage its pretty quiet, one sun4i mixer fix and one i915 display flicker fix: i915: - fix psr screen flicker sun4i: - mixer format fix" * tag 'drm-fixes-2022-03-11' of git://anongit.freedesktop.org/drm/drm: drm/sun4i: mixer: Fix P010 and P210 format numbers drm/i915/psr: Set "SF Partial Frame Enable" also on full update commit 0966d385830de3470b7131db8e86c0c5bc9c52dc Author: Emil Renner Berthing Date: Wed Feb 23 20:12:57 2022 +0100 riscv: Fix auipc+jalr relocation range checks RISC-V can do PC-relative jumps with a 32bit range using the following two instructions: auipc t0, imm20 ; t0 = PC + imm20 * 2^12 jalr ra, t0, imm12 ; ra = PC + 4, PC = t0 + imm12 Crucially both the 20bit immediate imm20 and the 12bit immediate imm12 are treated as two's-complement signed values. For this reason the immediates are usually calculated like this: imm20 = (offset + 0x800) >> 12 imm12 = offset & 0xfff ..where offset is the signed offset from the auipc instruction. When the 11th bit of offset is 0 the addition of 0x800 doesn't change the top 20 bits and imm12 considered positive. When the 11th bit is 1 the carry of the addition by 0x800 means imm20 is one higher, but since imm12 is then considered negative the two's complement representation means it all cancels out nicely. However, this addition by 0x800 (2^11) means an offset greater than or equal to 2^31 - 2^11 would overflow so imm20 is considered negative and result in a backwards jump. Similarly the lower range of offset is also moved down by 2^11 and hence the true 32bit range is [-2^31 - 2^11, 2^31 - 2^11) Signed-off-by: Emil Renner Berthing Fixes: e2c0cdfba7f6 ("RISC-V: User-facing API") Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit 30eb13a26014ca640b5eb57b6d010114084d5c92 Merge: 1f37299bb4e10 804f468853179 Author: Dave Airlie Date: Fri Mar 11 13:26:18 2022 +1000 Merge tag 'drm-intel-fixes-2022-03-10' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes - Fix PSR2 when selective fetch is enabled and cursor at (-1, -1) (Jouni Högander) Signed-off-by: Dave Airlie From: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/YinTFSFg++HvuFpZ@tursulin-mobl2 commit 1f37299bb4e10223f689b49723bac74b5c05c1a9 Merge: ffb217a13a2ea 9470c29faa91c Author: Dave Airlie Date: Fri Mar 11 10:37:16 2022 +1000 Merge tag 'drm-misc-fixes-2022-03-10' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes * drm/sun4i: Fix P010 and P210 format numbers Signed-off-by: Dave Airlie From: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/YipS65Iuu7RMMlAa@linux-uq9g commit dda64ead7e82caa47fafe0edc36067ee64df2203 Merge: 186d32bbf0344 78cbc6513217b Author: Linus Torvalds Date: Thu Mar 10 17:23:08 2022 -0800 Merge tag 'trace-v5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing fixes from Steven Rostedt: "Minor tracing fixes: - Fix unregistering the same event twice. A user could disable the same event that osnoise will disable on unregistering. - Inform RCU of a quiescent state in the osnoise testing thread. - Fix some kerneldoc comments" * tag 'trace-v5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: ftrace: Fix some W=1 warnings in kernel doc comments tracing/osnoise: Force quiescent states while tracing tracing/osnoise: Do not unregister events twice commit 186d32bbf034417b40e2b4e773eeb8ef106c16c1 Merge: 3bcb6451cc96c e0ae713023a9d Author: Linus Torvalds Date: Thu Mar 10 16:47:58 2022 -0800 Merge tag 'net-5.17-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Jakub Kicinski: "Including fixes from bluetooth, and ipsec. Current release - regressions: - Bluetooth: fix unbalanced unlock in set_device_flags() - Bluetooth: fix not processing all entries on cmd_sync_work, make connect with qualcomm and intel adapters reliable - Revert "xfrm: state and policy should fail if XFRMA_IF_ID 0" - xdp: xdp_mem_allocator can be NULL in trace_mem_connect() - eth: ice: fix race condition and deadlock during interface enslave Current release - new code bugs: - tipc: fix incorrect order of state message data sanity check Previous releases - regressions: - esp: fix possible buffer overflow in ESP transformation - dsa: unlock the rtnl_mutex when dsa_master_setup() fails - phy: meson-gxl: fix interrupt handling in forced mode - smsc95xx: ignore -ENODEV errors when device is unplugged Previous releases - always broken: - xfrm: fix tunnel mode fragmentation behavior - esp: fix inter address family tunneling on GSO - tipc: fix null-deref due to race when enabling bearer - sctp: fix kernel-infoleak for SCTP sockets - eth: macb: fix lost RX packet wakeup race in NAPI receive - eth: intel stop disabling VFs due to PF error responses - eth: bcmgenet: don't claim WOL when its not available" * tag 'net-5.17-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (50 commits) xdp: xdp_mem_allocator can be NULL in trace_mem_connect(). ice: Fix race condition during interface enslave net: phy: meson-gxl: improve link-up behavior net: bcmgenet: Don't claim WOL when its not available net: arc_emac: Fix use after free in arc_mdio_probe() sctp: fix kernel-infoleak for SCTP sockets net: phy: correct spelling error of media in documentation net: phy: DP83822: clear MISR2 register to disable interrupts gianfar: ethtool: Fix refcount leak in gfar_get_ts_info selftests: pmtu.sh: Kill nettest processes launched in subshell. selftests: pmtu.sh: Kill tcpdump processes launched by subshell. NFC: port100: fix use-after-free in port100_send_complete net/mlx5e: SHAMPO, reduce TIR indication net/mlx5e: Lag, Only handle events from highest priority multipath entry net/mlx5: Fix offloading with ESWITCH_IPV4_TTL_MODIFY_ENABLE net/mlx5: Fix a race on command flush flow net/mlx5: Fix size field in bufferx_reg struct ax25: Fix NULL pointer dereference in ax25_kill_by_device net: marvell: prestera: Add missing of_node_put() in prestera_switch_set_base_mac_addr net: ethernet: lpc_eth: Handle error for clk_enable ... commit e0ae713023a9d09d6e1b454bdc8e8c1dd32c586e Author: Sebastian Andrzej Siewior Date: Wed Mar 9 23:13:45 2022 +0100 xdp: xdp_mem_allocator can be NULL in trace_mem_connect(). Since the commit mentioned below __xdp_reg_mem_model() can return a NULL pointer. This pointer is dereferenced in trace_mem_connect() which leads to segfault. The trace points (mem_connect + mem_disconnect) were put in place to pair connect/disconnect using the IDs. The ID is only assigned if __xdp_reg_mem_model() does not return NULL. That connect trace point is of no use if there is no ID. Skip that connect trace point if xdp_alloc is NULL. [ Toke Høiland-Jørgensen delivered the reasoning for skipping the trace point ] Fixes: 4a48ef70b93b8 ("xdp: Allow registering memory model without rxq reference") Signed-off-by: Sebastian Andrzej Siewior Acked-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/r/YikmmXsffE+QajTB@linutronix.de Signed-off-by: Jakub Kicinski commit 5cb1ebdbc4342b1c2ce89516e19808d64417bdbc Author: Ivan Vecera Date: Thu Mar 10 18:16:41 2022 +0100 ice: Fix race condition during interface enslave Commit 5dbbbd01cbba83 ("ice: Avoid RTNL lock when re-creating auxiliary device") changes a process of re-creation of aux device so ice_plug_aux_dev() is called from ice_service_task() context. This unfortunately opens a race window that can result in dead-lock when interface has left LAG and immediately enters LAG again. Reproducer: ``` #!/bin/sh ip link add lag0 type bond mode 1 miimon 100 ip link set lag0 for n in {1..10}; do echo Cycle: $n ip link set ens7f0 master lag0 sleep 1 ip link set ens7f0 nomaster done ``` This results in: [20976.208697] Workqueue: ice ice_service_task [ice] [20976.213422] Call Trace: [20976.215871] __schedule+0x2d1/0x830 [20976.219364] schedule+0x35/0xa0 [20976.222510] schedule_preempt_disabled+0xa/0x10 [20976.227043] __mutex_lock.isra.7+0x310/0x420 [20976.235071] enum_all_gids_of_dev_cb+0x1c/0x100 [ib_core] [20976.251215] ib_enum_roce_netdev+0xa4/0xe0 [ib_core] [20976.256192] ib_cache_setup_one+0x33/0xa0 [ib_core] [20976.261079] ib_register_device+0x40d/0x580 [ib_core] [20976.266139] irdma_ib_register_device+0x129/0x250 [irdma] [20976.281409] irdma_probe+0x2c1/0x360 [irdma] [20976.285691] auxiliary_bus_probe+0x45/0x70 [20976.289790] really_probe+0x1f2/0x480 [20976.298509] driver_probe_device+0x49/0xc0 [20976.302609] bus_for_each_drv+0x79/0xc0 [20976.306448] __device_attach+0xdc/0x160 [20976.310286] bus_probe_device+0x9d/0xb0 [20976.314128] device_add+0x43c/0x890 [20976.321287] __auxiliary_device_add+0x43/0x60 [20976.325644] ice_plug_aux_dev+0xb2/0x100 [ice] [20976.330109] ice_service_task+0xd0c/0xed0 [ice] [20976.342591] process_one_work+0x1a7/0x360 [20976.350536] worker_thread+0x30/0x390 [20976.358128] kthread+0x10a/0x120 [20976.365547] ret_from_fork+0x1f/0x40 ... [20976.438030] task:ip state:D stack: 0 pid:213658 ppid:213627 flags:0x00004084 [20976.446469] Call Trace: [20976.448921] __schedule+0x2d1/0x830 [20976.452414] schedule+0x35/0xa0 [20976.455559] schedule_preempt_disabled+0xa/0x10 [20976.460090] __mutex_lock.isra.7+0x310/0x420 [20976.464364] device_del+0x36/0x3c0 [20976.467772] ice_unplug_aux_dev+0x1a/0x40 [ice] [20976.472313] ice_lag_event_handler+0x2a2/0x520 [ice] [20976.477288] notifier_call_chain+0x47/0x70 [20976.481386] __netdev_upper_dev_link+0x18b/0x280 [20976.489845] bond_enslave+0xe05/0x1790 [bonding] [20976.494475] do_setlink+0x336/0xf50 [20976.502517] __rtnl_newlink+0x529/0x8b0 [20976.543441] rtnl_newlink+0x43/0x60 [20976.546934] rtnetlink_rcv_msg+0x2b1/0x360 [20976.559238] netlink_rcv_skb+0x4c/0x120 [20976.563079] netlink_unicast+0x196/0x230 [20976.567005] netlink_sendmsg+0x204/0x3d0 [20976.570930] sock_sendmsg+0x4c/0x50 [20976.574423] ____sys_sendmsg+0x1eb/0x250 [20976.586807] ___sys_sendmsg+0x7c/0xc0 [20976.606353] __sys_sendmsg+0x57/0xa0 [20976.609930] do_syscall_64+0x5b/0x1a0 [20976.613598] entry_SYSCALL_64_after_hwframe+0x65/0xca 1. Command 'ip link ... set nomaster' causes that ice_plug_aux_dev() is called from ice_service_task() context, aux device is created and associated device->lock is taken. 2. Command 'ip link ... set master...' calls ice's notifier under RTNL lock and that notifier calls ice_unplug_aux_dev(). That function tries to take aux device->lock but this is already taken by ice_plug_aux_dev() in step 1 3. Later ice_plug_aux_dev() tries to take RTNL lock but this is already taken in step 2 4. Dead-lock The patch fixes this issue by following changes: - Bit ICE_FLAG_PLUG_AUX_DEV is kept to be set during ice_plug_aux_dev() call in ice_service_task() - The bit is checked in ice_clear_rdma_cap() and only if it is not set then ice_unplug_aux_dev() is called. If it is set (in other words plugging of aux device was requested and ice_plug_aux_dev() is potentially running) then the function only clears the bit - Once ice_plug_aux_dev() call (in ice_service_task) is finished the bit ICE_FLAG_PLUG_AUX_DEV is cleared but it is also checked whether it was already cleared by ice_clear_rdma_cap(). If so then aux device is unplugged. Signed-off-by: Ivan Vecera Co-developed-by: Petr Oros Signed-off-by: Petr Oros Reviewed-by: Dave Ertman Link: https://lore.kernel.org/r/20220310171641.3863659-1-ivecera@redhat.com Signed-off-by: Jakub Kicinski commit 2c87c6f9fbddc5b84d67b2fa3f432fcac6d99d93 Author: Heiner Kallweit Date: Wed Mar 9 22:04:47 2022 +0100 net: phy: meson-gxl: improve link-up behavior Sometimes the link comes up but no data flows. This patch fixes this behavior. It's not clear what's the root cause of the issue. According to the tests one other link-up issue remains. In very rare cases the link isn't even reported as up. Fixes: 84c8f773d2dc ("net: phy: meson-gxl: remove the use of .ack_callback()") Tested-by: Erico Nunes Signed-off-by: Heiner Kallweit Link: https://lore.kernel.org/r/e3473452-a1f9-efcf-5fdd-02b6f44c3fcd@gmail.com Signed-off-by: Jakub Kicinski commit 00b022f8f876a3a036b0df7f971001bef6398605 Author: Jeremy Linton Date: Wed Mar 9 22:55:35 2022 -0600 net: bcmgenet: Don't claim WOL when its not available Some of the bcmgenet platforms don't correctly support WOL, yet ethtool returns: "Supports Wake-on: gsf" which is false. Ideally if there isn't a wol_irq, or there is something else that keeps the device from being able to wakeup it should display: "Supports Wake-on: d" This patch checks whether the device can wakup, before using the hard-coded supported flags. This corrects the ethtool reporting, as well as the WOL configuration because ethtool verifies that the mode is supported before attempting it. Fixes: c51de7f3976b ("net: bcmgenet: add Wake-on-LAN support code") Signed-off-by: Jeremy Linton Tested-by: Peter Robinson Acked-by: Florian Fainelli Link: https://lore.kernel.org/r/20220310045535.224450-1-jeremy.linton@arm.com Signed-off-by: Jakub Kicinski commit bc0e610a6eb0d46e4123fafdbe5e6141d9fff3be Author: Jianglei Nie Date: Wed Mar 9 20:18:24 2022 +0800 net: arc_emac: Fix use after free in arc_mdio_probe() If bus->state is equal to MDIOBUS_ALLOCATED, mdiobus_free(bus) will free the "bus". But bus->name is still used in the next line, which will lead to a use after free. We can fix it by putting the name in a local variable and make the bus->name point to the rodata section "name",then use the name in the error message without referring to bus to avoid the uaf. Fixes: 95b5fc03c189 ("net: arc_emac: Make use of the helper function dev_err_probe()") Signed-off-by: Jianglei Nie Link: https://lore.kernel.org/r/20220309121824.36529-1-niejianglei2021@163.com Signed-off-by: Jakub Kicinski commit 633593a808980f82d251d0ca89730d8bb8b0220c Author: Eric Dumazet Date: Wed Mar 9 16:11:45 2022 -0800 sctp: fix kernel-infoleak for SCTP sockets syzbot reported a kernel infoleak [1] of 4 bytes. After analysis, it turned out r->idiag_expires is not initialized if inet_sctp_diag_fill() calls inet_diag_msg_common_fill() Make sure to clear idiag_timer/idiag_retrans/idiag_expires and let inet_diag_msg_sctpasoc_fill() fill them again if needed. [1] BUG: KMSAN: kernel-infoleak in instrument_copy_to_user include/linux/instrumented.h:121 [inline] BUG: KMSAN: kernel-infoleak in copyout lib/iov_iter.c:154 [inline] BUG: KMSAN: kernel-infoleak in _copy_to_iter+0x6ef/0x25a0 lib/iov_iter.c:668 instrument_copy_to_user include/linux/instrumented.h:121 [inline] copyout lib/iov_iter.c:154 [inline] _copy_to_iter+0x6ef/0x25a0 lib/iov_iter.c:668 copy_to_iter include/linux/uio.h:162 [inline] simple_copy_to_iter+0xf3/0x140 net/core/datagram.c:519 __skb_datagram_iter+0x2d5/0x11b0 net/core/datagram.c:425 skb_copy_datagram_iter+0xdc/0x270 net/core/datagram.c:533 skb_copy_datagram_msg include/linux/skbuff.h:3696 [inline] netlink_recvmsg+0x669/0x1c80 net/netlink/af_netlink.c:1977 sock_recvmsg_nosec net/socket.c:948 [inline] sock_recvmsg net/socket.c:966 [inline] __sys_recvfrom+0x795/0xa10 net/socket.c:2097 __do_sys_recvfrom net/socket.c:2115 [inline] __se_sys_recvfrom net/socket.c:2111 [inline] __x64_sys_recvfrom+0x19d/0x210 net/socket.c:2111 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x54/0xd0 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x44/0xae Uninit was created at: slab_post_alloc_hook mm/slab.h:737 [inline] slab_alloc_node mm/slub.c:3247 [inline] __kmalloc_node_track_caller+0xe0c/0x1510 mm/slub.c:4975 kmalloc_reserve net/core/skbuff.c:354 [inline] __alloc_skb+0x545/0xf90 net/core/skbuff.c:426 alloc_skb include/linux/skbuff.h:1158 [inline] netlink_dump+0x3e5/0x16c0 net/netlink/af_netlink.c:2248 __netlink_dump_start+0xcf8/0xe90 net/netlink/af_netlink.c:2373 netlink_dump_start include/linux/netlink.h:254 [inline] inet_diag_handler_cmd+0x2e7/0x400 net/ipv4/inet_diag.c:1341 sock_diag_rcv_msg+0x24a/0x620 netlink_rcv_skb+0x40c/0x7e0 net/netlink/af_netlink.c:2494 sock_diag_rcv+0x63/0x80 net/core/sock_diag.c:277 netlink_unicast_kernel net/netlink/af_netlink.c:1317 [inline] netlink_unicast+0x1093/0x1360 net/netlink/af_netlink.c:1343 netlink_sendmsg+0x14d9/0x1720 net/netlink/af_netlink.c:1919 sock_sendmsg_nosec net/socket.c:705 [inline] sock_sendmsg net/socket.c:725 [inline] sock_write_iter+0x594/0x690 net/socket.c:1061 do_iter_readv_writev+0xa7f/0xc70 do_iter_write+0x52c/0x1500 fs/read_write.c:851 vfs_writev fs/read_write.c:924 [inline] do_writev+0x645/0xe00 fs/read_write.c:967 __do_sys_writev fs/read_write.c:1040 [inline] __se_sys_writev fs/read_write.c:1037 [inline] __x64_sys_writev+0xe5/0x120 fs/read_write.c:1037 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 Bytes 68-71 of 2508 are uninitialized Memory access of size 2508 starts at ffff888114f9b000 Data copied to user address 00007f7fe09ff2e0 CPU: 1 PID: 3478 Comm: syz-executor306 Not tainted 5.17.0-rc4-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Fixes: 8f840e47f190 ("sctp: add the sctp_diag.c file") Signed-off-by: Eric Dumazet Reported-by: syzbot Cc: Vlad Yasevich Cc: Neil Horman Cc: Marcelo Ricardo Leitner Reviewed-by: Xin Long Link: https://lore.kernel.org/r/20220310001145.297371-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit 26183cfe478c1d1d5cd1e3920a4b2c5b1980849d Author: Colin Foster Date: Tue Mar 8 22:25:44 2022 -0800 net: phy: correct spelling error of media in documentation The header file incorrectly referenced "median-independant interface" instead of media. Correct this typo. Signed-off-by: Colin Foster Fixes: 4069a572d423 ("net: phy: Document core PHY structures") Reviewed-by: Russell King (Oracle) Link: https://lore.kernel.org/r/20220309062544.3073-1-colin.foster@in-advantage.com Signed-off-by: Jakub Kicinski commit 55c4bf4d93bec773eb373f048ed8c6c53b96d8eb Merge: 37c9d66c95564 99a2b9be077ae Author: Jakub Kicinski Date: Thu Mar 10 14:32:32 2022 -0800 Merge tag 'mlx5-fixes-2022-03-09' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5 fixes 2022-03-09 This series provides bug fixes to mlx5 driver. * tag 'mlx5-fixes-2022-03-09' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux: net/mlx5e: SHAMPO, reduce TIR indication net/mlx5e: Lag, Only handle events from highest priority multipath entry net/mlx5: Fix offloading with ESWITCH_IPV4_TTL_MODIFY_ENABLE net/mlx5: Fix a race on command flush flow net/mlx5: Fix size field in bufferx_reg struct ==================== Link: https://lore.kernel.org/r/20220309201517.589132-1-saeed@kernel.org Signed-off-by: Jakub Kicinski commit 3bcb6451cc96ca38e50120a4f333ecf157245544 Merge: c30b5b8cfb72c 0a5aa8d161d19 Author: Linus Torvalds Date: Thu Mar 10 12:56:36 2022 -0800 Merge tag 'block-5.17-2022-03-10' of git://git.kernel.dk/linux-block Pull block fix from Jens Axboe: "Just a single fix for a regression that occured in this merge window" * tag 'block-5.17-2022-03-10' of git://git.kernel.dk/linux-block: block: fix blk_mq_attempt_bio_merge and rq_qos_throttle protection commit c30b5b8cfb72cc83c10793588ce94471a4769409 Merge: 55b4083b44361 342e7c6ea5820 Author: Linus Torvalds Date: Thu Mar 10 12:43:06 2022 -0800 Merge tag 'staging-5.17-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging driver fixes from Greg KH: "Here are three small fixes for staging drivers for 5.17-rc8 or -final, which ever comes next. They resolve some reported problems: - rtl8723bs wifi driver deadlock fix for reported problem that is a revert of a previous patch. Also a documentation fix is added so that the same problem hopefully can not come back again. - gdm724x driver use-after-free fix for a reported problem. All of these have been in linux-next for a while with no reported problems" * tag 'staging-5.17-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: staging: rtl8723bs: Improve the comment explaining the locking rules staging: rtl8723bs: Fix access-point mode deadlock staging: gdm724x: fix use after free in gdm_lte_rx() commit 37c9d66c95564c85a001d8a035354f0220a1e1c3 Author: Clément Léger Date: Wed Mar 9 15:22:28 2022 +0100 net: phy: DP83822: clear MISR2 register to disable interrupts MISR1 was cleared twice but the original author intention was probably to clear MISR1 & MISR2 to completely disable interrupts. Fix it to clear MISR2. Fixes: 87461f7a58ab ("net: phy: DP83822 initial driver submission") Signed-off-by: Clément Léger Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20220309142228.761153-1-clement.leger@bootlin.com Signed-off-by: Jakub Kicinski commit 2ac5b58e645c66932438bb021cb5b52097ce70b0 Author: Miaoqian Lin Date: Thu Mar 10 01:53:13 2022 +0000 gianfar: ethtool: Fix refcount leak in gfar_get_ts_info The of_find_compatible_node() function returns a node pointer with refcount incremented, We should use of_node_put() on it when done Add the missing of_node_put() to release the refcount. Fixes: 7349a74ea75c ("net: ethernet: gianfar_ethtool: get phc index through drvdata") Signed-off-by: Miaoqian Lin Reviewed-by: Jesse Brandeburg Reviewed-by: Claudiu Manoil Link: https://lore.kernel.org/r/20220310015313.14938-1-linmq006@gmail.com Signed-off-by: Jakub Kicinski commit 55b4083b44361d833c93216a619d3b4e6d03a0c9 Merge: fe673d3f5bf1f 7e606edaa0a2e Author: Linus Torvalds Date: Thu Mar 10 11:43:01 2022 -0800 Merge tag 'soc-fixes-5.17-3' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC fixes from Arnd Bergmann: "Here is a third set of fixes for the soc tree, well within the expected set of changes. Maintainer list changes: - Krzysztof Kozlowski and Jisheng Zhang both have new email addresses - Broadcom iProc has a new git tree Regressions: - Robert Foss sends a revert for a Mediatek DPI bridge patch that caused an inadvertent break in the DT binding - mstar timers need to be included in Kconfig Devicetree fixes for: - Aspeed ast2600 spi pinmux - Tegra eDP panels on Nyan FHD - Tegra display IOMMU - Qualcomm sm8350 UFS clocks - minor DT changes for Marvell Armada, Qualcomm sdx65, Qualcomm sm8450, and Broadcom BCM2711" * tag 'soc-fixes-5.17-3' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: arm64: dts: marvell: armada-37xx: Remap IO space to bus address 0x0 MAINTAINERS: Update Jisheng's email address Revert "arm64: dts: mt8183: jacuzzi: Fix bus properties in anx's DSI endpoint" dt-bindings: drm/bridge: anx7625: Revert DPI support ARM: dts: aspeed: Fix AST2600 quad spi group MAINTAINERS: update Krzysztof Kozlowski's email MAINTAINERS: Update git tree for Broadcom iProc SoCs ARM: tegra: Move Nyan FHD panels to AUX bus arm64: dts: armada-3720-turris-mox: Add missing ethernet0 alias ARM: mstar: Select HAVE_ARM_ARCH_TIMER soc: mediatek: mt8192-mmsys: Fix dither to dsi0 path's input sel arm64: dts: mt8183: jacuzzi: Fix bus properties in anx's DSI endpoint ARM: boot: dts: bcm2711: Fix HVS register range arm64: dts: qcom: c630: disable crypto due to serror arm64: dts: qcom: sm8450: fix apps_smmu interrupts arm64: dts: qcom: sm8450: enable GCC_USB3_0_CLKREF_EN for usb arm64: dts: qcom: sm8350: Correct UFS symbol clocks arm64: tegra: Disable ISO SMMU for Tegra194 Revert "dt-bindings: arm: qcom: Document SDX65 platform and boards" commit fe673d3f5bf1fc50cdc4b754831db91a2ec10126 Author: Linus Torvalds Date: Tue Mar 8 11:55:48 2022 -0800 mm: gup: make fault_in_safe_writeable() use fixup_user_fault() Instead of using GUP, make fault_in_safe_writeable() actually force a 'handle_mm_fault()' using the same fixup_user_fault() machinery that futexes already use. Using the GUP machinery meant that fault_in_safe_writeable() did not do everything that a real fault would do, ranging from not auto-expanding the stack segment, to not updating accessed or dirty flags in the page tables (GUP sets those flags on the pages themselves). The latter causes problems on architectures (like s390) that do accessed bit handling in software, which meant that fault_in_safe_writeable() didn't actually do all the fault handling it needed to, and trying to access the user address afterwards would still cause faults. Reported-and-tested-by: Andreas Gruenbacher Fixes: cdd591fc86e3 ("iov_iter: Introduce fault_in_iov_iter_writeable") Link: https://lore.kernel.org/all/CAHc6FU5nP+nziNGG0JAF1FUx-GV7kKFvM7aZuU_XD2_1v4vnvg@mail.gmail.com/ Acked-by: David Hildenbrand Signed-off-by: Linus Torvalds commit c80ee64a8020ef1a6a92109798080786829b8994 Author: Jisheng Zhang Date: Fri Feb 11 00:49:43 2022 +0800 riscv: alternative only works on !XIP_KERNEL The alternative mechanism needs runtime code patching, it can't work on XIP_KERNEL. And the errata workarounds are implemented via the alternative mechanism. So add !XIP_KERNEL dependency for alternative and erratas. Signed-off-by: Jisheng Zhang Fixes: 44c922572952 ("RISC-V: enable XIP") Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit 7e606edaa0a2e443fba9ae324efc1ba7834a0e7d Merge: d986afd5a7b75 a1cc1697bb56c Author: Arnd Bergmann Date: Thu Mar 10 15:25:45 2022 +0100 Merge tag 'mvebu-fixes-5.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/gclement/mvebu into arm/fixes mvebu fixes for 5.17 (part 2) Allow using old PCIe card on Armada 37xx * tag 'mvebu-fixes-5.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/gclement/mvebu: arm64: dts: marvell: armada-37xx: Remap IO space to bus address 0x0 Link: https://lore.kernel.org/r/87bkydj4fn.fsf@BL-laptop Signed-off-by: Arnd Bergmann commit a1cc1697bb56cdf880ad4d17b79a39ef2c294bc9 Author: Pali Rohár Date: Thu Mar 10 11:39:23 2022 +0100 arm64: dts: marvell: armada-37xx: Remap IO space to bus address 0x0 Legacy and old PCI I/O based cards do not support 32-bit I/O addressing. Since commit 64f160e19e92 ("PCI: aardvark: Configure PCIe resources from 'ranges' DT property") kernel can set different PCIe address on CPU and different on the bus for the one A37xx address mapping without any firmware support in case the bus address does not conflict with other A37xx mapping. So remap I/O space to the bus address 0x0 to enable support for old legacy I/O port based cards which have hardcoded I/O ports in low address space. Note that DDR on A37xx is mapped to bus address 0x0. And mapping of I/O space can be set to address 0x0 too because MEM space and I/O space are separate and so do not conflict. Remapping IO space on Turris Mox to different address is not possible to due bootloader bug. Signed-off-by: Pali Rohár Reported-by: Arnd Bergmann Fixes: 76f6386b25cc ("arm64: dts: marvell: Add Aardvark PCIe support for Armada 3700") Cc: stable@vger.kernel.org # 64f160e19e92 ("PCI: aardvark: Configure PCIe resources from 'ranges' DT property") Cc: stable@vger.kernel.org # 514ef1e62d65 ("arm64: dts: marvell: armada-37xx: Extend PCIe MEM space") Reviewed-by: Arnd Bergmann Signed-off-by: Gregory CLEMENT commit 95932ab2ea07b79cdb33121e2f40ccda9e6a73b5 Author: Jason Wang Date: Thu Mar 10 15:52:11 2022 +0800 vhost: allow batching hint without size Commit e2ae38cf3d91 ("vhost: fix hung thread due to erroneous iotlb entries") tries to reject the IOTLB message whose size is zero. But the size is not necessarily meaningful, one example is the batching hint, so the commit breaks that. Fixing this be reject zero size message only if the message is used to update/invalidate the IOTLB. Fixes: e2ae38cf3d91 ("vhost: fix hung thread due to erroneous iotlb entries") Reported-by: Eli Cohen Cc: Anirudh Rayabharam Signed-off-by: Jason Wang Link: https://lore.kernel.org/r/20220310075211.4801-1-jasowang@redhat.com Signed-off-by: Michael S. Tsirkin Tested-by: Eli Cohen commit 1db333d9a51f3459fba1bcaa564d95befe79f0b3 Merge: b1a384d2cbccb 1a4e53d2fc4f6 Author: Linus Torvalds Date: Thu Mar 10 04:15:09 2022 -0800 Merge tag 'spi-fix-v5.17-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi Pull spi fix from Mark Brown: "One fix for type conversion issues when working out maximum scatter/gather segment sizes. It caused problems for some systems where the limits overflow due to the type conversion" * tag 'spi-fix-v5.17-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: spi: Fix invalid sgs value commit b1a384d2cbccb1eb3f84765020d25e2c1929706e Author: Russell King (Oracle) Date: Thu Mar 10 10:22:14 2022 +0000 ARM: fix build warning in proc-v7-bugs.c The kernel test robot discovered that building without HARDEN_BRANCH_PREDICTOR issues a warning due to a missing argument to pr_info(). Add the missing argument. Reported-by: kernel test robot Fixes: 9dd78194a372 ("ARM: report Spectre v2 status through sysfs") Signed-off-by: Russell King (Oracle) Signed-off-by: Linus Torvalds commit cef06913a0af21e161a6179a17d3f5fa7132ba46 Merge: 9c674947f6112 55d01c98a88b3 Author: Linus Torvalds Date: Thu Mar 10 03:55:33 2022 -0800 Merge tag 'gpio-fixes-for-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux Pull gpio fixes from Bartosz Golaszewski: - fix a probe failure for Tegra241 GPIO controller in gpio-tegra186 - revert changes that caused a regression in the sysfs user-space interface - correct the debounce time conversion in GPIO ACPI - statify a struct in gpio-sim and fix a typo - update registers in correct order (hardware quirk) in gpio-ts4900 * tag 'gpio-fixes-for-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: gpio: sim: fix a typo gpio: ts4900: Do not set DAT and OE together gpio: sim: Declare gpio_sim_hog_config_item_ops static gpiolib: acpi: Convert ACPI value of debounce to microseconds gpio: Revert regression in sysfs-gpio (gpiolib.c) gpio: tegra186: Add IRQ per bank for Tegra241 commit 55d01c98a88b346e217eaa931b32e7baea905c9a Author: Bartosz Golaszewski Date: Tue Mar 8 09:44:54 2022 +0100 gpio: sim: fix a typo Just noticed this when applying Andy's patch. s/childred/children/ Fixes: cb8c474e79be ("gpio: sim: new testing module") Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko commit 03fe003547975680fdb9ff5ab0e41cb68276c4f2 Author: Mark Featherston Date: Wed Mar 9 17:16:16 2022 -0800 gpio: ts4900: Do not set DAT and OE together This works around an issue with the hardware where both OE and DAT are exposed in the same register. If both are updated simultaneously, the harware makes no guarantees that OE or DAT will actually change in any given order and may result in a glitch of a few ns on a GPIO pin when changing direction and value in a single write. Setting direction to input now only affects OE bit. Setting direction to output updates DAT first, then OE. Fixes: 9c6686322d74 ("gpio: add Technologic I2C-FPGA gpio support") Signed-off-by: Mark Featherston Signed-off-by: Kris Bahnsen Signed-off-by: Bartosz Golaszewski commit 9a564bccb78a76740ea9d75a259942df8143d02c Author: Haimin Zhang Date: Tue Mar 8 11:20:28 2022 +0800 af_key: add __GFP_ZERO flag for compose_sadb_supported in function pfkey_register Add __GFP_ZERO flag for compose_sadb_supported in function pfkey_register to initialize the buffer of supp_skb to fix a kernel-info-leak issue. 1) Function pfkey_register calls compose_sadb_supported to request a sk_buff. 2) compose_sadb_supported calls alloc_sbk to allocate a sk_buff, but it doesn't zero it. 3) If auth_len is greater 0, then compose_sadb_supported treats the memory as a struct sadb_supported and begins to initialize. But it just initializes the field sadb_supported_len and field sadb_supported_exttype without field sadb_supported_reserved. Reported-by: TCS Robot Signed-off-by: Haimin Zhang Signed-off-by: Steffen Klassert commit 9c674947f6112e4d68715e9f363c6698c2b0eead Merge: b5521fe9a9336 aa091a6a91df3 Author: Linus Torvalds Date: Wed Mar 9 20:58:29 2022 -0800 Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux Pull clk fixes from Stephen Boyd: "One more small batch of clk driver fixes: - A fix for the Qualcomm GDSC power domain delays that avoids black screens at boot on some more recent SoCs that use a different delay than the hard-coded delays in the driver. - A build fix LAN966X clk driver that let it be built on architectures that didn't have IOMEM" * tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: clk: lan966x: Fix linking error clk: qcom: dispcc: Update the transition delay for MDSS GDSC clk: qcom: gdsc: Add support to update GDSC transition delay commit b5521fe9a9336caa1caa2db126f1d3ba1bc8303e Merge: 3bf7edc84a9eb 66e3531b33ee5 Author: Linus Torvalds Date: Wed Mar 9 20:44:17 2022 -0800 Merge tag 'xsa396-5.17-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen fixes from Juergen Gross: "Several Linux PV device frontends are using the grant table interfaces for removing access rights of the backends in ways being subject to race conditions, resulting in potential data leaks, data corruption by malicious backends, and denial of service triggered by malicious backends: - blkfront, netfront, scsifront and the gntalloc driver are testing whether a grant reference is still in use. If this is not the case, they assume that a following removal of the granted access will always succeed, which is not true in case the backend has mapped the granted page between those two operations. As a result the backend can keep access to the memory page of the guest no matter how the page will be used after the frontend I/O has finished. The xenbus driver has a similar problem, as it doesn't check the success of removing the granted access of a shared ring buffer. - blkfront, netfront, scsifront, usbfront, dmabuf, xenbus, 9p, kbdfront, and pvcalls are using a functionality to delay freeing a grant reference until it is no longer in use, but the freeing of the related data page is not synchronized with dropping the granted access. As a result the backend can keep access to the memory page even after it has been freed and then re-used for a different purpose. - netfront will fail a BUG_ON() assertion if it fails to revoke access in the rx path. This will result in a Denial of Service (DoS) situation of the guest which can be triggered by the backend" * tag 'xsa396-5.17-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen/netfront: react properly to failing gnttab_end_foreign_access_ref() xen/gnttab: fix gnttab_end_foreign_access() without page specified xen/pvcalls: use alloc/free_pages_exact() xen/9p: use alloc/free_pages_exact() xen/usb: don't use gnttab_end_foreign_access() in xenhcd_gnttab_done() xen: remove gnttab_query_foreign_access() xen/gntalloc: don't use gnttab_query_foreign_access() xen/scsifront: don't use gnttab_query_foreign_access() for mapped status xen/netfront: don't use gnttab_query_foreign_access() for mapped status xen/blkfront: don't use gnttab_query_foreign_access() for mapped status xen/grant-table: add gnttab_try_end_foreign_access() xen/xenbus: don't let xenbus_grant_ring() remove grants in error case commit 5f147476057832b8f87461ff6da35b5d2e1c2c29 Merge: f80cfe2f26581 94a4a4fe4c696 Author: Jakub Kicinski Date: Wed Mar 9 20:23:37 2022 -0800 Merge branch 'selftests-pmtu-sh-fix-cleanup-of-processes-launched-in-subshell' Guillaume Nault says: ==================== selftests: pmtu.sh: Fix cleanup of processes launched in subshell. Depending on the options used, pmtu.sh may launch tcpdump and nettest processes in the background. However it fails to clean them up after the tests complete. Patch 1 allows the cleanup() function to read the list of PIDs launched by the tests. Patch 2 fixes the way the nettest PIDs are retrieved. ==================== Link: https://lore.kernel.org/r/cover.1646776561.git.gnault@redhat.com Signed-off-by: Jakub Kicinski commit 94a4a4fe4c696413932eed8bdec46574de9576b8 Author: Guillaume Nault Date: Tue Mar 8 23:15:03 2022 +0100 selftests: pmtu.sh: Kill nettest processes launched in subshell. When using "run_cmd &", then "$!" refers to the PID of the subshell used to run , not the command itself. Therefore nettest_pids actually doesn't contain the list of the nettest commands running in the background. So cleanup() can't kill them and the nettest processes run until completion (fortunately they have a 5s timeout). Fix this by defining a new command for running processes in the background, for which "$!" really refers to the PID of the command run. Also, double quote variables on the modified lines, to avoid shellcheck warnings. Fixes: ece1278a9b81 ("selftests: net: add ESP-in-UDP PMTU test") Signed-off-by: Guillaume Nault Reviewed-by: Shuah Khan Signed-off-by: Jakub Kicinski commit 18dfc667550fe9c032a6dcc3402b50e691e18029 Author: Guillaume Nault Date: Tue Mar 8 23:15:00 2022 +0100 selftests: pmtu.sh: Kill tcpdump processes launched by subshell. The cleanup() function takes care of killing processes launched by the test functions. It relies on variables like ${tcpdump_pids} to get the relevant PIDs. But tests are run in their own subshell, so updated *_pids values are invisible to other shells. Therefore cleanup() never sees any process to kill: $ ./tools/testing/selftests/net/pmtu.sh -t pmtu_ipv4_exception TEST: ipv4: PMTU exceptions [ OK ] TEST: ipv4: PMTU exceptions - nexthop objects [ OK ] $ pgrep -af tcpdump 6084 tcpdump -s 0 -i veth_A-R1 -w pmtu_ipv4_exception_veth_A-R1.pcap 6085 tcpdump -s 0 -i veth_R1-A -w pmtu_ipv4_exception_veth_R1-A.pcap 6086 tcpdump -s 0 -i veth_R1-B -w pmtu_ipv4_exception_veth_R1-B.pcap 6087 tcpdump -s 0 -i veth_B-R1 -w pmtu_ipv4_exception_veth_B-R1.pcap 6088 tcpdump -s 0 -i veth_A-R2 -w pmtu_ipv4_exception_veth_A-R2.pcap 6089 tcpdump -s 0 -i veth_R2-A -w pmtu_ipv4_exception_veth_R2-A.pcap 6090 tcpdump -s 0 -i veth_R2-B -w pmtu_ipv4_exception_veth_R2-B.pcap 6091 tcpdump -s 0 -i veth_B-R2 -w pmtu_ipv4_exception_veth_B-R2.pcap 6228 tcpdump -s 0 -i veth_A-R1 -w pmtu_ipv4_exception_veth_A-R1.pcap 6229 tcpdump -s 0 -i veth_R1-A -w pmtu_ipv4_exception_veth_R1-A.pcap 6230 tcpdump -s 0 -i veth_R1-B -w pmtu_ipv4_exception_veth_R1-B.pcap 6231 tcpdump -s 0 -i veth_B-R1 -w pmtu_ipv4_exception_veth_B-R1.pcap 6232 tcpdump -s 0 -i veth_A-R2 -w pmtu_ipv4_exception_veth_A-R2.pcap 6233 tcpdump -s 0 -i veth_R2-A -w pmtu_ipv4_exception_veth_R2-A.pcap 6234 tcpdump -s 0 -i veth_R2-B -w pmtu_ipv4_exception_veth_R2-B.pcap 6235 tcpdump -s 0 -i veth_B-R2 -w pmtu_ipv4_exception_veth_B-R2.pcap Fix this by running cleanup() in the context of the test subshell. Now that each test cleans the environment after completion, there's no need for calling cleanup() again when the next test starts. So let's drop it from the setup() function. This is okay because cleanup() is also called when pmtu.sh starts, so even the first test starts in a clean environment. Also, use tcpdump's immediate mode. Otherwise it might not have time to process buffered packets, resulting in missing packets or even empty pcap files for short tests. Note: PAUSE_ON_FAIL is still evaluated before cleanup(), so one can still inspect the test environment upon failure when using -p. Fixes: a92a0a7b8e7c ("selftests: pmtu: Simplify cleanup and namespace names") Signed-off-by: Guillaume Nault Reviewed-by: Shuah Khan Signed-off-by: Jakub Kicinski commit f80cfe2f26581f188429c12bd937eb905ad3ac7b Author: Pavel Skripkin Date: Tue Mar 8 21:50:07 2022 +0300 NFC: port100: fix use-after-free in port100_send_complete Syzbot reported UAF in port100_send_complete(). The root case is in missing usb_kill_urb() calls on error handling path of ->probe function. port100_send_complete() accesses devm allocated memory which will be freed on probe failure. We should kill this urbs before returning an error from probe function to prevent reported use-after-free Fail log: BUG: KASAN: use-after-free in port100_send_complete+0x16e/0x1a0 drivers/nfc/port100.c:935 Read of size 1 at addr ffff88801bb59540 by task ksoftirqd/2/26 ... Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0x8d/0x303 mm/kasan/report.c:255 __kasan_report mm/kasan/report.c:442 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:459 port100_send_complete+0x16e/0x1a0 drivers/nfc/port100.c:935 __usb_hcd_giveback_urb+0x2b0/0x5c0 drivers/usb/core/hcd.c:1670 ... Allocated by task 1255: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:436 [inline] ____kasan_kmalloc mm/kasan/common.c:515 [inline] ____kasan_kmalloc mm/kasan/common.c:474 [inline] __kasan_kmalloc+0xa6/0xd0 mm/kasan/common.c:524 alloc_dr drivers/base/devres.c:116 [inline] devm_kmalloc+0x96/0x1d0 drivers/base/devres.c:823 devm_kzalloc include/linux/device.h:209 [inline] port100_probe+0x8a/0x1320 drivers/nfc/port100.c:1502 Freed by task 1255: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:45 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free+0xff/0x140 mm/kasan/common.c:328 kasan_slab_free include/linux/kasan.h:236 [inline] __cache_free mm/slab.c:3437 [inline] kfree+0xf8/0x2b0 mm/slab.c:3794 release_nodes+0x112/0x1a0 drivers/base/devres.c:501 devres_release_all+0x114/0x190 drivers/base/devres.c:530 really_probe+0x626/0xcc0 drivers/base/dd.c:670 Reported-and-tested-by: syzbot+16bcb127fb73baeecb14@syzkaller.appspotmail.com Fixes: 0347a6ab300a ("NFC: port100: Commands mechanism implementation") Signed-off-by: Pavel Skripkin Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220308185007.6987-1-paskripkin@gmail.com Signed-off-by: Jakub Kicinski commit 3bf7edc84a9eb4007dd9a0cb8878a7e1d5ec6a3b Merge: 36168e387fa7d 52c9f93a9c482 Author: Linus Torvalds Date: Wed Mar 9 14:30:09 2022 -0800 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 build fix from Catalin Marinas: "Fix kernel build with clang LTO after the inclusion of the Spectre BHB arm64 mitigations" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: Do not include __READ_ONCE() block in assembly files commit 36168e387fa7d0f1fe0cd5cf76c8cea7aee714fa Author: Nathan Chancellor Date: Wed Mar 9 15:07:27 2022 -0700 ARM: Do not use NOCROSSREFS directive with ld.lld ld.lld does not support the NOCROSSREFS directive at the moment, which breaks the build after commit b9baf5c8c5c3 ("ARM: Spectre-BHB workaround"): ld.lld: error: ./arch/arm/kernel/vmlinux.lds:34: AT expected, but got NOCROSSREFS Support for this directive will eventually be implemented, at which point a version check can be added. To avoid breaking the build in the meantime, just define NOCROSSREFS to nothing when using ld.lld, with a link to the issue for tracking. Cc: stable@vger.kernel.org Fixes: b9baf5c8c5c3 ("ARM: Spectre-BHB workaround") Link: https://github.com/ClangBuiltLinux/linux/issues/1609 Signed-off-by: Nathan Chancellor Signed-off-by: Linus Torvalds commit 52c9f93a9c482251cb0d224faa602ba26d462be8 Author: Nathan Chancellor Date: Wed Mar 9 12:16:34 2022 -0700 arm64: Do not include __READ_ONCE() block in assembly files When building arm64 defconfig + CONFIG_LTO_CLANG_{FULL,THIN}=y after commit 558c303c9734 ("arm64: Mitigate spectre style branch history side channels"), the following error occurs: :4:2: error: invalid fixup for movz/movk instruction mov w0, #ARM_SMCCC_ARCH_WORKAROUND_3 ^ Marc figured out that moving "#include " in include/linux/arm-smccc.h into a !__ASSEMBLY__ block resolves it. The full include chain with CONFIG_LTO=y from include/linux/arm-smccc.h: include/linux/init.h include/linux/compiler.h arch/arm64/include/asm/rwonce.h arch/arm64/include/asm/alternative-macros.h arch/arm64/include/asm/assembler.h The asm/alternative-macros.h include in asm/rwonce.h only happens when CONFIG_LTO is set, which ultimately casues asm/assembler.h to be included before the definition of ARM_SMCCC_ARCH_WORKAROUND_3. As a result, the preprocessor does not expand ARM_SMCCC_ARCH_WORKAROUND_3 in __mitigate_spectre_bhb_fw, which results in the error above. Avoid this problem by just avoiding the CONFIG_LTO=y __READ_ONCE() block in asm/rwonce.h with assembly files, as nothing in that block is useful to assembly files, which allows ARM_SMCCC_ARCH_WORKAROUND_3 to be properly expanded with CONFIG_LTO=y builds. Fixes: e35123d83ee3 ("arm64: lto: Strengthen READ_ONCE() to acquire when CONFIG_LTO=y") Cc: # 5.11.x Link: https://lore.kernel.org/r/20220309155716.3988480-1-maz@kernel.org/ Reported-by: Marc Zyngier Acked-by: James Morse Signed-off-by: Nathan Chancellor Link: https://lore.kernel.org/r/20220309191633.2307110-1-nathan@kernel.org Signed-off-by: Catalin Marinas commit 37c333a5dea519973e8b6588ef7845b18ee1cb46 Merge: e7e19defa5758 fe23b6bbeac40 Author: Linus Torvalds Date: Wed Mar 9 13:47:12 2022 -0800 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid Pull HID fixes from Jiri Kosina: - sysfs attributes leak fix for Google Vivaldi driver (Dmitry Torokhov) - fix for potential out-of-bounds read in Thrustmaster driver (Pavel Skripkin) - error handling reference leak in Elo driver (Jiri Kosina) - a few new device IDs * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: HID: nintendo: check the return value of alloc_workqueue() HID: vivaldi: fix sysfs attributes leak HID: hid-thrustmaster: fix OOB read in thrustmaster_interrupts HID: elo: Revert USB reference counting HID: Add support for open wheel and no attachment to T300 HID: logitech-dj: add new lightspeed receiver id commit e7e19defa57580d679bf0d03f8a34933008a7930 Merge: 33970b031dc46 b859ebedd1e73 Author: Linus Torvalds Date: Wed Mar 9 12:59:21 2022 -0800 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fixes from Catalin Marinas: - Fix compilation of eBPF object files that indirectly include mte-kasan.h. - Fix test for execute-only permissions with EPAN (Enhanced Privileged Access Never, ARMv8.7 feature). * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: kasan: fix include error in MTE functions arm64: Ensure execute-only permissions are not allowed without EPAN commit 33970b031dc4653cc9dc80f2886976706c4c8ef1 Author: Russell King (Oracle) Date: Wed Mar 9 19:08:42 2022 +0000 ARM: fix co-processor register typo In the recent Spectre BHB patches, there was a typo that is only exposed in certain configurations: mcr p15,0,XX,c7,r5,4 should have been mcr p15,0,XX,c7,c5,4 Reported-by: kernel test robot Fixes: b9baf5c8c5c3 ("ARM: Spectre-BHB workaround") Signed-off-by: Russell King (Oracle) Acked-by: Catalin Marinas Signed-off-by: Linus Torvalds commit 99a2b9be077ae3a5d97fbf5f7782e0f2e9812978 Author: Ben Ben-Ishay Date: Wed Mar 2 17:07:08 2022 +0200 net/mlx5e: SHAMPO, reduce TIR indication SHAMPO is an RQ / WQ feature, an indication was added to the TIR in the first place to enforce suitability between connected TIR and RQ, this enforcement does not exist in current the Firmware implementation and was redundant in the first place. Fixes: 83439f3c37aa ("net/mlx5e: Add HW-GRO offload") Signed-off-by: Ben Ben-Ishay Signed-off-by: Saeed Mahameed commit ad11c4f1d8fd1f03639460e425a36f7fd0ea83f5 Author: Roi Dayan Date: Wed Feb 16 13:56:57 2022 +0200 net/mlx5e: Lag, Only handle events from highest priority multipath entry There could be multiple multipath entries but changing the port affinity for each one doesn't make much sense and there should be a default one. So only track the entry with lowest priority value. The commit doesn't affect existing users with a single entry. Fixes: 544fe7c2e654 ("net/mlx5e: Activate HW multipath and handle port affinity based on FIB events") Signed-off-by: Roi Dayan Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed commit 39bab83b119faac4bf7f07173a42ed35be95147e Author: Dima Chumak Date: Mon Jan 17 15:32:16 2022 +0200 net/mlx5: Fix offloading with ESWITCH_IPV4_TTL_MODIFY_ENABLE Only prio 1 is supported for nic mode when there is no ignore flow level support in firmware. But for switchdev mode, which supports fixed number of statically pre-allocated prios, this restriction is not relevant so it can be relaxed. Fixes: d671e109bd85 ("net/mlx5: Fix tc max supported prio for nic mode") Signed-off-by: Dima Chumak Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 063bd355595428750803d8736a9bb7c8db67d42d Author: Moshe Shemesh Date: Fri Feb 4 11:47:44 2022 +0200 net/mlx5: Fix a race on command flush flow Fix a refcount use after free warning due to a race on command entry. Such race occurs when one of the commands releases its last refcount and frees its index and entry while another process running command flush flow takes refcount to this command entry. The process which handles commands flush may see this command as needed to be flushed if the other process released its refcount but didn't release the index yet. Fix it by adding the needed spin lock. It fixes the following warning trace: refcount_t: addition on 0; use-after-free. WARNING: CPU: 11 PID: 540311 at lib/refcount.c:25 refcount_warn_saturate+0x80/0xe0 ... RIP: 0010:refcount_warn_saturate+0x80/0xe0 ... Call Trace: mlx5_cmd_trigger_completions+0x293/0x340 [mlx5_core] mlx5_cmd_flush+0x3a/0xf0 [mlx5_core] enter_error_state+0x44/0x80 [mlx5_core] mlx5_fw_fatal_reporter_err_work+0x37/0xe0 [mlx5_core] process_one_work+0x1be/0x390 worker_thread+0x4d/0x3d0 ? rescuer_thread+0x350/0x350 kthread+0x141/0x160 ? set_kthread_struct+0x40/0x40 ret_from_fork+0x1f/0x30 Fixes: 50b2412b7e78 ("net/mlx5: Avoid possible free of command entry while timeout comp handler") Signed-off-by: Moshe Shemesh Reviewed-by: Eran Ben Elisha Signed-off-by: Saeed Mahameed commit ac77998b7ac3044f0509b097da9637184598980d Author: Mohammad Kabat Date: Thu Mar 25 14:38:55 2021 +0200 net/mlx5: Fix size field in bufferx_reg struct According to HW spec the field "size" should be 16 bits in bufferx register. Fixes: e281682bf294 ("net/mlx5_core: HW data structs/types definitions cleanup") Signed-off-by: Mohammad Kabat Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed commit 78cbc6513217b00be6a9904415ef7ff3619eb035 Author: Jiapeng Chong Date: Mon Mar 7 08:43:03 2022 +0800 ftrace: Fix some W=1 warnings in kernel doc comments Clean up the following clang-w1 warning: kernel/trace/ftrace.c:7827: warning: Function parameter or member 'ops' not described in 'unregister_ftrace_function'. kernel/trace/ftrace.c:7805: warning: Function parameter or member 'ops' not described in 'register_ftrace_function'. Link: https://lkml.kernel.org/r/20220307004303.26399-1-jiapeng.chong@linux.alibaba.com Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Steven Rostedt (Google) commit caf4c86bf136845982c5103b2661751b40c474c0 Author: Nicolas Saenz Julienne Date: Mon Mar 7 19:07:40 2022 +0100 tracing/osnoise: Force quiescent states while tracing At the moment running osnoise on a nohz_full CPU or uncontested FIFO priority and a PREEMPT_RCU kernel might have the side effect of extending grace periods too much. This will entice RCU to force a context switch on the wayward CPU to end the grace period, all while introducing unwarranted noise into the tracer. This behaviour is unavoidable as overly extending grace periods might exhaust the system's memory. This same exact problem is what extended quiescent states (EQS) were created for, conversely, rcu_momentary_dyntick_idle() emulates them by performing a zero duration EQS. So let's make use of it. In the common case rcu_momentary_dyntick_idle() is fairly inexpensive: atomically incrementing a local per-CPU counter and doing a store. So it shouldn't affect osnoise's measurements (which has a 1us granularity), so we'll call it unanimously. The uncommon case involve calling rcu_momentary_dyntick_idle() after having the osnoise process: - Receive an expedited quiescent state IPI with preemption disabled or during an RCU critical section. (activates rdp->cpu_no_qs.b.exp code-path). - Being preempted within in an RCU critical section and having the subsequent outermost rcu_read_unlock() called with interrupts disabled. (t->rcu_read_unlock_special.b.blocked code-path). Neither of those are possible at the moment, and are unlikely to be in the future given the osnoise's loop design. On top of this, the noise generated by the situations described above is unavoidable, and if not exposed by rcu_momentary_dyntick_idle() will be eventually seen in subsequent rcu_read_unlock() calls or schedule operations. Link: https://lkml.kernel.org/r/20220307180740.577607-1-nsaenzju@redhat.com Cc: stable@vger.kernel.org Fixes: bce29ac9ce0b ("trace: Add osnoise tracer") Signed-off-by: Nicolas Saenz Julienne Acked-by: Paul E. McKenney Acked-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) commit f0cfe17bcc1dd2f0872966b554a148e888833ee9 Author: Daniel Bristot de Oliveira Date: Wed Mar 9 14:13:02 2022 +0100 tracing/osnoise: Do not unregister events twice Nicolas reported that using: # trace-cmd record -e all -M 10 -p osnoise --poll Resulted in the following kernel warning: ------------[ cut here ]------------ WARNING: CPU: 0 PID: 1217 at kernel/tracepoint.c:404 tracepoint_probe_unregister+0x280/0x370 [...] CPU: 0 PID: 1217 Comm: trace-cmd Not tainted 5.17.0-rc6-next-20220307-nico+ #19 RIP: 0010:tracepoint_probe_unregister+0x280/0x370 [...] CR2: 00007ff919b29497 CR3: 0000000109da4005 CR4: 0000000000170ef0 Call Trace: osnoise_workload_stop+0x36/0x90 tracing_set_tracer+0x108/0x260 tracing_set_trace_write+0x94/0xd0 ? __check_object_size.part.0+0x10a/0x150 ? selinux_file_permission+0x104/0x150 vfs_write+0xb5/0x290 ksys_write+0x5f/0xe0 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7ff919a18127 [...] ---[ end trace 0000000000000000 ]--- The warning complains about an attempt to unregister an unregistered tracepoint. This happens on trace-cmd because it first stops tracing, and then switches the tracer to nop. Which is equivalent to: # cd /sys/kernel/tracing/ # echo osnoise > current_tracer # echo 0 > tracing_on # echo nop > current_tracer The osnoise tracer stops the workload when no trace instance is actually collecting data. This can be caused both by disabling tracing or disabling the tracer itself. To avoid unregistering events twice, use the existing trace_osnoise_callback_enabled variable to check if the events (and the workload) are actually active before trying to deactivate them. Link: https://lore.kernel.org/all/c898d1911f7f9303b7e14726e7cc9678fbfb4a0e.camel@redhat.com/ Link: https://lkml.kernel.org/r/938765e17d5a781c2df429a98f0b2e7cc317b022.1646823913.git.bristot@kernel.org Cc: stable@vger.kernel.org Cc: Marcelo Tosatti Fixes: 2fac8d6486d5 ("tracing/osnoise: Allow multiple instances of the same tracer") Reported-by: Nicolas Saenz Julienne Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) commit b859ebedd1e730bbda69142fca87af4e712649a1 Author: Paul Semel Date: Tue Mar 8 10:30:58 2022 +0100 arm64: kasan: fix include error in MTE functions Fix `error: expected string literal in 'asm'`. This happens when compiling an ebpf object file that includes `net/net_namespace.h` from linux kernel headers. Include trace: include/net/net_namespace.h:10 include/linux/workqueue.h:9 include/linux/timer.h:8 include/linux/debugobjects.h:6 include/linux/spinlock.h:90 include/linux/workqueue.h:9 arch/arm64/include/asm/spinlock.h:9 arch/arm64/include/generated/asm/qrwlock.h:1 include/asm-generic/qrwlock.h:14 arch/arm64/include/asm/processor.h:33 arch/arm64/include/asm/kasan.h:9 arch/arm64/include/asm/mte-kasan.h:45 arch/arm64/include/asm/mte-def.h:14 Signed-off-by: Paul Semel Fixes: 2cb34276427a ("arm64: kasan: simplify and inline MTE functions") Cc: # 5.12.x Link: https://lore.kernel.org/r/bacb5387-2992-97e4-0c48-1ed925905bee@gmail.com Signed-off-by: Catalin Marinas commit cc7e2f596e64783ded1feebc55445199c9bd929e Merge: 71171ac8eb34c 23c7f8d7989e1 Author: David S. Miller Date: Wed Mar 9 14:48:11 2022 +0000 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec Steffen Klassert says: ==================== pull request (net): ipsec 2022-03-09 1) Fix IPv6 PMTU discovery for xfrm interfaces. From Lina Wang. 2) Revert failing for policies and states that are configured with XFRMA_IF_ID 0. It broke a user configuration. From Kai Lueke. 3) Fix a possible buffer overflow in the ESP output path. 4) Fix ESP GSO for tunnel and BEET mode on inter address family tunnels. ==================== Signed-off-by: David S. Miller commit 71171ac8eb34ce7fe6b3267dce27c313ab3cb3ac Author: Duoming Zhou Date: Tue Mar 8 16:12:23 2022 +0800 ax25: Fix NULL pointer dereference in ax25_kill_by_device When two ax25 devices attempted to establish connection, the requester use ax25_create(), ax25_bind() and ax25_connect() to initiate connection. The receiver use ax25_rcv() to accept connection and use ax25_create_cb() in ax25_rcv() to create ax25_cb, but the ax25_cb->sk is NULL. When the receiver is detaching, a NULL pointer dereference bug caused by sock_hold(sk) in ax25_kill_by_device() will happen. The corresponding fail log is shown below: =============================================================== BUG: KASAN: null-ptr-deref in ax25_device_event+0xfd/0x290 Call Trace: ... ax25_device_event+0xfd/0x290 raw_notifier_call_chain+0x5e/0x70 dev_close_many+0x174/0x220 unregister_netdevice_many+0x1f7/0xa60 unregister_netdevice_queue+0x12f/0x170 unregister_netdev+0x13/0x20 mkiss_close+0xcd/0x140 tty_ldisc_release+0xc0/0x220 tty_release_struct+0x17/0xa0 tty_release+0x62d/0x670 ... This patch add condition check in ax25_kill_by_device(). If s->sk is NULL, it will goto if branch to kill device. Fixes: 4e0f718daf97 ("ax25: improve the incomplete fix to avoid UAF and NPD bugs") Reported-by: Thomas Osterried Signed-off-by: Duoming Zhou Signed-off-by: David S. Miller commit c9ffa3e2bc451816ce0295e40063514fabf2bd36 Author: Miaoqian Lin Date: Tue Mar 8 07:42:47 2022 +0000 net: marvell: prestera: Add missing of_node_put() in prestera_switch_set_base_mac_addr This node pointer is returned by of_find_compatible_node() with refcount incremented. Calling of_node_put() to aovid the refcount leak. Fixes: 501ef3066c89 ("net: marvell: prestera: Add driver for Prestera family ASIC devices") Signed-off-by: Miaoqian Lin Signed-off-by: David S. Miller commit 2169b79258c8be803d2595d6456b1e77129fe154 Author: Jiasheng Jiang Date: Tue Mar 8 14:57:39 2022 +0800 net: ethernet: lpc_eth: Handle error for clk_enable As the potential failure of the clk_enable(), it should be better to check it and return error if fails. Fixes: b7370112f519 ("lpc32xx: Added ethernet driver") Signed-off-by: Jiasheng Jiang Signed-off-by: David S. Miller commit 2a760554dcba450d3ad61b32375b50ed6d59a87c Author: Minghao Chi (CGEL ZTE) Date: Tue Mar 8 06:43:09 2022 +0000 net:mcf8390: Use platform_get_irq() to get the interrupt It is not recommened to use platform_get_resource(pdev, IORESOURCE_IRQ) for requesting IRQ's resources any more, as they can be not ready yet in case of DT-booting. platform_get_irq() instead is a recommended way for getting IRQ even if it was not retrieved earlier. It also makes code simpler because we're getting "int" value right away and no conversion from resource to int is required. Reported-by: Zeal Robot Signed-off-by: Minghao Chi (CGEL ZTE) Signed-off-by: David S. Miller commit 6babfc6e6fab068018c36e8f6605184b8c0b349d Author: Jiasheng Jiang Date: Tue Mar 8 14:40:07 2022 +0800 net: ethernet: ti: cpts: Handle error for clk_enable As the potential failure of the clk_enable(), it should be better to check it and return error if fails. Fixes: 8a2c9a5ab4b9 ("net: ethernet: ti: cpts: rework initialization/deinitialization") Signed-off-by: Jiasheng Jiang Signed-off-by: David S. Miller commit 445c1470b6ef96440e7cfc42dfc160f5004fd149 Author: Ross Philipson Date: Wed Feb 23 21:07:36 2022 -0500 x86/boot: Add setup_indirect support in early_memremap_is_setup_data() The x86 boot documentation describes the setup_indirect structures and how they are used. Only one of the two functions in ioremap.c that needed to be modified to be aware of the introduction of setup_indirect functionality was updated. Adds comparable support to the other function where it was missing. Fixes: b3c72fc9a78e ("x86/boot: Introduce setup_indirect") Signed-off-by: Ross Philipson Signed-off-by: Borislav Petkov Reviewed-by: Daniel Kiper Cc: Link: https://lore.kernel.org/r/1645668456-22036-3-git-send-email-ross.philipson@oracle.com commit 7228918b34615ef6317edcd9a058a057bc54aa32 Author: Ross Philipson Date: Wed Feb 23 21:07:35 2022 -0500 x86/boot: Fix memremap of setup_indirect structures As documented, the setup_indirect structure is nested inside the setup_data structures in the setup_data list. The code currently accesses the fields inside the setup_indirect structure but only the sizeof(struct setup_data) is being memremapped. No crash occurred but this is just due to how the area is remapped under the covers. Properly memremap both the setup_data and setup_indirect structures in these cases before accessing them. Fixes: b3c72fc9a78e ("x86/boot: Introduce setup_indirect") Signed-off-by: Ross Philipson Signed-off-by: Borislav Petkov Reviewed-by: Daniel Kiper Cc: Link: https://lore.kernel.org/r/1645668456-22036-2-git-send-email-ross.philipson@oracle.com commit 030141b0fce1e823190b07b1a592b5ccdab3f5fd Merge: c79fcc27be90b ad35ffa252af6 Author: David S. Miller Date: Wed Mar 9 10:42:14 2022 +0000 Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2022-03-08 This series contains updates to iavf, i40e, and ice drivers. Michal ensures netdev features are properly updated to reflect VLAN changes received from PF and adds an additional flag for MSI-X reinitialization as further differentiation of reinitialization operations is needed for iavf. Jake stops disabling of VFs due to failed virtchannel responses for i40e and ice driver. Dave moves MTU event notification to the service task to prevent issues with RTNL lock for ice. Christophe Jaillet corrects an allocation to GFP_ATOMIC instead of GFP_KERNEL for ice. Jedrzej fixes the value for link speed comparison which was preventing the requested value from being set for ice. --- Note: This will conflict when merging with net-next. Resolution: diff --cc drivers/net/ethernet/intel/ice/ice.h index dc42ff92dbad,3121f9b04f59..000000000000 --- a/drivers/net/ethernet/intel/ice/ice.h +++ b/drivers/net/ethernet/intel/ice/ice.h @@@ -484,10 -481,9 +484,11 @@@ enum ice_pf_flags ICE_FLAG_LEGACY_RX, ICE_FLAG_VF_TRUE_PROMISC_ENA, ICE_FLAG_MDD_AUTO_RESET_VF, + ICE_FLAG_VF_VLAN_PRUNING, ICE_FLAG_LINK_LENIENT_MODE_ENA, ICE_FLAG_PLUG_AUX_DEV, + ICE_FLAG_MTU_CHANGED, + ICE_FLAG_GNSS, /* GNSS successfully initialized */ ICE_PF_FLAGS_NBITS /* must be last */ }; ==================== Signed-off-by: David S. Miller commit c79fcc27be90b308b3fa90811aefafdd4078668c Author: Tung Nguyen Date: Tue Mar 8 02:11:59 2022 +0000 tipc: fix incorrect order of state message data sanity check When receiving a state message, function tipc_link_validate_msg() is called to validate its header portion. Then, its data portion is validated before it can be accessed correctly. However, current data sanity check is done after the message header is accessed to update some link variables. This commit fixes this issue by moving the data sanity check to the beginning of state message handling and right after the header sanity check. Fixes: 9aa422ad3266 ("tipc: improve size validations for received domain records") Acked-by: Jon Maloy Signed-off-by: Tung Nguyen Link: https://lore.kernel.org/r/20220308021200.9245-1-tung.q.nguyen@dektech.com.au Signed-off-by: Jakub Kicinski commit b19ab4b38b06aae12442b2de95ccf58b5dc53584 Author: Miaoqian Lin Date: Tue Mar 8 02:47:49 2022 +0000 ethernet: Fix error handling in xemaclite_of_probe This node pointer is returned by of_parse_phandle() with refcount incremented in this function. Calling of_node_put() to avoid the refcount leak. As the remove function do. Fixes: 5cdaaa12866e ("net: emaclite: adding MDIO and phy lib support") Signed-off-by: Miaoqian Lin Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220308024751.2320-1-linmq006@gmail.com Signed-off-by: Jakub Kicinski commit 0a5aa8d161d19a1b12fd25b434b32f7c885c73bb Author: Shin'ichiro Kawasaki Date: Tue Mar 8 17:09:15 2022 +0900 block: fix blk_mq_attempt_bio_merge and rq_qos_throttle protection Commit 9d497e2941c3 ("block: don't protect submit_bio_checks by q_usage_counter") moved blk_mq_attempt_bio_merge and rq_qos_throttle calls out of q_usage_counter protection. However, these functions require q_usage_counter protection. The blk_mq_attempt_bio_merge call without the protection resulted in blktests block/005 failure with KASAN null- ptr-deref or use-after-free at bio merge. The rq_qos_throttle call without the protection caused kernel hang at qos throttle. To fix the failures, move the blk_mq_attempt_bio_merge and rq_qos_throttle calls back to q_usage_counter protection. Fixes: 9d497e2941c3 ("block: don't protect submit_bio_checks by q_usage_counter") Signed-off-by: Shin'ichiro Kawasaki Link: https://lore.kernel.org/r/20220308080915.3473689-1-shinichiro.kawasaki@wdc.com Reviewed-by: Ming Lei Signed-off-by: Jens Axboe commit ad35ffa252af67d4cc7c744b9377a2b577748e3f Author: Jedrzej Jagielski Date: Tue Feb 22 11:43:04 2022 +0000 ice: Fix curr_link_speed advertised speed Change curr_link_speed advertised speed, due to link_info.link_speed is not equal phy.curr_user_speed_req. Without this patch it is impossible to set advertised speed to same as link_speed. Testing Hints: Try to set advertised speed to 25G only with 25G default link (use ethtool -s 0x80000000) Fixes: 48cb27f2fd18 ("ice: Implement handlers for ethtool PHY/link operations") Signed-off-by: Grzegorz Siwik Signed-off-by: Jedrzej Jagielski Tested-by: Gurucharan (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 3d97f1afd8d831e0c0dc1157418f94b8faa97b54 Author: Christophe JAILLET Date: Sun Jan 16 19:46:20 2022 +0100 ice: Don't use GFP_KERNEL in atomic context ice_misc_intr() is an irq handler. It should not sleep. Use GFP_ATOMIC instead of GFP_KERNEL when allocating some memory. Fixes: 348048e724a0 ("ice: Implement iidc operations") Signed-off-by: Christophe JAILLET Tested-by: Leszek Kaliszczuk Signed-off-by: Tony Nguyen commit 97b0129146b1544bbb0773585327896da3bb4e0a Author: Dave Ertman Date: Fri Feb 18 12:39:25 2022 -0800 ice: Fix error with handling of bonding MTU When a bonded interface is destroyed, .ndo_change_mtu can be called during the tear-down process while the RTNL lock is held. This is a problem since the auxiliary driver linked to the LAN driver needs to be notified of the MTU change, and this requires grabbing a device_lock on the auxiliary_device's dev. Currently this is being attempted in the same execution context as the call to .ndo_change_mtu which is causing a dead-lock. Move the notification of the changed MTU to a separate execution context (watchdog service task) and eliminate the "before" notification. Fixes: 348048e724a0e ("ice: Implement iidc operations") Signed-off-by: Dave Ertman Tested-by: Jonathan Toppins Tested-by: Gurucharan G (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit 79498d5af8e458102242d1667cf44df1f1564e63 Author: Jacob Keller Date: Wed Feb 16 16:51:36 2022 -0800 ice: stop disabling VFs due to PF error responses The ice_vc_send_msg_to_vf function has logic to detect "failure" responses being sent to a VF. If a VF is sent more than ICE_DFLT_NUM_INVAL_MSGS_ALLOWED then the VF is marked as disabled. Almost identical logic also existed in the i40e driver. This logic was added to the ice driver in commit 1071a8358a28 ("ice: Implement virtchnl commands for AVF support") which itself copied from the i40e implementation in commit 5c3c48ac6bf5 ("i40e: implement virtual device interface"). Neither commit provides a proper explanation or justification of the check. In fact, later commits to i40e changed the logic to allow bypassing the check in some specific instances. The "logic" for this seems to be that error responses somehow indicate a malicious VF. This is not really true. The PF might be sending an error for any number of reasons such as lack of resources, etc. Additionally, this causes the PF to log an info message for every failed VF response which may confuse users, and can spam the kernel log. This behavior is not documented as part of any requirement for our products and other operating system drivers such as the FreeBSD implementation of our drivers do not include this type of check. In fact, the change from dev_err to dev_info in i40e commit 18b7af57d9c1 ("i40e: Lower some message levels") explains that these messages typically don't actually indicate a real issue. It is quite likely that a user who hits this in practice will be very confused as the VF will be disabled without an obvious way to recover. We already have robust malicious driver detection logic using actual hardware detection mechanisms that detect and prevent invalid device usage. Remove the logic since its not a documented requirement and the behavior is not intuitive. Fixes: 1071a8358a28 ("ice: Implement virtchnl commands for AVF support") Signed-off-by: Jacob Keller Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit 5710ab79166504013f7c0ae6a57e7d2fd26e5c43 Author: Jacob Keller Date: Wed Feb 16 16:51:35 2022 -0800 i40e: stop disabling VFs due to PF error responses The i40e_vc_send_msg_to_vf_ex (and its wrapper i40e_vc_send_msg_to_vf) function has logic to detect "failure" responses sent to the VF. If a VF is sent more than I40E_DEFAULT_NUM_INVALID_MSGS_ALLOWED, then the VF is marked as disabled. In either case, a dev_info message is printed stating that a VF opcode failed. This logic originates from the early implementation of VF support in commit 5c3c48ac6bf5 ("i40e: implement virtual device interface"). That commit did not go far enough. The "logic" for this behavior seems to be that error responses somehow indicate a malicious VF. This is not really true. The PF might be sending an error for any number of reasons such as lacking resources, an unsupported operation, etc. This does not indicate a malicious VF. We already have a separate robust malicious VF detection which relies on hardware logic to detect and prevent a variety of behaviors. There is no justification for this behavior in the original implementation. In fact, a later commit 18b7af57d9c1 ("i40e: Lower some message levels") reduced the opcode failure message from a dev_err to a dev_info. In addition, recent commit 01cbf50877e6 ("i40e: Fix to not show opcode msg on unsuccessful VF MAC change") changed the logic to allow quieting it for expected failures. That commit prevented this logic from kicking in for specific circumstances. This change did not go far enough. The behavior is not documented nor is it part of any requirement for our products. Other operating systems such as the FreeBSD implementation of our driver do not include this logic. It is clear this check does not make sense, and causes problems which led to ugly workarounds. Fix this by just removing the entire logic and the need for the i40e_vc_send_msg_to_vf_ex function. Fixes: 01cbf50877e6 ("i40e: Fix to not show opcode msg on unsuccessful VF MAC change") Fixes: 5c3c48ac6bf5 ("i40e: implement virtual device interface") Signed-off-by: Jacob Keller Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit 57d03f5608c34079f6f15031f4e8b1e2ae95dcb0 Author: Michal Maloszewski Date: Wed Feb 2 12:44:54 2022 +0000 iavf: Fix adopting new combined setting In some cases overloaded flag IAVF_FLAG_REINIT_ITR_NEEDED which should indicate that interrupts need to be completely reinitialized during reset leads to RTNL deadlocks using ethtool -C while a reset is in progress. To fix, it was added a new flag IAVF_FLAG_REINIT_MSIX_NEEDED used to trigger MSI-X reinit. New combined setting is fixed adopt after VF reset. This has been implemented by call reinit interrupt scheme during VF reset. Without this fix new combined setting has never been adopted. Fixes: 209f2f9c7181 ("iavf: Add support for VIRTCHNL_VF_OFFLOAD_VLAN_V2 negotiation") Signed-off-by: Grzegorz Szczurek Signed-off-by: Mitch Williams Signed-off-by: Michal Maloszewski Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit 2cf29e55894886965722e6625f6a03630b4db31d Author: Michal Maloszewski Date: Mon Jan 24 13:35:43 2022 +0000 iavf: Fix handling of vlan strip virtual channel messages Modify netdev->features for vlan stripping based on virtual channel messages received from the PF. Change is needed to synchronize vlan strip status between PF sysfs and iavf ethtool. Fixes: 5951a2b9812d ("iavf: Fix VLAN feature flags after VFR") Signed-off-by: Norbert Ciosek Signed-off-by: Michal Maloszewski Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit 330f4c53d3c2d8b11d86ec03a964b86dc81452f5 Author: Emmanuel Gil Peyrot Date: Tue Mar 8 20:18:20 2022 +0100 ARM: fix build error when BPF_SYSCALL is disabled It was missing a semicolon. Signed-off-by: Emmanuel Gil Peyrot Reviewed-by: Nathan Chancellor Fixes: 25875aa71dfe ("ARM: include unprivileged BPF status in Spectre V2 reporting"). Signed-off-by: Linus Torvalds commit 4f86a6b46e5377a300b1d49f51c687450f72fb6d Merge: 92f90cc9fe0e7 f6eafa4022dd6 Author: Linus Torvalds Date: Tue Mar 8 11:52:45 2022 -0800 Merge tag 'devicetree-fixes-for-5.17-3' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux Pull devicetree fixes from Rob Herring: - Fix pinctrl node name warnings in examples - Add missing 'mux-states' property in ti,tcan104x-can binding * tag 'devicetree-fixes-for-5.17-3' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: dt-bindings: phy: ti,tcan104x-can: Document mux-states property dt-bindings: mfd: Fix pinctrl node name warnings commit 92f90cc9fe0e7a984ea3d4bf3d120e30ba8a2118 Merge: cd22a8bfcfe07 0c4bcfdecb1ac Author: Linus Torvalds Date: Tue Mar 8 09:41:18 2022 -0800 Merge tag 'fuse-fixes-5.17-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse Pull fuse fixes from Miklos Szeredi: - Fix an issue with splice on the fuse device - Fix a regression in the fileattr API conversion - Add a small userspace API improvement * tag 'fuse-fixes-5.17-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse: fuse: fix pipe buffer lifetime for direct_io fuse: move FUSE_SUPER_MAGIC definition to magic.h fuse: fix fileattr op failure commit cd22a8bfcfe07ef35b1b5d96dd468e92dc5e9d8a Merge: fc55c23a736cc 58c9a5060cb7c Author: Linus Torvalds Date: Tue Mar 8 09:27:25 2022 -0800 Merge tag 'arm64-spectre-bhb-for-v5.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 spectre fixes from James Morse: "ARM64 Spectre-BHB mitigations: - Make EL1 vectors per-cpu - Add mitigation sequences to the EL1 and EL2 vectors on vulnerble CPUs - Implement ARCH_WORKAROUND_3 for KVM guests - Report Vulnerable when unprivileged eBPF is enabled" * tag 'arm64-spectre-bhb-for-v5.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: proton-pack: Include unprivileged eBPF status in Spectre v2 mitigation reporting arm64: Use the clearbhb instruction in mitigations KVM: arm64: Allow SMCCC_ARCH_WORKAROUND_3 to be discovered and migrated arm64: Mitigate spectre style branch history side channels arm64: proton-pack: Report Spectre-BHB vulnerabilities as part of Spectre-v2 arm64: Add percpu vectors for EL1 arm64: entry: Add macro for reading symbol addresses from the trampoline arm64: entry: Add vectors that have the bhb mitigation sequences arm64: entry: Add non-kpti __bp_harden_el1_vectors for mitigations arm64: entry: Allow the trampoline text to occupy multiple pages arm64: entry: Make the kpti trampoline's kpti sequence optional arm64: entry: Move trampoline macros out of ifdef'd section arm64: entry: Don't assume tramp_vectors is the start of the vectors arm64: entry: Allow tramp_alias to access symbols after the 4K boundary arm64: entry: Move the trampoline data page before the text page arm64: entry: Free up another register on kpti's tramp_exit path arm64: entry: Make the trampoline cleanup optional KVM: arm64: Allow indirect vectors to be used without SPECTRE_V3A arm64: spectre: Rename spectre_v4_patch_fw_mitigation_conduit arm64: entry.S: Add ventry overflow sanity checks commit fc55c23a736cce88f5f975ab93326d25b49ef109 Merge: 4a01e748a51cd 25875aa71dfef Author: Linus Torvalds Date: Tue Mar 8 09:08:06 2022 -0800 Merge tag 'for-linus-bhb' of git://git.armlinux.org.uk/~rmk/linux-arm Pull ARM spectre fixes from Russell King: "ARM Spectre BHB mitigations. These patches add Spectre BHB migitations for the following Arm CPUs to the 32-bit ARM kernels: - Cortex A15 - Cortex A57 - Cortex A72 - Cortex A73 - Cortex A75 - Brahma B15 for CVE-2022-23960" * tag 'for-linus-bhb' of git://git.armlinux.org.uk/~rmk/linux-arm: ARM: include unprivileged BPF status in Spectre V2 reporting ARM: Spectre-BHB workaround ARM: use LOADADDR() to get load address of sections ARM: early traps initialisation ARM: report Spectre v2 status through sysfs commit f6eafa4022dd61e029205bea4d4147d26e69fef2 Author: Aswath Govindraju Date: Thu Dec 16 09:40:11 2021 +0530 dt-bindings: phy: ti,tcan104x-can: Document mux-states property On some boards, for routing CAN signals from controller to transceivers, muxes might need to be set. This can be implemented using mux-states property. Therefore, document the same in the respective bindings. Signed-off-by: Aswath Govindraju Reviewed-by: Rob Herring Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211216041012.16892-2-a-govindraju@ti.com commit 7e807f4b081c5813df21da54e9a0491ea2ce16e7 Author: Rob Herring Date: Thu Mar 3 17:23:49 2022 -0600 dt-bindings: mfd: Fix pinctrl node name warnings The recent addition pinctrl.yaml in commit c09acbc499e8 ("dt-bindings: pinctrl: use pinctrl.yaml") resulted in some node name warnings: Documentation/devicetree/bindings/mfd/cirrus,lochnagar.example.dt.yaml: \ lochnagar-pinctrl: $nodename:0: 'lochnagar-pinctrl' does not match '^(pinctrl|pinmux)(@[0-9a-f]+)?$' Documentation/devicetree/bindings/mfd/cirrus,madera.example.dt.yaml: \ codec@1a: $nodename:0: 'codec@1a' does not match '^(pinctrl|pinmux)(@[0-9a-f]+)?$' Documentation/devicetree/bindings/mfd/brcm,cru.example.dt.yaml: \ pin-controller@1c0: $nodename:0: 'pin-controller@1c0' does not match '^(pinctrl|pinmux)(@[0-9a-f]+)?$' Fix the node names to the preferred 'pinctrl'. For cirrus,madera, nothing from pinctrl.yaml schema is used, so just drop the reference. Fixes: c09acbc499e8 ("dt-bindings: pinctrl: use pinctrl.yaml") Cc: Rafał Miłecki Signed-off-by: Rob Herring Acked-by: Charles Keepax Acked-by: Lee Jones Link: https://lore.kernel.org/r/20220303232350.2591143-1-robh@kernel.org commit d986afd5a7b75b477ac347b222354cecd97edc87 Author: Jisheng Zhang Date: Fri Mar 4 15:55:59 2022 +0800 MAINTAINERS: Update Jisheng's email address I'm leaving synaptics. Update my email address to my korg mail address and add entries to .mailmap as well to map my work addresses to korg mail address. Signed-off-by: Jisheng Zhang Link: https://lore.kernel.org/r/ce7213bd-28ac-6580-466e-875e755fe0ae@synaptics.com' Signed-off-by: Arnd Bergmann commit ee0a4dc9f317fb9a97f20037d219802ca8de939b Author: Florian Westphal Date: Tue Mar 8 17:28:38 2022 +0100 Revert "netfilter: conntrack: tag conntracks picked up in local out hook" This was a prerequisite for the ill-fated "netfilter: nat: force port remap to prevent shadowing well-known ports". As this has been reverted, this change can be backed out too. Signed-off-by: Florian Westphal commit d25ca90833073f2b807e0e697dcf05ba75396de7 Merge: d3258737afc01 1860d30466366 Author: Arnd Bergmann Date: Tue Mar 8 17:25:23 2022 +0100 Merge tag 'arm-soc/for-5.18/maintainers' of https://github.com/Broadcom/stblinux into arm/fixes This pull request updates the MAINTAINERS file for Broadcom SoCs, please pull the following for 5.18: - Kuldeep updates the Broadcom iProc entry to use the same up to date Linux tree as the other Broadcom SoCs. * tag 'arm-soc/for-5.18/maintainers' of https://github.com/Broadcom/stblinux: MAINTAINERS: Update git tree for Broadcom iProc SoCs Link: https://lore.kernel.org/r/20220307194817.3754107-4-f.fainelli@gmail.com Signed-off-by: Arnd Bergmann commit 25875aa71dfefd1959f07e626c4d285b88b27ac2 Author: Russell King (Oracle) Date: Mon Mar 7 19:28:32 2022 +0000 ARM: include unprivileged BPF status in Spectre V2 reporting The mitigations for Spectre-BHB are only applied when an exception is taken, but when unprivileged BPF is enabled, userspace can load BPF programs that can be used to exploit the problem. When unprivileged BPF is enabled, report the vulnerable status via the spectre_v2 sysfs file. Signed-off-by: Russell King (Oracle) commit d3258737afc0101f497745f83fc4038c963a6b81 Author: Robert Foss Date: Tue Mar 8 10:49:11 2022 +0100 Revert "arm64: dts: mt8183: jacuzzi: Fix bus properties in anx's DSI endpoint" This reverts commit 32568ae37596b529628ac09b875f4874e614f63f. Signed-off-by: Robert Foss Reviewed-by: Chen-Yu Tsai Reviewed-by: Laurent Pinchart Acked-by: Matthias Brugger Signed-off-by: Arnd Bergmann commit 979452fbc43028675b5a5da156f91928b739dea8 Author: Robert Foss Date: Tue Mar 8 10:49:10 2022 +0100 dt-bindings: drm/bridge: anx7625: Revert DPI support Revert DPI support from binding. DPI support relies on the bus-type enum which does not yet support Mipi DPI, since no v4l2_fwnode_bus_type has been defined for this bus type. When DPI for anx7625 was initially added, it assumed that V4L2_FWNODE_BUS_TYPE_PARALLEL was the correct bus type for representing DPI, which it is not. In order to prevent adding this mis-usage to the ABI, let's revert the support. Signed-off-by: Robert Foss Reviewed-by: Laurent Pinchart Reviewed-by: Rob Herring Signed-off-by: Arnd Bergmann commit 5adf349439d29f92467e864f728dfc23180f3ef9 Author: Peter Zijlstra Date: Thu Mar 3 12:23:23 2022 +0100 x86/module: Fix the paravirt vs alternative order Ever since commit 4e6292114c74 ("x86/paravirt: Add new features for paravirt patching") there is an ordering dependency between patching paravirt ops and patching alternatives, the module loader still violates this. Fixes: 4e6292114c74 ("x86/paravirt: Add new features for paravirt patching") Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Miroslav Benes Cc: Link: https://lore.kernel.org/r/20220303112825.068773913@infradead.org commit a82c25c366b0963d33ddf699196e6cf57f6d89b1 Author: Florian Westphal Date: Tue Mar 8 13:52:11 2022 +0100 Revert "netfilter: nat: force port remap to prevent shadowing well-known ports" This reverts commit 878aed8db324bec64f3c3f956e64d5ae7375a5de. This change breaks existing setups where conntrack is used with asymmetric paths. In these cases, the NAT transformation occurs on the syn-ack instead of the syn: 1. SYN x:12345 -> y -> 443 // sent by initiator, receiverd by responder 2. SYNACK y:443 -> x:12345 // First packet seen by conntrack, as sent by responder 3. tuple_force_port_remap() gets called, sees: 'tcp from 443 to port 12345 NAT' -> pick a new source port, inititor receives 4. SYNACK y:$RANDOM -> x:12345 // connection is never established While its possible to avoid the breakage with NOTRACK rules, a kernel update should not break working setups. An alternative to the revert is to augment conntrack to tag mid-stream connections plus more code in the nat core to skip NAT for such connections, however, this leads to more interaction/integration between conntrack and NAT. Therefore, revert, users will need to add explicit nat rules to avoid port shadowing. Link: https://lore.kernel.org/netfilter-devel/20220302105908.GA5852@breakpoint.cc/#R Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2051413 Signed-off-by: Florian Westphal commit 2f6edb6bcb2f3f41d876e0eba2ba97f87a0296ea Author: Joel Stanley Date: Tue Mar 8 10:36:31 2022 +1030 ARM: dts: aspeed: Fix AST2600 quad spi group Requesting quad mode for the FMC resulted in an error: &fmc { status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_fwqspi_default>' [ 0.742963] aspeed-g6-pinctrl 1e6e2000.syscon:pinctrl: invalid function FWQSPID in map table  This is because the quad mode pins are a group of pins, not a function. After applying this patch we can request the pins and the QSPI data lines are muxed: # cat /sys/kernel/debug/pinctrl/1e6e2000.syscon\:pinctrl-aspeed-g6-pinctrl/pinmux-pins |grep 1e620000.spi pin 196 (AE12): device 1e620000.spi function FWSPID group FWQSPID pin 197 (AF12): device 1e620000.spi function FWSPID group FWQSPID pin 240 (Y1): device 1e620000.spi function FWSPID group FWQSPID pin 241 (Y2): device 1e620000.spi function FWSPID group FWQSPID pin 242 (Y3): device 1e620000.spi function FWSPID group FWQSPID pin 243 (Y4): device 1e620000.spi function FWSPID group FWQSPID Fixes: f510f04c8c83 ("ARM: dts: aspeed: Add AST2600 pinmux nodes") Signed-off-by: Joel Stanley Reviewed-by: Andrew Jeffery Link: https://lore.kernel.org/r/20220304011010.974863-1-joel@jms.id.au Link: https://lore.kernel.org/r/20220304011010.974863-1-joel@jms.id.au' Signed-off-by: Arnd Bergmann commit 60392db617b5ccd7ba3bfa03673a45085bcfe3ee Merge: 5125091d757a2 7401b49c50c2b Author: Arnd Bergmann Date: Tue Mar 8 13:43:41 2022 +0100 Merge tag 'tegra-for-5.17-arm-dt-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/fixes ARM: tegra: Device tree fixes for v5.17 One more patch to fix up eDP panels on Nyan FHD models. * tag 'tegra-for-5.17-arm-dt-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: ARM: tegra: Move Nyan FHD panels to AUX bus ARM: tegra: Move panels to AUX bus Link: https://lore.kernel.org/r/20220308084339.2199400-1-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit 1a4e53d2fc4f68aa654ad96d13ad042e1a8e8a7d Author: Biju Das Date: Mon Mar 7 18:48:43 2022 +0000 spi: Fix invalid sgs value max_seg_size is unsigned int and it can have a value up to 2^32 (for eg:-RZ_DMAC driver sets dma_set_max_seg_size as U32_MAX) When this value is used in min_t() as an integer type, it becomes -1 and the value of sgs becomes 0. Fix this issue by replacing the 'int' data type with 'unsigned int' in min_t(). Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20220307184843.9994-1-biju.das.jz@bp.renesas.com Signed-off-by: Mark Brown commit e5417cbf7ab5df1632e68fe7d9e6331fc0e7dbd6 Author: Russell King (Oracle) Date: Mon Mar 7 12:13:30 2022 +0000 net: dsa: mt7530: fix incorrect test in mt753x_phylink_validate() Discussing one of the tests in mt753x_phylink_validate() with Landen Chao confirms that the "||" should be "&&". Fix this. Fixes: c288575f7810 ("net: dsa: mt7530: Add the support of MT7531 switch") Signed-off-by: Russell King (Oracle) Link: https://lore.kernel.org/r/E1nRCF0-00CiXD-7q@rmk-PC.armlinux.org.uk Signed-off-by: Paolo Abeni commit 9470c29faa91c804aa04de4c10634bf02462bfa5 Author: Jernej Skrabec Date: Mon Feb 28 19:14:36 2022 +0100 drm/sun4i: mixer: Fix P010 and P210 format numbers It turns out that DE3 manual has inverted YUV and YVU format numbers for P010 and P210. Invert them. This was tested by playing video decoded to P010 and additionally confirmed by looking at BSP driver source. Fixes: 169ca4b38932 ("drm/sun4i: Add separate DE3 VI layer formats") Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220228181436.1424550-1-jernej.skrabec@gmail.com commit 6e2edd6371a497a6350bb735534c9bda2a31f43d Author: Catalin Marinas Date: Thu Mar 3 18:00:44 2022 +0000 arm64: Ensure execute-only permissions are not allowed without EPAN Commit 18107f8a2df6 ("arm64: Support execute-only permissions with Enhanced PAN") re-introduced execute-only permissions when EPAN is available. When EPAN is not available, arch_filter_pgprot() is supposed to change a PAGE_EXECONLY permission into PAGE_READONLY_EXEC. However, if BTI or MTE are present, such check does not detect the execute-only pgprot in the presence of PTE_GP (BTI) or MT_NORMAL_TAGGED (MTE), allowing the user to request PROT_EXEC with PROT_BTI or PROT_MTE. Remove the arch_filter_pgprot() function, change the default VM_EXEC permissions to PAGE_READONLY_EXEC and update the protection_map[] array at core_initcall() if EPAN is detected. Signed-off-by: Catalin Marinas Fixes: 18107f8a2df6 ("arm64: Support execute-only permissions with Enhanced PAN") Cc: # 5.13.x Acked-by: Will Deacon Reviewed-by: Vladimir Murzin Tested-by: Vladimir Murzin commit a9a5b720dc8227243f433141ba1343aa53ef57e4 Author: Andy Shevchenko Date: Mon Mar 7 18:38:40 2022 +0200 gpio: sim: Declare gpio_sim_hog_config_item_ops static Compiler is not happy: warning: symbol 'gpio_sim_hog_config_item_ops' was not declared. Should it be static? Fixes: cb8c474e79be ("gpio: sim: new testing module") Signed-off-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit 4a01e748a51cdc0527fdc913546dd46e822aa00d Merge: ea4424be16887 0de05d056afdb Author: Linus Torvalds Date: Mon Mar 7 17:29:47 2022 -0800 Merge tag 'x86_bugs_for_v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 spectre fixes from Borislav Petkov: - Mitigate Spectre v2-type Branch History Buffer attacks on machines which support eIBRS, i.e., the hardware-assisted speculation restriction after it has been shown that such machines are vulnerable even with the hardware mitigation. - Do not use the default LFENCE-based Spectre v2 mitigation on AMD as it is insufficient to mitigate such attacks. Instead, switch to retpolines on all AMD by default. - Update the docs and add some warnings for the obviously vulnerable cmdline configurations. * tag 'x86_bugs_for_v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/speculation: Warn about eIBRS + LFENCE + Unprivileged eBPF + SMT x86/speculation: Warn about Spectre v2 LFENCE mitigation x86/speculation: Update link to AMD speculation whitepaper x86/speculation: Use generic retpoline by default on AMD x86/speculation: Include unprivileged eBPF status in Spectre v2 mitigation reporting Documentation/hw-vuln: Update spectre doc x86/speculation: Add eIBRS + Retpoline options x86/speculation: Rename RETPOLINE_AMD to RETPOLINE_LFENCE commit 5125091d757a251a128ec38d2397c9d160394eac Author: Krzysztof Kozlowski Date: Mon Mar 7 18:28:05 2022 +0100 MAINTAINERS: update Krzysztof Kozlowski's email Use Krzysztof Kozlowski's @kernel.org account in maintainer entries. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220307172805.156760-1-krzysztof.kozlowski@canonical.com' Signed-off-by: Arnd Bergmann commit 537c3757b4e3116ad5ab039029b830224f9154d9 Merge: a0e897d1b3679 ebea268ea583b Author: Arnd Bergmann Date: Mon Mar 7 23:23:56 2022 +0100 Merge tag 'tegra-for-5.17-arm64-dt-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/fixes arm64: tegra: Device tree fixes for v5.17 This contains a single, last-minute fix to disable the display SMMU by default because under some circumstances leaving it enabled by default can cause SMMU faults on boot. * tag 'tegra-for-5.17-arm64-dt-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: arm64: tegra: Disable ISO SMMU for Tegra194 Link: https://lore.kernel.org/r/20220307182120.2169598-1-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit e941dc13fd3717122207d74539ab95da07ef797f Author: Linus Walleij Date: Fri Mar 4 13:17:33 2022 -0800 Input: zinitix - do not report shadow fingers I observed the following problem with the BT404 touch pad running the Phosh UI: When e.g. typing on the virtual keyboard pressing "g" would produce "ggg". After some analysis it turns out the firmware reports that three fingers hit that coordinate at the same time, finger 0, 2 and 4 (of the five available 0,1,2,3,4). DOWN Zinitix-TS 3-0020: finger 0 down (246, 395) Zinitix-TS 3-0020: finger 1 up (0, 0) Zinitix-TS 3-0020: finger 2 down (246, 395) Zinitix-TS 3-0020: finger 3 up (0, 0) Zinitix-TS 3-0020: finger 4 down (246, 395) UP Zinitix-TS 3-0020: finger 0 up (246, 395) Zinitix-TS 3-0020: finger 2 up (246, 395) Zinitix-TS 3-0020: finger 4 up (246, 395) This is one touch and release: i.e. this is all reported on touch (down) and release. There is a field in the struct touch_event called finger_cnt which is actually a bitmask of the fingers active in the event. Rename this field finger_mask as this matches the use contents better, then use for_each_set_bit() to iterate over just the fingers that are actally active. Factor out a finger reporting function zinitix_report_fingers() to handle all fingers. Also be more careful in reporting finger down/up: we were reporting every event with input_mt_report_slot_state(..., true); but this should only be reported on finger down or move, not on finger up, so also add code to check p->sub_status to see what is happening and report correctly. After this my Zinitix BT404 touchscreen report fingers flawlessly. The vendor drive I have notably does not use the "finger_cnt" and contains obviously incorrect code like this: if (touch_dev->touch_info.finger_cnt > MAX_SUPPORTED_FINGER_NUM) touch_dev->touch_info.finger_cnt = MAX_SUPPORTED_FINGER_NUM; As MAX_SUPPORTED_FINGER_NUM is an ordinal and the field is a bitmask this seems quite confused. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20220228233017.2270599-1-linus.walleij@linaro.org Signed-off-by: Dmitry Torokhov commit 1860d30466366774055d993f9b31094ede8af415 Author: Kuldeep Singh Date: Mon Mar 7 23:50:59 2022 +0530 MAINTAINERS: Update git tree for Broadcom iProc SoCs Current git tree for Broadcom iProc SoCs is pretty outdated as it has not updated for a long time. Fix the reference. Signed-off-by: Kuldeep Singh commit ea4424be16887a37735d6550cfd0611528dbe5d9 Merge: 06be3029703fe 42da5a4ba1707 Author: Linus Torvalds Date: Mon Mar 7 11:43:22 2022 -0800 Merge tag 'mtd/fixes-for-5.17-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux Pull MTD fix from Miquel Raynal: "As part of a previous changeset introducing support for the K3 architecture, the OMAP_GPMC (a non visible symbol) got selected by the selection of MTD_NAND_OMAP2 instead of doing so from the architecture directly (like for the other users of these two drivers). Indeed, from a hardware perspective, the OMAP NAND controller needs the GPMC to work. This led to a robot error which got addressed in fix merge into -rc4. Unfortunately, the approach at this time still used "select" and lead to further build error reports (sparc64:allmodconfig). This time we switch to 'depends on' in order to prevent random misconfigurations. The different dependencies will however need a future cleanup" * tag 'mtd/fixes-for-5.17-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux: mtd: rawnand: omap2: Actually prevent invalid configuration and build error commit 06be3029703fed2099b7247c527ab70d75255178 Merge: aa6f8dcbab473 3dd7d135e75cb Author: Linus Torvalds Date: Mon Mar 7 11:32:17 2022 -0800 Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost Pull virtio fixes from Michael Tsirkin: "Some last minute fixes that took a while to get ready. Not regressions, but they look safe and seem to be worth to have" * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: tools/virtio: handle fallout from folio work tools/virtio: fix virtio_test execution vhost: remove avail_event arg from vhost_update_avail_event() virtio: drop default for virtio-mem vdpa: fix use-after-free on vp_vdpa_remove virtio-blk: Remove BUG_ON() in virtio_queue_rq() virtio-blk: Don't use MAX_DISCARD_SEGMENTS if max_discard_seg is zero vhost: fix hung thread due to erroneous iotlb entries vduse: Fix returning wrong type in vduse_domain_alloc_iova() vdpa/mlx5: add validation for VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET command vdpa/mlx5: should verify CTRL_VQ feature exists for MQ vdpa: factor out vdpa_set_features_unlocked for vdpa internal use virtio_console: break out of buf poll on remove virtio: document virtio_reset_device virtio: acknowledge all features before access virtio: unexport virtio_finalize_features commit aa6f8dcbab473f3a3c7454b74caa46d36cdc5d13 Author: Halil Pasic Date: Sat Mar 5 18:07:14 2022 +0100 swiotlb: rework "fix info leak with DMA_FROM_DEVICE" Unfortunately, we ended up merging an old version of the patch "fix info leak with DMA_FROM_DEVICE" instead of merging the latest one. Christoph (the swiotlb maintainer), he asked me to create an incremental fix (after I have pointed this out the mix up, and asked him for guidance). So here we go. The main differences between what we got and what was agreed are: * swiotlb_sync_single_for_device is also required to do an extra bounce * We decided not to introduce DMA_ATTR_OVERWRITE until we have exploiters * The implantation of DMA_ATTR_OVERWRITE is flawed: DMA_ATTR_OVERWRITE must take precedence over DMA_ATTR_SKIP_CPU_SYNC Thus this patch removes DMA_ATTR_OVERWRITE, and makes swiotlb_sync_single_for_device() bounce unconditionally (that is, also when dir == DMA_TO_DEVICE) in order do avoid synchronising back stale data from the swiotlb buffer. Let me note, that if the size used with dma_sync_* API is less than the size used with dma_[un]map_*, under certain circumstances we may still end up with swiotlb not being transparent. In that sense, this is no perfect fix either. To get this bullet proof, we would have to bounce the entire mapping/bounce buffer. For that we would have to figure out the starting address, and the size of the mapping in swiotlb_sync_single_for_device(). While this does seem possible, there seems to be no firm consensus on how things are supposed to work. Signed-off-by: Halil Pasic Fixes: ddbd89deb7d3 ("swiotlb: fix info leak with DMA_FROM_DEVICE") Cc: stable@vger.kernel.org Reviewed-by: Christoph Hellwig Signed-off-by: Linus Torvalds commit 7401b49c50c2b032223de408e28e37cbd63f4c97 Author: Thierry Reding Date: Mon Mar 7 18:59:09 2022 +0100 ARM: tegra: Move Nyan FHD panels to AUX bus Similarly to what was earlier done for other Nyan variants, move the eDP panel on the FHD models to the AUX bus as well. Suggested-by: Dmitry Osipenko Fixes: ef6fb9875ce0 ("ARM: tegra: Add device-tree for 1080p version of Nyan Big") Signed-off-by: Thierry Reding commit 58c9a5060cb7cd529d49c93954cdafe81c1d642a Author: James Morse Date: Thu Mar 3 16:53:56 2022 +0000 arm64: proton-pack: Include unprivileged eBPF status in Spectre v2 mitigation reporting The mitigations for Spectre-BHB are only applied when an exception is taken from user-space. The mitigation status is reported via the spectre_v2 sysfs vulnerabilities file. When unprivileged eBPF is enabled the mitigation in the exception vectors can be avoided by an eBPF program. When unprivileged eBPF is enabled, print a warning and report vulnerable via the sysfs vulnerabilities file. Acked-by: Catalin Marinas Signed-off-by: James Morse commit 42da5a4ba17070e9d99abf375a5bd70e85d2a6b8 Author: Roger Quadros Date: Sat Feb 19 21:36:00 2022 +0200 mtd: rawnand: omap2: Actually prevent invalid configuration and build error The root of the problem is that we are selecting symbols that have dependencies. This can cause random configurations that can fail. The cleanest solution is to avoid using select. This driver uses interfaces from the OMAP_GPMC driver so we have to depend on it instead. Fixes: 4cd335dae3cf ("mtd: rawnand: omap2: Prevent invalid configuration and build error") Signed-off-by: Roger Quadros Signed-off-by: Miquel Raynal Tested-by: Randy Dunlap Link: https://lore.kernel.org/linux-mtd/20220219193600.24892-1-rogerq@kernel.org commit 0c4bcfdecb1ac0967619ee7ff44871d93c08c909 Author: Miklos Szeredi Date: Mon Mar 7 16:30:44 2022 +0100 fuse: fix pipe buffer lifetime for direct_io In FOPEN_DIRECT_IO mode, fuse_file_write_iter() calls fuse_direct_write_iter(), which normally calls fuse_direct_io(), which then imports the write buffer with fuse_get_user_pages(), which uses iov_iter_get_pages() to grab references to userspace pages instead of actually copying memory. On the filesystem device side, these pages can then either be read to userspace (via fuse_dev_read()), or splice()d over into a pipe using fuse_dev_splice_read() as pipe buffers with &nosteal_pipe_buf_ops. This is wrong because after fuse_dev_do_read() unlocks the FUSE request, the userspace filesystem can mark the request as completed, causing write() to return. At that point, the userspace filesystem should no longer have access to the pipe buffer. Fix by copying pages coming from the user address space to new pipe buffers. Reported-by: Jann Horn Fixes: c3021629a0d8 ("fuse: support splice() reading from fuse device") Cc: Signed-off-by: Miklos Szeredi commit 804f468853179b9b58af05c153c411931aa5b310 Author: Jouni Högander Date: Fri Feb 25 09:02:28 2022 +0200 drm/i915/psr: Set "SF Partial Frame Enable" also on full update Currently we are observing occasional screen flickering when PSR2 selective fetch is enabled. More specifically glitch seems to happen on full frame update when cursor moves to coords x = -1 or y = -1. According to Bspec SF Single full frame should not be set if SF Partial Frame Enable is not set. This happened to be true for ADLP as PSR2_MAN_TRK_CTL_ENABLE is always set and for ADL_P it's actually "SF Partial Frame Enable" (Bit 31). Setting "SF Partial Frame Enable" bit also on full update seems to fix screen flickering. Also make code more clear by setting PSR2_MAN_TRK_CTL_ENABLE only if not on ADL_P. Bit 31 has different meaning in ADL_P. Bspec: 49274 v2: Fix Mihai Harpau email address v3: Modify commit message and remove unnecessary comment Tested-by: Lyude Paul Fixes: 7f6002e58025 ("drm/i915/display: Enable PSR2 selective fetch by default") Reported-by: Lyude Paul Cc: Mihai Harpau Cc: José Roberto de Souza Cc: Ville Syrjälä Bugzilla: https://gitlab.freedesktop.org/drm/intel/-/issues/5077 Signed-off-by: Jouni Högander Reviewed-by: José Roberto de Souza Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20220225070228.855138-1-jouni.hogander@intel.com (cherry picked from commit 8d5516d18b323cf7274d1cf5fe76f4a691f879c6) Signed-off-by: Tvrtko Ursulin commit 660c619b9d7ccd28648ee3766cdbe94ec7b27402 Author: Andy Shevchenko Date: Mon Mar 7 13:56:23 2022 +0200 gpiolib: acpi: Convert ACPI value of debounce to microseconds It appears that GPIO ACPI library uses ACPI debounce values directly. However, the GPIO library APIs expect the debounce timeout to be in microseconds. Convert ACPI value of debounce to microseconds. While at it, document this detail where it is appropriate. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=215664 Reported-by: Kai-Heng Feng Fixes: 8dcb7a15a585 ("gpiolib: acpi: Take into account debounce settings") Signed-off-by: Andy Shevchenko Tested-by: Kai-Heng Feng Reviewed-by: Mika Westerberg Signed-off-by: Bartosz Golaszewski commit fc328a7d1fcce263db0b046917a66f3aa6e68719 Author: Marcelo Roberto Jimenez Date: Mon Mar 7 10:57:24 2022 +0100 gpio: Revert regression in sysfs-gpio (gpiolib.c) Some GPIO lines have stopped working after the patch commit 2ab73c6d8323f ("gpio: Support GPIO controllers without pin-ranges") And this has supposedly been fixed in the following patches commit 89ad556b7f96a ("gpio: Avoid using pin ranges with !PINCTRL") commit 6dbbf84603961 ("gpiolib: Don't free if pin ranges are not defined") But an erratic behavior where some GPIO lines work while others do not work has been introduced. This patch reverts those changes so that the sysfs-gpio interface works properly again. Signed-off-by: Marcelo Roberto Jimenez Signed-off-by: Bartosz Golaszewski commit 5f84e73f9a8f14b95115b0eb2080da6d9fa7a82e Author: Akhil R Date: Mon Feb 28 21:04:05 2022 +0530 gpio: tegra186: Add IRQ per bank for Tegra241 Add the number of interrupts per bank for Tegra241 (Grace) to fix the probe failure. Fixes: d1056b771ddb ("gpio: tegra186: Add support for Tegra241") Signed-off-by: Akhil R Signed-off-by: Bartosz Golaszewski commit c70c453abcbf3ecbaadd4c3236a5119b8da365cf Author: Fabio Estevam Date: Sat Mar 5 17:47:20 2022 -0300 smsc95xx: Ignore -ENODEV errors when device is unplugged According to Documentation/driver-api/usb/URB.rst when a device is unplugged usb_submit_urb() returns -ENODEV. This error code propagates all the way up to usbnet_read_cmd() and usbnet_write_cmd() calls inside the smsc95xx.c driver during Ethernet cable unplug, unbind or reboot. This causes the following errors to be shown on reboot, for example: ci_hdrc ci_hdrc.1: remove, state 1 usb usb2: USB disconnect, device number 1 usb 2-1: USB disconnect, device number 2 usb 2-1.1: USB disconnect, device number 3 smsc95xx 2-1.1:1.0 eth1: unregister 'smsc95xx' usb-ci_hdrc.1-1.1, smsc95xx USB 2.0 Ethernet smsc95xx 2-1.1:1.0 eth1: Failed to read reg index 0x00000114: -19 smsc95xx 2-1.1:1.0 eth1: Error reading MII_ACCESS smsc95xx 2-1.1:1.0 eth1: __smsc95xx_mdio_read: MII is busy smsc95xx 2-1.1:1.0 eth1: Failed to read reg index 0x00000114: -19 smsc95xx 2-1.1:1.0 eth1: Error reading MII_ACCESS smsc95xx 2-1.1:1.0 eth1: __smsc95xx_mdio_read: MII is busy smsc95xx 2-1.1:1.0 eth1: hardware isn't capable of remote wakeup usb 2-1.4: USB disconnect, device number 4 ci_hdrc ci_hdrc.1: USB bus 2 deregistered ci_hdrc ci_hdrc.0: remove, state 4 usb usb1: USB disconnect, device number 1 ci_hdrc ci_hdrc.0: USB bus 1 deregistered imx2-wdt 30280000.watchdog: Device shutdown: Expect reboot! reboot: Restarting system Ignore the -ENODEV errors inside __smsc95xx_mdio_read() and __smsc95xx_phy_wait_not_busy() and do not print error messages when -ENODEV is returned. Fixes: a049a30fc27c ("net: usb: Correct PHY handling of smsc95xx") Signed-off-by: Fabio Estevam Signed-off-by: David S. Miller commit d9dc0c84ad2d4cc911ba252c973d1bf18d5eb9cf Author: Tom Rix Date: Sat Mar 5 07:06:42 2022 -0800 qed: return status of qed_iov_get_link Clang static analysis reports this issue qed_sriov.c:4727:19: warning: Assigned value is garbage or undefined ivi->max_tx_rate = tx_rate ? tx_rate : link.speed; ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ link is only sometimes set by the call to qed_iov_get_link() qed_iov_get_link fails without setting link or returning status. So change the decl to return status. Fixes: 73390ac9d82b ("qed*: support ndo_get_vf_config") Signed-off-by: Tom Rix Signed-off-by: David S. Miller commit 23c7f8d7989e1646aac82f75761b7648c355cb8a Author: Steffen Klassert Date: Mon Mar 7 13:11:41 2022 +0100 net: Fix esp GSO on inter address family tunnels. The esp tunnel GSO handlers use skb_mac_gso_segment to push the inner packet to the segmentation handlers. However, skb_mac_gso_segment takes the Ethernet Protocol ID from 'skb->protocol' which is wrong for inter address family tunnels. We fix this by introducing a new skb_eth_gso_segment function. This function can be used if it is necessary to pass the Ethernet Protocol ID directly to the segmentation handler. First users of this function will be the esp4 and esp6 tunnel segmentation handlers. Fixes: c35fe4106b92 ("xfrm: Add mode handlers for IPsec on layer 2") Signed-off-by: Steffen Klassert commit 053c8fdf2c930efdff5496960842bbb5c34ad43a Author: Steffen Klassert Date: Mon Mar 7 13:11:40 2022 +0100 esp: Fix BEET mode inter address family tunneling on GSO The xfrm{4,6}_beet_gso_segment() functions did not correctly set the SKB_GSO_IPXIP4 and SKB_GSO_IPXIP6 gso types for the address family tunneling case. Fix this by setting these gso types. Fixes: 384a46ea7bdc7 ("esp4: add gso_segment for esp4 beet mode") Fixes: 7f9e40eb18a99 ("esp6: add gso_segment for esp6 beet mode") Signed-off-by: Steffen Klassert commit ebe48d368e97d007bfeb76fcb065d6cfc4c96645 Author: Steffen Klassert Date: Mon Mar 7 13:11:39 2022 +0100 esp: Fix possible buffer overflow in ESP transformation The maximum message size that can be send is bigger than the maximum site that skb_page_frag_refill can allocate. So it is possible to write beyond the allocated buffer. Fix this by doing a fallback to COW in that case. v2: Avoid get get_order() costs as suggested by Linus Torvalds. Fixes: cac2661c53f3 ("esp4: Avoid skb_cow_data whenever possible") Fixes: 03e2a30f6a27 ("esp6: Avoid skb_cow_data whenever possible") Reported-by: valis Signed-off-by: Steffen Klassert commit bb77bd31c281f70ec77c9c4f584950a779e05cf8 Author: Zheyu Ma Date: Sat Mar 5 14:55:04 2022 +0000 ethernet: sun: Free the coherent when failing in probing When the driver fails to register net device, it should free the DMA region first, and then do other cleanup. Signed-off-by: Zheyu Ma Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit dd830aed23c6e07cd8e2a163742bf3d63c9add08 Author: Aleksander Jan Bajkowski Date: Sat Mar 5 12:20:39 2022 +0100 net: lantiq_xrx200: fix use after free bug The skb->len field is read after the packet is sent to the network stack. In the meantime, skb can be freed. This patch fixes this bug. Fixes: c3e6b2c35b34 ("net: lantiq_xrx200: add ingress SG DMA support") Reported-by: Eric Dumazet Signed-off-by: Aleksander Jan Bajkowski Acked-by: Hauke Mehrtens Signed-off-by: David S. Miller commit e0058f0fa80f6e09c4d363779c241c45a3c56b94 Author: Jia-Ju Bai Date: Sat Mar 5 01:14:11 2022 -0800 net: qlogic: check the return value of dma_alloc_coherent() in qed_vf_hw_prepare() The function dma_alloc_coherent() in qed_vf_hw_prepare() can fail, so its return value should be checked. Fixes: 1408cc1fa48c ("qed: Introduce VFs") Reported-by: TOTE Robot Signed-off-by: Jia-Ju Bai Signed-off-by: David S. Miller commit d0aeb0d4a3f7d2a0df7e9545892bbeede8f2ac7e Author: Jia-Ju Bai Date: Sat Mar 5 00:58:16 2022 -0800 isdn: hfcpci: check the return value of dma_set_mask() in setup_hw() The function dma_set_mask() in setup_hw() can fail, so its return value should be checked. Fixes: 1700fe1a10dc ("Add mISDN HFC PCI driver") Reported-by: TOTE Robot Signed-off-by: Jia-Ju Bai Signed-off-by: David S. Miller commit 1760fdb6fe9f796fbdb9b4106b3e0bbacc16b55c Author: Ulf Hansson Date: Fri Mar 4 11:56:56 2022 +0100 mmc: core: Restore (almost) the busy polling for MMC_SEND_OP_COND Commit 76bfc7ccc2fa ("mmc: core: adjust polling interval for CMD1"), significantly decreased the polling period from ~10-12ms into just a couple of us. The purpose was to decrease the total time spent in the busy polling loop, but unfortunate it has lead to problems, that causes eMMC cards to never gets out busy and thus fails to be initialized. To fix the problem, but also to try to keep some of the new improved behaviour, let's start by using a polling period of 1-2ms, which then increases for each loop, according to common polling loop in __mmc_poll_for_busy(). Reported-by: Jean Rene Dawin Reported-by: H. Nikolaus Schaller Cc: Huijin Park Fixes: 76bfc7ccc2fa ("mmc: core: adjust polling interval for CMD1") Signed-off-by: Ulf Hansson Tested-by: Jean Rene Dawin Tested-by: H. Nikolaus Schaller Link: https://lore.kernel.org/r/20220304105656.149281-1-ulf.hansson@linaro.org commit 66e3531b33ee51dad17c463b4d9c9f52e341503d Author: Juergen Gross Date: Mon Mar 7 09:48:55 2022 +0100 xen/netfront: react properly to failing gnttab_end_foreign_access_ref() When calling gnttab_end_foreign_access_ref() the returned value must be tested and the reaction to that value should be appropriate. In case of failure in xennet_get_responses() the reaction should not be to crash the system, but to disable the network device. The calls in setup_netfront() can be replaced by calls of gnttab_end_foreign_access(). While at it avoid double free of ring pages and grant references via xennet_disconnect_backend() in this case. This is CVE-2022-23042 / part of XSA-396. Reported-by: Demi Marie Obenour Signed-off-by: Juergen Gross Reviewed-by: Jan Beulich --- V2: - avoid double free V3: - remove pointless initializer (Jan Beulich) commit 42baefac638f06314298087394b982ead9ec444b Author: Juergen Gross Date: Mon Mar 7 09:48:55 2022 +0100 xen/gnttab: fix gnttab_end_foreign_access() without page specified gnttab_end_foreign_access() is used to free a grant reference and optionally to free the associated page. In case the grant is still in use by the other side processing is being deferred. This leads to a problem in case no page to be freed is specified by the caller: the caller doesn't know that the page is still mapped by the other side and thus should not be used for other purposes. The correct way to handle this situation is to take an additional reference to the granted page in case handling is being deferred and to drop that reference when the grant reference could be freed finally. This requires that there are no users of gnttab_end_foreign_access() left directly repurposing the granted page after the call, as this might result in clobbered data or information leaks via the not yet freed grant reference. This is part of CVE-2022-23041 / XSA-396. Reported-by: Simon Gaiser Signed-off-by: Juergen Gross Reviewed-by: Jan Beulich --- V4: - expand comment in header V5: - get page ref in case of kmalloc() failure, too commit b0576cc9c6b843d99c6982888d59a56209341888 Author: Juergen Gross Date: Mon Mar 7 09:48:55 2022 +0100 xen/pvcalls: use alloc/free_pages_exact() Instead of __get_free_pages() and free_pages() use alloc_pages_exact() and free_pages_exact(). This is in preparation of a change of gnttab_end_foreign_access() which will prohibit use of high-order pages. This is part of CVE-2022-23041 / XSA-396. Reported-by: Simon Gaiser Signed-off-by: Juergen Gross Reviewed-by: Jan Beulich --- V4: - new patch commit 5cadd4bb1d7fc9ab201ac14620d1a478357e4ebd Author: Juergen Gross Date: Mon Mar 7 09:48:55 2022 +0100 xen/9p: use alloc/free_pages_exact() Instead of __get_free_pages() and free_pages() use alloc_pages_exact() and free_pages_exact(). This is in preparation of a change of gnttab_end_foreign_access() which will prohibit use of high-order pages. By using the local variable "order" instead of ring->intf->ring_order in the error path of xen_9pfs_front_alloc_dataring() another bug is fixed, as the error path can be entered before ring->intf->ring_order is being set. By using alloc_pages_exact() the size in bytes is specified for the allocation, which fixes another bug for the case of order < (PAGE_SHIFT - XEN_PAGE_SHIFT). This is part of CVE-2022-23041 / XSA-396. Reported-by: Simon Gaiser Signed-off-by: Juergen Gross Reviewed-by: Jan Beulich --- V4: - new patch commit cd7bcfab4e73dcb3de92c2014c19f17af3864bfe Author: Juergen Gross Date: Mon Mar 7 09:48:55 2022 +0100 xen/usb: don't use gnttab_end_foreign_access() in xenhcd_gnttab_done() The usage of gnttab_end_foreign_access() in xenhcd_gnttab_done() is not safe against a malicious backend, as the backend could keep the I/O page mapped and modify it even after the granted memory page is being used for completely other purposes in the local system. So replace that use case with gnttab_try_end_foreign_access() and disable the PV host adapter in case the backend didn't stop using the granted page. In xenhcd_urb_request_done() immediately return in case of setting the device state to "error" instead of looking into further backend responses. Reported-by: Demi Marie Obenour Signed-off-by: Juergen Gross Reviewed-by: Jan Beulich --- V2: - use gnttab_try_end_foreign_access() commit 1dbd11ca75fe664d3e54607547771d021f531f59 Author: Juergen Gross Date: Mon Mar 7 09:48:54 2022 +0100 xen: remove gnttab_query_foreign_access() Remove gnttab_query_foreign_access(), as it is unused and unsafe to use. All previous use cases assumed a grant would not be in use after gnttab_query_foreign_access() returned 0. This information is useless in best case, as it only refers to a situation in the past, which could have changed already. Signed-off-by: Juergen Gross Reviewed-by: Jan Beulich commit d3b6372c5881cb54925212abb62c521df8ba4809 Author: Juergen Gross Date: Mon Mar 7 09:48:54 2022 +0100 xen/gntalloc: don't use gnttab_query_foreign_access() Using gnttab_query_foreign_access() is unsafe, as it is racy by design. The use case in the gntalloc driver is not needed at all. While at it replace the call of gnttab_end_foreign_access_ref() with a call of gnttab_end_foreign_access(), which is what is really wanted there. In case the grant wasn't used due to an allocation failure, just free the grant via gnttab_free_grant_reference(). This is CVE-2022-23039 / part of XSA-396. Reported-by: Demi Marie Obenour Signed-off-by: Juergen Gross Reviewed-by: Jan Beulich --- V3: - fix __del_gref() (Jan Beulich) commit 33172ab50a53578a95691310f49567c9266968b0 Author: Juergen Gross Date: Mon Mar 7 09:48:54 2022 +0100 xen/scsifront: don't use gnttab_query_foreign_access() for mapped status It isn't enough to check whether a grant is still being in use by calling gnttab_query_foreign_access(), as a mapping could be realized by the other side just after having called that function. In case the call was done in preparation of revoking a grant it is better to do so via gnttab_try_end_foreign_access() and check the success of that operation instead. This is CVE-2022-23038 / part of XSA-396. Reported-by: Demi Marie Obenour Signed-off-by: Juergen Gross Reviewed-by: Jan Beulich --- V2: - use gnttab_try_end_foreign_access() commit 31185df7e2b1d2fa1de4900247a12d7b9c7087eb Author: Juergen Gross Date: Mon Mar 7 09:48:54 2022 +0100 xen/netfront: don't use gnttab_query_foreign_access() for mapped status It isn't enough to check whether a grant is still being in use by calling gnttab_query_foreign_access(), as a mapping could be realized by the other side just after having called that function. In case the call was done in preparation of revoking a grant it is better to do so via gnttab_end_foreign_access_ref() and check the success of that operation instead. This is CVE-2022-23037 / part of XSA-396. Reported-by: Demi Marie Obenour Signed-off-by: Juergen Gross Reviewed-by: Jan Beulich --- V2: - use gnttab_try_end_foreign_access() V3: - don't use gnttab_try_end_foreign_access() commit abf1fd5919d6238ee3bc5eb4a9b6c3947caa6638 Author: Juergen Gross Date: Mon Mar 7 09:48:54 2022 +0100 xen/blkfront: don't use gnttab_query_foreign_access() for mapped status It isn't enough to check whether a grant is still being in use by calling gnttab_query_foreign_access(), as a mapping could be realized by the other side just after having called that function. In case the call was done in preparation of revoking a grant it is better to do so via gnttab_end_foreign_access_ref() and check the success of that operation instead. For the ring allocation use alloc_pages_exact() in order to avoid high order pages in case of a multi-page ring. If a grant wasn't unmapped by the backend without persistent grants being used, set the device state to "error". This is CVE-2022-23036 / part of XSA-396. Reported-by: Demi Marie Obenour Signed-off-by: Juergen Gross Reviewed-by: Roger Pau Monné --- V2: - use gnttab_try_end_foreign_access() V4: - use alloc_pages_exact() and free_pages_exact() - set state to error if backend didn't unmap (Roger Pau Monné) commit 6b1775f26a2da2b05a6dc8ec2b5d14e9a4701a1a Author: Juergen Gross Date: Mon Mar 7 09:48:54 2022 +0100 xen/grant-table: add gnttab_try_end_foreign_access() Add a new grant table function gnttab_try_end_foreign_access(), which will remove and free a grant if it is not in use. Its main use case is to either free a grant if it is no longer in use, or to take some other action if it is still in use. This other action can be an error exit, or (e.g. in the case of blkfront persistent grant feature) some special handling. This is CVE-2022-23036, CVE-2022-23038 / part of XSA-396. Reported-by: Demi Marie Obenour Signed-off-by: Juergen Gross Reviewed-by: Jan Beulich --- V2: - new patch V4: - add comments to header (Jan Beulich) commit 3777ea7bac3113005b7180e6b9dadf16d19a5827 Author: Juergen Gross Date: Mon Mar 7 09:48:54 2022 +0100 xen/xenbus: don't let xenbus_grant_ring() remove grants in error case Letting xenbus_grant_ring() tear down grants in the error case is problematic, as the other side could already have used these grants. Calling gnttab_end_foreign_access_ref() without checking success is resulting in an unclear situation for any caller of xenbus_grant_ring() as in the error case the memory pages of the ring page might be partially mapped. Freeing them would risk unwanted foreign access to them, while not freeing them would leak memory. In order to remove the need to undo any gnttab_grant_foreign_access() calls, use gnttab_alloc_grant_references() to make sure no further error can occur in the loop granting access to the ring pages. It should be noted that this way of handling removes leaking of grant entries in the error case, too. This is CVE-2022-23040 / part of XSA-396. Reported-by: Demi Marie Obenour Signed-off-by: Juergen Gross Reviewed-by: Jan Beulich commit 48015b632f770c401f3816f144499a39f2884677 Author: Michael Ellerman Date: Fri Feb 11 17:32:37 2022 +1100 powerpc: Fix STACKTRACE=n build Our skiroot_defconfig doesn't enable FTRACE, and so doesn't get STACKTRACE enabled either. That leads to a build failure since commit 1614b2b11fab ("arch: Make ARCH_STACKWALK independent of STACKTRACE") made stacktrace.c build even when STACKTRACE=n. arch/powerpc/kernel/stacktrace.c: In function ‘handle_backtrace_ipi’: arch/powerpc/kernel/stacktrace.c:171:2: error: implicit declaration of function ‘nmi_cpu_backtrace’ 171 | nmi_cpu_backtrace(regs); | ^~~~~~~~~~~~~~~~~ arch/powerpc/kernel/stacktrace.c: In function ‘arch_trigger_cpumask_backtrace’: arch/powerpc/kernel/stacktrace.c:226:2: error: implicit declaration of function ‘nmi_trigger_cpumask_backtrace’ 226 | nmi_trigger_cpumask_backtrace(mask, exclude_self, raise_backtrace_ipi); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This happens because our headers haven't defined arch_trigger_cpumask_backtrace, which causes lib/nmi_backtrace.c not to build nmi_cpu_backtrace(). The code in question doesn't actually depend on STACKTRACE=y, that was just added because arch_trigger_cpumask_backtrace() lived in stacktrace.c for convenience. So drop the dependency on CONFIG_STACKTRACE, that causes lib/nmi_backtrace.c to build nmi_cpu_backtrace() etc. and fixes the build. Fixes: 1614b2b11fab ("arch: Make ARCH_STACKWALK independent of STACKTRACE") [mpe: Cherry pick of 5a72345e6a78 from next into fixes] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220212111349.2806972-1-mpe@ellerman.id.au commit ffb217a13a2eaf6d5bd974fc83036a53ca69f1e2 Author: Linus Torvalds Date: Sun Mar 6 14:28:31 2022 -0800 Linux 5.17-rc7 commit 3ee65c0f0778b8fa95381cd7676cde2c03e0f889 Merge: f81664f760046 ca93e44bfb5fd Author: Linus Torvalds Date: Sun Mar 6 12:19:36 2022 -0800 Merge tag 'for-5.17-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs fixes from David Sterba: "A few more fixes for various problems that have user visible effects or seem to be urgent: - fix corruption when combining DIO and non-blocking io_uring over multiple extents (seen on MariaDB) - fix relocation crash due to premature return from commit - fix quota deadlock between rescan and qgroup removal - fix item data bounds checks in tree-checker (found on a fuzzed image) - fix fsync of prealloc extents after EOF - add missing run of delayed items after unlink during log replay - don't start relocation until snapshot drop is finished - fix reversed condition for subpage writers locking - fix warning on page error" * tag 'for-5.17-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: btrfs: fallback to blocking mode when doing async dio over multiple extents btrfs: add missing run of delayed items after unlink during log replay btrfs: qgroup: fix deadlock between rescan worker and remove qgroup btrfs: fix relocation crash due to premature return from btrfs_commit_transaction() btrfs: do not start relocation until in progress drops are done btrfs: tree-checker: use u64 for item data end to avoid overflow btrfs: do not WARN_ON() if we have PageError set btrfs: fix lost prealloc extents beyond eof after full fsync btrfs: subpage: fix a wrong check on subpage->writers commit f81664f760046ac9b5731d9340f9e48e70ea7c8d Merge: 9bdeaca18bf61 8d25b7beca7ed Author: Linus Torvalds Date: Sun Mar 6 12:08:42 2022 -0800 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull kvm fixes from Paolo Bonzini: "x86 guest: - Tweaks to the paravirtualization code, to avoid using them when they're pointless or harmful x86 host: - Fix for SRCU lockdep splat - Brown paper bag fix for the propagation of errno" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: KVM: x86: pull kvm->srcu read-side to kvm_arch_vcpu_ioctl_run KVM: x86/mmu: Passing up the error state of mmu_alloc_shadow_roots() KVM: x86: Yield to IPI target vCPU only if it is busy x86/kvmclock: Fix Hyper-V Isolated VM's boot issue when vCPUs > 64 x86/kvm: Don't waste memory if kvmclock is disabled x86/kvm: Don't use PV TLB/yield when mwait is advertised commit 9bdeaca18bf61d55029277bb35f72c2002c88c4d Merge: f40a33f5ea54c 58dbe9b373df2 Author: Linus Torvalds Date: Sun Mar 6 11:57:42 2022 -0800 Merge tag 'powerpc-5.17-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fix from Michael Ellerman: "Fix build failure when CONFIG_PPC_64S_HASH_MMU is not set. Thanks to Murilo Opsfelder Araujo, and Erhard F" * tag 'powerpc-5.17-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/64s: Fix build failure when CONFIG_PPC_64S_HASH_MMU is not set commit f40a33f5ea54c01d640b150eb63e94defeb9b614 Merge: dcde98da99707 1d02b444b8d13 Author: Linus Torvalds Date: Sun Mar 6 11:47:59 2022 -0800 Merge tag 'trace-v5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing fixes from Steven Rostedt: - Fix sorting on old "cpu" value in histograms - Fix return value of __setup() boot parameter handlers * tag 'trace-v5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing: Fix return value of __setup handlers tracing/histogram: Fix sorting on old "cpu" value commit 3dd7d135e75cb37c8501ba02977332a2a487dd39 Author: Michael S. Tsirkin Date: Fri Mar 4 12:10:38 2022 -0500 tools/virtio: handle fallout from folio work just add a stub Signed-off-by: Michael S. Tsirkin commit 32f1b53fe8f03d962423ba81f8e92af5839814da Author: Stefano Garzarella Date: Tue Jan 18 16:06:31 2022 +0100 tools/virtio: fix virtio_test execution virtio_test hangs on __vring_new_virtqueue() because `vqs_list_lock` is not initialized. Let's initialize it in vdev_info_init(). Signed-off-by: Stefano Garzarella Link: https://lore.kernel.org/r/20220118150631.167015-1-sgarzare@redhat.com Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit 4c8093637bc9f8cc2e41eed343c12f85d6ff9e25 Author: Stefano Garzarella Date: Thu Jan 13 15:11:34 2022 +0100 vhost: remove avail_event arg from vhost_update_avail_event() In vhost_update_avail_event() we never used the `avail_event` argument, since its introduction in commit 2723feaa8ec6 ("vhost: set log when updating used flags or avail event"). Let's remove it to clean up the code. Signed-off-by: Stefano Garzarella Link: https://lore.kernel.org/r/20220113141134.186773-1-sgarzare@redhat.com Signed-off-by: Michael S. Tsirkin commit e7c552ec897894ec421867059e48474eb7f1ff6d Author: Michael S. Tsirkin Date: Fri Feb 25 06:46:34 2022 -0500 virtio: drop default for virtio-mem There's no special reason why virtio-mem needs a default that's different from what kconfig provides, any more than e.g. virtio blk. Signed-off-by: Michael S. Tsirkin Acked-by: David Hildenbrand commit eb057b44dbe35ae14527830236a92f51de8f9184 Author: Zhang Min Date: Tue Mar 1 17:10:59 2022 +0800 vdpa: fix use-after-free on vp_vdpa_remove When vp_vdpa driver is unbind, vp_vdpa is freed in vdpa_unregister_device and then vp_vdpa->mdev.pci_dev is dereferenced in vp_modern_remove, triggering use-after-free. Call Trace of unbinding driver free vp_vdpa : do_syscall_64 vfs_write kernfs_fop_write_iter device_release_driver_internal pci_device_remove vp_vdpa_remove vdpa_unregister_device kobject_release device_release kfree Call Trace of dereference vp_vdpa->mdev.pci_dev: vp_modern_remove pci_release_selected_regions pci_release_region pci_resource_len pci_resource_end (dev)->resource[(bar)].end Signed-off-by: Zhang Min Signed-off-by: Yi Wang Link: https://lore.kernel.org/r/20220301091059.46869-1-wang.yi59@zte.com.cn Signed-off-by: Michael S. Tsirkin Fixes: 64b9f64f80a6 ("vdpa: introduce virtio pci driver") Reviewed-by: Stefano Garzarella commit e030759a1ddcbf61d42b6e996bfeb675e0032d8b Author: Xie Yongji Date: Fri Mar 4 18:00:58 2022 +0800 virtio-blk: Remove BUG_ON() in virtio_queue_rq() Currently we have a BUG_ON() to make sure the number of sg list does not exceed queue_max_segments() in virtio_queue_rq(). However, the block layer uses queue_max_discard_segments() instead of queue_max_segments() to limit the sg list for discard requests. So the BUG_ON() might be triggered if virtio-blk device reports a larger value for max discard segment than queue_max_segments(). To fix it, let's simply remove the BUG_ON() which has become unnecessary after commit 02746e26c39e("virtio-blk: avoid preallocating big SGL for data"). And the unused vblk->sg_elems can also be removed together. Fixes: 1f23816b8eb8 ("virtio_blk: add discard and write zeroes support") Suggested-by: Christoph Hellwig Signed-off-by: Xie Yongji Reviewed-by: Max Gurtovoy Link: https://lore.kernel.org/r/20220304100058.116-2-xieyongji@bytedance.com Signed-off-by: Michael S. Tsirkin commit dacc73ed0b88f1a787ec20385f42ca9dd9eddcd0 Author: Xie Yongji Date: Fri Mar 4 18:00:57 2022 +0800 virtio-blk: Don't use MAX_DISCARD_SEGMENTS if max_discard_seg is zero Currently the value of max_discard_segment will be set to MAX_DISCARD_SEGMENTS (256) with no basis in hardware if device set 0 to max_discard_seg in configuration space. It's incorrect since the device might not be able to handle such large descriptors. To fix it, let's follow max_segments restrictions in this case. Fixes: 1f23816b8eb8 ("virtio_blk: add discard and write zeroes support") Signed-off-by: Xie Yongji Link: https://lore.kernel.org/r/20220304100058.116-1-xieyongji@bytedance.com Signed-off-by: Michael S. Tsirkin commit e2ae38cf3d91837a493cb2093c87700ff3cbe667 Author: Anirudh Rayabharam Date: Sat Mar 5 15:25:25 2022 +0530 vhost: fix hung thread due to erroneous iotlb entries In vhost_iotlb_add_range_ctx(), range size can overflow to 0 when start is 0 and last is ULONG_MAX. One instance where it can happen is when userspace sends an IOTLB message with iova=size=uaddr=0 (vhost_process_iotlb_msg). So, an entry with size = 0, start = 0, last = ULONG_MAX ends up in the iotlb. Next time a packet is sent, iotlb_access_ok() loops indefinitely due to that erroneous entry. Call Trace: iotlb_access_ok+0x21b/0x3e0 drivers/vhost/vhost.c:1340 vq_meta_prefetch+0xbc/0x280 drivers/vhost/vhost.c:1366 vhost_transport_do_send_pkt+0xe0/0xfd0 drivers/vhost/vsock.c:104 vhost_worker+0x23d/0x3d0 drivers/vhost/vhost.c:372 kthread+0x2e9/0x3a0 kernel/kthread.c:377 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Reported by syzbot at: https://syzkaller.appspot.com/bug?extid=0abd373e2e50d704db87 To fix this, do two things: 1. Return -EINVAL in vhost_chr_write_iter() when userspace asks to map a range with size 0. 2. Fix vhost_iotlb_add_range_ctx() to handle the range [0, ULONG_MAX] by splitting it into two entries. Fixes: 0bbe30668d89e ("vhost: factor out IOTLB") Reported-by: syzbot+0abd373e2e50d704db87@syzkaller.appspotmail.com Tested-by: syzbot+0abd373e2e50d704db87@syzkaller.appspotmail.com Signed-off-by: Anirudh Rayabharam Link: https://lore.kernel.org/r/20220305095525.5145-1-mail@anirudhrb.com Signed-off-by: Michael S. Tsirkin commit afb3cc1a397d77771f342691b7e6b032a234d7f2 Author: Vladimir Oltean Date: Thu Mar 3 16:08:40 2022 +0200 net: dsa: unlock the rtnl_mutex when dsa_master_setup() fails After the blamed commit, dsa_tree_setup_master() may exit without calling rtnl_unlock(), fix that. Fixes: c146f9bc195a ("net: dsa: hold rtnl_mutex when calling dsa_master_{setup,teardown}") Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit a3d9001b4e287fc043e5539d03d71a32ab114bcb Author: Kai Lueke Date: Thu Mar 3 15:55:10 2022 +0100 Revert "xfrm: state and policy should fail if XFRMA_IF_ID 0" This reverts commit 68ac0f3810e76a853b5f7b90601a05c3048b8b54 because ID 0 was meant to be used for configuring the policy/state without matching for a specific interface (e.g., Cilium is affected, see https://github.com/cilium/cilium/pull/18789 and https://github.com/cilium/cilium/pull/19019). Signed-off-by: Kai Lueke Signed-off-by: Steffen Klassert commit dcde98da997075053041942ecf97d787855722ec Merge: 0014404f9c18d 327b89f0acc4c Author: Linus Torvalds Date: Sat Mar 5 15:49:45 2022 -0800 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Pull input updates from Dmitry Torokhov: - a fixup for Goodix touchscreen driver allowing it to work on certain Cherry Trail devices - a fix for imbalanced enable/disable regulator in Elam touchpad driver that became apparent when used with Asus TF103C 2-in-1 dock - a couple new input keycodes used on newer keyboards * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: HID: add mapping for KEY_ALL_APPLICATIONS HID: add mapping for KEY_DICTATE Input: elan_i2c - fix regulator enable count imbalance after suspend/resume Input: elan_i2c - move regulator_[en|dis]able() out of elan_[en|dis]able_power() Input: goodix - workaround Cherry Trail devices with a bogus ACPI Interrupt() resource Input: goodix - use the new soc_intel_is_byt() helper Input: samsung-keypad - properly state IOMEM dependency commit 0014404f9c18dd360a1b8bb4243643c679ce99bf Merge: f9026e19a44d9 d1eff16d727ff Author: Linus Torvalds Date: Sat Mar 5 12:03:14 2022 -0800 Merge branch 'akpm' (patches from Andrew) Merge misc fixes from Andrew Morton: "8 patches. Subsystems affected by this patch series: mm (hugetlb, pagemap, and userfaultfd), memfd, selftests, and kconfig" * emailed patches from Andrew Morton : configs/debug: set CONFIG_DEBUG_INFO=y properly proc: fix documentation and description of pagemap kselftest/vm: fix tests build with old libc memfd: fix F_SEAL_WRITE after shmem huge page allocated mm: fix use-after-free when anon vma name is used after vma is freed mm: prevent vm_area_struct::anon_name refcount saturation mm: refactor vm_area_struct::anon_vma_name usage code selftests/vm: cleanup hugetlb file after mremap test commit f9026e19a44d965793d25e7a02b0d6c1bcafd8f5 Merge: ac84e82f78cb5 c194dad21025d Author: Linus Torvalds Date: Sat Mar 5 11:25:26 2022 -0800 Merge tag 's390-5.17-5' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull s390 fixes from Vasily Gorbik: - Fix HAVE_DYNAMIC_FTRACE_WITH_ARGS implementation by providing correct switching between ftrace_caller/ftrace_regs_caller and supplying pt_regs only when ftrace_regs_caller is activated. - Fix exception table sorting. - Fix breakage of kdump tooling by preserving metadata it cannot function without. * tag 's390-5.17-5' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390/extable: fix exception table sorting s390/ftrace: fix arch_ftrace_get_regs implementation s390/ftrace: fix ftrace_caller/ftrace_regs_caller generation s390/setup: preserve memory at OLDMEM_BASE and OLDMEM_SIZE commit d1eff16d727ff257b706d32114d3881f67cc9c75 Author: Qian Cai Date: Fri Mar 4 20:29:10 2022 -0800 configs/debug: set CONFIG_DEBUG_INFO=y properly CONFIG_DEBUG_INFO can't be set by user directly, so set CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y instead. Otherwise, we end up with no debuginfo in vmlinux which is a big no-no for kernel debugging. Link: https://lkml.kernel.org/r/20220301202920.18488-1-quic_qiancai@quicinc.com Signed-off-by: Qian Cai Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit dd21bfa425c098b95ca86845f8e7d1ec1ddf6e4a Author: Yun Zhou Date: Fri Mar 4 20:29:07 2022 -0800 proc: fix documentation and description of pagemap Since bit 57 was exported for uffd-wp write-protected (commit fb8e37f35a2f: "mm/pagemap: export uffd-wp protection information"), fixing it can reduce some unnecessary confusion. Link: https://lkml.kernel.org/r/20220301044538.3042713-1-yun.zhou@windriver.com Fixes: fb8e37f35a2fe1 ("mm/pagemap: export uffd-wp protection information") Signed-off-by: Yun Zhou Reviewed-by: Peter Xu Cc: Jonathan Corbet Cc: Tiberiu A Georgescu Cc: Florian Schmidt Cc: Ivan Teterevkov Cc: SeongJae Park Cc: Yang Shi Cc: David Hildenbrand Cc: Axel Rasmussen Cc: Miaohe Lin Cc: Andrea Arcangeli Cc: Colin Cross Cc: Alistair Popple Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b773827e361952b3f53ac6fa4c4e39ccd632102e Author: Chengming Zhou Date: Fri Mar 4 20:29:04 2022 -0800 kselftest/vm: fix tests build with old libc The error message when I build vm tests on debian10 (GLIBC 2.28): userfaultfd.c: In function `userfaultfd_pagemap_test': userfaultfd.c:1393:37: error: `MADV_PAGEOUT' undeclared (first use in this function); did you mean `MADV_RANDOM'? if (madvise(area_dst, test_pgsize, MADV_PAGEOUT)) ^~~~~~~~~~~~ MADV_RANDOM This patch includes these newer definitions from UAPI linux/mman.h, is useful to fix tests build on systems without these definitions in glibc sys/mman.h. Link: https://lkml.kernel.org/r/20220227055330.43087-2-zhouchengming@bytedance.com Signed-off-by: Chengming Zhou Reviewed-by: Shuah Khan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit f2b277c4d1c63a85127e8aa2588e9cc3bd21cb99 Author: Hugh Dickins Date: Fri Mar 4 20:29:01 2022 -0800 memfd: fix F_SEAL_WRITE after shmem huge page allocated Wangyong reports: after enabling tmpfs filesystem to support transparent hugepage with the following command: echo always > /sys/kernel/mm/transparent_hugepage/shmem_enabled the docker program tries to add F_SEAL_WRITE through the following command, but it fails unexpectedly with errno EBUSY: fcntl(5, F_ADD_SEALS, F_SEAL_WRITE) = -1. That is because memfd_tag_pins() and memfd_wait_for_pins() were never updated for shmem huge pages: checking page_mapcount() against page_count() is hopeless on THP subpages - they need to check total_mapcount() against page_count() on THP heads only. Make memfd_tag_pins() (compared > 1) as strict as memfd_wait_for_pins() (compared != 1): either can be justified, but given the non-atomic total_mapcount() calculation, it is better now to be strict. Bear in mind that total_mapcount() itself scans all of the THP subpages, when choosing to take an XA_CHECK_SCHED latency break. Also fix the unlikely xa_is_value() case in memfd_wait_for_pins(): if a page has been swapped out since memfd_tag_pins(), then its refcount must have fallen, and so it can safely be untagged. Link: https://lkml.kernel.org/r/a4f79248-df75-2c8c-3df-ba3317ccb5da@google.com Signed-off-by: Hugh Dickins Reported-by: Zeal Robot Reported-by: wangyong Cc: Mike Kravetz Cc: Matthew Wilcox (Oracle) Cc: CGEL ZTE Cc: Kirill A. Shutemov Cc: Song Liu Cc: Yang Yang Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 942341dcc5748d9c1fc7009a359fc1916bfe0ef0 Author: Suren Baghdasaryan Date: Fri Mar 4 20:28:58 2022 -0800 mm: fix use-after-free when anon vma name is used after vma is freed When adjacent vmas are being merged it can result in the vma that was originally passed to madvise_update_vma being destroyed. In the current implementation, the name parameter passed to madvise_update_vma points directly to vma->anon_name and it is used after the call to vma_merge. In the cases when vma_merge merges the original vma and destroys it, this might result in UAF. For that the original vma would have to hold the anon_vma_name with the last reference. The following vma would need to contain a different anon_vma_name object with the same string. Such scenario is shown below: madvise_vma_behavior(vma) madvise_update_vma(vma, ..., anon_name == vma->anon_name) vma_merge(vma) __vma_adjust(vma) <-- merges vma with adjacent one vm_area_free(vma) <-- frees the original vma replace_vma_anon_name(anon_name) <-- UAF of vma->anon_name Fix this by raising the name refcount and stabilizing it. Link: https://lkml.kernel.org/r/20220224231834.1481408-3-surenb@google.com Link: https://lkml.kernel.org/r/20220223153613.835563-3-surenb@google.com Fixes: 9a10064f5625 ("mm: add a field to store names for private anonymous memory") Signed-off-by: Suren Baghdasaryan Reported-by: syzbot+aa7b3d4b35f9dc46a366@syzkaller.appspotmail.com Acked-by: Michal Hocko Cc: Alexey Gladkov Cc: Chris Hyser Cc: Christian Brauner Cc: Colin Cross Cc: Cyrill Gorcunov Cc: Dave Hansen Cc: David Hildenbrand Cc: Davidlohr Bueso Cc: "Eric W. Biederman" Cc: Johannes Weiner Cc: Kees Cook Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Michal Hocko Cc: Peter Collingbourne Cc: Sasha Levin Cc: Sumit Semwal Cc: Vlastimil Babka Cc: Xiaofeng Cao Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 96403e11283def1d1c465c8279514c9a504d8630 Author: Suren Baghdasaryan Date: Fri Mar 4 20:28:55 2022 -0800 mm: prevent vm_area_struct::anon_name refcount saturation A deep process chain with many vmas could grow really high. With default sysctl_max_map_count (64k) and default pid_max (32k) the max number of vmas in the system is 2147450880 and the refcounter has headroom of 1073774592 before it reaches REFCOUNT_SATURATED (3221225472). Therefore it's unlikely that an anonymous name refcounter will overflow with these defaults. Currently the max for pid_max is PID_MAX_LIMIT (4194304) and for sysctl_max_map_count it's INT_MAX (2147483647). In this configuration anon_vma_name refcount overflow becomes theoretically possible (that still require heavy sharing of that anon_vma_name between processes). kref refcounting interface used in anon_vma_name structure will detect a counter overflow when it reaches REFCOUNT_SATURATED value but will only generate a warning and freeze the ref counter. This would lead to the refcounted object never being freed. A determined attacker could leak memory like that but it would be rather expensive and inefficient way to do so. To ensure anon_vma_name refcount does not overflow, stop anon_vma_name sharing when the refcount reaches REFCOUNT_MAX (2147483647), which still leaves INT_MAX/2 (1073741823) values before the counter reaches REFCOUNT_SATURATED. This should provide enough headroom for raising the refcounts temporarily. Link: https://lkml.kernel.org/r/20220223153613.835563-2-surenb@google.com Signed-off-by: Suren Baghdasaryan Suggested-by: Michal Hocko Acked-by: Michal Hocko Cc: Alexey Gladkov Cc: Chris Hyser Cc: Christian Brauner Cc: Colin Cross Cc: Cyrill Gorcunov Cc: Dave Hansen Cc: David Hildenbrand Cc: Davidlohr Bueso Cc: "Eric W. Biederman" Cc: Johannes Weiner Cc: Kees Cook Cc: "Kirill A. Shutemov" Cc: Matthew Wilcox Cc: Peter Collingbourne Cc: Sasha Levin Cc: Sumit Semwal Cc: Vlastimil Babka Cc: Xiaofeng Cao Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 5c26f6ac9416b63d093e29c30e79b3297e425472 Author: Suren Baghdasaryan Date: Fri Mar 4 20:28:51 2022 -0800 mm: refactor vm_area_struct::anon_vma_name usage code Avoid mixing strings and their anon_vma_name referenced pointers by using struct anon_vma_name whenever possible. This simplifies the code and allows easier sharing of anon_vma_name structures when they represent the same name. [surenb@google.com: fix comment] Link: https://lkml.kernel.org/r/20220223153613.835563-1-surenb@google.com Link: https://lkml.kernel.org/r/20220224231834.1481408-1-surenb@google.com Signed-off-by: Suren Baghdasaryan Suggested-by: Matthew Wilcox Suggested-by: Michal Hocko Acked-by: Michal Hocko Cc: Colin Cross Cc: Sumit Semwal Cc: Dave Hansen Cc: Kees Cook Cc: "Kirill A. Shutemov" Cc: Vlastimil Babka Cc: Johannes Weiner Cc: "Eric W. Biederman" Cc: Christian Brauner Cc: Alexey Gladkov Cc: Sasha Levin Cc: Chris Hyser Cc: Davidlohr Bueso Cc: Peter Collingbourne Cc: Xiaofeng Cao Cc: David Hildenbrand Cc: Cyrill Gorcunov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ff712a627f7296a42ea5d7356704525e1e909e05 Author: Mike Kravetz Date: Fri Mar 4 20:28:48 2022 -0800 selftests/vm: cleanup hugetlb file after mremap test The hugepage-mremap test will create a file in a hugetlb filesystem. In a default 'run_vmtests' run, the file will contain all the hugetlb pages. After the test, the file remains and there are no free hugetlb pages for subsequent tests. This causes those hugetlb tests to fail. Change hugepage-mremap to take the name of the hugetlb file as an argument. Unlink the file within the test, and just to be sure remove the file in the run_vmtests script. Link: https://lkml.kernel.org/r/20220201033459.156944-1-mike.kravetz@oracle.com Signed-off-by: Mike Kravetz Reviewed-by: Shuah Khan Acked-by: Yosry Ahmed Reviewed-by: Muchun Song Reviewed-by: Mina Almasry Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c6a502c2299941c8326d029cfc8a3bc8a4607ad5 Author: Alexey Khoroshilov Date: Fri Mar 4 21:25:36 2022 +0300 mISDN: Fix memory leak in dsp_pipeline_build() dsp_pipeline_build() allocates dup pointer by kstrdup(cfg), but then it updates dup variable by strsep(&dup, "|"). As a result when it calls kfree(dup), the dup variable contains NULL. Found by Linux Driver Verification project (linuxtesting.org) with SVACE. Signed-off-by: Alexey Khoroshilov Fixes: 960366cf8dbb ("Add mISDN DSP") Signed-off-by: David S. Miller commit b9baf5c8c5c356757f4f9d8180b5e9d234065bc3 Author: Russell King (Oracle) Date: Thu Feb 10 16:05:45 2022 +0000 ARM: Spectre-BHB workaround Workaround the Spectre BHB issues for Cortex-A15, Cortex-A57, Cortex-A72, Cortex-A73 and Cortex-A75. We also include Brahma B15 as well to be safe, which is affected by Spectre V2 in the same ways as Cortex-A15. Reviewed-by: Catalin Marinas Signed-off-by: Russell King (Oracle) commit 8d9d651ff2270a632e9dc497b142db31e8911315 Author: Russell King (Oracle) Date: Fri Feb 11 19:49:50 2022 +0000 ARM: use LOADADDR() to get load address of sections Use the linker's LOADADDR() macro to get the load address of the sections, and provide a macro to set the start and end symbols. Acked-by: Catalin Marinas Signed-off-by: Russell King (Oracle) commit 04e91b7324760a377a725e218b5ee783826d30f5 Author: Russell King (Oracle) Date: Fri Feb 11 19:46:15 2022 +0000 ARM: early traps initialisation Provide a couple of helpers to copy the vectors and stubs, and also to flush the copied vectors and stubs. Acked-by: Catalin Marinas Signed-off-by: Russell King (Oracle) commit 9dd78194a3722fa6712192cdd4f7032d45112a9a Author: Russell King (Oracle) Date: Fri Feb 11 16:45:54 2022 +0000 ARM: report Spectre v2 status through sysfs As per other architectures, add support for reporting the Spectre vulnerability status via sysfs CPU. Acked-by: Catalin Marinas Signed-off-by: Russell King (Oracle) commit 58dbe9b373df2828d873b1c0e5afc77485b2f376 Author: Murilo Opsfelder Araujo Date: Tue Mar 1 17:47:43 2022 -0300 powerpc/64s: Fix build failure when CONFIG_PPC_64S_HASH_MMU is not set The following build failure occurs when CONFIG_PPC_64S_HASH_MMU is not set: arch/powerpc/kernel/setup_64.c: In function ‘setup_per_cpu_areas’: arch/powerpc/kernel/setup_64.c:811:21: error: ‘mmu_linear_psize’ undeclared (first use in this function); did you mean ‘mmu_virtual_psize’? 811 | if (mmu_linear_psize == MMU_PAGE_4K) | ^~~~~~~~~~~~~~~~ | mmu_virtual_psize arch/powerpc/kernel/setup_64.c:811:21: note: each undeclared identifier is reported only once for each function it appears in Move the declaration of mmu_linear_psize outside of CONFIG_PPC_64S_HASH_MMU ifdef. After the above is fixed, it fails later with the following error: ld: arch/powerpc/kexec/file_load_64.o: in function `.arch_kexec_kernel_image_probe': file_load_64.c:(.text+0x1c1c): undefined reference to `.add_htab_mem_range' Fix that, too, by conditioning add_htab_mem_range() symbol to CONFIG_PPC_64S_HASH_MMU. Fixes: 387e220a2e5e ("powerpc/64s: Move hash MMU support code under CONFIG_PPC_64S_HASH_MMU") Reported-by: Erhard F. Signed-off-by: Murilo Opsfelder Araujo Signed-off-by: Michael Ellerman BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=215567 Link: https://lore.kernel.org/r/20220301204743.45133-1-muriloo@linux.ibm.com commit 0de05d056afdb00eca8c7bbb0c79a3438daf700c Author: Josh Poimboeuf Date: Fri Feb 25 14:32:28 2022 -0800 x86/speculation: Warn about eIBRS + LFENCE + Unprivileged eBPF + SMT The commit 44a3918c8245 ("x86/speculation: Include unprivileged eBPF status in Spectre v2 mitigation reporting") added a warning for the "eIBRS + unprivileged eBPF" combination, which has been shown to be vulnerable against Spectre v2 BHB-based attacks. However, there's no warning about the "eIBRS + LFENCE retpoline + unprivileged eBPF" combo. The LFENCE adds more protection by shortening the speculation window after a mispredicted branch. That makes an attack significantly more difficult, even with unprivileged eBPF. So at least for now the logic doesn't warn about that combination. But if you then add SMT into the mix, the SMT attack angle weakens the effectiveness of the LFENCE considerably. So extend the "eIBRS + unprivileged eBPF" warning to also include the "eIBRS + LFENCE + unprivileged eBPF + SMT" case. [ bp: Massage commit message. ] Suggested-by: Alyssa Milburn Signed-off-by: Josh Poimboeuf Signed-off-by: Borislav Petkov commit eafd987d4a82c7bb5aa12f0e3b4f8f3dea93e678 Author: Josh Poimboeuf Date: Fri Feb 25 14:31:49 2022 -0800 x86/speculation: Warn about Spectre v2 LFENCE mitigation With: f8a66d608a3e ("x86,bugs: Unconditionally allow spectre_v2=retpoline,amd") it became possible to enable the LFENCE "retpoline" on Intel. However, Intel doesn't recommend it, as it has some weaknesses compared to retpoline. Now AMD doesn't recommend it either. It can still be left available as a cmdline option. It's faster than retpoline but is weaker in certain scenarios -- particularly SMT, but even non-SMT may be vulnerable in some cases. So just unconditionally warn if the user requests it on the cmdline. [ bp: Massage commit message. ] Signed-off-by: Josh Poimboeuf Signed-off-by: Borislav Petkov commit a502a8f04097e038c3daa16c5202a9538116d563 Author: Heiner Kallweit Date: Thu Mar 3 08:54:15 2022 +0100 net: phy: meson-gxl: fix interrupt handling in forced mode This PHY doesn't support a link-up interrupt source. If aneg is enabled we use the "aneg complete" interrupt for this purpose, but if aneg is disabled link-up isn't signaled currently. According to a vendor driver there's an additional "energy detect" interrupt source that can be used to signal link-up if aneg is disabled. We can safely ignore this interrupt source if aneg is enabled. This patch was tested on a TX3 Mini TV box with S905W (even though boot message says it's a S905D). This issue has been existing longer, but due to changes in phylib and the driver the patch applies only from the commit marked as fixed. Fixes: 84c8f773d2dc ("net: phy: meson-gxl: remove the use of .ack_callback()") Signed-off-by: Heiner Kallweit Link: https://lore.kernel.org/r/04cac530-ea1b-850e-6cfa-144a55c4d75d@gmail.com Signed-off-by: Jakub Kicinski commit ac84e82f78cb55ce8e760e0b5887d56efd78d6bc Merge: 07ebd38a0da24 30939293262eb Author: Linus Torvalds Date: Fri Mar 4 16:03:46 2022 -0800 Merge tag 'block-5.17-2022-03-04' of git://git.kernel.dk/linux-block Pull block fix from Jens Axboe: "Just a small UAF fix for blktrace" * tag 'block-5.17-2022-03-04' of git://git.kernel.dk/linux-block: blktrace: fix use after free for struct blk_trace commit 07ebd38a0da24d2534da57b4841346379db9f354 Merge: 3f509f5971bca 74583f1b92cb3 Author: Linus Torvalds Date: Fri Mar 4 11:54:06 2022 -0800 Merge tag 'riscv-for-linus-5.17-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull RISC-V fixes from Palmer Dabbelt: - Fixes for a handful of KASAN-related crashes. - A fix to avoid a crash during boot for SPARSEMEM && !SPARSEMEM_VMEMMAP configurations. - A fix to stop reporting some incorrect errors under DEBUG_VIRTUAL. - A fix for the K210's device tree to properly populate the interrupt map, so hart1 will get interrupts again. * tag 'riscv-for-linus-5.17-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: riscv: dts: k210: fix broken IRQs on hart1 riscv: Fix kasan pud population riscv: Move high_memory initialization to setup_bootmem riscv: Fix config KASAN && DEBUG_VIRTUAL riscv: Fix DEBUG_VIRTUAL false warnings riscv: Fix config KASAN && SPARSEMEM && !SPARSE_VMEMMAP riscv: Fix is_linear_mapping with recent move of KASAN region commit 3f509f5971bca38eeb543186131fb1b404262023 Merge: a4ffdb61035da 9826e393e4a8c Author: Linus Torvalds Date: Fri Mar 4 11:30:57 2022 -0800 Merge tag 'iommu-fixes-v5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu Pull iommu fixes from Joerg Roedel: - Fix a double list_add() in Intel VT-d code - Add missing put_device() in Tegra SMMU driver - Two AMD IOMMU fixes: - Memory leak in IO page-table freeing code - Add missing recovery from event-log overflow * tag 'iommu-fixes-v5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: iommu/tegra-smmu: Fix missing put_device() call in tegra_smmu_find iommu/vt-d: Fix double list_add when enabling VMD in scalable mode iommu/amd: Fix I/O page table memory leak iommu/amd: Recover from event log overflow commit a4ffdb61035da6e1550c3cb141a6b25acd7ae3da Merge: 8d670948f4d6d 5838a14832d44 Author: Linus Torvalds Date: Fri Mar 4 11:19:14 2022 -0800 Merge tag 'thermal-5.17-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull thermal control fix from Rafael Wysocki: "Fix NULL pointer dereference in the thermal netlink interface (Nicolas Cavallari)" * tag 'thermal-5.17-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: thermal: core: Fix TZ_GET_TRIP NULL pointer dereference commit 8d670948f4d6d372935b7dcf9f7db14548859b67 Merge: c4fc118ae26f9 0aa6b294b312d Author: Linus Torvalds Date: Fri Mar 4 11:15:00 2022 -0800 Merge tag 'sound-5.17-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "Hopefully the last PR for 5.17, including just a few small changes: an additional fix for ASoC ops boundary check and other minor device-specific fixes" * tag 'sound-5.17-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: intel_hdmi: Fix reference to PCM buffer address ASoC: cs4265: Fix the duplicated control name ASoC: ops: Shift tested values in snd_soc_put_volsw() by +min commit c4fc118ae26f9d4e5885d151f9b0f96467a136da Merge: 0b7344a658e66 8fdb19679722a Author: Linus Torvalds Date: Fri Mar 4 11:01:22 2022 -0800 Merge tag 'drm-fixes-2022-03-04' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Things are quieting down as expected, just a small set of fixes, i915, exynos, amdgpu, vrr, bridge and hdlcd. Nothing scary at all. i915: - Fix GuC SLPC unset command - Fix misidentification of some Apple MacBook Pro laptops as Jasper Lake amdgpu: - Suspend regression fix exynos: - irq handling fixes - Fix two regressions to TE-gpio handling arm/hdlcd: - Select DRM_GEM_CMEA_HELPER for HDLCD bridge: - ti-sn65dsi86: Properly undo autosuspend vrr: - Fix potential NULL-pointer deref" * tag 'drm-fixes-2022-03-04' of git://anongit.freedesktop.org/drm/drm: drm/amdgpu: fix suspend/resume hang regression drm/vrr: Set VRR capable prop only if it is attached to connector drm/arm: arm hdlcd select DRM_GEM_CMA_HELPER drm/bridge: ti-sn65dsi86: Properly undo autosuspend drm/i915: s/JSP2/ICP2/ PCH drm/i915/guc/slpc: Correct the param count for unset param drm/exynos: Search for TE-gpio in DSI panel's node drm/exynos: Don't fail if no TE-gpio is defined for DSI driver drm/exynos: gsc: Use platform_get_irq() to get the interrupt drm/exynos/fimc: Use platform_get_irq() to get the interrupt drm/exynos/exynos_drm_fimd: Use platform_get_irq_byname() to get the interrupt drm/exynos: mixer: Use platform_get_irq() to get the interrupt drm/exynos/exynos7_drm_decon: Use platform_get_irq_byname() to get the interrupt commit 0b7344a658e66a6835ad96dbc5dd35f1e876078a Merge: 0708a0afe291b bac129dbc6560 Author: Linus Torvalds Date: Fri Mar 4 10:56:00 2022 -0800 Merge tag 'pinctrl-v5.17-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Pull pin control fixes from Linus Walleij: "These two fixes should fix the issues seen on the OrangePi, first we needed the correct offset when calling pinctrl_gpio_direction(), and fixing that made a lockdep issue explode in our face. Both now fixed" * tag 'pinctrl-v5.17-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: pinctrl: sunxi: Use unique lockdep classes for IRQs pinctrl-sunxi: sunxi_pinctrl_gpio_direction_in/output: use correct offset commit 1d02b444b8d1345ea4708db3bab4db89a7784b55 Author: Randy Dunlap Date: Wed Mar 2 19:17:44 2022 -0800 tracing: Fix return value of __setup handlers __setup() handlers should generally return 1 to indicate that the boot options have been handled. Using invalid option values causes the entire kernel boot option string to be reported as Unknown and added to init's environment strings, polluting it. Unknown kernel command line parameters "BOOT_IMAGE=/boot/bzImage-517rc6 kprobe_event=p,syscall_any,$arg1 trace_options=quiet trace_clock=jiffies", will be passed to user space. Run /sbin/init as init process with arguments: /sbin/init with environment: HOME=/ TERM=linux BOOT_IMAGE=/boot/bzImage-517rc6 kprobe_event=p,syscall_any,$arg1 trace_options=quiet trace_clock=jiffies Return 1 from the __setup() handlers so that init's environment is not polluted with kernel boot options. Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru Link: https://lkml.kernel.org/r/20220303031744.32356-1-rdunlap@infradead.org Cc: stable@vger.kernel.org Fixes: 7bcfaf54f591 ("tracing: Add trace_options kernel command line parameter") Fixes: e1e232ca6b8f ("tracing: Add trace_clock= kernel parameter") Fixes: 970988e19eb0 ("tracing/kprobe: Add kprobe_event= boot parameter") Signed-off-by: Randy Dunlap Reported-by: Igor Zhbanov Acked-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (Google) commit 0708a0afe291bdfe1386d74d5ec1f0c27e8b9168 Author: Daniel Borkmann Date: Fri Mar 4 15:26:32 2022 +0100 mm: Consider __GFP_NOWARN flag for oversized kvmalloc() calls syzkaller was recently triggering an oversized kvmalloc() warning via xdp_umem_create(). The triggered warning was added back in 7661809d493b ("mm: don't allow oversized kvmalloc() calls"). The rationale for the warning for huge kvmalloc sizes was as a reaction to a security bug where the size was more than UINT_MAX but not everything was prepared to handle unsigned long sizes. Anyway, the AF_XDP related call trace from this syzkaller report was: kvmalloc include/linux/mm.h:806 [inline] kvmalloc_array include/linux/mm.h:824 [inline] kvcalloc include/linux/mm.h:829 [inline] xdp_umem_pin_pages net/xdp/xdp_umem.c:102 [inline] xdp_umem_reg net/xdp/xdp_umem.c:219 [inline] xdp_umem_create+0x6a5/0xf00 net/xdp/xdp_umem.c:252 xsk_setsockopt+0x604/0x790 net/xdp/xsk.c:1068 __sys_setsockopt+0x1fd/0x4e0 net/socket.c:2176 __do_sys_setsockopt net/socket.c:2187 [inline] __se_sys_setsockopt net/socket.c:2184 [inline] __x64_sys_setsockopt+0xb5/0x150 net/socket.c:2184 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 Björn mentioned that requests for >2GB allocation can still be valid: The structure that is being allocated is the page-pinning accounting. AF_XDP has an internal limit of U32_MAX pages, which is *a lot*, but still fewer than what memcg allows (PAGE_COUNTER_MAX is a LONG_MAX/ PAGE_SIZE on 64 bit systems). [...] I could just change from U32_MAX to INT_MAX, but as I stated earlier that has a hacky feeling to it. [...] From my perspective, the code isn't broken, with the memcg limits in consideration. [...] Linus says: [...] Pretty much every time this has come up, the kernel warning has shown that yes, the code was broken and there really wasn't a reason for doing allocations that big. Of course, some people would be perfectly fine with the allocation failing, they just don't want the warning. I didn't want __GFP_NOWARN to shut it up originally because I wanted people to see all those cases, but these days I think we can just say "yeah, people can shut it up explicitly by saying 'go ahead and fail this allocation, don't warn about it'". So enough time has passed that by now I'd certainly be ok with [it]. Thus allow call-sites to silence such userspace triggered splats if the allocation requests have __GFP_NOWARN. For xdp_umem_pin_pages()'s call to kvcalloc() this is already the case, so nothing else needed there. Fixes: 7661809d493b ("mm: don't allow oversized kvmalloc() calls") Reported-by: syzbot+11421fbbff99b989670e@syzkaller.appspotmail.com Suggested-by: Linus Torvalds Signed-off-by: Daniel Borkmann Tested-by: syzbot+11421fbbff99b989670e@syzkaller.appspotmail.com Cc: Björn Töpel Cc: Magnus Karlsson Cc: Willy Tarreau Cc: Andrew Morton Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Jakub Kicinski Cc: David S. Miller Link: https://lore.kernel.org/bpf/CAJ+HfNhyfsT5cS_U9EC213ducHs9k9zNxX9+abqC0kTrPbQ0gg@mail.gmail.com Link: https://lore.kernel.org/bpf/20211201202905.b9892171e3f5b9a60f9da251@linux-foundation.org Reviewed-by: Leon Romanovsky Ackd-by: Michal Hocko Signed-off-by: Linus Torvalds commit b9d102dafec6af1c07b610faf0a6d4e8aee14ae0 Author: Xie Yongji Date: Fri Jan 21 16:39:39 2022 +0800 vduse: Fix returning wrong type in vduse_domain_alloc_iova() This fixes the following smatch warnings: drivers/vdpa/vdpa_user/iova_domain.c:305 vduse_domain_alloc_iova() warn: should 'iova_pfn << shift' be a 64 bit type? Fixes: 8c773d53fb7b ("vduse: Implement an MMU-based software IOTLB") Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Xie Yongji Link: https://lore.kernel.org/r/20220121083940.102-1-xieyongji@bytedance.com Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit ed0f849fc3a63ed2ddf5e72cdb1de3bdbbb0f8eb Author: Si-Wei Liu Date: Fri Jan 14 19:28:01 2022 -0500 vdpa/mlx5: add validation for VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET command When control vq receives a VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET command request from the driver, presently there is no validation against the number of queue pairs to configure, or even if multiqueue had been negotiated or not is unverified. This may lead to kernel panic due to uninitialized resource for the queues were there any bogus request sent down by untrusted driver. Tie up the loose ends there. Fixes: 52893733f2c5 ("vdpa/mlx5: Add multiqueue support") Signed-off-by: Si-Wei Liu Link: https://lore.kernel.org/r/1642206481-30721-4-git-send-email-si-wei.liu@oracle.com Signed-off-by: Michael S. Tsirkin Reviewed-by: Eli Cohen Acked-by: Jason Wang commit 30c22f3816ffef8aa21a000e93c4ee1402a6ea65 Author: Si-Wei Liu Date: Fri Jan 14 19:28:00 2022 -0500 vdpa/mlx5: should verify CTRL_VQ feature exists for MQ Per VIRTIO v1.1 specification, section 5.1.3.1 Feature bit requirements: "VIRTIO_NET_F_MQ Requires VIRTIO_NET_F_CTRL_VQ". There's assumption in the mlx5_vdpa multiqueue code that MQ must come together with CTRL_VQ. However, there's nowhere in the upper layer to guarantee this assumption would hold. Were there an untrusted driver sending down MQ without CTRL_VQ, it would compromise various spots for e.g. is_index_valid() and is_ctrl_vq_idx(). Although this doesn't end up with immediate panic or security loophole as of today's code, the chance for this to be taken advantage of due to future code change is not zero. Harden the crispy assumption by failing the set_driver_features() call when seeing (MQ && !CTRL_VQ). For that end, verify_min_features() is renamed to verify_driver_features() to reflect the fact that it now does more than just validate the minimum features. verify_driver_features() is now used to accommodate various checks against the driver features for set_driver_features(). Signed-off-by: Si-Wei Liu Link: https://lore.kernel.org/r/1642206481-30721-3-git-send-email-si-wei.liu@oracle.com Signed-off-by: Michael S. Tsirkin Reviewed-by: Eli Cohen Acked-by: Jason Wang commit e0077cc13b831f8fad5557442f73bf7728683713 Author: Si-Wei Liu Date: Fri Jan 14 19:27:59 2022 -0500 vdpa: factor out vdpa_set_features_unlocked for vdpa internal use No functional change introduced. vdpa bus driver such as virtio_vdpa or vhost_vdpa is not supposed to take care of the locking for core by its own. The locked API vdpa_set_features should suffice the bus driver's need. Signed-off-by: Si-Wei Liu Reviewed-by: Eli Cohen Link: https://lore.kernel.org/r/1642206481-30721-2-git-send-email-si-wei.liu@oracle.com Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit ca93e44bfb5fd7996b76f0f544999171f647f93b Author: Filipe Manana Date: Wed Mar 2 11:48:39 2022 +0000 btrfs: fallback to blocking mode when doing async dio over multiple extents Some users recently reported that MariaDB was getting a read corruption when using io_uring on top of btrfs. This started to happen in 5.16, after commit 51bd9563b6783d ("btrfs: fix deadlock due to page faults during direct IO reads and writes"). That changed btrfs to use the new iomap flag IOMAP_DIO_PARTIAL and to disable page faults before calling iomap_dio_rw(). This was necessary to fix deadlocks when the iovector corresponds to a memory mapped file region. That type of scenario is exercised by test case generic/647 from fstests. For this MariaDB scenario, we attempt to read 16K from file offset X using IOCB_NOWAIT and io_uring. In that range we have 4 extents, each with a size of 4K, and what happens is the following: 1) btrfs_direct_read() disables page faults and calls iomap_dio_rw(); 2) iomap creates a struct iomap_dio object, its reference count is initialized to 1 and its ->size field is initialized to 0; 3) iomap calls btrfs_dio_iomap_begin() with file offset X, which finds the first 4K extent, and setups an iomap for this extent consisting of a single page; 4) At iomap_dio_bio_iter(), we are able to access the first page of the buffer (struct iov_iter) with bio_iov_iter_get_pages() without triggering a page fault; 5) iomap submits a bio for this 4K extent (iomap_dio_submit_bio() -> btrfs_submit_direct()) and increments the refcount on the struct iomap_dio object to 2; The ->size field of the struct iomap_dio object is incremented to 4K; 6) iomap calls btrfs_iomap_begin() again, this time with a file offset of X + 4K. There we setup an iomap for the next extent that also has a size of 4K; 7) Then at iomap_dio_bio_iter() we call bio_iov_iter_get_pages(), which tries to access the next page (2nd page) of the buffer. This triggers a page fault and returns -EFAULT; 8) At __iomap_dio_rw() we see the -EFAULT, but we reset the error to 0 because we passed the flag IOMAP_DIO_PARTIAL to iomap and the struct iomap_dio object has a ->size value of 4K (we submitted a bio for an extent already). The 'wait_for_completion' variable is not set to true, because our iocb has IOCB_NOWAIT set; 9) At the bottom of __iomap_dio_rw(), we decrement the reference count of the struct iomap_dio object from 2 to 1. Because we were not the only ones holding a reference on it and 'wait_for_completion' is set to false, -EIOCBQUEUED is returned to btrfs_direct_read(), which just returns it up the callchain, up to io_uring; 10) The bio submitted for the first extent (step 5) completes and its bio endio function, iomap_dio_bio_end_io(), decrements the last reference on the struct iomap_dio object, resulting in calling iomap_dio_complete_work() -> iomap_dio_complete(). 11) At iomap_dio_complete() we adjust the iocb->ki_pos from X to X + 4K and return 4K (the amount of io done) to iomap_dio_complete_work(); 12) iomap_dio_complete_work() calls the iocb completion callback, iocb->ki_complete() with a second argument value of 4K (total io done) and the iocb with the adjust ki_pos of X + 4K. This results in completing the read request for io_uring, leaving it with a result of 4K bytes read, and only the first page of the buffer filled in, while the remaining 3 pages, corresponding to the other 3 extents, were not filled; 13) For the application, the result is unexpected because if we ask to read N bytes, it expects to get N bytes read as long as those N bytes don't cross the EOF (i_size). MariaDB reports this as an error, as it's not expecting a short read, since it knows it's asking for read operations fully within the i_size boundary. This is typical in many applications, but it may also be questionable if they should react to such short reads by issuing more read calls to get the remaining data. Nevertheless, the short read happened due to a change in btrfs regarding how it deals with page faults while in the middle of a read operation, and there's no reason why btrfs can't have the previous behaviour of returning the whole data that was requested by the application. The problem can also be triggered with the following simple program: /* Get O_DIRECT */ #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif #include #include #include #include #include #include #include int main(int argc, char *argv[]) { char *foo_path; struct io_uring ring; struct io_uring_sqe *sqe; struct io_uring_cqe *cqe; struct iovec iovec; int fd; long pagesize; void *write_buf; void *read_buf; ssize_t ret; int i; if (argc != 2) { fprintf(stderr, "Use: %s \n", argv[0]); return 1; } foo_path = malloc(strlen(argv[1]) + 5); if (!foo_path) { fprintf(stderr, "Failed to allocate memory for file path\n"); return 1; } strcpy(foo_path, argv[1]); strcat(foo_path, "/foo"); /* * Create file foo with 2 extents, each with a size matching * the page size. Then allocate a buffer to read both extents * with io_uring, using O_DIRECT and IOCB_NOWAIT. Before doing * the read with io_uring, access the first page of the buffer * to fault it in, so that during the read we only trigger a * page fault when accessing the second page of the buffer. */ fd = open(foo_path, O_CREAT | O_TRUNC | O_WRONLY | O_DIRECT, 0666); if (fd == -1) { fprintf(stderr, "Failed to create file 'foo': %s (errno %d)", strerror(errno), errno); return 1; } pagesize = sysconf(_SC_PAGE_SIZE); ret = posix_memalign(&write_buf, pagesize, 2 * pagesize); if (ret) { fprintf(stderr, "Failed to allocate write buffer\n"); return 1; } memset(write_buf, 0xab, pagesize); memset(write_buf + pagesize, 0xcd, pagesize); /* Create 2 extents, each with a size matching page size. */ for (i = 0; i < 2; i++) { ret = pwrite(fd, write_buf + i * pagesize, pagesize, i * pagesize); if (ret != pagesize) { fprintf(stderr, "Failed to write to file, ret = %ld errno %d (%s)\n", ret, errno, strerror(errno)); return 1; } ret = fsync(fd); if (ret != 0) { fprintf(stderr, "Failed to fsync file\n"); return 1; } } close(fd); fd = open(foo_path, O_RDONLY | O_DIRECT); if (fd == -1) { fprintf(stderr, "Failed to open file 'foo': %s (errno %d)", strerror(errno), errno); return 1; } ret = posix_memalign(&read_buf, pagesize, 2 * pagesize); if (ret) { fprintf(stderr, "Failed to allocate read buffer\n"); return 1; } /* * Fault in only the first page of the read buffer. * We want to trigger a page fault for the 2nd page of the * read buffer during the read operation with io_uring * (O_DIRECT and IOCB_NOWAIT). */ memset(read_buf, 0, 1); ret = io_uring_queue_init(1, &ring, 0); if (ret != 0) { fprintf(stderr, "Failed to create io_uring queue\n"); return 1; } sqe = io_uring_get_sqe(&ring); if (!sqe) { fprintf(stderr, "Failed to get io_uring sqe\n"); return 1; } iovec.iov_base = read_buf; iovec.iov_len = 2 * pagesize; io_uring_prep_readv(sqe, fd, &iovec, 1, 0); ret = io_uring_submit_and_wait(&ring, 1); if (ret != 1) { fprintf(stderr, "Failed at io_uring_submit_and_wait()\n"); return 1; } ret = io_uring_wait_cqe(&ring, &cqe); if (ret < 0) { fprintf(stderr, "Failed at io_uring_wait_cqe()\n"); return 1; } printf("io_uring read result for file foo:\n\n"); printf(" cqe->res == %d (expected %d)\n", cqe->res, 2 * pagesize); printf(" memcmp(read_buf, write_buf) == %d (expected 0)\n", memcmp(read_buf, write_buf, 2 * pagesize)); io_uring_cqe_seen(&ring, cqe); io_uring_queue_exit(&ring); return 0; } When running it on an unpatched kernel: $ gcc io_uring_test.c -luring $ mkfs.btrfs -f /dev/sda $ mount /dev/sda /mnt/sda $ ./a.out /mnt/sda io_uring read result for file foo: cqe->res == 4096 (expected 8192) memcmp(read_buf, write_buf) == -205 (expected 0) After this patch, the read always returns 8192 bytes, with the buffer filled with the correct data. Although that reproducer always triggers the bug in my test vms, it's possible that it will not be so reliable on other environments, as that can happen if the bio for the first extent completes and decrements the reference on the struct iomap_dio object before we do the atomic_dec_and_test() on the reference at __iomap_dio_rw(). Fix this in btrfs by having btrfs_dio_iomap_begin() return -EAGAIN whenever we try to satisfy a non blocking IO request (IOMAP_NOWAIT flag set) over a range that spans multiple extents (or a mix of extents and holes). This avoids returning success to the caller when we only did partial IO, which is not optimal for writes and for reads it's actually incorrect, as the caller doesn't expect to get less bytes read than it has requested (unless EOF is crossed), as previously mentioned. This is also the type of behaviour that xfs follows (xfs_direct_write_iomap_begin()), even though it doesn't use IOMAP_DIO_PARTIAL. A test case for fstests will follow soon. Link: https://lore.kernel.org/linux-btrfs/CABVffEM0eEWho+206m470rtM0d9J8ue85TtR-A_oVTuGLWFicA@mail.gmail.com/ Link: https://lore.kernel.org/linux-btrfs/CAHF2GV6U32gmqSjLe=XKgfcZAmLCiH26cJ2OnHGp5x=VAH4OHQ@mail.gmail.com/ CC: stable@vger.kernel.org # 5.16+ Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 0e7174b9d5877130fec41fb4a16e0c2ee4958d44 Author: Michael S. Tsirkin Date: Tue Oct 5 03:04:10 2021 -0400 virtio_console: break out of buf poll on remove A common pattern for device reset is currently: vdev->config->reset(vdev); .. cleanup .. reset prevents new interrupts from arriving and waits for interrupt handlers to finish. However if - as is common - the handler queues a work request which is flushed during the cleanup stage, we have code adding buffers / trying to get buffers while device is reset. Not good. This was reproduced by running modprobe virtio_console modprobe -r virtio_console in a loop. Fix this up by calling virtio_break_device + flush before reset. Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1786239 Signed-off-by: Michael S. Tsirkin commit c46eccdaadabb7822080a04e633f81b2ad37f358 Author: Michael S. Tsirkin Date: Fri Jan 14 15:54:01 2022 -0500 virtio: document virtio_reset_device Looks like most callers get driver/device removal wrong. Document what's expected of callers. Signed-off-by: Michael S. Tsirkin commit 4fa59ede95195f267101a1b8916992cf3f245cdb Author: Michael S. Tsirkin Date: Fri Jan 14 14:58:41 2022 -0500 virtio: acknowledge all features before access The feature negotiation was designed in a way that makes it possible for devices to know which config fields will be accessed by drivers. This is broken since commit 404123c2db79 ("virtio: allow drivers to validate features") with fallout in at least block and net. We have a partial work-around in commit 2f9a174f918e ("virtio: write back F_VERSION_1 before validate") which at least lets devices find out which format should config space have, but this is a partial fix: guests should not access config space without acknowledging features since otherwise we'll never be able to change the config space format. To fix, split finalize_features from virtio_finalize_features and call finalize_features with all feature bits before validation, and then - if validation changed any bits - once again after. Since virtio_finalize_features no longer writes out features rename it to virtio_features_ok - since that is what it does: checks that features are ok with the device. As a side effect, this also reduces the amount of hypervisor accesses - we now only acknowledge features once unless we are clearing any features when validating (which is uncommon). IRC I think that this was more or less always the intent in the spec but unfortunately the way the spec is worded does not say this explicitly, I plan to address this at the spec level, too. Acked-by: Jason Wang Cc: stable@vger.kernel.org Fixes: 404123c2db79 ("virtio: allow drivers to validate features") Fixes: 2f9a174f918e ("virtio: write back F_VERSION_1 before validate") Cc: "Halil Pasic" Signed-off-by: Michael S. Tsirkin commit 838d6d3461db0fdbf33fc5f8a69c27b50b4a46da Author: Michael S. Tsirkin Date: Fri Jan 14 14:56:15 2022 -0500 virtio: unexport virtio_finalize_features virtio_finalize_features is only used internally within virtio. No reason to export it. Signed-off-by: Michael S. Tsirkin Reviewed-by: Cornelia Huck Acked-by: Jason Wang commit be4977b847f5d5cedb64d50eaaf2218c3a55a3a3 Author: Tung Nguyen Date: Fri Mar 4 03:25:18 2022 +0000 tipc: fix kernel panic when enabling bearer When enabling a bearer on a node, a kernel panic is observed: [ 4.498085] RIP: 0010:tipc_mon_prep+0x4e/0x130 [tipc] ... [ 4.520030] Call Trace: [ 4.520689] [ 4.521236] tipc_link_build_proto_msg+0x375/0x750 [tipc] [ 4.522654] tipc_link_build_state_msg+0x48/0xc0 [tipc] [ 4.524034] __tipc_node_link_up+0xd7/0x290 [tipc] [ 4.525292] tipc_rcv+0x5da/0x730 [tipc] [ 4.526346] ? __netif_receive_skb_core+0xb7/0xfc0 [ 4.527601] tipc_l2_rcv_msg+0x5e/0x90 [tipc] [ 4.528737] __netif_receive_skb_list_core+0x20b/0x260 [ 4.530068] netif_receive_skb_list_internal+0x1bf/0x2e0 [ 4.531450] ? dev_gro_receive+0x4c2/0x680 [ 4.532512] napi_complete_done+0x6f/0x180 [ 4.533570] virtnet_poll+0x29c/0x42e [virtio_net] ... The node in question is receiving activate messages in another thread after changing bearer status to allow message sending/ receiving in current thread: thread 1 | thread 2 -------- | -------- | tipc_enable_bearer() | test_and_set_bit_lock() | tipc_bearer_xmit_skb() | | tipc_l2_rcv_msg() | tipc_rcv() | __tipc_node_link_up() | tipc_link_build_state_msg() | tipc_link_build_proto_msg() | tipc_mon_prep() | { | ... | // null-pointer dereference | u16 gen = mon->dom_gen; | ... | } // Not being executed yet | tipc_mon_create() | { | ... | // allocate | mon = kzalloc(); | ... | } | Monitoring pointer in thread 2 is dereferenced before monitoring data is allocated in thread 1. This causes kernel panic. This commit fixes it by allocating the monitoring data before enabling the bearer to receive messages. Fixes: 35c55c9877f8 ("tipc: add neighbor monitoring framework") Reported-by: Shuang Li Acked-by: Jon Maloy Signed-off-by: Tung Nguyen Signed-off-by: David S. Miller commit 0bf476fc3624e3a72af4ba7340d430a91c18cd67 Author: Robert Hancock Date: Thu Mar 3 12:10:27 2022 -0600 net: macb: Fix lost RX packet wakeup race in NAPI receive There is an oddity in the way the RSR register flags propagate to the ISR register (and the actual interrupt output) on this hardware: it appears that RSR register bits only result in ISR being asserted if the interrupt was actually enabled at the time, so enabling interrupts with RSR bits already set doesn't trigger an interrupt to be raised. There was already a partial fix for this race in the macb_poll function where it checked for RSR bits being set and re-triggered NAPI receive. However, there was a still a race window between checking RSR and actually enabling interrupts, where a lost wakeup could happen. It's necessary to check again after enabling interrupts to see if RSR was set just prior to the interrupt being enabled, and re-trigger receive in that case. This issue was noticed in a point-to-point UDP request-response protocol which periodically saw timeouts or abnormally high response times due to received packets not being processed in a timely fashion. In many applications, more packets arriving, including TCP retransmissions, would cause the original packet to be processed, thus masking the issue. Fixes: 02f7a34f34e3 ("net: macb: Re-enable RX interrupt only when RX is done") Cc: stable@vger.kernel.org Co-developed-by: Scott McNutt Signed-off-by: Scott McNutt Signed-off-by: Robert Hancock Tested-by: Claudiu Beznea Signed-off-by: David S. Miller commit 9f3956d6595abcd1295f13d96132ff7f28e8ed64 Merge: b949c21fc23ec 008ee9eb8a11b Author: Jakub Kicinski Date: Thu Mar 3 20:31:02 2022 -0800 Merge tag 'for-net-2022-03-03' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth Luiz Augusto von Dentz says: ==================== bluetooth pull request for net: - Fix regression with processing of MGMT commands - Fix unbalanced unlock in Set Device Flags * tag 'for-net-2022-03-03' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth: Bluetooth: hci_sync: Fix not processing all entries on cmd_sync_work Bluetooth: hci_core: Fix unbalanced unlock in set_device_flags() ==================== Link: https://lore.kernel.org/r/20220303210743.314679-1-luiz.dentz@gmail.com Signed-off-by: Jakub Kicinski commit 74583f1b92cb3bbba1a3741cea237545c56f506c Author: Niklas Cassel Date: Tue Mar 1 00:44:18 2022 +0000 riscv: dts: k210: fix broken IRQs on hart1 Commit 67d96729a9e7 ("riscv: Update Canaan Kendryte K210 device tree") incorrectly removed two entries from the PLIC interrupt-controller node's interrupts-extended property. The PLIC driver cannot know the mapping between hart contexts and hart ids, so this information has to be provided by device tree, as specified by the PLIC device tree binding. The PLIC driver uses the interrupts-extended property, and initializes the hart context registers in the exact same order as provided by the interrupts-extended property. In other words, if we don't specify the S-mode interrupts, the PLIC driver will simply initialize the hart0 S-mode hart context with the hart1 M-mode configuration. It is therefore essential to specify the S-mode IRQs even though the system itself will only ever be running in M-mode. Re-add the S-mode interrupts, so that we get working IRQs on hart1 again. Cc: Fixes: 67d96729a9e7 ("riscv: Update Canaan Kendryte K210 device tree") Signed-off-by: Niklas Cassel Signed-off-by: Palmer Dabbelt commit 8fdb19679722a02fe21642d39710c701d2ed567a Merge: c9585249c245e 62929726ef0ec Author: Dave Airlie Date: Fri Mar 4 13:04:06 2022 +1000 Merge tag 'drm-misc-fixes-2022-03-03' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes * drm/arm: Select DRM_GEM_CMEA_HELPER for HDLCD * drm/bridge: ti-sn65dsi86: Properly undo autosuspend * drm/vrr: Fix potential NULL-pointer deref Signed-off-by: Dave Airlie From: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/YiCTGZ8IVCw0ilKK@linux-uq9g commit c9585249c245e23580a2c3edbc8f14d9d7173f12 Merge: 0d9f0ee17b3f5 f1ef17011c765 Author: Dave Airlie Date: Fri Mar 4 13:02:13 2022 +1000 Merge tag 'amd-drm-fixes-5.17-2022-03-02' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-fixes-5.17-2022-03-02: amdgpu: - Suspend regression fix Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220303045035.5650-1-alexander.deucher@amd.com commit 0d9f0ee17b3f57012e6b8530d6b9e80f138a8e28 Merge: e7c470a4b5433 08783aa7693f5 Author: Dave Airlie Date: Fri Mar 4 12:55:48 2022 +1000 Merge tag 'drm-intel-fixes-2022-03-03' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes - Fix GuC SLPC unset command. (Vinay Belgaumkar) - Fix misidentification of some Apple MacBook Pro laptops as Jasper Lake. (Ville Syrjälä) Signed-off-by: Dave Airlie From: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/YiCXHiTyCE7TbopG@tursulin-mobl2 commit 327b89f0acc4c20a06ed59e4d9af7f6d804dc2e2 Author: William Mahon Date: Thu Mar 3 18:26:22 2022 -0800 HID: add mapping for KEY_ALL_APPLICATIONS This patch adds a new key definition for KEY_ALL_APPLICATIONS and aliases KEY_DASHBOARD to it. It also maps the 0x0c/0x2a2 usage code to KEY_ALL_APPLICATIONS. Signed-off-by: William Mahon Acked-by: Benjamin Tissoires Link: https://lore.kernel.org/r/20220303035618.1.I3a7746ad05d270161a18334ae06e3b6db1a1d339@changeid Signed-off-by: Dmitry Torokhov commit bfa26ba343c727e055223be04e08f2ebdd43c293 Author: William Mahon Date: Thu Mar 3 18:23:42 2022 -0800 HID: add mapping for KEY_DICTATE Numerous keyboards are adding dictate keys which allows for text messages to be dictated by a microphone. This patch adds a new key definition KEY_DICTATE and maps 0x0c/0x0d8 usage code to this new keycode. Additionally hid-debug is adjusted to recognize this new usage code as well. Signed-off-by: William Mahon Acked-by: Benjamin Tissoires Link: https://lore.kernel.org/r/20220303021501.1.I5dbf50eb1a7a6734ee727bda4a8573358c6d3ec0@changeid Signed-off-by: Dmitry Torokhov commit e4fcfe6eca6f32357f1b4408ff15b10527518eee Author: Alexandre Ghiti Date: Fri Feb 25 13:39:53 2022 +0100 riscv: Fix kasan pud population In sv48, the kasan inner regions are not aligned on PGDIR_SIZE and then when we populate the kasan linear mapping region, we clear the kasan vmalloc region which is in the same PGD. Fix this by copying the content of the kasan early pud after allocating a new PGD for the first time. Fixes: e8a62cc26ddf ("riscv: Implement sv48 support") Signed-off-by: Alexandre Ghiti Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit 625e24a550e6a600e639b43cf7c15879b2a70840 Author: Alexandre Ghiti Date: Fri Feb 25 13:39:52 2022 +0100 riscv: Move high_memory initialization to setup_bootmem high_memory used to be initialized in mem_init, way after setup_bootmem. But a call to dma_contiguous_reserve in this function gives rise to the below warning because high_memory is equal to 0 and is used at the very beginning at cma_declare_contiguous_nid. It went unnoticed since the move of the kasan region redefined KERN_VIRT_SIZE so that it does not encompass -1 anymore. Fix this by initializing high_memory in setup_bootmem. ------------[ cut here ]------------ virt_to_phys used for non-linear address: ffffffffffffffff (0xffffffffffffffff) WARNING: CPU: 0 PID: 0 at arch/riscv/mm/physaddr.c:14 __virt_to_phys+0xac/0x1b8 Modules linked in: CPU: 0 PID: 0 Comm: swapper Not tainted 5.17.0-rc1-00007-ga68b89289e26 #27 Hardware name: riscv-virtio,qemu (DT) epc : __virt_to_phys+0xac/0x1b8 ra : __virt_to_phys+0xac/0x1b8 epc : ffffffff80014922 ra : ffffffff80014922 sp : ffffffff84a03c30 gp : ffffffff85866c80 tp : ffffffff84a3f180 t0 : ffffffff86bce657 t1 : fffffffef09406e8 t2 : 0000000000000000 s0 : ffffffff84a03c70 s1 : ffffffffffffffff a0 : 000000000000004f a1 : 00000000000f0000 a2 : 0000000000000002 a3 : ffffffff8011f408 a4 : 0000000000000000 a5 : 0000000000000000 a6 : 0000000000f00000 a7 : ffffffff84a03747 s2 : ffffffd800000000 s3 : ffffffff86ef4000 s4 : ffffffff8467f828 s5 : fffffff800000000 s6 : 8000000000006800 s7 : 0000000000000000 s8 : 0000000480000000 s9 : 0000000080038ea0 s10: 0000000000000000 s11: ffffffffffffffff t3 : ffffffff84a035c0 t4 : fffffffef09406e8 t5 : fffffffef09406e9 t6 : ffffffff84a03758 status: 0000000000000100 badaddr: 0000000000000000 cause: 0000000000000003 [] cma_declare_contiguous_nid+0xf2/0x64a [] dma_contiguous_reserve_area+0x46/0xb4 [] dma_contiguous_reserve+0x174/0x18e [] paging_init+0x12c/0x35e [] setup_arch+0x120/0x74e [] start_kernel+0xce/0x68c irq event stamp: 0 hardirqs last enabled at (0): [<0000000000000000>] 0x0 hardirqs last disabled at (0): [<0000000000000000>] 0x0 softirqs last enabled at (0): [<0000000000000000>] 0x0 softirqs last disabled at (0): [<0000000000000000>] 0x0 ---[ end trace 0000000000000000 ]--- Fixes: f7ae02333d13 ("riscv: Move KASAN mapping next to the kernel mapping") Signed-off-by: Alexandre Ghiti Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit c648c4bb7d02ceb53ee40172fdc4433b37cee9c6 Author: Alexandre Ghiti Date: Fri Feb 25 13:39:51 2022 +0100 riscv: Fix config KASAN && DEBUG_VIRTUAL __virt_to_phys function is called very early in the boot process (ie kasan_early_init) so it should not be instrumented by KASAN otherwise it bugs. Fix this by declaring phys_addr.c as non-kasan instrumentable. Signed-off-by: Alexandre Ghiti Fixes: 8ad8b72721d0 (riscv: Add KASAN support) Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit 5f763b3b59602735993149330ffa7e348bc85bc0 Author: Alexandre Ghiti Date: Fri Feb 25 13:39:50 2022 +0100 riscv: Fix DEBUG_VIRTUAL false warnings KERN_VIRT_SIZE used to encompass the kernel mapping before it was redefined when moving the kasan mapping next to the kernel mapping to only match the maximum amount of physical memory. Then, kernel mapping addresses that go through __virt_to_phys are now declared as wrong which is not true, one can use __virt_to_phys on such addresses. Fix this by redefining the condition that matches wrong addresses. Fixes: f7ae02333d13 ("riscv: Move KASAN mapping next to the kernel mapping") Signed-off-by: Alexandre Ghiti Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit a3d328037846d013bb4c7f3777241e190e4c75e1 Author: Alexandre Ghiti Date: Fri Feb 25 13:39:49 2022 +0100 riscv: Fix config KASAN && SPARSEMEM && !SPARSE_VMEMMAP In order to get the pfn of a struct page* when sparsemem is enabled without vmemmap, the mem_section structures need to be initialized which happens in sparse_init. But kasan_early_init calls pfn_to_page way before sparse_init is called, which then tries to dereference a null mem_section pointer. Fix this by removing the usage of this function in kasan_early_init. Fixes: 8ad8b72721d0 ("riscv: Add KASAN support") Signed-off-by: Alexandre Ghiti Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit 8b274f2238950c55570ff14fcc278a7fcbecc663 Author: Alexandre Ghiti Date: Fri Feb 25 13:39:48 2022 +0100 riscv: Fix is_linear_mapping with recent move of KASAN region The KASAN region was recently moved between the linear mapping and the kernel mapping, is_linear_mapping used to check the validity of an address by using the start of the kernel mapping, which is now wrong. Fix this by using the maximum size of the physical memory. Fixes: f7ae02333d13 ("riscv: Move KASAN mapping next to the kernel mapping") Signed-off-by: Alexandre Ghiti Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit 38f80f42147ff658aff218edb0a88c37e58bf44f Author: Ammar Faizi Date: Sat Feb 26 14:40:56 2022 +0700 MAINTAINERS: Remove dead patchwork link The patchwork link is dead. It says: 404: File not found The page URL requested (/project/LKML/list/) does not exist. Remove it. Signed-off-by: Ammar Faizi Signed-off-by: Linus Torvalds commit b08968f196d498b19e9d0841d76a03862258f2d8 Author: David Howells Date: Thu Mar 3 13:05:18 2022 +0000 cachefiles: Fix incorrect length to fallocate() When cachefiles_shorten_object() calls fallocate() to shape the cache file to match the DIO size, it passes the total file size it wants to achieve, not the amount of zeros that should be inserted. Since this is meant to preallocate that amount of storage for the file, it can cause the cache to fill up the disk and hit ENOSPC. Fix this by passing the length actually required to go from the current EOF to the desired EOF. Fixes: 7623ed6772de ("cachefiles: Implement cookie resize for truncate") Reported-by: Jeffle Xu Signed-off-by: David Howells Tested-by: Jeff Layton Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/164630854858.3665356.17419701804248490708.stgit@warthog.procyon.org.uk # v1 Signed-off-by: Linus Torvalds commit b949c21fc23ecaccef89582f251e6281cad1f81e Merge: e58bd49da6eb4 2d3916f318917 Author: Linus Torvalds Date: Thu Mar 3 11:10:56 2022 -0800 Merge tag 'net-5.17-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Jakub Kicinski: "Including fixes from can, xfrm, wifi, bluetooth, and netfilter. Lots of various size fixes, the length of the tag speaks for itself. Most of the 5.17-relevant stuff comes from xfrm, wifi and bt trees which had been lagging as you pointed out previously. But there's also a larger than we'd like portion of fixes for bugs from previous releases. Three more fixes still under discussion, including and xfrm revert for uAPI error. Current release - regressions: - iwlwifi: don't advertise TWT support, prevent FW crash - xfrm: fix the if_id check in changelink - xen/netfront: destroy queues before real_num_tx_queues is zeroed - bluetooth: fix not checking MGMT cmd pending queue, make scanning work again Current release - new code bugs: - mptcp: make SIOCOUTQ accurate for fallback socket - bluetooth: access skb->len after null check - bluetooth: hci_sync: fix not using conn_timeout - smc: fix cleanup when register ULP fails - dsa: restore error path of dsa_tree_change_tag_proto - iwlwifi: fix build error for IWLMEI - iwlwifi: mvm: propagate error from request_ownership to the user Previous releases - regressions: - xfrm: fix pMTU regression when reported pMTU is too small - xfrm: fix TCP MSS calculation when pMTU is close to 1280 - bluetooth: fix bt_skb_sendmmsg not allocating partial chunks - ipv6: ensure we call ipv6_mc_down() at most once, prevent leaks - ipv6: prevent leaks in igmp6 when input queues get full - fix up skbs delta_truesize in UDP GRO frag_list - eth: e1000e: fix possible HW unit hang after an s0ix exit - eth: e1000e: correct NVM checksum verification flow - ptp: ocp: fix large time adjustments Previous releases - always broken: - tcp: make tcp_read_sock() more robust in presence of urgent data - xfrm: distinguishing SAs and SPs by if_id in xfrm_migrate - xfrm: fix xfrm_migrate issues when address family changes - dcb: flush lingering app table entries for unregistered devices - smc: fix unexpected SMC_CLC_DECL_ERR_REGRMB error - mac80211: fix EAPoL rekey fail in 802.3 rx path - mac80211: fix forwarded mesh frames AC & queue selection - netfilter: nf_queue: fix socket access races and bugs - batman-adv: fix ToCToU iflink problems and check the result belongs to the expected net namespace - can: gs_usb, etas_es58x: fix opened_channel_cnt's accounting - can: rcar_canfd: register the CAN device when fully ready - eth: igb, igc: phy: drop premature return leaking HW semaphore - eth: ixgbe: xsk: change !netif_carrier_ok() handling in ixgbe_xmit_zc(), prevent live lock when link goes down - eth: stmmac: only enable DMA interrupts when ready - eth: sparx5: move vlan checks before any changes are made - eth: iavf: fix races around init, removal, resets and vlan ops - ibmvnic: more reset flow fixes Misc: - eth: fix return value of __setup handlers" * tag 'net-5.17-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (92 commits) ipv6: fix skb drops in igmp6_event_query() and igmp6_event_report() net: dsa: make dsa_tree_change_tag_proto actually unwind the tag proto change ixgbe: xsk: change !netif_carrier_ok() handling in ixgbe_xmit_zc() selftests: mlxsw: resource_scale: Fix return value selftests: mlxsw: tc_police_scale: Make test more robust net: dcb: disable softirqs in dcbnl_flush_dev() bnx2: Fix an error message sfc: extend the locking on mcdi->seqno net/smc: fix unexpected SMC_CLC_DECL_ERR_REGRMB error cause by server net/smc: fix unexpected SMC_CLC_DECL_ERR_REGRMB error generated by client net: arcnet: com20020: Fix null-ptr-deref in com20020pci_probe() tcp: make tcp_read_sock() more robust bpf, sockmap: Do not ignore orig_len parameter net: ipa: add an interconnect dependency net: fix up skbs delta_truesize in UDP GRO frag_list iwlwifi: mvm: return value for request_ownership nl80211: Update bss channel on channel switch for P2P_CLIENT iwlwifi: fix build error for IWLMEI ptp: ocp: Add ptp_ocp_adjtime_coarse for large adjustments batman-adv: Don't expect inter-netns unique iflink indices ... commit e58bd49da6eb4ba80175f82025d6c0e084237abf Merge: 4d5ae2340dd4f 5d8965704fe56 Author: Linus Torvalds Date: Thu Mar 3 10:38:28 2022 -0800 Merge tag 'mips-fixes-5.17_4' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux Pull MIPS fixes from Thomas Bogendoerfer: - Fix memory detection for MT7621 devices - Fix setnocoherentio kernel option - Fix warning when CONFIG_SCHED_CORE is enabled * tag 'mips-fixes-5.17_4' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: MIPS: ralink: mt7621: use bitwise NOT instead of logical mips: setup: fix setnocoherentio() boolean setting MIPS: smp: fill in sibling and core maps earlier MIPS: ralink: mt7621: do memory detection on KSEG1 commit 4d5ae2340dd4f0298e607e0792b0881693657279 Merge: 5859a2b199110 9ed331f8a0fb6 Author: Linus Torvalds Date: Thu Mar 3 10:31:09 2022 -0800 Merge tag 'auxdisplay-for-linus-v5.17-rc7' of git://github.com/ojeda/linux Pull auxdisplay fixes from Miguel Ojeda: "A few lcd2s fixes from Andy Shevchenko" * tag 'auxdisplay-for-linus-v5.17-rc7' of git://github.com/ojeda/linux: auxdisplay: lcd2s: Use proper API to free the instance of charlcd object auxdisplay: lcd2s: Fix memory leak in ->remove() auxdisplay: lcd2s: Fix lcd2s_redefine_char() feature commit 2d3916f3189172d5c69d33065c3c21119fe539fc Author: Eric Dumazet Date: Thu Mar 3 09:37:28 2022 -0800 ipv6: fix skb drops in igmp6_event_query() and igmp6_event_report() While investigating on why a synchronize_net() has been added recently in ipv6_mc_down(), I found that igmp6_event_query() and igmp6_event_report() might drop skbs in some cases. Discussion about removing synchronize_net() from ipv6_mc_down() will happen in a different thread. Fixes: f185de28d9ae ("mld: add new workqueues for process mld events") Signed-off-by: Eric Dumazet Cc: Taehee Yoo Cc: Cong Wang Cc: David Ahern Link: https://lore.kernel.org/r/20220303173728.937869-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit e1bec7fa1cee311a6d3fb9161037c7675904134d Author: Vladimir Oltean Date: Thu Mar 3 17:42:49 2022 +0200 net: dsa: make dsa_tree_change_tag_proto actually unwind the tag proto change The blamed commit said one thing but did another. It explains that we should restore the "return err" to the original "goto out_unwind_tagger", but instead it replaced it with "goto out_unlock". When DSA_NOTIFIER_TAG_PROTO fails after the first switch of a multi-switch tree, the switches would end up not using the same tagging protocol. Fixes: 0b0e2ff10356 ("net: dsa: restore error path of dsa_tree_change_tag_proto") Signed-off-by: Vladimir Oltean Link: https://lore.kernel.org/r/20220303154249.1854436-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 6c7273a266759d9d36f7c862149f248bcdeddc0f Author: Maciej Fijalkowski Date: Wed Mar 2 09:59:27 2022 -0800 ixgbe: xsk: change !netif_carrier_ok() handling in ixgbe_xmit_zc() Commit c685c69fba71 ("ixgbe: don't do any AF_XDP zero-copy transmit if netif is not OK") addressed the ring transient state when MEM_TYPE_XSK_BUFF_POOL was being configured which in turn caused the interface to through down/up. Maurice reported that when carrier is not ok and xsk_pool is present on ring pair, ksoftirqd will consume 100% CPU cycles due to the constant NAPI rescheduling as ixgbe_poll() states that there is still some work to be done. To fix this, do not set work_done to false for a !netif_carrier_ok(). Fixes: c685c69fba71 ("ixgbe: don't do any AF_XDP zero-copy transmit if netif is not OK") Reported-by: Maurice Baijens Tested-by: Maurice Baijens Signed-off-by: Maciej Fijalkowski Tested-by: Sandeep Penigalapati Signed-off-by: Tony Nguyen Signed-off-by: Jakub Kicinski commit 312f2d500af55823b96cd33b6b9bf6c4c0bc6e78 Merge: 10b6bb62ae1a4 196f9bc050cbc Author: Jakub Kicinski Date: Thu Mar 3 08:14:04 2022 -0800 Merge branch 'selftests-mlxsw-a-couple-of-fixes' Ido Schimmel says: ==================== selftests: mlxsw: A couple of fixes Patch #1 fixes a breakage due to a change in iproute2 output. The real problem is not iproute2, but the fact that the check was not strict enough. Fixed by using JSON output instead. Targeting at net so that the test will pass as part of old and new kernels regardless of iproute2 version. Patch #2 fixes an issue uncovered by the first one. ==================== Link: https://lore.kernel.org/r/20220302161447.217447-1-idosch@nvidia.com Signed-off-by: Jakub Kicinski commit 196f9bc050cbc5085b4cbb61cce2efe380bc66d0 Author: Amit Cohen Date: Wed Mar 2 18:14:47 2022 +0200 selftests: mlxsw: resource_scale: Fix return value The test runs several test cases and is supposed to return an error in case at least one of them failed. Currently, the check of the return value of each test case is in the wrong place, which can result in the wrong return value. For example: # TESTS='tc_police' ./resource_scale.sh TEST: 'tc_police' [default] 968 [FAIL] tc police offload count failed Error: mlxsw_spectrum: Failed to allocate policer index. We have an error talking to the kernel Command failed /tmp/tmp.i7Oc5HwmXY:969 TEST: 'tc_police' [default] overflow 969 [ OK ] ... TEST: 'tc_police' [ipv4_max] overflow 969 [ OK ] $ echo $? 0 Fix this by moving the check to be done after each test case. Fixes: 059b18e21c63 ("selftests: mlxsw: Return correct error code in resource scale test") Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: Jakub Kicinski commit dc9752075341e7beb653e37c6f4a3723074dc8bc Author: Amit Cohen Date: Wed Mar 2 18:14:46 2022 +0200 selftests: mlxsw: tc_police_scale: Make test more robust The test adds tc filters and checks how many of them were offloaded by grepping for 'in_hw'. iproute2 commit f4cd4f127047 ("tc: add skip_hw and skip_sw to control action offload") added offload indication to tc actions, producing the following output: $ tc filter show dev swp2 ingress ... filter protocol ipv6 pref 1000 flower chain 0 handle 0x7c0 eth_type ipv6 dst_ip 2001:db8:1::7bf skip_sw in_hw in_hw_count 1 action order 1: police 0x7c0 rate 10Mbit burst 100Kb mtu 2Kb action drop overhead 0b ref 1 bind 1 not_in_hw used_hw_stats immediate The current grep expression matches on both 'in_hw' and 'not_in_hw', resulting in incorrect results. Fix that by using JSON output instead. Fixes: 5061e773264b ("selftests: mlxsw: Add scale test for tc-police") Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: Jakub Kicinski commit 10b6bb62ae1a49ee818fc479cf57b8900176773e Author: Vladimir Oltean Date: Wed Mar 2 21:39:39 2022 +0200 net: dcb: disable softirqs in dcbnl_flush_dev() Ido Schimmel points out that since commit 52cff74eef5d ("dcbnl : Disable software interrupts before taking dcb_lock"), the DCB API can be called by drivers from softirq context. One such in-tree example is the chelsio cxgb4 driver: dcb_rpl -> cxgb4_dcb_handle_fw_update -> dcb_ieee_setapp If the firmware for this driver happened to send an event which resulted in a call to dcb_ieee_setapp() at the exact same time as another DCB-enabled interface was unregistering on the same CPU, the softirq would deadlock, because the interrupted process was already holding the dcb_lock in dcbnl_flush_dev(). Fix this unlikely event by using spin_lock_bh() in dcbnl_flush_dev() as in the rest of the dcbnl code. Fixes: 91b0383fef06 ("net: dcb: flush lingering app table entries for unregistered devices") Reported-by: Ido Schimmel Signed-off-by: Vladimir Oltean Link: https://lore.kernel.org/r/20220302193939.1368823-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 8ccffe9ac3239e549beaa0a9d5e1a1eac94e866c Author: Christophe JAILLET Date: Wed Mar 2 21:21:15 2022 +0100 bnx2: Fix an error message Fix an error message and report the correct failing function. Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller commit f1fb205efb0ccca55626fd4ef38570dd16b44719 Author: Niels Dossche Date: Tue Mar 1 23:28:22 2022 +0100 sfc: extend the locking on mcdi->seqno seqno could be read as a stale value outside of the lock. The lock is already acquired to protect the modification of seqno against a possible race condition. Place the reading of this value also inside this locking to protect it against a possible race condition. Signed-off-by: Niels Dossche Acked-by: Martin Habets Signed-off-by: David S. Miller commit 008ee9eb8a11bcabf12c91771dd4f470b082bd44 Author: Luiz Augusto von Dentz Date: Wed Mar 2 13:02:45 2022 -0800 Bluetooth: hci_sync: Fix not processing all entries on cmd_sync_work hci_cmd_sync_queue can be called multiple times, each adding a hci_cmd_sync_work_entry, before hci_cmd_sync_work is run so this makes sure they are all dequeued properly otherwise it creates a backlog of entries that are never run. Link: https://lore.kernel.org/all/CAJCQCtSeUtHCgsHXLGrSTWKmyjaQDbDNpP4rb0i+RE+L2FTXSA@mail.gmail.com/T/ Fixes: 6a98e3836fa20 ("Bluetooth: Add helper for serialized HCI command execution") Tested-by: Chris Clayton Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 815d5121927093017947fd76e627da03f0f70be7 Author: Hans de Goede Date: Wed Mar 2 14:44:39 2022 +0100 Bluetooth: hci_core: Fix unbalanced unlock in set_device_flags() There is only one "goto done;" in set_device_flags() and this happens *before* hci_dev_lock() is called, move the done label to after the hci_dev_unlock() to fix the following unlock balance: [ 31.493567] ===================================== [ 31.493571] WARNING: bad unlock balance detected! [ 31.493576] 5.17.0-rc2+ #13 Tainted: G C E [ 31.493581] ------------------------------------- [ 31.493584] bluetoothd/685 is trying to release lock (&hdev->lock) at: [ 31.493594] [] set_device_flags+0x65/0x1f0 [bluetooth] [ 31.493684] but there are no more locks to release! Note this bug has been around for a couple of years, but before commit fe92ee6425a2 ("Bluetooth: hci_core: Rework hci_conn_params flags") supported_flags was hardcoded to "((1U << HCI_CONN_FLAG_MAX) - 1)" so the check for unsupported flags which does the "goto done;" never triggered. Fixes: fe92ee6425a2 ("Bluetooth: hci_core: Rework hci_conn_params flags") Cc: Luiz Augusto von Dentz Signed-off-by: Hans de Goede Signed-off-by: Marcel Holtmann commit f8e9bd34cedd89b93b1167aa32ab8ecd6c2ccf4a Merge: bd6f1fd5d33df 4940a1fdf31c3 Author: David S. Miller Date: Thu Mar 3 10:34:18 2022 +0000 Merge branch 'smc-fix' D. Wythe says: ==================== fix unexpected SMC_CLC_DECL_ERR_REGRMB error We can easily trigger the SMC_CLC_DECL_ERR_REGRMB exception within following script: server: smc_run nginx client: smc_run ./wrk -c 2000 -t 8 -d 20 http://smc-server And we can clearly see that this error is also divided into two types: 1. 0x09990003 2. 0x05000000/0x09990003 Which has the same root causes, but the immediate causes vary. The root cause of this issues is that remove connections from link group is not synchronous with add/delete rtoken entry, which means that even the number of connections is less that SMC_RMBS_PER_LGR_MAX, it does not mean that the connection can register rtoken successfully later. In other words, the rtoken entry may released, This will cause an unexpected SMC_CLC_DECL_ERR_REGRMB to be reported, and then this SMC connections have to fallback to TCP. This patch set handles two types of SMC_CLC_DECL_ERR_REGRMB exceptions from different perspectives. Patch 1: fix the 0x05000000/0x09990003 error. Patch 2: fix the 0x09990003 error. After those patches, there is no SMC_CLC_DECL_ERR_REGRMB exceptions in my test case any more. v1 -> v2: - add bugfix patch for SMC_CLC_DECL_ERR_REGRMB cause by server side v2 -> v3: - fix incorrect mail thread ==================== Signed-off-by: David S. Miller commit 4940a1fdf31c39f0806ac831cde333134862030b Author: D. Wythe Date: Wed Mar 2 21:25:12 2022 +0800 net/smc: fix unexpected SMC_CLC_DECL_ERR_REGRMB error cause by server The problem of SMC_CLC_DECL_ERR_REGRMB on the server is very clear. Based on the fact that whether a new SMC connection can be accepted or not depends on not only the limit of conn nums, but also the available entries of rtoken. Since the rtoken release is trigger by peer, while the conn nums is decrease by local, tons of thing can happen in this time difference. This only thing that needs to be mentioned is that now all connection creations are completely protected by smc_server_lgr_pending lock, it's enough to check only the available entries in rtokens_used_mask. Fixes: cd6851f30386 ("smc: remote memory buffers (RMBs)") Signed-off-by: D. Wythe Signed-off-by: David S. Miller commit 0537f0a2151375dcf90c1bbfda6a0aaf57164e89 Author: D. Wythe Date: Wed Mar 2 21:25:11 2022 +0800 net/smc: fix unexpected SMC_CLC_DECL_ERR_REGRMB error generated by client The main reason for this unexpected SMC_CLC_DECL_ERR_REGRMB in client dues to following execution sequence: Server Conn A: Server Conn B: Client Conn B: smc_lgr_unregister_conn smc_lgr_register_conn smc_clc_send_accept -> smc_rtoken_add smcr_buf_unuse -> Client Conn A: smc_rtoken_delete smc_lgr_unregister_conn() makes current link available to assigned to new incoming connection, while smcr_buf_unuse() has not executed yet, which means that smc_rtoken_add may fail because of insufficient rtoken_entry, reversing their execution order will avoid this problem. Fixes: 3e034725c0d8 ("net/smc: common functions for RMBs and send buffers") Signed-off-by: D. Wythe Signed-off-by: David S. Miller commit bd6f1fd5d33dfe5d1b4f2502d3694a7cc13f166d Author: Zheyu Ma Date: Wed Mar 2 20:24:23 2022 +0800 net: arcnet: com20020: Fix null-ptr-deref in com20020pci_probe() During driver initialization, the pointer of card info, i.e. the variable 'ci' is required. However, the definition of 'com20020pci_id_table' reveals that this field is empty for some devices, which will cause null pointer dereference when initializing these devices. The following log reveals it: [ 3.973806] KASAN: null-ptr-deref in range [0x0000000000000028-0x000000000000002f] [ 3.973819] RIP: 0010:com20020pci_probe+0x18d/0x13e0 [com20020_pci] [ 3.975181] Call Trace: [ 3.976208] local_pci_probe+0x13f/0x210 [ 3.977248] pci_device_probe+0x34c/0x6d0 [ 3.977255] ? pci_uevent+0x470/0x470 [ 3.978265] really_probe+0x24c/0x8d0 [ 3.978273] __driver_probe_device+0x1b3/0x280 [ 3.979288] driver_probe_device+0x50/0x370 Fix this by checking whether the 'ci' is a null pointer first. Fixes: 8c14f9c70327 ("ARCNET: add com20020 PCI IDs with metadata") Signed-off-by: Zheyu Ma Signed-off-by: David S. Miller commit e3d5ea2c011ecb16fb94c56a659364e6b30fac94 Author: Eric Dumazet Date: Wed Mar 2 08:17:23 2022 -0800 tcp: make tcp_read_sock() more robust If recv_actor() returns an incorrect value, tcp_read_sock() might loop forever. Instead, issue a one time warning and make sure to make progress. Signed-off-by: Eric Dumazet Acked-by: John Fastabend Acked-by: Jakub Sitnicki Acked-by: Daniel Borkmann Link: https://lore.kernel.org/r/20220302161723.3910001-2-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit 60ce37b03917e593d8e5d8bcc7ec820773daf81d Author: Eric Dumazet Date: Wed Mar 2 08:17:22 2022 -0800 bpf, sockmap: Do not ignore orig_len parameter Currently, sk_psock_verdict_recv() returns skb->len This is problematic because tcp_read_sock() might have passed orig_len < skb->len, due to the presence of TCP urgent data. This causes an infinite loop from tcp_read_sock() Followup patch will make tcp_read_sock() more robust vs bad actors. Fixes: ef5659280eb1 ("bpf, sockmap: Allow skipping sk_skb parser program") Reported-by: syzbot Signed-off-by: Eric Dumazet Acked-by: John Fastabend Acked-by: Jakub Sitnicki Tested-by: Jakub Sitnicki Acked-by: Daniel Borkmann Link: https://lore.kernel.org/r/20220302161723.3910001-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit 1dba41c9d2e2dc94b543394974f63d55aa195bfe Author: Alex Elder Date: Tue Mar 1 05:34:40 2022 -0600 net: ipa: add an interconnect dependency In order to function, the IPA driver very clearly requires the interconnect framework to be enabled in the kernel configuration. State that dependency in the Kconfig file. This became a problem when CONFIG_COMPILE_TEST support was added. Non-Qualcomm platforms won't necessarily enable CONFIG_INTERCONNECT. Reported-by: kernel test robot Fixes: 38a4066f593c5 ("net: ipa: support COMPILE_TEST") Signed-off-by: Alex Elder Link: https://lore.kernel.org/r/20220301113440.257916-1-elder@linaro.org Signed-off-by: Jakub Kicinski commit 224102de2ff105a2c05695e66a08f4b5b6b2d19c Author: lena wang Date: Tue Mar 1 19:17:09 2022 +0800 net: fix up skbs delta_truesize in UDP GRO frag_list The truesize for a UDP GRO packet is added by main skb and skbs in main skb's frag_list: skb_gro_receive_list p->truesize += skb->truesize; The commit 53475c5dd856 ("net: fix use-after-free when UDP GRO with shared fraglist") introduced a truesize increase for frag_list skbs. When uncloning skb, it will call pskb_expand_head and trusesize for frag_list skbs may increase. This can occur when allocators uses __netdev_alloc_skb and not jump into __alloc_skb. This flow does not use ksize(len) to calculate truesize while pskb_expand_head uses. skb_segment_list err = skb_unclone(nskb, GFP_ATOMIC); pskb_expand_head if (!skb->sk || skb->destructor == sock_edemux) skb->truesize += size - osize; If we uses increased truesize adding as delta_truesize, it will be larger than before and even larger than previous total truesize value if skbs in frag_list are abundant. The main skb truesize will become smaller and even a minus value or a huge value for an unsigned int parameter. Then the following memory check will drop this abnormal skb. To avoid this error we should use the original truesize to segment the main skb. Fixes: 53475c5dd856 ("net: fix use-after-free when UDP GRO with shared fraglist") Signed-off-by: lena wang Acked-by: Paolo Abeni Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/1646133431-8948-1-git-send-email-lena.wang@mediatek.com Signed-off-by: Jakub Kicinski commit ea97ab9889b0125d2256e5131d854c370aab8212 Merge: 95749c1033798 6c1f41afc1dbe Author: Jakub Kicinski Date: Wed Mar 2 21:53:34 2022 -0800 Merge tag 'batadv-net-pullrequest-20220302' of git://git.open-mesh.org/linux-merge Simon Wunderlich says: ==================== Here are some batman-adv bugfixes: - Remove redundant iflink requests, by Sven Eckelmann (2 patches) - Don't expect inter-netns unique iflink indices, by Sven Eckelmann * tag 'batadv-net-pullrequest-20220302' of git://git.open-mesh.org/linux-merge: batman-adv: Don't expect inter-netns unique iflink indices batman-adv: Request iflink once in batadv_get_real_netdevice batman-adv: Request iflink once in batadv-on-batadv check ==================== Link: https://lore.kernel.org/r/20220302163049.101957-1-sw@simonwunderlich.de Signed-off-by: Jakub Kicinski commit 95749c103379814780b5e2e8cbb168b744047841 Merge: 90f8f4c0e3ceb e6e91ec966db5 Author: Jakub Kicinski Date: Wed Mar 2 21:49:57 2022 -0800 Merge tag 'wireless-for-net-2022-03-02' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless Johannes Berg says: ==================== Three more fixes: - fix build issue in iwlwifi, now that I understood what's going on there - propagate error in iwlwifi/mvm to userspace so it can figure out what's happening - fix channel switch related updates in P2P-client in cfg80211 * tag 'wireless-for-net-2022-03-02' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless: iwlwifi: mvm: return value for request_ownership nl80211: Update bss channel on channel switch for P2P_CLIENT iwlwifi: fix build error for IWLMEI ==================== Link: https://lore.kernel.org/r/20220302214444.100180-1-johannes@sipsolutions.net Signed-off-by: Jakub Kicinski commit 5859a2b1991101d6b978f3feb5325dad39421f29 Merge: 7e3d76139b5da 0ac983f512033 Author: Linus Torvalds Date: Wed Mar 2 16:20:04 2022 -0800 Merge branch 'ucount-rlimit-fixes-for-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace Pull ucounts fix from Eric Biederman: "Etienne Dechamps recently found a regression caused by enforcing RLIMIT_NPROC for root where the rlimit was not previously enforced. Michal Koutný had previously pointed out the inconsistency in enforcing the RLIMIT_NPROC that had been on the root owned process after the root user creates a user namespace. Which makes the fix for the regression simply removing the inconsistency" * 'ucount-rlimit-fixes-for-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: ucounts: Fix systemd LimitNPROC with private users regression commit 7e3d76139b5da7f58bda13c485e8e208ffce5c9c Merge: 92ebf5f91b4dd 7b83299e5b938 Author: Linus Torvalds Date: Wed Mar 2 16:11:56 2022 -0800 Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm Pull ARM fixes from Russell King: - Fix kgdb breakpoint for Thumb2 - Fix dependency for BITREVERSE kconfig - Fix nommu early_params and __setup returns * tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm: ARM: 9182/1: mmu: fix returns from early_param() and __setup() functions ARM: 9178/1: fix unmet dependency on BITREVERSE for HAVE_ARCH_BITREVERSE ARM: Fix kgdb breakpoint for Thumb2 commit f1ef17011c765495c876fa75435e59eecfdc1ee4 Author: Qiang Yu Date: Tue Mar 1 14:11:59 2022 +0800 drm/amdgpu: fix suspend/resume hang regression Regression has been reported that suspend/resume may hang with the previous vm ready check commit. So bring back the evicted list check as a temp fix. Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1922 Fixes: c1a66c3bc425 ("drm/amdgpu: check vm ready by amdgpu_vm->evicting flag") Reviewed-by: Christian König Signed-off-by: Qiang Yu Signed-off-by: Alex Deucher commit 9ed331f8a0fb674f4f06edf05a1687bf755af27b Author: Andy Shevchenko Date: Wed Feb 23 17:47:18 2022 +0200 auxdisplay: lcd2s: Use proper API to free the instance of charlcd object While it might work, the current approach is fragile in a few ways: - whenever members in the structure are shuffled, the pointer will be wrong - the resource freeing may include more than covered by kfree() Fix this by using charlcd_free() call instead of kfree(). Fixes: 8c9108d014c5 ("auxdisplay: add a driver for lcd2s character display") Cc: Lars Poeschel Signed-off-by: Andy Shevchenko Signed-off-by: Miguel Ojeda commit 898c0a15425a5bcaa8d44bd436eae5afd2483796 Author: Andy Shevchenko Date: Wed Feb 23 17:47:17 2022 +0200 auxdisplay: lcd2s: Fix memory leak in ->remove() Once allocated the struct lcd2s_data is never freed. Fix the memory leak by switching to devm_kzalloc(). Fixes: 8c9108d014c5 ("auxdisplay: add a driver for lcd2s character display") Cc: Lars Poeschel Signed-off-by: Andy Shevchenko Signed-off-by: Miguel Ojeda commit 4424c35ead667ba2e8de7ab8206da66453e6f728 Author: Andy Shevchenko Date: Wed Feb 23 17:47:16 2022 +0200 auxdisplay: lcd2s: Fix lcd2s_redefine_char() feature It seems that the lcd2s_redefine_char() has never been properly tested. The buffer is filled by DEF_CUSTOM_CHAR command followed by the character number (from 0 to 7), but immediately after that these bytes are rewritten by the decoded hex stream. Fix the index to fill the buffer after the command and number. Fixes: 8c9108d014c5 ("auxdisplay: add a driver for lcd2s character display") Cc: Lars Poeschel Signed-off-by: Andy Shevchenko Reviewed-by: Geert Uytterhoeven [fixed typo in commit message] Signed-off-by: Miguel Ojeda commit e6e91ec966db5af4f059cfbac1af06560404b317 Author: Emmanuel Grumbach Date: Wed Mar 2 09:27:15 2022 +0200 iwlwifi: mvm: return value for request_ownership Propagate the value to the user space so it can understand if the operation failed or not. Fixes: bfcfdb59b669 ("iwlwifi: mvm: add vendor commands needed for iwlmei") Signed-off-by: Emmanuel Grumbach Link: https://lore.kernel.org/r/20220302072715.4885-1-emmanuel.grumbach@intel.com Signed-off-by: Johannes Berg commit e50b88c4f076242358b66ddb67482b96947438f2 Author: Sreeramya Soratkal Date: Tue Mar 1 11:33:20 2022 +0530 nl80211: Update bss channel on channel switch for P2P_CLIENT The wdev channel information is updated post channel switch only for the station mode and not for the other modes. Due to this, the P2P client still points to the old value though it moved to the new channel when the channel change is induced from the P2P GO. Update the bss channel after CSA channel switch completion for P2P client interface as well. Signed-off-by: Sreeramya Soratkal Link: https://lore.kernel.org/r/1646114600-31479-1-git-send-email-quic_ssramya@quicinc.com Signed-off-by: Johannes Berg commit 875ad06015329314c594d3302ac2bbea37774543 Author: Randy Dunlap Date: Sun Feb 27 12:00:51 2022 -0800 iwlwifi: fix build error for IWLMEI When CONFIG_IWLWIFI=m and CONFIG_IWLMEI=y, the kernel build system must be told to build the iwlwifi/ subdirectory for both IWLWIFI and IWLMEI so that builds for both =y and =m are done. This resolves an undefined reference build error: ERROR: modpost: "iwl_mei_is_connected" [drivers/net/wireless/intel/iwlwifi/iwlwifi.ko] undefined! Fixes: 977df8bd5844 ("wlwifi: work around reverse dependency on MEI") Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Arnd Bergmann Cc: Luca Coelho Cc: linux-wireless@vger.kernel.org Link: https://lore.kernel.org/r/20220227200051.7176-1-rdunlap@infradead.org Signed-off-by: Johannes Berg commit 92ebf5f91b4dd5156886d2509202be0fb4230dfd Merge: ae5f531d1766a 22ba5e99b96f1 Author: Linus Torvalds Date: Wed Mar 2 12:08:36 2022 -0800 Merge tag 'erofs-for-5.17-rc7-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs Pull erofs fix from Gao Xiang: "A one-line patch to fix the new ztailpacking feature on > 4GiB filesystems because z_idataoff can get trimmed improperly. ztailpacking is still a brand new EXPERIMENTAL feature, but it'd be better to fix the issue as soon as possible to avoid unnecessary backporting. Summary: - Fix ztailpacking z_idataoff getting trimmed on > 4GiB filesystems" * tag 'erofs-for-5.17-rc7-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs: erofs: fix ztailpacking on > 4GiB filesystems commit ae5f531d1766a2cc98857707671223ff1284236d Merge: fb184c4af9b9f 9b818634f8e7e Author: Linus Torvalds Date: Wed Mar 2 11:58:27 2022 -0800 Merge tag 'ntb-5.17-bugfixes' of git://github.com/jonmason/ntb Pull NTB fixes from Jon Mason: "Bug fixes for sparse warning, intel port config offset, and a new mailing list" * tag 'ntb-5.17-bugfixes' of git://github.com/jonmason/ntb: MAINTAINERS: update mailing list address for NTB subsystem ntb: intel: fix port config status offset for SPR NTB/msi: Use struct_size() helper in devm_kzalloc() commit 90f8f4c0e3cebd541deaa45cf0e470bb9810dd4f Author: Jonathan Lemon Date: Mon Feb 28 12:39:57 2022 -0800 ptp: ocp: Add ptp_ocp_adjtime_coarse for large adjustments In ("ptp: ocp: Have FPGA fold in ns adjustment for adjtime."), the ns adjustment was written to the FPGA register, so the clock could accurately perform adjustments. However, the adjtime() call passes in a s64, while the clock adjustment registers use a s32. When trying to perform adjustments with a large value (37 sec), things fail. Examine the incoming delta, and if larger than 1 sec, use the original (coarse) adjustment method. If smaller than 1 sec, then allow the FPGA to fold in the changes over a 1 second window. Fixes: 6d59d4fa1789 ("ptp: ocp: Have FPGA fold in ns adjustment for adjtime.") Signed-off-by: Jonathan Lemon Acked-by: Richard Cochran Link: https://lore.kernel.org/r/20220228203957.367371-1-jonathan.lemon@gmail.com Signed-off-by: Jakub Kicinski commit 8d25b7beca7ed6ca34f53f0f8abd009e2be15d94 Author: Paolo Bonzini Date: Sat Feb 19 04:28:20 2022 -0500 KVM: x86: pull kvm->srcu read-side to kvm_arch_vcpu_ioctl_run kvm_arch_vcpu_ioctl_run is already doing srcu_read_lock/unlock in two places, namely vcpu_run and post_kvm_run_save, and a third is actually needed around the call to vcpu->arch.complete_userspace_io to avoid the following splat: WARNING: suspicious RCU usage arch/x86/kvm/pmu.c:190 suspicious rcu_dereference_check() usage! other info that might help us debug this: rcu_scheduler_active = 2, debug_locks = 1 1 lock held by CPU 28/KVM/370841: #0: ff11004089f280b8 (&vcpu->mutex){+.+.}-{3:3}, at: kvm_vcpu_ioctl+0x87/0x730 [kvm] Call Trace: dump_stack_lvl+0x59/0x73 reprogram_fixed_counter+0x15d/0x1a0 [kvm] kvm_pmu_trigger_event+0x1a3/0x260 [kvm] ? free_moved_vector+0x1b4/0x1e0 complete_fast_pio_in+0x8a/0xd0 [kvm] This splat is not at all unexpected, since complete_userspace_io callbacks can execute similar code to vmexits. For example, SVM with nrips=false will call into the emulator from svm_skip_emulated_instruction(). While it's tempting to never acquire kvm->srcu for an uninitialized vCPU, practically speaking there's no penalty to acquiring kvm->srcu "early" as the KVM_MP_STATE_UNINITIALIZED path is a one-time thing per vCPU. On the other hand, seemingly innocuous helpers like kvm_apic_accept_events() and sync_regs() can theoretically reach code that might access SRCU-protected data structures, e.g. sync_regs() can trigger forced existing of nested mode via kvm_vcpu_ioctl_x86_set_vcpu_events(). Reported-by: Like Xu Co-developed-by: Sean Christopherson Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit c6c937d673aaa1d603f62f134e1ca9c173eeeed3 Author: Like Xu Date: Tue Mar 1 20:49:41 2022 +0800 KVM: x86/mmu: Passing up the error state of mmu_alloc_shadow_roots() Just like on the optional mmu_alloc_direct_roots() path, once shadow path reaches "r = -EIO" somewhere, the caller needs to know the actual state in order to enter error handling and avoid something worse. Fixes: 4a38162ee9f1 ("KVM: MMU: load PDPTRs outside mmu_lock") Signed-off-by: Like Xu Reviewed-by: Sean Christopherson Message-Id: <20220301124941.48412-1-likexu@tencent.com> Signed-off-by: Paolo Bonzini commit 4751dc99627e4d1465c5bfa8cb7ab31ed418eff5 Author: Filipe Manana Date: Mon Feb 28 16:29:28 2022 +0000 btrfs: add missing run of delayed items after unlink during log replay During log replay, whenever we need to check if a name (dentry) exists in a directory we do searches on the subvolume tree for inode references or or directory entries (BTRFS_DIR_INDEX_KEY keys, and BTRFS_DIR_ITEM_KEY keys as well, before kernel 5.17). However when during log replay we unlink a name, through btrfs_unlink_inode(), we may not delete inode references and dir index keys from a subvolume tree and instead just add the deletions to the delayed inode's delayed items, which will only be run when we commit the transaction used for log replay. This means that after an unlink operation during log replay, if we attempt to search for the same name during log replay, we will not see that the name was already deleted, since the deletion is recorded only on the delayed items. We run delayed items after every unlink operation during log replay, except at unlink_old_inode_refs() and at add_inode_ref(). This was due to an overlook, as delayed items should be run after evert unlink, for the reasons stated above. So fix those two cases. Fixes: 0d836392cadd5 ("Btrfs: fix mount failure after fsync due to hard link recreation") Fixes: 1f250e929a9c9 ("Btrfs: fix log replay failure after unlink and link combination") CC: stable@vger.kernel.org # 4.19+ Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit d4aef1e122d8bbdc15ce3bd0bc813d6b44a7d63a Author: Sidong Yang Date: Mon Feb 28 01:43:40 2022 +0000 btrfs: qgroup: fix deadlock between rescan worker and remove qgroup The commit e804861bd4e6 ("btrfs: fix deadlock between quota disable and qgroup rescan worker") by Kawasaki resolves deadlock between quota disable and qgroup rescan worker. But also there is a deadlock case like it. It's about enabling or disabling quota and creating or removing qgroup. It can be reproduced in simple script below. for i in {1..100} do btrfs quota enable /mnt & btrfs qgroup create 1/0 /mnt & btrfs qgroup destroy 1/0 /mnt & btrfs quota disable /mnt & done Here's why the deadlock happens: 1) The quota rescan task is running. 2) Task A calls btrfs_quota_disable(), locks the qgroup_ioctl_lock mutex, and then calls btrfs_qgroup_wait_for_completion(), to wait for the quota rescan task to complete. 3) Task B calls btrfs_remove_qgroup() and it blocks when trying to lock the qgroup_ioctl_lock mutex, because it's being held by task A. At that point task B is holding a transaction handle for the current transaction. 4) The quota rescan task calls btrfs_commit_transaction(). This results in it waiting for all other tasks to release their handles on the transaction, but task B is blocked on the qgroup_ioctl_lock mutex while holding a handle on the transaction, and that mutex is being held by task A, which is waiting for the quota rescan task to complete, resulting in a deadlock between these 3 tasks. To resolve this issue, the thread disabling quota should unlock qgroup_ioctl_lock before waiting rescan completion. Move btrfs_qgroup_wait_for_completion() after unlock of qgroup_ioctl_lock. Fixes: e804861bd4e6 ("btrfs: fix deadlock between quota disable and qgroup rescan worker") CC: stable@vger.kernel.org # 5.4+ Reviewed-by: Filipe Manana Reviewed-by: Shin'ichiro Kawasaki Signed-off-by: Sidong Yang Reviewed-by: David Sterba Signed-off-by: David Sterba commit 5fd76bf31ccfecc06e2e6b29f8c809e934085b99 Author: Omar Sandoval Date: Thu Feb 17 15:14:43 2022 -0800 btrfs: fix relocation crash due to premature return from btrfs_commit_transaction() We are seeing crashes similar to the following trace: [38.969182] WARNING: CPU: 20 PID: 2105 at fs/btrfs/relocation.c:4070 btrfs_relocate_block_group+0x2dc/0x340 [btrfs] [38.973556] CPU: 20 PID: 2105 Comm: btrfs Not tainted 5.17.0-rc4 #54 [38.974580] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/01/2014 [38.976539] RIP: 0010:btrfs_relocate_block_group+0x2dc/0x340 [btrfs] [38.980336] RSP: 0000:ffffb0dd42e03c20 EFLAGS: 00010206 [38.981218] RAX: ffff96cfc4ede800 RBX: ffff96cfc3ce0000 RCX: 000000000002ca14 [38.982560] RDX: 0000000000000000 RSI: 4cfd109a0bcb5d7f RDI: ffff96cfc3ce0360 [38.983619] RBP: ffff96cfc309c000 R08: 0000000000000000 R09: 0000000000000000 [38.984678] R10: ffff96cec0000001 R11: ffffe84c80000000 R12: ffff96cfc4ede800 [38.985735] R13: 0000000000000000 R14: 0000000000000000 R15: ffff96cfc3ce0360 [38.987146] FS: 00007f11c15218c0(0000) GS:ffff96d6dfb00000(0000) knlGS:0000000000000000 [38.988662] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [38.989398] CR2: 00007ffc922c8e60 CR3: 00000001147a6001 CR4: 0000000000370ee0 [38.990279] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [38.991219] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [38.992528] Call Trace: [38.992854] [38.993148] btrfs_relocate_chunk+0x27/0xe0 [btrfs] [38.993941] btrfs_balance+0x78e/0xea0 [btrfs] [38.994801] ? vsnprintf+0x33c/0x520 [38.995368] ? __kmalloc_track_caller+0x351/0x440 [38.996198] btrfs_ioctl_balance+0x2b9/0x3a0 [btrfs] [38.997084] btrfs_ioctl+0x11b0/0x2da0 [btrfs] [38.997867] ? mod_objcg_state+0xee/0x340 [38.998552] ? seq_release+0x24/0x30 [38.999184] ? proc_nr_files+0x30/0x30 [38.999654] ? call_rcu+0xc8/0x2f0 [39.000228] ? __x64_sys_ioctl+0x84/0xc0 [39.000872] ? btrfs_ioctl_get_supported_features+0x30/0x30 [btrfs] [39.001973] __x64_sys_ioctl+0x84/0xc0 [39.002566] do_syscall_64+0x3a/0x80 [39.003011] entry_SYSCALL_64_after_hwframe+0x44/0xae [39.003735] RIP: 0033:0x7f11c166959b [39.007324] RSP: 002b:00007fff2543e998 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 [39.008521] RAX: ffffffffffffffda RBX: 00007f11c1521698 RCX: 00007f11c166959b [39.009833] RDX: 00007fff2543ea40 RSI: 00000000c4009420 RDI: 0000000000000003 [39.011270] RBP: 0000000000000003 R08: 0000000000000013 R09: 00007f11c16f94e0 [39.012581] R10: 0000000000000000 R11: 0000000000000246 R12: 00007fff25440df3 [39.014046] R13: 0000000000000000 R14: 00007fff2543ea40 R15: 0000000000000001 [39.015040] [39.015418] ---[ end trace 0000000000000000 ]--- [43.131559] ------------[ cut here ]------------ [43.132234] kernel BUG at fs/btrfs/extent-tree.c:2717! [43.133031] invalid opcode: 0000 [#1] PREEMPT SMP PTI [43.133702] CPU: 1 PID: 1839 Comm: btrfs Tainted: G W 5.17.0-rc4 #54 [43.134863] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org 04/01/2014 [43.136426] RIP: 0010:unpin_extent_range+0x37a/0x4f0 [btrfs] [43.139913] RSP: 0000:ffffb0dd4216bc70 EFLAGS: 00010246 [43.140629] RAX: 0000000000000000 RBX: ffff96cfc34490f8 RCX: 0000000000000001 [43.141604] RDX: 0000000080000001 RSI: 0000000051d00000 RDI: 00000000ffffffff [43.142645] RBP: 0000000000000000 R08: 0000000000000000 R09: ffff96cfd07dca50 [43.143669] R10: ffff96cfc46e8a00 R11: fffffffffffec000 R12: 0000000041d00000 [43.144657] R13: ffff96cfc3ce0000 R14: ffffb0dd4216bd08 R15: 0000000000000000 [43.145686] FS: 00007f7657dd68c0(0000) GS:ffff96d6df640000(0000) knlGS:0000000000000000 [43.146808] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [43.147584] CR2: 00007f7fe81bf5b0 CR3: 00000001093ee004 CR4: 0000000000370ee0 [43.148589] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [43.149581] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [43.150559] Call Trace: [43.150904] [43.151253] btrfs_finish_extent_commit+0x88/0x290 [btrfs] [43.152127] btrfs_commit_transaction+0x74f/0xaa0 [btrfs] [43.152932] ? btrfs_attach_transaction_barrier+0x1e/0x50 [btrfs] [43.153786] btrfs_ioctl+0x1edc/0x2da0 [btrfs] [43.154475] ? __check_object_size+0x150/0x170 [43.155170] ? preempt_count_add+0x49/0xa0 [43.155753] ? __x64_sys_ioctl+0x84/0xc0 [43.156437] ? btrfs_ioctl_get_supported_features+0x30/0x30 [btrfs] [43.157456] __x64_sys_ioctl+0x84/0xc0 [43.157980] do_syscall_64+0x3a/0x80 [43.158543] entry_SYSCALL_64_after_hwframe+0x44/0xae [43.159231] RIP: 0033:0x7f7657f1e59b [43.161819] RSP: 002b:00007ffda5cd1658 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 [43.162702] RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007f7657f1e59b [43.163526] RDX: 0000000000000000 RSI: 0000000000009408 RDI: 0000000000000003 [43.164358] RBP: 0000000000000003 R08: 0000000000000000 R09: 0000000000000000 [43.165208] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 [43.166029] R13: 00005621b91c3232 R14: 00005621b91ba580 R15: 00007ffda5cd1800 [43.166863] [43.167125] Modules linked in: btrfs blake2b_generic xor pata_acpi ata_piix libata raid6_pq scsi_mod libcrc32c virtio_net virtio_rng net_failover rng_core failover scsi_common [43.169552] ---[ end trace 0000000000000000 ]--- [43.171226] RIP: 0010:unpin_extent_range+0x37a/0x4f0 [btrfs] [43.174767] RSP: 0000:ffffb0dd4216bc70 EFLAGS: 00010246 [43.175600] RAX: 0000000000000000 RBX: ffff96cfc34490f8 RCX: 0000000000000001 [43.176468] RDX: 0000000080000001 RSI: 0000000051d00000 RDI: 00000000ffffffff [43.177357] RBP: 0000000000000000 R08: 0000000000000000 R09: ffff96cfd07dca50 [43.178271] R10: ffff96cfc46e8a00 R11: fffffffffffec000 R12: 0000000041d00000 [43.179178] R13: ffff96cfc3ce0000 R14: ffffb0dd4216bd08 R15: 0000000000000000 [43.180071] FS: 00007f7657dd68c0(0000) GS:ffff96d6df800000(0000) knlGS:0000000000000000 [43.181073] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [43.181808] CR2: 00007fe09905f010 CR3: 00000001093ee004 CR4: 0000000000370ee0 [43.182706] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [43.183591] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 We first hit the WARN_ON(rc->block_group->pinned > 0) in btrfs_relocate_block_group() and then the BUG_ON(!cache) in unpin_extent_range(). This tells us that we are exiting relocation and removing the block group with bytes still pinned for that block group. This is supposed to be impossible: the last thing relocate_block_group() does is commit the transaction to get rid of pinned extents. Commit d0c2f4fa555e ("btrfs: make concurrent fsyncs wait less when waiting for a transaction commit") introduced an optimization so that commits from fsync don't have to wait for the previous commit to unpin extents. This was only intended to affect fsync, but it inadvertently made it possible for any commit to skip waiting for the previous commit to unpin. This is because if a call to btrfs_commit_transaction() finds that another thread is already committing the transaction, it waits for the other thread to complete the commit and then returns. If that other thread was in fsync, then it completes the commit without completing the previous commit. This makes the following sequence of events possible: Thread 1____________________|Thread 2 (fsync)_____________________|Thread 3 (balance)___________________ btrfs_commit_transaction(N) | | btrfs_run_delayed_refs | | pin extents | | ... | | state = UNBLOCKED |btrfs_sync_file | | btrfs_start_transaction(N + 1) |relocate_block_group | | btrfs_join_transaction(N + 1) | btrfs_commit_transaction(N + 1) | ... | trans->state = COMMIT_START | | | btrfs_commit_transaction(N + 1) | | wait_for_commit(N + 1, COMPLETED) | wait_for_commit(N, SUPER_COMMITTED)| state = SUPER_COMMITTED | ... | btrfs_finish_extent_commit| | unpin_extent_range() | trans->state = COMPLETED | | | return | | ... | |Thread 1 isn't done, so pinned > 0 | |and we WARN | | | |btrfs_remove_block_group unpin_extent_range() | | Thread 3 removed the | | block group, so we BUG| | There are other sequences involving SUPER_COMMITTED transactions that can cause a similar outcome. We could fix this by making relocation explicitly wait for unpinning, but there may be other cases that need it. Josef mentioned ENOSPC flushing and the free space cache inode as other potential victims. Rather than playing whack-a-mole, this fix is conservative and makes all commits not in fsync wait for all previous transactions, which is what the optimization intended. Fixes: d0c2f4fa555e ("btrfs: make concurrent fsyncs wait less when waiting for a transaction commit") CC: stable@vger.kernel.org # 5.15+ Reviewed-by: Filipe Manana Signed-off-by: Omar Sandoval Signed-off-by: David Sterba commit b4be6aefa73c9a6899ef3ba9c5faaa8a66e333ef Author: Josef Bacik Date: Fri Feb 18 14:56:10 2022 -0500 btrfs: do not start relocation until in progress drops are done We hit a bug with a recovering relocation on mount for one of our file systems in production. I reproduced this locally by injecting errors into snapshot delete with balance running at the same time. This presented as an error while looking up an extent item WARNING: CPU: 5 PID: 1501 at fs/btrfs/extent-tree.c:866 lookup_inline_extent_backref+0x647/0x680 CPU: 5 PID: 1501 Comm: btrfs-balance Not tainted 5.16.0-rc8+ #8 RIP: 0010:lookup_inline_extent_backref+0x647/0x680 RSP: 0018:ffffae0a023ab960 EFLAGS: 00010202 RAX: 0000000000000001 RBX: 0000000000000000 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 000000000000000c RDI: 0000000000000000 RBP: ffff943fd2a39b60 R08: 0000000000000000 R09: 0000000000000001 R10: 0001434088152de0 R11: 0000000000000000 R12: 0000000001d05000 R13: ffff943fd2a39b60 R14: ffff943fdb96f2a0 R15: ffff9442fc923000 FS: 0000000000000000(0000) GS:ffff944e9eb40000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f1157b1fca8 CR3: 000000010f092000 CR4: 0000000000350ee0 Call Trace: insert_inline_extent_backref+0x46/0xd0 __btrfs_inc_extent_ref.isra.0+0x5f/0x200 ? btrfs_merge_delayed_refs+0x164/0x190 __btrfs_run_delayed_refs+0x561/0xfa0 ? btrfs_search_slot+0x7b4/0xb30 ? btrfs_update_root+0x1a9/0x2c0 btrfs_run_delayed_refs+0x73/0x1f0 ? btrfs_update_root+0x1a9/0x2c0 btrfs_commit_transaction+0x50/0xa50 ? btrfs_update_reloc_root+0x122/0x220 prepare_to_merge+0x29f/0x320 relocate_block_group+0x2b8/0x550 btrfs_relocate_block_group+0x1a6/0x350 btrfs_relocate_chunk+0x27/0xe0 btrfs_balance+0x777/0xe60 balance_kthread+0x35/0x50 ? btrfs_balance+0xe60/0xe60 kthread+0x16b/0x190 ? set_kthread_struct+0x40/0x40 ret_from_fork+0x22/0x30 Normally snapshot deletion and relocation are excluded from running at the same time by the fs_info->cleaner_mutex. However if we had a pending balance waiting to get the ->cleaner_mutex, and a snapshot deletion was running, and then the box crashed, we would come up in a state where we have a half deleted snapshot. Again, in the normal case the snapshot deletion needs to complete before relocation can start, but in this case relocation could very well start before the snapshot deletion completes, as we simply add the root to the dead roots list and wait for the next time the cleaner runs to clean up the snapshot. Fix this by setting a bit on the fs_info if we have any DEAD_ROOT's that had a pending drop_progress key. If they do then we know we were in the middle of the drop operation and set a flag on the fs_info. Then balance can wait until this flag is cleared to start up again. If there are DEAD_ROOT's that don't have a drop_progress set then we're safe to start balance right away as we'll be properly protected by the cleaner_mutex. CC: stable@vger.kernel.org # 5.10+ Reviewed-by: Filipe Manana Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit a6ab66eb8541d61b0a11d70980f07b4c2dfeddc5 Author: Su Yue Date: Tue Feb 22 16:42:07 2022 +0800 btrfs: tree-checker: use u64 for item data end to avoid overflow User reported there is an array-index-out-of-bounds access while mounting the crafted image: [350.411942 ] loop0: detected capacity change from 0 to 262144 [350.427058 ] BTRFS: device fsid a62e00e8-e94e-4200-8217-12444de93c2e devid 1 transid 8 /dev/loop0 scanned by systemd-udevd (1044) [350.428564 ] BTRFS info (device loop0): disk space caching is enabled [350.428568 ] BTRFS info (device loop0): has skinny extents [350.429589 ] [350.429619 ] UBSAN: array-index-out-of-bounds in fs/btrfs/struct-funcs.c:161:1 [350.429636 ] index 1048096 is out of range for type 'page *[16]' [350.429650 ] CPU: 0 PID: 9 Comm: kworker/u8:1 Not tainted 5.16.0-rc4 [350.429652 ] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-1ubuntu1.1 04/01/2014 [350.429653 ] Workqueue: btrfs-endio-meta btrfs_work_helper [btrfs] [350.429772 ] Call Trace: [350.429774 ] [350.429776 ] dump_stack_lvl+0x47/0x5c [350.429780 ] ubsan_epilogue+0x5/0x50 [350.429786 ] __ubsan_handle_out_of_bounds+0x66/0x70 [350.429791 ] btrfs_get_16+0xfd/0x120 [btrfs] [350.429832 ] check_leaf+0x754/0x1a40 [btrfs] [350.429874 ] ? filemap_read+0x34a/0x390 [350.429878 ] ? load_balance+0x175/0xfc0 [350.429881 ] validate_extent_buffer+0x244/0x310 [btrfs] [350.429911 ] btrfs_validate_metadata_buffer+0xf8/0x100 [btrfs] [350.429935 ] end_bio_extent_readpage+0x3af/0x850 [btrfs] [350.429969 ] ? newidle_balance+0x259/0x480 [350.429972 ] end_workqueue_fn+0x29/0x40 [btrfs] [350.429995 ] btrfs_work_helper+0x71/0x330 [btrfs] [350.430030 ] ? __schedule+0x2fb/0xa40 [350.430033 ] process_one_work+0x1f6/0x400 [350.430035 ] ? process_one_work+0x400/0x400 [350.430036 ] worker_thread+0x2d/0x3d0 [350.430037 ] ? process_one_work+0x400/0x400 [350.430038 ] kthread+0x165/0x190 [350.430041 ] ? set_kthread_struct+0x40/0x40 [350.430043 ] ret_from_fork+0x1f/0x30 [350.430047 ] [350.430047 ] [350.430077 ] BTRFS warning (device loop0): bad eb member start: ptr 0xffe20f4e start 20975616 member offset 4293005178 size 2 btrfs check reports: corrupt leaf: root=3 block=20975616 physical=20975616 slot=1, unexpected item end, have 4294971193 expect 3897 The first slot item offset is 4293005033 and the size is 1966160. In check_leaf, we use btrfs_item_end() to check item boundary versus extent_buffer data size. However, return type of btrfs_item_end() is u32. (u32)(4293005033 + 1966160) == 3897, overflow happens and the result 3897 equals to leaf data size reasonably. Fix it by use u64 variable to store item data end in check_leaf() to avoid u32 overflow. This commit does solve the invalid memory access showed by the stack trace. However, its metadata profile is DUP and another copy of the leaf is fine. So the image can be mounted successfully. But when umount is called, the ASSERT btrfs_mark_buffer_dirty() will be triggered because the only node in extent tree has 0 item and invalid owner. It's solved by another commit "btrfs: check extent buffer owner against the owner rootid". Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=215299 Reported-by: Wenqing Liu CC: stable@vger.kernel.org # 4.19+ Signed-off-by: Su Yue Reviewed-by: David Sterba Signed-off-by: David Sterba commit a50e1fcbc9b85fd4e95b89a75c0884cb032a3e06 Author: Josef Bacik Date: Fri Feb 18 10:17:39 2022 -0500 btrfs: do not WARN_ON() if we have PageError set Whenever we do any extent buffer operations we call assert_eb_page_uptodate() to complain loudly if we're operating on an non-uptodate page. Our overnight tests caught this warning earlier this week WARNING: CPU: 1 PID: 553508 at fs/btrfs/extent_io.c:6849 assert_eb_page_uptodate+0x3f/0x50 CPU: 1 PID: 553508 Comm: kworker/u4:13 Tainted: G W 5.17.0-rc3+ #564 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-2.fc32 04/01/2014 Workqueue: btrfs-cache btrfs_work_helper RIP: 0010:assert_eb_page_uptodate+0x3f/0x50 RSP: 0018:ffffa961440a7c68 EFLAGS: 00010246 RAX: 0017ffffc0002112 RBX: ffffe6e74453f9c0 RCX: 0000000000001000 RDX: ffffe6e74467c887 RSI: ffffe6e74453f9c0 RDI: ffff8d4c5efc2fc0 RBP: 0000000000000d56 R08: ffff8d4d4a224000 R09: 0000000000000000 R10: 00015817fa9d1ef0 R11: 000000000000000c R12: 00000000000007b1 R13: ffff8d4c5efc2fc0 R14: 0000000001500000 R15: 0000000001cb1000 FS: 0000000000000000(0000) GS:ffff8d4dbbd00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ff31d3448d8 CR3: 0000000118be8004 CR4: 0000000000370ee0 Call Trace: extent_buffer_test_bit+0x3f/0x70 free_space_test_bit+0xa6/0xc0 load_free_space_tree+0x1f6/0x470 caching_thread+0x454/0x630 ? rcu_read_lock_sched_held+0x12/0x60 ? rcu_read_lock_sched_held+0x12/0x60 ? rcu_read_lock_sched_held+0x12/0x60 ? lock_release+0x1f0/0x2d0 btrfs_work_helper+0xf2/0x3e0 ? lock_release+0x1f0/0x2d0 ? finish_task_switch.isra.0+0xf9/0x3a0 process_one_work+0x26d/0x580 ? process_one_work+0x580/0x580 worker_thread+0x55/0x3b0 ? process_one_work+0x580/0x580 kthread+0xf0/0x120 ? kthread_complete_and_exit+0x20/0x20 ret_from_fork+0x1f/0x30 This was partially fixed by c2e39305299f01 ("btrfs: clear extent buffer uptodate when we fail to write it"), however all that fix did was keep us from finding extent buffers after a failed writeout. It didn't keep us from continuing to use a buffer that we already had found. In this case we're searching the commit root to cache the block group, so we can start committing the transaction and switch the commit root and then start writing. After the switch we can look up an extent buffer that hasn't been written yet and start processing that block group. Then we fail to write that block out and clear Uptodate on the page, and then we start spewing these errors. Normally we're protected by the tree lock to a certain degree here. If we read a block we have that block read locked, and we block the writer from locking the block before we submit it for the write. However this isn't necessarily fool proof because the read could happen before we do the submit_bio and after we locked and unlocked the extent buffer. Also in this particular case we have path->skip_locking set, so that won't save us here. We'll simply get a block that was valid when we read it, but became invalid while we were using it. What we really want is to catch the case where we've "read" a block but it's not marked Uptodate. On read we ClearPageError(), so if we're !Uptodate and !Error we know we didn't do the right thing for reading the page. Fix this by checking !Uptodate && !Error, this way we will not complain if our buffer gets invalidated while we're using it, and we'll maintain the spirit of the check which is to make sure we have a fully in-cache block while we're messing with it. CC: stable@vger.kernel.org # 5.4+ Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit d99478874355d3a7b9d86dfb5d7590d5b1754b1f Author: Filipe Manana Date: Thu Feb 17 12:12:02 2022 +0000 btrfs: fix lost prealloc extents beyond eof after full fsync When doing a full fsync, if we have prealloc extents beyond (or at) eof, and the leaves that contain them were not modified in the current transaction, we end up not logging them. This results in losing those extents when we replay the log after a power failure, since the inode is truncated to the current value of the logged i_size. Just like for the fast fsync path, we need to always log all prealloc extents starting at or beyond i_size. The fast fsync case was fixed in commit 471d557afed155 ("Btrfs: fix loss of prealloc extents past i_size after fsync log replay") but it missed the full fsync path. The problem exists since the very early days, when the log tree was added by commit e02119d5a7b439 ("Btrfs: Add a write ahead tree log to optimize synchronous operations"). Example reproducer: $ mkfs.btrfs -f /dev/sdc $ mount /dev/sdc /mnt # Create our test file with many file extent items, so that they span # several leaves of metadata, even if the node/page size is 64K. Use # direct IO and not fsync/O_SYNC because it's both faster and it avoids # clearing the full sync flag from the inode - we want the fsync below # to trigger the slow full sync code path. $ xfs_io -f -d -c "pwrite -b 4K 0 16M" /mnt/foo # Now add two preallocated extents to our file without extending the # file's size. One right at i_size, and another further beyond, leaving # a gap between the two prealloc extents. $ xfs_io -c "falloc -k 16M 1M" /mnt/foo $ xfs_io -c "falloc -k 20M 1M" /mnt/foo # Make sure everything is durably persisted and the transaction is # committed. This makes all created extents to have a generation lower # than the generation of the transaction used by the next write and # fsync. sync # Now overwrite only the first extent, which will result in modifying # only the first leaf of metadata for our inode. Then fsync it. This # fsync will use the slow code path (inode full sync bit is set) because # it's the first fsync since the inode was created/loaded. $ xfs_io -c "pwrite 0 4K" -c "fsync" /mnt/foo # Extent list before power failure. $ xfs_io -c "fiemap -v" /mnt/foo /mnt/foo: EXT: FILE-OFFSET BLOCK-RANGE TOTAL FLAGS 0: [0..7]: 2178048..2178055 8 0x0 1: [8..16383]: 26632..43007 16376 0x0 2: [16384..32767]: 2156544..2172927 16384 0x0 3: [32768..34815]: 2172928..2174975 2048 0x800 4: [34816..40959]: hole 6144 5: [40960..43007]: 2174976..2177023 2048 0x801 # Mount fs again, trigger log replay. $ mount /dev/sdc /mnt # Extent list after power failure and log replay. $ xfs_io -c "fiemap -v" /mnt/foo /mnt/foo: EXT: FILE-OFFSET BLOCK-RANGE TOTAL FLAGS 0: [0..7]: 2178048..2178055 8 0x0 1: [8..16383]: 26632..43007 16376 0x0 2: [16384..32767]: 2156544..2172927 16384 0x1 # The prealloc extents at file offsets 16M and 20M are missing. So fix this by calling btrfs_log_prealloc_extents() when we are doing a full fsync, so that we always log all prealloc extents beyond eof. A test case for fstests will follow soon. CC: stable@vger.kernel.org # 4.19+ Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit c992fa1fd52380d0c4ced7b07479e877311ae645 Author: Qu Wenruo Date: Fri Feb 18 10:13:00 2022 +0800 btrfs: subpage: fix a wrong check on subpage->writers [BUG] When looping btrfs/074 with 64K page size and 4K sectorsize, there is a low chance (1/50~1/100) to crash with the following ASSERT() triggered in btrfs_subpage_start_writer(): ret = atomic_add_return(nbits, &subpage->writers); ASSERT(ret == nbits); <<< This one <<< [CAUSE] With more debugging output on the parameters of btrfs_subpage_start_writer(), it shows a very concerning error: ret=29 nbits=13 start=393216 len=53248 For @nbits it's correct, but @ret which is the returned value from atomic_add_return(), it's not only larger than nbits, but also larger than max sectors per page value (for 64K page size and 4K sector size, it's 16). This indicates that some call sites are not properly decreasing the value. And that's exactly the case, in btrfs_page_unlock_writer(), due to the fact that we can have page locked either by lock_page() or process_one_page(), we have to check if the subpage has any writer. If no writers, it's locked by lock_page() and we only need to unlock it. But unfortunately the check for the writers are completely opposite: if (atomic_read(&subpage->writers)) /* No writers, locked by plain lock_page() */ return unlock_page(page); We directly unlock the page if it has writers, which is the completely opposite what we want. Thankfully the affected call site is only limited to extent_write_locked_range(), so it's mostly affecting compressed write. [FIX] Just fix the wrong check condition to fix the bug. Fixes: e55a0de18572 ("btrfs: rework page locking in __extent_writepage()") CC: stable@vger.kernel.org # 5.16 Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 342e7c6ea58200e45bcaa9bdd8402a5531c4777e Author: Hans de Goede Date: Wed Mar 2 11:16:37 2022 +0100 staging: rtl8723bs: Improve the comment explaining the locking rules rtw_mlme.h has a comment which briefly describes the locking rules for the rtl8723bs driver, improve this to also mention the locking order of xmit_priv.lock vs the lock(s) embedded in the various queues. Cc: Fabio Aiuto Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220302101637.26542-2-hdegoede@redhat.com Signed-off-by: Greg Kroah-Hartman commit 8f4347081be32e67b0873827e0138ab0fdaaf450 Author: Hans de Goede Date: Wed Mar 2 11:16:36 2022 +0100 staging: rtl8723bs: Fix access-point mode deadlock Commit 54659ca026e5 ("staging: rtl8723bs: remove possible deadlock when disconnect (v2)") split the locking of pxmitpriv->lock vs sleep_q/lock into 2 locks in attempt to fix a lockdep reported issue with the locking order of the sta_hash_lock vs pxmitpriv->lock. But in the end this turned out to not fully solve the sta_hash_lock issue so commit a7ac783c338b ("staging: rtl8723bs: remove a second possible deadlock") was added to fix this in another way. The original fix was kept as it was still seen as a good thing to have, but now it turns out that it creates a deadlock in access-point mode: [Feb20 23:47] ====================================================== [ +0.074085] WARNING: possible circular locking dependency detected [ +0.074077] 5.16.0-1-amd64 #1 Tainted: G C E [ +0.064710] ------------------------------------------------------ [ +0.074075] ksoftirqd/3/29 is trying to acquire lock: [ +0.060542] ffffb8b30062ab00 (&pxmitpriv->lock){+.-.}-{2:2}, at: rtw_xmit_classifier+0x8a/0x140 [r8723bs] [ +0.114921] but task is already holding lock: [ +0.069908] ffffb8b3007ab704 (&psta->sleep_q.lock){+.-.}-{2:2}, at: wakeup_sta_to_xmit+0x3b/0x300 [r8723bs] [ +0.116976] which lock already depends on the new lock. [ +0.098037] the existing dependency chain (in reverse order) is: [ +0.089704] -> #1 (&psta->sleep_q.lock){+.-.}-{2:2}: [ +0.077232] _raw_spin_lock_bh+0x34/0x40 [ +0.053261] xmitframe_enqueue_for_sleeping_sta+0xc1/0x2f0 [r8723bs] [ +0.082572] rtw_xmit+0x58b/0x940 [r8723bs] [ +0.056528] _rtw_xmit_entry+0xba/0x350 [r8723bs] [ +0.062755] dev_hard_start_xmit+0xf1/0x320 [ +0.056381] sch_direct_xmit+0x9e/0x360 [ +0.052212] __dev_queue_xmit+0xce4/0x1080 [ +0.055334] ip6_finish_output2+0x18f/0x6e0 [ +0.056378] ndisc_send_skb+0x2c8/0x870 [ +0.052209] ndisc_send_ns+0xd3/0x210 [ +0.050130] addrconf_dad_work+0x3df/0x5a0 [ +0.055338] process_one_work+0x274/0x5a0 [ +0.054296] worker_thread+0x52/0x3b0 [ +0.050124] kthread+0x16c/0x1a0 [ +0.044925] ret_from_fork+0x1f/0x30 [ +0.049092] -> #0 (&pxmitpriv->lock){+.-.}-{2:2}: [ +0.074101] __lock_acquire+0x10f5/0x1d80 [ +0.054298] lock_acquire+0xd7/0x300 [ +0.049088] _raw_spin_lock_bh+0x34/0x40 [ +0.053248] rtw_xmit_classifier+0x8a/0x140 [r8723bs] [ +0.066949] rtw_xmitframe_enqueue+0xa/0x20 [r8723bs] [ +0.066946] rtl8723bs_hal_xmitframe_enqueue+0x14/0x50 [r8723bs] [ +0.078386] wakeup_sta_to_xmit+0xa6/0x300 [r8723bs] [ +0.065903] rtw_recv_entry+0xe36/0x1160 [r8723bs] [ +0.063809] rtl8723bs_recv_tasklet+0x349/0x6c0 [r8723bs] [ +0.071093] tasklet_action_common.constprop.0+0xe5/0x110 [ +0.070966] __do_softirq+0x16f/0x50a [ +0.050134] __irq_exit_rcu+0xeb/0x140 [ +0.051172] irq_exit_rcu+0xa/0x20 [ +0.047006] common_interrupt+0xb8/0xd0 [ +0.052214] asm_common_interrupt+0x1e/0x40 [ +0.056381] finish_task_switch.isra.0+0x100/0x3a0 [ +0.063670] __schedule+0x3ad/0xd20 [ +0.048047] schedule+0x4e/0xc0 [ +0.043880] smpboot_thread_fn+0xc4/0x220 [ +0.054298] kthread+0x16c/0x1a0 [ +0.044922] ret_from_fork+0x1f/0x30 [ +0.049088] other info that might help us debug this: [ +0.095950] Possible unsafe locking scenario: [ +0.070952] CPU0 CPU1 [ +0.054282] ---- ---- [ +0.054285] lock(&psta->sleep_q.lock); [ +0.047004] lock(&pxmitpriv->lock); [ +0.074082] lock(&psta->sleep_q.lock); [ +0.077209] lock(&pxmitpriv->lock); [ +0.043873] *** DEADLOCK *** [ +0.070950] 1 lock held by ksoftirqd/3/29: [ +0.049082] #0: ffffb8b3007ab704 (&psta->sleep_q.lock){+.-.}-{2:2}, at: wakeup_sta_to_xmit+0x3b/0x300 [r8723bs] Analysis shows that in hindsight the splitting of the lock was not a good idea, so revert this to fix the access-point mode deadlock. Note this is a straight-forward revert done with git revert, the commented out "/* spin_lock_bh(&psta_bmc->sleep_q.lock); */" lines were part of the code before the reverted changes. Fixes: 54659ca026e5 ("staging: rtl8723bs: remove possible deadlock when disconnect (v2)") Cc: stable Cc: Fabio Aiuto Signed-off-by: Hans de Goede BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=215542 Link: https://lore.kernel.org/r/20220302101637.26542-1-hdegoede@redhat.com Signed-off-by: Greg Kroah-Hartman commit 22ba5e99b96f1c0dbdfa4f4e1d9751b4c8348541 Author: Gao Xiang Date: Tue Feb 22 11:31:18 2022 +0800 erofs: fix ztailpacking on > 4GiB filesystems z_idataoff here is an absolute physical offset, so it should use erofs_off_t (64 bits at least). Otherwise, it'll get trimmed and cause the decompresion failure. Link: https://lore.kernel.org/r/20220222033118.20540-1-hsiangkao@linux.alibaba.com Fixes: ab92184ff8f1 ("erofs: add on-disk compressed tail-packing inline support") Reviewed-by: Yue Hu Reviewed-by: Chao Yu Signed-off-by: Gao Xiang commit 0aa6b294b312d9710804679abd2c0c8ca52cc2bc Author: Zhen Ni Date: Wed Mar 2 15:42:41 2022 +0800 ALSA: intel_hdmi: Fix reference to PCM buffer address PCM buffers might be allocated dynamically when the buffer preallocation failed or a larger buffer is requested, and it's not guaranteed that substream->dma_buffer points to the actually used buffer. The driver needs to refer to substream->runtime->dma_addr instead for the buffer address. Signed-off-by: Zhen Ni Cc: Link: https://lore.kernel.org/r/20220302074241.30469-1-nizhen@uniontech.com Signed-off-by: Takashi Iwai commit 6c1f41afc1dbe59d9d3c8bb0d80b749c119aa334 Author: Sven Eckelmann Date: Sun Feb 27 23:23:49 2022 +0100 batman-adv: Don't expect inter-netns unique iflink indices The ifindex doesn't have to be unique for multiple network namespaces on the same machine. $ ip netns add test1 $ ip -net test1 link add dummy1 type dummy $ ip netns add test2 $ ip -net test2 link add dummy2 type dummy $ ip -net test1 link show dev dummy1 6: dummy1: mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000 link/ether 96:81:55:1e:dd:85 brd ff:ff:ff:ff:ff:ff $ ip -net test2 link show dev dummy2 6: dummy2: mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000 link/ether 5a:3c:af:35:07:c3 brd ff:ff:ff:ff:ff:ff But the batman-adv code to walk through the various layers of virtual interfaces uses this assumption because dev_get_iflink handles it internally and doesn't return the actual netns of the iflink. And dev_get_iflink only documents the situation where ifindex == iflink for physical devices. But only checking for dev->netdev_ops->ndo_get_iflink is also not an option because ipoib_get_iflink implements it even when it sometimes returns an iflink != ifindex and sometimes iflink == ifindex. The caller must therefore make sure itself to check both netns and iflink + ifindex for equality. Only when they are equal, a "physical" interface was detected which should stop the traversal. On the other hand, vxcan_get_iflink can also return 0 in case there was currently no valid peer. In this case, it is still necessary to stop. Fixes: b7eddd0b3950 ("batman-adv: prevent using any virtual device created on batman-adv as hard-interface") Fixes: 5ed4a460a1d3 ("batman-adv: additional checks for virtual interfaces on top of WiFi") Reported-by: Sabrina Dubroca Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich commit 6116ba09423f7d140f0460be6a1644dceaad00da Author: Sven Eckelmann Date: Mon Feb 28 00:01:24 2022 +0100 batman-adv: Request iflink once in batadv_get_real_netdevice There is no need to call dev_get_iflink multiple times for the same net_device in batadv_get_real_netdevice. And since some of the ndo_get_iflink callbacks are dynamic (for example via RCUs like in vxcan_get_iflink), it could easily happen that the returned values are not stable. The pre-checks before __dev_get_by_index are then of course bogus. Fixes: 5ed4a460a1d3 ("batman-adv: additional checks for virtual interfaces on top of WiFi") Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich commit 690bb6fb64f5dc7437317153902573ecad67593d Author: Sven Eckelmann Date: Mon Feb 28 00:01:24 2022 +0100 batman-adv: Request iflink once in batadv-on-batadv check There is no need to call dev_get_iflink multiple times for the same net_device in batadv_is_on_batman_iface. And since some of the .ndo_get_iflink callbacks are dynamic (for example via RCUs like in vxcan_get_iflink), it could easily happen that the returned values are not stable. The pre-checks before __dev_get_by_index are then of course bogus. Fixes: b7eddd0b3950 ("batman-adv: prevent using any virtual device created on batman-adv as hard-interface") Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich commit 04b7762e37c95d9b965d16bb0e18dbd1fa2e2861 Author: Hans de Goede Date: Mon Feb 28 23:39:50 2022 -0800 Input: elan_i2c - fix regulator enable count imbalance after suspend/resume Before these changes elan_suspend() would only disable the regulator when device_may_wakeup() returns false; whereas elan_resume() would unconditionally enable it, leading to an enable count imbalance when device_may_wakeup() returns true. This triggers the "WARN_ON(regulator->enable_count)" in regulator_put() when the elan_i2c driver gets unbound, this happens e.g. with the hot-plugable dock with Elan I2C touchpad for the Asus TF103C 2-in-1. Fix this by making the regulator_enable() call also be conditional on device_may_wakeup() returning false. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220131135436.29638-2-hdegoede@redhat.com Signed-off-by: Dmitry Torokhov commit 81a36d8ce554b82b0a08e2b95d0bd44fcbff339b Author: Hans de Goede Date: Mon Feb 28 23:39:38 2022 -0800 Input: elan_i2c - move regulator_[en|dis]able() out of elan_[en|dis]able_power() elan_disable_power() is called conditionally on suspend, where as elan_enable_power() is always called on resume. This leads to an imbalance in the regulator's enable count. Move the regulator_[en|dis]able() calls out of elan_[en|dis]able_power() in preparation of fixing this. No functional changes intended. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220131135436.29638-1-hdegoede@redhat.com [dtor: consolidate elan_[en|dis]able() into elan_set_power()] Signed-off-by: Dmitry Torokhov commit 1d1898f65616c4601208963c3376c1d828cbf2c7 Author: Steven Rostedt (Google) Date: Tue Mar 1 22:29:04 2022 -0500 tracing/histogram: Fix sorting on old "cpu" value When trying to add a histogram against an event with the "cpu" field, it was impossible due to "cpu" being a keyword to key off of the running CPU. So to fix this, it was changed to "common_cpu" to match the other generic fields (like "common_pid"). But since some scripts used "cpu" for keying off of the CPU (for events that did not have "cpu" as a field, which is most of them), a backward compatibility trick was added such that if "cpu" was used as a key, and the event did not have "cpu" as a field name, then it would fallback and switch over to "common_cpu". This fix has a couple of subtle bugs. One was that when switching over to "common_cpu", it did not change the field name, it just set a flag. But the code still found a "cpu" field. The "cpu" field is used for filtering and is returned when the event does not have a "cpu" field. This was found by: # cd /sys/kernel/tracing # echo hist:key=cpu,pid:sort=cpu > events/sched/sched_wakeup/trigger # cat events/sched/sched_wakeup/hist Which showed the histogram unsorted: { cpu: 19, pid: 1175 } hitcount: 1 { cpu: 6, pid: 239 } hitcount: 2 { cpu: 23, pid: 1186 } hitcount: 14 { cpu: 12, pid: 249 } hitcount: 2 { cpu: 3, pid: 994 } hitcount: 5 Instead of hard coding the "cpu" checks, take advantage of the fact that trace_event_field_field() returns a special field for "cpu" and "CPU" if the event does not have "cpu" as a field. This special field has the "filter_type" of "FILTER_CPU". Check that to test if the returned field is of the CPU type instead of doing the string compare. Also, fix the sorting bug by testing for the hist_field flag of HIST_FIELD_FL_CPU when setting up the sort routine. Otherwise it will use the special CPU field to know what compare routine to use, and since that special field does not have a size, it returns tracing_map_cmp_none. Cc: stable@vger.kernel.org Fixes: 1e3bac71c505 ("tracing/histogram: Rename "cpu" to "common_cpu"") Reported-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) commit 0b0e2ff10356e7e2ffd66ecdd6eee69a2f03449b Author: Vladimir Oltean Date: Mon Feb 28 16:17:15 2022 +0200 net: dsa: restore error path of dsa_tree_change_tag_proto When the DSA_NOTIFIER_TAG_PROTO returns an error, the user space process which initiated the protocol change exits the kernel processing while still holding the rtnl_mutex. So any other process attempting to lock the rtnl_mutex would deadlock after such event. The error handling of DSA_NOTIFIER_TAG_PROTO was inadvertently changed by the blamed commit, introducing this regression. We must still call rtnl_unlock(), and we must still call DSA_NOTIFIER_TAG_PROTO for the old protocol. The latter is due to the limiting design of notifier chains for cross-chip operations, which don't have a built-in error recovery mechanism - we should look into using notifier_call_chain_robust for that. Fixes: dc452a471dba ("net: dsa: introduce tagger-owned storage for private and shared data") Signed-off-by: Vladimir Oltean Link: https://lore.kernel.org/r/20220228141715.146485-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 2e77551c61286bac56ebf337b1ac2dd419952c8d Merge: 4761df52f1549 275f3f6487024 Author: Jakub Kicinski Date: Tue Mar 1 17:16:46 2022 -0800 Merge tag 'for-net-2022-03-01' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth Luiz Augusto von Dentz says: ==================== bluetooth pull request for net: - Fix regression with scanning not working in some systems. * tag 'for-net-2022-03-01' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth: Bluetooth: Fix not checking MGMT cmd pending queue ==================== Link: https://lore.kernel.org/r/20220302004330.125536-1-luiz.dentz@gmail.com Signed-off-by: Jakub Kicinski commit 275f3f64870245b06188f24bdf917e55a813d294 Author: Brian Gix Date: Tue Mar 1 14:34:57 2022 -0800 Bluetooth: Fix not checking MGMT cmd pending queue A number of places in the MGMT handlers we examine the command queue for other commands (in progress but not yet complete) that will interact with the process being performed. However, not all commands go into the queue if one of: 1. There is no negative side effect of consecutive or redundent commands 2. The command is entirely perform "inline". This change examines each "pending command" check, and if it is not needed, deletes the check. Of the remaining pending command checks, we make sure that the command is in the pending queue by using the mgmt_pending_add/mgmt_pending_remove pair rather than the mgmt_pending_new/mgmt_pending_free pair. Link: https://lore.kernel.org/linux-bluetooth/f648f2e11bb3c2974c32e605a85ac3a9fac944f1.camel@redhat.com/T/ Tested-by: Maxim Levitsky Signed-off-by: Brian Gix Signed-off-by: Luiz Augusto von Dentz commit 4761df52f1549cc8c5ffcad0b2095fffe2c5435d Merge: b8d06ce712e37 db6140e5e35a4 Author: Jakub Kicinski Date: Tue Mar 1 15:13:46 2022 -0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf Pablo Neira Ayuso says: ==================== Netfilter fixes for net 1) Use kfree_rcu(ptr, rcu) variant, using kfree_rcu(ptr) was not intentional. From Eric Dumazet. 2) Use-after-free in netfilter hook core, from Eric Dumazet. 3) Missing rcu read lock side for netfilter egress hook, from Florian Westphal. 4) nf_queue assume state->sk is full socket while it might not be. Invoke sock_gen_put(), from Florian Westphal. 5) Add selftest to exercise the reported KASAN splat in 4) 6) Fix possible use-after-free in nf_queue in case sk_refcnt is 0. Also from Florian. 7) Use input interface index only for hardware offload, not for the software plane. This breaks tc ct action. Patch from Paul Blakey. * git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf: net/sched: act_ct: Fix flow table lookup failure with no originating ifindex netfilter: nf_queue: handle socket prefetch netfilter: nf_queue: fix possible use-after-free selftests: netfilter: add nfqueue TCP_NEW_SYN_RECV socket race test netfilter: nf_queue: don't assume sk is full socket netfilter: egress: silence egress hook lockdep splats netfilter: fix use-after-free in __nf_register_net_hook() netfilter: nf_tables: prefer kfree_rcu(ptr, rcu) variant ==================== Link: https://lore.kernel.org/r/20220301215337.378405-1-pablo@netfilter.org Signed-off-by: Jakub Kicinski commit fc7f750dc9d102c1ed7bbe4591f991e770c99033 Author: Dan Carpenter Date: Mon Feb 28 10:43:31 2022 +0300 staging: gdm724x: fix use after free in gdm_lte_rx() The netif_rx_ni() function frees the skb so we can't dereference it to save the skb->len. Fixes: 61e121047645 ("staging: gdm7240: adding LTE USB driver") Cc: stable Reported-by: kernel test robot Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20220228074331.GA13685@kili Signed-off-by: Greg Kroah-Hartman commit a0e897d1b36793fe0ab899f2fe93dff25c82f418 Author: Pali Rohár Date: Mon Jan 17 19:20:06 2022 +0100 arm64: dts: armada-3720-turris-mox: Add missing ethernet0 alias U-Boot uses ethernet* aliases for setting MAC addresses. Therefore define also alias for ethernet0. Fixes: 7109d817db2e ("arm64: dts: marvell: add DTS for Turris Mox") Signed-off-by: Pali Rohár Signed-off-by: Gregory CLEMENT Signed-off-by: Arnd Bergmann commit db6140e5e35a48405e669353bd54042c1d4c3841 Author: Paul Blakey Date: Mon Feb 28 11:23:49 2022 +0200 net/sched: act_ct: Fix flow table lookup failure with no originating ifindex After cited commit optimizted hw insertion, flow table entries are populated with ifindex information which was intended to only be used for HW offload. This tuple ifindex is hashed in the flow table key, so it must be filled for lookup to be successful. But tuple ifindex is only relevant for the netfilter flowtables (nft), so it's not filled in act_ct flow table lookup, resulting in lookup failure, and no SW offload and no offload teardown for TCP connection FIN/RST packets. To fix this, add new tc ifindex field to tuple, which will only be used for offloading, not for lookup, as it will not be part of the tuple hash. Fixes: 9795ded7f924 ("net/sched: act_ct: Fill offloading tuple iifidx") Signed-off-by: Paul Blakey Signed-off-by: Pablo Neira Ayuso commit fb184c4af9b9f4563e7a126219389986a71d5b5b Merge: 575115360652e ece32a75f0034 Author: Linus Torvalds Date: Tue Mar 1 12:01:18 2022 -0800 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull kvm fixes from Paolo Bonzini: "The bigger part of the change is a revert for x86 hosts. Here the second patch was supposed to fix the first, but in reality it was just as broken, so both have to go. x86 host: - Revert incorrect assumption that cr3 changes come with preempt notifier callbacks (they don't when static branches are changed, for example) ARM host: - Correctly synchronise PMR and co on PSCI CPU_SUSPEND - Skip tests that depend on GICv3 when the HW isn't available" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: KVM: selftests: aarch64: Skip tests if we can't create a vgic-v3 Revert "KVM: VMX: Save HOST_CR3 in vmx_prepare_switch_to_guest()" Revert "KVM: VMX: Save HOST_CR3 in vmx_set_host_fs_gs()" KVM: arm64: Don't miss pending interrupts for suspended vCPU commit c194dad21025dfd043210912653baab823bdff67 Author: Heiko Carstens Date: Thu Feb 24 22:03:29 2022 +0100 s390/extable: fix exception table sorting s390 has a swap_ex_entry_fixup function, however it is not being used since common code expects a swap_ex_entry_fixup define. If it is not defined the default implementation will be used. So fix this by adding a proper define. However also the implementation of the function must be fixed, since a NULL value for handler has a special meaning and must not be adjusted. Luckily all of this doesn't fix a real bug currently: the main extable is correctly sorted during build time, and for runtime sorting there is currently no case where the handler field is not NULL. Fixes: 05a68e892e89 ("s390/kernel: expand exception table logic to allow new handling options") Acked-by: Ilya Leoshkevich Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 1389f17937a03fe4ec71b094e1aa6530a901963e Author: Heiko Carstens Date: Tue Feb 22 14:53:47 2022 +0100 s390/ftrace: fix arch_ftrace_get_regs implementation arch_ftrace_get_regs is supposed to return a struct pt_regs pointer only if the pt_regs structure contains all register contents, which means it must have been populated when created via ftrace_regs_caller. If it was populated via ftrace_caller the contents are not complete (the psw mask part is missing), and therefore a NULL pointer needs be returned. The current code incorrectly always returns a struct pt_regs pointer. Fix this by adding another pt_regs flag which indicates if the contents are complete, and fix arch_ftrace_get_regs accordingly. Fixes: 894979689d3a ("s390/ftrace: provide separate ftrace_caller/ftrace_regs_caller implementations") Reported-by: Christophe Leroy Reported-by: Naveen N. Rao Reviewed-by: Sven Schnelle Acked-by: Ilya Leoshkevich Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 9fa881f7e3c74ce6626d166bca9397e5d925937f Author: Heiko Carstens Date: Wed Feb 23 13:02:59 2022 +0100 s390/ftrace: fix ftrace_caller/ftrace_regs_caller generation ftrace_caller was used for both ftrace_caller and ftrace_regs_caller, which means that the target address of the hotpatch trampoline was never updated. With commit 894979689d3a ("s390/ftrace: provide separate ftrace_caller/ftrace_regs_caller implementations") a separate ftrace_regs_caller entry point was implemeted, however it was forgotten to implement the necessary changes for ftrace_modify_call and ftrace_make_call, where the branch target has to be modified accordingly. Therefore add the missing code now. Fixes: 894979689d3a ("s390/ftrace: provide separate ftrace_caller/ftrace_regs_caller implementations") Reviewed-by: Sven Schnelle Acked-by: Ilya Leoshkevich Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 6b4b54c7ca347bcb4aa7a3cc01aa16e84ac7fbe4 Author: Alexander Egorenkov Date: Wed Feb 9 11:25:09 2022 +0100 s390/setup: preserve memory at OLDMEM_BASE and OLDMEM_SIZE We need to preserve the values at OLDMEM_BASE and OLDMEM_SIZE which are used by zgetdump in case when kdump crashes. In that case zgetdump will attempt to read OLDMEM_BASE and OLDMEM_SIZE in order to find out where the memory range [0 - OLDMEM_SIZE] belonging to the production kernel is. Fixes: f1a546947431 ("s390/setup: don't reserve memory that occupied decompressor's head") Cc: stable@vger.kernel.org # 5.15+ Signed-off-by: Alexander Egorenkov Acked-by: Vasily Gorbik Signed-off-by: Vasily Gorbik commit 62929726ef0ec72cbbe9440c5d125d4278b99894 Author: Manasi Navare Date: Thu Feb 24 17:30:54 2022 -0800 drm/vrr: Set VRR capable prop only if it is attached to connector VRR capable property is not attached by default to the connector It is attached only if VRR is supported. So if the driver tries to call drm core set prop function without it being attached that causes NULL dereference. Cc: Jani Nikula Cc: Ville Syrjälä Cc: dri-devel@lists.freedesktop.org Signed-off-by: Manasi Navare Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220225013055.9282-1-manasi.d.navare@intel.com commit 575115360652e9920cc56a028a286ebe9bf82694 Merge: 719fce7539cd3 439a8468242b3 Author: Linus Torvalds Date: Tue Mar 1 11:31:37 2022 -0800 Merge tag 'binfmt_elf-v5.17-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull binfmt_elf fix from Kees Cook: "This addresses a regression[1] under ia64 where some ET_EXEC binaries were not loading" Link: https://linux-regtracking.leemhuis.info/regzbot/regression/a3edd529-c42d-3b09-135c-7e98a15b150f@leemhuis.info/ [1] - Fix ia64 ET_EXEC loading * tag 'binfmt_elf-v5.17-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: binfmt_elf: Avoid total_mapping_size for ET_EXEC commit 439a8468242b313486e69b8cc3b45ddcfa898fbf Author: Kees Cook Date: Mon Feb 28 10:59:12 2022 -0800 binfmt_elf: Avoid total_mapping_size for ET_EXEC Partially revert commit 5f501d555653 ("binfmt_elf: reintroduce using MAP_FIXED_NOREPLACE"), which applied the ET_DYN "total_mapping_size" logic also to ET_EXEC. At least ia64 has ET_EXEC PT_LOAD segments that are not virtual-address contiguous (but _are_ file-offset contiguous). This would result in a giant mapping attempting to cover the entire span, including the virtual address range hole, and well beyond the size of the ELF file itself, causing the kernel to refuse to load it. For example: $ readelf -lW /usr/bin/gcc ... Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz ... ... LOAD 0x000000 0x4000000000000000 0x4000000000000000 0x00b5a0 0x00b5a0 ... LOAD 0x00b5a0 0x600000000000b5a0 0x600000000000b5a0 0x0005ac 0x000710 ... ... ^^^^^^^^ ^^^^^^^^^^^^^^^^^^ ^^^^^^^^ ^^^^^^^^ File offset range : 0x000000-0x00bb4c 0x00bb4c bytes Virtual address range : 0x4000000000000000-0x600000000000bcb0 0x200000000000bcb0 bytes Remove the total_mapping_size logic for ET_EXEC, which reduces the ET_EXEC MAP_FIXED_NOREPLACE coverage to only the first PT_LOAD (better than nothing), and retains it for ET_DYN. Ironically, this is the reverse of the problem that originally caused problems with MAP_FIXED_NOREPLACE: overlapping PT_LOAD segments. Future work could restore full coverage if load_elf_binary() were to perform mappings in a separate phase from the loading (where it could resolve both overlaps and holes). Cc: Eric Biederman Cc: Alexander Viro Cc: linux-fsdevel@vger.kernel.org Cc: linux-mm@kvack.org Reported-by: matoro Fixes: 5f501d555653 ("binfmt_elf: reintroduce using MAP_FIXED_NOREPLACE") Link: https://lore.kernel.org/r/a3edd529-c42d-3b09-135c-7e98a15b150f@leemhuis.info Tested-by: matoro Link: https://lore.kernel.org/lkml/ce8af9c13bcea9230c7689f3c1e0e2cd@matoro.tk Tested-By: John Paul Adrian Glaubitz Link: https://lore.kernel.org/lkml/49182d0d-708b-4029-da5f-bc18603440a6@physik.fu-berlin.de Cc: stable@vger.kernel.org Signed-off-by: Kees Cook commit 5838a14832d447990827d85e90afe17e6fb9c175 Author: Nicolas Cavallari Date: Mon Feb 28 12:03:51 2022 +0100 thermal: core: Fix TZ_GET_TRIP NULL pointer dereference Do not call get_trip_hyst() from thermal_genl_cmd_tz_get_trip() if the thermal zone does not define one. Fixes: 1ce50e7d408e ("thermal: core: genetlink support for events/cmd/sampling") Signed-off-by: Nicolas Cavallari Cc: 5.10+ # 5.10+ Signed-off-by: Rafael J. Wysocki commit fe23b6bbeac40de957724b90a88d46fb336e29a9 Author: Jia-Ju Bai Date: Thu Feb 24 19:41:10 2022 -0800 HID: nintendo: check the return value of alloc_workqueue() The function alloc_workqueue() in nintendo_hid_probe() can fail, but there is no check of its return value. To fix this bug, its return value should be checked with new error handling code. Fixes: c4eae84feff3e ("HID: nintendo: add rumble support") Reported-by: TOTE Robot Signed-off-by: Jia-Ju Bai Reviewed-by: Silvan Jegen Signed-off-by: Jiri Kosina commit b8d06ce712e37c6a6e74bf1624a0f4a412cd6508 Merge: 7cf5aa32e392d a12f76345e026 Author: David S. Miller Date: Tue Mar 1 14:45:55 2022 +0000 Merge tag 'wireless-for-net-2022-03-01' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless johannes Berg says: ==================== Some last-minute fixes: * rfkill - add missing rfill_soft_blocked() when disabled * cfg80211 - handle a nla_memdup() failure correctly - fix CONFIG_CFG80211_EXTRA_REGDB_KEYDIR typo in Makefile * mac80211 - fix EAPOL handling in 802.3 RX path - reject setting up aggregation sessions before connection is authorized to avoid timeouts or similar - handle some SAE authentication steps correctly - fix AC selection in mesh forwarding * iwlwifi - remove TWT support as it causes firmware crashes when the AP isn't behaving correctly - check debugfs pointer before dereferncing it ==================== Signed-off-by: David S. Miller commit cc71d37fd1f11e0495b1cf580909ebea37eaa886 Author: Dmitry Torokhov Date: Fri Feb 25 17:18:58 2022 -0800 HID: vivaldi: fix sysfs attributes leak The driver creates the top row map sysfs attribute in input_configured() method; unfortunately we do not have a callback that is executed when HID interface is unbound, thus we are leaking these sysfs attributes, for example when device is disconnected. To fix it let's switch to managed version of adding sysfs attributes which will ensure that they are destroyed when the driver is unbound. Fixes: 14c9c014babe ("HID: add vivaldi HID driver") Signed-off-by: Dmitry Torokhov Tested-by: Stephen Boyd Reviewed-by: Stephen Boyd Signed-off-by: Jiri Kosina commit a12f76345e026f1b300a0d17c56f020b6949b093 Author: Johannes Berg Date: Mon Feb 21 15:55:12 2022 +0100 cfg80211: fix CONFIG_CFG80211_EXTRA_REGDB_KEYDIR typo The kbuild change here accidentally removed not only the unquoting, but also the last character of the variable name. Fix that. Fixes: 129ab0d2d9f3 ("kbuild: do not quote string values in include/config/auto.conf") Reviewed-by: Masahiro Yamada Link: https://lore.kernel.org/r/20220221155512.1d25895f7c5f.I50fa3d4189fcab90a2896fe8cae215035dae9508@changeid Signed-off-by: Johannes Berg commit ea49432d184a6a09f84461604b7711a4e9f5ec9c Author: Daniel Palmer Date: Tue Mar 1 19:43:49 2022 +0900 ARM: mstar: Select HAVE_ARM_ARCH_TIMER The mstar SoCs have an arch timer but HAVE_ARM_ARCH_TIMER wasn't selected. If MSC313E_TIMER isn't selected then the kernel gets stuck at boot because there are no timers available. Signed-off-by: Daniel Palmer Link: https://lore.kernel.org/r/20220301104349.3040422-1-daniel@0x0f.com' Signed-off-by: Arnd Bergmann commit 4ff2980b6bd2aa6b4ded3ce3b7c0ccfab29980af Author: Lina Wang Date: Sat Feb 26 15:48:01 2022 +0800 xfrm: fix tunnel model fragmentation behavior in tunnel mode, if outer interface(ipv4) is less, it is easily to let inner IPV6 mtu be less than 1280. If so, a Packet Too Big ICMPV6 message is received. When send again, packets are fragmentized with 1280, they are still rejected with ICMPV6(Packet Too Big) by xfrmi_xmit2(). According to RFC4213 Section3.2.2: if (IPv4 path MTU - 20) is less than 1280 if packet is larger than 1280 bytes Send ICMPv6 "packet too big" with MTU=1280 Drop packet else Encapsulate but do not set the Don't Fragment flag in the IPv4 header. The resulting IPv4 packet might be fragmented by the IPv4 layer on the encapsulator or by some router along the IPv4 path. endif else if packet is larger than (IPv4 path MTU - 20) Send ICMPv6 "packet too big" with MTU = (IPv4 path MTU - 20). Drop packet. else Encapsulate and set the Don't Fragment flag in the IPv4 header. endif endif Packets should be fragmentized with ipv4 outer interface, so change it. After it is fragemtized with ipv4, there will be double fragmenation. No.48 & No.51 are ipv6 fragment packets, No.48 is double fragmentized, then tunneled with IPv4(No.49& No.50), which obey spec. And received peer cannot decrypt it rightly. 48 2002::10 2002::11 1296(length) IPv6 fragment (off=0 more=y ident=0xa20da5bc nxt=50) 49 0x0000 (0) 2002::10 2002::11 1304 IPv6 fragment (off=0 more=y ident=0x7448042c nxt=44) 50 0x0000 (0) 2002::10 2002::11 200 ESP (SPI=0x00035000) 51 2002::10 2002::11 180 Echo (ping) request 52 0x56dc 2002::10 2002::11 248 IPv6 fragment (off=1232 more=n ident=0xa20da5bc nxt=50) xfrm6_noneed_fragment has fixed above issues. Finally, it acted like below: 1 0x6206 192.168.1.138 192.168.1.1 1316 Fragmented IP protocol (proto=Encap Security Payload 50, off=0, ID=6206) [Reassembled in #2] 2 0x6206 2002::10 2002::11 88 IPv6 fragment (off=0 more=y ident=0x1f440778 nxt=50) 3 0x0000 2002::10 2002::11 248 ICMPv6 Echo (ping) request Signed-off-by: Lina Wang Signed-off-by: Steffen Klassert commit 3b836da4081fa585cf6c392f62557496f2cb0efe Author: Florian Westphal Date: Tue Mar 1 00:46:19 2022 +0100 netfilter: nf_queue: handle socket prefetch In case someone combines bpf socket assign and nf_queue, then we will queue an skb who references a struct sock that did not have its reference count incremented. As we leave rcu protection, there is no guarantee that skb->sk is still valid. For refcount-less skb->sk case, try to increment the reference count and then override the destructor. In case of failure we have two choices: orphan the skb and 'delete' preselect or let nf_queue() drop the packet. Do the latter, it should not happen during normal operation. Fixes: cf7fbe660f2d ("bpf: Add socket assign support") Acked-by: Joe Stringer Signed-off-by: Florian Westphal commit c3873070247d9e3c7a6b0cf9bf9b45e8018427b1 Author: Florian Westphal Date: Mon Feb 28 06:22:22 2022 +0100 netfilter: nf_queue: fix possible use-after-free Eric Dumazet says: The sock_hold() side seems suspect, because there is no guarantee that sk_refcnt is not already 0. On failure, we cannot queue the packet and need to indicate an error. The packet will be dropped by the caller. v2: split skb prefetch hunk into separate change Fixes: 271b72c7fa82c ("udp: RCU handling for Unicast packets.") Reported-by: Eric Dumazet Reviewed-by: Eric Dumazet Signed-off-by: Florian Westphal commit 2e78855d311c401083df9776aa450d32d716e83e Author: Florian Westphal Date: Fri Feb 25 12:01:23 2022 +0100 selftests: netfilter: add nfqueue TCP_NEW_SYN_RECV socket race test causes: BUG: KASAN: slab-out-of-bounds in sk_free+0x25/0x80 Write of size 4 at addr ffff888106df0284 by task nf-queue/1459 sk_free+0x25/0x80 nf_queue_entry_release_refs+0x143/0x1a0 nf_reinject+0x233/0x770 ... without 'netfilter: nf_queue: don't assume sk is full socket'. Signed-off-by: Florian Westphal commit 747670fd9a2d1b7774030dba65ca022ba442ce71 Author: Florian Westphal Date: Fri Feb 25 14:02:41 2022 +0100 netfilter: nf_queue: don't assume sk is full socket There is no guarantee that state->sk refers to a full socket. If refcount transitions to 0, sock_put calls sk_free which then ends up with garbage fields. I'd like to thank Oleksandr Natalenko and Jiri Benc for considerable debug work and pointing out state->sk oddities. Fixes: ca6fb0651883 ("tcp: attach SYNACK messages to request sockets instead of listener") Tested-by: Oleksandr Natalenko Signed-off-by: Florian Westphal commit 94d9864cc86f572f881db9b842a78e9d075493ae Author: Johannes Berg Date: Thu Feb 24 10:39:34 2022 +0100 mac80211: treat some SAE auth steps as final When we get anti-clogging token required (added by the commit mentioned below), or the other status codes added by the later commit 4e56cde15f7d ("mac80211: Handle special status codes in SAE commit") we currently just pretend (towards the internal state machine of authentication) that we didn't receive anything. This has the undesirable consequence of retransmitting the prior frame, which is not expected, because the timer is still armed. If we just disarm the timer at that point, it would result in the undesirable side effect of being in this state indefinitely if userspace crashes, or so. So to fix this, reset the timer and set a new auth_data->waiting in order to have no more retransmissions, but to have the data destroyed when the timer actually fires, which will only happen if userspace didn't continue (i.e. crashed or abandoned it.) Fixes: a4055e74a2ff ("mac80211: Don't destroy auth data in case of anti-clogging") Reported-by: Jouni Malinen Link: https://lore.kernel.org/r/20220224103932.75964e1d7932.Ia487f91556f29daae734bf61f8181404642e1eec@changeid Signed-off-by: Johannes Berg commit 6ad27f522cb3b210476daf63ce6ddb6568c0508b Author: Jiasheng Jiang Date: Tue Mar 1 18:00:20 2022 +0800 nl80211: Handle nla_memdup failures in handle_nan_filter As there's potential for failure of the nla_memdup(), check the return value. Fixes: a442b761b24b ("cfg80211: add add_nan_func / del_nan_func") Signed-off-by: Jiasheng Jiang Link: https://lore.kernel.org/r/20220301100020.3801187-1-jiasheng@iscas.ac.cn Signed-off-by: Johannes Berg commit 5a6248c0a22352f09ea041665d3bd3e18f6f872c Author: Randy Dunlap Date: Tue Feb 22 19:06:30 2022 -0800 iwlwifi: mvm: check debugfs_dir ptr before use When "debugfs=off" is used on the kernel command line, iwiwifi's mvm module uses an invalid/unchecked debugfs_dir pointer and causes a BUG: BUG: kernel NULL pointer dereference, address: 000000000000004f #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP CPU: 1 PID: 503 Comm: modprobe Tainted: G W 5.17.0-rc5 #7 Hardware name: Dell Inc. Inspiron 15 5510/076F7Y, BIOS 2.4.1 11/05/2021 RIP: 0010:iwl_mvm_dbgfs_register+0x692/0x700 [iwlmvm] Code: 69 a0 be 80 01 00 00 48 c7 c7 50 73 6a a0 e8 95 cf ee e0 48 8b 83 b0 1e 00 00 48 c7 c2 54 73 6a a0 be 64 00 00 00 48 8d 7d 8c <48> 8b 48 50 e8 15 22 07 e1 48 8b 43 28 48 8d 55 8c 48 c7 c7 5f 73 RSP: 0018:ffffc90000a0ba68 EFLAGS: 00010246 RAX: ffffffffffffffff RBX: ffff88817d6e3328 RCX: ffff88817d6e3328 RDX: ffffffffa06a7354 RSI: 0000000000000064 RDI: ffffc90000a0ba6c RBP: ffffc90000a0bae0 R08: ffffffff824e4880 R09: ffffffffa069d620 R10: ffffc90000a0ba00 R11: ffffffffffffffff R12: 0000000000000000 R13: ffffc90000a0bb28 R14: ffff88817d6e3328 R15: ffff88817d6e3320 FS: 00007f64dd92d740(0000) GS:ffff88847f640000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000000000000004f CR3: 000000016fc79001 CR4: 0000000000770ee0 PKRU: 55555554 Call Trace: ? iwl_mvm_mac_setup_register+0xbdc/0xda0 [iwlmvm] iwl_mvm_start_post_nvm+0x71/0x100 [iwlmvm] iwl_op_mode_mvm_start+0xab8/0xb30 [iwlmvm] _iwl_op_mode_start+0x6f/0xd0 [iwlwifi] iwl_opmode_register+0x6a/0xe0 [iwlwifi] ? 0xffffffffa0231000 iwl_mvm_init+0x35/0x1000 [iwlmvm] ? 0xffffffffa0231000 do_one_initcall+0x5a/0x1b0 ? kmem_cache_alloc+0x1e5/0x2f0 ? do_init_module+0x1e/0x220 do_init_module+0x48/0x220 load_module+0x2602/0x2bc0 ? __kernel_read+0x145/0x2e0 ? kernel_read_file+0x229/0x290 __do_sys_finit_module+0xc5/0x130 ? __do_sys_finit_module+0xc5/0x130 __x64_sys_finit_module+0x13/0x20 do_syscall_64+0x38/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f64dda564dd Code: 5b 41 5c c3 66 0f 1f 84 00 00 00 00 00 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 1b 29 0f 00 f7 d8 64 89 01 48 RSP: 002b:00007ffdba393f88 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f64dda564dd RDX: 0000000000000000 RSI: 00005575399e2ab2 RDI: 0000000000000001 RBP: 000055753a91c5e0 R08: 0000000000000000 R09: 0000000000000002 R10: 0000000000000001 R11: 0000000000000246 R12: 00005575399e2ab2 R13: 000055753a91ceb0 R14: 0000000000000000 R15: 000055753a923018 Modules linked in: btintel(+) btmtk bluetooth vfat snd_hda_codec_hdmi fat snd_hda_codec_realtek snd_hda_codec_generic iwlmvm(+) snd_sof_pci_intel_tgl mac80211 snd_sof_intel_hda_common soundwire_intel soundwire_generic_allocation soundwire_cadence soundwire_bus snd_sof_intel_hda snd_sof_pci snd_sof snd_sof_xtensa_dsp snd_soc_hdac_hda snd_hda_ext_core snd_soc_acpi_intel_match snd_soc_acpi snd_soc_core btrfs snd_compress snd_hda_intel snd_intel_dspcfg snd_intel_sdw_acpi snd_hda_codec raid6_pq iwlwifi snd_hda_core snd_pcm snd_timer snd soundcore cfg80211 intel_ish_ipc(+) thunderbolt rfkill intel_ishtp ucsi_acpi wmi i2c_hid_acpi i2c_hid evdev CR2: 000000000000004f ---[ end trace 0000000000000000 ]--- Check the debugfs_dir pointer for an error before using it. Fixes: 8c082a99edb9 ("iwlwifi: mvm: simplify iwl_mvm_dbgfs_register") Signed-off-by: Randy Dunlap Cc: Luca Coelho Cc: linux-wireless@vger.kernel.org Cc: Kalle Valo Cc: Greg Kroah-Hartman Cc: Emmanuel Grumbach Cc: stable Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20220223030630.23241-1-rdunlap@infradead.org [change to make both conditional] Signed-off-by: Johannes Berg commit 1db5fcbba2631277b78d7f8aff99c9607d29f6d8 Author: Golan Ben Ami Date: Tue Mar 1 09:29:26 2022 +0200 iwlwifi: don't advertise TWT support Some APs misbehave when TWT is used and cause our firmware to crash. We don't know a reasonable way to detect and work around this problem in the FW yet. To prevent these crashes, disable TWT in the driver by stopping to advertise TWT support. Link: https://bugzilla.kernel.org/show_bug.cgi?id=215523 Signed-off-by: Golan Ben Ami [reworded the commit message] Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/20220301072926.153969-1-luca@coelho.fi Signed-off-by: Johannes Berg commit 50bb467c9e76743fbc8441d29113cdad62dbc4fe Author: Ben Dooks Date: Fri Feb 18 09:38:58 2022 +0000 rfkill: define rfill_soft_blocked() if !RFKILL If CONFIG_RFKILL is not set, the Intel WiFi driver will not build the iw_mvm driver part due to the missing rfill_soft_blocked() call. Adding a inline declaration of rfill_soft_blocked() if CONFIG_RFKILL=n fixes the following error: drivers/net/wireless/intel/iwlwifi/mvm/mvm.h: In function 'iwl_mvm_mei_set_sw_rfkill_state': drivers/net/wireless/intel/iwlwifi/mvm/mvm.h:2215:38: error: implicit declaration of function 'rfkill_soft_blocked'; did you mean 'rfkill_blocked'? [-Werror=implicit-function-declaration] 2215 | mvm->hw_registered ? rfkill_soft_blocked(mvm->hw->wiphy->rfkill) : false; | ^~~~~~~~~~~~~~~~~~~ | rfkill_blocked Signed-off-by: Ben Dooks Reported-by: Neill Whillans Fixes: 5bc9a9dd7535 ("rfkill: allow to get the software rfkill state") Link: https://lore.kernel.org/r/20220218093858.1245677-1-ben.dooks@codethink.co.uk Signed-off-by: Johannes Berg commit 35e33a24f8fe0bacc55d62eb506d99c122f02012 Merge: cf90e2f1de977 c432cd598a185 Author: Arnd Bergmann Date: Tue Mar 1 10:46:04 2022 +0100 Merge tag 'v5.17-fixes-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux into arm/fixes - Set display pipeline to DSI on mt8183 kukui jacuzzi - Fix display for mt8192 based boards by fixing the routing table * tag 'v5.17-fixes-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux: soc: mediatek: mt8192-mmsys: Fix dither to dsi0 path's input sel arm64: dts: mt8183: jacuzzi: Fix bus properties in anx's DSI endpoint Link: https://lore.kernel.org/r/8eb8510d-c597-4fee-e4b3-924b6d4bb3be@gmail.com Signed-off-by: Arnd Bergmann commit cf90e2f1de977fb79873b1eaf6df113e4e8b4469 Merge: e1d7eed180b63 fc5a40694ba68 Author: Arnd Bergmann Date: Tue Mar 1 10:45:55 2022 +0100 Merge tag 'qcom-dts-fixes-for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/fixes Qualcomm DeviceTree fixes for v5.17 The SDX65 platform and MTP device was added twice to the DT binding, this drops one of the occurances. * tag 'qcom-dts-fixes-for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: Revert "dt-bindings: arm: qcom: Document SDX65 platform and boards" Link: https://lore.kernel.org/r/20220301033838.1801689-1-bjorn.andersson@linaro.org Signed-off-by: Arnd Bergmann commit e1d7eed180b6355cedfbbd5c69ef7e0f145a5510 Merge: 9411ac255e535 382e3e0eb6a83 Author: Arnd Bergmann Date: Tue Mar 1 10:45:46 2022 +0100 Merge tag 'qcom-arm64-fixes-for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/fixes Qualcomm ARM64 DeviceTree fixes for 5.17 This starts off by fixing an issue introduced in a bug fix in the global clock controller, where the symbol clocks for UFS would end up picking the wrong parent clock which breaks UFS. It then makes sure that the reference clock for the USB blocks are enabled, even with booting without clk_ignore_unused. It corrects the apps SMMU interrupts defintion by adding a missing interrupt in the list. Lastly it disables the Qualcomm crypto hardware (for now) on the Lenovo Yoga C630, to prevent the cryptomanager tests during boot from crashing the device. * tag 'qcom-arm64-fixes-for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: arm64: dts: qcom: c630: disable crypto due to serror arm64: dts: qcom: sm8450: fix apps_smmu interrupts arm64: dts: qcom: sm8450: enable GCC_USB3_0_CLKREF_EN for usb arm64: dts: qcom: sm8350: Correct UFS symbol clocks Link: https://lore.kernel.org/r/20220301033526.1801295-1-bjorn.andersson@linaro.org Signed-off-by: Arnd Bergmann commit 9411ac255e535059d06729acae34df0914e55502 Merge: 7e57714cd0ad2 515415d316168 Author: Arnd Bergmann Date: Tue Mar 1 10:45:37 2022 +0100 Merge tag 'arm-soc/for-5.17/devicetree-fixes' of https://github.com/Broadcom/stblinux into arm/fixes This pull request contains Broadcom ARM-based SoCs Device Tree fixes for 5.17, please pull the following: - Maxime fixes the HVS (display) register range for the BCM2711 (Raspberry Pi 4) SoC * tag 'arm-soc/for-5.17/devicetree-fixes' of https://github.com/Broadcom/stblinux: ARM: boot: dts: bcm2711: Fix HVS register range Link: https://lore.kernel.org/r/20220228165537.1950863-1-f.fainelli@gmail.com Signed-off-by: Arnd Bergmann commit 5d8965704fe5662e2e4a7e4424a2cbe53e182670 Author: Ilya Lipnitskiy Date: Mon Feb 28 17:15:07 2022 -0800 MIPS: ralink: mt7621: use bitwise NOT instead of logical It was the intention to reverse the bits, not make them all zero by using logical NOT operator. Fixes: cc19db8b312a ("MIPS: ralink: mt7621: do memory detection on KSEG1") Suggested-by: Chuanhong Guo Signed-off-by: Ilya Lipnitskiy Reviewed-by: Sergio Paracuellos Signed-off-by: Thomas Bogendoerfer commit 7cf5aa32e392dfa1e671ef2f704b729a7b39c7f9 Merge: caef14b7530c0 ffd24fa2fcc76 Author: David S. Miller Date: Tue Mar 1 08:33:55 2022 +0000 Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2022-02-28 This series contains updates to igc and e1000e drivers. Corinna Vinschen ensures release of hardware sempahore on failed register read in igc_read_phy_reg_gpy(). Sasha does the same for the write variant, igc_write_phy_reg_gpy(). On e1000e, he resolves an issue with hardware unit hang on s0ix exit by disabling some bits and LAN connected device reset during power management flows. Lastly, he allows for TGP platforms to correct its NVM checksum. v2: Fix Fixes tag on patch 3 ==================== Signed-off-by: David S. Miller commit 9feaf8b387ee0ece9c1d7add308776b502a35d0c Author: Randy Dunlap Date: Mon Feb 28 20:18:51 2022 -0800 efi: fix return value of __setup handlers When "dump_apple_properties" is used on the kernel boot command line, it causes an Unknown parameter message and the string is added to init's argument strings: Unknown kernel command line parameters "dump_apple_properties BOOT_IMAGE=/boot/bzImage-517rc6 efivar_ssdt=newcpu_ssdt", will be passed to user space. Run /sbin/init as init process with arguments: /sbin/init dump_apple_properties with environment: HOME=/ TERM=linux BOOT_IMAGE=/boot/bzImage-517rc6 efivar_ssdt=newcpu_ssdt Similarly when "efivar_ssdt=somestring" is used, it is added to the Unknown parameter message and to init's environment strings, polluting them (see examples above). Change the return value of the __setup functions to 1 to indicate that the __setup options have been handled. Fixes: 58c5475aba67 ("x86/efi: Retrieve and assign Apple device properties") Fixes: 475fb4e8b2f4 ("efi / ACPI: load SSTDs from EFI variables") Signed-off-by: Randy Dunlap Reported-by: Igor Zhbanov Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru Cc: Ard Biesheuvel Cc: linux-efi@vger.kernel.org Cc: Lukas Wunner Cc: Octavian Purdila Cc: "Rafael J. Wysocki" Cc: Matt Fleming Link: https://lore.kernel.org/r/20220301041851.12459-1-rdunlap@infradead.org Signed-off-by: Ard Biesheuvel commit c432cd598a185afefba1ac3b0ee226f222f71341 Author: AngeloGioacchino Del Regno Date: Fri Jan 28 15:20:56 2022 +0100 soc: mediatek: mt8192-mmsys: Fix dither to dsi0 path's input sel In commit d687e056a18f ("soc: mediatek: mmsys: Add mt8192 mmsys routing table"), the mmsys routing table for mt8192 was introduced but the input selector for DITHER->DSI0 has no value assigned to it. This means that we are clearing bit 0 instead of setting it, blocking communication between these two blocks; due to that, any display that is connected to DSI0 will not work, as no data will go through. The effect of that issue is that, during bootup, the DRM will block for some time, while atomically waiting for a vblank that never happens; later, the situation doesn't get better, leaving the display in a non-functional state. To fix this issue, fix the route entry in the table by assigning the dither input selector to MT8192_DISP_DSI0_SEL_IN. Fixes: d687e056a18f ("soc: mediatek: mmsys: Add mt8192 mmsys routing table") Signed-off-by: AngeloGioacchino Del Regno Tested-by: Alyssa Rosenzweig Reviewed-by: Nícolas F. R. A. Prado Link: https://lore.kernel.org/r/20220128142056.359900-1-angelogioacchino.delregno@collabora.com Signed-off-by: Matthias Brugger commit d982992669733dd75520000c6057d8ee0725a363 Author: Hans de Goede Date: Mon Feb 28 22:53:12 2022 -0800 Input: goodix - workaround Cherry Trail devices with a bogus ACPI Interrupt() resource ACPI/x86 devices with a Cherry Trail SoC should have a GpioInt + a regular GPIO ACPI resource in their ACPI tables. Some CHT devices have a bug, where the also is bogus interrupt resource (likely copied from a previous Bay Trail based generation of the device). The i2c-core-acpi code will assign the bogus, non-working, interrupt resource to client->irq. Add a workaround to fix this up. BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=2043960 Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220228111613.363336-1-hdegoede@redhat.com Signed-off-by: Dmitry Torokhov commit d176708ffc20332d1c730098d2b111e0b77ece82 Author: Hans de Goede Date: Mon Feb 28 22:52:31 2022 -0800 Input: goodix - use the new soc_intel_is_byt() helper Use the new soc_intel_is_byt() helper from linux/platform_data/x86/soc.h. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220131143539.109142-5-hdegoede@redhat.com Signed-off-by: Dmitry Torokhov commit 1136fa0c07de570dc17858745af8be169d1440ba Merge: ba115adf61b36 754e0b0e35608 Author: Dmitry Torokhov Date: Mon Feb 28 23:12:55 2022 -0800 Merge tag 'v5.17-rc4' into for-linus Merge with mainline to get the Intel ASoC generic helpers header and other changes. commit bac129dbc6560dfeb634c03f0c08b78024e71915 Author: Samuel Holland Date: Tue Feb 15 22:00:36 2022 -0600 pinctrl: sunxi: Use unique lockdep classes for IRQs This driver, like several others, uses a chained IRQ for each GPIO bank, and forwards .irq_set_wake to the GPIO bank's upstream IRQ. As a result, a call to irq_set_irq_wake() needs to lock both the upstream and downstream irq_desc's. Lockdep considers this to be a possible deadlock when the irq_desc's share lockdep classes, which they do by default: ============================================ WARNING: possible recursive locking detected 5.17.0-rc3-00394-gc849047c2473 #1 Not tainted -------------------------------------------- init/307 is trying to acquire lock: c2dfe27c (&irq_desc_lock_class){-.-.}-{2:2}, at: __irq_get_desc_lock+0x58/0xa0 but task is already holding lock: c3c0ac7c (&irq_desc_lock_class){-.-.}-{2:2}, at: __irq_get_desc_lock+0x58/0xa0 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&irq_desc_lock_class); lock(&irq_desc_lock_class); *** DEADLOCK *** May be due to missing lock nesting notation 4 locks held by init/307: #0: c1f29f18 (system_transition_mutex){+.+.}-{3:3}, at: __do_sys_reboot+0x90/0x23c #1: c20f7760 (&dev->mutex){....}-{3:3}, at: device_shutdown+0xf4/0x224 #2: c2e804d8 (&dev->mutex){....}-{3:3}, at: device_shutdown+0x104/0x224 #3: c3c0ac7c (&irq_desc_lock_class){-.-.}-{2:2}, at: __irq_get_desc_lock+0x58/0xa0 stack backtrace: CPU: 0 PID: 307 Comm: init Not tainted 5.17.0-rc3-00394-gc849047c2473 #1 Hardware name: Allwinner sun8i Family unwind_backtrace from show_stack+0x10/0x14 show_stack from dump_stack_lvl+0x68/0x90 dump_stack_lvl from __lock_acquire+0x1680/0x31a0 __lock_acquire from lock_acquire+0x148/0x3dc lock_acquire from _raw_spin_lock_irqsave+0x50/0x6c _raw_spin_lock_irqsave from __irq_get_desc_lock+0x58/0xa0 __irq_get_desc_lock from irq_set_irq_wake+0x2c/0x19c irq_set_irq_wake from irq_set_irq_wake+0x13c/0x19c [tail call from sunxi_pinctrl_irq_set_wake] irq_set_irq_wake from gpio_keys_suspend+0x80/0x1a4 gpio_keys_suspend from gpio_keys_shutdown+0x10/0x2c gpio_keys_shutdown from device_shutdown+0x180/0x224 device_shutdown from __do_sys_reboot+0x134/0x23c __do_sys_reboot from ret_fast_syscall+0x0/0x1c However, this can never deadlock because the upstream and downstream IRQs are never the same (nor do they even involve the same irqchip). Silence this erroneous lockdep splat by applying what appears to be the usual fix of moving the GPIO IRQs to separate lockdep classes. Fixes: a59c99d9eaf9 ("pinctrl: sunxi: Forward calls to irq_set_irq_wake") Reported-by: Guenter Roeck Signed-off-by: Samuel Holland Reviewed-by: Jernej Skrabec Tested-by: Guenter Roeck Link: https://lore.kernel.org/r/20220216040037.22730-1-samuel@sholland.org Signed-off-by: Linus Walleij commit 7795686d573de0438bba6b2b344e6b203223c889 Author: Hans Verkuil Date: Wed Jan 26 12:02:04 2022 +0100 pinctrl-sunxi: sunxi_pinctrl_gpio_direction_in/output: use correct offset The commit that sets the direction directly without calling pinctrl_gpio_direction(), forgot to add chip->base to the offset when calling sunxi_pmx_gpio_set_direction(). This caused failures for various Allwinner boards which have two GPIO blocks. Signed-off-by: Hans Verkuil Reported-by: 5kft <5kft@5kft.org> Suggested-by: 5kft <5kft@5kft.org> Reported-by: Corentin Labbe Fixes: 8df89a7cbc63 (pinctrl-sunxi: don't call pinctrl_gpio_direction()) Tested-by: Corentin Labbe Tested-by: Jernej Skrabec Acked-by: Jernej Skrabec Link: https://lore.kernel.org/r/0f536cd8-01db-5d16-2cec-ec6d19409a49@xs4all.nl Signed-off-by: Guenter Roeck [Picked from linux-next to pinctrl fixes] Signed-off-by: Linus Walleij commit ffd24fa2fcc76ecb2e61e7a4ef8588177bcb42a6 Author: Sasha Neftin Date: Thu Feb 3 14:21:49 2022 +0200 e1000e: Correct NVM checksum verification flow Update MAC type check e1000_pch_tgp because for e1000_pch_cnp, NVM checksum update is still possible. Emit a more detailed warning message. Bugzilla: https://bugzilla.opensuse.org/show_bug.cgi?id=1191663 Fixes: 4051f68318ca ("e1000e: Do not take care about recovery NVM checksum") Reported-by: Thomas Bogendoerfer Signed-off-by: Sasha Neftin Tested-by: Naama Meir Signed-off-by: Tony Nguyen commit 1866aa0d0d6492bc2f8d22d0df49abaccf50cddd Author: Sasha Neftin Date: Tue Jan 25 19:31:23 2022 +0200 e1000e: Fix possible HW unit hang after an s0ix exit Disable the OEM bit/Gig Disable/restart AN impact and disable the PHY LAN connected device (LCD) reset during power management flows. This fixes possible HW unit hangs on the s0ix exit on some corporate ADL platforms. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=214821 Fixes: 3e55d231716e ("e1000e: Add handshake with the CSME to support S0ix") Suggested-by: Dima Ruinskiy Suggested-by: Nir Efrati Signed-off-by: Sasha Neftin Tested-by: Kai-Heng Feng Signed-off-by: Tony Nguyen commit 17a8f31bba7bac8cce4bd12bab50697da96e7710 Author: Florian Westphal Date: Mon Feb 28 04:18:05 2022 +0100 netfilter: egress: silence egress hook lockdep splats Netfilter assumes its called with rcu_read_lock held, but in egress hook case it may be called with BH readlock. This triggers lockdep splat. In order to avoid to change all rcu_dereference() to rcu_dereference_check(..., rcu_read_lock_bh_held()), wrap nf_hook_slow with read lock/unlock pair. Reported-by: Eric Dumazet Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 56763f12b0f02706576a088e85ef856deacc98a0 Author: Eric Dumazet Date: Sun Feb 27 10:01:41 2022 -0800 netfilter: fix use-after-free in __nf_register_net_hook() We must not dereference @new_hooks after nf_hook_mutex has been released, because other threads might have freed our allocated hooks already. BUG: KASAN: use-after-free in nf_hook_entries_get_hook_ops include/linux/netfilter.h:130 [inline] BUG: KASAN: use-after-free in hooks_validate net/netfilter/core.c:171 [inline] BUG: KASAN: use-after-free in __nf_register_net_hook+0x77a/0x820 net/netfilter/core.c:438 Read of size 2 at addr ffff88801c1a8000 by task syz-executor237/4430 CPU: 1 PID: 4430 Comm: syz-executor237 Not tainted 5.17.0-rc5-syzkaller-00306-g2293be58d6a1 #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_address_description.constprop.0.cold+0x8d/0x336 mm/kasan/report.c:255 __kasan_report mm/kasan/report.c:442 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:459 nf_hook_entries_get_hook_ops include/linux/netfilter.h:130 [inline] hooks_validate net/netfilter/core.c:171 [inline] __nf_register_net_hook+0x77a/0x820 net/netfilter/core.c:438 nf_register_net_hook+0x114/0x170 net/netfilter/core.c:571 nf_register_net_hooks+0x59/0xc0 net/netfilter/core.c:587 nf_synproxy_ipv6_init+0x85/0xe0 net/netfilter/nf_synproxy_core.c:1218 synproxy_tg6_check+0x30d/0x560 net/ipv6/netfilter/ip6t_SYNPROXY.c:81 xt_check_target+0x26c/0x9e0 net/netfilter/x_tables.c:1038 check_target net/ipv6/netfilter/ip6_tables.c:530 [inline] find_check_entry.constprop.0+0x7f1/0x9e0 net/ipv6/netfilter/ip6_tables.c:573 translate_table+0xc8b/0x1750 net/ipv6/netfilter/ip6_tables.c:735 do_replace net/ipv6/netfilter/ip6_tables.c:1153 [inline] do_ip6t_set_ctl+0x56e/0xb90 net/ipv6/netfilter/ip6_tables.c:1639 nf_setsockopt+0x83/0xe0 net/netfilter/nf_sockopt.c:101 ipv6_setsockopt+0x122/0x180 net/ipv6/ipv6_sockglue.c:1024 rawv6_setsockopt+0xd3/0x6a0 net/ipv6/raw.c:1084 __sys_setsockopt+0x2db/0x610 net/socket.c:2180 __do_sys_setsockopt net/socket.c:2191 [inline] __se_sys_setsockopt net/socket.c:2188 [inline] __x64_sys_setsockopt+0xba/0x150 net/socket.c:2188 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:0x7f65a1ace7d9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 71 15 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f65a1a7f308 EFLAGS: 00000246 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 0000000000000006 RCX: 00007f65a1ace7d9 RDX: 0000000000000040 RSI: 0000000000000029 RDI: 0000000000000003 RBP: 00007f65a1b574c8 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000020000000 R11: 0000000000000246 R12: 00007f65a1b55130 R13: 00007f65a1b574c0 R14: 00007f65a1b24090 R15: 0000000000022000 The buggy address belongs to the page: page:ffffea0000706a00 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1c1a8 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea0001c1b108 ffffea000046dd08 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 2, migratetype Unmovable, gfp_mask 0x52dc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_ZERO), pid 4430, ts 1061781545818, free_ts 1061791488993 prep_new_page mm/page_alloc.c:2434 [inline] get_page_from_freelist+0xa72/0x2f50 mm/page_alloc.c:4165 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5389 __alloc_pages_node include/linux/gfp.h:572 [inline] alloc_pages_node include/linux/gfp.h:595 [inline] kmalloc_large_node+0x62/0x130 mm/slub.c:4438 __kmalloc_node+0x35a/0x4a0 mm/slub.c:4454 kmalloc_node include/linux/slab.h:604 [inline] kvmalloc_node+0x97/0x100 mm/util.c:580 kvmalloc include/linux/slab.h:731 [inline] kvzalloc include/linux/slab.h:739 [inline] allocate_hook_entries_size net/netfilter/core.c:61 [inline] nf_hook_entries_grow+0x140/0x780 net/netfilter/core.c:128 __nf_register_net_hook+0x144/0x820 net/netfilter/core.c:429 nf_register_net_hook+0x114/0x170 net/netfilter/core.c:571 nf_register_net_hooks+0x59/0xc0 net/netfilter/core.c:587 nf_synproxy_ipv6_init+0x85/0xe0 net/netfilter/nf_synproxy_core.c:1218 synproxy_tg6_check+0x30d/0x560 net/ipv6/netfilter/ip6t_SYNPROXY.c:81 xt_check_target+0x26c/0x9e0 net/netfilter/x_tables.c:1038 check_target net/ipv6/netfilter/ip6_tables.c:530 [inline] find_check_entry.constprop.0+0x7f1/0x9e0 net/ipv6/netfilter/ip6_tables.c:573 translate_table+0xc8b/0x1750 net/ipv6/netfilter/ip6_tables.c:735 do_replace net/ipv6/netfilter/ip6_tables.c:1153 [inline] do_ip6t_set_ctl+0x56e/0xb90 net/ipv6/netfilter/ip6_tables.c:1639 nf_setsockopt+0x83/0xe0 net/netfilter/nf_sockopt.c:101 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1352 [inline] free_pcp_prepare+0x374/0x870 mm/page_alloc.c:1404 free_unref_page_prepare mm/page_alloc.c:3325 [inline] free_unref_page+0x19/0x690 mm/page_alloc.c:3404 kvfree+0x42/0x50 mm/util.c:613 rcu_do_batch kernel/rcu/tree.c:2527 [inline] rcu_core+0x7b1/0x1820 kernel/rcu/tree.c:2778 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558 Memory state around the buggy address: ffff88801c1a7f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88801c1a7f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88801c1a8000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88801c1a8080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88801c1a8100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff Fixes: 2420b79f8c18 ("netfilter: debug: check for sorted array") Signed-off-by: Eric Dumazet Reported-by: syzbot Acked-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 719fce7539cd3e186598e2aed36325fe892150cf Merge: 201b5c016f165 c253bf70c657b Author: Linus Torvalds Date: Mon Feb 28 12:51:14 2022 -0800 Merge tag 'soc-fixes-5.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC fixes from Arnd Bergmann: "The code changes address mostly minor problems: - Several NXP/FSL SoC driver fixes, addressing issues with error handling and compilation - Fix a clock disabling imbalance in gpcv2 driver. - Arm Juno DMA coherency issue - Trivial firmware driver fixes for op-tee and scmi firmware The remaining changes address issues in the devicetree files: - A timer regression for the OMAP devkit8000, which has to use the alternative timer. - A hang in the i.MX8MM power domain configuration - Multiple fixes for the Rockchip RK3399 addressing issues with sound and eMMC - Cosmetic fixes for i.MX8ULP, RK3xxx, and Tegra124" * tag 'soc-fixes-5.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (32 commits) ARM: tegra: Move panels to AUX bus soc: imx: gpcv2: Fix clock disabling imbalance in error path soc: fsl: qe: Check of ioremap return value soc: fsl: qe: fix typo in a comment soc: fsl: guts: Add a missing memory allocation failure check soc: fsl: guts: Revert commit 3c0d64e867ed soc: fsl: Correct MAINTAINERS database (SOC) soc: fsl: Correct MAINTAINERS database (QUICC ENGINE LIBRARY) soc: fsl: Replace kernel.h with the necessary inclusions dt-bindings: fsl,layerscape-dcfg: add missing compatible for lx2160a dt-bindings: qoriq-clock: add missing compatible for lx2160a ARM: dts: Use 32KiHz oscillator on devkit8000 ARM: dts: switch timer config to common devkit8000 devicetree tee: optee: fix error return code in probe function arm64: dts: imx8ulp: Set #thermal-sensor-cells to 1 as required arm64: dts: imx8mm: Fix VPU Hanging ARM: dts: rockchip: fix a typo on rk3288 crypto-controller ARM: dts: rockchip: reorder rk322x hmdi clocks firmware: arm_scmi: Remove space in MODULE_ALIAS name arm64: dts: agilex: use the compatible "intel,socfpga-agilex-hsotg" ... commit 201b5c016f1655ead2ecc7e7e270841782cbbd0b Merge: 7e57714cd0ad2 258dd902022cb Author: Linus Torvalds Date: Mon Feb 28 12:44:33 2022 -0800 Merge tag 'efi-urgent-for-v5.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi Pull EFI fixes from Ard Biesheuvel: - don't treat valid hartid U32_MAX as a failure return code (RISC-V) - avoid blocking query_variable_info() call when blocking is not allowed * tag 'efi-urgent-for-v5.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi: efivars: Respect "block" flag in efivar_entry_set_safe() riscv/efi_stub: Fix get_boot_hartid_from_fdt() return value commit cb1852783f790feae845006d062acb9e0a5d4304 Author: Carsten Haitzler Date: Mon Jan 24 16:24:37 2022 +0000 drm/arm: arm hdlcd select DRM_GEM_CMA_HELPER Without DRM_GEM_CMA_HELPER HDLCD won't build. This needs to be there too. Fixes: 09717af7d13d ("drm: Remove CONFIG_DRM_KMS_CMA_HELPER option") Reviewed-by: Steven Price Signed-off-by: Carsten Haitzler Acked-by: Liviu Dudau Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220124162437.2470344-1-carsten.haitzler@foss.arm.com commit 26d3474348293dc752c55fe6d41282199f73714c Author: Douglas Anderson Date: Tue Feb 22 14:18:43 2022 -0800 drm/bridge: ti-sn65dsi86: Properly undo autosuspend The PM Runtime docs say: Drivers in ->remove() callback should undo the runtime PM changes done in ->probe(). Usually this means calling pm_runtime_disable(), pm_runtime_dont_use_autosuspend() etc. We weren't doing that for autosuspend. Let's do it. Fixes: 9bede63127c6 ("drm/bridge: ti-sn65dsi86: Use pm_runtime autosuspend") Signed-off-by: Douglas Anderson Reviewed-by: Linus Walleij Link: https://patchwork.freedesktop.org/patch/msgid/20220222141838.1.If784ba19e875e8ded4ec4931601ce6d255845245@changeid commit e9b6013a7ce31535b04b02ba99babefe8a8599fa Author: Kim Phillips Date: Mon Feb 28 11:23:16 2022 -0600 x86/speculation: Update link to AMD speculation whitepaper Update the link to the "Software Techniques for Managing Speculation on AMD Processors" whitepaper. Signed-off-by: Kim Phillips Signed-off-by: Borislav Petkov commit 244d00b5dd4755f8df892c86cab35fb2cfd4f14b Author: Kim Phillips Date: Mon Feb 28 11:23:15 2022 -0600 x86/speculation: Use generic retpoline by default on AMD AMD retpoline may be susceptible to speculation. The speculation execution window for an incorrect indirect branch prediction using LFENCE/JMP sequence may potentially be large enough to allow exploitation using Spectre V2. By default, don't use retpoline,lfence on AMD. Instead, use the generic retpoline. Signed-off-by: Kim Phillips Signed-off-by: Borislav Petkov commit c4208653a327a09da1e9e7b10299709b6d9b17bf Author: Sasha Neftin Date: Sun Feb 20 09:29:15 2022 +0200 igc: igc_write_phy_reg_gpy: drop premature return Similar to "igc_read_phy_reg_gpy: drop premature return" patch. igc_write_phy_reg_gpy checks the return value from igc_write_phy_reg_mdic and if it's not 0, returns immediately. By doing this, it leaves the HW semaphore in the acquired state. Drop this premature return statement, the function returns after releasing the semaphore immediately anyway. Fixes: 5586838fe9ce ("igc: Add code for PHY support") Suggested-by: Dima Ruinskiy Reported-by: Corinna Vinschen Signed-off-by: Sasha Neftin Tested-by: Naama Meir Signed-off-by: Tony Nguyen commit fda2635466cd26ad237e1bc5d3f6a60f97ad09b6 Author: Corinna Vinschen Date: Wed Feb 16 14:31:35 2022 +0100 igc: igc_read_phy_reg_gpy: drop premature return igc_read_phy_reg_gpy checks the return value from igc_read_phy_reg_mdic and if it's not 0, returns immediately. By doing this, it leaves the HW semaphore in the acquired state. Drop this premature return statement, the function returns after releasing the semaphore immediately anyway. Fixes: 5586838fe9ce ("igc: Add code for PHY support") Signed-off-by: Corinna Vinschen Acked-by: Sasha Neftin Tested-by: Naama Meir Signed-off-by: Tony Nguyen commit 7b83299e5b9385943a857d59e15cba270df20d7e Author: Randy Dunlap Date: Wed Feb 23 20:46:35 2022 +0100 ARM: 9182/1: mmu: fix returns from early_param() and __setup() functions early_param() handlers should return 0 on success. __setup() handlers should return 1 on success, i.e., the parameter has been handled. A return of 0 would cause the "option=value" string to be added to init's environment strings, polluting it. ../arch/arm/mm/mmu.c: In function 'test_early_cachepolicy': ../arch/arm/mm/mmu.c:215:1: error: no return statement in function returning non-void [-Werror=return-type] ../arch/arm/mm/mmu.c: In function 'test_noalign_setup': ../arch/arm/mm/mmu.c:221:1: error: no return statement in function returning non-void [-Werror=return-type] Fixes: b849a60e0903 ("ARM: make cr_alignment read-only #ifndef CONFIG_CPU_CP15") Signed-off-by: Randy Dunlap Reported-by: Igor Zhbanov Cc: Uwe Kleine-König Cc: linux-arm-kernel@lists.infradead.org Cc: patches@armlinux.org.uk Signed-off-by: Russell King (Oracle) commit 30939293262eb433c960c4532a0d59c4073b2b84 Author: Yu Kuai Date: Mon Feb 28 11:43:54 2022 +0800 blktrace: fix use after free for struct blk_trace When tracing the whole disk, 'dropped' and 'msg' will be created under 'q->debugfs_dir' and 'bt->dir' is NULL, thus blk_trace_free() won't remove those files. What's worse, the following UAF can be triggered because of accessing stale 'dropped' and 'msg': ================================================================== BUG: KASAN: use-after-free in blk_dropped_read+0x89/0x100 Read of size 4 at addr ffff88816912f3d8 by task blktrace/1188 CPU: 27 PID: 1188 Comm: blktrace Not tainted 5.17.0-rc4-next-20220217+ #469 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS ?-20190727_073836-4 Call Trace: dump_stack_lvl+0x34/0x44 print_address_description.constprop.0.cold+0xab/0x381 ? blk_dropped_read+0x89/0x100 ? blk_dropped_read+0x89/0x100 kasan_report.cold+0x83/0xdf ? blk_dropped_read+0x89/0x100 kasan_check_range+0x140/0x1b0 blk_dropped_read+0x89/0x100 ? blk_create_buf_file_callback+0x20/0x20 ? kmem_cache_free+0xa1/0x500 ? do_sys_openat2+0x258/0x460 full_proxy_read+0x8f/0xc0 vfs_read+0xc6/0x260 ksys_read+0xb9/0x150 ? vfs_write+0x3d0/0x3d0 ? fpregs_assert_state_consistent+0x55/0x60 ? exit_to_user_mode_prepare+0x39/0x1e0 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7fbc080d92fd Code: ce 20 00 00 75 10 b8 00 00 00 00 0f 05 48 3d 01 f0 ff ff 73 31 c3 48 83 1 RSP: 002b:00007fbb95ff9cb0 EFLAGS: 00000293 ORIG_RAX: 0000000000000000 RAX: ffffffffffffffda RBX: 00007fbb95ff9dc0 RCX: 00007fbc080d92fd RDX: 0000000000000100 RSI: 00007fbb95ff9cc0 RDI: 0000000000000045 RBP: 0000000000000045 R08: 0000000000406299 R09: 00000000fffffffd R10: 000000000153afa0 R11: 0000000000000293 R12: 00007fbb780008c0 R13: 00007fbb78000938 R14: 0000000000608b30 R15: 00007fbb780029c8 Allocated by task 1050: kasan_save_stack+0x1e/0x40 __kasan_kmalloc+0x81/0xa0 do_blk_trace_setup+0xcb/0x410 __blk_trace_setup+0xac/0x130 blk_trace_ioctl+0xe9/0x1c0 blkdev_ioctl+0xf1/0x390 __x64_sys_ioctl+0xa5/0xe0 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 1050: kasan_save_stack+0x1e/0x40 kasan_set_track+0x21/0x30 kasan_set_free_info+0x20/0x30 __kasan_slab_free+0x103/0x180 kfree+0x9a/0x4c0 __blk_trace_remove+0x53/0x70 blk_trace_ioctl+0x199/0x1c0 blkdev_common_ioctl+0x5e9/0xb30 blkdev_ioctl+0x1a5/0x390 __x64_sys_ioctl+0xa5/0xe0 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff88816912f380 which belongs to the cache kmalloc-96 of size 96 The buggy address is located 88 bytes inside of 96-byte region [ffff88816912f380, ffff88816912f3e0) The buggy address belongs to the page: page:000000009a1b4e7c refcount:1 mapcount:0 mapping:0000000000000000 index:0x0f flags: 0x17ffffc0000200(slab|node=0|zone=2|lastcpupid=0x1fffff) raw: 0017ffffc0000200 ffffea00044f1100 dead000000000002 ffff88810004c780 raw: 0000000000000000 0000000000200020 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88816912f280: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ffff88816912f300: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc >ffff88816912f380: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ^ ffff88816912f400: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ffff88816912f480: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ================================================================== Fixes: c0ea57608b69 ("blktrace: remove debugfs file dentries from struct blk_trace") Signed-off-by: Yu Kuai Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20220228034354.4047385-1-yukuai3@huawei.com Signed-off-by: Jens Axboe commit 9826e393e4a8c3df474e7f9eacd3087266f74005 Author: Miaoqian Lin Date: Fri Jan 7 08:09:11 2022 +0000 iommu/tegra-smmu: Fix missing put_device() call in tegra_smmu_find The reference taken by 'of_find_device_by_node()' must be released when not needed anymore. Add the corresponding 'put_device()' in the error handling path. Fixes: 765a9d1d02b2 ("iommu/tegra-smmu: Fix mc errors on tegra124-nyan") Signed-off-by: Miaoqian Lin Acked-by: Thierry Reding Link: https://lore.kernel.org/r/20220107080915.12686-1-linmq006@gmail.com Signed-off-by: Joerg Roedel commit b00833768e170a31af09268f7ab96aecfcca9623 Author: Adrian Huang Date: Mon Feb 21 13:33:48 2022 +0800 iommu/vt-d: Fix double list_add when enabling VMD in scalable mode When enabling VMD and IOMMU scalable mode, the following kernel panic call trace/kernel log is shown in Eagle Stream platform (Sapphire Rapids CPU) during booting: pci 0000:59:00.5: Adding to iommu group 42 ... vmd 0000:59:00.5: PCI host bridge to bus 10000:80 pci 10000:80:01.0: [8086:352a] type 01 class 0x060400 pci 10000:80:01.0: reg 0x10: [mem 0x00000000-0x0001ffff 64bit] pci 10000:80:01.0: enabling Extended Tags pci 10000:80:01.0: PME# supported from D0 D3hot D3cold pci 10000:80:01.0: DMAR: Setup RID2PASID failed pci 10000:80:01.0: Failed to add to iommu group 42: -16 pci 10000:80:03.0: [8086:352b] type 01 class 0x060400 pci 10000:80:03.0: reg 0x10: [mem 0x00000000-0x0001ffff 64bit] pci 10000:80:03.0: enabling Extended Tags pci 10000:80:03.0: PME# supported from D0 D3hot D3cold ------------[ cut here ]------------ kernel BUG at lib/list_debug.c:29! invalid opcode: 0000 [#1] PREEMPT SMP NOPTI CPU: 0 PID: 7 Comm: kworker/0:1 Not tainted 5.17.0-rc3+ #7 Hardware name: Lenovo ThinkSystem SR650V3/SB27A86647, BIOS ESE101Y-1.00 01/13/2022 Workqueue: events work_for_cpu_fn RIP: 0010:__list_add_valid.cold+0x26/0x3f Code: 9a 4a ab ff 4c 89 c1 48 c7 c7 40 0c d9 9e e8 b9 b1 fe ff 0f 0b 48 89 f2 4c 89 c1 48 89 fe 48 c7 c7 f0 0c d9 9e e8 a2 b1 fe ff <0f> 0b 48 89 d1 4c 89 c6 4c 89 ca 48 c7 c7 98 0c d9 9e e8 8b b1 fe RSP: 0000:ff5ad434865b3a40 EFLAGS: 00010246 RAX: 0000000000000058 RBX: ff4d61160b74b880 RCX: ff4d61255e1fffa8 RDX: 0000000000000000 RSI: 00000000fffeffff RDI: ffffffff9fd34f20 RBP: ff4d611d8e245c00 R08: 0000000000000000 R09: ff5ad434865b3888 R10: ff5ad434865b3880 R11: ff4d61257fdc6fe8 R12: ff4d61160b74b8a0 R13: ff4d61160b74b8a0 R14: ff4d611d8e245c10 R15: ff4d611d8001ba70 FS: 0000000000000000(0000) GS:ff4d611d5ea00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ff4d611fa1401000 CR3: 0000000aa0210001 CR4: 0000000000771ef0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe07f0 DR7: 0000000000000400 PKRU: 55555554 Call Trace: intel_pasid_alloc_table+0x9c/0x1d0 dmar_insert_one_dev_info+0x423/0x540 ? device_to_iommu+0x12d/0x2f0 intel_iommu_attach_device+0x116/0x290 __iommu_attach_device+0x1a/0x90 iommu_group_add_device+0x190/0x2c0 __iommu_probe_device+0x13e/0x250 iommu_probe_device+0x24/0x150 iommu_bus_notifier+0x69/0x90 blocking_notifier_call_chain+0x5a/0x80 device_add+0x3db/0x7b0 ? arch_memremap_can_ram_remap+0x19/0x50 ? memremap+0x75/0x140 pci_device_add+0x193/0x1d0 pci_scan_single_device+0xb9/0xf0 pci_scan_slot+0x4c/0x110 pci_scan_child_bus_extend+0x3a/0x290 vmd_enable_domain.constprop.0+0x63e/0x820 vmd_probe+0x163/0x190 local_pci_probe+0x42/0x80 work_for_cpu_fn+0x13/0x20 process_one_work+0x1e2/0x3b0 worker_thread+0x1c4/0x3a0 ? rescuer_thread+0x370/0x370 kthread+0xc7/0xf0 ? kthread_complete_and_exit+0x20/0x20 ret_from_fork+0x1f/0x30 Modules linked in: ---[ end trace 0000000000000000 ]--- ... Kernel panic - not syncing: Fatal exception Kernel Offset: 0x1ca00000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff) ---[ end Kernel panic - not syncing: Fatal exception ]--- The following 'lspci' output shows devices '10000:80:*' are subdevices of the VMD device 0000:59:00.5: $ lspci ... 0000:59:00.5 RAID bus controller: Intel Corporation Volume Management Device NVMe RAID Controller (rev 20) ... 10000:80:01.0 PCI bridge: Intel Corporation Device 352a (rev 03) 10000:80:03.0 PCI bridge: Intel Corporation Device 352b (rev 03) 10000:80:05.0 PCI bridge: Intel Corporation Device 352c (rev 03) 10000:80:07.0 PCI bridge: Intel Corporation Device 352d (rev 03) 10000:81:00.0 Non-Volatile memory controller: Intel Corporation NVMe Datacenter SSD [3DNAND, Beta Rock Controller] 10000:82:00.0 Non-Volatile memory controller: Intel Corporation NVMe Datacenter SSD [3DNAND, Beta Rock Controller] The symptom 'list_add double add' is caused by the following failure message: pci 10000:80:01.0: DMAR: Setup RID2PASID failed pci 10000:80:01.0: Failed to add to iommu group 42: -16 pci 10000:80:03.0: [8086:352b] type 01 class 0x060400 Device 10000:80:01.0 is the subdevice of the VMD device 0000:59:00.5, so invoking intel_pasid_alloc_table() gets the pasid_table of the VMD device 0000:59:00.5. Here is call path: intel_pasid_alloc_table pci_for_each_dma_alias get_alias_pasid_table search_pasid_table pci_real_dma_dev() in pci_for_each_dma_alias() gets the real dma device which is the VMD device 0000:59:00.5. However, pte of the VMD device 0000:59:00.5 has been configured during this message "pci 0000:59:00.5: Adding to iommu group 42". So, the status -EBUSY is returned when configuring pasid entry for device 10000:80:01.0. It then invokes dmar_remove_one_dev_info() to release 'struct device_domain_info *' from iommu_devinfo_cache. But, the pasid table is not released because of the following statement in __dmar_remove_one_dev_info(): if (info->dev && !dev_is_real_dma_subdevice(info->dev)) { ... intel_pasid_free_table(info->dev); } The subsequent dmar_insert_one_dev_info() operation of device 10000:80:03.0 allocates 'struct device_domain_info *' from iommu_devinfo_cache. The allocated address is the same address that is released previously for device 10000:80:01.0. Finally, invoking device_attach_pasid_table() causes the issue. `git bisect` points to the offending commit 474dd1c65064 ("iommu/vt-d: Fix clearing real DMA device's scalable-mode context entries"), which releases the pasid table if the device is not the subdevice by checking the returned status of dev_is_real_dma_subdevice(). Reverting the offending commit can work around the issue. The solution is to prevent from allocating pasid table if those devices are subdevices of the VMD device. Fixes: 474dd1c65064 ("iommu/vt-d: Fix clearing real DMA device's scalable-mode context entries") Cc: stable@vger.kernel.org # v5.14+ Signed-off-by: Adrian Huang Link: https://lore.kernel.org/r/20220216091307.703-1-adrianhuang0701@gmail.com Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20220221053348.262724-2-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit f0d2f15362f02444c5d7ffd5a5eb03e4aa54b685 Author: Rong Chen Date: Wed Feb 16 20:42:39 2022 +0800 mmc: meson: Fix usage of meson_mmc_post_req() Currently meson_mmc_post_req() is called in meson_mmc_request() right after meson_mmc_start_cmd(). This could lead to DMA unmapping before the request is actually finished. To fix, don't call meson_mmc_post_req() until meson_mmc_request_done(). Signed-off-by: Rong Chen Reviewed-by: Kevin Hilman Fixes: 79ed05e329c3 ("mmc: meson-gx: add support for descriptor chain mode") Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220216124239.4007667-1-rong.chen@amlogic.com Signed-off-by: Ulf Hansson commit 08783aa7693f55619859f4f63f384abf17cb58c5 Author: Ville Syrjälä Date: Thu Feb 24 15:21:42 2022 +0200 drm/i915: s/JSP2/ICP2/ PCH This JSP2 PCH actually seems to be some special Apple specific ICP variant rather than a JSP. Make it so. Or at least all the references to it seem to be some Apple ICL machines. Didn't manage to find these PCI IDs in any public chipset docs unfortunately. The only thing we're losing here with this JSP->ICP change is Wa_14011294188, but based on the HSD that isn't actually needed on any ICP based design (including JSP), only TGP based stuff (including MCC) really need it. The documented w/a just never made that distinction because Windows didn't want to differentiate between JSP and MCC (not sure how they handle hpd/ddc/etc. then though...). Cc: stable@vger.kernel.org Cc: Matt Roper Cc: Vivek Kasireddy Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/4226 Fixes: 943682e3bd19 ("drm/i915: Introduce Jasper Lake PCH") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220224132142.12927-1-ville.syrjala@linux.intel.com Acked-by: Vivek Kasireddy Tested-by: Tomas Bzatek (cherry picked from commit 53581504a8e216d435f114a4f2596ad0dfd902fc) Signed-off-by: Tvrtko Ursulin commit 1b279f6ad467535c3b8a66b4edefaca2cdd5bdc3 Author: Vinay Belgaumkar Date: Wed Feb 16 10:15:04 2022 -0800 drm/i915/guc/slpc: Correct the param count for unset param SLPC unset param H2G only needs one parameter - the id of the param. Fixes: 025cb07bebfa ("drm/i915/guc/slpc: Cache platform frequency limits") Suggested-by: Umesh Nerlige Ramappa Signed-off-by: Vinay Belgaumkar Reviewed-by: Umesh Nerlige Ramappa Signed-off-by: Ramalingam C Link: https://patchwork.freedesktop.org/patch/msgid/20220216181504.7155-1-vinay.belgaumkar@intel.com (cherry picked from commit 9648f1c3739505557d94ff749a4f32192ea81fe3) Signed-off-by: Tvrtko Ursulin commit caef14b7530c065fb85d54492768fa48fdb5093e Author: Alex Elder Date: Fri Feb 25 14:15:30 2022 -0600 net: ipa: fix a build dependency An IPA build problem arose in the linux-next tree the other day. The problem is that a recent commit adds a new dependency on some code, and the Kconfig file for IPA doesn't reflect that dependency. As a result, some configurations can fail to build (particularly when COMPILE_TEST is enabled). The recent patch adds calls to qmp_get(), qmp_put(), and qmp_send(), and those are built based on the QCOM_AOSS_QMP config option. If that symbol is not defined, stubs are defined, so we just need to ensure QCOM_AOSS_QMP is compatible with QCOM_IPA, or it's not defined. Reported-by: Randy Dunlap Fixes: 34a081761e4e3 ("net: ipa: request IPA register values be retained") Signed-off-by: Alex Elder Tested-by: Randy Dunlap Acked-by: Randy Dunlap Signed-off-by: David S. Miller commit d4e26aaea7f82ba884dcb4acfe689406bc092dc3 Author: Jia-Ju Bai Date: Fri Feb 25 04:52:30 2022 -0800 atm: firestream: check the return value of ioremap() in fs_init() The function ioremap() in fs_init() can fail, so its return value should be checked. Reported-by: TOTE Robot Signed-off-by: Jia-Ju Bai Signed-off-by: David S. Miller commit 90d4025285748448809701a44cf466a3f5443eaa Author: Casper Andersson Date: Fri Feb 25 13:43:27 2022 +0100 net: sparx5: Add #include to remove warning main.h uses NUM_TARGETS from main_regs.h, but the missing include never causes any errors because everywhere main.h is (currently) included, main_regs.h is included before. But since it is dependent on main_regs.h it should always be included. Signed-off-by: Casper Andersson Reviewed-by: Joacim Zetterling Signed-off-by: David S. Miller commit 4d08b7b57ece83a1c31c633a7e4e27f121157f9c Author: Tony Lu Date: Fri Feb 25 14:56:57 2022 +0800 net/smc: Fix cleanup when register ULP fails This patch calls smc_ib_unregister_client() when tcp_register_ulp() fails, and make sure to clean it up. Fixes: d7cd421da9da ("net/smc: Introduce TCP ULP support") Signed-off-by: Tony Lu Signed-off-by: David S. Miller commit 32568ae37596b529628ac09b875f4874e614f63f Author: Nícolas F. R. A. Prado Date: Mon Feb 14 15:05:07 2022 -0500 arm64: dts: mt8183: jacuzzi: Fix bus properties in anx's DSI endpoint mt8183-kukui-jacuzzi has an anx7625 bridge connected to the output of its DSI host. However, after commit fd0310b6fe7d ("drm/bridge: anx7625: add MIPI DPI input feature"), a bus-type property started being required in the endpoint node by the driver to indicate whether it is DSI or DPI. Add the missing bus-type property and set it to 5 (V4L2_FWNODE_BUS_TYPE_PARALLEL) so that the driver has its input configured to DSI and the display pipeline can probe correctly. While at it, also set the data-lanes property that was also introduced in that same commit, so that we don't rely on the default value. Fixes: fd0310b6fe7d ("drm/bridge: anx7625: add MIPI DPI input feature") Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Nícolas F. R. A. Prado Link: https://lore.kernel.org/r/20220214200507.2500693-1-nfraprado@collabora.com Signed-off-by: Matthias Brugger commit 9995b408f17ff8c7f11bc725c8aa225ba3a63b1c Author: j.nixdorf@avm.de Date: Thu Feb 24 10:06:49 2022 +0100 net: ipv6: ensure we call ipv6_mc_down() at most once There are two reasons for addrconf_notify() to be called with NETDEV_DOWN: either the network device is actually going down, or IPv6 was disabled on the interface. If either of them stays down while the other is toggled, we repeatedly call the code for NETDEV_DOWN, including ipv6_mc_down(), while never calling the corresponding ipv6_mc_up() in between. This will cause a new entry in idev->mc_tomb to be allocated for each multicast group the interface is subscribed to, which in turn leaks one struct ifmcaddr6 per nontrivial multicast group the interface is subscribed to. The following reproducer will leak at least $n objects: ip addr add ff2e::4242/32 dev eth0 autojoin sysctl -w net.ipv6.conf.eth0.disable_ipv6=1 for i in $(seq 1 $n); do ip link set up eth0; ip link set down eth0 done Joining groups with IPV6_ADD_MEMBERSHIP (unprivileged) or setting the sysctl net.ipv6.conf.eth0.forwarding to 1 (=> subscribing to ff02::2) can also be used to create a nontrivial idev->mc_list, which will the leak objects with the right up-down-sequence. Based on both sources for NETDEV_DOWN events the interface IPv6 state should be considered: - not ready if the network interface is not ready OR IPv6 is disabled for it - ready if the network interface is ready AND IPv6 is enabled for it The functions ipv6_mc_up() and ipv6_down() should only be run when this state changes. Implement this by remembering when the IPv6 state is ready, and only run ipv6_mc_down() if it actually changed from ready to not ready. The other direction (not ready -> ready) already works correctly, as: - the interface notification triggered codepath for NETDEV_UP / NETDEV_CHANGE returns early if ipv6 is disabled, and - the disable_ipv6=0 triggered codepath skips fully initializing the interface as long as addrconf_link_ready(dev) returns false - calling ipv6_mc_up() repeatedly does not leak anything Fixes: 3ce62a84d53c ("ipv6: exit early in addrconf_notify() if IPv6 is disabled") Signed-off-by: Johannes Nixdorf Signed-off-by: David S. Miller commit 258dd902022cb10c83671176688074879517fd21 Author: Jann Horn Date: Fri Feb 18 19:05:59 2022 +0100 efivars: Respect "block" flag in efivar_entry_set_safe() When the "block" flag is false, the old code would sometimes still call check_var_size(), which wrongly tells ->query_variable_store() that it can block. As far as I can tell, this can't really materialize as a bug at the moment, because ->query_variable_store only does something on X86 with generic EFI, and in that configuration we always take the efivar_entry_set_nonblocking() path. Fixes: ca0e30dcaa53 ("efi: Add nonblocking option to efi_query_variable_store()") Signed-off-by: Jann Horn Signed-off-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20220218180559.1432559-1-jannh@google.com commit dcf0c838854c86e1f41fb1934aea906845d69782 Author: Sunil V L Date: Fri Jan 28 10:20:04 2022 +0530 riscv/efi_stub: Fix get_boot_hartid_from_fdt() return value The get_boot_hartid_from_fdt() function currently returns U32_MAX for failure case which is not correct because U32_MAX is a valid hartid value. This patch fixes the issue by returning error code. Cc: Fixes: d7071743db31 ("RISC-V: Add EFI stub support.") Signed-off-by: Sunil V L Reviewed-by: Heinrich Schuchardt Signed-off-by: Ard Biesheuvel commit ba115adf61b36b8c167126425a62b0efc23f72c0 Author: David Gow Date: Sun Feb 27 21:00:10 2022 -0800 Input: samsung-keypad - properly state IOMEM dependency Make the samsung-keypad driver explicitly depend on CONFIG_HAS_IOMEM, as it calls devm_ioremap(). This prevents compile errors in some configs (e.g, allyesconfig/randconfig under UML): /usr/bin/ld: drivers/input/keyboard/samsung-keypad.o: in function `samsung_keypad_probe': samsung-keypad.c:(.text+0xc60): undefined reference to `devm_ioremap' Signed-off-by: David Gow Acked-by: anton ivanov Link: https://lore.kernel.org/r/20220225041727.1902850-1-davidgow@google.com Signed-off-by: Dmitry Torokhov commit e7c470a4b543375d50d88a4c5abd4b9e0f5adcea Merge: 7e57714cd0ad2 4188db23285e2 Author: Dave Airlie Date: Mon Feb 28 14:05:39 2022 +1000 Merge tag 'exynos-drm-fixes-v5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-fixes Fixups - Make display controller drivers for Exynos series to use platform_get_irq and platform_get_irq_byname functions to get the interrupt, which prevents irq chaning from messed up when using hierarchical interrupt domains which use "interrupts" property in the node. - Fix two regressions to TE-gpio handling. Signed-off-by: Dave Airlie From: Inki Dae Link: https://patchwork.freedesktop.org/patch/msgid/20220225014042.17637-1-inki.dae@samsung.com commit 7e57714cd0ad2d5bb90e50b5096a0e671dec1ef3 Author: Linus Torvalds Date: Sun Feb 27 14:36:33 2022 -0800 Linux 5.17-rc6 commit 52a02554673122486ecb36c36387d91cf9544986 Merge: 98f3e84f8df66 ba1366f3d039e Author: Linus Torvalds Date: Sun Feb 27 13:07:40 2022 -0800 Merge tag 'irq-urgent-2022-02-27' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull irq fix from Thomas Gleixner: "A single fix for a regression caused by the recent PCI/MSI rework which resulted in a recursive locking problem in the VMD driver. The cure is to cache the relevant information upfront instead of retrieving it at runtime" * tag 'irq-urgent-2022-02-27' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: PCI: vmd: Prevent recursive locking on interrupt allocation commit 98f3e84f8df66f1ac9d04b6d8093993c9bfd69e6 Merge: 6676ba2a6df68 ddbd89deb7d32 Author: Linus Torvalds Date: Sun Feb 27 12:42:37 2022 -0800 Merge tag 'dma-mapping-5.17-1' of git://git.infradead.org/users/hch/dma-mapping Pull dma-mapping fix from Christoph Hellwig: - fix a swiotlb info leak (Halil Pasic) * tag 'dma-mapping-5.17-1' of git://git.infradead.org/users/hch/dma-mapping: swiotlb: fix info leak with DMA_FROM_DEVICE commit 6676ba2a6df6864a6b7b11f20166026e2201b627 Merge: 2293be58d6a18 486c2d15aa812 Author: Linus Torvalds Date: Sun Feb 27 12:30:54 2022 -0800 Merge tag 'pinctrl-v5-17-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Pull pin control fixes from Linus Walleij: - Fix some drive strength and pull-up code in the K210 driver. - Add the Alder Lake-M ACPI ID so it starts to work properly. - Use a static name for the StarFive GPIO irq_chip, forestalling an upcoming fixes series from Marc Zyngier. - Fix an ages old bug in the Tegra 186 driver where we were indexing at random into struct and being lucky getting the right member. * tag 'pinctrl-v5-17-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: gpio: tegra186: Fix chip_data type confusion pinctrl: starfive: Use a static name for the GPIO irq_chip pinctrl: tigerlake: Revert "Add Alder Lake-M ACPI ID" pinctrl: k210: Fix bias-pull-up pinctrl: fix loop in k210_pinconf_get_drive() commit 2293be58d6a18cab800e25e42081bacb75c05752 Merge: e41898d2ba51e 90f59ee41abf5 Author: Linus Torvalds Date: Sat Feb 26 12:10:17 2022 -0800 Merge tag 'trace-v5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing fixes from Steven Rostedt: - rtla (Real-Time Linux Analysis tool): - fix typo in man page - Update API -e to -E before it is released - Error message fix and memory leak fix - Partially uninline trace event soft disable to shrink text - Fix function graph start up test - Have triggers affect the trace instance they are in and not top level - Have osnoise sleep in the units it says it uses - Remove unused ftrace stub function - Remove event probe redundant info from event in the buffer - Fix group ownership setting in tracefs - Ensure trace buffer is minimum size to prevent crashes * tag 'trace-v5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: rtla/osnoise: Fix error message when failing to enable trace instance rtla/osnoise: Free params at the exit rtla/hist: Make -E the short version of --entries tracing: Fix selftest config check for function graph start up test tracefs: Set the group ownership in apply_options() not parse_options() tracing/osnoise: Make osnoise_main to sleep for microseconds ftrace: Remove unused ftrace_startup_enable() stub tracing: Ensure trace buffer is at least 4096 bytes large tracing: Uninline trace_trigger_soft_disabled() partly eprobes: Remove redundant event type information tracing: Have traceon and traceoff trigger honor the instance tracing: Dump stacktrace trigger to the corresponding instance rtla: Fix systme -> system typo on man page commit e41898d2ba51ef2e8e81fb905c1eaa958aec830a Merge: 086ee11b0384c c94afc46cae7a Author: Linus Torvalds Date: Sat Feb 26 12:00:44 2022 -0800 Merge tag 'fixes-2022-02-26' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock Pull memblock fix from Mike Rapoport: "Use kfree() to release kmalloced memblock regions memblock.{reserved,memory}.regions may be allocated using kmalloc() in memblock_double_array(). Use kfree() to release these kmalloced regions" * tag 'fixes-2022-02-26' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock: memblock: use kfree() to release kmalloced memblock regions commit 086ee11b0384c5ee837a46fac36e38189717960b Merge: 2c8c230edab57 fda153c89af34 Author: Linus Torvalds Date: Sat Feb 26 11:52:14 2022 -0800 Merge branch 'akpm' (patches from Andrew) Merge misc fixes from Andrew Morton: "12 patches. Subsystems affected by this patch series: MAINTAINERS, mailmap, memfd, and mm (hugetlb, kasan, hugetlbfs, pagemap, selftests, memcg, and slab)" * emailed patches from Andrew Morton : selftests/memfd: clean up mapping in mfd_fail_write mailmap: update Roman Gushchin's email MAINTAINERS, SLAB: add Roman as reviewer, git tree MAINTAINERS: add Shakeel as a memcg co-maintainer MAINTAINERS: remove Vladimir from memcg maintainers MAINTAINERS: add Roman as a memcg co-maintainer selftest/vm: fix map_fixed_noreplace test failure mm: fix use-after-free bug when mm->mmap is reused after being freed hugetlbfs: fix a truncation issue in hugepages parameter kasan: test: prevent cache merging in kmem_cache_double_destroy mm/hugetlb: fix kernel crash with hugetlb mremap MAINTAINERS: add sysctl-next git tree commit 2c8c230edab57eae6d2e8df7239ef121a45a1443 Merge: 3bd9dd813820a 22e2100b1b07d Author: Linus Torvalds Date: Sat Feb 26 10:26:24 2022 -0800 Merge tag 'riscv-for-linus-5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull RISC-V fixes from Palmer Dabbelt: - A fix for the K210 sdcard defconfig, to avoid using a fixed delay for the root FS - A fix to make sure there's a proper call frame for trace_hardirqs_{on,off}(). * tag 'riscv-for-linus-5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: riscv: fix oops caused by irqsoff latency tracer riscv: fix nommu_k210_sdcard_defconfig commit 3bd9dd813820a258fdd7df5444b550b2b1a71db6 Merge: 9137eda53752e b97cca3ba9098 Author: Linus Torvalds Date: Sat Feb 26 09:53:19 2022 -0800 Merge tag 'xfs-5.17-fixes-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull xfs fixes from Darrick Wong: "Nothing exciting, just more fixes for not returning sync_filesystem error values (and eliding it when it's not necessary). Summary: - Only call sync_filesystem when we're remounting the filesystem readonly readonly, and actually check its return value" * tag 'xfs-5.17-fixes-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: xfs: only bother with sync_filesystem during readonly remount commit fda153c89af344d21df281009a9d046cf587ea0f Author: Mike Kravetz Date: Fri Feb 25 19:11:26 2022 -0800 selftests/memfd: clean up mapping in mfd_fail_write Running the memfd script ./run_hugetlbfs_test.sh will often end in error as follows: memfd-hugetlb: CREATE memfd-hugetlb: BASIC memfd-hugetlb: SEAL-WRITE memfd-hugetlb: SEAL-FUTURE-WRITE memfd-hugetlb: SEAL-SHRINK fallocate(ALLOC) failed: No space left on device ./run_hugetlbfs_test.sh: line 60: 166855 Aborted (core dumped) ./memfd_test hugetlbfs opening: ./mnt/memfd fuse: DONE If no hugetlb pages have been preallocated, run_hugetlbfs_test.sh will allocate 'just enough' pages to run the test. In the SEAL-FUTURE-WRITE test the mfd_fail_write routine maps the file, but does not unmap. As a result, two hugetlb pages remain reserved for the mapping. When the fallocate call in the SEAL-SHRINK test attempts allocate all hugetlb pages, it is short by the two reserved pages. Fix by making sure to unmap in mfd_fail_write. Link: https://lkml.kernel.org/r/20220219004340.56478-1-mike.kravetz@oracle.com Signed-off-by: Mike Kravetz Cc: Joel Fernandes Cc: Shuah Khan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 9502bdbf34e4ffe865d144fe4218eb64602a75bd Author: Roman Gushchin Date: Fri Feb 25 19:11:23 2022 -0800 mailmap: update Roman Gushchin's email I'm moving to a @linux.dev account. Map my old addresses. Link: https://lkml.kernel.org/r/20220221200006.416377-1-roman.gushchin@linux.dev Signed-off-by: Roman Gushchin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 7b0112f3432915fd6ac68ddd61bc4bcd1ac2505d Author: Vlastimil Babka Date: Fri Feb 25 19:11:20 2022 -0800 MAINTAINERS, SLAB: add Roman as reviewer, git tree The slab code has an overlap with kmem accounting, where Roman has done a lot of work recently and it would be useful to make sure he's CC'd on patches that potentially affect it. Thus add him as a reviewer for the SLAB subsystem. Also while at it, add the link to slab git tree. Link: https://lkml.kernel.org/r/20220222103104.13241-1-vbabka@suse.cz Signed-off-by: Vlastimil Babka Acked-by: David Rientjes Acked-by: Roman Gushchin Cc: Christoph Lameter Cc: Pekka Enberg Cc: Joonsoo Kim Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit bb9d5454992322a0b793c655e1d860a54a38a3d3 Author: Shakeel Butt Date: Fri Feb 25 19:11:17 2022 -0800 MAINTAINERS: add Shakeel as a memcg co-maintainer I have been contributing and reviewing to the memcg codebase for last couple of years. So, making it official. Link: https://lkml.kernel.org/r/20220224060148.4092228-1-shakeelb@google.com Signed-off-by: Shakeel Butt Acked-by: Roman Gushchin Acked-by: Michal Hocko Cc: Johannes Weiner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 0a972e72e2f9630b10bf6b7b5e08312e87eb6854 Author: Vladimir Davydov Date: Fri Feb 25 19:11:14 2022 -0800 MAINTAINERS: remove Vladimir from memcg maintainers Link: https://lkml.kernel.org/r/4ad1f8da49d7b71c84a0c15bd5347f5ce704e730.1645608825.git.vdavydov.dev@gmail.com Signed-off-by: Vladimir Davydov Acked-by: Johannes Weiner Acked-by: Michal Hocko Cc: Roman Gushchin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 7d547dcf97f275e9f507c8099e168ed682fe1257 Author: Roman Gushchin Date: Fri Feb 25 19:11:11 2022 -0800 MAINTAINERS: add Roman as a memcg co-maintainer Add myself as a memcg co-maintainer. My primary focus over last few years was the kernel memory accounting stack, but I do work on some other parts of the memory controller as well. Link: https://lkml.kernel.org/r/20220221233951.659048-1-roman.gushchin@linux.dev Signed-off-by: Roman Gushchin Acked-by: Michal Hocko Acked-by: Johannes Weiner Acked-by: Vlastimil Babka Cc: Vladimir Davydov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit f39c58008dee7ab5fc94c3f1995a21e886801df0 Author: Aneesh Kumar K.V Date: Fri Feb 25 19:11:08 2022 -0800 selftest/vm: fix map_fixed_noreplace test failure On the latest RHEL the test fails due to executable mapped at 256MB address # ./map_fixed_noreplace mmap() @ 0x10000000-0x10050000 p=0xffffffffffffffff result=File exists 10000000-10010000 r-xp 00000000 fd:04 34905657 /root/rpmbuild/BUILD/kernel-5.14.0-56.el9/linux-5.14.0-56.el9.ppc64le/tools/testing/selftests/vm/map_fixed_noreplace 10010000-10020000 r--p 00000000 fd:04 34905657 /root/rpmbuild/BUILD/kernel-5.14.0-56.el9/linux-5.14.0-56.el9.ppc64le/tools/testing/selftests/vm/map_fixed_noreplace 10020000-10030000 rw-p 00010000 fd:04 34905657 /root/rpmbuild/BUILD/kernel-5.14.0-56.el9/linux-5.14.0-56.el9.ppc64le/tools/testing/selftests/vm/map_fixed_noreplace 10029b90000-10029bc0000 rw-p 00000000 00:00 0 [heap] 7fffbb510000-7fffbb750000 r-xp 00000000 fd:04 24534 /usr/lib64/libc.so.6 7fffbb750000-7fffbb760000 r--p 00230000 fd:04 24534 /usr/lib64/libc.so.6 7fffbb760000-7fffbb770000 rw-p 00240000 fd:04 24534 /usr/lib64/libc.so.6 7fffbb780000-7fffbb7a0000 r--p 00000000 00:00 0 [vvar] 7fffbb7a0000-7fffbb7b0000 r-xp 00000000 00:00 0 [vdso] 7fffbb7b0000-7fffbb800000 r-xp 00000000 fd:04 24514 /usr/lib64/ld64.so.2 7fffbb800000-7fffbb810000 r--p 00040000 fd:04 24514 /usr/lib64/ld64.so.2 7fffbb810000-7fffbb820000 rw-p 00050000 fd:04 24514 /usr/lib64/ld64.so.2 7fffd93f0000-7fffd9420000 rw-p 00000000 00:00 0 [stack] Error: couldn't map the space we need for the test Fix this by finding a free address using mmap instead of hardcoding BASE_ADDRESS. Link: https://lkml.kernel.org/r/20220217083417.373823-1-aneesh.kumar@linux.ibm.com Signed-off-by: Aneesh Kumar K.V Cc: Michael Ellerman Cc: Jann Horn Cc: Shuah Khan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit f798a1d4f94de9510e060d37b9b47721065a957c Author: Suren Baghdasaryan Date: Fri Feb 25 19:11:05 2022 -0800 mm: fix use-after-free bug when mm->mmap is reused after being freed oom reaping (__oom_reap_task_mm) relies on a 2 way synchronization with exit_mmap. First it relies on the mmap_lock to exclude from unlock path[1], page tables tear down (free_pgtables) and vma destruction. This alone is not sufficient because mm->mmap is never reset. For historical reasons[2] the lock is taken there is also MMF_OOM_SKIP set for oom victims before. The oom reaper only ever looks at oom victims so the whole scheme works properly but process_mrelease can opearate on any task (with fatal signals pending) which doesn't really imply oom victims. That means that the MMF_OOM_SKIP part of the synchronization doesn't work and it can see a task after the whole address space has been demolished and traverse an already released mm->mmap list. This leads to use after free as properly caught up by KASAN report. Fix the issue by reseting mm->mmap so that MMF_OOM_SKIP synchronization is not needed anymore. The MMF_OOM_SKIP is not removed from exit_mmap yet but it acts mostly as an optimization now. [1] 27ae357fa82b ("mm, oom: fix concurrent munlock and oom reaper unmap, v3") [2] 212925802454 ("mm: oom: let oom_reap_task and exit_mmap run concurrently") [mhocko@suse.com: changelog rewrite] Link: https://lore.kernel.org/all/00000000000072ef2c05d7f81950@google.com/ Link: https://lkml.kernel.org/r/20220215201922.1908156-1-surenb@google.com Fixes: 64591e8605d6 ("mm: protect free_pgtables with mmap_lock write lock in exit_mmap") Signed-off-by: Suren Baghdasaryan Reported-by: syzbot+2ccf63a4bd07cf39cab0@syzkaller.appspotmail.com Suggested-by: Michal Hocko Reviewed-by: Rik van Riel Reviewed-by: Yang Shi Acked-by: Michal Hocko Cc: David Rientjes Cc: Matthew Wilcox Cc: Johannes Weiner Cc: Roman Gushchin Cc: Rik van Riel Cc: Minchan Kim Cc: Kirill A. Shutemov Cc: Andrea Arcangeli 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 Cc: Tim Murray Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e79ce9832316e09529b212a21278d68240ccbf1f Author: Liu Yuntao Date: Fri Feb 25 19:11:02 2022 -0800 hugetlbfs: fix a truncation issue in hugepages parameter When we specify a large number for node in hugepages parameter, it may be parsed to another number due to truncation in this statement: node = tmp; For example, add following parameter in command line: hugepagesz=1G hugepages=4294967297:5 and kernel will allocate 5 hugepages for node 1 instead of ignoring it. I move the validation check earlier to fix this issue, and slightly simplifies the condition here. Link: https://lkml.kernel.org/r/20220209134018.8242-1-liuyuntao10@huawei.com Fixes: b5389086ad7be0 ("hugetlbfs: extend the definition of hugepages parameter to support node allocation") Signed-off-by: Liu Yuntao Reviewed-by: Mike Kravetz Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 70effdc3756c924f4a2b6af1ec4e2e92e18e1b45 Author: Andrey Konovalov Date: Fri Feb 25 19:10:59 2022 -0800 kasan: test: prevent cache merging in kmem_cache_double_destroy With HW_TAGS KASAN and kasan.stacktrace=off, the cache created in the kmem_cache_double_destroy() test might get merged with an existing one. Thus, the first kmem_cache_destroy() call won't actually destroy it but will only decrease the refcount. This causes the test to fail. Provide an empty constructor for the created cache to prevent the cache from getting merged. Link: https://lkml.kernel.org/r/b597bd434c49591d8af00ee3993a42c609dc9a59.1644346040.git.andreyknvl@google.com Fixes: f98f966cd750 ("kasan: test: add test case for double-kmem_cache_destroy()") Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Dmitry Vyukov Cc: Andrey Ryabinin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit db110a99d3367936058727ff4798e3a39c707969 Author: Aneesh Kumar K.V Date: Fri Feb 25 19:10:56 2022 -0800 mm/hugetlb: fix kernel crash with hugetlb mremap This fixes the below crash: kernel BUG at include/linux/mm.h:2373! cpu 0x5d: Vector: 700 (Program Check) at [c00000003c6e76e0] pc: c000000000581a54: pmd_to_page+0x54/0x80 lr: c00000000058d184: move_hugetlb_page_tables+0x4e4/0x5b0 sp: c00000003c6e7980 msr: 9000000000029033 current = 0xc00000003bd8d980 paca = 0xc000200fff610100 irqmask: 0x03 irq_happened: 0x01 pid = 9349, comm = hugepage-mremap kernel BUG at include/linux/mm.h:2373! move_hugetlb_page_tables+0x4e4/0x5b0 (link register) move_hugetlb_page_tables+0x22c/0x5b0 (unreliable) move_page_tables+0xdbc/0x1010 move_vma+0x254/0x5f0 sys_mremap+0x7c0/0x900 system_call_exception+0x160/0x2c0 the kernel can't use huge_pte_offset before it set the pte entry because a page table lookup check for huge PTE bit in the page table to differentiate between a huge pte entry and a pointer to pte page. A huge_pte_alloc won't mark the page table entry huge and hence kernel should not use huge_pte_offset after a huge_pte_alloc. Link: https://lkml.kernel.org/r/20220211063221.99293-1-aneesh.kumar@linux.ibm.com Fixes: 550a7d60bd5e ("mm, hugepages: add mremap() support for hugepage backed vma") Signed-off-by: Aneesh Kumar K.V Reviewed-by: Mike Kravetz Reviewed-by: Mina Almasry Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit bbcf7b0e2e4b8376ef4b401777f2852302c745e3 Author: Luis Chamberlain Date: Fri Feb 25 19:10:53 2022 -0800 MAINTAINERS: add sysctl-next git tree Add a git tree for sysctls as there's been quite a bit of work lately to remove all the syctls out of kernel/sysctl.c and move to their respective places, so coordination has been needed to avoid conflicts. This tree will also help soak these changes on linux-next prior to getting to Linus. Link: https://lkml.kernel.org/r/20220218182736.3694508-1-mcgrof@kernel.org Signed-off-by: Luis Chamberlain Cc: Kees Cook Cc: Iurii Zaikin Cc: Stephen Rothwell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 519ca6fa960587d02904a9f8f79d587ac874fb03 Merge: 328e765c03737 14756b2ae265d Author: David S. Miller Date: Sat Feb 26 12:50:20 2022 +0000 Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2022-02-25 This series contains updates to iavf driver only. Slawomir fixes stability issues that can be seen when stressing the driver using a large number of VFs with a multitude of operations. Among the fixes are reworking mutexes to provide more effective locking, ensuring initialization is complete before teardown, preventing operations which could race while removing the driver, stopping certain tasks from being queued when the device is down, and adding a missing mutex unlock. ==================== Signed-off-by: David S. Miller commit 90f59ee41abf587ad4675a70434136c8707fdf4b Author: Daniel Bristot de Oliveira Date: Fri Feb 18 18:57:09 2022 +0100 rtla/osnoise: Fix error message when failing to enable trace instance When a trace instance creation fails, tools are printing: Could not enable -> osnoiser <- tracer for tracing Print the actual (and correct) name of the tracer it fails to enable. Link: https://lkml.kernel.org/r/53ef0582605af91eca14b19dba9fc9febb95d4f9.1645206561.git.bristot@kernel.org Fixes: b1696371d865 ("rtla: Helper functions for rtla") Cc: Jonathan Corbet Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) commit 316f710172461c501f9b73f3b2fc7ce8aa5b84a5 Author: Daniel Bristot de Oliveira Date: Fri Feb 18 18:57:08 2022 +0100 rtla/osnoise: Free params at the exit The variable that stores the parsed command line arguments are not being free()d at the rtla osnoise top exit path. Free params variable before exiting. Link: https://lkml.kernel.org/r/0be31d8259c7c53b98a39769d60cfeecd8421785.1645206561.git.bristot@kernel.org Fixes: 1eceb2fc2ca5 ("rtla/osnoise: Add osnoise top mode") Cc: Jonathan Corbet Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) commit dd48f316a1216fa10f9ba26852457794417d9bc6 Author: Daniel Bristot de Oliveira Date: Fri Feb 18 18:57:07 2022 +0100 rtla/hist: Make -E the short version of --entries Currently, --entries uses -e as the short version in the hist mode of timerlat and osnoise tools. But as -e is already used to enable events on trace sessions by other tools, thus let's keep it available for the same usage for all rtla tools. Make -E the short version of --entries for hist mode on all tools. Note: rtla was merged in this merge window, so rtla was not released yet. Link: https://lkml.kernel.org/r/5dbf0cbe7364d3a05e708926b41a097c59a02b1e.1645206561.git.bristot@kernel.org Cc: Jonathan Corbet Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) commit c5229a0bd47814770c895e94fbc97ad21819abfe Author: Christophe Leroy Date: Mon Dec 20 16:38:06 2021 +0000 tracing: Fix selftest config check for function graph start up test CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS is required to test direct tramp. Link: https://lkml.kernel.org/r/bdc7e594e13b0891c1d61bc8d56c94b1890eaed7.1640017960.git.christophe.leroy@csgroup.eu Signed-off-by: Christophe Leroy Signed-off-by: Steven Rostedt (Google) commit 851e99ebeec3f4a672bb5010cf1ece095acee447 Author: Steven Rostedt (Google) Date: Fri Feb 25 15:34:26 2022 -0500 tracefs: Set the group ownership in apply_options() not parse_options() Al Viro brought it to my attention that the dentries may not be filled when the parse_options() is called, causing the call to set_gid() to possibly crash. It should only be called if parse_options() succeeds totally anyway. He suggested the logical place to do the update is in apply_options(). Link: https://lore.kernel.org/all/20220225165219.737025658@goodmis.org/ Link: https://lkml.kernel.org/r/20220225153426.1c4cab6b@gandalf.local.home Cc: stable@vger.kernel.org Acked-by: Al Viro Reported-by: Al Viro Fixes: 48b27b6b5191 ("tracefs: Set all files to the same group ownership as the mount option") Signed-off-by: Steven Rostedt (Google) commit 328e765c03737ec36d0cc9eabc445fc605070ef6 Merge: e01b042e580f1 c5048a7b2c23a Author: Jakub Kicinski Date: Fri Feb 25 14:53:58 2022 -0800 Merge tag 'linux-can-fixes-for-5.17-20220225' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can Marc Kleine-Budde says: ==================== pull-request: can 2022-02-25 The first 2 patches are by Vincent Mailhol and fix the error handling of the ndo_open callbacks of the etas_es58x and the gs_usb CAN USB drivers. The last patch is by Lad Prabhakar and fixes a small race condition in the rcar_canfd's rcar_canfd_channel_probe() function. * tag 'linux-can-fixes-for-5.17-20220225' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can: can: rcar_canfd: rcar_canfd_channel_probe(): register the CAN device when fully ready can: gs_usb: change active_channels's type from atomic_t to u8 can: etas_es58x: change opened_channel_cnt's type from atomic_t to u8 ==================== Link: https://lore.kernel.org/r/20220225165622.3231809-1-mkl@pengutronix.de Signed-off-by: Jakub Kicinski commit 9137eda53752ef73148e42b0d7640a00f1bc96b1 Merge: c0419188b5c1a 84ec758fb2daa Author: Linus Torvalds Date: Fri Feb 25 14:12:36 2022 -0800 Merge tag 'configfs-5.17-2022-02-25' of git://git.infradead.org/users/hch/configfs Pull configfs fix from Christoph Hellwig: - fix a race in configfs_{,un}register_subsystem (ChenXiaoSong) * tag 'configfs-5.17-2022-02-25' of git://git.infradead.org/users/hch/configfs: configfs: fix a race in configfs_{,un}register_subsystem() commit c0419188b5c1a7735b12cf1405cafc3f8d722819 Merge: ca7457236d47d 558732df21220 Author: Linus Torvalds Date: Fri Feb 25 14:08:03 2022 -0800 Merge tag 'for-5.17-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs fixes from David Sterba: "This is a hopefully last batch of fixes for defrag that got broken in 5.16, all stable material. The remaining reported problem is excessive IO with autodefrag due to various conditions in the defrag code not met or missing" * tag 'for-5.17-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: btrfs: reduce extent threshold for autodefrag btrfs: autodefrag: only scan one inode once btrfs: defrag: don't use merged extent map for their generation check btrfs: defrag: bring back the old file extent search behavior btrfs: defrag: remove an ambiguous condition for rejection btrfs: defrag: don't defrag extents which are already at max capacity btrfs: defrag: don't try to merge regular extents with preallocated extents btrfs: defrag: allow defrag_one_cluster() to skip large extent which is not a target btrfs: prevent copying too big compressed lzo segment commit ca7457236d47d8748bdb6b423d148726220ec3d8 Merge: 115ccd2278cca 22e9f71072fa6 Author: Linus Torvalds Date: Fri Feb 25 13:34:30 2022 -0800 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma Pull rdma fixes from Jason Gunthorpe: - Older "does not even boot" regression in qib from July - Bug fixes for error unwind in rtrs - Avoid a deadlock syzkaller found in srp - Fix another UAF syzkaller found in cma * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: RDMA/cma: Do not change route.addr.src_addr outside state checks RDMA/ib_srp: Fix a deadlock RDMA/rtrs-clt: Move free_permit from free_clt to rtrs_clt_close RDMA/rtrs-clt: Fix possible double free in error case IB/qib: Fix duplicate sysfs directory name commit 115ccd2278ccaa882000a20cb81a3649ef7dfe8b Merge: 4b23c6ecefcc9 ae42f92888463 Author: Linus Torvalds Date: Fri Feb 25 12:56:11 2022 -0800 Merge tag 'gpio-fixes-for-v5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux Pull gpio fixes from Bartosz Golaszewski: - fix an bug generating spurious interrupts in gpio-rockchip - fix a race condition in gpiod_to_irq() called by GPIO consumers * tag 'gpio-fixes-for-v5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: gpio: Return EPROBE_DEFER if gc->to_irq is NULL gpio: rockchip: Reset int_bothedge when changing trigger commit 22e9f71072fa605cbf033158db58e0790101928d Author: Jason Gunthorpe Date: Wed Feb 23 11:23:57 2022 -0400 RDMA/cma: Do not change route.addr.src_addr outside state checks If the state is not idle then resolve_prepare_src() should immediately fail and no change to global state should happen. However, it unconditionally overwrites the src_addr trying to build a temporary any address. 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) Which 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 This 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 derived from the dst build one explicitly on the stack and bind to that as any other normal flow would do. rdma_bind_addr() will copy it over the src_addr once it knows the state is valid. This is similar to commit bc0bdc5afaa7 ("RDMA/cma: Do not change route.addr.src_addr.ss_family") Link: https://lore.kernel.org/r/0-v2-e975c8fd9ef2+11e-syz_cma_srcaddr_jgg@nvidia.com Cc: stable@vger.kernel.org Fixes: 732d41c545bb ("RDMA/cma: Make the locking for automatic state transition more clear") Reported-by: syzbot+c94a3675a626f6333d74@syzkaller.appspotmail.com Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 4b23c6ecefcc9c15ae3d2f09d529151ab214b97f Merge: 64b5132b897ca 80808768e4132 Author: Linus Torvalds Date: Fri Feb 25 12:37:41 2022 -0800 Merge tag 'spi-fix-v5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi Pull spi fixes from Mark Brown: "A few small driver specific fixes" * tag 'spi-fix-v5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: spi: rockchip: terminate dma transmission when slave abort spi: rockchip: Fix error in getting num-cs property spi: spi-zynq-qspi: Fix a NULL pointer dereference in zynq_qspi_exec_mem_op() commit 64b5132b897caeb4188fcbafd46fd73dc96be4a8 Merge: 0e9894e6aac2c 9c7cf33c53ce8 Author: Linus Torvalds Date: Fri Feb 25 12:33:51 2022 -0800 Merge tag 'regulator-fix-v5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator Pull regulator fixes from Mark Brown: "A series of fixes for the da9121 driver" * tag 'regulator-fix-v5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: regulator: da9121: Remove surplus DA9141 parameters regulator: da9121: Fix DA914x voltage value regulator: da9121: Fix DA914x current values commit 0e9894e6aac2c591da00dae91c448c02d1ca6373 Merge: e48cb5c2c65db d04ad245d67a3 Author: Linus Torvalds Date: Fri Feb 25 12:30:01 2022 -0800 Merge tag 'regmap-fix-v5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap Pull regmap fix from Mark Brown: "A fix for interrupt controllers which require the explicit acknowledgement of interrupts using a different register to the one where interrupts are reported. Urgent for the few devices this affects" * tag 'regmap-fix-v5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: regmap-irq: Update interrupt clear register for proper reset commit e48cb5c2c65db87cf1269ca004e111764da6cc74 Merge: 2800b6d0fc390 3abea10e6a8f0 Author: Linus Torvalds Date: Fri Feb 25 12:25:44 2022 -0800 Merge tag 'thermal-5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull thermal control fix from Rafael Wysocki: "Fix a memory leak in the int340x thermal driver's ACPI notify handler (Chuansheng Liu)" * tag 'thermal-5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: thermal: int340x: fix memory leak in int3400_notify() commit 2800b6d0fc390d7c3f22109a408d5ed72746588c Merge: c47658311d60b c5eb92f57de24 Author: Linus Torvalds Date: Fri Feb 25 12:17:20 2022 -0800 Merge tag 'pm-5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull power management fixes from Rafael Wysocki: "Fix the throttle IRQ handling during cpufreq initialization on Qualcomm platforms (Bjorn Andersson)" * tag 'pm-5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: cpufreq: qcom-hw: Delay enabling throttle_irq cpufreq: Reintroduce ready() callback commit c47658311d60be064b839f329c0e4d34f5f0735b Merge: d68ccfdbe5205 6c7621890995d Author: Linus Torvalds Date: Fri Feb 25 12:12:06 2022 -0800 Merge tag 'char-misc-5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull char/misc driver fixes from Greg KH: "Here are a few small driver fixes for 5.17-rc6 for reported issues. The majority of these are IIO fixes for small things, and the other two are a mvmem and mtd core conflict fix. All of these have been in linux-next with no reported issues" * tag 'char-misc-5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: mtd: core: Fix a conflict between MTD and NVMEM on wp-gpios property nvmem: core: Fix a conflict between MTD and NVMEM on wp-gpios property iio: imu: st_lsm6dsx: wait for settling time in st_lsm6dsx_read_oneshot iio: Fix error handling for PM iio: addac: ad74413r: correct comparator gpio getters mask usage iio: addac: ad74413r: use ngpio size when iterating over mask iio: addac: ad74413r: Do not reference negative array offsets iio: adc: men_z188_adc: Fix a resource leak in an error handling path iio: frequency: admv1013: remove the always true condition iio: accel: fxls8962af: add padding to regmap for SPI iio:imu:adis16480: fix buffering for devices with no burst mode iio: adc: ad7124: fix mask used for setting AIN_BUFP & AIN_BUFM bits iio: adc: tsc2046: fix memory corruption by preventing array overflow commit d68ccfdbe5205c746c6ad145c771a4db19fb8dc0 Merge: eae9350eb40aa d8f7a5484f218 Author: Linus Torvalds Date: Fri Feb 25 12:05:40 2022 -0800 Merge tag 'driver-core-5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core fix from Greg KH: "Here is a single driver core fix for 5.17-rc6. It resolves a reported problem when the DMA map of a device is not properly released. It has been in linux-next with no reported problems" * tag 'driver-core-5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: driver core: Free DMA range map when device is released commit eae9350eb40aa0b07c280ab3a504bdc65c2211f1 Merge: d8fc3bb606d84 b6821b0d9b563 Author: Linus Torvalds Date: Fri Feb 25 11:56:16 2022 -0800 Merge tag 'staging-5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging driver fix from Greg KH: "Here is a single staging driver fix for 5.17-rc6. It resolves a reported problem in the fbtft fb_st7789v.c driver that could cause the display to be flipped in cold weather. It has been in linux-next with no reported problems" * tag 'staging-5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: staging: fbtft: fb_st7789v: reset display before initialization commit d8fc3bb606d84ddaf26e31231d848600ae0eccec Merge: 548b1af45d1a1 eebb0f4e894f1 Author: Linus Torvalds Date: Fri Feb 25 11:45:29 2022 -0800 Merge tag 'tty-5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull tty/serial driver fixes from Greg KH: "Here are some small n_gsm and sc16is7xx serial driver fixes for 5.17-rc6. The n_gsm fixes are from Siemens as it seems they are using the line discipline and fixing up a number of issues they found in their testing. The sc16is7xx serial driver fix is for a reported problem with that chip. All of these have been in linux-next with no reported problems" * tag 'tty-5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: sc16is7xx: Fix for incorrect data being transmitted tty: n_gsm: fix deadlock in gsmtty_open() tty: n_gsm: fix wrong modem processing in convergence layer type 2 tty: n_gsm: fix wrong tty control line for flow control tty: n_gsm: fix NULL pointer access due to DLCI release tty: n_gsm: fix proper link termination after failed open tty: n_gsm: fix encoding of command/response bit tty: n_gsm: fix encoding of control signal octet bit DV commit 14756b2ae265d526b8356e86729090b01778fdf6 Author: Slawomir Laba Date: Wed Feb 23 13:38:55 2022 +0100 iavf: Fix __IAVF_RESETTING state usage The setup of __IAVF_RESETTING state in watchdog task had no effect and could lead to slow resets in the driver as the task for __IAVF_RESETTING state only requeues watchdog. Till now the __IAVF_RESETTING was interpreted by reset task as running state which could lead to errors with allocating and resources disposal. Make watchdog_task queue the reset task when it's necessary. Do not update the state to __IAVF_RESETTING so the reset task knows exactly what is the current state of the adapter. Fixes: 898ef1cb1cb2 ("iavf: Combine init and watchdog state machines") Signed-off-by: Slawomir Laba Signed-off-by: Phani Burra Signed-off-by: Jacob Keller Signed-off-by: Mateusz Palczewski Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit d2c0f45fcceb0995f208c441d9c9a453623f9ccf Author: Slawomir Laba Date: Wed Feb 23 13:38:43 2022 +0100 iavf: Fix missing check for running netdev The driver was queueing reset_task regardless of the netdev state. Do not queue the reset task in iavf_change_mtu if netdev is not running. Fixes: fdd4044ffdc8 ("iavf: Remove timer for work triggering, use delaying work instead") Signed-off-by: Slawomir Laba Signed-off-by: Phani Burra Signed-off-by: Jacob Keller Signed-off-by: Mateusz Palczewski Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit e85ff9c631e1bf109ce8428848dfc8e8b0041f48 Author: Slawomir Laba Date: Wed Feb 23 13:38:31 2022 +0100 iavf: Fix deadlock in iavf_reset_task There exists a missing mutex_unlock call on crit_lock in iavf_reset_task call path. Unlock the crit_lock before returning from reset task. Fixes: 5ac49f3c2702 ("iavf: use mutexes for locking of critical sections") Signed-off-by: Slawomir Laba Signed-off-by: Phani Burra Signed-off-by: Jacob Keller Signed-off-by: Mateusz Palczewski Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit a472eb5cbaebb5774672c565e024336c039e9128 Author: Slawomir Laba Date: Wed Feb 23 13:38:01 2022 +0100 iavf: Fix race in init state When iavf_init_version_check sends VIRTCHNL_OP_GET_VF_RESOURCES message, the driver will wait for the response after requeueing the watchdog task in iavf_init_get_resources call stack. The logic is implemented this way that iavf_init_get_resources has to be called in order to allocate adapter->vf_res. It is polling for the AQ response in iavf_get_vf_config function. Expect a call trace from kernel when adminq_task worker handles this message first. adapter->vf_res will be NULL in iavf_virtchnl_completion. Make the watchdog task not queue the adminq_task if the init process is not finished yet. Fixes: 898ef1cb1cb2 ("iavf: Combine init and watchdog state machines") Signed-off-by: Slawomir Laba Signed-off-by: Phani Burra Signed-off-by: Jacob Keller Signed-off-by: Mateusz Palczewski Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit 0579fafd37fb7efe091f0e6c8ccf968864f40f3e Author: Slawomir Laba Date: Wed Feb 23 13:37:50 2022 +0100 iavf: Fix locking for VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS iavf_virtchnl_completion is called under crit_lock but when the code for VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS is called, this lock is released in order to obtain rtnl_lock to avoid ABBA deadlock with unregister_netdev. Along with the new way iavf_remove behaves, there exist many risks related to the lock release and attmepts to regrab it. The driver faces crashes related to races between unregister_netdev and netdev_update_features. Yet another risk is that the driver could already obtain the crit_lock in order to destroy it and iavf_virtchnl_completion could crash or block forever. Make iavf_virtchnl_completion never relock crit_lock in it's call paths. Extract rtnl_lock locking logic to the driver for unregister_netdev in order to set the netdev_registered flag inside the lock. Introduce a new flag that will inform adminq_task to perform the code from VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS right after it finishes processing messages. Guard this code with remove flags so it's never called when the driver is in remove state. Fixes: 5951a2b9812d ("iavf: Fix VLAN feature flags after VFR") Signed-off-by: Slawomir Laba Signed-off-by: Phani Burra Signed-off-by: Jacob Keller Signed-off-by: Mateusz Palczewski Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit 3ccd54ef44ebfa0792c5441b6d9c86618f3378d1 Author: Slawomir Laba Date: Wed Feb 23 13:37:10 2022 +0100 iavf: Fix init state closure on remove When init states of the adapter work, the errors like lack of communication with the PF might hop in. If such events occur the driver restores previous states in order to retry initialization in a proper way. When remove task kicks in, this situation could lead to races with unregistering the netdevice as well as resources cleanup. With the commit introducing the waiting in remove for init to complete, this problem turns into an endless waiting if init never recovers from errors. Introduce __IAVF_IN_REMOVE_TASK bit to indicate that the remove thread has started. Make __IAVF_COMM_FAILED adapter state respect the __IAVF_IN_REMOVE_TASK bit and set the __IAVF_INIT_FAILED state and return without any action instead of trying to recover. Make __IAVF_INIT_FAILED adapter state respect the __IAVF_IN_REMOVE_TASK bit and return without any further actions. Make the loop in the remove handler break when adapter has __IAVF_INIT_FAILED state set. Fixes: 898ef1cb1cb2 ("iavf: Combine init and watchdog state machines") Signed-off-by: Slawomir Laba Signed-off-by: Phani Burra Signed-off-by: Jacob Keller Signed-off-by: Mateusz Palczewski Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit 974578017fc1fdd06cea8afb9dfa32602e8529ed Author: Slawomir Laba Date: Wed Feb 23 13:36:56 2022 +0100 iavf: Add waiting so the port is initialized in remove There exist races when port is being configured and remove is triggered. unregister_netdev is not and can't be called under crit_lock mutex since it is calling ndo_stop -> iavf_close which requires this lock. Depending on init state the netdev could be still unregistered so unregister_netdev never cleans up, when shortly after that the device could become registered. Make iavf_remove wait until port finishes initialization. All critical state changes are atomic (under crit_lock). Crashes that come from iavf_reset_interrupt_capability and iavf_free_traffic_irqs should now be solved in a graceful manner. Fixes: 605ca7c5c6707 ("iavf: Fix kernel BUG in free_msi_irqs") Signed-off-by: Slawomir Laba Signed-off-by: Phani Burra Signed-off-by: Jacob Keller Signed-off-by: Mateusz Palczewski Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit fc2e6b3b132a907378f6af08356b105a4139c4fb Author: Slawomir Laba Date: Wed Feb 23 13:35:49 2022 +0100 iavf: Rework mutexes for better synchronisation The driver used to crash in multiple spots when put to stress testing of the init, reset and remove paths. The user would experience call traces or hangs when creating, resetting, removing VFs. Depending on the machines, the call traces are happening in random spots, like reset restoring resources racing with driver remove. Make adapter->crit_lock mutex a mandatory lock for guarding the operations performed on all workqueues and functions dealing with resource allocation and disposal. Make __IAVF_REMOVE a final state of the driver respected by workqueues that shall not requeue, when they fail to obtain the crit_lock. Make the IRQ handler not to queue the new work for adminq_task when the __IAVF_REMOVE state is set. Fixes: 5ac49f3c2702 ("iavf: use mutexes for locking of critical sections") Signed-off-by: Slawomir Laba Signed-off-by: Phani Burra Signed-off-by: Jacob Keller Signed-off-by: Mateusz Palczewski Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit 548b1af45d1a10a6e2a04255c29d06cc14c10870 Merge: 78081594971aa 19eae24b76c27 Author: Linus Torvalds Date: Fri Feb 25 11:36:31 2022 -0800 Merge tag 'usb-5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB fixes from Greg KH: "Here are a number of small USB driver fixes for 5.17-rc6 to resolve reported problems and add new device ids. They include: - dwc3: - device mapping fix - new device ids - driver fixes - xhci driver fixes - gadget driver fixes - usb-serial driver device id updates All of these have been in linux-next with no reported problems" * tag 'usb-5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: usb: gadget: rndis: add spinlock for rndis response list usb: dwc3: gadget: Let the interrupt handler disable bottom halves. USB: gadget: validate endpoint index for xilinx udc USB: serial: option: add Telit LE910R1 compositions USB: serial: option: add support for DW5829e Revert "USB: serial: ch341: add new Product ID for CH341A" usb: dwc2: drd: fix soft connect when gadget is unconfigured usb: dwc3: pci: Fix Bay Trail phy GPIO mappings tps6598x: clear int mask on probe failure xhci: Prevent futile URB re-submissions due to incorrect return value. xhci: re-initialize the HC during resume if HCE was set usb: dwc3: pci: Add "snps,dis_u2_susphy_quirk" for Intel Bay Trail usb: dwc3: pci: add support for the Intel Raptor Lake-S commit 78081594971aae94d743c1af73e63fb258c04616 Merge: 53ab78cd6d5ab 8d093e02e898b Author: Linus Torvalds Date: Fri Feb 25 11:22:19 2022 -0800 Merge tag 'ata-5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata Pull ata fixes from Damien Le Moal: "Two fixes for the pata_hpt37x driver, both from Sergey: - Fix a PCI register access using an incorrect size (8bits instead of 16bits) - Make sure to always disable the primary channel as it is unused" * tag 'ata-5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata: ata: pata_hpt37x: disable primary channel on HPT371 ata: pata_hpt37x: fix PCI clock detection commit dd990352f01ee9a6c6eee152e5d11c021caccfe4 Author: Daniel Bristot de Oliveira Date: Fri Feb 18 16:17:38 2022 +0100 tracing/osnoise: Make osnoise_main to sleep for microseconds osnoise's runtime and period are in the microseconds scale, but it is currently sleeping in the millisecond's scale. This behavior roots in the usage of hwlat as the skeleton for osnoise. Make osnoise to sleep in the microseconds scale. Also, move the sleep to a specialized function. Link: https://lkml.kernel.org/r/302aa6c7bdf2d131719b22901905e9da122a11b2.1645197336.git.bristot@kernel.org Cc: Ingo Molnar Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) commit ab2f993c01f261aa3eeb8842842ff38bff7806b6 Author: Nathan Chancellor Date: Mon Feb 14 12:28:47 2022 -0700 ftrace: Remove unused ftrace_startup_enable() stub When building with clang + CONFIG_DYNAMIC_FTRACE=n + W=1, there is a warning: kernel/trace/ftrace.c:7194:20: error: unused function 'ftrace_startup_enable' [-Werror,-Wunused-function] static inline void ftrace_startup_enable(int command) { } ^ 1 error generated. Clang warns on instances of static inline functions in .c files with W=1 after commit 6863f5643dd7 ("kbuild: allow Clang to find unused static inline functions for W=1 build"). The ftrace_startup_enable() stub has been unused since commit e1effa0144a1 ("ftrace: Annotate the ops operation on update"), where its use outside of the CONFIG_DYNAMIC_TRACE section was replaced by ftrace_startup_all(). Remove it to resolve the warning. Link: https://lkml.kernel.org/r/20220214192847.488166-1-nathan@kernel.org Reported-by: kernel test robot Signed-off-by: Nathan Chancellor Signed-off-by: Steven Rostedt (Google) commit 7acf3a127bb7c65ff39099afd78960e77b2ca5de Author: Sven Schnelle Date: Mon Feb 14 14:44:56 2022 +0100 tracing: Ensure trace buffer is at least 4096 bytes large Booting the kernel with 'trace_buf_size=1' give a warning at boot during the ftrace selftests: [ 0.892809] Running postponed tracer tests: [ 0.892893] Testing tracer function: [ 0.901899] Callback from call_rcu_tasks_trace() invoked. [ 0.983829] Callback from call_rcu_tasks_rude() invoked. [ 1.072003] .. bad ring buffer .. corrupted trace buffer .. [ 1.091944] Callback from call_rcu_tasks() invoked. [ 1.097695] PASSED [ 1.097701] Testing dynamic ftrace: .. filter failed count=0 ..FAILED! [ 1.353474] ------------[ cut here ]------------ [ 1.353478] WARNING: CPU: 0 PID: 1 at kernel/trace/trace.c:1951 run_tracer_selftest+0x13c/0x1b0 Therefore enforce a minimum of 4096 bytes to make the selftest pass. Link: https://lkml.kernel.org/r/20220214134456.1751749-1-svens@linux.ibm.com Signed-off-by: Sven Schnelle Signed-off-by: Steven Rostedt (Google) commit bc82c38a6933aab308387d4aca47e0a05de7b553 Author: Christophe Leroy Date: Fri Feb 11 08:10:18 2022 +0100 tracing: Uninline trace_trigger_soft_disabled() partly On a powerpc32 build with CONFIG_CC_OPTIMISE_FOR_SIZE, the inline keyword is not honored and trace_trigger_soft_disabled() appears approx 50 times in vmlinux. Adding -Winline to the build, the following message appears: ./include/linux/trace_events.h:712:1: error: inlining failed in call to 'trace_trigger_soft_disabled': call is unlikely and code size would grow [-Werror=inline] That function is rather big for an inlined function: c003df60 : c003df60: 94 21 ff f0 stwu r1,-16(r1) c003df64: 7c 08 02 a6 mflr r0 c003df68: 90 01 00 14 stw r0,20(r1) c003df6c: bf c1 00 08 stmw r30,8(r1) c003df70: 83 e3 00 24 lwz r31,36(r3) c003df74: 73 e9 01 00 andi. r9,r31,256 c003df78: 41 82 00 10 beq c003df88 c003df7c: 38 60 00 00 li r3,0 c003df80: 39 61 00 10 addi r11,r1,16 c003df84: 4b fd 60 ac b c0014030 <_rest32gpr_30_x> c003df88: 73 e9 00 80 andi. r9,r31,128 c003df8c: 7c 7e 1b 78 mr r30,r3 c003df90: 41 a2 00 14 beq c003dfa4 c003df94: 38 c0 00 00 li r6,0 c003df98: 38 a0 00 00 li r5,0 c003df9c: 38 80 00 00 li r4,0 c003dfa0: 48 05 c5 f1 bl c009a590 c003dfa4: 73 e9 00 40 andi. r9,r31,64 c003dfa8: 40 82 00 28 bne c003dfd0 c003dfac: 73 ff 02 00 andi. r31,r31,512 c003dfb0: 41 82 ff cc beq c003df7c c003dfb4: 80 01 00 14 lwz r0,20(r1) c003dfb8: 83 e1 00 0c lwz r31,12(r1) c003dfbc: 7f c3 f3 78 mr r3,r30 c003dfc0: 83 c1 00 08 lwz r30,8(r1) c003dfc4: 7c 08 03 a6 mtlr r0 c003dfc8: 38 21 00 10 addi r1,r1,16 c003dfcc: 48 05 6f 6c b c0094f38 c003dfd0: 38 60 00 01 li r3,1 c003dfd4: 4b ff ff ac b c003df80 However it is located in a hot path so inlining it is important. But forcing inlining of the entire function by using __always_inline leads to increasing the text size by approx 20 kbytes. Instead, split the fonction in two parts, one part with the likely fast path, flagged __always_inline, and a second part out of line. With this change, on a powerpc32 with CONFIG_CC_OPTIMISE_FOR_SIZE vmlinux text increases by only 1,4 kbytes, which is partly compensated by a decrease of vmlinux data by 7 kbytes. On ppc64_defconfig which has CONFIG_CC_OPTIMISE_FOR_SPEED, this change reduces vmlinux text by more than 30 kbytes. Link: https://lkml.kernel.org/r/69ce0986a52d026d381d612801d978aa4f977460.1644563295.git.christophe.leroy@csgroup.eu Signed-off-by: Christophe Leroy Signed-off-by: Steven Rostedt (Google) commit b61edd57740de5895f44f2ea417b164d9e1708bb Author: Steven Rostedt (Google) Date: Fri Feb 18 19:00:57 2022 -0500 eprobes: Remove redundant event type information Currently, the event probes save the type of the event they are attached to when recording the event. For example: # echo 'e:switch sched/sched_switch prev_state=$prev_state prev_prio=$prev_prio next_pid=$next_pid next_prio=$next_prio' > dynamic_events # cat events/eprobes/switch/format name: switch ID: 1717 format: field:unsigned short common_type; offset:0; size:2; signed:0; field:unsigned char common_flags; offset:2; size:1; signed:0; field:unsigned char common_preempt_count; offset:3; size:1; signed:0; field:int common_pid; offset:4; size:4; signed:1; field:unsigned int __probe_type; offset:8; size:4; signed:0; field:u64 prev_state; offset:12; size:8; signed:0; field:u64 prev_prio; offset:20; size:8; signed:0; field:u64 next_pid; offset:28; size:8; signed:0; field:u64 next_prio; offset:36; size:8; signed:0; print fmt: "(%u) prev_state=0x%Lx prev_prio=0x%Lx next_pid=0x%Lx next_prio=0x%Lx", REC->__probe_type, REC->prev_state, REC->prev_prio, REC->next_pid, REC->next_prio The __probe_type adds 4 bytes to every event. One of the reasons for creating eprobes is to limit what is traced in an event to be able to limit what is written into the ring buffer. Having this redundant 4 bytes to every event takes away from this. The event that is recorded can be retrieved from the event probe itself, that is available when the trace is happening. For user space tools, it could simply read the dynamic_event file to find the event they are for. So there is really no reason to write this information into the ring buffer for every event. Link: https://lkml.kernel.org/r/20220218190057.2f5a19a8@gandalf.local.home Acked-by: Masami Hiramatsu Reviewed-by: Joel Fernandes Signed-off-by: Steven Rostedt (Google) commit 302e9edd54985f584cfc180098f3554774126969 Author: Steven Rostedt (Google) Date: Wed Feb 23 22:38:37 2022 -0500 tracing: Have traceon and traceoff trigger honor the instance If a trigger is set on an event to disable or enable tracing within an instance, then tracing should be disabled or enabled in the instance and not at the top level, which is confusing to users. Link: https://lkml.kernel.org/r/20220223223837.14f94ec3@rorschach.local.home Cc: stable@vger.kernel.org Fixes: ae63b31e4d0e2 ("tracing: Separate out trace events from global variables") Tested-by: Daniel Bristot de Oliveira Reviewed-by: Tom Zanussi Signed-off-by: Steven Rostedt (Google) commit e01b042e580f1fbf4fd8da467442451da00c7a90 Author: Randy Dunlap Date: Wed Feb 23 19:35:36 2022 -0800 net: stmmac: fix return value of __setup handler __setup() handlers should return 1 on success, i.e., the parameter has been handled. A return of 0 causes the "option=value" string to be added to init's environment strings, polluting it. Fixes: 47dd7a540b8a ("net: add support for STMicroelectronics Ethernet controllers.") Fixes: f3240e2811f0 ("stmmac: remove warning when compile as built-in (V2)") Signed-off-by: Randy Dunlap Reported-by: Igor Zhbanov Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru Cc: Giuseppe Cavallaro Cc: Alexandre Torgue Cc: Jose Abreu Link: https://lore.kernel.org/r/20220224033536.25056-1-rdunlap@infradead.org Signed-off-by: Jakub Kicinski commit 50e06ddceeea263f57fe92baa677c638ecd65bb6 Author: Randy Dunlap Date: Wed Feb 23 19:35:28 2022 -0800 net: sxgbe: fix return value of __setup handler __setup() handlers should return 1 on success, i.e., the parameter has been handled. A return of 0 causes the "option=value" string to be added to init's environment strings, polluting it. Fixes: acc18c147b22 ("net: sxgbe: add EEE(Energy Efficient Ethernet) for Samsung sxgbe") Fixes: 1edb9ca69e8a ("net: sxgbe: add basic framework for Samsung 10Gb ethernet driver") Signed-off-by: Randy Dunlap Reported-by: Igor Zhbanov Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru Cc: Siva Reddy Cc: Girish K S Cc: Byungho An Link: https://lore.kernel.org/r/20220224033528.24640-1-rdunlap@infradead.org Signed-off-by: Jakub Kicinski commit c5048a7b2c23ab589f3476a783bd586b663eda5b Author: Lad Prabhakar Date: Mon Feb 21 22:59:35 2022 +0000 can: rcar_canfd: rcar_canfd_channel_probe(): register the CAN device when fully ready Register the CAN device only when all the necessary initialization is completed. This patch makes sure all the data structures and locks are initialized before registering the CAN device. Link: https://lore.kernel.org/all/20220221225935.12300-1-prabhakar.mahadev-lad.rj@bp.renesas.com Reported-by: Pavel Machek Signed-off-by: Lad Prabhakar Reviewed-by: Pavel Machek Reviewed-by: Ulrich Hecht Signed-off-by: Marc Kleine-Budde commit 0ac983f512033cb7b5e210c9589768ad25b1e36b Author: Eric W. Biederman Date: Thu Feb 24 08:32:28 2022 -0600 ucounts: Fix systemd LimitNPROC with private users regression Long story short recursively enforcing RLIMIT_NPROC when it is not enforced on the process that creates a new user namespace, causes currently working code to fail. There is no reason to enforce RLIMIT_NPROC recursively when we don't enforce it normally so update the code to detect this case. I would like to simply use capable(CAP_SYS_RESOURCE) to detect when RLIMIT_NPROC is not enforced upon the caller. Unfortunately because RLIMIT_NPROC is charged and checked for enforcement based upon the real uid, using capable() which is euid based is inconsistent with reality. Come as close as possible to testing for capable(CAP_SYS_RESOURCE) by testing for when the real uid would match the conditions when CAP_SYS_RESOURCE would be present if the real uid was the effective uid. Reported-by: Etienne Dechamps Link: https://bugzilla.kernel.org/show_bug.cgi?id=215596 Link: https://lkml.kernel.org/r/e9589141-cfeb-90cd-2d0e-83a62787239a@edechamps.fr Link: https://lkml.kernel.org/r/87sfs8jmpz.fsf_-_@email.froward.int.ebiederm.org Cc: stable@vger.kernel.org Fixes: 21d1c5e386bc ("Reimplement RLIMIT_NPROC on top of ucounts") Reviewed-by: Kees Cook Signed-off-by: "Eric W. Biederman" commit c253bf70c657b407286a6139d85c42fb41f3fcfd Merge: f03f10a9823ab a222fd8541394 Author: Arnd Bergmann Date: Fri Feb 25 16:41:17 2022 +0100 Merge tag 'soc-fsl-fix-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/leo/linux into arm/fixes NXP/FSL SoC driver fixes for v5.17 - Add missing SoC compatible in existing binding - Replace kernel.h with the necessary inclusions - MAINTAINERS file fixes - Fix memory allocation failure check in guts driver - Various cleanups and minor fixes * tag 'soc-fsl-fix-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/leo/linux: soc: fsl: qe: Check of ioremap return value soc: fsl: qe: fix typo in a comment soc: fsl: guts: Add a missing memory allocation failure check soc: fsl: guts: Revert commit 3c0d64e867ed soc: fsl: Correct MAINTAINERS database (SOC) soc: fsl: Correct MAINTAINERS database (QUICC ENGINE LIBRARY) soc: fsl: Replace kernel.h with the necessary inclusions dt-bindings: fsl,layerscape-dcfg: add missing compatible for lx2160a dt-bindings: qoriq-clock: add missing compatible for lx2160a Link: https://lore.kernel.org/r/20220219012208.21835-1-leoyang.li@nxp.com Signed-off-by: Arnd Bergmann commit 9ee83635d872812f3920209c606c6ea9e412ffcc Author: Li RongQing Date: Wed Feb 9 12:16:41 2022 +0800 KVM: x86: Yield to IPI target vCPU only if it is busy When sending a call-function IPI-many to vCPUs, yield to the IPI target vCPU which is marked as preempted. but when emulating HLT, an idling vCPU will be voluntarily scheduled out and mark as preempted from the guest kernel perspective. yielding to idle vCPU is pointless and increase unnecessary vmexit, maybe miss the true preempted vCPU so yield to IPI target vCPU only if vCPU is busy and preempted Signed-off-by: Li RongQing Message-Id: <1644380201-29423-1-git-send-email-lirongqing@baidu.com> Signed-off-by: Paolo Bonzini commit 92e68cc558774de01024c18e8b35cdce4731c910 Author: Dexuan Cui Date: Fri Feb 25 00:46:00 2022 -0800 x86/kvmclock: Fix Hyper-V Isolated VM's boot issue when vCPUs > 64 When Linux runs as an Isolated VM on Hyper-V, it supports AMD SEV-SNP but it's partially enlightened, i.e. cc_platform_has( CC_ATTR_GUEST_MEM_ENCRYPT) is true but sev_active() is false. Commit 4d96f9109109 per se is good, but with it now kvm_setup_vsyscall_timeinfo() -> kvmclock_init_mem() calls set_memory_decrypted(), and later gets stuck when trying to zere out the pages pointed by 'hvclock_mem', if Linux runs as an Isolated VM on Hyper-V. The cause is that here now the Linux VM should no longer access the original guest physical addrss (GPA); instead the VM should do memremap() and access the original GPA + ms_hyperv.shared_gpa_boundary: see the example code in drivers/hv/connection.c: vmbus_connect() or drivers/hv/ring_buffer.c: hv_ringbuffer_init(). If the VM tries to access the original GPA, it keepts getting injected a fault by Hyper-V and gets stuck there. Here the issue happens only when the VM has >=65 vCPUs, because the global static array hv_clock_boot[] can hold 64 "struct pvclock_vsyscall_time_info" (the sizeof of the struct is 64 bytes), so kvmclock_init_mem() only allocates memory in the case of vCPUs > 64. Since the 'hvclock_mem' pages are only useful when the kvm clock is supported by the underlying hypervisor, fix the issue by returning early when Linux VM runs on Hyper-V, which doesn't support kvm clock. Fixes: 4d96f9109109 ("x86/sev: Replace occurrences of sev_active() with cc_platform_has()") Tested-by: Andrea Parri (Microsoft) Signed-off-by: Andrea Parri (Microsoft) Signed-off-by: Dexuan Cui Message-Id: <20220225084600.17817-1-decui@microsoft.com> Signed-off-by: Paolo Bonzini commit 3c51d0a6c761c2025c6db1ed4d3a7273167bf899 Author: Wanpeng Li Date: Tue Feb 22 01:02:03 2022 -0800 x86/kvm: Don't waste memory if kvmclock is disabled Even if "no-kvmclock" is passed in cmdline parameter, the guest kernel still allocates hvclock_mem which is scaled by the number of vCPUs, let's check kvmclock enable in advance to avoid this memory waste. Signed-off-by: Wanpeng Li Message-Id: <1645520523-30814-1-git-send-email-wanpengli@tencent.com> Signed-off-by: Paolo Bonzini commit 40cd58dbf121e1d0c18f1bd4dd10335ae45a28fc Author: Wanpeng Li Date: Fri Feb 25 00:29:40 2022 -0800 x86/kvm: Don't use PV TLB/yield when mwait is advertised MWAIT is advertised in host is not overcommitted scenario, however, PV TLB/sched yield should be enabled in host overcommitted scenario. Let's add the MWAIT checking when enabling PV TLB/sched yield. Signed-off-by: Wanpeng Li Message-Id: <1645777780-2581-1-git-send-email-wanpengli@tencent.com> Signed-off-by: Paolo Bonzini commit ece32a75f003464cad59c26305b4462305273d70 Merge: 1a71581012ddf 456f89e0928ab Author: Paolo Bonzini Date: Fri Feb 25 09:49:30 2022 -0500 Merge tag 'kvmarm-fixes-5.17-4' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD KVM/arm64 fixes for 5.17, take #4 - Correctly synchronise PMR and co on PSCI CPU_SUSPEND - Skip tests that depend on GICv3 when the HW isn't available commit 456f89e0928ab938122a40e9f094a6524cc158b4 Author: Mark Brown Date: Wed Feb 23 13:16:24 2022 +0000 KVM: selftests: aarch64: Skip tests if we can't create a vgic-v3 The arch_timer and vgic_irq kselftests assume that they can create a vgic-v3, using the library function vgic_v3_setup() which aborts with a test failure if it is not possible to do so. Since vgic-v3 can only be instantiated on systems where the host has GICv3 this leads to false positives on older systems where that is not the case. Fix this by changing vgic_v3_setup() to return an error if the vgic can't be instantiated and have the callers skip if this happens. We could also exit flagging a skip in vgic_v3_setup() but this would prevent future test cases conditionally deciding which GIC to use or generally doing more complex output. Signed-off-by: Mark Brown Reviewed-by: Andrew Jones Tested-by: Ricardo Koller Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220223131624.1830351-1-broonie@kernel.org commit b3a34dc362c03215031b268fcc0b988e69490231 Author: Casper Andersson Date: Fri Feb 25 11:15:16 2022 +0100 net: sparx5: Fix add vlan when invalid operation Check if operation is valid before changing any settings in hardware. Otherwise it results in changes being made despite it not being a valid operation. Fixes: 78eab33bb68b ("net: sparx5: add vlan support") Signed-off-by: Casper Andersson Signed-off-by: David S. Miller commit 767b9825ed1765894e569a3d698749d40d83762a Author: Jia-Ju Bai Date: Fri Feb 25 04:37:27 2022 -0800 net: chelsio: cxgb3: check the return value of pci_find_capability() The function pci_find_capability() in t3_prep_adapter() can fail, so its return value should be checked. Fixes: 4d22de3e6cc4 ("Add support for the latest 1G/10G Chelsio adapter, T3") Reported-by: TOTE Robot Signed-off-by: Jia-Ju Bai Signed-off-by: David S. Miller commit 5a83dd14c63b80133c0075dfa089d0446cb1e4b3 Merge: 31372fe9668e5 fd98693cb0721 Author: David S. Miller Date: Fri Feb 25 10:57:47 2022 +0000 Merge branch 'ibmvnic-fixes' Sukadev Bhattiprolu says: ==================== ibmvnic: Fix a race in ibmvnic_probe() If we get a transport (reset) event right after a successful CRQ_INIT during ibmvnic_probe() but before we set the adapter state to VNIC_PROBED, we will throw away the reset assuming that the adapter is still in the probing state. But since the adapter has completed the CRQ_INIT any subsequent CRQs the we send will be ignored by the vnicserver until we release/init the CRQ again. This can leave the adapter unconfigured. While here fix a couple of other bugs that were observed (Patches 1,2,4). ==================== Signed-off-by: David S. Miller commit fd98693cb0721317f27341951593712c580c36a1 Author: Sukadev Bhattiprolu Date: Thu Feb 24 22:23:58 2022 -0800 ibmvnic: Allow queueing resets during probe We currently don't allow queuing resets when adapter is in VNIC_PROBING state - instead we throw away the reset and return EBUSY. The reasoning is probably that during ibmvnic_probe() the ibmvnic_adapter itself is being initialized so performing a reset during this time can lead us to accessing fields in the ibmvnic_adapter that are not fully initialized. A review of the code shows that all the adapter state neede to process a reset is initialized before registering the CRQ so that should no longer be a concern. Further the expectation is that if we do get a reset (transport event) during probe, the do..while() loop in ibmvnic_probe() will handle this by reinitializing the CRQ. While that is true to some extent, it is possible that the reset might occur _after_ the CRQ is registered and CRQ_INIT message was exchanged but _before_ the adapter state is set to VNIC_PROBED. As mentioned above, such a reset will be thrown away. While the client assumes that the adapter is functional, the vnic server will wait for the client to reinit the adapter. This disconnect between the two leaves the adapter down needing manual intervention. Because ibmvnic_probe() has other work to do after initializing the CRQ (such as registering the netdev at a minimum) and because the reset event can occur at any instant after the CRQ is initialized, there will always be a window between initializing the CRQ and considering the adapter ready for resets (ie state == PROBED). So rather than discarding resets during this window, allow queueing them - but only process them after the adapter is fully initialized. To do this, introduce a new completion state ->probe_done and have the reset worker thread wait on this before processing resets. This change brings up two new situations in or just after ibmvnic_probe(). First after one or more resets were queued, we encounter an error and decide to retry the initialization. At that point the queued resets are no longer relevant since we could be talking to a new vnic server. So we must purge/flush the queued resets before restarting the initialization. As a side note, since we are still in the probing stage and we have not registered the netdev, it will not be CHANGE_PARAM reset. Second this change opens up a potential race between the worker thread in __ibmvnic_reset(), the tasklet and the ibmvnic_open() due to the following sequence of events: 1. Register CRQ 2. Get transport event before CRQ_INIT completes. 3. Tasklet schedules reset: a) add rwi to list b) schedule_work() to start worker thread which runs and waits for ->probe_done. 4. ibmvnic_probe() decides to retry, purges rwi_list 5. Re-register crq and this time rest of probe succeeds - register netdev and complete(->probe_done). 6. Worker thread resumes in __ibmvnic_reset() from 3b. 7. Worker thread sets ->resetting bit 8. ibmvnic_open() comes in, notices ->resetting bit, sets state to IBMVNIC_OPEN and returns early expecting worker thread to finish the open. 9. Worker thread finds rwi_list empty and returns without opening the interface. If this happens, the ->ndo_open() call is effectively lost and the interface remains down. To address this, ensure that ->rwi_list is not empty before setting the ->resetting bit. See also comments in __ibmvnic_reset(). Fixes: 6a2fb0e99f9c ("ibmvnic: driver initialization for kdump/kexec") Signed-off-by: Sukadev Bhattiprolu Signed-off-by: David S. Miller commit f628ad531b4f34fdba0984255b4a2850dd369513 Author: Sukadev Bhattiprolu Date: Thu Feb 24 22:23:57 2022 -0800 ibmvnic: clear fop when retrying probe Clear ->failover_pending flag that may have been set in the previous pass of registering CRQ. If we don't clear, a subsequent ibmvnic_open() call would be misled into thinking a failover is pending and assuming that the reset worker thread would open the adapter. If this pass of registering the CRQ succeeds (i.e there is no transport event), there wouldn't be a reset worker thread. This would leave the adapter unconfigured and require manual intervention to bring it up during boot. Fixes: 5a18e1e0c193 ("ibmvnic: Fix failover case for non-redundant configuration") Signed-off-by: Sukadev Bhattiprolu Signed-off-by: David S. Miller commit ae16bf15374d8b055e040ac6f3f1147ab1c9bb7d Author: Sukadev Bhattiprolu Date: Thu Feb 24 22:23:56 2022 -0800 ibmvnic: init init_done_rc earlier We currently initialize the ->init_done completion/return code fields before issuing a CRQ_INIT command. But if we get a transport event soon after registering the CRQ the taskslet may already have recorded the completion and error code. If we initialize here, we might overwrite/ lose that and end up issuing the CRQ_INIT only to timeout later. If that timeout happens during probe, we will leave the adapter in the DOWN state rather than retrying to register/init the CRQ. Initialize the completion before registering the CRQ so we don't lose the notification. Fixes: 032c5e82847a ("Driver for IBM System i/p VNIC protocol") Signed-off-by: Sukadev Bhattiprolu Signed-off-by: David S. Miller commit 570425f8c7c18b14fa8a2a58a0adb431968ad118 Author: Sukadev Bhattiprolu Date: Thu Feb 24 22:23:55 2022 -0800 ibmvnic: register netdev after init of adapter Finish initializing the adapter before registering netdev so state is consistent. Fixes: c26eba03e407 ("ibmvnic: Update reset infrastructure to support tunable parameters") Signed-off-by: Sukadev Bhattiprolu Signed-off-by: David S. Miller commit 36491f2df9ad2501e5a4ec25d3d95d72bafd2781 Author: Sukadev Bhattiprolu Date: Thu Feb 24 22:23:54 2022 -0800 ibmvnic: complete init_done on transport events If we get a transport event, set the error and mark the init as complete so the attempt to send crq-init or login fail sooner rather than wait for the timeout. Fixes: bbd669a868bb ("ibmvnic: Fix completion structure initialization") Signed-off-by: Sukadev Bhattiprolu Signed-off-by: David S. Miller commit 83da53f7e4bd86dca4b2edc1e2bb324fb3c033a1 Author: Sukadev Bhattiprolu Date: Thu Feb 24 22:23:53 2022 -0800 ibmvnic: define flush_reset_queue helper Define and use a helper to flush the reset queue. Fixes: 2770a7984db5 ("ibmvnic: Introduce hard reset recovery") Signed-off-by: Sukadev Bhattiprolu Signed-off-by: David S. Miller commit 765559b10ce514eb1576595834f23cdc92125fee Author: Sukadev Bhattiprolu Date: Thu Feb 24 22:23:52 2022 -0800 ibmvnic: initialize rc before completing wait We should initialize ->init_done_rc before calling complete(). Otherwise the waiting thread may see ->init_done_rc as 0 before we have updated it and may assume that the CRQ was successful. Fixes: 6b278c0cb378 ("ibmvnic delay complete()") Signed-off-by: Sukadev Bhattiprolu Signed-off-by: David S. Miller commit 8d0657f39f487d904fca713e0bc39c2707382553 Author: Sukadev Bhattiprolu Date: Thu Feb 24 22:23:51 2022 -0800 ibmvnic: free reset-work-item when flushing Fix a tiny memory leak when flushing the reset work queue. Fixes: 2770a7984db5 ("ibmvnic: Introduce hard reset recovery") Signed-off-by: Sukadev Bhattiprolu Signed-off-by: David S. Miller commit 31372fe9668e52c1f700c628c9fa716dd453f784 Merge: 91b0383fef06f 7c76ecd9c99b6 Author: David S. Miller Date: Fri Feb 25 10:44:15 2022 +0000 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec Steffen Klassert says: ==================== 1) Fix PMTU for IPv6 if the reported MTU minus the ESP overhead is smaller than 1280. From Jiri Bohac. 2) Fix xfrm interface ID and inter address family tunneling when migrating xfrm states. From Yan Yan. 3) Add missing xfrm intrerface ID initialization on xfrmi_changelink. From Antony Antony. 4) Enforce validity of xfrm offload input flags so that userspace can't send undefined flags to the offload driver. From Leon Romanovsky. ==================== Signed-off-by: David S. Miller commit 91b0383fef06f20b847fa9e4f0e3054ead0b1a1b Author: Vladimir Oltean Date: Thu Feb 24 18:01:54 2022 +0200 net: dcb: flush lingering app table entries for unregistered devices If I'm not mistaken (and I don't think I am), the way in which the dcbnl_ops work is that drivers call dcb_ieee_setapp() and this populates the application table with dynamically allocated struct dcb_app_type entries that are kept in the module-global dcb_app_list. However, nobody keeps exact track of these entries, and although dcb_ieee_delapp() is supposed to remove them, nobody does so when the interface goes away (example: driver unbinds from device). So the dcb_app_list will contain lingering entries with an ifindex that no longer matches any device in dcb_app_lookup(). Reclaim the lost memory by listening for the NETDEV_UNREGISTER event and flushing the app table entries of interfaces that are now gone. In fact something like this used to be done as part of the initial commit (blamed below), but it was done in dcbnl_exit() -> dcb_flushapp(), essentially at module_exit time. That became dead code after commit 7a6b6f515f77 ("DCB: fix kconfig option") which essentially merged "tristate config DCB" and "bool config DCBNL" into a single "bool config DCB", so net/dcb/dcbnl.c could not be built as a module anymore. Commit 36b9ad8084bd ("net/dcb: make dcbnl.c explicitly non-modular") recognized this and deleted dcbnl_exit() and dcb_flushapp() altogether, leaving us with the version we have today. Since flushing application table entries can and should be done as soon as the netdevice disappears, fundamentally the commit that is to blame is the one that introduced the design of this API. Fixes: 9ab933ab2cc8 ("dcbnl: add appliction tlv handlers") Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 9f1c50cf39167ff71dc5953a3234f3f6eeb8fcb5 Author: D. Wythe Date: Thu Feb 24 23:26:19 2022 +0800 net/smc: fix connection leak There's a potential leak issue under following execution sequence : smc_release smc_connect_work if (sk->sk_state == SMC_INIT) send_clc_confirim tcp_abort(); ... sk.sk_state = SMC_ACTIVE smc_close_active switch(sk->sk_state) { ... case SMC_ACTIVE: smc_close_final() // then wait peer closed Unfortunately, tcp_abort() may discard CLC CONFIRM messages that are still in the tcp send buffer, in which case our connection token cannot be delivered to the server side, which means that we cannot get a passive close message at all. Therefore, it is impossible for the to be disconnected at all. This patch tries a very simple way to avoid this issue, once the state has changed to SMC_ACTIVE after tcp_abort(), we can actively abort the smc connection, considering that the state is SMC_INIT before tcp_abort(), abandoning the complete disconnection process should not cause too much problem. In fact, this problem may exist as long as the CLC CONFIRM message is not received by the server. Whether a timer should be added after smc_close_final() needs to be discussed in the future. But even so, this patch provides a faster release for connection in above case, it should also be valuable. Fixes: 39f41f367b08 ("net/smc: common release code for non-accepted sockets") Signed-off-by: D. Wythe Acked-by: Karsten Graul Signed-off-by: David S. Miller commit 087a7b944c5db409f7c1a68bf4896c56ba54eaff Author: Vincent Whitchurch Date: Thu Feb 24 12:38:29 2022 +0100 net: stmmac: only enable DMA interrupts when ready In this driver's ->ndo_open() callback, it enables DMA interrupts, starts the DMA channels, then requests interrupts with request_irq(), and then finally enables napi. If RX DMA interrupts are received before napi is enabled, no processing is done because napi_schedule_prep() will return false. If the network has a lot of broadcast/multicast traffic, then the RX ring could fill up completely before napi is enabled. When this happens, no further RX interrupts will be delivered, and the driver will fail to receive any packets. Fix this by only enabling DMA interrupts after all other initialization is complete. Fixes: 523f11b5d4fd72efb ("net: stmmac: move hardware setup for stmmac_open to new function") Reported-by: Lars Persson Signed-off-by: Vincent Whitchurch Signed-off-by: David S. Miller commit dcf4ff7a48e7598e6b10126cc02177abb8ae4f3f Author: Marek Marczykowski-Górecki Date: Wed Feb 23 22:19:54 2022 +0100 xen/netfront: destroy queues before real_num_tx_queues is zeroed xennet_destroy_queues() relies on info->netdev->real_num_tx_queues to delete queues. Since d7dac083414eb5bb99a6d2ed53dc2c1b405224e5 ("net-sysfs: update the queue counts in the unregistration path"), unregister_netdev() indirectly sets real_num_tx_queues to 0. Those two facts together means, that xennet_destroy_queues() called from xennet_remove() cannot do its job, because it's called after unregister_netdev(). This results in kfree-ing queues that are still linked in napi, which ultimately crashes: BUG: kernel NULL pointer dereference, address: 0000000000000000 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 1 PID: 52 Comm: xenwatch Tainted: G W 5.16.10-1.32.fc32.qubes.x86_64+ #226 RIP: 0010:free_netdev+0xa3/0x1a0 Code: ff 48 89 df e8 2e e9 00 00 48 8b 43 50 48 8b 08 48 8d b8 a0 fe ff ff 48 8d a9 a0 fe ff ff 49 39 c4 75 26 eb 47 e8 ed c1 66 ff <48> 8b 85 60 01 00 00 48 8d 95 60 01 00 00 48 89 ef 48 2d 60 01 00 RSP: 0000:ffffc90000bcfd00 EFLAGS: 00010286 RAX: 0000000000000000 RBX: ffff88800edad000 RCX: 0000000000000000 RDX: 0000000000000001 RSI: ffffc90000bcfc30 RDI: 00000000ffffffff RBP: fffffffffffffea0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000001 R12: ffff88800edad050 R13: ffff8880065f8f88 R14: 0000000000000000 R15: ffff8880066c6680 FS: 0000000000000000(0000) GS:ffff8880f3300000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 00000000e998c006 CR4: 00000000003706e0 Call Trace: xennet_remove+0x13d/0x300 [xen_netfront] xenbus_dev_remove+0x6d/0xf0 __device_release_driver+0x17a/0x240 device_release_driver+0x24/0x30 bus_remove_device+0xd8/0x140 device_del+0x18b/0x410 ? _raw_spin_unlock+0x16/0x30 ? klist_iter_exit+0x14/0x20 ? xenbus_dev_request_and_reply+0x80/0x80 device_unregister+0x13/0x60 xenbus_dev_changed+0x18e/0x1f0 xenwatch_thread+0xc0/0x1a0 ? do_wait_intr_irq+0xa0/0xa0 kthread+0x16b/0x190 ? set_kthread_struct+0x40/0x40 ret_from_fork+0x22/0x30 Fix this by calling xennet_destroy_queues() from xennet_uninit(), when real_num_tx_queues is still available. This ensures that queues are destroyed when real_num_tx_queues is set to 0, regardless of how unregister_netdev() was called. Originally reported at https://github.com/QubesOS/qubes-issues/issues/7257 Fixes: d7dac083414eb5bb9 ("net-sysfs: update the queue counts in the unregistration path") Cc: stable@vger.kernel.org Signed-off-by: Marek Marczykowski-Górecki Signed-off-by: David S. Miller commit f03f10a9823ab8591afbc20ddaf9ce2aeb52ce59 Merge: 3f96885eb713c 8840f5460a237 Author: Arnd Bergmann Date: Fri Feb 25 11:14:22 2022 +0100 Merge tag 'omap-for-v5.17/fixes-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into arm/fixes Fixes for omaps Fixes for devkit8000 timer regression. Similar to the earlier beagleboard fixes, we must not configure the clocksource drivers to use an alternative timer configuration. It causes unnecessary issues with power management. Only some old designs based on early beagleboard revisions with a miswired timer need to use the alternative timer. * tag 'omap-for-v5.17/fixes-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: dts: Use 32KiHz oscillator on devkit8000 ARM: dts: switch timer config to common devkit8000 devicetree Link: https://lore.kernel.org/r/pull-1645606483-876944@atomide.com Signed-off-by: Arnd Bergmann commit 1a71581012ddf1f465040ef3d9f700341fa3cf04 Author: Sean Christopherson Date: Thu Feb 24 19:19:17 2022 +0000 Revert "KVM: VMX: Save HOST_CR3 in vmx_prepare_switch_to_guest()" Revert back to refreshing vmcs.HOST_CR3 immediately prior to VM-Enter. The PCID (ASID) part of CR3 can be bumped without KVM being scheduled out, as the kernel will switch CR3 during __text_poke(), e.g. in response to a static key toggling. If switch_mm_irqs_off() chooses a new ASID for the mm associate with KVM, KVM will do VM-Enter => VM-Exit with a stale vmcs.HOST_CR3. Add a comment to explain why KVM must wait until VM-Enter is imminent to refresh vmcs.HOST_CR3. The following splat was captured by stashing vmcs.HOST_CR3 in kvm_vcpu and adding a WARN in load_new_mm_cr3() to fire if a new ASID is being loaded for the KVM-associated mm while KVM has a "running" vCPU: static void load_new_mm_cr3(pgd_t *pgdir, u16 new_asid, bool need_flush) { struct kvm_vcpu *vcpu = kvm_get_running_vcpu(); ... WARN(vcpu && (vcpu->cr3 & GENMASK(11, 0)) != (new_mm_cr3 & GENMASK(11, 0)) && (vcpu->cr3 & PHYSICAL_PAGE_MASK) == (new_mm_cr3 & PHYSICAL_PAGE_MASK), "KVM is hosed, loading CR3 = %lx, vmcs.HOST_CR3 = %lx", new_mm_cr3, vcpu->cr3); } ------------[ cut here ]------------ KVM is hosed, loading CR3 = 8000000105393004, vmcs.HOST_CR3 = 105393003 WARNING: CPU: 4 PID: 20717 at arch/x86/mm/tlb.c:291 load_new_mm_cr3+0x82/0xe0 Modules linked in: vhost_net vhost vhost_iotlb tap kvm_intel CPU: 4 PID: 20717 Comm: stable Tainted: G W 5.17.0-rc3+ #747 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015 RIP: 0010:load_new_mm_cr3+0x82/0xe0 RSP: 0018:ffffc9000489fa98 EFLAGS: 00010082 RAX: 0000000000000000 RBX: 8000000105393004 RCX: 0000000000000027 RDX: 0000000000000027 RSI: 00000000ffffdfff RDI: ffff888277d1b788 RBP: 0000000000000004 R08: ffff888277d1b780 R09: ffffc9000489f8b8 R10: 0000000000000001 R11: 0000000000000001 R12: 0000000000000000 R13: ffff88810678a800 R14: 0000000000000004 R15: 0000000000000c33 FS: 00007fa9f0e72700(0000) GS:ffff888277d00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 00000001001b5003 CR4: 0000000000172ea0 Call Trace: switch_mm_irqs_off+0x1cb/0x460 __text_poke+0x308/0x3e0 text_poke_bp_batch+0x168/0x220 text_poke_finish+0x1b/0x30 arch_jump_label_transform_apply+0x18/0x30 static_key_slow_inc_cpuslocked+0x7c/0x90 static_key_slow_inc+0x16/0x20 kvm_lapic_set_base+0x116/0x190 kvm_set_apic_base+0xa5/0xe0 kvm_set_msr_common+0x2f4/0xf60 vmx_set_msr+0x355/0xe70 [kvm_intel] kvm_set_msr_ignored_check+0x91/0x230 kvm_emulate_wrmsr+0x36/0x120 vmx_handle_exit+0x609/0x6c0 [kvm_intel] kvm_arch_vcpu_ioctl_run+0x146f/0x1b80 kvm_vcpu_ioctl+0x279/0x690 __x64_sys_ioctl+0x83/0xb0 do_syscall_64+0x3b/0xc0 entry_SYSCALL_64_after_hwframe+0x44/0xae ---[ end trace 0000000000000000 ]--- This reverts commit 15ad9762d69fd8e40a4a51828c1d6b0c1b8fbea0. Fixes: 15ad9762d69f ("KVM: VMX: Save HOST_CR3 in vmx_prepare_switch_to_guest()") Reported-by: Wanpeng Li Cc: Lai Jiangshan Signed-off-by: Sean Christopherson Acked-by: Lai Jiangshan Message-Id: <20220224191917.3508476-3-seanjc@google.com> Signed-off-by: Paolo Bonzini commit bca06b85fcaf866602e328b3bcd86f74180eca14 Author: Sean Christopherson Date: Thu Feb 24 19:19:16 2022 +0000 Revert "KVM: VMX: Save HOST_CR3 in vmx_set_host_fs_gs()" Undo a nested VMX fix as a step toward reverting the commit it fixed, 15ad9762d69f ("KVM: VMX: Save HOST_CR3 in vmx_prepare_switch_to_guest()"), as the underlying premise that "host CR3 in the vcpu thread can only be changed when scheduling" is wrong. This reverts commit a9f2705ec84449e3b8d70c804766f8e97e23080d. Signed-off-by: Sean Christopherson Message-Id: <20220224191917.3508476-2-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 035b0fcf02707d3c9c2890dc1484b11aa5335eb1 Author: Vincent Mailhol Date: Tue Feb 15 08:48:14 2022 +0900 can: gs_usb: change active_channels's type from atomic_t to u8 The driver uses an atomic_t variable: gs_usb:active_channels to keep track of the number of opened channels in order to only allocate memory for the URBs when this count changes from zero to one. However, the driver does not decrement the counter when an error occurs in gs_can_open(). This issue is fixed by changing the type from atomic_t to u8 and by simplifying the logic accordingly. It is safe to use an u8 here because the network stack big kernel lock (a.k.a. rtnl_mutex) is being hold. For details, please refer to [1]. [1] https://lore.kernel.org/linux-can/CAMZ6Rq+sHpiw34ijPsmp7vbUpDtJwvVtdV7CvRZJsLixjAFfrg@mail.gmail.com/T/#t Fixes: d08e973a77d1 ("can: gs_usb: Added support for the GS_USB CAN devices") Link: https://lore.kernel.org/all/20220214234814.1321599-1-mailhol.vincent@wanadoo.fr Signed-off-by: Vincent Mailhol Signed-off-by: Marc Kleine-Budde commit f4896248e9025ff744b4147e6758274a1cb8cbae Author: Vincent Mailhol Date: Sat Feb 12 20:27:13 2022 +0900 can: etas_es58x: change opened_channel_cnt's type from atomic_t to u8 The driver uses an atomic_t variable: struct es58x_device::opened_channel_cnt to keep track of the number of opened channels in order to only allocate memory for the URBs when this count changes from zero to one. While the intent was to prevent race conditions, the choice of an atomic_t turns out to be a bad idea for several reasons: - implementation is incorrect and fails to decrement opened_channel_cnt when the URB allocation fails as reported in [1]. - even if opened_channel_cnt were to be correctly decremented, atomic_t is insufficient to cover edge cases: there can be a race condition in which 1/ a first process fails to allocate URBs memory 2/ a second process enters es58x_open() before the first process does its cleanup and decrements opened_channed_cnt. In which case, the second process would successfully return despite the URBs memory not being allocated. - actually, any kind of locking mechanism was useless here because it is redundant with the network stack big kernel lock (a.k.a. rtnl_lock) which is being hold by all the callers of net_device_ops:ndo_open() and net_device_ops:ndo_close(). c.f. the ASSERST_RTNL() calls in __dev_open() [2] and __dev_close_many() [3]. The atmomic_t is thus replaced by a simple u8 type and the logic to increment and decrement es58x_device:opened_channel_cnt is simplified accordingly fixing the bug reported in [1]. We do not check again for ASSERST_RTNL() as this is already done by the callers. [1] https://lore.kernel.org/linux-can/20220201140351.GA2548@kili/T/#u [2] https://elixir.bootlin.com/linux/v5.16/source/net/core/dev.c#L1463 [3] https://elixir.bootlin.com/linux/v5.16/source/net/core/dev.c#L1541 Fixes: 8537257874e9 ("can: etas_es58x: add core support for ETAS ES58X CAN USB interfaces") Link: https://lore.kernel.org/all/20220212112713.577957-1-mailhol.vincent@wanadoo.fr Reported-by: Dan Carpenter Signed-off-by: Vincent Mailhol Signed-off-by: Marc Kleine-Budde commit a6df953f0178c8a11fb2de95327643b622077018 Merge: 8a7271000b915 877d11f0332cd Author: Jakub Kicinski Date: Thu Feb 24 21:54:56 2022 -0800 Merge branch 'mptcp-fixes-for-5-17' Mat Martineau says: ==================== mptcp: Fixes for 5.17 Patch 1 fixes an issue with the SIOCOUTQ ioctl in MPTCP sockets that have performed a fallback to TCP. Patch 2 is a selftest fix to correctly remove temp files. Patch 3 fixes a shift-out-of-bounds issue found by syzkaller. ==================== Link: https://lore.kernel.org/r/20220225005259.318898-1-mathew.j.martineau@linux.intel.com Signed-off-by: Jakub Kicinski commit 877d11f0332cd2160e19e3313e262754c321fa36 Author: Mat Martineau Date: Thu Feb 24 16:52:59 2022 -0800 mptcp: Correctly set DATA_FIN timeout when number of retransmits is large Syzkaller with UBSAN uncovered a scenario where a large number of DATA_FIN retransmits caused a shift-out-of-bounds in the DATA_FIN timeout calculation: ================================================================================ UBSAN: shift-out-of-bounds in net/mptcp/protocol.c:470:29 shift exponent 32 is too large for 32-bit type 'unsigned int' CPU: 1 PID: 13059 Comm: kworker/1:0 Not tainted 5.17.0-rc2-00630-g5fbf21c90c60 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1.1 04/01/2014 Workqueue: events mptcp_worker Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 ubsan_epilogue+0xb/0x5a lib/ubsan.c:151 __ubsan_handle_shift_out_of_bounds.cold+0xb2/0x20e lib/ubsan.c:330 mptcp_set_datafin_timeout net/mptcp/protocol.c:470 [inline] __mptcp_retrans.cold+0x72/0x77 net/mptcp/protocol.c:2445 mptcp_worker+0x58a/0xa70 net/mptcp/protocol.c:2528 process_one_work+0x9df/0x16d0 kernel/workqueue.c:2307 worker_thread+0x95/0xe10 kernel/workqueue.c:2454 kthread+0x2f4/0x3b0 kernel/kthread.c:377 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 ================================================================================ This change limits the maximum timeout by limiting the size of the shift, which keeps all intermediate values in-bounds. Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/259 Fixes: 6477dd39e62c ("mptcp: Retransmit DATA_FIN") Acked-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 63bb8239d80571204c61d19c73f7bf5e3d9ef5fa Author: Paolo Abeni Date: Thu Feb 24 16:52:58 2022 -0800 selftests: mptcp: do complete cleanup at exit After commit 05be5e273c84 ("selftests: mptcp: add disconnect tests") the mptcp selftests leave behind a couple of tmp files after each run. run_tests_disconnect() misnames a few variables used to track them. Address the issue setting the appropriate global variables Fixes: 05be5e273c84 ("selftests: mptcp: add disconnect tests") Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 07c2c7a3b622e109ba4d2efd916da0477617ce81 Author: Paolo Abeni Date: Thu Feb 24 16:52:57 2022 -0800 mptcp: accurate SIOCOUTQ for fallback socket The MPTCP SIOCOUTQ implementation is not very accurate in case of fallback: it only measures the data in the MPTCP-level write queue, but it does not take in account the subflow write queue utilization. In case of fallback the first can be empty, while the latter is not. The above produces sporadic self-tests issues and can foul legit user-space application. Fix the issue additionally querying the subflow in case of fallback. Fixes: 644807e3e462 ("mptcp: add SIOCINQ, OUTQ and OUTQNSD ioctls") Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/260 Reported-by: Matthieu Baerts Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 22e2100b1b07d6f5acc71cc1acb53f680c677d77 Author: Changbin Du Date: Sun Feb 13 16:18:45 2022 +0800 riscv: fix oops caused by irqsoff latency tracer The trace_hardirqs_{on,off}() require the caller to setup frame pointer properly. This because these two functions use macro 'CALLER_ADDR1' (aka. __builtin_return_address(1)) to acquire caller info. If the $fp is used for other purpose, the code generated this macro (as below) could trigger memory access fault. 0xffffffff8011510e <+80>: ld a1,-16(s0) 0xffffffff80115112 <+84>: ld s2,-8(a1) # <-- paging fault here The oops message during booting if compiled with 'irqoff' tracer enabled: [ 0.039615][ T0] Unable to handle kernel NULL pointer dereference at virtual address 00000000000000f8 [ 0.041925][ T0] Oops [#1] [ 0.042063][ T0] Modules linked in: [ 0.042864][ T0] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.17.0-rc1-00233-g9a20c48d1ed2 #29 [ 0.043568][ T0] Hardware name: riscv-virtio,qemu (DT) [ 0.044343][ T0] epc : trace_hardirqs_on+0x56/0xe2 [ 0.044601][ T0] ra : restore_all+0x12/0x6e [ 0.044721][ T0] epc : ffffffff80126a5c ra : ffffffff80003b94 sp : ffffffff81403db0 [ 0.044801][ T0] gp : ffffffff8163acd8 tp : ffffffff81414880 t0 : 0000000000000020 [ 0.044882][ T0] t1 : 0098968000000000 t2 : 0000000000000000 s0 : ffffffff81403de0 [ 0.044967][ T0] s1 : 0000000000000000 a0 : 0000000000000001 a1 : 0000000000000100 [ 0.045046][ T0] a2 : 0000000000000000 a3 : 0000000000000000 a4 : 0000000000000000 [ 0.045124][ T0] a5 : 0000000000000000 a6 : 0000000000000000 a7 : 0000000054494d45 [ 0.045210][ T0] s2 : ffffffff80003b94 s3 : ffffffff81a8f1b0 s4 : ffffffff80e27b50 [ 0.045289][ T0] s5 : ffffffff81414880 s6 : ffffffff8160fa00 s7 : 00000000800120e8 [ 0.045389][ T0] s8 : 0000000080013100 s9 : 000000000000007f s10: 0000000000000000 [ 0.045474][ T0] s11: 0000000000000000 t3 : 7fffffffffffffff t4 : 0000000000000000 [ 0.045548][ T0] t5 : 0000000000000000 t6 : ffffffff814aa368 [ 0.045620][ T0] status: 0000000200000100 badaddr: 00000000000000f8 cause: 000000000000000d [ 0.046402][ T0] [] restore_all+0x12/0x6e This because the $fp(aka. $s0) register is not used as frame pointer in the assembly entry code. resume_kernel: REG_L s0, TASK_TI_PREEMPT_COUNT(tp) bnez s0, restore_all REG_L s0, TASK_TI_FLAGS(tp) andi s0, s0, _TIF_NEED_RESCHED beqz s0, restore_all call preempt_schedule_irq j restore_all To fix above issue, here we add one extra level wrapper for function trace_hardirqs_{on,off}() so they can be safely called by low level entry code. Signed-off-by: Changbin Du Fixes: 3c4697982982 ("riscv: Enable LOCKDEP_SUPPORT & fixup TRACE_IRQFLAGS_SUPPORT") Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit 762e52f79c95ea20a7229674ffd13b94d7d8959c Author: Damien Le Moal Date: Wed Feb 9 12:56:23 2022 +0900 riscv: fix nommu_k210_sdcard_defconfig Instead of an arbitrary delay, use the "rootwait" kernel option to wait for the mmc root device to be ready. Signed-off-by: Damien Le Moal Reviewed-by: Anup Patel Fixes: 7e09fd3994c5 ("riscv: Add Canaan Kendryte K210 SD card defconfig") Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit ce33c845b030c9cf768370c951bc699470b09fa7 Author: Daniel Bristot de Oliveira Date: Sun Feb 20 23:49:57 2022 +0100 tracing: Dump stacktrace trigger to the corresponding instance The stacktrace event trigger is not dumping the stacktrace to the instance where it was enabled, but to the global "instance." Use the private_data, pointing to the trigger file, to figure out the corresponding trace instance, and use it in the trigger action, like snapshot_trigger does. Link: https://lkml.kernel.org/r/afbb0b4f18ba92c276865bc97204d438473f4ebc.1645396236.git.bristot@kernel.org Cc: stable@vger.kernel.org Fixes: ae63b31e4d0e2 ("tracing: Separate out trace events from global variables") Reviewed-by: Tom Zanussi Tested-by: Tom Zanussi Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) commit 8a7271000b915bd6301866699c54c1e11885bc84 Merge: d8152cfe2f21d a56a1138cbd85 Author: Jakub Kicinski Date: Thu Feb 24 18:13:30 2022 -0800 Merge tag 'for-net-2022-02-24' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth Luiz Augusto von Dentz says: ==================== bluetooth pull request for net: - Fix regression with RFCOMM - Fix regression with LE devices using Privacy (RPA) - Fix regression with LE devices not waiting proper timeout to establish connections - Fix race in smp * tag 'for-net-2022-02-24' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth: Bluetooth: hci_sync: Fix not using conn_timeout Bluetooth: hci_sync: Fix hci_update_accept_list_sync Bluetooth: assign len after null check Bluetooth: Fix bt_skb_sendmmsg not allocating partial chunks Bluetooth: fix data races in smp_unregister(), smp_del_chan() Bluetooth: hci_core: Fix leaking sent_cmd skb ==================== Link: https://lore.kernel.org/r/20220224210838.197787-1-luiz.dentz@gmail.com Signed-off-by: Jakub Kicinski commit 53ab78cd6d5aba25575a7cfb95729336ba9497d8 Merge: 5ee3d0015a4ce 2f0754f27a230 Author: Linus Torvalds Date: Thu Feb 24 17:35:22 2022 -0800 Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux Pull clk fixes from Stephen Boyd: "A couple driver fixes in the clk subsystem - Fix a hang due to bad clk parent in the Ingenic jz4725b driver - Fix SD controllers on Qualcomm MSM8994 SoCs by removing clks that shouldn't be touched" * tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: clk: jz4725b: fix mmc0 clock gating clk: qcom: gcc-msm8994: Remove NoC clocks commit 5ee3d0015a4cec798b44ceefc34245752104fc08 Merge: 7ee022567bf9e ecf8a99f4807c Author: Linus Torvalds Date: Thu Feb 24 17:29:26 2022 -0800 Merge tag 'drm-fixes-2022-02-25' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Regular drm fixes pull, i915, amdgpu and tegra mostly, all pretty small. core: - edid: Always set RGB444 tegra: - tegra186 suspend/resume fixes - syncpoint wait fix - build warning fix - eDP on older devices fix amdgpu: - Display FP fix - PCO powergating fix - RDNA2 OEM SKU stability fixes - Display PSR fix - PCI ASPM fix - Display link encoder fix for TEST_COMMIT - Raven2 suspend/resume fix - Fix a regression in virtual display support - GPUVM eviction fix i915: - Fix QGV handling on ADL-P+ - Fix bw atomic check when switching between SAGV vs. no SAGV - Disconnect PHYs left connected by BIOS on disabled ports - Fix SAVG to no SAGV transitions on TGL+ - Print PHY name properly on calibration error (DG2) imx: - dcss: Select GEM CMA helpers radeon: - Fix some variables's type vc4: - Fix codec cleanup - Fix PM reference counting" * tag 'drm-fixes-2022-02-25' of git://anongit.freedesktop.org/drm/drm: (24 commits) drm/amdgpu: check vm ready by amdgpu_vm->evicting flag drm/amdgpu: bypass tiling flag check in virtual display case (v2) Revert "drm/amdgpu: add modifiers in amdgpu_vkms_plane_init()" drm/amdgpu: do not enable asic reset for raven2 drm/amd/display: Fix stream->link_enc unassigned during stream removal drm/amd: Check if ASPM is enabled from PCIe subsystem drm/edid: Always set RGB444 drm/tegra: dpaux: Populate AUX bus drm/radeon: fix variable type drm/amd/display: For vblank_disable_immediate, check PSR is really used drm/amd/pm: fix some OEM SKU specific stability issues drm/amdgpu: disable MMHUB PG for Picasso drm/amd/display: Protect update_bw_bounding_box FPU code. drm/i915/dg2: Print PHY name properly on calibration error drm/i915: Fix bw atomic check when switching between SAGV vs. no SAGV drm/i915: Correctly populate use_sagv_wm for all pipes drm/i915: Disconnect PHYs left connected by BIOS on disabled ports drm/i915: Widen the QGV point mask drm/imx/dcss: i.MX8MQ DCSS select DRM_GEM_CMA_HELPER drm/vc4: crtc: Fix runtime_pm reference counting ... commit aa091a6a91df395a0fa00a808a543301ec99e734 Author: Horatiu Vultur Date: Sat Feb 19 15:15:36 2022 +0100 clk: lan966x: Fix linking error If the config options HAS_IOMEM is not set then the driver fails to link with the following error: clk-lan966x.c:(.text+0x950): undefined reference to `devm_platform_ioremap_resource' Therefor add missing dependencies: HAS_IOMEM and OF. Fixes: 54104ee02333 ("clk: lan966x: Add lan966x SoC clock driver") Reported-by: kernel test robot Signed-off-by: Horatiu Vultur Link: https://lore.kernel.org/r/20220219141536.460812-1-horatiu.vultur@microchip.com Reviewed-by: Nicolas Ferre Signed-off-by: Stephen Boyd commit 4188db23285e28d9e9b9096f856cdcd7868005ee Author: Marek Szyprowski Date: Mon Jan 24 14:52:46 2022 +0100 drm/exynos: Search for TE-gpio in DSI panel's node TE-gpio, if defined, is placed in the panel's node, not the parent DSI node. Change the devm_gpiod_get_optional() to gpiod_get_optional() and pass proper device node to it. The code already has a proper cleanup path, so it looks that the devm_* variant has been applied accidentally during the conversion to gpiod API. Fixes: ee6c8b5afa62 ("drm/exynos: Replace legacy gpio interface for gpiod interface") Signed-off-by: Marek Szyprowski Fixed a typo. Signed-off-by: Inki Dae commit 0a6e8d0a6df67e0fff9c7d130b89769df4167c2b Author: Marek Szyprowski Date: Fri Jan 21 11:00:39 2022 +0100 drm/exynos: Don't fail if no TE-gpio is defined for DSI driver TE-gpio is optional and if it is not found then gpiod_get_optional() returns NULL. In such case the code will continue and try to convert NULL gpiod to irq what in turn fails. The failure is then propagated and driver is not registered. Fix this by returning early from exynos_dsi_register_te_irq() if no TE-gpio is found. Fixes: ee6c8b5afa62 ("drm/exynos: Replace legacy gpio interface for gpiod interface") Signed-off-by: Marek Szyprowski Signed-off-by: Inki Dae commit 586d0902456ad965c9a456fd0a0f451518aed1c5 Author: Lad Prabhakar Date: Wed Dec 22 19:01:34 2021 +0000 drm/exynos: gsc: Use platform_get_irq() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypassed the hierarchical setup and messed up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Signed-off-by: Lad Prabhakar Signed-off-by: Inki Dae commit be0a3b7e2a97e3f73004a5b453cc2023d8c1317a Author: Lad Prabhakar Date: Wed Dec 22 19:01:33 2021 +0000 drm/exynos/fimc: Use platform_get_irq() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypassed the hierarchical setup and messed up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Signed-off-by: Lad Prabhakar Signed-off-by: Inki Dae commit b342c1f335981ebc442127efe03524d2331a273c Author: Lad Prabhakar Date: Wed Dec 22 19:01:32 2021 +0000 drm/exynos/exynos_drm_fimd: Use platform_get_irq_byname() to get the interrupt platform_get_resource_byname(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypassed the hierarchical setup and messed up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq_byname(). Signed-off-by: Lad Prabhakar Signed-off-by: Inki Dae commit be52abd4d2b7ea343373cc116a99699a3e3c5573 Author: Lad Prabhakar Date: Wed Dec 22 19:01:31 2021 +0000 drm/exynos: mixer: Use platform_get_irq() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypassed the hierarchical setup and messed up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Signed-off-by: Lad Prabhakar Signed-off-by: Inki Dae commit 0d22b031662ad48d5835e470a90784f4b39adce9 Author: Lad Prabhakar Date: Wed Dec 22 19:01:30 2021 +0000 drm/exynos/exynos7_drm_decon: Use platform_get_irq_byname() to get the interrupt platform_get_resource_byname(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypassed the hierarchical setup and messed up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq_byname(). Signed-off-by: Lad Prabhakar Signed-off-by: Inki Dae commit 6e6fec3f961c00ca34ffb4bf2ad9febb4b499f8d Author: Taniya Das Date: Thu Feb 24 00:26:06 2022 +0530 clk: qcom: dispcc: Update the transition delay for MDSS GDSC On SC7180 we observe black screens because the gdsc is being enabled/disabled very rapidly and the GDSC FSM state does not work as expected. This is due to the fact that the GDSC reset value is being updated from SW. The recommended transition delay for mdss core gdsc updated for SC7180/SC7280/SM8250. Fixes: dd3d06622138 ("clk: qcom: Add display clock controller driver for SC7180") Fixes: 1a00c962f9cd ("clk: qcom: Add display clock controller driver for SC7280") Fixes: 80a18f4a8567 ("clk: qcom: Add display clock controller driver for SM8150 and SM8250") Signed-off-by: Taniya Das Link: https://lore.kernel.org/r/20220223185606.3941-2-tdas@codeaurora.org Reviewed-by: Bjorn Andersson [sboyd@kernel.org: lowercase hex] Signed-off-by: Stephen Boyd commit 4e7c4d3652f96f41179aab3ff53025c7a550d689 Author: Taniya Das Date: Thu Feb 24 00:26:05 2022 +0530 clk: qcom: gdsc: Add support to update GDSC transition delay GDSCs have multiple transition delays which are used for the GDSC FSM states. Older targets/designs required these values to be updated from gdsc code to certain default values for the FSM state to work as expected. But on the newer targets/designs the values updated from the GDSC driver can hamper the FSM state to not work as expected. On SC7180 we observe black screens because the gdsc is being enabled/disabled very rapidly and the GDSC FSM state does not work as expected. This is due to the fact that the GDSC reset value is being updated from SW. Thus add support to update the transition delay from the clock controller gdscs as required. Fixes: 45dd0e55317cc ("clk: qcom: Add support for GDSCs) Signed-off-by: Taniya Das Link: https://lore.kernel.org/r/20220223185606.3941-1-tdas@codeaurora.org Reviewed-by: Bjorn Andersson Signed-off-by: Stephen Boyd commit 7ee022567bf9e2e0b3cd92461a2f4986ecc99673 Merge: 1f840c0ef44b7 13e741b834538 Author: Linus Torvalds Date: Thu Feb 24 14:36:38 2022 -0800 Merge tag 'perf-tools-fixes-for-v5.17-2022-02-24' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux Pull perf tools fixes from Arnaldo Carvalho de Melo: - Fix double free in in the error path when opening perf.data from multiple files in a directory instead of from a single file - Sync the msr-index.h copy with the kernel sources - Fix error when printing 'weight' field in 'perf script' - Skip failing sigtrap test for arm+aarch64 in 'perf test' - Fix failure to use a cpu list for uncore events in hybrid systems, e.g. Intel Alder Lake * tag 'perf-tools-fixes-for-v5.17-2022-02-24' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: perf script: Fix error when printing 'weight' field tools arch x86: Sync the msr-index.h copy with the kernel sources perf data: Fix double free in perf_session__delete() perf evlist: Fix failed to use cpu list for uncore events perf test: Skip failing sigtrap test for arm+aarch64 commit 1f840c0ef44b7304d6a58499e0e5668084c0864d Merge: d8152cfe2f21d e910a53fb4f20 Author: Linus Torvalds Date: Thu Feb 24 14:05:49 2022 -0800 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull kvm fixes from Paolo Bonzini: "x86 host: - Expose KVM_CAP_ENABLE_CAP since it is supported - Disable KVM_HC_CLOCK_PAIRING in TSC catchup mode - Ensure async page fault token is nonzero - Fix lockdep false negative - Fix FPU migration regression from the AMX changes x86 guest: - Don't use PV TLB/IPI/yield on uniprocessor guests PPC: - reserve capability id (topic branch for ppc/kvm)" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: KVM: x86: nSVM: disallow userspace setting of MSR_AMD64_TSC_RATIO to non default value when tsc scaling disabled KVM: x86/mmu: make apf token non-zero to fix bug KVM: PPC: reserve capability 210 for KVM_CAP_PPC_AIL_MODE_3 x86/kvm: Don't use pv tlb/ipi/sched_yield if on 1 vCPU x86/kvm: Fix compilation warning in non-x86_64 builds x86/kvm/fpu: Remove kvm_vcpu_arch.guest_supported_xcr0 x86/kvm/fpu: Limit guest user_xfeatures to supported bits of XCR0 kvm: x86: Disable KVM_HC_CLOCK_PAIRING if tsc is in always catchup mode KVM: Fix lockdep false negative during host resume KVM: x86: Add KVM_CAP_ENABLE_CAP to x86 commit 3f96885eb713c45ca1c228a9a58b42e1a7726675 Merge: 31c50bf184a4f fa231bef3b34f Author: Arnd Bergmann Date: Thu Feb 24 22:50:17 2022 +0100 Merge tag 'imx-fixes-5.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/fixes i.MX fixes for 5.17, round 2: - Drop reset signal from i.MX8MM vpumix power domain to fix a system hang. - Fix a dtbs_check warning caused by #thermal-sensor-cells in i.MX8ULP device tree. - Fix a clock disabling imbalance in gpcv2 driver. Signed-off-by: Arnd Bergmann commit 31c50bf184a4f5c93394a48b5ba3bc281636360e Merge: 795a2ab1da7bd 8d3b01e0d4bb5 Author: Arnd Bergmann Date: Thu Feb 24 22:48:00 2022 +0100 Merge tag 'tegra-for-5.17-arm-dt-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/fixes ARM: tegra: Device tree fixes for v5.17-rc6 This contains fixes for the eDP panel found on the Venice 2 and Nyan boards. * tag 'tegra-for-5.17-arm-dt-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: ARM: tegra: Move panels to AUX bus Link: https://lore.kernel.org/r/20220223162209.293722-1-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit 795a2ab1da7bd67eee4d6b8a3bc6daa862008774 Merge: 98e437f134b34 3916c3619599a Author: Arnd Bergmann Date: Thu Feb 24 22:46:59 2022 +0100 Merge tag 'v5.17-rockchip-dtsfixes1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into arm/fixes Fix the display-port-sound on Gru devices, DDR voltage on the Quartz-A board, fix emmc signal-integrity and usb OTG mode on rk3399-puma as well as a number of dtschema fixes to make the reduce the number of errors. * tag 'v5.17-rockchip-dtsfixes1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: ARM: dts: rockchip: fix a typo on rk3288 crypto-controller ARM: dts: rockchip: reorder rk322x hmdi clocks arm64: dts: rockchip: reorder rk3399 hdmi clocks arm64: dts: rockchip: align pl330 node name with dtschema arm64: dts: rockchip: fix rk3399-puma eMMC HS400 signal integrity arm64: dts: rockchip: fix Quartz64-A ddr regulator voltage arm64: dts: rockchip: Switch RK3399-Gru DP to SPDIF output arm64: dts: rockchip: fix rk3399-puma-haikou USB OTG mode arm64: dts: rockchip: drop pclk_xpcs from gmac0 on rk3568 arm64: dts: rockchip: fix dma-controller node names on rk356x Link: https://lore.kernel.org/r/1973741.CViHJPHrxy@phil Signed-off-by: Arnd Bergmann commit d8152cfe2f21d6930c680311b03b169899c8d2a0 Merge: f672ff91236b5 3f1271b54edcc Author: Linus Torvalds Date: Thu Feb 24 13:19:57 2022 -0800 Merge tag 'pci-v5.17-fixes-5' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci Pull pci fixes from Bjorn Helgaas: - Fix a merge error that broke PCI device enumeration on mvebu platforms, including Turris Omnia (Armada 385) (Pali Rohár) - Avoid using ATS on all AMD Navi10 and Navi14 GPUs because some VBIOSes don't account for "harvested" (disabled) parts of the chip when initializing caches (Alex Deucher) * tag 'pci-v5.17-fixes-5' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: PCI: Mark all AMD Navi10 and Navi14 GPU ATS as broken PCI: mvebu: Fix device enumeration regression commit f672ff91236b556da338f477a23b1b4e87b40d23 Merge: 73878e5eb1bd3 42404d8f1c018 Author: Linus Torvalds Date: Thu Feb 24 12:45:32 2022 -0800 Merge tag 'net-5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Jakub Kicinski: "Including fixes from bpf and netfilter. Current release - regressions: - bpf: fix crash due to out of bounds access into reg2btf_ids - mvpp2: always set port pcs ops, avoid null-deref - eth: marvell: fix driver load from initrd - eth: intel: revert "Fix reset bw limit when DCB enabled with 1 TC" Current release - new code bugs: - mptcp: fix race in overlapping signal events Previous releases - regressions: - xen-netback: revert hotplug-status changes causing devices to not be configured - dsa: - avoid call to __dev_set_promiscuity() while rtnl_mutex isn't held - fix panic when removing unoffloaded port from bridge - dsa: microchip: fix bridging with more than two member ports Previous releases - always broken: - bpf: - fix crash due to incorrect copy_map_value when both spin lock and timer are present in a single value - fix a bpf_timer initialization issue with clang - do not try bpf_msg_push_data with len 0 - add schedule points in batch ops - nf_tables: - unregister flowtable hooks on netns exit - correct flow offload action array size - fix a couple of memory leaks - vsock: don't check owner in vhost_vsock_stop() while releasing - gso: do not skip outer ip header in case of ipip and net_failover - smc: use a mutex for locking "struct smc_pnettable" - openvswitch: fix setting ipv6 fields causing hw csum failure - mptcp: fix race in incoming ADD_ADDR option processing - sysfs: add check for netdevice being present to speed_show - sched: act_ct: fix flow table lookup after ct clear or switching zones - eth: intel: fixes for SR-IOV forwarding offloads - eth: broadcom: fixes for selftests and error recovery - eth: mellanox: flow steering and SR-IOV forwarding fixes Misc: - make __pskb_pull_tail() & pskb_carve_frag_list() drop_monitor friends not report freed skbs as drops - force inlining of checksum functions in net/checksum.h" * tag 'net-5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (85 commits) net: mv643xx_eth: process retval from of_get_mac_address ping: remove pr_err from ping_lookup Revert "i40e: Fix reset bw limit when DCB enabled with 1 TC" openvswitch: Fix setting ipv6 fields causing hw csum failure ipv6: prevent a possible race condition with lifetimes net/smc: Use a mutex for locking "struct smc_pnettable" bnx2x: fix driver load from initrd Revert "xen-netback: Check for hotplug-status existence before watching" Revert "xen-netback: remove 'hotplug-status' once it has served its purpose" net/mlx5e: Fix VF min/max rate parameters interchange mistake net/mlx5e: Add missing increment of count net/mlx5e: MPLSoUDP decap, fix check for unsupported matches net/mlx5e: Fix MPLSoUDP encap to use MPLS action information net/mlx5e: Add feature check for set fec counters net/mlx5e: TC, Skip redundant ct clear actions net/mlx5e: TC, Reject rules with forward and drop actions net/mlx5e: TC, Reject rules with drop and modify hdr action net/mlx5e: kTLS, Use CHECKSUM_UNNECESSARY for device-offloaded packets net/mlx5e: Fix wrong return value on ioctl EEPROM query failure net/mlx5: Fix possible deadlock on rule deletion ... commit a56a1138cbd85e4d565356199d60e1cb94e5a77a Author: Luiz Augusto von Dentz Date: Thu Feb 17 13:10:38 2022 -0800 Bluetooth: hci_sync: Fix not using conn_timeout When using hci_le_create_conn_sync it shall wait for the conn_timeout since the connection complete may take longer than just 2 seconds. Also fix the masking of HCI_EV_LE_ENHANCED_CONN_COMPLETE and HCI_EV_LE_CONN_COMPLETE so they are never both set so we can predict which one the controller will use in case of HCI_OP_LE_CREATE_CONN. Fixes: 6cd29ec6ae5e3 ("Bluetooth: hci_sync: Wait for proper events when connecting LE") Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 80740ebb7e1ad15ab9c11425dcd26e073f86d74b Author: Luiz Augusto von Dentz Date: Thu Feb 24 07:11:47 2022 -0800 Bluetooth: hci_sync: Fix hci_update_accept_list_sync hci_update_accept_list_sync is returning the filter based on the error but that gets overwritten by hci_le_set_addr_resolution_enable_sync return instead of using the actual result of the likes of hci_le_add_accept_list_sync which was intended. Fixes: ad383c2c65a5b ("Bluetooth: hci_sync: Enable advertising when LL privacy is enabled") Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 2e8ecb4bbc13d4752d64a9f8f5512d59125cab25 Author: Wang Qing Date: Mon Feb 14 18:01:56 2022 -0800 Bluetooth: assign len after null check len should be assigned after a null check Signed-off-by: Wang Qing Signed-off-by: Marcel Holtmann commit 29fb608396d6a62c1b85acc421ad7a4399085b9f Author: Luiz Augusto von Dentz Date: Mon Feb 14 17:59:38 2022 -0800 Bluetooth: Fix bt_skb_sendmmsg not allocating partial chunks Since bt_skb_sendmmsg can be used with the likes of SOCK_STREAM it shall return the partial chunks it could allocate instead of freeing everything as otherwise it can cause problems like bellow. Fixes: 81be03e026dc ("Bluetooth: RFCOMM: Replace use of memcpy_from_msg with bt_skb_sendmmsg") Reported-by: Paul Menzel Link: https://lore.kernel.org/r/d7206e12-1b99-c3be-84f4-df22af427ef5@molgen.mpg.de BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=215594 Signed-off-by: Luiz Augusto von Dentz Tested-by: Paul Menzel (Nokia N9 (MeeGo/Harmattan) Signed-off-by: Marcel Holtmann commit fa78d2d1d64f147062e384a4a10a26a5f89944b5 Author: Lin Ma Date: Wed Feb 16 12:37:14 2022 +0800 Bluetooth: fix data races in smp_unregister(), smp_del_chan() Previous commit e04480920d1e ("Bluetooth: defer cleanup of resources in hci_unregister_dev()") defers all destructive actions to hci_release_dev() to prevent cocurrent problems like NPD, UAF. However, there are still some exceptions that are ignored. The smp_unregister() in hci_dev_close_sync() (previously in hci_dev_do_close) will release resources like the sensitive channel and the smp_dev objects. Consider the situations the device is detaching or power down while the kernel is still operating on it, the following data race could take place. thread-A hci_dev_close_sync | thread-B read_local_oob_ext_data | hci_dev_unlock() | ... | hci_dev_lock() if (hdev->smp_data) | chan = hdev->smp_data | | chan = hdev->smp_data (3) | hdev->smp_data = NULL (1) | if (!chan || !chan->data) (4) ... | smp = chan->data | smp = chan->data if (smp) | chan->data = NULL (2) | ... | kfree_sensitive(smp) | | // dereference smp trigger UFA That is, the objects hdev->smp_data and chan->data both suffer from the data races. In a preempt-enable kernel, the above schedule (when (3) is before (1) and (4) is before (2)) leads to UAF bugs. It can be reproduced in the latest kernel and below is part of the report: [ 49.097146] ================================================================ [ 49.097611] BUG: KASAN: use-after-free in smp_generate_oob+0x2dd/0x570 [ 49.097611] Read of size 8 at addr ffff888006528360 by task generate_oob/155 [ 49.097611] [ 49.097611] Call Trace: [ 49.097611] [ 49.097611] dump_stack_lvl+0x34/0x44 [ 49.097611] print_address_description.constprop.0+0x1f/0x150 [ 49.097611] ? smp_generate_oob+0x2dd/0x570 [ 49.097611] ? smp_generate_oob+0x2dd/0x570 [ 49.097611] kasan_report.cold+0x7f/0x11b [ 49.097611] ? smp_generate_oob+0x2dd/0x570 [ 49.097611] smp_generate_oob+0x2dd/0x570 [ 49.097611] read_local_oob_ext_data+0x689/0xc30 [ 49.097611] ? hci_event_packet+0xc80/0xc80 [ 49.097611] ? sysvec_apic_timer_interrupt+0x9b/0xc0 [ 49.097611] ? asm_sysvec_apic_timer_interrupt+0x12/0x20 [ 49.097611] ? mgmt_init_hdev+0x1c/0x240 [ 49.097611] ? mgmt_init_hdev+0x28/0x240 [ 49.097611] hci_sock_sendmsg+0x1880/0x1e70 [ 49.097611] ? create_monitor_event+0x890/0x890 [ 49.097611] ? create_monitor_event+0x890/0x890 [ 49.097611] sock_sendmsg+0xdf/0x110 [ 49.097611] __sys_sendto+0x19e/0x270 [ 49.097611] ? __ia32_sys_getpeername+0xa0/0xa0 [ 49.097611] ? kernel_fpu_begin_mask+0x1c0/0x1c0 [ 49.097611] __x64_sys_sendto+0xd8/0x1b0 [ 49.097611] ? syscall_exit_to_user_mode+0x1d/0x40 [ 49.097611] do_syscall_64+0x3b/0x90 [ 49.097611] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 49.097611] RIP: 0033:0x7f5a59f51f64 ... [ 49.097611] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f5a59f51f64 [ 49.097611] RDX: 0000000000000007 RSI: 00007f5a59d6ac70 RDI: 0000000000000006 [ 49.097611] RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 [ 49.097611] R10: 0000000000000040 R11: 0000000000000246 R12: 00007ffec26916ee [ 49.097611] R13: 00007ffec26916ef R14: 00007f5a59d6afc0 R15: 00007f5a59d6b700 To solve these data races, this patch places the smp_unregister() function in the protected area by the hci_dev_lock(). That is, the smp_unregister() function can not be concurrently executed when operating functions (most of them are mgmt operations in mgmt.c) hold the device lock. This patch is tested with kernel LOCK DEBUGGING enabled. The price from the extended holding time of the device lock is supposed to be low as the smp_unregister() function is fairly short and efficient. Signed-off-by: Lin Ma Signed-off-by: Marcel Holtmann commit dd3b1dc3dd050f1f47cd13e300732852414270f8 Author: Luiz Augusto von Dentz Date: Fri Feb 4 13:12:35 2022 -0800 Bluetooth: hci_core: Fix leaking sent_cmd skb sent_cmd memory is not freed before freeing hci_dev causing it to leak it contents. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit ecf8a99f4807c17fa310a83067a95964cedd9ac1 Merge: 7c17b3d37f1fa 28adef861233c Author: Dave Airlie Date: Fri Feb 25 05:51:04 2022 +1000 Merge tag 'drm-intel-fixes-2022-02-24' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes - Fix QGV handling on ADL-P+ (Ville Syrjälä) - Fix bw atomic check when switching between SAGV vs. no SAGV (Ville Syrjälä) - Disconnect PHYs left connected by BIOS on disabled ports (Imre Deak) - Fix SAVG to no SAGV transitions on TGL+ (Ville Syrjälä) - Print PHY name properly on calibration error (DG2) (Matt Roper) Signed-off-by: Dave Airlie From: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/YhdyHwRWkOTWwlqi@tursulin-mobl2 commit 73878e5eb1bd3c9656685ca60bc3a49d17311e0c Merge: 3a5f59b17f9de b2750f14007f0 Author: Linus Torvalds Date: Thu Feb 24 11:15:10 2022 -0800 Merge tag 'block-5.17-2022-02-24' of git://git.kernel.dk/linux-block Pull block fixes from Jens Axboe: - NVMe pull request: - send H2CData PDUs based on MAXH2CDATA (Varun Prakash) - fix passthrough to namespaces with unsupported features (Christoph Hellwig) - Clear iocb->private at poll completion (Stefano) * tag 'block-5.17-2022-02-24' of git://git.kernel.dk/linux-block: nvme-tcp: send H2CData PDUs based on MAXH2CDATA nvme: also mark passthrough-only namespaces ready in nvme_update_ns_info nvme: don't return an error from nvme_configure_metadata block: clear iocb->private in blkdev_bio_end_io_async() commit 3abea10e6a8f0e7804ed4c124bea2d15aca977c8 Author: Chuansheng Liu Date: Wed Feb 23 08:20:24 2022 +0800 thermal: int340x: fix memory leak in int3400_notify() It is easy to hit the below memory leaks in my TigerLake platform: unreferenced object 0xffff927c8b91dbc0 (size 32): comm "kworker/0:2", pid 112, jiffies 4294893323 (age 83.604s) hex dump (first 32 bytes): 4e 41 4d 45 3d 49 4e 54 33 34 30 30 20 54 68 65 NAME=INT3400 The 72 6d 61 6c 00 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b a5 rmal.kkkkkkkkkk. backtrace: [] __kmalloc_track_caller+0x2fe/0x4a0 [] kvasprintf+0x65/0xd0 [] kasprintf+0x4e/0x70 [] int3400_notify+0x82/0x120 [int3400_thermal] [] acpi_ev_notify_dispatch+0x54/0x71 [] acpi_os_execute_deferred+0x17/0x30 [] process_one_work+0x21a/0x3f0 [] worker_thread+0x4a/0x3b0 [] kthread+0xfd/0x130 [] ret_from_fork+0x1f/0x30 Fix it by calling kfree() accordingly. Fixes: 38e44da59130 ("thermal: int3400_thermal: process "thermal table changed" event") Signed-off-by: Chuansheng Liu Cc: 4.14+ # 4.14+ Signed-off-by: Rafael J. Wysocki commit 3a5f59b17f9dec448976626663a73841460d7ab4 Merge: 6c528f34ca367 80912cef18f16 Author: Linus Torvalds Date: Thu Feb 24 11:08:15 2022 -0800 Merge tag 'io_uring-5.17-2022-02-23' of git://git.kernel.dk/linux-block Pull io_uring fixes from Jens Axboe: - Add a conditional schedule point in io_add_buffers() (Eric) - Fix for a quiesce speedup merged in this release (Dylan) - Don't convert to jiffies for event timeout waiting, it's way too coarse when we accept a timespec as input (me) * tag 'io_uring-5.17-2022-02-23' of git://git.kernel.dk/linux-block: io_uring: disallow modification of rsrc_data during quiesce io_uring: don't convert to jiffies for waiting on timeouts io_uring: add a schedule point in io_add_buffers() commit c5eb92f57de2446e0071c3af70ea54f237eb05d5 Merge: cfb92440ee71a ef8ee1cb8fc89 Author: Rafael J. Wysocki Date: Thu Feb 24 19:54:59 2022 +0100 Merge branch 'cpufreq/arm/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm Pull ARM cpufreq fixes for 5.18-rc6 from Viresh Kumar: "This fixes issues related to throttle IRQ for Qcom SoCs." * 'cpufreq/arm/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm: cpufreq: qcom-hw: Delay enabling throttle_irq cpufreq: Reintroduce ready() callback commit 6c528f34ca367468a5be2f0263a7031c166ad558 Merge: 91318b29a81cf 21d90aaee8d5c Author: Linus Torvalds Date: Thu Feb 24 10:42:20 2022 -0800 Merge tag 'platform-drivers-x86-v5.17-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 Pull more x86 platform driver fixes from Hans de Goede: "Two more fixes: - Fix suspend/resume regression on AMD Cezanne APUs in >= 5.16 - Fix Microsoft Surface 3 battery readings" * tag 'platform-drivers-x86-v5.17-4' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: surface: surface3_power: Fix battery readings on batteries without a serial number platform/x86: amd-pmc: Set QOS during suspend on CZN w/ timer wakeup commit 42404d8f1c01861b22ccfa1d70f950242720ae57 Author: Mauri Sandberg Date: Wed Feb 23 16:23:37 2022 +0200 net: mv643xx_eth: process retval from of_get_mac_address Obtaining a MAC address may be deferred in cases when the MAC is stored in an NVMEM block, for example, and it may not be ready upon the first retrieval attempt and return EPROBE_DEFER. It is also possible that a port that does not rely on NVMEM has been already created when getting the defer request. Thus, also the resources allocated previously must be freed when doing a roll-back. Fixes: 76723bca2802 ("net: mv643xx_eth: add DT parsing support") Signed-off-by: Mauri Sandberg Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220223142337.41757-1-maukka@ext.kapsi.fi Signed-off-by: Jakub Kicinski commit e910a53fb4f20aa012e46371ffb4c32c8da259b4 Author: Maxim Levitsky Date: Wed Feb 23 13:56:49 2022 +0200 KVM: x86: nSVM: disallow userspace setting of MSR_AMD64_TSC_RATIO to non default value when tsc scaling disabled If nested tsc scaling is disabled, MSR_AMD64_TSC_RATIO should never have non default value. Due to way nested tsc scaling support was implmented in qemu, it would set this msr to 0 when nested tsc scaling was disabled. Ignore that value for now, as it causes no harm. Fixes: 5228eb96a487 ("KVM: x86: nSVM: implement nested TSC scaling") Cc: stable@vger.kernel.org Signed-off-by: Maxim Levitsky Message-Id: <20220223115649.319134-1-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit 6f3c1fc53d86d580d8d6d749c4af23705e4f6f79 Author: Liang Zhang Date: Tue Feb 22 11:12:39 2022 +0800 KVM: x86/mmu: make apf token non-zero to fix bug In current async pagefault logic, when a page is ready, KVM relies on kvm_arch_can_dequeue_async_page_present() to determine whether to deliver a READY event to the Guest. This function test token value of struct kvm_vcpu_pv_apf_data, which must be reset to zero by Guest kernel when a READY event is finished by Guest. If value is zero meaning that a READY event is done, so the KVM can deliver another. But the kvm_arch_setup_async_pf() may produce a valid token with zero value, which is confused with previous mention and may lead the loss of this READY event. This bug may cause task blocked forever in Guest: INFO: task stress:7532 blocked for more than 1254 seconds. Not tainted 5.10.0 #16 "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. task:stress state:D stack: 0 pid: 7532 ppid: 1409 flags:0x00000080 Call Trace: __schedule+0x1e7/0x650 schedule+0x46/0xb0 kvm_async_pf_task_wait_schedule+0xad/0xe0 ? exit_to_user_mode_prepare+0x60/0x70 __kvm_handle_async_pf+0x4f/0xb0 ? asm_exc_page_fault+0x8/0x30 exc_page_fault+0x6f/0x110 ? asm_exc_page_fault+0x8/0x30 asm_exc_page_fault+0x1e/0x30 RIP: 0033:0x402d00 RSP: 002b:00007ffd31912500 EFLAGS: 00010206 RAX: 0000000000071000 RBX: ffffffffffffffff RCX: 00000000021a32b0 RDX: 000000000007d011 RSI: 000000000007d000 RDI: 00000000021262b0 RBP: 00000000021262b0 R08: 0000000000000003 R09: 0000000000000086 R10: 00000000000000eb R11: 00007fefbdf2baa0 R12: 0000000000000000 R13: 0000000000000002 R14: 000000000007d000 R15: 0000000000001000 Signed-off-by: Liang Zhang Message-Id: <20220222031239.1076682-1-zhangliang5@huawei.com> Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini commit cd33bdcbead882c2e58fdb4a54a7bd75b610a452 Author: Xin Long Date: Wed Feb 23 22:41:08 2022 -0500 ping: remove pr_err from ping_lookup As Jakub noticed, prints should be avoided on the datapath. Also, as packets would never come to the else branch in ping_lookup(), remove pr_err() from ping_lookup(). Fixes: 35a79e64de29 ("ping: fix the dif and sdif check in ping_lookup") Reported-by: Jakub Kicinski Signed-off-by: Xin Long Link: https://lore.kernel.org/r/1ef3f2fcd31bd681a193b1fcf235eee1603819bd.1645674068.git.lucien.xin@gmail.com Signed-off-by: Jakub Kicinski commit fe20371578ef640069e6ae9fa8038f60e7908565 Author: Mateusz Palczewski Date: Wed Feb 23 09:53:47 2022 -0800 Revert "i40e: Fix reset bw limit when DCB enabled with 1 TC" Revert of a patch that instead of fixing a AQ error when trying to reset BW limit introduced several regressions related to creation and managing TC. Currently there are errors when creating a TC on both PF and VF. Error log: [17428.783095] i40e 0000:3b:00.1: AQ command Config VSI BW allocation per TC failed = 14 [17428.783107] i40e 0000:3b:00.1: Failed configuring TC map 0 for VSI 391 [17428.783254] i40e 0000:3b:00.1: AQ command Config VSI BW allocation per TC failed = 14 [17428.783259] i40e 0000:3b:00.1: Unable to configure TC map 0 for VSI 391 This reverts commit 3d2504663c41104b4359a15f35670cfa82de1bbf. Fixes: 3d2504663c41 (i40e: Fix reset bw limit when DCB enabled with 1 TC) Signed-off-by: Mateusz Palczewski Signed-off-by: Tony Nguyen Link: https://lore.kernel.org/r/20220223175347.1690692-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit d9b5ae5c1b241b91480aa30408be12fe91af834a Author: Paul Blakey Date: Wed Feb 23 18:34:16 2022 +0200 openvswitch: Fix setting ipv6 fields causing hw csum failure Ipv6 ttl, label and tos fields are modified without first pulling/pushing the ipv6 header, which would have updated the hw csum (if available). This might cause csum validation when sending the packet to the stack, as can be seen in the trace below. Fix this by updating skb->csum if available. Trace resulted by ipv6 ttl dec and then sending packet to conntrack [actions: set(ipv6(hlimit=63)),ct(zone=99)]: [295241.900063] s_pf0vf2: hw csum failure [295241.923191] Call Trace: [295241.925728] [295241.927836] dump_stack+0x5c/0x80 [295241.931240] __skb_checksum_complete+0xac/0xc0 [295241.935778] nf_conntrack_tcp_packet+0x398/0xba0 [nf_conntrack] [295241.953030] nf_conntrack_in+0x498/0x5e0 [nf_conntrack] [295241.958344] __ovs_ct_lookup+0xac/0x860 [openvswitch] [295241.968532] ovs_ct_execute+0x4a7/0x7c0 [openvswitch] [295241.979167] do_execute_actions+0x54a/0xaa0 [openvswitch] [295242.001482] ovs_execute_actions+0x48/0x100 [openvswitch] [295242.006966] ovs_dp_process_packet+0x96/0x1d0 [openvswitch] [295242.012626] ovs_vport_receive+0x6c/0xc0 [openvswitch] [295242.028763] netdev_frame_hook+0xc0/0x180 [openvswitch] [295242.034074] __netif_receive_skb_core+0x2ca/0xcb0 [295242.047498] netif_receive_skb_internal+0x3e/0xc0 [295242.052291] napi_gro_receive+0xba/0xe0 [295242.056231] mlx5e_handle_rx_cqe_mpwrq_rep+0x12b/0x250 [mlx5_core] [295242.062513] mlx5e_poll_rx_cq+0xa0f/0xa30 [mlx5_core] [295242.067669] mlx5e_napi_poll+0xe1/0x6b0 [mlx5_core] [295242.077958] net_rx_action+0x149/0x3b0 [295242.086762] __do_softirq+0xd7/0x2d6 [295242.090427] irq_exit+0xf7/0x100 [295242.093748] do_IRQ+0x7f/0xd0 [295242.096806] common_interrupt+0xf/0xf [295242.100559] [295242.102750] RIP: 0033:0x7f9022e88cbd [295242.125246] RSP: 002b:00007f9022282b20 EFLAGS: 00000246 ORIG_RAX: ffffffffffffffda [295242.132900] RAX: 0000000000000005 RBX: 0000000000000010 RCX: 0000000000000000 [295242.140120] RDX: 00007f9022282ba8 RSI: 00007f9022282a30 RDI: 00007f9014005c30 [295242.147337] RBP: 00007f9014014d60 R08: 0000000000000020 R09: 00007f90254a8340 [295242.154557] R10: 00007f9022282a28 R11: 0000000000000246 R12: 0000000000000000 [295242.161775] R13: 00007f902308c000 R14: 000000000000002b R15: 00007f9022b71f40 Fixes: 3fdbd1ce11e5 ("openvswitch: add ipv6 'set' action") Signed-off-by: Paul Blakey Link: https://lore.kernel.org/r/20220223163416.24096-1-paulb@nvidia.com Signed-off-by: Jakub Kicinski commit 6c0d8833a605e195ae219b5042577ce52bf71fff Author: Niels Dossche Date: Wed Feb 23 14:19:56 2022 +0100 ipv6: prevent a possible race condition with lifetimes valid_lft, prefered_lft and tstamp are always accessed under the lock "lock" in other places. Reading these without taking the lock may result in inconsistencies regarding the calculation of the valid and preferred variables since decisions are taken on these fields for those variables. Signed-off-by: Niels Dossche Reviewed-by: David Ahern Signed-off-by: Niels Dossche Link: https://lore.kernel.org/r/20220223131954.6570-1-niels.dossche@ugent.be Signed-off-by: Jakub Kicinski commit 7ff57e98fb78ad94edafbdc7435f2d745e9e6bb5 Author: Fabio M. De Francesco Date: Wed Feb 23 11:02:52 2022 +0100 net/smc: Use a mutex for locking "struct smc_pnettable" smc_pnetid_by_table_ib() uses read_lock() and then it calls smc_pnet_apply_ib() which, in turn, calls mutex_lock(&smc_ib_devices.mutex). read_lock() disables preemption. Therefore, the code acquires a mutex while in atomic context and it leads to a SAC bug. Fix this bug by replacing the rwlock with a mutex. Reported-and-tested-by: syzbot+4f322a6d84e991c38775@syzkaller.appspotmail.com Fixes: 64e28b52c7a6 ("net/smc: add pnet table namespace support") Confirmed-by: Tony Lu Signed-off-by: Fabio M. De Francesco Acked-by: Karsten Graul Link: https://lore.kernel.org/r/20220223100252.22562-1-fmdefrancesco@gmail.com Signed-off-by: Jakub Kicinski commit e13ad1443684f7afaff24cf207e85e97885256bd Author: Manish Chopra Date: Wed Feb 23 00:57:20 2022 -0800 bnx2x: fix driver load from initrd Commit b7a49f73059f ("bnx2x: Utilize firmware 7.13.21.0") added new firmware support in the driver with maintaining older firmware compatibility. However, older firmware was not added in MODULE_FIRMWARE() which caused missing firmware files in initrd image leading to driver load failure from initrd. This patch adds MODULE_FIRMWARE() for older firmware version to have firmware files included in initrd. Fixes: b7a49f73059f ("bnx2x: Utilize firmware 7.13.21.0") Link: https://bugzilla.kernel.org/show_bug.cgi?id=215627 Signed-off-by: Manish Chopra Signed-off-by: Alok Prasad Signed-off-by: Ariel Elior Link: https://lore.kernel.org/r/20220223085720.12021-1-manishc@marvell.com Signed-off-by: Jakub Kicinski commit e8240addd0a3919e0fd7436416afe9aa6429c484 Author: Marek Marczykowski-Górecki Date: Tue Feb 22 01:18:17 2022 +0100 Revert "xen-netback: Check for hotplug-status existence before watching" This reverts commit 2afeec08ab5c86ae21952151f726bfe184f6b23d. The reasoning in the commit was wrong - the code expected to setup the watch even if 'hotplug-status' didn't exist. In fact, it relied on the watch being fired the first time - to check if maybe 'hotplug-status' is already set to 'connected'. Not registering a watch for non-existing path (which is the case if hotplug script hasn't been executed yet), made the backend not waiting for the hotplug script to execute. This in turns, made the netfront think the interface is fully operational, while in fact it was not (the vif interface on xen-netback side might not be configured yet). This was a workaround for 'hotplug-status' erroneously being removed. But since that is reverted now, the workaround is not necessary either. More discussion at https://lore.kernel.org/xen-devel/afedd7cb-a291-e773-8b0d-4db9b291fa98@ipxe.org/T/#u Signed-off-by: Marek Marczykowski-Górecki Reviewed-by: Paul Durrant Reviewed-by: Michael Brown Link: https://lore.kernel.org/r/20220222001817.2264967-2-marmarek@invisiblethingslab.com Signed-off-by: Jakub Kicinski commit 0f4558ae91870692ce7f509c31c9d6ee721d8cdc Author: Marek Marczykowski-Górecki Date: Tue Feb 22 01:18:16 2022 +0100 Revert "xen-netback: remove 'hotplug-status' once it has served its purpose" This reverts commit 1f2565780e9b7218cf92c7630130e82dcc0fe9c2. The 'hotplug-status' node should not be removed as long as the vif device remains configured. Otherwise the xen-netback would wait for re-running the network script even if it was already called (in case of the frontent re-connecting). But also, it _should_ be removed when the vif device is destroyed (for example when unbinding the driver) - otherwise hotplug script would not configure the device whenever it re-appear. Moving removal of the 'hotplug-status' node was a workaround for nothing calling network script after xen-netback module is reloaded. But when vif interface is re-created (on xen-netback unbind/bind for example), the script should be called, regardless of who does that - currently this case is not handled by the toolstack, and requires manual script call. Keeping hotplug-status=connected to skip the call is wrong and leads to not configured interface. More discussion at https://lore.kernel.org/xen-devel/afedd7cb-a291-e773-8b0d-4db9b291fa98@ipxe.org/T/#u Signed-off-by: Marek Marczykowski-Górecki Reviewed-by: Paul Durrant Link: https://lore.kernel.org/r/20220222001817.2264967-1-marmarek@invisiblethingslab.com Signed-off-by: Jakub Kicinski commit 558732df2122092259ab4ef85594bee11dbb9104 Author: Qu Wenruo Date: Sun Feb 13 15:42:33 2022 +0800 btrfs: reduce extent threshold for autodefrag There is a big gap between inode_should_defrag() and autodefrag extent size threshold. For inode_should_defrag() it has a flexible @small_write value. For compressed extent is 16K, and for non-compressed extent it's 64K. However for autodefrag extent size threshold, it's always fixed to the default value (256K). This means, the following write sequence will trigger autodefrag to defrag ranges which didn't trigger autodefrag: pwrite 0 8k sync pwrite 8k 128K sync The latter 128K write will also be considered as a defrag target (if other conditions are met). While only that 8K write is really triggering autodefrag. Such behavior can cause extra IO for autodefrag. Close the gap, by copying the @small_write value into inode_defrag, so that later autodefrag can use the same @small_write value which triggered autodefrag. With the existing transid value, this allows autodefrag really to scan the ranges which triggered autodefrag. Although this behavior change is mostly reducing the extent_thresh value for autodefrag, I believe in the future we should allow users to specify the autodefrag extent threshold through mount options, but that's an other problem to consider in the future. CC: stable@vger.kernel.org # 5.16+ Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 228a26b912287934789023b4132ba76065d9491c Author: James Morse Date: Fri Dec 10 14:32:56 2021 +0000 arm64: Use the clearbhb instruction in mitigations Future CPUs may implement a clearbhb instruction that is sufficient to mitigate SpectreBHB. CPUs that implement this instruction, but not CSV2.3 must be affected by Spectre-BHB. Add support to use this instruction as the BHB mitigation on CPUs that support it. The instruction is in the hint space, so it will be treated by a NOP as older CPUs. Reviewed-by: Russell King (Oracle) Reviewed-by: Catalin Marinas Signed-off-by: James Morse commit b2750f14007f0e1b36caf51058c161d2c93e63b6 Merge: bb49c6fa8b845 c2700d2886a87 Author: Jens Axboe Date: Thu Feb 24 07:02:15 2022 -0700 Merge tag 'nvme-5.17-2022-02-24' of git://git.infradead.org/nvme into block-5.17 Pull NVMe fixes from Christoph: "nvme fixes for Linux 5.17 - send H2CData PDUs based on MAXH2CDATA (Varun Prakash) - fix passthrough to namespaces with unsupported features (me)" * tag 'nvme-5.17-2022-02-24' of git://git.infradead.org/nvme: nvme-tcp: send H2CData PDUs based on MAXH2CDATA nvme: also mark passthrough-only namespaces ready in nvme_update_ns_info nvme: don't return an error from nvme_configure_metadata commit a5905d6af492ee6a4a2205f0d550b3f931b03d03 Author: James Morse Date: Fri Dec 10 11:16:18 2021 +0000 KVM: arm64: Allow SMCCC_ARCH_WORKAROUND_3 to be discovered and migrated KVM allows the guest to discover whether the ARCH_WORKAROUND SMCCC are implemented, and to preserve that state during migration through its firmware register interface. Add the necessary boiler plate for SMCCC_ARCH_WORKAROUND_3. Reviewed-by: Russell King (Oracle) Reviewed-by: Catalin Marinas Signed-off-by: James Morse commit 558c303c9734af5a813739cd284879227f7297d2 Author: James Morse Date: Wed Nov 10 14:48:00 2021 +0000 arm64: Mitigate spectre style branch history side channels Speculation attacks against some high-performance processors can make use of branch history to influence future speculation. When taking an exception from user-space, a sequence of branches or a firmware call overwrites or invalidates the branch history. The sequence of branches is added to the vectors, and should appear before the first indirect branch. For systems using KPTI the sequence is added to the kpti trampoline where it has a free register as the exit from the trampoline is via a 'ret'. For systems not using KPTI, the same register tricks are used to free up a register in the vectors. For the firmware call, arch-workaround-3 clobbers 4 registers, so there is no choice but to save them to the EL1 stack. This only happens for entry from EL0, so if we take an exception due to the stack access, it will not become re-entrant. For KVM, the existing branch-predictor-hardening vectors are used. When a spectre version of these vectors is in use, the firmware call is sufficient to mitigate against Spectre-BHB. For the non-spectre versions, the sequence of branches is added to the indirect vector. Reviewed-by: Catalin Marinas Signed-off-by: James Morse commit 19eae24b76c27dedfb166dc06a8c48e052cbc814 Merge: aaaba1c86d04d cfc4442c642d5 Author: Greg Kroah-Hartman Date: Thu Feb 24 14:51:45 2022 +0100 Merge tag 'usb-serial-5.17-rc6' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-linus Johan writes: USB-serial fixes for 5.17-rc6 Here's a revert of a commit which erroneously added a device id used for the EPP/MEM mode of ch341 devices. Included are also some new modem device ids. All have been in linux-next with no reported issues. * tag 'usb-serial-5.17-rc6' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial: USB: serial: option: add Telit LE910R1 compositions USB: serial: option: add support for DW5829e Revert "USB: serial: ch341: add new Product ID for CH341A" commit 21d90aaee8d5c2a097ef41f1430d97661233ecc6 Author: Hans de Goede Date: Thu Feb 24 11:18:48 2022 +0100 surface: surface3_power: Fix battery readings on batteries without a serial number The battery on the 2nd hand Surface 3 which I recently bought appears to not have a serial number programmed in. This results in any I2C reads from the registers containing the serial number failing with an I2C NACK. This was causing mshw0011_bix() to fail causing the battery readings to not work at all. Ignore EREMOTEIO (I2C NACK) errors when retrieving the serial number and continue with an empty serial number to fix this. Fixes: b1f81b496b0d ("platform/x86: surface3_power: MSHW0011 rev-eng implementation") BugLink: https://github.com/linux-surface/linux-surface/issues/608 Reviewed-by: Benjamin Tissoires Reviewed-by: Maximilian Luz Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220224101848.7219-1-hdegoede@redhat.com commit 68af28426b3ca1bf9ba21c7d8bdd0ff639e5134c Author: Mario Limonciello Date: Wed Feb 23 11:52:37 2022 -0600 platform/x86: amd-pmc: Set QOS during suspend on CZN w/ timer wakeup commit 59348401ebed ("platform/x86: amd-pmc: Add special handling for timer based S0i3 wakeup") adds support for using another platform timer in lieu of the RTC which doesn't work properly on some systems. This path was validated and worked well before submission. During the 5.16-rc1 merge window other patches were merged that caused this to stop working properly. When this feature was used with 5.16-rc1 or later some OEM laptops with the matching firmware requirements from that commit would shutdown instead of program a timer based wakeup. This was bisected to commit 8d89835b0467 ("PM: suspend: Do not pause cpuidle in the suspend-to-idle path"). This wasn't supposed to cause any negative impacts and also tested well on both Intel and ARM platforms. However this changed the semantics of when CPUs are allowed to be in the deepest state. For the AMD systems in question it appears this causes a firmware crash for timer based wakeup. It's hypothesized to be caused by the `amd-pmc` driver sending `OS_HINT` and all the CPUs going into a deep state while the timer is still being programmed. It's likely a firmware bug, but to avoid it don't allow setting CPUs into the deepest state while using CZN timer wakeup path. If later it's discovered that this also occurs from "regular" suspends without a timer as well or on other silicon, this may be later expanded to run in the suspend path for more scenarios. Cc: stable@vger.kernel.org # 5.16+ Suggested-by: Rafael J. Wysocki Link: https://lore.kernel.org/linux-acpi/BL1PR12MB51570F5BD05980A0DCA1F3F4E23A9@BL1PR12MB5157.namprd12.prod.outlook.com/T/#mee35f39c41a04b624700ab2621c795367f19c90e Fixes: 8d89835b0467 ("PM: suspend: Do not pause cpuidle in the suspend-to-idle path") Fixes: 23f62d7ab25b ("PM: sleep: Pause cpuidle later and resume it earlier during system transitions") Fixes: 59348401ebed ("platform/x86: amd-pmc: Add special handling for timer based S0i3 wakeup" Reviewed-by: Rafael J. Wysocki Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20220223175237.6209-1-mario.limonciello@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit aaaba1c86d04dac8e49bf508b492f81506257da3 Author: Daehwan Jung Date: Tue Feb 22 14:29:28 2022 +0900 usb: gadget: rndis: add spinlock for rndis response list There's no lock for rndis response list. It could cause list corruption if there're two different list_add at the same time like below. It's better to add in rndis_add_response / rndis_free_response / rndis_get_next_response to prevent any race condition on response list. [ 361.894299] [1: irq/191-dwc3:16979] list_add corruption. next->prev should be prev (ffffff80651764d0), but was ffffff883dc36f80. (next=ffffff80651764d0). [ 361.904380] [1: irq/191-dwc3:16979] Call trace: [ 361.904391] [1: irq/191-dwc3:16979] __list_add_valid+0x74/0x90 [ 361.904401] [1: irq/191-dwc3:16979] rndis_msg_parser+0x168/0x8c0 [ 361.904409] [1: irq/191-dwc3:16979] rndis_command_complete+0x24/0x84 [ 361.904417] [1: irq/191-dwc3:16979] usb_gadget_giveback_request+0x20/0xe4 [ 361.904426] [1: irq/191-dwc3:16979] dwc3_gadget_giveback+0x44/0x60 [ 361.904434] [1: irq/191-dwc3:16979] dwc3_ep0_complete_data+0x1e8/0x3a0 [ 361.904442] [1: irq/191-dwc3:16979] dwc3_ep0_interrupt+0x29c/0x3dc [ 361.904450] [1: irq/191-dwc3:16979] dwc3_process_event_entry+0x78/0x6cc [ 361.904457] [1: irq/191-dwc3:16979] dwc3_process_event_buf+0xa0/0x1ec [ 361.904465] [1: irq/191-dwc3:16979] dwc3_thread_interrupt+0x34/0x5c Fixes: f6281af9d62e ("usb: gadget: rndis: use list_for_each_entry_safe") Cc: stable Signed-off-by: Daehwan Jung Link: https://lore.kernel.org/r/1645507768-77687-1-git-send-email-dh10.jung@samsung.com Signed-off-by: Greg Kroah-Hartman commit 84918a89d6efaff075de570b55642b6f4ceeac6d Author: Sebastian Andrzej Siewior Date: Fri Feb 18 18:32:45 2022 +0100 usb: dwc3: gadget: Let the interrupt handler disable bottom halves. The interrupt service routine registered for the gadget is a primary handler which mask the interrupt source and a threaded handler which handles the source of the interrupt. Since the threaded handler is voluntary threaded, the IRQ-core does not disable bottom halves before invoke the handler like it does for the forced-threaded handler. Due to changes in networking it became visible that a network gadget's completions handler may schedule a softirq which remains unprocessed. The gadget's completion handler is usually invoked either in hard-IRQ or soft-IRQ context. In this context it is enough to just raise the softirq because the softirq itself will be handled once that context is left. In the case of the voluntary threaded handler, there is nothing that will process pending softirqs. Which means it remain queued until another random interrupt (on this CPU) fires and handles it on its exit path or another thread locks and unlocks a lock with the bh suffix. Worst case is that the CPU goes idle and the NOHZ complains about unhandled softirqs. Disable bottom halves before acquiring the lock (and disabling interrupts) and enable them after dropping the lock. This ensures that any pending softirqs will handled right away. Link: https://lkml.kernel.org/r/c2a64979-73d1-2c22-e048-c275c9f81558@samsung.com Fixes: e5f68b4a3e7b0 ("Revert "usb: dwc3: gadget: remove unnecessary _irqsave()"") Cc: stable Reported-by: Marek Szyprowski Tested-by: Marek Szyprowski Signed-off-by: Sebastian Andrzej Siewior Link: https://lore.kernel.org/r/Yg/YPejVQH3KkRVd@linutronix.de Signed-off-by: Greg Kroah-Hartman commit 7f14c7227f342d9932f9b918893c8814f86d2a0d Author: Szymon Heidrich Date: Mon Feb 21 13:24:56 2022 +0100 USB: gadget: validate endpoint index for xilinx udc Assure that host may not manipulate the index to point past endpoint array. Signed-off-by: Szymon Heidrich Cc: stable Signed-off-by: Greg Kroah-Hartman commit 5facf49702b6d994d3f1c72cffa0e83f3858ee19 Merge: 0228d37bd1a4f ca49df96f9f5e Author: Jakub Kicinski Date: Wed Feb 23 20:30:00 2022 -0800 Merge tag 'mlx5-fixes-2022-02-23' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5 fixes 2022-02-22 This series provides bug fixes to mlx5 driver. Please pull and let me know if there is any problem. * tag 'mlx5-fixes-2022-02-23' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux: net/mlx5e: Fix VF min/max rate parameters interchange mistake net/mlx5e: Add missing increment of count net/mlx5e: MPLSoUDP decap, fix check for unsupported matches net/mlx5e: Fix MPLSoUDP encap to use MPLS action information net/mlx5e: Add feature check for set fec counters net/mlx5e: TC, Skip redundant ct clear actions net/mlx5e: TC, Reject rules with forward and drop actions net/mlx5e: TC, Reject rules with drop and modify hdr action net/mlx5e: kTLS, Use CHECKSUM_UNNECESSARY for device-offloaded packets net/mlx5e: Fix wrong return value on ioctl EEPROM query failure net/mlx5: Fix possible deadlock on rule deletion net/mlx5: Fix tc max supported prio for nic mode net/mlx5: Fix wrong limitation of metadata match on ecpf net/mlx5: Update log_max_qp value to be 17 at most net/mlx5: DR, Fix the threshold that defines when pool sync is initiated net/mlx5: DR, Don't allow match on IP w/o matching on full ethertype/ip_version net/mlx5: DR, Fix slab-out-of-bounds in mlx5_cmd_dr_create_fte net/mlx5: DR, Cache STE shadow memory net/mlx5: Update the list of the PCI supported devices ==================== Link: https://lore.kernel.org/r/20220224001123.365265-1-saeed@kernel.org Signed-off-by: Jakub Kicinski commit 7c17b3d37f1fa1eb0498cdf63d43ce37b23eaae5 Merge: 0c3127933cb5e c1a66c3bc425f Author: Dave Airlie Date: Thu Feb 24 14:27:35 2022 +1000 Merge tag 'amd-drm-fixes-5.17-2022-02-23' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-fixes-5.17-2022-02-23: amdgpu: - Display FP fix - PCO powergating fix - RDNA2 OEM SKU stability fixes - Display PSR fix - PCI ASPM fix - Display link encoder fix for TEST_COMMIT - Raven2 suspend/resume fix - Fix a regression in virtual display support - GPUVM eviction fix Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220223214623.28823-1-alexander.deucher@amd.com commit 0c3127933cb5ee73784bdf6881525d1efc1d4b34 Merge: 753a64c779903 8913e1aea4b32 Author: Dave Airlie Date: Thu Feb 24 14:21:57 2022 +1000 Merge tag 'drm/tegra/for-5.17-rc6' of https://gitlab.freedesktop.org/drm/tegra into drm-fixes drm/tegra: Fixes for v5.17-rc6 Contains a couple of fixes for Tegra186 suspend/resume, syncpoint waiting, a build warning and eDP on older Tegra devices. Signed-off-by: Dave Airlie From: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20220223161903.293392-1-thierry.reding@gmail.com commit 753a64c7799034a413083ad03b9fe51dfcad9fb2 Merge: cfb92440ee71a ecbd4912a693b Author: Dave Airlie Date: Thu Feb 24 13:51:46 2022 +1000 Merge tag 'drm-misc-fixes-2022-02-23' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes * edid: Always set RGB444 * imx/dcss: Select GEM CMA helpers * radeon: Fix some variables's type * vc4: Fix codec cleanup; Fix PM reference counting Signed-off-by: Dave Airlie From: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/YhaKj4zWJ42YWRts@linux-uq9g.fritz.box commit 7414db411919980bc4c9bab11d5d040b5dd7667c Author: Arnaldo Carvalho de Melo Date: Wed Feb 23 14:18:31 2022 -0300 rtla: Fix systme -> system typo on man page Link: https://lkml.kernel.org/r/YhZsZxqk+IaFxorj@kernel.org Fixes: 496082df01bb08a4 ("rtla: Add rtla osnoise man page") Signed-off-by: Arnaldo Carvalho de Melo Acked-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) commit 91318b29a81cf51451ecf1c0054898f67dc26d87 Merge: 54134be658036 0c0822bcb73f1 Author: Linus Torvalds Date: Wed Feb 23 17:25:22 2022 -0800 Merge tag 'devicetree-fixes-for-5.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux Pull devicetree fixes from Rob Herring: - Update some maintainers email addresses - Fix handling of elfcorehdr reservation for crash dump kernel - Fix unittest expected warnings text * tag 'devicetree-fixes-for-5.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: dt-bindings: update Roger Quadros email MAINTAINERS: sifive: drop Yash Shah of/fdt: move elfcorehdr reservation early for crash dump kernel of: unittest: update text of expected warnings commit 54134be6580364ab98db09eb8070a09bb02e37ae Merge: 23d04328444a8 ce2fc710c9d2b Author: Linus Torvalds Date: Wed Feb 23 17:19:55 2022 -0800 Merge tag 'selinux-pr-20220223' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux Pull selinux fix from Paul Moore: "A second small SELinux fix which addresses an incorrect mutex_is_locked() check" * tag 'selinux-pr-20220223' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux: selinux: fix misuse of mutex_is_locked() commit ca49df96f9f5efd4f0f1e64f7c4c0c63a3329cb9 Author: Gal Pressman Date: Mon Feb 21 17:54:34 2022 +0200 net/mlx5e: Fix VF min/max rate parameters interchange mistake The VF min and max rate were passed incorrectly and resulted in wrongly interchanging them. Fix the order of parameters in mlx5_esw_qos_set_vport_rate(). Fixes: d7df09f5e7b4 ("net/mlx5: E-switch, Enable vport QoS on demand") Signed-off-by: Gal Pressman Reviewed-by: Aya Levin Signed-off-by: Saeed Mahameed commit 5ee02b7a800654ff9549807bcf0b4c9fd5cf25f9 Author: Lama Kayal Date: Mon Feb 21 12:26:11 2022 +0200 net/mlx5e: Add missing increment of count Add mistakenly missing increment of count variable when looping over output buffer in mlx5e_self_test(). This resolves the issue of garbage values output when querying with self test via ethtool. before: $ ethtool -t eth2 The test result is PASS The test extra info: Link Test 0 Speed Test 1768697188 Health Test 758528120 Loopback Test 3288687 after: $ ethtool -t eth2 The test result is PASS The test extra info: Link Test 0 Speed Test 0 Health Test 0 Loopback Test 0 Fixes: 7990b1b5e8bd ("net/mlx5e: loopback test is not supported in switchdev mode") Signed-off-by: Lama Kayal Reviewed-by: Gal Pressman Signed-off-by: Saeed Mahameed commit fdc18e4e4bded2a08638cdcd22dc087a64b9ddad Author: Maor Dickman Date: Thu Jan 6 14:46:24 2022 +0200 net/mlx5e: MPLSoUDP decap, fix check for unsupported matches Currently offload of rule on bareudp device require tunnel key in order to match on mpls fields and without it the mpls fields are ignored, this is incorrect due to the fact udp tunnel doesn't have key to match on. Fix by returning error in case flow is matching on tunnel key. Fixes: 72046a91d134 ("net/mlx5e: Allow to match on mpls parameters") Signed-off-by: Maor Dickman Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit c63741b426e11062631b013c3396f5452bbc0034 Author: Maor Dickman Date: Thu Jan 6 14:10:18 2022 +0200 net/mlx5e: Fix MPLSoUDP encap to use MPLS action information Currently the MPLSoUDP encap builds the MPLS header using encap action information (tunnel id, ttl and tos) instead of the MPLS action information (label, ttl, tc and bos) which is wrong. Fix by storing the MPLS action information during the flow action parse and later using it to create the encap MPLS header. Fixes: f828ca6a2fb6 ("net/mlx5e: Add support for hw encapsulation of MPLS over UDP") Signed-off-by: Maor Dickman Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 7fac0529038021919ef56a9c3218d8012f187cbb Author: Lama Kayal Date: Tue Feb 1 11:24:41 2022 +0200 net/mlx5e: Add feature check for set fec counters Fec counters support is checked via the PCAM feature_cap_mask, bit 0: PPCNT_counter_group_Phy_statistical_counter_group. Add feature check to avoid faulty behavior. Fixes: 0a1498ebfa55 ("net/mlx5e: Expose FEC counters via ethtool") Signed-off-by: Lama Kayal Reviewed-by: Gal Pressman Signed-off-by: Saeed Mahameed commit fb7e76ea3f3b6238dda2f19a4212052d2caf00aa Author: Roi Dayan Date: Thu Feb 3 09:42:19 2022 +0200 net/mlx5e: TC, Skip redundant ct clear actions Offload of ct clear action is just resetting the reg_c register. It's done by allocating modify hdr resources which is limited. Doing it multiple times is redundant and wasting modify hdr resources and if resources depleted the driver will fail offloading the rule. Ignore redundant ct clear actions after the first one. Fixes: 806401c20a0f ("net/mlx5e: CT, Fix multiple allocations and memleak of mod acts") Signed-off-by: Roi Dayan Reviewed-by: Ariel Levkovich Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed commit 3d65492a86d4e6675734646929759138a023d914 Author: Roi Dayan Date: Mon Jan 17 15:00:30 2022 +0200 net/mlx5e: TC, Reject rules with forward and drop actions Such rules are redundant but allowed and passed to the driver. The driver does not support offloading such rules so return an error. Fixes: 03a9d11e6eeb ("net/mlx5e: Add TC drop and mirred/redirect action parsing for SRIOV offloads") Signed-off-by: Roi Dayan Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed commit 23216d387c40b090b221ad457c95912fb47eb11e Author: Roi Dayan Date: Tue Jan 4 10:38:02 2022 +0200 net/mlx5e: TC, Reject rules with drop and modify hdr action This kind of action is not supported by firmware and generates a syndrome. kernel: mlx5_core 0000:08:00.0: mlx5_cmd_check:777:(pid 102063): SET_FLOW_TABLE_ENTRY(0x936) op_mod(0x0) failed, status bad parameter(0x3), syndrome (0x8708c3) Fixes: d7e75a325cb2 ("net/mlx5e: Add offloading of E-Switch TC pedit (header re-write) actions") Signed-off-by: Roi Dayan Reviewed-by: Maor Dickman Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed commit 7eaf1f37b8817c608c4e959d69986ef459d345cd Author: Tariq Toukan Date: Mon Jan 31 10:26:19 2022 +0200 net/mlx5e: kTLS, Use CHECKSUM_UNNECESSARY for device-offloaded packets For RX TLS device-offloaded packets, the HW spec guarantees checksum validation for the offloaded packets, but does not define whether the CQE.checksum field matches the original packet (ciphertext) or the decrypted one (plaintext). This latitude allows architetctural improvements between generations of chips, resulting in different decisions regarding the value type of CQE.checksum. Hence, for these packets, the device driver should not make use of this CQE field. Here we block CHECKSUM_COMPLETE usage for RX TLS device-offloaded packets, and use CHECKSUM_UNNECESSARY instead. Value of the packet's tcp_hdr.csum is not modified by the HW, and it always matches the original ciphertext. Fixes: 1182f3659357 ("net/mlx5e: kTLS, Add kTLS RX HW offload support") Signed-off-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 0b89429722353d112f8b8b29ca397e95fa994d27 Author: Gal Pressman Date: Wed Feb 2 16:07:21 2022 +0200 net/mlx5e: Fix wrong return value on ioctl EEPROM query failure The ioctl EEPROM query wrongly returns success on read failures, fix that by returning the appropriate error code. Fixes: bb64143eee8c ("net/mlx5e: Add ethtool support for dump module EEPROM") Signed-off-by: Gal Pressman Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit b645e57debca846f51b3209907546ea857ddd3f5 Author: Maor Gottlieb Date: Mon Jan 24 21:25:04 2022 +0200 net/mlx5: Fix possible deadlock on rule deletion Add missing call to up_write_ref_node() which releases the semaphore in case the FTE doesn't have destinations, such in drop rule case. Fixes: 465e7baab6d9 ("net/mlx5: Fix deletion of duplicate rules") Signed-off-by: Maor Gottlieb Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit be7f4b0ab149afd19514929fad824b2117d238c9 Author: Chris Mi Date: Tue Dec 14 03:52:53 2021 +0200 net/mlx5: Fix tc max supported prio for nic mode Only prio 1 is supported if firmware doesn't support ignore flow level for nic mode. The offending commit removed the check wrongly. Add it back. Fixes: 9a99c8f1253a ("net/mlx5e: E-Switch, Offload all chain 0 priorities when modify header and forward action is not supported") Signed-off-by: Chris Mi Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 07666c75ad17d7389b18ac0235c8cf41e1504ea8 Author: Ariel Levkovich Date: Sat Jan 29 01:39:24 2022 +0200 net/mlx5: Fix wrong limitation of metadata match on ecpf Match metadata support check returns false for ecpf device. However, this support does exist for ecpf and therefore this limitation should be removed to allow feature such as stacked devices and internal port offloaded to be supported. Fixes: 92ab1eb392c6 ("net/mlx5: E-Switch, Enable vport metadata matching if firmware supports it") Signed-off-by: Ariel Levkovich Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed commit 7f839965b2d77e1926ad08b23c51d60988f10a99 Author: Maher Sanalla Date: Wed Feb 16 11:01:04 2022 +0200 net/mlx5: Update log_max_qp value to be 17 at most Currently, log_max_qp value is dependent on what FW reports as its max capability. In reality, due to a bug, some FWs report a value greater than 17, even though they don't support log_max_qp > 17. This FW issue led the driver to exhaust memory on startup. Thus, log_max_qp value is set to be no more than 17 regardless of what FW reports, as it was before the cited commit. Fixes: f79a609ea6bf ("net/mlx5: Update log_max_qp value to FW max capability") Signed-off-by: Maher Sanalla Reviewed-by: Avihai Horon Signed-off-by: Saeed Mahameed commit ecd9c5cd46e013659e2fad433057bad1ba66888e Author: Yevgeny Kliteynik Date: Wed Dec 29 22:22:05 2021 +0200 net/mlx5: DR, Fix the threshold that defines when pool sync is initiated When deciding whether to start syncing and actually free all the "hot" ICM chunks, we need to consider the type of the ICM chunks that we're dealing with. For instance, the amount of available ICM for MODIFY_ACTION is significantly lower than the usual STE ICM, so the threshold should account for that - otherwise we can deplete MODIFY_ACTION memory just by creating and deleting the same modify header action in a continuous loop. This patch replaces the hard-coded threshold with a dynamic value. Fixes: 1c58651412bb ("net/mlx5: DR, ICM memory pools sync optimization") Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex Vesker Signed-off-by: Saeed Mahameed commit ffb0753b954763d94f52c901adfe58ed0d4005e6 Author: Yevgeny Kliteynik Date: Thu Jan 13 14:52:48 2022 +0200 net/mlx5: DR, Don't allow match on IP w/o matching on full ethertype/ip_version Currently SMFS allows adding rule with matching on src/dst IP w/o matching on full ethertype or ip_version, which is not supported by HW. This patch fixes this issue and adds the check as it is done in DMFS. Fixes: 26d688e33f88 ("net/mlx5: DR, Add Steering entry (STE) utilities") Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex Vesker Signed-off-by: Saeed Mahameed commit 0aec12d97b2036af0946e3d582144739860ac07b Author: Yevgeny Kliteynik Date: Tue Jan 11 03:00:03 2022 +0200 net/mlx5: DR, Fix slab-out-of-bounds in mlx5_cmd_dr_create_fte When adding a rule with 32 destinations, we hit the following out-of-band access issue: BUG: KASAN: slab-out-of-bounds in mlx5_cmd_dr_create_fte+0x18ee/0x1e70 This patch fixes the issue by both increasing the allocated buffers to accommodate for the needed actions and by checking the number of actions to prevent this issue when a rule with too many actions is provided. Fixes: 1ffd498901c1 ("net/mlx5: DR, Increase supported num of actions to 32") Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex Vesker Signed-off-by: Saeed Mahameed commit e5b2bc30c21139ae10f0e56989389d0bc7b7b1d6 Author: Yevgeny Kliteynik Date: Fri Dec 24 01:07:30 2021 +0200 net/mlx5: DR, Cache STE shadow memory During rule insertion on each ICM memory chunk we also allocate shadow memory used for management. This includes the hw_ste, dr_ste and miss list per entry. Since the scale of these allocations is large we noticed a performance hiccup that happens once malloc and free are stressed. In extreme usecases when ~1M chunks are freed at once, it might take up to 40 seconds to complete this, up to the point the kernel sees this as self-detected stall on CPU: rcu: INFO: rcu_sched self-detected stall on CPU To resolve this we will increase the reuse of shadow memory. Doing this we see that a time in the aforementioned usecase dropped from ~40 seconds to ~8-10 seconds. Fixes: 29cf8febd185 ("net/mlx5: DR, ICM pool memory allocator") Signed-off-by: Alex Vesker Signed-off-by: Yevgeny Kliteynik Signed-off-by: Saeed Mahameed commit f908a35b22180c4da64cf2647e4f5f0cd3054da7 Author: Meir Lichtinger Date: Mon Jan 10 10:14:41 2022 +0200 net/mlx5: Update the list of the PCI supported devices Add the upcoming BlueField-4 and ConnectX-8 device IDs. Fixes: 2e9d3e83ab82 ("net/mlx5: Update the list of the PCI supported devices") Signed-off-by: Meir Lichtinger Reviewed-by: Gal Pressman Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit c1a66c3bc425ff93774fb2f6eefa67b83170dd7e Author: Qiang Yu Date: Mon Feb 21 17:53:56 2022 +0800 drm/amdgpu: check vm ready by amdgpu_vm->evicting flag Workstation application ANSA/META v21.1.4 get this error dmesg when running CI test suite provided by ANSA/META: [drm:amdgpu_gem_va_ioctl [amdgpu]] *ERROR* Couldn't update BO_VA (-16) This is caused by: 1. create a 256MB buffer in invisible VRAM 2. CPU map the buffer and access it causes vm_fault and try to move it to visible VRAM 3. force visible VRAM space and traverse all VRAM bos to check if evicting this bo is valuable 4. when checking a VM bo (in invisible VRAM), amdgpu_vm_evictable() will set amdgpu_vm->evicting, but latter due to not in visible VRAM, won't really evict it so not add it to amdgpu_vm->evicted 5. before next CS to clear the amdgpu_vm->evicting, user VM ops ioctl will pass amdgpu_vm_ready() (check amdgpu_vm->evicted) but fail in amdgpu_vm_bo_update_mapping() (check amdgpu_vm->evicting) and get this error log This error won't affect functionality as next CS will finish the waiting VM ops. But we'd better clear the error log by checking the amdgpu_vm->evicting flag in amdgpu_vm_ready() to stop calling amdgpu_vm_bo_update_mapping() later. Another reason is amdgpu_vm->evicted list holds all BOs (both user buffer and page table), but only page table BOs' eviction prevent VM ops. amdgpu_vm->evicting flag is set only for page table BOs, so we should use evicting flag instead of evicted list in amdgpu_vm_ready(). The side effect of this change is: previously blocked VM op (user buffer in "evicted" list but no page table in it) gets done immediately. v2: update commit comments. Acked-by: Paul Menzel Reviewed-by: Christian König Signed-off-by: Qiang Yu Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit e2b993302f40c4eb714ecf896dd9e1c5be7d4cd7 Author: Guchun Chen Date: Fri Feb 18 13:05:26 2022 +0800 drm/amdgpu: bypass tiling flag check in virtual display case (v2) vkms leverages common amdgpu framebuffer creation, and also as it does not support FB modifier, there is no need to check tiling flags when initing framebuffer when virtual display is enabled. This can fix below calltrace: amdgpu 0000:00:08.0: GFX9+ requires FB check based on format modifier WARNING: CPU: 0 PID: 1023 at drivers/gpu/drm/amd/amdgpu/amdgpu_display.c:1150 amdgpu_display_framebuffer_init+0x8e7/0xb40 [amdgpu] v2: check adev->enable_virtual_display instead as vkms can be enabled in bare metal as well. Signed-off-by: Leslie Shi Signed-off-by: Guchun Chen Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 97c61e0b7c596cc5f683da30289f92c2e1b4b799 Author: Guchun Chen Date: Fri Feb 18 12:57:52 2022 +0800 Revert "drm/amdgpu: add modifiers in amdgpu_vkms_plane_init()" This reverts commit 4046afcebfc3c8c0dd5666c2671b2c192b344f78. No need to support modifier in virtual kms, otherwise, in SRIOV mode, when lanuching X server, set crtc will fail due to mismatch between primary plane modifier and framebuffer modifier. Signed-off-by: Guchun Chen Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 1e2be869c8a7247a7253ef4f461f85e2f5931b95 Author: Chen Gong Date: Thu Feb 17 15:29:41 2022 +0800 drm/amdgpu: do not enable asic reset for raven2 The GPU reset function of raven2 is not maintained or tested, so it should be very unstable. Now the amdgpu_asic_reset function is added to amdgpu_pmops_suspend, which causes the S3 test of raven2 to fail, so the asic_reset of raven2 is ignored here. Fixes: daf8de0874ab5b ("drm/amdgpu: always reset the asic in suspend (v2)") Signed-off-by: Chen Gong Acked-by: Alex Deucher Reviewed-by: Mario Limonciello Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 3743e7f6fcb938b7d8b7967e6a9442805e269b3d Author: Nicholas Kazlauskas Date: Tue Jan 25 12:04:34 2022 -0500 drm/amd/display: Fix stream->link_enc unassigned during stream removal [Why] Found when running igt@kms_atomic. Userspace attempts to do a TEST_COMMIT when 0 streams which calls dc_remove_stream_from_ctx. This in turn calls link_enc_unassign which ends up modifying stream->link = NULL directly, causing the global link_enc to be removed preventing further link activity and future link validation from passing. [How] We take care of link_enc unassignment at the start of link_enc_cfg_link_encs_assign so this call is no longer necessary. Fixes global state from being modified while unlocked. Reviewed-by: Jimmy Kizito Acked-by: Jasdeep Dhillon Signed-off-by: Nicholas Kazlauskas Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 7294863a6f01248d72b61d38478978d638641bee Author: Mario Limonciello Date: Tue Feb 1 10:26:33 2022 -0600 drm/amd: Check if ASPM is enabled from PCIe subsystem commit 0064b0ce85bb ("drm/amd/pm: enable ASPM by default") enabled ASPM by default but a variety of hardware configurations it turns out that this caused a regression. * PPC64LE hardware does not support ASPM at a hardware level. CONFIG_PCIEASPM is often disabled on these architectures. * Some dGPUs on ALD platforms don't work with ASPM enabled and PCIe subsystem disables it Check with the PCIe subsystem to see that ASPM has been enabled or not. Fixes: 0064b0ce85bb ("drm/amd/pm: enable ASPM by default") Link: https://wiki.raptorcs.com/w/images/a/ad/P9_PHB_version1.0_27July2018_pub.pdf Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1723 Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1739 Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1885 Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1907 Tested-by: koba.ko@canonical.com Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit ae42f9288846353982e2eab181fb41e7fd8bf60f Author: Shreeya Patel Date: Thu Feb 17 01:56:55 2022 +0530 gpio: Return EPROBE_DEFER if gc->to_irq is NULL We are racing the registering of .to_irq when probing the i2c driver. This results in random failure of touchscreen devices. Following explains the race condition better. [gpio driver] gpio driver registers gpio chip [gpio consumer] gpio is acquired [gpio consumer] gpiod_to_irq() fails with -ENXIO [gpio driver] gpio driver registers irqchip gpiod_to_irq works at this point, but -ENXIO is fatal We could see the following errors in dmesg logs when gc->to_irq is NULL [2.101857] i2c_hid i2c-FTS3528:00: HID over i2c has not been provided an Int IRQ [2.101953] i2c_hid: probe of i2c-FTS3528:00 failed with error -22 To avoid this situation, defer probing until to_irq is registered. Returning -EPROBE_DEFER would be the first step towards avoiding the failure of devices due to the race in registration of .to_irq. Final solution to this issue would be to avoid using gc irq members until they are fully initialized. This issue has been reported many times in past and people have been using workarounds like changing the pinctrl_amd to built-in instead of loading it as a module or by adding a softdep for pinctrl_amd into the config file. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=209413 Reviewed-by: Linus Walleij Reviewed-by: Andy Shevchenko Reported-by: kernel test robot Signed-off-by: Shreeya Patel Signed-off-by: Bartosz Golaszewski commit 23d04328444a8fa0ca060c5e532220dac8e8bc26 Merge: 6f5738db96ddc a97279836867b Author: Linus Torvalds Date: Wed Feb 23 12:06:23 2022 -0800 Merge tag 'for-5.17/parisc-4' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux Pull parisc unaligned handler fixes from Helge Deller: "Two patches which fix a few bugs in the unalignment handlers. The fldd and fstd instructions weren't handled at all on 32-bit kernels, the stw instruction didn't check for fault errors and the fldw_l and ldw_m were handled wrongly as integer vs floating point instructions. Both patches are tagged for stable series" * tag 'for-5.17/parisc-4' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc/unaligned: Fix ldw() and stw() unalignment handlers parisc/unaligned: Fix fldd and fstd unaligned handlers on 32-bit kernel commit 6f5738db96ddc3525de21990ed569ef43e05f42d Merge: 4eb0a7c8e195d 35f165f08950a Author: Linus Torvalds Date: Wed Feb 23 11:51:35 2022 -0800 Merge tag 'hwmon-for-v5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging Pull hwmon fixes from Guenter Roeck: "Fix two old bugs and one new bug in the hwmon subsystem: - In pmbus core, clear pmbus fault/warning status bits after read to follow PMBus standard - In hwmon core, handle failure to register sensor with thermal zone correctly - In ntc_thermal driver, use valid thermistor names for Samsung thermistors" * tag 'hwmon-for-v5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: hwmon: (pmbus) Clear pmbus fault/warning bits after read hwmon: Handle failure to register sensor with thermal zone correctly hwmon: (ntc_thermistor) Underscore Samsung thermistor commit 4eb0a7c8e195d4549221f9df3a0313254c493949 Merge: 5c1ee569660d4 221944736f66f Author: Linus Torvalds Date: Wed Feb 23 11:33:12 2022 -0800 Merge tag 'slab-for-5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab Pull slab fixes from Vlastimil Babka: - Build fix (workaround) for clang. - Fix a /proc/kcore based slabinfo script broken by struct slab changes in 5.17-rc1. * tag 'slab-for-5.17-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab: tools/cgroup/slabinfo: update to work with struct slab slab: remove __alloc_size attribute from __kmalloc_track_caller commit 081bdc9fe05bb23248f5effb6f811da3da4b8252 Author: Bart Van Assche Date: Tue Feb 15 13:05:11 2022 -0800 RDMA/ib_srp: Fix a deadlock Remove the flush_workqueue(system_long_wq) call since flushing system_long_wq is deadlock-prone and since that call is redundant with a preceding cancel_work_sync() Link: https://lore.kernel.org/r/20220215210511.28303-3-bvanassche@acm.org Fixes: ef6c49d87c34 ("IB/srp: Eliminate state SRP_TARGET_DEAD") Reported-by: syzbot+831661966588c802aae9@syzkaller.appspotmail.com Signed-off-by: Bart Van Assche Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 515415d316168c6521d74ea8280287e28d7303e6 Author: Maxime Ripard Date: Sat Feb 19 13:07:55 2022 +0100 ARM: boot: dts: bcm2711: Fix HVS register range While the HVS has the same context memory size in the BCM2711 than in the previous SoCs, the range allocated to the registers doubled and it now takes 16k + 16k, compared to 8k + 16k before. The KMS driver will use the whole context RAM though, eventually resulting in a pointer dereference error when we access the higher half of the context memory since it hasn't been mapped. Fixes: 4564363351e2 ("ARM: dts: bcm2711: Enable the display pipeline") Signed-off-by: Maxime Ripard Signed-off-by: Stefan Wahren Signed-off-by: Florian Fainelli commit 3f1271b54edcc692da5a3663f2aa2a64781f9bc3 Author: Alex Deucher Date: Tue Feb 22 11:08:01 2022 -0500 PCI: Mark all AMD Navi10 and Navi14 GPU ATS as broken There are enough VBIOS escapes without the proper workaround that some users still hit this. Microsoft never productized ATS on Windows so OEM platforms that were Windows-only didn't always validate ATS. The advantages of ATS are not worth it compared to the potential instabilities on harvested boards. Disable ATS on all Navi10 and Navi14 boards. Symptoms include: amdgpu 0000:07:00.0: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0007 address=0xffffc02000 flags=0x0000] AMD-Vi: Event logged [IO_PAGE_FAULT device=07:00.0 domain=0x0007 address=0xffffc02000 flags=0x0000] [drm:amdgpu_job_timedout [amdgpu]] *ERROR* ring sdma0 timeout, signaled seq=6047, emitted seq=6049 amdgpu 0000:07:00.0: amdgpu: GPU reset begin! amdgpu 0000:07:00.0: amdgpu: GPU reset succeeded, trying to resume amdgpu 0000:07:00.0: [drm:amdgpu_ring_test_helper [amdgpu]] *ERROR* ring sdma0 test failed (-110) [drm:amdgpu_device_ip_resume_phase2 [amdgpu]] *ERROR* resume of IP block failed -110 amdgpu 0000:07:00.0: amdgpu: GPU reset(1) failed Related commits: e8946a53e2a6 ("PCI: Mark AMD Navi14 GPU ATS as broken") a2da5d8cc0b0 ("PCI: Mark AMD Raven iGPU ATS as broken in some platforms") 45beb31d3afb ("PCI: Mark AMD Navi10 GPU rev 0x00 ATS as broken") 5e89cd303e3a ("PCI: Mark AMD Navi14 GPU rev 0xc5 ATS as broken") d28ca864c493 ("PCI: Mark AMD Stoney Radeon R7 GPU ATS as broken") 9b44b0b09dec ("PCI: Mark AMD Stoney GPU ATS as broken") [bhelgaas: add symptoms and related commits] Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1760 Link: https://lore.kernel.org/r/20220222160801.841643-1-alexander.deucher@amd.com Signed-off-by: Alex Deucher Signed-off-by: Bjorn Helgaas Acked-by: Christian König Acked-by: Guchun Chen commit a97279836867b1cb50a3d4f0b1bf60e0abe6d46c Author: Helge Deller Date: Fri Feb 18 23:40:14 2022 +0100 parisc/unaligned: Fix ldw() and stw() unalignment handlers Fix 3 bugs: a) emulate_stw() doesn't return the error code value, so faulting instructions are not reported and aborted. b) Tell emulate_ldw() to handle fldw_l as floating point instruction c) Tell emulate_ldw() to handle ldw_m as integer instruction Signed-off-by: Helge Deller Cc: stable@vger.kernel.org commit dd2288f4a020d693360e3e8d72f8b9d9c25f5ef6 Author: Helge Deller Date: Fri Feb 18 09:25:20 2022 +0100 parisc/unaligned: Fix fldd and fstd unaligned handlers on 32-bit kernel Usually the kernel provides fixup routines to emulate the fldd and fstd floating-point instructions if they load or store 8-byte from/to a not natuarally aligned memory location. On a 32-bit kernel I noticed that those unaligned handlers didn't worked and instead the application got a SEGV. While checking the code I found two problems: First, the OPCODE_FLDD_L and OPCODE_FSTD_L cases were ifdef'ed out by the CONFIG_PA20 option, and as such those weren't built on a pure 32-bit kernel. This is now fixed by moving the CONFIG_PA20 #ifdef to prevent the compilation of OPCODE_LDD_L and OPCODE_FSTD_L only, and handling the fldd and fstd instructions. The second problem are two bugs in the 32-bit inline assembly code, where the wrong registers where used. The calculation of the natural alignment used %2 (vall) instead of %3 (ior), and the first word was stored back to address %1 (valh) instead of %3 (ior). Signed-off-by: Helge Deller Cc: stable@vger.kernel.org commit 26fbac2517fcad34fa3f950151fd4c0240fb2935 Author: Qu Wenruo Date: Tue Feb 22 18:20:59 2022 +0100 btrfs: autodefrag: only scan one inode once Although we have btrfs_requeue_inode_defrag(), for autodefrag we are still just exhausting all inode_defrag items in the tree. This means, it doesn't make much difference to requeue an inode_defrag, other than scan the inode from the beginning till its end. Change the behaviour to always scan from offset 0 of an inode, and till the end. By this we get the following benefit: - Straight-forward code - No more re-queue related check - Fewer members in inode_defrag We still keep the same btrfs_get_fs_root() and btrfs_iget() check for each loop, and added extra should_auto_defrag() check per-loop. Note: the patch needs to be backported and is intentionally written to minimize the diff size, code will be cleaned up later. CC: stable@vger.kernel.org # 5.16 Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 199257a78bb01341c3ba6e85bdcf3a2e6e452c6d Author: Qu Wenruo Date: Fri Feb 11 14:46:13 2022 +0800 btrfs: defrag: don't use merged extent map for their generation check For extent maps, if they are not compressed extents and are adjacent by logical addresses and file offsets, they can be merged into one larger extent map. Such merged extent map will have the higher generation of all the original ones. But this brings a problem for autodefrag, as it relies on accurate extent_map::generation to determine if one extent should be defragged. For merged extent maps, their higher generation can mark some older extents to be defragged while the original extent map doesn't meet the minimal generation threshold. Thus this will cause extra IO. So solve the problem, here we introduce a new flag, EXTENT_FLAG_MERGED, to indicate if the extent map is merged from one or more ems. And for autodefrag, if we find a merged extent map, and its generation meets the generation requirement, we just don't use this one, and go back to defrag_get_extent() to read extent maps from subvolume trees. This could cause more read IO, but should result less defrag data write, so in the long run it should be a win for autodefrag. Reviewed-by: Filipe Manana Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit d5633b0dee02d7d25e93463a03709f11c71500e2 Author: Qu Wenruo Date: Fri Feb 11 14:46:12 2022 +0800 btrfs: defrag: bring back the old file extent search behavior For defrag, we don't really want to use btrfs_get_extent() to iterate all extent maps of an inode. The reasons are: - btrfs_get_extent() can merge extent maps And the result em has the higher generation of the two, causing defrag to mark unnecessary part of such merged large extent map. This in fact can result extra IO for autodefrag in v5.16+ kernels. However this patch is not going to completely solve the problem, as one can still using read() to trigger extent map reading, and got them merged. The completely solution for the extent map merging generation problem will come as an standalone fix. - btrfs_get_extent() caches the extent map result Normally it's fine, but for defrag the target range may not get another read/write for a long long time. Such cache would only increase the memory usage. - btrfs_get_extent() doesn't skip older extent map Unlike the old find_new_extent() which uses btrfs_search_forward() to skip the older subtree, thus it will pick up unnecessary extent maps. This patch will fix the regression by introducing defrag_get_extent() to replace the btrfs_get_extent() call. This helper will: - Not cache the file extent we found It will search the file extent and manually convert it to em. - Use btrfs_search_forward() to skip entire ranges which is modified in the past This should reduce the IO for autodefrag. Reported-by: Filipe Manana Fixes: 7b508037d4ca ("btrfs: defrag: use defrag_one_cluster() to implement btrfs_defrag_file()") Reviewed-by: Filipe Manana Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 550f133f6959db927127111b50e483da3a7ce662 Author: Qu Wenruo Date: Fri Jan 28 15:21:22 2022 +0800 btrfs: defrag: remove an ambiguous condition for rejection From the very beginning of btrfs defrag, there is a check to reject extents which meet both conditions: - Physically adjacent We may want to defrag physically adjacent extents to reduce the number of extents or the size of subvolume tree. - Larger than 128K This may be there for compressed extents, but unfortunately 128K is exactly the max capacity for compressed extents. And the check is > 128K, thus it never rejects compressed extents. Furthermore, the compressed extent capacity bug is fixed by previous patch, there is no reason for that check anymore. The original check has a very small ranges to reject (the target extent size is > 128K, and default extent threshold is 256K), and for compressed extent it doesn't work at all. So it's better just to remove the rejection, and allow us to defrag physically adjacent extents. CC: stable@vger.kernel.org # 5.16 Reviewed-by: Filipe Manana Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 979b25c300dbcbcb750e88715018e04e854de6c6 Author: Qu Wenruo Date: Fri Jan 28 15:21:21 2022 +0800 btrfs: defrag: don't defrag extents which are already at max capacity [BUG] For compressed extents, defrag ioctl will always try to defrag any compressed extents, wasting not only IO but also CPU time to compress/decompress: mkfs.btrfs -f $DEV mount -o compress $DEV $MNT xfs_io -f -c "pwrite -S 0xab 0 128K" $MNT/foobar sync xfs_io -f -c "pwrite -S 0xcd 128K 128K" $MNT/foobar sync echo "=== before ===" xfs_io -c "fiemap -v" $MNT/foobar btrfs filesystem defrag $MNT/foobar sync echo "=== after ===" xfs_io -c "fiemap -v" $MNT/foobar Then it shows the 2 128K extents just get COW for no extra benefit, with extra IO/CPU spent: === before === /mnt/btrfs/file1: EXT: FILE-OFFSET BLOCK-RANGE TOTAL FLAGS 0: [0..255]: 26624..26879 256 0x8 1: [256..511]: 26632..26887 256 0x9 === after === /mnt/btrfs/file1: EXT: FILE-OFFSET BLOCK-RANGE TOTAL FLAGS 0: [0..255]: 26640..26895 256 0x8 1: [256..511]: 26648..26903 256 0x9 This affects not only v5.16 (after the defrag rework), but also v5.15 (before the defrag rework). [CAUSE] From the very beginning, btrfs defrag never checks if one extent is already at its max capacity (128K for compressed extents, 128M otherwise). And the default extent size threshold is 256K, which is already beyond the compressed extent max size. This means, by default btrfs defrag ioctl will mark all compressed extent which is not adjacent to a hole/preallocated range for defrag. [FIX] Introduce a helper to grab the maximum extent size, and then in defrag_collect_targets() and defrag_check_next_extent(), reject extents which are already at their max capacity. Reported-by: Filipe Manana CC: stable@vger.kernel.org # 5.16 Reviewed-by: Filipe Manana Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 7093f15291e95f16dfb5a93307eda3272bfe1108 Author: Qu Wenruo Date: Fri Jan 28 15:21:20 2022 +0800 btrfs: defrag: don't try to merge regular extents with preallocated extents [BUG] With older kernels (before v5.16), btrfs will defrag preallocated extents. While with newer kernels (v5.16 and newer) btrfs will not defrag preallocated extents, but it will defrag the extent just before the preallocated extent, even it's just a single sector. This can be exposed by the following small script: mkfs.btrfs -f $dev > /dev/null mount $dev $mnt xfs_io -f -c "pwrite 0 4k" -c sync -c "falloc 4k 16K" $mnt/file xfs_io -c "fiemap -v" $mnt/file btrfs fi defrag $mnt/file sync xfs_io -c "fiemap -v" $mnt/file The output looks like this on older kernels: /mnt/btrfs/file: EXT: FILE-OFFSET BLOCK-RANGE TOTAL FLAGS 0: [0..7]: 26624..26631 8 0x0 1: [8..39]: 26632..26663 32 0x801 /mnt/btrfs/file: EXT: FILE-OFFSET BLOCK-RANGE TOTAL FLAGS 0: [0..39]: 26664..26703 40 0x1 Which defrags the single sector along with the preallocated extent, and replace them with an regular extent into a new location (caused by data COW). This wastes most of the data IO just for the preallocated range. On the other hand, v5.16 is slightly better: /mnt/btrfs/file: EXT: FILE-OFFSET BLOCK-RANGE TOTAL FLAGS 0: [0..7]: 26624..26631 8 0x0 1: [8..39]: 26632..26663 32 0x801 /mnt/btrfs/file: EXT: FILE-OFFSET BLOCK-RANGE TOTAL FLAGS 0: [0..7]: 26664..26671 8 0x0 1: [8..39]: 26632..26663 32 0x801 The preallocated range is not defragged, but the sector before it still gets defragged, which has no need for it. [CAUSE] One of the function reused by the old and new behavior is defrag_check_next_extent(), it will determine if we should defrag current extent by checking the next one. It only checks if the next extent is a hole or inlined, but it doesn't check if it's preallocated. On the other hand, out of the function, both old and new kernel will reject preallocated extents. Such inconsistent behavior causes above behavior. [FIX] - Also check if next extent is preallocated If so, don't defrag current extent. - Add comments for each branch why we reject the extent This will reduce the IO caused by defrag ioctl and autodefrag. CC: stable@vger.kernel.org # 5.16 Reviewed-by: Filipe Manana Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit ce345f1e48458837a5b064cac94382c095e00e79 Merge: c22a8086b3840 c5487b9cdea5c Author: Takashi Iwai Date: Wed Feb 23 15:06:48 2022 +0100 Merge tag 'asoc-fix-v5.17-rc5' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v5.17 A few more fixes for v5.17, one followup to the bounds checking fixes handling controls which support negative values internally and a driver specific one. commit c2700d2886a87f83f31e0a301de1d2350b52c79b Author: Varun Prakash Date: Sat Jan 22 22:27:44 2022 +0530 nvme-tcp: send H2CData PDUs based on MAXH2CDATA As per NVMe/TCP specification (revision 1.0a, section 3.6.2.3) Maximum Host to Controller Data length (MAXH2CDATA): Specifies the maximum number of PDU-Data bytes per H2CData PDU in bytes. This value is a multiple of dwords and should be no less than 4,096. Current code sets H2CData PDU data_length to r2t_length, it does not check MAXH2CDATA value. Fix this by setting H2CData PDU data_length to min(req->h2cdata_left, queue->maxh2cdata). Also validate MAXH2CDATA value returned by target in ICResp PDU, if it is not a multiple of dword or if it is less than 4096 return -EINVAL from nvme_tcp_init_connection(). Signed-off-by: Varun Prakash Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit 602e57c9799c19f27e440639deed3ec45cfe1651 Author: Christoph Hellwig Date: Wed Feb 16 14:14:58 2022 +0100 nvme: also mark passthrough-only namespaces ready in nvme_update_ns_info Commit e7d65803e2bb ("nvme-multipath: revalidate paths during rescan") introduced the NVME_NS_READY flag, which nvme_path_is_disabled() uses to check if a path can be used or not. We also need to set this flag for devices that fail the ZNS feature validation and which are available through passthrough devices only to that they can be used in multipathing setups. Fixes: e7d65803e2bb ("nvme-multipath: revalidate paths during rescan") Reported-by: Kanchan Joshi Signed-off-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Reviewed-by: Daniel Wagner Tested-by: Kanchan Joshi commit 363f6368603743072e5f318c668c632bccb097a3 Author: Christoph Hellwig Date: Wed Feb 16 15:07:15 2022 +0100 nvme: don't return an error from nvme_configure_metadata When a fabrics controller claims to support an invalidate metadata configuration we already warn and disable metadata support. No need to also return an error during revalidation. Signed-off-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Reviewed-by: Daniel Wagner Tested-by: Kanchan Joshi commit ecbd4912a693b862e25cba0a6990a8c95b00721e Author: Maxime Ripard Date: Thu Feb 3 12:54:16 2022 +0100 drm/edid: Always set RGB444 In order to fill the drm_display_info structure each time an EDID is read, the code currently will call drm_add_display_info with the parsed EDID. drm_add_display_info will then call drm_reset_display_info to reset all the fields to 0, and then set them to the proper value depending on the EDID. In the color_formats case, we will thus report that we don't support any color format, and then fill it back with RGB444 plus the additional formats described in the EDID Feature Support byte. However, since that byte only contains format-related bits since the 1.4 specification, this doesn't happen if the EDID is following an earlier specification. In turn, it means that for one of these EDID, we end up with color_formats set to 0. The EDID 1.3 specification never really specifies what it means by RGB exactly, but since both HDMI and DVI will use RGB444, it's fairly safe to assume it's supposed to be RGB444. Let's move the addition of RGB444 to color_formats earlier in drm_add_display_info() so that it's always set for a digital display. Fixes: da05a5a71ad8 ("drm: parse color format support for digital displays") Cc: Ville Syrjälä Reported-by: Matthias Reichl Signed-off-by: Maxime Ripard Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220203115416.1137308-1-maxime@cerno.tech commit 0228d37bd1a4fa552916e696f70490225272d58a Merge: ecf4a24cf9783 1baf2e50e48f1 Author: David S. Miller Date: Wed Feb 23 12:50:19 2022 +0000 Merge branch 'ftgmac100-fixes' Heyi Guo says: ==================== drivers/net/ftgmac100: fix occasional DHCP failure This patch set is to fix the issues discussed in the mail thread: https://lore.kernel.org/netdev/51f5b7a7-330f-6b3c-253d-10e45cdb6805@linux.alibaba.com/ and follows the advice from Andrew Lunn. The first 2 patches refactors the code to enable adjust_link calling reset function directly. ==================== Signed-off-by: David S. Miller commit 1baf2e50e48f10f0ea07d53e13381fd0da1546d2 Author: Heyi Guo Date: Wed Feb 23 11:14:36 2022 +0800 drivers/net/ftgmac100: fix DHCP potential failure with systemd DHCP failures were observed with systemd 247.6. The issue could be reproduced by rebooting Aspeed 2600 and then running ifconfig ethX down/up. It is caused by below procedures in the driver: 1. ftgmac100_open() enables net interface and call phy_start() 2. When PHY is link up, it calls netif_carrier_on() and then adjust_link callback 3. ftgmac100_adjust_link() will schedule the reset task 4. ftgmac100_reset_task() will then reset the MAC in another schedule After step 2, systemd will be notified to send DHCP discover packet, while the packet might be corrupted by MAC reset operation in step 4. Call ftgmac100_reset() directly instead of scheduling task to fix the issue. Signed-off-by: Heyi Guo Signed-off-by: David S. Miller commit 3c773dba8182cdfea7b32caafe9290240ab8de5f Author: Heyi Guo Date: Wed Feb 23 11:14:35 2022 +0800 drivers/net/ftgmac100: adjust code place for function call dependency This is to prepare for ftgmac100_adjust_link() to call ftgmac100_reset() directly. Only code places are changed. Signed-off-by: Heyi Guo Signed-off-by: David S. Miller commit 4f1e72850d452e5c3302faa82a01f179ff5f9482 Author: Heyi Guo Date: Wed Feb 23 11:14:34 2022 +0800 drivers/net/ftgmac100: refactor ftgmac100_reset_task to enable direct function call This is to prepare for ftgmac100_adjust_link() to call reset function directly, instead of task schedule. Signed-off-by: Heyi Guo Signed-off-by: David S. Miller commit ecf4a24cf97838fb0b78d4ede0f91d80b058289c Author: Wan Jiabing Date: Wed Feb 23 10:34:19 2022 +0800 net: sched: avoid newline at end of message in NL_SET_ERR_MSG_MOD Fix following coccicheck warning: ./net/sched/act_api.c:277:7-49: WARNING avoid newline at end of message in NL_SET_ERR_MSG_MOD Signed-off-by: Wan Jiabing Signed-off-by: David S. Miller commit 404ba13a6588d72b3fb9e5c17b73e4725f18c047 Author: Alvin Šipraga Date: Tue Feb 22 17:14:08 2022 +0100 MAINTAINERS: add myself as co-maintainer for Realtek DSA switch drivers Adding myself (Alvin Šipraga) as another maintainer for the Realtek DSA switch drivers. I intend to help Linus out with reviewing and testing changes to these drivers, particularly the rtl8365mb driver which I authored and have hardware access to. Cc: Linus Walleij Signed-off-by: Alvin Šipraga Reviewed-by: Linus Walleij Signed-off-by: David S. Miller commit a1f8fec4dac8bc7b172b2bdbd881e015261a6322 Author: Dan Carpenter Date: Tue Feb 22 16:43:12 2022 +0300 tipc: Fix end of loop tests for list_for_each_entry() These tests are supposed to check if the loop exited via a break or not. However the tests are wrong because if we did not exit via a break then "p" is not a valid pointer. In that case, it's the equivalent of "if (*(u32 *)sr == *last_key) {". That's going to work most of the time, but there is a potential for those to be equal. Fixes: 1593123a6a49 ("tipc: add name table dump to new netlink api") Fixes: 1a1a143daf84 ("tipc: add publication dump to new netlink api") Signed-off-by: Dan Carpenter Signed-off-by: David S. Miller commit de7b2efacf4e83954aed3f029d347dfc0b7a4f49 Author: Dan Carpenter Date: Tue Feb 22 16:42:51 2022 +0300 udp_tunnel: Fix end of loop test in udp_tunnel_nic_unregister() This test is checking if we exited the list via break or not. However if it did not exit via a break then "node" does not point to a valid udp_tunnel_nic_shared_node struct. It will work because of the way the structs are laid out it's the equivalent of "if (info->shared->udp_tunnel_nic_info != dev)" which will always be true, but it's not the right way to test. Fixes: 74cc6d182d03 ("udp_tunnel: add the ability to share port tables") Signed-off-by: Dan Carpenter Signed-off-by: David S. Miller commit a58da53ffd70294ebea8ecd0eb45fd0d74add9f9 Author: Stefano Garzarella Date: Tue Feb 22 10:47:42 2022 +0100 vhost/vsock: don't check owner in vhost_vsock_stop() while releasing vhost_vsock_stop() calls vhost_dev_check_owner() to check the device ownership. It expects current->mm to be valid. vhost_vsock_stop() is also called by vhost_vsock_dev_release() when the user has not done close(), so when we are in do_exit(). In this case current->mm is invalid and we're releasing the device, so we should clean it anyway. Let's check the owner only when vhost_vsock_stop() is called by an ioctl. When invoked from release we can not fail so we don't check return code of vhost_vsock_stop(). We need to stop vsock even if it's not the owner. Fixes: 433fc58e6bf2 ("VSOCK: Introduce vhost_vsock.ko") Cc: stable@vger.kernel.org Reported-by: syzbot+1e3ea63db39f2b4440e0@syzkaller.appspotmail.com Reported-and-tested-by: syzbot+3140b17cb44a7b174008@syzkaller.appspotmail.com Signed-off-by: Stefano Garzarella Acked-by: Jason Wang Signed-off-by: David S. Miller commit 8d3b01e0d4bb54368d73d0984466d72c2eeeac74 Author: Thierry Reding Date: Mon Dec 20 11:32:39 2021 +0100 ARM: tegra: Move panels to AUX bus Move the eDP panel on Venice 2 and Nyan boards into the corresponding AUX bus device tree node. This allows us to avoid a nasty circular dependency that would otherwise be created between the DPAUX and panel nodes via the DDC/I2C phandle. Fixes: eb481f9ac95c ("ARM: tegra: add Acer Chromebook 13 device tree") Fixes: 59fe02cb079f ("ARM: tegra: Add DTS for the nyan-blaze board") Fixes: 40e231c770a4 ("ARM: tegra: Enable eDP for Venice2") Signed-off-by: Thierry Reding commit 8913e1aea4b32a866343b14e565c62cec54f3f78 Author: Thierry Reding Date: Mon Dec 20 11:28:22 2021 +0100 drm/tegra: dpaux: Populate AUX bus The DPAUX hardware block exposes an DP AUX interface that provides access to an AUX bus and the devices on that bus. Use the DP AUX bus infrastructure that was recently introduced to probe devices on this bus from DT. Signed-off-by: Thierry Reding commit f762ce78897d734a08f52e39a353359b7d417578 Author: Christian König Date: Mon Feb 21 09:31:28 2022 +0100 drm/radeon: fix variable type When we switch to dma_resv_wait_timeout() the returned type changes as well. Signed-off-by: Christian König Fixes: 89aae41d740f ("drm/radeon: use dma_resv_wait_timeout() instead of manually waiting") Bug: https://bugzilla.kernel.org/show_bug.cgi?id=215600 Reviewed-by: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220221110503.2803-1-christian.koenig@amd.com commit ae089831ff28a115908b8d796f667c2dadef1637 Author: Eric Dumazet Date: Tue Feb 22 10:13:31 2022 -0800 netfilter: nf_tables: prefer kfree_rcu(ptr, rcu) variant While kfree_rcu(ptr) _is_ supported, it has some limitations. Given that 99.99% of kfree_rcu() users [1] use the legacy two parameters variant, and @catchall objects do have an rcu head, simply use it. Choice of kfree_rcu(ptr) variant was probably not intentional. [1] including calls from net/netfilter/nf_tables_api.c Fixes: aaa31047a6d2 ("netfilter: nftables: add catch-all set element support") Signed-off-by: Eric Dumazet Reviewed-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 277f2bb14361790a70e4b3c649e794b75a91a597 Author: Sukadev Bhattiprolu Date: Mon Feb 21 15:05:45 2022 -0600 ibmvnic: schedule failover only if vioctl fails If client is unable to initiate a failover reset via H_VIOCTL hcall, then it should schedule a failover reset as a last resort. Otherwise, there is no need to do a last resort. Fixes: 334c42414729 ("ibmvnic: improve failover sysfs entry") Reported-by: Cris Forno Signed-off-by: Sukadev Bhattiprolu Signed-off-by: Dany Madden Link: https://lore.kernel.org/r/20220221210545.115283-1-drt@linux.ibm.com Signed-off-by: Jakub Kicinski commit 342b6419193c6f697fd47d9c72fcff9cafc70687 Author: Alvin Šipraga Date: Mon Feb 21 21:35:38 2022 +0100 net: dsa: fix panic when removing unoffloaded port from bridge If a bridged port is not offloaded to the hardware - either because the underlying driver does not implement the port_bridge_{join,leave} ops, or because the operation failed - then its dp->bridge pointer will be NULL when dsa_port_bridge_leave() is called. Avoid dereferncing NULL. This fixes the following splat when removing a port from a bridge: Unable to handle kernel access to user memory outside uaccess routines at virtual address 0000000000000000 Internal error: Oops: 96000004 [#1] PREEMPT_RT SMP CPU: 3 PID: 1119 Comm: brctl Tainted: G O 5.17.0-rc4-rt4 #1 Call trace: dsa_port_bridge_leave+0x8c/0x1e4 dsa_slave_changeupper+0x40/0x170 dsa_slave_netdevice_event+0x494/0x4d4 notifier_call_chain+0x80/0xe0 raw_notifier_call_chain+0x1c/0x24 call_netdevice_notifiers_info+0x5c/0xac __netdev_upper_dev_unlink+0xa4/0x200 netdev_upper_dev_unlink+0x38/0x60 del_nbp+0x1b0/0x300 br_del_if+0x38/0x114 add_del_if+0x60/0xa0 br_ioctl_stub+0x128/0x2dc br_ioctl_call+0x68/0xb0 dev_ifsioc+0x390/0x554 dev_ioctl+0x128/0x400 sock_do_ioctl+0xb4/0xf4 sock_ioctl+0x12c/0x4e0 __arm64_sys_ioctl+0xa8/0xf0 invoke_syscall+0x4c/0x110 el0_svc_common.constprop.0+0x48/0xf0 do_el0_svc+0x28/0x84 el0_svc+0x1c/0x50 el0t_64_sync_handler+0xa8/0xb0 el0t_64_sync+0x17c/0x180 Code: f9402f00 f0002261 f9401302 913cc021 (a9401404) ---[ end trace 0000000000000000 ]--- Fixes: d3eed0e57d5d ("net: dsa: keep the bridge_dev and bridge_num as part of the same structure") Signed-off-by: Alvin Šipraga Reviewed-by: Vladimir Oltean Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20220221203539.310690-1-alvin@pqrs.dk Signed-off-by: Jakub Kicinski commit 8d093e02e898b24c58788b0289e3202317a96d2a Author: Sergey Shtylyov Date: Sat Feb 19 20:44:43 2022 +0300 ata: pata_hpt37x: disable primary channel on HPT371 The HPT371 chip physically has only one channel, the secondary one, however the primary channel registers do exist! Thus we have to manually disable the non-existing channel if the BIOS hasn't done this already. Similarly to the pata_hpt3x2n driver, always disable the primary channel. Fixes: 669a5db411d8 ("[libata] Add a bunch of PATA drivers.") Cc: stable@vger.kernel.org Signed-off-by: Sergey Shtylyov Signed-off-by: Damien Le Moal commit ef527f968ae05c6717c39f49c8709a7e2c19183a Author: Eric Dumazet Date: Sun Feb 20 07:40:52 2022 -0800 net: __pskb_pull_tail() & pskb_carve_frag_list() drop_monitor friends Whenever one of these functions pull all data from an skb in a frag_list, use consume_skb() instead of kfree_skb() to avoid polluting drop monitoring. Fixes: 6fa01ccd8830 ("skbuff: Add pskb_extract() helper function") Signed-off-by: Eric Dumazet Link: https://lore.kernel.org/r/20220220154052.1308469-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit 13e741b834538a225512912608f0182079fc64e2 Author: German Gomez Date: Mon Feb 21 17:17:06 2022 +0000 perf script: Fix error when printing 'weight' field In SPE traces the 'weight' field can't be printed in 'perf script' because the 'dummy:u' event doesn't have the WEIGHT attribute set. Use evsel__do_check_stype(..) to check this field, as it's done with other fields such as "phys_addr". Before: $ perf record -e arm_spe_0// -- sleep 1 $ perf script -F event,ip,weight Samples for 'dummy:u' event do not have WEIGHT attribute set. Cannot print 'weight' field. After: $ perf script -F event,ip,weight l1d-access: 12 ffffaf629d4cb320 tlb-access: 12 ffffaf629d4cb320 memory: 12 ffffaf629d4cb320 Fixes: b0fde9c6e291e528 ("perf arm-spe: Add SPE total latency as PERF_SAMPLE_WEIGHT") Signed-off-by: German Gomez Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Mark Rutland Cc: Namhyung Kim Link: https://lore.kernel.org/r/20220221171707.62960-1-german.gomez@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 5c1ee569660d4a205dced9cb4d0306b907fb7599 Merge: 917bbdb107f87 c70cd039f1d77 Author: Linus Torvalds Date: Tue Feb 22 16:14:35 2022 -0800 Merge branch 'for-5.17-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup Pull cgroup fixes from Tejun Heo: - Fix for a subtle bug in the recent release_agent permission check update - Fix for a long-standing race condition between cpuset and cpu hotplug - Comment updates * 'for-5.17-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: cpuset: Fix kernel-doc cgroup-v1: Correct privileges check in release_agent writes cgroup: clarify cgroup_css_set_fork() cgroup/cpuset: Fix a race between cpuset_attach() and cpu hotplug commit ce2fc710c9d2b25afc710f49bb2065b4439a62bc Author: Ondrej Mosnacek Date: Mon Feb 21 15:06:49 2022 +0100 selinux: fix misuse of mutex_is_locked() mutex_is_locked() tests whether the mutex is locked *by any task*, while here we want to test if it is held *by the current task*. To avoid false/missed WARNINGs, use lockdep_assert_is_held() and lockdep_assert_is_not_held() instead, which do the right thing (though they are a no-op if CONFIG_LOCKDEP=n). Cc: stable@vger.kernel.org Fixes: 2554a48f4437 ("selinux: measure state and policy capabilities") Signed-off-by: Ondrej Mosnacek Signed-off-by: Paul Moore commit 0c0822bcb73f154d96ee648644ec5a8628e3b864 Author: Krzysztof Kozlowski Date: Mon Feb 21 11:07:01 2022 +0100 dt-bindings: update Roger Quadros email Emails to Roger Quadros TI account bounce with: 550 Invalid recipient (#5.1.1) Signed-off-by: Krzysztof Kozlowski Acked-by: Roger Quadros Acked-By: Vinod Koul Acked-by: Lee Jones Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220221100701.48593-1-krzysztof.kozlowski@canonical.com commit 34f3eda8c8ffd4d0b2145ac11c91cc365cd1ada3 Author: Krzysztof Kozlowski Date: Mon Feb 14 09:23:49 2022 +0100 MAINTAINERS: sifive: drop Yash Shah Emails to Yash Shah bounce with "The email account that you tried to reach does not exist.", so drop him from all maintainer entries. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220214082349.162973-1-krzysztof.kozlowski@canonical.com commit 5b061a322b05a5e023d9a0df1ae1f8bb562ed87b Author: Arnaldo Carvalho de Melo Date: Fri Aug 7 08:45:47 2020 -0300 tools arch x86: Sync the msr-index.h copy with the kernel sources To pick up the changes in: 3915035282573c5e ("KVM: x86: SVM: move avic definitions from AMD's spec to svm.h") Addressing these tools/perf build warnings: diff -u tools/arch/x86/include/asm/msr-index.h arch/x86/include/asm/msr-index.h Warning: Kernel ABI header at 'tools/arch/x86/include/asm/msr-index.h' differs from latest version at 'arch/x86/include/asm/msr-index.h' That makes the beautification scripts to pick some new entries: $ tools/perf/trace/beauty/tracepoints/x86_msr.sh > before $ cp arch/x86/include/asm/msr-index.h tools/arch/x86/include/asm/msr-index.h $ tools/perf/trace/beauty/tracepoints/x86_msr.sh > after $ diff -u before after --- before 2022-02-22 17:35:36.996271430 -0300 +++ after 2022-02-22 17:35:46.258503347 -0300 @@ -287,6 +287,7 @@ [0xc0010114 - x86_AMD_V_KVM_MSRs_offset] = "VM_CR", [0xc0010115 - x86_AMD_V_KVM_MSRs_offset] = "VM_IGNNE", [0xc0010117 - x86_AMD_V_KVM_MSRs_offset] = "VM_HSAVE_PA", + [0xc001011b - x86_AMD_V_KVM_MSRs_offset] = "AMD64_SVM_AVIC_DOORBELL", [0xc001011e - x86_AMD_V_KVM_MSRs_offset] = "AMD64_VM_PAGE_FLUSH", [0xc001011f - x86_AMD_V_KVM_MSRs_offset] = "AMD64_VIRT_SPEC_CTRL", [0xc0010130 - x86_AMD_V_KVM_MSRs_offset] = "AMD64_SEV_ES_GHCB", $ And this gets rebuilt: CC /tmp/build/perf/trace/beauty/tracepoints/x86_msr.o LD /tmp/build/perf/trace/beauty/tracepoints/perf-in.o LD /tmp/build/perf/trace/beauty/perf-in.o CC /tmp/build/perf/util/amd-sample-raw.o LD /tmp/build/perf/util/perf-in.o LD /tmp/build/perf/perf-in.o LINK /tmp/build/perf/perf Now one can trace systemwide asking to see backtraces to where those MSRs are being read/written with: # perf trace -e msr:*_msr/max-stack=32/ --filter="msr>=AMD64_SVM_AVIC_DOORBELL && msr<=AMD64_SEV_ES_GHCB" ^C# If we use -v (verbose mode) we can see what it does behind the scenes: # perf trace -v -e msr:*_msr/max-stack=32/ --filter="msr>=AMD64_SVM_AVIC_DOORBELL && msr<=AMD64_SEV_ES_GHCB" Using CPUID AuthenticAMD-25-21-0 0xc001011b 0xc0010130 New filter for msr:read_msr: (msr>=0xc001011b && msr<=0xc0010130) && (common_pid != 1019953 && common_pid != 3629) 0xc001011b 0xc0010130 New filter for msr:write_msr: (msr>=0xc001011b && msr<=0xc0010130) && (common_pid != 1019953 && common_pid != 3629) mmap size 528384B ^C# Example with a frequent msr: # perf trace -v -e msr:*_msr/max-stack=32/ --filter="msr==IA32_SPEC_CTRL" --max-events 2 Using CPUID AuthenticAMD-25-21-0 0x48 New filter for msr:read_msr: (msr==0x48) && (common_pid != 2612129 && common_pid != 3841) 0x48 New filter for msr:write_msr: (msr==0x48) && (common_pid != 2612129 && common_pid != 3841) mmap size 528384B Looking at the vmlinux_path (8 entries long) symsrc__init: build id mismatch for vmlinux. Using /proc/kcore for kernel data Using /proc/kallsyms for symbols 0.000 Timer/2525383 msr:write_msr(msr: IA32_SPEC_CTRL, val: 6) do_trace_write_msr ([kernel.kallsyms]) do_trace_write_msr ([kernel.kallsyms]) __switch_to_xtra ([kernel.kallsyms]) __switch_to ([kernel.kallsyms]) __schedule ([kernel.kallsyms]) schedule ([kernel.kallsyms]) futex_wait_queue_me ([kernel.kallsyms]) futex_wait ([kernel.kallsyms]) do_futex ([kernel.kallsyms]) __x64_sys_futex ([kernel.kallsyms]) do_syscall_64 ([kernel.kallsyms]) entry_SYSCALL_64_after_hwframe ([kernel.kallsyms]) __futex_abstimed_wait_common64 (/usr/lib64/libpthread-2.33.so) 0.030 :0/0 msr:write_msr(msr: IA32_SPEC_CTRL, val: 2) do_trace_write_msr ([kernel.kallsyms]) do_trace_write_msr ([kernel.kallsyms]) __switch_to_xtra ([kernel.kallsyms]) __switch_to ([kernel.kallsyms]) __schedule ([kernel.kallsyms]) schedule_idle ([kernel.kallsyms]) do_idle ([kernel.kallsyms]) cpu_startup_entry ([kernel.kallsyms]) secondary_startup_64_no_verify ([kernel.kallsyms]) # Cc: Adrian Hunter Cc: Ian Rogers Cc: Jiri Olsa Cc: Maxim Levitsky Cc: Namhyung Kim Cc: Paolo Bonzini Link: http://lore.kernel.org/lkml/YhVKxaft+z8rpOfy@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 69560e366fc4d5fca7bebb0e44edbfafc8bcaf05 Author: Alexey Bayduraev Date: Fri Feb 18 18:23:41 2022 +0300 perf data: Fix double free in perf_session__delete() When perf_data__create_dir() fails, it calls close_dir(), but perf_session__delete() also calls close_dir() and since dir.version and dir.nr were initialized by perf_data__create_dir(), a double free occurs. This patch moves the initialization of dir.version and dir.nr after successful initialization of dir.files, that prevents double freeing. This behavior is already implemented in perf_data__open_dir(). Fixes: 145520631130bd64 ("perf data: Add perf_data__(create_dir|close_dir) functions") Signed-off-by: Alexey Bayduraev Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Alexander Antonov Cc: Alexander Shishkin Cc: Alexei Budankov Cc: Andi Kleen Cc: Ingo Molnar Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220218152341.5197-2-alexey.v.bayduraev@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit c70cd039f1d779126347a896a58876782dcc5284 Author: Jiapeng Chong Date: Wed Feb 16 11:17:53 2022 +0800 cpuset: Fix kernel-doc Fix the following W=1 kernel warnings: kernel/cgroup/cpuset.c:3718: warning: expecting prototype for cpuset_memory_pressure_bump(). Prototype was for __cpuset_memory_pressure_bump() instead. kernel/cgroup/cpuset.c:3568: warning: expecting prototype for cpuset_node_allowed(). Prototype was for __cpuset_node_allowed() instead. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Tejun Heo commit 917bbdb107f8767cb78f24e7d6725a2f93b9effe Merge: 038101e6b2cd5 9d2231c5d74e1 Author: Linus Torvalds Date: Tue Feb 22 10:31:53 2022 -0800 Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull ITER_PIPE fix from Al Viro: "Fix for old sloppiness in pipe_buffer reuse" * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: lib/iov_iter: initialize "flags" in new pipe_buffer commit 467a726b754f474936980da793b4ff2ec3e382a7 Author: Michal Koutný Date: Thu Feb 17 17:11:28 2022 +0100 cgroup-v1: Correct privileges check in release_agent writes The idea is to check: a) the owning user_ns of cgroup_ns, b) capabilities in init_user_ns. The commit 24f600856418 ("cgroup-v1: Require capabilities to set release_agent") got this wrong in the write handler of release_agent since it checked user_ns of the opener (may be different from the owning user_ns of cgroup_ns). Secondly, to avoid possibly confused deputy, the capability of the opener must be checked. Fixes: 24f600856418 ("cgroup-v1: Require capabilities to set release_agent") Cc: stable@vger.kernel.org Link: https://lore.kernel.org/stable/20220216121142.GB30035@blackbody.suse.cz/ Signed-off-by: Michal Koutný Reviewed-by: Masami Ichikawa(CIP) Signed-off-by: Tejun Heo commit 6d3971dab239e7db1691690a02ce6becf30689cb Author: Christian Brauner Date: Mon Feb 21 16:16:39 2022 +0100 cgroup: clarify cgroup_css_set_fork() With recent fixes for the permission checking when moving a task into a cgroup using a file descriptor to a cgroup's cgroup.procs file and calling write() it seems a good idea to clarify CLONE_INTO_CGROUP permission checking with a comment. Cc: Tejun Heo Cc: Signed-off-by: Christian Brauner Signed-off-by: Tejun Heo commit 84ec758fb2daa236026506868c8796b0500c047d Author: ChenXiaoSong Date: Tue Feb 15 15:10:30 2022 +0800 configfs: fix a race in configfs_{,un}register_subsystem() When configfs_register_subsystem() or configfs_unregister_subsystem() is executing link_group() or unlink_group(), it is possible that two processes add or delete list concurrently. Some unfortunate interleavings of them can cause kernel panic. One of cases is: A --> B --> C --> D A <-- B <-- C <-- D delete list_head *B | delete list_head *C --------------------------------|----------------------------------- configfs_unregister_subsystem | configfs_unregister_subsystem unlink_group | unlink_group unlink_obj | unlink_obj list_del_init | list_del_init __list_del_entry | __list_del_entry __list_del | __list_del // next == C | next->prev = prev | | next->prev = prev prev->next = next | | // prev == B | prev->next = next Fix this by adding mutex when calling link_group() or unlink_group(), but parent configfs_subsystem is NULL when config_item is root. So I create a mutex configfs_subsystem_mutex. Fixes: 7063fbf22611 ("[PATCH] configfs: User-driven configuration filesystem") Signed-off-by: ChenXiaoSong Signed-off-by: Laibin Qiu Signed-off-by: Christoph Hellwig commit 80912cef18f16f8fe59d1fb9548d4364342be360 Author: Dylan Yudaken Date: Tue Feb 22 08:17:51 2022 -0800 io_uring: disallow modification of rsrc_data during quiesce io_rsrc_ref_quiesce will unlock the uring while it waits for references to the io_rsrc_data to be killed. There are other places to the data that might add references to data via calls to io_rsrc_node_switch. There is a race condition where this reference can be added after the completion has been signalled. At this point the io_rsrc_ref_quiesce call will wake up and relock the uring, assuming the data is unused and can be freed - although it is actually being used. To fix this check in io_rsrc_ref_quiesce if a resource has been revived. Reported-by: syzbot+ca8bf833622a1662745b@syzkaller.appspotmail.com Cc: stable@vger.kernel.org Signed-off-by: Dylan Yudaken Link: https://lore.kernel.org/r/20220222161751.995746-1-dylany@fb.com Signed-off-by: Jens Axboe commit 35f165f08950a876f1b95a61d79c93678fba2fd6 Author: Vikash Chandola Date: Tue Feb 22 13:12:53 2022 +0000 hwmon: (pmbus) Clear pmbus fault/warning bits after read Almost all fault/warning bits in pmbus status registers remain set even after fault/warning condition are removed. As per pmbus specification these faults must be cleared by user. Modify hwmon behavior to clear fault/warning bit after fetching data if fault/warning bit was set. This allows to get fresh data in next read. Signed-off-by: Vikash Chandola Link: https://lore.kernel.org/r/20220222131253.2426834-1-vikash.chandola@linux.intel.com Signed-off-by: Guenter Roeck commit 1b5f517cca36292076d9e38fa6e33a257703e62e Author: Guenter Roeck Date: Mon Feb 21 08:32:14 2022 -0800 hwmon: Handle failure to register sensor with thermal zone correctly If an attempt is made to a sensor with a thermal zone and it fails, the call to devm_thermal_zone_of_sensor_register() may return -ENODEV. This may result in crashes similar to the following. Unable to handle kernel NULL pointer dereference at virtual address 00000000000003cd ... Internal error: Oops: 96000021 [#1] PREEMPT SMP ... pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : mutex_lock+0x18/0x60 lr : thermal_zone_device_update+0x40/0x2e0 sp : ffff800014c4fc60 x29: ffff800014c4fc60 x28: ffff365ee3f6e000 x27: ffffdde218426790 x26: ffff365ee3f6e000 x25: 0000000000000000 x24: ffff365ee3f6e000 x23: ffffdde218426870 x22: ffff365ee3f6e000 x21: 00000000000003cd x20: ffff365ee8bf3308 x19: ffffffffffffffed x18: 0000000000000000 x17: ffffdde21842689c x16: ffffdde1cb7a0b7c x15: 0000000000000040 x14: ffffdde21a4889a0 x13: 0000000000000228 x12: 0000000000000000 x11: 0000000000000000 x10: 0000000000000000 x9 : 0000000000000000 x8 : 0000000001120000 x7 : 0000000000000001 x6 : 0000000000000000 x5 : 0068000878e20f07 x4 : 0000000000000000 x3 : 00000000000003cd x2 : ffff365ee3f6e000 x1 : 0000000000000000 x0 : 00000000000003cd Call trace: mutex_lock+0x18/0x60 hwmon_notify_event+0xfc/0x110 0xffffdde1cb7a0a90 0xffffdde1cb7a0b7c irq_thread_fn+0x2c/0xa0 irq_thread+0x134/0x240 kthread+0x178/0x190 ret_from_fork+0x10/0x20 Code: d503201f d503201f d2800001 aa0103e4 (c8e47c02) Jon Hunter reports that the exact call sequence is: hwmon_notify_event() --> hwmon_thermal_notify() --> thermal_zone_device_update() --> update_temperature() --> mutex_lock() The hwmon core needs to handle all errors returned from calls to devm_thermal_zone_of_sensor_register(). If the call fails with -ENODEV, report that the sensor was not attached to a thermal zone but continue to register the hwmon device. Reported-by: Jon Hunter Cc: Dmitry Osipenko Fixes: 1597b374af222 ("hwmon: Add notification support") Reviewed-by: Dmitry Osipenko Tested-by: Jon Hunter Signed-off-by: Guenter Roeck commit 1e2277ed709585672565ecf0ff9215af148b7800 Merge: ec756e40e2718 93b71801a8274 Author: Paolo Bonzini Date: Tue Feb 22 09:07:16 2022 -0500 Merge branch 'kvm-ppc-cap-210' into kvm-master By request of Nick Piggin: > Patch 3 requires a KVM_CAP_PPC number allocated. QEMU maintainers are > happy with it (link in changelog) just waiting on KVM upstreaming. Do > you have objections to the series going to ppc/kvm tree first, or > another option is you could take patch 3 alone first (it's relatively > independent of the other 2) and ppc/kvm gets it from you? commit 93b71801a8274cd9511557faf04365a5de487197 Author: Nicholas Piggin Date: Tue Feb 22 09:06:54 2022 -0500 KVM: PPC: reserve capability 210 for KVM_CAP_PPC_AIL_MODE_3 Add KVM_CAP_PPC_AIL_MODE_3 to advertise the capability to set the AIL resource mode to 3 with the H_SET_MODE hypercall. This capability differs between processor types and KVM types (PR, HV, Nested HV), and affects guest-visible behaviour. QEMU will implement a cap-ail-mode-3 to control this behaviour[1], and use the KVM CAP if available to determine KVM support[2]. Reviewed-by: Fabiano Rosas Signed-off-by: Nicholas Piggin Signed-off-by: Paolo Bonzini commit bb49c6fa8b845591b317b0d7afea4ae60ec7f3aa Author: Stefano Garzarella Date: Fri Feb 11 10:01:36 2022 +0100 block: clear iocb->private in blkdev_bio_end_io_async() iocb_bio_iopoll() expects iocb->private to be cleared before releasing the bio. We already do this in blkdev_bio_end_io(), but we forgot in the recently added blkdev_bio_end_io_async(). Fixes: 54a88eb838d3 ("block: add single bio async direct IO helper") Cc: asml.silence@gmail.com Signed-off-by: Stefano Garzarella Reviewed-by: Ming Lei Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220211090136.44471-1-sgarzare@redhat.com Signed-off-by: Jens Axboe commit 9c7cf33c53ce833b58de9e5c192b4736dbd09cb1 Author: Adam Ward Date: Tue Feb 22 00:27:44 2022 +0000 regulator: da9121: Remove surplus DA9141 parameters Remove ramp_delay/enable_time values - subject to OTP, incorrect Signed-off-by: Adam Ward Link: https://lore.kernel.org/r/a175201b4a7ea323c6a70d77f7f6d2124bfc0bed.1645489455.git.Adam.Ward.opensource@diasemi.com Signed-off-by: Mark Brown commit c8c57fbc1c5067b913077e948c7d957af6834ba3 Author: Adam Ward Date: Tue Feb 22 00:27:43 2022 +0000 regulator: da9121: Fix DA914x voltage value Update DA9141/2 max voltage to match spec change Signed-off-by: Adam Ward Link: https://lore.kernel.org/r/9d1ec5b6db70d27f56d05b8a0139fc0840f03e20.1645489455.git.Adam.Ward.opensource@diasemi.com Signed-off-by: Mark Brown commit f0fdfc04fd974cea23351b830fcac0822ea19a51 Author: Adam Ward Date: Tue Feb 22 00:27:42 2022 +0000 regulator: da9121: Fix DA914x current values Update DA9141/2 ranges to correct errors Signed-off-by: Adam Ward Link: https://lore.kernel.org/r/cd5732c5061ce49dcfbcebb306d12ba1664b4ea6.1645489455.git.Adam.Ward.opensource@diasemi.com Signed-off-by: Mark Brown commit 5663b85462a66821fc314c5bf9ffd427d1ad71cc Merge: b6ad6261d2770 dad3bdeef45f8 Author: David S. Miller Date: Tue Feb 22 11:00:51 2022 +0000 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf Pablo Neira Ayuso says: ==================== Netfilter fixes for net This is fixing up the use without proper initialization in patch 5/5 -o- Hi, The following patchset contains Netfilter fixes for net: 1) Missing #ifdef CONFIG_IP6_NF_IPTABLES in recent xt_socket fix. 2) Fix incorrect flow action array size in nf_tables. 3) Unregister flowtable hooks from netns exit path. 4) Fix missing limit object release, from Florian Westphal. 5) Memleak in nf_tables object update path, also from Florian. ==================== Signed-off-by: David S. Miller commit 1e6ae0e46e32749b130f1823da30cea9aa2a59a0 Author: Randy Dunlap Date: Mon Feb 21 09:50:29 2022 -0800 mips: setup: fix setnocoherentio() boolean setting Correct a typo/pasto: setnocoherentio() should set dma_default_coherent to false, not true. Fixes: 14ac09a65e19 ("MIPS: refactor the runtime coherent vs noncoherent DMA indicators") Signed-off-by: Randy Dunlap Cc: Christoph Hellwig Cc: Thomas Bogendoerfer Cc: linux-mips@vger.kernel.org Reviewed-by: Christoph Hellwig Signed-off-by: Thomas Bogendoerfer commit d8f7a5484f2188e9af2d9e4e587587d724501b12 Author: Mårten Lindahl Date: Wed Feb 16 10:41:28 2022 +0100 driver core: Free DMA range map when device is released When unbinding/binding a driver with DMA mapped memory, the DMA map is not freed before the driver is reloaded. This leads to a memory leak when the DMA map is overwritten when reprobing the driver. This can be reproduced with a platform driver having a dma-range: dummy { ... #address-cells = <0x2>; #size-cells = <0x2>; ranges; dma-ranges = <...>; ... }; and then unbinding/binding it: ~# echo soc:dummy >/sys/bus/platform/drivers//unbind DMA map object 0xffffff800b0ae540 still being held by &pdev->dev ~# echo soc:dummy >/sys/bus/platform/drivers//bind ~# echo scan > /sys/kernel/debug/kmemleak ~# cat /sys/kernel/debug/kmemleak unreferenced object 0xffffff800b0ae540 (size 64): comm "sh", pid 833, jiffies 4295174550 (age 2535.352s) hex dump (first 32 bytes): 00 00 00 80 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 80 00 00 00 00 00 00 00 80 00 00 00 00 ................ backtrace: [] create_object.isra.0+0x108/0x344 [] kmemleak_alloc+0x8c/0xd0 [] __kmalloc+0x440/0x6f0 [] of_dma_get_range+0x124/0x220 [] of_dma_configure_id+0x40/0x2d0 [] platform_dma_configure+0x5c/0xa4 [] really_probe+0x8c/0x514 [] __driver_probe_device+0x9c/0x19c [] device_driver_attach+0x54/0xbc [] bind_store+0xc4/0x120 [] drv_attr_store+0x30/0x44 [] sysfs_kf_write+0x50/0x60 [] kernfs_fop_write_iter+0x124/0x1b4 [] new_sync_write+0xdc/0x160 [] vfs_write+0x23c/0x2a0 [] ksys_write+0x64/0xec To prevent this we should free the dma_range_map when the device is released. Fixes: e0d072782c73 ("dma-mapping: introduce DMA range map, supplanting dma_pfn_offset") Cc: stable Suggested-by: Rob Herring Reviewed-by: Rob Herring Signed-off-by: Mårten Lindahl Link: https://lore.kernel.org/r/20220216094128.4025861-1-marten.lindahl@axis.com Signed-off-by: Greg Kroah-Hartman commit dad3bdeef45f81a6e90204bcc85360bb76eccec7 Author: Florian Westphal Date: Mon Feb 21 13:31:49 2022 +0100 netfilter: nf_tables: fix memory leak during stateful obj update stateful objects can be updated from the control plane. The transaction logic allocates a temporary object for this purpose. The ->init function was called for this object, so plain kfree() leaks resources. We must call ->destroy function of the object. nft_obj_destroy does this, but it also decrements the module refcount, but the update path doesn't increment it. To avoid special-casing the update object release, do module_get for the update case too and release it via nft_obj_destroy(). Fixes: d62d0ba97b58 ("netfilter: nf_tables: Introduce stateful object update operation") Cc: Fernando Fernandez Mancera Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 5f6b0f2d037c8864f20ff15311c695f65eb09db5 Author: Sergey Shtylyov Date: Sat Feb 19 23:04:29 2022 +0300 ata: pata_hpt37x: fix PCI clock detection The f_CNT register (at the PCI config. address 0x78) is 16-bit, not 8-bit! The bug was there from the very start... :-( Signed-off-by: Sergey Shtylyov Fixes: 669a5db411d8 ("[libata] Add a bunch of PATA drivers.") Cc: stable@vger.kernel.org Signed-off-by: Damien Le Moal commit 4d22336f903930eb94588b939c310743a3640276 Author: Michel Dänzer Date: Tue Feb 15 19:53:37 2022 +0100 drm/amd/display: For vblank_disable_immediate, check PSR is really used Even if PSR is allowed for a present GPU, there might be no eDP link which supports PSR. Fixes: 708978487304 ("drm/amdgpu/display: Only set vblank_disable_immediate when PSR is not enabled") Reviewed-by: Harry Wentland Signed-off-by: Michel Dänzer Signed-off-by: Alex Deucher commit e3f3824874da78db5775a5cb9c0970cd1c6978bc Author: Evan Quan Date: Thu Jan 20 19:16:19 2022 +0800 drm/amd/pm: fix some OEM SKU specific stability issues Add a quirk in sienna_cichlid_ppt.c to fix some OEM SKU specific stability issues. Signed-off-by: Evan Quan Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit f626dd0ff05043e5a7154770cc7cda66acee33a3 Author: Evan Quan Date: Thu Jan 20 16:15:52 2022 +0800 drm/amdgpu: disable MMHUB PG for Picasso MMHUB PG needs to be disabled for Picasso for stability reasons. Signed-off-by: Evan Quan Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 1432108d00e42ffa383240bcac8d58f89ae19104 Author: Bas Nieuwenhuizen Date: Sat Feb 12 16:40:00 2022 +0100 drm/amd/display: Protect update_bw_bounding_box FPU code. For DCN3/3.01/3.02 at least these use the fpu. v2: squash in build fix for when DCN is not enabled (Leo) Signed-off-by: Bas Nieuwenhuizen Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit eebb0f4e894f1e9577a56b337693d1051dd6ebfd Author: Phil Elwell Date: Wed Feb 16 16:08:02 2022 +0000 sc16is7xx: Fix for incorrect data being transmitted UART drivers are meant to use the port spinlock within certain methods, to protect against reentrancy. The sc16is7xx driver does very little locking, presumably because when added it triggers "scheduling while atomic" errors. This is due to the use of mutexes within the regmap abstraction layer, and the mutex implementation's habit of sleeping the current thread while waiting for access. Unfortunately this lack of interlocking can lead to corruption of outbound data, which occurs when the buffer used for I2C transmission is used simultaneously by two threads - a work queue thread running sc16is7xx_tx_proc, and an IRQ thread in sc16is7xx_port_irq, both of which can call sc16is7xx_handle_tx. An earlier patch added efr_lock, a mutex that controls access to the EFR register. This mutex is already claimed in the IRQ handler, and all that is required is to claim the same mutex in sc16is7xx_tx_proc. See: https://github.com/raspberrypi/linux/issues/4885 Fixes: 6393ff1c4435 ("sc16is7xx: Use threaded IRQ") Cc: stable Signed-off-by: Phil Elwell Link: https://lore.kernel.org/r/20220216160802.1026013-1-phil@raspberrypi.com Signed-off-by: Greg Kroah-Hartman commit a2ab75b8e76e455af7867e3835fd9cdf386b508f Author: daniel.starke@siemens.com Date: Thu Feb 17 23:31:23 2022 -0800 tty: n_gsm: fix deadlock in gsmtty_open() In the current implementation the user may open a virtual tty which then could fail to establish the underlying DLCI. The function gsmtty_open() gets stuck in tty_port_block_til_ready() while waiting for a carrier rise. This happens if the remote side fails to acknowledge the link establishment request in time or completely. At some point gsm_dlci_close() is called to abort the link establishment attempt. The function tries to inform the associated virtual tty by performing a hangup. But the blocking loop within tty_port_block_til_ready() is not informed about this event. The patch proposed here fixes this by resetting the initialization state of the virtual tty to ensure the loop exits and triggering it to make tty_port_block_til_ready() return. Fixes: e1eaea46bb40 ("tty: n_gsm line discipline") Cc: stable@vger.kernel.org Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220218073123.2121-7-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman commit 687f9ad43c52501f46164758e908a5dd181a87fc Author: daniel.starke@siemens.com Date: Thu Feb 17 23:31:22 2022 -0800 tty: n_gsm: fix wrong modem processing in convergence layer type 2 The function gsm_process_modem() exists to handle modem status bits of incoming frames. This includes incoming MSC (modem status command) frames and convergence layer type 2 data frames. The function, however, was only designed to handle MSC frames as it expects the command length. Within gsm_dlci_data() it is wrongly assumed that this is the same as the data frame length. This is only true if the data frame contains only 1 byte of payload. This patch names the length parameter of gsm_process_modem() in a generic manner to reflect its association. It also corrects all calls to the function to handle the variable number of modem status octets correctly in both cases. Fixes: 7263287af93d ("tty: n_gsm: Fixed logic to decode break signal from modem status") Cc: stable@vger.kernel.org Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220218073123.2121-6-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman commit c19d93542a6081577e6da9bf5e887979c72e80c1 Author: daniel.starke@siemens.com Date: Thu Feb 17 23:31:21 2022 -0800 tty: n_gsm: fix wrong tty control line for flow control tty flow control is handled via gsmtty_throttle() and gsmtty_unthrottle(). Both functions propagate the outgoing hardware flow control state to the remote side via MSC (modem status command) frames. The local state is taken from the RTS (ready to send) flag of the tty. However, RTS gets mapped to DTR (data terminal ready), which is wrong. This patch corrects this by mapping RTS to RTS. Fixes: e1eaea46bb40 ("tty: n_gsm line discipline") Cc: stable@vger.kernel.org Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220218073123.2121-5-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman commit 96b169f05cdcc844b400695184d77e42071d14f2 Author: daniel.starke@siemens.com Date: Thu Feb 17 23:31:20 2022 -0800 tty: n_gsm: fix NULL pointer access due to DLCI release The here fixed commit made the tty hangup asynchronous to avoid a circular locking warning. I could not reproduce this warning. Furthermore, due to the asynchronous hangup the function call now gets queued up while the underlying tty is being freed. Depending on the timing this results in a NULL pointer access in the global work queue scheduler. To be precise in process_one_work(). Therefore, the previous commit made the issue worse which it tried to fix. This patch fixes this by falling back to the old behavior which uses a blocking tty hangup call before freeing up the associated tty. Fixes: 7030082a7415 ("tty: n_gsm: avoid recursive locking with async port hangup") Cc: stable@vger.kernel.org Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220218073123.2121-4-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman commit e3b7468f082d106459e86e8dc6fb9bdd65553433 Author: daniel.starke@siemens.com Date: Thu Feb 17 23:31:19 2022 -0800 tty: n_gsm: fix proper link termination after failed open Trying to open a DLCI by sending a SABM frame may fail with a timeout. The link is closed on the initiator side without informing the responder about this event. The responder assumes the link is open after sending a UA frame to answer the SABM frame. The link gets stuck in a half open state. This patch fixes this by initiating the proper link termination procedure after link setup timeout instead of silently closing it down. Fixes: e1eaea46bb40 ("tty: n_gsm line discipline") Cc: stable@vger.kernel.org Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220218073123.2121-3-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman commit 57435c42400ec147a527b2313188b649e81e449e Author: daniel.starke@siemens.com Date: Thu Feb 17 23:31:18 2022 -0800 tty: n_gsm: fix encoding of command/response bit n_gsm is based on the 3GPP 07.010 and its newer version is the 3GPP 27.010. See https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=1516 The changes from 07.010 to 27.010 are non-functional. Therefore, I refer to the newer 27.010 here. Chapter 5.2.1.2 describes the encoding of the C/R (command/response) bit. Table 1 shows that the actual encoding of the C/R bit is inverted if the associated frame is sent by the responder. The referenced commit fixed here further broke the internal meaning of this bit in the outgoing path by always setting the C/R bit regardless of the frame type. This patch fixes both by setting the C/R bit always consistently for command (1) and response (0) frames and inverting it later for the responder where necessary. The meaning of this bit in the debug output is being preserved and shows the bit as if it was encoded by the initiator. This reflects only the frame type rather than the encoded combination of communication side and frame type. Fixes: cc0f42122a7e ("tty: n_gsm: Modify CR,PF bit when config requester") Cc: stable@vger.kernel.org Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220218073123.2121-2-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman commit 737b0ef3be6b319d6c1fd64193d1603311969326 Author: daniel.starke@siemens.com Date: Thu Feb 17 23:31:17 2022 -0800 tty: n_gsm: fix encoding of control signal octet bit DV n_gsm is based on the 3GPP 07.010 and its newer version is the 3GPP 27.010. See https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=1516 The changes from 07.010 to 27.010 are non-functional. Therefore, I refer to the newer 27.010 here. Chapter 5.4.6.3.7 describes the encoding of the control signal octet used by the MSC (modem status command). The same encoding is also used in convergence layer type 2 as described in chapter 5.5.2. Table 7 and 24 both require the DV (data valid) bit to be set 1 for outgoing control signal octets sent by the DTE (data terminal equipment), i.e. for the initiator side. Currently, the DV bit is only set if CD (carrier detect) is on, regardless of the side. This patch fixes this behavior by setting the DV bit on the initiator side unconditionally. Fixes: e1eaea46bb40 ("tty: n_gsm line discipline") Cc: stable@vger.kernel.org Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220218073123.2121-1-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman commit 038101e6b2cd5c55f888f85db42ea2ad3aecb4b6 Merge: cfb92440ee71a ae09639e3b2a0 Author: Linus Torvalds Date: Mon Feb 21 09:10:53 2022 -0800 Merge tag 'platform-drivers-x86-v5.17-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 Pull x86 platform driver fixes from Hans de Goede: "Two small fixes and one hardware-id addition" * tag 'platform-drivers-x86-v5.17-3' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: platform/x86: int3472: Add terminator to gpiod_lookup_table platform/x86: asus-wmi: Fix regression when probing for fan curve control platform/x86: thinkpad_acpi: Add dual-fan quirk for T15g (2nd gen) commit 6c7621890995d089a56a06d11580d185ede7c2f8 Author: Christophe Kerello Date: Sun Feb 20 15:14:32 2022 +0000 mtd: core: Fix a conflict between MTD and NVMEM on wp-gpios property Wp-gpios property can be used on NVMEM nodes and the same property can be also used on MTD NAND nodes. In case of the wp-gpios property is defined at NAND level node, the GPIO management is done at NAND driver level. Write protect is disabled when the driver is probed or resumed and is enabled when the driver is released or suspended. When no partitions are defined in the NAND DT node, then the NAND DT node will be passed to NVMEM framework. If wp-gpios property is defined in this node, the GPIO resource is taken twice and the NAND controller driver fails to probe. A new Boolean flag named ignore_wp has been added in nvmem_config. In case ignore_wp is set, it means that the GPIO is handled by the provider. Lets set this flag in MTD layer to avoid the conflict on wp_gpios property. Fixes: 2a127da461a9 ("nvmem: add support for the write-protect pin") Cc: stable@vger.kernel.org Acked-by: Miquel Raynal Signed-off-by: Christophe Kerello Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220220151432.16605-3-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit f6c052afe6f802d87c74153b7a57c43b2e9faf07 Author: Christophe Kerello Date: Sun Feb 20 15:14:31 2022 +0000 nvmem: core: Fix a conflict between MTD and NVMEM on wp-gpios property Wp-gpios property can be used on NVMEM nodes and the same property can be also used on MTD NAND nodes. In case of the wp-gpios property is defined at NAND level node, the GPIO management is done at NAND driver level. Write protect is disabled when the driver is probed or resumed and is enabled when the driver is released or suspended. When no partitions are defined in the NAND DT node, then the NAND DT node will be passed to NVMEM framework. If wp-gpios property is defined in this node, the GPIO resource is taken twice and the NAND controller driver fails to probe. It would be possible to set config->wp_gpio at MTD level before calling nvmem_register function but NVMEM framework will toggle this GPIO on each write when this GPIO should only be controlled at NAND level driver to ensure that the Write Protect has not been enabled. A way to fix this conflict is to add a new boolean flag in nvmem_config named ignore_wp. In case ignore_wp is set, the GPIO resource will be managed by the provider. Fixes: 2a127da461a9 ("nvmem: add support for the write-protect pin") Cc: stable@vger.kernel.org Signed-off-by: Christophe Kerello Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220220151432.16605-2-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit efe8a1e7cad456075247488f92a05f9cc2ddb394 Merge: 754e0b0e35608 ea85bf9064661 Author: Greg Kroah-Hartman Date: Mon Feb 21 17:58:09 2022 +0100 Merge tag 'iio-fixes-for-5.17a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-linus Jonathan writes: 1st set of IIO fixes for the 5.17 cycle. Several drivers: - Fix a failure to disable runtime in probe error paths. All cases were introduced in the same rework patch. adi,ad7124 - Fix incorrect register masking. adi,ad74413r - Avoid referencing negative array offsets. - Use ngpio size when iterating over mask not numebr of channels. - Fix issue with wrong mask uage getting GPIOs. adi,admv1014 - Drop check on unsigned less than 0. adi,ads16480 - Correctly handle devices that don't have burst mode support. fsl,fxls8962af - Add missing padding needed between address and data for SPI transfers. men_z188 - Fix iomap leak in error path. st,lsm6dsx - Wait for setting time in oneshot reads to get a stable result. ti,tsc2046 - Prevent an array overflow. * tag 'iio-fixes-for-5.17a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: iio: imu: st_lsm6dsx: wait for settling time in st_lsm6dsx_read_oneshot iio: Fix error handling for PM iio: addac: ad74413r: correct comparator gpio getters mask usage iio: addac: ad74413r: use ngpio size when iterating over mask iio: addac: ad74413r: Do not reference negative array offsets iio: adc: men_z188_adc: Fix a resource leak in an error handling path iio: frequency: admv1013: remove the always true condition iio: accel: fxls8962af: add padding to regmap for SPI iio:imu:adis16480: fix buffering for devices with no burst mode iio: adc: ad7124: fix mask used for setting AIN_BUFP & AIN_BUFM bits iio: adc: tsc2046: fix memory corruption by preventing array overflow commit 9d2231c5d74e13b2a0546fee6737ee4446017903 Author: Max Kellermann Date: Mon Feb 21 11:03:13 2022 +0100 lib/iov_iter: initialize "flags" in new pipe_buffer The functions copy_page_to_iter_pipe() and push_pipe() can both allocate a new pipe_buffer, but the "flags" member initializer is missing. Fixes: 241699cd72a8 ("new iov_iter flavour: pipe-backed") To: Alexander Viro To: linux-fsdevel@vger.kernel.org To: linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org Signed-off-by: Max Kellermann Signed-off-by: Al Viro commit 11c57c3ba94da74c3446924260e34e0b1950b5d7 Author: Julian Braha Date: Mon Jan 17 05:09:40 2022 +0100 ARM: 9178/1: fix unmet dependency on BITREVERSE for HAVE_ARCH_BITREVERSE Resending this to properly add it to the patch tracker - thanks for letting me know, Arnd :) When ARM is enabled, and BITREVERSE is disabled, Kbuild gives the following warning: WARNING: unmet direct dependencies detected for HAVE_ARCH_BITREVERSE Depends on [n]: BITREVERSE [=n] Selected by [y]: - ARM [=y] && (CPU_32v7M [=n] || CPU_32v7 [=y]) && !CPU_32v6 [=n] This is because ARM selects HAVE_ARCH_BITREVERSE without selecting BITREVERSE, despite HAVE_ARCH_BITREVERSE depending on BITREVERSE. This unmet dependency bug was found by Kismet, a static analysis tool for Kconfig. Please advise if this is not the appropriate solution. Signed-off-by: Julian Braha Signed-off-by: Russell King (Oracle) commit d920eaa4c4559f59be7b4c2d26fa0a2e1aaa3da9 Author: Russell King (Oracle) Date: Wed Feb 16 15:37:38 2022 +0000 ARM: Fix kgdb breakpoint for Thumb2 The kgdb code needs to register an undef hook for the Thumb UDF instruction that will fault in order to be functional on Thumb2 platforms. Reported-by: Johannes Stezenbach Tested-by: Johannes Stezenbach Fixes: 5cbad0ebf45c ("kgdb: support for ARCH=arm") Signed-off-by: Russell King (Oracle) commit 1a58f84ea5df7f026bf92a0009f931bf547fe965 Author: Florian Westphal Date: Fri Feb 18 13:17:05 2022 +0100 netfilter: nft_limit: fix stateful object memory leak We need to provide a destroy callback to release the extra fields. Fixes: 3b9e2ea6c11b ("netfilter: nft_limit: move stateful fields out of expression data") Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 6069da443bf65f513bb507bb21e2f87cfb1ad0b6 Author: Pablo Neira Ayuso Date: Fri Feb 18 12:45:32 2022 +0100 netfilter: nf_tables: unregister flowtable hooks on netns exit Unregister flowtable hooks before they are releases via nf_tables_flowtable_destroy() otherwise hook core reports UAF. BUG: KASAN: use-after-free in nf_hook_entries_grow+0x5a7/0x700 net/netfilter/core.c:142 net/netfilter/core.c:142 Read of size 4 at addr ffff8880736f7438 by task syz-executor579/3666 CPU: 0 PID: 3666 Comm: syz-executor579 Not tainted 5.16.0-rc5-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 lib/dump_stack.c:88 [inline] lib/dump_stack.c:106 dump_stack_lvl+0x1dc/0x2d8 lib/dump_stack.c:106 lib/dump_stack.c:106 print_address_description+0x65/0x380 mm/kasan/report.c:247 mm/kasan/report.c:247 __kasan_report mm/kasan/report.c:433 [inline] __kasan_report mm/kasan/report.c:433 [inline] mm/kasan/report.c:450 kasan_report+0x19a/0x1f0 mm/kasan/report.c:450 mm/kasan/report.c:450 nf_hook_entries_grow+0x5a7/0x700 net/netfilter/core.c:142 net/netfilter/core.c:142 __nf_register_net_hook+0x27e/0x8d0 net/netfilter/core.c:429 net/netfilter/core.c:429 nf_register_net_hook+0xaa/0x180 net/netfilter/core.c:571 net/netfilter/core.c:571 nft_register_flowtable_net_hooks+0x3c5/0x730 net/netfilter/nf_tables_api.c:7232 net/netfilter/nf_tables_api.c:7232 nf_tables_newflowtable+0x2022/0x2cf0 net/netfilter/nf_tables_api.c:7430 net/netfilter/nf_tables_api.c:7430 nfnetlink_rcv_batch net/netfilter/nfnetlink.c:513 [inline] nfnetlink_rcv_skb_batch net/netfilter/nfnetlink.c:634 [inline] nfnetlink_rcv_batch net/netfilter/nfnetlink.c:513 [inline] net/netfilter/nfnetlink.c:652 nfnetlink_rcv_skb_batch net/netfilter/nfnetlink.c:634 [inline] net/netfilter/nfnetlink.c:652 nfnetlink_rcv+0x10e6/0x2550 net/netfilter/nfnetlink.c:652 net/netfilter/nfnetlink.c:652 __nft_release_hook() calls nft_unregister_flowtable_net_hooks() which only unregisters the hooks, then after RCU grace period, it is guaranteed that no packets add new entries to the flowtable (no flow offload rules and flowtable hooks are reachable from packet path), so it is safe to call nf_flow_table_free() which cleans up the remaining entries from the flowtable (both software and hardware) and it unbinds the flow_block. Fixes: ff4bf2f42a40 ("netfilter: nf_tables: add nft_unregister_flowtable_hook()") Reported-by: syzbot+e918523f77e62790d6d9@syzkaller.appspotmail.com Signed-off-by: Pablo Neira Ayuso commit c086df4902573e2f06c6a2a83452c13a8bc603f5 Author: Jeff Layton Date: Mon Jan 10 18:52:52 2022 -0500 fuse: move FUSE_SUPER_MAGIC definition to magic.h ...to help userland apps that need to identify FUSE mounts. Signed-off-by: Jeff Layton Signed-off-by: Miklos Szeredi commit ae09639e3b2a0291b37b122c94dd4f773cd4e513 Author: Daniel Scally Date: Wed Feb 16 22:53:02 2022 +0000 platform/x86: int3472: Add terminator to gpiod_lookup_table Without the terminator, if a con_id is passed to gpio_find() that does not exist in the lookup table the function will not stop looping correctly, and eventually cause an oops. Fixes: 19d8d6e36b4b ("platform/x86: int3472: Pass tps68470_regulator_platform_data to the tps68470-regulator MFD-cell") Signed-off-by: Daniel Scally Link: https://lore.kernel.org/r/20220216225304.53911-5-djrscally@gmail.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit b6ad6261d27708567b309fdb3102b12c42a070cc Author: Baruch Siach Date: Mon Feb 21 13:45:57 2022 +0200 net: mdio-ipq4019: add delay after clock enable Experimentation shows that PHY detect might fail when the code attempts MDIO bus read immediately after clock enable. Add delay to stabilize the clock before bus access. PHY detect failure started to show after commit 7590fc6f80ac ("net: mdio: Demote probed message to debug print") that removed coincidental delay between clock enable and bus access. 10ms is meant to match the time it take to send the probed message over UART at 115200 bps. This might be a far overshoot. Fixes: 23a890d493e3 ("net: mdio: Add the reset function for IPQ MDIO driver") Signed-off-by: Baruch Siach Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 228339662b398a59b3560cd571deb8b25b253c7e Author: Jens Axboe Date: Mon Feb 21 05:49:30 2022 -0700 io_uring: don't convert to jiffies for waiting on timeouts If an application calls io_uring_enter(2) with a timespec passed in, convert that timespec to ktime_t rather than jiffies. The latter does not provide the granularity the application may expect, and may in fact provided different granularity on different systems, depending on what the HZ value is configured at. Turn the timespec into an absolute ktime_t, and use that with schedule_hrtimeout() instead. Link: https://github.com/axboe/liburing/issues/531 Cc: stable@vger.kernel.org Reported-by: Bob Chen Signed-off-by: Jens Axboe commit cc20cced0598d9a5ff91ae4ab147b3b5e99ee819 Author: Tao Liu Date: Fri Feb 18 22:35:24 2022 +0800 gso: do not skip outer ip header in case of ipip and net_failover We encounter a tcp drop issue in our cloud environment. Packet GROed in host forwards to a VM virtio_net nic with net_failover enabled. VM acts as a IPVS LB with ipip encapsulation. The full path like: host gro -> vm virtio_net rx -> net_failover rx -> ipvs fullnat -> ipip encap -> net_failover tx -> virtio_net tx When net_failover transmits a ipip pkt (gso_type = 0x0103, which means SKB_GSO_TCPV4, SKB_GSO_DODGY and SKB_GSO_IPXIP4), there is no gso did because it supports TSO and GSO_IPXIP4. But network_header points to inner ip header. Call Trace: tcp4_gso_segment ------> return NULL inet_gso_segment ------> inner iph, network_header points to ipip_gso_segment inet_gso_segment ------> outer iph skb_mac_gso_segment Afterwards virtio_net transmits the pkt, only inner ip header is modified. And the outer one just keeps unchanged. The pkt will be dropped in remote host. Call Trace: inet_gso_segment ------> inner iph, outer iph is skipped skb_mac_gso_segment __skb_gso_segment validate_xmit_skb validate_xmit_skb_list sch_direct_xmit __qdisc_run __dev_queue_xmit ------> virtio_net dev_hard_start_xmit __dev_queue_xmit ------> net_failover ip_finish_output2 ip_output iptunnel_xmit ip_tunnel_xmit ipip_tunnel_xmit ------> ipip dev_hard_start_xmit __dev_queue_xmit ip_finish_output2 ip_output ip_forward ip_rcv __netif_receive_skb_one_core netif_receive_skb_internal napi_gro_receive receive_buf virtnet_poll net_rx_action The root cause of this issue is specific with the rare combination of SKB_GSO_DODGY and a tunnel device that adds an SKB_GSO_ tunnel option. SKB_GSO_DODGY is set from external virtio_net. We need to reset network header when callbacks.gso_segment() returns NULL. This patch also includes ipv6_gso_segment(), considering SIT, etc. Fixes: cb32f511a70b ("ipip: add GSO/TSO support") Signed-off-by: Tao Liu Reviewed-by: Willem de Bruijn Signed-off-by: David S. Miller commit 221944736f66f38e9bdbce52c616d10df7f15c54 Author: Roman Gushchin Date: Wed Feb 16 12:43:30 2022 -0800 tools/cgroup/slabinfo: update to work with struct slab After the introduction of the dedicated struct slab to describe slab pages by commit d122019bf061 ("mm: Split slab into its own type") and the following removal of the corresponding struct page's fields by commit 07f910f9b729 ("mm: Remove slab from struct page") the memcg_slabinfo tool broke. An attempt to run it produces a trace like this: Traceback (most recent call last): File "/usr/bin/drgn", line 33, in sys.exit(load_entry_point('drgn==0.0.16', 'console_scripts', 'drgn')()) File "/usr/lib64/python3.9/site-packages/drgn/internal/cli.py", line 133, in main runpy.run_path(args.script[0], init_globals=init_globals, run_name="__main__") File "/usr/lib64/python3.9/runpy.py", line 268, in run_path return _run_module_code(code, init_globals, run_name, File "/usr/lib64/python3.9/runpy.py", line 97, in _run_module_code _run_code(code, mod_globals, init_globals, File "/usr/lib64/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "memcg_slabinfo.py", line 226, in main() File "memcg_slabinfo.py", line 199, in main cache = page.slab_cache AttributeError: 'struct page' has no member 'slab_cache' The problem can be fixed by explicitly casting struct page * to struct slab * for slab pages. The tools works as expected with this fix, e.g.: cred_jar 776 776 192 21 1 : tunables 0 0 0 : slabdata 547 547 0 kmalloc-cg-32 6 6 32 128 1 : tunables 0 0 0 : slabdata 9 9 0 files_cache 3 3 832 39 8 : tunables 0 0 0 : slabdata 8 8 0 kmalloc-cg-512 1 1 512 32 4 : tunables 0 0 0 : slabdata 10 10 0 task_struct 10 10 6720 4 8 : tunables 0 0 0 : slabdata 63 63 0 mm_struct 3 3 1664 19 8 : tunables 0 0 0 : slabdata 9 9 0 kmalloc-cg-16 1 1 16 256 1 : tunables 0 0 0 : slabdata 8 8 0 pde_opener 1 1 40 102 1 : tunables 0 0 0 : slabdata 8 8 0 anon_vma_chain 375 375 64 64 1 : tunables 0 0 0 : slabdata 81 81 0 radix_tree_node 3 3 584 28 4 : tunables 0 0 0 : slabdata 419 419 0 dentry 98 98 312 26 2 : tunables 0 0 0 : slabdata 1420 1420 0 btrfs_inode 3 3 2368 13 8 : tunables 0 0 0 : slabdata 730 730 0 signal_cache 3 3 1600 20 8 : tunables 0 0 0 : slabdata 17 17 0 sighand_cache 3 3 2240 14 8 : tunables 0 0 0 : slabdata 20 20 0 filp 90 90 512 32 4 : tunables 0 0 0 : slabdata 95 95 0 anon_vma 214 214 200 20 1 : tunables 0 0 0 : slabdata 162 162 0 kmalloc-cg-1k 1 1 1024 32 8 : tunables 0 0 0 : slabdata 22 22 0 pid 10 10 256 32 2 : tunables 0 0 0 : slabdata 14 14 0 kmalloc-cg-64 2 2 64 64 1 : tunables 0 0 0 : slabdata 8 8 0 kmalloc-cg-96 3 3 96 42 1 : tunables 0 0 0 : slabdata 8 8 0 sock_inode_cache 5 5 1408 23 8 : tunables 0 0 0 : slabdata 29 29 0 UNIX 7 7 1920 17 8 : tunables 0 0 0 : slabdata 21 21 0 inode_cache 36 36 1152 28 8 : tunables 0 0 0 : slabdata 680 680 0 proc_inode_cache 26 26 1224 26 8 : tunables 0 0 0 : slabdata 64 64 0 kmalloc-cg-2k 2 2 2048 16 8 : tunables 0 0 0 : slabdata 9 9 0 v2: change naming and count_partial()/count_free()/for_each_slab() signatures to work with slabs, suggested by Matthew Wilcox Fixes: 07f910f9b729 ("mm: Remove slab from struct page") Reported-by: Vasily Averin Signed-off-by: Roman Gushchin Tested-by: Vasily Averin Signed-off-by: Vlastimil Babka Link: https://lore.kernel.org/linux-patches/Yg2cKKnIboNu7j+p@carbon.DHCP.thefacebook.com/ commit 93dd04ab0b2b32ae6e70284afc764c577156658e Author: Greg Kroah-Hartman Date: Fri Feb 18 14:13:58 2022 +0100 slab: remove __alloc_size attribute from __kmalloc_track_caller Commit c37495d6254c ("slab: add __alloc_size attributes for better bounds checking") added __alloc_size attributes to a bunch of kmalloc function prototypes. Unfortunately the change to __kmalloc_track_caller seems to cause clang to generate broken code and the first time this is called when booting, the box will crash. While the compiler problems are being reworked and attempted to be solved [1], let's just drop the attribute to solve the issue now. Once it is resolved it can be added back. [1] https://github.com/ClangBuiltLinux/linux/issues/1599 Fixes: c37495d6254c ("slab: add __alloc_size attributes for better bounds checking") Cc: stable Cc: Kees Cook Cc: Daniel Micay Cc: Nick Desaulniers Cc: Christoph Lameter Cc: Pekka Enberg Cc: Joonsoo Kim Cc: Andrew Morton Cc: Vlastimil Babka Cc: Nathan Chancellor Cc: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org Cc: llvm@lists.linux.dev Signed-off-by: Greg Kroah-Hartman Acked-by: Nick Desaulniers Acked-by: David Rientjes Acked-by: Kees Cook Signed-off-by: Vlastimil Babka Link: https://lore.kernel.org/r/20220218131358.3032912-1-gregkh@linuxfoundation.org commit 28adef861233c6fce47372ebd2070b55eaa8e899 Author: Matt Roper Date: Tue Feb 15 08:35:45 2022 -0800 drm/i915/dg2: Print PHY name properly on calibration error We need to use phy_name() to convert the PHY value into a human-readable character in the error message. Fixes: a6a128116e55 ("drm/i915/dg2: Wait for SNPS PHY calibration during display init") Signed-off-by: Matt Roper Reviewed-by: Swathi Dhanavanthri Link: https://patchwork.freedesktop.org/patch/msgid/20220215163545.2175730-1-matthew.d.roper@intel.com (cherry picked from commit 84073e568eec7b586b2f6fd5fb2fb08f59edec54) Signed-off-by: Tvrtko Ursulin commit ec663bca9128f13eada25cd0446e7fcb5fcdc088 Author: Ville Syrjälä Date: Fri Feb 18 08:40:35 2022 +0200 drm/i915: Fix bw atomic check when switching between SAGV vs. no SAGV If the only thing that is changing is SAGV vs. no SAGV but the number of active planes and the total data rates end up unchanged we currently bail out of intel_bw_atomic_check() early and forget to actually compute the new WGV point mask and thus won't actually enable/disable SAGV as requested. This ends up poorly if we end up running with SAGV enabled when we shouldn't. Usually ends up in underruns. To fix this let's go through the QGV point mask computation if either the data rates/number of planes, or the state of SAGV is changing. v2: Check more carefully if things are changing to avoid the extra calculations/debugs from introducing unwanted overhead Cc: stable@vger.kernel.org Reviewed-by: Stanislav Lisovskiy #v1 Fixes: 20f505f22531 ("drm/i915: Restrict qgv points which don't have enough bandwidth.") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220218064039.12834-3-ville.syrjala@linux.intel.com (cherry picked from commit 6b728595ffa51c087343c716bccbfc260f120e72) Signed-off-by: Tvrtko Ursulin commit afc189df6bcc6be65961deb54e15ec60e7f85337 Author: Ville Syrjälä Date: Fri Feb 18 08:40:34 2022 +0200 drm/i915: Correctly populate use_sagv_wm for all pipes When changing between SAGV vs. no SAGV on tgl+ we have to update the use_sagv_wm flag for all the crtcs or else an active pipe not already in the state will end up using the wrong watermarks. That is especially bad when we end up with the tighter non-SAGV watermarks with SAGV enabled. Usually ends up in underruns. Cc: stable@vger.kernel.org Reviewed-by: Stanislav Lisovskiy Fixes: 7241c57d3140 ("drm/i915: Add TGL+ SAGV support") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220218064039.12834-2-ville.syrjala@linux.intel.com (cherry picked from commit 8dd8ffb824ca7b897ce9f2082ffa7e64831c22dc) Signed-off-by: Tvrtko Ursulin commit a40ee54e9a0958406469d46def03eec62aea0b69 Author: Imre Deak Date: Thu Feb 17 17:22:37 2022 +0200 drm/i915: Disconnect PHYs left connected by BIOS on disabled ports BIOS may leave a TypeC PHY in a connected state even though the corresponding port is disabled. This will prevent any hotplug events from being signalled (after the monitor deasserts and then reasserts its HPD) until the PHY is disconnected and so the driver will not detect a connected sink. Rebooting with the PHY in the connected state also results in a system hang. Fix the above by disconnecting TypeC PHYs on disabled ports. Before commit 64851a32c463e5 the PHY connected state was read out even for disabled ports and later the PHY got disconnected as a side effect of a tc_port_lock/unlock() sequence (during connector probing), hence recovering the port's hotplug functionality. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5014 Fixes: 64851a32c463 ("drm/i915/tc: Add a mode for the TypeC PHY's disconnected state") Cc: # v5.16+ Cc: José Roberto de Souza Signed-off-by: Imre Deak Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20220217152237.670220-1-imre.deak@intel.com (cherry picked from commit ed0ccf349ffd9c80e7376d4d8c608643de990e86) Signed-off-by: Tvrtko Ursulin commit 3f33364836aacc28cd430d22cf22379e3b5ecd77 Author: Ville Syrjälä Date: Mon Feb 14 11:18:08 2022 +0200 drm/i915: Widen the QGV point mask adlp+ adds some extra bits to the QGV point mask. The code attempts to handle that but forgot to actually make sure we can store those bits in the bw state. Fix it. Cc: stable@vger.kernel.org Cc: Stanislav Lisovskiy Fixes: 192fbfb76744 ("drm/i915: Implement PSF GV point support") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220214091811.13725-4-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy (cherry picked from commit c0299cc9840b3805205173cc77782f317b78ea0e) Signed-off-by: Tvrtko Ursulin commit 44a3918c8245ab10c6c9719dd12e7a8d291980d8 Author: Josh Poimboeuf Date: Fri Feb 18 11:49:08 2022 -0800 x86/speculation: Include unprivileged eBPF status in Spectre v2 mitigation reporting With unprivileged eBPF enabled, eIBRS (without retpoline) is vulnerable to Spectre v2 BHB-based attacks. When both are enabled, print a warning message and report it in the 'spectre_v2' sysfs vulnerabilities file. Signed-off-by: Josh Poimboeuf Signed-off-by: Borislav Petkov Reviewed-by: Thomas Gleixner commit 5ad3eb1132453b9795ce5fd4572b1c18b292cca9 Author: Peter Zijlstra Date: Wed Feb 16 20:57:02 2022 +0100 Documentation/hw-vuln: Update spectre doc Update the doc with the new fun. [ bp: Massage commit message. ] Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Thomas Gleixner commit 1e19da8522c81bf46b335f84137165741e0d82b7 Author: Peter Zijlstra Date: Wed Feb 16 20:57:01 2022 +0100 x86/speculation: Add eIBRS + Retpoline options Thanks to the chaps at VUsec it is now clear that eIBRS is not sufficient, therefore allow enabling of retpolines along with eIBRS. Add spectre_v2=eibrs, spectre_v2=eibrs,lfence and spectre_v2=eibrs,retpoline options to explicitly pick your preferred means of mitigation. Since there's new mitigations there's also user visible changes in /sys/devices/system/cpu/vulnerabilities/spectre_v2 to reflect these new mitigations. [ bp: Massage commit message, trim error messages, do more precise eIBRS mode checking. ] Co-developed-by: Josh Poimboeuf Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Patrick Colp Reviewed-by: Thomas Gleixner commit d45476d9832409371537013ebdd8dc1a7781f97a Author: Peter Zijlstra (Intel) Date: Wed Feb 16 20:57:00 2022 +0100 x86/speculation: Rename RETPOLINE_AMD to RETPOLINE_LFENCE The RETPOLINE_AMD name is unfortunate since it isn't necessarily AMD only, in fact Hygon also uses it. Furthermore it will likely be sufficient for some Intel processors. Therefore rename the thing to RETPOLINE_LFENCE to better describe what it is. Add the spectre_v2=retpoline,lfence option as an alias to spectre_v2=retpoline,amd to preserve existing setups. However, the output of /sys/devices/system/cpu/vulnerabilities/spectre_v2 will be changed. [ bp: Fix typos, massage. ] Co-developed-by: Josh Poimboeuf Signed-off-by: Josh Poimboeuf Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Thomas Gleixner commit cfc4442c642d568014474b6718ccf65dc7ca6099 Author: Daniele Palmas Date: Fri Feb 18 14:45:52 2022 +0100 USB: serial: option: add Telit LE910R1 compositions Add support for the following Telit LE910R1 compositions: 0x701a: rndis, tty, tty, tty 0x701b: ecm, tty, tty, tty 0x9201: tty Signed-off-by: Daniele Palmas Link: https://lore.kernel.org/r/20220218134552.4051-1-dnlplm@gmail.com Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit 6ecb3f0b18b320320460a42e40d6fb603f6ded96 Author: Slark Xiao Date: Mon Feb 14 10:14:01 2022 +0800 USB: serial: option: add support for DW5829e Dell DW5829e same as DW5821e except CAT level. DW5821e supports CAT16 but DW5829e supports CAT9. There are 2 types product of DW5829e: normal and eSIM. So we will add 2 PID for DW5829e. And for each PID, it support MBIM or RMNET. Let's see test evidence as below: DW5829e MBIM mode: T: Bus=04 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 4 Spd=5000 MxCh= 0 D: Ver= 3.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS= 9 #Cfgs= 2 P: Vendor=413c ProdID=81e6 Rev=03.18 S: Manufacturer=Dell Inc. S: Product=DW5829e Snapdragon X20 LTE S: SerialNumber=0123456789ABCDEF C: #Ifs= 7 Cfg#= 2 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=00 Prot=00 Driver=option I: If#=0x3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option I: If#=0x6 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none) DW5829e RMNET mode: T: Bus=04 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 5 Spd=5000 MxCh= 0 D: Ver= 3.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS= 9 #Cfgs= 1 P: Vendor=413c ProdID=81e6 Rev=03.18 S: Manufacturer=Dell Inc. S: Product=DW5829e Snapdragon X20 LTE S: SerialNumber=0123456789ABCDEF C: #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=896mA I: If#=0x0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan I: If#=0x1 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=00 Prot=00 Driver=usbhid I: If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option DW5829e-eSIM MBIM mode: T: Bus=04 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 6 Spd=5000 MxCh= 0 D: Ver= 3.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS= 9 #Cfgs= 2 P: Vendor=413c ProdID=81e4 Rev=03.18 S: Manufacturer=Dell Inc. S: Product=DW5829e-eSIM Snapdragon X20 LTE S: SerialNumber=0123456789ABCDEF C: #Ifs= 7 Cfg#= 2 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=00 Prot=00 Driver=option I: If#=0x3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option I: If#=0x6 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none) DW5829e-eSIM RMNET mode: T: Bus=04 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 7 Spd=5000 MxCh= 0 D: Ver= 3.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS= 9 #Cfgs= 1 P: Vendor=413c ProdID=81e4 Rev=03.18 S: Manufacturer=Dell Inc. S: Product=DW5829e-eSIM Snapdragon X20 LTE S: SerialNumber=0123456789ABCDEF C: #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=896mA I: If#=0x0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan I: If#=0x1 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=00 Prot=00 Driver=usbhid I: If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option BTW, the interface 0x6 of MBIM mode is GNSS port, which not same as NMEA port. So it's banned from serial option driver. The remaining interfaces 0x2-0x5 are: MODEM, MODEM, NMEA, DIAG. Signed-off-by: Slark Xiao Link: https://lore.kernel.org/r/20220214021401.6264-1-slark_xiao@163.com [ johan: drop unnecessary reservation of interface 1 ] Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit 198a7ebd5fa17b4d0be8cb70240ee1be885175c0 Author: Dmytro Bagrii Date: Thu Feb 10 18:41:37 2022 +0200 Revert "USB: serial: ch341: add new Product ID for CH341A" This reverts commit 46ee4abb10a07bd8f8ce910ee6b4ae6a947d7f63. CH341 has Product ID 0x5512 in EPP/MEM mode which is used for I2C/SPI/GPIO interfaces. In asynchronous serial interface mode CH341 has PID 0x5523 which is already in the table. Mode is selected by corresponding jumper setting. Signed-off-by: Dmytro Bagrii Link: https://lore.kernel.org/r/20220210164137.4376-1-dimich.dmb@gmail.com Link: https://lore.kernel.org/r/YJ0OCS/sh+1ifD/q@hovoldconsulting.com Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit fc3ef2e3297b3c0e2006b5d7b3d66965e3392036 Author: Pavel Skripkin Date: Sun Feb 20 19:01:14 2022 +0300 HID: hid-thrustmaster: fix OOB read in thrustmaster_interrupts Syzbot reported an slab-out-of-bounds Read in thrustmaster_probe() bug. The root case is in missing validation check of actual number of endpoints. Code should not blindly access usb_host_interface::endpoint array, since it may contain less endpoints than code expects. Fix it by adding missing validaion check and print an error if number of endpoints do not match expected number Fixes: c49c33637802 ("HID: support for initialization of some Thrustmaster wheels") Reported-and-tested-by: syzbot+35eebd505e97d315d01c@syzkaller.appspotmail.com Signed-off-by: Pavel Skripkin Signed-off-by: Jiri Kosina commit fa231bef3b34f1670b240409c11e59a3ce095e6d Author: Laurent Pinchart Date: Fri Feb 18 23:57:20 2022 +0200 soc: imx: gpcv2: Fix clock disabling imbalance in error path The imx_pgc_power_down() starts by enabling the domain clocks, and thus disables them in the error path. Commit 18c98573a4cf ("soc: imx: gpcv2: add domain option to keep domain clocks enabled") made the clock enable conditional, but forgot to add the same condition to the error path. This can result in a clock enable/disable imbalance. Fix it. Fixes: 18c98573a4cf ("soc: imx: gpcv2: add domain option to keep domain clocks enabled") Signed-off-by: Laurent Pinchart Reviewed-by: Lucas Stach Signed-off-by: Shawn Guo commit ba1366f3d039e7c3ca1fc29ed00ce3ed2b8fd32f Author: Thomas Gleixner Date: Sun Feb 13 14:54:05 2022 +0100 PCI: vmd: Prevent recursive locking on interrupt allocation Tejas reported the following recursive locking issue: swapper/0/1 is trying to acquire lock: ffff8881074fd0a0 (&md->mutex){+.+.}-{3:3}, at: msi_get_virq+0x30/0xc0 but task is already holding lock: ffff8881017cd6a0 (&md->mutex){+.+.}-{3:3}, at: __pci_enable_msi_range+0xf2/0x290 stack backtrace: __mutex_lock+0x9d/0x920 msi_get_virq+0x30/0xc0 pci_irq_vector+0x26/0x30 vmd_msi_init+0xcc/0x210 msi_domain_alloc+0xbf/0x150 msi_domain_alloc_irqs_descs_locked+0x3e/0xb0 __pci_enable_msi_range+0x155/0x290 pci_alloc_irq_vectors_affinity+0xba/0x100 pcie_port_device_register+0x307/0x550 pcie_portdrv_probe+0x3c/0xd0 pci_device_probe+0x95/0x110 This is caused by the VMD MSI code which does a lookup of the Linux interrupt number for an VMD managed MSI[X] vector. The lookup function tries to acquire the already held mutex. Avoid that by caching the Linux interrupt number at initialization time instead of looking it up over and over. Fixes: 82ff8e6b78fc ("PCI/MSI: Use msi_get_virq() in pci_get_vector()") Reported-by: "Surendrakumar Upadhyay, TejaskumarX" Signed-off-by: Thomas Gleixner Tested-by: "Surendrakumar Upadhyay, TejaskumarX" Cc: linux-pci@vger.kernel.org Link: https://lore.kernel.org/r/87a6euub2a.ffs@tglx commit cfb92440ee71adcc2105b0890bb01ac3cddb8507 Author: Linus Torvalds Date: Sun Feb 20 13:07:20 2022 -0800 Linux 5.17-rc5 commit 3324e6e803156b4296975555f566892e4e3f4fcf Merge: 222177397aabd 28df029d53a2f Author: Linus Torvalds Date: Sun Feb 20 12:50:50 2022 -0800 Merge tag 'locking_urgent_for_v5.17_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull locking fix from Borislav Petkov: "Fix a NULL ptr dereference when dumping lockdep chains through /proc/lockdep_chains" * tag 'locking_urgent_for_v5.17_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: lockdep: Correct lock_classes index mapping commit 222177397aabda681ca9a16ab498bba5c597cda0 Merge: 0b0894ff78cc4 44cad52cc14ae Author: Linus Torvalds Date: Sun Feb 20 12:46:21 2022 -0800 Merge tag 'x86_urgent_for_v5.17_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fixes from Borislav Petkov: - Fix the ptrace regset xfpregs_set() callback to behave according to the ABI - Handle poisoned pages properly in the SGX reclaimer code * tag 'x86_urgent_for_v5.17_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/ptrace: Fix xfpregs_set()'s incorrect xmm clearing x86/sgx: Fix missing poison handling in reclaimer commit 0b0894ff78cc47bc72d53ec340e4898782189868 Merge: 6e8e752f705c2 b1e8206582f9d Author: Linus Torvalds Date: Sun Feb 20 12:40:20 2022 -0800 Merge tag 'sched_urgent_for_v5.17_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull scheduler fix from Borislav Petkov: "Fix task exposure order when forking tasks" * tag 'sched_urgent_for_v5.17_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched: Fix yet more sched_fork() races commit 6e8e752f705c2713005a3182c8444ef7b54f10aa Merge: e268d7084a90c f8efca92ae509 Author: Linus Torvalds Date: Sun Feb 20 12:04:14 2022 -0800 Merge tag 'edac_urgent_for_v5.17_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras Pull EDAC fix from Borislav Petkov: "Fix a long-standing struct alignment bug in the EDAC struct allocation code" * tag 'edac_urgent_for_v5.17_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras: EDAC: Fix calculation of returned address and next offset in edac_align_ptr() commit e268d7084a90c740198579abc069813f903120aa Merge: 77478077349f1 10af115646171 Author: Linus Torvalds Date: Sun Feb 20 11:51:49 2022 -0800 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fixes from James Bottomley: "Three fixes, all in drivers. The ufs and qedi fixes are minor; the lpfc one is a bit bigger because it involves adding a heuristic to detect and deal with common but not standards compliant behaviour" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: ufs: core: Fix divide by zero in ufshcd_map_queues() scsi: lpfc: Fix pt2pt NVMe PRLI reject LOGO loop scsi: qedi: Fix ABBA deadlock in qedi_process_tmf_resp() and qedi_process_cmd_cleanup_resp() commit 77478077349f14c78e30faeac358cf1187c0f0c1 Merge: dacec3e7b9bc5 455896c53d5b8 Author: Linus Torvalds Date: Sun Feb 20 11:30:18 2022 -0800 Merge tag 'dmaengine-fix-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine Pull dmaengine fixes from Vinod Koul: "A bunch of driver fixes for: - ptdma error handling in init - lock fix in at_hdmac - error path and error num fix for sh dma - pm balance fix for stm32" * tag 'dmaengine-fix-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine: dmaengine: shdma: Fix runtime PM imbalance on error dmaengine: sh: rcar-dmac: Check for error num after dma_set_max_seg_size dmaengine: stm32-dmamux: Fix PM disable depth imbalance in stm32_dmamux_probe dmaengine: sh: rcar-dmac: Check for error num after setting mask dmaengine: at_xdmac: Fix missing unlock in at_xdmac_tasklet() dmaengine: ptdma: Fix the error handling path in pt_core_init() commit dacec3e7b9bc59275b4c41319a9a52b0a1cacfa9 Merge: 961af9dbe5d0d 2428766e20156 Author: Linus Torvalds Date: Sun Feb 20 11:23:48 2022 -0800 Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c fixes from Wolfram Sang: "Some driver updates, a MAINTAINERS fix, and additions to COMPILE_TEST (so we won't miss build problems again)" * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: MAINTAINERS: remove duplicate entry for i2c-qcom-geni i2c: brcmstb: fix support for DSL and CM variants i2c: qup: allow COMPILE_TEST i2c: imx: allow COMPILE_TEST i2c: cadence: allow COMPILE_TEST i2c: qcom-cci: don't put a device tree node before i2c_add_adapter() i2c: qcom-cci: don't delete an unregistered adapter i2c: bcm2835: Avoid clock stretching timeouts commit 961af9dbe5d0d0f58aac989bac17279c17a43663 Merge: 70d2bec7c545e 7b1f781f2d246 Author: Linus Torvalds Date: Sun Feb 20 11:15:46 2022 -0800 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Pull input fixes from Dmitry Torokhov: - a fix for Synaptics touchpads in RMI4 mode failing to suspend/resume properly because I2C client devices are now being suspended and resumed asynchronously which changed the ordering - a change to make sure we do not set right and middle buttons capabilities on touchpads that are "buttonpads" (i.e. do not have separate physical buttons) - a change to zinitix touchscreen driver adding more compatible strings/IDs * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: psmouse - set up dependency between PS/2 and SMBus companions Input: zinitix - add new compatible strings Input: clear BTN_RIGHT/MIDDLE on buttonpads commit 70d2bec7c545e06057c5d963b8623e6e234901e8 Merge: 7f25f0412c9e2 f444578d727a0 Author: Linus Torvalds Date: Sun Feb 20 11:07:46 2022 -0800 Merge tag 'for-v5.17-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply Pull power supply fixes from Sebastian Reichel: "Three regression fixes for the 5.17 cycle: - build warning fix for power-supply documentation - pointer size fix in cw2015 battery driver - OOM handling in bq256xx charger driver" * tag 'for-v5.17-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: power: supply: bq256xx: Handle OOM correctly power: supply: core: fix application of sizeof to pointer power: supply: fix table problem in sysfs-class-power commit 7f25f0412c9e2be6811e8aedbd10ef795fff85f2 Merge: c1034d249d145 538f4f022a461 Author: Linus Torvalds Date: Sun Feb 20 11:01:47 2022 -0800 Merge tag 'fs.mount_setattr.v5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux Pull mount_setattr test/doc fixes from Christian Brauner: "This contains a fix for one of the selftests for the mount_setattr syscall to create idmapped mounts, an entry for idmapped mounts for maintainers, and missing kernel documentation for the helper we split out some time ago to get and yield write access to a mount when changing mount properties" * tag 'fs.mount_setattr.v5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux: fs: add kernel doc for mnt_{hold,unhold}_writers() MAINTAINERS: add entry for idmapped mounts tests: fix idmapped mount_setattr test commit c1034d249d1453b0f4c11582515a418a5d45b570 Merge: 2d3409ebc87f4 ddc204b517e60 Author: Linus Torvalds Date: Sun Feb 20 10:55:05 2022 -0800 Merge tag 'pidfd.v5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux Pull pidfd fix from Christian Brauner: "This fixes a problem reported by lockdep when installing a pidfd via fd_install() with siglock and the tasklisk write lock held in copy_process() when calling clone()/clone3() with CLONE_PIDFD. Originally a pidfd was created prior to holding any of these locks but this required a call to ksys_close(). So quite some time ago in 6fd2fe494b17 ("copy_process(): don't use ksys_close() on cleanups") we switched to a get_unused_fd_flags() + fd_install() model. As part of that we moved fd_install() as late as possible. This was done for two main reasons. First, because we needed to ensure that we call fd_install() past the point of no return as once that's called the fd is live in the task's file table. Second, because we tried to ensure that the fd is visible in /proc//fd/ right when the task is visible. This fix moves the fd_install() to an even later point which means that a task will be visible in proc while the pidfd isn't yet under /proc//fd/. While this is a user visible change it's very unlikely that this will have any impact. Nobody should be relying on that and if they do we need to come up with something better but again, it's doubtful this is relevant" * tag 'pidfd.v5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux: copy_process(): Move fd_install() out of sighand->siglock critical section commit 2d3409ebc87f4bc4ed23bd39e78db9ffc29eec44 Merge: 4f12b742eb2b3 0cbae9e24fa7d Author: Linus Torvalds Date: Sun Feb 20 10:44:11 2022 -0800 Merge branch 'ucount-rlimit-fixes-for-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace Pull ucounts fixes from Eric Biederman: "Michal Koutný recently found some bugs in the enforcement of RLIMIT_NPROC in the recent ucount rlimit implementation. In this set of patches I have developed a very conservative approach changing only what is necessary to fix the bugs that I can see clearly. Cleanups and anything that is making the code more consistent can follow after we have the code working as it has historically. The problem is not so much inconsistencies (although those exist) but that it is very difficult to figure out what the code should be doing in the case of RLIMIT_NPROC. All other rlimits are only enforced where the resource is acquired (allocated). RLIMIT_NPROC by necessity needs to be enforced in an additional location, and our current implementation stumbled it's way into that implementation" * 'ucount-rlimit-fixes-for-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: ucounts: Handle wrapping in is_ucounts_overlimit ucounts: Move RLIMIT_NPROC handling after set_user ucounts: Base set_cred_ucounts changes on the real user ucounts: Enforce RLIMIT_NPROC not RLIMIT_NPROC+1 rlimit: Fix RLIMIT_NPROC enforcement failure caused by capability calls in set_user commit 5a3449734bcbaac7a2cc25a4773a89913ef10e66 Merge: 8940e6b669ca1 1278d17a1fb86 Author: David S. Miller Date: Sun Feb 20 13:47:15 2022 +0000 Merge branch 'bnxt_en-fixes' Michael Chan says: ==================== bnxt_en: Bug fixes This series contains bug fixes for FEC reporting, ethtool self test, multicast setup, devlink health reporting and live patching, and a firmware response timeout. ==================== Signed-off-by: David S. Miller commit 1278d17a1fb860e7eab4bc3ff4b026a87cbf5105 Author: Kalesh AP Date: Sun Feb 20 04:05:53 2022 -0500 bnxt_en: Fix devlink fw_activate To install a livepatch, first flash the package to NVM, and then activate the patch through the "HWRM_FW_LIVEPATCH" fw command. To uninstall a patch from NVM, flash the removal package and then activate it through the "HWRM_FW_LIVEPATCH" fw command. The "HWRM_FW_LIVEPATCH" fw command has to consider following scenarios: 1. no patch in NVM and no patch active. Do nothing. 2. patch in NVM, but not active. Activate the patch currently in NVM. 3. patch is not in NVM, but active. Deactivate the patch. 4. patch in NVM and the patch active. Do nothing. Fix the code to handle these scenarios during devlink "fw_activate". To install and activate a live patch: devlink dev flash pci/0000:c1:00.0 file thor_patch.pkg devlink -f dev reload pci/0000:c1:00.0 action fw_activate limit no_reset To remove and deactivate a live patch: devlink dev flash pci/0000:c1:00.0 file thor_patch_rem.pkg devlink -f dev reload pci/0000:c1:00.0 action fw_activate limit no_reset Fixes: 3c4153394e2c ("bnxt_en: implement firmware live patching") Reviewed-by: Vikas Gupta Reviewed-by: Somnath Kotur Signed-off-by: Kalesh AP Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit b891106da52b2c12dbaf73400f6d225b06a38d80 Author: Michael Chan Date: Sun Feb 20 04:05:52 2022 -0500 bnxt_en: Increase firmware message response DMA wait time When polling for the firmware message response, we first poll for the response message header. Once the valid length is detected in the header, we poll for the valid bit at the end of the message which signals DMA completion. Normally, this poll time for DMA completion is extremely short (0 to a few usec). But on some devices under some rare conditions, it can be up to about 20 msec. Increase this delay to 50 msec and use udelay() for the first 10 usec for the common case, and usleep_range() beyond that. Also, change the error message to include the above delay time when printing the timeout value. Fixes: 3c8c20db769c ("bnxt_en: move HWRM API implementation into separate file") Reviewed-by: Vladimir Olovyannikov Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 0e0e3c5358470cbad10bd7ca29f84a44d179d286 Author: Kalesh AP Date: Sun Feb 20 04:05:51 2022 -0500 bnxt_en: Restore the resets_reliable flag in bnxt_open() During ifdown, we call bnxt_inv_fw_health_reg() which will clear both the status_reliable and resets_reliable flags if these registers are mapped. This is correct because a FW reset during ifdown will clear these register mappings. If we detect that FW has gone through reset during the next ifup, we will remap these registers. But during normal ifup with no FW reset, we need to restore the resets_reliable flag otherwise we will not show the reset counter during devlink diagnose. Fixes: 8cc95ceb7087 ("bnxt_en: improve fw diagnose devlink health messages") Reviewed-by: Vikas Gupta Reviewed-by: Pavan Chebbi Reviewed-by: Somnath Kotur Signed-off-by: Kalesh AP Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 8cdb15924252e27af16c4a8fe0fc606ce5fd04dc Author: Pavan Chebbi Date: Sun Feb 20 04:05:50 2022 -0500 bnxt_en: Fix incorrect multicast rx mask setting when not requested We should setup multicast only when net_device flags explicitly has IFF_MULTICAST set. Otherwise we will incorrectly turn it on even when not asked. Fix it by only passing the multicast table to the firmware if IFF_MULTICAST is set. Fixes: 7d2837dd7a32 ("bnxt_en: Setup multicast properly after resetting device.") Signed-off-by: Pavan Chebbi Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit cfcab3b3b61584a02bb523ffa99564eafa761dfe Author: Michael Chan Date: Sun Feb 20 04:05:49 2022 -0500 bnxt_en: Fix occasional ethtool -t loopback test failures In the current code, we setup the port to PHY or MAC loopback mode and then transmit a test broadcast packet for the loopback test. This scheme fails sometime if the port is shared with management firmware that can also send packets. The driver may receive the management firmware's packet and the test will fail when the contents don't match the test packet. Change the test packet to use it's own MAC address as the destination and setup the port to only receive it's own MAC address. This should filter out other packets sent by management firmware. Fixes: 91725d89b97a ("bnxt_en: Add PHY loopback to ethtool self-test.") Reviewed-by: Pavan Chebbi Reviewed-by: Edwin Peer Reviewed-by: Andy Gospodarek Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 6758f937669dba14c6aac7ca004edda42ec1b18d Author: Michael Chan Date: Sun Feb 20 04:05:48 2022 -0500 bnxt_en: Fix offline ethtool selftest with RDMA enabled For offline (destructive) self tests, we need to stop the RDMA driver first. Otherwise, the RDMA driver will run into unrecoverable errors when destructive firmware tests are being performed. The irq_re_init parameter used in the half close and half open sequence when preparing the NIC for offline tests should be set to true because the RDMA driver will free all IRQs before the offline tests begin. Fixes: 55fd0cf320c3 ("bnxt_en: Add external loopback test to ethtool selftest.") Reviewed-by: Edwin Peer Reviewed-by: Ben Li Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 84d3c83e6ea7d46cf3de3a54578af73eb24a64f2 Author: Somnath Kotur Date: Sun Feb 20 04:05:47 2022 -0500 bnxt_en: Fix active FEC reporting to ethtool ethtool --show-fec does not show anything when the Active FEC setting in the chip is set to None. Fix it to properly return ETHTOOL_FEC_OFF in that case. Fixes: 8b2775890ad8 ("bnxt_en: Report FEC settings to ethtool.") Signed-off-by: Somnath Kotur Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit c94afc46cae7ad41b2ad6a99368147879f4b0e56 Author: Miaohe Lin Date: Thu Feb 17 22:53:27 2022 +0800 memblock: use kfree() to release kmalloced memblock regions memblock.{reserved,memory}.regions may be allocated using kmalloc() in memblock_double_array(). Use kfree() to release these kmalloced regions indicated by memblock_{reserved,memory}_in_slab. Signed-off-by: Miaohe Lin Fixes: 3010f876500f ("mm: discard memblock data later") Signed-off-by: Mike Rapoport commit e23e40fd6de5c1c94793bc4147e8f34387d58576 Author: Linus Walleij Date: Sat Feb 5 01:58:04 2022 +0100 hwmon: (ntc_thermistor) Underscore Samsung thermistor The sysfs does not like that we name the thermistor something that contains a dash: ntc-thermistor thermistor: hwmon: 'ssg1404-001221' is not a valid name attribute, please fix Fix it up by switching to an underscore. Fixes: e13e979b2b3d ("hwmon: (ntc_thermistor) Add Samsung 1404-001221 NTC") Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20220205005804.123245-1-linus.walleij@linaro.org Signed-off-by: Guenter Roeck commit b1a5983f56e371046dcf164f90bfaf704d2b89f6 Author: Pablo Neira Ayuso Date: Thu Feb 17 23:41:20 2022 +0100 netfilter: nf_tables_offload: incorrect flow offload action array size immediate verdict expression needs to allocate one slot in the flow offload action array, however, immediate data expression does not need to do so. fwd and dup expression need to allocate one slot, this is missing. Add a new offload_action interface to report if this expression needs to allocate one slot in the flow offload action array. Fixes: be2861dc36d7 ("netfilter: nft_{fwd,dup}_netdev: add offload support") Reported-and-tested-by: Nick Gregory Signed-off-by: Pablo Neira Ayuso commit 8940e6b669ca1196ce0a0549c819078096390f76 Author: Vladimir Oltean Date: Fri Feb 18 14:13:02 2022 +0200 net: dsa: avoid call to __dev_set_promiscuity() while rtnl_mutex isn't held If the DSA master doesn't support IFF_UNICAST_FLT, then the following call path is possible: dsa_slave_switchdev_event_work -> dsa_port_host_fdb_add -> dev_uc_add -> __dev_set_rx_mode -> __dev_set_promiscuity Since the blamed commit, dsa_slave_switchdev_event_work() no longer holds rtnl_lock(), which triggers the ASSERT_RTNL() from __dev_set_promiscuity(). Taking rtnl_lock() around dev_uc_add() is impossible, because all the code paths that call dsa_flush_workqueue() do so from contexts where the rtnl_mutex is already held - so this would lead to an instant deadlock. dev_uc_add() in itself doesn't require the rtnl_mutex for protection. There is this comment in __dev_set_rx_mode() which assumes so: /* Unicast addresses changes may only happen under the rtnl, * therefore calling __dev_set_promiscuity here is safe. */ but it is from commit 4417da668c00 ("[NET]: dev: secondary unicast address support") dated June 2007, and in the meantime, commit f1f28aa3510d ("netdev: Add addr_list_lock to struct net_device."), dated July 2008, has added &dev->addr_list_lock to protect this instead of the global rtnl_mutex. Nonetheless, __dev_set_promiscuity() does assume rtnl_mutex protection, but it is the uncommon path of what we typically expect dev_uc_add() to do. So since only the uncommon path requires rtnl_lock(), just check ahead of time whether dev_uc_add() would result into a call to __dev_set_promiscuity(), and handle that condition separately. DSA already configures the master interface to be promiscuous if the tagger requires this. We can extend this to also cover the case where the master doesn't handle dev_uc_add() (doesn't support IFF_UNICAST_FLT), and on the premise that we'd end up making it promiscuous during operation anyway, either if a DSA slave has a non-inherited MAC address, or if the bridge notifies local FDB entries for its own MAC address, the address of a station learned on a foreign port, etc. Fixes: 0faf890fc519 ("net: dsa: drop rtnl_lock from dsa_slave_switchdev_event_work") Reported-by: Oleksij Rempel Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 3d00827a90db6f79abc7cdc553887f89a2e0a184 Author: Svenning Sørensen Date: Fri Feb 18 11:27:01 2022 +0000 net: dsa: microchip: fix bridging with more than two member ports Commit b3612ccdf284 ("net: dsa: microchip: implement multi-bridge support") plugged a packet leak between ports that were members of different bridges. Unfortunately, this broke another use case, namely that of more than two ports that are members of the same bridge. After that commit, when a port is added to a bridge, hardware bridging between other member ports of that bridge will be cleared, preventing packet exchange between them. Fix by ensuring that the Port VLAN Membership bitmap includes any existing ports in the bridge, not just the port being added. Fixes: b3612ccdf284 ("net: dsa: microchip: implement multi-bridge support") Signed-off-by: Svenning Sørensen Tested-by: Oleksij Rempel Signed-off-by: David S. Miller commit 5486f5bf790b5c664913076c3194b8f916a5c7ad Author: Christophe Leroy Date: Thu Feb 17 14:35:49 2022 +0100 net: Force inlining of checksum functions in net/checksum.h All functions defined as static inline in net/checksum.h are meant to be inlined for performance reason. But since commit ac7c3e4ff401 ("compiler: enable CONFIG_OPTIMIZE_INLINING forcibly") the compiler is allowed to uninline functions when it wants. Fair enough in the general case, but for tiny performance critical checksum helpers that's counter-productive. The problem mainly arises when selecting CONFIG_CC_OPTIMISE_FOR_SIZE, Those helpers being 'static inline' in header files you suddenly find them duplicated many times in the resulting vmlinux. Here is a typical exemple when building powerpc pmac32_defconfig with CONFIG_CC_OPTIMISE_FOR_SIZE. csum_sub() appears 4 times: c04a23cc : c04a23cc: 7c 84 20 f8 not r4,r4 c04a23d0: 7c 63 20 14 addc r3,r3,r4 c04a23d4: 7c 63 01 94 addze r3,r3 c04a23d8: 4e 80 00 20 blr ... c04a2ce8: 4b ff f6 e5 bl c04a23cc ... c04a2d2c: 4b ff f6 a1 bl c04a23cc ... c04a2d54: 4b ff f6 79 bl c04a23cc ... c04a754c : c04a754c: 7c 84 20 f8 not r4,r4 c04a7550: 7c 63 20 14 addc r3,r3,r4 c04a7554: 7c 63 01 94 addze r3,r3 c04a7558: 4e 80 00 20 blr ... c04ac930: 4b ff ac 1d bl c04a754c ... c04ad264: 4b ff a2 e9 bl c04a754c ... c04e3b08 : c04e3b08: 7c 84 20 f8 not r4,r4 c04e3b0c: 7c 63 20 14 addc r3,r3,r4 c04e3b10: 7c 63 01 94 addze r3,r3 c04e3b14: 4e 80 00 20 blr ... c04e5788: 4b ff e3 81 bl c04e3b08 ... c04e65c8: 4b ff d5 41 bl c04e3b08 ... c0512d34 : c0512d34: 7c 84 20 f8 not r4,r4 c0512d38: 7c 63 20 14 addc r3,r3,r4 c0512d3c: 7c 63 01 94 addze r3,r3 c0512d40: 4e 80 00 20 blr ... c0512dfc: 4b ff ff 39 bl c0512d34 ... c05138bc: 4b ff f4 79 bl c0512d34 ... Restore the expected behaviour by using __always_inline for all functions defined in net/checksum.h vmlinux size is even reduced by 256 bytes with this patch: text data bss dec hex filename 6980022 2515362 194384 9689768 93daa8 vmlinux.before 6979862 2515266 194384 9689512 93d9a8 vmlinux.now Fixes: ac7c3e4ff401 ("compiler: enable CONFIG_OPTIMIZE_INLINING forcibly") Cc: Masahiro Yamada Cc: Nick Desaulniers Cc: Andrew Morton Signed-off-by: Christophe Leroy Signed-off-by: David S. Miller commit 0033fced48d281d59f35565106e6d78b25a2f6e6 Merge: 90141edcd53d1 5950bdc88dd1d Author: David S. Miller Date: Sat Feb 19 12:35:20 2022 +0000 Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2022-02-18 This series contains updates to ice driver only. Wojciech fixes protocol matching for slow-path switchdev so that all packets are correctly redirected. Michal removes accidental unconditional setting of l4 port filtering flag. Jake adds locking to protect VF reset and removal to fix various issues that can be encountered when they race with each other. Tom Rix propagates an error and initializes a struct to resolve reported Clang issues. ==================== Signed-off-by: David S. Miller commit 90141edcd53d145e870bca24d0ce0daaa7157e02 Merge: 3a14d0888eb4b e35f885b357d4 Author: David S. Miller Date: Sat Feb 19 12:28:01 2022 +0000 Merge branch 'mptcp-fixes' Mat Martineau says: ==================== mptcp: Fix address advertisement races and stabilize tests Patches 1, 2, and 7 modify two self tests to give consistent, accurate results by fixing timing issues and accounting for syncookie behavior. Paches 3-6 fix two races in overlapping address advertisement send and receive. Associated self tests are updated, including addition of two MIBs to enable testing and tracking dropped address events. ==================== Signed-off-by: David S. Miller commit e35f885b357d47e04380a2056d1b2cc3e6f4f24b Author: Paolo Abeni Date: Fri Feb 18 13:35:44 2022 -0800 selftests: mptcp: be more conservative with cookie MPJ limits Since commit 2843ff6f36db ("mptcp: remote addresses fullmesh"), an MPTCP client can attempt creating multiple MPJ subflow simultaneusly. In such scenario the server, when syncookies are enabled, could end-up accepting incoming MPJ syn even above the configured subflow limit, as the such limit can be enforced in a reliable way only after the subflow creation. In case of syncookie, only after the 3rd ack reception. As a consequence the related self-tests case sporadically fails, as it verify that the server always accept the expected number of MPJ syn. Address the issues relaxing the MPJ syn number constrain. Note that the check on the accepted number of MPJ 3rd ack still remains intact. Fixes: 2843ff6f36db ("mptcp: remote addresses fullmesh") Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 6ef84b1517e08f6c2fc105b798a9d21bf4caa6cb Author: Paolo Abeni Date: Fri Feb 18 13:35:43 2022 -0800 selftests: mptcp: more robust signal race test The in kernel MPTCP PM implementation can process a single incoming add address option at any given time. In the mentioned test the server can surpass such limit. Let the setup cope with that allowing a faster add_addr retransmission. Fixes: a88c9e496937 ("mptcp: do not block subflows creation on errors") Fixes: f7efc7771eac ("mptcp: drop argument port from mptcp_pm_announce_addr") Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/254 Reported-and-tested-by: Matthieu Baerts Reviewed-by: Matthieu Baerts Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit f73c1194634506ab60af0debef04671fc431a435 Author: Paolo Abeni Date: Fri Feb 18 13:35:42 2022 -0800 mptcp: add mibs counter for ignored incoming options The MPTCP in kernel path manager has some constraints on incoming addresses announce processing, so that in edge scenarios it can end-up dropping (ignoring) some of such announces. The above is not very limiting in practice since such scenarios are very uncommon and MPTCP will recover due to ADD_ADDR retransmissions. This patch adds a few MIB counters to account for such drop events to allow easier introspection of the critical scenarios. Fixes: f7efc7771eac ("mptcp: drop argument port from mptcp_pm_announce_addr") Reviewed-by: Matthieu Baerts Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 837cf45df163a3780bc04b555700231e95b31dc9 Author: Paolo Abeni Date: Fri Feb 18 13:35:41 2022 -0800 mptcp: fix race in incoming ADD_ADDR option processing If an MPTCP endpoint received multiple consecutive incoming ADD_ADDR options, mptcp_pm_add_addr_received() can overwrite the current remote address value after the PM lock is released in mptcp_pm_nl_add_addr_received() and before such address is echoed. Fix the issue caching the remote address value a little earlier and always using the cached value after releasing the PM lock. Fixes: f7efc7771eac ("mptcp: drop argument port from mptcp_pm_announce_addr") Reviewed-by: Matthieu Baerts Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 98247bc16a27cf8ead4c47ce9f15888be85841fc Author: Paolo Abeni Date: Fri Feb 18 13:35:40 2022 -0800 mptcp: fix race in overlapping signal events After commit a88c9e496937 ("mptcp: do not block subflows creation on errors"), if a signal address races with a failing subflow creation, the subflow creation failure control path can trigger the selection of the next address to be announced while the current announced is still pending. The above will cause the unintended suppression of the ADD_ADDR announce. Fix the issue skipping the to-be-suppressed announce before it will mark an endpoint as already used. The relevant announce will be triggered again when the current one will complete. Fixes: a88c9e496937 ("mptcp: do not block subflows creation on errors") Reviewed-by: Matthieu Baerts Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 5b31dda736e31c58d1941c7349569c7452eafb6b Author: Paolo Abeni Date: Fri Feb 18 13:35:39 2022 -0800 selftests: mptcp: improve 'fair usage on close' stability The mentioned test has to wait for a subflow creation failure. The current code looks for TCP sockets in TW state and sometimes misses the relevant event. Switch to a more stable check, looking for the associated mib counter. Fixes: 46e967d187ed ("selftests: mptcp: add tests for subflow creation failure") Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/257 Reported-and-tested-by: Matthieu Baerts Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 0cd33c5ffec12bd77a1c02db2469fac08f840939 Author: Paolo Abeni Date: Fri Feb 18 13:35:38 2022 -0800 selftests: mptcp: fix diag instability Instead of waiting for an arbitrary amount of time for the MPTCP MP_CAPABLE handshake to complete, explicitly wait for the relevant socket to enter into the established status. Additionally let the data transfer application use the slowest transfer mode available (-r), to cope with very slow host, or high jitter caused by hosting VMs. Fixes: df62f2ec3df6 ("selftests/mptcp: add diag interface tests") Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/258 Reported-and-tested-by: Matthieu Baerts Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 2428766e201565a5fa964d7461d9f6608eb04d7d Author: Wolfram Sang Date: Fri Feb 18 11:49:04 2022 +0100 MAINTAINERS: remove duplicate entry for i2c-qcom-geni The driver is already covered in the ARM/QUALCOMM section. Also, Akash Asthana's email bounces meanwhile and Mukesh Savaliya has never responded to mails regarding this driver. Signed-off-by: Wolfram Sang Acked-by: Bjorn Andersson Signed-off-by: Wolfram Sang commit b1e8206582f9d680cff7d04828708c8b6ab32957 Author: Peter Zijlstra Date: Mon Feb 14 10:16:57 2022 +0100 sched: Fix yet more sched_fork() races Where commit 4ef0c5c6b5ba ("kernel/sched: Fix sched_fork() access an invalid sched_task_group") fixed a fork race vs cgroup, it opened up a race vs syscalls by not placing the task on the runqueue before it gets exposed through the pidhash. Commit 13765de8148f ("sched/fair: Fix fault in reweight_entity") is trying to fix a single instance of this, instead fix the whole class of issues, effectively reverting this commit. Fixes: 4ef0c5c6b5ba ("kernel/sched: Fix sched_fork() access an invalid sched_task_group") Reported-by: Linus Torvalds Signed-off-by: Peter Zijlstra (Intel) Tested-by: Tadeusz Struk Tested-by: Zhang Qiao Tested-by: Dietmar Eggemann Link: https://lkml.kernel.org/r/YgoeCbwj5mbCR0qA@hirez.programming.kicks-ass.net commit 3a14d0888eb4b0045884126acc69abfb7b87814d Author: Christophe JAILLET Date: Fri Feb 18 14:15:35 2022 +0100 nfp: flower: Fix a potential leak in nfp_tunnel_add_shared_mac() ida_simple_get() returns an id between min (0) and max (NFP_MAX_MAC_INDEX) inclusive. So NFP_MAX_MAC_INDEX (0xff) is a valid id. In order for the error handling path to work correctly, the 'invalid' value for 'ida_idx' should not be in the 0..NFP_MAX_MAC_INDEX range, inclusive. So set it to -1. Fixes: 20cce8865098 ("nfp: flower: enable MAC address sharing for offloadable devs") Signed-off-by: Christophe JAILLET Signed-off-by: Simon Horman Link: https://lore.kernel.org/r/20220218131535.100258-1-simon.horman@corigine.com Signed-off-by: Jakub Kicinski commit ba88b5533728c54bdea68431988eff2d9a7a1237 Author: Subash Abhinov Kasiviswanathan Date: Fri Feb 18 01:50:18 2022 -0700 MAINTAINERS: rmnet: Update email addresses Switch to the quicinc.com ids. Signed-off-by: Sean Tranchetti Signed-off-by: Subash Abhinov Kasiviswanathan Link: https://lore.kernel.org/r/1645174218-32632-1-git-send-email-quic_subashab@quicinc.com Signed-off-by: Jakub Kicinski commit 5a2aba71cd2610d3ed08867a1b1bf617cd8f89b8 Author: Jeremy Linton Date: Mon Feb 14 17:18:52 2022 -0600 net: mvpp2: always set port pcs ops Booting a MACCHIATObin with 5.17, the system OOPs with a null pointer deref when the network is started. This is caused by the pcs->ops structure being null in mcpp2_acpi_start() when it tries to call pcs_config(). Hoisting the code which sets pcs_gmac.ops and pcs_xlg.ops, assuring they are always set, fixes the problem. The OOPs looks like: [ 18.687760] Unable to handle kernel access to user memory outside uaccess routines at virtual address 0000000000000010 [ 18.698561] Mem abort info: [ 18.698564] ESR = 0x96000004 [ 18.698567] EC = 0x25: DABT (current EL), IL = 32 bits [ 18.709821] SET = 0, FnV = 0 [ 18.714292] EA = 0, S1PTW = 0 [ 18.718833] FSC = 0x04: level 0 translation fault [ 18.725126] Data abort info: [ 18.729408] ISV = 0, ISS = 0x00000004 [ 18.734655] CM = 0, WnR = 0 [ 18.738933] user pgtable: 4k pages, 48-bit VAs, pgdp=0000000111bbf000 [ 18.745409] [0000000000000010] pgd=0000000000000000, p4d=0000000000000000 [ 18.752235] Internal error: Oops: 96000004 [#1] SMP [ 18.757134] Modules linked in: rfkill ip_set nf_tables nfnetlink qrtr sunrpc vfat fat omap_rng fuse zram xfs crct10dif_ce mvpp2 ghash_ce sbsa_gwdt phylink xhci_plat_hcd ahci_plam [ 18.773481] CPU: 0 PID: 681 Comm: NetworkManager Not tainted 5.17.0-0.rc3.89.fc36.aarch64 #1 [ 18.781954] Hardware name: Marvell Armada 7k/8k Family Board /Armada 7k/8k Family Board , BIOS EDK II Jun 4 2019 [ 18.795222] pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 18.802213] pc : mvpp2_start_dev+0x2b0/0x300 [mvpp2] [ 18.807208] lr : mvpp2_start_dev+0x298/0x300 [mvpp2] [ 18.812197] sp : ffff80000b4732c0 [ 18.815522] x29: ffff80000b4732c0 x28: 0000000000000000 x27: ffffccab38ae57f8 [ 18.822689] x26: ffff6eeb03065a10 x25: ffff80000b473a30 x24: ffff80000b4735b8 [ 18.829855] x23: 0000000000000000 x22: 00000000000001e0 x21: ffff6eeb07b6ab68 [ 18.837021] x20: ffff6eeb07b6ab30 x19: ffff6eeb07b6a9c0 x18: 0000000000000014 [ 18.844187] x17: 00000000f6232bfe x16: ffffccab899b1dc0 x15: 000000006a30f9fa [ 18.851353] x14: 000000003b77bd50 x13: 000006dc896f0e8e x12: 001bbbfccfd0d3a2 [ 18.858519] x11: 0000000000001528 x10: 0000000000001548 x9 : ffffccab38ad0fb0 [ 18.865685] x8 : ffff80000b473330 x7 : 0000000000000000 x6 : 0000000000000000 [ 18.872851] x5 : 0000000000000000 x4 : 0000000000000000 x3 : ffff80000b4732f8 [ 18.880017] x2 : 000000000000001a x1 : 0000000000000002 x0 : ffff6eeb07b6ab68 [ 18.887183] Call trace: [ 18.889637] mvpp2_start_dev+0x2b0/0x300 [mvpp2] [ 18.894279] mvpp2_open+0x134/0x2b4 [mvpp2] [ 18.898483] __dev_open+0x128/0x1e4 [ 18.901988] __dev_change_flags+0x17c/0x1d0 [ 18.906187] dev_change_flags+0x30/0x70 [ 18.910038] do_setlink+0x278/0xa7c [ 18.913540] __rtnl_newlink+0x44c/0x7d0 [ 18.917391] rtnl_newlink+0x5c/0x8c [ 18.920892] rtnetlink_rcv_msg+0x254/0x314 [ 18.925006] netlink_rcv_skb+0x48/0x10c [ 18.928858] rtnetlink_rcv+0x24/0x30 [ 18.932449] netlink_unicast+0x290/0x2f4 [ 18.936386] netlink_sendmsg+0x1d0/0x41c [ 18.940323] sock_sendmsg+0x60/0x70 [ 18.943825] ____sys_sendmsg+0x248/0x260 [ 18.947762] ___sys_sendmsg+0x74/0xa0 [ 18.951438] __sys_sendmsg+0x64/0xcc [ 18.955027] __arm64_sys_sendmsg+0x30/0x40 [ 18.959140] invoke_syscall+0x50/0x120 [ 18.962906] el0_svc_common.constprop.0+0x4c/0xf4 [ 18.967629] do_el0_svc+0x30/0x9c [ 18.970958] el0_svc+0x28/0xb0 [ 18.974025] el0t_64_sync_handler+0x10c/0x140 [ 18.978400] el0t_64_sync+0x1a4/0x1a8 [ 18.982078] Code: 52800004 b9416262 aa1503e0 52800041 (f94008a5) [ 18.988196] ---[ end trace 0000000000000000 ]--- Fixes: cff056322372 ("net: mvpp2: use .mac_select_pcs() interface") Suggested-by: Russell King (Oracle) Signed-off-by: Jeremy Linton Reviewed-by: Marcin Wojtas Link: https://lore.kernel.org/r/20220214231852.3331430-1-jeremy.linton@arm.com Signed-off-by: Jakub Kicinski commit 486c2d15aa812d669bb27f8241aa5d5dafbac5b9 Merge: d1e972ace4239 6f66db29e2415 Author: Linus Walleij Date: Sat Feb 19 02:03:58 2022 +0100 Merge tag 'intel-pinctrl-v5.17-5' of gitolite.kernel.org:pub/scm/linux/kernel/git/pinctrl/intel into fixes intel-pinctrl for v5.17-5 * Revert misplaced ID The following is an automated git shortlog grouped by driver: tigerlake: - Revert "Add Alder Lake-M ACPI ID" commit d1e972ace42390de739cde87d96043dcbe502286 Author: Marc Zyngier Date: Fri Feb 11 09:39:04 2022 +0000 gpio: tegra186: Fix chip_data type confusion The tegra186 GPIO driver makes the assumption that the pointer returned by irq_data_get_irq_chip_data() is a pointer to a tegra_gpio structure. Unfortunately, it is actually a pointer to the inner gpio_chip structure, as mandated by the gpiolib infrastructure. Nice try. The saving grace is that the gpio_chip is the first member of tegra_gpio, so the bug has gone undetected since... forever. Fix it by performing a container_of() on the pointer. This results in no additional code, and makes it possible to understand how the whole thing works. Fixes: 5b2b135a87fc ("gpio: Add Tegra186 support") Signed-off-by: Marc Zyngier Cc: Thierry Reding Cc: Linus Walleij Cc: Bartosz Golaszewski Link: https://lore.kernel.org/r/20220211093904.1112679-1-maz@kernel.org Signed-off-by: Linus Walleij commit 64fd52a4d3ce63a327948cefc8e4e5c7ef35e813 Author: Marc Zyngier Date: Fri Feb 11 09:23:45 2022 +0000 pinctrl: starfive: Use a static name for the GPIO irq_chip Drop the device name used for the GPIO irq_chip and replace it with something static. The information is still available from debugfs and carried as part of the irqdomain. Suggested-by: Emil Renner Berthing Signed-off-by: Marc Zyngier Cc: Linus Walleij Cc: Bartosz Golaszewski Link: https://lore.kernel.org/r/20220211092345.1093332-1-maz@kernel.org Signed-off-by: Linus Walleij commit 4f12b742eb2b3a850ac8be7dc4ed52976fc6cb0b Merge: 1c2a33d0ac696 d19e0183a8830 Author: Linus Torvalds Date: Fri Feb 18 16:24:44 2022 -0800 Merge tag 'nfs-for-5.17-3' of git://git.linux-nfs.org/projects/anna/linux-nfs Pull NFS client bugfixes from Anna Schumaker: - Fix unnecessary changeattr revalidations - Fix resolving symlinks during directory lookups - Don't report writeback errors in nfs_getattr() * tag 'nfs-for-5.17-3' of git://git.linux-nfs.org/projects/anna/linux-nfs: NFS: Do not report writeback errors in nfs_getattr() NFS: LOOKUP_DIRECTORY is also ok with symlinks NFS: Remove an incorrect revalidation in nfs4_update_changeattr_locked() commit 1c2a33d0ac6961d36cd653638c7841b179969906 Merge: 241c32d853a84 8292656464e5f Author: Linus Torvalds Date: Fri Feb 18 16:19:14 2022 -0800 Merge tag 'acpi-5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI fixes from Rafael Wysocki: "These make an excess warning message go away and fix a recently introduced boot failure on a vintage machine. Specifics: - Change the log level of the "table not found" message in acpi_table_parse_entries_array() to debug to prevent it from showing up in the logs unnecessarily (Dan Williams) - Add a C-state limit quirk for 32-bit ThinkPad T40 to prevent it from crashing on boot after recent changes in the ACPI processor driver (Woody Suwalski)" * tag 'acpi-5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: processor: idle: fix lockup regression on 32-bit ThinkPad T40 ACPI: tables: Quiet ACPI table not found warning commit 241c32d853a84b9d775f9fd58f1ba91a0a5c9117 Merge: 7993e65fdd0fe 5feef64f4c670 Author: Linus Torvalds Date: Fri Feb 18 16:14:13 2022 -0800 Merge tag 'riscv-for-linus-5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull RISC-V fixes from Palmer Dabbelt: "A set of three fixes, all aimed at fixing some fallout from the recent sparse hart ID support" * tag 'riscv-for-linus-5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: RISC-V: Fix IPI/RFENCE hmask on non-monotonic hartid ordering RISC-V: Fix handling of empty cpu masks RISC-V: Fix hartid mask handling for hartid 31 and up commit a222fd8541394b36b13c89d1698d9530afd59a9c Author: Jiasheng Jiang Date: Thu Dec 30 09:45:43 2021 +0800 soc: fsl: qe: Check of ioremap return value As the possible failure of the ioremap(), the par_io could be NULL. Therefore it should be better to check it and return error in order to guarantee the success of the initiation. But, I also notice that all the caller like mpc85xx_qe_par_io_init() in `arch/powerpc/platforms/85xx/common.c` don't check the return value of the par_io_init(). Actually, par_io_init() needs to check to handle the potential error. I will submit another patch to fix that. Anyway, par_io_init() itsely should be fixed. Fixes: 7aa1aa6ecec2 ("QE: Move QE from arch/powerpc to drivers/soc") Signed-off-by: Jiasheng Jiang Signed-off-by: Li Yang commit 6385960501d9e0248a8745714674e86bd077e198 Author: Jason Wang Date: Sat Dec 11 17:08:45 2021 +0800 soc: fsl: qe: fix typo in a comment The double `is' in the comment in line 150 is repeated. Remove one of them from the comment. Also removes a redundant tab in a new line. Signed-off-by: Jason Wang Signed-off-by: Li Yang commit b9abe942cda43a1d46a0fd96efb54f1aa909f757 Author: Christophe JAILLET Date: Wed Nov 3 21:00:33 2021 +0100 soc: fsl: guts: Add a missing memory allocation failure check If 'devm_kstrdup()' fails, we should return -ENOMEM. While at it, move the 'of_node_put()' call in the error handling path and after the 'machine' has been copied. Better safe than sorry. Fixes: a6fc3b698130 ("soc: fsl: add GUTS driver for QorIQ platforms") Depends-on: fddacc7ff4dd ("soc: fsl: guts: Revert commit 3c0d64e867ed") Suggested-by: Tyrel Datwyler Signed-off-by: Christophe JAILLET Signed-off-by: Li Yang commit b113737cf12964a20cc3ba1ddabe6229099661c6 Author: Christophe JAILLET Date: Wed Nov 3 21:00:17 2021 +0100 soc: fsl: guts: Revert commit 3c0d64e867ed This reverts commit 3c0d64e867ed ("soc: fsl: guts: reuse machine name from device tree"). A following patch will fix the missing memory allocation failure check instead. Suggested-by: Tyrel Datwyler Signed-off-by: Christophe JAILLET Signed-off-by: Li Yang commit b80af7564446c8ab96438cac00e0575eb86154ad Author: Andy Shevchenko Date: Wed Nov 10 12:59:51 2021 +0200 soc: fsl: Correct MAINTAINERS database (SOC) MAINTAINERS lacks of proper coverage for FSL headers. Fix it accordingly. Fixes: 1b48706f027c ("MAINTAINERS: add entry for Freescale SoC drivers") Signed-off-by: Andy Shevchenko Signed-off-by: Li Yang commit f2b70418ec6f104981b54709a4cfe3a3c46b7d8f Author: Andy Shevchenko Date: Wed Nov 10 12:59:50 2021 +0200 soc: fsl: Correct MAINTAINERS database (QUICC ENGINE LIBRARY) MAINTAINERS lacks of proper coverage for FSL headers. Fix it accordingly. Fixes: 7aa1aa6ecec2 ("QE: Move QE from arch/powerpc to drivers/soc") Signed-off-by: Andy Shevchenko Signed-off-by: Li Yang commit 988f0a9045b0058a43ccee764a671dfab81e6d15 Author: Andy Shevchenko Date: Wed Nov 10 12:59:52 2021 +0200 soc: fsl: Replace kernel.h with the necessary inclusions When kernel.h is used in the headers it adds a lot into dependency hell, especially when there are circular dependencies are involved. Replace kernel.h inclusion with the list of what is really being used. Signed-off-by: Andy Shevchenko Signed-off-by: Li Yang commit 6b4266b8deb857ce2dc2a9b769b242865b9a0bce Author: Li Yang Date: Mon Nov 8 18:10:18 2021 -0600 dt-bindings: fsl,layerscape-dcfg: add missing compatible for lx2160a The compatible string is already in use, fix the chip list in binding to include it. Signed-off-by: Li Yang Acked-by: Rob Herring commit efd12405f1801ef0458d908a844317fb1388c3bf Author: Li Yang Date: Mon Nov 8 18:07:51 2021 -0600 dt-bindings: qoriq-clock: add missing compatible for lx2160a The compatible string is already in use, fix the binding to include it. Signed-off-by: Li Yang Acked-by: Rob Herring commit 7b1f781f2d2460693f43d5f764198df558e3494b Author: Dmitry Torokhov Date: Tue Feb 15 13:32:26 2022 -0800 Input: psmouse - set up dependency between PS/2 and SMBus companions When we switch from emulated PS/2 to native (RMI4 or Elan) protocols, we create SMBus companion devices that are attached to I2C/SMBus controllers. However, when suspending and resuming, we also need to make sure that we take into account the PS/2 device they are associated with, so that PS/2 device is suspended after the companion and resumed before it, otherwise companions will not work properly. Before I2C devices were marked for asynchronous suspend/resume, this ordering happened naturally, but now we need to enforce it by establishing device links, with PS/2 devices being suppliers and SMBus companions being consumers. Fixes: 172d931910e1 ("i2c: enable async suspend/resume on i2c client devices") Reported-and-tested-by: Hugh Dickins Tested-by: Jarkko Nikula Link: https://lore.kernel.org/r/89456fcd-a113-4c82-4b10-a9bcaefac68f@google.com Link: https://lore.kernel.org/r/YgwQN8ynO88CPMju@google.com Signed-off-by: Dmitry Torokhov commit 5950bdc88dd1d158f2845fdff8fb1de86476806c Author: Tom Rix Date: Mon Feb 14 07:40:43 2022 -0800 ice: initialize local variable 'tlv' Clang static analysis reports this issues ice_common.c:5008:21: warning: The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage ldo->phy_type_low |= ((u64)buf << (i * 16)); ~~~~~~~~~~~~~~~~~ ^ When called from ice_cfg_phy_fec() ldo is the uninitialized local variable tlv. So initialize. Fixes: ea78ce4dab05 ("ice: add link lenient and default override support") Signed-off-by: Tom Rix Tested-by: Gurucharan G (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit ed22d9c8d128293fc7b0b086c7d3654bcb99a8dd Author: Tom Rix Date: Mon Feb 14 06:33:27 2022 -0800 ice: check the return of ice_ptp_gettimex64 Clang static analysis reports this issue time64.h:69:50: warning: The left operand of '+' is a garbage value set_normalized_timespec64(&ts_delta, lhs.tv_sec + rhs.tv_sec, ~~~~~~~~~~ ^ In ice_ptp_adjtime_nonatomic(), the timespec64 variable 'now' is set by ice_ptp_gettimex64(). This function can fail with -EBUSY, so 'now' can have a gargbage value. So check the return. Fixes: 06c16d89d2cb ("ice: register 1588 PTP clock device object for E810 devices") Signed-off-by: Tom Rix Tested-by: Gurucharan G (A Contingent worker at Intel) Signed-off-by: Tony Nguyen commit fadead80fe4c033b5e514fcbadd20b55c4494112 Author: Jacob Keller Date: Mon Feb 7 10:23:29 2022 -0800 ice: fix concurrent reset and removal of VFs Commit c503e63200c6 ("ice: Stop processing VF messages during teardown") introduced a driver state flag, ICE_VF_DEINIT_IN_PROGRESS, which is intended to prevent some issues with concurrently handling messages from VFs while tearing down the VFs. This change was motivated by crashes caused while tearing down and bringing up VFs in rapid succession. It turns out that the fix actually introduces issues with the VF driver caused because the PF no longer responds to any messages sent by the VF during its .remove routine. This results in the VF potentially removing its DMA memory before the PF has shut down the device queues. Additionally, the fix doesn't actually resolve concurrency issues within the ice driver. It is possible for a VF to initiate a reset just prior to the ice driver removing VFs. This can result in the remove task concurrently operating while the VF is being reset. This results in similar memory corruption and panics purportedly fixed by that commit. Fix this concurrency at its root by protecting both the reset and removal flows using the existing VF cfg_lock. This ensures that we cannot remove the VF while any outstanding critical tasks such as a virtchnl message or a reset are occurring. This locking change also fixes the root cause originally fixed by commit c503e63200c6 ("ice: Stop processing VF messages during teardown"), so we can simply revert it. Note that I kept these two changes together because simply reverting the original commit alone would leave the driver vulnerable to worse race conditions. Fixes: c503e63200c6 ("ice: Stop processing VF messages during teardown") Signed-off-by: Jacob Keller Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit 932645c298c41aad64ef13016ff4c2034eef5aed Author: Michal Swiatkowski Date: Mon Jan 3 07:41:21 2022 +0100 ice: fix setting l4 port flag when adding filter Accidentally filter flag for none encapsulated l4 port field is always set. Even if user wants to add encapsulated l4 port field. Remove this unnecessary flag setting. Fixes: 9e300987d4a81 ("ice: VXLAN and Geneve TC support") Signed-off-by: Michal Swiatkowski Tested-by: Sandeep Penigalapati Signed-off-by: Tony Nguyen commit b70bc066d77b460a63a8c3fb2ea0d811ce862a83 Author: Wojciech Drewek Date: Fri Dec 17 12:36:25 2021 +0100 ice: Match on all profiles in slow-path In switchdev mode, slow-path rules need to match all protocols, in order to correctly redirect unfiltered or missed packets to the uplink. To set this up for the virtual function to uplink flow, the rule that redirects packets to the control VSI must have the tunnel type set to ICE_SW_TUN_AND_NON_TUN. As a result of that new tunnel type being set, ice_get_compat_fv_bitmap will select ICE_PROF_ALL. At that point all profiles would be selected for this rule, resulting in the desired behavior. Without this change slow-path would not work with tunnel protocols. Fixes: 8b032a55c1bd ("ice: low level support for tunnels") Signed-off-by: Wojciech Drewek Tested-by: Sandeep Penigalapati Signed-off-by: Tony Nguyen commit 8292656464e5f066d46cb73da957930613a2c597 Merge: f98da1d662988 bfe55a1f7fd6b Author: Rafael J. Wysocki Date: Fri Feb 18 19:36:36 2022 +0100 Merge branch 'acpi-processor' Merge fix for a recent boot lockup regression on 32-bit ThinkPad T40. * acpi-processor: ACPI: processor: idle: fix lockup regression on 32-bit ThinkPad T40 commit 7993e65fdd0fe07beb9f36f998f9bbef2c0ee391 Merge: b9889768bda1a 36415a7964711 Author: Linus Torvalds Date: Fri Feb 18 09:33:23 2022 -0800 Merge tag 'mtd/fixes-for-5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux Pull MTD fixes from Miquel Raynal: "MTD changes: - Qcom: - Don't print error message on -EPROBE_DEFER - Fix kernel panic on skipped partition - Fix missing free for pparts in cleanup - phram: Prevent divide by zero bug in phram_setup() Raw NAND controller changes: - ingenic: Fix missing put_device in ingenic_ecc_get - qcom: Fix clock sequencing in qcom_nandc_probe() - omap2: Prevent invalid configuration and build error - gpmi: Don't leak PM reference in error path - brcmnand: Fix incorrect sub-page ECC status" * tag 'mtd/fixes-for-5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux: mtd: rawnand: brcmnand: Fixed incorrect sub-page ECC status mtd: rawnand: gpmi: don't leak PM reference in error path mtd: phram: Prevent divide by zero bug in phram_setup() mtd: rawnand: omap2: Prevent invalid configuration and build error mtd: parsers: qcom: Fix missing free for pparts in cleanup mtd: parsers: qcom: Fix kernel panic on skipped partition mtd: parsers: qcom: Don't print error message on -EPROBE_DEFER mtd: rawnand: qcom: Fix clock sequencing in qcom_nandc_probe() mtd: rawnand: ingenic: Fix missing put_device in ingenic_ecc_get commit b9889768bda1a326238990b7d75ea179321d9693 Merge: 2848551bc6590 e92bc4cd34de2 Author: Linus Torvalds Date: Fri Feb 18 09:27:10 2022 -0800 Merge tag 'block-5.17-2022-02-17' of git://git.kernel.dk/linux-block Pull block fixes from Jens Axboe: - Surprise removal fix (Christoph) - Ensure that pages are zeroed before submitted for userspace IO (Haimin) - Fix blk-wbt accounting issue with BFQ (Laibin) - Use bsize for discard granularity in loop (Ming) - Fix missing zone handling in blk_complete_request() (Pankaj) * tag 'block-5.17-2022-02-17' of git://git.kernel.dk/linux-block: block/wbt: fix negative inflight counter when remove scsi device block: fix surprise removal for drivers calling blk_set_queue_dying block-map: add __GFP_ZERO flag for alloc_page in function bio_copy_kern block: loop:use kstatfs.f_bsize of backing file to set discard granularity block: Add handling for zone append command in blk_complete_request commit 2848551bc6590a0f4eaaae71d60a4aaa0e99b8cf Merge: 45a98a71d2daa c22a8086b3840 Author: Linus Torvalds Date: Fri Feb 18 09:20:52 2022 -0800 Merge tag 'sound-5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "A collection of small patches, mostly for old and new regressions and device-specific fixes. - Regression fixes regarding ALSA core SG-buffer helpers - Regression fix for Realtek HD-audio mutex deadlock - Regression fix for USB-audio PM resume error - More coverage of ASoC core control API notification fixes - Old regression fixes for HD-audio probe mask - Fixes for ASoC Realtek codec work handling - Other device-specific quirks / fixes" * tag 'sound-5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (24 commits) ASoC: intel: skylake: Set max DMA segment size ASoC: SOF: hda: Set max DMA segment size ALSA: hda: Set max DMA segment size ALSA: hda/realtek: Fix deadlock by COEF mutex ALSA: usb-audio: Don't abort resume upon errors ALSA: hda: Fix missing codec probe on Shenker Dock 15 ALSA: hda: Fix regression on forced probe mask option ALSA: hda/realtek: Add quirk for Legion Y9000X 2019 ALSA: usb-audio: revert to IMPLICIT_FB_FIXED_DEV for M-Audio FastTrack Ultra ASoC: wm_adsp: Correct control read size when parsing compressed buffer ASoC: qcom: Actually clear DMA interrupt register for HDMI ALSA: memalloc: invalidate SG pages before sync ALSA: memalloc: Fix dma_need_sync() checks MAINTAINERS: update cros_ec_codec maintainers ASoC: rt5682: do not block workqueue if card is unbound ASoC: rt5668: do not block workqueue if card is unbound ASoC: rt5682s: do not block workqueue if card is unbound ASoC: tas2770: Insert post reset delay ASoC: Revert "ASoC: mediatek: Check for error clk pointer" ASoC: amd: acp: Set gpio_spkr_en to None for max speaker amplifer in machine driver ... commit 45a98a71d2daa8c58a99c17343a5d118b085a9be Merge: ea4b3d299fe6b 4f6de676d94ee Author: Linus Torvalds Date: Fri Feb 18 09:14:19 2022 -0800 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fix from Catalin Marinas: "Fix wrong branch label in the EL2 GICv3 initialisation code" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: Correct wrong label in macro __init_el2_gicv3 commit ea4b3d299fe6b6c9afa4a91dc2cf5479d0089eeb Merge: 7476b043b1914 fe663df782581 Author: Linus Torvalds Date: Fri Feb 18 09:10:14 2022 -0800 Merge tag 'powerpc-5.17-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fixes from Michael Ellerman: - Fix boot failure on 603 with DEBUG_PAGEALLOC and KFENCE - Fix 32-build with newer binutils that rejects 'ptesync' etc Thanks to Anders Roxell, Christophe Leroy, and Maxime Bizon. * tag 'powerpc-5.17-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/lib/sstep: fix 'ptesync' build error powerpc/603: Fix boot failure with DEBUG_PAGEALLOC and KFENCE commit 7476b043b1914413f75b7e99040969734ae1fab6 Merge: 9195e5e0adbb8 53923e0fe2098 Author: Linus Torvalds Date: Fri Feb 18 09:04:27 2022 -0800 Merge tag '5.17-rc5-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6 Pull cifs fixes from Steve French: "Six small smb3 client fixes, three for stable: - fix for snapshot mount option - two ACL related fixes - use after free race fix - fix for confusing warning message logged with older dialects" * tag '5.17-rc5-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6: cifs: fix confusing unneeded warning message on smb2.1 and earlier cifs: modefromsids must add an ACE for authenticated users cifs: fix double free race when mount fails in cifs_get_root() cifs: do not use uninitialized data in the owner/group sid cifs: fix set of group SID via NTSD xattrs smb3: fix snapshot mount option commit 98e437f134b3447e22af78e6c71837cd9b404990 Merge: f159f2941db99 1ba603f56568c Author: Arnd Bergmann Date: Fri Feb 18 17:31:55 2022 +0100 Merge tag 'scmi-fix-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into arm/fixes Arm SCMI fix for v5.17 A simple fix to remove space in the MODULE_ALIAS name used in the SCMI driver as userspace expect no spaces in these names. * tag 'scmi-fix-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: firmware: arm_scmi: Remove space in MODULE_ALIAS name Link: https://lore.kernel.org/r/20220214144245.2376150-1-sudeep.holla@arm.com Signed-off-by: Arnd Bergmann commit f159f2941db993d4356fbec5e5601c6c3fb470b3 Merge: 4f6668f05206d 31eeb6b09f405 Author: Arnd Bergmann Date: Fri Feb 18 17:30:32 2022 +0100 Merge tag 'juno-fix-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into arm/fixes Arm Juno fix for v5.17 Just a single fix to address coherency issue reported[1] by removing the GICv2m address from the DMA ranges as it loose coherency if mapped as cacheable at the SMMU due to the attribute combining rules. The GICv2m range is normally programmed for Device memory attributes. [1] https://lore.kernel.org/stable/0a1d437d-9ea0-de83-3c19-e07f560ad37c@arm.com/ * tag 'juno-fix-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: arm64: dts: juno: Remove GICv2m dma-range Link: https://lore.kernel.org/r/20220214142615.2375269-1-sudeep.holla@arm.com Signed-off-by: Arnd Bergmann commit 4f6668f05206d8b69cb0f52a635116b119dd6a27 Merge: 35f5417911753 40eb0dcf4114c Author: Arnd Bergmann Date: Fri Feb 18 17:30:00 2022 +0100 Merge tag 'optee-fix2-for-v5.17' of git://git.linaro.org/people/jens.wiklander/linux-tee into arm/fixes OP-TEE fix error return code in probe functions * tag 'optee-fix2-for-v5.17' of git://git.linaro.org/people/jens.wiklander/linux-tee: tee: optee: fix error return code in probe function Link: https://lore.kernel.org/r/20220214125931.GA1332792@jade Signed-off-by: Arnd Bergmann commit 35f5417911753c7e815a5a2fbfc7c79648ecd8b6 Merge: a8cd28553f0f7 268a491aebc25 Author: Arnd Bergmann Date: Fri Feb 18 17:28:43 2022 +0100 Merge tag 'socfpga_dts_update_for_v5.18_part2' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux into arm/fixes SoCFPGA dts updates for v5.18, part 2 - Add the "intel,socfpga-agilex-hsotg" compatible for Agilex platform * tag 'socfpga_dts_update_for_v5.18_part2' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux: arm64: dts: agilex: use the compatible "intel,socfpga-agilex-hsotg" dt-bindings: usb: dwc2: add compatible "intel,socfpga-agilex-hsotg" Link: https://lore.kernel.org/r/20220211112556.98940-2-dinguyen@kernel.org Signed-off-by: Arnd Bergmann commit c46fa8911b17e3f808679061a8af8bee219f4602 Author: Md Haris Iqbal Date: Thu Feb 17 04:09:29 2022 +0100 RDMA/rtrs-clt: Move free_permit from free_clt to rtrs_clt_close Error path of rtrs_clt_open() calls free_clt(), where free_permit is called. This is wrong since error path of rtrs_clt_open() does not need to call free_permit(). Also, moving free_permits() call to rtrs_clt_close(), makes it more aligned with the call to alloc_permit() in rtrs_clt_open(). Fixes: 6a98d71daea1 ("RDMA/rtrs: client: main functionality") Link: https://lore.kernel.org/r/20220217030929.323849-2-haris.iqbal@ionos.com Signed-off-by: Md Haris Iqbal Reviewed-by: Jack Wang Signed-off-by: Jason Gunthorpe commit 8700af2cc18c919b2a83e74e0479038fd113c15d Author: Md Haris Iqbal Date: Thu Feb 17 04:09:28 2022 +0100 RDMA/rtrs-clt: Fix possible double free in error case Callback function rtrs_clt_dev_release() for put_device() calls kfree(clt) to free memory. We shouldn't call kfree(clt) again, and we can't use the clt after kfree too. Replace device_register() with device_initialize() and device_add() so that dev_set_name can() be used appropriately. Move mutex_destroy() to the release function so it can be called in the alloc_clt err path. Fixes: eab098246625 ("RDMA/rtrs-clt: Refactor the failure cases in alloc_clt") Link: https://lore.kernel.org/r/20220217030929.323849-1-haris.iqbal@ionos.com Reported-by: Miaoqian Lin Signed-off-by: Md Haris Iqbal Reviewed-by: Jack Wang Signed-off-by: Jason Gunthorpe commit 8a3d2ee0de3828e0d01f9682d35ee53704659bd0 Author: Zhengjun Xing Date: Fri Feb 18 17:31:27 2022 +0800 perf evlist: Fix failed to use cpu list for uncore events The 'perf record' and 'perf stat' commands have supported the option '-C/--cpus' to count or collect only on the list of CPUs provided. Commit 1d3351e631fc34d7 ("perf tools: Enable on a list of CPUs for hybrid") add it to be supported for hybrid. For hybrid support, it checks the cpu list are available on hybrid PMU. But when we test only uncore events(or events not in cpu_core and cpu_atom), there is a bug: Before: # perf stat -C0 -e uncore_clock/clockticks/ sleep 1 failed to use cpu list 0 In this case, for uncore event, its pmu_name is not cpu_core or cpu_atom, so in evlist__fix_hybrid_cpus, perf_pmu__find_hybrid_pmu should return NULL,both events_nr and unmatched_count should be 0 ,then the cpu list check function evlist__fix_hybrid_cpus return -1 and the error "failed to use cpu list 0" will happen. Bypass "events_nr=0" case then the issue is fixed. After: # perf stat -C0 -e uncore_clock/clockticks/ sleep 1 Performance counter stats for 'CPU(s) 0': 195,476,873 uncore_clock/clockticks/ 1.004518677 seconds time elapsed When testing with at least one core event and uncore events, it has no issue. # perf stat -C0 -e cpu_core/cpu-cycles/,uncore_clock/clockticks/ sleep 1 Performance counter stats for 'CPU(s) 0': 5,993,774 cpu_core/cpu-cycles/ 301,025,912 uncore_clock/clockticks/ 1.003964934 seconds time elapsed Fixes: 1d3351e631fc34d7 ("perf tools: Enable on a list of CPUs for hybrid") Reviewed-by: Kan Liang Signed-off-by: Zhengjun Xing Cc: Adrian Hunter Cc: alexander.shishkin@intel.com Cc: Andi Kleen Cc: Ian Rogers Cc: Jin Yao Cc: Jiri Olsa Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20220218093127.1844241-1-zhengjun.xing@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit f268088f65af69aa6ae1fb65e696cbb6478bcc9a Author: John Garry Date: Fri Feb 18 17:33:33 2022 +0800 perf test: Skip failing sigtrap test for arm+aarch64 Skip the Sigtrap test for arm + arm64, same as was done for s390 in commit a840974e96fd ("perf test: Test 73 Sig_trap fails on s390"). For this, reuse BP_SIGNAL_IS_SUPPORTED - meaning that the arch can use BP to generate signals - instead of BP_ACCOUNT_IS_SUPPORTED, which is appropriate. As described by Will at [0], in the test we get stuck in a loop of handling the HW breakpoint exception and never making progress. GDB handles this by stepping over the faulting instruction, but with perf the kernel is expected to handle the step (which it doesn't for arm). Dmitry made an attempt to get this work, also mentioned in the same thread as [0], which was appreciated. But the best thing to do is skip the test for now. [0] https://lore.kernel.org/linux-perf-users/20220118124343.GC98966@leoy-ThinkPad-X240s/T/#m13b06c39d2a5100d340f009435df6f4d8ee57b5a Fixes: 5504f67944484495 ("perf test sigtrap: Add basic stress test for sigtrap handling") Signed-off-by: John Garry Tested-by: Leo Yan Acked-by: Marco Elver Cc: Dmitriy Vyukov Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Marco Elver Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Thomas Richter Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Cc: linux@armlinux.org.uk Link: https://lore.kernel.org/r/1645176813-202756-1-git-send-email-john.garry@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit b352c3465bb808ab700d03f5bac2f7a6f37c5350 Author: Xiaoke Wang Date: Fri Feb 18 10:19:39 2022 +0800 net: ll_temac: check the return value of devm_kmalloc() devm_kmalloc() returns a pointer to allocated memory on success, NULL on failure. While lp->indirect_lock is allocated by devm_kmalloc() without proper check. It is better to check the value of it to prevent potential wrong memory access. Fixes: f14f5c11f051 ("net: ll_temac: Support indirect_mutex share within TEMAC IP") Signed-off-by: Xiaoke Wang Signed-off-by: David S. Miller commit a1cdec57e03a1352e92fbbe7974039dda4efcec0 Author: Eric Dumazet Date: Thu Feb 17 09:05:02 2022 -0800 net-timestamp: convert sk->sk_tskey to atomic_t UDP sendmsg() can be lockless, this is causing all kinds of data races. This patch converts sk->sk_tskey to remove one of these races. BUG: KCSAN: data-race in __ip_append_data / __ip_append_data read to 0xffff8881035d4b6c of 4 bytes by task 8877 on cpu 1: __ip_append_data+0x1c1/0x1de0 net/ipv4/ip_output.c:994 ip_make_skb+0x13f/0x2d0 net/ipv4/ip_output.c:1636 udp_sendmsg+0x12bd/0x14c0 net/ipv4/udp.c:1249 inet_sendmsg+0x5f/0x80 net/ipv4/af_inet.c:819 sock_sendmsg_nosec net/socket.c:705 [inline] sock_sendmsg net/socket.c:725 [inline] ____sys_sendmsg+0x39a/0x510 net/socket.c:2413 ___sys_sendmsg net/socket.c:2467 [inline] __sys_sendmmsg+0x267/0x4c0 net/socket.c:2553 __do_sys_sendmmsg net/socket.c:2582 [inline] __se_sys_sendmmsg net/socket.c:2579 [inline] __x64_sys_sendmmsg+0x53/0x60 net/socket.c:2579 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae write to 0xffff8881035d4b6c of 4 bytes by task 8880 on cpu 0: __ip_append_data+0x1d8/0x1de0 net/ipv4/ip_output.c:994 ip_make_skb+0x13f/0x2d0 net/ipv4/ip_output.c:1636 udp_sendmsg+0x12bd/0x14c0 net/ipv4/udp.c:1249 inet_sendmsg+0x5f/0x80 net/ipv4/af_inet.c:819 sock_sendmsg_nosec net/socket.c:705 [inline] sock_sendmsg net/socket.c:725 [inline] ____sys_sendmsg+0x39a/0x510 net/socket.c:2413 ___sys_sendmsg net/socket.c:2467 [inline] __sys_sendmmsg+0x267/0x4c0 net/socket.c:2553 __do_sys_sendmmsg net/socket.c:2582 [inline] __se_sys_sendmmsg net/socket.c:2579 [inline] __x64_sys_sendmmsg+0x53/0x60 net/socket.c:2579 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae value changed: 0x0000054d -> 0x0000054e Reported by Kernel Concurrency Sanitizer on: CPU: 0 PID: 8880 Comm: syz-executor.5 Not tainted 5.17.0-rc2-syzkaller-00167-gdcb85f85fa6f-dirty #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Fixes: 09c2d251b707 ("net-timestamp: add key to disambiguate concurrent datagrams") Signed-off-by: Eric Dumazet Cc: Willem de Bruijn Reported-by: syzbot Signed-off-by: David S. Miller commit e9da0b56fe27206b49f39805f7dcda8a89379062 Author: Oliver Neukum Date: Thu Feb 17 14:10:44 2022 +0100 sr9700: sanity check for packet length A malicious device can leak heap data to user space providing bogus frame lengths. Introduce a sanity check. Signed-off-by: Oliver Neukum Reviewed-by: Grant Grundler Signed-off-by: David S. Miller commit 2f131de361f6d0eaff17db26efdb844c178432f8 Author: Paul Blakey Date: Thu Feb 17 11:30:48 2022 +0200 net/sched: act_ct: Fix flow table lookup after ct clear or switching zones Flow table lookup is skipped if packet either went through ct clear action (which set the IP_CT_UNTRACKED flag on the packet), or while switching zones and there is already a connection associated with the packet. This will result in no SW offload of the connection, and the and connection not being removed from flow table with TCP teardown (fin/rst packet). To fix the above, remove these unneccary checks in flow table lookup. Fixes: 46475bb20f4b ("net/sched: act_ct: Software offload of established flows") Signed-off-by: Paul Blakey Acked-by: Marcelo Ricardo Leitner Signed-off-by: David S. Miller commit 4224cfd7fb6523f7a9d1c8bb91bb5df1e38eb624 Author: suresh kumar Date: Thu Feb 17 07:25:18 2022 +0530 net-sysfs: add check for netdevice being present to speed_show When bringing down the netdevice or system shutdown, a panic can be triggered while accessing the sysfs path because the device is already removed. [ 755.549084] mlx5_core 0000:12:00.1: Shutdown was called [ 756.404455] mlx5_core 0000:12:00.0: Shutdown was called ... [ 757.937260] BUG: unable to handle kernel NULL pointer dereference at (null) [ 758.031397] IP: [] dma_pool_alloc+0x1ab/0x280 crash> bt ... PID: 12649 TASK: ffff8924108f2100 CPU: 1 COMMAND: "amsd" ... #9 [ffff89240e1a38b0] page_fault at ffffffff8f38c778 [exception RIP: dma_pool_alloc+0x1ab] RIP: ffffffff8ee11acb RSP: ffff89240e1a3968 RFLAGS: 00010046 RAX: 0000000000000246 RBX: ffff89243d874100 RCX: 0000000000001000 RDX: 0000000000000000 RSI: 0000000000000246 RDI: ffff89243d874090 RBP: ffff89240e1a39c0 R8: 000000000001f080 R9: ffff8905ffc03c00 R10: ffffffffc04680d4 R11: ffffffff8edde9fd R12: 00000000000080d0 R13: ffff89243d874090 R14: ffff89243d874080 R15: 0000000000000000 ORIG_RAX: ffffffffffffffff CS: 0010 SS: 0018 #10 [ffff89240e1a39c8] mlx5_alloc_cmd_msg at ffffffffc04680f3 [mlx5_core] #11 [ffff89240e1a3a18] cmd_exec at ffffffffc046ad62 [mlx5_core] #12 [ffff89240e1a3ab8] mlx5_cmd_exec at ffffffffc046b4fb [mlx5_core] #13 [ffff89240e1a3ae8] mlx5_core_access_reg at ffffffffc0475434 [mlx5_core] #14 [ffff89240e1a3b40] mlx5e_get_fec_caps at ffffffffc04a7348 [mlx5_core] #15 [ffff89240e1a3bb0] get_fec_supported_advertised at ffffffffc04992bf [mlx5_core] #16 [ffff89240e1a3c08] mlx5e_get_link_ksettings at ffffffffc049ab36 [mlx5_core] #17 [ffff89240e1a3ce8] __ethtool_get_link_ksettings at ffffffff8f25db46 #18 [ffff89240e1a3d48] speed_show at ffffffff8f277208 #19 [ffff89240e1a3dd8] dev_attr_show at ffffffff8f0b70e3 #20 [ffff89240e1a3df8] sysfs_kf_seq_show at ffffffff8eedbedf #21 [ffff89240e1a3e18] kernfs_seq_show at ffffffff8eeda596 #22 [ffff89240e1a3e28] seq_read at ffffffff8ee76d10 #23 [ffff89240e1a3e98] kernfs_fop_read at ffffffff8eedaef5 #24 [ffff89240e1a3ed8] vfs_read at ffffffff8ee4e3ff #25 [ffff89240e1a3f08] sys_read at ffffffff8ee4f27f #26 [ffff89240e1a3f50] system_call_fastpath at ffffffff8f395f92 crash> net_device.state ffff89443b0c0000 state = 0x5 (__LINK_STATE_START| __LINK_STATE_NOCARRIER) To prevent this scenario, we also make sure that the netdevice is present. Signed-off-by: suresh kumar Signed-off-by: David S. Miller commit efe4186e6a1b54bf38b9e05450d43b0da1fd7739 Author: Duoming Zhou Date: Thu Feb 17 09:43:03 2022 +0800 drivers: hamradio: 6pack: fix UAF bug caused by mod_timer() When a 6pack device is detaching, the sixpack_close() will act to cleanup necessary resources. Although del_timer_sync() in sixpack_close() won't return if there is an active timer, one could use mod_timer() in sp_xmit_on_air() to wake up timer again by calling userspace syscall such as ax25_sendmsg(), ax25_connect() and ax25_ioctl(). This unexpected waked handler, sp_xmit_on_air(), realizes nothing about the undergoing cleanup and may still call pty_write() to use driver layer resources that have already been released. One of the possible race conditions is shown below: (USE) | (FREE) ax25_sendmsg() | ax25_queue_xmit() | ... | sp_xmit() | sp_encaps() | sixpack_close() sp_xmit_on_air() | del_timer_sync(&sp->tx_t) mod_timer(&sp->tx_t,...) | ... | unregister_netdev() | ... (wait a while) | tty_release() | tty_release_struct() | release_tty() sp_xmit_on_air() | tty_kref_put(tty_struct) //FREE pty_write(tty_struct) //USE | ... The corresponding fail log is shown below: =============================================================== BUG: KASAN: use-after-free in __run_timers.part.0+0x170/0x470 Write of size 8 at addr ffff88800a652ab8 by task swapper/2/0 ... Call Trace: ... queue_work_on+0x3f/0x50 pty_write+0xcd/0xe0pty_write+0xcd/0xe0 sp_xmit_on_air+0xb2/0x1f0 call_timer_fn+0x28/0x150 __run_timers.part.0+0x3c2/0x470 run_timer_softirq+0x3b/0x80 __do_softirq+0xf1/0x380 ... This patch reorders the del_timer_sync() after the unregister_netdev() to avoid UAF bugs. Because the unregister_netdev() is well synchronized, it flushs out any pending queues, waits the refcount of net_device decreases to zero and removes net_device from kernel. There is not any running routines after executing unregister_netdev(). Therefore, we could not arouse timer from userspace again. Signed-off-by: Duoming Zhou Reviewed-by: Lin Ma Signed-off-by: David S. Miller commit a679a61520d8a7b0211a1da990404daf5cc80b72 Author: Miklos Szeredi Date: Fri Feb 18 11:47:51 2022 +0100 fuse: fix fileattr op failure The fileattr API conversion broke lsattr on ntfs3g. Previously the ioctl(... FS_IOC_GETFLAGS) returned an EINVAL error, but after the conversion the error returned by the fuse filesystem was not propagated back to the ioctl() system call, resulting in success being returned with bogus values. Fix by checking for outarg.result in fuse_priv_ioctl(), just as generic ioctl code does. Reported-by: Jean-Pierre André Fixes: 72227eac177d ("fuse: convert to fileattr") Cc: # v5.13 Signed-off-by: Miklos Szeredi commit 44cad52cc14ae10062f142ec16ede489bccf4469 Author: Andy Lutomirski Date: Mon Feb 14 13:05:49 2022 +0100 x86/ptrace: Fix xfpregs_set()'s incorrect xmm clearing xfpregs_set() handles 32-bit REGSET_XFP and 64-bit REGSET_FP. The actual code treats these regsets as modern FX state (i.e. the beginning part of XSTATE). The declarations of the regsets thought they were the legacy i387 format. The code thought they were the 32-bit (no xmm8..15) variant of XSTATE and, for good measure, made the high bits disappear by zeroing the wrong part of the buffer. The latter broke ptrace, and everything else confused anyone trying to understand the code. In particular, the nonsense definitions of the regsets confused me when I wrote this code. Clean this all up. Change the declarations to match reality (which shouldn't change the generated code, let alone the ABI) and fix xfpregs_set() to clear the correct bits and to only do so for 32-bit callers. Fixes: 6164331d15f7 ("x86/fpu: Rewrite xfpregs_set()") Reported-by: Luís Ferreira Signed-off-by: Andy Lutomirski Signed-off-by: Borislav Petkov Cc: Link: https://bugzilla.kernel.org/show_bug.cgi?id=215524 Link: https://lore.kernel.org/r/YgpFnZpF01WwR8wU@zn.tnic commit 834cea3a252ed4847db076a769ad9efe06afe2d5 Author: Rafał Miłecki Date: Tue Feb 15 08:27:35 2022 +0100 i2c: brcmstb: fix support for DSL and CM variants DSL and CM (Cable Modem) support 8 B max transfer size and have a custom DT binding for that reason. This driver was checking for a wrong "compatible" however which resulted in an incorrect setup. Fixes: e2e5a2c61837 ("i2c: brcmstb: Adding support for CM and DSL SoCs") Signed-off-by: Rafał Miłecki Acked-by: Florian Fainelli Signed-off-by: Wolfram Sang commit 1aae05754fca861ce17f1f17fddcfbf8c0fc25b6 Author: Rudi Heitbaum Date: Wed Feb 16 21:22:28 2022 +0000 drm/imx/dcss: i.MX8MQ DCSS select DRM_GEM_CMA_HELPER Without DRM_GEM_CMA_HELPER i.MX8MQ DCSS won't build. This needs to be there. Signed-off-by: Rudi Heitbaum Reviewed-by: Laurentiu Palcu Signed-off-by: Laurentiu Palcu Link: https://patchwork.freedesktop.org/patch/msgid/20220216212228.1217831-1-rudi@heitbaum.com commit ec756e40e271866f951d77c5e923d8deb6002b15 Author: Wanpeng Li Date: Fri Feb 18 00:10:38 2022 -0800 x86/kvm: Don't use pv tlb/ipi/sched_yield if on 1 vCPU Inspired by commit 3553ae5690a (x86/kvm: Don't use pvqspinlock code if only 1 vCPU), on a VM with only 1 vCPU, there is no need to enable pv tlb/ipi/sched_yield and we can save the memory for __pv_cpu_mask. Signed-off-by: Wanpeng Li Message-Id: <1645171838-2855-1-git-send-email-wanpengli@tencent.com> Signed-off-by: Paolo Bonzini commit ba1f77c546966c12d86220d078e5838dcaeab348 Author: Leonardo Bras Date: Fri Feb 18 00:41:00 2022 -0300 x86/kvm: Fix compilation warning in non-x86_64 builds On non-x86_64 builds, helpers gtod_is_based_on_tsc() and kvm_guest_supported_xfd() are defined but never used. Because these are static inline but are in a .c file, some compilers do warn for them with -Wunused-function, which becomes an error if -Werror is present. Add #ifdef so they are only defined in x86_64 builds. Reported-by: kernel test robot Signed-off-by: Leonardo Bras Message-Id: <20220218034100.115702-1-leobras@redhat.com> Signed-off-by: Paolo Bonzini commit 8840f5460a23759403f1f2860429dcbcc2f04a65 Author: Anthoine Bourgeois Date: Tue Jan 25 20:11:39 2022 +0100 ARM: dts: Use 32KiHz oscillator on devkit8000 Devkit8000 board seems to always used 32k_counter as clocksource. Restore this behavior. If clocksource is back to 32k_counter, timer12 is now the clockevent source (as before) and timer2 is not longer needed here. This commit fixes the same issue observed with commit 23885389dbbb ("ARM: dts: Fix timer regression for beagleboard revision c") when sleep is blocked until hitting keys over serial console. Fixes: aba1ad05da08 ("clocksource/drivers/timer-ti-dm: Add clockevent and clocksource support") Fixes: e428e250fde6 ("ARM: dts: Configure system timers for omap3") Signed-off-by: Anthoine Bourgeois Signed-off-by: Tony Lindgren commit 64324ef337d0caa5798fa8fa3f6bbfbd3245868a Author: Anthoine Bourgeois Date: Tue Jan 25 20:11:38 2022 +0100 ARM: dts: switch timer config to common devkit8000 devicetree This patch allow lcd43 and lcd70 flavors to benefit from timer evolution. Fixes: e428e250fde6 ("ARM: dts: Configure system timers for omap3") Signed-off-by: Anthoine Bourgeois Signed-off-by: Tony Lindgren commit 2f0754f27a230fee6e6d753f07585cee03bedfe3 Author: Siarhei Volkau Date: Sat Feb 5 20:18:49 2022 +0300 clk: jz4725b: fix mmc0 clock gating The mmc0 clock gate bit was mistakenly assigned to "i2s" clock. You can find that the same bit is assigned to "mmc0" too. It leads to mmc0 hang for a long time after any sound activity also it prevented PM_SLEEP to work properly. I guess it was introduced by copy-paste from jz4740 driver where it is really controls I2S clock gate. Fixes: 226dfa4726eb ("clk: Add Ingenic jz4725b CGU driver") Signed-off-by: Siarhei Volkau Tested-by: Siarhei Volkau Reviewed-by: Paul Cercueil Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220205171849.687805-2-lis8215@gmail.com Signed-off-by: Stephen Boyd commit 3494894afff4ad11f25d8342cc99699be496d082 Author: Konrad Dybcio Date: Fri Feb 18 00:24:08 2022 +0100 clk: qcom: gcc-msm8994: Remove NoC clocks Just like in commit 05cf3ec00d46 ("clk: qcom: gcc-msm8996: Drop (again) gcc_aggre1_pnoc_ahb_clk") adding NoC clocks turned out to be a huge mistake, as they cause a lot of issues at little benefit (basically letting Linux know about their children's frequencies), especially when mishandled or misconfigured. Adding these ones broke SDCC approx 99 out of 100 times, but that somehow went unnoticed. To prevent further issues like this one, remove them. This commit is effectively a revert of 74a33fac3aab ("clk: qcom: gcc-msm8994: Add missing NoC clocks") with ABI preservation. Fixes: 74a33fac3aab ("clk: qcom: gcc-msm8994: Add missing NoC clocks") Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20220217232408.78932-1-konrad.dybcio@somainline.org Signed-off-by: Stephen Boyd commit 9195e5e0adbb8a9a5ee9ef0f9dedf6340d827405 Merge: b3d971ec25346 6fec1ab67f8d6 Author: Linus Torvalds Date: Thu Feb 17 15:21:42 2022 -0800 Merge tag 'linux-kselftest-fixes-5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull Kselftest fixes from Shuah Khan: "Fixes to ftrace, exec, and seccomp tests build, run-time and install bugs. These bugs are in the way of running the tests" * tag 'linux-kselftest-fixes-5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: selftests/ftrace: Do not trace do_softirq because of PREEMPT_RT selftests/seccomp: Fix seccomp failure by adding missing headers selftests/exec: Add non-regular to TEST_GEN_PROGS commit 132507ed04ce0c5559be04dd378fec4f3bbc00e8 Author: Nikhil Gupta Date: Fri Jan 28 09:53:21 2022 +0530 of/fdt: move elfcorehdr reservation early for crash dump kernel elfcorehdr_addr is fixed address passed to Second kernel which may be conflicted with potential reserved memory in Second kernel,so fdt_reserve_elfcorehdr() ahead of fdt_init_reserved_mem() can relieve this situation. Signed-off-by: Nikhil Gupta Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220128042321.15228-1-nikhil.gupta@nxp.com commit b3d971ec25346d6890e9e8f05b63f758cfcef8c5 Merge: 8b97cae315caf 5666b61019470 Author: Linus Torvalds Date: Thu Feb 17 13:11:46 2022 -0800 Merge tag 'drm-fixes-2022-02-18' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Regular fixes for rc5, nothing really stands out, mostly some amdgpu and i915 fixes with mediatek, radeon and some misc fixes. cma-helper: - set VM_DONTEXPAND atomic: - error handling fix mediatek: - fix probe defer loop with external bridge amdgpu: - Stable pstate clock fixes for Dimgrey Cavefish and Beige Goby - S0ix SDMA fix - Yellow Carp GPU reset fix radeon: - Backlight fix for iMac 12,1 i915: - GVT kerneldoc cleanup. - GVT Kconfig should depend on X86 - Prevent out of range access in SWSCI display code - Fix mbus join and dbuf slice config lookup - Fix inverted priority selection in the TTM backend - Fix FBC plane end Y offset check" * tag 'drm-fixes-2022-02-18' of git://anongit.freedesktop.org/drm/drm: drm/atomic: Don't pollute crtc_state->mode_blob with error pointers drm/radeon: Fix backlight control on iMac 12,1 drm/amd/pm: correct the sequence of sending gpu reset msg drm/amdgpu: skipping SDMA hw_init and hw_fini for S0ix. drm/amd/pm: correct UMD pstate clocks for Dimgrey Cavefish and Beige Goby drm/i915/fbc: Fix the plane end Y offset check drm/i915/opregion: check port number bounds for SWSCI display power state drm/i915/ttm: tweak priority hint selection drm/i915: Fix mbus join config lookup drm/i915: Fix dbuf slice config lookup drm/cma-helper: Set VM_DONTEXPAND for mmap drm/mediatek: mtk_dsi: Avoid EPROBE_DEFER loop with external bridge drm/i915/gvt: Make DRM_I915_GVT depend on X86 drm/i915/gvt: clean up kernel-doc in gtt.c commit 7a2fb91285151e843d6f30c0689536a4747712cb Merge: 8b97cae315caf 75134f16e7dd0 Author: Jakub Kicinski Date: Thu Feb 17 12:01:54 2022 -0800 Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Alexei Starovoitov says: ==================== pull-request: bpf 2022-02-17 We've added 8 non-merge commits during the last 7 day(s) which contain a total of 8 files changed, 119 insertions(+), 15 deletions(-). The main changes are: 1) Add schedule points in map batch ops, from Eric. 2) Fix bpf_msg_push_data with len 0, from Felix. 3) Fix crash due to incorrect copy_map_value, from Kumar. 4) Fix crash due to out of bounds access into reg2btf_ids, from Kumar. 5) Fix a bpf_timer initialization issue with clang, from Yonghong. * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf: bpf: Add schedule points in batch ops bpf: Fix crash due to out of bounds access into reg2btf_ids. selftests: bpf: Check bpf_msg_push_data return value bpf: Fix a bpf_timer initialization issue bpf: Emit bpf_timer in vmlinux BTF selftests/bpf: Add test for bpf_timer overwriting crash bpf: Fix crash due to incorrect copy_map_value bpf: Do not try bpf_msg_push_data with len 0 ==================== Link: https://lore.kernel.org/r/20220217190000.37925-1-alexei.starovoitov@gmail.com Signed-off-by: Jakub Kicinski commit 5666b610194705587807a1078753eadc007b9d79 Merge: babb1fc323432 26ace8793aaef Author: Dave Airlie Date: Fri Feb 18 05:44:44 2022 +1000 Merge tag 'drm-intel-fixes-2022-02-17' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes - GVT kerneldoc cleanup. (Randy Dunlap) - GVT Kconfig should depend on X86. (Siva Mullati) - Prevent out of range access in SWSCI display code. (Jani Nikula) - Fix mbus join and dbuf slice config lookup. (Ville Syrjälä) - Fix inverted priority selection in the TTM backend. (Matthew Auld) - Fix FBC plane end Y offset check. (Ville Syrjälä) Signed-off-by: Dave Airlie From: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/Yg4lA6k8+xp8u3aB@tursulin-mobl2 commit babb1fc3234320bd17930e02bad9d1a83f5e6859 Merge: 6379bd44ddbc4 439cf34c8e0a8 Author: Dave Airlie Date: Fri Feb 18 05:39:53 2022 +1000 Merge tag 'drm-misc-fixes-2022-02-17' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes * drm/cma-helper: Set VM_DONTEXPAND * drm/atomic: Fix error handling in drm_atomic_set_mode_for_crtc() Signed-off-by: Dave Airlie From: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/Yg4mzQALMX69UmA3@linux-uq9g commit 8b97cae315cafd7debf3601f88621e2aa8956ef3 Merge: a3580ac9b7a39 a6ab75cec1e46 Author: Linus Torvalds Date: Thu Feb 17 11:33:59 2022 -0800 Merge tag 'net-5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Jakub Kicinski: "Including fixes from wireless and netfilter. Current release - regressions: - dsa: lantiq_gswip: fix use after free in gswip_remove() - smc: avoid overwriting the copies of clcsock callback functions Current release - new code bugs: - iwlwifi: - fix use-after-free when no FW is present - mei: fix the pskb_may_pull check in ipv4 - mei: retry mapping the shared area - mvm: don't feed the hardware RFKILL into iwlmei Previous releases - regressions: - ipv6: mcast: use rcu-safe version of ipv6_get_lladdr() - tipc: fix wrong publisher node address in link publications - iwlwifi: mvm: don't send SAR GEO command for 3160 devices, avoid FW assertion - bgmac: make idm and nicpm resource optional again - atl1c: fix tx timeout after link flap Previous releases - always broken: - vsock: remove vsock from connected table when connect is interrupted by a signal - ping: change destination interface checks to match raw sockets - crypto: af_alg - get rid of alg_memory_allocated to avoid confusing semantics (and null-deref) after SO_RESERVE_MEM was added - ipv6: make exclusive flowlabel checks per-netns - bonding: force carrier update when releasing slave - sched: limit TC_ACT_REPEAT loops - bridge: multicast: notify switchdev driver whenever MC processing gets disabled because of max entries reached - wifi: brcmfmac: fix crash in brcm_alt_fw_path when WLAN not found - iwlwifi: fix locking when "HW not ready" - phy: mediatek: remove PHY mode check on MT7531 - dsa: mv88e6xxx: flush switchdev FDB workqueue before removing VLAN - dsa: lan9303: - fix polarity of reset during probe - fix accelerated VLAN handling" * tag 'net-5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (65 commits) bonding: force carrier update when releasing slave nfp: flower: netdev offload check for ip6gretap ipv6: fix data-race in fib6_info_hw_flags_set / fib6_purge_rt ipv4: fix data races in fib_alias_hw_flags_set net: dsa: lan9303: add VLAN IDs to master device net: dsa: lan9303: handle hwaccel VLAN tags vsock: remove vsock from connected table when connect is interrupted by a signal Revert "net: ethernet: bgmac: Use devm_platform_ioremap_resource_byname" ping: fix the dif and sdif check in ping_lookup net: usb: cdc_mbim: avoid altsetting toggling for Telit FN990 net: sched: limit TC_ACT_REPEAT loops tipc: fix wrong notification node addresses net: dsa: lantiq_gswip: fix use after free in gswip_remove() ipv6: per-netns exclusive flowlabel checks net: bridge: multicast: notify switchdev driver whenever MC processing gets disabled CDC-NCM: avoid overflow in sanity checking mctp: fix use after free net: mscc: ocelot: fix use-after-free in ocelot_vlan_del() bonding: fix data-races around agg_select_timer dpaa2-eth: Initialize mutex used in one step timestamping path ... commit a6ab75cec1e461f8a35559054c146c21428430b8 Author: Zhang Changzhong Date: Wed Feb 16 22:18:08 2022 +0800 bonding: force carrier update when releasing slave In __bond_release_one(), bond_set_carrier() is only called when bond device has no slave. Therefore, if we remove the up slave from a master with two slaves and keep the down slave, the master will remain up. Fix this by moving bond_set_carrier() out of if (!bond_has_slaves(bond)) statement. Reproducer: $ insmod bonding.ko mode=0 miimon=100 max_bonds=2 $ ifconfig bond0 up $ ifenslave bond0 eth0 eth1 $ ifconfig eth0 down $ ifenslave -d bond0 eth1 $ cat /proc/net/bonding/bond0 Fixes: ff59c4563a8d ("[PATCH] bonding: support carrier state for master") Signed-off-by: Zhang Changzhong Acked-by: Jay Vosburgh Link: https://lore.kernel.org/r/1645021088-38370-1-git-send-email-zhangchangzhong@huawei.com Signed-off-by: Jakub Kicinski commit 75134f16e7dd0007aa474b281935c5f42e79f2c8 Author: Eric Dumazet Date: Thu Feb 17 10:19:02 2022 -0800 bpf: Add schedule points in batch ops syzbot reported various soft lockups caused by bpf batch operations. INFO: task kworker/1:1:27 blocked for more than 140 seconds. INFO: task hung in rcu_barrier Nothing prevents batch ops to process huge amount of data, we need to add schedule points in them. Note that maybe_wait_bpf_programs(map) calls from generic_map_delete_batch() can be factorized by moving the call after the loop. This will be done later in -next tree once we get this fix merged, unless there is strong opinion doing this optimization sooner. Fixes: aa2e93b8e58e ("bpf: Add generic support for update and delete batch ops") Fixes: cb4d03ab499d ("bpf: Add generic support for lookup batch op") Reported-by: syzbot Signed-off-by: Eric Dumazet Signed-off-by: Alexei Starovoitov Reviewed-by: Stanislav Fomichev Acked-by: Brian Vazquez Link: https://lore.kernel.org/bpf/20220217181902.808742-1-eric.dumazet@gmail.com commit e5733d8c89c3b57c8fcd40b8acf508388fabaa42 Author: Reinette Chatre Date: Wed Feb 2 11:41:12 2022 -0800 x86/sgx: Fix missing poison handling in reclaimer The SGX reclaimer code lacks page poison handling in its main free path. This can lead to avoidable machine checks if a poisoned page is freed and reallocated instead of being isolated. A troublesome scenario is: 1. Machine check (#MC) occurs (asynchronous, !MF_ACTION_REQUIRED) 2. arch_memory_failure() is eventually called 3. (SGX) page->poison set to 1 4. Page is reclaimed 5. Page added to normal free lists by sgx_reclaim_pages() ^ This is the bug (poison pages should be isolated on the sgx_poison_page_list instead) 6. Page is reallocated by some innocent enclave, a second (synchronous) in-kernel #MC is induced, probably during EADD instruction. ^ This is the fallout from the bug (6) is unfortunate and can be avoided by replacing the open coded enclave page freeing code in the reclaimer with sgx_free_epc_page() to obtain support for poison page handling that includes placing the poisoned page on the correct list. Fixes: d6d261bded8a ("x86/sgx: Add new sgx_epc_page flag bit to mark free pages") Fixes: 992801ae9243 ("x86/sgx: Initial poison handling for dirty and free pages") Signed-off-by: Reinette Chatre Signed-off-by: Dave Hansen Reviewed-by: Jarkko Sakkinen Link: https://lkml.kernel.org/r/dcc95eb2aaefb042527ac50d0a50738c7c160dac.1643830353.git.reinette.chatre@intel.com commit a3580ac9b7a394a7d780448ba75cc5348d8a9e04 Author: Luis Chamberlain Date: Mon Feb 14 18:08:28 2022 -0800 fs/file_table: fix adding missing kmemleak_not_leak() Commit b42bc9a3c511 ("Fix regression due to "fs: move binfmt_misc sysctl to its own file") fixed a regression, however it failed to add a kmemleak_not_leak(). Fixes: b42bc9a3c511 ("Fix regression due to "fs: move binfmt_misc sysctl to its own file") Reported-by: Tong Zhang Cc: Tong Zhang Signed-off-by: Luis Chamberlain Signed-off-by: Linus Torvalds commit 2dd3a8a139082679b7a73fc32596aa667b0841d1 Merge: edbd6c628ef19 31ded1535e318 Author: Linus Torvalds Date: Thu Feb 17 10:06:09 2022 -0800 Merge tag 'perf-tools-fixes-for-v5.17-2022-02-17' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux Pull perf tools fixes from Arnaldo Carvalho de Melo: - Fix corrupt inject files when only last branch option is enabled with ARM CoreSight ETM - Fix use-after-free for realloc(..., 0) in libsubcmd, found by gcc 12 - Defer freeing string after possible strlen() on it in the BPF loader, found by gcc 12 - Avoid early exit in 'perf trace' due SIGCHLD from non-workload processes - Fix arm64 perf_event_attr 'perf test's wrt --call-graph initialization - Fix libperf 32-bit build for 'perf test' wrt uint64_t printf - Fix perf_cpu_map__for_each_cpu macro in libperf, providing access to the CPU iterator - Sync linux/perf_event.h UAPI with the kernel sources - Update Jiri Olsa's email address in MAINTAINERS * tag 'perf-tools-fixes-for-v5.17-2022-02-17' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: perf bpf: Defer freeing string after possible strlen() on it perf test: Fix arm64 perf_event_attr tests wrt --call-graph initialization libsubcmd: Fix use-after-free for realloc(..., 0) libperf: Fix perf_cpu_map__for_each_cpu macro perf cs-etm: Fix corrupt inject files when only last branch option is enabled perf cs-etm: No-op refactor of synth opt usage libperf: Fix 32-bit build for tests uint64_t printf tools headers UAPI: Sync linux/perf_event.h with the kernel sources perf trace: Avoid early exit due SIGCHLD from non-workload processes MAINTAINERS: Update Jiri's email address commit edbd6c628ef194ebef6e7b82ec9e396f57695d06 Merge: 80d47f5de5e31 a8e8f851e8299 Author: Linus Torvalds Date: Thu Feb 17 09:54:00 2022 -0800 Merge tag 'modules-5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux Pull module fix from Luis Chamberlain: "Fixes module decompression when CONFIG_SYSFS=n The only fix trickled down for v5.17-rc cycle so far is the fix for module decompression when CONFIG_SYSFS=n. This was reported through 0-day" * tag 'modules-5.17-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux: module: fix building with sysfs disabled commit 7dbcda584eaa5bdb4a281c379207dacc1a5e6081 Author: Danie du Toit Date: Thu Feb 17 14:48:20 2022 +0200 nfp: flower: netdev offload check for ip6gretap IPv6 GRE tunnels are not being offloaded, this is caused by a missing netdev offload check. The functionality of IPv6 GRE tunnel offloading was previously added but this check was not included. Adding the ip6gretap check allows IPv6 GRE tunnels to be offloaded correctly. Fixes: f7536ffb0986 ("nfp: flower: Allow ipv6gretap interface for offloading") Signed-off-by: Danie du Toit Signed-off-by: Louis Peens Signed-off-by: Simon Horman Link: https://lore.kernel.org/r/20220217124820.40436-1-louis.peens@corigine.com Signed-off-by: Jakub Kicinski commit d95d6320ba7a51d61c097ffc3bcafcf70283414e Author: Eric Dumazet Date: Wed Feb 16 09:32:17 2022 -0800 ipv6: fix data-race in fib6_info_hw_flags_set / fib6_purge_rt Because fib6_info_hw_flags_set() is called without any synchronization, all accesses to gi6->offload, fi->trap and fi->offload_failed need some basic protection like READ_ONCE()/WRITE_ONCE(). BUG: KCSAN: data-race in fib6_info_hw_flags_set / fib6_purge_rt read to 0xffff8881087d5886 of 1 bytes by task 13953 on cpu 0: fib6_drop_pcpu_from net/ipv6/ip6_fib.c:1007 [inline] fib6_purge_rt+0x4f/0x580 net/ipv6/ip6_fib.c:1033 fib6_del_route net/ipv6/ip6_fib.c:1983 [inline] fib6_del+0x696/0x890 net/ipv6/ip6_fib.c:2028 __ip6_del_rt net/ipv6/route.c:3876 [inline] ip6_del_rt+0x83/0x140 net/ipv6/route.c:3891 __ipv6_dev_ac_dec+0x2b5/0x370 net/ipv6/anycast.c:374 ipv6_dev_ac_dec net/ipv6/anycast.c:387 [inline] __ipv6_sock_ac_close+0x141/0x200 net/ipv6/anycast.c:207 ipv6_sock_ac_close+0x79/0x90 net/ipv6/anycast.c:220 inet6_release+0x32/0x50 net/ipv6/af_inet6.c:476 __sock_release net/socket.c:650 [inline] sock_close+0x6c/0x150 net/socket.c:1318 __fput+0x295/0x520 fs/file_table.c:280 ____fput+0x11/0x20 fs/file_table.c:313 task_work_run+0x8e/0x110 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:175 [inline] exit_to_user_mode_prepare+0x160/0x190 kernel/entry/common.c:207 __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline] syscall_exit_to_user_mode+0x20/0x40 kernel/entry/common.c:300 do_syscall_64+0x50/0xd0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae write to 0xffff8881087d5886 of 1 bytes by task 1912 on cpu 1: fib6_info_hw_flags_set+0x155/0x3b0 net/ipv6/route.c:6230 nsim_fib6_rt_hw_flags_set drivers/net/netdevsim/fib.c:668 [inline] nsim_fib6_rt_add drivers/net/netdevsim/fib.c:691 [inline] nsim_fib6_rt_insert drivers/net/netdevsim/fib.c:756 [inline] nsim_fib6_event drivers/net/netdevsim/fib.c:853 [inline] nsim_fib_event drivers/net/netdevsim/fib.c:886 [inline] nsim_fib_event_work+0x284f/0x2cf0 drivers/net/netdevsim/fib.c:1477 process_one_work+0x3f6/0x960 kernel/workqueue.c:2307 worker_thread+0x616/0xa70 kernel/workqueue.c:2454 kthread+0x2c7/0x2e0 kernel/kthread.c:327 ret_from_fork+0x1f/0x30 value changed: 0x22 -> 0x2a Reported by Kernel Concurrency Sanitizer on: CPU: 1 PID: 1912 Comm: kworker/1:3 Not tainted 5.16.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: events nsim_fib_event_work Fixes: 0c5fcf9e249e ("IPv6: Add "offload failed" indication to routes") Fixes: bb3c4ab93e44 ("ipv6: Add "offload" and "trap" indications to routes") Signed-off-by: Eric Dumazet Cc: Amit Cohen Cc: Ido Schimmel Reported-by: syzbot Link: https://lore.kernel.org/r/20220216173217.3792411-2-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit 9fcf986cc4bc6a3a39f23fbcbbc3a9e52d3c24fd Author: Eric Dumazet Date: Wed Feb 16 09:32:16 2022 -0800 ipv4: fix data races in fib_alias_hw_flags_set fib_alias_hw_flags_set() can be used by concurrent threads, and is only RCU protected. We need to annotate accesses to following fields of struct fib_alias: offload, trap, offload_failed Because of READ_ONCE()WRITE_ONCE() limitations, make these field u8. BUG: KCSAN: data-race in fib_alias_hw_flags_set / fib_alias_hw_flags_set read to 0xffff888134224a6a of 1 bytes by task 2013 on cpu 1: fib_alias_hw_flags_set+0x28a/0x470 net/ipv4/fib_trie.c:1050 nsim_fib4_rt_hw_flags_set drivers/net/netdevsim/fib.c:350 [inline] nsim_fib4_rt_add drivers/net/netdevsim/fib.c:367 [inline] nsim_fib4_rt_insert drivers/net/netdevsim/fib.c:429 [inline] nsim_fib4_event drivers/net/netdevsim/fib.c:461 [inline] nsim_fib_event drivers/net/netdevsim/fib.c:881 [inline] nsim_fib_event_work+0x1852/0x2cf0 drivers/net/netdevsim/fib.c:1477 process_one_work+0x3f6/0x960 kernel/workqueue.c:2307 process_scheduled_works kernel/workqueue.c:2370 [inline] worker_thread+0x7df/0xa70 kernel/workqueue.c:2456 kthread+0x1bf/0x1e0 kernel/kthread.c:377 ret_from_fork+0x1f/0x30 write to 0xffff888134224a6a of 1 bytes by task 4872 on cpu 0: fib_alias_hw_flags_set+0x2d5/0x470 net/ipv4/fib_trie.c:1054 nsim_fib4_rt_hw_flags_set drivers/net/netdevsim/fib.c:350 [inline] nsim_fib4_rt_add drivers/net/netdevsim/fib.c:367 [inline] nsim_fib4_rt_insert drivers/net/netdevsim/fib.c:429 [inline] nsim_fib4_event drivers/net/netdevsim/fib.c:461 [inline] nsim_fib_event drivers/net/netdevsim/fib.c:881 [inline] nsim_fib_event_work+0x1852/0x2cf0 drivers/net/netdevsim/fib.c:1477 process_one_work+0x3f6/0x960 kernel/workqueue.c:2307 process_scheduled_works kernel/workqueue.c:2370 [inline] worker_thread+0x7df/0xa70 kernel/workqueue.c:2456 kthread+0x1bf/0x1e0 kernel/kthread.c:377 ret_from_fork+0x1f/0x30 value changed: 0x00 -> 0x02 Reported by Kernel Concurrency Sanitizer on: CPU: 0 PID: 4872 Comm: kworker/0:0 Not tainted 5.17.0-rc3-syzkaller-00188-g1d41d2e82623-dirty #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: events nsim_fib_event_work Fixes: 90b93f1b31f8 ("ipv4: Add "offload" and "trap" indications to routes") Signed-off-by: Eric Dumazet Reported-by: syzbot Reviewed-by: Ido Schimmel Link: https://lore.kernel.org/r/20220216173217.3792411-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit 430065e2671905ac675f97b7af240cc255964e93 Author: Mans Rullgard Date: Wed Feb 16 20:48:18 2022 +0000 net: dsa: lan9303: add VLAN IDs to master device If the master device does VLAN filtering, the IDs used by the switch must be added for any frames to be received. Do this in the port_enable() function, and remove them in port_disable(). Fixes: a1292595e006 ("net: dsa: add new DSA switch driver for the SMSC-LAN9303") Signed-off-by: Mans Rullgard Reviewed-by: Florian Fainelli Reviewed-by: Vladimir Oltean Link: https://lore.kernel.org/r/20220216204818.28746-1-mans@mansr.com Signed-off-by: Jakub Kicinski commit 017b355bbdc6620fd8fe05fe297f553ce9d855ee Author: Mans Rullgard Date: Wed Feb 16 12:46:34 2022 +0000 net: dsa: lan9303: handle hwaccel VLAN tags Check for a hwaccel VLAN tag on rx and use it if present. Otherwise, use __skb_vlan_pop() like the other tag parsers do. This fixes the case where the VLAN tag has already been consumed by the master. Fixes: a1292595e006 ("net: dsa: add new DSA switch driver for the SMSC-LAN9303") Signed-off-by: Mans Rullgard Reviewed-by: Vladimir Oltean Link: https://lore.kernel.org/r/20220216124634.23123-1-mans@mansr.com Signed-off-by: Jakub Kicinski commit 80d47f5de5e311cbc0d01ebb6ee684e8f4c196c6 Author: Linus Torvalds Date: Thu Feb 17 08:57:47 2022 -0800 mm: don't try to NUMA-migrate COW pages that have other uses Oded Gabbay reports that enabling NUMA balancing causes corruption with his Gaudi accelerator test load: "All the details are in the bug, but the bottom line is that somehow, this patch causes corruption when the numa balancing feature is enabled AND we don't use process affinity AND we use GUP to pin pages so our accelerator can DMA to/from system memory. Either disabling numa balancing, using process affinity to bind to specific numa-node or reverting this patch causes the bug to disappear" and Oded bisected the issue to commit 09854ba94c6a ("mm: do_wp_page() simplification"). Now, the NUMA balancing shouldn't actually be changing the writability of a page, and as such shouldn't matter for COW. But it appears it does. Suspicious. However, regardless of that, the condition for enabling NUMA faults in change_pte_range() is nonsensical. It uses "page_mapcount(page)" to decide if a COW page should be NUMA-protected or not, and that makes absolutely no sense. The number of mappings a page has is irrelevant: not only does GUP get a reference to a page as in Oded's case, but the other mappings migth be paged out and the only reference to them would be in the page count. Since we should never try to NUMA-balance a page that we can't move anyway due to other references, just fix the code to use 'page_count()'. Oded confirms that that fixes his issue. Now, this does imply that something in NUMA balancing ends up changing page protections (other than the obvious one of making the page inaccessible to get the NUMA faulting information). Otherwise the COW simplification wouldn't matter - since doing the GUP on the page would make sure it's writable. The cause of that permission change would be good to figure out too, since it clearly results in spurious COW events - but fixing the nonsensical test that just happened to work before is obviously the CorrectThing(tm) to do regardless. Fixes: 09854ba94c6a ("mm: do_wp_page() simplification") Link: https://bugzilla.kernel.org/show_bug.cgi?id=215616 Link: https://lore.kernel.org/all/CAFCwf10eNmwq2wD71xjUhqkvv5+_pJMR1nPug2RqNDcFT4H86Q@mail.gmail.com/ Reported-and-tested-by: Oded Gabbay Cc: David Hildenbrand Cc: Peter Xu Signed-off-by: Linus Torvalds commit b9208492fcaecff8f43915529ae34b3bcb03877c Author: Seth Forshee Date: Thu Feb 17 08:13:12 2022 -0600 vsock: remove vsock from connected table when connect is interrupted by a signal vsock_connect() expects that the socket could already be in the TCP_ESTABLISHED state when the connecting task wakes up with a signal pending. If this happens the socket will be in the connected table, and it is not removed when the socket state is reset. In this situation it's common for the process to retry connect(), and if the connection is successful the socket will be added to the connected table a second time, corrupting the list. Prevent this by calling vsock_remove_connected() if a signal is received while waiting for a connection. This is harmless if the socket is not in the connected table, and if it is in the table then removing it will prevent list corruption from a double add. Note for backporting: this patch requires d5afa82c977e ("vsock: correct removal of socket from the list"), which is in all current stable trees except 4.9.y. Fixes: d021c344051a ("VSOCK: Introduce VM Sockets") Signed-off-by: Seth Forshee Reviewed-by: Stefano Garzarella Link: https://lore.kernel.org/r/20220217141312.2297547-1-sforshee@digitalocean.com Signed-off-by: Jakub Kicinski commit 6aba04ee3263669b335458c4cf4c7d97d6940229 Author: Jonas Gorski Date: Wed Feb 16 10:46:34 2022 -0800 Revert "net: ethernet: bgmac: Use devm_platform_ioremap_resource_byname" This reverts commit 3710e80952cf2dc48257ac9f145b117b5f74e0a5. Since idm_base and nicpm_base are still optional resources not present on all platforms, this breaks the driver for everything except Northstar 2 (which has both). The same change was already reverted once with 755f5738ff98 ("net: broadcom: fix a mistake about ioremap resource"). So let's do it again. Fixes: 3710e80952cf ("net: ethernet: bgmac: Use devm_platform_ioremap_resource_byname") Signed-off-by: Jonas Gorski [florian: Added comments to explain the resources are optional] Signed-off-by: Florian Fainelli Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220216184634.2032460-1-f.fainelli@gmail.com Signed-off-by: Jakub Kicinski commit 6764eb690e77ecded48587d6d4e346ba2e196546 Author: Maxime Ripard Date: Thu Feb 3 11:20:03 2022 +0100 drm/vc4: crtc: Fix runtime_pm reference counting At boot on the BCM2711, if the HDMI controllers are running, the CRTC driver will disable itself and its associated HDMI controller to work around a hardware bug that would leave some pixels stuck in a FIFO. In order to avoid that issue, we need to run some operations in lockstep between the CRTC and HDMI controller, and we need to make sure the HDMI controller will be powered properly. However, since we haven't enabled it through KMS, the runtime_pm state is off at this point so we need to make sure the device is powered through pm_runtime_resume_and_get, and once the operations are complete, we call pm_runtime_put. However, the HDMI controller will do that itself in its post_crtc_powerdown, which means we'll end up calling pm_runtime_put for a single pm_runtime_get, throwing the reference counting off. Let's remove the pm_runtime_put call in the CRTC code in order to have the proper counting. Fixes: bca10db67bda ("drm/vc4: crtc: Make sure the HDMI controller is powered when disabling") Signed-off-by: Maxime Ripard Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220203102003.1114673-1-maxime@cerno.tech commit e40945ab7c7f966d0c37b7bd7b0596497dfe228d Author: Maxime Ripard Date: Thu Jan 27 12:14:52 2022 +0100 drm/vc4: hdmi: Unregister codec device on unbind On bind we will register the HDMI codec device but we don't unregister it on unbind, leading to a device leakage. Unregister our device at unbind. Signed-off-by: Maxime Ripard Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20220127111452.222002-1-maxime@cerno.tech commit 32f57cb1b2c8d6f20aefec7052b1bfeb7e3b69d4 Author: Mike Marciniszyn Date: Thu Feb 17 08:59:32 2022 -0500 IB/qib: Fix duplicate sysfs directory name The qib driver load has been failing with the following message: sysfs: cannot create duplicate filename '/devices/pci0000:80/0000:80:02.0/0000:81:00.0/infiniband/qib0/ports/1/linkcontrol' The patch below has two "linkcontrol" names causing the duplication. Fix by using the correct "diag_counters" name on the second instance. Fixes: 4a7aaf88c89f ("RDMA/qib: Use attributes for the port sysfs") Link: https://lore.kernel.org/r/1645106372-23004-1-git-send-email-mike.marciniszyn@cornelisnetworks.com Cc: Reviewed-by: Dennis Dalessandro Signed-off-by: Mike Marciniszyn Signed-off-by: Jason Gunthorpe commit 80808768e41324d2e23de89972b5406c1020e6e4 Author: Jon Lin Date: Wed Feb 16 09:40:24 2022 +0800 spi: rockchip: terminate dma transmission when slave abort After slave abort, all DMA should be stopped, or it will affect the next transmission and maybe abort again. Signed-off-by: Jon Lin Link: https://lore.kernel.org/r/20220216014028.8123-3-jon.lin@rock-chips.com Signed-off-by: Mark Brown commit 9382df0a98aad5bbcd4d634790305a1d786ad224 Author: Jon Lin Date: Wed Feb 16 09:40:23 2022 +0800 spi: rockchip: Fix error in getting num-cs property Get num-cs u32 from dts of_node property rather than u16. Signed-off-by: Jon Lin Link: https://lore.kernel.org/r/20220216014028.8123-2-jon.lin@rock-chips.com Signed-off-by: Mark Brown commit d04ad245d67a3991dfea5e108e4c452c2ab39bac Author: Prasad Kumpatla Date: Thu Feb 17 14:20:07 2022 +0530 regmap-irq: Update interrupt clear register for proper reset With the existing logic where clear_ack is true (HW doesn’t support auto clear for ICR), interrupt clear register reset is not handled properly. Due to this only the first interrupts get processed properly and further interrupts are blocked due to not resetting interrupt clear register. Example for issue case where Invert_ack is false and clear_ack is true: Say Default ISR=0x00 & ICR=0x00 and ISR is triggered with 2 interrupts making ISR = 0x11. Step 1: Say ISR is set 0x11 (store status_buff = ISR). ISR needs to be cleared with the help of ICR once the Interrupt is processed. Step 2: Write ICR = 0x11 (status_buff), this will clear the ISR to 0x00. Step 3: Issue - In the existing code, ICR is written with ICR = ~(status_buff) i.e ICR = 0xEE -> This will block all the interrupts from raising except for interrupts 0 and 4. So expectation here is to reset ICR, which will unblock all the interrupts. if (chip->clear_ack) { if (chip->ack_invert && !ret) ........ else if (!ret) ret = regmap_write(map, reg, ~data->status_buf[i]); So writing 0 and 0xff (when ack_invert is true) should have no effect, other than clearing the ACKs just set. Fixes: 3a6f0fb7b8eb ("regmap: irq: Add support to clear ack registers") Signed-off-by: Prasad Kumpatla Reviewed-by: Charles Keepax Tested-by: Marek Szyprowski Link: https://lore.kernel.org/r/20220217085007.30218-1-quic_pkumpatl@quicinc.com Signed-off-by: Mark Brown commit 0cbae9e24fa7d6c6e9f828562f084da82217a0c5 Author: Eric W. Biederman Date: Wed Feb 9 18:09:41 2022 -0600 ucounts: Handle wrapping in is_ucounts_overlimit While examining is_ucounts_overlimit and reading the various messages I realized that is_ucounts_overlimit fails to deal with counts that may have wrapped. Being wrapped should be a transitory state for counts and they should never be wrapped for long, but it can happen so handle it. Cc: stable@vger.kernel.org Fixes: 21d1c5e386bc ("Reimplement RLIMIT_NPROC on top of ucounts") Link: https://lkml.kernel.org/r/20220216155832.680775-5-ebiederm@xmission.com Reviewed-by: Shuah Khan Signed-off-by: "Eric W. Biederman" commit c923a8e7edb010da67424077cbf1a6f1396ebd2e Author: Eric W. Biederman Date: Mon Feb 14 09:40:25 2022 -0600 ucounts: Move RLIMIT_NPROC handling after set_user During set*id() which cred->ucounts to charge the the current process to is not known until after set_cred_ucounts. So move the RLIMIT_NPROC checking into a new helper flag_nproc_exceeded and call flag_nproc_exceeded after set_cred_ucounts. This is very much an arbitrary subset of the places where we currently change the RLIMIT_NPROC accounting, designed to preserve the existing logic. Fixing the existing logic will be the subject of another series of changes. Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20220216155832.680775-4-ebiederm@xmission.com Fixes: 21d1c5e386bc ("Reimplement RLIMIT_NPROC on top of ucounts") Signed-off-by: "Eric W. Biederman" commit a55d07294f1e9b576093bdfa95422f8119941e83 Author: Eric W. Biederman Date: Wed Feb 9 16:22:20 2022 -0600 ucounts: Base set_cred_ucounts changes on the real user Michal Koutný wrote: > Tasks are associated to multiple users at once. Historically and as per > setrlimit(2) RLIMIT_NPROC is enforce based on real user ID. > > The commit 21d1c5e386bc ("Reimplement RLIMIT_NPROC on top of ucounts") > made the accounting structure "indexed" by euid and hence potentially > account tasks differently. > > The effective user ID may be different e.g. for setuid programs but > those are exec'd into already existing task (i.e. below limit), so > different accounting is moot. > > Some special setresuid(2) users may notice the difference, justifying > this fix. I looked at cred->ucount and it is only used for rlimit operations that were previously stored in cred->user. Making the fact cred->ucount can refer to a different user from cred->user a bug, affecting all uses of cred->ulimit not just RLIMIT_NPROC. Fix set_cred_ucounts to always use the real uid not the effective uid. Further simplify set_cred_ucounts by noticing that set_cred_ucounts somehow retained a draft version of the check to see if alloc_ucounts was needed that checks the new->user and new->user_ns against the current_real_cred(). Remove that draft version of the check. All that matters for setting the cred->ucounts are the user_ns and uid fields in the cred. Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20220207121800.5079-4-mkoutny@suse.com Link: https://lkml.kernel.org/r/20220216155832.680775-3-ebiederm@xmission.com Reported-by: Michal Koutný Reviewed-by: Michal Koutný Fixes: 21d1c5e386bc ("Reimplement RLIMIT_NPROC on top of ucounts") Signed-off-by: "Eric W. Biederman" commit 8f2f9c4d82f24f172ae439e5035fc1e0e4c229dd Author: Eric W. Biederman Date: Wed Feb 9 20:03:19 2022 -0600 ucounts: Enforce RLIMIT_NPROC not RLIMIT_NPROC+1 Michal Koutný wrote: > It was reported that v5.14 behaves differently when enforcing > RLIMIT_NPROC limit, namely, it allows one more task than previously. > This is consequence of the commit 21d1c5e386bc ("Reimplement > RLIMIT_NPROC on top of ucounts") that missed the sharpness of > equality in the forking path. This can be fixed either by fixing the test or by moving the increment to be before the test. Fix it my moving copy_creds which contains the increment before is_ucounts_overlimit. In the case of CLONE_NEWUSER the ucounts in the task_cred changes. The function is_ucounts_overlimit needs to use the final version of the ucounts for the new process. Which means moving the is_ucounts_overlimit test after copy_creds is necessary. Both the test in fork and the test in set_user were semantically changed when the code moved to ucounts. The change of the test in fork was bad because it was before the increment. The test in set_user was wrong and the change to ucounts fixed it. So this fix only restores the old behavior in one lcation not two. Link: https://lkml.kernel.org/r/20220204181144.24462-1-mkoutny@suse.com Link: https://lkml.kernel.org/r/20220216155832.680775-2-ebiederm@xmission.com Cc: stable@vger.kernel.org Reported-by: Michal Koutný Reviewed-by: Michal Koutný Fixes: 21d1c5e386bc ("Reimplement RLIMIT_NPROC on top of ucounts") Signed-off-by: "Eric W. Biederman" commit 32fde84362c40961726a5c91f35ad37355ccc0c6 Author: Fabrice Gasnier Date: Wed Feb 16 09:12:15 2022 +0100 usb: dwc2: drd: fix soft connect when gadget is unconfigured When the gadget driver hasn't been (yet) configured, and the cable is connected to a HOST, the SFTDISCON gets cleared unconditionally, so the HOST tries to enumerate it. At the host side, this can result in a stuck USB port or worse. When getting lucky, some dmesg can be observed at the host side: new high-speed USB device number ... device descriptor read/64, error -110 Fix it in drd, by checking the enabled flag before calling dwc2_hsotg_core_connect(). It will be called later, once configured, by the normal flow: - udc_bind_to_driver - usb_gadget_connect - dwc2_hsotg_pullup - dwc2_hsotg_core_connect Fixes: 17f934024e84 ("usb: dwc2: override PHY input signals with usb role switch support") Cc: stable Signed-off-by: Fabrice Gasnier Link: https://lore.kernel.org/r/1644999135-13478-1-git-send-email-fabrice.gasnier@foss.st.com Signed-off-by: Greg Kroah-Hartman commit 62e3f0afe246720f7646eb1b034a6897dac34405 Author: Hans de Goede Date: Sun Feb 13 14:05:17 2022 +0100 usb: dwc3: pci: Fix Bay Trail phy GPIO mappings When the Bay Trail phy GPIO mappings where added cs and reset were swapped, this did not cause any issues sofar, because sofar they were always driven high/low at the same time. Note the new mapping has been verified both in /sys/kernel/debug/gpio output on Android factory images on multiple devices, as well as in the schematics for some devices. Fixes: 5741022cbdf3 ("usb: dwc3: pci: Add GPIO lookup table on platforms without ACPI GPIO resources") Cc: stable Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220213130524.18748-3-hdegoede@redhat.com Signed-off-by: Greg Kroah-Hartman commit c16bdeb5a39ffa3f32b32f812831a2092d2a3061 Author: Eric W. Biederman Date: Fri Feb 11 13:57:44 2022 -0600 rlimit: Fix RLIMIT_NPROC enforcement failure caused by capability calls in set_user Solar Designer wrote: > I'm not aware of anyone actually running into this issue and reporting > it. The systems that I personally know use suexec along with rlimits > still run older/distro kernels, so would not yet be affected. > > So my mention was based on my understanding of how suexec works, and > code review. Specifically, Apache httpd has the setting RLimitNPROC, > which makes it set RLIMIT_NPROC: > > https://httpd.apache.org/docs/2.4/mod/core.html#rlimitnproc > > The above documentation for it includes: > > "This applies to processes forked from Apache httpd children servicing > requests, not the Apache httpd children themselves. This includes CGI > scripts and SSI exec commands, but not any processes forked from the > Apache httpd parent, such as piped logs." > > In code, there are: > > ./modules/generators/mod_cgid.c: ( (cgid_req.limits.limit_nproc_set) && ((rc = apr_procattr_limit_set(procattr, APR_LIMIT_NPROC, > ./modules/generators/mod_cgi.c: ((rc = apr_procattr_limit_set(procattr, APR_LIMIT_NPROC, > ./modules/filters/mod_ext_filter.c: rv = apr_procattr_limit_set(procattr, APR_LIMIT_NPROC, conf->limit_nproc); > > For example, in mod_cgi.c this is in run_cgi_child(). > > I think this means an httpd child sets RLIMIT_NPROC shortly before it > execs suexec, which is a SUID root program. suexec then switches to the > target user and execs the CGI script. > > Before 2863643fb8b9, the setuid() in suexec would set the flag, and the > target user's process count would be checked against RLIMIT_NPROC on > execve(). After 2863643fb8b9, the setuid() in suexec wouldn't set the > flag because setuid() is (naturally) called when the process is still > running as root (thus, has those limits bypass capabilities), and > accordingly execve() would not check the target user's process count > against RLIMIT_NPROC. In commit 2863643fb8b9 ("set_user: add capability check when rlimit(RLIMIT_NPROC) exceeds") capable calls were added to set_user to make it more consistent with fork. Unfortunately because of call site differences those capable calls were checking the credentials of the user before set*id() instead of after set*id(). This breaks enforcement of RLIMIT_NPROC for applications that set the rlimit and then call set*id() while holding a full set of capabilities. The capabilities are only changed in the new credential in security_task_fix_setuid(). The code in apache suexec appears to follow this pattern. Commit 909cc4ae86f3 ("[PATCH] Fix two bugs with process limits (RLIMIT_NPROC)") where this check was added describes the targes of this capability check as: 2/ When a root-owned process (e.g. cgiwrap) sets up process limits and then calls setuid, the setuid should fail if the user would then be running more than rlim_cur[RLIMIT_NPROC] processes, but it doesn't. This patch adds an appropriate test. With this patch, and per-user process limit imposed in cgiwrap really works. So the original use case of this check also appears to match the broken pattern. Restore the enforcement of RLIMIT_NPROC by removing the bad capable checks added in set_user. This unfortunately restores the inconsistent state the code has been in for the last 11 years, but dealing with the inconsistencies looks like a larger problem. Cc: stable@vger.kernel.org Link: https://lore.kernel.org/all/20210907213042.GA22626@openwall.com/ Link: https://lkml.kernel.org/r/20220212221412.GA29214@openwall.com Link: https://lkml.kernel.org/r/20220216155832.680775-1-ebiederm@xmission.com Fixes: 2863643fb8b9 ("set_user: add capability check when rlimit(RLIMIT_NPROC) exceeds") History-Tree: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git Reviewed-by: Solar Designer Signed-off-by: "Eric W. Biederman" commit 988896bb61827345c6d074dd5f2af1b7b008193f Author: Leonardo Bras Date: Thu Feb 17 02:30:30 2022 -0300 x86/kvm/fpu: Remove kvm_vcpu_arch.guest_supported_xcr0 kvm_vcpu_arch currently contains the guest supported features in both guest_supported_xcr0 and guest_fpu.fpstate->user_xfeatures field. Currently both fields are set to the same value in kvm_vcpu_after_set_cpuid() and are not changed anywhere else after that. Since it's not good to keep duplicated data, remove guest_supported_xcr0. To keep the code more readable, introduce kvm_guest_supported_xcr() and kvm_guest_supported_xfd() to replace the previous usages of guest_supported_xcr0. Signed-off-by: Leonardo Bras Message-Id: <20220217053028.96432-3-leobras@redhat.com> Signed-off-by: Paolo Bonzini commit ad856280ddea3401e1f5060ef20e6de9f6122c76 Author: Leonardo Bras Date: Thu Feb 17 02:30:29 2022 -0300 x86/kvm/fpu: Limit guest user_xfeatures to supported bits of XCR0 During host/guest switch (like in kvm_arch_vcpu_ioctl_run()), the kernel swaps the fpu between host/guest contexts, by using fpu_swap_kvm_fpstate(). When xsave feature is available, the fpu swap is done by: - xsave(s) instruction, with guest's fpstate->xfeatures as mask, is used to store the current state of the fpu registers to a buffer. - xrstor(s) instruction, with (fpu_kernel_cfg.max_features & XFEATURE_MASK_FPSTATE) as mask, is used to put the buffer into fpu regs. For xsave(s) the mask is used to limit what parts of the fpu regs will be copied to the buffer. Likewise on xrstor(s), the mask is used to limit what parts of the fpu regs will be changed. The mask for xsave(s), the guest's fpstate->xfeatures, is defined on kvm_arch_vcpu_create(), which (in summary) sets it to all features supported by the cpu which are enabled on kernel config. This means that xsave(s) will save to guest buffer all the fpu regs contents the cpu has enabled when the guest is paused, even if they are not used. This would not be an issue, if xrstor(s) would also do that. xrstor(s)'s mask for host/guest swap is basically every valid feature contained in kernel config, except XFEATURE_MASK_PKRU. Accordingto kernel src, it is instead switched in switch_to() and flush_thread(). Then, the following happens with a host supporting PKRU starts a guest that does not support it: 1 - Host has XFEATURE_MASK_PKRU set. 1st switch to guest, 2 - xsave(s) fpu regs to host fpustate (buffer has XFEATURE_MASK_PKRU) 3 - xrstor(s) guest fpustate to fpu regs (fpu regs have XFEATURE_MASK_PKRU) 4 - guest runs, then switch back to host, 5 - xsave(s) fpu regs to guest fpstate (buffer now have XFEATURE_MASK_PKRU) 6 - xrstor(s) host fpstate to fpu regs. 7 - kvm_vcpu_ioctl_x86_get_xsave() copy guest fpstate to userspace (with XFEATURE_MASK_PKRU, which should not be supported by guest vcpu) On 5, even though the guest does not support PKRU, it does have the flag set on guest fpstate, which is transferred to userspace via vcpu ioctl KVM_GET_XSAVE. This becomes a problem when the user decides on migrating the above guest to another machine that does not support PKRU: the new host restores guest's fpu regs to as they were before (xrstor(s)), but since the new host don't support PKRU, a general-protection exception ocurs in xrstor(s) and that crashes the guest. This can be solved by making the guest's fpstate->user_xfeatures hold a copy of guest_supported_xcr0. This way, on 7 the only flags copied to userspace will be the ones compatible to guest requirements, and thus there will be no issue during migration. As a bonus, it will also fail if userspace tries to set fpu features (with the KVM_SET_XSAVE ioctl) that are not compatible to the guest configuration. Such features will never be returned by KVM_GET_XSAVE or KVM_GET_XSAVE2. Also, since kvm_vcpu_after_set_cpuid() now sets fpstate->user_xfeatures, there is not need to set it in kvm_check_cpuid(). So, change fpstate_realloc() so it does not touch fpstate->user_xfeatures if a non-NULL guest_fpu is passed, which is the case when kvm_check_cpuid() calls it. Signed-off-by: Leonardo Bras Message-Id: <20220217053028.96432-2-leobras@redhat.com> Signed-off-by: Paolo Bonzini commit aba2081e0a9c977396124aa6df93b55ed5912b19 Author: Jens Axboe Date: Tue Feb 15 11:22:04 2022 -0700 tps6598x: clear int mask on probe failure The interrupt mask is enabled before any potential failure points in the driver, which can leave a failure path where we exit with interrupts enabled but the device not live. This causes an infinite stream of interrupts on an Apple M1 Pro laptop on USB-C. Add a failure label that's used post enabling interrupts, where we mask them again before returning an error. Suggested-by: Sven Peter Cc: stable Reviewed-by: Heikki Krogerus Signed-off-by: Jens Axboe Link: https://lore.kernel.org/r/e6b80669-20f3-06e7-9ed5-8951a9c6db6f@kernel.dk Signed-off-by: Greg Kroah-Hartman commit 35a79e64de29e8d57a5989aac57611c0cd29e13e Author: Xin Long Date: Wed Feb 16 00:20:52 2022 -0500 ping: fix the dif and sdif check in ping_lookup When 'ping' changes to use PING socket instead of RAW socket by: # sysctl -w net.ipv4.ping_group_range="0 100" There is another regression caused when matching sk_bound_dev_if and dif, RAW socket is using inet_iif() while PING socket lookup is using skb->dev->ifindex, the cmd below fails due to this: # ip link add dummy0 type dummy # ip link set dummy0 up # ip addr add 192.168.111.1/24 dev dummy0 # ping -I dummy0 192.168.111.1 -c1 The issue was also reported on: https://github.com/iputils/iputils/issues/104 But fixed in iputils in a wrong way by not binding to device when destination IP is on device, and it will cause some of kselftests to fail, as Jianlin noticed. This patch is to use inet(6)_iif and inet(6)_sdif to get dif and sdif for PING socket, and keep consistent with RAW socket. Fixes: c319b4d76b9e ("net: ipv4: add IPPROTO_ICMP socket kind") Reported-by: Jianlin Shi Signed-off-by: Xin Long Signed-off-by: David S. Miller commit e92bc4cd34de2ce454bdea8cd198b8067ee4e123 Author: Laibin Qiu Date: Sat Jan 22 19:10:45 2022 +0800 block/wbt: fix negative inflight counter when remove scsi device Now that we disable wbt by set WBT_STATE_OFF_DEFAULT in wbt_disable_default() when switch elevator to bfq. And when we remove scsi device, wbt will be enabled by wbt_enable_default. If it become false positive between wbt_wait() and wbt_track() when submit write request. The following is the scenario that triggered the problem. T1 T2 T3 elevator_switch_mq bfq_init_queue wbt_disable_default <= Set rwb->enable_state (OFF) Submit_bio blk_mq_make_request rq_qos_throttle <= rwb->enable_state (OFF) scsi_remove_device sd_remove del_gendisk blk_unregister_queue elv_unregister_queue wbt_enable_default <= Set rwb->enable_state (ON) q_qos_track <= rwb->enable_state (ON) ^^^^^^ this request will mark WBT_TRACKED without inflight add and will lead to drop rqw->inflight to -1 in wbt_done() which will trigger IO hung. Fix this by move wbt_enable_default() from elv_unregister to bfq_exit_queue(). Only re-enable wbt when bfq exit. Fixes: 76a8040817b4b ("blk-wbt: make sure throttle is enabled properly") Remove oneline stale comment, and kill one oneshot local variable. Signed-off-by: Ming Lei Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/linux-block/20211214133103.551813-1-qiulaibin@huawei.com/ Signed-off-by: Laibin Qiu Signed-off-by: Jens Axboe commit 7a5428dcb7902700b830e912feee4e845df7c019 Author: Christoph Hellwig Date: Thu Feb 17 08:52:31 2022 +0100 block: fix surprise removal for drivers calling blk_set_queue_dying Various block drivers call blk_set_queue_dying to mark a disk as dead due to surprise removal events, but since commit 8e141f9eb803 that doesn't work given that the GD_DEAD flag needs to be set to stop I/O. Replace the driver calls to blk_set_queue_dying with a new (and properly documented) blk_mark_disk_dead API, and fold blk_set_queue_dying into the only remaining caller. Fixes: 8e141f9eb803 ("block: drain file system I/O on del_gendisk") Reported-by: Markus Blöchl Signed-off-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Link: https://lore.kernel.org/r/20220217075231.1140-1-hch@lst.de Signed-off-by: Jens Axboe commit cc8f7fe1f5eab010191aa4570f27641876fa1267 Author: Haimin Zhang Date: Wed Feb 16 16:40:38 2022 +0800 block-map: add __GFP_ZERO flag for alloc_page in function bio_copy_kern Add __GFP_ZERO flag for alloc_page in function bio_copy_kern to initialize the buffer of a bio. Signed-off-by: Haimin Zhang Reviewed-by: Chaitanya Kulkarni Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220216084038.15635-1-tcs.kernel@gmail.com Signed-off-by: Jens Axboe commit 3a55f729240a686aa8af00af436306c0cd532522 Author: Anton Romanov Date: Wed Feb 16 18:26:54 2022 +0000 kvm: x86: Disable KVM_HC_CLOCK_PAIRING if tsc is in always catchup mode If vcpu has tsc_always_catchup set each request updates pvclock data. KVM_HC_CLOCK_PAIRING consumers such as ptp_kvm_x86 rely on tsc read on host's side and do hypercall inside pvclock_read_retry loop leading to infinite loop in such situation. v3: Removed warn Changed return code to KVM_EFAULT v2: Added warn Signed-off-by: Anton Romanov Message-Id: <20220216182653.506850-1-romanton@google.com> Signed-off-by: Paolo Bonzini commit 4cb9a998b1ce25fad74a82f5a5c45a4ef40de337 Author: Wanpeng Li Date: Tue Feb 15 02:15:42 2022 -0800 KVM: Fix lockdep false negative during host resume I saw the below splatting after the host suspended and resumed. WARNING: CPU: 0 PID: 2943 at kvm/arch/x86/kvm/../../../virt/kvm/kvm_main.c:5531 kvm_resume+0x2c/0x30 [kvm] CPU: 0 PID: 2943 Comm: step_after_susp Tainted: G W IOE 5.17.0-rc3+ #4 RIP: 0010:kvm_resume+0x2c/0x30 [kvm] Call Trace: syscore_resume+0x90/0x340 suspend_devices_and_enter+0xaee/0xe90 pm_suspend.cold+0x36b/0x3c2 state_store+0x82/0xf0 kernfs_fop_write_iter+0x1b6/0x260 new_sync_write+0x258/0x370 vfs_write+0x33f/0x510 ksys_write+0xc9/0x160 do_syscall_64+0x3b/0xc0 entry_SYSCALL_64_after_hwframe+0x44/0xae lockdep_is_held() can return -1 when lockdep is disabled which triggers this warning. Let's use lockdep_assert_not_held() which can detect incorrect calls while holding a lock and it also avoids false negatives when lockdep is disabled. Signed-off-by: Wanpeng Li Message-Id: <1644920142-81249-1-git-send-email-wanpengli@tencent.com> Signed-off-by: Paolo Bonzini commit 127770ac0d043435375ab86434f31a93efa88215 Author: Aaron Lewis Date: Mon Feb 14 21:29:51 2022 +0000 KVM: x86: Add KVM_CAP_ENABLE_CAP to x86 Follow the precedent set by other architectures that support the VCPU ioctl, KVM_ENABLE_CAP, and advertise the VM extension, KVM_CAP_ENABLE_CAP. This way, userspace can ensure that KVM_ENABLE_CAP is available on a vcpu before using it. Fixes: 5c919412fe61 ("kvm/x86: Hyper-V synthetic interrupt controller") Signed-off-by: Aaron Lewis Message-Id: <20220214212950.1776943-1-aaronlewis@google.com> Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini commit 21e8a96377e6b6debae42164605bf9dcbe5720c5 Author: Daniele Palmas Date: Tue Feb 15 12:13:35 2022 +0100 net: usb: cdc_mbim: avoid altsetting toggling for Telit FN990 Add quirk CDC_MBIM_FLAG_AVOID_ALTSETTING_TOGGLE for Telit FN990 0x1071 composition in order to avoid bind error. Signed-off-by: Daniele Palmas Signed-off-by: David S. Miller commit a867e9d0cc15039a6ef72e17e2603303dcd1783f Author: Oliver Upton Date: Thu Feb 17 10:12:42 2022 +0000 KVM: arm64: Don't miss pending interrupts for suspended vCPU In order to properly emulate the WFI instruction, KVM reads back ICH_VMCR_EL2 and enables doorbells for GICv4. These preparations are necessary in order to recognize pending interrupts in kvm_arch_vcpu_runnable() and return to the guest. Until recently, this work was done by kvm_arch_vcpu_{blocking,unblocking}(). Since commit 6109c5a6ab7f ("KVM: arm64: Move vGIC v4 handling for WFI out arch callback hook"), these callbacks were gutted and superseded by kvm_vcpu_wfi(). It is important to note that KVM implements PSCI CPU_SUSPEND calls as a WFI within the guest. However, the implementation calls directly into kvm_vcpu_halt(), which skips the needed work done in kvm_vcpu_wfi() to detect pending interrupts. Fix the issue by calling the WFI helper. Fixes: 6109c5a6ab7f ("KVM: arm64: Move vGIC v4 handling for WFI out arch callback hook") Signed-off-by: Oliver Upton Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220217101242.3013716-1-oupton@google.com commit ac89895213d8950dba6ab342863a0959f73142a7 Author: Jiri Kosina Date: Thu Feb 17 14:13:49 2022 +0100 HID: elo: Revert USB reference counting Commit 817b8b9c539 ("HID: elo: fix memory leak in elo_probe") introduced memory leak on error path, but more importantly the whole USB reference counting is not needed at all in the first place, as the driver itself doesn't change the reference counting in any way, and the associated usb_device is guaranteed to be kept around by USB core as long as the driver binding exists. Reported-by: Alan Stern Reported-by: Dan Carpenter Fixes: fbf42729d0e ("HID: elo: update the reference count of the usb device structure") Fixes: 817b8b9c539 ("HID: elo: fix memory leak in elo_probe") Signed-off-by: Jiri Kosina commit 31ded1535e3182778a1d0e5c32711f55da3bc512 Author: Arnaldo Carvalho de Melo Date: Wed Feb 16 16:01:00 2022 -0300 perf bpf: Defer freeing string after possible strlen() on it This was detected by the gcc in Fedora Rawhide's gcc: 50 11.01 fedora:rawhide : FAIL gcc version 12.0.1 20220205 (Red Hat 12.0.1-0) (GCC) inlined from 'bpf__config_obj' at util/bpf-loader.c:1242:9: util/bpf-loader.c:1225:34: error: pointer 'map_opt' may be used after 'free' [-Werror=use-after-free] 1225 | *key_scan_pos += strlen(map_opt); | ^~~~~~~~~~~~~~~ util/bpf-loader.c:1223:9: note: call to 'free' here 1223 | free(map_name); | ^~~~~~~~~~~~~~ cc1: all warnings being treated as errors So do the calculations on the pointer before freeing it. Fixes: 04f9bf2bac72480c ("perf bpf-loader: Add missing '*' for key_scan_pos") Cc: Adrian Hunter Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang ShaoBo Link: https://lore.kernel.org/lkml/Yg1VtQxKrPpS3uNA@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 6379bd44ddbc45cf5c7c46f74ad00de4ed72e7ce Merge: fb9c96714f10d 364438fd629f7 Author: Dave Airlie Date: Thu Feb 17 19:06:07 2022 +1000 Merge tag 'amd-drm-fixes-5.17-2022-02-16' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-fixes-5.17-2022-02-16: amdgpu: - Stable pstate clock fixes for Dimgrey Cavefish and Beige Goby - S0ix SDMA fix - Yellow Carp GPU reset fix radeon: - Backlight fix for iMac 12,1 Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220217035242.8084-1-alexander.deucher@amd.com commit c22a8086b384025ab97ce07465420a219697d3f2 Author: Takashi Iwai Date: Tue Feb 15 14:27:56 2022 +0100 ASoC: intel: skylake: Set max DMA segment size The recent code refactoring to use the standard DMA helper requires the max DMA segment size setup for SG list management. Without it, the kernel may spew warnings when a large buffer is allocated. This patch sets up dma_set_max_seg_size() for avoiding spurious warnings. Fixes: 2c95b92ecd92 ("ALSA: memalloc: Unify x86 SG-buffer handling (take#3)") Acked-by: Cezary Rojewski Acked-by: Mark Brown Cc: BugLink: https://github.com/thesofproject/linux/issues/3430 Link: https://lore.kernel.org/r/20220215132756.31236-4-tiwai@suse.de Signed-off-by: Takashi Iwai commit 8872fc0d04592925b74ad9ab1b5686f4e016befe Author: Takashi Iwai Date: Tue Feb 15 14:27:55 2022 +0100 ASoC: SOF: hda: Set max DMA segment size The recent code refactoring to use the standard DMA helper requires the max DMA segment size setup for SG list management. Without it, the kernel may spew warnings when a large buffer is allocated. This patch sets up dma_set_max_seg_size() for avoiding spurious warnings. Fixes: 2c95b92ecd92 ("ALSA: memalloc: Unify x86 SG-buffer handling (take#3)") Acked-by: Mark Brown Cc: BugLink: https://github.com/thesofproject/linux/issues/3430 Link: https://lore.kernel.org/r/20220215132756.31236-3-tiwai@suse.de Signed-off-by: Takashi Iwai commit acd289e04a0a1f52bea7ff1129b365626059e3c2 Author: Takashi Iwai Date: Tue Feb 15 14:27:54 2022 +0100 ALSA: hda: Set max DMA segment size The recent code refactoring to use the standard DMA helper requires the max DMA segment size setup for SG list management. Without it, the kernel may spew warnings when a large buffer is allocated. This patch sets up dma_set_max_seg_size() for avoiding spurious warnings. Fixes: 2c95b92ecd92 ("ALSA: memalloc: Unify x86 SG-buffer handling (take#3)") Cc: BugLink: https://github.com/thesofproject/linux/issues/3430 Link: https://lore.kernel.org/r/20220215132756.31236-2-tiwai@suse.de Signed-off-by: Takashi Iwai commit 16693c1b2d98cebc8dedf03b49d1053cf1826c86 Author: Jon Hunter Date: Wed Feb 16 09:17:43 2022 +0000 drm/tegra: Fix cast to restricted __le32 Sparse warns about the following cast in the function falcon_copy_firmware_image() ... drivers/gpu/drm/tegra/falcon.c:66:27: warning: cast to restricted __le32 Fix this by casting the firmware data array to __le32 instead of u32. Signed-off-by: Jon Hunter Signed-off-by: Thierry Reding commit fb9c96714f10d99b8125d6f9dfbd36b0005cf5c3 Merge: 754e0b0e35608 647474b8d9802 Author: Dave Airlie Date: Thu Feb 17 15:00:47 2022 +1000 Merge tag 'mediatek-drm-fixes-5.17' of https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux into drm-fixes Mediatek DRM Fixes for Linux 5.17 1. Avoid EPROBE_DEFER loop with external bridge Signed-off-by: Dave Airlie From: Chun-Kuang Hu Link: https://patchwork.freedesktop.org/patch/msgid/1645027727-19554-1-git-send-email-chunkuang.hu@kernel.org commit 5740d068909676d4bdb5c9c00c37a83df7728909 Author: Eric Dumazet Date: Tue Feb 15 15:53:05 2022 -0800 net: sched: limit TC_ACT_REPEAT loops We have been living dangerously, at the mercy of malicious users, abusing TC_ACT_REPEAT, as shown by this syzpot report [1]. Add an arbitrary limit (32) to the number of times an action can return TC_ACT_REPEAT. v2: switch the limit to 32 instead of 10. Use net_warn_ratelimited() instead of pr_err_once(). [1] (C repro available on demand) rcu: INFO: rcu_preempt self-detected stall on CPU rcu: 1-...!: (10500 ticks this GP) idle=021/1/0x4000000000000000 softirq=5592/5592 fqs=0 (t=10502 jiffies g=5305 q=190) rcu: rcu_preempt kthread timer wakeup didn't happen for 10502 jiffies! g5305 f0x0 RCU_GP_WAIT_FQS(5) ->state=0x402 rcu: Possible timer handling issue on cpu=0 timer-softirq=3527 rcu: rcu_preempt kthread starved for 10505 jiffies! g5305 f0x0 RCU_GP_WAIT_FQS(5) ->state=0x402 ->cpu=0 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:I stack:29344 pid: 14 ppid: 2 flags:0x00004000 Call Trace: context_switch kernel/sched/core.c:4986 [inline] __schedule+0xab2/0x4db0 kernel/sched/core.c:6295 schedule+0xd2/0x260 kernel/sched/core.c:6368 schedule_timeout+0x14a/0x2a0 kernel/time/timer.c:1881 rcu_gp_fqs_loop+0x186/0x810 kernel/rcu/tree.c:1963 rcu_gp_kthread+0x1de/0x320 kernel/rcu/tree.c:2136 kthread+0x2e9/0x3a0 kernel/kthread.c:377 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 1 to CPUs 0: NMI backtrace for cpu 0 CPU: 0 PID: 3646 Comm: syz-executor358 Not tainted 5.17.0-rc3-syzkaller-00149-gbf8e59fd315f #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:rep_nop arch/x86/include/asm/vdso/processor.h:13 [inline] RIP: 0010:cpu_relax arch/x86/include/asm/vdso/processor.h:18 [inline] RIP: 0010:pv_wait_head_or_lock kernel/locking/qspinlock_paravirt.h:437 [inline] RIP: 0010:__pv_queued_spin_lock_slowpath+0x3b8/0xb40 kernel/locking/qspinlock.c:508 Code: 48 89 eb c6 45 01 01 41 bc 00 80 00 00 48 c1 e9 03 83 e3 07 41 be 01 00 00 00 48 b8 00 00 00 00 00 fc ff df 4c 8d 2c 01 eb 0c 90 41 83 ec 01 0f 84 72 04 00 00 41 0f b6 45 00 38 d8 7f 08 84 RSP: 0018:ffffc9000283f1b0 EFLAGS: 00000206 RAX: 0000000000000003 RBX: 0000000000000000 RCX: 1ffff1100fc0071e RDX: 0000000000000001 RSI: 0000000000000201 RDI: 0000000000000000 RBP: ffff88807e0038f0 R08: 0000000000000001 R09: ffffffff8ffbf9ff R10: 0000000000000001 R11: 0000000000000001 R12: 0000000000004c1e R13: ffffed100fc0071e R14: 0000000000000001 R15: ffff8880b9c3aa80 FS: 00005555562bf300(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ffdbfef12b8 CR3: 00000000723c2000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt.h:591 [inline] queued_spin_lock_slowpath arch/x86/include/asm/qspinlock.h:51 [inline] queued_spin_lock include/asm-generic/qspinlock.h:85 [inline] do_raw_spin_lock+0x200/0x2b0 kernel/locking/spinlock_debug.c:115 spin_lock_bh include/linux/spinlock.h:354 [inline] sch_tree_lock include/net/sch_generic.h:610 [inline] sch_tree_lock include/net/sch_generic.h:605 [inline] prio_tune+0x3b9/0xb50 net/sched/sch_prio.c:211 prio_init+0x5c/0x80 net/sched/sch_prio.c:244 qdisc_create.constprop.0+0x44a/0x10f0 net/sched/sch_api.c:1253 tc_modify_qdisc+0x4c5/0x1980 net/sched/sch_api.c:1660 rtnetlink_rcv_msg+0x413/0xb80 net/core/rtnetlink.c:5594 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2494 netlink_unicast_kernel net/netlink/af_netlink.c:1317 [inline] netlink_unicast+0x539/0x7e0 net/netlink/af_netlink.c:1343 netlink_sendmsg+0x904/0xe00 net/netlink/af_netlink.c:1919 sock_sendmsg_nosec net/socket.c:705 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:725 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2413 ___sys_sendmsg+0xf3/0x170 net/socket.c:2467 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2496 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:0x7f7ee98aae99 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:00007ffdbfef12d8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007ffdbfef1300 RCX: 00007f7ee98aae99 RDX: 0000000000000000 RSI: 0000000020000000 RDI: 0000000000000003 RBP: 0000000000000000 R08: 000000000000000d R09: 000000000000000d R10: 000000000000000d R11: 0000000000000246 R12: 00007ffdbfef12f0 R13: 00000000000f4240 R14: 000000000004ca47 R15: 00007ffdbfef12e4 INFO: NMI handler (nmi_cpu_backtrace_handler) took too long to run: 2.293 msecs NMI backtrace for cpu 1 CPU: 1 PID: 3260 Comm: kworker/1:3 Not tainted 5.17.0-rc3-syzkaller-00149-gbf8e59fd315f #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: mld mld_ifc_work Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 nmi_cpu_backtrace.cold+0x47/0x144 lib/nmi_backtrace.c:111 nmi_trigger_cpumask_backtrace+0x1b3/0x230 lib/nmi_backtrace.c:62 trigger_single_cpu_backtrace include/linux/nmi.h:164 [inline] rcu_dump_cpu_stacks+0x25e/0x3f0 kernel/rcu/tree_stall.h:343 print_cpu_stall kernel/rcu/tree_stall.h:604 [inline] check_cpu_stall kernel/rcu/tree_stall.h:688 [inline] rcu_pending kernel/rcu/tree.c:3919 [inline] rcu_sched_clock_irq.cold+0x5c/0x759 kernel/rcu/tree.c:2617 update_process_times+0x16d/0x200 kernel/time/timer.c:1785 tick_sched_handle+0x9b/0x180 kernel/time/tick-sched.c:226 tick_sched_timer+0x1b0/0x2d0 kernel/time/tick-sched.c:1428 __run_hrtimer kernel/time/hrtimer.c:1685 [inline] __hrtimer_run_queues+0x1c0/0xe50 kernel/time/hrtimer.c:1749 hrtimer_interrupt+0x31c/0x790 kernel/time/hrtimer.c:1811 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1086 [inline] __sysvec_apic_timer_interrupt+0x146/0x530 arch/x86/kernel/apic/apic.c:1103 sysvec_apic_timer_interrupt+0x8e/0xc0 arch/x86/kernel/apic/apic.c:1097 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:638 RIP: 0010:__sanitizer_cov_trace_const_cmp4+0xc/0x70 kernel/kcov.c:286 Code: 00 00 00 48 89 7c 30 e8 48 89 4c 30 f0 4c 89 54 d8 20 48 89 10 5b c3 0f 1f 80 00 00 00 00 41 89 f8 bf 03 00 00 00 4c 8b 14 24 <89> f1 65 48 8b 34 25 00 70 02 00 e8 14 f9 ff ff 84 c0 74 4b 48 8b RSP: 0018:ffffc90002c5eea8 EFLAGS: 00000246 RAX: 0000000000000007 RBX: ffff88801c625800 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000003 RBP: ffff8880137d3100 R08: 0000000000000000 R09: 0000000000000000 R10: ffffffff874fcd88 R11: 0000000000000000 R12: ffff88801d692dc0 R13: ffff8880137d3104 R14: 0000000000000000 R15: ffff88801d692de8 tcf_police_act+0x358/0x11d0 net/sched/act_police.c:256 tcf_action_exec net/sched/act_api.c:1049 [inline] tcf_action_exec+0x1a6/0x530 net/sched/act_api.c:1026 tcf_exts_exec include/net/pkt_cls.h:326 [inline] route4_classify+0xef0/0x1400 net/sched/cls_route.c:179 __tcf_classify net/sched/cls_api.c:1549 [inline] tcf_classify+0x3e8/0x9d0 net/sched/cls_api.c:1615 prio_classify net/sched/sch_prio.c:42 [inline] prio_enqueue+0x3a7/0x790 net/sched/sch_prio.c:75 dev_qdisc_enqueue+0x40/0x300 net/core/dev.c:3668 __dev_xmit_skb net/core/dev.c:3756 [inline] __dev_queue_xmit+0x1f61/0x3660 net/core/dev.c:4081 neigh_hh_output include/net/neighbour.h:533 [inline] neigh_output include/net/neighbour.h:547 [inline] ip_finish_output2+0x14dc/0x2170 net/ipv4/ip_output.c:228 __ip_finish_output net/ipv4/ip_output.c:306 [inline] __ip_finish_output+0x396/0x650 net/ipv4/ip_output.c:288 ip_finish_output+0x32/0x200 net/ipv4/ip_output.c:316 NF_HOOK_COND include/linux/netfilter.h:296 [inline] ip_output+0x196/0x310 net/ipv4/ip_output.c:430 dst_output include/net/dst.h:451 [inline] ip_local_out+0xaf/0x1a0 net/ipv4/ip_output.c:126 iptunnel_xmit+0x628/0xa50 net/ipv4/ip_tunnel_core.c:82 geneve_xmit_skb drivers/net/geneve.c:966 [inline] geneve_xmit+0x10c8/0x3530 drivers/net/geneve.c:1077 __netdev_start_xmit include/linux/netdevice.h:4683 [inline] netdev_start_xmit include/linux/netdevice.h:4697 [inline] xmit_one net/core/dev.c:3473 [inline] dev_hard_start_xmit+0x1eb/0x920 net/core/dev.c:3489 __dev_queue_xmit+0x2985/0x3660 net/core/dev.c:4116 neigh_hh_output include/net/neighbour.h:533 [inline] neigh_output include/net/neighbour.h:547 [inline] ip6_finish_output2+0xf7a/0x14f0 net/ipv6/ip6_output.c:126 __ip6_finish_output net/ipv6/ip6_output.c:191 [inline] __ip6_finish_output+0x61e/0xe90 net/ipv6/ip6_output.c:170 ip6_finish_output+0x32/0x200 net/ipv6/ip6_output.c:201 NF_HOOK_COND include/linux/netfilter.h:296 [inline] ip6_output+0x1e4/0x530 net/ipv6/ip6_output.c:224 dst_output include/net/dst.h:451 [inline] NF_HOOK include/linux/netfilter.h:307 [inline] NF_HOOK include/linux/netfilter.h:301 [inline] mld_sendpack+0x9a3/0xe40 net/ipv6/mcast.c:1826 mld_send_cr net/ipv6/mcast.c:2127 [inline] mld_ifc_work+0x71c/0xdc0 net/ipv6/mcast.c:2659 process_one_work+0x9ac/0x1650 kernel/workqueue.c:2307 worker_thread+0x657/0x1110 kernel/workqueue.c:2454 kthread+0x2e9/0x3a0 kernel/kthread.c:377 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 ---------------- Code disassembly (best guess): 0: 48 89 eb mov %rbp,%rbx 3: c6 45 01 01 movb $0x1,0x1(%rbp) 7: 41 bc 00 80 00 00 mov $0x8000,%r12d d: 48 c1 e9 03 shr $0x3,%rcx 11: 83 e3 07 and $0x7,%ebx 14: 41 be 01 00 00 00 mov $0x1,%r14d 1a: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax 21: fc ff df 24: 4c 8d 2c 01 lea (%rcx,%rax,1),%r13 28: eb 0c jmp 0x36 * 2a: f3 90 pause <-- trapping instruction 2c: 41 83 ec 01 sub $0x1,%r12d 30: 0f 84 72 04 00 00 je 0x4a8 36: 41 0f b6 45 00 movzbl 0x0(%r13),%eax 3b: 38 d8 cmp %bl,%al 3d: 7f 08 jg 0x47 3f: 84 .byte 0x84 Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Eric Dumazet Acked-by: Jamal Hadi Salim Cc: Cong Wang Cc: Jiri Pirko Reported-by: syzbot Link: https://lore.kernel.org/r/20220215235305.3272331-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit c08e58438d4a709fb451b6d7d33432cc9907a2a8 Author: Jon Maloy Date: Tue Feb 15 21:00:09 2022 -0500 tipc: fix wrong notification node addresses The previous bug fix had an unfortunate side effect that broke distribution of binding table entries between nodes. The updated tipc_sock_addr struct is also used further down in the same function, and there the old value is still the correct one. Fixes: 032062f363b4 ("tipc: fix wrong publisher node address in link publications") Signed-off-by: Jon Maloy Link: https://lore.kernel.org/r/20220216020009.3404578-1-jmaloy@redhat.com Signed-off-by: Jakub Kicinski commit 8c6ae46150a453f8ae9a6cd49b45f354f478587d Author: Alexey Khoroshilov Date: Tue Feb 15 13:42:48 2022 +0300 net: dsa: lantiq_gswip: fix use after free in gswip_remove() of_node_put(priv->ds->slave_mii_bus->dev.of_node) should be done before mdiobus_free(priv->ds->slave_mii_bus). Signed-off-by: Alexey Khoroshilov Fixes: 0d120dfb5d67 ("net: dsa: lantiq_gswip: don't use devres for mdiobus") Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/1644921768-26477-1-git-send-email-khoroshilov@ispras.ru Signed-off-by: Jakub Kicinski commit 0b0dff5b3b98c5c7ce848151df9da0b3cdf0cc8b Author: Willem de Bruijn Date: Tue Feb 15 11:00:37 2022 -0500 ipv6: per-netns exclusive flowlabel checks Ipv6 flowlabels historically require a reservation before use. Optionally in exclusive mode (e.g., user-private). Commit 59c820b2317f ("ipv6: elide flowlabel check if no exclusive leases exist") introduced a fastpath that avoids this check when no exclusive leases exist in the system, and thus any flowlabel use will be granted. That allows skipping the control operation to reserve a flowlabel entirely. Though with a warning if the fast path fails: This is an optimization. Robust applications still have to revert to requesting leases if the fast path fails due to an exclusive lease. Still, this is subtle. Better isolate network namespaces from each other. Flowlabels are per-netns. Also record per-netns whether exclusive leases are in use. Then behavior does not change based on activity in other netns. Changes v2 - wrap in IS_ENABLED(CONFIG_IPV6) to avoid breakage if disabled Fixes: 59c820b2317f ("ipv6: elide flowlabel check if no exclusive leases exist") Link: https://lore.kernel.org/netdev/MWHPR2201MB1072BCCCFCE779E4094837ACD0329@MWHPR2201MB1072.namprd22.prod.outlook.com/ Reported-by: Congyu Liu Signed-off-by: Willem de Bruijn Tested-by: Congyu Liu Link: https://lore.kernel.org/r/20220215160037.1976072-1-willemdebruijn.kernel@gmail.com Signed-off-by: Jakub Kicinski commit c832962ac972082b3a1f89775c9d4274c8cb5670 Author: Oleksandr Mazur Date: Tue Feb 15 18:53:03 2022 +0200 net: bridge: multicast: notify switchdev driver whenever MC processing gets disabled Whenever bridge driver hits the max capacity of MDBs, it disables the MC processing (by setting corresponding bridge option), but never notifies switchdev about such change (the notifiers are called only upon explicit setting of this option, through the registered netlink interface). This could lead to situation when Software MDB processing gets disabled, but this event never gets offloaded to the underlying Hardware. Fix this by adding a notify message in such case. Fixes: 147c1e9b902c ("switchdev: bridge: Offload multicast disabled") Signed-off-by: Oleksandr Mazur Acked-by: Nikolay Aleksandrov Link: https://lore.kernel.org/r/20220215165303.31908-1-oleksandr.mazur@plvision.eu Signed-off-by: Jakub Kicinski commit 53923e0fe2098f90f339510aeaa0e1413ae99a16 Author: Steve French Date: Wed Feb 16 13:23:53 2022 -0600 cifs: fix confusing unneeded warning message on smb2.1 and earlier When mounting with SMB2.1 or earlier, even with nomultichannel, we log the confusing warning message: "CIFS: VFS: multichannel is not supported on this protocol version, use 3.0 or above" Fix this so that we don't log this unless they really are trying to mount with multichannel. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=215608 Reported-by: Kim Scarborough Cc: stable@vger.kernel.org # 5.11+ Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French commit a8e8f851e8299703a005cf23dfb9ec854a2611e5 Author: Dmitry Torokhov Date: Tue Feb 15 13:11:42 2022 -0800 module: fix building with sysfs disabled Sysfs support might be disabled so we need to guard the code that instantiates "compression" attribute with an #ifdef. Fixes: b1ae6dc41eaa ("module: add in-kernel support for decompressing") Reported-by: kernel test robot Signed-off-by: Dmitry Torokhov Signed-off-by: Luis Chamberlain commit 45ce4b4f9009102cd9f581196d480a59208690c1 Author: Kumar Kartikeya Dwivedi Date: Thu Feb 17 01:49:43 2022 +0530 bpf: Fix crash due to out of bounds access into reg2btf_ids. When commit e6ac2450d6de ("bpf: Support bpf program calling kernel function") added kfunc support, it defined reg2btf_ids as a cheap way to translate the verifier reg type to the appropriate btf_vmlinux BTF ID, however commit c25b2ae13603 ("bpf: Replace PTR_TO_XXX_OR_NULL with PTR_TO_XXX | PTR_MAYBE_NULL") moved the __BPF_REG_TYPE_MAX from the last member of bpf_reg_type enum to after the base register types, and defined other variants using type flag composition. However, now, the direct usage of reg->type to index into reg2btf_ids may no longer fall into __BPF_REG_TYPE_MAX range, and hence lead to out of bounds access and kernel crash on dereference of bad pointer. Fixes: c25b2ae13603 ("bpf: Replace PTR_TO_XXX_OR_NULL with PTR_TO_XXX | PTR_MAYBE_NULL") Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220216201943.624869-1-memxor@gmail.com commit d19e0183a88306acda07f4a01fedeeffe2a2a06b Author: Trond Myklebust Date: Tue Feb 15 18:05:18 2022 -0500 NFS: Do not report writeback errors in nfs_getattr() The result of the writeback, whether it is an ENOSPC or an EIO, or anything else, does not inhibit the NFS client from reporting the correct file timestamps. Fixes: 79566ef018f5 ("NFS: Getattr doesn't require data sync semantics") Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit f71077a4d84bbe8c7b91b7db7c4ef815755ac5e3 Merge: 3593030761630 54309fde1a352 Author: Linus Torvalds Date: Wed Feb 16 12:09:22 2022 -0800 Merge tag 'mmc-v5.17-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc Pull MMC fix from Ulf Hansson: "Fix recovery logic for multi block I/O reads (MMC_READ_MULTIPLE_BLOCK)" * tag 'mmc-v5.17-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: mmc: block: fix read single on recovery logic commit f2703def339c793674010cc9f01bfe4980231808 Author: Alexander Lobakin Date: Sat Feb 12 22:21:11 2022 +0000 MIPS: smp: fill in sibling and core maps earlier After enabling CONFIG_SCHED_CORE (landed during 5.14 cycle), 2-core 2-thread-per-core interAptiv (CPS-driven) started emitting the following: [ 0.025698] CPU1 revision is: 0001a120 (MIPS interAptiv (multi)) [ 0.048183] ------------[ cut here ]------------ [ 0.048187] WARNING: CPU: 1 PID: 0 at kernel/sched/core.c:6025 sched_core_cpu_starting+0x198/0x240 [ 0.048220] Modules linked in: [ 0.048233] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 5.17.0-rc3+ #35 b7b319f24073fd9a3c2aa7ad15fb7993eec0b26f [ 0.048247] Stack : 817f0000 00000004 327804c8 810eb050 00000000 00000004 00000000 c314fdd1 [ 0.048278] 830cbd64 819c0000 81800000 817f0000 83070bf4 00000001 830cbd08 00000000 [ 0.048307] 00000000 00000000 815fcbc4 00000000 00000000 00000000 00000000 00000000 [ 0.048334] 00000000 00000000 00000000 00000000 817f0000 00000000 00000000 817f6f34 [ 0.048361] 817f0000 818a3c00 817f0000 00000004 00000000 00000000 4dc33260 0018c933 [ 0.048389] ... [ 0.048396] Call Trace: [ 0.048399] [<8105a7bc>] show_stack+0x3c/0x140 [ 0.048424] [<8131c2a0>] dump_stack_lvl+0x60/0x80 [ 0.048440] [<8108b5c0>] __warn+0xc0/0xf4 [ 0.048454] [<8108b658>] warn_slowpath_fmt+0x64/0x10c [ 0.048467] [<810bd418>] sched_core_cpu_starting+0x198/0x240 [ 0.048483] [<810c6514>] sched_cpu_starting+0x14/0x80 [ 0.048497] [<8108c0f8>] cpuhp_invoke_callback_range+0x78/0x140 [ 0.048510] [<8108d914>] notify_cpu_starting+0x94/0x140 [ 0.048523] [<8106593c>] start_secondary+0xbc/0x280 [ 0.048539] [ 0.048543] ---[ end trace 0000000000000000 ]--- [ 0.048636] Synchronize counters for CPU 1: done. ...for each but CPU 0/boot. Basic debug printks right before the mentioned line say: [ 0.048170] CPU: 1, smt_mask: So smt_mask, which is sibling mask obviously, is empty when entering the function. This is critical, as sched_core_cpu_starting() calculates core-scheduling parameters only once per CPU start, and it's crucial to have all the parameters filled in at that moment (at least it uses cpu_smt_mask() which in fact is `&cpu_sibling_map[cpu]` on MIPS). A bit of debugging led me to that set_cpu_sibling_map() performing the actual map calculation, was being invocated after notify_cpu_start(), and exactly the latter function starts CPU HP callback round (sched_core_cpu_starting() is basically a CPU HP callback). While the flow is same on ARM64 (maps after the notifier, although before calling set_cpu_online()), x86 started calculating sibling maps earlier than starting the CPU HP callbacks in Linux 4.14 (see [0] for the reference). Neither me nor my brief tests couldn't find any potential caveats in calculating the maps right after performing delay calibration, but the WARN splat is now gone. The very same debug prints now yield exactly what I expected from them: [ 0.048433] CPU: 1, smt_mask: 0-1 [0] https://git.kernel.org/pub/scm/linux/kernel/git/mips/linux.git/commit/?id=76ce7cfe35ef Signed-off-by: Alexander Lobakin Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Bogendoerfer commit cc19db8b312a6c75645645f5cc1b45166b109006 Author: Chuanhong Guo Date: Fri Feb 11 08:13:44 2022 +0800 MIPS: ralink: mt7621: do memory detection on KSEG1 It's reported that current memory detection code occasionally detects larger memory under some bootloaders. Current memory detection code tests whether address space wraps around on KSEG0, which is unreliable because it's cached. Rewrite memory size detection to perform the same test on KSEG1 instead. While at it, this patch also does the following two things: 1. use a fixed pattern instead of a random function pointer as the magic value. 2. add an additional memory write and a second comparison as part of the test to prevent possible smaller memory detection result due to leftover values in memory. Fixes: 139c949f7f0a MIPS: ("ralink: mt7621: add memory detection support") Reported-by: Rui Salvaterra Signed-off-by: Chuanhong Guo Tested-by: Sergio Paracuellos Tested-by: Rui Salvaterra Signed-off-by: Thomas Bogendoerfer commit 3593030761630e09200072a4bd06468892c27be3 Author: Linus Torvalds Date: Tue Feb 15 15:28:00 2022 -0800 tty: n_tty: do not look ahead for EOL character past the end of the buffer Daniel Gibson reports that the n_tty code gets line termination wrong in very specific cases: "If you feed a line with exactly 64 chars + terminating newline, and directly afterwards (without reading) another line into a pseudo terminal, the the first read() on the other side will return the 64 char line *without* terminating newline, and the next read() will return the missing terminating newline AND the complete next line (if it fits in the buffer)" and bisected the behavior to commit 3b830a9c34d5 ("tty: convert tty_ldisc_ops 'read()' function to take a kernel pointer"). Now, digging deeper, it turns out that the behavior isn't exactly new: what changed in commit 3b830a9c34d5 was that the tty line discipline .read() function is now passed an intermediate kernel buffer rather than the final user space buffer. And that intermediate kernel buffer is 64 bytes in size - thus that special case with exactly 64 bytes plus terminating newline. The same problem did exist before, but historically the boundary was not the 64-byte chunk, but the user-supplied buffer size, which is obviously generally bigger (and potentially bigger than N_TTY_BUF_SIZE, which would hide the issue entirely). The reason is that the n_tty canon_copy_from_read_buf() code would look ahead for the EOL character one byte further than it would actually copy. It would then decide that it had found the terminator, and unmark it as an EOL character - which in turn explains why the next read wouldn't then be terminated by it. Now, the reason it did all this in the first place is related to some historical and pretty obscure EOF behavior, see commit ac8f3bf8832a ("n_tty: Fix poll() after buffer-limited eof push read") and commit 40d5e0905a03 ("n_tty: Fix EOF push handling"). And the reason for the EOL confusion is that we treat EOF as a special EOL condition, with the EOL character being NUL (aka "__DISABLED_CHAR" in the kernel sources). So that EOF look-ahead also affects the normal EOL handling. This patch just removes the look-ahead that causes problems, because EOL is much more critical than the historical "EOF in the middle of a line that coincides with the end of the buffer" handling ever was. Now, it is possible that we should indeed re-introduce the "look at next character to see if it's a EOF" behavior, but if so, that should be done not at the kernel buffer chunk boundary in canon_copy_from_read_buf(), but at a higher level, when we run out of the user buffer. In particular, the place to do that would be at the top of 'n_tty_read()', where we check if it's a continuation of a previously started read, and there is no more buffer space left, we could decide to just eat the __DISABLED_CHAR at that point. But that would be a separate patch, because I suspect nobody actually cares, and I'd like to get a report about it before bothering. Fixes: 3b830a9c34d5 ("tty: convert tty_ldisc_ops 'read()' function to take a kernel pointer") Fixes: ac8f3bf8832a ("n_tty: Fix poll() after buffer-limited eof push read") Fixes: 40d5e0905a03 ("n_tty: Fix EOF push handling") Link: https://bugzilla.kernel.org/show_bug.cgi?id=215611 Reported-and-tested-by: Daniel Gibson Cc: Peter Hurley Cc: Greg Kroah-Hartman Cc: Jiri Slaby Signed-off-by: Linus Torvalds commit bfe55a1f7fd6bfede16078bf04c6250fbca11588 Author: Woody Suwalski Date: Wed Feb 9 16:05:09 2022 -0500 ACPI: processor: idle: fix lockup regression on 32-bit ThinkPad T40 Add and ACPI idle power level limit for 32-bit ThinkPad T40. There is a regression on T40 introduced by commit d6b88ce2, starting with kernel 5.16: commit d6b88ce2eb9d2698eb24451eb92c0a1649b17bb1 Author: Richard Gong Date:   Wed Sep 22 08:31:16 2021 -0500 ACPI: processor idle: Allow playing dead in C3 state The above patch is trying to enter C3 state during init, what is causing a T40 system freeze. I have not found a similar issue on any other of my 32-bit machines. The fix is to add another exception to the processor_power_dmi_table[] list. As a result the dmesg shows as expected: [2.155398] ACPI: IBM ThinkPad T40 detected - limiting to C2 max_cstate. Override with "processor.max_cstate=9" [2.155404] ACPI: processor limited to max C-state 2 The fix is trivial and affects only vintage T40 systems. Fixes: d6b88ce2eb9d ("CPI: processor idle: Allow playing dead in C3 state") Signed-off-by: Woody Suwalski Reviewed-by: Hans de Goede Cc: 5.16+ # 5.16+ [ rjw: New subject ] Signed-off-by: Rafael J. Wysocki commit 047e6032c4f054372311eb20c759cfe0b3ca7ffe Author: German Gomez Date: Tue Jan 25 10:44:34 2022 +0000 perf test: Fix arm64 perf_event_attr tests wrt --call-graph initialization The struct perf_event_attr is initialised differently in Arm64 when recording in call-graph fp mode, so update the relevant tests, and add two extra arm64-only tests. Before: $ perf test 17 -v 17: Setup struct perf_event_attr [...] running './tests/attr/test-record-graph-default' expected sample_type=295, got 4391 expected sample_regs_user=0, got 1073741824 FAILED './tests/attr/test-record-graph-default' - match failure test child finished with -1 ---- end ---- After: [...] running './tests/attr/test-record-graph-default-aarch64' test limitation 'aarch64' running './tests/attr/test-record-graph-fp-aarch64' test limitation 'aarch64' running './tests/attr/test-record-graph-default' test limitation '!aarch64' excluded architecture list ['aarch64'] skipped [aarch64] './tests/attr/test-record-graph-default' running './tests/attr/test-record-graph-fp' test limitation '!aarch64' excluded architecture list ['aarch64'] skipped [aarch64] './tests/attr/test-record-graph-fp' [...] Fixes: 7248e308a5758761 ("perf tools: Record ARM64 LR register automatically") Signed-off-by: German Gomez Cc: Alexander Shishkin Cc: Alexandre Truong Cc: Ian Rogers Cc: James Clark Cc: Jiri Olsa Cc: John Fastabend Cc: KP Singh Cc: Mark Rutland Cc: Martin KaFai Lau Cc: Namhyung Kim Cc: Song Liu Cc: Yonghong Song Link: http://lore.kernel.org/lkml/20220125104435.2737-1-german.gomez@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 52a9dab6d892763b2a8334a568bd4e2c1a6fde66 Author: Kees Cook Date: Sun Feb 13 10:24:43 2022 -0800 libsubcmd: Fix use-after-free for realloc(..., 0) GCC 12 correctly reports a potential use-after-free condition in the xrealloc helper. Fix the warning by avoiding an implicit "free(ptr)" when size == 0: In file included from help.c:12: In function 'xrealloc', inlined from 'add_cmdname' at help.c:24:2: subcmd-util.h:56:23: error: pointer may be used after 'realloc' [-Werror=use-after-free] 56 | ret = realloc(ptr, size); | ^~~~~~~~~~~~~~~~~~ subcmd-util.h:52:21: note: call to 'realloc' here 52 | void *ret = realloc(ptr, size); | ^~~~~~~~~~~~~~~~~~ subcmd-util.h:58:31: error: pointer may be used after 'realloc' [-Werror=use-after-free] 58 | ret = realloc(ptr, 1); | ^~~~~~~~~~~~~~~ subcmd-util.h:52:21: note: call to 'realloc' here 52 | void *ret = realloc(ptr, size); | ^~~~~~~~~~~~~~~~~~ Fixes: 2f4ce5ec1d447beb ("perf tools: Finalize subcmd independence") Reported-by: Valdis Klētnieks Signed-off-by: Kees Kook Tested-by: Valdis Klētnieks Tested-by: Justin M. Forbes Acked-by: Josh Poimboeuf Cc: linux-hardening@vger.kernel.org Cc: Valdis Klētnieks Link: http://lore.kernel.org/lkml/20220213182443.4037039-1-keescook@chromium.org Signed-off-by: Arnaldo Carvalho de Melo commit 30d1c4d947983f3cfbff9cbb7a4d69b05b699678 Author: Jiri Olsa Date: Tue Feb 15 16:37:13 2022 +0100 libperf: Fix perf_cpu_map__for_each_cpu macro Tzvetomir Stoyanov reported an issue with using macro perf_cpu_map__for_each_cpu using private perf_cpu object. The issue is caused by recent change that wrapped cpu in struct perf_cpu to distinguish it from cpu indexes. We need to make struct perf_cpu public. Add a simple test for using the perf_cpu_map__for_each_cpu macro. Fixes: 6d18804b963b78dc ("perf cpumap: Give CPUs their own type") Reported-by: Tzvetomir Stoyanov (VMware) Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Ian Rogers Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20220215153713.31395-1-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 9de0736973dd7f0f710d0f5e0a3dfd9fa9ffeb3f Author: James Clark Date: Thu Feb 10 20:06:20 2022 +0000 perf cs-etm: Fix corrupt inject files when only last branch option is enabled 'perf inject' with Coresight data generates files that cannot be opened when only the last branch option is specified: perf inject -i perf.data --itrace=l -o inject.data perf script -i inject.data 0x33faa8 [0x8]: failed to process type: 9 [Bad address] This is because cs_etm__synth_instruction_sample() is called even when the sample type for instructions hasn't been setup. Last branch records are attached to instruction samples so it doesn't make sense to generate them when --itrace=i isn't specified anyway. This change disables all calls of cs_etm__synth_instruction_sample() unless --itrace=i is specified, resulting in a file with no samples if only --itrace=l is provided, rather than a bad file. 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: Will Deacon Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20220210200620.1227232-2-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 0b31ea6613ad1e6b9b84d877c1be18e39934e90a Author: James Clark Date: Thu Feb 10 20:06:19 2022 +0000 perf cs-etm: No-op refactor of synth opt usage sample_branches and sample_instructions are already saved in the synth_opts struct. Other usages like synth_opts.last_branch don't save a value, so make this more consistent by always going through synth_opts and not saving duplicate values. 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: Will Deacon Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20220210200620.1227232-1-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 096972f5588dbac741f7f0cc057c84d895d4d80f Author: Rob Herring Date: Tue Feb 1 15:39:03 2022 -0600 libperf: Fix 32-bit build for tests uint64_t printf Commit a7f3713f6bf207e6 ("libperf tests: Add test_stat_multiplexing test") added printf's of 64-bit ints using %lu which doesn't work on 32-bit builds: tests/test-evlist.c:529:29: error: format ‘%lu’ expects argument of type \ ‘long unsigned int’, but argument 4 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Werror=format=] Use PRIu64 instead which works on both 32-bit and 64-bit systems. Fixes: a7f3713f6bf207e6 ("libperf tests: Add test_stat_multiplexing test") Signed-off-by: Rob Herring Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Shunsuke Nakamura Link: https://lore.kernel.org/r/20220201213903.699656-1-robh@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 714b8b7131f9287b1ff6c0528accd5df585b30d3 Author: Arnaldo Carvalho de Melo Date: Fri May 21 16:00:31 2021 -0300 tools headers UAPI: Sync linux/perf_event.h with the kernel sources To pick the trivial change in: ddecd22878601a60 ("perf: uapi: Document perf_event_attr::sig_data truncation on 32 bit architectures") Just adds a comment. This silences this perf build warning: Warning: Kernel ABI header at 'tools/include/uapi/linux/perf_event.h' differs from latest version at 'include/uapi/linux/perf_event.h' diff -u tools/include/uapi/linux/perf_event.h include/uapi/linux/perf_event.h Cc: Marco Elver Cc: Peter Zijlstra Link: https://lore.kernel.org/lkml/ Signed-off-by: Arnaldo Carvalho de Melo commit de9f498d2b381de1abf654ca3459c4f01227b5cd Author: Changbin Du Date: Tue Feb 8 22:07:25 2022 +0800 perf trace: Avoid early exit due SIGCHLD from non-workload processes The function trace__symbols_init() runs "perf-read-vdso32" and that ends up with a SIGCHLD delivered to 'perf'. And this SIGCHLD make perf exit early. 'perf trace' should exit only if the SIGCHLD is from our workload process. So let's use sigaction() instead of signal() to match such condition. Committer notes: Use memset to zero the 'struct sigaction' variable as the '= { 0 }' method isn't accepted in many compiler versions, e.g.: 4 34.02 alpine:3.6 : FAIL clang version 4.0.0 (tags/RELEASE_400/final) builtin-trace.c:4897:35: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces] struct sigaction sigchld_act = { 0 }; ^ {} builtin-trace.c:4897:37: error: missing field 'sa_mask' initializer [-Werror,-Wmissing-field-initializers] struct sigaction sigchld_act = { 0 }; ^ 2 errors generated. 6 32.60 alpine:3.8 : FAIL gcc version 6.4.0 (Alpine 6.4.0) builtin-trace.c:4897:35: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces] struct sigaction sigchld_act = { 0 }; ^ {} builtin-trace.c:4897:37: error: missing field 'sa_mask' initializer [-Werror,-Wmissing-field-initializers] struct sigaction sigchld_act = { 0 }; ^ 2 errors generated. 7 34.82 alpine:3.9 : FAIL gcc version 8.3.0 (Alpine 8.3.0) builtin-trace.c:4897:35: error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces] struct sigaction sigchld_act = { 0 }; ^ {} builtin-trace.c:4897:37: error: missing field 'sa_mask' initializer [-Werror,-Wmissing-field-initializers] struct sigaction sigchld_act = { 0 }; ^ 2 errors generated. Signed-off-by: Changbin Du Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220208140725.3947-1-changbin.du@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit c5487b9cdea5c1ede38a7ec94db0fc59963c8e86 Author: Fabio Estevam Date: Tue Feb 15 09:05:14 2022 -0300 ASoC: cs4265: Fix the duplicated control name Currently, the following error messages are seen during boot: asoc-simple-card sound: control 2:0:0:SPDIF Switch:0 is already present cs4265 1-004f: ASoC: failed to add widget SPDIF dapm kcontrol SPDIF Switch: -16 Quoting Mark Brown: "The driver is just plain buggy, it defines both a regular SPIDF Switch control and a SND_SOC_DAPM_SWITCH() called SPDIF both of which will create an identically named control, it can never have loaded without error. One or both of those has to be renamed or they need to be merged into one thing." Fix the duplicated control name by combining the two SPDIF controls here and move the register bits onto the DAPM widget and have DAPM control them. Fixes: f853d6b3ba34 ("ASoC: cs4265: Add a S/PDIF enable switch") Signed-off-by: Fabio Estevam Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220215120514.1760628-1-festevam@gmail.com Signed-off-by: Mark Brown commit 9bdd10d57a8807dba0003af0325191f3cec0f11c Author: Marek Vasut Date: Tue Feb 15 14:06:45 2022 +0100 ASoC: ops: Shift tested values in snd_soc_put_volsw() by +min While the $val/$val2 values passed in from userspace are always >= 0 integers, the limits of the control can be signed integers and the $min can be non-zero and less than zero. To correctly validate $val/$val2 against platform_max, add the $min offset to val first. Fixes: 817f7c9335ec0 ("ASoC: ops: Reject out of bounds values in snd_soc_put_volsw()") Signed-off-by: Marek Vasut Cc: Mark Brown Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220215130645.164025-1-marex@denx.de Signed-off-by: Mark Brown commit 184b58fa816fb5ee1854daf0d430766422bf2a77 Author: Mikko Perttunen Date: Mon Feb 7 15:19:31 2022 +0200 gpu: host1x: Always return syncpoint value when waiting The new TegraDRM UAPI uses syncpoint waiting with timeout set to zero to indicate reading the syncpoint value. To support that we need to return the syncpoint value always when waiting. Fixes: 44e961381354 ("drm/tegra: Implement syncpoint wait UAPI") Signed-off-by: Mikko Perttunen Signed-off-by: Thierry Reding commit 0a5a587501b54e8c6d86960b047d4491fd40dcf2 Author: Michael Hübner Date: Thu Jan 20 08:40:48 2022 +0100 HID: Add support for open wheel and no attachment to T300 Different add ons to the wheel base report different models. Having no wheel mounted to the base and using the open wheel attachment is added here. Signed-off-by: Michael Hübner Signed-off-by: Jiri Kosina commit 25666e8ccd952627899b09b68f7c9b68cfeaf028 Author: Lucas Zampieri Date: Wed Jan 26 11:44:00 2022 -0300 HID: logitech-dj: add new lightspeed receiver id As of logitech lightspeed receiver fw version 04.02.B0009, HIDPP_PARAM_DEVICE_INFO is being reported as 0x11. With patch "HID: logitech-dj: add support for the new lightspeed receiver iteration", the mouse starts to error out with: logitech-djreceiver: unusable device of type UNKNOWN (0x011) connected on slot 1 and becomes unusable. This has been noticed on a Logitech G Pro X Superlight fw MPM 25.01.B0018. Signed-off-by: Lucas Zampieri Acked-by: Nestor Lopez Casado Signed-off-by: Jiri Kosina commit 7920af5c826cb4a7ada1ae26fdd317642805adc2 Author: Samuel Holland Date: Sat Feb 12 14:50:48 2022 -0600 gpio: rockchip: Reset int_bothedge when changing trigger With v2 hardware, an IRQ can be configured to trigger on both edges via a bit in the int_bothedge register. Currently, the driver sets this bit when changing the trigger type to IRQ_TYPE_EDGE_BOTH, but fails to reset this bit if the trigger type is later changed to something else. This causes spurious IRQs, and when using gpio-keys with wakeup-event-action set to EV_ACT_(DE)ASSERTED, those IRQs translate into spurious wakeups. Fixes: 3bcbd1a85b68 ("gpio/rockchip: support next version gpio controller") Reported-by: Guillaume Savaton Tested-by: Guillaume Savaton Signed-off-by: Samuel Holland Signed-off-by: Bartosz Golaszewski commit 859ae7018316daa4adbc496012dcbbb458d7e510 Author: Nicolas Escande Date: Mon Feb 14 18:32:14 2022 +0100 mac80211: fix forwarded mesh frames AC & queue selection There are two problems with the current code that have been highlighted with the AQL feature that is now enbaled by default. First problem is in ieee80211_rx_h_mesh_fwding(), ieee80211_select_queue_80211() is used on received packets to choose the sending AC queue of the forwarding packet although this function should only be called on TX packet (it uses ieee80211_tx_info). This ends with forwarded mesh packets been sent on unrelated random AC queue. To fix that, AC queue can directly be infered from skb->priority which has been extracted from QOS info (see ieee80211_parse_qos()). Second problem is the value of queue_mapping set on forwarded mesh frames via skb_set_queue_mapping() is not the AC of the packet but a hardware queue index. This may or may not work depending on AC to HW queue mapping which is driver specific. Both of these issues lead to improper AC selection while forwarding mesh packets but more importantly due to improper airtime accounting (which is done on a per STA, per AC basis) caused traffic stall with the introduction of AQL. Fixes: cf44012810cc ("mac80211: fix unnecessary frame drops in mesh fwding") Fixes: d3c1597b8d1b ("mac80211: fix forwarded mesh frame queue mapping") Co-developed-by: Remi Pommarel Signed-off-by: Remi Pommarel Signed-off-by: Nicolas Escande Link: https://lore.kernel.org/r/20220214173214.368862-1-nico.escande@gmail.com Signed-off-by: Johannes Berg commit a6bce78262f5dd4b50510f0aa47f3995f7b185f3 Author: Johannes Berg Date: Thu Feb 3 20:15:29 2022 +0100 mac80211: refuse aggregations sessions before authorized If an MFP station isn't authorized, the receiver will (or at least should) drop the action frame since it's a robust management frame, but if we're not authorized we haven't installed keys yet. Refuse attempts to start a session as they'd just time out. Signed-off-by: Johannes Berg Link: https://lore.kernel.org/r/20220203201528.ff4d5679dce9.I34bb1f2bc341e161af2d6faf74f91b332ba11285@changeid Signed-off-by: Johannes Berg commit 610d086d6df0b15c3732a7b4a5b0f1c3e1b84d4c Author: Deren Wu Date: Sun Feb 13 00:20:15 2022 +0800 mac80211: fix EAPoL rekey fail in 802.3 rx path mac80211 set capability NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211 to upper layer by default. That means we should pass EAPoL packets through nl80211 path only, and should not send the EAPoL skb to netdevice diretly. At the meanwhile, wpa_supplicant would not register sock to listen EAPoL skb on the netdevice. However, there is no control_port_protocol handler in mac80211 for 802.3 RX packets, mac80211 driver would pass up the EAPoL rekey frame to netdevice and wpa_supplicant would be never interactive with this kind of packets, if SUPPORTS_RX_DECAP_OFFLOAD is enabled. This causes STA always rekey fail if EAPoL frame go through 802.3 path. To avoid this problem, align the same process as 802.11 type to handle this frame before put it into network stack. This also addresses a potential security issue in 802.3 RX mode that was previously fixed in commit a8c4d76a8dd4 ("mac80211: do not accept/forward invalid EAPOL frames"). Cc: stable@vger.kernel.org # 5.12+ Fixes: 80a915ec4427 ("mac80211: add rx decapsulation offload support") Signed-off-by: Deren Wu Link: https://lore.kernel.org/r/6889c9fced5859ebb088564035f84fd0fa792a49.1644680751.git.deren.wu@mediatek.com [fix typos, update comment and add note about security issue] Signed-off-by: Johannes Berg commit dee435be76f4117410bbd90573a881fd33488f37 Author: James Morse Date: Tue Feb 8 16:08:13 2022 +0000 arm64: proton-pack: Report Spectre-BHB vulnerabilities as part of Spectre-v2 Speculation attacks against some high-performance processors can make use of branch history to influence future speculation as part of a spectre-v2 attack. This is not mitigated by CSV2, meaning CPUs that previously reported 'Not affected' are now moderately mitigated by CSV2. Update the value in /sys/devices/system/cpu/vulnerabilities/spectre_v2 to also show the state of the BHB mitigation. Reviewed-by: Catalin Marinas Signed-off-by: James Morse commit bd09128d16fac3c34b80bd6a29088ac632e8ce09 Author: James Morse Date: Tue Nov 23 18:29:25 2021 +0000 arm64: Add percpu vectors for EL1 The Spectre-BHB workaround adds a firmware call to the vectors. This is needed on some CPUs, but not others. To avoid the unaffected CPU in a big/little pair from making the firmware call, create per cpu vectors. The per-cpu vectors only apply when returning from EL0. Systems using KPTI can use the canonical 'full-fat' vectors directly at EL1, the trampoline exit code will switch to this_cpu_vector on exit to EL0. Systems not using KPTI should always use this_cpu_vector. this_cpu_vector will point at a vector in tramp_vecs or __bp_harden_el1_vectors, depending on whether KPTI is in use. Reviewed-by: Catalin Marinas Signed-off-by: James Morse commit b28a8eebe81c186fdb1a0078263b30576c8e1f42 Author: James Morse Date: Thu Nov 25 14:25:34 2021 +0000 arm64: entry: Add macro for reading symbol addresses from the trampoline The trampoline code needs to use the address of symbols in the wider kernel, e.g. vectors. PC-relative addressing wouldn't work as the trampoline code doesn't run at the address the linker expected. tramp_ventry uses a literal pool, unless CONFIG_RANDOMIZE_BASE is set, in which case it uses the data page as a literal pool because the data page can be unmapped when running in user-space, which is required for CPUs vulnerable to meltdown. Pull this logic out as a macro, instead of adding a third copy of it. Reviewed-by: Catalin Marinas Signed-off-by: James Morse commit ba2689234be92024e5635d30fe744f4853ad97db Author: James Morse Date: Thu Nov 18 13:59:46 2021 +0000 arm64: entry: Add vectors that have the bhb mitigation sequences Some CPUs affected by Spectre-BHB need a sequence of branches, or a firmware call to be run before any indirect branch. This needs to go in the vectors. No CPU needs both. While this can be patched in, it would run on all CPUs as there is a single set of vectors. If only one part of a big/little combination is affected, the unaffected CPUs have to run the mitigation too. Create extra vectors that include the sequence. Subsequent patches will allow affected CPUs to select this set of vectors. Later patches will modify the loop count to match what the CPU requires. Reviewed-by: Catalin Marinas Signed-off-by: James Morse commit 439cf34c8e0a8a33d8c15a31be1b7423426bc765 Author: Ville Syrjälä Date: Wed Feb 9 11:19:27 2022 +0200 drm/atomic: Don't pollute crtc_state->mode_blob with error pointers Make sure we don't assign an error pointer to crtc_state->mode_blob as that will break all kinds of places that assume either NULL or a valid pointer (eg. drm_property_blob_put()). Cc: stable@vger.kernel.org Reported-by: fuyufan Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220209091928.14766-1-ville.syrjala@linux.intel.com Acked-by: Maxime Ripard commit de8aa31ac7c23af98fe24d1c1b43b065027d6af5 Author: Linus Walleij Date: Tue Feb 15 16:29:08 2022 -0800 Input: zinitix - add new compatible strings This driver works just fine with the BT404 version of the touchscreen as well. Tested on the Samsung GT-I8160 (Codina) mobile phone. Add all the new variants from the binding document so people can easily test them, we believe most of them work more or less. Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20220214234033.1052681-1-linus.walleij@linaro.org Signed-off-by: Dmitry Torokhov commit c5d9ae265b105d9a67575fb67bd4650a6fc08e25 Merge: a254a9da455c1 710c476514313 Author: Linus Torvalds Date: Tue Feb 15 11:07:59 2022 -0800 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull kvm fixes from Paolo Bonzini: "ARM: - Read HW interrupt pending state from the HW x86: - Don't truncate the performance event mask on AMD - Fix Xen runstate updates to be atomic when preempting vCPU - Fix for AMD AVIC interrupt injection race - Several other AMD fixes" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: KVM: x86/pmu: Use AMD64_RAW_EVENT_MASK for PERF_TYPE_RAW KVM: x86/pmu: Don't truncate the PerfEvtSeln MSR when creating a perf event KVM: SVM: fix race between interrupt delivery and AVIC inhibition KVM: SVM: set IRR in svm_deliver_interrupt KVM: SVM: extract avic_ring_doorbell selftests: kvm: Remove absent target file KVM: arm64: vgic: Read HW interrupt pending state from the HW KVM: x86/xen: Fix runstate updates to be atomic when preempting vCPU KVM: x86: SVM: move avic definitions from AMD's spec to svm.h KVM: x86: lapic: don't touch irr_pending in kvm_apic_update_apicv when inhibiting it KVM: x86: nSVM: deal with L1 hypervisor that intercepts interrupts but lets L2 control them KVM: x86: nSVM: expose clean bit support to the guest KVM: x86: nSVM/nVMX: set nested_run_pending on VM entry which is a result of RSM KVM: x86: nSVM: mark vmcb01 as dirty when restoring SMM saved state KVM: x86: nSVM: fix potential NULL derefernce on nested migration KVM: x86: SVM: don't passthrough SMAP/SMEP/PKE bits in !NPT && !gCR0.PG case Revert "svm: Add warning message for AVIC IPI invalid target" commit f98da1d66298882b1d2061051ea14ddc15c58884 Author: Dan Williams Date: Tue Feb 15 10:54:23 2022 -0800 ACPI: tables: Quiet ACPI table not found warning Paul reports that the ACPI core complains on every boot about a missing CEDT table. Unlike the standard NUMA tables (SRAT, MADT, and SLIT) that are critical to NUMA init, CEDT is only expected on CXL platforms. Given the notice is not actionable lower its severity to debug. Link: https://lore.kernel.org/r/55f5c077-061c-7e53-b02d-53dde1dd654f@molgen.mpg.de Fixes: fd49f99c1809 ("ACPI: NUMA: Add a node and memblk for each CFMWS not in SRAT") Reported-by: Paul Menzel Signed-off-by: Dan Williams Signed-off-by: Rafael J. Wysocki commit 966d879bafaaf020c11a7cee9526f6dd823a4126 Author: Qu Wenruo Date: Fri Feb 11 14:41:39 2022 +0800 btrfs: defrag: allow defrag_one_cluster() to skip large extent which is not a target In the rework of btrfs_defrag_file(), we always call defrag_one_cluster() and increase the offset by cluster size, which is only 256K. But there are cases where we have a large extent (e.g. 128M) which doesn't need to be defragged at all. Before the refactor, we can directly skip the range, but now we have to scan that extent map again and again until the cluster moves after the non-target extent. Fix the problem by allow defrag_one_cluster() to increase btrfs_defrag_ctrl::last_scanned to the end of an extent, if and only if the last extent of the cluster is not a target. The test script looks like this: mkfs.btrfs -f $dev > /dev/null mount $dev $mnt # As btrfs ioctl uses 32M as extent_threshold xfs_io -f -c "pwrite 0 64M" $mnt/file1 sync # Some fragemented range to defrag xfs_io -s -c "pwrite 65548k 4k" \ -c "pwrite 65544k 4k" \ -c "pwrite 65540k 4k" \ -c "pwrite 65536k 4k" \ $mnt/file1 sync echo "=== before ===" xfs_io -c "fiemap -v" $mnt/file1 echo "=== after ===" btrfs fi defrag $mnt/file1 sync xfs_io -c "fiemap -v" $mnt/file1 umount $mnt With extra ftrace put into defrag_one_cluster(), before the patch it would result tons of loops: (As defrag_one_cluster() is inlined, the function name is its caller) btrfs-126062 [005] ..... 4682.816026: btrfs_defrag_file: r/i=5/257 start=0 len=262144 btrfs-126062 [005] ..... 4682.816027: btrfs_defrag_file: r/i=5/257 start=262144 len=262144 btrfs-126062 [005] ..... 4682.816028: btrfs_defrag_file: r/i=5/257 start=524288 len=262144 btrfs-126062 [005] ..... 4682.816028: btrfs_defrag_file: r/i=5/257 start=786432 len=262144 btrfs-126062 [005] ..... 4682.816028: btrfs_defrag_file: r/i=5/257 start=1048576 len=262144 ... btrfs-126062 [005] ..... 4682.816043: btrfs_defrag_file: r/i=5/257 start=67108864 len=262144 But with this patch there will be just one loop, then directly to the end of the extent: btrfs-130471 [014] ..... 5434.029558: defrag_one_cluster: r/i=5/257 start=0 len=262144 btrfs-130471 [014] ..... 5434.029559: defrag_one_cluster: r/i=5/257 start=67108864 len=16384 CC: stable@vger.kernel.org # 5.16 Signed-off-by: Qu Wenruo Reviewed-by: Filipe Manana Signed-off-by: David Sterba commit 741b23a970a79d5d3a1db2d64fa2c7b375a4febb Author: Dāvis Mosāns Date: Wed Feb 2 23:44:55 2022 +0200 btrfs: prevent copying too big compressed lzo segment Compressed length can be corrupted to be a lot larger than memory we have allocated for buffer. This will cause memcpy in copy_compressed_segment to write outside of allocated memory. This mostly results in stuck read syscall but sometimes when using btrfs send can get #GP kernel: general protection fault, probably for non-canonical address 0x841551d5c1000: 0000 [#1] PREEMPT SMP NOPTI kernel: CPU: 17 PID: 264 Comm: kworker/u256:7 Tainted: P OE 5.17.0-rc2-1 #12 kernel: Workqueue: btrfs-endio btrfs_work_helper [btrfs] kernel: RIP: 0010:lzo_decompress_bio (./include/linux/fortify-string.h:225 fs/btrfs/lzo.c:322 fs/btrfs/lzo.c:394) btrfs Code starting with the faulting instruction =========================================== 0:* 48 8b 06 mov (%rsi),%rax <-- trapping instruction 3: 48 8d 79 08 lea 0x8(%rcx),%rdi 7: 48 83 e7 f8 and $0xfffffffffffffff8,%rdi b: 48 89 01 mov %rax,(%rcx) e: 44 89 f0 mov %r14d,%eax 11: 48 8b 54 06 f8 mov -0x8(%rsi,%rax,1),%rdx kernel: RSP: 0018:ffffb110812efd50 EFLAGS: 00010212 kernel: RAX: 0000000000001000 RBX: 000000009ca264c8 RCX: ffff98996e6d8ff8 kernel: RDX: 0000000000000064 RSI: 000841551d5c1000 RDI: ffffffff9500435d kernel: RBP: ffff989a3be856c0 R08: 0000000000000000 R09: 0000000000000000 kernel: R10: 0000000000000000 R11: 0000000000001000 R12: ffff98996e6d8000 kernel: R13: 0000000000000008 R14: 0000000000001000 R15: 000841551d5c1000 kernel: FS: 0000000000000000(0000) GS:ffff98a09d640000(0000) knlGS:0000000000000000 kernel: CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 kernel: CR2: 00001e9f984d9ea8 CR3: 000000014971a000 CR4: 00000000003506e0 kernel: Call Trace: kernel: kernel: end_compressed_bio_read (fs/btrfs/compression.c:104 fs/btrfs/compression.c:1363 fs/btrfs/compression.c:323) btrfs kernel: end_workqueue_fn (fs/btrfs/disk-io.c:1923) btrfs kernel: btrfs_work_helper (fs/btrfs/async-thread.c:326) btrfs kernel: process_one_work (./arch/x86/include/asm/jump_label.h:27 ./include/linux/jump_label.h:212 ./include/trace/events/workqueue.h:108 kernel/workqueue.c:2312) kernel: worker_thread (./include/linux/list.h:292 kernel/workqueue.c:2455) kernel: ? process_one_work (kernel/workqueue.c:2397) kernel: kthread (kernel/kthread.c:377) kernel: ? kthread_complete_and_exit (kernel/kthread.c:332) kernel: ret_from_fork (arch/x86/entry/entry_64.S:301) kernel: CC: stable@vger.kernel.org # 4.9+ Signed-off-by: Dāvis Mosāns Reviewed-by: David Sterba Signed-off-by: David Sterba commit a254a9da455c171441ab3a76ed8f5d1e9412e15f Merge: 705d84a366cfc 7f016b35ca762 Author: Linus Torvalds Date: Tue Feb 15 10:52:05 2022 -0800 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid Pull HID fixes from Jiri Kosina: - memory leak fix for hid-elo driver (Dongliang Mu) - fix for hangs on newer AMD platforms with amd_sfh-driven hardware (Basavaraj Natikar ) - locking fix in i2c-hid (Daniel Thompson) - a few device-ID specific quirks * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: HID: amd_sfh: Add interrupt handler to process interrupts HID: amd_sfh: Add functionality to clear interrupts HID: amd_sfh: Disable the interrupt for all command HID: amd_sfh: Correct the structure field name HID: amd_sfh: Handle amd_sfh work buffer in PM ops HID:Add support for UGTABLET WP5540 HID: amd_sfh: Add illuminance mask to limit ALS max value HID: amd_sfh: Increase sensor command timeout HID: i2c-hid: goodix: Fix a lockdep splat HID: elo: fix memory leak in elo_probe HID: apple: Set the tilde quirk flag on the Wellspring 5 and later commit 61d06f01f9710b327a53492e5add9f972eb909b3 Author: Felix Maurer Date: Fri Feb 11 18:43:36 2022 +0100 selftests: bpf: Check bpf_msg_push_data return value bpf_msg_push_data may return a non-zero value to indicate an error. The return value should be checked to prevent undetected errors. To indicate an error, the BPF programs now perform a different action than their intended one to make the userspace test program notice the error, i.e., the programs supposed to pass/redirect drop, the program supposed to drop passes. Fixes: 84fbfe026acaa ("bpf: test_sockmap add options to use msg_push_data") Signed-off-by: Felix Maurer Signed-off-by: Alexei Starovoitov Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/89f767bb44005d6b4dd1f42038c438f76b3ebfad.1644601294.git.fmaurer@redhat.com commit aff65393fa1401e034656e349abd655cfe272de0 Author: James Morse Date: Wed Nov 24 15:03:15 2021 +0000 arm64: entry: Add non-kpti __bp_harden_el1_vectors for mitigations kpti is an optional feature, for systems not using kpti a set of vectors for the spectre-bhb mitigations is needed. Add another set of vectors, __bp_harden_el1_vectors, that will be used if a mitigation is needed and kpti is not in use. The EL1 ventries are repeated verbatim as there is no additional work needed for entry from EL1. Reviewed-by: Russell King (Oracle) Reviewed-by: Catalin Marinas Signed-off-by: James Morse commit a9c406e6462ff14956d690de7bbe5131a5677dc9 Author: James Morse Date: Thu Nov 18 15:04:32 2021 +0000 arm64: entry: Allow the trampoline text to occupy multiple pages Adding a second set of vectors to .entry.tramp.text will make it larger than a single 4K page. Allow the trampoline text to occupy up to three pages by adding two more fixmap slots. Previous changes to tramp_valias allowed it to reach beyond a single page. Reviewed-by: Catalin Marinas Signed-off-by: James Morse commit c47e4d04ba0f1ea17353d85d45f611277507e07a Author: James Morse Date: Thu Nov 18 13:16:23 2021 +0000 arm64: entry: Make the kpti trampoline's kpti sequence optional Spectre-BHB needs to add sequences to the vectors. Having one global set of vectors is a problem for big/little systems where the sequence is costly on cpus that are not vulnerable. Making the vectors per-cpu in the style of KVM's bh_harden_hyp_vecs requires the vectors to be generated by macros. Make the kpti re-mapping of the kernel optional, so the macros can be used without kpti. Reviewed-by: Russell King (Oracle) Reviewed-by: Catalin Marinas Signed-off-by: James Morse commit 13d7a08352a83ef2252aeb464a5e08dfc06b5dfd Author: James Morse Date: Thu Nov 18 14:02:30 2021 +0000 arm64: entry: Move trampoline macros out of ifdef'd section The macros for building the kpti trampoline are all behind CONFIG_UNMAP_KERNEL_AT_EL0, and in a region that outputs to the .entry.tramp.text section. Move the macros out so they can be used to generate other kinds of trampoline. Only the symbols need to be guarded by CONFIG_UNMAP_KERNEL_AT_EL0 and appear in the .entry.tramp.text section. Reviewed-by: Russell King (Oracle) Reviewed-by: Catalin Marinas Signed-off-by: James Morse commit ed50da7764535f1e24432ded289974f2bf2b0c5a Author: James Morse Date: Wed Nov 24 13:40:09 2021 +0000 arm64: entry: Don't assume tramp_vectors is the start of the vectors The tramp_ventry macro uses tramp_vectors as the address of the vectors when calculating which ventry in the 'full fat' vectors to branch to. While there is one set of tramp_vectors, this will be true. Adding multiple sets of vectors will break this assumption. Move the generation of the vectors to a macro, and pass the start of the vectors as an argument to tramp_ventry. Reviewed-by: Russell King (Oracle) Reviewed-by: Catalin Marinas Signed-off-by: James Morse commit 6c5bf79b69f911560fbf82214c0971af6e58e682 Author: James Morse Date: Wed Nov 24 11:40:18 2021 +0000 arm64: entry: Allow tramp_alias to access symbols after the 4K boundary Systems using kpti enter and exit the kernel through a trampoline mapping that is always mapped, even when the kernel is not. tramp_valias is a macro to find the address of a symbol in the trampoline mapping. Adding extra sets of vectors will expand the size of the entry.tramp.text section to beyond 4K. tramp_valias will be unable to generate addresses for symbols beyond 4K as it uses the 12 bit immediate of the add instruction. As there are now two registers available when tramp_alias is called, use the extra register to avoid the 4K limit of the 12 bit immediate. Reviewed-by: Russell King (Oracle) Reviewed-by: Catalin Marinas Signed-off-by: James Morse commit c091fb6ae059cda563b2a4d93fdbc548ef34e1d6 Author: James Morse Date: Tue Nov 23 15:43:31 2021 +0000 arm64: entry: Move the trampoline data page before the text page The trampoline code has a data page that holds the address of the vectors, which is unmapped when running in user-space. This ensures that with CONFIG_RANDOMIZE_BASE, the randomised address of the kernel can't be discovered until after the kernel has been mapped. If the trampoline text page is extended to include multiple sets of vectors, it will be larger than a single page, making it tricky to find the data page without knowing the size of the trampoline text pages, which will vary with PAGE_SIZE. Move the data page to appear before the text page. This allows the data page to be found without knowing the size of the trampoline text pages. 'tramp_vectors' is used to refer to the beginning of the .entry.tramp.text section, do that explicitly. Reviewed-by: Russell King (Oracle) Reviewed-by: Catalin Marinas Signed-off-by: James Morse commit 03aff3a77a58b5b52a77e00537a42090ad57b80b Author: James Morse Date: Tue Nov 23 18:41:43 2021 +0000 arm64: entry: Free up another register on kpti's tramp_exit path Kpti stashes x30 in far_el1 while it uses x30 for all its work. Making the vectors a per-cpu data structure will require a second register. Allow tramp_exit two registers before it unmaps the kernel, by leaving x30 on the stack, and stashing x29 in far_el1. Reviewed-by: Russell King (Oracle) Reviewed-by: Catalin Marinas Signed-off-by: James Morse commit d739da1694a0eaef0358a42b76904b611539b77b Author: James Morse Date: Wed Nov 24 15:36:12 2021 +0000 arm64: entry: Make the trampoline cleanup optional Subsequent patches will add additional sets of vectors that use the same tricks as the kpti vectors to reach the full-fat vectors. The full-fat vectors contain some cleanup for kpti that is patched in by alternatives when kpti is in use. Once there are additional vectors, the cleanup will be needed in more cases. But on big/little systems, the cleanup would be harmful if no trampoline vector were in use. Instead of forcing CPUs that don't need a trampoline vector to use one, make the trampoline cleanup optional. Entry at the top of the vectors will skip the cleanup. The trampoline vectors can then skip the first instruction, triggering the cleanup to run. Reviewed-by: Russell King (Oracle) Reviewed-by: Catalin Marinas Signed-off-by: James Morse commit 5bdf3437603d4af87f9c7f424b0c8aeed2420745 Author: James Morse Date: Tue Nov 16 15:06:19 2021 +0000 KVM: arm64: Allow indirect vectors to be used without SPECTRE_V3A CPUs vulnerable to Spectre-BHB either need to make an SMC-CC firmware call from the vectors, or run a sequence of branches. This gets added to the hyp vectors. If there is no support for arch-workaround-1 in firmware, the indirect vector will be used. kvm_init_vector_slots() only initialises the two indirect slots if the platform is vulnerable to Spectre-v3a. pKVM's hyp_map_vectors() only initialises __hyp_bp_vect_base if the platform is vulnerable to Spectre-v3a. As there are about to more users of the indirect vectors, ensure their entries in hyp_spectre_vector_selector[] are always initialised, and __hyp_bp_vect_base defaults to the regular VA mapping. The Spectre-v3a check is moved to a helper kvm_system_needs_idmapped_vectors(), and merged with the code that creates the hyp mappings. Reviewed-by: Catalin Marinas Signed-off-by: James Morse commit 1b33d4860deaecf1d8eec3061b7e7ed7ab0bae8d Author: James Morse Date: Tue Nov 16 15:00:51 2021 +0000 arm64: spectre: Rename spectre_v4_patch_fw_mitigation_conduit The spectre-v4 sequence includes an SMC from the assembly entry code. spectre_v4_patch_fw_mitigation_conduit is the patching callback that generates an HVC or SMC depending on the SMCCC conduit type. As this isn't specific to spectre-v4, rename it smccc_patch_fw_mitigation_conduit so it can be re-used. Reviewed-by: Russell King (Oracle) Reviewed-by: Catalin Marinas Signed-off-by: James Morse commit 4330e2c5c04c27bebf89d34e0bc14e6943413067 Author: James Morse Date: Wed Nov 17 15:15:26 2021 +0000 arm64: entry.S: Add ventry overflow sanity checks Subsequent patches add even more code to the ventry slots. Ensure kernels that overflow a ventry slot don't get built. Reviewed-by: Russell King (Oracle) Reviewed-by: Catalin Marinas Signed-off-by: James Morse commit 705d84a366cfccda1e7aec1113a5399cd2ffee7d Merge: 2572da44a5119 2e7be9db125a0 Author: Linus Torvalds Date: Tue Feb 15 09:14:05 2022 -0800 Merge tag 'for-5.17-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs fixes from David Sterba: - yield CPU more often when defragmenting a large file - skip defragmenting extents already under writeback - improve error message when send fails to write file data - get rid of warning when mounted with 'flushoncommit' * tag 'for-5.17-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: btrfs: send: in case of IO error log it btrfs: get rid of warning on transaction commit when using flushoncommit btrfs: defrag: don't try to defrag extents which are under writeback btrfs: don't hold CPU for too long when defragging a file commit 2572da44a51192ad181482c1989e66e5eb47dcbe Merge: c24449b321095 6e8793674bb0d Author: Linus Torvalds Date: Tue Feb 15 09:10:09 2022 -0800 Merge tag 'for-5.17/parisc-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux Pull parisc architecture fixes from Helge Deller: - Fix miscompilations when function calls are made from inside a put_user() call - Drop __init from map_pages() declaration to avoid random boot crashes - Added #error messages if a 64-bit compiler was used to build a 32-bit kernel (and vice versa) - Fix out-of-bound data TLB miss faults in sba_iommu and ccio-dma drivers - Add ioread64_lo_hi() and iowrite64_lo_hi() functions to avoid kernel test robot errors - Fix link failure when 8250_gsc driver is built without CONFIG_IOSAPIC * tag 'for-5.17/parisc-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: serial: parisc: GSC: fix build when IOSAPIC is not set parisc: Fix some apparent put_user() failures parisc: Show error if wrong 32/64-bit compiler is being used parisc: Add ioread64_lo_hi() and iowrite64_lo_hi() parisc: Fix sglist access in ccio-dma.c parisc: Fix data TLB miss in sba_unmap_sg parisc: Drop __init from map_pages declaration commit c24449b321095d8c80cdda3d68107269c1d5569f Merge: d567f5db412ed ffc58bc4af936 Author: Linus Torvalds Date: Tue Feb 15 09:05:01 2022 -0800 Merge tag 'hyperv-fixes-signed-20220215' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux Pull hyperv fixes from Wei Liu: - Rework use of DMA_BIT_MASK in vmbus to work around a clang bug (Michael Kelley) - Fix NUMA topology (Long Li) - Fix a memory leak in vmbus (Miaoqian Lin) - One minor clean-up patch (Cai Huoqing) * tag 'hyperv-fixes-signed-20220215' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux: Drivers: hv: utils: Make use of the helper macro LIST_HEAD() Drivers: hv: vmbus: Rework use of DMA_BIT_MASK(64) Drivers: hv: vmbus: Fix memory leak in vmbus_add_channel_kobj PCI: hv: Fix NUMA node assignment when kernel boots with custom NUMA topology commit 6f66db29e2415cbe8759c48584f9cae19b3c2651 Author: Andy Shevchenko Date: Tue Dec 14 19:49:13 2021 +0200 pinctrl: tigerlake: Revert "Add Alder Lake-M ACPI ID" It appears that last minute change moved ACPI ID of Alder Lake-M to the INTC1055, which is already in the driver. This ID on the other hand will be used elsewhere. This reverts commit 258435a1c8187f559549e515d2f77fa0b57bcd27. Signed-off-by: Andy Shevchenko commit b6821b0d9b56386d2bf14806f90ec401468c799f Author: Oliver Graute Date: Thu Feb 10 09:53:22 2022 +0100 staging: fbtft: fb_st7789v: reset display before initialization In rare cases the display is flipped or mirrored. This was observed more often in a low temperature environment. A clean reset on init_display() should help to get registers in a sane state. Fixes: ef8f317795da (staging: fbtft: use init function instead of init sequence) Cc: stable@vger.kernel.org Signed-off-by: Oliver Graute Link: https://lore.kernel.org/r/20220210085322.15676-1-oliver.graute@kococonnector.com Signed-off-by: Greg Kroah-Hartman commit 8d2b1a1ec9f559d30b724877da4ce592edc41fdc Author: Oliver Neukum Date: Tue Feb 15 11:35:47 2022 +0100 CDC-NCM: avoid overflow in sanity checking A broken device may give an extreme offset like 0xFFF0 and a reasonable length for a fragment. In the sanity check as formulated now, this will create an integer overflow, defeating the sanity check. Both offset and offset + len need to be checked in such a manner that no overflow can occur. And those quantities should be unsigned. Signed-off-by: Oliver Neukum Reviewed-by: Greg Kroah-Hartman Signed-off-by: David S. Miller commit f8efca92ae509c25e0a4bd5d0a86decea4f0c41e Author: Eliav Farber Date: Thu Jan 13 10:06:19 2022 +0000 EDAC: Fix calculation of returned address and next offset in edac_align_ptr() Do alignment logic properly and use the "ptr" local variable for calculating the remainder of the alignment. This became an issue because struct edac_mc_layer has a size that is not zero modulo eight, and the next offset that was prepared for the private data was unaligned, causing an alignment exception. The patch in Fixes: which broke this actually wanted to "what we actually care about is the alignment of the actual pointer that's about to be returned." But it didn't check that alignment. Use the correct variable "ptr" for that. [ bp: Massage commit message. ] Fixes: 8447c4d15e35 ("edac: Do alignment logic properly in edac_align_ptr()") Signed-off-by: Eliav Farber Signed-off-by: Borislav Petkov Cc: Link: https://lore.kernel.org/r/20220113100622.12783-2-farbere@amazon.com commit 7e5b6a5c8c44310784c88c1c198dde79f6402f7b Author: Tom Rix Date: Mon Feb 14 18:05:41 2022 -0800 mctp: fix use after free Clang static analysis reports this problem route.c:425:4: warning: Use of memory after it is freed trace_mctp_key_acquire(key); ^~~~~~~~~~~~~~~~~~~~~~~~~~~ When mctp_key_add() fails, key is freed but then is later used in trace_mctp_key_acquire(). Add an else statement to use the key only when mctp_key_add() is successful. Fixes: 4f9e1ba6de45 ("mctp: Add tracepoints for tag/key handling") Signed-off-by: Tom Rix Signed-off-by: David S. Miller commit f240762f88b4b1b58561939ffd44837759756477 Author: Eric Dumazet Date: Mon Feb 14 20:10:03 2022 -0800 io_uring: add a schedule point in io_add_buffers() Looping ~65535 times doing kmalloc() calls can trigger soft lockups, especially with DEBUG features (like KASAN). [ 253.536212] watchdog: BUG: soft lockup - CPU#64 stuck for 26s! [b219417889:12575] [ 253.544433] Modules linked in: vfat fat i2c_mux_pca954x i2c_mux spidev cdc_acm xhci_pci xhci_hcd sha3_generic gq(O) [ 253.544451] CPU: 64 PID: 12575 Comm: b219417889 Tainted: G S O 5.17.0-smp-DEV #801 [ 253.544457] RIP: 0010:kernel_text_address (./include/asm-generic/sections.h:192 ./include/linux/kallsyms.h:29 kernel/extable.c:67 kernel/extable.c:98) [ 253.544464] Code: 0f 93 c0 48 c7 c1 e0 63 d7 a4 48 39 cb 0f 92 c1 20 c1 0f b6 c1 5b 5d c3 90 0f 1f 44 00 00 55 48 89 e5 41 57 41 56 53 48 89 fb <48> c7 c0 00 00 80 a0 41 be 01 00 00 00 48 39 c7 72 0c 48 c7 c0 40 [ 253.544468] RSP: 0018:ffff8882d8baf4c0 EFLAGS: 00000246 [ 253.544471] RAX: 1ffff1105b175e00 RBX: ffffffffa13ef09a RCX: 00000000a13ef001 [ 253.544474] RDX: ffffffffa13ef09a RSI: ffff8882d8baf558 RDI: ffffffffa13ef09a [ 253.544476] RBP: ffff8882d8baf4d8 R08: ffff8882d8baf5e0 R09: 0000000000000004 [ 253.544479] R10: ffff8882d8baf5e8 R11: ffffffffa0d59a50 R12: ffff8882eab20380 [ 253.544481] R13: ffffffffa0d59a50 R14: dffffc0000000000 R15: 1ffff1105b175eb0 [ 253.544483] FS: 00000000016d3380(0000) GS:ffff88af48c00000(0000) knlGS:0000000000000000 [ 253.544486] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 253.544488] CR2: 00000000004af0f0 CR3: 00000002eabfa004 CR4: 00000000003706e0 [ 253.544491] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 253.544492] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 253.544494] Call Trace: [ 253.544496] [ 253.544498] ? io_queue_sqe (fs/io_uring.c:7143) [ 253.544505] __kernel_text_address (kernel/extable.c:78) [ 253.544508] unwind_get_return_address (arch/x86/kernel/unwind_frame.c:19) [ 253.544514] arch_stack_walk (arch/x86/kernel/stacktrace.c:27) [ 253.544517] ? io_queue_sqe (fs/io_uring.c:7143) [ 253.544521] stack_trace_save (kernel/stacktrace.c:123) [ 253.544527] ____kasan_kmalloc (mm/kasan/common.c:39 mm/kasan/common.c:45 mm/kasan/common.c:436 mm/kasan/common.c:515) [ 253.544531] ? ____kasan_kmalloc (mm/kasan/common.c:39 mm/kasan/common.c:45 mm/kasan/common.c:436 mm/kasan/common.c:515) [ 253.544533] ? __kasan_kmalloc (mm/kasan/common.c:524) [ 253.544535] ? kmem_cache_alloc_trace (./include/linux/kasan.h:270 mm/slab.c:3567) [ 253.544541] ? io_issue_sqe (fs/io_uring.c:4556 fs/io_uring.c:4589 fs/io_uring.c:6828) [ 253.544544] ? __io_queue_sqe (fs/io_uring.c:?) [ 253.544551] __kasan_kmalloc (mm/kasan/common.c:524) [ 253.544553] kmem_cache_alloc_trace (./include/linux/kasan.h:270 mm/slab.c:3567) [ 253.544556] ? io_issue_sqe (fs/io_uring.c:4556 fs/io_uring.c:4589 fs/io_uring.c:6828) [ 253.544560] io_issue_sqe (fs/io_uring.c:4556 fs/io_uring.c:4589 fs/io_uring.c:6828) [ 253.544564] ? __kasan_slab_alloc (mm/kasan/common.c:45 mm/kasan/common.c:436 mm/kasan/common.c:469) [ 253.544567] ? __kasan_slab_alloc (mm/kasan/common.c:39 mm/kasan/common.c:45 mm/kasan/common.c:436 mm/kasan/common.c:469) [ 253.544569] ? kmem_cache_alloc_bulk (mm/slab.h:732 mm/slab.c:3546) [ 253.544573] ? __io_alloc_req_refill (fs/io_uring.c:2078) [ 253.544578] ? io_submit_sqes (fs/io_uring.c:7441) [ 253.544581] ? __se_sys_io_uring_enter (fs/io_uring.c:10154 fs/io_uring.c:10096) [ 253.544584] ? __x64_sys_io_uring_enter (fs/io_uring.c:10096) [ 253.544587] ? do_syscall_64 (arch/x86/entry/common.c:50 arch/x86/entry/common.c:80) [ 253.544590] ? entry_SYSCALL_64_after_hwframe (??:?) [ 253.544596] __io_queue_sqe (fs/io_uring.c:?) [ 253.544600] io_queue_sqe (fs/io_uring.c:7143) [ 253.544603] io_submit_sqe (fs/io_uring.c:?) [ 253.544608] io_submit_sqes (fs/io_uring.c:?) [ 253.544612] __se_sys_io_uring_enter (fs/io_uring.c:10154 fs/io_uring.c:10096) [ 253.544616] __x64_sys_io_uring_enter (fs/io_uring.c:10096) [ 253.544619] do_syscall_64 (arch/x86/entry/common.c:50 arch/x86/entry/common.c:80) [ 253.544623] entry_SYSCALL_64_after_hwframe (??:?) Fixes: ddf0322db79c ("io_uring: add IORING_OP_PROVIDE_BUFFERS") Signed-off-by: Eric Dumazet Cc: Jens Axboe Cc: Pavel Begunkov Cc: io-uring Reported-by: syzbot Link: https://lore.kernel.org/r/20220215041003.2394784-1-eric.dumazet@gmail.com Signed-off-by: Jens Axboe commit ef57640575406f57f5b3393cf57f457b0ace837e Author: Vladimir Oltean Date: Tue Feb 15 01:42:00 2022 +0200 net: mscc: ocelot: fix use-after-free in ocelot_vlan_del() ocelot_vlan_member_del() will free the struct ocelot_bridge_vlan, so if this is the same as the port's pvid_vlan which we access afterwards, what we're accessing is freed memory. Fix the bug by determining whether to clear ocelot_port->pvid_vlan prior to calling ocelot_vlan_member_del(). Fixes: d4004422f6f9 ("net: mscc: ocelot: track the port pvid using a pointer") Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 9ceaf6f76b203682bb6100e14b3d7da4c0bedde8 Author: Eric Dumazet Date: Mon Feb 14 11:15:53 2022 -0800 bonding: fix data-races around agg_select_timer syzbot reported that two threads might write over agg_select_timer at the same time. Make agg_select_timer atomic to fix the races. BUG: KCSAN: data-race in bond_3ad_initiate_agg_selection / bond_3ad_state_machine_handler read to 0xffff8881242aea90 of 4 bytes by task 1846 on cpu 1: bond_3ad_state_machine_handler+0x99/0x2810 drivers/net/bonding/bond_3ad.c:2317 process_one_work+0x3f6/0x960 kernel/workqueue.c:2307 worker_thread+0x616/0xa70 kernel/workqueue.c:2454 kthread+0x1bf/0x1e0 kernel/kthread.c:377 ret_from_fork+0x1f/0x30 write to 0xffff8881242aea90 of 4 bytes by task 25910 on cpu 0: bond_3ad_initiate_agg_selection+0x18/0x30 drivers/net/bonding/bond_3ad.c:1998 bond_open+0x658/0x6f0 drivers/net/bonding/bond_main.c:3967 __dev_open+0x274/0x3a0 net/core/dev.c:1407 dev_open+0x54/0x190 net/core/dev.c:1443 bond_enslave+0xcef/0x3000 drivers/net/bonding/bond_main.c:1937 do_set_master net/core/rtnetlink.c:2532 [inline] do_setlink+0x94f/0x2500 net/core/rtnetlink.c:2736 __rtnl_newlink net/core/rtnetlink.c:3414 [inline] rtnl_newlink+0xfeb/0x13e0 net/core/rtnetlink.c:3529 rtnetlink_rcv_msg+0x745/0x7e0 net/core/rtnetlink.c:5594 netlink_rcv_skb+0x14e/0x250 net/netlink/af_netlink.c:2494 rtnetlink_rcv+0x18/0x20 net/core/rtnetlink.c:5612 netlink_unicast_kernel net/netlink/af_netlink.c:1317 [inline] netlink_unicast+0x602/0x6d0 net/netlink/af_netlink.c:1343 netlink_sendmsg+0x728/0x850 net/netlink/af_netlink.c:1919 sock_sendmsg_nosec net/socket.c:705 [inline] sock_sendmsg net/socket.c:725 [inline] ____sys_sendmsg+0x39a/0x510 net/socket.c:2413 ___sys_sendmsg net/socket.c:2467 [inline] __sys_sendmsg+0x195/0x230 net/socket.c:2496 __do_sys_sendmsg net/socket.c:2505 [inline] __se_sys_sendmsg net/socket.c:2503 [inline] __x64_sys_sendmsg+0x42/0x50 net/socket.c:2503 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae value changed: 0x00000050 -> 0x0000004f Reported by Kernel Concurrency Sanitizer on: CPU: 0 PID: 25910 Comm: syz-executor.1 Tainted: G W 5.17.0-rc4-syzkaller-dirty #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Eric Dumazet Reported-by: syzbot Cc: Jay Vosburgh Cc: Veaceslav Falico Signed-off-by: David S. Miller commit 07dd44852be89386ab12210df90a2d78779f3bff Author: Radu Bulie Date: Mon Feb 14 19:45:34 2022 +0200 dpaa2-eth: Initialize mutex used in one step timestamping path 1588 Single Step Timestamping code path uses a mutex to enforce atomicity for two events: - update of ptp single step register - transmit ptp event packet Before this patch the mutex was not initialized. This caused unexpected crashes in the Tx function. Fixes: c55211892f463 ("dpaa2-eth: support PTP Sync packet one-step timestamping") Signed-off-by: Radu Bulie Reviewed-by: Ioana Ciornei Signed-off-by: David S. Miller commit 2a36ed7c1cd55742503bed81d2cc0ea83bd0ad0c Author: Tom Rix Date: Mon Feb 14 07:41:39 2022 -0800 dpaa2-switch: fix default return of dpaa2_switch_flower_parse_mirror_key Clang static analysis reports this representative problem dpaa2-switch-flower.c:616:24: warning: The right operand of '==' is a garbage value tmp->cfg.vlan_id == vlan) { ^ ~~~~ vlan is set in dpaa2_switch_flower_parse_mirror_key(). However this function can return success without setting vlan. So change the default return to -EOPNOTSUPP. Fixes: 0f3faece5808 ("dpaa2-switch: add VLAN based mirroring") Signed-off-by: Tom Rix Reviewed-by: Ioana Ciornei Signed-off-by: David S. Miller commit 9d2d38c35e7a3de96340c446f3b0fde7b2e7348e Author: Zhang Yunkai Date: Mon Feb 14 03:27:21 2022 +0000 ipv4: add description about martian source When multiple containers are running in the environment and multiple macvlan network port are configured in each container, a lot of martian source prints will appear after martian_log is enabled. they are almost the same, and printed by net_warn_ratelimited. Each arp message will trigger this print on each network port. Such as: IPv4: martian source 173.254.95.16 from 173.254.100.109, on dev eth0 ll header: 00000000: ff ff ff ff ff ff 40 00 ad fe 64 6d 08 06 ......@...dm.. IPv4: martian source 173.254.95.16 from 173.254.100.109, on dev eth1 ll header: 00000000: ff ff ff ff ff ff 40 00 ad fe 64 6d 08 06 ......@...dm.. There is no description of this kind of source in the RFC1812. Signed-off-by: Zhang Yunkai Signed-off-by: David S. Miller commit 25206111512de994dfc914f5b2972a22aa904ef3 Author: Eric Dumazet Date: Sun Feb 13 11:06:07 2022 -0800 crypto: af_alg - get rid of alg_memory_allocated alg_memory_allocated does not seem to be really used. alg_proto does have a .memory_allocated field, but no corresponding .sysctl_mem. This means sk_has_account() returns true, but all sk_prot_mem_limits() users will trigger a NULL dereference [1]. THis was not a problem until SO_RESERVE_MEM addition. general protection fault, probably for non-canonical address 0xdffffc0000000001: 0000 [#1] PREEMPT SMP KASAN KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f] CPU: 1 PID: 3591 Comm: syz-executor153 Not tainted 5.17.0-rc3-syzkaller-00316-gb81b1829e7e3 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:sk_prot_mem_limits include/net/sock.h:1523 [inline] RIP: 0010:sock_reserve_memory+0x1d7/0x330 net/core/sock.c:1000 Code: 08 00 74 08 48 89 ef e8 27 20 bb f9 4c 03 7c 24 10 48 8b 6d 00 48 83 c5 08 48 89 e8 48 c1 e8 03 48 b9 00 00 00 00 00 fc ff df <80> 3c 08 00 74 08 48 89 ef e8 fb 1f bb f9 48 8b 6d 00 4c 89 ff 48 RSP: 0018:ffffc90001f1fb68 EFLAGS: 00010202 RAX: 0000000000000001 RBX: ffff88814aabc000 RCX: dffffc0000000000 RDX: 0000000000000001 RSI: 0000000000000008 RDI: ffffffff90e18120 RBP: 0000000000000008 R08: dffffc0000000000 R09: fffffbfff21c3025 R10: fffffbfff21c3025 R11: 0000000000000000 R12: ffffffff8d109840 R13: 0000000000001002 R14: 0000000000000001 R15: 0000000000000001 FS: 0000555556e08300(0000) GS:ffff8880b9b00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fc74416f130 CR3: 0000000073d9e000 CR4: 00000000003506e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: sock_setsockopt+0x14a9/0x3a30 net/core/sock.c:1446 __sys_setsockopt+0x5af/0x980 net/socket.c:2176 __do_sys_setsockopt net/socket.c:2191 [inline] __se_sys_setsockopt net/socket.c:2188 [inline] __x64_sys_setsockopt+0xb1/0xc0 net/socket.c:2188 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7fc7440fddc9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 51 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:00007ffe98f07968 EFLAGS: 00000246 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007fc7440fddc9 RDX: 0000000000000049 RSI: 0000000000000001 RDI: 0000000000000004 RBP: 0000000000000000 R08: 0000000000000004 R09: 00007ffe98f07990 R10: 0000000020000000 R11: 0000000000000246 R12: 00007ffe98f0798c R13: 00007ffe98f079a0 R14: 00007ffe98f079e0 R15: 0000000000000000 Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:sk_prot_mem_limits include/net/sock.h:1523 [inline] RIP: 0010:sock_reserve_memory+0x1d7/0x330 net/core/sock.c:1000 Code: 08 00 74 08 48 89 ef e8 27 20 bb f9 4c 03 7c 24 10 48 8b 6d 00 48 83 c5 08 48 89 e8 48 c1 e8 03 48 b9 00 00 00 00 00 fc ff df <80> 3c 08 00 74 08 48 89 ef e8 fb 1f bb f9 48 8b 6d 00 4c 89 ff 48 RSP: 0018:ffffc90001f1fb68 EFLAGS: 00010202 RAX: 0000000000000001 RBX: ffff88814aabc000 RCX: dffffc0000000000 RDX: 0000000000000001 RSI: 0000000000000008 RDI: ffffffff90e18120 RBP: 0000000000000008 R08: dffffc0000000000 R09: fffffbfff21c3025 R10: fffffbfff21c3025 R11: 0000000000000000 R12: ffffffff8d109840 R13: 0000000000001002 R14: 0000000000000001 R15: 0000000000000001 FS: 0000555556e08300(0000) GS:ffff8880b9b00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fc74416f130 CR3: 0000000073d9e000 CR4: 00000000003506e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 Fixes: 2bb2f5fb21b0 ("net: add new socket option SO_RESERVE_MEM") Signed-off-by: Eric Dumazet Cc: Wei Wang Reported-by: syzbot Signed-off-by: David S. Miller commit b465c0dc83be93428eddff82b7bd4479759a0163 Merge: 525b108e6d95b bdc120a2bcd83 Author: David S. Miller Date: Tue Feb 15 14:22:05 2022 +0000 Merge tag 'ieee802154-for-net-2022-02-15' of git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan Stefan Schmidt says: ==================== Only a single fix this time. Miquel Raynal fixed the lifs/sifs periods in the ca82010 to take the actual symbol duration time into account. ==================== Signed-off-by: David S. Miller commit 525b108e6d95b643eccbd84fb10aa9aa101b18dd Author: DENG Qingfang Date: Wed Feb 9 22:39:47 2022 +0800 net: phy: mediatek: remove PHY mode check on MT7531 The function mt7531_phy_mode_supported in the DSA driver set supported mode to PHY_INTERFACE_MODE_GMII instead of PHY_INTERFACE_MODE_INTERNAL for the internal PHY, so this check breaks the PHY initialization: mt7530 mdio-bus:00 wan (uninitialized): failed to connect to PHY: -EINVAL Remove the check to make it work again. Reported-by: Hauke Mehrtens Fixes: e40d2cca0189 ("net: phy: add MediaTek Gigabit Ethernet PHY driver") Signed-off-by: DENG Qingfang Acked-by: Arınç ÜNAL Tested-by: Hauke Mehrtens Signed-off-by: David S. Miller commit 243a1dd7ba48c120986dd9e66fee74bcb7751034 Author: Hongyu Xie Date: Tue Feb 15 14:33:20 2022 +0200 xhci: Prevent futile URB re-submissions due to incorrect return value. The -ENODEV return value from xhci_check_args() is incorrectly changed to -EINVAL in a couple places before propagated further. xhci_check_args() returns 4 types of value, -ENODEV, -EINVAL, 1 and 0. xhci_urb_enqueue and xhci_check_streams_endpoint return -EINVAL if the return value of xhci_check_args <= 0. This causes problems for example r8152_submit_rx, calling usb_submit_urb in drivers/net/usb/r8152.c. r8152_submit_rx will never get -ENODEV after submiting an urb when xHC is halted because xhci_urb_enqueue returns -EINVAL in the very beginning. [commit message and header edit -Mathias] Fixes: 203a86613fb3 ("xhci: Avoid NULL pointer deref when host dies.") Cc: stable@vger.kernel.org Signed-off-by: Hongyu Xie Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20220215123320.1253947-3-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 8b328f8002bcf29ef517ee4bf234e09aabec4d2e Author: Puma Hsu Date: Tue Feb 15 14:33:19 2022 +0200 xhci: re-initialize the HC during resume if HCE was set When HCE(Host Controller Error) is set, it means an internal error condition has been detected. Software needs to re-initialize the HC, so add this check in xhci resume. Cc: stable@vger.kernel.org Signed-off-by: Puma Hsu Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20220215123320.1253947-2-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit d7c93a903f33ff35aa0e6b5a8032eb9755b00826 Author: Hans de Goede Date: Sun Feb 13 14:05:16 2022 +0100 usb: dwc3: pci: Add "snps,dis_u2_susphy_quirk" for Intel Bay Trail Commit e0082698b689 ("usb: dwc3: ulpi: conditionally resume ULPI PHY") fixed an issue where ULPI transfers would timeout if any requests where send to the phy sometime after init, giving it enough time to auto-suspend. Commit e5f4ca3fce90 ("usb: dwc3: ulpi: Fix USB2.0 HS/FS/LS PHY suspend regression") changed the behavior to instead of clearing the DWC3_GUSB2PHYCFG_SUSPHY bit, add an extra sleep when it is set. But on Bay Trail devices, when phy_set_mode() gets called during init, this leads to errors like these: [ 28.451522] tusb1210 dwc3.ulpi: error -110 writing val 0x01 to reg 0x0a [ 28.464089] tusb1210 dwc3.ulpi: error -110 writing val 0x01 to reg 0x0a Add "snps,dis_u2_susphy_quirk" to the settings for Bay Trail devices to fix this. This restores the old behavior for Bay Trail devices, since previously the DWC3_GUSB2PHYCFG_SUSPHY bit would get cleared on the first ulpi_read/_write() and then was never set again. Fixes: e5f4ca3fce90 ("usb: dwc3: ulpi: Fix USB2.0 HS/FS/LS PHY suspend regression") Cc: stable@kernel.org Cc: Serge Semin Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220213130524.18748-2-hdegoede@redhat.com Signed-off-by: Greg Kroah-Hartman commit 038438a25c45d5ac996e95a22fa9e76ff3d1f8c7 Author: Heikki Krogerus Date: Mon Feb 14 17:19:48 2022 +0300 usb: dwc3: pci: add support for the Intel Raptor Lake-S This patch adds the necessary PCI ID for Intel Raptor Lake-S devices. Signed-off-by: Heikki Krogerus Link: https://lore.kernel.org/r/20220214141948.18637-1-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit fe663df7825811358531dc2e8a52d9eaa5e3515e Author: Anders Roxell Date: Fri Feb 11 01:51:13 2022 +0100 powerpc/lib/sstep: fix 'ptesync' build error Building tinyconfig with gcc (Debian 11.2.0-16) and assembler (Debian 2.37.90.20220207) the following build error shows up: {standard input}: Assembler messages: {standard input}:2088: Error: unrecognized opcode: `ptesync' make[3]: *** [/builds/linux/scripts/Makefile.build:287: arch/powerpc/lib/sstep.o] Error 1 Add the 'ifdef CONFIG_PPC64' around the 'ptesync' in function 'emulate_update_regs()' to like it is in 'analyse_instr()'. Since it looks like it got dropped inadvertently by commit 3cdfcbfd32b9 ("powerpc: Change analyse_instr so it doesn't modify *regs"). A key detail is that analyse_instr() will never recognise lwsync or ptesync on 32-bit (because of the existing ifdef), and as a result emulate_update_regs() should never be called with an op specifying either of those on 32-bit. So removing them from emulate_update_regs() should be a nop in terms of runtime behaviour. Fixes: 3cdfcbfd32b9 ("powerpc: Change analyse_instr so it doesn't modify *regs") Cc: stable@vger.kernel.org # v4.14+ Suggested-by: Arnd Bergmann Signed-off-by: Anders Roxell [mpe: Add last paragraph of change log mentioning analyse_instr() details] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220211005113.1361436-1-anders.roxell@linaro.org commit 5de717974005fcad2502281e9f82e139ca91f4bb Author: Wolfram Sang Date: Sat Feb 12 20:47:07 2022 +0100 i2c: qup: allow COMPILE_TEST Driver builds fine with COMPILE_TEST. Enable it for wider test coverage and easier maintenance. Signed-off-by: Wolfram Sang commit 2ce4462f2724d1b3cedccea441c6d18bb360629a Author: Wolfram Sang Date: Sat Feb 12 20:46:57 2022 +0100 i2c: imx: allow COMPILE_TEST Driver builds fine with COMPILE_TEST. Enable it for wider test coverage and easier maintenance. Signed-off-by: Wolfram Sang Acked-by: Oleksij Rempel commit 0b0dcb3882c8f08bdeafa03adb4487e104d26050 Author: Wolfram Sang Date: Sat Feb 12 20:45:48 2022 +0100 i2c: cadence: allow COMPILE_TEST Driver builds fine with COMPILE_TEST. Enable it for wider test coverage and easier maintenance. Signed-off-by: Wolfram Sang Acked-by: Michal Simek commit 455896c53d5b803733ddd84e1bf8a430644439b6 Author: Yongzhi Liu Date: Sat Jan 15 21:34:56 2022 -0800 dmaengine: shdma: Fix runtime PM imbalance on error pm_runtime_get_() increments the runtime PM usage counter even when it returns an error code, thus a matching decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Yongzhi Liu Link: https://lore.kernel.org/r/1642311296-87020-1-git-send-email-lyz_cs@pku.edu.cn Signed-off-by: Vinod Koul commit da2ad87fba0891576aadda9161b8505fde81a84d Author: Jiasheng Jiang Date: Tue Jan 11 09:12:39 2022 +0800 dmaengine: sh: rcar-dmac: Check for error num after dma_set_max_seg_size As the possible failure of the dma_set_max_seg_size(), it should be better to check the return value of the dma_set_max_seg_size(). Fixes: 97d49c59e219 ("dmaengine: rcar-dmac: set scatter/gather max segment size") Reported-by: Geert Uytterhoeven Signed-off-by: Jiasheng Jiang Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20220111011239.452837-1-jiasheng@iscas.ac.cn Signed-off-by: Vinod Koul commit e831c7aba950f3ae94002b10321279654525e5ec Author: Miaoqian Lin Date: Sat Jan 8 08:53:36 2022 +0000 dmaengine: stm32-dmamux: Fix PM disable depth imbalance in stm32_dmamux_probe The pm_runtime_enable will increase power disable depth. If the probe fails, we should use pm_runtime_disable() to balance pm_runtime_enable(). Fixes: 4f3ceca254e0 ("dmaengine: stm32-dmamux: Add PM Runtime support") Signed-off-by: Miaoqian Lin Reviewed-by: Amelie Delaunay Link: https://lore.kernel.org/r/20220108085336.11992-1-linmq006@gmail.com Signed-off-by: Vinod Koul commit 2d21543efe332cd8c8f212fb7d365bc8b0690bfa Author: Jiasheng Jiang Date: Thu Jan 6 11:09:39 2022 +0800 dmaengine: sh: rcar-dmac: Check for error num after setting mask Because of the possible failure of the dma_supported(), the dma_set_mask_and_coherent() may return error num. Therefore, it should be better to check it and return the error if fails. Fixes: dc312349e875 ("dmaengine: rcar-dmac: Widen DMA mask to 40 bits") Signed-off-by: Jiasheng Jiang Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20220106030939.2644320-1-jiasheng@iscas.ac.cn Signed-off-by: Vinod Koul commit aa7accb7f91c4c2c98bfdde62446d96ecc1ef2c6 Author: Yang Yingliang Date: Fri Jan 7 10:40:47 2022 +0800 dmaengine: at_xdmac: Fix missing unlock in at_xdmac_tasklet() Add the missing unlock before return from at_xdmac_tasklet(). Fixes: e77e561925df ("dmaengine: at_xdmac: Fix race over irq_status") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Reviewed-by: Tudor Ambarus Link: https://lore.kernel.org/r/20220107024047.1051915-1-yangyingliang@huawei.com Signed-off-by: Vinod Koul commit 032062f363b4bf02b1d547f329aa5d97b6a17410 Author: Jon Maloy Date: Sun Feb 13 20:38:52 2022 -0500 tipc: fix wrong publisher node address in link publications When a link comes up we add its presence to the name table to make it possible for users to subscribe for link up/down events. However, after a previous call signature change the binding is wrongly published with the peer node as publishing node, instead of the own node as it should be. This has the effect that the command 'tipc name table show' will list the link binding (service type 2) with node scope and a peer node as originator, something that obviously is impossible. We correct this bug here. Fixes: 50a3499ab853 ("tipc: simplify signature of tipc_namtbl_publish()") Signed-off-by: Jon Maloy Link: https://lore.kernel.org/r/20220214013852.2803940-1-jmaloy@redhat.com Signed-off-by: Jakub Kicinski commit 3c62fd3406e0b2277c76a6984d3979c7f3f1d129 Author: Christophe JAILLET Date: Sat Feb 5 07:58:44 2022 +0100 dmaengine: ptdma: Fix the error handling path in pt_core_init() In order to free resources correctly in the error handling path of pt_core_init(), 2 goto's have to be switched. Otherwise, some resources will leak and we will try to release things that have not been allocated yet. Also move a dev_err() to a place where it is more meaningful. Fixes: fa5d823b16a9 ("dmaengine: ptdma: Initial driver for the AMD PTDMA") Signed-off-by: Christophe JAILLET Acked-by: Sanjay R Mehta Reviewed-by: Dan Carpenter Link: https://lore.kernel.org/r/41a963a35173f89c874f5c44df5530dc09fea8da.1644044244.git.christophe.jaillet@wanadoo.fr Signed-off-by: Vinod Koul commit 382e3e0eb6a83f1cf73d4dfa3448ade1ed721f22 Author: Steev Klimaszewski Date: Thu Nov 4 22:52:32 2021 -0500 arm64: dts: qcom: c630: disable crypto due to serror Disable the crypto block due to it causing an SError in qce_start() on the C630, which happens upon every boot when cryptomanager tests are enabled. Signed-off-by: Steev Klimaszewski [bjorn: Reworked commit message] Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211105035235.2392-1-steev@kali.org commit 10af115646171afc0217177d6eae92917b785897 Author: Jinyoung Choi Date: Mon Feb 14 19:33:52 2022 +0900 scsi: ufs: core: Fix divide by zero in ufshcd_map_queues() Before calling blk_mq_map_queues(), the mq_map and nr_queues belonging to struct blk_mq_queue_map must have a valid value. If nr_queues is set to 0, the system may encounter a divide by zero depending on the type of architecture. blk_mq_map_queues() -> queue_index() Link: https://lore.kernel.org/r/1891546521.01644873481638.JavaMail.epsvc@epcpadp4 Reviewed-by: Bart Van Assche Signed-off-by: Jinyoung Choi Signed-off-by: Martin K. Petersen commit 7f4c5a26f735dea4bbc0eb8eb9da99cda95a8563 Author: James Smart Date: Sat Feb 12 08:31:20 2022 -0800 scsi: lpfc: Fix pt2pt NVMe PRLI reject LOGO loop When connected point to point, the driver does not know the FC4's supported by the other end. In Fabrics, it can query the nameserver. Thus the driver must send PRLIs for the FC4s it supports and enable support based on the acc(ept) or rej(ect) of the respective FC4 PRLI. Currently the driver supports SCSI and NVMe PRLIs. Unfortunately, although the behavior is per standard, many devices have come to expect only SCSI PRLIs. In this particular example, the NVMe PRLI is properly RJT'd but the target decided that it must LOGO after seeing the unexpected NVMe PRLI. The LOGO causes the sequence to restart and login is now in an infinite failure loop. Fix the problem by having the driver, on a pt2pt link, remember NVMe PRLI accept or reject status across logout as long as the link stays "up". When retrying login, if the prior NVMe PRLI was rejected, it will not be sent on the next login. Link: https://lore.kernel.org/r/20220212163120.15385-1-jsmart2021@gmail.com Cc: # v5.4+ Reviewed-by: Ewan D. Milne Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 6fec1ab67f8d60704cc7de64abcfd389ab131542 Author: Krzysztof Kozlowski Date: Mon Feb 14 09:36:57 2022 +0100 selftests/ftrace: Do not trace do_softirq because of PREEMPT_RT The PREEMPT_RT patchset does not use do_softirq() function thus trying to filter for do_softirq fails for such kernel: echo do_softirq ftracetest: 81: echo: echo: I/O error Choose some other visible function for the test. The function does not have to be actually executed during the test, because it is only testing filter API interface. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Shuah Khan Acked-by: Sebastian Andrzej Siewior Reviewed-by: Steven Rostedt (Google) Signed-off-by: Shuah Khan commit 5feef64f4c67068c49f5409d43c67cabf2327f66 Author: Geert Uytterhoeven Date: Mon Jan 31 14:26:22 2022 +0100 RISC-V: Fix IPI/RFENCE hmask on non-monotonic hartid ordering If the boot CPU does not have the lowest hartid, "hartid - hbase" can become negative, leading to an incorrect hmask, causing userspace to crash with SEGV. This is observed on e.g. Starlight Beta, where cpuid 1 maps to hartid 0, and cpuid 0 maps to hartid 1. Fix this by detecting this case, and shifting the accumulated mask and updating hbase, if possible. Fixes: 26fb751ca37846c9 ("RISC-V: Do not use cpumask data structure for hartid bitmap") Signed-off-by: Geert Uytterhoeven Reviewed-by: Atish Patra Tested-by: Atish Patra Signed-off-by: Palmer Dabbelt commit 2b35d5b7d13062b805aa82dc53812a5f56249287 Author: Geert Uytterhoeven Date: Mon Jan 31 14:26:21 2022 +0100 RISC-V: Fix handling of empty cpu masks The cpumask rework slightly changed the behavior of the code. Fix this by treating an empty cpumask as meaning all online CPUs. Extracted from a patch by Atish Patra . Reported-by: Jessica Clarke Fixes: 26fb751ca37846c9 ("RISC-V: Do not use cpumask data structure for hartid bitmap") Signed-off-by: Geert Uytterhoeven Reviewed-by: Atish Patra Signed-off-by: Palmer Dabbelt commit 12f4a665cc3568328728e46c3162873b5b69cd27 Author: Geert Uytterhoeven Date: Mon Jan 31 14:26:20 2022 +0100 RISC-V: Fix hartid mask handling for hartid 31 and up Jessica reports that using "1 << hartid" causes undefined behavior for hartid 31 and up. Fix this by using the BIT() helper instead of an explicit shift. Reported-by: Jessica Clarke Fixes: 26fb751ca37846c9 ("RISC-V: Do not use cpumask data structure for hartid bitmap") Signed-off-by: Geert Uytterhoeven Reviewed-by: Atish Patra Signed-off-by: Palmer Dabbelt commit 364438fd629f7611a84c8e6d7de91659300f1502 Author: Nicholas Bishop Date: Fri Feb 11 14:57:39 2022 -0500 drm/radeon: Fix backlight control on iMac 12,1 The iMac 12,1 does not use the gmux driver for backlight, so the radeon backlight device is needed to set the brightness. Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1838 Signed-off-by: Nicholas Bishop Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 9c4f59ea3f865693150edf0c91d1cc6b451360dd Author: Yifan Zhang Date: Fri Feb 11 17:58:08 2022 +0800 drm/amd/pm: correct the sequence of sending gpu reset msg the 2nd parameter should be smu msg type rather than asic msg index. Fixes: 7d38d9dc4ecc ("drm/amdgpu: add mode2 reset support for yellow carp") Signed-off-by: Yifan Zhang Acked-by: Aaron Liu Reviewed-by: Huang Rui Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit f8f4e2a518347063179def4e64580b2d28233d03 Author: Rajib Mahapatra Date: Thu Feb 10 18:46:40 2022 +0530 drm/amdgpu: skipping SDMA hw_init and hw_fini for S0ix. [Why] SDMA ring buffer test failed if suspend is aborted during S0i3 resume. [How] If suspend is aborted for some reason during S0i3 resume cycle, it follows SDMA ring test failing and errors in amdgpu resume. For RN/CZN/Picasso, SMU saves and restores SDMA registers during S0ix cycle. So, skipping SDMA suspend and resume from driver solves the issue. This time, the system is able to resume gracefully even the suspend is aborted. Reviewed-by: Mario Limonciello Reviewed-by: Alex Deucher Signed-off-by: Rajib Mahapatra Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 0136f5844b006e2286f873457c3fcba8c45a3735 Author: Evan Quan Date: Tue Jan 18 14:07:51 2022 +0800 drm/amd/pm: correct UMD pstate clocks for Dimgrey Cavefish and Beige Goby Correct the UMD pstate profiling clocks for Dimgrey Cavefish and Beige Goby. Signed-off-by: Evan Quan Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit e0caaf75d443e02e55e146fd75fe2efc8aed5540 Author: Trond Myklebust Date: Tue Feb 8 13:38:23 2022 -0500 NFS: LOOKUP_DIRECTORY is also ok with symlinks Commit ac795161c936 (NFSv4: Handle case where the lookup of a directory fails) [1], part of Linux since 5.17-rc2, introduced a regression, where a symbolic link on an NFS mount to a directory on another NFS does not resolve(?) the first time it is accessed: Reported-by: Paul Menzel Fixes: ac795161c936 ("NFSv4: Handle case where the lookup of a directory fails") Signed-off-by: Trond Myklebust Tested-by: Donald Buczek Signed-off-by: Anna Schumaker commit 9d047bf68fe8cdb4086deaf4edd119731a9481ed Author: Trond Myklebust Date: Tue Feb 8 12:14:44 2022 -0500 NFS: Remove an incorrect revalidation in nfs4_update_changeattr_locked() In nfs4_update_changeattr_locked(), we don't need to set the NFS_INO_REVAL_PAGECACHE flag, because we already know the value of the change attribute, and we're already flagging the size. In fact, this forces us to revalidate the change attribute a second time for no good reason. This extra flag appears to have been introduced as part of the xattr feature, when update_changeattr_locked() was converted for use by the xattr code. Fixes: 1b523ca972ed ("nfs: modify update_changeattr to deal with regular files") Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit 05c7b7a92cc87ff8d7fde189d0fade250697573c Author: Zhang Qiao Date: Fri Jan 21 18:12:10 2022 +0800 cgroup/cpuset: Fix a race between cpuset_attach() and cpu hotplug As previously discussed(https://lkml.org/lkml/2022/1/20/51), cpuset_attach() is affected with similar cpu hotplug race, as follow scenario: cpuset_attach() cpu hotplug --------------------------- ---------------------- down_write(cpuset_rwsem) guarantee_online_cpus() // (load cpus_attach) sched_cpu_deactivate set_cpu_active() // will change cpu_active_mask set_cpus_allowed_ptr(cpus_attach) __set_cpus_allowed_ptr_locked() // (if the intersection of cpus_attach and cpu_active_mask is empty, will return -EINVAL) up_write(cpuset_rwsem) To avoid races such as described above, protect cpuset_attach() call with cpu_hotplug_lock. Fixes: be367d099270 ("cgroups: let ss->can_attach and ss->attach do whole threadgroups at a time") Cc: stable@vger.kernel.org # v2.6.32+ Reported-by: Zhao Gongyi Signed-off-by: Zhang Qiao Acked-by: Waiman Long Reviewed-by: Michal Koutný Signed-off-by: Tejun Heo commit 0bc2ba49101f4ca35e0c878968adb5660ffa2517 Author: Jiri Olsa Date: Tue Feb 8 23:11:17 2022 +0100 MAINTAINERS: Update Jiri's email address Using my kernel.org email. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20220208221117.710405-1-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 4f6de676d94ee8ddfc2e7e7cd935fc7cb2feff3a Author: Joakim Tjernlund Date: Mon Feb 14 18:56:43 2022 +0100 arm64: Correct wrong label in macro __init_el2_gicv3 In commit: 114945d84a30a5fe ("arm64: Fix labels in el2_setup macros") We renamed a label from '1' to '.Lskip_gicv3_\@', but failed to update a branch to it, which now targets a later label also called '1'. The branch is taken rarely, when GICv3 is present but SRE is disabled at EL3, causing a boot-time crash. Update the caller to the new label name. Fixes: 114945d84a30 ("arm64: Fix labels in el2_setup macros") Cc: # 5.12.x Signed-off-by: Joakim Tjernlund Link: https://lore.kernel.org/r/20220214175643.21931-1-joakim.tjernlund@infinera.com Reviewed-by: Mark Rutland Reviewed-by: Marc Zyngier Signed-off-by: Catalin Marinas commit 6e8793674bb0d1135ca0e5c9f7e16fecbf815926 Author: Randy Dunlap Date: Mon Feb 14 10:00:19 2022 -0800 serial: parisc: GSC: fix build when IOSAPIC is not set There is a build error when using a kernel .config file from 'kernel test robot' for a different build problem: hppa64-linux-ld: drivers/tty/serial/8250/8250_gsc.o: in function `.LC3': (.data.rel.ro+0x18): undefined reference to `iosapic_serial_irq' when: CONFIG_GSC=y CONFIG_SERIO_GSCPS2=y CONFIG_SERIAL_8250_GSC=y CONFIG_PCI is not set and hence PCI_LBA is not set. IOSAPIC depends on PCI_LBA, so IOSAPIC is not set/enabled. Make the use of iosapic_serial_irq() conditional to fix the build error. Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: "James E.J. Bottomley" Cc: Helge Deller Cc: linux-parisc@vger.kernel.org Cc: Greg Kroah-Hartman Cc: linux-serial@vger.kernel.org Cc: Jiri Slaby Cc: Johan Hovold Suggested-by: Helge Deller Signed-off-by: Helge Deller Cc: stable@vger.kernel.org Signed-off-by: Helge Deller commit 21bffcb76ee2fbafc7d5946cef10abc9df5cfff7 Author: Sherry Yang Date: Thu Feb 10 12:30:49 2022 -0800 selftests/seccomp: Fix seccomp failure by adding missing headers seccomp_bpf failed on tests 47 global.user_notification_filter_empty and 48 global.user_notification_filter_empty_threaded when it's tested on updated kernel but with old kernel headers. Because old kernel headers don't have definition of macro __NR_clone3 which is required for these two tests. Since under selftests/, we can install headers once for all tests (the default INSTALL_HDR_PATH is usr/include), fix it by adding usr/include to the list of directories to be searched. Use "-isystem" to indicate it's a system directory as the real kernel headers directories are. Signed-off-by: Sherry Yang Tested-by: Sherry Yang Reviewed-by: Kees Cook Signed-off-by: Shuah Khan commit d567f5db412ed52de0b3b3efca4a451263de6108 Merge: 754e0b0e35608 4e2a354e37758 Author: Linus Torvalds Date: Mon Feb 14 09:51:26 2022 -0800 Merge tag 'regulator-fix-v5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator Pull regulator fix from Mark Brown: "One fix here, for initialisation of regulators that don't have an in_enabled() operation which would mainly impact cases where they aren't otherwise used during early setup for some reason" * tag 'regulator-fix-v5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: regulator: core: fix false positive in regulator_late_cleanup() commit 5948342a526f43ffbd02ebac64670e55475b7e09 Merge: 2a845837e3d0d a887f9c7a4d37 Author: Takashi Iwai Date: Mon Feb 14 17:55:39 2022 +0100 Merge tag 'asoc-fix-v5.17-rc4' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v5.18 More fixes that have arrived in the past few -rcs, plus a MAINTAINERS update. The biggest update here is the fix for control change notifications in ASoC generic controls found by mixer-test. commit 0c6f4ebf8835d01866eb686d47578cde80097981 Author: Ronnie Sahlberg Date: Mon Feb 14 08:40:52 2022 +1000 cifs: modefromsids must add an ACE for authenticated users When we create a file with modefromsids we set an ACL that has one ACE for the magic modefromsid as well as a second ACE that grants full access to all authenticated users. When later we chante the mode on the file we strip away this, and other, ACE for authenticated users in set_chmod_dacl() and then just add back/update the modefromsid ACE. Thus leaving the file with a single ACE that is for the mode and no ACE to grant any user any rights to access the file. Fix this by always adding back also the modefromsid ACE so that we do not drop the rights to access the file. Signed-off-by: Ronnie Sahlberg Reviewed-by: Shyam Prasad N Signed-off-by: Steve French commit c49ae619905eebd3f54598a84e4cd2bd58ba8fe9 Author: Pali Rohár Date: Mon Feb 14 12:02:28 2022 +0100 PCI: mvebu: Fix device enumeration regression Jan reported that on Turris Omnia (Armada 385), no PCIe devices were detected after upgrading from v5.16.1 to v5.16.3 and identified the cause as the backport of 91a8d79fc797 ("PCI: mvebu: Fix configuring secondary bus of PCIe Root Port via emulated bridge"), which appeared in v5.17-rc1. 91a8d79fc797 was incorrectly applied from mailing list patch [1] to the linux git repository [2] probably due to resolving merge conflicts incorrectly. Fix it now. [1] https://lore.kernel.org/r/20211125124605.25915-12-pali@kernel.org [2] https://git.kernel.org/linus/91a8d79fc797 [bhelgaas: commit log] BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=215540 Fixes: 91a8d79fc797 ("PCI: mvebu: Fix configuring secondary bus of PCIe Root Port via emulated bridge") Link: https://lore.kernel.org/r/20220214110228.25825-1-pali@kernel.org Link: https://lore.kernel.org/r/20220127234917.GA150851@bhelgaas Reported-by: Jan Palus Signed-off-by: Pali Rohár Signed-off-by: Bjorn Helgaas commit 7f016b35ca7623c71b31facdde080e8ce171a697 Author: Basavaraj Natikar Date: Tue Feb 8 17:51:12 2022 +0530 HID: amd_sfh: Add interrupt handler to process interrupts On newer AMD platforms with SFH, it is observed that random interrupts get generated on the SFH hardware and until this is cleared the firmware sensor processing is stalled, resulting in no data been received to driver side. Add routines to handle these interrupts, so that firmware operations are not stalled. Signed-off-by: Basavaraj Natikar Signed-off-by: Jiri Kosina commit fb75a3791a8032848c987db29b622878d8fe2b1c Author: Basavaraj Natikar Date: Tue Feb 8 17:51:11 2022 +0530 HID: amd_sfh: Add functionality to clear interrupts Newer AMD platforms with SFH may generate interrupts on some events which are unwarranted. Until this is cleared the actual MP2 data processing maybe stalled in some cases. Add a mechanism to clear the pending interrupts (if any) during the driver initialization and sensor command operations. Signed-off-by: Basavaraj Natikar Signed-off-by: Jiri Kosina commit b300667b33b2b5a2c8e5f8f22826befb3d7f4f2b Author: Basavaraj Natikar Date: Tue Feb 8 17:51:10 2022 +0530 HID: amd_sfh: Disable the interrupt for all command Sensor data is processed in polling mode. Hence disable the interrupt for all sensor command. Signed-off-by: Basavaraj Natikar Signed-off-by: Jiri Kosina commit aa0b724a2bf041036e56cbb3b4b3afde7c5e7c9e Author: Basavaraj Natikar Date: Tue Feb 8 17:51:09 2022 +0530 HID: amd_sfh: Correct the structure field name Misinterpreted intr_enable field name. Hence correct the structure field name accordingly to reflect the functionality. Fixes: f264481ad614 ("HID: amd_sfh: Extend driver capabilities for multi-generation support") Signed-off-by: Basavaraj Natikar Signed-off-by: Jiri Kosina commit 0cf74235f4403b760a37f77271d2ca3424001ff9 Author: Basavaraj Natikar Date: Tue Feb 8 17:51:08 2022 +0530 HID: amd_sfh: Handle amd_sfh work buffer in PM ops Since in the current amd_sfh design the sensor data is periodically obtained in the form of poll data, during the suspend/resume cycle, scheduling a delayed work adds no value. So, cancel the work and restart back during the suspend/resume cycle respectively. Signed-off-by: Basavaraj Natikar Signed-off-by: Jiri Kosina commit 6605cc67ca18b9d583eb96e18a20f5f4e726103c Author: Oliver Neukum Date: Mon Feb 14 15:08:18 2022 +0100 USB: zaurus: support another broken Zaurus This SL-6000 says Direct Line, not Ethernet v2: added Reporter and Link Signed-off-by: Oliver Neukum Reported-by: Ross Maynard Link: https://bugzilla.kernel.org/show_bug.cgi?id=215361 Signed-off-by: David S. Miller commit 603c692d574185a1fffc9549e8e30f27bd7dba6c Author: Nikolay Aleksandrov Date: Mon Feb 14 13:23:32 2022 +0200 MAINTAINERS: bridge: update my email I'm leaving NVIDIA and my email account will stop working in a week, update it with my personal account. Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 0fc95dec096c2133942c382396172ae4487b4d57 Author: Alex Maydanik Date: Sat Feb 12 12:29:27 2022 +0200 net: fix documentation for kernel_getsockname Fixes return value documentation of kernel_getsockname() and kernel_getpeername() functions. The previous documentation wrongly specified that the return value is 0 in case of success, however sock->ops->getname returns the length of the address in bytes in case of success. Signed-off-by: Alex Maydanik Signed-off-by: David S. Miller commit 5891cd5ec46c2c2eb6427cb54d214b149635dd0e Author: Eric Dumazet Date: Fri Feb 11 12:06:23 2022 -0800 net_sched: add __rcu annotation to netdev->qdisc syzbot found a data-race [1] which lead me to add __rcu annotations to netdev->qdisc, and proper accessors to get LOCKDEP support. [1] BUG: KCSAN: data-race in dev_activate / qdisc_lookup_rcu write to 0xffff888168ad6410 of 8 bytes by task 13559 on cpu 1: attach_default_qdiscs net/sched/sch_generic.c:1167 [inline] dev_activate+0x2ed/0x8f0 net/sched/sch_generic.c:1221 __dev_open+0x2e9/0x3a0 net/core/dev.c:1416 __dev_change_flags+0x167/0x3f0 net/core/dev.c:8139 rtnl_configure_link+0xc2/0x150 net/core/rtnetlink.c:3150 __rtnl_newlink net/core/rtnetlink.c:3489 [inline] rtnl_newlink+0xf4d/0x13e0 net/core/rtnetlink.c:3529 rtnetlink_rcv_msg+0x745/0x7e0 net/core/rtnetlink.c:5594 netlink_rcv_skb+0x14e/0x250 net/netlink/af_netlink.c:2494 rtnetlink_rcv+0x18/0x20 net/core/rtnetlink.c:5612 netlink_unicast_kernel net/netlink/af_netlink.c:1317 [inline] netlink_unicast+0x602/0x6d0 net/netlink/af_netlink.c:1343 netlink_sendmsg+0x728/0x850 net/netlink/af_netlink.c:1919 sock_sendmsg_nosec net/socket.c:705 [inline] sock_sendmsg net/socket.c:725 [inline] ____sys_sendmsg+0x39a/0x510 net/socket.c:2413 ___sys_sendmsg net/socket.c:2467 [inline] __sys_sendmsg+0x195/0x230 net/socket.c:2496 __do_sys_sendmsg net/socket.c:2505 [inline] __se_sys_sendmsg net/socket.c:2503 [inline] __x64_sys_sendmsg+0x42/0x50 net/socket.c:2503 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae read to 0xffff888168ad6410 of 8 bytes by task 13560 on cpu 0: qdisc_lookup_rcu+0x30/0x2e0 net/sched/sch_api.c:323 __tcf_qdisc_find+0x74/0x3a0 net/sched/cls_api.c:1050 tc_del_tfilter+0x1c7/0x1350 net/sched/cls_api.c:2211 rtnetlink_rcv_msg+0x5ba/0x7e0 net/core/rtnetlink.c:5585 netlink_rcv_skb+0x14e/0x250 net/netlink/af_netlink.c:2494 rtnetlink_rcv+0x18/0x20 net/core/rtnetlink.c:5612 netlink_unicast_kernel net/netlink/af_netlink.c:1317 [inline] netlink_unicast+0x602/0x6d0 net/netlink/af_netlink.c:1343 netlink_sendmsg+0x728/0x850 net/netlink/af_netlink.c:1919 sock_sendmsg_nosec net/socket.c:705 [inline] sock_sendmsg net/socket.c:725 [inline] ____sys_sendmsg+0x39a/0x510 net/socket.c:2413 ___sys_sendmsg net/socket.c:2467 [inline] __sys_sendmsg+0x195/0x230 net/socket.c:2496 __do_sys_sendmsg net/socket.c:2505 [inline] __se_sys_sendmsg net/socket.c:2503 [inline] __x64_sys_sendmsg+0x42/0x50 net/socket.c:2503 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae value changed: 0xffffffff85dee080 -> 0xffff88815d96ec00 Reported by Kernel Concurrency Sanitizer on: CPU: 0 PID: 13560 Comm: syz-executor.2 Not tainted 5.17.0-rc3-syzkaller-00116-gf1baf68e1383-dirty #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Fixes: 470502de5bdb ("net: sched: unlock rules update API") Signed-off-by: Eric Dumazet Cc: Vlad Buslov Reported-by: syzbot Cc: Jamal Hadi Salim Cc: Cong Wang Cc: Jiri Pirko Signed-off-by: David S. Miller commit a2614140dc0f467a83aa3bb4b6ee2d6480a76202 Author: Vladimir Oltean Date: Fri Feb 11 19:45:06 2022 +0200 net: dsa: mv88e6xxx: flush switchdev FDB workqueue before removing VLAN mv88e6xxx is special among DSA drivers in that it requires the VTU to contain the VID of the FDB entry it modifies in mv88e6xxx_port_db_load_purge(), otherwise it will return -EOPNOTSUPP. Sometimes due to races this is not always satisfied even if external code does everything right (first deletes the FDB entries, then the VLAN), because DSA commits to hardware FDB entries asynchronously since commit c9eb3e0f8701 ("net: dsa: Add support for learning FDB through notification"). Therefore, the mv88e6xxx driver must close this race condition by itself, by asking DSA to flush the switchdev workqueue of any FDB deletions in progress, prior to exiting a VLAN. Fixes: c9eb3e0f8701 ("net: dsa: Add support for learning FDB through notification") Reported-by: Rafael Richter Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 26394fc118d6115390bd5b3a0fb17096271da227 Author: Ignat Korchagin Date: Fri Feb 11 17:30:42 2022 +0000 ipv6: mcast: use rcu-safe version of ipv6_get_lladdr() Some time ago 8965779d2c0e ("ipv6,mcast: always hold idev->lock before mca_lock") switched ipv6_get_lladdr() to __ipv6_get_lladdr(), which is rcu-unsafe version. That was OK, because idev->lock was held for these codepaths. In 88e2ca308094 ("mld: convert ifmcaddr6 to RCU") these external locks were removed, so we probably need to restore the original rcu-safe call. Otherwise, we occasionally get a machine crashed/stalled with the following in dmesg: [ 3405.966610][T230589] general protection fault, probably for non-canonical address 0xdead00000000008c: 0000 [#1] SMP NOPTI [ 3405.982083][T230589] CPU: 44 PID: 230589 Comm: kworker/44:3 Tainted: G O 5.15.19-cloudflare-2022.2.1 #1 [ 3405.998061][T230589] Hardware name: SUPA-COOL-SERV [ 3406.009552][T230589] Workqueue: mld mld_ifc_work [ 3406.017224][T230589] RIP: 0010:__ipv6_get_lladdr+0x34/0x60 [ 3406.025780][T230589] Code: 57 10 48 83 c7 08 48 89 e5 48 39 d7 74 3e 48 8d 82 38 ff ff ff eb 13 48 8b 90 d0 00 00 00 48 8d 82 38 ff ff ff 48 39 d7 74 22 <66> 83 78 32 20 77 1b 75 e4 89 ca 23 50 2c 75 dd 48 8b 50 08 48 8b [ 3406.055748][T230589] RSP: 0018:ffff94e4b3fc3d10 EFLAGS: 00010202 [ 3406.065617][T230589] RAX: dead00000000005a RBX: ffff94e4b3fc3d30 RCX: 0000000000000040 [ 3406.077477][T230589] RDX: dead000000000122 RSI: ffff94e4b3fc3d30 RDI: ffff8c3a31431008 [ 3406.089389][T230589] RBP: ffff94e4b3fc3d10 R08: 0000000000000000 R09: 0000000000000000 [ 3406.101445][T230589] R10: ffff8c3a31430000 R11: 000000000000000b R12: ffff8c2c37887100 [ 3406.113553][T230589] R13: ffff8c3a39537000 R14: 00000000000005dc R15: ffff8c3a31431000 [ 3406.125730][T230589] FS: 0000000000000000(0000) GS:ffff8c3b9fc80000(0000) knlGS:0000000000000000 [ 3406.138992][T230589] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 3406.149895][T230589] CR2: 00007f0dfea1db60 CR3: 000000387b5f2000 CR4: 0000000000350ee0 [ 3406.162421][T230589] Call Trace: [ 3406.170235][T230589] [ 3406.177736][T230589] mld_newpack+0xfe/0x1a0 [ 3406.186686][T230589] add_grhead+0x87/0xa0 [ 3406.195498][T230589] add_grec+0x485/0x4e0 [ 3406.204310][T230589] ? newidle_balance+0x126/0x3f0 [ 3406.214024][T230589] mld_ifc_work+0x15d/0x450 [ 3406.223279][T230589] process_one_work+0x1e6/0x380 [ 3406.232982][T230589] worker_thread+0x50/0x3a0 [ 3406.242371][T230589] ? rescuer_thread+0x360/0x360 [ 3406.252175][T230589] kthread+0x127/0x150 [ 3406.261197][T230589] ? set_kthread_struct+0x40/0x40 [ 3406.271287][T230589] ret_from_fork+0x22/0x30 [ 3406.280812][T230589] [ 3406.288937][T230589] Modules linked in: ... [last unloaded: kheaders] [ 3406.476714][T230589] ---[ end trace 3525a7655f2f3b9e ]--- Fixes: 88e2ca308094 ("mld: convert ifmcaddr6 to RCU") Reported-by: David Pinilla Caparros Signed-off-by: Ignat Korchagin Signed-off-by: David S. Miller commit 2a845837e3d0ddaed493b4c5c4643d7f0542804d Author: Takashi Iwai Date: Mon Feb 14 14:04:10 2022 +0100 ALSA: hda/realtek: Fix deadlock by COEF mutex The recently introduced coef_mutex for Realtek codec seems causing a deadlock when the relevant code is invoked from the power-off state; then the HD-audio core tries to power-up internally, and this kicks off the codec runtime PM code that tries to take the same coef_mutex. In order to avoid the deadlock, do the temporary power up/down around the coef_mutex acquisition and release. This assures that the power-up sequence runs before the mutex, hence no re-entrance will happen. Fixes: b837a9f5ab3b ("ALSA: hda: realtek: Fix race at concurrent COEF updates") Reported-and-tested-by: Julian Wollrath Cc: Link: https://lore.kernel.org/r/20220214132838.4db10fca@schienar Link: https://lore.kernel.org/r/20220214130410.21230-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 9a5adeb28b77416446658e75bdef3bbe5fb92a83 Author: Takashi Iwai Date: Mon Feb 14 13:57:11 2022 +0100 ALSA: usb-audio: Don't abort resume upon errors The default mixer resume code treats the errors at restoring the modified mixer items as a fatal error, and it returns back to the caller. This ends up in the resume failure, and the device will be come unavailable, although basically those errors are intermittent and can be safely ignored. The problem itself has been present from the beginning, but it didn't hit usually because the code tries to resume only the modified items. But now with the recent commit to forcibly initialize each item at the probe time, the problem surfaced more often, hence it appears as a regression. This patch fixes the regression simply by ignoring the errors at resume. Fixes: b96681bd5827 ("ALSA: usb-audio: Initialize every feature unit once at probe time") Cc: BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=215561 Link: https://lore.kernel.org/r/20220214125711.20531-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 710c476514313c74045c41c0571bb5178fd16e3d Author: Jim Mattson Date: Wed Feb 2 17:48:13 2022 -0800 KVM: x86/pmu: Use AMD64_RAW_EVENT_MASK for PERF_TYPE_RAW AMD's event select is 3 nybbles, with the high nybble in bits 35:32 of a PerfEvtSeln MSR. Don't mask off the high nybble when configuring a RAW perf event. Fixes: ca724305a2b0 ("KVM: x86/vPMU: Implement AMD vPMU code for KVM") Signed-off-by: Jim Mattson Message-Id: <20220203014813.2130559-2-jmattson@google.com> Reviewed-by: David Dunn Signed-off-by: Paolo Bonzini commit b8bfee85f1307426e0242d654f3a14c06ef639c5 Author: Jim Mattson Date: Wed Feb 2 17:48:12 2022 -0800 KVM: x86/pmu: Don't truncate the PerfEvtSeln MSR when creating a perf event AMD's event select is 3 nybbles, with the high nybble in bits 35:32 of a PerfEvtSeln MSR. Don't drop the high nybble when setting up the config field of a perf_event_attr structure for a call to perf_event_create_kernel_counter(). Fixes: ca724305a2b0 ("KVM: x86/vPMU: Implement AMD vPMU code for KVM") Reported-by: Stephane Eranian Signed-off-by: Jim Mattson Message-Id: <20220203014813.2130559-1-jmattson@google.com> Reviewed-by: David Dunn Signed-off-by: Paolo Bonzini commit 6b0b2d9a6a308bcd9300c2d83000a82812c56cea Author: Suravee Suthikulpanit Date: Thu Feb 10 09:47:45 2022 -0600 iommu/amd: Fix I/O page table memory leak The current logic updates the I/O page table mode for the domain before calling the logic to free memory used for the page table. This results in IOMMU page table memory leak, and can be observed when launching VM w/ pass-through devices. Fix by freeing the memory used for page table before updating the mode. Cc: Joerg Roedel Reported-by: Daniel Jordan Tested-by: Daniel Jordan Signed-off-by: Suravee Suthikulpanit Fixes: e42ba0633064 ("iommu/amd: Restructure code for freeing page table") Link: https://lore.kernel.org/all/20220118194720.urjgi73b7c3tq2o6@oracle.com/ Link: https://lore.kernel.org/r/20220210154745.11524-1-suravee.suthikulpanit@amd.com Signed-off-by: Joerg Roedel commit 40eb0dcf4114cbfff4d207890fa5a19e82da9fdc Author: Yang Yingliang Date: Thu Feb 10 17:10:53 2022 +0800 tee: optee: fix error return code in probe function If teedev_open() fails, probe function need return error code. Fixes: aceeafefff73 ("optee: use driver internal tee_context for some rpc") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Signed-off-by: Jens Wiklander commit dbd0b42350d5717786cb8257fbe5b528f3af9772 Author: Helge Deller Date: Sun Feb 13 22:52:11 2022 +0100 parisc: Fix some apparent put_user() failures After commit 4b9d2a731c3d ("parisc: Switch user access functions to signal errors in r29 instead of r8") bash suddenly started to report those warnings after login: -bash: cannot set terminal process group (-1): Bad file descriptor -bash: no job control in this shell It turned out, that a function call inside a put_user(), e.g.: put_user(vt_do_kdgkbmode(console), (int __user *)arg); clobbered the error register (r29) and thus the put_user() call itself seem to have failed. Rearrange the C-code to pre-calculate the intermediate value and then do the put_user(). Additionally prefer the "+" constraint on pu_err and gu_err registers to tell the compiler that those operands are both read and written by the assembly instruction. Reported-by: John David Anglin Signed-off-by: Helge Deller Fixes: 4b9d2a731c3d ("parisc: Switch user access functions to signal errors in r29 instead of r8") Signed-off-by: Helge Deller commit 86006f996346e8a5a1ea80637ec949ceeea4ecbc Author: Jesse Brandeburg Date: Fri Feb 11 09:14:18 2022 -0800 ice: enable parsing IPSEC SPI headers for RSS The COMMS package can enable the hardware parser to recognize IPSEC frames with ESP header and SPI identifier. If this package is available and configured for loading in /lib/firmware, then the driver will succeed in enabling this protocol type for RSS. This in turn allows the hardware to hash over the SPI and use it to pick a consistent receive queue for the same secure flow. Without this all traffic is steered to the same queue for multiple traffic threads from the same IP address. For that reason this is marked as a fix, as the driver supports the model, but it wasn't enabled. If the package is not available, adding this type will fail, but the failure is ignored on purpose as it has no negative affect. Fixes: c90ed40cefe1 ("ice: Enable writing hardware filtering tables") Signed-off-by: Jesse Brandeburg Tested-by: Gurucharan G (A Contingent worker at Intel) Signed-off-by: Tony Nguyen Signed-off-by: David S. Miller commit 5ce97f4ec5e0f8726a5dda1710727b1ee9badcac Author: Lennert Buytenhek Date: Mon Oct 4 13:07:24 2021 +0300 iommu/amd: Recover from event log overflow The AMD IOMMU logs I/O page faults and such to a ring buffer in system memory, and this ring buffer can overflow. The AMD IOMMU spec has the following to say about the interrupt status bit that signals this overflow condition: EventOverflow: Event log overflow. RW1C. Reset 0b. 1 = IOMMU event log overflow has occurred. This bit is set when a new event is to be written to the event log and there is no usable entry in the event log, causing the new event information to be discarded. An interrupt is generated when EventOverflow = 1b and MMIO Offset 0018h[EventIntEn] = 1b. No new event log entries are written while this bit is set. Software Note: To resume logging, clear EventOverflow (W1C), and write a 1 to MMIO Offset 0018h[EventLogEn]. The AMD IOMMU driver doesn't currently implement this recovery sequence, meaning that if a ring buffer overflow occurs, logging of EVT/PPR/GA events will cease entirely. This patch implements the spec-mandated reset sequence, with the minor tweak that the hardware seems to want to have a 0 written to MMIO Offset 0018h[EventLogEn] first, before writing an 1 into this field, or the IOMMU won't actually resume logging events. Signed-off-by: Lennert Buytenhek Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/YVrSXEdW2rzEfOvk@wantstofly.org Signed-off-by: Joerg Roedel commit dd8e5b161d7fb9cefa1f1d6e35a39b9e1563c8d3 Author: Takashi Iwai Date: Mon Feb 14 11:00:20 2022 +0100 ALSA: hda: Fix missing codec probe on Shenker Dock 15 By some unknown reason, BIOS on Shenker Dock 15 doesn't set up the codec mask properly for the onboard audio. Let's set the forced codec mask to enable the codec discovery. Reported-by: dmummenschanz@web.de Cc: Link: https://lore.kernel.org/r/trinity-f018660b-95c9-442b-a2a8-c92a56eb07ed-1644345967148@3c-app-webde-bap22 Link: https://lore.kernel.org/r/20220214100020.8870-2-tiwai@suse.de Signed-off-by: Takashi Iwai commit 6317f7449348a897483a2b4841f7a9190745c81b Author: Takashi Iwai Date: Mon Feb 14 11:00:19 2022 +0100 ALSA: hda: Fix regression on forced probe mask option The forced probe mask via probe_mask 0x100 bit doesn't work any longer as expected since the bus init code was moved and it's clearing the codec_mask value that was set beforehand. This patch fixes the long-time regression by moving the check_probe_mask() call. Fixes: a41d122449be ("ALSA: hda - Embed bus into controller object") Reported-by: dmummenschanz@web.de Cc: Link: https://lore.kernel.org/r/trinity-f018660b-95c9-442b-a2a8-c92a56eb07ed-1644345967148@3c-app-webde-bap22 Link: https://lore.kernel.org/r/20220214100020.8870-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 26ace8793aaefbcd0d6bb664573ded35c69cd6ef Author: Ville Syrjälä Date: Thu Feb 10 12:31:07 2022 +0200 drm/i915/fbc: Fix the plane end Y offset check We lost the required >>16 when I refactored the FBC plane state checks. Bring it back so the check does what it's supposed to. Cc: Mika Kahola Fixes: 2e6c99f88679 ("drm/i915/fbc: Nuke lots of crap from intel_fbc_state_cache") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220210103107.24492-1-ville.syrjala@linux.intel.com Reviewed-by: Mika Kahola (cherry picked from commit f7bc440bc79ae5dcf648b90209910ea8dba6ef0c) Signed-off-by: Tvrtko Ursulin commit ea958422291de248b9e2eaaeea36004e84b64043 Author: Jani Nikula Date: Thu Feb 10 12:36:42 2022 +0200 drm/i915/opregion: check port number bounds for SWSCI display power state The mapping from enum port to whatever port numbering scheme is used by the SWSCI Display Power State Notification is odd, and the memory of it has faded. In any case, the parameter only has space for ports numbered [0..4], and UBSAN reports bit shift beyond it when the platform has port F or more. Since the SWSCI functionality is supposed to be obsolete for new platforms (i.e. ones that might have port F or more), just bail out early if the mapped and mangled port number is beyond what the Display Power State Notification can support. Fixes: 9c4b0a683193 ("drm/i915: add opregion function to notify bios of encoder enable/disable") Cc: # v3.13+ Cc: Ville Syrjälä Cc: Lucas De Marchi Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/4800 Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/cc363f42d6b5a5932b6d218fefcc8bdfb15dbbe5.1644489329.git.jani.nikula@intel.com (cherry picked from commit 24a644ebbfd3b13cda702f98907f9dd123e34bf9) Signed-off-by: Tvrtko Ursulin commit 0bdc0a0699929c814a8aecd55d2accb8c11beae2 Author: Matthew Auld Date: Wed Feb 9 11:16:52 2022 +0000 drm/i915/ttm: tweak priority hint selection For some reason we are selecting PRIO_HAS_PAGES when we don't have mm.pages, and vice versa. v2(Thomas): - Add missing fixes tag Fixes: 213d50927763 ("drm/i915/ttm: Introduce a TTM i915 gem object backend") Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20220209111652.468762-1-matthew.auld@intel.com (cherry picked from commit ba2c5d15022a565da187d90e2fe44768e33e5034) Signed-off-by: Tvrtko Ursulin commit 8d9d2a723d64b650f2e6423024ccb4a33f0cdc40 Author: Ville Syrjälä Date: Mon Feb 7 15:27:00 2022 +0200 drm/i915: Fix mbus join config lookup The bogus loop from compute_dbuf_slices() was copied into check_mbus_joined() as well. So this lookup is wrong as well. Fix it. Cc: stable@vger.kernel.org Fixes: f4dc00863226 ("drm/i915/adl_p: MBUS programming") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220207132700.481-2-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula (cherry picked from commit 053f2b85631316a9226f6340c1c0fd95634f7a5b) Signed-off-by: Tvrtko Ursulin commit 698bef8ff5d2edea5d1c9d6e5adf1bfed1e8a106 Author: Ville Syrjälä Date: Mon Feb 7 15:26:59 2022 +0200 drm/i915: Fix dbuf slice config lookup Apparently I totally fumbled the loop condition when I removed the ARRAY_SIZE() stuff from the dbuf slice config lookup. Comparing the loop index with the active_pipes bitmask is utter nonsense, what we want to do is check to see if the mask is zero or not. Note that the code actually ended up working correctly despite the fumble, up until commit eef173954432 ("drm/i915: Allow !join_mbus cases for adlp+ dbuf configuration") when things broke for real. Cc: stable@vger.kernel.org Fixes: 05e8155afe35 ("drm/i915: Use a sentinel to terminate the dbuf slice arrays") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220207132700.481-1-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula (cherry picked from commit a28fde308c3c1c174249ff9559b57f24e6850086) Signed-off-by: Tvrtko Ursulin commit aa4d01a4734bcb1cc9190807cdbcd5af1495910b Merge: 754e0b0e35608 d72d69abfdb6e Author: Tvrtko Ursulin Date: Mon Feb 14 09:50:23 2022 +0000 Merge tag 'gvt-fixes-2022-01-13' of https://github.com/intel/gvt-linux into drm-intel-fixes gvt-fixes-2022-01-13 - Make DRM_I915_GVT depend on X86 (Siva Mullati) - Clean kernel doc in gtt.c (Randy Dunlap) Signed-off-by: Tvrtko Ursulin From: Zhi Wang Link: https://patchwork.freedesktop.org/patch/msgid/1f619581-e3da-3899-09ac-f714d954a580@gmail.com commit ddbd89deb7d32b1fbb879f48d68fda1a8ac58e8e Author: Halil Pasic Date: Fri Feb 11 02:12:52 2022 +0100 swiotlb: fix info leak with DMA_FROM_DEVICE The problem I'm addressing was discovered by the LTP test covering cve-2018-1000204. A short description of what happens follows: 1) The test case issues a command code 00 (TEST UNIT READY) via the SG_IO interface with: dxfer_len == 524288, dxdfer_dir == SG_DXFER_FROM_DEV and a corresponding dxferp. The peculiar thing about this is that TUR is not reading from the device. 2) In sg_start_req() the invocation of blk_rq_map_user() effectively bounces the user-space buffer. As if the device was to transfer into it. Since commit a45b599ad808 ("scsi: sg: allocate with __GFP_ZERO in sg_build_indirect()") we make sure this first bounce buffer is allocated with GFP_ZERO. 3) For the rest of the story we keep ignoring that we have a TUR, so the device won't touch the buffer we prepare as if the we had a DMA_FROM_DEVICE type of situation. My setup uses a virtio-scsi device and the buffer allocated by SG is mapped by the function virtqueue_add_split() which uses DMA_FROM_DEVICE for the "in" sgs (here scatter-gather and not scsi generics). This mapping involves bouncing via the swiotlb (we need swiotlb to do virtio in protected guest like s390 Secure Execution, or AMD SEV). 4) When the SCSI TUR is done, we first copy back the content of the second (that is swiotlb) bounce buffer (which most likely contains some previous IO data), to the first bounce buffer, which contains all zeros. Then we copy back the content of the first bounce buffer to the user-space buffer. 5) The test case detects that the buffer, which it zero-initialized, ain't all zeros and fails. One can argue that this is an swiotlb problem, because without swiotlb we leak all zeros, and the swiotlb should be transparent in a sense that it does not affect the outcome (if all other participants are well behaved). Copying the content of the original buffer into the swiotlb buffer is the only way I can think of to make swiotlb transparent in such scenarios. So let's do just that if in doubt, but allow the driver to tell us that the whole mapped buffer is going to be overwritten, in which case we can preserve the old behavior and avoid the performance impact of the extra bounce. Signed-off-by: Halil Pasic Signed-off-by: Christoph Hellwig commit c07f2c7b45413a9e50ba78630fda04ecfa17b4f2 Author: Yu Huang Date: Sun Feb 13 00:08:33 2022 +0800 ALSA: hda/realtek: Add quirk for Legion Y9000X 2019 Legion Y9000X 2019 has the same speaker with Y9000X 2020, but with a different quirk address. Add one quirk entry to make the speaker work on Y9000X 2019 too. Signed-off-by: Yu Huang Cc: Link: https://lore.kernel.org/r/20220212160835.165065-1-diwang90@gmail.com Signed-off-by: Takashi Iwai commit 19d20c7a29bf2e46ff1ab8e8c4fcd2da8a4f38e2 Author: Matteo Martelli Date: Fri Feb 11 23:49:13 2022 +0100 ALSA: usb-audio: revert to IMPLICIT_FB_FIXED_DEV for M-Audio FastTrack Ultra Commit 83b7dcbc51c930fc2079ab6c6fc9d719768321f1 introduced a generic implicit feedback parser, which fails to execute for M-Audio FastTrack Ultra sound cards. The issue is with the ENDPOINT_SYNCTYPE check in add_generic_implicit_fb() where the SYNCTYPE is ADAPTIVE instead of ASYNC. The reason is that the sync type of the FastTrack output endpoints are set to adaptive in the quirks table since commit 65f04443c96dbda11b8fff21d6390e082846aa3c. Fixes: 83b7dcbc51c9 ("ALSA: usb-audio: Add generic implicit fb parsing") Signed-off-by: Matteo Martelli Cc: Link: https://lore.kernel.org/r/20220211224913.20683-2-matteomartelli3@gmail.com Signed-off-by: Takashi Iwai commit 538f4f022a4612f969d5324ee227403c9f8b1d72 Author: Christian Brauner Date: Thu Feb 3 14:14:07 2022 +0100 fs: add kernel doc for mnt_{hold,unhold}_writers() When I introduced mnt_{hold,unhold}_writers() in commit fbdc2f6c40f6 ("fs: split out functions to hold writers") I did not add kernel doc for them. Fix this and introduce proper documentation. Link: https://lore.kernel.org/r/20220203131411.3093040-4-brauner@kernel.org Fixes: fbdc2f6c40f6 ("fs: split out functions to hold writers") Cc: Seth Forshee Cc: Christoph Hellwig Cc: Al Viro Cc: linux-fsdevel@vger.kernel.org Reviewed-by: Christoph Hellwig Signed-off-by: Christian Brauner commit 45d941f67b000b6d79159522a0bbfc37cfd584d6 Author: Sudeep Holla Date: Fri Feb 11 11:02:04 2022 +0000 arm64: dts: imx8ulp: Set #thermal-sensor-cells to 1 as required The SCMI binding clearly states the value of #thermal-sensor-cells must be 1. However arch/arm64/boot/dts/freescale/imx8ulp.dtsi sets it 0 which results in the following warning with dtbs_check: | arch/arm64/boot/dts/freescale/imx8ulp-evk.dt.yaml: scmi: | protocol@15:#thermal-sensor-cells:0:0: 1 was expected | From schema: Documentation/devicetree/bindings/firmware/arm,scmi.yaml Fix it by setting it to 1 as required. Cc:Shawn Guo Cc: Sascha Hauer Signed-off-by: Sudeep Holla Reviewed-by: Fabio Estevam Acked-by: Peng Fan Fixes: a38771d7a49b ("arm64: dts: imx8ulp: add scmi firmware node") Signed-off-by: Shawn Guo commit ef3075d6638d3d5353a97fcc7bb0338fc85675f5 Author: Adam Ford Date: Tue Jan 25 11:11:25 2022 -0600 arm64: dts: imx8mm: Fix VPU Hanging The vpumix power domain has a reset assigned to it, however when used, it causes a system hang. Testing has shown that it does not appear to be needed anywhere. Fixes: d39d4bb15310 ("arm64: dts: imx8mm: add GPC node") Signed-off-by: Adam Ford Reviewed-by: Lucas Stach Signed-off-by: Shawn Guo commit 2874b7911132f6975e668f6849c8ac93bc4e1f35 Author: Pablo Neira Ayuso Date: Sat Feb 12 00:44:11 2022 +0100 netfilter: xt_socket: missing ifdef CONFIG_IP6_NF_IPTABLES dependency nf_defrag_ipv6_disable() requires CONFIG_IP6_NF_IPTABLES. Fixes: 75063c9294fb ("netfilter: xt_socket: fix a typo in socket_mt_destroy()") Reported-by: kernel test robot Reviewed-by: Eric Dumazet Signed-off-by: Pablo Neira Ayuso commit b160628e9ebcdc85d0db9d7f423c26b3c7c179d0 Author: Helge Deller Date: Sun Feb 13 22:29:25 2022 +0100 parisc: Show error if wrong 32/64-bit compiler is being used It happens quite often that people use the wrong compiler to build the kernel: make ARCH=parisc -> builds the 32-bit kernel make ARCH=parisc64 -> builds the 64-bit kernel This patch adds a sanity check which errors out with an instruction how use the correct ARCH= option. Signed-off-by: Helge Deller Cc: stable@vger.kernel.org # v5.15+ commit 3d6cc9898efdfb062efb74dc18cfc700e082f5d5 Author: Ronnie Sahlberg Date: Fri Feb 11 02:59:15 2022 +1000 cifs: fix double free race when mount fails in cifs_get_root() When cifs_get_root() fails during cifs_smb3_do_mount() we call deactivate_locked_super() which eventually will call delayed_free() which will free the context. In this situation we should not proceed to enter the out: section in cifs_smb3_do_mount() and free the same resources a second time. [Thu Feb 10 12:59:06 2022] BUG: KASAN: use-after-free in rcu_cblist_dequeue+0x32/0x60 [Thu Feb 10 12:59:06 2022] Read of size 8 at addr ffff888364f4d110 by task swapper/1/0 [Thu Feb 10 12:59:06 2022] CPU: 1 PID: 0 Comm: swapper/1 Tainted: G OE 5.17.0-rc3+ #4 [Thu Feb 10 12:59:06 2022] Hardware name: Microsoft Corporation Virtual Machine/Virtual Machine, BIOS Hyper-V UEFI Release v4.0 12/17/2019 [Thu Feb 10 12:59:06 2022] Call Trace: [Thu Feb 10 12:59:06 2022] [Thu Feb 10 12:59:06 2022] dump_stack_lvl+0x5d/0x78 [Thu Feb 10 12:59:06 2022] print_address_description.constprop.0+0x24/0x150 [Thu Feb 10 12:59:06 2022] ? rcu_cblist_dequeue+0x32/0x60 [Thu Feb 10 12:59:06 2022] kasan_report.cold+0x7d/0x117 [Thu Feb 10 12:59:06 2022] ? rcu_cblist_dequeue+0x32/0x60 [Thu Feb 10 12:59:06 2022] __asan_load8+0x86/0xa0 [Thu Feb 10 12:59:06 2022] rcu_cblist_dequeue+0x32/0x60 [Thu Feb 10 12:59:06 2022] rcu_core+0x547/0xca0 [Thu Feb 10 12:59:06 2022] ? call_rcu+0x3c0/0x3c0 [Thu Feb 10 12:59:06 2022] ? __this_cpu_preempt_check+0x13/0x20 [Thu Feb 10 12:59:06 2022] ? lock_is_held_type+0xea/0x140 [Thu Feb 10 12:59:06 2022] rcu_core_si+0xe/0x10 [Thu Feb 10 12:59:06 2022] __do_softirq+0x1d4/0x67b [Thu Feb 10 12:59:06 2022] __irq_exit_rcu+0x100/0x150 [Thu Feb 10 12:59:06 2022] irq_exit_rcu+0xe/0x30 [Thu Feb 10 12:59:06 2022] sysvec_hyperv_stimer0+0x9d/0xc0 ... [Thu Feb 10 12:59:07 2022] Freed by task 58179: [Thu Feb 10 12:59:07 2022] kasan_save_stack+0x26/0x50 [Thu Feb 10 12:59:07 2022] kasan_set_track+0x25/0x30 [Thu Feb 10 12:59:07 2022] kasan_set_free_info+0x24/0x40 [Thu Feb 10 12:59:07 2022] ____kasan_slab_free+0x137/0x170 [Thu Feb 10 12:59:07 2022] __kasan_slab_free+0x12/0x20 [Thu Feb 10 12:59:07 2022] slab_free_freelist_hook+0xb3/0x1d0 [Thu Feb 10 12:59:07 2022] kfree+0xcd/0x520 [Thu Feb 10 12:59:07 2022] cifs_smb3_do_mount+0x149/0xbe0 [cifs] [Thu Feb 10 12:59:07 2022] smb3_get_tree+0x1a0/0x2e0 [cifs] [Thu Feb 10 12:59:07 2022] vfs_get_tree+0x52/0x140 [Thu Feb 10 12:59:07 2022] path_mount+0x635/0x10c0 [Thu Feb 10 12:59:07 2022] __x64_sys_mount+0x1bf/0x210 [Thu Feb 10 12:59:07 2022] do_syscall_64+0x5c/0xc0 [Thu Feb 10 12:59:07 2022] entry_SYSCALL_64_after_hwframe+0x44/0xae [Thu Feb 10 12:59:07 2022] Last potentially related work creation: [Thu Feb 10 12:59:07 2022] kasan_save_stack+0x26/0x50 [Thu Feb 10 12:59:07 2022] __kasan_record_aux_stack+0xb6/0xc0 [Thu Feb 10 12:59:07 2022] kasan_record_aux_stack_noalloc+0xb/0x10 [Thu Feb 10 12:59:07 2022] call_rcu+0x76/0x3c0 [Thu Feb 10 12:59:07 2022] cifs_umount+0xce/0xe0 [cifs] [Thu Feb 10 12:59:07 2022] cifs_kill_sb+0xc8/0xe0 [cifs] [Thu Feb 10 12:59:07 2022] deactivate_locked_super+0x5d/0xd0 [Thu Feb 10 12:59:07 2022] cifs_smb3_do_mount+0xab9/0xbe0 [cifs] [Thu Feb 10 12:59:07 2022] smb3_get_tree+0x1a0/0x2e0 [cifs] [Thu Feb 10 12:59:07 2022] vfs_get_tree+0x52/0x140 [Thu Feb 10 12:59:07 2022] path_mount+0x635/0x10c0 [Thu Feb 10 12:59:07 2022] __x64_sys_mount+0x1bf/0x210 [Thu Feb 10 12:59:07 2022] do_syscall_64+0x5c/0xc0 [Thu Feb 10 12:59:07 2022] entry_SYSCALL_64_after_hwframe+0x44/0xae Reported-by: Shyam Prasad N Reviewed-by: Shyam Prasad N Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French commit 26d3dadebbcbddfaf1d9caad42527a28a0ed28d8 Author: Ronnie Sahlberg Date: Sat Feb 12 08:16:20 2022 +1000 cifs: do not use uninitialized data in the owner/group sid When idsfromsid is used we create a special SID for owner/group. This structure must be initialized or else the first 5 bytes of the Authority field of the SID will contain uninitialized data and thus not be a valid SID. Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French commit dd5a927e411836eaef44eb9b00fece615e82e242 Author: Amir Goldstein Date: Mon Jan 3 16:50:25 2022 +0200 cifs: fix set of group SID via NTSD xattrs 'setcifsacl -g ' silently fails to set the group SID on server. Actually, the bug existed since commit 438471b67963 ("CIFS: Add support for setting owner info, dos attributes, and create time"), but this fix will not apply cleanly to kernel versions <= v5.10. Fixes: 3970acf7ddb9 ("SMB3: Add support for getting and setting SACLs") Cc: stable@vger.kernel.org # 5.11+ Signed-off-by: Amir Goldstein Signed-off-by: Steve French commit 9405b5f8b20c2bfa6523a555279a0379640dc136 Author: Steve French Date: Sat Feb 12 01:54:14 2022 -0600 smb3: fix snapshot mount option The conversion to the new API broke the snapshot mount option due to 32 vs. 64 bit type mismatch Fixes: 24e0a1eff9e2 ("cifs: switch to new mount api") Cc: stable@vger.kernel.org # 5.11+ Reported-by: Acked-by: Ronnie Sahlberg Signed-off-by: Steve French commit 754e0b0e35608ed5206d6a67a791563c631cec07 Author: Linus Torvalds Date: Sun Feb 13 12:13:30 2022 -0800 Linux 5.17-rc4 commit e89d3a46710908c3973397849e758f6ca42db77d Merge: c5d714aa6dce2 1b9e740a81f91 Author: Linus Torvalds Date: Sun Feb 13 11:58:11 2022 -0800 Merge tag 'kbuild-fixes-v5.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kbuild fixes from Masahiro Yamada: - Fix the truncated path issue for HAVE_GCC_PLUGINS test in Kconfig - Move -Wunsligned-access to W=1 builds to avoid sprinkling warnings for the latest Clang - Fix missing fclose() in Kconfig - Fix Kconfig to touch dep headers correctly when KCONFIG_AUTOCONFIG is overridden. * tag 'kbuild-fixes-v5.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: kconfig: fix failing to generate auto.conf kconfig: fix missing fclose() on error paths Makefile.extrawarn: Move -Wunaligned-access to W=1 kconfig: let 'shell' return enough output for deep path names commit c5d714aa6dce262482992cccc0ab01383294f7ac Merge: 42964a18f81c9 1e34064b60552 Author: Linus Torvalds Date: Sun Feb 13 10:06:40 2022 -0800 Merge tag 'irq-urgent-2022-02-13' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull irq fixes from Thomas Gleixner: "Interrupt chip driver fixes: - Don't install an hotplug notifier for GICV3-ITS on systems which do not need it to prevent a warning in the notifier about inconsistent state - Add the missing device tree matching for the T-HEAD PLIC variant so the related SoC is properly supported" * tag 'irq-urgent-2022-02-13' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: irqchip/sifive-plic: Add missing thead,c900-plic match string dt-bindings: update riscv plic compatible string irqchip/gic-v3-its: Skip HP notifier when no ITS is registered commit 42964a18f81c9e514dce2d11277b7cc546146723 Merge: 6f3573672324b bfb1a7c91fb77 Author: Linus Torvalds Date: Sun Feb 13 09:43:34 2022 -0800 Merge tag 'objtool_urgent_for_v5.17_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull objtool fix from Borislav Petkov: "Fix a case where objtool would mistakenly warn about instructions being unreachable" * tag 'objtool_urgent_for_v5.17_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/bug: Merge annotate_reachable() into _BUG_FLAGS() asm commit 6f3573672324b6391014680dd6e2cf7298aaea22 Merge: f5e02656b19fa 13765de8148f7 Author: Linus Torvalds Date: Sun Feb 13 09:27:26 2022 -0800 Merge tag 'sched_urgent_for_v5.17_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull scheduler fix from Borislav Petkov: "Fix a NULL-ptr dereference when recalculating a sched entity's weight" * tag 'sched_urgent_for_v5.17_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched/fair: Fix fault in reweight_entity commit f5e02656b19fa4e38180a08faadd631858a02877 Merge: 808f0ab22106d 5f4e5ce638e6a Author: Linus Torvalds Date: Sun Feb 13 09:25:26 2022 -0800 Merge tag 'perf_urgent_for_v5.17_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull perf fix from Borislav Petkov: "Prevent cgroup event list corruption when switching events" * tag 'perf_urgent_for_v5.17_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf: Fix list corruption in perf_cgroup_switch() commit 808f0ab22106d2305b33a2b3e4df559a92679615 Merge: e9c25787db080 8795359e35bc3 Author: Linus Torvalds Date: Sun Feb 13 09:22:52 2022 -0800 Merge tag 'x86_urgent_for_v5.17_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fix from Borislav Petkov: "Prevent softlockups when tearing down large SGX enclaves" * tag 'x86_urgent_for_v5.17_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/sgx: Silence softlockup detection when releasing large enclaves commit e9c25787db080cb28601ce182088ce77659f684b Merge: b81b1829e7e39 2a05137a0575b Author: Linus Torvalds Date: Sun Feb 13 09:16:45 2022 -0800 Merge tag '5.17-rc4-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6 Pull cifs fixes from Steve French: "Three small smb3 reconnect fixes and an error log clarification" * tag '5.17-rc4-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6: cifs: mark sessions for reconnection in helper function cifs: call helper functions for marking channels for reconnect cifs: call cifs_reconnect when a connection is marked [smb3] improve error message when mount options conflict with posix commit 1e34064b60552616b2767d22f2e6f440ced09acb Merge: dd7f5a11ac5a6 1d4df649cbb4b Author: Thomas Gleixner Date: Sun Feb 13 14:16:23 2022 +0100 Merge tag 'irqchip-fixes-5.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms into irq/urgent Pull irqchip fixes from Marc Zyngier: - Don't register a hotplug notifier on GICv3 systems that advertise LPI support, but have no ITS to make use of it - Add missing DT matching for the thead,c900-plic variant of the SiFive PLIC Link: https://lore.kernel.org/r/20220211110038.1179155-1-maz@kernel.org commit 143de8d97d79316590475dc2a84513c63c863ddf Author: Hangyu Hua Date: Fri Feb 11 12:55:10 2022 +0800 tipc: fix a bit overflow in tipc_crypto_key_rcv() msg_data_sz return a 32bit value, but size is 16bit. This may lead to a bit overflow. Signed-off-by: Hangyu Hua Signed-off-by: David S. Miller commit b81b1829e7e39f6cebdf6e4d5484eacbceda8554 Merge: 080eba785fe10 5852ed2a6a39c Author: Linus Torvalds Date: Sat Feb 12 10:29:02 2022 -0800 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fixes from James Bottomley: "Two minor fixes in the lpfc driver. One changing the classification of trace messages and the other fixing a build issue when NVME_FC is disabled" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: lpfc: Reduce log messages seen after firmware download scsi: lpfc: Remove NVMe support if kernel has NVME_FC disabled commit 080eba785fe10ba21c40bbdd80f2bd5331a28be6 Merge: dcd72f5466571 c72ea20503610 Author: Linus Torvalds Date: Sat Feb 12 10:16:32 2022 -0800 Merge tag 'char-misc-5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull char/misc driver fixes from Greg KH: "Here are a small number of char/misc driver fixes for 5.17-rc4 for reported issues. They contain: - phy driver fixes - iio driver fix - eeprom driver fix - speakup regression fix - fastrpc fix All of these have been in linux-next with no reported issues" * tag 'char-misc-5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: iio: buffer: Fix file related error handling in IIO_BUFFER_GET_FD_IOCTL speakup-dectlk: Restore pitch setting bus: mhi: pci_generic: Add mru_default for Cinterion MV31-W bus: mhi: pci_generic: Add mru_default for Foxconn SDX55 eeprom: ee1004: limit i2c reads to I2C_SMBUS_BLOCK_MAX misc: fastrpc: avoid double fput() on failed usercopy phy: dphy: Correct clk_pre parameter phy: phy-mtk-tphy: Fix duplicated argument in phy-mtk-tphy phy: stm32: fix a refcount leak in stm32_usbphyc_pll_enable() phy: xilinx: zynqmp: Fix bus width setting for SGMII phy: cadence: Sierra: fix error handling bugs in probe() phy: ti: Fix missing sentinel for clk_div_table phy: broadcom: Kconfig: Fix PHY_BRCM_USB config option phy: usb: Leave some clocks running during suspend commit dcd72f54665717f9d610ea101336d42b7a80704b Merge: 522e7d03f7d28 426aca16e903b Author: Linus Torvalds Date: Sat Feb 12 10:10:35 2022 -0800 Merge tag 'staging-5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pullstaging driver fixes from Greg KH: "Here are two staging driver fixes for 5.17-rc4. These are: - fbtft error path fix - vc04_services rcu dereference fix Both of these have been in linux-next for a while with no reported issues" * tag 'staging-5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: staging: fbtft: Fix error path in fbtft_driver_module_init() staging: vc04_services: Fix RCU dereference check commit 522e7d03f7d286cde06bee51982121f63bb03097 Merge: 85187378990eb 28cb138f559f8 Author: Linus Torvalds Date: Sat Feb 12 10:01:55 2022 -0800 Merge tag 'tty-5.17-rc4' 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 fixes for 5.17-rc4. They are: - 8250_pericom change revert to fix a reported regression - two speculation fixes for vt_ioctl - n_tty regression fix for polling All of these have been in linux-next for a while with no reported issues" * tag 'tty-5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: vt_ioctl: add array_index_nospec to VT_ACTIVATE vt_ioctl: fix array_index_nospec in vt_setactivate serial: 8250_pericom: Revert "Re-enable higher baud rates" n_tty: wake up poll(POLLRDNORM) on receiving data commit 85187378990eb25012b4a506114ad41a478b00a5 Merge: a4fd49cdb5495 736e8d89044c1 Author: Linus Torvalds Date: Sat Feb 12 09:56:18 2022 -0800 Merge tag 'usb-5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB fixes from Greg KH: "Here are some small USB driver fixes for 5.17-rc4 that resolve some reported issues and add new device ids: - usb-serial new device ids - ulpi cleanup fixes - f_fs use-after-free fix - dwc3 driver fixes - ax88179_178a usb network driver fix - usb gadget fixes There is a revert at the end of this series to resolve a build problem that 0-day found yesterday. Most of these have been in linux-next, except for the last few, and all have now passed 0-day tests" * tag 'usb-5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: Revert "usb: dwc2: drd: fix soft connect when gadget is unconfigured" usb: dwc2: drd: fix soft connect when gadget is unconfigured usb: gadget: rndis: check size of RNDIS_MSG_SET command USB: gadget: validate interface OS descriptor requests usb: core: Unregister device on component_add() failure net: usb: ax88179_178a: Fix out-of-bounds accesses in RX fixup usb: dwc3: gadget: Prevent core from processing stale TRBs USB: serial: cp210x: add CPI Bulk Coin Recycler id USB: serial: cp210x: add NCR Retail IO box id USB: serial: ftdi_sio: add support for Brainboxes US-159/235/320 usb: gadget: f_uac2: Define specific wTerminalType usb: gadget: udc: renesas_usb3: Fix host to USB_ROLE_NONE transition usb: raw-gadget: fix handling of dual-direction-capable endpoints usb: usb251xb: add boost-up property support usb: ulpi: Call of_node_put correctly usb: ulpi: Move of_node_put to ulpi_dev_release USB: serial: option: add ZTE MF286D modem USB: serial: ch341: add support for GW Instek USB2.0-Serial devices usb: f_fs: Fix use-after-free for epfile usb: dwc3: xilinx: fix uninitialized return value commit a4fd49cdb5495f36a35bd27b69b3806e383c719b Merge: 4a387c98b3abc dd9cb842fa9d9 Author: Linus Torvalds Date: Sat Feb 12 09:12:44 2022 -0800 Merge tag 's390-5.17-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull s390 updates from Vasily Gorbik: "Maintainers and reviewers changes: - Add Alexander Gordeev as maintainer for s390. - Christian Borntraeger will focus on s390 KVM maintainership and stays as s390 reviewer. Fixes: - Fix clang build of modules loader KUnit test. - Fix kernel panic in CIO code on FCES path-event when no driver is attached to a device or the driver does not provide the path_event function" * tag 's390-5.17-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390/cio: verify the driver availability for path_event call s390/module: fix building test_modules_helpers.o with clang MAINTAINERS: downgrade myself to Reviewer for s390 MAINTAINERS: add Alexander Gordeev as maintainer for s390 commit 4a387c98b3abc7cf9a2281f01f9b4dd7dbc48f65 Merge: eef8cffcaba8f f66edf684edcb Author: Linus Torvalds Date: Sat Feb 12 09:08:57 2022 -0800 Merge tag 'for-linus-5.17a-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen fixes from Juergen Gross: - Two small cleanups - Another fix for addressing the EFI framebuffer above 4GB when running as Xen dom0 - A patch to let Xen guests use reserved bits in MSI- and IO-APIC- registers for extended APIC-IDs the same way KVM guests are doing it already * tag 'for-linus-5.17a-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen/pci: Make use of the helper macro LIST_HEAD() xen/x2apic: Fix inconsistent indenting xen/x86: detect support for extended destination ID xen/x86: obtain full video frame buffer address for Dom0 also under EFI commit eef8cffcaba8f1498ec32f55c859b883315232ad Merge: 9917ff5f31978 eed09ad261822 Author: Linus Torvalds Date: Sat Feb 12 09:04:05 2022 -0800 Merge tag 'seccomp-v5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull seccomp fixes from Kees Cook: "This fixes a corner case of fatal SIGSYS being ignored since v5.15. Along with the signal fix is a change to seccomp so that seeing another syscall after a fatal filter result will cause seccomp to kill the process harder. Summary: - Force HANDLER_EXIT even for SIGNAL_UNKILLABLE - Make seccomp self-destruct after fatal filter results - Update seccomp samples for easier behavioral demonstration" * tag 'seccomp-v5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: samples/seccomp: Adjust sample to also provide kill option seccomp: Invalidate seccomp mode to catch death failures signal: HANDLER_EXIT should clear SIGNAL_UNKILLABLE commit 9917ff5f319788a195c691fa19cf3e90cee59f40 Merge: 83e3966411106 8913c61001482 Author: Linus Torvalds Date: Sat Feb 12 08:57:37 2022 -0800 Merge branch 'akpm' (patches from Andrew) Merge misc fixes from Andrew Morton: "5 patches. Subsystems affected by this patch series: binfmt, procfs, and mm (vmscan, memcg, and kfence)" * emailed patches from Andrew Morton : kfence: make test case compatible with run time set sample interval mm: memcg: synchronize objcg lists with a dedicated spinlock mm: vmscan: remove deadlock due to throttling failing to make progress fs/proc: task_mmu.c: don't read mapcount for migration entry fs/binfmt_elf: fix PT_LOAD p_align values for loaders commit 1b9e740a81f91ae338b29ed70455719804957b80 Author: Jing Leng Date: Fri Feb 11 17:27:36 2022 +0800 kconfig: fix failing to generate auto.conf When the KCONFIG_AUTOCONFIG is specified (e.g. export \ KCONFIG_AUTOCONFIG=output/config/auto.conf), the directory of include/config/ will not be created, so kconfig can't create deps files in it and auto.conf can't be generated. Signed-off-by: Jing Leng Signed-off-by: Masahiro Yamada commit 736e8d89044c1c330967fb938fa766cd9e0d8af0 Author: Greg Kroah-Hartman Date: Sat Feb 12 10:08:54 2022 +0100 Revert "usb: dwc2: drd: fix soft connect when gadget is unconfigured" This reverts commit 269cbcf7b72de6f0016806d4a0cec1d689b55a87. It causes build errors as reported by the kernel test robot. Link: https://lore.kernel.org/r/202202112236.AwoOTtHO-lkp@intel.com Reported-by: kernel test robot Fixes: 269cbcf7b72d ("usb: dwc2: drd: fix soft connect when gadget is unconfigured") Cc: stable@kernel.org Cc: Amelie Delaunay Cc: Minas Harutyunyan Cc: Fabrice Gasnier Signed-off-by: Greg Kroah-Hartman commit 8913c61001482378d4ed8cc577b17c1ba3e847e4 Author: Peng Liu Date: Fri Feb 11 16:32:35 2022 -0800 kfence: make test case compatible with run time set sample interval The parameter kfence_sample_interval can be set via boot parameter and late shell command, which is convenient for automated tests and KFENCE parameter optimization. However, KFENCE test case just uses compile-time CONFIG_KFENCE_SAMPLE_INTERVAL, which will make KFENCE test case not run as users desired. Export kfence_sample_interval, so that KFENCE test case can use run-time-set sample interval. Link: https://lkml.kernel.org/r/20220207034432.185532-1-liupeng256@huawei.com Signed-off-by: Peng Liu Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Dmitry Vyukov Cc: Jonathan Corbet Cc: Sumit Semwal Cc: Christian Knig Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 0764db9b49c932b89ee4d9e3236dff4bb07b4a66 Author: Roman Gushchin Date: Fri Feb 11 16:32:32 2022 -0800 mm: memcg: synchronize objcg lists with a dedicated spinlock Alexander reported a circular lock dependency revealed by the mmap1 ltp test: LOCKDEP_CIRCULAR (suite: ltp, case: mtest06 (mmap1)) WARNING: possible circular locking dependency detected 5.17.0-20220113.rc0.git0.f2211f194038.300.fc35.s390x+debug #1 Not tainted ------------------------------------------------------ mmap1/202299 is trying to acquire lock: 00000001892c0188 (css_set_lock){..-.}-{2:2}, at: obj_cgroup_release+0x4a/0xe0 but task is already holding lock: 00000000ca3b3818 (&sighand->siglock){-.-.}-{2:2}, at: force_sig_info_to_task+0x38/0x180 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&sighand->siglock){-.-.}-{2:2}: __lock_acquire+0x604/0xbd8 lock_acquire.part.0+0xe2/0x238 lock_acquire+0xb0/0x200 _raw_spin_lock_irqsave+0x6a/0xd8 __lock_task_sighand+0x90/0x190 cgroup_freeze_task+0x2e/0x90 cgroup_migrate_execute+0x11c/0x608 cgroup_update_dfl_csses+0x246/0x270 cgroup_subtree_control_write+0x238/0x518 kernfs_fop_write_iter+0x13e/0x1e0 new_sync_write+0x100/0x190 vfs_write+0x22c/0x2d8 ksys_write+0x6c/0xf8 __do_syscall+0x1da/0x208 system_call+0x82/0xb0 -> #0 (css_set_lock){..-.}-{2:2}: check_prev_add+0xe0/0xed8 validate_chain+0x736/0xb20 __lock_acquire+0x604/0xbd8 lock_acquire.part.0+0xe2/0x238 lock_acquire+0xb0/0x200 _raw_spin_lock_irqsave+0x6a/0xd8 obj_cgroup_release+0x4a/0xe0 percpu_ref_put_many.constprop.0+0x150/0x168 drain_obj_stock+0x94/0xe8 refill_obj_stock+0x94/0x278 obj_cgroup_charge+0x164/0x1d8 kmem_cache_alloc+0xac/0x528 __sigqueue_alloc+0x150/0x308 __send_signal+0x260/0x550 send_signal+0x7e/0x348 force_sig_info_to_task+0x104/0x180 force_sig_fault+0x48/0x58 __do_pgm_check+0x120/0x1f0 pgm_check_handler+0x11e/0x180 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&sighand->siglock); lock(css_set_lock); lock(&sighand->siglock); lock(css_set_lock); *** DEADLOCK *** 2 locks held by mmap1/202299: #0: 00000000ca3b3818 (&sighand->siglock){-.-.}-{2:2}, at: force_sig_info_to_task+0x38/0x180 #1: 00000001892ad560 (rcu_read_lock){....}-{1:2}, at: percpu_ref_put_many.constprop.0+0x0/0x168 stack backtrace: CPU: 15 PID: 202299 Comm: mmap1 Not tainted 5.17.0-20220113.rc0.git0.f2211f194038.300.fc35.s390x+debug #1 Hardware name: IBM 3906 M04 704 (LPAR) Call Trace: dump_stack_lvl+0x76/0x98 check_noncircular+0x136/0x158 check_prev_add+0xe0/0xed8 validate_chain+0x736/0xb20 __lock_acquire+0x604/0xbd8 lock_acquire.part.0+0xe2/0x238 lock_acquire+0xb0/0x200 _raw_spin_lock_irqsave+0x6a/0xd8 obj_cgroup_release+0x4a/0xe0 percpu_ref_put_many.constprop.0+0x150/0x168 drain_obj_stock+0x94/0xe8 refill_obj_stock+0x94/0x278 obj_cgroup_charge+0x164/0x1d8 kmem_cache_alloc+0xac/0x528 __sigqueue_alloc+0x150/0x308 __send_signal+0x260/0x550 send_signal+0x7e/0x348 force_sig_info_to_task+0x104/0x180 force_sig_fault+0x48/0x58 __do_pgm_check+0x120/0x1f0 pgm_check_handler+0x11e/0x180 INFO: lockdep is turned off. In this example a slab allocation from __send_signal() caused a refilling and draining of a percpu objcg stock, resulted in a releasing of another non-related objcg. Objcg release path requires taking the css_set_lock, which is used to synchronize objcg lists. This can create a circular dependency with the sighandler lock, which is taken with the locked css_set_lock by the freezer code (to freeze a task). In general it seems that using css_set_lock to synchronize objcg lists makes any slab allocations and deallocation with the locked css_set_lock and any intervened locks risky. To fix the problem and make the code more robust let's stop using css_set_lock to synchronize objcg lists and use a new dedicated spinlock instead. Link: https://lkml.kernel.org/r/Yfm1IHmoGdyUR81T@carbon.dhcp.thefacebook.com Fixes: bf4f059954dc ("mm: memcg/slab: obj_cgroup API") Signed-off-by: Roman Gushchin Reported-by: Alexander Egorenkov Tested-by: Alexander Egorenkov Reviewed-by: Waiman Long Acked-by: Tejun Heo Reviewed-by: Shakeel Butt Reviewed-by: Jeremy Linton Tested-by: Jeremy Linton Cc: Johannes Weiner Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b485c6f1f9f54b81443efda5f3d8a5036ba2cd91 Author: Mel Gorman Date: Fri Feb 11 16:32:29 2022 -0800 mm: vmscan: remove deadlock due to throttling failing to make progress A soft lockup bug in kcompactd was reported in a private bugzilla with the following visible in dmesg; watchdog: BUG: soft lockup - CPU#33 stuck for 26s! [kcompactd0:479] watchdog: BUG: soft lockup - CPU#33 stuck for 52s! [kcompactd0:479] watchdog: BUG: soft lockup - CPU#33 stuck for 78s! [kcompactd0:479] watchdog: BUG: soft lockup - CPU#33 stuck for 104s! [kcompactd0:479] The machine had 256G of RAM with no swap and an earlier failed allocation indicated that node 0 where kcompactd was run was potentially unreclaimable; Node 0 active_anon:29355112kB inactive_anon:2913528kB active_file:0kB inactive_file:0kB unevictable:64kB isolated(anon):0kB isolated(file):0kB mapped:8kB dirty:0kB writeback:0kB shmem:26780kB shmem_thp: 0kB shmem_pmdmapped: 0kB anon_thp: 23480320kB writeback_tmp:0kB kernel_stack:2272kB pagetables:24500kB all_unreclaimable? yes Vlastimil Babka investigated a crash dump and found that a task migrating pages was trying to drain PCP lists; PID: 52922 TASK: ffff969f820e5000 CPU: 19 COMMAND: "kworker/u128:3" Call Trace: __schedule schedule schedule_timeout wait_for_completion __flush_work __drain_all_pages __alloc_pages_slowpath.constprop.114 __alloc_pages alloc_migration_target migrate_pages migrate_to_node do_migrate_pages cpuset_migrate_mm_workfn process_one_work worker_thread kthread ret_from_fork This failure is specific to CONFIG_PREEMPT=n builds. The root of the problem is that kcompact0 is not rescheduling on a CPU while a task that has isolated a large number of the pages from the LRU is waiting on kcompact0 to reschedule so the pages can be released. While shrink_inactive_list() only loops once around too_many_isolated, reclaim can continue without rescheduling if sc->skipped_deactivate == 1 which could happen if there was no file LRU and the inactive anon list was not low. Link: https://lkml.kernel.org/r/20220203100326.GD3301@suse.de Fixes: d818fca1cac3 ("mm/vmscan: throttle reclaim and compaction when too may pages are isolated") Signed-off-by: Mel Gorman Debugged-by: Vlastimil Babka Reviewed-by: Vlastimil Babka Acked-by: Michal Hocko Acked-by: David Rientjes Cc: Hugh Dickins Cc: Michal Hocko Cc: Rik van Riel Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 24d7275ce2791829953ed4e72f68277ceb2571c6 Author: Yang Shi Date: Fri Feb 11 16:32:26 2022 -0800 fs/proc: task_mmu.c: don't read mapcount for migration entry The syzbot reported the below BUG: kernel BUG at include/linux/page-flags.h:785! invalid opcode: 0000 [#1] PREEMPT SMP KASAN CPU: 1 PID: 4392 Comm: syz-executor560 Not tainted 5.16.0-rc6-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:PageDoubleMap include/linux/page-flags.h:785 [inline] RIP: 0010:__page_mapcount+0x2d2/0x350 mm/util.c:744 Call Trace: page_mapcount include/linux/mm.h:837 [inline] smaps_account+0x470/0xb10 fs/proc/task_mmu.c:466 smaps_pte_entry fs/proc/task_mmu.c:538 [inline] smaps_pte_range+0x611/0x1250 fs/proc/task_mmu.c:601 walk_pmd_range mm/pagewalk.c:128 [inline] walk_pud_range mm/pagewalk.c:205 [inline] walk_p4d_range mm/pagewalk.c:240 [inline] walk_pgd_range mm/pagewalk.c:277 [inline] __walk_page_range+0xe23/0x1ea0 mm/pagewalk.c:379 walk_page_vma+0x277/0x350 mm/pagewalk.c:530 smap_gather_stats.part.0+0x148/0x260 fs/proc/task_mmu.c:768 smap_gather_stats fs/proc/task_mmu.c:741 [inline] show_smap+0xc6/0x440 fs/proc/task_mmu.c:822 seq_read_iter+0xbb0/0x1240 fs/seq_file.c:272 seq_read+0x3e0/0x5b0 fs/seq_file.c:162 vfs_read+0x1b5/0x600 fs/read_write.c:479 ksys_read+0x12d/0x250 fs/read_write.c:619 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 The reproducer was trying to read /proc/$PID/smaps when calling MADV_FREE at the mean time. MADV_FREE may split THPs if it is called for partial THP. It may trigger the below race: CPU A CPU B ----- ----- smaps walk: MADV_FREE: page_mapcount() PageCompound() split_huge_page() page = compound_head(page) PageDoubleMap(page) When calling PageDoubleMap() this page is not a tail page of THP anymore so the BUG is triggered. This could be fixed by elevated refcount of the page before calling mapcount, but that would prevent it from counting migration entries, and it seems overkilling because the race just could happen when PMD is split so all PTE entries of tail pages are actually migration entries, and smaps_account() does treat migration entries as mapcount == 1 as Kirill pointed out. Add a new parameter for smaps_account() to tell this entry is migration entry then skip calling page_mapcount(). Don't skip getting mapcount for device private entries since they do track references with mapcount. Pagemap also has the similar issue although it was not reported. Fixed it as well. [shy828301@gmail.com: v4] Link: https://lkml.kernel.org/r/20220203182641.824731-1-shy828301@gmail.com [nathan@kernel.org: avoid unused variable warning in pagemap_pmd_range()] Link: https://lkml.kernel.org/r/20220207171049.1102239-1-nathan@kernel.org Link: https://lkml.kernel.org/r/20220120202805.3369-1-shy828301@gmail.com Fixes: e9b61f19858a ("thp: reintroduce split_huge_page()") Signed-off-by: Yang Shi Signed-off-by: Nathan Chancellor Reported-by: syzbot+1f52b3a18d5633fa7f82@syzkaller.appspotmail.com Acked-by: David Hildenbrand Cc: "Kirill A. Shutemov" Cc: Jann Horn Cc: Matthew Wilcox Cc: Alexey Dobriyan Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 925346c129da1171222a9cdb11fa2b734d9955da Author: Mike Rapoport Date: Fri Feb 11 16:32:22 2022 -0800 fs/binfmt_elf: fix PT_LOAD p_align values for loaders Rui Salvaterra reported that Aisleroit solitaire crashes with "Wrong __data_start/_end pair" assertion from libgc after update to v5.17-rc1. Bisection pointed to commit 9630f0d60fec ("fs/binfmt_elf: use PT_LOAD p_align values for static PIE") that fixed handling of static PIEs, but made the condition that guards load_bias calculation to exclude loader binaries. Restoring the check for presence of interpreter fixes the problem. Link: https://lkml.kernel.org/r/20220202121433.3697146-1-rppt@kernel.org Fixes: 9630f0d60fec ("fs/binfmt_elf: use PT_LOAD p_align values for static PIE") Signed-off-by: Mike Rapoport Reported-by: Rui Salvaterra Tested-by: Rui Salvaterra Cc: Alexander Viro Cc: Eric Biederman Cc: "H.J. Lu" Cc: Kees Cook Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3916c3619599a3970d3e6f98fb430b7c46266ada Author: Corentin Labbe Date: Wed Feb 9 12:03:55 2022 +0000 ARM: dts: rockchip: fix a typo on rk3288 crypto-controller crypto-controller had a typo, fix it. In the same time, rename it to just crypto Signed-off-by: Corentin Labbe Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220209120355.1985707-1-clabbe@baylibre.com Signed-off-by: Heiko Stuebner commit be4e65bdffab5f588044325117df77dad7e9c45a Author: Sascha Hauer Date: Thu Feb 10 15:23:53 2022 +0100 ARM: dts: rockchip: reorder rk322x hmdi clocks The binding specifies the clock order to "iahb", "isfr", "cec". Reorder the clocks accordingly. Signed-off-by: Sascha Hauer Link: https://lore.kernel.org/r/20220210142353.3420859-1-s.hauer@pengutronix.de Signed-off-by: Heiko Stuebner commit bf8e59fd315f304eb538546e35de6dc603e4709f Author: Gatis Peisenieks Date: Fri Feb 11 08:51:23 2022 +0200 atl1c: fix tx timeout after link flap on Mikrotik 10/25G NIC If NIC had packets in tx queue at the moment link down event happened, it could result in tx timeout when link got back up. Since device has more than one tx queue we need to reset them accordingly. Fixes: 057f4af2b171 ("atl1c: add 4 RX/TX queue support for Mikrotik 10/25G NIC") Signed-off-by: Gatis Peisenieks Link: https://lore.kernel.org/r/20220211065123.4187615-1-gatis@mikrotik.com Signed-off-by: Jakub Kicinski commit 6c342ce2239c182c2428ce5a44cb32330434ae6e Author: Jeremy Kerr Date: Fri Feb 11 09:15:52 2022 +0800 mctp: serial: Cancel pending work from ndo_uninit handler We cannot do the cancel_work_sync from after the unregister_netdev, as the dev pointer is no longer valid, causing a uaf on ldisc unregister (or device close). Instead, do the cancel_work_sync from the ndo_uninit op, where the dev still exists, but the queue has stopped. Fixes: 7bd9890f3d74 ("mctp: serial: cancel tx work on ldisc close") Reported-by: Luo Likang Tested-by: Luo Likang Signed-off-by: Jeremy Kerr Link: https://lore.kernel.org/r/20220211011552.1861886-1-jk@codeconstruct.com.au Signed-off-by: Jakub Kicinski commit 28df029d53a2fd80c1b8674d47895648ad26dcfb Author: Cheng Jui Wang Date: Thu Feb 10 18:50:11 2022 +0800 lockdep: Correct lock_classes index mapping A kernel exception was hit when trying to dump /proc/lockdep_chains after lockdep report "BUG: MAX_LOCKDEP_CHAIN_HLOCKS too low!": Unable to handle kernel paging request at virtual address 00054005450e05c3 ... 00054005450e05c3] address between user and kernel address ranges ... pc : [0xffffffece769b3a8] string+0x50/0x10c lr : [0xffffffece769ac88] vsnprintf+0x468/0x69c ... Call trace: string+0x50/0x10c vsnprintf+0x468/0x69c seq_printf+0x8c/0xd8 print_name+0x64/0xf4 lc_show+0xb8/0x128 seq_read_iter+0x3cc/0x5fc proc_reg_read_iter+0xdc/0x1d4 The cause of the problem is the function lock_chain_get_class() will shift lock_classes index by 1, but the index don't need to be shifted anymore since commit 01bb6f0af992 ("locking/lockdep: Change the range of class_idx in held_lock struct") already change the index to start from 0. The lock_classes[-1] located at chain_hlocks array. When printing lock_classes[-1] after the chain_hlocks entries are modified, the exception happened. The output of lockdep_chains are incorrect due to this problem too. Fixes: f611e8cf98ec ("lockdep: Take read/write status in consideration when generate chainkey") Signed-off-by: Cheng Jui Wang Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Boqun Feng Link: https://lore.kernel.org/r/20220210105011.21712-1-cheng-jui.wang@mediatek.com commit 6bb9681a43f34f2cab4aad6e2a02da4ce54d13c5 Author: Mans Rullgard Date: Wed Feb 9 14:54:54 2022 +0000 net: dsa: lan9303: fix reset on probe The reset input to the LAN9303 chip is active low, and devicetree gpio handles reflect this. Therefore, the gpio should be requested with an initial state of high in order for the reset signal to be asserted. Other uses of the gpio already use the correct polarity. Fixes: a1292595e006 ("net: dsa: add new DSA switch driver for the SMSC-LAN9303") Signed-off-by: Mans Rullgard Reviewed-by: Andrew Lunn Reviewed-by: Florian Fianelil Link: https://lore.kernel.org/r/20220209145454.19749-1-mans@mansr.com Signed-off-by: Jakub Kicinski commit 06582bc86d7f48d35cd044098ca1e246e8c7c52e Author: Ming Lei Date: Wed Jan 26 11:58:30 2022 +0800 block: loop:use kstatfs.f_bsize of backing file to set discard granularity If backing file's filesystem has implemented ->fallocate(), we think the loop device can support discard, then pass sb->s_blocksize as discard_granularity. However, some underlying FS, such as overlayfs, doesn't set sb->s_blocksize, and causes discard_granularity to be set as zero, then the warning in __blkdev_issue_discard() is triggered. Christoph suggested to pass kstatfs.f_bsize as discard granularity, and this way is fine because kstatfs.f_bsize means 'Optimal transfer block size', which still matches with definition of discard granularity. So fix the issue by setting discard_granularity as kstatfs.f_bsize if it is available, otherwise claims discard isn't supported. Cc: Christoph Hellwig Cc: Vivek Goyal Reported-by: Pei Zhang Signed-off-by: Ming Lei Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220126035830.296465-1-ming.lei@redhat.com Signed-off-by: Jens Axboe commit f10f582d28220f50099d3f561116256267821429 Author: Mike Christie Date: Tue Feb 8 12:54:48 2022 -0600 scsi: qedi: Fix ABBA deadlock in qedi_process_tmf_resp() and qedi_process_cmd_cleanup_resp() This fixes a deadlock added with commit b40f3894e39e ("scsi: qedi: Complete TMF works before disconnect") Bug description from Jia-Ju Bai: qedi_process_tmf_resp() spin_lock(&session->back_lock); --> Line 201 (Lock A) spin_lock(&qedi_conn->tmf_work_lock); --> Line 230 (Lock B) qedi_process_cmd_cleanup_resp() spin_lock_bh(&qedi_conn->tmf_work_lock); --> Line 752 (Lock B) spin_lock_bh(&conn->session->back_lock); --> Line 784 (Lock A) When qedi_process_tmf_resp() and qedi_process_cmd_cleanup_resp() are concurrently executed, the deadlock can occur. This patch fixes the deadlock by not holding the tmf_work_lock in qedi_process_cmd_cleanup_resp while holding the back_lock. The tmf_work_lock is only needed while we remove the tmf_work from the work_list. Link: https://lore.kernel.org/r/20220208185448.6206-1-michael.christie@oracle.com Fixes: b40f3894e39e ("scsi: qedi: Complete TMF works before disconnect") Cc: Manish Rangankar Cc: Nilesh Javali Reported-by: TOTE Robot Reported-by: Jia-Ju Bai Signed-off-by: Mike Christie Signed-off-by: Martin K. Petersen commit 83e396641110663d3c7bb25b9bc0c6a750359ecf Merge: adccc16ea3c5f 5e5eddd94c890 Author: Linus Torvalds Date: Fri Feb 11 13:40:03 2022 -0800 Merge tag 'soc-fixes-5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC fixes from Arnd Bergmann: "This is a fairly large set of bugfixes, most of which had been sent a while ago but only now made it into the soc tree: Maintainer file updates: - Claudiu Beznea now co-maintains the at91 soc family, replacing Ludovic Desroches. - Michael Walle maintains the sl28cpld drivers - Alain Volmat and Raphael Gallais-Pou take over some drivers for ST platforms - Alim Akhtar is an additional reviewer for Samsung platforms Code fixes: - Op-tee had a problem with object lifetime that needs a slightly complex fix, as well as another bug with error handling. - Several minor issues for the OMAP platform, including a regression with the timer - A Kconfig change to fix a build-time issue on Intel SoCFPGA Device tree fixes: - The Amlogic Meson platform fixes a boot regression on am1-odroid, a spurious interrupt, and a problem with reserved memory regions - In the i.MX platform, several bug fixes are needed to make devices work correctly: SD card detection, alarmtimer, and sound card on some board. One patch for the GPU got in there by accident and gets reverted again. - TI K3 needs a fix for J721S2 serial port numbers - ux500 needs a fix to mount the SD card as root on the Skomer phone" * tag 'soc-fixes-5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (46 commits) Revert "arm64: dts: imx8mn-venice-gw7902: disable gpu" arm64: Remove ARCH_VULCAN MAINTAINERS: add myself as a maintainer for the sl28cpld MAINTAINERS: add IRC to ARM sub-architectures and Devicetree MAINTAINERS: arm: samsung: add Git tree and IRC ARM: dts: Fix boot regression on Skomer ARM: dts: spear320: Drop unused and undocumented 'irq-over-gpio' property soc: aspeed: lpc-ctrl: Block error printing on probe defer cases docs/ABI: testing: aspeed-uart-routing: Escape asterisk MAINTAINERS: update drm/stm drm/sti and cec/sti maintainers MAINTAINERS: Update Benjamin Gaignard maintainer status ARM: socfpga: fix missing RESET_CONTROLLER arm64: dts: meson-sm1-odroid: fix boot loop after reboot arm64: dts: meson-g12: drop BL32 region from SEI510/SEI610 arm64: dts: meson-g12: add ATF BL32 reserved-memory region arm64: dts: meson-gx: add ATF BL32 reserved-memory region arm64: dts: meson-sm1-bananapi-m5: fix wrong GPIO domain for GPIOE_2 arm64: dts: meson-sm1-odroid: use correct enable-gpio pin for tf-io regulator arm64: dts: meson-g12b-odroid-n2: fix typo 'dio2133' optee: use driver internal tee_context for some rpc ... commit 3df9d803163e1616c2e742be8a7bfc00ac444ea8 Merge: acc3c47394a17 5eaed6eedbe96 Author: Alexei Starovoitov Date: Fri Feb 11 13:21:47 2022 -0800 Merge branch 'bpf: fix a bpf_timer initialization issue' Yonghong Song says: ==================== The patch [1] exposed a bpf_timer initialization bug in function check_and_init_map_value(). With bug fix here, the patch [1] can be applied with all selftests passed. Please see individual patches for fix details. [1] https://lore.kernel.org/bpf/20220209070324.1093182-2-memxor@gmail.com/ Changelog: v3 -> v4: . move header file in patch #1 to avoid bpf-next merge conflict v2 -> v3: . switch patch #1 and patch #2 for better bisecting v1 -> v2: . add Fixes tag for patch #1 . rebase against bpf tree ==================== Signed-off-by: Alexei Starovoitov commit 5eaed6eedbe9612f642ad2b880f961d1c6c8ec2b Author: Yonghong Song Date: Fri Feb 11 11:49:53 2022 -0800 bpf: Fix a bpf_timer initialization issue The patch in [1] intends to fix a bpf_timer related issue, but the fix caused existing 'timer' selftest to fail with hang or some random errors. After some debug, I found an issue with check_and_init_map_value() in the hashtab.c. More specifically, in hashtab.c, we have code l_new = bpf_map_kmalloc_node(&htab->map, ...) check_and_init_map_value(&htab->map, l_new...) Note that bpf_map_kmalloc_node() does not do initialization so l_new contains random value. The function check_and_init_map_value() intends to zero the bpf_spin_lock and bpf_timer if they exist in the map. But I found bpf_spin_lock is zero'ed but bpf_timer is not zero'ed. With [1], later copy_map_value() skips copying of bpf_spin_lock and bpf_timer. The non-zero bpf_timer caused random failures for 'timer' selftest. Without [1], for both bpf_spin_lock and bpf_timer case, bpf_timer will be zero'ed, so 'timer' self test is okay. For check_and_init_map_value(), why bpf_spin_lock is zero'ed properly while bpf_timer not. In bpf uapi header, we have struct bpf_spin_lock { __u32 val; }; struct bpf_timer { __u64 :64; __u64 :64; } __attribute__((aligned(8))); The initialization code: *(struct bpf_spin_lock *)(dst + map->spin_lock_off) = (struct bpf_spin_lock){}; *(struct bpf_timer *)(dst + map->timer_off) = (struct bpf_timer){}; It appears the compiler has no obligation to initialize anonymous fields. For example, let us use clang with bpf target as below: $ cat t.c struct bpf_timer { unsigned long long :64; }; struct bpf_timer2 { unsigned long long a; }; void test(struct bpf_timer *t) { *t = (struct bpf_timer){}; } void test2(struct bpf_timer2 *t) { *t = (struct bpf_timer2){}; } $ clang -target bpf -O2 -c -g t.c $ llvm-objdump -d t.o ... 0000000000000000 : 0: 95 00 00 00 00 00 00 00 exit 0000000000000008 : 1: b7 02 00 00 00 00 00 00 r2 = 0 2: 7b 21 00 00 00 00 00 00 *(u64 *)(r1 + 0) = r2 3: 95 00 00 00 00 00 00 00 exit gcc11.2 does not have the above issue. But from INTERNATIONAL STANDARD ©ISO/IEC ISO/IEC 9899:201x Programming languages — C http://www.open-std.org/Jtc1/sc22/wg14/www/docs/n1547.pdf page 157: Except where explicitly stated otherwise, for the purposes of this subclause unnamed members of objects of structure and union type do not participate in initialization. Unnamed members of structure objects have indeterminate value even after initialization. To fix the problem, let use memset for bpf_timer case in check_and_init_map_value(). For consistency, memset is also used for bpf_spin_lock case. [1] https://lore.kernel.org/bpf/20220209070324.1093182-2-memxor@gmail.com/ Fixes: 68134668c17f3 ("bpf: Add map side support for bpf timers.") Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220211194953.3142152-1-yhs@fb.com commit 3bd916ee0ecbbdd902fc24845f2fef332b2a310c Author: Yonghong Song Date: Fri Feb 11 11:49:48 2022 -0800 bpf: Emit bpf_timer in vmlinux BTF Currently the following code in check_and_init_map_value() *(struct bpf_timer *)(dst + map->timer_off) = (struct bpf_timer){}; can help generate bpf_timer definition in vmlinuxBTF. But the code above may not zero the whole structure due to anonymour members and that code will be replaced by memset in the subsequent patch and bpf_timer definition will disappear from vmlinuxBTF. Let us emit the type explicitly so bpf program can continue to use it from vmlinux.h. Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220211194948.3141529-1-yhs@fb.com commit a8cd28553f0f7979668473b0b4675e5dd7587a48 Merge: 5e5eddd94c890 26077968f8389 Author: Arnd Bergmann Date: Fri Feb 11 22:13:16 2022 +0100 Merge tag 'at91-fixes-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into arm/fixes AT91 fixes #1 for 5.17: - MAINTAINERS file update. * tag 'at91-fixes-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: dt-bindings: ARM: at91: update maintainers entry MAINTAINERS: replace a Microchip AT91 maintainer Link: https://lore.kernel.org/r/20220211133515.15314-1-nicolas.ferre@microchip.com Signed-off-by: Arnd Bergmann commit acc3c47394a1790b4023ca316ac46e798338dd1a Merge: 4a11678f68381 a7e75016a0753 Author: Alexei Starovoitov Date: Fri Feb 11 13:13:04 2022 -0800 Merge branch 'Fix for crash due to overwrite in copy_map_value' Kumar Kartikeya says: ==================== A fix for an oversight in copy_map_value that leads to kernel crash. Also, a question for BPF developers: It seems in arraymap.c, we always do check_and_free_timer_in_array after we do copy_map_value in map_update_elem callback, but the same is not done for hashtab.c. Is there a specific reason for this difference in behavior, or did I miss that it happens for hashtab.c as well? Changlog: --------- v1 -> v2: v1: https://lore.kernel.org/bpf/20220209051113.870717-1-memxor@gmail.com * Fix build error for selftests patch due to missing SYS_PREFIX in bpf tree ==================== Signed-off-by: Alexei Starovoitov commit a7e75016a0753c24d6c995bc02501ae35368e333 Author: Kumar Kartikeya Dwivedi Date: Wed Feb 9 12:33:24 2022 +0530 selftests/bpf: Add test for bpf_timer overwriting crash Add a test that validates that timer value is not overwritten when doing a copy_map_value call in the kernel. Without the prior fix, this test triggers a crash. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220209070324.1093182-3-memxor@gmail.com commit a8abb0c3dc1e28454851a00f8b7333d9695d566c Author: Kumar Kartikeya Dwivedi Date: Wed Feb 9 12:33:23 2022 +0530 bpf: Fix crash due to incorrect copy_map_value When both bpf_spin_lock and bpf_timer are present in a BPF map value, copy_map_value needs to skirt both objects when copying a value into and out of the map. However, the current code does not set both s_off and t_off in copy_map_value, which leads to a crash when e.g. bpf_spin_lock is placed in map value with bpf_timer, as bpf_map_update_elem call will be able to overwrite the other timer object. When the issue is not fixed, an overwriting can produce the following splat: [root@(none) bpf]# ./test_progs -t timer_crash [ 15.930339] bpf_testmod: loading out-of-tree module taints kernel. [ 16.037849] ================================================================== [ 16.038458] BUG: KASAN: user-memory-access in __pv_queued_spin_lock_slowpath+0x32b/0x520 [ 16.038944] Write of size 8 at addr 0000000000043ec0 by task test_progs/325 [ 16.039399] [ 16.039514] CPU: 0 PID: 325 Comm: test_progs Tainted: G OE 5.16.0+ #278 [ 16.039983] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS ArchLinux 1.15.0-1 04/01/2014 [ 16.040485] Call Trace: [ 16.040645] [ 16.040805] dump_stack_lvl+0x59/0x73 [ 16.041069] ? __pv_queued_spin_lock_slowpath+0x32b/0x520 [ 16.041427] kasan_report.cold+0x116/0x11b [ 16.041673] ? __pv_queued_spin_lock_slowpath+0x32b/0x520 [ 16.042040] __pv_queued_spin_lock_slowpath+0x32b/0x520 [ 16.042328] ? memcpy+0x39/0x60 [ 16.042552] ? pv_hash+0xd0/0xd0 [ 16.042785] ? lockdep_hardirqs_off+0x95/0xd0 [ 16.043079] __bpf_spin_lock_irqsave+0xdf/0xf0 [ 16.043366] ? bpf_get_current_comm+0x50/0x50 [ 16.043608] ? jhash+0x11a/0x270 [ 16.043848] bpf_timer_cancel+0x34/0xe0 [ 16.044119] bpf_prog_c4ea1c0f7449940d_sys_enter+0x7c/0x81 [ 16.044500] bpf_trampoline_6442477838_0+0x36/0x1000 [ 16.044836] __x64_sys_nanosleep+0x5/0x140 [ 16.045119] do_syscall_64+0x59/0x80 [ 16.045377] ? lock_is_held_type+0xe4/0x140 [ 16.045670] ? irqentry_exit_to_user_mode+0xa/0x40 [ 16.046001] ? mark_held_locks+0x24/0x90 [ 16.046287] ? asm_exc_page_fault+0x1e/0x30 [ 16.046569] ? asm_exc_page_fault+0x8/0x30 [ 16.046851] ? lockdep_hardirqs_on+0x7e/0x100 [ 16.047137] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 16.047405] RIP: 0033:0x7f9e4831718d [ 16.047602] Code: b4 0c 00 0f 05 eb a9 66 0f 1f 44 00 00 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 b3 6c 0c 00 f7 d8 64 89 01 48 [ 16.048764] RSP: 002b:00007fff488086b8 EFLAGS: 00000206 ORIG_RAX: 0000000000000023 [ 16.049275] RAX: ffffffffffffffda RBX: 00007f9e48683740 RCX: 00007f9e4831718d [ 16.049747] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00007fff488086d0 [ 16.050225] RBP: 00007fff488086f0 R08: 00007fff488085d7 R09: 00007f9e4cb594a0 [ 16.050648] R10: 0000000000000000 R11: 0000000000000206 R12: 00007f9e484cde30 [ 16.051124] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 [ 16.051608] [ 16.051762] ================================================================== Fixes: 68134668c17f ("bpf: Add map side support for bpf timers.") Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220209070324.1093182-2-memxor@gmail.com commit adccc16ea3c5fb205bdec0133d08e799aa6cc9ea Merge: 1d41d2e82623b 075b7d363c675 Author: Linus Torvalds Date: Fri Feb 11 12:55:17 2022 -0800 Merge tag 'pci-v5.17-fixes-4' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci Pull pci fix from Bjorn Helgaas: "Revert a commit that reduced the number of IRQs used but resulted in interrupt storms (Bjorn Helgaas)" * tag 'pci-v5.17-fixes-4' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: Revert "PCI/portdrv: Do not setup up IRQs if there are no users" commit f444578d727a0ca4a72b19cd4a1d7da9f1fb99fe Author: Linus Walleij Date: Mon Jan 10 16:50:07 2022 +0100 power: supply: bq256xx: Handle OOM correctly Since we now return a pointer to an allocated object we need to account for memory allocation failure in a separate error path. Fixes: 25fd330370ac ("power: supply_core: Pass pointer to battery info") Reported-by: Dan Carpenter Signed-off-by: Linus Walleij Signed-off-by: Sebastian Reichel commit 075b7d363c675ef7fa03918881caeca3458e2a96 Author: Bjorn Helgaas Date: Mon Feb 7 16:33:30 2022 -0600 Revert "PCI/portdrv: Do not setup up IRQs if there are no users" This reverts commit 0e8ae5a6ff5952253cd7cc0260df838ab4c21009. 0e8ae5a6ff59 ("PCI/portdrv: Do not setup up IRQs if there are no users") reduced usage of IRQs when we don't think we need them. But Joey, Sergiu, and David reported choppy GUI rendering, systems that became unresponsive every few seconds, incorrect values reported by cpufreq, and high IRQ 16 CPU usage. Joey bisected the issues to 0e8ae5a6ff59, so revert it until we figure out a better solution. Link: https://lore.kernel.org/r/20220210222717.GA658201@bhelgaas Link: https://bugzilla.kernel.org/show_bug.cgi?id=215533 Link: https://bugzilla.kernel.org/show_bug.cgi?id=215546 Reported-by: Joey Corleone Reported-by: Sergiu Deitsch Reported-by: David Spencer Signed-off-by: Bjorn Helgaas Cc: stable@vger.kernel.org # v5.16+ Cc: Jan Kiszka commit 1d41d2e82623b40ee27811fe9ea38bafe2e722e9 Merge: e47ca40326268 6df2a016c0c8a Author: Linus Torvalds Date: Fri Feb 11 12:02:09 2022 -0800 Merge tag 'riscv-for-linus-5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull RISC-V fixes from Palmer Dabbelt: - A fix to avoid undefined behavior when stack backtracing, which manifests in GCC as incorrect stack addresses - A few fixes for the XIP kernels - A fix to tracking NUMA state on CPU hotplug - Support for the recently relesaed binutils-2.38, which changed the default ISA version to one without CSRs or fence.i in 'I' extension * tag 'riscv-for-linus-5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: riscv: fix build with binutils 2.38 riscv: cpu-hotplug: clear cpu from numa map when teardown riscv: extable: fix err reg writing in dedicated uaccess handler riscv/mm: Add XIP_FIXUP for riscv_pfn_base riscv/mm: Add XIP_FIXUP for phys_ram_base riscv: Fix XIP_FIXUP_FLASH_OFFSET riscv: eliminate unreliable __builtin_frame_address(1) commit e47ca403262680db81dbd8bbfd40e7f522c7f147 Merge: 883fd0aba1ae5 da5fb9e1ad3fb Author: Linus Torvalds Date: Fri Feb 11 11:55:26 2022 -0800 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fixes from Catalin Marinas: - Enable Cortex-A510 erratum 2051678 by default as we do with other errata. - arm64 IORT: Check the node revision for PMCG resources to cope with old firmware based on a broken revision of the spec that had no way to describe the second register page (when an implementation is using the recommended RELOC_CTRS feature). * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: ACPI/IORT: Check node revision for PMCG resources arm64: Enable Cortex-A510 erratum 2051678 by default commit 883fd0aba1ae52b800081b9aa9ba9edfc88f36b0 Merge: 8ce964b520ad0 27a98fe60b033 Author: Linus Torvalds Date: Fri Feb 11 11:48:13 2022 -0800 Merge tag 'acpi-5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI fixes from Rafael Wysocki: "These revert two commits that turned out to be problematic and fix two issues related to wakeup from suspend-to-idle on x86. Specifics: - Revert a recent change that attempted to avoid issues with conflicting address ranges during PCI initialization, because it turned out to introduce a regression (Hans de Goede). - Revert a change that limited EC GPE wakeups from suspend-to-idle to systems based on Intel hardware, because it turned out that systems based on hardware from other vendors depended on that functionality too (Mario Limonciello). - Fix two issues related to the handling of wakeup interrupts and wakeup events signaled through the EC GPE during suspend-to-idle on x86 (Rafael Wysocki)" * tag 'acpi-5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: x86/PCI: revert "Ignore E820 reservations for bridge windows on newer systems" PM: s2idle: ACPI: Fix wakeup interrupts handling ACPI: PM: s2idle: Cancel wakeup before dispatching EC GPE ACPI: PM: Revert "Only mark EC GPE for wakeup on Intel systems" commit 8ce964b520ad0ad626cb1ee93a444aedceed5425 Merge: cf26a2360a6e1 d3add1a9519dc Author: Linus Torvalds Date: Fri Feb 11 11:36:32 2022 -0800 Merge tag 'gfs2-v5.16-rc3-fixes2' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2 Pull gfs2 fixes from Andreas Gruenbacher: - Revert debug commit that causes unexpected data corruption - Fix muti-block reservation regression * tag 'gfs2-v5.16-rc3-fixes2' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2: gfs2: Fix gfs2_release for non-writers regression Revert "gfs2: check context in gfs2_glock_put" commit cf26a2360a6e1352a9e0bebabbbcad2b92dd8c6c Merge: 199b7f84c428d bf23747ee0532 Author: Linus Torvalds Date: Fri Feb 11 11:26:07 2022 -0800 Merge tag 'block-5.17-2022-02-11' of git://git.kernel.dk/linux-block Pull block fixes from Jens Axboe: - NVMe pull request - nvme-tcp: fix bogus request completion when failing to send AER (Sagi Grimberg) - add the missing nvme_complete_req tracepoint for batched completion (Bean Huo) - Revert of the loop async autoclear issue that has continued to plague us this release. A few patchsets exists to improve this, but they are too invasive to be considered at this point (Tetsuo) * tag 'block-5.17-2022-02-11' of git://git.kernel.dk/linux-block: loop: revert "make autoclear operation asynchronous" nvme-tcp: fix bogus request completion when failing to send AER nvme: add nvme_complete_req tracepoint for batched completion commit 199b7f84c428d90e1858dafa583f7b1d587cbeb8 Merge: 0b9df436192aa 0a3f1e0beacf6 Author: Linus Torvalds Date: Fri Feb 11 11:18:42 2022 -0800 Merge tag 'io_uring-5.17-2022-02-11' of git://git.kernel.dk/linux-block Pull io_uring fixes from Jens Axboe: - Fix a false-positive warning from an older gcc (Alviro) - Allow oom killer invocations from io_uring_setup (Shakeel) * tag 'io_uring-5.17-2022-02-11' of git://git.kernel.dk/linux-block: mm: io_uring: allow oom-killer from io_uring_setup io_uring: Clean up a false-positive warning from GCC 9.3.0 commit 0b9df436192aae9f9705bfe42f6e618dd4773792 Merge: 284fce0443329 c162ca0bcbfb3 Author: Linus Torvalds Date: Fri Feb 11 11:05:49 2022 -0800 Merge tag 'gpio-fixes-for-v5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux Pull gpio fixes from Bartosz Golaszewski: - use sleeping variants of GPIO accessors where needed in gpio-aggregator - never return kernel's internal error codes to user-space in gpiolib core - use the correct register for reading output values in gpio-sifive - fix line hogging in gpio-sim * tag 'gpio-fixes-for-v5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: gpio: sim: fix hogs with custom chip labels gpio: sifive: use the correct register to read output values gpiolib: Never return internal error codes to user space gpio: aggregator: Fix calling into sleeping GPIO controllers commit 284fce0443329b641694894bd1757e4cda626c1f Merge: c3ee3a9e4fa6b c8ea23d5fa59f Author: Linus Torvalds Date: Fri Feb 11 10:42:31 2022 -0800 Merge tag 'ata-5.17-rc4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata Pull ata fixes from Damien Le Moal: "A couple of additional fixes for 5.17-rc4: - Fix compilation warnings in the sata_fsl driver (powerpc) (me) - Disable TRIM commands on M88V29 devices as these commands are failing despite the device reporting it supports TRIM (Zoltan)" * tag 'ata-5.17-rc4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata: ata: libata-core: Disable TRIM on M88V29 ata: sata_fsl: fix sscanf() and sysfs_emit() format strings commit c3ee3a9e4fa6b1d249b5abff2d4c7dab5a47d522 Merge: 32f6c5d037740 95e875bdb1862 Author: Linus Torvalds Date: Fri Feb 11 10:35:12 2022 -0800 Merge tag 'drm-fixes-2022-02-11' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Regular fixes pull, mostly i915 and amd fixes, along with a maintainers update for fbdev core. Otherwise just some build fixes and vc4 HDMI fixes. fbdev: - MAINTAINERS: add Daniel as fbdev core module maintainer - build warning fix - implicit type cast fix panel: - simple: Fix assignments from panel_dpi_probe() privacy-screen: - fix docs warning i915: - non-x86 build fix - ttm error propogation fix - drrs on hsw/ivb disabled - BIOS readout fixes - missing stackdepot oops fix amd: - DCN 3.1 display fixes - GC 10.3.1 harvest fix - Page flip irq fix - hwmon label fix - DCN 2.0 display fix rockchip: - fix HDMI error cleanup - fix RK3399 VOP register fields vc4: - HDMI fixes - remove redundant code" * tag 'drm-fixes-2022-02-11' of git://anongit.freedesktop.org/drm/drm: (25 commits) drm/amdgpu/display: change pipe policy for DCN 2.0 drm/amd/pm: fix hwmon node of power1_label create issue drm/amd/display: keep eDP Vdd on when eDP stream is already enabled drm/amd/display: fix yellow carp wm clamping drm/amd/display: Cap pflip irqs per max otg number drm/amdgpu: add utcl2_harvest to gc 10.3.1 display/amd: decrease message verbosity about watermarks table failure drm/rockchip: vop: Correct RK3399 VOP register fields drm/rockchip: dw_hdmi: Do not leave clock enabled in error case MAINTAINERS: Add entry for fbdev core fbcon: Avoid 'cap' set but not used warning drm/privacy-screen: Fix sphinx warning drm/i915: Workaround broken BIOS DBUF configuration on TGL/RKL drm/i915: Populate pipe dbuf slices more accurately during readout drm/i915: Allow !join_mbus cases for adlp+ dbuf configuration drm/i915: Fix header test for !CONFIG_X86 drm/i915/ttm: Return some errors instead of trying memcpy move drm/i915: Disable DRRS on IVB/HSW port != A drm/i915: Fix oops due to missing stack depot drm/vc4: crtc: Fix redundant variable assignment ... commit 32f6c5d037740835043f58f5c59b29841dbe39ff Merge: f1baf68e1383f 3203ce39ac0b2 Author: Linus Torvalds Date: Fri Feb 11 10:22:48 2022 -0800 Merge tag 'trace-v5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing fixes from Steven Rostedt: - Fixes to the RTLA tooling - A fix to a tp_printk overriding tp_printk_stop_on_boot on the command line * tag 'trace-v5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing: Fix tp_printk option related with tp_printk_stop_on_boot MAINTAINERS: Add RTLA entry rtla: Fix segmentation fault when failing to enable -t rtla/trace: Error message fixup rtla/utils: Fix session duration parsing rtla: Follow kernel version commit 66fa226c131fb89287f8f7d004a46e39a859fbf6 Author: Maxim Levitsky Date: Tue Feb 8 06:48:42 2022 -0500 KVM: SVM: fix race between interrupt delivery and AVIC inhibition If svm_deliver_avic_intr is called just after the target vcpu's AVIC got inhibited, it might read a stale value of vcpu->arch.apicv_active which can lead to the target vCPU not noticing the interrupt. To fix this use load-acquire/store-release so that, if the target vCPU is IN_GUEST_MODE, we're guaranteed to see a previous disabling of the AVIC. If AVIC has been disabled in the meanwhile, proceed with the KVM_REQ_EVENT-based delivery. Incomplete IPI vmexit has the same races as svm_deliver_avic_intr, and in fact it can be handled in exactly the same way; the only difference lies in who has set IRR, whether svm_deliver_interrupt or the processor. Therefore, svm_complete_interrupt_delivery can be used to fix incomplete IPI vmexits as well. Co-developed-by: Paolo Bonzini Signed-off-by: Paolo Bonzini Signed-off-by: Maxim Levitsky Signed-off-by: Paolo Bonzini commit 30811174f0dbe17fd58eba5c22c50292c083c75b Author: Paolo Bonzini Date: Tue Feb 8 06:57:07 2022 -0500 KVM: SVM: set IRR in svm_deliver_interrupt SVM has to set IRR for both the AVIC and the software-LAPIC case, so pull it up to the common function that handles both configurations. Signed-off-by: Paolo Bonzini commit 0a5f784273aad41a22963fc8b818ead3c892c97a Author: Maxim Levitsky Date: Tue Feb 8 06:45:16 2022 -0500 KVM: SVM: extract avic_ring_doorbell The check on the current CPU adds an extra level of indentation to svm_deliver_avic_intr and conflates documentation on what happens if the vCPU exits (of interest to svm_deliver_avic_intr) and migrates (only of interest to avic_ring_doorbell, which calls get/put_cpu()). Extract the wrmsr to a separate function and rewrite the comment in svm_deliver_avic_intr(). Co-developed-by: Paolo Bonzini Signed-off-by: Paolo Bonzini Signed-off-by: Maxim Levitsky Signed-off-by: Paolo Bonzini commit 0316dbb9a017d3231f86e0188376f067ec26a59c Author: Muhammad Usama Anjum Date: Thu Feb 10 22:23:51 2022 +0500 selftests: kvm: Remove absent target file There is no vmx_pi_mmio_test file. Remove it to get rid of error while creation of selftest archive: rsync: [sender] link_stat "/kselftest/kvm/x86_64/vmx_pi_mmio_test" failed: No such file or directory (2) rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1333) [sender=3.2.3] Fixes: 6a58150859fd ("selftest: KVM: Add intra host migration tests") Reported-by: "kernelci.org bot" Signed-off-by: Muhammad Usama Anjum Message-Id: <20220210172352.1317554-1-usama.anjum@collabora.com> Signed-off-by: Paolo Bonzini commit 02a4a69667a2ad32f3b52ca906f19628fbdd8a01 Author: Vladimir Zapolskiy Date: Thu Feb 3 18:47:03 2022 +0200 i2c: qcom-cci: don't put a device tree node before i2c_add_adapter() There is a minor chance for a race, if a pointer to an i2c-bus subnode is stored and then reused after releasing its reference, and it would be sufficient to get one more reference under a loop over children subnodes. Fixes: e517526195de ("i2c: Add Qualcomm CCI I2C driver") Signed-off-by: Vladimir Zapolskiy Reviewed-by: Robert Foss Reviewed-by: Bjorn Andersson Signed-off-by: Wolfram Sang commit a0d48505a1d68e27220369e2dd1e3573a2f362d2 Author: Vladimir Zapolskiy Date: Thu Feb 3 18:47:00 2022 +0200 i2c: qcom-cci: don't delete an unregistered adapter If i2c_add_adapter() fails to add an I2C adapter found on QCOM CCI controller, on error path i2c_del_adapter() is still called. Fortunately there is a sanity check in the I2C core, so the only visible implication is a printed debug level message: i2c-core: attempting to delete unregistered adapter [Qualcomm-CCI] Nevertheless it would be reasonable to correct the probe error path. Fixes: e517526195de ("i2c: Add Qualcomm CCI I2C driver") Signed-off-by: Vladimir Zapolskiy Reviewed-by: Robert Foss Reviewed-by: Bjorn Andersson Signed-off-by: Wolfram Sang commit a7e793a867ae312cecdeb6f06cceff98263e75dd Author: Muhammad Usama Anjum Date: Thu Feb 10 22:13:23 2022 +0500 selftests/exec: Add non-regular to TEST_GEN_PROGS non-regular file needs to be compiled and then copied to the output directory. Remove it from TEST_PROGS and add it to TEST_GEN_PROGS. This removes error thrown by rsync when non-regular object isn't found: rsync: [sender] link_stat "/linux/tools/testing/selftests/exec/non-regular" failed: No such file or directory (2) rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1333) [sender=3.2.3] Fixes: 0f71241a8e32 ("selftests/exec: add file type errno tests") Reported-by: "kernelci.org bot" Signed-off-by: Muhammad Usama Anjum Reviewed-by: Shuah Khan Reviewed-by: Kees Cook Signed-off-by: Shuah Khan commit 59f39bfa6553d598cb22f694d45e89547f420d85 Author: Robin Murphy Date: Wed Oct 13 10:36:54 2021 -0400 drm/cma-helper: Set VM_DONTEXPAND for mmap drm_gem_cma_mmap() cannot assume every implementation of dma_mmap_wc() will end up calling remap_pfn_range() (which happens to set the relevant vma flag, among others), so in order to make sure expectations around VM_DONTEXPAND are met, let it explicitly set the flag like most other GEM mmap implementations do. This avoids repeated warnings on a small minority of systems where the display is behind an IOMMU, and has a simple driver which does not override drm_gem_cma_default_funcs. Arm hdlcd is an in-tree affected driver. Out-of-tree, the Apple DCP driver is affected; this fix is required for DCP to be mainlined. [Alyssa: Update commit message.] Fixes: c40069cb7bd6 ("drm: add mmap() to drm_gem_object_funcs") Acked-by: Daniel Vetter Signed-off-by: Robin Murphy Signed-off-by: Alyssa Rosenzweig Link: https://patchwork.freedesktop.org/patch/msgid/20211013143654.39031-1-alyssa@rosenzweig.io commit ed343aa85718f039f5c3121aff099085902c97f0 Merge: fcb732d8f8cf6 5bfa685e62e9b Author: Paolo Bonzini Date: Fri Feb 11 12:10:57 2022 -0500 Merge tag 'kvmarm-fixes-5.17-3' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD KVM/arm64 fixes for 5.17, take #3 - Fix pending state read of a HW interrupt commit a12821d5e012a42673f6fe521971f193441d8aa4 Author: Pankaj Raghav Date: Fri Feb 11 10:34:25 2022 +0100 block: Add handling for zone append command in blk_complete_request Zone append command needs special handling to update the bi_sector field in the bio struct with the actual position of the data in the device. It is stored in __sector field of the request struct. Fixes: 5581a5ddfe8d ("block: add completion handler for fast path") Signed-off-by: Pankaj Raghav Reviewed-by: Christoph Hellwig Tested-by: Adam Manzanares Reviewed-by: Johannes Thumshirn Link: https://lore.kernel.org/r/20220211093425.43262-2-p.raghav@samsung.com Signed-off-by: Jens Axboe commit d3add1a9519dcacd6e644ecac741c56cf18b67f5 Author: Bob Peterson Date: Tue Jan 18 09:30:18 2022 -0500 gfs2: Fix gfs2_release for non-writers regression When a file is opened for writing, the vfs code (do_dentry_open) calls get_write_access for the inode, thus incrementing the inode's write count. That writer normally then creates a multi-block reservation for the inode (i_res) that can be re-used by other writers, which speeds up writes for applications that stupidly loop on open/write/close. When the writes are all done, the multi-block reservation should be deleted when the file is closed by the last "writer." Commit 0ec9b9ea4f83 broke that concept when it moved the call to gfs2_rs_delete before the check for FMODE_WRITE. Non-writers have no business removing the multi-block reservations of writers. In fact, if someone opens and closes the file for RO while a writer has a multi-block reservation, the RO closer will delete the reservation midway through the write, and this results in: kernel BUG at fs/gfs2/rgrp.c:677! (or thereabouts) which is: BUG_ON(rs->rs_requested); from function gfs2_rs_deltree. This patch moves the check back inside the check for FMODE_WRITE. Fixes: 0ec9b9ea4f83 ("gfs2: Check for active reservation in gfs2_release") Cc: stable@vger.kernel.org # v5.12+ Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher commit 356b8103d4c495d5440e3e687db9026ec2b76043 Author: Andreas Gruenbacher Date: Thu Feb 3 14:06:56 2022 +0100 Revert "gfs2: check context in gfs2_glock_put" It turns out that the might_sleep() call that commit 660a6126f8c3 adds is triggering occasional data corruption in testing. We're not sure about the root cause yet, but since this commit was added as a debugging aid only, revert it for now. This reverts commit 660a6126f8c3208f6df8d552039cda078a8426d1. Fixes: 660a6126f8c3 ("gfs2: check context in gfs2_glock_put") Cc: stable@vger.kernel.org # v5.16+ Signed-off-by: Andreas Gruenbacher commit 27a98fe60b033dfce95361abe368750994b8a78e Merge: cb1f65c1e1424 3eb616b26408a Author: Rafael J. Wysocki Date: Fri Feb 11 17:32:20 2022 +0100 Merge branch 'acpi-x86' Merge a revert of a problematic commit for 5.17-rc4. * acpi-x86: x86/PCI: revert "Ignore E820 reservations for bridge windows on newer systems" commit c1dd10c681cd661aae7926630b3f3b0f26fc1cd5 Merge: 269cbcf7b72de 6ca0c6283340d Author: Greg Kroah-Hartman Date: Fri Feb 11 16:44:20 2022 +0100 Merge tag 'usb-serial-5.17-rc4' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-linus Johan writes: USB-serial fixes for 5.17-rc4 Here are some new device ids for 5.17-rc4. All have been in linux-next with no reported issues. * tag 'usb-serial-5.17-rc4' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial: USB: serial: cp210x: add CPI Bulk Coin Recycler id USB: serial: cp210x: add NCR Retail IO box id USB: serial: ftdi_sio: add support for Brainboxes US-159/235/320 USB: serial: option: add ZTE MF286D modem USB: serial: ch341: add support for GW Instek USB2.0-Serial devices commit 85d24ad38bc4658ce9a16b85b9c8dc0577d66c71 Merge: 525de9a79349b bea2662e7818e Author: David S. Miller Date: Fri Feb 11 14:18:39 2022 +0000 Merge tag 'wireless-2022-02-11' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless wireless fixes for v5.17 Second set of fixes for v5.17. This is the first pull request with both driver and stack patches. Most important here are a regression fix for brcmfmac USB devices and an iwlwifi fix for use after free when the firmware was missing. We have new maintainers for ath9k and wcn36xx as well as ath6kl is now orphaned. Also smaller fixes to iwlwifi and stack. commit bf23747ee05320903177809648002601cd140cdd Author: Tetsuo Handa Date: Fri Feb 11 16:15:54 2022 +0900 loop: revert "make autoclear operation asynchronous" The kernel test robot is reporting that xfstest which does umount ext2 on xfs umount xfs sequence started failing, for commit 322c4293ecc58110 ("loop: make autoclear operation asynchronous") removed a guarantee that fput() of backing file is processed before lo_release() from close() returns to user mode. And syzbot is reporting that deferring destroy_workqueue() from __loop_clr_fd() to a WQ context did not help [1]. Revert that commit. Link: https://syzkaller.appspot.com/bug?extid=831661966588c802aae9 [1] Reported-by: kernel test robot Acked-by: Jan Kara Reviewed-by: Christoph Hellwig Reported-by: syzbot Signed-off-by: Tetsuo Handa Link: https://lore.kernel.org/r/20220211071554.3424-1-penguin-kernel@I-love.SAKURA.ne.jp Signed-off-by: Jens Axboe commit 4a11678f683814df82fca9018d964771e02d7e6d Author: Felix Maurer Date: Wed Feb 9 16:55:26 2022 +0100 bpf: Do not try bpf_msg_push_data with len 0 If bpf_msg_push_data() is called with len 0 (as it happens during selftests/bpf/test_sockmap), we do not need to do anything and can return early. Calling bpf_msg_push_data() with len 0 previously lead to a wrong ENOMEM error: we later called get_order(copy + len); if len was 0, copy + len was also often 0 and get_order() returned some undefined value (at the moment 52). alloc_pages() caught that and failed, but then bpf_msg_push_data() returned ENOMEM. This was wrong because we are most probably not out of memory and actually do not need any additional memory. Fixes: 6fff607e2f14b ("bpf: sk_msg program helper bpf_msg_push_data") Signed-off-by: Felix Maurer Signed-off-by: Daniel Borkmann Acked-by: Yonghong Song Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/df69012695c7094ccb1943ca02b4920db3537466.1644421921.git.fmaurer@redhat.com commit 525de9a79349bd83fe5276d7672f91887f9ee721 Merge: dcd54265c8bc1 bbe4c0896d250 Author: David S. Miller Date: Fri Feb 11 11:55:08 2022 +0000 Merge ra.kernel.org:/pub/scm/linux/kernel/git/netfilter/nf Pablo Neira Ayuso says: ==================== Netfilter fixes for net The following patchset contains Netfilter fixes for net: 1) Add selftest for nft_synproxy, from Florian Westphal. 2) xt_socket destroy path incorrectly disables IPv4 defrag for IPv6 traffic (typo), from Eric Dumazet. 3) Fix exit value selftest nft_concat_range.sh, from Hangbin Liu. 4) nft_synproxy disables the IPv4 hooks if the IPv6 hooks fail to be registered. 5) disable rp_filter on router in selftest nft_fib.sh, also from Hangbin Liu. ==================== Signed-off-by: David S. Miller commit dcd54265c8bc14bd023815e36e2d5f9d66ee1fee Author: Eric Dumazet Date: Thu Feb 10 09:13:31 2022 -0800 drop_monitor: fix data-race in dropmon_net_event / trace_napi_poll_hit trace_napi_poll_hit() is reading stat->dev while another thread can write on it from dropmon_net_event() Use READ_ONCE()/WRITE_ONCE() here, RCU rules are properly enforced already, we only have to take care of load/store tearing. BUG: KCSAN: data-race in dropmon_net_event / trace_napi_poll_hit write to 0xffff88816f3ab9c0 of 8 bytes by task 20260 on cpu 1: dropmon_net_event+0xb8/0x2b0 net/core/drop_monitor.c:1579 notifier_call_chain kernel/notifier.c:84 [inline] raw_notifier_call_chain+0x53/0xb0 kernel/notifier.c:392 call_netdevice_notifiers_info net/core/dev.c:1919 [inline] call_netdevice_notifiers_extack net/core/dev.c:1931 [inline] call_netdevice_notifiers net/core/dev.c:1945 [inline] unregister_netdevice_many+0x867/0xfb0 net/core/dev.c:10415 ip_tunnel_delete_nets+0x24a/0x280 net/ipv4/ip_tunnel.c:1123 vti_exit_batch_net+0x2a/0x30 net/ipv4/ip_vti.c:515 ops_exit_list net/core/net_namespace.c:173 [inline] cleanup_net+0x4dc/0x8d0 net/core/net_namespace.c:597 process_one_work+0x3f6/0x960 kernel/workqueue.c:2307 worker_thread+0x616/0xa70 kernel/workqueue.c:2454 kthread+0x1bf/0x1e0 kernel/kthread.c:377 ret_from_fork+0x1f/0x30 read to 0xffff88816f3ab9c0 of 8 bytes by interrupt on cpu 0: trace_napi_poll_hit+0x89/0x1c0 net/core/drop_monitor.c:292 trace_napi_poll include/trace/events/napi.h:14 [inline] __napi_poll+0x36b/0x3f0 net/core/dev.c:6366 napi_poll net/core/dev.c:6432 [inline] net_rx_action+0x29e/0x650 net/core/dev.c:6519 __do_softirq+0x158/0x2de kernel/softirq.c:558 do_softirq+0xb1/0xf0 kernel/softirq.c:459 __local_bh_enable_ip+0x68/0x70 kernel/softirq.c:383 __raw_spin_unlock_bh include/linux/spinlock_api_smp.h:167 [inline] _raw_spin_unlock_bh+0x33/0x40 kernel/locking/spinlock.c:210 spin_unlock_bh include/linux/spinlock.h:394 [inline] ptr_ring_consume_bh include/linux/ptr_ring.h:367 [inline] wg_packet_decrypt_worker+0x73c/0x780 drivers/net/wireguard/receive.c:506 process_one_work+0x3f6/0x960 kernel/workqueue.c:2307 worker_thread+0x616/0xa70 kernel/workqueue.c:2454 kthread+0x1bf/0x1e0 kernel/kthread.c:377 ret_from_fork+0x1f/0x30 value changed: 0xffff88815883e000 -> 0x0000000000000000 Reported by Kernel Concurrency Sanitizer on: CPU: 0 PID: 26435 Comm: kworker/0:1 Not tainted 5.17.0-rc1-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: wg-crypt-wg2 wg_packet_decrypt_worker Fixes: 4ea7e38696c7 ("dropmon: add ability to detect when hardware dropsrxpackets") Signed-off-by: Eric Dumazet Cc: Neil Horman Reported-by: syzbot Signed-off-by: David S. Miller commit c72ea20503610a4a7ba26c769357d31602769c01 Author: Mathias Krause Date: Mon Feb 7 16:01:19 2022 +0100 iio: buffer: Fix file related error handling in IIO_BUFFER_GET_FD_IOCTL If we fail to copy the just created file descriptor to userland, we try to clean up by putting back 'fd' and freeing 'ib'. The code uses put_unused_fd() for the former which is wrong, as the file descriptor was already published by fd_install() which gets called internally by anon_inode_getfd(). This makes the error handling code leaving a half cleaned up file descriptor table around and a partially destructed 'file' object, allowing userland to play use-after-free tricks on us, by abusing the still usable fd and making the code operate on a dangling 'file->private_data' pointer. Instead of leaving the kernel in a partially corrupted state, don't attempt to explicitly clean up and leave this to the process exit path that'll release any still valid fds, including the one created by the previous call to anon_inode_getfd(). Simply return -EFAULT to indicate the error. Fixes: f73f7f4da581 ("iio: buffer: add ioctl() to support opening extra buffers for IIO device") Cc: stable@kernel.org Cc: Jonathan Cameron Cc: Alexandru Ardelean Cc: Lars-Peter Clausen Cc: Nuno Sa Reported-by: Dan Carpenter Signed-off-by: Mathias Krause Reviewed-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman commit 1de9770d121ee9294794cca0e0be8fbfa0134ee8 Author: Wen Gu Date: Wed Feb 9 22:10:53 2022 +0800 net/smc: Avoid overwriting the copies of clcsock callback functions The callback functions of clcsock will be saved and replaced during the fallback. But if the fallback happens more than once, then the copies of these callback functions will be overwritten incorrectly, resulting in a loop call issue: clcsk->sk_error_report |- smc_fback_error_report() <------------------------------| |- smc_fback_forward_wakeup() | (loop) |- clcsock_callback() (incorrectly overwritten) | |- smc->clcsk_error_report() ------------------| So this patch fixes the issue by saving these function pointers only once in the fallback and avoiding overwriting. Reported-by: syzbot+4de3c0e8a263e1e499bc@syzkaller.appspotmail.com Fixes: 341adeec9ada ("net/smc: Forward wakeup to smc socket waitqueue after fallback") Link: https://lore.kernel.org/r/0000000000006d045e05d78776f6@google.com Signed-off-by: Wen Gu Signed-off-by: David S. Miller commit 5bfa685e62e9ba93c303a9a8db646c7228b9b570 Author: Marc Zyngier Date: Thu Feb 3 09:24:45 2022 +0000 KVM: arm64: vgic: Read HW interrupt pending state from the HW It appears that a read access to GIC[DR]_I[CS]PENDRn doesn't always result in the pending interrupts being accurately reported if they are mapped to a HW interrupt. This is particularily visible when acking the timer interrupt and reading the GICR_ISPENDR1 register immediately after, for example (the interrupt appears as not-pending while it really is...). This is because a HW interrupt has its 'active and pending state' kept in the *physical* distributor, and not in the virtual one, as mandated by the spec (this is what allows the direct deactivation). The virtual distributor only caries the pending and active *states* (note the plural, as these are two independent and non-overlapping states). Fix it by reading the HW state back, either from the timer itself or from the distributor if necessary. Reported-by: Ricardo Koller Tested-by: Ricardo Koller Reviewed-by: Ricardo Koller Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220208123726.3604198-1-maz@kernel.org commit 1ba603f56568c3b4c2542dfba07afa25f21dcff3 Author: Alyssa Ross Date: Fri Feb 11 10:27:04 2022 +0000 firmware: arm_scmi: Remove space in MODULE_ALIAS name modprobe can't handle spaces in aliases. Get rid of it to fix the issue. Link: https://lore.kernel.org/r/20220211102704.128354-1-sudeep.holla@arm.com Fixes: aa4f886f3893 ("firmware: arm_scmi: add basic driver infrastructure for SCMI") Reviewed-by: Cristian Marussi Signed-off-by: Alyssa Ross Signed-off-by: Sudeep Holla commit 269cbcf7b72de6f0016806d4a0cec1d689b55a87 Author: Fabrice Gasnier Date: Wed Feb 9 17:15:53 2022 +0100 usb: dwc2: drd: fix soft connect when gadget is unconfigured When the gadget driver hasn't been (yet) configured, and the cable is connected to a HOST, the SFTDISCON gets cleared unconditionally, so the HOST tries to enumerate it. At the host side, this can result in a stuck USB port or worse. When getting lucky, some dmesg can be observed at the host side: new high-speed USB device number ... device descriptor read/64, error -110 Fix it in drd, by checking the enabled flag before calling dwc2_hsotg_core_connect(). It will be called later, once configured, by the normal flow: - udc_bind_to_driver - usb_gadget_connect - dwc2_hsotg_pullup - dwc2_hsotg_core_connect Fixes: 17f934024e84 ("usb: dwc2: override PHY input signals with usb role switch support") Cc: stable@kernel.org Reviewed-by: Amelie Delaunay Acked-by: Minas Harutyunyan Signed-off-by: Fabrice Gasnier Link: https://lore.kernel.org/r/1644423353-17859-1-git-send-email-fabrice.gasnier@foss.st.com Signed-off-by: Greg Kroah-Hartman commit 38ea1eac7d88072bbffb630e2b3db83ca649b826 Author: Greg Kroah-Hartman Date: Wed Feb 9 16:37:53 2022 +0100 usb: gadget: rndis: check size of RNDIS_MSG_SET command Check the size of the RNDIS_MSG_SET command given to us before attempting to respond to an invalid message size. Reported-by: Szymon Heidrich Cc: stable@kernel.org Tested-by: Szymon Heidrich Signed-off-by: Greg Kroah-Hartman commit 75e5b4849b81e19e9efe1654b30d7f3151c33c2c Author: Szymon Heidrich Date: Mon Jan 24 12:14:00 2022 +0100 USB: gadget: validate interface OS descriptor requests Stall the control endpoint in case provided index exceeds array size of MAX_CONFIG_INTERFACES or when the retrieved function pointer is null. Signed-off-by: Szymon Heidrich Cc: stable@kernel.org Signed-off-by: Greg Kroah-Hartman commit c853685d11c09da35cb49bbf8f0c001abdc0d0a9 Author: Fabio M. De Francesco Date: Wed Feb 9 17:45:00 2022 +0100 usb: core: Unregister device on component_add() failure Commit 8c67d06f3fd9 ("usb: Link the ports to the connectors they are attached to") creates a link to the USB Type-C connector for every new port that is added when possible. If component_add() fails, usb_hub_create_port_device() prints a warning but does not unregister the device and does not return errors to the callers. Syzbot reported a "WARNING in component_del()". Fix this issue in usb_hub_create_port_device by calling device_unregister() and returning the errors from component_add(). Fixes: 8c67d06f3fd9 ("usb: Link the ports to the connectors they are attached to") Reported-and-tested-by: syzbot+60df062e1c41940cae0f@syzkaller.appspotmail.com Reviewed-by: Heikki Krogerus Signed-off-by: Fabio M. De Francesco Link: https://lore.kernel.org/r/20220209164500.8769-1-fmdefrancesco@gmail.com Signed-off-by: Greg Kroah-Hartman commit 57bc3d3ae8c14df3ceb4e17d26ddf9eeab304581 Author: Jann Horn Date: Wed Jan 26 14:14:52 2022 +0100 net: usb: ax88179_178a: Fix out-of-bounds accesses in RX fixup ax88179_rx_fixup() contains several out-of-bounds accesses that can be triggered by a malicious (or defective) USB device, in particular: - The metadata array (hdr_off..hdr_off+2*pkt_cnt) can be out of bounds, causing OOB reads and (on big-endian systems) OOB endianness flips. - A packet can overlap the metadata array, causing a later OOB endianness flip to corrupt data used by a cloned SKB that has already been handed off into the network stack. - A packet SKB can be constructed whose tail is far beyond its end, causing out-of-bounds heap data to be considered part of the SKB's data. I have tested that this can be used by a malicious USB device to send a bogus ICMPv6 Echo Request and receive an ICMPv6 Echo Reply in response that contains random kernel heap data. It's probably also possible to get OOB writes from this on a little-endian system somehow - maybe by triggering skb_cow() via IP options processing -, but I haven't tested that. Fixes: e2ca90c276e1 ("ax88179_178a: ASIX AX88179_178A USB 3.0/2.0 to gigabit ethernet adapter driver") Cc: stable@kernel.org Signed-off-by: Jann Horn Signed-off-by: Greg Kroah-Hartman commit ddc204b517e60ae64db34f9832dc41dafa77c751 Author: Waiman Long Date: Tue Feb 8 11:39:12 2022 -0500 copy_process(): Move fd_install() out of sighand->siglock critical section I was made aware of the following lockdep splat: [ 2516.308763] ===================================================== [ 2516.309085] WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected [ 2516.309433] 5.14.0-51.el9.aarch64+debug #1 Not tainted [ 2516.309703] ----------------------------------------------------- [ 2516.310149] stress-ng/153663 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire: [ 2516.310512] ffff0000e422b198 (&newf->file_lock){+.+.}-{2:2}, at: fd_install+0x368/0x4f0 [ 2516.310944] and this task is already holding: [ 2516.311248] ffff0000c08140d8 (&sighand->siglock){-.-.}-{2:2}, at: copy_process+0x1e2c/0x3e80 [ 2516.311804] which would create a new lock dependency: [ 2516.312066] (&sighand->siglock){-.-.}-{2:2} -> (&newf->file_lock){+.+.}-{2:2} [ 2516.312446] but this new dependency connects a HARDIRQ-irq-safe lock: [ 2516.312983] (&sighand->siglock){-.-.}-{2:2} : [ 2516.330700] Possible interrupt unsafe locking scenario: [ 2516.331075] CPU0 CPU1 [ 2516.331328] ---- ---- [ 2516.331580] lock(&newf->file_lock); [ 2516.331790] local_irq_disable(); [ 2516.332231] lock(&sighand->siglock); [ 2516.332579] lock(&newf->file_lock); [ 2516.332922] [ 2516.333069] lock(&sighand->siglock); [ 2516.333291] *** DEADLOCK *** [ 2516.389845] stack backtrace: [ 2516.390101] CPU: 3 PID: 153663 Comm: stress-ng Kdump: loaded Not tainted 5.14.0-51.el9.aarch64+debug #1 [ 2516.390756] Hardware name: QEMU KVM Virtual Machine, BIOS 0.0.0 02/06/2015 [ 2516.391155] Call trace: [ 2516.391302] dump_backtrace+0x0/0x3e0 [ 2516.391518] show_stack+0x24/0x30 [ 2516.391717] dump_stack_lvl+0x9c/0xd8 [ 2516.391938] dump_stack+0x1c/0x38 [ 2516.392247] print_bad_irq_dependency+0x620/0x710 [ 2516.392525] check_irq_usage+0x4fc/0x86c [ 2516.392756] check_prev_add+0x180/0x1d90 [ 2516.392988] validate_chain+0x8e0/0xee0 [ 2516.393215] __lock_acquire+0x97c/0x1e40 [ 2516.393449] lock_acquire.part.0+0x240/0x570 [ 2516.393814] lock_acquire+0x90/0xb4 [ 2516.394021] _raw_spin_lock+0xe8/0x154 [ 2516.394244] fd_install+0x368/0x4f0 [ 2516.394451] copy_process+0x1f5c/0x3e80 [ 2516.394678] kernel_clone+0x134/0x660 [ 2516.394895] __do_sys_clone3+0x130/0x1f4 [ 2516.395128] __arm64_sys_clone3+0x5c/0x7c [ 2516.395478] invoke_syscall.constprop.0+0x78/0x1f0 [ 2516.395762] el0_svc_common.constprop.0+0x22c/0x2c4 [ 2516.396050] do_el0_svc+0xb0/0x10c [ 2516.396252] el0_svc+0x24/0x34 [ 2516.396436] el0t_64_sync_handler+0xa4/0x12c [ 2516.396688] el0t_64_sync+0x198/0x19c [ 2517.491197] NET: Registered PF_ATMPVC protocol family [ 2517.491524] NET: Registered PF_ATMSVC protocol family [ 2591.991877] sched: RT throttling activated One way to solve this problem is to move the fd_install() call out of the sighand->siglock critical section. Before commit 6fd2fe494b17 ("copy_process(): don't use ksys_close() on cleanups"), the pidfd installation was done without holding both the task_list lock and the sighand->siglock. Obviously, holding these two locks are not really needed to protect the fd_install() call. So move the fd_install() call down to after the releases of both locks. Link: https://lore.kernel.org/r/20220208163912.1084752-1-longman@redhat.com Fixes: 6fd2fe494b17 ("copy_process(): don't use ksys_close() on cleanups") Reviewed-by: "Eric W. Biederman" Signed-off-by: Waiman Long Signed-off-by: Christian Brauner commit 97acd701185b13825f8ec7882345040415d46762 Author: Christian Brauner Date: Thu Feb 3 14:14:06 2022 +0100 MAINTAINERS: add entry for idmapped mounts I'd like to continue maintaining the work that was done around idmapped, make sure that I'm Cced on new patches and work that impacts the infrastructure. Link: https://lore.kernel.org/r/20220203131411.3093040-3-brauner@kernel.org Cc: Seth Forshee Cc: Christoph Hellwig Cc: Al Viro Cc: linux-fsdevel@vger.kernel.org Reviewed-by: Christoph Hellwig Signed-off-by: Christian Brauner commit d1c56bfdaca465bd1d0e913053a9c5cafe8b6a6c Author: Christian Brauner Date: Thu Feb 3 14:14:05 2022 +0100 tests: fix idmapped mount_setattr test The test treated zero as a successful run when it really should treat non-zero as a successful run. A mount's idmapping can't change once it has been attached to the filesystem. Link: https://lore.kernel.org/r/20220203131411.3093040-2-brauner@kernel.org Fixes: 01eadc8dd96d ("tests: add mount_setattr() selftests") Cc: Seth Forshee Cc: Christoph Hellwig Cc: linux-fsdevel@vger.kernel.org Reviewed-by: Christoph Hellwig Signed-off-by: Christian Brauner commit eed09ad261822a7bdc441ed192c6f444375e5527 Author: Kees Cook Date: Mon Feb 7 20:53:34 2022 -0800 samples/seccomp: Adjust sample to also provide kill option As a quick way to test SECCOMP_RET_KILL, have a negative errno mean to kill the process. While we're in here, also swap the arch and syscall arguments so they're ordered more like how seccomp filters order them. Signed-off-by: Kees Cook commit 495ac3069a6235bfdf516812a2a9b256671bbdf9 Author: Kees Cook Date: Mon Feb 7 20:21:13 2022 -0800 seccomp: Invalidate seccomp mode to catch death failures If seccomp tries to kill a process, it should never see that process again. To enforce this proactively, switch the mode to something impossible. If encountered: WARN, reject all syscalls, and attempt to kill the process again even harder. Cc: Andy Lutomirski Cc: Will Drewry Fixes: 8112c4f140fa ("seccomp: remove 2-phase API") Cc: stable@vger.kernel.org Signed-off-by: Kees Cook commit 5c72263ef2fbe99596848f03758ae2dc593adf2c Author: Kees Cook Date: Tue Feb 8 00:57:17 2022 -0800 signal: HANDLER_EXIT should clear SIGNAL_UNKILLABLE Fatal SIGSYS signals (i.e. seccomp RET_KILL_* syscall filter actions) were not being delivered to ptraced pid namespace init processes. Make sure the SIGNAL_UNKILLABLE doesn't get set for these cases. Reported-by: Robert Święcki Suggested-by: "Eric W. Biederman" Fixes: 00b06da29cf9 ("signal: Add SA_IMMUTABLE to ensure forced siganls do not get changed") Cc: stable@vger.kernel.org Signed-off-by: Kees Cook Reviewed-by: "Eric W. Biederman" Link: https://lore.kernel.org/lkml/878rui8u4a.fsf@email.froward.int.ebiederm.org commit 95e875bdb1862db178bf24fb703387ec3aa3a34a Merge: 7830643835535 6e7545ddb1341 Author: Dave Airlie Date: Fri Feb 11 12:44:01 2022 +1000 Merge tag 'amd-drm-fixes-5.17-2022-02-09' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-fixes-5.17-2022-02-09: amdgpu: - DCN 3.1 display fixes - GC 10.3.1 harvest fix - Page flip irq fix - hwmon label fix - DCN 2.0 display fix Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220210041137.5926-1-alexander.deucher@amd.com commit 78306438355353e677a5ffcf5e9351604b694159 Merge: df2bb4dc285e6 4e6f55120c7ec Author: Dave Airlie Date: Fri Feb 11 12:32:45 2022 +1000 Merge tag 'drm-intel-fixes-2022-02-10' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes - Build fix for non-x86 platforms after remap_io_mmapping changes. (Lucas De Marchi) - Correctly propagate errors during object migration blits. (Thomas Hellström) - Disable DRRS support on HSW/IVB where it is not implemented yet. (Ville Syrjälä) - Correct pipe dbuf BIOS configuration during readout. (Ville Syrjälä) - Properly sanitise BIOS buf configuration on ADL-P+ for !join_mbus cases. (Ville Syrjälä) - Fix oops due to missing stack depot. (Ville Syrjälä) - Workaround broken BIOS DBUF configuration on TGL/RKL. (Ville Syrjälä) Signed-off-by: Dave Airlie From: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/YgTuYAtpaV3XAGmx@tursulin-mobl2 commit df2bb4dc285e60665930889e6f8c5bb38b90249a Merge: dfd42facf1e4a 9da1e9ab82c92 Author: Dave Airlie Date: Fri Feb 11 12:05:04 2022 +1000 Merge tag 'drm-misc-fixes-2022-02-10' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes * drm/panel: simple: Fix assignments from panel_dpi_probe() * drm/privacy-screen: Cleanups * drm/rockchip: Fix HDMI error cleanup; Fix RK3399 VOP register fields * drm/vc4: HDMI fixes; Cleanups * fbdev: Add fbdev core module with Daniel as maintainer; Cleanups Signed-off-by: Dave Airlie From: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/YgTf1Zsflzq3JSFo@linux-uq9g commit e9f7b9228a94778edb7a63fde3c0a3c5bb793064 Author: Sean Anderson Date: Wed Feb 9 13:28:22 2022 -0500 pinctrl: k210: Fix bias-pull-up Using bias-pull-up would actually cause the pin to have its pull-down enabled. Fix this. Signed-off-by: Sean Anderson Reviewed-by: Damien Le Moal Fixes: d4c34d09ab03 ("pinctrl: Add RISC-V Canaan Kendryte K210 FPIOA driver") Link: https://lore.kernel.org/r/20220209182822.640905-1-seanga2@gmail.com Signed-off-by: Linus Walleij commit ba2ab85951c91a140a8fa51d8347d54e59ec009d Author: Dan Carpenter Date: Wed Feb 9 21:08:06 2022 +0300 pinctrl: fix loop in k210_pinconf_get_drive() The loop exited too early so the k210_pinconf_drive_strength[0] array element was never used. Fixes: d4c34d09ab03 ("pinctrl: Add RISC-V Canaan Kendryte K210 FPIOA driver") Signed-off-by: Dan Carpenter Reviewed-by: Damien Le Moal Reviewed-by: Sean Anderson Link: https://lore.kernel.org/r/20220209180804.GA18385@kili Signed-off-by: Linus Walleij commit f1baf68e1383f6ed93eb9cff2866d46562607a43 Merge: 16f7432c884bb 51a04ebf21122 Author: Linus Torvalds Date: Thu Feb 10 16:01:22 2022 -0800 Merge tag 'net-5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Jakub Kicinski: "Including fixes from netfilter and can. Current release - new code bugs: - sparx5: fix get_stat64 out-of-bound access and crash - smc: fix netdev ref tracker misuse Previous releases - regressions: - eth: ixgbevf: require large buffers for build_skb on 82599VF, avoid overflows - eth: ocelot: fix all IP traffic getting trapped to CPU with PTP over IP - bonding: fix rare link activation misses in 802.3ad mode Previous releases - always broken: - tcp: fix tcp sock mem accounting in zero-copy corner cases - remove the cached dst when uncloning an skb dst and its metadata, since we only have one ref it'd lead to an UaF - netfilter: - conntrack: don't refresh sctp entries in closed state - conntrack: re-init state for retransmitted syn-ack, avoid connection establishment getting stuck with strange stacks - ctnetlink: disable helper autoassign, avoid it getting lost - nft_payload: don't allow transport header access for fragments - dsa: fix use of devres for mdio throughout drivers - eth: amd-xgbe: disable interrupts during pci removal - eth: dpaa2-eth: unregister netdev before disconnecting the PHY - eth: ice: fix IPIP and SIT TSO offload" * tag 'net-5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (53 commits) net: dsa: mv88e6xxx: fix use-after-free in mv88e6xxx_mdios_unregister net: mscc: ocelot: fix mutex lock error during ethtool stats read ice: Avoid RTNL lock when re-creating auxiliary device ice: Fix KASAN error in LAG NETDEV_UNREGISTER handler ice: fix IPIP and SIT TSO offload ice: fix an error code in ice_cfg_phy_fec() net: mpls: Fix GCC 12 warning dpaa2-eth: unregister the netdev before disconnecting from the PHY skbuff: cleanup double word in comment net: macb: Align the dma and coherent dma masks mptcp: netlink: process IPv6 addrs in creating listening sockets selftests: mptcp: add missing join check net: usb: qmi_wwan: Add support for Dell DW5829e vlan: move dev_put into vlan_dev_uninit vlan: introduce vlan_dev_free_egress_priority ax25: fix UAF bugs of net_device caused by rebinding operation net: dsa: fix panic when DSA master device unbinds on shutdown net: amd-xgbe: disable interrupts during pci removal tipc: rate limit warning for received illegal binding update net: mdio: aspeed: Add missing MODULE_DEVICE_TABLE ... commit 8795359e35bc33bf86b6d0765aa7f37431db3b9c Author: Reinette Chatre Date: Tue Feb 8 10:48:07 2022 -0800 x86/sgx: Silence softlockup detection when releasing large enclaves Vijay reported that the "unclobbered_vdso_oversubscribed" selftest triggers the softlockup detector. Actual SGX systems have 128GB of enclave memory or more. The "unclobbered_vdso_oversubscribed" selftest creates one enclave which consumes all of the enclave memory on the system. Tearing down such a large enclave takes around a minute, most of it in the loop where the EREMOVE instruction is applied to each individual 4k enclave page. Spending one minute in a loop triggers the softlockup detector. Add a cond_resched() to give other tasks a chance to run and placate the softlockup detector. Cc: stable@vger.kernel.org Fixes: 1728ab54b4be ("x86/sgx: Add a page reclaimer") Reported-by: Vijay Dhanraj Signed-off-by: Reinette Chatre Signed-off-by: Dave Hansen Reviewed-by: Jarkko Sakkinen Acked-by: Dave Hansen Tested-by: Jarkko Sakkinen (kselftest as sanity check) Link: https://lkml.kernel.org/r/ced01cac1e75f900251b0a4ae1150aa8ebd295ec.1644345232.git.reinette.chatre@intel.com commit 16f7432c884bb7882f0534cb8b9c38cdbccc37bc Merge: ff00854812b21 183f80fd72db4 Author: Linus Torvalds Date: Thu Feb 10 15:42:48 2022 -0800 Merge tag 'linux-kselftest-fixes-5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull Kselftest fixes from Shuah Khan: "Build and run-time fixes to pidfd, clone3, and ir tests" * tag 'linux-kselftest-fixes-5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: selftests/ir: fix build with ancient kernel headers selftests: fixup build warnings in pidfd / clone3 tests pidfd: fix test failure due to stack overflow on some arches commit ff00854812b216e06e92191f036eb0bd1596b2d4 Merge: e3c85076d7a6f 92a68053c3468 Author: Linus Torvalds Date: Thu Feb 10 15:39:59 2022 -0800 Merge tag 'linux-kselftest-kunit-fixes-5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull KUnit fixes from Shuah Khan: "Fixes to the test and usage documentation" * tag 'linux-kselftest-kunit-fixes-5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: Documentation: KUnit: Fix usage bug kunit: fix missing f in f-string in run_checks.py commit bbe4c0896d25009a7c86285d2ab024eed4374eea Author: Hangbin Liu Date: Thu Feb 10 17:50:56 2022 +0800 selftests: netfilter: disable rp_filter on router Some distros may enable rp_filter by default. After ns1 change addr to 10.0.2.99 and set default router to 10.0.2.1, while the connected router address is still 10.0.1.1. The router will not reply the arp request from ns1. Fix it by setting the router's veth0 rp_filter to 0. Before the fix: # ./nft_fib.sh PASS: fib expression did not cause unwanted packet drops Netns nsrouter-HQkDORO2 fib counter doesn't match expected packet count of 1 for 1.1.1.1 table inet filter { chain prerouting { type filter hook prerouting priority filter; policy accept; ip daddr 1.1.1.1 fib saddr . iif oif missing counter packets 0 bytes 0 drop ip6 daddr 1c3::c01d fib saddr . iif oif missing counter packets 0 bytes 0 drop } } After the fix: # ./nft_fib.sh PASS: fib expression did not cause unwanted packet drops PASS: fib expression did drop packets for 1.1.1.1 PASS: fib expression did drop packets for 1c3::c01d Fixes: 82944421243e ("selftests: netfilter: add fib test case") Signed-off-by: Yi Chen Signed-off-by: Hangbin Liu Signed-off-by: Pablo Neira Ayuso commit 51a04ebf21122d5c76a716ecd9bfc33ea44b2b39 Author: Vladimir Oltean Date: Thu Feb 10 19:40:17 2022 +0200 net: dsa: mv88e6xxx: fix use-after-free in mv88e6xxx_mdios_unregister Since struct mv88e6xxx_mdio_bus *mdio_bus is the bus->priv of something allocated with mdiobus_alloc_size(), this means that mdiobus_free(bus) will free the memory backing the mdio_bus as well. Therefore, the mdio_bus->list element is freed memory, but we continue to iterate through the list of MDIO buses using that list element. To fix this, use the proper list iterator that handles element deletion by keeping a copy of the list element next pointer. Fixes: f53a2ce893b2 ("net: dsa: mv88e6xxx: don't use devres for mdiobus") Reported-by: Rafael Richter Signed-off-by: Vladimir Oltean Link: https://lore.kernel.org/r/20220210174017.3271099-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit a19f7d7da9b3ffe8fcc43203a2d49c096d0754f6 Merge: 7fbf6795d127a 5dbbbd01cbba8 Author: Jakub Kicinski Date: Thu Feb 10 11:45:35 2022 -0800 Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2022-02-10 Dan Carpenter propagates an error in FEC configuration. Jesse fixes TSO offloads of IPIP and SIT frames. Dave adds a dedicated LAG unregister function to resolve a KASAN error and moves auxiliary device re-creation after LAG removal to the service task to avoid issues with RTNL lock. * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: ice: Avoid RTNL lock when re-creating auxiliary device ice: Fix KASAN error in LAG NETDEV_UNREGISTER handler ice: fix IPIP and SIT TSO offload ice: fix an error code in ice_cfg_phy_fec() ==================== Link: https://lore.kernel.org/r/20220210170515.2609656-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 7fbf6795d127a3b1bb39b0e42579904cf6db1624 Author: Colin Foster Date: Thu Feb 10 07:04:51 2022 -0800 net: mscc: ocelot: fix mutex lock error during ethtool stats read An ongoing workqueue populates the stats buffer. At the same time, a user might query the statistics. While writing to the buffer is mutex-locked, reading from the buffer wasn't. This could lead to buggy reads by ethtool. This patch fixes the former blamed commit, but the bug was introduced in the latter. Signed-off-by: Colin Foster Fixes: 1e1caa9735f90 ("ocelot: Clean up stats update deferred work") Fixes: a556c76adc052 ("net: mscc: Add initial Ocelot switch support") Reported-by: Vladimir Oltean Reviewed-by: Vladimir Oltean Link: https://lore.kernel.org/all/20220210150451.416845-2-colin.foster@in-advantage.com/ Signed-off-by: Jakub Kicinski commit fcb732d8f8cf6084f8480015ad41d25fb023a4dd Author: David Woodhouse Date: Mon Oct 25 14:29:01 2021 +0100 KVM: x86/xen: Fix runstate updates to be atomic when preempting vCPU There are circumstances whem kvm_xen_update_runstate_guest() should not sleep because it ends up being called from __schedule() when the vCPU is preempted: [ 222.830825] kvm_xen_update_runstate_guest+0x24/0x100 [ 222.830878] kvm_arch_vcpu_put+0x14c/0x200 [ 222.830920] kvm_sched_out+0x30/0x40 [ 222.830960] __schedule+0x55c/0x9f0 To handle this, make it use the same trick as __kvm_xen_has_interrupt(), of using the hva from the gfn_to_hva_cache directly. Then it can use pagefault_disable() around the accesses and just bail out if the page is absent (which is unlikely). I almost switched to using a gfn_to_pfn_cache here and bailing out if kvm_map_gfn() fails, like kvm_steal_time_set_preempted() does — but on closer inspection it looks like kvm_map_gfn() will *always* fail in atomic context for a page in IOMEM, which means it will silently fail to make the update every single time for such guests, AFAICT. So I didn't do it that way after all. And will probably fix that one too. Cc: stable@vger.kernel.org Fixes: 30b5c851af79 ("KVM: x86/xen: Add support for vCPU runstate information") Signed-off-by: David Woodhouse Message-Id: Signed-off-by: Paolo Bonzini commit a887f9c7a4d37a8e874ba8415a42a92a1b5139fc Author: Charles Keepax Date: Thu Feb 10 17:20:51 2022 +0000 ASoC: wm_adsp: Correct control read size when parsing compressed buffer When parsing the compressed stream the whole buffer descriptor is now read in a single cs_dsp_coeff_read_ctrl; on older firmwares this descriptor is just 4 bytes but on more modern firmwares it is 24 bytes. The current code reads the full 24 bytes regardless, this was working but reading junk for the last 20 bytes. However commit f444da38ac92 ("firmware: cs_dsp: Add offset to cs_dsp read/write") added a size check into cs_dsp_coeff_read_ctrl, causing the older firmwares to now return an error. Update the code to only read the amount of data appropriate for the firmware loaded. Fixes: 04ae08596737 ("ASoC: wm_adsp: Switch to using wm_coeff_read_ctrl for compressed buffers") Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220210172053.22782-1-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 6df2a016c0c8a3d0933ef33dd192ea6606b115e3 Author: Aurelien Jarno Date: Wed Jan 26 18:14:42 2022 +0100 riscv: fix build with binutils 2.38 From version 2.38, binutils default to ISA spec version 20191213. This means that the csr read/write (csrr*/csrw*) instructions and fence.i instruction has separated from the `I` extension, become two standalone extensions: Zicsr and Zifencei. As the kernel uses those instruction, this causes the following build failure: CC arch/riscv/kernel/vdso/vgettimeofday.o <>/arch/riscv/include/asm/vdso/gettimeofday.h: Assembler messages: <>/arch/riscv/include/asm/vdso/gettimeofday.h:71: Error: unrecognized opcode `csrr a5,0xc01' <>/arch/riscv/include/asm/vdso/gettimeofday.h:71: Error: unrecognized opcode `csrr a5,0xc01' <>/arch/riscv/include/asm/vdso/gettimeofday.h:71: Error: unrecognized opcode `csrr a5,0xc01' <>/arch/riscv/include/asm/vdso/gettimeofday.h:71: Error: unrecognized opcode `csrr a5,0xc01' The fix is to specify those extensions explicitely in -march. However as older binutils version do not support this, we first need to detect that. Signed-off-by: Aurelien Jarno Tested-by: Alexandre Ghiti Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit f40fe31c01445f31253b15bef2412b33ae31093b Author: Pingfan Liu Date: Sun Jan 23 20:13:52 2022 +0800 riscv: cpu-hotplug: clear cpu from numa map when teardown There is numa_add_cpu() when cpus online, accordingly, there should be numa_remove_cpu() when cpus offline. Signed-off-by: Pingfan Liu Fixes: 4f0e8eef772e ("riscv: Add numa support for riscv64 platform") Cc: stable@vger.kernel.org [Palmer: Add missing NUMA include] Signed-off-by: Palmer Dabbelt commit 5dbbbd01cbba831233c6ea9a3e6bfa133606d3c0 Author: Dave Ertman Date: Thu Jan 20 16:27:56 2022 -0800 ice: Avoid RTNL lock when re-creating auxiliary device If a call to re-create the auxiliary device happens in a context that has already taken the RTNL lock, then the call flow that recreates auxiliary device can hang if there is another attempt to claim the RTNL lock by the auxiliary driver. To avoid this, any call to re-create auxiliary devices that comes from an source that is holding the RTNL lock (e.g. netdev notifier when interface exits a bond) should execute in a separate thread. To accomplish this, add a flag to the PF that will be evaluated in the service task and dealt with there. Fixes: f9f5301e7e2d ("ice: Register auxiliary device to provide RDMA") Signed-off-by: Dave Ertman Reviewed-by: Jonathan Toppins Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit bea1898f65b9b7096cb4e73e97c83b94718f1fa1 Author: Dave Ertman Date: Tue Jan 18 13:08:20 2022 -0800 ice: Fix KASAN error in LAG NETDEV_UNREGISTER handler Currently, the same handler is called for both a NETDEV_BONDING_INFO LAG unlink notification as for a NETDEV_UNREGISTER call. This is causing a problem though, since the netdev_notifier_info passed has a different structure depending on which event is passed. The problem manifests as a call trace from a BUG: KASAN stack-out-of-bounds error. Fix this by creating a handler specific to NETDEV_UNREGISTER that only is passed valid elements in the netdev_notifier_info struct for the NETDEV_UNREGISTER event. Also included is the removal of an unbalanced dev_put on the peer_netdev and related braces. Fixes: 6a8b357278f5 ("ice: Respond to a NETDEV_UNREGISTER event for LAG") Signed-off-by: Dave Ertman Acked-by: Jonathan Toppins Tested-by: Sunitha Mekala Signed-off-by: Tony Nguyen commit 46b699c50c0304cdbd725d7740073a7f9d5edb10 Author: Jesse Brandeburg Date: Fri Jan 14 15:38:39 2022 -0800 ice: fix IPIP and SIT TSO offload The driver was avoiding offload for IPIP (at least) frames due to parsing the inner header offsets incorrectly when trying to check lengths. This length check works for VXLAN frames but fails on IPIP frames because skb_transport_offset points to the inner header in IPIP frames, which meant the subtraction of transport_header from inner_network_header returns a negative value (-20). With the code before this patch, everything continued to work, but GSO was being used to segment, causing throughputs of 1.5Gb/s per thread. After this patch, throughput is more like 10Gb/s per thread for IPIP traffic. Fixes: e94d44786693 ("ice: Implement filter sync, NDO operations and bump version") Signed-off-by: Jesse Brandeburg Reviewed-by: Paul Menzel Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit 21338d58736ef70eaae5fd75d567a358ff7902f9 Author: Dan Carpenter Date: Fri Jan 7 11:02:06 2022 +0300 ice: fix an error code in ice_cfg_phy_fec() Propagate the error code from ice_get_link_default_override() instead of returning success. Fixes: ea78ce4dab05 ("ice: add link lenient and default override support") Signed-off-by: Dan Carpenter Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit 249749c88906a00dc937a750406a36dfd11b5701 Author: Pablo Neira Ayuso Date: Thu Feb 10 10:11:52 2022 +0100 selftests: netfilter: synproxy test requires nf_conntrack Otherwise, this test does not find the sysctl entry in place: sysctl: cannot stat /proc/sys/net/netfilter/nf_conntrack_tcp_loose: No such file or directory iperf3: error - unable to send control message: Bad file descriptor FAIL: iperf3 returned an error Fixes: 7152303cbec4 ("selftests: netfilter: add synproxy test") Signed-off-by: Pablo Neira Ayuso commit 2b4e5fb4d3776c391e40fb33673ba946dd96012d Author: Pablo Neira Ayuso Date: Thu Feb 10 10:06:42 2022 +0100 netfilter: nft_synproxy: unregister hooks on init error path Disable the IPv4 hooks if the IPv6 hooks fail to be registered. Fixes: ad49d86e07a4 ("netfilter: nf_tables: Add synproxy support") Signed-off-by: Pablo Neira Ayuso commit c4416f5c2eb3ed48dfba265e628a6e52da962f03 Author: Victor Erminpour Date: Wed Feb 9 16:28:38 2022 -0800 net: mpls: Fix GCC 12 warning When building with automatic stack variable initialization, GCC 12 complains about variables defined outside of switch case statements. Move the variable outside the switch, which silences the warning: ./net/mpls/af_mpls.c:1624:21: error: statement will never be executed [-Werror=switch-unreachable] 1624 | int err; | ^~~ Signed-off-by: Victor Erminpour Signed-off-by: David S. Miller commit 9ccc6e0c8959a019bb40f6b18704b142c04b19a8 Author: Robert-Ionut Alexa Date: Wed Feb 9 17:57:43 2022 +0200 dpaa2-eth: unregister the netdev before disconnecting from the PHY The netdev should be unregistered before we are disconnecting from the MAC/PHY so that the dev_close callback is called and the PHY and the phylink workqueues are actually stopped before we are disconnecting and destroying the phylink instance. Fixes: 719479230893 ("dpaa2-eth: add MAC/PHY support through phylink") Signed-off-by: Robert-Ionut Alexa Signed-off-by: Ioana Ciornei Signed-off-by: David S. Miller commit 58e61e416b5abedcacd32032144b333bca30cf1e Author: Tom Rix Date: Wed Feb 9 07:02:42 2022 -0800 skbuff: cleanup double word in comment Remove the second 'to'. Signed-off-by: Tom Rix Signed-off-by: David S. Miller commit 37f7860602b5b2d99fc7465f6407f403f5941988 Author: Marc St-Amand Date: Wed Feb 9 15:13:25 2022 +0530 net: macb: Align the dma and coherent dma masks Single page and coherent memory blocks can use different DMA masks when the macb accesses physical memory directly. The kernel is clever enough to allocate pages that fit into the requested address width. When using the ARM SMMU, the DMA mask must be the same for single pages and big coherent memory blocks. Otherwise the translation tables turn into one big mess. [ 74.959909] macb ff0e0000.ethernet eth0: DMA bus error: HRESP not OK [ 74.959989] arm-smmu fd800000.smmu: Unhandled context fault: fsr=0x402, iova=0x3165687460, fsynr=0x20001, cbfrsynra=0x877, cb=1 [ 75.173939] macb ff0e0000.ethernet eth0: DMA bus error: HRESP not OK [ 75.173955] arm-smmu fd800000.smmu: Unhandled context fault: fsr=0x402, iova=0x3165687460, fsynr=0x20001, cbfrsynra=0x877, cb=1 Since using the same DMA mask does not hurt direct 1:1 physical memory mappings, this commit always aligns DMA and coherent masks. Signed-off-by: Marc St-Amand Signed-off-by: Harini Katakam Acked-by: Nicolas Ferre Tested-by: Conor Dooley Signed-off-by: David S. Miller commit 93e2c52d71a6067d08ee927e2682e9781cb911ef Merge: b13e0c7185681 63573807b27e0 Author: Jens Axboe Date: Thu Feb 10 06:56:43 2022 -0700 Merge tag 'nvme-5.17-2022-02-10' of git://git.infradead.org/nvme into block-5.17 Pull NVMe fixes from Christoph: "nvme fixes for Linux 5.17 - nvme-tcp: fix bogus request completion when failing to send AER (Sagi Grimberg) - add the missing nvme_complete_req tracepoint for batched completion (Bean Huo)" * tag 'nvme-5.17-2022-02-10' of git://git.infradead.org/nvme: nvme-tcp: fix bogus request completion when failing to send AER nvme: add nvme_complete_req tracepoint for batched completion commit e3c85076d7a6f986445b9008be7e7f83d1b0780a Merge: 252787201edfd d9565bf40da22 Author: Linus Torvalds Date: Thu Feb 10 05:52:00 2022 -0800 Merge tag 'mips-fixes-5.17_3' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux Pull MIPS fix from Thomas Bogendoerfer: "Device tree fix for Ingenic CI20" * tag 'mips-fixes-5.17_3' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: MIPS: DTS: CI20: fix how ddc power is enabled commit 252787201edfdf563ddf6b6006aa534ddc504031 Merge: 9aa422ad32663 7a82f89de92aa Author: Linus Torvalds Date: Thu Feb 10 05:43:43 2022 -0800 Merge tag 'audit-pr-20220209' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit Pull audit fix from Paul Moore: "Another audit fix, this time a single rather small but important fix for an oops/page-fault caused by improperly accessing userspace memory" * tag 'audit-pr-20220209' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit: audit: don't deref the syscall args when checking the openat2 open_how::flags commit 9aa422ad326634b76309e8ff342c246800621216 Author: Jon Maloy Date: Sat Feb 5 14:11:18 2022 -0500 tipc: improve size validations for received domain records The function tipc_mon_rcv() allows a node to receive and process domain_record structs from peer nodes to track their views of the network topology. This patch verifies that the number of members in a received domain record does not exceed the limit defined by MAX_MON_DOMAIN, something that may otherwise lead to a stack overflow. tipc_mon_rcv() is called from the function tipc_link_proto_rcv(), where we are reading a 32 bit message data length field into a uint16. To avert any risk of bit overflow, we add an extra sanity check for this in that function. We cannot see that happen with the current code, but future designers being unaware of this risk, may introduce it by allowing delivery of very large (> 64k) sk buffers from the bearer layer. This potential problem was identified by Eric Dumazet. This fixes CVE-2022-0435 Reported-by: Samuel Page Reported-by: Eric Dumazet Fixes: 35c55c9877f8 ("tipc: add neighbor monitoring framework") Signed-off-by: Jon Maloy Reviewed-by: Xin Long Reviewed-by: Samuel Page Reviewed-by: Eric Dumazet Signed-off-by: Linus Torvalds commit c8d251f51ee61df06ee0e419348d8c9160bbfb86 Author: Stephen Boyd Date: Wed Feb 9 15:25:20 2022 -0800 ASoC: qcom: Actually clear DMA interrupt register for HDMI In commit da0363f7bfd3 ("ASoC: qcom: Fix for DMA interrupt clear reg overwriting") we changed regmap_write() to regmap_update_bits() so that we can avoid overwriting bits that we didn't intend to modify. Unfortunately this change breaks the case where a register is writable but not readable, which is exactly how the HDMI irq clear register is designed (grep around LPASS_HDMITX_APP_IRQCLEAR_REG to see how it's write only). That's because regmap_update_bits() tries to read the register from the hardware and if it isn't readable it looks in the regmap cache to see what was written there last time to compare against what we want to write there. Eventually, we're unable to modify this register at all because the bits that we're trying to set are already set in the cache. This is doubly bad for the irq clear register because you have to write the bit to clear an interrupt. Given the irq is level triggered, we see an interrupt storm upon plugging in an HDMI cable and starting audio playback. The irq storm is so great that performance degrades significantly, leading to CPU soft lockups. Fix it by using regmap_write_bits() so that we really do write the bits in the clear register that we want to. This brings the number of irqs handled by lpass_dma_interrupt_handler() down from ~150k/sec to ~10/sec. Fixes: da0363f7bfd3 ("ASoC: qcom: Fix for DMA interrupt clear reg overwriting") Cc: Srinivasa Rao Mandadapu Cc: Srinivas Kandagatla Signed-off-by: Stephen Boyd Link: https://lore.kernel.org/r/20220209232520.4017634-1-swboyd@chromium.org Signed-off-by: Mark Brown commit 3e16dc50d77dc3494275a241fac250c94bf45206 Author: Takashi Iwai Date: Thu Feb 10 13:33:44 2022 +0100 ALSA: memalloc: invalidate SG pages before sync It seems that calling invalidate_kernel_vmap_range() is more correct to be called before dma_sync_*(), judging from the other thread: https://lore.kernel.org/all/20220111085958.GA22795@lst.de/ Although this won't matter much in practice, let's fix the call order for consistency. Fixes: a25684a95646 ("ALSA: memalloc: Support for non-contiguous page allocation") Reported-by: Ezequiel Garcia Cc: Link: https://lore.kernel.org/r/20220210123344.8756-3-tiwai@suse.de Signed-off-by: Takashi Iwai commit 8e1741c658996a16bd096e077dae0da2460a997f Author: Takashi Iwai Date: Thu Feb 10 13:33:43 2022 +0100 ALSA: memalloc: Fix dma_need_sync() checks dma_need_sync() checks each DMA address. Fix the incorrect usages for non-contiguous and non-coherent page allocations. Fortunately, there are no actual call sites that need manual syncs yet. Fixes: a25684a95646 ("ALSA: memalloc: Support for non-contiguous page allocation") Fixes: 73325f60e2ed ("ALSA: memalloc: Support for non-coherent page allocation") Cc: Reported-by: Ezequiel Garcia Link: https://lore.kernel.org/r/20220210123344.8756-2-tiwai@suse.de Signed-off-by: Takashi Iwai commit f66edf684edcb85c1db0b0aa8cf1a9392ba68a9d Author: Cai Huoqing Date: Wed Feb 9 11:28:41 2022 +0800 xen/pci: Make use of the helper macro LIST_HEAD() Replace "struct list_head head = LIST_HEAD_INIT(head)" with "LIST_HEAD(head)" to simplify the code. Signed-off-by: Cai Huoqing Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/20220209032842.38818-1-cai.huoqing@linux.dev Signed-off-by: Juergen Gross commit afea27dc3105004080c3127c6570dc3dff8563b2 Author: Jiapeng Chong Date: Mon Feb 7 18:35:06 2022 +0800 xen/x2apic: Fix inconsistent indenting Eliminate the follow smatch warning: arch/x86/xen/enlighten_hvm.c:189 xen_cpu_dead_hvm() warn: inconsistent indenting. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/20220207103506.102008-1-jiapeng.chong@linux.alibaba.com Signed-off-by: Juergen Gross commit e07e98da924e61e814bdaaa3ebc6e72b60dbf9ed Author: Roger Pau Monne Date: Thu Jan 20 16:25:27 2022 +0100 xen/x86: detect support for extended destination ID Xen allows the usage of some previously reserved bits in the IO-APIC RTE and the MSI address fields in order to store high bits for the target APIC ID. Such feature is already implemented by QEMU/KVM and HyperV, so in order to enable it just add the handler that checks for it's presence. Signed-off-by: Roger Pau Monné Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/20220120152527.7524-3-roger.pau@citrix.com Signed-off-by: Juergen Gross commit f34c4f2dd2445ab89e5373fff2990fab36578bd3 Author: Jan Beulich Date: Mon Feb 7 08:41:03 2022 +0100 xen/x86: obtain full video frame buffer address for Dom0 also under EFI The initial change would not work when Xen was booted from EFI: There is an early exit from the case block in that case. Move the necessary code ahead of that. Fixes: 335e4dd67b48 ("xen/x86: obtain upper 32 bits of video frame buffer address for Dom0") Signed-off-by: Jan Beulich Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/2501ce9d-40e5-b49d-b0e5-435544d17d4a@suse.com Signed-off-by: Juergen Gross commit 5e5eddd94c8906472e3904cb11b4e3ccbb99d0d4 Author: Arnd Bergmann Date: Thu Feb 10 09:57:48 2022 +0100 Revert "arm64: dts: imx8mn-venice-gw7902: disable gpu" This reverts commit 0c566618e27f17b5807086dba8c222ca8ca3dc1e, this one was meant for v5.18, not as a bugfix, though the patch itself was correct. Reported-by: Shawn Guo Signed-off-by: Arnd Bergmann commit bea2662e7818e15d7607d17d57912ac984275d94 Author: Johannes Berg Date: Tue Feb 8 11:47:30 2022 +0100 iwlwifi: fix use-after-free If no firmware was present at all (or, presumably, all of the firmware files failed to parse), we end up unbinding by calling device_release_driver(), which calls remove(), which then in iwlwifi calls iwl_drv_stop(), freeing the 'drv' struct. However the new code I added will still erroneously access it after it was freed. Set 'failure=false' in this case to avoid the access, all data was already freed anyway. Cc: stable@vger.kernel.org Reported-by: Stefan Agner Reported-by: Wolfgang Walter Reported-by: Jason Self Reported-by: Dominik Behr Reported-by: Marek Marczykowski-Górecki Fixes: ab07506b0454 ("iwlwifi: fix leaks/bad data after failed firmware load") Signed-off-by: Johannes Berg Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220208114728.e6b514cf4c85.Iffb575ca2a623d7859b542c33b2a507d01554251@changeid commit 4e9120cbaca118f35a31a5e9986063e722614378 Merge: 8ecbb179286cb 029744cd4bc6e Author: Jakub Kicinski Date: Wed Feb 9 21:44:37 2022 -0800 Merge branch 'mptcp-fixes-for-5-17' Mat Martineau says: ==================== mptcp: Fixes for 5.17 Patch 1 fixes a MPTCP selftest bug that combined the results of two separate tests in the test output. Patch 2 fixes a problem where advertised IPv6 addresses were not actually available for incoming MP_JOIN requests. ==================== Link: https://lore.kernel.org/r/20220210012508.226880-1-mathew.j.martineau@linux.intel.com Signed-off-by: Jakub Kicinski commit 029744cd4bc6e9eb3bd833b4a033348296d34645 Author: Kishen Maloor Date: Wed Feb 9 17:25:08 2022 -0800 mptcp: netlink: process IPv6 addrs in creating listening sockets This change updates mptcp_pm_nl_create_listen_socket() to create listening sockets bound to IPv6 addresses (where IPv6 is supported). Fixes: 1729cf186d8a ("mptcp: create the listening socket for new port") Acked-by: Geliang Tang Signed-off-by: Kishen Maloor Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 857898eb4b28daf3faca3ae334c78b2bb141475e Author: Matthieu Baerts Date: Wed Feb 9 17:25:07 2022 -0800 selftests: mptcp: add missing join check This function also writes the name of the test with its ID, making clear a new test has been executed. Without that, the ADD_ADDR results from this test was appended at the end of the previous test causing confusions. Especially when the second test was failing, we had: 17 signal invalid addresses syn[ ok ] - synack[ ok ] - ack[ ok ] add[ ok ] - echo [ ok ] add[fail] got 2 ADD_ADDR[s] expected 3 In fact, this 17th test was OK but not the 18th one. Now we have: 17 signal invalid addresses syn[ ok ] - synack[ ok ] - ack[ ok ] add[ ok ] - echo [ ok ] 18 signal addresses race test syn[fail] got 2 JOIN[s] syn expected 3 - synack[fail] got 2 JOIN[s] synack expected - ack[fail] got 2 JOIN[s] ack expected 3 add[fail] got 2 ADD_ADDR[s] expected 3 Fixes: 33c563ad28e3 ("selftests: mptcp: add_addr and echo race test") Reported-by: Paolo Abeni Signed-off-by: Matthieu Baerts Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit b97cca3ba9098522e5a1c3388764ead42640c1a5 Author: Darrick J. Wong Date: Thu Feb 3 08:29:21 2022 -0800 xfs: only bother with sync_filesystem during readonly remount In commit 02b9984d6408, we pushed a sync_filesystem() call from the VFS into xfs_fs_remount. The only time that we ever need to push dirty file data or metadata to disk for a remount is if we're remounting the filesystem read only, so this really could be moved to xfs_remount_ro. Once we've moved the call site, actually check the return value from sync_filesystem. Fixes: 02b9984d6408 ("fs: push sync_filesystem() down to the file system's remount_fs()") Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit 8ecbb179286cbc91810c16caeb3396e06305cd0c Author: Slark Xiao Date: Wed Feb 9 10:47:17 2022 +0800 net: usb: qmi_wwan: Add support for Dell DW5829e Dell DW5829e same as DW5821e except the CAT level. DW5821e supports CAT16 but DW5829e supports CAT9. Also, DW5829e includes normal and eSIM type. Please see below test evidence: T: Bus=04 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 5 Spd=5000 MxCh= 0 D: Ver= 3.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS= 9 #Cfgs= 1 P: Vendor=413c ProdID=81e6 Rev=03.18 S: Manufacturer=Dell Inc. S: Product=DW5829e Snapdragon X20 LTE S: SerialNumber=0123456789ABCDEF C: #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=896mA I: If#=0x0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan I: If#=0x1 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=00 Prot=00 Driver=usbhid I: If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option T: Bus=04 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 7 Spd=5000 MxCh= 0 D: Ver= 3.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS= 9 #Cfgs= 1 P: Vendor=413c ProdID=81e4 Rev=03.18 S: Manufacturer=Dell Inc. S: Product=DW5829e-eSIM Snapdragon X20 LTE S: SerialNumber=0123456789ABCDEF C: #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=896mA I: If#=0x0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan I: If#=0x1 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=00 Prot=00 Driver=usbhid I: If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option I: If#=0x5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option Signed-off-by: Slark Xiao Acked-by: Bjørn Mork Link: https://lore.kernel.org/r/20220209024717.8564-1-slark_xiao@163.com Signed-off-by: Jakub Kicinski commit d23a0c3718222a42430fd56359478a6fc7675070 Author: Masahiro Yamada Date: Tue Feb 8 15:26:18 2022 +0900 kconfig: fix missing fclose() on error paths The file is not closed when ferror() fails. Fixes: 00d674cb3536 ("kconfig: refactor conf_write_dep()") Fixes: 57ddd07c4560 ("kconfig: refactor conf_write_autoconf()") Reported-by: Ryan Cai Signed-off-by: Masahiro Yamada commit 6e7545ddb13416fd200e0b91c0acfd0404e2e27b Author: Alex Deucher Date: Thu Feb 3 10:04:58 2022 -0500 drm/amdgpu/display: change pipe policy for DCN 2.0 Fixes hangs on driver load with multiple displays on DCN 2.0 parts. Bug: https://bugzilla.kernel.org/show_bug.cgi?id=215511 Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1877 Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1886 Fixes: ee2698cf79cc ("drm/amd/display: Changed pipe split policy to allow for multi-display pipe split") Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit dd9cb842fa9d90653a9b48aba52f89c069f3bc50 Author: Vineeth Vijayan Date: Wed Feb 2 21:45:56 2022 +0100 s390/cio: verify the driver availability for path_event call If no driver is attached to a device or the driver does not provide the path_event function, an FCES path-event on this device could end up in a kernel-panic. Verify the driver availability before the path_event function call. Fixes: 32ef938815c1 ("s390/cio: Add support for FCES status notification") Cc: stable@vger.kernel.org Signed-off-by: Vineeth Vijayan Suggested-by: Peter Oberparleiter Reviewed-by: Jan Hoeppner Reviewed-by: Peter Oberparleiter Signed-off-by: Vasily Gorbik commit 7a82f89de92aac5a244d3735b2bd162c1147620c Author: Paul Moore Date: Wed Feb 9 14:49:38 2022 -0500 audit: don't deref the syscall args when checking the openat2 open_how::flags As reported by Jeff, dereferencing the openat2 syscall argument in audit_match_perm() to obtain the open_how::flags can result in an oops/page-fault. This patch fixes this by using the open_how struct that we store in the audit_context with audit_openat2_how(). Independent of this patch, Richard Guy Briggs posted a similar patch to the audit mailing list roughly 40 minutes after this patch was posted. Cc: stable@vger.kernel.org Fixes: 1c30e3af8a79 ("audit: add support for the openat2 syscall") Reported-by: Jeff Mahoney Signed-off-by: Paul Moore commit a8b1e8636a3252daa729762b2e3cc9015cc91a5c Author: Yang Wang Date: Tue Feb 8 14:23:55 2022 +0800 drm/amd/pm: fix hwmon node of power1_label create issue it will cause hwmon node of power1_label is not created. v2: the hwmon node of "power1_label" is always needed for all ASICs. and the patch will remove ASIC type check for "power1_label". Fixes: ae07970a0621d6 ("drm/amd/pm: add support for hwmon control of slow and fast PPT limit on vangogh") Signed-off-by: Yang Wang Reviewed-by: Kenneth Feng Signed-off-by: Alex Deucher commit ad787771b43602d64e02b5963f4192232b46366b Author: Zhan Liu Date: Thu Jan 27 22:08:53 2022 -0500 drm/amd/display: keep eDP Vdd on when eDP stream is already enabled [Why] Even if can_apply_edp_fast_boot is set to 1 at boot, this flag will be cleared to 0 at S3 resume. [How] Keep eDP Vdd on when eDP stream is already enabled. Reviewed-by: Charlene Liu Acked-by: Jasdeep Dhillon Signed-off-by: Zhan Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 60fdf98a774eee244a4e00c34a9e7729b61d0f44 Author: Dmytro Laktyushkin Date: Thu Jan 27 11:55:49 2022 -0500 drm/amd/display: fix yellow carp wm clamping Fix clamping to match register field size Reviewed-by: Charlene Liu Acked-by: Jasdeep Dhillon Signed-off-by: Dmytro Laktyushkin Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 328e34a5ad227399391891d454043e5d73e598d2 Author: Roman Li Date: Wed Feb 2 14:30:09 2022 -0500 drm/amd/display: Cap pflip irqs per max otg number [Why] pflip interrupt order are mapped 1 to 1 to otg id. e.g. if irq_src=26 corresponds to otg0 then 27->otg1, 28->otg2... Linux DM registers pflip interrupts per number of crtcs. In fused pipe case crtc numbers can be less than otg id. e.g. if one pipe out of 3(otg#0-2) is fused adev->mode_info.num_crtc=2 so DM only registers irq_src 26,27. This is a bug since if pipe#2 remains unfused DM never gets otg2 pflip interrupt (irq_src=28) That may results in gfx failure due to pflip timeout. [How] Register pflip interrupts per max num of otg instead of num_crtc Signed-off-by: Roman Li Reviewed-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher commit a072312f43c33ea02ad88bff3375f650684a6f24 Author: Aaron Liu Date: Sat Jan 29 09:21:31 2022 +0800 drm/amdgpu: add utcl2_harvest to gc 10.3.1 Confirmed with hardware team, there is harvesting for gc 10.3.1. Signed-off-by: Aaron Liu Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit 03ad3093c7c069d6ab4403730009ebafeea9ee37 Author: Mario Limonciello Date: Tue Jan 25 15:49:47 2022 -0600 display/amd: decrease message verbosity about watermarks table failure A number of BIOS versions have a problem with the watermarks table not being configured properly. This manifests as a very scary looking warning during resume from s0i3. This should be harmless in most cases and is well understood, so decrease the assertion to a clearer warning about the problem. Reviewed-by: Harry Wentland Signed-off-by: Mario Limonciello Signed-off-by: Alex Deucher commit 268a491aebc25e6dc7c618903b09ac3a2e8af530 Author: Dinh Nguyen Date: Thu Jan 6 17:53:31 2022 -0600 arm64: dts: agilex: use the compatible "intel,socfpga-agilex-hsotg" The DWC2 USB controller on the Agilex platform does not support clock gating, so use the chip specific "intel,socfpga-agilex-hsotg" compatible. Signed-off-by: Dinh Nguyen commit 728390fce4fc4d033a898fb6f5088697d03254b8 Author: Dinh Nguyen Date: Thu Jan 6 17:37:03 2022 -0600 dt-bindings: usb: dwc2: add compatible "intel,socfpga-agilex-hsotg" Add the compatible "intel,socfpga-agilex-hsotg" to the DWC2 implementation, because the Agilex DWC2 implementation does not support clock gating. Acked-by: Rob Herring Signed-off-by: Dinh Nguyen commit 3eb616b26408ac813c67280cf883f36d98b8441d Author: Hans de Goede Date: Wed Feb 9 17:13:42 2022 +0100 x86/PCI: revert "Ignore E820 reservations for bridge windows on newer systems" Commit 7f7b4236f204 ("x86/PCI: Ignore E820 reservations for bridge windows on newer systems") fixes the touchpad not working on laptops like the Lenovo IdeaPad 3 15IIL05 and the Lenovo IdeaPad 5 14IIL05, as well as fixing thunderbolt hotplug issues on the Lenovo Yoga C940. Unfortunately it turns out that this is causing issues with suspend/resume on Lenovo ThinkPad X1 Carbon Gen 2 laptops. So, per the no regressions policy, rever this. Note I'm looking into another fix for the issues this fixed. Fixes: 7f7b4236f204 ("x86/PCI: Ignore E820 reservations for bridge windows on newer systems") BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=2029207 Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit da5fb9e1ad3fbf632dce735f1bdad257ca528499 Author: Robin Murphy Date: Thu Feb 3 19:31:24 2022 +0000 ACPI/IORT: Check node revision for PMCG resources The original version of the IORT PMCG definition had an oversight wherein there was no way to describe the second register page for an implementation using the recommended RELOC_CTRS feature. Although the spec was fixed, and the final patches merged to ACPICA and Linux written against the new version, it seems that some old firmware based on the original revision has survived and turned up in the wild. Add a check for the original PMCG definition, and avoid filling in the second memory resource with nonsense if so. Otherwise it is likely that something horrible will happen when the PMCG driver attempts to probe. Reported-by: Michael Petlan Fixes: 24e516049360 ("ACPI/IORT: Add support for PMCG") Cc: # 5.2.x Signed-off-by: Robin Murphy Acked-by: Lorenzo Pieralisi Link: https://lore.kernel.org/r/75628ae41c257fb73588f7bf1c4459160e04be2b.1643916258.git.robin.murphy@arm.com Signed-off-by: Catalin Marinas commit f4bc5bbb5fef3cf421ba3485d6d383c27ec473ed Merge: f9f94c9d2c070 c306d737691ef Author: Linus Torvalds Date: Wed Feb 9 09:56:57 2022 -0800 Merge tag 'nfsd-5.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux Pull more nfsd fixes from Chuck Lever: "Ensure that NFS clients cannot send file size or offset values that can cause the NFS server to crash or to return incorrect or surprising results. In particular, fix how the NFS server handles values larger than OFFSET_MAX" * tag 'nfsd-5.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: NFSD: Deprecate NFS_OFFSET_MAX NFSD: Fix offset type in I/O trace points NFSD: COMMIT operations must not return NFS?ERR_INVAL NFSD: Clamp WRITE offsets NFSD: Fix NFSv3 SETATTR/CREATE's handling of large file sizes NFSD: Fix ia_size underflow NFSD: Fix the behavior of READ near OFFSET_MAX commit f9f94c9d2c070941a5688f0f751a489c7d0e5039 Merge: b42bc9a3c5115 c6ce9c5831cae Author: Linus Torvalds Date: Wed Feb 9 09:53:56 2022 -0800 Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 Pull crypto fixes from Herbert Xu: "Fix two regressions: - Potential boot failure due to missing cryptomgr on initramfs - Stack overflow in octeontx2" * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: api - Move cryptomgr soft dependency into algapi crypto: octeontx2 - Avoid stack variable overflow commit 2e7be9db125a0bf940c5d65eb5c40d8700f738b5 Author: Dāvis Mosāns Date: Sat Feb 5 20:48:23 2022 +0200 btrfs: send: in case of IO error log it Currently if we get IO error while doing send then we abort without logging information about which file caused issue. So log it to help with debugging. CC: stable@vger.kernel.org # 4.9+ Signed-off-by: Dāvis Mosāns Reviewed-by: David Sterba Signed-off-by: David Sterba commit a0f0cf8341e34e5d2265bfd3a7ad68342da1e2aa Author: Filipe Manana Date: Wed Feb 2 15:26:09 2022 +0000 btrfs: get rid of warning on transaction commit when using flushoncommit When using the flushoncommit mount option, during almost every transaction commit we trigger a warning from __writeback_inodes_sb_nr(): $ cat fs/fs-writeback.c: (...) static void __writeback_inodes_sb_nr(struct super_block *sb, ... { (...) WARN_ON(!rwsem_is_locked(&sb->s_umount)); (...) } (...) The trace produced in dmesg looks like the following: [947.473890] WARNING: CPU: 5 PID: 930 at fs/fs-writeback.c:2610 __writeback_inodes_sb_nr+0x7e/0xb3 [947.481623] Modules linked in: nfsd nls_cp437 cifs asn1_decoder cifs_arc4 fscache cifs_md4 ipmi_ssif [947.489571] CPU: 5 PID: 930 Comm: btrfs-transacti Not tainted 95.16.3-srb-asrock-00001-g36437ad63879 #186 [947.497969] RIP: 0010:__writeback_inodes_sb_nr+0x7e/0xb3 [947.502097] Code: 24 10 4c 89 44 24 18 c6 (...) [947.519760] RSP: 0018:ffffc90000777e10 EFLAGS: 00010246 [947.523818] RAX: 0000000000000000 RBX: 0000000000963300 RCX: 0000000000000000 [947.529765] RDX: 0000000000000000 RSI: 000000000000fa51 RDI: ffffc90000777e50 [947.535740] RBP: ffff888101628a90 R08: ffff888100955800 R09: ffff888100956000 [947.541701] R10: 0000000000000002 R11: 0000000000000001 R12: ffff888100963488 [947.547645] R13: ffff888100963000 R14: ffff888112fb7200 R15: ffff888100963460 [947.553621] FS: 0000000000000000(0000) GS:ffff88841fd40000(0000) knlGS:0000000000000000 [947.560537] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [947.565122] CR2: 0000000008be50c4 CR3: 000000000220c000 CR4: 00000000001006e0 [947.571072] Call Trace: [947.572354] [947.573266] btrfs_commit_transaction+0x1f1/0x998 [947.576785] ? start_transaction+0x3ab/0x44e [947.579867] ? schedule_timeout+0x8a/0xdd [947.582716] transaction_kthread+0xe9/0x156 [947.585721] ? btrfs_cleanup_transaction.isra.0+0x407/0x407 [947.590104] kthread+0x131/0x139 [947.592168] ? set_kthread_struct+0x32/0x32 [947.595174] ret_from_fork+0x22/0x30 [947.597561] [947.598553] ---[ end trace 644721052755541c ]--- This is because we started using writeback_inodes_sb() to flush delalloc when committing a transaction (when using -o flushoncommit), in order to avoid deadlocks with filesystem freeze operations. This change was made by commit ce8ea7cc6eb313 ("btrfs: don't call btrfs_start_delalloc_roots in flushoncommit"). After that change we started producing that warning, and every now and then a user reports this since the warning happens too often, it spams dmesg/syslog, and a user is unsure if this reflects any problem that might compromise the filesystem's reliability. We can not just lock the sb->s_umount semaphore before calling writeback_inodes_sb(), because that would at least deadlock with filesystem freezing, since at fs/super.c:freeze_super() sync_filesystem() is called while we are holding that semaphore in write mode, and that can trigger a transaction commit, resulting in a deadlock. It would also trigger the same type of deadlock in the unmount path. Possibly, it could also introduce some other locking dependencies that lockdep would report. To fix this call try_to_writeback_inodes_sb() instead of writeback_inodes_sb(), because that will try to read lock sb->s_umount and then will only call writeback_inodes_sb() if it was able to lock it. This is fine because the cases where it can't read lock sb->s_umount are during a filesystem unmount or during a filesystem freeze - in those cases sb->s_umount is write locked and sync_filesystem() is called, which calls writeback_inodes_sb(). In other words, in all cases where we can't take a read lock on sb->s_umount, writeback is already being triggered elsewhere. An alternative would be to call btrfs_start_delalloc_roots() with a number of pages different from LONG_MAX, for example matching the number of delalloc bytes we currently have, in which case we would end up starting all delalloc with filemap_fdatawrite_wbc() and not with an async flush via filemap_flush() - that is only possible after the rather recent commit e076ab2a2ca70a ("btrfs: shrink delalloc pages instead of full inodes"). However that creates a whole new can of worms due to new lock dependencies, which lockdep complains, like for example: [ 8948.247280] ====================================================== [ 8948.247823] WARNING: possible circular locking dependency detected [ 8948.248353] 5.17.0-rc1-btrfs-next-111 #1 Not tainted [ 8948.248786] ------------------------------------------------------ [ 8948.249320] kworker/u16:18/933570 is trying to acquire lock: [ 8948.249812] ffff9b3de1591690 (sb_internal#2){.+.+}-{0:0}, at: find_free_extent+0x141e/0x1590 [btrfs] [ 8948.250638] but task is already holding lock: [ 8948.251140] ffff9b3e09c717d8 (&root->delalloc_mutex){+.+.}-{3:3}, at: start_delalloc_inodes+0x78/0x400 [btrfs] [ 8948.252018] which lock already depends on the new lock. [ 8948.252710] the existing dependency chain (in reverse order) is: [ 8948.253343] -> #2 (&root->delalloc_mutex){+.+.}-{3:3}: [ 8948.253950] __mutex_lock+0x90/0x900 [ 8948.254354] start_delalloc_inodes+0x78/0x400 [btrfs] [ 8948.254859] btrfs_start_delalloc_roots+0x194/0x2a0 [btrfs] [ 8948.255408] btrfs_commit_transaction+0x32f/0xc00 [btrfs] [ 8948.255942] btrfs_mksubvol+0x380/0x570 [btrfs] [ 8948.256406] btrfs_mksnapshot+0x81/0xb0 [btrfs] [ 8948.256870] __btrfs_ioctl_snap_create+0x17f/0x190 [btrfs] [ 8948.257413] btrfs_ioctl_snap_create_v2+0xbb/0x140 [btrfs] [ 8948.257961] btrfs_ioctl+0x1196/0x3630 [btrfs] [ 8948.258418] __x64_sys_ioctl+0x83/0xb0 [ 8948.258793] do_syscall_64+0x3b/0xc0 [ 8948.259146] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 8948.259709] -> #1 (&fs_info->delalloc_root_mutex){+.+.}-{3:3}: [ 8948.260330] __mutex_lock+0x90/0x900 [ 8948.260692] btrfs_start_delalloc_roots+0x97/0x2a0 [btrfs] [ 8948.261234] btrfs_commit_transaction+0x32f/0xc00 [btrfs] [ 8948.261766] btrfs_set_free_space_cache_v1_active+0x38/0x60 [btrfs] [ 8948.262379] btrfs_start_pre_rw_mount+0x119/0x180 [btrfs] [ 8948.262909] open_ctree+0x1511/0x171e [btrfs] [ 8948.263359] btrfs_mount_root.cold+0x12/0xde [btrfs] [ 8948.263863] legacy_get_tree+0x30/0x50 [ 8948.264242] vfs_get_tree+0x28/0xc0 [ 8948.264594] vfs_kern_mount.part.0+0x71/0xb0 [ 8948.265017] btrfs_mount+0x11d/0x3a0 [btrfs] [ 8948.265462] legacy_get_tree+0x30/0x50 [ 8948.265851] vfs_get_tree+0x28/0xc0 [ 8948.266203] path_mount+0x2d4/0xbe0 [ 8948.266554] __x64_sys_mount+0x103/0x140 [ 8948.266940] do_syscall_64+0x3b/0xc0 [ 8948.267300] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 8948.267790] -> #0 (sb_internal#2){.+.+}-{0:0}: [ 8948.268322] __lock_acquire+0x12e8/0x2260 [ 8948.268733] lock_acquire+0xd7/0x310 [ 8948.269092] start_transaction+0x44c/0x6e0 [btrfs] [ 8948.269591] find_free_extent+0x141e/0x1590 [btrfs] [ 8948.270087] btrfs_reserve_extent+0x14b/0x280 [btrfs] [ 8948.270588] cow_file_range+0x17e/0x490 [btrfs] [ 8948.271051] btrfs_run_delalloc_range+0x345/0x7a0 [btrfs] [ 8948.271586] writepage_delalloc+0xb5/0x170 [btrfs] [ 8948.272071] __extent_writepage+0x156/0x3c0 [btrfs] [ 8948.272579] extent_write_cache_pages+0x263/0x460 [btrfs] [ 8948.273113] extent_writepages+0x76/0x130 [btrfs] [ 8948.273573] do_writepages+0xd2/0x1c0 [ 8948.273942] filemap_fdatawrite_wbc+0x68/0x90 [ 8948.274371] start_delalloc_inodes+0x17f/0x400 [btrfs] [ 8948.274876] btrfs_start_delalloc_roots+0x194/0x2a0 [btrfs] [ 8948.275417] flush_space+0x1f2/0x630 [btrfs] [ 8948.275863] btrfs_async_reclaim_data_space+0x108/0x1b0 [btrfs] [ 8948.276438] process_one_work+0x252/0x5a0 [ 8948.276829] worker_thread+0x55/0x3b0 [ 8948.277189] kthread+0xf2/0x120 [ 8948.277506] ret_from_fork+0x22/0x30 [ 8948.277868] other info that might help us debug this: [ 8948.278548] Chain exists of: sb_internal#2 --> &fs_info->delalloc_root_mutex --> &root->delalloc_mutex [ 8948.279601] Possible unsafe locking scenario: [ 8948.280102] CPU0 CPU1 [ 8948.280508] ---- ---- [ 8948.280915] lock(&root->delalloc_mutex); [ 8948.281271] lock(&fs_info->delalloc_root_mutex); [ 8948.281915] lock(&root->delalloc_mutex); [ 8948.282487] lock(sb_internal#2); [ 8948.282800] *** DEADLOCK *** [ 8948.283333] 4 locks held by kworker/u16:18/933570: [ 8948.283750] #0: ffff9b3dc00a9d48 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_one_work+0x1d2/0x5a0 [ 8948.284609] #1: ffffa90349dafe70 ((work_completion)(&fs_info->async_data_reclaim_work)){+.+.}-{0:0}, at: process_one_work+0x1d2/0x5a0 [ 8948.285637] #2: ffff9b3e14db5040 (&fs_info->delalloc_root_mutex){+.+.}-{3:3}, at: btrfs_start_delalloc_roots+0x97/0x2a0 [btrfs] [ 8948.286674] #3: ffff9b3e09c717d8 (&root->delalloc_mutex){+.+.}-{3:3}, at: start_delalloc_inodes+0x78/0x400 [btrfs] [ 8948.287596] stack backtrace: [ 8948.287975] CPU: 3 PID: 933570 Comm: kworker/u16:18 Not tainted 5.17.0-rc1-btrfs-next-111 #1 [ 8948.288677] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 [ 8948.289649] Workqueue: events_unbound btrfs_async_reclaim_data_space [btrfs] [ 8948.290298] Call Trace: [ 8948.290517] [ 8948.290700] dump_stack_lvl+0x59/0x73 [ 8948.291026] check_noncircular+0xf3/0x110 [ 8948.291375] ? start_transaction+0x228/0x6e0 [btrfs] [ 8948.291826] __lock_acquire+0x12e8/0x2260 [ 8948.292241] lock_acquire+0xd7/0x310 [ 8948.292714] ? find_free_extent+0x141e/0x1590 [btrfs] [ 8948.293241] ? lock_is_held_type+0xea/0x140 [ 8948.293601] start_transaction+0x44c/0x6e0 [btrfs] [ 8948.294055] ? find_free_extent+0x141e/0x1590 [btrfs] [ 8948.294518] find_free_extent+0x141e/0x1590 [btrfs] [ 8948.294957] ? _raw_spin_unlock+0x29/0x40 [ 8948.295312] ? btrfs_get_alloc_profile+0x124/0x290 [btrfs] [ 8948.295813] btrfs_reserve_extent+0x14b/0x280 [btrfs] [ 8948.296270] cow_file_range+0x17e/0x490 [btrfs] [ 8948.296691] btrfs_run_delalloc_range+0x345/0x7a0 [btrfs] [ 8948.297175] ? find_lock_delalloc_range+0x247/0x270 [btrfs] [ 8948.297678] writepage_delalloc+0xb5/0x170 [btrfs] [ 8948.298123] __extent_writepage+0x156/0x3c0 [btrfs] [ 8948.298570] extent_write_cache_pages+0x263/0x460 [btrfs] [ 8948.299061] extent_writepages+0x76/0x130 [btrfs] [ 8948.299495] do_writepages+0xd2/0x1c0 [ 8948.299817] ? sched_clock_cpu+0xd/0x110 [ 8948.300160] ? lock_release+0x155/0x4a0 [ 8948.300494] filemap_fdatawrite_wbc+0x68/0x90 [ 8948.300874] ? do_raw_spin_unlock+0x4b/0xa0 [ 8948.301243] start_delalloc_inodes+0x17f/0x400 [btrfs] [ 8948.301706] ? lock_release+0x155/0x4a0 [ 8948.302055] btrfs_start_delalloc_roots+0x194/0x2a0 [btrfs] [ 8948.302564] flush_space+0x1f2/0x630 [btrfs] [ 8948.302970] btrfs_async_reclaim_data_space+0x108/0x1b0 [btrfs] [ 8948.303510] process_one_work+0x252/0x5a0 [ 8948.303860] ? process_one_work+0x5a0/0x5a0 [ 8948.304221] worker_thread+0x55/0x3b0 [ 8948.304543] ? process_one_work+0x5a0/0x5a0 [ 8948.304904] kthread+0xf2/0x120 [ 8948.305184] ? kthread_complete_and_exit+0x20/0x20 [ 8948.305598] ret_from_fork+0x22/0x30 [ 8948.305921] It all comes from the fact that btrfs_start_delalloc_roots() takes the delalloc_root_mutex, in the transaction commit path we are holding a read lock on one of the superblock's freeze semaphores (via sb_start_intwrite()), the async reclaim task can also do a call to btrfs_start_delalloc_roots(), which ends up triggering writeback with calls to filemap_fdatawrite_wbc(), resulting in extent allocation which in turn can call btrfs_start_transaction(), which will result in taking the freeze semaphore via sb_start_intwrite(), forming a nasty dependency on all those locks which can be taken in different orders by different code paths. So just adopt the simple approach of calling try_to_writeback_inodes_sb() at btrfs_start_delalloc_flush(). Link: https://lore.kernel.org/linux-btrfs/20220130005258.GA7465@cuci.nl/ Link: https://lore.kernel.org/linux-btrfs/43acc426-d683-d1b6-729d-c6bc4a2fff4d@gmail.com/ Link: https://lore.kernel.org/linux-btrfs/6833930a-08d7-6fbc-0141-eb9cdfd6bb4d@gmail.com/ Link: https://lore.kernel.org/linux-btrfs/20190322041731.GF16651@hungrycats.org/ Reviewed-by: Omar Sandoval Signed-off-by: Filipe Manana [ add more link reports ] Signed-off-by: David Sterba commit 0d1ffa2228cb34f485f8fe927f134b82a0ea62ae Author: Qu Wenruo Date: Tue Feb 8 14:54:05 2022 +0800 btrfs: defrag: don't try to defrag extents which are under writeback Once we start writeback (have called btrfs_run_delalloc_range()), we allocate an extent, create an extent map point to that extent, with a generation of (u64)-1, created the ordered extent and then clear the DELALLOC bit from the range in the inode's io tree. Such extent map can pass the first call of defrag_collect_targets(), as its generation is (u64)-1, meets any possible minimal generation check. And the range will not have DELALLOC bit, also passing the DELALLOC bit check. It will only be re-checked in the second call of defrag_collect_targets(), which will wait for writeback. But at that stage we have already spent our time waiting for some IO we may or may not want to defrag. Let's reject such extents early so we won't waste our time. CC: stable@vger.kernel.org # 5.16 Reviewed-by: Filipe Manana Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit ea0eba69a2a8125229b1b6011644598039bc53aa Author: Qu Wenruo Date: Sun Jan 30 20:53:15 2022 +0800 btrfs: don't hold CPU for too long when defragging a file There is a user report about "btrfs filesystem defrag" causing 120s timeout problem. For btrfs_defrag_file() it will iterate all file extents if called from defrag ioctl, thus it can take a long time. There is no reason not to release the CPU during such a long operation. Add cond_resched() after defragged one cluster. CC: stable@vger.kernel.org # 5.16 Link: https://lore.kernel.org/linux-btrfs/10e51417-2203-f0a4-2021-86c8511cc367@gmx.com Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit b42bc9a3c5115c3102a4923776bbeed3b191f2db Author: Domenico Andreoli Date: Wed Feb 9 08:49:20 2022 +0100 Fix regression due to "fs: move binfmt_misc sysctl to its own file" Commit 3ba442d5331f ("fs: move binfmt_misc sysctl to its own file") did not go unnoticed, binfmt-support stopped to work on my Debian system since v5.17-rc2 (did not check with -rc1). The existance of the /proc/sys/fs/binfmt_misc is a precondition for attempting to mount the binfmt_misc fs, which in turn triggers the autoload of the binfmt_misc module. Without it, no module is loaded and no binfmt is available at boot. Building as built-in or manually loading the module and mounting the fs works fine, it's therefore only a matter of interaction with user-space. I could try to improve the Debian systemd configuration but I can't say anything about the other distributions. This patch restores a working system right after boot. Fixes: 3ba442d5331f ("fs: move binfmt_misc sysctl to its own file") Signed-off-by: Domenico Andreoli Cc: Andrew Morton Cc: Luis Chamberlain Reviewed-by: Tong Zhang Signed-off-by: Linus Torvalds commit 09a93c1df3eafa43bcdfd7bf837c574911f12f55 Merge: e6251ab4551f5 2c212e1baedcd Author: Linus Torvalds Date: Wed Feb 9 09:14:22 2022 -0800 Merge tag 'kvm-s390-kernel-access' from emailed bundle Pull s390 kvm fix from Christian Borntraeger: "Add missing check for the MEMOP ioctl The SIDA MEMOPs must only be used for secure guests, otherwise userspace can do unwanted memory accesses" * tag 'kvm-s390-kernel-access' from emailed bundle: KVM: s390: Return error on SIDA memop on normal guest commit 647474b8d980256b26b1cd112d7333a4dbd4260a Author: AngeloGioacchino Del Regno Date: Mon Jan 31 09:55:20 2022 +0100 drm/mediatek: mtk_dsi: Avoid EPROBE_DEFER loop with external bridge DRM bridge drivers are now attaching their DSI device at probe time, which requires us to register our DSI host in order to let the bridge to probe: this recently started producing an endless -EPROBE_DEFER loop on some machines that are using external bridges, like the parade-ps8640, found on the ACER Chromebook R13. Now that the DSI hosts/devices probe sequence is documented, we can do adjustments to the mtk_dsi driver as to both fix now and make sure to avoid this situation in the future: for this, following what is documented in drm_bridge.c, move the mtk_dsi component_add() to the mtk_dsi_ops.attach callback and delete it in the detach callback; keeping in mind that we are registering a drm_bridge for our DSI, which is only used/attached if the DSI Host is bound, it wouldn't make sense to keep adding our bridge at probe time (as it would be useless to have it if mtk_dsi_ops.attach() fails!), so also move that one to the dsi host attach function (and remove it in detach). Cc: # 5.15.x Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Andrzej Hajda Reviewed-by: Jagan Teki Tested-by: Nícolas F. R. A. Prado Signed-off-by: Chun-Kuang Hu commit e4e3a93c6e267572ca2345d8d86053e166843a8c Author: Tzung-Bi Shih Date: Tue Feb 8 11:12:42 2022 +0800 MAINTAINERS: update cros_ec_codec maintainers Updates cros_ec_codec maintainers. Signed-off-by: Tzung-Bi Shih Acked-By: Cheng-Yi Chiang Acked-By: Benson Leung Link: https://lore.kernel.org/r/20220208031242.227563-1-tzungbi@google.com Signed-off-by: Mark Brown commit ffc58bc4af9365d4eea72526bb3cf6a83615c673 Author: Cai Huoqing Date: Wed Feb 9 11:22:51 2022 +0800 Drivers: hv: utils: Make use of the helper macro LIST_HEAD() Replace "struct list_head head = LIST_HEAD_INIT(head)" with "LIST_HEAD(head)" to simplify the code. Signed-off-by: Cai Huoqing Link: https://lore.kernel.org/r/20220209032251.37362-1-cai.huoqing@linux.dev Signed-off-by: Wei Liu commit c306d737691ef84305d4ed0d302c63db2932f0bb Author: Chuck Lever Date: Tue Jan 25 15:57:45 2022 -0500 NFSD: Deprecate NFS_OFFSET_MAX NFS_OFFSET_MAX was introduced way back in Linux v2.3.y before there was a kernel-wide OFFSET_MAX value. As a clean up, replace the last few uses of it with its generic equivalent, and get rid of it. Signed-off-by: Chuck Lever commit 6a4d333d540041d244b2fca29b8417bfde20af81 Author: Chuck Lever Date: Fri Feb 4 17:05:24 2022 -0500 NFSD: Fix offset type in I/O trace points NFSv3 and NFSv4 use u64 offset values on the wire. Record these values verbatim without the implicit type case to loff_t. Signed-off-by: Chuck Lever commit 3f965021c8bc38965ecb1924f570c4842b33d408 Author: Chuck Lever Date: Mon Jan 24 15:50:31 2022 -0500 NFSD: COMMIT operations must not return NFS?ERR_INVAL Since, well, forever, the Linux NFS server's nfsd_commit() function has returned nfserr_inval when the passed-in byte range arguments were non-sensical. However, according to RFC 1813 section 3.3.21, NFSv3 COMMIT requests are permitted to return only the following non-zero status codes: NFS3ERR_IO NFS3ERR_STALE NFS3ERR_BADHANDLE NFS3ERR_SERVERFAULT NFS3ERR_INVAL is not included in that list. Likewise, NFS4ERR_INVAL is not listed in the COMMIT row of Table 6 in RFC 8881. RFC 7530 does permit COMMIT to return NFS4ERR_INVAL, but does not specify when it can or should be used. Instead of dropping or failing a COMMIT request in a byte range that is not supported, turn it into a valid request by treating one or both arguments as zero. Offset zero means start-of-file, count zero means until-end-of-file, so we only ever extend the commit range. NFS servers are always allowed to commit more and sooner than requested. The range check is no longer bounded by NFS_OFFSET_MAX, but rather by the value that is returned in the maxfilesize field of the NFSv3 FSINFO procedure or the NFSv4 maxfilesize file attribute. Note that this change results in a new pynfs failure: CMT4 st_commit.testCommitOverflow : RUNNING CMT4 st_commit.testCommitOverflow : FAILURE COMMIT with offset + count overflow should return NFS4ERR_INVAL, instead got NFS4_OK IMO the test is not correct as written: RFC 8881 does not allow the COMMIT operation to return NFS4ERR_INVAL. Reported-by: Dan Aloni Cc: stable@vger.kernel.org Signed-off-by: Chuck Lever Reviewed-by: Bruce Fields commit 6260d9a56ab352b54891ec66ab0eced57d55abc6 Author: Chuck Lever Date: Tue Jan 25 16:36:22 2022 -0500 NFSD: Clamp WRITE offsets Ensure that a client cannot specify a WRITE range that falls in a byte range outside what the kernel's internal types (such as loff_t, which is signed) can represent. The kiocb iterators, invoked in nfsd_vfs_write(), should properly limit write operations to within the underlying file system's s_maxbytes. Cc: stable@vger.kernel.org Signed-off-by: Chuck Lever commit a648fdeb7c0e17177a2280344d015dba3fbe3314 Author: Chuck Lever Date: Tue Jan 25 15:59:57 2022 -0500 NFSD: Fix NFSv3 SETATTR/CREATE's handling of large file sizes iattr::ia_size is a loff_t, so these NFSv3 procedures must be careful to deal with incoming client size values that are larger than s64_max without corrupting the value. Silently capping the value results in storing a different value than the client passed in which is unexpected behavior, so remove the min_t() check in decode_sattr3(). Note that RFC 1813 permits only the WRITE procedure to return NFS3ERR_FBIG. We believe that NFSv3 reference implementations also return NFS3ERR_FBIG when ia_size is too large. Cc: stable@vger.kernel.org Signed-off-by: Chuck Lever commit e6faac3f58c7c4176b66f63def17a34232a17b0e Author: Chuck Lever Date: Mon Jan 31 13:01:53 2022 -0500 NFSD: Fix ia_size underflow iattr::ia_size is a loff_t, which is a signed 64-bit type. NFSv3 and NFSv4 both define file size as an unsigned 64-bit type. Thus there is a range of valid file size values an NFS client can send that is already larger than Linux can handle. Currently decode_fattr4() dumps a full u64 value into ia_size. If that value happens to be larger than S64_MAX, then ia_size underflows. I'm about to fix up the NFSv3 behavior as well, so let's catch the underflow in the common code path: nfsd_setattr(). Cc: stable@vger.kernel.org Signed-off-by: Chuck Lever commit 0cb4d23ae08c48f6bf3c29a8e5c4a74b8388b960 Author: Chuck Lever Date: Fri Feb 4 15:19:34 2022 -0500 NFSD: Fix the behavior of READ near OFFSET_MAX Dan Aloni reports: > Due to commit 8cfb9015280d ("NFS: Always provide aligned buffers to > the RPC read layers") on the client, a read of 0xfff is aligned up > to server rsize of 0x1000. > > As a result, in a test where the server has a file of size > 0x7fffffffffffffff, and the client tries to read from the offset > 0x7ffffffffffff000, the read causes loff_t overflow in the server > and it returns an NFS code of EINVAL to the client. The client as > a result indefinitely retries the request. The Linux NFS client does not handle NFS?ERR_INVAL, even though all NFS specifications permit servers to return that status code for a READ. Instead of NFS?ERR_INVAL, have out-of-range READ requests succeed and return a short result. Set the EOF flag in the result to prevent the client from retrying the READ request. This behavior appears to be consistent with Solaris NFS servers. Note that NFSv3 and NFSv4 use u64 offset values on the wire. These must be converted to loff_t internally before use -- an implicit type cast is not adequate for this purpose. Otherwise VFS checks against sb->s_maxbytes do not work properly. Reported-by: Dan Aloni Cc: stable@vger.kernel.org Signed-off-by: Chuck Lever commit 63573807b27e0faf8065a28b1bbe1cbfb23c0130 Author: Sagi Grimberg Date: Mon Feb 7 00:40:13 2022 +0200 nvme-tcp: fix bogus request completion when failing to send AER AER is not backed by a real request, hence we should not incorrectly assume that when failing to send a nvme command, it is a normal request but rather check if this is an aer and if so complete the aer (similar to the normal completion path). Cc: stable@vger.kernel.org Signed-off-by: Sagi Grimberg Reviewed-by: Hannes Reinecke Signed-off-by: Christoph Hellwig commit 00e757b648c0935d703a9b8042312f4a76ee793b Author: Bean Huo Date: Tue Feb 8 00:28:06 2022 +0100 nvme: add nvme_complete_req tracepoint for batched completion Add NVMe request completion trace in nvme_complete_batch_req() because nvme:nvme_complete_req tracepoint is missing in case of request batched completion. Signed-off-by: Bean Huo Signed-off-by: Christoph Hellwig commit 3bed06e36994661a75bae6a289926e566b9b3c1a Merge: feef318c855a3 d6ff94afd90b0 Author: David S. Miller Date: Wed Feb 9 13:33:39 2022 +0000 Merge branch 'vlan-QinQ-leak-fix' Xin Long says: ==================== vlan: fix a netdev refcnt leak for QinQ This issue can be simply reproduced by: # ip link add dummy0 type dummy # ip link add link dummy0 name dummy0.1 type vlan id 1 # ip link add link dummy0.1 name dummy0.1.2 type vlan id 2 # rmmod 8021q unregister_netdevice: waiting for dummy0.1 to become free. Usage count = 1 So as to fix it, adjust vlan_dev_uninit() in Patch 1/1 so that it won't be called twice for the same device, then do the fix in vlan_dev_uninit() in Patch 2/2. ==================== Signed-off-by: David S. Miller commit d6ff94afd90b0ce8d1715f8ef77d4347d7a7f2c0 Author: Xin Long Date: Wed Feb 9 03:19:56 2022 -0500 vlan: move dev_put into vlan_dev_uninit Shuang Li reported an QinQ issue by simply doing: # ip link add dummy0 type dummy # ip link add link dummy0 name dummy0.1 type vlan id 1 # ip link add link dummy0.1 name dummy0.1.2 type vlan id 2 # rmmod 8021q unregister_netdevice: waiting for dummy0.1 to become free. Usage count = 1 When rmmods 8021q, all vlan devs are deleted from their real_dev's vlan grp and added into list_kill by unregister_vlan_dev(). dummy0.1 is unregistered before dummy0.1.2, as it's using for_each_netdev() in __rtnl_kill_links(). When unregisters dummy0.1, dummy0.1.2 is not unregistered in the event of NETDEV_UNREGISTER, as it's been deleted from dummy0.1's vlan grp. However, due to dummy0.1.2 still holding dummy0.1, dummy0.1 will keep waiting in netdev_wait_allrefs(), while dummy0.1.2 will never get unregistered and release dummy0.1, as it delays dev_put until calling dev->priv_destructor, vlan_dev_free(). This issue was introduced by Commit 563bcbae3ba2 ("net: vlan: fix a UAF in vlan_dev_real_dev()"), and this patch is to fix it by moving dev_put() into vlan_dev_uninit(), which is called after NETDEV_UNREGISTER event but before netdev_wait_allrefs(). Fixes: 563bcbae3ba2 ("net: vlan: fix a UAF in vlan_dev_real_dev()") Reported-by: Shuang Li Signed-off-by: Xin Long Signed-off-by: David S. Miller commit 37aa50c539bcbcc01767e515bd170787fcfc0f33 Author: Xin Long Date: Wed Feb 9 03:19:55 2022 -0500 vlan: introduce vlan_dev_free_egress_priority This patch is to introduce vlan_dev_free_egress_priority() to free egress priority for vlan dev, and keep vlan_dev_uninit() static as .ndo_uninit. It makes the code more clear and safer when adding new code in vlan_dev_uninit() in the future. Signed-off-by: Xin Long Signed-off-by: David S. Miller commit feef318c855a361a1eccd880f33e88c460eb63b4 Author: Duoming Zhou Date: Wed Feb 9 20:53:45 2022 +0800 ax25: fix UAF bugs of net_device caused by rebinding operation The ax25_kill_by_device() will set s->ax25_dev = NULL and call ax25_disconnect() to change states of ax25_cb and sock, if we call ax25_bind() before ax25_kill_by_device(). However, if we call ax25_bind() again between the window of ax25_kill_by_device() and ax25_dev_device_down(), the values and states changed by ax25_kill_by_device() will be reassigned. Finally, ax25_dev_device_down() will deallocate net_device. If we dereference net_device in syscall functions such as ax25_release(), ax25_sendmsg(), ax25_getsockopt(), ax25_getname() and ax25_info_show(), a UAF bug will occur. One of the possible race conditions is shown below: (USE) | (FREE) ax25_bind() | | ax25_kill_by_device() ax25_bind() | ax25_connect() | ... | ax25_dev_device_down() | ... | dev_put_track(dev, ...) //FREE ax25_release() | ... ax25_send_control() | alloc_skb() //USE | the corresponding fail log is shown below: =============================================================== BUG: KASAN: use-after-free in ax25_send_control+0x43/0x210 ... Call Trace: ... ax25_send_control+0x43/0x210 ax25_release+0x2db/0x3b0 __sock_release+0x6d/0x120 sock_close+0xf/0x20 __fput+0x11f/0x420 ... Allocated by task 1283: ... __kasan_kmalloc+0x81/0xa0 alloc_netdev_mqs+0x5a/0x680 mkiss_open+0x6c/0x380 tty_ldisc_open+0x55/0x90 ... Freed by task 1969: ... kfree+0xa3/0x2c0 device_release+0x54/0xe0 kobject_put+0xa5/0x120 tty_ldisc_kill+0x3e/0x80 ... In order to fix these UAF bugs caused by rebinding operation, this patch adds dev_hold_track() into ax25_bind() and corresponding dev_put_track() into ax25_kill_by_device(). Signed-off-by: Duoming Zhou Signed-off-by: David S. Miller commit ee534378f00561207656663d93907583958339ae Author: Vladimir Oltean Date: Wed Feb 9 14:04:33 2022 +0200 net: dsa: fix panic when DSA master device unbinds on shutdown Rafael reports that on a system with LX2160A and Marvell DSA switches, if a reboot occurs while the DSA master (dpaa2-eth) is up, the following panic can be seen: systemd-shutdown[1]: Rebooting. Unable to handle kernel paging request at virtual address 00a0000800000041 [00a0000800000041] address between user and kernel address ranges Internal error: Oops: 96000004 [#1] PREEMPT SMP CPU: 6 PID: 1 Comm: systemd-shutdow Not tainted 5.16.5-00042-g8f5585009b24 #32 pc : dsa_slave_netdevice_event+0x130/0x3e4 lr : raw_notifier_call_chain+0x50/0x6c Call trace: dsa_slave_netdevice_event+0x130/0x3e4 raw_notifier_call_chain+0x50/0x6c call_netdevice_notifiers_info+0x54/0xa0 __dev_close_many+0x50/0x130 dev_close_many+0x84/0x120 unregister_netdevice_many+0x130/0x710 unregister_netdevice_queue+0x8c/0xd0 unregister_netdev+0x20/0x30 dpaa2_eth_remove+0x68/0x190 fsl_mc_driver_remove+0x20/0x5c __device_release_driver+0x21c/0x220 device_release_driver_internal+0xac/0xb0 device_links_unbind_consumers+0xd4/0x100 __device_release_driver+0x94/0x220 device_release_driver+0x28/0x40 bus_remove_device+0x118/0x124 device_del+0x174/0x420 fsl_mc_device_remove+0x24/0x40 __fsl_mc_device_remove+0xc/0x20 device_for_each_child+0x58/0xa0 dprc_remove+0x90/0xb0 fsl_mc_driver_remove+0x20/0x5c __device_release_driver+0x21c/0x220 device_release_driver+0x28/0x40 bus_remove_device+0x118/0x124 device_del+0x174/0x420 fsl_mc_bus_remove+0x80/0x100 fsl_mc_bus_shutdown+0xc/0x1c platform_shutdown+0x20/0x30 device_shutdown+0x154/0x330 __do_sys_reboot+0x1cc/0x250 __arm64_sys_reboot+0x20/0x30 invoke_syscall.constprop.0+0x4c/0xe0 do_el0_svc+0x4c/0x150 el0_svc+0x24/0xb0 el0t_64_sync_handler+0xa8/0xb0 el0t_64_sync+0x178/0x17c It can be seen from the stack trace that the problem is that the deregistration of the master causes a dev_close(), which gets notified as NETDEV_GOING_DOWN to dsa_slave_netdevice_event(). But dsa_switch_shutdown() has already run, and this has unregistered the DSA slave interfaces, and yet, the NETDEV_GOING_DOWN handler attempts to call dev_close_many() on those slave interfaces, leading to the problem. The previous attempt to avoid the NETDEV_GOING_DOWN on the master after dsa_switch_shutdown() was called seems improper. Unregistering the slave interfaces is unnecessary and unhelpful. Instead, after the slaves have stopped being uppers of the DSA master, we can now reset to NULL the master->dsa_ptr pointer, which will make DSA start ignoring all future notifier events on the master. Fixes: 0650bf52b31f ("net: dsa: be compatible with masters which unregister on shutdown") Reported-by: Rafael Richter Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit d9565bf40da22426d2f660cb31700b6858d1911d Author: H. Nikolaus Schaller Date: Wed Feb 2 17:31:22 2022 +0100 MIPS: DTS: CI20: fix how ddc power is enabled Originally we proposed a new hdmi-5v-supply regulator reference for CI20 device tree but that was superseded by a better idea to use the already defined "ddc-en-gpios" property of the "hdmi-connector". Since "MIPS: DTS: CI20: Add DT nodes for HDMI setup" has already been applied to v5.17-rc1, we add this on top. Fixes: ae1b8d2c2de9 ("MIPS: DTS: CI20: Add DT nodes for HDMI setup") Signed-off-by: H. Nikolaus Schaller Reviewed-by: Paul Cercueil Signed-off-by: Thomas Bogendoerfer commit 68c2d6af1f1e469544d6cbe9a601d96fb9c00e7f Author: Raju Rangoju Date: Wed Feb 9 10:02:01 2022 +0530 net: amd-xgbe: disable interrupts during pci removal Hardware interrupts are enabled during the pci probe, however, they are not disabled during pci removal. Disable all hardware interrupts during pci removal to avoid any issues. Fixes: e75377404726 ("amd-xgbe: Update PCI support to use new IRQ functions") Suggested-by: Selwin Sebastian Signed-off-by: Raju Rangoju Signed-off-by: David S. Miller commit c7223d687758462826a20e9735305d55bb874c70 Author: Jon Maloy Date: Tue Feb 8 22:22:37 2022 -0500 tipc: rate limit warning for received illegal binding update It would be easy to craft a message containing an illegal binding table update operation. This is handled correctly by the code, but the corresponding warning printout is not rate limited as is should be. We fix this now. Fixes: b97bf3fd8f6a ("[TIPC] Initial merge") Signed-off-by: Jon Maloy Signed-off-by: David S. Miller commit bc1c3c3b10db4f37c41e6107751a8d450d9c431c Author: Joel Stanley Date: Wed Feb 9 10:33:59 2022 +1030 net: mdio: aspeed: Add missing MODULE_DEVICE_TABLE Fix loading of the driver when built as a module. Fixes: f160e99462c6 ("net: phy: Add mdio-aspeed") Signed-off-by: Joel Stanley Reviewed-by: Andrew Lunn Acked-by: Andrew Jeffery Signed-off-by: David S. Miller commit 68468d8c4cd4222a4ca1f185ab5a1c14480d078c Author: Eric Dumazet Date: Tue Feb 8 15:28:22 2022 -0800 veth: fix races around rq->rx_notify_masked veth being NETIF_F_LLTX enabled, we need to be more careful whenever we read/write rq->rx_notify_masked. BUG: KCSAN: data-race in veth_xmit / veth_xmit write to 0xffff888133d9a9f8 of 1 bytes by task 23552 on cpu 0: __veth_xdp_flush drivers/net/veth.c:269 [inline] veth_xmit+0x307/0x470 drivers/net/veth.c:350 __netdev_start_xmit include/linux/netdevice.h:4683 [inline] netdev_start_xmit include/linux/netdevice.h:4697 [inline] xmit_one+0x105/0x2f0 net/core/dev.c:3473 dev_hard_start_xmit net/core/dev.c:3489 [inline] __dev_queue_xmit+0x86d/0xf90 net/core/dev.c:4116 dev_queue_xmit+0x13/0x20 net/core/dev.c:4149 br_dev_queue_push_xmit+0x3ce/0x430 net/bridge/br_forward.c:53 NF_HOOK include/linux/netfilter.h:307 [inline] br_forward_finish net/bridge/br_forward.c:66 [inline] NF_HOOK include/linux/netfilter.h:307 [inline] __br_forward+0x2e4/0x400 net/bridge/br_forward.c:115 br_flood+0x521/0x5c0 net/bridge/br_forward.c:242 br_dev_xmit+0x8b6/0x960 __netdev_start_xmit include/linux/netdevice.h:4683 [inline] netdev_start_xmit include/linux/netdevice.h:4697 [inline] xmit_one+0x105/0x2f0 net/core/dev.c:3473 dev_hard_start_xmit net/core/dev.c:3489 [inline] __dev_queue_xmit+0x86d/0xf90 net/core/dev.c:4116 dev_queue_xmit+0x13/0x20 net/core/dev.c:4149 neigh_hh_output include/net/neighbour.h:525 [inline] neigh_output include/net/neighbour.h:539 [inline] ip_finish_output2+0x6f8/0xb70 net/ipv4/ip_output.c:228 ip_finish_output+0xfb/0x240 net/ipv4/ip_output.c:316 NF_HOOK_COND include/linux/netfilter.h:296 [inline] ip_output+0xf3/0x1a0 net/ipv4/ip_output.c:430 dst_output include/net/dst.h:451 [inline] ip_local_out net/ipv4/ip_output.c:126 [inline] ip_send_skb+0x6e/0xe0 net/ipv4/ip_output.c:1570 udp_send_skb+0x641/0x880 net/ipv4/udp.c:967 udp_sendmsg+0x12ea/0x14c0 net/ipv4/udp.c:1254 inet_sendmsg+0x5f/0x80 net/ipv4/af_inet.c:819 sock_sendmsg_nosec net/socket.c:705 [inline] sock_sendmsg net/socket.c:725 [inline] ____sys_sendmsg+0x39a/0x510 net/socket.c:2413 ___sys_sendmsg net/socket.c:2467 [inline] __sys_sendmmsg+0x267/0x4c0 net/socket.c:2553 __do_sys_sendmmsg net/socket.c:2582 [inline] __se_sys_sendmmsg net/socket.c:2579 [inline] __x64_sys_sendmmsg+0x53/0x60 net/socket.c:2579 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae read to 0xffff888133d9a9f8 of 1 bytes by task 23563 on cpu 1: __veth_xdp_flush drivers/net/veth.c:268 [inline] veth_xmit+0x2d6/0x470 drivers/net/veth.c:350 __netdev_start_xmit include/linux/netdevice.h:4683 [inline] netdev_start_xmit include/linux/netdevice.h:4697 [inline] xmit_one+0x105/0x2f0 net/core/dev.c:3473 dev_hard_start_xmit net/core/dev.c:3489 [inline] __dev_queue_xmit+0x86d/0xf90 net/core/dev.c:4116 dev_queue_xmit+0x13/0x20 net/core/dev.c:4149 br_dev_queue_push_xmit+0x3ce/0x430 net/bridge/br_forward.c:53 NF_HOOK include/linux/netfilter.h:307 [inline] br_forward_finish net/bridge/br_forward.c:66 [inline] NF_HOOK include/linux/netfilter.h:307 [inline] __br_forward+0x2e4/0x400 net/bridge/br_forward.c:115 br_flood+0x521/0x5c0 net/bridge/br_forward.c:242 br_dev_xmit+0x8b6/0x960 __netdev_start_xmit include/linux/netdevice.h:4683 [inline] netdev_start_xmit include/linux/netdevice.h:4697 [inline] xmit_one+0x105/0x2f0 net/core/dev.c:3473 dev_hard_start_xmit net/core/dev.c:3489 [inline] __dev_queue_xmit+0x86d/0xf90 net/core/dev.c:4116 dev_queue_xmit+0x13/0x20 net/core/dev.c:4149 neigh_hh_output include/net/neighbour.h:525 [inline] neigh_output include/net/neighbour.h:539 [inline] ip_finish_output2+0x6f8/0xb70 net/ipv4/ip_output.c:228 ip_finish_output+0xfb/0x240 net/ipv4/ip_output.c:316 NF_HOOK_COND include/linux/netfilter.h:296 [inline] ip_output+0xf3/0x1a0 net/ipv4/ip_output.c:430 dst_output include/net/dst.h:451 [inline] ip_local_out net/ipv4/ip_output.c:126 [inline] ip_send_skb+0x6e/0xe0 net/ipv4/ip_output.c:1570 udp_send_skb+0x641/0x880 net/ipv4/udp.c:967 udp_sendmsg+0x12ea/0x14c0 net/ipv4/udp.c:1254 inet_sendmsg+0x5f/0x80 net/ipv4/af_inet.c:819 sock_sendmsg_nosec net/socket.c:705 [inline] sock_sendmsg net/socket.c:725 [inline] ____sys_sendmsg+0x39a/0x510 net/socket.c:2413 ___sys_sendmsg net/socket.c:2467 [inline] __sys_sendmmsg+0x267/0x4c0 net/socket.c:2553 __do_sys_sendmmsg net/socket.c:2582 [inline] __se_sys_sendmmsg net/socket.c:2579 [inline] __x64_sys_sendmmsg+0x53/0x60 net/socket.c:2579 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 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: 23563 Comm: syz-executor.5 Not tainted 5.17.0-rc2-syzkaller-00064-gc36c04c2e132 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Fixes: 948d4f214fde ("veth: Add driver XDP") Signed-off-by: Eric Dumazet Cc: Toshiaki Makita Reported-by: syzbot Signed-off-by: David S. Miller commit 6d072066aba72243253a29acb2a58244355ece40 Merge: 7ec02f5ac8a5b 8375dfac4f683 Author: David S. Miller Date: Wed Feb 9 12:02:28 2022 +0000 Merge tag 'linux-can-fixes-for-5.17-20220209' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can Marc Kleine-Budde says: ==================== pull-request: can 2022-02-09 this is a pull request of 2 patches for net/master. Oliver Hartkopp contributes 2 fixes for the CAN ISOTP protocol. ==================== Signed-off-by: David S. Miller commit 7ec02f5ac8a5be5a3f20611731243dc5e1d9ba10 Author: Duoming Zhou Date: Tue Feb 8 23:40:00 2022 +0800 ax25: fix NPD bug in ax25_disconnect The ax25_disconnect() in ax25_kill_by_device() is not protected by any locks, thus there is a race condition between ax25_disconnect() and ax25_destroy_socket(). when ax25->sk is assigned as NULL by ax25_destroy_socket(), a NULL pointer dereference bug will occur if site (1) or (2) dereferences ax25->sk. ax25_kill_by_device() | ax25_release() ax25_disconnect() | ax25_destroy_socket() ... | if(ax25->sk != NULL) | ... ... | ax25->sk = NULL; bh_lock_sock(ax25->sk); //(1) | ... ... | bh_unlock_sock(ax25->sk); //(2)| This patch moves ax25_disconnect() into lock_sock(), which can synchronize with ax25_destroy_socket() in ax25_release(). Fail log: =============================================================== BUG: kernel NULL pointer dereference, address: 0000000000000088 ... RIP: 0010:_raw_spin_lock+0x7e/0xd0 ... Call Trace: ax25_disconnect+0xf6/0x220 ax25_device_event+0x187/0x250 raw_notifier_call_chain+0x5e/0x70 dev_close_many+0x17d/0x230 rollback_registered_many+0x1f1/0x950 unregister_netdevice_queue+0x133/0x200 unregister_netdev+0x13/0x20 ... Signed-off-by: Duoming Zhou Signed-off-by: David S. Miller commit 676b49366a70ea91997585ba8e4577290f5172a5 Merge: 7db788ad627aa 9eeabdf17fa0a Author: David S. Miller Date: Wed Feb 9 11:41:48 2022 +0000 Merge branch 'net-fix-skb-unclone-issues' Antoine Tenart says: ==================== net: fix issues when uncloning an skb dst+metadata This fixes two issues when uncloning an skb dst+metadata in tun_dst_unclone; this was initially reported by Vlad Buslov[1]. Because of the memory leak fixed by patch 2, the issue in patch 1 never happened in practice. tun_dst_unclone is called from two different places, one in geneve/vxlan to handle PMTU and one in net/openvswitch/actions.c where it is used to retrieve tunnel information. While both Vlad and I tested the former, we could not for the latter. I did spend quite some time trying to, but that code path is not easy to trigger. Code inspection shows this should be fine, the tunnel information (dst+metadata) is uncloned and the skb it is referenced from is only consumed after all accesses to the tunnel information are done: do_execute_actions output_userspace dev_fill_metadata_dst <- dst+metadata is uncloned ovs_dp_upcall queue_userspace_packet ovs_nla_put_tunnel_info <- metadata (tunnel info) is accessed consume_skb <- dst+metadata is freed Thanks! Antoine [1] https://lore.kernel.org/all/ygnhh79yluw2.fsf@nvidia.com/T/#m2f814614a4f5424cea66bbff7297f692b59b69a0 ==================== Signed-off-by: David S. Miller commit 9eeabdf17fa0ab75381045c867c370f4cc75a613 Author: Antoine Tenart Date: Mon Feb 7 18:13:19 2022 +0100 net: fix a memleak when uncloning an skb dst and its metadata When uncloning an skb dst and its associated metadata, a new dst+metadata is allocated and later replaces the old one in the skb. This is helpful to have a non-shared dst+metadata attached to a specific skb. The issue is the uncloned dst+metadata is initialized with a refcount of 1, which is increased to 2 before attaching it to the skb. When tun_dst_unclone returns, the dst+metadata is only referenced from a single place (the skb) while its refcount is 2. Its refcount will never drop to 0 (when the skb is consumed), leading to a memory leak. Fix this by removing the call to dst_hold in tun_dst_unclone, as the dst+metadata refcount is already 1. Fixes: fc4099f17240 ("openvswitch: Fix egress tunnel info.") Cc: Pravin B Shelar Reported-by: Vlad Buslov Tested-by: Vlad Buslov Signed-off-by: Antoine Tenart Signed-off-by: David S. Miller commit cfc56f85e72f5b9c5c5be26dc2b16518d36a7868 Author: Antoine Tenart Date: Mon Feb 7 18:13:18 2022 +0100 net: do not keep the dst cache when uncloning an skb dst and its metadata When uncloning an skb dst and its associated metadata a new dst+metadata is allocated and the tunnel information from the old metadata is copied over there. The issue is the tunnel metadata has references to cached dst, which are copied along the way. When a dst+metadata refcount drops to 0 the metadata is freed including the cached dst entries. As they are also referenced in the initial dst+metadata, this ends up in UaFs. In practice the above did not happen because of another issue, the dst+metadata was never freed because its refcount never dropped to 0 (this will be fixed in a subsequent patch). Fix this by initializing the dst cache after copying the tunnel information from the old metadata to also unshare the dst cache. Fixes: d71785ffc7e7 ("net: add dst_cache to ovs vxlan lwtunnel") Cc: Paolo Abeni Reported-by: Vlad Buslov Tested-by: Vlad Buslov Signed-off-by: Antoine Tenart Acked-by: Paolo Abeni Signed-off-by: David S. Miller commit c162ca0bcbfb39308c4dff4157e27c751af7032a Author: Bartosz Golaszewski Date: Tue Feb 8 11:37:56 2022 +0100 gpio: sim: fix hogs with custom chip labels We always assign the default device name as the chip_label in hog structures which makes it impossible to assign hogs to chips. Let's first check if a custom label was set and then copy it instead of the default device name. Fixes: cb8c474e79be ("gpio: sim: new testing module") Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko commit 26077968f8389a68fdb38af3f2c2289ddc95e8ca Author: Nicolas Ferre Date: Sun Jan 30 15:39:36 2022 +0100 dt-bindings: ARM: at91: update maintainers entry Align the binding documentation with the newly updated MAINTAINERS entry. Signed-off-by: Nicolas Ferre Acked-by: Claudiu Beznea Acked-by: Ludovic Desroches Link: https://lore.kernel.org/r/5bf9873eeee3cd49c52a8952a7cd4cb60b61d50a.1643553501.git.nicolas.ferre@microchip.com commit 6620e311ae76c502b685247b8f7232e81a321a5b Author: Nicolas Ferre Date: Sun Jan 30 15:39:35 2022 +0100 MAINTAINERS: replace a Microchip AT91 maintainer As Ludovic is more focusing on other aspects of the Microchip Linux-based development, replace him with Claudiu. Entry is added to the CREDITS file. Thanks Ludovic for these great contributions in the kernel space! Signed-off-by: Nicolas Ferre Acked-by: Claudiu Beznea Acked-by: Ludovic Desroches Link: https://lore.kernel.org/r/23819d8baa635815d0893955197561fe4f044d5e.1643553501.git.nicolas.ferre@microchip.com commit 2e71ec1a725a794a16e3862791ed43fe5ba6a06b Author: Hangbin Liu Date: Wed Feb 9 16:25:51 2022 +0800 selftests: netfilter: fix exit value for nft_concat_range When the nft_concat_range test failed, it exit 1 in the code specifically. But when part of, or all of the test passed, it will failed the [ ${passed} -eq 0 ] check and thus exit with 1, which is the same exit value with failure result. Fix it by exit 0 when passed is not 0. Fixes: 611973c1e06f ("selftests: netfilter: Introduce tests for sets with range concatenation") Signed-off-by: Hangbin Liu Reviewed-by: Stefano Brivio Signed-off-by: Pablo Neira Ayuso commit 75063c9294fb239bbe64eb72141b6871fe526d29 Author: Eric Dumazet Date: Tue Feb 8 18:30:43 2022 -0800 netfilter: xt_socket: fix a typo in socket_mt_destroy() Calling nf_defrag_ipv4_disable() instead of nf_defrag_ipv6_disable() was probably not the intent. I found this by code inspection, while chasing a possible issue in TPROXY. Fixes: de8c12110a13 ("netfilter: disable defrag once its no longer needed") Signed-off-by: Eric Dumazet Reviewed-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 7152303cbec4f7c2c4db1fb646b549ffd4069b7c Author: Florian Westphal Date: Fri Feb 4 14:02:33 2022 +0100 selftests: netfilter: add synproxy test Simple test for synproxy feature, iperf3 should be intercepted by synproxy netns, but connection should still succeed. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 7c76ecd9c99b6e9a771d813ab1aa7fa428b3ade1 Author: Leon Romanovsky Date: Tue Feb 8 16:14:32 2022 +0200 xfrm: enforce validity of offload input flags struct xfrm_user_offload has flags variable that received user input, but kernel didn't check if valid bits were provided. It caused a situation where not sanitized input was forwarded directly to the drivers. For example, XFRM_OFFLOAD_IPV6 define that was exposed, was used by strongswan, but not implemented in the kernel at all. As a solution, check and sanitize input flags to forward XFRM_OFFLOAD_INBOUND to the drivers. Fixes: d77e38e612a0 ("xfrm: Add an IPsec hardware offloading API") Signed-off-by: Leon Romanovsky Signed-off-by: Steffen Klassert commit ef8ee1cb8fc8976a68f5e89cd5f7b6f7de80c66f Author: Bjorn Andersson Date: Thu Jan 27 19:25:54 2022 -0800 cpufreq: qcom-hw: Delay enabling throttle_irq In the event that the SoC is under thermal pressure while booting it's possible for the dcvs notification to happen inbetween the cpufreq framework calling init and it actually updating the policy's related_cpus cpumask. Prior to the introduction of the thermal pressure update helper an empty cpumask would simply result in the thermal pressure of no cpus being updated, but the new code will attempt to dereference an invalid per_cpu variable. Avoid this problem by using the newly reintroduced "ready" callback, to postpone enabling the IRQ until the related_cpus cpumask is filled in. Fixes: 0258cb19c77d ("cpufreq: qcom-cpufreq-hw: Use new thermal pressure update function") Signed-off-by: Bjorn Andersson Signed-off-by: Viresh Kumar commit 4f774c4a65bf3987d1a95c966e884f38c8a942af Author: Bjorn Andersson Date: Thu Jan 27 19:25:53 2022 -0800 cpufreq: Reintroduce ready() callback This effectively revert '4bf8e582119e ("cpufreq: Remove ready() callback")', in order to reintroduce the ready callback. This is needed in order to be able to leave the thermal pressure interrupts in the Qualcomm CPUfreq driver disabled during initialization, so that it doesn't fire while related_cpus are still 0. Signed-off-by: Bjorn Andersson [ Viresh: Added the Chinese translation as well and updated commit msg ] Signed-off-by: Viresh Kumar commit 8375dfac4f683e1b2c5956d919d36aeedad46699 Author: Oliver Hartkopp Date: Wed Feb 9 08:36:01 2022 +0100 can: isotp: fix error path in isotp_sendmsg() to unlock wait queue Commit 43a08c3bdac4 ("can: isotp: isotp_sendmsg(): fix TX buffer concurrent access in isotp_sendmsg()") introduced a new locking scheme that may render the userspace application in a locking state when an error is detected. This issue shows up under high load on simultaneously running isotp channels with identical configuration which is against the ISO specification and therefore breaks any reasonable PDU communication anyway. Fixes: 43a08c3bdac4 ("can: isotp: isotp_sendmsg(): fix TX buffer concurrent access in isotp_sendmsg()") Link: https://lore.kernel.org/all/20220209073601.25728-1-socketcan@hartkopp.net Cc: stable@vger.kernel.org Cc: Ziyang Xuan Signed-off-by: Oliver Hartkopp Signed-off-by: Marc Kleine-Budde commit 7c759040c1dd03954f650f147ae7175476d51314 Author: Oliver Hartkopp Date: Tue Feb 8 21:00:26 2022 +0100 can: isotp: fix potential CAN frame reception race in isotp_rcv() When receiving a CAN frame the current code logic does not consider concurrently receiving processes which do not show up in real world usage. Ziyang Xuan writes: The following syz problem is one of the scenarios. so->rx.len is changed by isotp_rcv_ff() during isotp_rcv_cf(), so->rx.len equals 0 before alloc_skb() and equals 4096 after alloc_skb(). That will trigger skb_over_panic() in skb_put(). ======================================================= CPU: 1 PID: 19 Comm: ksoftirqd/1 Not tainted 5.16.0-rc8-syzkaller #0 RIP: 0010:skb_panic+0x16c/0x16e net/core/skbuff.c:113 Call Trace: skb_over_panic net/core/skbuff.c:118 [inline] skb_put.cold+0x24/0x24 net/core/skbuff.c:1990 isotp_rcv_cf net/can/isotp.c:570 [inline] isotp_rcv+0xa38/0x1e30 net/can/isotp.c:668 deliver net/can/af_can.c:574 [inline] can_rcv_filter+0x445/0x8d0 net/can/af_can.c:635 can_receive+0x31d/0x580 net/can/af_can.c:665 can_rcv+0x120/0x1c0 net/can/af_can.c:696 __netif_receive_skb_one_core+0x114/0x180 net/core/dev.c:5465 __netif_receive_skb+0x24/0x1b0 net/core/dev.c:5579 Therefore we make sure the state changes and data structures stay consistent at CAN frame reception time by adding a spin_lock in isotp_rcv(). This fixes the issue reported by syzkaller but does not affect real world operation. Fixes: e057dd3fc20f ("can: add ISO 15765-2:2016 transport protocol") Link: https://lore.kernel.org/linux-can/d7e69278-d741-c706-65e1-e87623d9a8e8@huawei.com/T/ Link: https://lore.kernel.org/all/20220208200026.13783-1-socketcan@hartkopp.net Cc: stable@vger.kernel.org Reported-by: syzbot+4c63f36709a642f801c5@syzkaller.appspotmail.com Reported-by: Ziyang Xuan Signed-off-by: Oliver Hartkopp Signed-off-by: Marc Kleine-Budde commit 7db788ad627aabff2b74d4f1a3b68516d0fee0d7 Author: Louis Peens Date: Tue Feb 8 11:14:53 2022 +0100 nfp: flower: fix ida_idx not being released When looking for a global mac index the extra NFP_TUN_PRE_TUN_IDX_BIT that gets set if nfp_flower_is_supported_bridge is true is not taken into account. Consequently the path that should release the ida_index in cleanup is never triggered, causing messages like: nfp 0000:02:00.0: nfp: Failed to offload MAC on br-ex. nfp 0000:02:00.0: nfp: Failed to offload MAC on br-ex. nfp 0000:02:00.0: nfp: Failed to offload MAC on br-ex. after NFP_MAX_MAC_INDEX number of reconfigs. Ultimately this lead to new tunnel flows not being offloaded. Fix this by unsetting the NFP_TUN_PRE_TUN_IDX_BIT before checking if the port is of type OTHER. Fixes: 2e0bc7f3cb55 ("nfp: flower: encode mac indexes with pre-tunnel rule check") Signed-off-by: Louis Peens Signed-off-by: Simon Horman Link: https://lore.kernel.org/r/20220208101453.321949-1-simon.horman@corigine.com Signed-off-by: Jakub Kicinski commit 5611a00697c8ecc5aad04392bea629e9d6a20463 Author: Eric Dumazet Date: Mon Feb 7 21:34:51 2022 -0800 ipmr,ip6mr: acquire RTNL before calling ip[6]mr_free_table() on failure path ip[6]mr_free_table() can only be called under RTNL lock. RTNL: assertion failed at net/core/dev.c (10367) WARNING: CPU: 1 PID: 5890 at net/core/dev.c:10367 unregister_netdevice_many+0x1246/0x1850 net/core/dev.c:10367 Modules linked in: CPU: 1 PID: 5890 Comm: syz-executor.2 Not tainted 5.16.0-syzkaller-11627-g422ee58dc0ef #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:unregister_netdevice_many+0x1246/0x1850 net/core/dev.c:10367 Code: 0f 85 9b ee ff ff e8 69 07 4b fa ba 7f 28 00 00 48 c7 c6 00 90 ae 8a 48 c7 c7 40 90 ae 8a c6 05 6d b1 51 06 01 e8 8c 90 d8 01 <0f> 0b e9 70 ee ff ff e8 3e 07 4b fa 4c 89 e7 e8 86 2a 59 fa e9 ee RSP: 0018:ffffc900046ff6e0 EFLAGS: 00010286 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 RDX: ffff888050f51d00 RSI: ffffffff815fa008 RDI: fffff520008dfece RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: ffffffff815f3d6e R11: 0000000000000000 R12: 00000000fffffff4 R13: dffffc0000000000 R14: ffffc900046ff750 R15: ffff88807b7dc000 FS: 00007f4ab736e700(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fee0b4f8990 CR3: 000000001e7d2000 CR4: 00000000003506e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: mroute_clean_tables+0x244/0xb40 net/ipv6/ip6mr.c:1509 ip6mr_free_table net/ipv6/ip6mr.c:389 [inline] ip6mr_rules_init net/ipv6/ip6mr.c:246 [inline] ip6mr_net_init net/ipv6/ip6mr.c:1306 [inline] ip6mr_net_init+0x3f0/0x4e0 net/ipv6/ip6mr.c:1298 ops_init+0xaf/0x470 net/core/net_namespace.c:140 setup_net+0x54f/0xbb0 net/core/net_namespace.c:331 copy_net_ns+0x318/0x760 net/core/net_namespace.c:475 create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110 copy_namespaces+0x391/0x450 kernel/nsproxy.c:178 copy_process+0x2e0c/0x7300 kernel/fork.c:2167 kernel_clone+0xe7/0xab0 kernel/fork.c:2555 __do_sys_clone+0xc8/0x110 kernel/fork.c:2672 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:0x7f4ab89f9059 Code: Unable to access opcode bytes at RIP 0x7f4ab89f902f. RSP: 002b:00007f4ab736e118 EFLAGS: 00000206 ORIG_RAX: 0000000000000038 RAX: ffffffffffffffda RBX: 00007f4ab8b0bf60 RCX: 00007f4ab89f9059 RDX: 0000000020000280 RSI: 0000000020000270 RDI: 0000000040200000 RBP: 00007f4ab8a5308d R08: 0000000020000300 R09: 0000000020000300 R10: 00000000200002c0 R11: 0000000000000206 R12: 0000000000000000 R13: 00007ffc3977cc1f R14: 00007f4ab736e300 R15: 0000000000022000 Fixes: f243e5a7859a ("ipmr,ip6mr: call ip6mr_free_table() on failure path") Signed-off-by: Eric Dumazet Cc: Cong Wang Reported-by: syzbot Link: https://lore.kernel.org/r/20220208053451.2885398-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit 2427f03fb42f9dc14c53108f2c9b5563eb37e770 Author: Cai Huoqing Date: Tue Feb 8 09:33:08 2022 +0800 net: ethernet: litex: Add the dependency on HAS_IOMEM The LiteX driver uses devm io function API which needs HAS_IOMEM enabled, so add the dependency on HAS_IOMEM. Fixes: ee7da21ac4c3 ("net: Add driver for LiteX's LiteETH network interface") Signed-off-by: Cai Huoqing Link: https://lore.kernel.org/r/20220208013308.6563-1-cai.huoqing@linux.dev Signed-off-by: Jakub Kicinski commit 61772b0908c640d0309c40f7d41d062ca4e979fa Author: Sukadev Bhattiprolu Date: Mon Feb 7 16:19:18 2022 -0800 ibmvnic: don't release napi in __ibmvnic_open() If __ibmvnic_open() encounters an error such as when setting link state, it calls release_resources() which frees the napi structures needlessly. Instead, have __ibmvnic_open() only clean up the work it did so far (i.e. disable napi and irqs) and leave the rest to the callers. If caller of __ibmvnic_open() is ibmvnic_open(), it should release the resources immediately. If the caller is do_reset() or do_hard_reset(), they will release the resources on the next reset. This fixes following crash that occurred when running the drmgr command several times to add/remove a vnic interface: [102056] ibmvnic 30000003 env3: Disabling rx_scrq[6] irq [102056] ibmvnic 30000003 env3: Disabling rx_scrq[7] irq [102056] ibmvnic 30000003 env3: Replenished 8 pools Kernel attempted to read user page (10) - exploit attempt? (uid: 0) BUG: Kernel NULL pointer dereference on read at 0x00000010 Faulting instruction address: 0xc000000000a3c840 Oops: Kernel access of bad area, sig: 11 [#1] LE PAGE_SIZE=64K MMU=Radix SMP NR_CPUS=2048 NUMA pSeries ... CPU: 9 PID: 102056 Comm: kworker/9:2 Kdump: loaded Not tainted 5.16.0-rc5-autotest-g6441998e2e37 #1 Workqueue: events_long __ibmvnic_reset [ibmvnic] NIP: c000000000a3c840 LR: c0080000029b5378 CTR: c000000000a3c820 REGS: c0000000548e37e0 TRAP: 0300 Not tainted (5.16.0-rc5-autotest-g6441998e2e37) MSR: 8000000000009033 CR: 28248484 XER: 00000004 CFAR: c0080000029bdd24 DAR: 0000000000000010 DSISR: 40000000 IRQMASK: 0 GPR00: c0080000029b55d0 c0000000548e3a80 c0000000028f0200 0000000000000000 ... NIP [c000000000a3c840] napi_enable+0x20/0xc0 LR [c0080000029b5378] __ibmvnic_open+0xf0/0x430 [ibmvnic] Call Trace: [c0000000548e3a80] [0000000000000006] 0x6 (unreliable) [c0000000548e3ab0] [c0080000029b55d0] __ibmvnic_open+0x348/0x430 [ibmvnic] [c0000000548e3b40] [c0080000029bcc28] __ibmvnic_reset+0x500/0xdf0 [ibmvnic] [c0000000548e3c60] [c000000000176228] process_one_work+0x288/0x570 [c0000000548e3d00] [c000000000176588] worker_thread+0x78/0x660 [c0000000548e3da0] [c0000000001822f0] kthread+0x1c0/0x1d0 [c0000000548e3e10] [c00000000000cf64] ret_from_kernel_thread+0x5c/0x64 Instruction dump: 7d2948f8 792307e0 4e800020 60000000 3c4c01eb 384239e0 f821ffd1 39430010 38a0fff6 e92d1100 f9210028 39200000 f9010020 60420000 e9210020 ---[ end trace 5f8033b08fd27706 ]--- Fixes: ed651a10875f ("ibmvnic: Updated reset handling") Reported-by: Abdul Haleem Signed-off-by: Sukadev Bhattiprolu Reviewed-by: Dany Madden Link: https://lore.kernel.org/r/20220208001918.900602-1-sukadev@linux.ibm.com Signed-off-by: Jakub Kicinski commit 1335648f0b6f9e2f643ae0c1501e995752b5c79e Merge: 23de0d7b6f0e3 0d120dfb5d67e Author: Jakub Kicinski Date: Tue Feb 8 20:30:38 2022 -0800 Merge branch 'more-dsa-fixes-for-devres-mdiobus_-alloc-register' Vladimir Oltean says: ==================== More DSA fixes for devres + mdiobus_{alloc,register} The initial patch series "[net,0/2] Fix mdiobus users with devres" https://patchwork.kernel.org/project/netdevbpf/cover/20210920214209.1733768-1-vladimir.oltean@nxp.com/ fixed some instances where DSA drivers on slow buses (SPI, I2C) trigger a panic (changed since then to a warn) in mdiobus_free. That was due to devres calling mdiobus_free() with no prior mdiobus_unregister(), which again was due to commit ac3a68d56651 ("net: phy: don't abuse devres in devm_mdiobus_register()") by Bartosz Golaszewski. Rafael Richter and Daniel Klauer report yet another variation on that theme, but this time it applies to any DSA switch driver, not just those on buses which have a "->shutdown() calls ->remove() which unregisters children" sequence. Their setup is that of an LX2160A DPAA2 SoC driving a Marvell DSA switch (MDIO). DPAA2 Ethernet drivers probe on the "fsl-mc" bus (drivers/bus/fsl-mc/fsl-mc-bus.c). This bus is meant to be the kernel-side representation of the networking objects kept by the Management Complex (MC) firmware. The fsl-mc bus driver has this pattern: static void fsl_mc_bus_shutdown(struct platform_device *pdev) { fsl_mc_bus_remove(pdev); } which proceeds to remove the children on the bus. Among those children, the dpaa2-eth network driver. When dpaa2-eth is a DSA master, this removal of the master on shutdown trips up the device link created by dsa_master_setup(), and as such, the Marvell switch is also removed. From this point on, readers can revisit the description of commits 74b6d7d13307 ("net: dsa: realtek: register the MDIO bus under devres") 5135e96a3dd2 ("net: dsa: don't allocate the slave_mii_bus using devres") since the prerequisites for the BUG_ON in mdiobus_free() have been accomplished if there is a devres mismatch between mdiobus_alloc() and mdiobus_register(). Most DSA drivers have this kind of mismatch, and upon my initial assessment I had not realized the possibility described above, so I didn't fix it. This patch series walks through all drivers and makes them use either fully devres, or no devres. I am aware that there are DSA drivers that are only known to be tested with a single DSA master, so some patches are probably overkill for them. But code is copy-pasted from so many sources without fully understanding the differences, that I think it's better to not leave an in-tree source of inspiration that may lead to subtle breakage if not adapted properly. ==================== Link: https://lore.kernel.org/r/20220207161553.579933-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 0d120dfb5d67edc5bcd1804e167dba2b30809afd Author: Vladimir Oltean Date: Mon Feb 7 18:15:53 2022 +0200 net: dsa: lantiq_gswip: don't use devres for mdiobus As explained in commits: 74b6d7d13307 ("net: dsa: realtek: register the MDIO bus under devres") 5135e96a3dd2 ("net: dsa: don't allocate the slave_mii_bus using devres") mdiobus_free() will panic when called from devm_mdiobus_free() <- devres_release_all() <- __device_release_driver(), and that mdiobus was not previously unregistered. The GSWIP switch is a platform device, so the initial set of constraints that I thought would cause this (I2C or SPI buses which call ->remove on ->shutdown) do not apply. But there is one more which applies here. If the DSA master itself is on a bus that calls ->remove from ->shutdown (like dpaa2-eth, which is on the fsl-mc bus), there is a device link between the switch and the DSA master, and device_links_unbind_consumers() will unbind the GSWIP switch driver on shutdown. So the same treatment must be applied to all DSA switch drivers, which is: either use devres for both the mdiobus allocation and registration, or don't use devres at all. The gswip driver has the code structure in place for orderly mdiobus removal, so just replace devm_mdiobus_alloc() with the non-devres variant, and add manual free where necessary, to ensure that we don't let devres free a still-registered bus. Fixes: ac3a68d56651 ("net: phy: don't abuse devres in devm_mdiobus_register()") Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: Jakub Kicinski commit 9ffe3d09e32da45bb5a29cf2e80ec8d7534010c5 Author: Vladimir Oltean Date: Mon Feb 7 18:15:52 2022 +0200 net: dsa: mt7530: fix kernel bug in mdiobus_free() when unbinding Nobody in this driver calls mdiobus_unregister(), which is necessary if mdiobus_register() completes successfully. So if the devres callbacks that free the mdiobus get invoked (this is the case when unbinding the driver), mdiobus_free() will BUG if the mdiobus is still registered, which it is. My speculation is that this is due to the fact that prior to commit ac3a68d56651 ("net: phy: don't abuse devres in devm_mdiobus_register()") from June 2020, _devm_mdiobus_free() used to call mdiobus_unregister(). But at the time that the mt7530 support was introduced in May 2021, the API was already changed. It's therefore likely that the blamed patch was developed on an older tree, and incorrectly adapted to net-next. This makes the Fixes: tag correct. Fix the problem by using the devres variant of mdiobus_register. Fixes: ba751e28d442 ("net: dsa: mt7530: add interrupt support") Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: Jakub Kicinski commit bd488afc3b39e045ba71aab472233f2a78726e7b Author: Vladimir Oltean Date: Mon Feb 7 18:15:51 2022 +0200 net: dsa: seville: register the mdiobus under devres As explained in commits: 74b6d7d13307 ("net: dsa: realtek: register the MDIO bus under devres") 5135e96a3dd2 ("net: dsa: don't allocate the slave_mii_bus using devres") mdiobus_free() will panic when called from devm_mdiobus_free() <- devres_release_all() <- __device_release_driver(), and that mdiobus was not previously unregistered. The Seville VSC9959 switch is a platform device, so the initial set of constraints that I thought would cause this (I2C or SPI buses which call ->remove on ->shutdown) do not apply. But there is one more which applies here. If the DSA master itself is on a bus that calls ->remove from ->shutdown (like dpaa2-eth, which is on the fsl-mc bus), there is a device link between the switch and the DSA master, and device_links_unbind_consumers() will unbind the seville switch driver on shutdown. So the same treatment must be applied to all DSA switch drivers, which is: either use devres for both the mdiobus allocation and registration, or don't use devres at all. The seville driver has a code structure that could accommodate both the mdiobus_unregister and mdiobus_free calls, but it has an external dependency upon mscc_miim_setup() from mdio-mscc-miim.c, which calls devm_mdiobus_alloc_size() on its behalf. So rather than restructuring that, and exporting yet one more symbol mscc_miim_teardown(), let's work with devres and replace of_mdiobus_register with the devres variant. When we use all-devres, we can ensure that devres doesn't free a still-registered bus (it either runs both callbacks, or none). Fixes: ac3a68d56651 ("net: phy: don't abuse devres in devm_mdiobus_register()") Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: Jakub Kicinski commit 209bdb7ec6a28c7cdf580a0a98afbc9fc3b98932 Author: Vladimir Oltean Date: Mon Feb 7 18:15:50 2022 +0200 net: dsa: felix: don't use devres for mdiobus As explained in commits: 74b6d7d13307 ("net: dsa: realtek: register the MDIO bus under devres") 5135e96a3dd2 ("net: dsa: don't allocate the slave_mii_bus using devres") mdiobus_free() will panic when called from devm_mdiobus_free() <- devres_release_all() <- __device_release_driver(), and that mdiobus was not previously unregistered. The Felix VSC9959 switch is a PCI device, so the initial set of constraints that I thought would cause this (I2C or SPI buses which call ->remove on ->shutdown) do not apply. But there is one more which applies here. If the DSA master itself is on a bus that calls ->remove from ->shutdown (like dpaa2-eth, which is on the fsl-mc bus), there is a device link between the switch and the DSA master, and device_links_unbind_consumers() will unbind the felix switch driver on shutdown. So the same treatment must be applied to all DSA switch drivers, which is: either use devres for both the mdiobus allocation and registration, or don't use devres at all. The felix driver has the code structure in place for orderly mdiobus removal, so just replace devm_mdiobus_alloc_size() with the non-devres variant, and add manual free where necessary, to ensure that we don't let devres free a still-registered bus. Fixes: ac3a68d56651 ("net: phy: don't abuse devres in devm_mdiobus_register()") Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: Jakub Kicinski commit 08f1a20822349004bb9cc1b153ecb516e9f2889d Author: Vladimir Oltean Date: Mon Feb 7 18:15:49 2022 +0200 net: dsa: bcm_sf2: don't use devres for mdiobus As explained in commits: 74b6d7d13307 ("net: dsa: realtek: register the MDIO bus under devres") 5135e96a3dd2 ("net: dsa: don't allocate the slave_mii_bus using devres") mdiobus_free() will panic when called from devm_mdiobus_free() <- devres_release_all() <- __device_release_driver(), and that mdiobus was not previously unregistered. The Starfighter 2 is a platform device, so the initial set of constraints that I thought would cause this (I2C or SPI buses which call ->remove on ->shutdown) do not apply. But there is one more which applies here. If the DSA master itself is on a bus that calls ->remove from ->shutdown (like dpaa2-eth, which is on the fsl-mc bus), there is a device link between the switch and the DSA master, and device_links_unbind_consumers() will unbind the bcm_sf2 switch driver on shutdown. So the same treatment must be applied to all DSA switch drivers, which is: either use devres for both the mdiobus allocation and registration, or don't use devres at all. The bcm_sf2 driver has the code structure in place for orderly mdiobus removal, so just replace devm_mdiobus_alloc() with the non-devres variant, and add manual free where necessary, to ensure that we don't let devres free a still-registered bus. Fixes: ac3a68d56651 ("net: phy: don't abuse devres in devm_mdiobus_register()") Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: Jakub Kicinski commit 50facd86e9fbc4b93fe02e5fe05776047f45dbfb Author: Vladimir Oltean Date: Mon Feb 7 18:15:48 2022 +0200 net: dsa: ar9331: register the mdiobus under devres As explained in commits: 74b6d7d13307 ("net: dsa: realtek: register the MDIO bus under devres") 5135e96a3dd2 ("net: dsa: don't allocate the slave_mii_bus using devres") mdiobus_free() will panic when called from devm_mdiobus_free() <- devres_release_all() <- __device_release_driver(), and that mdiobus was not previously unregistered. The ar9331 is an MDIO device, so the initial set of constraints that I thought would cause this (I2C or SPI buses which call ->remove on ->shutdown) do not apply. But there is one more which applies here. If the DSA master itself is on a bus that calls ->remove from ->shutdown (like dpaa2-eth, which is on the fsl-mc bus), there is a device link between the switch and the DSA master, and device_links_unbind_consumers() will unbind the ar9331 switch driver on shutdown. So the same treatment must be applied to all DSA switch drivers, which is: either use devres for both the mdiobus allocation and registration, or don't use devres at all. The ar9331 driver doesn't have a complex code structure for mdiobus removal, so just replace of_mdiobus_register with the devres variant in order to be all-devres and ensure that we don't free a still-registered bus. Fixes: ac3a68d56651 ("net: phy: don't abuse devres in devm_mdiobus_register()") Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Tested-by: Oleksij Rempel Signed-off-by: Jakub Kicinski commit f53a2ce893b2c7884ef94471f170839170a4eba0 Author: Vladimir Oltean Date: Mon Feb 7 18:15:47 2022 +0200 net: dsa: mv88e6xxx: don't use devres for mdiobus As explained in commits: 74b6d7d13307 ("net: dsa: realtek: register the MDIO bus under devres") 5135e96a3dd2 ("net: dsa: don't allocate the slave_mii_bus using devres") mdiobus_free() will panic when called from devm_mdiobus_free() <- devres_release_all() <- __device_release_driver(), and that mdiobus was not previously unregistered. The mv88e6xxx is an MDIO device, so the initial set of constraints that I thought would cause this (I2C or SPI buses which call ->remove on ->shutdown) do not apply. But there is one more which applies here. If the DSA master itself is on a bus that calls ->remove from ->shutdown (like dpaa2-eth, which is on the fsl-mc bus), there is a device link between the switch and the DSA master, and device_links_unbind_consumers() will unbind the Marvell switch driver on shutdown. systemd-shutdown[1]: Powering off. mv88e6085 0x0000000008b96000:00 sw_gl0: Link is Down fsl-mc dpbp.9: Removing from iommu group 7 fsl-mc dpbp.8: Removing from iommu group 7 ------------[ cut here ]------------ kernel BUG at drivers/net/phy/mdio_bus.c:677! Internal error: Oops - BUG: 0 [#1] PREEMPT SMP Modules linked in: CPU: 0 PID: 1 Comm: systemd-shutdow Not tainted 5.16.5-00040-gdc05f73788e5 #15 pc : mdiobus_free+0x44/0x50 lr : devm_mdiobus_free+0x10/0x20 Call trace: mdiobus_free+0x44/0x50 devm_mdiobus_free+0x10/0x20 devres_release_all+0xa0/0x100 __device_release_driver+0x190/0x220 device_release_driver_internal+0xac/0xb0 device_links_unbind_consumers+0xd4/0x100 __device_release_driver+0x4c/0x220 device_release_driver_internal+0xac/0xb0 device_links_unbind_consumers+0xd4/0x100 __device_release_driver+0x94/0x220 device_release_driver+0x28/0x40 bus_remove_device+0x118/0x124 device_del+0x174/0x420 fsl_mc_device_remove+0x24/0x40 __fsl_mc_device_remove+0xc/0x20 device_for_each_child+0x58/0xa0 dprc_remove+0x90/0xb0 fsl_mc_driver_remove+0x20/0x5c __device_release_driver+0x21c/0x220 device_release_driver+0x28/0x40 bus_remove_device+0x118/0x124 device_del+0x174/0x420 fsl_mc_bus_remove+0x80/0x100 fsl_mc_bus_shutdown+0xc/0x1c platform_shutdown+0x20/0x30 device_shutdown+0x154/0x330 kernel_power_off+0x34/0x6c __do_sys_reboot+0x15c/0x250 __arm64_sys_reboot+0x20/0x30 invoke_syscall.constprop.0+0x4c/0xe0 do_el0_svc+0x4c/0x150 el0_svc+0x24/0xb0 el0t_64_sync_handler+0xa8/0xb0 el0t_64_sync+0x178/0x17c So the same treatment must be applied to all DSA switch drivers, which is: either use devres for both the mdiobus allocation and registration, or don't use devres at all. The Marvell driver already has a good structure for mdiobus removal, so just plug in mdiobus_free and get rid of devres. Fixes: ac3a68d56651 ("net: phy: don't abuse devres in devm_mdiobus_register()") Reported-by: Rafael Richter Signed-off-by: Vladimir Oltean Tested-by: Daniel Klauer Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Signed-off-by: Jakub Kicinski commit 2a05137a0575b7d1006bdf4c1beeee9e391e22a0 Author: Shyam Prasad N Date: Tue Feb 8 17:10:02 2022 +0000 cifs: mark sessions for reconnection in helper function Today we have the code to mark connections and sessions (and tcons) for reconnect clubbed with the code to close the socket and abort all mids in the same function. Sometimes, we need to mark connections and sessions outside cifsd thread. So as a part of this change, I'm splitting this function into two different functions and calling them one after the other in cifs_reconnect. Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit 52492ff5c583036306bc422a83e246c971af387a Author: Shyam Prasad N Date: Tue Feb 8 19:15:17 2022 +0000 cifs: call helper functions for marking channels for reconnect cifs_mark_tcp_ses_conns_for_reconnect helper function is now meant to be used by any of the threads to mark a channel (or all the channels) for reconnect. Replace all such manual changes to tcpStatus to use this helper function, which takes care that the right channels, smb sessions and tcons are marked for reconnect. Also includes one line minor change Reported-by: kernel test robot Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit 23de0d7b6f0e3f9a6283a882594c479949da1120 Author: Mahesh Bandewar Date: Mon Feb 7 14:29:01 2022 -0800 bonding: pair enable_port with slave_arr_updates When 803.2ad mode enables a participating port, it should update the slave-array. I have observed that the member links are participating and are part of the active aggregator while the traffic is egressing via only one member link (in a case where two links are participating). Via kprobes I discovered that slave-arr has only one link added while the other participating link wasn't part of the slave-arr. I couldn't see what caused that situation but the simple code-walk through provided me hints that the enable_port wasn't always associated with the slave-array update. Fixes: ee6377147409 ("bonding: Simplify the xmit function for modes that use xmit_hash") Signed-off-by: Mahesh Bandewar Acked-by: Jay Vosburgh Link: https://lore.kernel.org/r/20220207222901.1795287-1-maheshb@google.com Signed-off-by: Jakub Kicinski commit f81393a5b252df772b934cde81b7e16273afbd43 Author: Jisheng Zhang Date: Sun Jan 23 17:04:17 2022 +0800 riscv: extable: fix err reg writing in dedicated uaccess handler Mayuresh reported commit 20802d8d477d ("riscv: extable: add a dedicated uaccess handler") breaks the writev02 test case in LTP. This is due to the err reg isn't correctly set with the errno(-EFAULT in writev02 case). First of all, the err and zero regs are reg numbers rather than reg offsets in struct pt_regs; Secondly, regs_set_gpr() should write the regs when offset isn't zero(zero means epc) Fix it by correcting regs_set_gpr() logic and passing the correct reg offset to it. Reported-by: Mayuresh Chitale Fixes: 20802d8d477d ("riscv: extable: add a dedicated uaccess handler") Signed-off-by: Jisheng Zhang Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit 084cbb2ec3af2d23be9de65fcc9493e21e265859 Author: Tao Liu Date: Mon Feb 7 09:59:01 2022 -0800 gve: Recording rx queue before sending to napi This caused a significant performance degredation when using generic XDP with multiple queues. Fixes: f5cedc84a30d2 ("gve: Add transmit and receive support") Signed-off-by: Tao Liu Link: https://lore.kernel.org/r/20220207175901.2486596-1-jeroendb@google.com Signed-off-by: Jakub Kicinski commit 37ef4c19b4c659926ce65a7ac709ceaefb211c40 Author: José Expósito Date: Tue Feb 8 09:59:16 2022 -0800 Input: clear BTN_RIGHT/MIDDLE on buttonpads Buttonpads are expected to map the INPUT_PROP_BUTTONPAD property bit and the BTN_LEFT key bit. As explained in the specification, where a device has a button type value of 0 (click-pad) or 1 (pressure-pad) there should not be discrete buttons: https://docs.microsoft.com/en-us/windows-hardware/design/component-guidelines/touchpad-windows-precision-touchpad-collection#device-capabilities-feature-report However, some drivers map the BTN_RIGHT and/or BTN_MIDDLE key bits even though the device is a buttonpad and therefore does not have those buttons. This behavior has forced userspace applications like libinput to implement different workarounds and quirks to detect buttonpads and offer to the user the right set of features and configuration options. For more information: https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/726 In order to avoid this issue clear the BTN_RIGHT and BTN_MIDDLE key bits when the input device is register if the INPUT_PROP_BUTTONPAD property bit is set. Notice that this change will not affect udev because it does not check for buttons. See systemd/src/udev/udev-builtin-input_id.c. List of known affected hardware: - Chuwi AeroBook Plus - Chuwi Gemibook - Framework Laptop - GPD Win Max - Huawei MateBook 2020 - Prestigio Smartbook 141 C2 - Purism Librem 14v1 - StarLite Mk II - AMI firmware - StarLite Mk II - Coreboot firmware - StarLite Mk III - AMI firmware - StarLite Mk III - Coreboot firmware - StarLabTop Mk IV - AMI firmware - StarLabTop Mk IV - Coreboot firmware - StarBook Mk V Acked-by: Peter Hutterer Acked-by: Benjamin Tissoires Acked-by: Jiri Kosina Signed-off-by: José Expósito Link: https://lore.kernel.org/r/20220208174806.17183-1-jose.exposito89@gmail.com Signed-off-by: Dmitry Torokhov commit 3203ce39ac0b2a57a84382ec184c7d4a0bede175 Author: JaeSang Yoo Date: Wed Feb 9 04:54:22 2022 +0900 tracing: Fix tp_printk option related with tp_printk_stop_on_boot The kernel parameter "tp_printk_stop_on_boot" starts with "tp_printk" which is the same as another kernel parameter "tp_printk". If "tp_printk" setup is called before the "tp_printk_stop_on_boot", it will override the latter and keep it from being set. This is similar to other kernel parameter issues, such as: Commit 745a600cf1a6 ("um: console: Ignore console= option") or init/do_mounts.c:45 (setup function of "ro" kernel param) Fix it by checking for a "_" right after the "tp_printk" and if that exists do not process the parameter. Link: https://lkml.kernel.org/r/20220208195421.969326-1-jsyoo5b@gmail.com Signed-off-by: JaeSang Yoo [ Fixed up change log and added space after if condition ] Signed-off-by: Steven Rostedt (Google) commit 3a92e6de780c7afaa826b80058abd952bb2904d8 Author: Daniel Bristot de Oliveira Date: Tue Feb 8 15:47:10 2022 +0100 MAINTAINERS: Add RTLA entry Add an RTLA entry in the MAINTAINERS file with Steven Rostedt and myself as maintainers. Link: https://lkml.kernel.org/r/50d8870522580905a1c7f3e6fb611a700f632af1.1643994005.git.bristot@kernel.org Cc: Joe Perches Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) commit 92a68053c3468705e2c7c752c9a3f256304a35a6 Author: Akira Kawata Date: Mon Feb 7 20:20:44 2022 +0900 Documentation: KUnit: Fix usage bug Fix a bug of kunit documentation. Link: https://bugzilla.kernel.org/show_bug.cgi?id=205773 : Quoting Steve Pfetsch: : : kunit documentation is incorrect: : https://kunit.dev/third_party/stable_kernel/docs/usage.html : struct rectangle *self = container_of(this, struct shape, parent); : : : Shouldn't it be: : struct rectangle *self = container_of(this, struct rectangle, parent); : ? Signed-off-by: Akira Kawata Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit e6251ab4551f51fa4cee03523e08051898c3ce82 Merge: 555f3d7be91a8 b49ea673e119f Author: Linus Torvalds Date: Tue Feb 8 12:03:07 2022 -0800 Merge tag 'nfs-for-5.17-2' of git://git.linux-nfs.org/projects/anna/linux-nfs Pull NFS client fixes from Anna Schumaker: "Stable Fixes: - Fix initialization of nfs_client cl_flags Other Fixes: - Fix performance issues with uncached readdir calls - Fix potential pointer dereferences in rpcrdma_ep_create - Fix nfs4_proc_get_locations() kernel-doc comment - Fix locking during sunrpc sysfs reads - Update my email address in the MAINTAINERS file to my new kernel.org email" * tag 'nfs-for-5.17-2' of git://git.linux-nfs.org/projects/anna/linux-nfs: SUNRPC: lock against ->sock changing during sysfs read MAINTAINERS: Update my email address NFS: Fix nfs4_proc_get_locations() kernel-doc comment xprtrdma: fix pointer derefs in error cases of rpcrdma_ep_create NFS: Fix initialisation of nfs_client cl_flags field NFS: Avoid duplicate uncached readdir calls on eof NFS: Don't skip directory entries when doing uncached readdir NFS: Don't overfill uncached readdir pages commit a81da65fbae6436e1e2f415532b8aacc3274d840 Author: Shyam Prasad N Date: Tue Feb 8 19:28:28 2022 +0000 cifs: call cifs_reconnect when a connection is marked In cifsd thread, we should continue to call cifs_reconnect whenever server->tcpStatus is marked as CifsNeedReconnect. This was inexplicably removed by one of my recent commits. Fixing that here. Fixes: a05885ce13bd ("cifs: fix the connection state transitions with multichannel") Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit 3915035282573c5e29996ce3173171f5f05234d1 Author: Maxim Levitsky Date: Mon Feb 7 17:54:26 2022 +0200 KVM: x86: SVM: move avic definitions from AMD's spec to svm.h asm/svm.h is the correct place for all values that are defined in the SVM spec, and that includes AVIC. Also add some values from the spec that were not defined before and will be soon useful. Signed-off-by: Maxim Levitsky Message-Id: <20220207155447.840194-10-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit 755c2bf878607dbddb1423df9abf16b82205896f Author: Maxim Levitsky Date: Mon Feb 7 17:54:25 2022 +0200 KVM: x86: lapic: don't touch irr_pending in kvm_apic_update_apicv when inhibiting it kvm_apic_update_apicv is called when AVIC is still active, thus IRR bits can be set by the CPU after it is called, and don't cause the irr_pending to be set to true. Also logic in avic_kick_target_vcpu doesn't expect a race with this function so to make it simple, just keep irr_pending set to true and let the next interrupt injection to the guest clear it. Signed-off-by: Maxim Levitsky Message-Id: <20220207155447.840194-9-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit 2b0ecccb55310a4b8ad5d59c703cf8c821be6260 Author: Maxim Levitsky Date: Mon Feb 7 17:54:24 2022 +0200 KVM: x86: nSVM: deal with L1 hypervisor that intercepts interrupts but lets L2 control them Fix a corner case in which the L1 hypervisor intercepts interrupts (INTERCEPT_INTR) and either doesn't set virtual interrupt masking (V_INTR_MASKING) or enters a nested guest with EFLAGS.IF disabled prior to the entry. In this case, despite the fact that L1 intercepts the interrupts, KVM still needs to set up an interrupt window to wait before injecting the INTR vmexit. Currently the KVM instead enters an endless loop of 'req_immediate_exit'. Exactly the same issue also happens for SMIs and NMI. Fix this as well. Note that on VMX, this case is impossible as there is only 'vmexit on external interrupts' execution control which either set, in which case both host and guest's EFLAGS.IF are ignored, or not set, in which case no VMexits are delivered. Signed-off-by: Maxim Levitsky Message-Id: <20220207155447.840194-8-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit 91f673b3e1bd99faf46472b5244cb40fdcd01078 Author: Maxim Levitsky Date: Mon Feb 7 17:54:22 2022 +0200 KVM: x86: nSVM: expose clean bit support to the guest KVM already honours few clean bits thus it makes sense to let the nested guest know about it. Note that KVM also doesn't check if the hardware supports clean bits, and therefore nested KVM was already setting clean bits and L0 KVM was already honouring them. Signed-off-by: Maxim Levitsky Message-Id: <20220207155447.840194-6-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit 759cbd59674a6c0aec616a3f4f0740ebd3f5fbef Author: Maxim Levitsky Date: Mon Feb 7 17:54:21 2022 +0200 KVM: x86: nSVM/nVMX: set nested_run_pending on VM entry which is a result of RSM While RSM induced VM entries are not full VM entries, they still need to be followed by actual VM entry to complete it, unlike setting the nested state. This patch fixes boot of hyperv and SMM enabled windows VM running nested on KVM, which fail due to this issue combined with lack of dirty bit setting. Signed-off-by: Maxim Levitsky Cc: stable@vger.kernel.org Message-Id: <20220207155447.840194-5-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit e8efa4ff00374d2e6f47f6e4628ca3b541c001af Author: Maxim Levitsky Date: Mon Feb 7 17:54:20 2022 +0200 KVM: x86: nSVM: mark vmcb01 as dirty when restoring SMM saved state While usually, restoring the smm state makes the KVM enter the nested guest thus a different vmcb (vmcb02 vs vmcb01), KVM should still mark it as dirty, since hardware can in theory cache multiple vmcbs. Failure to do so, combined with lack of setting the nested_run_pending (which is fixed in the next patch), might make KVM re-enter vmcb01, which was just exited from, with completely different set of guest state registers (SMM vs non SMM) and without proper dirty bits set, which results in the CPU reusing stale IDTR pointer which leads to a guest shutdown on any interrupt. On the real hardware this usually doesn't happen, but when running nested, L0's KVM does check and honour few dirty bits, causing this issue to happen. This patch fixes boot of hyperv and SMM enabled windows VM running nested on KVM. Signed-off-by: Maxim Levitsky Cc: stable@vger.kernel.org Message-Id: <20220207155447.840194-4-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit e1779c2714c3023e4629825762bcbc43a3b943df Author: Maxim Levitsky Date: Mon Feb 7 17:54:19 2022 +0200 KVM: x86: nSVM: fix potential NULL derefernce on nested migration Turns out that due to review feedback and/or rebases I accidentally moved the call to nested_svm_load_cr3 to be too early, before the NPT is enabled, which is very wrong to do. KVM can't even access guest memory at that point as nested NPT is needed for that, and of course it won't initialize the walk_mmu, which is main issue the patch was addressing. Fix this for real. Fixes: 232f75d3b4b5 ("KVM: nSVM: call nested_svm_load_cr3 on nested state load") Cc: stable@vger.kernel.org Signed-off-by: Maxim Levitsky Message-Id: <20220207155447.840194-3-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit c53bbe2145f51d3bc0438c2db02e737b9b598bf3 Author: Maxim Levitsky Date: Mon Feb 7 17:54:18 2022 +0200 KVM: x86: SVM: don't passthrough SMAP/SMEP/PKE bits in !NPT && !gCR0.PG case When the guest doesn't enable paging, and NPT/EPT is disabled, we use guest't paging CR3's as KVM's shadow paging pointer and we are technically in direct mode as if we were to use NPT/EPT. In direct mode we create SPTEs with user mode permissions because usually in the direct mode the NPT/EPT doesn't need to restrict access based on guest CPL (there are MBE/GMET extenstions for that but KVM doesn't use them). In this special "use guest paging as direct" mode however, and if CR4.SMAP/CR4.SMEP are enabled, that will make the CPU fault on each access and KVM will enter endless loop of page faults. Since page protection doesn't have any meaning in !PG case, just don't passthrough these bits. The fix is the same as was done for VMX in commit: commit 656ec4a4928a ("KVM: VMX: fix SMEP and SMAP without EPT") This fixes the boot of windows 10 without NPT for good. (Without this patch, BSP boots, but APs were stuck in endless loop of page faults, causing the VM boot with 1 CPU) Signed-off-by: Maxim Levitsky Cc: stable@vger.kernel.org Message-Id: <20220207155447.840194-2-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit dd4589eee99db8f61f7b8f7df1531cad3f74a64d Author: Sean Christopherson Date: Fri Feb 4 21:41:55 2022 +0000 Revert "svm: Add warning message for AVIC IPI invalid target" Remove a WARN on an "AVIC IPI invalid target" exit, the WARN is trivial to trigger from guest as it will fail on any destination APIC ID that doesn't exist from the guest's perspective. Don't bother recording anything in the kernel log, the common tracepoint for kvm_avic_incomplete_ipi() is sufficient for debugging. This reverts commit 37ef0c4414c9743ba7f1af4392f0a27a99649f2a. Cc: stable@vger.kernel.org Signed-off-by: Sean Christopherson Message-Id: <20220204214205.3306634-2-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 9da1e9ab82c92d0e89fe44cad2cd7c2d18d64070 Author: Brian Norris Date: Wed Jan 19 16:11:22 2022 -0800 drm/rockchip: vop: Correct RK3399 VOP register fields Commit 7707f7227f09 ("drm/rockchip: Add support for afbc") switched up the rk3399_vop_big[] register windows, but it did so incorrectly. The biggest problem is in rk3288_win23_data[] vs. rk3368_win23_data[] .format field: RK3288's format: VOP_REG(RK3288_WIN2_CTRL0, 0x7, 1) RK3368's format: VOP_REG(RK3368_WIN2_CTRL0, 0x3, 5) Bits 5:6 (i.e., shift 5, mask 0x3) are correct for RK3399, according to the TRM. There are a few other small differences between the 3288 and 3368 definitions that were swapped in commit 7707f7227f09. I reviewed them to the best of my ability according to the RK3399 TRM and fixed them up. This fixes IOMMU issues (and display errors) when testing with BG24 color formats. Fixes: 7707f7227f09 ("drm/rockchip: Add support for afbc") Cc: Andrzej Pietrasiewicz Cc: Signed-off-by: Brian Norris Tested-by: Andrzej Pietrasiewicz Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20220119161104.1.I1d01436bef35165a8cdfe9308789c0badb5ff46a@changeid commit c0cfbb122275da1b726481de5a8cffeb24e6322b Author: Sascha Hauer Date: Wed Jan 26 15:55:24 2022 +0100 drm/rockchip: dw_hdmi: Do not leave clock enabled in error case The driver returns an error when devm_phy_optional_get() fails leaving the previously enabled clock turned on. Change order and enable the clock only after the phy has been acquired. Signed-off-by: Sascha Hauer Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20220126145549.617165-3-s.hauer@pengutronix.de commit 4bbf59a9db44c78dd3e5c72057548f7c1eb8d2ba Author: Daniel Bristot de Oliveira Date: Tue Feb 8 15:36:21 2022 +0100 rtla: Fix segmentation fault when failing to enable -t rtla osnoise and timerlat are causing a segmentation fault when running with the --trace option on a kernel that does not support multiple instances. For example: [root@f34 rtla]# rtla osnoise top -t failed to enable the tracer osnoise Could not enable osnoiser tracer for tracing Failed to enable the trace instance Segmentation fault (core dumped) This error happens because the exit code of the tools is trying to destroy the trace instance that failed to be created. Make osnoise_destroy_tool() aware of possible NULL osnoise_tool *, and do not attempt to destroy it. This also simplifies the exit code. Link: https://lkml.kernel.org/r/5660a2b6bf66c2655842360f2d7f6b48db5dba23.1644327249.git.bristot@kernel.org Suggested-by: Steven Rostedt Fixes: 1eceb2fc2ca5 ("rtla/osnoise: Add osnoise top mode") Fixes: 829a6c0b5698 ("rtla/osnoise: Add the hist mode") Fixes: a828cd18bc4a ("rtla: Add timerlat tool and timelart top mode") Fixes: 1eeb6328e8b3 ("rtla/timerlat: Add timerlat hist mode") Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) commit 54309fde1a352ad2674ebba004a79f7d20b9f037 Author: Christian Löhle Date: Fri Feb 4 15:11:37 2022 +0000 mmc: block: fix read single on recovery logic On reads with MMC_READ_MULTIPLE_BLOCK that fail, the recovery handler will use MMC_READ_SINGLE_BLOCK for each of the blocks, up to MMC_READ_SINGLE_RETRIES times each. The logic for this is fixed to never report unsuccessful reads as success to the block layer. On command error with retries remaining, blk_update_request was called with whatever value error was set last to. In case it was last set to BLK_STS_OK (default), the read will be reported as success, even though there was no data read from the device. This could happen on a CRC mismatch for the response, a card rejecting the command (e.g. again due to a CRC mismatch). In case it was last set to BLK_STS_IOERR, the error is reported correctly, but no retries will be attempted. Fixes: 81196976ed946c ("mmc: block: Add blk-mq support") Cc: stable@vger.kernel.org Signed-off-by: Christian Loehle Reviewed-by: Adrian Hunter Link: https://lore.kernel.org/r/bc706a6ab08c4fe2834ba0c05a804672@hyperstone.com Signed-off-by: Ulf Hansson commit 1830947ee4e8ed3e7083e8d41d2b8486568ebea7 Author: Geert Uytterhoeven Date: Wed Jan 12 15:07:37 2022 +0100 arm64: Remove ARCH_VULCAN Commit a314520d82317650 ("arm64: disable Broadcom Vulcan platform") did not remove the ARCH_VULCAN configuration symbol, as there were still references to this symbol. As of commits 240d3d5b2a7a3263 ("gpio: xlp: update GPIO_XLP dependency") and f85a543e5373eeba ("arm64: defconfig: drop ARCH_VULCAN"), the last users of ARCH_VULCAN have been removed. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/9e8fef2cf4f2d5648e87076bc96601cff945ce40.1641996361.git.geert+renesas@glider.be' Signed-off-by: Arnd Bergmann commit b49ea673e119f59c71645e2f65b3ccad857c90ee Author: NeilBrown Date: Mon Jan 17 16:36:53 2022 +1100 SUNRPC: lock against ->sock changing during sysfs read ->sock can be set to NULL asynchronously unless ->recv_mutex is held. So it is important to hold that mutex. Otherwise a sysfs read can trigger an oops. Commit 17f09d3f619a ("SUNRPC: Check if the xprt is connected before handling sysfs reads") appears to attempt to fix this problem, but it only narrows the race window. Fixes: 17f09d3f619a ("SUNRPC: Check if the xprt is connected before handling sysfs reads") Fixes: a8482488a7d6 ("SUNRPC query transport's source port") Signed-off-by: NeilBrown Signed-off-by: Anna Schumaker commit 63db37e99ac17f575766c9317f927c8d4c6e8cdf Author: Anna Schumaker Date: Mon Feb 7 11:14:47 2022 -0500 MAINTAINERS: Update my email address Signed-off-by: Anna Schumaker commit 3d4a39404ba323b08fb42bcdca9a015144e213dd Author: Yang Li Date: Thu Jan 13 10:26:04 2022 +0800 NFS: Fix nfs4_proc_get_locations() kernel-doc comment Add the description of @server and @fhandle, and remove the excess @inode in nfs4_proc_get_locations() kernel-doc comment to remove warnings found by running scripts/kernel-doc, which is caused by using 'make W=1'. fs/nfs/nfs4proc.c:8219: warning: Function parameter or member 'server' not described in 'nfs4_proc_get_locations' fs/nfs/nfs4proc.c:8219: warning: Function parameter or member 'fhandle' not described in 'nfs4_proc_get_locations' fs/nfs/nfs4proc.c:8219: warning: Excess function parameter 'inode' description in 'nfs4_proc_get_locations' Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Anna Schumaker commit a9c10b5b3b67b3750a10c8b089b2e05f5e176e33 Author: Dan Aloni Date: Tue Jan 25 22:06:46 2022 +0200 xprtrdma: fix pointer derefs in error cases of rpcrdma_ep_create If there are failures then we must not leave the non-NULL pointers with the error value, otherwise `rpcrdma_ep_destroy` gets confused and tries free them, resulting in an Oops. Signed-off-by: Dan Aloni Acked-by: Chuck Lever Signed-off-by: Anna Schumaker commit 468d126dab45718feeb728319be20bd869a5eaa7 Author: Trond Myklebust Date: Wed Feb 2 18:52:01 2022 -0500 NFS: Fix initialisation of nfs_client cl_flags field For some long forgotten reason, the nfs_client cl_flags field is initialised in nfs_get_client() instead of being initialised at allocation time. This quirk was harmless until we moved the call to nfs_create_rpc_client(). Fixes: dd99e9f98fbf ("NFSv4: Initialise connection to the server in nfs4_alloc_client()") Cc: stable@vger.kernel.org # 4.8.x Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit db405774f6a80c5607dcf43ec810f078bb5c660d Author: Daniel Vetter Date: Mon Jan 31 22:05:32 2022 +0100 MAINTAINERS: Add entry for fbdev core Ever since Tomi extracted the core code in 2014 it's been defacto me maintaining this, with help from others from dri-devel and sometimes Linus (but those are mostly merge conflicts): $ git shortlog -ns drivers/video/fbdev/core/ | head -n5 35 Daniel Vetter 23 Linus Torvalds 10 Hans de Goede 9 Dave Airlie 6 Peter Rosin I think ideally we'd also record that the various firmware fb drivers (efifb, vesafb, ...) are also maintained in drm-misc because for the past few years the patches have either been to fix handover issues with drm drivers, or caused handover issues with drm drivers. So any other tree just doesn't make sense. But also, there's plenty of outdated MAINTAINER entries for these with people and git trees that haven't been active in years, so maybe let's just leave them alone. And furthermore distros are now adopting simpledrm as the firmware fb driver, so hopefully the need to care about the fbdev firmware drivers will go down going forward. Note that drm-misc is group maintained, I expect that to continue like we've done before, so no new expectations that patches all go through my hands. That would be silly. This also means I'm happy to put any other volunteer's name in the M: line, but otherwise git log says I'm the one who's stuck with this. Acked-by: Alex Deucher Acked-by: Daniel Stone Acked-by: Dave Airlie Acked-by: Geert Uytterhoeven Acked-by: Greg Kroah-Hartman Cc: Dave Airlie Acked-by: Helge Deller Acked-by: Jani Nikula Acked-by: Maxime Ripard Acked-by: Sam Ravnborg Acked-by: Thomas Zimmermann Acked-by: Tomi Valkeinen Reviewed-by: Javier Martinez Canillas Cc: Jani Nikula Cc: Linus Torvalds Cc: Linux Fbdev development list Cc: Pavel Machek Cc: Sam Ravnborg Cc: Greg Kroah-Hartman Cc: Javier Martinez Canillas Cc: DRI Development Cc: Linux Kernel Mailing List Cc: Claudio Suarez Cc: Tomi Valkeinen Cc: Geert Uytterhoeven Cc: Thomas Zimmermann Cc: Daniel Vetter Cc: Sven Schnelle Cc: Gerd Hoffmann Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220131210552.482606-2-daniel.vetter@ffwll.ch commit 50b10528aad568c95f772039d4b3093b4aea7439 Author: Helge Deller Date: Mon Feb 7 16:59:31 2022 +0100 fbcon: Avoid 'cap' set but not used warning Fix this kernel test robot warning: drivers/video/fbdev/core/fbcon.c: In function 'fbcon_init': drivers/video/fbdev/core/fbcon.c:1028:6: warning: variable 'cap' set but not used [-Wunused-but-set-variable] The cap variable is only used when CONFIG_FRAMEBUFFER_CONSOLE_LEGACY_ACCELERATION is enabled. Drop the temporary variable and use info->flags instead. Fixes: 87ab9f6b7417 ("Revert "fbcon: Disable accelerated scrolling") Reported-by: kernel test robot Signed-off-by: Helge Deller Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/YgFB4xqI+As196FR@p100 commit ab3824427b848da10e9fe2727f035bbeecae6ff4 Author: Zhou Qingyang Date: Wed Dec 1 01:22:53 2021 +0800 spi: spi-zynq-qspi: Fix a NULL pointer dereference in zynq_qspi_exec_mem_op() In zynq_qspi_exec_mem_op(), kzalloc() is directly used in memset(), which could lead to a NULL pointer dereference on failure of kzalloc(). Fix this bug by adding a check of tmpbuf. This bug was found by a static analyzer. The analysis employs differential checking to identify inconsistent security operations (e.g., checks or kfrees) between two code paths and confirms that the inconsistent operations are not recovered in the current function or the callers, so they constitute bugs. Note that, as a bug found by static analysis, it can be a false positive or hard to trigger. Multiple researchers have cross-reviewed the bug. Builds with CONFIG_SPI_ZYNQ_QSPI=m show no new warnings, and our static analyzer no longer warns about this code. Fixes: 67dca5e580f1 ("spi: spi-mem: Add support for Zynq QSPI controller") Signed-off-by: Zhou Qingyang Link: https://lore.kernel.org/r/20211130172253.203700-1-zhou1615@umn.edu Signed-off-by: Mark Brown commit 4e2a354e3775870ca823f1fb29bbbffbe11059a6 Author: Oliver Barta Date: Tue Feb 8 09:46:45 2022 +0100 regulator: core: fix false positive in regulator_late_cleanup() The check done by regulator_late_cleanup() to detect whether a regulator is on was inconsistent with the check done by _regulator_is_enabled(). While _regulator_is_enabled() takes the enable GPIO into account, regulator_late_cleanup() was not doing that. This resulted in a false positive, e.g. when a GPIO-controlled fixed regulator was used, which was not enabled at boot time, e.g. reg_disp_1v2: reg_disp_1v2 { compatible = "regulator-fixed"; regulator-name = "display_1v2"; regulator-min-microvolt = <1200000>; regulator-max-microvolt = <1200000>; gpio = <&tlmm 148 0>; enable-active-high; }; Such regulator doesn't have an is_enabled() operation. Nevertheless it's state can be determined based on the enable GPIO. The check in regulator_late_cleanup() wrongly assumed that the regulator is on and tried to disable it. Signed-off-by: Oliver Barta Link: https://lore.kernel.org/r/20220208084645.8686-1-oliver.barta@aptiv.com Signed-off-by: Mark Brown commit 4c33de0673ced9c7c37b3bbd9bfe0fda72340b2a Author: Kai Vehmanen Date: Mon Feb 7 17:30:00 2022 +0200 ASoC: rt5682: do not block workqueue if card is unbound The current rt5682_jack_detect_handler() assumes the component and card will always show up and implements an infinite usleep loop waiting for them to show up. This does not hold true if a codec interrupt (or other event) occurs when the card is unbound. The codec driver's remove or shutdown functions cannot cancel the workqueue due to the wait loop. As a result, code can either end up blocking the workqueue, or hit a kernel oops when the card is freed. Fix the issue by rescheduling the jack detect handler in case the card is not ready. In case card never shows up, the shutdown/remove/suspend calls can now cancel the detect task. Signed-off-by: Kai Vehmanen Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Reviewed-by: Péter Ujfalusi Reviewed-by: Shuming Fan Link: https://lore.kernel.org/r/20220207153000.3452802-3-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit a6d78661dc903d90a327892bbc34268f3a5f4b9c Author: Kai Vehmanen Date: Mon Feb 7 17:29:59 2022 +0200 ASoC: rt5668: do not block workqueue if card is unbound The current rt5668_jack_detect_handler() assumes the component and card will always show up and implements an infinite usleep loop waiting for them to show up. This does not hold true if a codec interrupt (or other event) occurs when the card is unbound. The codec driver's remove or shutdown functions cannot cancel the workqueue due to the wait loop. As a result, code can either end up blocking the workqueue, or hit a kernel oops when the card is freed. Fix the issue by rescheduling the jack detect handler in case the card is not ready. In case card never shows up, the shutdown/remove/suspend calls can now cancel the detect task. Signed-off-by: Kai Vehmanen Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Reviewed-by: Péter Ujfalusi Reviewed-by: Shuming Fan Link: https://lore.kernel.org/r/20220207153000.3452802-2-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit d7b530fdc45e75a54914a194c4becd9672a4e24f Author: Kai Vehmanen Date: Mon Feb 7 17:29:58 2022 +0200 ASoC: rt5682s: do not block workqueue if card is unbound The current rt5682s_jack_detect_handler() assumes the component and card will always show up and implements an infinite usleep loop waiting for them to show up. This does not hold true if a codec interrupt (or other event) occurs when the card is unbound. The codec driver's remove or shutdown functions cannot cancel the workqueue due to the wait loop. As a result, code can either end up blocking the workqueue, or hit a kernel oops when the card is freed. Fix the issue by rescheduling the jack detect handler in case the card is not ready. In case card never shows up, the shutdown/remove/suspend calls can now cancel the detect task. Signed-off-by: Kai Vehmanen Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Reviewed-by: Péter Ujfalusi Reviewed-by: Shuming Fan Link: https://lore.kernel.org/r/20220207153000.3452802-1-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit 307f31452078792aab94a729fce33200c6e42dc4 Author: Martin Povišer Date: Fri Feb 4 10:53:01 2022 +0100 ASoC: tas2770: Insert post reset delay Per TAS2770 datasheet there must be a 1 ms delay from reset to first command. So insert delays into the driver where appropriate. Fixes: 1a476abc723e ("tas2770: add tas2770 smart PA kernel driver") Signed-off-by: Martin Povišer Link: https://lore.kernel.org/r/20220204095301.5554-1-povik+lin@cutebit.org Signed-off-by: Mark Brown commit 946eb87114af37c9c13c618a7c1cdaca936905fa Author: Guenter Roeck Date: Mon Feb 7 08:09:23 2022 -0800 ASoC: Revert "ASoC: mediatek: Check for error clk pointer" This reverts commit 9de2b9286a6d ("ASoC: mediatek: Check for error clk pointer"). With this patch in the tree, Chromebooks running the affected hardware no longer boot. Bisect points to this patch, and reverting it fixes the problem. An analysis of the code with this patch applied shows: ret = init_clks(pdev, clk); if (ret) return ERR_PTR(ret); ... for (j = 0; j < MAX_CLKS && data->clk_id[j]; j++) { struct clk *c = clk[data->clk_id[j]]; if (IS_ERR(c)) { dev_err(&pdev->dev, "%s: clk unavailable\n", data->name); return ERR_CAST(c); } scpd->clk[j] = c; } Not all clocks in the clk_names array have to be present. Only the clocks in the data->clk_id array are actually needed. The code already checks if the required clocks are available and bails out if not. The assumption that all clocks have to be present is wrong, and commit 9de2b9286a6d ("ASoC: mediatek: Check for error clk pointer") needs to be reverted. Cc: Jiasheng Jiang Cc: Mark Brown Cc: James Liao Cc: Kevin Hilman Cc: Matthias Brugger Reported-by: Frank Wunderlich Reported-by: Daniel Golle Fixes: 9de2b9286a6d ("ASoC: mediatek: Check for error clk pointer") Signed-off-by: Guenter Roeck Link: https://lore.kernel.org/r/20220207160923.3911501-1-linux@roeck-us.net Signed-off-by: Mark Brown commit 2e8a8b5955a000cc655f7e368670518cbb77fe58 Author: Sascha Hauer Date: Wed Jan 26 15:55:40 2022 +0100 arm64: dts: rockchip: reorder rk3399 hdmi clocks The binding specifies the clock order to "cec", "grf", "vpll". Reorder the clocks accordingly. Signed-off-by: Sascha Hauer Link: https://lore.kernel.org/r/20220126145549.617165-19-s.hauer@pengutronix.de Signed-off-by: Heiko Stuebner commit 117b4e96c7f362eb6459543883fc07f77662472c Author: Udipto Goswami Date: Mon Feb 7 09:55:58 2022 +0530 usb: dwc3: gadget: Prevent core from processing stale TRBs With CPU re-ordering on write instructions, there might be a chance that the HWO is set before the TRB is updated with the new mapped buffer address. And in the case where core is processing a list of TRBs it is possible that it fetched the TRBs when the HWO is set but before the buffer address is updated. Prevent this by adding a memory barrier before the HWO is updated to ensure that the core always process the updated TRBs. Fixes: f6bafc6a1c9d ("usb: dwc3: convert TRBs into bitshifts") Cc: stable Reviewed-by: Pavankumar Kondeti Signed-off-by: Udipto Goswami Link: https://lore.kernel.org/r/1644207958-18287-1-git-send-email-quic_ugoswami@quicinc.com Signed-off-by: Greg Kroah-Hartman commit bca828ccdd6548d24613d0cede04ada4dfb2f89c Author: Samuel Thibault Date: Sun Feb 6 02:56:26 2022 +0100 speakup-dectlk: Restore pitch setting d97a9d7aea04 ("staging/speakup: Add inflection synth parameter") introduced the inflection parameter, but happened to drop the pitch parameter from the dectlk driver. This restores it. Cc: stable@vger.kernel.org Fixes: d97a9d7aea04 ("staging/speakup: Add inflection synth parameter") Signed-off-by: Samuel Thibault Link: https://lore.kernel.org/r/20220206015626.aesbhvvdkmqsrbaw@begin Signed-off-by: Greg Kroah-Hartman commit 7896020612039fcbff11b8a903b28b0f157d2e5f Merge: 4a64f2d3527a0 3375aa77135f6 Author: Arnd Bergmann Date: Tue Feb 8 10:51:03 2022 +0100 Merge tag 'amlogic-fixes-v5.17-rc-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux into arm/fixes Amlogic fixes for v5.17-rc - meson6/meson8/meson8b UART compatible fixup to notably fix earlycon * tag 'amlogic-fixes-v5.17-rc-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux: ARM: dts: meson8b: Fix the UART device-tree schema validation ARM: dts: meson8: Fix the UART device-tree schema validation ARM: dts: meson: Fix the UART compatible strings Link: https://lore.kernel.org/r/746a7f25-1c96-9d27-3a08-e86b2af608ef@baylibre.com Signed-off-by: Arnd Bergmann commit cc38ef936840ac29204d806deb4d1836ec509594 Author: Niklas Cassel Date: Fri Feb 4 13:02:25 2022 +0000 gpio: sifive: use the correct register to read output values Setting the output of a GPIO to 1 using gpiod_set_value(), followed by reading the same GPIO using gpiod_get_value(), will currently yield an incorrect result. This is because the SiFive GPIO device stores the output values in reg_set, not reg_dat. Supply the flag BGPIOF_READ_OUTPUT_REG_SET to bgpio_init() so that the generic driver reads the correct register. Fixes: 96868dce644d ("gpio/sifive: Add GPIO driver for SiFive SoCs") Signed-off-by: Niklas Cassel Reviewed-by: Linus Walleij [Bartosz: added the Fixes tag] Signed-off-by: Bartosz Golaszewski commit 95a4eed7dd5b7c1c3664a626174290686ddbee9f Author: Andy Shevchenko Date: Tue Feb 1 17:27:55 2022 +0200 gpiolib: Never return internal error codes to user space Currently it's possible that character device interface may return the error codes which are not supposed to be seen by user space. In this case it's EPROBE_DEFER. Wrap it to return -ENODEV instead as sysfs does. Fixes: d7c51b47ac11 ("gpio: userspace ABI for reading/writing GPIO lines") Fixes: 61f922db7221 ("gpio: userspace ABI for reading GPIO line events") Fixes: 3c0d9c635ae2 ("gpiolib: cdev: support GPIO_V2_GET_LINE_IOCTL and GPIO_V2_LINE_GET_VALUES_IOCTL") Reported-by: Suresh Balakrishnan Signed-off-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit 4a64f2d3527a0ae400bcea353898a8f47209b446 Author: Michael Walle Date: Mon Feb 7 19:46:52 2022 +0100 MAINTAINERS: add myself as a maintainer for the sl28cpld The sl28cpld is a management controller found on the Kontron SMARC-sAL28 board for now. Support for it was added by me quite a while ago, but I didn't add a MAINTAINERS entry. Add it now. Signed-off-by: Michael Walle Link: https://lore.kernel.org/r/20220207184652.1218447-1-michael@walle.cc' Signed-off-by: Arnd Bergmann commit 5b52ada7141f7adb53bed6d104df2690f4304f4c Author: Krzysztof Kozlowski Date: Mon Feb 7 18:55:03 2022 +0100 MAINTAINERS: add IRC to ARM sub-architectures and Devicetree Mention the IRC channels used for discussions about ARM/ARM64 sub-architectures and Devicetree. This documents purely existing state. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220207175503.425200-2-krzysztof.kozlowski@canonical.com' Signed-off-by: Arnd Bergmann commit d9bc0de02aa0afa7ff96682428b2bb792bf00d9c Author: Krzysztof Kozlowski Date: Mon Feb 7 18:55:02 2022 +0100 MAINTAINERS: arm: samsung: add Git tree and IRC Add already used Krzysztof Kozlowski's Git tree for Samsung S3C/S5P/Exynos ARM sub-architecture and IRC channel (#linux-exynos at Libera). This documents purely existing state. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220207175503.425200-1-krzysztof.kozlowski@canonical.com' Signed-off-by: Arnd Bergmann commit 6efb9f739d41b867cb7e865ba4213003ab1b9c91 Merge: d9058d6a0e92d 3037b174b1876 Author: Arnd Bergmann Date: Tue Feb 8 09:57:07 2022 +0100 Merge tag 'socfpga_fix_for_v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux into arm/fixes SoCFPGA fix for v5.17, part 1 - Fix a build error for socfpga_defconfig * tag 'socfpga_fix_for_v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux: ARM: socfpga: fix missing RESET_CONTROLLER Link: https://lore.kernel.org/r/20220207101002.7566-1-dinguyen@kernel.org Signed-off-by: Arnd Bergmann commit d9058d6a0e92d8e4a00855f8fe204792f42794db Author: Linus Walleij Date: Sun Feb 6 00:53:12 2022 +0100 ARM: dts: Fix boot regression on Skomer The signal routing on the Skomer board was incorrect making it impossible to mount root from the SD card. Fix this up. Signed-off-by: Linus Walleij Cc: stable@vger.kernel.org Cc: Stefan Hansson Link: https://lore.kernel.org/r/20220205235312.446730-1-linus.walleij@linaro.org' Signed-off-by: Arnd Bergmann commit 99c410e89ed0f9aef3c652279813611576d9ea5e Merge: 724004a11a84e aee744a37aaf2 Author: Arnd Bergmann Date: Tue Feb 8 09:55:52 2022 +0100 Merge tag 'ti-k3-dt-fixes-for-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/ti/linux into arm/fixes Device Tree fixes for TI K3 platform for v5.17 merge window * Update J721S2 platform to switch serial aliases to ttyS2. * tag 'ti-k3-dt-fixes-for-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/ti/linux: arm64: dts: ti: k3-j721s2-common-proc-board: Alias console uart to serial2 arm64: dts: ti: k3-j721s2: Move aliases to board dts Link: https://lore.kernel.org/r/20220204130716.fjlm4vvcbtzcwlwx@chalice Signed-off-by: Arnd Bergmann commit 724004a11a84ea762b03bc1822c40d977ae53f1c Author: Rob Herring Date: Thu Feb 3 18:41:17 2022 -0600 ARM: dts: spear320: Drop unused and undocumented 'irq-over-gpio' property The property 'irq-over-gpio' is both unused and undocumented. It also happens to collide with standard *-gpio properties. As it is not needed, drop it. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220204004117.1232902-1-robh@kernel.org' Signed-off-by: Arnd Bergmann commit 301a5d3ad2432d7829f59432ca0a93a6defbb9a1 Author: Jae Hyun Yoo Date: Tue Feb 1 17:31:18 2022 +1030 soc: aspeed: lpc-ctrl: Block error printing on probe defer cases Add a checking code when it gets -EPROBE_DEFER while getting a clock resource. In this case, it doesn't need to print out an error message because the probing will be re-visited. Signed-off-by: Jae Hyun Yoo Signed-off-by: Joel Stanley Reviewed-by: Andrew Jeffery Reviewed-by: Iwona Winiarska Link: https://lore.kernel.org/r/20211104173709.222912-1-jae.hyun.yoo@intel.com Link: https://lore.kernel.org/r/20220201070118.196372-1-joel@jms.id.au' Signed-off-by: Arnd Bergmann commit 088400521e421a1df7d0128dc0f9246db4ef1c7c Author: Chia-Wei Wang Date: Tue Feb 1 17:30:27 2022 +1030 docs/ABI: testing: aspeed-uart-routing: Escape asterisk Escape asterisk symbols to fix the following warning: "WARNING: Inline emphasis start-string without end-string" Fixes: c6807970c3bc ("soc: aspeed: Add UART routing support") Reported-by: Stephen Rothwell Signed-off-by: Chia-Wei Wang Signed-off-by: Joel Stanley Link: https://lore.kernel.org/r/20220124014351.9121-1-chiawei_wang@aspeedtech.com Link: https://lore.kernel.org/r/20220201070027.196314-1-joel@jms.id.au' Signed-off-by: Arnd Bergmann commit ebdd054ffa14ece5764365846f90fea3703c935f Merge: f8d1fc05e2881 442b0c08db7e3 Author: Arnd Bergmann Date: Tue Feb 8 09:52:04 2022 +0100 Merge tag 'samsung-fixes-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into arm/fixes Samsung fixes for v5.17 1. Typo in CONFIG_EXYNOS_USI description. 2. Add Alim Akhtar as a reviewer for Samsung Exynos platform. * tag 'samsung-fixes-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: soc: samsung: Fix typo in CONFIG_EXYNOS_USI description MAINTAINERS: add reviewer entry for Samsung/Exynos platform Link: https://lore.kernel.org/r/20220129115442.13474-1-krzysztof.kozlowski@canonical.com Signed-off-by: Arnd Bergmann commit f8d1fc05e2881fe3e466b212af7a2b67c2d88f8d Merge: cc0def5b4ed61 91f6d5f181f66 Author: Arnd Bergmann Date: Tue Feb 8 09:51:29 2022 +0100 Merge tag 'imx-fixes-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/fixes i.MX fixes for 5.17: - Fix sound card model for MBa8Mx board. - Drop i.MX8MQ LCDIF port node unit-address to fix DTC warning. - Add missing SD card detect line for imx6qdl-udoo board. - Remove MX23_PAD_SSP1_DETECT from imx23-evk hog group. It fixes the broken SD ard support on the board. - A couple of fixes from Martin Kepplinger to fix the MIPI_CSI port number on i.MX8MQ. - Re-enable ftm_alarm0 device on ls1028a-kontron-sl28 board which was disabled accidentally. - Fix 'assigned-clocks-parents' typo in i.MX7ULP watchdog device node. - Disable GPU device on imx8mn-venice-gw7902 board, as it uses MIMX8MN5CVTI SoC which does not integrate a GPU. * tag 'imx-fixes-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: arm64: dts: imx8mq: fix lcdif port node arm64: dts: imx8mq-librem5: fix mipi_csi1 port number to sensor arm64: dts: imx8mq: fix mipi_csi bidirectional port numbers ARM: dts: imx7ulp: Fix 'assigned-clocks-parents' typo arm64: dts: ls1028a: sl28: re-enable ftm_alarm0 arm64: dts: freescale: Fix sound card model for MBa8Mx ARM: dts: imx23-evk: Remove MX23_PAD_SSP1_DETECT from hog group ARM: dts: imx6qdl-udoo: Properly describe the SD card detect arm64: dts: imx8mn-venice-gw7902: disable gpu Link: https://lore.kernel.org/r/20220129073150.GZ4686@dragon Signed-off-by: Arnd Bergmann commit cc0def5b4ed61a262b88c67e6f8ed1a70c52c568 Merge: 78b390bd5657e 4064c461148ab Author: Arnd Bergmann Date: Tue Feb 8 09:48:43 2022 +0100 Merge tag 'optee-fixes-for-v5.17' of git://git.linaro.org/people/jens.wiklander/linux-tee into arm/fixes OP-TE fixes for v5.17 - Adds error checking in optee_ffa_do_call_with_arg() - Reintroduces an accidentally lost fix for a memref size check - Uses bitmap_free() to free memory obtained with bitmap_zalloc() * tag 'optee-fixes-for-v5.17' of git://git.linaro.org/people/jens.wiklander/linux-tee: optee: add error checks in optee_ffa_do_call_with_arg() tee: optee: do not check memref size on return from Secure World optee: Use bitmap_free() to free bitmap Link: https://lore.kernel.org/r/20220126102609.GA1516258@jade Signed-off-by: Arnd Bergmann commit 78b390bd5657e79f8e60b736f81ac1a3203777ea Merge: 7eabedfb29034 6dc701ee9fabf Author: Arnd Bergmann Date: Tue Feb 8 09:47:05 2022 +0100 Merge tag 'asahi-soc-maintainers-5.17' of https://github.com/AsahiLinux/linux into arm/fixes Apple SoC MAINTAINERS updates for 5.17. Adds the watchdog driver MAINTAINERS changes. The driver itself is already merged. This branch is based on asahi-soc-dt-5.17-v2 to avoid a merge conflict. * tag 'asahi-soc-maintainers-5.17' of https://github.com/AsahiLinux/linux: MAINTAINERS: Add Apple watchdog to ARM/APPLE MACHINE SUPPORT Link: https://lore.kernel.org/r/24ae6871-3e67-5c7f-2060-28048db439a2@marcan.st Signed-off-by: Arnd Bergmann commit c8ea23d5fa59f28302d4e3370c75d9c308e64410 Author: Zoltán Böszörményi Date: Fri Feb 4 13:57:50 2022 +0100 ata: libata-core: Disable TRIM on M88V29 This device is a CF card, or possibly an SSD in CF form factor. It supports NCQ and high speed DMA. While it also advertises TRIM support, I/O errors are reported when the discard mount option fstrim is used. TRIM also fails when disabling NCQ and not just as an NCQ command. TRIM must be disabled for this device. Signed-off-by: Zoltán Böszörményi Signed-off-by: Damien Le Moal commit 921d2eb09673af8e74aa11369a4de700e676a9c1 Author: Damien Le Moal Date: Tue Feb 8 15:16:09 2022 +0900 ata: sata_fsl: fix sscanf() and sysfs_emit() format strings Use the %u format for unsigned int parameters handling with sscanf() and sysfs_emit() to avoid compilation warnings. In fsl_sata_rx_watermark_store(), the call to sscanf() to parse a single argument is replaced with a call to kstrtouint(). While at it, also replace the printk(KERN_ERR) calls with dev_err() calls and fix blank lines in fsl_sata_rx_watermark_store(). Reported-by: kernel test robot Signed-off-by: Damien Le Moal commit 5852ed2a6a39c862c8a3fdf646e1f4e01b91d710 Author: James Smart Date: Mon Feb 7 10:04:42 2022 -0800 scsi: lpfc: Reduce log messages seen after firmware download Messages around firmware download were incorrectly tagged as being related to discovery trace events. Thus, firmware download status ended up dumping the trace log as well as the firmware update message. As there were a couple of log messages in this state, the trace log was dumped multiple times. Resolve this by converting from trace events to SLI events. Link: https://lore.kernel.org/r/20220207180442.72836-1-jsmart2021@gmail.com Reviewed-by: Ewan D. Milne Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit c80b27cfd93ba9f5161383f798414609e84729f3 Author: James Smart Date: Mon Feb 7 10:05:16 2022 -0800 scsi: lpfc: Remove NVMe support if kernel has NVME_FC disabled The driver is initiating NVMe PRLIs to determine device NVMe support. This should not be occurring if CONFIG_NVME_FC support is disabled. Correct this by changing the default value for FC4 support. Currently it defaults to FCP and NVMe. With change, when NVME_FC support is not enabled in the kernel, the default value is just FCP. Link: https://lore.kernel.org/r/20220207180516.73052-1-jsmart2021@gmail.com Reviewed-by: Ewan D. Milne Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 1cf5f151d25fcca94689efd91afa0253621fb33a Author: Nathan Chancellor Date: Wed Feb 2 16:05:16 2022 -0700 Makefile.extrawarn: Move -Wunaligned-access to W=1 -Wunaligned-access is a new warning in clang that is default enabled for arm and arm64 under certain circumstances within the clang frontend (see LLVM commit below). On v5.17-rc2, an ARCH=arm allmodconfig build shows 1284 total/70 unique instances of this warning (most of the instances are in header files), which is quite noisy. To keep a normal build green through CONFIG_WERROR, only show this warning with W=1, which will allow automated build systems to catch new instances of the warning so that the total number can be driven down to zero eventually since catching unaligned accesses at compile time would be generally useful. Cc: stable@vger.kernel.org Link: https://github.com/llvm/llvm-project/commit/35737df4dcd28534bd3090157c224c19b501278a Link: https://github.com/ClangBuiltLinux/linux/issues/1569 Link: https://github.com/ClangBuiltLinux/linux/issues/1576 Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Signed-off-by: Masahiro Yamada commit 8a4c5b2a6d8ea079fa36034e8167de87ab6f8880 Author: Brenda Streiff Date: Fri Jan 28 16:01:28 2022 -0600 kconfig: let 'shell' return enough output for deep path names The 'shell' built-in only returns the first 256 bytes of the command's output. In some cases, 'shell' is used to return a path; by bumping up the buffer size to 4096 this lets us capture up to PATH_MAX. The specific case where I ran into this was due to commit 1e860048c53e ("gcc-plugins: simplify GCC plugin-dev capability test"). After this change, we now use `$(shell,$(CC) -print-file-name=plugin)` to return a path; if the gcc path is particularly long, then the path ends up truncated at the 256 byte mark, which makes the HAVE_GCC_PLUGINS depends test always fail. Signed-off-by: Brenda Streiff Signed-off-by: Masahiro Yamada commit fe4f57bf7b585dca58f1496c4e2481ecbae18126 Author: Pavel Parkhomenko Date: Sat Feb 5 23:39:32 2022 +0300 net: phy: marvell: Fix RGMII Tx/Rx delays setting in 88e1121-compatible PHYs It is mandatory for a software to issue a reset upon modifying RGMII Receive Timing Control and RGMII Transmit Timing Control bit fields of MAC Specific Control register 2 (page 2, register 21) otherwise the changes won't be perceived by the PHY (the same is applicable for a lot of other registers). Not setting the RGMII delays on the platforms that imply it' being done on the PHY side will consequently cause the traffic loss. We discovered that the denoted soft-reset is missing in the m88e1121_config_aneg() method for the case if the RGMII delays are modified but the MDIx polarity isn't changed or the auto-negotiation is left enabled, thus causing the traffic loss on our platform with Marvell Alaska 88E1510 installed. Let's fix that by issuing the soft-reset if the delays have been actually set in the m88e1121_config_aneg_rgmii_delays() method. Cc: stable@vger.kernel.org Fixes: d6ab93364734 ("net: phy: marvell: Avoid unnecessary soft reset") Signed-off-by: Pavel Parkhomenko Reviewed-by: Russell King (Oracle) Reviewed-by: Serge Semin Link: https://lore.kernel.org/r/20220205203932.26899-1-Pavel.Parkhomenko@baikalelectronics.ru Signed-off-by: Jakub Kicinski commit 555f3d7be91a873114c9656069f1a9fa476ec41a Merge: 2ade8eef993c3 f9929ef6a2a55 Author: Linus Torvalds Date: Mon Feb 7 15:25:50 2022 -0800 Merge tag '5.17-rc3-ksmbd-server-fixes' of git://git.samba.org/ksmbd Pull ksmbd server fixes from Steve French: - NTLMSSP authentication improvement - RDMA (smbdirect) fix allowing broader set of NICs to be supported - improved buffer validation - additional small fixes, including a posix extensions fix for stable * tag '5.17-rc3-ksmbd-server-fixes' of git://git.samba.org/ksmbd: ksmbd: add support for key exchange ksmbd: reduce smb direct max read/write size ksmbd: don't align last entry offset in smb2 query directory ksmbd: fix same UniqueId for dot and dotdot entries ksmbd: smbd: validate buffer descriptor structures ksmbd: fix SMB 3.11 posix extension mount failure commit ea85bf906466191b58532bb19f4fbb4591f0a77e Author: Lorenzo Bianconi Date: Sat Feb 5 22:57:42 2022 +0100 iio: imu: st_lsm6dsx: wait for settling time in st_lsm6dsx_read_oneshot We need to wait for sensor settling time (~ 3/ODR) before reading data in st_lsm6dsx_read_oneshot routine in order to avoid corrupted samples. Fixes: 290a6ce11d93 ("iio: imu: add support to lsm6dsx driver") Reported-by: Mario Tesi Tested-by: Mario Tesi Signed-off-by: Lorenzo Bianconi Link: https://lore.kernel.org/r/b41ebda5535895298716c76d939f9f165fcd2d13.1644098120.git.lorenzo@kernel.org Cc: Signed-off-by: Jonathan Cameron commit 2ade8eef993c37a2a43e51a9b1f6c25509a2acce Merge: 51f7ea914d79a fda17afc6166e Author: Linus Torvalds Date: Mon Feb 7 12:10:35 2022 -0800 Merge tag 'ata-5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata Pull ata fix from Damien Le Moal: "A single patch from me, to fix a bug that is causing boot issues in the field (reports of problems with Fedora 35). The bug affects mostly old-ish drives that have issues with read log page command handling" * tag 'ata-5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata: ata: libata-core: Fix ata_dev_config_cpr() commit cb1f65c1e1424a4b5e4a86da8aa3b8fd8459c8ec Author: Rafael J. Wysocki Date: Fri Feb 4 18:35:22 2022 +0100 PM: s2idle: ACPI: Fix wakeup interrupts handling After commit e3728b50cd9b ("ACPI: PM: s2idle: Avoid possible race related to the EC GPE") wakeup interrupts occurring immediately after the one discarded by acpi_s2idle_wake() may be missed. Moreover, if the SCI triggers again immediately after the rearming in acpi_s2idle_wake(), that wakeup may be missed too. The problem is that pm_system_irq_wakeup() only calls pm_system_wakeup() when pm_wakeup_irq is 0, but that's not the case any more after the interrupt causing acpi_s2idle_wake() to run until pm_wakeup_irq is cleared by the pm_wakeup_clear() call in s2idle_loop(). However, there may be wakeup interrupts occurring in that time frame and if that happens, they will be missed. To address that issue first move the clearing of pm_wakeup_irq to the point at which it is known that the interrupt causing acpi_s2idle_wake() to tun will be discarded, before rearming the SCI for wakeup. Moreover, because that only reduces the size of the time window in which the issue may manifest itself, allow pm_system_irq_wakeup() to register two second wakeup interrupts in a row and, when discarding the first one, replace it with the second one. [Of course, this assumes that only one wakeup interrupt can be discarded in one go, but currently that is the case and I am not aware of any plans to change that.] Fixes: e3728b50cd9b ("ACPI: PM: s2idle: Avoid possible race related to the EC GPE") Cc: 5.4+ # 5.4+ Signed-off-by: Rafael J. Wysocki commit dc0075ba7f387fe4c48a8c674b11ab6f374a6acc Author: Rafael J. Wysocki Date: Fri Feb 4 18:31:02 2022 +0100 ACPI: PM: s2idle: Cancel wakeup before dispatching EC GPE Commit 4a9af6cac050 ("ACPI: EC: Rework flushing of EC work while suspended to idle") made acpi_ec_dispatch_gpe() check pm_wakeup_pending(), but that is before canceling the SCI wakeup, so pm_wakeup_pending() is always true. This causes the loop in acpi_ec_dispatch_gpe() to always terminate after one iteration which may not be correct. Address this issue by canceling the SCI wakeup earlier, from acpi_ec_dispatch_gpe() itself. Fixes: 4a9af6cac050 ("ACPI: EC: Rework flushing of EC work while suspended to idle") Signed-off-by: Rafael J. Wysocki commit d6ebb17ccc7b37872a32bc25b4a21f1e5af8c7e3 Author: Mario Limonciello Date: Fri Jan 28 14:35:03 2022 -0600 ACPI: PM: Revert "Only mark EC GPE for wakeup on Intel systems" Testing on various upcoming OEM systems shows commit 7b167c4cb48e ("ACPI: PM: Only mark EC GPE for wakeup on Intel systems") was short sighted and the symptoms were indicative of other problems. Some OEMs do have the dedicated GPIOs for the power button but also rely upon an interrupt to the EC SCI to let the lid work. The original commit showed spurious activity on Lenovo systems: * On both Lenovo T14 and P14s the keyboard wakeup doesn't work, and sometimes the power button event doesn't work. This was confirmed on my end at that time. However further development in the kernel showed that the issue was actually the IRQ for the GPIO controller was also shared with the EC SCI. This was actually fixed by commit 2d54067fcd23 ("pinctrl: amd: Fix wakeups when IRQ is shared with SCI"). The original commit also showed problems with AC adapter: * On HP 635 G7 detaching or attaching AC during suspend will cause the system not to wakeup * On Asus vivobook to prevent detaching AC causing resume problems * On Lenovo 14ARE05 to prevent detaching AC causing resume problems * On HP ENVY x360 to prevent detaching AC causing resume problems Detaching AC adapter causing problems appears to have been a problem because the EC SCI went off to notify the OS of the power adapter change but the SCI was ignored and there was no other way to wake up this system since GPIO controller wasn't properly enabled. The wakeups were fixed by enabling the GPIO controller in commit acd47b9f28e5 ("pinctrl: amd: Handle wake-up interrupt"). I've confirmed on a variety of OEM notebooks with the following test 1) echo 1 | sudo tee /sys/power/pm_debug_messages 2) sudo systemctl suspend 3) unplug AC adapter, make sure system is still asleep 4) wake system from lid (which is provided by ACPI SCI on some of them) 5) dmesg a) see the EC GPE dispatched, timekeeping for X seconds (matching ~time until AC adapter plug out) b) see timekeeping for Y seconds until woke (matching ~time from AC adapter until lid event) 6) Look at /sys/kernel/debug/amd_pmc/s0ix_stats "Time (in us) in S0i3" = X + Y - firmware processing time Signed-off-by: Mario Limonciello Tested-by: Kai-Heng Feng Signed-off-by: Rafael J. Wysocki commit 51f7ea914d79aa44156dd63fe9e1cc75708d781d Merge: c8ba56b7e8f3c bd2db32e7c3e3 Author: Linus Torvalds Date: Mon Feb 7 11:51:14 2022 -0800 Merge tag 'mmc-v5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc Pull MMC fixes from Ulf Hansson: "MMC core: - Fix support for SD Power off notification MMC host: - moxart: Fix potential use-after-free on remove path - sdhci-of-esdhc: Fix error path when setting dma mask - sh_mmcif: Fix potential NULL pointer dereference" * tag 'mmc-v5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: moxart: fix potential use-after-free on remove path mmc: core: Wait for command setting 'Power Off Notification' bit to complete mmc: sh_mmcif: Check for null res pointer mmc: sdhci-of-esdhc: Check for error num after setting mask commit 6bf625a4140f24b490766043b307f8252519578b Author: Michael Kelley Date: Sun Feb 6 11:36:56 2022 -0800 Drivers: hv: vmbus: Rework use of DMA_BIT_MASK(64) Using DMA_BIT_MASK(64) as an initializer for a global variable causes problems with Clang 12.0.1. The compiler doesn't understand that value 64 is excluded from the shift at compile time, resulting in a build error. While this is a compiler problem, avoid the issue by setting up the dma_mask memory as part of struct hv_device, and initialize it using dma_set_mask(). Reported-by: Nathan Chancellor Reported-by: Vitaly Chikunov Reported-by: Jakub Kicinski Fixes: 743b237c3a7b ("scsi: storvsc: Add Isolation VM support for storvsc driver") Signed-off-by: Michael Kelley Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor Link: https://lore.kernel.org/r/1644176216-12531-1-git-send-email-mikelley@microsoft.com Signed-off-by: Wei Liu commit c8ba56b7e8f3ca4d86c556f5498e4faeb6d139ec Merge: dfd42facf1e4a 89677197ae709 Author: Linus Torvalds Date: Mon Feb 7 09:55:14 2022 -0800 Merge tag 'integrity-v5.17-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity Pull integrity fixes from Mimi Zohar: "Fixes for recently found bugs. One was found/noticed while reviewing IMA support for fsverity digests and signatures. Two of them were found/noticed while working on IMA namespacing. Plus two other bugs. All of them are for previous kernel releases" * tag 'integrity-v5.17-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity: ima: Do not print policy rule with inactive LSM labels ima: Allow template selection with ima_template[_fmt]= after ima_hash= ima: Remove ima_policy file before directory integrity: check the return value of audit_log_start() ima: fix reference leak in asymmetric_verify() commit 8bc69f86328e87a0ffa79438430cc82f3aa6a194 Author: Miaoqian Lin Date: Fri Feb 4 01:30:08 2022 +0800 Drivers: hv: vmbus: Fix memory leak in vmbus_add_channel_kobj kobject_init_and_add() takes reference even when it fails. According to the doc of kobject_init_and_add(): If this function returns an error, kobject_put() must be called to properly clean up the memory associated with the object. Fix memory leak by calling kobject_put(). Fixes: c2e5df616e1a ("vmbus: add per-channel sysfs info") Signed-off-by: Miaoqian Lin Reviewed-by: Juan Vazquez Link: https://lore.kernel.org/r/20220203173008.43480-1-linmq006@gmail.com Signed-off-by: Wei Liu commit 7eabedfb2903493d2601fd224f1e027cd1860fa0 Merge: 486343d3728be e6b03375132fe Author: Arnd Bergmann Date: Mon Feb 7 17:45:06 2022 +0100 Merge branch 'v5.17/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux into arm/fixes * 'v5.17/fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux: arm64: dts: meson-sm1-odroid: fix boot loop after reboot arm64: dts: meson-g12: drop BL32 region from SEI510/SEI610 arm64: dts: meson-g12: add ATF BL32 reserved-memory region arm64: dts: meson-gx: add ATF BL32 reserved-memory region arm64: dts: meson-sm1-bananapi-m5: fix wrong GPIO domain for GPIOE_2 arm64: dts: meson-sm1-odroid: use correct enable-gpio pin for tf-io regulator arm64: dts: meson-g12b-odroid-n2: fix typo 'dio2133' Link: https://lore.kernel.org/r/67888f6a-f4ff-9569-131a-0c7baba6ddaf@baylibre.com Signed-off-by: Arnd Bergmann commit 486343d3728be741db13854dc7e983c20cdd7c07 Merge: 63a8728579a8d 31aa7056bbec0 Author: Arnd Bergmann Date: Mon Feb 7 17:42:43 2022 +0100 Merge tag 'omap-for-v5.17/fixes-for-merge-window-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into arm/fixes Fixes for omaps A series of fixes for omap variants for minor issues, and a fix for a timer regression for some omap3 beagleboard versions. The timer fix needs to patch both the dts and the timer code because otherwise the timer quirk handling for old dtbs will prevent the dts fix from working. The other changes are for issues found by automated analysis, a macasp typo fix, and two cosmetic fixes for clocks. * tag 'omap-for-v5.17/fixes-for-merge-window-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: dts: Don't use legacy clock defines for dra7 clkctrl clk: ti: Move dra7 clock devices out of the legacy section ARM: dts: Fix timer regression for beagleboard revision c ARM: dts: am335x-wega: Fix typo in mcasp property rx-num-evt ARM: OMAP2+: adjust the location of put_device() call in omapdss_init_of ARM: OMAP2+: hwmod: Add of_node_put() before break Link: https://lore.kernel.org/r/pull-1641801310-149268@atomide.com Signed-off-by: Arnd Bergmann commit 0a3f1e0beacf6cc8ae5f846b0641c1df476e83d6 Author: Shakeel Butt Date: Mon Jan 24 21:17:36 2022 -0800 mm: io_uring: allow oom-killer from io_uring_setup On an overcommitted system which is running multiple workloads of varying priorities, it is preferred to trigger an oom-killer to kill a low priority workload than to let the high priority workload receiving ENOMEMs. On our memory overcommitted systems, we are seeing a lot of ENOMEMs instead of oom-kills because io_uring_setup callchain is using __GFP_NORETRY gfp flag which avoids the oom-killer. Let's remove it and allow the oom-killer to kill a lower priority job. Signed-off-by: Shakeel Butt Link: https://lore.kernel.org/r/20220125051736.2981459-1-shakeelb@google.com Signed-off-by: Jens Axboe commit 0d7c1153d9291197c1dc473cfaade77acb874b4b Author: Alviro Iskandar Setiawan Date: Mon Feb 7 21:05:33 2022 +0700 io_uring: Clean up a false-positive warning from GCC 9.3.0 In io_recv(), if import_single_range() fails, the @flags variable is uninitialized, then it will goto out_free. After the goto, the compiler doesn't know that (ret < min_ret) is always true, so it thinks the "if ((flags & MSG_WAITALL) ..." path could be taken. The complaint comes from gcc-9 (Debian 9.3.0-22) 9.3.0: ``` fs/io_uring.c:5238 io_recvfrom() error: uninitialized symbol 'flags' ``` Fix this by bypassing the @ret and @flags check when import_single_range() fails. Reasons: 1. import_single_range() only returns -EFAULT when it fails. 2. At that point, @flags is uninitialized and shouldn't be read. Reported-by: kernel test robot Reported-by: Dan Carpenter Reported-by: "Chen, Rong A" Link: https://lore.gnuweeb.org/timl/d33bb5a9-8173-f65b-f653-51fc0681c6d6@intel.com/ Cc: Pavel Begunkov Suggested-by: Ammar Faizi Fixes: 7297ce3d59449de49d3c9e1f64ae25488750a1fc ("io_uring: improve send/recv error handling") Signed-off-by: Alviro Iskandar Setiawan Signed-off-by: Ammar Faizi Link: https://lore.kernel.org/r/20220207140533.565411-1-ammarfaizi2@gnuweeb.org Signed-off-by: Jens Axboe commit 18a1d5e1945385d9b5adc3fe11427ce4a9d2826e Author: Andy Shevchenko Date: Mon Feb 7 17:16:39 2022 +0200 parisc: Add ioread64_lo_hi() and iowrite64_lo_hi() It's a followup to the previous commit f15309d7ad5d ("parisc: Add ioread64_hi_lo() and iowrite64_hi_lo()") which does only half of the job. Add the rest, so we won't get a new kernel test robot reports. Fixes: f15309d7ad5d ("parisc: Add ioread64_hi_lo() and iowrite64_hi_lo()") Signed-off-by: Andy Shevchenko Signed-off-by: Helge Deller commit 63a8728579a8dc2cf3af6a56689eb1078a9946a5 Merge: 60f40305529b3 aceeafefff736 Author: Arnd Bergmann Date: Mon Feb 7 16:10:59 2022 +0100 Merge tag 'optee-fix-for-v5.17' of git://git.linaro.org/people/jens.wiklander/linux-tee into arm/fixes OP-TEE fix shutdown problems * tag 'optee-fix-for-v5.17' of git://git.linaro.org/people/jens.wiklander/linux-tee: optee: use driver internal tee_context for some rpc Link: https://lore.kernel.org/r/20220203132323.GA4132001@jade Signed-off-by: Arnd Bergmann commit 9495b9b31abe525ebd93da58de2c88b9f66d3a0e Author: Eric Anholt Date: Fri Feb 23 22:42:31 2018 +0100 i2c: bcm2835: Avoid clock stretching timeouts The CLKT register contains at poweron 0x40, which at our typical 100kHz bus rate means .64ms. But there is no specified limit to how long devices should be able to stretch the clocks, so just disable the timeout. We still have a timeout wrapping the entire transfer. Signed-off-by: Eric Anholt Signed-off-by: Stefan Wahren BugLink: https://github.com/raspberrypi/linux/issues/3064 Signed-off-by: Wolfram Sang commit 60f40305529b38d6c3903bd833dc25e39b94e5b6 Author: Philippe Cornu Date: Thu Jan 13 18:19:21 2022 +0100 MAINTAINERS: update drm/stm drm/sti and cec/sti maintainers Add Alain as sti maintainer for both drm/sti & cec/sti. Add Raphaël as stm maintainer for drm/stm. Signed-off-by: Philippe Cornu Reviewed-by: Raphael Gallais-Pou Reviewed-by: Alain Volmat Link: https://lore.kernel.org/r/20220113171921.17466-3-philippe.cornu@foss.st.com' Signed-off-by: Arnd Bergmann commit bf5bdcc9f262b5afd3c0f06c39b34b4f2fcff661 Author: Benjamin Gaignard Date: Thu Jan 13 18:19:20 2022 +0100 MAINTAINERS: Update Benjamin Gaignard maintainer status Update Benjamin Gaignard address and remove it from no more maintained drivers. Signed-off-by: Benjamin Gaignard Reviewed-by: Philippe Cornu Link: https://lore.kernel.org/r/20220113171921.17466-2-philippe.cornu@foss.st.com' Signed-off-by: Arnd Bergmann commit fda17afc6166e975bec1197bd94cd2a3317bce3f Author: Damien Le Moal Date: Mon Feb 7 11:27:53 2022 +0900 ata: libata-core: Fix ata_dev_config_cpr() The concurrent positioning ranges log page 47h is a general purpose log page and not a subpage of the indentify device log. Using ata_identify_page_supported() to test for concurrent positioning ranges support is thus wrong. ata_log_supported() must be used. Furthermore, unlike other advanced ATA features (e.g. NCQ priority), accesses to the concurrent positioning ranges log page are not gated by a feature bit from the device IDENTIFY data. Since many older drives react badly to the READ LOG EXT and/or READ LOG DMA EXT commands isued to read device log pages, avoid problems with older drives by limiting the concurrent positioning ranges support detection to drives implementing at least the ACS-4 ATA standard (major version 11). This additional condition effectively turns ata_dev_config_cpr() into a nop for older drives, avoiding problems in the field. Fixes: fe22e1c2f705 ("libata: support concurrent positioning ranges log") BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=215519 Cc: stable@vger.kernel.org Reviewed-by: Hannes Reinecke Tested-by: Abderraouf Adjal Signed-off-by: Damien Le Moal commit 200e8e3e43c4da4bd5ca83722523754ddb14ca02 Author: Hans de Goede Date: Mon Feb 7 14:04:07 2022 +0100 drm/privacy-screen: Fix sphinx warning Fix the following warning from "make htmldocs": drivers/gpu/drm/drm_privacy_screen.c:270: WARNING: Inline emphasis start-string without end-string. Fixes: 8a12b170558a ("drm/privacy-screen: Add notifier support (v2)") Reported-by: Stephen Rothwell Signed-off-by: Hans de Goede Reviewed-by: Simon Ser Link: https://lore.kernel.org/r/20220207130407.389585-1-hdegoede@redhat.com Link: https://patchwork.freedesktop.org/patch/msgid/20220207130407.389585-1-hdegoede@redhat.com commit 4e6f55120c7eccf6f9323bb681632e23cbcb3f3c Author: Ville Syrjälä Date: Fri Feb 4 16:18:18 2022 +0200 drm/i915: Workaround broken BIOS DBUF configuration on TGL/RKL On TGL/RKL the BIOS likes to use some kind of bogus DBUF layout that doesn't match what the spec recommends. With a single active pipe that is not going to be a problem, but with multiple pipes active skl_commit_modeset_enables() goes into an infinite loop since it can't figure out any order in which it can commit the pipes without causing DBUF overlaps between the planes. We'd need some kind of extra DBUF defrag stage in between to make the transition possible. But that is clearly way too complex a solution, so in the name of simplicity let's just sanitize the DBUF state by simply turning off all planes when we detect a pipe encroaching on its neighbours' DBUF slices. We only have to disable the primary planes as all other planes should have already been disabled (if they somehow were enabled) by earlier sanitization steps. And for good measure let's also sanitize in case the DBUF allocations of the pipes already seem to overlap each other. Cc: # v5.14+ Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/4762 Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220204141818.1900-3-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy (cherry picked from commit 15512021eb3975a8c2366e3883337e252bb0eee5) Signed-off-by: Tvrtko Ursulin commit 85bb289215cf37e05e9581b39b114db1293f9ecd Author: Ville Syrjälä Date: Fri Feb 4 16:18:17 2022 +0200 drm/i915: Populate pipe dbuf slices more accurately during readout During readout we cannot assume the planes are actually using the slices they are supposed to use. The BIOS may have misprogrammed things and put the planes onto the wrong dbuf slices. So let's do the readout more carefully to make sure we really know which dbuf slices are actually in use by the pipe at the time. Cc: # v5.14+ Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220204141818.1900-2-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy (cherry picked from commit b3dcc6dc0f32612d04839c2fb32e94d0ebf92c98) Signed-off-by: Tvrtko Ursulin commit 8fd5a26e43859547790a7995494c952b708ab3b5 Author: Ville Syrjälä Date: Fri Feb 4 16:18:16 2022 +0200 drm/i915: Allow !join_mbus cases for adlp+ dbuf configuration Reintroduce the !join_mbus single pipe cases for adlp+. Due to the mbus relative dbuf offsets in PLANE_BUF_CFG we need to know the actual slices used by the pipe when doing readout, even when mbus joining isn't enabled. Accurate readout will be needed to properly sanitize invalid BIOS dbuf configurations. This will also make it much easier to play around with the !join_mbus configs for testin/workaround purposes. Cc: # v5.14+ Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220204141818.1900-1-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy (cherry picked from commit eef173954432fe0612acb63421a95deb41155cdc) Signed-off-by: Tvrtko Ursulin commit 9d7516b16f2a7ecbddd7940e582c78fcdc9136ef Author: Lucas De Marchi Date: Mon Jan 31 08:59:25 2022 -0800 drm/i915: Fix header test for !CONFIG_X86 Architectures others than x86 have a stub implementation calling WARN_ON_ONCE(). The appropriate headers need to be included, otherwise the header-test target will fail with: HDRTEST drivers/gpu/drm/i915/i915_mm.h In file included from : ./drivers/gpu/drm/i915/i915_mm.h: In function ‘remap_io_mapping’: ./drivers/gpu/drm/i915/i915_mm.h:26:2: error: implicit declaration of function ‘WARN_ON_ONCE’ [-Werror=implicit-function-declaration] 26 | WARN_ON_ONCE(1); | ^~~~~~~~~~~~ v2: Do not include since call to pr_err() has been removed Fixes: 67c430bbaae1 ("drm/i915: Skip remap_io_mapping() for non-x86 platforms") Cc: Siva Mullati Signed-off-by: Lucas De Marchi Reviewed-by: Siva Mullati Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20220131165926.3230642-3-lucas.demarchi@intel.com (cherry picked from commit 377c675f3c17ffaefd023ee283bb366bbd6bbcea) Signed-off-by: Tvrtko Ursulin commit 3526b607b02397cdb6d459594e4f1d63133d6655 Author: Thomas Hellström Date: Tue Feb 1 08:03:40 2022 +0100 drm/i915/ttm: Return some errors instead of trying memcpy move The i915_ttm_accel_move() function may return error codes that should be propagated further up the stack rather than consumed assuming that the accel move failed and could be replaced with a memcpy move. For -EINTR, -ERESTARTSYS and -EAGAIN, just propagate those codes, rather than retrying with a memcpy move. Fixes: 2b0a750caf33 ("drm/i915/ttm: Failsafe migration blits") Cc: Matthew Auld Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20220201070340.16457-1-thomas.hellstrom@linux.intel.com (cherry picked from commit 29b9702ffe70d83b9970abbccaeb287dfda4409f) Signed-off-by: Tvrtko Ursulin commit ee59792c97176f12c1da31f29fc4c2aab187f06e Author: Ville Syrjälä Date: Fri Jan 28 12:37:50 2022 +0200 drm/i915: Disable DRRS on IVB/HSW port != A Currently we allow DRRS on IVB PCH ports, but we're missing a few programming steps meaning it is guaranteed to not work. And on HSW DRRS is not supported on anything but port A ever as only transcoder EDP has the M2/N2 registers (though I'm not sure if HSW ever has eDP on any other port). Starting from BDW all transcoders have the dynamically reprogrammable M/N registers so DRRS could work on any port. Stop initializing DRRS on ports where it cannot possibly work. Cc: stable@vger.kernel.org Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220128103757.22461-11-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula (cherry picked from commit f0d4ce59f4d48622044933054a0e0cefa91ba15e) Signed-off-by: Tvrtko Ursulin commit eb48d42198792f1330bbb3e82ac725d43c13fe02 Author: Ville Syrjälä Date: Wed Jan 26 10:15:38 2022 +0200 drm/i915: Fix oops due to missing stack depot We call __save_depot_stack() unconditionally so the stack depot must always be initialized or else we'll oops on platforms without runtime pm support. Presumably we've not seen this in CI due to stack_depot_init() already getting called via drm_mm_init()+CONFIG_DRM_DEBUG_MM. Cc: Vlastimil Babka Cc: Dmitry Vyukov Cc: Marco Elver # stackdepot Cc: Chris Wilson Cc: Imre Deak Fixes: 2dba5eb1c73b ("lib/stackdepot: allow optional init and stack_table allocation by kvmalloc()") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220126081539.23227-1-ville.syrjala@linux.intel.com Acked-by: Vlastimil Babka Reviewed-by: Imre Deak (cherry picked from commit 751a9d69b19702af35b0fedfb8ff362027c1cf0c) Signed-off-by: Tvrtko Ursulin commit 94fdd7c02a56d0316d20e417a1141b71a8dcee82 Author: Eric Dumazet Date: Sun Feb 6 06:33:48 2022 -0800 net/smc: use GFP_ATOMIC allocation in smc_pnet_add_eth() My last patch moved the netdev_tracker_alloc() call to a section protected by a write_lock(). I should have replaced GFP_KERNEL with GFP_ATOMIC to avoid the infamous: BUG: sleeping function called from invalid context at include/linux/sched/mm.h:256 Fixes: 28f922213886 ("net/smc: fix ref_tracker issue in smc_pnet_add()") Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit fc764b103b81ebe88f69f9ae4f116551ab8cfc5d Author: Maxime Ripard Date: Thu Feb 3 16:11:51 2022 +0100 drm/vc4: crtc: Fix redundant variable assignment The variable is assigned twice to the same value. Let's drop one. Reported-by: kernel test robot Signed-off-by: Maxime Ripard Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20220203151151.1270461-1-maxime@cerno.tech commit 3037b174b1876aae6b2d1a27a878c681c78ccadc Author: Krzysztof Kozlowski Date: Mon Feb 7 09:44:04 2022 +0100 ARM: socfpga: fix missing RESET_CONTROLLER The SocFPGA machine since commit b3ca9888f35f ("reset: socfpga: add an early reset driver for SoCFPGA") uses reset controller, so it should select RESET_CONTROLLER explicitly. Selecting ARCH_HAS_RESET_CONTROLLER is not enough because it affects only default choice still allowing a non-buildable configuration: /usr/bin/arm-linux-gnueabi-ld: arch/arm/mach-socfpga/socfpga.o: in function `socfpga_init_irq': arch/arm/mach-socfpga/socfpga.c:56: undefined reference to `socfpga_reset_init' Reported-by: kernel test robot Cc: Fixes: b3ca9888f35f ("reset: socfpga: add an early reset driver for SoCFPGA") Signed-off-by: Krzysztof Kozlowski Signed-off-by: Dinh Nguyen commit 9bb162fa26ed76031ed0e7dbc77ccea0bf977758 Author: Christophe Leroy Date: Tue Dec 7 06:10:05 2021 +0000 powerpc/603: Fix boot failure with DEBUG_PAGEALLOC and KFENCE Allthough kernel text is always mapped with BATs, we still have inittext mapped with pages, so TLB miss handling is required when CONFIG_DEBUG_PAGEALLOC or CONFIG_KFENCE is set. The final solution should be to set a BAT that also maps inittext but that BAT then needs to be cleared at end of init, and it will require more changes to be able to do it properly. As DEBUG_PAGEALLOC or KFENCE are debugging, performance is not a big deal so let's fix it simply for now to enable easy stable application. Fixes: 035b19a15a98 ("powerpc/32s: Always map kernel text and rodata with BATs") Cc: stable@vger.kernel.org # v5.11+ Reported-by: Maxime Bizon Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/aea33b4813a26bdb9378b5f273f00bd5d4abe240.1638857364.git.christophe.leroy@csgroup.eu commit d0cbe56a7d5ac170f6cf3757ef5a14dd854e7da9 Author: Steve French Date: Sun Feb 6 18:59:57 2022 -0600 [smb3] improve error message when mount options conflict with posix POSIX extensions require SMB3.1.1 (so improve the error message when vers=3.0, 2.1 or 2.0 is specified on mount) Signed-off-by: Steve French commit e286f231eab410793f3e91c924e6dbd23edee05a Author: Ilya Leoshkevich Date: Mon Jan 31 14:17:11 2022 +0100 s390/module: fix building test_modules_helpers.o with clang Move test_modules_return_* prototypes into a header file in order to placate -Wmissing-prototypes. Fixes: 90c5318795ee ("s390/module: test loading modules with a lot of relocations") Reported-by: kernel test robot Reviewed-by: Heiko Carstens Signed-off-by: Ilya Leoshkevich Signed-off-by: Vasily Gorbik commit 72fc40931d7a488e1646d04f988f4d5a97b02100 Author: Christian Borntraeger Date: Thu Jan 27 15:24:49 2022 +0100 MAINTAINERS: downgrade myself to Reviewer for s390 Now that Alexander Gordeev has volunteered to be a co-maintainer for s390, I can act as a reviewer instead of being a maintainer for s390. With Alexander, Heiko, and Vasily we are in really good shape. I will continue to act as the maintainer for KVM on s390 together with Janosch. Signed-off-by: Christian Borntraeger Acked-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 4f9e67f5e03ab92ecbe51399a8cc55968106e8f9 Author: Heiko Carstens Date: Thu Jan 27 15:06:31 2022 +0100 MAINTAINERS: add Alexander Gordeev as maintainer for s390 Change Alexander Gordeev's status so he is maintainer instead of reviewer for s390. Acked-by: Alexander Gordeev Acked-by: Christian Borntraeger Acked-by: Sven Schnelle Acked-by: Vasily Gorbik Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik commit 5f4e5ce638e6a490b976ade4a40017b40abb2da0 Author: Song Liu Date: Thu Feb 3 16:40:57 2022 -0800 perf: Fix list corruption in perf_cgroup_switch() There's list corruption on cgrp_cpuctx_list. This happens on the following path: perf_cgroup_switch: list_for_each_entry(cgrp_cpuctx_list) cpu_ctx_sched_in ctx_sched_in ctx_pinned_sched_in merge_sched_in perf_cgroup_event_disable: remove the event from the list Use list_for_each_entry_safe() to allow removing an entry during iteration. Fixes: 058fe1c0440e ("perf/core: Make cgroup switch visit only cpuctxs with cgroup events") Signed-off-by: Song Liu Reviewed-by: Rik van Riel Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220204004057.2961252-1-song@kernel.org commit 13765de8148f71fa795e0a6607de37c49ea5915a Author: Tadeusz Struk Date: Thu Feb 3 08:18:46 2022 -0800 sched/fair: Fix fault in reweight_entity Syzbot found a GPF in reweight_entity. This has been bisected to commit 4ef0c5c6b5ba ("kernel/sched: Fix sched_fork() access an invalid sched_task_group") There is a race between sched_post_fork() and setpriority(PRIO_PGRP) within a thread group that causes a null-ptr-deref in reweight_entity() in CFS. The scenario is that the main process spawns number of new threads, which then call setpriority(PRIO_PGRP, 0, -20), wait, and exit. For each of the new threads the copy_process() gets invoked, which adds the new task_struct and calls sched_post_fork() for it. In the above scenario there is a possibility that setpriority(PRIO_PGRP) and set_one_prio() will be called for a thread in the group that is just being created by copy_process(), and for which the sched_post_fork() has not been executed yet. This will trigger a null pointer dereference in reweight_entity(), as it will try to access the run queue pointer, which hasn't been set. Before the mentioned change the cfs_rq pointer for the task has been set in sched_fork(), which is called much earlier in copy_process(), before the new task is added to the thread_group. Now it is done in the sched_post_fork(), which is called after that. To fix the issue the remove the update_load param from the update_load param() function and call reweight_task() only if the task flag doesn't have the TASK_NEW flag set. Fixes: 4ef0c5c6b5ba ("kernel/sched: Fix sched_fork() access an invalid sched_task_group") Reported-by: syzbot+af7a719bc92395ee41b3@syzkaller.appspotmail.com Signed-off-by: Tadeusz Struk Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Dietmar Eggemann Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20220203161846.1160750-1-tadeusz.struk@linaro.org commit dfd42facf1e4ada021b939b4e19c935dcdd55566 Author: Linus Torvalds Date: Sun Feb 6 12:20:50 2022 -0800 Linux 5.17-rc3 commit d8ad2ce873abab1cfd38779c626b79cef6307aac Merge: 18118a4298fd7 f340b3d902748 Author: Linus Torvalds Date: Sun Feb 6 10:34:45 2022 -0800 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: "Various bug fixes for ext4 fast commit and inline data handling. Also fix regression introduced as part of moving to the new mount API" * tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: fs/ext4: fix comments mentioning i_mutex ext4: fix incorrect type issue during replay_del_range jbd2: fix kernel-doc descriptions for jbd2_journal_shrink_{scan,count}() ext4: fix potential NULL pointer dereference in ext4_fill_super() jbd2: refactor wait logic for transaction updates into a common function jbd2: cleanup unused functions declarations from jbd2.h ext4: fix error handling in ext4_fc_record_modified_inode() ext4: remove redundant max inline_size check in ext4_da_write_inline_data_begin() ext4: fix error handling in ext4_restore_inline_data() ext4: fast commit may miss file actions ext4: fast commit may not fallback for ineligible commit ext4: modify the logic of ext4_mb_new_blocks_simple ext4: prevent used blocks from being allocated during fast commit replay commit 18118a4298fd7b0d686ef61be6f2622a77f51b96 Merge: c3bf8a14408ad fceb62124d8fe Author: Linus Torvalds Date: Sun Feb 6 10:18:23 2022 -0800 Merge tag 'perf-tools-fixes-for-v5.17-2022-02-06' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux Pull perf tools fixes from Arnaldo Carvalho de Melo: - Fix display of grouped aliased events in 'perf stat'. - Add missing branch_sample_type to perf_event_attr__fprintf(). - Apply correct label to user/kernel symbols in branch mode. - Fix 'perf ftrace' system_wide tracing, it has to be set before creating the maps. - Return error if procfs isn't mounted for PID namespaces when synthesizing records for pre-existing processes. - Set error stream of objdump process for 'perf annotate' TUI, to avoid garbling the screen. - Add missing arm64 support to perf_mmap__read_self(), the kernel part got into 5.17. - Check for NULL pointer before dereference writing debug info about a sample. - Update UAPI copies for asound, perf_event, prctl and kvm headers. - Fix a typo in bpf_counter_cgroup.c. * tag 'perf-tools-fixes-for-v5.17-2022-02-06' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: perf ftrace: system_wide collection is not effective by default libperf: Add arm64 support to perf_mmap__read_self() tools include UAPI: Sync sound/asound.h copy with the kernel sources perf stat: Fix display of grouped aliased events perf tools: Apply correct label to user/kernel symbols in branch mode perf bpf: Fix a typo in bpf_counter_cgroup.c perf synthetic-events: Return error if procfs isn't mounted for PID namespaces perf session: Check for NULL pointer before dereference perf annotate: Set error stream of objdump process for TUI perf tools: Add missing branch_sample_type to perf_event_attr__fprintf() tools headers UAPI: Sync linux/kvm.h with the kernel sources tools headers UAPI: Sync linux/prctl.h with the kernel sources perf beauty: Make the prctl arg regexp more strict to cope with PR_SET_VMA tools headers cpufeatures: Sync with the kernel sources tools headers UAPI: Sync linux/perf_event.h with the kernel sources tools include UAPI: Sync sound/asound.h copy with the kernel sources commit c3bf8a14408ad2b84fe48246fa66d1459480ee6b Merge: aeabe1e0744d1 1d9093457b243 Author: Linus Torvalds Date: Sun Feb 6 10:11:14 2022 -0800 Merge tag 'perf_urgent_for_v5.17_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull perf fixes from Borislav Petkov: - Intel/PT: filters could crash the kernel - Intel: default disable the PMU for SMM, some new-ish EFI firmware has started using CPL3 and the PMU CPL filters don't discriminate against SMM, meaning that CPL3 (userspace only) events now also count EFI/SMM cycles. - Fixup for perf_event_attr::sig_data * tag 'perf_urgent_for_v5.17_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/x86/intel/pt: Fix crash with stop filters in single-range mode perf: uapi: Document perf_event_attr::sig_data truncation on 32 bit architectures selftests/perf_events: Test modification of perf_event_attr::sig_data perf: Copy perf_event_attr::sig_data on modification x86/perf: Default set FREEZE_ON_SMI for all commit aeabe1e0744d1794246a909d2c042e9129fe22bd Merge: b72e40b192f21 82880283d7fcd Author: Linus Torvalds Date: Sun Feb 6 10:04:43 2022 -0800 Merge tag 'objtool_urgent_for_v5.17_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull objtool fix from Borislav Petkov: "Fix a potential truncated string warning triggered by gcc12" * tag 'objtool_urgent_for_v5.17_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: objtool: Fix truncated string warning commit b72e40b192f21f172a152ecb5905d22928bea2a3 Merge: 898b5841ae37c dd7f5a11ac5a6 Author: Linus Torvalds Date: Sun Feb 6 10:00:40 2022 -0800 Merge tag 'irq_urgent_for_v5.17_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull irq fix from Borislav Petkov: "Remove a bogus warning introduced by the recent PCI MSI irq affinity overhaul" * tag 'irq_urgent_for_v5.17_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: PCI/MSI: Remove bogus warning in pci_irq_get_affinity() commit 898b5841ae37c8a7297214b7fd001d4c0f6fd89d Merge: 90c9e950c0def dfd0dfb9a7cc0 Author: Linus Torvalds Date: Sun Feb 6 09:57:39 2022 -0800 Merge tag 'edac_urgent_for_v5.17_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras Pull EDAC fixes from Borislav Petkov: "Fix altera and xgene EDAC drivers to propagate the correct error code from platform_get_irq() so that deferred probing still works" * tag 'edac_urgent_for_v5.17_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras: EDAC/xgene: Fix deferred probing EDAC/altera: Fix deferred probing commit fceb62124d8fe1f6fb4b64e8f11c095dca8e7ea7 Author: Changbin Du Date: Thu Jan 27 21:20:10 2022 +0800 perf ftrace: system_wide collection is not effective by default The ftrace.target.system_wide must be set before invoking evlist__create_maps(), otherwise it has no effect. Fixes: 53be50282269b46c ("perf ftrace: Add 'latency' subcommand") Signed-off-by: Changbin Du Acked-by: Namhyung Kim Cc: Ingo Molnar Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220127132010.4836-1-changbin.du@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit 05daa805a86c831ad9692f6f15e1b877c8f10638 Author: Slark Xiao Date: Sat Feb 5 19:27:31 2022 +0530 bus: mhi: pci_generic: Add mru_default for Cinterion MV31-W For default mechanism, product would use default MRU 3500 if they didn't define it. But for Cinterion MV31-W, there is a known issue which MRU 3500 would lead to data connection lost. So we align it with Qualcomm default MRU settings. Link: https://lore.kernel.org/r/20220119102519.5342-1-slark_xiao@163.com [mani: Modified the commit message to reflect Cinterion MV31-W and CCed stable] Fixes: 87693e092bd0 ("bus: mhi: pci_generic: Add Cinterion MV31-W PCIe to MHI") Cc: stable@vger.kernel.org # v5.14 + Reviewed-by: Manivannan Sadhasivam Signed-off-by: Slark Xiao Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20220205135731.157871-3-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit a0572cea8866230ac13da6358c88075f89e99b20 Author: Slark Xiao Date: Sat Feb 5 19:27:30 2022 +0530 bus: mhi: pci_generic: Add mru_default for Foxconn SDX55 For default mechanism, product would use default MRU 3500 if they didn't define it. But for Foxconn SDX55, there is a known issue which MRU 3500 would lead to data connection lost. So we align it with Qualcomm default MRU settings. Link: https://lore.kernel.org/r/20220119101213.5008-1-slark_xiao@163.com [mani: Added pci_generic prefix to subject and CCed stable] Fixes: aac426562f56 ("bus: mhi: pci_generic: Introduce Foxconn T99W175 support") Cc: stable@vger.kernel.org # v5.12+ Reviewed-by: Manivannan Sadhasivam Signed-off-by: Slark Xiao Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20220205135731.157871-2-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit 407eb43ae87c969d98746c3274ae5d0f977b102e Author: Rob Herring Date: Tue Feb 1 15:40:56 2022 -0600 libperf: Add arm64 support to perf_mmap__read_self() Add the arm64 variants for read_perf_counter() and read_timestamp(). Unfortunately the counter number is encoded into the instruction, so the code is a bit verbose to enumerate all possible counters. Tested-by: Masayoshi Mizuma Signed-off-by: Rob Herring Acked-by: Jiri Olsa Tested-by: John Garry Signed-off-by: Arnaldo Carvalho de Melo Link: https://lore.kernel.org/r/20220201214056.702854-1-robh@kernel.org Cc: Mark Rutland Cc: Peter Zijlstra Cc: Arnaldo Carvalho de Melo Cc: Namhyung Kim Cc: Will Deacon Cc: Alexander Shishkin Cc: Ingo Molnar Cc: linux-kernel@vger.kernel.org Cc: linux-perf-users@vger.kernel.org commit 4f2492731ada9d702ffdfaa6ec1ff64820a1664c 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: 06feec6005c9d950 ("ASoC: hdmi-codec: Fix OOB memory accesses") 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: Dmitry Osipenko Cc: Mark Brown Cc: Takashi Iwai Link: https://lore.kernel.org/lkml/Yf+6OT+2eMrYDEeX@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit b2b1aa73ade982c175ac926a1fd34e76ad628b94 Author: Ian Rogers Date: Fri Feb 4 17:09:41 2022 -0800 perf stat: Fix display of grouped aliased events An event may have a number of uncore aliases that when added to the evlist are consecutive. If there are multiple uncore events in a group then parse_events__set_leader_for_uncore_aliase will reorder the evlist so that events on the same PMU are adjacent. The collect_all_aliases function assumes that aliases are in blocks so that only the first counter is printed and all others are marked merged. The reordering for groups breaks the assumption and so all counts are printed. This change removes the assumption from collect_all_aliases that the events are in blocks and instead processes the entire evlist. Before: ``` $ perf stat -e '{UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE,UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE},duration_time' -a -A -- sleep 1 Performance counter stats for 'system wide': CPU0 256,866 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU36 494,413 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU0 967 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU36 1,738 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU0 285,161 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU36 429,920 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU0 955 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU36 1,443 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU0 310,753 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU36 416,657 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU0 1,231 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU36 1,573 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU0 416,067 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU36 405,966 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU0 1,481 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU36 1,447 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU0 312,911 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU36 408,154 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU0 1,086 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU36 1,380 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU0 333,994 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU36 370,349 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU0 1,287 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU36 1,335 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU0 188,107 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU36 302,423 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU0 701 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU36 1,070 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU0 307,221 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU36 383,642 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU0 1,036 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU36 1,158 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU0 318,479 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU36 821,545 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU0 1,028 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU36 2,550 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU0 227,618 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU36 372,272 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU0 903 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU36 1,456 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU0 376,783 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU36 419,827 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU0 1,406 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU36 1,453 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU0 286,583 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU36 429,956 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU0 999 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU36 1,436 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU0 313,867 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU36 370,159 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU0 1,114 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU36 1,291 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU0 342,083 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU36 409,111 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU0 1,399 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU36 1,684 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU0 365,828 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU36 376,037 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU0 1,378 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU36 1,411 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU0 382,456 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU36 621,743 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU0 1,232 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU36 1,955 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU0 342,316 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU36 385,067 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU0 1,176 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU36 1,268 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU0 373,588 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU36 386,163 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU0 1,394 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU36 1,464 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU0 381,206 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU36 546,891 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU0 1,266 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU36 1,712 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU0 221,176 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU36 392,069 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU0 831 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU36 1,456 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU0 355,401 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU36 705,595 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU0 1,235 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU36 2,216 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU0 371,436 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU36 428,103 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU0 1,306 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU36 1,442 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU0 384,352 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU36 504,200 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU0 1,468 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU36 1,860 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU0 228,856 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU36 287,976 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU0 832 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU36 1,060 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU0 215,121 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU36 334,162 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU0 681 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU36 1,026 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU0 296,179 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU36 436,083 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU0 1,084 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU36 1,525 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU0 262,296 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU36 416,573 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU0 986 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU36 1,533 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU0 285,852 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU36 359,842 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU0 1,073 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU36 1,326 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU0 303,379 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU36 367,222 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU0 1,008 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU36 1,156 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU0 273,487 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU36 425,449 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU0 932 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU36 1,367 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU0 297,596 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU36 414,793 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU0 1,140 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU36 1,601 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU0 342,365 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU36 360,422 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU0 1,291 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU36 1,342 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU0 327,196 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU36 580,858 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU0 1,122 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU36 2,014 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU0 296,564 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU36 452,817 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU0 1,087 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU36 1,694 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU0 375,002 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU36 389,393 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU0 1,478 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU36 1,540 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU0 365,213 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU36 594,685 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU0 1,401 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU36 2,222 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU0 1,000,749,060 ns duration_time 1.000749060 seconds time elapsed ``` After: ``` Performance counter stats for 'system wide': CPU0 20,547,434 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU36 45,202,862 UNC_CHA_TOR_OCCUPANCY.IA_MISS_DRD_REMOTE CPU0 82,001 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU36 159,688 UNC_CHA_TOR_INSERTS.IA_MISS_DRD_REMOTE CPU0 1,000,464,828 ns duration_time 1.000464828 seconds time elapsed ``` Fixes: 3cdc5c2cb924acb4 ("perf parse-events: Handle uncore event aliases in small groups properly") Reviewed-by: Andi Kleen Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Alexandre Torgue Cc: Asaf Yaffe Cc: Caleb Biggers Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kan Liang Cc: Kshipra Bopardikar Cc: Mark Rutland Cc: Maxime Coquelin Cc: Namhyung Kim Cc: Perry Taylor Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Vineet Singh Cc: Zhengjun Xing Link: https://lore.kernel.org/r/20220205010941.1065469-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 05b5a9d6285412d97fc61b8ec113d1d4f6b950c2 Author: German Gomez Date: Wed Jan 26 10:59:26 2022 +0000 perf tools: Apply correct label to user/kernel symbols in branch mode In branch mode, the branch symbols were being displayed with incorrect cpumode labels. So fix this. For example, before: # perf record -b -a -- sleep 1 # perf report -b Overhead Command Source Shared Object Source Symbol Target Symbol 0.08% swapper [kernel.kallsyms] [k] rcu_idle_enter [k] cpuidle_enter_state ==> 0.08% cmd0 [kernel.kallsyms] [.] psi_group_change [.] psi_group_change 0.08% cmd1 [kernel.kallsyms] [k] psi_group_change [k] psi_group_change After: # perf report -b Overhead Command Source Shared Object Source Symbol Target Symbol 0.08% swapper [kernel.kallsyms] [k] rcu_idle_enter [k] cpuidle_enter_state 0.08% cmd0 [kernel.kallsyms] [k] psi_group_change [k] pei_group_change 0.08% cmd1 [kernel.kallsyms] [k] psi_group_change [k] psi_group_change Reviewed-by: James Clark Signed-off-by: German Gomez Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Link: https://lore.kernel.org/r/20220126105927.3411216-1-german.gomez@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit a2887b9b8d1db7be971e5951e08ffe8563ea412f Author: Masanari Iida Date: Sat Dec 25 09:55:58 2021 +0900 perf bpf: Fix a typo in bpf_counter_cgroup.c This patch fixes a spelling typo in error message. Signed-off-by: Masanari Iida Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20211225005558.503935-1-standby24x7@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit bc9c806e524429a4b98de257179af5e3fc2cb57d Author: Leo Yan Date: Fri Dec 24 20:40:13 2021 +0800 perf synthetic-events: Return error if procfs isn't mounted for PID namespaces For perf recording, it retrieves process info by iterating nodes in proc fs. If we run perf in a non-root PID namespace with command: # unshare --fork --pid perf record -e cycles -a -- test_program ... in this case, unshare command creates a child PID namespace and launches perf tool in it, but the issue is the proc fs is not mounted for the non-root PID namespace, this leads to the perf tool gathering process info from its parent PID namespace. We can use below command to observe the process nodes under proc fs: # unshare --pid --fork ls /proc 1 137 1968 2128 3 342 48 62 78 crypto kcore net uptime 10 138 2 2142 30 35 49 63 8 devices keys pagetypeinfo version 11 139 20 2143 304 36 50 64 82 device-tree key-users partitions vmallocinfo 12 14 2011 22 305 37 51 65 83 diskstats kmsg self vmstat 128 140 2038 23 307 39 52 656 84 driver kpagecgroup slabinfo zoneinfo 129 15 2074 24 309 4 53 67 9 execdomains kpagecount softirqs 13 16 2094 241 31 40 54 68 asound fb kpageflags stat 130 164 2096 242 310 41 55 69 buddyinfo filesystems loadavg swaps 131 17 2098 25 317 42 56 70 bus fs locks sys 132 175 21 26 32 43 57 71 cgroups interrupts meminfo sysrq-trigger 133 179 2102 263 329 44 58 75 cmdline iomem misc sysvipc 134 1875 2103 27 330 45 59 76 config.gz ioports modules thread-self 135 19 2117 29 333 46 6 77 consoles irq mounts timer_list 136 1941 2121 298 34 47 60 773 cpuinfo kallsyms mtd tty So it shows many existed tasks, since unshared command has not mounted the proc fs for the new created PID namespace, it still accesses the proc fs of the root PID namespace. This leads to two prominent issues: - Firstly, PID values are mismatched between thread info and samples. The gathered thread info are coming from the proc fs of the root PID namespace, but samples record its PID from the child PID namespace. - The second issue is profiled program 'test_program' returns its forked PID number from the child PID namespace, perf tool wrongly uses this PID number to retrieve the process info via the proc fs of the root PID namespace. To avoid issues, we need to mount proc fs for the child PID namespace with the option '--mount-proc' when use unshare command: # unshare --fork --pid --mount-proc perf record -e cycles -a -- test_program Conversely, when the proc fs of the root PID namespace is used by child namespace, perf tool can detect the multiple PID levels and nsinfo__is_in_root_namespace() returns false, this patch reports error for this case: # unshare --fork --pid perf record -e cycles -a -- test_program Couldn't synthesize bpf events. Perf runs in non-root PID namespace but it tries to gather process info from its parent PID namespace. Please mount the proc file system properly, e.g. add the option '--mount-proc' for unshare command. Reviewed-by: James Clark Signed-off-by: Leo Yan Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Daniel Borkmann Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Fastabend Cc: KP Singh Cc: Mark Rutland Cc: Martin KaFai Lau Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Song Liu Cc: Yonghong Song Link: https://lore.kernel.org/r/20211224124014.2492751-1-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit d792a7a94c2c3ba045247266bee2e2bced7b495a Author: Ameer Hamza Date: Tue Jan 25 17:11:41 2022 +0500 perf session: Check for NULL pointer before dereference Move NULL pointer check before dereferencing the variable. Addresses-Coverity: 1497622 ("Derereference before null check") Reviewed-by: James Clark Signed-off-by: Ameer Hamza Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Alexey Bayduraev Cc: German Gomez Cc: Ingo Molnar Cc: Jiri Olsa Cc: Leo Yan Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Riccardo Mancini Link: https://lore.kernel.org/r/20220125121141.18347-1-amhamza.mgc@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit a663520fcc4bce2814032e3de6c4e2665b9555e5 Author: Namhyung Kim Date: Tue Feb 1 23:08:25 2022 -0800 perf annotate: Set error stream of objdump process for TUI The stderr should be set to a pipe when using TUI. Otherwise it'd print to stdout and break TUI windows with an error message. Signed-off-by: Namhyung Kim Cc: Andi Kleen Cc: Ian Rogers Cc: Jiri Olsa Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20220202070828.143303-2-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit ae65b443f03fca3620cb37c5e019ddca3f89a1ce Author: Anshuman Khandual Date: Wed Feb 2 16:27:23 2022 +0530 perf tools: Add missing branch_sample_type to perf_event_attr__fprintf() This updates branch sample type with missing PERF_SAMPLE_BRANCH_TYPE_SAVE. Suggested-by: James Clark Signed-off-by: Anshuman Khandual Acked-by: Jiri Olsa Cc: James Clark Cc: Mark Rutland Cc: Peter Zijlstra Cc: linux-arm-kernel@lists.infradead.org Link: http://lore.kernel.org/lkml/1643799443-15109-1-git-send-email-anshuman.khandual@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit b7b9825fbee708e17ab7ea8b583561587c8ff7df 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: f6c6804c43fa18d3 ("kvm: Move KVM_GET_XSAVE2 IOCTL definition at the end of kvm.h") That just rebuilds perf, as these patches don't add any new KVM ioctl to be harvested for the the 'perf trace' ioctl syscall argument beautifiers. This is also by now used by tools/testing/selftests/kvm/, a simple test build succeeded. This silences this perf build warning: Warning: Kernel ABI header at 'tools/include/uapi/linux/kvm.h' differs from latest version at 'include/uapi/linux/kvm.h' diff -u tools/include/uapi/linux/kvm.h include/uapi/linux/kvm.h Cc: Janosch Frank Cc: Paolo Bonzini Link: http://lore.kernel.org/lkml/Yf+4k5Fs5Q3HdSG9@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 9334030c3b94ca32af2e5afd02cb1c63307a2bea Merge: fc45e6588d57b 90c9e950c0def Author: Arnaldo Carvalho de Melo Date: Sun Feb 6 08:28:34 2022 -0300 Merge remote-tracking branch 'torvalds/master' into perf/urgent To check if more kernel API sync is needed and also to see if the perf build tests continue to pass. Signed-off-by: Arnaldo Carvalho de Melo commit 28f9222138868899c53e00bc1f910faa55f88546 Author: Eric Dumazet Date: Sat Feb 5 21:05:16 2022 -0800 net/smc: fix ref_tracker issue in smc_pnet_add() I added the netdev_tracker_alloc() right after ndev was stored into the newly allocated object: new_pe->ndev = ndev; if (ndev) netdev_tracker_alloc(ndev, &new_pe->dev_tracker, GFP_KERNEL); But I missed that later, we could end up freeing new_pe, then calling dev_put(ndev) to release the reference on ndev. The new_pe->dev_tracker would not be freed. To solve this issue, move the netdev_tracker_alloc() call to the point we know for sure new_pe will be kept. syzbot report (on net-next tree, but the bug is present in net tree) WARNING: CPU: 0 PID: 6019 at lib/refcount.c:31 refcount_warn_saturate+0xbf/0x1e0 lib/refcount.c:31 Modules linked in: CPU: 0 PID: 6019 Comm: syz-executor.3 Not tainted 5.17.0-rc2-syzkaller-00650-g5a8fb33e5305 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:refcount_warn_saturate+0xbf/0x1e0 lib/refcount.c:31 Code: 1d f4 70 a0 09 31 ff 89 de e8 4d bc 99 fd 84 db 75 e0 e8 64 b8 99 fd 48 c7 c7 20 0c 06 8a c6 05 d4 70 a0 09 01 e8 9e 4e 28 05 <0f> 0b eb c4 e8 48 b8 99 fd 0f b6 1d c3 70 a0 09 31 ff 89 de e8 18 RSP: 0018:ffffc900043b7400 EFLAGS: 00010282 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 RDX: 0000000000040000 RSI: ffffffff815fb318 RDI: fffff52000876e72 RBP: 0000000000000004 R08: 0000000000000000 R09: 0000000000000000 R10: ffffffff815f507e R11: 0000000000000000 R12: 1ffff92000876e85 R13: 0000000000000000 R14: ffff88805c1c6600 R15: 0000000000000000 FS: 00007f1ef6feb700(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000001b2d02b000 CR3: 00000000223f4000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __refcount_dec include/linux/refcount.h:344 [inline] refcount_dec include/linux/refcount.h:359 [inline] ref_tracker_free+0x53f/0x6c0 lib/ref_tracker.c:119 netdev_tracker_free include/linux/netdevice.h:3867 [inline] dev_put_track include/linux/netdevice.h:3884 [inline] dev_put_track include/linux/netdevice.h:3880 [inline] dev_put include/linux/netdevice.h:3910 [inline] smc_pnet_add_eth net/smc/smc_pnet.c:399 [inline] smc_pnet_enter net/smc/smc_pnet.c:493 [inline] smc_pnet_add+0x5fc/0x15f0 net/smc/smc_pnet.c:556 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:2494 genl_rcv+0x24/0x40 net/netlink/genetlink.c:803 netlink_unicast_kernel net/netlink/af_netlink.c:1317 [inline] netlink_unicast+0x539/0x7e0 net/netlink/af_netlink.c:1343 netlink_sendmsg+0x904/0xe00 net/netlink/af_netlink.c:1919 sock_sendmsg_nosec net/socket.c:705 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:725 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2413 ___sys_sendmsg+0xf3/0x170 net/socket.c:2467 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2496 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: b60645248af3 ("net/smc: add net device tracker to struct smc_pnetentry") Signed-off-by: Eric Dumazet Reported-by: syzbot Signed-off-by: David S. Miller commit aec12836e7196e4d360b2cbf20cf7aa5139ad2ec Author: Pavel Parkhomenko Date: Sun Feb 6 00:49:51 2022 +0300 net: phy: marvell: Fix MDI-x polarity setting in 88e1118-compatible PHYs When setting up autonegotiation for 88E1118R and compatible PHYs, a software reset of PHY is issued before setting up polarity. This is incorrect as changes of MDI Crossover Mode bits are disruptive to the normal operation and must be followed by a software reset to take effect. Let's patch m88e1118_config_aneg() to fix the issue mentioned before by invoking software reset of the PHY just after setting up MDI-x polarity. Fixes: 605f196efbf8 ("phy: Add support for Marvell 88E1118 PHY") Signed-off-by: Pavel Parkhomenko Reviewed-by: Serge Semin Suggested-by: Andrew Lunn Cc: stable@vger.kernel.org Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 6df4432a5eca101b5fd80fbee41d309f3d67928d Author: Christoph Niedermaier Date: Tue Feb 1 12:01:53 2022 +0100 drm/panel: simple: Assign data from panel_dpi_probe() correctly In the function panel_simple_probe() the pointer panel->desc is assigned to the passed pointer desc. If function panel_dpi_probe() is called panel->desc will be updated, but further on only desc will be evaluated. So update the desc pointer to be able to use the data from the function panel_dpi_probe(). Fixes: 4a1d0dbc8332 ("drm/panel: simple: add panel-dpi support") Signed-off-by: Christoph Niedermaier Cc: Marek Vasut Cc: Thierry Reding Cc: Sam Ravnborg Cc: David Airlie Cc: Daniel Vetter To: dri-devel@lists.freedesktop.org Reviewed-by: Sam Ravnborg Signed-off-by: Marek Vasut Link: https://patchwork.freedesktop.org/patch/msgid/20220201110153.3479-1-cniedermaier@dh-electronics.com commit 90c9e950c0def5c354b4a6154a2ddda3e5f214ac Merge: 5fdb26213fcb9 e25a8d959992f Author: Linus Torvalds Date: Sat Feb 5 10:40:17 2022 -0800 Merge tag 'for-linus-5.17a-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen fixes from Juergen Gross: - documentation fixes related to Xen - enable x2apic mode when available when running as hardware virtualized guest under Xen - cleanup and fix a corner case of vcpu enumeration when running a paravirtualized Xen guest * tag 'for-linus-5.17a-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: x86/Xen: streamline (and fix) PV CPU enumeration xen: update missing ioctl magic numers documentation Improve docs for IOCTL_GNTDEV_MAP_GRANT_REF xen: xenbus_dev.h: delete incorrect file name xen/x2apic: enable x2apic mode when supported for HVM commit 5fdb26213fcb912955e0c9eacbe2b8961628682f Merge: fbc04bf01a8d5 7e6a6b400db80 Author: Linus Torvalds Date: Sat Feb 5 09:55:59 2022 -0800 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull kvm fixes from Paolo Bonzini: "ARM: - A couple of fixes when handling an exception while a SError has been delivered - Workaround for Cortex-A510's single-step erratum RISC-V: - Make CY, TM, and IR counters accessible in VU mode - Fix SBI implementation version x86: - Report deprecation of x87 features in supported CPUID - Preparation for fixing an interrupt delivery race on AMD hardware - Sparse fix All except POWER and s390: - Rework guest entry code to correctly mark noinstr areas and fix vtime' accounting (for x86, this was already mostly correct but not entirely; for ARM, MIPS and RISC-V it wasn't)" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: KVM: x86: Use ERR_PTR_USR() to return -EFAULT as a __user pointer KVM: x86: Report deprecated x87 features in supported CPUID KVM: arm64: Workaround Cortex-A510's single-step and PAC trap errata KVM: arm64: Stop handle_exit() from handling HVC twice when an SError occurs KVM: arm64: Avoid consuming a stale esr value when SError occur RISC-V: KVM: Fix SBI implementation version RISC-V: KVM: make CY, TM, and IR counters accessible in VU mode kvm/riscv: rework guest entry logic kvm/arm64: rework guest entry logic kvm/x86: rework guest entry logic kvm/mips: rework guest entry logic kvm: add guest_state_{enter,exit}_irqoff() KVM: x86: Move delivery of non-APICv interrupt into vendor code kvm: Move KVM_GET_XSAVE2 IOCTL definition at the end of kvm.h commit fbc04bf01a8d5a639c2e90fea9402f715cf10ff2 Merge: ea7b3e6d42d7a cea267c235e1b Author: Linus Torvalds Date: Sat Feb 5 09:21:55 2022 -0800 Merge tag 'xfs-5.17-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull xfs fixes from Darrick Wong: "I was auditing operations in XFS that clear file privileges, and realized that XFS' fallocate implementation drops suid/sgid but doesn't clear file capabilities the same way that file writes and reflink do. There are VFS helpers that do it correctly, so refactor XFS to use them. I also noticed that we weren't flushing the log at the correct point in the fallocate operation, so that's fixed too. Summary: - Fix fallocate so that it drops all file privileges when files are modified instead of open-coding that incompletely. - Fix fallocate to flush the log if the caller wanted synchronous file updates" * tag 'xfs-5.17-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: xfs: ensure log flush at the end of a synchronous fallocate call xfs: move xfs_update_prealloc_flags() to xfs_pnfs.c xfs: set prealloc flag in xfs_alloc_file_space() xfs: fallocate() should call file_modified() xfs: remove XFS_PREALLOC_SYNC xfs: reject crazy array sizes being fed to XFS_IOC_GETBMAP* commit ea7b3e6d42d7afa141ff765099d6b4ea406001bc Merge: 524446e217985 2d86293c70750 Author: Linus Torvalds Date: Sat Feb 5 09:13:51 2022 -0800 Merge tag 'vfs-5.17-fixes-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull vfs fixes from Darrick Wong: "I was auditing the sync_fs code paths recently and noticed that most callers of ->sync_fs ignore its return value (and many implementations never return nonzero even if the fs is broken!), which means that internal fs errors and corruption are not passed up to userspace callers of syncfs(2) or FIFREEZE. Hence fixing the common code and XFS, and I'll start working on the ext4/btrfs folks if this is merged. Summary: - Fix a bug where callers of ->sync_fs (e.g. sync_filesystem and syncfs(2)) ignore the return value. - Fix a bug where callers of sync_filesystem (e.g. fs freeze) ignore the return value. - Fix a bug in XFS where xfs_fs_sync_fs never passed back error returns" * tag 'vfs-5.17-fixes-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: xfs: return errors in xfs_fs_sync_fs quota: make dquot_quota_sync return errors from ->sync_fs vfs: make sync_filesystem return errors from ->sync_fs vfs: make freeze_super abort when sync_filesystem returns error commit 524446e2179855534b425647dfc250757905aad8 Merge: 0457e5153e0e8 ebb7fb1557b1d Author: Linus Torvalds Date: Sat Feb 5 09:04:43 2022 -0800 Merge tag 'iomap-5.17-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull iomap fix from Darrick Wong: "A single bugfix for iomap. The fix should eliminate occasional complaints about stall warnings when a lot of writeback IO completes all at once and we have to then go clearing status on a large number of folios. Summary: - Limit the length of ioend chains in writeback so that we don't trip the softlockup watchdog and to limit long tail latency on clearing PageWriteback" * tag 'iomap-5.17-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: xfs, iomap: limit individual ioend chain lengths in writeback commit 59085208e4a2183998964844f8684fea0378128d Author: Vladimir Oltean Date: Sat Feb 5 01:03:21 2022 +0200 net: mscc: ocelot: fix all IP traffic getting trapped to CPU with PTP over IP The filters for the PTP trap keys are incorrectly configured, in the sense that is2_entry_set() only looks at trap->key.ipv4.dport or trap->key.ipv6.dport if trap->key.ipv4.proto or trap->key.ipv6.proto is set to IPPROTO_TCP or IPPROTO_UDP. But we don't do that, so is2_entry_set() goes through the "else" branch of the IP protocol check, and ends up installing a rule for "Any IP protocol match" (because msk is also 0). The UDP port is ignored. This means that when we run "ptp4l -i swp0 -4", all IP traffic is trapped to the CPU, which hinders bridging. Fix this by specifying the IP protocol in the VCAP IS2 filters for PTP over UDP. Fixes: 96ca08c05838 ("net: mscc: ocelot: set up traps for PTP packets") Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit e3d13da7f77d73c64981b62591c21614a6cf688f Author: Hans de Goede Date: Sat Feb 5 12:28:40 2022 +0100 platform/x86: asus-wmi: Fix regression when probing for fan curve control The fan curve control patches introduced a regression for at least the TUF FX506 and possibly other TUF series laptops that do not have support for fan curve control. As part of the probing process, asus_wmi_evaluate_method_buf is called to get the factory default fan curve . The WMI management function returns 0 on certain laptops to indicate lack of fan curve control instead of ASUS_WMI_UNSUPPORTED_METHOD. This 0 is transformed to -ENODATA which results in failure when probing. Fixes: 0f0ac158d28f ("platform/x86: asus-wmi: Add support for custom fan curves") Reported-and-tested-by: Abhijeet V Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220205112840.33095-1-hdegoede@redhat.com commit fd5dd6acd8f823ea804f76d3af64fa1be9d5fb78 Author: Sergio Costas Date: Fri Feb 4 10:01:17 2022 +0100 HID:Add support for UGTABLET WP5540 This patch adds support for the UGTABLET WP5540 digitizer tablet devices. Without it, the pen moves the cursor, but neither the buttons nor the tap sensor in the tip do work. Signed-off-by: Sergio Costas Link: https://lore.kernel.org/r/63dece1d-91ca-1b1b-d90d-335be66896be@gmail.com Cc: stable@vger.kernel.org Signed-off-by: Benjamin Tissoires commit 9ccdcc73d37cf0f1d4f97712f6b38af8806ac064 Merge: c0689e46be231 9a8406ba1a9a2 Author: Greg Kroah-Hartman Date: Sat Feb 5 11:52:53 2022 +0100 Merge tag 'phy-fixes-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy into char-misc-next Vinod writes: phy: fixes for 5.17 Fixes for bunch of drivers: - clk params for dphy - arg fix for mtk-tphy - refcount leak fix for stm32 - bus width fix for zynqmp - sentinel fix ti - PHY_BRCM_USB Kconfig fix - clk fix for usb phy * tag 'phy-fixes-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy: phy: dphy: Correct clk_pre parameter phy: phy-mtk-tphy: Fix duplicated argument in phy-mtk-tphy phy: stm32: fix a refcount leak in stm32_usbphyc_pll_enable() phy: xilinx: zynqmp: Fix bus width setting for SGMII phy: cadence: Sierra: fix error handling bugs in probe() phy: ti: Fix missing sentinel for clk_div_table phy: broadcom: Kconfig: Fix PHY_BRCM_USB config option phy: usb: Leave some clocks running during suspend commit 7e6a6b400db8048bd1c06e497e338388413cf5bc Merge: 6e37ec8825a11 1dd498e5e26ad Author: Paolo Bonzini Date: Sat Feb 5 00:58:25 2022 -0500 Merge tag 'kvmarm-fixes-5.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD KVM/arm64 fixes for 5.17, take #2 - A couple of fixes when handling an exception while a SError has been delivered - Workaround for Cortex-A510's single-step[ erratum commit c6ce9c5831cae515d375a01b97ae1778689acf19 Author: Herbert Xu Date: Wed Feb 2 17:46:48 2022 +1100 crypto: api - Move cryptomgr soft dependency into algapi The soft dependency on cryptomgr is only needed in algapi because if algapi isn't present then no algorithms can be loaded. This also fixes the case where api is built-in but algapi is built as a module as the soft dependency would otherwise get lost. Fixes: 8ab23d547f65 ("crypto: api - Add softdep on cryptomgr") Reported-by: Jan Beulich Signed-off-by: Herbert Xu Tested-by: Jan Beulich Signed-off-by: Herbert Xu commit f8d9d938514f46c4892aff6bfe32f425e84d81cc Author: Eric Dumazet Date: Thu Feb 3 14:55:47 2022 -0800 tcp: take care of mixed splice()/sendmsg(MSG_ZEROCOPY) case syzbot found that mixing sendpage() and sendmsg(MSG_ZEROCOPY) calls over the same TCP socket would again trigger the infamous warning in inet_sock_destruct() WARN_ON(sk_forward_alloc_get(sk)); While Talal took into account a mix of regular copied data and MSG_ZEROCOPY one in the same skb, the sendpage() path has been forgotten. We want the charging to happen for sendpage(), because pages could be coming from a pipe. What is missing is the downgrading of pure zerocopy status to make sure sk_forward_alloc will stay synced. Add tcp_downgrade_zcopy_pure() helper so that we can use it from the two callers. Fixes: 9b65b17db723 ("net: avoid double accounting for pure zerocopy skbs") Signed-off-by: Eric Dumazet Reported-by: syzbot Cc: Talal Ahmad Cc: Arjun Roy Cc: Willem de Bruijn Acked-by: Soheil Hassas Yeganeh Link: https://lore.kernel.org/r/20220203225547.665114-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit 0457e5153e0e8420134f60921349099e907264ca Merge: fc93310c67ff1 f3136c4ce7acf Author: Linus Torvalds Date: Fri Feb 4 16:28:11 2022 -0800 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma Pull rdma fixes from Jason Gunthorpe: "Some medium sized bugs in the various drivers. A couple are more recent regressions: - Fix two panics in hfi1 and two allocation problems - Send the IGMP to the correct address in cma - Squash a syzkaller bug related to races reading the multicast list - Memory leak in siw and cm - Fix a corner case spec compliance for HFI/QIB - Correct the implementation of fences in siw - Error unwind bug in mlx4" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: RDMA/mlx4: Don't continue event handler after memory allocation failure RDMA/siw: Fix broken RDMA Read Fence/Resume logic. IB/rdmavt: Validate remote_addr during loopback atomic tests IB/cm: Release previously acquired reference counter in the cm_id_priv RDMA/siw: Fix refcounting leak in siw_create_qp() RDMA/ucma: Protect mc during concurrent multicast leaves RDMA/cma: Use correct address when leaving multicast group IB/hfi1: Fix tstats alloc and dealloc IB/hfi1: Fix AIP early init panic IB/hfi1: Fix alloc failure with larger txqueuelen IB/hfi1: Fix panic with larger ipoib send_queue_size commit fc93310c67ff1c0dc38e3df7814973b55eea5559 Merge: e09e1a40639ba c763ec4c10f78 Author: Linus Torvalds Date: Fri Feb 4 15:27:45 2022 -0800 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fixes from James Bottomley: "Seven fixes, six of which are fairly obvious driver fixes. The one core change to the device budget depth is to try to ensure that if the default depth is large (which can produce quite a sizeable bitmap allocation per device), we give back the memory we don't need if there's a queue size reduction in slave_configure (which happens to a lot of devices)" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: hisi_sas: Fix setting of hisi_sas_slot.is_internal scsi: pm8001: Fix use-after-free for aborted SSP/STP sas_task scsi: pm8001: Fix use-after-free for aborted TMF sas_task scsi: pm8001: Fix warning for undescribed param in process_one_iomb() scsi: core: Reallocate device's budget map on queue depth change scsi: bnx2fc: Make bnx2fc_recv_frame() mp safe scsi: pm80xx: Fix double completion for SATA devices commit e09e1a40639ba10eff22984003c201db57fe033a Merge: 86286e486cbdd 7dd3876205df9 Author: Linus Torvalds Date: Fri Feb 4 15:22:35 2022 -0800 Merge tag 'pci-v5.17-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci Pull pci fixes from Bjorn Helgaas: - Restructure j721e_pcie_probe() so we don't dereference a NULL pointer (Bjorn Helgaas) - Add a kirin_pcie_data struct to identify different Kirin variants to fix probe failure for controllers with an internal PHY (Bjorn Helgaas) * tag 'pci-v5.17-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: PCI: kirin: Add dev struct for of_device_get_match_data() PCI: j721e: Initialize pcie->cdns_pcie before using it commit ca0cb9a60f6d86d4b2139c6f393a78f39edcd7cb Author: Palmer Dabbelt Date: Fri Feb 4 13:14:08 2022 -0800 riscv/mm: Add XIP_FIXUP for riscv_pfn_base This manifests as a crash early in boot on VexRiscv. Signed-off-by: Myrtle Shah [Palmer: split commit] Fixes: 44c922572952 ("RISC-V: enable XIP") Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit 4b1c70aa8ed8249608bb991380cb8ff423edf49e Author: Palmer Dabbelt Date: Fri Feb 4 13:13:37 2022 -0800 riscv/mm: Add XIP_FIXUP for phys_ram_base This manifests as a crash early in boot on VexRiscv. Signed-off-by: Myrtle Shah [Palmer: split commit] Fixes: 6d7f91d914bc ("riscv: Get rid of CONFIG_PHYS_RAM_BASE in kernel physical address conversion") Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit 7dd3876205df92e07d824fe2264b38e0b8a9eec1 Author: Bjorn Helgaas Date: Wed Feb 2 09:52:41 2022 -0600 PCI: kirin: Add dev struct for of_device_get_match_data() Bean reported that a622435fbe1a ("PCI: kirin: Prefer of_device_get_match_data()") broke kirin_pcie_probe() because it assumed match data of 0 was a failure when in fact, it meant the match data was "(void *)PCIE_KIRIN_INTERNAL_PHY". Therefore, probing of "hisilicon,kirin960-pcie" devices failed with -EINVAL and an "OF data missing" message. Add a struct kirin_pcie_data to encode the PHY type. Then the result of of_device_get_match_data() should always be a non-NULL pointer to a struct kirin_pcie_data that contains the PHY type. Fixes: a622435fbe1a ("PCI: kirin: Prefer of_device_get_match_data()") Link: https://lore.kernel.org/r/20220202162659.GA12603@bhelgaas Link: https://lore.kernel.org/r/20220201215941.1203155-1-huobean@gmail.com Reported-by: Bean Huo Signed-off-by: Bjorn Helgaas commit 86286e486cbdd68f01d330409307f6a6efcd4298 Merge: b0bc0cb8157d5 40cdc509877ba Author: Linus Torvalds Date: Fri Feb 4 12:14:58 2022 -0800 Merge tag 'for-5.17-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs fixes from David Sterba: "A few fixes and error handling improvements: - fix deadlock between quota disable and qgroup rescan worker - fix use-after-free after failure to create a snapshot - skip warning on unmount after log cleanup failure - don't start transaction for scrub if the fs is mounted read-only - tree checker verifies item sizes" * tag 'for-5.17-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: btrfs: skip reserved bytes warning on unmount after log cleanup failure btrfs: fix use of uninitialized variable at rm device ioctl btrfs: fix use-after-free after failure to create a snapshot btrfs: tree-checker: check item_size for dev_item btrfs: tree-checker: check item_size for inode_item btrfs: fix deadlock between quota disable and qgroup rescan worker btrfs: don't start transaction for scrub if the fs is mounted read-only commit 183f80fd72db42c9cc483aa7a5e8e881355d0b03 Author: Sean Young Date: Tue Feb 1 18:38:36 2022 +0000 selftests/ir: fix build with ancient kernel headers Since commit e2bcbd7769ee ("tools headers UAPI: remove stale lirc.h"), the build of the selftests fails on rhel 8 since its version of /usr/include/linux/lirc.h has no definition of RC_PROTO_RCMM32, etc [1]. [1] https://lkml.org/lkml/2022/1/28/275 Fixes: e2bcbd7769ee ("tools headers UAPI: remove stale lirc.h") Reviewed-by: Shuah Khan Reported-by: kernel test robot Signed-off-by: Sean Young Signed-off-by: Shuah Khan commit b0bc0cb8157d5f09493a235e1ee73e84dd182ff9 Merge: 7c4a94590e4dc 24331050a3e6a Author: Linus Torvalds Date: Fri Feb 4 12:08:49 2022 -0800 Merge tag 'erofs-for-5.17-rc3-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs Pull erofs fixes from Gao Xiang: "Two fixes related to fsdax cleanup in this cycle and ztailpacking to fix small compressed data inlining. There is also a trivial cleanup to rearrange code for better reading. Summary: - fix fsdax partition offset misbehavior - clean up z_erofs_decompressqueue_work() declaration - fix up EOF lcluster inlining, especially for small compressed data" * tag 'erofs-for-5.17-rc3-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs: erofs: fix small compressed files inlining erofs: avoid unnecessary z_erofs_decompressqueue_work() declaration erofs: fix fsdax partition offset handling commit e2aa5e650b07693477dff554053605976789fd68 Author: Axel Rasmussen Date: Thu Jan 27 14:11:15 2022 -0800 selftests: fixup build warnings in pidfd / clone3 tests These are some trivial fixups, which were needed to build the tests with clang and -Werror. The following issues are fixed: - Remove various unused variables. - In child_poll_leader_exit_test, clang isn't smart enough to realize syscall(SYS_exit, 0) won't return, so it complains we never return from a non-void function. Add an extra exit(0) to appease it. - In test_pidfd_poll_leader_exit, ret may be branched on despite being uninitialized, if we have !use_waitpid. Initialize it to zero to get the right behavior in that case. Signed-off-by: Axel Rasmussen Acked-by: Christian Brauner Signed-off-by: Shuah Khan commit 4cbd93c3c110447adc66cb67c08af21f939ae2d7 Author: Axel Rasmussen Date: Thu Jan 27 13:29:51 2022 -0800 pidfd: fix test failure due to stack overflow on some arches When running the pidfd_fdinfo_test on arm64, it fails for me. After some digging, the reason is that the child exits due to SIGBUS, because it overflows the 1024 byte stack we've reserved for it. To fix the issue, increase the stack size to 8192 bytes (this number is somewhat arbitrary, and was arrived at through experimentation -- I kept doubling until the failure no longer occurred). Also, let's make the issue easier to debug. wait_for_pid() returns an ambiguous value: it may return -1 in all of these cases: 1. waitpid() itself returned -1 2. waitpid() returned success, but we found !WIFEXITED(status). 3. The child process exited, but it did so with a -1 exit code. There's no way for the caller to tell the difference. So, at least log which occurred, so the test runner can debug things. While debugging this, I found that we had !WIFEXITED(), because the child exited due to a signal. This seems like a reasonably common case, so also print out whether or not we have WIFSIGNALED(), and the associated WTERMSIG() (if any). This lets us see the SIGBUS I'm fixing clearly when it occurs. Finally, I'm suspicious of allocating the child's stack on our stack. man clone(2) suggests that the correct way to do this is with mmap(), and in particular by setting MAP_STACK. So, switch to doing it that way instead. Signed-off-by: Axel Rasmussen Acked-by: Christian Brauner Signed-off-by: Shuah Khan commit 7c4a94590e4dc134b36b0edeb5ddcf6e8b3da498 Merge: 494a2c2b27c5d b13e0c7185681 Author: Linus Torvalds Date: Fri Feb 4 12:01:57 2022 -0800 Merge tag 'block-5.17-2022-02-04' of git://git.kernel.dk/linux-block Pull block fixes from Jens Axboe: - NVMe pull request - fix use-after-free in rdma and tcp controller reset (Sagi Grimberg) - fix the state check in nvmf_ctlr_matches_baseopts (Uday Shankar) - MD nowait null pointer fix (Song) - blk-integrity seed advance fix (Martin) - Fix a dio regression in this merge window (Ilya) * tag 'block-5.17-2022-02-04' of git://git.kernel.dk/linux-block: block: bio-integrity: Advance seed correctly for larger interval sizes nvme-fabrics: fix state check in nvmf_ctlr_matches_baseopts() md: fix NULL pointer deref with nowait but no mddev->queue block: fix DIO handling regressions in blkdev_read_iter() nvme-rdma: fix possible use-after-free in transport error_recovery work nvme-tcp: fix possible use-after-free in transport error_recovery work nvme: fix a possible use-after-free in controller reset during load commit 494a2c2b27c5d2a3c4f65a325fe5a0087013c1a4 Merge: 07cd9ac4c5403 ac9f0c810684a Author: Linus Torvalds Date: Fri Feb 4 11:52:37 2022 -0800 Merge tag 'ata-5.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata Pull ATA fixes from Damien Le Moal: - Sergey volunteered to be a reviewer for the Renesas R-Car SATA driver and PATA drivers. Update the MAINTAINERS file accordingly. - Regression fix: add a horkage flag to prevent accessing the log directory log page with SATADOM-ML 3ME SATA devices as they react badly to reading that log page (from Anton). * tag 'ata-5.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata: ata: libata-core: Introduce ATA_HORKAGE_NO_LOG_DIR horkage MAINTAINERS: add myself as Renesas R-Car SATA driver reviewer MAINTAINERS: add myself as PATA drivers reviewer commit 07cd9ac4c54039c99f98d30e83e23040e330fad5 Merge: ba6ef8af0f3be 9b45a7738eec5 Author: Linus Torvalds Date: Fri Feb 4 11:45:16 2022 -0800 Merge tag 'iommu-fixes-v5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu Pull iommu fixes from Joerg Roedel: - Warning fixes and a fix for a potential use-after-free in IOMMU core code - Another potential memory leak fix for the Intel VT-d driver - Fix for an IO polling loop timeout issue in the AMD IOMMU driver * tag 'iommu-fixes-v5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: iommu/amd: Fix loop timeout issue in iommu_ga_log_enable() iommu/vt-d: Fix potential memory leak in intel_setup_irq_remapping() iommu: Fix some W=1 warnings iommu: Fix potential use-after-free during probe commit ba6ef8af0f3be2e0318aac7e6e43d3a04a069a6a Merge: ddb16b08316bc 9d5505f1eebec Author: Linus Torvalds Date: Fri Feb 4 11:38:01 2022 -0800 Merge tag 'random-5.17-rc3-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random Pull random number generator fixes from Jason Donenfeld: "For this week, we have: - A fix to make more frequent use of hwgenerator randomness, from Dominik. - More cleanups to the boot initialization sequence, from Dominik. - A fix for an old shortcoming with the ZAP ioctl, from me. - A workaround for a still unfixed Clang CFI/FullLTO compiler bug, from me. On one hand, it's a bummer to commit workarounds for experimental compiler features that have bugs. But on the other, I think this actually improves the code somewhat, independent of the bug. So a win-win" * tag 'random-5.17-rc3-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random: random: only call crng_finalize_init() for primary_crng random: access primary_pool directly rather than through pointer random: wake up /dev/random writers after zap random: continually use hwgenerator randomness lib/crypto: blake2s: avoid indirect calls to compression function for Clang CFI commit ddb16b08316bc4d57b9a46f4a470fd331815fb4a Merge: 0a566d43c8cde 04662bac0067e Author: Linus Torvalds Date: Fri Feb 4 11:32:46 2022 -0800 Merge tag 'acpi-5.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI fix from Rafael Wysocki: "Fix compilation in the case when ACPI is selected and CRC32, depended on by ACPI after recent changes, is not (Randy Dunlap)" * tag 'acpi-5.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: require CRC32 to build commit 0a566d43c8cdefb30a225f0dbde40e4f487e0fc9 Merge: 31462d9e47cf6 52517d9c0c011 Author: Linus Torvalds Date: Fri Feb 4 11:24:28 2022 -0800 Merge tag 'sound-5.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "A collection of small fixes. The major changes are ASoC core fixes, addressing the DPCM locking issue after the recent code changes and the potentially invalid register accesses via control API. Also, HD-audio got a core fix for Oops at dynamic unbinding. The rest are device-specific small fixes, including the usual stuff like HD-audio and USB-audio quirks" * tag 'sound-5.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (31 commits) ALSA: hda: Skip codec shutdown in case the codec is not registered ALSA: usb-audio: Correct quirk for VF0770 ALSA: Replace acpi_bus_get_device() Input: wm97xx: Simplify resource management ALSA: hda/realtek: Add quirk for ASUS GU603 ALSA: hda/realtek: Fix silent output on Gigabyte X570 Aorus Xtreme after reboot from Windows ALSA: hda/realtek: Fix silent output on Gigabyte X570S Aorus Master (newer chipset) ALSA: hda/realtek: Add missing fixup-model entry for Gigabyte X570 ALC1220 quirks ALSA: hda: realtek: Fix race at concurrent COEF updates ASoC: ops: Check for negative values before reading them ASoC: rt5682: Fix deadlock on resume ASoC: hdmi-codec: Fix OOB memory accesses ASoC: soc-pcm: Move debugfs removal out of spinlock ASoC: soc-pcm: Fix DPCM lockdep warning due to nested stream locks ASoC: fsl: Add missing error handling in pcm030_fabric_probe ALSA: hda: Fix signedness of sscanf() arguments ALSA: usb-audio: initialize variables that could ignore errors ALSA: hda: Fix UAF of leds class devs at unbinding ASoC: qdsp6: q6apm-dai: only stop graphs that are started ASoC: codecs: wcd938x: fix return value of mixer put function ... commit 31462d9e47cf6e2cb10a69c833b5e081fff7086d Merge: f9aaa5b05ea37 9ca3d3cd08575 Author: Linus Torvalds Date: Fri Feb 4 11:13:54 2022 -0800 Merge tag 'drm-fixes-2022-02-04' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Regular fixes for the week. Daniel has agreed to bring back the fbcon hw acceleration under a CONFIG option for the non-drm fbdev users, we don't advise turning this on unless you are in the niche that is old fbdev drivers, Since it's essentially a revert and shouldn't be high impact seemed like a good time to do it now. Otherwise, i915 and amdgpu fixes are most of it, along with some minor fixes elsewhere. fbdev: - readd fbcon acceleration i915: - fix DP monitor via type-c dock - fix for engine busyness and read timeout with GuC - use ALLOW_FAIL for error capture buffer allocs - don't use interruptible lock on error paths - smatch fix to reject zero sized overlays. amdgpu: - mGPU fan boost fix for beige goby - S0ix fixes - Cyan skillfish hang fix - DCN fixes for DCN 3.1 - DCN fixes for DCN 3.01 - Apple retina panel fix - ttm logic inversion fix dma-buf: - heaps: fix potential spectre v1 gadget kmb: - fix potential oob access mxsfb: - fix NULL ptr deref nouveau: - fix potential oob access during BIOS decode" * tag 'drm-fixes-2022-02-04' of git://anongit.freedesktop.org/drm/drm: (24 commits) drm: mxsfb: Fix NULL pointer dereference drm/amdgpu: fix logic inversion in check drm/amd: avoid suspend on dGPUs w/ s2idle support when runtime PM enabled drm/amd/display: Force link_rate as LINK_RATE_RBR2 for 2018 15" Apple Retina panels drm/amd/display: revert "Reset fifo after enable otg" drm/amd/display: watermark latencies is not enough on DCN31 drm/amd/display: Update watermark values for DCN301 drm/amdgpu: fix a potential GPU hang on cyan skillfish drm/amd: Only run s3 or s0ix if system is configured properly drm/amd: add support to check whether the system is set to s3 fbcon: Add option to enable legacy hardware acceleration Revert "fbcon: Disable accelerated scrolling" Revert "fbdev: Garbage collect fbdev scrolling acceleration, part 1 (from TODO list)" drm/i915/pmu: Fix KMD and GuC race on accessing busyness dma-buf: heaps: Fix potential spectre v1 gadget drm/amd: Warn users about potential s0ix problems drm/amd/pm: correct the MGpuFanBoost support for Beige Goby drm/nouveau: fix off by one in BIOS boundary checking drm/i915/adlp: Fix TypeC PHY-ready status readout drm/i915/pmu: Use PM timestamp instead of RING TIMESTAMP for reference ... commit 3c04d84508b54fcf524093b0d4a718680ed67f0f Author: Myrtle Shah Date: Thu Jan 20 15:33:37 2022 +0000 riscv: Fix XIP_FIXUP_FLASH_OFFSET There were several problems with the calculation. Not only was an 'and' being computed into t1 but thrown away; but the 'and' itself would cause problems if the granularity of the XIP physical address was less than XIP_OFFSET - in my case I had the kernel image at 2MB in SPI flash. Fixes: f9ace4ede49b ("riscv: remove .text section size limitation for XIP") Cc: stable@vger.kernel.org Signed-off-by: Myrtle Shah Signed-off-by: Palmer Dabbelt commit f9aaa5b05ea376f4917ff2c838c4641a100fd1e2 Merge: cff7f2237c2b4 07d2505b963b2 Author: Linus Torvalds Date: Fri Feb 4 10:34:19 2022 -0800 Merge branch 'akpm' (patches from Andrew) Merge misc fixes from Andrew Morton: "10 patches. Subsystems affected by this patch series: ipc, MAINTAINERS, and mm (vmscan, debug, pagemap, kmemleak, and selftests)" * emailed patches from Andrew Morton : kselftest/vm: revert "tools/testing/selftests/vm/userfaultfd.c: use swap() to make code cleaner" MAINTAINERS: update rppt's email mm/kmemleak: avoid scanning potential huge holes ipc/sem: do not sleep with a spin lock held mm/pgtable: define pte_index so that preprocessor could recognize it mm/page_table_check: check entries at pmd levels mm/khugepaged: unify collapse pmd clear, flush and free mm/page_table_check: use unsigned long for page counters and cleanup mm/debug_vm_pgtable: remove pte entry from the page table Revert "mm/page_isolation: unset migratetype directly for non Buddy page" commit 9d5505f1eebeca778074a0260ed077fd85f8792c Author: Dominik Brodowski Date: Sun Jan 30 22:03:20 2022 +0100 random: only call crng_finalize_init() for primary_crng crng_finalize_init() returns instantly if it is called for another pool than primary_crng. The test whether crng_finalize_init() is still required can be moved to the relevant caller in crng_reseed(), and crng_need_final_init can be reset to false if crng_finalize_init() is called with workqueues ready. Then, no previous callsite will call crng_finalize_init() unless it is needed, and we can get rid of the superfluous function parameter. Signed-off-by: Dominik Brodowski Signed-off-by: Jason A. Donenfeld commit ebf7606388732ecf2821ca21087e9446cb4a5b57 Author: Dominik Brodowski Date: Sun Jan 30 22:03:19 2022 +0100 random: access primary_pool directly rather than through pointer Both crng_initialize_primary() and crng_init_try_arch_early() are only called for the primary_pool. Accessing it directly instead of through a function parameter simplifies the code. Signed-off-by: Dominik Brodowski Signed-off-by: Jason A. Donenfeld commit 042e293e16e3aa9794ce60c29f5b7b0c8170f933 Author: Jason A. Donenfeld Date: Fri Jan 28 23:44:03 2022 +0100 random: wake up /dev/random writers after zap When account() is called, and the amount of entropy dips below random_write_wakeup_bits, we wake up the random writers, so that they can write some more in. However, the RNDZAPENTCNT/RNDCLEARPOOL ioctl sets the entropy count to zero -- a potential reduction just like account() -- but does not unblock writers. This commit adds the missing logic to that ioctl to unblock waiting writers. Reviewed-by: Dominik Brodowski Signed-off-by: Jason A. Donenfeld commit c321e907aa4803d562d6e70ebed9444ad082f953 Author: Dominik Brodowski Date: Tue Jan 25 21:14:57 2022 +0100 random: continually use hwgenerator randomness The rngd kernel thread may sleep indefinitely if the entropy count is kept above random_write_wakeup_bits by other entropy sources. To make best use of multiple sources of randomness, mix entropy from hardware RNGs into the pool at least once within CRNG_RESEED_INTERVAL. Cc: Herbert Xu Cc: Jason A. Donenfeld Signed-off-by: Dominik Brodowski Signed-off-by: Jason A. Donenfeld commit d2a02e3c8bb6b347818518edff5a4b40ff52d6d8 Author: Jason A. Donenfeld Date: Wed Jan 19 14:35:06 2022 +0100 lib/crypto: blake2s: avoid indirect calls to compression function for Clang CFI blake2s_compress_generic is weakly aliased by blake2s_compress. The current harness for function selection uses a function pointer, which is ordinarily inlined and resolved at compile time. But when Clang's CFI is enabled, CFI still triggers when making an indirect call via a weak symbol. This seems like a bug in Clang's CFI, as though it's bucketing weak symbols and strong symbols differently. It also only seems to trigger when "full LTO" mode is used, rather than "thin LTO". [ 0.000000][ T0] Kernel panic - not syncing: CFI failure (target: blake2s_compress_generic+0x0/0x1444) [ 0.000000][ T0] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.16.0-mainline-06981-g076c855b846e #1 [ 0.000000][ T0] Hardware name: MT6873 (DT) [ 0.000000][ T0] Call trace: [ 0.000000][ T0] dump_backtrace+0xfc/0x1dc [ 0.000000][ T0] dump_stack_lvl+0xa8/0x11c [ 0.000000][ T0] panic+0x194/0x464 [ 0.000000][ T0] __cfi_check_fail+0x54/0x58 [ 0.000000][ T0] __cfi_slowpath_diag+0x354/0x4b0 [ 0.000000][ T0] blake2s_update+0x14c/0x178 [ 0.000000][ T0] _extract_entropy+0xf4/0x29c [ 0.000000][ T0] crng_initialize_primary+0x24/0x94 [ 0.000000][ T0] rand_initialize+0x2c/0x6c [ 0.000000][ T0] start_kernel+0x2f8/0x65c [ 0.000000][ T0] __primary_switched+0xc4/0x7be4 [ 0.000000][ T0] Rebooting in 5 seconds.. Nonetheless, the function pointer method isn't so terrific anyway, so this patch replaces it with a simple boolean, which also gets inlined away. This successfully works around the Clang bug. In general, I'm not too keen on all of the indirection involved here; it clearly does more harm than good. Hopefully the whole thing can get cleaned up down the road when lib/crypto is overhauled more comprehensively. But for now, we go with a simple bandaid. Fixes: 6048fdcc5f26 ("lib/crypto: blake2s: include as built-in") Link: https://github.com/ClangBuiltLinux/linux/issues/1567 Reported-by: Miles Chen Tested-by: Miles Chen Tested-by: Nathan Chancellor Tested-by: John Stultz Acked-by: Nick Desaulniers Reviewed-by: Eric Biggers Signed-off-by: Jason A. Donenfeld commit 6a00ef4493706a23120057fafbc62379bcde11ec Author: Changbin Du Date: Mon Jan 17 23:44:33 2022 +0800 riscv: eliminate unreliable __builtin_frame_address(1) I tried different pieces of code which uses __builtin_frame_address(1) (with both gcc version 7.5.0 and 10.3.0) to verify whether it works as expected on riscv64. The result is negative. What the compiler had generated is as below: 31 fp = (unsigned long)__builtin_frame_address(1); 0xffffffff80006024 <+200>: ld s1,0(s0) It takes '0(s0)' as the address of frame 1 (caller), but the actual address should be '-16(s0)'. | ... | <-+ +-----------------+ | | return address | | | previous fp | | | saved registers | | | local variables | | $fp --> | ... | | +-----------------+ | | return address | | | previous fp --------+ | saved registers | $sp --> | local variables | +-----------------+ This leads the kernel can not dump the full stack trace on riscv. [ 7.222126][ T1] Call Trace: [ 7.222804][ T1] [] dump_backtrace+0x2c/0x3a This problem is not exposed on most riscv builds just because the '0(s0)' occasionally is the address frame 2 (caller's caller), if only ra and fp are stored in frame 1 (caller). | ... | <-+ +-----------------+ | | return address | | $fp --> | previous fp | | +-----------------+ | | return address | | | previous fp --------+ | saved registers | $sp --> | local variables | +-----------------+ This could be a *bug* of gcc that should be fixed. But as noted in gcc manual "Calling this function with a nonzero argument can have unpredictable effects, including crashing the calling program.", let's remove the '__builtin_frame_address(1)' in backtrace code. With this fix now it can show full stack trace: [ 10.444838][ T1] Call Trace: [ 10.446199][ T1] [] dump_backtrace+0x2c/0x3a [ 10.447711][ T1] [] show_stack+0x32/0x3e [ 10.448710][ T1] [] dump_stack_lvl+0x58/0x7a [ 10.449941][ T1] [] dump_stack+0x14/0x1c [ 10.450929][ T1] [] ubsan_epilogue+0x10/0x5a [ 10.451869][ T1] [] __ubsan_handle_load_invalid_value+0x6c/0x78 [ 10.453049][ T1] [] __pagevec_release+0x62/0x64 [ 10.455476][ T1] [] truncate_inode_pages_range+0x132/0x5be [ 10.456798][ T1] [] truncate_inode_pages+0x24/0x30 [ 10.457853][ T1] [] kill_bdev+0x32/0x3c ... Signed-off-by: Changbin Du Fixes: eac2f3059e02 ("riscv: stacktrace: fix the riscv stacktrace when CONFIG_FRAME_POINTER enabled") Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit cff7f2237c2b494a07c90f70291588d218b77e14 Merge: 1eb7de177d407 038b8d1d1ab1c Author: Linus Torvalds Date: Fri Feb 4 09:54:02 2022 -0800 Merge tag 'ceph-for-5.17-rc3' of git://github.com/ceph/ceph-client Pull ceph fixes from Ilya Dryomov: "A patch to make it possible to disable zero copy path in the messenger to avoid checksum or authentication tag mismatches and ensuing session resets in case the destination buffer isn't guaranteed to be stable" * tag 'ceph-for-5.17-rc3' of git://github.com/ceph/ceph-client: libceph: optionally use bounce buffer on recv path in crc mode libceph: make recv path in secure mode work the same as send path commit 1eb7de177d4073085e3a1cebf19d5d538d171f10 Merge: 633a8e8986eac 22e424feb6658 Author: Linus Torvalds Date: Fri Feb 4 09:44:42 2022 -0800 Merge tag '9p-for-5.17-rc3' of git://github.com/martinetd/linux Pull 9p fix from Dominique Martinet: "Fix 'cannot walk open fid' rule The 9p 'walk' operation requires fid arguments to not originate from an open or create call and we've missed that for a while as the servers regularly running tests with don't enforce the check and no active reviewer knew about the rule. Both reporters confirmed reverting this patch fixes things for them and looking at it further wasn't actually required... Will take more time for follow up and enforcing the rule more thoroughly later" * tag '9p-for-5.17-rc3' of git://github.com/martinetd/linux: Revert "fs/9p: search open fids first" commit 1a6229096bb501495442ab47761d746c1ae791e1 Author: Daniel Bristot de Oliveira Date: Fri Feb 4 17:24:04 2022 +0100 rtla/trace: Error message fixup Use capital and change "tracer %s" to "%s tracer". No functional change. Link: https://lkml.kernel.org/r/361697d27431afefa64c67c323564205385c418d.1643990447.git.bristot@kernel.org Fixes: b1696371d865 ("rtla: Helper functions for rtla") Cc: Daniel Bristot de Oliveira Cc: linux-kernel@vger.kernel.org Cc: linux-trace-devel@vger.kernel.org Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) commit f35491b861290a2c8258b5f70f9bb5d5ed2a1c6f Author: Daniel Bristot de Oliveira Date: Fri Feb 4 17:24:03 2022 +0100 rtla/utils: Fix session duration parsing Use gmtime to format the duration time. This avoids problems when the system uses local time different of Pisa's Local Time. Link: https://lkml.kernel.org/r/a2f0a37bc006c2561bb8ecd871cd70532b4a9f2d.1643990447.git.bristot@kernel.org Fixes: b1696371d865 ("rtla: Helper functions for rtla") Cc: Daniel Bristot de Oliveira Cc: linux-kernel@vger.kernel.org Cc: linux-trace-devel@vger.kernel.org Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) commit 8619e32825fd0af82d243e585b9aa6917b99a975 Author: Daniel Bristot de Oliveira Date: Fri Feb 4 17:24:02 2022 +0100 rtla: Follow kernel version To avoid having commits with new version, it is just easier to follow kernel version. Link: https://lkml.kernel.org/r/9c2df0d1de65cea96c7d731fe64781a2bb90c5b3.1643990447.git.bristot@kernel.org Cc: Daniel Bristot de Oliveira Cc: linux-kernel@vger.kernel.org Cc: linux-trace-devel@vger.kernel.org Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt (Google) commit 633a8e8986eac2c9e32c76ccb9cfe0e5a898b314 Merge: dcb85f85fa6f1 d3b331fb51f32 Author: Linus Torvalds Date: Fri Feb 4 09:34:37 2022 -0800 Merge tag '5.17-rc3-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6 Pull cifs fixes from Steve French: "SMB3 client fixes including: - multiple fscache related fixes, reenabling ability to read/write to cached files for cifs.ko (that was temporarily disabled for cifs.ko a few weeks ago due to the recent fscache changes) - also includes a new fscache helper function ("query_occupancy") used by above - fix for multiuser mounts and NTLMSSP auth (workstation name) for stable - fix locking ordering problem in multichannel code - trivial malformed comment fix" * tag '5.17-rc3-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6: cifs: fix workstation_name for multiuser mounts Invalidate fscache cookie only when inode attributes are changed. cifs: Fix the readahead conversion to manage the batch when reading from cache cifs: Implement cache I/O by accessing the cache directly netfs, cachefiles: Add a method to query presence of data in the cache cifs: Transition from ->readpages() to ->readahead() cifs: unlock chan_lock before calling cifs_put_tcp_session Fix a warning about a malformed kernel doc comment in cifs commit 07d2505b963b2d30f747dce338211f51068b8765 Author: Shuah Khan Date: Thu Feb 3 20:49:45 2022 -0800 kselftest/vm: revert "tools/testing/selftests/vm/userfaultfd.c: use swap() to make code cleaner" With this change, userfaultfd fails to build with undefined reference swap() error: userfaultfd.c: In function `userfaultfd_stress': userfaultfd.c:1530:17: warning: implicit declaration of function `swap'; did you mean `swab'? [-Wimplicit-function-declaration] 1530 | swap(area_src, area_dst); | ^~~~ | swab /usr/bin/ld: /tmp/ccDGOAdV.o: in function `userfaultfd_stress': userfaultfd.c:(.text+0x549e): undefined reference to `swap' /usr/bin/ld: userfaultfd.c:(.text+0x54bc): undefined reference to `swap' collect2: error: ld returned 1 exit status Revert the commit to fix the problem. Link: https://lkml.kernel.org/r/20220202003340.87195-1-skhan@linuxfoundation.org Fixes: 2c769ed7137a ("tools/testing/selftests/vm/userfaultfd.c: use swap() to make code cleaner") Signed-off-by: Shuah Khan Cc: Shuah Khan Cc: Minghao Chi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 6a0fb704b05cd143dfe2c6a4969c41c59a04b330 Author: Mike Rapoport Date: Thu Feb 3 20:49:41 2022 -0800 MAINTAINERS: update rppt's email Use my @kernel.org address Link: https://lkml.kernel.org/r/20220203090324.3701774-1-rppt@kernel.org Signed-off-by: Mike Rapoport Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c10a0f877fe007021d70f9cada240f42adc2b5db Author: Lang Yu Date: Thu Feb 3 20:49:37 2022 -0800 mm/kmemleak: avoid scanning potential huge holes When using devm_request_free_mem_region() and devm_memremap_pages() to add ZONE_DEVICE memory, if requested free mem region's end pfn were huge(e.g., 0x400000000), the node_end_pfn() will be also huge (see move_pfn_range_to_zone()). Thus it creates a huge hole between node_start_pfn() and node_end_pfn(). We found on some AMD APUs, amdkfd requested such a free mem region and created a huge hole. In such a case, following code snippet was just doing busy test_bit() looping on the huge hole. for (pfn = start_pfn; pfn < end_pfn; pfn++) { struct page *page = pfn_to_online_page(pfn); if (!page) continue; ... } So we got a soft lockup: watchdog: BUG: soft lockup - CPU#6 stuck for 26s! [bash:1221] CPU: 6 PID: 1221 Comm: bash Not tainted 5.15.0-custom #1 RIP: 0010:pfn_to_online_page+0x5/0xd0 Call Trace: ? kmemleak_scan+0x16a/0x440 kmemleak_write+0x306/0x3a0 ? common_file_perm+0x72/0x170 full_proxy_write+0x5c/0x90 vfs_write+0xb9/0x260 ksys_write+0x67/0xe0 __x64_sys_write+0x1a/0x20 do_syscall_64+0x3b/0xc0 entry_SYSCALL_64_after_hwframe+0x44/0xae I did some tests with the patch. (1) amdgpu module unloaded before the patch: real 0m0.976s user 0m0.000s sys 0m0.968s after the patch: real 0m0.981s user 0m0.000s sys 0m0.973s (2) amdgpu module loaded before the patch: real 0m35.365s user 0m0.000s sys 0m35.354s after the patch: real 0m1.049s user 0m0.000s sys 0m1.042s Link: https://lkml.kernel.org/r/20211108140029.721144-1-lang.yu@amd.com Signed-off-by: Lang Yu Acked-by: David Hildenbrand Acked-by: Catalin Marinas Cc: Oscar Salvador Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 520ba724061cef59763e2b6f5b26e8387c2e5822 Author: Minghao Chi Date: Thu Feb 3 20:49:33 2022 -0800 ipc/sem: do not sleep with a spin lock held We can't call kvfree() with a spin lock held, so defer it. Link: https://lkml.kernel.org/r/20211223031207.556189-1-chi.minghao@zte.com.cn Fixes: fc37a3b8b438 ("[PATCH] ipc sem: use kvmalloc for sem_undo allocation") Reported-by: Zeal Robot Signed-off-by: Minghao Chi Reviewed-by: Shakeel Butt Reviewed-by: Manfred Spraul Cc: Arnd Bergmann Cc: Yang Guang Cc: Davidlohr Bueso Cc: Randy Dunlap Cc: Bhaskar Chowdhury Cc: Vasily Averin Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 314c459a6fe0957b5885fbc65c53d51444092880 Author: Mike Rapoport Date: Thu Feb 3 20:49:29 2022 -0800 mm/pgtable: define pte_index so that preprocessor could recognize it Since commit 974b9b2c68f3 ("mm: consolidate pte_index() and pte_offset_*() definitions") pte_index is a static inline and there is no define for it that can be recognized by the preprocessor. As a result, vm_insert_pages() uses slower loop over vm_insert_page() instead of insert_pages() that amortizes the cost of spinlock operations when inserting multiple pages. Link: https://lkml.kernel.org/r/20220111145457.20748-1-rppt@kernel.org Fixes: 974b9b2c68f3 ("mm: consolidate pte_index() and pte_offset_*() definitions") Signed-off-by: Mike Rapoport Reported-by: Christian Dietrich Reviewed-by: Khalid Aziz Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 80110bbfbba6f0078d5a1cbc8df004506db8ffe5 Author: Pasha Tatashin Date: Thu Feb 3 20:49:24 2022 -0800 mm/page_table_check: check entries at pmd levels syzbot detected a case where the page table counters were not properly updated. syzkaller login: ------------[ cut here ]------------ kernel BUG at mm/page_table_check.c:162! invalid opcode: 0000 [#1] PREEMPT SMP KASAN CPU: 0 PID: 3099 Comm: pasha Not tainted 5.16.0+ #48 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIO4 RIP: 0010:__page_table_check_zero+0x159/0x1a0 Call Trace: free_pcp_prepare+0x3be/0xaa0 free_unref_page+0x1c/0x650 free_compound_page+0xec/0x130 free_transhuge_page+0x1be/0x260 __put_compound_page+0x90/0xd0 release_pages+0x54c/0x1060 __pagevec_release+0x7c/0x110 shmem_undo_range+0x85e/0x1250 ... The repro involved having a huge page that is split due to uprobe event temporarily replacing one of the pages in the huge page. Later the huge page was combined again, but the counters were off, as the PTE level was not properly updated. Make sure that when PMD is cleared and prior to freeing the level the PTEs are updated. Link: https://lkml.kernel.org/r/20220131203249.2832273-5-pasha.tatashin@soleen.com Fixes: df4e817b7108 ("mm: page table check") Signed-off-by: Pasha Tatashin Acked-by: David Rientjes Cc: Aneesh Kumar K.V Cc: Anshuman Khandual Cc: Dave Hansen Cc: Greg Thelen Cc: H. Peter Anvin Cc: Hugh Dickins Cc: Ingo Molnar Cc: Jiri Slaby Cc: Mike Rapoport Cc: Muchun Song Cc: Paul Turner Cc: Wei Xu Cc: Will Deacon Cc: Zi Yan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e59a47b8a45353d9ee234aab2d229474e09885df Author: Pasha Tatashin Date: Thu Feb 3 20:49:20 2022 -0800 mm/khugepaged: unify collapse pmd clear, flush and free Unify the code that flushes, clears pmd entry, and frees the PTE table level into a new function collapse_and_free_pmd(). This cleanup is useful as in the next patch we will add another call to this function to iterate through PTE prior to freeing the level for page table check. Link: https://lkml.kernel.org/r/20220131203249.2832273-4-pasha.tatashin@soleen.com Signed-off-by: Pasha Tatashin Acked-by: David Rientjes Cc: Aneesh Kumar K.V Cc: Anshuman Khandual Cc: Dave Hansen Cc: Greg Thelen Cc: H. Peter Anvin Cc: Hugh Dickins Cc: Ingo Molnar Cc: Jiri Slaby Cc: Mike Rapoport Cc: Muchun Song Cc: Paul Turner Cc: Wei Xu Cc: Will Deacon Cc: Zi Yan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 64d8b9e14512ceb7bf11b235faeb8531aeb4d9d3 Author: Pasha Tatashin Date: Thu Feb 3 20:49:15 2022 -0800 mm/page_table_check: use unsigned long for page counters and cleanup For consistency, use "unsigned long" for all page counters. Also, reduce code duplication by calling __page_table_check_*_clear() from __page_table_check_*_set() functions. Link: https://lkml.kernel.org/r/20220131203249.2832273-3-pasha.tatashin@soleen.com Signed-off-by: Pasha Tatashin Reviewed-by: Wei Xu Acked-by: David Rientjes Cc: Aneesh Kumar K.V Cc: Anshuman Khandual Cc: Dave Hansen Cc: Greg Thelen Cc: H. Peter Anvin Cc: Hugh Dickins Cc: Ingo Molnar Cc: Jiri Slaby Cc: Mike Rapoport Cc: Muchun Song Cc: Paul Turner Cc: Will Deacon Cc: Zi Yan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit fb5222aae64fe25e5f3ebefde8214dcf3ba33ca5 Author: Pasha Tatashin Date: Thu Feb 3 20:49:10 2022 -0800 mm/debug_vm_pgtable: remove pte entry from the page table Patch series "page table check fixes and cleanups", v5. This patch (of 4): The pte entry that is used in pte_advanced_tests() is never removed from the page table at the end of the test. The issue is detected by page_table_check, to repro compile kernel with the following configs: CONFIG_DEBUG_VM_PGTABLE=y CONFIG_PAGE_TABLE_CHECK=y CONFIG_PAGE_TABLE_CHECK_ENFORCED=y During the boot the following BUG is printed: debug_vm_pgtable: [debug_vm_pgtable ]: Validating architecture page table helpers ------------[ cut here ]------------ kernel BUG at mm/page_table_check.c:162! invalid opcode: 0000 [#1] PREEMPT SMP PTI CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.16.0-11413-g2c271fe77d52 #3 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014 ... The entry should be properly removed from the page table before the page is released to the free list. Link: https://lkml.kernel.org/r/20220131203249.2832273-1-pasha.tatashin@soleen.com Link: https://lkml.kernel.org/r/20220131203249.2832273-2-pasha.tatashin@soleen.com Fixes: a5c3b9ffb0f4 ("mm/debug_vm_pgtable: add tests validating advanced arch page table helpers") Signed-off-by: Pasha Tatashin Reviewed-by: Zi Yan Tested-by: Zi Yan Acked-by: David Rientjes Reviewed-by: Anshuman Khandual Cc: Paul Turner Cc: Wei Xu Cc: Greg Thelen Cc: Ingo Molnar Cc: Will Deacon Cc: Mike Rapoport Cc: Dave Hansen Cc: H. Peter Anvin Cc: Aneesh Kumar K.V Cc: Jiri Slaby Cc: Muchun Song Cc: Hugh Dickins Cc: [5.9+] Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a85468b766d3bc17c8b17ed23a36ef6469340bb2 Author: Chen Wandun Date: Thu Feb 3 20:49:06 2022 -0800 Revert "mm/page_isolation: unset migratetype directly for non Buddy page" This reverts commit 721fb891ad0b3956d5c168b2931e3e5e4fb7ca40. Commit 721fb891ad0b ("mm/page_isolation: unset migratetype directly for non Buddy page") will result memory that should in buddy disappear by mistake. move_freepages_block moves all pages in pageblock instead of pages indicated by input parameter, so if input pages is not in buddy but other pages in pageblock is in buddy, it will result in page out of control. Link: https://lkml.kernel.org/r/20220126024436.13921-1-chenwandun@huawei.com Fixes: 721fb891ad0b ("mm/page_isolation: unset migratetype directly for non Buddy page") Signed-off-by: Chen Wandun Reported-by: "kernelci.org bot" Acked-by: David Hildenbrand Tested-by: Dong Aisheng Tested-by: Francesco Dolcini Acked-by: Vlastimil Babka Tested-by: Guenter Roeck Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 40106e005bd9764f84ef9e6c0979fe1126d7ff02 Merge: fe68195daf34d d1ca60efc53d6 Author: Jakub Kicinski Date: Fri Feb 4 08:47:41 2022 -0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf Pablo Neira Ayuso says: ==================== Netfilter fixes for net 1) Don't refresh timeout for SCTP flows in CLOSED state. 2) Don't allow access to transport header if fragment offset is set on. 3) Reinitialize internal conntrack state for retransmitted TCP syn-ack packet. 4) Update MAINTAINER file to add the Netfilter group tree. Moving forward, Florian Westphal has access to this tree so he can also send pull requests. 5) Set on IPS_HELPER for entries created via ctnetlink, otherwise NAT might zap it. All patches from Florian Westphal. * git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf: netfilter: ctnetlink: disable helper autoassign MAINTAINERS: netfilter: update git links netfilter: conntrack: re-init state for retransmitted syn-ack netfilter: conntrack: move synack init code to helper netfilter: nft_payload: don't allow th access for fragments netfilter: conntrack: don't refresh sctp entries in closed state ==================== Link: https://lore.kernel.org/r/20220204151903.320786-1-pablo@netfilter.org Signed-off-by: Jakub Kicinski commit f0a6fd1527067da537e9c48390237488719948ed Author: Johannes Berg Date: Tue Feb 1 14:09:51 2022 +0100 cfg80211: fix race in netlink owner interface destruction My previous fix here to fix the deadlock left a race where the exact same deadlock (see the original commit referenced below) can still happen if cfg80211_destroy_ifaces() already runs while nl80211_netlink_notify() is still marking some interfaces as nl_owner_dead. The race happens because we have two loops here - first we dev_close() all the netdevs, and then we destroy them. If we also have two netdevs (first one need only be a wdev though) then we can find one during the first iteration, close it, and go to the second iteration -- but then find two, and try to destroy also the one we didn't close yet. Fix this by only iterating once. Reported-by: Toke Høiland-Jørgensen Fixes: ea6b2098dd02 ("cfg80211: fix locking in netlink owner interface destruction") Tested-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/r/20220201130951.22093-1-johannes@sipsolutions.net Signed-off-by: Johannes Berg commit c0689e46be23160d925dca95dfc411f1a0462708 Author: Jonas Malaco Date: Thu Feb 3 13:49:52 2022 -0300 eeprom: ee1004: limit i2c reads to I2C_SMBUS_BLOCK_MAX Commit effa453168a7 ("i2c: i801: Don't silently correct invalid transfer size") revealed that ee1004_eeprom_read() did not properly limit how many bytes to read at once. In particular, i2c_smbus_read_i2c_block_data_or_emulated() takes the length to read as an u8. If count == 256 after taking into account the offset and page boundary, the cast to u8 overflows. And this is common when user space tries to read the entire EEPROM at once. To fix it, limit each read to I2C_SMBUS_BLOCK_MAX (32) bytes, already the maximum length i2c_smbus_read_i2c_block_data_or_emulated() allows. Fixes: effa453168a7 ("i2c: i801: Don't silently correct invalid transfer size") Cc: stable@vger.kernel.org Reviewed-by: Heiner Kallweit Signed-off-by: Jonas Malaco Link: https://lore.kernel.org/r/20220203165024.47767-1-jonas@protocubo.io Signed-off-by: Greg Kroah-Hartman commit 28cb138f559f8c1a1395f5564f86b8bbee83631b Author: Jakob Koschel Date: Thu Jan 27 15:44:05 2022 +0100 vt_ioctl: add array_index_nospec to VT_ACTIVATE in vt_setactivate an almost identical code path has been patched with array_index_nospec. In the VT_ACTIVATE path the user input is from a system call argument instead of a usercopy. For consistency both code paths should have the same mitigations applied. Kasper Acknowledgements: Jakob Koschel, Brian Johannesmeyer, Kaveh Razavi, Herbert Bos, Cristiano Giuffrida from the VUSec group at VU Amsterdam. Co-developed-by: Brian Johannesmeyer Signed-off-by: Brian Johannesmeyer Signed-off-by: Jakob Koschel Link: https://lore.kernel.org/r/20220127144406.3589293-2-jakobkoschel@gmail.com Cc: stable Signed-off-by: Greg Kroah-Hartman commit 61cc70d9e8ef5b042d4ed87994d20100ec8896d9 Author: Jakob Koschel Date: Thu Jan 27 15:44:04 2022 +0100 vt_ioctl: fix array_index_nospec in vt_setactivate array_index_nospec ensures that an out-of-bounds value is set to zero on the transient path. Decreasing the value by one afterwards causes a transient integer underflow. vsa.console should be decreased first and then sanitized with array_index_nospec. Kasper Acknowledgements: Jakob Koschel, Brian Johannesmeyer, Kaveh Razavi, Herbert Bos, Cristiano Giuffrida from the VUSec group at VU Amsterdam. Co-developed-by: Brian Johannesmeyer Signed-off-by: Brian Johannesmeyer Signed-off-by: Jakob Koschel Link: https://lore.kernel.org/r/20220127144406.3589293-1-jakobkoschel@gmail.com Cc: stable Signed-off-by: Greg Kroah-Hartman commit 5d5ead5e1cafa6a6076e8c3b55f707eafc76bfbd Author: Andy Shevchenko Date: Thu Feb 3 17:00:26 2022 +0200 serial: 8250_pericom: Revert "Re-enable higher baud rates" UPF_MAGIC_MULTIPLIER is userspace available bit and can be changed at any time. There is no sense to rely on it to be always present. This reverts commit b4ccaf5aa2d795ee7f47a6eeb209f3de981e1929. Note, that code was not reliably worked before, hence it implies no functional change. Signed-off-by: Andy Shevchenko Fixes: b4ccaf5aa2d7 ("serial: 8250_pericom: Re-enable higher baud rates") Link: https://lore.kernel.org/r/20220203150026.19087-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 9b45a7738eec52bf0f5d8d3d54e822962781c5f2 Author: Joerg Roedel Date: Fri Feb 4 12:55:37 2022 +0100 iommu/amd: Fix loop timeout issue in iommu_ga_log_enable() The polling loop for the register change in iommu_ga_log_enable() needs to have a udelay() in it. Otherwise the CPU might be faster than the IOMMU hardware and wrongly trigger the WARN_ON() further down the code stream. Use a 10us for udelay(), has there is some hardware where activation of the GA log can take more than a 100ms. A future optimization should move the activation check of the GA log to the point where it gets used for the first time. But that is a bigger change and not suitable for a fix. Fixes: 8bda0cfbdc1a ("iommu/amd: Detect and initialize guest vAPIC log") Signed-off-by: Joerg Roedel Link: https://lore.kernel.org/r/20220204115537.3894-1-joro@8bytes.org commit fe68195daf34d5dddacd3f93dd3eafc4beca3a0e Author: Samuel Mendoza-Jonas Date: Thu Feb 3 14:49:16 2022 -0800 ixgbevf: Require large buffers for build_skb on 82599VF From 4.17 onwards the ixgbevf driver uses build_skb() to build an skb around new data in the page buffer shared with the ixgbe PF. This uses either a 2K or 3K buffer, and offsets the DMA mapping by NET_SKB_PAD + NET_IP_ALIGN. When using a smaller buffer RXDCTL is set to ensure the PF does not write a full 2K bytes into the buffer, which is actually 2K minus the offset. However on the 82599 virtual function, the RXDCTL mechanism is not available. The driver attempts to work around this by using the SET_LPE mailbox method to lower the maximm frame size, but the ixgbe PF driver ignores this in order to keep the PF and all VFs in sync[0]. This means the PF will write up to the full 2K set in SRRCTL, causing it to write NET_SKB_PAD + NET_IP_ALIGN bytes past the end of the buffer. With 4K pages split into two buffers, this means it either writes NET_SKB_PAD + NET_IP_ALIGN bytes past the first buffer (and into the second), or NET_SKB_PAD + NET_IP_ALIGN bytes past the end of the DMA mapping. Avoid this by only enabling build_skb when using "large" buffers (3K). These are placed in each half of an order-1 page, preventing the PF from writing past the end of the mapping. [0]: Technically it only ever raises the max frame size, see ixgbe_set_vf_lpe() in ixgbe_sriov.c Fixes: f15c5ba5b6cd ("ixgbevf: add support for using order 1 pages to receive large frames") Signed-off-by: Samuel Mendoza-Jonas Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen Signed-off-by: David S. Miller commit dd7f5a11ac5a6f733f422dc22b4d145d3260304e Author: Thomas Gleixner Date: Mon Jan 31 22:02:46 2022 +0100 PCI/MSI: Remove bogus warning in pci_irq_get_affinity() The recent overhaul of pci_irq_get_affinity() introduced a regression when pci_irq_get_affinity() is called for an MSI-X interrupt which was not allocated with affinity descriptor information. The original code just returned a NULL pointer in that case, but the rework added a WARN_ON() under the assumption that the corresponding WARN_ON() in the MSI case can be applied to MSI-X as well. In fact the MSI warning in the original code does not make sense either because it's legitimate to invoke pci_irq_get_affinity() for a MSI interrupt which was not allocated with affinity descriptor information. Remove it and just return NULL as the original code did. Fixes: f48235900182 ("PCI/MSI: Simplify pci_irq_get_affinity()") Reported-by: Guenter Roeck Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/87ee4n38sm.ffs@tglx commit 6e37ec8825a113bc2dd1b280be10e5ac6eb4f6b1 Author: Sean Christopherson Date: Wed Feb 2 00:51:57 2022 +0000 KVM: x86: Use ERR_PTR_USR() to return -EFAULT as a __user pointer Use ERR_PTR_USR() when returning -EFAULT from kvm_get_attr_addr(), sparse complains about implicitly casting the kernel pointer from ERR_PTR() into a __user pointer. >> arch/x86/kvm/x86.c:4342:31: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected void [noderef] __user * @@ got void * @@ arch/x86/kvm/x86.c:4342:31: sparse: expected void [noderef] __user * arch/x86/kvm/x86.c:4342:31: sparse: got void * >> arch/x86/kvm/x86.c:4342:31: sparse: sparse: incorrect type in return expression (different address spaces) @@ expected void [noderef] __user * @@ got void * @@ arch/x86/kvm/x86.c:4342:31: sparse: expected void [noderef] __user * arch/x86/kvm/x86.c:4342:31: sparse: got void * No functional change intended. Fixes: 56f289a8d23a ("KVM: x86: Add a helper to retrieve userspace address from kvm_device_attr") Reported-by: kernel test robot Signed-off-by: Sean Christopherson Message-Id: <20220202005157.2545816-1-seanjc@google.com> Signed-off-by: Paolo Bonzini commit e6b03375132fefddc55cf700418cf794b3884e0c Author: Lutz Koschorreck Date: Fri Jan 28 20:31:50 2022 +0100 arm64: dts: meson-sm1-odroid: fix boot loop after reboot Since the correct gpio pin is used for enabling tf-io regulator the system did not boot correctly after calling reboot. [ 36.862443] reboot: Restarting system bl31 reboot reason: 0xd bl31 reboot reason: 0x0 system cmd 1. SM1:BL:511f6b:81ca2f;FEAT:A0F83180:20282000;POC:B;RCY:0;SPINOR:0;CHK:1F;EMMC:800;NAND:81;SD?:0;SD:0;READ:0;0.0;CHK:0; bl2_stage_init 0x01 bl2_stage_init 0x81 hw id: SM1:BL:511f6b:81ca2f;FEAT:A0F83180:20282000;POC:B;RCY:0;SPINOR:0;CHK:1F;EMMC:800;NAND:81;SD?:0;SD:400;USB:8;LOOP:1;... Setting the gpio to open drain solves the issue. Fixes: 1f80a5cf74a6 ("arm64: dts: meson-sm1-odroid: add missing enable gpio and supply for tf_io regulator") Signed-off-by: Lutz Koschorreck Reviewed-by: Neil Armstrong [narmstrong: reduced serial log & removed invalid character in commit message] Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20220128193150.GA1304381@odroid-VirtualBox commit f26573e2bc9dfd551a0d5c6971f18cc546543312 Author: Christian Hewitt Date: Wed Jan 26 04:49:54 2022 +0000 arm64: dts: meson-g12: drop BL32 region from SEI510/SEI610 The BL32/TEE reserved-memory region is now inherited from the common family dtsi (meson-g12-common) so we can drop it from board files. Signed-off-by: Christian Hewitt Reviewed-by: Neil Armstrong Reviewed-by: Kevin Hilman Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20220126044954.19069-4-christianshewitt@gmail.com commit 08982a1b3aa2611c9c711d24825c9002d28536f4 Author: Christian Hewitt Date: Wed Jan 26 04:49:53 2022 +0000 arm64: dts: meson-g12: add ATF BL32 reserved-memory region Add an additional reserved memory region for the BL32 trusted firmware present in many devices that boot from Amlogic vendor u-boot. Signed-off-by: Christian Hewitt Reviewed-by: Neil Armstrong Reviewed-by: Kevin Hilman Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20220126044954.19069-3-christianshewitt@gmail.com commit 76577c9137456febb05b0e17d244113196a98968 Author: Christian Hewitt Date: Wed Jan 26 04:49:52 2022 +0000 arm64: dts: meson-gx: add ATF BL32 reserved-memory region Add an additional reserved memory region for the BL32 trusted firmware present in many devices that boot from Amlogic vendor u-boot. Suggested-by: Mateusz Krzak Signed-off-by: Christian Hewitt Reviewed-by: Neil Armstrong Reviewed-by: Kevin Hilman Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20220126044954.19069-2-christianshewitt@gmail.com commit a5be3e5d46f373fe1d2ee835c7ede31769c241cd Author: Dongjin Kim Date: Fri Jan 28 00:16:56 2022 +0900 arm64: dts: meson-sm1-bananapi-m5: fix wrong GPIO domain for GPIOE_2 GPIOE_2 is in AO domain and "<&gpio GPIOE_2 ...>" changes the state of TF_PWR_EN of 'FC8731' on BPI-M5 Fixes: 976e920183e4 ("arm64: dts: meson-sm1: add Banana PI BPI-M5 board dts") Signed-off-by: Dongjin Kim Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20220127151656.GA2419733@paju commit 323ca765bfe9d637fa774373baec0bc41e51fcfa Author: Lutz Koschorreck Date: Thu Jan 27 14:05:37 2022 +0100 arm64: dts: meson-sm1-odroid: use correct enable-gpio pin for tf-io regulator The interrupt pin of the external ethernet phy is used, instead of the enable-gpio pin of the tf-io regulator. The GPIOE_2 pin is located in the gpio_ao bank. This causes phy interrupt problems at system startup. [ 76.645190] irq 36: nobody cared (try booting with the "irqpoll" option) [ 76.649617] CPU: 0 PID: 1416 Comm: irq/36-0.0:00 Not tainted 5.16.0 #2 [ 76.649629] Hardware name: Hardkernel ODROID-HC4 (DT) [ 76.649635] Call trace: [ 76.649638] dump_backtrace+0x0/0x1c8 [ 76.649658] show_stack+0x14/0x60 [ 76.649667] dump_stack_lvl+0x64/0x7c [ 76.649676] dump_stack+0x14/0x2c [ 76.649683] __report_bad_irq+0x38/0xe8 [ 76.649695] note_interrupt+0x220/0x3a0 [ 76.649704] handle_irq_event_percpu+0x58/0x88 [ 76.649713] handle_irq_event+0x44/0xd8 [ 76.649721] handle_fasteoi_irq+0xa8/0x130 [ 76.649730] generic_handle_domain_irq+0x38/0x58 [ 76.649738] gic_handle_irq+0x9c/0xb8 [ 76.649747] call_on_irq_stack+0x28/0x38 [ 76.649755] do_interrupt_handler+0x7c/0x80 [ 76.649763] el1_interrupt+0x34/0x80 [ 76.649772] el1h_64_irq_handler+0x14/0x20 [ 76.649781] el1h_64_irq+0x74/0x78 [ 76.649788] irq_finalize_oneshot.part.56+0x68/0xf8 [ 76.649796] irq_thread_fn+0x5c/0x98 [ 76.649804] irq_thread+0x13c/0x260 [ 76.649812] kthread+0x144/0x178 [ 76.649822] ret_from_fork+0x10/0x20 [ 76.649830] handlers: [ 76.653170] [<0000000025a6cd31>] irq_default_primary_handler threaded [<0000000093580eb7>] phy_interrupt [ 76.661256] Disabling IRQ #36 Fixes: 1f80a5cf74a6 ("arm64: dts: meson-sm1-odroid: add missing enable gpio and supply for tf_io regulator") Signed-off-by: Lutz Koschorreck Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong [narmstrong: removed spurious invalid & blank lines from commit message] Link: https://lore.kernel.org/r/20220127130537.GA187347@odroid-VirtualBox commit bc41099f060ea74ac8d02c51bd0f5f46d969bedf Author: Dongjin Kim Date: Thu Jan 27 21:29:25 2022 +0900 arm64: dts: meson-g12b-odroid-n2: fix typo 'dio2133' Typo in audio amplifier node, dioo2133 -> dio2133 Signed-off-by: Dongjin Kim Fixes: ef599f5f3e10 ("arm64: dts: meson: convert ODROID-N2 to dtsi") Fixes: 67d141c1f8e6 ("arm64: dts: meson: odroid-n2: add jack audio output support") Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/YfKQJejh0bfGYvof@anyang commit e3bcfda012edd3564e12551b212afbd2521a1f68 Author: Jim Mattson Date: Thu Feb 3 16:13:48 2022 -0800 KVM: x86: Report deprecated x87 features in supported CPUID CPUID.(EAX=7,ECX=0):EBX.FDP_EXCPTN_ONLY[bit 6] and CPUID.(EAX=7,ECX=0):EBX.ZERO_FCS_FDS[bit 13] are "defeature" bits. Unlike most of the other CPUID feature bits, these bits are clear if the features are present and set if the features are not present. These bits should be reported in KVM_GET_SUPPORTED_CPUID, because if these bits are set on hardware, they cannot be cleared in the guest CPUID. Doing so would claim guest support for a feature that the hardware doesn't support and that can't be efficiently emulated. Of course, any software (e.g WIN87EM.DLL) expecting these features to be present likely predates these CPUID feature bits and therefore doesn't know to check for them anyway. Aaron Lewis added the corresponding X86_FEATURE macros in commit cbb99c0f5887 ("x86/cpufeatures: Add FDP_EXCPTN_ONLY and ZERO_FCS_FDS"), with the intention of reporting these bits in KVM_GET_SUPPORTED_CPUID, but I was unable to find a proposed patch on the kvm list. Opportunistically reordered the CPUID_7_0_EBX capability bits from least to most significant. Cc: Aaron Lewis Signed-off-by: Jim Mattson Message-Id: <20220204001348.2844660-1-jmattson@google.com> Signed-off-by: Paolo Bonzini commit ac9f0c810684a1b161c18eb4b91ce84cbc13c91d Author: Anton Lundin Date: Thu Feb 3 10:41:35 2022 +0100 ata: libata-core: Introduce ATA_HORKAGE_NO_LOG_DIR horkage 06f6c4c6c3e8 ("ata: libata: add missing ata_identify_page_supported() calls") introduced additional calls to ata_identify_page_supported(), thus also adding indirectly accesses to the device log directory log page through ata_log_supported(). Reading this log page causes SATADOM-ML 3ME devices to lock up. Introduce the horkage flag ATA_HORKAGE_NO_LOG_DIR to prevent accesses to the log directory in ata_log_supported() and add a blacklist entry with this flag for "SATADOM-ML 3ME" devices. Fixes: 636f6e2af4fb ("libata: add horkage for missing Identify Device log") Cc: stable@vger.kernel.org # v5.10+ Signed-off-by: Anton Lundin Signed-off-by: Damien Le Moal commit d052c5d3a35fcea2d9089d76e295d7af713e8865 Author: Sergey Shtylyov Date: Thu Feb 3 22:47:09 2022 +0300 MAINTAINERS: add myself as Renesas R-Car SATA driver reviewer Add myself as a reviewer for the Renesas R-Car SATA driver -- I don't have the hardware anymore (Geert Uytterhoeven does have a lot of hardware!) but I do have the manuals still! :-) Signed-off-by: Sergey Shtylyov Acked-by: Geert Uytterhoeven Signed-off-by: Damien Le Moal commit f9929ef6a2a55f03aac61248c6a3a987b8546f2a Author: Namjae Jeon Date: Tue Feb 1 18:20:34 2022 +0900 ksmbd: add support for key exchange When mounting cifs client, can see the following warning message. CIFS: decode_ntlmssp_challenge: authentication has been weakened as server does not support key exchange To remove this warning message, Add support for key exchange feature to ksmbd. This patch decrypts 16-byte ciphertext value sent by the client using RC4 with session key. The decrypted value is the recovered secondary key that will use instead of the session key for signing and sealing. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit deae24b0b13ff5f46022124fbfc2c72fc534bc6a Author: Namjae Jeon Date: Sun Jan 30 18:28:11 2022 +0900 ksmbd: reduce smb direct max read/write size ksmbd does not support more than one Buffer Descriptor V1 element in an smbdirect protocol request. Reducing the maximum read/write size to about 512KB allows interoperability with Windows over a wider variety of RDMA NICs, as an interim workaround. Reviewed-by: Tom Talpey Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 04e260948a160d3b7d622bf4c8a96fa4577c09bd Author: Namjae Jeon Date: Sun Jan 30 18:31:01 2022 +0900 ksmbd: don't align last entry offset in smb2 query directory When checking smb2 query directory packets from other servers, OutputBufferLength is different with ksmbd. Other servers add an unaligned next offset to OutputBufferLength for the last entry. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 97550c7478a2da93e348d8c3075d92cddd473a78 Author: Namjae Jeon Date: Sun Jan 30 18:28:56 2022 +0900 ksmbd: fix same UniqueId for dot and dotdot entries ksmbd sets the inode number to UniqueId. However, the same UniqueId for dot and dotdot entry is set to the inode number of the parent inode. This patch set them using the current inode and parent inode. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 6d896d3b44cf64ab9b2483697e222098e7b72f70 Author: Hyunchul Lee Date: Thu Jan 20 21:10:11 2022 +0900 ksmbd: smbd: validate buffer descriptor structures Check ChannelInfoOffset and ChannelInfoLength to validate buffer descriptor structures. And add a debug log to print the structures' content. Acked-by: Namjae Jeon Signed-off-by: Hyunchul Lee Signed-off-by: Steve French commit 9ca3d3cd0857523c95ab8cdbb6cfe47b8f90e309 Merge: 8ea2c5187d7b4 7d73c602154df Author: Dave Airlie Date: Fri Feb 4 15:48:26 2022 +1000 Merge tag 'drm-intel-fixes-2022-02-03' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes Fix GitLab issue #4698: DP monitor through Type-C dock(Dell DA310) doesn't work. Fixes for inconsistent engine busyness value and read timeout with GuC. Fix to use ALLOW_FAIL for error capture buffer allocation. Don't use interruptible lock on error path. Smatch fix to reject zero sized overlays. Signed-off-by: Dave Airlie From: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/YfuiG8SKMKP5V/Dm@jlahtine-mobl.ger.corp.intel.com commit 8ea2c5187d7b4901a70374415e772f1db422fb74 Merge: 7eb3848cc8c17 622c9a3a7868e Author: Dave Airlie Date: Fri Feb 4 14:43:28 2022 +1000 Merge tag 'drm-misc-fixes-2022-02-03' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes * dma-buf/heaps: Fix potential spectre v1 gadget * drm/kmb: Fix potential out-of-bounds access * drm/mxsfb: Fix NULL-pointer dereference * drm/nouveau: Fix potential out-of-bounds access in BIOS decoding * fbdev: Re-add support for fbcon hardware acceleration Signed-off-by: Dave Airlie From: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/Yfu8mTZQUNt1RwZd@linux-uq9g commit d1ca60efc53d665cf89ed847a14a510a81770b81 Author: Florian Westphal Date: Wed Feb 2 12:00:56 2022 +0100 netfilter: ctnetlink: disable helper autoassign When userspace, e.g. conntrackd, inserts an entry with a specified helper, its possible that the helper is lost immediately after its added: ctnetlink_create_conntrack -> nf_ct_helper_ext_add + assign helper -> ctnetlink_setup_nat -> ctnetlink_parse_nat_setup -> parse_nat_setup -> nfnetlink_parse_nat_setup -> nf_nat_setup_info -> nf_conntrack_alter_reply -> __nf_ct_try_assign_helper ... and __nf_ct_try_assign_helper will zero the helper again. Set IPS_HELPER bit to bypass auto-assign logic, its unwanted, just like when helper is assigned via ruleset. Dropped old 'not strictly necessary' comment, it referred to use of rcu_assign_pointer() before it got replaced by RCU_INIT_POINTER(). NB: Fixes tag intentionally incorrect, this extends the referenced commit, but this change won't build without IPS_HELPER introduced there. Fixes: 6714cf5465d280 ("netfilter: nf_conntrack: fix explicit helper attachment and NAT") Reported-by: Pham Thanh Tuyen Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 1f6339e034d5780ad7097c8d8c11b26e0762afba Author: Florian Westphal Date: Sat Jan 29 18:30:18 2022 +0100 MAINTAINERS: netfilter: update git links nf and nf-next have a new location. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 82b72cb94666b3dbd7152bb9f441b068af7a921b Author: Florian Westphal Date: Sat Jan 29 17:47:01 2022 +0100 netfilter: conntrack: re-init state for retransmitted syn-ack TCP conntrack assumes that a syn-ack retransmit is identical to the previous syn-ack. This isn't correct and causes stuck 3whs in some more esoteric scenarios. tcpdump to illustrate the problem: client > server: Flags [S] seq 1365731894, win 29200, [mss 1460,sackOK,TS val 2083035583 ecr 0,wscale 7] server > client: Flags [S.] seq 145824453, ack 643160523, win 65535, [mss 8952,wscale 5,TS val 3215367629 ecr 2082921663] Note the invalid/outdated synack ack number. Conntrack marks this syn-ack as out-of-window/invalid, but it did initialize the reply direction parameters based on this packets content. client > server: Flags [S] seq 1365731894, win 29200, [mss 1460,sackOK,TS val 2083036623 ecr 0,wscale 7] ... retransmit... server > client: Flags [S.], seq 145824453, ack 643160523, win 65535, [mss 8952,wscale 5,TS val 3215368644 ecr 2082921663] and another bogus synack. This repeats, then client re-uses for a new attempt: client > server: Flags [S], seq 2375731741, win 29200, [mss 1460,sackOK,TS val 2083100223 ecr 0,wscale 7] server > client: Flags [S.], seq 145824453, ack 643160523, win 65535, [mss 8952,wscale 5,TS val 3215430754 ecr 2082921663] ... but still gets a invalid syn-ack. This repeats until: server > client: Flags [S.], seq 145824453, ack 643160523, win 65535, [mss 8952,wscale 5,TS val 3215437785 ecr 2082921663] server > client: Flags [R.], seq 145824454, ack 643160523, win 65535, [mss 8952,wscale 5,TS val 3215443451 ecr 2082921663] client > server: Flags [S], seq 2375731741, win 29200, [mss 1460,sackOK,TS val 2083115583 ecr 0,wscale 7] server > client: Flags [S.], seq 162602410, ack 2375731742, win 65535, [mss 8952,wscale 5,TS val 3215445754 ecr 2083115583] This syn-ack has the correct ack number, but conntrack flags it as invalid: The internal state was created from the first syn-ack seen so the sequence number of the syn-ack is treated as being outside of the announced window. Don't assume that retransmitted syn-ack is identical to previous one. Treat it like the first syn-ack and reinit state. Signed-off-by: Florian Westphal Acked-by: Jozsef Kadlecsik Signed-off-by: Pablo Neira Ayuso commit cc4f9d62037ebcb811f4908bba2986c01df1bd50 Author: Florian Westphal Date: Sat Jan 29 17:47:00 2022 +0100 netfilter: conntrack: move synack init code to helper It seems more readable to use a common helper in the followup fix rather than copypaste or goto. No functional change intended. The function is only called for syn-ack or syn in repy direction in case of simultaneous open. Signed-off-by: Florian Westphal Acked-by: Jozsef Kadlecsik Signed-off-by: Pablo Neira Ayuso commit a9e8503def0fd4ed89ade1f61c315f904581d439 Author: Florian Westphal Date: Sat Jan 29 17:13:23 2022 +0100 netfilter: nft_payload: don't allow th access for fragments Loads relative to ->thoff naturally expect that this points to the transport header, but this is only true if pkt->fragoff == 0. This has little effect for rulesets with connection tracking/nat because these enable ip defra. For other rulesets this prevents false matches. Fixes: 96518518cc41 ("netfilter: add nftables") Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 77b337196a9d87f3d6bb9b07c0436ecafbffda1e Author: Florian Westphal Date: Fri Jan 28 13:13:32 2022 +0100 netfilter: conntrack: don't refresh sctp entries in closed state Vivek Thrivikraman reported: An SCTP server application which is accessed continuously by client application. When the session disconnects the client retries to establish a connection. After restart of SCTP server application the session is not established because of stale conntrack entry with connection state CLOSED as below. (removing this entry manually established new connection): sctp 9 CLOSED src=10.141.189.233 [..] [ASSURED] Just skip timeout update of closed entries, we don't want them to stay around forever. Reported-and-tested-by: Vivek Thrivikraman Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1579 Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 24331050a3e6afcd4451409831dd9ae8085a42f6 Author: Gao Xiang Date: Fri Feb 4 03:02:03 2022 +0800 erofs: fix small compressed files inlining Prior to ztailpacking feature, it's enough that each lcluster has two pclusters at most, and the last pcluster should be turned into an uncompressed pcluster when necessary. For example, _________________________________________________ |_ pcluster n-2 _|_ pcluster n-1 _|____ EOFed ____| which should be converted into: _________________________________________________ |_ pcluster n-2 _|_ pcluster n-1 (uncompressed)' _| That is fine since either pcluster n-1 or (uncompressed)' takes one physical block. However, after ztailpacking was supported, the game is changed since the last pcluster can be inlined now. And such case above is quite common for inlining small files. Therefore, in order to inline more effectively, special EOF lclusters are now supported which can have three parts at most, as illustrated below: _________________________________________________ |_ pcluster n-2 _|_ pcluster n-1 _|____ EOFed ____| ^ i_size Actually similar code exists in Yue Hu's original patchset [1], but I removed this part on purpose. After evaluating more real cases with small files, I've changed my mind. [1] https://lore.kernel.org/r/20211215094449.15162-1-huyue2@yulong.com Link: https://lore.kernel.org/r/20220203190203.30794-1-xiang@kernel.org Fixes: ab92184ff8f1 ("erofs: add on-disk compressed tail-packing inline support") Reviewed-by: Chao Yu Signed-off-by: Gao Xiang commit b13e0c71856817fca67159b11abac350e41289f5 Author: Martin K. Petersen Date: Thu Feb 3 22:42:09 2022 -0500 block: bio-integrity: Advance seed correctly for larger interval sizes Commit 309a62fa3a9e ("bio-integrity: bio_integrity_advance must update integrity seed") added code to update the integrity seed value when advancing a bio. However, it failed to take into account that the integrity interval might be larger than the 512-byte block layer sector size. This broke bio splitting on PI devices with 4KB logical blocks. The seed value should be advanced by bio_integrity_intervals() and not the number of sectors. Cc: Dmitry Monakhov Cc: stable@vger.kernel.org Fixes: 309a62fa3a9e ("bio-integrity: bio_integrity_advance must update integrity seed") Tested-by: Dmitry Ivanov Reported-by: Alexey Lyashkov Signed-off-by: Martin K. Petersen Link: https://lore.kernel.org/r/20220204034209.4193-1-martin.petersen@oracle.com Signed-off-by: Jens Axboe commit 7eb3848cc8c17a822f4cced5da0aa437e0063097 Merge: 26291c54e111f e8ae38720e1a6 Author: Dave Airlie Date: Fri Feb 4 13:18:55 2022 +1000 Merge tag 'amd-drm-fixes-5.17-2022-02-02' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-fixes-5.17-2022-02-02: amdgpu: - mGPU fan boost fix for beige goby - S0ix fixes - Cyan skillfish hang fix - DCN fixes for DCN 3.1 - DCN fixes for DCN 3.01 - Apple retina panel fix - ttm logic inversion fix Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220203035224.5801-1-alexander.deucher@amd.com commit ed14fc7a79ab43e9f2cb1fa9c1733fdc133bba30 Author: Steen Hegelund Date: Thu Feb 3 11:29:00 2022 +0100 net: sparx5: Fix get_stat64 crash in tcpdump This problem was found with Sparx5 when the tcpdump tool requests the do_get_stats64 (sparx5_get_stats64) statistic. The portstats pointer was incorrectly incremented when fetching priority based statistics. Fixes: af4b11022e2d (net: sparx5: add ethtool configuration and statistics support) Signed-off-by: Steen Hegelund Link: https://lore.kernel.org/r/20220203102900.528987-1-steen.hegelund@microchip.com Signed-off-by: Jakub Kicinski commit dcb85f85fa6f142aae1fe86f399d4503d49f2b60 Author: Kees Cook Date: Thu Feb 3 12:17:54 2022 -0800 gcc-plugins/stackleak: Use noinstr in favor of notrace While the stackleak plugin was already using notrace, objtool is now a bit more picky. Update the notrace uses to noinstr. Silences the following objtool warnings when building with: CONFIG_DEBUG_ENTRY=y CONFIG_STACK_VALIDATION=y CONFIG_VMLINUX_VALIDATION=y CONFIG_GCC_PLUGIN_STACKLEAK=y vmlinux.o: warning: objtool: do_syscall_64()+0x9: call to stackleak_track_stack() leaves .noinstr.text section vmlinux.o: warning: objtool: do_int80_syscall_32()+0x9: call to stackleak_track_stack() leaves .noinstr.text section vmlinux.o: warning: objtool: exc_general_protection()+0x22: call to stackleak_track_stack() leaves .noinstr.text section vmlinux.o: warning: objtool: fixup_bad_iret()+0x20: call to stackleak_track_stack() leaves .noinstr.text section vmlinux.o: warning: objtool: do_machine_check()+0x27: call to stackleak_track_stack() leaves .noinstr.text section vmlinux.o: warning: objtool: .text+0x5346e: call to stackleak_erase() leaves .noinstr.text section vmlinux.o: warning: objtool: .entry.text+0x143: call to stackleak_erase() leaves .noinstr.text section vmlinux.o: warning: objtool: .entry.text+0x10eb: call to stackleak_erase() leaves .noinstr.text section vmlinux.o: warning: objtool: .entry.text+0x17f9: call to stackleak_erase() leaves .noinstr.text section Note that the plugin's addition of calls to stackleak_track_stack() from noinstr functions is expected to be safe, as it isn't runtime instrumentation and is self-contained. Cc: Alexander Popov Suggested-by: Peter Zijlstra Signed-off-by: Kees Cook Signed-off-by: Linus Torvalds commit eb2eb5161cdbd4f0acc574ef1c3ce799b980544b Merge: 551007a8f10af 87563a043cef0 Author: Linus Torvalds Date: Thu Feb 3 16:54:18 2022 -0800 Merge tag 'net-5.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Jakub Kicinski: "Including fixes from bpf, netfilter, and ieee802154. Current release - regressions: - Partially revert "net/smc: Add netlink net namespace support", fix uABI breakage - netfilter: - nft_ct: fix use after free when attaching zone template - nft_byteorder: track register operations Previous releases - regressions: - ipheth: fix EOVERFLOW in ipheth_rcvbulk_callback - phy: qca8081: fix speeds lower than 2.5Gb/s - sched: fix use-after-free in tc_new_tfilter() Previous releases - always broken: - tcp: fix mem under-charging with zerocopy sendmsg() - tcp: add missing tcp_skb_can_collapse() test in tcp_shift_skb_data() - neigh: do not trigger immediate probes on NUD_FAILED from neigh_managed_work, avoid a deadlock - bpf: use VM_MAP instead of VM_ALLOC for ringbuf, avoid KASAN false-positives - netfilter: nft_reject_bridge: fix for missing reply from prerouting - smc: forward wakeup to smc socket waitqueue after fallback - ieee802154: - return meaningful error codes from the netlink helpers - mcr20a: fix lifs/sifs periods - at86rf230, ca8210: stop leaking skbs on error paths - macsec: add missing un-offload call for NETDEV_UNREGISTER of parent - ax25: add refcount in ax25_dev to avoid UAF bugs - eth: mlx5e: - fix SFP module EEPROM query - fix broken SKB allocation in HW-GRO - IPsec offload: fix tunnel mode crypto for non-TCP/UDP flows - eth: amd-xgbe: - fix skb data length underflow - ensure reset of the tx_timer_active flag, avoid Tx timeouts - eth: stmmac: fix runtime pm use in stmmac_dvr_remove() - eth: e1000e: handshake with CSME starts from Alder Lake platforms" * tag 'net-5.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (69 commits) ax25: fix reference count leaks of ax25_dev net: stmmac: ensure PTP time register reads are consistent net: ipa: request IPA register values be retained dt-bindings: net: qcom,ipa: add optional qcom,qmp property tools/resolve_btfids: Do not print any commands when building silently bpf: Use VM_MAP instead of VM_ALLOC for ringbuf net, neigh: Do not trigger immediate probes on NUD_FAILED from neigh_managed_work tcp: add missing tcp_skb_can_collapse() test in tcp_shift_skb_data() net: sparx5: do not refer to skb after passing it on Partially revert "net/smc: Add netlink net namespace support" net/mlx5e: Avoid field-overflowing memcpy() net/mlx5e: Use struct_group() for memcpy() region net/mlx5e: Avoid implicit modify hdr for decap drop rule net/mlx5e: IPsec: Fix tunnel mode crypto offload for non TCP/UDP traffic net/mlx5e: IPsec: Fix crypto offload for non TCP/UDP encapsulated traffic net/mlx5e: Don't treat small ceil values as unlimited in HTB offload net/mlx5: E-Switch, Fix uninitialized variable modact net/mlx5e: Fix handling of wrong devices during bond netevent net/mlx5e: Fix broken SKB allocation in HW-GRO net/mlx5e: Fix wrong calculation of header index in HW_GRO ... commit 551007a8f10afdc45959ad637d6bee816716769f Merge: 25b20ae8151b3 186edf7e368c4 Author: Linus Torvalds Date: Thu Feb 3 16:44:12 2022 -0800 Merge tag 'selinux-pr-20220203' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux Pull selinux fix from Paul Moore: "One small SELinux patch to ensure that a policy structure field is properly reset after freeing so that we don't inadvertently do a double-free on certain error conditions" * tag 'selinux-pr-20220203' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux: selinux: fix double free of cond_list on error paths commit 25b20ae8151b3d5289896f4f200ff790d2cdf4bf Merge: 1f2cfdd349b76 ec049891b2dc1 Author: Linus Torvalds Date: Thu Feb 3 16:36:26 2022 -0800 Merge tag 'linux-kselftest-fixes-5.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull Kselftest fixes from Shuah Khan: "Important fixes to several tests and documentation clarification on running mainline kselftest on stable releases. A few notable fixes: - fix kselftest run hang due to child processes that haven't been terminated. Fix signals all child processes - fix false pass/fail results from vdso_test_abi, openat2, mincore - build failures when using -j (multiple jobs) option - exec test build failure due to incorrect build rule for a run-time created "pipe" - zram test fixes related to interaction with zram-generator to make sure zram test to coordinate deleted with zram-generator - zram test compression ratio calculation fix and skipping max_comp_streams. - increasing rtc test timeout - cpufreq test to write test results to stdout which will necessary on automated test systems" * tag 'linux-kselftest-fixes-5.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: kselftest: Fix vdso_test_abi return status selftests: skip mincore.check_file_mmap when fs lacks needed support selftests: openat2: Skip testcases that fail with EOPNOTSUPP selftests: openat2: Add missing dependency in Makefile selftests: openat2: Print also errno in failure messages selftests: futex: Use variable MAKE instead of make selftests/exec: Remove pipe from TEST_GEN_FILES selftests/zram: Adapt the situation that /dev/zram0 is being used selftests/zram01.sh: Fix compression ratio calculation selftests/zram: Skip max_comp_streams interface on newer kernel docs/kselftest: clarify running mainline tests on stables kselftest: signal all child processes selftests: cpufreq: Write test output to stdout as well selftests: rtc: Increase test timeout so that all tests run commit 87563a043cef044fed5db7967a75741cc16ad2b1 Author: Duoming Zhou Date: Thu Feb 3 23:08:11 2022 +0800 ax25: fix reference count leaks of ax25_dev The previous commit d01ffb9eee4a ("ax25: add refcount in ax25_dev to avoid UAF bugs") introduces refcount into ax25_dev, but there are reference leak paths in ax25_ctl_ioctl(), ax25_fwd_ioctl(), ax25_rt_add(), ax25_rt_del() and ax25_rt_opt(). This patch uses ax25_dev_put() and adjusts the position of ax25_addr_ax25dev() to fix reference cout leaks of ax25_dev. Fixes: d01ffb9eee4a ("ax25: add refcount in ax25_dev to avoid UAF bugs") Signed-off-by: Duoming Zhou Reviewed-by: Dan Carpenter Link: https://lore.kernel.org/r/20220203150811.42256-1-duoming@zju.edu.cn Signed-off-by: Jakub Kicinski commit 80d4609008e6d696a279e39ae7458c916fcd44c1 Author: Yannick Vignon Date: Thu Feb 3 17:00:25 2022 +0100 net: stmmac: ensure PTP time register reads are consistent Even if protected from preemption and interrupts, a small time window remains when the 2 register reads could return inconsistent values, each time the "seconds" register changes. This could lead to an about 1-second error in the reported time. Add logic to ensure the "seconds" and "nanoseconds" values are consistent. Fixes: 92ba6888510c ("stmmac: add the support for PTP hw clock driver") Signed-off-by: Yannick Vignon Reviewed-by: Russell King (Oracle) Link: https://lore.kernel.org/r/20220203160025.750632-1-yannick.vignon@oss.nxp.com Signed-off-by: Jakub Kicinski commit 77b1b8b43ec3c060ecf7e926a92b0f8772171046 Merge: 0166556a12664 7f3bdbc3f1314 Author: Jakub Kicinski Date: Thu Feb 3 13:42:38 2022 -0800 Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Daniel Borkmann says: ==================== pull-request: bpf 2022-02-03 We've added 6 non-merge commits during the last 10 day(s) which contain a total of 7 files changed, 11 insertions(+), 236 deletions(-). The main changes are: 1) Fix BPF ringbuf to allocate its area with VM_MAP instead of VM_ALLOC flag which otherwise trips over KASAN, from Hou Tao. 2) Fix unresolved symbol warning in resolve_btfids due to LSM callback rename, from Alexei Starovoitov. 3) Fix a possible race in inc_misses_counter() when IRQ would trigger during counter update, from He Fengqing. 4) Fix tooling infra for cross-building with clang upon probing whether gcc provides the standard libraries, from Jean-Philippe Brucker. 5) Fix silent mode build for resolve_btfids, from Nathan Chancellor. 6) Drop unneeded and outdated lirc.h header copy from tooling infra as BPF does not require it anymore, from Sean Young. * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf: tools/resolve_btfids: Do not print any commands when building silently bpf: Use VM_MAP instead of VM_ALLOC for ringbuf tools: Ignore errors from `which' when searching a GCC toolchain tools headers UAPI: remove stale lirc.h bpf: Fix possible race in inc_misses_counter bpf: Fix renaming task_getsecid_subj->current_getsecid_subj. ==================== Link: https://lore.kernel.org/r/20220203155815.25689-1-daniel@iogearbox.net Signed-off-by: Jakub Kicinski commit e8db8c9cadacab5694b0d1bd5f6b3ba6a234a34c Merge: aace2b7a93ca4 6a51abdeb259a Author: Jens Axboe Date: Thu Feb 3 12:37:02 2022 -0700 Merge tag 'nvme-5.17-2022-02-03' of git://git.infradead.org/nvme into block-5.17 Pull NVMe fixes from Christoph: "nvme fixes for Linux 5.17 - fix a use-after-free in rdm and tcp controller reset (Sagi Grimberg) - fix the state check in nvmf_ctlr_matches_baseopts (Uday Shankar)" * tag 'nvme-5.17-2022-02-03' of git://git.infradead.org/nvme: nvme-fabrics: fix state check in nvmf_ctlr_matches_baseopts() nvme-rdma: fix possible use-after-free in transport error_recovery work nvme-tcp: fix possible use-after-free in transport error_recovery work nvme: fix a possible use-after-free in controller reset during load commit 1f2cfdd349b7647f438c1e552dc1b983da86d830 Author: Mickaël Salaün Date: Thu Feb 3 15:50:29 2022 +0100 printk: Fix incorrect __user type in proc_dointvec_minmax_sysadmin() The move of proc_dointvec_minmax_sysadmin() from kernel/sysctl.c to kernel/printk/sysctl.c introduced an incorrect __user attribute to the buffer argument. I spotted this change in [1] as well as the kernel test robot. Revert this change to please sparse: kernel/printk/sysctl.c:20:51: warning: incorrect type in argument 3 (different address spaces) kernel/printk/sysctl.c:20:51: expected void * kernel/printk/sysctl.c:20:51: got void [noderef] __user *buffer Fixes: faaa357a55e0 ("printk: move printk sysctl to printk/sysctl.c") Link: https://lore.kernel.org/r/20220104155024.48023-2-mic@digikod.net [1] Reported-by: kernel test robot Cc: Andrew Morton Cc: John Ogness Cc: Luis Chamberlain Cc: Petr Mladek Cc: Sergey Senozhatsky Cc: Steven Rostedt Cc: Xiaoming Ni Signed-off-by: Mickaël Salaün Link: https://lore.kernel.org/r/20220203145029.272640-1-mic@digikod.net Signed-off-by: Linus Torvalds commit 67d6212afda218d564890d1674bab28e8612170f Author: Igor Pylypiv Date: Thu Jan 27 15:39:53 2022 -0800 Revert "module, async: async_synchronize_full() on module init iff async is used" This reverts commit 774a1221e862b343388347bac9b318767336b20b. We need to finish all async code before the module init sequence is done. In the reverted commit the PF_USED_ASYNC flag was added to mark a thread that called async_schedule(). Then the PF_USED_ASYNC flag was used to determine whether or not async_synchronize_full() needs to be invoked. This works when modprobe thread is calling async_schedule(), but it does not work if module dispatches init code to a worker thread which then calls async_schedule(). For example, PCI driver probing is invoked from a worker thread based on a node where device is attached: if (cpu < nr_cpu_ids) error = work_on_cpu(cpu, local_pci_probe, &ddi); else error = local_pci_probe(&ddi); We end up in a situation where a worker thread gets the PF_USED_ASYNC flag set instead of the modprobe thread. As a result, async_synchronize_full() is not invoked and modprobe completes without waiting for the async code to finish. The issue was discovered while loading the pm80xx driver: (scsi_mod.scan=async) modprobe pm80xx worker ... do_init_module() ... pci_call_probe() work_on_cpu(local_pci_probe) local_pci_probe() pm8001_pci_probe() scsi_scan_host() async_schedule() worker->flags |= PF_USED_ASYNC; ... < return from worker > ... if (current->flags & PF_USED_ASYNC) <--- false async_synchronize_full(); Commit 21c3c5d28007 ("block: don't request module during elevator init") fixed the deadlock issue which the reverted commit 774a1221e862 ("module, async: async_synchronize_full() on module init iff async is used") tried to fix. Since commit 0fdff3ec6d87 ("async, kmod: warn on synchronous request_module() from async workers") synchronous module loading from async is not allowed. Given that the original deadlock issue is fixed and it is no longer allowed to call synchronous request_module() from async we can remove PF_USED_ASYNC flag to make module init consistently invoke async_synchronize_full() unless async module probe is requested. Signed-off-by: Igor Pylypiv Reviewed-by: Changyuan Lyu Reviewed-by: Luis Chamberlain Acked-by: Tejun Heo Signed-off-by: Linus Torvalds commit aace2b7a93ca48dc075af8526394bc5d43b5b148 Merge: 3e1f941dd9f33 0f9650bd838ef Author: Jens Axboe Date: Thu Feb 3 11:54:53 2022 -0700 Merge branch 'md-fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md into block-5.17 Pull MD fix from Song: "Please consider pulling the following fix on top of your block-5.17 branch. It fixes a NULL ptr deref case with nowait." * 'md-fixes' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md: md: fix NULL pointer deref with nowait but no mddev->queue commit 305e6c42e8de565864431510230a8ad75c85f4d4 Merge: c36c04c2e132f 2bdfd2825c966 Author: Linus Torvalds Date: Thu Feb 3 08:15:13 2022 -0800 Merge branch 'for-5.17-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup Pull cgroup fixes from Tejun Heo: - Eric's fix for a long standing cgroup1 permission issue where it only checks for uid 0 instead of CAP which inadvertently allows unprivileged userns roots to modify release_agent userhelper - Fixes for the fallout from Waiman's recent cpuset work * 'for-5.17-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: cgroup/cpuset: Fix "suspicious RCU usage" lockdep warning cgroup-v1: Require capabilities to set release_agent cpuset: Fix the bug that subpart_cpus updated wrongly in update_cpumask() cgroup/cpuset: Make child cpusets restrict parents on v1 hierarchy commit 0166556a12664ed3d91b58b0d3a4a78404c0e7c3 Merge: 4a81f6da9cb2d 34a081761e4e3 Author: Jakub Kicinski Date: Thu Feb 3 08:04:15 2022 -0800 Merge branch 'net-ipa-enable-register-retention' Alex Elder says: ==================== net: ipa: enable register retention With runtime power management in place, we sometimes need to issue a command to enable retention of IPA register values before power collapse. This requires a new Device Tree property, whose presence will also be used to signal that the command is required. ==================== Link: https://lore.kernel.org/r/20220201150205.468403-1-elder@linaro.org Signed-off-by: Jakub Kicinski commit 34a081761e4e3c35381cbfad609ebae2962fe2f8 Author: Alex Elder Date: Tue Feb 1 09:02:05 2022 -0600 net: ipa: request IPA register values be retained In some cases, the IPA hardware needs to request the always-on subsystem (AOSS) to coordinate with the IPA microcontroller to retain IPA register values at power collapse. This is done by issuing a QMP request to the AOSS microcontroller. A similar request ondoes that request. We must get and hold the "QMP" handle early, because we might get back EPROBE_DEFER for that. But the actual request should be sent while we know the IPA clock is active, and when we know the microcontroller is operational. Fixes: 1aac309d3207 ("net: ipa: use autosuspend") Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski commit ac62a0174d62ae0f4447c0c8cf35a8e5d793df56 Author: Alex Elder Date: Tue Feb 1 09:02:04 2022 -0600 dt-bindings: net: qcom,ipa: add optional qcom,qmp property For some systems, the IPA driver must make a request to ensure that its registers are retained across power collapse of the IPA hardware. On such systems, we'll use the existence of the "qcom,qmp" property as a signal that this request is required. Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski commit 2bdfd2825c9662463371e6691b1a794e97fa36b4 Author: Waiman Long Date: Wed Feb 2 22:31:03 2022 -0500 cgroup/cpuset: Fix "suspicious RCU usage" lockdep warning It was found that a "suspicious RCU usage" lockdep warning was issued with the rcu_read_lock() call in update_sibling_cpumasks(). It is because the update_cpumasks_hier() function may sleep. So we have to release the RCU lock, call update_cpumasks_hier() and reacquire it afterward. Also add a percpu_rwsem_assert_held() in update_sibling_cpumasks() instead of stating that in the comment. Fixes: 4716909cc5c5 ("cpuset: Track cpusets that use parent's effective_cpus") Signed-off-by: Waiman Long Tested-by: Phil Auld Reviewed-by: Phil Auld Signed-off-by: Tejun Heo commit f340b3d9027485945d59f9c04f1e33070b02cae2 Author: hongnanli Date: Fri Jan 21 15:06:11 2022 +0800 fs/ext4: fix comments mentioning i_mutex inode->i_mutex has been replaced with inode->i_rwsem long ago. Fix comments still mentioning i_mutex. Signed-off-by: hongnanli Link: https://lore.kernel.org/r/20220121070611.21618-1-hongnan.li@linux.alibaba.com Signed-off-by: Theodore Ts'o commit 8fca8a2b0a822f7936130af7299d2fd7f0a66714 Author: Xin Yin Date: Wed Jan 26 14:31:46 2022 +0800 ext4: fix incorrect type issue during replay_del_range should not use fast commit log data directly, add le32_to_cpu(). Reported-by: kernel test robot Fixes: 0b5b5a62b945 ("ext4: use ext4_ext_remove_space() for fast commit replay delete range") Cc: stable@kernel.org Signed-off-by: Xin Yin Reviewed-by: Ritesh Harjani Link: https://lore.kernel.org/r/20220126063146.2302-1-yinxin.x@bytedance.com Signed-off-by: Theodore Ts'o commit 715a67f11d6755e0cc853ff4ef539f362b566096 Author: Yang Li Date: Mon Jan 10 21:28:41 2022 +0800 jbd2: fix kernel-doc descriptions for jbd2_journal_shrink_{scan,count}() Add the description of @shrink and @sc in jbd2_journal_shrink_scan() and jbd2_journal_shrink_count() kernel-doc comment to remove warnings found by running scripts/kernel-doc, which is caused by using 'make W=1'. fs/jbd2/journal.c:1296: warning: Function parameter or member 'shrink' not described in 'jbd2_journal_shrink_scan' fs/jbd2/journal.c:1296: warning: Function parameter or member 'sc' not described in 'jbd2_journal_shrink_scan' fs/jbd2/journal.c:1320: warning: Function parameter or member 'shrink' not described in 'jbd2_journal_shrink_count' fs/jbd2/journal.c:1320: warning: Function parameter or member 'sc' not described in 'jbd2_journal_shrink_count' Reported-by: Abaci Robot Signed-off-by: Yang Li Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20220110132841.34531-1-yang.lee@linux.alibaba.com Signed-off-by: Theodore Ts'o commit 7c268d4ce2d3761f666a9950b029c8902bfab710 Author: Lukas Czerner Date: Wed Jan 19 14:02:09 2022 +0100 ext4: fix potential NULL pointer dereference in ext4_fill_super() By mistake we fail to return an error from ext4_fill_super() in case that ext4_alloc_sbi() fails to allocate a new sbi. Instead we just set the ret variable and allow the function to continue which will later lead to a NULL pointer dereference. Fix it by returning -ENOMEM in the case ext4_alloc_sbi() fails. Fixes: cebe85d570cf ("ext4: switch to the new mount api") Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Lukas Czerner Link: https://lore.kernel.org/r/20220119130209.40112-1-lczerner@redhat.com Signed-off-by: Theodore Ts'o Cc: stable@kernel.org commit 4f98186848707f530669238d90e0562d92a78aab Author: Ritesh Harjani Date: Mon Jan 17 17:41:51 2022 +0530 jbd2: refactor wait logic for transaction updates into a common function No functionality change as such in this patch. This only refactors the common piece of code which waits for t_updates to finish into a common function named as jbd2_journal_wait_updates(journal_t *) Signed-off-by: Ritesh Harjani Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/8c564f70f4b2591171677a2a74fccb22a7b6c3a4.1642416995.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o commit 3ca40c0d329113a9f76f6aa01abe73d9f16ace9d Author: Ritesh Harjani Date: Mon Jan 17 17:41:50 2022 +0530 jbd2: cleanup unused functions declarations from jbd2.h During code review found no references of few of these below function declarations. This patch cleans those up from jbd2.h Signed-off-by: Ritesh Harjani Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/30d1fc327becda197a4136cf9cdc73d9baa3b7b9.1642416995.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o commit cdce59a1549190b66f8e3fe465c2b2f714b98a94 Author: Ritesh Harjani Date: Mon Jan 17 17:41:49 2022 +0530 ext4: fix error handling in ext4_fc_record_modified_inode() Current code does not fully takes care of krealloc() error case, which could lead to silent memory corruption or a kernel bug. This patch fixes that. Also it cleans up some duplicated error handling logic from various functions in fast_commit.c file. Reported-by: luo penghao Suggested-by: Lukas Czerner Signed-off-by: Ritesh Harjani Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/62e8b6a1cce9359682051deb736a3c0953c9d1e9.1642416995.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o Cc: stable@kernel.org commit 09355d9d038a1590ee055831a4ad3a79952cfa8b Author: Ritesh Harjani Date: Mon Jan 17 17:41:48 2022 +0530 ext4: remove redundant max inline_size check in ext4_da_write_inline_data_begin() ext4_prepare_inline_data() already checks for ext4_get_max_inline_size() and returns -ENOSPC. So there is no need to check it twice within ext4_da_write_inline_data_begin(). This patch removes the extra check. It also makes it more clean. No functionality change in this patch. Signed-off-by: Ritesh Harjani Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/cdd1654128d5105550c65fd13ca5da53b2162cc4.1642416995.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o commit 897026aaa73eb2517dfea8d147f20ddb0b813044 Author: Ritesh Harjani Date: Mon Jan 17 17:41:47 2022 +0530 ext4: fix error handling in ext4_restore_inline_data() While running "./check -I 200 generic/475" it sometimes gives below kernel BUG(). Ideally we should not call ext4_write_inline_data() if ext4_create_inline_data() has failed. [73131.453234] kernel BUG at fs/ext4/inline.c:223! 212 static void ext4_write_inline_data(struct inode *inode, struct ext4_iloc *iloc, 213 void *buffer, loff_t pos, unsigned int len) 214 { <...> 223 BUG_ON(!EXT4_I(inode)->i_inline_off); 224 BUG_ON(pos + len > EXT4_I(inode)->i_inline_size); This patch handles the error and prints out a emergency msg saying potential data loss for the given inode (since we couldn't restore the original inline_data due to some previous error). [ 9571.070313] EXT4-fs (dm-0): error restoring inline_data for inode -- potential data loss! (inode 1703982, error -30) Reported-by: Eric Whitney Signed-off-by: Ritesh Harjani Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/9f4cd7dfd54fa58ff27270881823d94ddf78dd07.1642416995.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o Cc: stable@kernel.org commit bdc8a53a6f2f0b1cb5f991440f2100732299eb93 Author: Xin Yin Date: Mon Jan 17 17:36:55 2022 +0800 ext4: fast commit may miss file actions in the follow scenario: 1. jbd start transaction n 2. task A get new handle for transaction n+1 3. task A do some actions and add inode to FC_Q_MAIN fc_q 4. jbd complete transaction n and clear FC_Q_MAIN fc_q 5. task A call fsync Fast commit will lost the file actions during a full commit. we should also add updates to staging queue during a full commit. and in ext4_fc_cleanup(), when reset a inode's fc track range, check it's i_sync_tid, if it bigger than current transaction tid, do not rest it, or we will lost the track range. And EXT4_MF_FC_COMMITTING is not needed anymore, so drop it. Signed-off-by: Xin Yin Link: https://lore.kernel.org/r/20220117093655.35160-3-yinxin.x@bytedance.com Signed-off-by: Theodore Ts'o Cc: stable@kernel.org commit e85c81ba8859a4c839bcd69c5d83b32954133a5b Author: Xin Yin Date: Mon Jan 17 17:36:54 2022 +0800 ext4: fast commit may not fallback for ineligible commit For the follow scenario: 1. jbd start commit transaction n 2. task A get new handle for transaction n+1 3. task A do some ineligible actions and mark FC_INELIGIBLE 4. jbd complete transaction n and clean FC_INELIGIBLE 5. task A call fsync In this case fast commit will not fallback to full commit and transaction n+1 also not handled by jbd. Make ext4_fc_mark_ineligible() also record transaction tid for latest ineligible case, when call ext4_fc_cleanup() check current transaction tid, if small than latest ineligible tid do not clear the EXT4_MF_FC_INELIGIBLE. Reported-by: kernel test robot Reported-by: Dan Carpenter Reported-by: Ritesh Harjani Suggested-by: Harshad Shirwadkar Signed-off-by: Xin Yin Link: https://lore.kernel.org/r/20220117093655.35160-2-yinxin.x@bytedance.com Signed-off-by: Theodore Ts'o Cc: stable@kernel.org commit 31a074a0c62dc0d2bfb9b543142db4fe27f9e5eb Author: Xin Yin Date: Mon Jan 10 11:51:41 2022 +0800 ext4: modify the logic of ext4_mb_new_blocks_simple For now in ext4_mb_new_blocks_simple, if we found a block which should be excluded then will switch to next group, this may probably cause 'group' run out of range. Change to check next block in the same group when get a block should be excluded. Also change the search range to EXT4_CLUSTERS_PER_GROUP and add error checking. Signed-off-by: Xin Yin Reviewed-by: Harshad Shirwadkar Link: https://lore.kernel.org/r/20220110035141.1980-3-yinxin.x@bytedance.com Signed-off-by: Theodore Ts'o Cc: stable@kernel.org commit 599ea31d13617c5484c40cdf50d88301dc351cfc Author: Xin Yin Date: Mon Jan 10 11:51:40 2022 +0800 ext4: prevent used blocks from being allocated during fast commit replay During fast commit replay procedure, we clear inode blocks bitmap in ext4_ext_clear_bb(), this may cause ext4_mb_new_blocks_simple() allocate blocks still in use. Make ext4_fc_record_regions() also record physical disk regions used by inodes during replay procedure. Then ext4_mb_new_blocks_simple() can excludes these blocks in use. Signed-off-by: Xin Yin Link: https://lore.kernel.org/r/20220110035141.1980-2-yinxin.x@bytedance.com Signed-off-by: Theodore Ts'o Cc: stable@kernel.org commit 46963e2e0629cb31c96b1d47ddd89dc3d8990b34 Author: Mathias Krause Date: Thu Jan 27 14:02:18 2022 +0100 misc: fastrpc: avoid double fput() on failed usercopy If the copy back to userland fails for the FASTRPC_IOCTL_ALLOC_DMA_BUFF ioctl(), we shouldn't assume that 'buf->dmabuf' is still valid. In fact, dma_buf_fd() called fd_install() before, i.e. "consumed" one reference, leaving us with none. Calling dma_buf_put() will therefore put a reference we no longer own, leading to a valid file descritor table entry for an already released 'file' object which is a straight use-after-free. Simply avoid calling dma_buf_put() and rely on the process exit code to do the necessary cleanup, if needed, i.e. if the file descriptor is still valid. Fixes: 6cffd79504ce ("misc: fastrpc: Add support for dmabuf exporter") Acked-by: Christian König Signed-off-by: Mathias Krause Link: https://lore.kernel.org/r/20220127130218.809261-1-minipli@grsecurity.net Signed-off-by: Greg Kroah-Hartman commit 7f3bdbc3f13146eb9d07de81ea71f551587a384b Author: Nathan Chancellor Date: Tue Feb 1 14:25:04 2022 -0700 tools/resolve_btfids: Do not print any commands when building silently When building with 'make -s', there is some output from resolve_btfids: $ make -sj"$(nproc)" oldconfig prepare MKDIR .../tools/bpf/resolve_btfids/libbpf/ MKDIR .../tools/bpf/resolve_btfids//libsubcmd LINK resolve_btfids Silent mode means that no information should be emitted about what is currently being done. Use the $(silent) variable from Makefile.include to avoid defining the msg macro so that there is no information printed. Fixes: fbbb68de80a4 ("bpf: Add resolve_btfids tool to resolve BTF IDs in ELF object") Signed-off-by: Nathan Chancellor Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220201212503.731732-1-nathan@kernel.org commit 1d118965965f89948236ebe23072bb1fca5e7832 Author: Dave Stevenson Date: Thu Jan 27 14:51:16 2022 +0100 drm/vc4: hdmi: Allow DBLCLK modes even if horz timing is odd. The 2711 pixel valve can't produce odd horizontal timings, and checks were added to vc4_hdmi_encoder_atomic_check and vc4_hdmi_encoder_mode_valid to filter out/block selection of such modes. Modes with DRM_MODE_FLAG_DBLCLK double all the horizontal timing values before programming them into the PV. The PV values, therefore, can not be odd, and so the modes can be supported. Amend the filtering appropriately. Fixes: 57fb32e632be ("drm/vc4: hdmi: Block odd horizontal timings") Signed-off-by: Dave Stevenson Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220127135116.298278-1-maxime@cerno.tech commit 71702c495b78dfbc22eeac32ea9cda452862750d Author: Dave Stevenson Date: Thu Jan 27 14:45:59 2022 +0100 drm/vc4: hdmi: Don't try disabling SCDC on Pi0-3. The code that set the scdc_enabled flag to ensure it was disabled at boot time also ran on Pi0-3 where there is no SCDC support. This lead to a warning in vc4_hdmi_encoder_post_crtc_disable due to vc4_hdmi_disable_scrambling being called and trying to read (and write) register HDMI_SCRAMBLER_CTL which doesn't exist on those platforms. Only set the flag should the interface be configured to support more than HDMI 1.4. Fixes: 1998646129fa ("drm/vc4: hdmi: Introduce a scdc_enabled flag") Signed-off-by: Dave Stevenson Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220127134559.292778-1-maxime@cerno.tech commit 3404b39919c3c87677cdba45405d24033b3276f3 Author: Dave Stevenson Date: Thu Jan 27 14:17:54 2022 +0100 drm/vc4: hdmi: Ensure we don't use 2711 HPD registers on Pi0-3 The existing logic was flawed in that it could try reading the 2711 specific registers for HPD on a CM1/3 where the HPD GPIO hadn't been defined in DT. Ensure we don't do the 2711 register read on invalid hardware, and then Signed-off-by: Dave Stevenson Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220127131754.236074-1-maxime@cerno.tech commit c36c04c2e132fc39f6b658bf607aed4425427fd7 Author: John Hubbard Date: Tue Feb 1 19:23:17 2022 -0800 Revert "mm/gup: small refactoring: simplify try_grab_page()" This reverts commit 54d516b1d62ff8f17cee2da06e5e4706a0d00b8a That commit did a refactoring that effectively combined fast and slow gup paths (again). And that was again incorrect, for two reasons: a) Fast gup and slow gup get reference counts on pages in different ways and with different goals: see Linus' writeup in commit cd1adf1b63a1 ("Revert "mm/gup: remove try_get_page(), call try_get_compound_head() directly""), and b) try_grab_compound_head() also has a specific check for "FOLL_LONGTERM && !is_pinned(page)", that assumes that the caller can fall back to slow gup. This resulted in new failures, as recently report by Will McVicker [1]. But (a) has problems too, even though they may not have been reported yet. So just revert this. Link: https://lore.kernel.org/r/20220131203504.3458775-1-willmcvicker@google.com [1] Fixes: 54d516b1d62f ("mm/gup: small refactoring: simplify try_grab_page()") Reported-and-tested-by: Will McVicker Cc: Christoph Hellwig Cc: Minchan Kim Cc: Matthew Wilcox Cc: Christian Borntraeger Cc: Heiko Carstens Cc: Vasily Gorbik Cc: stable@vger.kernel.org # 5.15 Signed-off-by: John Hubbard Signed-off-by: Linus Torvalds commit d394bb77dd0bd20b125459da25fdac00a853be28 Merge: 88808fbbead48 2161ba070999a Author: Linus Torvalds Date: Thu Feb 3 06:45:34 2022 -0800 Merge tag 'mips-fixes-5.17_2' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux Pull MIPS fixes from Thomas Bogendoerfer: - fix missed change for PTR->PTR_WD conversion - kernel-doc fixes * tag 'mips-fixes-5.17_2' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: MIPS: KVM: fix vz.c kernel-doc notation MIPS: octeon: Fix missed PTR->PTR_WD conversion commit 3149efcdf2c6314420c418dfc94de53bfd076b1f Author: Long Li Date: Wed Jan 26 17:43:34 2022 -0800 PCI: hv: Fix NUMA node assignment when kernel boots with custom NUMA topology When kernel boots with a NUMA topology with some NUMA nodes offline, the PCI driver should only set an online NUMA node on the device. This can happen during KDUMP where some NUMA nodes are not made online by the KDUMP kernel. This patch also fixes the case where kernel is booting with "numa=off". Fixes: 999dd956d838 ("PCI: hv: Add support for protocol 1.3 and support PCI_BUS_RELATIONS2") Signed-off-by: Long Li Reviewed-by: Michael Kelley Tested-by: Purna Pavan Chandra Aekkaladevi Acked-by: Lorenzo Pieralisi Link: https://lore.kernel.org/r/1643247814-15184-1-git-send-email-longli@linuxonhyperv.com Signed-off-by: Wei Liu commit 68e8cc2a23b61862bf20ffc9b782a3fb49c65568 Author: Yizhuo Zhai Date: Wed Feb 2 15:58:08 2022 -0800 fbdev: fbmem: Fix the implicit type casting In function do_fb_ioctl(), the "arg" is the type of unsigned long, and in "case FBIOBLANK:" this argument is casted into an int before passig to fb_blank(). In fb_blank(), the comparision if (blank > FB_BLANK_POWERDOWN) would be bypass if the original "arg" is a large number, which is possible because it comes from the user input. Fix this by adding the check before the function call. Reviewed-by: Guenter Roeck Reviewed-by: Sam Ravnborg Acked-by: Helge Deller Signed-off-by: Yizhuo Zhai Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220202235811.1621017-1-yzhai003@ucr.edu commit aceeafefff736057e8f93f19bbfbef26abd94604 Author: Jens Wiklander Date: Thu Jan 27 15:29:39 2022 +0100 optee: use driver internal tee_context for some rpc Adds a driver private tee_context by moving the tee_context in struct optee_notif to struct optee. This tee_context was previously used when doing internal calls to secure world to deliver notification. The new driver internal tee_context is now also when allocating driver private shared memory. This decouples the shared memory object from its original tee_context. This is needed when the life time of such a memory allocation outlives the client tee_context. This patch fixes the problem described below: The addition of a shutdown hook by commit f25889f93184 ("optee: fix tee out of memory failure seen during kexec reboot") introduced a kernel shutdown regression that can be triggered after running the OP-TEE xtest suites. Once the shutdown hook is called it is not possible to communicate any more with the supplicant process because the system is not scheduling task any longer. Thus if the optee driver shutdown path receives a supplicant RPC request from the OP-TEE we will deadlock the kernel's shutdown. Fixes: f25889f93184 ("optee: fix tee out of memory failure seen during kexec reboot") Fixes: 217e0250cccb ("tee: use reference counting for tee_context") Reported-by: Lars Persson Cc: stable@vger.kernel.org Reviewed-by: Sumit Garg Signed-off-by: Jens Wiklander commit 868d7618d75f2cac23c2be6ca8d55ae1380c36d1 Author: Hans de Goede Date: Thu Feb 3 11:33:02 2022 +0100 platform/x86: thinkpad_acpi: Add dual-fan quirk for T15g (2nd gen) The ThinkPad T15g Gen 2 has 2 fan, add a TPACPI_FAN_2CTL quirk entry for it to the fan_quirk_table[] so that both fans can be controllerd. Reported-and-tested-by: David Dreschner Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220203103302.49401-1-hdegoede@redhat.com commit 1dd498e5e26ad71e3e9130daf72cfb6a693fee03 Author: James Morse Date: Thu Jan 27 12:20:52 2022 +0000 KVM: arm64: Workaround Cortex-A510's single-step and PAC trap errata Cortex-A510's erratum #2077057 causes SPSR_EL2 to be corrupted when single-stepping authenticated ERET instructions. A single step is expected, but a pointer authentication trap is taken instead. The erratum causes SPSR_EL1 to be copied to SPSR_EL2, which could allow EL1 to cause a return to EL2 with a guest controlled ELR_EL2. Because the conditions require an ERET into active-not-pending state, this is only a problem for the EL2 when EL2 is stepping EL1. In this case the previous SPSR_EL2 value is preserved in struct kvm_vcpu, and can be restored. Cc: stable@vger.kernel.org # 53960faf2b73: arm64: Add Cortex-A510 CPU part definition Cc: stable@vger.kernel.org Signed-off-by: James Morse [maz: fixup cpucaps ordering] Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220127122052.1584324-5-james.morse@arm.com commit 1229630af88620f6e3a621a1ebd1ca14d9340df7 Author: James Morse Date: Thu Jan 27 12:20:51 2022 +0000 KVM: arm64: Stop handle_exit() from handling HVC twice when an SError occurs Prior to commit defe21f49bc9 ("KVM: arm64: Move PC rollback on SError to HYP"), when an SError is synchronised due to another exception, KVM handles the SError first. If the guest survives, the instruction that triggered the original exception is re-exectued to handle the first exception. HVC is treated as a special case as the instruction wouldn't normally be re-exectued, as its not a trap. Commit defe21f49bc9 didn't preserve the behaviour of the 'return 1' that skips the rest of handle_exit(). Since commit defe21f49bc9, KVM will try to handle the SError and the original exception at the same time. When the exception was an HVC, fixup_guest_exit() has already rolled back ELR_EL2, meaning if the guest has virtual SError masked, it will execute and handle the HVC twice. Restore the original behaviour. Fixes: defe21f49bc9 ("KVM: arm64: Move PC rollback on SError to HYP") Cc: stable@vger.kernel.org Signed-off-by: James Morse Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220127122052.1584324-4-james.morse@arm.com commit 1c71dbc8a179d99dd9bb7e7fc1888db613cf85de Author: James Morse Date: Thu Jan 27 12:20:50 2022 +0000 KVM: arm64: Avoid consuming a stale esr value when SError occur When any exception other than an IRQ occurs, the CPU updates the ESR_EL2 register with the exception syndrome. An SError may also become pending, and will be synchronised by KVM. KVM notes the exception type, and whether an SError was synchronised in exit_code. When an exception other than an IRQ occurs, fixup_guest_exit() updates vcpu->arch.fault.esr_el2 from the hardware register. When an SError was synchronised, the vcpu esr value is used to determine if the exception was due to an HVC. If so, ELR_EL2 is moved back one instruction. This is so that KVM can process the SError first, and re-execute the HVC if the guest survives the SError. But if an IRQ synchronises an SError, the vcpu's esr value is stale. If the previous non-IRQ exception was an HVC, KVM will corrupt ELR_EL2, causing an unrelated guest instruction to be executed twice. Check ARM_EXCEPTION_CODE() before messing with ELR_EL2, IRQs don't update this register so don't need to check. Fixes: defe21f49bc9 ("KVM: arm64: Move PC rollback on SError to HYP") Cc: stable@vger.kernel.org Reported-by: Steven Price Signed-off-by: James Morse Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220127122052.1584324-3-james.morse@arm.com commit 622c9a3a7868e1eeca39c55305ca3ebec4742b64 Author: Alexander Stein Date: Wed Feb 2 09:17:55 2022 +0100 drm: mxsfb: Fix NULL pointer dereference mxsfb should not ever dereference the NULL pointer which drm_atomic_get_new_bridge_state is allowed to return. Assume a fixed format instead. Fixes: b776b0f00f24 ("drm: mxsfb: Use bus_format from the nearest bridge if present") Signed-off-by: Alexander Stein Signed-off-by: Marek Vasut Link: https://patchwork.freedesktop.org/patch/msgid/20220202081755.145716-3-alexander.stein@ew.tq-group.com commit 5f06f6bf8d816578c390a2b8a485d40adcca4749 Author: Luca Coelho Date: Fri Jan 28 14:48:51 2022 +0200 iwlwifi: mvm: don't send SAR GEO command for 3160 devices SAR GEO offsets are not supported on 3160 devices. The code was refactored and caused us to start sending the command anyway, which causes a FW assertion failure. Fix that only considering this feature supported on FW API with major version is 17 if the device is not 3160. Additionally, fix the caller of iwl_mvm_sar_geo_init() so that it checks for the return value, which it was ignoring. Reported-by: Len Brown Signed-off-by: Luca Coelho Fixes: 78a19d5285d9 ("iwlwifi: mvm: Read the PPAG and SAR tables at INIT stage") Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/iwlwifi.20220128144623.96f683a89b42.I14e2985bfd7ddd8a8d83eb1869b800c0e7f30db4@changeid commit 92883a524ae918736a7b8acef98698075507b8c1 Author: Luca Coelho Date: Fri Jan 28 14:48:50 2022 +0200 iwlwifi: remove deprecated broadcast filtering feature This feature has been deprecated and should not be used anymore. With newer firmwares, namely *-67.ucode and above, trying to use it causes an assertion failure in the FW, similar to this: [Tue Jan 11 20:05:24 2022] iwlwifi 0000:04:00.0: 0x00001062 | ADVANCED_SYSASSERT In order to prevent this feature from being used, remove it entirely and get rid of the Kconfig option that enables it (IWLWIFI_BCAST_FILTERING). Fixes: cbaa6aeedee5 ("iwlwifi: bump FW API to 67 for AX devices") Link: https://bugzilla.kernel.org/show_bug.cgi?id=215488 Cc: stable@vger.kernel.org # 5.16.x Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/iwlwifi.20220128144623.9241e049f13e.Ia4f282813ca2ddd24c13427823519113f2bbebf2@changeid commit 30de48b436a08a8df651011e2d3614e26a2c592a Author: Emmanuel Grumbach Date: Fri Jan 28 14:30:57 2022 +0200 iwlwifi: mei: report RFKILL upon register when needed When we register and we are in link protection passive, meaning that the host can't touch the device, report RFKILL immediately upon register() and don't wait for the CSME firmware to let us know again about the link protection state. What happens if we wait is that the host will not see RFKILL soon enough and we'll have a window of time during which it can bring up the device which will request ownership. Fixes: 2da4366f9e2c ("iwlwifi: mei: add the driver to allow cooperation with CSME") Signed-off-by: Emmanuel Grumbach Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/iwlwifi.20220128142706.a136f9f46336.Ief7506dc3b1813a1943a5a639aa45d8e5f284f31@changeid commit 7cf800f46e07e6b75a43036c4389d6ca717fd017 Author: Emmanuel Grumbach Date: Fri Jan 28 14:30:56 2022 +0200 iwlwifi: mvm: don't feed the hardware RFKILL into iwlmei iwlmei can trigger a hardware RFKILL when the CSME firmware does not want the host to touch the device. But then, iwlmvm reports RFKILL which makes cfg80211 update iwlmvm about RFKILL. iwlmvm then thinks there is a change in the _software_ rfkill and it calls rfkill_blocked() to fetch the RFKILL state. This returns that RFKILL is blocked (because of iwlmei) and iwlmvm tells iwlmei that _software_ RFKILL is asserted. This is a bug of course. Fix this by checking explicitly the software RFKILL state and not the overall RFKILL state. Fixes: 7ce1f2157e14 ("iwlwifi: mvm: read the rfkill state and feed it to iwlmei") Signed-off-by: Emmanuel Grumbach Fixes: 7ce1f2157e14 ("iwlwifi: mvm: read the rfkill state and feed it to iwlmei") Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/iwlwifi.20220128142706.f293861a3f92.I9553d27df1de6fd5756a43ea5f8b89d06fa1a6f2@changeid commit 44bf7c4667efe10390aa59eda39833a9a0439b5b Author: Emmanuel Grumbach Date: Fri Jan 28 14:30:55 2022 +0200 iwlwifi: mei: retry mapping the shared area The shared area is a DMA memory allocated in the host and mapped so that the host and the CSME firmware can exchange data. It is mapped through a dedicated PCI device that is driven by the mei bus driver. The bus driver is in charge of allocating and mapping this memory. It also needs to configure the CSME firmware with a specific set of commands, so that the CSME firmware will know that this memory is meant to be used by its internal WLAN module. For this, the CSME firmware first needs to completely initialize its WLAN module and only then get the mapping request. The problem is that the mei bus enumeration completes before the WLAN is completely ready. This means that the WLAN module's initialization is racing with iwlmei's allocation and mapping flow. Testing showed a problem in resume flows where iwlmei was too fast and the DMA mapping failed. Add a retry mechanism to make sure that we will succeed to map the memory. Fixes: 2da4366f9e2c ("iwlwifi: mei: add the driver to allow cooperation with CSME") Fixes: bcbddc4f9d02 ("iwlwifi: mei: wait before mapping the shared area") Signed-off-by: Emmanuel Grumbach Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/iwlwifi.20220128142706.cc51e6a6d635.I4b74a082eb8d89f9e4f556a27c4339c15444dc6c@changeid commit e1849784de9b75519f972abd22fb7e9e7bd7f992 Author: Emmanuel Grumbach Date: Fri Jan 28 14:30:54 2022 +0200 iwlwifi: mei: fix the pskb_may_pull check in ipv4 The check makes sure that we can look at the ip header. We first need to check that the basic ip header (20 bytes) can be pulled before we look at the field that will teach us how long is the ip header. This is why there are two checks. The second check was wrong and smatch pointed that sizeof(ip_hdrlen(skb) - sizeof(*iphdr)) can't be right. Looking at the code again made me think that we really need ip_hdrlen(skb) since we want to make sure all the IP header is in the buffer header. This will allow us to set the transport offset and from there to look at the transport header (TCP / UDP). Reported-by: Dan Carpenter Signed-off-by: Emmanuel Grumbach Fixes: 2da4366f9e2c ("iwlwifi: mei: add the driver to allow cooperation with CSME") Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/iwlwifi.20220128142706.6d9fcf82691e.I449b1e21c5b5478f2ac218522570479918f49f9d@changeid commit 4c29c1e27a1e178a219b3877d055e6dd643bdfda Author: Johannes Berg Date: Fri Jan 28 14:30:53 2022 +0200 iwlwifi: pcie: gen2: fix locking when "HW not ready" If we run into this error path, we shouldn't unlock the mutex since it's not locked since. Fix this in the gen2 code as well. Fixes: eda50cde58de ("iwlwifi: pcie: add context information support") Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/iwlwifi.20220128142706.b8b0dfce16ef.Ie20f0f7b23e5911350a2766524300d2915e7b677@changeid commit e9848aed147708a06193b40d78493b0ef6abccf2 Author: Johannes Berg Date: Fri Jan 28 14:30:52 2022 +0200 iwlwifi: pcie: fix locking when "HW not ready" If we run into this error path, we shouldn't unlock the mutex since it's not locked since. Fix this. Fixes: a6bd005fe92d ("iwlwifi: pcie: fix RF-Kill vs. firmware load race") Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/iwlwifi.20220128142706.5d16821d1433.Id259699ddf9806459856d6aefbdbe54477aecffd@changeid commit 973f02c932b0be41a26bb9bdf38b7b92721611d2 Author: Miri Korenblit Date: Fri Jan 28 14:30:51 2022 +0200 iwlwifi: fix iwl_legacy_rate_to_fw_idx There are a couple of bugs in this function: 1. It is declared as a non-static function, even though it's only used in one file. 2. Its return value should be of type u32 but it returns (in some cases) -1. Fix them by making this function static and returning an error value of type unsigned. In addition, we're assigning the return value of this function as the legacy rate even if the function returned an error value. Fix this by assigning the lowest rate in this case. Signed-off-by: Miri Korenblit Reported-by: Ye Guojin Reported-by: Zeal Robot Fixes: 9998f81e4ba5 ("iwlwifi: mvm: convert old rate & flags to the new format.") Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/iwlwifi.20220128142706.5612eeb9d6d0.I992e10d93fc22919b2bc42daad087ee1b5d6f014@changeid commit be8287c9b8326d767429c8371bbc78b33f6efe13 Author: Miri Korenblit Date: Fri Jan 28 14:30:50 2022 +0200 iwlwifi: mvm: fix condition which checks the version of rate_n_flags We're checking the FW version of TX_CMD in order to decide whether to convert rate_n_flags from the old format to the new one. If the API is smaller or equal to 6 we should convert it. Currently we're converting if the API version is greater than 6. Fix it. Signed-off-by: Miri Korenblit Fixes: dc52fac37c87 ("iwlwifi: mvm: Support new TX_RSP and COMPRESSED_BA_RES versions") Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/iwlwifi.20220128142706.a264ac51d106.I228ba1317cdcbfef931c09d280d701fcad9048d2@changeid commit e25a8d959992f61b64a58fc62fb7951dc6f31d1f Author: Jan Beulich Date: Tue Feb 1 11:57:16 2022 +0100 x86/Xen: streamline (and fix) PV CPU enumeration This started out with me noticing that "dom0_max_vcpus=" with larger than the number of physical CPUs reported through ACPI tables would not bring up the "excess" vCPU-s. Addressing this is the primary purpose of the change; CPU maps handling is being tidied only as far as is necessary for the change here (with the effect of also avoiding the setting up of too much per-CPU infrastructure, i.e. for CPUs which can never come online). Noticing that xen_fill_possible_map() is called way too early, whereas xen_filter_cpu_maps() is called too late (after per-CPU areas were already set up), and further observing that each of the functions serves only one of Dom0 or DomU, it looked like it was better to simplify this. Use the .get_smp_config hook instead, uniformly for Dom0 and DomU. xen_fill_possible_map() can be dropped altogether, while xen_filter_cpu_maps() is re-purposed but not otherwise changed. Signed-off-by: Jan Beulich Reviewed-by: Boris Ostrovsky Link: https://lore.kernel.org/r/2dbd5f0a-9859-ca2d-085e-a02f7166c610@suse.com Signed-off-by: Juergen Gross commit 3ccb3128e50380b86e01c2f9b6f4ac9c11dc05eb Author: Randy Dunlap Date: Mon Jan 31 08:19:59 2022 -0800 xen: update missing ioctl magic numers documentation Add missing ioctl "magic numbers" for various Xen interfaces (xenbus_dev.h, gntalloc.h, gntdev.h, and privcmd.h). Signed-off-by: Randy Dunlap Reviewed-by: Juergen Gross Cc: Boris Ostrovsky Cc: Juergen Gross Cc: Stefano Stabellini Cc: xen-devel@lists.xenproject.org Link: https://lore.kernel.org/r/20220131161959.16509-1-rdunlap@infradead.org Signed-off-by: Juergen Gross commit 164666fa66669d437bdcc8d5f1744a2aee73be41 Author: Demi Marie Obenour Date: Mon Jan 31 12:23:07 2022 -0500 Improve docs for IOCTL_GNTDEV_MAP_GRANT_REF --------------cKY3Ggs6VDUCSn4I6iN78sHA Content-Type: multipart/mixed; boundary="------------g0T69ASidFiPhh4eOY4XzIg1" --------------g0T69ASidFiPhh4eOY4XzIg1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable The current implementation of gntdev guarantees that the first call to IOCTL_GNTDEV_MAP_GRANT_REF will set @index to 0. This is required to use gntdev for Wayland, which is a future desire of Qubes OS. Additionally, requesting zero grants results in an error, but this was not documented either. Document both of these. Signed-off-by: Demi Marie Obenour Reviewed-by: Juergen Gross Link: https://lore.kernel.org/r/f66c5a4e-2034-00b5-a635-6983bd999c07@gmail.com Signed-off-by: Juergen Gross commit 4564661af6ee321942ec1ab012191d7adedd3e00 Author: Randy Dunlap Date: Sun Jan 30 11:17:05 2022 -0800 xen: xenbus_dev.h: delete incorrect file name It is better/preferred not to include file names in source files because (a) they are not needed and (b) they can be incorrect, so just delete this incorrect file name. Signed-off-by: Randy Dunlap Reviewed-by: Juergen Gross Cc: Boris Ostrovsky Cc: Juergen Gross Cc: Stefano Stabellini Cc: xen-devel@lists.xenproject.org Link: https://lore.kernel.org/r/20220130191705.24971-1-rdunlap@infradead.org Signed-off-by: Juergen Gross commit b293dcc473d22a62dc6d78de2b15e4f49515db56 Author: Hou Tao Date: Wed Feb 2 14:01:58 2022 +0800 bpf: Use VM_MAP instead of VM_ALLOC for ringbuf After commit 2fd3fb0be1d1 ("kasan, vmalloc: unpoison VM_ALLOC pages after mapping"), non-VM_ALLOC mappings will be marked as accessible in __get_vm_area_node() when KASAN is enabled. But now the flag for ringbuf area is VM_ALLOC, so KASAN will complain out-of-bound access after vmap() returns. Because the ringbuf area is created by mapping allocated pages, so use VM_MAP instead. After the change, info in /proc/vmallocinfo also changes from [start]-[end] 24576 ringbuf_map_alloc+0x171/0x290 vmalloc user to [start]-[end] 24576 ringbuf_map_alloc+0x171/0x290 vmap user Fixes: 457f44363a88 ("bpf: Implement BPF ring buffer and verifier support for it") Reported-by: syzbot+5ad567a418794b9b5983@syzkaller.appspotmail.com Signed-off-by: Hou Tao Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220202060158.6260-1-houtao1@huawei.com commit 6d0d95a1c2b07270870e7be16575c513c29af3f1 Author: Antony Antony Date: Tue Feb 1 07:51:57 2022 +0100 xfrm: fix the if_id check in changelink if_id will be always 0, because it was not yet initialized. Fixes: 8dce43919566 ("xfrm: interface with if_id 0 should return error") Reported-by: Pavel Machek Signed-off-by: Antony Antony Signed-off-by: Steffen Klassert commit 6a51abdeb259a56d95f13cc67e3a0838bcda0377 Author: Uday Shankar Date: Thu Jan 20 12:17:37 2022 -0800 nvme-fabrics: fix state check in nvmf_ctlr_matches_baseopts() Controller deletion/reset, immediately followed by or concurrent with a reconnect, is hard failing the connect attempt resulting in a complete loss of connectivity to the controller. In the connect request, fabrics looks for an existing controller with the same address components and aborts the connect if a controller already exists and the duplicate connect option isn't set. The match routine filters out controllers that are dead or dying, so they don't interfere with the new connect request. When NVME_CTRL_DELETING_NOIO was added, it missed updating the state filters in the nvmf_ctlr_matches_baseopts() routine. Thus, when in this new state, it's seen as a live controller and fails the connect request. Correct by adding the DELETING_NIO state to the match checks. Fixes: ecca390e8056 ("nvme: fix deadlock in disconnect during scan_work and/or ana_work") Cc: # v5.7+ Signed-off-by: Uday Shankar Reviewed-by: James Smart Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit d3b331fb51f326d5b5326010bf2b5841bb86cdc6 Author: Ryan Bair Date: Wed Dec 22 11:04:05 2021 -0500 cifs: fix workstation_name for multiuser mounts Set workstation_name from the master_tcon for multiuser mounts. Just in case, protect size_of_ntlmssp_blob against a NULL workstation_name. Fixes: 49bd49f983b5 ("cifs: send workstation name during ntlmssp session setup") Cc: stable@vger.kernel.org # 5.16 Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Ryan Bair Signed-off-by: Steve French commit 40c845c176953311c8fc232e977516f7733c64cd Author: Rohith Surabattula Date: Tue Feb 1 07:22:02 2022 +0000 Invalidate fscache cookie only when inode attributes are changed. For example if mtime or size has changed. Signed-off-by: Rohith Surabattula Reviewed-by: Shyam Prasad N Signed-off-by: Steve French commit 4a81f6da9cb2d1ef911131a6fd8bd15cb61fc772 Author: Daniel Borkmann Date: Tue Feb 1 20:39:42 2022 +0100 net, neigh: Do not trigger immediate probes on NUD_FAILED from neigh_managed_work syzkaller was able to trigger a deadlock for NTF_MANAGED entries [0]: kworker/0:16/14617 is trying to acquire lock: ffffffff8d4dd370 (&tbl->lock){++-.}-{2:2}, at: ___neigh_create+0x9e1/0x2990 net/core/neighbour.c:652 [...] but task is already holding lock: ffffffff8d4dd370 (&tbl->lock){++-.}-{2:2}, at: neigh_managed_work+0x35/0x250 net/core/neighbour.c:1572 The neighbor entry turned to NUD_FAILED state, where __neigh_event_send() triggered an immediate probe as per commit cd28ca0a3dd1 ("neigh: reduce arp latency") via neigh_probe() given table lock was held. One option to fix this situation is to defer the neigh_probe() back to the neigh_timer_handler() similarly as pre cd28ca0a3dd1. For the case of NTF_MANAGED, this deferral is acceptable given this only happens on actual failure state and regular / expected state is NUD_VALID with the entry already present. The fix adds a parameter to __neigh_event_send() in order to communicate whether immediate probe is allowed or disallowed. Existing call-sites of neigh_event_send() default as-is to immediate probe. However, the neigh_managed_work() disables it via use of neigh_event_send_probe(). [0] __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:2956 [inline] check_deadlock kernel/locking/lockdep.c:2999 [inline] validate_chain kernel/locking/lockdep.c:3788 [inline] __lock_acquire.cold+0x149/0x3ab kernel/locking/lockdep.c:5027 lock_acquire kernel/locking/lockdep.c:5639 [inline] lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5604 __raw_write_lock_bh include/linux/rwlock_api_smp.h:202 [inline] _raw_write_lock_bh+0x2f/0x40 kernel/locking/spinlock.c:334 ___neigh_create+0x9e1/0x2990 net/core/neighbour.c:652 ip6_finish_output2+0x1070/0x14f0 net/ipv6/ip6_output.c:123 __ip6_finish_output net/ipv6/ip6_output.c:191 [inline] __ip6_finish_output+0x61e/0xe90 net/ipv6/ip6_output.c:170 ip6_finish_output+0x32/0x200 net/ipv6/ip6_output.c:201 NF_HOOK_COND include/linux/netfilter.h:296 [inline] ip6_output+0x1e4/0x530 net/ipv6/ip6_output.c:224 dst_output include/net/dst.h:451 [inline] NF_HOOK include/linux/netfilter.h:307 [inline] ndisc_send_skb+0xa99/0x17f0 net/ipv6/ndisc.c:508 ndisc_send_ns+0x3a9/0x840 net/ipv6/ndisc.c:650 ndisc_solicit+0x2cd/0x4f0 net/ipv6/ndisc.c:742 neigh_probe+0xc2/0x110 net/core/neighbour.c:1040 __neigh_event_send+0x37d/0x1570 net/core/neighbour.c:1201 neigh_event_send include/net/neighbour.h:470 [inline] neigh_managed_work+0x162/0x250 net/core/neighbour.c:1574 process_one_work+0x9ac/0x1650 kernel/workqueue.c:2307 worker_thread+0x657/0x1110 kernel/workqueue.c:2454 kthread+0x2e9/0x3a0 kernel/kthread.c:377 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Fixes: 7482e3841d52 ("net, neigh: Add NTF_MANAGED flag for managed neighbor entries") Reported-by: syzbot+5239d0e1778a500d477a@syzkaller.appspotmail.com Signed-off-by: Daniel Borkmann Cc: Eric Dumazet Cc: Roopa Prabhu Tested-by: syzbot+5239d0e1778a500d477a@syzkaller.appspotmail.com Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20220201193942.5055-1-daniel@iogearbox.net Signed-off-by: Jakub Kicinski commit b67985be400969578d4d4b17299714c0e5d2c07b Author: Eric Dumazet Date: Tue Feb 1 10:46:40 2022 -0800 tcp: add missing tcp_skb_can_collapse() test in tcp_shift_skb_data() tcp_shift_skb_data() might collapse three packets into a larger one. P_A, P_B, P_C -> P_ABC Historically, it used a single tcp_skb_can_collapse_to(P_A) call, because it was enough. In commit 85712484110d ("tcp: coalesce/collapse must respect MPTCP extensions"), this call was replaced by a call to tcp_skb_can_collapse(P_A, P_B) But the now needed test over P_C has been missed. This probably broke MPTCP. Then later, commit 9b65b17db723 ("net: avoid double accounting for pure zerocopy skbs") added an extra condition to tcp_skb_can_collapse(), but the missing call from tcp_shift_skb_data() is also breaking TCP zerocopy, because P_A and P_C might have different skb_zcopy_pure() status. Fixes: 85712484110d ("tcp: coalesce/collapse must respect MPTCP extensions") Fixes: 9b65b17db723 ("net: avoid double accounting for pure zerocopy skbs") Signed-off-by: Eric Dumazet Cc: Mat Martineau Cc: Talal Ahmad Cc: Arjun Roy Cc: Willem de Bruijn Acked-by: Soheil Hassas Yeganeh Acked-by: Paolo Abeni Link: https://lore.kernel.org/r/20220201184640.756716-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit c4f9c8bbcc24f00002827f73957053a59aba5646 Author: Sergey Shtylyov Date: Thu Feb 3 00:30:38 2022 +0300 MAINTAINERS: add myself as PATA drivers reviewer Add myself as a reviewer for the libata PATA drivers -- there is activity in this area still... 8-) Having been hacking on ATA from the early 90s, I think I deserved this highly responsible position, at last! :-) Signed-off-by: Sergey Shtylyov Signed-off-by: Damien Le Moal commit e8ae38720e1a685fd98cfa5ae118c9d07b45ca79 Author: Christian König Date: Fri Jan 28 13:21:10 2022 +0100 drm/amdgpu: fix logic inversion in check We probably never trigger this, but the logic inside the check is inverted. Signed-off-by: Christian König Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit e55a3aea418269266d84f426b3bd70794d3389c8 Author: Mario Limonciello Date: Tue Jan 25 21:46:58 2022 -0600 drm/amd: avoid suspend on dGPUs w/ s2idle support when runtime PM enabled dGPUs connected to Intel systems configured for suspend to idle will not have the power rails cut at suspend and resetting the GPU may lead to problematic behaviors. Fixes: e25443d2765f4 ("drm/amdgpu: add a dev_pm_ops prepare callback (v2)") Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1879 Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello Signed-off-by: Alex Deucher commit 30fbce374745a9c6af93c775a5ac49a97f822fda Author: Aun-Ali Zaidi Date: Sat Jan 29 05:49:55 2022 +0000 drm/amd/display: Force link_rate as LINK_RATE_RBR2 for 2018 15" Apple Retina panels The eDP link rate reported by the DP_MAX_LINK_RATE dpcd register (0xa) is contradictory to the highest rate supported reported by EDID (0xc = LINK_RATE_RBR2). The effects of this compounded with commit '4a8ca46bae8a ("drm/amd/display: Default max bpc to 16 for eDP")' results in no display modes being found and a dark panel. For now, simply force the maximum supported link rate for the eDP attached 2018 15" Apple Retina panels. Additionally, we must also check the firmware revision since the device ID reported by the DPCD is identical to that of the more capable 16,1, incorrectly quirking it. We also use said firmware check to quirk the refreshed 15,1 models with Vega graphics as they use a slightly newer firmware version. Tested-by: Aun-Ali Zaidi Reviewed-by: Harry Wentland Signed-off-by: Aun-Ali Zaidi Signed-off-by: Aditya Garg Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 49a6ebb95d04bdaa5d57313a380c44249cf02100 Author: Zhan Liu Date: Fri Jan 28 22:03:59 2022 +0800 drm/amd/display: revert "Reset fifo after enable otg" [Why] This change causes regression, that prevents some systems from lighting up internal displays. [How] Revert this patch until a new solution is ready. Tested-by: Daniel Wheeler Reviewed-by: Charlene Liu Acked-by: Stylon Wang Signed-off-by: Zhan Liu Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit f5fa54f45ab41cbb1f99b1208f49554132ffb207 Author: Paul Hsieh Date: Fri Jan 28 22:03:57 2022 +0800 drm/amd/display: watermark latencies is not enough on DCN31 [Why] The original latencies were causing underflow in some modes. Resolution: 2880x1620@60p when HDR enable [How] 1. Replace with the up-to-date watermark values based on new measurments 2. Correct the ddr_wm_table name to DDR5 on DCN31 Tested-by: Daniel Wheeler Reviewed-by: Aric Cyr Acked-by: Stylon Wang Signed-off-by: Paul Hsieh Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 2d8ae25d233767171942a9fba5fd8f4a620996be Author: Agustin Gutierrez Date: Fri Jan 28 17:51:53 2022 -0500 drm/amd/display: Update watermark values for DCN301 [Why] There is underflow / visual corruption DCN301, for high bandwidth MST DSC configurations such as 2x1440p144 or 2x4k60. [How] Use up-to-date watermark values for DCN301. Reviewed-by: Zhan Liu Signed-off-by: Agustin Gutierrez Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit bca52455a3c07922ee976714b00563a13a29ab15 Author: Lang Yu Date: Fri Jan 28 18:24:53 2022 +0800 drm/amdgpu: fix a potential GPU hang on cyan skillfish We observed a GPU hang when querying GMC CG state(i.e., cat amdgpu_pm_info) on cyan skillfish. Acctually, cyan skillfish doesn't support any CG features. Just prevent it from accessing GMC CG registers. Signed-off-by: Lang Yu Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 04ef860469fda6a646dc841190d05b31fae68e8c Author: Mario Limonciello Date: Tue Jan 25 21:37:57 2022 -0600 drm/amd: Only run s3 or s0ix if system is configured properly This will cause misconfigured systems to not run the GPU suspend routines. * In APUs that are properly configured system will go into s2idle. * In APUs that are intended to be S3 but user selects s2idle the GPU will stay fully powered for the suspend. * In APUs that are intended to be s2idle and system misconfigured the GPU will stay fully powered for the suspend. * In systems that are intended to be s2idle, but AMD dGPU is also present, the dGPU will go through S3 Signed-off-by: Mario Limonciello Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit f52a2b8badbd24faf73a13c9c07fdb9d07352944 Author: Mario Limonciello Date: Tue Jan 25 21:35:09 2022 -0600 drm/amd: add support to check whether the system is set to s3 This will be used to help make decisions on what to do in misconfigured systems. v2: squash in semicolon fix from Stephen Rothwell Signed-off-by: Mario Limonciello Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit bfb1a7c91fb7758273b4a8d735313d9cc388b502 Author: Nick Desaulniers Date: Wed Feb 2 12:55:53 2022 -0800 x86/bug: Merge annotate_reachable() into _BUG_FLAGS() asm In __WARN_FLAGS(), we had two asm statements (abbreviated): asm volatile("ud2"); asm volatile(".pushsection .discard.reachable"); These pair of statements are used to trigger an exception, but then help objtool understand that for warnings, control flow will be restored immediately afterwards. The problem is that volatile is not a compiler barrier. GCC explicitly documents this: > Note that the compiler can move even volatile asm instructions > relative to other code, including across jump instructions. Also, no clobbers are specified to prevent instructions from subsequent statements from being scheduled by compiler before the second asm statement. This can lead to instructions from subsequent statements being emitted by the compiler before the second asm statement. Providing a scheduling model such as via -march= options enables the compiler to better schedule instructions with known latencies to hide latencies from data hazards compared to inline asm statements in which latencies are not estimated. If an instruction gets scheduled by the compiler between the two asm statements, then objtool will think that it is not reachable, producing a warning. To prevent instructions from being scheduled in between the two asm statements, merge them. Also remove an unnecessary unreachable() asm annotation from BUG() in favor of __builtin_unreachable(). objtool is able to track that the ud2 from BUG() terminates control flow within the function. Link: https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html#Volatile Link: https://github.com/ClangBuiltLinux/linux/issues/1483 Signed-off-by: Nick Desaulniers Signed-off-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220202205557.2260694-1-ndesaulniers@google.com commit 9b818634f8e7e0bca3386a50b1fada7a49036408 Author: Dave Jiang Date: Wed Feb 2 14:19:25 2022 -0700 MAINTAINERS: update mailing list address for NTB subsystem NTB mailing list is moving from linux-ntb@googlegroups.com to ntb@lists.linux.dev in order to get better archive and lore support. Update all entries in MAINTAINERS. Signed-off-by: Dave Jiang Signed-off-by: Jon Mason commit 618c2dc667c87995cdc7de339224bd96bb049a1f Merge: 7fa5c33d04316 2b7c46369f09c Author: Mark Brown Date: Wed Feb 2 18:15:20 2022 +0000 ASoC: ops: Fix stereo change notifications Merge series from Mark Brown : The event generation coverage I just wrote shows that the generic ASoC ops fail to generate events for stereo controls when only the first channel is changed, we just return the status for the second channel and discard that for the first. commit 88808fbbead481aedb46640a5ace69c58287f56a Merge: d5084ffbc50c7 ab451ea952fe9 Author: Linus Torvalds Date: Wed Feb 2 10:14:31 2022 -0800 Merge tag 'nfsd-5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux Pull nfsd fixes from Chuck Lever: "Notable bug fixes: - Ensure SM_NOTIFY doesn't crash the NFS server host - Ensure NLM locks are cleaned up after client reboot - Fix a leak of internal NFSv4 lease information" * tag 'nfsd-5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: nfsd: nfsd4_setclientid_confirm mistakenly expires confirmed client. lockd: fix failure to cleanup client locks lockd: fix server crash on reboot of client holding lock commit 0f9650bd838efe5c52f7e5f40c3204ad59f1964d Author: Song Liu Date: Wed Feb 2 09:24:10 2022 -0800 md: fix NULL pointer deref with nowait but no mddev->queue Leon reported NULL pointer deref with nowait support: [ 15.123761] device-mapper: raid: Loading target version 1.15.1 [ 15.124185] device-mapper: raid: Ignoring chunk size parameter for RAID 1 [ 15.124192] device-mapper: raid: Choosing default region size of 4MiB [ 15.129524] BUG: kernel NULL pointer dereference, address: 0000000000000060 [ 15.129530] #PF: supervisor write access in kernel mode [ 15.129533] #PF: error_code(0x0002) - not-present page [ 15.129535] PGD 0 P4D 0 [ 15.129538] Oops: 0002 [#1] PREEMPT SMP NOPTI [ 15.129541] CPU: 5 PID: 494 Comm: ldmtool Not tainted 5.17.0-rc2-1-mainline #1 9fe89d43dfcb215d2731e6f8851740520778615e [ 15.129546] Hardware name: Gigabyte Technology Co., Ltd. X570 AORUS ELITE/X570 AORUS ELITE, BIOS F36e 10/14/2021 [ 15.129549] RIP: 0010:blk_queue_flag_set+0x7/0x20 [ 15.129555] Code: 00 00 00 0f 1f 44 00 00 48 8b 35 e4 e0 04 02 48 8d 57 28 bf 40 01 \ 00 00 e9 16 c1 be ff 66 0f 1f 44 00 00 0f 1f 44 00 00 89 ff 48 0f ab 7e 60 \ 31 f6 89 f7 c3 66 66 2e 0f 1f 84 00 00 00 00 00 [ 15.129559] RSP: 0018:ffff966b81987a88 EFLAGS: 00010202 [ 15.129562] RAX: ffff8b11c363a0d0 RBX: ffff8b11e294b070 RCX: 0000000000000000 [ 15.129564] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 000000000000001d [ 15.129566] RBP: ffff8b11e294b058 R08: 0000000000000000 R09: 0000000000000000 [ 15.129568] R10: 0000000000000000 R11: 0000000000000000 R12: ffff8b11e294b070 [ 15.129570] R13: 0000000000000000 R14: ffff8b11e294b000 R15: 0000000000000001 [ 15.129572] FS: 00007fa96e826780(0000) GS:ffff8b18deb40000(0000) knlGS:0000000000000000 [ 15.129575] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 15.129577] CR2: 0000000000000060 CR3: 000000010b8ce000 CR4: 00000000003506e0 [ 15.129580] Call Trace: [ 15.129582] [ 15.129584] md_run+0x67c/0xc70 [md_mod 1e470c1b6bcf1114198109f42682f5a2740e9531] [ 15.129597] raid_ctr+0x134a/0x28ea [dm_raid 6a645dd7519e72834bd7e98c23497eeade14cd63] [ 15.129604] ? dm_split_args+0x63/0x150 [dm_mod 0d7b0bc3414340a79c4553bae5ca97294b78336e] [ 15.129615] dm_table_add_target+0x188/0x380 [dm_mod 0d7b0bc3414340a79c4553bae5ca97294b78336e] [ 15.129625] table_load+0x13b/0x370 [dm_mod 0d7b0bc3414340a79c4553bae5ca97294b78336e] [ 15.129635] ? dev_suspend+0x2d0/0x2d0 [dm_mod 0d7b0bc3414340a79c4553bae5ca97294b78336e] [ 15.129644] ctl_ioctl+0x1bd/0x460 [dm_mod 0d7b0bc3414340a79c4553bae5ca97294b78336e] [ 15.129655] dm_ctl_ioctl+0xa/0x20 [dm_mod 0d7b0bc3414340a79c4553bae5ca97294b78336e] [ 15.129663] __x64_sys_ioctl+0x8e/0xd0 [ 15.129667] do_syscall_64+0x5c/0x90 [ 15.129672] ? syscall_exit_to_user_mode+0x23/0x50 [ 15.129675] ? do_syscall_64+0x69/0x90 [ 15.129677] ? do_syscall_64+0x69/0x90 [ 15.129679] ? syscall_exit_to_user_mode+0x23/0x50 [ 15.129682] ? do_syscall_64+0x69/0x90 [ 15.129684] ? do_syscall_64+0x69/0x90 [ 15.129686] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 15.129689] RIP: 0033:0x7fa96ecd559b [ 15.129692] Code: ff ff ff 85 c0 79 9b 49 c7 c4 ff ff ff ff 5b 5d 4c 89 e0 41 5c \ c3 66 0f 1f 84 00 00 00 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 a5 a8 0c 00 f7 d8 64 89 01 48 [ 15.129696] RSP: 002b:00007ffcaf85c258 EFLAGS: 00000206 ORIG_RAX: 0000000000000010 [ 15.129699] RAX: ffffffffffffffda RBX: 00007fa96f1b48f0 RCX: 00007fa96ecd559b [ 15.129701] RDX: 00007fa97017e610 RSI: 00000000c138fd09 RDI: 0000000000000003 [ 15.129702] RBP: 00007fa96ebab583 R08: 00007fa97017c9e0 R09: 00007ffcaf85bf27 [ 15.129704] R10: 0000000000000001 R11: 0000000000000206 R12: 00007fa97017e610 [ 15.129706] R13: 00007fa97017e640 R14: 00007fa97017e6c0 R15: 00007fa97017e530 [ 15.129709] This is caused by missing mddev->queue check for setting QUEUE_FLAG_NOWAIT Fix this by moving the QUEUE_FLAG_NOWAIT logic to under mddev->queue check. Fixes: f51d46d0e7cb ("md: add support for REQ_NOWAIT") Reported-by: Leon Möller Tested-by: Leon Möller Cc: Vishal Verma Signed-off-by: Song Liu commit de4d73b16d5d9c3e5d03a66046e5410e1e74f903 Author: Daniel Latypov Date: Thu Jan 27 14:17:10 2022 -0800 kunit: fix missing f in f-string in run_checks.py We're missing the `f` prefix to have python do string interpolation, so we'd never end up printing what the actual "unexpected" error is. Fixes: ee92ed38364e ("kunit: add run_checks.py script to validate kunit changes") Signed-off-by: Daniel Latypov Reviewed-by: David Gow Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit d5084ffbc50c76e4a237d87e022e88f6b15b3cb9 Merge: 27bb0b18c208e ee12595147ac1 Author: Linus Torvalds Date: Wed Feb 2 10:08:52 2022 -0800 Merge tag 'fsnotify_for_v5.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs Pull fanotify fix from Jan Kara: "Fix stale file descriptor in copy_event_to_user" * tag 'fsnotify_for_v5.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: fanotify: Fix stale file descriptor in copy_event_to_user() commit 27bb0b18c208ecd4c0deda6aad28616d73e4133d Merge: 3e5832e923a9c 235528072f28b Author: Linus Torvalds Date: Wed Feb 2 10:00:08 2022 -0800 Merge tag 'linux-kselftest-kunit-fixes-5.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull KUnit fixes from Shuah Khan: "A single fix to an error seen on qemu due to a missing import" * tag 'linux-kselftest-kunit-fixes-5.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: kunit: tool: Import missing importlib.abc commit 038b8d1d1ab1cce11a158d30bf080ff41a2cfd15 Author: Ilya Dryomov Date: Thu Dec 30 15:13:32 2021 +0100 libceph: optionally use bounce buffer on recv path in crc mode Both msgr1 and msgr2 in crc mode are zero copy in the sense that message data is read from the socket directly into the destination buffer. We assume that the destination buffer is stable (i.e. remains unchanged while it is being read to) though. Otherwise, CRC errors ensue: libceph: read_partial_message 0000000048edf8ad data crc 1063286393 != exp. 228122706 libceph: osd1 (1)192.168.122.1:6843 bad crc/signature libceph: bad data crc, calculated 57958023, expected 1805382778 libceph: osd2 (2)192.168.122.1:6876 integrity error, bad crc Introduce rxbounce option to enable use of a bounce buffer when receiving message data. In particular this is needed if a mapped image is a Windows VM disk, passed to QEMU. Windows has a system-wide "dummy" page that may be mapped into the destination buffer (potentially more than once into the same buffer) by the Windows Memory Manager in an effort to generate a single large I/O [1][2]. QEMU makes a point of preserving overlap relationships when cloning I/O vectors, so krbd gets exposed to this behaviour. [1] "What Is Really in That MDL?" https://docs.microsoft.com/en-us/previous-versions/windows/hardware/design/dn614012(v=vs.85) [2] https://blogs.msmvps.com/kernelmustard/2005/05/04/dummy-pages/ URL: https://bugzilla.redhat.com/show_bug.cgi?id=1973317 Signed-off-by: Ilya Dryomov Reviewed-by: Jeff Layton commit 2ea88716369ac9a7486a8cb309d6bf1239ea156c Author: Ilya Dryomov Date: Sun Jan 23 17:27:47 2022 +0100 libceph: make recv path in secure mode work the same as send path The recv path of secure mode is intertwined with that of crc mode. While it's slightly more efficient that way (the ciphertext is read into the destination buffer and decrypted in place, thus avoiding two potentially heavy memory allocations for the bounce buffer and the corresponding sg array), it isn't really amenable to changes. Sacrifice that edge and align with the send path which always uses a full-sized bounce buffer (currently there is no other way -- if the kernel crypto API ever grows support for streaming (piecewise) en/decryption for GCM [1], we would be able to easily take advantage of that on both sides). [1] https://lore.kernel.org/all/20141225202830.GA18794@gondor.apana.org.au/ Signed-off-by: Ilya Dryomov Reviewed-by: Jeff Layton commit 3e5832e923a9c3a12c76980f68853668d4675ecf Merge: 9f7fb8de5d9ba baf927a833ca2 Author: Linus Torvalds Date: Wed Feb 2 09:50:17 2022 -0800 Merge tag 'pinctrl-v5.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Pull pin control fixes from Linus Walleij: "Most interesting and urgent is the Intel stuff affecting Chromebooks and laptops. - Fix up group name building on the Intel Thunderbay - Fix interrupt problems on the Intel Cherryview - Fix some pin data on the Sunxi H616 - Fix up the CONFIG_PINCTRL_ST Kconfig sort order as noted during the merge window - Fix an unexpected interrupt problem on the Intel Sunrisepoint - Fix a glitch when updating IRQ flags on all Intel pin controllers - Revert a Zynqmp patch to unify the pin naming, let's find some better solution - Fix some error paths in the Broadcom BCM2835 driver - Fix a Kconfig problem pertaining to the BCM63XX drivers - Fix the regmap support in the Microchip SGPIO driver" * tag 'pinctrl-v5.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: pinctrl: microchip-sgpio: Fix support for regmap pinctrl: bcm63xx: fix unmet dependency on REGMAP for GPIO_REGMAP pinctrl: bcm2835: Fix a few error paths pinctrl: zynqmp: Revert "Unify pin naming" pinctrl: intel: Fix a glitch when updating IRQ flags on a preconfigured line pinctrl: intel: fix unexpected interrupt pinctrl: Place correctly CONFIG_PINCTRL_ST in the Makefile pinctrl: sunxi: Fix H616 I2S3 pin data pinctrl: cherryview: Trigger hwirq0 for interrupt-lines without a mapping pinctrl: thunderbay: rework loops looking for groups names pinctrl: thunderbay: comment process of building functions a bit commit 81eb8b0b18789e647e65579303529fd52d861cc2 Author: Steen Hegelund Date: Wed Feb 2 09:30:39 2022 +0100 net: sparx5: do not refer to skb after passing it on Do not try to use any SKB fields after the packet has been passed up in the receive stack. Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Steen Hegelund Link: https://lore.kernel.org/r/20220202083039.3774851-1-steen.hegelund@microchip.com Signed-off-by: Jakub Kicinski commit bdc120a2bcd834e571ce4115aaddf71ab34495de Author: Miquel Raynal Date: Tue Feb 1 19:06:26 2022 +0100 net: ieee802154: ca8210: Fix lifs/sifs periods These periods are expressed in time units (microseconds) while 40 and 12 are the number of symbol durations these periods will last. We need to multiply them both with the symbol_duration in order to get these values in microseconds. Fixes: ded845a781a5 ("ieee802154: Add CA8210 IEEE 802.15.4 device driver") Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/r/20220201180629.93410-2-miquel.raynal@bootlin.com Signed-off-by: Stefan Schmidt commit 89677197ae709eb1ab3646952c44f6a171c9e74c Author: Stefan Berger Date: Tue Feb 1 15:37:10 2022 -0500 ima: Do not print policy rule with inactive LSM labels Before printing a policy rule scan for inactive LSM labels in the policy rule. Inactive LSM labels are identified by args_p != NULL and rule == NULL. Fixes: 483ec26eed42 ("ima: ima/lsm policy rule loading logic bug fixes") Signed-off-by: Stefan Berger Cc: # v5.6+ Acked-by: Christian Brauner [zohar@linux.ibm.com: Updated "Fixes" tag] Signed-off-by: Mimi Zohar commit bb8e52e4906f148c2faf6656b5106cf7233e9301 Author: Roberto Sassu Date: Mon Jan 31 18:11:39 2022 +0100 ima: Allow template selection with ima_template[_fmt]= after ima_hash= Commit c2426d2ad5027 ("ima: added support for new kernel cmdline parameter ima_template_fmt") introduced an additional check on the ima_template variable to avoid multiple template selection. Unfortunately, ima_template could be also set by the setup function of the ima_hash= parameter, when it calls ima_template_desc_current(). This causes attempts to choose a new template with ima_template= or with ima_template_fmt=, after ima_hash=, to be ignored. Achieve the goal of the commit mentioned with the new static variable template_setup_done, so that template selection requests after ima_hash= are not ignored. Finally, call ima_init_template_list(), if not already done, to initialize the list of templates before lookup_template_desc() is called. Reported-by: Guo Zihua Signed-off-by: Roberto Sassu Cc: stable@vger.kernel.org Fixes: c2426d2ad5027 ("ima: added support for new kernel cmdline parameter ima_template_fmt") Signed-off-by: Mimi Zohar commit f7333b9572d0559e00352a926c92f29f061b4569 Author: Stefan Berger Date: Tue Jan 25 17:46:23 2022 -0500 ima: Remove ima_policy file before directory The removal of ima_dir currently fails since ima_policy still exists, so remove the ima_policy file before removing the directory. Fixes: 4af4662fa4a9 ("integrity: IMA policy") Signed-off-by: Stefan Berger Cc: Acked-by: Christian Brauner Signed-off-by: Mimi Zohar commit 83230351c523b04ff8a029a4bdf97d881ecb96fc Author: Xiaoke Wang Date: Sat Jan 15 09:11:11 2022 +0800 integrity: check the return value of audit_log_start() audit_log_start() returns audit_buffer pointer on success or NULL on error, so it is better to check the return value of it. Fixes: 3323eec921ef ("integrity: IMA as an integrity service provider") Signed-off-by: Xiaoke Wang Cc: Reviewed-by: Paul Moore Signed-off-by: Mimi Zohar commit 7fa5c33d043160eba3be9fb8e21588dff2a467c7 Author: V sujith kumar Reddy Date: Tue Feb 1 02:02:15 2022 +0530 ASoC: amd: acp: Set gpio_spkr_en to None for max speaker amplifer in machine driver Maxim codec driver already enabling/disabling spk_en_gpio in form of sd_mode gpio hence remove such gpio access control from machine driver to avoid conflict Signed-off-by: V sujith kumar Reddy Link: https://lore.kernel.org/r/20220131203225.1418648-1-vsujithkumar.reddy@amd.com Signed-off-by: Mark Brown commit 2b7c46369f09c358164d31d17e5695185403185e Author: Mark Brown Date: Tue Feb 1 15:56:29 2022 +0000 ASoC: ops: Fix stereo change notifications in snd_soc_put_xr_sx() When writing out a stereo control we discard the change notification from the first channel, meaning that events are only generated based on changes to the second channel. Ensure that we report a change if either channel has changed. Signed-off-by: Mark Brown Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220201155629.120510-5-broonie@kernel.org Signed-off-by: Mark Brown commit 650204ded3703b5817bd4b6a77fa47d333c4f902 Author: Mark Brown Date: Tue Feb 1 15:56:28 2022 +0000 ASoC: ops: Fix stereo change notifications in snd_soc_put_volsw_range() When writing out a stereo control we discard the change notification from the first channel, meaning that events are only generated based on changes to the second channel. Ensure that we report a change if either channel has changed. Signed-off-by: Mark Brown Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220201155629.120510-4-broonie@kernel.org Signed-off-by: Mark Brown commit 7f3d90a3519680dfa23e750f80bfdefc0f5eda4a Author: Mark Brown Date: Tue Feb 1 15:56:27 2022 +0000 ASoC: ops: Fix stereo change notifications in snd_soc_put_volsw_sx() When writing out a stereo control we discard the change notification from the first channel, meaning that events are only generated based on changes to the second channel. Ensure that we report a change if either channel has changed. Signed-off-by: Mark Brown Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220201155629.120510-3-broonie@kernel.org Signed-off-by: Mark Brown commit 564778d7b1ea465f9487eedeece7527a033549c5 Author: Mark Brown Date: Tue Feb 1 15:56:26 2022 +0000 ASoC: ops: Fix stereo change notifications in snd_soc_put_volsw() When writing out a stereo control we discard the change notification from the first channel, meaning that events are only generated based on changes to the second channel. Ensure that we report a change if either channel has changed. Signed-off-by: Mark Brown Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220201155629.120510-2-broonie@kernel.org Signed-off-by: Mark Brown commit 186edf7e368c40d06cf727a1ad14698ea67b74ad Author: Vratislav Bendel Date: Wed Feb 2 12:25:11 2022 +0100 selinux: fix double free of cond_list on error paths On error path from cond_read_list() and duplicate_policydb_cond_list() the cond_list_destroy() gets called a second time in caller functions, resulting in NULL pointer deref. Fix this by resetting the cond_list_len to 0 in cond_list_destroy(), making subsequent calls a noop. Also consistently reset the cond_list pointer to NULL after freeing. Cc: stable@vger.kernel.org Signed-off-by: Vratislav Bendel [PM: fix line lengths in the description] Signed-off-by: Paul Moore commit e1d2699b96793d19388e302fa095e0da2c145701 Author: Trond Myklebust Date: Tue Jan 18 22:10:52 2022 -0500 NFS: Avoid duplicate uncached readdir calls on eof If we've reached the end of the directory, then cache that information in the context so that we don't need to do an uncached readdir in order to rediscover that fact. Fixes: 794092c57f89 ("NFS: Do uncached readdir when we're seeking a cookie in an empty page cache") Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit ce292d8faf41f62e0fb0c78476c6fce5d629235a Author: trondmy@kernel.org Date: Tue Jan 18 19:52:16 2022 -0500 NFS: Don't skip directory entries when doing uncached readdir Ensure that we initialise desc->cache_entry_index correctly in uncached_readdir(). Fixes: d1bacf9eb2fd ("NFS: add readdir cache array") Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit d9c4e39c1f8f8a8ebaccf00b8f22c14364b2d27e Author: trondmy@kernel.org Date: Tue Jan 18 19:25:42 2022 -0500 NFS: Don't overfill uncached readdir pages If we're doing an uncached read of the directory, then we ideally want to read only the exact set of entries that will fit in the buffer supplied by the getdents() system call. So unlike the case where we're reading into the page cache, let's send only one READDIR call, before trying to fill up the buffer. Fixes: 35df59d3ef69 ("NFS: Reduce number of RPC calls when doing uncached readdir") Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit c86d86131ab75696fc52d98571148842e067d620 Author: Dmitry V. Levin Date: Wed Feb 2 06:09:04 2022 +0300 Partially revert "net/smc: Add netlink net namespace support" The change of sizeof(struct smc_diag_linkinfo) by commit 79d39fc503b4 ("net/smc: Add netlink net namespace support") introduced an ABI regression: since struct smc_diag_lgrinfo contains an object of type "struct smc_diag_linkinfo", offset of all subsequent members of struct smc_diag_lgrinfo was changed by that change. As result, applications compiled with the old version of struct smc_diag_linkinfo will receive garbage in struct smc_diag_lgrinfo.role if the kernel implements this new version of struct smc_diag_linkinfo. Fix this regression by reverting the part of commit 79d39fc503b4 that changes struct smc_diag_linkinfo. After all, there is SMC_GEN_NETLINK interface which is good enough, so there is probably no need to touch the smc_diag ABI in the first place. Fixes: 79d39fc503b4 ("net/smc: Add netlink net namespace support") Signed-off-by: Dmitry V. Levin Reviewed-by: Karsten Graul Link: https://lore.kernel.org/r/20220202030904.GA9742@altlinux.org Signed-off-by: Jakub Kicinski commit cb4f0843429e38431023c26ca7cdaee447953cbd Merge: 8cfe148a7136b 403271548a840 Author: Paolo Bonzini Date: Wed Feb 2 09:58:10 2022 -0500 Merge tag 'kvm-riscv-fixes-5.17-1' of https://github.com/kvm-riscv/linux into HEAD KVM/riscv fixes for 5.17, take #1 - Rework guest entry logic - Make CY, TM, and IR counters accessible in VU mode - Fix SBI implementation version commit 3e1f941dd9f33776b3df4e30f741fe445ff773f3 Author: Ilya Dryomov Date: Tue Feb 1 11:04:20 2022 +0100 block: fix DIO handling regressions in blkdev_read_iter() Commit ceaa762527f4 ("block: move direct_IO into our own read_iter handler") introduced several regressions for bdev DIO: 1. read spanning EOF always returns 0 instead of the number of bytes read. This is because "count" is assigned early and isn't updated when the iterator is truncated: $ lsblk -o name,size /dev/vdb NAME SIZE vdb 1G $ xfs_io -d -c 'pread -b 4M 1021M 4M' /dev/vdb read 0/4194304 bytes at offset 1070596096 0.000000 bytes, 0 ops; 0.0007 sec (0.000000 bytes/sec and 0.0000 ops/sec) instead of $ xfs_io -d -c 'pread -b 4M 1021M 4M' /dev/vdb read 3145728/4194304 bytes at offset 1070596096 3 MiB, 1 ops; 0.0007 sec (3.865 GiB/sec and 1319.2612 ops/sec) 2. truncated iterator isn't reexpanded 3. iterator isn't reverted on blkdev_direct_IO() error 4. zero size read no longer skips atime update Fixes: ceaa762527f4 ("block: move direct_IO into our own read_iter handler") Signed-off-by: Ilya Dryomov Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220201100420.25875-1-idryomov@gmail.com Signed-off-by: Jens Axboe commit c8ff576e4e553a059e0790afd15385f418b1a854 Merge: 3aa430d33b8dd ad5185735f7da Author: David S. Miller Date: Wed Feb 2 14:19:38 2022 +0000 Merge tag 'mlx5-fixes-2022-02-01' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5 fixes 2022-02-01 This series provides bug fixes to mlx5 driver. Please pull and let me know if there is any problem. Sorry about the long series, but I had to move the top two patches from net-next to net to help avoiding a build break when kspp branch is merged into linus-next on next merge window. ==================== Signed-off-by: David S. Miller commit a3f781a9d6114c1d1e01defb7aa234dec45d2a5f Author: Helge Deller Date: Wed Feb 2 14:55:31 2022 +0100 fbcon: Add option to enable legacy hardware acceleration Add a config option CONFIG_FRAMEBUFFER_CONSOLE_LEGACY_ACCELERATION to enable bitblt and fillrect hardware acceleration in the framebuffer console. If disabled, such acceleration will not be used, even if it is supported by the graphics hardware driver. If you plan to use DRM as your main graphics output system, you should disable this option since it will prevent compiling in code which isn't used later on when DRM takes over. For all other configurations, e.g. if none of your graphic cards support DRM (yet), DRM isn't available for your architecture, or you can't be sure that the graphic card in the target system will support DRM, you most likely want to enable this option. In the non-accelerated case (e.g. when DRM is used), the inlined fb_scrollmode() function is hardcoded to return SCROLL_REDRAW and as such the compiler is able to optimize much unneccesary code away. In this v3 patch version I additionally changed the GETVYRES() and GETVXRES() macros to take a pointer to the fbcon_display struct. This fixes the build when console rotation is enabled and helps the compiler again to optimize out code. Signed-off-by: Helge Deller Cc: stable@vger.kernel.org # v5.10+ Signed-off-by: Helge Deller Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220202135531.92183-4-deller@gmx.de commit 87ab9f6b7417349aa197a6c7098d4fdd4beebb74 Author: Helge Deller Date: Wed Feb 2 14:55:30 2022 +0100 Revert "fbcon: Disable accelerated scrolling" This reverts commit 39aead8373b3c20bb5965c024dfb51a94e526151. Revert the first (of 2) commits which disabled scrolling acceleration in fbcon/fbdev. It introduced a regression for fbdev-supported graphic cards because of the performance penalty by doing screen scrolling by software instead of using the existing graphic card 2D hardware acceleration. Console scrolling acceleration was disabled by dropping code which checked at runtime the driver hardware capabilities for the BINFO_HWACCEL_COPYAREA or FBINFO_HWACCEL_FILLRECT flags and if set, it enabled scrollmode SCROLL_MOVE which uses hardware acceleration to move screen contents. After dropping those checks scrollmode was hard-wired to SCROLL_REDRAW instead, which forces all graphic cards to redraw every character at the new screen position when scrolling. This change effectively disabled all hardware-based scrolling acceleration for ALL drivers, because now all kind of 2D hardware acceleration (bitblt, fillrect) in the drivers isn't used any longer. The original commit message mentions that only 3 DRM drivers (nouveau, omapdrm and gma500) used hardware acceleration in the past and thus code for checking and using scrolling acceleration is obsolete. This statement is NOT TRUE, because beside the DRM drivers there are around 35 other fbdev drivers which depend on fbdev/fbcon and still provide hardware acceleration for fbdev/fbcon. The original commit message also states that syzbot found lots of bugs in fbcon and thus it's "often the solution to just delete code and remove features". This is true, and the bugs - which actually affected all users of fbcon, including DRM - were fixed, or code was dropped like e.g. the support for software scrollback in vgacon (commit 973c096f6a85). So to further analyze which bugs were found by syzbot, I've looked through all patches in drivers/video which were tagged with syzbot or syzkaller back to year 2005. The vast majority fixed the reported issues on a higher level, e.g. when screen is to be resized, or when font size is to be changed. The few ones which touched driver code fixed a real driver bug, e.g. by adding a check. But NONE of those patches touched code of either the SCROLL_MOVE or the SCROLL_REDRAW case. That means, there was no real reason why SCROLL_MOVE had to be ripped-out and just SCROLL_REDRAW had to be used instead. The only reason I can imagine so far was that SCROLL_MOVE wasn't used by DRM and as such it was assumed that it could go away. That argument completely missed the fact that SCROLL_MOVE is still heavily used by fbdev (non-DRM) drivers. Some people mention that using memcpy() instead of the hardware acceleration is pretty much the same speed. But that's not true, at least not for older graphic cards and machines where we see speed decreases by factor 10 and more and thus this change leads to console responsiveness way worse than before. That's why the original commit is to be reverted. By reverting we reintroduce hardware-based scrolling acceleration and fix the performance regression for fbdev drivers. There isn't any impact on DRM when reverting those patches. Signed-off-by: Helge Deller Acked-by: Geert Uytterhoeven Acked-by: Sven Schnelle Cc: stable@vger.kernel.org # v5.10+ Signed-off-by: Helge Deller Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220202135531.92183-3-deller@gmx.de commit 1148836fd3226c20de841084aba24184d4fbbe77 Author: Helge Deller Date: Wed Feb 2 14:55:29 2022 +0100 Revert "fbdev: Garbage collect fbdev scrolling acceleration, part 1 (from TODO list)" This reverts commit b3ec8cdf457e5e63d396fe1346cc788cf7c1b578. Revert the second (of 2) commits which disabled scrolling acceleration in fbcon/fbdev. It introduced a regression for fbdev-supported graphic cards because of the performance penalty by doing screen scrolling by software instead of using the existing graphic card 2D hardware acceleration. Console scrolling acceleration was disabled by dropping code which checked at runtime the driver hardware capabilities for the BINFO_HWACCEL_COPYAREA or FBINFO_HWACCEL_FILLRECT flags and if set, it enabled scrollmode SCROLL_MOVE which uses hardware acceleration to move screen contents. After dropping those checks scrollmode was hard-wired to SCROLL_REDRAW instead, which forces all graphic cards to redraw every character at the new screen position when scrolling. This change effectively disabled all hardware-based scrolling acceleration for ALL drivers, because now all kind of 2D hardware acceleration (bitblt, fillrect) in the drivers isn't used any longer. The original commit message mentions that only 3 DRM drivers (nouveau, omapdrm and gma500) used hardware acceleration in the past and thus code for checking and using scrolling acceleration is obsolete. This statement is NOT TRUE, because beside the DRM drivers there are around 35 other fbdev drivers which depend on fbdev/fbcon and still provide hardware acceleration for fbdev/fbcon. The original commit message also states that syzbot found lots of bugs in fbcon and thus it's "often the solution to just delete code and remove features". This is true, and the bugs - which actually affected all users of fbcon, including DRM - were fixed, or code was dropped like e.g. the support for software scrollback in vgacon (commit 973c096f6a85). So to further analyze which bugs were found by syzbot, I've looked through all patches in drivers/video which were tagged with syzbot or syzkaller back to year 2005. The vast majority fixed the reported issues on a higher level, e.g. when screen is to be resized, or when font size is to be changed. The few ones which touched driver code fixed a real driver bug, e.g. by adding a check. But NONE of those patches touched code of either the SCROLL_MOVE or the SCROLL_REDRAW case. That means, there was no real reason why SCROLL_MOVE had to be ripped-out and just SCROLL_REDRAW had to be used instead. The only reason I can imagine so far was that SCROLL_MOVE wasn't used by DRM and as such it was assumed that it could go away. That argument completely missed the fact that SCROLL_MOVE is still heavily used by fbdev (non-DRM) drivers. Some people mention that using memcpy() instead of the hardware acceleration is pretty much the same speed. But that's not true, at least not for older graphic cards and machines where we see speed decreases by factor 10 and more and thus this change leads to console responsiveness way worse than before. That's why the original commit is to be reverted. By reverting we reintroduce hardware-based scrolling acceleration and fix the performance regression for fbdev drivers. There isn't any impact on DRM when reverting those patches. Signed-off-by: Helge Deller Acked-by: Geert Uytterhoeven Acked-by: Sven Schnelle Cc: stable@vger.kernel.org # v5.16+ Signed-off-by: Helge Deller Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220202135531.92183-2-deller@gmx.de commit 91aaea527bc3b707c5d3208cde035421ed54f79c Author: Basavaraj Natikar Date: Mon Jan 31 22:48:33 2022 +0530 HID: amd_sfh: Add illuminance mask to limit ALS max value ALS illuminance value present only in first 15 bits from SFH firmware for V2 platforms. Hence added a mask of 15 bit to limit ALS max illuminance values to get correct illuminance value. Fixes: 0aad9c95eb9a ("HID: amd_sfh: Extend ALS support for newer AMD platform") Signed-off-by: Basavaraj Natikar Signed-off-by: Jiri Kosina commit a7072c01c3ac3ae6ecd08fa7b43431cfc8ed331f Author: Basavaraj Natikar Date: Mon Jan 31 22:48:32 2022 +0530 HID: amd_sfh: Increase sensor command timeout HPD sensors take more time to initialize. Hence increasing sensor command timeout to get response with status within a max timeout. Fixes: 173709f50e98 ("HID: amd_sfh: Add command response to check command status") Signed-off-by: Basavaraj Natikar Signed-off-by: Jiri Kosina commit 2787710f73fcce4a9bdab540aaf1aef778a27462 Author: Daniel Thompson Date: Fri Jan 28 17:46:25 2022 +0000 HID: i2c-hid: goodix: Fix a lockdep splat I'm was on the receiving end of a lockdep splat from this driver and after scratching my head I couldn't be entirely sure it was a false positive given we would also have to think about whether the regulator locking is safe (since the notifier is called whilst holding regulator locks which are also needed for regulator_is_enabled() ). Regardless of whether it is a real bug or not, the mutex isn't needed. We can use reference counting tricks instead to avoid races with the notifier calls. The observed splat follows: ------------------------------------------------------ kworker/u16:3/127 is trying to acquire lock: ffff00008021fb20 (&ihid_goodix->regulator_mutex){+.+.}-{4:4}, at: ihid_goodix_vdd_notify+0x30/0x94 but task is already holding lock: ffff0000835c60c0 (&(&rdev->notifier)->rwsem){++++}-{4:4}, at: blocking_notifier_call_chain+0x30/0x70 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&(&rdev->notifier)->rwsem){++++}-{4:4}: down_write+0x68/0x8c blocking_notifier_chain_register+0x54/0x70 regulator_register_notifier+0x1c/0x24 devm_regulator_register_notifier+0x58/0x98 i2c_hid_of_goodix_probe+0xdc/0x158 i2c_device_probe+0x25d/0x270 really_probe+0x174/0x2cc __driver_probe_device+0xc0/0xd8 driver_probe_device+0x50/0xe4 __device_attach_driver+0xa8/0xc0 bus_for_each_drv+0x9c/0xc0 __device_attach_async_helper+0x6c/0xbc async_run_entry_fn+0x38/0x100 process_one_work+0x294/0x438 worker_thread+0x180/0x258 kthread+0x120/0x130 ret_from_fork+0x10/0x20 -> #0 (&ihid_goodix->regulator_mutex){+.+.}-{4:4}: __lock_acquire+0xd24/0xfe8 lock_acquire+0x288/0x2f4 __mutex_lock+0xa0/0x338 mutex_lock_nested+0x3c/0x5c ihid_goodix_vdd_notify+0x30/0x94 notifier_call_chain+0x6c/0x8c blocking_notifier_call_chain+0x48/0x70 _notifier_call_chain.isra.0+0x18/0x20 _regulator_enable+0xc0/0x178 regulator_enable+0x40/0x7c goodix_i2c_hid_power_up+0x18/0x20 i2c_hid_core_power_up.isra.0+0x1c/0x2c i2c_hid_core_probe+0xd8/0x3d4 i2c_hid_of_goodix_probe+0x14c/0x158 i2c_device_probe+0x25c/0x270 really_probe+0x174/0x2cc __driver_probe_device+0xc0/0xd8 driver_probe_device+0x50/0xe4 __device_attach_driver+0xa8/0xc0 bus_for_each_drv+0x9c/0xc0 __device_attach_async_helper+0x6c/0xbc async_run_entry_fn+0x38/0x100 process_one_work+0x294/0x438 worker_thread+0x180/0x258 kthread+0x120/0x130 ret_from_fork+0x10/0x20 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&(&rdev->notifier)->rwsem); lock(&ihid_goodix->regulator_mutex); lock(&(&rdev->notifier)->rwsem); lock(&ihid_goodix->regulator_mutex); *** DEADLOCK *** Signed-off-by: Daniel Thompson Fixes: 18eeef46d359 ("HID: i2c-hid: goodix: Tie the reset line to true state of the regulator") Reviewed-by: Douglas Anderson Signed-off-by: Jiri Kosina commit 403271548a840dd4f884088d6333e09f899be5ff Author: Anup Patel Date: Mon Jan 31 22:12:32 2022 +0530 RISC-V: KVM: Fix SBI implementation version The SBI implementation version returned by KVM RISC-V should be the Host Linux version code. Fixes: c62a76859723 ("RISC-V: KVM: Add SBI v0.2 base extension") Signed-off-by: Anup Patel Reviewed-by: Atish Patra Signed-off-by: Anup Patel commit de1d7b6a51dab546160d252e47baa54adf104d4a Author: Mayuresh Chitale Date: Mon Jan 31 16:33:07 2022 +0530 RISC-V: KVM: make CY, TM, and IR counters accessible in VU mode Those applications that run in VU mode and access the time CSR cause a virtual instruction trap as Guest kernel currently does not initialize the scounteren CSR. To fix this, we should make CY, TM, and IR counters accessibile by default in VU mode (similar to OpenSBI). Fixes: a33c72faf2d73 ("RISC-V: KVM: Implement VCPU create, init and destroy functions") Cc: stable@vger.kernel.org Signed-off-by: Mayuresh Chitale Signed-off-by: Anup Patel commit 6455317e4d0d8395e8e4a2fd1ec8d6502267dd02 Author: Mark Rutland Date: Tue Feb 1 13:29:25 2022 +0000 kvm/riscv: rework guest entry logic In kvm_arch_vcpu_ioctl_run() we enter an RCU extended quiescent state (EQS) by calling guest_enter_irqoff(), and unmask IRQs prior to exiting the EQS by calling guest_exit(). As the IRQ entry code will not wake RCU in this case, we may run the core IRQ code and IRQ handler without RCU watching, leading to various potential problems. Additionally, we do not inform lockdep or tracing that interrupts will be enabled during guest execution, which caan lead to misleading traces and warnings that interrupts have been enabled for overly-long periods. This patch fixes these issues by using the new timing and context entry/exit helpers to ensure that interrupts are handled during guest vtime but with RCU watching, with a sequence: guest_timing_enter_irqoff(); guest_state_enter_irqoff(); < run the vcpu > guest_state_exit_irqoff(); < take any pending IRQs > guest_timing_exit_irqoff(); Since instrumentation may make use of RCU, we must also ensure that no instrumented code is run during the EQS. I've split out the critical section into a new kvm_riscv_enter_exit_vcpu() helper which is marked noinstr. Fixes: 99cdc6c18c2d815e ("RISC-V: Add initial skeletal KVM support") Signed-off-by: Mark Rutland Cc: Albert Ou Cc: Anup Patel Cc: Atish Patra Cc: Frederic Weisbecker Cc: Palmer Dabbelt Cc: Paolo Bonzini Cc: Paul E. McKenney Cc: Paul Walmsley Tested-by: Anup Patel Signed-off-by: Anup Patel commit 1d9093457b243061a9bba23543c38726e864a643 Author: Tristan Hume Date: Thu Jan 27 17:08:06 2022 -0500 perf/x86/intel/pt: Fix crash with stop filters in single-range mode Add a check for !buf->single before calling pt_buffer_region_size in a place where a missing check can cause a kernel crash. Fixes a bug introduced by commit 670638477aed ("perf/x86/intel/pt: Opportunistically use single range output mode"), which added a support for PT single-range output mode. Since that commit if a PT stop filter range is hit while tracing, the kernel will crash because of a null pointer dereference in pt_handle_status due to calling pt_buffer_region_size without a ToPA configured. The commit which introduced single-range mode guarded almost all uses of the ToPA buffer variables with checks of the buf->single variable, but missed the case where tracing was stopped by the PT hardware, which happens when execution hits a configured stop filter. Tested that hitting a stop filter while PT recording successfully records a trace with this patch but crashes without this patch. Fixes: 670638477aed ("perf/x86/intel/pt: Opportunistically use single range output mode") Signed-off-by: Tristan Hume Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Adrian Hunter Cc: stable@kernel.org Link: https://lkml.kernel.org/r/20220127220806.73664-1-tristan@thume.ca commit ddecd22878601a606d160680fa85802b75d92eb6 Author: Marco Elver Date: Mon Jan 31 11:34:07 2022 +0100 perf: uapi: Document perf_event_attr::sig_data truncation on 32 bit architectures Due to the alignment requirements of siginfo_t, as described in 3ddb3fd8cdb0 ("signal, perf: Fix siginfo_t by avoiding u64 on 32-bit architectures"), siginfo_t::si_perf_data is limited to an unsigned long. However, perf_event_attr::sig_data is an u64, to avoid having to deal with compat conversions. Due to being an u64, it may not immediately be clear to users that sig_data is truncated on 32 bit architectures. Add a comment to explicitly point this out, and hopefully help some users save time by not having to deduce themselves what's happening. Reported-by: Dmitry Vyukov Signed-off-by: Marco Elver Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Dmitry Vyukov Link: https://lore.kernel.org/r/20220131103407.1971678-3-elver@google.com commit 95d29fa104523b1756323f7003294b1711c27808 Author: Marco Elver Date: Mon Jan 31 11:34:06 2022 +0100 selftests/perf_events: Test modification of perf_event_attr::sig_data Test that PERF_EVENT_IOC_MODIFY_ATTRIBUTES correctly modifies perf_event_attr::sig_data as well. Signed-off-by: Marco Elver Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Dmitry Vyukov Link: https://lore.kernel.org/r/20220131103407.1971678-2-elver@google.com commit 3c25fc97f5590060464cabfa25710970ecddbc96 Author: Marco Elver Date: Mon Jan 31 11:34:05 2022 +0100 perf: Copy perf_event_attr::sig_data on modification The intent has always been that perf_event_attr::sig_data should also be modifiable along with PERF_EVENT_IOC_MODIFY_ATTRIBUTES, because it is observable by user space if SIGTRAP on events is requested. Currently only PERF_TYPE_BREAKPOINT is modifiable, and explicitly copies relevant breakpoint-related attributes in hw_breakpoint_copy_attr(). This misses copying perf_event_attr::sig_data. Since sig_data is not specific to PERF_TYPE_BREAKPOINT, introduce a helper to copy generic event-type-independent attributes on modification. Fixes: 97ba62b27867 ("perf: Add support for SIGTRAP on perf events") Reported-by: Dmitry Vyukov Signed-off-by: Marco Elver Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Dmitry Vyukov Link: https://lore.kernel.org/r/20220131103407.1971678-1-elver@google.com commit a01994f5e5c79d3a35e5e8cf4252c7f2147323c3 Author: Peter Zijlstra Date: Thu Jan 27 12:32:51 2022 +0100 x86/perf: Default set FREEZE_ON_SMI for all Kyle reported that rr[0] has started to malfunction on Comet Lake and later CPUs due to EFI starting to make use of CPL3 [1] and the PMU event filtering not distinguishing between regular CPL3 and SMM CPL3. Since this is a privilege violation, default disable SMM visibility where possible. Administrators wanting to observe SMM cycles can easily change this using the sysfs attribute while regular users don't have access to this file. [0] https://rr-project.org/ [1] See the Intel white paper "Trustworthy SMM on the Intel vPro Platform" at https://bugzilla.kernel.org/attachment.cgi?id=300300, particularly the end of page 5. Reported-by: Kyle Huey Suggested-by: Andrew Cooper Signed-off-by: Peter Zijlstra (Intel) Cc: stable@kernel.org Link: https://lkml.kernel.org/r/YfKChjX61OW4CkYm@hirez.programming.kicks-ass.net commit 2cba05451a6d0c703bb74f1a250691404f27c4f1 Author: Geert Uytterhoeven Date: Mon Jan 31 11:35:53 2022 +0100 gpio: aggregator: Fix calling into sleeping GPIO controllers If the parent GPIO controller is a sleeping controller (e.g. a GPIO controller connected to I2C), getting or setting a GPIO triggers a might_sleep() warning. This happens because the GPIO Aggregator takes the can_sleep flag into account only for its internal locking, not for calling into the parent GPIO controller. Fix this by using the gpiod_[gs]et*_cansleep() APIs when calling into a sleeping GPIO controller. Reported-by: Mikko Salomäki Fixes: 828546e24280f721 ("gpio: Add GPIO Aggregator") Signed-off-by: Geert Uytterhoeven Reviewed-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit 1d4df649cbb4b26d19bea38ecff4b65b10a1bbca Author: Guo Ren Date: Sun Jan 30 21:56:34 2022 +0800 irqchip/sifive-plic: Add missing thead,c900-plic match string The thead,c900-plic has been used in opensbi to distinguish PLIC [1]. Although PLICs have the same behaviors in Linux, they are different hardware with some custom initializing in firmware(opensbi). Qute opensbi patch commit-msg by Samuel: The T-HEAD PLIC implementation requires setting a delegation bit to allow access from S-mode. Now that the T-HEAD PLIC has its own compatible string, set this bit automatically from the PLIC driver, instead of reaching into the PLIC's MMIO space from another driver. [1]: https://github.com/riscv-software-src/opensbi/commit/78c2b19218bd62653b9fb31623a42ced45f38ea6 Signed-off-by: Guo Ren Cc: Anup Patel Cc: Marc Zyngier Cc: Palmer Dabbelt Cc: Samuel Holland Cc: Thomas Gleixner Tested-by: Samuel Holland Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220130135634.1213301-3-guoren@kernel.org commit 321a8be37e1a93cefeae990107533142c8515933 Author: Guo Ren Date: Sun Jan 30 21:56:33 2022 +0800 dt-bindings: update riscv plic compatible string Add the compatible string "thead,c900-plic" to the riscv plic bindings to support allwinner d1 SOC which contains c906 core. Signed-off-by: Guo Ren Cc: Anup Patel Cc: Heiko Stuebner Cc: Rob Herring Cc: Rob Herring Cc: Palmer Dabbelt Cc: Samuel Holland Reviewed-by: Rob Herring Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220130135634.1213301-2-guoren@kernel.org commit eba1e44beef88aa722f07755f79f604cd5d92290 Author: Marc Zyngier Date: Wed Feb 2 10:34:54 2022 +0000 irqchip/gic-v3-its: Skip HP notifier when no ITS is registered We have some systems out there that have both LPI support and an ITS, but that don't expose the ITS in their firmware tables (either because it is broken or because they run under a hypervisor that hides it...). Is such a configuration, we still register the HP notifier to free the allocated tables if needed, resulting in a warning as there is no memory to free (nothing was allocated the first place). Fix it by keying the HP notifier on the presence of at least one sucessfully probed ITS. Fixes: d23bc2bc1d63 ("irqchip/gic-v3-its: Postpone LPI pending table freeing and memreserve") Reported-by: Steev Klimaszewski Tested-by: Steev Klimaszewski Signed-off-by: Marc Zyngier Cc: Valentin Schneider Link: https://lore.kernel.org/r/20220202103454.2480465-1-maz@kernel.org commit 2c212e1baedcd782b2535a3f86bc491977677c0e Author: Janis Schoetterl-Glausch Date: Fri Jan 28 15:06:43 2022 +0100 KVM: s390: Return error on SIDA memop on normal guest Refuse SIDA memops on guests which are not protected. For normal guests, the secure instruction data address designation, which determines the location we access, is not under control of KVM. Fixes: 19e122776886 (KVM: S390: protvirt: Introduce instruction data area bounce buffer) Signed-off-by: Janis Schoetterl-Glausch Cc: stable@vger.kernel.org Signed-off-by: Christian Borntraeger commit b6bb1722f34bbdbabed27acdceaf585d300c5fd2 Author: Sagi Grimberg Date: Tue Feb 1 14:54:21 2022 +0200 nvme-rdma: fix possible use-after-free in transport error_recovery work While nvme_rdma_submit_async_event_work is checking the ctrl and queue state before preparing the AER command and scheduling io_work, in order to fully prevent a race where this check is not reliable the error recovery work must flush async_event_work before continuing to destroy the admin queue after setting the ctrl state to RESETTING such that there is no race .submit_async_event and the error recovery handler itself changing the ctrl state. Signed-off-by: Sagi Grimberg commit ff9fc7ebf5c06de1ef72a69f9b1ab40af8b07f9e Author: Sagi Grimberg Date: Tue Feb 1 14:54:20 2022 +0200 nvme-tcp: fix possible use-after-free in transport error_recovery work While nvme_tcp_submit_async_event_work is checking the ctrl and queue state before preparing the AER command and scheduling io_work, in order to fully prevent a race where this check is not reliable the error recovery work must flush async_event_work before continuing to destroy the admin queue after setting the ctrl state to RESETTING such that there is no race .submit_async_event and the error recovery handler itself changing the ctrl state. Tested-by: Chris Leech Signed-off-by: Sagi Grimberg commit 0fa0f99fc84e41057cbdd2efbfe91c6b2f47dd9d Author: Sagi Grimberg Date: Tue Feb 1 14:54:19 2022 +0200 nvme: fix a possible use-after-free in controller reset during load Unlike .queue_rq, in .submit_async_event drivers may not check the ctrl readiness for AER submission. This may lead to a use-after-free condition that was observed with nvme-tcp. The race condition may happen in the following scenario: 1. driver executes its reset_ctrl_work 2. -> nvme_stop_ctrl - flushes ctrl async_event_work 3. ctrl sends AEN which is received by the host, which in turn schedules AEN handling 4. teardown admin queue (which releases the queue socket) 5. AEN processed, submits another AER, calling the driver to submit 6. driver attempts to send the cmd ==> use-after-free In order to fix that, add ctrl state check to validate the ctrl is actually able to accept the AER submission. This addresses the above race in controller resets because the driver during teardown should: 1. change ctrl state to RESETTING 2. flush async_event_work (as well as other async work elements) So after 1,2, any other AER command will find the ctrl state to be RESETTING and bail out without submitting the AER. Signed-off-by: Sagi Grimberg commit 3aa430d33b8dd4d3f996af9966833c7a51834fb8 Merge: c7108979a010f cad014b7b5a68 Author: Jakub Kicinski Date: Tue Feb 1 21:03:15 2022 -0800 Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2022-02-01 This series contains updates to e1000e driver only. Sasha removes CSME handshake with TGL platform as this is not supported and is causing hardware unit hangs to be reported. * '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: e1000e: Handshake with CSME starts from ADL platforms e1000e: Separate ADP board type from TGP ==================== Link: https://lore.kernel.org/r/20220201173754.580305-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 9a8406ba1a9a2965c27e0db1d7753471d12ee9ff Author: Liu Ying Date: Mon Jan 24 10:40:07 2022 +0800 phy: dphy: Correct clk_pre parameter The D-PHY specification (v1.2) explicitly mentions that the T-CLK-PRE parameter's unit is Unit Interval(UI) and the minimum value is 8. Also, kernel doc of the 'clk_pre' member of struct phy_configure_opts_mipi_dphy mentions that it should be in UI. However, the dphy core driver wrongly sets 'clk_pre' to 8000, which seems to hint that it's in picoseconds. So, let's fix the dphy core driver to correctly reflect the T-CLK-PRE parameter's minimum value according to the D-PHY specification. I'm assuming that all impacted custom drivers shall program values in TxByteClkHS cycles into hardware for the T-CLK-PRE parameter. The D-PHY specification mentions that the frequency of TxByteClkHS is exactly 1/8 the High-Speed(HS) bit rate(each HS bit consumes one UI). So, relevant custom driver code is changed to program those values as DIV_ROUND_UP(cfg->clk_pre, BITS_PER_BYTE), then. Note that I've only tested the patch with RM67191 DSI panel on i.MX8mq EVK. Help is needed to test with other i.MX8mq, Meson and Rockchip platforms, as I don't have the hardwares. Fixes: 2ed869990e14 ("phy: Add MIPI D-PHY configuration options") Tested-by: Liu Ying # RM67191 DSI panel on i.MX8mq EVK Reviewed-by: Andrzej Hajda Reviewed-by: Neil Armstrong # for phy-meson-axg-mipi-dphy.c Tested-by: Neil Armstrong # for phy-meson-axg-mipi-dphy.c Tested-by: Guido Günther # Librem 5 (imx8mq) with it's rather picky panel Reviewed-by: Laurent Pinchart Signed-off-by: Liu Ying Link: https://lore.kernel.org/r/20220124024007.1465018-1-victor.liu@nxp.com Signed-off-by: Vinod Koul commit ad5185735f7dab342fdd0dd41044da4c9ccfef67 Author: Kees Cook Date: Mon Jan 24 09:20:28 2022 -0800 net/mlx5e: 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. Use flexible arrays instead of zero-element arrays (which look like they are always overflowing) and split the cross-field memcpy() into two halves that can be appropriately bounds-checked by the compiler. We were doing: #define ETH_HLEN 14 #define VLAN_HLEN 4 ... #define MLX5E_XDP_MIN_INLINE (ETH_HLEN + VLAN_HLEN) ... struct mlx5e_tx_wqe *wqe = mlx5_wq_cyc_get_wqe(wq, pi); ... struct mlx5_wqe_eth_seg *eseg = &wqe->eth; struct mlx5_wqe_data_seg *dseg = wqe->data; ... memcpy(eseg->inline_hdr.start, xdptxd->data, MLX5E_XDP_MIN_INLINE); target is wqe->eth.inline_hdr.start (which the compiler sees as being 2 bytes in size), but copying 18, intending to write across start (really vlan_tci, 2 bytes). The remaining 16 bytes get written into wqe->data[0], covering byte_count (4 bytes), lkey (4 bytes), and addr (8 bytes). struct mlx5e_tx_wqe { struct mlx5_wqe_ctrl_seg ctrl; /* 0 16 */ struct mlx5_wqe_eth_seg eth; /* 16 16 */ struct mlx5_wqe_data_seg data[]; /* 32 0 */ /* size: 32, cachelines: 1, members: 3 */ /* last cacheline: 32 bytes */ }; struct mlx5_wqe_eth_seg { u8 swp_outer_l4_offset; /* 0 1 */ u8 swp_outer_l3_offset; /* 1 1 */ u8 swp_inner_l4_offset; /* 2 1 */ u8 swp_inner_l3_offset; /* 3 1 */ u8 cs_flags; /* 4 1 */ u8 swp_flags; /* 5 1 */ __be16 mss; /* 6 2 */ __be32 flow_table_metadata; /* 8 4 */ union { struct { __be16 sz; /* 12 2 */ u8 start[2]; /* 14 2 */ } inline_hdr; /* 12 4 */ struct { __be16 type; /* 12 2 */ __be16 vlan_tci; /* 14 2 */ } insert; /* 12 4 */ __be32 trailer; /* 12 4 */ }; /* 12 4 */ /* size: 16, cachelines: 1, members: 9 */ /* last cacheline: 16 bytes */ }; struct mlx5_wqe_data_seg { __be32 byte_count; /* 0 4 */ __be32 lkey; /* 4 4 */ __be64 addr; /* 8 8 */ /* size: 16, cachelines: 1, members: 3 */ /* last cacheline: 16 bytes */ }; So, split the memcpy() so the compiler can reason about the buffer sizes. "pahole" shows no size nor member offset changes to struct mlx5e_tx_wqe nor struct mlx5e_umr_wqe. "objdump -d" shows no meaningful object code changes (i.e. only source line number induced differences and optimizations). Fixes: b5503b994ed5 ("net/mlx5e: XDP TX forwarding support") Signed-off-by: Kees Cook Signed-off-by: Saeed Mahameed commit 6d5c900eb64107001e91e1f46bddc254dded8a59 Author: Kees Cook Date: Mon Jan 24 09:22:41 2022 -0800 net/mlx5e: Use struct_group() for memcpy() region 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. Use struct_group() in struct vlan_ethhdr around members h_dest and h_source, so they can be referenced together. This will allow memcpy() and sizeof() to more easily reason about sizes, improve readability, and avoid future warnings about writing beyond the end of h_dest. "pahole" shows no size nor member offset changes to struct vlan_ethhdr. "objdump -d" shows no object code changes. Fixes: 34802a42b352 ("net/mlx5e: Do not modify the TX SKB") Signed-off-by: Kees Cook Signed-off-by: Saeed Mahameed commit 5b209d1a22afabfb7d644abb10510c5713a3e569 Author: Roi Dayan Date: Tue Feb 1 15:27:48 2022 +0200 net/mlx5e: Avoid implicit modify hdr for decap drop rule Currently the driver adds implicit modify hdr action for decap rules on tunnel devices if the port is an ovs port. This is also done if the action is drop and makes the modify hdr redundant and also the FW doesn't support it and will generate a syndrome. kernel: mlx5_core 0000:08:00.0: mlx5_cmd_check:777:(pid 102063): SET_FLOW_TABLE_ENTRY(0x936) op_mod(0x0) failed, status bad parameter(0x3), syndrome (0x8708c3) Fix it by adding the implicit modify hdr only for fwd actions. Fixes: b16eb3c81fe2 ("net/mlx5: Support internal port as decap route device") Fixes: 077cdda764c7 ("net/mlx5e: TC, Fix memory leak with rules with internal port") Signed-off-by: Roi Dayan Reviewed-by: Ariel Levkovich Signed-off-by: Saeed Mahameed commit de47db0cf7f4a9c555ad204e06baa70b50a70d08 Author: Raed Salem Date: Thu Dec 2 17:49:01 2021 +0200 net/mlx5e: IPsec: Fix tunnel mode crypto offload for non TCP/UDP traffic IPsec Tunnel mode crypto offload software parser (SWP) setting in data path currently always set the inner L4 offset regardless of the encapsulated L4 header type and whether it exists in the first place, this breaks non TCP/UDP traffic as such. Set the SWP inner L4 offset only when the IPsec tunnel encapsulated L4 header protocol is TCP/UDP. While at it fix inner ip protocol read for setting MLX5_ETH_WQE_SWP_INNER_L4_UDP flag to address the case where the ip header protocol is IPv6. Fixes: f1267798c980 ("net/mlx5: Fix checksum issue of VXLAN and IPsec crypto offload") Signed-off-by: Raed Salem Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed commit 5352859b3bfa0ca188b2f1d2c1436fddc781e3b6 Author: Raed Salem Date: Thu Dec 2 17:43:50 2021 +0200 net/mlx5e: IPsec: Fix crypto offload for non TCP/UDP encapsulated traffic IPsec crypto offload always set the ethernet segment checksum flags with the inner L4 header checksum flag enabled for encapsulated IPsec offloaded packet regardless of the encapsulated L4 header type, and even if it doesn't exists in the first place, this breaks non TCP/UDP traffic as such. Set the inner L4 checksum flag only when the encapsulated L4 header protocol is TCP/UDP using software parser swp_inner_l4_offset field as indication. Fixes: 5cfb540ef27b ("net/mlx5e: Set IPsec WAs only in IP's non checksum partial case.") Signed-off-by: Raed Salem Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed commit 736dfe4e68b868829a1e89dfef4a44c1580d4478 Author: Maxim Mikityanskiy Date: Tue Jan 18 13:31:54 2022 +0200 net/mlx5e: Don't treat small ceil values as unlimited in HTB offload The hardware spec defines max_average_bw == 0 as "unlimited bandwidth". max_average_bw is calculated as `ceil / BYTES_IN_MBIT`, which can become 0 when ceil is small, leading to an undesired effect of having no bandwidth limit. This commit fixes it by rounding up small values of ceil to 1 Mbit/s. Fixes: 214baf22870c ("net/mlx5e: Support HTB offload") Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit d8e5883d694bb053b19c4142a2d1f43a34f6fe2c Author: Maor Dickman Date: Sun Jan 30 16:00:41 2022 +0200 net/mlx5: E-Switch, Fix uninitialized variable modact The variable modact is not initialized before used in command modify header allocation which can cause command to fail. Fix by initializing modact with zeros. Addresses-Coverity: ("Uninitialized scalar variable") Fixes: 8f1e0b97cc70 ("net/mlx5: E-Switch, Mark miss packets with new chain id mapping") Signed-off-by: Maor Dickman Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit ec41332e02bd0acf1f24206867bb6a02f5877a62 Author: Maor Dickman Date: Thu Jan 13 15:11:42 2022 +0200 net/mlx5e: Fix handling of wrong devices during bond netevent Current implementation of bond netevent handler only check if the handled netdev is VF representor and it missing a check if the VF representor is on the same phys device of the bond handling the netevent. Fix by adding the missing check and optimizing the check if the netdev is VF representor so it will not access uninitialized private data and crashes. BUG: kernel NULL pointer dereference, address: 000000000000036c PGD 0 P4D 0 Oops: 0000 [#1] SMP NOPTI Workqueue: eth3bond0 bond_mii_monitor [bonding] RIP: 0010:mlx5e_is_uplink_rep+0xc/0x50 [mlx5_core] RSP: 0018:ffff88812d69fd60 EFLAGS: 00010282 RAX: 0000000000000000 RBX: ffff8881cf800000 RCX: 0000000000000000 RDX: ffff88812d69fe10 RSI: 000000000000001b RDI: ffff8881cf800880 RBP: ffff8881cf800000 R08: 00000445cabccf2b R09: 0000000000000008 R10: 0000000000000004 R11: 0000000000000008 R12: ffff88812d69fe10 R13: 00000000fffffffe R14: ffff88820c0f9000 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff88846fb00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000000000000036c CR3: 0000000103d80006 CR4: 0000000000370ea0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: mlx5e_eswitch_uplink_rep+0x31/0x40 [mlx5_core] mlx5e_rep_is_lag_netdev+0x94/0xc0 [mlx5_core] mlx5e_rep_esw_bond_netevent+0xeb/0x3d0 [mlx5_core] raw_notifier_call_chain+0x41/0x60 call_netdevice_notifiers_info+0x34/0x80 netdev_lower_state_changed+0x4e/0xa0 bond_mii_monitor+0x56b/0x640 [bonding] process_one_work+0x1b9/0x390 worker_thread+0x4d/0x3d0 ? rescuer_thread+0x350/0x350 kthread+0x124/0x150 ? set_kthread_struct+0x40/0x40 ret_from_fork+0x1f/0x30 Fixes: 7e51891a237f ("net/mlx5e: Use netdev events to set/del egress acl forward-to-vport rule") Signed-off-by: Maor Dickman Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 7957837b816f11eecb9146235bb0715478f4c81f Author: Khalid Manaa Date: Wed Jan 26 14:25:55 2022 +0200 net/mlx5e: Fix broken SKB allocation in HW-GRO In case the HW doesn't perform header-data split, it will write the whole packet into the data buffer in the WQ, in this case the SHAMPO CQE handler couldn't use the header entry to build the SKB, instead it should allocate a new memory to build the SKB using the function: mlx5e_skb_from_cqe_mpwrq_nonlinear. Fixes: f97d5c2a453e ("net/mlx5e: Add handle SHAMPO cqe support") Signed-off-by: Khalid Manaa Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit b8d91145ed7cfa046cc07bcfb277465b9d45da73 Author: Khalid Manaa Date: Wed Jan 26 14:14:58 2022 +0200 net/mlx5e: Fix wrong calculation of header index in HW_GRO The HW doesn't wrap the CQE.shampo.header_index field according to the headers buffer size, instead it always increases it until reaching overflow of u16 size. Thus the mlx5e_handle_rx_cqe_mpwrq_shampo handler should mask the CQE header_index field to find the actual header index in the headers buffer. Fixes: f97d5c2a453e ("net/mlx5e: Add handle SHAMPO cqe support") Signed-off-by: Khalid Manaa Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 880b517691908fb753019b9b27cd082e7617debd Author: Roi Dayan Date: Mon Jan 24 13:56:26 2022 +0200 net/mlx5: Bridge, Fix devlink deadlock on net namespace deletion When changing mode to switchdev, rep bridge init registered to netdevice notifier holds the devlink lock and then takes pernet_ops_rwsem. At that time deleting a netns holds pernet_ops_rwsem and then takes the devlink lock. Example sequence is: $ ip netns add foo $ devlink dev eswitch set pci/0000:00:08.0 mode switchdev & $ ip netns del foo deleting netns trace: [ 1185.365555] ? devlink_pernet_pre_exit+0x74/0x1c0 [ 1185.368331] ? mutex_lock_io_nested+0x13f0/0x13f0 [ 1185.370984] ? xt_find_table+0x40/0x100 [ 1185.373244] ? __mutex_lock+0x24a/0x15a0 [ 1185.375494] ? net_generic+0xa0/0x1c0 [ 1185.376844] ? wait_for_completion_io+0x280/0x280 [ 1185.377767] ? devlink_pernet_pre_exit+0x74/0x1c0 [ 1185.378686] devlink_pernet_pre_exit+0x74/0x1c0 [ 1185.379579] ? devlink_nl_cmd_get_dumpit+0x3a0/0x3a0 [ 1185.380557] ? xt_find_table+0xda/0x100 [ 1185.381367] cleanup_net+0x372/0x8e0 changing mode to switchdev trace: [ 1185.411267] down_write+0x13a/0x150 [ 1185.412029] ? down_write_killable+0x180/0x180 [ 1185.413005] register_netdevice_notifier+0x1e/0x210 [ 1185.414000] mlx5e_rep_bridge_init+0x181/0x360 [mlx5_core] [ 1185.415243] mlx5e_uplink_rep_enable+0x269/0x480 [mlx5_core] [ 1185.416464] ? mlx5e_uplink_rep_disable+0x210/0x210 [mlx5_core] [ 1185.417749] mlx5e_attach_netdev+0x232/0x400 [mlx5_core] [ 1185.418906] mlx5e_netdev_attach_profile+0x15b/0x1e0 [mlx5_core] [ 1185.420172] mlx5e_netdev_change_profile+0x15a/0x1d0 [mlx5_core] [ 1185.421459] mlx5e_vport_rep_load+0x557/0x780 [mlx5_core] [ 1185.422624] ? mlx5e_stats_grp_vport_rep_num_stats+0x10/0x10 [mlx5_core] [ 1185.424006] mlx5_esw_offloads_rep_load+0xdb/0x190 [mlx5_core] [ 1185.425277] esw_offloads_enable+0xd74/0x14a0 [mlx5_core] Fix this by registering rep bridges for per net netdev notifier instead of global one, which operats on the net namespace without holding the pernet_ops_rwsem. Fixes: 19e9bfa044f3 ("net/mlx5: Bridge, add offload infrastructure") Signed-off-by: Roi Dayan Reviewed-by: Vlad Buslov Signed-off-by: Saeed Mahameed commit 55b2ca702cfa744a9eb108915996a2294da47e71 Author: Dima Chumak Date: Mon Jan 17 15:32:16 2022 +0200 net/mlx5: Fix offloading with ESWITCH_IPV4_TTL_MODIFY_ENABLE Only prio 1 is supported for nic mode when there is no ignore flow level support in firmware. But for switchdev mode, which supports fixed number of statically pre-allocated prios, this restriction is not relevant so it can be relaxed. Fixes: d671e109bd85 ("net/mlx5: Fix tc max supported prio for nic mode") Signed-off-by: Dima Chumak Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 5623ef8a118838aae65363750dfafcba734dc8cb Author: Roi Dayan Date: Mon Jan 17 15:00:30 2022 +0200 net/mlx5e: TC, Reject rules with forward and drop actions Such rules are redundant but allowed and passed to the driver. The driver does not support offloading such rules so return an error. Fixes: 03a9d11e6eeb ("net/mlx5e: Add TC drop and mirred/redirect action parsing for SRIOV offloads") Signed-off-by: Roi Dayan Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed commit 3c5193a87b0fea090aa3f769d020337662d87b5e Author: Maher Sanalla Date: Thu Jan 13 15:48:48 2022 +0200 net/mlx5: Use del_timer_sync in fw reset flow of halting poll Substitute del_timer() with del_timer_sync() in fw reset polling deactivation flow, in order to prevent a race condition which occurs when del_timer() is called and timer is deactivated while another process is handling the timer interrupt. A situation that led to the following call trace: RIP: 0010:run_timer_softirq+0x137/0x420 recalibrate_cpu_khz+0x10/0x10 ktime_get+0x3e/0xa0 ? sched_clock_cpu+0xb/0xc0 __do_softirq+0xf5/0x2ea irq_exit_rcu+0xc1/0xf0 sysvec_apic_timer_interrupt+0x9e/0xc0 asm_sysvec_apic_timer_interrupt+0x12/0x20 Fixes: 38b9f903f22b ("net/mlx5: Handle sync reset request event") Signed-off-by: Maher Sanalla Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed commit 4a08a131351e375a2969b98e46df260ed04dcba7 Author: Gal Pressman Date: Sun Jan 16 09:07:22 2022 +0200 net/mlx5e: Fix module EEPROM query When querying the module EEPROM, there was a misusage of the 'offset' variable vs the 'query.offset' field. Fix that by always using 'offset' and assigning its value to 'query.offset' right before the mcia register read call. While at it, the cross-pages read size adjustment was changed to be more intuitive. Fixes: e19b0a3474ab ("net/mlx5: Refactor module EEPROM query") Reported-by: Wang Yugui Signed-off-by: Gal Pressman Reviewed-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed commit a2446bc77a16cefd27de712d28af2396d6287593 Author: Roi Dayan Date: Tue Jan 4 10:38:02 2022 +0200 net/mlx5e: TC, Reject rules with drop and modify hdr action This kind of action is not supported by firmware and generates a syndrome. kernel: mlx5_core 0000:08:00.0: mlx5_cmd_check:777:(pid 102063): SET_FLOW_TABLE_ENTRY(0x936) op_mod(0x0) failed, status bad parameter(0x3), syndrome (0x8708c3) Fixes: d7e75a325cb2 ("net/mlx5e: Add offloading of E-Switch TC pedit (header re-write) actions") Signed-off-by: Roi Dayan Reviewed-by: Oz Shlomo Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed commit 350d9a823734b5a7e767cddc3bdde5f0bcbb7ff4 Author: Vlad Buslov Date: Thu Jan 6 18:45:26 2022 +0200 net/mlx5: Bridge, ensure dev_name is null-terminated Even though net_device->name is guaranteed to be null-terminated string of size<=IFNAMSIZ, the test robot complains that return value of netdev_name() can be larger: In file included from include/trace/define_trace.h:102, from drivers/net/ethernet/mellanox/mlx5/core/esw/diag/bridge_tracepoint.h:113, from drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c:12: drivers/net/ethernet/mellanox/mlx5/core/esw/diag/bridge_tracepoint.h: In function 'trace_event_raw_event_mlx5_esw_bridge_fdb_template': >> drivers/net/ethernet/mellanox/mlx5/core/esw/diag/bridge_tracepoint.h:24:29: warning: 'strncpy' output may be truncated copying 16 bytes from a string of length 20 [-Wstringop-truncation] 24 | strncpy(__entry->dev_name, | ^~~~~~~~~~~~~~~~~~~~~~~~~~ 25 | netdev_name(fdb->dev), | ~~~~~~~~~~~~~~~~~~~~~~ 26 | IFNAMSIZ); | ~~~~~~~~~ This is caused by the fact that default value of IFNAMSIZ is 16, while placeholder value that is returned by netdev_name() for unnamed net devices is larger than that. The offending code is in a tracing function that is only called for mlx5 representors, so there is no straightforward way to reproduce the issue but let's fix it for correctness sake by replacing strncpy() with strscpy() to ensure that resulting string is always null-terminated. Fixes: 9724fd5d9c2a ("net/mlx5: Bridge, add tracepoints") Reported-by: kernel test robot Signed-off-by: Vlad Buslov Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 04f8c12f031fcd0ffa0c72822eb665ceb2c872e7 Author: Vlad Buslov Date: Thu Jan 6 16:40:18 2022 +0200 net/mlx5: Bridge, take rtnl lock in init error handler The mlx5_esw_bridge_cleanup() is expected to be called with rtnl lock taken, which is true for mlx5e_rep_bridge_cleanup() function but not for error handling code in mlx5e_rep_bridge_init(). Add missing rtnl lock/unlock calls and extend both mlx5_esw_bridge_cleanup() and its dual function mlx5_esw_bridge_init() with ASSERT_RTNL() to verify the invariant from now on. Fixes: 7cd6a54a8285 ("net/mlx5: Bridge, handle FDB events") Fixes: 19e9bfa044f3 ("net/mlx5: Bridge, add offload infrastructure") Signed-off-by: Vlad Buslov Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit c7108979a010f693d9f3b0adc7aa770b33d1b77d Merge: d0cfa548dbde3 6533e558c6505 Author: Jakub Kicinski Date: Tue Feb 1 20:39:46 2022 -0800 Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2022-01-31 This series contains updates to i40e driver only. Jedrzej fixes a condition check which would cause an error when resetting bandwidth when DCB is active with one TC. Karen resolves a null pointer dereference that could occur when removing the driver while VSI rings are being disabled. * '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: i40e: Fix reset path while removing the driver i40e: Fix reset bw limit when DCB enabled with 1 TC ==================== Link: https://lore.kernel.org/r/20220201000522.505909-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit d0cfa548dbde354de986911d3913897b5448faad Author: Lior Nahmanson Date: Sun Jan 30 13:37:52 2022 +0200 net: macsec: Verify that send_sci is on when setting Tx sci explicitly When setting Tx sci explicit, the Rx side is expected to use this sci and not recalculate it from the packet.However, in case of Tx sci is explicit and send_sci is off, the receiver is wrongly recalculate the sci from the source MAC address which most likely be different than the explicit sci. Fix by preventing such configuration when macsec newlink is established and return EINVAL error code on such cases. Fixes: c09440f7dcb3 ("macsec: introduce IEEE 802.1AE driver") Signed-off-by: Lior Nahmanson Reviewed-by: Raed Salem Signed-off-by: Raed Salem Link: https://lore.kernel.org/r/1643542672-29403-1-git-send-email-raeds@nvidia.com Signed-off-by: Jakub Kicinski commit 63e4b45c82ed1bde979da7052229a4229ce9cabf Author: Georgi Valkov Date: Tue Feb 1 08:16:18 2022 +0100 ipheth: fix EOVERFLOW in ipheth_rcvbulk_callback When rx_buf is allocated we need to account for IPHETH_IP_ALIGN, which reduces the usable size by 2 bytes. Otherwise we have 1512 bytes usable instead of 1514, and if we receive more than 1512 bytes, ipheth_rcvbulk_callback is called with status -EOVERFLOW, after which the driver malfunctiones and all communication stops. Resolves ipheth 2-1:4.2: ipheth_rcvbulk_callback: urb status: -75 Fixes: f33d9e2b48a3 ("usbnet: ipheth: fix connectivity with iOS 14") Signed-off-by: Georgi Valkov Tested-by: Jan Kiszka Link: https://lore.kernel.org/all/B60B8A4B-92A0-49B3-805D-809A2433B46C@abv.bg/ Link: https://lore.kernel.org/all/24851bd2769434a5fc24730dce8e8a984c5a4505.1643699778.git.jan.kiszka@siemens.com/ Signed-off-by: Jakub Kicinski commit 479f5547239d970d3833f15f54a6481fffdb91ec Author: Eric Dumazet Date: Mon Jan 31 22:52:54 2022 -0800 tcp: fix mem under-charging with zerocopy sendmsg() We got reports of following warning in inet_sock_destruct() WARN_ON(sk_forward_alloc_get(sk)); Whenever we add a non zero-copy fragment to a pure zerocopy skb, we have to anticipate that whole skb->truesize will be uncharged when skb is finally freed. skb->data_len is the payload length. But the memory truesize estimated by __zerocopy_sg_from_iter() is page aligned. Fixes: 9b65b17db723 ("net: avoid double accounting for pure zerocopy skbs") Signed-off-by: Eric Dumazet Cc: Talal Ahmad Cc: Arjun Roy Cc: Willem de Bruijn Acked-by: Soheil Hassas Yeganeh Link: https://lore.kernel.org/r/20220201065254.680532-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit e42e70ad6ae2ae511a6143d2e8da929366e58bd9 Author: Eric Dumazet Date: Mon Jan 31 18:23:58 2022 -0800 af_packet: fix data-race in packet_setsockopt / packet_setsockopt When packet_setsockopt( PACKET_FANOUT_DATA ) reads po->fanout, no lock is held, meaning that another thread can change po->fanout. Given that po->fanout can only be set once during the socket lifetime (it is only cleared from fanout_release()), we can use READ_ONCE()/WRITE_ONCE() to document the race. BUG: KCSAN: data-race in packet_setsockopt / packet_setsockopt write to 0xffff88813ae8e300 of 8 bytes by task 14653 on cpu 0: fanout_add net/packet/af_packet.c:1791 [inline] packet_setsockopt+0x22fe/0x24a0 net/packet/af_packet.c:3931 __sys_setsockopt+0x209/0x2a0 net/socket.c:2180 __do_sys_setsockopt net/socket.c:2191 [inline] __se_sys_setsockopt net/socket.c:2188 [inline] __x64_sys_setsockopt+0x62/0x70 net/socket.c:2188 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae read to 0xffff88813ae8e300 of 8 bytes by task 14654 on cpu 1: packet_setsockopt+0x691/0x24a0 net/packet/af_packet.c:3935 __sys_setsockopt+0x209/0x2a0 net/socket.c:2180 __do_sys_setsockopt net/socket.c:2191 [inline] __se_sys_setsockopt net/socket.c:2188 [inline] __x64_sys_setsockopt+0x62/0x70 net/socket.c:2188 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae value changed: 0x0000000000000000 -> 0xffff888106f8c000 Reported by Kernel Concurrency Sanitizer on: CPU: 1 PID: 14654 Comm: syz-executor.3 Not tainted 5.16.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Fixes: 47dceb8ecdc1 ("packet: add classic BPF fanout mode") Signed-off-by: Eric Dumazet Cc: Willem de Bruijn Reported-by: syzbot Link: https://lore.kernel.org/r/20220201022358.330621-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit c6f6f2444bdbe0079e41914a35081530d0409963 Author: Eric Dumazet Date: Mon Jan 31 17:21:06 2022 -0800 rtnetlink: make sure to refresh master_dev/m_ops in __rtnl_newlink() While looking at one unrelated syzbot bug, I found the replay logic in __rtnl_newlink() to potentially trigger use-after-free. It is better to clear master_dev and m_ops inside the loop, in case we have to replay it. Fixes: ba7d49b1f0f8 ("rtnetlink: provide api for getting and setting slave info") Signed-off-by: Eric Dumazet Cc: Jiri Pirko Link: https://lore.kernel.org/r/20220201012106.216495-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit 04c2a47ffb13c29778e2a14e414ad4cb5a5db4b5 Author: Eric Dumazet Date: Mon Jan 31 09:20:18 2022 -0800 net: sched: fix use-after-free in tc_new_tfilter() Whenever tc_new_tfilter() jumps back to replay: label, we need to make sure @q and @chain local variables are cleared again, or risk use-after-free as in [1] For consistency, apply the same fix in tc_ctl_chain() BUG: KASAN: use-after-free in mini_qdisc_pair_swap+0x1b9/0x1f0 net/sched/sch_generic.c:1581 Write of size 8 at addr ffff8880985c4b08 by task syz-executor.4/1945 CPU: 0 PID: 1945 Comm: syz-executor.4 Not tainted 5.17.0-rc1-syzkaller-00495-gff58831fa02d #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_address_description.constprop.0.cold+0x8d/0x336 mm/kasan/report.c:255 __kasan_report mm/kasan/report.c:442 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:459 mini_qdisc_pair_swap+0x1b9/0x1f0 net/sched/sch_generic.c:1581 tcf_chain_head_change_item net/sched/cls_api.c:372 [inline] tcf_chain0_head_change.isra.0+0xb9/0x120 net/sched/cls_api.c:386 tcf_chain_tp_insert net/sched/cls_api.c:1657 [inline] tcf_chain_tp_insert_unique net/sched/cls_api.c:1707 [inline] tc_new_tfilter+0x1e67/0x2350 net/sched/cls_api.c:2086 rtnetlink_rcv_msg+0x80d/0xb80 net/core/rtnetlink.c:5583 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2494 netlink_unicast_kernel net/netlink/af_netlink.c:1317 [inline] netlink_unicast+0x539/0x7e0 net/netlink/af_netlink.c:1343 netlink_sendmsg+0x904/0xe00 net/netlink/af_netlink.c:1919 sock_sendmsg_nosec net/socket.c:705 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:725 ____sys_sendmsg+0x331/0x810 net/socket.c:2413 ___sys_sendmsg+0xf3/0x170 net/socket.c:2467 __sys_sendmmsg+0x195/0x470 net/socket.c:2553 __do_sys_sendmmsg net/socket.c:2582 [inline] __se_sys_sendmmsg net/socket.c:2579 [inline] __x64_sys_sendmmsg+0x99/0x100 net/socket.c:2579 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f2647172059 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f2645aa5168 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 00007f2647285100 RCX: 00007f2647172059 RDX: 040000000000009f RSI: 00000000200002c0 RDI: 0000000000000006 RBP: 00007f26471cc08d R08: 0000000000000000 R09: 0000000000000000 R10: 9e00000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fffb3f7f02f R14: 00007f2645aa5300 R15: 0000000000022000 Allocated by task 1944: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:436 [inline] ____kasan_kmalloc mm/kasan/common.c:515 [inline] ____kasan_kmalloc mm/kasan/common.c:474 [inline] __kasan_kmalloc+0xa9/0xd0 mm/kasan/common.c:524 kmalloc_node include/linux/slab.h:604 [inline] kzalloc_node include/linux/slab.h:726 [inline] qdisc_alloc+0xac/0xa10 net/sched/sch_generic.c:941 qdisc_create.constprop.0+0xce/0x10f0 net/sched/sch_api.c:1211 tc_modify_qdisc+0x4c5/0x1980 net/sched/sch_api.c:1660 rtnetlink_rcv_msg+0x413/0xb80 net/core/rtnetlink.c:5592 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2494 netlink_unicast_kernel net/netlink/af_netlink.c:1317 [inline] netlink_unicast+0x539/0x7e0 net/netlink/af_netlink.c:1343 netlink_sendmsg+0x904/0xe00 net/netlink/af_netlink.c:1919 sock_sendmsg_nosec net/socket.c:705 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:725 ____sys_sendmsg+0x331/0x810 net/socket.c:2413 ___sys_sendmsg+0xf3/0x170 net/socket.c:2467 __sys_sendmmsg+0x195/0x470 net/socket.c:2553 __do_sys_sendmmsg net/socket.c:2582 [inline] __se_sys_sendmmsg net/socket.c:2579 [inline] __x64_sys_sendmmsg+0x99/0x100 net/socket.c:2579 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 3609: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:45 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free+0x130/0x160 mm/kasan/common.c:328 kasan_slab_free include/linux/kasan.h:236 [inline] slab_free_hook mm/slub.c:1728 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1754 slab_free mm/slub.c:3509 [inline] kfree+0xcb/0x280 mm/slub.c:4562 rcu_do_batch kernel/rcu/tree.c:2527 [inline] rcu_core+0x7b8/0x1540 kernel/rcu/tree.c:2778 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558 Last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 __kasan_record_aux_stack+0xbe/0xd0 mm/kasan/generic.c:348 __call_rcu kernel/rcu/tree.c:3026 [inline] call_rcu+0xb1/0x740 kernel/rcu/tree.c:3106 qdisc_put_unlocked+0x6f/0x90 net/sched/sch_generic.c:1109 tcf_block_release+0x86/0x90 net/sched/cls_api.c:1238 tc_new_tfilter+0xc0d/0x2350 net/sched/cls_api.c:2148 rtnetlink_rcv_msg+0x80d/0xb80 net/core/rtnetlink.c:5583 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2494 netlink_unicast_kernel net/netlink/af_netlink.c:1317 [inline] netlink_unicast+0x539/0x7e0 net/netlink/af_netlink.c:1343 netlink_sendmsg+0x904/0xe00 net/netlink/af_netlink.c:1919 sock_sendmsg_nosec net/socket.c:705 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:725 ____sys_sendmsg+0x331/0x810 net/socket.c:2413 ___sys_sendmsg+0xf3/0x170 net/socket.c:2467 __sys_sendmmsg+0x195/0x470 net/socket.c:2553 __do_sys_sendmmsg net/socket.c:2582 [inline] __se_sys_sendmmsg net/socket.c:2579 [inline] __x64_sys_sendmmsg+0x99/0x100 net/socket.c:2579 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff8880985c4800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 776 bytes inside of 1024-byte region [ffff8880985c4800, ffff8880985c4c00) The buggy address belongs to the page: page:ffffea0002617000 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x985c0 head:ffffea0002617000 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 dead000000000122 ffff888010c41dc0 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 1941, ts 1038999441284, free_ts 1033444432829 prep_new_page mm/page_alloc.c:2434 [inline] get_page_from_freelist+0xa72/0x2f50 mm/page_alloc.c:4165 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5389 alloc_pages+0x1aa/0x310 mm/mempolicy.c:2271 alloc_slab_page mm/slub.c:1799 [inline] allocate_slab mm/slub.c:1944 [inline] new_slab+0x28a/0x3b0 mm/slub.c:2004 ___slab_alloc+0x87c/0xe90 mm/slub.c:3018 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3105 slab_alloc_node mm/slub.c:3196 [inline] slab_alloc mm/slub.c:3238 [inline] __kmalloc+0x2fb/0x340 mm/slub.c:4420 kmalloc include/linux/slab.h:586 [inline] kzalloc include/linux/slab.h:715 [inline] __register_sysctl_table+0x112/0x1090 fs/proc/proc_sysctl.c:1335 neigh_sysctl_register+0x2c8/0x5e0 net/core/neighbour.c:3787 devinet_sysctl_register+0xb1/0x230 net/ipv4/devinet.c:2618 inetdev_init+0x286/0x580 net/ipv4/devinet.c:278 inetdev_event+0xa8a/0x15d0 net/ipv4/devinet.c:1532 notifier_call_chain+0xb5/0x200 kernel/notifier.c:84 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:1919 call_netdevice_notifiers_extack net/core/dev.c:1931 [inline] call_netdevice_notifiers net/core/dev.c:1945 [inline] register_netdevice+0x1073/0x1500 net/core/dev.c:9698 veth_newlink+0x59c/0xa90 drivers/net/veth.c:1722 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1352 [inline] free_pcp_prepare+0x374/0x870 mm/page_alloc.c:1404 free_unref_page_prepare mm/page_alloc.c:3325 [inline] free_unref_page+0x19/0x690 mm/page_alloc.c:3404 release_pages+0x748/0x1220 mm/swap.c:956 tlb_batch_pages_flush mm/mmu_gather.c:50 [inline] tlb_flush_mmu_free mm/mmu_gather.c:243 [inline] tlb_flush_mmu+0xe9/0x6b0 mm/mmu_gather.c:250 zap_pte_range mm/memory.c:1441 [inline] zap_pmd_range mm/memory.c:1490 [inline] zap_pud_range mm/memory.c:1519 [inline] zap_p4d_range mm/memory.c:1540 [inline] unmap_page_range+0x1d1d/0x2a30 mm/memory.c:1561 unmap_single_vma+0x198/0x310 mm/memory.c:1606 unmap_vmas+0x16b/0x2f0 mm/memory.c:1638 exit_mmap+0x201/0x670 mm/mmap.c:3178 __mmput+0x122/0x4b0 kernel/fork.c:1114 mmput+0x56/0x60 kernel/fork.c:1135 exit_mm kernel/exit.c:507 [inline] do_exit+0xa3c/0x2a30 kernel/exit.c:793 do_group_exit+0xd2/0x2f0 kernel/exit.c:935 __do_sys_exit_group kernel/exit.c:946 [inline] __se_sys_exit_group kernel/exit.c:944 [inline] __x64_sys_exit_group+0x3a/0x50 kernel/exit.c:944 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 Memory state around the buggy address: ffff8880985c4a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880985c4a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880985c4b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880985c4b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880985c4c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc Fixes: 470502de5bdb ("net: sched: unlock rules update API") Signed-off-by: Eric Dumazet Cc: Vlad Buslov Cc: Jiri Pirko Cc: Cong Wang Reported-by: syzbot Link: https://lore.kernel.org/r/20220131172018.3704490-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit 6dde7acdb3dc2e0b3bcb090aac0b3699396d309f Author: Jakub Kicinski Date: Mon Jan 31 13:17:30 2022 -0800 ethernet: smc911x: fix indentation in get/set EEPROM Build bot produced a smatch indentation warning, the code looks correct but it mixes spaces and tabs. Reported-by: kernel test robot Link: https://lore.kernel.org/r/20220131211730.3940875-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit cea267c235e1b1ec3bfc415f6bd420289bcb3bc9 Author: Dave Chinner Date: Mon Jan 31 13:20:10 2022 -0800 xfs: ensure log flush at the end of a synchronous fallocate call Since we've started treating fallocate more like a file write, we should flush the log to disk if the user has asked for synchronous writes either by setting it via fcntl flags, or inode flags, or with the sync mount option. We've already got a helper for this, so use it. [The original patch by Darrick was massaged by Dave to fit this patchset] Signed-off-by: Darrick J. Wong Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong commit b39a04636fd7454911b80e7b5ab2a66b011a8145 Author: Dave Chinner Date: Mon Jan 31 13:20:10 2022 -0800 xfs: move xfs_update_prealloc_flags() to xfs_pnfs.c The operations that xfs_update_prealloc_flags() perform are now unique to xfs_fs_map_blocks(), so move xfs_update_prealloc_flags() to be a static function in xfs_pnfs.c and cut out all the other functionality that is doesn't use anymore. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 0b02c8c0d75a738c98c35f02efb36217c170d78c Author: Dave Chinner Date: Mon Jan 31 13:20:09 2022 -0800 xfs: set prealloc flag in xfs_alloc_file_space() Now that we only call xfs_update_prealloc_flags() from xfs_file_fallocate() in the case where we need to set the preallocation flag, do this in xfs_alloc_file_space() where we already have the inode joined into a transaction and get rid of the call to xfs_update_prealloc_flags() from the fallocate code. This also means that we now correctly avoid setting the XFS_DIFLAG_PREALLOC flag when xfs_is_always_cow_inode() is true, as these inodes will never have preallocated extents. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit fbe7e520036583a783b13ff9744e35c2a329d9a4 Author: Dave Chinner Date: Mon Jan 31 13:20:09 2022 -0800 xfs: fallocate() should call file_modified() In XFS, we always update the inode change and modification time when any fallocate() operation succeeds. Furthermore, as various fallocate modes can change the file contents (extending EOF, punching holes, zeroing things, shifting extents), we should drop file privileges like suid just like we do for a regular write(). There's already a VFS helper that figures all this out for us, so use that. The net effect of this is that we no longer drop suid/sgid if the caller is root, but we also now drop file capabilities. We also move the xfs_update_prealloc_flags() function so that it now is only called by the scope that needs to set the the prealloc flag. Based on a patch from Darrick Wong. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 472c6e46f589c26057596dcba160712a5b3e02c5 Author: Dave Chinner Date: Mon Jan 31 13:20:08 2022 -0800 xfs: remove XFS_PREALLOC_SYNC Callers can acheive the same thing by calling xfs_log_force_inode() after making their modifications. There is no need for xfs_update_prealloc_flags() to do this. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit b7892f7d5cb2b8187c603dd8ea3a7c44059ccfc2 Author: Jean-Philippe Brucker Date: Tue Feb 1 09:31:20 2022 +0000 tools: Ignore errors from `which' when searching a GCC toolchain When cross-building tools with clang, we run `which $(CROSS_COMPILE)gcc` to detect whether a GCC toolchain provides the standard libraries. It is only a helper because some distros put libraries where LLVM does not automatically find them. On other systems, LLVM detects the libc automatically and does not need this. There, it is completely fine not to have a GCC at all, but some versions of `which' display an error when the command is not found: which: no aarch64-linux-gnu-gcc in ($PATH) Since the error can safely be ignored, throw it to /dev/null. Fixes: cebdb7374577 ("tools: Help cross-building with clang") Reported-by: Nathan Chancellor Signed-off-by: Jean-Philippe Brucker Signed-off-by: Daniel Borkmann Tested-by: Nathan Chancellor Reviewed-by: Nathan Chancellor Link: https://lore.kernel.org/bpf/20220201093119.1713207-1-jean-philippe@linaro.org commit 9f7fb8de5d9bac17b6392a14af40baf555d9129b Merge: 9e155101c24ad f83a96e5f033f Author: Linus Torvalds Date: Tue Feb 1 12:39:37 2022 -0800 Merge tag 'spi-fix-v5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi Pull spi fixes from Mark Brown: "There are quite a few fixes that have accumilated since the merge window here, all driver specific and none super urgent, plus a new device ID for the Rockchip driver" * tag 'spi-fix-v5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: spi: mediatek: Avoid NULL pointer crash in interrupt spi: dt-bindings: Fix 'reg' child node schema spi: bcm-qspi: check for valid cs before applying chip select spi: uniphier: fix reference count leak in uniphier_spi_probe() spi: meson-spicc: add IRQ check in meson_spicc_probe spi: uniphier: Fix a bug that doesn't point to private data correctly spi: change clk_disable_unprepare to clk_unprepare spi: spi-rockchip: Add rk3568-spi compatible spi: stm32: make SPI_MASTER_MUST_TX flags only specific to STM32F4 spi: stm32: remove inexistant variables in struct stm32_spi_cfg comment spi: stm32-qspi: Update spi registering commit 9e155101c24adb32b26475ca09bab93cf8fd80c6 Merge: 83c2713a67548 b4c18c18ebf7c Author: Linus Torvalds Date: Tue Feb 1 12:37:20 2022 -0800 Merge tag 'regulator-fix-v5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator Pull regulator fixes from Mark Brown: "A couple of very minor fixes for the regulator framework, nothing at all urgent here" * tag 'regulator-fix-v5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: regulator: MAX20086: add gpio/consumer.h regulator: max20086: fix error code in max20086_parse_regulators_dt() commit 83c2713a6754815c4f533097914a8d4fbe85dcf1 Merge: 24d7f48c72362 836f35f79153c Author: Linus Torvalds Date: Tue Feb 1 12:12:10 2022 -0800 Merge tag 'platform-drivers-x86-v5.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 Pull x86 platform driver fixes from Hans de Goede: "This consists of various build- and bug-fixes as well as a few hardware-id additions. Highlights: - Bunch of fixes for the new x86-android-tablets module - Misc other fixes - A couple of hw-id additions" * tag 'platform-drivers-x86-v5.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: platform/x86: thinkpad_acpi: Fix incorrect use of platform profile on AMD platforms platform/x86: amd-pmc: Correct usage of SMU version platform/x86: asus-tf103c-dock: Make 2 global structs static platform/x86: amd-pmc: Make amd_pmc_stb_debugfs_fops static platform/x86: ISST: Fix possible circular locking dependency detected platform/x86: intel_crystal_cove_charger: Fix IRQ masking / unmasking platform/x86: thinkpad_acpi: Add quirk for ThinkPads without a fan platform/x86: touchscreen_dmi: Add info for the RWC NANOTE P8 AY07J 2-in-1 platform/surface: Reinstate platform dependency platform/x86: x86-android-tablets: Trivial typo fix for MODULE_AUTHOR platform/x86: x86-android-tablets: Fix the buttons on CZC P10T tablet platform/x86: x86-android-tablets: Constify the gpiod_lookup_tables arrays platform/x86: x86-android-tablets: Add an init() callback to struct x86_dev_info platform/x86: x86-android-tablets: Add support for disabling ACPI _AEI handlers platform/x86: x86-android-tablets: Correct crystal_cove_charger module name commit 24d7f48c72362bc7cdb8adf06cb303fe4a2c200d Merge: 1a2beb3d5a0b4 94fd19752b28a Author: Linus Torvalds Date: Tue Feb 1 11:23:02 2022 -0800 Merge tag 'ovl-fixes-5.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs Pull overlayfs fixes from Miklos Szeredi: "Fix a regression introduced in v5.15, affecting copy up of files with 'noatime' or 'sync' attributes to a tmpfs upper layer" * tag 'ovl-fixes-5.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs: ovl: don't fail copy up if no fileattr support on upper ovl: fix NULL pointer dereference in copy up warning commit 1a2beb3d5a0b4051067ecf49ea799bee340e0e7c Author: Christian Brauner Date: Mon Jan 31 15:48:54 2022 +0100 mailmap: update Christian Brauner's email address At least one of the addresses will stop functioning after February. Signed-off-by: Christian Brauner Signed-off-by: Linus Torvalds commit 630c12862c21a312c15a494922cdbf9c1beb1733 Merge: 61fda95541cd0 5298d4bfe80f6 Author: Linus Torvalds Date: Tue Feb 1 11:13:24 2022 -0800 Merge tag 'unicode-for-next-5.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/krisman/unicode Pull unicode cleanup from Gabriel Krisman Bertazi: "A fix from Christoph Hellwig merging the CONFIG_UNICODE_UTF8_DATA into the previous CONFIG_UNICODE. It is -rc material since we don't want to expose the former symbol on 5.17. This has been living on linux-next for the past week" * tag 'unicode-for-next-5.17-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/krisman/unicode: unicode: clean up the Kconfig symbol confusion commit 61fda95541cd0287540da45bb6dcbff2aeab1af9 Merge: 26291c54e111f f26d04331360d Author: Linus Torvalds Date: Tue Feb 1 11:07:09 2022 -0800 Merge tag 'audit-pr-20220131' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit Pull audit fix from Paul Moore: "A single audit patch to fix problems relating to audit queuing and system responsiveness when "audit=1" is specified on the kernel command line and the audit daemon is SIGSTOP'd for an extended period of time" * tag 'audit-pr-20220131' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit: audit: improve audit queue handling when "audit=1" on cmdline commit a4b92cebc31d49b7e6ef0ce584c7f2a2e112877d Author: Mark Brown Date: Tue Feb 1 14:48:38 2022 +0000 arm64: Enable Cortex-A510 erratum 2051678 by default The recently added configuration option for Cortex A510 erratum 2051678 does not have a "default y" unlike other errata fixes. This appears to simply be an oversight since the help text suggests enabling the option if unsure and there's nothing in the commit log to suggest it is intentional. Fixes: 297ae1eb23b0 ("arm64: cpufeature: List early Cortex-A510 parts as having broken dbm") Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220201144838.20037-1-broonie@kernel.org Signed-off-by: Catalin Marinas commit 8cfe148a7136bc60452a5c6b7ac2d9d15c36909b Author: Mark Rutland Date: Tue Feb 1 13:29:23 2022 +0000 kvm/arm64: rework guest entry logic In kvm_arch_vcpu_ioctl_run() we enter an RCU extended quiescent state (EQS) by calling guest_enter_irqoff(), and unmasked IRQs prior to exiting the EQS by calling guest_exit(). As the IRQ entry code will not wake RCU in this case, we may run the core IRQ code and IRQ handler without RCU watching, leading to various potential problems. Additionally, we do not inform lockdep or tracing that interrupts will be enabled during guest execution, which caan lead to misleading traces and warnings that interrupts have been enabled for overly-long periods. This patch fixes these issues by using the new timing and context entry/exit helpers to ensure that interrupts are handled during guest vtime but with RCU watching, with a sequence: guest_timing_enter_irqoff(); guest_state_enter_irqoff(); < run the vcpu > guest_state_exit_irqoff(); < take any pending IRQs > guest_timing_exit_irqoff(); Since instrumentation may make use of RCU, we must also ensure that no instrumented code is run during the EQS. I've split out the critical section into a new kvm_arm_enter_exit_vcpu() helper which is marked noinstr. Fixes: 1b3d546daf85ed2b ("arm/arm64: KVM: Properly account for guest CPU time") Reported-by: Nicolas Saenz Julienne Signed-off-by: Mark Rutland Reviewed-by: Marc Zyngier Reviewed-by: Nicolas Saenz Julienne Cc: Alexandru Elisei Cc: Catalin Marinas Cc: Frederic Weisbecker Cc: James Morse Cc: Paolo Bonzini Cc: Paul E. McKenney Cc: Suzuki K Poulose Cc: Will Deacon Message-Id: <20220201132926.3301912-3-mark.rutland@arm.com> Signed-off-by: Paolo Bonzini commit 24f6008564183aa120d07c03d9289519c2fe02af Author: Eric W. Biederman Date: Thu Jan 20 11:04:01 2022 -0600 cgroup-v1: Require capabilities to set release_agent The cgroup release_agent is called with call_usermodehelper. The function call_usermodehelper starts the release_agent with a full set fo capabilities. Therefore require capabilities when setting the release_agaent. Reported-by: Tabitha Sable Tested-by: Tabitha Sable Fixes: 81a6a5cdd2c5 ("Task Control Groups: automatic userspace notification of idle cgroups") Cc: stable@vger.kernel.org # v2.6.24+ Signed-off-by: "Eric W. Biederman" Signed-off-by: Tejun Heo commit 053ca37c87af65f41f5842070c68aa53c3d035f5 Author: Bjorn Helgaas Date: Thu Jan 27 15:49:49 2022 -0600 PCI: j721e: Initialize pcie->cdns_pcie before using it Christian reported a NULL pointer dereference in j721e_pcie_probe() caused by 19e863828acf ("PCI: j721e: Drop redundant struct device *"), which removed struct j721e_pcie.dev since there's another copy in struct cdns_pcie.dev reachable via j721e_pcie->cdns_pcie->dev. The problem is that j721e_pcie->cdns_pcie was dereferenced before being initialized: j721e_pcie_probe pcie = devm_kzalloc() # struct j721e_pcie j721e_pcie_ctrl_init(pcie) dev = pcie->cdns_pcie->dev <-- dereference cdns_pcie switch (mode) { case PCI_MODE_RC: cdns_pcie = ... # alloc as part of pci_host_bridge pcie->cdns_pcie = cdns_pcie <-- initialize pcie->cdns_pcie Move the cdns_pcie initialization earlier so it is done before it is used. This also simplifies the error exits. Fixes: 19e863828acf ("PCI: j721e: Drop redundant struct device *") Link: https://lore.kernel.org/r/20220127222951.GA144828@bhelgaas Link: https://lore.kernel.org/r/20220124122132.435743-1-christian.gmeiner@gmail.com Reported-by: Christian Gmeiner Tested-by: Christian Gmeiner Signed-off-by: Bjorn Helgaas commit cad014b7b5a6897d8c4fad13e2888978bfb7a53f Author: Sasha Neftin Date: Tue Dec 7 13:23:42 2021 +0200 e1000e: Handshake with CSME starts from ADL platforms Handshake with CSME/AMT on none provisioned platforms during S0ix flow is not supported on TGL platform and can cause to HW unit hang. Update the handshake with CSME flow to start from the ADL platform. Fixes: 3e55d231716e ("e1000e: Add handshake with the CSME to support S0ix") Signed-off-by: Sasha Neftin Tested-by: Nechama Kraus Signed-off-by: Tony Nguyen commit 68defd528f94ed1cf11f49a75cc1875dccd781fa Author: Sasha Neftin Date: Tue Dec 7 13:23:06 2021 +0200 e1000e: Separate ADP board type from TGP We have the same LAN controller on different PCH's. Separate ADP board type from a TGP which will allow for specific fixes to be applied for ADP platforms. Suggested-by: Kai-Heng Feng Suggested-by: Dima Ruinskiy Signed-off-by: Sasha Neftin Tested-by: Nechama Kraus Signed-off-by: Tony Nguyen commit 46f5cbdef7d4fbb0f857a3caddec6799d0b5bb2f Author: David Howells Date: Mon Jan 31 17:54:43 2022 +0000 cifs: Fix the readahead conversion to manage the batch when reading from cache Fix the readahead conversion to correctly manage the last batch skipping when reading from cache. This involves a readahead batch of one page or one folio, so set the batch size according to the number of constituent pages (should be 1 for a filesystem that doesn't do multipage folios yet). Signed-off-by: David Howells cc: Steve French Reviewed-by: Rohith Surabattula Reviewed-by: Shyam Prasad N cc: Jeff Layton cc: linux-cifs@vger.kernel.org Signed-off-by: Steve French commit 0174ee9947bd0f24fee2794b35258960d108b7aa Author: David Howells Date: Thu Jan 27 16:02:58 2022 +0000 cifs: Implement cache I/O by accessing the cache directly Move cifs to using fscache DIO API instead of the old upstream I/O API as that has been removed. This is a stopgap solution as the intention is that at sometime in the future, the cache will move to using larger blocks and won't be able to store individual pages in order to deal with the potential for data corruption due to the backing filesystem being able insert/remove bridging blocks of zeros into its extent list[1]. cifs then reads and writes cache pages synchronously and one page at a time. The preferred change would be to use the netfs lib, but the new I/O API can be used directly. It's just that as the cache now needs to track data for itself, caching blocks may exceed page size... This code is somewhat borrowed from my "fallback I/O" patchset[2]. Signed-off-by: David Howells cc: Steve French cc: Shyam Prasad N cc: linux-cifs@vger.kernel.org cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/YO17ZNOcq+9PajfQ@mit.edu [1] Link: https://lore.kernel.org/r/202112100957.2oEDT20W-lkp@intel.com/ [2] Acked-by: Jeff Layton Signed-off-by: Steve French commit bee9f65523218e3baeeecde9295c8fbe9bc08e0a Author: David Howells Date: Thu Jan 27 16:02:50 2022 +0000 netfs, cachefiles: Add a method to query presence of data in the cache Add a netfs_cache_ops method by which a network filesystem can ask the cache about what data it has available and where so that it can make a multipage read more efficient. Signed-off-by: David Howells cc: linux-cachefs@redhat.com Acked-by: Jeff Layton Reviewed-by: Rohith Surabattula Signed-off-by: Steve French commit 052e04a52dcd3359ba1df25a508a3a93707a3f6e Author: David Howells Date: Thu Jan 27 16:02:42 2022 +0000 cifs: Transition from ->readpages() to ->readahead() Transition the cifs filesystem from using the old ->readpages() method to using the new ->readahead() method. For the moment, this removes any invocation of fscache to read data from the local cache, leaving that to another patch. Signed-off-by: David Howells cc: Steve French cc: Shyam Prasad N cc: Matthew Wilcox cc: Jeff Layton cc: linux-cifs@vger.kernel.org cc: linux-cachefs@redhat.com Reviewed-by: Rohith Surabattula Acked-by: Jeff Layton Signed-off-by: Steve French commit fc45e6588d57b65378612fce07089276141509dc 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: 9a10064f5625d557 ("mm: add a field to store names for private anonymous memory") 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 $ This actually adds a new prctl arg, but it has to be dealt with differently, as it is not in sequence with the other arguments. 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: Adrian Hunter Cc: Colin Cross Cc: Ian Rogers Cc: Jiri Olsa Cc: Kees Cook Cc: Namhyung Kim Cc: Suren Baghdasaryan Signed-off-by: Arnaldo Carvalho de Melo commit 100198322b2eb7fb38750cb0fcae5cd533907410 Author: Arnaldo Carvalho de Melo Date: Tue Feb 1 12:53:16 2022 -0300 perf beauty: Make the prctl arg regexp more strict to cope with PR_SET_VMA This new PR_SET_VMA value isn't in sequence with all the other prctl arguments and instead uses a big, 0x prefixed hex number: 0x53564d41 (S V M A). This makes it harder to generate a string table as it would be rather sparse, so make the regexp more stricter to avoid catching those. A followup patch for 'perf trace' to cope with such oddities will be needed, but then its a matter for the next merge window. The next patch will update the prctl.h file to cope with this perf 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 Here is the output of this script: $ tools/perf/trace/beauty/prctl_option.sh static const char *prctl_options[] = { [1] = "SET_PDEATHSIG", [2] = "GET_PDEATHSIG", [3] = "GET_DUMPABLE", [4] = "SET_DUMPABLE", [5] = "GET_UNALIGN", [6] = "SET_UNALIGN", [7] = "GET_KEEPCAPS", [8] = "SET_KEEPCAPS", [9] = "GET_FPEMU", [10] = "SET_FPEMU", [11] = "GET_FPEXC", [12] = "SET_FPEXC", [13] = "GET_TIMING", [14] = "SET_TIMING", [15] = "SET_NAME", [16] = "GET_NAME", [19] = "GET_ENDIAN", [20] = "SET_ENDIAN", [21] = "GET_SECCOMP", [22] = "SET_SECCOMP", [23] = "CAPBSET_READ", [24] = "CAPBSET_DROP", [25] = "GET_TSC", [26] = "SET_TSC", [27] = "GET_SECUREBITS", [28] = "SET_SECUREBITS", [29] = "SET_TIMERSLACK", [30] = "GET_TIMERSLACK", [31] = "TASK_PERF_EVENTS_DISABLE", [32] = "TASK_PERF_EVENTS_ENABLE", [33] = "MCE_KILL", [34] = "MCE_KILL_GET", [35] = "SET_MM", [36] = "SET_CHILD_SUBREAPER", [37] = "GET_CHILD_SUBREAPER", [38] = "SET_NO_NEW_PRIVS", [39] = "GET_NO_NEW_PRIVS", [40] = "GET_TID_ADDRESS", [41] = "SET_THP_DISABLE", [42] = "GET_THP_DISABLE", [43] = "MPX_ENABLE_MANAGEMENT", [44] = "MPX_DISABLE_MANAGEMENT", [45] = "SET_FP_MODE", [46] = "GET_FP_MODE", [47] = "CAP_AMBIENT", [50] = "SVE_SET_VL", [51] = "SVE_GET_VL", [52] = "GET_SPECULATION_CTRL", [53] = "SET_SPECULATION_CTRL", [54] = "PAC_RESET_KEYS", [55] = "SET_TAGGED_ADDR_CTRL", [56] = "GET_TAGGED_ADDR_CTRL", [57] = "SET_IO_FLUSHER", [58] = "GET_IO_FLUSHER", [59] = "SET_SYSCALL_USER_DISPATCH", [60] = "PAC_SET_ENABLED_KEYS", [61] = "PAC_GET_ENABLED_KEYS", [62] = "SCHED_CORE", }; static const char *prctl_set_mm_options[] = { [1] = "START_CODE", [2] = "END_CODE", [3] = "START_DATA", [4] = "END_DATA", [5] = "START_STACK", [6] = "START_BRK", [7] = "BRK", [8] = "ARG_START", [9] = "ARG_END", [10] = "ENV_START", [11] = "ENV_END", [12] = "AUXV", [13] = "EXE_FILE", [14] = "MAP", [15] = "MAP_SIZE", }; $ Cc: Adrian Hunter Cc: Colin Cross Cc: Ian Rogers Cc: Jiri Olsa Cc: Kees Cook Cc: Namhyung Kim Cc: Suren Baghdasaryan Link: https://lore.kernel.org/lkml/YflZqY0rYQ3d1bKt@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 52517d9c0c011272950e1d88f1ced297daa001e9 Merge: 1c7f0e349aa5f a4f399a1416f6 Author: Takashi Iwai Date: Tue Feb 1 16:52:54 2022 +0100 Merge tag 'asoc-fix-v5.17-rc2' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v5.17 Quite a few fixes here, including an unusually large set in the core spurred on by various testing efforts as well as the usual small driver fixes. There are quite a few fixes for out of bounds writes in both the core and the various Qualcomm drivers, plus a couple of fixes for locking in the DPCM code. commit d5381cc9f123d64bee1d1a124cd98faa5fa36ca6 Author: Arnaldo Carvalho de Melo Date: Thu Jul 1 13:39:15 2021 -0300 tools headers cpufeatures: Sync with the kernel sources To pick the changes from: 690a757d610e50c2 ("kvm: x86: Add CPUID support for Intel AMX") This only causes these perf files to be rebuilt: CC /tmp/build/perf/bench/mem-memcpy-x86-64-asm.o CC /tmp/build/perf/bench/mem-memset-x86-64-asm.o And addresses this perf build warning: Warning: Kernel ABI header at 'tools/arch/x86/include/asm/cpufeatures.h' differs from latest version at 'arch/x86/include/asm/cpufeatures.h' diff -u tools/arch/x86/include/asm/cpufeatures.h arch/x86/include/asm/cpufeatures.h Cc: Jing Liu Cc: Paolo Bonzini Link: https://lore.kernel.org/lkml/YflQCEO9FRLeTmlB@kernel.org/ Signed-off-by: Arnaldo Carvalho de Melo commit 88443d3f79b8d2b5679f2a1df1482fa024be2353 Author: Arnaldo Carvalho de Melo Date: Fri May 21 16:00:31 2021 -0300 tools headers UAPI: Sync linux/perf_event.h with the kernel sources To pick the trivial change in: cb1c4aba055f928f ("perf: Add new macros for mem_hops field") Just comment source code alignment. This silences this perf build warning: Warning: Kernel ABI header at 'tools/include/uapi/linux/perf_event.h' differs from latest version at 'include/uapi/linux/perf_event.h' diff -u tools/include/uapi/linux/perf_event.h include/uapi/linux/perf_event.h Cc: Kajol Jain Cc: Michael Ellerman Link: https://lore.kernel.org/lkml/YflPKLhu2AtHmPov@kernel.org/ Signed-off-by: Arnaldo Carvalho de Melo commit e9cc5d48d4f463fbea19dd93253e98af3b612b7c 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: 55b71f6c29f2a78a ("ALSA: uapi: use C90 comment style instead of C99 style") fb6723daf89083a0 ("ALSA: pcm: comment about relation between msbits hw parameter and [S|U]32 formats") b456abe63f60ad93 ("ALSA: pcm: introduce INFO_NO_REWINDS flag") 5aec579e08e4f2be ("ALSA: uapi: Fix a C++ style comment in asound.h") 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: Mark Brown Cc: Pierre-Louis Bossart Cc: Takashi Iwai Cc: Takashi Sakamoto Link: https://lore.kernel.org/all/YflN0j09T+6ODHIh@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 836f35f79153ce09d813c83f341dba4481996966 Author: Mark Pearson Date: Thu Jan 27 14:03:58 2022 -0500 platform/x86: thinkpad_acpi: Fix incorrect use of platform profile on AMD platforms Lenovo AMD based platforms have been offering platform_profiles but they are not working correctly. This is because the mode we are using on the Intel platforms (MMC) is not available on the AMD platforms. This commit adds checking of the functional capabilities returned by the BIOS to confirm if MMC is supported or not. Profiles will not be available if the platform is not MMC capable. I'm investigating and working on an alternative for AMD platforms but that is still work-in-progress. Signed-off-by: Mark Pearson Link: https://lore.kernel.org/r/20220127190358.4078-1-markpearson@lenovo.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 1c7f0e349aa5f8f80b1cac3d4917405332e14cdf Author: Peter Ujfalusi Date: Tue Feb 1 13:21:44 2022 +0200 ALSA: hda: Skip codec shutdown in case the codec is not registered If the codec->registered is not set then it means that pm_runtime is not yet enabled and the codec->pcm_list_head has not been initialized. The access to the not initialized pcm_list_head will lead a kernel crash during shutdown. Reported-by: Guennadi Liakhovetski Signed-off-by: Peter Ujfalusi Tested-by: Guennadi Liakhovetski Fixes: b98444ed597d ("ALSA: hda: Suspend codec at shutdown") Link: https://lore.kernel.org/r/20220201112144.29411-1-peter.ujfalusi@linux.intel.com Signed-off-by: Takashi Iwai commit f3136c4ce7acf64bee43135971ca52a880572e32 Author: Leon Romanovsky Date: Mon Jan 31 11:45:26 2022 +0200 RDMA/mlx4: Don't continue event handler after memory allocation failure The failure to allocate memory during MLX4_DEV_EVENT_PORT_MGMT_CHANGE event handler will cause skip the assignment logic, but ib_dispatch_event() will be called anyway. Fix it by calling to return instead of break after memory allocation failure. Fixes: 00f5ce99dc6e ("mlx4: Use port management change event instead of smp_snoop") Link: https://lore.kernel.org/r/12a0e83f18cfad4b5f62654f141e240d04915e10.1643622264.git.leonro@nvidia.com Signed-off-by: Leon Romanovsky Reviewed-by: Håkon Bugge Signed-off-by: Jason Gunthorpe commit b43a76f423aa304037603fd6165c4a534d2c09a7 Author: Bernard Metzler Date: Sun Jan 30 18:08:15 2022 +0100 RDMA/siw: Fix broken RDMA Read Fence/Resume logic. Code unconditionally resumed fenced SQ processing after next RDMA Read completion, even if other RDMA Read responses are still outstanding, or ORQ is full. Also adds comments for better readability of fence processing, and removes orq_get_tail() helper, which is not needed anymore. Fixes: 8b6a361b8c48 ("rdma/siw: receive path") Fixes: a531975279f3 ("rdma/siw: main include file") Link: https://lore.kernel.org/r/20220130170815.1940-1-bmt@zurich.ibm.com Reported-by: Jared Holzman Signed-off-by: Bernard Metzler Signed-off-by: Jason Gunthorpe commit b2d2af7e5df37ee3a9ba6b405bdbb7691a5c2dfc Author: Mark Rutland Date: Tue Feb 1 13:29:24 2022 +0000 kvm/x86: rework guest entry logic For consistency and clarity, migrate x86 over to the generic helpers for guest timing and lockdep/RCU/tracing management, and remove the x86-specific helpers. Prior to this patch, the guest timing was entered in kvm_guest_enter_irqoff() (called by svm_vcpu_enter_exit() and svm_vcpu_enter_exit()), and was exited by the call to vtime_account_guest_exit() within vcpu_enter_guest(). To minimize duplication and to more clearly balance entry and exit, both entry and exit of guest timing are placed in vcpu_enter_guest(), using the new guest_timing_{enter,exit}_irqoff() helpers. When context tracking is used a small amount of additional time will be accounted towards guests; tick-based accounting is unnaffected as IRQs are disabled at this point and not enabled until after the return from the guest. This also corrects (benign) mis-balanced context tracking accounting introduced in commits: ae95f566b3d22ade ("KVM: X86: TSCDEADLINE MSR emulation fastpath") 26efe2fd92e50822 ("KVM: VMX: Handle preemption timer fastpath") Where KVM can enter a guest multiple times, calling vtime_guest_enter() without a corresponding call to vtime_account_guest_exit(), and with vtime_account_system() called when vtime_account_guest() should be used. As account_system_time() checks PF_VCPU and calls account_guest_time(), this doesn't result in any functional problem, but is unnecessarily confusing. Signed-off-by: Mark Rutland Acked-by: Paolo Bonzini Reviewed-by: Nicolas Saenz Julienne Cc: Borislav Petkov Cc: Dave Hansen Cc: Ingo Molnar Cc: Jim Mattson Cc: Joerg Roedel Cc: Sean Christopherson Cc: Thomas Gleixner Cc: Vitaly Kuznetsov Cc: Wanpeng Li Message-Id: <20220201132926.3301912-4-mark.rutland@arm.com> Signed-off-by: Paolo Bonzini commit 72e3244512b34756a7e8aa67eff45cdcb040ac4e Author: Mark Rutland Date: Tue Feb 1 13:29:26 2022 +0000 kvm/mips: rework guest entry logic In kvm_arch_vcpu_ioctl_run() we use guest_enter_irqoff() and guest_exit_irqoff() directly, with interrupts masked between these. As we don't handle any timer ticks during this window, we will not account time spent within the guest as guest time, which is unfortunate. Additionally, we do not inform lockdep or tracing that interrupts will be enabled during guest execution, which caan lead to misleading traces and warnings that interrupts have been enabled for overly-long periods. This patch fixes these issues by using the new timing and context entry/exit helpers to ensure that interrupts are handled during guest vtime but with RCU watching, with a sequence: guest_timing_enter_irqoff(); guest_state_enter_irqoff(); < run the vcpu > guest_state_exit_irqoff(); < take any pending IRQs > guest_timing_exit_irqoff(); In addition, as guest exits during the "run the vcpu" step are handled by kvm_mips_handle_exit(), a wrapper function is added which ensures that such exists are handled with a sequence: guest_state_exit_irqoff(); < handle the exit > guest_state_enter_irqoff(); This means that exits which stop the vCPU running will have a redundant guest_state_enter_irqoff() .. guest_state_exit_irqoff() sequence, which can be addressed with future rework. Since instrumentation may make use of RCU, we must also ensure that no instrumented code is run during the EQS. I've split out the critical section into a new kvm_mips_enter_exit_vcpu() helper which is marked noinstr. Signed-off-by: Mark Rutland Cc: Aleksandar Markovic Cc: Frederic Weisbecker Cc: Huacai Chen Cc: Paolo Bonzini Cc: Paul E. McKenney Cc: Thomas Bogendoerfer Message-Id: <20220201132926.3301912-6-mark.rutland@arm.com> Signed-off-by: Paolo Bonzini commit ef9989afda73332df566852d6e9ca695c05f10ce Author: Mark Rutland Date: Tue Feb 1 13:29:22 2022 +0000 kvm: add guest_state_{enter,exit}_irqoff() When transitioning to/from guest mode, it is necessary to inform lockdep, tracing, and RCU in a specific order, similar to the requirements for transitions to/from user mode. Additionally, it is necessary to perform vtime accounting for a window around running the guest, with RCU enabled, such that timer interrupts taken from the guest can be accounted as guest time. Most architectures don't handle all the necessary pieces, and a have a number of common bugs, including unsafe usage of RCU during the window between guest_enter() and guest_exit(). On x86, this was dealt with across commits: 87fa7f3e98a1310e ("x86/kvm: Move context tracking where it belongs") 0642391e2139a2c1 ("x86/kvm/vmx: Add hardirq tracing to guest enter/exit") 9fc975e9efd03e57 ("x86/kvm/svm: Add hardirq tracing on guest enter/exit") 3ebccdf373c21d86 ("x86/kvm/vmx: Move guest enter/exit into .noinstr.text") 135961e0a7d555fc ("x86/kvm/svm: Move guest enter/exit into .noinstr.text") 160457140187c5fb ("KVM: x86: Defer vtime accounting 'til after IRQ handling") bc908e091b326467 ("KVM: x86: Consolidate guest enter/exit logic to common helpers") ... but those fixes are specific to x86, and as the resulting logic (while correct) is split across generic helper functions and x86-specific helper functions, it is difficult to see that the entry/exit accounting is balanced. This patch adds generic helpers which architectures can use to handle guest entry/exit consistently and correctly. The guest_{enter,exit}() helpers are split into guest_timing_{enter,exit}() to perform vtime accounting, and guest_context_{enter,exit}() to perform the necessary context tracking and RCU management. The existing guest_{enter,exit}() heleprs are left as wrappers of these. Atop this, new guest_state_enter_irqoff() and guest_state_exit_irqoff() helpers are added to handle the ordering of lockdep, tracing, and RCU manageent. These are inteneded to mirror exit_to_user_mode() and enter_from_user_mode(). Subsequent patches will migrate architectures over to the new helpers, following a sequence: guest_timing_enter_irqoff(); guest_state_enter_irqoff(); < run the vcpu > guest_state_exit_irqoff(); < take any pending IRQs > guest_timing_exit_irqoff(); This sequences handles all of the above correctly, and more clearly balances the entry and exit portions, making it easier to understand. The existing helpers are marked as deprecated, and will be removed once all architectures have been converted. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Reviewed-by: Marc Zyngier Reviewed-by: Paolo Bonzini Reviewed-by: Nicolas Saenz Julienne Message-Id: <20220201132926.3301912-2-mark.rutland@arm.com> Signed-off-by: Paolo Bonzini commit 2b56a9a28a6bf09890a43161402948ed62963f36 Author: Yang Li Date: Wed Jan 5 10:37:00 2022 +0800 power: supply: core: fix application of sizeof to pointer The coccinelle check report: ./drivers/power/supply/cw2015_battery.c:692:12-18: ERROR: application of sizeof to pointer Reported-by: Abaci Robot Fixes: 25fd330370ac ("power: supply_core: Pass pointer to battery info") Signed-off-by: Yang Li Reviewed-by: Linus Walleij Signed-off-by: Sebastian Reichel commit 881cc731df6af99a21622e9be25a23b81adcd10b Author: Jonathan McDowell Date: Mon Jan 31 13:56:41 2022 +0000 net: phy: Fix qca8081 with speeds lower than 2.5Gb/s A typo in qca808x_read_status means we try to set SMII mode on the port rather than SGMII when the link speed is not 2.5Gb/s. This results in no traffic due to the mismatch in configuration between the phy and the mac. v2: Only change interface mode when the link is up Fixes: 79c7bc0521545 ("net: phy: add qca8081 read_status") Cc: stable@vger.kernel.org Signed-off-by: Jonathan McDowell Reviewed-by: Russell King (Oracle) Signed-off-by: David S. Miller commit ee12595147ac1fbfb5bcb23837e26dd58d94b15d Author: Dan Carpenter Date: Fri Jan 28 22:57:01 2022 +0300 fanotify: Fix stale file descriptor in copy_event_to_user() This code calls fd_install() which gives the userspace access to the fd. Then if copy_info_records_to_user() fails it calls put_unused_fd(fd) but that will not release it and leads to a stale entry in the file descriptor table. Generally you can't trust the fd after a call to fd_install(). The fix is to delay the fd_install() until everything else has succeeded. Fortunately it requires CAP_SYS_ADMIN to reach this code so the security impact is less. Fixes: f644bc449b37 ("fanotify: fix copy_event_to_user() fid error clean up") Link: https://lore.kernel.org/r/20220128195656.GA26981@kili Signed-off-by: Dan Carpenter Reviewed-by: Mathias Krause Signed-off-by: Jan Kara commit 57dfd7b53dec740afe402135fdd1c5708ec337f0 Author: Sean Christopherson Date: Fri Jan 28 00:51:48 2022 +0000 KVM: x86: Move delivery of non-APICv interrupt into vendor code Handle non-APICv interrupt delivery in vendor code, even though it means VMX and SVM will temporarily have duplicate code. SVM's AVIC has a race condition that requires KVM to fall back to legacy interrupt injection _after_ the interrupt has been logged in the vIRR, i.e. to fix the race, SVM will need to open code the full flow anyways[*]. Refactor the code so that the SVM bug without introducing other issues, e.g. SVM would return "success" and thus invoke trace_kvm_apicv_accept_irq() even when delivery through the AVIC failed, and to opportunistically prepare for using KVM_X86_OP to fill each vendor's kvm_x86_ops struct, which will rely on the vendor function matching the kvm_x86_op pointer name. No functional change intended. [*] https://lore.kernel.org/all/20211213104634.199141-4-mlevitsk@redhat.com Signed-off-by: Sean Christopherson Message-Id: <20220128005208.4008533-3-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 6ca0c6283340d819bf9c7d8e76be33c9fbd903ab Author: Johan Hovold Date: Tue Feb 1 11:42:53 2022 +0100 USB: serial: cp210x: add CPI Bulk Coin Recycler id Add the device id for the Crane Payment Innovation / Money Controls Bulk Coin Recycler: https://www.cranepi.com/en/system/files/Support/OM_BCR_EN_V1-04_0.pdf Reported-by: Scott Russell Cc: stable@vger.kernel.org Reviewed-by: Greg Kroah-Hartman Signed-off-by: Johan Hovold commit b50f8f09c622297d3cf46e332e17ba8adedec9af Author: Johan Hovold Date: Tue Feb 1 11:42:52 2022 +0100 USB: serial: cp210x: add NCR Retail IO box id Add the device id for NCR's Retail IO box (CP2105) used in NCR FastLane SelfServ Checkout - R6C: https://www.ncr.com/product-catalog/ncr-fastlane-selfserv-checkout-r6c Reported-by: Scott Russell Cc: stable@vger.kernel.org Reviewed-by: Greg Kroah-Hartman Signed-off-by: Johan Hovold commit fbb9b194e15a63c56c5664e76ccd0e85c6100cea Author: Cameron Williams Date: Tue Feb 1 10:12:51 2022 +0000 USB: serial: ftdi_sio: add support for Brainboxes US-159/235/320 This patch adds support for the Brainboxes US-159, US-235 and US-320 USB-to-Serial devices. Signed-off-by: Cameron Williams Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit da5462a4dc446e7028e6d150a4b02684d1d3ea81 Author: Randy Dunlap Date: Mon Jan 17 18:15:22 2022 -0800 power: supply: fix table problem in sysfs-class-power Add a bottom table border to complete the table format and prevent a documentation build warning. Documentation/ABI/testing/sysfs-class-power:459: WARNING: Malformed table. No bottom table border found. Fixes: 1b0b6cc8030d0 ("power: supply: add charge_behaviour attributes") Signed-off-by: Randy Dunlap Cc: Thomas Weißschuh Cc: Hans de Goede Cc: Sebastian Reichel Cc: linux-pm@vger.kernel.org Cc: Stephen Rothwell Signed-off-by: Sebastian Reichel commit 7d73c602154df56802a9e75ac212505fc1e9a2b6 Author: Umesh Nerlige Ramappa Date: Mon Jan 24 18:01:24 2022 -0800 drm/i915/pmu: Fix KMD and GuC race on accessing busyness GuC updates shared memory and KMD reads it. Since this is not synchronized, we run into a race where the value read is inconsistent. Sometimes the inconsistency is in reading the upper MSB bytes of the last_switch_in value. 2 types of cases are seen - upper 8 bits are zero and upper 24 bits are zero. Since these are non-zero values, it is not trivial to determine validity of these values. Instead we read the values multiple times until they are consistent. In test runs, 3 attempts results in consistent values. The upper bound is set to 6 attempts and may need to be tuned as per any new occurences. Since the duration that gt is parked can vary, the patch also updates the gt timestamp on unpark before starting the worker. v2: - Initialize i - Use READ_ONCE to access engine record Fixes: 77cdd054dd2c ("drm/i915/pmu: Connect engine busyness stats from GuC to pmu") Signed-off-by: Umesh Nerlige Ramappa Reviewed-by: Alan Previn Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20220125020124.788679-2-umesh.nerlige.ramappa@intel.com (cherry picked from commit 512712a824de9b856a4e61343e3e4390eba2c391) Signed-off-by: Tvrtko Ursulin commit 92c4cfaee6872038563c5b6f2e8e613f9d84d47d Author: Jordy Zomer Date: Sat Jan 29 16:06:04 2022 +0100 dma-buf: heaps: Fix potential spectre v1 gadget It appears like nr could be a Spectre v1 gadget as it's supplied by a user and used as an array index. Prevent the contents of kernel memory from being leaked to userspace via speculative execution by using array_index_nospec. Signed-off-by: Jordy Zomer Fixes: c02a81fba74f ("dma-buf: Add dma-buf heaps framework") Cc: # v5.6+ Acked-by: John Stultz Signed-off-by: Sumit Semwal [sumits: added fixes and cc: stable tags] Link: https://patchwork.freedesktop.org/patch/msgid/20220129150604.3461652-1-jordy@pwning.systems commit 2161ba070999a709f975910b6b9ad6b51cd6f120 Author: Randy Dunlap Date: Sat Jan 29 12:58:19 2022 -0800 MIPS: KVM: fix vz.c kernel-doc notation Fix all kernel-doc warnings in mips/kvm/vz.c as reported by the kernel test robot: arch/mips/kvm/vz.c:471: warning: Function parameter or member 'out_compare' not described in '_kvm_vz_save_htimer' arch/mips/kvm/vz.c:471: warning: Function parameter or member 'out_cause' not described in '_kvm_vz_save_htimer' arch/mips/kvm/vz.c:471: warning: Excess function parameter 'compare' description in '_kvm_vz_save_htimer' arch/mips/kvm/vz.c:471: warning: Excess function parameter 'cause' description in '_kvm_vz_save_htimer' arch/mips/kvm/vz.c:1551: warning: No description found for return value of 'kvm_trap_vz_handle_cop_unusable' arch/mips/kvm/vz.c:1552: warning: expecting prototype for kvm_trap_vz_handle_cop_unusuable(). Prototype was for kvm_trap_vz_handle_cop_unusable() instead arch/mips/kvm/vz.c:1597: warning: No description found for return value of 'kvm_trap_vz_handle_msa_disabled' Fixes: c992a4f6a9b0 ("KVM: MIPS: Implement VZ support") Fixes: f4474d50c7d4 ("KVM: MIPS/VZ: Support hardware guest timer") Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Thomas Bogendoerfer Cc: linux-mips@vger.kernel.org Cc: Huacai Chen Cc: Aleksandar Markovic Cc: James Hogan Cc: kvm@vger.kernel.org Signed-off-by: Thomas Bogendoerfer commit 50317b636e7184d15126e2dfc83db0963a38d31e Author: Thomas Bogendoerfer Date: Mon Jan 31 11:07:02 2022 +0100 MIPS: octeon: Fix missed PTR->PTR_WD conversion Fixes: fa62f39dc7e2 ("MIPS: Fix build error due to PTR used in more places") Signed-off-by: Thomas Bogendoerfer commit 4ee02e20893d2f9e951c7888f2284fa608ddaa35 Author: Jonas Hahnfeld Date: Mon Jan 31 19:35:16 2022 +0100 ALSA: usb-audio: Correct quirk for VF0770 This device provides both audio and video. The original quirk added in commit 48827e1d6af5 ("ALSA: usb-audio: Add quirk for VF0770") used USB_DEVICE to match the vendor and product ID. Depending on module order, if snd-usb-audio was asked first, it would match the entire device and uvcvideo wouldn't get to see it. Change the matching to USB_AUDIO_DEVICE to restore uvcvideo matching in all cases. Fixes: 48827e1d6af5 ("ALSA: usb-audio: Add quirk for VF0770") Reported-by: Jukka Heikintalo Tested-by: Jukka Heikintalo Reported-by: Paweł Susicki Tested-by: Paweł Susicki Cc: # 5.4, 5.10, 5.14, 5.15 Signed-off-by: Jonas Hahnfeld Link: https://lore.kernel.org/r/20220131183516.61191-1-hahnjo@hahnjo.de Signed-off-by: Takashi Iwai commit ff4865b3c8cd746ef72f59bdd485848b4cebd43d Author: Rafael J. Wysocki Date: Wed Jan 26 20:48:49 2022 +0100 ALSA: Replace acpi_bus_get_device() Replace acpi_bus_get_device() that is going to be dropped with acpi_fetch_acpi_dev(). No intentional functional impact. Signed-off-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/2828205.e9J7NaK4W3@kreacher Signed-off-by: Takashi Iwai commit 9cef24c8b76c1f6effe499d2f131807c90f7ce9a Author: Lior Nahmanson Date: Sun Jan 30 13:29:01 2022 +0200 net: macsec: Fix offload support for NETDEV_UNREGISTER event Current macsec netdev notify handler handles NETDEV_UNREGISTER event by releasing relevant SW resources only, this causes resources leak in case of macsec HW offload, as the underlay driver was not notified to clean it's macsec offload resources. Fix by calling the underlay driver to clean it's relevant resources by moving offload handling from macsec_dellink() to macsec_common_dellink() when handling NETDEV_UNREGISTER event. Fixes: 3cf3227a21d1 ("net: macsec: hardware offloading infrastructure") Signed-off-by: Lior Nahmanson Reviewed-by: Raed Salem Signed-off-by: Raed Salem Reviewed-by: Antoine Tenart Link: https://lore.kernel.org/r/1643542141-28956-1-git-send-email-raeds@nvidia.com Signed-off-by: Jakub Kicinski commit 7af037c39b600bac2c716dd1228e8ddbe149573f Author: Camel Guo Date: Mon Jan 31 09:38:40 2022 +0100 net: stmmac: dump gmac4 DMA registers correctly Unlike gmac100, gmac1000, gmac4 has 27 DMA registers and they are located at DMA_CHAN_BASE_ADDR (0x1100). In order for ethtool to dump gmac4 DMA registers correctly, this commit checks if a net_device has gmac4 and uses different logic to dump its DMA registers. This fixes the following KASAN warning, which can normally be triggered by a command similar like "ethtool -d eth0": BUG: KASAN: vmalloc-out-of-bounds in dwmac4_dump_dma_regs+0x6d4/0xb30 Write of size 4 at addr ffffffc010177100 by task ethtool/1839 kasan_report+0x200/0x21c __asan_report_store4_noabort+0x34/0x60 dwmac4_dump_dma_regs+0x6d4/0xb30 stmmac_ethtool_gregs+0x110/0x204 ethtool_get_regs+0x200/0x4b0 dev_ethtool+0x1dac/0x3800 dev_ioctl+0x7c0/0xb50 sock_ioctl+0x298/0x6c4 ... Fixes: fbf68229ffe7 ("net: stmmac: unify registers dumps methods") Signed-off-by: Camel Guo Link: https://lore.kernel.org/r/20220131083841.3346801-1-camel.guo@axis.com Signed-off-by: Jakub Kicinski commit 4223f86512877b04c932e7203648b37eec931731 Author: Arınç ÜNAL Date: Sat Jan 29 09:27:04 2022 +0300 net: dsa: mt7530: make NET_DSA_MT7530 select MEDIATEK_GE_PHY Make MediaTek MT753x DSA driver enable MediaTek Gigabit PHYs driver to properly control MT7530 and MT7531 switch PHYs. A noticeable change is that the behaviour of switchport interfaces going up-down-up-down is no longer there. Fixes: b8f126a8d543 ("net-next: dsa: add dsa support for Mediatek MT7530 switch") Signed-off-by: Arınç ÜNAL Reviewed-by: Andrew Lunn Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20220129062703.595-1-arinc.unal@arinc9.com Signed-off-by: Jakub Kicinski commit 7baa00bef336254e2cea5d4b064afe6430a05309 Author: Jonathan Marek Date: Sat Jan 22 11:29:32 2022 -0500 arm64: dts: qcom: sm8450: fix apps_smmu interrupts Update interrupts in apps_smmu to match downstream. This is fixes apps_smmu failing to probe when running at EL2 (expects 96 context interrupts) Fixes: 892d5395396d ("arm64: dts: qcom: sm8450: add smmu nodes") Signed-off-by: Jonathan Marek Reviewed-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220122162932.7686-2-jonathan@marek.ca commit 197769fede5824d218f1f13f7620243015801d81 Author: Jonathan Marek Date: Sat Jan 22 11:29:31 2022 -0500 arm64: dts: qcom: sm8450: enable GCC_USB3_0_CLKREF_EN for usb USB doesn't work at all without this clock enabled. This fixes USB when not using clk_ignore_unused. Fixes: 19fd04fb9247 ("arm64: dts: qcom: sm8450: Add usb nodes") Signed-off-by: Jonathan Marek Reviewed-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220122162932.7686-1-jonathan@marek.ca commit 0fd4dcb607ce29110d6c0b481a98c4ff3d300551 Author: Bjorn Andersson Date: Wed Dec 22 08:20:58 2021 -0800 arm64: dts: qcom: sm8350: Correct UFS symbol clocks The introduction of '9a61f813fcc8 ("clk: qcom: regmap-mux: fix parent clock lookup")' broke UFS support on SM8350. The cause for this is that the symbol clocks have a specified rate in the "freq-table-hz" table in the UFS node, which causes the UFS code to request a rate change, for which the "bi_tcxo" happens to provide the closest rate. Prior to the change in regmap-mux it was determined (incorrectly) that no change was needed and everything worked. The rates of 75 and 300MHz matches the documentation for the symbol clocks, but we don't represent the parent clocks today. So let's mimic the configuration found in other platforms, by omitting the rate for the symbol clocks as well to avoid the rate change. While at it also fill in the dummy symbol clocks that was dropped from the GCC driver as it was upstreamed. Fixes: 59c7cf814783 ("arm64: dts: qcom: sm8350: Add UFS nodes") Signed-off-by: Bjorn Andersson Reviewed-by: Vinod Koul Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20211222162058.3418902-1-bjorn.andersson@linaro.org commit a6ed2035878e5ad2e43ed175d8812ac9399d6c40 Author: Mario Limonciello Date: Tue Jan 11 14:00:26 2022 -0600 drm/amd: Warn users about potential s0ix problems On some OEM setups users can configure the BIOS for S3 or S2idle. When configured to S3 users can still choose 's2idle' in the kernel by using `/sys/power/mem_sleep`. Before commit 6dc8265f9803 ("drm/amdgpu: always reset the asic in suspend (v2)"), the GPU would crash. Now when configured this way, the system should resume but will use more power. As such, adjust the `amdpu_acpi_is_s0ix function` to warn users about potential power consumption issues during their first attempt at suspending. Reported-by: Bjoren Dasse Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1824 Reviewed-by: Alex Deucher Signed-off-by: Mario Limonciello Signed-off-by: Alex Deucher commit 3ec5586b4699cfb75cdfa09425e11d121db40773 Author: Evan Quan Date: Mon Jan 24 13:40:35 2022 +0800 drm/amd/pm: correct the MGpuFanBoost support for Beige Goby The existing way cannot handle Beige Goby well as a different PPTable data structure(PPTable_beige_goby_t instead of PPTable_t) is used there. Signed-off-by: Evan Quan Acked-by: Alex Deucher Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org commit 6533e558c6505e94c3e0ed4281ed5e31ec985f4d Author: Karen Sornek Date: Wed Jan 12 10:19:47 2022 +0100 i40e: Fix reset path while removing the driver Fix the crash in kernel while dereferencing the NULL pointer, when the driver is unloaded and simultaneously the VSI rings are being stopped. The hardware requires 50msec in order to finish RX queues disable. For this purpose the driver spins in mdelay function for the operation to be completed. For example changing number of queues which requires reset would fail in the following call stack: 1) i40e_prep_for_reset 2) i40e_pf_quiesce_all_vsi 3) i40e_quiesce_vsi 4) i40e_vsi_close 5) i40e_down 6) i40e_vsi_stop_rings 7) i40e_vsi_control_rx -> disable requires the delay of 50msecs 8) continue back in i40e_down function where i40e_clean_tx_ring(vsi->tx_rings[i]) is going to crash When the driver was spinning vsi_release called i40e_vsi_free_arrays where the vsi->tx_rings resources were freed and the pointer was set to NULL. Fixes: 5b6d4a7f20b0 ("i40e: Fix crash during removing i40e driver") Signed-off-by: Slawomir Laba Signed-off-by: Sylwester Dziedziuch Signed-off-by: Karen Sornek Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit c763ec4c10f78678d6d4415646237f07109a5a5f Author: John Garry Date: Mon Jan 31 19:13:27 2022 +0800 scsi: hisi_sas: Fix setting of hisi_sas_slot.is_internal The hisi_sas_slot.is_internal member is not set properly for ATA commands which the driver sends directly. A TMF struct pointer is normally used as a test to set this, but it is NULL for those commands. It's not ideal, but pass an empty TMF struct to set that member properly. Link: https://lore.kernel.org/r/1643627607-138785-1-git-send-email-john.garry@huawei.com Fixes: dc313f6b125b ("scsi: hisi_sas: Factor out task prep and delivery code") Reported-by: Xiang Chen Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit 1b777d4d9e383d2744fc9b3a09af6ec1893c8b1a Author: Nick Lopez Date: Sat Jan 22 01:19:06 2022 -0700 drm/nouveau: fix off by one in BIOS boundary checking Bounds checking when parsing init scripts embedded in the BIOS reject access to the last byte. This causes driver initialization to fail on Apple eMac's with GeForce 2 MX GPUs, leaving the system with no working console. This is probably only seen on OpenFirmware machines like PowerPC Macs because the BIOS image provided by OF is only the used parts of the ROM, not a power-of-two blocks read from PCI directly so PCs always have empty bytes at the end that are never accessed. Signed-off-by: Nick Lopez Fixes: 4d4e9907ff572 ("drm/nouveau/bios: guard against out-of-bounds accesses to image") Cc: # v4.10+ Reviewed-by: Ilia Mirkin Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://patchwork.freedesktop.org/patch/msgid/20220122081906.2633061-1-github@glowingmonkey.org commit df7abcaa1246e2537ab4016077b5443bb3c09378 Author: John Garry Date: Thu Jan 27 21:12:52 2022 +0800 scsi: pm8001: Fix use-after-free for aborted SSP/STP sas_task Currently a use-after-free may occur if a sas_task is aborted by the upper layer before we handle the I/O completion in mpi_ssp_completion() or mpi_sata_completion(). In this case, the following are the two steps in handling those I/O completions: - Call complete() to inform the upper layer handler of completion of the I/O. - Release driver resources associated with the sas_task in pm8001_ccb_task_free() call. When complete() is called, the upper layer may free the sas_task. As such, we should not touch the associated sas_task afterwards, but we do so in the pm8001_ccb_task_free() call. Fix by swapping the complete() and pm8001_ccb_task_free() calls ordering. Link: https://lore.kernel.org/r/1643289172-165636-4-git-send-email-john.garry@huawei.com Reviewed-by: Damien Le Moal Acked-by: Jack Wang Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit 61f162aa4381845acbdc7f2be4dfb694d027c018 Author: John Garry Date: Thu Jan 27 21:12:51 2022 +0800 scsi: pm8001: Fix use-after-free for aborted TMF sas_task Currently a use-after-free may occur if a TMF sas_task is aborted before we handle the IO completion in mpi_ssp_completion(). The abort occurs due to timeout. When the timeout occurs, the SAS_TASK_STATE_ABORTED flag is set and the sas_task is freed in pm8001_exec_internal_tmf_task(). However, if the I/O completion occurs later, the I/O completion still thinks that the sas_task is available. Fix this by clearing the ccb->task if the TMF times out - the I/O completion handler does nothing if this pointer is cleared. Link: https://lore.kernel.org/r/1643289172-165636-3-git-send-email-john.garry@huawei.com Reviewed-by: Damien Le Moal Acked-by: Jack Wang Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit 0aed75fd30dacd31144188f7ddd5d571db7511c5 Author: John Garry Date: Thu Jan 27 21:12:50 2022 +0800 scsi: pm8001: Fix warning for undescribed param in process_one_iomb() make W=1 complains of an undescribed function parameter: drivers/scsi/pm8001/pm80xx_hwi.c:3938: warning: Function parameter or member 'circularQ' not described in 'process_one_iomb' Fix it. Link: https://lore.kernel.org/r/1643289172-165636-2-git-send-email-john.garry@huawei.com Reported-by: Damien Le Moal Reviewed-by: Damien Le Moal Acked-by: Jack Wang Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit 3d2504663c41104b4359a15f35670cfa82de1bbf Author: Jedrzej Jagielski Date: Tue Dec 14 10:08:22 2021 +0000 i40e: Fix reset bw limit when DCB enabled with 1 TC There was an AQ error I40E_AQ_RC_EINVAL when trying to reset bw limit as part of bw allocation setup. This was caused by trying to reset bw limit with DCB enabled. Bw limit should not be reset when DCB is enabled. The code was relying on the pf->flags to check if DCB is enabled but if only 1 TC is available this flag will not be set even though DCB is enabled. Add a check for number of TC and if it is 1 don't try to reset bw limit even if pf->flags shows DCB as disabled. Fixes: fa38e30ac73f ("i40e: Fix for Tx timeouts when interface is brought up if DCB is enabled") Suggested-by: Alexander Lobakin # Flatten the condition Signed-off-by: Sylwester Dziedziuch Signed-off-by: Jedrzej Jagielski Reviewed-by: Alexander Lobakin Tested-by: Imam Hassan Reza Biswas Signed-off-by: Tony Nguyen commit 29d650f7e3ab55283b89c9f5883d0c256ce478b5 Author: Darrick J. Wong Date: Mon Jan 24 15:48:31 2022 -0800 xfs: reject crazy array sizes being fed to XFS_IOC_GETBMAP* Syzbot tripped over the following complaint from the kernel: WARNING: CPU: 2 PID: 15402 at mm/util.c:597 kvmalloc_node+0x11e/0x125 mm/util.c:597 While trying to run XFS_IOC_GETBMAP against the following structure: struct getbmap fubar = { .bmv_count = 0x22dae649, }; Obviously, this is a crazy huge value since the next thing that the ioctl would do is allocate 37GB of memory. This is enough to make kvmalloc mad, but isn't large enough to trip the validation functions. In other words, I'm fussing with checks that were **already sufficient** because that's easier than dealing with 644 internal bug reports. Yes, that's right, six hundred and forty-four. Signed-off-by: Darrick J. Wong Reviewed-by: Allison Henderson Reviewed-by: Catherine Hoang commit 04662bac0067e2fd7f243d6abaa4d779bce14114 Author: Randy Dunlap Date: Sun Jan 30 14:38:18 2022 -0800 ACPI: require CRC32 to build ACPI core now requires crc32() but the kernel build can fail when CRC32 is not set/enabled, so select it in the ACPI Kconfig entry. Fixes this build error: ia64-linux-ld: drivers/acpi/scan.o: in function `acpi_store_pld_crc': include/acpi/platform/aclinuxex.h:62: undefined reference to `crc32_le' Fixes: 882c982dada4 ("acpi: Store CRC-32 hash of the _PLD in struct acpi_device") Signed-off-by: Randy Dunlap Reported-by: Guenter Roeck Reviewed-by: Guenter Roeck Tested-by: Guenter Roeck Signed-off-by: Rafael J. Wysocki commit edb854a3680bacc9ef9b91ec0c5ff6105886f6f3 Author: Ming Lei Date: Thu Jan 27 23:37:33 2022 +0800 scsi: core: Reallocate device's budget map on queue depth change We currently use ->cmd_per_lun as initial queue depth for setting up the budget_map. Martin Wilck reported that it is common for the queue_depth to be subsequently updated in slave_configure() based on detected hardware characteristics. As a result, for some drivers, the static host template settings for cmd_per_lun and can_queue won't actually get used in practice. And if the default values are used to allocate the budget_map, memory may be consumed unnecessarily. Fix the issue by reallocating the budget_map after ->slave_configure() returns. At that time the device queue_depth should accurately reflect what the hardware needs. Link: https://lore.kernel.org/r/20220127153733.409132-1-ming.lei@redhat.com Cc: Bart Van Assche Reported-by: Martin Wilck Suggested-by: Martin Wilck Tested-by: Martin Wilck Reviewed-by: Martin Wilck Reviewed-by: Bart Van Assche Signed-off-by: Ming Lei Signed-off-by: Martin K. Petersen commit ec049891b2dc16591813eacaddc476b3d27c8c14 Author: Vincenzo Frascino Date: Mon Jan 31 11:34:05 2022 +0000 kselftest: Fix vdso_test_abi return status vdso_test_abi contains a batch of tests that verify the validity of the vDSO ABI. When a vDSO symbol is not found the relevant test is skipped reporting KSFT_SKIP. All the tests return values are then added in a single variable which is checked to verify failures. This approach can have side effects which result in reporting the wrong kselftest exit status. Fix vdso_test_abi verifying the return code of each test separately. Cc: Shuah Khan Cc: Andy Lutomirski Cc: Thomas Gleixner Reported-by: Cristian Marussi Signed-off-by: Vincenzo Frascino Signed-off-by: Shuah Khan commit 936bd03405fc83ba039d42bc93ffd4b88418f1d3 Author: John Meneghini Date: Mon Jan 24 09:51:10 2022 -0500 scsi: bnx2fc: Make bnx2fc_recv_frame() mp safe Running tests with a debug kernel shows that bnx2fc_recv_frame() is modifying the per_cpu lport stats counters in a non-mpsafe way. Just boot a debug kernel and run the bnx2fc driver with the hardware enabled. [ 1391.699147] BUG: using smp_processor_id() in preemptible [00000000] code: bnx2fc_ [ 1391.699160] caller is bnx2fc_recv_frame+0xbf9/0x1760 [bnx2fc] [ 1391.699174] CPU: 2 PID: 4355 Comm: bnx2fc_l2_threa Kdump: loaded Tainted: G B [ 1391.699180] Hardware name: HP ProLiant DL120 G7, BIOS J01 07/01/2013 [ 1391.699183] Call Trace: [ 1391.699188] dump_stack_lvl+0x57/0x7d [ 1391.699198] check_preemption_disabled+0xc8/0xd0 [ 1391.699205] bnx2fc_recv_frame+0xbf9/0x1760 [bnx2fc] [ 1391.699215] ? do_raw_spin_trylock+0xb5/0x180 [ 1391.699221] ? bnx2fc_npiv_create_vports.isra.0+0x4e0/0x4e0 [bnx2fc] [ 1391.699229] ? bnx2fc_l2_rcv_thread+0xb7/0x3a0 [bnx2fc] [ 1391.699240] bnx2fc_l2_rcv_thread+0x1af/0x3a0 [bnx2fc] [ 1391.699250] ? bnx2fc_ulp_init+0xc0/0xc0 [bnx2fc] [ 1391.699258] kthread+0x364/0x420 [ 1391.699263] ? _raw_spin_unlock_irq+0x24/0x50 [ 1391.699268] ? set_kthread_struct+0x100/0x100 [ 1391.699273] ret_from_fork+0x22/0x30 Restore the old get_cpu/put_cpu code with some modifications to reduce the size of the critical section. Link: https://lore.kernel.org/r/20220124145110.442335-1-jmeneghi@redhat.com Fixes: d576a5e80cd0 ("bnx2fc: Improve stats update mechanism") Tested-by: Guangwu Zhang Acked-by: Saurav Kashyap Signed-off-by: John Meneghini Signed-off-by: Martin K. Petersen commit c26b85ea16365079be8d206b20556a60a0c69ad4 Author: Ajish Koshy Date: Mon Jan 24 13:52:55 2022 +0530 scsi: pm80xx: Fix double completion for SATA devices Current code handles completions for SATA devices in mpi_sata_completion() and mpi_sata_event(). However, at the time when any SATA event happens, for almost all the event types, the command is still in the target. It is therefore incorrect to complete the task in sata_event(). There are some events for which we get sata_completions, some need recovery procedure and others abort. All the tasks must be completed via sata_completion() path. Removed the task done related code from sata_events(). For tasks where we don't get completions, let top layer call abort() to abort the command post timeout. Link: https://lore.kernel.org/r/20220124082255.86223-1-Ajish.Koshy@microchip.com Acked-by: Jack Wang Co-developed-by: Viswas G Signed-off-by: Viswas G Signed-off-by: Ajish Koshy Signed-off-by: Martin K. Petersen commit 36415a7964711822e63695ea67fede63979054d9 Author: david regan Date: Wed Jan 26 23:43:44 2022 +0100 mtd: rawnand: brcmnand: Fixed incorrect sub-page ECC status The brcmnand driver contains a bug in which if a page (example 2k byte) is read from the parallel/ONFI NAND and within that page a subpage (512 byte) has correctable errors which is followed by a subpage with uncorrectable errors, the page read will return the wrong status of correctable (as opposed to the actual status of uncorrectable.) The bug is in function brcmnand_read_by_pio where there is a check for uncorrectable bits which will be preempted if a previous status for correctable bits is detected. The fix is to stop checking for bad bits only if we already have a bad bits status. Fixes: 27c5b17cd1b1 ("mtd: nand: add NAND driver "library" for Broadcom STB NAND controller") Signed-off-by: david regan Reviewed-by: Florian Fainelli Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/trinity-478e0c09-9134-40e8-8f8c-31c371225eda-1643237024774@3c-app-mailcom-lxa02 commit fcda1cb81663b5fb846803607e1d0a3180d1a5d4 Author: Kalle Valo Date: Fri Jan 28 15:58:41 2022 +0200 MAINTAINERS: add DT bindings files for ath10k and ath11k The DT bindings files were missing for ath10k and ath11k so add them now. Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220128135841.1926-4-kvalo@kernel.org commit e2ac75e0619b8db32447bb592f4a5b9e9d990c57 Author: Kalle Valo Date: Fri Jan 28 15:58:40 2022 +0200 MAINTAINERS: hand over ath9k maintainership to Toke In practise I have been the only maintainer for ath9k for some time now but I don't really have time for it. Luckily Toke is willing to look after so mark him as maintainer. Thanks Toke! Signed-off-by: Kalle Valo Acked-by: Toke Høiland-Jørgensen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220128135841.1926-3-kvalo@kernel.org commit 3451613c338bfecb3e037f79db4bbfa51f7a0236 Author: Kalle Valo Date: Fri Jan 28 15:58:39 2022 +0200 MAINTAINERS: change Loic as wcn36xx maintainer I don't have time for being wcn36xx maintainer but Loic is willing to step up. Thanks Loic! Also remove Eugene's old tree, it has not been used for a long time. Signed-off-by: Kalle Valo Acked-by: Loic Poulain Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220128135841.1926-2-kvalo@kernel.org commit 533da5077b63485ba88f5bb03fd6a93048a9a72d Author: Kalle Valo Date: Fri Jan 28 15:58:38 2022 +0200 MAINTAINERS: mark ath6kl as orphan I don't have time to maintain ath6kl anymore so mark it as orphan. Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220128135841.1926-1-kvalo@kernel.org commit 99e675d473eb8cf2deac1376a0f840222fc1adcf Author: Guoqing Jiang Date: Fri Jan 28 11:10:02 2022 +0800 iommu/vt-d: Fix potential memory leak in intel_setup_irq_remapping() After commit e3beca48a45b ("irqdomain/treewide: Keep firmware node unconditionally allocated"). For tear down scenario, fn is only freed after fail to allocate ir_domain, though it also should be freed in case dmar_enable_qi returns error. Besides free fn, irq_domain and ir_msi_domain need to be removed as well if intel_setup_irq_remapping fails to enable queued invalidation. Improve the rewinding path by add out_free_ir_domain and out_free_fwnode lables per Baolu's suggestion. Fixes: e3beca48a45b ("irqdomain/treewide: Keep firmware node unconditionally allocated") Suggested-by: Lu Baolu Signed-off-by: Guoqing Jiang Link: https://lore.kernel.org/r/20220119063640.16864-1-guoqing.jiang@linux.dev Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20220128031002.2219155-3-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 30209b93177a75843673de92771716c941c20ef5 Author: John Garry Date: Fri Jan 28 18:44:33 2022 +0800 iommu: Fix some W=1 warnings The code is mostly free of W=1 warning, so fix the following: drivers/iommu/iommu.c:996: warning: expecting prototype for iommu_group_for_each_dev(). Prototype was for __iommu_group_for_each_dev() instead drivers/iommu/iommu.c:3048: warning: Function parameter or member 'drvdata' not described in 'iommu_sva_bind_device' drivers/iommu/ioasid.c:354: warning: Function parameter or member 'ioasid' not described in 'ioasid_get' drivers/iommu/omap-iommu.c:1098: warning: expecting prototype for omap_iommu_suspend_prepare(). Prototype was for omap_iommu_prepare() instead Signed-off-by: John Garry Reviewed-by: Robin Murphy Link: https://lore.kernel.org/r/1643366673-26803-1-git-send-email-john.garry@huawei.com Signed-off-by: Joerg Roedel commit b54240ad494300ff0994c4539a531727874381f4 Author: Vijayanand Jitta Date: Mon Jan 31 12:42:35 2022 +0530 iommu: Fix potential use-after-free during probe Kasan has reported the following use after free on dev->iommu. when a device probe fails and it is in process of freeing dev->iommu in dev_iommu_free function, a deferred_probe_work_func runs in parallel and tries to access dev->iommu->fwspec in of_iommu_configure path thus causing use after free. BUG: KASAN: use-after-free in of_iommu_configure+0xb4/0x4a4 Read of size 8 at addr ffffff87a2f1acb8 by task kworker/u16:2/153 Workqueue: events_unbound deferred_probe_work_func Call trace: dump_backtrace+0x0/0x33c show_stack+0x18/0x24 dump_stack_lvl+0x16c/0x1e0 print_address_description+0x84/0x39c __kasan_report+0x184/0x308 kasan_report+0x50/0x78 __asan_load8+0xc0/0xc4 of_iommu_configure+0xb4/0x4a4 of_dma_configure_id+0x2fc/0x4d4 platform_dma_configure+0x40/0x5c really_probe+0x1b4/0xb74 driver_probe_device+0x11c/0x228 __device_attach_driver+0x14c/0x304 bus_for_each_drv+0x124/0x1b0 __device_attach+0x25c/0x334 device_initial_probe+0x24/0x34 bus_probe_device+0x78/0x134 deferred_probe_work_func+0x130/0x1a8 process_one_work+0x4c8/0x970 worker_thread+0x5c8/0xaec kthread+0x1f8/0x220 ret_from_fork+0x10/0x18 Allocated by task 1: ____kasan_kmalloc+0xd4/0x114 __kasan_kmalloc+0x10/0x1c kmem_cache_alloc_trace+0xe4/0x3d4 __iommu_probe_device+0x90/0x394 probe_iommu_group+0x70/0x9c bus_for_each_dev+0x11c/0x19c bus_iommu_probe+0xb8/0x7d4 bus_set_iommu+0xcc/0x13c arm_smmu_bus_init+0x44/0x130 [arm_smmu] arm_smmu_device_probe+0xb88/0xc54 [arm_smmu] platform_drv_probe+0xe4/0x13c really_probe+0x2c8/0xb74 driver_probe_device+0x11c/0x228 device_driver_attach+0xf0/0x16c __driver_attach+0x80/0x320 bus_for_each_dev+0x11c/0x19c driver_attach+0x38/0x48 bus_add_driver+0x1dc/0x3a4 driver_register+0x18c/0x244 __platform_driver_register+0x88/0x9c init_module+0x64/0xff4 [arm_smmu] do_one_initcall+0x17c/0x2f0 do_init_module+0xe8/0x378 load_module+0x3f80/0x4a40 __se_sys_finit_module+0x1a0/0x1e4 __arm64_sys_finit_module+0x44/0x58 el0_svc_common+0x100/0x264 do_el0_svc+0x38/0xa4 el0_svc+0x20/0x30 el0_sync_handler+0x68/0xac el0_sync+0x160/0x180 Freed by task 1: kasan_set_track+0x4c/0x84 kasan_set_free_info+0x28/0x4c ____kasan_slab_free+0x120/0x15c __kasan_slab_free+0x18/0x28 slab_free_freelist_hook+0x204/0x2fc kfree+0xfc/0x3a4 __iommu_probe_device+0x284/0x394 probe_iommu_group+0x70/0x9c bus_for_each_dev+0x11c/0x19c bus_iommu_probe+0xb8/0x7d4 bus_set_iommu+0xcc/0x13c arm_smmu_bus_init+0x44/0x130 [arm_smmu] arm_smmu_device_probe+0xb88/0xc54 [arm_smmu] platform_drv_probe+0xe4/0x13c really_probe+0x2c8/0xb74 driver_probe_device+0x11c/0x228 device_driver_attach+0xf0/0x16c __driver_attach+0x80/0x320 bus_for_each_dev+0x11c/0x19c driver_attach+0x38/0x48 bus_add_driver+0x1dc/0x3a4 driver_register+0x18c/0x244 __platform_driver_register+0x88/0x9c init_module+0x64/0xff4 [arm_smmu] do_one_initcall+0x17c/0x2f0 do_init_module+0xe8/0x378 load_module+0x3f80/0x4a40 __se_sys_finit_module+0x1a0/0x1e4 __arm64_sys_finit_module+0x44/0x58 el0_svc_common+0x100/0x264 do_el0_svc+0x38/0xa4 el0_svc+0x20/0x30 el0_sync_handler+0x68/0xac el0_sync+0x160/0x180 Fix this by setting dev->iommu to NULL first and then freeing dev_iommu structure in dev_iommu_free function. Suggested-by: Robin Murphy Signed-off-by: Vijayanand Jitta Link: https://lore.kernel.org/r/1643613155-20215-1-git-send-email-quic_vjitta@quicinc.com Signed-off-by: Joerg Roedel commit f83a96e5f033fbbd21764705cb9c04234b96218e Author: Benjamin Gaignard Date: Mon Jan 31 15:17:08 2022 +0100 spi: mediatek: Avoid NULL pointer crash in interrupt In some case, like after a transfer timeout, master->cur_msg pointer is NULL which led to a kernel crash when trying to use master->cur_msg->spi. mtk_spi_can_dma(), pointed by master->can_dma, doesn't use this parameter avoid the problem by setting NULL as second parameter. Fixes: a568231f46322 ("spi: mediatek: Add spi bus for Mediatek MT8173") Signed-off-by: Benjamin Gaignard Link: https://lore.kernel.org/r/20220131141708.888710-1-benjamin.gaignard@collabora.com Signed-off-by: Mark Brown commit 40cdc509877bacb438213b83c7541c5e24a1d9ec Author: Filipe Manana Date: Tue Jan 18 13:39:34 2022 +0000 btrfs: skip reserved bytes warning on unmount after log cleanup failure After the recent changes made by commit c2e39305299f01 ("btrfs: clear extent buffer uptodate when we fail to write it") and its followup fix, commit 651740a5024117 ("btrfs: check WRITE_ERR when trying to read an extent buffer"), we can now end up not cleaning up space reservations of log tree extent buffers after a transaction abort happens, as well as not cleaning up still dirty extent buffers. This happens because if writeback for a log tree extent buffer failed, then we have cleared the bit EXTENT_BUFFER_UPTODATE from the extent buffer and we have also set the bit EXTENT_BUFFER_WRITE_ERR on it. Later on, when trying to free the log tree with free_log_tree(), which iterates over the tree, we can end up getting an -EIO error when trying to read a node or a leaf, since read_extent_buffer_pages() returns -EIO if an extent buffer does not have EXTENT_BUFFER_UPTODATE set and has the EXTENT_BUFFER_WRITE_ERR bit set. Getting that -EIO means that we return immediately as we can not iterate over the entire tree. In that case we never update the reserved space for an extent buffer in the respective block group and space_info object. When this happens we get the following traces when unmounting the fs: [174957.284509] BTRFS: error (device dm-0) in cleanup_transaction:1913: errno=-5 IO failure [174957.286497] BTRFS: error (device dm-0) in free_log_tree:3420: errno=-5 IO failure [174957.399379] ------------[ cut here ]------------ [174957.402497] WARNING: CPU: 2 PID: 3206883 at fs/btrfs/block-group.c:127 btrfs_put_block_group+0x77/0xb0 [btrfs] [174957.407523] Modules linked in: btrfs overlay dm_zero (...) [174957.424917] CPU: 2 PID: 3206883 Comm: umount Tainted: G W 5.16.0-rc5-btrfs-next-109 #1 [174957.426689] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 [174957.428716] RIP: 0010:btrfs_put_block_group+0x77/0xb0 [btrfs] [174957.429717] Code: 21 48 8b bd (...) [174957.432867] RSP: 0018:ffffb70d41cffdd0 EFLAGS: 00010206 [174957.433632] RAX: 0000000000000001 RBX: ffff8b09c3848000 RCX: ffff8b0758edd1c8 [174957.434689] RDX: 0000000000000001 RSI: ffffffffc0b467e7 RDI: ffff8b0758edd000 [174957.436068] RBP: ffff8b0758edd000 R08: 0000000000000000 R09: 0000000000000000 [174957.437114] R10: 0000000000000246 R11: 0000000000000000 R12: ffff8b09c3848148 [174957.438140] R13: ffff8b09c3848198 R14: ffff8b0758edd188 R15: dead000000000100 [174957.439317] FS: 00007f328fb82800(0000) GS:ffff8b0a2d200000(0000) knlGS:0000000000000000 [174957.440402] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [174957.441164] CR2: 00007fff13563e98 CR3: 0000000404f4e005 CR4: 0000000000370ee0 [174957.442117] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [174957.443076] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [174957.443948] Call Trace: [174957.444264] [174957.444538] btrfs_free_block_groups+0x255/0x3c0 [btrfs] [174957.445238] close_ctree+0x301/0x357 [btrfs] [174957.445803] ? call_rcu+0x16c/0x290 [174957.446250] generic_shutdown_super+0x74/0x120 [174957.446832] kill_anon_super+0x14/0x30 [174957.447305] btrfs_kill_super+0x12/0x20 [btrfs] [174957.447890] deactivate_locked_super+0x31/0xa0 [174957.448440] cleanup_mnt+0x147/0x1c0 [174957.448888] task_work_run+0x5c/0xa0 [174957.449336] exit_to_user_mode_prepare+0x1e5/0x1f0 [174957.449934] syscall_exit_to_user_mode+0x16/0x40 [174957.450512] do_syscall_64+0x48/0xc0 [174957.450980] entry_SYSCALL_64_after_hwframe+0x44/0xae [174957.451605] RIP: 0033:0x7f328fdc4a97 [174957.452059] Code: 03 0c 00 f7 (...) [174957.454320] RSP: 002b:00007fff13564ec8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6 [174957.455262] RAX: 0000000000000000 RBX: 00007f328feea264 RCX: 00007f328fdc4a97 [174957.456131] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000560b8ae51dd0 [174957.457118] RBP: 0000560b8ae51ba0 R08: 0000000000000000 R09: 00007fff13563c40 [174957.458005] R10: 00007f328fe49fc0 R11: 0000000000000246 R12: 0000000000000000 [174957.459113] R13: 0000560b8ae51dd0 R14: 0000560b8ae51cb0 R15: 0000000000000000 [174957.460193] [174957.460534] irq event stamp: 0 [174957.461003] hardirqs last enabled at (0): [<0000000000000000>] 0x0 [174957.461947] hardirqs last disabled at (0): [] copy_process+0x934/0x2040 [174957.463147] softirqs last enabled at (0): [] copy_process+0x934/0x2040 [174957.465116] softirqs last disabled at (0): [<0000000000000000>] 0x0 [174957.466323] ---[ end trace bc7ee0c490bce3af ]--- [174957.467282] ------------[ cut here ]------------ [174957.468184] WARNING: CPU: 2 PID: 3206883 at fs/btrfs/block-group.c:3976 btrfs_free_block_groups+0x330/0x3c0 [btrfs] [174957.470066] Modules linked in: btrfs overlay dm_zero (...) [174957.483137] CPU: 2 PID: 3206883 Comm: umount Tainted: G W 5.16.0-rc5-btrfs-next-109 #1 [174957.484691] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 [174957.486853] RIP: 0010:btrfs_free_block_groups+0x330/0x3c0 [btrfs] [174957.488050] Code: 00 00 00 ad de (...) [174957.491479] RSP: 0018:ffffb70d41cffde0 EFLAGS: 00010206 [174957.492520] RAX: ffff8b08d79310b0 RBX: ffff8b09c3848000 RCX: 0000000000000000 [174957.493868] RDX: 0000000000000001 RSI: fffff443055ee600 RDI: ffffffffb1131846 [174957.495183] RBP: ffff8b08d79310b0 R08: 0000000000000000 R09: 0000000000000000 [174957.496580] R10: 0000000000000001 R11: 0000000000000000 R12: ffff8b08d7931000 [174957.498027] R13: ffff8b09c38492b0 R14: dead000000000122 R15: dead000000000100 [174957.499438] FS: 00007f328fb82800(0000) GS:ffff8b0a2d200000(0000) knlGS:0000000000000000 [174957.500990] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [174957.502117] CR2: 00007fff13563e98 CR3: 0000000404f4e005 CR4: 0000000000370ee0 [174957.503513] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [174957.504864] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [174957.506167] Call Trace: [174957.506654] [174957.507047] close_ctree+0x301/0x357 [btrfs] [174957.507867] ? call_rcu+0x16c/0x290 [174957.508567] generic_shutdown_super+0x74/0x120 [174957.509447] kill_anon_super+0x14/0x30 [174957.510194] btrfs_kill_super+0x12/0x20 [btrfs] [174957.511123] deactivate_locked_super+0x31/0xa0 [174957.511976] cleanup_mnt+0x147/0x1c0 [174957.512610] task_work_run+0x5c/0xa0 [174957.513309] exit_to_user_mode_prepare+0x1e5/0x1f0 [174957.514231] syscall_exit_to_user_mode+0x16/0x40 [174957.515069] do_syscall_64+0x48/0xc0 [174957.515718] entry_SYSCALL_64_after_hwframe+0x44/0xae [174957.516688] RIP: 0033:0x7f328fdc4a97 [174957.517413] Code: 03 0c 00 f7 d8 (...) [174957.521052] RSP: 002b:00007fff13564ec8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6 [174957.522514] RAX: 0000000000000000 RBX: 00007f328feea264 RCX: 00007f328fdc4a97 [174957.523950] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000560b8ae51dd0 [174957.525375] RBP: 0000560b8ae51ba0 R08: 0000000000000000 R09: 00007fff13563c40 [174957.526763] R10: 00007f328fe49fc0 R11: 0000000000000246 R12: 0000000000000000 [174957.528058] R13: 0000560b8ae51dd0 R14: 0000560b8ae51cb0 R15: 0000000000000000 [174957.529404] [174957.529843] irq event stamp: 0 [174957.530256] hardirqs last enabled at (0): [<0000000000000000>] 0x0 [174957.531061] hardirqs last disabled at (0): [] copy_process+0x934/0x2040 [174957.532075] softirqs last enabled at (0): [] copy_process+0x934/0x2040 [174957.533083] softirqs last disabled at (0): [<0000000000000000>] 0x0 [174957.533865] ---[ end trace bc7ee0c490bce3b0 ]--- [174957.534452] BTRFS info (device dm-0): space_info 4 has 1070841856 free, is not full [174957.535404] BTRFS info (device dm-0): space_info total=1073741824, used=2785280, pinned=0, reserved=49152, may_use=0, readonly=65536 zone_unusable=0 [174957.537029] BTRFS info (device dm-0): global_block_rsv: size 0 reserved 0 [174957.537859] BTRFS info (device dm-0): trans_block_rsv: size 0 reserved 0 [174957.538697] BTRFS info (device dm-0): chunk_block_rsv: size 0 reserved 0 [174957.539552] BTRFS info (device dm-0): delayed_block_rsv: size 0 reserved 0 [174957.540403] BTRFS info (device dm-0): delayed_refs_rsv: size 0 reserved 0 This also means that in case we have log tree extent buffers that are still dirty, we can end up not cleaning them up in case we find an extent buffer with EXTENT_BUFFER_WRITE_ERR set on it, as in that case we have no way for iterating over the rest of the tree. This issue is very often triggered with test cases generic/475 and generic/648 from fstests. The issue could almost be fixed by iterating over the io tree attached to each log root which keeps tracks of the range of allocated extent buffers, log_root->dirty_log_pages, however that does not work and has some inconveniences: 1) After we sync the log, we clear the range of the extent buffers from the io tree, so we can't find them after writeback. We could keep the ranges in the io tree, with a separate bit to signal they represent extent buffers already written, but that means we need to hold into more memory until the transaction commits. How much more memory is used depends a lot on whether we are able to allocate contiguous extent buffers on disk (and how often) for a log tree - if we are able to, then a single extent state record can represent multiple extent buffers, otherwise we need multiple extent state record structures to track each extent buffer. In fact, my earlier approach did that: https://lore.kernel.org/linux-btrfs/3aae7c6728257c7ce2279d6660ee2797e5e34bbd.1641300250.git.fdmanana@suse.com/ However that can cause a very significant negative impact on performance, not only due to the extra memory usage but also because we get a larger and deeper dirty_log_pages io tree. We got a report that, on beefy machines at least, we can get such performance drop with fsmark for example: https://lore.kernel.org/linux-btrfs/20220117082426.GE32491@xsang-OptiPlex-9020/ 2) We would be doing it only to deal with an unexpected and exceptional case, which is basically failure to read an extent buffer from disk due to IO failures. On a healthy system we don't expect transaction aborts to happen after all; 3) Instead of relying on iterating the log tree or tracking the ranges of extent buffers in the dirty_log_pages io tree, using the radix tree that tracks extent buffers (fs_info->buffer_radix) to find all log tree extent buffers is not reliable either, because after writeback of an extent buffer it can be evicted from memory by the release page callback of the btree inode (btree_releasepage()). Since there's no way to be able to properly cleanup a log tree without being able to read its extent buffers from disk and without using more memory to track the logical ranges of the allocated extent buffers do the following: 1) When we fail to cleanup a log tree, setup a flag that indicates that failure; 2) Trigger writeback of all log tree extent buffers that are still dirty, and wait for the writeback to complete. This is just to cleanup their state, page states, page leaks, etc; 3) When unmounting the fs, ignore if the number of bytes reserved in a block group and in a space_info is not 0 if, and only if, we failed to cleanup a log tree. Also ignore only for metadata block groups and the metadata space_info object. This is far from a perfect solution, but it serves to silence test failures such as those from generic/475 and generic/648. However having a non-zero value for the reserved bytes counters on unmount after a transaction abort, is not such a terrible thing and it's completely harmless, it does not affect the filesystem integrity in any way. Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 37b4599547e324589e011c20f74b021d6d25cb7f Author: Tom Rix Date: Fri Jan 21 05:45:22 2022 -0800 btrfs: fix use of uninitialized variable at rm device ioctl Clang static analysis reports this problem ioctl.c:3333:8: warning: 3rd function call argument is an uninitialized value ret = exclop_start_or_cancel_reloc(fs_info, cancel is only set in one branch of an if-check and is always used. So initialize to false. Fixes: 1a15eb724aae ("btrfs: use btrfs_get_dev_args_from_path in dev removal ioctls") Reviewed-by: Filipe Manana Reviewed-by: Anand Jain Signed-off-by: Tom Rix Signed-off-by: David Sterba commit 28b21c558a3753171097193b6f6602a94169093a Author: Filipe Manana Date: Fri Jan 21 15:44:39 2022 +0000 btrfs: fix use-after-free after failure to create a snapshot At ioctl.c:create_snapshot(), we allocate a pending snapshot structure and then attach it to the transaction's list of pending snapshots. After that we call btrfs_commit_transaction(), and if that returns an error we jump to 'fail' label, where we kfree() the pending snapshot structure. This can result in a later use-after-free of the pending snapshot: 1) We allocated the pending snapshot and added it to the transaction's list of pending snapshots; 2) We call btrfs_commit_transaction(), and it fails either at the first call to btrfs_run_delayed_refs() or btrfs_start_dirty_block_groups(). In both cases, we don't abort the transaction and we release our transaction handle. We jump to the 'fail' label and free the pending snapshot structure. We return with the pending snapshot still in the transaction's list; 3) Another task commits the transaction. This time there's no error at all, and then during the transaction commit it accesses a pointer to the pending snapshot structure that the snapshot creation task has already freed, resulting in a user-after-free. This issue could actually be detected by smatch, which produced the following warning: fs/btrfs/ioctl.c:843 create_snapshot() warn: '&pending_snapshot->list' not removed from list So fix this by not having the snapshot creation ioctl directly add the pending snapshot to the transaction's list. Instead add the pending snapshot to the transaction handle, and then at btrfs_commit_transaction() we add the snapshot to the list only when we can guarantee that any error returned after that point will result in a transaction abort, in which case the ioctl code can safely free the pending snapshot and no one can access it anymore. CC: stable@vger.kernel.org # 5.10+ Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit ea1d1ca4025ac6c075709f549f9aa036b5b6597d Author: Su Yue Date: Fri Jan 21 17:33:35 2022 +0800 btrfs: tree-checker: check item_size for dev_item Check item size before accessing the device item to avoid out of bound access, similar to inode_item check. Signed-off-by: Su Yue Reviewed-by: David Sterba Signed-off-by: David Sterba commit 0c982944af27d131d3b74242f3528169f66950ad Author: Su Yue Date: Fri Jan 21 17:33:34 2022 +0800 btrfs: tree-checker: check item_size for inode_item while mounting the crafted image, out-of-bounds access happens: [350.429619] UBSAN: array-index-out-of-bounds in fs/btrfs/struct-funcs.c:161:1 [350.429636] index 1048096 is out of range for type 'page *[16]' [350.429650] CPU: 0 PID: 9 Comm: kworker/u8:1 Not tainted 5.16.0-rc4 #1 [350.429652] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-1ubuntu1.1 04/01/2014 [350.429653] Workqueue: btrfs-endio-meta btrfs_work_helper [btrfs] [350.429772] Call Trace: [350.429774] [350.429776] dump_stack_lvl+0x47/0x5c [350.429780] ubsan_epilogue+0x5/0x50 [350.429786] __ubsan_handle_out_of_bounds+0x66/0x70 [350.429791] btrfs_get_16+0xfd/0x120 [btrfs] [350.429832] check_leaf+0x754/0x1a40 [btrfs] [350.429874] ? filemap_read+0x34a/0x390 [350.429878] ? load_balance+0x175/0xfc0 [350.429881] validate_extent_buffer+0x244/0x310 [btrfs] [350.429911] btrfs_validate_metadata_buffer+0xf8/0x100 [btrfs] [350.429935] end_bio_extent_readpage+0x3af/0x850 [btrfs] [350.429969] ? newidle_balance+0x259/0x480 [350.429972] end_workqueue_fn+0x29/0x40 [btrfs] [350.429995] btrfs_work_helper+0x71/0x330 [btrfs] [350.430030] ? __schedule+0x2fb/0xa40 [350.430033] process_one_work+0x1f6/0x400 [350.430035] ? process_one_work+0x400/0x400 [350.430036] worker_thread+0x2d/0x3d0 [350.430037] ? process_one_work+0x400/0x400 [350.430038] kthread+0x165/0x190 [350.430041] ? set_kthread_struct+0x40/0x40 [350.430043] ret_from_fork+0x1f/0x30 [350.430047] [350.430077] BTRFS warning (device loop0): bad eb member start: ptr 0xffe20f4e start 20975616 member offset 4293005178 size 2 check_leaf() is checking the leaf: corrupt leaf: root=4 block=29396992 slot=1, bad key order, prev (16140901064495857664 1 0) current (1 204 12582912) leaf 29396992 items 6 free space 3565 generation 6 owner DEV_TREE leaf 29396992 flags 0x1(WRITTEN) backref revision 1 fs uuid a62e00e8-e94e-4200-8217-12444de93c2e chunk uuid cecbd0f7-9ca0-441e-ae9f-f782f9732bd8 item 0 key (16140901064495857664 INODE_ITEM 0) itemoff 3955 itemsize 40 generation 0 transid 0 size 0 nbytes 17592186044416 block group 0 mode 52667 links 33 uid 0 gid 2104132511 rdev 94223634821136 sequence 100305 flags 0x2409000(none) atime 0.0 (1970-01-01 08:00:00) ctime 2973280098083405823.4294967295 (-269783007-01-01 21:37:03) mtime 18446744071572723616.4026825121 (1902-04-16 12:40:00) otime 9249929404488876031.4294967295 (622322949-04-16 04:25:58) item 1 key (1 DEV_EXTENT 12582912) itemoff 3907 itemsize 48 dev extent chunk_tree 3 chunk_objectid 256 chunk_offset 12582912 length 8388608 chunk_tree_uuid cecbd0f7-9ca0-441e-ae9f-f782f9732bd8 The corrupted leaf of device tree has an inode item. The leaf passed checksum and others checks in validate_extent_buffer until check_leaf_item(). Because of the key type BTRFS_INODE_ITEM, check_inode_item() is called even we are in the device tree. Since the item offset + sizeof(struct btrfs_inode_item) > eb->len, out-of-bounds access is triggered. The item end vs leaf boundary check has been done before check_leaf_item(), so fix it by checking item size in check_inode_item() before access of the inode item in extent buffer. Other check functions except check_dev_item() in check_leaf_item() have their item size checks. The commit for check_dev_item() is followed. No regression observed during running fstests. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=215299 CC: stable@vger.kernel.org # 5.10+ CC: Wenqing Liu Signed-off-by: Su Yue Reviewed-by: David Sterba Signed-off-by: David Sterba commit e804861bd4e69cc5fe1053eedcb024982dde8e48 Author: Shin'ichiro Kawasaki Date: Thu Jan 20 20:09:16 2022 +0900 btrfs: fix deadlock between quota disable and qgroup rescan worker Quota disable ioctl starts a transaction before waiting for the qgroup rescan worker completes. However, this wait can be infinite and results in deadlock because of circular dependency among the quota disable ioctl, the qgroup rescan worker and the other task with transaction such as block group relocation task. The deadlock happens with the steps following: 1) Task A calls ioctl to disable quota. It starts a transaction and waits for qgroup rescan worker completes. 2) Task B such as block group relocation task starts a transaction and joins to the transaction that task A started. Then task B commits to the transaction. In this commit, task B waits for a commit by task A. 3) Task C as the qgroup rescan worker starts its job and starts a transaction. In this transaction start, task C waits for completion of the transaction that task A started and task B committed. This deadlock was found with fstests test case btrfs/115 and a zoned null_blk device. The test case enables and disables quota, and the block group reclaim was triggered during the quota disable by chance. The deadlock was also observed by running quota enable and disable in parallel with 'btrfs balance' command on regular null_blk devices. An example report of the deadlock: [372.469894] INFO: task kworker/u16:6:103 blocked for more than 122 seconds. [372.479944] Not tainted 5.16.0-rc8 #7 [372.485067] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [372.493898] task:kworker/u16:6 state:D stack: 0 pid: 103 ppid: 2 flags:0x00004000 [372.503285] Workqueue: btrfs-qgroup-rescan btrfs_work_helper [btrfs] [372.510782] Call Trace: [372.514092] [372.521684] __schedule+0xb56/0x4850 [372.530104] ? io_schedule_timeout+0x190/0x190 [372.538842] ? lockdep_hardirqs_on+0x7e/0x100 [372.547092] ? _raw_spin_unlock_irqrestore+0x3e/0x60 [372.555591] schedule+0xe0/0x270 [372.561894] btrfs_commit_transaction+0x18bb/0x2610 [btrfs] [372.570506] ? btrfs_apply_pending_changes+0x50/0x50 [btrfs] [372.578875] ? free_unref_page+0x3f2/0x650 [372.585484] ? finish_wait+0x270/0x270 [372.591594] ? release_extent_buffer+0x224/0x420 [btrfs] [372.599264] btrfs_qgroup_rescan_worker+0xc13/0x10c0 [btrfs] [372.607157] ? lock_release+0x3a9/0x6d0 [372.613054] ? btrfs_qgroup_account_extent+0xda0/0xda0 [btrfs] [372.620960] ? do_raw_spin_lock+0x11e/0x250 [372.627137] ? rwlock_bug.part.0+0x90/0x90 [372.633215] ? lock_is_held_type+0xe4/0x140 [372.639404] btrfs_work_helper+0x1ae/0xa90 [btrfs] [372.646268] process_one_work+0x7e9/0x1320 [372.652321] ? lock_release+0x6d0/0x6d0 [372.658081] ? pwq_dec_nr_in_flight+0x230/0x230 [372.664513] ? rwlock_bug.part.0+0x90/0x90 [372.670529] worker_thread+0x59e/0xf90 [372.676172] ? process_one_work+0x1320/0x1320 [372.682440] kthread+0x3b9/0x490 [372.687550] ? _raw_spin_unlock_irq+0x24/0x50 [372.693811] ? set_kthread_struct+0x100/0x100 [372.700052] ret_from_fork+0x22/0x30 [372.705517] [372.709747] INFO: task btrfs-transacti:2347 blocked for more than 123 seconds. [372.729827] Not tainted 5.16.0-rc8 #7 [372.745907] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [372.767106] task:btrfs-transacti state:D stack: 0 pid: 2347 ppid: 2 flags:0x00004000 [372.787776] Call Trace: [372.801652] [372.812961] __schedule+0xb56/0x4850 [372.830011] ? io_schedule_timeout+0x190/0x190 [372.852547] ? lockdep_hardirqs_on+0x7e/0x100 [372.871761] ? _raw_spin_unlock_irqrestore+0x3e/0x60 [372.886792] schedule+0xe0/0x270 [372.901685] wait_current_trans+0x22c/0x310 [btrfs] [372.919743] ? btrfs_put_transaction+0x3d0/0x3d0 [btrfs] [372.938923] ? finish_wait+0x270/0x270 [372.959085] ? join_transaction+0xc75/0xe30 [btrfs] [372.977706] start_transaction+0x938/0x10a0 [btrfs] [372.997168] transaction_kthread+0x19d/0x3c0 [btrfs] [373.013021] ? btrfs_cleanup_transaction.isra.0+0xfc0/0xfc0 [btrfs] [373.031678] kthread+0x3b9/0x490 [373.047420] ? _raw_spin_unlock_irq+0x24/0x50 [373.064645] ? set_kthread_struct+0x100/0x100 [373.078571] ret_from_fork+0x22/0x30 [373.091197] [373.105611] INFO: task btrfs:3145 blocked for more than 123 seconds. [373.114147] Not tainted 5.16.0-rc8 #7 [373.120401] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [373.130393] task:btrfs state:D stack: 0 pid: 3145 ppid: 3141 flags:0x00004000 [373.140998] Call Trace: [373.145501] [373.149654] __schedule+0xb56/0x4850 [373.155306] ? io_schedule_timeout+0x190/0x190 [373.161965] ? lockdep_hardirqs_on+0x7e/0x100 [373.168469] ? _raw_spin_unlock_irqrestore+0x3e/0x60 [373.175468] schedule+0xe0/0x270 [373.180814] wait_for_commit+0x104/0x150 [btrfs] [373.187643] ? test_and_set_bit+0x20/0x20 [btrfs] [373.194772] ? kmem_cache_free+0x124/0x550 [373.201191] ? btrfs_put_transaction+0x69/0x3d0 [btrfs] [373.208738] ? finish_wait+0x270/0x270 [373.214704] ? __btrfs_end_transaction+0x347/0x7b0 [btrfs] [373.222342] btrfs_commit_transaction+0x44d/0x2610 [btrfs] [373.230233] ? join_transaction+0x255/0xe30 [btrfs] [373.237334] ? btrfs_record_root_in_trans+0x4d/0x170 [btrfs] [373.245251] ? btrfs_apply_pending_changes+0x50/0x50 [btrfs] [373.253296] relocate_block_group+0x105/0xc20 [btrfs] [373.260533] ? mutex_lock_io_nested+0x1270/0x1270 [373.267516] ? btrfs_wait_nocow_writers+0x85/0x180 [btrfs] [373.275155] ? merge_reloc_roots+0x710/0x710 [btrfs] [373.283602] ? btrfs_wait_ordered_extents+0xd30/0xd30 [btrfs] [373.291934] ? kmem_cache_free+0x124/0x550 [373.298180] btrfs_relocate_block_group+0x35c/0x930 [btrfs] [373.306047] btrfs_relocate_chunk+0x85/0x210 [btrfs] [373.313229] btrfs_balance+0x12f4/0x2d20 [btrfs] [373.320227] ? lock_release+0x3a9/0x6d0 [373.326206] ? btrfs_relocate_chunk+0x210/0x210 [btrfs] [373.333591] ? lock_is_held_type+0xe4/0x140 [373.340031] ? rcu_read_lock_sched_held+0x3f/0x70 [373.346910] btrfs_ioctl_balance+0x548/0x700 [btrfs] [373.354207] btrfs_ioctl+0x7f2/0x71b0 [btrfs] [373.360774] ? lockdep_hardirqs_on_prepare+0x410/0x410 [373.367957] ? lockdep_hardirqs_on_prepare+0x410/0x410 [373.375327] ? btrfs_ioctl_get_supported_features+0x20/0x20 [btrfs] [373.383841] ? find_held_lock+0x2c/0x110 [373.389993] ? lock_release+0x3a9/0x6d0 [373.395828] ? mntput_no_expire+0xf7/0xad0 [373.402083] ? lock_is_held_type+0xe4/0x140 [373.408249] ? vfs_fileattr_set+0x9f0/0x9f0 [373.414486] ? selinux_file_ioctl+0x349/0x4e0 [373.420938] ? trace_raw_output_lock+0xb4/0xe0 [373.427442] ? selinux_inode_getsecctx+0x80/0x80 [373.434224] ? lockdep_hardirqs_on+0x7e/0x100 [373.440660] ? force_qs_rnp+0x2a0/0x6b0 [373.446534] ? lock_is_held_type+0x9b/0x140 [373.452763] ? __blkcg_punt_bio_submit+0x1b0/0x1b0 [373.459732] ? security_file_ioctl+0x50/0x90 [373.466089] __x64_sys_ioctl+0x127/0x190 [373.472022] do_syscall_64+0x3b/0x90 [373.477513] entry_SYSCALL_64_after_hwframe+0x44/0xae [373.484823] RIP: 0033:0x7f8f4af7e2bb [373.490493] RSP: 002b:00007ffcbf936178 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 [373.500197] RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f8f4af7e2bb [373.509451] RDX: 00007ffcbf936220 RSI: 00000000c4009420 RDI: 0000000000000003 [373.518659] RBP: 00007ffcbf93774a R08: 0000000000000013 R09: 00007f8f4b02d4e0 [373.527872] R10: 00007f8f4ae87740 R11: 0000000000000246 R12: 0000000000000001 [373.537222] R13: 00007ffcbf936220 R14: 0000000000000000 R15: 0000000000000002 [373.546506] [373.550878] INFO: task btrfs:3146 blocked for more than 123 seconds. [373.559383] Not tainted 5.16.0-rc8 #7 [373.565748] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [373.575748] task:btrfs state:D stack: 0 pid: 3146 ppid: 2168 flags:0x00000000 [373.586314] Call Trace: [373.590846] [373.595121] __schedule+0xb56/0x4850 [373.600901] ? __lock_acquire+0x23db/0x5030 [373.607176] ? io_schedule_timeout+0x190/0x190 [373.613954] schedule+0xe0/0x270 [373.619157] schedule_timeout+0x168/0x220 [373.625170] ? usleep_range_state+0x150/0x150 [373.631653] ? mark_held_locks+0x9e/0xe0 [373.637767] ? do_raw_spin_lock+0x11e/0x250 [373.643993] ? lockdep_hardirqs_on_prepare+0x17b/0x410 [373.651267] ? _raw_spin_unlock_irq+0x24/0x50 [373.657677] ? lockdep_hardirqs_on+0x7e/0x100 [373.664103] wait_for_completion+0x163/0x250 [373.670437] ? bit_wait_timeout+0x160/0x160 [373.676585] btrfs_quota_disable+0x176/0x9a0 [btrfs] [373.683979] ? btrfs_quota_enable+0x12f0/0x12f0 [btrfs] [373.691340] ? down_write+0xd0/0x130 [373.696880] ? down_write_killable+0x150/0x150 [373.703352] btrfs_ioctl+0x3945/0x71b0 [btrfs] [373.710061] ? find_held_lock+0x2c/0x110 [373.716192] ? lock_release+0x3a9/0x6d0 [373.722047] ? __handle_mm_fault+0x23cd/0x3050 [373.728486] ? btrfs_ioctl_get_supported_features+0x20/0x20 [btrfs] [373.737032] ? set_pte+0x6a/0x90 [373.742271] ? do_raw_spin_unlock+0x55/0x1f0 [373.748506] ? lock_is_held_type+0xe4/0x140 [373.754792] ? vfs_fileattr_set+0x9f0/0x9f0 [373.761083] ? selinux_file_ioctl+0x349/0x4e0 [373.767521] ? selinux_inode_getsecctx+0x80/0x80 [373.774247] ? __up_read+0x182/0x6e0 [373.780026] ? count_memcg_events.constprop.0+0x46/0x60 [373.787281] ? up_write+0x460/0x460 [373.792932] ? security_file_ioctl+0x50/0x90 [373.799232] __x64_sys_ioctl+0x127/0x190 [373.805237] do_syscall_64+0x3b/0x90 [373.810947] entry_SYSCALL_64_after_hwframe+0x44/0xae [373.818102] RIP: 0033:0x7f1383ea02bb [373.823847] RSP: 002b:00007fffeb4d71f8 EFLAGS: 00000202 ORIG_RAX: 0000000000000010 [373.833641] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f1383ea02bb [373.842961] RDX: 00007fffeb4d7210 RSI: 00000000c0109428 RDI: 0000000000000003 [373.852179] RBP: 0000000000000003 R08: 0000000000000003 R09: 0000000000000078 [373.861408] R10: 00007f1383daec78 R11: 0000000000000202 R12: 00007fffeb4d874a [373.870647] R13: 0000000000493099 R14: 0000000000000001 R15: 0000000000000000 [373.879838] [373.884018] Showing all locks held in the system: [373.894250] 3 locks held by kworker/4:1/58: [373.900356] 1 lock held by khungtaskd/63: [373.906333] #0: ffffffff8945ff60 (rcu_read_lock){....}-{1:2}, at: debug_show_all_locks+0x53/0x260 [373.917307] 3 locks held by kworker/u16:6/103: [373.923938] #0: ffff888127b4f138 ((wq_completion)btrfs-qgroup-rescan){+.+.}-{0:0}, at: process_one_work+0x712/0x1320 [373.936555] #1: ffff88810b817dd8 ((work_completion)(&work->normal_work)){+.+.}-{0:0}, at: process_one_work+0x73f/0x1320 [373.951109] #2: ffff888102dd4650 (sb_internal#2){.+.+}-{0:0}, at: btrfs_qgroup_rescan_worker+0x1f6/0x10c0 [btrfs] [373.964027] 2 locks held by less/1803: [373.969982] #0: ffff88813ed56098 (&tty->ldisc_sem){++++}-{0:0}, at: tty_ldisc_ref_wait+0x24/0x80 [373.981295] #1: ffffc90000b3b2e8 (&ldata->atomic_read_lock){+.+.}-{3:3}, at: n_tty_read+0x9e2/0x1060 [373.992969] 1 lock held by btrfs-transacti/2347: [373.999893] #0: ffff88813d4887a8 (&fs_info->transaction_kthread_mutex){+.+.}-{3:3}, at: transaction_kthread+0xe3/0x3c0 [btrfs] [374.015872] 3 locks held by btrfs/3145: [374.022298] #0: ffff888102dd4460 (sb_writers#18){.+.+}-{0:0}, at: btrfs_ioctl_balance+0xc3/0x700 [btrfs] [374.034456] #1: ffff88813d48a0a0 (&fs_info->reclaim_bgs_lock){+.+.}-{3:3}, at: btrfs_balance+0xfe5/0x2d20 [btrfs] [374.047646] #2: ffff88813d488838 (&fs_info->cleaner_mutex){+.+.}-{3:3}, at: btrfs_relocate_block_group+0x354/0x930 [btrfs] [374.063295] 4 locks held by btrfs/3146: [374.069647] #0: ffff888102dd4460 (sb_writers#18){.+.+}-{0:0}, at: btrfs_ioctl+0x38b1/0x71b0 [btrfs] [374.081601] #1: ffff88813d488bb8 (&fs_info->subvol_sem){+.+.}-{3:3}, at: btrfs_ioctl+0x38fd/0x71b0 [btrfs] [374.094283] #2: ffff888102dd4650 (sb_internal#2){.+.+}-{0:0}, at: btrfs_quota_disable+0xc8/0x9a0 [btrfs] [374.106885] #3: ffff88813d489800 (&fs_info->qgroup_ioctl_lock){+.+.}-{3:3}, at: btrfs_quota_disable+0xd5/0x9a0 [btrfs] [374.126780] ============================================= To avoid the deadlock, wait for the qgroup rescan worker to complete before starting the transaction for the quota disable ioctl. Clear BTRFS_FS_QUOTA_ENABLE flag before the wait and the transaction to request the worker to complete. On transaction start failure, set the BTRFS_FS_QUOTA_ENABLE flag again. These BTRFS_FS_QUOTA_ENABLE flag changes can be done safely since the function btrfs_quota_disable is not called concurrently because of fs_info->subvol_sem. Also check the BTRFS_FS_QUOTA_ENABLE flag in qgroup_rescan_init to avoid another qgroup rescan worker to start after the previous qgroup worker completed. CC: stable@vger.kernel.org # 5.4+ Suggested-by: Nikolay Borisov Reviewed-by: Filipe Manana Signed-off-by: Shin'ichiro Kawasaki Signed-off-by: David Sterba commit 2d192fc4c1abeb0d04d1c8cd54405ff4a0b0255b Author: Qu Wenruo Date: Thu Dec 16 19:47:35 2021 +0800 btrfs: don't start transaction for scrub if the fs is mounted read-only [BUG] The following super simple script would crash btrfs at unmount time, if CONFIG_BTRFS_ASSERT() is set. mkfs.btrfs -f $dev mount $dev $mnt xfs_io -f -c "pwrite 0 4k" $mnt/file umount $mnt mount -r ro $dev $mnt btrfs scrub start -Br $mnt umount $mnt This will trigger the following ASSERT() introduced by commit 0a31daa4b602 ("btrfs: add assertion for empty list of transactions at late stage of umount"). That patch is definitely not the cause, it just makes enough noise for developers. [CAUSE] We will start transaction for the following call chain during scrub: scrub_enumerate_chunks() |- btrfs_inc_block_group_ro() |- btrfs_join_transaction() However for RO mount, there is no running transaction at all, thus btrfs_join_transaction() will start a new transaction. Furthermore, since it's read-only mount, btrfs_sync_fs() will not call btrfs_commit_super() to commit the new but empty transaction. And leads to the ASSERT(). The bug has been there for a long time. Only the new ASSERT() makes it noisy enough to be noticed. [FIX] For read-only scrub on read-only mount, there is no need to start a transaction nor to allocate new chunks in btrfs_inc_block_group_ro(). Just do extra read-only mount check in btrfs_inc_block_group_ro(), and if it's read-only, skip all chunk allocation and go inc_block_group_ro() directly. CC: stable@vger.kernel.org # 5.4+ Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit bd2db32e7c3e35bd4d9b8bbff689434a50893546 Author: Greg Kroah-Hartman Date: Thu Jan 27 08:16:38 2022 +0100 moxart: fix potential use-after-free on remove path It was reported that the mmc host structure could be accessed after it was freed in moxart_remove(), so fix this by saving the base register of the device and using it instead of the pointer dereference. Cc: Ulf Hansson Cc: Xiyu Yang Cc: Xin Xiong Cc: Xin Tan Cc: Tony Lindgren Cc: Yang Li Cc: linux-mmc@vger.kernel.org Cc: stable Reported-by: whitehat002 Signed-off-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20220127071638.4057899-1-gregkh@linuxfoundation.org Signed-off-by: Ulf Hansson commit fa4300f060e5c4ca670b705f1e9b93685ad30c5b Author: Frank Rowand Date: Thu Jan 27 13:26:43 2022 -0600 of: unittest: update text of expected warnings The text of various warning messages triggered by unittest has changed. Update the text of expected warnings to match. The expected vs actual warnings are most easily seen by filtering the boot console messages with the of_unittest_expect program at https://github.com/frowand/dt_tools.git. The filter prefixes problem lines with '***', and prefixes lines that match expected errors with 'ok '. All other lines are prefixed with ' '. Unrelated lines have been deleted in the following examples. The mismatch appears as: -> ### dt-test ### start of unittest - you will see error messages OF: /testcase-data/phandle-tests/consumer-a: #phandle-cells = 3 found 1 ** of_unittest_expect WARNING - not found ---> OF: /testcase-data/phandle-tests/consumer-a: #phandle-cells = 3 found -1 OF: /testcase-data/phandle-tests/consumer-a: #phandle-cells = 3 found 1 ** of_unittest_expect WARNING - not found ---> OF: /testcase-data/phandle-tests/consumer-a: #phandle-cells = 3 found -1 OF: /testcase-data/phandle-tests/consumer-b: #phandle-cells = 2 found 1 ** of_unittest_expect WARNING - not found ---> OF: /testcase-data/phandle-tests/consumer-b: #phandle-cells = 2 found -1 platform testcase-data:testcase-device2: error -ENXIO: IRQ index 0 not found ** of_unittest_expect WARNING - not found ---> platform testcase-data:testcase-device2: IRQ index 0 not found -> ### dt-test ### end of unittest - 254 passed, 0 failed ** EXPECT statistics: ** ** EXPECT found : 42 ** EXPECT not found : 4 With this commit applied, the mismatch is resolved: -> ### dt-test ### start of unittest - you will see error messages ok OF: /testcase-data/phandle-tests/consumer-a: #phandle-cells = 3 found 1 ok OF: /testcase-data/phandle-tests/consumer-a: #phandle-cells = 3 found 1 ok OF: /testcase-data/phandle-tests/consumer-b: #phandle-cells = 2 found 1 ok platform testcase-data:testcase-device2: error -ENXIO: IRQ index 0 not found -> ### dt-test ### end of unittest - 254 passed, 0 failed ** EXPECT statistics: ** ** EXPECT found : 46 ** EXPECT not found : 0 Fixes: 2043727c2882 ("driver core: platform: Make use of the helper function dev_err_probe()") Fixes: 94a4950a4acf ("of: base: Fix phandle argument length mismatch error message") Signed-off-by: Frank Rowand Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220127192643.2534941-1-frowand.list@gmail.com commit cacfddf82baf1470e5741edeecb187260868f195 Author: JaeMan Park Date: Thu Jan 13 15:02:35 2022 +0900 mac80211_hwsim: initialize ieee80211_tx_info at hw_scan_work In mac80211_hwsim, the probe_req frame is created and sent while scanning. It is sent with ieee80211_tx_info which is not initialized. Uninitialized ieee80211_tx_info can cause problems when using mac80211_hwsim with wmediumd. wmediumd checks the tx_rates field of ieee80211_tx_info and doesn't relay probe_req frame to other clients even if it is a broadcasting message. Call ieee80211_tx_prepare_skb() to initialize ieee80211_tx_info for the probe_req that is created by hw_scan_work in mac80211_hwsim. Signed-off-by: JaeMan Park Link: https://lore.kernel.org/r/20220113060235.546107-1-jaeman@google.com [fix memory leak] Signed-off-by: Johannes Berg commit 42a79960ffa50bfe9e0bf5d6280be89bf563a5dd Author: Benjamin Beichler Date: Tue Jan 11 22:13:26 2022 +0000 mac80211_hwsim: report NOACK frames in tx_status Add IEEE80211_TX_STAT_NOACK_TRANSMITTED to tx_status flags to have proper statistics for non-acked frames. Signed-off-by: Benjamin Beichler Link: https://lore.kernel.org/r/20220111221327.1499881-1-benjamin.beichler@uni-rostock.de Signed-off-by: Johannes Berg commit f6c6804c43fa18d3cee64b55490dfbd3bef1363a Author: Janosch Frank Date: Fri Jan 28 15:40:25 2022 +0000 kvm: Move KVM_GET_XSAVE2 IOCTL definition at the end of kvm.h This way we can more easily find the next free IOCTL number when adding new IOCTLs. Fixes: be50b2065dfa ("kvm: x86: Add support for getting/setting expanded xstate buffer") Signed-off-by: Janosch Frank Message-Id: <20220128154025.102666-1-frankja@linux.ibm.com> Signed-off-by: Paolo Bonzini commit a72c01a94f1d285a274219d36e2a17b4846c0615 Author: Jiasheng Jiang Date: Wed Jan 5 16:15:59 2022 +0800 mac80211: mlme: check for null after calling kmemdup As the possible failure of the alloc, the ifmgd->assoc_req_ies might be NULL pointer returned from kmemdup(). Therefore it might be better to free the skb and return error in order to fail the association, like ieee80211_assoc_success(). Also, the caller, ieee80211_do_assoc(), needs to deal with the return value from ieee80211_send_assoc(). Fixes: 4d9ec73d2b78 ("cfg80211: Report Association Request frame IEs in association events") Signed-off-by: Jiasheng Jiang Link: https://lore.kernel.org/r/20220105081559.2387083-1-jiasheng@iscas.ac.cn [fix some paths to be errors, not success] Signed-off-by: Johannes Berg commit c816b2e65b0e86b95011418cad334f0524fc33b8 Author: TATSUKAWA KOSUKE (立川 江介) Date: Wed Jan 26 23:35:02 2022 +0000 n_tty: wake up poll(POLLRDNORM) on receiving data The poll man page says POLLRDNORM is equivalent to POLLIN when used as an event. $ man poll POLLRDNORM Equivalent to POLLIN. However, in n_tty driver, POLLRDNORM does not return until timeout even if there is terminal input, whereas POLLIN returns. The following test program works until kernel-3.17, but the test stops in poll() after commit 57087d515441 ("tty: Fix spurious poll() wakeups"). [Steps to run test program] $ cc -o test-pollrdnorm test-pollrdnorm.c $ ./test-pollrdnorm foo <-- Type in something from the terminal followed by [RET]. The string should be echoed back. ------------------------< test-pollrdnorm.c >------------------------ #include #include #include #include void main(void) { int n; unsigned char buf[8]; struct pollfd fds[1] = {{ 0, POLLRDNORM, 0 }}; n = poll(fds, 1, -1); if (n < 0) perror("poll"); n = read(0, buf, 8); if (n < 0) perror("read"); if (n > 0) write(1, buf, n); } ------------------------------------------------------------------------ The attached patch fixes this problem. Many calls to wake_up_interruptible_poll() in the kernel source code already specify "POLLIN | POLLRDNORM". Fixes: 57087d515441 ("tty: Fix spurious poll() wakeups") Cc: stable@vger.kernel.org Signed-off-by: Kosuke Tatsukawa Link: https://lore.kernel.org/r/TYCPR01MB81901C0F932203D30E452B3EA5209@TYCPR01MB8190.jpnprd01.prod.outlook.com Signed-off-by: Greg Kroah-Hartman commit 5432184107cd0013761bdfa6cb6079527ef87b95 Author: Pavel Hofman Date: Mon Jan 31 08:18:13 2022 +0100 usb: gadget: f_uac2: Define specific wTerminalType Several users have reported that their Win10 does not enumerate UAC2 gadget with the existing wTerminalType set to UAC_INPUT_TERMINAL_UNDEFINED/UAC_INPUT_TERMINAL_UNDEFINED, e.g. https://github.com/raspberrypi/linux/issues/4587#issuecomment-926567213. While the constant is officially defined by the USB terminal types document, e.g. XMOS firmware for UAC2 (commonly used for Win10) defines no undefined output terminal type in its usbaudio20.h header. Therefore wTerminalType of EP-IN is set to UAC_INPUT_TERMINAL_MICROPHONE and wTerminalType of EP-OUT to UAC_OUTPUT_TERMINAL_SPEAKER for the UAC2 gadget. Signed-off-by: Pavel Hofman Cc: stable Link: https://lore.kernel.org/r/20220131071813.7433-1-pavel.hofman@ivitera.com Signed-off-by: Greg Kroah-Hartman commit 459702eea6132888b5c5b64c0e9c626da4ec2493 Author: Adam Ford Date: Fri Jan 28 16:36:03 2022 -0600 usb: gadget: udc: renesas_usb3: Fix host to USB_ROLE_NONE transition The support the external role switch a variety of situations were addressed, but the transition from USB_ROLE_HOST to USB_ROLE_NONE leaves the host up which can cause some error messages when switching from host to none, to gadget, to none, and then back to host again. xhci-hcd ee000000.usb: Abort failed to stop command ring: -110 xhci-hcd ee000000.usb: xHCI host controller not responding, assume dead xhci-hcd ee000000.usb: HC died; cleaning up usb 4-1: device not accepting address 6, error -108 usb usb4-port1: couldn't allocate usb_device After this happens it will not act as a host again. Fix this by releasing the host mode when transitioning to USB_ROLE_NONE. Fixes: 0604160d8c0b ("usb: gadget: udc: renesas_usb3: Enhance role switch support") Cc: stable Reviewed-by: Yoshihiro Shimoda Signed-off-by: Adam Ford Link: https://lore.kernel.org/r/20220128223603.2362621-1-aford173@gmail.com Signed-off-by: Greg Kroah-Hartman commit 292d2c82b105d92082c2120a44a58de9767e44f1 Author: Jann Horn Date: Wed Jan 26 21:52:14 2022 +0100 usb: raw-gadget: fix handling of dual-direction-capable endpoints Under dummy_hcd, every available endpoint is *either* IN or OUT capable. But with some real hardware, there are endpoints that support both IN and OUT. In particular, the PLX 2380 has four available endpoints that each support both IN and OUT. raw-gadget currently gets confused and thinks that any endpoint that is usable as an IN endpoint can never be used as an OUT endpoint. Fix it by looking at the direction in the configured endpoint descriptor instead of looking at the hardware capabilities. With this change, I can use the PLX 2380 with raw-gadget. Fixes: f2c2e717642c ("usb: gadget: add raw-gadget interface") Cc: stable Tested-by: Andrey Konovalov Reviewed-by: Andrey Konovalov Signed-off-by: Jann Horn Link: https://lore.kernel.org/r/20220126205214.2149936-1-jannh@google.com Signed-off-by: Greg Kroah-Hartman commit 5c2b9c61ae5d8ad0a196d33b66ce44543be22281 Author: Tommaso Merciai Date: Fri Jan 28 19:17:13 2022 +0100 usb: usb251xb: add boost-up property support Add support for boost-up register of usb251xb hub. boost-up property control USB electrical drive strength This register can be set: - Normal mode -> 0x00 - Low -> 0x01 - Medium -> 0x10 - High -> 0x11 (Normal Default) References: - http://www.mouser.com/catalog/specsheets/2514.pdf p29 Reviewed-by: Richard Leitner Signed-off-by: Tommaso Merciai Link: https://lore.kernel.org/r/20220128181713.96856-1-tomm.merciai@gmail.com Signed-off-by: Greg Kroah-Hartman commit a4f399a1416f645ac701064a55b0cb5203707ac9 Author: Christophe JAILLET Date: Sun Jan 30 09:06:36 2022 +0100 Input: wm97xx: Simplify resource management Since the commit in the Fixes tag below, 'wm->input_dev' is a managed resource that doesn't need to be explicitly unregistered or freed (see devm_input_allocate_device() documentation) So, remove some unless line of code to slightly simplify it. Fixes: c72f61e74073 ("Input: wm97xx: split out touchscreen registering") Signed-off-by: Christophe JAILLET Acked-by: Charles Keepax Link: https://lore.kernel.org/r/87dce7e80ea9b191843fa22415ca3aef5f3cc2e6.1643529968.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown commit 0a907ee9d95e3ac35eb023d71f29eae0aaa52d1b Author: Sean Anderson Date: Thu Jan 27 14:00:03 2022 -0500 usb: ulpi: Call of_node_put correctly of_node_put should always be called on device nodes gotten from of_get_*. Additionally, it should only be called after there are no remaining users. To address the first issue, call of_node_put if later steps in ulpi_register fail. To address the latter, call put_device if device_register fails, which will call ulpi_dev_release if necessary. Fixes: ef6a7bcfb01c ("usb: ulpi: Support device discovery via DT") Cc: stable Reviewed-by: Heikki Krogerus Signed-off-by: Sean Anderson Link: https://lore.kernel.org/r/20220127190004.1446909-3-sean.anderson@seco.com Signed-off-by: Greg Kroah-Hartman commit 092f45b13e51666fe8ecbf2d6cd247aa7e6c1f74 Author: Sean Anderson Date: Thu Jan 27 14:00:02 2022 -0500 usb: ulpi: Move of_node_put to ulpi_dev_release Drivers are not unbound from the device when ulpi_unregister_interface is called. Move of_node-freeing code to ulpi_dev_release which is called only after all users are gone. Fixes: ef6a7bcfb01c ("usb: ulpi: Support device discovery via DT") Cc: stable Reviewed-by: Heikki Krogerus Signed-off-by: Sean Anderson Link: https://lore.kernel.org/r/20220127190004.1446909-2-sean.anderson@seco.com Signed-off-by: Greg Kroah-Hartman commit baf927a833ca2c6717795ac131079f485cb7a5dc Author: Horatiu Vultur Date: Mon Jan 31 09:52:01 2022 +0100 pinctrl: microchip-sgpio: Fix support for regmap Initially the driver accessed the registers using u32 __iomem but then in the blamed commit it changed it to use regmap. The problem is that now the offset of the registers is not calculated anymore at word offset but at byte offset. Therefore make sure to multiply the offset with word size. Acked-by: Steen Hegelund Reviewed-by: Colin Foster Fixes: 2afbbab45c261a ("pinctrl: microchip-sgpio: update to support regmap") Signed-off-by: Horatiu Vultur Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220131085201.307031-1-horatiu.vultur@microchip.com Signed-off-by: Linus Walleij commit 341adeec9adad0874f29a0a1af35638207352a39 Author: Wen Gu Date: Wed Jan 26 23:33:04 2022 +0800 net/smc: Forward wakeup to smc socket waitqueue after fallback When we replace TCP with SMC and a fallback occurs, there may be some socket waitqueue entries remaining in smc socket->wq, such as eppoll_entries inserted by userspace applications. After the fallback, data flows over TCP/IP and only clcsocket->wq will be woken up. Applications can't be notified by the entries which were inserted in smc socket->wq before fallback. So we need a mechanism to wake up smc socket->wq at the same time if some entries remaining in it. The current workaround is to transfer the entries from smc socket->wq to clcsock->wq during the fallback. But this may cause a crash like this: general protection fault, probably for non-canonical address 0xdead000000000100: 0000 [#1] PREEMPT SMP PTI CPU: 3 PID: 0 Comm: swapper/3 Kdump: loaded Tainted: G E 5.16.0+ #107 RIP: 0010:__wake_up_common+0x65/0x170 Call Trace: __wake_up_common_lock+0x7a/0xc0 sock_def_readable+0x3c/0x70 tcp_data_queue+0x4a7/0xc40 tcp_rcv_established+0x32f/0x660 ? sk_filter_trim_cap+0xcb/0x2e0 tcp_v4_do_rcv+0x10b/0x260 tcp_v4_rcv+0xd2a/0xde0 ip_protocol_deliver_rcu+0x3b/0x1d0 ip_local_deliver_finish+0x54/0x60 ip_local_deliver+0x6a/0x110 ? tcp_v4_early_demux+0xa2/0x140 ? tcp_v4_early_demux+0x10d/0x140 ip_sublist_rcv_finish+0x49/0x60 ip_sublist_rcv+0x19d/0x230 ip_list_rcv+0x13e/0x170 __netif_receive_skb_list_core+0x1c2/0x240 netif_receive_skb_list_internal+0x1e6/0x320 napi_complete_done+0x11d/0x190 mlx5e_napi_poll+0x163/0x6b0 [mlx5_core] __napi_poll+0x3c/0x1b0 net_rx_action+0x27c/0x300 __do_softirq+0x114/0x2d2 irq_exit_rcu+0xb4/0xe0 common_interrupt+0xba/0xe0 The crash is caused by privately transferring waitqueue entries from smc socket->wq to clcsock->wq. The owners of these entries, such as epoll, have no idea that the entries have been transferred to a different socket wait queue and still use original waitqueue spinlock (smc socket->wq.wait.lock) to make the entries operation exclusive, but it doesn't work. The operations to the entries, such as removing from the waitqueue (now is clcsock->wq after fallback), may cause a crash when clcsock waitqueue is being iterated over at the moment. This patch tries to fix this by no longer transferring wait queue entries privately, but introducing own implementations of clcsock's callback functions in fallback situation. The callback functions will forward the wakeup to smc socket->wq if clcsock->wq is actually woken up and smc socket->wq has remaining entries. Fixes: 2153bd1e3d3d ("net/smc: Transfer remaining wait queue entries during fallback") Suggested-by: Karsten Graul Signed-off-by: Wen Gu Acked-by: Karsten Graul Signed-off-by: David S. Miller commit d48384c7ed6c8fe4727eaa0f3048f62afd1cd715 Author: Pawel Dembicki Date: Tue Jan 11 23:12:05 2022 +0100 USB: serial: option: add ZTE MF286D modem Modem from ZTE MF286D is an Qualcomm MDM9250 based 3G/4G modem. T: Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 3 Spd=5000 MxCh= 0 D: Ver= 3.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 9 #Cfgs= 1 P: Vendor=19d2 ProdID=1485 Rev=52.87 S: Manufacturer=ZTE,Incorporated S: Product=ZTE Technologies MSM S: SerialNumber=MF286DZTED000000 C:* #Ifs= 7 Cfg#= 1 Atr=80 MxPwr=896mA A: FirstIf#= 0 IfCount= 2 Cls=02(comm.) Sub=06 Prot=00 I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=02 Prot=ff Driver=rndis_host E: Ad=82(I) Atr=03(Int.) MxPS= 8 Ivl=32ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=rndis_host E: Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E: Ad=01(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=83(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=85(I) Atr=03(Int.) MxPS= 10 Ivl=32ms E: Ad=84(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E: Ad=03(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=87(I) Atr=03(Int.) MxPS= 10 Ivl=32ms E: Ad=86(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E: Ad=04(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms I:* If#= 5 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan E: Ad=88(I) Atr=03(Int.) MxPS= 8 Ivl=32ms E: Ad=8e(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E: Ad=0f(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms I:* If#= 6 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=usbfs E: Ad=05(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms E: Ad=89(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms Signed-off-by: Pawel Dembicki Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit fa77ce201f7f2d823b07753575122d1ae5597fbe Author: Stephan Brunner Date: Sat Jan 8 13:00:20 2022 +0100 USB: serial: ch341: add support for GW Instek USB2.0-Serial devices Programmable lab power supplies made by GW Instek, such as the GPP-2323, have a USB port exposing a serial port to control the device. Stringing the supplied Windows driver, references to the ch341 chip are found. Binding the existing ch341 driver to the VID/PID of the GPP-2323 ("GW Instek USB2.0-Serial" as per the USB product name) works out of the box, communication and control is now possible. This patch should work with any GPP series power supply due to similarities in the product line. Signed-off-by: Stephan Brunner Link: https://lore.kernel.org/r/4a47b864-0816-6f6a-efee-aa20e74bcdc6@stephan-brunner.net Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold commit ebe2b1add1055b903e2acd86b290a85297edc0b3 Author: Udipto Goswami Date: Thu Jan 27 09:39:55 2022 +0530 usb: f_fs: Fix use-after-free for epfile Consider a case where ffs_func_eps_disable is called from ffs_func_disable as part of composition switch and at the same time ffs_epfile_release get called from userspace. ffs_epfile_release will free up the read buffer and call ffs_data_closed which in turn destroys ffs->epfiles and mark it as NULL. While this was happening the driver has already initialized the local epfile in ffs_func_eps_disable which is now freed and waiting to acquire the spinlock. Once spinlock is acquired the driver proceeds with the stale value of epfile and tries to free the already freed read buffer causing use-after-free. Following is the illustration of the race: CPU1 CPU2 ffs_func_eps_disable epfiles (local copy) ffs_epfile_release ffs_data_closed if (last file closed) ffs_data_reset ffs_data_clear ffs_epfiles_destroy spin_lock dereference epfiles Fix this races by taking epfiles local copy & assigning it under spinlock and if epfiles(local) is null then update it in ffs->epfiles then finally destroy it. Extending the scope further from the race, protecting the ep related structures, and concurrent accesses. Fixes: a9e6f83c2df1 ("usb: gadget: f_fs: stop sleeping in ffs_func_eps_disable") Co-developed-by: Udipto Goswami Reviewed-by: John Keeping Signed-off-by: Pratham Pratap Signed-off-by: Udipto Goswami Link: https://lore.kernel.org/r/1643256595-10797-1-git-send-email-quic_ugoswami@quicinc.com Signed-off-by: Greg Kroah-Hartman commit 3c6f13ad723e7206f03bb2752b01d18202b7fc9d Author: Imre Deak Date: Wed Jan 26 12:43:56 2022 +0200 drm/i915/adlp: Fix TypeC PHY-ready status readout The TCSS_DDI_STATUS register is indexed by tc_port not by the FIA port index, fix this up. This only caused an issue on TC#3/4 ports in legacy mode, as in all other cases the two indices either match (on TC#1/2) or the TCSS_DDI_STATUS_READY flag is set regardless of something being connected or not (on TC#1/2/3/4 in dp-alt and tbt-alt modes). Reported-and-tested-by: Chia-Lin Kao (AceLan) Fixes: 55ce306c2aa1 ("drm/i915/adl_p: Implement TC sequences") Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/4698 Cc: José Roberto de Souza Cc: # v5.14+ Signed-off-by: Imre Deak Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20220126104356.2022975-1-imre.deak@intel.com (cherry picked from commit 516b33460c5bee78b2055637b0547bdb0e6af754) Signed-off-by: Tvrtko Ursulin commit b3f74938d65665f892d1b7807c51140f68dc911c Author: Umesh Nerlige Ramappa Date: Mon Jan 10 17:55:23 2022 -0800 drm/i915/pmu: Use PM timestamp instead of RING TIMESTAMP for reference All timestamps returned by GuC for GuC PMU busyness are captured from GUC PM TIMESTAMP. Since this timestamp does not tick when GuC goes idle, kmd uses RING_TIMESTAMP to measure busyness of an engine with an active context. In further stress testing, the MMIO read of the RING_TIMESTAMP is seen to cause a rare hang. Resolve the issue by using gt specific timestamp from PM which is in sync with the GuC PM timestamp. Fixes: 77cdd054dd2c ("drm/i915/pmu: Connect engine busyness stats from GuC to pmu") Signed-off-by: Umesh Nerlige Ramappa Reviewed-by: Alan Previn Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20220111015523.225562-1-umesh.nerlige.ramappa@intel.com (cherry picked from commit 721fd84ea1fe957453587efad5fdc44dfba58e04) Signed-off-by: Tvrtko Ursulin commit 90a3d22ff02b196d5884e111f39271a1d4ee8e3e Author: Dan Carpenter Date: Mon Jan 24 15:24:09 2022 +0300 drm/i915/overlay: Prevent divide by zero bugs in scaling Smatch detected a divide by zero bug in check_overlay_scaling(). drivers/gpu/drm/i915/display/intel_overlay.c:976 check_overlay_scaling() error: potential divide by zero bug '/ rec->dst_height'. drivers/gpu/drm/i915/display/intel_overlay.c:980 check_overlay_scaling() error: potential divide by zero bug '/ rec->dst_width'. Prevent this by ensuring that the dst height and width are non-zero. Fixes: 02e792fbaadb ("drm/i915: implement drmmode overlay support v4") Signed-off-by: Dan Carpenter Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20220124122409.GA31673@kili (cherry picked from commit cf5b64f7f10b28bebb9b7c9d25e7aee5cbe43918) Signed-off-by: Tvrtko Ursulin commit 5ae13c305ef8cb54efc4f0ba4565709b9f320fed Author: Matthew Brost Date: Tue Jan 11 08:39:29 2022 -0800 drm/i915: Lock timeline mutex directly in error path of eb_pin_timeline Don't use the interruptable version of the timeline mutex lock in the error path of eb_pin_timeline as the cleanup must always happen. v2: (John Harrison) - Don't check for interrupt during mutex lock v3: (Tvrtko) - A comment explaining why lock helper isn't used Fixes: 544460c33821 ("drm/i915: Multi-BB execbuf") Signed-off-by: Matthew Brost Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20220111163929.14017-1-matthew.brost@intel.com (cherry picked from commit cb935c4618bd2ff9058feee4af7088446da6a763) Signed-off-by: Tvrtko Ursulin commit 8172f41859cf7516e73eb957297e6752b3073119 Author: Matthew Brost Date: Thu Jan 20 20:31:16 2022 -0800 drm/i915: Allocate intel_engine_coredump_alloc with ALLOW_FAIL Allocate intel_engine_coredump_alloc with ALLOW_FAIL rather than GFP_KERNEL to fully decouple the error capture from fence signalling. v2: (John Harrison) - Fix typo in commit message (s/do/to) Fixes: 8b91cdd4f8649 ("drm/i915: Use __GFP_KSWAPD_RECLAIM in the capture code") Signed-off-by: Matthew Brost Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20220121043118.24886-2-matthew.brost@intel.com (cherry picked from commit 4f72fc3c7f3d9f29a438bb0e17c7773f2fc8242a) Signed-off-by: Tvrtko Ursulin commit b470947c3672f7eb7c4c271d510383d896831cc2 Author: Robert Hancock Date: Thu Jan 27 16:15:00 2022 -0600 usb: dwc3: xilinx: fix uninitialized return value A previous patch to skip part of the initialization when a USB3 PHY was not present could result in the return value being uninitialized in that case, causing spurious probe failures. Initialize ret to 0 to avoid this. Fixes: 9678f3361afc ("usb: dwc3: xilinx: Skip resets and USB3 register settings for USB2.0 mode") Cc: Reviewed-by: Nathan Chancellor Signed-off-by: Robert Hancock Link: https://lore.kernel.org/r/20220127221500.177021-1-robert.hancock@calian.com Signed-off-by: Greg Kroah-Hartman commit 94db9cc8f8fa2d5426ce79ec4ca16028f7084224 Author: Albert Geantă Date: Mon Jan 31 03:05:23 2022 +0200 ALSA: hda/realtek: Add quirk for ASUS GU603 The ASUS GU603 (Zephyrus M16 - SSID 1043:16b2) requires a quirk similar to other ASUS devices for correctly routing the 4 integrated speakers. This fixes it by adding a corresponding quirk entry, which connects the bass speakers to the proper DAC. Signed-off-by: Albert Geantă Cc: Link: https://lore.kernel.org/r/20220131010523.546386-1-albertgeanta@gmail.com Signed-off-by: Takashi Iwai commit ea3541961376f733373839cc90493aafa8a7f733 Author: Christian Lachner Date: Sat Jan 29 12:32:43 2022 +0100 ALSA: hda/realtek: Fix silent output on Gigabyte X570 Aorus Xtreme after reboot from Windows This commit switches the Gigabyte X570 Aorus Xtreme from using the ALC1220_FIXUP_CLEVO_P950 to the ALC1220_FIXUP_GB_X570 quirk. This fixes the no-audio after reboot from windows problem. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=205275 Signed-off-by: Christian Lachner Cc: Link: https://lore.kernel.org/r/20220129113243.93068-4-gladiac@gmail.com Signed-off-by: Takashi Iwai commit 41a8601302ecbe704ac970552c33dc942300fc37 Author: Christian Lachner Date: Sat Jan 29 12:32:42 2022 +0100 ALSA: hda/realtek: Fix silent output on Gigabyte X570S Aorus Master (newer chipset) Newer versions of the X570 Master come with a newer revision of the mainboard chipset - the X570S. These boards have the same ALC1220 codec but seem to initialize the codec with a different parameter in Coef 0x7 which causes the output audio to be very low. We therefore write a known-good value to Coef 0x7 to fix that. As the value is the exact same as on the other X570(non-S) boards the same quirk-function can be shared between both generations. This commit adds the Gigabyte X570S Aorus Master to the list of boards using the ALC1220_FIXUP_GB_X570 quirk. This fixes both, the silent output and the no-audio after reboot from windows problems. This work has been tested by the folks over at the level1techs forum here: https://forum.level1techs.com/t/has-anybody-gotten-audio-working-in-linux-on-aorus-x570-master/154072 Signed-off-by: Christian Lachner Cc: Link: https://lore.kernel.org/r/20220129113243.93068-3-gladiac@gmail.com Signed-off-by: Takashi Iwai commit 63394a16086fc2152869d7902621e2525e14bc40 Author: Christian Lachner Date: Sat Jan 29 12:32:41 2022 +0100 ALSA: hda/realtek: Add missing fixup-model entry for Gigabyte X570 ALC1220 quirks The initial commit of the new Gigabyte X570 ALC1220 quirks lacked the fixup-model entry in alc882_fixup_models[]. It seemed not to cause any ill effects but for completeness sake this commit makes up for that. Signed-off-by: Christian Lachner Cc: Link: https://lore.kernel.org/r/20220129113243.93068-2-gladiac@gmail.com Signed-off-by: Takashi Iwai commit b837a9f5ab3bdfab9233c9f98a6bef717673a3e5 Author: Takashi Iwai Date: Mon Jan 31 08:57:38 2022 +0100 ALSA: hda: realtek: Fix race at concurrent COEF updates The COEF access is done with two steps: setting the index then read or write the data. When multiple COEF accesses are performed concurrently, the index and data might be paired unexpectedly. In most cases, this isn't a big problem as the COEF setup is done at the initialization, but some dynamic changes like the mute LED may hit such a race. For avoiding the racy COEF accesses, this patch introduces a new mutex coef_mutex to alc_spec, and wrap the COEF accessing functions with it. Reported-by: Alexander Sergeyev Cc: Link: https://lore.kernel.org/r/20220111195229.a77wrpjclqwrx4bx@localhost.localdomain Link: https://lore.kernel.org/r/20220131075738.24323-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 47307c31d90ae7d52cebbbc7c1d4ff213213d4e9 Author: Kees Cook Date: Wed Jan 12 12:38:11 2022 -0800 crypto: octeontx2 - Avoid stack variable overflow Building with -Warray-bounds showed a stack variable array index overflow. Increase the expected size of the array to avoid the warning: In file included from ./include/linux/printk.h:555, from ./include/asm-generic/bug.h:22, from ./arch/x86/include/asm/bug.h:84, from ./include/linux/bug.h:5, from ./include/linux/mmdebug.h:5, from ./include/linux/gfp.h:5, from ./include/linux/firmware.h:7, from drivers/crypto/marvell/octeontx2/otx2_cptpf_ucode.c:5: drivers/crypto/marvell/octeontx2/otx2_cptpf_ucode.c: In function 'otx2_cpt_print_uc_dbg_info': ./include/linux/dynamic_debug.h:162:33: warning: array subscript 4 is above array bounds of 'u32[4]' {aka 'unsigned int[4]'} [-Warray-bounds] 162 | _dynamic_func_call(fmt, __dynamic_pr_debug, \ | ^ ./include/linux/dynamic_debug.h:134:17: note: in definition of macro '__dynamic_func_call' 134 | func(&id, ##__VA_ARGS__); \ | ^~~~ ./include/linux/dynamic_debug.h:162:9: note: in expansion of macro '_dynamic_func_call' 162 | _dynamic_func_call(fmt, __dynamic_pr_debug, \ | ^~~~~~~~~~~~~~~~~~ ./include/linux/printk.h:570:9: note: in expansion of macro 'dynamic_pr_debug' 570 | dynamic_pr_debug(fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~~~~~ drivers/crypto/marvell/octeontx2/otx2_cptpf_ucode.c:1807:41: note: in expansion of macro 'pr_debug' 1807 | pr_debug("Mask: %8.8x %8.8x %8.8x %8.8x %8.8x", | ^~~~~~~~ drivers/crypto/marvell/octeontx2/otx2_cptpf_ucode.c:1765:13: note: while referencing 'mask' 1765 | u32 mask[4]; | ^~~~ This is justified because the mask size (eng_grps->engs_num) can be at most 144 (OTX2_CPT_MAX_ENGINES bits), which is larger than available storage. 4 * 32 == 128, so this must be 5: 5 * 32bit = 160. Additionally clear the mask before conversion so trailing bits are zero. Cc: Herbert Xu Cc: Boris Brezillon Cc: Arnaud Ebalard Cc: Srujana Challa Cc: "David S. Miller" Cc: Suheil Chandran Cc: Shijith Thotton Cc: Lukasz Bartosik Cc: linux-crypto@vger.kernel.org Fixes: d9d7749773e8 ("crypto: octeontx2 - add apis for custom engine groups") Acked-by: Ard Biesheuvel Signed-off-by: Kees Cook Signed-off-by: Herbert Xu commit 2d86293c70750e4331e9616aded33ab6b47c299d Author: Darrick J. Wong Date: Sun Jan 30 08:53:17 2022 -0800 xfs: return errors in xfs_fs_sync_fs Now that the VFS will do something with the return values from ->sync_fs, make ours pass on error codes. Signed-off-by: Darrick J. Wong Reviewed-by: Jan Kara Reviewed-by: Christoph Hellwig Acked-by: Christian Brauner commit dd5532a4994bfda0386eb2286ec00758cee08444 Author: Darrick J. Wong Date: Sun Jan 30 08:53:16 2022 -0800 quota: make dquot_quota_sync return errors from ->sync_fs Strangely, dquot_quota_sync ignores the return code from the ->sync_fs call, which means that quotacalls like Q_SYNC never see the error. This doesn't seem right, so fix that. Signed-off-by: Darrick J. Wong Reviewed-by: Jan Kara Reviewed-by: Christoph Hellwig Acked-by: Christian Brauner commit 5679897eb104cec9e99609c3f045a0c20603da4c Author: Darrick J. Wong Date: Sun Jan 30 08:53:16 2022 -0800 vfs: make sync_filesystem return errors from ->sync_fs Strangely, sync_filesystem ignores the return code from the ->sync_fs call, which means that syscalls like syncfs(2) never see the error. This doesn't seem right, so fix that. Signed-off-by: Darrick J. Wong Reviewed-by: Jan Kara Reviewed-by: Christoph Hellwig Acked-by: Christian Brauner commit 2719c7160dcfaae1f73a1c0c210ad3281c19022e Author: Darrick J. Wong Date: Sun Jan 30 08:53:16 2022 -0800 vfs: make freeze_super abort when sync_filesystem returns error If we fail to synchronize the filesystem while preparing to freeze the fs, abort the freeze. Signed-off-by: Darrick J. Wong Reviewed-by: Jan Kara Reviewed-by: Christoph Hellwig Acked-by: Christian Brauner commit 632fe0bb8c5b9c06ec961f575ee42a6fff5eceeb Author: Miaoqian Lin Date: Thu Jan 6 11:23:09 2022 +0000 iio: Fix error handling for PM The pm_runtime_enable will increase power disable depth. If the probe fails, we should use pm_runtime_disable() to balance pm_runtime_enable(). In the PM Runtime docs: Drivers in ->remove() callback should undo the runtime PM changes done in ->probe(). Usually this means calling pm_runtime_disable(), pm_runtime_dont_use_autosuspend() etc. We should do this in error handling. Fix this problem for the following drivers: bmc150, bmg160, kmx61, kxcj-1013, mma9551, mma9553. Fixes: 7d0ead5c3f00 ("iio: Reconcile operation order between iio_register/unregister and pm functions") Signed-off-by: Miaoqian Lin Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220106112309.16879-1-linmq006@gmail.com Cc: Signed-off-by: Jonathan Cameron commit 4165456fe6b7719c0c9626022a7d96c381c94e6f Author: Cosmin Tanislav Date: Tue Jan 11 09:47:02 2022 +0200 iio: addac: ad74413r: correct comparator gpio getters mask usage The value of the GPIOs is currently altered using offsets rather than masks. Make use of __assign_bit and the BIT macro to turn the offsets into masks. Fixes: fea251b6a5db ("iio: addac: add AD74413R driver") Signed-off-by: Cosmin Tanislav Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220111074703.3677392-2-cosmin.tanislav@analog.com Signed-off-by: Jonathan Cameron commit 8a3e4a5614adab30b6e0eb7dbd8ef737aabbb8eb Author: Cosmin Tanislav Date: Tue Jan 11 09:47:01 2022 +0200 iio: addac: ad74413r: use ngpio size when iterating over mask ngpio is the actual number of GPIOs handled by the GPIO chip, as opposed to the max number of GPIOs. Fixes: fea251b6a5db ("iio: addac: add AD74413R driver") Signed-off-by: Cosmin Tanislav Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220111074703.3677392-1-cosmin.tanislav@analog.com Signed-off-by: Jonathan Cameron commit e7a3290d330e3f8cf06a3cad455c49e89183137b Author: Kees Cook Date: Wed Jan 12 12:34:56 2022 -0800 iio: addac: ad74413r: Do not reference negative array offsets Instead of aiming rx_buf at an invalid array-boundary-crossing location, just skip the first increment. Seen when building with -Warray-bounds: drivers/iio/addac/ad74413r.c: In function 'ad74413r_update_scan_mode': drivers/iio/addac/ad74413r.c:843:22: warning: array subscript -4 is below array bounds of 'u8[16]' { aka 'unsigned char[16]'} [-Warray-bounds] 843 | u8 *rx_buf = &st->adc_samples_buf.rx_buf[-1 * AD74413R_FRAME_SIZE]; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/iio/addac/ad74413r.c:84:20: note: while referencing 'rx_buf' 84 | u8 rx_buf[AD74413R_FRAME_SIZE * AD74413R_CHANNEL_MAX]; | ^~~~~~ Cc: Lars-Peter Clausen Cc: Michael Hennerich Cc: Jonathan Cameron Cc: linux-iio@vger.kernel.org Fixes: fea251b6a5db ("iio: addac: add AD74413R driver") Reviewed-by: Cosmin Tanislav Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220112203456.3950884-1-keescook@chromium.org Signed-off-by: Jonathan Cameron commit e0a2e37f303828d030a83f33ffe14b36cb88d563 Author: Christophe JAILLET Date: Sat Jan 29 09:32:47 2022 +0100 iio: adc: men_z188_adc: Fix a resource leak in an error handling path If iio_device_register() fails, a previous ioremap() is left unbalanced. Update the error handling path and add the missing iounmap() call, as already done in the remove function. Fixes: 74aeac4da66f ("iio: adc: Add MEN 16z188 ADC driver") Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/320fc777863880247c2aff4a9d1a54ba69abf080.1643445149.git.christophe.jaillet@wanadoo.fr Cc: Signed-off-by: Jonathan Cameron commit 26291c54e111ff6ba87a164d85d4a4e134b7315c Author: Linus Torvalds Date: Sun Jan 30 15:37:07 2022 +0200 Linux 5.17-rc2 commit 22e424feb6658c5d6789e45121830357809c59cb Author: Dominique Martinet Date: Sat Jan 29 18:42:59 2022 +0900 Revert "fs/9p: search open fids first" This reverts commit 478ba09edc1f2f2ee27180a06150cb2d1a686f9c. That commit was meant as a fix for setattrs with by fd (e.g. ftruncate) to use an open fid instead of the first fid it found on lookup. The proper fix for that is to use the fid associated with the open file struct, available in iattr->ia_file for such operations, and was actually done just before in 66246641609b ("9p: retrieve fid from file when file instance exist.") As such, this commit is no longer required. Furthermore, changing lookup to return open fids first had unwanted side effects, as it turns out the protocol forbids the use of open fids for further walks (e.g. clone_fid) and we broke mounts for some servers enforcing this rule. Note this only reverts to the old working behaviour, but it's still possible for lookup to return open fids if dentry->d_fsdata is not set, so more work is needed to make sure we respect this rule in the future, for example by adding a flag to the lookup functions to only match certain fid open modes depending on caller requirements. Link: https://lkml.kernel.org/r/20220130130651.712293-1-asmadeus@codewreck.org Fixes: 478ba09edc1f ("fs/9p: search open fids first") Cc: stable@vger.kernel.org # v5.11+ Reported-by: ron minnich Reported-by: ng@0x80.stream Signed-off-by: Dominique Martinet commit c5fe9de7903330df7641fd342733fec6fb91afa2 Merge: 27a96c4feb837 243d308037441 Author: Linus Torvalds Date: Sun Jan 30 15:12:02 2022 +0200 Merge tag 'irq_urgent_for_v5.17_rc2_p2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull irq fixes from Borislav Petkov: - Drop an unused private data field in the AIC driver - Various fixes to the realtek-rtl driver - Make the GICv3 ITS driver compile again in !SMP configurations - Force reset of the GICv3 ITSs at probe time to avoid issues during kexec - Yet another kfree/bitmap_free conversion - Various DT updates (Renesas, SiFive) * tag 'irq_urgent_for_v5.17_rc2_p2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: dt-bindings: interrupt-controller: sifive,plic: Group interrupt tuples dt-bindings: interrupt-controller: sifive,plic: Fix number of interrupts dt-bindings: irqchip: renesas-irqc: Add R-Car V3U support irqchip/gic-v3-its: Reset each ITS's BASERn register before probe irqchip/gic-v3-its: Fix build for !SMP irqchip/loongson-pch-ms: Use bitmap_free() to free bitmap irqchip/realtek-rtl: Service all pending interrupts irqchip/realtek-rtl: Fix off-by-one in routing irqchip/realtek-rtl: Map control data to virq irqchip/apple-aic: Drop unused ipi_hwirq field commit 27a96c4feb837093f6075bbd97c942260d26ef33 Merge: 24f4db1f3a272 c5de60cd622a2 Author: Linus Torvalds Date: Sun Jan 30 15:02:32 2022 +0200 Merge tag 'perf_urgent_for_v5.17_rc2_p2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull perf fixes from Borislav Petkov: - Prevent accesses to the per-CPU cgroup context list from another CPU except the one it belongs to, to avoid list corruption - Make sure parent events are always woken up to avoid indefinite hangs in the traced workload * tag 'perf_urgent_for_v5.17_rc2_p2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/core: Fix cgroup event list management perf: Always wake the parent event commit a1cba0e2deeb0fe5200602658ed1078a714f8667 Author: Muhammad Usama Anjum Date: Wed Jan 5 02:09:20 2022 +0500 iio: frequency: admv1013: remove the always true condition unsigned int variable is always greater than or equal to zero. Make the if condition simple. Signed-off-by: Muhammad Usama Anjum Fixes: da35a7b526d9 ("iio: frequency: admv1013: add support for ADMV1013") Link: https://lore.kernel.org/r/YdS3gJYtECMaDDjA@debian-BULLSEYE-live-builder-AMD64 Signed-off-by: Jonathan Cameron commit 24f4db1f3a2725a6308105081d822b26889e1018 Merge: a96d3a5b15192 809232619f5b1 Author: Linus Torvalds Date: Sun Jan 30 13:09:00 2022 +0200 Merge tag 'sched_urgent_for_v5.17_rc2_p2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull scheduler fix from Borislav Petkov: "Make sure the membarrier-rseq fence commands are part of the reported set when querying membarrier(2) commands through MEMBARRIER_CMD_QUERY" * tag 'sched_urgent_for_v5.17_rc2_p2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched/membarrier: Fix membarrier-rseq fence command missing from query bitmask commit a96d3a5b15192f401aa8fa68965ff2a5303367a9 Merge: 8dd71685dcb78 e464121f2d40e Author: Linus Torvalds Date: Sun Jan 30 12:55:06 2022 +0200 Merge tag 'x86_urgent_for_v5.17_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fixes from Borislav Petkov: - Add another Intel CPU model to the list of CPUs supporting the processor inventory unique number - Allow writing to MCE thresholding sysfs files again - a previous change had accidentally disabled it and no one noticed. Goes to show how much is this stuff used * tag 'x86_urgent_for_v5.17_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/cpu: Add Xeon Icelake-D to list of CPUs that support PPIN x86/MCE/AMD: Allow thresholding interface updates after init commit 8dd71685dcb7839f6d91417e0a9237daca363908 Merge: f8c7e4ede46fe ddf4b773aa407 Author: Linus Torvalds Date: Sun Jan 30 11:21:50 2022 +0200 Merge branch 'akpm' (patches from Andrew) Merge misc fixes from Andrew Morton: "12 patches. Subsystems affected by this patch series: sysctl, binfmt, ia64, mm (memory-failure, folios, kasan, and psi), selftests, and ocfs2" * emailed patches from Andrew Morton : ocfs2: fix a deadlock when commit trans jbd2: export jbd2_journal_[grab|put]_journal_head psi: fix "defined but not used" warnings when CONFIG_PROC_FS=n psi: fix "no previous prototype" warnings when CONFIG_CGROUPS=n mm, kasan: use compare-exchange operation to set KASAN page tag kasan: test: fix compatibility with FORTIFY_SOURCE tools/testing/scatterlist: add missing defines mm: page->mapping folio->mapping should have the same offset memory-failure: fetch compound_head after pgmap_pfn_valid() ia64: make IA64_MCA_RECOVERY bool instead of tristate binfmt_misc: fix crash when load/unload module include/linux/sysctl.h: fix register_sysctl_mount_point() return type commit 8fd9415042826c7609c588e5ef45f3e84237785f Author: Krzysztof Kozlowski Date: Sat Jan 29 18:54:29 2022 +0100 arm64: dts: rockchip: align pl330 node name with dtschema Fixes dtbs_check warnings like: dmac@ff240000: $nodename:0: 'dmac@ff240000' does not match '^dma-controller(@.*)?$' Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220129175429.298836-1-krzysztof.kozlowski@canonical.com Signed-off-by: Heiko Stuebner commit 62966cbdda8a92f82d966a45aa671e788b2006f7 Author: Jakob Unterwurzacher Date: Wed Jan 19 14:49:48 2022 +0100 arm64: dts: rockchip: fix rk3399-puma eMMC HS400 signal integrity There are signal integrity issues running the eMMC at 200MHz on Puma RK3399-Q7. Similar to the work-around found for RK3399 Gru boards, lowering the frequency to 100MHz made the eMMC much more stable, so let's lower the frequency to 100MHz. It might be possible to run at 150MHz as on RK3399 Gru boards but only 100MHz was extensively tested. Cc: Quentin Schulz Signed-off-by: Jakob Unterwurzacher Signed-off-by: Quentin Schulz Link: https://lore.kernel.org/r/20220119134948.1444965-1-quentin.schulz@theobroma-systems.com Signed-off-by: Heiko Stuebner commit ad02776cf8d083e28b1ca4d93d8b1949668c27cc Author: Peter Geis Date: Thu Jan 27 19:38:05 2022 -0500 arm64: dts: rockchip: fix Quartz64-A ddr regulator voltage The Quartz64 Model A uses a voltage divider to ensure ddr voltage is within specification from the default regulator configuration. Adjusting this voltage is detrimental, and currently causes the ddr voltage to be about 0.8v. Remove the min and max voltage setpoints for the ddr regulator. Fixes: b33a22a1e7c4 ("arm64: dts: rockchip: add basic dts for Pine64 Quartz64-A") Signed-off-by: Peter Geis Link: https://lore.kernel.org/r/20220128003809.3291407-2-pgwipeout@gmail.com Signed-off-by: Heiko Stuebner commit ddf4b773aa40790dfa936bd845c18e735a49c61c Author: Joseph Qi Date: Sat Jan 29 13:41:27 2022 -0800 ocfs2: fix a deadlock when commit trans commit 6f1b228529ae introduces a regression which can deadlock as follows: Task1: Task2: jbd2_journal_commit_transaction ocfs2_test_bg_bit_allocatable spin_lock(&jh->b_state_lock) jbd_lock_bh_journal_head __jbd2_journal_remove_checkpoint spin_lock(&jh->b_state_lock) jbd2_journal_put_journal_head jbd_lock_bh_journal_head Task1 and Task2 lock bh->b_state and jh->b_state_lock in different order, which finally result in a deadlock. So use jbd2_journal_[grab|put]_journal_head instead in ocfs2_test_bg_bit_allocatable() to fix it. Link: https://lkml.kernel.org/r/20220121071205.100648-3-joseph.qi@linux.alibaba.com Fixes: 6f1b228529ae ("ocfs2: fix race between searching chunks and release journal_head from buffer_head") Signed-off-by: Joseph Qi Reported-by: Gautham Ananthakrishna Tested-by: Gautham Ananthakrishna Reported-by: Saeed Mirzamohammadi Cc: "Theodore Ts'o" Cc: Andreas Dilger Cc: Changwei Ge Cc: Gang He Cc: Joel Becker Cc: Jun Piao Cc: Junxiao Bi Cc: Mark Fasheh Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 4cd1103d8c66b2cdb7e64385c274edb0ac5e8887 Author: Joseph Qi Date: Sat Jan 29 13:41:23 2022 -0800 jbd2: export jbd2_journal_[grab|put]_journal_head Patch series "ocfs2: fix a deadlock case". This fixes a deadlock case in ocfs2. We firstly export jbd2 symbols jbd2_journal_[grab|put]_journal_head as preparation and later use them in ocfs2 insread of jbd_[lock|unlock]_bh_journal_head to fix the deadlock. This patch (of 2): This exports symbols jbd2_journal_[grab|put]_journal_head, which will be used outside modules, e.g. ocfs2. Link: https://lkml.kernel.org/r/20220121071205.100648-2-joseph.qi@linux.alibaba.com Signed-off-by: Joseph Qi Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Changwei Ge Cc: Gang He Cc: Jun Piao Cc: Andreas Dilger Cc: Gautham Ananthakrishna Cc: Saeed Mirzamohammadi Cc: "Theodore Ts'o" Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 44585f7bc0cb01095bc2ad4258049c02bbad21ef Author: Suren Baghdasaryan Date: Sat Jan 29 13:41:20 2022 -0800 psi: fix "defined but not used" warnings when CONFIG_PROC_FS=n When CONFIG_PROC_FS is disabled psi code generates the following warnings: kernel/sched/psi.c:1364:30: warning: 'psi_cpu_proc_ops' defined but not used [-Wunused-const-variable=] 1364 | static const struct proc_ops psi_cpu_proc_ops = { | ^~~~~~~~~~~~~~~~ kernel/sched/psi.c:1355:30: warning: 'psi_memory_proc_ops' defined but not used [-Wunused-const-variable=] 1355 | static const struct proc_ops psi_memory_proc_ops = { | ^~~~~~~~~~~~~~~~~~~ kernel/sched/psi.c:1346:30: warning: 'psi_io_proc_ops' defined but not used [-Wunused-const-variable=] 1346 | static const struct proc_ops psi_io_proc_ops = { | ^~~~~~~~~~~~~~~ Make definitions of these structures and related functions conditional on CONFIG_PROC_FS config. Link: https://lkml.kernel.org/r/20220119223940.787748-3-surenb@google.com Fixes: 0e94682b73bf ("psi: introduce psi monitor") Signed-off-by: Suren Baghdasaryan Reported-by: kernel test robot Acked-by: Johannes Weiner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 51e50fbd3efc6064c30ed73a5e009018b36e290a Author: Suren Baghdasaryan Date: Sat Jan 29 13:41:17 2022 -0800 psi: fix "no previous prototype" warnings when CONFIG_CGROUPS=n When CONFIG_CGROUPS is disabled psi code generates the following warnings: kernel/sched/psi.c:1112:21: warning: no previous prototype for 'psi_trigger_create' [-Wmissing-prototypes] 1112 | struct psi_trigger *psi_trigger_create(struct psi_group *group, | ^~~~~~~~~~~~~~~~~~ kernel/sched/psi.c:1182:6: warning: no previous prototype for 'psi_trigger_destroy' [-Wmissing-prototypes] 1182 | void psi_trigger_destroy(struct psi_trigger *t) | ^~~~~~~~~~~~~~~~~~~ kernel/sched/psi.c:1249:10: warning: no previous prototype for 'psi_trigger_poll' [-Wmissing-prototypes] 1249 | __poll_t psi_trigger_poll(void **trigger_ptr, | ^~~~~~~~~~~~~~~~ Change the declarations of these functions in the header to provide the prototypes even when they are unused. Link: https://lkml.kernel.org/r/20220119223940.787748-2-surenb@google.com Fixes: 0e94682b73bf ("psi: introduce psi monitor") Signed-off-by: Suren Baghdasaryan Reported-by: kernel test robot Acked-by: Johannes Weiner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 27fe73394a1c6d0b07fa4d95f1bca116d1cc66e9 Author: Peter Collingbourne Date: Sat Jan 29 13:41:14 2022 -0800 mm, kasan: use compare-exchange operation to set KASAN page tag It has been reported that the tag setting operation on newly-allocated pages can cause the page flags to be corrupted when performed concurrently with other flag updates as a result of the use of non-atomic operations. Fix the problem by using a compare-exchange loop to update the tag. Link: https://lkml.kernel.org/r/20220120020148.1632253-1-pcc@google.com Link: https://linux-review.googlesource.com/id/I456b24a2b9067d93968d43b4bb3351c0cec63101 Fixes: 2813b9c02962 ("kasan, mm, arm64: tag non slab memory allocated via pagealloc") Signed-off-by: Peter Collingbourne Reviewed-by: Andrey Konovalov Cc: Peter Zijlstra Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 09c6304e38e440b93a9ebf3f3cf75cd6cb529f91 Author: Marco Elver Date: Sat Jan 29 13:41:11 2022 -0800 kasan: test: fix compatibility with FORTIFY_SOURCE With CONFIG_FORTIFY_SOURCE enabled, string functions will also perform dynamic checks using __builtin_object_size(ptr), which when failed will panic the kernel. Because the KASAN test deliberately performs out-of-bounds operations, the kernel panics with FORTIFY_SOURCE, for example: | kernel BUG at lib/string_helpers.c:910! | invalid opcode: 0000 [#1] PREEMPT SMP KASAN PTI | CPU: 1 PID: 137 Comm: kunit_try_catch Tainted: G B 5.16.0-rc3+ #3 | Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-2 04/01/2014 | RIP: 0010:fortify_panic+0x19/0x1b | ... | Call Trace: | kmalloc_oob_in_memset.cold+0x16/0x16 | ... Fix it by also hiding `ptr` from the optimizer, which will ensure that __builtin_object_size() does not return a valid size, preventing fortified string functions from panicking. Link: https://lkml.kernel.org/r/20220124160744.1244685-1-elver@google.com Signed-off-by: Marco Elver Reported-by: Nico Pache Reviewed-by: Nico Pache Reviewed-by: Andrey Konovalov Reviewed-by: Kees Cook Cc: Andrey Ryabinin Cc: Alexander Potapenko Cc: Dmitry Vyukov Cc: Brendan Higgins Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 0226bd64da52aa23120d1450c37a424387827a21 Author: Maor Gottlieb Date: Sat Jan 29 13:41:07 2022 -0800 tools/testing/scatterlist: add missing defines The cited commits replaced preemptible with pagefault_disabled and flush_kernel_dcache_page with flush_dcache_page respectively, hence need to update the corresponding defines in the test. scatterlist.c: In function ‘sg_miter_stop’: scatterlist.c:919:4: warning: implicit declaration of function ‘flush_dcache_page’ [-Wimplicit-function-declaration] flush_dcache_page(miter->page); ^~~~~~~~~~~~~~~~~ In file included from linux/scatterlist.h:8:0, from scatterlist.c:9: scatterlist.c:922:18: warning: implicit declaration of function ‘pagefault_disabled’ [-Wimplicit-function-declaration] WARN_ON_ONCE(!pagefault_disabled()); ^ linux/mm.h:23:25: note: in definition of macro ‘WARN_ON_ONCE’ int __ret_warn_on = !!(condition); \ ^~~~~~~~~ Link: https://lkml.kernel.org/r/20220118082105.1737320-1-maorg@nvidia.com Fixes: 723aca208516 ("mm/scatterlist: replace the !preemptible warning in sg_miter_stop()") Fixes: 0e84f5dbf8d6 ("scatterlist: replace flush_kernel_dcache_page with flush_dcache_page") Signed-off-by: Maor Gottlieb Tested-by: Sebastian Andrzej Siewior Cc: Thomas Gleixner Cc: Christoph Hellwig Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 536f4217ced62b671bd759f6b549621a5654a70f Author: Wei Yang Date: Sat Jan 29 13:41:04 2022 -0800 mm: page->mapping folio->mapping should have the same offset As with the other members of folio, the offset of page->mapping and folio->mapping must be the same. The compile-time check was inadvertently removed during development. Add it back. [willy@infradead.org: changelog redo] Link: https://lkml.kernel.org/r/20220104011734.21714-1-richard.weiyang@gmail.com Signed-off-by: Wei Yang Reviewed-by: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 61e28cf0543c7d8e6ef88c3c305f727c5a21ba5b Author: Joao Martins Date: Sat Jan 29 13:41:01 2022 -0800 memory-failure: fetch compound_head after pgmap_pfn_valid() memory_failure_dev_pagemap() at the moment assumes base pages (e.g. dax_lock_page()). For devmap with compound pages fetch the compound_head in case a tail page memory failure is being handled. Currently this is a nop, but in the advent of compound pages in dev_pagemap it allows memory_failure_dev_pagemap() to keep working. Without this fix memory-failure handling (i.e. MCEs on pmem) with device-dax configured namespaces will regress (and crash). Link: https://lkml.kernel.org/r/20211202204422.26777-2-joao.m.martins@oracle.com Reported-by: Jane Chu Signed-off-by: Joao Martins Reviewed-by: Naoya Horiguchi Reviewed-by: Dan Williams Reviewed-by: Muchun Song Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit dbecf9b8b8ce580f4e11afed9d61e8aa294cddd2 Author: Randy Dunlap Date: Sat Jan 29 13:40:58 2022 -0800 ia64: make IA64_MCA_RECOVERY bool instead of tristate In linux-next, IA64_MCA_RECOVERY uses the (new) function make_task_dead(), which is not exported for use by modules. Instead of exporting it for one user, convert IA64_MCA_RECOVERY to be a bool Kconfig symbol. In a config file from "kernel test robot " for a different problem, this linker error was exposed when CONFIG_IA64_MCA_RECOVERY=m. Fixes this build error: ERROR: modpost: "make_task_dead" [arch/ia64/kernel/mca_recovery.ko] undefined! Link: https://lkml.kernel.org/r/20220124213129.29306-1-rdunlap@infradead.org Fixes: 0e25498f8cd4 ("exit: Add and use make_task_dead.") Signed-off-by: Randy Dunlap Suggested-by: Christoph Hellwig Reviewed-by: Christoph Hellwig Reviewed-by: "Eric W. Biederman" Cc: Tony Luck Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e7f1e8834b2b2144dfbe0b2235d05e4f6f95882e Author: Tong Zhang Date: Sat Jan 29 13:40:55 2022 -0800 binfmt_misc: fix crash when load/unload module We should unregister the table upon module unload otherwise something horrible will happen when we load binfmt_misc module again. Also note that we should keep value returned by register_sysctl_mount_point() and release it later, otherwise it will leak. Also, per Christian's comment, to fully restore the old behavior that won't break userspace the check(binfmt_misc_header) should be eliminated. To reproduce: modprobe binfmt_misc modprobe -r binfmt_misc modprobe binfmt_misc modprobe -r binfmt_misc modprobe binfmt_misc resulting in modprobe: can't load module binfmt_misc (kernel/fs/binfmt_misc.ko): Cannot allocate memory and an unhappy kernel: binfmt_misc: Failed to create fs/binfmt_misc sysctl mount point binfmt_misc: Failed to create fs/binfmt_misc sysctl mount point BUG: unable to handle page fault for address: fffffbfff8004802 Call Trace: init_misc_binfmt+0x2d/0x1000 [binfmt_misc] Link: https://lkml.kernel.org/r/20220124181812.1869535-2-ztong0001@gmail.com Fixes: 3ba442d5331f ("fs: move binfmt_misc sysctl to its own file") Signed-off-by: Tong Zhang Co-developed-by: Christian Brauner Acked-by: Luis Chamberlain Cc: Eric Biederman Cc: Kees Cook Cc: Iurii Zaikin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 6cb917411e028dcb66ce8f5db1b47361b78d7d3f Author: Andrew Morton Date: Sat Jan 29 13:40:52 2022 -0800 include/linux/sysctl.h: fix register_sysctl_mount_point() return type The CONFIG_SYSCTL=n stub returns the wrong type. Fixes: ee9efac48a082 ("sysctl: add helper to register a sysctl mount point") Reported-by: kernel test robot Acked-by: Luis Chamberlain Cc: Tong Zhang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3a5286955bf5febc3d151bcb2c5e272e383b64aa Author: Julian Braha Date: Mon Jan 17 01:25:57 2022 -0500 pinctrl: bcm63xx: fix unmet dependency on REGMAP for GPIO_REGMAP When PINCTRL_BCM63XX is selected, and REGMAP is not selected, Kbuild gives the following warning: WARNING: unmet direct dependencies detected for GPIO_REGMAP Depends on [n]: GPIOLIB [=y] && REGMAP [=n] Selected by [y]: - PINCTRL_BCM63XX [=y] && PINCTRL [=y] This is because PINCTRL_BCM63XX selects GPIO_REGMAP without selecting or depending on REGMAP, despite GPIO_REGMAP depending on REGMAP. This unmet dependency bug was detected by Kismet, a static analysis tool for Kconfig. Please advise if this is not the appropriate solution. Signed-off-by: Julian Braha Link: https://lore.kernel.org/r/20220117062557.89568-1-julianbraha@gmail.com Signed-off-by: Linus Walleij commit 5297c693d8c8e08fa742e3112cf70723f7a04da2 Author: Florian Fainelli Date: Thu Jan 27 13:50:31 2022 -0800 pinctrl: bcm2835: Fix a few error paths After commit 266423e60ea1 ("pinctrl: bcm2835: Change init order for gpio hogs") a few error paths would not unwind properly the registration of gpio ranges. Correct that by assigning a single error label and goto it whenever we encounter a fatal error. Fixes: 266423e60ea1 ("pinctrl: bcm2835: Change init order for gpio hogs") Signed-off-by: Florian Fainelli Link: https://lore.kernel.org/r/20220127215033.267227-1-f.fainelli@gmail.com Signed-off-by: Linus Walleij commit 474932a3b215de3dffd828d5ef3296275b80ea01 Merge: 1fd6bb5b47a65 500c77eed0fea Author: Linus Walleij Date: Sun Jan 30 02:27:01 2022 +0100 Merge tag 'intel-pinctrl-v5.17-4' of gitolite.kernel.org:pub/scm/linux/kernel/git/pinctrl/intel into fixes intel-pinctrl for v5.17-4 * Couple of fixes on how Intel driver handles an interrupt * Revert pin renaming change in ZynqMQ as it appears to be part of the Device Tree bindings * Fix ordering of the files in the Makefile The following is an automated git shortlog grouped by driver: intel: - Fix a glitch when updating IRQ flags on a preconfigured line - fix unexpected interrupt Place correctly CONFIG_PINCTRL_ST in the Makefile: - Place correctly CONFIG_PINCTRL_ST in the Makefile zynqmp: - Revert "Unify pin naming" commit dfd0dfb9a7cc04acf93435b440dd34c2ca7b4424 Author: Sergey Shtylyov Date: Mon Jan 24 21:55:03 2022 +0300 EDAC/xgene: Fix deferred probing The driver overrides error codes returned by platform_get_irq_optional() to -EINVAL for some strange reason, so if it returns -EPROBE_DEFER, the driver will fail the probe permanently instead of the deferred probing. Switch to propagating the proper error codes to platform driver code upwards. [ bp: Massage commit message. ] Fixes: 0d4429301c4a ("EDAC: Add APM X-Gene SoC EDAC driver") Signed-off-by: Sergey Shtylyov Signed-off-by: Borislav Petkov Cc: Link: https://lore.kernel.org/r/20220124185503.6720-3-s.shtylyov@omp.ru commit 243d30803744155a54bfb8a844cc964945cfd9a1 Merge: a0af3d1104f75 c89e5eb7dcf15 Author: Thomas Gleixner Date: Sat Jan 29 21:03:20 2022 +0100 Merge tag 'irqchip-fixes-5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms into irq/urgent Pull irqchip fixes from Marc Zyngier: - Drop an unused private data field in the AIC driver - Various fixes to the realtek-rtl driver - Make the GICv3 ITS driver compile again in !SMP configurations - Force reset of the GICv3 ITSs at probe time to avoid issues during kexec - Yet another kfree/bitmap_free conversion - Various DT updates (Renesas, SiFive) Link: https://lore.kernel.org/r/20220128174217.517041-1-maz@kernel.org commit 489f710a738e24d887823a010b8b206b4124e26f Author: Shyam Prasad N Date: Sat Jan 29 09:32:33 2022 +0000 cifs: unlock chan_lock before calling cifs_put_tcp_session While removing an smb session, we need to free up the tcp session for each channel for that session. We were doing this with chan_lock held. This results in a cyclic dependency with cifs_tcp_ses_lock. For now, unlock the chan_lock temporarily before calling cifs_put_tcp_session. This should not cause any problem for now, since we do not remove channels anywhere else. And this code segment will not be called by two threads. When we do implement the code for removing channels, we will need to execute proper ref counting here. Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit f8c7e4ede46fe63ff10000669652648aab09d112 Merge: 4cd90083d3257 66d28b21fe6b3 Author: Linus Torvalds Date: Sat Jan 29 19:05:47 2022 +0200 Merge tag 'pci-v5.17-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci Pull pci fixes from Bjorn Helgaas: - Fix compilation warnings in new mt7621 driver (Sergio Paracuellos) - Restore the sysfs "rom" file for VGA shadow ROMs, which was broken when converting "rom" to be a static attribute (Bjorn Helgaas) * tag 'pci-v5.17-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: PCI/sysfs: Find shadow ROM before static attribute initialization PCI: mt7621: Remove unused function pcie_rmw() PCI: mt7621: Drop of_match_ptr() to avoid unused variable commit 4cd90083d32574e52ac839c6c7e4ff445ac4472c Merge: e255759e5afbc 8aa0f94b0a8d5 Author: Linus Torvalds Date: Sat Jan 29 15:45:33 2022 +0200 Merge tag 'gpio-fixes-for-v5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux Pull gpio fixes from Bartosz Golaszewski: "Two fixes for the gpio-simulator: - fix a bug with hogs not being set-up in gpio-sim when user-space sets the chip label to an empty string - include the gpio-sim documentation in the index" * tag 'gpio-fixes-for-v5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: gpio: sim: add doc file to index file gpio: sim: check the label length when setting up device properties commit e255759e5afbc233544d7246ad325417320e90b6 Merge: bb37101b36332 fc55e63e148f1 Author: Linus Torvalds Date: Sat Jan 29 15:34:04 2022 +0200 Merge tag 'char-misc-5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull char/misc driver fixes from Greg KH: "Here are two small char/misc driver fixes for 5.17-rc2 that fix some reported issues. They are: - fix up a merge issue in the at25.c driver that ended up dropping some lines in the driver. The removed lines ended being needed, so this restores it and the driver works again. - counter core fix where the wrong error was being returned, NULL should be the correct error for when memory is gone here, like the kmalloc() core does. Both of these have been in linux-next this week with no reported issues" * tag 'char-misc-5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: counter: fix an IS_ERR() vs NULL bug eeprom: at25: Restore missing allocation commit bb37101b36332345a1e1c1f9f2f3bcc8ad7edb65 Merge: 44aa31a2bfaab d1ad2721b1eb0 Author: Linus Torvalds Date: Sat Jan 29 15:23:13 2022 +0200 Merge tag 'tty-5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull tty/serial driver fixes from Greg KH: "Here are some small bug fixes and reverts for reported problems with the tty core and drivers. They include: - revert the fifo use for the 8250 console mode. It caused too many regressions and problems, and had a bug in it as well. This is being reworked and should show up in a later -rc1 release, but it's not ready for 5.17 - rpmsg tty race fix - restore the cyclades.h uapi header file. Turns out a compiler test suite used it for some unknown reason. Bring it back just for the parts that are used by the builder test so they continue to build. No functionality is restored as no one actually has this hardware anymore, nor is it really tested. - stm32 driver fixes - n_gsm flow control fixes - pl011 driver fix - rs485 initialization fix All of these have been in linux-next this week with no reported problems" * tag 'tty-5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: kbuild: remove include/linux/cyclades.h from header file check serial: core: Initialize rs485 RTS polarity already on probe serial: pl011: Fix incorrect rs485 RTS polarity on set_mctrl serial: stm32: fix software flow control transfer serial: stm32: prevent TDR register overwrite when sending x_char tty: n_gsm: fix SW flow control encoding/handling serial: 8250: of: Fix mapped region size when using reg-offset property tty: rpmsg: Fix race condition releasing tty port tty: Partially revert the removal of the Cyclades public API tty: Add support for Brainboxes UC cards. Revert "tty: serial: Use fifo in 8250 console driver" commit 44aa31a2bfaab2ad36614f05162cda88ade9ce65 Merge: cb323ee75d24e 79aa3e19fe8f5 Author: Linus Torvalds Date: Sat Jan 29 15:17:20 2022 +0200 Merge tag 'usb-5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB driver fixes from Greg KH: "Here are some small USB driver fixes for 5.17-rc2 that resolve a number of reported problems. These include: - typec driver fixes - xhci platform driver fixes for suspending - ulpi core fix - role.h build fix - new device ids - syzbot-reported bugfixes - gadget driver fixes - dwc3 driver fixes - other small fixes All of these have been in linux-next this week with no reported issues" * tag 'usb-5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: usb: cdnsp: Fix segmentation fault in cdns_lost_power function usb: dwc2: gadget: don't try to disable ep0 in dwc2_hsotg_suspend usb: gadget: at91_udc: fix incorrect print type usb: dwc3: xilinx: Fix error handling when getting USB3 PHY usb: dwc3: xilinx: Skip resets and USB3 register settings for USB2.0 mode usb: xhci-plat: fix crash when suspend if remote wake enable usb: common: ulpi: Fix crash in ulpi_match() usb: gadget: f_sourcesink: Fix isoc transfer for USB_SPEED_SUPER_PLUS ucsi_ccg: Check DEV_INT bit only when starting CCG4 USB: core: Fix hang in usb_kill_urb by adding memory barriers usb-storage: Add unusual-devs entry for VL817 USB-SATA bridge usb: typec: tcpm: Do not disconnect when receiving VSAFE0V usb: typec: tcpm: Do not disconnect while receiving VBUS off usb: typec: Don't try to register component master without components usb: typec: Only attempt to link USB ports if there is fwnode usb: typec: tcpci: don't touch CC line if it's Vconn source usb: roles: fix include/linux/usb/role.h compile issue commit cb323ee75d24e7acc2f188d123ba6df46159cf09 Merge: 3b58e9f3a301e b879f915bc48a Author: Linus Torvalds Date: Sat Jan 29 15:01:08 2022 +0200 Merge tag 'block-5.17-2022-01-28' of git://git.kernel.dk/linux-block Pull block fixes from Jens Axboe: - NVMe pull request - add the IGNORE_DEV_SUBNQN quirk for Intel P4500/P4600 SSDs (Wu Zheng) - remove the unneeded ret variable in nvmf_dev_show (Changcheng Deng) - Fix for a hang regression introduced with a patch in the merge window, where low queue depth devices would not always get woken correctly (Laibin) - Small series fixing an IO accounting issue with bio backed dm devices (Mike, Yu) * tag 'block-5.17-2022-01-28' of git://git.kernel.dk/linux-block: dm: properly fix redundant bio-based IO accounting dm: revert partial fix for redundant bio-based IO accounting block: add bio_start_io_acct_time() to control start_time blk-mq: Fix wrong wakeup batch configuration which will cause hang nvme-fabrics: remove the unneeded ret variable in nvmf_dev_show nvme-pci: add the IGNORE_DEV_SUBNQN quirk for Intel P4500/P4600 SSDs blk-mq: fix missing blk_account_io_done() in error path block: fix memory leak in disk_register_independent_access_ranges commit 3b58e9f3a301e175d2de6f7fa1e834c4605e1c73 Merge: d66c1e79b9fcb f6133fbd37381 Author: Linus Torvalds Date: Sat Jan 29 14:53:07 2022 +0200 Merge tag 'io_uring-5.17-2022-01-28' of git://git.kernel.dk/linux-block Pull io_uring fixes from Jens Axboe: "Just two small fixes this time: - Fix a bug that can lead to node registration taking 1 second, when it should finish much quicker (Dylan) - Remove an unused argument from a function (Usama)" * tag 'io_uring-5.17-2022-01-28' of git://git.kernel.dk/linux-block: io_uring: remove unused argument from io_rsrc_node_alloc io_uring: fix bug in slow unregistering of nodes commit d66c1e79b9fcbfc6559ea3c5b1243d590fa04179 Merge: 216e2aede2b57 8defc2a5dd8f4 Author: Linus Torvalds Date: Sat Jan 29 14:46:19 2022 +0200 Merge tag 'powerpc-5.17-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fixes from Michael Ellerman: - Fix VM debug warnings on boot triggered via __set_fixmap(). - Fix a debug warning in the 64-bit Book3S PMU handling code. - Fix nested guest HFSCR handling with multiple vCPUs on Power9 or later. - Fix decrementer storm caused by a recent change, seen with some configs. Thanks to Alexey Kardashevskiy, Athira Rajeev, Christophe Leroy, Fabiano Rosas, Maxime Bizon, Nicholas Piggin, and Sachin Sant. * tag 'powerpc-5.17-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/64s/interrupt: Fix decrementer storm KVM: PPC: Book3S HV Nested: Fix nested HFSCR being clobbered with multiple vCPUs powerpc/perf: Fix power_pmu_disable to call clear_pmi_irq_pending only if PMI is pending powerpc/fixmap: Fix VM debug warning on unmap commit 216e2aede2b575016bd579e0c23661bbdbbaada7 Merge: d1e7f0919ea84 297ae1eb23b04 Author: Linus Torvalds Date: Sat Jan 29 08:57:22 2022 +0200 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fixes from Catalin Marinas: - Errata workarounds for Cortex-A510: broken hardware dirty bit management, detection code for the TRBE (tracing) bugs with the actual fixes going in via the CoreSight tree. - Cortex-X2 errata handling for TRBE (inheriting the workarounds from Cortex-A710). - Fix ex_handler_load_unaligned_zeropad() to use the correct struct members. - A couple of kselftest fixes for FPSIMD. - Silence the vdso "no previous prototype" warning. - Mark start_backtrace() notrace and NOKPROBE_SYMBOL. * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: cpufeature: List early Cortex-A510 parts as having broken dbm kselftest/arm64: Correct logging of FPSIMD register read via ptrace kselftest/arm64: Skip VL_INHERIT tests for unsupported vector types arm64: errata: Add detection for TRBE trace data corruption arm64: errata: Add detection for TRBE invalid prohibited states arm64: errata: Add detection for TRBE ignored system register writes arm64: Add Cortex-A510 CPU part definition arm64: extable: fix load_unaligned_zeropad() reg indices arm64: Mark start_backtrace() notrace and NOKPROBE_SYMBOL arm64: errata: Update ARM64_ERRATUM_[2119858|2224489] with Cortex-X2 ranges arm64: Add Cortex-X2 CPU part definition arm64: vdso: Fix "no previous prototype" warning commit d1e7f0919ea84911e2ab965418cd502ba6a906e1 Merge: 246e179d637ef 7f5056b9e7b71 Author: Linus Torvalds Date: Sat Jan 29 08:52:27 2022 +0200 Merge tag 'fixes-v5.17-lsm-ceph-null' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security Pull security sybsystem fix from James Morris: "Fix NULL pointer crash in LSM via Ceph, from Vivek Goyal" * tag 'fixes-v5.17-lsm-ceph-null' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: security, lsm: dentry_init_security() Handle multi LSM registration commit 91f6d5f181f6629dd74ab71759fe92d3f4eff966 Author: Alexander Stein Date: Sat Jan 29 14:39:05 2022 +0800 arm64: dts: imx8mq: fix lcdif port node The port node does not have a unit-address, remove it. This fixes the warnings: lcd-controller@30320000: 'port' is a required property lcd-controller@30320000: 'port@0' does not match any of the regexes: 'pinctrl-[0-9]+' Fixes: commit d0081bd02a03 ("arm64: dts: imx8mq: Add NWL MIPI DSI controller") Signed-off-by: Alexander Stein Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 5ea62d06b1899f63c4374f52c8d40c43cad69ec0 Author: Martin Kepplinger Date: Fri Jan 21 10:33:26 2022 +0100 arm64: dts: imx8mq-librem5: fix mipi_csi1 port number to sensor Since the previous commit fixed a hardware description bug for imx8mq, we need to fix up all DT users like this. The mipi_csi port@0 is connected to the sensor, not port@1. Fixes: fed7603597fa ("arm64: dts: imx8mq-librem5: describe the selfie cam") Signed-off-by: Martin Kepplinger Signed-off-by: Shawn Guo commit 283d45145fbf460dbaf0229cacd7ed60ec52f364 Author: Martin Kepplinger Date: Fri Jan 21 10:33:25 2022 +0100 arm64: dts: imx8mq: fix mipi_csi bidirectional port numbers The port numbers for the imx8mq mipi csi controller are wrong and the mipi driver can't find any media devices as port@1 is connected to the CSI bridge, not port@0. And port@0 is connected to the source - the sensor. Fix this. Fixes: bcadd5f66c2a ("arm64: dts: imx8mq: add mipi csi phy and csi bridge descriptions") Signed-off-by: Martin Kepplinger Signed-off-by: Shawn Guo commit 246e179d637ef8432fb223e4a7ddced740a32350 Merge: 169387e2aa291 854d0982eef0e Author: Linus Torvalds Date: Sat Jan 29 08:27:28 2022 +0200 Merge tag 'docs-5.17-3' of git://git.lwn.net/linux Pull documentation fixes from Jonathan Corbet: "A few documentation fixes for 5.17" * tag 'docs-5.17-3' of git://git.lwn.net/linux: docs/vm: Fix typo in *harden* Documentation: arm: marvell: Extend Avanta list docs: fix typo in Documentation/kernel-hacking/locking.rst docs: Hook the RTLA documents into the kernel docs build commit 6d58c5e21a3fe355ce6d1808e96d02a610265218 Author: Rob Herring Date: Thu Jan 20 11:23:55 2022 -0600 ARM: dts: imx7ulp: Fix 'assigned-clocks-parents' typo The correct property name is 'assigned-clock-parents', not 'assigned-clocks-parents'. Though if the platform works with the typo, one has to wonder if the property is even needed. Signed-off-by: Rob Herring Fixes: 8b8c7d97e2c7 ("ARM: dts: imx7ulp: Add wdog1 node") Signed-off-by: Shawn Guo commit ff3cfc35a4dd4b432e33eee4f6d772411d70399f Author: Michael Walle Date: Sat Jan 15 22:04:32 2022 +0100 arm64: dts: ls1028a: sl28: re-enable ftm_alarm0 Commit dd3d936a1b17 ("arm64: dts: ls1028a: add ftm_alarm1 node to be used as wakeup source") disables ftm_alarm0 in the SoC dtsi but doesn't enable it on the board which is still using it. Re-enable it on the sl28 board. Fixes: dd3d936a1b17 ("arm64: dts: ls1028a: add ftm_alarm1 node to be used as wakeup source") Reported-by: Guillaume Tucker Reported-by: "kernelci.org bot" Signed-off-by: Michael Walle Signed-off-by: Shawn Guo commit dbe0d009d8c23c7408da9721c1378a5f661aaa83 Author: Alexander Stein Date: Fri Jan 14 09:59:06 2022 +0100 arm64: dts: freescale: Fix sound card model for MBa8Mx The audio codec connection on MBa8Mx is identical to MBa7 (imx7) and MBa6 (imx6). Use the same sound card model as well. Fixes commit dfcd1b6f7620 ("arm64: dts: freescale: add initial device tree for TQMa8MQML with i.MX8MM") Signed-off-by: Alexander Stein Signed-off-by: Shawn Guo commit 1601033da2dd2052e0489137f7788a46a8fcd82f Author: Mark Brown Date: Fri Jan 28 19:24:43 2022 +0000 ASoC: ops: Check for negative values before reading them The controls allow inputs to be specified as negative but our manipulating them into register fields need to be done on unsigned variables so the checks for negative numbers weren't taking effect properly. Do the checks for negative values on the variable in the ABI struct rather than on our local unsigned copy. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220128192443.3504823-1-broonie@kernel.org Signed-off-by: Mark Brown commit 4c38f8747c5769a272bc6557c2504d218f01914e Merge: 4045daf0fa878 9f620684c1ef5 Author: Mark Brown Date: Fri Jan 28 20:45:33 2022 +0000 ASoC DPCM lockdep fixes Merge series from Takashi Iwai : This is the revised patches for addressing ASoC lockdep warnings due to the recent DPCM locking refactoring. commit 279eb8575fdaa92c314a54c0d583c65e26229107 Author: Sergey Shtylyov Date: Mon Jan 24 21:55:02 2022 +0300 EDAC/altera: Fix deferred probing The driver overrides the error codes returned by platform_get_irq() to -ENODEV for some strange reason, so if it returns -EPROBE_DEFER, the driver will fail the probe permanently instead of the deferred probing. Switch to propagating the proper error codes to platform driver code upwards. [ bp: Massage commit message. ] Fixes: 71bcada88b0f ("edac: altera: Add Altera SDRAM EDAC support") Signed-off-by: Sergey Shtylyov Signed-off-by: Borislav Petkov Acked-by: Dinh Nguyen Cc: Link: https://lore.kernel.org/r/20220124185503.6720-2-s.shtylyov@omp.ru commit b879f915bc48a18d4f4462729192435bb0f17052 Author: Mike Snitzer Date: Fri Jan 28 10:58:41 2022 -0500 dm: properly fix redundant bio-based IO accounting Record the start_time for a bio but defer the starting block core's IO accounting until after IO is submitted using bio_start_io_acct_time(). This approach avoids the need to mess around with any of the individual IO stats in response to a bio_split() that follows bio submission. Reported-by: Bud Brown Reviewed-by: Christoph Hellwig Cc: stable@vger.kernel.org Depends-on: e45c47d1f94e ("block: add bio_start_io_acct_time() to control start_time") Signed-off-by: Mike Snitzer Link: https://lore.kernel.org/r/20220128155841.39644-4-snitzer@redhat.com Signed-off-by: Jens Axboe commit f524d9c95fab54783d0038f7a3e8c014d5b56857 Author: Mike Snitzer Date: Fri Jan 28 10:58:40 2022 -0500 dm: revert partial fix for redundant bio-based IO accounting Reverts a1e1cb72d9649 ("dm: fix redundant IO accounting for bios that need splitting") because it was too narrow in scope (only addressed redundant 'sectors[]' accounting and not ios, nsecs[], etc). Cc: stable@vger.kernel.org Signed-off-by: Mike Snitzer Link: https://lore.kernel.org/r/20220128155841.39644-3-snitzer@redhat.com Signed-off-by: Jens Axboe commit e45c47d1f94e0cc7b6b079fdb4bcce2995e2adc4 Author: Mike Snitzer Date: Fri Jan 28 10:58:39 2022 -0500 block: add bio_start_io_acct_time() to control start_time bio_start_io_acct_time() interface is like bio_start_io_acct() that allows start_time to be passed in. This gives drivers the ability to defer starting accounting until after IO is issued (but possibily not entirely due to bio splitting). Reviewed-by: Christoph Hellwig Signed-off-by: Mike Snitzer Link: https://lore.kernel.org/r/20220128155841.39644-2-snitzer@redhat.com Signed-off-by: Jens Axboe commit 169387e2aa291a4e3cb856053730fe99d6cec06f Merge: 073819e0ff389 4db09593af0b0 Author: Linus Torvalds Date: Fri Jan 28 21:17:58 2022 +0200 Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fixes from James Bottomley: "Sixteen patches, mostly minor fixes and updates; however there are substantive driver bug fixes in pm8001, bnx2fc, zfcp, myrs and qedf" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: myrs: Fix crash in error case scsi: 53c700: Remove redundant assignment to pointer SCp scsi: ufs: Treat link loss as fatal error scsi: ufs: Use generic error code in ufshcd_set_dev_pwr_mode() scsi: bfa: Remove useless DMA-32 fallback configuration scsi: hisi_sas: Remove useless DMA-32 fallback configuration scsi: 3w-sas: Remove useless DMA-32 fallback configuration scsi: bnx2fc: Flush destroy_work queue before calling bnx2fc_interface_put() scsi: zfcp: Fix failed recovery on gone remote port with non-NPIV FCP devices scsi: pm8001: Fix bogus FW crash for maxcpus=1 scsi: qedf: Change context reset messages to ratelimited scsi: qedf: Fix refcount issue when LOGO is received during TMF scsi: qedf: Add stag_work to all the vports scsi: ufs: ufshcd-pltfrm: Check the return value of devm_kstrdup() scsi: target: iscsi: Make sure the np under each tpg is unique scsi: elx: efct: Don't use GFP_KERNEL under spin lock commit 073819e0ff389ee94dadd2d5340bfdc108ccddff Merge: a7b4b0076b5c7 f5390cd0b43c2 Author: Linus Torvalds Date: Fri Jan 28 21:12:07 2022 +0200 Merge tag 'efi-urgent-for-v5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi Pull EFI fixes from Ard Biesheuvel: - avoid UEFI v2.00+ runtime services on Apple Mac systems, as they have been reported to cause crashes, and most Macs claim to be EFI v1.10 anyway - avoid a spurious boot time warning on arm64 systems with 64k pages * tag 'efi-urgent-for-v5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi: efi: runtime: avoid EFIv2 runtime services on Apple x86 machines efi/libstub: arm64: Fix image check alignment at entry commit 7f5056b9e7b71149bf11073f00a57fa1ac2921a9 Author: Vivek Goyal Date: Wed Jan 26 15:35:14 2022 -0500 security, lsm: dentry_init_security() Handle multi LSM registration A ceph user has reported that ceph is crashing with kernel NULL pointer dereference. Following is the backtrace. /proc/version: Linux version 5.16.2-arch1-1 (linux@archlinux) (gcc (GCC) 11.1.0, GNU ld (GNU Binutils) 2.36.1) #1 SMP PREEMPT Thu, 20 Jan 2022 16:18:29 +0000 distro / arch: Arch Linux / x86_64 SELinux is not enabled ceph cluster version: 16.2.7 (dd0603118f56ab514f133c8d2e3adfc983942503) relevant dmesg output: [ 30.947129] BUG: kernel NULL pointer dereference, address: 0000000000000000 [ 30.947206] #PF: supervisor read access in kernel mode [ 30.947258] #PF: error_code(0x0000) - not-present page [ 30.947310] PGD 0 P4D 0 [ 30.947342] Oops: 0000 [#1] PREEMPT SMP PTI [ 30.947388] CPU: 5 PID: 778 Comm: touch Not tainted 5.16.2-arch1-1 #1 86fbf2c313cc37a553d65deb81d98e9dcc2a3659 [ 30.947486] Hardware name: Gigabyte Technology Co., Ltd. B365M DS3H/B365M DS3H, BIOS F5 08/13/2019 [ 30.947569] RIP: 0010:strlen+0x0/0x20 [ 30.947616] Code: b6 07 38 d0 74 16 48 83 c7 01 84 c0 74 05 48 39 f7 75 ec 31 c0 31 d2 89 d6 89 d7 c3 48 89 f8 31 d2 89 d6 89 d7 c3 0 f 1f 40 00 <80> 3f 00 74 12 48 89 f8 48 83 c0 01 80 38 00 75 f7 48 29 f8 31 ff [ 30.947782] RSP: 0018:ffffa4ed80ffbbb8 EFLAGS: 00010246 [ 30.947836] RAX: 0000000000000000 RBX: ffffa4ed80ffbc60 RCX: 0000000000000000 [ 30.947904] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 [ 30.947971] RBP: ffff94b0d15c0ae0 R08: 0000000000000000 R09: 0000000000000000 [ 30.948040] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 [ 30.948106] R13: 0000000000000001 R14: ffffa4ed80ffbc60 R15: 0000000000000000 [ 30.948174] FS: 00007fc7520f0740(0000) GS:ffff94b7ced40000(0000) knlGS:0000000000000000 [ 30.948252] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 30.948308] CR2: 0000000000000000 CR3: 0000000104a40001 CR4: 00000000003706e0 [ 30.948376] Call Trace: [ 30.948404] [ 30.948431] ceph_security_init_secctx+0x7b/0x240 [ceph 49f9c4b9bf5be8760f19f1747e26da33920bce4b] [ 30.948582] ceph_atomic_open+0x51e/0x8a0 [ceph 49f9c4b9bf5be8760f19f1747e26da33920bce4b] [ 30.948708] ? get_cached_acl+0x4d/0xa0 [ 30.948759] path_openat+0x60d/0x1030 [ 30.948809] do_filp_open+0xa5/0x150 [ 30.948859] do_sys_openat2+0xc4/0x190 [ 30.948904] __x64_sys_openat+0x53/0xa0 [ 30.948948] do_syscall_64+0x5c/0x90 [ 30.948989] ? exc_page_fault+0x72/0x180 [ 30.949034] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 30.949091] RIP: 0033:0x7fc7521e25bb [ 30.950849] Code: 25 00 00 41 00 3d 00 00 41 00 74 4b 64 8b 04 25 18 00 00 00 85 c0 75 67 44 89 e2 48 89 ee bf 9c ff ff ff b8 01 01 0 0 00 0f 05 <48> 3d 00 f0 ff ff 0f 87 91 00 00 00 48 8b 54 24 28 64 48 2b 14 25 Core of the problem is that ceph checks for return code from security_dentry_init_security() and if return code is 0, it assumes everything is fine and continues to call strlen(name), which crashes. Typically SELinux LSM returns 0 and sets name to "security.selinux" and it is not a problem. Or if selinux is not compiled in or disabled, it returns -EOPNOTSUP and ceph deals with it. But somehow in this configuration, 0 is being returned and "name" is not being initialized and that's creating the problem. Our suspicion is that BPF LSM is registering a hook for dentry_init_security() and returns hook default of 0. LSM_HOOK(int, 0, dentry_init_security, struct dentry *dentry,...) I have not been able to reproduce it just by doing CONFIG_BPF_LSM=y. Stephen has tested the patch though and confirms it solves the problem for him. dentry_init_security() is written in such a way that it expects only one LSM to register the hook. Atleast that's the expectation with current code. If another LSM returns a hook and returns default, it will simply return 0 as of now and that will break ceph. Hence, suggestion is that change semantics of this hook a bit. If there are no LSMs or no LSM is taking ownership and initializing security context, then return -EOPNOTSUP. Also allow at max one LSM to initialize security context. This hook can't deal with multiple LSMs trying to init security context. This patch implements this new behavior. Reported-by: Stephen Muth Tested-by: Stephen Muth Suggested-by: Casey Schaufler Acked-by: Casey Schaufler Reviewed-by: Serge Hallyn Cc: Jeff Layton Cc: Christian Brauner Cc: Paul Moore Cc: # 5.16.0 Signed-off-by: Vivek Goyal Reviewed-by: Jeff Layton Acked-by: Paul Moore Acked-by: Christian Brauner Signed-off-by: James Morris commit a7b4b0076b5c76090b35c1eb8eebe308ce800b2d Merge: df0001545b276 33569ef3c754a Author: Linus Torvalds Date: Fri Jan 28 20:44:07 2022 +0200 Merge tag 'pm-5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull power management fixes from Rafael Wysocki: "These make the buffer handling in pm_show_wakelocks() more robust and drop an unused hibernation-related function. Specifics: - Make the buffer handling in pm_show_wakelocks() more robust by using sysfs_emit_at() in it to generate output (Greg Kroah-Hartman). - Drop register_nosave_region_late() which is not used (Amadeusz Sławiński)" * tag 'pm-5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: PM: hibernate: Remove register_nosave_region_late() PM: wakeup: simplify the output logic of pm_show_wakelocks() commit df0001545b2769e6aa33a45e26c00a4cdac48c29 Merge: 76fcbc9c7c57a 67ab5eb71b37b Author: Linus Torvalds Date: Fri Jan 28 19:30:35 2022 +0200 Merge tag 'trace-v5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pulltracing fixes from Steven Rostedt: - Limit mcount build time sorting to only those archs that we know it works for. - Fix memory leak in error path of histogram setup - Fix and clean up rel_loc array out of bounds issue - tools/rtla documentation fixes - Fix issues with histogram logic * tag 'trace-v5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing: Don't inc err_log entry count if entry allocation fails tracing: Propagate is_signed to expression tracing: Fix smatch warning for do while check in event_hist_trigger_parse() tracing: Fix smatch warning for null glob in event_hist_trigger_parse() tools/tracing: Update Makefile to build rtla rtla: Make doc build optional tracing/perf: Avoid -Warray-bounds warning for __rel_loc macro tracing: Avoid -Warray-bounds warning for __rel_loc macro tracing/histogram: Fix a potential memory leak for kstrdup() ftrace: Have architectures opt-in for mcount build time sorting commit c89e5eb7dcf1519e5e084ee82e0d29d4e751ddb7 Author: Geert Uytterhoeven Date: Fri Jan 28 10:03:58 2022 +0100 dt-bindings: interrupt-controller: sifive,plic: Group interrupt tuples To improve human readability and enable automatic validation, the tuples in "interrupts-extended" properties should be grouped using angle brackets. Signed-off-by: Geert Uytterhoeven Reviewed-by: Rob Herring Reviewed-by: Anup Patel Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/211705e74a2ce77de43d036c5dea032484119bf7.1643360419.git.geert@linux-m68k.org commit 8fbc16d26d3a1ed3d80553b773be29408750987b Author: Geert Uytterhoeven Date: Fri Jan 28 10:03:57 2022 +0100 dt-bindings: interrupt-controller: sifive,plic: Fix number of interrupts The number of interrupts lacks an upper bound, thus assuming one, causing properly grouped "interrupts-extended" properties to be flagged as an error by "make dtbs_check". Fix this by adding the missing "maxItems", using the architectural maximum of 15872 interrupts. Signed-off-by: Geert Uytterhoeven Acked-by: Rob Herring Reviewed-by: Anup Patel Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/f73a0aead89e1426b146c4c64f797aa035868bf0.1643360419.git.geert@linux-m68k.org commit 76fcbc9c7c57a5d44e7ca493d8f2f6eba3964f29 Merge: a773abf72eb0c f9d87929d451d Author: Linus Torvalds Date: Fri Jan 28 19:25:24 2022 +0200 Merge branch 'ucount-rlimit-fixes-for-v5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace Pull ucount rlimit fix from Eric Biederman. Make sure the ucounts have a reference to the user namespace it refers to, so that users that themselves don't carry such a reference around can safely use the ucount functions. * 'ucount-rlimit-fixes-for-v5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: ucount: Make get_ucount a safe get_user replacement commit e8cc7a5d1ad2d44e7f43664ef6a61e31c0545a5b Author: Geert Uytterhoeven Date: Wed Jan 26 13:32:05 2022 +0100 dt-bindings: irqchip: renesas-irqc: Add R-Car V3U support Document support for the Interrupt Controller for External Devices (INT-EC) in the Renesas R-Car V3U (r8a779a0) SoC. Signed-off-by: Geert Uytterhoeven Tested-by: Kieran Bingham Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/85b246cc0792663c72c1bb12a8576bd23d2299d3.1643200256.git.geert+renesas@glider.be commit a773abf72eb0cac008743891068ca6edecc44683 Merge: 56a14c69ae5e0 da123016ca8cb Author: Linus Torvalds Date: Fri Jan 28 19:19:22 2022 +0200 Merge tag 'rcu-urgent.2022.01.26a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu Pull RCU fix from Paul McKenney: "This fixes a brown-paper-bag bug in RCU tasks that causes things like BPF and ftrace to fail miserably on systems with non-power-of-two numbers of CPUs. It fixes a math error added in 7a30871b6a27 ("rcu-tasks: Introduce ->percpu_enqueue_shift for dynamic queue selection') during the v5.17 merge window. This commit works correctly only on systems with a power-of-two number of CPUs, which just so happens to be the kind that rcutorture always uses by default. This pull request fixes the math so that things also work on systems that don't happen to have a power-of-two number of CPUs" * tag 'rcu-urgent.2022.01.26a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu: rcu-tasks: Fix computation of CPU-to-list shift counts commit 56a14c69ae5e0a1661e4b54ebf2fbf6e7410a9ec Merge: 3cd7cd8a62e6f 9ff5549b1d1d3 Author: Linus Torvalds Date: Fri Jan 28 19:06:11 2022 +0200 Merge tag 'hyperv-fixes-signed-20220128' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux Pull hyperv fixes from Wei Liu: - Fix screen resolution for hyperv framebuffer (Michael Kelley) - Fix packet header accounting for balloon driver (Yanming Liu) * tag 'hyperv-fixes-signed-20220128' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux: video: hyperv_fb: Fix validation of screen resolution Drivers: hv: balloon: account for vmbus packet header in max_pkt_size commit 3cd7cd8a62e6f4b81e8429db7afcb11cc155ea3c Merge: e0152705e4630 17179d0068b20 Author: Linus Torvalds Date: Fri Jan 28 19:00:26 2022 +0200 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull kvm fixes from Paolo Bonzini: "Two larger x86 series: - Redo incorrect fix for SEV/SMAP erratum - Windows 11 Hyper-V workaround Other x86 changes: - Various x86 cleanups - Re-enable access_tracking_perf_test - Fix for #GP handling on SVM - Fix for CPUID leaf 0Dh in KVM_GET_SUPPORTED_CPUID - Fix for ICEBP in interrupt shadow - Avoid false-positive RCU splat - Enable Enlightened MSR-Bitmap support for real ARM: - Correctly update the shadow register on exception injection when running in nVHE mode - Correctly use the mm_ops indirection when performing cache invalidation from the page-table walker - Restrict the vgic-v3 workaround for SEIS to the two known broken implementations Generic code changes: - Dead code cleanup" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (43 commits) KVM: eventfd: Fix false positive RCU usage warning KVM: nVMX: Allow VMREAD when Enlightened VMCS is in use KVM: nVMX: Implement evmcs_field_offset() suitable for handle_vmread() KVM: nVMX: Rename vmcs_to_field_offset{,_table} KVM: nVMX: eVMCS: Filter out VM_EXIT_SAVE_VMX_PREEMPTION_TIMER KVM: nVMX: Also filter MSR_IA32_VMX_TRUE_PINBASED_CTLS when eVMCS selftests: kvm: check dynamic bits against KVM_X86_XCOMP_GUEST_SUPP KVM: x86: add system attribute to retrieve full set of supported xsave states KVM: x86: Add a helper to retrieve userspace address from kvm_device_attr selftests: kvm: move vm_xsave_req_perm call to amx_test KVM: x86: Sync the states size with the XCR0/IA32_XSS at, any time KVM: x86: Update vCPU's runtime CPUID on write to MSR_IA32_XSS KVM: x86: Keep MSR_IA32_XSS unchanged for INIT KVM: x86: Free kvm_cpuid_entry2 array on post-KVM_RUN KVM_SET_CPUID{,2} KVM: nVMX: WARN on any attempt to allocate shadow VMCS for vmcs02 KVM: selftests: Don't skip L2's VMCALL in SMM test for SVM guest KVM: x86: Check .flags in kvm_cpuid_check_equal() too KVM: x86: Forcibly leave nested virt when SMM state is toggled KVM: SVM: drop unnecessary code in svm_hv_vmcb_dirty_nested_enlightenments() KVM: SVM: hyper-v: Enable Enlightened MSR-Bitmap support for real ... commit e0152705e4630b4a6ae8eb716aa44ed5a90054ea Merge: 7eb3625489813 fa62f39dc7e25 Author: Linus Torvalds Date: Fri Jan 28 18:53:45 2022 +0200 Merge tag 'mips-fixes-5.17_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux Pull MIPS build fix from Thomas Bogendoerfer: "Fix for allmodconfig build" * tag 'mips-fixes-5.17_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: MIPS: Fix build error due to PTR used in more places commit 7eb36254898131ef2feed7629ae93bc6a2c56d18 Merge: 8157f4707360a 663d34c8df987 Author: Linus Torvalds Date: Fri Jan 28 18:50:05 2022 +0200 Merge tag 's390-5.17-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull s390 fixes from Vasily Gorbik: - Fix loading of modules with lots of relocations and add a regression test for it. - Fix machine check handling for vector validity and guarded storage validity failures in KVM guests. - Fix hypervisor performance data to include z/VM guests with access control group set. - Fix z900 build problem in uaccess code. - Update defconfigs. * tag 's390-5.17-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390/hypfs: include z/VM guests with access control group set s390: update defconfigs s390/module: test loading modules with a lot of relocations s390/module: fix loading modules with a lot of relocations s390/uaccess: fix compile error s390/nmi: handle vector validity failures for KVM guests s390/nmi: handle guarded storage validity failures for KVM guests commit 4028bccb003cf67e46632dee7f97ddc5d7b6e685 Author: Mike Marciniszyn Date: Wed Jan 19 04:28:09 2022 -0500 IB/rdmavt: Validate remote_addr during loopback atomic tests The rdma-core test suite sends an unaligned remote address and expects a failure. ERROR: test_atomic_non_aligned_addr (tests.test_atomic.AtomicTest) The qib/hfi1 rc handling validates properly, but the test has the client and server on the same system. The loopback of these operations is a distinct code path. Fix by syntaxing the proposed remote address in the loopback code path. Fixes: 15703461533a ("IB/{hfi1, qib, rdmavt}: Move ruc_loopback to rdmavt") Link: https://lore.kernel.org/r/1642584489-141005-1-git-send-email-mike.marciniszyn@cornelisnetworks.com Reviewed-by: Dennis Dalessandro Signed-off-by: Mike Marciniszyn Signed-off-by: Jason Gunthorpe commit b856101a1774b5f1c8c99e8dfdef802856520732 Author: Mark Zhang Date: Wed Jan 19 10:37:55 2022 +0200 IB/cm: Release previously acquired reference counter in the cm_id_priv In failure flow, the reference counter acquired was not released, and the following error was reported: drivers/infiniband/core/cm.c:3373 cm_lap_handler() warn: inconsistent refcounting 'cm_id_priv->refcount.refs.counter': Fixes: 7345201c3963 ("IB/cm: Improve the calling of cm_init_av_for_lap and cm_init_av_by_path") Link: https://lore.kernel.org/r/7615f23bbb5c5b66d03f6fa13e1c99d51dae6916.1642581448.git.leonro@nvidia.com Reported-by: Dan Carpenter Signed-off-by: Mark Zhang Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 8157f4707360a17027538fa43b1b89b534c65eb9 Merge: f6a26318e3148 4584a768f22b7 Author: Linus Torvalds Date: Fri Jan 28 18:36:42 2022 +0200 Merge tag 'ceph-for-5.17-rc2' of git://github.com/ceph/ceph-client Pull ceph fixes from Ilya Dryomov: "A ZERO_SIZE_PTR dereference fix from Xiubo and two fixes for async creates interacting with pool namespace-constrained OSD permissions from Jeff (marked for stable)" * tag 'ceph-for-5.17-rc2' of git://github.com/ceph/ceph-client: ceph: set pool_ns in new inode layout for async creates ceph: properly put ceph_string reference after async create attempt ceph: put the requests/sessions when it fails to alloc memory commit 483529f3209f56d4c7a465d045278a2546ae7ed9 Author: David Howells Date: Thu Jan 27 16:02:34 2022 +0000 Fix a warning about a malformed kernel doc comment in cifs Fix by removing the extra asterisk. Signed-off-by: David Howells Acked-by: Jeff Layton Reviewed-by: Rohith Surabattula Signed-off-by: Steve French commit 297ae1eb23b04c5a46111ab53c8d0f69af43f402 Author: James Morse Date: Tue Jan 25 15:40:40 2022 +0000 arm64: cpufeature: List early Cortex-A510 parts as having broken dbm Versions of Cortex-A510 before r0p3 are affected by a hardware erratum where the hardware update of the dirty bit is not correctly ordered. Add these cpus to the cpu_has_broken_dbm list. Signed-off-by: James Morse Link: https://lore.kernel.org/r/20220125154040.549272-3-james.morse@arm.com Signed-off-by: Catalin Marinas commit f6a26318e3148289717b0f39ee976f9d95a93f4d Author: Linus Torvalds Date: Fri Jan 28 10:00:29 2022 +0200 ocfs2: fix subdirectory registration with register_sysctl() The kernel test robot reports that commit c42ff46f97c1 ("ocfs2: simplify subdirectory registration with register_sysctl()") is broken, and results in kernel warning messages like sysctl table check failed: fs/ocfs2/nm Not a file sysctl table check failed: fs/ocfs2/nm No proc_handler sysctl table check failed: fs/ocfs2/nm bogus .mode 0555 and in fact this was already reported back in linux-next, but nobody seems to have reacted to that report. Possibly that original report only ever made it to the lkp list. The problem seems to be that the simplification didn't actually go far enough, and should have converted the whole directory path to the final sysctl file, rather than just the two first components. So take that last step. Fixes: c42ff46f97c1 ("ocfs2: simplify subdirectory registration with register_sysctl()") Reported-by: kernel test robot Link: https://lore.kernel.org/all/20220128065310.GF8421@xsang-OptiPlex-9020/ Link: https://lists.01.org/hyperkitty/list/lkp@lists.01.org/thread/KQ2F6TPJWMDVEXJM4WTUC4DU3EH3YJVT/ Tested-by: Jan Kara Reviewed-by: Jan Kara Cc: Luis Chamberlain Cc: Andrew Morton Signed-off-by: Linus Torvalds commit df20597044e59cd383135b3d91c5b131dc333969 Merge: 9ae279ecabe3e 708e8af4924ec Author: Catalin Marinas Date: Fri Jan 28 16:14:06 2022 +0000 Merge tag 'trbe-cortex-a510-errata' of gitolite.kernel.org:pub/scm/linux/kernel/git/coresight/linux into for-next/fixes coresight: trbe: Workaround Cortex-A510 erratas This pull request is providing arm64 definitions to support TRBE Cortex-A510 erratas. Signed-off-by: Mathieu Poirier * tag 'trbe-cortex-a510-errata' of gitolite.kernel.org:pub/scm/linux/kernel/git/coresight/linux: arm64: errata: Add detection for TRBE trace data corruption arm64: errata: Add detection for TRBE invalid prohibited states arm64: errata: Add detection for TRBE ignored system register writes arm64: Add Cortex-A510 CPU part definition commit 4045daf0fa87846a27f56329fddad2deeb5ca354 Author: Peter Ujfalusi Date: Wed Jan 26 12:03:25 2022 +0200 ASoC: rt5682: Fix deadlock on resume On resume from suspend the following chain of events can happen: A rt5682_resume() -> mod_delayed_work() for jack_detect_work B DAPM sequence starts ( DAPM is locked now) A1. rt5682_jack_detect_handler() scheduled - Takes both jdet_mutex and calibrate_mutex - Calls in to rt5682_headset_detect() which tries to take DAPM lock, it starts to wait for it as B path took it already. B1. DAPM sequence reaches the "HP Amp", rt5682_hp_event() tries to take the jdet_mutex, but it is locked in A1, so it waits. Deadlock. To solve the deadlock, drop the jdet_mutex, use the jack_detect_work to do the jack removal handling, move the dapm lock up one level to protect the most of the rt5682_jack_detect_handler(), but not the jack reporting as it might trigger a DAPM sequence. The rt5682_headset_detect() can be changed to static as well. Fixes: 8deb34a90f063 ("ASoC: rt5682: fix the wrong jack type detected") Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20220126100325.16513-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 06feec6005c9d9500cd286ec440aabf8b2ddd94d Author: Dmitry Osipenko Date: Wed Jan 12 22:50:39 2022 +0300 ASoC: hdmi-codec: Fix OOB memory accesses Correct size of iec_status array by changing it to the size of status array of the struct snd_aes_iec958. This fixes out-of-bounds slab read accesses made by memcpy() of the hdmi-codec driver. This problem is reported by KASAN. Cc: stable@vger.kernel.org Signed-off-by: Dmitry Osipenko Link: https://lore.kernel.org/r/20220112195039.1329-1-digetx@gmail.com Signed-off-by: Mark Brown commit 9f620684c1ef5a002b6622ecc7b5818e81252f48 Author: Takashi Iwai Date: Wed Jan 19 16:52:49 2022 +0100 ASoC: soc-pcm: Move debugfs removal out of spinlock The recent fix for DPCM locking also covered the loop in dpcm_be_disconnect() with the FE stream lock. This caused an unexpected side effect, thought: calling debugfs_remove_recursive() in the spinlock may lead to lockdep splats as the code there assumes the SOFTIRQ-safe context. For avoiding the problem, this patch changes the disconnection procedure to two phases: at first, the matching entries are removed from the linked list, then the resources are freed outside the lock. Fixes: b7898396f4bb ("ASoC: soc-pcm: Fix and cleanup DPCM locking") Reported-and-tested-by: Marek Szyprowski Signed-off-by: Takashi Iwai Link: https://lore.kernel.org/r/20220119155249.26754-3-tiwai@suse.de Signed-off-by: Mark Brown commit 3c75c0ea5da749bd1efebd1387f2e5011b8c7d78 Author: Takashi Iwai Date: Wed Jan 19 16:52:48 2022 +0100 ASoC: soc-pcm: Fix DPCM lockdep warning due to nested stream locks The recent change for DPCM locking caused spurious lockdep warnings. Actually the warnings are false-positive, as those are triggered due to the nested stream locks for FE and BE. Since both locks belong to the same lock class, lockdep sees it as if a deadlock. For fixing this, we need to take PCM stream locks for BE with the nested lock primitives. Since currently snd_pcm_stream_lock*() helper assumes only the top-level single locking, a new helper function snd_pcm_stream_lock_irqsave_nested() is defined for a single-depth nested lock, which is now used in the BE DAI trigger that is always performed inside a FE stream lock. Fixes: b2ae80663008 ("ASoC: soc-pcm: serialize BE triggers") Reported-and-tested-by: Hans de Goede Reported-and-tested-by: Marek Szyprowski Link: https://lore.kernel.org/r/73018f3c-9769-72ea-0325-b3f8e2381e30@redhat.com Link: https://lore.kernel.org/alsa-devel/9a0abddd-49e9-872d-2f00-a1697340f786@samsung.com Signed-off-by: Takashi Iwai Link: https://lore.kernel.org/r/20220119155249.26754-2-tiwai@suse.de Signed-off-by: Mark Brown commit 4897e722b54f10e2e96c3eeca260caa7a8b0dbff Merge: c2b19fd753114 29044dae2e746 Author: Linus Torvalds Date: Fri Jan 28 17:51:31 2022 +0200 Merge tag 'fsnotify_for_v5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs Pull fsnotify fixes from Jan Kara: "Fixes for userspace breakage caused by fsnotify changes ~3 years ago and one fanotify cleanup" * tag 'fsnotify_for_v5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: fsnotify: fix fsnotify hooks in pseudo filesystems fsnotify: invalidate dcache before IN_DELETE event fanotify: remove variable set but not used commit a75badebfdc0b3823054bedf112edb54d6357c75 Author: Dan Carpenter Date: Tue Jan 18 12:11:04 2022 +0300 RDMA/siw: Fix refcounting leak in siw_create_qp() The atomic_inc() needs to be paired with an atomic_dec() on the error path. Fixes: 514aee660df4 ("RDMA: Globally allocate and release QP memory") Link: https://lore.kernel.org/r/20220118091104.GA11671@kili Signed-off-by: Dan Carpenter Reviewed-by: Leon Romanovsky Reviewed-by: Bernard Metzler Signed-off-by: Jason Gunthorpe commit 36e8169ec973359f671f9ec7213547059cae972e Author: Leon Romanovsky Date: Tue Jan 18 09:35:01 2022 +0200 RDMA/ucma: Protect mc during concurrent multicast leaves Partially revert the commit mentioned in the Fixes line to make sure that allocation and erasing multicast struct are locked. BUG: KASAN: use-after-free in ucma_cleanup_multicast drivers/infiniband/core/ucma.c:491 [inline] BUG: KASAN: use-after-free in ucma_destroy_private_ctx+0x914/0xb70 drivers/infiniband/core/ucma.c:579 Read of size 8 at addr ffff88801bb74b00 by task syz-executor.1/25529 CPU: 0 PID: 25529 Comm: syz-executor.1 Not tainted 5.16.0-rc7-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_address_description.constprop.0.cold+0x8d/0x320 mm/kasan/report.c:247 __kasan_report mm/kasan/report.c:433 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:450 ucma_cleanup_multicast drivers/infiniband/core/ucma.c:491 [inline] ucma_destroy_private_ctx+0x914/0xb70 drivers/infiniband/core/ucma.c:579 ucma_destroy_id+0x1e6/0x280 drivers/infiniband/core/ucma.c:614 ucma_write+0x25c/0x350 drivers/infiniband/core/ucma.c:1732 vfs_write+0x28e/0xae0 fs/read_write.c:588 ksys_write+0x1ee/0x250 fs/read_write.c:643 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 Currently the xarray search can touch a concurrently freeing mc as the xa_for_each() is not surrounded by any lock. Rather than hold the lock for a full scan hold it only for the effected items, which is usually an empty list. Fixes: 95fe51096b7a ("RDMA/ucma: Remove mc_list and rely on xarray") Link: https://lore.kernel.org/r/1cda5fabb1081e8d16e39a48d3a4f8160cea88b8.1642491047.git.leonro@nvidia.com Reported-by: syzbot+e3f96c43d19782dd14a7@syzkaller.appspotmail.com Suggested-by: Jason Gunthorpe Reviewed-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit d9e410ebbed9d091b97bdf45b8a3792e2878dc48 Author: Maor Gottlieb Date: Tue Jan 18 09:35:00 2022 +0200 RDMA/cma: Use correct address when leaving multicast group In RoCE we should use cma_iboe_set_mgid() and not cma_set_mgid to generate the mgid, otherwise we will generate an IGMP for an incorrect address. Fixes: b5de0c60cc30 ("RDMA/cma: Fix use after free race in roce multicast join") Link: https://lore.kernel.org/r/913bc6783fd7a95fe71ad9454e01653ee6fb4a9a.1642491047.git.leonro@nvidia.com Signed-off-by: Maor Gottlieb Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit c2b19fd753114f8e11d313389ee1252dc3bb70d7 Merge: 145d9b498fc82 9daf0a4d32d60 Author: Linus Torvalds Date: Fri Jan 28 17:19:49 2022 +0200 Merge tag 'fs_for_v5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs Pull udf and quota fixes from Jan Kara: "Fixes for crashes in UDF when inode expansion fails and one quota cleanup" * tag 'fs_for_v5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: quota: cleanup double word in comment udf: Restore i_lenAlloc when inode expansion fails udf: Fix NULL ptr deref when converting from inline format commit d5081bf5dcfb1cb83fb538708b0ac07a10a79cc4 Author: Dave Jiang Date: Thu Jan 27 13:31:12 2022 -0700 ntb: intel: fix port config status offset for SPR The field offset for port configuration status on SPR has been changed to bit 14 from ICX where it resides at bit 12. By chance link status detection continued to work on SPR. This is due to bit 12 being a configuration bit which is in sync with the status bit. Fix this by checking for a SPR device and checking correct status bit. Fixes: 26bfe3d0b227 ("ntb: intel: Add Icelake (gen4) support for Intel NTB") Tested-by: Jerry Dai Signed-off-by: Dave Jiang Signed-off-by: Jon Mason commit 6449520391dfc3d2cef134f11a91251a054ff7d0 Author: Jisheng Zhang Date: Fri Jan 28 22:15:50 2022 +0800 net: stmmac: properly handle with runtime pm in stmmac_dvr_remove() There are two issues with runtime pm handling in stmmac_dvr_remove(): 1. the mac is runtime suspended before stopping dma and rx/tx. We need to ensure the device is properly resumed back. 2. the stmmaceth clk enable/disable isn't balanced in both exit and error handling code path. Take the exit code path for example, when we unbind the driver or rmmod the driver module, the mac is runtime suspended as said above, so the stmmaceth clk is disabled, but stmmac_dvr_remove() stmmac_remove_config_dt() clk_disable_unprepare() CCF will complain this time. The error handling code path suffers from the similar situtaion. Here are kernel warnings in error handling code path on Allwinner D1 platform: [ 1.604695] ------------[ cut here ]------------ [ 1.609328] bus-emac already disabled [ 1.613015] WARNING: CPU: 0 PID: 38 at drivers/clk/clk.c:952 clk_core_disable+0xcc/0xec [ 1.621039] CPU: 0 PID: 38 Comm: kworker/u2:1 Not tainted 5.14.0-rc4#1 [ 1.627653] Hardware name: Allwinner D1 NeZha (DT) [ 1.632443] Workqueue: events_unbound deferred_probe_work_func [ 1.638286] epc : clk_core_disable+0xcc/0xec [ 1.642561] ra : clk_core_disable+0xcc/0xec [ 1.646835] epc : ffffffff8023c2ec ra : ffffffff8023c2ec sp : ffffffd00411bb10 [ 1.654054] gp : ffffffff80ec9988 tp : ffffffe00143a800 t0 : ffffffff80ed6a6f [ 1.661272] t1 : ffffffff80ed6a60 t2 : 0000000000000000 s0 : ffffffe001509e00 [ 1.668489] s1 : 0000000000000001 a0 : 0000000000000019 a1 : ffffffff80e80bd8 [ 1.675707] a2 : 00000000ffffefff a3 : 00000000000000f4 a4 : 0000000000000002 [ 1.682924] a5 : 0000000000000001 a6 : 0000000000000030 a7 : 00000000028f5c29 [ 1.690141] s2 : 0000000000000800 s3 : ffffffe001375000 s4 : ffffffe01fdf7a80 [ 1.697358] s5 : ffffffe001375010 s6 : ffffffff8001fc10 s7 : ffffffffffffffff [ 1.704577] s8 : 0000000000000001 s9 : ffffffff80ecb248 s10: ffffffe001b80000 [ 1.711794] s11: ffffffe001b80760 t3 : 0000000000000062 t4 : ffffffffffffffff [ 1.719012] t5 : ffffffff80e0f6d8 t6 : ffffffd00411b8f0 [ 1.724321] status: 8000000201800100 badaddr: 0000000000000000 cause: 0000000000000003 [ 1.732233] [] clk_core_disable+0xcc/0xec [ 1.737810] [] clk_disable+0x38/0x78 [ 1.742956] [] worker_thread+0x1a8/0x4d8 [ 1.748451] [] stmmac_remove_config_dt+0x1c/0x4c [ 1.754646] [] sun8i_dwmac_probe+0x378/0x82c [ 1.760484] [] worker_thread+0x1a8/0x4d8 [ 1.765975] [] platform_probe+0x64/0xf0 [ 1.771382] [] really_probe.part.0+0x8c/0x30c [ 1.777305] [] __driver_probe_device+0xa0/0x148 [ 1.783402] [] driver_probe_device+0x38/0x138 [ 1.789324] [] __device_attach_driver+0xd0/0x170 [ 1.795508] [] __driver_attach_async_helper+0xbc/0xc0 [ 1.802125] [] bus_for_each_drv+0x68/0xb4 [ 1.807701] [] __device_attach+0xd8/0x184 [ 1.813277] [] bus_probe_device+0x98/0xbc [ 1.818852] [] deferred_probe_work_func+0x90/0xd4 [ 1.825122] [] process_one_work+0x1e4/0x390 [ 1.830872] [] worker_thread+0x31c/0x4d8 [ 1.836362] [] kthreadd+0x94/0x188 [ 1.841335] [] kthreadd+0x94/0x188 [ 1.846304] [] process_one_work+0x38c/0x390 [ 1.852054] [] kthread+0x124/0x160 [ 1.857021] [] set_kthread_struct+0x5c/0x60 [ 1.862770] [] ret_from_syscall_rejected+0x8/0xc [ 1.868956] ---[ end trace 8d5c6046255f84a0 ]--- [ 1.873675] ------------[ cut here ]------------ [ 1.878366] bus-emac already unprepared [ 1.882378] WARNING: CPU: 0 PID: 38 at drivers/clk/clk.c:810 clk_core_unprepare+0xe4/0x168 [ 1.890673] CPU: 0 PID: 38 Comm: kworker/u2:1 Tainted: G W 5.14.0-rc4 #1 [ 1.898674] Hardware name: Allwinner D1 NeZha (DT) [ 1.903464] Workqueue: events_unbound deferred_probe_work_func [ 1.909305] epc : clk_core_unprepare+0xe4/0x168 [ 1.913840] ra : clk_core_unprepare+0xe4/0x168 [ 1.918375] epc : ffffffff8023d6cc ra : ffffffff8023d6cc sp : ffffffd00411bb10 [ 1.925593] gp : ffffffff80ec9988 tp : ffffffe00143a800 t0 : 0000000000000002 [ 1.932811] t1 : ffffffe01f743be0 t2 : 0000000000000040 s0 : ffffffe001509e00 [ 1.940029] s1 : 0000000000000001 a0 : 000000000000001b a1 : ffffffe00143a800 [ 1.947246] a2 : 0000000000000000 a3 : 00000000000000f4 a4 : 0000000000000001 [ 1.954463] a5 : 0000000000000000 a6 : 0000000005fce2a5 a7 : 0000000000000001 [ 1.961680] s2 : 0000000000000800 s3 : ffffffff80afeb90 s4 : ffffffe01fdf7a80 [ 1.968898] s5 : ffffffe001375010 s6 : ffffffff8001fc10 s7 : ffffffffffffffff [ 1.976115] s8 : 0000000000000001 s9 : ffffffff80ecb248 s10: ffffffe001b80000 [ 1.983333] s11: ffffffe001b80760 t3 : ffffffff80b39120 t4 : 0000000000000001 [ 1.990550] t5 : 0000000000000000 t6 : ffffffe001600002 [ 1.995859] status: 8000000201800120 badaddr: 0000000000000000 cause: 0000000000000003 [ 2.003771] [] clk_core_unprepare+0xe4/0x168 [ 2.009609] [] clk_unprepare+0x24/0x3c [ 2.014929] [] stmmac_remove_config_dt+0x24/0x4c [ 2.021125] [] sun8i_dwmac_probe+0x378/0x82c [ 2.026965] [] worker_thread+0x1a8/0x4d8 [ 2.032463] [] platform_probe+0x64/0xf0 [ 2.037871] [] really_probe.part.0+0x8c/0x30c [ 2.043795] [] __driver_probe_device+0xa0/0x148 [ 2.049892] [] driver_probe_device+0x38/0x138 [ 2.055815] [] __device_attach_driver+0xd0/0x170 [ 2.061999] [] __driver_attach_async_helper+0xbc/0xc0 [ 2.068616] [] bus_for_each_drv+0x68/0xb4 [ 2.074193] [] __device_attach+0xd8/0x184 [ 2.079769] [] bus_probe_device+0x98/0xbc [ 2.085345] [] deferred_probe_work_func+0x90/0xd4 [ 2.091616] [] process_one_work+0x1e4/0x390 [ 2.097367] [] worker_thread+0x31c/0x4d8 [ 2.102858] [] kthreadd+0x94/0x188 [ 2.107830] [] kthreadd+0x94/0x188 [ 2.112800] [] process_one_work+0x38c/0x390 [ 2.118551] [] kthread+0x124/0x160 [ 2.123520] [] set_kthread_struct+0x5c/0x60 [ 2.129268] [] ret_from_syscall_rejected+0x8/0xc [ 2.135455] ---[ end trace 8d5c6046255f84a1 ]--- Fixes: 5ec55823438e ("net: stmmac: add clocks management for gmac driver") Signed-off-by: Jisheng Zhang Signed-off-by: David S. Miller commit e5cce44aff3be9ad2cd52f63f35edbd706181d50 Author: Mike Marciniszyn Date: Sat Jan 15 18:02:36 2022 -0500 IB/hfi1: Fix tstats alloc and dealloc The tstats allocation is done in the accelerated ndo_init function but the allocation is not tested to succeed. The deallocation is not done in the accelerated ndo_uninit function. Resolve issues by testing for an allocation failure and adding the free_percpu in the uninit function. Fixes: aa0616a9bd52 ("IB/hfi1: switch to core handling of rx/tx byte/packet counters") Link: https://lore.kernel.org/r/1642287756-182313-5-git-send-email-mike.marciniszyn@cornelisnetworks.com Reviewed-by: Dennis Dalessandro Signed-off-by: Mike Marciniszyn Signed-off-by: Jason Gunthorpe commit 5f8f55b92edd621f056bdf09e572092849fabd83 Author: Mike Marciniszyn Date: Sat Jan 15 18:02:35 2022 -0500 IB/hfi1: Fix AIP early init panic An early failure in hfi1_ipoib_setup_rn() can lead to the following panic: BUG: unable to handle kernel NULL pointer dereference at 00000000000001b0 PGD 0 P4D 0 Oops: 0002 [#1] SMP NOPTI Workqueue: events work_for_cpu_fn RIP: 0010:try_to_grab_pending+0x2b/0x140 Code: 1f 44 00 00 41 55 41 54 55 48 89 d5 53 48 89 fb 9c 58 0f 1f 44 00 00 48 89 c2 fa 66 0f 1f 44 00 00 48 89 55 00 40 84 f6 75 77 48 0f ba 2b 00 72 09 31 c0 5b 5d 41 5c 41 5d c3 48 89 df e8 6c RSP: 0018:ffffb6b3cf7cfa48 EFLAGS: 00010046 RAX: 0000000000000246 RBX: 00000000000001b0 RCX: 0000000000000000 RDX: 0000000000000246 RSI: 0000000000000000 RDI: 00000000000001b0 RBP: ffffb6b3cf7cfa70 R08: 0000000000000f09 R09: 0000000000000001 R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000000 R13: ffffb6b3cf7cfa90 R14: ffffffff9b2fbfc0 R15: ffff8a4fdf244690 FS: 0000000000000000(0000) GS:ffff8a527f400000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000000001b0 CR3: 00000017e2410003 CR4: 00000000007706f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 PKRU: 55555554 Call Trace: __cancel_work_timer+0x42/0x190 ? dev_printk_emit+0x4e/0x70 iowait_cancel_work+0x15/0x30 [hfi1] hfi1_ipoib_txreq_deinit+0x5a/0x220 [hfi1] ? dev_err+0x6c/0x90 hfi1_ipoib_netdev_dtor+0x15/0x30 [hfi1] hfi1_ipoib_setup_rn+0x10e/0x150 [hfi1] rdma_init_netdev+0x5a/0x80 [ib_core] ? hfi1_ipoib_free_rdma_netdev+0x20/0x20 [hfi1] ipoib_intf_init+0x6c/0x350 [ib_ipoib] ipoib_intf_alloc+0x5c/0xc0 [ib_ipoib] ipoib_add_one+0xbe/0x300 [ib_ipoib] add_client_context+0x12c/0x1a0 [ib_core] enable_device_and_get+0xdc/0x1d0 [ib_core] ib_register_device+0x572/0x6b0 [ib_core] rvt_register_device+0x11b/0x220 [rdmavt] hfi1_register_ib_device+0x6b4/0x770 [hfi1] do_init_one.isra.20+0x3e3/0x680 [hfi1] local_pci_probe+0x41/0x90 work_for_cpu_fn+0x16/0x20 process_one_work+0x1a7/0x360 ? create_worker+0x1a0/0x1a0 worker_thread+0x1cf/0x390 ? create_worker+0x1a0/0x1a0 kthread+0x116/0x130 ? kthread_flush_work_fn+0x10/0x10 ret_from_fork+0x1f/0x40 The panic happens in hfi1_ipoib_txreq_deinit() because there is a NULL deref when hfi1_ipoib_netdev_dtor() is called in this error case. hfi1_ipoib_txreq_init() and hfi1_ipoib_rxq_init() are self unwinding so fix by adjusting the error paths accordingly. Other changes: - hfi1_ipoib_free_rdma_netdev() is deleted including the free_netdev() since the netdev core code deletes calls free_netdev() - The switch to the accelerated entrances is moved to the success path. Cc: stable@vger.kernel.org Fixes: d99dc602e2a5 ("IB/hfi1: Add functions to transmit datagram ipoib packets") Link: https://lore.kernel.org/r/1642287756-182313-4-git-send-email-mike.marciniszyn@cornelisnetworks.com Reviewed-by: Dennis Dalessandro Signed-off-by: Mike Marciniszyn Signed-off-by: Jason Gunthorpe commit b1151b74ff68cc83c2a8e1a618efe7d056e4f237 Author: Mike Marciniszyn Date: Sat Jan 15 18:02:34 2022 -0500 IB/hfi1: Fix alloc failure with larger txqueuelen The following allocation with large txqueuelen will result in the following warning: Call Trace: __alloc_pages_nodemask+0x283/0x2c0 kmalloc_large_node+0x3c/0xa0 __kmalloc_node+0x22a/0x2f0 hfi1_ipoib_txreq_init+0x19f/0x330 [hfi1] hfi1_ipoib_setup_rn+0xd3/0x1a0 [hfi1] rdma_init_netdev+0x5a/0x80 [ib_core] ipoib_intf_init+0x6c/0x350 [ib_ipoib] ipoib_intf_alloc+0x5c/0xc0 [ib_ipoib] ipoib_add_one+0xbe/0x300 [ib_ipoib] add_client_context+0x12c/0x1a0 [ib_core] ib_register_client+0x147/0x190 [ib_core] ipoib_init_module+0xdd/0x132 [ib_ipoib] do_one_initcall+0x46/0x1c3 do_init_module+0x5a/0x220 load_module+0x14c5/0x17f0 __do_sys_init_module+0x13b/0x180 do_syscall_64+0x5b/0x1a0 entry_SYSCALL_64_after_hwframe+0x65/0xca For ipoib, the txqueuelen is modified with the module parameter send_queue_size. Fix by changing to use kv versions of the same allocator to handle the large allocations. The allocation embeds a hdr struct that is dma mapped. Change that struct to a pointer to a kzalloced struct. Cc: stable@vger.kernel.org Fixes: d99dc602e2a5 ("IB/hfi1: Add functions to transmit datagram ipoib packets") Link: https://lore.kernel.org/r/1642287756-182313-3-git-send-email-mike.marciniszyn@cornelisnetworks.com Reviewed-by: Dennis Dalessandro Signed-off-by: Mike Marciniszyn Signed-off-by: Jason Gunthorpe commit 010a2a6623317bbf13facaff8bf50ac08468c1df Merge: 1f84a9450d75e 5d8a8b324ff48 Author: David S. Miller Date: Fri Jan 28 15:10:45 2022 +0000 Merge tag 'ieee802154-for-net-2022-01-28' of git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan Stefan Schmidt says: ==================== pull-request: ieee802154 for net 2022-01-28 An update from ieee802154 for your *net* tree. A bunch of fixes in drivers, all from Miquel Raynal. Clarifying the default channel in hwsim, leak fixes in at86rf230 and ca8210 as well as a symbol duration fix for mcr20a. Topping up the driver fixes with better error codes in nl802154 and a cleanup in MAINTAINERS for an orphaned driver. ==================== Signed-off-by: David S. Miller commit 1f84a9450d75e08af70d9e2f2d5e1c0ac0c881d2 Author: Haiyue Wang Date: Fri Jan 28 18:47:14 2022 +0800 gve: fix the wrong AdminQ buffer queue index check The 'tail' and 'head' are 'unsigned int' type free-running count, when 'head' is overflow, the 'int i (= tail) < u32 head' will be false: Only '- loop 0: idx = 63' result is shown, so it needs to use 'int' type to compare, it can handle the overflow correctly. typedef uint32_t u32; int main() { u32 tail, head; int stail, shead; int i, loop; tail = 0xffffffff; head = 0x00000000; for (i = tail, loop = 0; i < head; i++) { unsigned int idx = i & 63; printf("+ loop %d: idx = %u\n", loop++, idx); } stail = tail; shead = head; for (i = stail, loop = 0; i < shead; i++) { unsigned int idx = i & 63; printf("- loop %d: idx = %u\n", loop++, idx); } return 0; } Fixes: 5cdad90de62c ("gve: Batch AQ commands for creating and destroying queues.") Signed-off-by: Haiyue Wang Signed-off-by: David S. Miller commit 8c83d39cc730378bbac64d67a551897b203a606e Author: Mike Marciniszyn Date: Sat Jan 15 18:02:33 2022 -0500 IB/hfi1: Fix panic with larger ipoib send_queue_size When the ipoib send_queue_size is increased from the default the following panic happens: RIP: 0010:hfi1_ipoib_drain_tx_ring+0x45/0xf0 [hfi1] Code: 31 e4 eb 0f 8b 85 c8 02 00 00 41 83 c4 01 44 39 e0 76 60 8b 8d cc 02 00 00 44 89 e3 be 01 00 00 00 d3 e3 48 03 9d c0 02 00 00 83 18 01 00 00 00 00 00 00 48 8b bb 30 01 00 00 e8 25 af a7 e0 RSP: 0018:ffffc9000798f4a0 EFLAGS: 00010286 RAX: 0000000000008000 RBX: ffffc9000aa0f000 RCX: 000000000000000f RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000000 RBP: ffff88810ff08000 R08: ffff88889476d900 R09: 0000000000000101 R10: 0000000000000000 R11: ffffc90006590ff8 R12: 0000000000000200 R13: ffffc9000798fba8 R14: 0000000000000000 R15: 0000000000000001 FS: 00007fd0f79cc3c0(0000) GS:ffff88885fb00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffc9000aa0f118 CR3: 0000000889c84001 CR4: 00000000001706e0 Call Trace: hfi1_ipoib_napi_tx_disable+0x45/0x60 [hfi1] hfi1_ipoib_dev_stop+0x18/0x80 [hfi1] ipoib_ib_dev_stop+0x1d/0x40 [ib_ipoib] ipoib_stop+0x48/0xc0 [ib_ipoib] __dev_close_many+0x9e/0x110 __dev_change_flags+0xd9/0x210 dev_change_flags+0x21/0x60 do_setlink+0x31c/0x10f0 ? __nla_validate_parse+0x12d/0x1a0 ? __nla_parse+0x21/0x30 ? inet6_validate_link_af+0x5e/0xf0 ? cpumask_next+0x1f/0x20 ? __snmp6_fill_stats64.isra.53+0xbb/0x140 ? __nla_validate_parse+0x47/0x1a0 __rtnl_newlink+0x530/0x910 ? pskb_expand_head+0x73/0x300 ? __kmalloc_node_track_caller+0x109/0x280 ? __nla_put+0xc/0x20 ? cpumask_next_and+0x20/0x30 ? update_sd_lb_stats.constprop.144+0xd3/0x820 ? _raw_spin_unlock_irqrestore+0x25/0x37 ? __wake_up_common_lock+0x87/0xc0 ? kmem_cache_alloc_trace+0x3d/0x3d0 rtnl_newlink+0x43/0x60 The issue happens when the shift that should have been a function of the txq item size mistakenly used the ring size. Fix by using the item size. Cc: stable@vger.kernel.org Fixes: d47dfc2b00e6 ("IB/hfi1: Remove cache and embed txreq in ring") Link: https://lore.kernel.org/r/1642287756-182313-2-git-send-email-mike.marciniszyn@cornelisnetworks.com Reviewed-by: Dennis Dalessandro Signed-off-by: Mike Marciniszyn Signed-off-by: Jason Gunthorpe commit 501c8f5e3901f0de3244137e72fb39611f77a77c Merge: 928d6fe996f69 d01ffb9eee4af Author: David S. Miller Date: Fri Jan 28 14:56:47 2022 +0000 Merge branch 'ax25-fixes' Duoming Zhou says: ==================== ax25: fix NPD and UAF bugs when detaching ax25 device There are NPD and UAF bugs when detaching ax25 device, we use lock and refcount to mitigate these bugs. ==================== Signed-off-by: David S. Miller commit d01ffb9eee4af165d83b08dd73ebdf9fe94a519b Author: Duoming Zhou Date: Fri Jan 28 12:47:16 2022 +0800 ax25: add refcount in ax25_dev to avoid UAF bugs If we dereference ax25_dev after we call kfree(ax25_dev) in ax25_dev_device_down(), it will lead to concurrency UAF bugs. There are eight syscall functions suffer from UAF bugs, include ax25_bind(), ax25_release(), ax25_connect(), ax25_ioctl(), ax25_getname(), ax25_sendmsg(), ax25_getsockopt() and ax25_info_show(). One of the concurrency UAF can be shown as below: (USE) | (FREE) | ax25_device_event | ax25_dev_device_down ax25_bind | ... ... | kfree(ax25_dev) ax25_fillin_cb() | ... ax25_fillin_cb_from_dev() | ... | The root cause of UAF bugs is that kfree(ax25_dev) in ax25_dev_device_down() is not protected by any locks. When ax25_dev, which there are still pointers point to, is released, the concurrency UAF bug will happen. This patch introduces refcount into ax25_dev in order to guarantee that there are no pointers point to it when ax25_dev is released. Signed-off-by: Duoming Zhou Signed-off-by: David S. Miller commit 4e0f718daf97d47cf7dec122da1be970f145c809 Author: Duoming Zhou Date: Fri Jan 28 12:47:15 2022 +0800 ax25: improve the incomplete fix to avoid UAF and NPD bugs The previous commit 1ade48d0c27d ("ax25: NPD bug when detaching AX25 device") introduce lock_sock() into ax25_kill_by_device to prevent NPD bug. But the concurrency NPD or UAF bug will occur, when lock_sock() or release_sock() dereferences the ax25_cb->sock. The NULL pointer dereference bug can be shown as below: ax25_kill_by_device() | ax25_release() | ax25_destroy_socket() | ax25_cb_del() ... | ... | ax25->sk=NULL; lock_sock(s->sk); //(1) | s->ax25_dev = NULL; | ... release_sock(s->sk); //(2) | ... | The root cause is that the sock is set to null before dereference site (1) or (2). Therefore, this patch extracts the ax25_cb->sock in advance, and uses ax25_list_lock to protect it, which can synchronize with ax25_cb_del() and ensure the value of sock is not null before dereference sites. The concurrency UAF bug can be shown as below: ax25_kill_by_device() | ax25_release() | ax25_destroy_socket() ... | ... | sock_put(sk); //FREE lock_sock(s->sk); //(1) | s->ax25_dev = NULL; | ... release_sock(s->sk); //(2) | ... | The root cause is that the sock is released before dereference site (1) or (2). Therefore, this patch uses sock_hold() to increase the refcount of sock and uses ax25_list_lock to protect it, which can synchronize with ax25_cb_del() in ax25_destroy_socket() and ensure the sock wil not be released before dereference sites. Signed-off-by: Duoming Zhou Signed-off-by: David S. Miller commit 500c77eed0feabddd5b3afb48e32c204614a8eab Author: Gerhard Engleder Date: Thu Jan 27 20:46:02 2022 +0100 pinctrl: zynqmp: Revert "Unify pin naming" This reverts commit 54784ff24971ed5bd3f1056edce998148709d0a7. This patch changes the pin names from "MIO%d" to "MIO-%d", but all dts in arch/arm64/boot/dts/xilinx still use the old name. As a result my ZCU104 has no output on serial terminal and is not reachable over network. Signed-off-by: Gerhard Engleder Signed-off-by: Andy Shevchenko commit 928d6fe996f69330ded6b887baf4534c5fac7988 Author: Yuji Ishikawa Date: Thu Jan 27 21:17:14 2022 +0900 net: stmmac: dwmac-visconti: No change to ETHER_CLOCK_SEL for unexpected speed request. Variable clk_sel_val is not initialized in the default case of the first switch statement. In that case, the function should return immediately without any changes to the hardware. Reported-by: kernel test robot Reported-by: Dan Carpenter Fixes: b38dd98ff8d0 ("net: stmmac: Add Toshiba Visconti SoCs glue driver") Signed-off-by: Yuji Ishikawa Reviewed-by: Nobuhiro Iwamatsu Signed-off-by: David S. Miller commit 665408f4c3a5c83e712871daa062721624b2b79e Author: Phil Elwell Date: Tue Jan 18 15:45:14 2022 +0000 brcmfmac: firmware: Fix crash in brcm_alt_fw_path The call to brcm_alt_fw_path in brcmf_fw_get_firmwares is not protected by a check to the validity of the fwctx->req->board_type pointer. This results in a crash in strlcat when, for example, the WLAN chip is found in a USB dongle. Prevent the crash by adding the necessary check. See: https://github.com/raspberrypi/linux/issues/4833 Fixes: 5ff013914c62 ("brcmfmac: firmware: Allow per-board firmware binaries") Signed-off-by: Phil Elwell Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220118154514.3245524-1-phil@raspberrypi.com commit ab451ea952fe9d7afefae55ddb28943a148247fe Author: Dai Ngo Date: Wed Jan 26 13:13:38 2022 -0800 nfsd: nfsd4_setclientid_confirm mistakenly expires confirmed client. From RFC 7530 Section 16.34.5: o The server has not recorded an unconfirmed { v, x, c, *, * } and has recorded a confirmed { v, x, c, *, s }. If the principals of the record and of SETCLIENTID_CONFIRM do not match, the server returns NFS4ERR_CLID_INUSE without removing any relevant leased client state, and without changing recorded callback and callback_ident values for client { x }. The current code intends to do what the spec describes above but it forgot to set 'old' to NULL resulting to the confirmed client to be expired. Fixes: 2b63482185e6 ("nfsd: fix clid_inuse on mount with security change") Signed-off-by: Dai Ngo Signed-off-by: Chuck Lever Reviewed-by: Bruce Fields commit 60b1e97140a487608b7cbde774b3cff1b5a99c00 Author: Rob Herring Date: Wed Jan 26 17:13:26 2022 -0600 spi: dt-bindings: Fix 'reg' child node schema The schema for SPI child nodes' 'reg' property is not complete. 'reg' is a matrix of cells. The schema needs to define both the number of 'reg' entries and constraints on each entry. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220126231326.1636199-1-robh@kernel.org Signed-off-by: Mark Brown commit 2cbd27267ffe020af1442b95ec57f59a157ba85c Author: Kamal Dasu Date: Thu Jan 27 13:53:59 2022 -0500 spi: bcm-qspi: check for valid cs before applying chip select Apply only valid chip select value. This change fixes case where chip select is set to initial value of '-1' during probe and PM supend and subsequent resume can try to use the value with undefined behaviour. Also in case where gpio based chip select, the check in bcm_qspi_chip_select() shall prevent undefined behaviour on resume. Fixes: fa236a7ef240 ("spi: bcm-qspi: Add Broadcom MSPI driver") Signed-off-by: Kamal Dasu Acked-by: Florian Fainelli Link: https://lore.kernel.org/r/20220127185359.27322-1-kdasu.kdev@gmail.com Signed-off-by: Mark Brown commit fb25621da5702c104ce0a48de5b174ced09e5b4e Author: Miaoqian Lin Date: Thu Jan 27 13:13:34 2022 +0000 ASoC: fsl: Add missing error handling in pcm030_fabric_probe Add the missing platform_device_put() and platform_device_del() before return from pcm030_fabric_probe in the error handling case. Fixes: c912fa913446 ("ASoC: fsl: register the wm9712-codec") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220127131336.30214-1-linmq006@gmail.com Signed-off-by: Mark Brown commit 17179d0068b20413de2355f84c75a93740257e20 Merge: 6a0c61703e3a5 278583055a237 Author: Paolo Bonzini Date: Fri Jan 28 07:45:15 2022 -0500 Merge tag 'kvmarm-fixes-5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD KVM/arm64 fixes for 5.17, take #1 - Correctly update the shadow register on exception injection when running in nVHE mode - Correctly use the mm_ops indirection when performing cache invalidation from the page-table walker - Restrict the vgic-v3 workaround for SEIS to the two known broken implementations commit 6a0c61703e3a5d67845a4b275e1d9d7bc1b5aad7 Author: Hou Wenlong Date: Thu Jan 27 14:54:49 2022 +0800 KVM: eventfd: Fix false positive RCU usage warning Fix the following false positive warning: ============================= WARNING: suspicious RCU usage 5.16.0-rc4+ #57 Not tainted ----------------------------- arch/x86/kvm/../../../virt/kvm/eventfd.c:484 RCU-list traversed in non-reader section!! other info that might help us debug this: rcu_scheduler_active = 2, debug_locks = 1 3 locks held by fc_vcpu 0/330: #0: ffff8884835fc0b0 (&vcpu->mutex){+.+.}-{3:3}, at: kvm_vcpu_ioctl+0x88/0x6f0 [kvm] #1: ffffc90004c0bb68 (&kvm->srcu){....}-{0:0}, at: vcpu_enter_guest+0x600/0x1860 [kvm] #2: ffffc90004c0c1d0 (&kvm->irq_srcu){....}-{0:0}, at: kvm_notify_acked_irq+0x36/0x180 [kvm] stack backtrace: CPU: 26 PID: 330 Comm: fc_vcpu 0 Not tainted 5.16.0-rc4+ Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 Call Trace: dump_stack_lvl+0x44/0x57 kvm_notify_acked_gsi+0x6b/0x70 [kvm] kvm_notify_acked_irq+0x8d/0x180 [kvm] kvm_ioapic_update_eoi+0x92/0x240 [kvm] kvm_apic_set_eoi_accelerated+0x2a/0xe0 [kvm] handle_apic_eoi_induced+0x3d/0x60 [kvm_intel] vmx_handle_exit+0x19c/0x6a0 [kvm_intel] vcpu_enter_guest+0x66e/0x1860 [kvm] kvm_arch_vcpu_ioctl_run+0x438/0x7f0 [kvm] kvm_vcpu_ioctl+0x38a/0x6f0 [kvm] __x64_sys_ioctl+0x89/0xc0 do_syscall_64+0x3a/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae Since kvm_unregister_irq_ack_notifier() does synchronize_srcu(&kvm->irq_srcu), kvm->irq_ack_notifier_list is protected by kvm->irq_srcu. In fact, kvm->irq_srcu SRCU read lock is held in kvm_notify_acked_irq(), making it a false positive warning. So use hlist_for_each_entry_srcu() instead of hlist_for_each_entry_rcu(). Reviewed-by: Sean Christopherson Signed-off-by: Hou Wenlong Message-Id: Signed-off-by: Paolo Bonzini commit 6cbbaab60ff33f59355492c241318046befd9ffc Author: Vitaly Kuznetsov Date: Wed Jan 12 18:01:34 2022 +0100 KVM: nVMX: Allow VMREAD when Enlightened VMCS is in use Hyper-V TLFS explicitly forbids VMREAD and VMWRITE instructions when Enlightened VMCS interface is in use: "Any VMREAD or VMWRITE instructions while an enlightened VMCS is active is unsupported and can result in unexpected behavior."" Windows 11 + WSL2 seems to ignore this, attempts to VMREAD VMCS field 0x4404 ("VM-exit interruption information") are observed. Failing these attempts with nested_vmx_failInvalid() makes such guests unbootable. Microsoft confirms this is a Hyper-V bug and claims that it'll get fixed eventually but for the time being we need a workaround. (Temporary) allow VMREAD to get data from the currently loaded Enlightened VMCS. Note: VMWRITE instructions remain forbidden, it is not clear how to handle them properly and hopefully won't ever be needed. Reviewed-by: Sean Christopherson Signed-off-by: Vitaly Kuznetsov Message-Id: <20220112170134.1904308-6-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini commit 892a42c10ddb945d3a4dcf07dccdf9cb98b21548 Author: Vitaly Kuznetsov Date: Wed Jan 12 18:01:33 2022 +0100 KVM: nVMX: Implement evmcs_field_offset() suitable for handle_vmread() In preparation to allowing reads from Enlightened VMCS from handle_vmread(), implement evmcs_field_offset() to get the correct read offset. get_evmcs_offset(), which is being used by KVM-on-Hyper-V, is almost what's needed but a few things need to be adjusted. First, WARN_ON() is unacceptable for handle_vmread() as any field can (in theory) be supplied by the guest and not all fields are defined in eVMCS v1. Second, we need to handle 'holes' in eVMCS (missing fields). It also sounds like a good idea to WARN_ON() if such fields are ever accessed by KVM-on-Hyper-V. Implement dedicated evmcs_field_offset() helper. No functional change intended. Signed-off-by: Vitaly Kuznetsov Message-Id: <20220112170134.1904308-5-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini commit 2423a4c0d17418eca1ba1e3f48684cb2ab7523d5 Author: Vitaly Kuznetsov Date: Wed Jan 12 18:01:32 2022 +0100 KVM: nVMX: Rename vmcs_to_field_offset{,_table} vmcs_to_field_offset{,_table} may sound misleading as VMCS is an opaque blob which is not supposed to be accessed directly. In fact, vmcs_to_field_offset{,_table} are related to KVM defined VMCS12 structure. Rename vmcs_field_to_offset() to get_vmcs12_field_offset() for clarity. No functional change intended. Reviewed-by: Sean Christopherson Signed-off-by: Vitaly Kuznetsov Message-Id: <20220112170134.1904308-4-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini commit 7a601e2cf61558dfd534a9ecaad09f5853ad8204 Author: Vitaly Kuznetsov Date: Wed Jan 12 18:01:31 2022 +0100 KVM: nVMX: eVMCS: Filter out VM_EXIT_SAVE_VMX_PREEMPTION_TIMER Enlightened VMCS v1 doesn't have VMX_PREEMPTION_TIMER_VALUE field, PIN_BASED_VMX_PREEMPTION_TIMER is also filtered out already so it makes sense to filter out VM_EXIT_SAVE_VMX_PREEMPTION_TIMER too. Note, none of the currently existing Windows/Hyper-V versions are known to enable 'save VMX-preemption timer value' when eVMCS is in use, the change is aimed at making the filtering future proof. Signed-off-by: Vitaly Kuznetsov Message-Id: <20220112170134.1904308-3-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini commit f80ae0ef089a09e8c18da43a382c3caac9a424a7 Author: Vitaly Kuznetsov Date: Wed Jan 12 18:01:30 2022 +0100 KVM: nVMX: Also filter MSR_IA32_VMX_TRUE_PINBASED_CTLS when eVMCS Similar to MSR_IA32_VMX_EXIT_CTLS/MSR_IA32_VMX_TRUE_EXIT_CTLS, MSR_IA32_VMX_ENTRY_CTLS/MSR_IA32_VMX_TRUE_ENTRY_CTLS pair, MSR_IA32_VMX_TRUE_PINBASED_CTLS needs to be filtered the same way MSR_IA32_VMX_PINBASED_CTLS is currently filtered as guests may solely rely on 'true' MSR data. Note, none of the currently existing Windows/Hyper-V versions are known to stumble upon the unfiltered MSR_IA32_VMX_TRUE_PINBASED_CTLS, the change is aimed at making the filtering future proof. Signed-off-by: Vitaly Kuznetsov Message-Id: <20220112170134.1904308-2-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini commit b19c99b9f4486f23e3b7248dd4ce3d83e19b9032 Author: Paolo Bonzini Date: Wed Jan 26 07:51:00 2022 -0500 selftests: kvm: check dynamic bits against KVM_X86_XCOMP_GUEST_SUPP Provide coverage for the new API. Signed-off-by: Paolo Bonzini commit dd6e631220181162478984d2d46dd979e04d8e75 Author: Paolo Bonzini Date: Wed Jan 26 07:49:45 2022 -0500 KVM: x86: add system attribute to retrieve full set of supported xsave states Because KVM_GET_SUPPORTED_CPUID is meant to be passed (by simple-minded VMMs) to KVM_SET_CPUID2, it cannot include any dynamic xsave states that have not been enabled. Probing those, for example so that they can be passed to ARCH_REQ_XCOMP_GUEST_PERM, requires a new ioctl or arch_prctl. The latter is in fact worse, even though that is what the rest of the API uses, because it would require supported_xcr0 to be moved from the KVM module to the kernel just for this use. In addition, the value would be nonsensical (or an error would have to be returned) until the KVM module is loaded in. Therefore, to limit the growth of system ioctls, add a /dev/kvm variant of KVM_{GET,HAS}_DEVICE_ATTR, and implement it in x86 with just one group (0) and attribute (KVM_X86_XCOMP_GUEST_SUPP). Signed-off-by: Paolo Bonzini commit 56f289a8d23addfa4408a08f07f42fcfe2a7bd69 Author: Sean Christopherson Date: Thu Jan 27 07:31:53 2022 -0800 KVM: x86: Add a helper to retrieve userspace address from kvm_device_attr Add a helper to handle converting the u64 userspace address embedded in struct kvm_device_attr into a userspace pointer, it's all too easy to forget the intermediate "unsigned long" cast as well as the truncation check. No functional change intended. Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit c8980fcb210851138cb34c9a8cb0cf0c09f07bf9 Author: Roger Pau Monne Date: Fri Jan 21 10:01:46 2022 +0100 xen/x2apic: enable x2apic mode when supported for HVM There's no point in disabling x2APIC mode when running as a Xen HVM guest, just enable it when available. Remove some unneeded wrapping around the detection functions, and simply provide a xen_x2apic_available helper that's a wrapper around x2apic_supported. Signed-off-by: Roger Pau Monné Reviewed-by: Boris Ostrovsky Link: https://lore.kernel.org/r/20220121090146.13697-1-roger.pau@citrix.com Signed-off-by: Juergen Gross commit 9ae279ecabe3e5bb85567e6c7371f4d35cfa00d6 Author: Mark Brown Date: Mon Jan 24 17:55:27 2022 +0000 kselftest/arm64: Correct logging of FPSIMD register read via ptrace There's a cut'n'paste error in the logging for our test for reading register state back via ptrace, correctly say that we did a read instead of a write. Signed-off-by: Mark Brown Reviewed-by: Shuah Khan Link: https://lore.kernel.org/r/20220124175527.3260234-3-broonie@kernel.org Signed-off-by: Catalin Marinas commit 50806fd91428a28d5daa649310dd0ca05b39c118 Author: Mark Brown Date: Mon Jan 24 17:55:26 2022 +0000 kselftest/arm64: Skip VL_INHERIT tests for unsupported vector types Currently we unconditionally test the ability to set the vector length inheritance flag via ptrace meaning that we generate false failures on systems that don't support SVE when we attempt to set the vector length there. Check the hwcap and mark the tests as skipped when it's not present. Fixes: 0ba1ce1e8605 ("selftests: arm64: Add coverage of ptrace flags for SVE VL inheritance") Signed-off-by: Mark Brown Reviewed-by: Shuah Khan Link: https://lore.kernel.org/r/20220124175527.3260234-2-broonie@kernel.org Signed-off-by: Catalin Marinas commit 145d9b498fc827b79c1260b4caa29a8e59d4c2b9 Merge: 374630e3f94ef 9b6d90e2085ca Author: Linus Torvalds Date: Fri Jan 28 11:47:05 2022 +0200 Merge tag 'ata-5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata Pull ATA fix from Damien Le Moal: "A single fix for 5.17-rc2, adding a missing resource allocation error check in the pata_platform driver, from Zhou" * tag 'ata-5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata: ata: pata_platform: Fix a NULL pointer dereference in __pata_platform_probe() commit d7da660cab47183cded65e11b64497d0f56c6edf Author: John David Anglin Date: Thu Jan 27 22:33:41 2022 +0000 parisc: Fix sglist access in ccio-dma.c This patch implements the same bug fix to ccio-dma.c as to sba_iommu.c. It ensures that only the allocated entries of the sglist are accessed. Signed-off-by: John David Anglin Cc: stable@vger.kernel.org Signed-off-by: Helge Deller commit b7d6f44a0fa716a82969725516dc0b16bc7cd514 Author: John David Anglin Date: Wed Jan 26 20:39:05 2022 +0000 parisc: Fix data TLB miss in sba_unmap_sg Rolf Eike Beer reported the following bug: [1274934.746891] Bad Address (null pointer deref?): Code=15 (Data TLB miss fault) at addr 0000004140000018 [1274934.746891] CPU: 3 PID: 5549 Comm: cmake Not tainted 5.15.4-gentoo-parisc64 #4 [1274934.746891] Hardware name: 9000/785/C8000 [1274934.746891] [1274934.746891] YZrvWESTHLNXBCVMcbcbcbcbOGFRQPDI [1274934.746891] PSW: 00001000000001001111111000001110 Not tainted [1274934.746891] r00-03 000000ff0804fe0e 0000000040bc9bc0 00000000406760e4 0000004140000000 [1274934.746891] r04-07 0000000040b693c0 0000004140000000 000000004a2b08b0 0000000000000001 [1274934.746891] r08-11 0000000041f98810 0000000000000000 000000004a0a7000 0000000000000001 [1274934.746891] r12-15 0000000040bddbc0 0000000040c0cbc0 0000000040bddbc0 0000000040bddbc0 [1274934.746891] r16-19 0000000040bde3c0 0000000040bddbc0 0000000040bde3c0 0000000000000007 [1274934.746891] r20-23 0000000000000006 000000004a368950 0000000000000000 0000000000000001 [1274934.746891] r24-27 0000000000001fff 000000000800000e 000000004a1710f0 0000000040b693c0 [1274934.746891] r28-31 0000000000000001 0000000041f988b0 0000000041f98840 000000004a171118 [1274934.746891] sr00-03 00000000066e5800 0000000000000000 0000000000000000 00000000066e5800 [1274934.746891] sr04-07 0000000000000000 0000000000000000 0000000000000000 0000000000000000 [1274934.746891] [1274934.746891] IASQ: 0000000000000000 0000000000000000 IAOQ: 00000000406760e8 00000000406760ec [1274934.746891] IIR: 48780030 ISR: 0000000000000000 IOR: 0000004140000018 [1274934.746891] CPU: 3 CR30: 00000040e3a9c000 CR31: ffffffffffffffff [1274934.746891] ORIG_R28: 0000000040acdd58 [1274934.746891] IAOQ[0]: sba_unmap_sg+0xb0/0x118 [1274934.746891] IAOQ[1]: sba_unmap_sg+0xb4/0x118 [1274934.746891] RP(r2): sba_unmap_sg+0xac/0x118 [1274934.746891] Backtrace: [1274934.746891] [<00000000402740cc>] dma_unmap_sg_attrs+0x6c/0x70 [1274934.746891] [<000000004074d6bc>] scsi_dma_unmap+0x54/0x60 [1274934.746891] [<00000000407a3488>] mptscsih_io_done+0x150/0xd70 [1274934.746891] [<0000000040798600>] mpt_interrupt+0x168/0xa68 [1274934.746891] [<0000000040255a48>] __handle_irq_event_percpu+0xc8/0x278 [1274934.746891] [<0000000040255c34>] handle_irq_event_percpu+0x3c/0xd8 [1274934.746891] [<000000004025ecb4>] handle_percpu_irq+0xb4/0xf0 [1274934.746891] [<00000000402548e0>] generic_handle_irq+0x50/0x70 [1274934.746891] [<000000004019a254>] call_on_stack+0x18/0x24 [1274934.746891] [1274934.746891] Kernel panic - not syncing: Bad Address (null pointer deref?) The bug is caused by overrunning the sglist and incorrectly testing sg_dma_len(sglist) before nents. Normally this doesn't cause a crash, but in this case sglist crossed a page boundary. This occurs in the following code: while (sg_dma_len(sglist) && nents--) { The fix is simply to test nents first and move the decrement of nents into the loop. Reported-by: Rolf Eike Beer Signed-off-by: John David Anglin Cc: stable@vger.kernel.org Signed-off-by: Helge Deller commit 9129886b88185962538180625ca8051362b01327 Author: John David Anglin Date: Sat Jan 22 18:19:49 2022 +0000 parisc: Drop __init from map_pages declaration With huge kernel pages, we randomly eat a SPARC in map_pages(). This is fixed by dropping __init from the declaration. However, map_pages references the __init routine memblock_alloc_try_nid via memblock_alloc. Thus, it needs to be marked with __ref. memblock_alloc is only called before the kernel text is set to readonly. The __ref on free_initmem is no longer needed. Comment regarding map_pages being in the init section is removed. Signed-off-by: John David Anglin Cc: stable@vger.kernel.org # v5.4+ Signed-off-by: Helge Deller commit 0444f82766f0b5b9c8302ad802dafa5dd0e722d0 Author: Takashi Iwai Date: Thu Jan 27 14:57:17 2022 +0100 ALSA: hda: Fix signedness of sscanf() arguments The %x format of sscanf() takes an unsigned int pointer, while we pass a signed int pointer. Practically it's OK, but this may result in a compile warning. Let's fix it. Fixes: a235d5b8e550 ("ALSA: hda: Allow model option to specify PCI SSID alias") Reported-by: kernel test robot Link: https://lore.kernel.org/r/20220127135717.31751-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 374630e3f94efc8184a727694276088f52bcc3d1 Merge: 82b550fa99f2c 79da533d3cc71 Author: Linus Torvalds Date: Fri Jan 28 09:48:20 2022 +0200 Merge tag 'hwmon-for-v5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging Pull hwmon fixes from Guenter Roeck: - Fix crash in nct6775 driver - Prevent divide by zero in adt7470 driver - Fix conditional compile warning in pmbus/ir38064 driver - Various minor fixes in lm90 driver * tag 'hwmon-for-v5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: hwmon: (nct6775) Fix crash in clear_caseopen hwmon: (adt7470) Prevent divide by zero in adt7470_fan_write() hwmon: (pmbus/ir38064) Mark ir38064_of_match as __maybe_unused hwmon: (lm90) Fix sysfs and udev notifications hwmon: (lm90) Mark alert as broken for MAX6646/6647/6649 hwmon: (lm90) Mark alert as broken for MAX6680 hwmon: (lm90) Mark alert as broken for MAX6654 hwmon: (lm90) Re-enable interrupts after alert clears hwmon: (lm90) Reduce maximum conversion rate for G781 commit 82b550fa99f2c73636ca3f84900117c3c3272ef7 Merge: 23a46422c5614 db5aa1497d02e Author: Linus Torvalds Date: Fri Jan 28 09:43:00 2022 +0200 Merge tag 'drm-fixes-2022-01-28' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "This week's regular normal fixes. amdgpu and msm make up the bulk of it, with a scattering of fixes elsewhere. atomic: - fix CRTC handling during modeset privcy-screen: - honor acpi=off ttm: - build fix for um panel: - add orientation quirk for 1NetBook OneXPlayer amdgpu: - Proper fix for otg synchronization logic regression - DCN3.01 fixes - Filter out secondary radeon PCI IDs - udelay fixes - Fix a memory leak in an error path msm: - parameter check fixes - put_device balancing - idle/suspend fixes etnaviv: - relax submit size checks vc4: - fix potential deadlock in DSI code ast: - revert 1600x900 mode change" * tag 'drm-fixes-2022-01-28' of git://anongit.freedesktop.org/drm/drm: (25 commits) drm/privacy-screen: honor acpi=off in detect_thinkpad_privacy_screen Revert "drm/ast: Support 1600x900 with 108MHz PCLK" drm/amdgpu/display: Remove t_srx_delay_us. drm/amd/display: Wrap dcn301_calculate_wm_and_dlg for FPU. drm/amd/display: Fix FP start/end for dcn30_internal_validate_bw. drm/amd/display/dc/calcs/dce_calcs: Fix a memleak in calculate_bandwidth() drm/amdgpu/display: use msleep rather than udelay for long delays drm/amdgpu/display: adjust msleep limit in dp_wait_for_training_aux_rd_interval drm/amdgpu: filter out radeon secondary ids as well drm/amd/display: change FIFO reset condition to embedded display only drm/amd/display: Correct MPC split policy for DCN301 drm/amd/display: Fix for otg synchronization logic drm/etnaviv: relax submit size limits drm/msm/gpu: Cancel idle/boost work on suspend drm/msm/gpu: Wait for idle before suspending drm/atomic: Add the crtc to affected crtc only if uapi.enable = true drm/msm/dsi: invalid parameter check in msm_dsi_phy_enable drm/msm/a6xx: Add missing suspend_count increment drm/msm: Fix wrong size calculation drm/msm/dpu: invalid parameter check in dpu_setup_dspp_pcc ... commit 42c9b28e6862d16db82a56f5667cf4d1f6658cf6 Author: Fabio Estevam Date: Mon Dec 27 13:14:02 2021 -0300 ARM: dts: imx23-evk: Remove MX23_PAD_SSP1_DETECT from hog group Currently, SD card fails to mount due to the following pinctrl error: [ 11.170000] imx23-pinctrl 80018000.pinctrl: pin SSP1_DETECT already requested by 80018000.pinctrl; cannot claim for 80010000.spi [ 11.180000] imx23-pinctrl 80018000.pinctrl: pin-65 (80010000.spi) status -22 [ 11.190000] imx23-pinctrl 80018000.pinctrl: could not request pin 65 (SSP1_DETECT) from group mmc0-pins-fixup.0 on device 80018000.pinctrl [ 11.200000] mxs-mmc 80010000.spi: Error applying setting, reverse things back Fix it by removing the MX23_PAD_SSP1_DETECT pin from the hog group as it is already been used by the mmc0-pins-fixup pinctrl group. With this change the rootfs can be mounted and the imx23-evk board can boot successfully. Cc: Fixes: bc3875f1a61e ("ARM: dts: mxs: modify mx23/mx28 dts files to use pinctrl headers") Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit db5aa1497d02e7770e40dd0d1bfcb4ea0b0d3906 Merge: b1d83f4c94f52 2a807341ed107 Author: Dave Airlie Date: Fri Jan 28 14:59:44 2022 +1000 Merge tag 'amd-drm-fixes-5.17-2022-01-26' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes amd-drm-fixes-5.17-2022-01-26: amdgpu: - Proper fix for otg synchronization logic regression - DCN3.01 fixes - Filter out secondary radeon PCI IDs - udelay fixes - Fix a memory leak in an error path Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220127041006.5695-1-alexander.deucher@amd.com commit b1d83f4c94f52f2967cdd9b54b9ffb8bb6cfc61b Merge: 52fa904e5167f e3d26528e083e Author: Dave Airlie Date: Fri Jan 28 14:56:17 2022 +1000 Merge branch 'etnaviv/fixes' of https://git.pengutronix.de/git/lst/linux into drm-fixes - relax submit size checks. Signed-off-by: Dave Airlie From: Lucas Stach Link: https://patchwork.freedesktop.org/patch/msgid/8c2cb3e3a702be86db9d43ca8927b6b78ac2b1d2.camel@pengutronix.de commit 52fa904e5167fc10f4e421727e898ee96c307518 Merge: 2fd0e5fb4ba37 6aa89ae1fb049 Author: Dave Airlie Date: Fri Jan 28 14:52:34 2022 +1000 Merge tag 'drm-msm-fixes-2022-01-25' of https://gitlab.freedesktop.org/drm/msm into drm-fixes A few msm fixes. - parameter checks - put_device balancing - idle/suspend fixes Signed-off-by: Dave Airlie From: Rob Clark Link: https://patchwork.freedesktop.org/patch/msgid/CAF6AEGvAfsgtr==VM4wixAC_hSTuV=eNWXxX=BhZqQrbxHjKgg@mail.gmail.com commit 2fd0e5fb4ba37dff344b7bed5176212c2d6a7063 Merge: 23ecd4c135422 7fde14d705985 Author: Dave Airlie Date: Fri Jan 28 14:46:11 2022 +1000 Merge tag 'drm-misc-fixes-2022-01-27' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes * drm/ast: Revert 1600x800 with 108MHz PCLK * drm/atomic: fix CRTC handling during modeset * drm/privacy-screen: Honor acpi=off * drm/ttm: build fix for ARCH=um Signed-off-by: Dave Airlie From: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/YfJgH9fz+oo7YSXd@linux-uq9g.fritz.box commit 23ecd4c1354226fd6ac9c5f8881666f76b9d6cbe Merge: e783362eb54cd d3cbc6e323c92 Author: Dave Airlie Date: Fri Jan 28 14:37:30 2022 +1000 Merge tag 'drm-misc-next-fixes-2022-01-21' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes * vc4: Fix potential deadlock in DSI code * panel: Add orientation quirk for 1Netbook OneXPlayer Signed-off-by: Dave Airlie From: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/Yepuhj+Ks+IyJ9Dp@linux-uq9g commit 7674b7b559b683478c3832527c59bceb169e701d Author: Raju Rangoju Date: Thu Jan 27 11:32:22 2022 +0530 net: amd-xgbe: ensure to reset the tx_timer_active flag Ensure to reset the tx_timer_active flag in xgbe_stop(), otherwise a port restart may result in tx timeout due to uncleared flag. Fixes: c635eaacbf77 ("amd-xgbe: Remove Tx coalescing") Co-developed-by: Sudheesh Mavila Signed-off-by: Sudheesh Mavila Signed-off-by: Raju Rangoju Acked-by: Tom Lendacky Link: https://lore.kernel.org/r/20220127060222.453371-1-Raju.Rangoju@amd.com Signed-off-by: Jakub Kicinski commit 33d12dc91bc41183003913b888cc492420ae6ef8 Merge: 5aac9108a180f b07f413732549 Author: Jakub Kicinski Date: Thu Jan 27 18:53:01 2022 -0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf Pablo Neira Ayuso says: ==================== Netfilter fixes for net 1) Remove leftovers from flowtable modules, from Geert Uytterhoeven. 2) Missing refcount increment of conntrack template in nft_ct, from Florian Westphal. 3) Reduce nft_zone selftest time, also from Florian. 4) Add selftest to cover stateless NAT on fragments, from Florian Westphal. 5) Do not set net_device when for reject packets from the bridge path, from Phil Sutter. 6) Cancel register tracking info on nft_byteorder operations. 7) Extend nft_concat_range selftest to cover set reload with no elements, from Florian Westphal. 8) Remove useless update of pointer in chain blob builder, reported by kbuild test robot. * git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf: netfilter: nf_tables: remove assignment with no effect in chain blob builder selftests: nft_concat_range: add test for reload with no element add/del netfilter: nft_byteorder: track register operations netfilter: nft_reject_bridge: Fix for missing reply from prerouting selftests: netfilter: check stateless nat udp checksum fixup selftests: netfilter: reduce zone stress test running time netfilter: nft_ct: fix use after free when attaching zone template netfilter: Remove flowtable relics ==================== Link: https://lore.kernel.org/r/20220127235235.656931-1-pablo@netfilter.org Signed-off-by: Jakub Kicinski commit 5aac9108a180fc06e28d4e7fb00247ce603b72ee Author: Shyam Sundar S K Date: Thu Jan 27 14:50:03 2022 +0530 net: amd-xgbe: Fix skb data length underflow There will be BUG_ON() triggered in include/linux/skbuff.h leading to intermittent kernel panic, when the skb length underflow is detected. Fix this by dropping the packet if such length underflows are seen because of inconsistencies in the hardware descriptors. Fixes: 622c36f143fc ("amd-xgbe: Fix jumbo MTU processing on newer hardware") Suggested-by: Tom Lendacky Signed-off-by: Shyam Sundar S K Acked-by: Tom Lendacky Link: https://lore.kernel.org/r/20220127092003.2812745-1-Shyam-sundar.S-k@amd.com Signed-off-by: Jakub Kicinski commit 67ab5eb71b37b55f7c5522d080a1b42823351776 Author: Tom Zanussi Date: Thu Jan 27 15:44:18 2022 -0600 tracing: Don't inc err_log entry count if entry allocation fails tr->n_err_log_entries should only be increased if entry allocation succeeds. Doing it when it fails won't cause any problems other than wasting an entry, but should be fixed anyway. Link: https://lkml.kernel.org/r/cad1ab28f75968db0f466925e7cba5970cec6c29.1643319703.git.zanussi@kernel.org Cc: stable@vger.kernel.org Fixes: 2f754e771b1a6 ("tracing: Don't inc err_log entry count if entry allocation fails") Signed-off-by: Tom Zanussi Signed-off-by: Steven Rostedt (Google) commit 097f1eefedeab528cecbd35586dfe293853ffb17 Author: Tom Zanussi Date: Thu Jan 27 15:44:17 2022 -0600 tracing: Propagate is_signed to expression During expression parsing, a new expression field is created which should inherit the properties of the operands, such as size and is_signed. is_signed propagation was missing, causing spurious errors with signed operands. Add it in parse_expr() and parse_unary() to fix the problem. Link: https://lkml.kernel.org/r/f4dac08742fd7a0920bf80a73c6c44042f5eaa40.1643319703.git.zanussi@kernel.org Cc: stable@vger.kernel.org Fixes: 100719dcef447 ("tracing: Add simple expression support to hist triggers") Reported-by: Yordan Karadzhov BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=215513 Signed-off-by: Tom Zanussi Signed-off-by: Steven Rostedt (Google) commit b59f2f2b865cedd6d1641394b9cd84399bd738ff Author: Tom Zanussi Date: Thu Jan 27 15:44:16 2022 -0600 tracing: Fix smatch warning for do while check in event_hist_trigger_parse() The patch ec5ce0987541: "tracing: Allow whitespace to surround hist trigger filter" from Jan 15, 2018, leads to the following Smatch static checker warning: kernel/trace/trace_events_hist.c:6199 event_hist_trigger_parse() warn: 'p' can't be NULL. Since p is always checked for a NULL value at the top of loop and nothing in the rest of the loop will set it to NULL, the warning is correct and might as well be 1 to silence the warning. Link: https://lkml.kernel.org/r/a1d4c79766c0cf61e20438dc35244d216633fef6.1643319703.git.zanussi@kernel.org Fixes: ec5ce09875410 ("tracing: Allow whitespace to surround hist trigger filter") Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Tom Zanussi Signed-off-by: Steven Rostedt (Google) commit 798a5b6c195d1c64fd5e9dd252381feb17e5ff22 Author: Tom Zanussi Date: Thu Jan 27 15:44:15 2022 -0600 tracing: Fix smatch warning for null glob in event_hist_trigger_parse() The recent rename of event_hist_trigger_parse() caused smatch re-evaluation of trace_events_hist.c and as a result an old warning was found: kernel/trace/trace_events_hist.c:6174 event_hist_trigger_parse() error: we previously assumed 'glob' could be null (see line 6166) glob should never be null (and apparently smatch can also figure that out and skip the warning when using the cross-function DB (but which can't be used with a 0day build as it takes too much time to generate)). Nonetheless for clarity, remove the test but add a WARN_ON() in case the code ever changes. Link: https://lkml.kernel.org/r/96925e5c1f116654ada7ea0613d930b1266b5e1c.1643319703.git.zanussi@kernel.org Fixes: f404da6e1d46c ("tracing: Add 'last error' error facility for hist triggers") Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Tom Zanussi Signed-off-by: Steven Rostedt (Google) commit aa814c51ab7cb3ddeeeeedaa37d599aee7ba6649 Author: Shuah Khan Date: Tue Jan 25 17:22:34 2022 -0700 tools/tracing: Update Makefile to build rtla Update tracing Makefile to build/install/clean rtla tragets. Link: https://lkml.kernel.org/r/20220126002234.79337-1-skhan@linuxfoundation.org Reviewed-by: Daniel Bristot de Oliveira Signed-off-by: Shuah Khan Signed-off-by: Steven Rostedt (Google) commit 2201aea114d4c7eedd05865df545dbb987cee5c1 Author: Shuah Khan Date: Tue Jan 25 17:13:01 2022 -0700 rtla: Make doc build optional rtla build fails due to doc build dependency on rst2man. Make doc build optional so rtla could be built without docs. Leave the install dependency on doc_install alone. Link: https://lkml.kernel.org/r/20220126001301.79096-1-skhan@linuxfoundation.org Acked-by: Daniel Bristot de Oliveira Signed-off-by: Shuah Khan Signed-off-by: Steven Rostedt (Google) commit c6d777acdf8f62d4ebaef0e5c6cd8fedbd6e8546 Author: Kees Cook Date: Tue Jan 25 14:00:37 2022 -0800 tracing/perf: Avoid -Warray-bounds warning for __rel_loc macro As done for trace_events.h, also fix the __rel_loc macro in perf.h, which silences the -Warray-bounds warning: In file included from ./include/linux/string.h:253, from ./include/linux/bitmap.h:11, from ./include/linux/cpumask.h:12, from ./include/linux/mm_types_task.h:14, from ./include/linux/mm_types.h:5, from ./include/linux/buildid.h:5, from ./include/linux/module.h:14, from samples/trace_events/trace-events-sample.c:2: In function '__fortify_strcpy', inlined from 'perf_trace_foo_rel_loc' at samples/trace_events/./trace-events-sample.h:519:1: ./include/linux/fortify-string.h:47:33: warning: '__builtin_strcpy' offset 12 is out of the bounds [ 0, 4] [-Warray-bounds] 47 | #define __underlying_strcpy __builtin_strcpy | ^ ./include/linux/fortify-string.h:445:24: note: in expansion of macro '__underlying_strcpy' 445 | return __underlying_strcpy(p, q); | ^~~~~~~~~~~~~~~~~~~ Also make __data struct member a proper flexible array to avoid future problems. Link: https://lkml.kernel.org/r/20220125220037.2738923-1-keescook@chromium.org Cc: Steven Rostedt Cc: Masami Hiramatsu Fixes: 55de2c0b5610c ("tracing: Add '__rel_loc' using trace event macros") Reported-by: Stephen Rothwell Signed-off-by: Kees Cook Signed-off-by: Steven Rostedt (Google) commit 58c5724ec2cdd72b22107ec5de00d90cc4797796 Author: Masami Hiramatsu Date: Tue Jan 25 23:19:30 2022 +0900 tracing: Avoid -Warray-bounds warning for __rel_loc macro Since -Warray-bounds checks the destination size from the type of given pointer, __assign_rel_str() macro gets warned because it passes the pointer to the 'u32' field instead of 'trace_event_raw_*' data structure. Pass the data address calculated from the 'trace_event_raw_*' instead of 'u32' __rel_loc field. Link: https://lkml.kernel.org/r/20220125233154.dac280ed36944c0c2fe6f3ac@kernel.org Cc: Stephen Rothwell Cc: Kees Cook Signed-off-by: Masami Hiramatsu [ This did not fix the warning, but is still a nice clean up ] Signed-off-by: Steven Rostedt (Google) commit e629e7b525a179e29d53463d992bdee759c950fb Author: Xiaoke Wang Date: Tue Jan 25 12:07:15 2022 +0800 tracing/histogram: Fix a potential memory leak for kstrdup() kfree() is missing on an error path to free the memory allocated by kstrdup(): p = param = kstrdup(data->params[i], GFP_KERNEL); So it is better to free it via kfree(p). Link: https://lkml.kernel.org/r/tencent_C52895FD37802832A3E5B272D05008866F0A@qq.com Cc: stable@vger.kernel.org Fixes: d380dcde9a07c ("tracing: Fix now invalid var_ref_vals assumption in trace action") Signed-off-by: Xiaoke Wang Signed-off-by: Steven Rostedt (Google) commit 4ed308c445a1e3abac8f6c17928c1cb533867e38 Author: Steven Rostedt (Google) Date: Tue Jan 25 09:19:10 2022 -0500 ftrace: Have architectures opt-in for mcount build time sorting First S390 complained that the sorting of the mcount sections at build time caused the kernel to crash on their architecture. Now PowerPC is complaining about it too. And also ARM64 appears to be having issues. It may be necessary to also update the relocation table for the values in the mcount table. Not only do we have to sort the table, but also update the relocations that may be applied to the items in the table. If the system is not relocatable, then it is fine to sort, but if it is, some architectures may have issues (although x86 does not as it shifts all addresses the same). Add a HAVE_BUILDTIME_MCOUNT_SORT that an architecture can set to say it is safe to do the sorting at build time. Also update the config to compile in build time sorting in the sorttable code in scripts/ to depend on CONFIG_BUILDTIME_MCOUNT_SORT. Link: https://lore.kernel.org/all/944D10DA-8200-4BA9-8D0A-3BED9AA99F82@linux.ibm.com/ Link: https://lkml.kernel.org/r/20220127153821.3bc1ac6e@gandalf.local.home Cc: Ingo Molnar Cc: Andrew Morton Cc: Russell King Cc: Yinan Liu Cc: Ard Biesheuvel Cc: Kees Cook Reported-by: Sachin Sant Reviewed-by: Mark Rutland Tested-by: Mark Rutland [arm64] Tested-by: Sachin Sant Fixes: 72b3942a173c ("scripts: ftrace - move the sort-processing in ftrace_init") Signed-off-by: Steven Rostedt (Google) commit dae1d8ac31896988e7313384c0370176a75e9b45 Author: Cristian Marussi Date: Wed Jan 26 10:27:19 2022 +0000 selftests: skip mincore.check_file_mmap when fs lacks needed support Report mincore.check_file_mmap as SKIP instead of FAIL if the underlying filesystem lacks support of O_TMPFILE or fallocate since such failures are not really related to mincore functionality. Cc: Ricardo Cañuelo Signed-off-by: Cristian Marussi Signed-off-by: Shuah Khan commit ac9e0a250bb155078601a5b999aab05f2a04d1ab Author: Cristian Marussi Date: Wed Jan 26 10:27:23 2022 +0000 selftests: openat2: Skip testcases that fail with EOPNOTSUPP Skip testcases that fail since the requested valid flags combination is not supported by the underlying filesystem. Cc: Aleksa Sarai Signed-off-by: Cristian Marussi Signed-off-by: Shuah Khan commit ea3396725aa143dd42fe388cb67e44c90d2fb719 Author: Cristian Marussi Date: Wed Jan 26 10:27:22 2022 +0000 selftests: openat2: Add missing dependency in Makefile Add a dependency on header helpers.h to the main target; while at that add to helpers.h also a missing include for bool types. Cc: Aleksa Sarai Signed-off-by: Cristian Marussi Signed-off-by: Shuah Khan commit e051cdf655fa016692008a446a060eff06222bb5 Author: Cristian Marussi Date: Wed Jan 26 10:27:21 2022 +0000 selftests: openat2: Print also errno in failure messages In E_func() macro, on error, print also errno in order to aid debugging. Cc: Aleksa Sarai Signed-off-by: Cristian Marussi Signed-off-by: Shuah Khan commit b9199181a9ef8252e47e207be8c23e1f50662620 Author: Muhammad Usama Anjum Date: Thu Jan 27 22:44:46 2022 +0500 selftests: futex: Use variable MAKE instead of make Recursive make commands should always use the variable MAKE, not the explicit command name ‘make’. This has benefits and removes the following warning when multiple jobs are used for the build: make[2]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule. Fixes: a8ba798bc8ec ("selftests: enable O and KBUILD_OUTPUT") Signed-off-by: Muhammad Usama Anjum Reviewed-by: André Almeida Signed-off-by: Shuah Khan commit 43f2517955875be5d96b641fba33d73097fe3cd9 Author: Anitha Chrisanthus Date: Thu Jan 27 10:45:46 2022 -0800 drm/kmb: Fix for build errors with Warray-bounds This fixes the following build error drivers/gpu/drm/kmb/kmb_plane.c: In function 'kmb_plane_atomic_disable': drivers/gpu/drm/kmb/kmb_plane.c:165:34: error: array subscript 3 is above array bounds of 'struct layer_status[2]' [-Werror=array-bounds] 165 | kmb->plane_status[plane_id].ctrl = LCD_CTRL_GL2_ENABLE; | ~~~~~~~~~~~~~~~~~^~~~~~~~~~ In file included from drivers/gpu/drm/kmb/kmb_plane.c:17: drivers/gpu/drm/kmb/kmb_drv.h:61:41: note: while referencing 'plane_status' 61 | struct layer_status plane_status[KMB_MAX_PLANES]; | ^~~~~~~~~~~~ drivers/gpu/drm/kmb/kmb_plane.c:162:34: error: array subscript 2 is above array bounds of 'struct layer_status[2]' [-Werror=array-bounds] 162 | kmb->plane_status[plane_id].ctrl = LCD_CTRL_GL1_ENABLE; | ~~~~~~~~~~~~~~~~~^~~~~~~~~~ In file included from drivers/gpu/drm/kmb/kmb_plane.c:17: drivers/gpu/drm/kmb/kmb_drv.h:61:41: note: while referencing 'plane_status' 61 | struct layer_status plane_status[KMB_MAX_PLANES]; | ^~~~~~~~~~~~ Fixes: 7f7b96a8a0a1 ("drm/kmb: Add support for KeemBay Display") Signed-off-by: Anitha Chrisanthus Reviewed-by: Kees Cook Link: https://patchwork.freedesktop.org/patch/msgid/20220127194227.2213608-1-anitha.chrisanthus@intel.com commit 708e8af4924ec2fdd5b81fe09192c6bac2f86935 Author: Anshuman Khandual Date: Tue Jan 25 19:50:34 2022 +0530 arm64: errata: Add detection for TRBE trace data corruption TRBE implementations affected by Arm erratum #1902691 might corrupt trace data or deadlock, when it's being written into the memory. So effectively TRBE is broken and hence cannot be used to capture trace data. This adds a new errata ARM64_ERRATUM_1902691 in arm64 errata framework. Cc: Catalin Marinas Cc: Will Deacon Cc: Mathieu Poirier Cc: Suzuki Poulose Cc: coresight@lists.linaro.org Cc: linux-doc@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Suzuki K Poulose Acked-by: Catalin Marinas Signed-off-by: Anshuman Khandual Link: https://lore.kernel.org/r/1643120437-14352-5-git-send-email-anshuman.khandual@arm.com Signed-off-by: Mathieu Poirier commit 3bd94a8759de9b724b83a80942b0354acd7701eb Author: Anshuman Khandual Date: Tue Jan 25 19:50:33 2022 +0530 arm64: errata: Add detection for TRBE invalid prohibited states TRBE implementations affected by Arm erratum #2038923 might get TRBE into an inconsistent view on whether trace is prohibited within the CPU. As a result, the trace buffer or trace buffer state might be corrupted. This happens after TRBE buffer has been enabled by setting TRBLIMITR_EL1.E, followed by just a single context synchronization event before execution changes from a context, in which trace is prohibited to one where it isn't, or vice versa. In these mentioned conditions, the view of whether trace is prohibited is inconsistent between parts of the CPU, and the trace buffer or the trace buffer state might be corrupted. This adds a new errata ARM64_ERRATUM_2038923 in arm64 errata framework. Cc: Catalin Marinas Cc: Will Deacon Cc: Mathieu Poirier Cc: Suzuki Poulose Cc: coresight@lists.linaro.org Cc: linux-doc@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Suzuki K Poulose Acked-by: Catalin Marinas Signed-off-by: Anshuman Khandual Link: https://lore.kernel.org/r/1643120437-14352-4-git-send-email-anshuman.khandual@arm.com Signed-off-by: Mathieu Poirier commit 607a9afaae09cde21ece458a8f10cb99d3f94f14 Author: Anshuman Khandual Date: Tue Jan 25 19:50:32 2022 +0530 arm64: errata: Add detection for TRBE ignored system register writes TRBE implementations affected by Arm erratum #2064142 might fail to write into certain system registers after the TRBE has been disabled. Under some conditions after TRBE has been disabled, writes into certain TRBE registers TRBLIMITR_EL1, TRBPTR_EL1, TRBBASER_EL1, TRBSR_EL1 and TRBTRG_EL1 will be ignored and not be effected. This adds a new errata ARM64_ERRATUM_2064142 in arm64 errata framework. Cc: Catalin Marinas Cc: Will Deacon Cc: Mathieu Poirier Cc: Suzuki Poulose Cc: coresight@lists.linaro.org Cc: linux-doc@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Suzuki K Poulose Acked-by: Catalin Marinas Signed-off-by: Anshuman Khandual Link: https://lore.kernel.org/r/1643120437-14352-3-git-send-email-anshuman.khandual@arm.com Signed-off-by: Mathieu Poirier commit 53960faf2b731dd2f9ed6e1334634b8ba6286850 Author: Anshuman Khandual Date: Tue Jan 25 19:50:31 2022 +0530 arm64: Add Cortex-A510 CPU part definition Add the CPU Partnumbers for the new Arm designs. Cc: Catalin Marinas Cc: Will Deacon Cc: Suzuki Poulose Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Suzuki K Poulose Acked-by: Catalin Marinas Signed-off-by: Anshuman Khandual Link: https://lore.kernel.org/r/1643120437-14352-2-git-send-email-anshuman.khandual@arm.com Signed-off-by: Mathieu Poirier commit 23a46422c56144939c091c76cf389aa863ce9c18 Merge: a0f90c8815706 fd20d9738395c Author: Linus Torvalds Date: Thu Jan 27 20:58:39 2022 +0200 Merge tag 'net-5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Jakub Kicinski: "Including fixes from netfilter and can. Current release - new code bugs: - tcp: add a missing sk_defer_free_flush() in tcp_splice_read() - tcp: add a stub for sk_defer_free_flush(), fix CONFIG_INET=n - nf_tables: set last expression in register tracking area - nft_connlimit: fix memleak if nf_ct_netns_get() fails - mptcp: fix removing ids bitmap setting - bonding: use rcu_dereference_rtnl when getting active slave - fix three cases of sleep in atomic context in drivers: lan966x, gve - handful of build fixes for esoteric drivers after netdev->dev_addr was made const Previous releases - regressions: - revert "ipv6: Honor all IPv6 PIO Valid Lifetime values", it broke Linux compatibility with USGv6 tests - procfs: show net device bound packet types - ipv4: fix ip option filtering for locally generated fragments - phy: broadcom: hook up soft_reset for BCM54616S Previous releases - always broken: - ipv4: raw: lock the socket in raw_bind() - ipv4: decrease the use of shared IPID generator to decrease the chance of attackers guessing the values - procfs: fix cross-netns information leakage in /proc/net/ptype - ethtool: fix link extended state for big endian - bridge: vlan: fix single net device option dumping - ping: fix the sk_bound_dev_if match in ping_lookup" * tag 'net-5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (86 commits) net: bridge: vlan: fix memory leak in __allowed_ingress net: socket: rename SKB_DROP_REASON_SOCKET_FILTER ipv4: remove sparse error in ip_neigh_gw4() ipv4: avoid using shared IP generator for connected sockets ipv4: tcp: send zero IPID in SYNACK messages ipv4: raw: lock the socket in raw_bind() MAINTAINERS: add missing IPv4/IPv6 header paths MAINTAINERS: add more files to eth PHY net: stmmac: dwmac-sun8i: use return val of readl_poll_timeout() net: bridge: vlan: fix single net device option dumping net: stmmac: skip only stmmac_ptp_register when resume from suspend net: stmmac: configure PTP clock source prior to PTP initialization Revert "ipv6: Honor all IPv6 PIO Valid Lifetime values" connector/cn_proc: Use task_is_in_init_pid_ns() pid: Introduce helper task_is_in_init_pid_ns() gve: Fix GFP flags when allocing pages net: lan966x: Fix sleep in atomic context when updating MAC table net: lan966x: Fix sleep in atomic context when injecting frames ethernet: seeq/ether3: don't write directly to netdev->dev_addr ethernet: 8390/etherh: don't write directly to netdev->dev_addr ... commit 854d0982eef0e424e8108d09d9275aaf445b1597 Author: Paul Menzel Date: Mon Jan 17 12:13:37 2022 +0100 docs/vm: Fix typo in *harden* Fixes: df4e817b7108 ("mm: page table check") Signed-off-by: Paul Menzel Link: https://lore.kernel.org/r/20220117111338.115455-1-pmenzel@molgen.mpg.de Signed-off-by: Jonathan Corbet commit 573fe46e398f4b451d075e854d221f6197941540 Author: Pali Rohár Date: Fri Jan 21 12:58:04 2022 +0100 Documentation: arm: marvell: Extend Avanta list Include another two SoCs from Avanta family. Signed-off-by: Pali Rohár Link: https://lore.kernel.org/r/20220121115804.28824-1-pali@kernel.org Signed-off-by: Jonathan Corbet commit 10855b45a428d8888b1a111d7f607c32a6a49a06 Author: Takahiro Itazuri Date: Mon Jan 24 17:14:47 2022 +0900 docs: fix typo in Documentation/kernel-hacking/locking.rst Change copy_from_user*( to copy_from_user() . Signed-off-by: Takahiro Itazuri Link: https://lore.kernel.org/r/20220124081447.34066-1-itazur@amazon.com Signed-off-by: Jonathan Corbet commit 941518d6538afa5ea0edc26e6c009d0b3163d422 Author: Jonathan Corbet Date: Thu Jan 20 17:00:33 2022 -0700 docs: Hook the RTLA documents into the kernel docs build The RTLA documents were added to Documentation/ but never hooked into the rest of the docs build, leading to a bunch of warnings like: Documentation/tools/rtla/rtla-osnoise.rst: WARNING: document isn't included in any toctree Add some basic glue to wire these documents into the build so that they are available with the rest of the rendered docs. No attempt has been made to turn the RTLA docs into proper RST files rather than warmed-over man pages; that is an exercise for the future. Fixes: d40d48e1f1f2 ("rtla: Add Documentation") Acked-by: Daniel Bristot de Oliveira Acked-by: Steven Rostedt (Google) Link: https://lore.kernel.org/r/877dau555q.fsf@meer.lwn.net Signed-off-by: Jonathan Corbet commit 908a26e139e8cf21093acc56d8e90ddad2ad1eff Author: Muhammad Usama Anjum Date: Thu Jan 27 21:33:45 2022 +0500 selftests/exec: Remove pipe from TEST_GEN_FILES pipe named FIFO special file is being created in execveat.c to perform some tests. Makefile doesn't need to do anything with the pipe. When it isn't found, Makefile generates the following build error: make: *** No rule to make target '../tools/testing/selftests/exec/pipe', needed by 'all'. Stop. pipe is created and removed during test run-time. Amended change log to add pipe remove info: Shuah Khan Fixes: 61016db15b8e ("selftests/exec: Verify execve of non-regular files fail") Signed-off-by: Muhammad Usama Anjum Reviewed-by: Shuah Khan Signed-off-by: Shuah Khan commit 01dabed20573804750af5c7bf8d1598a6bf7bf6e Author: Yang Xu Date: Thu Jan 27 17:11:37 2022 +0800 selftests/zram: Adapt the situation that /dev/zram0 is being used If zram-generator package is installed and works, then we can not remove zram module because zram swap is being used. This case needs a clean zram environment, change this test by using hot_add/hot_remove interface. So even zram device is being used, we still can add zram device and remove them in cleanup. The two interface was introduced since kernel commit 6566d1a32bf7("zram: add dynamic device add/remove functionality") in v4.2-rc1. If kernel supports these two interface, we use hot_add/hot_remove to slove this problem, if not, just check whether zram is being used or built in, then skip it on old kernel. Signed-off-by: Yang Xu Signed-off-by: Shuah Khan commit d18da7ec3719559d6e74937266d0416e6c7e0b31 Author: Yang Xu Date: Thu Jan 27 17:11:36 2022 +0800 selftests/zram01.sh: Fix compression ratio calculation zram01 uses `free -m` to measure zram memory usage. The results are no sense because they are polluted by all running processes on the system. We Should only calculate the free memory delta for the current process. So use the third field of /sys/block/zram/mm_stat to measure memory usage instead. The file is available since kernel 4.1. orig_data_size(first): uncompressed size of data stored in this disk. compr_data_size(second): compressed size of data stored in this disk mem_used_total(third): the amount of memory allocated for this disk Also remove useless zram cleanup call in zram_fill_fs and so we don't need to cleanup zram twice if fails. Signed-off-by: Yang Xu Signed-off-by: Shuah Khan commit fc4eb486a59d70bd35cf1209f0e68c2d8b979193 Author: Yang Xu Date: Thu Jan 27 17:11:35 2022 +0800 selftests/zram: Skip max_comp_streams interface on newer kernel Since commit 43209ea2d17a ("zram: remove max_comp_streams internals"), zram has switched to per-cpu streams. Even kernel still keep this interface for some reasons, but writing to max_comp_stream doesn't take any effect. So skip it on newer kernel ie 4.7. The code that comparing kernel version is from xfstests testsuite ext4/053. Signed-off-by: Yang Xu Signed-off-by: Shuah Khan commit dede34b2c1a88e26f8353b433e381ea355f7258d Author: Shuah Khan Date: Wed Jan 26 13:13:41 2022 -0700 docs/kselftest: clarify running mainline tests on stables Update the document to clarifiy support for running mainline kselftest on stable releases and the reasons for not removing test code that can test older kernels. Signed-off-by: Shuah Khan commit ebea268ea583ba4970df425dfef8c8e21d0a4e12 Author: Jon Hunter Date: Thu Jan 13 14:31:52 2022 +0000 arm64: tegra: Disable ISO SMMU for Tegra194 Commit e762232f9466 ("arm64: tegra: Add ISO SMMU controller for Tegra194") added the ISO SMMU for display devices on Tegra194. The SMMU is enabled by default but not hooked up to the display controllers yet because we do not have a way to pass frame-buffer memory from the bootloader to the kernel. However, even though the SMMU is not hooked up to the display controllers' SMMU faults are being seen if a display is connected. Therefore, keep the ISO SMMU disabled by default for now. Fixes: e762232f9466 ("arm64: tegra: Add ISO SMMU controller for Tegra194") Signed-off-by: Jon Hunter Signed-off-by: Thierry Reding commit 22d7ee32f1fb6d51ef8cf657c6685ca04745755a Author: Dmitry Osipenko Date: Thu Dec 23 17:46:50 2021 +0300 gpu: host1x: Fix hang on Tegra186+ Tegra186+ hangs if host1x hardware is disabled at a kernel boot time because we touch hardware before runtime PM is resumed. Move sync point assignment initialization to the RPM-resume callback. Older SoCs were unaffected because they skip that sync point initialization. Tested-by: Jon Hunter # T186 Reported-by: Jon Hunter # T186 Fixes: 6b6776e2ab8a ("gpu: host1x: Add initial runtime PM and OPP support") Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit f6133fbd373811066c8441737e65f384c8f31974 Author: Usama Arif Date: Thu Jan 27 14:04:44 2022 +0000 io_uring: remove unused argument from io_rsrc_node_alloc io_ring_ctx is not used in the function. Signed-off-by: Usama Arif Link: https://lore.kernel.org/r/20220127140444.4016585-1-usama.arif@bytedance.com Signed-off-by: Jens Axboe commit 10825410b956dc1ed8c5fbc8bbedaffdadde7f20 Author: Laibin Qiu Date: Thu Jan 27 18:00:47 2022 +0800 blk-mq: Fix wrong wakeup batch configuration which will cause hang Commit 180dccb0dba4f ("blk-mq: fix tag_get wait task can't be awakened") will recalculate wake_batch when incrementing or decrementing active_queues to avoid wake_batch > hctx_max_depth. At the same time, in order to not affect performance as much as possible, the minimum wakeup batch is set to 4. But when the QD is small (such as QD=1), if inc or dec active_queues increases wakeup batch, that can lead to a hang: Fix this problem with the following strategies: QD : >= 32 | < 32 --------------------------------- wakeup batch: 8~4 | 3~1 Fixes: 180dccb0dba4f ("blk-mq: fix tag_get wait task can't be awakened") Link: https://lore.kernel.org/linux-block/78cafe94-a787-e006-8851-69906f0c2128@huawei.com/T/#t Reported-by: Alex Xu (Hello71) Signed-off-by: Laibin Qiu Tested-by: Alex Xu (Hello71) Link: https://lore.kernel.org/r/20220127100047.1763746-1-qiulaibin@huawei.com Signed-off-by: Jens Axboe commit fd20d9738395cf8e27d0a17eba34169699fccdff Author: Tim Yi Date: Thu Jan 27 15:49:53 2022 +0800 net: bridge: vlan: fix memory leak in __allowed_ingress When using per-vlan state, if vlan snooping and stats are disabled, untagged or priority-tagged ingress frame will go to check pvid state. If the port state is forwarding and the pvid state is not learning/forwarding, untagged or priority-tagged frame will be dropped but skb memory is not freed. Should free skb when __allowed_ingress returns false. Fixes: a580c76d534c ("net: bridge: vlan: add per-vlan state") Signed-off-by: Tim Yi Acked-by: Nikolay Aleksandrov Link: https://lore.kernel.org/r/20220127074953.12632-1-tim.yi@pica8.com Signed-off-by: Jakub Kicinski commit b07f413732549e5a96e891411fbb5980f2d8e5a1 Author: Pablo Neira Ayuso Date: Thu Jan 27 13:40:38 2022 +0100 netfilter: nf_tables: remove assignment with no effect in chain blob builder cppcheck possible warnings: >> net/netfilter/nf_tables_api.c:2014:2: warning: Assignment of function parameter has no effect outside the function. Did you forget dereferencing it? [uselessAssignmentPtrArg] ptr += offsetof(struct nft_rule_dp, data); ^ Reported-by: kernel test robot Signed-off-by: Pablo Neira Ayuso commit 364df53c081d93fcfd6b91085ff2650c7f17b3c7 Author: Menglong Dong Date: Thu Jan 27 17:13:01 2022 +0800 net: socket: rename SKB_DROP_REASON_SOCKET_FILTER Rename SKB_DROP_REASON_SOCKET_FILTER, which is used as the reason of skb drop out of socket filter before it's part of a released kernel. It will be used for more protocols than just TCP in future series. Signed-off-by: Menglong Dong Reviewed-by: David Ahern Link: https://lore.kernel.org/all/20220127091308.91401-2-imagedong@tencent.com/ Signed-off-by: Jakub Kicinski commit 3c42b2019863b327caa233072c50739d4144dd16 Author: Eric Dumazet Date: Wed Jan 26 17:34:04 2022 -0800 ipv4: remove sparse error in ip_neigh_gw4() ./include/net/route.h:373:48: warning: incorrect type in argument 2 (different base types) ./include/net/route.h:373:48: expected unsigned int [usertype] key ./include/net/route.h:373:48: got restricted __be32 [usertype] daddr Fixes: 5c9f7c1dfc2e ("ipv4: Add helpers for neigh lookup for nexthop") Signed-off-by: Eric Dumazet Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20220127013404.1279313-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit 3ede6465e756651ff5bd9b495d6cacd5ec8216e5 Merge: 153a0d187e767 23f57406b82de Author: Jakub Kicinski Date: Thu Jan 27 08:37:05 2022 -0800 Merge branch 'ipv4-less-uses-of-shared-ip-generator' Eric Dumazet says: ==================== ipv4: less uses of shared IP generator From: Eric Dumazet We keep receiving research reports based on linux IPID generation. Before breaking part of the Internet by switching to pure random generator, this series reduces the need for the shared IP generator for TCP sockets. ==================== Link: https://lore.kernel.org/r/20220127011022.1274803-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit 23f57406b82de51809d5812afd96f210f8b627f3 Author: Eric Dumazet Date: Wed Jan 26 17:10:22 2022 -0800 ipv4: avoid using shared IP generator for connected sockets ip_select_ident_segs() has been very conservative about using the connected socket private generator only for packets with IP_DF set, claiming it was needed for some VJ compression implementations. As mentioned in this referenced document, this can be abused. (Ref: Off-Path TCP Exploits of the Mixed IPID Assignment) Before switching to pure random IPID generation and possibly hurt some workloads, lets use the private inet socket generator. Not only this will remove one vulnerability, this will also improve performance of TCP flows using pmtudisc==IP_PMTUDISC_DONT Fixes: 73f156a6e8c1 ("inetpeer: get rid of ip_id_count") Signed-off-by: Eric Dumazet Reviewed-by: David Ahern Reported-by: Ray Che Cc: Willy Tarreau Signed-off-by: Jakub Kicinski commit 970a5a3ea86da637471d3cd04d513a0755aba4bf Author: Eric Dumazet Date: Wed Jan 26 17:10:21 2022 -0800 ipv4: tcp: send zero IPID in SYNACK messages In commit 431280eebed9 ("ipv4: tcp: send zero IPID for RST and ACK sent in SYN-RECV and TIME-WAIT state") we took care of some ctl packets sent by TCP. It turns out we need to use a similar strategy for SYNACK packets. By default, they carry IP_DF and IPID==0, but there are ways to ask them to use the hashed IP ident generator and thus be used to build off-path attacks. (Ref: Off-Path TCP Exploits of the Mixed IPID Assignment) One of this way is to force (before listener is started) echo 1 >/proc/sys/net/ipv4/ip_no_pmtu_disc Another way is using forged ICMP ICMP_FRAG_NEEDED with a very small MTU (like 68) to force a false return from ip_dont_fragment() In this patch, ip_build_and_send_pkt() uses the following heuristics. 1) Most SYNACK packets are smaller than IPV4_MIN_MTU and therefore can use IP_DF regardless of the listener or route pmtu setting. 2) In case the SYNACK packet is bigger than IPV4_MIN_MTU, we use prandom_u32() generator instead of the IPv4 hashed ident one. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Eric Dumazet Reported-by: Ray Che Reviewed-by: David Ahern Cc: Geoff Alexander Cc: Willy Tarreau Signed-off-by: Jakub Kicinski commit a0f90c8815706981c483a652a6aefca51a5e191c Author: Mathias Krause Date: Thu Jan 27 18:34:19 2022 +1000 drm/vmwgfx: Fix stale file descriptors on failed usercopy A failing usercopy of the fence_rep object will lead to a stale entry in the file descriptor table as put_unused_fd() won't release it. This enables userland to refer to a dangling 'file' object through that still valid file descriptor, leading to all kinds of use-after-free exploitation scenarios. Fix this by deferring the call to fd_install() until after the usercopy has succeeded. Fixes: c906965dee22 ("drm/vmwgfx: Add export fence to file descriptor support") Signed-off-by: Mathias Krause Signed-off-by: Zack Rusin Signed-off-by: Dave Airlie Signed-off-by: Linus Torvalds commit d19a7af73b5ecaac8168712d18be72b9db166768 Author: J. Bruce Fields Date: Tue Jan 18 17:00:51 2022 -0500 lockd: fix failure to cleanup client locks In my testing, we're sometimes hitting the request->fl_flags & FL_EXISTS case in posix_lock_inode, presumably just by random luck since we're not actually initializing fl_flags here. This probably didn't matter before commit 7f024fcd5c97 ("Keep read and write fds with each nlm_file") since we wouldn't previously unlock unless we knew there were locks. But now it causes lockd to give up on removing more locks. We could just initialize fl_flags, but really it seems dubious to be calling vfs_lock_file with random values in some of the fields. Fixes: 7f024fcd5c97 ("Keep read and write fds with each nlm_file") Signed-off-by: J. Bruce Fields [ cel: fixed checkpatch.pl nit ] Signed-off-by: Chuck Lever commit 153a0d187e767c68733b8e9f46218eb1f41ab902 Author: Eric Dumazet Date: Wed Jan 26 16:51:16 2022 -0800 ipv4: raw: lock the socket in raw_bind() For some reason, raw_bind() forgot to lock the socket. BUG: KCSAN: data-race in __ip4_datagram_connect / raw_bind write to 0xffff8881170d4308 of 4 bytes by task 5466 on cpu 0: raw_bind+0x1b0/0x250 net/ipv4/raw.c:739 inet_bind+0x56/0xa0 net/ipv4/af_inet.c:443 __sys_bind+0x14b/0x1b0 net/socket.c:1697 __do_sys_bind net/socket.c:1708 [inline] __se_sys_bind net/socket.c:1706 [inline] __x64_sys_bind+0x3d/0x50 net/socket.c:1706 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae read to 0xffff8881170d4308 of 4 bytes by task 5468 on cpu 1: __ip4_datagram_connect+0xb7/0x7b0 net/ipv4/datagram.c:39 ip4_datagram_connect+0x2a/0x40 net/ipv4/datagram.c:89 inet_dgram_connect+0x107/0x190 net/ipv4/af_inet.c:576 __sys_connect_file net/socket.c:1900 [inline] __sys_connect+0x197/0x1b0 net/socket.c:1917 __do_sys_connect net/socket.c:1927 [inline] __se_sys_connect net/socket.c:1924 [inline] __x64_sys_connect+0x3d/0x50 net/socket.c:1924 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae value changed: 0x00000000 -> 0x0003007f Reported by Kernel Concurrency Sanitizer on: CPU: 1 PID: 5468 Comm: syz-executor.5 Not tainted 5.17.0-rc1-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Eric Dumazet Reported-by: syzbot Signed-off-by: David S. Miller commit 966f435add4821f53bf1c507dadc3ba9aaeb5f01 Author: Jakub Kicinski Date: Wed Jan 26 14:55:35 2022 -0800 MAINTAINERS: add missing IPv4/IPv6 header paths Add missing headers to the IP entry. Reviewed-by: David Ahern Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 492fefbaafb9d9f49d8d14614d57c956a81f2ea1 Author: Jakub Kicinski Date: Wed Jan 26 12:24:24 2022 -0800 MAINTAINERS: add more files to eth PHY include/linux/linkmode.h and include/linux/mii.h do not match anything in MAINTAINERS. Looks like they should be under Ethernet PHY. Signed-off-by: Jakub Kicinski Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 3c8cef9f3d86d9bf3402f5b397f92fc7026f78b6 Merge: 592ee1197f78b a5f3851b7f795 Author: Jens Axboe Date: Thu Jan 27 06:52:50 2022 -0700 Merge tag 'nvme-5.17-2022-01-27' of git://git.infradead.org/nvme into block-5.17 Pull NVMe fixes from Christoph: "nvme fixes for Linux 5.17 - add the IGNORE_DEV_SUBNQN quirk for Intel P4500/P4600 SSDs (Wu Zheng) - remove the unneeded ret variable in nvmf_dev_show (Changcheng Deng)" * tag 'nvme-5.17-2022-01-27' of git://git.infradead.org/nvme: nvme-fabrics: remove the unneeded ret variable in nvmf_dev_show nvme-pci: add the IGNORE_DEV_SUBNQN quirk for Intel P4500/P4600 SSDs commit 9e0db41e7a0b6f1271cbcfb16dbf5b8641b4e440 Author: Jisheng Zhang Date: Thu Jan 27 00:52:15 2022 +0800 net: stmmac: dwmac-sun8i: use return val of readl_poll_timeout() When readl_poll_timeout() timeout, we'd better directly use its return value. Before this patch: [ 2.145528] dwmac-sun8i: probe of 4500000.ethernet failed with error -14 After this patch: [ 2.138520] dwmac-sun8i: probe of 4500000.ethernet failed with error -110 Signed-off-by: Jisheng Zhang Acked-by: Jernej Skrabec Signed-off-by: David S. Miller commit dcb2c5c6ca9b9177f04abaf76e5a983d177c9414 Author: Nikolay Aleksandrov Date: Wed Jan 26 15:10:25 2022 +0200 net: bridge: vlan: fix single net device option dumping When dumping vlan options for a single net device we send the same entries infinitely because user-space expects a 0 return at the end but we keep returning skb->len and restarting the dump on retry. Fix it by returning the value from br_vlan_dump_dev() if it completed or there was an error. The only case that must return skb->len is when the dump was incomplete and needs to continue (-EMSGSIZE). Reported-by: Benjamin Poirier Fixes: 8dcea187088b ("net: bridge: vlan: add rtm definitions and dump support") Signed-off-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit aa44323e1c4d2e896f5f271c202a13f4c45e5b40 Merge: 36268983e9031 0735e639f129d Author: David S. Miller Date: Thu Jan 27 13:46:18 2022 +0000 Merge branch 'stmmac-ptp-fix' Mohammad Athari Bin Ismail says: ==================== Fix PTP issue in stmmac This patch series to fix PTP issue in stmmac related to: 1/ PTP clock source configuration during initialization. 2/ PTP initialization during resume from suspend. ==================== Signed-off-by: David S. Miller commit 0735e639f129dff455aeb91da291f5c578cc33db Author: Mohammad Athari Bin Ismail Date: Wed Jan 26 17:47:23 2022 +0800 net: stmmac: skip only stmmac_ptp_register when resume from suspend When resume from suspend, besides skipping PTP registration, it also skipping PTP HW initialization. This could cause PTP clock not able to operate properly when resume from suspend. To fix this, only stmmac_ptp_register() is skipped when resume from suspend. Fixes: fe1319291150 ("stmmac: Don't init ptp again when resume from suspend/hibernation") Cc: # 5.15.x Signed-off-by: Mohammad Athari Bin Ismail Signed-off-by: David S. Miller commit 94c82de43e01ef5747a95e4a590880de863fe423 Author: Mohammad Athari Bin Ismail Date: Wed Jan 26 17:47:22 2022 +0800 net: stmmac: configure PTP clock source prior to PTP initialization For Intel platform, it is required to configure PTP clock source prior PTP initialization in MAC. So, need to move ptp_clk_freq_config execution from stmmac_ptp_register() to stmmac_init_ptp(). Fixes: 76da35dc99af ("stmmac: intel: Add PSE and PCH PTP clock source selection") Cc: # 5.15.x Signed-off-by: Mohammad Athari Bin Ismail Signed-off-by: David S. Miller commit 3da4b7403db87d39bc2613cfd790de1de99a70ab Author: Tom Rix Date: Wed Jan 26 10:21:42 2022 -0800 ALSA: usb-audio: initialize variables that could ignore errors clang static analysis reports this representative issue mixer.c:1548:35: warning: Assigned value is garbage or undefined ucontrol->value.integer.value[0] = val; ^ ~~~ The filter_error() macro allows errors to be ignored. If errors can be ignored, initialize variables so garbage will not be used. Fixes: 48cc42973509 ("ALSA: usb-audio: Filter error from connector kctl ops, too") Signed-off-by: Tom Rix Link: https://lore.kernel.org/r/20220126182142.1184819-1-trix@redhat.com Signed-off-by: Takashi Iwai commit 36268983e90316b37000a005642af42234dabb36 Author: Guillaume Nault Date: Wed Jan 26 16:38:52 2022 +0100 Revert "ipv6: Honor all IPv6 PIO Valid Lifetime values" This reverts commit b75326c201242de9495ff98e5d5cff41d7fc0d9d. This commit breaks Linux compatibility with USGv6 tests. The RFC this commit was based on is actually an expired draft: no published RFC currently allows the new behaviour it introduced. Without full IETF endorsement, the flash renumbering scenario this patch was supposed to enable is never going to work, as other IPv6 equipements on the same LAN will keep the 2 hours limit. Fixes: b75326c20124 ("ipv6: Honor all IPv6 PIO Valid Lifetime values") Signed-off-by: Guillaume Nault Signed-off-by: David S. Miller commit 626b2dda7651a7c766108db4cdc0825db05b980d Merge: 96b5590a48610 7a534ae89e34e Author: Linus Torvalds Date: Thu Jan 27 11:23:26 2022 +0200 Merge tag 'rpmsg-v5.17-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux Pull rpmsg fixes from Bjorn Andersson: "The cdev cleanup in the rpmsg_char driver was not performed properly, resulting in unpredicable behaviour when the parent remote processor is stopped with any of the cdevs open by a client. Two patches transitions the implementation to use cdev_device_add() and cdev_del_device(), to capture the relationship between the two objects, and relocates the incorrectly placed cdev_del()" * tag 'rpmsg-v5.17-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux: rpmsg: char: Fix race between the release of rpmsg_eptdev and cdev rpmsg: char: Fix race between the release of rpmsg_ctrldev and cdev commit 96b5590a486106206f2dab7b28555b5b1a8751c5 Merge: 0280e3c58f92b eee412e968f7b Author: Linus Torvalds Date: Thu Jan 27 11:19:20 2022 +0200 Merge tag 'rproc-v5.17-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux Pull remoteproc fix from Bjorn Andersson: "The interaction between the various Qualcomm remoteproc drivers and the Qualcomm 'QMP' driver (used to communicate with the power-management hardware) was reworked in v5.17-rc1, but failed to account for the new Kconfig dependency" * tag 'rproc-v5.17-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux: remoteproc: qcom: q6v5: fix service routines build errors commit fa62f39dc7e25fc16371b958ac59b9a6fd260bea Author: Thomas Bogendoerfer Date: Tue Jan 25 15:19:44 2022 +0100 MIPS: Fix build error due to PTR used in more places Use PTR_WD instead of PTR to avoid clashes with other parts. Signed-off-by: Thomas Bogendoerfer commit d1ad2721b1eb05d54e81393a7ebc332d4a35c68f Author: Greg Kroah-Hartman Date: Thu Jan 27 08:33:04 2022 +0100 kbuild: remove include/linux/cyclades.h from header file check The file now rightfully throws up a big warning that it should never be included, so remove it from the header_check test. Fixes: f23653fe6447 ("tty: Partially revert the removal of the Cyclades public API") Cc: stable Cc: Masahiro Yamada Cc: "Maciej W. Rozycki" Reported-by: Stephen Rothwell Reported-by: kernel test robot Link: https://lore.kernel.org/r/20220127073304.42399-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit 5d8a8b324ff48c9d9fe4f1634e33dc647d2481b4 Author: Miquel Raynal Date: Tue Jan 25 13:14:26 2022 +0100 MAINTAINERS: Remove Harry Morris bouncing address Harry's e-mail address from Cascoda bounces, I have not found any contributions from him since 2018 so let's drop the Maintainer entry from the CA8210 driver and mark it Orphan. Signed-off-by: Miquel Raynal Acked-by: Alexander Aring Link: https://lore.kernel.org/r/20220125121426.848337-7-miquel.raynal@bootlin.com Signed-off-by: Stefan Schmidt commit 79c37ca73a6e9a33f7b2b7783ba6af07a448c8a9 Author: Miquel Raynal Date: Tue Jan 25 13:14:25 2022 +0100 net: ieee802154: Return meaningful error codes from the netlink helpers Returning -1 does not indicate anything useful. Use a standard and meaningful error code instead. Fixes: a26c5fd7622d ("nl802154: add support for security layer") Signed-off-by: Miquel Raynal Acked-by: Alexander Aring Link: https://lore.kernel.org/r/20220125121426.848337-6-miquel.raynal@bootlin.com Signed-off-by: Stefan Schmidt commit 621b24b09eb61c63f262da0c9c5f0e93348897e5 Author: Miquel Raynal Date: Tue Jan 25 13:14:24 2022 +0100 net: ieee802154: ca8210: Stop leaking skb's Upon error the ieee802154_xmit_complete() helper is not called. Only ieee802154_wake_queue() is called manually. We then leak the skb structure. Free the skb structure upon error before returning. Fixes: ded845a781a5 ("ieee802154: Add CA8210 IEEE 802.15.4 device driver") Signed-off-by: Miquel Raynal Acked-by: Alexander Aring Link: https://lore.kernel.org/r/20220125121426.848337-5-miquel.raynal@bootlin.com Signed-off-by: Stefan Schmidt commit e5ce576d45bf72fd0e3dc37eff897bfcc488f6a9 Author: Miquel Raynal Date: Tue Jan 25 13:14:23 2022 +0100 net: ieee802154: at86rf230: Stop leaking skb's Upon error the ieee802154_xmit_complete() helper is not called. Only ieee802154_wake_queue() is called manually. In the Tx case we then leak the skb structure. Free the skb structure upon error before returning when appropriate. As the 'is_tx = 0' cannot be moved in the complete handler because of a possible race between the delay in switching to STATE_RX_AACK_ON and a new interrupt, we introduce an intermediate 'was_tx' boolean just for this purpose. There is no Fixes tag applying here, many changes have been made on this area and the issue kind of always existed. Suggested-by: Alexander Aring Signed-off-by: Miquel Raynal Acked-by: Alexander Aring Link: https://lore.kernel.org/r/20220125121426.848337-4-miquel.raynal@bootlin.com Signed-off-by: Stefan Schmidt commit d753c4004820a888ec007dd88b271fa9c3172c5c Author: Miquel Raynal Date: Tue Jan 25 13:14:22 2022 +0100 net: ieee802154: mcr20a: Fix lifs/sifs periods These periods are expressed in time units (microseconds) while 40 and 12 are the number of symbol durations these periods will last. We need to multiply them both with phy->symbol_duration in order to get these values in microseconds. Fixes: 8c6ad9cc5157 ("ieee802154: Add NXP MCR20A IEEE 802.15.4 transceiver driver") Signed-off-by: Miquel Raynal Acked-by: Alexander Aring Link: https://lore.kernel.org/r/20220125121426.848337-3-miquel.raynal@bootlin.com Signed-off-by: Stefan Schmidt commit 1293fccc9e892712d910ec96079d3717307f1d2d Author: Miquel Raynal Date: Tue Jan 25 13:14:21 2022 +0100 net: ieee802154: hwsim: Ensure proper channel selection at probe time Drivers are expected to set the PHY current_channel and current_page according to their default state. The hwsim driver is advertising being configured on channel 13 by default but that is not reflected in its own internal pib structure. In order to ensure that this driver consider the current channel as being 13 internally, we at least need to set the pib->channel field to 13. Fixes: f25da51fdc38 ("ieee802154: hwsim: add replacement for fakelb") Signed-off-by: Miquel Raynal [stefan@datenfreihafen.org: fixed assigment from page to channel] Acked-by: Alexander Aring Link: https://lore.kernel.org/r/20220125121426.848337-2-miquel.raynal@bootlin.com Signed-off-by: Stefan Schmidt commit a5f3851b7f7951e8d4ba0a9ba3b5308a5f250a2d Author: Changcheng Deng Date: Fri Jan 7 02:23:06 2022 +0000 nvme-fabrics: remove the unneeded ret variable in nvmf_dev_show Remove unneeded variable and directly return 0. Reported-by: Zeal Robot Signed-off-by: Changcheng Deng Signed-off-by: Christoph Hellwig commit 25e58af4be412d59e056da65cc1cefbd89185bd2 Author: Wu Zheng Date: Mon Jun 21 19:07:01 2021 -0400 nvme-pci: add the IGNORE_DEV_SUBNQN quirk for Intel P4500/P4600 SSDs The Intel P4500/P4600 SSDs do not report a subsystem NQN despite claiming compliance to a standards version where reporting one is required. Add the IGNORE_DEV_SUBNQN quirk to not fail the initialization of a second such SSDs in a system. Signed-off-by: Zheng Wu Signed-off-by: Ye Jinhe Reviewed-by: Keith Busch Signed-off-by: Christoph Hellwig commit 46e994717807f4b935c44d81dde9dd8bcd9a4f5d Author: Wan Jiabing Date: Fri Jan 7 10:50:50 2022 +0800 phy: phy-mtk-tphy: Fix duplicated argument in phy-mtk-tphy Fix following coccicheck warning: ./drivers/phy/mediatek/phy-mtk-tphy.c:994:6-29: duplicated argument to && or || The efuse_rx_imp is duplicate. Here should be efuse_tx_imp. Signed-off-by: Wan Jiabing Acked-by: Chunfeng Yun Link: https://lore.kernel.org/r/20220107025050.787720-1-wanjiabing@vivo.com Signed-off-by: Vinod Koul commit a6d95c5a628a09be129f25d5663a7e9db8261f51 Author: Jiri Bohac Date: Wed Jan 26 16:00:18 2022 +0100 Revert "xfrm: xfrm_state_mtu should return at least 1280 for ipv6" This reverts commit b515d2637276a3810d6595e10ab02c13bfd0b63a. Commit b515d2637276a3810d6595e10ab02c13bfd0b63a ("xfrm: xfrm_state_mtu should return at least 1280 for ipv6") in v5.14 breaks the TCP MSS calculation in ipsec transport mode, resulting complete stalls of TCP connections. This happens when the (P)MTU is 1280 or slighly larger. The desired formula for the MSS is: MSS = (MTU - ESP_overhead) - IP header - TCP header However, the above commit clamps the (MTU - ESP_overhead) to a minimum of 1280, turning the formula into MSS = max(MTU - ESP overhead, 1280) - IP header - TCP header With the (P)MTU near 1280, the calculated MSS is too large and the resulting TCP packets never make it to the destination because they are over the actual PMTU. The above commit also causes suboptimal double fragmentation in xfrm tunnel mode, as described in https://lore.kernel.org/netdev/20210429202529.codhwpc7w6kbudug@dwarf.suse.cz/ The original problem the above commit was trying to fix is now fixed by commit 6596a0229541270fb8d38d989f91b78838e5e9da ("xfrm: fix MTU regression"). Signed-off-by: Jiri Bohac Signed-off-by: Steffen Klassert commit cfc826c88a79e22ba5d8001556eb2c7efd8a01b6 Author: Dan Carpenter Date: Wed Jan 12 14:17:24 2022 +0300 phy: stm32: fix a refcount leak in stm32_usbphyc_pll_enable() This error path needs to decrement "usbphyc->n_pll_cons.counter" before returning. Fixes: 5b1af71280ab ("phy: stm32: rework PLL Lock detection") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20220112111724.GB3019@kili Signed-off-by: Vinod Koul commit 37291f60d0822f191748c2a54ce63b0bc669020f Author: Robert Hancock Date: Tue Jan 25 18:16:00 2022 -0600 phy: xilinx: zynqmp: Fix bus width setting for SGMII TX_PROT_BUS_WIDTH and RX_PROT_BUS_WIDTH are single registers with separate bit fields for each lane. The code in xpsgtr_phy_init_sgmii was not preserving the existing register value for other lanes, so enabling the PHY in SGMII mode on one lane zeroed out the settings for all other lanes, causing other PS-GTR peripherals such as USB3 to malfunction. Use xpsgtr_clr_set to only manipulate the desired bits in the register. Fixes: 4a33bea00314 ("phy: zynqmp: Add PHY driver for the Xilinx ZynqMP Gigabit Transceiver") Signed-off-by: Robert Hancock Acked-by: Michal Simek Reviewed-by: Laurent Pinchart Link: https://lore.kernel.org/r/20220126001600.1592218-1-robert.hancock@calian.com Signed-off-by: Vinod Koul commit c7ec845f0eafc7c89efcd04a75a20d548e86beea Merge: a92f7a6feeb38 42c66d1675640 Author: Jakub Kicinski Date: Wed Jan 26 18:57:12 2022 -0800 Merge branch 'pid-introduce-helper-task_is_in_root_ns' Leo Yan says: ==================== pid: Introduce helper task_is_in_root_ns() This patch series introduces a helper function task_is_in_init_pid_ns() to replace open code. The two patches are extracted from the original series [1] for network subsystem. As a plan, we can firstly land this patch set into kernel 5.18; there have 5 patches are left out from original series [1], as a next step, I will resend them for appropriate linux-next merging. [1] https://lore.kernel.org/lkml/20211208083320.472503-1-leo.yan@linaro.org/ ==================== Link: https://lore.kernel.org/r/20220126050427.605628-1-leo.yan@linaro.org Signed-off-by: Jakub Kicinski commit 42c66d16756402c4749d94f005a998a43e8fa338 Author: Leo Yan Date: Wed Jan 26 13:04:27 2022 +0800 connector/cn_proc: Use task_is_in_init_pid_ns() This patch replaces open code with task_is_in_init_pid_ns() to check if a task is in root PID namespace. Signed-off-by: Leo Yan Acked-by: Balbir Singh Signed-off-by: Jakub Kicinski commit d7e4f8545b497b3f5687e592f1c355cbaee64c8c Author: Leo Yan Date: Wed Jan 26 13:04:26 2022 +0800 pid: Introduce helper task_is_in_init_pid_ns() Currently the kernel uses open code in multiple places to check if a task is in the root PID namespace with the kind of format: if (task_active_pid_ns(current) == &init_pid_ns) do_something(); This patch creates a new helper function, task_is_in_init_pid_ns(), it returns true if a passed task is in the root PID namespace, otherwise returns false. So it will be used to replace open codes. Suggested-by: Suzuki K Poulose Signed-off-by: Leo Yan Reviewed-by: Leon Romanovsky Acked-by: Suzuki K Poulose Acked-by: Balbir Singh Signed-off-by: Jakub Kicinski commit a92f7a6feeb3884c69c1c7c1f13bccecb2228ad0 Author: Catherine Sullivan Date: Tue Jan 25 16:38:43 2022 -0800 gve: Fix GFP flags when allocing pages Use GFP_ATOMIC when allocating pages out of the hotpath, continue to use GFP_KERNEL when allocating pages during setup. GFP_KERNEL will allow blocking which allows it to succeed more often in a low memory enviornment but in the hotpath we do not want to allow the allocation to block. Fixes: f5cedc84a30d2 ("gve: Add transmit and receive support") Signed-off-by: Catherine Sullivan Signed-off-by: David Awogbemila Link: https://lore.kernel.org/r/20220126003843.3584521-1-awogbemila@google.com Signed-off-by: Jakub Kicinski commit 9b6d90e2085ca2ce72ef9ea78658bf270855e62e Author: Zhou Qingyang Date: Tue Jan 25 00:45:25 2022 +0800 ata: pata_platform: Fix a NULL pointer dereference in __pata_platform_probe() In __pata_platform_probe(), devm_kzalloc() is assigned to ap->ops and there is a dereference of it right after that, which could introduce a NULL pointer dereference bug. Fix this by adding a NULL check of ap->ops. This bug was found by a static analyzer. Builds with 'make allyesconfig' show no new warnings, and our static analyzer no longer warns about this code. Fixes: f3d5e4f18dba ("ata: pata_of_platform: Allow to use 16-bit wide data transfer") Signed-off-by: Zhou Qingyang Signed-off-by: Damien Le Moal Reviewed-by: Sergey Shtylyov commit f9d87929d451d3e649699d0f1d74f71f77ad38f5 Author: Eric W. Biederman Date: Mon Jan 24 12:46:50 2022 -0600 ucount: Make get_ucount a safe get_user replacement When the ucount code was refactored to create get_ucount it was missed that some of the contexts in which a rlimit is kept elevated can be the only reference to the user/ucount in the system. Ordinary ucount references exist in places that also have a reference to the user namspace, but in POSIX message queues, the SysV shm code, and the SIGPENDING code there is no independent user namespace reference. Inspection of the the user_namespace show no instance of circular references between struct ucounts and the user_namespace. So hold a reference from struct ucount to i's user_namespace to resolve this problem. Link: https://lore.kernel.org/lkml/YZV7Z+yXbsx9p3JN@fixkernel.com/ Reported-by: Qian Cai Reported-by: Mathias Krause Tested-by: Mathias Krause Reviewed-by: Mathias Krause Reviewed-by: Alexey Gladkov Fixes: d64696905554 ("Reimplement RLIMIT_SIGPENDING on top of ucounts") Fixes: 6e52a9f0532f ("Reimplement RLIMIT_MSGQUEUE on top of ucounts") Fixes: d7c9e99aee48 ("Reimplement RLIMIT_MEMLOCK on top of ucounts") Cc: stable@vger.kernel.org Signed-off-by: "Eric W. Biederman" commit eda0cf1202acf1ef47f93d8f92d4839213431424 Author: Florian Westphal Date: Wed Jan 26 12:54:54 2022 +0100 selftests: nft_concat_range: add test for reload with no element add/del Add a specific test for the reload issue fixed with commit 23c54263efd7cb ("netfilter: nft_set_pipapo: allocate pcpu scratch maps on clone"). Add to set, then flush set content + restore without other add/remove in the transaction. On kernels before the fix, this test case fails: net,mac with reload [FAIL] Signed-off-by: Florian Westphal Reviewed-by: Stefano Brivio Signed-off-by: Pablo Neira Ayuso commit f459bfd4b9793f25e0fcf19878edd87d8dc569d9 Author: Pablo Neira Ayuso Date: Wed Jan 26 01:46:58 2022 +0100 netfilter: nft_byteorder: track register operations Cancel tracking for byteorder operation, otherwise selector + byteorder operation is incorrectly reduced if source and destination registers are the same. Reported-by: kernel test robot Signed-off-by: Pablo Neira Ayuso commit aeac4554eb549037ff2f719200c0a9c1c25e7eaa Author: Phil Sutter Date: Tue Jan 25 20:06:03 2022 +0100 netfilter: nft_reject_bridge: Fix for missing reply from prerouting Prior to commit fa538f7cf05aa ("netfilter: nf_reject: add reject skbuff creation helpers"), nft_reject_bridge did not assign to nskb->dev before passing nskb on to br_forward(). The shared skbuff creation helpers introduced in above commit do which seems to confuse br_forward() as reject statements in prerouting hook won't emit a packet anymore. Fix this by simply passing NULL instead of 'dev' to the helpers - they use the pointer for just that assignment, nothing else. Fixes: fa538f7cf05aa ("netfilter: nf_reject: add reject skbuff creation helpers") Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso commit aad51ca71ad83273e8826d6cfdcf53c98748d1fa Author: Florian Westphal Date: Mon Jan 24 22:09:15 2022 +0100 selftests: netfilter: check stateless nat udp checksum fixup Add a test that sends large udp packet (which is fragmented) via a stateless nft nat rule, i.e. 'ip saddr set 10.2.3.4' and check that the datagram is received by peer. On kernels without commit 4e1860a38637 ("netfilter: nft_payload: do not update layer 4 checksum when mangling fragments")', this will fail with: cmp: EOF on /tmp/tmp.V1q0iXJyQF which is empty -rw------- 1 root root 4096 Jan 24 22:03 /tmp/tmp.Aaqnq4rBKS -rw------- 1 root root 0 Jan 24 22:03 /tmp/tmp.V1q0iXJyQF ERROR: in and output file mismatch when checking udp with stateless nat FAIL: nftables v1.0.0 (Fearless Fosdick #2) On patched kernels, this will show: PASS: IP statless for ns2-PFp89amx Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit c858620d2ae3489409af593f005a48a8a324da3d Author: Florian Westphal Date: Sun Jan 23 15:45:54 2022 +0100 selftests: netfilter: reduce zone stress test running time This selftests needs almost 3 minutes to complete, reduce the insertes zones to 1000. Test now completes in about 20 seconds. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 34243b9ec856309339172b1507379074156947e8 Author: Florian Westphal Date: Sun Jan 23 15:24:00 2022 +0100 netfilter: nft_ct: fix use after free when attaching zone template The conversion erroneously removed the refcount increment. In case we can use the percpu template, we need to increment the refcount, else it will be released when the skb gets freed. In case the slowpath is taken, the new template already has a refcount of 1. Fixes: 719774377622 ("netfilter: conntrack: convert to refcount_t api") Reported-by: kernel test robot Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 7355bfe0e0cc27597d530f78e259a985cb85af40 Author: Geert Uytterhoeven Date: Sun Jan 23 13:57:17 2022 +0100 netfilter: Remove flowtable relics NF_FLOW_TABLE_IPV4 and NF_FLOW_TABLE_IPV6 are invisble, selected by nothing (so they can no longer be enabled), and their last real users have been removed (nf_flow_table_ipv6.c is empty). Clean up the leftovers. Fixes: c42ba4290b2147aa ("netfilter: flowtable: remove ipv4/ipv6 modules") Signed-off-by: Geert Uytterhoeven Signed-off-by: Pablo Neira Ayuso commit da123016ca8cb5697366c0b2dd55059b976e67e4 Author: Paul E. McKenney Date: Wed Jan 26 10:42:58 2022 -0800 rcu-tasks: Fix computation of CPU-to-list shift counts The ->percpu_enqueue_shift field is used to map from the running CPU number to the index of the corresponding callback list. This mapping can change at runtime in response to varying callback load, resulting in varying levels of contention on the callback-list locks. Unfortunately, the initial value of this field is correct only if the system happens to have a power-of-two number of CPUs, otherwise the callbacks from the high-numbered CPUs can be placed into the callback list indexed by 1 (rather than 0), and those index-1 callbacks will be ignored. This can result in soft lockups and hangs. This commit therefore corrects this mapping, adding one to this shift count as needed for systems having odd numbers of CPUs. Fixes: 7a30871b6a27 ("rcu-tasks: Introduce ->percpu_enqueue_shift for dynamic queue selection") Reported-by: Andrii Nakryiko Cc: Reported-by: Martin Lau Cc: Neeraj Upadhyay Signed-off-by: Paul E. McKenney commit 4584a768f22b7669cdebabc911543621ac661341 Author: Jeff Layton Date: Wed Jan 26 12:36:49 2022 -0500 ceph: set pool_ns in new inode layout for async creates Dan reported that he was unable to write to files that had been asynchronously created when the client's OSD caps are restricted to a particular namespace. The issue is that the layout for the new inode is only partially being filled. Ensure that we populate the pool_ns_data and pool_ns_len in the iinfo before calling ceph_fill_inode. Cc: stable@vger.kernel.org URL: https://tracker.ceph.com/issues/54013 Fixes: 9a8d03ca2e2c ("ceph: attempt to do async create when possible") Reported-by: Dan van der Ster Signed-off-by: Jeff Layton Reviewed-by: Ilya Dryomov Signed-off-by: Ilya Dryomov commit 932a9b5870d38b87ba0a9923c804b1af7d3605b9 Author: Jeff Layton Date: Tue Jan 25 15:39:16 2022 -0500 ceph: properly put ceph_string reference after async create attempt The reference acquired by try_prep_async_create is currently leaked. Ensure we put it. Cc: stable@vger.kernel.org Fixes: 9a8d03ca2e2c ("ceph: attempt to do async create when possible") Signed-off-by: Jeff Layton Reviewed-by: Ilya Dryomov Signed-off-by: Ilya Dryomov commit 89d43d0551a848e70e63d9ba11534aaeabc82443 Author: Xiubo Li Date: Wed Jan 12 12:29:04 2022 +0800 ceph: put the requests/sessions when it fails to alloc memory When failing to allocate the sessions memory we should make sure the req1 and req2 and the sessions get put. And also in case the max_sessions decreased so when kreallocate the new memory some sessions maybe missed being put. And if the max_sessions is 0 krealloc will return ZERO_SIZE_PTR, which will lead to a distinct access fault. URL: https://tracker.ceph.com/issues/53819 Fixes: e1a4541ec0b9 ("ceph: flush the mdlog before waiting on unsafe reqs") Signed-off-by: Xiubo Li Reviewed-by: Venky Shankar Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov commit 3758a6c74e08bdc15ccccd6872a6ad37d165239a Author: Evgenii Stepanov Date: Tue Jan 25 10:22:17 2022 -0800 arm64: extable: fix load_unaligned_zeropad() reg indices In ex_handler_load_unaligned_zeropad() we erroneously extract the data and addr register indices from ex->type rather than ex->data. As ex->type will contain EX_TYPE_LOAD_UNALIGNED_ZEROPAD (i.e. 4): * We'll always treat X0 as the address register, since EX_DATA_REG_ADDR is extracted from bits [9:5]. Thus, we may attempt to dereference an arbitrary address as X0 may hold an arbitrary value. * We'll always treat X4 as the data register, since EX_DATA_REG_DATA is extracted from bits [4:0]. Thus we will corrupt X4 and cause arbitrary behaviour within load_unaligned_zeropad() and its caller. Fix this by extracting both values from ex->data as originally intended. On an MTE-enabled QEMU image we are hitting the following crash: Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000 Call trace: fixup_exception+0xc4/0x108 __do_kernel_fault+0x3c/0x268 do_tag_check_fault+0x3c/0x104 do_mem_abort+0x44/0xf4 el1_abort+0x40/0x64 el1h_64_sync_handler+0x60/0xa0 el1h_64_sync+0x7c/0x80 link_path_walk+0x150/0x344 path_openat+0xa0/0x7dc do_filp_open+0xb8/0x168 do_sys_openat2+0x88/0x17c __arm64_sys_openat+0x74/0xa0 invoke_syscall+0x48/0x148 el0_svc_common+0xb8/0xf8 do_el0_svc+0x28/0x88 el0_svc+0x24/0x84 el0t_64_sync_handler+0x88/0xec el0t_64_sync+0x1b4/0x1b8 Code: f8695a69 71007d1f 540000e0 927df12a (f940014a) Fixes: 753b32368705 ("arm64: extable: add load_unaligned_zeropad() handler") Cc: # 5.16.x Reviewed-by: Mark Rutland Signed-off-by: Evgenii Stepanov Link: https://lore.kernel.org/r/20220125182217.2605202-1-eugenis@google.com Signed-off-by: Catalin Marinas commit fc55e63e148f1db2180867da875460a00aac8bd1 Author: Dan Carpenter Date: Tue Jan 11 20:32:43 2022 +0300 counter: fix an IS_ERR() vs NULL bug There are 8 callers for devm_counter_alloc() and they all check for NULL instead of error pointers. I think NULL is the better thing to return for allocation functions so update counter_alloc() and devm_counter_alloc() to return NULL instead of error pointers. Fixes: c18e2760308e ("counter: Provide alternative counter registration functions") Acked-by: Uwe Kleine-König Acked-by: William Breathitt Gray Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20220111173243.GA2192@kili Signed-off-by: Greg Kroah-Hartman commit dd4516aee365fc9c944c9d6036b6b87363398680 Author: Paolo Bonzini Date: Wed Jan 26 07:44:34 2022 -0500 selftests: kvm: move vm_xsave_req_perm call to amx_test There is no need for tests other than amx_test to enable dynamic xsave states. Remove the call to vm_xsave_req_perm from generic code, and move it inside the test. While at it, allow customizing the bit that is requested, so that future tests can use it differently. Signed-off-by: Paolo Bonzini commit 05a9e065059e566f218f8778c4d17ee75db56c55 Author: Like Xu Date: Wed Jan 26 17:22:26 2022 +0000 KVM: x86: Sync the states size with the XCR0/IA32_XSS at, any time XCR0 is reset to 1 by RESET but not INIT and IA32_XSS is zeroed by both RESET and INIT. The kvm_set_msr_common()'s handling of MSR_IA32_XSS also needs to update kvm_update_cpuid_runtime(). In the above cases, the size in bytes of the XSAVE area containing all states enabled by XCR0 or (XCRO | IA32_XSS) needs to be updated. For simplicity and consistency, existing helpers are used to write values and call kvm_update_cpuid_runtime(), and it's not exactly a fast path. Fixes: a554d207dc46 ("KVM: X86: Processor States following Reset or INIT") Cc: stable@vger.kernel.org Signed-off-by: Like Xu Signed-off-by: Sean Christopherson Message-Id: <20220126172226.2298529-4-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 4c282e51e4450b94680d6ca3b10f830483b1f243 Author: Like Xu Date: Wed Jan 26 17:22:25 2022 +0000 KVM: x86: Update vCPU's runtime CPUID on write to MSR_IA32_XSS Do a runtime CPUID update for a vCPU if MSR_IA32_XSS is written, as the size in bytes of the XSAVE area is affected by the states enabled in XSS. Fixes: 203000993de5 ("kvm: vmx: add MSR logic for XSAVES") Cc: stable@vger.kernel.org Signed-off-by: Like Xu [sean: split out as a separate patch, adjust Fixes tag] Signed-off-by: Sean Christopherson Message-Id: <20220126172226.2298529-3-seanjc@google.com> Signed-off-by: Paolo Bonzini commit be4f3b3f82271c3193ce200a996dc70682c8e622 Author: Xiaoyao Li Date: Wed Jan 26 17:22:24 2022 +0000 KVM: x86: Keep MSR_IA32_XSS unchanged for INIT It has been corrected from SDM version 075 that MSR_IA32_XSS is reset to zero on Power up and Reset but keeps unchanged on INIT. Fixes: a554d207dc46 ("KVM: X86: Processor States following Reset or INIT") Cc: stable@vger.kernel.org Signed-off-by: Xiaoyao Li Signed-off-by: Sean Christopherson Message-Id: <20220126172226.2298529-2-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 663d34c8df98740f1e90241e78e456d00b3c6cad Author: Vasily Gorbik Date: Thu Jan 20 16:23:19 2022 +0100 s390/hypfs: include z/VM guests with access control group set Currently if z/VM guest is allowed to retrieve hypervisor performance data globally for all guests (privilege class B) the query is formed in a way to include all guests but the group name is left empty. This leads to that z/VM guests which have access control group set not being included in the results (even local vm). Change the query group identifier from empty to "any" to retrieve information about all guests from any groups (or without a group set). Cc: stable@vger.kernel.org Fixes: 31cb4bd31a48 ("[S390] Hypervisor filesystem (s390_hypfs) for z/VM") Reviewed-by: Gerald Schaefer Signed-off-by: Vasily Gorbik commit 811f95ff95270e6048197821434d9301e3d7f07c Author: Sean Christopherson Date: Tue Jan 25 21:04:45 2022 +0000 KVM: x86: Free kvm_cpuid_entry2 array on post-KVM_RUN KVM_SET_CPUID{,2} Free the "struct kvm_cpuid_entry2" array on successful post-KVM_RUN KVM_SET_CPUID{,2} to fix a memory leak, the callers of kvm_set_cpuid() free the array only on failure. BUG: memory leak unreferenced object 0xffff88810963a800 (size 2048): comm "syz-executor025", pid 3610, jiffies 4294944928 (age 8.080s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 0d 00 00 00 ................ 47 65 6e 75 6e 74 65 6c 69 6e 65 49 00 00 00 00 GenuntelineI.... backtrace: [] kmalloc_node include/linux/slab.h:604 [inline] [] kvmalloc_node+0x3e/0x100 mm/util.c:580 [] kvmalloc include/linux/slab.h:732 [inline] [] vmemdup_user+0x22/0x100 mm/util.c:199 [] kvm_vcpu_ioctl_set_cpuid2+0x8f/0xf0 arch/x86/kvm/cpuid.c:423 [] kvm_arch_vcpu_ioctl+0xb99/0x1e60 arch/x86/kvm/x86.c:5251 [] kvm_vcpu_ioctl+0x4ad/0x950 arch/x86/kvm/../../../virt/kvm/kvm_main.c:4066 [] 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 Fixes: c6617c61e8fe ("KVM: x86: Partially allow KVM_SET_CPUID{,2} after KVM_RUN") Cc: stable@vger.kernel.org Reported-by: syzbot+be576ad7655690586eec@syzkaller.appspotmail.com Signed-off-by: Sean Christopherson Message-Id: <20220125210445.2053429-1-seanjc@google.com> Reviewed-by: Vitaly Kuznetsov Signed-off-by: Paolo Bonzini commit ebb7fb1557b1d03b906b668aa2164b51e6b7d19a Author: Dave Chinner Date: Wed Jan 26 09:19:20 2022 -0800 xfs, iomap: limit individual ioend chain lengths in writeback Trond Myklebust reported soft lockups in XFS IO completion such as this: watchdog: BUG: soft lockup - CPU#12 stuck for 23s! [kworker/12:1:3106] CPU: 12 PID: 3106 Comm: kworker/12:1 Not tainted 4.18.0-305.10.2.el8_4.x86_64 #1 Workqueue: xfs-conv/md127 xfs_end_io [xfs] RIP: 0010:_raw_spin_unlock_irqrestore+0x11/0x20 Call Trace: wake_up_page_bit+0x8a/0x110 iomap_finish_ioend+0xd7/0x1c0 iomap_finish_ioends+0x7f/0xb0 xfs_end_ioend+0x6b/0x100 [xfs] xfs_end_io+0xb9/0xe0 [xfs] process_one_work+0x1a7/0x360 worker_thread+0x1fa/0x390 kthread+0x116/0x130 ret_from_fork+0x35/0x40 Ioends are processed as an atomic completion unit when all the chained bios in the ioend have completed their IO. Logically contiguous ioends can also be merged and completed as a single, larger unit. Both of these things can be problematic as both the bio chains per ioend and the size of the merged ioends processed as a single completion are both unbound. If we have a large sequential dirty region in the page cache, write_cache_pages() will keep feeding us sequential pages and we will keep mapping them into ioends and bios until we get a dirty page at a non-sequential file offset. These large sequential runs can will result in bio and ioend chaining to optimise the io patterns. The pages iunder writeback are pinned within these chains until the submission chaining is broken, allowing the entire chain to be completed. This can result in huge chains being processed in IO completion context. We get deep bio chaining if we have large contiguous physical extents. We will keep adding pages to the current bio until it is full, then we'll chain a new bio to keep adding pages for writeback. Hence we can build bio chains that map millions of pages and tens of gigabytes of RAM if the page cache contains big enough contiguous dirty file regions. This long bio chain pins those pages until the final bio in the chain completes and the ioend can iterate all the chained bios and complete them. OTOH, if we have a physically fragmented file, we end up submitting one ioend per physical fragment that each have a small bio or bio chain attached to them. We do not chain these at IO submission time, but instead we chain them at completion time based on file offset via iomap_ioend_try_merge(). Hence we can end up with unbound ioend chains being built via completion merging. XFS can then do COW remapping or unwritten extent conversion on that merged chain, which involves walking an extent fragment at a time and running a transaction to modify the physical extent information. IOWs, we merge all the discontiguous ioends together into a contiguous file range, only to then process them individually as discontiguous extents. This extent manipulation is computationally expensive and can run in a tight loop, so merging logically contiguous but physically discontigous ioends gains us nothing except for hiding the fact the fact we broke the ioends up into individual physical extents at submission and then need to loop over those individual physical extents at completion. Hence we need to have mechanisms to limit ioend sizes and to break up completion processing of large merged ioend chains: 1. bio chains per ioend need to be bound in length. Pure overwrites go straight to iomap_finish_ioend() in softirq context with the exact bio chain attached to the ioend by submission. Hence the only way to prevent long holdoffs here is to bound ioend submission sizes because we can't reschedule in softirq context. 2. iomap_finish_ioends() has to handle unbound merged ioend chains correctly. This relies on any one call to iomap_finish_ioend() being bound in runtime so that cond_resched() can be issued regularly as the long ioend chain is processed. i.e. this relies on mechanism #1 to limit individual ioend sizes to work correctly. 3. filesystems have to loop over the merged ioends to process physical extent manipulations. This means they can loop internally, and so we break merging at physical extent boundaries so the filesystem can easily insert reschedule points between individual extent manipulations. Signed-off-by: Dave Chinner Reported-and-tested-by: Trond Myklebust Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit d6e656cd266cdcc95abd372c7faef05bee271d1a Author: Sean Christopherson Date: Tue Jan 25 22:05:27 2022 +0000 KVM: nVMX: WARN on any attempt to allocate shadow VMCS for vmcs02 WARN if KVM attempts to allocate a shadow VMCS for vmcs02. KVM emulates VMCS shadowing but doesn't virtualize it, i.e. KVM should never allocate a "real" shadow VMCS for L2. The previous code WARNed but continued anyway with the allocation, presumably in an attempt to avoid NULL pointer dereference. However, alloc_vmcs (and hence alloc_shadow_vmcs) can fail, and indeed the sole caller does: if (enable_shadow_vmcs && !alloc_shadow_vmcs(vcpu)) goto out_shadow_vmcs; which makes it not a useful attempt. Signed-off-by: Sean Christopherson Message-Id: <20220125220527.2093146-1-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 4cf3d3ebe8794c449af3e0e8c1d790c97e461d20 Author: Sean Christopherson Date: Tue Jan 25 22:17:25 2022 +0000 KVM: selftests: Don't skip L2's VMCALL in SMM test for SVM guest Don't skip the vmcall() in l2_guest_code() prior to re-entering L2, doing so will result in L2 running to completion, popping '0' off the stack for RET, jumping to address '0', and ultimately dying with a triple fault shutdown. It's not at all obvious why the test re-enters L2 and re-executes VMCALL, but presumably it serves a purpose. The VMX path doesn't skip vmcall(), and the test can't possibly have passed on SVM, so just do what VMX does. Fixes: d951b2210c1a ("KVM: selftests: smm_test: Test SMM enter from L2") Cc: Maxim Levitsky Signed-off-by: Sean Christopherson Message-Id: <20220125221725.2101126-1-seanjc@google.com> Reviewed-by: Vitaly Kuznetsov Tested-by: Vitaly Kuznetsov Signed-off-by: Paolo Bonzini commit 033a3ea59a19df63edb4db6bfdbb357cd028258a Author: Vitaly Kuznetsov Date: Wed Jan 26 14:18:04 2022 +0100 KVM: x86: Check .flags in kvm_cpuid_check_equal() too kvm_cpuid_check_equal() checks for the (full) equality of the supplied CPUID data so .flags need to be checked too. Reported-by: Sean Christopherson Fixes: c6617c61e8fe ("KVM: x86: Partially allow KVM_SET_CPUID{,2} after KVM_RUN") Signed-off-by: Vitaly Kuznetsov Message-Id: <20220126131804.2839410-1-vkuznets@redhat.com> Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini commit f7e570780efc5cec9b2ed1e0472a7da14e864fdb Author: Sean Christopherson Date: Tue Jan 25 22:03:58 2022 +0000 KVM: x86: Forcibly leave nested virt when SMM state is toggled Forcibly leave nested virtualization operation if userspace toggles SMM state via KVM_SET_VCPU_EVENTS or KVM_SYNC_X86_EVENTS. If userspace forces the vCPU out of SMM while it's post-VMXON and then injects an SMI, vmx_enter_smm() will overwrite vmx->nested.smm.vmxon and end up with both vmxon=false and smm.vmxon=false, but all other nVMX state allocated. Don't attempt to gracefully handle the transition as (a) most transitions are nonsencial, e.g. forcing SMM while L2 is running, (b) there isn't sufficient information to handle all transitions, e.g. SVM wants access to the SMRAM save state, and (c) KVM_SET_VCPU_EVENTS must precede KVM_SET_NESTED_STATE during state restore as the latter disallows putting the vCPU into L2 if SMM is active, and disallows tagging the vCPU as being post-VMXON in SMM if SMM is not active. Abuse of KVM_SET_VCPU_EVENTS manifests as a WARN and memory leak in nVMX due to failure to free vmcs01's shadow VMCS, but the bug goes far beyond just a memory leak, e.g. toggling SMM on while L2 is active puts the vCPU in an architecturally impossible state. WARNING: CPU: 0 PID: 3606 at free_loaded_vmcs arch/x86/kvm/vmx/vmx.c:2665 [inline] WARNING: CPU: 0 PID: 3606 at free_loaded_vmcs+0x158/0x1a0 arch/x86/kvm/vmx/vmx.c:2656 Modules linked in: CPU: 1 PID: 3606 Comm: syz-executor725 Not tainted 5.17.0-rc1-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:free_loaded_vmcs arch/x86/kvm/vmx/vmx.c:2665 [inline] RIP: 0010:free_loaded_vmcs+0x158/0x1a0 arch/x86/kvm/vmx/vmx.c:2656 Code: <0f> 0b eb b3 e8 8f 4d 9f 00 e9 f7 fe ff ff 48 89 df e8 92 4d 9f 00 Call Trace: kvm_arch_vcpu_destroy+0x72/0x2f0 arch/x86/kvm/x86.c:11123 kvm_vcpu_destroy arch/x86/kvm/../../../virt/kvm/kvm_main.c:441 [inline] kvm_destroy_vcpus+0x11f/0x290 arch/x86/kvm/../../../virt/kvm/kvm_main.c:460 kvm_free_vcpus arch/x86/kvm/x86.c:11564 [inline] kvm_arch_destroy_vm+0x2e8/0x470 arch/x86/kvm/x86.c:11676 kvm_destroy_vm arch/x86/kvm/../../../virt/kvm/kvm_main.c:1217 [inline] kvm_put_kvm+0x4fa/0xb00 arch/x86/kvm/../../../virt/kvm/kvm_main.c:1250 kvm_vm_release+0x3f/0x50 arch/x86/kvm/../../../virt/kvm/kvm_main.c:1273 __fput+0x286/0x9f0 fs/file_table.c:311 task_work_run+0xdd/0x1a0 kernel/task_work.c:164 exit_task_work include/linux/task_work.h:32 [inline] do_exit+0xb29/0x2a30 kernel/exit.c:806 do_group_exit+0xd2/0x2f0 kernel/exit.c:935 get_signal+0x4b0/0x28c0 kernel/signal.c:2862 arch_do_signal_or_restart+0x2a9/0x1c40 arch/x86/kernel/signal.c:868 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:207 __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:300 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae Cc: stable@vger.kernel.org Reported-by: syzbot+8112db3ab20e70d50c31@syzkaller.appspotmail.com Signed-off-by: Sean Christopherson Message-Id: <20220125220358.2091737-1-seanjc@google.com> Signed-off-by: Paolo Bonzini commit aa3b39f38c7a5dfdd10b3f61a0d055b85aa85451 Author: Vitaly Kuznetsov Date: Mon Dec 20 16:21:35 2021 +0100 KVM: SVM: drop unnecessary code in svm_hv_vmcb_dirty_nested_enlightenments() Commit 3fa5e8fd0a0e4 ("KVM: SVM: delay svm_vcpu_init_msrpm after svm->vmcb is initialized") re-arranged svm_vcpu_init_msrpm() call in svm_create_vcpu(), thus making the comment about vmcb being NULL obsolete. Drop it. While on it, drop superfluous vmcb_is_clean() check: vmcb_mark_dirty() is a bit flip, an extra check is unlikely to bring any performance gain. Drop now-unneeded vmcb_is_clean() helper as well. Fixes: 3fa5e8fd0a0e4 ("KVM: SVM: delay svm_vcpu_init_msrpm after svm->vmcb is initialized") Signed-off-by: Vitaly Kuznetsov Message-Id: <20211220152139.418372-2-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini commit 38dfa8308cfc43f671a74c753302fec26808edc0 Author: Vitaly Kuznetsov Date: Mon Dec 20 16:21:36 2021 +0100 KVM: SVM: hyper-v: Enable Enlightened MSR-Bitmap support for real Commit c4327f15dfc7 ("KVM: SVM: hyper-v: Enlightened MSR-Bitmap support") introduced enlightened MSR-Bitmap support for KVM-on-Hyper-V but it didn't actually enable the support. Similar to enlightened NPT TLB flush and direct TLB flush features, the guest (KVM) has to tell L0 (Hyper-V) that it's using the feature by setting the appropriate feature fit in VMCB control area (sw reserved fields). Fixes: c4327f15dfc7 ("KVM: SVM: hyper-v: Enlightened MSR-Bitmap support") Signed-off-by: Vitaly Kuznetsov Message-Id: <20211220152139.418372-3-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini commit cdf85e0c5dc766fc7fc779466280e454a6d04f87 Author: Sean Christopherson Date: Thu Jan 20 01:07:19 2022 +0000 KVM: SVM: Don't kill SEV guest if SMAP erratum triggers in usermode Inject a #GP instead of synthesizing triple fault to try to avoid killing the guest if emulation of an SEV guest fails due to encountering the SMAP erratum. The injected #GP may still be fatal to the guest, e.g. if the userspace process is providing critical functionality, but KVM should make every attempt to keep the guest alive. Signed-off-by: Sean Christopherson Reviewed-by: Liam Merwick Message-Id: <20220120010719.711476-10-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 3280cc22aea74d78ebbea277ff8bc8d593582de3 Author: Sean Christopherson Date: Thu Jan 20 01:07:18 2022 +0000 KVM: SVM: Don't apply SEV+SMAP workaround on code fetch or PT access Resume the guest instead of synthesizing a triple fault shutdown if the instruction bytes buffer is empty due to the #NPF being on the code fetch itself or on a page table access. The SMAP errata applies if and only if the code fetch was successful and ucode's subsequent data read from the code page encountered a SMAP violation. In practice, the guest is likely hosed either way, but crashing the guest on a code fetch to emulated MMIO is technically wrong according to the behavior described in the APM. Signed-off-by: Sean Christopherson Reviewed-by: Liam Merwick Message-Id: <20220120010719.711476-9-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 04c40f344defdbd842d8a64fcfb47ef74b39ef4e Author: Sean Christopherson Date: Thu Jan 20 01:07:17 2022 +0000 KVM: SVM: Inject #UD on attempted emulation for SEV guest w/o insn buffer Inject #UD if KVM attempts emulation for an SEV guests without an insn buffer and instruction decoding is required. The previous behavior of allowing emulation if there is no insn buffer is undesirable as doing so means KVM is reading guest private memory and thus decoding cyphertext, i.e. is emulating garbage. The check was previously necessary as the emulation type was not provided, i.e. SVM needed to allow emulation to handle completion of emulation after exiting to userspace to handle I/O. Signed-off-by: Sean Christopherson Reviewed-by: Liam Merwick Message-Id: <20220120010719.711476-8-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 132627c64d94b1561ba5a444824e46c9f84c3d5b Author: Sean Christopherson Date: Thu Jan 20 01:07:16 2022 +0000 KVM: SVM: WARN if KVM attempts emulation on #UD or #GP for SEV guests WARN if KVM attempts to emulate in response to #UD or #GP for SEV guests, i.e. if KVM intercepts #UD or #GP, as emulation on any fault except #NPF is impossible since KVM cannot read guest private memory to get the code stream, and the CPU's DecodeAssists feature only provides the instruction bytes on #NPF. Signed-off-by: Sean Christopherson Reviewed-by: Liam Merwick Message-Id: <20220120010719.711476-7-seanjc@google.com> [Warn on EMULTYPE_TRAP_UD_FORCED according to Liam Merwick's review. - Paolo] Signed-off-by: Paolo Bonzini commit 4d31d9eff244e2631f028d658979ccbbdbcb423b Author: Sean Christopherson Date: Thu Jan 20 01:07:15 2022 +0000 KVM: x86: Pass emulation type to can_emulate_instruction() Pass the emulation type to kvm_x86_ops.can_emulate_insutrction() so that a future commit can harden KVM's SEV support to WARN on emulation scenarios that should never happen. No functional change intended. Signed-off-by: Sean Christopherson Reviewed-by: Liam Merwick Message-Id: <20220120010719.711476-6-seanjc@google.com> Signed-off-by: Paolo Bonzini commit c532f2903b69b775d27016511fbe29a14a098f95 Author: Sean Christopherson Date: Thu Jan 20 01:07:14 2022 +0000 KVM: SVM: Explicitly require DECODEASSISTS to enable SEV support Add a sanity check on DECODEASSIST being support if SEV is supported, as KVM cannot read guest private memory and thus relies on the CPU to provide the instruction byte stream on #NPF for emulation. The intent of the check is to document the dependency, it should never fail in practice as producing hardware that supports SEV but not DECODEASSISTS would be non-sensical. Signed-off-by: Sean Christopherson Reviewed-by: Liam Merwick Message-Id: <20220120010719.711476-5-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 0b0be065b7563ac708aaa9f69dd4941c80b3446d Author: Sean Christopherson Date: Thu Jan 20 01:07:13 2022 +0000 KVM: SVM: Don't intercept #GP for SEV guests Never intercept #GP for SEV guests as reading SEV guest private memory will return cyphertext, i.e. emulating on #GP can't work as intended. Cc: stable@vger.kernel.org Cc: Tom Lendacky Cc: Brijesh Singh Signed-off-by: Sean Christopherson Reviewed-by: Liam Merwick Message-Id: <20220120010719.711476-4-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 31c25585695abdf03d6160aa6d829e855b256329 Author: Sean Christopherson Date: Thu Jan 20 01:07:12 2022 +0000 Revert "KVM: SVM: avoid infinite loop on NPF from bad address" Revert a completely broken check on an "invalid" RIP in SVM's workaround for the DecodeAssists SMAP errata. kvm_vcpu_gfn_to_memslot() obviously expects a gfn, i.e. operates in the guest physical address space, whereas RIP is a virtual (not even linear) address. The "fix" worked for the problematic KVM selftest because the test identity mapped RIP. Fully revert the hack instead of trying to translate RIP to a GPA, as the non-SEV case is now handled earlier, and KVM cannot access guest page tables to translate RIP. This reverts commit e72436bc3a5206f95bb384e741154166ddb3202e. Fixes: e72436bc3a52 ("KVM: SVM: avoid infinite loop on NPF from bad address") Reported-by: Liam Merwick Cc: stable@vger.kernel.org Signed-off-by: Sean Christopherson Reviewed-by: Liam Merwick Message-Id: <20220120010719.711476-3-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 55467fcd55b89c622e62b4afe60ac0eb2fae91f2 Author: Sean Christopherson Date: Thu Jan 20 01:07:11 2022 +0000 KVM: SVM: Never reject emulation due to SMAP errata for !SEV guests Always signal that emulation is possible for !SEV guests regardless of whether or not the CPU provided a valid instruction byte stream. KVM can read all guest state (memory and registers) for !SEV guests, i.e. can fetch the code stream from memory even if the CPU failed to do so because of the SMAP errata. Fixes: 05d5a4863525 ("KVM: SVM: Workaround errata#1096 (insn_len maybe zero on SMAP violation)") Cc: stable@vger.kernel.org Cc: Tom Lendacky Cc: Brijesh Singh Signed-off-by: Sean Christopherson Reviewed-by: Liam Merwick Message-Id: <20220120010719.711476-2-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 47c28d436f409f5b009dc82bd82d4971088aa391 Author: Denis Valeev Date: Sat Jan 22 23:13:57 2022 +0300 KVM: x86: nSVM: skip eax alignment check for non-SVM instructions The bug occurs on #GP triggered by VMware backdoor when eax value is unaligned. eax alignment check should not be applied to non-SVM instructions because it leads to incorrect omission of the instructions emulation. Apply the alignment check only to SVM instructions to fix. Fixes: d1cba6c92237 ("KVM: x86: nSVM: test eax for 4K alignment for GP errata workaround") Signed-off-by: Denis Valeev Message-Id: Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini commit 1ffce0924a8c86cf0590c039cd5f5c9375d32e9b Author: Like Xu Date: Tue Jan 25 19:52:23 2022 +0800 KVM: x86/cpuid: Exclude unpermitted xfeatures sizes at KVM_GET_SUPPORTED_CPUID With the help of xstate_get_guest_group_perm(), KVM can exclude unpermitted xfeatures in cpuid.0xd.0.eax, in which case the corresponding xfeatures sizes should also be matched to the permitted xfeatures. To fix this inconsistency, the permitted_xcr0 and permitted_xss are defined consistently, which implies 'supported' plus certain permissions for this task, and it also fixes cpuid.0xd.1.ebx and later leaf-by-leaf queries. Fixes: 445ecdf79be0 ("kvm: x86: Exclude unpermitted xfeatures at KVM_GET_SUPPORTED_CPUID") Signed-off-by: Like Xu Message-Id: <20220125115223.33707-1-likexu@tencent.com> Signed-off-by: Paolo Bonzini commit 35fe7cfbab2e81f1afb23fc4212210b1de6d9633 Author: Wanpeng Li Date: Tue Jan 25 01:17:00 2022 -0800 KVM: LAPIC: Also cancel preemption timer during SET_LAPIC The below warning is splatting during guest reboot. ------------[ cut here ]------------ WARNING: CPU: 0 PID: 1931 at arch/x86/kvm/x86.c:10322 kvm_arch_vcpu_ioctl_run+0x874/0x880 [kvm] CPU: 0 PID: 1931 Comm: qemu-system-x86 Tainted: G I 5.17.0-rc1+ #5 RIP: 0010:kvm_arch_vcpu_ioctl_run+0x874/0x880 [kvm] Call Trace: kvm_vcpu_ioctl+0x279/0x710 [kvm] __x64_sys_ioctl+0x83/0xb0 do_syscall_64+0x3b/0xc0 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7fd39797350b This can be triggered by not exposing tsc-deadline mode and doing a reboot in the guest. The lapic_shutdown() function which is called in sys_reboot path will not disarm the flying timer, it just masks LVTT. lapic_shutdown() clears APIC state w/ LVT_MASKED and timer-mode bit is 0, this can trigger timer-mode switch between tsc-deadline and oneshot/periodic, which can result in preemption timer be cancelled in apic_update_lvtt(). However, We can't depend on this when not exposing tsc-deadline mode and oneshot/periodic modes emulated by preemption timer. Qemu will synchronise states around reset, let's cancel preemption timer under KVM_SET_LAPIC. Signed-off-by: Wanpeng Li Message-Id: <1643102220-35667-1-git-send-email-wanpengli@tencent.com> Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini commit 519669cc58368385db93fd1560c09bf3334a6ecc Author: Jim Mattson Date: Mon Jan 24 16:43:59 2022 -0800 KVM: VMX: Remove vmcs_config.order The maximum size of a VMCS (or VMXON region) is 4096. By definition, these are order 0 allocations. Signed-off-by: Jim Mattson Message-Id: <20220125004359.147600-1-jmattson@google.com> Signed-off-by: Paolo Bonzini commit c80d401c52a2d1baf2a5afeb06f0ffe678e56d23 Author: Tianchen Ding Date: Tue Jan 18 18:05:18 2022 +0800 cpuset: Fix the bug that subpart_cpus updated wrongly in update_cpumask() subparts_cpus should be limited as a subset of cpus_allowed, but it is updated wrongly by using cpumask_andnot(). Use cpumask_and() instead to fix it. Fixes: ee8dde0cd2ce ("cpuset: Add new v2 cpuset.sched.partition flag") Signed-off-by: Tianchen Ding Reviewed-by: Waiman Long Signed-off-by: Tejun Heo commit 66d28b21fe6b3da8d1e9f0a7ba38bc61b6c547e1 Author: Bjorn Helgaas Date: Wed Jan 26 09:40:01 2022 -0600 PCI/sysfs: Find shadow ROM before static attribute initialization Ville reported that the sysfs "rom" file for VGA devices disappeared after 527139d738d7 ("PCI/sysfs: Convert "rom" to static attribute"). Prior to 527139d738d7, FINAL fixups, including pci_fixup_video() where we find shadow ROMs, were run before pci_create_sysfs_dev_files() created the sysfs "rom" file. After 527139d738d7, "rom" is a static attribute and is created before FINAL fixups are run, so we didn't create "rom" files for shadow ROMs: acpi_pci_root_add ... pci_scan_single_device pci_device_add pci_fixup_video # <-- new HEADER fixup device_add ... if (grp->is_visible()) pci_dev_rom_attr_is_visible # after 527139d738d7 pci_bus_add_devices pci_bus_add_device pci_fixup_device(pci_fixup_final) pci_fixup_video # <-- previous FINAL fixup pci_create_sysfs_dev_files if (pci_resource_len(pdev, PCI_ROM_RESOURCE)) sysfs_create_bin_file("rom") # before 527139d738d7 Change pci_fixup_video() to be a HEADER fixup so it runs before sysfs static attributes are initialized. Rename the Loongson pci_fixup_radeon() to pci_fixup_video() and make its dmesg logging identical to the others since it is doing the same job. Link: https://lore.kernel.org/r/YbxqIyrkv3GhZVxx@intel.com Fixes: 527139d738d7 ("PCI/sysfs: Convert "rom" to static attribute") Link: https://lore.kernel.org/r/20220126154001.16895-1-helgaas@kernel.org Reported-by: Ville Syrjälä Tested-by: Ville Syrjälä Signed-off-by: Bjorn Helgaas Cc: stable@vger.kernel.org # v5.13+ Cc: Huacai Chen Cc: Jiaxun Yang Cc: Thomas Bogendoerfer Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: Krzysztof Wilczyński commit 37c2c83ca4f1ef4b6908181ac98e18360af89b42 Author: Xin Xiong Date: Tue Jan 25 18:12:15 2022 +0800 spi: uniphier: fix reference count leak in uniphier_spi_probe() The issue happens in several error paths in uniphier_spi_probe(). When either dma_get_slave_caps() or devm_spi_register_master() returns an error code, the function forgets to decrease the refcount of both `dma_rx` and `dma_tx` objects, which may lead to refcount leaks. Fix it by decrementing the reference count of specific objects in those error paths. Signed-off-by: Xin Xiong Signed-off-by: Xiyu Yang Signed-off-by: Xin Tan Reviewed-by: Kunihiko Hayashi Fixes: 28d1dddc59f6 ("spi: uniphier: Add DMA transfer mode support") Link: https://lore.kernel.org/r/20220125101214.35677-1-xiongx18@fudan.edu.cn Signed-off-by: Mark Brown commit 2f6513284347432d137ce54e30baae2aa5d5f55c Merge: 8199d0c6ad95a 77bdaf39f3c8a Author: David S. Miller Date: Wed Jan 26 15:45:49 2022 +0000 Merge branch 'lan966x-fixes' Horatiu Vultur says: ==================== net: lan966x: Fixes for sleep in atomic context This patch series contains 2 fixes for lan966x that is sleeping in atomic context. The first patch fixes the injection of the frames while the second one fixes the updating of the MAC table. v1->v2: - correct the fix tag in the second patch, it was using the wrong sha. ==================== Signed-off-by: David S. Miller commit 77bdaf39f3c8a10892bace06ed60bd063b731529 Author: Horatiu Vultur Date: Tue Jan 25 12:48:16 2022 +0100 net: lan966x: Fix sleep in atomic context when updating MAC table The function lan966x_mac_wait_for_completion is used to poll the status of the MAC table using the function readx_poll_timeout. The problem with this function is that is called also from atomic context. Therefore update the function to use readx_poll_timeout_atomic. Fixes: e18aba8941b40b ("net: lan966x: add mactable support") Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit b6ab149654ef1fada0b37b379c04c475c2fdc675 Author: Horatiu Vultur Date: Tue Jan 25 12:48:15 2022 +0100 net: lan966x: Fix sleep in atomic context when injecting frames On lan966x, when injecting a frame it was polling the register QS_INJ_STATUS to see if it can continue with the injection of the frame. The problem was that it was using readx_poll_timeout which could sleep in atomic context. This patch fixes this issue by using readx_poll_timeout_atomic. Fixes: d28d6d2e37d10d ("net: lan966x: add port module support") Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 8199d0c6ad95ae0d6ef84c28ab296ee4de46ed76 Merge: 429c3be8a5e26 8eb86fc2f4905 Author: David S. Miller Date: Wed Jan 26 15:40:02 2022 +0000 Merge branch 'dev_addr-const-fixes' Jakub Kicinski says: ==================== ethernet: fix some esoteric drivers after netdev->dev_addr constification Looking at recent fixes for drivers which don't get included with allmodconfig builds I thought it's worth grepping for more instances of: dev->dev_addr\[.*\] = This set contains the fixes. v2: add last 3 patches which fix drivers for the RiscPC ARM platform. Thanks to Arnd Bergmann for explaining how to build test that. ==================== Signed-off-by: David S. Miller commit 8eb86fc2f4905899a4684c1e03555e42556f4d53 Author: Jakub Kicinski Date: Tue Jan 25 16:38:01 2022 -0800 ethernet: seeq/ether3: don't write directly to netdev->dev_addr netdev->dev_addr is const now. Compile tested rpc_defconfig w/ GCC 8.5. Fixes: adeef3e32146 ("net: constify netdev->dev_addr") Signed-off-by: Jakub Kicinski Reviewed-by: Russell King (Oracle) Signed-off-by: David S. Miller commit 5518c5246ba600f52c108474ecea615ef8ff9e25 Author: Jakub Kicinski Date: Tue Jan 25 16:38:00 2022 -0800 ethernet: 8390/etherh: don't write directly to netdev->dev_addr netdev->dev_addr is const now. Compile tested rpc_defconfig w/ GCC 8.5. Fixes: adeef3e32146 ("net: constify netdev->dev_addr") Signed-off-by: Jakub Kicinski Reviewed-by: Russell King (Oracle) Signed-off-by: David S. Miller commit 98ef22bbae788e05109aba16b77deb9f37bfb285 Author: Jakub Kicinski Date: Tue Jan 25 16:37:59 2022 -0800 ethernet: i825xx: don't write directly to netdev->dev_addr netdev->dev_addr is const now. Compile tested rpc_defconfig w/ GCC 8.5. Fixes: adeef3e32146 ("net: constify netdev->dev_addr") Signed-off-by: Jakub Kicinski Reviewed-by: Russell King (Oracle) Signed-off-by: David S. Miller commit 7f6ec2b2f01b45b39cd2ffcd49fdb30d0b6c626d Author: Jakub Kicinski Date: Tue Jan 25 16:37:58 2022 -0800 ethernet: broadcom/sb1250-mac: don't write directly to netdev->dev_addr netdev->dev_addr is const now. Compile tested bigsur_defconfig and sb1250_swarm_defconfig. Fixes: adeef3e32146 ("net: constify netdev->dev_addr") Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 14ba66a60fbfbe69bb7faf6b45e9803c2efd7a23 Author: Jakub Kicinski Date: Tue Jan 25 16:37:57 2022 -0800 ethernet: tundra: don't write directly to netdev->dev_addr netdev->dev_addr is const now. Maintain the questionable offsetting in ndo_set_mac_address. Compile tested holly_defconfig and mpc7448_hpc2_defconfig. Fixes: adeef3e32146 ("net: constify netdev->dev_addr") Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 007c95120d1b054fb637dff24636a307a4889016 Author: Jakub Kicinski Date: Tue Jan 25 16:37:56 2022 -0800 ethernet: 3com/typhoon: don't write directly to netdev->dev_addr This driver casts off the const and writes directly to netdev->dev_addr. This will result in a MAC address tree corruption and a warning. Compile tested ppc6xx_defconfig. Fixes: adeef3e32146 ("net: constify netdev->dev_addr") Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 549f8ffc7b2f7561bea7f90930b6c5104318e87b Author: Takashi Iwai Date: Wed Jan 26 15:50:11 2022 +0100 ALSA: hda: Fix UAF of leds class devs at unbinding The LED class devices that are created by HD-audio codec drivers are registered via devm_led_classdev_register() and associated with the HD-audio codec device. Unfortunately, it turned out that the devres release doesn't work for this case; namely, since the codec resource release happens before the devm call chain, it triggers a NULL dereference or a UAF for a stale set_brightness_delay callback. For fixing the bug, this patch changes the LED class device register and unregister in a manual manner without devres, keeping the instances in hda_gen_spec. Reported-by: Alexander Sergeyev Cc: Link: https://lore.kernel.org/r/20220111195229.a77wrpjclqwrx4bx@localhost.localdomain Link: https://lore.kernel.org/r/20220126145011.16728-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 7fde14d705985dd933a3d916d39daa72b1668098 Author: Tong Zhang Date: Sun Jan 23 01:10:04 2022 -0800 drm/privacy-screen: honor acpi=off in detect_thinkpad_privacy_screen when acpi=off is provided in bootarg, kernel crash with [ 1.252739] BUG: kernel NULL pointer dereference, address: 0000000000000018 [ 1.258308] Call Trace: [ 1.258490] ? acpi_walk_namespace+0x147/0x147 [ 1.258770] acpi_get_devices+0xe4/0x137 [ 1.258921] ? drm_core_init+0xc0/0xc0 [drm] [ 1.259108] detect_thinkpad_privacy_screen+0x5e/0xa8 [drm] [ 1.259337] drm_privacy_screen_lookup_init+0xe/0xe85 [drm] The reason is that acpi_walk_namespace expects acpi related stuff initialized but in fact it wouldn't when acpi is set to off. In this case we should honor acpi=off in detect_thinkpad_privacy_screen(). Signed-off-by: Tong Zhang Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede Link: https://patchwork.freedesktop.org/patch/msgid/20220123091004.763775-1-ztong0001@gmail.com commit c5de60cd622a2607c043ba65e25a6e9998a369f9 Author: Namhyung Kim Date: Mon Jan 24 11:58:08 2022 -0800 perf/core: Fix cgroup event list management The active cgroup events are managed in the per-cpu cgrp_cpuctx_list. This list is only accessed from current cpu and not protected by any locks. But from the commit ef54c1a476ae ("perf: Rework perf_event_exit_event()"), it's possible to access (actually modify) the list from another cpu. In the perf_remove_from_context(), it can remove an event from the context without an IPI when the context is not active. This is not safe with cgroup events which can have some active events in the context even if ctx->is_active is 0 at the moment. The target cpu might be in the middle of list iteration at the same time. If the event is enabled when it's about to be closed, it might call perf_cgroup_event_disable() and list_del() with the cgrp_cpuctx_list on a different cpu. This resulted in a crash due to an invalid list pointer access during the cgroup list traversal on the cpu which the event belongs to. Let's fallback to IPI to access the cgrp_cpuctx_list from that cpu. Similarly, perf_install_in_context() should use IPI for the cgroup events too. Fixes: ef54c1a476ae ("perf: Rework perf_event_exit_event()") Signed-off-by: Namhyung Kim Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220124195808.2252071-1-namhyung@kernel.org commit 961c39121759ad09a89598ec4ccdd34ae0468a19 Author: James Clark Date: Mon Dec 6 11:38:40 2021 +0000 perf: Always wake the parent event When using per-process mode and event inheritance is set to true, forked processes will create a new perf events via inherit_event() -> perf_event_alloc(). But these events will not have ring buffers assigned to them. Any call to wakeup will be dropped if it's called on an event with no ring buffer assigned because that's the object that holds the wakeup list. If the child event is disabled due to a call to perf_aux_output_begin() or perf_aux_output_end(), the wakeup is dropped leaving userspace hanging forever on the poll. Normally the event is explicitly re-enabled by userspace after it wakes up to read the aux data, but in this case it does not get woken up so the event remains disabled. This can be reproduced when using Arm SPE and 'stress' which forks once before running the workload. By looking at the list of aux buffers read, it's apparent that they stop after the fork: perf record -e arm_spe// -vvv -- stress -c 1 With this patch applied they continue to be printed. This behaviour doesn't happen when using systemwide or per-cpu mode. Reported-by: Ruben Ayrapetyan Signed-off-by: James Clark Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20211206113840.130802-2-james.clark@arm.com commit 2dd8a74fddd21b95dcc60a2d3c9eaec993419d69 Author: Lukas Wunner Date: Sun Jan 23 05:21:14 2022 +0100 serial: core: Initialize rs485 RTS polarity already on probe RTS polarity of rs485-enabled ports is currently initialized on uart open via: tty_port_open() tty_port_block_til_ready() tty_port_raise_dtr_rts() # if (C_BAUD(tty)) uart_dtr_rts() uart_port_dtr_rts() There's at least three problems here: First, if no baud rate is set, RTS polarity is not initialized. That's the right thing to do for rs232, but not for rs485, which requires that RTS is deasserted unconditionally. Second, if the DeviceTree property "linux,rs485-enabled-at-boot-time" is present, RTS should be deasserted as early as possible, i.e. on probe. Otherwise it may remain asserted until first open. Third, even though RTS is deasserted on open and close, it may subsequently be asserted by uart_throttle(), uart_unthrottle() or uart_set_termios() because those functions aren't rs485-aware. (Only uart_tiocmset() is.) To address these issues, move RTS initialization from uart_port_dtr_rts() to uart_configure_port(). Prevent subsequent modification of RTS polarity by moving the existing rs485 check from uart_tiocmget() to uart_update_mctrl(). That way, RTS is initialized on probe and then remains unmodified unless the uart transmits data. If rs485 is enabled at runtime (instead of at boot) through a TIOCSRS485 ioctl(), RTS is initialized by the uart driver's ->rs485_config() callback and then likewise remains unmodified. The PL011 driver initializes RTS on uart open and prevents subsequent modification in its ->set_mctrl() callback. That code is obsoleted by the present commit, so drop it. Cc: Jan Kiszka Cc: Su Bao Cheng Signed-off-by: Lukas Wunner Link: https://lore.kernel.org/r/2d2acaf3a69e89b7bf687c912022b11fd29dfa1e.1642909284.git.lukas@wunner.de Signed-off-by: Greg Kroah-Hartman commit 62f676ff7898f6c1bd26ce014564773a3dc00601 Author: Jochen Mades Date: Sat Jan 23 05:10:14 2021 +0100 serial: pl011: Fix incorrect rs485 RTS polarity on set_mctrl Commit 8d479237727c ("serial: amba-pl011: add RS485 support") sought to keep RTS deasserted on set_mctrl if rs485 is enabled. However it did so only if deasserted RTS polarity is high. Fix it in case it's low. Fixes: 8d479237727c ("serial: amba-pl011: add RS485 support") Cc: stable@vger.kernel.org # v5.15+ Cc: Lino Sanfilippo Signed-off-by: Jochen Mades [lukas: copyedit commit message, add stable designation] Signed-off-by: Lukas Wunner Link: https://lore.kernel.org/r/85fa3323ba8c307943969b7343e23f34c3e652ba.1642909284.git.lukas@wunner.de Signed-off-by: Greg Kroah-Hartman commit 037b91ec7729524107982e36ec4b40f9b174f7a2 Author: Valentin Caron Date: Tue Jan 11 17:44:41 2022 +0100 serial: stm32: fix software flow control transfer x_char is ignored by stm32_usart_start_tx() when xmit buffer is empty. Fix start_tx condition to allow x_char to be sent. Fixes: 48a6092fb41f ("serial: stm32-usart: Add STM32 USART Driver") Cc: stable Signed-off-by: Erwan Le Ray Signed-off-by: Valentin Caron Link: https://lore.kernel.org/r/20220111164441.6178-3-valentin.caron@foss.st.com Signed-off-by: Greg Kroah-Hartman commit d3d079bde07e1b7deaeb57506dc0b86010121d17 Author: Valentin Caron Date: Tue Jan 11 17:44:40 2022 +0100 serial: stm32: prevent TDR register overwrite when sending x_char When sending x_char in stm32_usart_transmit_chars(), driver can overwrite the value of TDR register by the value of x_char. If this happens, the previous value that was present in TDR register will not be sent through uart. This code checks if the previous value in TDR register is sent before writing the x_char value into register. Fixes: 48a6092fb41f ("serial: stm32-usart: Add STM32 USART Driver") Cc: stable Signed-off-by: Valentin Caron Link: https://lore.kernel.org/r/20220111164441.6178-2-valentin.caron@foss.st.com Signed-off-by: Greg Kroah-Hartman commit 8838b2af23caf1ff0610caef2795d6668a013b2d Author: daniel.starke@siemens.com Date: Thu Jan 20 02:18:57 2022 -0800 tty: n_gsm: fix SW flow control encoding/handling n_gsm is based on the 3GPP 07.010 and its newer version is the 3GPP 27.010. See https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=1516 The changes from 07.010 to 27.010 are non-functional. Therefore, I refer to the newer 27.010 here. Chapter 5.2.7.3 states that DC1 (XON) and DC3 (XOFF) are the control characters defined in ISO/IEC 646. These shall be quoted if seen in the data stream to avoid interpretation as flow control characters. ISO/IEC 646 refers to the set of ISO standards described as the ISO 7-bit coded character set for information interchange. Its final version is also known as ITU T.50. See https://www.itu.int/rec/T-REC-T.50-199209-I/en To abide the standard it is needed to quote DC1 and DC3 correctly if these are seen as data bytes and not as control characters. The current implementation already tries to enforce this but fails to catch all defined cases. 3GPP 27.010 chapter 5.2.7.3 clearly states that the most significant bit shall be ignored for DC1 and DC3 handling. The current implementation handles only the case with the most significant bit set 0. Cases in which DC1 and DC3 have the most significant bit set 1 are left unhandled. This patch fixes this by masking the data bytes with ISO_IEC_646_MASK (only the 7 least significant bits set 1) before comparing them with XON (a.k.a. DC1) and XOFF (a.k.a. DC3) when testing which byte values need quotation via byte stuffing. Fixes: e1eaea46bb40 ("tty: n_gsm line discipline") Cc: stable@vger.kernel.org Signed-off-by: Daniel Starke Link: https://lore.kernel.org/r/20220120101857.2509-1-daniel.starke@siemens.com Signed-off-by: Greg Kroah-Hartman commit d06b1cf28297e27127d3da54753a3a01a2fa2f28 Author: Robert Hancock Date: Wed Jan 12 13:42:14 2022 -0600 serial: 8250: of: Fix mapped region size when using reg-offset property 8250_of supports a reg-offset property which is intended to handle cases where the device registers start at an offset inside the region of memory allocated to the device. The Xilinx 16550 UART, for which this support was initially added, requires this. However, the code did not adjust the overall size of the mapped region accordingly, causing the driver to request an area of memory past the end of the device's allocation. For example, if the UART was allocated an address of 0xb0130000, size of 0x10000 and reg-offset of 0x1000 in the device tree, the region of memory reserved was b0131000-b0140fff, which caused the driver for the region starting at b0140000 to fail to probe. Fix this by subtracting reg-offset from the mapped region size. Fixes: b912b5e2cfb3 ([POWERPC] Xilinx: of_serial support for Xilinx uart 16550.) Cc: stable Signed-off-by: Robert Hancock Link: https://lore.kernel.org/r/20220112194214.881844-1-robert.hancock@calian.com Signed-off-by: Greg Kroah-Hartman commit db7f19c0aa0abcb751ff0ed694a071363f702b1d Author: Arnaud Pouliquen Date: Tue Jan 4 17:35:45 2022 +0100 tty: rpmsg: Fix race condition releasing tty port The tty_port struct is part of the rpmsg_tty_port structure. The issue is that the rpmsg_tty_port structure is freed on rpmsg_tty_remove while it is still referenced in the tty_struct. Its release is not predictable due to workqueues. For instance following ftrace shows that rpmsg_tty_close is called after rpmsg_tty_release_cport: nr_test.sh-389 [000] ..... 212.093752: rpmsg_tty_remove <-rpmsg_dev_ remove cat-1191 [001] ..... 212.095697: tty_release <-__fput nr_test.sh-389 [000] ..... 212.099166: rpmsg_tty_release_cport <-rpm sg_tty_remove cat-1191 [001] ..... 212.115352: rpmsg_tty_close <-tty_release cat-1191 [001] ..... 212.115371: release_tty <-tty_release_str As consequence, the port must be free only when user has released the TTY interface. This path : - Introduce the .destruct port tty ops function to release the allocated rpmsg_tty_port structure. - Introduce the .hangup tty ops function to call tty_port_hangup. - Manages the tty port refcounting to trig the .destruct port ops, - Introduces the rpmsg_tty_cleanup function to ensure that the TTY is removed before decreasing the port refcount. Fixes: 7c0408d80579 ("tty: add rpmsg driver") Cc: stable Signed-off-by: Arnaud Pouliquen Link: https://lore.kernel.org/r/20220104163545.34710-1-arnaud.pouliquen@foss.st.com Signed-off-by: Greg Kroah-Hartman commit f23653fe64479d96910bfda2b700b1af17c991ac Author: Maciej W. Rozycki Date: Wed Jan 26 09:22:54 2022 +0000 tty: Partially revert the removal of the Cyclades public API Fix a user API regression introduced with commit f76edd8f7ce0 ("tty: cyclades, remove this orphan"), which removed a part of the API and caused compilation errors for user programs using said part, such as GCC 9 in its libsanitizer component[1]: .../libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc:160:10: fatal error: linux/cyclades.h: No such file or directory 160 | #include | ^~~~~~~~~~~~~~~~~~ compilation terminated. make[4]: *** [Makefile:664: sanitizer_platform_limits_posix.lo] Error 1 As the absolute minimum required bring `struct cyclades_monitor' and ioctl numbers back then so as to make the library build again. Add a preprocessor warning as to the obsolescence of the features provided. References: [1] GCC PR sanitizer/100379, "cyclades.h is removed from linux kernel header files", Fixes: f76edd8f7ce0 ("tty: cyclades, remove this orphan") Cc: stable@vger.kernel.org # v5.13+ Reviewed-by: Christoph Hellwig Signed-off-by: Maciej W. Rozycki Link: https://lore.kernel.org/r/alpine.DEB.2.20.2201260733430.11348@tpp.orcam.me.uk Signed-off-by: Greg Kroah-Hartman commit 152d1afa834c84530828ee031cf07a00e0fc0b8c Author: Cameron Williams Date: Mon Jan 24 09:42:23 2022 +0000 tty: Add support for Brainboxes UC cards. This commit adds support for the some of the Brainboxes PCI range of cards, including the UC-101, UC-235/246, UC-257, UC-268, UC-275/279, UC-302, UC-310, UC-313, UC-320/324, UC-346, UC-357, UC-368 and UC-420/431. Signed-off-by: Cameron Williams Cc: stable Link: https://lore.kernel.org/r/AM5PR0202MB2564688493F7DD9B9C610827C45E9@AM5PR0202MB2564.eurprd02.prod.outlook.com Signed-off-by: Greg Kroah-Hartman commit 592ee1197f78b30bd60c87db9b6c8c045c8d8314 Author: Yu Kuai Date: Wed Jan 26 09:21:32 2022 +0800 blk-mq: fix missing blk_account_io_done() in error path If blk_mq_request_issue_directly() failed from blk_insert_cloned_request(), the request will be accounted start. Currently, blk_insert_cloned_request() is only called by dm, and such request won't be accounted done by dm. In normal path, io will be accounted start from blk_mq_bio_to_request(), when the request is allocated, and such io will be accounted done from __blk_mq_end_request_acct() whether it succeeded or failed. Thus add blk_account_io_done() to fix the problem. Signed-off-by: Yu Kuai Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220126012132.3111551-1-yukuai3@huawei.com Signed-off-by: Jens Axboe commit 6a7b9f002eca6788d346c16a6ff0c218b41f8d1d Author: Greg Kroah-Hartman Date: Wed Jan 26 14:33:58 2022 +0100 Revert "tty: serial: Use fifo in 8250 console driver" This reverts commit 5021d709b31b8a14317998a33cbc78be0de9ab30. The patch is still a bit buggy, and this breaks some other hardware types. It needs to be resubmitted in a non-buggy way, and make sure the other hardware types also continue to work properly. Fixes: 5021d709b31b ("tty: serial: Use fifo in 8250 console driver") Reported-by: Sebastian Andrzej Siewior Reported-by: Jon Hunter Link: https://lore.kernel.org/r/Ye/1+Z8mEzbKbrqG@linutronix.de Link: https://lore.kernel.org/r/a1ac6254-f79e-d131-fa2a-c7ad714c6d4a@nvidia.com Cc: Wander Lairson Costa Cc: Andy Shevchenko Cc: Jiri Slaby Signed-off-by: Greg Kroah-Hartman commit e937440f7fc444a3e3f1fb75ea65292d6f433a44 Author: Miaoqian Lin Date: Wed Jan 26 11:04:47 2022 +0000 spi: meson-spicc: add IRQ check in meson_spicc_probe This check misses checking for platform_get_irq()'s call and may 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 invalid IRQ #s. Fixes: 454fa271bc4e ("spi: Add Meson SPICC driver") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220126110447.24549-1-linmq006@gmail.com Signed-off-by: Mark Brown commit 8f2e5c65ec7534cce6d315fccf2c3aef023f68f0 Author: Srinivas Kandagatla Date: Wed Jan 26 11:35:49 2022 +0000 ASoC: qdsp6: q6apm-dai: only stop graphs that are started Its possible that the sound card is just opened and closed without actually playing stream, ex: if the audio file itself is missing. Even in such cases we do call stop on graphs that are not yet started. DSP can throw errors in such cases, so add a check to see if the graph was started before stopping it. Fixes: 9b4fe0f1cd79 ("ASoC: qdsp6: audioreach: add q6apm-dai support") Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220126113549.8853-5-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit bd2347fd67d8da0fa76296507cc556da0a233bcb Author: Srinivas Kandagatla Date: Wed Jan 26 11:35:48 2022 +0000 ASoC: codecs: wcd938x: fix return value of mixer put function wcd938x_ear_pa_put_gain, wcd938x_set_swr_port and wcd938x_set_compander currently returns zero eventhough it changes the value. Fix this, so that change notifications are sent correctly. Fixes: e8ba1e05bdc01 ("ASoC: codecs: wcd938x: add basic controls") Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220126113549.8853-4-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit fca041a3ab70a099a6d5519ecb689b6279bd04f3 Author: Srinivas Kandagatla Date: Wed Jan 26 11:35:47 2022 +0000 ASoC: codecs: lpass-rx-macro: fix sidetone register offsets For some reason we ended up with incorrect register offfset calcuations for sidetone. regmap clearly throw errors when accessing these incorrect registers as these do not belong to any read/write ranges. so fix them to point to correct register offsets. Fixes: f3ce6f3c9a99 ("ASoC: codecs: lpass-rx-macro: add iir widgets") Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220126113549.8853-3-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit c5c1546a654f613e291a7c5d6f3660fc1eb6d0c7 Author: Srinivas Kandagatla Date: Wed Jan 26 11:35:46 2022 +0000 ASoC: codecs: wcd938x: fix incorrect used of portid Mixer controls have the channel id in mixer->reg, which is not same as port id. port id should be derived from chan_info array. So fix this. Without this, its possible that we could corrupt struct wcd938x_sdw_priv by accessing port_map array out of range with channel id instead of port id. Fixes: e8ba1e05bdc0 ("ASoC: codecs: wcd938x: add basic controls") Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220126113549.8853-2-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit 993d66140f8d1c1853a3b58b77b43b681eb64dee Author: Fabio Estevam Date: Sun Dec 19 19:42:15 2021 -0300 ARM: dts: imx6qdl-udoo: Properly describe the SD card detect GPIO7_IO00 is used as SD card detect. Properly describe this in the devicetree. Fixes: 40cdaa542cf0 ("ARM: dts: imx6q-udoo: Add initial board support") Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 79aa3e19fe8f5be30e846df8a436bfe306e8b1a6 Author: Pawel Laszczak Date: Tue Jan 11 10:07:37 2022 +0100 usb: cdnsp: Fix segmentation fault in cdns_lost_power function CDNSP driver read not initialized cdns->otg_v0_regs which lead to segmentation fault. Patch fixes this issue. Fixes: 2cf2581cd229 ("usb: cdns3: add power lost support for system resume") cc: Signed-off-by: Pawel Laszczak Link: https://lore.kernel.org/r/20220111090737.10345-1-pawell@gli-login.cadence.com Signed-off-by: Greg Kroah-Hartman commit 23e3404de1aecc62c14ac96d4b63403c3e0f52d5 Author: Kunihiko Hayashi Date: Wed Dec 22 13:48:12 2021 +0900 spi: uniphier: Fix a bug that doesn't point to private data correctly In uniphier_spi_remove(), there is a wrong code to get private data from the platform device, so the driver can't be removed properly. The driver should get spi_master from the platform device and retrieve the private data from it. Cc: Fixes: 5ba155a4d4cc ("spi: add SPI controller driver for UniPhier SoC") Signed-off-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/1640148492-32178-1-git-send-email-hayashi.kunihiko@socionext.com Signed-off-by: Mark Brown commit 90cafce461de108bfb07c06148395dc86c3fcd23 Author: Dongliang Mu Date: Mon Dec 6 18:19:31 2021 +0800 spi: change clk_disable_unprepare to clk_unprepare The corresponding API for clk_prepare is clk_unprepare, other than clk_disable_unprepare. Fix this by changing clk_disable_unprepare to clk_unprepare. Fixes: 5762ab71eb24 ("spi: Add support for Armada 3700 SPI Controller") Signed-off-by: Dongliang Mu Link: https://lore.kernel.org/r/20211206101931.2816597-1-mudongliangabcd@gmail.com Signed-off-by: Mark Brown commit ac55d163855924aa5af9f1560977da8f346963c8 Author: Amelie Delaunay Date: Tue Dec 7 14:01:01 2021 +0100 usb: dwc2: gadget: don't try to disable ep0 in dwc2_hsotg_suspend Calling dwc2_hsotg_ep_disable on ep0 (in/out) will lead to the following logs before returning -EINVAL: dwc2 49000000.usb-otg: dwc2_hsotg_ep_disable: called for ep0 dwc2 49000000.usb-otg: dwc2_hsotg_ep_disable: called for ep0 To avoid these two logs while suspending, start disabling the endpoint from the index 1, as done in dwc2_hsotg_udc_stop: /* all endpoints should be shutdown */ for (ep = 1; ep < hsotg->num_of_eps; ep++) { if (hsotg->eps_in[ep]) dwc2_hsotg_ep_disable_lock(&hsotg->eps_in[ep]->ep); if (hsotg->eps_out[ep]) dwc2_hsotg_ep_disable_lock(&hsotg->eps_out[ep]->ep); } Acked-by: Minas Harutyunyan Signed-off-by: Amelie Delaunay Link: https://lore.kernel.org/r/20211207130101.270314-1-amelie.delaunay@foss.st.com Signed-off-by: Greg Kroah-Hartman commit 26d81b29249273d39e753cc0c7b0ca62c6a6283f Author: Miles Chen Date: Wed Jan 19 10:08:49 2022 +0800 usb: gadget: at91_udc: fix incorrect print type Fix a build error observed with ARCH=arm DEFCONFIG=allmodconfig build. drivers/usb/gadget/udc/at91_udc.h:174:42: error: format '%d' expects argument of type 'int', but argument 3 has type 'struct gpio_desc *' [-Werror=format=] Fixes: 4a555f2b8d31 ("usb: gadget: at91_udc: Convert to GPIO descriptors") Reviewed-by: Macpaul Lin Signed-off-by: Miles Chen Link: https://lore.kernel.org/r/20220119020849.25732-1-miles.chen@mediatek.com Signed-off-by: Greg Kroah-Hartman commit 2cc9b1c93b1c4caa2d971856c0780fb5f7d04692 Author: Robert Hancock Date: Tue Jan 25 18:02:51 2022 -0600 usb: dwc3: xilinx: Fix error handling when getting USB3 PHY The code that looked up the USB3 PHY was ignoring all errors other than EPROBE_DEFER in an attempt to handle the PHY not being present. Fix and simplify the code by using devm_phy_optional_get and dev_err_probe so that a missing PHY is not treated as an error and unexpected errors are handled properly. Fixes: 84770f028fab ("usb: dwc3: Add driver for Xilinx platforms") Cc: stable Signed-off-by: Robert Hancock Link: https://lore.kernel.org/r/20220126000253.1586760-3-robert.hancock@calian.com Signed-off-by: Greg Kroah-Hartman commit 9678f3361afc27a3124cd2824aec0227739986fb Author: Robert Hancock Date: Tue Jan 25 18:02:50 2022 -0600 usb: dwc3: xilinx: Skip resets and USB3 register settings for USB2.0 mode It appears that the PIPE clock should not be selected when only USB 2.0 is being used in the design and no USB 3.0 reference clock is used. Also, the core resets are not required if a USB3 PHY is not in use, and will break things if USB3 is actually used but the PHY entry is not listed in the device tree. Skip core resets and register settings that are only required for USB3 mode when no USB3 PHY is specified in the device tree. Fixes: 84770f028fab ("usb: dwc3: Add driver for Xilinx platforms") Cc: stable Signed-off-by: Robert Hancock Link: https://lore.kernel.org/r/20220126000253.1586760-2-robert.hancock@calian.com Signed-off-by: Greg Kroah-Hartman commit 9df478463d9feb90dae24f183383961cf123a0ec Author: Frank Li Date: Mon Jan 10 11:27:38 2022 -0600 usb: xhci-plat: fix crash when suspend if remote wake enable Crashed at i.mx8qm platform when suspend if enable remote wakeup Internal error: synchronous external abort: 96000210 [#1] PREEMPT SMP Modules linked in: CPU: 2 PID: 244 Comm: kworker/u12:6 Not tainted 5.15.5-dirty #12 Hardware name: Freescale i.MX8QM MEK (DT) Workqueue: events_unbound async_run_entry_fn pstate: 600000c5 (nZCv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : xhci_disable_hub_port_wake.isra.62+0x60/0xf8 lr : xhci_disable_hub_port_wake.isra.62+0x34/0xf8 sp : ffff80001394bbf0 x29: ffff80001394bbf0 x28: 0000000000000000 x27: ffff00081193b578 x26: ffff00081193b570 x25: 0000000000000000 x24: 0000000000000000 x23: ffff00081193a29c x22: 0000000000020001 x21: 0000000000000001 x20: 0000000000000000 x19: ffff800014e90490 x18: 0000000000000000 x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000 x14: 0000000000000000 x13: 0000000000000002 x12: 0000000000000000 x11: 0000000000000000 x10: 0000000000000960 x9 : ffff80001394baa0 x8 : ffff0008145d1780 x7 : ffff0008f95b8e80 x6 : 000000001853b453 x5 : 0000000000000496 x4 : 0000000000000000 x3 : ffff00081193a29c x2 : 0000000000000001 x1 : 0000000000000000 x0 : ffff000814591620 Call trace: xhci_disable_hub_port_wake.isra.62+0x60/0xf8 xhci_suspend+0x58/0x510 xhci_plat_suspend+0x50/0x78 platform_pm_suspend+0x2c/0x78 dpm_run_callback.isra.25+0x50/0xe8 __device_suspend+0x108/0x3c0 The basic flow: 1. run time suspend call xhci_suspend, xhci parent devices gate the clock. 2. echo mem >/sys/power/state, system _device_suspend call xhci_suspend 3. xhci_suspend call xhci_disable_hub_port_wake, which access register, but clock already gated by run time suspend. This problem was hidden by power domain driver, which call run time resume before it. But the below commit remove it and make this issue happen. commit c1df456d0f06e ("PM: domains: Don't runtime resume devices at genpd_prepare()") This patch call run time resume before suspend to make sure clock is on before access register. Reviewed-by: Peter Chen Cc: stable Signed-off-by: Frank Li Testeb-by: Abel Vesa Link: https://lore.kernel.org/r/20220110172738.31686-1-Frank.Li@nxp.com Signed-off-by: Greg Kroah-Hartman commit 2e3dd4a6246945bf84ea6f478365d116e661554c Author: Jon Hunter Date: Mon Jan 17 15:00:39 2022 +0000 usb: common: ulpi: Fix crash in ulpi_match() Commit 7495af930835 ("ARM: multi_v7_defconfig: Enable drivers for DragonBoard 410c") enables the CONFIG_PHY_QCOM_USB_HS for the ARM multi_v7_defconfig. Enabling this Kconfig is causing the kernel to crash on the Tegra20 Ventana platform in the ulpi_match() function. The Qualcomm USB HS PHY driver that is enabled by CONFIG_PHY_QCOM_USB_HS, registers a ulpi_driver but this driver does not provide an 'id_table', so when ulpi_match() is called on the Tegra20 Ventana platform, it crashes when attempting to deference the id_table pointer which is not valid. The Qualcomm USB HS PHY driver uses device-tree for matching the ULPI driver with the device and so fix this crash by using device-tree for matching if the id_table is not valid. Fixes: ef6a7bcfb01c ("usb: ulpi: Support device discovery via DT") Cc: stable Signed-off-by: Jon Hunter Link: https://lore.kernel.org/r/20220117150039.44058-1-jonathanh@nvidia.com Signed-off-by: Greg Kroah-Hartman commit 904edf8aeb459697129be5fde847e2a502f41fd9 Author: Pavankumar Kondeti Date: Sat Jan 22 08:33:22 2022 +0530 usb: gadget: f_sourcesink: Fix isoc transfer for USB_SPEED_SUPER_PLUS Currently when gadget enumerates in super speed plus, the isoc endpoint request buffer size is not calculated correctly. Fix this by checking the gadget speed against USB_SPEED_SUPER_PLUS and update the request buffer size. Fixes: 90c4d05780d4 ("usb: fix various gadgets null ptr deref on 10gbps cabling.") Cc: stable Signed-off-by: Pavankumar Kondeti Link: https://lore.kernel.org/r/1642820602-20619-1-git-send-email-quic_pkondeti@quicinc.com Signed-off-by: Greg Kroah-Hartman commit 825911492eb15bf8bb7fb94bc0c0421fe7a6327d Author: Sing-Han Chen Date: Wed Jan 12 17:41:43 2022 +0800 ucsi_ccg: Check DEV_INT bit only when starting CCG4 CCGx clears Bit 0:Device Interrupt in the INTR_REG if CCGx is reset successfully. However, there might be a chance that other bits in INTR_REG are not cleared due to internal data queued in PPM. This case misleads the driver that CCGx reset failed. The commit checks bit 0 in INTR_REG and ignores other bits. The ucsi driver would reset PPM later. Fixes: 247c554a14aa ("usb: typec: ucsi: add support for Cypress CCGx") Cc: stable@vger.kernel.org Reviewed-by: Heikki Krogerus Signed-off-by: Sing-Han Chen Signed-off-by: Wayne Chang Link: https://lore.kernel.org/r/20220112094143.628610-1-waynec@nvidia.com Signed-off-by: Greg Kroah-Hartman commit 0c566618e27f17b5807086dba8c222ca8ca3dc1e Author: Tim Harvey Date: Thu Dec 16 08:12:27 2021 -0800 arm64: dts: imx8mn-venice-gw7902: disable gpu Since commit 99aa29932271 ("arm64: dts: imx8mn: Enable GPU") imx8mn-venice-gw7902 will hang during kernel init because it uses a MIMX8MN5CVTI which does not have a GPU. Disable pgc_gpumix to work around this. We also disable the GPU devices that depend on the gpumix power domain and pgc_gpu to avoid them staying in a probe deferred state forever. Cc: Adam Ford Cc: Lucas Stach Signed-off-by: Tim Harvey Fixes: 99aa29932271 ("arm64: dts: imx8mn: Enable GPU") Reviewed-by: Adam Ford Signed-off-by: Shawn Guo commit c733ebb7cb67dfb146a07c0ae329a0de9ec52f36 Author: Marc Zyngier Date: Mon Jan 24 13:38:09 2022 +0000 irqchip/gic-v3-its: Reset each ITS's BASERn register before probe A recent bug report outlined that the way GICv4.1 is handled across kexec is pretty bad. We can end-up in a situation where ITSs share memory (this is the case when SVPET==1) and reprogram the base registers, creating a situation where ITSs that are part of a given affinity group see different pointers. Which is illegal. Boo. In order to restore some sanity, reset the BASERn registers to 0 *before* probing any ITS. Although this isn't optimised at all, this is only a once-per-boot cost, which shouldn't show up on anyone's radar. Cc: Jay Chen Signed-off-by: Marc Zyngier Reviewed-by: Lorenzo Pieralisi Link: https://lore.kernel.org/r/20211216190315.GA14220@lpieralisi Link: https://lore.kernel.org/r/20220124133809.1291195-1-maz@kernel.org commit 31eeb6b09f4053f32a30ce9fbcdfca31f713028d Author: Robin Murphy Date: Mon Jan 24 17:57:01 2022 +0000 arm64: dts: juno: Remove GICv2m dma-range Although it is painstakingly honest to describe all 3 PCI windows in "dma-ranges", it misses the the subtle distinction that the window for the GICv2m range is normally programmed for Device memory attributes rather than Normal Cacheable like the DRAM windows. Since MMU-401 only offers stage 2 translation, this means that when the PCI SMMU is enabled, accesses through that IPA range unexpectedly lose coherency if mapped as cacheable at the SMMU, due to the attribute combining rules. Since an extra 256KB is neither here nor there when we still have 10GB worth of usable address space, rather than attempting to describe and cope with this detail let's just remove the offending range. If the SMMU is not used then it makes no difference anyway. Link: https://lore.kernel.org/r/856c3f7192c6c3ce545ba67462f2ce9c86ed6b0c.1643046936.git.robin.murphy@arm.com Fixes: 4ac4d146cb63 ("arm64: dts: juno: Describe PCI dma-ranges") Reported-by: Anders Roxell Acked-by: Liviu Dudau Signed-off-by: Robin Murphy Signed-off-by: Sudeep Holla commit 76cea3d95513fe40000d06a3719c4bb6b53275e2 Author: Dave Airlie Date: Thu Jan 20 14:05:27 2022 +1000 Revert "drm/ast: Support 1600x900 with 108MHz PCLK" This reverts commit 9bb7b689274b67ecb3641e399e76f84adc627df1. This caused a regression reported to Red Hat. Fixes: 9bb7b689274b ("drm/ast: Support 1600x900 with 108MHz PCLK") Signed-off-by: Dave Airlie Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220120040527.552068-1-airlied@gmail.com commit 9161f365c91614e5a3f5c6dcc44c3b1b33bc59c0 Author: Christian Eggers Date: Tue Jan 25 09:16:19 2022 +0100 mtd: rawnand: gpmi: don't leak PM reference in error path If gpmi_nfc_apply_timings() fails, the PM runtime usage counter must be dropped. Reported-by: Pavel Machek Fixes: f53d4c109a66 ("mtd: rawnand: gpmi: Add ERR007117 protection for nfc_apply_timings") Signed-off-by: Christian Eggers Cc: stable@vger.kernel.org Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220125081619.6286-1-ceggers@arri.de commit 48ee4835b73c48590d05a54730dc8037ebd39d3b Merge: 5ec1cebd59300 e783362eb54cd Author: Thomas Zimmermann Date: Wed Jan 26 09:40:24 2022 +0100 Merge drm/drm-fixes into drm-misc-fixes Backmerging drm/drm-fixes into drm-misc-fixes for v5.17-rc1. Signed-off-by: Thomas Zimmermann commit e03c3bba351f99ad932e8f06baa9da1afc418e02 Author: Yan Yan Date: Tue Jan 18 16:00:14 2022 -0800 xfrm: Fix xfrm migrate issues when address family changes xfrm_migrate cannot handle address family change of an xfrm_state. The symptons are the xfrm_state will be migrated to a wrong address, and sending as well as receiving packets wil be broken. This commit fixes it by breaking the original xfrm_state_clone method into two steps so as to update the props.family before running xfrm_init_state. As the result, xfrm_state's inner mode, outer mode, type and IP header length in xfrm_state_migrate can be updated with the new address family. Tested with additions to Android's kernel unit test suite: https://android-review.googlesource.com/c/kernel/tests/+/1885354 Signed-off-by: Yan Yan Signed-off-by: Steffen Klassert commit c1aca3080e382886e2e58e809787441984a2f89b Author: Yan Yan Date: Tue Jan 18 16:00:13 2022 -0800 xfrm: Check if_id in xfrm_migrate This patch enables distinguishing SAs and SPs based on if_id during the xfrm_migrate flow. This ensures support for xfrm interfaces throughout the SA/SP lifecycle. When there are multiple existing SPs with the same direction, the same xfrm_selector and different endpoint addresses, xfrm_migrate might fail with ENODATA. Specifically, the code path for performing xfrm_migrate is: Stage 1: find policy to migrate with xfrm_migrate_policy_find(sel, dir, type, net) Stage 2: find and update state(s) with xfrm_migrate_state_find(mp, net) Stage 3: update endpoint address(es) of template(s) with xfrm_policy_migrate(pol, m, num_migrate) Currently "Stage 1" always returns the first xfrm_policy that matches, and "Stage 3" looks for the xfrm_tmpl that matches the old endpoint address. Thus if there are multiple xfrm_policy with same selector, direction, type and net, "Stage 1" might rertun a wrong xfrm_policy and "Stage 3" will fail with ENODATA because it cannot find a xfrm_tmpl with the matching endpoint address. The fix is to allow userspace to pass an if_id and add if_id to the matching rule in Stage 1 and Stage 2 since if_id is a unique ID for xfrm_policy and xfrm_state. For compatibility, if_id will only be checked if the attribute is set. Tested with additions to Android's kernel unit test suite: https://android-review.googlesource.com/c/kernel/tests/+/1668886 Signed-off-by: Yan Yan Signed-off-by: Steffen Klassert commit 429c3be8a5e2695b5b92a6a12361eb89eb185495 Author: Maxim Mikityanskiy Date: Tue Jan 25 12:06:54 2022 +0200 sch_htb: Fail on unsupported parameters when offload is requested The current implementation of HTB offload doesn't support some parameters. Instead of ignoring them, actively return the EINVAL error when they are set to non-defaults. As this patch goes to stable, the driver API is not changed here. If future drivers support more offload parameters, the checks can be moved to the driver side. Note that the buffer and cbuffer parameters are also not supported, but the tc userspace tool assigns some default values derived from rate and ceil, and identifying these defaults in sch_htb would be unreliable, so they are still ignored. Fixes: d03b195b5aa0 ("sch_htb: Hierarchical QoS hardware offload") Reported-by: Jakub Kicinski Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Link: https://lore.kernel.org/r/20220125100654.424570-1-maximmi@nvidia.com Signed-off-by: Jakub Kicinski commit e2bcbd7769ee8f05e1b3d10848aace98973844e4 Author: Sean Young Date: Mon Jan 24 15:30:28 2022 +0000 tools headers UAPI: remove stale lirc.h The lirc.h file is an old copy of lirc.h from the kernel sources. It is out of date, and the bpf lirc tests don't need a new copy anyway. As long as /usr/include/linux/lirc.h is from kernel v5.2 or newer, the tests will compile fine. Signed-off-by: Sean Young Reviewed-by: Shuah Khan Link: https://lore.kernel.org/r/20220124153028.394409-1-sean@mess.org Signed-off-by: Alexei Starovoitov commit 0e3135d3bfa5dfb658145238d2bc723a8e30c3a3 Author: He Fengqing Date: Sat Jan 22 10:29:36 2022 +0000 bpf: Fix possible race in inc_misses_counter It seems inc_misses_counter() suffers from same issue fixed in the commit d979617aa84d ("bpf: Fixes possible race in update_prog_stats() for 32bit arches"): As it can run while interrupts are enabled, it could be re-entered and the u64_stats syncp could be mangled. Fixes: 9ed9e9ba2337 ("bpf: Count the number of times recursion was prevented") Signed-off-by: He Fengqing Acked-by: John Fastabend Link: https://lore.kernel.org/r/20220122102936.1219518-1-hefengqing@huawei.com Signed-off-by: Alexei Starovoitov commit c035366d9c9fe48d947ee6c43465ab43d42e20f2 Author: Sergio Paracuellos Date: Mon Jan 24 12:30:03 2022 +0100 PCI: mt7621: Remove unused function pcie_rmw() Function pcie_rmw() is not being used at all and can be deleted. Hence get rid of it, which fixes this warning: drivers/pci/controller/pcie-mt7621.c:112:20: warning: unused function 'pcie_rmw' [-Wunused-function] Fixes: 2bdd5238e756 ("PCI: mt7621: Add MediaTek MT7621 PCIe host controller driver") Link: https://lore.kernel.org/r/20220124113003.406224-3-sergio.paracuellos@gmail.com Link: https://lore.kernel.org/all/202201241754.igtHzgHv-lkp@intel.com/ Reported-by: kernel test robot Signed-off-by: Sergio Paracuellos Signed-off-by: Bjorn Helgaas commit 4b77e4abb32cddb9e666e2ac411b0b0d6b8331dd Author: Sergio Paracuellos Date: Mon Jan 24 12:30:02 2022 +0100 PCI: mt7621: Drop of_match_ptr() to avoid unused variable We have stubs for most OF interfaces even when CONFIG_OF is not set, so we allow building of pcie-mt7621.c in that case for compile testing. When CONFIG_OF is not set, "of_match_ptr(mt7621_pcie_ids)" compiles to NULL, which leaves mt7621_pcie_ids unused: $ make W=1 drivers/pci/controller/pcie-mt7621.c:549:34: warning: unused variable 'mt7621_pcie_ids' [-Wunused-const-variable] Drop of_match_ptr() to avoid the unused variable warning. [bhelgaas: commit log] Fixes: 2bdd5238e756 ("PCI: mt7621: Add MediaTek MT7621 PCIe host controller driver") Link: https://lore.kernel.org/r/20220124113003.406224-2-sergio.paracuellos@gmail.com Link: https://lore.kernel.org/r/202201241754.igtHzgHv-lkp@intel.com Reported-by: kernel test robot Signed-off-by: Sergio Paracuellos Signed-off-by: Bjorn Helgaas commit 2a807341ed1074ab83638f2fab08dffaa373f6b8 Author: Bas Nieuwenhuizen Date: Sun Jan 23 03:38:28 2022 +0100 drm/amdgpu/display: Remove t_srx_delay_us. Unused. Convert the divisions into asserts on the divisor, to debug why it is zero. The divide by zero is suspected of causing kernel panics. While I have no idea where the zero is coming from I think this patch is a positive either way. Cc: stable@vger.kernel.org Reviewed-by: Harry Wentland Signed-off-by: Bas Nieuwenhuizen Signed-off-by: Alex Deucher commit 25f1488bdbba63415239ff301fe61a8546140d9f Author: Bas Nieuwenhuizen Date: Mon Jan 24 01:23:36 2022 +0100 drm/amd/display: Wrap dcn301_calculate_wm_and_dlg for FPU. Mirrors the logic for dcn30. Cue lots of WARNs and some kernel panics without this fix. Cc: stable@vger.kernel.org Signed-off-by: Bas Nieuwenhuizen Signed-off-by: Alex Deucher commit 72a8d87b87270bff0c0b2fed4d59c48d0dd840d7 Author: Bas Nieuwenhuizen Date: Mon Jan 24 01:23:35 2022 +0100 drm/amd/display: Fix FP start/end for dcn30_internal_validate_bw. It calls populate_dml_pipes which uses doubles to initialize the scale_ratio_depth params. Mirrors the dcn20 logic. Cc: stable@vger.kernel.org Signed-off-by: Bas Nieuwenhuizen Signed-off-by: Alex Deucher commit ebc77bcc6e1660a011483c035d53c461c8dcc4f5 Author: Zhou Qingyang Date: Tue Jan 25 00:55:51 2022 +0800 drm/amd/display/dc/calcs/dce_calcs: Fix a memleak in calculate_bandwidth() In calculate_bandwidth(), the tag free_sclk and free_yclk are reversed, which could lead to a memory leak of yclk. Fix this bug by changing the location of free_sclk and free_yclk. This bug was found by a static analyzer. Builds with 'make allyesconfig' show no new warnings, and our static analyzer no longer warns about this code. Fixes: 2be8989d0fc2 ("drm/amd/display/dc/calcs/dce_calcs: Move some large variables from the stack to the heap") Signed-off-by: Zhou Qingyang Signed-off-by: Alex Deucher commit 98fdcacb45f7cd2092151d6af2e60152811eb79c Author: Alex Deucher Date: Thu Jan 20 12:57:33 2022 -0500 drm/amdgpu/display: use msleep rather than udelay for long delays Some architectures (e.g., ARM) throw an compilation error if the udelay is too long. In general udelays of longer than 2000us are not recommended on any architecture. Switch to msleep in these cases. Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit dc919d670c6fd1ac81ebf31625cd19579f7b3d4c Author: Alex Deucher Date: Thu Jan 20 12:52:13 2022 -0500 drm/amdgpu/display: adjust msleep limit in dp_wait_for_training_aux_rd_interval Some architectures (e.g., ARM) have relatively low udelay limits. On most architectures, anything longer than 2000us is not recommended. Change the check to align with other similar checks in DC. Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 9e5a14bce2402e84251a10269df0235cd7ce9234 Author: Alex Deucher Date: Thu Jan 20 12:17:07 2022 -0500 drm/amdgpu: filter out radeon secondary ids as well Older radeon boards (r2xx-r5xx) had secondary PCI functions which we solely there for supporting multi-head on OSs with special requirements. Add them to the unsupported list as well so we don't attempt to bind to them. The driver would fail to bind to them anyway, but this does so in a cleaner way that should not confuse the user. Cc: stable@vger.kernel.org Acked-by: Christian König Signed-off-by: Alex Deucher commit 7e38ac562b820915faa33a5077ca9bccf42d39d2 Author: Zhan Liu Date: Wed Jan 19 17:07:53 2022 -0500 drm/amd/display: change FIFO reset condition to embedded display only [Why] FIFO reset is only necessary for fast boot sequence, where otg is disabled and dig fe is enabled when changing dispclk. Fast boot is only enabled on embedded displays. [How] Change FIFO reset condition to "embedded display only". Signed-off-by: Zhan Liu Reviewed-by: Charlene Liu Signed-off-by: Alex Deucher commit ac46d93235074a6c5d280d35771c23fd8620e7d9 Author: Zhan Liu Date: Wed Jan 19 16:55:16 2022 -0500 drm/amd/display: Correct MPC split policy for DCN301 [Why] DCN301 has seamless boot enabled. With MPC split enabled at the same time, system will hang. [How] Revert MPC split policy back to "MPC_SPLIT_AVOID". Since we have ODM combine enabled on DCN301, pipe split is not necessary here. Signed-off-by: Zhan Liu Reviewed-by: Charlene Liu Signed-off-by: Alex Deucher commit 5f0c749158158f89eba7647bdc4e8096979de981 Author: Meenakshikumar Somasundaram Date: Mon Nov 15 01:51:37 2021 -0500 drm/amd/display: Fix for otg synchronization logic [Why] During otg sync trigger, plane states are used to decide whether the otg is already synchronized or not. There are scenarions when otgs are disabled without plane state getting disabled and in such case the otg is excluded from synchronization. [How] Introduced pipe_idx_syncd in pipe_ctx that tracks each otgs master pipe. When a otg is disabled/enabled, pipe_idx_syncd is reset to itself. On sync trigger, pipe_idx_syncd is checked to decide whether a otg is already synchronized and the otg is further included or excluded from synchronization. v2: Don't drop is_blanked logic Reviewed-by: Jun Lei Reviewed-by: Mustapha Ghaddar Acked-by: Bhawanpreet Lakha Signed-off-by: meenakshikumar somasundaram Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Signed-off-by: Harry Wentland Cc: torvalds@linux-foundation.org Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 809232619f5b15e31fb3563985e705454f32621f Author: Mathieu Desnoyers Date: Mon Jan 17 15:30:10 2022 -0500 sched/membarrier: Fix membarrier-rseq fence command missing from query bitmask The membarrier command MEMBARRIER_CMD_QUERY allows querying the available membarrier commands. When the membarrier-rseq fence commands were added, a new MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ_BITMASK was introduced with the intent to expose them with the MEMBARRIER_CMD_QUERY command, the but it was never added to MEMBARRIER_CMD_BITMASK. The membarrier-rseq fence commands are therefore not wired up with the query command. Rename MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ_BITMASK to MEMBARRIER_PRIVATE_EXPEDITED_RSEQ_BITMASK (the bitmask is not a command per-se), and change the erroneous MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ_BITMASK (which does not actually exist) to MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ. Wire up MEMBARRIER_PRIVATE_EXPEDITED_RSEQ_BITMASK in MEMBARRIER_CMD_BITMASK. Fixing this allows discovering availability of the membarrier-rseq fence feature. Fixes: 2a36ab717e8f ("rseq/membarrier: Add MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ") Signed-off-by: Mathieu Desnoyers Signed-off-by: Peter Zijlstra (Intel) Cc: # 5.10+ Link: https://lkml.kernel.org/r/20220117203010.30129-1-mathieu.desnoyers@efficios.com commit 92d25637a3a45904292c93f1863c6bbda4e3e38f Author: Li Zhijian Date: Fri Dec 17 17:29:55 2021 +0800 kselftest: signal all child processes We have some many cases that will create child process as well, such as pidfd_wait. Previously, we will signal/kill the parent process when it is time out, but this signal will not be sent to its child process. In such case, if child process doesn't terminate itself, ksefltest framework will hang forever. Here we group all its child processes so that kill() can signal all of them in timeout. Fixed change log: Shuah Khan Suggested-by: yang xu Signed-off-by: Li Zhijian Acked-by: Christian Brauner Signed-off-by: Shuah Khan commit 40d70d4d60974c28054a60316f2aec8810833526 Author: Nícolas F. R. A. Prado Date: Fri Jan 14 18:21:26 2022 -0500 selftests: cpufreq: Write test output to stdout as well Use 'tee' to send the test output to stdout in addition to the current output file. This makes the output easier to handle in automated test systems and is superior to only later dumping the output file contents to stdout, since this way the test output can be interleaved with other log messages, like from the kernel, so that chronology is preserved, making it easier to detect issues. Signed-off-by: Nícolas F. R. A. Prado Acked-by: Viresh Kumar Signed-off-by: Shuah Khan commit f034cc1301e7d83d4ec428dd6b8ffb57ca446efb Author: Nícolas F. R. A. Prado Date: Wed Jan 12 14:41:42 2022 -0500 selftests: rtc: Increase test timeout so that all tests run The timeout setting for the rtc kselftest is currently 90 seconds. This setting is used by the kselftest runner to stop running a test if it takes longer than the assigned value. However, two of the test cases inside rtc set alarms. These alarms are set to the next beginning of the minute, so each of these test cases may take up to, in the worst case, 60 seconds. In order to allow for all test cases in rtc to run, even in the worst case, when using the kselftest runner, the timeout value should be increased to at least 120. Set it to 180, so there's some additional slack. Correct operation can be tested by running the following command right after the start of a minute (low second count), and checking that all test cases run: ./run_kselftest.sh -c rtc Signed-off-by: Nícolas F. R. A. Prado Acked-by: Alexandre Belloni Signed-off-by: Shuah Khan commit 235528072f28b3b0a1446279b7eaddda36dbf743 Author: Michał Winiarski Date: Thu Jan 13 00:36:57 2022 +0100 kunit: tool: Import missing importlib.abc Python 3.10.0 contains: 9e09849d20 ("bpo-41006: importlib.util no longer imports typing (GH-20938)") It causes importlib.util to no longer import importlib.abs, which leads to the following error when trying to use kunit with qemu: AttributeError: module 'importlib' has no attribute 'abc'. Did you mean: '_abc'? Add the missing import. Signed-off-by: Michał Winiarski Reviewed-by: Daniel Latypov Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit f26d04331360d42dbd6b58448bd98e4edbfbe1c5 Author: Paul Moore Date: Thu Jan 13 18:54:38 2022 -0500 audit: improve audit queue handling when "audit=1" on cmdline When an admin enables audit at early boot via the "audit=1" kernel command line the audit queue behavior is slightly different; the audit subsystem goes to greater lengths to avoid dropping records, which unfortunately can result in problems when the audit daemon is forcibly stopped for an extended period of time. This patch makes a number of changes designed to improve the audit queuing behavior so that leaving the audit daemon in a stopped state for an extended period does not cause a significant impact to the system. - kauditd_send_queue() is now limited to looping through the passed queue only once per call. This not only prevents the function from looping indefinitely when records are returned to the current queue, it also allows any recovery handling in kauditd_thread() to take place when kauditd_send_queue() returns. - Transient netlink send errors seen as -EAGAIN now cause the record to be returned to the retry queue instead of going to the hold queue. The intention of the hold queue is to store, perhaps for an extended period of time, the events which led up to the audit daemon going offline. The retry queue remains a temporary queue intended to protect against transient issues between the kernel and the audit daemon. - The retry queue is now limited by the audit_backlog_limit setting, the same as the other queues. This allows admins to bound the size of all of the audit queues on the system. - kauditd_rehold_skb() now returns records to the end of the hold queue to ensure ordering is preserved in the face of recent changes to kauditd_send_queue(). Cc: stable@vger.kernel.org Fixes: 5b52330bbfe63 ("audit: fix auditd/kernel connection state tracking") Fixes: f4b3ee3c85551 ("audit: improve robustness of the audit queue handling") Reported-by: Gaosheng Cui Tested-by: Gaosheng Cui Reviewed-by: Richard Guy Briggs Signed-off-by: Paul Moore commit 0280e3c58f92b2fe0e8fbbdf8d386449168de4a8 Merge: 7938d61591d33 aed28b7a2d620 Author: Linus Torvalds Date: Tue Jan 25 20:16:03 2022 +0200 Merge tag 'nfs-for-5.17-1' of git://git.linux-nfs.org/projects/anna/linux-nfs Pull NFS client updates from Anna Schumaker: "New Features: - Basic handling for case insensitive filesystems - Initial support for fs_locations and server trunking Bugfixes and Cleanups: - Cleanups to how the "struct cred *" is handled for the nfs_access_entry - Ensure the server has an up to date ctimes before hardlinking or renaming - Update 'blocks used' after writeback, fallocate, and clone - nfs_atomic_open() fixes - Improvements to sunrpc tracing - Various null check & indenting related cleanups - Some improvements to the sunrpc sysfs code: - Use default_groups in kobj_type - Fix some potential races and reference leaks - A few tracepoint cleanups in xprtrdma" [ This should have gone in during the merge window, but didn't. The original pull request - sent during the merge window - had gotten marked as spam and discarded due missing DKIM headers in the email from Anna. - Linus ] * tag 'nfs-for-5.17-1' of git://git.linux-nfs.org/projects/anna/linux-nfs: (35 commits) SUNRPC: Don't dereference xprt->snd_task if it's a cookie xprtrdma: Remove definitions of RPCDBG_FACILITY xprtrdma: Remove final dprintk call sites from xprtrdma sunrpc: Fix potential race conditions in rpc_sysfs_xprt_state_change() net/sunrpc: fix reference count leaks in rpc_sysfs_xprt_state_change NFSv4.1 test and add 4.1 trunking transport SUNRPC allow for unspecified transport time in rpc_clnt_add_xprt NFSv4 handle port presence in fs_location server string NFSv4 expose nfs_parse_server_name function NFSv4.1 query for fs_location attr on a new file system NFSv4 store server support for fs_location attribute NFSv4 remove zero number of fs_locations entries error check NFSv4: nfs_atomic_open() can race when looking up a non-regular file NFSv4: Handle case where the lookup of a directory fails NFSv42: Fallocate and clone should also request 'blocks used' NFSv4: Allow writebacks to request 'blocks used' SUNRPC: use default_groups in kobj_type NFS: use default_groups in kobj_type NFS: Fix the verifier for case sensitive filesystem in nfs_atomic_open() NFS: Add a helper to remove case-insensitive aliases ... commit 7938d61591d33394a21bdd7797a245b65428f44c Author: Tvrtko Ursulin Date: Tue Oct 19 13:27:10 2021 +0100 drm/i915: Flush TLBs before releasing backing store We need to flush TLBs before releasing backing store otherwise userspace is able to encounter stale entries if a) it is not declaring access to certain buffers and b) it races with the backing store release from a such undeclared execution already executing on the GPU in parallel. The approach taken is to mark any buffer objects which were ever bound to the GPU and to trigger a serialized TLB flush when their backing store is released. Alternatively the flushing could be done on VMA unbind, at which point we would be able to ascertain whether there is potential a parallel GPU execution (which could race), but essentially it boils down to paying the cost of TLB flushes potentially needlessly at VMA unbind time (when the backing store is not known to be going away so not needed for safety), versus potentially needlessly at backing store relase time (since we at that point cannot tell whether there is anything executing on the GPU which uses that object). Thereforce simplicity of implementation has been chosen for now with scope to benchmark and refine later as required. Signed-off-by: Tvrtko Ursulin Reported-by: Sushma Venkatesh Reddy Reviewed-by: Daniel Vetter Acked-by: Dave Airlie Cc: Daniel Vetter Cc: Jon Bloomfield Cc: Joonas Lahtinen Cc: Jani Nikula Cc: stable@vger.kernel.org Signed-off-by: Linus Torvalds commit e3d26528e083e612314d4dcd713f3d5a26143ddc Author: Lucas Stach Date: Thu Jan 6 19:10:21 2022 +0100 drm/etnaviv: relax submit size limits While all userspace tried to limit commandstreams to 64K in size, a bug in the Mesa driver lead to command streams of up to 128K being submitted. Allow those to avoid breaking existing userspace. Fixes: 6dfa2fab8ddd ("drm/etnaviv: limit submit sizes") Cc: stable@vger.kernel.org Signed-off-by: Lucas Stach Reviewed-by: Christian Gmeiner commit 26fbe9772b8c459687930511444ce443011f86bf Author: Alan Stern Date: Mon Jan 24 15:23:45 2022 -0500 USB: core: Fix hang in usb_kill_urb by adding memory barriers The syzbot fuzzer has identified a bug in which processes hang waiting for usb_kill_urb() to return. It turns out the issue is not unlinking the URB; that works just fine. Rather, the problem arises when the wakeup notification that the URB has completed is not received. The reason is memory-access ordering on SMP systems. In outline form, usb_kill_urb() and __usb_hcd_giveback_urb() operating concurrently on different CPUs perform the following actions: CPU 0 CPU 1 ---------------------------- --------------------------------- usb_kill_urb(): __usb_hcd_giveback_urb(): ... ... atomic_inc(&urb->reject); atomic_dec(&urb->use_count); ... ... wait_event(usb_kill_urb_queue, atomic_read(&urb->use_count) == 0); if (atomic_read(&urb->reject)) wake_up(&usb_kill_urb_queue); Confining your attention to urb->reject and urb->use_count, you can see that the overall pattern of accesses on CPU 0 is: write urb->reject, then read urb->use_count; whereas the overall pattern of accesses on CPU 1 is: write urb->use_count, then read urb->reject. This pattern is referred to in memory-model circles as SB (for "Store Buffering"), and it is well known that without suitable enforcement of the desired order of accesses -- in the form of memory barriers -- it is entirely possible for one or both CPUs to execute their reads ahead of their writes. The end result will be that sometimes CPU 0 sees the old un-decremented value of urb->use_count while CPU 1 sees the old un-incremented value of urb->reject. Consequently CPU 0 ends up on the wait queue and never gets woken up, leading to the observed hang in usb_kill_urb(). The same pattern of accesses occurs in usb_poison_urb() and the failure pathway of usb_hcd_submit_urb(). The problem is fixed by adding suitable memory barriers. To provide proper memory-access ordering in the SB pattern, a full barrier is required on both CPUs. The atomic_inc() and atomic_dec() accesses themselves don't provide any memory ordering, but since they are present, we can use the optimized smp_mb__after_atomic() memory barrier in the various routines to obtain the desired effect. This patch adds the necessary memory barriers. CC: Reported-and-tested-by: syzbot+76629376e06e2c2ad626@syzkaller.appspotmail.com Signed-off-by: Alan Stern Link: https://lore.kernel.org/r/Ye8K0QYee0Q0Nna2@rowland.harvard.edu Signed-off-by: Greg Kroah-Hartman commit 5b67b315037250a61861119683e7fcb509deea25 Author: Alan Stern Date: Mon Jan 24 15:14:40 2022 -0500 usb-storage: Add unusual-devs entry for VL817 USB-SATA bridge Two people have reported (and mentioned numerous other reports on the web) that VIA's VL817 USB-SATA bridge does not work with the uas driver. Typical log messages are: [ 3606.232149] sd 14:0:0:0: [sdg] tag#2 uas_zap_pending 0 uas-tag 1 inflight: CMD [ 3606.232154] sd 14:0:0:0: [sdg] tag#2 CDB: Write(16) 8a 00 00 00 00 00 18 0c c9 80 00 00 00 80 00 00 [ 3606.306257] usb 4-4.4: reset SuperSpeed Plus Gen 2x1 USB device number 11 using xhci_hcd [ 3606.328584] scsi host14: uas_eh_device_reset_handler success Surprisingly, the devices do seem to work okay for some other people. The cause of the differing behaviors is not known. In the hope of getting the devices to work for the most users, even at the possible cost of degraded performance for some, this patch adds an unusual_devs entry for the VL817 to block it from binding to the uas driver by default. Users will be able to override this entry by means of a module parameter, if they want. CC: Reported-by: DocMAX Reported-and-tested-by: Thomas Weißschuh Signed-off-by: Alan Stern Link: https://lore.kernel.org/r/Ye8IsK2sjlEv1rqU@rowland.harvard.edu Signed-off-by: Greg Kroah-Hartman commit 746f96e7d6f7a276726860f696671766bfb24cf0 Author: Badhri Jagan Sridharan Date: Fri Jan 21 17:55:20 2022 -0800 usb: typec: tcpm: Do not disconnect when receiving VSAFE0V With some chargers, vbus might momentarily raise above VSAFE5V and fall back to 0V causing VSAFE0V to be triggered. This will will report a VBUS off event causing TCPM to transition to SNK_UNATTACHED state where it should be waiting in either SNK_ATTACH_WAIT or SNK_DEBOUNCED state. This patch makes TCPM avoid VSAFE0V events while in SNK_ATTACH_WAIT or SNK_DEBOUNCED state. Stub from the spec: "4.5.2.2.4.2 Exiting from AttachWait.SNK State A Sink shall transition to Unattached.SNK when the state of both the CC1 and CC2 pins is SNK.Open for at least tPDDebounce. A DRP shall transition to Unattached.SRC when the state of both the CC1 and CC2 pins is SNK.Open for at least tPDDebounce." [23.194131] CC1: 0 -> 0, CC2: 0 -> 5 [state SNK_UNATTACHED, polarity 0, connected] [23.201777] state change SNK_UNATTACHED -> SNK_ATTACH_WAIT [rev3 NONE_AMS] [23.209949] pending state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED @ 170 ms [rev3 NONE_AMS] [23.300579] VBUS off [23.300668] state change SNK_ATTACH_WAIT -> SNK_UNATTACHED [rev3 NONE_AMS] [23.301014] VBUS VSAFE0V [23.301111] Start toggling Fixes: 28b43d3d746b8 ("usb: typec: tcpm: Introduce vsafe0v for vbus") Cc: stable@vger.kernel.org Acked-by: Heikki Krogerus Signed-off-by: Badhri Jagan Sridharan Link: https://lore.kernel.org/r/20220122015520.332507-2-badhri@google.com Signed-off-by: Greg Kroah-Hartman commit 90b8aa9f5b09edae6928c0561f933fec9f7a9987 Author: Badhri Jagan Sridharan Date: Fri Jan 21 17:55:19 2022 -0800 usb: typec: tcpm: Do not disconnect while receiving VBUS off With some chargers, vbus might momentarily raise above VSAFE5V and fall back to 0V before tcpm gets to read port->tcpc->get_vbus. This will will report a VBUS off event causing TCPM to transition to SNK_UNATTACHED where it should be waiting in either SNK_ATTACH_WAIT or SNK_DEBOUNCED state. This patch makes TCPM avoid vbus off events while in SNK_ATTACH_WAIT or SNK_DEBOUNCED state. Stub from the spec: "4.5.2.2.4.2 Exiting from AttachWait.SNK State A Sink shall transition to Unattached.SNK when the state of both the CC1 and CC2 pins is SNK.Open for at least tPDDebounce. A DRP shall transition to Unattached.SRC when the state of both the CC1 and CC2 pins is SNK.Open for at least tPDDebounce." [23.194131] CC1: 0 -> 0, CC2: 0 -> 5 [state SNK_UNATTACHED, polarity 0, connected] [23.201777] state change SNK_UNATTACHED -> SNK_ATTACH_WAIT [rev3 NONE_AMS] [23.209949] pending state change SNK_ATTACH_WAIT -> SNK_DEBOUNCED @ 170 ms [rev3 NONE_AMS] [23.300579] VBUS off [23.300668] state change SNK_ATTACH_WAIT -> SNK_UNATTACHED [rev3 NONE_AMS] [23.301014] VBUS VSAFE0V [23.301111] Start toggling Fixes: f0690a25a140b8 ("staging: typec: USB Type-C Port Manager (tcpm)") Cc: stable@vger.kernel.org Acked-by: Heikki Krogerus Signed-off-by: Badhri Jagan Sridharan Link: https://lore.kernel.org/r/20220122015520.332507-1-badhri@google.com Signed-off-by: Greg Kroah-Hartman commit e464121f2d40eabc7d11823fb26db807ce945df4 Author: Tony Luck Date: Fri Jan 21 09:47:38 2022 -0800 x86/cpu: Add Xeon Icelake-D to list of CPUs that support PPIN Missed adding the Icelake-D CPU to the list. It uses the same MSRs to control and read the inventory number as all the other models. Fixes: dc6b025de95b ("x86/mce: Add Xeon Icelake to list of CPUs that support PPIN") Reported-by: Ailin Xu Signed-off-by: Tony Luck Signed-off-by: Borislav Petkov Cc: Link: https://lore.kernel.org/r/20220121174743.1875294-2-tony.luck@intel.com commit 147ab5376f18045da9f22a8262185707745bbf77 Author: Heikki Krogerus Date: Mon Jan 24 12:02:28 2022 +0300 usb: typec: Don't try to register component master without components This fixes NULL pointer dereference that happens if component master is registered with empty component match list. Fixes: 730b49aac426 ("usb: typec: port-mapper: Convert to the component framework") Reported-by: Mikhail Gavrilov Tested-by: John Stultz Signed-off-by: Heikki Krogerus Link: https://lore.kernel.org/r/20220124090228.41396-3-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 7817adb03cfb52ebb5bdb25fd9fc8f683a1a09d9 Author: Heikki Krogerus Date: Mon Jan 24 12:02:27 2022 +0300 usb: typec: Only attempt to link USB ports if there is fwnode The code that creates the links to the USB ports attached to a connector inside the system assumed that the ACPI nodes (fwnodes) always exist for the connectors, but it can not do that. There is no guarantee that every USB Type-C connector has ACPI device node representing it in the ACPI tables, and even if there are the nodes in the ACPI tables, the _STA method in those nodes may still return 0 (which means the device does not exist from ACPI PoW). This fixes NULL pointer dereference that happens if the nodes are missing. Fixes: 730b49aac426 ("usb: typec: port-mapper: Convert to the component framework") Reported-and-tested-by: Robert Święcki Reported-by: Mikhail Gavrilov Tested-by: Marc Zyngier Acked-by: Marc Zyngier Signed-off-by: Heikki Krogerus Link: https://lore.kernel.org/r/20220124090228.41396-2-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 5638b0dfb6921f69943c705383ff40fb64b987f2 Author: Xu Yang Date: Thu Jan 13 17:29:43 2022 +0800 usb: typec: tcpci: don't touch CC line if it's Vconn source With the AMS and Collision Avoidance, tcpm often needs to change the CC's termination. When one CC line is sourcing Vconn, if we still change its termination, the voltage of the another CC line is likely to be fluctuant and unstable. Therefore, we should verify whether a CC line is sourcing Vconn before changing its termination and only change the termination that is not a Vconn line. This can be done by reading the Vconn Present bit of POWER_ STATUS register. To determine the polarity, we can read the Plug Orientation bit of TCPC_CONTROL register. Since Vconn can only be sourced if Plug Orientation is set. Fixes: 0908c5aca31e ("usb: typec: tcpm: AMS and Collision Avoidance") cc: Reviewed-by: Guenter Roeck Acked-by: Heikki Krogerus Signed-off-by: Xu Yang Link: https://lore.kernel.org/r/20220113092943.752372-1-xu.yang_2@nxp.com Signed-off-by: Greg Kroah-Hartman commit 33569ef3c754a82010f266b7b938a66a3ccf90a4 Author: Amadeusz Sławiński Date: Wed Jan 19 11:47:51 2022 +0100 PM: hibernate: Remove register_nosave_region_late() It is an unused wrapper forcing kmalloc allocation for registering nosave regions. Also, rename __register_nosave_region() to register_nosave_region() now that there is no need for disambiguation. Signed-off-by: Amadeusz Sławiński Reviewed-by: Cezary Rojewski Signed-off-by: Rafael J. Wysocki commit 945c37ed564770c78dfe6b9f08bed57a1b4e60ef Author: Linyu Yuan Date: Mon Jan 10 20:43:28 2022 +0800 usb: roles: fix include/linux/usb/role.h compile issue when CONFIG_USB_ROLE_SWITCH is not defined, add usb_role_switch_find_by_fwnode() definition which return NULL. Fixes: c6919d5e0cd1 ("usb: roles: Add usb_role_switch_find_by_fwnode()") Signed-off-by: Linyu Yuan Link: https://lore.kernel.org/r/1641818608-25039-1-git-send-email-quic_linyyuan@quicinc.com Signed-off-by: Greg Kroah-Hartman commit c9d967b2ce40d71e968eb839f36c936b8a9cf1ea Author: Greg Kroah-Hartman Date: Thu Jan 13 19:44:20 2022 +0100 PM: wakeup: simplify the output logic of pm_show_wakelocks() The buffer handling in pm_show_wakelocks() is tricky, and hopefully correct. Ensure it really is correct by using sysfs_emit_at() which handles all of the tricky string handling logic in a PAGE_SIZE buffer for us automatically as this is a sysfs file being read from. Signed-off-by: Greg Kroah-Hartman Reviewed-by: Lee Jones Signed-off-by: Rafael J. Wysocki commit 8bdd24940b69c0018b64b496aa3b03a25f7295ca Author: Thomas Bogendoerfer Date: Tue Jan 25 15:40:06 2022 +0100 amd: declance: use eth_hw_addr_set() Copy scattered mac address octets into an array then eth_hw_addr_set(). Fixes: adeef3e32146 ("net: constify netdev->dev_addr") Signed-off-by: Thomas Bogendoerfer Link: https://lore.kernel.org/r/20220125144007.64407-1-tsbogend@alpha.franken.de Signed-off-by: Jakub Kicinski commit 6aa89ae1fb049614b7e03e24485bbfb96754a02b Author: Rob Clark Date: Sat Jan 8 10:09:11 2022 -0800 drm/msm/gpu: Cancel idle/boost work on suspend With system suspend using pm_runtime_force_suspend() we can't rely on the pm_runtime_get_if_in_use() trick to deal with devfreq callbacks after (or racing with) suspend. So flush any pending idle or boost work in the suspend path. Signed-off-by: Rob Clark Link: https://lore.kernel.org/r/20220108180913.814448-3-robdclark@gmail.com Signed-off-by: Rob Clark commit 167a668ab0edf92bfd043bafd24e7f895d074173 Author: Rob Clark Date: Sat Jan 8 10:09:10 2022 -0800 drm/msm/gpu: Wait for idle before suspending System suspend uses pm_runtime_force_suspend(), which cheekily bypasses the runpm reference counts. This doesn't actually work so well when the GPU is active. So add a reasonable delay waiting for the GPU to become idle. Alternatively we could just return -EBUSY in this case, but that has the disadvantage of causing system suspend to fail. v2: s/ret/remaining [sboyd], and switch to using active_submits count to ensure we aren't racing with submit cleanup (and devfreq idle work getting scheduled, etc) v3: fix inverted logic Signed-off-by: Rob Clark Reviewed-by: Bjorn Andersson Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220108180913.814448-2-robdclark@gmail.com Signed-off-by: Rob Clark commit 49d766f3a0e49624c4cf83909d56c68164e7c545 Merge: a08b41ab9e2e4 27cdfde181bca Author: Linus Torvalds Date: Tue Jan 25 18:29:10 2022 +0200 Merge tag 'for-5.17-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs fixes from David Sterba: "Several fixes for defragmentation that got broken in 5.16 after refactoring and added subpage support. The observed bugs are excessive IO or uninterruptible ioctl. All stable material" * tag 'for-5.17-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: btrfs: update writeback index when starting defrag btrfs: add back missing dirty page rate limiting to defrag btrfs: fix deadlock when reserving space during defrag btrfs: defrag: properly update range->start for autodefrag btrfs: defrag: fix wrong number of defragged sectors btrfs: allow defrag to be interruptible btrfs: fix too long loop when defragging a 1 byte file commit 426aca16e903b387a0b0001d62207a745c67cfd3 Author: Uwe Kleine-König Date: Tue Jan 18 19:13:37 2022 +0100 staging: fbtft: Fix error path in fbtft_driver_module_init() If registering the platform driver fails, the function must not return without undoing the spi driver registration first. Fixes: c296d5f9957c ("staging: fbtft: core support") Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20220118181338.207943-1-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 0cea730cac824edf78ffd3302938ed5fe2b9d50d Author: Padmanabha Srinivasaiah Date: Fri Dec 31 20:54:03 2021 +0100 staging: vc04_services: Fix RCU dereference check In service_callback path RCU dereferenced pointer struct vchiq_service need to be accessed inside rcu read-critical section. Also userdata/user_service part of vchiq_service is accessed around different synchronization mechanism, getting an extra reference to a pointer keeps sematics simpler and avoids prolonged graceperiod. Accessing vchiq_service with rcu_read_[lock/unlock] fixes below issue. [ 32.201659] ============================= [ 32.201664] WARNING: suspicious RCU usage [ 32.201670] 5.15.11-rt24-v8+ #3 Not tainted [ 32.201680] ----------------------------- [ 32.201685] drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h:529 suspicious rcu_dereference_check() usage! [ 32.201695] [ 32.201695] other info that might help us debug this: [ 32.201695] [ 32.201700] [ 32.201700] rcu_scheduler_active = 2, debug_locks = 1 [ 32.201708] no locks held by vchiq-slot/0/98. [ 32.201715] [ 32.201715] stack backtrace: [ 32.201723] CPU: 1 PID: 98 Comm: vchiq-slot/0 Not tainted 5.15.11-rt24-v8+ #3 [ 32.201733] Hardware name: Raspberry Pi 4 Model B Rev 1.4 (DT) [ 32.201739] Call trace: [ 32.201742] dump_backtrace+0x0/0x1b8 [ 32.201772] show_stack+0x20/0x30 [ 32.201784] dump_stack_lvl+0x8c/0xb8 [ 32.201799] dump_stack+0x18/0x34 [ 32.201808] lockdep_rcu_suspicious+0xe4/0xf8 [ 32.201817] service_callback+0x124/0x400 [ 32.201830] slot_handler_func+0xf60/0x1e20 [ 32.201839] kthread+0x19c/0x1a8 [ 32.201849] ret_from_fork+0x10/0x20 Tested-by: Stefan Wahren Signed-off-by: Padmanabha Srinivasaiah Link: https://lore.kernel.org/r/20211231195406.5479-1-treasure4paddy@gmail.com Signed-off-by: Greg Kroah-Hartman commit d081a343dd18f6733f2f4d9a2521db92de9f7b75 Author: Quanfa Fu Date: Sun Dec 19 17:14:46 2021 +0800 KVM/X86: Make kvm_vcpu_reload_apic_access_page() static Make kvm_vcpu_reload_apic_access_page() static as it is no longer invoked directly by vmx and it is also no longer exported. No functional change intended. Signed-off-by: Quanfa Fu Message-Id: <20211219091446.174584-1-quanfafu@gmail.com> Signed-off-by: Paolo Bonzini commit de1956f48543e90f94b1194395f33140898b39b2 Author: David Matlack Date: Thu Jan 20 00:38:26 2022 +0000 KVM: selftests: Re-enable access_tracking_perf_test This selftest was accidentally removed by commit 6a58150859fd ("selftest: KVM: Add intra host migration tests"). Add it back. Fixes: 6a58150859fd ("selftest: KVM: Add intra host migration tests") Signed-off-by: David Matlack Message-Id: <20220120003826.2805036-1-dmatlack@google.com> Signed-off-by: Paolo Bonzini commit b9bed78e2fa9571b7c983b20666efa0009030c71 Author: Sean Christopherson Date: Thu Jan 20 00:06:24 2022 +0000 KVM: VMX: Set vmcs.PENDING_DBG.BS on #DB in STI/MOVSS blocking shadow Set vmcs.GUEST_PENDING_DBG_EXCEPTIONS.BS, a.k.a. the pending single-step breakpoint flag, when re-injecting a #DB with RFLAGS.TF=1, and STI or MOVSS blocking is active. Setting the flag is necessary to make VM-Entry consistency checks happy, as VMX has an invariant that if RFLAGS.TF is set and STI/MOVSS blocking is true, then the previous instruction must have been STI or MOV/POP, and therefore a single-step #DB must be pending since the RFLAGS.TF cannot have been set by the previous instruction, i.e. the one instruction delay after setting RFLAGS.TF must have already expired. Normally, the CPU sets vmcs.GUEST_PENDING_DBG_EXCEPTIONS.BS appropriately when recording guest state as part of a VM-Exit, but #DB VM-Exits intentionally do not treat the #DB as "guest state" as interception of the #DB effectively makes the #DB host-owned, thus KVM needs to manually set PENDING_DBG.BS when forwarding/re-injecting the #DB to the guest. Note, although this bug can be triggered by guest userspace, doing so requires IOPL=3, and guest userspace running with IOPL=3 has full access to all I/O ports (from the guest's perspective) and can crash/reboot the guest any number of ways. IOPL=3 is required because STI blocking kicks in if and only if RFLAGS.IF is toggled 0=>1, and if CPL>IOPL, STI either takes a #GP or modifies RFLAGS.VIF, not RFLAGS.IF. MOVSS blocking can be initiated by userspace, but can be coincident with a #DB if and only if DR7.GD=1 (General Detect enabled) and a MOV DR is executed in the MOVSS shadow. MOV DR #GPs at CPL>0, thus MOVSS blocking is problematic only for CPL0 (and only if the guest is crazy enough to access a DR in a MOVSS shadow). All other sources of #DBs are either suppressed by MOVSS blocking (single-step, code fetch, data, and I/O), are mutually exclusive with MOVSS blocking (T-bit task switch), or are already handled by KVM (ICEBP, a.k.a. INT1). This bug was originally found by running tests[1] created for XSA-308[2]. Note that Xen's userspace test emits ICEBP in the MOVSS shadow, which is presumably why the Xen bug was deemed to be an exploitable DOS from guest userspace. KVM already handles ICEBP by skipping the ICEBP instruction and thus clears MOVSS blocking as a side effect of its "emulation". [1] http://xenbits.xenproject.org/docs/xtf/xsa-308_2main_8c_source.html [2] https://xenbits.xen.org/xsa/advisory-308.html Reported-by: David Woodhouse Reported-by: Alexander Graf Signed-off-by: Sean Christopherson Message-Id: <20220120000624.655815-1-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 5c89be1dd5cfb697614bc13626ba3bd0781aa160 Author: Vitaly Kuznetsov Date: Mon Jan 24 11:36:05 2022 +0100 KVM: x86: Move CPUID.(EAX=0x12,ECX=1) mangling to __kvm_update_cpuid_runtime() Full equality check of CPUID data on update (kvm_cpuid_check_equal()) may fail for SGX enabled CPUs as CPUID.(EAX=0x12,ECX=1) is currently being mangled in kvm_vcpu_after_set_cpuid(). Move it to __kvm_update_cpuid_runtime() and split off cpuid_get_supported_xcr0() helper as 'vcpu->arch.guest_supported_xcr0' update needs (logically) to stay in kvm_vcpu_after_set_cpuid(). Cc: stable@vger.kernel.org Fixes: feb627e8d6f6 ("KVM: x86: Forbid KVM_SET_CPUID{,2} after KVM_RUN") Signed-off-by: Vitaly Kuznetsov Message-Id: <20220124103606.2630588-2-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini commit 2f61353cd2f789a4229b6f5c1c24a40a613357bb Author: Yufeng Mo Date: Tue Jan 25 15:03:12 2022 +0800 net: hns3: handle empty unknown interrupt for VF Since some interrupt states may be cleared by hardware, the driver may receive an empty interrupt. Currently, the VF driver directly disables the vector0 interrupt in this case. As a result, the VF is unavailable. Therefore, the vector0 interrupt should be enabled in this case. Fixes: b90fcc5bd904 ("net: hns3: add reset handling for VF when doing Core/Global/IMP reset") Signed-off-by: Yufeng Mo Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 74afa30630976861a1308c5ec93391f8b037a2ae Author: Jakub Kicinski Date: Mon Jan 24 09:22:49 2022 -0800 net: fec_mpc52xx: don't discard const from netdev->dev_addr Recent changes made netdev->dev_addr const, and it's passed directly to mpc52xx_fec_set_paddr(). Similar problem exists on the probe patch, the driver needs to call eth_hw_addr_set(). Reported-by: Geert Uytterhoeven Fixes: adeef3e32146 ("net: constify netdev->dev_addr") Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit c63003e3d99761afb280add3b30de1cf30fa522b Author: Toke Høiland-Jørgensen Date: Mon Jan 24 15:35:29 2022 +0100 net: cpsw: Properly initialise struct page_pool_params The cpsw driver didn't properly initialise the struct page_pool_params before calling page_pool_create(), which leads to crashes after the struct has been expanded with new parameters. The second Fixes tag below is where the buggy code was introduced, but because the code was moved around this patch will only apply on top of the commit in the first Fixes tag. Fixes: c5013ac1dd0e ("net: ethernet: ti: cpsw: move set of common functions in cpsw_priv") Fixes: 9ed4050c0d75 ("net: ethernet: ti: cpsw: add XDP support") Reported-by: Colin Foster Signed-off-by: Toke Høiland-Jørgensen Tested-by: Colin Foster Acked-by: Jesper Dangaard Brouer Signed-off-by: David S. Miller commit 29eb31542787e1019208a2e1047bb7c76c069536 Author: Hangyu Hua Date: Mon Jan 24 11:29:54 2022 +0800 yam: fix a memory leak in yam_siocdevprivate() ym needs to be free when ym->cmd != SIOCYAMSMCS. Fixes: 0781168e23a2 ("yam: fix a missing-check bug") Signed-off-by: Hangyu Hua Signed-off-by: David S. Miller commit c74ead223deb88bdf18af8c772d7ca5a9b6c3c2b Author: Jisheng Zhang Date: Sun Jan 23 23:54:58 2022 +0800 net: stmmac: reduce unnecessary wakeups from eee sw timer Currently, on EEE capable platforms, if EEE SW timer is used, the SW timer cause 1 wakeup/s even if the TX has successfully entered EEE. Remove this unnecessary wakeup by only calling mod_timer() if we haven't successfully entered EEE. Signed-off-by: Jisheng Zhang Signed-off-by: David S. Miller commit 4cf28e9ae6e2e11a044be1bcbcfa1b0d8675fe4d Author: Mark Brown Date: Mon Jan 24 15:32:53 2022 +0000 ASoC: ops: Reject out of bounds values in snd_soc_put_xr_sx() We don't currently validate that the values being set are within the range we advertised to userspace as being valid, do so and reject any values that are out of range. Signed-off-by: Mark Brown Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220124153253.3548853-4-broonie@kernel.org Signed-off-by: Mark Brown commit 4f1e50d6a9cf9c1b8c859d449b5031cacfa8404e Author: Mark Brown Date: Mon Jan 24 15:32:52 2022 +0000 ASoC: ops: Reject out of bounds values in snd_soc_put_volsw_sx() We don't currently validate that the values being set are within the range we advertised to userspace as being valid, do so and reject any values that are out of range. Signed-off-by: Mark Brown Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220124153253.3548853-3-broonie@kernel.org Signed-off-by: Mark Brown commit 817f7c9335ec01e0f5e8caffc4f1dcd5e458a4c0 Author: Mark Brown Date: Mon Jan 24 15:32:51 2022 +0000 ASoC: ops: Reject out of bounds values in snd_soc_put_volsw() We don't currently validate that the values being set are within the range we advertised to userspace as being valid, do so and reject any values that are out of range. Signed-off-by: Mark Brown Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220124153253.3548853-2-broonie@kernel.org Signed-off-by: Mark Brown commit 3e3765875b1b8864898603768fd5c93eeb552211 Author: Dan Carpenter Date: Fri Jan 21 14:55:05 2022 +0300 mtd: phram: Prevent divide by zero bug in phram_setup() The problem is that "erasesize" is a uint64_t type so it might be non-zero but the lower 32 bits are zero so when it's truncated, "(uint32_t)erasesize", then that value is zero. This leads to a divide by zero bug. Avoid the bug by delaying the divide until after we have validated that "erasesize" is non-zero and within the uint32_t range. Fixes: dc2b3e5cbc80 ("mtd: phram: use div_u64_rem to stop overwrite len in phram_setup") Signed-off-by: Dan Carpenter Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220121115505.GI1978@kadam commit 4cd335dae3cf25412427938d8abbaf04d46e63b5 Author: Roger Quadros Date: Tue Jan 18 14:35:25 2022 +0200 mtd: rawnand: omap2: Prevent invalid configuration and build error We need to select MEMORY as well otherwise OMAP_GPMC will not be built. For simplicity let's select MEMORY and OMAP_GPMC unconditionally as this driver depends on OMAP_GPMC driver and uses symbols from there. Fixes: dbcb124acebd ("mtd: rawnand: omap2: Select GPMC device driver for ARCH_K3") Reported-by: kernel test robot Signed-off-by: Roger Quadros Reviewed-by: Krzysztof Kozlowski Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220118123525.8020-1-rogerq@kernel.org commit 3dd8ba961b9356c4113b96541c752c73d98fef70 Author: Ansuel Smith Date: Sun Jan 16 04:22:11 2022 +0100 mtd: parsers: qcom: Fix missing free for pparts in cleanup Mtdpart doesn't free pparts when a cleanup function is declared. Add missing free for pparts in cleanup function for smem to fix the leak. Fixes: 10f3b4d79958 ("mtd: parsers: qcom: Fix leaking of partition name") Signed-off-by: Ansuel Smith Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220116032211.9728-2-ansuelsmth@gmail.com commit 65d003cca335cabc0160d3cd7daa689eaa9dd3cd Author: Ansuel Smith Date: Sun Jan 16 04:22:10 2022 +0100 mtd: parsers: qcom: Fix kernel panic on skipped partition In the event of a skipped partition (case when the entry name is empty) the kernel panics in the cleanup function as the name entry is NULL. Rework the parser logic by first checking the real partition number and then allocate the space and set the data for the valid partitions. The logic was also fundamentally wrong as with a skipped partition, the parts number returned was incorrect by not decreasing it for the skipped partitions. Fixes: 803eb124e1a6 ("mtd: parsers: Add Qcom SMEM parser") Signed-off-by: Ansuel Smith Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220116032211.9728-1-ansuelsmth@gmail.com commit 079e6bdb2b1cc1da8b5c602229db782732668ae7 Author: Bryan O'Donoghue Date: Mon Jan 3 03:03:16 2022 +0000 mtd: parsers: qcom: Don't print error message on -EPROBE_DEFER Its possible for the main smem driver to not be loaded by the time we come along to parse the smem partition description but, this is a perfectly normal thing. No need to print out an error message in this case. Signed-off-by: Bryan O'Donoghue Reviewed-by: Manivannan Sadhasivam Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220103030316.58301-3-bryan.odonoghue@linaro.org commit 5c23b3f965bc9ee696bf2ed4bdc54d339dd9a455 Author: Bryan O'Donoghue Date: Mon Jan 3 03:03:15 2022 +0000 mtd: rawnand: qcom: Fix clock sequencing in qcom_nandc_probe() Interacting with a NAND chip on an IPQ6018 I found that the qcomsmem NAND partition parser was returning -EPROBE_DEFER waiting for the main smem driver to load. This caused the board to reset. Playing about with the probe() function shows that the problem lies in the core clock being switched off before the nandc_unalloc() routine has completed. If we look at how qcom_nandc_remove() tears down allocated resources we see the expected order is qcom_nandc_unalloc(nandc); clk_disable_unprepare(nandc->aon_clk); clk_disable_unprepare(nandc->core_clk); dma_unmap_resource(&pdev->dev, nandc->base_dma, resource_size(res), DMA_BIDIRECTIONAL, 0); Tweaking probe() to both bring up and tear-down in that order removes the reset if we end up deferring elsewhere. Fixes: c76b78d8ec05 ("mtd: nand: Qualcomm NAND controller driver") Signed-off-by: Bryan O'Donoghue Reviewed-by: Manivannan Sadhasivam Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220103030316.58301-2-bryan.odonoghue@linaro.org commit ba1b71b008e97fd747845ff3a818420b11bbe830 Author: Miaoqian Lin Date: Thu Dec 30 07:27:51 2021 +0000 mtd: rawnand: ingenic: Fix missing put_device in ingenic_ecc_get If of_find_device_by_node() succeeds, ingenic_ecc_get() doesn't have a corresponding put_device(). Thus add put_device() to fix the exception handling. Fixes: 15de8c6efd0e ("mtd: rawnand: ingenic: Separate top-level and SoC specific code") Signed-off-by: Miaoqian Lin Reviewed-by: Paul Cercueil Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20211230072751.21622-1-linmq006@gmail.com commit a08b41ab9e2e468647f78eb17c28e29b93006394 Merge: dd81e1c7d5fb1 9f80ccda53b94 Author: Linus Torvalds Date: Tue Jan 25 08:02:46 2022 +0200 Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm Pull ARM fixes from Russell King: - Fix panic whe both KASAN and KPROBEs are enabled - Avoid alignment faults in copy_*_kernel_nofault() - Align SMP alternatives in modules * tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm: ARM: 9180/1: Thumb2: align ALT_UP() sections in modules sufficiently ARM: 9179/1: uaccess: avoid alignment faults in copy_[from|to]_kernel_nofault ARM: 9170/1: fix panic when kasan and kprobe are enabled commit 8defc2a5dd8f4c0cb19ecbaca8d3e89ab98524da Author: Nicholas Piggin Date: Tue Jan 25 00:39:28 2022 +1000 powerpc/64s/interrupt: Fix decrementer storm The decrementer exception can fail to be cleared when the interrupt returns in the case where the decrementer wraps with the next timer still beyond decrementer_max. This results in a decrementer interrupt storm. This is triggerable with small decrementer system with hard and soft watchdogs disabled. Fix this by always programming the decrementer if there was no timer. Fixes: 0faf20a1ad16 ("powerpc/64s/interrupt: Don't enable MSR[EE] in irq handlers unless perf is in use") Reported-by: Alexey Kardashevskiy Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220124143930.3923442-1-npiggin@gmail.com commit 22f7ff0dea9491e90b6fe808ed40c30bd791e5c2 Author: Nicholas Piggin Date: Sat Jan 22 20:55:30 2022 +1000 KVM: PPC: Book3S HV Nested: Fix nested HFSCR being clobbered with multiple vCPUs The L0 is storing HFSCR requested by the L1 for the L2 in struct kvm_nested_guest when the L1 requests a vCPU enter L2. kvm_nested_guest is not a per-vCPU structure. Hilarity ensues. Fix it by moving the nested hfscr into the vCPU structure together with the other per-vCPU nested fields. Fixes: 8b210a880b35 ("KVM: PPC: Book3S HV Nested: Make nested HFSCR state accessible") Cc: stable@vger.kernel.org # v5.15+ Signed-off-by: Nicholas Piggin Reviewed-by: Fabiano Rosas Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220122105530.3477250-1-npiggin@gmail.com commit 5ec1cebd59300ddd26dbaa96c17c508764eef911 Author: Manasi Navare Date: Mon Oct 4 04:59:13 2021 -0700 drm/atomic: Add the crtc to affected crtc only if uapi.enable = true In case of a modeset where a mode gets split across multiple CRTCs in the driver specific implementation (bigjoiner in i915) we wrongly count the affected CRTCs based on the drm_crtc_mask and indicate the stolen CRTC as an affected CRTC in atomic_check_only(). This triggers a warning since affected CRTCs doent match requested CRTC. To fix this in such bigjoiner configurations, we should only increment affected crtcs if that CRTC is enabled in UAPI not if it is just used internally in the driver to split the mode. v3: Add the same uapi crtc_state->enable check in requested crtc calc (Ville) Cc: Ville Syrjälä Cc: Simon Ser Cc: Pekka Paalanen Cc: Daniel Stone Cc: Daniel Vetter Cc: dri-devel@lists.freedesktop.org Cc: # v5.11+ Fixes: 919c2299a893 ("drm/i915: Enable bigjoiner") Signed-off-by: Manasi Navare Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211004115913.23889-1-manasi.d.navare@intel.com commit 4db09593af0b0b4d7d4805ebb3273df51d7cc30d Author: Tong Zhang Date: Sun Jan 23 14:57:17 2022 -0800 scsi: myrs: Fix crash in error case In myrs_detect(), cs->disable_intr is NULL when privdata->hw_init() fails with non-zero. In this case, myrs_cleanup(cs) will call a NULL ptr and crash the kernel. [ 1.105606] myrs 0000:00:03.0: Unknown Initialization Error 5A [ 1.105872] myrs 0000:00:03.0: Failed to initialize Controller [ 1.106082] BUG: kernel NULL pointer dereference, address: 0000000000000000 [ 1.110774] Call Trace: [ 1.110950] myrs_cleanup+0xe4/0x150 [myrs] [ 1.111135] myrs_probe.cold+0x91/0x56a [myrs] [ 1.111302] ? DAC960_GEM_intr_handler+0x1f0/0x1f0 [myrs] [ 1.111500] local_pci_probe+0x48/0x90 Link: https://lore.kernel.org/r/20220123225717.1069538-1-ztong0001@gmail.com Reviewed-by: Hannes Reinecke Signed-off-by: Tong Zhang Signed-off-by: Martin K. Petersen commit efd7bb1d75cf6808d67c869a29245c88a990bdea Author: Colin Ian King Date: Sun Jan 23 17:55:30 2022 +0000 scsi: 53c700: Remove redundant assignment to pointer SCp Pointer SCp is being re-assigned the same value that it was initialized to a few lines earlier, the assignment is redundant and can be removed. Link: https://lore.kernel.org/r/20220123175530.110462-1-colin.i.king@gmail.com Signed-off-by: Colin Ian King Signed-off-by: Martin K. Petersen commit c99b9b2301492b665b6e51ba6c06ec362eddcd10 Author: Kiwoong Kim Date: Fri Jan 21 14:37:55 2022 +0900 scsi: ufs: Treat link loss as fatal error This event is raised when link is lost as specified in UFSHCI spec and that means communication is not possible. Thus initializing UFS interface needs to be done. Make UFS driver considers Link Lost as fatal in the INT_FATAL_ERRORS mask. This will trigger a host reset whenever a link lost interrupt occurs. Link: https://lore.kernel.org/r/1642743475-54275-1-git-send-email-kwmad.kim@samsung.com Signed-off-by: Kiwoong Kim Signed-off-by: Martin K. Petersen commit ad6c8a426446873febc98140d81d5353f8c0825b Author: Kiwoong Kim Date: Fri Jan 21 14:33:02 2022 +0900 scsi: ufs: Use generic error code in ufshcd_set_dev_pwr_mode() The return value of ufshcd_set_dev_pwr_mode() is passed to device PM core. However, the function currently returns a SCSI result which the PM core doesn't understand. This might lead to unexpected behaviors in userland; a platform reset was observed in Android. Use a generic error code for SSU failures. Link: https://lore.kernel.org/r/1642743182-54098-1-git-send-email-kwmad.kim@samsung.com Reviewed-by: Bart Van Assche Signed-off-by: Kiwoong Kim Signed-off-by: Martin K. Petersen commit 012d98dae453821ac31da25595ffa26d4ad49c8c Author: Christophe JAILLET Date: Sat Jan 15 10:15:41 2022 +0100 scsi: bfa: Remove useless DMA-32 fallback configuration As stated in [1], dma_set_mask() with a 64-bit mask never fails if dev->dma_mask is non-NULL. So, if it fails, the 32-bit case will also fail for the same reason. Simplify code and remove some dead code accordingly. [1]: https://lore.kernel.org/linux-kernel/YL3vSPK5DXTNvgdx@infradead.org/#t Link: https://lore.kernel.org/r/5663cef9b54004fa56cca7ce65f51eadfc3ecddb.1642238127.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET Signed-off-by: Martin K. Petersen commit 8001fa240fc0af1c3538a9fbaccd2c345ff9ab62 Author: Christophe JAILLET Date: Sat Jan 15 10:05:22 2022 +0100 scsi: hisi_sas: Remove useless DMA-32 fallback configuration As stated in [1], dma_set_mask() with a 64-bit mask never fails if dev->dma_mask is non-NULL. So, if it fails, the 32-bit case will also fail for the same reason. Simplify code and remove some dead code accordingly. [1]: https://lore.kernel.org/linux-kernel/YL3vSPK5DXTNvgdx@infradead.org/#t Link: https://lore.kernel.org/r/1bf2d3660178b0e6f172e5208bc0bd68d31d9268.1642237482.git.christophe.jaillet@wanadoo.fr Acked-by: John Garry Signed-off-by: Christophe JAILLET Signed-off-by: Martin K. Petersen commit fb8d5ea8fd907faa3751a9e5df5d01b5f3803e35 Author: Christophe JAILLET Date: Sat Jan 15 09:53:03 2022 +0100 scsi: 3w-sas: Remove useless DMA-32 fallback configuration As stated in [1], dma_set_mask() with a 64-bit mask never fails if dev->dma_mask is non-NULL. So, if it fails, the 32-bit case will also fail for the same reason. Simplify code and remove some dead code accordingly. [1]: https://lore.kernel.org/linux-kernel/YL3vSPK5DXTNvgdx@infradead.org/#t Link: https://lore.kernel.org/r/dbbe8671ca760972d80f8d35f3170b4609bee368.1642236763.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET Signed-off-by: Martin K. Petersen commit 847f9ea4c5186fdb7b84297e3eeed9e340e83fce Author: John Meneghini Date: Fri Jan 14 23:00:44 2022 -0500 scsi: bnx2fc: Flush destroy_work queue before calling bnx2fc_interface_put() The bnx2fc_destroy() functions are removing the interface before calling destroy_work. This results multiple WARNings from sysfs_remove_group() as the controller rport device attributes are removed too early. Replace the fcoe_port's destroy_work queue. It's not needed. The problem is easily reproducible with the following steps. Example: $ dmesg -w & $ systemctl enable --now fcoe $ fipvlan -s -c ens2f1 $ fcoeadm -d ens2f1.802 [ 583.464488] host2: libfc: Link down on port (7500a1) [ 583.472651] bnx2fc: 7500a1 - rport not created Yet!! [ 583.490468] ------------[ cut here ]------------ [ 583.538725] sysfs group 'power' not found for kobject 'rport-2:0-0' [ 583.568814] WARNING: CPU: 3 PID: 192 at fs/sysfs/group.c:279 sysfs_remove_group+0x6f/0x80 [ 583.607130] Modules linked in: dm_service_time 8021q garp mrp stp llc bnx2fc cnic uio rpcsec_gss_krb5 auth_rpcgss nfsv4 ... [ 583.942994] CPU: 3 PID: 192 Comm: kworker/3:2 Kdump: loaded Not tainted 5.14.0-39.el9.x86_64 #1 [ 583.984105] Hardware name: HP ProLiant DL120 G7, BIOS J01 07/01/2013 [ 584.016535] Workqueue: fc_wq_2 fc_rport_final_delete [scsi_transport_fc] [ 584.050691] RIP: 0010:sysfs_remove_group+0x6f/0x80 [ 584.074725] Code: ff 5b 48 89 ef 5d 41 5c e9 ee c0 ff ff 48 89 ef e8 f6 b8 ff ff eb d1 49 8b 14 24 48 8b 33 48 c7 c7 ... [ 584.162586] RSP: 0018:ffffb567c15afdc0 EFLAGS: 00010282 [ 584.188225] RAX: 0000000000000000 RBX: ffffffff8eec4220 RCX: 0000000000000000 [ 584.221053] RDX: ffff8c1586ce84c0 RSI: ffff8c1586cd7cc0 RDI: ffff8c1586cd7cc0 [ 584.255089] RBP: 0000000000000000 R08: 0000000000000000 R09: ffffb567c15afc00 [ 584.287954] R10: ffffb567c15afbf8 R11: ffffffff8fbe7f28 R12: ffff8c1486326400 [ 584.322356] R13: ffff8c1486326480 R14: ffff8c1483a4a000 R15: 0000000000000004 [ 584.355379] FS: 0000000000000000(0000) GS:ffff8c1586cc0000(0000) knlGS:0000000000000000 [ 584.394419] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 584.421123] CR2: 00007fe95a6f7840 CR3: 0000000107674002 CR4: 00000000000606e0 [ 584.454888] Call Trace: [ 584.466108] device_del+0xb2/0x3e0 [ 584.481701] device_unregister+0x13/0x60 [ 584.501306] bsg_unregister_queue+0x5b/0x80 [ 584.522029] bsg_remove_queue+0x1c/0x40 [ 584.541884] fc_rport_final_delete+0xf3/0x1d0 [scsi_transport_fc] [ 584.573823] process_one_work+0x1e3/0x3b0 [ 584.592396] worker_thread+0x50/0x3b0 [ 584.609256] ? rescuer_thread+0x370/0x370 [ 584.628877] kthread+0x149/0x170 [ 584.643673] ? set_kthread_struct+0x40/0x40 [ 584.662909] ret_from_fork+0x22/0x30 [ 584.680002] ---[ end trace 53575ecefa942ece ]--- Link: https://lore.kernel.org/r/20220115040044.1013475-1-jmeneghi@redhat.com Fixes: 0cbf32e1681d ("[SCSI] bnx2fc: Avoid calling bnx2fc_if_destroy with unnecessary locks") Tested-by: Guangwu Zhang Co-developed-by: Maurizio Lombardi Signed-off-by: Maurizio Lombardi Signed-off-by: John Meneghini Signed-off-by: Martin K. Petersen commit 8c9db6679be4348b8aae108e11d4be2f83976e30 Author: Steffen Maier Date: Tue Jan 18 17:58:03 2022 +0100 scsi: zfcp: Fix failed recovery on gone remote port with non-NPIV FCP devices Suppose we have an environment with a number of non-NPIV FCP devices (virtual HBAs / FCP devices / zfcp "adapter"s) sharing the same physical FCP channel (HBA port) and its I_T nexus. Plus a number of storage target ports zoned to such shared channel. Now one target port logs out of the fabric causing an RSCN. Zfcp reacts with an ADISC ELS and subsequent port recovery depending on the ADISC result. This happens on all such FCP devices (in different Linux images) concurrently as they all receive a copy of this RSCN. In the following we look at one of those FCP devices. Requests other than FSF_QTCB_FCP_CMND can be slow until they get a response. Depending on which requests are affected by slow responses, there are different recovery outcomes. Here we want to fix failed recoveries on port or adapter level by avoiding recovery requests that can be slow. We need the cached N_Port_ID for the remote port "link" test with ADISC. Just before sending the ADISC, we now intentionally forget the old cached N_Port_ID. The idea is that on receiving an RSCN for a port, we have to assume that any cached information about this port is stale. This forces a fresh new GID_PN [FC-GS] nameserver lookup on any subsequent recovery for the same port. Since we typically can still communicate with the nameserver efficiently, we now reach steady state quicker: Either the nameserver still does not know about the port so we stop recovery, or the nameserver already knows the port potentially with a new N_Port_ID and we can successfully and quickly perform open port recovery. For the one case, where ADISC returns successfully, we re-initialize port->d_id because that case does not involve any port recovery. This also solves a problem if the storage WWPN quickly logs into the fabric again but with a different N_Port_ID. Such as on virtual WWPN takeover during target NPIV failover. [https://www.redbooks.ibm.com/abstracts/redp5477.html] In that case the RSCN from the storage FDISC was ignored by zfcp and we could not successfully recover the failover. On some later failback on the storage, we could have been lucky if the virtual WWPN got the same old N_Port_ID from the SAN switch as we still had cached. Then the related RSCN triggered a successful port reopen recovery. However, there is no guarantee to get the same N_Port_ID on NPIV FDISC. Even though NPIV-enabled FCP devices are not affected by this problem, this code change optimizes recovery time for gone remote ports as a side effect. The timely drop of cached N_Port_IDs prevents unnecessary slow open port attempts. While the problem might have been in code before v2.6.32 commit 799b76d09aee ("[SCSI] zfcp: Decouple gid_pn requests from erp") this fix depends on the gid_pn_work introduced with that commit, so we mark it as culprit to satisfy fix dependencies. Note: Point-to-point remote port is already handled separately and gets its N_Port_ID from the cached peer_d_id. So resetting port->d_id in general does not affect PtP. Link: https://lore.kernel.org/r/20220118165803.3667947-1-maier@linux.ibm.com Fixes: 799b76d09aee ("[SCSI] zfcp: Decouple gid_pn requests from erp") Cc: #2.6.32+ Suggested-by: Benjamin Block Reviewed-by: Benjamin Block Signed-off-by: Steffen Maier Signed-off-by: Martin K. Petersen commit 62afb379a0fee7e9c2f9f68e1abeb85ceddf51b9 Author: John Garry Date: Tue Jan 18 20:15:05 2022 +0800 scsi: pm8001: Fix bogus FW crash for maxcpus=1 According to the comment in check_fw_ready() we should not check the IOP1_READY field in register SCRATCH_PAD_1 for 8008 or 8009 controllers. However we check this very field in process_oq() for processing the highest index interrupt vector. The highest interrupt vector is checked as the FW is programmed to signal fatal errors through this irq. Change that function to not check IOP1_READY for those mentioned controllers, but do check ILA_READY in both cases. The reason I assume that this was not hit earlier was because we always allocated 64 MSI(X), and just did not pass the vector index check in process_oq(), i.e. the handler never ran for vector index 63. Link: https://lore.kernel.org/r/1642508105-95432-1-git-send-email-john.garry@huawei.com Tested-by: Damien Le Moal Reviewed-by: Damien Le Moal Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit 64fd4af6274eb0f49d29772c228fffcf6bde1635 Author: Saurav Kashyap Date: Mon Jan 17 05:53:11 2022 -0800 scsi: qedf: Change context reset messages to ratelimited If FCoE is not configured, libfc/libfcoe keeps on retrying FLOGI and after 3 retries driver does a context reset and tries fipvlan again. This leads to context reset message flooding the logs. Hence ratelimit the message to prevent flooding the logs. Link: https://lore.kernel.org/r/20220117135311.6256-4-njavali@marvell.com Signed-off-by: Saurav Kashyap Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit 5239ab63f17cee643bd4bf6addfedebaa7d4f41e Author: Saurav Kashyap Date: Mon Jan 17 05:53:10 2022 -0800 scsi: qedf: Fix refcount issue when LOGO is received during TMF Hung task call trace was seen during LOGO processing. [ 974.309060] [0000:00:00.0]:[qedf_eh_device_reset:868]: 1:0:2:0: LUN RESET Issued... [ 974.309065] [0000:00:00.0]:[qedf_initiate_tmf:2422]: tm_flags 0x10 sc_cmd 00000000c16b930f op = 0x2a target_id = 0x2 lun=0 [ 974.309178] [0000:00:00.0]:[qedf_initiate_tmf:2431]: portid=016900 tm_flags =LUN RESET [ 974.309222] [0000:00:00.0]:[qedf_initiate_tmf:2438]: orig io_req = 00000000ec78df8f xid = 0x180 ref_cnt = 1. [ 974.309625] host1: rport 016900: Received LOGO request while in state Ready [ 974.309627] host1: rport 016900: Delete port [ 974.309642] host1: rport 016900: work event 3 [ 974.309644] host1: rport 016900: lld callback ev 3 [ 974.313243] [0000:61:00.2]:[qedf_execute_tmf:2383]:1: fcport is uploading, not executing flush. [ 974.313295] [0000:61:00.2]:[qedf_execute_tmf:2400]:1: task mgmt command success... [ 984.031088] INFO: task jbd2/dm-15-8:7645 blocked for more than 120 seconds. [ 984.031136] Not tainted 4.18.0-305.el8.x86_64 #1 [ 984.031166] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [ 984.031209] jbd2/dm-15-8 D 0 7645 2 0x80004080 [ 984.031212] Call Trace: [ 984.031222] __schedule+0x2c4/0x700 [ 984.031230] ? unfreeze_partials.isra.83+0x16e/0x1a0 [ 984.031233] ? bit_wait_timeout+0x90/0x90 [ 984.031235] schedule+0x38/0xa0 [ 984.031238] io_schedule+0x12/0x40 [ 984.031240] bit_wait_io+0xd/0x50 [ 984.031243] __wait_on_bit+0x6c/0x80 [ 984.031248] ? free_buffer_head+0x21/0x50 [ 984.031251] out_of_line_wait_on_bit+0x91/0xb0 [ 984.031257] ? init_wait_var_entry+0x50/0x50 [ 984.031268] jbd2_journal_commit_transaction+0x112e/0x19f0 [jbd2] [ 984.031280] kjournald2+0xbd/0x270 [jbd2] [ 984.031284] ? finish_wait+0x80/0x80 [ 984.031291] ? commit_timeout+0x10/0x10 [jbd2] [ 984.031294] kthread+0x116/0x130 [ 984.031300] ? kthread_flush_work_fn+0x10/0x10 [ 984.031305] ret_from_fork+0x1f/0x40 There was a ref count issue when LOGO is received during TMF. This leads to one of the I/Os hanging with the driver. Fix the ref count. Link: https://lore.kernel.org/r/20220117135311.6256-3-njavali@marvell.com Signed-off-by: Saurav Kashyap Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit b70a99fd13282d7885f69bf1372e28b7506a1613 Author: Saurav Kashyap Date: Mon Jan 17 05:53:09 2022 -0800 scsi: qedf: Add stag_work to all the vports Call trace seen when creating NPIV ports, only 32 out of 64 show online. stag work was not initialized for vport, hence initialize the stag work. WARNING: CPU: 8 PID: 645 at kernel/workqueue.c:1635 __queue_delayed_work+0x68/0x80 CPU: 8 PID: 645 Comm: kworker/8:1 Kdump: loaded Tainted: G IOE --------- -- 4.18.0-348.el8.x86_64 #1 Hardware name: Dell Inc. PowerEdge MX740c/0177V9, BIOS 2.12.2 07/09/2021 Workqueue: events fc_lport_timeout [libfc] RIP: 0010:__queue_delayed_work+0x68/0x80 Code: 89 b2 88 00 00 00 44 89 82 90 00 00 00 48 01 c8 48 89 42 50 41 81 f8 00 20 00 00 75 1d e9 60 24 07 00 44 89 c7 e9 98 f6 ff ff <0f> 0b eb c5 0f 0b eb a1 0f 0b eb a7 0f 0b eb ac 44 89 c6 e9 40 23 RSP: 0018:ffffae514bc3be40 EFLAGS: 00010006 RAX: ffff8d25d6143750 RBX: 0000000000000202 RCX: 0000000000000002 RDX: ffff8d2e31383748 RSI: ffff8d25c000d600 RDI: ffff8d2e31383788 RBP: ffff8d2e31380de0 R08: 0000000000002000 R09: ffff8d2e31383750 R10: ffffffffc0c957e0 R11: ffff8d2624800000 R12: ffff8d2e31380a58 R13: ffff8d2d915eb000 R14: ffff8d25c499b5c0 R15: ffff8d2e31380e18 FS: 0000000000000000(0000) GS:ffff8d2d1fb00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000055fd0484b8b8 CR3: 00000008ffc10006 CR4: 00000000007706e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 PKRU: 55555554 Call Trace: queue_delayed_work_on+0x36/0x40 qedf_elsct_send+0x57/0x60 [qedf] fc_lport_enter_flogi+0x90/0xc0 [libfc] fc_lport_timeout+0xb7/0x140 [libfc] process_one_work+0x1a7/0x360 ? create_worker+0x1a0/0x1a0 worker_thread+0x30/0x390 ? create_worker+0x1a0/0x1a0 kthread+0x116/0x130 ? kthread_flush_work_fn+0x10/0x10 ret_from_fork+0x35/0x40 ---[ end trace 008f00f722f2c2ff ]-- Initialize stag work for all the vports. Link: https://lore.kernel.org/r/20220117135311.6256-2-njavali@marvell.com Signed-off-by: Saurav Kashyap Signed-off-by: Nilesh Javali Signed-off-by: Martin K. Petersen commit a65b32748f4566f986ba2495a8236c141fa42a26 Author: Xiaoke Wang Date: Sun Jan 16 11:06:49 2022 +0800 scsi: ufs: ufshcd-pltfrm: Check the return value of devm_kstrdup() devm_kstrdup() returns pointer to allocated string on success, NULL on failure. So it is better to check the return value of it. Link: https://lore.kernel.org/r/tencent_4257E15D4A94FF9020DDCC4BB9B21C041408@qq.com Reviewed-by: Bean Huo Signed-off-by: Xiaoke Wang Signed-off-by: Martin K. Petersen commit a861790afaa8b6369eee8a88c5d5d73f5799c0c6 Author: ZouMingzhe Date: Tue Jan 11 13:47:42 2022 +0800 scsi: target: iscsi: Make sure the np under each tpg is unique iscsit_tpg_check_network_portal() has nested for_each loops and is supposed to return true when a match is found. However, the tpg loop will still continue after existing the tpg_np loop. If this tpg_np is not the last the match value will be changed. Break the outer loop after finding a match and make sure the np under each tpg is unique. Link: https://lore.kernel.org/r/20220111054742.19582-1-mingzhe.zou@easystack.cn Signed-off-by: ZouMingzhe Reviewed-by: Mike Christie Signed-off-by: Martin K. Petersen commit 61263b3a11a2594b4e898f166c31162236182b5c Author: Yang Yingliang Date: Tue Jan 11 09:24:41 2022 +0800 scsi: elx: efct: Don't use GFP_KERNEL under spin lock GFP_KERNEL/GFP_DMA can't be used under a spin lock. According the comment, els_ios_lock is used to protect els ios list so we can move down the spin lock to avoid using this flag under the lock. Link: https://lore.kernel.org/r/20220111012441.3232527-1-yangyingliang@huawei.com Fixes: 8f406ef72859 ("scsi: elx: libefc: Extended link Service I/O handling") Reported-by: Hulk Robot Reviewed-by: James Smart Signed-off-by: Yang Yingliang Signed-off-by: Martin K. Petersen commit 63ee956f69d8c181e5251c7ce58b84c1edec0f6a Author: Alexei Starovoitov Date: Mon Jan 24 20:20:51 2022 -0800 bpf: Fix renaming task_getsecid_subj->current_getsecid_subj. The commit 6326948f940d missed renaming of task->current LSM hook in BTF_ID. Fix it to silence build warning: WARN: resolve_btfids: unresolved symbol bpf_lsm_task_getsecid_subj Fixes: 6326948f940d ("lsm: security_task_getsecid_subj() -> security_current_getsecid_subj()") Acked-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov commit 5e761a2287234bc402ba7ef07129f5103bcd775c Author: José Expósito Date: Sun Jan 16 19:18:44 2022 +0100 drm/msm/dsi: invalid parameter check in msm_dsi_phy_enable The function performs a check on the "phy" input parameter, however, it is used before the check. Initialize the "dev" variable after the sanity check to avoid a possible NULL pointer dereference. Fixes: 5c8290284402b ("drm/msm/dsi: Split PHY drivers to separate files") Addresses-Coverity-ID: 1493860 ("Null pointer dereference") Signed-off-by: José Expósito Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220116181844.7400-1-jose.exposito89@gmail.com Signed-off-by: Dmitry Baryshkov commit 860a7b2a87b7c743154824d0597b6c3eb3b53154 Author: Rob Clark Date: Thu Jan 13 08:32:13 2022 -0800 drm/msm/a6xx: Add missing suspend_count increment Reported-by: Danylo Piliaiev Fixes: 3ab1c5cc3939 ("drm/msm: Add param for userspace to query suspend count") Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220113163215.215367-1-robdclark@gmail.com Signed-off-by: Dmitry Baryshkov commit 0a727b459ee39bd4c5ced19d6024258ac87b6b2e Author: Xianting Tian Date: Wed Jan 12 20:33:34 2022 +0800 drm/msm: Fix wrong size calculation For example, memory-region in .dts as below, reg = <0x0 0x50000000 0x0 0x20000000> We can get below values, struct resource r; r.start = 0x50000000; r.end = 0x6fffffff; So the size should be: size = r.end - r.start + 1 = 0x20000000 Signed-off-by: Xianting Tian Fixes: 072f1f9168ed ("drm/msm: add support for "stolen" mem") Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220112123334.749776-1-xianting.tian@linux.alibaba.com Signed-off-by: Dmitry Baryshkov commit 170b22234d5495f5e0844246e23f004639ee89ba Author: José Expósito Date: Sun Jan 9 20:24:31 2022 +0100 drm/msm/dpu: invalid parameter check in dpu_setup_dspp_pcc The function performs a check on the "ctx" input parameter, however, it is used before the check. Initialize the "base" variable after the sanity check to avoid a possible NULL pointer dereference. Fixes: 4259ff7ae509e ("drm/msm/dpu: add support for pcc color block in dpu driver") Addresses-Coverity-ID: 1493866 ("Null pointer dereference") Signed-off-by: José Expósito Link: https://lore.kernel.org/r/20220109192431.135949-1-jose.exposito89@gmail.com Signed-off-by: Dmitry Baryshkov commit 774fe0cd838d1b1419d41ab4ea0613c80d4ecbd7 Author: Miaoqian Lin Date: Fri Jan 7 08:50:22 2022 +0000 drm/msm/hdmi: Fix missing put_device() call in msm_hdmi_get_phy The reference taken by 'of_find_device_by_node()' must be released when not needed anymore. Add the corresponding 'put_device()' in the error handling path. Fixes: e00012b256d4 ("drm/msm/hdmi: Make HDMI core get its PHY") Signed-off-by: Miaoqian Lin Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20220107085026.23831-1-linmq006@gmail.com Signed-off-by: Dmitry Baryshkov commit c04c3148ca12227d92f91b355b4538cc333c9922 Author: Miaoqian Lin Date: Thu Dec 30 07:09:40 2021 +0000 drm/msm/dsi: Fix missing put_device() call in dsi_get_phy If of_find_device_by_node() succeeds, dsi_get_phy() doesn't a corresponding put_device(). Thus add put_device() to fix the exception handling. Fixes: ec31abf ("drm/msm/dsi: Separate PHY to another platform device") Signed-off-by: Miaoqian Lin Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20211230070943.18116-1-linmq006@gmail.com Signed-off-by: Dmitry Baryshkov commit 84d46e1fc33cc56b622b2e7a91703157161ce2e9 Author: Yang Li Date: Thu Dec 16 11:11:03 2021 +0800 drm/msm: remove variable set but not used The code that uses variable mdss has been removed, So the declaration and assignment of the variable can be removed. Eliminate the following clang warning: drivers/gpu/drm/msm/msm_drv.c:513:19: warning: variable 'mdss' set but not used [-Wunused-but-set-variable] Reported-by: Abaci Robot Fixes: 2027e5b3413d ("drm/msm: Initialize MDSS irq domain at probe time") Signed-off-by: Yang Li Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20211216031103.34146-1-yang.lee@linux.alibaba.com Signed-off-by: Dmitry Baryshkov commit 926fd9f23b27ca6587492c3f58f4c7f4cd01dad5 Author: Eric Biggers Date: Thu Jan 13 11:44:38 2022 -0800 ima: fix reference leak in asymmetric_verify() Don't leak a reference to the key if its algorithm is unknown. Fixes: 947d70597236 ("ima: Support EC keys for signature verification") Cc: # v5.13+ Signed-off-by: Eric Biggers Reviewed-by: Stefan Berger Reviewed-by: Tianjia Zhang Signed-off-by: Mimi Zohar commit 79da533d3cc717ccc05ddbd3190da8a72bc2408b Author: Guenter Roeck Date: Sun Jan 23 18:23:22 2022 -0800 hwmon: (nct6775) Fix crash in clear_caseopen Paweł Marciniak reports the following crash, observed when clearing the chassis intrusion alarm. BUG: kernel NULL pointer dereference, address: 0000000000000028 PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 3 PID: 4815 Comm: bash Tainted: G S 5.16.2-200.fc35.x86_64 #1 Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./Z97 Extreme4, BIOS P2.60A 05/03/2018 RIP: 0010:clear_caseopen+0x5a/0x120 [nct6775] Code: 68 70 e8 e9 32 b1 e3 85 c0 0f 85 d2 00 00 00 48 83 7c 24 ... RSP: 0018:ffffabcb02803dd8 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 0000000000000002 RCX: 0000000000000000 RDX: ffff8e8808192880 RSI: 0000000000000000 RDI: ffff8e87c7509a68 RBP: 0000000000000000 R08: 0000000000000001 R09: 000000000000000a R10: 000000000000000a R11: f000000000000000 R12: 000000000000001f R13: ffff8e87c7509828 R14: ffff8e87c7509a68 R15: ffff8e88494527a0 FS: 00007f4db9151740(0000) GS:ffff8e8ebfec0000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000028 CR3: 0000000166b66001 CR4: 00000000001706e0 Call Trace: kernfs_fop_write_iter+0x11c/0x1b0 new_sync_write+0x10b/0x180 vfs_write+0x209/0x2a0 ksys_write+0x4f/0xc0 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae The problem is that the device passed to clear_caseopen() is the hwmon device, not the platform device, and the platform data is not set in the hwmon device. Store the pointer to sio_data in struct nct6775_data and get if from there if needed. Fixes: 2e7b9886968b ("hwmon: (nct6775) Use superio_*() function pointers in sio_data.") Cc: Denis Pauk Cc: Bernhard Seibold Reported-by: Paweł Marciniak Tested-by: Denis Pauk Signed-off-by: Guenter Roeck commit e52984be9a522fb55c8f3e3df860d464d6658585 Merge: de8a820df2acd f04aefd4659b7 Author: Jakub Kicinski Date: Mon Jan 24 12:17:58 2022 -0800 Merge tag 'linux-can-fixes-for-5.17-20220124' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can Marc Kleine-Budde says: ==================== pull-request: can 2022-01-24 The first patch updates the email address of Brian Silverman from his former employer to his private address. The next patch fixes DT bindings information for the tcan4x5x SPI CAN driver. The following patch targets the m_can driver and fixes the introduction of FIFO bulk read support. Another patch for the tcan4x5x driver, which fixes the max register value for the regmap config. The last patch for the flexcan driver marks the RX mailbox support for the MCF5441X as support. * tag 'linux-can-fixes-for-5.17-20220124' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can: can: flexcan: mark RX via mailboxes as supported on MCF5441X can: tcan4x5x: regmap: fix max register value can: m_can: m_can_fifo_{read,write}: don't read or write from/to FIFO if length is 0 dt-bindings: can: tcan4x5x: fix mram-cfg RX FIFO config mailmap: update email address of Brian Silverman ==================== Link: https://lore.kernel.org/r/20220124175955.3464134-1-mkl@pengutronix.de Signed-off-by: Jakub Kicinski commit aee744a37aaf277e74557e683cc524fbe6daeef7 Author: Aswath Govindraju Date: Thu Dec 23 17:46:50 2021 +0530 arm64: dts: ti: k3-j721s2-common-proc-board: Alias console uart to serial2 On J721s2 Linux console is on main_uart8 but to be consistent with other J7 family of devices, alias it to ttyS2 (serial2). This also eliminates need to have higher number of 8250 runtime UARTs. Signed-off-by: Aswath Govindraju Signed-off-by: Vignesh Raghavendra Signed-off-by: Nishanth Menon Reviewed-by: Kishon Vijay Abraham I Link: https://lore.kernel.org/r/20211223121650.26868-3-vigneshr@ti.com commit 165216533dda560f2620ce8f61381a9ee0ca57ba Author: Aswath Govindraju Date: Thu Dec 23 17:46:49 2021 +0530 arm64: dts: ti: k3-j721s2: Move aliases to board dts Aliases are board specific and should be in board dts files. So, move aliases to board dts and trim the list to interfaces that are actually enabled. Signed-off-by: Aswath Govindraju Signed-off-by: Vignesh Raghavendra Signed-off-by: Nishanth Menon Reviewed-by: Kishon Vijay Abraham I Link: https://lore.kernel.org/r/20211223121650.26868-2-vigneshr@ti.com commit 82880283d7fcd0a1d20964a56d6d1a5cc0df0713 Author: Sergei Trofimovich Date: Thu Jan 20 23:37:48 2022 +0000 objtool: Fix truncated string warning On GCC 12, the build fails due to a possible truncated string: check.c: In function 'validate_call': check.c:2865:58: error: '%d' directive output may be truncated writing between 1 and 10 bytes into a region of size 9 [-Werror=format-truncation=] 2865 | snprintf(pvname, sizeof(pvname), "pv_ops[%d]", idx); | ^~ In theory it's a valid bug: static char pvname[16]; int idx; ... idx = (rel->addend / sizeof(void *)); snprintf(pvname, sizeof(pvname), "pv_ops[%d]", idx); There are only 7 chars for %d while it could take up to 9, so the printed "pv_ops[%d]" string could get truncated. In reality the bug should never happen, because pv_ops only has ~80 entries, so 7 chars for the integer is more than enough. Still, it's worth fixing. Bump the buffer size by 2 bytes to silence the warning. [ jpoimboe: changed size to 19; massaged changelog ] Fixes: db2b0c5d7b6f ("objtool: Support pv_opsindirect calls for noinstr") Reported-by: Adam Borowski Reported-by: Martin Liška Signed-off-by: Sergei Trofimovich Signed-off-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20220120233748.2062559-1-slyich@gmail.com commit f04aefd4659b7959e50e6d0d649936c6940f9d34 Author: Marc Kleine-Budde Date: Fri Jan 21 09:22:34 2022 +0100 can: flexcan: mark RX via mailboxes as supported on MCF5441X Most flexcan IP cores support 2 RX modes: - FIFO - mailbox The flexcan IP core on the MCF5441X cannot receive CAN RTR messages via mailboxes. However the mailbox mode is more performant. The commit | 1c45f5778a3b ("can: flexcan: add ethtool support to change rx-rtr setting during runtime") added support to switch from FIFO to mailbox mode on these cores. After testing the mailbox mode on the MCF5441X by Angelo Dureghello, this patch marks it (without RTR capability) as supported. Further the IP core overview table is updated, that RTR reception via mailboxes is not supported. Link: https://lore.kernel.org/all/20220121084425.3141218-1-mkl@pengutronix.de Tested-by: Angelo Dureghello Signed-off-by: Marc Kleine-Budde commit e59986de5ff701494e14c722b78b6e6d513e0ab5 Author: Marc Kleine-Budde Date: Fri Jan 14 18:50:54 2022 +0100 can: tcan4x5x: regmap: fix max register value The MRAM of the tcan4x5x has a size of 2K and starts at 0x8000. There are no further registers in the tcan4x5x making 0x87fc the biggest addressable register. This patch fixes the max register value of the regmap config from 0x8ffc to 0x87fc. Fixes: 6e1caaf8ed22 ("can: tcan4x5x: fix max register value") Link: https://lore.kernel.org/all/20220119064011.2943292-1-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde commit db72589c49fd260bfc99c7160c079675bc7417af Author: Marc Kleine-Budde Date: Fri Jan 14 15:35:01 2022 +0100 can: m_can: m_can_fifo_{read,write}: don't read or write from/to FIFO if length is 0 In order to optimize FIFO access, especially on m_can cores attached to slow busses like SPI, in patch | e39381770ec9 ("can: m_can: Disable IRQs on FIFO bus errors") bulk read/write support has been added to the m_can_fifo_{read,write} functions. That change leads to the tcan driver to call regmap_bulk_{read,write}() with a length of 0 (for CAN frames with 0 data length). regmap treats this as an error: | tcan4x5x spi1.0 tcan4x5x0: FIFO write returned -22 This patch fixes the problem by not calling the cdev->ops->{read,write)_fifo() in case of a 0 length read/write. Fixes: e39381770ec9 ("can: m_can: Disable IRQs on FIFO bus errors") Link: https://lore.kernel.org/all/20220114155751.2651888-1-mkl@pengutronix.de Cc: stable@vger.kernel.org Cc: Matt Kline Cc: Chandrasekar Ramakrishnan Reported-by: Michael Anochin Signed-off-by: Marc Kleine-Budde commit 17a30422621c0e04cb6060d20d7edcefd7463347 Author: Marc Kleine-Budde Date: Fri Jan 14 18:47:41 2022 +0100 dt-bindings: can: tcan4x5x: fix mram-cfg RX FIFO config This tcan4x5x only comes with 2K of MRAM, a RX FIFO with a dept of 32 doesn't fit into the MRAM. Use a depth of 16 instead. Fixes: 4edd396a1911 ("dt-bindings: can: tcan4x5x: Add DT bindings for TCAN4x5X driver") Link: https://lore.kernel.org/all/20220119062951.2939851-1-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 984d1efff2304833e20fce89046ef8a89fb51d15 Author: Marc Kleine-Budde Date: Mon Jan 10 09:20:19 2022 +0100 mailmap: update email address of Brian Silverman Brian Silverman's address at bluerivertech.com is not valid anymore, use Brian's private email address instead. Link: https://lore.kernel.org/all/20220110082359.2019735-1-mkl@pengutronix.de Cc: Brian Silverman Signed-off-by: Marc Kleine-Budde commit 27cdfde181bcacd226c230b2fd831f6f5b8c215f Author: Filipe Manana Date: Thu Jan 20 17:41:17 2022 +0000 btrfs: update writeback index when starting defrag When starting a defrag, we should update the writeback index of the inode's mapping in case it currently has a value beyond the start of the range we are defragging. This can help performance and often result in getting less extents after writeback - for e.g., if the current value of the writeback index sits somewhere in the middle of a range that gets dirty by the defrag, then after writeback we can get two smaller extents instead of a single, larger extent. We used to have this before the refactoring in 5.16, but it was removed without any reason to do so. Originally it was added in kernel 3.1, by commit 2a0f7f5769992b ("Btrfs: fix recursive auto-defrag"), in order to fix a loop with autodefrag resulting in dirtying and writing pages over and over, but some testing on current code did not show that happening, at least with the test described in that commit. So add back the behaviour, as at the very least it is a nice to have optimization. Fixes: 7b508037d4cac3 ("btrfs: defrag: use defrag_one_cluster() to implement btrfs_defrag_file()") CC: stable@vger.kernel.org # 5.16 Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 3c9d31c715948aaff0ee6d322a91a2dec07770bf Author: Filipe Manana Date: Thu Jan 20 17:11:52 2022 +0000 btrfs: add back missing dirty page rate limiting to defrag A defrag operation can dirty a lot of pages, specially if operating on the entire file or a large file range. Any task dirtying pages should periodically call balance_dirty_pages_ratelimited(), as stated in that function's comments, otherwise they can leave too many dirty pages in the system. This is what we did before the refactoring in 5.16, and it should have remained, just like in the buffered write path and relocation. So restore that behaviour. Fixes: 7b508037d4cac3 ("btrfs: defrag: use defrag_one_cluster() to implement btrfs_defrag_file()") CC: stable@vger.kernel.org # 5.16 Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 0cb5950f3f3b51a4e8657d106f897f2b913e0586 Author: Filipe Manana Date: Thu Jan 20 14:27:56 2022 +0000 btrfs: fix deadlock when reserving space during defrag When defragging we can end up collecting a range for defrag that has already pages under delalloc (dirty), as long as the respective extent map for their range is not mapped to a hole, a prealloc extent or the extent map is from an old generation. Most of the time that is harmless from a functional perspective at least, however it can result in a deadlock: 1) At defrag_collect_targets() we find an extent map that meets all requirements but there's delalloc for the range it covers, and we add its range to list of ranges to defrag; 2) The defrag_collect_targets() function is called at defrag_one_range(), after it locked a range that overlaps the range of the extent map; 3) At defrag_one_range(), while the range is still locked, we call defrag_one_locked_target() for the range associated to the extent map we collected at step 1); 4) Then finally at defrag_one_locked_target() we do a call to btrfs_delalloc_reserve_space(), which will reserve data and metadata space. If the space reservations can not be satisfied right away, the flusher might be kicked in and start flushing delalloc and wait for the respective ordered extents to complete. If this happens we will deadlock, because both flushing delalloc and finishing an ordered extent, requires locking the range in the inode's io tree, which was already locked at defrag_collect_targets(). So fix this by skipping extent maps for which there's already delalloc. Fixes: eb793cf857828d ("btrfs: defrag: introduce helper to collect target file extents") CC: stable@vger.kernel.org # 5.16 Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 6596a0229541270fb8d38d989f91b78838e5e9da Author: Jiri Bohac Date: Wed Jan 19 10:22:53 2022 +0100 xfrm: fix MTU regression Commit 749439bfac6e1a2932c582e2699f91d329658196 ("ipv6: fix udpv6 sendmsg crash caused by too small MTU") breaks PMTU for xfrm. A Packet Too Big ICMPv6 message received in response to an ESP packet will prevent all further communication through the tunnel if the reported MTU minus the ESP overhead is smaller than 1280. E.g. in a case of a tunnel-mode ESP with sha256/aes the overhead is 92 bytes. Receiving a PTB with MTU of 1371 or less will result in all further packets in the tunnel dropped. A ping through the tunnel fails with "ping: sendmsg: Invalid argument". Apparently the MTU on the xfrm route is smaller than 1280 and fails the check inside ip6_setup_cork() added by 749439bf. We found this by debugging USGv6/ipv6ready failures. Failing tests are: "Phase-2 Interoperability Test Scenario IPsec" / 5.3.11 and 5.4.11 (Tunnel Mode: Fragmentation). Commit b515d2637276a3810d6595e10ab02c13bfd0b63a ("xfrm: xfrm_state_mtu should return at least 1280 for ipv6") attempted to fix this but caused another regression in TCP MSS calculations and had to be reverted. The patch below fixes the situation by dropping the MTU check and instead checking for the underflows described in the 749439bf commit message. Signed-off-by: Jiri Bohac Fixes: 749439bfac6e ("ipv6: fix udpv6 sendmsg crash caused by too small MTU") Signed-off-by: Steffen Klassert commit 379f56c24e698f14242f532b1d0a0f1747725e08 Author: Andrey Skvortsov Date: Sat Jan 15 15:14:46 2022 +0300 mmc: core: Wait for command setting 'Power Off Notification' bit to complete SD card is allowed to signal busy on DAT0 up to 1s after the CMD49. According to SD spec (version 6.0 section 5.8.1.3) first host waits until busy of CMD49 is released and only then polls Power Management Status register up to 1s until the card indicates ready to power off. Without waiting for busy before polling status register sometimes card becomes unresponsive and system fails to suspend: [ 205.907459] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done. [ 206.421274] sunxi-mmc 1c0f000.mmc: data error, sending stop command [ 206.421321] sunxi-mmc 1c0f000.mmc: send stop command failed [ 206.421347] mmc0: error -110 reading status reg of PM func [ 206.421366] PM: dpm_run_callback(): mmc_bus_suspend+0x0/0x74 returns -110 [ 206.421402] mmcblk mmc0:aaaa: PM: failed to suspend async: error -110 [ 206.437064] PM: Some devices failed to suspend, or early wake event detected Tested with Sandisk Extreme PRO A2 64GB on Allwinner A64 system. Signed-off-by: Andrey Skvortsov Fixes: 2c5d42769038 ("mmc: core: Add support for Power Off Notification for SD cards") Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220115121447.641524-1-andrej.skvortzov@gmail.com Signed-off-by: Ulf Hansson commit 4d315357b3d6c315a7260420c6c6fc076e58d14b Author: Jiasheng Jiang Date: Wed Jan 19 20:00:06 2022 +0800 mmc: sh_mmcif: Check for null res pointer If there is no suitable resource, platform_get_resource() will return NULL. Therefore in order to avoid the dereference of the NULL pointer, it should be better to check the 'res'. Signed-off-by: Jiasheng Jiang Cc: stable@vger.kernel.org # v5.16+ Link: https://lore.kernel.org/r/20220119120006.1426964-1-jiasheng@iscas.ac.cn Signed-off-by: Ulf Hansson commit 40c67c291a93f8846c4a972c9ef1b7ba4544c8d0 Author: Jiasheng Jiang Date: Wed Jan 12 16:31:56 2022 +0800 mmc: sdhci-of-esdhc: Check for error num after setting mask Because of the possible failure of the dma_supported(), the dma_set_mask_and_coherent() may return error num. Therefore, it should be better to check it and return the error if fails. And since the sdhci_setup_host() has already checked the return value of the enable_dma, we need not check it in sdhci_resume_host() again. Fixes: 5552d7ad596c ("mmc: sdhci-of-esdhc: set proper dma mask for ls104x chips") Signed-off-by: Jiasheng Jiang Acked-by: Adrian Hunter Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220112083156.1124782-1-jiasheng@iscas.ac.cn Signed-off-by: Ulf Hansson commit 7865827c432bf9885ee26e5767697c3d9e21a82c Author: Gao Xiang Date: Fri Jan 21 17:14:12 2022 +0800 erofs: avoid unnecessary z_erofs_decompressqueue_work() declaration Just code rearrange. No logic changes. Link: https://lore.kernel.org/r/20220121091412.86086-1-hsiangkao@linux.alibaba.com Reviewed-by: Yue Hu Reviewed-by: Chao Yu Signed-off-by: Gao Xiang commit e33f42b20bcb2f55cb1eeeab9956a503dcf36107 Author: Gao Xiang Date: Thu Jan 13 13:18:45 2022 +0800 erofs: fix fsdax partition offset handling After seeking time on testing today upstream fsdax, I found it actually doesn't work well as below: [ 186.492983] ------------[ cut here ]------------ [ 186.493629] WARNING: CPU: 1 PID: 205 at fs/iomap/iter.c:33 iomap_iter+0x2f6/0x310 The problem is that m_dax_part_off should be applied to physical addresses and very sorry about that I didn't catch this eariler. Anyway, let's fix it up now. Also, I need to find a way to set up a standalone testcase to look after this later. Link: https://lore.kernel.org/r/20220113051845.244461-1-hsiangkao@linux.alibaba.com Fixes: de2051147771 ("fsdax: shift partition offset handling into the file systems") Reviewed-by: Christoph Hellwig Reviewed-by: Chao Yu Signed-off-by: Gao Xiang commit e12963c453263d5321a2c610e98cbc731233b685 Author: Andy Shevchenko Date: Wed Jan 19 20:19:15 2022 +0200 pinctrl: intel: Fix a glitch when updating IRQ flags on a preconfigured line The commit af7e3eeb84e2 ("pinctrl: intel: Disable input and output buffer when switching to GPIO") hadn't taken into account an update of the IRQ flags scenario. When updating the IRQ flags on the preconfigured line the ->irq_set_type() is called again. In such case the sequential Rx buffer configuration changes may trigger a falling or rising edge interrupt that may lead, on some platforms, to an undesired event. This may happen because each of intel_gpio_set_gpio_mode() and __intel_gpio_set_direction() updates the pad configuration with a different value of the GPIORXDIS bit. Notable, that the intel_gpio_set_gpio_mode() is called only for the pads that are configured as an input. Due to this fact, integrate the logic of __intel_gpio_set_direction() call into the intel_gpio_set_gpio_mode() so that the Rx buffer won't be disabled and immediately re-enabled. Fixes: af7e3eeb84e2 ("pinctrl: intel: Disable input and output buffer when switching to GPIO") Reported-by: Kane Chen Signed-off-by: Andy Shevchenko Acked-by: Mika Westerberg Tested-by: Grace Kao commit e986f0e602f19ecb7880b04dd1db415ed9bca3f6 Author: Łukasz Bartosik Date: Mon Jan 24 13:55:29 2022 +0100 pinctrl: intel: fix unexpected interrupt ASUS Chromebook C223 with Celeron N3350 crashes sometimes during cold booot. Inspection of the kernel log showed that it gets into an inifite loop logging the following message: ->handle_irq(): 000000009cdb51e8, handle_bad_irq+0x0/0x251 ->irq_data.chip(): 000000005ec212a7, 0xffffa043009d8e7 ->action(): 00000 IRQ_NOPROBE set unexpected IRQ trap at vector 7c The issue happens during cold boot but only if cold boot happens at most several dozen seconds after Chromebook is powered off. For longer intervals between power off and power on (cold boot) the issue does not reproduce. The unexpected interrupt is sourced from INT3452 GPIO pin which is used for SD card detect. Investigation relevealed that when the interval between power off and power on (cold boot) is less than several dozen seconds then values of INT3452 GPIO interrupt enable and interrupt pending registers survive power off and power on sequence and interrupt for SD card detect pin is enabled and pending during probe of SD controller which causes the unexpected IRQ message. "Intel Pentium and Celeron Processor N- and J- Series" volume 3 doc mentions that GPIO interrupt enable and status registers default value is 0x0. The fix clears INT3452 GPIO interrupt enabled and interrupt pending registers in its probe function. Fixes: 7981c0015af2 ("pinctrl: intel: Add Intel Sunrisepoint pin controller and GPIO support") Signed-off-by: Łukasz Bartosik Signed-off-by: Andy Shevchenko commit 77311237eaffa240af6eae1d511b61e77a20a2ef Author: Andy Shevchenko Date: Wed Jan 12 22:58:46 2022 +0200 pinctrl: Place correctly CONFIG_PINCTRL_ST in the Makefile Keep Makefile entries ordered in the same way as Kconfig ones. Reported-by: Linus Torvalds Signed-off-by: Andy Shevchenko commit 1e0924bd09916fab795fc2a21ec1d148f24299fd Author: Masami Hiramatsu Date: Mon Jan 24 17:17:54 2022 +0900 arm64: Mark start_backtrace() notrace and NOKPROBE_SYMBOL Mark the start_backtrace() as notrace and NOKPROBE_SYMBOL because this function is called from ftrace and lockdep to get the caller address via return_address(). The lockdep is used in kprobes, it should also be NOKPROBE_SYMBOL. Fixes: b07f3499661c ("arm64: stacktrace: Move start_backtrace() out of the header") Cc: # 5.13.x Signed-off-by: Masami Hiramatsu Reviewed-by: Mark Brown Link: https://lore.kernel.org/r/164301227374.1433152.12808232644267107415.stgit@devnote2 Signed-off-by: Catalin Marinas commit eb30d838a44c9e59a2a106884f536119859c7257 Author: Anshuman Khandual Date: Mon Jan 24 08:45:38 2022 +0530 arm64: errata: Update ARM64_ERRATUM_[2119858|2224489] with Cortex-X2 ranges Errata ARM64_ERRATUM_[2119858|2224489] also affect some Cortex-X2 ranges as well. Lets update these errata definition and detection to accommodate all new Cortex-X2 based cpu MIDR ranges. Cc: Will Deacon Cc: Mathieu Poirier Cc: Suzuki Poulose Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual Reviewed-by: Suzuki K Poulose Link: https://lore.kernel.org/r/1642994138-25887-3-git-send-email-anshuman.khandual@arm.com Signed-off-by: Catalin Marinas commit 72bb9dcb6c33cfac80282713c2b4f2b254cd24d1 Author: Anshuman Khandual Date: Mon Jan 24 08:45:37 2022 +0530 arm64: Add Cortex-X2 CPU part definition Add the CPU Partnumbers for the new Arm designs. Cc: Will Deacon Cc: Suzuki Poulose Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual Reviewed-by: Suzuki K Poulose Link: https://lore.kernel.org/r/1642994138-25887-2-git-send-email-anshuman.khandual@arm.com Signed-off-by: Catalin Marinas commit 9ff5549b1d1d3c3a9d71220d44bd246586160f1d Author: Michael Kelley Date: Sun Jan 16 11:18:31 2022 -0800 video: hyperv_fb: Fix validation of screen resolution In the WIN10 version of the Synthetic Video protocol with Hyper-V, Hyper-V reports a list of supported resolutions as part of the protocol negotiation. The driver calculates the maximum width and height from the list of resolutions, and uses those maximums to validate any screen resolution specified in the video= option on the kernel boot line. This method of validation is incorrect. For example, the list of supported resolutions could contain 1600x1200 and 1920x1080, both of which fit in an 8 Mbyte frame buffer. But calculating the max width and height yields 1920 and 1200, and 1920x1200 resolution does not fit in an 8 Mbyte frame buffer. Unfortunately, this resolution is accepted, causing a kernel fault when the driver accesses memory outside the frame buffer. Instead, validate the specified screen resolution by calculating its size, and comparing against the frame buffer size. Delete the code for calculating the max width and height from the list of resolutions, since these max values have no use. Also add the frame buffer size to the info message to aid in understanding why a resolution might be rejected. Fixes: 67e7cdb4829d ("video: hyperv: hyperv_fb: Obtain screen resolution from Hyper-V host") Signed-off-by: Michael Kelley Reviewed-by: Haiyang Zhang Acked-by: Helge Deller Link: https://lore.kernel.org/r/1642360711-2335-1-git-send-email-mikelley@microsoft.com Signed-off-by: Wei Liu commit 1625566ec8fd3a42e305c5118df81fb113eb60a7 Author: Xianting Tian Date: Mon Jan 24 10:04:56 2022 +0800 KVM: remove async parameter of hva_to_pfn_remapped() The async parameter of hva_to_pfn_remapped() is not used, so remove it. Signed-off-by: Xianting Tian Message-Id: <20220124020456.156386-1-xianting.tian@linux.alibaba.com> Signed-off-by: Paolo Bonzini commit adb759e599990416e42e659c024a654b76c84617 Author: Peter Zijlstra Date: Sun Jan 23 13:42:19 2022 +0100 x86,kvm/xen: Remove superfluous .fixup usage Commit 14243b387137 ("KVM: x86/xen: Add KVM_IRQ_ROUTING_XEN_EVTCHN and event channel delivery") adds superfluous .fixup usage after the whole .fixup section was removed in commit e5eefda5aa51 ("x86: Remove .fixup section"). Fixes: 14243b387137 ("KVM: x86/xen: Add KVM_IRQ_ROUTING_XEN_EVTCHN and event channel delivery") Reported-by: Borislav Petkov Signed-off-by: Peter Zijlstra (Intel) Message-Id: <20220123124219.GH20638@worktop.programming.kicks-ass.net> Signed-off-by: Paolo Bonzini commit 94fea1d8a30eadc3ef07afc0f53dc06799bb300b Author: Sean Christopherson Date: Sat Jan 22 01:52:11 2022 +0000 KVM: VMX: Zero host's SYSENTER_ESP iff SYSENTER is NOT used Zero vmcs.HOST_IA32_SYSENTER_ESP when initializing *constant* host state if and only if SYSENTER cannot be used, i.e. the kernel is a 64-bit kernel and is not emulating 32-bit syscalls. As the name suggests, vmx_set_constant_host_state() is intended for state that is *constant*. When SYSENTER is used, SYSENTER_ESP isn't constant because stacks are per-CPU, and the VMCS must be updated whenever the vCPU is migrated to a new CPU. The logic in vmx_vcpu_load_vmcs() doesn't differentiate between "never loaded" and "loaded on a different CPU", i.e. setting SYSENTER_ESP on VMCS load also handles setting correct host state when the VMCS is first loaded. Because a VMCS must be loaded before it is initialized during vCPU RESET, zeroing the field in vmx_set_constant_host_state() obliterates the value that was written when the VMCS was loaded. If the vCPU is run before it is migrated, the subsequent VM-Exit will zero out MSR_IA32_SYSENTER_ESP, leading to a #DF on the next 32-bit syscall. double fault: 0000 [#1] SMP CPU: 0 PID: 990 Comm: stable Not tainted 5.16.0+ #97 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015 EIP: entry_SYSENTER_32+0x0/0xe7 Code: <9c> 50 eb 17 0f 20 d8 a9 00 10 00 00 74 0d 25 ff ef ff ff 0f 22 d8 EAX: 000000a2 EBX: a8d1300c ECX: a8d13014 EDX: 00000000 ESI: a8f87000 EDI: a8d13014 EBP: a8d12fc0 ESP: 00000000 DS: 007b ES: 007b FS: 0000 GS: 0000 SS: 0068 EFLAGS: 00210093 CR0: 80050033 CR2: fffffffc CR3: 02c3b000 CR4: 00152e90 Fixes: 6ab8a4053f71 ("KVM: VMX: Avoid to rdmsrl(MSR_IA32_SYSENTER_ESP)") Cc: Lai Jiangshan Signed-off-by: Sean Christopherson Message-Id: <20220122015211.1468758-1-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 9daf0a4d32d60a57f2a2533bdf4c178be7fdff7f Author: Tom Rix Date: Sun Jan 16 04:59:36 2022 -0800 quota: cleanup double word in comment Remove the second 'handle'. Link: https://lore.kernel.org/r/20220116125936.389767-1-trix@redhat.com Signed-off-by: Tom Rix Signed-off-by: Jan Kara commit ea8569194b43f0f01f0a84c689388542c7254a1f Author: Jan Kara Date: Tue Jan 18 09:57:25 2022 +0100 udf: Restore i_lenAlloc when inode expansion fails When we fail to expand inode from inline format to a normal format, we restore inode to contain the original inline formatting but we forgot to set i_lenAlloc back. The mismatch between i_lenAlloc and i_size was then causing further problems such as warnings and lost data down the line. Reported-by: butt3rflyh4ck CC: stable@vger.kernel.org Fixes: 7e49b6f2480c ("udf: Convert UDF to new truncate calling sequence") Reviewed-by: Christoph Hellwig Signed-off-by: Jan Kara commit 7fc3b7c2981bbd1047916ade327beccb90994eee Author: Jan Kara Date: Mon Jan 17 18:22:13 2022 +0100 udf: Fix NULL ptr deref when converting from inline format udf_expand_file_adinicb() calls directly ->writepage to write data expanded into a page. This however misses to setup inode for writeback properly and so we can crash on inode->i_wb dereference when submitting page for IO like: BUG: kernel NULL pointer dereference, address: 0000000000000158 #PF: supervisor read access in kernel mode ... __folio_start_writeback+0x2ac/0x350 __block_write_full_page+0x37d/0x490 udf_expand_file_adinicb+0x255/0x400 [udf] udf_file_write_iter+0xbe/0x1b0 [udf] new_sync_write+0x125/0x1c0 vfs_write+0x28e/0x400 Fix the problem by marking the page dirty and going through the standard writeback path to write the page. Strictly speaking we would not even have to write the page but we want to catch e.g. ENOSPC errors early. Reported-by: butt3rflyh4ck CC: stable@vger.kernel.org Fixes: 52ebea749aae ("writeback: make backing_dev_info host cgroup-specific bdi_writebacks") Reviewed-by: Christoph Hellwig Signed-off-by: Jan Kara commit de8a820df2acd02eac1d98a99dd447634226d653 Author: Jisheng Zhang Date: Sun Jan 23 20:27:58 2022 +0800 net: stmmac: remove unused members in struct stmmac_priv The tx_coalesce and mii_irq are not used at all now, so remove them. Signed-off-by: Jisheng Zhang Signed-off-by: David S. Miller commit bdac3bbd0dc63873a9c606b8e4f814e6d61d288d Author: Nicolas Frattaroli Date: Fri Nov 26 16:43:42 2021 +0100 spi: spi-rockchip: Add rk3568-spi compatible This adds a compatible string for the SPI controller found on the RK3566 and RK3568 SoCs. Signed-off-by: Nicolas Frattaroli Link: https://lore.kernel.org/r/20211126154344.724316-2-frattaroli.nicolas@gmail.com Signed-off-by: Mark Brown commit 29044dae2e746949ad4b9cbdbfb248994d1dcdb4 Author: Amir Goldstein Date: Thu Jan 20 23:53:05 2022 +0200 fsnotify: fix fsnotify hooks in pseudo filesystems Commit 49246466a989 ("fsnotify: move fsnotify_nameremove() hook out of d_delete()") moved the fsnotify delete hook before d_delete() so fsnotify will have access to a positive dentry. This allowed a race where opening the deleted file via cached dentry is now possible after receiving the IN_DELETE event. To fix the regression in pseudo filesystems, convert d_delete() calls to d_drop() (see commit 46c46f8df9aa ("devpts_pty_kill(): don't bother with d_delete()") and move the fsnotify hook after d_drop(). Add a missing fsnotify_unlink() hook in nfsdfs that was found during the audit of fsnotify hooks in pseudo filesystems. Note that the fsnotify hooks in simple_recursive_removal() follow d_invalidate(), so they require no change. Link: https://lore.kernel.org/r/20220120215305.282577-2-amir73il@gmail.com Reported-by: Ivan Delalande Link: https://lore.kernel.org/linux-fsdevel/YeNyzoDM5hP5LtGW@visor/ Fixes: 49246466a989 ("fsnotify: move fsnotify_nameremove() hook out of d_delete()") Cc: stable@vger.kernel.org # v5.3+ Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara commit a37d9a17f099072fe4d3a9048b0321978707a918 Author: Amir Goldstein Date: Thu Jan 20 23:53:04 2022 +0200 fsnotify: invalidate dcache before IN_DELETE event Apparently, there are some applications that use IN_DELETE event as an invalidation mechanism and expect that if they try to open a file with the name reported with the delete event, that it should not contain the content of the deleted file. Commit 49246466a989 ("fsnotify: move fsnotify_nameremove() hook out of d_delete()") moved the fsnotify delete hook before d_delete() so fsnotify will have access to a positive dentry. This allowed a race where opening the deleted file via cached dentry is now possible after receiving the IN_DELETE event. To fix the regression, create a new hook fsnotify_delete() that takes the unlinked inode as an argument and use a helper d_delete_notify() to pin the inode, so we can pass it to fsnotify_delete() after d_delete(). Backporting hint: this regression is from v5.3. Although patch will apply with only trivial conflicts to v5.4 and v5.10, it won't build, because fsnotify_delete() implementation is different in each of those versions (see fsnotify_link()). A follow up patch will fix the fsnotify_unlink/rmdir() calls in pseudo filesystem that do not need to call d_delete(). Link: https://lore.kernel.org/r/20220120215305.282577-1-amir73il@gmail.com Reported-by: Ivan Delalande Link: https://lore.kernel.org/linux-fsdevel/YeNyzoDM5hP5LtGW@visor/ Fixes: 49246466a989 ("fsnotify: move fsnotify_nameremove() hook out of d_delete()") Cc: stable@vger.kernel.org # v5.3+ Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara commit ebe0582bee78e221b7d9f09ff22a530e0ddd6c96 Author: Christophe JAILLET Date: Sun Jan 23 07:53:46 2022 +0100 net: atlantic: Use the bitmap API instead of hand-writing it Simplify code by using bitmap_weight() and bitmap_zero() instead of hand-writing these functions. Signed-off-by: Christophe JAILLET Reviewed-by: Igor Russkikh Signed-off-by: David S. Miller commit 2afc3b5a31f9edf3ef0f374f5d70610c79c93a42 Author: Xin Long Date: Sat Jan 22 06:40:56 2022 -0500 ping: fix the sk_bound_dev_if match in ping_lookup When 'ping' changes to use PING socket instead of RAW socket by: # sysctl -w net.ipv4.ping_group_range="0 100" the selftests 'router_broadcast.sh' will fail, as such command # ip vrf exec vrf-h1 ping -I veth0 198.51.100.255 -b can't receive the response skb by the PING socket. It's caused by mismatch of sk_bound_dev_if and dif in ping_rcv() when looking up the PING socket, as dif is vrf-h1 if dif's master was set to vrf-h1. This patch is to fix this regression by also checking the sk_bound_dev_if against sdif so that the packets can stil be received even if the socket is not bound to the vrf device but to the real iif. Fixes: c319b4d76b9e ("net: ipv4: add IPPROTO_ICMP socket kind") Reported-by: Hangbin Liu Signed-off-by: Xin Long Signed-off-by: David S. Miller commit 58cd4a088e8917b4092c7011d499e277e04a6644 Author: Vincenzo Frascino Date: Fri Jan 21 12:12:34 2022 +0000 arm64: vdso: Fix "no previous prototype" warning If compiling the arm64 kernel with W=1 the following warning is produced: | arch/arm64/kernel/vdso/vgettimeofday.c:9:5: error: no previous prototype for ‘__kernel_clock_gettime’ [-Werror=missing-prototypes] | 9 | int __kernel_clock_gettime(clockid_t clock, | | ^~~~~~~~~~~~~~~~~~~~~~ | arch/arm64/kernel/vdso/vgettimeofday.c:15:5: error: no previous prototype for ‘__kernel_gettimeofday’ [-Werror=missing-prototypes] | 15 | int __kernel_gettimeofday(struct __kernel_old_timeval *tv, | | ^~~~~~~~~~~~~~~~~~~~~ | arch/arm64/kernel/vdso/vgettimeofday.c:21:5: error: no previous prototype for ‘__kernel_clock_getres’ [-Werror=missing-prototypes] | 21 | int __kernel_clock_getres(clockid_t clock_id, | | ^~~~~~~~~~~~~~~~~~~~~ This patch removes "-Wmissing-prototypes" and "-Wmissing-declarations" compilers flags from the compilation of vgettimeofday.c to make possible to build the kernel with CONFIG_WERROR enabled. Cc: Will Deacon Reported-by: Marc Kleine-Budde Signed-off-by: Vincenzo Frascino Tested-by: Marc Kleine-Budde Link: https://lore.kernel.org/r/20220121121234.47273-1-vincenzo.frascino@arm.com Signed-off-by: Catalin Marinas commit c0bf3d8a943b6f2e912b7c1de03e2ef28e76f760 Author: Wen Gu Date: Sat Jan 22 17:43:09 2022 +0800 net/smc: Transitional solution for clcsock race issue We encountered a crash in smc_setsockopt() and it is caused by accessing smc->clcsock after clcsock was released. BUG: kernel NULL pointer dereference, address: 0000000000000020 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 0 P4D 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 1 PID: 50309 Comm: nginx Kdump: loaded Tainted: G E 5.16.0-rc4+ #53 RIP: 0010:smc_setsockopt+0x59/0x280 [smc] Call Trace: __sys_setsockopt+0xfc/0x190 __x64_sys_setsockopt+0x20/0x30 do_syscall_64+0x34/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f16ba83918e This patch tries to fix it by holding clcsock_release_lock and checking whether clcsock has already been released before access. In case that a crash of the same reason happens in smc_getsockopt() or smc_switch_to_fallback(), this patch also checkes smc->clcsock in them too. And the caller of smc_switch_to_fallback() will identify whether fallback succeeds according to the return value. Fixes: fd57770dd198 ("net/smc: wait for pending work before clcsock release_sock") Link: https://lore.kernel.org/lkml/5dd7ffd1-28e2-24cc-9442-1defec27375e@linux.ibm.com/T/ Signed-off-by: Wen Gu Acked-by: Karsten Graul Signed-off-by: David S. Miller commit 3a5d9db7fbdfc8207ddf70d92668ced0ab330701 Author: Sukadev Bhattiprolu Date: Fri Jan 21 18:59:21 2022 -0800 ibmvnic: remove unused ->wait_capability With previous bug fix, ->wait_capability flag is no longer needed and can be removed. Fixes: 249168ad07cd ("ibmvnic: Make CRQ interrupt tasklet wait for all capabilities crqs") Signed-off-by: Sukadev Bhattiprolu Reviewed-by: Dany Madden Signed-off-by: David S. Miller commit 48079e7fdd0269d66b1d7d66ae88bd03162464ad Author: Sukadev Bhattiprolu Date: Fri Jan 21 18:59:20 2022 -0800 ibmvnic: don't spin in tasklet ibmvnic_tasklet() continuously spins waiting for responses to all capability requests. It does this to avoid encountering an error during initialization of the vnic. However if there is a bug in the VIOS and we do not receive a response to one or more queries the tasklet ends up spinning continuously leading to hard lock ups. If we fail to receive a message from the VIOS it is reasonable to timeout the login attempt rather than spin indefinitely in the tasklet. Fixes: 249168ad07cd ("ibmvnic: Make CRQ interrupt tasklet wait for all capabilities crqs") Signed-off-by: Sukadev Bhattiprolu Reviewed-by: Dany Madden Signed-off-by: David S. Miller commit 151b6a5c06b678687f64f2d9a99fd04d5cd32b72 Author: Sukadev Bhattiprolu Date: Fri Jan 21 18:59:19 2022 -0800 ibmvnic: init ->running_cap_crqs early We use ->running_cap_crqs to determine when the ibmvnic_tasklet() should send out the next protocol message type. i.e when we get back responses to all our QUERY_CAPABILITY CRQs we send out REQUEST_CAPABILITY crqs. Similiary, when we get responses to all the REQUEST_CAPABILITY crqs, we send out the QUERY_IP_OFFLOAD CRQ. We currently increment ->running_cap_crqs as we send out each CRQ and have the ibmvnic_tasklet() send out the next message type, when this running_cap_crqs count drops to 0. This assumes that all the CRQs of the current type were sent out before the count drops to 0. However it is possible that we send out say 6 CRQs, get preempted and receive all the 6 responses before we send out the remaining CRQs. This can result in ->running_cap_crqs count dropping to zero before all messages of the current type were sent and we end up sending the next protocol message too early. Instead initialize the ->running_cap_crqs upfront so the tasklet will only send the next protocol message after all responses are received. Use the cap_reqs local variable to also detect any discrepancy (either now or in future) in the number of capability requests we actually send. Currently only send_query_cap() is affected by this behavior (of sending next message early) since it is called from the worker thread (during reset) and from application thread (during ->ndo_open()) and they can be preempted. send_request_cap() is only called from the tasklet which processes CRQ responses sequentially, is not be affected. But to maintain the existing symmtery with send_query_capability() we update send_request_capability() also. Fixes: 249168ad07cd ("ibmvnic: Make CRQ interrupt tasklet wait for all capabilities crqs") Signed-off-by: Sukadev Bhattiprolu Reviewed-by: Dany Madden Signed-off-by: David S. Miller commit db9f0e8bf79e6da7068b5818fea0ffd9d0d4b4da Author: Sukadev Bhattiprolu Date: Fri Jan 21 18:59:18 2022 -0800 ibmvnic: Allow extra failures before disabling If auto-priority-failover (APF) is enabled and there are at least two backing devices of different priorities, some resets like fail-over, change-param etc can cause at least two back to back failovers. (Failover from high priority backing device to lower priority one and then back to the higher priority one if that is still functional). Depending on the timimg of the two failovers it is possible to trigger a "hard" reset and for the hard reset to fail due to failovers. When this occurs, the driver assumes that the network is unstable and disables the VNIC for a 60-second "settling time". This in turn can cause the ethtool command to fail with "No such device" while the vnic automatically recovers a little while later. Given that it's possible to have two back to back failures, allow for extra failures before disabling the vnic for the settling time. Fixes: f15fde9d47b8 ("ibmvnic: delay next reset if hard reset fails") Signed-off-by: Sukadev Bhattiprolu Reviewed-by: Dany Madden Signed-off-by: David S. Miller commit 27a8caa59babb96c5890569e131bc0eb6d45daee Author: Jakub Kicinski Date: Fri Jan 21 16:57:31 2022 -0800 ipv4: fix ip option filtering for locally generated fragments During IP fragmentation we sanitize IP options. This means overwriting options which should not be copied with NOPs. Only the first fragment has the original, full options. ip_fraglist_prepare() copies the IP header and options from previous fragment to the next one. Commit 19c3401a917b ("net: ipv4: place control buffer handling away from fragmentation iterators") moved sanitizing options before ip_fraglist_prepare() which means options are sanitized and then overwritten again with the old values. Fixing this is not enough, however, nor did the sanitization work prior to aforementioned commit. ip_options_fragment() (which does the sanitization) uses ipcb->opt.optlen for the length of the options. ipcb->opt of fragments is not populated (it's 0), only the head skb has the state properly built. So even when called at the right time ip_options_fragment() does nothing. This seems to date back all the way to v2.5.44 when the fast path for pre-fragmented skbs had been introduced. Prior to that ip_options_build() would have been called for every fragment (in fact ever since v2.5.44 the fragmentation handing in ip_options_build() has been dead code, I'll clean it up in -next). In the original patch (see Link) caixf mentions fixing the handling for fragments other than the second one, but I'm not sure how _any_ fragment could have had their options sanitized with the code as it stood. Tested with python (MTU on lo lowered to 1000 to force fragmentation): import socket s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.setsockopt(socket.IPPROTO_IP, socket.IP_OPTIONS, bytearray([7,4,5,192, 20|0x80,4,1,0])) s.sendto(b'1'*2000, ('127.0.0.1', 1234)) Before: IP (tos 0x0, ttl 64, id 1053, offset 0, flags [+], proto UDP (17), length 996, options (RR [bad length 4] [bad ptr 5] 192.148.4.1,,RA value 256)) localhost.36500 > localhost.search-agent: UDP, length 2000 IP (tos 0x0, ttl 64, id 1053, offset 968, flags [+], proto UDP (17), length 996, options (RR [bad length 4] [bad ptr 5] 192.148.4.1,,RA value 256)) localhost > localhost: udp IP (tos 0x0, ttl 64, id 1053, offset 1936, flags [none], proto UDP (17), length 100, options (RR [bad length 4] [bad ptr 5] 192.148.4.1,,RA value 256)) localhost > localhost: udp After: IP (tos 0x0, ttl 96, id 42549, offset 0, flags [+], proto UDP (17), length 996, options (RR [bad length 4] [bad ptr 5] 192.148.4.1,,RA value 256)) localhost.51607 > localhost.search-agent: UDP, bad length 2000 > 960 IP (tos 0x0, ttl 96, id 42549, offset 968, flags [+], proto UDP (17), length 996, options (NOP,NOP,NOP,NOP,RA value 256)) localhost > localhost: udp IP (tos 0x0, ttl 96, id 42549, offset 1936, flags [none], proto UDP (17), length 100, options (NOP,NOP,NOP,NOP,RA value 256)) localhost > localhost: udp RA (20 | 0x80) is now copied as expected, RR (7) is "NOPed out". Link: https://lore.kernel.org/netdev/20220107080559.122713-1-ooppublic@163.com/ Fixes: 19c3401a917b ("net: ipv4: place control buffer handling away from fragmentation iterators") Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: caixf Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 4064c461148ab129dfe5eaeea129b4af6cf4b9b7 Author: Jens Wiklander Date: Tue Dec 28 21:25:57 2021 +0100 optee: add error checks in optee_ffa_do_call_with_arg() Adds error checking in optee_ffa_do_call_with_arg() for correctness. Fixes: 4615e5a34b95 ("optee: add FF-A support") Reviewed-by: Sumit Garg Signed-off-by: Jens Wiklander commit 1d10f8a1f40b965d449e8f2d5ed7b96a7c138b77 Author: Jianguo Wu Date: Fri Jan 21 17:15:31 2022 +0800 net-procfs: show net devices bound packet types After commit:7866a621043f ("dev: add per net_device packet type chains"), we can not get packet types that are bound to a specified net device by /proc/net/ptype, this patch fix the regression. Run "tcpdump -i ens192 udp -nns0" Before and after apply this patch: Before: [root@localhost ~]# cat /proc/net/ptype Type Device Function 0800 ip_rcv 0806 arp_rcv 86dd ipv6_rcv After: [root@localhost ~]# cat /proc/net/ptype Type Device Function ALL ens192 tpacket_rcv 0800 ip_rcv 0806 arp_rcv 86dd ipv6_rcv v1 -> v2: - fix the regression rather than adding new /proc API as suggested by Stephen Hemminger. Fixes: 7866a621043f ("dev: add per net_device packet type chains") Signed-off-by: Jianguo Wu Signed-off-by: David S. Miller commit aa6034678e873db8bd5c5a4b73f8b88c469374d6 Author: Hangbin Liu Date: Fri Jan 21 16:25:18 2022 +0800 bonding: use rcu_dereference_rtnl when get bonding active slave bond_option_active_slave_get_rcu() should not be used in rtnl_mutex as it use rcu_dereference(). Replace to rcu_dereference_rtnl() so we also can use this function in rtnl protected context. With this update, we can rmeove the rcu_read_lock/unlock in bonding .ndo_eth_ioctl and .get_ts_info. Reported-by: Vladimir Oltean Fixes: 94dd016ae538 ("bond: pass get_ts_info and SIOC[SG]HWTSTAMP ioctl to active device") Signed-off-by: Hangbin Liu Signed-off-by: David S. Miller commit abc8dc34d1f6e34ed346c6e3fc554127e421b769 Author: Jerome Forissier Date: Thu Jan 13 16:27:13 2022 +0100 tee: optee: do not check memref size on return from Secure World Commit c650b8dc7a79 ("tee: optee: do not check memref size on return from Secure World") was mistakenly lost in commit 4602c5842f64 ("optee: refactor driver with internal callbacks"). Remove the unwanted code again. Fixes: 4602c5842f64 ("optee: refactor driver with internal callbacks") Signed-off-by: Jerome Forissier Reviewed-by: Sumit Garg Signed-off-by: Jens Wiklander commit 9decff5f403f9a48f639736ec0271e2870cadbb6 Author: Christophe JAILLET Date: Sun Dec 26 15:32:45 2021 +0100 optee: Use bitmap_free() to free bitmap kfree() and bitmap_free() are the same. But using the latter is more consistent when freeing memory allocated with bitmap_zalloc(). Signed-off-by: Christophe JAILLET Reviewed-by: Sumit Garg Signed-off-by: Jens Wiklander commit 2148927e6ed43a1667baf7c2ae3e0e05a44b51a0 Author: Marek Behún Date: Wed Jan 19 17:44:55 2022 +0100 net: sfp: ignore disabled SFP node Commit ce0aa27ff3f6 ("sfp: add sfp-bus to bridge between network devices and sfp cages") added code which finds SFP bus DT node even if the node is disabled with status = "disabled". Because of this, when phylink is created, it ends with non-null .sfp_bus member, even though the SFP module is not probed (because the node is disabled). We need to ignore disabled SFP bus node. Fixes: ce0aa27ff3f6 ("sfp: add sfp-bus to bridge between network devices and sfp cages") Signed-off-by: Marek Behún Cc: stable@vger.kernel.org # 2203cbf2c8b5 ("net: sfp: move fwnode parsing into sfp-bus layer") Signed-off-by: David S. Miller commit b8fb0d9b47660ddb8a8256412784aad7cee9f21a Author: Mario Limonciello Date: Thu Jan 20 11:44:39 2022 -0600 platform/x86: amd-pmc: Correct usage of SMU version Yellow carp has been outputting versions like `1093.24.0`, but this is supposed to be 69.24.0. That is the MSB is being interpreted incorrectly. The MSB is not part of the major version, but has generally been treated that way thus far. It's actually the program, and used to distinguish between two programs from a similar family but different codebase. Link: https://patchwork.freedesktop.org/patch/469993/ Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20220120174439.12770-1-mario.limonciello@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit f8c28b93d2628610cf793b3528f6f40fd1c7cd5b Author: Hans de Goede Date: Mon Jan 17 12:26:44 2022 +0100 platform/x86: asus-tf103c-dock: Make 2 global structs static tf103c_dock_hid_ll_driver and tf103c_dock_pm_ops are not used outside of the driver, make them both static. Reported-by: kernel test robot Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220117112644.260168-2-hdegoede@redhat.com commit f7086daab3b540c89951b9b4c00fc49111f7cfa6 Author: Hans de Goede Date: Mon Jan 17 12:26:43 2022 +0100 platform/x86: amd-pmc: Make amd_pmc_stb_debugfs_fops static amd_pmc_stb_debugfs_fops is not used outside of amd-pmc.c, make it static. Cc: Sanket Goswami Reported-by: kernel test robot Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220117112644.260168-1-hdegoede@redhat.com commit 17da2d5f93692086dd096a975225ffd5622d0bf8 Author: Srinivas Pandruvada Date: Tue Jan 11 18:25:21 2022 -0800 platform/x86: ISST: Fix possible circular locking dependency detected As reported: [ 256.104522] ====================================================== [ 256.113783] WARNING: possible circular locking dependency detected [ 256.120093] 5.16.0-rc6-yocto-standard+ #99 Not tainted [ 256.125362] ------------------------------------------------------ [ 256.131673] intel-speed-sel/844 is trying to acquire lock: [ 256.137290] ffffffffc036f0d0 (punit_misc_dev_lock){+.+.}-{3:3}, at: isst_if_open+0x18/0x90 [isst_if_common] [ 256.147171] [ 256.147171] but task is already holding lock: [ 256.153135] ffffffff8ee7cb50 (misc_mtx){+.+.}-{3:3}, at: misc_open+0x2a/0x170 [ 256.160407] [ 256.160407] which lock already depends on the new lock. [ 256.160407] [ 256.168712] [ 256.168712] the existing dependency chain (in reverse order) is: [ 256.176327] [ 256.176327] -> #1 (misc_mtx){+.+.}-{3:3}: [ 256.181946] lock_acquire+0x1e6/0x330 [ 256.186265] __mutex_lock+0x9b/0x9b0 [ 256.190497] mutex_lock_nested+0x1b/0x20 [ 256.195075] misc_register+0x32/0x1a0 [ 256.199390] isst_if_cdev_register+0x65/0x180 [isst_if_common] [ 256.205878] isst_if_probe+0x144/0x16e [isst_if_mmio] ... [ 256.241976] [ 256.241976] -> #0 (punit_misc_dev_lock){+.+.}-{3:3}: [ 256.248552] validate_chain+0xbc6/0x1750 [ 256.253131] __lock_acquire+0x88c/0xc10 [ 256.257618] lock_acquire+0x1e6/0x330 [ 256.261933] __mutex_lock+0x9b/0x9b0 [ 256.266165] mutex_lock_nested+0x1b/0x20 [ 256.270739] isst_if_open+0x18/0x90 [isst_if_common] [ 256.276356] misc_open+0x100/0x170 [ 256.280409] chrdev_open+0xa5/0x1e0 ... The call sequence suggested that misc_device /dev file can be opened before misc device is yet to be registered, which is done only once. Here punit_misc_dev_lock was used as common lock, to protect the registration by multiple ISST HW drivers, one time setup, prevent duplicate registry of misc device and prevent load/unload when device is open. We can split into locks: - One which just prevent duplicate call to misc_register() and one time setup. Also never call again if the misc_register() failed or required one time setup is failed. This lock is not shared with any misc device callbacks. - The other lock protects registry, load and unload of HW drivers. Sequence in isst_if_cdev_register() - Register callbacks under punit_misc_dev_open_lock - Call isst_misc_reg() which registers misc_device on the first registry which is under punit_misc_dev_reg_lock, which is not shared with callbacks. Sequence in isst_if_cdev_unregister Just opposite of isst_if_cdev_register Reported-and-tested-by: Liwei Song Signed-off-by: Srinivas Pandruvada Link: https://lore.kernel.org/r/20220112022521.54669-1-srinivas.pandruvada@linux.intel.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit a29012ab23163f78087a7e77719f05d201088700 Author: Hans de Goede Date: Wed Jan 12 00:23:09 2022 +0100 platform/x86: intel_crystal_cove_charger: Fix IRQ masking / unmasking The driver as originally submitted accidentally relied on Android having run before and Android having unmasked the 2nd level IRQ-mask for the charger IRQ. This worked since these are PMIC registers which are only reset when the battery is fully drained or disconnected. Fix the charger IRQ no longer working after loss of battery power by properly setting the 2nd level IRQ-mask for the charger IRQ. Note this removes the need to enable/disable our parent IRQ which just sets the mask bit in the 1st level IRQ-mask register, setting one of the 2 level masks is enough to stop the IRQ from getting reported. Fixes: 761db353d9e2 ("platform/x86: Add intel_crystal_cove_charger driver") Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220111232309.377642-1-hdegoede@redhat.com commit b288420e773f5a9db77115b9cc3767a8ada16648 Author: Alexander Kobel Date: Wed Jan 12 12:18:27 2022 +0100 platform/x86: thinkpad_acpi: Add quirk for ThinkPads without a fan Some ThinkPad models, like the X1 Tablet 1st and 2nd Gen, are passively cooled without any fan. Currently, an entry in /proc/acpi/ibm/fan is nevertheless created, and misleadingly shows status: enabled speed: 65535 level: auto This patch adds a TPACPI_FAN_NOFAN quirk definition and corresponding handling to not initialize a fan interface at all. For the time being, the quirk is only applied for X1 Tablet 2nd Gen (types 20JB, 20JC; EC N1O...); further models (such as Gen1, types 20GG and 20GH) can be added easily once tested. Tested on a 20JCS00C00, BIOS N1OET58W (1.43), EC N1OHT34W. Signed-off-by: Alexander Kobel Link: https://lore.kernel.org/r/12d4b825-a2b9-8cb7-6ed3-db4d66f46a60@a-kobel.de Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 512eb73cfd1208898cf10cb06094e0ee0bb53b58 Author: Yuka Kawajiri Date: Wed Jan 12 00:40:21 2022 +0900 platform/x86: touchscreen_dmi: Add info for the RWC NANOTE P8 AY07J 2-in-1 Add touchscreen info for RWC NANOTE P8 (AY07J) 2-in-1. Signed-off-by: Yuka Kawajiri Link: https://lore.kernel.org/r/20220111154019.4599-1-yukx00@gmail.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit c197e969e3082b9c19175d2f013a0dbd3ce52236 Author: Geert Uytterhoeven Date: Sat Jan 15 15:08:49 2022 +0100 platform/surface: Reinstate platform dependency Microsoft Surface platform-specific devices are only present on Microsoft Surface platforms, which are currently limited to arm64 and x86. Hence add a dependency on ARM64 || X86, to prevent asking the user about drivers for these devices when configuring a kernel for an architecture that does not support Microsoft Surface platforms. Fixes: 272479928172edf0 ("platform: surface: Propagate ACPI Dependency") Signed-off-by: Geert Uytterhoeven Acked-by: Maximilian Luz Link: https://lore.kernel.org/r/20220115140849.269479-1-geert@linux-m68k.org Signed-off-by: Hans de Goede commit 17f6736a020ef195f4855e807c76d2360310d143 Author: Lubomir Rintel Date: Mon Jan 10 07:36:29 2022 +0100 platform/x86: x86-android-tablets: Trivial typo fix for MODULE_AUTHOR Bring balance to the quoting of Hans' e-mail address. Signed-off-by: Lubomir Rintel Link: https://lore.kernel.org/r/20220110063629.273364-1-lkundrak@v3.sk Signed-off-by: Hans de Goede commit 5de2ffd5acd33368e472dd3255a51cac528c730e Author: Lubomir Rintel Date: Mon Jan 10 07:35:12 2022 +0100 platform/x86: x86-android-tablets: Fix the buttons on CZC P10T tablet This switches the P10T tablet to "Android" mode, where the Home button sends a single sancode instead of a Windows-specific key combination and the other button doesn't disable the Wi-Fi. Signed-off-by: Lubomir Rintel Link: https://lore.kernel.org/r/20220110063512.273252-1-lkundrak@v3.sk Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 442bf564eb0c4577d98a77e87caa10f704dddcad Author: Hans de Goede Date: Mon Jan 10 11:39:52 2022 +0100 platform/x86: x86-android-tablets: Constify the gpiod_lookup_tables arrays The individual gpiod_lookup_table structs cannot be const because they contain a list-head which gets used when registering them. But the array of pointers to the gpiod_lookup_table-s used by a board can be const, constify these. Signed-off-by: Hans de Goede Reviewed-By: Lubomir Rintel Link: https://lore.kernel.org/r/20220110103952.48760-3-hdegoede@redhat.com commit 84c2dcdd475f3f5d1d30c87404cafba4dd4b75ec Author: Hans de Goede Date: Mon Jan 10 11:39:51 2022 +0100 platform/x86: x86-android-tablets: Add an init() callback to struct x86_dev_info Add an init() callback to struct x86_dev_info, board descriptions can use this to do some custom setup before registering the i2c_clients, platform- devices and servdevs. Also add an exit() callback to also allow for cleanup of the custom setup. Signed-off-by: Hans de Goede Reviewed-By: Lubomir Rintel Link: https://lore.kernel.org/r/20220110103952.48760-2-hdegoede@redhat.com commit 4ce2a32d40260374dfce5344960c419fde23ce87 Author: Hans de Goede Date: Mon Jan 10 11:39:50 2022 +0100 platform/x86: x86-android-tablets: Add support for disabling ACPI _AEI handlers Some of the broken DSDTs on these devices often also include broken / wrong _AEI (ACPI Event Interrupt) handlers, which can cause e.g. interrupt storms by listening to a floating GPIO pin. Add support for disabling these and disable them on the Asus ME176C and TF103C tablets. Signed-off-by: Hans de Goede Reviewed-By: Lubomir Rintel Link: https://lore.kernel.org/r/20220110103952.48760-1-hdegoede@redhat.com commit ddec7abd4d93760ad5b2c7c61bf123a7707664ca Author: Hans de Goede Date: Tue Jan 11 11:07:08 2022 +0100 platform/x86: x86-android-tablets: Correct crystal_cove_charger module name The module was renamed to intel_crystal_cove_charger before it was merged, updated bq24190_modules to match. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220111100708.38585-1-hdegoede@redhat.com commit 278583055a237270fac70518275ba877bf9e4013 Author: Marc Zyngier Date: Fri Jan 21 18:42:07 2022 +0000 KVM: arm64: Use shadow SPSR_EL1 when injecting exceptions on !VHE Injecting an exception into a guest with non-VHE is risky business. Instead of writing in the shadow register for the switch code to restore it, we override the CPU register instead. Which gets overriden a few instructions later by said restore code. The result is that although the guest correctly gets the exception, it will return to the original context in some random state, depending on what was there the first place... Boo. Fix the issue by writing to the shadow register. The original code is absolutely fine on VHE, as the state is already loaded, and writing to the shadow register in that case would actually be a bug. Fixes: bb666c472ca2 ("KVM: arm64: Inject AArch64 exceptions from HYP") Cc: stable@vger.kernel.org Signed-off-by: Marc Zyngier Reviewed-by: Fuad Tabba Link: https://lore.kernel.org/r/20220121184207.423426-1-maz@kernel.org commit 8aa0f94b0a8d5304ea1bd63bf1ed06f9e395e328 Author: Randy Dunlap Date: Sat Jan 22 23:35:36 2022 -0800 gpio: sim: add doc file to index file Include the gpio-sim.rst file in the GPIO index (toc/table of contents). Quietens this doc build warning: Documentation/admin-guide/gpio/gpio-sim.rst: WARNING: document isn't included in any toctree Fixes: b48f6b466e44 ("gpio: sim: new testing module") Signed-off-by: Randy Dunlap Reported-by: Stephen Rothwell Signed-off-by: Bartosz Golaszewski commit dda8e14363f4f2bac0a1122322a35f47b5565d46 Author: Bartosz Golaszewski Date: Thu Jan 20 20:49:48 2022 +0100 gpio: sim: check the label length when setting up device properties If the user-space sets the chip label to an empty string - we should check the length and not override the default name or else line hogs will not be properly attached. Fixes: cb8c474e79be ("gpio: sim: new testing module") Signed-off-by: Bartosz Golaszewski commit c9bb19368b3ab111aedf3297e65bf84c9d3aa005 Author: Heiko Carstens Date: Fri Dec 17 14:58:49 2021 +0100 s390: update defconfigs Signed-off-by: Heiko Carstens commit 90c5318795eefa09a9f9aef8d18a904e24962b5c Author: Ilya Leoshkevich Date: Wed Jan 19 19:26:38 2022 +0100 s390/module: test loading modules with a lot of relocations Add a test in order to prevent regressions. Signed-off-by: Ilya Leoshkevich Reviewed-by: Heiko Carstens Cc: Vasily Gorbik Cc: Christian Borntraeger Signed-off-by: Heiko Carstens commit f3b7e73b2c6619884351a3a0a7468642f852b8a2 Author: Ilya Leoshkevich Date: Wed Jan 19 19:26:37 2022 +0100 s390/module: fix loading modules with a lot of relocations If the size of the PLT entries generated by apply_rela() exceeds 64KiB, the first ones can no longer reach __jump_r1 with brc. Fix by using brcl. An alternative solution is to add a __jump_r1 copy after every 64KiB, however, the space savings are quite small and do not justify the additional complexity. Fixes: f19fbd5ed642 ("s390: introduce execute-trampolines for branches") Cc: stable@vger.kernel.org Reported-by: Andrea Righi Signed-off-by: Ilya Leoshkevich Reviewed-by: Heiko Carstens Cc: Vasily Gorbik Cc: Christian Borntraeger Signed-off-by: Heiko Carstens commit 817b8b9c5396d2b2d92311b46719aad5d3339dbe Author: Dongliang Mu Date: Sat Jan 22 17:48:26 2022 +0800 HID: elo: fix memory leak in elo_probe When hid_parse() in elo_probe() fails, it forgets to call usb_put_dev to decrease the refcount. Fix this by adding usb_put_dev() in the error handling code of elo_probe(). Fixes: fbf42729d0e9 ("HID: elo: update the reference count of the usb device structure") Reported-by: syzkaller Signed-off-by: Dongliang Mu Signed-off-by: Jiri Kosina commit fb6433b48a178d4672cb26632454ee0b21056eaa Author: Athira Rajeev Date: Sat Jan 22 09:04:29 2022 +0530 powerpc/perf: Fix power_pmu_disable to call clear_pmi_irq_pending only if PMI is pending Running selftest with CONFIG_PPC_IRQ_SOFT_MASK_DEBUG enabled in kernel triggered below warning: [ 172.851380] ------------[ cut here ]------------ [ 172.851391] WARNING: CPU: 8 PID: 2901 at arch/powerpc/include/asm/hw_irq.h:246 power_pmu_disable+0x270/0x280 [ 172.851402] Modules linked in: dm_mod bonding nft_ct nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 ip_set nf_tables rfkill nfnetlink sunrpc xfs libcrc32c pseries_rng xts vmx_crypto uio_pdrv_genirq uio sch_fq_codel ip_tables ext4 mbcache jbd2 sd_mod t10_pi sg ibmvscsi ibmveth scsi_transport_srp fuse [ 172.851442] CPU: 8 PID: 2901 Comm: lost_exception_ Not tainted 5.16.0-rc5-03218-g798527287598 #2 [ 172.851451] NIP: c00000000013d600 LR: c00000000013d5a4 CTR: c00000000013b180 [ 172.851458] REGS: c000000017687860 TRAP: 0700 Not tainted (5.16.0-rc5-03218-g798527287598) [ 172.851465] MSR: 8000000000029033 CR: 48004884 XER: 20040000 [ 172.851482] CFAR: c00000000013d5b4 IRQMASK: 1 [ 172.851482] GPR00: c00000000013d5a4 c000000017687b00 c000000002a10600 0000000000000004 [ 172.851482] GPR04: 0000000082004000 c0000008ba08f0a8 0000000000000000 00000008b7ed0000 [ 172.851482] GPR08: 00000000446194f6 0000000000008000 c00000000013b118 c000000000d58e68 [ 172.851482] GPR12: c00000000013d390 c00000001ec54a80 0000000000000000 0000000000000000 [ 172.851482] GPR16: 0000000000000000 0000000000000000 c000000015d5c708 c0000000025396d0 [ 172.851482] GPR20: 0000000000000000 0000000000000000 c00000000a3bbf40 0000000000000003 [ 172.851482] GPR24: 0000000000000000 c0000008ba097400 c0000000161e0d00 c00000000a3bb600 [ 172.851482] GPR28: c000000015d5c700 0000000000000001 0000000082384090 c0000008ba0020d8 [ 172.851549] NIP [c00000000013d600] power_pmu_disable+0x270/0x280 [ 172.851557] LR [c00000000013d5a4] power_pmu_disable+0x214/0x280 [ 172.851565] Call Trace: [ 172.851568] [c000000017687b00] [c00000000013d5a4] power_pmu_disable+0x214/0x280 (unreliable) [ 172.851579] [c000000017687b40] [c0000000003403ac] perf_pmu_disable+0x4c/0x60 [ 172.851588] [c000000017687b60] [c0000000003445e4] __perf_event_task_sched_out+0x1d4/0x660 [ 172.851596] [c000000017687c50] [c000000000d1175c] __schedule+0xbcc/0x12a0 [ 172.851602] [c000000017687d60] [c000000000d11ea8] schedule+0x78/0x140 [ 172.851608] [c000000017687d90] [c0000000001a8080] sys_sched_yield+0x20/0x40 [ 172.851615] [c000000017687db0] [c0000000000334dc] system_call_exception+0x18c/0x380 [ 172.851622] [c000000017687e10] [c00000000000c74c] system_call_common+0xec/0x268 The warning indicates that MSR_EE being set(interrupt enabled) when there was an overflown PMC detected. This could happen in power_pmu_disable since it runs under interrupt soft disable condition ( local_irq_save ) and not with interrupts hard disabled. commit 2c9ac51b850d ("powerpc/perf: Fix PMU callbacks to clear pending PMI before resetting an overflown PMC") intended to clear PMI pending bit in Paca when disabling the PMU. It could happen that PMC gets overflown while code is in power_pmu_disable callback function. Hence add a check to see if PMI pending bit is set in Paca before clearing it via clear_pmi_pending. Fixes: 2c9ac51b850d ("powerpc/perf: Fix PMU callbacks to clear pending PMI before resetting an overflown PMC") Reported-by: Sachin Sant Signed-off-by: Athira Rajeev Tested-by: Sachin Sant Reviewed-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220122033429.25395-1-atrajeev@linux.vnet.ibm.com commit aec982603aa8cc0a21143681feb5f60ecc69d718 Author: Christophe Leroy Date: Mon Dec 6 11:11:51 2021 +0000 powerpc/fixmap: Fix VM debug warning on unmap Unmapping a fixmap entry is done by calling __set_fixmap() with FIXMAP_PAGE_CLEAR as flags. Today, powerpc __set_fixmap() calls map_kernel_page(). map_kernel_page() is not happy when called a second time for the same page. WARNING: CPU: 0 PID: 1 at arch/powerpc/mm/pgtable.c:194 set_pte_at+0xc/0x1e8 CPU: 0 PID: 1 Comm: swapper Not tainted 5.16.0-rc3-s3k-dev-01993-g350ff07feb7d-dirty #682 NIP: c0017cd4 LR: c00187f0 CTR: 00000010 REGS: e1011d50 TRAP: 0700 Not tainted (5.16.0-rc3-s3k-dev-01993-g350ff07feb7d-dirty) MSR: 00029032 CR: 42000208 XER: 00000000 GPR00: c0165fec e1011e10 c14c0000 c0ee2550 ff800000 c0f3d000 00000000 c001686c GPR08: 00001000 b00045a9 00000001 c0f58460 c0f50000 00000000 c0007e10 00000000 GPR16: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 GPR24: 00000000 00000000 c0ee2550 00000000 c0f57000 00000ff8 00000000 ff800000 NIP [c0017cd4] set_pte_at+0xc/0x1e8 LR [c00187f0] map_kernel_page+0x9c/0x100 Call Trace: [e1011e10] [c0736c68] vsnprintf+0x358/0x6c8 (unreliable) [e1011e30] [c0165fec] __set_fixmap+0x30/0x44 [e1011e40] [c0c13bdc] early_iounmap+0x11c/0x170 [e1011e70] [c0c06cb0] ioremap_legacy_serial_console+0x88/0xc0 [e1011e90] [c0c03634] do_one_initcall+0x80/0x178 [e1011ef0] [c0c0385c] kernel_init_freeable+0xb4/0x250 [e1011f20] [c0007e34] kernel_init+0x24/0x140 [e1011f30] [c0016268] ret_from_kernel_thread+0x5c/0x64 Instruction dump: 7fe3fb78 48019689 80010014 7c630034 83e1000c 5463d97e 7c0803a6 38210010 4e800020 81250000 712a0001 41820008 <0fe00000> 9421ffe0 93e1001c 48000030 Implement unmap_kernel_page() which clears an existing pte. Reported-by: Maxime Bizon Signed-off-by: Christophe Leroy Tested-by: Maxime Bizon Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/b0b752f6f6ecc60653e873f385c6f0dce4e9ab6a.1638789098.git.christophe.leroy@csgroup.eu commit 29afbd769ca338fa14cbfbbc824f7dc457ed7f2e Author: Dan Carpenter Date: Sat Jan 15 14:51:46 2022 +0300 phy: cadence: Sierra: fix error handling bugs in probe() There are two bugs in the error handling: 1: If devm_of_phy_provider_register() fails then there was no cleanup. 2: The error handling called of_node_put(child) improperly leading to a use after free. We are only holding the reference inside the loop so the last two gotos after the loop lead to a use after free bug. Fix this by cleaning up the partial allocations (or partial iterations) in the loop before doing the goto. Fixes: a43f72ae136a ("phy: cadence: Sierra: Change MAX_LANES of Sierra to 16") Fixes: 44d30d622821 ("phy: cadence: Add driver for Sierra PHY") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20220115115146.GC7552@kili Signed-off-by: Vinod Koul commit 6d1e6bcb31663ee83aaea1f171f3dbfe95dd4a69 Author: Kishon Vijay Abraham I Date: Mon Jan 17 16:31:08 2022 +0530 phy: ti: Fix missing sentinel for clk_div_table _get_table_maxdiv() tries to access "clk_div_table" array out of bound defined in phy-j721e-wiz.c. Add a sentinel entry to prevent the following global-out-of-bounds error reported by enabling KASAN. [ 9.552392] BUG: KASAN: global-out-of-bounds in _get_maxdiv+0xc0/0x148 [ 9.558948] Read of size 4 at addr ffff8000095b25a4 by task kworker/u4:1/38 [ 9.565926] [ 9.567441] CPU: 1 PID: 38 Comm: kworker/u4:1 Not tainted 5.16.0-116492-gdaadb3bd0e8d-dirty #360 [ 9.576242] Hardware name: Texas Instruments J721e EVM (DT) [ 9.581832] Workqueue: events_unbound deferred_probe_work_func [ 9.587708] Call trace: [ 9.590174] dump_backtrace+0x20c/0x218 [ 9.594038] show_stack+0x18/0x68 [ 9.597375] dump_stack_lvl+0x9c/0xd8 [ 9.601062] print_address_description.constprop.0+0x78/0x334 [ 9.606830] kasan_report+0x1f0/0x260 [ 9.610517] __asan_load4+0x9c/0xd8 [ 9.614030] _get_maxdiv+0xc0/0x148 [ 9.617540] divider_determine_rate+0x88/0x488 [ 9.622005] divider_round_rate_parent+0xc8/0x124 [ 9.626729] wiz_clk_div_round_rate+0x54/0x68 [ 9.631113] clk_core_determine_round_nolock+0x124/0x158 [ 9.636448] clk_core_round_rate_nolock+0x68/0x138 [ 9.641260] clk_core_set_rate_nolock+0x268/0x3a8 [ 9.645987] clk_set_rate+0x50/0xa8 [ 9.649499] cdns_sierra_phy_init+0x88/0x248 [ 9.653794] phy_init+0x98/0x108 [ 9.657046] cdns_pcie_enable_phy+0xa0/0x170 [ 9.661340] cdns_pcie_init_phy+0x250/0x2b0 [ 9.665546] j721e_pcie_probe+0x4b8/0x798 [ 9.669579] platform_probe+0x8c/0x108 [ 9.673350] really_probe+0x114/0x630 [ 9.677037] __driver_probe_device+0x18c/0x220 [ 9.681505] driver_probe_device+0xac/0x150 [ 9.685712] __device_attach_driver+0xec/0x170 [ 9.690178] bus_for_each_drv+0xf0/0x158 [ 9.694124] __device_attach+0x184/0x210 [ 9.698070] device_initial_probe+0x14/0x20 [ 9.702277] bus_probe_device+0xec/0x100 [ 9.706223] deferred_probe_work_func+0x124/0x180 [ 9.710951] process_one_work+0x4b0/0xbc0 [ 9.714983] worker_thread+0x74/0x5d0 [ 9.718668] kthread+0x214/0x230 [ 9.721919] ret_from_fork+0x10/0x20 [ 9.725520] [ 9.727032] The buggy address belongs to the variable: [ 9.732183] clk_div_table+0x24/0x440 Fixes: 091876cc355d ("phy: ti: j721e-wiz: Add support for WIZ module present in TI J721E SoC") Cc: stable@vger.kernel.org # v5.10+ Signed-off-by: Kishon Vijay Abraham I Link: https://lore.kernel.org/r/20220117110108.4117-1-kishon@ti.com Signed-off-by: Vinod Koul commit c1ec0cabc36718efc7fe8b4157d41b82d08ec1d2 Author: Dan Carpenter Date: Fri Jan 21 14:55:43 2022 +0300 hwmon: (adt7470) Prevent divide by zero in adt7470_fan_write() The "val" variable is controlled by the user and comes from hwmon_attr_store(). The FAN_RPM_TO_PERIOD() macro divides by "val" so a zero will crash the system. Check for that and return -EINVAL. Negatives are also invalid so return -EINVAL for those too. Fixes: fc958a61ff6d ("hwmon: (adt7470) Convert to devm_hwmon_device_register_with_info API") Signed-off-by: Dan Carpenter Signed-off-by: Guenter Roeck commit f1e75e0d6a1ae02fa4189d7aeebab623bade2a21 Author: Guenter Roeck Date: Tue Jan 18 07:53:19 2022 -0800 hwmon: (pmbus/ir38064) Mark ir38064_of_match as __maybe_unused If CONFIG_PM is not enabled, the following warning is reported. drivers/hwmon/pmbus/ir38064.c:54:34: warning: unused variable 'ir38064_of_match' Mark it as __maybe_unused. Reported-by: kernel test robot Cc: Arthur Heymans Signed-off-by: Guenter Roeck commit d379880d9adb9f1ada3f1266aa49ea2561328e08 Author: Guenter Roeck Date: Mon Jan 10 23:23:31 2022 -0800 hwmon: (lm90) Fix sysfs and udev notifications sysfs and udev notifications need to be sent to the _alarm attributes, not to the value attributes. Fixes: 94dbd23ed88c ("hwmon: (lm90) Use hwmon_notify_event()") Cc: Dmitry Osipenko Signed-off-by: Guenter Roeck commit f614629f9c1080dcc844a8430e3fb4c37ebbf05d Author: Guenter Roeck Date: Fri Jan 7 12:36:41 2022 -0800 hwmon: (lm90) Mark alert as broken for MAX6646/6647/6649 Experiments with MAX6646 and MAX6648 show that the alert function of those chips is broken, similar to other chips supported by the lm90 driver. Mark it accordingly. Fixes: 4667bcb8d8fc ("hwmon: (lm90) Introduce chip parameter structure") Signed-off-by: Guenter Roeck commit 94746b0ba479743355e0d3cc1cb9cfe3011fb8be Author: Guenter Roeck Date: Fri Jan 7 11:11:00 2022 -0800 hwmon: (lm90) Mark alert as broken for MAX6680 Experiments with MAX6680 and MAX6681 show that the alert function of those chips is broken, similar to other chips supported by the lm90 driver. Mark it accordingly. Fixes: 4667bcb8d8fc ("hwmon: (lm90) Introduce chip parameter structure") Signed-off-by: Guenter Roeck commit a53fff96f35763d132a36c620b183fdf11022d7a Author: Guenter Roeck Date: Fri Jan 7 11:05:23 2022 -0800 hwmon: (lm90) Mark alert as broken for MAX6654 Experiments with MAX6654 show that its alert function is broken, similar to other chips supported by the lm90 driver. Mark it accordingly. Fixes: 229d495d8189 ("hwmon: (lm90) Add max6654 support to lm90 driver") Cc: Josh Lehan Signed-off-by: Guenter Roeck commit bc341a1a98827925082e95db174734fc8bd68af6 Author: Guenter Roeck Date: Sat Jan 8 11:37:19 2022 -0800 hwmon: (lm90) Re-enable interrupts after alert clears If alert handling is broken, interrupts are disabled after an alert and re-enabled after the alert clears. However, if there is an interrupt handler, this does not apply if alerts were originally disabled and enabled when the driver was loaded. In that case, interrupts will stay disabled after an alert was handled though the alert handler even after the alert condition clears. Address the situation by always re-enabling interrupts after the alert condition clears if there is an interrupt handler. Fixes: 2abdc357c55d9 ("hwmon: (lm90) Unmask hardware interrupt") Cc: Dmitry Osipenko Signed-off-by: Guenter Roeck commit a66c5ed539277b9f2363bbace0dba88b85b36c26 Author: Guenter Roeck Date: Thu Jan 6 11:48:52 2022 -0800 hwmon: (lm90) Reduce maximum conversion rate for G781 According to its datasheet, G781 supports a maximum conversion rate value of 8 (62.5 ms). However, chips labeled G781 and G780 were found to only support a maximum conversion rate value of 7 (125 ms). On the other side, chips labeled G781-1 and G784 were found to support a conversion rate value of 8. There is no known means to distinguish G780 from G781 or G784; all chips report the same manufacturer ID and chip revision. Setting the conversion rate register value to 8 on chips not supporting it causes unexpected behavior since the real conversion rate is set to 0 (16 seconds) if a value of 8 is written into the conversion rate register. Limit the conversion rate register value to 7 for all G78x chips to avoid the problem. Fixes: ae544f64cc7b ("hwmon: (lm90) Add support for GMT G781") Signed-off-by: Guenter Roeck commit 9ca8581e79e51c57e60b3b8e3b89d816448f49fe Author: Namjae Jeon Date: Sat Jan 22 10:47:22 2022 +0900 ksmbd: fix SMB 3.11 posix extension mount failure cifs client set 4 to DataLength of create_posix context, which mean Mode variable of create_posix context is only available. So buffer validation of ksmbd should check only the size of Mode except for the size of Reserved variable. Fixes: 8f77150c15f8 ("ksmbd: add buffer validation for SMB2_CREATE_CONTEXT") Cc: stable@vger.kernel.org # v5.15+ Reported-by: Steve French Tested-by: Steve French Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 1fd6bb5b47a65eacb063b37e6fa6df2b8fa92959 Author: Andre Przywara Date: Wed Jan 5 17:29:52 2022 +0000 pinctrl: sunxi: Fix H616 I2S3 pin data Two bugs have sneaked in the H616 pinctrl data: - PH9 uses the mux value of 0x3 twice (one should be 0x5 instead) - PH8 and PH9 use the "i2s3" function name twice in each pin For the double pin name we use the same trick we pulled for i2s0: append the pin function to the group name to designate the special function. Fixes: 25adc29407fb ("pinctrl: sunxi: Add support for the Allwinner H616 pin controller") Reported-by: SASANO Takayoshi Signed-off-by: Andre Przywara Reviewed-by: Jernej Skrabec Reviewed-by: Samuel Holland Link: https://lore.kernel.org/r/20220105172952.23347-1-andre.przywara@arm.com Signed-off-by: Linus Walleij commit aa28514592d52043f4837a6457d6310452135ae1 Author: Hans de Goede Date: Tue Jan 4 17:42:38 2022 +0100 pinctrl: cherryview: Trigger hwirq0 for interrupt-lines without a mapping Commit bdfbef2d29dc ("pinctrl: cherryview: Don't use selection 0 to mark an interrupt line as unused") made the code properly differentiate between unset vs (hwirq) 0 entries in the GPIO-controller interrupt-line to GPIO pinnumber/hwirq mapping. This is causing some boards to not boot. This commit restores the old behavior of triggering hwirq 0 when receiving an interrupt on an interrupt-line for which there is no mapping. Fixes: bdfbef2d29dc ("pinctrl: cherryview: Don't use selection 0 to mark an interrupt line as unused") Reported-and-tested-by: Jarkko Nikula Signed-off-by: Hans de Goede Acked-by: Andy Shevchenko Acked-by: Mika Westerberg Link: https://lore.kernel.org/r/20220104164238.253142-1-hdegoede@redhat.com Signed-off-by: Linus Walleij commit 25d2e41cf59bd6ccd23adc2965a157053bc3ed5c Author: Rafał Miłecki Date: Tue Jan 11 18:29:19 2022 +0100 pinctrl: thunderbay: rework loops looking for groups names Make the outer loop iterate over functions as that's the real subject. This simplifies code (and reduces amount of lines of code) as allocating memory for names doesn't require extra checks anymore. While at it use local "group_names" variable. It fixes: drivers/pinctrl/pinctrl-thunderbay.c: In function 'thunderbay_add_functions': drivers/pinctrl/pinctrl-thunderbay.c:815:8: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] 815 | grp = func->group_names; | ^ Ref: c26c4bfc1040 ("pinctrl: keembay: rework loops looking for groups names") Reported-by: Nathan Chancellor Signed-off-by: Rafał Miłecki Link: https://lore.kernel.org/r/20220111172919.6567-2-zajec5@gmail.com Signed-off-by: Linus Walleij commit 30cc53897470d45219fb0a5eafd0cc8b0032cd1e Author: Rafał Miłecki Date: Tue Jan 11 18:29:18 2022 +0100 pinctrl: thunderbay: comment process of building functions a bit This should make code a bit easier to follow. While at it use some "for" loops to simplify array iteration loops. Ref: 5d0674999cc5 ("pinctrl: keembay: comment process of building functions a bit") Signed-off-by: Rafał Miłecki Link: https://lore.kernel.org/r/20220111172919.6567-1-zajec5@gmail.com Signed-off-by: Linus Walleij commit 96d9d1fa5cd505078534113308ced0aa56d8da58 Author: Yanming Liu Date: Thu Jan 20 04:20:52 2022 +0800 Drivers: hv: balloon: account for vmbus packet header in max_pkt_size Commit adae1e931acd ("Drivers: hv: vmbus: Copy packets sent by Hyper-V out of the ring buffer") introduced a notion of maximum packet size in vmbus channel and used that size to initialize a buffer holding all incoming packet along with their vmbus packet header. hv_balloon uses the default maximum packet size VMBUS_DEFAULT_MAX_PKT_SIZE which matches its maximum message size, however vmbus_open expects this size to also include vmbus packet header. This leads to 4096 bytes dm_unballoon_request messages being truncated to 4080 bytes. When the driver tries to read next packet it starts from a wrong read_index, receives garbage and prints a lot of "Unhandled message: type: " in dmesg. Allocate the buffer with HV_HYP_PAGE_SIZE more bytes to make room for the header. Fixes: adae1e931acd ("Drivers: hv: vmbus: Copy packets sent by Hyper-V out of the ring buffer") Suggested-by: Michael Kelley (LINUX) Suggested-by: Andrea Parri (Microsoft) Signed-off-by: Yanming Liu Reviewed-by: Michael Kelley Reviewed-by: Andrea Parri (Microsoft) Link: https://lore.kernel.org/r/20220119202052.3006981-1-yanminglr@gmail.com Signed-off-by: Wei Liu commit 305325688ff924c52a6e12f92235a89536e022cf Author: Gustavo A. R. Silva Date: Thu Jan 20 17:02:47 2022 -0600 NTB/msi: Use struct_size() helper in devm_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. Also, address the following sparse warnings: drivers/ntb/msi.c:46:23: warning: using sizeof on a flexible structure Link: https://github.com/KSPP/linux/issues/174 Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Reviewed-by: Logan Gunthorpe Signed-off-by: Jon Mason commit 1f52b0aba6fd37653416375cb8a1ca673acf8d5f Author: Yazen Ghannam Date: Mon Jan 17 16:13:28 2022 +0000 x86/MCE/AMD: Allow thresholding interface updates after init Changes to the AMD Thresholding sysfs code prevents sysfs writes from updating the underlying registers once CPU init is completed, i.e. "threshold_banks" is set. Allow the registers to be updated if the thresholding interface is already initialized or if in the init path. Use the "set_lvt_off" value to indicate if running in the init path, since this value is only set during init. Fixes: a037f3ca0ea0 ("x86/mce/amd: Make threshold bank setting hotplug robust") Signed-off-by: Yazen Ghannam Signed-off-by: Borislav Petkov Cc: Link: https://lore.kernel.org/r/20220117161328.19148-1-yazen.ghannam@amd.com commit ccbed9d8d2a5351d8238f2d3f0741c9a3176f752 Author: Sean Nyekjaer Date: Mon Dec 20 13:51:43 2021 +0100 iio: accel: fxls8962af: add padding to regmap for SPI Add missing don't care padding between address and data for SPI transfers Fixes: a3e0b51884ee ("iio: accel: add support for FXLS8962AF/FXLS8964AF accelerometers") Signed-off-by: Sean Nyekjaer Link: https://lore.kernel.org/r/20211220125144.3630539-1-sean@geanix.com Cc: Signed-off-by: Jonathan Cameron commit b0e85f95e30d4d2dc22ea123a30dba36406879a1 Author: Nuno Sá Date: Fri Jan 14 14:26:08 2022 +0100 iio:imu:adis16480: fix buffering for devices with no burst mode The trigger handler defined in the driver assumes that burst mode is being used. Hence, for devices that do not support it, we have to use the adis library default trigger implementation. Tested-by: Julia Pineda Fixes: 941f130881fa9 ("iio: adis16480: support burst read function") Signed-off-by: Nuno Sá Link: https://lore.kernel.org/r/20220114132608.241-1-nuno.sa@analog.com Cc: Signed-off-by: Jonathan Cameron commit 0e33d15f1dce9e3a80a970ea7f0b27837168aeca Author: Cosmin Tanislav Date: Wed Jan 12 22:00:36 2022 +0200 iio: adc: ad7124: fix mask used for setting AIN_BUFP & AIN_BUFM bits According to page 90 of the datasheet [1], AIN_BUFP is bit 6 and AIN_BUFM is bit 5 of the CONFIG_0 -> CONFIG_7 registers. Fix the mask used for setting these bits. [1]: https://www.analog.com/media/en/technical-documentation/data-sheets/ad7124-8.pdf Fixes: 0eaecea6e487 ("iio: adc: ad7124: Add buffered input support") Signed-off-by: Cosmin Tanislav Link: https://lore.kernel.org/r/20220112200036.694490-1-cosmin.tanislav@analog.com Cc: Signed-off-by: Jonathan Cameron commit b7a78a8adaa8849c02f174d707aead0f85dca0da Author: Oleksij Rempel Date: Fri Jan 7 09:14:01 2022 +0100 iio: adc: tsc2046: fix memory corruption by preventing array overflow On one side we have indio_dev->num_channels includes all physical channels + timestamp channel. On other side we have an array allocated only for physical channels. So, fix memory corruption by ARRAY_SIZE() instead of num_channels variable. Note the first case is a cleanup rather than a fix as the software timestamp channel bit in active_scanmask is never set by the IIO core. Fixes: 9374e8f5a38d ("iio: adc: add ADC driver for the TI TSC2046 controller") Signed-off-by: Oleksij Rempel Link: https://lore.kernel.org/r/20220107081401.2816357-1-o.rempel@pengutronix.de Cc: Signed-off-by: Jonathan Cameron commit 442b0c08db7e35980bed6af091877f4dda72ffca Author: Sam Protsenko Date: Fri Jan 14 16:46:06 2022 +0200 soc: samsung: Fix typo in CONFIG_EXYNOS_USI description The proper name is Exynos Auto V9, not V0. It was the typo slipped in unnoticed, fix it. Fixes: b603377e408f ("soc: samsung: Add USI driver") Signed-off-by: Sam Protsenko Reviewed-by: Chanho Park Link: https://lore.kernel.org/r/20220114144606.24358-1-semen.protsenko@linaro.org Signed-off-by: Krzysztof Kozlowski commit 94bfe2bdfc5059a0870447ccf2c8048f3d016898 Author: Alim Akhtar Date: Wed Jan 5 22:13:41 2022 +0530 MAINTAINERS: add reviewer entry for Samsung/Exynos platform Adds myself as reviewer for Samsung/Exynos platform to help in review of current and upcoming SoCs patches. Signed-off-by: Alim Akhtar Acked-by: Sylwester Nawrocki Link: https://lore.kernel.org/r/20220105164341.27479-1-alim.akhtar@samsung.com Signed-off-by: Krzysztof Kozlowski commit 83114df32ae779df57e0af99a8ba6c3968b2ba3d Author: Miaoqian Lin Date: Thu Jan 20 10:10:25 2022 +0000 block: fix memory leak in disk_register_independent_access_ranges kobject_init_and_add() takes reference even when it fails. According to the doc of kobject_init_and_add() If this function returns an error, kobject_put() must be called to properly clean up the memory associated with the object. Fix this issue by adding kobject_put(). Callback function blk_ia_ranges_sysfs_release() in kobject_put() can handle the pointer "iars" properly. Fixes: a2247f19ee1c ("block: Add independent access ranges support") Signed-off-by: Miaoqian Lin Reviewed-by: Damien Le Moal Link: https://lore.kernel.org/r/20220120101025.22411-1-linmq006@gmail.com Signed-off-by: Jens Axboe commit b36a2050040b2d839bdc044007cdd57101d7f881 Author: Dylan Yudaken Date: Fri Jan 21 04:38:56 2022 -0800 io_uring: fix bug in slow unregistering of nodes In some cases io_rsrc_ref_quiesce will call io_rsrc_node_switch_start, and then immediately flush the delayed work queue &ctx->rsrc_put_work. However the percpu_ref_put does not immediately destroy the node, it will be called asynchronously via RCU. That ends up with io_rsrc_node_ref_zero only being called after rsrc_put_work has been flushed, and so the process ends up sleeping for 1 second unnecessarily. This patch executes the put code immediately if we are busy quiescing. Fixes: 4a38aed2a0a7 ("io_uring: batch reap of dead file registrations") Signed-off-by: Dylan Yudaken Link: https://lore.kernel.org/r/20220121123856.3557884-1-dylany@fb.com Signed-off-by: Jens Axboe commit dd81e1c7d5fb126e5fbc5c9e334d7b3ec29a16a0 Merge: ac5a9bb6b4fa2 aee101d7b95a0 Author: Linus Torvalds Date: Sun Jan 23 17:52:42 2022 +0200 Merge tag 'powerpc-5.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fixes from Michael Ellerman: - A series of bpf fixes, including an oops fix and some codegen fixes. - Fix a regression in syscall_get_arch() for compat processes. - Fix boot failure on some 32-bit systems with KASAN enabled. - A couple of other build/minor fixes. Thanks to Athira Rajeev, Christophe Leroy, Dmitry V. Levin, Jiri Olsa, Johan Almbladh, Maxime Bizon, Naveen N. Rao, and Nicholas Piggin. * tag 'powerpc-5.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/64s: Mask SRR0 before checking against the masked NIP powerpc/perf: Only define power_pmu_wants_prompt_pmi() for CONFIG_PPC64 powerpc/32s: Fix kasan_init_region() for KASAN powerpc/time: Fix build failure due to do_hard_irq_enable() on PPC32 powerpc/audit: Fix syscall_get_arch() powerpc64/bpf: Limit 'ldbrx' to processors compliant with ISA v2.06 tools/bpf: Rename 'struct event' to avoid naming conflict powerpc/bpf: Update ldimm64 instructions during extra pass powerpc32/bpf: Fix codegen for bpf-to-bpf calls bpf: Guard against accessing NULL pt_regs in bpf_get_task_stack() commit ac5a9bb6b4fa22135b3e371ac9787de120e18c8d Merge: 10c64a0f28063 a0af3d1104f75 Author: Linus Torvalds Date: Sun Jan 23 17:45:00 2022 +0200 Merge tag 'irq_urgent_for_v5.17_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull irq fix from Borislav Petkov: "A single use-after-free fix in the PCI MSI irq domain allocation path" * tag 'irq_urgent_for_v5.17_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: PCI/MSI: Prevent UAF in error path commit 10c64a0f280636652ec63bb1ddd34b6c8e2f5584 Merge: 0f9e042212273 0e3872499de1a Author: Linus Torvalds Date: Sun Jan 23 17:35:27 2022 +0200 Merge tag 'sched_urgent_for_v5.17_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull scheduler fixes from Borislav Petkov: "A bunch of fixes: forced idle time accounting, utilization values propagation in the sched hierarchies and other minor cleanups and improvements" * tag 'sched_urgent_for_v5.17_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: kernel/sched: Remove dl_boosted flag comment sched: Avoid double preemption in __cond_resched_*lock*() sched/fair: Fix all kernel-doc warnings sched/core: Accounting forceidle time for all tasks except idle task sched/pelt: Relax the sync of load_sum with load_avg sched/pelt: Relax the sync of runnable_sum with runnable_avg sched/pelt: Continue to relax the sync of util_sum with util_avg sched/pelt: Relax the sync of util_sum with util_avg psi: Fix uaf issue when psi trigger is destroyed while being polled commit 0f9e04221227302d665bf64c69e5308360f4f88a Merge: e783362eb54cd 8c16dc047b5dd Author: Linus Torvalds Date: Sun Jan 23 17:31:24 2022 +0200 Merge tag 'perf_urgent_for_v5.17_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull perf fixes from Borislav Petkov: - Add support for accessing the general purpose counters on Alder Lake via MMIO - Add new LBR format v7 support which is v5 modulo TSX - Fix counter enumeration on Alder Lake hybrids - Overhaul how context time updates are done and get rid of perf_event::shadow_ctx_time. - The usual amount of fixes: event mask correction, supported event types reporting, etc. * tag 'perf_urgent_for_v5.17_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/perf: Avoid warning for Arch LBR without XSAVE perf/x86/intel/uncore: Add IMC uncore support for ADL perf/x86/intel/lbr: Add static_branch for LBR INFO flags perf/x86/intel/lbr: Support LBR format V7 perf/x86/rapl: fix AMD event handling perf/x86/intel/uncore: Fix CAS_COUNT_WRITE issue for ICX perf/x86/intel: Add a quirk for the calculation of the number of counters on Alder Lake perf: Fix perf_event_read_local() time commit b5fbaf7d779f5f02b7f75b080e7707222573be2a Author: Brian Norris Date: Fri Jan 14 15:02:07 2022 -0800 arm64: dts: rockchip: Switch RK3399-Gru DP to SPDIF output Commit b18c6c3c7768 ("ASoC: rockchip: cdn-dp sound output use spdif") switched the platform to SPDIF, but we didn't fix up the device tree. Drop the pinctrl settings, because the 'spdif_bus' pins are either: * unused (on kevin, bob), so the settings is ~harmless * used by a different function (on scarlet), which causes probe failures (!!) Fixes: b18c6c3c7768 ("ASoC: rockchip: cdn-dp sound output use spdif") Signed-off-by: Brian Norris Reviewed-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20220114150129.v2.1.I46f64b00508d9dff34abe1c3e8d2defdab4ea1e5@changeid Signed-off-by: Heiko Stuebner commit ed2c66a95c0c5669880aa93d0d34c6e9694b4cbd Author: Quentin Schulz Date: Thu Jan 20 13:51:56 2022 +0100 arm64: dts: rockchip: fix rk3399-puma-haikou USB OTG mode The micro USB3.0 port available on the Haikou evaluation kit for Puma RK3399-Q7 SoM supports dual-role model (aka drd or OTG) but its support was broken until now because of missing logic around the ID pin. This adds proper support for USB OTG on Puma Haikou by "connecting" the GPIO used for USB ID to the USB3 controller device. Cc: Quentin Schulz Signed-off-by: Quentin Schulz Link: https://lore.kernel.org/r/20220120125156.16217-1-quentin.schulz@theobroma-systems.com Signed-off-by: Heiko Stuebner commit 5070ce86246a8a4ebacd0c15b121e6b6325bc167 Author: Al Cooper Date: Wed Dec 1 13:06:53 2021 -0500 phy: broadcom: Kconfig: Fix PHY_BRCM_USB config option The previous commit 4b402fa8e0b7 ("phy: phy-brcm-usb: support PHY on the BCM4908") added a second "default" line for ARCH_BCM_4908 above the original "default" line for ARCH_BRCMSTB. When two "default" lines are used, only the first is used and this change stopped the PHY_BRCM_USB option for being enabled for ARCH_BRCMSTB. The fix is to use one "default line with "||". Fixes: 4b402fa8e0b7 ("phy: phy-brcm-usb: support PHY on the BCM4908") Signed-off-by: Al Cooper Acked-by: Rafał Miłecki Acked-by: Florian Fainelli Link: https://lore.kernel.org/r/20211201180653.35097-4-alcooperx@gmail.com Signed-off-by: Vinod Koul commit 42fed57046fc74586d7058bd51a1c10ac9c690cb Author: Al Cooper Date: Wed Dec 1 13:06:51 2021 -0500 phy: usb: Leave some clocks running during suspend The PHY client driver does a phy_exit() call on suspend or rmmod and the PHY driver needs to know the difference because some clocks need to be kept running for suspend but can be shutdown on unbind/rmmod (or if there are no PHY clients at all). The fix is to use a PM notifier so the driver can tell if a PHY client is calling exit() because of a system suspend or a driver unbind/rmmod. Signed-off-by: Al Cooper Acked-by: Florian Fainelli Link: https://lore.kernel.org/r/20211201180653.35097-2-alcooperx@gmail.com Signed-off-by: Vinod Koul commit 85a8bccfa945680dc561f06b65ea01341d2033fc Author: Frank Wunderlich Date: Sun Jan 23 14:35:10 2022 +0100 arm64: dts: rockchip: drop pclk_xpcs from gmac0 on rk3568 pclk_xpcs is not supported by mainline driver and breaks dtbs_check following warnings occour, and many more rk3568-evb1-v10.dt.yaml: ethernet@fe2a0000: clocks: [[15, 386], [15, 389], [15, 389], [15, 184], [15, 180], [15, 181], [15, 389], [15, 185], [15, 172]] is too long From schema: Documentation/devicetree/bindings/net/snps,dwmac.yaml rk3568-evb1-v10.dt.yaml: ethernet@fe2a0000: clock-names: ['stmmaceth', 'mac_clk_rx', 'mac_clk_tx', 'clk_mac_refout', 'aclk_mac', 'pclk_mac', 'clk_mac_speed', 'ptp_ref', 'pclk_xpcs'] is too long From schema: Documentation/devicetree/bindings/net/snps,dwmac.yaml after removing it, the clock and other warnings are gone. pclk_xpcs on gmac is used to support QSGMII, but this requires a driver supporting it. Once xpcs support is introduced, the clock can be added to the documentation and both controllers. Fixes: b8d41e5053cd ("arm64: dts: rockchip: add gmac0 node to rk3568") Co-developed-by: Peter Geis Signed-off-by: Peter Geis Signed-off-by: Frank Wunderlich Acked-by: Michael Riesch Link: https://lore.kernel.org/r/20220123133510.135651-1-linux@fw-web.de Signed-off-by: Heiko Stuebner commit 2ddd96aadbd0412040ef49eda94549c32de6c92c Author: Frank Wunderlich Date: Sun Jan 23 14:36:15 2022 +0100 arm64: dts: rockchip: fix dma-controller node names on rk356x DMA-Cotrollers defined in rk356x.dtsi do not match the pattern in bindings. arch/arm64/boot/dts/rockchip/rk3568-evb1-v10.dt.yaml: dmac@fe530000: $nodename:0: 'dmac@fe530000' does not match '^dma-controller(@.*)?$' From schema: Documentation/devicetree/bindings/dma/arm,pl330.yaml arch/arm64/boot/dts/rockchip/rk3568-evb1-v10.dt.yaml: dmac@fe550000: $nodename:0: 'dmac@fe550000' does not match '^dma-controller(@.*)?$' From schema: Documentation/devicetree/bindings/dma/arm,pl330.yaml This Patch fixes it. Signed-off-by: Frank Wunderlich Link: https://lore.kernel.org/r/20220123133615.135789-1-linux@fw-web.de Signed-off-by: Heiko Stuebner commit f5390cd0b43c2e54c7cf5506c7da4a37c5cef746 Author: Ard Biesheuvel Date: Wed Jan 12 11:14:13 2022 +0100 efi: runtime: avoid EFIv2 runtime services on Apple x86 machines Aditya reports [0] that his recent MacbookPro crashes in the firmware when using the variable services at runtime. The culprit appears to be a call to QueryVariableInfo(), which we did not use to call on Apple x86 machines in the past as they only upgraded from EFI v1.10 to EFI v2.40 firmware fairly recently, and QueryVariableInfo() (along with UpdateCapsule() et al) was added in EFI v2.00. The only runtime service introduced in EFI v2.00 that we actually use in Linux is QueryVariableInfo(), as the capsule based ones are optional, generally not used at runtime (all the LVFS/fwupd firmware update infrastructure uses helper EFI programs that invoke capsule update at boot time, not runtime), and not implemented by Apple machines in the first place. QueryVariableInfo() is used to 'safely' set variables, i.e., only when there is enough space. This prevents machines with buggy firmwares from corrupting their NVRAMs when they run out of space. Given that Apple machines have been using EFI v1.10 services only for the longest time (the EFI v2.0 spec was released in 2006, and Linux support for the newly introduced runtime services was added in 2011, but the MacbookPro12,1 released in 2015 still claims to be EFI v1.10 only), let's avoid the EFI v2.0 ones on all Apple x86 machines. [0] https://lore.kernel.org/all/6D757C75-65B1-468B-842D-10410081A8E4@live.com/ Cc: Cc: Jeremy Kerr Cc: Matthew Garrett Reported-by: Aditya Garg Tested-by: Orlando Chamberlain Signed-off-by: Ard Biesheuvel Tested-by: Aditya Garg Link: https://bugzilla.kernel.org/show_bug.cgi?id=215277 commit e9b7c3a4263bdcfd31bc3d03d48ce0ded7a94635 Author: Mihai Carabas Date: Wed Jan 19 18:14:27 2022 +0200 efi/libstub: arm64: Fix image check alignment at entry The kernel is aligned at SEGMENT_SIZE and this is the size populated in the PE headers: arch/arm64/kernel/efi-header.S: .long SEGMENT_ALIGN // SectionAlignment EFI_KIMG_ALIGN is defined as: (SEGMENT_ALIGN > THREAD_ALIGN ? SEGMENT_ALIGN : THREAD_ALIGN) So it depends on THREAD_ALIGN. On newer builds this message started to appear even though the loader is taking into account the PE header (which is stating SEGMENT_ALIGN). Fixes: c32ac11da3f8 ("efi/libstub: arm64: Double check image alignment at entry") Signed-off-by: Mihai Carabas Signed-off-by: Ard Biesheuvel commit 3d787b392d169d4a2e3aee6ac6dfd6ec39722cf2 Author: Heiko Carstens Date: Sat Jan 22 10:24:31 2022 +0100 s390/uaccess: fix compile error Compiling with e.g MARCH=z900 results in compile errors: arch/s390/lib/uaccess.c: In function 'copy_from_user_mvcos': >> arch/s390/lib/uaccess.c:65:15: error: variable 'spec' has initializer but incomplete type 65 | union oac spec = { Therefore make definition of union oac visible for all MARCHs. Reported-by: kernel test robot Cc: Nico Boehr Cc: Janis Schoetterl-Glausch Fixes: 012a224e1fa3 ("s390/uaccess: introduce bit field for OAC specifier") Signed-off-by: Heiko Carstens commit f094a39c6ba168f2df1edfd1731cca377af5f442 Author: Christian Borntraeger Date: Mon Jan 17 18:40:32 2022 +0100 s390/nmi: handle vector validity failures for KVM guests The machine check validity bit tells about the context. If a KVM guest was running the bit tells about the guest validity and the host state is not affected. As a guest can disable the guest validity this might result in unwanted host errors on machine checks. Cc: stable@vger.kernel.org Fixes: c929500d7a5a ("s390/nmi: s390: New low level handling for machine check happening in guest") Signed-off-by: Christian Borntraeger Reviewed-by: Heiko Carstens Signed-off-by: Heiko Carstens commit 1ea1d6a847d2b1d17fefd9196664b95f052a0775 Author: Christian Borntraeger Date: Thu Jan 13 11:44:19 2022 +0100 s390/nmi: handle guarded storage validity failures for KVM guests machine check validity bits reflect the state of the machine check. If a guest does not make use of guarded storage, the validity bit might be off. We can not use the host CR bit to decide if the validity bit must be on. So ignore "invalid" guarded storage controls for KVM guests in the host and rely on the machine check being forwarded to the guest. If no other errors happen from a host perspective everything is fine and no process must be killed and the host can continue to run. Cc: stable@vger.kernel.org Fixes: c929500d7a5a ("s390/nmi: s390: New low level handling for machine check happening in guest") Reported-by: Carsten Otte Signed-off-by: Christian Borntraeger Tested-by: Carsten Otte Reviewed-by: Heiko Carstens Signed-off-by: Heiko Carstens commit e783362eb54cd99b2cac8b3a9aeac942e6f6ac07 Author: Linus Torvalds Date: Sun Jan 23 10:12:53 2022 +0200 Linux 5.17-rc1 commit 40c843218f11625722e9a7c3ced81a83b95ecf05 Merge: 67bfce0e01927 f0ac5b85810a6 Author: Linus Torvalds Date: Sun Jan 23 08:14:21 2022 +0200 Merge tag 'perf-tools-for-v5.17-2022-01-22' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux Pull more perf tools updates from Arnaldo Carvalho de Melo: - Fix printing 'phys_addr' in 'perf script'. - Fix failure to add events with 'perf probe' in ppc64 due to not removing leading dot (ppc64 ABIv1). - Fix cpu_map__item() python binding building. - Support event alias in form foo-bar-baz, add pmu-events and parse-event tests for it. - No need to setup affinities when starting a workload or attaching to a pid. - Use path__join() to compose a path instead of ad-hoc snprintf() equivalent. - Override attr->sample_period for non-libpfm4 events. - Use libperf cpumap APIs instead of accessing the internal state directly. - Sync x86 arch prctl headers and files changed by the new set_mempolicy_home_node syscall with the kernel sources. - Remove duplicate include in cpumap.h. - Remove redundant err variable. * tag 'perf-tools-for-v5.17-2022-01-22' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: perf tools: Remove redundant err variable perf test: Add parse-events test for aliases with hyphens perf test: Add pmu-events test for aliases with hyphens perf parse-events: Support event alias in form foo-bar-baz perf evsel: Override attr->sample_period for non-libpfm4 events perf cpumap: Remove duplicate include in cpumap.h perf cpumap: Migrate to libperf cpumap api perf python: Fix cpu_map__item() building perf script: Fix printing 'phys_addr' failure issue tools headers UAPI: Sync files changed by new set_mempolicy_home_node syscall tools headers UAPI: Sync x86 arch prctl headers with the kernel sources perf machine: Use path__join() to compose a path instead of snprintf(dir, '/', filename) perf evlist: No need to setup affinities when disabling events for pid targets perf evlist: No need to setup affinities when enabling events for pid targets perf stat: No need to setup affinities when starting a workload perf affinity: Allow passing a NULL arg to affinity__cleanup() perf probe: Fix ppc64 'perf probe add events failed' case commit 67bfce0e01927859618b76ff5a36a7f23b412cef Merge: 473aec0e1f84b 6b9b6413700e1 Author: Linus Torvalds Date: Sun Jan 23 08:07:02 2022 +0200 Merge tag 'trace-v5.17-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull ftrace fix from Steven Rostedt: "Fix s390 breakage from sorting mcount tables. The latest merge of the tracing tree sorts the mcount table at build time. But s390 appears to do things differently (like always) and replaces the sorted table back to the original unsorted one. As the ftrace algorithm depends on it being sorted, bad things happen when it is not, and s390 experienced those bad things. Add a new config to tell the boot if the mcount table is sorted or not, and allow s390 to opt out of it" * tag 'trace-v5.17-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: ftrace: Fix assuming build time sort works for s390 commit 6b9b6413700e104934734b72a3be622a76923b98 Author: Steven Rostedt (Google) Date: Sat Jan 22 09:17:10 2022 -0500 ftrace: Fix assuming build time sort works for s390 To speed up the boot process, as mcount_loc needs to be sorted for ftrace to work properly, sorting it at build time is more efficient than boot up and can save milliseconds of time. Unfortunately, this change broke s390 as it will modify the mcount_loc location after the sorting takes place and will put back the unsorted locations. Since the sorting is skipped at boot up if it is believed that it was sorted at run time, ftrace can crash as its algorithms are dependent on the list being sorted. Add a new config BUILDTIME_MCOUNT_SORT that is set when BUILDTIME_TABLE_SORT but not if S390 is set. Use this config to determine if sorting should take place at boot up. Link: https://lore.kernel.org/all/yt9dee51ctfn.fsf@linux.ibm.com/ Fixes: 72b3942a173c ("scripts: ftrace - move the sort-processing in ftrace_init") Reported-by: Sven Schnelle Tested-by: Heiko Carstens Signed-off-by: Steven Rostedt (Google) commit 473aec0e1f84be97c7ea52c4266b7ef13ce36af3 Merge: 3689f9f8b0c52 e6340b6526eee Author: Linus Torvalds Date: Sun Jan 23 06:32:29 2022 +0200 Merge tag 'kbuild-fixes-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kbuild fixes from Masahiro Yamada: - Bring include/uapi/linux/nfc.h into the UAPI compile-test coverage - Revert the workaround of CONFIG_CC_IMPLICIT_FALLTHROUGH - Fix build errors in certs/Makefile * tag 'kbuild-fixes-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: certs: Fix build error when CONFIG_MODULE_SIG_KEY is empty certs: Fix build error when CONFIG_MODULE_SIG_KEY is PKCS#11 URI Revert "Makefile: Do not quote value for CONFIG_CC_IMPLICIT_FALLTHROUGH" usr/include/Makefile: add linux/nfc.h to the compile-test coverage commit 3689f9f8b0c52dfd8f5995e4b58917f8f3ac3ee3 Merge: 1c52283265a46 15325b4f768f2 Author: Linus Torvalds Date: Sun Jan 23 06:20:44 2022 +0200 Merge tag 'bitmap-5.17-rc1' of git://github.com/norov/linux Pull bitmap updates from Yury Norov: - introduce for_each_set_bitrange() - use find_first_*_bit() instead of find_next_*_bit() where possible - unify for_each_bit() macros * tag 'bitmap-5.17-rc1' of git://github.com/norov/linux: vsprintf: rework bitmap_list_string lib: bitmap: add performance test for bitmap_print_to_pagebuf bitmap: unify find_bit operations mm/percpu: micro-optimize pcpu_is_populated() Replace for_each_*_bit_from() with for_each_*_bit() where appropriate find: micro-optimize for_each_{set,clear}_bit() include/linux: move for_each_bit() macros from bitops.h to find.h cpumask: replace cpumask_next_* with cpumask_first_* where appropriate tools: sync tools/bitmap with mother linux all: replace find_next{,_zero}_bit with find_first{,_zero}_bit where appropriate cpumask: use find_first_and_bit() lib: add find_first_and_bit() arch: remove GENERIC_FIND_FIRST_BIT entirely include: move find.h from asm_generic to linux bitops: move find_bit_*_le functions from le.h to find.h bitops: protect find_first_{,zero}_bit properly commit f0ac5b85810a69104ee6bc939bcbaecfe4db9a3e Author: Minghao Chi Date: Wed Jan 12 08:01:09 2022 +0000 perf tools: Remove redundant err variable Return value from perf_event__process_tracing_data() directly instead of taking this in another redundant variable. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Link: http://lore.kernel.org/lkml/20220112080109.666800-1-chi.minghao@zte.com.cn Signed-off-by: CGEL ZTE Signed-off-by: Arnaldo Carvalho de Melo commit b4a7276c5e9a79c238a2fad4fb9498dd3558ad2e Author: John Garry Date: Mon Jan 17 23:10:15 2022 +0800 perf test: Add parse-events test for aliases with hyphens Add a test which allows us to test parsing an event alias with hyphens. Since these events typically do not exist on most host systems, add the alias to the fake pmu. Function perf_pmu__test_parse_init() has terms added to match known test aliases. Signed-off-by: John Garry Acked-by: Ian Rogers Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kajol Jain Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Qi Liu Cc: Shaokun Zhang Cc: linuxarm@huawei.com Link: https://lore.kernel.org/r/1642432215-234089-4-git-send-email-john.garry@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 34fa67e72085201ea94b5332eae316951331958f Author: John Garry Date: Mon Jan 17 23:10:14 2022 +0800 perf test: Add pmu-events test for aliases with hyphens Add a test for aliases with hyphens in the name to ensure that the pmu-events tables are as expects. There should be no reason why these sort of aliases would be treated differently, but no harm in checking. Signed-off-by: John Garry Acked-by: Ian Rogers Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kajol Jain Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Qi Liu Cc: Shaokun Zhang Cc: linuxarm@huawei.com Link: https://lore.kernel.org/r/1642432215-234089-3-git-send-email-john.garry@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 864bc8c905261f264c3ea357027cf555fe51c5a3 Author: John Garry Date: Mon Jan 17 23:10:13 2022 +0800 perf parse-events: Support event alias in form foo-bar-baz Event aliasing for events whose name in the form foo-bar-baz is not supported, while foo-bar, foo_bar_baz, and other combinations are, i.e. two hyphens are not supported. The HiSilicon D06 platform has events in such form: $ ./perf list sdir-home-migrate List of pre-defined events (to be used in -e): uncore hha: sdir-home-migrate [Unit: hisi_sccl,hha] $ sudo ./perf stat -e sdir-home-migrate event syntax error: 'sdir-home-migrate' \___ parser error Run 'perf list' for a list of valid events Usage: perf stat [] [] -e, --event event selector. use 'perf list' to list available events To support, add an extra PMU event symbol type for "baz", and add a new rule in the bison file. Signed-off-by: John Garry Acked-by: Ian Rogers Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kajol Jain Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Qi Liu Cc: Shaokun Zhang Cc: linuxarm@huawei.com Link: https://lore.kernel.org/r/1642432215-234089-2-git-send-email-john.garry@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit 3606c0e1a1050d397ad759a62607e419fd8b0ccb Author: German Gomez Date: Tue Jan 18 14:40:54 2022 +0000 perf evsel: Override attr->sample_period for non-libpfm4 events A previous patch preventing "attr->sample_period" values from being overridden in pfm events changed a related behaviour in arm-spe. Before said patch: perf record -c 10000 -e arm_spe_0// -- sleep 1 Would yield an SPE event with period=10000. After the patch, the period in "-c 10000" was being ignored because the arm-spe code initializes sample_period to a non-zero value. This patch restores the previous behaviour for non-libpfm4 events. Fixes: ae5dcc8abe31 (“perf record: Prevent override of attr->sample_period for libpfm4 events”) Reported-by: Chase Conklin Signed-off-by: German Gomez Cc: Alexander Shishkin Cc: Ian Rogers Cc: Jiri Olsa Cc: John Fastabend Cc: KP Singh Cc: Mark Rutland Cc: Martin KaFai Lau Cc: Namhyung Kim Cc: Song Liu Cc: Stephane Eranian Cc: Yonghong Song Cc: bpf@vger.kernel.org Cc: netdev@vger.kernel.org Link: http://lore.kernel.org/lkml/20220118144054.2541-1-german.gomez@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 24ead7c254b42c4ea252e57bf9928154dc7744e0 Author: Lv Ruyi Date: Mon Jan 17 08:37:30 2022 +0000 perf cpumap: Remove duplicate include in cpumap.h Remove all but the first include of stdbool.h from cpumap.h. Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Acked-by: Ian Rogers Cc: Alexander Shishkin Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Link: https://lore.kernel.org/r/20220117083730.863200-1-lv.ruyi@zte.com.cn Signed-off-by: CGEL ZTE Signed-off-by: Arnaldo Carvalho de Melo commit 440286993960bea4aa09d912a5497d92d09ae54c Author: Ian Rogers Date: Fri Jan 21 20:58:10 2022 -0800 perf cpumap: Migrate to libperf cpumap api Switch from directly accessing the perf_cpu_map to using the appropriate libperf API when possible. Using the API simplifies the job of refactoring use of perf_cpu_map. Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Alexey Bayduraev Cc: Andi Kleen Cc: Andrew Morton Cc: André Almeida Cc: Andy Shevchenko Cc: Darren Hart Cc: Davidlohr Bueso Cc: Dmitriy Vyukov Cc: Eric Dumazet Cc: German Gomez Cc: James Clark Cc: Jin Yao Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Masami Hiramatsu Cc: Miaoqian Lin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Shunsuke Nakamura Cc: Song Liu Cc: Stephane Eranian Cc: Stephen Brennan Cc: Steven Rostedt (VMware) Cc: Thomas Gleixner Cc: Thomas Richter Cc: Yury Norov Link: http://lore.kernel.org/lkml/20220122045811.3402706-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 1d1d9af254ffc3bc38c59484c50c600d1d0c96da Author: Ian Rogers Date: Fri Jan 21 20:58:09 2022 -0800 perf python: Fix cpu_map__item() building Value should be built as an integer. Switch some uses of perf_cpu_map to use the library API. Fixes: 6d18804b963b78dc ("perf cpumap: Give CPUs their own type") Signed-off-by: Ian Rogers Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Alexey Bayduraev Cc: Andi Kleen Cc: André Almeida Cc: Andrew Morton Cc: Andy Shevchenko Cc: Darren Hart Cc: Davidlohr Bueso Cc: Dmitriy Vyukov Cc: Eric Dumazet Cc: German Gomez Cc: Ian Rogers Cc: James Clark Cc: Jin Yao Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Masami Hiramatsu Cc: Miaoqian Lin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Shunsuke Nakamura Cc: Song Liu Cc: Stephane Eranian Cc: Stephen Brennan Cc: Steven Rostedt (VMware) Cc: Thomas Gleixner Cc: Thomas Richter Cc: Yury Norov Link: http://lore.kernel.org/lkml/20220122045811.3402706-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 9edcde68d653e1f8f895fbb69a0043c6a56ae35e Author: Yao Jin Date: Fri Jan 21 14:59:54 2022 +0800 perf script: Fix printing 'phys_addr' failure issue Perf script was failed to print the phys_addr for SPE profiling. One 'dummy' event is added by SPE profiling but it doesn't have PHYS_ADDR attribute set, perf script then exits with error. Now referring to 'addr', use evsel__do_check_stype() to check the type. Before: # perf record -e arm_spe_0/branch_filter=0,ts_enable=1,pa_enable=1,load_filter=1,jitter=0,\ store_filter=0,min_latency=0,event_filter=2/ -p 4064384 -- sleep 3 # perf script -F pid,tid,addr,phys_addr Samples for 'dummy:u' event do not have PHYS_ADDR attribute set. Cannot print 'phys_addr' field. After: # perf record -e arm_spe_0/branch_filter=0,ts_enable=1,pa_enable=1,load_filter=1,jitter=0,\ store_filter=0,min_latency=0,event_filter=2/ -p 4064384 -- sleep 3 # perf script -F pid,tid,addr,phys_addr 4064384/4064384 ffff802f921be0d0 2f921be0d0 4064384/4064384 ffff802f921be0d0 2f921be0d0 Reviewed-by: German Gomez Signed-off-by: Yao Jin Cc: Alexander Shishkin Cc: Hanjun Guo Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20220121065954.2121900-1-liwei391@huawei.com Signed-off-by: Wei Li Signed-off-by: Arnaldo Carvalho de Melo commit 16436f70abeebb29cd99444e27b310755806c1fa Author: Ard Biesheuvel Date: Sat Jan 22 16:16:14 2022 +0100 irqchip/gic-v3-its: Fix build for !SMP Commit 835f442fdbce ("irqchip/gic-v3-its: Limit memreserve cpuhp state lifetime") added a reference to cpus_booted_once_mask, which does not exist on !SMP builds, breaking the build for such configurations. Given the intent of the check, short circuit it to always pass. Cc: Valentin Schneider Fixes: 835f442fdbce ("irqchip/gic-v3-its: Limit memreserve cpuhp state lifetime") Signed-off-by: Ard Biesheuvel Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220122151614.133766-1-ardb@kernel.org commit e6340b6526eeec5a00fe26a6ff515afe7d0affa4 Author: Masahiro Yamada Date: Fri Jan 21 04:22:05 2022 +0900 certs: Fix build error when CONFIG_MODULE_SIG_KEY is empty Since b8c96a6b466c ("certs: simplify $(srctree)/ handling and remove config_filename macro"), when CONFIG_MODULE_SIG_KEY is empty, signing_key.x509 fails to build: CERT certs/signing_key.x509 Usage: extract-cert make[1]: *** [certs/Makefile:78: certs/signing_key.x509] Error 2 make: *** [Makefile:1831: certs] Error 2 Pass "" to the first argument of extract-cert to fix the build error. Link: https://lore.kernel.org/linux-kbuild/20220120094606.2skuyb26yjlnu66q@lion.mk-sys.cz/T/#u Fixes: b8c96a6b466c ("certs: simplify $(srctree)/ handling and remove config_filename macro") Reported-by: Michal Kubecek Signed-off-by: Masahiro Yamada Tested-by: Michal Kubecek commit ad29a2fb3c201ef066b0a9fe10a6e14dd0d59c48 Author: Masahiro Yamada Date: Fri Jan 21 04:22:04 2022 +0900 certs: Fix build error when CONFIG_MODULE_SIG_KEY is PKCS#11 URI When CONFIG_MODULE_SIG_KEY is PKCS#11 URL (pkcs11:*), signing_key.x509 fails to build: certs/Makefile:77: *** target pattern contains no '%'. Stop. Due to the typo, $(X509_DEP) contains a colon. Fix it. Fixes: b8c96a6b466c ("certs: simplify $(srctree)/ handling and remove config_filename macro") Signed-off-by: Masahiro Yamada commit e92e2634ef3a95376ad917452a476fccaff83fde Author: Masahiro Yamada Date: Thu Jan 20 14:31:00 2022 +0900 Revert "Makefile: Do not quote value for CONFIG_CC_IMPLICIT_FALLTHROUGH" This reverts commit cd8c917a56f20f48748dd43d9ae3caff51d5b987. Commit 129ab0d2d9f3 ("kbuild: do not quote string values in include/config/auto.conf") provided the final solution. Now reverting the temporary workaround. Signed-off-by: Masahiro Yamada commit 10756dc5b02bff370ddd351d7744bc99ada659c2 Author: Dmitry V. Levin Date: Mon Jan 3 04:24:02 2022 +0300 usr/include/Makefile: add linux/nfc.h to the compile-test coverage As linux/nfc.h userspace compilation was finally fixed by commits 79b69a83705e ("nfc: uapi: use kernel size_t to fix user-space builds") and 7175f02c4e5f ("uapi: fix linux/nfc.h userspace compilation errors"), there is no need to keep the compile-test exception for it in usr/include/Makefile. Signed-off-by: Dmitry V. Levin Signed-off-by: Masahiro Yamada commit a6501e4b380faee6bbf41bb2f833977c7ac6491a Author: Kees Cook Date: Tue Jan 18 10:20:03 2022 -0800 eeprom: at25: Restore missing allocation The at25 driver regressed in v5.17-rc1 due to a broken conflict resolution: the allocation of the object was accidentally removed. Restore it. This was found when building under CONFIG_FORTIFY_SOURCE=y and -Warray-bounds, which complained about strncpy() being used against an empty object: In function 'strncpy', inlined from 'at25_fw_to_chip.constprop' at drivers/misc/eeprom/at25.c:312:2: ./include/linux/fortify-string.h:48:33: warning: '__builtin_strncpy' offset [0, 9] is out of the bounds [0, 0] [-Warray-bounds] 48 | #define __underlying_strncpy __builtin_strncpy | ^ ./include/linux/fortify-string.h:59:16: note: in expansion of macro '__underlying_strncpy' 59 | return __underlying_strncpy(p, q, size); | ^~~~~~~~~~~~~~~~~~~~ In function 'strncpy', inlined from 'at25_fram_to_chip' at drivers/misc/eeprom/at25.c:373:2, inlined from 'at25_probe' at drivers/misc/eeprom/at25.c:453:10: ./include/linux/fortify-string.h:48:33: warning: '__builtin_strncpy' offset [0, 9] is out of the bounds [0, 0] [-Warray-bounds] 48 | #define __underlying_strncpy __builtin_strncpy | ^ ./include/linux/fortify-string.h:59:16: note: in expansion of macro '__underlying_strncpy' 59 | return __underlying_strncpy(p, q, size); | ^~~~~~~~~~~~~~~~~~~~ Link: https://lore.kernel.org/lkml/CAHp75VdqK7h63fz-cPaQ2MGaVdaR2f1Fb5kKCZidUG3RwLsAVA@mail.gmail.com/ Fixes: af40d16042d6 ("Merge v5.15-rc5 into char-misc-next") Cc: Arnd Bergmann Cc: Jiri Prchal Reviewed-by: Andy Shevchenko Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220118182003.3385019-1-keescook@chromium.org Signed-off-by: Greg Kroah-Hartman commit d11a327ed95dbec756b99cbfef2a7fd85c9eeb09 Author: Marc Zyngier Date: Fri Jan 21 21:07:47 2022 +0000 KVM: arm64: vgic-v3: Restrict SEIS workaround to known broken systems Contrary to what df652bcf1136 ("KVM: arm64: vgic-v3: Work around GICv3 locally generated SErrors") was asserting, there is at least one other system out there (Cavium ThunderX2) implementing SEIS, and not in an obviously broken way. So instead of imposing the M1 workaround on an innocent bystander, let's limit it to the two known broken Apple implementations. Fixes: df652bcf1136 ("KVM: arm64: vgic-v3: Work around GICv3 locally generated SErrors") Reported-by: Ard Biesheuvel Tested-by: Ard Biesheuvel Acked-by: Ard Biesheuvel Signed-off-by: Marc Zyngier Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220122103912.795026-1-maz@kernel.org commit 1c52283265a462a100ae63ddf58b4e5884acde86 Merge: 8205ae327e396 6e61dde82e8bf Author: Linus Torvalds Date: Sat Jan 22 11:28:23 2022 +0200 Merge branch 'akpm' (patches from Andrew) Merge yet more updates from Andrew Morton: "This is the post-linux-next queue. Material which was based on or dependent upon material which was in -next. 69 patches. Subsystems affected by this patch series: mm (migration and zsmalloc), sysctl, proc, and lib" * emailed patches from Andrew Morton : (69 commits) mm: hide the FRONTSWAP Kconfig symbol frontswap: remove support for multiple ops mm: mark swap_lock and swap_active_head static frontswap: simplify frontswap_register_ops frontswap: remove frontswap_test mm: simplify try_to_unuse frontswap: remove the frontswap exports frontswap: simplify frontswap_init frontswap: remove frontswap_curr_pages frontswap: remove frontswap_shrink frontswap: remove frontswap_tmem_exclusive_gets frontswap: remove frontswap_writethrough mm: remove cleancache lib/stackdepot: always do filter_irq_stacks() in stack_depot_save() lib/stackdepot: allow optional init and stack_table allocation by kvmalloc() proc: remove PDE_DATA() completely fs: proc: store PDE()->data into inode->i_private zsmalloc: replace get_cpu_var with local_lock zsmalloc: replace per zpage lock with pool->migrate_lock locking/rwlocks: introduce write_lock_nested ... commit 8205ae327e396820fb7a176a94768146ac0b87ea Merge: 1cb69c8044fd5 51620150ca2df Author: Linus Torvalds Date: Sat Jan 22 11:12:26 2022 +0200 Merge tag '5.17-rc-part2-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6 Pull cifs fixes from Steve French: - multichannel fixes, addressing additional reconnect and DFS scenarios - reenabling fscache support (indexing rewrite, metadata caching e.g.) - send additional version information during NTLMSSP negotiate to improve debugging - fix for a mount race - DFS fixes - fix for a memory leak for stable * tag '5.17-rc-part2-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6: cifs: update internal module number smb3: send NTLMSSP version information cifs: Support fscache indexing rewrite cifs: cifs_ses_mark_for_reconnect should also update reconnect bits cifs: update tcpStatus during negotiate and sess setup cifs: make status checks in version independent callers cifs: remove repeated state change in dfs tree connect cifs: fix the cifs_reconnect path for DFS cifs: remove unused variable ses_selected cifs: protect all accesses to chan_* with chan_lock cifs: fix the connection state transitions with multichannel cifs: check reconnects for channels of active tcons too smb3: add new defines from protocol specification cifs: serialize all mount attempts cifs: quirk for STATUS_OBJECT_NAME_INVALID returned for non-ASCII dfs refs cifs: alloc_path_with_tree_prefix: do not append sep. if the path is empty cifs: clean up an inconsistent indenting cifs: free ntlmsspblob allocated in negotiate commit 1cb69c8044fd534a0e19154831234d75f7b8d447 Merge: 7fd350f6ff846 6191cf3ad59fd Author: Linus Torvalds Date: Sat Jan 22 11:04:27 2022 +0200 Merge tag 'xfs-5.17-merge-7' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull xfs fixes from Darrick Wong: "One of the patches removes some dead code from xfs_ioctl32.h and the other fixes broken workqueue flushing in the inode garbage collector. - Minor cleanup of ioctl32 cruft - Clean up open coded inodegc workqueue function calls" * tag 'xfs-5.17-merge-7' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: xfs: flush inodegc workqueue tasks before cancel xfs: remove unused xfs_ioctl32.h declarations commit 7fd350f6ff846f788ba5f6668bacf2ce4257ed8f Merge: b68b10b626600 cef0223191452 Author: Linus Torvalds Date: Sat Jan 22 10:59:32 2022 +0200 Merge tag 'fscache-fixes-20220121' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs Pull more fscache updates from David Howells: "A set of fixes and minor updates for the fscache rewrite: - Fix mishandling of volume collisions (the wait condition is inverted and so it was only waiting if the volume collision was already resolved). - Fix miscalculation of whether there's space available in cachefiles. - Make sure a default cache name is set on a cache if the user hasn't set one by the time they bind the cache. - Adjust the way the backing inode is presented in tracepoints, add a tracepoint for mkdir and trace directory lookup. - Add a tracepoint for failure to set the active file mark. - Add an explanation of the checks made on the backing filesystem. - Check that the backing filesystem supports tmpfile. - Document how the page-release cancellation of the read-skip optimisation works. And I've included a change for netfslib: - Make ops->init_rreq() optional" * tag 'fscache-fixes-20220121' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs: netfs: Make ops->init_rreq() optional fscache: Add a comment explaining how page-release optimisation works cachefiles: Check that the backing filesystem supports tmpfiles cachefiles: Explain checks in a comment cachefiles: Trace active-mark failure cachefiles: Make some tracepoint adjustments cachefiles: set default tag name if it's unspecified cachefiles: Calculate the blockshift in terms of bytes, not pages fscache: Fix the volume collision wait condition commit b68b10b6266009bc8770adf952d637250ee93135 Merge: 369af20a2c3f7 3abb28e275bfb Author: Linus Torvalds Date: Sat Jan 22 10:43:07 2022 +0200 Merge tag 'folio-5.17a' of git://git.infradead.org/users/willy/pagecache Pull more folio updates from Matthew Wilcox: "Three small folio patches. One bug fix, one patch pulled forward from the patches destined for 5.18 and then a patch to make use of that functionality" * tag 'folio-5.17a' of git://git.infradead.org/users/willy/pagecache: filemap: Use folio_put_refs() in filemap_free_folio() mm: Add folio_put_refs() pagevec: Initialise folio_batch->percpu_pvec_drained commit 369af20a2c3f738c8610d75b010ee5dc5d3c207f Merge: b087788c20aa9 2576e153cd982 Author: Linus Torvalds Date: Sat Jan 22 10:24:02 2022 +0200 Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull more SCSI updates from James Bottomley: "This series is all the stragglers that didn't quite make the first merge window pull. It's mostly minor updates and bug fixes of merge window code" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: nsp_cs: Check of ioremap return value scsi: ufs: ufs-mediatek: Fix error checking in ufs_mtk_init_va09_pwr_ctrl() scsi: ufs: Modify Tactive time setting conditions scsi: efct: Remove useless DMA-32 fallback configuration scsi: message: fusion: mptctl: Use dma_alloc_coherent() scsi: message: fusion: mptsas: Use dma_alloc_coherent() scsi: message: fusion: Use dma_alloc_coherent() in mptsas_exp_repmanufacture_info() scsi: message: fusion: mptbase: Use dma_alloc_coherent() scsi: message: fusion: Use dma_alloc_coherent() in mpt_alloc_fw_memory() scsi: message: fusion: Remove usage of the deprecated "pci-dma-compat.h" API scsi: megaraid: Avoid mismatched storage type sizes scsi: hisi_sas: Remove unused variable and check in hisi_sas_send_ata_reset_each_phy() scsi: aic79xx: Remove redundant error variable scsi: pm80xx: Port reset timeout error handling correction scsi: mpi3mr: Fix formatting problems in some kernel-doc comments scsi: mpi3mr: Fix some spelling mistakes scsi: mpt3sas: Update persistent trigger pages from sysfs interface scsi: core: Fix scsi_mode_select() interface scsi: aacraid: Fix spelling of "its" scsi: qedf: Fix potential dereference of NULL pointer commit b087788c20aa959f83df989b31fdcc4182b2d067 Merge: 6bdfb259d6d66 b875b39e7373d Author: Linus Torvalds Date: Sat Jan 22 10:22:11 2022 +0200 Merge tag 'ata-5.17-rc1-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata Pull ATA fix from Damien Le Moal: "A single patch to fix a compilation error in the pata_octeon_cf driver (mips architecture), from me" * tag 'ata-5.17-rc1-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata: ata: pata_octeon_cf: fix call to trace_ata_bmdma_stop() commit 6bdfb259d6d66161011d1d618af190f52b6d57fd Merge: 71f1b916d5ea4 e5b54867f47f7 Author: Linus Torvalds Date: Sat Jan 22 10:15:41 2022 +0200 Merge tag 'thermal-5.17-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull more thermal control updates from Rafael Wysocki: "Add device IDs for Raptor Lake to the int340x thermal control driver (Srinivas Pandruvada)" * tag 'thermal-5.17-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: thermal: int340x: Add Raptor Lake PCI device id thermal: int340x: Support Raptor Lake commit 71f1b916d5ea4a6d781b29e2470f5870a561e82e Merge: 0809edbae347a f6f02040e0ca7 Author: Linus Torvalds Date: Sat Jan 22 10:09:51 2022 +0200 Merge tag 'acpi-5.17-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull extra ACPI updates from Rafael Wysocki: "These fix and clean up the ACPI CPPC driver on top of the recent changes in it merged previously and add some new device IDs to the ACPI DPTF driver. Specifics: - Fix a recently introduced endianness-related issue in the ACPI CPPC library and clean it up on top of that (Rafael Wysocki) - Add new device IDs for the Raptor Lake SoC to the ACPI DPTF driver (Srinivas Pandruvada)" * tag 'acpi-5.17-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: DPTF: Support Raptor Lake ACPI: CPPC: Drop redundant local variable from cpc_read() ACPI: CPPC: Fix up I/O port access in cpc_read() commit 0809edbae347a224ca1b59fb8be1c2d54389c2c6 Merge: 636b5284d8fa1 18a86e5907f71 Author: Linus Torvalds Date: Sat Jan 22 09:52:17 2022 +0200 Merge tag 'devicetree-fixes-for-5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux Pull devicetree fixes and cleanups from Rob Herring: - Fix a regression when probing a child device reusing the parent device's DT node pointer - Refactor of_parse_phandle*() variants to static inlines - Drop Enric Balletbo i Serra as a maintainer - Fix DT schemas with arrays incorrectly encoded as a matrix - Drop unneeded pinctrl properties from schemas - Add SPI peripheral schema to SPI based displays - Clean-up several schema examples - Clean-up trivial-devices.yaml comments - Add missing, in use vendor prefixes: Wingtech, Thundercomm, Huawei, F(x)tec, 8devices * tag 'devicetree-fixes-for-5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: dt-bindings: google,cros-ec: drop Enric Balletbo i Serra from maintainers dt-bindings: display: bridge: drop Enric Balletbo i Serra from maintainers of: Check 'of_node_reused' flag on of_match_device() of: property: define of_property_read_u{8,16,32,64}_array() unconditionally of: base: make small of_parse_phandle() variants static inline dt-bindings: mfd: cirrus,madera: Fix 'interrupts' in example dt-bindings: Fix array schemas encoded as matrices dt-bindings: Drop unnecessary pinctrl properties dt-bindings: rtc: st,stm32-rtc: Make each example a separate entry dt-bindings: mmc: arm,pl18x: Make each example a separate entry dt-bindings: display: Add SPI peripheral schema to SPI based displays scripts/dtc: dtx_diff: remove broken example from help text dt-bindings: trivial-devices: fix double spaces in comments dt-bindings: trivial-devices: fix swapped comments dt-bindings: vendor-prefixes: add Wingtech dt-bindings: vendor-prefixes: add Thundercomm dt-bindings: vendor-prefixes: add Huawei dt-bindings: vendor-prefixes: add F(x)tec dt-bindings: vendor-prefixes: add 8devices dt-bindings: power: reset: gpio-restart: Correct default priority commit 636b5284d8fa12cadbaa09bb7efa48473aa804f5 Merge: dc5341f41dc81 e2e83a73d7ce6 Author: Linus Torvalds Date: Sat Jan 22 09:40:01 2022 +0200 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull more kvm updates from Paolo Bonzini: "Generic: - selftest compilation fix for non-x86 - KVM: avoid warning on s390 in mark_page_dirty x86: - fix page write-protection bug and improve comments - use binary search to lookup the PMU event filter, add test - enable_pmu module parameter support for Intel CPUs - switch blocked_vcpu_on_cpu_lock to raw spinlock - cleanups of blocked vCPU logic - partially allow KVM_SET_CPUID{,2} after KVM_RUN (5.16 regression) - various small fixes" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (46 commits) docs: kvm: fix WARNINGs from api.rst selftests: kvm/x86: Fix the warning in lib/x86_64/processor.c selftests: kvm/x86: Fix the warning in pmu_event_filter_test.c kvm: selftests: Do not indent with spaces kvm: selftests: sync uapi/linux/kvm.h with Linux header selftests: kvm: add amx_test to .gitignore KVM: SVM: Nullify vcpu_(un)blocking() hooks if AVIC is disabled KVM: SVM: Move svm_hardware_setup() and its helpers below svm_x86_ops KVM: SVM: Drop AVIC's intermediate avic_set_running() helper KVM: VMX: Don't do full kick when handling posted interrupt wakeup KVM: VMX: Fold fallback path into triggering posted IRQ helper KVM: VMX: Pass desired vector instead of bool for triggering posted IRQ KVM: VMX: Don't do full kick when triggering posted interrupt "fails" KVM: SVM: Skip AVIC and IRTE updates when loading blocking vCPU KVM: SVM: Use kvm_vcpu_is_blocking() in AVIC load to handle preemption KVM: SVM: Remove unnecessary APICv/AVIC update in vCPU unblocking path KVM: SVM: Don't bother checking for "running" AVIC when kicking for IPIs KVM: SVM: Signal AVIC doorbell iff vCPU is in guest mode KVM: x86: Remove defunct pre_block/post_block kvm_x86_ops hooks KVM: x86: Unexport LAPIC's switch_to_{hv,sw}_timer() helpers ... commit dc5341f41dc81bd497828e562da135bcff9c876c Merge: 7867e402787a2 d24846a4246b6 Author: Linus Torvalds Date: Sat Jan 22 09:37:31 2022 +0200 Merge tag 'for-5.17/parisc-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux Pull more parisc architecture updates from Helge Deller: "Fixes and enhancements: - a memory leak fix in an error path in pdc_stable (Miaoqian Lin) - two compiler warning fixes in the TOC code - added autodetection for currently used console type (serial or graphics) which inserts console= if it's missing" * tag 'for-5.17/parisc-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: pdc_stable: Fix memory leak in pdcs_register_pathentries parisc: Fix missing prototype for 'toc_intr' warning in toc.c parisc: Autodetect default output device and set console= kernel parameter parisc: Use safer strscpy() in setup_cmdline() parisc: Add visible flag to toc_stack variable commit 7867e402787a23001cfb81ff298b7d023fee676a Merge: b21bae9af1da9 c59cd507fb640 Author: Linus Torvalds Date: Sat Jan 22 09:34:49 2022 +0200 Merge tag 'riscv-for-linus-5.17-mw1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull more RISC-V updates from Palmer Dabbelt: - Support for sv48 paging - Hart ID mappings are now sparse, which enables more CPUs to come up on systems with sparse hart IDs - A handful of cleanups and fixes * tag 'riscv-for-linus-5.17-mw1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: (27 commits) RISC-V: nommu_virt: Drop unused SLAB_MERGE_DEFAULT RISC-V: Remove redundant err variable riscv: dts: sifive unmatched: Add gpio poweroff riscv: canaan: remove useless select of non-existing config SYSCON RISC-V: Do not use cpumask data structure for hartid bitmap RISC-V: Move spinwait booting method to its own config RISC-V: Move the entire hart selection via lottery to SMP RISC-V: Use __cpu_up_stack/task_pointer only for spinwait method RISC-V: Do not print the SBI version during HSM extension boot print RISC-V: Avoid using per cpu array for ordered booting riscv: default to CONFIG_RISCV_SBI_V01=n riscv: fix boolconv.cocci warnings riscv: Explicit comment about user virtual address space size riscv: Use pgtable_l4_enabled to output mmu_type in cpuinfo riscv: Implement sv48 support asm-generic: Prepare for riscv use of pud_alloc_one and pud_free riscv: Allow to dynamically define VA_BITS riscv: Introduce functions to switch pt_ops riscv: Split early kasan mapping to prepare sv48 introduction riscv: Move KASAN mapping next to the kernel mapping ... commit b21bae9af1da9b319b5f52ca8fcda76a26cd175a Merge: 0854dc81e108c bb425a7598479 Author: Linus Torvalds Date: Sat Jan 22 09:22:10 2022 +0200 Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fixes/cleanups from Catalin Marinas: "Some fixes that turned up during the merge window: - Add brackets to the io_stop_wc macro - Avoid -Warray-bounds warning with the LSE atomics inline asm - Apply __ro_after_init to memory_limit" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: arm64: mm: apply __ro_after_init to memory_limit arm64: atomics: lse: Dereference matching size asm-generic: Add missing brackets for io_stop_wc macro commit 0854dc81e108c90cccda6d1fc54bc270f16a3cc9 Merge: 9b57f45898574 b0ac702f3329c Author: Linus Torvalds Date: Sat Jan 22 09:02:57 2022 +0200 Merge tag 'docs-5.17-2' of git://git.lwn.net/linux Pull documentation fixes from Jonathan Corbet: "Three small documentation fixes" * tag 'docs-5.17-2' of git://git.lwn.net/linux: Documentation: fix firewire.rst ABI file path error docs: ftrace: fix ambiguous sentence docs: staging/tee.rst: fix two typos found while reading commit 6e61dde82e8bfe65e8ebbe43da45e615bc529236 Author: Christoph Hellwig Date: Fri Jan 21 22:15:14 2022 -0800 mm: hide the FRONTSWAP Kconfig symbol Select FRONTSWAP from ZSWAP instead of prompting for it. Link: https://lkml.kernel.org/r/20211224062246.1258487-14-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Juergen Gross Cc: Dan Streetman Cc: Geert Uytterhoeven Cc: Hugh Dickins Cc: Konrad Rzeszutek Wilk Cc: Matthew Wilcox (Oracle) Cc: Seth Jennings Cc: Vitaly Wool Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 1da0d94a3ec8c5f3793b7be8538b55e60ebeefe3 Author: Christoph Hellwig Date: Fri Jan 21 22:15:10 2022 -0800 frontswap: remove support for multiple ops There is only a single instance of frontswap ops in the kernel, so simplify the frontswap code by removing support for multiple operations. Link: https://lkml.kernel.org/r/20211224062246.1258487-13-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Juergen Gross Cc: Dan Streetman Cc: Geert Uytterhoeven Cc: Hugh Dickins Cc: Konrad Rzeszutek Wilk Cc: Matthew Wilcox (Oracle) Cc: Seth Jennings Cc: Vitaly Wool Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 633423a09cb5cfe61438283e1ce49c23cf4a0611 Author: Christoph Hellwig Date: Fri Jan 21 22:15:07 2022 -0800 mm: mark swap_lock and swap_active_head static swap_lock and swap_active_head are only used in swapfile.c, so mark them static. Link: https://lkml.kernel.org/r/20211224062246.1258487-12-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Juergen Gross Cc: Dan Streetman Cc: Geert Uytterhoeven Cc: Hugh Dickins Cc: Konrad Rzeszutek Wilk Cc: Matthew Wilcox (Oracle) Cc: Seth Jennings Cc: Vitaly Wool Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit f328c1d16e4c764992895ac9c9425cea861b2ca0 Author: Christoph Hellwig Date: Fri Jan 21 22:15:04 2022 -0800 frontswap: simplify frontswap_register_ops Given that frontswap_register_ops must be called from built-in code, there is no need to handle the case of swapfiles coming online before or during it, so delete the code that deals with that case. Link: https://lkml.kernel.org/r/20211224062246.1258487-11-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Juergen Gross Cc: Dan Streetman Cc: Geert Uytterhoeven Cc: Hugh Dickins Cc: Konrad Rzeszutek Wilk Cc: Matthew Wilcox (Oracle) Cc: Seth Jennings Cc: Vitaly Wool Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit bd9cd521496ba8d537d8f46f4167bf4221aba9a3 Author: Christoph Hellwig Date: Fri Jan 21 22:15:01 2022 -0800 frontswap: remove frontswap_test frontswap_test is unused now, remove it. Link: https://lkml.kernel.org/r/20211224062246.1258487-10-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Juergen Gross Cc: Dan Streetman Cc: Geert Uytterhoeven Cc: Hugh Dickins Cc: Konrad Rzeszutek Wilk Cc: Matthew Wilcox (Oracle) Cc: Seth Jennings Cc: Vitaly Wool Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 10a9c496789fe2098bfc018650fc77b23ba08a54 Author: Christoph Hellwig Date: Fri Jan 21 22:14:57 2022 -0800 mm: simplify try_to_unuse Remove the unused frontswap and pages_to_unuse arguments, and mark the function static now that the caller in frontswap is gone. [akpm@linux-foundation.org: fix shmem_unuse() stub, per Matthew] Link: https://lkml.kernel.org/r/20211224062246.1258487-9-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Juergen Gross Cc: Dan Streetman Cc: Geert Uytterhoeven Cc: Hugh Dickins Cc: Konrad Rzeszutek Wilk Cc: Matthew Wilcox (Oracle) Cc: Seth Jennings Cc: Vitaly Wool Cc: Naresh Kamboju Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 360be5daa33fe74fc472195242ae2a2337c4320b Author: Christoph Hellwig Date: Fri Jan 21 22:14:54 2022 -0800 frontswap: remove the frontswap exports None of the frontswap API is called from modular code. Link: https://lkml.kernel.org/r/20211224062246.1258487-8-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Juergen Gross Cc: Dan Streetman Cc: Geert Uytterhoeven Cc: Hugh Dickins Cc: Konrad Rzeszutek Wilk Cc: Matthew Wilcox (Oracle) Cc: Seth Jennings Cc: Vitaly Wool Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 1cf53c894d15dd4b73397a56fa055d76d3db66b4 Author: Christoph Hellwig Date: Fri Jan 21 22:14:51 2022 -0800 frontswap: simplify frontswap_init Just use IS_ENABLED() and remove the __frontswap_init indirection. Also remove the unused export. Link: https://lkml.kernel.org/r/20211224062246.1258487-7-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Juergen Gross Cc: Dan Streetman Cc: Geert Uytterhoeven Cc: Hugh Dickins Cc: Konrad Rzeszutek Wilk Cc: Matthew Wilcox (Oracle) Cc: Seth Jennings Cc: Vitaly Wool Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3e8e1af63d7a831f576477c25d9b89049bd2d53d Author: Christoph Hellwig Date: Fri Jan 21 22:14:47 2022 -0800 frontswap: remove frontswap_curr_pages frontswap_curr_pages is never called, so remove it. Link: https://lkml.kernel.org/r/20211224062246.1258487-6-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Juergen Gross Cc: Dan Streetman Cc: Geert Uytterhoeven Cc: Hugh Dickins Cc: Konrad Rzeszutek Wilk Cc: Matthew Wilcox (Oracle) Cc: Seth Jennings Cc: Vitaly Wool Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 0b364446d734da76e421dbfb09e5268270cefaf0 Author: Christoph Hellwig Date: Fri Jan 21 22:14:44 2022 -0800 frontswap: remove frontswap_shrink frontswap_shrink is never called, so remove it. Link: https://lkml.kernel.org/r/20211224062246.1258487-5-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Juergen Gross Cc: Dan Streetman Cc: Geert Uytterhoeven Cc: Hugh Dickins Cc: Konrad Rzeszutek Wilk Cc: Matthew Wilcox (Oracle) Cc: Seth Jennings Cc: Vitaly Wool Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 71024cb4a0bfe7767aec7a128d0a1a13a37b7fcd Author: Christoph Hellwig Date: Fri Jan 21 22:14:41 2022 -0800 frontswap: remove frontswap_tmem_exclusive_gets frontswap_tmem_exclusive_gets is never called, so remove it. Link: https://lkml.kernel.org/r/20211224062246.1258487-4-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Juergen Gross Cc: Dan Streetman Cc: Geert Uytterhoeven Cc: Hugh Dickins Cc: Konrad Rzeszutek Wilk Cc: Matthew Wilcox (Oracle) Cc: Seth Jennings Cc: Vitaly Wool Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3d6035f136009f9cae380022754cba31f32570c5 Author: Christoph Hellwig Date: Fri Jan 21 22:14:38 2022 -0800 frontswap: remove frontswap_writethrough frontswap_writethrough is never called, so remove it. Link: https://lkml.kernel.org/r/20211224062246.1258487-3-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Juergen Gross Cc: Dan Streetman Cc: Geert Uytterhoeven Cc: Hugh Dickins Cc: Konrad Rzeszutek Wilk Cc: Matthew Wilcox (Oracle) Cc: Seth Jennings Cc: Vitaly Wool Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 0a4ee518185e902758191d968600399f3bc2be31 Author: Christoph Hellwig Date: Fri Jan 21 22:14:34 2022 -0800 mm: remove cleancache Patch series "remove Xen tmem leftovers". Since the removal of the Xen tmem driver in 2019, the cleancache hooks are entirely unused, as are large parts of frontswap. This series against linux-next (with the folio changes included) removes cleancaches, and cuts down frontswap to the bits actually used by zswap. This patch (of 13): The cleancache subsystem is unused since the removal of Xen tmem driver in commit 814bbf49dcd0 ("xen: remove tmem driver"). [akpm@linux-foundation.org: remove now-unreachable code] Link: https://lkml.kernel.org/r/20211224062246.1258487-1-hch@lst.de Link: https://lkml.kernel.org/r/20211224062246.1258487-2-hch@lst.de Signed-off-by: Christoph Hellwig Reviewed-by: Juergen Gross Acked-by: Geert Uytterhoeven Cc: Konrad Rzeszutek Wilk Cc: Hugh Dickins Cc: Seth Jennings Cc: Dan Streetman Cc: Vitaly Wool Cc: Matthew Wilcox (Oracle) Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e940066089490efde86abc519593be84362f4e53 Author: Marco Elver Date: Fri Jan 21 22:14:31 2022 -0800 lib/stackdepot: always do filter_irq_stacks() in stack_depot_save() The non-interrupt portion of interrupt stack traces before interrupt entry is usually arbitrary. Therefore, saving stack traces of interrupts (that include entries before interrupt entry) to stack depot leads to unbounded stackdepot growth. As such, use of filter_irq_stacks() is a requirement to ensure stackdepot can efficiently deduplicate interrupt stacks. Looking through all current users of stack_depot_save(), none (except KASAN) pass the stack trace through filter_irq_stacks() before passing it on to stack_depot_save(). Rather than adding filter_irq_stacks() to all current users of stack_depot_save(), it became clear that stack_depot_save() should simply do filter_irq_stacks(). Link: https://lkml.kernel.org/r/20211130095727.2378739-1-elver@google.com Signed-off-by: Marco Elver Reviewed-by: Alexander Potapenko Acked-by: Vlastimil Babka Reviewed-by: Andrey Konovalov Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Vijayanand Jitta Cc: "Gustavo A. R. Silva" Cc: Imran Khan Cc: Chris Wilson Cc: Jani Nikula Cc: Mika Kuoppala Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 2dba5eb1c73b6ba2988ced07250edeac0f8cbf5a Author: Vlastimil Babka Date: Fri Jan 21 22:14:27 2022 -0800 lib/stackdepot: allow optional init and stack_table allocation by kvmalloc() Currently, enabling CONFIG_STACKDEPOT means its stack_table will be allocated from memblock, even if stack depot ends up not actually used. The default size of stack_table is 4MB on 32-bit, 8MB on 64-bit. This is fine for use-cases such as KASAN which is also a config option and has overhead on its own. But it's an issue for functionality that has to be actually enabled on boot (page_owner) or depends on hardware (GPU drivers) and thus the memory might be wasted. This was raised as an issue [1] when attempting to add stackdepot support for SLUB's debug object tracking functionality. It's common to build kernels with CONFIG_SLUB_DEBUG and enable slub_debug on boot only when needed, or create only specific kmem caches with debugging for testing purposes. It would thus be more efficient if stackdepot's table was allocated only when actually going to be used. This patch thus makes the allocation (and whole stack_depot_init() call) optional: - Add a CONFIG_STACKDEPOT_ALWAYS_INIT flag to keep using the current well-defined point of allocation as part of mem_init(). Make CONFIG_KASAN select this flag. - Other users have to call stack_depot_init() as part of their own init when it's determined that stack depot will actually be used. This may depend on both config and runtime conditions. Convert current users which are page_owner and several in the DRM subsystem. Same will be done for SLUB later. - Because the init might now be called after the boot-time memblock allocation has given all memory to the buddy allocator, change stack_depot_init() to allocate stack_table with kvmalloc() when memblock is no longer available. Also handle allocation failure by disabling stackdepot (could have theoretically happened even with memblock allocation previously), and don't unnecessarily align the memblock allocation to its own size anymore. [1] https://lore.kernel.org/all/CAMuHMdW=eoVzM1Re5FVoEN87nKfiLmM2+Ah7eNu2KXEhCvbZyA@mail.gmail.com/ Link: https://lkml.kernel.org/r/20211013073005.11351-1-vbabka@suse.cz Signed-off-by: Vlastimil Babka Acked-by: Dmitry Vyukov Reviewed-by: Marco Elver # stackdepot Cc: Marco Elver Cc: Vijayanand Jitta Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: David Airlie Cc: Daniel Vetter Cc: Andrey Ryabinin Cc: Alexander Potapenko Cc: Andrey Konovalov Cc: Dmitry Vyukov Cc: Geert Uytterhoeven Cc: Oliver Glitta Cc: Imran Khan From: Colin Ian King Subject: lib/stackdepot: fix spelling mistake and grammar in pr_err message There is a spelling mistake of the work allocation so fix this and re-phrase the message to make it easier to read. Link: https://lkml.kernel.org/r/20211015104159.11282-1-colin.king@canonical.com Signed-off-by: Colin Ian King Cc: Vlastimil Babka From: Vlastimil Babka Subject: lib/stackdepot: allow optional init and stack_table allocation by kvmalloc() - fixup On FLATMEM, we call page_ext_init_flatmem_late() just before kmem_cache_init() which means stack_depot_init() (called by page owner init) will not recognize properly it should use kvmalloc() and not memblock_alloc(). memblock_alloc() will also not issue a warning and return a block memory that can be invalid and cause kernel page fault when saving stacks, as reported by the kernel test robot [1]. Fix this by moving page_ext_init_flatmem_late() below kmem_cache_init() so that slab_is_available() is true during stack_depot_init(). SPARSEMEM doesn't have this issue, as it doesn't do page_ext_init_flatmem_late(), but a different page_ext_init() even later in the boot process. Thanks to Mike Rapoport for pointing out the FLATMEM init ordering issue. While at it, also actually resolve a checkpatch warning in stack_depot_init() from DRM CI, which was supposed to be in the original patch already. [1] https://lore.kernel.org/all/20211014085450.GC18719@xsang-OptiPlex-9020/ Link: https://lkml.kernel.org/r/6abd9213-19a9-6d58-cedc-2414386d2d81@suse.cz Signed-off-by: Vlastimil Babka Reported-by: kernel test robot Cc: Mike Rapoport Cc: Stephen Rothwell From: Vlastimil Babka Subject: lib/stackdepot: allow optional init and stack_table allocation by kvmalloc() - fixup3 Due to cd06ab2fd48f ("drm/locking: add backtrace for locking contended locks without backoff") landing recently to -next adding a new stack depot user in drivers/gpu/drm/drm_modeset_lock.c we need to add an appropriate call to stack_depot_init() there as well. Link: https://lkml.kernel.org/r/2a692365-cfa1-64f2-34e0-8aa5674dce5e@suse.cz Signed-off-by: Vlastimil Babka Cc: Jani Nikula Cc: Naresh Kamboju Cc: Marco Elver Cc: Vijayanand Jitta Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: David Airlie Cc: Daniel Vetter Cc: Andrey Ryabinin Cc: Alexander Potapenko Cc: Andrey Konovalov Cc: Dmitry Vyukov Cc: Geert Uytterhoeven Cc: Oliver Glitta Cc: Imran Khan Cc: Stephen Rothwell From: Vlastimil Babka Subject: lib/stackdepot: allow optional init and stack_table allocation by kvmalloc() - fixup4 Due to 4e66934eaadc ("lib: add reference counting tracking infrastructure") landing recently to net-next adding a new stack depot user in lib/ref_tracker.c we need to add an appropriate call to stack_depot_init() there as well. Link: https://lkml.kernel.org/r/45c1b738-1a2f-5b5f-2f6d-86fab206d01c@suse.cz Signed-off-by: Vlastimil Babka Reviewed-by: Eric Dumazet Cc: Jiri Slab Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 359745d78351c6f5442435f81549f0207ece28aa Author: Muchun Song Date: Fri Jan 21 22:14:23 2022 -0800 proc: remove PDE_DATA() completely Remove PDE_DATA() completely and replace it with pde_data(). [akpm@linux-foundation.org: fix naming clash in drivers/nubus/proc.c] [akpm@linux-foundation.org: now fix it properly] Link: https://lkml.kernel.org/r/20211124081956.87711-2-songmuchun@bytedance.com Signed-off-by: Muchun Song Acked-by: Christian Brauner Cc: Alexey Dobriyan Cc: Alexey Gladkov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 6dfbbae14a7b961f41d80a106e1ab60e86d061c5 Author: Muchun Song Date: Fri Jan 21 22:14:20 2022 -0800 fs: proc: store PDE()->data into inode->i_private PDE_DATA(inode) is introduced to get user private data and hide the layout of struct proc_dir_entry. The inode->i_private is used to do the same thing as well. Save a copy of user private data to inode-> i_private when proc inode is allocated. This means the user also can get their private data by inode->i_private. Introduce pde_data() to wrap inode->i_private so that we can remove PDE_DATA() from fs/proc/generic.c and make PTE_DATE() as a wrapper of pde_data(). It will be easier if we decide to remove PDE_DATE() in the future. Link: https://lkml.kernel.org/r/20211124081956.87711-1-songmuchun@bytedance.com Signed-off-by: Muchun Song Acked-by: Christian Brauner Cc: Alexey Dobriyan Cc: Alexey Gladkov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a37265995c867a4e413761d846cef0445b08d6d5 Author: Mike Galbraith Date: Fri Jan 21 22:14:17 2022 -0800 zsmalloc: replace get_cpu_var with local_lock The usage of get_cpu_var() in zs_map_object() is problematic because it disables preemption and makes it impossible to acquire any sleeping lock on PREEMPT_RT such as a spinlock_t. Replace the get_cpu_var() usage with a local_lock_t which is embedded struct mapping_area. It ensures that the access the struct is synchronized against all users on the same CPU. [minchan: remove the bit_spin_lock part and change the title] Link: https://lkml.kernel.org/r/20211115185909.3949505-10-minchan@kernel.org Signed-off-by: Mike Galbraith Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Minchan Kim Tested-by: Sebastian Andrzej Siewior Cc: Peter Zijlstra (Intel) Cc: Sergey Senozhatsky Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b475d42d2c43321d8bea685f54916220cb76b511 Author: Minchan Kim Date: Fri Jan 21 22:14:13 2022 -0800 zsmalloc: replace per zpage lock with pool->migrate_lock The zsmalloc has used a bit for spin_lock in zpage handle to keep zpage object alive during several operations. However, it causes the problem for PREEMPT_RT as well as introducing too complicated. This patch replaces the bit spin_lock with pool->migrate_lock rwlock. It could make the code simple as well as zsmalloc work under PREEMPT_RT. The drawback is the pool->migrate_lock is bigger granuarity than per zpage lock so the contention would be higher than old when both IO-related operations(i.e., zsmalloc, zsfree, zs_[map|unmap]) and compaction(page/zpage migration) are going in parallel(*, the migrate_lock is rwlock and IO related functions are all read side lock so there is no contention). However, the write-side is fast enough(dominant overhead is just page copy) so it wouldn't affect much. If the lock granurity becomes more problem later, we could introduce table locks based on handle as a hash value. Link: https://lkml.kernel.org/r/20211115185909.3949505-9-minchan@kernel.org Signed-off-by: Minchan Kim Acked-by: Sebastian Andrzej Siewior Tested-by: Sebastian Andrzej Siewior Cc: Mike Galbraith Cc: Peter Zijlstra (Intel) Cc: Sergey Senozhatsky Cc: Thomas Gleixner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 4a57d6bbaecd28c8175dc5da013009e4158018c2 Author: Minchan Kim Date: Fri Jan 21 22:14:10 2022 -0800 locking/rwlocks: introduce write_lock_nested In preparation for converting bit_spin_lock to rwlock in zsmalloc so that multiple writers of zspages can run at the same time but those zspages are supposed to be different zspage instance. Thus, it's not deadlock. This patch adds write_lock_nested to support the case for LOCKDEP. [minchan@kernel.org: fix write_lock_nested for RT] Link: https://lkml.kernel.org/r/YZfrMTAXV56HFWJY@google.com [bigeasy@linutronix.de: fixup write_lock_nested() implementation] Link: https://lkml.kernel.org/r/20211123170134.y6xb7pmpgdn4m3bn@linutronix.de Link: https://lkml.kernel.org/r/20211115185909.3949505-8-minchan@kernel.org Signed-off-by: Minchan Kim Signed-off-by: Sebastian Andrzej Siewior Acked-by: Peter Zijlstra (Intel) Acked-by: Sebastian Andrzej Siewior Tested-by: Sebastian Andrzej Siewior Cc: Mike Galbraith Cc: Sergey Senozhatsky Cc: Thomas Gleixner Cc: Naresh Kamboju Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c4549b871102db01ba23cce4bd0cdac511f8991d Author: Minchan Kim Date: Fri Jan 21 22:14:07 2022 -0800 zsmalloc: remove zspage isolation for migration zspage isolation for migration introduced additional exceptions to be dealt with since the zspage was isolated from class list. The reason why I isolated zspage from class list was to prevent race between obj_malloc and page migration via allocating zpage from the zspage further. However, it couldn't prevent object freeing from zspage so it needed corner case handling. This patch removes the whole mess. Now, we are fine since class->lock and zspage->lock can prevent the race. Link: https://lkml.kernel.org/r/20211115185909.3949505-7-minchan@kernel.org Signed-off-by: Minchan Kim Acked-by: Sebastian Andrzej Siewior Tested-by: Sebastian Andrzej Siewior Cc: Mike Galbraith Cc: Peter Zijlstra (Intel) Cc: Sergey Senozhatsky Cc: Thomas Gleixner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a41ec880aa7beeabcb3bfa476ef35b23f376133b Author: Minchan Kim Date: Fri Jan 21 22:14:04 2022 -0800 zsmalloc: move huge compressed obj from page to zspage The flag aims for zspage, not per page. Let's move it to zspage. Link: https://lkml.kernel.org/r/20211115185909.3949505-6-minchan@kernel.org Signed-off-by: Minchan Kim Acked-by: Sebastian Andrzej Siewior Tested-by: Sebastian Andrzej Siewior Cc: Mike Galbraith Cc: Peter Zijlstra (Intel) Cc: Sergey Senozhatsky Cc: Thomas Gleixner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3ae92ac23bd88ed18c43a5b138d5a91252c31d2a Author: Minchan Kim Date: Fri Jan 21 22:14:01 2022 -0800 zsmalloc: introduce obj_allocated The usage pattern for obj_to_head is to check whether the zpage is allocated or not. Thus, introduce obj_allocated. Link: https://lkml.kernel.org/r/20211115185909.3949505-5-minchan@kernel.org Signed-off-by: Minchan Kim Acked-by: Sebastian Andrzej Siewior Tested-by: Sebastian Andrzej Siewior Cc: Mike Galbraith Cc: Peter Zijlstra (Intel) Cc: Sergey Senozhatsky Cc: Thomas Gleixner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 0a5f079b810765be3bd931fce0f88154035af897 Author: Minchan Kim Date: Fri Jan 21 22:13:57 2022 -0800 zsmalloc: decouple class actions from zspage works This patch moves class stat update out of obj_malloc since it's not related to zspage operation. This is a preparation to introduce new lock scheme in next patch. Link: https://lkml.kernel.org/r/20211115185909.3949505-4-minchan@kernel.org Signed-off-by: Minchan Kim Acked-by: Sebastian Andrzej Siewior Tested-by: Sebastian Andrzej Siewior Cc: Mike Galbraith Cc: Peter Zijlstra (Intel) Cc: Sergey Senozhatsky Cc: Thomas Gleixner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3828a76470792aaa5f2de5c0d7fce497187c1e35 Author: Minchan Kim Date: Fri Jan 21 22:13:54 2022 -0800 zsmalloc: rename zs_stat_type to class_stat_type The stat aims for class stat, not zspage so rename it. Link: https://lkml.kernel.org/r/20211115185909.3949505-3-minchan@kernel.org Signed-off-by: Minchan Kim Acked-by: Sebastian Andrzej Siewior Tested-by: Sebastian Andrzej Siewior Cc: Mike Galbraith Cc: Peter Zijlstra (Intel) Cc: Sergey Senozhatsky Cc: Thomas Gleixner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 67f1c9cd0c561d25354c1e289cdd0d77d3112513 Author: Minchan Kim Date: Fri Jan 21 22:13:51 2022 -0800 zsmalloc: introduce some helper functions Patch series "zsmalloc: remove bit_spin_lock", v2. zsmalloc uses bit_spin_lock to minimize space overhead since it's zpage granularity lock. However, it causes zsmalloc non-working under PREEMPT_RT as well as adding too much complication. This patchset tries to replace the bit_spin_lock with per-pool rwlock. It also removes unnecessary zspage isolation logic from class, which was the other part too much complication added into zsmalloc. Last patch changes the get_cpu_var to local_lock to make it work in PREEMPT_RT. This patch (of 9): get_zspage_mapping returns fullness as well as class_idx. However, the fullness is usually not used since it could be stale in some contexts. It causes misleading as well as unnecessary instructions so this patch introduces zspage_class. obj_to_location also produces page and index but we don't need always the index, either so this patch introduces obj_to_page. Link: https://lkml.kernel.org/r/20211115185909.3949505-1-minchan@kernel.org Link: https://lkml.kernel.org/r/20211115185909.3949505-2-minchan@kernel.org Signed-off-by: Minchan Kim Acked-by: Sebastian Andrzej Siewior Tested-by: Sebastian Andrzej Siewior Cc: Peter Zijlstra Cc: Mike Galbraith Cc: Thomas Gleixner Cc: Sebastian Andrzej Siewior Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 1622ed7d0743201293094162c26019d2573ecacb Author: Baokun Li Date: Fri Jan 21 22:13:48 2022 -0800 sysctl: returns -EINVAL when a negative value is passed to proc_doulongvec_minmax When we pass a negative value to the proc_doulongvec_minmax() function, the function returns 0, but the corresponding interface value does not change. we can easily reproduce this problem with the following commands: cd /proc/sys/fs/epoll echo -1 > max_user_watches; echo $?; cat max_user_watches This function requires a non-negative number to be passed in, so when a negative number is passed in, -EINVAL is returned. Link: https://lkml.kernel.org/r/20211220092627.3744624-1-libaokun1@huawei.com Signed-off-by: Baokun Li Reported-by: Hulk Robot Acked-by: Luis Chamberlain Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e565a8ed1ee4b481539b66cd6f54df9ecf1e9861 Author: Colin Ian King Date: Fri Jan 21 22:13:45 2022 -0800 kernel/sysctl.c: remove unused variable ten_thousand The const variable ten_thousand is not used, it is redundant and can be removed. Cleans up clang warning: kernel/sysctl.c:99:18: warning: unused variable 'ten_thousand' [-Wunused-const-variable] static const int ten_thousand = 10000; Link: https://lkml.kernel.org/r/20211221184501.574670-1-colin.i.king@gmail.com Fixes: c26da54dc8ca ("printk: move printk sysctl to printk/sysctl.c") Signed-off-by: Colin Ian King Acked-by: Luis Chamberlain Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a737a3c6744bc822d1e6a837fef550e665ddf877 Author: Xiaoming Ni Date: Fri Jan 21 22:13:41 2022 -0800 kprobe: move sysctl_kprobes_optimization to kprobes.c kernel/sysctl.c is a kitchen sink where everyone leaves their dirty dishes, this makes it very difficult to maintain. To help with this maintenance let's start by moving sysctls to places where they actually belong. The proc sysctl maintainers do not want to know what sysctl knobs you wish to add for your own piece of code, we just care about the core logic. Move sysctl_kprobes_optimization from kernel/sysctl.c to kernel/kprobes.c. Use register_sysctl() to register the sysctl interface. [mcgrof@kernel.org: fix compile issue when CONFIG_OPTPROBES is disabled] Link: https://lkml.kernel.org/r/20211129211943.640266-7-mcgrof@kernel.org Signed-off-by: Xiaoming Ni Signed-off-by: Luis Chamberlain Cc: Al Viro Cc: Anil S Keshavamurthy Cc: Antti Palosaari Cc: Christian Brauner Cc: "David S. Miller" Cc: Eric Biederman Cc: Eric Biggers Cc: Iurii Zaikin Cc: Kees Cook Cc: Lukas Middendorf Cc: Masami Hiramatsu Cc: "Naveen N. Rao" Cc: Stephen Kitt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit f0bc21b268c1464603192a00851cdbbf7c2cdc36 Author: Xiaoming Ni Date: Fri Jan 21 22:13:38 2022 -0800 fs/coredump: move coredump sysctls into its own file This moves the fs/coredump.c respective sysctls to its own file. Link: https://lkml.kernel.org/r/20211129211943.640266-6-mcgrof@kernel.org Signed-off-by: Xiaoming Ni Signed-off-by: Luis Chamberlain Cc: Al Viro Cc: Anil S Keshavamurthy Cc: Antti Palosaari Cc: Christian Brauner Cc: "David S. Miller" Cc: Eric Biederman Cc: Eric Biggers Cc: Iurii Zaikin Cc: Kees Cook Cc: Lukas Middendorf Cc: Masami Hiramatsu Cc: "Naveen N. Rao" Cc: Stephen Kitt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit fdcd4073fccc6f989308be3f1d61d8a68cd990ce Author: Xiaoming Ni Date: Fri Jan 21 22:13:34 2022 -0800 printk: fix build warning when CONFIG_PRINTK=n build warning when CONFIG_PRINTK=n kernel/printk/printk.c:175:5: warning: no previous prototype for 'devkmsg_sysctl_set_loglvl' [-Wmissing-prototypes] devkmsg_sysctl_set_loglvl() is only used in sysctl.c when CONFIG_PRINTK=y, but it participates in the build when CONFIG_PRINTK=n. So add compile dependency CONFIG_PRINTK=y && CONFIG_SYSCTL=y to fix the build warning. Link: https://lkml.kernel.org/r/20211129211943.640266-5-mcgrof@kernel.org Signed-off-by: Xiaoming Ni Signed-off-by: Luis Chamberlain Cc: Al Viro Cc: Anil S Keshavamurthy Cc: Antti Palosaari Cc: Christian Brauner Cc: "David S. Miller" Cc: Eric Biederman Cc: Eric Biggers Cc: Iurii Zaikin Cc: Kees Cook Cc: Lukas Middendorf Cc: Masami Hiramatsu Cc: "Naveen N. Rao" Cc: Stephen Kitt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit d8c0418aac78e661b5283c9d6a1dfc61d44f26fd Author: Luis Chamberlain Date: Fri Jan 21 22:13:31 2022 -0800 kernel/sysctl.c: rename sysctl_init() to sysctl_init_bases() Rename sysctl_init() to sysctl_init_bases() so to reflect exactly what this is doing. Link: https://lkml.kernel.org/r/20211129211943.640266-4-mcgrof@kernel.org Signed-off-by: Luis Chamberlain Cc: Al Viro Cc: Anil S Keshavamurthy Cc: Antti Palosaari Cc: Christian Brauner Cc: "David S. Miller" Cc: Eric Biederman Cc: Eric Biggers Cc: Iurii Zaikin Cc: Kees Cook Cc: Lukas Middendorf Cc: Masami Hiramatsu Cc: "Naveen N. Rao" Cc: Stephen Kitt Cc: Xiaoming Ni Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ab171b952c6e065779687b44041038efdadb3915 Author: Luis Chamberlain Date: Fri Jan 21 22:13:27 2022 -0800 fs: move namespace sysctls and declare fs base directory This moves the namespace sysctls to its own file as part of the kernel/sysctl.c spring cleaning Since we have now removed all sysctls for "fs", we now have to declare it on the filesystem code, we do that using the new helper, which reduces boiler plate code. We rename init_fs_shared_sysctls() to init_fs_sysctls() to reflect that now fs/sysctls.c is taking on the burden of being the first to register the base directory as well. Lastly, since init code will load in the order in which we link it we have to move the sysctl code to be linked in early, so that its early init routine runs prior to other fs code. This way, other filesystem code can register their own sysctls using the helpers after this: * register_sysctl_init() * register_sysctl() Link: https://lkml.kernel.org/r/20211129211943.640266-3-mcgrof@kernel.org Signed-off-by: Luis Chamberlain Cc: Al Viro Cc: Anil S Keshavamurthy Cc: Antti Palosaari Cc: Christian Brauner Cc: "David S. Miller" Cc: Eric Biederman Cc: Eric Biggers Cc: Iurii Zaikin Cc: Kees Cook Cc: Lukas Middendorf Cc: Masami Hiramatsu Cc: "Naveen N. Rao" Cc: Stephen Kitt Cc: Xiaoming Ni Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 51cb8dfc5a5c39e6c70376b9dc9a14d624a9d271 Author: Luis Chamberlain Date: Fri Jan 21 22:13:24 2022 -0800 sysctl: add and use base directory declarer and registration helper Patch series "sysctl: add and use base directory declarer and registration helper". In this patch series we start addressing base directories, and so we start with the "fs" sysctls. The end goal is we end up completely moving all "fs" sysctl knobs out from kernel/sysctl. This patch (of 6): Add a set of helpers which can be used to declare and register base directory sysctls on their own. We do this so we can later move each of the base sysctl directories like "fs", "kernel", etc, to their own respective files instead of shoving the declarations and registrations all on kernel/sysctl.c. The lazy approach has caught up and with this, we just end up extending the list of base directories / sysctls on one file and this makes maintenance difficult due to merge conflicts from many developers. The declarations are used first by kernel/sysctl.c for registration its own base which over time we'll try to clean up. It will be used in the next patch to demonstrate how to cleanly deal with base sysctl directories. [mcgrof@kernel.org: null-terminate the ctl_table arrays] Link: https://lkml.kernel.org/r/YafJY3rXDYnjK/gs@bombadil.infradead.org Link: https://lkml.kernel.org/r/20211129211943.640266-1-mcgrof@kernel.org Link: https://lkml.kernel.org/r/20211129211943.640266-2-mcgrof@kernel.org Signed-off-by: Luis Chamberlain Cc: Al Viro Cc: Kees Cook Cc: Iurii Zaikin Cc: Xiaoming Ni Cc: Eric Biederman Cc: Stephen Kitt Cc: Lukas Middendorf Cc: Antti Palosaari Cc: Christian Brauner Cc: Eric Biggers Cc: "Naveen N. Rao" Cc: "David S. Miller" Cc: Masami Hiramatsu Cc: Anil S Keshavamurthy Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 1998f19324d24df7de4e74d81503b4299eb99e7d Author: Luis Chamberlain Date: Fri Jan 21 22:13:20 2022 -0800 fs: move pipe sysctls to is own file kernel/sysctl.c is a kitchen sink where everyone leaves their dirty dishes, this makes it very difficult to maintain. To help with this maintenance let's start by moving sysctls to places where they actually belong. The proc sysctl maintainers do not want to know what sysctl knobs you wish to add for your own piece of code, we just care about the core logic. So move the pipe sysctls to its own file. Link: https://lkml.kernel.org/r/20211129205548.605569-10-mcgrof@kernel.org Signed-off-by: Luis Chamberlain Cc: Al Viro Cc: Andy Shevchenko Cc: Antti Palosaari Cc: Eric Biederman Cc: Iurii Zaikin Cc: "J. Bruce Fields" Cc: Jeff Layton Cc: Kees Cook Cc: Lukas Middendorf Cc: Stephen Kitt Cc: Xiaoming Ni Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 66ad398634c21e0a42ce10002ae06c39352da0d1 Author: Luis Chamberlain Date: Fri Jan 21 22:13:17 2022 -0800 fs: move fs/exec.c sysctls into its own file kernel/sysctl.c is a kitchen sink where everyone leaves their dirty dishes, this makes it very difficult to maintain. To help with this maintenance let's start by moving sysctls to places where they actually belong. The proc sysctl maintainers do not want to know what sysctl knobs you wish to add for your own piece of code, we just care about the core logic. So move the fs/exec.c respective sysctls to its own file. Since checkpatch complains about style issues with the old code, this move also fixes a few of those minor style issues: * Use pr_warn() instead of prink(WARNING * New empty lines are wanted at the beginning of routines Link: https://lkml.kernel.org/r/20211129205548.605569-9-mcgrof@kernel.org Signed-off-by: Luis Chamberlain Cc: Al Viro Cc: Andy Shevchenko Cc: Antti Palosaari Cc: Eric Biederman Cc: Iurii Zaikin Cc: "J. Bruce Fields" Cc: Jeff Layton Cc: Kees Cook Cc: Lukas Middendorf Cc: Stephen Kitt Cc: Xiaoming Ni Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 9c011be132972ff94bde2ae99064e29f94e85c68 Author: Luis Chamberlain Date: Fri Jan 21 22:13:13 2022 -0800 fs: move namei sysctls to its own file kernel/sysctl.c is a kitchen sink where everyone leaves their dirty dishes, this makes it very difficult to maintain. To help with this maintenance let's start by moving sysctls to places where they actually belong. The proc sysctl maintainers do not want to know what sysctl knobs you wish to add for your own piece of code, we just care about the core logic. So move namei's own sysctl knobs to its own file. Other than the move we also avoid initializing two static variables to 0 as this is not needed: * sysctl_protected_symlinks * sysctl_protected_hardlinks Link: https://lkml.kernel.org/r/20211129205548.605569-8-mcgrof@kernel.org Signed-off-by: Luis Chamberlain Cc: Al Viro Cc: Andy Shevchenko Cc: Antti Palosaari Cc: Eric Biederman Cc: Iurii Zaikin Cc: "J. Bruce Fields" Cc: Jeff Layton Cc: Kees Cook Cc: Lukas Middendorf Cc: Stephen Kitt Cc: Xiaoming Ni Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit dd81faa88340a1fe8cd81c8ecbadd8e95c58549c Author: Luis Chamberlain Date: Fri Jan 21 22:13:10 2022 -0800 fs: move locking sysctls where they are used kernel/sysctl.c is a kitchen sink where everyone leaves their dirty dishes, this makes it very difficult to maintain. To help with this maintenance let's start by moving sysctls to places where they actually belong. The proc sysctl maintainers do not want to know what sysctl knobs you wish to add for your own piece of code, we just care about the core logic. The locking fs sysctls are only used on fs/locks.c, so move them there. Link: https://lkml.kernel.org/r/20211129205548.605569-7-mcgrof@kernel.org Signed-off-by: Luis Chamberlain Cc: Al Viro Cc: Andy Shevchenko Cc: Antti Palosaari Cc: Eric Biederman Cc: Iurii Zaikin Cc: "J. Bruce Fields" Cc: Jeff Layton Cc: Kees Cook Cc: Lukas Middendorf Cc: Stephen Kitt Cc: Xiaoming Ni Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit d1d8ac9edf10e83f16d13f009439585a1f93ccb2 Author: Luis Chamberlain Date: Fri Jan 21 22:13:06 2022 -0800 fs: move shared sysctls to fs/sysctls.c To help with this maintenance let's start by moving sysctls to places where they actually belong. The proc sysctl maintainers do not want to know what sysctl knobs you wish to add for your own piece of code, we just care about the core logic. To help with this maintenance let's start by moving sysctls to places where they actually belong. The proc sysctl maintainers do not want to know what sysctl knobs you wish to add for your own piece of code, we just care about the core logic. So move sysctls which are shared between filesystems into a common file outside of kernel/sysctl.c. Link: https://lkml.kernel.org/r/20211129205548.605569-6-mcgrof@kernel.org Signed-off-by: Luis Chamberlain Cc: Al Viro Cc: Andy Shevchenko Cc: Antti Palosaari Cc: Eric Biederman Cc: Iurii Zaikin Cc: "J. Bruce Fields" Cc: Jeff Layton Cc: Kees Cook Cc: Lukas Middendorf Cc: Stephen Kitt Cc: Xiaoming Ni Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 54771613e8a7dbbba2a205ddf1b33e25a290b3fd Author: Luis Chamberlain Date: Fri Jan 21 22:13:03 2022 -0800 sysctl: move maxolduid as a sysctl specific const The maxolduid value is only shared for sysctl purposes for use on a max range. Just stuff this into our shared const array. [akpm@linux-foundation.org: fix sysctl_vals[], per Mickaël] Link: https://lkml.kernel.org/r/20211129205548.605569-5-mcgrof@kernel.org Signed-off-by: Luis Chamberlain Signed-off-by: Mickaël Salaün Cc: Al Viro Cc: Andy Shevchenko Cc: Antti Palosaari Cc: Eric Biederman Cc: Iurii Zaikin Cc: "J. Bruce Fields" Cc: Jeff Layton Cc: Kees Cook Cc: Lukas Middendorf Cc: Stephen Kitt Cc: Xiaoming Ni Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c8c0c239d5ab1e3e8d2bb0453ce642fe2c6357ec Author: Luis Chamberlain Date: Fri Jan 21 22:12:59 2022 -0800 fs: move dcache sysctls to its own file kernel/sysctl.c is a kitchen sink where everyone leaves their dirty dishes, this makes it very difficult to maintain. To help with this maintenance let's start by moving sysctls to places where they actually belong. The proc sysctl maintainers do not want to know what sysctl knobs you wish to add for your own piece of code, we just care about the core logic. So move the dcache sysctl clutter out of kernel/sysctl.c. This is a small one-off entry, perhaps later we can simplify this representation, but for now we use the helpers we have. We won't know how we can simplify this further untl we're fully done with the cleanup. [arnd@arndb.de: avoid unused-function warning] Link: https://lkml.kernel.org/r/20211203190123.874239-2-arnd@kernel.org Link: https://lkml.kernel.org/r/20211129205548.605569-4-mcgrof@kernel.org Signed-off-by: Luis Chamberlain Signed-off-by: Arnd Bergmann Cc: Al Viro Cc: Andy Shevchenko Cc: Antti Palosaari Cc: Eric Biederman Cc: Iurii Zaikin Cc: "J. Bruce Fields" Cc: Jeff Layton Cc: Kees Cook Cc: Lukas Middendorf Cc: Stephen Kitt Cc: Xiaoming Ni Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 204d5a24e15562b2816825c0f9b49d26814b77be Author: Luis Chamberlain Date: Fri Jan 21 22:12:56 2022 -0800 fs: move fs stat sysctls to file_table.c kernel/sysctl.c is a kitchen sink where everyone leaves their dirty dishes, this makes it very difficult to maintain. To help with this maintenance let's start by moving sysctls to places where they actually belong. The proc sysctl maintainers do not want to know what sysctl knobs you wish to add for your own piece of code, we just care about the core logic. We can create the sysctl dynamically on early init for fs stat to help with this clutter. This dusts off the fs stat syctls knobs and puts them into where they are declared. Link: https://lkml.kernel.org/r/20211129205548.605569-3-mcgrof@kernel.org Signed-off-by: Luis Chamberlain Cc: Al Viro Cc: Andy Shevchenko Cc: Antti Palosaari Cc: Eric Biederman Cc: Iurii Zaikin Cc: "J. Bruce Fields" Cc: Jeff Layton Cc: Kees Cook Cc: Lukas Middendorf Cc: Stephen Kitt Cc: Xiaoming Ni Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 1d67fe585049d3e2448b997af78c68cbf90ada09 Author: Luis Chamberlain Date: Fri Jan 21 22:12:52 2022 -0800 fs: move inode sysctls to its own file Patch series "sysctl: 4th set of kernel/sysctl cleanups". This is slimming down the fs uses of kernel/sysctl.c to the point that the next step is to just get rid of the fs base directory for it and move that elsehwere, so that next patch series starts dealing with that to demo how we can end up cleaning up a full base directory from kernel/sysctl.c, one at a time. This patch (of 9): kernel/sysctl.c is a kitchen sink where everyone leaves their dirty dishes, this makes it very difficult to maintain. To help with this maintenance let's start by moving sysctls to places where they actually belong. The proc sysctl maintainers do not want to know what sysctl knobs you wish to add for your own piece of code, we just care about the core logic. So move the inode sysctls to its own file. Since we are no longer using this outside of fs/ remove the extern declaration of its respective proc helper. We use early_initcall() as it is the earliest we can use. [arnd@arndb.de: avoid unused-variable warning] Link: https://lkml.kernel.org/r/20211203190123.874239-1-arnd@kernel.org Link: https://lkml.kernel.org/r/20211129205548.605569-1-mcgrof@kernel.org Link: https://lkml.kernel.org/r/20211129205548.605569-2-mcgrof@kernel.org Signed-off-by: Luis Chamberlain Signed-off-by: Arnd Bergmann Cc: Al Viro Cc: Kees Cook Cc: Iurii Zaikin Cc: Xiaoming Ni Cc: Eric Biederman Cc: Stephen Kitt Cc: Lukas Middendorf Cc: Antti Palosaari Cc: Andy Shevchenko Cc: Jeff Layton Cc: "J. Bruce Fields" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b1f2aff888af54a057c2c3c0d88a13ef5d37b52a Author: Luis Chamberlain Date: Fri Jan 21 22:12:48 2022 -0800 sysctl: share unsigned long const values Provide a way to share unsigned long values. This will allow others to not have to re-invent these values. Link: https://lkml.kernel.org/r/20211124231435.1445213-9-mcgrof@kernel.org Signed-off-by: Luis Chamberlain Cc: Al Viro Cc: Amir Goldstein Cc: Andy Shevchenko Cc: Antti Palosaari Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Benjamin LaHaise Cc: Clemens Ladisch Cc: David Airlie Cc: Douglas Gilbert Cc: Eric Biederman Cc: Greg Kroah-Hartman Cc: Iurii Zaikin Cc: James E.J. Bottomley Cc: Jani Nikula Cc: Jani Nikula Cc: Jan Kara Cc: Joel Becker Cc: John Ogness Cc: Joonas Lahtinen Cc: Joseph Qi Cc: Julia Lawall Cc: Kees Cook Cc: Lukas Middendorf Cc: Mark Fasheh Cc: Martin K. Petersen Cc: Paul Turner Cc: Peter Zijlstra Cc: Petr Mladek Cc: Phillip Potter Cc: Qing Wang Cc: "Rafael J. Wysocki" Cc: Rodrigo Vivi Cc: Sebastian Reichel Cc: Sergey Senozhatsky Cc: Stephen Kitt Cc: Steven Rostedt (VMware) Cc: Suren Baghdasaryan Cc: Tetsuo Handa Cc: "Theodore Ts'o" Cc: Xiaoming Ni Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 0df8bdd5e3b3e557ce2c2575fce0c64c5dd1045a Author: Xiaoming Ni Date: Fri Jan 21 22:12:43 2022 -0800 stackleak: move stack_erasing sysctl to stackleak.c kernel/sysctl.c is a kitchen sink where everyone leaves their dirty dishes, this makes it very difficult to maintain. To help with this maintenance let's start by moving sysctls to places where they actually belong. The proc sysctl maintainers do not want to know what sysctl knobs you wish to add for your own piece of code, we just care about the core logic. So move the stack_erasing sysctl from kernel/sysctl.c to kernel/stackleak.c and use register_sysctl() to register the sysctl interface. [mcgrof@kernel.org: commit log update] Link: https://lkml.kernel.org/r/20211124231435.1445213-8-mcgrof@kernel.org Signed-off-by: Xiaoming Ni Signed-off-by: Luis Chamberlain Cc: Al Viro Cc: Amir Goldstein Cc: Andy Shevchenko Cc: Antti Palosaari Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Benjamin LaHaise Cc: Clemens Ladisch Cc: David Airlie Cc: Douglas Gilbert Cc: Eric Biederman Cc: Greg Kroah-Hartman Cc: Iurii Zaikin Cc: James E.J. Bottomley Cc: Jani Nikula Cc: Jani Nikula Cc: Jan Kara Cc: Joel Becker Cc: John Ogness Cc: Joonas Lahtinen Cc: Joseph Qi Cc: Julia Lawall Cc: Kees Cook Cc: Lukas Middendorf Cc: Mark Fasheh Cc: Martin K. Petersen Cc: Paul Turner Cc: Peter Zijlstra Cc: Petr Mladek Cc: Phillip Potter Cc: Qing Wang Cc: "Rafael J. Wysocki" Cc: Rodrigo Vivi Cc: Sebastian Reichel Cc: Sergey Senozhatsky Cc: Stephen Kitt Cc: Steven Rostedt (VMware) Cc: Suren Baghdasaryan Cc: Tetsuo Handa Cc: "Theodore Ts'o" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 26d1c80fd61e59d5e2eb6fda00e0148a6704ddeb Author: Xiaoming Ni Date: Fri Jan 21 22:12:38 2022 -0800 scsi/sg: move sg-big-buff sysctl to scsi/sg.c kernel/sysctl.c is a kitchen sink where everyone leaves their dirty dishes, this makes it very difficult to maintain. To help with this maintenance let's start by moving sysctls to places where they actually belong. The proc sysctl maintainers do not want to know what sysctl knobs you wish to add for your own piece of code, we just care about the core logic. So move the sg-big-buff sysctl from kernel/sysctl.c to drivers/scsi/sg.c and use register_sysctl() to register the sysctl interface. [mcgrof@kernel.org: commit log update] Link: https://lkml.kernel.org/r/20211124231435.1445213-7-mcgrof@kernel.org Signed-off-by: Xiaoming Ni Signed-off-by: Luis Chamberlain Cc: Al Viro Cc: Amir Goldstein Cc: Andy Shevchenko Cc: Antti Palosaari Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Benjamin LaHaise Cc: Clemens Ladisch Cc: David Airlie Cc: Douglas Gilbert Cc: Eric Biederman Cc: Greg Kroah-Hartman Cc: Iurii Zaikin Cc: James E.J. Bottomley Cc: Jani Nikula Cc: Jani Nikula Cc: Jan Kara Cc: Joel Becker Cc: John Ogness Cc: Joonas Lahtinen Cc: Joseph Qi Cc: Julia Lawall Cc: Kees Cook Cc: Lukas Middendorf Cc: Mark Fasheh Cc: Martin K. Petersen Cc: Paul Turner Cc: Peter Zijlstra Cc: Petr Mladek Cc: Phillip Potter Cc: Qing Wang Cc: "Rafael J. Wysocki" Cc: Rodrigo Vivi Cc: Sebastian Reichel Cc: Sergey Senozhatsky Cc: Stephen Kitt Cc: Steven Rostedt (VMware) Cc: Suren Baghdasaryan Cc: Tetsuo Handa Cc: "Theodore Ts'o" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit faaa357a55e03490fb280ac211be2298e635b220 Author: Xiaoming Ni Date: Fri Jan 21 22:12:33 2022 -0800 printk: move printk sysctl to printk/sysctl.c kernel/sysctl.c is a kitchen sink where everyone leaves their dirty dishes, this makes it very difficult to maintain. To help with this maintenance let's start by moving sysctls to places where they actually belong. The proc sysctl maintainers do not want to know what sysctl knobs you wish to add for your own piece of code, we just care about the core logic. So move printk sysctl from kernel/sysctl.c to kernel/printk/sysctl.c. Use register_sysctl() to register the sysctl interface. [mcgrof@kernel.org: fixed compile issues when PRINTK is not set, commit log update] Link: https://lkml.kernel.org/r/20211124231435.1445213-6-mcgrof@kernel.org Signed-off-by: Xiaoming Ni Signed-off-by: Luis Chamberlain Cc: Al Viro Cc: Amir Goldstein Cc: Andy Shevchenko Cc: Antti Palosaari Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Benjamin LaHaise Cc: Clemens Ladisch Cc: David Airlie Cc: Douglas Gilbert Cc: Eric Biederman Cc: Greg Kroah-Hartman Cc: Iurii Zaikin Cc: James E.J. Bottomley Cc: Jani Nikula Cc: Jani Nikula Cc: Jan Kara Cc: Joel Becker Cc: John Ogness Cc: Joonas Lahtinen Cc: Joseph Qi Cc: Julia Lawall Cc: Kees Cook Cc: Lukas Middendorf Cc: Mark Fasheh Cc: Martin K. Petersen Cc: Paul Turner Cc: Peter Zijlstra Cc: Petr Mladek Cc: Phillip Potter Cc: Qing Wang Cc: "Rafael J. Wysocki" Cc: Rodrigo Vivi Cc: Sebastian Reichel Cc: Sergey Senozhatsky Cc: Stephen Kitt Cc: Steven Rostedt (VMware) Cc: Suren Baghdasaryan Cc: Tetsuo Handa Cc: "Theodore Ts'o" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3ba442d5331ff4d4339faf4986d0841386196f92 Author: Luis Chamberlain Date: Fri Jan 21 22:12:28 2022 -0800 fs: move binfmt_misc sysctl to its own file kernel/sysctl.c is a kitchen sink where everyone leaves their dirty dishes, this makes it very difficult to maintain. To help with this maintenance let's start by moving sysctls to places where they actually belong. The proc sysctl maintainers do not want to know what sysctl knobs you wish to add for your own piece of code, we just care about the core logic. This moves the binfmt_misc sysctl to its own file to help remove clutter from kernel/sysctl.c. Link: https://lkml.kernel.org/r/20211124231435.1445213-5-mcgrof@kernel.org Signed-off-by: Luis Chamberlain Cc: Al Viro Cc: Amir Goldstein Cc: Andy Shevchenko Cc: Antti Palosaari Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Benjamin LaHaise Cc: Clemens Ladisch Cc: David Airlie Cc: Douglas Gilbert Cc: Eric Biederman Cc: Greg Kroah-Hartman Cc: Iurii Zaikin Cc: James E.J. Bottomley Cc: Jani Nikula Cc: Jani Nikula Cc: Jan Kara Cc: Joel Becker Cc: John Ogness Cc: Joonas Lahtinen Cc: Joseph Qi Cc: Julia Lawall Cc: Kees Cook Cc: Lukas Middendorf Cc: Mark Fasheh Cc: Martin K. Petersen Cc: Paul Turner Cc: Peter Zijlstra Cc: Petr Mladek Cc: Phillip Potter Cc: Qing Wang Cc: "Rafael J. Wysocki" Cc: Rodrigo Vivi Cc: Sebastian Reichel Cc: Sergey Senozhatsky Cc: Stephen Kitt Cc: Steven Rostedt (VMware) Cc: Suren Baghdasaryan Cc: Tetsuo Handa Cc: "Theodore Ts'o" Cc: Xiaoming Ni Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ee9efac48a082904d17a20131aa73d82f058cdd6 Author: Luis Chamberlain Date: Fri Jan 21 22:12:23 2022 -0800 sysctl: add helper to register a sysctl mount point The way to create a subdirectory on top of sysctl_mount_point is a bit obscure, and *why* we do that even so more. Provide a helper which makes it clear why we do this. [akpm@linux-foundation.org: export register_sysctl_mount_point() to modules] Link: https://lkml.kernel.org/r/20211124231435.1445213-4-mcgrof@kernel.org Signed-off-by: Luis Chamberlain Suggested-by: "Eric W. Biederman" Cc: Al Viro Cc: Amir Goldstein Cc: Andy Shevchenko Cc: Antti Palosaari Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Benjamin LaHaise Cc: Clemens Ladisch Cc: David Airlie Cc: Douglas Gilbert Cc: Greg Kroah-Hartman Cc: Iurii Zaikin Cc: James E.J. Bottomley Cc: Jani Nikula Cc: Jani Nikula Cc: Jan Kara Cc: Joel Becker Cc: John Ogness Cc: Joonas Lahtinen Cc: Joseph Qi Cc: Julia Lawall Cc: Kees Cook Cc: Lukas Middendorf Cc: Mark Fasheh Cc: Martin K. Petersen Cc: Paul Turner Cc: Peter Zijlstra Cc: Petr Mladek Cc: Phillip Potter Cc: Qing Wang Cc: "Rafael J. Wysocki" Cc: Rodrigo Vivi Cc: Sebastian Reichel Cc: Sergey Senozhatsky Cc: Stephen Kitt Cc: Steven Rostedt (VMware) Cc: Suren Baghdasaryan Cc: Tetsuo Handa Cc: "Theodore Ts'o" Cc: Xiaoming Ni Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 5475e8f03c80bbce7b43a57d861f5acc44a60b22 Author: Xiaoming Ni Date: Fri Jan 21 22:12:18 2022 -0800 random: move the random sysctl declarations to its own file kernel/sysctl.c is a kitchen sink where everyone leaves their dirty dishes, this makes it very difficult to maintain. To help with this maintenance let's start by moving sysctls to places where they actually belong. The proc sysctl maintainers do not want to know what sysctl knobs you wish to add for your own piece of code, we just care about the core logic. So move the random sysctls to their own file and use register_sysctl_init(). [mcgrof@kernel.org: commit log update to justify the move] Link: https://lkml.kernel.org/r/20211124231435.1445213-3-mcgrof@kernel.org Signed-off-by: Xiaoming Ni Signed-off-by: Luis Chamberlain Cc: Al Viro Cc: Amir Goldstein Cc: Andy Shevchenko Cc: Antti Palosaari Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Benjamin LaHaise Cc: Clemens Ladisch Cc: David Airlie Cc: Douglas Gilbert Cc: Eric Biederman Cc: Greg Kroah-Hartman Cc: Iurii Zaikin Cc: James E.J. Bottomley Cc: Jani Nikula Cc: Jani Nikula Cc: Jan Kara Cc: Joel Becker Cc: John Ogness Cc: Joonas Lahtinen Cc: Joseph Qi Cc: Julia Lawall Cc: Kees Cook Cc: Lukas Middendorf Cc: Mark Fasheh Cc: Martin K. Petersen Cc: Paul Turner Cc: Peter Zijlstra Cc: Petr Mladek Cc: Phillip Potter Cc: Qing Wang Cc: "Rafael J. Wysocki" Cc: Rodrigo Vivi Cc: Sebastian Reichel Cc: Sergey Senozhatsky Cc: Stephen Kitt Cc: Steven Rostedt (VMware) Cc: Suren Baghdasaryan Cc: Tetsuo Handa Cc: "Theodore Ts'o" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 6aad36d421d8bfe156508fa4edfe67827234cf0f Author: Xiaoming Ni Date: Fri Jan 21 22:12:13 2022 -0800 firmware_loader: move firmware sysctl to its own files Patch series "sysctl: 3rd set of kernel/sysctl cleanups", v2. This is the third set of patches to help address cleaning the kitchen seink in kernel/sysctl.c and to move sysctls away to where they are actually implemented / used. This patch (of 8): kernel/sysctl.c is a kitchen sink where everyone leaves their dirty dishes, this makes it very difficult to maintain. To help with this maintenance let's start by moving sysctls to places where they actually belong. The proc sysctl maintainers do not want to know what sysctl knobs you wish to add for your own piece of code, we just care about the core logic. So move the firmware configuration sysctl table to the only place where it is used, and make it clear that if sysctls are disabled this is not used. [akpm@linux-foundation.org: export register_firmware_config_sysctl and unregister_firmware_config_sysctl to modules] [akpm@linux-foundation.org: use EXPORT_SYMBOL_NS_GPL instead] [sfr@canb.auug.org.au: fix that so it compiles] Link: https://lkml.kernel.org/r/20211201160626.401d828d@canb.auug.org.au [mcgrof@kernel.org: major commit log update to justify the move] Link: https://lkml.kernel.org/r/20211124231435.1445213-1-mcgrof@kernel.org Link: https://lkml.kernel.org/r/20211124231435.1445213-2-mcgrof@kernel.org Signed-off-by: Xiaoming Ni Signed-off-by: Luis Chamberlain Signed-off-by: Stephen Rothwell Cc: Kees Cook Cc: Iurii Zaikin Cc: Eric Biederman Cc: Stephen Kitt Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Cc: "Theodore Ts'o" Cc: Al Viro Cc: Petr Mladek Cc: Sergey Senozhatsky Cc: Steven Rostedt (VMware) Cc: John Ogness Cc: Douglas Gilbert Cc: James E.J. Bottomley Cc: Martin K. Petersen Cc: Lukas Middendorf Cc: Antti Palosaari Cc: Amir Goldstein Cc: Andy Shevchenko Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Benjamin LaHaise Cc: Clemens Ladisch Cc: David Airlie Cc: Jani Nikula Cc: Jani Nikula Cc: Jan Kara Cc: Joel Becker Cc: Joonas Lahtinen Cc: Joseph Qi Cc: Julia Lawall Cc: Mark Fasheh Cc: Paul Turner Cc: Peter Zijlstra Cc: Phillip Potter Cc: Qing Wang Cc: Rodrigo Vivi Cc: Sebastian Reichel Cc: Suren Baghdasaryan Cc: Tetsuo Handa Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a8f5de894f76f1c73f4a068d04897a5e2f873825 Author: Xiaoming Ni Date: Fri Jan 21 22:12:09 2022 -0800 eventpoll: simplify sysctl declaration with register_sysctl() The kernel/sysctl.c is a kitchen sink where everyone leaves their dirty dishes, this makes it very difficult to maintain. To help with this maintenance let's start by moving sysctls to places where they actually belong. The proc sysctl maintainers do not want to know what sysctl knobs you wish to add for your own piece of code, we just care about the core logic. So move the epoll_table sysctl to fs/eventpoll.c and use register_sysctl(). Link: https://lkml.kernel.org/r/20211123202422.819032-9-mcgrof@kernel.org Signed-off-by: Xiaoming Ni Signed-off-by: Luis Chamberlain Cc: Al Viro Cc: Amir Goldstein Cc: Andy Shevchenko Cc: Antti Palosaari Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Benjamin LaHaise Cc: Clemens Ladisch Cc: David Airlie Cc: "Eric W. Biederman" Cc: Greg Kroah-Hartman Cc: Iurii Zaikin Cc: Jani Nikula Cc: Jan Kara Cc: Joel Becker Cc: Joonas Lahtinen Cc: Joseph Qi Cc: Julia Lawall Cc: Kees Cook Cc: Lukas Middendorf Cc: Mark Fasheh Cc: Paul Turner Cc: Peter Zijlstra Cc: Petr Mladek Cc: Phillip Potter Cc: Qing Wang Cc: Rodrigo Vivi Cc: Sebastian Reichel Cc: Sergey Senozhatsky Cc: Stephen Kitt Cc: Tetsuo Handa Cc: Douglas Gilbert Cc: James E.J. Bottomley Cc: Jani Nikula Cc: John Ogness Cc: Martin K. Petersen Cc: "Rafael J. Wysocki" Cc: Steven Rostedt (VMware) Cc: Suren Baghdasaryan Cc: "Theodore Ts'o" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ad8f74315b335c55f3d8bd7c37d21d6c74d1be20 Author: Luis Chamberlain Date: Fri Jan 21 22:12:04 2022 -0800 cdrom: simplify subdirectory registration with register_sysctl() There is no need to user boiler plate code to specify a set of base directories we're going to stuff sysctls under. Simplify this by using register_sysctl() and specifying the directory path directly. // pycocci sysctl-subdir-register-sysctl-simplify.cocci PATH @c1@ expression E1; identifier subdir, sysctls; @@ static struct ctl_table subdir[] = { { .procname = E1, .maxlen = 0, .mode = 0555, .child = sysctls, }, { } }; @c2@ identifier c1.subdir; expression E2; identifier base; @@ static struct ctl_table base[] = { { .procname = E2, .maxlen = 0, .mode = 0555, .child = subdir, }, { } }; @c3@ identifier c2.base; identifier header; @@ header = register_sysctl_table(base); @r1 depends on c1 && c2 && c3@ expression c1.E1; identifier c1.subdir, c1.sysctls; @@ -static struct ctl_table subdir[] = { - { - .procname = E1, - .maxlen = 0, - .mode = 0555, - .child = sysctls, - }, - { } -}; @r2 depends on c1 && c2 && c3@ identifier c1.subdir; expression c2.E2; identifier c2.base; @@ -static struct ctl_table base[] = { - { - .procname = E2, - .maxlen = 0, - .mode = 0555, - .child = subdir, - }, - { } -}; @initialize:python@ @@ def make_my_fresh_expression(s1, s2): return '"' + s1.strip('"') + "/" + s2.strip('"') + '"' @r3 depends on c1 && c2 && c3@ expression c1.E1; identifier c1.sysctls; expression c2.E2; identifier c2.base; identifier c3.header; fresh identifier E3 = script:python(E2, E1) { make_my_fresh_expression(E2, E1) }; @@ header = -register_sysctl_table(base); +register_sysctl(E3, sysctls); Generated-by: Coccinelle SmPL Link: https://lkml.kernel.org/r/20211123202422.819032-8-mcgrof@kernel.org Signed-off-by: Luis Chamberlain Cc: Al Viro Cc: Amir Goldstein Cc: Andy Shevchenko Cc: Antti Palosaari Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Benjamin LaHaise Cc: Clemens Ladisch Cc: David Airlie Cc: "Eric W. Biederman" Cc: Greg Kroah-Hartman Cc: Iurii Zaikin Cc: Jani Nikula Cc: Jan Kara Cc: Joel Becker Cc: Joonas Lahtinen Cc: Joseph Qi Cc: Julia Lawall Cc: Kees Cook Cc: Lukas Middendorf Cc: Mark Fasheh Cc: Paul Turner Cc: Peter Zijlstra Cc: Petr Mladek Cc: Phillip Potter Cc: Qing Wang Cc: Rodrigo Vivi Cc: Sebastian Reichel Cc: Sergey Senozhatsky Cc: Stephen Kitt Cc: Tetsuo Handa Cc: Xiaoming Ni Cc: Douglas Gilbert Cc: James E.J. Bottomley Cc: Jani Nikula Cc: John Ogness Cc: Martin K. Petersen Cc: "Rafael J. Wysocki" Cc: Steven Rostedt (VMware) Cc: Suren Baghdasaryan Cc: "Theodore Ts'o" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 7b9ad122b52c9839e1f68f16c907990a6ad6f793 Author: Xiaoming Ni Date: Fri Jan 21 22:11:59 2022 -0800 inotify: simplify subdirectory registration with register_sysctl() There is no need to user boiler plate code to specify a set of base directories we're going to stuff sysctls under. Simplify this by using register_sysctl() and specifying the directory path directly. Move inotify_user sysctl to inotify_user.c while at it to remove clutter from kernel/sysctl.c. [mcgrof@kernel.org: remember to register fanotify_table] Link: https://lkml.kernel.org/r/YZ5A6iWLb0h3N3RC@bombadil.infradead.org [mcgrof@kernel.org: update commit log to reflect new path we decided to take] Link: https://lkml.kernel.org/r/20211123202422.819032-7-mcgrof@kernel.org Signed-off-by: Xiaoming Ni Signed-off-by: Luis Chamberlain Cc: Al Viro Cc: Amir Goldstein Cc: Andy Shevchenko Cc: Antti Palosaari Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Benjamin LaHaise Cc: Clemens Ladisch Cc: David Airlie Cc: "Eric W. Biederman" Cc: Greg Kroah-Hartman Cc: Iurii Zaikin Cc: Jani Nikula Cc: Jan Kara Cc: Joel Becker Cc: Joonas Lahtinen Cc: Joseph Qi Cc: Julia Lawall Cc: Kees Cook Cc: Lukas Middendorf Cc: Mark Fasheh Cc: Paul Turner Cc: Peter Zijlstra Cc: Petr Mladek Cc: Phillip Potter Cc: Qing Wang Cc: Rodrigo Vivi Cc: Sebastian Reichel Cc: Sergey Senozhatsky Cc: Stephen Kitt Cc: Tetsuo Handa Cc: Douglas Gilbert Cc: James E.J. Bottomley Cc: Jani Nikula Cc: John Ogness Cc: Martin K. Petersen Cc: "Rafael J. Wysocki" Cc: Steven Rostedt (VMware) Cc: Suren Baghdasaryan Cc: "Theodore Ts'o" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 04bc883c986d9c8a64fc1f1cc2cbc328c2b2a496 Author: Luis Chamberlain Date: Fri Jan 21 22:11:54 2022 -0800 test_sysctl: simplify subdirectory registration with register_sysctl() There is no need to user boiler plate code to specify a set of base directories we're going to stuff sysctls under. Simplify this by using register_sysctl() and specifying the directory path directly. // pycocci sysctl-subdir-register-sysctl-simplify.cocci lib/test_sysctl.c @c1@ expression E1; identifier subdir, sysctls; @@ static struct ctl_table subdir[] = { { .procname = E1, .maxlen = 0, .mode = 0555, .child = sysctls, }, { } }; @c2@ identifier c1.subdir; expression E2; identifier base; @@ static struct ctl_table base[] = { { .procname = E2, .maxlen = 0, .mode = 0555, .child = subdir, }, { } }; @c3@ identifier c2.base; identifier header; @@ header = register_sysctl_table(base); @r1 depends on c1 && c2 && c3@ expression c1.E1; identifier c1.subdir, c1.sysctls; @@ -static struct ctl_table subdir[] = { - { - .procname = E1, - .maxlen = 0, - .mode = 0555, - .child = sysctls, - }, - { } -}; @r2 depends on c1 && c2 && c3@ identifier c1.subdir; expression c2.E2; identifier c2.base; @@ -static struct ctl_table base[] = { - { - .procname = E2, - .maxlen = 0, - .mode = 0555, - .child = subdir, - }, - { } -}; @initialize:python@ @@ def make_my_fresh_expression(s1, s2): return '"' + s1.strip('"') + "/" + s2.strip('"') + '"' @r3 depends on c1 && c2 && c3@ expression c1.E1; identifier c1.sysctls; expression c2.E2; identifier c2.base; identifier c3.header; fresh identifier E3 = script:python(E2, E1) { make_my_fresh_expression(E2, E1) }; @@ header = -register_sysctl_table(base); +register_sysctl(E3, sysctls); Generated-by: Coccinelle SmPL Link: https://lkml.kernel.org/r/20211123202422.819032-6-mcgrof@kernel.org Signed-off-by: Luis Chamberlain Cc: Al Viro Cc: Amir Goldstein Cc: Andy Shevchenko Cc: Antti Palosaari Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Benjamin LaHaise Cc: Clemens Ladisch Cc: David Airlie Cc: "Eric W. Biederman" Cc: Greg Kroah-Hartman Cc: Iurii Zaikin Cc: Jani Nikula Cc: Jan Kara Cc: Joel Becker Cc: Joonas Lahtinen Cc: Joseph Qi Cc: Julia Lawall Cc: Kees Cook Cc: Lukas Middendorf Cc: Mark Fasheh Cc: Paul Turner Cc: Peter Zijlstra Cc: Petr Mladek Cc: Phillip Potter Cc: Qing Wang Cc: Rodrigo Vivi Cc: Sebastian Reichel Cc: Sergey Senozhatsky Cc: Stephen Kitt Cc: Tetsuo Handa Cc: Xiaoming Ni Cc: Douglas Gilbert Cc: James E.J. Bottomley Cc: Jani Nikula Cc: John Ogness Cc: Martin K. Petersen Cc: "Rafael J. Wysocki" Cc: Steven Rostedt (VMware) Cc: Suren Baghdasaryan Cc: "Theodore Ts'o" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c42ff46f97c1c25577a84fbfb111710d25a129e0 Author: Luis Chamberlain Date: Fri Jan 21 22:11:49 2022 -0800 ocfs2: simplify subdirectory registration with register_sysctl() There is no need to user boiler plate code to specify a set of base directories we're going to stuff sysctls under. Simplify this by using register_sysctl() and specifying the directory path directly. // pycocci sysctl-subdir-register-sysctl-simplify.cocci PATH @c1@ expression E1; identifier subdir, sysctls; @@ static struct ctl_table subdir[] = { { .procname = E1, .maxlen = 0, .mode = 0555, .child = sysctls, }, { } }; @c2@ identifier c1.subdir; expression E2; identifier base; @@ static struct ctl_table base[] = { { .procname = E2, .maxlen = 0, .mode = 0555, .child = subdir, }, { } }; @c3@ identifier c2.base; identifier header; @@ header = register_sysctl_table(base); @r1 depends on c1 && c2 && c3@ expression c1.E1; identifier c1.subdir, c1.sysctls; @@ -static struct ctl_table subdir[] = { - { - .procname = E1, - .maxlen = 0, - .mode = 0555, - .child = sysctls, - }, - { } -}; @r2 depends on c1 && c2 && c3@ identifier c1.subdir; expression c2.E2; identifier c2.base; @@ -static struct ctl_table base[] = { - { - .procname = E2, - .maxlen = 0, - .mode = 0555, - .child = subdir, - }, - { } -}; @initialize:python@ @@ def make_my_fresh_expression(s1, s2): return '"' + s1.strip('"') + "/" + s2.strip('"') + '"' @r3 depends on c1 && c2 && c3@ expression c1.E1; identifier c1.sysctls; expression c2.E2; identifier c2.base; identifier c3.header; fresh identifier E3 = script:python(E2, E1) { make_my_fresh_expression(E2, E1) }; @@ header = -register_sysctl_table(base); +register_sysctl(E3, sysctls); Generated-by: Coccinelle SmPL Link: https://lkml.kernel.org/r/20211123202422.819032-5-mcgrof@kernel.org Signed-off-by: Luis Chamberlain Reviewed-by: Jan Kara Cc: Al Viro Cc: Amir Goldstein Cc: Andy Shevchenko Cc: Antti Palosaari Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Benjamin LaHaise Cc: Clemens Ladisch Cc: David Airlie Cc: "Eric W. Biederman" Cc: Greg Kroah-Hartman Cc: Iurii Zaikin Cc: Jani Nikula Cc: Joel Becker Cc: Joonas Lahtinen Cc: Joseph Qi Cc: Julia Lawall Cc: Kees Cook Cc: Lukas Middendorf Cc: Mark Fasheh Cc: Paul Turner Cc: Peter Zijlstra Cc: Petr Mladek Cc: Phillip Potter Cc: Qing Wang Cc: Rodrigo Vivi Cc: Sebastian Reichel Cc: Sergey Senozhatsky Cc: Stephen Kitt Cc: Tetsuo Handa Cc: Xiaoming Ni Cc: Douglas Gilbert Cc: James E.J. Bottomley Cc: Jani Nikula Cc: John Ogness Cc: Martin K. Petersen Cc: "Rafael J. Wysocki" Cc: Steven Rostedt (VMware) Cc: Suren Baghdasaryan Cc: "Theodore Ts'o" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e99f5e7479110868ac04c5f6593a15c2da61f969 Author: Luis Chamberlain Date: Fri Jan 21 22:11:44 2022 -0800 macintosh/mac_hid.c: simplify subdirectory registration with register_sysctl() There is no need to user boiler plate code to specify a set of base directories we're going to stuff sysctls under. Simplify this by using register_sysctl() and specifying the directory path directly. // pycocci sysctl-subdir-register-sysctl-simplify.cocci PATH @c1@ expression E1; identifier subdir, sysctls; @@ static struct ctl_table subdir[] = { { .procname = E1, .maxlen = 0, .mode = 0555, .child = sysctls, }, { } }; @c2@ identifier c1.subdir; expression E2; identifier base; @@ static struct ctl_table base[] = { { .procname = E2, .maxlen = 0, .mode = 0555, .child = subdir, }, { } }; @c3@ identifier c2.base; identifier header; @@ header = register_sysctl_table(base); @r1 depends on c1 && c2 && c3@ expression c1.E1; identifier c1.subdir, c1.sysctls; @@ -static struct ctl_table subdir[] = { - { - .procname = E1, - .maxlen = 0, - .mode = 0555, - .child = sysctls, - }, - { } -}; @r2 depends on c1 && c2 && c3@ identifier c1.subdir; expression c2.E2; identifier c2.base; @@ -static struct ctl_table base[] = { - { - .procname = E2, - .maxlen = 0, - .mode = 0555, - .child = subdir, - }, - { } -}; @initialize:python@ @@ def make_my_fresh_expression(s1, s2): return '"' + s1.strip('"') + "/" + s2.strip('"') + '"' @r3 depends on c1 && c2 && c3@ expression c1.E1; identifier c1.sysctls; expression c2.E2; identifier c2.base; identifier c3.header; fresh identifier E3 = script:python(E2, E1) { make_my_fresh_expression(E2, E1) }; @@ header = -register_sysctl_table(base); +register_sysctl(E3, sysctls); Generated-by: Coccinelle SmPL Link: https://lkml.kernel.org/r/20211123202422.819032-4-mcgrof@kernel.org Signed-off-by: Luis Chamberlain Cc: Al Viro Cc: Amir Goldstein Cc: Andy Shevchenko Cc: Antti Palosaari Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Benjamin LaHaise Cc: Clemens Ladisch Cc: David Airlie Cc: "Eric W. Biederman" Cc: Greg Kroah-Hartman Cc: Iurii Zaikin Cc: Jani Nikula Cc: Jan Kara Cc: Joel Becker Cc: Joonas Lahtinen Cc: Joseph Qi Cc: Julia Lawall Cc: Kees Cook Cc: Lukas Middendorf Cc: Mark Fasheh Cc: Paul Turner Cc: Peter Zijlstra Cc: Petr Mladek Cc: Phillip Potter Cc: Qing Wang Cc: Rodrigo Vivi Cc: Sebastian Reichel Cc: Sergey Senozhatsky Cc: Stephen Kitt Cc: Tetsuo Handa Cc: Xiaoming Ni Cc: Douglas Gilbert Cc: James E.J. Bottomley Cc: Jani Nikula Cc: John Ogness Cc: Martin K. Petersen Cc: "Rafael J. Wysocki" Cc: Steven Rostedt (VMware) Cc: Suren Baghdasaryan Cc: "Theodore Ts'o" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e5a1fd997cc2deda1b08d5faae04625de0440a1e Author: Luis Chamberlain Date: Fri Jan 21 22:11:39 2022 -0800 i915: simplify subdirectory registration with register_sysctl() There is no need to user boiler plate code to specify a set of base directories we're going to stuff sysctls under. Simplify this by using register_sysctl() and specifying the directory path directly. // pycocci sysctl-subdir-register-sysctl-simplify.cocci PATH @c1@ expression E1; identifier subdir, sysctls; @@ static struct ctl_table subdir[] = { { .procname = E1, .maxlen = 0, .mode = 0555, .child = sysctls, }, { } }; @c2@ identifier c1.subdir; expression E2; identifier base; @@ static struct ctl_table base[] = { { .procname = E2, .maxlen = 0, .mode = 0555, .child = subdir, }, { } }; @c3@ identifier c2.base; identifier header; @@ header = register_sysctl_table(base); @r1 depends on c1 && c2 && c3@ expression c1.E1; identifier c1.subdir, c1.sysctls; @@ -static struct ctl_table subdir[] = { - { - .procname = E1, - .maxlen = 0, - .mode = 0555, - .child = sysctls, - }, - { } -}; @r2 depends on c1 && c2 && c3@ identifier c1.subdir; expression c2.E2; identifier c2.base; @@ -static struct ctl_table base[] = { - { - .procname = E2, - .maxlen = 0, - .mode = 0555, - .child = subdir, - }, - { } -}; @initialize:python@ @@ def make_my_fresh_expression(s1, s2): return '"' + s1.strip('"') + "/" + s2.strip('"') + '"' @r3 depends on c1 && c2 && c3@ expression c1.E1; identifier c1.sysctls; expression c2.E2; identifier c2.base; identifier c3.header; fresh identifier E3 = script:python(E2, E1) { make_my_fresh_expression(E2, E1) }; @@ header = -register_sysctl_table(base); +register_sysctl(E3, sysctls); Generated-by: Coccinelle SmPL Link: https://lkml.kernel.org/r/20211123202422.819032-3-mcgrof@kernel.org Signed-off-by: Luis Chamberlain Acked-by: Jani Nikula Cc: Al Viro Cc: Amir Goldstein Cc: Andy Shevchenko Cc: Antti Palosaari Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Benjamin LaHaise Cc: Clemens Ladisch Cc: David Airlie Cc: "Eric W. Biederman" Cc: Greg Kroah-Hartman Cc: Iurii Zaikin Cc: Jan Kara Cc: Joel Becker Cc: Joonas Lahtinen Cc: Joseph Qi Cc: Julia Lawall Cc: Kees Cook Cc: Lukas Middendorf Cc: Mark Fasheh Cc: Paul Turner Cc: Peter Zijlstra Cc: Petr Mladek Cc: Phillip Potter Cc: Qing Wang Cc: Rodrigo Vivi Cc: Sebastian Reichel Cc: Sergey Senozhatsky Cc: Stephen Kitt Cc: Tetsuo Handa Cc: Xiaoming Ni Cc: Douglas Gilbert Cc: James E.J. Bottomley Cc: Jani Nikula Cc: John Ogness Cc: Martin K. Petersen Cc: "Rafael J. Wysocki" Cc: Steven Rostedt (VMware) Cc: Suren Baghdasaryan Cc: "Theodore Ts'o" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c8dd55410ba07de602169e037cbb62e495ad1880 Author: Luis Chamberlain Date: Fri Jan 21 22:11:34 2022 -0800 hpet: simplify subdirectory registration with register_sysctl() Patch series "sysctl: second set of kernel/sysctl cleanups", v2. This is the 2nd set of kernel/sysctl.c cleanups. The diff stat should reflect how this is a much better way to deal with theses. Fortunately coccinelle can be used to ensure correctness for most of these and/or future merge conflicts. Note that since this is part of a larger effort to cleanup kernel/sysctl.c I think we have no other option but to go with merging these patches in either Andrew's tree or keep them staged in a separate tree and send a merge request later. Otherwise kernel/sysctl.c will end up becoming a sore spot for the next merge window. This patch (of 8): There is no need to user boiler plate code to specify a set of base directories we're going to stuff sysctls under. Simplify this by using register_sysctl() and specifying the directory path directly. // pycocci sysctl-subdir-register-sysctl-simplify.cocci drivers/char/hpet.c @c1@ expression E1; identifier subdir, sysctls; @@ static struct ctl_table subdir[] = { { .procname = E1, .maxlen = 0, .mode = 0555, .child = sysctls, }, { } }; @c2@ identifier c1.subdir; expression E2; identifier base; @@ static struct ctl_table base[] = { { .procname = E2, .maxlen = 0, .mode = 0555, .child = subdir, }, { } }; @c3@ identifier c2.base; identifier header; @@ header = register_sysctl_table(base); @r1 depends on c1 && c2 && c3@ expression c1.E1; identifier c1.subdir, c1.sysctls; @@ -static struct ctl_table subdir[] = { - { - .procname = E1, - .maxlen = 0, - .mode = 0555, - .child = sysctls, - }, - { } -}; @r2 depends on c1 && c2 && c3@ identifier c1.subdir; expression c2.E2; identifier c2.base; @@ -static struct ctl_table base[] = { - { - .procname = E2, - .maxlen = 0, - .mode = 0555, - .child = subdir, - }, - { } -}; @initialize:python@ @@ def make_my_fresh_expression(s1, s2): return '"' + s1.strip('"') + "/" + s2.strip('"') + '"' @r3 depends on c1 && c2 && c3@ expression c1.E1; identifier c1.sysctls; expression c2.E2; identifier c2.base; identifier c3.header; fresh identifier E3 = script:python(E2, E1) { make_my_fresh_expression(E2, E1) }; @@ header = -register_sysctl_table(base); +register_sysctl(E3, sysctls); Generated-by: Coccinelle SmPL Link: https://lkml.kernel.org/r/20211123202422.819032-1-mcgrof@kernel.org Link: https://lkml.kernel.org/r/20211123202422.819032-2-mcgrof@kernel.org Signed-off-by: Luis Chamberlain Cc: Kees Cook Cc: Iurii Zaikin Cc: Xiaoming Ni Cc: "Eric W. Biederman" Cc: Clemens Ladisch Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Rodrigo Vivi Cc: David Airlie Cc: Benjamin Herrenschmidt Cc: Mark Fasheh Cc: Joel Becker Cc: Joseph Qi Cc: Jan Kara Cc: Amir Goldstein Cc: Phillip Potter Cc: Al Viro Cc: Julia Lawall Cc: Lukas Middendorf Cc: Antti Palosaari Cc: Andy Shevchenko Cc: Benjamin LaHaise Cc: Paul Turner Cc: Peter Zijlstra Cc: Petr Mladek Cc: Qing Wang Cc: Sebastian Reichel Cc: Sergey Senozhatsky Cc: Stephen Kitt Cc: Tetsuo Handa Cc: Douglas Gilbert Cc: James E.J. Bottomley Cc: Jani Nikula Cc: John Ogness Cc: Martin K. Petersen Cc: "Rafael J. Wysocki" Cc: Steven Rostedt (VMware) Cc: Suren Baghdasaryan Cc: "Theodore Ts'o" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 49a4de75719b6c0f1f375df9908a95cef1e34945 Author: Xiaoming Ni Date: Fri Jan 21 22:11:29 2022 -0800 dnotify: move dnotify sysctl to dnotify.c The kernel/sysctl.c is a kitchen sink where everyone leaves their dirty dishes, this makes it very difficult to maintain. To help with this maintenance let's start by moving sysctls to places where they actually belong. The proc sysctl maintainers do not want to know what sysctl knobs you wish to add for your own piece of code, we just care about the core logic. So move dnotify sysctls to dnotify.c and use the new register_sysctl_init() to register the sysctl interface. [mcgrof@kernel.org: adjust the commit log to justify the move] Link: https://lkml.kernel.org/r/20211123202347.818157-10-mcgrof@kernel.org Signed-off-by: Xiaoming Ni Signed-off-by: Luis Chamberlain Acked-by: Jan Kara Cc: Al Viro Cc: Amir Goldstein Cc: Andy Shevchenko Cc: Benjamin LaHaise Cc: "Eric W. Biederman" Cc: Greg Kroah-Hartman Cc: Iurii Zaikin Cc: Kees Cook Cc: Paul Turner Cc: Peter Zijlstra Cc: Petr Mladek Cc: Qing Wang Cc: Sebastian Reichel Cc: Sergey Senozhatsky Cc: Stephen Kitt Cc: Tetsuo Handa Cc: Antti Palosaari Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Clemens Ladisch Cc: David Airlie Cc: Jani Nikula Cc: Joel Becker Cc: Joonas Lahtinen Cc: Joseph Qi Cc: Julia Lawall Cc: Lukas Middendorf Cc: Mark Fasheh Cc: Phillip Potter Cc: Rodrigo Vivi Cc: Douglas Gilbert Cc: James E.J. Bottomley Cc: Jani Nikula Cc: John Ogness Cc: Martin K. Petersen Cc: "Rafael J. Wysocki" Cc: Steven Rostedt (VMware) Cc: Suren Baghdasaryan Cc: "Theodore Ts'o" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 86b12b6c5d6b46e64bf2e8080528781032e4bd90 Author: Xiaoming Ni Date: Fri Jan 21 22:11:24 2022 -0800 aio: move aio sysctl to aio.c The kernel/sysctl.c is a kitchen sink where everyone leaves their dirty dishes, this makes it very difficult to maintain. To help with this maintenance let's start by moving sysctls to places where they actually belong. The proc sysctl maintainers do not want to know what sysctl knobs you wish to add for your own piece of code, we just care about the core logic. Move aio sysctl to aio.c and use the new register_sysctl_init() to register the sysctl interface for aio. [mcgrof@kernel.org: adjust commit log to justify the move] Link: https://lkml.kernel.org/r/20211123202347.818157-9-mcgrof@kernel.org Signed-off-by: Xiaoming Ni Signed-off-by: Luis Chamberlain Reviewed-by: Jan Kara Cc: Al Viro Cc: Amir Goldstein Cc: Andy Shevchenko Cc: Benjamin LaHaise Cc: "Eric W. Biederman" Cc: Greg Kroah-Hartman Cc: Iurii Zaikin Cc: Kees Cook Cc: Paul Turner Cc: Peter Zijlstra Cc: Petr Mladek Cc: Qing Wang Cc: Sebastian Reichel Cc: Sergey Senozhatsky Cc: Stephen Kitt Cc: Tetsuo Handa Cc: Antti Palosaari Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Clemens Ladisch Cc: David Airlie Cc: Jani Nikula Cc: Joel Becker Cc: Joonas Lahtinen Cc: Joseph Qi Cc: Julia Lawall Cc: Lukas Middendorf Cc: Mark Fasheh Cc: Phillip Potter Cc: Rodrigo Vivi Cc: Douglas Gilbert Cc: James E.J. Bottomley Cc: Jani Nikula Cc: John Ogness Cc: Martin K. Petersen Cc: "Rafael J. Wysocki" Cc: Steven Rostedt (VMware) Cc: Suren Baghdasaryan Cc: "Theodore Ts'o" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 2452dcb9f7f2bab5b47344148bc23a732be9195c Author: Xiaoming Ni Date: Fri Jan 21 22:11:19 2022 -0800 sysctl: use SYSCTL_ZERO to replace some static int zero uses Use the variable SYSCTL_ZERO to replace some static int boundary variables with a value of 0 (minolduid, min_extfrag_threshold, min_wakeup_granularity_ns). Link: https://lkml.kernel.org/r/20211123202347.818157-8-mcgrof@kernel.org Signed-off-by: Xiaoming Ni Signed-off-by: Luis Chamberlain Cc: Al Viro Cc: Amir Goldstein Cc: Andy Shevchenko Cc: Benjamin LaHaise Cc: "Eric W. Biederman" Cc: Greg Kroah-Hartman Cc: Iurii Zaikin Cc: Jan Kara Cc: Kees Cook Cc: Paul Turner Cc: Peter Zijlstra Cc: Petr Mladek Cc: Qing Wang Cc: Sebastian Reichel Cc: Sergey Senozhatsky Cc: Stephen Kitt Cc: Tetsuo Handa Cc: Antti Palosaari Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Clemens Ladisch Cc: David Airlie Cc: Jani Nikula Cc: Joel Becker Cc: Joonas Lahtinen Cc: Joseph Qi Cc: Julia Lawall Cc: Lukas Middendorf Cc: Mark Fasheh Cc: Phillip Potter Cc: Rodrigo Vivi Cc: Douglas Gilbert Cc: James E.J. Bottomley Cc: Jani Nikula Cc: John Ogness Cc: Martin K. Petersen Cc: "Rafael J. Wysocki" Cc: Steven Rostedt (VMware) Cc: Suren Baghdasaryan Cc: "Theodore Ts'o" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit d73840ec2f747b860331bbba53677d0ce38fb9c1 Author: Xiaoming Ni Date: Fri Jan 21 22:11:14 2022 -0800 sysctl: use const for typically used max/min proc sysctls When proc_dointvec_minmax() or proc_doulongvec_minmax() are used we are using the extra1 and extra2 parameters on the sysctl table only for a min and max boundary, these extra1 and extra2 arguments are then used for read-only operations. So make them const to reflect this. [mcgrof@kernel.org: commit log love] Link: https://lkml.kernel.org/r/20211123202347.818157-7-mcgrof@kernel.org Signed-off-by: Xiaoming Ni Signed-off-by: Luis Chamberlain Cc: Al Viro Cc: Amir Goldstein Cc: Andy Shevchenko Cc: Benjamin LaHaise Cc: "Eric W. Biederman" Cc: Greg Kroah-Hartman Cc: Iurii Zaikin Cc: Jan Kara Cc: Kees Cook Cc: Paul Turner Cc: Peter Zijlstra Cc: Petr Mladek Cc: Qing Wang Cc: Sebastian Reichel Cc: Sergey Senozhatsky Cc: Stephen Kitt Cc: Tetsuo Handa Cc: Antti Palosaari Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Clemens Ladisch Cc: David Airlie Cc: Jani Nikula Cc: Joel Becker Cc: Joonas Lahtinen Cc: Joseph Qi Cc: Julia Lawall Cc: Lukas Middendorf Cc: Mark Fasheh Cc: Phillip Potter Cc: Rodrigo Vivi Cc: Douglas Gilbert Cc: James E.J. Bottomley Cc: Jani Nikula Cc: John Ogness Cc: Martin K. Petersen Cc: "Rafael J. Wysocki" Cc: Steven Rostedt (VMware) Cc: Suren Baghdasaryan Cc: "Theodore Ts'o" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit f628867da46f8867e1854e43d7200e42ec22eee2 Author: Stephen Kitt Date: Fri Jan 21 22:11:09 2022 -0800 sysctl: make ngroups_max const ngroups_max is a read-only sysctl entry, reflecting NGROUPS_MAX. Make it const, in the same way as cap_last_cap. Link: https://lkml.kernel.org/r/20211123202347.818157-6-mcgrof@kernel.org Signed-off-by: Stephen Kitt Signed-off-by: Luis Chamberlain Cc: Al Viro Cc: Amir Goldstein Cc: Andy Shevchenko Cc: Benjamin LaHaise Cc: "Eric W. Biederman" Cc: Greg Kroah-Hartman Cc: Iurii Zaikin Cc: Jan Kara Cc: Kees Cook Cc: Paul Turner Cc: Peter Zijlstra Cc: Petr Mladek Cc: Qing Wang Cc: Sebastian Reichel Cc: Sergey Senozhatsky Cc: Tetsuo Handa Cc: Xiaoming Ni Cc: Antti Palosaari Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Clemens Ladisch Cc: David Airlie Cc: Jani Nikula Cc: Joel Becker Cc: Joonas Lahtinen Cc: Joseph Qi Cc: Julia Lawall Cc: Lukas Middendorf Cc: Mark Fasheh Cc: Phillip Potter Cc: Rodrigo Vivi Cc: Douglas Gilbert Cc: James E.J. Bottomley Cc: Jani Nikula Cc: John Ogness Cc: Martin K. Petersen Cc: "Rafael J. Wysocki" Cc: Steven Rostedt (VMware) Cc: Suren Baghdasaryan Cc: "Theodore Ts'o" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit dd0693fdf054f2ed37202ed56649ae2cccd29474 Author: Xiaoming Ni Date: Fri Jan 21 22:11:05 2022 -0800 watchdog: move watchdog sysctl interface to watchdog.c The kernel/sysctl.c is a kitchen sink where everyone leaves their dirty dishes, this makes it very difficult to maintain. To help with this maintenance let's start by moving sysctls to places where they actually belong. The proc sysctl maintainers do not want to know what sysctl knobs you wish to add for your own piece of code, we just care about the core logic of proc sysctl. So, move the watchdog syscl interface to watchdog.c. Use register_sysctl() to register the sysctl interface to avoid merge conflicts when different features modify sysctl.c at the same time. [mcgrof@kernel.org: justify the move on the commit log] Link: https://lkml.kernel.org/r/20211123202347.818157-5-mcgrof@kernel.org Signed-off-by: Xiaoming Ni Signed-off-by: Luis Chamberlain Reviewed-by: Kees Cook Reviewed-by: Petr Mladek Cc: Al Viro Cc: Amir Goldstein Cc: Andy Shevchenko Cc: Benjamin LaHaise Cc: "Eric W. Biederman" Cc: Greg Kroah-Hartman Cc: Iurii Zaikin Cc: Jan Kara Cc: Paul Turner Cc: Peter Zijlstra Cc: Qing Wang Cc: Sebastian Reichel Cc: Sergey Senozhatsky Cc: Stephen Kitt Cc: Tetsuo Handa Cc: Antti Palosaari Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Clemens Ladisch Cc: David Airlie Cc: Jani Nikula Cc: Joel Becker Cc: Joonas Lahtinen Cc: Joseph Qi Cc: Julia Lawall Cc: Lukas Middendorf Cc: Mark Fasheh Cc: Phillip Potter Cc: Rodrigo Vivi Cc: Douglas Gilbert Cc: James E.J. Bottomley Cc: Jani Nikula Cc: John Ogness Cc: Martin K. Petersen Cc: "Rafael J. Wysocki" Cc: Steven Rostedt (VMware) Cc: Suren Baghdasaryan Cc: "Theodore Ts'o" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit bbe7a10ed83a5fa0b0ff6161ecdc4e65a0e9c993 Author: Xiaoming Ni Date: Fri Jan 21 22:11:00 2022 -0800 hung_task: move hung_task sysctl interface to hung_task.c The kernel/sysctl.c is a kitchen sink where everyone leaves their dirty dishes, this makes it very difficult to maintain. To help with this maintenance let's start by moving sysctls to places where they actually belong. The proc sysctl maintainers do not want to know what sysctl knobs you wish to add for your own piece of code, we just care about the core logic. So move hung_task sysctl interface to hung_task.c and use register_sysctl() to register the sysctl interface. [mcgrof@kernel.org: commit log refresh and fixed 2-3 0day reported compile issues] Link: https://lkml.kernel.org/r/20211123202347.818157-4-mcgrof@kernel.org Signed-off-by: Xiaoming Ni Signed-off-by: Luis Chamberlain Reviewed-by: Kees Cook Reviewed-by: Petr Mladek Cc: Al Viro Cc: Amir Goldstein Cc: Andy Shevchenko Cc: Benjamin LaHaise Cc: "Eric W. Biederman" Cc: Greg Kroah-Hartman Cc: Iurii Zaikin Cc: Jan Kara Cc: Paul Turner Cc: Peter Zijlstra Cc: Qing Wang Cc: Sebastian Reichel Cc: Sergey Senozhatsky Cc: Stephen Kitt Cc: Tetsuo Handa Cc: Antti Palosaari Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Clemens Ladisch Cc: David Airlie Cc: Jani Nikula Cc: Joel Becker Cc: Joonas Lahtinen Cc: Joseph Qi Cc: Julia Lawall Cc: Lukas Middendorf Cc: Mark Fasheh Cc: Phillip Potter Cc: Rodrigo Vivi Cc: Douglas Gilbert Cc: James E.J. Bottomley Cc: Jani Nikula Cc: John Ogness Cc: Martin K. Petersen Cc: "Rafael J. Wysocki" Cc: Steven Rostedt (VMware) Cc: Suren Baghdasaryan Cc: "Theodore Ts'o" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 78e36f3b0dae586f623c4a37ec5eb5496f5abbe1 Author: Xiaoming Ni Date: Fri Jan 21 22:10:55 2022 -0800 sysctl: move some boundary constants from sysctl.c to sysctl_vals sysctl has helpers which let us specify boundary values for a min or max int value. Since these are used for a boundary check only they don't change, so move these variables to sysctl_vals to avoid adding duplicate variables. This will help with our cleanup of kernel/sysctl.c. [akpm@linux-foundation.org: update it for "mm/pagealloc: sysctl: change watermark_scale_factor max limit to 30%"] [mcgrof@kernel.org: major rebase] Link: https://lkml.kernel.org/r/20211123202347.818157-3-mcgrof@kernel.org Signed-off-by: Xiaoming Ni Signed-off-by: Luis Chamberlain Reviewed-by: Kees Cook Cc: Al Viro Cc: Amir Goldstein Cc: Andy Shevchenko Cc: Benjamin LaHaise Cc: "Eric W. Biederman" Cc: Greg Kroah-Hartman Cc: Iurii Zaikin Cc: Jan Kara Cc: Paul Turner Cc: Peter Zijlstra Cc: Petr Mladek Cc: Qing Wang Cc: Sebastian Reichel Cc: Sergey Senozhatsky Cc: Stephen Kitt Cc: Tetsuo Handa Cc: Antti Palosaari Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Clemens Ladisch Cc: David Airlie Cc: Jani Nikula Cc: Joel Becker Cc: Joonas Lahtinen Cc: Joseph Qi Cc: Julia Lawall Cc: Lukas Middendorf Cc: Mark Fasheh Cc: Phillip Potter Cc: Rodrigo Vivi Cc: Douglas Gilbert Cc: James E.J. Bottomley Cc: Jani Nikula Cc: John Ogness Cc: Martin K. Petersen Cc: "Rafael J. Wysocki" Cc: Steven Rostedt (VMware) Cc: Suren Baghdasaryan Cc: "Theodore Ts'o" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3ddd9a808cee7284931312f2f3e854c9617f44b2 Author: Xiaoming Ni Date: Fri Jan 21 22:10:50 2022 -0800 sysctl: add a new register_sysctl_init() interface Patch series "sysctl: first set of kernel/sysctl cleanups", v2. Finally had time to respin the series of the work we had started last year on cleaning up the kernel/sysct.c kitchen sink. People keeps stuffing their sysctls in that file and this creates a maintenance burden. So this effort is aimed at placing sysctls where they actually belong. I'm going to split patches up into series as there is quite a bit of work. This first set adds register_sysctl_init() for uses of registerting a sysctl on the init path, adds const where missing to a few places, generalizes common values so to be more easy to share, and starts the move of a few kernel/sysctl.c out where they belong. The majority of rework on v2 in this first patch set is 0-day fixes. Eric Biederman's feedback is later addressed in subsequent patch sets. I'll only post the first two patch sets for now. We can address the rest once the first two patch sets get completely reviewed / Acked. This patch (of 9): The kernel/sysctl.c is a kitchen sink where everyone leaves their dirty dishes, this makes it very difficult to maintain. To help with this maintenance let's start by moving sysctls to places where they actually belong. The proc sysctl maintainers do not want to know what sysctl knobs you wish to add for your own piece of code, we just care about the core logic. Today though folks heavily rely on tables on kernel/sysctl.c so they can easily just extend this table with their needed sysctls. In order to help users move their sysctls out we need to provide a helper which can be used during code initialization. We special-case the initialization use of register_sysctl() since it *is* safe to fail, given all that sysctls do is provide a dynamic interface to query or modify at runtime an existing variable. So the use case of register_sysctl() on init should *not* stop if the sysctls don't end up getting registered. It would be counter productive to stop boot if a simple sysctl registration failed. Provide a helper for init then, and document the recommended init levels to use for callers of this routine. We will later use this in subsequent patches to start slimming down kernel/sysctl.c tables and moving sysctl registration to the code which actually needs these sysctls. [mcgrof@kernel.org: major commit log and documentation rephrasing also moved to fs/proc/proc_sysctl.c ] Link: https://lkml.kernel.org/r/20211123202347.818157-1-mcgrof@kernel.org Link: https://lkml.kernel.org/r/20211123202347.818157-2-mcgrof@kernel.org Signed-off-by: Xiaoming Ni Signed-off-by: Luis Chamberlain Reviewed-by: Kees Cook Cc: Iurii Zaikin Cc: "Eric W. Biederman" Cc: Peter Zijlstra Cc: Greg Kroah-Hartman Cc: Paul Turner Cc: Andy Shevchenko Cc: Sebastian Reichel Cc: Tetsuo Handa Cc: Petr Mladek Cc: Sergey Senozhatsky Cc: Qing Wang Cc: Benjamin LaHaise Cc: Al Viro Cc: Jan Kara Cc: Amir Goldstein Cc: Stephen Kitt Cc: Antti Palosaari Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Clemens Ladisch Cc: David Airlie Cc: Jani Nikula Cc: Joel Becker Cc: Joonas Lahtinen Cc: Joseph Qi Cc: Julia Lawall Cc: Lukas Middendorf Cc: Mark Fasheh Cc: Phillip Potter Cc: Rodrigo Vivi Cc: Douglas Gilbert Cc: James E.J. Bottomley Cc: Jani Nikula Cc: John Ogness Cc: Martin K. Petersen Cc: "Rafael J. Wysocki" Cc: Steven Rostedt (VMware) Cc: Suren Baghdasaryan Cc: "Theodore Ts'o" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ffa65753c43142f3b803486442813744da71cff2 Author: Alistair Popple Date: Fri Jan 21 22:10:46 2022 -0800 mm/migrate.c: rework migration_entry_wait() to not take a pageref This fixes the FIXME in migrate_vma_check_page(). Before migrating a page migration code will take a reference and check there are no unexpected page references, failing the migration if there are. When a thread faults on a migration entry it will take a temporary reference to the page to wait for the page to become unlocked signifying the migration entry has been removed. This reference is dropped just prior to waiting on the page lock, however the extra reference can cause migration failures so it is desirable to avoid taking it. As migration code already has a reference to the migrating page an extra reference to wait on PG_locked is unnecessary so long as the reference can't be dropped whilst setting up the wait. When faulting on a migration entry the ptl is taken to check the migration entry. Removing a migration entry also requires the ptl, and migration code won't drop its page reference until after the migration entry has been removed. Therefore retaining the ptl of a migration entry is sufficient to ensure the page has a reference. Reworking migration_entry_wait() to hold the ptl until the wait setup is complete means the extra page reference is no longer needed. [apopple@nvidia.com: v5] Link: https://lkml.kernel.org/r/20211213033848.1973946-1-apopple@nvidia.com Link: https://lkml.kernel.org/r/20211118020754.954425-1-apopple@nvidia.com Signed-off-by: Alistair Popple Acked-by: David Hildenbrand Cc: David Howells Cc: Hugh Dickins Cc: Jason Gunthorpe Cc: Jerome Glisse Cc: John Hubbard Cc: Matthew Wilcox (Oracle) Cc: Ralph Campbell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit afa114d987c40e72ebbbc36bedf7d66b7cdc5883 Author: Justin Iurman Date: Fri Jan 21 18:34:49 2022 +0100 selftests: net: ioam: expect support for Queue depth data The IOAM queue-depth data field was added a few weeks ago, but the test unit was not updated accordingly. Reported-by: kernel test robot Fixes: b63c5478e9cb ("ipv6: ioam: Support for Queue depth data field") Signed-off-by: Justin Iurman Link: https://lore.kernel.org/r/20220121173449.26918-1-justin.iurman@uliege.be Signed-off-by: Jakub Kicinski commit 63ec72bd58487935a2e40d2cdffe5c9498f1275e Author: Kees Cook Date: Thu Jan 20 23:39:35 2022 -0800 mptcp: Use struct_group() to avoid cross-field memset() 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. Use struct_group() to capture the fields to be reset, so that memset() can be appropriately bounds-checked by the compiler. Cc: Matthieu Baerts Cc: mptcp@lists.linux.dev Signed-off-by: Kees Cook Reviewed-by: Mat Martineau Link: https://lore.kernel.org/r/20220121073935.1154263-1-keescook@chromium.org Signed-off-by: Jakub Kicinski commit 2c13c05c5ff4b9fc907b07f7311821910ebaaf8a Author: David Howells Date: Fri Jan 21 23:12:58 2022 +0000 rxrpc: Adjust retransmission backoff Improve retransmission backoff by only backing off when we retransmit data packets rather than when we set the lost ack timer. To this end: (1) In rxrpc_resend(), use rxrpc_get_rto_backoff() when setting the retransmission timer and only tell it that we are retransmitting if we actually have things to retransmit. Note that it's possible for the retransmission algorithm to race with the processing of a received ACK, so we may see no packets needing retransmission. (2) In rxrpc_send_data_packet(), don't bump the backoff when setting the ack_lost_at timer, as it may then get bumped twice. With this, when looking at one particular packet, the retransmission intervals were seen to be 1.5ms, 2ms, 3ms, 5ms, 9ms, 17ms, 33ms, 71ms, 136ms, 264ms, 544ms, 1.088s, 2.1s, 4.2s and 8.3s. Fixes: c410bf01933e ("rxrpc: Fix the excessive initial retransmission timeout") Suggested-by: Marc Dionne Signed-off-by: David Howells Reviewed-by: Marc Dionne Tested-by: Marc Dionne cc: linux-afs@lists.infradead.org Link: https://lore.kernel.org/r/164138117069.2023386.17446904856843997127.stgit@warthog.procyon.org.uk/ Signed-off-by: David S. Miller commit d24846a4246b6e61ecbd036880a4adf61681d241 Author: Miaoqian Lin Date: Thu Jan 20 12:18:12 2022 +0000 parisc: pdc_stable: Fix memory leak in pdcs_register_pathentries kobject_init_and_add() takes reference even when it fails. According to the doc of kobject_init_and_add(): If this function returns an error, kobject_put() must be called to properly clean up the memory associated with the object. Fix memory leak by calling kobject_put(). Fixes: 73f368cf679b ("Kobject: change drivers/parisc/pdc_stable.c to use kobject_init_and_add") Signed-off-by: Miaoqian Lin Signed-off-by: Helge Deller commit cef0223191452b3c493a1070baad9ffe806babac Author: Jeffle Xu Date: Tue Dec 28 20:44:19 2021 +0800 netfs: Make ops->init_rreq() optional Make the ops->init_rreq() callback optional. This isn't required for the erofs changes I'm implementing to do on-demand read through fscache[1]. Further, ceph has an empty init_rreq method that can then be removed and it's marked optional in the documentation. Signed-off-by: Jeffle Xu Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/20211227125444.21187-1-jefflexu@linux.alibaba.com/ [1] Link: https://lore.kernel.org/r/20211228124419.103020-1-jefflexu@linux.alibaba.com Link: https://lore.kernel.org/r/164251410387.3435901.2504600788262093313.stgit@warthog.procyon.org.uk/ # v1 commit c522e3ad296b7b692ed3960dfde467f2a34b434f Author: David Howells Date: Fri Jan 7 09:28:41 2022 +0000 fscache: Add a comment explaining how page-release optimisation works Add a comment into fscache_note_page_release() to explain how the page-release optimisation logic works[1]. It's not entirely obvious as it has nothing to do with whether or not the netfs file contains data. FSCACHE_COOKIE_NO_DATA_TO_READ is set if we have no data in the cache yet (ie. the backing file lookup was negative, the file is 0 length or the cookie got invalidated). It means that we have no data in the cache, not that the file is necessarily empty on the server. FSCACHE_COOKIE_HAVE_DATA is set once we've stored data in the backing file. From that point on, we have data we *could* read - however, it's covered by pages in the netfs pagecache until at such time one of those covering pages is released. So if we've written data to the cache (HAVE_DATA) and there wasn't any data in the cache when we started (NO_DATA_TO_READ), it may no longer be true that we can skip reading from the cache. Read skipping is done by cachefiles_prepare_read(). Note that tracking is not done on a per-page basis, but only on a per-file basis. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/043a206f03929c2667a465314144e518070a9b2d.camel@kernel.org/ [1] Link: https://lore.kernel.org/r/164251408479.3435901.9540165422908194636.stgit@warthog.procyon.org.uk/ # v1 commit 6633213139d827fb9abf9a9a280f3d9e89fc7091 Author: David Howells Date: Fri Jan 7 10:57:45 2022 +0000 cachefiles: Check that the backing filesystem supports tmpfiles Add a check that the backing filesystem supports the creation of tmpfiles[1]. Suggested-by: Jeff Layton Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/568749bd7cc02908ecf6f3d6a611b6f9cf5c4afd.camel@kernel.org/ [1] Link: https://lore.kernel.org/r/164251406558.3435901.1249023136670058162.stgit@warthog.procyon.org.uk/ # v1 commit 14b9d0902dfa25dac9c41bf346aa655fdeafe5b2 Author: David Howells Date: Fri Jan 7 10:51:13 2022 +0000 cachefiles: Explain checks in a comment Add a comment to explain the checks that cachefiles is making of the backing filesystem[1]. Suggested-by: Jeff Layton Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/568749bd7cc02908ecf6f3d6a611b6f9cf5c4afd.camel@kernel.org/ [1] Link: https://lore.kernel.org/r/164251405621.3435901.771439791811515914.stgit@warthog.procyon.org.uk/ # v1 commit b64a3314989df8e44c114f377808407f36dbf4f4 Author: David Howells Date: Fri Jan 14 11:05:13 2022 +0000 cachefiles: Trace active-mark failure Add a tracepoint to log failure to apply an active mark to a file in addition to tracing successfully setting and unsetting the mark. Also include the backing file inode number in the message logged to dmesg. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/164251404666.3435901.17331742792401482190.stgit@warthog.procyon.org.uk/ # v1 commit 8c39b8bc82aafcc8dd378bd79c76fac8e8a89c8d Author: David Howells Date: Fri Jan 14 11:44:54 2022 +0000 cachefiles: Make some tracepoint adjustments Make some adjustments to tracepoints to make the tracing a bit more followable: (1) Standardise on displaying the backing inode number as "B=" with no leading zeros. (2) Make the cachefiles_lookup tracepoint log the directory inode number as well as the looked-up inode number. (3) Add a cachefiles_lookup tracepoint into cachefiles_get_directory() to log directory lookup. (4) Add a new cachefiles_mkdir tracepoint and use that to log a successful mkdir from cachefiles_get_directory(). (5) Make the cachefiles_unlink and cachefiles_rename tracepoints log the inode number of the affected file/dir rather than dentry struct pointers. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/164251403694.3435901.9797725381831316715.stgit@warthog.procyon.org.uk/ # v1 commit c7ca73155762684a896ba57edf48519b645ea528 Author: Jeffle Xu Date: Fri Jan 14 15:30:29 2022 +0800 cachefiles: set default tag name if it's unspecified fscache_acquire_cache() requires a non-empty name, while 'tag ' command is optional for cachefilesd. Thus set default tag name if it's unspecified to avoid the regression of cachefilesd. The logic is the same with that before rewritten. Signed-off-by: Jeffle Xu Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/164251399914.3435901.4761991152407411408.stgit@warthog.procyon.org.uk/ # v1 commit 5638b067d370583c6c455f019129ce33340b4142 Author: David Howells Date: Fri Jan 14 14:13:59 2022 +0000 cachefiles: Calculate the blockshift in terms of bytes, not pages Cachefiles keeps track of how much space is available on the backing filesystem and refuses new writes permission to start if there isn't enough (we especially don't want ENOSPC happening). It also tracks the amount of data pending in DIO writes (cache->b_writing) and reduces the amount of free space available by this amount before deciding if it can set up a new write. However, the old fscache I/O API was very much page-granularity dependent and, as such, cachefiles's cache->bshift was meant to be a multiplier to get from PAGE_SIZE to block size (ie. a blocksize of 512 would give a shift of 3 for a 4KiB page) - and this was incorrectly being used to turn the number of bytes in a DIO write into a number of blocks, leading to a massive over estimation of the amount of data in flight. Fix this by changing cache->bshift to be a multiplier from bytes to blocksize and deal with quantities of blocks, not quantities of pages. Fix also the rounding in the calculation in cachefiles_write() which needs a "- 1" inserting. Fixes: 047487c947e8 ("cachefiles: Implement the I/O routines") Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/164251398954.3435901.7138806620218474123.stgit@warthog.procyon.org.uk/ # v1 commit 80a00ab8344f0fe4d555a1f97960215b659436e9 Author: David Howells Date: Fri Jan 14 13:30:17 2022 +0000 fscache: Fix the volume collision wait condition The condition that the waits in fscache_wait_on_volume_collision() are waiting until are inverted. This suddenly started happening on the upstream kernel with something like the following appearing in dmesg when running xfstests: CacheFiles: cachefiles: Inode already in use: Iafs,example.com,100055 Fix them by inverting the conditions. Fixes: 62ab63352350 ("fscache: Implement volume registration") Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/164251398010.3435901.943876048104930939.stgit@warthog.procyon.org.uk/ # v1 commit f6f02040e0ca7cb2e82d8aeb8f7daf5d89acc04c Merge: 6a8d7fbf1c650 f684b10751287 a510c78e5b6f2 Author: Rafael J. Wysocki Date: Fri Jan 21 20:05:34 2022 +0100 Merge branches 'acpi-cppc' and 'acpi-dptf' Merge new ACPI CPPC driver updates and new Raptor Lake DPTF device IDs for 5.17-rc1. * acpi-cppc: ACPI: CPPC: Drop redundant local variable from cpc_read() ACPI: CPPC: Fix up I/O port access in cpc_read() * acpi-dptf: ACPI: DPTF: Support Raptor Lake commit 248be352bbae1a0f14d0d3511a5b0bb9665097f5 Author: Ajit Kumar Pandey Date: Thu Jan 20 19:06:01 2022 +0530 ASoC: amd: acp-mach: Fix Left and Right rt1019 amp devices We're setting wrong card codec conf for rt1019 amp devices in our machine driver. Due to this left and right amp channels data are reversed in our machines as wrong device prefix results in wrong value for "Mono LR Select" rt1019 mixer control. Reverse dev ids in codec conf with Left and Right name_prefix to fix such issue. Signed-off-by: Ajit Kumar Pandey Link: https://lore.kernel.org/r/20220120133605.476138-1-AjitKumar.Pandey@amd.com Signed-off-by: Mark Brown commit e26a78057c25dd56f112d536319c38735ed92ba4 Author: Alex Henrie Date: Sun Jan 16 16:01:58 2022 -0700 HID: apple: Set the tilde quirk flag on the Wellspring 5 and later Markus reports that his 2011 MacBook with a German ISO keyboard (USB product code 05ac:0246, HID country code 13) has the tilde key quirk. Seeing as all of the standalone Apple ISO keyboards since about 2008 have the quirk, it seems reasonable to assume that once the integrated laptop keyboards started having the quirk, they likewise never stopped having it. Reported-by: Markus Wageringel Signed-off-by: Alex Henrie Signed-off-by: Jiri Kosina commit 03c82e80ec283b115c56026ecdb95c901a57c51e Merge: 67ab55956e649 745166fcf01ce Author: David S. Miller Date: Fri Jan 21 14:32:21 2022 +0000 Merge branch 'octeontx2-af-fixes' Subbaraya Sundeep says: ==================== octeontx-af2: Fixes for CN10K and CN9xxx platforms This patchset has consolidated fixes in Octeontx2 driver handling CN10K and CN9xxx platforms. When testing the new CN10K hardware some issues resurfaced like accessing wrong register for CN10K and enabling loopback on not supported interfaces. Some fixes are needed for CN9xxx platforms as well. Below is the description of patches Patch 1: AF sets RX RSS action for all the VFs when a VF is brought up. But when a PF sets RX action for its VF like Drop/Direct to a queue in ntuple filter it is not retained because of AF fixup. This patch skips modifying VF RX RSS action if PF has already set its action. Patch 2: When configuring backpressure wrong register is being read for LBKs hence fixed it. Patch 3: Some RVU blocks may take longer time to reset but are guaranteed to complete the reset. Hence wait till reset is complete. Patch 4: For enabling LMAC CN10K needs another register compared to CN9xxx platforms. Hence changed it. Patch 5: Adds missing barrier before submitting memory pointer to the aura hardware. Patch 6: Increase polling time while link credit restore and also return proper error code when timeout occurs. Patch 7: Internal loopback not supported on LPCS interfaces like SGMII/QSGMII so do not enable it. Patch 8: When there is a error in message processing, AF sets the error response and replies back to requestor. PF forwards a invalid message to VF back if AF reply has error in it. This way VF lacks the actual error set by AF for its message. This is changed such that PF simply forwards the actual reply and let VF handle the error. Patch 9: ntuple filter with "flow-type ether proto 0x8842 vlan 0x92e" was not working since ethertype 0x8842 is NGIO protocol. Hardware parser explicitly parses such NGIO packets and sets the packet as NGIO and do not set it as tagged packet. Fix this by changing parser such that it sets the packet as both NGIO and tagged by using separate layer types. ==================== Signed-off-by: David S. Miller commit 745166fcf01cecc4f5ff3defc6586868349a43f9 Author: Kiran Kumar K Date: Fri Jan 21 12:04:47 2022 +0530 octeontx2-af: Add KPU changes to parse NGIO as separate layer With current KPU profile NGIO is being parsed along with CTAG as a single layer. Because of this MCAM/ntuple rules installed with ethertype as 0x8842 are not being hit. Adding KPU profile changes to parse NGIO in separate ltype and CTAG in separate ltype. Fixes: f9c49be90c05 ("octeontx2-af: Update the default KPU profile and fixes") Signed-off-by: Kiran Kumar K Signed-off-by: Subbaraya Sundeep Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit a8db854be28622a2477cb21cdf7f829adbb2c42d Author: Subbaraya Sundeep Date: Fri Jan 21 12:04:46 2022 +0530 octeontx2-pf: Forward error codes to VF PF forwards its VF messages to AF and corresponding replies from AF to VF. AF sets proper error code in the replies after processing message requests. Currently PF checks the error codes in replies and sends invalid message to VF. This way VF lacks the information of error code set by AF for its messages. This patch changes that such that PF simply forwards AF replies so that VF can handle error codes. Fixes: d424b6c02415 ("octeontx2-pf: Enable SRIOV and added VF mbox handling") Signed-off-by: Subbaraya Sundeep Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit df66b6ebc5dcf7253e35a640b9ec4add54195c25 Author: Geetha sowjanya Date: Fri Jan 21 12:04:45 2022 +0530 octeontx2-af: cn10k: Do not enable RPM loopback for LPC interfaces Internal looback is not supported to low rate LPCS interface like SGMII/QSGMII. Hence don't allow to enable for such interfaces. Fixes: 3ad3f8f93c81 ("octeontx2-af: cn10k: MAC internal loopback support") Signed-off-by: Geetha sowjanya Signed-off-by: Subbaraya Sundeep Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit 1581d61b42d985cefe7b71eea67ab3bfcbf34d0f Author: Geetha sowjanya Date: Fri Jan 21 12:04:44 2022 +0530 octeontx2-af: Increase link credit restore polling timeout It's been observed that sometimes link credit restore takes a lot of time than the current timeout. This patch increases the default timeout value and return the proper error value on failure. Fixes: 1c74b89171c3 ("octeontx2-af: Wait for TX link idle for credits change") Signed-off-by: Geetha sowjanya Signed-off-by: Subbaraya Sundeep Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit c5d731c54a17677939bd59ee8be4ed74d7485ba4 Author: Geetha sowjanya Date: Fri Jan 21 12:04:43 2022 +0530 octeontx2-pf: cn10k: Ensure valid pointers are freed to aura While freeing SQB pointers to aura, driver first memcpy to target address and then triggers lmtst operation to free pointer to the aura. We need to ensure(by adding dmb barrier)that memcpy is finished before pointers are freed to the aura. This patch also adds the missing sq context structure entry in debugfs. Fixes: ef6c8da71eaf ("octeontx2-pf: cn10K: Reserve LMTST lines per core") Signed-off-by: Geetha sowjanya Signed-off-by: Subbaraya Sundeep Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit fae80edeafbbba5ef9a0423aa5e5515518626433 Author: Geetha sowjanya Date: Fri Jan 21 12:04:42 2022 +0530 octeontx2-af: cn10k: Use appropriate register for LMAC enable CN10K platforms uses RPM(0..2)_MTI_MAC100(0..3)_COMMAND_CONFIG register for lmac TX/RX enable whereas CN9xxx platforms use CGX_CMRX_CONFIG register. This config change was missed when adding support for CN10K RPM. Fixes: 91c6945ea1f9 ("octeontx2-af: cn10k: Add RPM MAC support") Signed-off-by: Geetha sowjanya Signed-off-by: Subbaraya Sundeep Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit 03ffbc9914bd1130fba464f0a41c01372e5fc359 Author: Geetha sowjanya Date: Fri Jan 21 12:04:41 2022 +0530 octeontx2-af: Retry until RVU block reset complete Few RVU blocks like SSO require more time for reset on some silicons. Hence retrying the block reset until success. Fixes: c0fa2cff8822c ("octeontx2-af: Handle return value in block reset") Signed-off-by: Geetha sowjanya Signed-off-by: Subbaraya Sundeep Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit 00bfe94e388fe12bfd0d4f6361b1b1343374ff5b Author: Sunil Goutham Date: Fri Jan 21 12:04:40 2022 +0530 octeontx2-af: Fix LBK backpressure id count In rvu_nix_get_bpid() lbk_bpid_cnt is being read from wrong register. Due to this backpressure enable is failing for LBK VF32 onwards. This patch fixes that. Fixes: fe1939bb2340 ("octeontx2-af: Add SDP interface support") Signed-off-by: Sunil Goutham Signed-off-by: Subbaraya Sundeep Signed-off-by: David S. Miller commit d225c449ab2be25273a3674f476c6c0b57c50254 Author: Subbaraya Sundeep Date: Fri Jan 21 12:04:39 2022 +0530 octeontx2-af: Do not fixup all VF action entries AF modifies all the rules destined for VF to use the action same as default RSS action. This fixup was needed because AF only installs default rules with RSS action. But the action in rules installed by a PF for its VFs should not be changed by this fixup. This is because action can be drop or direct to queue as specified by user(ntuple filters). This patch fixes that problem. Fixes: 967db3529eca ("octeontx2-af: add support for multicast/promisc packet") Signed-off-by: Subbaraya Sundeep Signed-off-by: Naveen Mamindlapalli Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit 9b57f458985742bd1c585f4c7f36d04634ce1143 Merge: 3c7c25038b6c7 20f3cf5f860f9 Author: Linus Torvalds Date: Fri Jan 21 16:25:38 2022 +0200 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid Pull HID fixes from Jiri Kosina: - fix for race condition that could lead to NULL pointer dereferences or UAF during uhid device destruction (Jann Horn) - contact count handling regression fixes for Wacom devices (Jason Gerecke) - fix for handling unnumbered HID reports handling in Google Vivaldi driver (Dmitry Torokhov) * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: HID: wacom: Avoid using stale array indicies to read contact count HID: wacom: Ignore the confidence flag when a touch is removed HID: wacom: Reset expected and received contact counts at the same time HID: uhid: Use READ_ONCE()/WRITE_ONCE() for ->running HID: uhid: Fix worker destroying device without any protection HID: vivaldi: Minor cleanups HID: vivaldi: fix handling devices not using numbered reports HID: Ignore battery for Elan touchscreen on HP Envy X360 15t-dr100 commit 3c7c25038b6c7d66a6816028219914379be6a5cc Merge: f3a78227eef20 46cdc45acb089 Author: Linus Torvalds Date: Fri Jan 21 16:17:03 2022 +0200 Merge tag 'block-5.17-2022-01-21' of git://git.kernel.dk/linux-block Pull block fixes from Jens Axboe: "Various little minor fixes that should go into this release: - Fix issue with cloned bios and IO accounting (Christoph) - Remove redundant assignments (Colin, GuoYong) - Fix an issue with the mq-deadline async_depth sysfs interface (me) - Fix brd module loading race (Tetsuo) - Shared tag map wakeup fix (Laibin) - End of bdev read fix (OGAWA) - srcu leak fix (Ming)" * tag 'block-5.17-2022-01-21' of git://git.kernel.dk/linux-block: block: fix async_depth sysfs interface for mq-deadline block: Fix wrong offset in bio_truncate() block: assign bi_bdev for cloned bios in blk_rq_prep_clone block: cleanup q->srcu block: Remove unnecessary variable assignment brd: remove brd_devices_mutex mutex aoe: remove redundant assignment on variable n loop: remove redundant initialization of pointer node blk-mq: fix tag_get wait task can't be awakened commit 20f3cf5f860f9f267a6a6e5642d3d0525edb1814 Author: Jason Gerecke Date: Tue Jan 18 14:38:41 2022 -0800 HID: wacom: Avoid using stale array indicies to read contact count If we ever see a touch report with contact count data we initialize several variables used to read the contact count in the pre-report phase. These variables are never reset if we process a report which doesn't contain a contact count, however. This can cause the pre- report function to trigger a read of arbitrary memory (e.g. NULL if we're lucky) and potentially crash the driver. This commit restores resetting of the variables back to default "none" values that were used prior to the commit mentioned below. Link: https://github.com/linuxwacom/input-wacom/issues/276 Fixes: 003f50ab673c (HID: wacom: Update last_slot_field during pre_report phase) CC: stable@vger.kernel.org Signed-off-by: Jason Gerecke Reviewed-by: Ping Cheng Signed-off-by: Jiri Kosina commit df03e9bd6d4806619b4cdc91a3d7695818a8e2b7 Author: Jason Gerecke Date: Tue Jan 18 14:37:56 2022 -0800 HID: wacom: Ignore the confidence flag when a touch is removed AES hardware may internally re-classify a contact that it thought was intentional as a palm. Intentional contacts are reported as "down" with the confidence bit set. When this re-classification occurs, however, the state transitions to "up" with the confidence bit cleared. This kind of transition appears to be legal according to Microsoft docs, but we do not handle it correctly. Because the confidence bit is clear, we don't call `wacom_wac_finger_slot` and update userspace. This causes hung touches that confuse userspace and interfere with pen arbitration. This commit adds a special case to ignore the confidence flag if a contact is reported as removed. This ensures we do not leave a hung touch if one of these re-classification events occured. Ideally we'd have some way to also let userspace know that the touch has been re-classified as a palm and needs to be canceled, but that's not possible right now :) Link: https://github.com/linuxwacom/input-wacom/issues/288 Fixes: 7fb0413baa7f (HID: wacom: Use "Confidence" flag to prevent reporting invalid contacts) CC: stable@vger.kernel.org Signed-off-by: Jason Gerecke Reviewed-by: Ping Cheng Signed-off-by: Jiri Kosina commit 546e41ac994cc185ef3de610ca849a294b5df3ba Author: Jason Gerecke Date: Tue Jan 18 14:37:55 2022 -0800 HID: wacom: Reset expected and received contact counts at the same time These two values go hand-in-hand and must be valid for the driver to behave correctly. We are currently lazy about updating the values and rely on the "expected" code flow to take care of making sure they're valid at the point they're needed. The "expected" flow changed somewhat with commit f8b6a74719b5 ("HID: wacom: generic: Support multiple tools per report"), however. This led to problems with the DTH-2452 due (in part) to *all* contacts being fully processed -- even those past the expected contact count. Specifically, the received count gets reset to 0 once all expected fingers are processed, but not the expected count. The rest of the contacts in the report are then *also* processed since now the driver thinks we've only processed 0 of N expected contacts. Later commits such as 7fb0413baa7f (HID: wacom: Use "Confidence" flag to prevent reporting invalid contacts) worked around the DTH-2452 issue by skipping the invalid contacts at the end of the report, but this is not a complete fix. The confidence flag cannot be relied on when a contact is removed (see the following patch), and dealing with that condition re-introduces the DTH-2452 issue unless we also address this contact count laziness. By resetting expected and received counts at the same time we ensure the driver understands that there are 0 more contacts expected in the report. Similarly, we also make sure to reset the received count if for some reason we're out of sync in the pre-report phase. Link: https://github.com/linuxwacom/input-wacom/issues/288 Fixes: f8b6a74719b5 ("HID: wacom: generic: Support multiple tools per report") CC: stable@vger.kernel.org Signed-off-by: Jason Gerecke Reviewed-by: Ping Cheng Signed-off-by: Jiri Kosina commit f3a78227eef20c0ba13bbf9401f0a340bca3ad16 Merge: 1f40caa080474 73031f761cb7c Author: Linus Torvalds Date: Fri Jan 21 16:07:21 2022 +0200 Merge tag 'io_uring-5.17-2022-01-21' of git://git.kernel.dk/linux-block Pull io_uring fixes from Jens Axboe: - Fix the io_uring POLLFREE handling, similarly to how it was done for aio (Pavel) - Remove (now) unused function (Jiapeng) - Small series fixing an issue with work cancelations. A window exists where work isn't locatable in the pending list, and isn't active in a worker yet either. (me) * tag 'io_uring-5.17-2022-01-21' of git://git.kernel.dk/linux-block: io-wq: delete dead lock shuffling code io_uring: perform poll removal even if async work removal is successful io-wq: add intermediate work step between pending list and active work io-wq: perform both unstarted and started work cancelations in one go io-wq: invoke work cancelation with wqe->lock held io-wq: make io_worker lock a raw spinlock io-wq: remove useless 'work' argument to __io_worker_busy() io_uring: fix UAF due to missing POLLFREE handling io_uring: Remove unused function req_ref_put commit 1f40caa080474d0420e0b0e6c896e455acb6e236 Merge: 75242f31db6ca 2a1355f0bf41a Author: Linus Torvalds Date: Fri Jan 21 13:49:22 2022 +0200 Merge tag 'sound-fix-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "A small set of HD-audio and USB-audio fixes as well as a couple of ALSA core fixes. Most of them are fix-ups for the newly added CS35L41 codec" * tag 'sound-fix-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: hda/cs8409: Add new Warlock SKUs to patch_cs8409 ALSA: core: Simplify snd_power_ref_and_wait() with the standard macro ALSA: hda: cs35l41: Make cs35l41_hda_remove() return void ALSA: hda: cs35l41: Tidyup code ALSA: hda: cs35l41: Make use of the helper function dev_err_probe() ALSA: hda: cs35l41: Add missing default cases ALSA: hda: cs35l41: Move cs35l41* calls to its own symbol namespace ALSA: hda: cs35l41: Add calls to newly added test key function ALSA: hda: cs35l41: Avoid overwriting register patch ALSA: core: Fix SSID quirk lookup for subvendor=0 ALSA: usb-audio: add mapping for MSI MPG X570S Carbon Max Wifi. ALSA: hda/realtek: fix speakers and micmute on HP 855 G8 commit 67ab55956e64906c9e0f049c5fc41fc28e5e48bc Merge: 0b6d8cf2ecb98 a1222ca0681f1 Author: David S. Miller Date: Fri Jan 21 11:23:33 2022 +0000 Merge tag 'wireless-2022-01-21' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless Kalle Valo says: ==================== wireless fixes for v5.17 First set of fixes for v5.17. This is the first pull request from the new wireless tree and only changes to MAINTAINERS file. ==================== Signed-off-by: David S. Miller commit 75242f31db6cabf602a5eb84c13b579099d72a65 Merge: c2c94b3b187dc 5ceee540fdc7f Author: Linus Torvalds Date: Fri Jan 21 13:13:35 2022 +0200 Merge tag 'rtc-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux Pull RTC updates from Alexandre Belloni: "Two new drivers this cycle and a significant rework of the CMOS driver make the bulk of the changes. I also carry powerpc changes with the agreement of Michael. New drivers: - Sunplus SP7021 RTC - Nintendo GameCube, Wii and Wii U RTC Driver updates: - cmos: refactor UIP handling and presence check, fix century - rs5c372: offset correction support, report low voltage - rv8803: Epson RX8804 support" * tag 'rtc-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (33 commits) rtc: sunplus: fix return value in sp_rtc_probe() rtc: cmos: Evaluate century appropriate rtc: gamecube: Fix an IS_ERR() vs NULL check rtc: mc146818-lib: fix signedness bug in mc146818_get_time() dt-bindings: rtc: qcom-pm8xxx-rtc: update register numbers rtc: pxa: fix null pointer dereference rtc: ftrtc010: Use platform_get_irq() to get the interrupt rtc: Move variable into switch case statement rtc: pcf2127: Fix typo in comment dt-bindings: rtc: Add Sunplus RTC json-schema rtc: Add driver for RTC in Sunplus SP7021 rtc: rs5c372: fix incorrect oscillation value on r2221tl rtc: rs5c372: add offset correction support rtc: cmos: avoid UIP when writing alarm time rtc: cmos: avoid UIP when reading alarm time rtc: mc146818-lib: refactor mc146818_does_rtc_work rtc: mc146818-lib: refactor mc146818_get_time rtc: mc146818-lib: extract mc146818_avoid_UIP rtc: mc146818-lib: fix RTC presence check rtc: Check return value from mc146818_get_time() ... commit 0b6d8cf2ecb98a842eaf523f31939ba362eb2235 Merge: 276c7635d7be3 3b8428b84539c Author: David S. Miller Date: Fri Jan 21 10:30:30 2022 +0000 Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2022-01-20 This series contains updates to i40e driver only. Jedrzej increases delay for EMP reset and adds checks to ensure a VF request to change queues can be met. Sylwester moves the placement of the Flow Director queue as to not fragment the queue pile which would cause later re-allocation issues. Karen prevents VF reset being invoked while another is still occurring to avoid reading invalid data. Joe Damato fixes some statistics fields to match the values of the fields they are based on. ==================== Signed-off-by: David S. Miller commit b875b39e7373dcaccb19a600a52a956061c2c833 Author: Damien Le Moal Date: Fri Jan 21 17:19:33 2022 +0900 ata: pata_octeon_cf: fix call to trace_ata_bmdma_stop() The first argument of trace_ata_bmdma_stop() must be a pointer to a struct ata_port, not to a struct ata_queued_cmd. Reported-by: Linux Kernel Functional Testing Fixes: d3e140f2b008 ("ata: pata_octeon_cf: Drop pointless VPRINTK() calls and convert the remaining one") Signed-off-by: Damien Le Moal Tested-by: Linux Kernel Functional Testing commit c2c94b3b187dc92b2002809f489e0f24a41e91bc Merge: 39e77c484bcd1 ccf34586758cf Author: Linus Torvalds Date: Fri Jan 21 09:25:38 2022 +0200 Merge tag 'drm-next-2022-01-21' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Dave Airlie: "Thanks to Daniel for taking care of things while I was out, just a set of merge window fixes that came in this week, two i915 display fixes and a bunch of misc amdgpu, along with a radeon regression fix. amdgpu: - SR-IOV fix - VCN harvest fix - Suspend/resume fixes - Tahiti fix - Enable GPU recovery on yellow carp radeon: - Fix error handling regression in radeon_driver_open_kms i915: - Update EHL display voltage swing table - Fix programming the ADL-P display TC voltage swing" * tag 'drm-next-2022-01-21' of git://anongit.freedesktop.org/drm/drm: drm/radeon: fix error handling in radeon_driver_open_kms drm/amd/amdgpu: fixing read wrong pf2vf data in SRIOV drm/amdgpu: apply vcn harvest quirk drm/i915/display/adlp: Implement new step in the TC voltage swing prog sequence drm/i915/display/ehl: Update voltage swing table drm/amd/display: Revert W/A for hard hangs on DCN20/DCN21 drm/amdgpu: drop flags check for CHIP_IP_DISCOVERY drm/amdgpu: Fix rejecting Tahiti GPUs drm/amdgpu: don't do resets on APUs which don't support it drm/amdgpu: invert the logic in amdgpu_device_should_recover_gpu() drm/amdgpu: Enable recovery on yellow carp commit 39e77c484bcd1865ff6abdbde6b36eb91ee1ff33 Merge: 4141a5e694588 b4966a7dc0725 Author: Linus Torvalds Date: Fri Jan 21 09:16:11 2022 +0200 Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux Pull clk fixes from Stephen Boyd: "Some hot fixes for clk driver patches merged last week and one oops fix: - Fix license on recent MediaTek drivers - Initialize a variable before use in the new Visconti driver - Avoid an oops by unregistering the clk provider in si5341" * tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: clk: mediatek: relicense mt7986 clock driver to GPL-2.0 clk: visconti: Fix uninitialized variable in printk clk: si5341: Fix clock HW provider cleanup commit 4141a5e694588897cbec955bc4a646075dc0afd7 Merge: 85e67d56ebdec 9c494ca4d3a53 Author: Linus Torvalds Date: Fri Jan 21 09:10:46 2022 +0200 Merge tag 'pci-v5.17-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci Pull pci fix from Bjorn Helgaas: - Reserve "stolen memory" for integrated Intel GPU, even if it's not the first GPU to be enumerated (Lucas De Marchi) * tag 'pci-v5.17-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: x86/gpu: Reserve stolen memory for first integrated Intel GPU commit 85e67d56ebdecd8601d62e3aadcd2927845c97b9 Merge: 31d949782e1da 5754f9084f261 Author: Linus Torvalds Date: Fri Jan 21 08:57:15 2022 +0200 Merge tag 's390-5.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull more s390 updates from Heiko Carstens: - add Sven Schnelle as reviewer for s390 code - make uaccess code more readable - change cpu measurement facility code to also support counter second version number 7, and add discard support for limited samples * tag 's390-5.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390: add Sven Schnelle as reviewer s390/uaccess: introduce bit field for OAC specifier s390/cpumf: Support for CPU Measurement Sampling Facility LS bit s390/cpumf: Support for CPU Measurement Facility CSVN 7 commit 31d949782e1daf4b329337dd36b2d6d60764fe29 Merge: d701a8ccac7a1 b3bb9413e717b Author: Linus Torvalds Date: Fri Jan 21 08:51:48 2022 +0200 Merge tag 'xfs-5.17-merge-6' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull more xfs irix ioctl housecleaning from Darrick Wong: "Withdraw the XFS_IOC_ALLOCSP* and XFS_IOC_FREESP* ioctl definitions. This is the third and final of a series of small pull requests that perform some long overdue housecleaning of XFS ioctls. This time, we're withdrawing all variants of the ALLOCSP and FREESP ioctls from XFS' userspace API. This might be a little premature since we've only just removed the functionality, but as I pointed out in the last pull request, nobody (including fstests) noticed that it was broken for 20 years. In response to the patch, we received a single comment from someone who stated that they 'augment' the ioctl for their own purposes, but otherwise acquiesced to the withdrawal. I still want to try to clobber these old ioctl definitions in 5.17. So remove the header definitions for these ioctls. The just-removed implementation has allowed callers to read stale disk contents for more than **21 years** and nobody noticed or complained, which implies a lack of users aside from exploit programs" * tag 'xfs-5.17-merge-6' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: xfs: remove the XFS_IOC_{ALLOC,FREE}SP* definitions commit d701a8ccac7a1c0912425a01919a3cbe05f22914 Merge: 12a8fb20f1c23 4d1b97f9ce7c0 Author: Linus Torvalds Date: Fri Jan 21 08:47:25 2022 +0200 Merge tag 'xfs-5.17-merge-5' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull xfs irix ioctl housecleaning from Darrick Wong: "Remove the XFS_IOC_ALLOCSP* and XFS_IOC_FREESP* ioctl families. This is the second of a series of small pull requests that perform some long overdue housecleaning of XFS ioctls. This time, we're vacating the implementation of all variants of the ALLOCSP and FREESP ioctls, which are holdovers from EFS in Irix, circa 1993. Roughly equivalent functionality have been available for both ioctls since 2.6.25 (April 2008): - XFS_IOC_FREESP ftruncates a file. - XFS_IOC_ALLOCSP is the equivalent of fallocate. As noted in the fix patch for CVE 2021-4155, the ALLOCSP ioctl has been serving up stale disk blocks since 2000, and in 21 years **nobody** noticed. On those grounds I think it's safe to vacate the implementation. Note that we lose the ability to preallocate and truncate relative to the current file position, but as nobody's ever implemented that for the VFS, I conclude that it's not in high demand. Linux has always used fallocate as the space management system call, whereas these Irix legacy ioctls only ever worked on XFS, and have been the cause of recent stale data disclosure vulnerabilities. As equivalent functionality is available elsewhere, remove the code" * tag 'xfs-5.17-merge-5' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: xfs: kill the XFS_IOC_{ALLOC,FREE}SP* ioctls commit 12a8fb20f1c2387eaad417587c14cb684f380735 Merge: 2c271fe77d52a 9dec0368b9640 Author: Linus Torvalds Date: Fri Jan 21 08:44:07 2022 +0200 Merge tag 'xfs-5.17-merge-4' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull xfs ioctl housecleaning from Darrick Wong: "This is the first of a series of small pull requests that perform some long overdue housecleaning of XFS ioctls. This first pull request removes the FSSETDM ioctl, which was used to set DMAPI event attributes on XFS files. The DMAPI support has never been merged upstream and the implementation of FSSETDM itself was removed two years ago, so let's withdraw it completely. - Withdraw the ioctl definition for the FSSETDM ioctl" * tag 'xfs-5.17-merge-4' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: xfs: remove the XFS_IOC_FSSETDM definitions commit 276c7635d7be3aa233251354bd7e8b77ab5dcf9c Merge: 6f97fde8694d5 9846921dba493 Author: Jakub Kicinski Date: Thu Jan 20 20:24:03 2022 -0800 Merge branch 'mptcp-a-few-fixes' Mat Martineau says: ==================== mptcp: A few fixes Patch 1 fixes a RCU locking issue when processing a netlink command that updates endpoint flags in the in-kernel MPTCP path manager. Patch 2 fixes a typo affecting available endpoint id tracking. Patch 3 fixes IPv6 routing in the MPTCP self tests. ==================== Link: https://lore.kernel.org/r/20220121003529.54930-1-mathew.j.martineau@linux.intel.com Signed-off-by: Jakub Kicinski commit 9846921dba4936d92f7608315b5d1e0a8ec3a538 Author: Paolo Abeni Date: Thu Jan 20 16:35:29 2022 -0800 selftests: mptcp: fix ipv6 routing setup MPJ ipv6 selftests currently lack per link route to the server net. Additionally, ipv6 subflows endpoints are created without any interface specified. The end-result is that in ipv6 self-tests subflows are created all on the same link, leading to expected delays and sporadic self-tests failures. Fix the issue by adding the missing setup bits. Fixes: 523514ed0a99 ("selftests: mptcp: add ADD_ADDR IPv6 test cases") Reported-and-tested-by: Geliang Tang Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit a4c0214fbee97c46e3f41fee37931d66c0fc3cb1 Author: Geliang Tang Date: Thu Jan 20 16:35:28 2022 -0800 mptcp: fix removing ids bitmap setting In mptcp_pm_nl_rm_addr_or_subflow(), the bit of rm_list->ids[i] in the id_avail_bitmap should be set, not rm_list->ids[1]. This patch fixed it. Fixes: 86e39e04482b ("mptcp: keep track of local endpoint still available for each msk") Acked-by: Paolo Abeni Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 8e9eacad7ec7a9cbf262649ebf1fa6e6f6cc7d82 Author: Paolo Abeni Date: Thu Jan 20 16:35:27 2022 -0800 mptcp: fix msk traversal in mptcp_nl_cmd_set_flags() The MPTCP endpoint list is under RCU protection, guarded by the pernet spinlock. mptcp_nl_cmd_set_flags() traverses the list without acquiring the spin-lock nor under the RCU critical section. This change addresses the issue performing the lookup and the endpoint update under the pernet spinlock. Fixes: 0f9f696a502e ("mptcp: add set_flags command in PM netlink") Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 6f97fde8694d5242ace94a58bc8522a70b5f77cc Merge: aafc2e3285c2d 830af2eba4032 Author: Jakub Kicinski Date: Thu Jan 20 20:22:30 2022 -0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf Pablo Neira Ayuso says: ==================== Netfilter fixes for net 1) Incorrect helper module alias in netbios_ns, from Florian Westphal. 2) Remove unused variable in nf_tables. 3) Uninitialized last expression in nf_tables register tracking. 4) Memleak in nft_connlimit after moving stateful data out of the expression data area. 5) Bogus invalid stats update when NF_REPEAT is returned, from Florian. * git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf: netfilter: conntrack: don't increment invalid counter on NF_REPEAT netfilter: nft_connlimit: memleak if nf_ct_netns_get() fails netfilter: nf_tables: set last expression in register tracking area netfilter: nf_tables: remove unused variable netfilter: nf_conntrack_netbios_ns: fix helper module alias ==================== Link: https://lore.kernel.org/r/20220120125212.991271-1-pablo@netfilter.org Signed-off-by: Jakub Kicinski commit aafc2e3285c2d7a79b7ee15221c19fbeca7b1509 Author: Eric Dumazet Date: Thu Jan 20 09:41:12 2022 -0800 ipv6: annotate accesses to fn->fn_sernum struct fib6_node's fn_sernum field can be read while other threads change it. Add READ_ONCE()/WRITE_ONCE() annotations. Do not change existing smp barriers in fib6_get_cookie_safe() and __fib6_update_sernum_upto_root() syzbot reported: BUG: KCSAN: data-race in fib6_clean_node / inet6_csk_route_socket write to 0xffff88813df62e2c of 4 bytes by task 1920 on cpu 1: fib6_clean_node+0xc2/0x260 net/ipv6/ip6_fib.c:2178 fib6_walk_continue+0x38e/0x430 net/ipv6/ip6_fib.c:2112 fib6_walk net/ipv6/ip6_fib.c:2160 [inline] fib6_clean_tree net/ipv6/ip6_fib.c:2240 [inline] __fib6_clean_all+0x1a9/0x2e0 net/ipv6/ip6_fib.c:2256 fib6_flush_trees+0x6c/0x80 net/ipv6/ip6_fib.c:2281 rt_genid_bump_ipv6 include/net/net_namespace.h:488 [inline] addrconf_dad_completed+0x57f/0x870 net/ipv6/addrconf.c:4230 addrconf_dad_work+0x908/0x1170 process_one_work+0x3f6/0x960 kernel/workqueue.c:2307 worker_thread+0x616/0xa70 kernel/workqueue.c:2454 kthread+0x1bf/0x1e0 kernel/kthread.c:359 ret_from_fork+0x1f/0x30 read to 0xffff88813df62e2c of 4 bytes by task 15701 on cpu 0: fib6_get_cookie_safe include/net/ip6_fib.h:285 [inline] rt6_get_cookie include/net/ip6_fib.h:306 [inline] ip6_dst_store include/net/ip6_route.h:234 [inline] inet6_csk_route_socket+0x352/0x3c0 net/ipv6/inet6_connection_sock.c:109 inet6_csk_xmit+0x91/0x1e0 net/ipv6/inet6_connection_sock.c:121 __tcp_transmit_skb+0x1323/0x1840 net/ipv4/tcp_output.c:1402 tcp_transmit_skb net/ipv4/tcp_output.c:1420 [inline] tcp_write_xmit+0x1450/0x4460 net/ipv4/tcp_output.c:2680 __tcp_push_pending_frames+0x68/0x1c0 net/ipv4/tcp_output.c:2864 tcp_push+0x2d9/0x2f0 net/ipv4/tcp.c:725 mptcp_push_release net/mptcp/protocol.c:1491 [inline] __mptcp_push_pending+0x46c/0x490 net/mptcp/protocol.c:1578 mptcp_sendmsg+0x9ec/0xa50 net/mptcp/protocol.c:1764 inet6_sendmsg+0x5f/0x80 net/ipv6/af_inet6.c:643 sock_sendmsg_nosec net/socket.c:705 [inline] sock_sendmsg net/socket.c:725 [inline] kernel_sendmsg+0x97/0xd0 net/socket.c:745 sock_no_sendpage+0x84/0xb0 net/core/sock.c:3086 inet_sendpage+0x9d/0xc0 net/ipv4/af_inet.c:834 kernel_sendpage+0x187/0x200 net/socket.c:3492 sock_sendpage+0x5a/0x70 net/socket.c:1007 pipe_to_sendpage+0x128/0x160 fs/splice.c:364 splice_from_pipe_feed fs/splice.c:418 [inline] __splice_from_pipe+0x207/0x500 fs/splice.c:562 splice_from_pipe fs/splice.c:597 [inline] generic_splice_sendpage+0x94/0xd0 fs/splice.c:746 do_splice_from fs/splice.c:767 [inline] direct_splice_actor+0x80/0xa0 fs/splice.c:936 splice_direct_to_actor+0x345/0x650 fs/splice.c:891 do_splice_direct+0x106/0x190 fs/splice.c:979 do_sendfile+0x675/0xc40 fs/read_write.c:1245 __do_sys_sendfile64 fs/read_write.c:1310 [inline] __se_sys_sendfile64 fs/read_write.c:1296 [inline] __x64_sys_sendfile64+0x102/0x140 fs/read_write.c:1296 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae value changed: 0x0000026f -> 0x00000271 Reported by Kernel Concurrency Sanitizer on: CPU: 0 PID: 15701 Comm: syz-executor.2 Not tainted 5.16.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 The Fixes tag I chose is probably arbitrary, I do not think we need to backport this patch to older kernels. Fixes: c5cff8561d2d ("ipv6: add rcu grace period before freeing fib6_node") Signed-off-by: Eric Dumazet Reported-by: syzbot Link: https://lore.kernel.org/r/20220120174112.1126644-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit ebdc1a0309629e71e5910b353e6b005f022ce171 Author: Eric Dumazet Date: Thu Jan 20 04:45:30 2022 -0800 tcp: add a missing sk_defer_free_flush() in tcp_splice_read() Without it, splice users can hit the warning added in commit 79074a72d335 ("net: Flush deferred skb free on socket destroy") Fixes: f35f821935d8 ("tcp: defer skb freeing after socket lock is released") Fixes: 79074a72d335 ("net: Flush deferred skb free on socket destroy") Suggested-by: Jakub Kicinski Signed-off-by: Eric Dumazet Cc: Gal Pressman Link: https://lore.kernel.org/r/20220120124530.925607-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit 48cec899e357cfb92d022a9c0df6bbe72a7f6951 Author: Gal Pressman Date: Thu Jan 20 14:34:40 2022 +0200 tcp: Add a stub for sk_defer_free_flush() When compiling the kernel with CONFIG_INET disabled, the sk_defer_free_flush() should be defined as a nop. This resolves the following compilation error: ld: net/core/sock.o: in function `sk_defer_free_flush': ./include/net/tcp.h:1378: undefined reference to `__sk_defer_free_flush' Fixes: 79074a72d335 ("net: Flush deferred skb free on socket destroy") Reported-by: kernel test robot Reviewed-by: Tariq Toukan Signed-off-by: Gal Pressman Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/20220120123440.9088-1-gal@nvidia.com Signed-off-by: Jakub Kicinski commit cbda1b16687580d5beee38273f6241ae3725960c Author: Marek Behún Date: Wed Jan 19 17:27:48 2022 +0100 phylib: fix potential use-after-free Commit bafbdd527d56 ("phylib: Add device reset GPIO support") added call to phy_device_reset(phydev) after the put_device() call in phy_detach(). The comment before the put_device() call says that the phydev might go away with put_device(). Fix potential use-after-free by calling phy_device_reset() before put_device(). Fixes: bafbdd527d56 ("phylib: Add device reset GPIO support") Signed-off-by: Marek Behún Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220119162748.32418-1-kabel@kernel.org Signed-off-by: Jakub Kicinski commit a0af3d1104f752b6d0dba71788e3fddd67c857a7 Author: Thomas Gleixner Date: Wed Jan 19 18:54:52 2022 +0100 PCI/MSI: Prevent UAF in error path When the core MSI allocation fails, then the PCI/MSI code uses an already freed MSI descriptor to unmask the MSI mask register in order to bring it back into reset state. Remove MSI_FLAG_FREE_MSI_DESCS from the PCI/MSI irqdomain flags and let the PCI/MSI code free the MSI descriptors after usage. Fixes: 0f62d941acf9 ("genirq/msi: Provide msi_domain_alloc/free_irqs_descs_locked()") Reported-by: Tong Zhang Signed-off-by: Thomas Gleixner Tested-by: Tong Zhang Acked-by: Bjorn Helgaas Link: https://lore.kernel.org/r/87r1938vbn.ffs@tglx commit 5298d4bfe80f6ae6ae2777bcd1357b0022d98573 Author: Christoph Hellwig Date: Tue Jan 18 07:56:14 2022 +0100 unicode: clean up the Kconfig symbol confusion Turn the CONFIG_UNICODE symbol into a tristate that generates some always built in code and remove the confusing CONFIG_UNICODE_UTF8_DATA symbol. Note that a lot of the IS_ENABLED() checks could be turned from cpp statements into normal ifs, but this change is intended to be fairly mechanic, so that should be cleaned up later. Fixes: 2b3d04787012 ("unicode: Add utf8-data module") Reported-by: Linus Torvalds Reviewed-by: Eric Biggers Signed-off-by: Christoph Hellwig Signed-off-by: Gabriel Krisman Bertazi commit b0ac702f3329cdc8a06dcaac73183d4b5a2b942d Author: Randy Dunlap Date: Tue Jan 18 19:39:05 2022 -0800 Documentation: fix firewire.rst ABI file path error Adjust the path of the ABI files for firewire.rst to prevent a documentation build error. Prevents this problem: Sphinx parallel build error: docutils.utils.SystemMessage: Documentation/driver-api/firewire.rst:22: (SEVERE/4) Problems with "include" directive path: InputError: [Errno 2] No such file or directory: '../Documentation/driver-api/ABI/stable/firewire-cdev'. Fixes: 2f4830ef96d2 ("FireWire: add driver-api Introduction section") Signed-off-by: Randy Dunlap Tested-by: Akira Yokosawa Link: https://lore.kernel.org/r/20220119033905.4779-1-rdunlap@infradead.org Signed-off-by: Jonathan Corbet commit ccf34586758cf00c0934e48f6ef6d688f01d7b19 Merge: 410482b51afec 4722f463896cc Author: Dave Airlie Date: Fri Jan 21 08:37:56 2022 +1000 Merge tag 'amd-drm-fixes-5.17-2022-01-19' of https://gitlab.freedesktop.org/agd5f/linux into drm-next amd-drm-fixes-5.17-2022-01-19: amdgpu: - SR-IOV fix - VCN harvest fix - Suspend/resume fixes - Tahiti fix - Enable GPU recovery on yellow carp radeon: - Fix error handling regression in radeon_driver_open_kms Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220120013547.5649-1-alexander.deucher@amd.com commit 410482b51afecddb8fc29324d1b11945dfa0b682 Merge: 4efdddbce7c13 e26602be4869c Author: Dave Airlie Date: Fri Jan 21 08:31:29 2022 +1000 Merge tag 'drm-intel-next-fixes-2022-01-20' of git://anongit.freedesktop.org/drm/drm-intel into drm-next - Latest updates for the EHL display voltage swing table (José Roberto de Souza) - Additional step is required when programming the ADL-P display TC voltage swing (José Roberto de Souza) Signed-off-by: Dave Airlie From: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/Yek1zdsnRPiBVvFF@tursulin-mobl2 commit c59cd507fb640c2acc6b07cb60d7f765839e18c7 Author: Palmer Dabbelt Date: Wed Jan 19 10:39:37 2022 -0800 RISC-V: nommu_virt: Drop unused SLAB_MERGE_DEFAULT Our nommu_virt_defconfig set SLOB=y and SLAB_MERGE_DEFAULT=n. As of eb52c0fc2331 ("mm: Make SLAB_MERGE_DEFAULT depend on SL[AU]B") it's no longer necessary to set the second, which appears to never have had any effect for SLOB=y anyway. This was suggested by savedefconfig. Signed-off-by: Palmer Dabbelt commit 18a86e5907f7160fb548d0d717e0f842b310708a Author: Krzysztof Kozlowski Date: Thu Jan 20 11:40:09 2022 +0100 dt-bindings: google,cros-ec: drop Enric Balletbo i Serra from maintainers Enric Balletbo i Serra emails bounce: : Recipient address rejected: User unknown in local recipient table so drop him from the maintainers, similarly to commit 3119c28634dd ("MAINTAINERS: Chrome: Drop Enric Balletbo i Serra"). Signed-off-by: Krzysztof Kozlowski Acked-by: Lee Jones Acked-by: Enric Balletbo i Serra Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220120104009.159147-2-krzysztof.kozlowski@canonical.com commit 5e547d60dae7c66fe0c33654474eedcc1ddace67 Author: Krzysztof Kozlowski Date: Thu Jan 20 11:40:08 2022 +0100 dt-bindings: display: bridge: drop Enric Balletbo i Serra from maintainers Enric Balletbo i Serra emails bounce: : Recipient address rejected: User unknown in local recipient table so drop him from the maintainers, similarly to commit 3119c28634dd ("MAINTAINERS: Chrome: Drop Enric Balletbo i Serra"). Add generic DRM bridge maintainers to Analogix ANX7814. Signed-off-by: Krzysztof Kozlowski Acked-by: Neil Armstrong Acked-by: Enric Balletbo i Serra Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220120104009.159147-1-krzysztof.kozlowski@canonical.com commit 30f308999426871e1b896384093e9a681099f521 Author: Helge Deller Date: Mon Jan 17 10:10:10 2022 +0100 parisc: Fix missing prototype for 'toc_intr' warning in toc.c Fix a missing prototype warning noticed by the kernel test robot. Reported-by: kernel test robot Signed-off-by: Helge Deller commit 5f7ee6e37a3cadefe45378c17c4285fa41141d92 Author: Helge Deller Date: Fri Jan 14 07:57:20 2022 +0100 parisc: Autodetect default output device and set console= kernel parameter Usually palo (the PA-RISC boot loader) will check at boot time if the machine/firmware was configured to use the serial line (ttyS0, SERIAL_x) or the graphical display (tty0, graph) as default output device and add the correct "console=ttyS0" or "console=tty0" Linux kernel parameter to the kernel command line when starting the Linux kernel. But the kernel could also have been started via the HP-UX boot loader or directly in qemu, in which cases the console parameter is missing. This patch fixes this problem by adding the correct console= parameter if it's missing in the current kernel command line. Signed-off-by: Helge Deller commit bd25c378527f3fde38a496ac2744cbd3924f0803 Author: Helge Deller Date: Fri Jan 14 07:52:07 2022 +0100 parisc: Use safer strscpy() in setup_cmdline() Signed-off-by: Helge Deller commit 9b22c17a3cc5f61b195da624cbb48634b4e42055 Author: Rob Herring Date: Tue Jan 18 11:34:04 2022 -0600 of: Check 'of_node_reused' flag on of_match_device() Commit 0f153a1b8193 ("usb: chipidea: Set the DT node on the child device") caused the child device to match on the parent driver instead of the child's driver since the child's DT node pointer matched. The worst case result is a loop of the parent driver probing another instance and creating yet another child device eventually exhausting the stack. If the child driver happens to match first, then everything works fine. A device sharing the DT node should never do DT based driver matching, so let's simply check of_node_reused in of_match_device() to prevent that. Fixes: 0f153a1b8193 ("usb: chipidea: Set the DT node on the child device") Link: https://lore.kernel.org/all/20220114105620.GK18506@ediswmail.ad.cirrus.com/ Reported-by: Charles Keepax Cc: Frank Rowand Cc: Arnd Bergmann Cc: Tony Lindgren Cc: Greg Kroah-Hartman Cc: Peter Chen Tested-by: Charles Keepax Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220118173404.1891800-1-robh@kernel.org commit 2ca42c3ad9ed875b136065b010753a4caaaa1d38 Author: Michael Walle Date: Tue Jan 18 18:35:03 2022 +0100 of: property: define of_property_read_u{8,16,32,64}_array() unconditionally We can get rid of all the empty stubs because all these functions call of_property_read_variable_u{8,16,32,64}_array() which already have an empty stub if CONFIG_OF is not defined. Signed-off-by: Michael Walle Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220118173504.2867523-3-michael@walle.cc commit 66a8f7f04979f4ad739085f01d99c8caf620b4f5 Author: Michael Walle Date: Tue Jan 18 18:35:02 2022 +0100 of: base: make small of_parse_phandle() variants static inline Make all the smaller variants of the of_parse_phandle() static inline. This also let us remove the empty function stubs if CONFIG_OF is not defined. Suggested-by: Rob Herring Signed-off-by: Michael Walle [robh: move index < 0 check into __of_parse_phandle_with_args] Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220118173504.2867523-2-michael@walle.cc commit 25e20b505e0e2454ff6713c0cef4bcdd66dffb95 Author: Rob Herring Date: Tue Jan 18 19:56:11 2022 -0600 dt-bindings: mfd: cirrus,madera: Fix 'interrupts' in example The 'interrupts' properties takes an irq number, not a phandle, and 'interrupt-parent' isn't needed in examples. Signed-off-by: Rob Herring Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220119015611.2442819-1-robh@kernel.org commit 986536b952fd7070f5137358df7b055f3081dd2b Author: Rob Herring Date: Tue Jan 18 19:56:26 2022 -0600 dt-bindings: Fix array schemas encoded as matrices The YAML DT encoding has leaked into some array properties. Properties which are defined as an array should have a schema that's just an array. That means there should only be a single level of 'minItems', 'maxItems', and/or 'items'. Signed-off-by: Rob Herring Acked-by: Marc Kleine-Budde Link: https://lore.kernel.org/r/20220119015627.2443334-1-robh@kernel.org commit 3b8428b84539c78fdc8006c17ebd25afd4722d51 Author: Joe Damato Date: Wed Dec 8 17:56:33 2021 -0800 i40e: fix unsigned stat widths Change i40e_update_vsi_stats and struct i40e_vsi to use u64 fields to match the width of the stats counters in struct i40e_rx_queue_stats. Update debugfs code to use the correct format specifier for u64. Fixes: 41c445ff0f48 ("i40e: main driver core") Signed-off-by: Joe Damato Reported-by: kernel test robot Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit 0f344c8129a5337dae50e31b817dd50a60ff238c Author: Karen Sornek Date: Thu Dec 2 12:52:01 2021 +0100 i40e: Fix for failed to init adminq while VF reset Fix for failed to init adminq: -53 while VF is resetting via MAC address changing procedure. Added sync module to avoid reading deadbeef value in reinit adminq during software reset. Without this patch it is possible to trigger VF reset procedure during reinit adminq. This resulted in an incorrect reading of value from the AQP registers and generated the -53 error. Fixes: 5c3c48ac6bf5 ("i40e: implement virtual device interface") Signed-off-by: Grzegorz Szczurek Signed-off-by: Karen Sornek Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit 92947844b8beee988c0ce17082b705c2f75f0742 Author: Sylwester Dziedziuch Date: Fri Nov 26 11:11:22 2021 +0100 i40e: Fix queues reservation for XDP When XDP was configured on a system with large number of CPUs and X722 NIC there was a call trace with NULL pointer dereference. i40e 0000:87:00.0: failed to get tracking for 256 queues for VSI 0 err -12 i40e 0000:87:00.0: setup of MAIN VSI failed BUG: kernel NULL pointer dereference, address: 0000000000000000 RIP: 0010:i40e_xdp+0xea/0x1b0 [i40e] Call Trace: ? i40e_reconfig_rss_queues+0x130/0x130 [i40e] dev_xdp_install+0x61/0xe0 dev_xdp_attach+0x18a/0x4c0 dev_change_xdp_fd+0x1e6/0x220 do_setlink+0x616/0x1030 ? ahci_port_stop+0x80/0x80 ? ata_qc_issue+0x107/0x1e0 ? lock_timer_base+0x61/0x80 ? __mod_timer+0x202/0x380 rtnl_setlink+0xe5/0x170 ? bpf_lsm_binder_transaction+0x10/0x10 ? security_capable+0x36/0x50 rtnetlink_rcv_msg+0x121/0x350 ? rtnl_calcit.isra.0+0x100/0x100 netlink_rcv_skb+0x50/0xf0 netlink_unicast+0x1d3/0x2a0 netlink_sendmsg+0x22a/0x440 sock_sendmsg+0x5e/0x60 __sys_sendto+0xf0/0x160 ? __sys_getsockname+0x7e/0xc0 ? _copy_from_user+0x3c/0x80 ? __sys_setsockopt+0xc8/0x1a0 __x64_sys_sendto+0x20/0x30 do_syscall_64+0x33/0x40 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f83fa7a39e0 This was caused by PF queue pile fragmentation due to flow director VSI queue being placed right after main VSI. Because of this main VSI was not able to resize its queue allocation for XDP resulting in no queues allocated for main VSI when XDP was turned on. Fix this by always allocating last queue in PF queue pile for a flow director VSI. Fixes: 41c445ff0f48 ("i40e: main driver core") Fixes: 74608d17fe29 ("i40e: add support for XDP_TX action") Signed-off-by: Sylwester Dziedziuch Signed-off-by: Mateusz Palczewski Reviewed-by: Maciej Fijalkowski Tested-by: Kiran Bhandare Signed-off-by: Tony Nguyen commit d701658a50a471591094b3eb3961b4926cc8f104 Author: Jedrzej Jagielski Date: Fri Nov 5 11:17:00 2021 +0000 i40e: Fix issue when maximum queues is exceeded Before this patch VF interface vanished when maximum queue number was exceeded. Driver tried to add next queues even if there was not enough space. PF sent incorrect number of queues to the VF when there were not enough of them. Add an additional condition introduced to check available space in 'qp_pile' before proceeding. This condition makes it impossible to add queues if they number is greater than the number resulting from available space. Also add the search for free space in PF queue pair piles. Without this patch VF interfaces are not seen when available space for queues has been exceeded and following logs appears permanently in dmesg: "Unable to get VF config (-32)". "VF 62 failed opcode 3, retval: -5" "Unable to get VF config due to PF error condition, not retrying" Fixes: 7daa6bf3294e ("i40e: driver core headers") Fixes: 41c445ff0f48 ("i40e: main driver core") Signed-off-by: Jaroslaw Gawin Signed-off-by: Slawomir Laba Signed-off-by: Jedrzej Jagielski Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit 9b13bd53134c9ddd544a790125199fdbdb505e67 Author: Jedrzej Jagielski Date: Thu Oct 28 13:51:14 2021 +0000 i40e: Increase delay to 1 s after global EMP reset Recently simplified i40e_rebuild causes that FW sometimes is not ready after NVM update, the ping does not return. Increase the delay in case of EMP reset. Old delay of 300 ms was introduced for specific cards for 710 series. Now it works for all the cards and delay was increased. Fixes: 1fa51a650e1d ("i40e: Add delay after EMP reset for firmware to recover") Signed-off-by: Arkadiusz Kubalewski Signed-off-by: Jedrzej Jagielski Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit 8da46c0f98a1a17bc8f6d324d82b4d26e1448869 Author: Minghao Chi Date: Wed Jan 12 08:27:29 2022 +0000 RISC-V: Remove redundant err variable Return value from user_regset_copyin() directly instead of taking this in another redundant variable. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: CGEL ZTE Signed-off-by: Palmer Dabbelt commit 46cdc45acb089c811d9a54fd50af33b96e5fae9d Author: Jens Axboe Date: Thu Jan 20 10:28:13 2022 -0700 block: fix async_depth sysfs interface for mq-deadline A previous commit added this feature, but it inadvertently used the wrong variable to show/store the setting from/to, victimized by copy/paste. Fix it up so that the async_depth sysfs interface reads and writes from the right setting. Fixes: 07757588e507 ("block/mq-deadline: Reserve 25% of scheduler tags for synchronous requests") Link: https://bugzilla.kernel.org/show_bug.cgi?id=215485 Reviewed-by: Bart Van Assche Signed-off-by: Jens Axboe commit 58dfff3e984dfb96dae98008e6ea0ab92248d003 Author: Rob Herring Date: Tue Jan 18 19:53:25 2022 -0600 dt-bindings: Drop unnecessary pinctrl properties For a single pinctrl mode, it is not necessary to define pinctrl properties as the tools always allow pinctrl properties. Signed-off-by: Rob Herring Acked-by: Charles Keepax Acked-by: Mark Brown Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220119015325.2438277-1-robh@kernel.org commit db3f02df1853acf4d678bcddb3f1eab23219b410 Author: Ron Economos Date: Thu Dec 30 22:11:06 2021 -0800 riscv: dts: sifive unmatched: Add gpio poweroff Some of the GPIO pins on the Unmatched are wire up to control the power of the board, indicate that in the device tree. Signed-off-by: Ron Economos Signed-off-by: Palmer Dabbelt commit 3c2905ea79245fd37c2ab9d9384ab85d4732e3ef Author: Lukas Bulwahn Date: Wed Dec 29 20:24:58 2021 +0100 riscv: canaan: remove useless select of non-existing config SYSCON The config SYSCON never existed in the kernel repository; so, the select of that config in ./drivers/soc/canaan/Kconfig has no effect. Presumably, this was just some mistake, assuming some symmetry in handling and naming of configs that simply does not exist. Remove this useless select of a non-existing config. Signed-off-by: Lukas Bulwahn Signed-off-by: Palmer Dabbelt commit 26fb751ca37846c912daa347be298bfd945cc560 Author: Atish Patra Date: Thu Jan 20 01:09:18 2022 -0800 RISC-V: Do not use cpumask data structure for hartid bitmap Currently, SBI APIs accept a hartmask that is generated from struct cpumask. Cpumask data structure can hold upto NR_CPUs value. Thus, it is not the correct data structure for hartids as it can be higher than NR_CPUs for platforms with sparse or discontguous hartids. Remove all association between hartid mask and struct cpumask. Reviewed-by: Anup Patel (For Linux RISC-V changes) Acked-by: Anup Patel (For KVM RISC-V changes) Signed-off-by: Atish Patra Signed-off-by: Palmer Dabbelt commit 2ffc48fc7071da4b2d881b0f21d37ed05feb697b Author: Atish Patra Date: Thu Jan 20 01:09:17 2022 -0800 RISC-V: Move spinwait booting method to its own config The spinwait booting method should only be used for platforms with older firmware without SBI HSM extension or M-mode firmware because spinwait method can't support cpu hotplug, kexec or sparse hartid. It is better to move the entire spinwait implementation to its own config which can be disabled if required. It is enabled by default to maintain backward compatibility and M-mode Linux. Reviewed-by: Anup Patel Signed-off-by: Atish Patra Signed-off-by: Palmer Dabbelt commit 0b39eb38f85908e039ce8c9f09868438e029757b Author: Atish Patra Date: Thu Jan 20 01:09:16 2022 -0800 RISC-V: Move the entire hart selection via lottery to SMP The booting hart selection via lottery is only useful for SMP systems. Moreover, the lottery selection is only necessary for systems using spinwait booting method. It is better to keep the entire lottery selection together so that it can be disabled in future. Move the lottery selection code to under CONFIG_SMP. Reviewed-by: Anup Patel Signed-off-by: Atish Patra Signed-off-by: Palmer Dabbelt commit c78f94f35cf6486c4057317e8de3ddc4c62e12c7 Author: Atish Patra Date: Thu Jan 20 01:09:15 2022 -0800 RISC-V: Use __cpu_up_stack/task_pointer only for spinwait method The __cpu_up_stack/task_pointer array is only used for spinwait method now. The per cpu array based lookup is also fragile for platforms with discontiguous/sparse hartids. The spinwait method is only used for M-mode Linux or older firmwares without SBI HSM extension. For general Linux systems, ordered booting method is preferred anyways to support cpu hotplug and kexec. Make sure that __cpu_up_stack/task_pointer is only used for spinwait method. Take this opportunity to rename it to __cpu_spinwait_stack/task_pointer to emphasize the purpose as well. Reviewed-by: Anup Patel Signed-off-by: Atish Patra Signed-off-by: Palmer Dabbelt commit 410bb20a698d4c95c63e7f2b6f6f7d8da43795f5 Author: Atish Patra Date: Thu Jan 20 01:09:14 2022 -0800 RISC-V: Do not print the SBI version during HSM extension boot print The HSM extension information log also prints the SBI version v0.2. This is misleading as the underlying firmware SBI version may be different from v0.2. Remove the unncessary printing of SBI version. Signed-off-by: Atish Patra Reviewed-by: Anup Patel Signed-off-by: Palmer Dabbelt commit 9a2451f1866344d38b4a1dc20396e3a03954fcd7 Author: Atish Patra Date: Thu Jan 20 01:09:13 2022 -0800 RISC-V: Avoid using per cpu array for ordered booting Currently both order booting and spinwait approach uses a per cpu array to update stack & task pointer. This approach will not work for the following cases. 1. If NR_CPUs are configured to be less than highest hart id. 2. A platform has sparse hartid. This issue can be fixed for ordered booting as the booting cpu brings up one cpu at a time using SBI HSM extension which has opaque parameter that is unused until now. Introduce a common secondary boot data structure that can store the stack and task pointer. Secondary harts will use this data while booting up to setup the sp & tp. Reviewed-by: Anup Patel Signed-off-by: Atish Patra Signed-off-by: Palmer Dabbelt commit e2e83a73d7ce66f62c7830a85619542ef59c90e4 Author: Wei Wang Date: Wed Jan 19 23:50:03 2022 -0500 docs: kvm: fix WARNINGs from api.rst Use the api number 134 for KVM_GET_XSAVE2, instead of 42, which has been used by KVM_GET_XSAVE. Also, fix the WARNINGs of the underlines being too short. Reported-by: Stephen Rothwell Signed-off-by: Wei Wang Tested-by: Stephen Rothwell Message-Id: <20220120045003.315177-1-wei.w.wang@intel.com> Signed-off-by: Paolo Bonzini commit 83a34ad848937462aa64fa3d48f8c0b4034f2503 Author: Jinrong Liang Date: Wed Jan 19 22:03:25 2022 +0800 selftests: kvm/x86: Fix the warning in lib/x86_64/processor.c The following warning appears when executing make -C tools/testing/selftests/kvm include/x86_64/processor.h:290:2: warning: 'ecx' may be used uninitialized in this function [-Wmaybe-uninitialized] asm volatile("cpuid" ^~~ lib/x86_64/processor.c:1523:21: note: 'ecx' was declared here uint32_t eax, ebx, ecx, edx, max_ext_leaf; Just initialize ecx to remove this warning. Fixes: c8cc43c1eae2 ("selftests: KVM: avoid failures due to reserved HyperTransport region") Signed-off-by: Jinrong Liang Message-Id: <20220119140325.59369-1-cloudliang@tencent.com> Signed-off-by: Paolo Bonzini commit a0f4ba7f51ea736a6b4ccf58563507d7af9128fb Author: Jinrong Liang Date: Wed Jan 19 21:39:10 2022 +0800 selftests: kvm/x86: Fix the warning in pmu_event_filter_test.c The following warning appears when executing make -C tools/testing/selftests/kvm x86_64/pmu_event_filter_test.c: In function 'vcpu_supports_intel_br_retired': x86_64/pmu_event_filter_test.c:241:28: warning: variable 'cpuid' set but not used [-Wunused-but-set-variable] 241 | struct kvm_cpuid2 *cpuid; | ^~~~~ x86_64/pmu_event_filter_test.c: In function 'vcpu_supports_amd_zen_br_retired': x86_64/pmu_event_filter_test.c:258:28: warning: variable 'cpuid' set but not used [-Wunused-but-set-variable] 258 | struct kvm_cpuid2 *cpuid; | ^~~~~ Just delete the unused variables to stay away from warnings. Fixes: dc7e75b3b3ee ("selftests: kvm/x86: Add test for KVM_SET_PMU_EVENT_FILTER") Signed-off-by: Jinrong Liang Message-Id: <20220119133910.56285-1-cloudliang@tencent.com> Signed-off-by: Paolo Bonzini commit 3938d5a2f9369d1ebd56320629fed395ce327e9c Author: Heinrich Schuchardt Date: Thu Dec 16 13:35:38 2021 +0100 riscv: default to CONFIG_RISCV_SBI_V01=n The SBI 0.1 specification is obsolete. The current version is 0.3. Hence we should not rely by default on SBI 0.1 being implemented. Signed-off-by: Heinrich Schuchardt Signed-off-by: Palmer Dabbelt commit 2c271fe77d52a0555161926c232cd5bc07178b39 Merge: 64f29d8856a9e 9f51ce0b9e73f Author: Linus Torvalds Date: Thu Jan 20 17:38:23 2022 +0200 Merge tag 'gpio-fixes-for-v5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux Pull gpio fixes from Bartosz Golaszewski: "Fix the same error check issue in two drivers. And then the drivers are fixed even more because the first patches were incomplete which I missed. Summary: - fix the error checks of platform_get_irq() in gpio-mpc8xxx and gpio-idt3243x" * tag 'gpio-fixes-for-v5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: gpio: mpc8xxx: Fix an ignored error return from platform_get_irq() gpio: idt3243x: Fix an ignored error return from platform_get_irq() gpio: idt3243x: Fix IRQ check in idt_gpio_probe gpio: mpc8xxx: Fix IRQ check in mpc8xxx_probe commit 6e10e21915c1ab6eaa145f7b5ebaf4500af1b011 Author: Arnaldo Carvalho de Melo Date: Wed Sep 8 16:09:08 2021 -0300 tools headers UAPI: Sync files changed by new set_mempolicy_home_node syscall To pick the changes in these csets: 21b084fdf2a49ca1 ("mm/mempolicy: wire up syscall set_mempolicy_home_node") That add support for this new syscall in tools such as 'perf trace'. For instance, this is now possible: [root@five ~]# perf trace -e set_mempolicy_home_node ^C[root@five ~]# [root@five ~]# perf trace -v -e set_mempolicy_home_node Using CPUID AuthenticAMD-25-21-0 event qualifier tracepoint filter: (common_pid != 253729 && common_pid != 3585) && (id == 450) mmap size 528384B ^C[root@five ~] [root@five ~]# perf trace -v -e set* --max-events 5 Using CPUID AuthenticAMD-25-21-0 event qualifier tracepoint filter: (common_pid != 253734 && common_pid != 3585) && (id == 38 || id == 54 || id == 105 || id == 106 || id == 109 || id == 112 || id == 113 || id == 114 || id == 116 || id == 117 || id == 119 || id == 122 || id == 123 || id == 141 || id == 160 || id == 164 || id == 170 || id == 171 || id == 188 || id == 205 || id == 218 || id == 238 || id == 273 || id == 308 || id == 450) mmap size 528384B 0.000 ( 0.008 ms): bash/253735 setpgid(pid: 253735 (bash), pgid: 253735 (bash)) = 0 6849.011 ( 0.008 ms): bash/16046 setpgid(pid: 253736 (bash), pgid: 253736 (bash)) = 0 6849.080 ( 0.005 ms): bash/253736 setpgid(pid: 253736 (bash), pgid: 253736 (bash)) = 0 7437.718 ( 0.009 ms): gnome-shell/253737 set_robust_list(head: 0x7f34b527e920, len: 24) = 0 13445.986 ( 0.010 ms): bash/16046 setpgid(pid: 253738 (bash), pgid: 253738 (bash)) = 0 [root@five ~]# That is the filter expression attached to the raw_syscalls:sys_{enter,exit} tracepoints. $ find tools/perf/arch/ -name "syscall*tbl" | xargs grep -w set_mempolicy_home_node tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl:450 common set_mempolicy_home_node sys_set_mempolicy_home_node tools/perf/arch/powerpc/entry/syscalls/syscall.tbl:450 nospu set_mempolicy_home_node sys_set_mempolicy_home_node tools/perf/arch/s390/entry/syscalls/syscall.tbl:450 common set_mempolicy_home_node sys_set_mempolicy_home_node sys_set_mempolicy_home_node tools/perf/arch/x86/entry/syscalls/syscall_64.tbl:450 common set_mempolicy_home_node sys_set_mempolicy_home_node $ $ grep -w set_mempolicy_home_node /tmp/build/perf/arch/x86/include/generated/asm/syscalls_64.c [450] = "set_mempolicy_home_node", $ 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: Aneesh Kumar K.V Cc: Linus Torvalds Signed-off-by: Arnaldo Carvalho de Melo commit 2a1355f0bf41a2132d522ed7a2a7eb1cc4fe3d8f Author: Stefan Binding Date: Thu Jan 20 10:56:18 2022 +0000 ALSA: hda/cs8409: Add new Warlock SKUs to patch_cs8409 Signed-off-by: Stefan Binding Signed-off-by: Vitaly Rodionov Link: https://lore.kernel.org/r/20220120105618.249144-1-vitalyr@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 3ee859e384d453d6ac68bfd5971f630d9fa46ad3 Author: OGAWA Hirofumi Date: Sun Jan 9 18:36:43 2022 +0900 block: Fix wrong offset in bio_truncate() bio_truncate() clears the buffer outside of last block of bdev, however current bio_truncate() is using the wrong offset of page. So it can return the uninitialized data. This happened when both of truncated/corrupted FS and userspace (via bdev) are trying to read the last of bdev. Reported-by: syzbot+ac94ae5f68b84197f41c@syzkaller.appspotmail.com Signed-off-by: OGAWA Hirofumi Reviewed-by: Ming Lei Link: https://lore.kernel.org/r/875yqt1c9g.fsf@mail.parknet.co.jp Signed-off-by: Jens Axboe commit 217663f101a56ef77f82273818253fff082bf503 Author: Yang Li Date: Thu Jan 20 13:57:22 2022 +0100 fanotify: remove variable set but not used The code that uses the pointer info has been removed in 7326e382c21e ("fanotify: report old and/or new parent+name in FAN_RENAME event"). and fanotify_event_info() doesn't change 'event', so the declaration and assignment of info can be removed. Eliminate the following clang warning: fs/notify/fanotify/fanotify_user.c:161:24: warning: variable ‘info’ set but not used Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Jan Kara commit 57afdc0aab094b4c811b3fe030b2567812a495f3 Merge: 6cee105e7f2ce 0959bc4bd4206 Author: David S. Miller Date: Thu Jan 20 11:58:45 2022 +0000 Merge branch 'stmmac-fixes' Yuji Ishikawa says: ==================== net: stmmac: dwmac-visconti: Fix bit definitions and clock configuration for RMII mode This series is a fix for RMII/MII operation mode of the dwmac-visconti driver. It is composed of two parts: * 1/2: fix constant definitions for cleared bits in ETHER_CLK_SEL register * 2/2: fix configuration of ETHER_CLK_SEL register for running in RMII operation mode. net: stmmac: dwmac-visconti: Fix bit definitions for ETHER_CLK_SEL v1 -> v2: - added Fixes tag to commit message net: stmmac: dwmac-visconti: Fix clock configuration for RMII mode v1 -> v2: - added Fixes tag to commit message ==================== Signed-off-by: David S. Miller commit 0959bc4bd4206433ed101a1332a23e93ad16ec77 Author: Yuji Ishikawa Date: Wed Jan 19 13:46:48 2022 +0900 net: stmmac: dwmac-visconti: Fix clock configuration for RMII mode Bit pattern of the ETHER_CLOCK_SEL register for RMII/MII mode should be fixed. Also, some control bits should be modified with a specific sequence. Fixes: b38dd98ff8d0 ("net: stmmac: Add Toshiba Visconti SoCs glue driver") Signed-off-by: Yuji Ishikawa Reviewed-by: Nobuhiro Iwamatsu Signed-off-by: David S. Miller commit 1ba1a4a90fa416a6f389206416c5f488cf8b1543 Author: Yuji Ishikawa Date: Wed Jan 19 13:46:47 2022 +0900 net: stmmac: dwmac-visconti: Fix bit definitions for ETHER_CLK_SEL just 0 should be used to represent cleared bits * ETHER_CLK_SEL_DIV_SEL_20 * ETHER_CLK_SEL_TX_CLK_EXT_SEL_IN * ETHER_CLK_SEL_RX_CLK_EXT_SEL_IN * ETHER_CLK_SEL_TX_CLK_O_TX_I * ETHER_CLK_SEL_RMII_CLK_SEL_IN Fixes: b38dd98ff8d0 ("net: stmmac: Add Toshiba Visconti SoCs glue driver") Signed-off-by: Yuji Ishikawa Reviewed-by: Nobuhiro Iwamatsu Signed-off-by: David S. Miller commit 64f29d8856a9e0d1fcdc5344f76e70c364b941cb Merge: 67ed868d23711 a0b3a15eab6bc Author: Linus Torvalds Date: Thu Jan 20 13:46:20 2022 +0200 Merge tag 'ceph-for-5.17-rc1' of git://github.com/ceph/ceph-client Pull ceph updates from Ilya Dryomov: "The highlight is the new mount "device" string syntax implemented by Venky Shankar. It solves some long-standing issues with using different auth entities and/or mounting different CephFS filesystems from the same cluster, remounting and also misleading /proc/mounts contents. The existing syntax of course remains to be maintained. On top of that, there is a couple of fixes for edge cases in quota and a new mount option for turning on unbuffered I/O mode globally instead of on a per-file basis with ioctl(CEPH_IOC_SYNCIO)" * tag 'ceph-for-5.17-rc1' of git://github.com/ceph/ceph-client: ceph: move CEPH_SUPER_MAGIC definition to magic.h ceph: remove redundant Lsx caps check ceph: add new "nopagecache" option ceph: don't check for quotas on MDS stray dirs ceph: drop send metrics debug message rbd: make const pointer spaces a static const array ceph: Fix incorrect statfs report for small quota ceph: mount syntax module parameter doc: document new CephFS mount device syntax ceph: record updated mon_addr on remount ceph: new device mount syntax libceph: rename parse_fsid() to ceph_parse_fsid() and export libceph: generalize addr/ip parsing based on delimiter commit 67ed868d23711e9cec9e8adb7ae5596ae76f7cbb Merge: c5a0b6e40d0b8 ac090d9c90b08 Author: Linus Torvalds Date: Thu Jan 20 13:39:13 2022 +0200 Merge tag '5.17-rc-ksmbd-server-fixes' of git://git.samba.org/ksmbd Pull ksmbd server fixes from Steve French: - authentication fix - RDMA (smbdirect) fixes (including fix for a memory corruption, and some performance improvements) - multiple improvements for multichannel - misc fixes, including crediting (flow control) improvements - cleanup fixes, including some kernel doc fixes * tag '5.17-rc-ksmbd-server-fixes' of git://git.samba.org/ksmbd: (23 commits) ksmbd: fix guest connection failure with nautilus ksmbd: uninitialized variable in create_socket() ksmbd: smbd: fix missing client's memory region invalidation ksmbd: add smb-direct shutdown ksmbd: smbd: change the default maximum read/write, receive size ksmbd: smbd: create MR pool ksmbd: add reserved room in ipc request/response ksmbd: smbd: call rdma_accept() under CM handler ksmbd: limits exceeding the maximum allowable outstanding requests ksmbd: move credit charge deduction under processing request ksmbd: add support for smb2 max credit parameter ksmbd: set 445 port to smbdirect port by default ksmbd: register ksmbd ib client with ib_register_client() ksmbd: Fix smb2_get_name() kernel-doc comment ksmbd: Delete an invalid argument description in smb2_populate_readdir_entry() ksmbd: Fix smb2_set_info_file() kernel-doc comment ksmbd: Fix buffer_check_err() kernel-doc comment ksmbd: fix multi session connection failure ksmbd: set both ipv4 and ipv6 in FSCTL_QUERY_NETWORK_INTERFACE_INFO ksmbd: set RSS capable in FSCTL_QUERY_NETWORK_INTERFACE_INFO ... commit 6cee105e7f2ced596373951d9ea08dacc3883c68 Author: Ido Schimmel Date: Thu Jan 20 10:05:46 2022 +0200 ipv6_tunnel: Rate limit warning messages The warning messages can be invoked from the data path for every packet transmitted through an ip6gre netdev, leading to high CPU utilization. Fix that by rate limiting the messages. Fixes: 09c6bbf090ec ("[IPV6]: Do mandatory IPv6 tunnel endpoint checks in realtime") Reported-by: Maksym Yaremchuk Tested-by: Maksym Yaremchuk Signed-off-by: Ido Schimmel Reviewed-by: Amit Cohen Signed-off-by: David S. Miller commit c5a0b6e40d0b8c040dbfc37f7403e99867768d92 Merge: 41652aae67c79 2bed2ced40c97 Author: Linus Torvalds Date: Thu Jan 20 13:31:46 2022 +0200 Merge tag 'vfio-v5.17-rc1' of git://github.com/awilliam/linux-vfio Pull VFIO updates from Alex Williamson: - Fix sparse endian warnings in IGD code (Alex Williamson) - Balance kvzalloc with kvfree (Jiacheng Shi) * tag 'vfio-v5.17-rc1' of git://github.com/awilliam/linux-vfio: vfio/iommu_type1: replace kfree with kvfree vfio/pci: Resolve sparse endian warnings in IGD support commit e2f08207c558bc0bc8abaa557cdb29bad776ac7b Author: Moshe Tal Date: Thu Jan 20 11:55:50 2022 +0200 ethtool: Fix link extended state for big endian The link extended sub-states are assigned as enum that is an integer size but read from a union as u8, this is working for small values on little endian systems but for big endian this always give 0. Fix the variable in the union to match the enum size. Fixes: ecc31c60240b ("ethtool: Add link extended state") Signed-off-by: Moshe Tal Reviewed-by: Ido Schimmel Tested-by: Ido Schimmel Reviewed-by: Gal Pressman Reviewed-by: Amit Cohen Signed-off-by: David S. Miller commit d15c7e875d44367005370e6a82e8f3a382a04f9b Author: Robert Hancock Date: Tue Jan 18 15:52:43 2022 -0600 net: phy: broadcom: hook up soft_reset for BCM54616S A problem was encountered with the Bel-Fuse 1GBT-SFP05 SFP module (which is a 1 Gbps copper module operating in SGMII mode with an internal BCM54616S PHY device) using the Xilinx AXI Ethernet MAC core, where the module would work properly on the initial insertion or boot of the device, but after the device was rebooted, the link would either only come up at 100 Mbps speeds or go up and down erratically. I found no meaningful changes in the PHY configuration registers between the working and non-working boots, but the status registers seemed to have a lot of error indications set on the SERDES side of the device on the non-working boot. I suspect the problem is that whatever happens on the SGMII link when the device is rebooted and the FPGA logic gets reloaded ends up putting the module's onboard PHY into a bad state. Since commit 6e2d85ec0559 ("net: phy: Stop with excessive soft reset") the genphy_soft_reset call is not made automatically by the PHY core unless the callback is explicitly specified in the driver structure. For most of these Broadcom devices, there is probably a hardware reset that gets asserted to reset the PHY during boot, however for SFP modules (where the BCM54616S is commonly found) no such reset line exists, so if the board keeps the SFP cage powered up across a reboot, it will end up with no reset occurring during reboots. Hook up the genphy_soft_reset callback for BCM54616S to ensure that a PHY reset is performed before the device is initialized. This appears to fix the issue with erratic operation after a reboot with this SFP module. Fixes: 6e2d85ec0559 ("net: phy: Stop with excessive soft reset") Signed-off-by: Robert Hancock Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 973bf8fdd12f0e70ea351c018e68edd377a836d1 Author: Victor Nogueira Date: Tue Jan 18 14:19:09 2022 -0300 net: sched: Clarify error message when qdisc kind is unknown When adding a tc rule with a qdisc kind that is not supported or not compiled into the kernel, the kernel emits the following error: "Error: Specified qdisc not found.". Found via tdc testing when ETS qdisc was not compiled in and it was not obvious right away what the message meant without looking at the kernel code. Change the error message to be more explicit and say the qdisc kind is unknown. Signed-off-by: Victor Nogueira Signed-off-by: David S. Miller commit 41652aae67c79a50d56174468de03bdb04d61d4b Merge: fa2e1ba3e9e39 3f0565451cc0c Author: Linus Torvalds Date: Thu Jan 20 13:25:01 2022 +0200 Merge tag 'pwm/for-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm Pull pwm updates from Thierry Reding: "This contains a number of nice cleanups and improvements for the core and various drivers, as well as a minor tweak to the json-schema device tree bindings" * tag 'pwm/for-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm: dt-bindings: pwm: Avoid selecting schema on node name match pwm: img: Use only a single idiom to get a runtime PM reference pwm: vt8500: Implement .apply() callback pwm: img: Implement .apply() callback pwm: twl: Implement .apply() callback pwm: Restore initial state if a legacy callback fails pwm: Prevent a glitch for legacy drivers pwm: Move legacy driver handling into a dedicated function commit 47934e06b65637c88a762d9c98329ae6e3238888 Author: Congyu Liu Date: Tue Jan 18 14:20:13 2022 -0500 net: fix information leakage in /proc/net/ptype In one net namespace, after creating a packet socket without binding it to a device, users in other net namespaces can observe the new `packet_type` added by this packet socket by reading `/proc/net/ptype` file. This is minor information leakage as packet socket is namespace aware. Add a net pointer in `packet_type` to keep the net namespace of of corresponding packet socket. In `ptype_seq_show`, this net pointer must be checked when it is not NULL. Fixes: 2feb27dbe00c ("[NETNS]: Minor information leak via /proc/net/ptype file.") Signed-off-by: Congyu Liu Signed-off-by: David S. Miller commit bb425a7598479fa0f171ec806033c440f218b0ce Author: Peng Fan Date: Wed Dec 15 14:45:58 2021 +0800 arm64: mm: apply __ro_after_init to memory_limit This variable is only set during initialization, so mark with __ro_after_init. Signed-off-by: Peng Fan Reviewed-by: David Hildenbrand Acked-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20211215064559.2843555-1-peng.fan@oss.nxp.com Signed-off-by: Catalin Marinas commit 3364c6ce23c6e347c63fc895e0d6d1e8a9407849 Author: Kees Cook Date: Wed Jan 12 12:22:59 2022 -0800 arm64: atomics: lse: Dereference matching size When building with -Warray-bounds, the following warning is generated: In file included from ./arch/arm64/include/asm/lse.h:16, from ./arch/arm64/include/asm/cmpxchg.h:14, from ./arch/arm64/include/asm/atomic.h:16, from ./include/linux/atomic.h:7, from ./include/asm-generic/bitops/atomic.h:5, from ./arch/arm64/include/asm/bitops.h:25, from ./include/linux/bitops.h:33, from ./include/linux/kernel.h:22, from kernel/printk/printk.c:22: ./arch/arm64/include/asm/atomic_lse.h:247:9: warning: array subscript 'long unsigned int[0]' is partly outside array bounds of 'atomic_t[1]' [-Warray-bounds] 247 | asm volatile( \ | ^~~ ./arch/arm64/include/asm/atomic_lse.h:266:1: note: in expansion of macro '__CMPXCHG_CASE' 266 | __CMPXCHG_CASE(w, , acq_, 32, a, "memory") | ^~~~~~~~~~~~~~ kernel/printk/printk.c:3606:17: note: while referencing 'printk_cpulock_owner' 3606 | static atomic_t printk_cpulock_owner = ATOMIC_INIT(-1); | ^~~~~~~~~~~~~~~~~~~~ This is due to the compiler seeing an unsigned long * cast against something (atomic_t) that is int sized. Replace the cast with the matching size cast. This results in no change in binary output. Note that __ll_sc__cmpxchg_case_##name##sz already uses the same constraint: [v] "+Q" (*(u##sz *)ptr Which is why only the LSE form needs updating and not the LL/SC form, so this change is unlikely to be problematic. Cc: Will Deacon Cc: Peter Zijlstra Cc: Boqun Feng Cc: linux-arm-kernel@lists.infradead.org Acked-by: Ard Biesheuvel Acked-by: Mark Rutland Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20220112202259.3950286-1-keescook@chromium.org Signed-off-by: Catalin Marinas commit 440323b6cf5b9896013a78c4f578823e8243a7fd Author: Xiongfeng Wang Date: Fri Jan 14 18:58:57 2022 +0800 asm-generic: Add missing brackets for io_stop_wc macro After using io_stop_wc(), drivers reports following compile error when compiled on X86. drivers/net/ethernet/hisilicon/hns3/hns3_enet.c: In function ‘hns3_tx_push_bd’: drivers/net/ethernet/hisilicon/hns3/hns3_enet.c:2058:12: error: expected ‘;’ before ‘(’ token io_stop_wc(); ^ It is because I missed to add the brackets after io_stop_wc macro. So let's add the missing brackets. Fixes: d5624bb29f49 ("asm-generic: introduce io_stop_wc() and add implementation for ARM64") Reported-by: Guangbin Huang Signed-off-by: Xiongfeng Wang Link: https://lore.kernel.org/r/20220114105857.126300-1-wangxiongfeng2@huawei.com Signed-off-by: Catalin Marinas commit fa2e1ba3e9e39072fa7a6a9d11ac432c505b4ac7 Merge: f4484d138b31e ff9fc0a31d85f Author: Linus Torvalds Date: Thu Jan 20 10:57:05 2022 +0200 Merge tag 'net-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Pull networking fixes from Jakub Kicinski: "Including fixes from netfilter, bpf. Quite a handful of old regression fixes but most of those are pre-5.16. Current release - regressions: - fix memory leaks in the skb free deferral scheme if upper layer protocols are used, i.e. in-kernel TCP readers like TLS Current release - new code bugs: - nf_tables: fix NULL check typo in _clone() functions - change the default to y for Vertexcom vendor Kconfig - a couple of fixes to incorrect uses of ref tracking - two fixes for constifying netdev->dev_addr Previous releases - regressions: - bpf: - various verifier fixes mainly around register offset handling when passed to helper functions - fix mount source displayed for bpffs (none -> bpffs) - bonding: - fix extraction of ports for connection hash calculation - fix bond_xmit_broadcast return value when some devices are down - phy: marvell: add Marvell specific PHY loopback - sch_api: don't skip qdisc attach on ingress, prevent ref leak - htb: restore minimal packet size handling in rate control - sfp: fix high power modules without diagnostic monitoring - mscc: ocelot: - don't let phylink re-enable TX PAUSE on the NPI port - don't dereference NULL pointers with shared tc filters - smsc95xx: correct reset handling for LAN9514 - cpsw: avoid alignment faults by taking NET_IP_ALIGN into account - phy: micrel: use kszphy_suspend/_resume for irq aware devices, avoid races with the interrupt Previous releases - always broken: - xdp: check prog type before updating BPF link - smc: resolve various races around abnormal connection termination - sit: allow encapsulated IPv6 traffic to be delivered locally - axienet: fix init/reset handling, add missing barriers, read the right status words, stop queues correctly - add missing dev_put() in sock_timestamping_bind_phc() Misc: - ipv4: prevent accidentally passing RTO_ONLINK to ip_route_output_key_hash() by sanitizing flags - ipv4: avoid quadratic behavior in netns dismantle - stmmac: dwmac-oxnas: add support for OX810SE - fsl: xgmac_mdio: add workaround for erratum A-009885" * tag 'net-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (92 commits) ipv4: add net_hash_mix() dispersion to fib_info_laddrhash keys ipv4: avoid quadratic behavior in netns dismantle net/fsl: xgmac_mdio: Fix incorrect iounmap when removing module powerpc/fsl/dts: Enable WA for erratum A-009885 on fman3l MDIO buses dt-bindings: net: Document fsl,erratum-a009885 net/fsl: xgmac_mdio: Add workaround for erratum A-009885 net: mscc: ocelot: fix using match before it is set net: phy: micrel: use kszphy_suspend()/kszphy_resume for irq aware devices net: cpsw: avoid alignment faults by taking NET_IP_ALIGN into account nfc: llcp: fix NULL error pointer dereference on sendmsg() after failed bind() net: axienet: increase default TX ring size to 128 net: axienet: fix for TX busy handling net: axienet: fix number of TX ring slots for available check net: axienet: Fix TX ring slot available check net: axienet: limit minimum TX ring size net: axienet: add missing memory barriers net: axienet: reset core on initialization prior to MDIO access net: axienet: Wait for PhyRstCmplt after core reset net: axienet: increase reset timeout bpf, selftests: Add ringbuf memory type confusion test ... commit f4484d138b31e8fa1ba410363b5b9664f68974af Merge: 1d1df41c5a333 b1e78ef3be253 Author: Linus Torvalds Date: Thu Jan 20 10:41:01 2022 +0200 Merge branch 'akpm' (patches from Andrew) Merge more updates from Andrew Morton: "55 patches. Subsystems affected by this patch series: percpu, procfs, sysctl, misc, core-kernel, get_maintainer, lib, checkpatch, binfmt, nilfs2, hfs, fat, adfs, panic, delayacct, kconfig, kcov, and ubsan" * emailed patches from Andrew Morton : (55 commits) lib: remove redundant assignment to variable ret ubsan: remove CONFIG_UBSAN_OBJECT_SIZE kcov: fix generic Kconfig dependencies if ARCH_WANTS_NO_INSTR lib/Kconfig.debug: make TEST_KMOD depend on PAGE_SIZE_LESS_THAN_256KB btrfs: use generic Kconfig option for 256kB page size limit arch/Kconfig: split PAGE_SIZE_LESS_THAN_256KB from PAGE_SIZE_LESS_THAN_64KB configs: introduce debug.config for CI-like setup delayacct: track delays from memory compact Documentation/accounting/delay-accounting.rst: add thrashing page cache and direct compact delayacct: cleanup flags in struct task_delay_info and functions use it delayacct: fix incomplete disable operation when switch enable to disable delayacct: support swapin delay accounting for swapping without blkio panic: remove oops_id panic: use error_report_end tracepoint on warnings fs/adfs: remove unneeded variable make code cleaner FAT: use io_schedule_timeout() instead of congestion_wait() hfsplus: use struct_group_attr() for memcpy() region nilfs2: remove redundant pointer sbufs fs/binfmt_elf: use PT_LOAD p_align values for static PIE const_structs.checkpatch: add frequently used ops structs ... commit 9f51ce0b9e73f83bab2442b36d5e247a81bd3401 Author: Yang Li Date: Wed Jan 19 09:04:32 2022 +0800 gpio: mpc8xxx: Fix an ignored error return from platform_get_irq() The return from the call to platform_get_irq() is int, it can be a negative error code, however this is being assigned to an unsigned int variable 'irqn', so making 'irqn' an int. Eliminate the following coccicheck warning: ./drivers/gpio/gpio-mpc8xxx.c:391:5-21: WARNING: Unsigned expression compared with zero: mpc8xxx_gc -> irqn < 0 Reported-by: Abaci Robot Fixes: 0b39536cc699 ("gpio: mpc8xxx: Fix IRQ check in mpc8xxx_probe") Signed-off-by: Yang Li Signed-off-by: Bartosz Golaszewski commit 7c1cf55577782725ea2bc24687767c8fe8e57486 Author: Yang Li Date: Wed Jan 19 09:04:31 2022 +0800 gpio: idt3243x: Fix an ignored error return from platform_get_irq() The return from the call to platform_get_irq() is int, it can be a negative error code, however this is being assigned to an unsigned int variable 'parent_irq', so making 'parent_irq' an int. Eliminate the following coccicheck warning: ./drivers/gpio/gpio-idt3243x.c:167:6-16: WARNING: Unsigned expression compared with zero: parent_irq < 0 Reported-by: Abaci Robot Fixes: 30fee1d7462a ("gpio: idt3243x: Fix IRQ check in idt_gpio_probe") Signed-off-by: Yang Li Signed-off-by: Bartosz Golaszewski commit b1e78ef3be2533973953a35a56739fda7325875c Author: Colin Ian King Date: Wed Jan 19 18:10:38 2022 -0800 lib: remove redundant assignment to variable ret The variable ret is being assigned a value that is never read. If the for-loop is entered then ret is immediately re-assigned a new value. If the for-loop is not executed ret is never read. The assignment is redundant and can be removed. Link: https://lkml.kernel.org/r/20211230134557.83633-1-colin.i.king@gmail.com Signed-off-by: Colin Ian King Reviewed-by: Jarkko Sakkinen Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 69d0db01e210e07fe915e5da91b54a867cda040f Author: Kees Cook Date: Wed Jan 19 18:10:35 2022 -0800 ubsan: remove CONFIG_UBSAN_OBJECT_SIZE The object-size sanitizer is redundant to -Warray-bounds, and inappropriately performs its checks at run-time when all information needed for the evaluation is available at compile-time, making it quite difficult to use: https://bugzilla.kernel.org/show_bug.cgi?id=214861 With -Warray-bounds almost enabled globally, it doesn't make sense to keep this around. Link: https://lkml.kernel.org/r/20211203235346.110809-1-keescook@chromium.org Signed-off-by: Kees Cook Reviewed-by: Marco Elver Cc: Masahiro Yamada Cc: Michal Marek Cc: Nick Desaulniers Cc: Nathan Chancellor Cc: Andrey Ryabinin Cc: "Peter Zijlstra (Intel)" Cc: Stephen Rothwell Cc: Arnd Bergmann Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit bece04b5b41dd7730dd06aec0d6b15c53d1fbb5a Author: Marco Elver Date: Wed Jan 19 18:10:31 2022 -0800 kcov: fix generic Kconfig dependencies if ARCH_WANTS_NO_INSTR Until recent versions of GCC and Clang, it was not possible to disable KCOV instrumentation via a function attribute. The relevant function attribute was introduced in 540540d06e9d9 ("kcov: add __no_sanitize_coverage to fix noinstr for all architectures"). x86 was the first architecture to want a working noinstr, and at the time no compiler support for the attribute existed yet. Therefore, commit 0f1441b44e823 ("objtool: Fix noinstr vs KCOV") introduced the ability to NOP __sanitizer_cov_*() calls in .noinstr.text. However, this doesn't work for other architectures like arm64 and s390 that want a working noinstr per ARCH_WANTS_NO_INSTR. At the time of 0f1441b44e823, we didn't yet have ARCH_WANTS_NO_INSTR, but now we can move the Kconfig dependency checks to the generic KCOV option. KCOV will be available if: - architecture does not care about noinstr, OR - we have objtool support (like on x86), OR - GCC is 12.0 or newer, OR - Clang is 13.0 or newer. Link: https://lkml.kernel.org/r/20211201152604.3984495-1-elver@google.com Signed-off-by: Marco Elver Reviewed-by: Nathan Chancellor Acked-by: Peter Zijlstra (Intel) Cc: Mark Rutland Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: H. Peter Anvin Cc: Nick Desaulniers Cc: Dmitry Vyukov Cc: Andrey Konovalov Cc: Catalin Marinas Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit bbd2e05fad3e692ff2495895975bd0fce02bdbae Author: Nathan Chancellor Date: Wed Jan 19 18:10:28 2022 -0800 lib/Kconfig.debug: make TEST_KMOD depend on PAGE_SIZE_LESS_THAN_256KB Commit b05fbcc36be1 ("btrfs: disable build on platforms having page size 256K") disabled btrfs for configurations that used a 256kB page size. However, it did not fully solve the problem because CONFIG_TEST_KMOD selects CONFIG_BTRFS, which does not account for the dependency. This results in a Kconfig warning and the failed BUILD_BUG_ON error returning. WARNING: unmet direct dependencies detected for BTRFS_FS Depends on [n]: BLOCK [=y] && !PPC_256K_PAGES && !PAGE_SIZE_256KB [=y] Selected by [m]: - TEST_KMOD [=m] && RUNTIME_TESTING_MENU [=y] && m && MODULES [=y] && NETDEVICES [=y] && NET_CORE [=y] && INET [=y] && BLOCK [=y] To resolve this, add CONFIG_PAGE_SIZE_LESS_THAN_256KB as a dependency of CONFIG_TEST_KMOD so there is no more invalid configuration or build errors. Link: https://lkml.kernel.org/r/20211129230141.228085-4-nathan@kernel.org Fixes: b05fbcc36be1 ("btrfs: disable build on platforms having page size 256K") Signed-off-by: Nathan Chancellor Reported-by: kernel test robot Cc: Chris Mason Cc: David Sterba Cc: Josef Bacik Cc: Luis Chamberlain Cc: Nick Desaulniers Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e9009095998a8de4491692e89ca303fb74047c9e Author: Nathan Chancellor Date: Wed Jan 19 18:10:25 2022 -0800 btrfs: use generic Kconfig option for 256kB page size limit Use the newly introduced CONFIG_PAGE_SIZE_LESS_THAN_256KB to describe the dependency introduced by commit b05fbcc36be1 ("btrfs: disable build on platforms having page size 256K"). Link: https://lkml.kernel.org/r/20211129230141.228085-3-nathan@kernel.org Signed-off-by: Nathan Chancellor Acked-by: David Sterba Cc: Chris Mason Cc: Josef Bacik Cc: kernel test robot Cc: Luis Chamberlain Cc: Nick Desaulniers Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e4bbd20d8c2b9fb5a937bf132775f5257ccb0412 Author: Nathan Chancellor Date: Wed Jan 19 18:10:22 2022 -0800 arch/Kconfig: split PAGE_SIZE_LESS_THAN_256KB from PAGE_SIZE_LESS_THAN_64KB Patch series "Fix CONFIG_TEST_KMOD with 256kB page size". The kernel test robot reported a build error [1] from a failed assertion in fs/btrfs/inode.c with a hexagon randconfig that includes CONFIG_PAGE_SIZE_256KB. This error is the same one that was addressed by commit b05fbcc36be1 ("btrfs: disable build on platforms having page size 256K") but CONFIG_TEST_KMOD selects CONFIG_BTRFS without having the "page size less than 256kB dependency", which results in the error reappearing. The first patch introduces CONFIG_PAGE_SIZE_LESS_THAN_256KB by splitting it off from CONFIG_PAGE_SIZE_LESS_THAN_64KB, which was introduced in commit 1f0e290cc5fd ("arch: Add generic Kconfig option indicating page size smaller than 64k") for a similar reason in 5.16-rc3. The second patch uses that configuration option for CONFIG_BTRFS to reduce duplication. The third patch resolves the build error by adding CONFIG_PAGE_SIZE_LESS_THAN_256KB as a dependency to CONFIG_TEST_KMOD so that CONFIG_BTRFS does not get enabled under that invalid configuration. [1]: https://lore.kernel.org/r/202111270255.UYOoN5VN-lkp@intel.com/ This patch (of 3): btrfs requires a page size smaller than 256kB. To use that dependency in other places, introduce CONFIG_PAGE_SIZE_LESS_THAN_256KB and reuse that dependency in CONFIG_PAGE_SIZE_LESS_THAN_64KB. Link: https://lkml.kernel.org/r/20211129230141.228085-1-nathan@kernel.org Link: https://lkml.kernel.org/r/20211129230141.228085-2-nathan@kernel.org Signed-off-by: Nathan Chancellor Cc: Chris Mason Cc: Josef Bacik Cc: David Sterba Cc: Luis Chamberlain Cc: Nick Desaulniers Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 0aaa8977acbf3996d351f51b3b15295943092f63 Author: Qian Cai Date: Wed Jan 19 18:10:18 2022 -0800 configs: introduce debug.config for CI-like setup Some general debugging features like kmemleak, KASAN, lockdep, UBSAN etc help fix many viruses like a microscope. On the other hand, those features are scatter around and mixed up with more situational debugging options making them difficult to consume properly. This cold help amplify the general debugging/testing efforts and help establish sensitive default values for those options across the broad. This could also help different distros to collaborate on maintaining debug-flavored kernels. The config is based on years' experiences running daily CI inside the largest enterprise Linux distro company to seek regressions on linux-next builds on different bare-metal and virtual platforms. It can be used for example, $ make ARCH=arm64 defconfig debug.config Since KASAN and KCSAN can't be enabled together, we will need to create a separate one for KCSAN later as well. Link: https://lkml.kernel.org/r/20211115134754.7334-1-quic_qiancai@quicinc.com Signed-off-by: Qian Cai Acked-by: Paul E. McKenney Cc: Marco Elver Cc: Dmitry Vyukov Cc: Daniel Thompson Cc: Masahiro Yamada Cc: Naresh Kamboju Cc: "Stephen Rothwell" Cc: Randy Dunlap Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 5bf18281534451bf1ad56a45a3085cd7ad46860d Author: wangyong Date: Wed Jan 19 18:10:15 2022 -0800 delayacct: track delays from memory compact Delay accounting does not track the delay of memory compact. When there is not enough free memory, tasks can spend a amount of their time waiting for compact. To get the impact of tasks in direct memory compact, measure the delay when allocating memory through memory compact. Also update tools/accounting/getdelays.c: / # ./getdelays_next -di -p 304 print delayacct stats ON printing IO accounting PID 304 CPU count real total virtual total delay total delay average 277 780000000 849039485 18877296 0.068ms IO count delay total delay average 0 0 0ms SWAP count delay total delay average 0 0 0ms RECLAIM count delay total delay average 5 11088812685 2217ms THRASHING count delay total delay average 0 0 0ms COMPACT count delay total delay average 3 72758 0ms watch: read=0, write=0, cancelled_write=0 Link: https://lkml.kernel.org/r/1638619795-71451-1-git-send-email-wang.yong12@zte.com.cn Signed-off-by: wangyong Reviewed-by: Jiang Xuexin Reviewed-by: Zhang Wenya Reviewed-by: Yang Yang Reviewed-by: Balbir Singh Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ec710aa8b2385e6a2239f79120fbf9b78400865b Author: wangyong Date: Wed Jan 19 18:10:12 2022 -0800 Documentation/accounting/delay-accounting.rst: add thrashing page cache and direct compact Add thrashing page cache and direct compact related descriptions and update the usage of getdelays userspace utility. The following patches modifications have been updated: https://lore.kernel.org/all/20190312102002.31737-4-jinpuwang@gmail.com/ https://lore.kernel.org/all/1638619795-71451-1-git-send-email- wang.yong12@zte.com.cn/ Link: https://lkml.kernel.org/r/1639583021-92977-1-git-send-email-wang.yong12@zte.com.cn Signed-off-by: wangyong Reviewed-by: Yang Yang Reported-by: Zeal Robot Cc: Balbir Singh Cc: Peter Zijlstra Cc: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 1193829da1a6728249cd02577a020bd64fd9c160 Author: Yang Yang Date: Wed Jan 19 18:10:09 2022 -0800 delayacct: cleanup flags in struct task_delay_info and functions use it Flags in struct task_delay_info is used to distinguish the difference between swapin and blkio delay acountings. But after patch "delayacct: support swapin delay accounting for swapping without blkio", there is no need to do that since swapin and blkio delay accounting use their own functions. Link: https://lkml.kernel.org/r/20211124065958.36703-1-yang.yang29@zte.com.cn Signed-off-by: Yang Yang Cc: Balbir Singh Cc: Ingo Molnar Cc: Johannes Weiner Cc: Peter Zijlstra Cc: Zeal Robot Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 82065b7266899fbdce4c7394d7dd02688161f0cf Author: Yang Yang Date: Wed Jan 19 18:10:06 2022 -0800 delayacct: fix incomplete disable operation when switch enable to disable When a task is created after delayacct is enabled, kernel will do all the delay accountings for that task. The problems is if user disables delayacct by set /proc/sys/kernel/task_delayacct to zero, only blkio delay accounting is disabled. Now disable all the kinds of delay accountings when /proc/sys/kernel/task_delayacct sets to zero. Link: https://lkml.kernel.org/r/20211123140342.32962-1-ran.xiaokai@zte.com.cn Signed-off-by: Yang Yang Reported-by: Zeal Robot Cc: Balbir Singh Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Johannes Weiner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a3d5dc908a5f572ce3e31fe83fd2459a1c3c5422 Author: Yang Yang Date: Wed Jan 19 18:10:02 2022 -0800 delayacct: support swapin delay accounting for swapping without blkio Currently delayacct accounts swapin delay only for swapping that cause blkio. If we use zram for swapping, tools/accounting/getdelays can't get any SWAP delay. It's useful to get zram swapin delay information, for example to adjust compress algorithm or /proc/sys/vm/swappiness. Reference to PSI, it accounts any kind of swapping by doing its work in swap_readpage(), no matter whether swapping causes blkio. Let delayacct do the similar work. Link: https://lkml.kernel.org/r/20211112083813.8559-1-yang.yang29@zte.com.cn Signed-off-by: Yang Yang Reported-by: Zeal Robot Cc: Balbir Singh Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Johannes Weiner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e83a4472bf9f556d01984048e398e64246c4dd6f Author: Sebastian Andrzej Siewior Date: Wed Jan 19 18:09:59 2022 -0800 panic: remove oops_id The oops id has been added as part of the end of trace marker for the kerneloops.org project. The id is used to automatically identify duplicate submissions of the same report. Identical looking reports with different a id can be considered as the same oops occurred again. The early initialisation of the oops_id can create a warning if the random core is not yet fully initialized. On PREEMPT_RT it is problematic if the id is initialized on demand from non preemptible context. The kernel oops project is not available since 2017. Remove the oops_id and use 0 in the output in case parser rely on it. Link: https://bugs.debian.org/953172 Link: https://lkml.kernel.org/r/Ybdi16aP2NEugWHq@linutronix.de Signed-off-by: Sebastian Andrzej Siewior Cc: Arjan van de Ven Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Peter Zijlstra Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 23b36fec7e14f8cf1c17e832e53dd4761e0dfe83 Author: Marco Elver Date: Wed Jan 19 18:09:56 2022 -0800 panic: use error_report_end tracepoint on warnings Introduce the error detector "warning" to the error_report event and use the error_report_end tracepoint at the end of a warning report. This allows in-kernel tests but also userspace to more easily determine if a warning occurred without polling kernel logs. [akpm@linux-foundation.org: add comma to enum list, per Andy] Link: https://lkml.kernel.org/r/20211115085630.1756817-1-elver@google.com Signed-off-by: Marco Elver Cc: Steven Rostedt Cc: Ingo Molnar Cc: Alexander Potapenko Cc: Petr Mladek Cc: Luis Chamberlain Cc: Wei Liu Cc: Mike Rapoport Cc: Arnd Bergmann Cc: John Ogness Cc: Andy Shevchenko Cc: Alexander Popov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 25d2e88632c9069cb21e23340e14cd19b8a0b1df Author: Minghao Chi Date: Wed Jan 19 18:09:53 2022 -0800 fs/adfs: remove unneeded variable make code cleaner Return value directly instead of taking this in a variable. Link: https://lkml.kernel.org/r/20211210023211.424609-1-chi.minghao@zte.com.cn Signed-off-by: Minghao Chi Reported-by: Zeal Robot Cc: Christian Brauner Cc: Jan Kara Cc: Greg Kroah-Hartman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 9bb56d592532526f638468ed0781b7ab7925a1ec Author: NeilBrown Date: Wed Jan 19 18:09:50 2022 -0800 FAT: use io_schedule_timeout() instead of congestion_wait() congestion_wait() in this context is just a sleep - block devices do not support congestion signalling any more. The goal for this wait, which was introduced in commit ae78bf9c4f5f ("[PATCH] add -o flush for fat") is to wait for any recently written data to get to storage. We currently have no direct mechanism to do this, so a simple wait that behaves identically to the current congestion_wait() is the best we can do. This is a step towards removing congestion_wait() Link: https://lkml.kernel.org/r/163936544519.22433.13400436295732112065@noble.neil.brown.name Signed-off-by: NeilBrown Acked-by: OGAWA Hirofumi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e35fa567a082a7547a4ec21e50a27eecf38961aa Author: Kees Cook Date: Wed Jan 19 18:09:47 2022 -0800 hfsplus: use struct_group_attr() for memcpy() region In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Add struct_group() to mark the "info" region (containing struct DInfo and struct DXInfo structs) in struct hfsplus_cat_folder and struct hfsplus_cat_file that are written into directly, so the compiler can correctly reason about the expected size of the writes. "pahole" shows no size nor member offset changes to struct hfsplus_cat_folder nor struct hfsplus_cat_file. "objdump -d" shows no object code changes. Link: https://lkml.kernel.org/r/20211119192851.1046717-1-keescook@chromium.org Signed-off-by: Kees Cook Acked-by: Christian Brauner Cc: Zhen Lei Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e1ce8a97befa98566f49acb99c79cc233cf3a703 Author: Colin Ian King Date: Wed Jan 19 18:09:44 2022 -0800 nilfs2: remove redundant pointer sbufs Pointer sbufs is being assigned a value but it's not being used later on. The pointer is redundant and can be removed. Cleans up scan-build static analysis warning: fs/nilfs2/page.c:203:8: warning: Although the value stored to 'sbufs' is used in the enclosing expression, the value is never actually read from 'sbufs' [deadcode.DeadStores] sbh = sbufs = page_buffers(src); Link: https://lkml.kernel.org/r/20211211180955.550380-1-colin.i.king@gmail.com Link: https://lkml.kernel.org/r/1640712476-15136-1-git-send-email-konishi.ryusuke@gmail.com Signed-off-by: Colin Ian King Signed-off-by: Ryusuke Konishi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 9630f0d60fec5fbcaa4435a66f75df1dc9704b66 Author: H.J. Lu Date: Wed Jan 19 18:09:40 2022 -0800 fs/binfmt_elf: use PT_LOAD p_align values for static PIE Extend commit ce81bb256a22 ("fs/binfmt_elf: use PT_LOAD p_align values for suitable start address") which fixed PIE binaries built with -Wl,-z,max-page-size=0x200000, to cover static PIE binaries. This fixes: https://bugzilla.kernel.org/show_bug.cgi?id=215275 Tested by verifying static PIE binaries with -Wl,-z,max-page-size=0x200000 loading. Link: https://lkml.kernel.org/r/20211209174052.370537-1-hjl.tools@gmail.com Signed-off-by: H.J. Lu Cc: Chris Kennelly Cc: Al Viro Cc: Alexey Dobriyan Cc: Song Liu Cc: David Rientjes Cc: Ian Rogers Cc: Hugh Dickins Cc: Suren Baghdasaryan Cc: Sandeep Patil Cc: Fangrui Song Cc: Nick Desaulniers Cc: Kirill A. Shutemov Cc: Mike Kravetz Cc: Shuah Khan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c55cdc5cd6663ff616c94ecf7204e92c7049bb5e Author: Rikard Falkeborn Date: Wed Jan 19 18:09:37 2022 -0800 const_structs.checkpatch: add frequently used ops structs Add commonly used structs (>50 instances) which are always or almost always const. Link: https://lkml.kernel.org/r/20211127101134.33101-1-rikard.falkeborn@gmail.com Signed-off-by: Rikard Falkeborn Cc: Joe Perches Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b8709bce9089996528f594cd1f71f1a085761aad Author: Joe Perches Date: Wed Jan 19 18:09:34 2022 -0800 checkpatch: improve Kconfig help test The Kconfig help test erroneously counts patch context lines as part of the help text. Fix that and improve the message block output. Link: https://lkml.kernel.org/r/06c0cdc157ae1502e8e9eb3624b9ea995cf11e7a.camel@perches.com Signed-off-by: Joe Perches Tested-by: Randy Dunlap Acked-by: Randy Dunlap Cc: Andy Whitcroft Cc: Dwaipayan Ray Cc: Lukas Bulwahn Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 36f8b348a94c12e30ca5c81eb31c9a445117ef7b Author: Jerome Forissier Date: Wed Jan 19 18:09:31 2022 -0800 checkpatch: relax regexp for COMMIT_LOG_LONG_LINE One exceptions to the COMMIT_LOG_LONG_LINE rule is a file path followed by ':'. That is typically some sort diagnostic message from a compiler or a build tool, in which case we don't want to wrap the lines but keep the message unmodified. The regular expression used to match this pattern currently doesn't accept absolute paths or + characters. This can result in false positives as in the following (out-of-tree) example: ... /home/jerome/work/optee_repo_qemu/build/../toolchains/aarch32/bin/arm-linux-gnueabihf-ld.bfd: /home/jerome/work/toolchains-gcc10.2/aarch32/bin/../lib/gcc/arm-none-linux-gnueabihf/10.2.1/../../../../arm-none-linux-gnueabihf/lib/libstdc++.a(eh_alloc.o): in function `__cxa_allocate_exception': /tmp/dgboter/bbs/build03--cen7x86_64/buildbot/cen7x86_64--arm-none-linux-gnueabihf/build/src/gcc/libstdc++-v3/libsupc++/eh_alloc.cc:284: undefined reference to `malloc' ... Update the regular expression to match the above paths. Link: https://lkml.kernel.org/r/20210923143842.2837983-1-jerome@forissier.org Signed-off-by: Jerome Forissier Acked-by: Joe Perches Cc: Andy Whitcroft Cc: Dwaipayan Ray Cc: Lukas Bulwahn Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e073e5ef90298d2d6e5e7f04b545a0815e92110c Author: Andrey Konovalov Date: Wed Jan 19 18:09:28 2022 -0800 lib/test_meminit: destroy cache in kmem_cache_alloc_bulk() test Make do_kmem_cache_size_bulk() destroy the cache it creates. Link: https://lkml.kernel.org/r/aced20a94bf04159a139f0846e41d38a1537debb.1640018297.git.andreyknvl@google.com Fixes: 03a9349ac0e0 ("lib/test_meminit: add a kmem_cache_alloc_bulk() test") Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Dmitry Vyukov Cc: Andrey Ryabinin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c7e4289cbe668c2743ac0fd623a2518dbc191dc0 Author: Andy Shevchenko Date: Wed Jan 19 18:09:25 2022 -0800 uuid: remove licence boilerplate text from the header Remove licence boilerplate text from the UAPI header. Link: https://lkml.kernel.org/r/20211216113552.81199-2-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Acked-by: Christoph Hellwig Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 8e930a66993be0a5f9a97c7c1c76ef09db4ef8bb Author: Andy Shevchenko Date: Wed Jan 19 18:09:22 2022 -0800 uuid: discourage people from using UAPI header in new code Discourage people from using UAPI header in new code by adding a note. Link: https://lkml.kernel.org/r/20211216113552.81199-1-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Acked-by: Christoph Hellwig Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 60c7801b121aa0e90d8aae7245859aec0ce2306f Author: Andy Shevchenko Date: Wed Jan 19 18:09:19 2022 -0800 kunit: replace kernel.h with the necessary inclusions When kernel.h is used in the headers it adds a lot into dependency hell, especially when there are circular dependencies are involved. Replace kernel.h inclusion with the list of what is really being used. Link: https://lkml.kernel.org/r/20211213204441.56204-1-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Reviewed-by: Brendan Higgins Tested-by: Brendan Higgins Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 0acc968f352336a459f27ba1f23745a174933c9c Author: Isabella Basso Date: Wed Jan 19 18:09:15 2022 -0800 test_hash.c: refactor into kunit Use KUnit framework to make tests more easily integrable with CIs. Even though these tests are not yet properly written as unit tests this change should help in debugging. Also remove kernel messages (i.e. through pr_info) as KUnit handles all debugging output and let it handle module init and exit details. Link: https://lkml.kernel.org/r/20211208183711.390454-6-isabbasso@riseup.net Reviewed-by: David Gow Reported-by: kernel test robot Tested-by: David Gow Co-developed-by: Augusto Durães Camargo Signed-off-by: Augusto Durães Camargo Co-developed-by: Enzo Ferreira Signed-off-by: Enzo Ferreira Signed-off-by: Isabella Basso Cc: Brendan Higgins Cc: Daniel Latypov Cc: Geert Uytterhoeven Cc: Rodrigo Siqueira Cc: Shuah Khan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 88168bf35c5260013daab4bddf944cd557cb6f08 Author: Isabella Basso Date: Wed Jan 19 18:09:12 2022 -0800 lib/Kconfig.debug: properly split hash test kernel entries Split TEST_HASH so that each entry only has one file. Note that there's no stringhash test file, but actually tests are performed in lib/test_hash.c. Link: https://lkml.kernel.org/r/20211208183711.390454-5-isabbasso@riseup.net Reviewed-by: David Gow Tested-by: David Gow Signed-off-by: Isabella Basso Cc: Augusto Durães Camargo Cc: Brendan Higgins Cc: Daniel Latypov Cc: Enzo Ferreira Cc: Geert Uytterhoeven Cc: kernel test robot Cc: Rodrigo Siqueira Cc: Shuah Khan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 5427d3d772a77a4d67fece057064832ec5cfa078 Author: Isabella Basso Date: Wed Jan 19 18:09:09 2022 -0800 test_hash.c: split test_hash_init Split up test_hash_init so that it calls each test more explicitly insofar it is possible without rewriting the entire file. This aims at improving readability. Split tests performed on string_or as they don't interfere with those performed in hash_or. Also separate pr_info calls about skipped tests as they're not part of the tests themselves, but only warn about (un)defined arch-specific hash functions. Link: https://lkml.kernel.org/r/20211208183711.390454-4-isabbasso@riseup.net Reviewed-by: David Gow Tested-by: David Gow Signed-off-by: Isabella Basso Cc: Augusto Durães Camargo Cc: Brendan Higgins Cc: Daniel Latypov Cc: Enzo Ferreira Cc: Geert Uytterhoeven Cc: kernel test robot Cc: Rodrigo Siqueira Cc: Shuah Khan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ae7880676bc8019ff61e49126c558ad7c4b6fa21 Author: Isabella Basso Date: Wed Jan 19 18:09:05 2022 -0800 test_hash.c: split test_int_hash into arch-specific functions Split the test_int_hash function to keep its mainloop separate from arch-specific chunks, which are only compiled as needed. This aims at improving readability. Link: https://lkml.kernel.org/r/20211208183711.390454-3-isabbasso@riseup.net Reviewed-by: David Gow Tested-by: David Gow Signed-off-by: Isabella Basso Cc: Augusto Durães Camargo Cc: Brendan Higgins Cc: Daniel Latypov Cc: Enzo Ferreira Cc: Geert Uytterhoeven Cc: kernel test robot Cc: Rodrigo Siqueira Cc: Shuah Khan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit fd0a1462405b087377e59b84e119fe7e2d08499a Author: Isabella Basso Date: Wed Jan 19 18:09:02 2022 -0800 hash.h: remove unused define directive Patch series "test_hash.c: refactor into KUnit", v3. We refactored the lib/test_hash.c file into KUnit as part of the student group LKCAMP [1] introductory hackathon for kernel development. This test was pointed to our group by Daniel Latypov [2], so its full conversion into a pure KUnit test was our goal in this patch series, but we ran into many problems relating to it not being split as unit tests, which complicated matters a bit, as the reasoning behind the original tests is quite cryptic for those unfamiliar with hash implementations. Some interesting developments we'd like to highlight are: - In patch 1/5 we noticed that there was an unused define directive that could be removed. - In patch 4/5 we noticed how stringhash and hash tests are all under the lib/test_hash.c file, which might cause some confusion, and we also broke those kernel config entries up. Overall KUnit developments have been made in the other patches in this series: In patches 2/5, 3/5 and 5/5 we refactored the lib/test_hash.c file so as to make it more compatible with the KUnit style, whilst preserving the original idea of the maintainer who designed it (i.e. George Spelvin), which might be undesirable for unit tests, but we assume it is enough for a first patch. This patch (of 5): Currently, there exist hash_32() and __hash_32() functions, which were introduced in a patch [1] targeting architecture specific optimizations. These functions can be overridden on a per-architecture basis to achieve such optimizations. They must set their corresponding define directive (HAVE_ARCH_HASH_32 and HAVE_ARCH__HASH_32, respectively) so that header files can deal with these overrides properly. As the supported 32-bit architectures that have their own hash function implementation (i.e. m68k, Microblaze, H8/300, pa-risc) have only been making use of the (more general) __hash_32() function (which only lacks a right shift operation when compared to the hash_32() function), remove the define directive corresponding to the arch-specific hash_32() implementation. [1] https://lore.kernel.org/lkml/20160525073311.5600.qmail@ns.sciencehorizons.net/ [akpm@linux-foundation.org: hash_32_generic() becomes hash_32()] Link: https://lkml.kernel.org/r/20211208183711.390454-1-isabbasso@riseup.net Link: https://lkml.kernel.org/r/20211208183711.390454-2-isabbasso@riseup.net Reviewed-by: David Gow Tested-by: David Gow Co-developed-by: Augusto Durães Camargo Signed-off-by: Augusto Durães Camargo Co-developed-by: Enzo Ferreira Signed-off-by: Enzo Ferreira Signed-off-by: Isabella Basso Cc: Geert Uytterhoeven Cc: Brendan Higgins Cc: Daniel Latypov Cc: Shuah Khan Cc: Rodrigo Siqueira Cc: kernel test robot Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a31f9336ed48317d61c2299d595ed14294ffe5f9 Author: Zhen Lei Date: Wed Jan 19 18:08:59 2022 -0800 lib/list_debug.c: print more list debugging context in __list_del_entry_valid() Currently, the entry->prev and entry->next are considered to be valid as long as they are not LIST_POISON{1|2}. However, the memory may be corrupted. The prev->next is invalid probably because 'prev' is invalid, not because prev->next's content is illegal. Unfortunately, the printk and its subfunctions will modify the registers that hold the 'prev' and 'next', and we don't see this valuable information in the BUG context. So print the contents of 'entry->prev' and 'entry->next'. Here's an example: list_del corruption. prev->next should be c0ecbf74, but was c08410dc kernel BUG at lib/list_debug.c:53! ... ... PC is at __list_del_entry_valid+0x58/0x98 LR is at __list_del_entry_valid+0x58/0x98 psr: 60000093 sp : c0ecbf30 ip : 00000000 fp : 00000001 r10: c08410d0 r9 : 00000001 r8 : c0825e0c r7 : 20000013 r6 : c08410d0 r5 : c0ecbf74 r4 : c0ecbf74 r3 : c0825d08 r2 : 00000000 r1 : df7ce6f4 r0 : 00000044 ... ... Stack: (0xc0ecbf30 to 0xc0ecc000) bf20: c0ecbf74 c0164fd0 c0ecbf70 c0165170 bf40: c0eca000 c0840c00 c0840c00 c0824500 c0825e0c c0189bbc c088f404 60000013 bf60: 60000013 c0e85100 000004ec 00000000 c0ebcdc0 c0ecbf74 c0ecbf74 c0825d08 bf80: c0e807c0 c018965c 00000000 c013f2a0 c0e807c0 c013f154 00000000 00000000 bfa0: 00000000 00000000 00000000 c01001b0 00000000 00000000 00000000 00000000 bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 bfe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000 (__list_del_entry_valid) from (__list_del_entry+0xc/0x20) (__list_del_entry) from (finish_swait+0x60/0x7c) (finish_swait) from (rcu_gp_kthread+0x560/0xa20) (rcu_gp_kthread) from (kthread+0x14c/0x15c) (kthread) from (ret_from_fork+0x14/0x24) At first, I thought prev->next was overwritten. Later, I carefully analyzed the RCU code and the disassembly code. The error occurred when deleting a node from the list rcu_state.gp_wq. The System.map shows that the address of rcu_state is c0840c00. Then I use gdb to obtain the offset of rcu_state.gp_wq.task_list. (gdb) p &((struct rcu_state *)0)->gp_wq.task_list $1 = (struct list_head *) 0x4dc Again: list_del corruption. prev->next should be c0ecbf74, but was c08410dc c08410dc = c0840c00 + 0x4dc = &rcu_state.gp_wq.task_list Because rcu_state.gp_wq has at most one node, so I can guess that "prev = &rcu_state.gp_wq.task_list". But for other scenes, maybe I wasn't so lucky, I cannot figure out the value of 'prev'. Link: https://lkml.kernel.org/r/20211207025835.1909-1-thunder.leizhen@huawei.com Signed-off-by: Zhen Lei Cc: "Paul E . McKenney" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 0425473037db40d9e322631f2d4dc6ef51f97e88 Author: Andy Shevchenko Date: Wed Jan 19 18:08:56 2022 -0800 list: introduce list_is_head() helper and re-use it in list.h Introduce list_is_head() in the similar (*) way as it's done for list_entry_is_head(). Make use of it in the list.h. *) it's done as inliner and not a macro to be aligned with other list_is_*() APIs; while at it, make all three to have the same style. Link: https://lkml.kernel.org/r/20211201141824.81400-1-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Cc: Heikki Krogerus Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 70ac69928e9717a313a4c72647ebe80663e397a3 Author: Alexey Dobriyan Date: Wed Jan 19 18:08:53 2022 -0800 kstrtox: uninline everything I've made a mistake of looking into lib/kstrtox.o code generation. The only function remotely performance critical is _parse_integer() (via /proc/*/map_files/*), everything else is not. Uninline everything, shrink lib/kstrtox.o by ~20 % ! Space savings on x86_64: add/remove: 0/0 grow/shrink: 0/23 up/down: 0/-1269 (-1269 !!!) Function old new delta kstrtoull 16 13 -3 kstrtouint 59 48 -11 kstrtou8 60 49 -11 kstrtou16 61 50 -11 _kstrtoul 46 35 -11 kstrtoull_from_user 95 83 -12 kstrtoul_from_user 95 83 -12 kstrtoll 93 80 -13 kstrtouint_from_user 124 83 -41 kstrtou8_from_user 125 83 -42 kstrtou16_from_user 126 83 -43 kstrtos8 101 50 -51 kstrtos16 102 51 -51 kstrtoint 100 49 -51 _kstrtol 93 35 -58 kstrtobool_from_user 156 75 -81 kstrtoll_from_user 165 83 -82 kstrtol_from_user 165 83 -82 kstrtoint_from_user 172 83 -89 kstrtos8_from_user 173 83 -90 kstrtos16_from_user 174 83 -91 _parse_integer 136 10 -126 _kstrtoull 308 101 -207 Total: Before=3421236, After=3419967, chg -0.04% Link: https://lkml.kernel.org/r/YZDsFDhHst4m2Pnt@localhost.localdomain Signed-off-by: Alexey Dobriyan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 26d98e9f78da8e49413b1cb6bcd0d63ac03b8c85 Author: Randy Dunlap Date: Wed Jan 19 18:08:50 2022 -0800 get_maintainer: don't remind about no git repo when --nogit is used When --nogit is used with scripts/get_maintainer.pl, the script spews 4 lines of unnecessary information (noise). Do not print those lines when --nogit is specified. This change removes the printing of these 4 lines: ./scripts/get_maintainer.pl: No supported VCS found. Add --nogit to options? Using a git repository produces better results. Try Linus Torvalds' latest git repository using: git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Link: https://lkml.kernel.org/r/20220102031424.3328-1-rdunlap@infradead.org Signed-off-by: Randy Dunlap Cc: Joe Perches Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 7f8ca0edfe07d271ba6bef3cef5ec7fc1bbe8a68 Author: Davidlohr Bueso Date: Wed Jan 19 18:08:47 2022 -0800 kernel/sys.c: only take tasklist_lock for get/setpriority(PRIO_PGRP) PRIO_PGRP needs the tasklist_lock mainly to serialize vs setpgid(2), to protect against any concurrent change_pid(PIDTYPE_PGID) that can move the task from one hlist to another while iterating. However, the remaining can only rely only on RCU: PRIO_PROCESS only does the task lookup and never iterates over tasklist and we already have an rcu-aware stable pointer. PRIO_USER is already racy vs setuid(2) so with creds being rcu protected, we can end up seeing stale data. When removing the tasklist_lock there can be a race with (i) fork but this is benign as the child's nice is inherited and the new task is not observable by the user yet either, hence the return semantics do not differ. And (ii) a race with exit, which is a small window and can cause us to miss a task which was removed from the list and it had the highest nice. Similarly change the buggy do_each_thread/while_each_thread combo in PRIO_USER for the rcu-safe for_each_process_thread flavor, which doesn't make use of next_thread/p->thread_group. [akpm@linux-foundation.org: coding style fixes] Link: https://lkml.kernel.org/r/20211210182250.43734-1-dave@stgolabs.net Signed-off-by: Davidlohr Bueso Acked-by: Oleg Nesterov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit d6986ce24fc00b0638bd29efe8fb7ba7619ed2aa Author: Yafang Shao Date: Wed Jan 19 18:08:43 2022 -0800 kthread: dynamically allocate memory to store kthread's full name When I was implementing a new per-cpu kthread cfs_migration, I found the comm of it "cfs_migration/%u" is truncated due to the limitation of TASK_COMM_LEN. For example, the comm of the percpu thread on CPU10~19 all have the same name "cfs_migration/1", which will confuse the user. This issue is not critical, because we can get the corresponding CPU from the task's Cpus_allowed. But for kthreads corresponding to other hardware devices, it is not easy to get the detailed device info from task comm, for example, jbd2/nvme0n1p2- xfs-reclaim/sdf Currently there are so many truncated kthreads: rcu_tasks_kthre rcu_tasks_rude_ rcu_tasks_trace poll_mpt3sas0_s ext4-rsv-conver xfs-reclaim/sd{a, b, c, ...} xfs-blockgc/sd{a, b, c, ...} xfs-inodegc/sd{a, b, c, ...} audit_send_repl ecryptfs-kthrea vfio-irqfd-clea jbd2/nvme0n1p2- ... We can shorten these names to work around this problem, but it may be not applied to all of the truncated kthreads. Take 'jbd2/nvme0n1p2-' for example, it is a nice name, and it is not a good idea to shorten it. One possible way to fix this issue is extending the task comm size, but as task->comm is used in lots of places, that may cause some potential buffer overflows. Another more conservative approach is introducing a new pointer to store kthread's full name if it is truncated, which won't introduce too much overhead as it is in the non-critical path. Finally we make a dicision to use the second approach. See also the discussions in this thread: https://lore.kernel.org/lkml/20211101060419.4682-1-laoar.shao@gmail.com/ After this change, the full name of these truncated kthreads will be displayed via /proc/[pid]/comm: rcu_tasks_kthread rcu_tasks_rude_kthread rcu_tasks_trace_kthread poll_mpt3sas0_statu ext4-rsv-conversion xfs-reclaim/sdf1 xfs-blockgc/sdf1 xfs-inodegc/sdf1 audit_send_reply ecryptfs-kthread vfio-irqfd-cleanup jbd2/nvme0n1p2-8 Link: https://lkml.kernel.org/r/20211120112850.46047-1-laoar.shao@gmail.com Signed-off-by: Yafang Shao Reviewed-by: David Hildenbrand Reviewed-by: Petr Mladek Suggested-by: Petr Mladek Suggested-by: Steven Rostedt Cc: Mathieu Desnoyers Cc: Arnaldo Carvalho de Melo Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Michal Miroslaw Cc: Peter Zijlstra Cc: Steven Rostedt Cc: Matthew Wilcox Cc: Al Viro Cc: Kees Cook Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3087c61ed2c48548b74dd343a5209b87082c682d Author: Yafang Shao Date: Wed Jan 19 18:08:40 2022 -0800 tools/testing/selftests/bpf: replace open-coded 16 with TASK_COMM_LEN As the sched:sched_switch tracepoint args are derived from the kernel, we'd better make it same with the kernel. So the macro TASK_COMM_LEN is converted to type enum, then all the BPF programs can get it through BTF. The BPF program which wants to use TASK_COMM_LEN should include the header vmlinux.h. Regarding the test_stacktrace_map and test_tracepoint, as the type defined in linux/bpf.h are also defined in vmlinux.h, so we don't need to include linux/bpf.h again. Link: https://lkml.kernel.org/r/20211120112738.45980-8-laoar.shao@gmail.com Signed-off-by: Yafang Shao Acked-by: Andrii Nakryiko Acked-by: David Hildenbrand Cc: Mathieu Desnoyers Cc: Arnaldo Carvalho de Melo Cc: Andrii Nakryiko Cc: Michal Miroslaw Cc: Peter Zijlstra Cc: Steven Rostedt Cc: Matthew Wilcox Cc: David Hildenbrand Cc: Al Viro Cc: Kees Cook Cc: Petr Mladek Cc: Alexei Starovoitov Cc: Dennis Dalessandro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 4cfb943537ed3716daf668ca5a33d3ce667f82a3 Author: Yafang Shao Date: Wed Jan 19 18:08:36 2022 -0800 tools/bpf/bpftool/skeleton: replace bpf_probe_read_kernel with bpf_probe_read_kernel_str to get task comm bpf_probe_read_kernel_str() will add a nul terminator to the dst, then we don't care about if the dst size is big enough. Link: https://lkml.kernel.org/r/20211120112738.45980-7-laoar.shao@gmail.com Signed-off-by: Yafang Shao Acked-by: Andrii Nakryiko Reviewed-by: David Hildenbrand Cc: Mathieu Desnoyers Cc: Arnaldo Carvalho de Melo Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Michal Miroslaw Cc: Peter Zijlstra Cc: Steven Rostedt Cc: Matthew Wilcox Cc: David Hildenbrand Cc: Al Viro Cc: Kees Cook Cc: Petr Mladek Cc: Dennis Dalessandro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit d068144d3b2cae09062ed936a3865c093ff69590 Author: Yafang Shao Date: Wed Jan 19 18:08:33 2022 -0800 samples/bpf/test_overhead_kprobe_kern: replace bpf_probe_read_kernel with bpf_probe_read_kernel_str to get task comm bpf_probe_read_kernel_str() will add a nul terminator to the dst, then we don't care about if the dst size is big enough. This patch also replaces the hard-coded 16 with TASK_COMM_LEN to make it grepable. Link: https://lkml.kernel.org/r/20211120112738.45980-6-laoar.shao@gmail.com Signed-off-by: Yafang Shao Reviewed-by: Kees Cook Acked-by: Andrii Nakryiko Reviewed-by: David Hildenbrand Cc: Mathieu Desnoyers Cc: Arnaldo Carvalho de Melo Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Michal Miroslaw Cc: Peter Zijlstra Cc: Steven Rostedt Cc: Matthew Wilcox Cc: David Hildenbrand Cc: Al Viro Cc: Kees Cook Cc: Petr Mladek Cc: Dennis Dalessandro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 95af469c4f609de011debc08e7a35b45201623a8 Author: Yafang Shao Date: Wed Jan 19 18:08:29 2022 -0800 fs/binfmt_elf: replace open-coded string copy with get_task_comm It is better to use get_task_comm() instead of the open coded string copy as we do in other places. struct elf_prpsinfo is used to dump the task information in userspace coredump or kernel vmcore. Below is the verification of vmcore, crash> ps PID PPID CPU TASK ST %MEM VSZ RSS COMM 0 0 0 ffffffff9d21a940 RU 0.0 0 0 [swapper/0] > 0 0 1 ffffa09e40f85e80 RU 0.0 0 0 [swapper/1] > 0 0 2 ffffa09e40f81f80 RU 0.0 0 0 [swapper/2] > 0 0 3 ffffa09e40f83f00 RU 0.0 0 0 [swapper/3] > 0 0 4 ffffa09e40f80000 RU 0.0 0 0 [swapper/4] > 0 0 5 ffffa09e40f89f80 RU 0.0 0 0 [swapper/5] 0 0 6 ffffa09e40f8bf00 RU 0.0 0 0 [swapper/6] > 0 0 7 ffffa09e40f88000 RU 0.0 0 0 [swapper/7] > 0 0 8 ffffa09e40f8de80 RU 0.0 0 0 [swapper/8] > 0 0 9 ffffa09e40f95e80 RU 0.0 0 0 [swapper/9] > 0 0 10 ffffa09e40f91f80 RU 0.0 0 0 [swapper/10] > 0 0 11 ffffa09e40f93f00 RU 0.0 0 0 [swapper/11] > 0 0 12 ffffa09e40f90000 RU 0.0 0 0 [swapper/12] > 0 0 13 ffffa09e40f9bf00 RU 0.0 0 0 [swapper/13] > 0 0 14 ffffa09e40f98000 RU 0.0 0 0 [swapper/14] > 0 0 15 ffffa09e40f9de80 RU 0.0 0 0 [swapper/15] It works well as expected. Some comments are added to explain why we use the hard-coded 16. Link: https://lkml.kernel.org/r/20211120112738.45980-5-laoar.shao@gmail.com Suggested-by: Kees Cook Signed-off-by: Yafang Shao Reviewed-by: David Hildenbrand Cc: Mathieu Desnoyers Cc: Arnaldo Carvalho de Melo Cc: Andrii Nakryiko Cc: Michal Miroslaw Cc: Peter Zijlstra Cc: Steven Rostedt Cc: Matthew Wilcox Cc: David Hildenbrand Cc: Al Viro Cc: Kees Cook Cc: Petr Mladek Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Dennis Dalessandro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 7b6397d7e5dfabf2ce1e77739d2a24af31b8a43f Author: Yafang Shao Date: Wed Jan 19 18:08:26 2022 -0800 drivers/infiniband: replace open-coded string copy with get_task_comm We'd better use the helper get_task_comm() rather than the open-coded strlcpy() to get task comm. As the comment above the hard-coded 16, we can replace it with TASK_COMM_LEN. Link: https://lkml.kernel.org/r/20211120112738.45980-4-laoar.shao@gmail.com Signed-off-by: Yafang Shao Acked-by: Dennis Dalessandro Reviewed-by: David Hildenbrand Cc: Mathieu Desnoyers Cc: Arnaldo Carvalho de Melo Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Michal Miroslaw Cc: Peter Zijlstra Cc: Steven Rostedt Cc: Matthew Wilcox Cc: David Hildenbrand Cc: Al Viro Cc: Kees Cook Cc: Petr Mladek Cc: Andrii Nakryiko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 503471ac36df60bba037c3b110d76f53a93f61b5 Author: Yafang Shao Date: Wed Jan 19 18:08:22 2022 -0800 fs/exec: replace strncpy with strscpy_pad in __get_task_comm If the dest buffer size is smaller than sizeof(tsk->comm), the buffer will be without null ternimator, that may cause problem. Using strscpy_pad() instead of strncpy() in __get_task_comm() can make the string always nul ternimated and zero padded. Link: https://lkml.kernel.org/r/20211120112738.45980-3-laoar.shao@gmail.com Suggested-by: Kees Cook Suggested-by: Steven Rostedt Signed-off-by: Yafang Shao Reviewed-by: Kees Cook Reviewed-by: David Hildenbrand Cc: Mathieu Desnoyers Cc: Arnaldo Carvalho de Melo Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Michal Miroslaw Cc: Peter Zijlstra Cc: Steven Rostedt Cc: Matthew Wilcox Cc: David Hildenbrand Cc: Al Viro Cc: Kees Cook Cc: Petr Mladek Cc: Andrii Nakryiko Cc: Dennis Dalessandro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 06c5088aeedafc06f8b33074d67e30077ba71b8b Author: Yafang Shao Date: Wed Jan 19 18:08:19 2022 -0800 fs/exec: replace strlcpy with strscpy_pad in __set_task_comm Patch series "task comm cleanups", v2. This patchset is part of the patchset "extend task comm from 16 to 24"[1]. Now we have different opinion that dynamically allocates memory to store kthread's long name into a separate pointer, so I decide to take the useful cleanups apart from the original patchset and send it separately[2]. These useful cleanups can make the usage around task comm less error-prone. Furthermore, it will be useful if we want to extend task comm in the future. [1]. https://lore.kernel.org/lkml/20211101060419.4682-1-laoar.shao@gmail.com/ [2]. https://lore.kernel.org/lkml/CALOAHbAx55AUo3bm8ZepZSZnw7A08cvKPdPyNTf=E_tPqmw5hw@mail.gmail.com/ This patch (of 7): strlcpy() can trigger out-of-bound reads on the source string[1], we'd better use strscpy() instead. To make it be robust against full tsk->comm copies that got noticed in other places, we should make sure it's zero padded. [1] https://github.com/KSPP/linux/issues/89 Link: https://lkml.kernel.org/r/20211120112738.45980-1-laoar.shao@gmail.com Link: https://lkml.kernel.org/r/20211120112738.45980-2-laoar.shao@gmail.com Signed-off-by: Yafang Shao Reviewed-by: Kees Cook Reviewed-by: David Hildenbrand Cc: Mathieu Desnoyers Cc: Arnaldo Carvalho de Melo Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Michal Miroslaw Cc: Peter Zijlstra Cc: Steven Rostedt Cc: Matthew Wilcox Cc: David Hildenbrand Cc: Al Viro Cc: Kees Cook Cc: Petr Mladek Cc: Andrii Nakryiko Cc: Dennis Dalessandro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 40cbf09f060c8febef64541c463d4dd526abe445 Author: Andy Shevchenko Date: Wed Jan 19 18:08:16 2022 -0800 kernel.h: include a note to discourage people from including it in headers Include a note at the top to discourage people from including it in headers. Link: https://lkml.kernel.org/r/20211209150803.4473-1-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 22c033989c3eb9731ad0c497dfab4231b8e367d6 Author: Andy Shevchenko Date: Wed Jan 19 18:08:12 2022 -0800 include/linux/unaligned: replace kernel.h with the necessary inclusions When kernel.h is used in the headers it adds a lot into dependency hell, especially when there are circular dependencies are involved. Replace kernel.h inclusion with the list of what is really being used. The rest of the changes are induced by the above and may not be split. Link: https://lkml.kernel.org/r/20211209123823.20425-1-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Acked-by: Arend van Spriel [brcmfmac] Acked-by: Kalle Valo Cc: Arend van Spriel Cc: Franky Lin Cc: Hante Meuleman Cc: Chi-hsien Lin Cc: Wright Feng Cc: Chung-hsien Hsu Cc: Kalle Valo Cc: David S. Miller Cc: Jakub Kicinski Cc: Heikki Krogerus Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 7080cead5d45b79ec0c86fa285cf9b6abc413ed8 Author: luo penghao Date: Wed Jan 19 18:08:09 2022 -0800 sysctl: remove redundant ret assignment Subsequent if judgments will assign new values to ret, so the statement here should be deleted The clang_analyzer complains as follows: fs/proc/proc_sysctl.c: Value stored to 'ret' is never read Link: https://lkml.kernel.org/r/20211230063622.586360-1-luo.penghao@zte.com.cn Signed-off-by: luo penghao Reported-by: Zeal Robot Acked-by: Luis Chamberlain Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 153ee1c41a3ec707438ae0ca6b0061f72de334ef Author: Geert Uytterhoeven Date: Wed Jan 19 18:08:06 2022 -0800 sysctl: fix duplicate path separator in printed entries sysctl_print_dir() always terminates the printed path name with a slash, so printing a slash before the file part causes a duplicate like in sysctl duplicate entry: /kernel//perf_user_access Fix this by dropping the extra slash. Link: https://lkml.kernel.org/r/e3054d605dc56f83971e4b6d2f5fa63a978720ad.1641551872.git.geert+renesas@glider.be Signed-off-by: Geert Uytterhoeven Acked-by: Christian Brauner Acked-by: Luis Chamberlain Cc: Iurii Zaikin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 51a18734402874382ccfab288342c72d7227e122 Author: Qi Zheng Date: Wed Jan 19 18:08:03 2022 -0800 proc: convert the return type of proc_fd_access_allowed() to be boolean Convert return type of proc_fd_access_allowed() and the 'allowed' in it to be boolean since the return type of ptrace_may_access() is boolean. Link: https://lkml.kernel.org/r/20211219024404.29779-1-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Cc: Kees Cook Cc: Alexey Dobriyan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ae62fbe299629d3b2fa61d4cf5146258c4d99fdf Author: Hans de Goede Date: Wed Jan 19 18:08:00 2022 -0800 proc: make the proc_create[_data]() stubs static inlines Change the proc_create[_data]() stubs which are used when CONFIG_PROC_FS is not set from #defines to a static inline stubs. This should fix clang -Werror builds failing due to errors like this: drivers/platform/x86/thinkpad_acpi.c:918:30: error: unused variable 'dispatch_proc_ops' [-Werror,-Wunused-const-variable] Fixing this in include/linux/proc_fs.h should ensure that the same issue is also fixed in any other drivers hitting the same -Werror issue. [akpm@linux-foundation.org: fix CONFIG_PROC_FS=n] [akpm@linux-foundation.org: fix arch/sparc/kernel/led.c] [akpm@linux-foundation.org: fix build] Link: https://lkml.kernel.org/r/20211116131112.508304-1-hdegoede@redhat.com Signed-off-by: Hans de Goede Reported-by: kernel test robot Acked-by: Christian Brauner Cc: Alexander Viro Cc: Hans de Goede Cc: David Howells Cc: Christoph Hellwig Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 25bc5b0de91bc5e7afa65f1face0087fb9e331c7 Author: David Hildenbrand Date: Wed Jan 19 18:07:57 2022 -0800 proc/vmcore: don't fake reading zeroes on surprise vmcore_cb unregistration In commit cc5f2704c934 ("proc/vmcore: convert oldmem_pfn_is_ram callback to more generic vmcore callbacks"), we added detection of surprise vmcore_cb unregistration after the vmcore was already opened. Once detected, we warn the user and simulate reading zeroes from that point on when accessing the vmcore. The basic reason was that unexpected unregistration, for example, by manually unbinding a driver from a device after opening the vmcore, is not supported and could result in reading oldmem the vmcore_cb would have actually prohibited while registered. However, something like that can similarly be trigger by a user that's really looking for trouble simply by unbinding the relevant driver before opening the vmcore -- or by disallowing loading the driver in the first place. So it's actually of limited help. Currently, unregistration can only be triggered via virtio-mem when manually unbinding the driver from the device inside the VM; there is no way to trigger it from the hypervisor, as hypervisors don't allow for unplugging virtio-mem devices -- ripping out system RAM from a VM without coordination with the guest is usually not a good idea. The important part is that unbinding the driver and unregistering the vmcore_cb while concurrently reading the vmcore won't crash the system, and that is handled by the rwsem. To make the mechanism more future proof, let's remove the "read zero" part, but leave the warning in place. For example, we could have a future driver (like virtio-balloon) that will contact the hypervisor to figure out if we already populated a page for a given PFN. Hotunplugging such a device and consequently unregistering the vmcore_cb could be triggered from the hypervisor without harming the system even while kdump is running. In that case, we don't want to silently end up with a vmcore that contains wrong data, because the user inside the VM might be unaware of the hypervisor action and might easily miss the warning in the log. Link: https://lkml.kernel.org/r/20211111192243.22002-1-david@redhat.com Signed-off-by: David Hildenbrand Acked-by: Baoquan He Cc: Dave Young Cc: Vivek Goyal Cc: Philipp Rudo Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 20c035764626c56c4f6514936b9ee4be0f4cd962 Author: Kefeng Wang Date: Wed Jan 19 18:07:53 2022 -0800 mm: percpu: add generic pcpu_populate_pte() function With NEED_PER_CPU_PAGE_FIRST_CHUNK enabled, we need a function to populate pte, this patch adds a generic pcpu populate pte function, pcpu_populate_pte(), which is marked __weak and used on most architectures, but it is overridden on x86, which has its own implementation. Link: https://lkml.kernel.org/r/20211216112359.103822-5-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: "David S. Miller" Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: "H. Peter Anvin" Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Cc: Dennis Zhou Cc: Tejun Heo Cc: Christoph Lameter Cc: Albert Ou Cc: Catalin Marinas Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: Thomas Bogendoerfer Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 23f917169ef157aa7a6bf80d8c4aad6f1282852c Author: Kefeng Wang Date: Wed Jan 19 18:07:49 2022 -0800 mm: percpu: add generic pcpu_fc_alloc/free funciton With the previous patch, we could add a generic pcpu first chunk allocate and free function to cleanup the duplicated definations on each architecture. Link: https://lkml.kernel.org/r/20211216112359.103822-4-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Cc: Thomas Bogendoerfer Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: "David S. Miller" Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: "H. Peter Anvin" Cc: Greg Kroah-Hartman Cc: Dennis Zhou Cc: Tejun Heo Cc: Christoph Lameter Cc: Albert Ou Cc: Catalin Marinas Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: "Rafael J. Wysocki" Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 1ca3fb3abd2b615c4b61728de545760a6e2c2d8b Author: Kefeng Wang Date: Wed Jan 19 18:07:45 2022 -0800 mm: percpu: add pcpu_fc_cpu_to_node_fn_t typedef Add pcpu_fc_cpu_to_node_fn_t and pass it into pcpu_fc_alloc_fn_t, pcpu first chunk allocation will call it to alloc memblock on the corresponding node by it, this is prepare for the next patch. Link: https://lkml.kernel.org/r/20211216112359.103822-3-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Cc: Thomas Bogendoerfer Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: "David S. Miller" Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: "H. Peter Anvin" Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Cc: Dennis Zhou Cc: Tejun Heo Cc: Christoph Lameter Cc: Albert Ou Cc: Catalin Marinas Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 7ecd19cfdfcbb625cc059dfa5b267d2436732c1c Author: Kefeng Wang Date: Wed Jan 19 18:07:41 2022 -0800 mm: percpu: generalize percpu related config Patch series "mm: percpu: Cleanup percpu first chunk function". When supporting page mapping percpu first chunk allocator on arm64, we found there are lots of duplicated codes in percpu embed/page first chunk allocator. This patchset is aimed to cleanup them and should no function change. The currently supported status about 'embed' and 'page' in Archs shows below, embed: NEED_PER_CPU_PAGE_FIRST_CHUNK page: NEED_PER_CPU_EMBED_FIRST_CHUNK embed page ------------------------ arm64 Y Y mips Y N powerpc Y Y riscv Y N sparc Y Y x86 Y Y ------------------------ There are two interfaces about percpu first chunk allocator, extern int __init pcpu_embed_first_chunk(size_t reserved_size, size_t dyn_size, size_t atom_size, pcpu_fc_cpu_distance_fn_t cpu_distance_fn, - pcpu_fc_alloc_fn_t alloc_fn, - pcpu_fc_free_fn_t free_fn); + pcpu_fc_cpu_to_node_fn_t cpu_to_nd_fn); extern int __init pcpu_page_first_chunk(size_t reserved_size, - pcpu_fc_alloc_fn_t alloc_fn, - pcpu_fc_free_fn_t free_fn, - pcpu_fc_populate_pte_fn_t populate_pte_fn); + pcpu_fc_cpu_to_node_fn_t cpu_to_nd_fn); The pcpu_fc_alloc_fn_t/pcpu_fc_free_fn_t is killed, we provide generic pcpu_fc_alloc() and pcpu_fc_free() function, which are called in the pcpu_embed/page_first_chunk(). 1) For pcpu_embed_first_chunk(), pcpu_fc_cpu_to_node_fn_t is needed to be provided when archs supported NUMA. 2) For pcpu_page_first_chunk(), the pcpu_fc_populate_pte_fn_t is killed too, a generic pcpu_populate_pte() which marked '__weak' is provided, if you need a different function to populate pte on the arch(like x86), please provide its own implementation. [1] https://github.com/kevin78/linux.git percpu-cleanup This patch (of 4): The HAVE_SETUP_PER_CPU_AREA/NEED_PER_CPU_EMBED_FIRST_CHUNK/ NEED_PER_CPU_PAGE_FIRST_CHUNK/USE_PERCPU_NUMA_NODE_ID configs, which have duplicate definitions on platforms that subscribe it. Move them into mm, drop these redundant definitions and instead just select it on applicable platforms. Link: https://lkml.kernel.org/r/20211216112359.103822-1-wangkefeng.wang@huawei.com Link: https://lkml.kernel.org/r/20211216112359.103822-2-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Acked-by: Catalin Marinas [arm64] Cc: Will Deacon Cc: Thomas Bogendoerfer Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Paul Walmsley Cc: Palmer Dabbelt Cc: Albert Ou Cc: "David S. Miller" Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: "H. Peter Anvin" Cc: Christoph Lameter Cc: Dennis Zhou Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Cc: Tejun Heo Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 51620150ca2df62f8ea472ab8962be590c957288 Author: Steve French Date: Wed Jan 19 22:11:33 2022 -0600 cifs: update internal module number To 2.35 Signed-off-by: Steve French commit 52d005337b2c94ab37273d9ad8382d4fb051defd Author: Steve French Date: Wed Jan 19 22:00:29 2022 -0600 smb3: send NTLMSSP version information For improved debugging it can be helpful to send version information as other clients do during NTLMSSP negotiation. See protocol document MS-NLMP section 2.2.1.1 Set the major and minor versions based on the kernel version, and the BuildNumber based on the internal cifs.ko module version number, and following the recommendation in the protocol documentation (MS-NLMP section 2.2.10) we set the NTLMRevisionCurrent field to 15. Reviewed-by: Shyam Prasad N Signed-off-by: Steve French commit 20aa49541a2ea2cb767ada04cbcaf12fe3ca1275 Author: kernel test robot Date: Wed Jan 19 11:38:36 2022 +0800 riscv: fix boolconv.cocci warnings arch/riscv/mm/init.c:48:11-16: 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 Reported-by: kernel test robot Signed-off-by: kernel test robot Signed-off-by: Palmer Dabbelt commit 0c34e79e52bb13881c08f1a2c2390b7b88ff10c7 Merge: fc839c6d33c88 c774de22c4307 Author: Palmer Dabbelt Date: Wed Jan 19 19:23:41 2022 -0800 RISC-V: Introduce sv48 support without relocatable kernel This patchset allows to have a single kernel for sv39 and sv48 without being relocatable. The idea comes from Arnd Bergmann who suggested to do the same as x86, that is mapping the kernel to the end of the address space, which allows the kernel to be linked at the same address for both sv39 and sv48 and then does not require to be relocated at runtime. This implements sv48 support at runtime. The kernel will try to boot with 4-level page table and will fallback to 3-level if the HW does not support it. Folding the 4th level into a 3-level page table has almost no cost at runtime. Note that kasan region had to be moved to the end of the address space since its location must be known at compile-time and then be valid for both sv39 and sv48 (and sv57 that is coming). * riscv-sv48-v3: riscv: Explicit comment about user virtual address space size riscv: Use pgtable_l4_enabled to output mmu_type in cpuinfo riscv: Implement sv48 support asm-generic: Prepare for riscv use of pud_alloc_one and pud_free riscv: Allow to dynamically define VA_BITS riscv: Introduce functions to switch pt_ops riscv: Split early kasan mapping to prepare sv48 introduction riscv: Move KASAN mapping next to the kernel mapping riscv: Get rid of MAXPHYSMEM configs Signed-off-by: Palmer Dabbelt commit c774de22c430733487f70d755067d9ea55dbe6de Author: Alexandre Ghiti Date: Mon Dec 6 11:46:53 2021 +0100 riscv: Explicit comment about user virtual address space size Define precisely the size of the user accessible virtual space size for sv32/39/48 mmu types and explain why the whole virtual address space is split into 2 equal chunks between kernel and user space. Signed-off-by: Alexandre Ghiti Reviewed-by: Anup Patel Reviewed-by: Palmer Dabbelt Signed-off-by: Palmer Dabbelt commit 73c7c8f68e7266bd558227bd9c598cb90b1673cc Author: Alexandre Ghiti Date: Mon Dec 6 11:46:52 2021 +0100 riscv: Use pgtable_l4_enabled to output mmu_type in cpuinfo Now that the mmu type is determined at runtime using SATP characteristic, use the global variable pgtable_l4_enabled to output mmu type of the processor through /proc/cpuinfo instead of relying on device tree infos. Signed-off-by: Alexandre Ghiti Reviewed-by: Anup Patel Reviewed-by: Palmer Dabbelt Signed-off-by: Palmer Dabbelt commit e8a62cc26ddf53a3c6ba2a8d33036cf7b84f3923 Author: Alexandre Ghiti Date: Mon Dec 6 11:46:51 2021 +0100 riscv: Implement sv48 support By adding a new 4th level of page table, give the possibility to 64bit kernel to address 2^48 bytes of virtual address: in practice, that offers 128TB of virtual address space to userspace and allows up to 64TB of physical memory. If the underlying hardware does not support sv48, we will automatically fallback to a standard 3-level page table by folding the new PUD level into PGDIR level. In order to detect HW capabilities at runtime, we use SATP feature that ignores writes with an unsupported mode. Signed-off-by: Alexandre Ghiti Signed-off-by: Palmer Dabbelt commit 60639f74c2f4fcc3ffa2ac0b120eaa874ccc713f Author: Alexandre Ghiti Date: Mon Dec 6 11:46:50 2021 +0100 asm-generic: Prepare for riscv use of pud_alloc_one and pud_free In the following commits, riscv will almost use the generic versions of pud_alloc_one and pud_free but an additional check is required since those functions are only relevant when using at least a 4-level page table, which will be determined at runtime on riscv. So move the content of those functions into other functions that riscv can use without duplicating code. Signed-off-by: Alexandre Ghiti Signed-off-by: Palmer Dabbelt commit 3270bfdb9e4a01bb15d018612a6354c1837b5f97 Author: Alexandre Ghiti Date: Mon Dec 6 11:46:48 2021 +0100 riscv: Allow to dynamically define VA_BITS With 4-level page table folding at runtime, we don't know at compile time the size of the virtual address space so we must set VA_BITS dynamically so that sparsemem reserves the right amount of memory for struct pages. Signed-off-by: Alexandre Ghiti Signed-off-by: Palmer Dabbelt commit 840125a97abc7e676d839adc2743e8f703a156b3 Author: Alexandre Ghiti Date: Mon Dec 6 11:46:47 2021 +0100 riscv: Introduce functions to switch pt_ops This simply gathers the different pt_ops initialization in functions where a comment was added to explain why the page table operations must be changed along the boot process. Signed-off-by: Alexandre Ghiti Signed-off-by: Palmer Dabbelt commit 2efad17e5794f4223bbeff1b2c568e3afd9a8c22 Author: Alexandre Ghiti Date: Mon Dec 6 11:46:46 2021 +0100 riscv: Split early kasan mapping to prepare sv48 introduction Now that kasan shadow region is next to the kernel, for sv48, this region won't be aligned on PGDIR_SIZE and then when populating this region, we'll need to get down to lower levels of the page table. So instead of reimplementing the page table walk for the early population, take advantage of the existing functions used for the final population. Note that kasan swapper initialization must also be split since memblock is not initialized at this point and as the last PGD is shared with the kernel, we'd need to allocate a PUD so postpone the kasan final population after the kernel population is done. Signed-off-by: Alexandre Ghiti Signed-off-by: Palmer Dabbelt commit f7ae02333d13f598da6ff6b94cf643255707f752 Author: Alexandre Ghiti Date: Mon Dec 6 11:46:45 2021 +0100 riscv: Move KASAN mapping next to the kernel mapping Now that KASAN_SHADOW_OFFSET is defined at compile time as a config, this value must remain constant whatever the size of the virtual address space, which is only possible by pushing this region at the end of the address space next to the kernel mapping. Signed-off-by: Alexandre Ghiti Signed-off-by: Palmer Dabbelt commit db1503d355a79d1d4255a9996f20e72848b74a56 Author: Alexandre Ghiti Date: Mon Jan 17 10:57:16 2022 +0100 riscv: Get rid of MAXPHYSMEM configs CONFIG_MAXPHYSMEM_* are actually never used, even the nommu defconfigs selecting the MAXPHYSMEM_2GB had no effects on PAGE_OFFSET since it was preempted by !MMU case right before. In addition, the move of the kernel mapping at the end of the address space broke the use of MAXPHYSMEM_2G with MMU since it defines PAGE_OFFSET at the same address as the kernel mapping. Reported-by: Geert Uytterhoeven Fixes: 2bfc6cd81bd1 ("riscv: Move kernel mapping outside of linear mapping") Signed-off-by: Alexandre Ghiti Tested-by: Geert Uytterhoeven Tested-by: Conor Dooley Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit 6191cf3ad59fda5901160633fef8e41b064a5246 Author: Brian Foster Date: Tue Jan 18 11:32:35 2022 -0800 xfs: flush inodegc workqueue tasks before cancel The xfs_inodegc_stop() helper performs a high level flush of pending work on the percpu queues and then runs a cancel_work_sync() on each of the percpu work tasks to ensure all work has completed before returning. While cancel_work_sync() waits for wq tasks to complete, it does not guarantee work tasks have started. This means that the _stop() helper can queue and instantly cancel a wq task without having completed the associated work. This can be observed by tracepoint inspection of a simple "rm -f ; fsfreeze -f " test: xfs_destroy_inode: ... ino 0x83 ... xfs_inode_set_need_inactive: ... ino 0x83 ... xfs_inodegc_stop: ... ... xfs_inodegc_start: ... xfs_inodegc_worker: ... xfs_inode_inactivating: ... ino 0x83 ... The first few lines show that the inode is removed and need inactive state set, but the inactivation work has not completed before the inodegc mechanism stops. The inactivation doesn't actually occur until the fs is unfrozen and the gc mechanism starts back up. Note that this test requires fsfreeze to reproduce because xfs_freeze indirectly invokes xfs_fs_statfs(), which calls xfs_inodegc_flush(). When this occurs, the workqueue try_to_grab_pending() logic first tries to steal the pending bit, which does not succeed because the bit has been set by queue_work_on(). Subsequently, it checks for association of a pool workqueue from the work item under the pool lock. This association is set at the point a work item is queued and cleared when dequeued for processing. If the association exists, the work item is removed from the queue and cancel_work_sync() returns true. If the pwq association is cleared, the remove attempt assumes the task is busy and retries (eventually returning false to the caller after waiting for the work task to complete). To avoid this race, we can flush each work item explicitly before cancel. However, since the _queue_all() already schedules each underlying work item, the workqueue level helpers are sufficient to achieve the same ordering effect. E.g., the inodegc enabled flag prevents scheduling any further work in the _stop() case. Use the drain_workqueue() helper in this particular case to make the intent a bit more self explanatory. Signed-off-by: Brian Foster Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit 73031f761cb7c2397d73957d14d041c31fe58c34 Author: Jens Axboe Date: Wed Jan 19 13:11:58 2022 -0700 io-wq: delete dead lock shuffling code We used to have more code around the work loop, but now the goto and lock juggling just makes it less readable than it should. Get rid of it. Signed-off-by: Jens Axboe commit b4966a7dc0725b2baa12b0aeb1489d52568a2aad Author: Sam Shih Date: Wed Jan 19 20:36:58 2022 +0800 clk: mediatek: relicense mt7986 clock driver to GPL-2.0 The previous mt7986 clock drivers were incorrectly marked as GPL-1.0. This patch changes the driver to the standard GPL-2.0 license. Signed-off-by: Sam Shih Link: https://lore.kernel.org/r/20220119123658.10095-2-sam.shih@mediatek.com Reported-by: Lukas Bulwahn Signed-off-by: Stephen Boyd commit fc839c6d33c8828514f595822f457e51328507e5 Author: Jisheng Zhang Date: Tue Jan 11 00:52:08 2022 +0800 riscv: bpf: Fix eBPF's exception tables eBPF's exception tables needs to be modified to relative synchronously. Suggested-by: Tong Tiangen Signed-off-by: Jisheng Zhang Fixes: 1f77ed9422cb ("riscv: switch to relative extable and other improvements") Signed-off-by: Palmer Dabbelt commit 96c852c8bf52af2d34654e700d9b5d2e8a99bae5 Author: Paolo Bonzini Date: Wed Jan 19 13:34:30 2022 -0500 kvm: selftests: Do not indent with spaces Some indentation with spaces crept in, likely due to terminal-based cut and paste. Clean it up. Signed-off-by: Paolo Bonzini commit fa68118144c63e292628945c5b8feb16b84fea7d Author: Paolo Bonzini Date: Wed Jan 19 13:30:23 2022 -0500 kvm: selftests: sync uapi/linux/kvm.h with Linux header KVM_CAP_XSAVE2 is out of sync due to a conflict. Copy the whole file while at it. Reported-by: Yang Zhong Signed-off-by: Paolo Bonzini commit 805a3ebed59f81155ded218648db58bdc886a881 Author: Jisheng Zhang Date: Mon Dec 6 23:03:53 2021 +0800 riscv: mm: init: try best to remove #ifdef CONFIG_XIP_KERNEL usage Currently, the #ifdef CONFIG_XIP_KERNEL usage can be divided into the following three types: The first one is for functions/declarations only used in XIP case. The second one is for XIP_FIXUP case. Something as below: |foo_type foo; |#ifdef CONFIG_XIP_KERNEL |#define foo (*(foo_type *)XIP_FIXUP(&foo)) |#endif Usually, it's better to let the foo macro sit with the foo var together. But if various foos are defined adjacently, we can save some #ifdef CONFIG_XIP_KERNEL usage by grouping them together. The third one is for different implementations for XIP, usually, this is a #ifdef...#else...#endif case. This patch moves the pt_ops macro to adjacent #ifdef CONFIG_XIP_KERNEL and group first type usage cases into one. Signed-off-by: Jisheng Zhang Reviewed-by: Alexandre Ghiti Signed-off-by: Palmer Dabbelt commit fe036db7d8a93cfbfd254f76e0ecf81aecbbf6b4 Author: Jisheng Zhang Date: Mon Dec 6 23:03:52 2021 +0800 riscv: mm: init: try IS_ENABLED(CONFIG_XIP_KERNEL) instead of #ifdef Try our best to replace the conditional compilation using "#ifdef CONFIG_XIP_KERNEL" with "IS_ENABLED(CONFIG_XIP_KERNEL)", to simplify the code and to increase compile coverage. Signed-off-by: Jisheng Zhang Reviewed-by: Alexandre Ghiti Signed-off-by: Palmer Dabbelt commit 3274a6ef3b1bd9faef940c40ef201723d5d3d056 Author: Jisheng Zhang Date: Mon Dec 6 23:03:51 2021 +0800 riscv: mm: init: remove _pt_ops and use pt_ops directly Except "pt_ops", other global vars when CONFIG_XIP_KERNEL=y is defined as below: |foo_type foo; |#ifdef CONFIG_XIP_KERNEL |#define foo (*(foo_type *)XIP_FIXUP(&foo)) |#endif Follow the same way for pt_ops to unify the style and to simplify code. Signed-off-by: Jisheng Zhang Reviewed-by: Alexandre Ghiti Signed-off-by: Palmer Dabbelt commit 07aabe8fb6d1ac3163cc74c856521f2ee746270b Author: Jisheng Zhang Date: Mon Dec 6 23:03:50 2021 +0800 riscv: mm: init: try best to use IS_ENABLED(CONFIG_64BIT) instead of #ifdef Try our best to replace the conditional compilation using "#ifdef CONFIG_64BIT" by a check for "IS_ENABLED(CONFIG_64BIT)", to simplify the code and to increase compile coverage. Now we can also remove the __maybe_unused used in max_mapped_addr declaration. We also remove the BUG_ON check of mapping the last 4K bytes of the addressable memory since this is always true for every kernel actually. Signed-off-by: Jisheng Zhang Reviewed-by: Alexandre Ghiti Signed-off-by: Palmer Dabbelt commit 902d6364aad5fc8731ac5b19ed9a1d9c9ee0bd91 Author: Jisheng Zhang Date: Mon Dec 6 23:03:49 2021 +0800 riscv: mm: init: remove unnecessary "#ifdef CONFIG_CRASH_DUMP" The is_kdump_kernel() returns false for !CRASH_DUMP case, so we don't need the #ifdef CONFIG_CRASH_DUMP for is_kdump_kernel() checking. Signed-off-by: Jisheng Zhang Reviewed-by: Alexandre Ghiti Signed-off-by: Palmer Dabbelt commit 8326c79d10be2ddbfd3d3804206949a71cb15675 Author: Arnaldo Carvalho de Melo Date: Sat Nov 13 10:43:52 2021 -0300 tools headers UAPI: Sync x86 arch prctl headers with the kernel sources To pick the changes in this cset: 980fe2fddcff2193 ("x86/fpu: Extend fpu_xstate_prctl() with guest permissions") This picks these new prctls: $ tools/perf/trace/beauty/x86_arch_prctl.sh > /tmp/before $ cp arch/x86/include/uapi/asm/prctl.h tools/arch/x86/include/uapi/asm/prctl.h $ tools/perf/trace/beauty/x86_arch_prctl.sh > /tmp/after $ diff -u /tmp/before /tmp/after --- /tmp/before 2022-01-19 14:40:05.049394977 -0300 +++ /tmp/after 2022-01-19 14:40:35.628154565 -0300 @@ -9,6 +9,8 @@ [0x1021 - 0x1001]= "GET_XCOMP_SUPP", [0x1022 - 0x1001]= "GET_XCOMP_PERM", [0x1023 - 0x1001]= "REQ_XCOMP_PERM", + [0x1024 - 0x1001]= "GET_XCOMP_GUEST_PERM", + [0x1025 - 0x1001]= "REQ_XCOMP_GUEST_PERM", }; #define x86_arch_prctl_codes_2_offset 0x2001 $ With this 'perf trace' can translate those numbers into strings and use the strings in filter expressions: # perf trace -e prctl 0.000 ( 0.011 ms): DOM Worker/3722622 prctl(option: SET_NAME, arg2: 0x7f9c014b7df5) = 0 0.032 ( 0.002 ms): DOM Worker/3722622 prctl(option: SET_NAME, arg2: 0x7f9bb6b51580) = 0 5.452 ( 0.003 ms): StreamT~ns #30/3722623 prctl(option: SET_NAME, arg2: 0x7f9bdbdfeb70) = 0 5.468 ( 0.002 ms): StreamT~ns #30/3722623 prctl(option: SET_NAME, arg2: 0x7f9bdbdfea70) = 0 24.494 ( 0.009 ms): IndexedDB #556/3722624 prctl(option: SET_NAME, arg2: 0x7f562a32ae28) = 0 24.540 ( 0.002 ms): IndexedDB #556/3722624 prctl(option: SET_NAME, arg2: 0x7f563c6d4b30) = 0 670.281 ( 0.008 ms): systemd-userwo/3722339 prctl(option: SET_NAME, arg2: 0x564be30805c8) = 0 670.293 ( 0.002 ms): systemd-userwo/3722339 prctl(option: SET_NAME, arg2: 0x564be30800f0) = 0 ^C# This addresses these perf build warnings: Warning: Kernel ABI header at 'tools/arch/x86/include/uapi/asm/prctl.h' differs from latest version at 'arch/x86/include/uapi/asm/prctl.h' diff -u tools/arch/x86/include/uapi/asm/prctl.h arch/x86/include/uapi/asm/prctl.h Cc: Paolo Bonzini Cc: Thomas Gleixner Signed-off-by: Arnaldo Carvalho de Melo commit c080b4144b9dd3b7af838a194ffad3204ca15166 Author: Qu Wenruo Date: Tue Jan 18 19:53:52 2022 +0800 btrfs: defrag: properly update range->start for autodefrag [BUG] After commit 7b508037d4ca ("btrfs: defrag: use defrag_one_cluster() to implement btrfs_defrag_file()") autodefrag no longer properly re-defrag the file from previously finished location. [CAUSE] The recent refactoring of defrag only focuses on defrag ioctl subpage support, doesn't take autodefrag into consideration. There are two problems involved which prevents autodefrag to restart its scan: - No range.start update Previously when one defrag target is found, range->start will be updated to indicate where next search should start from. But now btrfs_defrag_file() doesn't update it anymore, making all autodefrag to rescan from file offset 0. This would also make autodefrag to mark the same range dirty again and again, causing extra IO. - No proper quick exit for defrag_one_cluster() Currently if we reached or exceed @max_sectors limit, we just exit defrag_one_cluster(), and let next defrag_one_cluster() call to do a quick exit. This makes @cur increase, thus no way to properly know which range is defragged and which range is skipped. [FIX] The fix involves two modifications: - Update range->start to next cluster start This is a little different from the old behavior. Previously range->start is updated to the next defrag target. But in the end, the behavior should still be pretty much the same, as now we skip to next defrag target inside btrfs_defrag_file(). Thus if auto-defrag determines to re-scan, then we still do the skip, just at a different timing. - Make defrag_one_cluster() to return >0 to indicate a quick exit So that btrfs_defrag_file() can also do a quick exit, without increasing @cur to the range end, and re-use @cur to update @range->start. - Add comment for btrfs_defrag_file() to mention the range->start update Currently only autodefrag utilize this behavior, as defrag ioctl won't set @max_to_defrag parameter, thus unless interrupted it will always try to defrag the whole range. Reported-by: Filipe Manana Fixes: 7b508037d4ca ("btrfs: defrag: use defrag_one_cluster() to implement btrfs_defrag_file()") Link: https://lore.kernel.org/linux-btrfs/0a269612-e43f-da22-c5bc-b34b1b56ebe8@mailbox.org/ CC: stable@vger.kernel.org # 5.16 Reviewed-by: Filipe Manana Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 484167da77739a8d0e225008c48e697fd3f781ae Author: Qu Wenruo Date: Tue Jan 18 15:19:04 2022 +0800 btrfs: defrag: fix wrong number of defragged sectors [BUG] There are users using autodefrag mount option reporting obvious increase in IO: > If I compare the write average (in total, I don't have it per process) > when taking idle periods on the same machine: > Linux 5.16: > without autodefrag: ~ 10KiB/s > with autodefrag: between 1 and 2MiB/s. > > Linux 5.15: > with autodefrag:~ 10KiB/s (around the same as without > autodefrag on 5.16) [CAUSE] When autodefrag mount option is enabled, btrfs_defrag_file() will be called with @max_sectors = BTRFS_DEFRAG_BATCH (1024) to limit how many sectors we can defrag in one try. And then use the number of sectors defragged to determine if we need to re-defrag. But commit b18c3ab2343d ("btrfs: defrag: introduce helper to defrag one cluster") uses wrong unit to increase @sectors_defragged, which should be in unit of sector, not byte. This means, if we have defragged any sector, then @sectors_defragged will be >= sectorsize (normally 4096), which is larger than BTRFS_DEFRAG_BATCH. This makes the @max_sectors check in defrag_one_cluster() to underflow, rendering the whole @max_sectors check useless. Thus causing way more IO for autodefrag mount options, as now there is no limit on how many sectors can really be defragged. [FIX] Fix the problems by: - Use sector as unit when increasing @sectors_defragged - Include @sectors_defragged > @max_sectors case to break the loop - Add extra comment on the return value of btrfs_defrag_file() Reported-by: Anthony Ruhier Fixes: b18c3ab2343d ("btrfs: defrag: introduce helper to defrag one cluster") Link: https://lore.kernel.org/linux-btrfs/0a269612-e43f-da22-c5bc-b34b1b56ebe8@mailbox.org/ CC: stable@vger.kernel.org # 5.16 Reviewed-by: Filipe Manana Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 70431bfd825d9cd5d93412c0456f253ecad6c415 Author: David Howells Date: Tue Nov 17 15:56:59 2020 +0000 cifs: Support fscache indexing rewrite Change the cifs filesystem to take account of the changes to fscache's indexing rewrite and reenable caching in cifs. The following changes have been made: (1) The fscache_netfs struct is no more, and there's no need to register the filesystem as a whole. (2) The session cookie is now an fscache_volume cookie, allocated with fscache_acquire_volume(). That takes three parameters: a string representing the "volume" in the index, a string naming the cache to use (or NULL) and a u64 that conveys coherency metadata for the volume. For cifs, I've made it render the volume name string as: "cifs,," where the sharename has '/' characters replaced with ';'. This probably needs rethinking a bit as the total name could exceed the maximum filename component length. Further, the coherency data is currently just set to 0. It needs something else doing with it - I wonder if it would suffice simply to sum the resource_id, vol_create_time and vol_serial_number or maybe hash them. (3) The fscache_cookie_def is no more and needed information is passed directly to fscache_acquire_cookie(). The cache no longer calls back into the filesystem, but rather metadata changes are indicated at other times. fscache_acquire_cookie() is passed the same keying and coherency information as before. (4) The functions to set/reset cookies are removed and fscache_use_cookie() and fscache_unuse_cookie() are used instead. fscache_use_cookie() is passed a flag to indicate if the cookie is opened for writing. fscache_unuse_cookie() is passed updates for the metadata if we changed it (ie. if the file was opened for writing). These are called when the file is opened or closed. (5) cifs_setattr_*() are made to call fscache_resize() to change the size of the cache object. (6) The functions to read and write data are stubbed out pending a conversion to use netfslib. Changes ======= ver #8: - Abstract cache invalidation into a helper function. - Fix some checkpatch warnings[3]. ver #7: - Removed the accidentally added-back call to get the super cookie in cifs_root_iget(). - Fixed the right call to cifs_fscache_get_super_cookie() to take account of the "-o fsc" mount flag. ver #6: - Moved the change of gfpflags_allow_blocking() to current_is_kswapd() for cifs here. - Fixed one of the error paths in cifs_atomic_open() to jump around the call to use the cookie. - Fixed an additional successful return in the middle of cifs_open() to use the cookie on the way out. - Only get a volume cookie (and thus inode cookies) when "-o fsc" is supplied to mount. ver #5: - Fixed a couple of bits of cookie handling[2]: - The cookie should be released in cifs_evict_inode(), not cifsFileInfo_put_final(). The cookie needs to persist beyond file closure so that writepages will be able to write to it. - fscache_use_cookie() needs to be called in cifs_atomic_open() as it is for cifs_open(). ver #4: - Fixed the use of sizeof with memset. - tcon->vol_create_time is __le64 so doesn't need cpu_to_le64(). ver #3: - Canonicalise the cifs coherency data to make the cache portable. - Set volume coherency data. ver #2: - Use gfpflags_allow_blocking() rather than using flag directly. - Upgraded to -rc4 to allow for upstream changes[1]. - fscache_acquire_volume() now returns errors. Signed-off-by: David Howells Acked-by: Jeff Layton cc: Steve French cc: Shyam Prasad N cc: linux-cifs@vger.kernel.org cc: linux-cachefs@redhat.com Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=23b55d673d7527b093cd97b7c217c82e70cd1af0 [1] Link: https://lore.kernel.org/r/3419813.1641592362@warthog.procyon.org.uk/ [2] Link: https://lore.kernel.org/r/CAH2r5muTanw9pJqzAHd01d9A8keeChkzGsCEH6=0rHutVLAF-A@mail.gmail.com/ [3] Link: https://lore.kernel.org/r/163819671009.215744.11230627184193298714.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906982979.143852.10672081929614953210.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967187187.1823006.247415138444991444.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021579335.640689.2681324337038770579.stgit@warthog.procyon.org.uk/ # v4 Link: https://lore.kernel.org/r/3462849.1641593783@warthog.procyon.org.uk/ # v5 Link: https://lore.kernel.org/r/1318953.1642024578@warthog.procyon.org.uk/ # v6 Signed-off-by: Steve French commit b767c2fc787e992daeadfff40d61c05f66c82da0 Author: Filipe Manana Date: Tue Jan 18 13:43:31 2022 +0000 btrfs: allow defrag to be interruptible During defrag, at btrfs_defrag_file(), we have this loop that iterates over a file range in steps no larger than 256K subranges. If the range is too long, there's no way to interrupt it. So make the loop check in each iteration if there's signal pending, and if there is, break and return -AGAIN to userspace. Before kernel 5.16, we used to allow defrag to be cancelled through a signal, but that was lost with commit 7b508037d4cac3 ("btrfs: defrag: use defrag_one_cluster() to implement btrfs_defrag_file()"). This change adds back the possibility to cancel a defrag with a signal and keeps the same semantics, returning -EAGAIN to user space (and not the usually more expected -EINTR). This is also motivated by a recent bug on 5.16 where defragging a 1 byte file resulted in iterating from file range 0 to (u64)-1, as hitting the bug triggered a too long loop, basically requiring one to reboot the machine, as it was not possible to cancel defrag. Fixes: 7b508037d4cac3 ("btrfs: defrag: use defrag_one_cluster() to implement btrfs_defrag_file()") CC: stable@vger.kernel.org # 5.16 Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 6b34cd8e175bfbf4f3f01b6d19eae18245e1a8cc Author: Filipe Manana Date: Mon Jan 17 16:28:29 2022 +0000 btrfs: fix too long loop when defragging a 1 byte file When attempting to defrag a file with a single byte, we can end up in a too long loop, which is nearly infinite because at btrfs_defrag_file() we end up with the variable last_byte assigned with a value of 18446744073709551615 (which is (u64)-1). The problem comes from the fact we end up doing: last_byte = round_up(last_byte, fs_info->sectorsize) - 1; So if last_byte was assigned 0, which is i_size - 1, we underflow and end up with the value 18446744073709551615. This is trivial to reproduce and the following script triggers it: $ cat test.sh #!/bin/bash DEV=/dev/sdj MNT=/mnt/sdj mkfs.btrfs -f $DEV mount $DEV $MNT echo -n "X" > $MNT/foobar btrfs filesystem defragment $MNT/foobar umount $MNT So fix this by not decrementing last_byte by 1 before doing the sector size round up. Also, to make it easier to follow, make the round up right after computing last_byte. Reported-by: Anthony Ruhier Fixes: 7b508037d4cac3 ("btrfs: defrag: use defrag_one_cluster() to implement btrfs_defrag_file()") Link: https://lore.kernel.org/linux-btrfs/0a269612-e43f-da22-c5bc-b34b1b56ebe8@mailbox.org/ CC: stable@vger.kernel.org # 5.16 Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit d5ad5b1c04c85f01850e88231cad7dfbc9e1d30c Author: Muhammad Usama Anjum Date: Tue Jan 18 17:20:52 2022 +0500 selftests: kvm: add amx_test to .gitignore amx_test's binary should be present in the .gitignore file for the git to ignore it. Fixes: bf70636d9443 ("selftest: kvm: Add amx selftest") Signed-off-by: Muhammad Usama Anjum Message-Id: <20220118122053.1941915-1-usama.anjum@collabora.com> Signed-off-by: Paolo Bonzini commit a3c19d5beaad25fcaa703b251c72c3a22fc09100 Author: Sean Christopherson Date: Wed Dec 8 01:52:33 2021 +0000 KVM: SVM: Nullify vcpu_(un)blocking() hooks if AVIC is disabled Nullify svm_x86_ops.vcpu_(un)blocking if AVIC/APICv is disabled as the hooks are necessary only to clear the vCPU's IsRunning entry in the Physical APIC and to update IRTE entries if the VM has a pass-through device attached. Opportunistically rename the helpers to clarify their AVIC relationship. Signed-off-by: Sean Christopherson Message-Id: <20211208015236.1616697-24-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 54744e17f031cbc5c5b995b1e275df1520c8a739 Author: Sean Christopherson Date: Wed Dec 8 01:52:32 2021 +0000 KVM: SVM: Move svm_hardware_setup() and its helpers below svm_x86_ops Move svm_hardware_setup() below svm_x86_ops so that KVM can modify ops during setup, e.g. the vcpu_(un)blocking hooks can be nullified if AVIC is disabled or unsupported. No functional change intended. Signed-off-by: Sean Christopherson Message-Id: <20211208015236.1616697-23-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 935a7333958e91b5d0c1b0ebc75a5cefdbb34dd5 Author: Sean Christopherson Date: Wed Dec 8 01:52:31 2021 +0000 KVM: SVM: Drop AVIC's intermediate avic_set_running() helper Drop avic_set_running() in favor of calling avic_vcpu_{load,put}() directly, and modify the block+put path to use preempt_disable/enable() instead of get/put_cpu(), as it doesn't actually care about the current pCPU associated with the vCPU. Opportunistically add lockdep assertions as being preempted in avic_vcpu_put() would lead to consuming stale data, even though doing so _in the current code base_ would not be fatal. Add a much needed comment explaining why svm_vcpu_blocking() needs to unload the AVIC and update the IRTE _before_ the vCPU starts blocking. Signed-off-by: Sean Christopherson Message-Id: <20211208015236.1616697-22-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 635e6357f948d57bc98af8d37eb81896333822e9 Author: Sean Christopherson Date: Wed Dec 8 01:52:30 2021 +0000 KVM: VMX: Don't do full kick when handling posted interrupt wakeup When waking vCPUs in the posted interrupt wakeup handling, do exactly that and no more. There is no need to kick the vCPU as the wakeup handler just needs to get the vCPU task running, and if it's in the guest then it's definitely running. Signed-off-by: Sean Christopherson Reviewed-by: Maxim Levitsky Message-Id: <20211208015236.1616697-21-seanjc@google.com> Signed-off-by: Paolo Bonzini commit ccf8d687542f6a7288b79727bec1cc084b3771b3 Author: Sean Christopherson Date: Wed Dec 8 01:52:29 2021 +0000 KVM: VMX: Fold fallback path into triggering posted IRQ helper Move the fallback "wake_up" path into the helper to trigger posted interrupt helper now that the nested and non-nested paths are identical. No functional change intended. Signed-off-by: Sean Christopherson Reviewed-by: Maxim Levitsky Message-Id: <20211208015236.1616697-20-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 296aa26644d088d8ccf0d62b0a93443f7188d5e5 Author: Sean Christopherson Date: Wed Dec 8 01:52:28 2021 +0000 KVM: VMX: Pass desired vector instead of bool for triggering posted IRQ Refactor the posted interrupt helper to take the desired notification vector instead of a bool so that the callers are self-documenting. No functional change intended. Signed-off-by: Sean Christopherson Reviewed-by: Maxim Levitsky Message-Id: <20211208015236.1616697-19-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 0f65a9d337676b966316db17374fbef910ab8e4a Author: Sean Christopherson Date: Wed Dec 8 01:52:26 2021 +0000 KVM: VMX: Don't do full kick when triggering posted interrupt "fails" Replace the full "kick" with just the "wake" in the fallback path when triggering a virtual interrupt via a posted interrupt fails because the guest is not IN_GUEST_MODE. If the guest transitions into guest mode between the check and the kick, then it's guaranteed to see the pending interrupt as KVM syncs the PIR to IRR (and onto GUEST_RVI) after setting IN_GUEST_MODE. Kicking the guest in this case is nothing more than an unnecessary VM-Exit (and host IRQ). Opportunistically update comments to explain the various ordering rules and barriers at play. Signed-off-by: Sean Christopherson Message-Id: <20211208015236.1616697-17-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 782f64558de7bef84b90ea812deb38f0e53a8c7a Author: Sean Christopherson Date: Wed Dec 8 01:52:24 2021 +0000 KVM: SVM: Skip AVIC and IRTE updates when loading blocking vCPU Don't bother updating the Physical APIC table or IRTE when loading a vCPU that is blocking, i.e. won't be marked IsRun{ning}=1, as the pCPU is queried if and only if IsRunning is '1'. If the vCPU was migrated, the new pCPU will be picked up when avic_vcpu_load() is called by svm_vcpu_unblocking(). Signed-off-by: Sean Christopherson Message-Id: <20211208015236.1616697-15-seanjc@google.com> Signed-off-by: Paolo Bonzini commit af52f5aa5c1b46809834b728a13a1af5aab451e9 Author: Sean Christopherson Date: Wed Dec 8 01:52:23 2021 +0000 KVM: SVM: Use kvm_vcpu_is_blocking() in AVIC load to handle preemption Use kvm_vcpu_is_blocking() to determine whether or not the vCPU should be marked running during avic_vcpu_load(). Drop avic_is_running, which really should have been named "vcpu_is_not_blocking", as it tracked if the vCPU was blocking, not if it was actually running, e.g. it was set during svm_create_vcpu() when the vCPU was obviously not running. This is technically a teeny tiny functional change, as the vCPU will be marked IsRunning=1 on being reloaded if the vCPU is preempted between svm_vcpu_blocking() and prepare_to_rcuwait(). But that's a benign change as the vCPU will be marked IsRunning=0 when KVM voluntarily schedules out the vCPU. Signed-off-by: Sean Christopherson Message-Id: <20211208015236.1616697-14-seanjc@google.com> Signed-off-by: Paolo Bonzini commit e422b88969489e67fd1a87a6ef4ef5c30bb53edb Author: Sean Christopherson Date: Wed Dec 8 01:52:22 2021 +0000 KVM: SVM: Remove unnecessary APICv/AVIC update in vCPU unblocking path Remove handling of KVM_REQ_APICV_UPDATE from svm_vcpu_unblocking(), it's no longer needed as it was made obsolete by commit df7e4827c549 ("KVM: SVM: call avic_vcpu_load/avic_vcpu_put when enabling/disabling AVIC"). Prior to that commit, the manual check was necessary to ensure the AVIC stuff was updated by avic_set_running() when a request to enable APICv became pending while the vCPU was blocking, as the request handling itself would not do the update. But, as evidenced by the commit, that logic was flawed and subject to various races. Now that svm_refresh_apicv_exec_ctrl() does avic_vcpu_load/put() in response to an APICv status change, drop the manual check in the unblocking path. Suggested-by: Paolo Bonzini Signed-off-by: Sean Christopherson Message-Id: <20211208015236.1616697-13-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 202470d536b2cad22fa859f3e01202571c49ded9 Author: Sean Christopherson Date: Wed Dec 8 01:52:21 2021 +0000 KVM: SVM: Don't bother checking for "running" AVIC when kicking for IPIs Drop the avic_vcpu_is_running() check when waking vCPUs in response to a VM-Exit due to incomplete IPI delivery. The check isn't wrong per se, but it's not 100% accurate in the sense that it doesn't guarantee that the vCPU was one of the vCPUs that didn't receive the IPI. The check isn't required for correctness as blocking == !running in this context. From a performance perspective, waking a live task is not expensive as the only moderately costly operation is a locked operation to temporarily disable preemption. And if that is indeed a performance issue, kvm_vcpu_is_blocking() would be a better check than poking into the AVIC. Signed-off-by: Sean Christopherson Reviewed-by: Maxim Levitsky Message-Id: <20211208015236.1616697-12-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 31f251d4ddfa464c6dd92ee873b9b223e992a085 Author: Sean Christopherson Date: Wed Dec 8 01:52:20 2021 +0000 KVM: SVM: Signal AVIC doorbell iff vCPU is in guest mode Signal the AVIC doorbell iff the vCPU is running in the guest. If the vCPU is not IN_GUEST_MODE, it's guaranteed to pick up any pending IRQs on the next VMRUN, which unconditionally processes the vIRR. Add comments to document the logic. Signed-off-by: Sean Christopherson Message-Id: <20211208015236.1616697-11-seanjc@google.com> Signed-off-by: Paolo Bonzini commit c3e8abf0f3536a46a235b0533149c2b2c2bbac27 Author: Sean Christopherson Date: Wed Dec 8 01:52:19 2021 +0000 KVM: x86: Remove defunct pre_block/post_block kvm_x86_ops hooks Drop kvm_x86_ops' pre/post_block() now that all implementations are nops. No functional change intended. Signed-off-by: Sean Christopherson Reviewed-by: Maxim Levitsky Message-Id: <20211208015236.1616697-10-seanjc@google.com> Signed-off-by: Paolo Bonzini commit b6d42baddf85310eb2c455cf78af2580773c4ff0 Author: Sean Christopherson Date: Wed Dec 8 01:52:18 2021 +0000 KVM: x86: Unexport LAPIC's switch_to_{hv,sw}_timer() helpers Unexport switch_to_{hv,sw}_timer() now that common x86 handles the transitions. No functional change intended. Signed-off-by: Sean Christopherson Reviewed-by: Maxim Levitsky Message-Id: <20211208015236.1616697-9-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 98c25ead5eda5e9d41abe57839ad3e8caf19500c Author: Sean Christopherson Date: Wed Dec 8 01:52:17 2021 +0000 KVM: VMX: Move preemption timer <=> hrtimer dance to common x86 Handle the switch to/from the hypervisor/software timer when a vCPU is blocking in common x86 instead of in VMX. Even though VMX is the only user of a hypervisor timer, the logic and all functions involved are generic x86 (unless future CPUs do something completely different and implement a hypervisor timer that runs regardless of mode). Handling the switch in common x86 will allow for the elimination of the pre/post_blocks hooks, and also lets KVM switch back to the hypervisor timer if and only if it was in use (without additional params). Add a comment explaining why the switch cannot be deferred to kvm_sched_out() or kvm_vcpu_block(). Signed-off-by: Sean Christopherson Reviewed-by: Maxim Levitsky Message-Id: <20211208015236.1616697-8-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 12a8eee5686ef3ea7d8db90cd664f11e4a39e349 Author: Sean Christopherson Date: Wed Dec 8 01:52:16 2021 +0000 KVM: Move x86 VMX's posted interrupt list_head to vcpu_vmx Move the seemingly generic block_vcpu_list from kvm_vcpu to vcpu_vmx, and rename the list and all associated variables to clarify that it tracks the set of vCPU that need to be poked on a posted interrupt to the wakeup vector. The list is not used to track _all_ vCPUs that are blocking, and the term "blocked" can be misleading as it may refer to a blocking condition in the host or the guest, where as the PI wakeup case is specifically for the vCPUs that are actively blocking from within the guest. No functional change intended. Signed-off-by: Sean Christopherson Reviewed-by: Maxim Levitsky Message-Id: <20211208015236.1616697-7-seanjc@google.com> Signed-off-by: Paolo Bonzini commit e6eec09b7bc7869a49ac0ff376415bad40030ade Author: Sean Christopherson Date: Wed Dec 8 01:52:15 2021 +0000 KVM: Drop unused kvm_vcpu.pre_pcpu field Remove kvm_vcpu.pre_pcpu as it no longer has any users. No functional change intended. Signed-off-by: Sean Christopherson Reviewed-by: Maxim Levitsky Message-Id: <20211208015236.1616697-6-seanjc@google.com> Signed-off-by: Paolo Bonzini commit d76fb40637fc0e84b27bf431cd72cf8fe3f813ef Author: Sean Christopherson Date: Wed Dec 8 01:52:14 2021 +0000 KVM: VMX: Handle PI descriptor updates during vcpu_put/load Move the posted interrupt pre/post_block logic into vcpu_put/load respectively, using the kvm_vcpu_is_blocking() to determining whether or not the wakeup handler needs to be set (and unset). This avoids updating the PI descriptor if halt-polling is successful, reduces the number of touchpoints for updating the descriptor, and eliminates the confusing behavior of intentionally leaving a "stale" PI.NDST when a blocking vCPU is scheduled back in after preemption. The downside is that KVM will do the PID update twice if the vCPU is preempted after prepare_to_rcuwait() but before schedule(), but that's a rare case (and non-existent on !PREEMPT kernels). The notable wart is the need to send a self-IPI on the wakeup vector if an outstanding notification is pending after configuring the wakeup vector. Ideally, KVM would just do a kvm_vcpu_wake_up() in this case, but the scheduler doesn't support waking a task from its preemption notifier callback, i.e. while the task is right in the middle of being scheduled out. Note, setting the wakeup vector before halt-polling is not necessary: once the pending IRQ will be recorded in the PIR, kvm_vcpu_has_events() will detect this (via kvm_cpu_get_interrupt(), kvm_apic_get_interrupt(), apic_has_interrupt_for_ppr() and finally vmx_sync_pir_to_irr()) and terminate the polling. Signed-off-by: Sean Christopherson Reviewed-by: Maxim Levitsky Message-Id: <20211208015236.1616697-5-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 4f5a884fc212d99654e4fb36ba98d5354f0dd18e Merge: e09fccb5435d7 5f02ef741a785 Author: Paolo Bonzini Date: Tue Jan 18 04:45:32 2022 -0500 Merge branch 'kvm-pi-raw-spinlock' into HEAD Bring in fix for VT-d posted interrupts before further changing the code in 5.17. Signed-off-by: Paolo Bonzini commit e09fccb5435d7b9ab3fd5dfeada8ae40cfa56e08 Author: Christian Borntraeger Date: Thu Jan 13 13:29:24 2022 +0100 KVM: avoid warning on s390 in mark_page_dirty Avoid warnings on s390 like [ 1801.980931] CPU: 12 PID: 117600 Comm: kworker/12:0 Tainted: G E 5.17.0-20220113.rc0.git0.32ce2abb03cf.300.fc35.s390x+next #1 [ 1801.980938] Workqueue: events irqfd_inject [kvm] [...] [ 1801.981057] Call Trace: [ 1801.981060] [<000003ff805f0f5c>] mark_page_dirty_in_slot+0xa4/0xb0 [kvm] [ 1801.981083] [<000003ff8060e9fe>] adapter_indicators_set+0xde/0x268 [kvm] [ 1801.981104] [<000003ff80613c24>] set_adapter_int+0x64/0xd8 [kvm] [ 1801.981124] [<000003ff805fb9aa>] kvm_set_irq+0xc2/0x130 [kvm] [ 1801.981144] [<000003ff805f8d86>] irqfd_inject+0x76/0xa0 [kvm] [ 1801.981164] [<0000000175e56906>] process_one_work+0x1fe/0x470 [ 1801.981173] [<0000000175e570a4>] worker_thread+0x64/0x498 [ 1801.981176] [<0000000175e5ef2c>] kthread+0x10c/0x110 [ 1801.981180] [<0000000175de73c8>] __ret_from_fork+0x40/0x58 [ 1801.981185] [<000000017698440a>] ret_from_fork+0xa/0x40 when writing to a guest from an irqfd worker as long as we do not have the dirty ring. Signed-off-by: Christian Borntraeger Reluctantly-acked-by: David Woodhouse Message-Id: <20220113122924.740496-1-borntraeger@linux.ibm.com> Fixes: 2efd61a608b0 ("KVM: Warn if mark_page_dirty() is called without an active vCPU") Signed-off-by: Paolo Bonzini commit e337f7e063641ca4d040c8210d4bd790b81effb0 Author: Sean Christopherson Date: Tue Dec 28 23:24:37 2021 +0000 KVM: selftests: Add a test to force emulation with a pending exception Add a VMX specific test to verify that KVM doesn't explode if userspace attempts KVM_RUN when emulation is required with a pending exception. KVM VMX's emulation support for !unrestricted_guest punts exceptions to userspace instead of attempting to synthesize the exception with all the correct state (and stack switching, etc...). Punting is acceptable as there's never been a request to support injecting exceptions when emulating due to invalid state, but KVM has historically assumed that userspace will do the right thing and either clear the exception or kill the guest. Deliberately do the opposite and attempt to re-enter the guest with a pending exception and emulation required to verify KVM continues to punt the combination to userspace, e.g. doesn't explode, WARN, etc... Signed-off-by: Sean Christopherson Message-Id: <20211228232437.1875318-3-seanjc@google.com> Signed-off-by: Paolo Bonzini commit fc4fad79fc3d8841562e2a85808079da5b4835f6 Author: Sean Christopherson Date: Tue Dec 28 23:24:36 2021 +0000 KVM: VMX: Reject KVM_RUN if emulation is required with pending exception Reject KVM_RUN if emulation is required (because VMX is running without unrestricted guest) and an exception is pending, as KVM doesn't support emulating exceptions except when emulating real mode via vm86. The vCPU is hosed either way, but letting KVM_RUN proceed triggers a WARN due to the impossible condition. Alternatively, the WARN could be removed, but then userspace and/or KVM bugs would result in the vCPU silently running in a bad state, which isn't very friendly to users. Originally, the bug was hit by syzkaller with a nested guest as that doesn't require kvm_intel.unrestricted_guest=0. That particular flavor is likely fixed by commit cd0e615c49e5 ("KVM: nVMX: Synthesize TRIPLE_FAULT for L2 if emulation is required"), but it's trivial to trigger the WARN with a non-nested guest, and userspace can likely force bad state via ioctls() for a nested guest as well. Checking for the impossible condition needs to be deferred until KVM_RUN because KVM can't force specific ordering between ioctls. E.g. clearing exception.pending in KVM_SET_SREGS doesn't prevent userspace from setting it in KVM_SET_VCPU_EVENTS, and disallowing KVM_SET_VCPU_EVENTS with emulation_required would prevent userspace from queuing an exception and then stuffing sregs. Note, if KVM were to try and detect/prevent the condition prior to KVM_RUN, handle_invalid_guest_state() and/or handle_emulation_failure() would need to be modified to clear the pending exception prior to exiting to userspace. ------------[ cut here ]------------ WARNING: CPU: 6 PID: 137812 at arch/x86/kvm/vmx/vmx.c:1623 vmx_queue_exception+0x14f/0x160 [kvm_intel] CPU: 6 PID: 137812 Comm: vmx_invalid_nes Not tainted 5.15.2-7cc36c3e14ae-pop #279 Hardware name: ASUS Q87M-E/Q87M-E, BIOS 1102 03/03/2014 RIP: 0010:vmx_queue_exception+0x14f/0x160 [kvm_intel] Code: <0f> 0b e9 fd fe ff ff 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 RSP: 0018:ffffa45c83577d38 EFLAGS: 00010202 RAX: 0000000000000003 RBX: 0000000080000006 RCX: 0000000000000006 RDX: 0000000000000000 RSI: 0000000000010002 RDI: ffff9916af734000 RBP: ffff9916af734000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000006 R13: 0000000000000000 R14: ffff9916af734038 R15: 0000000000000000 FS: 00007f1e1a47c740(0000) GS:ffff99188fb80000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f1e1a6a8008 CR3: 000000026f83b005 CR4: 00000000001726e0 Call Trace: kvm_arch_vcpu_ioctl_run+0x13a2/0x1f20 [kvm] kvm_vcpu_ioctl+0x279/0x690 [kvm] __x64_sys_ioctl+0x83/0xb0 do_syscall_64+0x3b/0xc0 entry_SYSCALL_64_after_hwframe+0x44/0xae Reported-by: syzbot+82112403ace4cbd780d8@syzkaller.appspotmail.com Signed-off-by: Sean Christopherson Message-Id: <20211228232437.1875318-2-seanjc@google.com> Signed-off-by: Paolo Bonzini commit bef9a701f3ebfb60da259b04778d24128505a96c Author: Jim Mattson Date: Fri Jan 14 21:24:31 2022 -0800 selftests: kvm/x86: Add test for KVM_SET_PMU_EVENT_FILTER Verify that the PMU event filter works as expected. Note that the virtual PMU doesn't work as expected on AMD Zen CPUs (an intercepted rdmsr is counted as a retired branch instruction), but the PMU event filter does work. Signed-off-by: Jim Mattson Signed-off-by: Paolo Bonzini Message-Id: <20220115052431.447232-7-jmattson@google.com> Signed-off-by: Paolo Bonzini commit 2ba9047424fc7243c63ac57f5fdfa754aa895e3c Author: Jim Mattson Date: Fri Jan 14 21:24:30 2022 -0800 selftests: kvm/x86: Introduce x86_model() Extract the x86 model number from CPUID.01H:EAX. Signed-off-by: Jim Mattson Signed-off-by: Paolo Bonzini Message-Id: <20220115052431.447232-6-jmattson@google.com> Signed-off-by: Paolo Bonzini commit 398f9240f90f4168f5882180723f743f7b682049 Author: Jim Mattson Date: Fri Jan 14 21:24:29 2022 -0800 selftests: kvm/x86: Export x86_family() for use outside of processor.c Move this static inline function to processor.h, so that it can be used in individual tests, as needed. Opportunistically replace the bare 'unsigned' with 'unsigned int.' Signed-off-by: Jim Mattson Signed-off-by: Paolo Bonzini Message-Id: <20220115052431.447232-5-jmattson@google.com> Signed-off-by: Paolo Bonzini commit 21066101f42cfd86fdd835b70ce0e36c335f5f4d Author: Jim Mattson Date: Fri Jan 14 21:24:28 2022 -0800 selftests: kvm/x86: Introduce is_amd_cpu() Replace the one ad hoc "AuthenticAMD" CPUID vendor string comparison with a new function, is_amd_cpu(). Signed-off-by: Jim Mattson Signed-off-by: Paolo Bonzini Message-Id: <20220115052431.447232-4-jmattson@google.com> Signed-off-by: Paolo Bonzini commit b33b9c407861985713ca18cc9ea05b7540210ad4 Author: Jim Mattson Date: Fri Jan 14 21:24:27 2022 -0800 selftests: kvm/x86: Parameterize the CPUID vendor string check Refactor is_intel_cpu() to make it easier to reuse the bulk of the code for other vendors in the future. Signed-off-by: Jim Mattson Signed-off-by: Paolo Bonzini Message-Id: <20220115052431.447232-3-jmattson@google.com> Signed-off-by: Paolo Bonzini commit 7ff775aca48adc854436b92c060e5eebfffb6a4a Author: Jim Mattson Date: Fri Jan 14 21:24:26 2022 -0800 KVM: x86/pmu: Use binary search to check filtered events The PMU event filter may contain up to 300 events. Replace the linear search in reprogram_gp_counter() with a binary search. Signed-off-by: Jim Mattson Signed-off-by: Paolo Bonzini Message-Id: <20220115052431.447232-2-jmattson@google.com> Signed-off-by: Paolo Bonzini commit ba978e83255a759a4a07257a46ca6396a8b81787 Author: Shyam Prasad N Date: Mon Jan 17 07:15:02 2022 +0000 cifs: cifs_ses_mark_for_reconnect should also update reconnect bits Recent restructuring of cifs_reconnect introduced a helper func named cifs_ses_mark_for_reconnect, which updates the state of tcp session for all the channels of a session for reconnect. However, this does not update the session state and chans_need_reconnect bitmask. This change fixes that. Also, cifs_mark_tcp_sess_for_reconnect should mark set the bitmask for all channels when the whole session is marked for reconnect. Fixed that here too. Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit 47de760655f329ce4b3d3e6276557220956d8c38 Author: Shyam Prasad N Date: Tue Jan 18 09:24:08 2022 +0000 cifs: update tcpStatus during negotiate and sess setup Till the end of SMB session setup, update tcpStatus and avoid updating session status field. There was a typo in cifs_setup_session, which caused ses->status to be updated instead. This was causing issues during reconnect. Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit c1604da708d345a1ca1cf6a5537d503b14aa4787 Author: Shyam Prasad N Date: Sun Jan 16 13:38:14 2022 +0000 cifs: make status checks in version independent callers The status of tcp session, smb session and tcon have the same flow, irrespective of the SMB version used. Hence these status checks and updates should happen in the version independent callers of these commands. Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit ece0767641740c7eea7aee5a332728e115b00eab Author: Shyam Prasad N Date: Sun Jan 16 13:28:34 2022 +0000 cifs: remove repeated state change in dfs tree connect cifs_tree_connect checks and sets the tidStatus for the tcon. cifs_tree_connect also calls a dfs specific tree connect function, which also does similar checks. This should not happen. Removing it with this change. Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit e154cb7b0ab961f9d785ed34c2d7128413e7083d Author: Shyam Prasad N Date: Sun Jan 16 11:19:36 2022 +0000 cifs: fix the cifs_reconnect path for DFS Recently, the cifs_reconnect code was refactored into two branches for regular vs dfs codepath. Some of my recent changes were missing in the dfs path, namely the code to enable periodic DNS query, and a missing lock. Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit 8a409cda978e212661b8c032e1b08b3b0b0f9d36 Author: Muhammad Usama Anjum Date: Wed Jan 5 02:24:37 2022 +0500 cifs: remove unused variable ses_selected ses_selected is being declared and set at several places. It is not being used. Remove it. Signed-off-by: Muhammad Usama Anjum Signed-off-by: Steve French commit 88b024f556fcd5bf1288c6333016f576cfa5f539 Author: Shyam Prasad N Date: Fri Nov 19 14:16:57 2021 +0000 cifs: protect all accesses to chan_* with chan_lock A spin lock called chan_lock was introduced recently. But not all accesses were protected. Doing that with this change. To make sure that a channel is not freed when in use, we need to introduce a ref count. But today, we don't ever free channels. Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit a05885ce13bd5ec9602551e32dfb1a4f26bfa542 Author: Shyam Prasad N Date: Wed Nov 17 15:57:22 2021 +0000 cifs: fix the connection state transitions with multichannel Recent changes to multichannel required some adjustments in the way connection states transitioned during/after reconnect. Also some minor fixes: 1. A pending switch of GlobalMid_Lock to cifs_tcp_ses_lock 2. Relocations of the code that logs reconnect 3. Changed some code in allocate_mid to suit the new scheme Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit 3663c9045f51a7ad635a0785adef07c21b79b560 Author: Shyam Prasad N Date: Sat Oct 30 04:51:35 2021 +0000 cifs: check reconnects for channels of active tcons too With the new multichannel logic, when a channel needs reconnection, the tree connect and other channels can still be active. This fix will handle cases of checking for channel reconnect, when the tcon does not need reconnect. Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit 1a1d1dbce6d5477e2bb08ce1ef0d77caa838cc8e Author: Wei Wang Date: Mon Jan 17 20:48:17 2022 -0500 kvm: selftests: conditionally build vm_xsave_req_perm() vm_xsave_req_perm() is currently defined and used by x86_64 only. Make it compiled into vm_create_with_vcpus() only when on x86_64 machines. Otherwise, it would cause linkage errors, e.g. on s390x. Fixes: 415a3c33e8 ("kvm: selftests: Add support for KVM_CAP_XSAVE2") Reported-by: Janis Schoetterl-Glausch Signed-off-by: Wei Wang Tested-by: Janis Schoetterl-Glausch Message-Id: <20220118014817.30910-1-wei.w.wang@intel.com> Signed-off-by: Paolo Bonzini commit e9737468829c2f6abc0c67e5372f8878dff11653 Author: Like Xu Date: Mon Jan 17 15:45:31 2022 +0800 KVM: x86/cpuid: Clear XFD for component i if the base feature is missing According to Intel extended feature disable (XFD) spec, the sub-function i (i > 1) of CPUID function 0DH enumerates "details for state component i. ECX[2] enumerates support for XFD support for this state component." If KVM does not report F(XFD) feature (e.g. due to CONFIG_X86_64), then the corresponding XFD support for any state component i should also be removed. Translate this dependency into KVM terms. Fixes: 690a757d610e ("kvm: x86: Add CPUID support for Intel AMX") Signed-off-by: Like Xu Message-Id: <20220117074531.76925-1-likexu@tencent.com> Signed-off-by: Paolo Bonzini commit 6ff94f27fd47847d6ecb9302f9d3bd1ca991a17f Author: David Matlack Date: Thu Jan 13 23:30:20 2022 +0000 KVM: x86/mmu: Improve TLB flush comment in kvm_mmu_slot_remove_write_access() Rewrite the comment in kvm_mmu_slot_remove_write_access() that explains why it is safe to flush TLBs outside of the MMU lock after write-protecting SPTEs for dirty logging. The current comment is a long run-on sentence that was difficult to understand. In addition it was specific to the shadow MMU (mentioning mmu_spte_update()) when the TDP MMU has to handle this as well. The new comment explains: - Why the TLB flush is necessary at all. - Why it is desirable to do the TLB flush outside of the MMU lock. - Why it is safe to do the TLB flush outside of the MMU lock. No functional change intended. Signed-off-by: David Matlack Message-Id: <20220113233020.3986005-5-dmatlack@google.com> Reviewed-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 5f16bcac6e280a7dade580d9627f5cf93ef6aa56 Author: David Matlack Date: Thu Jan 13 23:30:19 2022 +0000 KVM: x86/mmu: Document and enforce MMU-writable and Host-writable invariants SPTEs are tagged with software-only bits to indicate if it is "MMU-writable" and "Host-writable". These bits are used to determine why KVM has marked an SPTE as read-only. Document these bits and their invariants, and enforce the invariants with new WARNs in spte_can_locklessly_be_made_writable() to ensure they are not accidentally violated in the future. Opportunistically move DEFAULT_SPTE_{MMU,HOST}_WRITABLE next to EPT_SPTE_{MMU,HOST}_WRITABLE since the new documentation applies to both. No functional change intended. Signed-off-by: David Matlack Message-Id: <20220113233020.3986005-4-dmatlack@google.com> Signed-off-by: Paolo Bonzini commit f082d86ea68559e4bd1ecaffa04981b72281e28f Author: David Matlack Date: Thu Jan 13 23:30:18 2022 +0000 KVM: x86/mmu: Clear MMU-writable during changed_pte notifier When handling the changed_pte notifier and the new PTE is read-only, clear both the Host-writable and MMU-writable bits in the SPTE. This preserves the invariant that MMU-writable is set if-and-only-if Host-writable is set. No functional change intended. Nothing currently relies on the aforementioned invariant and technically the changed_pte notifier is dead code. Signed-off-by: David Matlack Message-Id: <20220113233020.3986005-3-dmatlack@google.com> Reviewed-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 7c8a4742c4abe205ec9daf416c9d42fd6b406e8e Author: David Matlack Date: Thu Jan 13 23:30:17 2022 +0000 KVM: x86/mmu: Fix write-protection of PTs mapped by the TDP MMU When the TDP MMU is write-protection GFNs for page table protection (as opposed to for dirty logging, or due to the HVA not being writable), it checks if the SPTE is already write-protected and if so skips modifying the SPTE and the TLB flush. This behavior is incorrect because it fails to check if the SPTE is write-protected for page table protection, i.e. fails to check that MMU-writable is '0'. If the SPTE was write-protected for dirty logging but not page table protection, the SPTE could locklessly be made writable, and vCPUs could still be running with writable mappings cached in their TLB. Fix this by only skipping setting the SPTE if the SPTE is already write-protected *and* MMU-writable is already clear. Technically, checking only MMU-writable would suffice; a SPTE cannot be writable without MMU-writable being set. But check both to be paranoid and because it arguably yields more readable code. Fixes: 46044f72c382 ("kvm: x86/mmu: Support write protection for nesting in tdp MMU") Cc: stable@vger.kernel.org Signed-off-by: David Matlack Message-Id: <20220113233020.3986005-2-dmatlack@google.com> Reviewed-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 9d5f0c36438eeae7566ca383b2b673179e3cc613 Author: Arnaldo Carvalho de Melo Date: Tue Jan 18 09:02:43 2022 -0300 perf machine: Use path__join() to compose a path instead of snprintf(dir, '/', filename) Its more intention revealing, and if we're interested in the odd cases where this may end up truncating we can do debug checks at one centralized place. Motivation, of all the container builds, fedora rawhide started complaining of: util/machine.c: In function ‘machine__create_modules’: util/machine.c:1419:50: error: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size between 0 and 4095 [-Werror=format-truncation=] 1419 | snprintf(path, sizeof(path), "%s/%s", dir_name, dent->d_name); | ^~ In file included from /usr/include/stdio.h:894, from util/branch.h:9, from util/callchain.h:8, from util/machine.c:7: In function ‘snprintf’, inlined from ‘maps__set_modules_path_dir’ at util/machine.c:1419:3, inlined from ‘machine__set_modules_path’ at util/machine.c:1473:9, inlined from ‘machine__create_modules’ at util/machine.c:1519:7: /usr/include/bits/stdio2.h:71:10: note: ‘__builtin___snprintf_chk’ output between 2 and 4352 bytes into a destination of size 4096 There are other places where we should use path__join(), but lets get rid of this one first. Cc: Adrian Hunter Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Acked-by: Ian Rogers Link: Link: https://lore.kernel.org/r/YebZKjwgfdOz0lAs@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 9df15d842a0f77f2b8ee29386f6d714e4220df57 Author: Alain Volmat Date: Wed Jan 19 10:32:45 2022 +0100 spi: stm32: make SPI_MASTER_MUST_TX flags only specific to STM32F4 Commit 61367d0b8f5e ("spi: stm32: Add 'SPI_SIMPLEX_RX', 'SPI_3WIRE_RX' support for stm32f4") allowed to properly communicate with the st-gyro-spi even when there is no tx_buf provided by setting the flag SPI_MASTER_MUST_TX and thus forcing a dummy TX buffer to work in Full Duplex. This behavior should kept only for the STM32F4 and not for other compatible since the STM32H7 do support SIMPLEX_RX and SIMPLEX_TX. Add the flags variable within the struct stm32_spi_cfg so that flags used at master registration time are compatible specific. Fixes: 61367d0b8f5e ("spi: stm32: Add 'SPI_SIMPLEX_RX', 'SPI_3WIRE_RX' support for stm32f4") Signed-off-by: Alain Volmat Link: https://lore.kernel.org/r/20220119093245.624878-3-alain.volmat@foss.st.com Signed-off-by: Mark Brown commit 3cefddb72f80dc8d49ce605628ceb6525cfd64da Author: Alain Volmat Date: Wed Jan 19 10:32:44 2022 +0100 spi: stm32: remove inexistant variables in struct stm32_spi_cfg comment Variables 'can_dma' and 'has_startbit' are described within the struct stm32_spi_cfg comment but have never existed in this structure so remove them. Signed-off-by: Alain Volmat Link: https://lore.kernel.org/r/20220119093245.624878-2-alain.volmat@foss.st.com Signed-off-by: Mark Brown commit e4d63473d3110afd170e6e0e48494d3789d26136 Author: Patrice Chotard Date: Mon Jan 17 13:17:44 2022 +0100 spi: stm32-qspi: Update spi registering Some device driver need to communicate to qspi device during the remove process, qspi controller must be functional when spi_unregister_master() is called. To ensure this, replace devm_spi_register_master() by spi_register_master() and spi_unregister_master() is called directly in .remove callback before stopping the qspi controller. This issue was put in evidence using kernel v5.11 and later with a spi-nor which supports the software reset feature introduced by commit d73ee7534cc5 ("mtd: spi-nor: core: perform a Soft Reset on shutdown") Fixes: c530cd1d9d5e ("spi: spi-mem: add stm32 qspi controller") Signed-off-by: Patrice Chotard Cc: # 5.8.x Reviewed-by: Lukas Wunner Link: https://lore.kernel.org/r/20220117121744.29729-1-patrice.chotard@foss.st.com Signed-off-by: Mark Brown commit b4c18c18ebf7cf1e602af88c12ef9cb0d6e5ce51 Author: Randy Dunlap Date: Fri Jan 14 19:36:03 2022 -0800 regulator: MAX20086: add gpio/consumer.h max20086-regulator.c needs for an enum, some macros, and a function prototype. (seen on ARCH=m68k) Adding this header file fixes multiple build errors: ../drivers/regulator/max20086-regulator.c: In function 'max20086_i2c_probe': ../drivers/regulator/max20086-regulator.c:217:26: error: storage size of 'flags' isn't known 217 | enum gpiod_flags flags; ../drivers/regulator/max20086-regulator.c:261:27: error: 'GPIOD_OUT_HIGH' undeclared (first use in this function); did you mean 'GPIOF_INIT_HIGH'? 261 | flags = boot_on ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW; | ^~~~~~~~~~~~~~ ../drivers/regulator/max20086-regulator.c:261:44: error: 'GPIOD_OUT_LOW' undeclared (first use in this function); did you mean 'GPIOF_INIT_LOW'? 261 | flags = boot_on ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW; ../drivers/regulator/max20086-regulator.c:262:27: error: implicit declaration of function 'devm_gpiod_get'; did you mean 'devm_gpio_free'? [-Werror=implicit-function-declaration] 262 | chip->ena_gpiod = devm_gpiod_get(chip->dev, "enable", flags); ../drivers/regulator/max20086-regulator.c:217:26: warning: unused variable 'flags' [-Wunused-variable] 217 | enum gpiod_flags flags; Fixes: bfff546aae50 ("regulator: Add MAX20086-MAX20089 driver") Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Watson Chow Cc: Mark Brown Cc: Laurent Pinchart Reviewed-by: Laurent Pinchart Link: https://lore.kernel.org/r/20220115033603.24473-1-rdunlap@infradead.org Signed-off-by: Mark Brown commit 579b2c8f72d974f27d85bbd53846f34675ee3b01 Author: Julian Braha Date: Mon Jan 17 00:03:24 2022 -0500 ASoC: mediatek: fix unmet dependency on GPIOLIB for SND_SOC_DMIC When SND_SOC_MT8195_MT6359_RT1011_RT5682 is selected, and GPIOLIB is not selected, Kbuild gives the following warning: WARNING: unmet direct dependencies detected for SND_SOC_DMIC Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && GPIOLIB [=n] Selected by [y]: - SND_SOC_MT8195_MT6359_RT1011_RT5682 [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && I2C [=y] && SND_SOC_MT8195 [=y] && MTK_PMIC_WRAP [=y] This is because SND_SOC_MT8195_MT6359_RT1011_RT5682 selects SND_SOC_DMIC without selecting or depending on GPIOLIB, depsite SND_SOC_DMIC depending on GPIOLIB. This unmet dependency bug was detected by Kismet, a static analysis tool for Kconfig. Please advise if this is not the appropriate solution. Signed-off-by: Julian Braha Reviewed-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20220117050324.68371-1-julianbraha@gmail.com Signed-off-by: Mark Brown commit 4c907bcd9dcd233da6707059d777ab389dcbd964 Author: Dan Carpenter Date: Wed Jan 19 15:31:01 2022 +0300 ASoC: max9759: fix underflow in speaker_gain_control_put() Check for negative values of "priv->gain" to prevent an out of bounds access. The concern is that these might come from the user via: -> snd_ctl_elem_write_user() -> snd_ctl_elem_write() -> kctl->put() Fixes: fa8d915172b8 ("ASoC: max9759: Add Amplifier Driver") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20220119123101.GA9509@kili Signed-off-by: Mark Brown commit 8c0ae778e2874f3742bd619000b791d178c187e2 Author: Takashi Iwai Date: Wed Jan 19 10:10:50 2022 +0100 ALSA: core: Simplify snd_power_ref_and_wait() with the standard macro Use wait_event_cmd() macro and simplify snd_power_ref_wait() implementation. This may also cover possible races in the current open code, too. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20220119091050.30125-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit ff9fc0a31d85fcf0011eb4bc4ecaf47d3cc9e21c Merge: 8eb896a77701b 79eb15da3cd68 Author: Jakub Kicinski Date: Wed Jan 19 08:14:42 2022 -0800 Merge branch 'ipv4-avoid-pathological-hash-tables' Eric Dumazet says: ==================== ipv4: avoid pathological hash tables This series speeds up netns dismantles on hosts having many active netns, by making sure two hash tables used for IPV4 fib contains uniformly spread items. v2: changed second patch to add fib_info_laddrhash_bucket() for consistency (David Ahern suggestion). ==================== Link: https://lore.kernel.org/r/20220119100413.4077866-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit 79eb15da3cd68f04b06edf73f9bbafa70a06871f Author: Eric Dumazet Date: Wed Jan 19 02:04:13 2022 -0800 ipv4: add net_hash_mix() dispersion to fib_info_laddrhash keys net/ipv4/fib_semantics.c uses a hash table (fib_info_laddrhash) in which fib_sync_down_addr() can locate fib_info based on IPv4 local address. This hash table is resized based on total number of hashed fib_info, but the hash function is only using the local address. For hosts having many active network namespaces, all fib_info for loopback devices (IPv4 address 127.0.0.1) are hashed into a single bucket, making netns dismantles very slow. Signed-off-by: Eric Dumazet Reviewed-by: David Ahern Signed-off-by: Jakub Kicinski commit d07418afea8f1d9896aaf9dc5ae47ac4f45b220c Author: Eric Dumazet Date: Wed Jan 19 02:04:12 2022 -0800 ipv4: avoid quadratic behavior in netns dismantle net/ipv4/fib_semantics.c uses an hash table of 256 slots, keyed by device ifindexes: fib_info_devhash[DEVINDEX_HASHSIZE] Problem is that with network namespaces, devices tend to use the same ifindex. lo device for instance has a fixed ifindex of one, for all network namespaces. This means that hosts with thousands of netns spend a lot of time looking at some hash buckets with thousands of elements, notably at netns dismantle. Simply add a per netns perturbation (net_hash_mix()) to spread elements more uniformely. Also change fib_devindex_hashfn() to use more entropy. Fixes: aa79e66eee5d ("net: Make ifindex generation per-net namespace") Signed-off-by: Eric Dumazet Reviewed-by: David Ahern Signed-off-by: Jakub Kicinski commit 8eb896a77701bef7c80a99833ca776c9ddc317c8 Merge: baa59504c1cd0 3f7c239c7844d Author: Jakub Kicinski Date: Wed Jan 19 08:14:25 2022 -0800 Merge branch 'net-fsl-xgmac_mdio-add-workaround-for-erratum-a-009885' Tobias Waldekranz says: ==================== net/fsl: xgmac_mdio: Add workaround for erratum A-009885 The individual messages mostly speak for themselves. It is very possible that there are more chips out there that are impacted by this, but I only have access to the errata document for the T1024 family, so I've limited the DT changes to the exact FMan version used in that device. Hopefully someone from NXP can supply a follow-up if need be. The final commit is an unrelated fix that was brought to my attention by sparse. ==================== Link: https://lore.kernel.org/r/20220118215054.2629314-1-tobias@waldekranz.com Signed-off-by: Jakub Kicinski commit 3f7c239c7844d2044ed399399d97a5f1c6008e1b Author: Tobias Waldekranz Date: Tue Jan 18 22:50:53 2022 +0100 net/fsl: xgmac_mdio: Fix incorrect iounmap when removing module As reported by sparse: In the remove path, the driver would attempt to unmap its own priv pointer - instead of the io memory that it mapped in probe. Fixes: 9f35a7342cff ("net/fsl: introduce Freescale 10G MDIO driver") Signed-off-by: Tobias Waldekranz Reviewed-by: Andrew Lunn Signed-off-by: Jakub Kicinski commit 0d375d610fa96524e2ee2b46830a46a7bfa92a9f Author: Tobias Waldekranz Date: Tue Jan 18 22:50:52 2022 +0100 powerpc/fsl/dts: Enable WA for erratum A-009885 on fman3l MDIO buses This block is used in (at least) T1024 and T1040, including their variants like T1023 etc. Fixes: d55ad2967d89 ("powerpc/mpc85xx: Create dts components for the FSL QorIQ DPAA FMan") Signed-off-by: Tobias Waldekranz Signed-off-by: Jakub Kicinski commit ea11fc509ff26039046744d1bdfdf2747dda558c Author: Tobias Waldekranz Date: Tue Jan 18 22:50:51 2022 +0100 dt-bindings: net: Document fsl,erratum-a009885 Update FMan binding documentation with the newly added workaround for erratum A-009885. Signed-off-by: Tobias Waldekranz Reviewed-by: Andrew Lunn Signed-off-by: Jakub Kicinski commit 6198c722019774d38018457a8bfb9ba3ed8c931e Author: Tobias Waldekranz Date: Tue Jan 18 22:50:50 2022 +0100 net/fsl: xgmac_mdio: Add workaround for erratum A-009885 Once an MDIO read transaction is initiated, we must read back the data register within 16 MDC cycles after the transaction completes. Outside of this window, reads may return corrupt data. Therefore, disable local interrupts in the critical section, to maximize the probability that we can satisfy this requirement. Fixes: d55ad2967d89 ("powerpc/mpc85xx: Create dts components for the FSL QorIQ DPAA FMan") Signed-off-by: Tobias Waldekranz Reviewed-by: Andrew Lunn Signed-off-by: Jakub Kicinski commit d9dfab097d90f74dd8d7198aa6e8b87bc15f2122 Author: Rob Herring Date: Thu Jan 6 12:25:15 2022 -0600 dt-bindings: rtc: st,stm32-rtc: Make each example a separate entry Each independent example should be a separate entry. This allows for 'interrupts' to have different cell sizes. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220106182518.1435497-7-robh@kernel.org commit 59449e5dc87e72e9b4a16df115625a93b0112203 Author: Rob Herring Date: Thu Jan 6 12:25:14 2022 -0600 dt-bindings: mmc: arm,pl18x: Make each example a separate entry Each independent example should be a separate entry. This and dropping 'interrupt-parent' allows for 'interrupts' to have different cell sizes. Signed-off-by: Rob Herring Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20220106182518.1435497-6-robh@kernel.org commit c476d430bfc02115e67a32a268ebd31b8d683698 Author: Rob Herring Date: Tue Dec 21 08:52:09 2021 -0400 dt-bindings: display: Add SPI peripheral schema to SPI based displays With 'unevaluatedProperties' support enabled, several SPI based display binding examples have warnings: Documentation/devicetree/bindings/display/panel/samsung,ld9040.example.dt.yaml: lcd@0: Unevaluated properties are not allowed ('#address-cells', '#size-cells', 'spi-max-frequency', 'spi-cpol', 'spi-cpha' were unexpected) Documentation/devicetree/bindings/display/panel/kingdisplay,kd035g6-54nt.example.dt.yaml: panel@0: Unevaluated properties are not allowed ('spi-max-frequency', 'spi-3wire' were unexpected) Documentation/devicetree/bindings/display/panel/ilitek,ili9322.example.dt.yaml: display@0: Unevaluated properties are not allowed ('reg' was unexpected) Documentation/devicetree/bindings/display/panel/samsung,s6e63m0.example.dt.yaml: display@0: Unevaluated properties are not allowed ('spi-max-frequency' was unexpected) Documentation/devicetree/bindings/display/panel/abt,y030xx067a.example.dt.yaml: panel@0: Unevaluated properties are not allowed ('spi-max-frequency' was unexpected) Documentation/devicetree/bindings/display/panel/sony,acx565akm.example.dt.yaml: panel@2: Unevaluated properties are not allowed ('spi-max-frequency', 'reg' were unexpected) Documentation/devicetree/bindings/display/panel/tpo,td.example.dt.yaml: panel@0: Unevaluated properties are not allowed ('spi-max-frequency', 'spi-cpol', 'spi-cpha' were unexpected) Documentation/devicetree/bindings/display/panel/lgphilips,lb035q02.example.dt.yaml: panel@0: Unevaluated properties are not allowed ('reg', 'spi-max-frequency', 'spi-cpol', 'spi-cpha' were unexpected) Documentation/devicetree/bindings/display/panel/innolux,ej030na.example.dt.yaml: panel@0: Unevaluated properties are not allowed ('spi-max-frequency' was unexpected) Documentation/devicetree/bindings/display/panel/sitronix,st7789v.example.dt.yaml: panel@0: Unevaluated properties are not allowed ('spi-max-frequency', 'spi-cpol', 'spi-cpha' were unexpected) Fix all of these by adding a reference to spi-peripheral-props.yaml. With this, the description that the binding must follow spi-controller.yaml is both a bit out of date and redundant, so remove it. Signed-off-by: Rob Herring Reviewed-by: Linus Walleij Acked-by: Paul Cercueil Acked-by: Sam Ravnborg Link: https://lore.kernel.org/r/20211221125209.1195932-1-robh@kernel.org commit d3cbc6e323c9299d10c8d2e4127c77c7d05d07b1 Author: Raymond Jay Golo Date: Thu Jan 13 08:06:20 2022 +0800 drm: panel-orientation-quirks: Add quirk for the 1Netbook OneXPlayer The 1Netbook OneXPlayer uses a panel which has been mounted 90 degrees rotated. Add a quirk for this. Signed-off-by: Raymond Jay Golo Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20220113000619.90988-1-rjgolo@gmail.com commit c8e7ff41f819b0c31c66c5196933c26c18f7681f Author: Jann Horn Date: Fri Jan 14 14:33:31 2022 +0100 HID: uhid: Use READ_ONCE()/WRITE_ONCE() for ->running The flag uhid->running can be set to false by uhid_device_add_worker() without holding the uhid->devlock. Mark all reads/writes of the flag that might race with READ_ONCE()/WRITE_ONCE() for clarity and correctness. Signed-off-by: Jann Horn Signed-off-by: Jiri Kosina commit 4ea5763fb79ed89b3bdad455ebf3f33416a81624 Author: Jann Horn Date: Fri Jan 14 14:33:30 2022 +0100 HID: uhid: Fix worker destroying device without any protection uhid has to run hid_add_device() from workqueue context while allowing parallel use of the userspace API (which is protected with ->devlock). But hid_add_device() can fail. Currently, that is handled by immediately destroying the associated HID device, without using ->devlock - but if there are concurrent requests from userspace, that's wrong and leads to NULL dereferences and/or memory corruption (via use-after-free). Fix it by leaving the HID device as-is in the worker. We can clean it up later, either in the UHID_DESTROY command handler or in the ->release() handler. Cc: stable@vger.kernel.org Fixes: 67f8ecc550b5 ("HID: uhid: fix timeout when probe races with IO") Signed-off-by: Jann Horn Signed-off-by: Jiri Kosina commit baa59504c1cd0cca7d41954a45ee0b3dc78e41a0 Author: Tom Rix Date: Tue Jan 18 05:41:10 2022 -0800 net: mscc: ocelot: fix using match before it is set Clang static analysis reports this issue ocelot_flower.c:563:8: warning: 1st function call argument is an uninitialized value !is_zero_ether_addr(match.mask->dst)) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The variable match is used before it is set. So move the block. Fixes: 75944fda1dfe ("net: mscc: ocelot: offload ingress skbedit and vlan actions to VCAP IS1") Signed-off-by: Tom Rix Signed-off-by: David S. Miller commit f1131b9c23fb4a3540a774828ff49f421619f902 Author: Claudiu Beznea Date: Tue Jan 18 13:08:12 2022 +0200 net: phy: micrel: use kszphy_suspend()/kszphy_resume for irq aware devices On a setup with KSZ9131 and MACB drivers it happens on suspend path, from time to time, that the PHY interrupt arrives after PHY and MACB were suspended (PHY via genphy_suspend(), MACB via macb_suspend()). In this case the phy_read() at the beginning of kszphy_handle_interrupt() will fail (as MACB driver is suspended at this time) leading to phy_error() being called and a stack trace being displayed on console. To solve this .suspend/.resume functions for all KSZ devices implementing .handle_interrupt were replaced with kszphy_suspend()/kszphy_resume() which disable/enable interrupt before/after calling genphy_suspend()/genphy_resume(). The fix has been adapted for all KSZ devices which implements .handle_interrupt but it has been tested only on KSZ9131. Fixes: 59ca4e58b917 ("net: phy: micrel: implement generic .handle_interrupt() callback") Signed-off-by: Claudiu Beznea Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 1771afd47430f5e95c9c3a2e3a8a63e67402d3fe Author: Ard Biesheuvel Date: Tue Jan 18 11:22:04 2022 +0100 net: cpsw: avoid alignment faults by taking NET_IP_ALIGN into account Both versions of the CPSW driver declare a CPSW_HEADROOM_NA macro that takes NET_IP_ALIGN into account, but fail to use it appropriately when storing incoming packets in memory. This results in the IPv4 source and destination addresses to appear misaligned in memory, which causes aligment faults that need to be fixed up in software. So let's switch from CPSW_HEADROOM to CPSW_HEADROOM_NA where needed. This gets rid of any alignment faults on the RX path on a Beaglebone White. Fixes: 9ed4050c0d75 ("net: ethernet: ti: cpsw: add XDP support") Cc: Grygorii Strashko Cc: Ilias Apalodimas Signed-off-by: Ard Biesheuvel Signed-off-by: David S. Miller commit dded08927ca3c31a5c37f8e7f95fe98770475dd4 Author: Krzysztof Kozlowski Date: Wed Jan 19 08:48:16 2022 +0100 nfc: llcp: fix NULL error pointer dereference on sendmsg() after failed bind() Syzbot detected a NULL pointer dereference of nfc_llcp_sock->dev pointer (which is a 'struct nfc_dev *') with calls to llcp_sock_sendmsg() after a failed llcp_sock_bind(). The message being sent is a SOCK_DGRAM. KASAN report: BUG: KASAN: null-ptr-deref in nfc_alloc_send_skb+0x2d/0xc0 Read of size 4 at addr 00000000000005c8 by task llcp_sock_nfc_a/899 CPU: 5 PID: 899 Comm: llcp_sock_nfc_a Not tainted 5.16.0-rc6-next-20211224-00001-gc6437fbf18b0 #125 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-2 04/01/2014 Call Trace: dump_stack_lvl+0x45/0x59 ? nfc_alloc_send_skb+0x2d/0xc0 __kasan_report.cold+0x117/0x11c ? mark_lock+0x480/0x4f0 ? nfc_alloc_send_skb+0x2d/0xc0 kasan_report+0x38/0x50 nfc_alloc_send_skb+0x2d/0xc0 nfc_llcp_send_ui_frame+0x18c/0x2a0 ? nfc_llcp_send_i_frame+0x230/0x230 ? __local_bh_enable_ip+0x86/0xe0 ? llcp_sock_connect+0x470/0x470 ? llcp_sock_connect+0x470/0x470 sock_sendmsg+0x8e/0xa0 ____sys_sendmsg+0x253/0x3f0 ... The issue was visible only with multiple simultaneous calls to bind() and sendmsg(), which resulted in most of the bind() calls to fail. The bind() was failing on checking if there is available WKS/SDP/SAP (respective bit in 'struct nfc_llcp_local' fields). When there was no available WKS/SDP/SAP, the bind returned error but the sendmsg() to such socket was able to trigger mentioned NULL pointer dereference of nfc_llcp_sock->dev. The code looks simply racy and currently it protects several paths against race with checks for (!nfc_llcp_sock->local) which is NULL-ified in error paths of bind(). The llcp_sock_sendmsg() did not have such check but called function nfc_llcp_send_ui_frame() had, although not protected with lock_sock(). Therefore the race could look like (same socket is used all the time): CPU0 CPU1 ==== ==== llcp_sock_bind() - lock_sock() - success - release_sock() - return 0 llcp_sock_sendmsg() - lock_sock() - release_sock() llcp_sock_bind(), same socket - lock_sock() - error - nfc_llcp_send_ui_frame() - if (!llcp_sock->local) - llcp_sock->local = NULL - nfc_put_device(dev) - dereference llcp_sock->dev - release_sock() - return -ERRNO The nfc_llcp_send_ui_frame() checked llcp_sock->local outside of the lock, which is racy and ineffective check. Instead, its caller llcp_sock_sendmsg(), should perform the check inside lock_sock(). Reported-and-tested-by: syzbot+7f23bcddf626e0593a39@syzkaller.appspotmail.com Fixes: b874dec21d1c ("NFC: Implement LLCP connection less Tx path") Cc: Signed-off-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit 8c8963b27e685ec5d45696e51f95947a8c413727 Merge: 99845220d3c3b 2d19c3fd80178 Author: David S. Miller Date: Wed Jan 19 11:29:15 2022 +0000 Merge branch 'axienet-fixes' Robert Hancock says: ==================== Xilinx axienet fixes Various fixes for the Xilinx AXI Ethernet driver. Changed since v2: -added Reviewed-by tags, added some explanation to commit messages, no code changes Changed since v1: -corrected a Fixes tag to point to mainline commit -split up reset changes into 3 patches -added ratelimit on netdev_warn in TX busy case ==================== Signed-off-by: David S. Miller commit 2d19c3fd80178160dd505ccd7fed1643831227a5 Author: Robert Hancock Date: Tue Jan 18 15:41:32 2022 -0600 net: axienet: increase default TX ring size to 128 With previous changes to make the driver handle the TX ring size more correctly, the default TX ring size of 64 appears to significantly bottleneck TX performance to around 600 Mbps on a 1 Gbps link on ZynqMP. Increasing this to 128 seems to bring performance up to near line rate and shouldn't cause excess bufferbloat (this driver doesn't yet support modern byte-based queue management). Fixes: 8a3b7a252dca9 ("drivers/net/ethernet/xilinx: added Xilinx AXI Ethernet driver") Signed-off-by: Robert Hancock Signed-off-by: David S. Miller commit bb193e3db8b86a63f26889c99e14fd30c9ebd72a Author: Robert Hancock Date: Tue Jan 18 15:41:31 2022 -0600 net: axienet: fix for TX busy handling Network driver documentation indicates we should be avoiding returning NETDEV_TX_BUSY from ndo_start_xmit in normal cases, since it requires the packets to be requeued. Instead the queue should be stopped after a packet is added to the TX ring when there may not be enough room for an additional one. Also, when TX ring entries are completed, we should only wake the queue if we know there is room for another full maximally fragmented packet. Print a warning if there is insufficient space at the start of start_xmit, since this should no longer happen. Combined with increasing the default TX ring size (in a subsequent patch), this appears to recover the TX performance lost by previous changes to actually manage the TX ring state properly. Fixes: 8a3b7a252dca9 ("drivers/net/ethernet/xilinx: added Xilinx AXI Ethernet driver") Signed-off-by: Robert Hancock Signed-off-by: David S. Miller commit aba57a823d2985a2cc8c74a2535f3a88e68d9424 Author: Robert Hancock Date: Tue Jan 18 15:41:30 2022 -0600 net: axienet: fix number of TX ring slots for available check The check for the number of available TX ring slots was off by 1 since a slot is required for the skb header as well as each fragment. This could result in overwriting a TX ring slot that was still in use. Fixes: 8a3b7a252dca9 ("drivers/net/ethernet/xilinx: added Xilinx AXI Ethernet driver") Signed-off-by: Robert Hancock Signed-off-by: David S. Miller commit 996defd7f8b5dafc1d480b7585c7c62437f80c3c Author: Robert Hancock Date: Tue Jan 18 15:41:29 2022 -0600 net: axienet: Fix TX ring slot available check The check for whether a TX ring slot was available was incorrect, since a slot which had been loaded with transmit data but the device had not started transmitting would be treated as available, potentially causing non-transmitted slots to be overwritten. The control field in the descriptor should be checked, rather than the status field (which may only be updated when the device completes the entry). Fixes: 8a3b7a252dca9 ("drivers/net/ethernet/xilinx: added Xilinx AXI Ethernet driver") Signed-off-by: Robert Hancock Signed-off-by: David S. Miller commit 70f5817deddbc6ef3faa35841cab83c280cc653a Author: Robert Hancock Date: Tue Jan 18 15:41:28 2022 -0600 net: axienet: limit minimum TX ring size The driver will not work properly if the TX ring size is set to below MAX_SKB_FRAGS + 1 since it needs to hold at least one full maximally fragmented packet in the TX ring. Limit setting the ring size to below this value. Fixes: 8b09ca823ffb4 ("net: axienet: Make RX/TX ring sizes configurable") Signed-off-by: Robert Hancock Signed-off-by: David S. Miller commit 95978df6fa328df619c15312e65ece469c2be2d2 Author: Robert Hancock Date: Tue Jan 18 15:41:27 2022 -0600 net: axienet: add missing memory barriers This driver was missing some required memory barriers: Use dma_rmb to ensure we see all updates to the descriptor after we see that an entry has been completed. Use wmb and rmb to avoid stale descriptor status between the TX path and TX complete IRQ path. Fixes: 8a3b7a252dca9 ("drivers/net/ethernet/xilinx: added Xilinx AXI Ethernet driver") Signed-off-by: Robert Hancock Signed-off-by: David S. Miller commit 04cc2da39698efd7eb2e30c112538922d26f848e Author: Robert Hancock Date: Tue Jan 18 15:41:26 2022 -0600 net: axienet: reset core on initialization prior to MDIO access In some cases where the Xilinx Ethernet core was used in 1000Base-X or SGMII modes, which use the internal PCS/PMA PHY, and the MGT transceiver clock source for the PCS was not running at the time the FPGA logic was loaded, the core would come up in a state where the PCS could not be found on the MDIO bus. To fix this, the Ethernet core (including the PCS) should be reset after enabling the clocks, prior to attempting to access the PCS using of_mdio_find_device. Fixes: 1a02556086fc (net: axienet: Properly handle PCS/PMA PHY for 1000BaseX mode) Signed-off-by: Robert Hancock Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit b400c2f4f4c53c86594dd57098970d97d488bfde Author: Robert Hancock Date: Tue Jan 18 15:41:25 2022 -0600 net: axienet: Wait for PhyRstCmplt after core reset When resetting the device, wait for the PhyRstCmplt bit to be set in the interrupt status register before continuing initialization, to ensure that the core is actually ready. When using an external PHY, this also ensures we do not start trying to access the PHY while it is still in reset. The PHY reset is initiated by the core reset which is triggered just above, but remains asserted for 5ms after the core is reset according to the documentation. The MgtRdy bit could also be waited for, but unfortunately when using 7-series devices, the bit does not appear to work as documented (it seems to behave as some sort of link state indication and not just an indication the transceiver is ready) so it can't really be relied on for this purpose. Fixes: 8a3b7a252dca9 ("drivers/net/ethernet/xilinx: added Xilinx AXI Ethernet driver") Signed-off-by: Robert Hancock Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 2e5644b1bab2ccea9cfc7a9520af95b94eb0dbf1 Author: Robert Hancock Date: Tue Jan 18 15:41:24 2022 -0600 net: axienet: increase reset timeout The previous timeout of 1ms was too short to handle some cases where the core is reset just after the input clocks were started, which will be introduced in an upcoming patch. Increase the timeout to 50ms. Also simplify the reset timeout checking to use read_poll_timeout. Fixes: 8a3b7a252dca9 ("drivers/net/ethernet/xilinx: added Xilinx AXI Ethernet driver") Signed-off-by: Robert Hancock Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 9f80ccda53b9417236945bc7ece4b519037df74d Author: Ard Biesheuvel Date: Tue Jan 18 19:32:17 2022 +0100 ARM: 9180/1: Thumb2: align ALT_UP() sections in modules sufficiently When building for Thumb2, the .alt.smp.init sections that are emitted by the ALT_UP() patching code may not be 32-bit aligned, even though the fixup_smp_on_up() routine expects that. This results in alignment faults at module load time, which need to be fixed up by the fault handler. So let's align those sections explicitly, and prevent this from occurring. Cc: Signed-off-by: Ard Biesheuvel Signed-off-by: Russell King (Oracle) commit 15420269b02a63ed8c1841905d8b8b2403246004 Author: Ard Biesheuvel Date: Tue Jan 18 13:45:09 2022 +0100 ARM: 9179/1: uaccess: avoid alignment faults in copy_[from|to]_kernel_nofault The helpers that are used to implement copy_from_kernel_nofault() and copy_to_kernel_nofault() cast a void* to a pointer to a wider type, which may result in alignment faults on ARM if the compiler decides to use double-word or multiple-word load/store instructions. Only configurations that define CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y are affected, given that commit 2423de2e6f4d ("ARM: 9115/1: mm/maccess: fix unaligned copy_{from,to}_kernel_nofault") ensures that dst and src are sufficiently aligned otherwise. So use the unaligned accessors for accessing dst and src in cases where they may be misaligned. Cc: # depends on 2423de2e6f4d Fixes: 2df4c9a741a0 ("ARM: 9112/1: uaccess: add __{get,put}_kernel_nofault") Reviewed-by: Arnd Bergmann Signed-off-by: Ard Biesheuvel Signed-off-by: Russell King (Oracle) commit 8b59b0a53c840921b625378f137e88adfa87647e Author: sparkhuang Date: Wed Dec 15 10:08:23 2021 +0100 ARM: 9170/1: fix panic when kasan and kprobe are enabled arm32 uses software to simulate the instruction replaced by kprobe. some instructions may be simulated by constructing assembly functions. therefore, before executing instruction simulation, it is necessary to construct assembly function execution environment in C language through binding registers. after kasan is enabled, the register binding relationship will be destroyed, resulting in instruction simulation errors and causing kernel panic. the kprobe emulate instruction function is distributed in three files: actions-common.c actions-arm.c actions-thumb.c, so disable KASAN when compiling these files. for example, use kprobe insert on cap_capable+20 after kasan enabled, the cap_capable assembly code is as follows: : e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr} e1a05000 mov r5, r0 e280006c add r0, r0, #108 ; 0x6c e1a04001 mov r4, r1 e1a06002 mov r6, r2 e59fa090 ldr sl, [pc, #144] ; ebfc7bf8 bl c03aa4b4 <__asan_load4> e595706c ldr r7, [r5, #108] ; 0x6c e2859014 add r9, r5, #20 ...... The emulate_ldr assembly code after enabling kasan is as follows: c06f1384 : e92d47f0 push {r4, r5, r6, r7, r8, r9, sl, lr} e282803c add r8, r2, #60 ; 0x3c e1a05000 mov r5, r0 e7e37855 ubfx r7, r5, #16, #4 e1a00008 mov r0, r8 e1a09001 mov r9, r1 e1a04002 mov r4, r2 ebf35462 bl c03c6530 <__asan_load4> e357000f cmp r7, #15 e7e36655 ubfx r6, r5, #12, #4 e205a00f and sl, r5, #15 0a000001 beq c06f13bc e0840107 add r0, r4, r7, lsl #2 ebf3545c bl c03c6530 <__asan_load4> e084010a add r0, r4, sl, lsl #2 ebf3545a bl c03c6530 <__asan_load4> e2890010 add r0, r9, #16 ebf35458 bl c03c6530 <__asan_load4> e5990010 ldr r0, [r9, #16] e12fff30 blx r0 e356000f cm r6, #15 1a000014 bne c06f1430 e1a06000 mov r6, r0 e2840040 add r0, r4, #64 ; 0x40 ...... when running in emulate_ldr to simulate the ldr instruction, panic occurred, and the log is as follows: Unable to handle kernel NULL pointer dereference at virtual address 00000090 pgd = ecb46400 [00000090] *pgd=2e0fa003, *pmd=00000000 Internal error: Oops: 206 [#1] SMP ARM PC is at cap_capable+0x14/0xb0 LR is at emulate_ldr+0x50/0xc0 psr: 600d0293 sp : ecd63af8 ip : 00000004 fp : c0a7c30c r10: 00000000 r9 : c30897f4 r8 : ecd63cd4 r7 : 0000000f r6 : 0000000a r5 : e59fa090 r4 : ecd63c98 r3 : c06ae294 r2 : 00000000 r1 : b7611300 r0 : bf4ec008 Flags: nZCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment user Control: 32c5387d Table: 2d546400 DAC: 55555555 Process bash (pid: 1643, stack limit = 0xecd60190) (cap_capable) from (kprobe_handler+0x218/0x340) (kprobe_handler) from (kprobe_trap_handler+0x24/0x48) (kprobe_trap_handler) from (do_undefinstr+0x13c/0x364) (do_undefinstr) from (__und_svc_finish+0x0/0x30) (__und_svc_finish) from (cap_capable+0x18/0xb0) (cap_capable) from (cap_vm_enough_memory+0x38/0x48) (cap_vm_enough_memory) from (security_vm_enough_memory_mm+0x48/0x6c) (security_vm_enough_memory_mm) from (copy_process.constprop.5+0x16b4/0x25c8) (copy_process.constprop.5) from (_do_fork+0xe8/0x55c) (_do_fork) from (SyS_clone+0x1c/0x24) (SyS_clone) from (__sys_trace_return+0x0/0x10) Code: 0050a0e1 6c0080e2 0140a0e1 0260a0e1 (f801f0e7) Fixes: 35aa1df43283 ("ARM kprobes: instruction single-stepping support") Fixes: 421015713b30 ("ARM: 9017/2: Enable KASan for ARM") Signed-off-by: huangshaobo Acked-by: Ard Biesheuvel Signed-off-by: Russell King (Oracle) commit 1d1df41c5a33359a00e919d54eaebfb789711fdc Merge: e9f5cbc0c851c 5fed0be8583f0 Author: Linus Torvalds Date: Wed Jan 19 11:50:20 2022 +0200 Merge tag 'f2fs-for-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs Pull f2fs updates from Jaegeuk Kim: "In this round, we've tried to address some performance issues in f2fs_checkpoint and direct IO flows. Also, there was a work to enhance the page cache management used for compression. Other than them, we've done typical work including sysfs, code clean-ups, tracepoint, sanity check, in addition to bug fixes on corner cases. Enhancements: - use iomap for direct IO - try to avoid lock contention to improve f2fs_ckpt speed - avoid unnecessary memory allocation in compression flow - POSIX_FADV_DONTNEED drops the page cache containing compression pages - add some sysfs entries (gc_urgent_high_remaining, pending_discard) Bug fixes: - try not to expose unwritten blocks to user by DIO (this was added to avoid merge conflict; another patch is coming to address other missing case) - relax minor error condition for file pinning feature used in Android OTA - fix potential deadlock case in compression flow - should not truncate any block on pinned file In addition, we've done some code clean-ups and tracepoint/sanity check improvement" * tag 'f2fs-for-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: (29 commits) f2fs: do not allow partial truncation on pinned file f2fs: remove redunant invalidate compress pages f2fs: Simplify bool conversion f2fs: don't drop compressed page cache in .{invalidate,release}page f2fs: fix to reserve space for IO align feature f2fs: fix to check available space of CP area correctly in update_ckpt_flags() f2fs: support fault injection to f2fs_trylock_op() f2fs: clean up __find_inline_xattr() with __find_xattr() f2fs: fix to do sanity check on last xattr entry in __f2fs_setxattr() f2fs: do not bother checkpoint by f2fs_get_node_info f2fs: avoid down_write on nat_tree_lock during checkpoint f2fs: compress: fix potential deadlock of compress file f2fs: avoid EINVAL by SBI_NEED_FSCK when pinning a file f2fs: add gc_urgent_high_remaining sysfs node f2fs: fix to do sanity check in is_alive() f2fs: fix to avoid panic in is_alive() if metadata is inconsistent f2fs: fix to do sanity check on inode type during garbage collection f2fs: avoid duplicate call of mark_inode_dirty f2fs: show number of pending discard commands f2fs: support POSIX_FADV_DONTNEED drop compressed page cache ... commit e9f5cbc0c851c1cf98e4ecc5d72b5563d3fc5605 Merge: f1b744f65e2f9 35140d399db2b Author: Linus Torvalds Date: Wed Jan 19 11:44:34 2022 +0200 Merge tag 'trace-v5.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing fix from Steven Rostedt: "tracing/scripts: Possible uninitialized variable The 0day bot discovered a possible uninitialized path in the scripts that sort the mcount sections at build time. Just needed to initialize that variable" * tag 'trace-v5.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: script/sorttable: Fix some initialization problems commit f1b744f65e2f9682347c5faf6377e61e2ab19a67 Merge: fd6f57bfda7c3 b579dfe71a6a5 Author: Linus Torvalds Date: Wed Jan 19 11:38:21 2022 +0200 Merge tag 'riscv-for-linus-5.17-mw0' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux Pull RISC-V updates from Palmer Dabbelt: - Support for the DA9063 as used on the HiFive Unmatched. - Support for relative extables, which puts us in line with other architectures and save some space in vmlinux. - A handful of kexec fixes/improvements, including the ability to run crash kernels from PCI-addressable memory on the HiFive Unmatched. - Support for the SBI SRST extension, which allows systems that do not have an explicit driver in Linux to reboot. - A handful of fixes and cleanups, including to the defconfigs and device trees. * tag 'riscv-for-linus-5.17-mw0' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: (52 commits) RISC-V: Use SBI SRST extension when available riscv: mm: fix wrong phys_ram_base value for RV64 RISC-V: Use common riscv_cpuid_to_hartid_mask() for both SMP=y and SMP=n riscv: head: remove useless __PAGE_ALIGNED_BSS and .balign riscv: errata: alternative: mark vendor_patch_func __initdata riscv: head: make secondary_start_common() static riscv: remove cpu_stop() riscv: try to allocate crashkern region from 32bit addressible memory riscv: use hart id instead of cpu id on machine_kexec riscv: Don't use va_pa_offset on kdump riscv: dts: sifive: fu540-c000: Fix PLIC node riscv: dts: sifive: fu540-c000: Drop bogus soc node compatible values riscv: dts: sifive: Group tuples in register properties riscv: dts: sifive: Group tuples in interrupt properties riscv: dts: microchip: mpfs: Group tuples in interrupt properties riscv: dts: microchip: mpfs: Fix clock controller node riscv: dts: microchip: mpfs: Fix reference clock node riscv: dts: microchip: mpfs: Fix PLIC node riscv: dts: microchip: mpfs: Drop empty chosen node riscv: dts: canaan: Group tuples in interrupt properties ... commit fd6f57bfda7c36f2d465cee39d5d8c623db5d7aa Merge: 0ed905975612e c4d7f40b250c1 Author: Linus Torvalds Date: Wed Jan 19 11:15:19 2022 +0200 Merge tag 'kbuild-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild Pull Kbuild updates from Masahiro Yamada: - Add new kconfig target 'make mod2noconfig', which will be useful to speed up the build and test iteration. - Raise the minimum supported version of LLVM to 11.0.0 - Refactor certs/Makefile - Change the format of include/config/auto.conf to stop double-quoting string type CONFIG options. - Fix ARCH=sh builds in dash - Separate compression macros for general purposes (cmd_bzip2 etc.) and the ones for decompressors (cmd_bzip2_with_size etc.) - Misc Makefile cleanups * tag 'kbuild-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (34 commits) kbuild: add cmd_file_size arch: decompressor: remove useless vmlinux.bin.all-y kbuild: rename cmd_{bzip2,lzma,lzo,lz4,xzkern,zstd22} kbuild: drop $(size_append) from cmd_zstd sh: rename suffix-y to suffix_y doc: kbuild: fix default in `imply` table microblaze: use built-in function to get CPU_{MAJOR,MINOR,REV} certs: move scripts/extract-cert to certs/ kbuild: do not quote string values in include/config/auto.conf kbuild: do not include include/config/auto.conf from shell scripts certs: simplify $(srctree)/ handling and remove config_filename macro kbuild: stop using config_filename in scripts/Makefile.modsign certs: remove misleading comments about GCC PR certs: refactor file cleaning certs: remove unneeded -I$(srctree) option for system_certificates.o certs: unify duplicated cmd_extract_certs and improve the log certs: use $< and $@ to simplify the key generation rule kbuild: remove headers_check stub kbuild: move headers_check.pl to usr/include/ certs: use if_changed to re-generate the key when the key type is changed ... commit 0a3d12ab5097b1d045e693412e6b366b7e82031b Author: Padmanabha Srinivasaiah Date: Tue Jan 18 01:51:26 2022 +0100 drm/vc4: Fix deadlock on DSI device attach error DSI device attach to DSI host will be done with host device's lock held. Un-registering host in "device attach" error path (ex: probe retry) will result in deadlock with below call trace and non operational DSI display. Startup Call trace: [ 35.043036] rt_mutex_slowlock.constprop.21+0x184/0x1b8 [ 35.043048] mutex_lock_nested+0x7c/0xc8 [ 35.043060] device_del+0x4c/0x3e8 [ 35.043075] device_unregister+0x20/0x40 [ 35.043082] mipi_dsi_remove_device_fn+0x18/0x28 [ 35.043093] device_for_each_child+0x68/0xb0 [ 35.043105] mipi_dsi_host_unregister+0x40/0x90 [ 35.043115] vc4_dsi_host_attach+0xf0/0x120 [vc4] [ 35.043199] mipi_dsi_attach+0x30/0x48 [ 35.043209] tc358762_probe+0x128/0x164 [tc358762] [ 35.043225] mipi_dsi_drv_probe+0x28/0x38 [ 35.043234] really_probe+0xc0/0x318 [ 35.043244] __driver_probe_device+0x80/0xe8 [ 35.043254] driver_probe_device+0xb8/0x118 [ 35.043263] __device_attach_driver+0x98/0xe8 [ 35.043273] bus_for_each_drv+0x84/0xd8 [ 35.043281] __device_attach+0xf0/0x150 [ 35.043290] device_initial_probe+0x1c/0x28 [ 35.043300] bus_probe_device+0xa4/0xb0 [ 35.043308] deferred_probe_work_func+0xa0/0xe0 [ 35.043318] process_one_work+0x254/0x700 [ 35.043330] worker_thread+0x4c/0x448 [ 35.043339] kthread+0x19c/0x1a8 [ 35.043348] ret_from_fork+0x10/0x20 Shutdown Call trace: [ 365.565417] Call trace: [ 365.565423] __switch_to+0x148/0x200 [ 365.565452] __schedule+0x340/0x9c8 [ 365.565467] schedule+0x48/0x110 [ 365.565479] schedule_timeout+0x3b0/0x448 [ 365.565496] wait_for_completion+0xac/0x138 [ 365.565509] __flush_work+0x218/0x4e0 [ 365.565523] flush_work+0x1c/0x28 [ 365.565536] wait_for_device_probe+0x68/0x158 [ 365.565550] device_shutdown+0x24/0x348 [ 365.565561] kernel_restart_prepare+0x40/0x50 [ 365.565578] kernel_restart+0x20/0x70 [ 365.565591] __do_sys_reboot+0x10c/0x220 [ 365.565605] __arm64_sys_reboot+0x2c/0x38 [ 365.565619] invoke_syscall+0x4c/0x110 [ 365.565634] el0_svc_common.constprop.3+0xfc/0x120 [ 365.565648] do_el0_svc+0x2c/0x90 [ 365.565661] el0_svc+0x4c/0xf0 [ 365.565671] el0t_64_sync_handler+0x90/0xb8 [ 365.565682] el0t_64_sync+0x180/0x184 Signed-off-by: Padmanabha Srinivasaiah Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220118005127.29015-1-treasure4paddy@gmail.com commit 0ed905975612ea67224af26fd6bfbac965b6d029 Merge: 39b419eaf0df0 a254a0e4093fc Author: Linus Torvalds Date: Wed Jan 19 10:39:11 2022 +0200 Merge branch 'random-5.17-rc1-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random Pull random number generator fixes from Jason Donenfeld: - Some Kconfig changes resulted in BIG_KEYS being unselectable, which Justin sent a patch to fix. - Geert pointed out that moving to BLAKE2s bloated vmlinux on little machines, like m68k, so we now compensate for this. - Numerous style and house cleaning fixes, meant to have a cleaner base for future changes. * 'random-5.17-rc1-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random: random: simplify arithmetic function flow in account() random: selectively clang-format where it makes sense random: access input_pool_data directly rather than through pointer random: cleanup fractional entropy shift constants random: prepend remaining pool constants with POOL_ random: de-duplicate INPUT_POOL constants random: remove unused OUTPUT_POOL constants random: rather than entropy_store abstraction, use global random: remove unused extract_entropy() reserved argument random: remove incomplete last_data logic random: cleanup integer types random: cleanup poolinfo abstraction random: fix typo in comments lib/crypto: sha1: re-roll loops to reduce code size lib/crypto: blake2s: move hmac construction into wireguard lib/crypto: add prompts back to crypto libraries commit 39b419eaf0df0de720ed417e785e6c0b004b0a51 Merge: 99613159ad749 60630924bb5af Author: Linus Torvalds Date: Wed Jan 19 10:29:20 2022 +0200 Merge tag 'hwlock-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux Pull hwspinlock updates from Bjorn Andersson: "This contains a change to the stm32 hwspinlock driver to ensure that the hardware is operational even without CONFIG_PM" * tag 'hwlock-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux: hwspinlock: stm32: enable clock at probe commit a1222ca0681f1db3696d703aa8df61c8b41a61ac Author: Kalle Valo Date: Mon Jan 17 20:19:58 2022 +0200 MAINTAINERS: remove extra wireless section There's an unneeded and almost empty wireless section in MAINTAINERS, seems to be leftovers from commit 0e324cf640fb ("MAINTAINERS: changes for wireless"). I don't see any need for that so let's remove it. Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220117181958.3509-2-kvalo@kernel.org commit 51b667a32d616c399124328be97833ec154e0ff8 Author: Kalle Valo Date: Mon Jan 17 20:19:57 2022 +0200 MAINTAINERS: add common wireless and wireless-next trees For easier maintenance we have decided to create common wireless and wireless-next trees for all wireless patches. Old mac80211 and wireless-drivers trees will not be used anymore. While at it, add a wiki link to wireless drivers section and a patchwork link to 802.11, mac80211 and rfkill sections. Also use https in patchwork links. Acked-by: Johannes Berg Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20220117181958.3509-1-kvalo@kernel.org commit 99845220d3c3bd021819c5fea3d7cb55b2556296 Merge: 2836615aa22de 37c8d4807d1b8 Author: Jakub Kicinski Date: Tue Jan 18 19:28:28 2022 -0800 Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf Daniel Borkmann says: ==================== pull-request: bpf 2022-01-19 We've added 12 non-merge commits during the last 8 day(s) which contain a total of 12 files changed, 262 insertions(+), 64 deletions(-). The main changes are: 1) Various verifier fixes mainly around register offset handling when passed to helper functions, from Daniel Borkmann. 2) Fix XDP BPF link handling to assert program type, from Toke Høiland-Jørgensen. 3) Fix regression in mount parameter handling for BPF fs, from Yafang Shao. 4) Fix incorrect integer literal when marking scratched stack slots in verifier, from Christy Lee. * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf: bpf, selftests: Add ringbuf memory type confusion test bpf, selftests: Add various ringbuf tests with invalid offset bpf: Fix ringbuf memory type confusion when passing to helpers bpf: Fix out of bounds access for ringbuf helpers bpf: Generally fix helper register offset check bpf: Mark PTR_TO_FUNC register initially with zero offset bpf: Generalize check_ctx_reg for reuse with other types bpf: Fix incorrect integer literal used for marking scratched stack. bpf/selftests: Add check for updating XDP bpf_link with wrong program type bpf/selftests: convert xdp_link test to ASSERT_* macros xdp: check prog type before updating BPF link bpf: Fix mount source show for bpffs ==================== Link: https://lore.kernel.org/r/20220119011825.9082-1-daniel@iogearbox.net Signed-off-by: Jakub Kicinski commit ccbf726171b7328f800bc98005132fd77eb1a175 Author: Jens Axboe Date: Tue Jan 18 19:11:11 2022 -0700 io_uring: perform poll removal even if async work removal is successful An active work can have poll armed, hence it's not enough to just do the async work removal and return the value if it's different from "not found". Rather than make poll removal special, just fall through to do the remaining type lookups and removals. Reported-by: Florian Fischer Link: https://lore.kernel.org/io-uring/20220118151337.fac6cthvbnu7icoc@pasture/ Signed-off-by: Jens Axboe commit 361aee450c6e36c8dbab712c94a8a7835bd92e25 Author: Jens Axboe Date: Tue Jan 18 19:23:51 2022 -0700 io-wq: add intermediate work step between pending list and active work We have a gap where a worker removes an item from the work list and to when it gets added as the workers active work. In this state, the work item cannot be found by cancelations. This is a small window, but it does exist. Add a temporary pointer to a work item that isn't on the pending work list anymore, but also not the active work. This is needed as we need to drop the wqe lock in between grabbing the work item and marking it as active, to ensure that signal based cancelations are properly ordered. Reported-by: Florian Fischer Link: https://lore.kernel.org/io-uring/20220118151337.fac6cthvbnu7icoc@pasture/ Signed-off-by: Jens Axboe commit efdf518459b17e18a93c7c9cb622fd3051dabd0c Author: Jens Axboe Date: Tue Jan 18 19:22:32 2022 -0700 io-wq: perform both unstarted and started work cancelations in one go Rather than split these into two separate lookups and matches, combine them into one loop. This will become important when we can guarantee that we don't have a window where a pending work item isn't discoverable in either state. Signed-off-by: Jens Axboe commit 36e4c58bf044b07204c8c7e6dd7c2384e439921a Author: Jens Axboe Date: Tue Jan 18 19:18:20 2022 -0700 io-wq: invoke work cancelation with wqe->lock held io_wqe_cancel_pending_work() grabs it internally, grab it upfront instead. For the running work cancelation, grab the lock around it as well. Signed-off-by: Jens Axboe commit 081b58204629eff9dd93e7f68ed15c8aa6452a4b Author: Jens Axboe Date: Tue Jan 18 19:13:43 2022 -0700 io-wq: make io_worker lock a raw spinlock In preparation to nesting it under the wqe lock (which is raw due to being acquired from the scheduler side), change the io_worker lock from a normal spinlock to a raw spinlock. Signed-off-by: Jens Axboe commit ea6e7ceedaf11e1bad3ff21e8624694d696d276b Author: Jens Axboe Date: Tue Jan 18 19:10:11 2022 -0700 io-wq: remove useless 'work' argument to __io_worker_busy() We don't use 'work' anymore in the busy logic, remove the dead argument. Signed-off-by: Jens Axboe commit 37c8d4807d1b8b521b30310dce97f6695dc2c2c6 Author: Daniel Borkmann Date: Wed Jan 12 12:39:48 2022 +0000 bpf, selftests: Add ringbuf memory type confusion test Add two tests, one which asserts that ring buffer memory can be passed to other helpers for populating its entry area, and another one where verifier rejects different type of memory passed to bpf_ringbuf_submit(). Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Acked-by: Alexei Starovoitov commit 722e4db3ae0d52b2e3801280afbe19cf2d188e91 Author: Daniel Borkmann Date: Mon Jan 10 13:44:18 2022 +0000 bpf, selftests: Add various ringbuf tests with invalid offset Assert that the verifier is rejecting invalid offsets on the ringbuf entries: # ./test_verifier | grep ring #947/u ringbuf: invalid reservation offset 1 OK #947/p ringbuf: invalid reservation offset 1 OK #948/u ringbuf: invalid reservation offset 2 OK #948/p ringbuf: invalid reservation offset 2 OK Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Acked-by: Alexei Starovoitov commit a672b2e36a648afb04ad3bda93b6bda947a479a5 Author: Daniel Borkmann Date: Thu Jan 13 11:11:30 2022 +0000 bpf: Fix ringbuf memory type confusion when passing to helpers The bpf_ringbuf_submit() and bpf_ringbuf_discard() have ARG_PTR_TO_ALLOC_MEM in their bpf_func_proto definition as their first argument, and thus both expect the result from a prior bpf_ringbuf_reserve() call which has a return type of RET_PTR_TO_ALLOC_MEM_OR_NULL. While the non-NULL memory from bpf_ringbuf_reserve() can be passed to other helpers, the two sinks (bpf_ringbuf_submit(), bpf_ringbuf_discard()) right now only enforce a register type of PTR_TO_MEM. This can lead to potential type confusion since it would allow other PTR_TO_MEM memory to be passed into the two sinks which did not come from bpf_ringbuf_reserve(). Add a new MEM_ALLOC composable type attribute for PTR_TO_MEM, and enforce that: - bpf_ringbuf_reserve() returns NULL or PTR_TO_MEM | MEM_ALLOC - bpf_ringbuf_submit() and bpf_ringbuf_discard() only take PTR_TO_MEM | MEM_ALLOC but not plain PTR_TO_MEM arguments via ARG_PTR_TO_ALLOC_MEM - however, other helpers might treat PTR_TO_MEM | MEM_ALLOC as plain PTR_TO_MEM to populate the memory area when they use ARG_PTR_TO_{UNINIT_,}MEM in their func proto description Fixes: 457f44363a88 ("bpf: Implement BPF ring buffer and verifier support for it") Reported-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Acked-by: Alexei Starovoitov commit 64620e0a1e712a778095bd35cbb277dc2259281f Author: Daniel Borkmann Date: Tue Jan 11 14:43:41 2022 +0000 bpf: Fix out of bounds access for ringbuf helpers Both bpf_ringbuf_submit() and bpf_ringbuf_discard() have ARG_PTR_TO_ALLOC_MEM in their bpf_func_proto definition as their first argument. They both expect the result from a prior bpf_ringbuf_reserve() call which has a return type of RET_PTR_TO_ALLOC_MEM_OR_NULL. Meaning, after a NULL check in the code, the verifier will promote the register type in the non-NULL branch to a PTR_TO_MEM and in the NULL branch to a known zero scalar. Generally, pointer arithmetic on PTR_TO_MEM is allowed, so the latter could have an offset. The ARG_PTR_TO_ALLOC_MEM expects a PTR_TO_MEM register type. However, the non- zero result from bpf_ringbuf_reserve() must be fed into either bpf_ringbuf_submit() or bpf_ringbuf_discard() but with the original offset given it will then read out the struct bpf_ringbuf_hdr mapping. The verifier missed to enforce a zero offset, so that out of bounds access can be triggered which could be used to escalate privileges if unprivileged BPF was enabled (disabled by default in kernel). Fixes: 457f44363a88 ("bpf: Implement BPF ring buffer and verifier support for it") Reported-by: (SecCoder Security Lab) Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Acked-by: Alexei Starovoitov commit 6788ab23508bddb0a9d88e104284922cb2c22b77 Author: Daniel Borkmann Date: Mon Jan 10 14:40:40 2022 +0000 bpf: Generally fix helper register offset check Right now the assertion on check_ptr_off_reg() is only enforced for register types PTR_TO_CTX (and open coded also for PTR_TO_BTF_ID), however, this is insufficient since many other PTR_TO_* register types such as PTR_TO_FUNC do not handle/expect register offsets when passed to helper functions. Given this can slip-through easily when adding new types, make this an explicit allow-list and reject all other current and future types by default if this is encountered. Also, extend check_ptr_off_reg() to handle PTR_TO_BTF_ID as well instead of duplicating it. For PTR_TO_BTF_ID, reg->off is used for BTF to match expected BTF ids if struct offset is used. This part still needs to be allowed, but the dynamic off from the tnum must be rejected. Fixes: 69c087ba6225 ("bpf: Add bpf_for_each_map_elem() helper") Fixes: eaa6bcb71ef6 ("bpf: Introduce bpf_per_cpu_ptr()") Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Acked-by: Alexei Starovoitov commit d400a6cf1c8a57cdf10f35220ead3284320d85ff Author: Daniel Borkmann Date: Fri Jan 14 13:58:36 2022 +0000 bpf: Mark PTR_TO_FUNC register initially with zero offset Similar as with other pointer types where we use ldimm64, clear the register content to zero first, and then populate the PTR_TO_FUNC type and subprogno number. Currently this is not done, and leads to reuse of stale register tracking data. Given for special ldimm64 cases we always clear the register offset, make it common for all cases, so it won't be forgotten in future. Fixes: 69c087ba6225 ("bpf: Add bpf_for_each_map_elem() helper") Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Acked-by: Alexei Starovoitov commit be80a1d3f9dbe5aee79a325964f7037fe2d92f30 Author: Daniel Borkmann Date: Mon Jan 10 14:05:49 2022 +0000 bpf: Generalize check_ctx_reg for reuse with other types Generalize the check_ctx_reg() helper function into a more generic named one so that it can be reused for other register types as well to check whether their offset is non-zero. No functional change. Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Acked-by: Alexei Starovoitov commit 4722f463896cc0ef1a6f1c3cb2e171e949831249 Author: Christian König Date: Mon Jan 17 10:31:26 2022 +0100 drm/radeon: fix error handling in radeon_driver_open_kms The return value was never initialized so the cleanup code executed when it isn't even necessary. Just add proper error handling. Fixes: ab50cb9df889 ("drm/radeon/radeon_kms: Fix a NULL pointer dereference in radeon_driver_open_kms()") Signed-off-by: Christian König Tested-by: Jan Stancek Tested-by: Borislav Petkov Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 9a458402fb69bda886aa6cbe067311b6e3d9c52a Author: Jingwen Chen Date: Thu Jan 13 19:06:59 2022 +0800 drm/amd/amdgpu: fixing read wrong pf2vf data in SRIOV [Why] This fixes 892deb48269c ("drm/amdgpu: Separate vf2pf work item init from virt data exchange"). we should read pf2vf data based at mman.fw_vram_usage_va after gmc sw_init. commit 892deb48269c breaks this logic. [How] calling amdgpu_virt_exchange_data in amdgpu_virt_init_data_exchange to set the right base in the right sequence. v2: call amdgpu_virt_init_data_exchange after gmc sw_init to make data exchange workqueue run v3: clean up the code logic v4: add some comment and make the code more readable Fixes: 892deb48269c ("drm/amdgpu: Separate vf2pf work item init from virt data exchange") Signed-off-by: Jingwen Chen Reviewed-by: Horace Chen Signed-off-by: Alex Deucher commit 520d9cd267618181901272a79db6154c0b83309c Author: Guchun Chen Date: Fri Jan 14 13:49:13 2022 +0800 drm/amdgpu: apply vcn harvest quirk This is a following patch to apply the workaround only on those boards with a bad harvest table in ip discovery. Signed-off-by: Guchun Chen Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit ac090d9c90b087d6fb714e54b2a6dd1e6c373ed6 Author: Namjae Jeon Date: Mon Jan 17 22:16:01 2022 +0900 ksmbd: fix guest connection failure with nautilus MS-SMB2 describe session sign like the following. Session.SigningRequired MUST be set to TRUE under the following conditions: - If the SMB2_NEGOTIATE_SIGNING_REQUIRED bit is set in the SecurityMode field of the client request. - If the SMB2_SESSION_FLAG_IS_GUEST bit is not set in the SessionFlags field and Session.IsAnonymous is FALSE and either Connection.ShouldSign or global RequireMessageSigning is TRUE. When trying guest account connection using nautilus, The login failure happened on session setup. ksmbd does not allow this connection when the user is a guest and the connection sign is set. Just do not set session sign instead of error response as described in the specification. And this change improves the guest connection in Nautilus. Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3") Cc: stable@vger.kernel.org # v5.15+ Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit b207602fb04537cb21ac38fabd7577eca2fa05ae Author: Dan Carpenter Date: Sat Jan 15 14:49:00 2022 +0300 ksmbd: uninitialized variable in create_socket() The "ksmbd_socket" variable is not initialized on this error path. Cc: stable@vger.kernel.org Fixes: 0626e6641f6b ("cifsd: add server handler for central processing and tranport layers") Signed-off-by: Dan Carpenter Acked-by: Namjae Jeon Signed-off-by: Steve French commit 2fd5dcb1c8ef96c9f0fa8bda53ca480524b80ae7 Author: Hyunchul Lee Date: Thu Jan 13 09:51:39 2022 +0900 ksmbd: smbd: fix missing client's memory region invalidation if the Channel of a SMB2 WRITE request is SMB2_CHANNEL_RDMA_V1_INVALIDTE, a client does not invalidate its memory regions but ksmbd must do it by sending a SMB2 WRITE response with IB_WR_SEND_WITH_INV. But if errors occur while processing a SMB2 READ/WRITE request, ksmbd sends a response with IB_WR_SEND. So a client could use memory regions already in use. Acked-by: Namjae Jeon Signed-off-by: Hyunchul Lee Signed-off-by: Steve French commit e4e2787bef7e643511cf0f352deb6bd16e7fa9b4 Author: Steve French Date: Tue Jan 18 16:36:27 2022 -0600 smb3: add new defines from protocol specification In the October updates to MS-SMB2 two additional FSCTLs were described. Add the missing defines for these, as well as fix a typo in an earlier define. Reviewed-by: Ronnie Sahlberg Signed-off-by: Steve French commit 6e7f90d163afa8fc2efd6ae318e7c20156a5621f Author: J. Bruce Fields Date: Tue Jan 18 17:00:16 2022 -0500 lockd: fix server crash on reboot of client holding lock I thought I was iterating over the array when actually the iteration is over the values contained in the array? Ugh, keep it simple. Symptoms were a null deference in vfs_lock_file() when an NFSv3 client that previously held a lock came back up and sent a notify. Reported-by: Jonathan Woithe Fixes: 7f024fcd5c97 ("Keep read and write fds with each nlm_file") Signed-off-by: J. Bruce Fields Signed-off-by: Chuck Lever commit 9c494ca4d3a535f9ca11ad6af1813983c1c6cbdd Author: Lucas De Marchi Date: Thu Jan 13 16:28:39 2022 -0800 x86/gpu: Reserve stolen memory for first integrated Intel GPU "Stolen memory" is memory set aside for use by an Intel integrated GPU. The intel_graphics_quirks() early quirk reserves this memory when it is called for a GPU that appears in the intel_early_ids[] table of integrated GPUs. Previously intel_graphics_quirks() was marked as QFLAG_APPLY_ONCE, so it was called only for the first Intel GPU found. If a discrete GPU happened to be enumerated first, intel_graphics_quirks() was called for it but not for any integrated GPU found later. Therefore, stolen memory for such an integrated GPU was never reserved. For example, this problem occurs in this Alderlake-P (integrated) + DG2 (discrete) topology where the DG2 is found first, but stolen memory is associated with the integrated GPU: - 00:01.0 Bridge `- 03:00.0 DG2 discrete GPU - 00:02.0 Integrated GPU (with stolen memory) Remove the QFLAG_APPLY_ONCE flag and call intel_graphics_quirks() for every Intel GPU. Reserve stolen memory for the first GPU that appears in intel_early_ids[]. [bhelgaas: commit log, add code comment, squash in https://lore.kernel.org/r/20220118190558.2ququ4vdfjuahicm@ldmartin-desk2] Link: https://lore.kernel.org/r/20220114002843.2083382-1-lucas.demarchi@intel.com Signed-off-by: Lucas De Marchi Signed-off-by: Bjorn Helgaas Cc: stable@vger.kernel.org commit a8e422af696133003903e440b87f10a8248051b8 Author: Darrick J. Wong Date: Tue Jan 18 10:18:36 2022 -0800 xfs: remove unused xfs_ioctl32.h declarations Remove these unused ia32 compat declarations; all the bits involved have either been withdrawn or hoisted to the VFS. Signed-off-by: Darrick J. Wong Reviewed-by: Eric Sandeen commit 35140d399db2b67153fc53b51a97ddb8ba3b5956 Author: Yinan Liu Date: Tue Jan 18 14:52:41 2022 +0800 script/sorttable: Fix some initialization problems elf_mcount_loc and mcount_sort_thread definitions are not initialized immediately within the function, which can cause the judgment logic to use uninitialized values when the initialization logic of subsequent code fails. Link: https://lkml.kernel.org/r/20211212113358.34208-2-yinan@linux.alibaba.com Link: https://lkml.kernel.org/r/20220118065241.42364-1-yinan@linux.alibaba.com Fixes: 72b3942a173c ("scripts: ftrace - move the sort-processing in ftrace_init") Tested-by: Nathan Chancellor Reviewed-by: Nathan Chancellor Signed-off-by: Yinan Liu Signed-off-by: Steven Rostedt commit 2836615aa22de55b8fca5e32fe1b27a67cda625e Author: Eric Dumazet Date: Tue Jan 18 03:43:40 2022 -0800 netns: add schedule point in ops_exit_list() When under stress, cleanup_net() can have to dismantle netns in big numbers. ops_exit_list() currently calls many helpers [1] that have no schedule point, and we can end up with soft lockups, particularly on hosts with many cpus. Even for moderate amount of netns processed by cleanup_net() this patch avoids latency spikes. [1] Some of these helpers like fib_sync_up() and fib_sync_down_dev() are very slow because net/ipv4/fib_semantics.c uses host-wide hash tables, and ifindex is used as the only input of two hash functions. ifindexes tend to be the same for all netns (lo.ifindex==1 per instance) This will be fixed in a separate patch. Fixes: 72ad937abd0a ("net: Add support for batching network namespace cleanups") Signed-off-by: Eric Dumazet Cc: Eric W. Biederman Signed-off-by: David S. Miller commit fd9f4e62a39f09a7c014d7415c2b9d1390aa0504 Author: Christoph Hellwig Date: Tue Jan 18 08:04:44 2022 +0100 block: assign bi_bdev for cloned bios in blk_rq_prep_clone bio_clone_fast() sets the cloned bio to have the same ->bi_bdev as the source bio. This means that when request-based dm called setup_clone(), the cloned bio had its ->bi_bdev pointing to the dm device. After Commit 0b6e522cdc4a ("blk-mq: use ->bi_bdev for I/O accounting") __blk_account_io_start() started using the request's ->bio->bi_bdev for I/O accounting, if it was set. This caused IO going to the underlying devices to use the dm device for their I/O accounting. Set up the proper ->bi_bdev in blk_rq_prep_clone based on the whole device bdev for the queue the request is cloned onto. Fixes: 0b6e522cdc4a ("blk-mq: use ->bi_bdev for I/O accounting") Reported-by: Benjamin Marzinski Signed-off-by: Christoph Hellwig [hch: the commit message is mostly from a different patch from Benjamin] Reviewed-by: Ming Lei Reviewed-by: Benjamin Marzinski Link: https://lore.kernel.org/r/20220118070444.1241739-1-hch@lst.de Signed-off-by: Jens Axboe commit 85c25662d18903874fad585d17fc398a7ba37ab0 Author: Uwe Kleine-König Date: Mon Jan 17 23:00:55 2022 +0100 ALSA: hda: cs35l41: Make cs35l41_hda_remove() return void Up to now cs35l41_hda_remove() returns zero unconditionally. Make it return void instead which makes it easier to see in the callers that there is no error to handle. Also the return value of i2c and spi remove callbacks is ignored anyway. Signed-off-by: Uwe Kleine-König Reviewed-by: Lucas Tanure Link: https://lore.kernel.org/r/20220117220055.120955-1-u.kleine-koenig@pengutronix.de Signed-off-by: Takashi Iwai commit 8c286a0f973a81201a0cef72a7ca55eda29fc35c Author: Lucas Tanure Date: Mon Jan 17 16:08:30 2022 +0000 ALSA: hda: cs35l41: Tidyup code Clean up and simplify cs35l41_hda_bind function Signed-off-by: Lucas Tanure Link: https://lore.kernel.org/r/20220117160830.709403-6-tanureal@opensource.cirrus.com Signed-off-by: Takashi Iwai commit a025df02ce424fa77f6bc6aa195db21677e11274 Author: Lucas Tanure Date: Mon Jan 17 16:08:29 2022 +0000 ALSA: hda: cs35l41: Make use of the helper function dev_err_probe() When possible use dev_err_probe help to properly deal with the PROBE_DEFER error, the benefit is that DEFER issue will be logged in the devices_deferred debugfs file. Using dev_err_probe() can reduce code size, and the error value gets printed. Signed-off-by: Lucas Tanure Link: https://lore.kernel.org/r/20220117160830.709403-5-tanureal@opensource.cirrus.com Signed-off-by: Takashi Iwai commit cd8abf7d04c940c627ceb6f416b2142d3e7b36dd Author: Lucas Tanure Date: Mon Jan 17 16:08:28 2022 +0000 ALSA: hda: cs35l41: Add missing default cases Add switch default cases at gpio pins configs Signed-off-by: Lucas Tanure Link: https://lore.kernel.org/r/20220117160830.709403-4-tanureal@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 77dc3a6ee2eb5851535fe3a84fc31bf0705e4a2e Author: Lucas Tanure Date: Mon Jan 17 16:08:27 2022 +0000 ALSA: hda: cs35l41: Move cs35l41* calls to its own symbol namespace Create own namespace and avoid polluting the global namespace Signed-off-by: Lucas Tanure Link: https://lore.kernel.org/r/20220117160830.709403-3-tanureal@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 6e4320d8ecbc8711209b3075f2d896667006fa37 Author: Charles Keepax Date: Mon Jan 17 16:08:26 2022 +0000 ALSA: hda: cs35l41: Add calls to newly added test key function The test key now needs to be manually held when calling cs35l41_register_errata_patch, after patch: Add the missing function calls to this driver. Fixes: f517ba4924ad ("ASoC: cs35l41: Add support for hibernate memory retention mode") Signed-off-by: Charles Keepax Signed-off-by: Lucas Tanure Link: https://lore.kernel.org/r/20220117160830.709403-2-tanureal@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 2cb52046d186863e16ac82850c0e225462e493f1 Author: Charles Keepax Date: Mon Jan 17 16:08:25 2022 +0000 ALSA: hda: cs35l41: Avoid overwriting register patch regmap_register_patch can't be used to apply the probe sequence as a patch is already registers with the regmap by cs35l41_register_errata_patch and only a single patch can be attached to a single regmap. The driver doesn't currently rely on a cache sync to re-apply this probe sequence so simply switch it to a multi write. Fixes: 7b2f3eb492da ("ALSA: hda: cs35l41: Add support for CS35L41 in HDA systems") Signed-off-by: Charles Keepax Signed-off-by: Lucas Tanure Link: https://lore.kernel.org/r/20220117160830.709403-1-tanureal@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 0d3d237651fd7a01fe5dc501b0d170a43d8156ba Author: Arnaldo Carvalho de Melo Date: Mon Jan 17 13:09:31 2022 -0300 perf evlist: No need to setup affinities when disabling events for pid targets When the target is a pid, not started by 'perf stat' we need to disable the events, and in that case there is no need to setup affinities as we use a dummy CPU map, with just one entry set to -1. So stop doing it to avoid this needless call to sched_getaffinity(): # strace -ke sched_getaffinity perf stat -e cycles -p 241957 sleep 1 sched_getaffinity(0, 512, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31]) = 8 > /usr/lib64/libc-2.33.so(sched_getaffinity@@GLIBC_2.3.4+0x1a) [0xe6eea] > /var/home/acme/bin/perf(affinity__setup+0x6a) [0x532a2a] > /var/home/acme/bin/perf(__evlist__disable.constprop.0+0x27) [0x4b9827] > /var/home/acme/bin/perf(cmd_stat+0x29b5) [0x431725] > /var/home/acme/bin/perf(run_builtin+0x6a) [0x4a2cfa] > /var/home/acme/bin/perf(main+0x612) [0x40f8c2] > /usr/lib64/libc-2.33.so(__libc_start_main+0xd4) [0x27b74] > /var/home/acme/bin/perf(_start+0x2d) [0x40fadd] Acked-by: Ian Rogers Cc: Adrian Hunter Cc: Andi Kleen Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lore.kernel.org/r/20220117160931.1191712-5-acme@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit f350ee95498a3fa65c37ed597d9c051c6b2b6974 Author: Arnaldo Carvalho de Melo Date: Mon Jan 17 13:09:30 2022 -0300 perf evlist: No need to setup affinities when enabling events for pid targets When the target is a pid, not started by 'perf stat' we need to enable the events, and in that case there is no need to setup affinities as we use a dummy CPU map, with just one entry set to -1. So stop doing it to avoid this needless call to sched_getaffinity(): # strace -ke sched_getaffinity perf stat -e cycles -p 241957 sleep 1 sched_getaffinity(0, 512, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31]) = 8 > /usr/lib64/libc-2.33.so(sched_getaffinity@@GLIBC_2.3.4+0x1a) [0xe6eea] > /var/home/acme/bin/perf(affinity__setup+0x6a) [0x5329ca] > /var/home/acme/bin/perf(__evlist__enable.constprop.0+0x23) [0x4b9693] > /var/home/acme/bin/perf(enable_counters+0x14d) [0x42de5d] > /var/home/acme/bin/perf(cmd_stat+0x2358) [0x4310c8] > /var/home/acme/bin/perf(run_builtin+0x6a) [0x4a2cfa] > /var/home/acme/bin/perf(main+0x612) [0x40f8c2] > /usr/lib64/libc-2.33.so(__libc_start_main+0xd4) [0x27b74] > /var/home/acme/bin/perf(_start+0x2d) [0x40fadd] Acked-by: Ian Rogers Cc: Adrian Hunter Cc: Andi Kleen Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lore.kernel.org/r/20220117160931.1191712-4-acme@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 49de179577e7b05b57f625bf05cdc60a72de38d0 Author: Arnaldo Carvalho de Melo Date: Mon Jan 17 13:09:29 2022 -0300 perf stat: No need to setup affinities when starting a workload I.e. the simple: $ perf stat sleep 1 Uses a dummy CPU map and thus there is no need to setup/cleanup affinities to avoid IPIs, etc. With this we're down to a sched_getaffinity() call, in the libnuma initialization, that probably can be removed in a followup patch. Acked-by: Ian Rogers Cc: Adrian Hunter Cc: Andi Kleen Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lore.kernel.org/r/20220117160931.1191712-3-acme@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 1855b796f2f672cbb25400be2d3171c26fc869a3 Author: Arnaldo Carvalho de Melo Date: Mon Jan 17 13:09:28 2022 -0300 perf affinity: Allow passing a NULL arg to affinity__cleanup() Just like with free(), NULL is checked to avoid having all callers do it. Its convenient for when not using affinity setup/cleanup for dummy CPU maps, i.e. CPU maps for pid targets. Acked-by: Ian Rogers Cc: Adrian Hunter Cc: Andi Kleen Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lore.kernel.org/r/20220117160931.1191712-2-acme@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 4624f199327a704dd1069aca1c3cadb8f2a28c6f Author: Zechuan Chen Date: Tue Dec 28 19:13:38 2021 +0800 perf probe: Fix ppc64 'perf probe add events failed' case Because of commit bf794bf52a80c627 ("powerpc/kprobes: Fix kallsyms lookup across powerpc ABIv1 and ABIv2"), in ppc64 ABIv1, our perf command eliminates the need to use the prefix "." at the symbol name. But when the command "perf probe -a schedule" is executed on ppc64 ABIv1, it obtains two symbol address information through /proc/kallsyms, for example: cat /proc/kallsyms | grep -w schedule c000000000657020 T .schedule c000000000d4fdb8 D schedule The symbol "D schedule" is not a function symbol, and perf will print: "p:probe/schedule _text+13958584"Failed to write event: Invalid argument Therefore, when searching symbols from map and adding probe point for them, a symbol type check is added. If the type of symbol is not a function, skip it. Fixes: bf794bf52a80c627 ("powerpc/kprobes: Fix kallsyms lookup across powerpc ABIv1 and ABIv2") Signed-off-by: Zechuan Chen Acked-by: Masami Hiramatsu Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jianlin Lv Cc: Jin Yao Cc: Jiri Olsa Cc: Mark Rutland Cc: Michael Ellerman Cc: Namhyung Kim Cc: Naveen N. Rao Cc: Peter Zijlstra Cc: Ravi Bangoria Cc: Yang Jihong Link: https://lore.kernel.org/r/20211228111338.218602-1-chenzechuan1@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit a254a0e4093fce8c832414a83940736067eed515 Author: Jason A. Donenfeld Date: Mon Jan 17 18:43:02 2022 +0100 random: simplify arithmetic function flow in account() Now that have_bytes is never modified, we can simplify this function. First, we move the check for negative entropy_count to be first. That ensures that subsequent reads of this will be non-negative. Then, have_bytes and ibytes can be folded into their one use site in the min_t() function. Suggested-by: Dominik Brodowski Reviewed-by: Dominik Brodowski Signed-off-by: Jason A. Donenfeld commit 248045b8dea5a32ddc0aa44193d6bc70c4b9cd8e Author: Jason A. Donenfeld Date: Sat Jan 15 14:57:22 2022 +0100 random: selectively clang-format where it makes sense This is an old driver that has seen a lot of different eras of kernel coding style. In an effort to make it easier to code for, unify the coding style around the current norm, by accepting some of -- but certainly not all of -- the suggestions from clang-format. This should remove ambiguity in coding style, especially with regards to spacing, when code is being changed or amended. Consequently it also makes code review easier on the eyes, following one uniform style rather than several. Reviewed-by: Dominik Brodowski Signed-off-by: Jason A. Donenfeld commit 6c0eace6e1499712583b6ee62d95161e8b3449f5 Author: Jason A. Donenfeld Date: Sat Jan 15 14:40:04 2022 +0100 random: access input_pool_data directly rather than through pointer This gets rid of another abstraction we no longer need. It would be nice if we could instead make pool an array rather than a pointer, but the latent entropy plugin won't be able to do its magic in that case. So instead we put all accesses to the input pool's actual data through the input_pool_data array directly. Reviewed-by: Dominik Brodowski Signed-off-by: Jason A. Donenfeld commit 18263c4e8e62f7329f38f5eadc568751242ca89c Author: Jason A. Donenfeld Date: Thu Jan 13 18:18:48 2022 +0100 random: cleanup fractional entropy shift constants The entropy estimator is calculated in terms of 1/8 bits, which means there are various constants where things are shifted by 3. Move these into our pool info enum with the other relevant constants. While we're at it, move an English assertion about sizes into a proper BUILD_BUG_ON so that the compiler can ensure this invariant. Reviewed-by: Dominik Brodowski Signed-off-by: Jason A. Donenfeld commit b3d51c1f542113342ddfbf6007e38a684b9dbec9 Author: Jason A. Donenfeld Date: Fri Jan 14 16:48:35 2022 +0100 random: prepend remaining pool constants with POOL_ The other pool constants are prepended with POOL_, but not these last ones. Rename them. This will then let us move them into the enum in the following commit. Reviewed-by: Dominik Brodowski Signed-off-by: Jason A. Donenfeld commit 5b87adf30f1464477169a1d653e9baf8c012bbfe Author: Jason A. Donenfeld Date: Thu Jan 13 16:11:21 2022 +0100 random: de-duplicate INPUT_POOL constants We already had the POOL_* constants, so deduplicate the older INPUT_POOL ones. As well, fold EXTRACT_SIZE into the poolinfo enum, since it's related. Reviewed-by: Dominik Brodowski Signed-off-by: Jason A. Donenfeld commit 0f63702718c91d89c922081ac1e6baeddc2d8b1a Author: Jason A. Donenfeld Date: Thu Jan 13 15:51:06 2022 +0100 random: remove unused OUTPUT_POOL constants We no longer have an output pool. Rather, we have just a wakeup bits threshold for /dev/random reads, presumably so that processes don't hang. This value, random_write_wakeup_bits, is configurable anyway. So all the no longer usefully named OUTPUT_POOL constants were doing was setting a reasonable default for random_write_wakeup_bits. This commit gets rid of the constants and just puts it all in the default value of random_write_wakeup_bits. Reviewed-by: Dominik Brodowski Signed-off-by: Jason A. Donenfeld commit 90ed1e67e896cc8040a523f8428fc02f9b164394 Author: Jason A. Donenfeld Date: Wed Jan 12 17:18:08 2022 +0100 random: rather than entropy_store abstraction, use global Originally, the RNG used several pools, so having things abstracted out over a generic entropy_store object made sense. These days, there's only one input pool, and then an uneven mix of usage via the abstraction and usage via &input_pool. Rather than this uneasy mixture, just get rid of the abstraction entirely and have things always use the global. This simplifies the code and makes reading it a bit easier. Reviewed-by: Dominik Brodowski Signed-off-by: Jason A. Donenfeld commit 8b2d953b91e7f60200c24067ab17b77cc7bfd0d4 Author: Jason A. Donenfeld Date: Wed Jan 12 15:28:21 2022 +0100 random: remove unused extract_entropy() reserved argument This argument is always set to zero, as a result of us not caring about keeping a certain amount reserved in the pool these days. So just remove it and cleanup the function signatures. Reviewed-by: Dominik Brodowski Signed-off-by: Jason A. Donenfeld commit a4bfa9b31802c14ff5847123c12b98d5e36b3985 Author: Jason A. Donenfeld Date: Wed Jan 12 15:22:30 2022 +0100 random: remove incomplete last_data logic There were a few things added under the "if (fips_enabled)" banner, which never really got completed, and the FIPS people anyway are choosing a different direction. Rather than keep around this halfbaked code, get rid of it so that we can focus on a single design of the RNG rather than two designs. Reviewed-by: Dominik Brodowski Signed-off-by: Jason A. Donenfeld commit d38bb0853589c939573ea50e9cb64f733e0e273d Author: Jason A. Donenfeld Date: Sun Jan 9 17:48:58 2022 +0100 random: cleanup integer types Rather than using the userspace type, __uXX, switch to using uXX. And rather than using variously chosen `char *` or `unsigned char *`, use `u8 *` uniformly for things that aren't strings, in the case where we are doing byte-by-byte traversal. Reviewed-by: Dominik Brodowski Signed-off-by: Jason A. Donenfeld commit 91ec0fe138f107232cb36bc6112211db37cb5306 Author: Jason A. Donenfeld Date: Sun Jan 9 17:32:02 2022 +0100 random: cleanup poolinfo abstraction Now that we're only using one polynomial, we can cleanup its representation into constants, instead of passing around pointers dynamically to select different polynomials. This improves the codegen and makes the code a bit more straightforward. Reviewed-by: Dominik Brodowski Signed-off-by: Jason A. Donenfeld commit c0a8a61e7abbf66729687ee63659ee25983fbb1e Author: Schspa Shi Date: Fri Jan 14 16:12:16 2022 +0800 random: fix typo in comments s/or/for Signed-off-by: Schspa Shi Signed-off-by: Jason A. Donenfeld commit 9a1536b093bb5bf60689021275fd24d513bb8db0 Author: Jason A. Donenfeld Date: Tue Jan 11 18:58:43 2022 +0100 lib/crypto: sha1: re-roll loops to reduce code size With SHA-1 no longer being used for anything performance oriented, and also soon to be phased out entirely, we can make up for the space added by unrolled BLAKE2s by simply re-rolling SHA-1. Since SHA-1 is so much more complex, re-rolling it more or less takes care of the code size added by BLAKE2s. And eventually, hopefully we'll see SHA-1 removed entirely from most small kernel builds. Cc: Herbert Xu Cc: Ard Biesheuvel Tested-by: Geert Uytterhoeven Signed-off-by: Jason A. Donenfeld commit d8d83d8ab0a453e17e68b3a3bed1f940c34b8646 Author: Jason A. Donenfeld Date: Tue Jan 11 14:37:41 2022 +0100 lib/crypto: blake2s: move hmac construction into wireguard Basically nobody should use blake2s in an HMAC construction; it already has a keyed variant. But unfortunately for historical reasons, Noise, used by WireGuard, uses HKDF quite strictly, which means we have to use this. Because this really shouldn't be used by others, this commit moves it into wireguard's noise.c locally, so that kernels that aren't using WireGuard don't get this superfluous code baked in. On m68k systems, this shaves off ~314 bytes. Cc: Herbert Xu Tested-by: Geert Uytterhoeven Acked-by: Ard Biesheuvel Signed-off-by: Jason A. Donenfeld commit e56e18985596617ae426ed5997fb2e737cffb58b Author: Justin M. Forbes Date: Wed Jan 12 08:01:38 2022 -0600 lib/crypto: add prompts back to crypto libraries Commit 6048fdcc5f269 ("lib/crypto: blake2s: include as built-in") took away a number of prompt texts from other crypto libraries. This makes values flip from built-in to module when oldconfig runs, and causes problems when these crypto libs need to be built in for thingslike BIG_KEYS. Fixes: 6048fdcc5f269 ("lib/crypto: blake2s: include as built-in") Cc: Herbert Xu Cc: linux-crypto@vger.kernel.org Signed-off-by: Justin M. Forbes [Jason: - moved menu into submenu of lib/ instead of root menu - fixed chacha sub-dependencies for CONFIG_CRYPTO] Signed-off-by: Jason A. Donenfeld commit 99613159ad749543621da8238acf1a122880144e Merge: fe81ba137ebcc bbd0ff07ed12f Author: Linus Torvalds Date: Tue Jan 18 14:03:34 2022 +0200 Merge tag 'dmaengine-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine Pull dmaengine updates from Vinod Koul: "A bunch of new support and few updates to drivers: New support: - DMA_MEMCPY_SG support is bought back as we have a user in Xilinx driver - Support for TI J721S2 SoC in k3-udma driver - Support for Ingenic MDMA and BDMA in the JZ4760 - Support for Renesas r8a779f0 dmac Updates: - We are finally getting rid of slave_id, so this brings in the changes across tree for that - updates for idxd driver - at_xdmac driver cleanup" * tag 'dmaengine-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine: (60 commits) dt-bindings: dma-controller: Split interrupt fields in example dmaengine: pch_dma: Remove usage of the deprecated "pci-dma-compat.h" API dmaengine: at_xdmac: Fix race over irq_status dmaengine: at_xdmac: Remove a level of indentation in at_xdmac_tasklet() dmaengine: at_xdmac: Fix at_xdmac_lld struct definition dmaengine: at_xdmac: Fix lld view setting dmaengine: at_xdmac: Remove a level of indentation in at_xdmac_advance_work() dmaengine: at_xdmac: Fix concurrency over xfers_list dmaengine: at_xdmac: Move the free desc to the tail of the desc list dmaengine: at_xdmac: Fix race for the tx desc callback dmaengine: at_xdmac: Fix concurrency over chan's completed_cookie dmaengine: at_xdmac: Print debug message after realeasing the lock dmaengine: at_xdmac: Start transfer for cyclic channels in issue_pending dmaengine: at_xdmac: Don't start transactions at tx_submit level dmaengine: idxd: deprecate token sysfs attributes for read buffers dmaengine: idxd: change bandwidth token to read buffers dmaengine: idxd: fix wq settings post wq disable dmaengine: idxd: change MSIX allocation based on per wq activation dmaengine: idxd: fix descriptor flushing locking dmaengine: idxd: embed irq_entry in idxd_wq struct ... commit 0e3872499de1a1230cef5221607d71aa09264bd5 Author: Hui Su Date: Fri Jan 7 17:52:54 2022 +0800 kernel/sched: Remove dl_boosted flag comment since commit 2279f540ea7d ("sched/deadline: Fix priority inheritance with multiple scheduling classes"), we should not keep it here. Signed-off-by: Hui Su Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Daniel Bristot de Oliveira Link: https://lore.kernel.org/r/20220107095254.GA49258@localhost.localdomain commit 7e406d1ff39b8ee574036418a5043c86723170cf Author: Peter Zijlstra Date: Sat Dec 25 01:04:57 2021 +0100 sched: Avoid double preemption in __cond_resched_*lock*() For PREEMPT/DYNAMIC_PREEMPT the *_unlock() will already trigger a preemption, no point in then calling preempt_schedule_common() *again*. Use _cond_resched() instead, since this is a NOP for the preemptible configs while it provide a preemption point for the others. Reported-by: xuhaifeng Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/YcGnvDEYBwOiV0cR@hirez.programming.kicks-ass.net commit a315da5e686b02b20c1713dda818e8fb691526bb Author: Randy Dunlap Date: Fri Dec 17 21:59:00 2021 -0800 sched/fair: Fix all kernel-doc warnings Quieten all kernel-doc warnings in kernel/sched/fair.c: kernel/sched/fair.c:3663: warning: No description found for return value of 'update_cfs_rq_load_avg' kernel/sched/fair.c:8601: warning: No description found for return value of 'asym_smt_can_pull_tasks' kernel/sched/fair.c:8673: warning: Function parameter or member 'sds' not described in 'update_sg_lb_stats' kernel/sched/fair.c:9483: warning: contents before sections Signed-off-by: Randy Dunlap Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Ricardo Neri Acked-by: Vincent Guittot Link: https://lore.kernel.org/r/20211218055900.2704-1-rdunlap@infradead.org commit b171501f258063f5c56dd2c5fdf310802d8d7dc1 Author: Cruz Zhao Date: Tue Jan 11 17:55:59 2022 +0800 sched/core: Accounting forceidle time for all tasks except idle task There are two types of forced idle time: forced idle time from cookie'd task and forced idle time form uncookie'd task. The forced idle time from uncookie'd task is actually caused by the cookie'd task in runqueue indirectly, and it's more accurate to measure the capacity loss with the sum of both. Assuming cpu x and cpu y are a pair of SMT siblings, consider the following scenarios: 1.There's a cookie'd task running on cpu x, and there're 4 uncookie'd tasks running on cpu y. For cpu x, there will be 80% forced idle time (from uncookie'd task); for cpu y, there will be 20% forced idle time (from cookie'd task). 2.There's a uncookie'd task running on cpu x, and there're 4 cookie'd tasks running on cpu y. For cpu x, there will be 80% forced idle time (from cookie'd task); for cpu y, there will be 20% forced idle time (from uncookie'd task). The scenario1 can recurrent by stress-ng(scenario2 can recurrent similary): (cookie'd)taskset -c x stress-ng -c 1 -l 100 (uncookie'd)taskset -c y stress-ng -c 4 -l 100 In the above two scenarios, the total capacity loss is 1 cpu, but in scenario1, the cookie'd forced idle time tells us 20% cpu capacity loss, in scenario2, the cookie'd forced idle time tells us 80% cpu capacity loss, which are not accurate. It'll be more accurate to measure with cookie'd forced idle time and uncookie'd forced idle time. Signed-off-by: Cruz Zhao Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Josh Don Link: https://lore.kernel.org/r/1641894961-9241-2-git-send-email-CruzZhao@linux.alibaba.com commit 2d02fa8cc21a93da35cfba462bf8ab87bf2db651 Author: Vincent Guittot Date: Tue Jan 11 14:46:59 2022 +0100 sched/pelt: Relax the sync of load_sum with load_avg Similarly to util_avg and util_sum, don't sync load_sum with the low bound of load_avg but only ensure that load_sum stays in the correct range. Signed-off-by: Vincent Guittot Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Dietmar Eggemann Tested-by: Sachin Sant Link: https://lkml.kernel.org/r/20220111134659.24961-5-vincent.guittot@linaro.org commit 95246d1ec80b8d19d882cd8eb7ad094e63b41bb8 Author: Vincent Guittot Date: Tue Jan 11 14:46:58 2022 +0100 sched/pelt: Relax the sync of runnable_sum with runnable_avg Similarly to util_avg and util_sum, don't sync runnable_sum with the low bound of runnable_avg but only ensure that runnable_sum stays in the correct range. Signed-off-by: Vincent Guittot Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Dietmar Eggemann Tested-by: Sachin Sant Link: https://lkml.kernel.org/r/20220111134659.24961-4-vincent.guittot@linaro.org commit 7ceb77103001544a43e11d7f3a8a69a2c1f422cf Author: Vincent Guittot Date: Tue Jan 11 14:46:57 2022 +0100 sched/pelt: Continue to relax the sync of util_sum with util_avg Rick reported performance regressions in bugzilla because of cpu frequency being lower than before: https://bugzilla.kernel.org/show_bug.cgi?id=215045 He bisected the problem to: commit 1c35b07e6d39 ("sched/fair: Ensure _sum and _avg values stay consistent") This commit forces util_sum to be synced with the new util_avg after removing the contribution of a task and before the next periodic sync. By doing so util_sum is rounded to its lower bound and might lost up to LOAD_AVG_MAX-1 of accumulated contribution which has not yet been reflected in util_avg. update_tg_cfs_util() is not the only place where we round util_sum and lost some accumulated contributions that are not already reflected in util_avg. Modify update_tg_cfs_util() and detach_entity_load_avg() to not sync util_sum with the new util_avg. Instead of always setting util_sum to the low bound of util_avg, which can significantly lower the utilization, we propagate the difference. In addition, we also check that cfs's util_sum always stays above the lower bound for a given util_avg as it has been observed that sched_entity's util_sum is sometimes above cfs one. Signed-off-by: Vincent Guittot Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Dietmar Eggemann Tested-by: Sachin Sant Link: https://lkml.kernel.org/r/20220111134659.24961-3-vincent.guittot@linaro.org commit 98b0d890220d45418cfbc5157b3382e6da5a12ab Author: Vincent Guittot Date: Tue Jan 11 14:46:56 2022 +0100 sched/pelt: Relax the sync of util_sum with util_avg Rick reported performance regressions in bugzilla because of cpu frequency being lower than before: https://bugzilla.kernel.org/show_bug.cgi?id=215045 He bisected the problem to: commit 1c35b07e6d39 ("sched/fair: Ensure _sum and _avg values stay consistent") This commit forces util_sum to be synced with the new util_avg after removing the contribution of a task and before the next periodic sync. By doing so util_sum is rounded to its lower bound and might lost up to LOAD_AVG_MAX-1 of accumulated contribution which has not yet been reflected in util_avg. Instead of always setting util_sum to the low bound of util_avg, which can significantly lower the utilization of root cfs_rq after propagating the change down into the hierarchy, we revert the change of util_sum and propagate the difference. In addition, we also check that cfs's util_sum always stays above the lower bound for a given util_avg as it has been observed that sched_entity's util_sum is sometimes above cfs one. Fixes: 1c35b07e6d39 ("sched/fair: Ensure _sum and _avg values stay consistent") Reported-by: Rick Yiu Signed-off-by: Vincent Guittot Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Dietmar Eggemann Tested-by: Sachin Sant Link: https://lkml.kernel.org/r/20220111134659.24961-2-vincent.guittot@linaro.org commit a06247c6804f1a7c86a2e5398a4c1f1db1471848 Author: Suren Baghdasaryan Date: Tue Jan 11 15:23:09 2022 -0800 psi: Fix uaf issue when psi trigger is destroyed while being polled With write operation on psi files replacing old trigger with a new one, the lifetime of its waitqueue is totally arbitrary. Overwriting an existing trigger causes its waitqueue to be freed and pending poll() will stumble on trigger->event_wait which was destroyed. Fix this by disallowing to redefine an existing psi trigger. If a write operation is used on a file descriptor with an already existing psi trigger, the operation will fail with EBUSY error. Also bypass a check for psi_disabled in the psi_trigger_destroy as the flag can be flipped after the trigger is created, leading to a memory leak. Fixes: 0e94682b73bf ("psi: introduce psi monitor") Reported-by: syzbot+cdb5dd11c97cc532efad@syzkaller.appspotmail.com Suggested-by: Linus Torvalds Analyzed-by: Eric Biggers Signed-off-by: Suren Baghdasaryan Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Eric Biggers Acked-by: Johannes Weiner Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220111232309.1786347-1-surenb@google.com commit 8c16dc047b5dd8f7b3bf4584fa75733ea0dde7dc Author: Andi Kleen Date: Wed Dec 15 12:40:29 2021 -0800 x86/perf: Avoid warning for Arch LBR without XSAVE Some hypervisors support Arch LBR, but without the LBR XSAVE support. The current Arch LBR init code prints a warning when the xsave size (0) is unexpected. Avoid printing the warning for the "no LBR XSAVE" case. Signed-off-by: Andi Kleen Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20211215204029.150686-1-ak@linux.intel.com commit 5a4487f9ef5ef2fdb3215cadf0a9c3e5e8678634 Author: Kan Liang Date: Thu Jan 13 14:05:54 2022 -0800 perf/x86/intel/uncore: Add IMC uncore support for ADL Current ADL uncore code only supports the legacy IMC (memory controller) free-running counters. Besides the free-running counters, ADL also supports several general purpose-counters. The general-purpose counters can also be accessed via MMIO but in a different location. Factor out __uncore_imc_init_box() with offset as a parameter. The function can be shared between ADL and TGL. The event format and the layout of the control registers are a little bit different from other uncore counters. The intel_generic_uncore_mmio_enable_event() can be shared with client IMC uncore. Expose the function. Add more PCI IDs for ADL machines. Fixes: 772ed05f3c5c ("perf/x86/intel/uncore: Add Alder Lake support") Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/1642111554-118524-1-git-send-email-kan.liang@linux.intel.com commit 6b19788ddc5937831ffd27525a1b793953fd2d2b Author: Peter Zijlstra (Intel) Date: Tue Jan 4 08:51:17 2022 -0800 perf/x86/intel/lbr: Add static_branch for LBR INFO flags Using static_branch to replace the LBR INFO flags to optimize the LBR INFO parsing. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Tested-by: Kan Liang Link: https://lkml.kernel.org/r/1641315077-96661-2-git-send-email-peterz@infradead.org commit 1ac7fd8159a842b3aa51f0b46a351fa3eeb8fbf3 Author: Peter Zijlstra (Intel) Date: Tue Jan 4 08:51:16 2022 -0800 perf/x86/intel/lbr: Support LBR format V7 The Goldmont plus and Tremont have LBR format V7. The V7 has LBR_INFO, which is the same as LBR format V5. But V7 doesn't support TSX. Without the patch, the associated misprediction and cycles information in the LBR_INFO may be lost on a Goldmont plus platform. For Tremont, the patch only impacts the non-PEBS events. Because of the adaptive PEBS, the LBR_INFO is always processed for a PEBS event. Currently, two different ways are used to check the LBR capabilities, which make the codes complex and confusing. For the LBR format V4 and earlier, the global static lbr_desc array is used to store the flags for the LBR capabilities in each LBR format. For LBR format V5 and V6, the current code checks the version number for the LBR capabilities. There are common LBR capabilities among LBR format versions. Several flags for the LBR capabilities are introduced into the struct x86_pmu. The flags, which can be shared among LBR formats, are used to check the LBR capabilities. Add intel_pmu_lbr_init() to set the flags accordingly at boot time. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Tested-by: Kan Liang Link: https://lkml.kernel.org/r/1641315077-96661-1-git-send-email-peterz@infradead.org commit 0036fb00a756a2f6e360d44e2e3d2200a8afbc9b Author: Stephane Eranian Date: Wed Jan 5 10:56:59 2022 -0800 perf/x86/rapl: fix AMD event handling The RAPL events exposed under /sys/devices/power/events should only reflect what the underlying hardware actually support. This is how it works on Intel RAPL and Intel core/uncore PMUs in general. But on AMD, this was not the case. All possible RAPL events were advertised. This is what it showed on an AMD Fam17h: $ ls /sys/devices/power/events/ energy-cores energy-gpu energy-pkg energy-psys energy-ram energy-cores.scale energy-gpu.scale energy-pkg.scale energy-psys.scale energy-ram.scale energy-cores.unit energy-gpu.unit energy-pkg.unit energy-psys.unit energy-ram.unit Yet, on AMD Fam17h, only energy-pkg is supported. This patch fixes the problem. Given the way perf_msr_probe() works, the amd_rapl_msrs[] table has to have all entries filled out and in particular the group field, otherwise perf_msr_probe() defaults to making the event visible. With the patch applied, the kernel now only shows was is actually supported: $ ls /sys/devices/power/events/ energy-pkg energy-pkg.scale energy-pkg.unit The patch also uses the RAPL_MSR_MASK because only the 32-bits LSB of the RAPL counters are relevant when reading power consumption. Signed-off-by: Stephane Eranian Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20220105185659.643355-1-eranian@google.com commit 96fd2e89fba1aaada6f4b1e5d25a9d9ecbe1943d Author: Zhengjun Xing Date: Thu Dec 23 22:48:26 2021 +0800 perf/x86/intel/uncore: Fix CAS_COUNT_WRITE issue for ICX The user recently report a perf issue in the ICX platform, when test by perf event “uncore_imc_x/cas_count_write”,the write bandwidth is always very small (only 0.38MB/s), it is caused by the wrong "umask" for the "cas_count_write" event. When double-checking, find "cas_count_read" also is wrong. The public document for ICX uncore: 3rd Gen Intel® Xeon® Processor Scalable Family, Codename Ice Lake,Uncore Performance Monitoring Reference Manual, Revision 1.00, May 2021 On 2.4.7, it defines Unit Masks for CAS_COUNT: RD b00001111 WR b00110000 So corrected both "cas_count_read" and "cas_count_write" for ICX. Old settings: hswep_uncore_imc_events INTEL_UNCORE_EVENT_DESC(cas_count_read, "event=0x04,umask=0x03") INTEL_UNCORE_EVENT_DESC(cas_count_write, "event=0x04,umask=0x0c") New settings: snr_uncore_imc_events INTEL_UNCORE_EVENT_DESC(cas_count_read, "event=0x04,umask=0x0f") INTEL_UNCORE_EVENT_DESC(cas_count_write, "event=0x04,umask=0x30") Fixes: 2b3b76b5ec67 ("perf/x86/intel/uncore: Add Ice Lake server uncore support") Signed-off-by: Zhengjun Xing Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Adrian Hunter Reviewed-by: Kan Liang Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20211223144826.841267-1-zhengjun.xing@linux.intel.com commit 7fa981cad216e9f64f49e22112f610c0bfed91bc Author: Kan Liang Date: Tue Jan 11 10:20:38 2022 -0800 perf/x86/intel: Add a quirk for the calculation of the number of counters on Alder Lake For some Alder Lake machine with all E-cores disabled in a BIOS, the below warning may be triggered. [ 2.010766] hw perf events fixed 5 > max(4), clipping! Current perf code relies on the CPUID leaf 0xA and leaf 7.EDX[15] to calculate the number of the counters and follow the below assumption. For a hybrid configuration, the leaf 7.EDX[15] (X86_FEATURE_HYBRID_CPU) is set. The leaf 0xA only enumerate the common counters. Linux perf has to manually add the extra GP counters and fixed counters for P-cores. For a non-hybrid configuration, the X86_FEATURE_HYBRID_CPU should not be set. The leaf 0xA enumerates all counters. However, that's not the case when all E-cores are disabled in a BIOS. Although there are only P-cores in the system, the leaf 7.EDX[15] (X86_FEATURE_HYBRID_CPU) is still set. But the leaf 0xA is updated to enumerate all counters of P-cores. The inconsistency triggers the warning. Several software ways were considered to handle the inconsistency. - Drop the leaf 0xA and leaf 7.EDX[15] CPUID enumeration support. Hardcode the number of counters. This solution may be a problem for virtualization. A hypervisor cannot control the number of counters in a Linux guest via changing the guest CPUID enumeration anymore. - Find another CPUID bit that is also updated with E-cores disabled. There may be a problem in the virtualization environment too. Because a hypervisor may disable the feature/CPUID bit. - The P-cores have a maximum of 8 GP counters and 4 fixed counters on ADL. The maximum number can be used to detect the case. This solution is implemented in this patch. Fixes: ee72a94ea4a6 ("perf/x86/intel: Fix fixed counter check warning for some Alder Lake") Reported-by: Damjan Marion (damarion) Reported-by: Chan Edison Signed-off-by: Kan Liang Signed-off-by: Peter Zijlstra (Intel) Tested-by: Damjan Marion (damarion) Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/1641925238-149288-1-git-send-email-kan.liang@linux.intel.com commit 09f5e7dc7ad705289e1b1ec065439aa3c42951c4 Author: Peter Zijlstra Date: Mon Dec 20 13:19:52 2021 +0100 perf: Fix perf_event_read_local() time Time readers that cannot take locks (due to NMI etc..) currently make use of perf_event::shadow_ctx_time, which, for that event gives: time' = now + (time - timestamp) or, alternatively arranged: time' = time + (now - timestamp) IOW, the progression of time since the last time the shadow_ctx_time was updated. There's problems with this: A) the shadow_ctx_time is per-event, even though the ctx_time it reflects is obviously per context. The direct concequence of this is that the context needs to iterate all events all the time to keep the shadow_ctx_time in sync. B) even with the prior point, the context itself might not be active meaning its time should not advance to begin with. C) shadow_ctx_time isn't consistently updated when ctx_time is There are 3 users of this stuff, that suffer differently from this: - calc_timer_values() - perf_output_read() - perf_event_update_userpage() /* A */ - perf_event_read_local() /* A,B */ In particular, perf_output_read() doesn't suffer at all, because it's sample driven and hence only relevant when the event is actually running. This same was supposed to be true for perf_event_update_userpage(), after all self-monitoring implies the context is active *HOWEVER*, as per commit f79256532682 ("perf/core: fix userpage->time_enabled of inactive events") this goes wrong when combined with counter overcommit, in that case those events that do not get scheduled when the context becomes active (task events typically) miss out on the EVENT_TIME update and ENABLED time is inflated (for a little while) with the time the context was inactive. Once the event gets rotated in, this gets corrected, leading to a non-monotonic timeflow. perf_event_read_local() made things even worse, it can request time at any point, suffering all the problems perf_event_update_userpage() does and more. Because while perf_event_update_userpage() is limited by the context being active, perf_event_read_local() users have no such constraint. Therefore, completely overhaul things and do away with perf_event::shadow_ctx_time. Instead have regular context time updates keep track of this offset directly and provide perf_event_time_now() to complement perf_event_time(). perf_event_time_now() will, in adition to being context wide, also take into account if the context is active. For inactive context, it will not advance time. This latter property means the cgroup perf_cgroup_info context needs to grow addition state to track this. Additionally, since all this is strictly per-cpu, we can use barrier() to order context activity vs context time. Fixes: 7d9285e82db5 ("perf/bpf: Extend the perf_event_read_local() interface, a.k.a. "bpf: perf event change needed for subsequent bpf helpers"") Signed-off-by: Peter Zijlstra (Intel) Tested-by: Song Liu Tested-by: Namhyung Kim Link: https://lkml.kernel.org/r/YcB06DasOBtU0b00@hirez.programming.kicks-ass.net commit 5f02ef741a785678930f3ff0a8b6b2b0ef1bb402 Author: Marcelo Tosatti Date: Tue Jan 18 04:34:43 2022 -0500 KVM: VMX: switch blocked_vcpu_on_cpu_lock to raw spinlock blocked_vcpu_on_cpu_lock is taken from hard interrupt context (pi_wakeup_handler), therefore it cannot sleep. Switch it to a raw spinlock. Fixes: [41297.066254] BUG: scheduling while atomic: CPU 0/KVM/635218/0x00010001 [41297.066323] Preemption disabled at: [41297.066324] [] irq_enter_rcu+0xf/0x60 [41297.066339] Call Trace: [41297.066342] [41297.066346] dump_stack_lvl+0x34/0x44 [41297.066353] ? irq_enter_rcu+0xf/0x60 [41297.066356] __schedule_bug.cold+0x7d/0x8b [41297.066361] __schedule+0x439/0x5b0 [41297.066365] ? task_blocks_on_rt_mutex.constprop.0.isra.0+0x1b0/0x440 [41297.066369] schedule_rtlock+0x1e/0x40 [41297.066371] rtlock_slowlock_locked+0xf1/0x260 [41297.066374] rt_spin_lock+0x3b/0x60 [41297.066378] pi_wakeup_handler+0x31/0x90 [kvm_intel] [41297.066388] sysvec_kvm_posted_intr_wakeup_ipi+0x9d/0xd0 [41297.066392] [41297.066392] asm_sysvec_kvm_posted_intr_wakeup_ipi+0x12/0x20 ... Signed-off-by: Marcelo Tosatti Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini commit fe81ba137ebcc7f236780996a0b375732c07e85c Merge: 3bf6a9e36e441 237fe8885a3fd Author: Linus Torvalds Date: Tue Jan 18 10:14:49 2022 +0200 Merge tag 'ata-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata Pull ATA updates from Damien Le Moal: "A larger than usual set of changes for this cycle. The bulk of the changes are part of a rework of libata messages and debugging features from Hannes. In more detail, the changes are as follows. - Small code cleanups in the pata_ali driver (unnecessary variable initialization and simplified return statement, from Jason and Colin. - Switch to using struct_group() in the sata_fsl driver, from Kees. - Convert many sysfs attribute show functions to use sysfs_emit() instead of snprintf(), from me. - sata_dwc_460ex driver code cleanups, from Andy. - Improve DMA setup and remove superfluous error message in libahci_platform, from Andy - A small code cleanup in libata to use min() instead of open coding test, from Changcheng. - Rework of libata messages from Hannes. This is especially focused on replacing compile time defined debugging messages (DPRINTK() and VPRINTK()) with regular dynamic debugging messages (pr_debug()) and traceipoint events. Both libata-core and many drivers are updated to have a consistent debugging level control for all drivers. - Extend compile test support to as many drivers as possible in ATA Kconfig to improve compile test coverage, from me. - Fixes to avoid compile time warnings (W=1) and sparse warnings in sata_fsl and ahci_xgene drivers, from me. - Fix the interface of the read_id() port operation method to clarify that the data buffer passed as an argument is little endian. This avoids sparse warnings in the pata_netcell, pata_it821x, ahci_xgene, ahci_cevaxi and ahci_brcm drivers. From me. - Small code cleanup in the pata_octeon_cf driver, from Minghao. - Improved IRQ configuration code in pata_of_platform, from Lad. - Simplified implementation of __ata_scsi_queuecmd(), from Wenchao. - Debounce delay flag renaming, from Paul. - Add support for AMD A85 FCH (Hudson D4) AHCI adapters, from Paul" * tag 'ata-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata: (106 commits) ata: pata_ali: remove redundant return statement ata: ahci: Add support for AMD A85 FCH (Hudson D4) ata: libata: Rename link flag ATA_LFLAG_NO_DB_DELAY ata: libata-scsi: simplify __ata_scsi_queuecmd() ata: pata_of_platform: Use platform_get_irq_optional() to get the interrupt ata: pata_samsung_cf: add compile test support ata: pata_pxa: add compile test support ata: pata_imx: add compile test support ata: pata_ftide010: add compile test support ata: pata_cs5535: add compile test support ata: pata_octeon_cf: remove redundant val variable ata: fix read_id() ata port operation interface ata: ahci_xgene: use correct type for port mmio address ata: sata_fsl: fix cmdhdr_tbl_entry and prde struct definitions ata: sata_fsl: fix scsi host initialization ata: pata_bk3710: add compile test support ata: ahci_seattle: add compile test support ata: ahci_xgene: add compile test support ata: ahci_tegra: add compile test support ata: ahci_sunxi: add compile test support ... commit 3bf6a9e36e441714928d73a5adbc59562eb7ef19 Merge: 46a10fc3a2bed b03fc43e73877 Author: Linus Torvalds Date: Tue Jan 18 10:05:48 2022 +0200 Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost Pull virtio updates from Michael Tsirkin: "virtio,vdpa,qemu_fw_cfg: features, cleanups, and fixes. - partial support for < MAX_ORDER - 1 granularity for virtio-mem - driver_override for vdpa - sysfs ABI documentation for vdpa - multiqueue config support for mlx5 vdpa - and misc fixes, cleanups" * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: (42 commits) vdpa/mlx5: Fix tracking of current number of VQs vdpa/mlx5: Fix is_index_valid() to refer to features vdpa: Protect vdpa reset with cf_mutex vdpa: Avoid taking cf_mutex lock on get status vdpa/vdpa_sim_net: Report max device capabilities vdpa: Use BIT_ULL for bit operations vdpa/vdpa_sim: Configure max supported virtqueues vdpa/mlx5: Report max device capabilities vdpa: Support reporting max device capabilities vdpa/mlx5: Restore cur_num_vqs in case of failure in change_num_qps() vdpa: Add support for returning device configuration information vdpa/mlx5: Support configuring max data virtqueue vdpa/mlx5: Fix config_attr_mask assignment vdpa: Allow to configure max data virtqueues vdpa: Read device configuration only if FEATURES_OK vdpa: Sync calls set/get config/status with cf_mutex vdpa/mlx5: Distribute RX virtqueues in RQT object vdpa: Provide interface to read driver features vdpa: clean up get_config_size ret value handling virtio_ring: mark ring unused on error ... commit 46a10fc3a2beddd79dafc3cd800f14bde0844387 Merge: fc9d6952a4bbb cfcabbb24d5f4 Author: Linus Torvalds Date: Tue Jan 18 09:32:34 2022 +0200 Merge tag 'rproc-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux Pull remoteproc updates from Bjorn Andersson: "This introduces support for controlling the Cortex R7 co-processor in Renesas Gen3, support for R5F clusters and C71x DSPs on TI J721S2 and compute, audio and modem subsystems on Qualcomm SM6350. It fixes a couple of sparse errors related to memcpy_to/fromio and corrects the kerneldoc spelling of "Return:". The stm32 driver no longer attempts to communicate with the remote after the firmware has crashed" * tag 'rproc-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux: (22 commits) remoteproc: stm32: Improve crash recovery time remoteproc: rcar_rproc: Remove trailing semicolon remoteproc: rcar_rproc: Fix pm_runtime_get_sync error check remoteproc: qcom: pas: Add SM6350 CDSP support remoteproc: qcom: pas: Add SM6350 ADSP support remoteproc: qcom: pas: Add SM6350 MPSS support dt-bindings: remoteproc: qcom: pas: Add SM6350 adsp, cdsp & mpss remoteproc: qcom: pas: Add missing power-domain "mxc" for CDSP remoteproc: imx_rproc: correct firmware reload remoteproc: qcom: pil_info: Don't memcpy_toio more than is provided remoteproc: Add Renesas rcar driver dt-bindings: remoteproc: Add Renesas R-Car remoteproc: Fix remaining wrong return formatting in documentation MAINTAINERS: Removing Ohad from remoteproc/rpmsg maintenance remoteproc: ingenic: Request IRQ disabled remoteproc: k3-r5: Extend support for R5F clusters on J721S2 SoCs remoteproc: k3-dsp: Extend support for C71x DSPs on J721S2 SoCs dt-bindings: remoteproc: k3-dsp: Update bindings for J721S2 SoCs dt-bindings: remoteproc: k3-r5f: Update bindings for J721S2 SoCs remoteproc: coredump: Correct argument 2 type for memcpy_fromio ... commit fc9d6952a4bbb9908062726fbfb009fa6ea5c7af Merge: 722d94847de29 8066c615cb69b Author: Linus Torvalds Date: Tue Jan 18 09:27:40 2022 +0200 Merge tag 'rpmsg-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux Pull rpmsg updates from Bjorn Andersson: "This adds pr_fmt for the rpmsg_char driver, fixes error handling in rpmsg_dev_probe() and corrects the spelling of "Return:" in various places, in order to fix kerneldoc" * tag 'rpmsg-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux: rpmsg: core: Clean up resources on announce_create failure. rpmsg: Fix documentation return formatting rpmsg: char: Add pr_fmt() to prefix messages commit 722d94847de29310e8aa03fcbdb41fc92c521756 Author: Jamie Hill-Daniel Date: Tue Jan 18 08:06:04 2022 +0100 vfs: fs_context: fix up param length parsing in legacy_parse_param The "PAGE_SIZE - 2 - size" calculation in legacy_parse_param() is an unsigned type so a large value of "size" results in a high positive value instead of a negative value as expected. Fix this by getting rid of the subtraction. Signed-off-by: Jamie Hill-Daniel Signed-off-by: William Liu Tested-by: Salvatore Bonaccorso Tested-by: Thadeu Lima de Souza Cascardo Acked-by: Dan Carpenter Acked-by: Al Viro Signed-off-by: Greg Kroah-Hartman Signed-off-by: Linus Torvalds commit 8357f6fb3d9a02ac55f0d758b9c79b4647c18bcb Merge: 6a8d7fbf1c650 5865918fe49ed Author: Linus Torvalds Date: Tue Jan 18 09:13:30 2022 +0200 Merge tag 'pm-5.17-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull more power management updates from Rafael Wysocki: "This is a continuation of the rework of device power management macros used for declaring device power management callbacks (Paul Cercueil)" * tag 'pm-5.17-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: iio: pressure: bmp280: Use new PM macros PM: runtime: Add EXPORT[_GPL]_RUNTIME_DEV_PM_OPS macros PM: runtime: Add DEFINE_RUNTIME_DEV_PM_OPS() macro PM: core: Add EXPORT[_GPL]_SIMPLE_DEV_PM_OPS macros PM: core: Remove static qualifier in DEFINE_SIMPLE_DEV_PM_OPS macro PM: core: Remove DEFINE_UNIVERSAL_DEV_PM_OPS() macro commit 6a8d7fbf1c65034b85e7676b42449a56e4206bd3 Merge: e3a8b6a1e70c3 e3daa2607b1f4 Author: Linus Torvalds Date: Tue Jan 18 08:51:51 2022 +0200 Merge tag 'acpi-5.17-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull more ACPI updates from Rafael Wysocki: "The most significant item here is the Platform Firmware Runtime Update and Telemetry (PFRUT) support designed to allow certain pieces of the platform firmware to be updated on the fly, among other things. Also important is the e820 handling change on x86 that should work around PCI BAR allocation issues on some systems shipping since 2019. The rest is just a handful of assorted fixes and cleanups on top of the ACPI material merged previously. Specifics: - Add support for the the Platform Firmware Runtime Update and Telemetry (PFRUT) interface based on ACPI to allow certain pieces of the platform firmware to be updated without restarting the system and to provide a mechanism for collecting platform firmware telemetry data (Chen Yu, Dan Carpenter, Yang Yingliang). - Ignore E820 reservations covering PCI host bridge windows on sufficiently recent x86 systems to avoid issues with allocating PCI BARs on systems where the E820 reservations cover the entire PCI host bridge memory window returned by the _CRS object in the system's ACPI tables (Hans de Goede). - Fix and clean up acpi_scan_init() (Rafael Wysocki). - Add more sanity checking to ACPI SPCR tables parsing (Mark Langsdorf). - Fix up ACPI APD (AMD Soc) driver initialization (Jiasheng Jiang). - Drop unnecessary "static" from the ACPI PCC address space handling driver added recently (kernel test robot)" * tag 'acpi-5.17-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI: PCC: pcc_ctx can be static ACPI: scan: Rename label in acpi_scan_init() ACPI: scan: Simplify initialization of power and sleep buttons ACPI: scan: Change acpi_scan_init() return value type to void ACPI: SPCR: check if table->serial_port.access_width is too wide ACPI: APD: Check for NULL pointer after calling devm_ioremap() x86/PCI: Ignore E820 reservations for bridge windows on newer systems ACPI: pfr_telemetry: Fix info leak in pfrt_log_ioctl() ACPI: pfr_update: Fix return value check in pfru_write() ACPI: tools: Introduce utility for firmware updates/telemetry ACPI: Introduce Platform Firmware Runtime Telemetry driver ACPI: Introduce Platform Firmware Runtime Update device driver efi: Introduce EFI_FIRMWARE_MANAGEMENT_CAPSULE_HEADER and corresponding structures commit 5455b9ecaf231ec5c6b0cd5c6076eb64c9dbc9aa Author: Ronnie Sahlberg Date: Tue Jan 18 12:16:57 2022 +1000 cifs: serialize all mount attempts RHBZ: 2008434 Some servers, such as Windows2016 have a very low number of concurrent mounts that they allow from each client. This can be a problem if you have a more than a handful (==3 in this case) of cifs entries in your fstab and cause a number of the mounts there to randomly fail. Add a global mutex and use it to serialize all mount attempts. Signed-off-by: Ronnie Sahlberg Signed-off-by: Steve French commit e3a8b6a1e70c37702054ae3c7c07ed828435d8ee Merge: 62b488875c055 07f910f9b7295 Author: Linus Torvalds Date: Tue Jan 18 06:40:47 2022 +0200 Merge tag 'slab-for-5.17-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab Pull more slab updates from Vlastimil Babka: "Finish the conversion to struct slab by removing slab-specific fields from struct page. The first slab update (see merge commit ca1a46d6f506) did most of the conversion, but there was also series in iommu tree removing the iommu's usage of struct page 'freelist' field, blocking the final struct page cleanup. Now that the iommu changes have been merged, we can finish the job" * tag 'slab-for-5.17-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab: mm: Remove slab from struct page commit 62b488875c0551822ac3b961d04800d4c7a655d9 Merge: 57d17378a4a04 8f67f65d121cc Author: Linus Torvalds Date: Tue Jan 18 06:36:35 2022 +0200 Merge tag 'arc-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc Pull ARC fixes from Vineet Gupta: "Nothing too exciting for now" * tag 'arc-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc: arc: use swap() to make code cleaner arc: perf: Move static structs to where they're really used ARC: perf: fix misleading comment about pmu vs counter stop arc: Replace lkml.org links with lore ARC: perf: Remove redundant initialization of variable idx ARC: thread_info.h: correct two typos in a comment commit 57d17378a4a042401b0c2fe211e5a0e3a276cb3d Merge: f0033681f0fe8 9bce13ea88f85 Author: Linus Torvalds Date: Tue Jan 18 06:32:11 2022 +0200 Merge tag 'perf-tools-for-v5.17-2022-01-16' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux Pull perf tool updates from Arnaldo Carvalho de Melo: "New features: - Add 'trace' subcommand for 'perf ftrace', setting the stage for more 'perf ftrace' subcommands. Not using a subcommand yields the previous behaviour of 'perf ftrace'. - Add 'latency' subcommand to 'perf ftrace', that can use the function graph tracer or a BPF optimized one, via the -b/--use-bpf option. E.g.: $ sudo perf ftrace latency -a -T mutex_lock sleep 1 # DURATION | COUNT | GRAPH | 0 - 1 us | 4596 | ######################## | 1 - 2 us | 1680 | ######### | 2 - 4 us | 1106 | ##### | 4 - 8 us | 546 | ## | 8 - 16 us | 562 | ### | 16 - 32 us | 1 | | 32 - 64 us | 0 | | 64 - 128 us | 0 | | 128 - 256 us | 0 | | 256 - 512 us | 0 | | 512 - 1024 us | 0 | | 1 - 2 ms | 0 | | 2 - 4 ms | 0 | | 4 - 8 ms | 0 | | 8 - 16 ms | 0 | | 16 - 32 ms | 0 | | 32 - 64 ms | 0 | | 64 - 128 ms | 0 | | 128 - 256 ms | 0 | | 256 - 512 ms | 0 | | 512 - 1024 ms | 0 | | 1 - ... s | 0 | | The original implementation of this command was in the bcc tool. - Support --cputype option for hybrid events in 'perf stat'. Improvements: - Call chain improvements for ARM64. - No need to do any affinity setup when profiling pids. - Reduce multiplexing with duration_time in 'perf stat' metrics. - Improve error message for uncore events, stating that some event groups are can only be used in system wide (-a) mode. - perf stat metric group leader fixes/improvements, including arch specific changes to better support Intel topdown events. - Probe non-deprecated sysfs path first, i.e. try the path /sys/devices/system/cpu/cpuN/topology/thread_siblings first, then the old /sys/devices/system/cpu/cpuN/topology/core_cpus. - Disable debuginfod by default in 'perf record', to avoid stalls on distros such as Fedora 35. - Use unbuffered output in 'perf bench' when pipe/tee'ing to a file. - Enable ignore_missing_thread in 'perf trace' Fixes: - Avoid TUI crash when navigating in the annotation of recursive functions. - Fix hex dump character output in 'perf script'. - Fix JSON indentation to 4 spaces standard in the ARM vendor event files. - Fix use after free in metric__new(). - Fix IS_ERR_OR_NULL() usage in the perf BPF loader. - Fix up cross-arch register support, i.e. when printing register names take into account the architecture where the perf.data file was collected. - Fix SMT fallback with large core counts. - Don't lower case MetricExpr when parsing JSON files so as not to lose info such as the ":G" event modifier in metrics. perf test: - Add basic stress test for sigtrap handling to 'perf test'. - Fix 'perf test' failures on s/390 - Enable system wide for metricgroups test in 'perf test´. - Use 3 digits for test numbering now we can have more tests. Arch specific: - Add events for Arm Neoverse N2 in the ARM JSON vendor event files - Support PERF_MEM_LVLNUM encodings in powerpc, that came from a single patch series, where I incorrectly merged the kernel bits, that were then reverted after coordination with Michael Ellerman and Stephen Rothwell. - Add ARM SPE total latency as PERF_SAMPLE_WEIGHT. - Update AMD documentation, with info on raw event encoding. - Add support for global and local variants of the "p_stage_cyc" sort key, applicable to perf.data files collected on powerpc. - Remove duplicate and incorrect aux size checks in the ARM CoreSight ETM code. Refactorings: - Add a perf_cpu abstraction to disambiguate CPUs and CPU map indexes, fixing problems along the way. - Document CPU map methods. UAPI sync: - Update arch/x86/lib/mem{cpy,set}_64.S copies used in 'perf bench mem memcpy' - Sync UAPI files with the kernel sources: drm, msr-index, cpufeatures. Build system - Enable warnings through HOSTCFLAGS. - Drop requirement for libstdc++.so for libopencsd check libperf: - Make libperf adopt perf_counts_values__scale() from tools/perf/util/. - Add a stat multiplexing test to libperf" * tag 'perf-tools-for-v5.17-2022-01-16' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: (115 commits) perf record: Disable debuginfod by default perf evlist: No need to do any affinity setup when profiling pids perf cpumap: Add is_dummy() method perf metric: Fix metric_leader perf cputopo: Fix CPU topology reading on s/390 perf metricgroup: Fix use after free in metric__new() libperf tests: Update a use of the new cpumap API perf arm: Fix off-by-one directory path tools arch x86: Sync the msr-index.h copy with the kernel sources tools headers cpufeatures: Sync with the kernel sources tools headers UAPI: Update tools's copy of drm.h header tools arch: Update arch/x86/lib/mem{cpy,set}_64.S copies used in 'perf bench mem memcpy' perf pmu-events: Don't lower case MetricExpr perf expr: Add debug logging for literals perf tools: Probe non-deprecated sysfs path 1st perf tools: Fix SMT fallback with large core counts perf cpumap: Give CPUs their own type perf stat: Correct first_shadow_cpu to return index perf script: Fix flipped index and cpu perf c2c: Use more intention revealing iterator ... commit f0033681f0fe8421baf8db125e57fa6157824c2d Merge: 0c947b893d692 40a74870b2d1d Author: Linus Torvalds Date: Tue Jan 18 06:26:50 2022 +0200 Merge tag 'for-linus-5.17-ofs-1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux Pull orangefs fixes from Mike Marshall: "Two fixes: - Fix the size of a memory allocation in orangefs_bufmap_alloc() (Christophe JAILLET) - Use default_groups in kobj_type (Greg KH)" * tag 'for-linus-5.17-ofs-1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux: orangefs: Fix the size of a memory allocation in orangefs_bufmap_alloc() orangefs: use default_groups in kobj_type commit aee101d7b95a03078945681dd7f7ea5e4a1e7686 Author: Nicholas Piggin Date: Mon Jan 17 23:44:03 2022 +1000 powerpc/64s: Mask SRR0 before checking against the masked NIP Commit 314f6c23dd8d ("powerpc/64s: Mask NIP before checking against SRR0") masked off the low 2 bits of the NIP value in the interrupt stack frame in case they are non-zero and mis-compare against a SRR0 register value of a CPU which always reads back 0 from the 2 low bits which are reserved. This now causes the opposite problem that an implementation which does implement those bits in SRR0 will mis-compare against the masked NIP value in which they have been cleared. QEMU is one such implementation, and this is allowed by the architecture. This can be triggered by sigfuz by setting low bits of PT_NIP in the signal context. Fix this for now by masking the SRR0 bits as well. Cleaner is probably to sanitise these values before putting them in registers or stack, but this is the quick and backportable fix. Fixes: 314f6c23dd8d ("powerpc/64s: Mask NIP before checking against SRR0") Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220117134403.2995059-1-npiggin@gmail.com commit eee412e968f7b950564880bc6a7a9f00f49034da Author: Randy Dunlap Date: Fri Jan 14 17:13:38 2022 -0800 remoteproc: qcom: q6v5: fix service routines build errors When CONFIG_QCOM_AOSS_QMP=m and CONFIG_QCOM_Q6V5_MSS=y, the builtin driver cannot call into the loadable module's low-level service functions. Trying to build with that config combo causes linker errors. There are two problems here. First, drivers/remoteproc/qcom_q6v5.c should #include for the definitions of the service functions, depending on whether CONFIG_QCOM_AOSS_QMP is set/enabled or not. Second, the qcom remoteproc drivers should depend on QCOM_AOSS_QMP iff it is enabled (=y or =m) so that the qcom remoteproc drivers can be built properly. This prevents these build errors: aarch64-linux-ld: drivers/remoteproc/qcom_q6v5.o: in function `q6v5_load_state_toggle': qcom_q6v5.c:(.text+0xc4): undefined reference to `qmp_send' aarch64-linux-ld: drivers/remoteproc/qcom_q6v5.o: in function `qcom_q6v5_deinit': (.text+0x2e4): undefined reference to `qmp_put' aarch64-linux-ld: drivers/remoteproc/qcom_q6v5.o: in function `qcom_q6v5_init': (.text+0x778): undefined reference to `qmp_get' aarch64-linux-ld: (.text+0x7d8): undefined reference to `qmp_put' Fixes: c1fe10d238c0 ("remoteproc: qcom: q6v5: Use qmp_send to update co-processor load state") Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Bjorn Andersson Cc: Mathieu Poirier Cc: linux-remoteproc@vger.kernel.org Cc: Sibi Sankar Cc: Stephen Boyd Reviewed-by: Stephen Boyd Reviewed-by: Bjorn Andersson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220115011338.2973-1-rdunlap@infradead.org commit 7a534ae89e34e9b51acb5a63dd0f88308178b46a Author: Matthias Kaehlcke Date: Mon Jan 10 10:47:37 2022 -0800 rpmsg: char: Fix race between the release of rpmsg_eptdev and cdev struct rpmsg_eptdev contains a struct cdev. The current code frees the rpmsg_eptdev struct in rpmsg_eptdev_destroy(), but the cdev is a managed object, therefore its release is not predictable and the rpmsg_eptdev could be freed before the cdev is entirely released. The cdev_device_add/del() API was created to address this issue (see commit '233ed09d7fda ("chardev: add helper function to register char devs with a struct device")'), use it instead of cdev add/del(). Fixes: c0cdc19f84a4 ("rpmsg: Driver for user space endpoint interface") Suggested-by: Bjorn Andersson Signed-off-by: Matthias Kaehlcke Reviewed-by: Mathieu Poirier Reviewed-by: Stephen Boyd Reviewed-by: Bjorn Andersson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220110104706.v6.2.Idde68b05b88d4a2e6e54766c653f3a6d9e419ce6@changeid commit b7fb2dad571d1e21173c06cef0bced77b323990a Author: Sujit Kautkar Date: Mon Jan 10 10:47:36 2022 -0800 rpmsg: char: Fix race between the release of rpmsg_ctrldev and cdev struct rpmsg_ctrldev contains a struct cdev. The current code frees the rpmsg_ctrldev struct in rpmsg_ctrldev_release_device(), but the cdev is a managed object, therefore its release is not predictable and the rpmsg_ctrldev could be freed before the cdev is entirely released, as in the backtrace below. [ 93.625603] ODEBUG: free active (active state 0) object type: timer_list hint: delayed_work_timer_fn+0x0/0x7c [ 93.636115] WARNING: CPU: 0 PID: 12 at lib/debugobjects.c:488 debug_print_object+0x13c/0x1b0 [ 93.644799] Modules linked in: veth xt_cgroup xt_MASQUERADE rfcomm algif_hash algif_skcipher af_alg uinput ip6table_nat fuse uvcvideo videobuf2_vmalloc venus_enc venus_dec videobuf2_dma_contig hci_uart btandroid btqca snd_soc_rt5682_i2c bluetooth qcom_spmi_temp_alarm snd_soc_rt5682v [ 93.715175] CPU: 0 PID: 12 Comm: kworker/0:1 Tainted: G B 5.4.163-lockdep #26 [ 93.723855] Hardware name: Google Lazor (rev3 - 8) with LTE (DT) [ 93.730055] Workqueue: events kobject_delayed_cleanup [ 93.735271] pstate: 60c00009 (nZCv daif +PAN +UAO) [ 93.740216] pc : debug_print_object+0x13c/0x1b0 [ 93.744890] lr : debug_print_object+0x13c/0x1b0 [ 93.749555] sp : ffffffacf5bc7940 [ 93.752978] x29: ffffffacf5bc7940 x28: dfffffd000000000 [ 93.758448] x27: ffffffacdb11a800 x26: dfffffd000000000 [ 93.763916] x25: ffffffd0734f856c x24: dfffffd000000000 [ 93.769389] x23: 0000000000000000 x22: ffffffd0733c35b0 [ 93.774860] x21: ffffffd0751994a0 x20: ffffffd075ec27c0 [ 93.780338] x19: ffffffd075199100 x18: 00000000000276e0 [ 93.785814] x17: 0000000000000000 x16: dfffffd000000000 [ 93.791291] x15: ffffffffffffffff x14: 6e6968207473696c [ 93.796768] x13: 0000000000000000 x12: ffffffd075e2b000 [ 93.802244] x11: 0000000000000001 x10: 0000000000000000 [ 93.807723] x9 : d13400dff1921900 x8 : d13400dff1921900 [ 93.813200] x7 : 0000000000000000 x6 : 0000000000000000 [ 93.818676] x5 : 0000000000000080 x4 : 0000000000000000 [ 93.824152] x3 : ffffffd0732a0fa4 x2 : 0000000000000001 [ 93.829628] x1 : ffffffacf5bc7580 x0 : 0000000000000061 [ 93.835104] Call trace: [ 93.837644] debug_print_object+0x13c/0x1b0 [ 93.841963] __debug_check_no_obj_freed+0x25c/0x3c0 [ 93.846987] debug_check_no_obj_freed+0x18/0x20 [ 93.851669] slab_free_freelist_hook+0xbc/0x1e4 [ 93.856346] kfree+0xfc/0x2f4 [ 93.859416] rpmsg_ctrldev_release_device+0x78/0xb8 [ 93.864445] device_release+0x84/0x168 [ 93.868310] kobject_cleanup+0x12c/0x298 [ 93.872356] kobject_delayed_cleanup+0x10/0x18 [ 93.876948] process_one_work+0x578/0x92c [ 93.881086] worker_thread+0x804/0xcf8 [ 93.884963] kthread+0x2a8/0x314 [ 93.888303] ret_from_fork+0x10/0x18 The cdev_device_add/del() API was created to address this issue (see commit '233ed09d7fda ("chardev: add helper function to register char devs with a struct device")'), use it instead of cdev add/del(). Fixes: c0cdc19f84a4 ("rpmsg: Driver for user space endpoint interface") Signed-off-by: Sujit Kautkar Signed-off-by: Matthias Kaehlcke Reviewed-by: Mathieu Poirier Reviewed-by: Bjorn Andersson Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220110104706.v6.1.Iaac908f3e3149a89190ce006ba166e2d3fd247a3@changeid commit d8adf5b92a9d2205620874d498c39923ecea8749 Author: Matthias Schiffer Date: Thu Jan 13 09:19:18 2022 +0100 scripts/dtc: dtx_diff: remove broken example from help text dtx_diff suggests to use <(...) syntax to pipe two inputs into it, but this has never worked: The /proc/self/fds/... paths passed by the shell will fail the `[ -f "${dtx}" ] && [ -r "${dtx}" ]` check in compile_to_dts, but even with this check removed, the function cannot work: hexdump will eat up the DTB magic, making the subsequent dtc call fail, as a pipe cannot be rewound. Simply remove this broken example, as there is already an alternative one that works fine. Fixes: 10eadc253ddf ("dtc: create tool to diff device trees") Signed-off-by: Matthias Schiffer Reviewed-by: Frank Rowand Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220113081918.10387-1-matthias.schiffer@ew.tq-group.com commit af35a8b5bab7c1e31d30b9ad78a981fae9bda903 Author: Stanislav Jakubek Date: Thu Jan 13 14:39:20 2022 +0100 dt-bindings: trivial-devices: fix double spaces in comments Cleanup double spaces in some of the comments. Signed-off-by: Stanislav Jakubek Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/13b3f66efd3b20f1d9bbb9eff1eca00757ac5367.1642080090.git.stano.jakubek@gmail.com commit 154e5f296e2af04fc2775a6de3c76e6ee37b5609 Author: Stanislav Jakubek Date: Thu Jan 13 14:39:01 2022 +0100 dt-bindings: trivial-devices: fix swapped comments sparkfun,qwiic-joystick and st,24c256 had their comments incorrectly swapped. Swap them to make them correct. Signed-off-by: Stanislav Jakubek Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/7dc6ddb0b042cd243b2875e9aea81cad541d1c6b.1642080090.git.stano.jakubek@gmail.com commit 364da22cb30eb79198922ebf53c40f589bcece9d Author: Stanislav Jakubek Date: Thu Jan 13 11:31:10 2022 +0100 dt-bindings: vendor-prefixes: add Wingtech The vendor prefix for Wingtech [1] is used in device tree [2], but was not documented so far. Add it to the schema to document it. [1] http://www.wingtech.com/en [2] arch/arm64/boot/dts/qcom/msm8916-wingtech-wt88047.dts Signed-off-by: Stanislav Jakubek Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220113103110.GA4488@standask-GA-A55M-S2HP commit 6f2dfed0b6f078149072c34631a77902a8c85c7e Author: Stanislav Jakubek Date: Thu Jan 13 11:30:36 2022 +0100 dt-bindings: vendor-prefixes: add Thundercomm The vendor prefix for Thundercomm [1] is used in device tree [2], but was not documented so far. Add it to the schema to document it. [1] https://www.thundercomm.com/ [2] arch/arm64/boot/dts/qcom/sdm845-db845c.dts Signed-off-by: Stanislav Jakubek Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220113103036.GA4456@standask-GA-A55M-S2HP commit ca146834d6cdbde80dead9daf8e7e127fc85d31f Author: Stanislav Jakubek Date: Thu Jan 13 11:30:05 2022 +0100 dt-bindings: vendor-prefixes: add Huawei The vendor prefix for Huawei [1] is used in device trees [2][3], but was not documented so far. Add it to the schema to document it. [1] https://www.huawei.com/en/ [2] arch/arm64/boot/dts/qcom/msm8916-huawei-g7.dts [3] arch/arm64/boot/dts/qcom/msm8994-angler-rev-101.dts Signed-off-by: Stanislav Jakubek Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220113103005.GA4421@standask-GA-A55M-S2HP commit 8316cbbafd8bdf523fb1b3230f0701beae51679b Author: Stanislav Jakubek Date: Thu Jan 13 11:29:26 2022 +0100 dt-bindings: vendor-prefixes: add F(x)tec The vendor prefix for F(x)tec [1] is used in device tree [2], but was not documented so far. Add it to the schema to document it. [1] https://www.fxtec.com/ [2] arch/arm64/boot/dts/qcom/msm8998-fxtec-pro1.dts Signed-off-by: Stanislav Jakubek Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220113102926.GA4388@standask-GA-A55M-S2HP commit 38a9840e2e396e86e3a39d1d2daf5f46204066c7 Author: Stanislav Jakubek Date: Thu Jan 13 11:28:42 2022 +0100 dt-bindings: vendor-prefixes: add 8devices The vendor prefix for 8devices [1] is used in device tree [2], but was not documented so far. Add it to the schema to document it. [1] https://www.8devices.com/ [2] arch/arm/boot/dts/qcom-ipq4018-jalapeno.dts Signed-off-by: Stanislav Jakubek Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220113102842.GA4357@standask-GA-A55M-S2HP commit 2ba144e68edb4987a2fe1b1cf418b58cbdc4ee96 Author: Sander Vanheule Date: Mon Jan 10 22:44:56 2022 +0100 dt-bindings: power: reset: gpio-restart: Correct default priority Commit bcd56fe1aa97 ("power: reset: gpio-restart: increase priority slightly") changed the default restart priority 129, but did not update the documentation. Correct this, so the driver and documentation have the same default value. Signed-off-by: Sander Vanheule Reviewed-by: Rob Herring Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220110214456.67087-1-sander@svanheule.net commit cc2cf6796a90bf356a8ddc854f65cea434477ea7 Author: Huichun Feng Date: Tue Jan 11 13:20:01 2022 +0800 docs: ftrace: fix ambiguous sentence The sentence looks ambiguous, rephrase it by adding ", there". Signed-off-by: Huichun Feng Signed-off-by: Ching-Chun (Jim) Huang Signed-off-by: Chun-Hung Tseng Acked-by: Steven Rostedt Link: https://lore.kernel.org/r/20220111052000.2675944-1-foxhoundsk.tw@gmail.com Signed-off-by: Jonathan Corbet commit 6b0764598dc7dea21a44cd4e7ec3dd4a7aabf5c2 Author: Wang Cheng Date: Sat Jan 15 20:52:36 2022 +0800 docs: staging/tee.rst: fix two typos found while reading Signed-off-by: Wang Cheng Reviewed-by: Sumit Garg Acked-by: Randy Dunlap Link: https://lore.kernel.org/r/20220115125236.34886-1-wanngchenng@gmail.com Signed-off-by: Jonathan Corbet commit a2809d0e16963fdf3984409e47f145cccb0c6821 Author: Eugene Korenevsky Date: Fri Jan 14 22:53:40 2022 +0300 cifs: quirk for STATUS_OBJECT_NAME_INVALID returned for non-ASCII dfs refs Windows SMB server responds with STATUS_OBJECT_NAME_INVALID code to SMB2 QUERY_INFO request for "\\\" DFS reference, where contains non-ASCII unicode symbols. Check such DFS reference and emulate -EREMOTE if it is actual. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=215440 Signed-off-by: Eugene Korenevsky Signed-off-by: Steve French commit 7eacba3b00a3c35c1ad189f543b1995dd0bdca9c Author: Eugene Korenevsky Date: Fri Jan 14 22:53:00 2022 +0300 cifs: alloc_path_with_tree_prefix: do not append sep. if the path is empty alloc_path_with_tree_prefix() concatenates tree prefix and the path. Windows CIFS client does not add separator after the tree prefix if the path is empty. Let's do the same. This fixes mounting DFS namespaces with names containing non-ASCII symbols. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=215440 Signed-off-by: Eugene Korenevsky Signed-off-by: Steve French commit e5b54867f47f765fcb439e09ed763b5de617af3e Author: Srinivas Pandruvada Date: Fri Jan 14 15:24:35 2022 -0800 thermal: int340x: Add Raptor Lake PCI device id Add Raptor Lake PCI ID for processor thermal device. Signed-off-by: Srinivas Pandruvada Signed-off-by: Rafael J. Wysocki commit a95be874d26bed7c12a87b5493d5dac9281f707f Author: Srinivas Pandruvada Date: Fri Jan 14 15:24:34 2022 -0800 thermal: int340x: Support Raptor Lake Add Raptor Lake ACPI IDs for DPTF devices. Signed-off-by: Srinivas Pandruvada Signed-off-by: Rafael J. Wysocki commit a510c78e5b6f2f9b9add88071fdfc2b740d2e356 Author: Srinivas Pandruvada Date: Fri Jan 14 15:24:33 2022 -0800 ACPI: DPTF: Support Raptor Lake Add Raptor Lake ACPI IDs for DPTF devices. Signed-off-by: Srinivas Pandruvada Signed-off-by: Rafael J. Wysocki commit f684b10751287e8b7e15e8f10ae40bdd74149bba Author: Rafael J. Wysocki Date: Wed Jan 12 19:27:22 2022 +0100 ACPI: CPPC: Drop redundant local variable from cpc_read() The ret_val local variable in cpc_read() is not necessary, so eliminate it. No functional impact. Signed-off-by: Rafael J. Wysocki Acked-by: Huang Rui commit 5f51c7ce1dc36565296b3ef342585f70ec72a2a9 Author: Rafael J. Wysocki Date: Wed Jan 12 19:26:32 2022 +0100 ACPI: CPPC: Fix up I/O port access in cpc_read() The code as currently implemented does not work on big endian systems, so fix it up. Fixes: a2c8f92bea5f ("ACPI: CPPC: Implement support for SystemIO registers") Reported-by: Dan Carpenter Suggested-by: Dan Carpenter Link: https://lore.kernel.org/linux-acpi/20220111092928.GA24968@kili/ Signed-off-by: Rafael J. Wysocki Acked-by: Huang Rui commit 74ce6135ae6ef482715cff2ccd703b7295f900f2 Author: Yang Li Date: Mon Jan 17 09:11:30 2022 +0800 cifs: clean up an inconsistent indenting Eliminate the follow smatch warning: fs/cifs/sess.c:1581 sess_auth_rawntlmssp_authenticate() warn: inconsistent indenting Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Steve French commit e3548aaf41a200c2af359462be23bcdd76efd795 Author: Shyam Prasad N Date: Mon Jan 17 00:20:47 2022 -0600 cifs: free ntlmsspblob allocated in negotiate One of my previous fixes: cifs: send workstation name during ntlmssp session setup ...changed the prototype of build_ntlmssp_negotiate_blob from being allocated by the caller to being allocated within the function. The caller needs to free this object too. While SMB2 version of the caller did it, I forgot to free for the SMB1 version. Fixing that here. Fixes: 49bd49f983b5 ("cifs: send workstation name during ntlmssp session setup") Cc: stable@vger.kernel.org # 5.16 Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit 4732f2444acd9b7eabc744f20eb5cc9694c0bfbd Author: Like Xu Date: Tue Jan 11 15:38:23 2022 +0800 KVM: x86: Making the module parameter of vPMU more common The new module parameter to control PMU virtualization should apply to Intel as well as AMD, for situations where userspace is not trusted. If the module parameter allows PMU virtualization, there could be a new KVM_CAP or guest CPUID bits whereby userspace can enable/disable PMU virtualization on a per-VM basis. If the module parameter does not allow PMU virtualization, there should be no userspace override, since we have no precedent for authorizing that kind of override. If it's false, other counter-based profiling features (such as LBR including the associated CPUID bits if any) will not be exposed. Change its name from "pmu" to "enable_pmu" as we have temporary variables with the same name in our code like "struct kvm_pmu *pmu". Fixes: b1d66dad65dc ("KVM: x86/svm: Add module param to control PMU virtualization") Suggested-by : Jim Mattson Signed-off-by: Like Xu Message-Id: <20220111073823.21885-1-likexu@tencent.com> Signed-off-by: Paolo Bonzini commit ecebb966acaab2466d9857d1cc435ee1fc9eee50 Author: Vitaly Kuznetsov Date: Mon Jan 17 16:05:42 2022 +0100 KVM: selftests: Test KVM_SET_CPUID2 after KVM_RUN KVM forbids KVM_SET_CPUID2 after KVM_RUN was performed on a vCPU unless the supplied CPUID data is equal to what was previously set. Test this. Signed-off-by: Vitaly Kuznetsov Message-Id: <20220117150542.2176196-5-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini commit 9e6d484f9991176269607bb3c54a494e32eab27a Author: Vitaly Kuznetsov Date: Mon Jan 17 16:05:41 2022 +0100 KVM: selftests: Rename 'get_cpuid_test' to 'cpuid_test' In preparation to reusing the existing 'get_cpuid_test' for testing "KVM_SET_CPUID{,2} after KVM_RUN" rename it to 'cpuid_test' to avoid the confusion. No functional change intended. Signed-off-by: Vitaly Kuznetsov Message-Id: <20220117150542.2176196-4-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini commit c6617c61e8fe44b9e9fdfede921f61cac6b5149d Author: Vitaly Kuznetsov Date: Mon Jan 17 16:05:40 2022 +0100 KVM: x86: Partially allow KVM_SET_CPUID{,2} after KVM_RUN Commit feb627e8d6f6 ("KVM: x86: Forbid KVM_SET_CPUID{,2} after KVM_RUN") forbade changing CPUID altogether but unfortunately this is not fully compatible with existing VMMs. In particular, QEMU reuses vCPU fds for CPU hotplug after unplug and it calls KVM_SET_CPUID2. Instead of full ban, check whether the supplied CPUID data is equal to what was previously set. Reported-by: Igor Mammedov Fixes: feb627e8d6f6 ("KVM: x86: Forbid KVM_SET_CPUID{,2} after KVM_RUN") Signed-off-by: Vitaly Kuznetsov Message-Id: <20220117150542.2176196-3-vkuznets@redhat.com> Cc: stable@vger.kernel.org [Do not call kvm_find_cpuid_entry repeatedly. - Paolo] Signed-off-by: Paolo Bonzini commit e3daa2607b1f4bb1d09a5a8ad89ad9f7327a2e63 Merge: ebf8b135c04ae 7bf2e4d5ca1c9 Author: Rafael J. Wysocki Date: Mon Jan 17 18:25:57 2022 +0100 Merge branch 'acpi-pfrut' Merge support for the Platform Firmware Runtime Update and Telemetry interface based on ACPI. The interface provided here allows updating certain pieces of the platform firmware without restarting the system and collecting platform firmware telemetry data. This also includes a utility for accesing the new interface from user space. * acpi-pfrut: ACPI: pfr_telemetry: Fix info leak in pfrt_log_ioctl() ACPI: pfr_update: Fix return value check in pfru_write() ACPI: tools: Introduce utility for firmware updates/telemetry ACPI: Introduce Platform Firmware Runtime Telemetry driver ACPI: Introduce Platform Firmware Runtime Update device driver efi: Introduce EFI_FIRMWARE_MANAGEMENT_CAPSULE_HEADER and corresponding structures commit ee3a5f9e3d9bf94159f3cc80da542fbe83502dd8 Author: Vitaly Kuznetsov Date: Mon Jan 17 16:05:39 2022 +0100 KVM: x86: Do runtime CPUID update before updating vcpu->arch.cpuid_entries kvm_update_cpuid_runtime() mangles CPUID data coming from userspace VMM after updating 'vcpu->arch.cpuid_entries', this makes it impossible to compare an update with what was previously supplied. Introduce __kvm_update_cpuid_runtime() version which can be used to tweak the input before it goes to 'vcpu->arch.cpuid_entries' so the upcoming update check can compare tweaked data. No functional change intended. Signed-off-by: Vitaly Kuznetsov Message-Id: <20220117150542.2176196-2-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini commit a21864486f7e220bd5938c6fb637613d9635739a Author: Like Xu Date: Wed Jan 5 13:15:09 2022 +0800 KVM: x86/pmu: Fix available_event_types check for REF_CPU_CYCLES event According to CPUID 0x0A.EBX bit vector, the event [7] should be the unrealized event "Topdown Slots" instead of the *kernel* generalized common hardware event "REF_CPU_CYCLES", so we need to skip the cpuid unavaliblity check in the intel_pmc_perf_hw_id() for the last REF_CPU_CYCLES event and update the confusing comment. If the event is marked as unavailable in the Intel guest CPUID 0AH.EBX leaf, we need to avoid any perf_event creation, whether it's a gp or fixed counter. To distinguish whether it is a rejected event or an event that needs to be programmed with PERF_TYPE_RAW type, a new special returned value of "PERF_COUNT_HW_MAX + 1" is introduced. Fixes: 62079d8a43128 ("KVM: PMU: add proper support for fixed counter 2") Signed-off-by: Like Xu Message-Id: <20220105051509.69437-1-likexu@tencent.com> Signed-off-by: Paolo Bonzini commit b3bb9413e717b44e4aea833d07f14e90fb91cf97 Author: Darrick J. Wong Date: Tue Dec 21 13:07:38 2021 -0800 xfs: remove the XFS_IOC_{ALLOC,FREE}SP* definitions Now that we've made these ioctls defunct, move them from xfs_fs.h to xfs_ioctl.c, which effectively removes them from the publicly supported ioctl interfaces for XFS. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Reviewed-by: Eric Sandeen commit 4d1b97f9ce7c0d2af2bb85b12d48e6902172a28e Author: Darrick J. Wong Date: Fri Jan 7 17:45:51 2022 -0800 xfs: kill the XFS_IOC_{ALLOC,FREE}SP* ioctls According to the glibc compat header for Irix 4, these ioctls originated in April 1991 as a (somewhat clunky) way to preallocate space at the end of a file on an EFS filesystem. XFS, which was released in Irix 5.3 in December 1993, picked up these ioctls to maintain compatibility and they were ported to Linux in the early 2000s. Recently it was pointed out to me they still lurk in the kernel, even though the Linux fallocate syscall supplanted the functionality a long time ago. fstests doesn't seem to include any real functional or stress tests for these ioctls, which means that the code quality is ... very questionable. Most notably, it was a stale disk block exposure vector for 21 years and nobody noticed or complained. As mature programmers say, "If you're not testing it, it's broken." Given all that, let's withdraw these ioctls from the XFS userspace API. Normally we'd set a long deprecation process, but I estimate that there aren't any real users, so let's trigger a warning in dmesg and return -ENOTTY. See: CVE-2021-4155 Augments: 983d8e60f508 ("xfs: map unwritten blocks in XFS_IOC_{ALLOC,FREE}SP just like fallocate") Signed-off-by: Darrick J. Wong Reviewed-by: Eric Sandeen Reviewed-by: Dave Chinner commit 9dec0368b9640c09ef5af48214e097245e57a204 Author: Darrick J. Wong Date: Tue Jan 11 14:05:02 2022 -0800 xfs: remove the XFS_IOC_FSSETDM definitions Remove the definitions for these ioctls, since the functionality (and, weirdly, the 32-bit compat ioctl definitions) were removed from the kernel in November 2019. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit ebf8b135c04ae5481fc053ecb9fad66b26fd1112 Merge: c96f195deeefe 7f7b4236f2040 ee3fe99ff0a27 2cea3ec5b0099 415b4b6c447ae Author: Rafael J. Wysocki Date: Mon Jan 17 18:15:07 2022 +0100 Merge branches 'acpi-x86', 'acpi-tables', 'acpi-soc' and 'acpi-pcc' Merge additional ACPI-related updates for 5.17-rc1: - Ignore E820 reservations covering PCI host bridge windows on sufficiently recent x86 systems to avoid issues with allocating PCI BARs on systems where the E820 reservations cover the entire PCI host bridge memory window returned by the _CRS object in the system's ACPI tables (Hans de Goede). - Add more sanity checking to ACPI SPCR tables parsing (Mark Langsdorf). - Fix up ACPI APD (AMD Soc) driver initialization (Jiasheng Jiang). - Drop unnecessary "static" from the ACPI PCC address space handling driver added recently (kernel test robot). * acpi-x86: x86/PCI: Ignore E820 reservations for bridge windows on newer systems * acpi-tables: ACPI: SPCR: check if table->serial_port.access_width is too wide * acpi-soc: ACPI: APD: Check for NULL pointer after calling devm_ioremap() * acpi-pcc: ACPI: PCC: pcc_ctx can be static commit 5765cee119bf5a36c94d20eceb37c445508934be Author: Russell King (Oracle) Date: Mon Jan 17 14:52:33 2022 +0000 net: sfp: fix high power modules without diagnostic monitoring Commit 7cfa9c92d0a3 ("net: sfp: avoid power switch on address-change modules") unintetionally changed the semantics for high power modules without the digital diagnostics monitoring. We repeatedly attempt to read the power status from the non-existing 0xa2 address in a futile hope this failure is temporary: [ 8.856051] sfp sfp-eth3: module NTT 0000000000000000 rev 0000 sn 0000000000000000 dc 160408 [ 8.865843] mvpp2 f4000000.ethernet eth3: switched to inband/1000base-x link mode [ 8.873469] sfp sfp-eth3: Failed to read EEPROM: -5 [ 8.983251] sfp sfp-eth3: Failed to read EEPROM: -5 [ 9.103250] sfp sfp-eth3: Failed to read EEPROM: -5 We previosuly assumed such modules were powered up in the correct mode, continuing without further configuration as long as the required power class was supported by the host. Restore this behaviour, while preserving the intent of subsequent patches to avoid the "Address Change Sequence not supported" warning if we are not going to be accessing the DDM address. Fixes: 7cfa9c92d0a3 ("net: sfp: avoid power switch on address-change modules") Reported-by: 照山周一郎 Tested-by: 照山周一郎 Signed-off-by: Russell King (Oracle) Signed-off-by: David S. Miller commit 850fd2abbe02eb2b52cbb1550adbcc89b36d65de Author: Ming Lei Date: Tue Jan 11 20:34:01 2022 +0800 block: cleanup q->srcu srcu structure has to be cleanup via cleanup_srcu_struct(), so fix it. Reported-by: syzbot+4f789823c1abc5accf13@syzkaller.appspotmail.com Fixes: 704b914f15fb ("blk-mq: move srcu from blk_mq_hw_ctx to request_queue") Signed-off-by: Ming Lei Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220111123401.520192-1-ming.lei@redhat.com Signed-off-by: Jens Axboe commit e6a2e5116e07ce5acc8698785c29e9e47f010fd5 Author: GuoYong Zheng Date: Mon Jan 17 18:22:37 2022 +0800 block: Remove unnecessary variable assignment The parameter "ret" should be zero when running to this line, no need to set to zero again, remove it. Signed-off-by: GuoYong Zheng Link: https://lore.kernel.org/r/1642414957-6785-1-git-send-email-zhenggy@chinatelecom.cn Signed-off-by: Jens Axboe commit 00358933f66c44d511368a57eb421e172447cfb9 Author: Tetsuo Handa Date: Thu Jan 6 18:53:16 2022 +0900 brd: remove brd_devices_mutex mutex If brd_alloc() from brd_probe() is called before brd_alloc() from brd_init() is called, module loading will fail with -EEXIST error. To close this race, call __register_blkdev() just before leaving brd_init(). Then, we can remove brd_devices_mutex mutex, for brd_device list will no longer be accessed concurrently. Signed-off-by: Tetsuo Handa Reviewed-by: Christoph Hellwig Reviewed-by: Luis Chamberlain Link: https://lore.kernel.org/r/6b074af7-c165-4fab-b7da-8270a4f6f6cd@i-love.sakura.ne.jp Signed-off-by: Jens Axboe commit 30fee1d7462a446ade399c0819717a830cbdca69 Author: Miaoqian Lin Date: Fri Jan 14 06:51:24 2022 +0000 gpio: idt3243x: Fix IRQ check in idt_gpio_probe platform_get_irq() returns negative error number instead 0 on failure. And the doc of platform_get_irq() provides a usage example: int irq = platform_get_irq(pdev, 0); if (irq < 0) return irq; Fix the check of return value to catch errors correctly. Fixes: 4195926aedca ("gpio: Add support for IDT 79RC3243x GPIO controller") Signed-off-by: Miaoqian Lin Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 0b39536cc699db6850c426db7f9cb45923de40c5 Author: Miaoqian Lin Date: Fri Jan 14 06:48:20 2022 +0000 gpio: mpc8xxx: Fix IRQ check in mpc8xxx_probe platform_get_irq() returns negative error number instead 0 on failure. And the doc of platform_get_irq() provides a usage example: int irq = platform_get_irq(pdev, 0); if (irq < 0) return irq; Fix the check of return value to catch errors correctly. Fixes: 76c47d1449fc ("gpio: mpc8xxx: Add ACPI support") Signed-off-by: Miaoqian Lin Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit c831d92890e037aafee662e66172d406804e4818 Author: Christophe JAILLET Date: Sun Dec 26 15:46:21 2021 +0100 irqchip/loongson-pch-ms: Use bitmap_free() to free bitmap kfree() and bitmap_free() are the same. But using the latter is more consistent when freeing memory allocated with bitmap_zalloc(). Signed-off-by: Christophe JAILLET Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/0b982ab54844803049c217b2899baa59602faacd.1640529916.git.christophe.jaillet@wanadoo.fr commit 5754f9084f261f6fbfdcc6e57dae97c86a6ff688 Author: Heiko Carstens Date: Mon Jan 17 13:31:40 2022 +0100 s390: add Sven Schnelle as reviewer Sven Schnelle will help reviewing s390 architecture code. Acked-by: Sven Schnelle Acked-by: Alexander Gordeev Acked-by: Vasily Gorbik Acked-by: Christian Borntraeger Signed-off-by: Heiko Carstens commit 012a224e1fa31fc256aab921f691598e03db6018 Author: Nico Boehr Date: Tue Jan 11 11:00:03 2022 +0100 s390/uaccess: introduce bit field for OAC specifier Previously, we've used magic values to specify the OAC (operand-access control) for mvcos. Instead we introduce a bit field for it. When using a bit field, we cannot use an immediate value with K constraint anymore, since GCC older than 10 doesn't recognize the bit field union as a compile time constant. To make things work with older compilers, load the OAC value through a register. Bloat-o-meter reports a slight increase in kernel size with this change: Total: Before=15692135, After=15693015, chg +0.01% Signed-off-by: Nico Boehr Co-developed-by: Janis Schoetterl-Glausch Signed-off-by: Janis Schoetterl-Glausch Link: https://lore.kernel.org/r/20220111100003.743116-1-scgl@linux.ibm.com Cc: Alexander Gordeev Cc: Christian Borntraeger Cc: Vasily Gorbik Cc: Sven Schnelle Signed-off-by: Heiko Carstens commit 745f5d20e7936931f924410f32d8b0e599b5990e Author: Thomas Richter Date: Thu Jan 13 12:51:56 2022 +0100 s390/cpumf: Support for CPU Measurement Sampling Facility LS bit Adds support for the CPU Measurement Sampling Facility limit sampling bit in the sampling device driver. Limited samples have no valueable information are not collected. Signed-off-by: Thomas Richter Acked-by: Sumanth Korikkar Signed-off-by: Heiko Carstens commit a87b0fd4f9003f8521226e226cf92b18147b3519 Author: Thomas Richter Date: Thu Jan 13 12:31:16 2022 +0100 s390/cpumf: Support for CPU Measurement Facility CSVN 7 Adds support for the CPU Measurement Counter Facility second version number 7. Signed-off-by: Thomas Richter Acked-by: Sumanth Korikkar Signed-off-by: Heiko Carstens commit 9ea674d7ca4f6ce080b813ac2d9a9397f13d2427 Merge: c0b7f7d7e0ad4 79074a72d335d Author: David S. Miller Date: Mon Jan 17 13:07:47 2022 +0000 Merge branch 'skb-leak-fixes' Gal Pressman says: ==================== net: Couple of skb memory leak fixes As discussed in: https://lore.kernel.org/netdev/20220102081253.9123-1-gal@nvidia.com/ These are the two followup suggestions from Eric and Jakub. Patch #1 adds a sk_defer_free_flush() call to the kTLS splice_read handler. Patch #2 verifies the defer list is empty on socket destroy, and calls a defer free flush as well. ==================== Signed-off-by: David S. Miller commit 79074a72d335dbd021a716d8cc65cba3b2f706ab Author: Gal Pressman Date: Mon Jan 17 11:27:33 2022 +0200 net: Flush deferred skb free on socket destroy The cited Fixes patch moved to a deferred skb approach where the skbs are not freed immediately under the socket lock. Add a WARN_ON_ONCE() to verify the deferred list is empty on socket destroy, and empty it to prevent potential memory leaks. Fixes: f35f821935d8 ("tcp: defer skb freeing after socket lock is released") Signed-off-by: Gal Pressman Signed-off-by: David S. Miller commit db094aa8140e6da25ba77345b24a8af0c220665e Author: Gal Pressman Date: Mon Jan 17 11:27:32 2022 +0200 net/tls: Fix another skb memory leak when running kTLS traffic This patch is a followup to commit ffef737fd037 ("net/tls: Fix skb memory leak when running kTLS traffic") Which was missing another sk_defer_free_flush() call in tls_sw_splice_read(). Fixes: f35f821935d8 ("tcp: defer skb freeing after socket lock is released") Signed-off-by: Gal Pressman Signed-off-by: David S. Miller commit c0b7f7d7e0ad44f35745c01964b3fa2833e298cb Author: Horatiu Vultur Date: Mon Jan 17 13:53:00 2022 +0100 net: ocelot: Fix the call to switchdev_bridge_port_offload In the blamed commit, the call to the function switchdev_bridge_port_offload was passing the wrong argument for atomic_nb. It was ocelot_netdevice_nb instead of ocelot_swtchdev_nb. This patch fixes this issue. Fixes: 4e51bf44a03af6 ("net: bridge: move the switchdev object replay helpers to "push" mode") Signed-off-by: Horatiu Vultur Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit 960dd884ddf5621ae6284cd3a42724500a97ae4c Author: Sander Vanheule Date: Sun Jan 9 15:54:34 2022 +0100 irqchip/realtek-rtl: Service all pending interrupts Instead of only servicing the lowest pending interrupt line, make sure all pending SoC interrupts are serviced before exiting the chained handler. This adds a small overhead if only one interrupt is pending, but should prevent rapid re-triggering of the handler. Signed-off-by: Sander Vanheule Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/5082ad3cb8b4eedf55075561b93eff6570299fe1.1641739718.git.sander@svanheule.net commit 91351b5dd0fd494eb2d85e1bb6aca77b067447e0 Author: Sander Vanheule Date: Sun Jan 9 15:54:33 2022 +0100 irqchip/realtek-rtl: Fix off-by-one in routing There is an offset between routing values (1..6) and the connected MIPS CPU interrupts (2..7), but no distinction was made between these two values. This issue was previously hidden during testing, because an interrupt mapping was used where for each required interrupt another (unused) routing was configured, with an offset of +1. Offset the CPU IRQ numbers by -1 to retrieve the correct routing value. Fixes: 9f3a0f34b84a ("irqchip: Add support for Realtek RTL838x/RTL839x interrupt controller") Signed-off-by: Sander Vanheule Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/177b920aa8d8610615692d0e657e509f363c85ca.1641739718.git.sander@svanheule.net commit 291e79c7e2eb6fdc016453597b78482e06199d0f Author: Sander Vanheule Date: Sun Jan 9 15:54:32 2022 +0100 irqchip/realtek-rtl: Map control data to virq The driver assigned the irqchip and irq handler to the hardware irq, instead of the virq. This is incorrect, and only worked because these irq numbers happened to be the same on the devices used for testing the original driver. Fixes: 9f3a0f34b84a ("irqchip: Add support for Realtek RTL838x/RTL839x interrupt controller") Signed-off-by: Sander Vanheule Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/4b4936606480265db47df152f00bc2ed46340599.1641739718.git.sander@svanheule.net commit 45378cd33905966baf16d12ab0adbd56794ee075 Author: Marc Zyngier Date: Sat Jan 8 14:01:18 2022 +0000 irqchip/apple-aic: Drop unused ipi_hwirq field This field was never used, remove it. Signed-off-by: Marc Zyngier Acked-by: Hector Martin Link: https://lore.kernel.org/r/20220108140118.3378937-1-maz@kernel.org commit e26602be4869c74dd8a0f66f718b8a0ce120edb4 Author: José Roberto de Souza Date: Thu Jan 13 09:48:26 2022 -0800 drm/i915/display/adlp: Implement new step in the TC voltage swing prog sequence TC voltage swing programming sequence was updated with a new step. BSpec: 54956 Cc: stable@vger.kernel.org Cc: Jani Nikula Cc: Clint Taylor Cc: Imre Deak Signed-off-by: José Roberto de Souza Reviewed-by: Clint Taylor Link: https://patchwork.freedesktop.org/patch/msgid/20220113174826.50272-1-jose.souza@intel.com (cherry picked from commit 5ff59dddacd4738edcbd01847d9df7682348cf86) Signed-off-by: Tvrtko Ursulin commit ef3ac01564067a4337bb798b8eddc6ea7b78fd10 Author: José Roberto de Souza Date: Thu Jan 13 08:04:37 2022 -0800 drm/i915/display/ehl: Update voltage swing table EHL table was recently updated with some minor fixes. BSpec: 21257 Cc: stable@vger.kernel.org Cc: Clint Taylor Signed-off-by: José Roberto de Souza Reviewed-by: Clint Taylor Link: https://patchwork.freedesktop.org/patch/msgid/20220113160437.49059-1-jose.souza@intel.com (cherry picked from commit 5ec7baef52c367cdbda964aa662f7135c25bab1f) Signed-off-by: Tvrtko Ursulin commit 5576c4f24c56722a2d9fb9c447d896e5b312078b Author: Takashi Iwai Date: Sun Jan 16 09:28:38 2022 +0100 ALSA: core: Fix SSID quirk lookup for subvendor=0 Some weird devices set the codec SSID vendor ID 0, and snd_pci_quirk_lookup_id() loop aborts at the point although it should still try matching with the SSID device ID. This resulted in a missing quirk for some old Macs. Fix the loop termination condition to check both subvendor and subdevice. Fixes: 73355ddd8775 ("ALSA: hda: Code refactoring snd_hda_pick_fixup()") Cc: BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=215495 Link: https://lore.kernel.org/r/20220116082838.19382-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 0c947b893d69231a9add855939da7c66237ab44f Merge: a6097180d884d 9bbf8662a27b5 Author: Linus Torvalds Date: Mon Jan 17 09:53:21 2022 +0200 Merge tag '5.17-rc-part1-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6 Pull cifs updates from Steve French: - multichannel patches mostly related to improving reconnect behavior - minor cleanup patches * tag '5.17-rc-part1-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6: cifs: fix FILE_BOTH_DIRECTORY_INFO definition cifs: move superblock magic defitions to magic.h cifs: Fix smb311_update_preauth_hash() kernel-doc comment cifs: avoid race during socket reconnect between send and recv cifs: maintain a state machine for tcp/smb/tcon sessions cifs: fix hang on cifs_get_next_mid() cifs: take cifs_tcp_ses_lock for status checks cifs: reconnect only the connection and not smb session where possible cifs: add WARN_ON for when chan_count goes below minimum cifs: adjust DebugData to use chans_need_reconnect for conn status cifs: use the chans_need_reconnect bitmap for reconnect status cifs: track individual channel status using chans_need_reconnect cifs: remove redundant assignment to pointer p commit a6097180d884ddab769fb25588ea8598589c218c Author: NeilBrown Date: Mon Jan 17 09:07:26 2022 +1100 devtmpfs regression fix: reconfigure on each mount Prior to Linux v5.4 devtmpfs used mount_single() which treats the given mount options as "remount" options, so it updates the configuration of the single super_block on each mount. Since that was changed, the mount options used for devtmpfs are ignored. This is a regression which affect systemd - which mounts devtmpfs with "-o mode=755,size=4m,nr_inodes=1m". This patch restores the "remount" effect by calling reconfigure_single() Fixes: d401727ea0d7 ("devtmpfs: don't mix {ramfs,shmem}_fill_super() with mount_single()") Acked-by: Christian Brauner Cc: Al Viro Signed-off-by: NeilBrown Signed-off-by: Linus Torvalds commit 3c750c7b614322a4ab50be0d57a76addb598d51d Merge: b520085ca5798 f346f32701eba Author: Linus Torvalds Date: Mon Jan 17 08:48:09 2022 +0200 Merge tag 'fbdev-5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev Pull fbdev maintainership update from Helge Deller: "The fbdev layer is orphaned, but seems to need some care. So I'd like to step up as new maintainer" * tag 'fbdev-5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev: MAINTAINERS: Add Helge as fbdev maintainer commit b520085ca57982c4beeb9bb64b8f6018425cb61f Merge: 4b3789512f018 762f99f4f3cb4 Author: Linus Torvalds Date: Mon Jan 17 08:27:55 2022 +0200 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input Pull input updates from Dmitry Torokhov: "Updates to Goodix touchscreen driver (addition of pen support) and Silead touchscreen driver (also addition of pen support and parsing of embedded firmware to determine screen size), along with assorted fixes for other drivers" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: ti_am335x_tsc - fix a typo in a comment Input: zinitix - add compatible for bt532 Input: zinitix - handle proper supply names dt-bindings: input/ts/zinitix: Convert to YAML, fix and extend Input: axp20x-pek - revert "always register interrupt handlers" change Input: gpio-keys - avoid clearing twice some memory Input: byd - fix typo in a comment Input: ucb1400_ts - remove redundant variable penup Input: ti_am335x_tsc - lower the X and Y sampling time Input: ti_am335x_tsc - fix STEPCONFIG setup for Z2 Input: ti_am335x_tsc - set ADCREFM for X configuration Input: silead - add pen support Input: silead - add support for EFI-embedded fw using different min/max coordinates Input: goodix - 2 small fixes for pen support Input: goodix - improve gpiod_get() error logging Input: goodix - add pen support Input: ff-core - correct magnitude setting for rumble compatibility Input: palmas-pwrbutton - make a couple of arrays static const Input: wacom_i2c - clean up the query device fields Input: palmas-pwrbutton - use bitfield helpers commit 4b3789512f018819e0c4b0776731dc4ce694c484 Merge: 96000bc956628 13462ba1815db Author: Linus Torvalds Date: Mon Jan 17 08:20:28 2022 +0200 Merge tag 'i3c/for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux Pull i3c updates from Alexandre Belloni: "Mostly non urgent fixes and a few improvements (including runtime pm suport) to the Silvaco driver" * tag 'i3c/for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux: i3c: master: dw: check return of dw_i3c_master_get_free_pos() i3c: master: mipi-i3c-hci: correct the config reference for endianness i3c: master: svc: enable the interrupt in the enable ibi function i3c: master: svc: add the missing module device table i3c: master: svc: add runtime pm support i3c: master: svc: set ODSTOP to let I2C device see the STOP signal i3c: master: svc: add support for slave to stop returning data i3c: master: svc: separate err, fifo and disable interrupt of reset function i3c: master: svc: fix atomic issue i3c: master: svc: move module reset behind clk enable i3c/master/mipi-i3c-hci: Fix a potentially infinite loop in 'hci_dat_v1_get_index()' i3c: fix incorrect address slot lookup on 64-bit i3c/master/mipi-i3c-hci: Prefer kcalloc over open coded arithmetic i3c/master/mipi-i3c-hci: Prefer struct_size over open coded arithmetic commit 96000bc956628dc0cc608696d5385ffc19e65a76 Merge: 2225acc322750 8cd778650ae22 Author: Linus Torvalds Date: Mon Jan 17 08:14:18 2022 +0200 Merge tag 'ntb-5.17' of git://github.com/jonmason/ntb Pull NTB updates from Jon Mason: "New AMD PCI ID for NTB, and a number of bug fixes for ntb_hw_switchtec for Linux v5.17" * tag 'ntb-5.17' of git://github.com/jonmason/ntb: ntb_hw_switchtec: Fix a minor issue in config_req_id_table() ntb_hw_switchtec: Remove code for disabling ID protection ntb_hw_switchtec: Update the way of getting VEP instance ID ntb_hw_switchtec: AND with the part_map for a valid tpart_vec ntb_hw_switchtec: Fix bug with more than 32 partitions ntb_hw_switchtec: Fix pff ioread to read into mmio_part_cfg_all ntb_hw_switchtec: fix the spelling of "its" NTB/msi: Fix ntbm_msi_request_threaded_irq() kernel-doc comment ntb_hw_amd: Add NTB PCI ID for new gen CPU commit 2225acc32275085d5e0ce5845c6fd18d61204b49 Merge: b70b878c32ef3 ffd264bd152cb Author: Linus Torvalds Date: Mon Jan 17 08:07:57 2022 +0200 Merge tag 'linux-watchdog-5.17-rc1' of git://www.linux-watchdog.org/linux-watchdog Pull watchdog updates from Wim Van Sebroeck: - New device support: - Watchdog Timer driver for RZ/G2L - Realtek Otto watchdog timer - Apple SoC watchdog driver - Fintek F81966 - Remove BCM63XX_WDT after support for this SoC was added to BCM7038_WDT - Improvements of the BCM7038_WDT and s3c2410_wdt code - Several other fixes and improvements * tag 'linux-watchdog-5.17-rc1' of git://www.linux-watchdog.org/linux-watchdog: (38 commits) watchdog: msc313e: Check if the WDT was running at boot watchdog: Add Apple SoC watchdog driver dt-bindings: watchdog: Add SM6350 and SM8250 compatible watchdog: s3c2410: Fix getting the optional clock watchdog: s3c2410: Use platform_get_irq() to get the interrupt dt-bindings: watchdog: atmel: Add missing 'interrupts' property watchdog: mtk_wdt: use platform_get_irq_optional watchdog: Add Watchdog Timer driver for RZ/G2L dt-bindings: watchdog: renesas,wdt: Add support for RZ/G2L watchdog: da9063: Add hard dependency on I2C watchdog: Add Realtek Otto watchdog timer dt-bindings: watchdog: Realtek Otto WDT binding watchdog: s3c2410: Add Exynos850 support watchdog: da9063: use atomic safe i2c transfer in reset handler watchdog: davinci: Use div64_ul instead of do_div watchdog: Remove BCM63XX_WDT MIPS: BCM63XX: Provide platform data to watchdog device watchdog: bcm7038_wdt: Add platform device id for bcm63xx-wdt watchdog: Allow building BCM7038_WDT for BCM63XX watchdog: bcm7038_wdt: Support platform data configuration ... commit b70b878c32ef3971334ade7fac8f47e4629b029c Merge: 763978ca67a3d 3cdb8e995ee2e Author: Linus Torvalds Date: Mon Jan 17 08:00:56 2022 +0200 Merge branch 'for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux Pull coccinelle updates from Julia Lawall: "Remove some semantic patches and remove a maintainer. Qing Wang reported that fen.cocci mostly finds false positives, so it is dropped. scripts/coccinelle/iterators/for_each_child.cocci also subsumes it, in a more correct way. Matthew Wilcox reported that bugon.cocci mostly gives false positives. It is an old script and was designed to be inaccurate to maximally cover problems, but most of what it is useful for has been done already. Gilles Muller passed away and is thus dropped from the maintainers list" * 'for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux: drop fen.cocci scripts/coccinelle: drop bugon.cocci MAINTAINERS: remove Gilles Muller commit 763978ca67a3d7be3915e2035e2a6c331524c748 Merge: 98f2345773f9a a97ac8cb24a3c Author: Linus Torvalds Date: Mon Jan 17 07:32:51 2022 +0200 Merge branch 'modules-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux Pull module updates from Luis Chamberlain: "The biggest change here is in-kernel support for module decompression. This change is being made to help support LSMs like LoadPin as otherwise it loses link between the source of kernel module on the disk and binary blob that is being loaded into the kernel. kmod decompression is still done by userspace even with this is done, both because there are no measurable gains in not doing so and as it adds a secondary extra check for validating the module before loading it into the kernel. The rest of the changes are minor, the only other change worth mentionin there is Jessica Yu is now bowing out of maintenance of modules as she's taking a break from work. While there were other changes posted for modules, those have not yet received much review of testing so I'm not yet comfortable in merging any of those changes yet." * 'modules-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux: module: fix signature check failures when using in-kernel decompression kernel: Fix spelling mistake "compresser" -> "compressor" MAINTAINERS: add mailing lists for kmod and modules module.h: allow #define strings to work with MODULE_IMPORT_NS module: add in-kernel support for decompressing MAINTAINERS: Remove myself as modules maintainer module: Remove outdated comment commit 98f2345773f9ac739350230a85f9a7f7b1fe21a6 Author: Linus Torvalds Date: Mon Jan 17 07:26:43 2022 +0200 unicode: fix .gitignore for generated utfdata file Commit 2b3d04787012 ("unicode: Add utf8-data module") changed the generated utf8data file from 'utf8data.h' to 'utf8data.c', but didn't change the comments or the .gitignore to match. The comments should be updated too, but at least they don't cause any visible breakage. But the gitignore file needs changing to avoid git complaining about untracked files. Fixes: 2b3d04787012 ("unicode: Add utf8-data module") Signed-off-by: Linus Torvalds commit 429a64f6e91fbfe4912d17247c27d0d66767b1c2 Author: Athira Rajeev Date: Fri Jan 14 08:43:55 2022 +0530 powerpc/perf: Only define power_pmu_wants_prompt_pmi() for CONFIG_PPC64 power_pmu_wants_prompt_pmi() is used to decide if PMIs should be taken promptly. This is valid only for ppc64 and is used only if CONFIG_PPC_BOOK3S_64=y. Hence include the function under config check for PPC64. Fixes warning for 32-bit compilation: arch/powerpc/perf/core-book3s.c:2455:6: warning: no previous prototype for 'power_pmu_wants_prompt_pmi' 2455 | bool power_pmu_wants_prompt_pmi(void) | ^~~~~~~~~~~~~~~~~~~~~~~~~~ Fixes: 5a7745b96f43 ("powerpc/64s/perf: add power_pmu_wants_prompt_pmi to say whether perf wants PMIs to be soft-NMI") Reported-by: kernel test robot Signed-off-by: Athira Rajeev Reviewed-by: Nicholas Piggin [mpe: Move inside existing CONFIG_PPC64 ifdef block] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220114031355.87480-1-atrajeev@linux.vnet.ibm.com commit 35ce8ae9ae2e471f92759f9d6880eab42cc1c3b6 Merge: 6661224e66f03 a403df29789ba Author: Linus Torvalds Date: Mon Jan 17 05:49:30 2022 +0200 Merge branch 'signal-for-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace Pull signal/exit/ptrace updates from Eric Biederman: "This set of changes deletes some dead code, makes a lot of cleanups which hopefully make the code easier to follow, and fixes bugs found along the way. The end-game which I have not yet reached yet is for fatal signals that generate coredumps to be short-circuit deliverable from complete_signal, for force_siginfo_to_task not to require changing userspace configured signal delivery state, and for the ptrace stops to always happen in locations where we can guarantee on all architectures that the all of the registers are saved and available on the stack. Removal of profile_task_ext, profile_munmap, and profile_handoff_task are the big successes for dead code removal this round. A bunch of small bug fixes are included, as most of the issues reported were small enough that they would not affect bisection so I simply added the fixes and did not fold the fixes into the changes they were fixing. There was a bug that broke coredumps piped to systemd-coredump. I dropped the change that caused that bug and replaced it entirely with something much more restrained. Unfortunately that required some rebasing. Some successes after this set of changes: There are few enough calls to do_exit to audit in a reasonable amount of time. The lifetime of struct kthread now matches the lifetime of struct task, and the pointer to struct kthread is no longer stored in set_child_tid. The flag SIGNAL_GROUP_COREDUMP is removed. The field group_exit_task is removed. Issues where task->exit_code was examined with signal->group_exit_code should been examined were fixed. There are several loosely related changes included because I am cleaning up and if I don't include them they will probably get lost. The original postings of these changes can be found at: https://lkml.kernel.org/r/87a6ha4zsd.fsf@email.froward.int.ebiederm.org https://lkml.kernel.org/r/87bl1kunjj.fsf@email.froward.int.ebiederm.org https://lkml.kernel.org/r/87r19opkx1.fsf_-_@email.froward.int.ebiederm.org I trimmed back the last set of changes to only the obviously correct once. Simply because there was less time for review than I had hoped" * 'signal-for-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: (44 commits) ptrace/m68k: Stop open coding ptrace_report_syscall ptrace: Remove unused regs argument from ptrace_report_syscall ptrace: Remove second setting of PT_SEIZED in ptrace_attach taskstats: Cleanup the use of task->exit_code exit: Use the correct exit_code in /proc//stat exit: Fix the exit_code for wait_task_zombie exit: Coredumps reach do_group_exit exit: Remove profile_handoff_task exit: Remove profile_task_exit & profile_munmap signal: clean up kernel-doc comments signal: Remove the helper signal_group_exit signal: Rename group_exit_task group_exec_task coredump: Stop setting signal->group_exit_task signal: Remove SIGNAL_GROUP_COREDUMP signal: During coredumps set SIGNAL_GROUP_EXIT in zap_process signal: Make coredump handling explicit in complete_signal signal: Have prepare_signal detect coredumps using signal->core_state signal: Have the oom killer detect coredumps using signal->core_state exit: Move force_uaccess back into do_exit exit: Guarantee make_task_dead leaks the tsk when calling do_task_exit ... commit 6661224e66f03706daea8e27714436851cf01731 Merge: 79e06c4c4950b e2a58d2d3416a Author: Linus Torvalds Date: Mon Jan 17 05:40:02 2022 +0200 Merge tag 'unicode-for-next-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/krisman/unicode Pull unicode updates from Gabriel Krisman Bertazi: "This includes patches from Christoph Hellwig to split the large data tables of the unicode subsystem into a loadable module, which allow users to not have them around if case-insensitive filesystems are not to be used. It also includes minor code fixes to unicode and its users, from the same author. All the patches here have been on linux-next releases for the past months" * tag 'unicode-for-next-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/krisman/unicode: unicode: only export internal symbols for the selftests unicode: Add utf8-data module unicode: cache the normalization tables in struct unicode_map unicode: move utf8cursor to utf8-selftest.c unicode: simplify utf8len unicode: remove the unused utf8{,n}age{min,max} functions unicode: pass a UNICODE_AGE() tripple to utf8_load unicode: mark the version field in struct unicode_map unsigned unicode: remove the charset field from struct unicode_map f2fs: simplify f2fs_sb_read_encoding ext4: simplify ext4_sb_read_encoding commit 3abb28e275bfbe60136db37eae6679c3e1928cd5 Author: Matthew Wilcox (Oracle) Date: Fri Jan 7 13:03:48 2022 -0500 filemap: Use folio_put_refs() in filemap_free_folio() This shrinks filemap_free_folio() by 55 bytes in my .config; 24 bytes from removing the VM_BUG_ON_FOLIO() and 31 bytes from unifying the small/large folio paths. We could just use folio_ref_sub() here since the caller should hold a reference (as the VM_BUG_ON_FOLIO() was asserting), but that's fragile. Signed-off-by: Matthew Wilcox (Oracle) commit 3fe7fa5843d204e235d92902190fecb972a3f9cc Author: Matthew Wilcox (Oracle) Date: Fri Dec 10 15:09:21 2021 -0500 mm: Add folio_put_refs() This is like folio_put(), but puts N references at once instead of just one. It's like put_page_refs(), but does one atomic operation instead of two, and is available to more than just gup.c. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: John Hubbard Reviewed-by: Jason Gunthorpe Reviewed-by: William Kucharski commit 429e3d123d9a50cc9882402e40e0ac912d88cfcf Author: Moshe Tal Date: Sun Jan 16 19:39:29 2022 +0200 bonding: Fix extraction of ports from the packet headers Wrong hash sends single stream to multiple output interfaces. The offset calculation was relative to skb->head, fix it to be relative to skb->data. Fixes: a815bde56b15 ("net, bonding: Refactor bond_xmit_hash for use with xdp_buff") Reviewed-by: Jussi Maki Reviewed-by: Saeed Mahameed Reviewed-by: Gal Pressman Signed-off-by: Moshe Tal Acked-by: Jay Vosburgh Signed-off-by: David S. Miller commit 5ceee540fdc7f1d65ca6e2b1b193ce5aa95ab99c Author: Yang Yingliang Date: Thu Jan 6 15:57:11 2022 +0800 rtc: sunplus: fix return value in sp_rtc_probe() If devm_ioremap_resource() fails, it should return error code from sp_rtc->reg_base in sp_rtc_probe(). Fixes: fad6cbe9b2b4 ("rtc: Add driver for RTC in Sunplus SP7021") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220106075711.3216468-1-yangyingliang@huawei.com commit ff164ae39b82ee483b24579c8e22a13a8ce5bd04 Author: Riwen Lu Date: Thu Jan 6 16:46:09 2022 +0800 rtc: cmos: Evaluate century appropriate There's limiting the year to 2069. When setting the rtc year to 2070, reading it returns 1970. Evaluate century starting from 19 to count the correct year. $ sudo date -s 20700106 Mon 06 Jan 2070 12:00:00 AM CST $ sudo hwclock -w $ sudo hwclock -r 1970-01-06 12:00:49.604968+08:00 Fixes: 2a4daadd4d3e5071 ("rtc: cmos: ignore bogus century byte") Signed-off-by: Riwen Lu Acked-by: Eric Wong Reviewed-by: Mateusz Jończyk Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220106084609.1223688-1-luriwen@kylinos.cn commit 900ed72c8a190e8c0b87cb17abc645b8ec713011 Author: Dan Carpenter Date: Fri Jan 7 10:33:40 2022 +0300 rtc: gamecube: Fix an IS_ERR() vs NULL check The devm_kzalloc() function returns NULL on error, it doesn't return error pointers. Fixes: 86559400b3ef ("rtc: gamecube: Add a RTC driver for the GameCube, Wii and Wii U") Signed-off-by: Dan Carpenter Reviewed-by: Emmanuel Gil Peyrot Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220107073340.GF22086@kili commit 7372971c1be5b7d4fdd8ad237798bdc1d1d54162 Author: Dan Carpenter Date: Tue Jan 11 10:19:22 2022 +0300 rtc: mc146818-lib: fix signedness bug in mc146818_get_time() The mc146818_get_time() function returns zero on success or negative a error code on failure. It needs to be type int. Fixes: d35786b3a28d ("rtc: mc146818-lib: change return values of mc146818_get_time()") Signed-off-by: Dan Carpenter Reviewed-by: Mateusz Jończyk Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220111071922.GE11243@kili commit 79e06c4c4950be2abd8ca5d2428a8c915aa62c24 Merge: cb3f09f9afe52 c862dcd199759 Author: Linus Torvalds Date: Sun Jan 16 16:15:14 2022 +0200 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm Pull kvm updates from Paolo Bonzini: "RISCV: - Use common KVM implementation of MMU memory caches - SBI v0.2 support for Guest - Initial KVM selftests support - Fix to avoid spurious virtual interrupts after clearing hideleg CSR - Update email address for Anup and Atish ARM: - Simplification of the 'vcpu first run' by integrating it into KVM's 'pid change' flow - Refactoring of the FP and SVE state tracking, also leading to a simpler state and less shared data between EL1 and EL2 in the nVHE case - Tidy up the header file usage for the nvhe hyp object - New HYP unsharing mechanism, finally allowing pages to be unmapped from the Stage-1 EL2 page-tables - Various pKVM cleanups around refcounting and sharing - A couple of vgic fixes for bugs that would trigger once the vcpu xarray rework is merged, but not sooner - Add minimal support for ARMv8.7's PMU extension - Rework kvm_pgtable initialisation ahead of the NV work - New selftest for IRQ injection - Teach selftests about the lack of default IPA space and page sizes - Expand sysreg selftest to deal with Pointer Authentication - The usual bunch of cleanups and doc update s390: - fix sigp sense/start/stop/inconsistency - cleanups x86: - Clean up some function prototypes more - improved gfn_to_pfn_cache with proper invalidation, used by Xen emulation - add KVM_IRQ_ROUTING_XEN_EVTCHN and event channel delivery - completely remove potential TOC/TOU races in nested SVM consistency checks - update some PMCs on emulated instructions - Intel AMX support (joint work between Thomas and Intel) - large MMU cleanups - module parameter to disable PMU virtualization - cleanup register cache - first part of halt handling cleanups - Hyper-V enlightened MSR bitmap support for nested hypervisors Generic: - clean up Makefiles - introduce CONFIG_HAVE_KVM_DIRTY_RING - optimize memslot lookup using a tree - optimize vCPU array usage by converting to xarray" * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (268 commits) x86/fpu: Fix inline prefix warnings selftest: kvm: Add amx selftest selftest: kvm: Move struct kvm_x86_state to header selftest: kvm: Reorder vcpu_load_state steps for AMX kvm: x86: Disable interception for IA32_XFD on demand x86/fpu: Provide fpu_sync_guest_vmexit_xfd_state() kvm: selftests: Add support for KVM_CAP_XSAVE2 kvm: x86: Add support for getting/setting expanded xstate buffer x86/fpu: Add uabi_size to guest_fpu kvm: x86: Add CPUID support for Intel AMX kvm: x86: Add XCR0 support for Intel AMX kvm: x86: Disable RDMSR interception of IA32_XFD_ERR kvm: x86: Emulate IA32_XFD_ERR for guest kvm: x86: Intercept #NM for saving IA32_XFD_ERR x86/fpu: Prepare xfd_err in struct fpu_guest kvm: x86: Add emulation for IA32_XFD x86/fpu: Provide fpu_update_guest_xfd() for IA32_XFD emulation kvm: x86: Enable dynamic xfeatures at KVM_SET_CPUID2 x86/fpu: Provide fpu_enable_guest_xfd_features() for KVM x86/fpu: Add guest support to xfd_enable_feature() ... commit cb3f09f9afe5286c0aed7a1c5cc71495de166efb Merge: 4d66020dcef83 4eea5332d67d8 Author: Linus Torvalds Date: Sun Jan 16 15:53:00 2022 +0200 Merge tag 'hyperv-next-signed-20220114' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux Pull hyperv updates from Wei Liu: - More patches for Hyper-V isolation VM support (Tianyu Lan) - Bug fixes and clean-up patches from various people * tag 'hyperv-next-signed-20220114' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux: scsi: storvsc: Fix storvsc_queuecommand() memory leak x86/hyperv: Properly deal with empty cpumasks in hyperv_flush_tlb_multi() Drivers: hv: vmbus: Initialize request offers message for Isolation VM scsi: storvsc: Fix unsigned comparison to zero swiotlb: Add CONFIG_HAS_IOMEM check around swiotlb_mem_remap() x86/hyperv: Fix definition of hv_ghcb_pg variable Drivers: hv: Fix definition of hypercall input & output arg variables net: netvsc: Add Isolation VM support for netvsc driver scsi: storvsc: Add Isolation VM support for storvsc driver hyper-v: Enable swiotlb bounce buffer for Isolation VM x86/hyper-v: Add hyperv Isolation VM check in the cc_platform_has() swiotlb: Add swiotlb bounce buffer remap function for HV IVM commit 56d99e81ecbc997a5f984684d0eeb583992b2072 Author: Wen Gu Date: Sun Jan 16 15:43:42 2022 +0800 net/smc: Fix hung_task when removing SMC-R devices A hung_task is observed when removing SMC-R devices. Suppose that a link group has two active links(lnk_A, lnk_B) associated with two different SMC-R devices(dev_A, dev_B). When dev_A is removed, the link group will be removed from smc_lgr_list and added into lgr_linkdown_list. lnk_A will be cleared and smcibdev(A)->lnk_cnt will reach to zero. However, when dev_B is removed then, the link group can't be found in smc_lgr_list and lnk_B won't be cleared, making smcibdev->lnk_cnt never reaches zero, which causes a hung_task. This patch fixes this issue by restoring the implementation of smc_smcr_terminate_all() to what it was before commit 349d43127dac ("net/smc: fix kernel panic caused by race of smc_sock"). The original implementation also satisfies the intention that make sure QP destroy earlier than CQ destroy because we will always wait for smcibdev->lnk_cnt reaches zero, which guarantees QP has been destroyed. Fixes: 349d43127dac ("net/smc: fix kernel panic caused by race of smc_sock") Signed-off-by: Wen Gu Signed-off-by: David S. Miller commit 0a6e6b3c7db6c34e3d149f09cd714972f8753e3f Author: Eric Dumazet Date: Sun Jan 16 01:02:20 2022 -0800 ipv4: update fib_info_cnt under spinlock protection In the past, free_fib_info() was supposed to be called under RTNL protection. This eventually was no longer the case. Instead of enforcing RTNL it seems we simply can move fib_info_cnt changes to occur when fib_info_lock is held. v2: David Laight suggested to update fib_info_cnt only when an entry is added/deleted to/from the hash table, as fib_info_cnt is used to make sure hash table size is optimal. BUG: KCSAN: data-race in fib_create_info / free_fib_info write to 0xffffffff86e243a0 of 4 bytes by task 26429 on cpu 0: fib_create_info+0xe78/0x3440 net/ipv4/fib_semantics.c:1428 fib_table_insert+0x148/0x10c0 net/ipv4/fib_trie.c:1224 fib_magic+0x195/0x1e0 net/ipv4/fib_frontend.c:1087 fib_add_ifaddr+0xd0/0x2e0 net/ipv4/fib_frontend.c:1109 fib_netdev_event+0x178/0x510 net/ipv4/fib_frontend.c:1466 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0x53/0xb0 kernel/notifier.c:391 __dev_notify_flags+0x1d3/0x3b0 dev_change_flags+0xa2/0xc0 net/core/dev.c:8872 do_setlink+0x810/0x2410 net/core/rtnetlink.c:2719 rtnl_group_changelink net/core/rtnetlink.c:3242 [inline] __rtnl_newlink net/core/rtnetlink.c:3396 [inline] rtnl_newlink+0xb10/0x13b0 net/core/rtnetlink.c:3506 rtnetlink_rcv_msg+0x745/0x7e0 net/core/rtnetlink.c:5571 netlink_rcv_skb+0x14e/0x250 net/netlink/af_netlink.c:2496 rtnetlink_rcv+0x18/0x20 net/core/rtnetlink.c:5589 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x5fc/0x6c0 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x726/0x840 net/netlink/af_netlink.c:1921 sock_sendmsg_nosec net/socket.c:704 [inline] sock_sendmsg net/socket.c:724 [inline] ____sys_sendmsg+0x39a/0x510 net/socket.c:2409 ___sys_sendmsg net/socket.c:2463 [inline] __sys_sendmsg+0x195/0x230 net/socket.c:2492 __do_sys_sendmsg net/socket.c:2501 [inline] __se_sys_sendmsg net/socket.c:2499 [inline] __x64_sys_sendmsg+0x42/0x50 net/socket.c:2499 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae read to 0xffffffff86e243a0 of 4 bytes by task 31505 on cpu 1: free_fib_info+0x35/0x80 net/ipv4/fib_semantics.c:252 fib_info_put include/net/ip_fib.h:575 [inline] nsim_fib4_rt_destroy drivers/net/netdevsim/fib.c:294 [inline] nsim_fib4_rt_replace drivers/net/netdevsim/fib.c:403 [inline] nsim_fib4_rt_insert drivers/net/netdevsim/fib.c:431 [inline] nsim_fib4_event drivers/net/netdevsim/fib.c:461 [inline] nsim_fib_event drivers/net/netdevsim/fib.c:881 [inline] nsim_fib_event_work+0x15ca/0x2cf0 drivers/net/netdevsim/fib.c:1477 process_one_work+0x3fc/0x980 kernel/workqueue.c:2298 process_scheduled_works kernel/workqueue.c:2361 [inline] worker_thread+0x7df/0xa70 kernel/workqueue.c:2447 kthread+0x2c7/0x2e0 kernel/kthread.c:327 ret_from_fork+0x1f/0x30 value changed: 0x00000d2d -> 0x00000d2e Reported by Kernel Concurrency Sanitizer on: CPU: 1 PID: 31505 Comm: kworker/1:21 Not tainted 5.16.0-rc6-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: events nsim_fib_event_work Fixes: 48bb9eb47b27 ("netdevsim: fib: Add dummy implementation for FIB offload") Signed-off-by: Eric Dumazet Reported-by: syzbot Cc: David Laight Cc: Ido Schimmel Cc: Jiri Pirko Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit d37823c3528e5e0705fc7746bcbc2afffb619259 Author: Christophe Leroy Date: Mon Jan 10 15:29:25 2022 +0000 powerpc/32s: Fix kasan_init_region() for KASAN It has been reported some configuration where the kernel doesn't boot with KASAN enabled. This is due to wrong BAT allocation for the KASAN area: ---[ Data Block Address Translation ]--- 0: 0xc0000000-0xcfffffff 0x00000000 256M Kernel rw m 1: 0xd0000000-0xdfffffff 0x10000000 256M Kernel rw m 2: 0xe0000000-0xefffffff 0x20000000 256M Kernel rw m 3: 0xf8000000-0xf9ffffff 0x2a000000 32M Kernel rw m 4: 0xfa000000-0xfdffffff 0x2c000000 64M Kernel rw m A BAT must have both virtual and physical addresses alignment matching the size of the BAT. This is not the case for BAT 4 above. Fix kasan_init_region() by using block_size() function that is in book3s32/mmu.c. To be able to reuse it here, make it non static and change its name to bat_block_size() in order to avoid name conflict with block_size() defined in Also reuse find_free_bat() to avoid an error message from setbat() when no BAT is available. And allocate memory outside of linear memory mapping to avoid wasting that precious space. With this change we get correct alignment for BATs and KASAN shadow memory is allocated outside the linear memory space. ---[ Data Block Address Translation ]--- 0: 0xc0000000-0xcfffffff 0x00000000 256M Kernel rw 1: 0xd0000000-0xdfffffff 0x10000000 256M Kernel rw 2: 0xe0000000-0xefffffff 0x20000000 256M Kernel rw 3: 0xf8000000-0xfbffffff 0x7c000000 64M Kernel rw 4: 0xfc000000-0xfdffffff 0x7a000000 32M Kernel rw Fixes: 7974c4732642 ("powerpc/32s: Implement dedicated kasan_init_region()") Cc: stable@vger.kernel.org Reported-by: Maxime Bizon Signed-off-by: Christophe Leroy Tested-by: Maxime Bizon Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/7a50ef902494d1325227d47d33dada01e52e5518.1641818726.git.christophe.leroy@csgroup.eu commit 87b9d74fb0be80054c729e8d6a119ca0955cedf3 Author: Christophe Leroy Date: Mon Jan 10 15:29:53 2022 +0000 powerpc/time: Fix build failure due to do_hard_irq_enable() on PPC32 CC arch/powerpc/kernel/time.o In file included from : ./arch/powerpc/include/asm/hw_irq.h: In function 'do_hard_irq_enable': ././include/linux/compiler_types.h:335:45: error: call to '__compiletime_assert_35' declared with attribute error: BUILD_BUG failed 335 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) | ^ ././include/linux/compiler_types.h:316:25: note: in definition of macro '__compiletime_assert' 316 | prefix ## suffix(); \ | ^~~~~~ ././include/linux/compiler_types.h:335:9: note: in expansion of macro '_compiletime_assert' 335 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__) | ^~~~~~~~~~~~~~~~~~~ ./include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert' 39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg) | ^~~~~~~~~~~~~~~~~~ ./include/linux/build_bug.h:59:21: note: in expansion of macro 'BUILD_BUG_ON_MSG' 59 | #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed") | ^~~~~~~~~~~~~~~~ ./arch/powerpc/include/asm/hw_irq.h:483:9: note: in expansion of macro 'BUILD_BUG' 483 | BUILD_BUG(); | ^~~~~~~~~ should_hard_irq_enable() returns false on PPC32 so this BUILD_BUG() shouldn't trigger. Force inlining of should_hard_irq_enable() Fixes: 0faf20a1ad16 ("powerpc/64s/interrupt: Don't enable MSR[EE] in irq handlers unless perf is in use") Signed-off-by: Christophe Leroy Acked-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/247e01e0e10f4dbc59b5ff89e81702eb1ee7641e.1641828571.git.christophe.leroy@csgroup.eu commit 5762f980ca10dcfe5eead7c40d1c34cae61f409b Author: Johannes Schickel Date: Sat Jan 15 15:02:57 2022 +0100 ALSA: usb-audio: add mapping for MSI MPG X570S Carbon Max Wifi. The USB audio device 0db0:419c based on the Realtek ALC4080 chip exposes all playback volume controls as "PCM". This is makes distinguishing the individual functions hard. The added mapping distinguishes all playback volume controls as their respective function: - Speaker - for back panel output - Frontpanel Headphone - for front panel output - IEC958 - for digital output on the back panel This clarifies the individual volume control functions for users. Signed-off-by: Johannes Schickel Link: https://lore.kernel.org/r/20220115140257.8751-1-lordhoto@gmail.com Signed-off-by: Takashi Iwai commit 4d66020dcef83314092f2c8c89152a8d122627e2 Merge: 77dbd72b982ca f37c3bbc63599 Author: Linus Torvalds Date: Sun Jan 16 10:15:32 2022 +0200 Merge tag 'trace-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace Pull tracing updates from Steven Rostedt: "New: - The Real Time Linux Analysis (RTLA) tool is added to the tools directory. - Can safely filter on user space pointers with: field.ustring ~ "match-string" - eprobes can now be filtered like any other event. - trace_marker(_raw) now uses stream_open() to allow multiple threads to safely write to it. Note, this could possibly break existing user space, but we will not know until we hear about it, and then can revert the change if need be. - New field in events to display when bottom halfs are disabled. - Sorting of the ftrace functions are now done at compile time instead of at bootup. Infrastructure changes to support future efforts: - Added __rel_loc type for trace events. Similar to __data_loc but the offset to the dynamic data is based off of the location of the descriptor and not the beginning of the event. Needed for user defined events. - Some simplification of event trigger code. - Make synthetic events process its callback better to not hinder other event callbacks that are registered. Needed for user defined events. And other small fixes and cleanups" * tag 'trace-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: (50 commits) tracing: Add ustring operation to filtering string pointers rtla: Add rtla timerlat hist documentation rtla: Add rtla timerlat top documentation rtla: Add rtla timerlat documentation rtla: Add rtla osnoise hist documentation rtla: Add rtla osnoise top documentation rtla: Add rtla osnoise man page rtla: Add Documentation rtla/timerlat: Add timerlat hist mode rtla: Add timerlat tool and timelart top mode rtla/osnoise: Add the hist mode rtla/osnoise: Add osnoise top mode rtla: Add osnoise tool rtla: Helper functions for rtla rtla: Real-Time Linux Analysis tool tracing/osnoise: Properly unhook events if start_per_cpu_kthreads() fails tracing: Remove duplicate warnings when calling trace_create_file() tracing/kprobes: 'nmissed' not showed correctly for kretprobe tracing: Add test for user space strings when filtering on string pointers tracing: Have syscall trace events use trace_event_buffer_lock_reserve() ... commit 77dbd72b982ca648b42b4feac5f8b2ea55e4ed09 Merge: d0a231f01e5b2 b2dfc3fe73b5b Author: Linus Torvalds Date: Sun Jan 16 10:08:13 2022 +0200 Merge tag 'livepatching-for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching Pull livepatching updates from Petr Mladek: - Correctly handle kobjects when a livepatch init fails - Avoid CPU hogging when searching for many livepatched symbols - Add livepatch API page into documentation * tag 'livepatching-for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching: livepatch: Avoid CPU hogging with cond_resched livepatch: Fix missing unlock on error in klp_enable_patch() livepatch: Fix kobject refcount bug on klp_init_patch_early failure path Documentation: livepatch: Add livepatch API page commit d0a231f01e5b25bacd23e6edc7c979a18a517b2b Merge: 88db8458086b1 87c71931633bd Author: Linus Torvalds Date: Sun Jan 16 08:08:11 2022 +0200 Merge tag 'pci-v5.17-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci Pull pci updates from Bjorn Helgaas: "Enumeration: - Use pci_find_vsec_capability() instead of open-coding it (Andy Shevchenko) - Convert pci_dev_present() stub from macro to static inline to avoid 'unused variable' errors (Hans de Goede) - Convert sysfs slot attributes from default_attrs to default_groups (Greg Kroah-Hartman) - Use DWORD accesses for LTR, L1 SS to avoid BayHub OZ711LV2 erratum (Rajat Jain) - Remove unnecessary initialization of static variables (Longji Guo) Resource management: - Always write Intel I210 ROM BAR on update to work around device defect (Bjorn Helgaas) PCIe native device hotplug: - Fix pciehp lockdep errors on Thunderbolt undock (Hans de Goede) - Fix infinite loop in pciehp IRQ handler on power fault (Lukas Wunner) Power management: - Convert amd64-agp, sis-agp, via-agp from legacy PCI power management to generic power management (Vaibhav Gupta) IOMMU: - Add function 1 DMA alias quirk for Marvell 88SE9125 SATA controller so it can work with an IOMMU (Yifeng Li) Error handling: - Add PCI_ERROR_RESPONSE and related definitions for signaling and checking for transaction errors on PCI (Naveen Naidu) - Fabricate PCI_ERROR_RESPONSE data (~0) in config read wrappers, instead of in host controller drivers, when transactions fail on PCI (Naveen Naidu) - Use PCI_POSSIBLE_ERROR() to check for possible failure of config reads (Naveen Naidu) Peer-to-peer DMA: - Add Logan Gunthorpe as P2PDMA maintainer (Bjorn Helgaas) ASPM: - Calculate link L0s and L1 exit latencies when needed instead of caching them (Saheed O. Bolarinwa) - Calculate device L0s and L1 acceptable exit latencies when needed instead of caching them (Saheed O. Bolarinwa) - Remove struct aspm_latency since it's no longer needed (Saheed O. Bolarinwa) APM X-Gene PCIe controller driver: - Fix IB window setup, which was broken by the fact that IB resources are now sorted in address order instead of DT dma-ranges order (Rob Herring) Apple PCIe controller driver: - Enable clock gating to save power (Hector Martin) - Fix REFCLK1 enable/poll logic (Hector Martin) Broadcom STB PCIe controller driver: - Declare bitmap correctly for use by bitmap interfaces (Christophe JAILLET) - Clean up computation of legacy and non-legacy MSI bitmasks (Florian Fainelli) - Update suspend/resume/remove error handling to warn about errors and not fail the operation (Jim Quinlan) - Correct the "pcie" and "msi" interrupt descriptions in DT binding (Jim Quinlan) - Add DT bindings for endpoint voltage regulators (Jim Quinlan) - Split brcm_pcie_setup() into two functions (Jim Quinlan) - Add mechanism for turning on voltage regulators for connected devices (Jim Quinlan) - Turn voltage regulators for connected devices on/off when bus is added or removed (Jim Quinlan) - When suspending, don't turn off voltage regulators for wakeup devices (Jim Quinlan) Freescale i.MX6 PCIe controller driver: - Add i.MX8MM support (Richard Zhu) Freescale Layerscape PCIe controller driver: - Use DWC common ops instead of layerscape-specific link-up functions (Hou Zhiqiang) Intel VMD host bridge driver: - Honor platform ACPI _OSC feature negotiation for Root Ports below VMD (Kai-Heng Feng) - Add support for Raptor Lake SKUs (Karthik L Gopalakrishnan) - Reset everything below VMD before enumerating to work around failure to enumerate NVMe devices when guest OS reboots (Nirmal Patel) Bridge emulation (used by Marvell Aardvark and MVEBU): - Make emulated ROM BAR read-only by default (Pali Rohár) - Make some emulated legacy PCI bits read-only for PCIe devices (Pali Rohár) - Update reserved bits in emulated PCIe Capability (Pali Rohár) - Allow drivers to emulate different PCIe Capability versions (Pali Rohár) - Set emulated Capabilities List bit for all PCIe devices, since they must have at least a PCIe Capability (Pali Rohár) Marvell Aardvark PCIe controller driver: - Add bridge emulation definitions for PCIe DEVCAP2, DEVCTL2, DEVSTA2, LNKCAP2, LNKCTL2, LNKSTA2, SLTCAP2, SLTCTL2, SLTSTA2 (Pali Rohár) - Add aardvark support for DEVCAP2, DEVCTL2, LNKCAP2 and LNKCTL2 registers (Pali Rohár) - Clear all MSIs at setup to avoid spurious interrupts (Pali Rohár) - Disable bus mastering when unbinding host controller driver (Pali Rohár) - Mask all interrupts when unbinding host controller driver (Pali Rohár) - Fix memory leak in host controller unbind (Pali Rohár) - Assert PERST# when unbinding host controller driver (Pali Rohár) - Disable link training when unbinding host controller driver (Pali Rohár) - Disable common PHY when unbinding host controller driver (Pali Rohár) - Fix resource type checking to check only IORESOURCE_MEM, not IORESOURCE_MEM_64, which is a flavor of IORESOURCE_MEM (Pali Rohár) Marvell MVEBU PCIe controller driver: - Implement pci_remap_iospace() for ARM so mvebu can use devm_pci_remap_iospace() instead of the previous ARM-specific pci_ioremap_io() interface (Pali Rohár) - Use the standard pci_host_probe() instead of the device-specific mvebu_pci_host_probe() (Pali Rohár) - Replace all uses of ARM-specific pci_ioremap_io() with the ARM implementation of the standard pci_remap_iospace() interface and remove pci_ioremap_io() (Pali Rohár) - Skip initializing invalid Root Ports (Pali Rohár) - Check for errors from pci_bridge_emul_init() (Pali Rohár) - Ignore any bridges at non-zero function numbers (Pali Rohár) - Return ~0 data for invalid config read size (Pali Rohár) - Disallow mapping interrupts on emulated bridges (Pali Rohár) - Clear Root Port Memory & I/O Space Enable and Bus Master Enable at initialization (Pali Rohár) - Make type bits in Root Port I/O Base register read-only (Pali Rohár) - Disable Root Port windows when base/limit set to invalid values (Pali Rohár) - Set controller to Root Complex mode (Pali Rohár) - Set Root Port Class Code to PCI Bridge (Pali Rohár) - Update emulated Root Port secondary bus numbers to better reflect the actual topology (Pali Rohár) - Add PCI_BRIDGE_CTL_BUS_RESET support to emulated Root Ports so pci_reset_secondary_bus() can reset connected devices (Pali Rohár) - Add PCI_EXP_DEVCTL Error Reporting Enable support to emulated Root Ports (Pali Rohár) - Add PCI_EXP_RTSTA PME Status bit support to emulated Root Ports (Pali Rohár) - Add DEVCAP2, DEVCTL2 and LNKCTL2 support to emulated Root Ports on Armada XP and newer devices (Pali Rohár) - Export mvebu-mbus.c symbols to allow pci-mvebu.c to be a module (Pali Rohár) - Add support for compiling as a module (Pali Rohár) MediaTek PCIe controller driver: - Assert PERST# for 100ms to allow power and clock to stabilize (qizhong cheng) MediaTek PCIe Gen3 controller driver: - Disable Mediatek DVFSRC voltage request since lack of DVFSRC to respond to the request causes failure to exit L1 PM Substate (Jianjun Wang) MediaTek MT7621 PCIe controller driver: - Declare mt7621_pci_ops static (Sergio Paracuellos) - Give pcibios_root_bridge_prepare() access to host bridge windows (Sergio Paracuellos) - Move MIPS I/O coherency unit setup from driver to pcibios_root_bridge_prepare() (Sergio Paracuellos) - Add missing MODULE_LICENSE() (Sergio Paracuellos) - Allow COMPILE_TEST for all arches (Sergio Paracuellos) Microsoft Hyper-V host bridge driver: - Add hv-internal interfaces to encapsulate arch IRQ dependencies (Sunil Muthuswamy) - Add arm64 Hyper-V vPCI support (Sunil Muthuswamy) Qualcomm PCIe controller driver: - Undo PM setup in qcom_pcie_probe() error handling path (Christophe JAILLET) - Use __be16 type to store return value from cpu_to_be16() (Manivannan Sadhasivam) - Constify static dw_pcie_ep_ops (Rikard Falkeborn) Renesas R-Car PCIe controller driver: - Fix aarch32 abort handler so it doesn't check the wrong bus clock before accessing the host controller (Marek Vasut) TI Keystone PCIe controller driver: - Add register offset for ti,syscon-pcie-id and ti,syscon-pcie-mode DT properties (Kishon Vijay Abraham I) MicroSemi Switchtec management driver: - Add Gen4 automotive device IDs (Kelvin Cao) - Declare state_names[] as static so it's not allocated and initialized for every call (Kelvin Cao) Host controller driver cleanups: - Use of_device_get_match_data(), not of_match_device(), when we only need the device data in altera, artpec6, cadence, designware-plat, dra7xx, keystone, kirin (Fan Fei) - Drop pointless of_device_get_match_data() cast in j721e (Bjorn Helgaas) - Drop redundant struct device * from j721e since struct cdns_pcie already has one (Bjorn Helgaas) - Rename driver structs to *_pcie in intel-gw, iproc, ls-gen4, mediatek-gen3, microchip, mt7621, rcar-gen2, tegra194, uniphier, xgene, xilinx, xilinx-cpm for consistency across drivers (Fan Fei) - Fix invalid address space conversions in hisi, spear13xx (Bjorn Helgaas) Miscellaneous: - Sort Intel Device IDs by value (Andy Shevchenko) - Change Capability offsets to hex to match spec (Baruch Siach) - Correct misspellings (Krzysztof Wilczyński) - Terminate statement with semicolon in pci_endpoint_test.c (Ming Wang)" * tag 'pci-v5.17-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (151 commits) PCI: mt7621: Allow COMPILE_TEST for all arches PCI: mt7621: Add missing MODULE_LICENSE() PCI: mt7621: Move MIPS setup to pcibios_root_bridge_prepare() PCI: Let pcibios_root_bridge_prepare() access bridge->windows PCI: mt7621: Declare mt7621_pci_ops static PCI: brcmstb: Do not turn off WOL regulators on suspend PCI: brcmstb: Add control of subdevice voltage regulators PCI: brcmstb: Add mechanism to turn on subdev regulators PCI: brcmstb: Split brcm_pcie_setup() into two funcs dt-bindings: PCI: Add bindings for Brcmstb EP voltage regulators dt-bindings: PCI: Correct brcmstb interrupts, interrupt-map. PCI: brcmstb: Fix function return value handling PCI: brcmstb: Do not use __GENMASK PCI: brcmstb: Declare 'used' as bitmap, not unsigned long PCI: hv: Add arm64 Hyper-V vPCI support PCI: hv: Make the code arch neutral by adding arch specific interfaces PCI: pciehp: Use down_read/write_nested(reset_lock) to fix lockdep errors x86/PCI: Remove initialization of static variables to false PCI: Use DWORD accesses for LTR, L1 SS to avoid erratum misc: pci_endpoint_test: Terminate statement with semicolon ... commit 88db8458086b1dcf20b56682504bdb34d2bca0e2 Merge: 175398a0972bc 3d966521a8240 Author: Linus Torvalds Date: Sun Jan 16 07:54:11 2022 +0200 Merge tag 'exfat-for-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat Pull exfat updates from Namjae Jeon: - Fix ->i_blocks truncation issue that still exists elsewhere. - Four cleanups & typos fixes. - Move super block magic number to magic.h - Fix missing REQ_SYNC in exfat_update_bhs(). * tag 'exfat-for-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat: exfat: fix missing REQ_SYNC in exfat_update_bhs() exfat: remove argument 'sector' from exfat_get_dentry() exfat: move super block magic number to magic.h exfat: fix i_blocks for files truncated over 4 GiB exfat: reuse exfat_inode_info variable instead of calling EXFAT_I() exfat: make exfat_find_location() static exfat: fix typos in comments exfat: simplify is_valid_cluster() commit 175398a0972bc3ca1e824be324f17d8318357eba Merge: 49ad227d54e84 1672086167539 Author: Linus Torvalds Date: Sun Jan 16 07:42:58 2022 +0200 Merge tag 'nfsd-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux Pull nfsd updates from Chuck Lever: "Bruce has announced he is leaving Red Hat at the end of the month and is stepping back from his role as NFSD co-maintainer. As a result, this includes a patch removing him from the MAINTAINERS file. There is one patch in here that Jeff Layton was carrying in the locks tree. Since he had only one for this cycle, he asked us to send it to you via the nfsd tree. There continues to be 0-day reports from Robert Morris @MIT. This time we include a fix for a crash in the COPY_NOTIFY operation. Highlights: - Bruce steps down as NFSD maintainer - Prepare for dynamic nfsd thread management - More work on supporting re-exporting NFS mounts - One fs/locks patch on behalf of Jeff Layton Notable bug fixes: - Fix zero-length NFSv3 WRITEs - Fix directory cinfo on FS's that do not support iversion - Fix WRITE verifiers for stable writes - Fix crash on COPY_NOTIFY with a special state ID" * tag 'nfsd-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux: (51 commits) SUNRPC: Fix sockaddr handling in svcsock_accept_class trace points SUNRPC: Fix sockaddr handling in the svc_xprt_create_error trace point fs/locks: fix fcntl_getlk64/fcntl_setlk64 stub prototypes nfsd: fix crash on COPY_NOTIFY with special stateid MAINTAINERS: remove bfields NFSD: Move fill_pre_wcc() and fill_post_wcc() Revert "nfsd: skip some unnecessary stats in the v4 case" NFSD: Trace boot verifier resets NFSD: Rename boot verifier functions NFSD: Clean up the nfsd_net::nfssvc_boot field NFSD: Write verifier might go backwards nfsd: Add a tracepoint for errors in nfsd4_clone_file_range() NFSD: De-duplicate net_generic(nf->nf_net, nfsd_net_id) NFSD: De-duplicate net_generic(SVC_NET(rqstp), nfsd_net_id) NFSD: Clean up nfsd_vfs_write() nfsd: Replace use of rwsem with errseq_t NFSD: Fix verifier returned in stable WRITEs nfsd: Retry once in nfsd_open on an -EOPENSTALE return nfsd: Add errno mapping for EREMOTEIO nfsd: map EBADF ... commit 49ad227d54e842f436ed0122cb7c901d857b86cb Merge: 59d41458f143b 19d1c32652bbb Author: Linus Torvalds Date: Sun Jan 16 07:36:49 2022 +0200 Merge tag '9p-for-5.17-rc1' of git://github.com/martinetd/linux Pull 9p updates from Dominique Martinet: "Fixes, split 9p_net_fd, and new reviewer: - fix possible uninitialized memory usage for setattr - fix fscache reading hole in a file just after it's been grown - split net/9p/trans_fd.c in its own module like other transports. The new transport module defaults to 9P_NET and is autoloaded if required so users should not be impacted - add Christian Schoenebeck to 9p reviewers - some more trivial cleanup" * tag '9p-for-5.17-rc1' of git://github.com/martinetd/linux: 9p: fix enodata when reading growing file net/9p: show error message if user 'msize' cannot be satisfied MAINTAINERS: 9p: add Christian Schoenebeck as reviewer 9p: only copy valid iattrs in 9P2000.L setattr implementation 9p: Use BUG_ON instead of if condition followed by BUG. net/p9: load default transports 9p/xen: autoload when xenbus service is available 9p/trans_fd: split into dedicated module fs: 9p: remove unneeded variable 9p/trans_virtio: Fix typo in the comment for p9_virtio_create() commit 59d41458f143b7a20997b1e78b5c15d9d3e998c3 Merge: 2aab34f873cc6 4efdddbce7c13 Author: Linus Torvalds Date: Sun Jan 16 06:52:38 2022 +0200 Merge tag 'drm-next-2022-01-14' of git://anongit.freedesktop.org/drm/drm Pull drm fixes from Daniel Vetter: "drivers fixes: - i915 fixes for ttm backend + one pm wakelock fix - amdgpu fixes, fairly big pile of small things all over. Note this doesn't yet containe the fixed version of the otg sync patch that blew up - small driver fixes: meson, sun4i, vga16fb probe fix drm core fixes: - cma-buf heap locking - ttm compilation - self refresh helper state check - wrong error message in atomic helpers - mipi-dbi buffer mapping" * tag 'drm-next-2022-01-14' of git://anongit.freedesktop.org/drm/drm: (49 commits) drm/mipi-dbi: Fix source-buffer address in mipi_dbi_buf_copy drm: fix error found in some cases after the patch d1af5cd86997 drm/ttm: fix compilation on ARCH=um dma-buf: cma_heap: Fix mutex locking section video: vga16fb: Only probe for EGA and VGA 16 color graphic cards drm/amdkfd: Fix ASIC name typos drm/amdkfd: Fix DQM asserts on Hawaii drm/amdgpu: Use correct VIEWPORT_DIMENSION for DCN2 drm/amd/pm: only send GmiPwrDnControl msg on master die (v3) drm/amdgpu: use spin_lock_irqsave to avoid deadlock by local interrupt drm/amdgpu: not return error on the init_apu_flags drm/amdkfd: Use prange->update_list head for remove_list drm/amdkfd: Use prange->list head for insert_list drm/amdkfd: make SPDX License expression more sound drm/amdkfd: Check for null pointer after calling kmemdup drm/amd/display: invalid parameter check in dmub_hpd_callback Revert "drm/amdgpu: Don't inherit GEM object VMAs in child process" drm/amd/display: reset dcn31 SMU mailbox on failures drm/amdkfd: use default_groups in kobj_type drm/amdgpu: use default_groups in kobj_type ... commit 2aab34f873cc611cf195231c3738080c8dbda7f3 Merge: f56caedaf94f9 a59466ee91aaa Author: Linus Torvalds Date: Sun Jan 16 06:43:14 2022 +0200 Merge tag 'memblock-v5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock Pull memblock cleanup from Mike Rapoport: "Remove #ifdef __KERNEL__ from memblock.h memblock.h is not a uAPI header, so __KERNEL__ guard can be deleted" * tag 'memblock-v5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock: memblock: Remove #ifdef __KERNEL__ from memblock.h commit 830af2eba40327abec64325a5b08b1e85c37a2e0 Author: Florian Westphal Date: Thu Jan 13 21:37:58 2022 +0100 netfilter: conntrack: don't increment invalid counter on NF_REPEAT The packet isn't invalid, REPEAT means we're trying again after cleaning out a stale connection, e.g. via tcp tracker. This caused increases of invalid stat counter in a test case involving frequent connection reuse, even though no packet is actually invalid. Fixes: 56a62e2218f5 ("netfilter: conntrack: fix NF_REPEAT handling") Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 9404bc1e58e4bed41f629da9e3b890b2ca1f8b9c Author: Wen Gu Date: Fri Jan 14 21:35:45 2022 +0800 net/smc: Remove unused function declaration The declaration of smc_wr_tx_dismiss_slots() is unused. So remove it. Fixes: 349d43127dac ("net/smc: fix kernel panic caused by race of smc_sock") Signed-off-by: Wen Gu Reviewed-by: Dust Li Signed-off-by: David S. Miller commit f542cdfa3083a309e3caafbbdf41490c4935492a Author: Slark Xiao Date: Sat Jan 15 10:34:30 2022 +0800 net: wwan: Fix MRU mismatch issue which may lead to data connection lost In pci_generic.c there is a 'mru_default' in struct mhi_pci_dev_info. This value shall be used for whole mhi if it's given a value for a specific product. But in function mhi_net_rx_refill_work(), it's still using hard code value MHI_DEFAULT_MRU. 'mru_default' shall have higher priority than MHI_DEFAULT_MRU. And after checking, this change could help fix a data connection lost issue. Fixes: 5c2c85315948 ("bus: mhi: pci-generic: configurable network interface MRU") Signed-off-by: Shujun Wang Signed-off-by: Slark Xiao Reviewed-by: Loic Poulain Signed-off-by: David S. Miller commit 020a45aff1190c32b1087cd75b57fbf6bff46ea6 Author: Mohammad Athari Bin Ismail Date: Sat Jan 15 17:25:15 2022 +0800 net: phy: marvell: add Marvell specific PHY loopback Existing genphy_loopback() is not applicable for Marvell PHY. Besides configuring bit-6 and bit-13 in Page 0 Register 0 (Copper Control Register), it is also required to configure same bits in Page 2 Register 21 (MAC Specific Control Register 2) according to speed of the loopback is operating. Tested working on Marvell88E1510 PHY for all speeds (1000/100/10Mbps). FIXME: Based on trial and error test, it seem 1G need to have delay between soft reset and loopback enablement. Fixes: 014068dcb5b1 ("net: phy: genphy_loopback: add link speed configuration") Cc: # 5.15.x Signed-off-by: Mohammad Athari Bin Ismail Signed-off-by: David S. Miller commit 9a9acdccdfa430457986db608ee4ae4840107057 Author: Christophe JAILLET Date: Sat Jan 15 13:45:03 2022 +0100 net: ethernet: sun4i-emac: Fix an error handling path in emac_probe() A dma_request_chan() call is hidden in emac_configure_dma(). It must be released in the probe if an error occurs, as already done in the remove function. Add the corresponding dma_release_channel() call. Fixes: 47869e82c8b8 ("sun4i-emac.c: add dma support") Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller commit 214b3369ab9b0a6f28d6c970220c209417edbc65 Author: Tom Rix Date: Sat Jan 15 09:49:18 2022 -0800 net: ethernet: mtk_eth_soc: fix error checking in mtk_mac_config() Clang static analysis reports this problem mtk_eth_soc.c:394:7: warning: Branch condition evaluates to a garbage value if (err) ^~~ err is not initialized and only conditionally set. So intitialize err. Fixes: 7e538372694b ("net: ethernet: mediatek: Re-add support SGMII") Signed-off-by: Tom Rix Signed-off-by: David S. Miller commit 80f15f3bef9e9c2cc29888a6773df44de0a0c65f Author: Vladimir Oltean Date: Fri Jan 14 15:36:37 2022 +0200 net: mscc: ocelot: don't dereference NULL pointers with shared tc filters The following command sequence: tc qdisc del dev swp0 clsact tc qdisc add dev swp0 ingress_block 1 clsact tc qdisc add dev swp1 ingress_block 1 clsact tc filter add block 1 flower action drop tc qdisc del dev swp0 clsact produces the following NPD: Unable to handle kernel NULL pointer dereference at virtual address 0000000000000014 pc : vcap_entry_set+0x14/0x70 lr : ocelot_vcap_filter_del+0x198/0x234 Call trace: vcap_entry_set+0x14/0x70 ocelot_vcap_filter_del+0x198/0x234 ocelot_cls_flower_destroy+0x94/0xe4 felix_cls_flower_del+0x70/0x84 dsa_slave_setup_tc_block_cb+0x13c/0x60c dsa_slave_setup_tc_block_cb_ig+0x20/0x30 tc_setup_cb_reoffload+0x44/0x120 fl_reoffload+0x280/0x320 tcf_block_playback_offloads+0x6c/0x184 tcf_block_unbind+0x80/0xe0 tcf_block_setup+0x174/0x214 tcf_block_offload_cmd.isra.0+0x100/0x13c tcf_block_offload_unbind+0x5c/0xa0 __tcf_block_put+0x54/0x174 tcf_block_put_ext+0x5c/0x74 clsact_destroy+0x40/0x60 qdisc_destroy+0x4c/0x150 qdisc_put+0x70/0x90 qdisc_graft+0x3f0/0x4c0 tc_get_qdisc+0x1cc/0x364 rtnetlink_rcv_msg+0x124/0x340 The reason is that the driver isn't prepared to receive two tc filters with the same cookie. It unconditionally creates a new struct ocelot_vcap_filter for each tc filter, and it adds all filters with the same identifier (cookie) to the ocelot_vcap_block. The problem is here, in ocelot_vcap_filter_del(): /* Gets index of the filter */ index = ocelot_vcap_block_get_filter_index(block, filter); if (index < 0) return index; /* Delete filter */ ocelot_vcap_block_remove_filter(ocelot, block, filter); /* Move up all the blocks over the deleted filter */ for (i = index; i < block->count; i++) { struct ocelot_vcap_filter *tmp; tmp = ocelot_vcap_block_find_filter_by_index(block, i); vcap_entry_set(ocelot, i, tmp); } what will happen is ocelot_vcap_block_get_filter_index() will return the index (@index) of the first filter found with that cookie. This is _not_ the index of _this_ filter, but the other one with the same cookie, because ocelot_vcap_filter_equal() gets fooled. Then later, ocelot_vcap_block_remove_filter() is coded to remove all filters that are ocelot_vcap_filter_equal() with the passed @filter. So unexpectedly, both filters get deleted from the list. Then ocelot_vcap_filter_del() will attempt to move all the other filters up, again finding them by index (@i). The block count is 2, @index was 0, so it will attempt to move up filter @i=0 and @i=1. It assigns tmp = ocelot_vcap_block_find_filter_by_index(block, i), which is now a NULL pointer because ocelot_vcap_block_remove_filter() has removed more than one filter. As far as I can see, this problem has been there since the introduction of tc offload support, however I cannot test beyond the blamed commit due to hardware availability. In any case, any fix cannot be backported that far, due to lots of changes to the code base. Therefore, let's go for the correct solution, which is to not call ocelot_vcap_filter_add() and ocelot_vcap_filter_del(), unless the filter is actually unique and not shared. For the shared filters, we should just modify the ingress port mask and call ocelot_vcap_filter_replace(), a function introduced by commit 95706be13b9f ("net: mscc: ocelot: create a function that replaces an existing VCAP filter"). This way, block->rules will only contain filters with unique cookies, by design. Fixes: 07d985eef073 ("net: dsa: felix: Wire up the ocelot cls_flower methods") Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 9bce13ea88f85344b765abe5d3dabdd0f44dc177 Author: Jiri Olsa Date: Thu Dec 9 21:04:25 2021 +0100 perf record: Disable debuginfod by default Fedora 35 sets DEBUGINFOD_URLS by default, which might lead to unexpected stalls in perf record exit path, when we try to cache profiled binaries. # DEBUGINFOD_PROGRESS=1 ./perf record -a ^C[ perf record: Woken up 1 times to write data ] Downloading from https://debuginfod.fedoraproject.org/ 447069 Downloading from https://debuginfod.fedoraproject.org/ 1502175 Downloading \^Z Disabling DEBUGINFOD_URLS by default in perf record and adding debuginfod option and .perfconfig variable support to enable id. Default without debuginfo processing: # perf record -a Using system debuginfod setup: # perf record -a --debuginfod Using custom debuginfd url: # perf record -a --debuginfod='https://evenbetterdebuginfodserver.krava' Adding single perf_debuginfod_setup function and using it also in perf buildid-cache command. Signed-off-by: Jiri Olsa Cc: Alexander Shishkin Cc: Frank Ch. Eigler Cc: Ian Rogers Cc: Mark Rutland Cc: Michael Petlan Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20211209200425.303561-1-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 2eea0b56b0d6ace0172550477220a25d633ec5b9 Author: Arnaldo Carvalho de Melo Date: Sat Jan 15 17:15:09 2022 -0300 perf evlist: No need to do any affinity setup when profiling pids The cpumap is dummy, so no need to go on figuring out affinity.o This way we reduce the setup time for simple scenarios like: $ perf stat sleep 1 Acked-by: Andi Kleen Acked-by: Ian Rogers Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit 37be585807cb9a810f8395c39c4ee7bdbdc7b0dc Author: Arnaldo Carvalho de Melo Date: Sat Jan 15 17:11:10 2022 -0300 perf cpumap: Add is_dummy() method Needed to check if a cpu_map is dummy, i.e. not a cpu map at all, for pid monitoring scenarios. This probably needs to move to libperf, but since perf itself is the first and so far only user, leave it at tools/perf/util/. Acked-by: Andi Kleen Acked-by: Ian Rogers Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo commit 762f99f4f3cb41a775b5157dd761217beba65873 Merge: cf73ed894ee93 b6e43dddaea3d Author: Dmitry Torokhov Date: Sat Jan 15 12:09:44 2022 -0800 Merge branch 'next' into for-linus Prepare input updates for 5.17 merge window. commit d3e2bb4359f70c8b1d09a6f8e2f57240aab0da3f Author: Ian Rogers Date: Fri Jan 14 22:28:52 2022 -0800 perf metric: Fix metric_leader Multiple events may have a metric_leader to aggregate into. This happens for uncore events where, for example, uncore_imc is expanded into uncore_imc_0, uncore_imc_1, etc. Such events all have the same metric_id and should aggregate into the first event. The change introducing metric_ids had a bug where the metric_id was compared to itself, creating an always true condition. Correct this by comparing the event in the metric_evlist and the metric_leader. Fixes: ec5c5b3d2c21b3f3 ("perf metric: Encode and use metric-id as qualifier") Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20220115062852.1959424-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit f56caedaf94f9ced5dbfcdb0060a3e788d2078af Merge: a33f5c380c4bd 76fd0285b4479 Author: Linus Torvalds Date: Sat Jan 15 20:37:06 2022 +0200 Merge branch 'akpm' (patches from Andrew) Merge misc updates from Andrew Morton: "146 patches. Subsystems affected by this patch series: kthread, ia64, scripts, ntfs, squashfs, ocfs2, vfs, and mm (slab-generic, slab, kmemleak, dax, kasan, debug, pagecache, gup, shmem, frontswap, memremap, memcg, selftests, pagemap, dma, vmalloc, memory-failure, hugetlb, userfaultfd, vmscan, mempolicy, oom-kill, hugetlbfs, migration, thp, ksm, page-poison, percpu, rmap, zswap, zram, cleanups, hmm, and damon)" * emailed patches from Andrew Morton : (146 commits) mm/damon: hide kernel pointer from tracepoint event mm/damon/vaddr: hide kernel pointer from damon_va_three_regions() failure log mm/damon/vaddr: use pr_debug() for damon_va_three_regions() failure logging mm/damon/dbgfs: remove an unnecessary variable mm/damon: move the implementation of damon_insert_region to damon.h mm/damon: add access checking for hugetlb pages Docs/admin-guide/mm/damon/usage: update for schemes statistics mm/damon/dbgfs: support all DAMOS stats Docs/admin-guide/mm/damon/reclaim: document statistics parameters mm/damon/reclaim: provide reclamation statistics mm/damon/schemes: account how many times quota limit has exceeded mm/damon/schemes: account scheme actions that successfully applied mm/damon: remove a mistakenly added comment for a future feature Docs/admin-guide/mm/damon/usage: update for kdamond_pid and (mk|rm)_contexts Docs/admin-guide/mm/damon/usage: mention tracepoint at the beginning Docs/admin-guide/mm/damon/usage: remove redundant information Docs/admin-guide/mm/damon/usage: update for scheme quotas and watermarks mm/damon: convert macro functions to static inline functions mm/damon: modify damon_rand() macro to static inline function mm/damon: move damon_rand() definition into damon.h ... commit 15325b4f768f2b27b5765489eeab6ec0d6b5e902 Author: Yury Norov Date: Sat Aug 14 14:17:13 2021 -0700 vsprintf: rework bitmap_list_string bitmap_list_string() is very ineffective when printing bitmaps with long ranges of set bits because it calls find_next_bit for each bit in the bitmap. We can do better by detecting ranges of set bits. In my environment, before/after is 943008/31008 ns. Signed-off-by: Yury Norov Tested-by: Wolfram Sang commit db7313005e9c2d4e80888dd18d4a83926b920e8c Author: Yury Norov Date: Sat Aug 14 14:17:12 2021 -0700 lib: bitmap: add performance test for bitmap_print_to_pagebuf Functional tests for bitmap_print_to_pagebuf() are provided in lib/test_printf.c. This patch adds performance test for a case of fully set bitmap. Signed-off-by: Yury Norov Tested-by: Wolfram Sang commit ec288a2cf7ca40a939316b6df206ab845bb112d1 Author: Yury Norov Date: Sat Aug 14 14:17:11 2021 -0700 bitmap: unify find_bit operations bitmap_for_each_{set,clear}_region() are similar to for_each_bit() macros in include/linux/find.h, but interface and implementation of them are different. This patch adds for_each_bitrange() macros and drops unused bitmap_*_region() API in sake of unification. Signed-off-by: Yury Norov Tested-by: Wolfram Sang Acked-by: Dennis Zhou Acked-by: Ulf Hansson # For MMC commit 801a57365fc836d7ec866e2069d0b21d79925c1e Author: Yury Norov Date: Sat Aug 14 14:17:10 2021 -0700 mm/percpu: micro-optimize pcpu_is_populated() bitmap_next_clear_region() calls find_next_zero_bit() and find_next_bit() sequentially to find a range of clear bits. In case of pcpu_is_populated() there's a chance to return earlier if bitmap has all bits set. Signed-off-by: Yury Norov Tested-by: Wolfram Sang Acked-by: Dennis Zhou commit 749443de8dde3b8b420ee8b4daac4d929a6adeb9 Author: Yury Norov Date: Sat Aug 14 14:17:08 2021 -0700 Replace for_each_*_bit_from() with for_each_*_bit() where appropriate A couple of kernel functions call for_each_*_bit_from() with start bit equal to 0. Replace them with for_each_*_bit(). No functional changes, but might improve on readability. Signed-off-by: Yury Norov Tested-by: Wolfram Sang commit 7516be9931b8bc8bcaac8531f490b42ab11ded1e Author: Yury Norov Date: Sat Aug 14 14:17:07 2021 -0700 find: micro-optimize for_each_{set,clear}_bit() The macros iterate thru all set/clear bits in a bitmap. They search a first bit using find_first_bit(), and the rest bits using find_next_bit(). Since find_next_bit() is called shortly after find_first_bit(), we can save few lines of I-cache by not using find_first_bit(). Signed-off-by: Yury Norov Tested-by: Wolfram Sang commit bc9d6635c293a2ac30c6319f7cfd08860ab7948a Author: Yury Norov Date: Sat Aug 14 14:17:06 2021 -0700 include/linux: move for_each_bit() macros from bitops.h to find.h for_each_bit() macros depend on find_bit() machinery, and so the proper place for them is the find.h header. Signed-off-by: Yury Norov Tested-by: Wolfram Sang commit 9b51d9d866482a703646fd4c07e433c3d9d88efd Author: Yury Norov Date: Sat Aug 14 14:17:05 2021 -0700 cpumask: replace cpumask_next_* with cpumask_first_* where appropriate cpumask_first() is a more effective analogue of 'next' version if n == -1 (which means start == 0). This patch replaces 'next' with 'first' where things look trivial. There's no cpumask_first_zero() function, so create it. Signed-off-by: Yury Norov Tested-by: Wolfram Sang commit 4ade0818cf048bb166e875ed4f8b456e6c2c7b3c Author: Yury Norov Date: Sat Aug 14 14:17:04 2021 -0700 tools: sync tools/bitmap with mother linux Remove tools/include/asm-generic/bitops/find.h and copy include/linux/bitmap.h to tools. find_*_le() functions are not copied because not needed in tools. Signed-off-by: Yury Norov Tested-by: Wolfram Sang commit b5c7e7ec7d3418af2544452b45cc67297c857a86 Author: Yury Norov Date: Sat Aug 14 14:17:03 2021 -0700 all: replace find_next{,_zero}_bit with find_first{,_zero}_bit where appropriate find_first{,_zero}_bit is a more effective analogue of 'next' version if start == 0. This patch replaces 'next' with 'first' where things look trivial. Signed-off-by: Yury Norov Tested-by: Wolfram Sang commit 93ba139ba8190c33009c5353ca43c8519443f467 Author: Yury Norov Date: Sat Aug 14 14:17:02 2021 -0700 cpumask: use find_first_and_bit() Now we have an efficient implementation for find_first_and_bit(), so switch cpumask to use it where appropriate. Signed-off-by: Yury Norov Tested-by: Wolfram Sang commit f68edc9297bf3f7c94abb54b9b0b053607f7587b Author: Yury Norov Date: Sat Aug 14 14:17:01 2021 -0700 lib: add find_first_and_bit() Currently find_first_and_bit() is an alias to find_next_and_bit(). However, it is widely used in cpumask, so it worth to optimize it. This patch adds its own implementation for find_first_and_bit(). On x86_64 find_bit_benchmark says: Before (#define find_first_and_bit(...) find_next_and_bit(..., 0): Start testing find_bit() with random-filled bitmap [ 140.291468] find_first_and_bit: 46890919 ns, 32671 iterations Start testing find_bit() with sparse bitmap [ 140.295028] find_first_and_bit: 7103 ns, 1 iterations After: Start testing find_bit() with random-filled bitmap [ 162.574907] find_first_and_bit: 25045813 ns, 32846 iterations Start testing find_bit() with sparse bitmap [ 162.578458] find_first_and_bit: 4900 ns, 1 iterations (Thanks to Alexey Klimov for thorough testing.) Signed-off-by: Yury Norov Tested-by: Wolfram Sang Tested-by: Alexey Klimov commit c126a53c276048125b4a950072bab37ad0fea120 Author: Yury Norov Date: Sat Aug 14 14:17:00 2021 -0700 arch: remove GENERIC_FIND_FIRST_BIT entirely In 5.12 cycle we enabled GENERIC_FIND_FIRST_BIT config option for ARM64 and MIPS. It increased performance and shrunk .text size; and so far I didn't receive any negative feedback on the change. https://lore.kernel.org/linux-arch/20210225135700.1381396-1-yury.norov@gmail.com/ Now I think it's a good time to switch all architectures to use find_{first,last}_bit() unconditionally, and so remove corresponding config option. The patch does't introduce functioal changes for arc, arm, arm64, mips, m68k, s390 and x86, for other architectures I expect improvement both in performance and .text size. Signed-off-by: Yury Norov Tested-by: Alexander Lobakin (mips) Reviewed-by: Alexander Lobakin (mips) Reviewed-by: Andy Shevchenko Acked-by: Will Deacon Tested-by: Wolfram Sang commit 47d8c15615c0a2046d2d90b04cb80b81ddf31fb1 Author: Yury Norov Date: Sat Aug 14 14:16:59 2021 -0700 include: move find.h from asm_generic to linux find_bit API and bitmap API are closely related, but inclusion paths are different - include/asm-generic and include/linux, correspondingly. In the past it made a lot of troubles due to circular dependencies and/or undefined symbols. Fix this by moving find.h under include/linux. Signed-off-by: Yury Norov Tested-by: Wolfram Sang Acked-by: Geert Uytterhoeven commit 6b8ecb84f8f64017ae6e56cd745ad88e48f68779 Author: Yury Norov Date: Sat Aug 14 14:16:58 2021 -0700 bitops: move find_bit_*_le functions from le.h to find.h It's convenient to have all find_bit declarations in one place. Signed-off-by: Yury Norov Tested-by: Wolfram Sang commit b7ec62d7ee0f0b8af6ba190501dff7f9ee6545ca Author: Yury Norov Date: Sat Aug 14 14:16:57 2021 -0700 bitops: protect find_first_{,zero}_bit properly find_first_bit() and find_first_zero_bit() are not protected with ifdefs as other functions in find.h. It causes build errors on some platforms if CONFIG_GENERIC_FIND_FIRST_BIT is enabled. Signed-off-by: Yury Norov Fixes: 2cc7b6a44ac2 ("lib: add fast path for find_first_*_bit() and find_last_bit()") Reported-by: kernel test robot Tested-by: Wolfram Sang commit 9bbf8662a27b56358366027d1a77c0676f85b222 Author: Eugene Korenevsky Date: Tue Jan 11 11:36:50 2022 +0300 cifs: fix FILE_BOTH_DIRECTORY_INFO definition The size of FILE_BOTH_DIRECTORY_INFO.ShortName must be 24 bytes, not 12 (see MS-FSCC documentation). Signed-off-by: Eugene Korenevsky Signed-off-by: Steve French commit dea2903719283c156b53741126228c4a1b40440f Author: Jeff Layton Date: Mon Jan 10 19:00:02 2022 -0500 cifs: move superblock magic defitions to magic.h Help userland apps to identify cifs and smb2 mounts. Signed-off-by: Jeff Layton Signed-off-by: Steve French commit 3ac5f2f2574a8b9e219bb5872166e5db797e349d Author: Yang Li Date: Wed Jan 5 17:39:09 2022 +0800 cifs: Fix smb311_update_preauth_hash() kernel-doc comment Add the description of @server in smb311_update_preauth_hash() kernel-doc comment to remove warning found by running scripts/kernel-doc, which is caused by using 'make W=1'. fs/cifs/smb2misc.c:856: warning: Function parameter or member 'server' not described in 'smb311_update_preauth_hash' Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Steve French commit 76fd0285b447991267e838842c0be7395eb454bb Author: SeongJae Park Date: Fri Jan 14 14:10:50 2022 -0800 mm/damon: hide kernel pointer from tracepoint event DAMON's virtual address spaces monitoring primitive uses 'struct pid *' of the target process as its monitoring target id. The kernel address is exposed as-is to the user space via the DAMON tracepoint, 'damon_aggregated'. Though primarily only privileged users are allowed to access that, it would be better to avoid unnecessarily exposing kernel pointers so. Because the trace result is only required to be able to distinguish each target, we aren't need to use the pointer as-is. This makes the tracepoint to use the index of the target in the context's targets list as its id in the tracepoint, to hide the kernel space address. Link: https://lkml.kernel.org/r/20211229131016.23641-5-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 962fe7a6b1b2f9deb1b31b3344afa3b11afdf7ab Author: SeongJae Park Date: Fri Jan 14 14:10:47 2022 -0800 mm/damon/vaddr: hide kernel pointer from damon_va_three_regions() failure log The failure log message for 'damon_va_three_regions()' prints the target id, which is a 'struct pid' pointer in the case. To avoid exposing the kernel pointer via the log, this makes the log to use the index of the target in the context's targets list instead. Link: https://lkml.kernel.org/r/20211229131016.23641-4-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 251403f19aab6a122f4dcfb14149814e85564202 Author: SeongJae Park Date: Fri Jan 14 14:10:44 2022 -0800 mm/damon/vaddr: use pr_debug() for damon_va_three_regions() failure logging Failure of 'damon_va_three_regions()' is logged using 'pr_err()'. But, the function can fail in legal situations. To avoid making users be surprised and to keep the kernel clean, this makes the log to be printed using 'pr_debug()'. Link: https://lkml.kernel.org/r/20211229131016.23641-3-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 70b8480812d0a3930049a44820a1fa149b090c10 Author: SeongJae Park Date: Fri Jan 14 14:10:41 2022 -0800 mm/damon/dbgfs: remove an unnecessary variable Patch series "mm/damon: Hide unnecessary information disclosures". DAMON is exposing some unnecessary information including kernel pointer in kernel log and tracepoint. This patchset hides such information. The first patch is only for a trivial cleanup, though. This patch (of 4): This commit removes a unnecessarily used variable in dbgfs_target_ids_write(). Link: https://lkml.kernel.org/r/20211229131016.23641-1-sj@kernel.org Link: https://lkml.kernel.org/r/20211229131016.23641-2-sj@kernel.org Fixes: 4bc05954d007 ("mm/damon: implement a debugfs-based user space interface") Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 2cd4b8e10cc31eadb5b10b1d73b3f28156f3776c Author: Guoqing Jiang Date: Fri Jan 14 14:10:38 2022 -0800 mm/damon: move the implementation of damon_insert_region to damon.h Usually, inline function is declared static since it should sit between storage and type. And implement it in a header file if used by multiple files. And this change also fixes compile issue when backport damon to 5.10. mm/damon/vaddr.c: In function `damon_va_evenly_split_region': ./include/linux/damon.h:425:13: error: inlining failed in call to `always_inline' `damon_insert_region': function body not available 425 | inline void damon_insert_region(struct damon_region *r, | ^~~~~~~~~~~~~~~~~~~ mm/damon/vaddr.c:86:3: note: called from here 86 | damon_insert_region(n, r, next, t); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Link: https://lkml.kernel.org/r/20211223085703.6142-1-guoqing.jiang@linux.dev Signed-off-by: Guoqing Jiang Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 49f4203aae06ba9d67b500c90339b262b0a52637 Author: Baolin Wang Date: Fri Jan 14 14:10:35 2022 -0800 mm/damon: add access checking for hugetlb pages The process's VMAs can be mapped by hugetlb page, but now the DAMON did not implement the access checking for hugetlb pte, so we can not get the actual access count like below if a process VMAs were mapped by hugetlb. damon_aggregated: target_id=18446614368406014464 nr_regions=12 4194304-5476352: 0 545 damon_aggregated: target_id=18446614368406014464 nr_regions=12 140662370467840-140662372970496: 0 545 damon_aggregated: target_id=18446614368406014464 nr_regions=12 140662372970496-140662375460864: 0 545 damon_aggregated: target_id=18446614368406014464 nr_regions=12 140662375460864-140662377951232: 0 545 damon_aggregated: target_id=18446614368406014464 nr_regions=12 140662377951232-140662380449792: 0 545 damon_aggregated: target_id=18446614368406014464 nr_regions=12 140662380449792-140662382944256: 0 545 ...... Thus this patch adds hugetlb access checking support, with this patch we can see below VMA mapped by hugetlb access count. damon_aggregated: target_id=18446613056935405824 nr_regions=12 140296486649856-140296489914368: 1 3 damon_aggregated: target_id=18446613056935405824 nr_regions=12 140296489914368-140296492978176: 1 3 damon_aggregated: target_id=18446613056935405824 nr_regions=12 140296492978176-140296495439872: 1 3 damon_aggregated: target_id=18446613056935405824 nr_regions=12 140296495439872-140296498311168: 1 3 damon_aggregated: target_id=18446613056935405824 nr_regions=12 140296498311168-140296501198848: 1 3 damon_aggregated: target_id=18446613056935405824 nr_regions=12 140296501198848-140296504320000: 1 3 damon_aggregated: target_id=18446613056935405824 nr_regions=12 140296504320000-140296507568128: 1 2 ...... [baolin.wang@linux.alibaba.com: fix unused var warning] Link: https://lkml.kernel.org/r/1aaf9c11-0d8e-b92d-5c92-46e50a6e8d4e@linux.alibaba.com [baolin.wang@linux.alibaba.com: v3] Link: https://lkml.kernel.org/r/486927ecaaaecf2e3a7fbe0378ec6e1c58b50747.1640852276.git.baolin.wang@linux.alibaba.com Link: https://lkml.kernel.org/r/6afcbd1fda5f9c7c24f320d26a98188c727ceec3.1639623751.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang Reviewed-by: SeongJae Park Cc: Mike Kravetz Cc: Randy Dunlap Cc: Stephen Rothwell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit dbcb9b9f954f71fb46be34af624c9edaaa171414 Author: SeongJae Park Date: Fri Jan 14 14:10:32 2022 -0800 Docs/admin-guide/mm/damon/usage: update for schemes statistics This updates DAMON debugfs interface for statistics of schemes successfully applied regions and time/space quota limit exceeds counts. Link: https://lkml.kernel.org/r/20211210150016.35349-7-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3a619fdb8de8a3ecd4200e7d183d2c8ceb32289e Author: SeongJae Park Date: Fri Jan 14 14:10:29 2022 -0800 mm/damon/dbgfs: support all DAMOS stats Currently, DAMON debugfs interface is not supporting DAMON-based Operation Schemes (DAMOS) stats for schemes successfully applied regions and time/space quota limit exceeds. This adds the support. Link: https://lkml.kernel.org/r/20211210150016.35349-6-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 81f0895f1f5ed0d2bb80559ba9fbc6ce814e7235 Author: SeongJae Park Date: Fri Jan 14 14:10:26 2022 -0800 Docs/admin-guide/mm/damon/reclaim: document statistics parameters This adds descriptions for the DAMON_RECLAIM statistics parameters. Link: https://lkml.kernel.org/r/20211210150016.35349-5-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 60e52e7c46a127bca5ddd48b89002564f3862063 Author: SeongJae Park Date: Fri Jan 14 14:10:23 2022 -0800 mm/damon/reclaim: provide reclamation statistics This implements new DAMON_RECLAIM parameters for statistics reporting. Those can be used for understanding how DAMON_RECLAIM is working, and for tuning the other parameters. Link: https://lkml.kernel.org/r/20211210150016.35349-4-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 6268eac34ca30af7f6313504d556ec7fcd295621 Author: SeongJae Park Date: Fri Jan 14 14:10:20 2022 -0800 mm/damon/schemes: account how many times quota limit has exceeded If the time/space quotas of a given DAMON-based operation scheme is too small, the scheme could show unexpectedly slow progress. However, there is no good way to notice the case in runtime. This commit extends the DAMOS stat to provide how many times the quota limits exceeded so that the users can easily notice the case and tune the scheme. Link: https://lkml.kernel.org/r/20211210150016.35349-3-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 0e92c2ee9f459542c5384d9cfab24873c3dd6398 Author: SeongJae Park Date: Fri Jan 14 14:10:17 2022 -0800 mm/damon/schemes: account scheme actions that successfully applied Patch series "mm/damon/schemes: Extend stats for better online analysis and tuning". To help online access pattern analysis and tuning of DAMON-based Operation Schemes (DAMOS), DAMOS provides simple statistics for each scheme. Introduction of DAMOS time/space quota further made the tuning easier by making the risk management easier. However, that also made understanding of the working schemes a little bit more difficult. For an example, progress of a given scheme can now be throttled by not only the aggressiveness of the target access pattern, but also the time/space quotas. So, when a scheme is showing unexpectedly slow progress, it's difficult to know by what the progress of the scheme is throttled, with currently provided statistics. This patchset extends the statistics to contain some metrics that can be helpful for such online schemes analysis and tuning (patches 1-2), exports those to users (patches 3 and 5), and add documents (patches 4 and 6). This patch (of 6): DAMON-based operation schemes (DAMOS) stats provide only the number and the amount of regions that the action of the scheme has tried to be applied. Because the action could be failed for some reasons, the currently provided information is sometimes not useful or convenient enough for schemes profiling and tuning. To improve this situation, this commit extends the DAMOS stats to provide the number and the amount of regions that the action has successfully applied. Link: https://lkml.kernel.org/r/20211210150016.35349-1-sj@kernel.org Link: https://lkml.kernel.org/r/20211210150016.35349-2-sj@kernel.org Signed-off-by: SeongJae Park Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit f4c6d22c6cf282ef7d24a724b9bd978ee2b74fc6 Author: SeongJae Park Date: Fri Jan 14 14:10:14 2022 -0800 mm/damon: remove a mistakenly added comment for a future feature Due to a mistake in patches reordering, a comment for a future feature called 'arbitrary monitoring target support'[1], which is still under development, has added. Because it only introduces confusion and we don't have a plan to post the patches soon, this commit removes the mistakenly added part. [1] https://lore.kernel.org/linux-mm/20201215115448.25633-3-sjpark@amazon.com/ Link: https://lkml.kernel.org/r/20211209131806.19317-7-sj@kernel.org Fixes: 1f366e421c8f ("mm/damon/core: implement DAMON-based Operation Schemes (DAMOS)") Signed-off-by: SeongJae Park Cc: Jonathan Corbet Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 995d739cde879a35ef6e890ecf80226b605ad36c Author: SeongJae Park Date: Fri Jan 14 14:10:11 2022 -0800 Docs/admin-guide/mm/damon/usage: update for kdamond_pid and (mk|rm)_contexts The DAMON debugfs usage document is missing descriptions for 'kdamond_pid', 'mk_contexts', and 'rm_contexts' debugfs files. This commit adds those. Link: https://lkml.kernel.org/r/20211209131806.19317-6-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 4492bf452af532493b6591d2e090a0f8f7c11674 Author: SeongJae Park Date: Fri Jan 14 14:10:08 2022 -0800 Docs/admin-guide/mm/damon/usage: mention tracepoint at the beginning To get detailed monitoring results from the user space, users need to use the damon_aggregated tracepoint. This commit adds a brief mention of it at the beginning of the usage document. Link: https://lkml.kernel.org/r/20211209131806.19317-5-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 35b43d4092008ad33d3bcccee4b262ffbf8a551c Author: SeongJae Park Date: Fri Jan 14 14:10:05 2022 -0800 Docs/admin-guide/mm/damon/usage: remove redundant information DAMON usage document mentions DAMON user space tool and programming interface twice. This commit integrates those and remove unnecessary part. Link: https://lkml.kernel.org/r/20211209131806.19317-4-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 6322416b2d51f359efa7d875ab28bd195a5eb230 Author: SeongJae Park Date: Fri Jan 14 14:10:02 2022 -0800 Docs/admin-guide/mm/damon/usage: update for scheme quotas and watermarks DAMOS features including time/space quota limits and watermarks are not described in the DAMON debugfs interface document. This commit updates the document for the features. Link: https://lkml.kernel.org/r/20211209131806.19317-3-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 88f86dcfa454784f7de550966c60fc78a3e95d6d Author: SeongJae Park Date: Fri Jan 14 14:09:59 2022 -0800 mm/damon: convert macro functions to static inline functions Patch series "mm/damon: Misc cleanups". This patchset contains miscellaneous cleanups for DAMON's macro functions and documentation. This patch (of 6): This commit converts macro functions in DAMON to static inline functions, for better type checking, code documentation, etc[1]. [1] https://lore.kernel.org/linux-mm/20211202151213.6ec830863342220da4141bc5@linux-foundation.org/ Link: https://lkml.kernel.org/r/20211209131806.19317-1-sj@kernel.org Link: https://lkml.kernel.org/r/20211209131806.19317-2-sj@kernel.org Signed-off-by: SeongJae Park Cc: Jonathan Corbet Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 234d68732b6c135087bdebfa0630a43ae8c27758 Author: Xin Hao Date: Fri Jan 14 14:09:56 2022 -0800 mm/damon: modify damon_rand() macro to static inline function damon_rand() cannot be implemented as a macro. Example: damon_rand(a++, b); The value of 'a' will be incremented twice, This is obviously unreasonable, So there fix it. Link: https://lkml.kernel.org/r/110ffcd4e420c86c42b41ce2bc9f0fe6a4f32cd3.1638795127.git.xhao@linux.alibaba.com Fixes: b9a6ac4e4ede ("mm/damon: adaptively adjust regions") Signed-off-by: Xin Hao Reported-by: Andrew Morton Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 9b2a38d6ef25c1748e3964b0ff30a89e4ed26583 Author: Xin Hao Date: Fri Jan 14 14:09:53 2022 -0800 mm/damon: move damon_rand() definition into damon.h damon_rand() is called in three files:damon/core.c, damon/ paddr.c, damon/vaddr.c, i think there is no need to redefine this twice, So move it to damon.h will be a good choice. Link: https://lkml.kernel.org/r/20211202075859.51341-1-xhao@linux.alibaba.com Signed-off-by: Xin Hao Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c89ae63eb0662b6c9f82dbfad3ef010239b8c1b1 Author: Xin Hao Date: Fri Jan 14 14:09:50 2022 -0800 mm/damon/schemes: add the validity judgment of thresholds In dbgfs "schemes" interface, i do some test like this: # cd /sys/kernel/debug/damon # echo "2 1 2 1 10 1 3 10 1 1 1 1 1 1 1 1 2 3" > schemes # cat schemes # 2 1 2 1 10 1 3 10 1 1 1 1 1 1 1 1 2 3 0 0 There have some unreasonable places, i set the valules of these variables " , , " as "<2, 1>, <2, 1>, <10, 1>, <1, 2, 3>. So there add a validity judgment for these thresholds value. Link: https://lkml.kernel.org/r/d78360e52158d786fcbf20bc62c96785742e76d3.1637239568.git.xhao@linux.alibaba.com Signed-off-by: Xin Hao Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 8bd0b9da03c9154e279b1a502636103887b9fbed Author: Yihao Han Date: Fri Jan 14 14:09:47 2022 -0800 mm/damon/vaddr: remove swap_ranges() and replace it with swap() Remove 'swap_ranges()' and replace it with the macro 'swap()' defined in 'include/linux/minmax.h' to simplify code and improve efficiency Link: https://lkml.kernel.org/r/20211111115355.2808-1-hanyihao@vivo.com Signed-off-by: Yihao Han Reviewed-by: SeongJae Park Reviewed-by: Muchun Song Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit cdeed009f3bceee41f73f0137db785fd29a05cb8 Author: Xin Hao Date: Fri Jan 14 14:09:44 2022 -0800 mm/damon: remove some unneeded function definitions in damon.h In damon.h some func definitions about VA & PA can only be used in its own file, so there no need to define in the header file, and the header file will look cleaner. If other files later need these functions, the prototypes can be added to damon.h at that time. [sj@kernel.org: remove unnecessary function prototype position changes] Link: https://lkml.kernel.org/r/20211118114827.20052-1-sj@kernel.org Link: https://lkml.kernel.org/r/45fd5b3ef6cce8e28dbc1c92f9dc845ccfc949d7.1636989871.git.xhao@linux.alibaba.com Signed-off-by: Xin Hao Signed-off-by: SeongJae Park Reviewed-by: SeongJae Park Cc: Muchun Song Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit d720bbbd70e968f8a0257393b575c3a29b56f990 Author: Xin Hao Date: Fri Jan 14 14:09:40 2022 -0800 mm/damon/core: use abs() instead of diff_of() In kernel, we can use abs(a - b) to get the absolute value, So there is no need to redefine a new one. Link: https://lkml.kernel.org/r/b24e7b82d9efa90daf150d62dea171e19390ad0b.1636989871.git.xhao@linux.alibaba.com Signed-off-by: Xin Hao Reviewed-by: Muchun Song Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c46b0bb6a735db0b6140e12e750b5acb1b032982 Author: Xin Hao Date: Fri Jan 14 14:09:37 2022 -0800 mm/damon: add 'age' of region tracepoint support In Damon, we can get age information by analyzing the nr_access change, But short time sampling is not effective, we have to obtain enough data for analysis through long time trace, this also means that we need to consume more cpu resources and storage space. Now the region add a new 'age' variable, we only need to get the change of age value through a little time trace, for example, age has been increasing to 141, but nr_access shows a value of 0 at the same time, Through this,we can conclude that the region has a very low nr_access value for a long time. Link: https://lkml.kernel.org/r/b9def1262af95e0dc1d0caea447886434db01161.1636989871.git.xhao@linux.alibaba.com Signed-off-by: Xin Hao Reviewed-by: SeongJae Park Cc: Muchun Song Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b627b774911660852ce7f3f3817955ddad2bd130 Author: Xin Hao Date: Fri Jan 14 14:09:34 2022 -0800 mm/damon: unified access_check function naming rules Patch series "mm/damon: Do some small changes", v4. This patch (of 4): In damon/paddr.c file, two functions names start with underscore, static void __damon_pa_prepare_access_check(struct damon_ctx *ctx, struct damon_region *r) static void __damon_pa_prepare_access_check(struct damon_ctx *ctx, struct damon_region *r) In damon/vaddr.c file, there are also two functions with the same function, static void damon_va_prepare_access_check(struct damon_ctx *ctx, struct mm_struct *mm, struct damon_region *r) static void damon_va_check_access(struct damon_ctx *ctx, struct mm_struct *mm, struct damon_region *r) It makes sense to keep consistent, and it is not easy to be confused with the function that call them. Link: https://lkml.kernel.org/r/cover.1636989871.git.xhao@linux.alibaba.com Link: https://lkml.kernel.org/r/529054aed932a42b9c09fc9977ad4574b9e7b0bd.1636989871.git.xhao@linux.alibaba.com Signed-off-by: Xin Hao Reviewed-by: SeongJae Park Cc: Muchun Song Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 87c01d57fa23de82fff593a7d070933d08755801 Author: Alistair Popple Date: Fri Jan 14 14:09:31 2022 -0800 mm/hmm.c: allow VM_MIXEDMAP to work with hmm_range_fault hmm_range_fault() can be used instead of get_user_pages() for devices which allow faulting however unlike get_user_pages() it will return an error when used on a VM_MIXEDMAP range. To make hmm_range_fault() more closely match get_user_pages() remove this restriction. This requires dealing with the !ARCH_HAS_PTE_SPECIAL case in hmm_vma_handle_pte(). Rather than replicating the logic of vm_normal_page() call it directly and do a check for the zero pfn similar to what get_user_pages() currently does. Also add a test to hmm selftest to verify functionality. Link: https://lkml.kernel.org/r/20211104012001.2555676-1-apopple@nvidia.com Fixes: da4c3c735ea4 ("mm/hmm/mirror: helper to snapshot CPU page table") Signed-off-by: Alistair Popple Reviewed-by: Jason Gunthorpe Cc: Jerome Glisse Cc: John Hubbard Cc: Zi Yan Cc: Ralph Campbell Cc: Felix Kuehling Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit cab0a7c115546a4865fb7439558af9077a569574 Author: Ting Liu Date: Fri Jan 14 14:09:28 2022 -0800 mm: make some vars and functions static or __init "page_idle_ops" as a global var, but its scope of use within this document. So it should be static. "page_ext_ops" is a var used in the kernel initial phase. And other functions are aslo used in the kernel initial phase. So they should be __init or __initdata to reclaim memory. Link: https://lkml.kernel.org/r/20211217095023.67293-1-liuting.0x7c00@bytedance.com Signed-off-by: Ting Liu Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 0b8f0d870020dbd7037bfacbb73a9b3213470f90 Author: Quanfa Fu Date: Fri Jan 14 14:09:25 2022 -0800 mm: fix some comment errors Link: https://lkml.kernel.org/r/20211101040208.460810-1-fuqf0919@gmail.com Signed-off-by: Quanfa Fu Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 7f0d267243aa9dd32944bd7d3b34afff60545edb Author: Luis Chamberlain Date: Fri Jan 14 14:09:22 2022 -0800 zram: use ATTRIBUTE_GROUPS Embrace ATTRIBUTE_GROUPS to avoid boiler plate code. This should not introduce any functional changes. Link: https://lkml.kernel.org/r/20211028203600.2157356-1-mcgrof@kernel.org Signed-off-by: Luis Chamberlain Reviewed-by: Bart Van Assche Reviewed-by: Sergey Senozhatsky Cc: Minchan Kim Cc: Nitin Gupta Cc: Jens Axboe Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit f44e1e697674335f837280d5e4485d1523206ea9 Author: Zhaoyu Liu Date: Fri Jan 14 14:09:19 2022 -0800 zpool: remove the list of pools_head The list of pools_head is no longer needed because the caller has been deleted in commit 479305fd7172 ("zpool: remove zpool_evict()"). Link: https://lkml.kernel.org/r/20211215163727.GA17196@pc Signed-off-by: Zhaoyu Liu Cc: Dan Streetman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 5ee2fa2f063649570c702164f47a558a3432dd9e Author: Huang Ying Date: Fri Jan 14 14:09:16 2022 -0800 mm/rmap: fix potential batched TLB flush race In theory, the following race is possible for batched TLB flushing. CPU0 CPU1 ---- ---- shrink_page_list() unmap zap_pte_range() flush_tlb_batched_pending() flush_tlb_mm() try_to_unmap() set_tlb_ubc_flush_pending() mm->tlb_flush_batched = true mm->tlb_flush_batched = false After the TLB is flushed on CPU1 via flush_tlb_mm() and before mm->tlb_flush_batched is set to false, some PTE is unmapped on CPU0 and the TLB flushing is pended. Then the pended TLB flushing will be lost. Although both set_tlb_ubc_flush_pending() and flush_tlb_batched_pending() are called with PTL locked, different PTL instances may be used. Because the race window is really small, and the lost TLB flushing will cause problem only if a TLB entry is inserted before the unmapping in the race window, the race is only theoretical. But the fix is simple and cheap too. Syzbot has reported this too as follows: ================================================================== BUG: KCSAN: data-race in flush_tlb_batched_pending / try_to_unmap_one write to 0xffff8881072cfbbc of 1 bytes by task 17406 on cpu 1: flush_tlb_batched_pending+0x5f/0x80 mm/rmap.c:691 madvise_free_pte_range+0xee/0x7d0 mm/madvise.c:594 walk_pmd_range mm/pagewalk.c:128 [inline] walk_pud_range mm/pagewalk.c:205 [inline] walk_p4d_range mm/pagewalk.c:240 [inline] walk_pgd_range mm/pagewalk.c:277 [inline] __walk_page_range+0x981/0x1160 mm/pagewalk.c:379 walk_page_range+0x131/0x300 mm/pagewalk.c:475 madvise_free_single_vma mm/madvise.c:734 [inline] madvise_dontneed_free mm/madvise.c:822 [inline] madvise_vma mm/madvise.c:996 [inline] do_madvise+0xe4a/0x1140 mm/madvise.c:1202 __do_sys_madvise mm/madvise.c:1228 [inline] __se_sys_madvise mm/madvise.c:1226 [inline] __x64_sys_madvise+0x5d/0x70 mm/madvise.c:1226 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae write to 0xffff8881072cfbbc of 1 bytes by task 71 on cpu 0: set_tlb_ubc_flush_pending mm/rmap.c:636 [inline] try_to_unmap_one+0x60e/0x1220 mm/rmap.c:1515 rmap_walk_anon+0x2fb/0x470 mm/rmap.c:2301 try_to_unmap+0xec/0x110 shrink_page_list+0xe91/0x2620 mm/vmscan.c:1719 shrink_inactive_list+0x3fb/0x730 mm/vmscan.c:2394 shrink_list mm/vmscan.c:2621 [inline] shrink_lruvec+0x3c9/0x710 mm/vmscan.c:2940 shrink_node_memcgs+0x23e/0x410 mm/vmscan.c:3129 shrink_node+0x8f6/0x1190 mm/vmscan.c:3252 kswapd_shrink_node mm/vmscan.c:4022 [inline] balance_pgdat+0x702/0xd30 mm/vmscan.c:4213 kswapd+0x200/0x340 mm/vmscan.c:4473 kthread+0x2c7/0x2e0 kernel/kthread.c:327 ret_from_fork+0x1f/0x30 value changed: 0x01 -> 0x00 Reported by Kernel Concurrency Sanitizer on: CPU: 0 PID: 71 Comm: kswapd0 Not tainted 5.16.0-rc1-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 ================================================================== [akpm@linux-foundation.org: tweak comments] Link: https://lkml.kernel.org/r/20211201021104.126469-1-ying.huang@intel.com Signed-off-by: "Huang, Ying" Reported-by: syzbot+aa5bebed695edaccf0df@syzkaller.appspotmail.com Cc: Nadav Amit Cc: Mel Gorman Cc: Andrea Arcangeli Cc: Andy Lutomirski Cc: Dave Hansen Cc: Will Deacon Cc: Yu Zhao Cc: Marco Elver Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 8c57c07741bf28e7d867f1200aa80120b8ca663e Author: Qi Zheng Date: Fri Jan 14 14:09:12 2022 -0800 mm: memcg/percpu: account extra objcg space to memory cgroups Similar to slab memory allocator, for each accounted percpu object there is an extra space which is used to store obj_cgroup membership. Charge it too. [akpm@linux-foundation.org: fix layout] Link: https://lkml.kernel.org/r/20211126040606.97836-1-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Acked-by: Dennis Zhou Cc: Tejun Heo Cc: Christoph Lameter Cc: Muchun Song Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit bf181c582588f8f7406d52f2ee228539b465f173 Author: Naoya Horiguchi Date: Fri Jan 14 14:09:09 2022 -0800 mm/hwpoison: fix unpoison_memory() After recent soft-offline rework, error pages can be taken off from buddy allocator, but the existing unpoison_memory() does not properly undo the operation. Moreover, due to the recent change on __get_hwpoison_page(), get_page_unless_zero() is hardly called for hwpoisoned pages. So __get_hwpoison_page() highly likely returns -EBUSY (meaning to fail to grab page refcount) and unpoison just clears PG_hwpoison without releasing a refcount. That does not lead to a critical issue like kernel panic, but unpoisoned pages never get back to buddy (leaked permanently), which is not good. To (partially) fix this, we need to identify "taken off" pages from other types of hwpoisoned pages. We can't use refcount or page flags for this purpose, so a pseudo flag is defined by hacking ->private field. Someone might think that put_page() is enough to cancel taken-off pages, but the normal free path contains some operations not suitable for the current purpose, and can fire VM_BUG_ON(). Note that unpoison_memory() is now supposed to be cancel hwpoison events injected only by madvise() or /sys/devices/system/memory/{hard,soft}_offline_page, not by MCE injection, so please don't try to use unpoison when testing with MCE injection. [lkp@intel.com: report build failure for ARCH=i386] Link: https://lkml.kernel.org/r/20211115084006.3728254-4-naoya.horiguchi@linux.dev Signed-off-by: Naoya Horiguchi Reviewed-by: Yang Shi Cc: David Hildenbrand Cc: Oscar Salvador Cc: Michal Hocko Cc: Ding Hui Cc: Tony Luck Cc: "Aneesh Kumar K.V" Cc: Miaohe Lin Cc: Peter Xu Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c9fdc4d5487a16bd1f003fc8b66e91f88efb50e6 Author: Naoya Horiguchi Date: Fri Jan 14 14:09:06 2022 -0800 mm/hwpoison: remove MF_MSG_BUDDY_2ND and MF_MSG_POISONED_HUGE These action_page_types are no longer used, so remove them. Link: https://lkml.kernel.org/r/20211115084006.3728254-3-naoya.horiguchi@linux.dev Signed-off-by: Naoya Horiguchi Acked-by: Yang Shi Cc: "Aneesh Kumar K.V" Cc: David Hildenbrand Cc: Ding Hui Cc: Miaohe Lin Cc: Michal Hocko Cc: Oscar Salvador Cc: Peter Xu Cc: Tony Luck Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 91d005479e06392617bacc114509d611b705eaac Author: Naoya Horiguchi Date: Fri Jan 14 14:09:02 2022 -0800 mm/hwpoison: mf_mutex for soft offline and unpoison Patch series "mm/hwpoison: fix unpoison_memory()", v4. The main purpose of this series is to sync unpoison code to recent changes around how hwpoison code takes page refcount. Unpoison should work or simply fail (without crash) if impossible. The recent works of keeping hwpoison pages in shmem pagecache introduce a new state of hwpoisoned pages, but unpoison for such pages is not supported yet with this series. It seems that soft-offline and unpoison can be used as general purpose page offline/online mechanism (not in the context of memory error). I think that we need some additional works to realize it because currently soft-offline and unpoison are assumed not to happen so frequently (print out too many messages for aggressive usecases). But anyway this could be another interesting next topic. v1: https://lore.kernel.org/linux-mm/20210614021212.223326-1-nao.horiguchi@gmail.com/ v2: https://lore.kernel.org/linux-mm/20211025230503.2650970-1-naoya.horiguchi@linux.dev/ v3: https://lore.kernel.org/linux-mm/20211105055058.3152564-1-naoya.horiguchi@linux.dev/ This patch (of 3): Originally mf_mutex is introduced to serialize multiple MCE events, but it is not that useful to allow unpoison to run in parallel with memory_failure() and soft offline. So apply mf_mutex to soft offline and unpoison. The memory failure handler and soft offline handler get simpler with this. Link: https://lkml.kernel.org/r/20211115084006.3728254-1-naoya.horiguchi@linux.dev Link: https://lkml.kernel.org/r/20211115084006.3728254-2-naoya.horiguchi@linux.dev Signed-off-by: Naoya Horiguchi Reviewed-by: Yang Shi Cc: "Aneesh Kumar K.V" Cc: David Hildenbrand Cc: Ding Hui Cc: Miaohe Lin Cc: Michal Hocko Cc: Oscar Salvador Cc: Peter Xu Cc: Tony Luck Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e1c63e110f977205ab9dfb38989c54e6e7b52a7b Author: Nanyong Sun Date: Fri Jan 14 14:08:59 2022 -0800 mm: ksm: fix use-after-free kasan report in ksm_might_need_to_copy When under the stress of swapping in/out with KSM enabled, there is a low probability that kasan reports the BUG of use-after-free in ksm_might_need_to_copy() when do swap in. The freed object is the anon_vma got from page_anon_vma(page). It is because a swapcache page associated with one anon_vma now needed for another anon_vma, but the page's original vma was unmapped and the anon_vma was freed. In this case the if condition below always return false and then alloc a new page to copy. Swapin process then use the new page and can continue to run well, so this is harmless actually. } else if (anon_vma->root == vma->anon_vma->root && page->index == linear_page_index(vma, address)) { This patch exchange the order of above two judgment statement to avoid the kasan warning. Let cpu run "page->index == linear_page_index(vma, address)" firstly and return false basically to skip the read of anon_vma->root which may trigger the kasan use-after-free warning: ================================================================== BUG: KASAN: use-after-free in ksm_might_need_to_copy+0x12e/0x5b0 Read of size 8 at addr ffff88be9977dbd0 by task khugepaged/694 CPU: 8 PID: 694 Comm: khugepaged Kdump: loaded Tainted: G OE - 4.18.0.x86_64 Hardware name: 1288H V5/BC11SPSC0, BIOS 7.93 01/14/2021 Call Trace: dump_stack+0xf1/0x19b print_address_description+0x70/0x360 kasan_report+0x1b2/0x330 ksm_might_need_to_copy+0x12e/0x5b0 do_swap_page+0x452/0xe70 __collapse_huge_page_swapin+0x24b/0x720 khugepaged_scan_pmd+0xcae/0x1ff0 khugepaged+0x8ee/0xd70 kthread+0x1a2/0x1d0 ret_from_fork+0x1f/0x40 Allocated by task 2306153: kasan_kmalloc+0xa0/0xd0 kmem_cache_alloc+0xc0/0x1c0 anon_vma_clone+0xf7/0x380 anon_vma_fork+0xc0/0x390 copy_process+0x447b/0x4810 _do_fork+0x118/0x620 do_syscall_64+0x112/0x360 entry_SYSCALL_64_after_hwframe+0x65/0xca Freed by task 2306242: __kasan_slab_free+0x130/0x180 kmem_cache_free+0x78/0x1d0 unlink_anon_vmas+0x19c/0x4a0 free_pgtables+0x137/0x1b0 exit_mmap+0x133/0x320 mmput+0x15e/0x390 do_exit+0x8c5/0x1210 do_group_exit+0xb5/0x1b0 __x64_sys_exit_group+0x21/0x30 do_syscall_64+0x112/0x360 entry_SYSCALL_64_after_hwframe+0x65/0xca The buggy address belongs to the object at ffff88be9977dba0 which belongs to the cache anon_vma_chain of size 64 The buggy address is located 48 bytes inside of 64-byte region [ffff88be9977dba0, ffff88be9977dbe0) The buggy address belongs to the page: page:ffffea00fa65df40 count:1 mapcount:0 mapping:ffff888107717800 index:0x0 flags: 0x17ffffc0000100(slab) ================================================================== Link: https://lkml.kernel.org/r/20211202102940.1069634-1-sunnanyong@huawei.com Signed-off-by: Nanyong Sun Cc: Hugh Dickins Cc: Kefeng Wang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c0e582de6066e97c83a466f0e5983e3148123526 Author: Anshuman Khandual Date: Fri Jan 14 14:08:56 2022 -0800 mm/thp: drop unused trace events hugepage_[invalidate|splitting] The trace events hugepage_[invalidate|splitting], were added via the commit 9e813308a5c1 ("powerpc/thp: Add tracepoints to track hugepage invalidate"). Afterwards their call sites i.e trace_hugepage_[invalidate|splitting] were just dropped off, leaving these trace points unused. Link: https://lkml.kernel.org/r/1641546351-15109-1-git-send-email-anshuman.khandual@arm.com Signed-off-by: Anshuman Khandual Reviewed-by: David Hildenbrand Cc: Steven Rostedt Cc: Ingo Molnar Cc: Kirill A. Shutemov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit f1e8db04b68cc56edc5baee5c7cb1f9b79c3da7e Author: Colin Ian King Date: Fri Jan 14 14:08:53 2022 -0800 mm/migrate: remove redundant variables used in a for-loop The variable addr is being set and incremented in a for-loop but not actually being used. It is redundant and so addr and also variable start can be removed. Link: https://lkml.kernel.org/r/20211221185729.609630-1-colin.i.king@gmail.com Signed-off-by: Colin Ian King Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit dcee9bf5bf2f59c173f3645ac2274595ac6c6aea Author: Huang Ying Date: Fri Jan 14 14:08:49 2022 -0800 mm/migrate: move node demotion code to near its user Now, node_demotion and next_demotion_node() are placed between __unmap_and_move() and unmap_and_move(). This hurts code readability. So move them near their users in the file. There's no functionality change in this patch. Link: https://lkml.kernel.org/r/20211206031227.3323097-1-ying.huang@intel.com Signed-off-by: "Huang, Ying" Reviewed-by: Baolin Wang Reviewed-by: Yang Shi Reviewed-by: Wei Xu Cc: Dave Hansen Cc: Zi Yan Cc: Oscar Salvador Cc: Michal Hocko 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 7813a1b5257b8eb2cb915cd08e7ba857070fdfd3 Author: Baolin Wang Date: Fri Jan 14 14:08:46 2022 -0800 mm: migrate: add more comments for selecting target node randomly As Yang Shi suggested [1], it will be helpful to explain why we should select target node randomly now if there are multiple target nodes. [1] https://lore.kernel.org/all/CAHbLzkqSqCL+g7dfzeOw8fPyeEC0BBv13Ny1UVGHDkadnQdR=g@mail.gmail.com/ Link: https://lkml.kernel.org/r/c31d36bd097c6e9e69fc0f409c43b78e53e64fc2.1637766801.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang Reviewed-by: Yang Shi Cc: "Huang, Ying" Cc: Dave Hansen Cc: Zi Yan Cc: zhongjiang-ali Cc: Xunlei Pang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ac16ec835314677dd7405dfb5a5e007c3ca424c7 Author: Baolin Wang Date: Fri Jan 14 14:08:43 2022 -0800 mm: migrate: support multiple target nodes demotion We have some machines with multiple memory types like below, which have one fast (DRAM) memory node and two slow (persistent memory) memory nodes. According to current node demotion policy, if node 0 fills up, its memory should be migrated to node 1, when node 1 fills up, its memory will be migrated to node 2: node 0 -> node 1 -> node 2 ->stop. But this is not efficient and suitbale memory migration route for our machine with multiple slow memory nodes. Since the distance between node 0 to node 1 and node 0 to node 2 is equal, and memory migration between slow memory nodes will increase persistent memory bandwidth greatly, which will hurt the whole system's performance. Thus for this case, we can treat the slow memory node 1 and node 2 as a whole slow memory region, and we should migrate memory from node 0 to node 1 and node 2 if node 0 fills up. This patch changes the node_demotion data structure to support multiple target nodes, and establishes the migration path to support multiple target nodes with validating if the node distance is the best or not. available: 3 nodes (0-2) node 0 cpus: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 node 0 size: 62153 MB node 0 free: 55135 MB node 1 cpus: node 1 size: 127007 MB node 1 free: 126930 MB node 2 cpus: node 2 size: 126968 MB node 2 free: 126878 MB node distances: node 0 1 2 0: 10 20 20 1: 20 10 20 2: 20 20 10 Link: https://lkml.kernel.org/r/00728da107789bb4ed9e0d28b1d08fd8056af2ef.1636697263.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang Reviewed-by: "Huang, Ying" Cc: Dave Hansen Cc: Zi Yan Cc: Oscar Salvador Cc: Yang Shi Cc: Baolin Wang Cc: zhongjiang-ali Cc: Xunlei Pang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 84b328aa81216e08804d8875d63f26bda1298788 Author: Baolin Wang Date: Fri Jan 14 14:08:40 2022 -0800 mm: compaction: fix the migration stats in trace_mm_compaction_migratepages() Now the migrate_pages() has changed to return the number of {normal page, THP, hugetlb} instead, thus we should not use the return value to calculate the number of pages migrated successfully. Instead we can just use the 'nr_succeeded' which indicates the number of normal pages migrated successfully to calculate the non-migrated pages in trace_mm_compaction_migratepages(). Link: https://lkml.kernel.org/r/b4225251c4bec068dcd90d275ab7de88a39e2bd7.1636275127.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang Reviewed-by: Steven Rostedt (VMware) Cc: Zi Yan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 5d39a7ebc8be70e30176aed6f98f799bfa7439d6 Author: Baolin Wang Date: Fri Jan 14 14:08:37 2022 -0800 mm: migrate: correct the hugetlb migration stats Correct the migration stats for hugetlb with using compound_nr() instead of thp_nr_pages(), meanwhile change 'nr_failed_pages' to record the number of normal pages failed to migrate, including THP and hugetlb, and 'nr_succeeded' will record the number of normal pages migrated successfully. [baolin.wang@linux.alibaba.com: fix docs, per Mike] Link: https://lkml.kernel.org/r/141bdfc6-f898-3cc3-f692-726c5f6cb74d@linux.alibaba.com Link: https://lkml.kernel.org/r/71a4b6c22f208728fe8c78ad26375436c4ff9704.1636275127.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang Reviewed-by: Zi Yan Cc: Steven Rostedt (VMware) Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b5bade978e9b8f42521ccef711642bd21313cf44 Author: Baolin Wang Date: Fri Jan 14 14:08:34 2022 -0800 mm: migrate: fix the return value of migrate_pages() Patch series "Improve the migration stats". According to talk with Zi Yan [1], this patch set changes the return value of migrate_pages() to avoid returning a number which is larger than the number of pages the users tried to migrate by move_pages() syscall. Also fix the hugetlb migration stats and migration stats in trace_mm_compaction_migratepages(). [1] https://lore.kernel.org/linux-mm/7E44019D-2A5D-4BA7-B4D5-00D4712F1687@nvidia.com/ This patch (of 3): As Zi Yan pointed out, the syscall move_pages() can return a non-migrated number larger than the number of pages the users tried to migrate, when a THP page is failed to migrate. This is confusing for users. Since other migration scenarios do not care about the actual non-migrated number of pages except the memory compaction migration which will fix in following patch. Thus we can change the return value to return the number of {normal page, THP, hugetlb} instead to avoid this issue, and the number of THP splits will be considered as the number of non-migrated THP, no matter how many subpages of the THP are migrated successfully. Meanwhile we should still keep the migration counters using the number of normal pages. Link: https://lkml.kernel.org/r/cover.1636275127.git.baolin.wang@linux.alibaba.com Link: https://lkml.kernel.org/r/6486fabc3e8c66ff613e150af25e89b3147977a6.1636275127.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang Signed-off-by: Zi Yan Co-developed-by: Zi Yan Cc: Steven Rostedt (VMware) Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit d6aba4c8e20d4d2bf65d589953f6d891c178f3a3 Author: Sean Christopherson Date: Fri Jan 14 14:08:30 2022 -0800 hugetlbfs: fix off-by-one error in hugetlb_vmdelete_list() Pass "end - 1" instead of "end" when walking the interval tree in hugetlb_vmdelete_list() to fix an inclusive vs. exclusive bug. The two callers that pass a non-zero "end" treat it as exclusive, whereas the interval tree iterator expects an inclusive "last". E.g. punching a hole in a file that precisely matches the size of a single hugepage, with a vma starting right on the boundary, will result in unmap_hugepage_range() being called twice, with the second call having start==end. The off-by-one error doesn't cause functional problems as __unmap_hugepage_range() turns into a massive nop due to short-circuiting its for-loop on "address < end". But, the mmu_notifier invocations to invalid_range_{start,end}() are passed a bogus zero-sized range, which may be unexpected behavior for secondary MMUs. The bug was exposed by commit ed922739c919 ("KVM: Use interval tree to do fast hva lookup in memslots"), currently queued in the KVM tree for 5.17, which added a WARN to detect ranges with start==end. Link: https://lkml.kernel.org/r/20211228234257.1926057-1-seanjc@google.com Fixes: 1bfad99ab425 ("hugetlbfs: hugetlb_vmtruncate_list() needs to take a range to delete") Signed-off-by: Sean Christopherson Reported-by: syzbot+4e697fe80a31aa7efe21@syzkaller.appspotmail.com Reviewed-by: Mike Kravetz Cc: Paolo Bonzini Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit f530243a172d2ff03f88d0056f838928d6445c6d Author: Jann Horn Date: Fri Jan 14 14:08:27 2022 -0800 mm, oom: OOM sysrq should always kill a process The OOM kill sysrq (alt+sysrq+F) should allow the user to kill the process with the highest OOM badness with a single execution. However, at the moment, the OOM kill can bail out if an OOM notifier (e.g. the i915 one) says that it reclaimed a tiny amount of memory from somewhere. That's probably not what the user wants, so skip the bailout if the OOM was triggered via sysrq. Link: https://lkml.kernel.org/r/20220106102605.635656-1-jannh@google.com Signed-off-by: Jann Horn Acked-by: Michal Hocko Acked-by: David Rientjes Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit dad5b0232949818ae581ebd089c7013e2fdbb093 Author: Randy Dunlap Date: Fri Jan 14 14:08:24 2022 -0800 mm/mempolicy: fix all kernel-doc warnings Fix kernel-doc warnings in mempolicy.c: mempolicy.c:139: warning: No description found for return value of 'numa_map_to_online_node' mempolicy.c:2165: warning: Excess function parameter 'node' description in 'alloc_pages_vma' mempolicy.c:2973: warning: No description found for return value of 'mpol_parse_str' Link: https://lkml.kernel.org/r/20211213233216.5477-1-rdunlap@infradead.org Signed-off-by: Randy Dunlap Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 21b084fdf2a49ca1634e8e360e9ab6f9ff0dee11 Author: Aneesh Kumar K.V Date: Fri Jan 14 14:08:21 2022 -0800 mm/mempolicy: wire up syscall set_mempolicy_home_node Link: https://lkml.kernel.org/r/20211202123810.267175-4-aneesh.kumar@linux.ibm.com Signed-off-by: Aneesh Kumar K.V Cc: Ben Widawsky Cc: Dave Hansen Cc: Feng Tang Cc: 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 Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c6018b4b254971863bd0ad36bb5e7d0fa0f0ddb0 Author: Aneesh Kumar K.V Date: Fri Jan 14 14:08:17 2022 -0800 mm/mempolicy: add set_mempolicy_home_node syscall This syscall can be used to set a home node for the MPOL_BIND and MPOL_PREFERRED_MANY memory policy. Users should use this syscall after setting up a memory policy for the specified range as shown below. mbind(p, nr_pages * page_size, MPOL_BIND, new_nodes->maskp, new_nodes->size + 1, 0); sys_set_mempolicy_home_node((unsigned long)p, nr_pages * page_size, home_node, 0); The syscall allows specifying a home node/preferred node from which kernel will fulfill memory allocation requests first. For address range with MPOL_BIND memory policy, if nodemask specifies more than one node, page allocations will come from the node in the nodemask with sufficient free memory that is closest to the home node/preferred node. For MPOL_PREFERRED_MANY if the nodemask specifies more than one node, page allocation will come from the node in the nodemask with sufficient free memory that is closest to the home node/preferred node. If there is not enough memory in all the nodes specified in the nodemask, the allocation will be attempted from the closest numa node to the home node in the system. This helps applications to hint at a memory allocation preference node and fallback to _only_ a set of nodes if the memory is not available on the preferred node. Fallback allocation is attempted from the node which is nearest to the preferred node. This helps applications to have control on memory allocation numa nodes and avoids default fallback to slow memory NUMA nodes. For example a system with NUMA nodes 1,2 and 3 with DRAM memory and 10, 11 and 12 of slow memory new_nodes = numa_bitmask_alloc(nr_nodes); numa_bitmask_setbit(new_nodes, 1); numa_bitmask_setbit(new_nodes, 2); numa_bitmask_setbit(new_nodes, 3); p = mmap(NULL, nr_pages * page_size, protflag, mapflag, -1, 0); mbind(p, nr_pages * page_size, MPOL_BIND, new_nodes->maskp, new_nodes->size + 1, 0); sys_set_mempolicy_home_node(p, nr_pages * page_size, 2, 0); This will allocate from nodes closer to node 2 and will make sure the kernel will only allocate from nodes 1, 2, and 3. Memory will not be allocated from slow memory nodes 10, 11, and 12. This differs from default MPOL_BIND behavior in that with default MPOL_BIND the allocation will be attempted from node closer to the local node. One of the reasons to specify a home node is to allow allocations from cpu less NUMA node and its nearby NUMA nodes. With MPOL_PREFERRED_MANY on the other hand will first try to allocate from the closest node to node 2 from the node list 1, 2 and 3. If those nodes don't have enough memory, kernel will allocate from slow memory node 10, 11 and 12 which ever is closer to node 2. Link: https://lkml.kernel.org/r/20211202123810.267175-3-aneesh.kumar@linux.ibm.com Signed-off-by: Aneesh Kumar K.V Cc: Ben Widawsky Cc: Dave Hansen Cc: Feng Tang Cc: 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 Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c04551162167368022a61899843821bbf015b473 Author: Aneesh Kumar K.V Date: Fri Jan 14 14:08:14 2022 -0800 mm/mempolicy: use policy_node helper with MPOL_PREFERRED_MANY Patch series "mm: add new syscall set_mempolicy_home_node", v6. This patch (of 3): A followup patch will enable setting a home node with MPOL_PREFERRED_MANY memory policy. To facilitate that switch to using policy_node helper. There is no functional change in this patch. Link: https://lkml.kernel.org/r/20211202123810.267175-1-aneesh.kumar@linux.ibm.com Link: https://lkml.kernel.org/r/20211202123810.267175-2-aneesh.kumar@linux.ibm.com Signed-off-by: Aneesh Kumar K.V Acked-by: Michal Hocko Cc: Ben Widawsky Cc: Dave Hansen Cc: Feng Tang Cc: Andrea Arcangeli Cc: Mel Gorman Cc: Mike Kravetz Cc: Randy Dunlap Cc: Vlastimil Babka Cc: Andi Kleen Cc: Dan Williams Cc: Huang Ying Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 721fb891ad0b3956d5c168b2931e3e5e4fb7ca40 Author: Chen Wandun Date: Fri Jan 14 14:08:10 2022 -0800 mm/page_isolation: unset migratetype directly for non Buddy page In unset_migratetype_isolate(), we can bypass the call to move_freepages_block() for non-buddy pages. It will save a few cpu cycles for some situations such as cma and hugetlb when allocating continue pages, in these situation function alloc_contig_pages will be called. alloc_contig_pages __alloc_contig_migrate_range isolate_freepages_range ==> pages has been remove from buddy undo_isolate_page_range unset_migratetype_isolate ==> can directly set migratetype [osalvador@suse.de: changelog tweak] Link: https://lkml.kernel.org/r/20211229033649.2760586-1-chenwandun@huawei.com Fixes: 3c605096d315 ("mm/page_alloc: restrict max order of merging on isolated pageblock") Signed-off-by: Chen Wandun Reviewed-by: Oscar Salvador Cc: Vlastimil Babka Cc: Joonsoo Kim Cc: Wang Kefeng Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e4b424b7ec8791087375bb1f2480a3ba05d21e0b Author: Gang Li Date: Fri Jan 14 14:08:07 2022 -0800 vmscan: make drop_slab_node static drop_slab_node is only used in drop_slab. So remove it's declaration from header file and add keyword static for it's definition. Link: https://lkml.kernel.org/r/20211111062445.5236-1-ligang.bdlg@bytedance.com Signed-off-by: Gang Li Reviewed-by: David Hildenbrand Reviewed-by: Muchun Song Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 692b55815cf970eb4ce428f48f2c94d1800acc4b Author: Mike Kravetz Date: Fri Jan 14 14:08:04 2022 -0800 userfaultfd/selftests: clean up hugetlb allocation code The message for commit f5c73297181c ("userfaultfd/selftests: fix hugetlb area allocations") says there is no need to create a hugetlb file in the non-shared testing case. However, the commit did not actually change the code to prevent creation of the file. While it is technically true that there is no need to create and use a hugetlb file in the case of non-shared-testing, it is useful. This is because 'hole punching' of a hugetlb file has the potentially incorrect side effect of also removing pages from private mappings. The userfaultfd test relies on this side effect for removing pages from the destination buffer during rounds of stress testing. Remove the incomplete code that was added to deal with no hugetlb file. Just keep the code that prevents reserves from being created for the destination area. Link: https://lkml.kernel.org/r/20220104021729.111006-1-mike.kravetz@oracle.com Signed-off-by: Mike Kravetz Reviewed-by: Axel Rasmussen Cc: Peter Xu Cc: Andrea Arcangeli Cc: Mina Almasry Cc: Shuah Khan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit fab51505480058dcb63d973515c748fa6c437cab Author: Peter Xu Date: Fri Jan 14 14:08:01 2022 -0800 selftests/uffd: allow EINTR/EAGAIN This allow test to continue with interruptions like gdb. Link: https://lkml.kernel.org/r/20211115135219.85881-1-peterx@redhat.com Signed-off-by: Peter Xu Reviewed-by: Axel Rasmussen Cc: Andrea Arcangeli Cc: Nadav Amit Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 209376ed2a8431ccb4c40fdcef11194fc1e749b0 Author: Waiman Long Date: Fri Jan 14 14:07:58 2022 -0800 selftests/vm: make charge_reserved_hugetlb.sh work with existing cgroup setting The hugetlb cgroup reservation test charge_reserved_hugetlb.sh assume that no cgroup filesystems are mounted before running the test. That is not true in many cases. As a result, the test fails to run. Fix that by querying the current cgroup mount setting and using the existing cgroup setup instead before attempting to freshly mount a cgroup filesystem. Similar change is also made for hugetlb_reparenting_test.sh as well, though it still has problem if cgroup v2 isn't used. The patched test scripts were run on a centos 8 based system to verify that they ran properly. Link: https://lkml.kernel.org/r/20220106201359.1646575-1-longman@redhat.com Fixes: 29750f71a9b4 ("hugetlb_cgroup: add hugetlb_cgroup reservation tests") Signed-off-by: Waiman Long Acked-by: Mina Almasry Cc: Shuah Khan Cc: Mike Kravetz Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e9ea874a8ffb0f8ebed4f4981531a32c5b663d79 Author: Yang Yang Date: Fri Jan 14 14:07:55 2022 -0800 mm/vmstat: add events for THP max_ptes_* exceeds There are interfaces to adjust max_ptes_none, max_ptes_swap, max_ptes_shared values, see /sys/kernel/mm/transparent_hugepage/khugepaged/. But system administrator may not know which value is the best. So Add those events to support adjusting max_ptes_* to suitable values. For example, if default max_ptes_swap value causes too much failures, and system uses zram whose IO is fast, administrator could increase max_ptes_swap until THP_SCAN_EXCEED_SWAP_PTE not increase anymore. Link: https://lkml.kernel.org/r/20211225094036.574157-1-yang.yang29@zte.com.cn Signed-off-by: Yang Yang Cc: "Huang, Ying" Cc: Dave Hansen Cc: Minchan Kim Cc: Saravanan D Cc: Mike Kravetz Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit f77a286de48c04f7dd248b41584645afc3613bb1 Author: Yosry Ahmed Date: Fri Jan 14 14:07:52 2022 -0800 mm, hugepages: make memory size variable in hugepage-mremap selftest The hugetlb vma mremap() test currently maps 1GB of memory to trigger pmd sharing and make sure that 'unshare' path in mremap code works. The test originally only mapped 10MB of memory (as specified by the header comment) but was later modified to 1GB to tackle this case. However, not all machines will have 1GB of memory to spare for this test. Adding a mapping size arg will allow run_vmtest.sh to pass an adequate mapping size, while allowing users to run the test independently with arbitrary size mappings. Link: https://lkml.kernel.org/r/20211124203805.3700355-1-yosryahmed@google.com Signed-off-by: Yosry Ahmed Cc: Shuah Khan Cc: Mina Almasry Cc: Mike Kravetz Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit f47761999052b1cc987dd3e3d3adf47997358fc0 Author: Mina Almasry Date: Fri Jan 14 14:07:48 2022 -0800 hugetlb: add hugetlb.*.numa_stat file For hugetlb backed jobs/VMs it's critical to understand the numa information for the memory backing these jobs to deliver optimal performance. Currently this technically can be queried from /proc/self/numa_maps, but there are significant issues with that. Namely: 1. Memory can be mapped or unmapped. 2. numa_maps are per process and need to be aggregated across all processes in the cgroup. For shared memory this is more involved as the userspace needs to make sure it doesn't double count shared mappings. 3. I believe querying numa_maps needs to hold the mmap_lock which adds to the contention on this lock. For these reasons I propose simply adding hugetlb.*.numa_stat file, which shows the numa information of the cgroup similarly to memory.numa_stat. On cgroup-v2: cat /sys/fs/cgroup/unified/test/hugetlb.2MB.numa_stat total=2097152 N0=2097152 N1=0 On cgroup-v1: cat /sys/fs/cgroup/hugetlb/test/hugetlb.2MB.numa_stat total=2097152 N0=2097152 N1=0 hierarichal_total=2097152 N0=2097152 N1=0 This patch was tested manually by allocating hugetlb memory and querying the hugetlb.*.numa_stat file of the cgroup and its parents. [colin.i.king@googlemail.com: fix spelling mistake "hierarichal" -> "hierarchical"] Link: https://lkml.kernel.org/r/20211125090635.23508-1-colin.i.king@gmail.com [keescook@chromium.org: fix copy/paste array assignment] Link: https://lkml.kernel.org/r/20211203065647.2819707-1-keescook@chromium.org Link: https://lkml.kernel.org/r/20211123001020.4083653-1-almasrymina@google.com Signed-off-by: Mina Almasry Signed-off-by: Colin Ian King Signed-off-by: Kees Cook Reviewed-by: Shakeel Butt Reviewed-by: Muchun Song Reviewed-by: Mike Kravetz Cc: Shuah Khan Cc: Miaohe Lin Cc: Oscar Salvador Cc: Michal Hocko Cc: David Rientjes Cc: Jue Wang Cc: Yang Yao Cc: Joanna Li Cc: Cannon Matthews Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c4dc63f0032c77464fbd4e7a6afc22fa6913c4a7 Author: Baoquan He Date: Fri Jan 14 14:07:44 2022 -0800 mm/page_alloc.c: do not warn allocation failure on zone DMA if no managed pages In kdump kernel of x86_64, page allocation failure is observed: kworker/u2:2: page allocation failure: order:0, mode:0xcc1(GFP_KERNEL|GFP_DMA), nodemask=(null),cpuset=/,mems_allowed=0 CPU: 0 PID: 55 Comm: kworker/u2:2 Not tainted 5.16.0-rc4+ #5 Hardware name: AMD Dinar/Dinar, BIOS RDN1505B 06/05/2013 Workqueue: events_unbound async_run_entry_fn Call Trace: dump_stack_lvl+0x48/0x5e warn_alloc.cold+0x72/0xd6 __alloc_pages_slowpath.constprop.0+0xc69/0xcd0 __alloc_pages+0x1df/0x210 new_slab+0x389/0x4d0 ___slab_alloc+0x58f/0x770 __slab_alloc.constprop.0+0x4a/0x80 kmem_cache_alloc_trace+0x24b/0x2c0 sr_probe+0x1db/0x620 ...... device_add+0x405/0x920 ...... __scsi_add_device+0xe5/0x100 ata_scsi_scan_host+0x97/0x1d0 async_run_entry_fn+0x30/0x130 process_one_work+0x1e8/0x3c0 worker_thread+0x50/0x3b0 ? rescuer_thread+0x350/0x350 kthread+0x16b/0x190 ? set_kthread_struct+0x40/0x40 ret_from_fork+0x22/0x30 Mem-Info: ...... The above failure happened when calling kmalloc() to allocate buffer with GFP_DMA. It requests to allocate slab page from DMA zone while no managed pages at all in there. sr_probe() --> get_capabilities() --> buffer = kmalloc(512, GFP_KERNEL | GFP_DMA); Because in the current kernel, dma-kmalloc will be created as long as CONFIG_ZONE_DMA is enabled. However, kdump kernel of x86_64 doesn't have managed pages on DMA zone since commit 6f599d84231f ("x86/kdump: Always reserve the low 1M when the crashkernel option is specified"). The failure can be always reproduced. For now, let's mute the warning of allocation failure if requesting pages from DMA zone while no managed pages. [akpm@linux-foundation.org: fix warning] Link: https://lkml.kernel.org/r/20211223094435.248523-4-bhe@redhat.com Fixes: 6f599d84231f ("x86/kdump: Always reserve the low 1M when the crashkernel option is specified") Signed-off-by: Baoquan He Acked-by: John Donnelly Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: Christoph Lameter Cc: Pekka Enberg Cc: David Rientjes Cc: Joonsoo Kim Cc: Vlastimil Babka Cc: Borislav Petkov Cc: Christoph Hellwig Cc: David Hildenbrand Cc: David Laight Cc: Marek Szyprowski Cc: Robin Murphy Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a674e48c5443d12a8a43c3ac42367aa39505d506 Author: Baoquan He Date: Fri Jan 14 14:07:41 2022 -0800 dma/pool: create dma atomic pool only if dma zone has managed pages Currently three dma atomic pools are initialized as long as the relevant kernel codes are built in. While in kdump kernel of x86_64, this is not right when trying to create atomic_pool_dma, because there's no managed pages in DMA zone. In the case, DMA zone only has low 1M memory presented and locked down by memblock allocator. So no pages are added into buddy of DMA zone. Please check commit f1d4d47c5851 ("x86/setup: Always reserve the first 1M of RAM"). Then in kdump kernel of x86_64, it always prints below failure message: DMA: preallocated 128 KiB GFP_KERNEL pool for atomic allocations swapper/0: page allocation failure: order:5, mode:0xcc1(GFP_KERNEL|GFP_DMA), nodemask=(null),cpuset=/,mems_allowed=0 CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.13.0-0.rc5.20210611git929d931f2b40.42.fc35.x86_64 #1 Hardware name: Dell Inc. PowerEdge R910/0P658H, BIOS 2.12.0 06/04/2018 Call Trace: dump_stack+0x7f/0xa1 warn_alloc.cold+0x72/0xd6 __alloc_pages_slowpath.constprop.0+0xf29/0xf50 __alloc_pages+0x24d/0x2c0 alloc_page_interleave+0x13/0xb0 atomic_pool_expand+0x118/0x210 __dma_atomic_pool_init+0x45/0x93 dma_atomic_pool_init+0xdb/0x176 do_one_initcall+0x67/0x320 kernel_init_freeable+0x290/0x2dc kernel_init+0xa/0x111 ret_from_fork+0x22/0x30 Mem-Info: ...... DMA: failed to allocate 128 KiB GFP_KERNEL|GFP_DMA pool for atomic allocation DMA: preallocated 128 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations Here, let's check if DMA zone has managed pages, then create atomic_pool_dma if yes. Otherwise just skip it. Link: https://lkml.kernel.org/r/20211223094435.248523-3-bhe@redhat.com Fixes: 6f599d84231f ("x86/kdump: Always reserve the low 1M when the crashkernel option is specified") Signed-off-by: Baoquan He Reviewed-by: Christoph Hellwig Acked-by: John Donnelly Reviewed-by: David Hildenbrand Cc: Marek Szyprowski Cc: Robin Murphy Cc: Borislav Petkov Cc: Christoph Lameter Cc: David Laight Cc: David Rientjes Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: Joonsoo Kim Cc: Pekka Enberg Cc: Vlastimil Babka Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 62b3107073646e0946bd97ff926832bafb846d17 Author: Baoquan He Date: Fri Jan 14 14:07:37 2022 -0800 mm_zone: add function to check if managed dma zone exists Patch series "Handle warning of allocation failure on DMA zone w/o managed pages", v4. **Problem observed: On x86_64, when crash is triggered and entering into kdump kernel, page allocation failure can always be seen. --------------------------------- DMA: preallocated 128 KiB GFP_KERNEL pool for atomic allocations swapper/0: page allocation failure: order:5, mode:0xcc1(GFP_KERNEL|GFP_DMA), nodemask=(null),cpuset=/,mems_allowed=0 CPU: 0 PID: 1 Comm: swapper/0 Call Trace: dump_stack+0x7f/0xa1 warn_alloc.cold+0x72/0xd6 ...... __alloc_pages+0x24d/0x2c0 ...... dma_atomic_pool_init+0xdb/0x176 do_one_initcall+0x67/0x320 ? rcu_read_lock_sched_held+0x3f/0x80 kernel_init_freeable+0x290/0x2dc ? rest_init+0x24f/0x24f kernel_init+0xa/0x111 ret_from_fork+0x22/0x30 Mem-Info: ------------------------------------ ***Root cause: In the current kernel, it assumes that DMA zone must have managed pages and try to request pages if CONFIG_ZONE_DMA is enabled. While this is not always true. E.g in kdump kernel of x86_64, only low 1M is presented and locked down at very early stage of boot, so that this low 1M won't be added into buddy allocator to become managed pages of DMA zone. This exception will always cause page allocation failure if page is requested from DMA zone. ***Investigation: This failure happens since below commit merged into linus's tree. 1a6a9044b967 x86/setup: Remove CONFIG_X86_RESERVE_LOW and reservelow= options 23721c8e92f7 x86/crash: Remove crash_reserve_low_1M() f1d4d47c5851 x86/setup: Always reserve the first 1M of RAM 7c321eb2b843 x86/kdump: Remove the backup region handling 6f599d84231f x86/kdump: Always reserve the low 1M when the crashkernel option is specified Before them, on x86_64, the low 640K area will be reused by kdump kernel. So in kdump kernel, the content of low 640K area is copied into a backup region for dumping before jumping into kdump. Then except of those firmware reserved region in [0, 640K], the left area will be added into buddy allocator to become available managed pages of DMA zone. However, after above commits applied, in kdump kernel of x86_64, the low 1M is reserved by memblock, but not released to buddy allocator. So any later page allocation requested from DMA zone will fail. At the beginning, if crashkernel is reserved, the low 1M need be locked down because AMD SME encrypts memory making the old backup region mechanims impossible when switching into kdump kernel. Later, it was also observed that there are BIOSes corrupting memory under 1M. To solve this, in commit f1d4d47c5851, the entire region of low 1M is always reserved after the real mode trampoline is allocated. Besides, recently, Intel engineer mentioned their TDX (Trusted domain extensions) which is under development in kernel also needs to lock down the low 1M. So we can't simply revert above commits to fix the page allocation failure from DMA zone as someone suggested. ***Solution: Currently, only DMA atomic pool and dma-kmalloc will initialize and request page allocation with GFP_DMA during bootup. So only initializ DMA atomic pool when DMA zone has available managed pages, otherwise just skip the initialization. For dma-kmalloc(), for the time being, let's mute the warning of allocation failure if requesting pages from DMA zone while no manged pages. Meanwhile, change code to use dma_alloc_xx/dma_map_xx API to replace kmalloc(GFP_DMA), or do not use GFP_DMA when calling kmalloc() if not necessary. Christoph is posting patches to fix those under drivers/scsi/. Finally, we can remove the need of dma-kmalloc() as people suggested. This patch (of 3): In some places of the current kernel, it assumes that dma zone must have managed pages if CONFIG_ZONE_DMA is enabled. While this is not always true. E.g in kdump kernel of x86_64, only low 1M is presented and locked down at very early stage of boot, so that there's no managed pages at all in DMA zone. This exception will always cause page allocation failure if page is requested from DMA zone. Here add function has_managed_dma() and the relevant helper functions to check if there's DMA zone with managed pages. It will be used in later patches. Link: https://lkml.kernel.org/r/20211223094435.248523-1-bhe@redhat.com Link: https://lkml.kernel.org/r/20211223094435.248523-2-bhe@redhat.com Fixes: 6f599d84231f ("x86/kdump: Always reserve the low 1M when the crashkernel option is specified") Signed-off-by: Baoquan He Reviewed-by: David Hildenbrand Acked-by: John Donnelly Cc: Christoph Hellwig Cc: Christoph Lameter Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: Pekka Enberg Cc: David Rientjes Cc: Joonsoo Kim Cc: Vlastimil Babka Cc: David Laight Cc: Borislav Petkov Cc: Marek Szyprowski Cc: Robin Murphy Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit eaab8e753632b8e961701d02a5bb398c820f309c Author: Anshuman Khandual Date: Fri Jan 14 14:07:33 2022 -0800 mm/page_alloc.c: modify the comment section for alloc_contig_pages() Clarify that the alloc_contig_pages() allocated range will always be aligned to the requested nr_pages. Link: https://lkml.kernel.org/r/1639545478-12160-1-git-send-email-anshuman.khandual@arm.com Signed-off-by: Anshuman Khandual Cc: David Hildenbrand Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 04a536bfbd0f885338eecc2a4503dfca50ac94dd Author: Miles Chen Date: Fri Jan 14 14:07:30 2022 -0800 include/linux/gfp.h: further document GFP_DMA32 kmalloc(..., GFP_DMA32) does not return DMA32 memory because the DMA32 kmalloc cache array is not implemented. (Reason: there is no such user in kernel). Put a short comment about this so people can understand this by reading the comment. [1] https://lists.linuxfoundation.org/pipermail/iommu/2018-December/031696.html Link: https://lkml.kernel.org/r/20211207093610.6406-1-miles.chen@mediatek.com Signed-off-by: Miles Chen Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit be1a13eb51077b2ec5f7f4306f93dfece503a3f1 Author: Michal Hocko Date: Fri Jan 14 14:07:27 2022 -0800 mm: drop node from alloc_pages_vma alloc_pages_vma is meant to allocate a page with a vma specific memory policy. The initial node parameter is always a local node so it is pointless to waste a function argument for this. Drop the parameter. Link: https://lkml.kernel.org/r/YaSnlv4QpryEpesG@dhcp22.suse.cz Signed-off-by: Michal Hocko Cc: Aneesh Kumar K.V Cc: Ben Widawsky Cc: Dave Hansen Cc: Feng Tang Cc: Andrea Arcangeli Cc: Mel Gorman Cc: Mike Kravetz Cc: Randy Dunlap Cc: Vlastimil Babka Cc: Andi Kleen Cc: Dan Williams Cc: "Huang, Ying" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ca831f29f8f25c97182e726429b38c0802200c8f Author: Xiongwei Song Date: Fri Jan 14 14:07:24 2022 -0800 mm: page_alloc: fix building error on -Werror=array-compare Arthur Marsh reported we would hit the error below when building kernel with gcc-12: CC mm/page_alloc.o mm/page_alloc.c: In function `mem_init_print_info': mm/page_alloc.c:8173:27: error: comparison between two arrays [-Werror=array-compare] 8173 | if (start <= pos && pos < end && size > adj) \ | In C++20, the comparision between arrays should be warned. Link: https://lkml.kernel.org/r/20211125130928.32465-1-sxwjean@me.com Signed-off-by: Xiongwei Song Reported-by: Arthur Marsh Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 1611f74a94ba2e0f2d25b75008ed8e76e122097a Author: Changcheng Deng Date: Fri Jan 14 14:07:21 2022 -0800 mm: fix boolreturn.cocci warning Return statements in functions returning bool should use true/false instead of 1/0. Link: https://lkml.kernel.org/r/20211126073327.74815-1-deng.changcheng@zte.com.cn Signed-off-by: Changcheng Deng Reported-by: Zeal Robot Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 39c65a94cd9661532be150e88f8b02f4a6844a35 Author: Suren Baghdasaryan Date: Fri Jan 14 14:07:17 2022 -0800 mm/pagealloc: sysctl: change watermark_scale_factor max limit to 30% For embedded systems with low total memory, having to run applications with relatively large memory requirements, 10% max limitation for watermark_scale_factor poses an issue of triggering direct reclaim every time such application is started. This results in slow application startup times and bad end-user experience. By increasing watermark_scale_factor max limit we allow vendors more flexibility to choose the right level of kswapd aggressiveness for their device and workload requirements. Link: https://lkml.kernel.org/r/20211124193604.2758863-1-surenb@google.com Signed-off-by: Suren Baghdasaryan Acked-by: Johannes Weiner Cc: Michal Hocko Cc: Lukas Middendorf Cc: Antti Palosaari Cc: Luis Chamberlain Cc: Kees Cook Cc: Iurii Zaikin Cc: Dave Hansen Cc: Vlastimil Babka Cc: Mel Gorman Cc: Jonathan Corbet Cc: Zhang Yi Cc: Fengfei Xi Cc: Mike Rapoport Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 4034247a0d6ab281ba3293798ce67af494d86129 Author: NeilBrown Date: Fri Jan 14 14:07:14 2022 -0800 mm: introduce memalloc_retry_wait() Various places in the kernel - largely in filesystems - respond to a memory allocation failure by looping around and re-trying. Some of these cannot conveniently use __GFP_NOFAIL, for reasons such as: - a GFP_ATOMIC allocation, which __GFP_NOFAIL doesn't work on - a need to check for the process being signalled between failures - the possibility that other recovery actions could be performed - the allocation is quite deep in support code, and passing down an extra flag to say if __GFP_NOFAIL is wanted would be clumsy. Many of these currently use congestion_wait() which (in almost all cases) simply waits the given timeout - congestion isn't tracked for most devices. It isn't clear what the best delay is for loops, but it is clear that the various filesystems shouldn't be responsible for choosing a timeout. This patch introduces memalloc_retry_wait() with takes on that responsibility. Code that wants to retry a memory allocation can call this function passing the GFP flags that were used. It will wait however is appropriate. For now, it only considers __GFP_NORETRY and whatever gfpflags_allow_blocking() tests. If blocking is allowed without __GFP_NORETRY, then alloc_page either made some reclaim progress, or waited for a while, before failing. So there is no need for much further waiting. memalloc_retry_wait() will wait until the current jiffie ends. If this condition is not met, then alloc_page() won't have waited much if at all. In that case memalloc_retry_wait() waits about 200ms. This is the delay that most current loops uses. linux/sched/mm.h needs to be included in some files now, but linux/backing-dev.h does not. Link: https://lkml.kernel.org/r/163754371968.13692.1277530886009912421@noble.neil.brown.name Signed-off-by: NeilBrown Cc: Dave Chinner Cc: Michal Hocko Cc: "Theodore Ts'o" Cc: Jaegeuk Kim Cc: Chao Yu Cc: Darrick J. Wong Cc: Chuck Lever Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 704687deaae768a818d7da0584ee021793a97684 Author: Michal Hocko Date: Fri Jan 14 14:07:11 2022 -0800 mm: make slab and vmalloc allocators __GFP_NOLOCKDEP aware sl?b and vmalloc allocators reduce the given gfp mask for their internal needs. For that they use GFP_RECLAIM_MASK to preserve the reclaim behavior and constrains. __GFP_NOLOCKDEP is not a part of that mask because it doesn't really control the reclaim behavior strictly speaking. On the other hand it tells the underlying page allocator to disable reclaim recursion detection so arguably it should be part of the mask. Having __GFP_NOLOCKDEP in the mask will not alter the behavior in any form so this change is safe pretty much by definition. It also adds a support for this flag to SL?B and vmalloc allocators which will in turn allow its use to kvmalloc as well. A lack of the support has been noticed recently in http://lkml.kernel.org/r/20211119225435.GZ449541@dread.disaster.area Link: https://lkml.kernel.org/r/YZ9XtLY4AEjVuiEI@dhcp22.suse.cz Signed-off-by: Michal Hocko Reported-by: Sebastian Andrzej Siewior Acked-by: Dave Chinner Acked-by: Vlastimil Babka Cc: Christoph Hellwig Cc: Dave Chinner Cc: Ilya Dryomov Cc: Jeff Layton Cc: Neil Brown Cc: Uladzislau Rezki (Sony) Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a421ef303008b0ceee2cfc625c3246fa7654b0ca Author: Michal Hocko Date: Fri Jan 14 14:07:07 2022 -0800 mm: allow !GFP_KERNEL allocations for kvmalloc Support for GFP_NO{FS,IO} and __GFP_NOFAIL has been implemented by previous patches so we can allow the support for kvmalloc. This will allow some external users to simplify or completely remove their helpers. GFP_NOWAIT semantic hasn't been supported so far but it hasn't been explicitly documented so let's add a note about that. ceph_kvmalloc is the first helper to be dropped and changed to kvmalloc. Link: https://lkml.kernel.org/r/20211122153233.9924-5-mhocko@kernel.org Signed-off-by: Michal Hocko Reviewed-by: Uladzislau Rezki (Sony) Acked-by: Vlastimil Babka Cc: Christoph Hellwig Cc: Dave Chinner Cc: Ilya Dryomov Cc: Jeff Layton Cc: Neil Brown Cc: Sebastian Andrzej Siewior Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 30d3f01191d305c99e8b3f8b1b328fc852270c95 Author: Michal Hocko Date: Fri Jan 14 14:07:04 2022 -0800 mm/vmalloc: be more explicit about supported gfp flags. Commit b7d90e7a5ea8 ("mm/vmalloc: be more explicit about supported gfp flags") has been merged prematurely without the rest of the series and without addressed review feedback from Neil. Fix that up now. Only wording is changed slightly. Link: https://lkml.kernel.org/r/20211122153233.9924-4-mhocko@kernel.org Signed-off-by: Michal Hocko Reviewed-by: Uladzislau Rezki (Sony) Acked-by: Vlastimil Babka Cc: Christoph Hellwig Cc: Dave Chinner Cc: Ilya Dryomov Cc: Jeff Layton Cc: Neil Brown Cc: Sebastian Andrzej Siewior Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 9376130c390a76fac2788a5d6e1a149017b4ab50 Author: Michal Hocko Date: Fri Jan 14 14:07:01 2022 -0800 mm/vmalloc: add support for __GFP_NOFAIL Dave Chinner has mentioned that some of the xfs code would benefit from kvmalloc support for __GFP_NOFAIL because they have allocations that cannot fail and they do not fit into a single page. The large part of the vmalloc implementation already complies with the given gfp flags so there is no work for those to be done. The area and page table allocations are an exception to that. Implement a retry loop for those. Add a short sleep before retrying. 1 jiffy is a completely random timeout. Ideally the retry would wait for an explicit event - e.g. a change to the vmalloc space change if the failure was caused by the space fragmentation or depletion. But there are multiple different reasons to retry and this could become much more complex. Keep the retry simple for now and just sleep to prevent from hogging CPUs. Link: https://lkml.kernel.org/r/20211122153233.9924-3-mhocko@kernel.org Signed-off-by: Michal Hocko Acked-by: Vlastimil Babka Cc: Christoph Hellwig Cc: Dave Chinner Cc: Ilya Dryomov Cc: Jeff Layton Cc: Neil Brown Cc: Sebastian Andrzej Siewior Cc: Uladzislau Rezki (Sony) Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 451769ebb7e792c3404db53b3c2a422990de654e Author: Michal Hocko Date: Fri Jan 14 14:06:57 2022 -0800 mm/vmalloc: alloc GFP_NO{FS,IO} for vmalloc Patch series "extend vmalloc support for constrained allocations", v2. Based on a recent discussion with Dave and Neil [1] I have tried to implement NOFS, NOIO, NOFAIL support for the vmalloc to make life of kvmalloc users easier. A requirement for NOFAIL support for kvmalloc was new to me but this seems to be really needed by the xfs code. NOFS/NOIO was a known and a long term problem which was hoped to be handled by the scope API. Those scope should have been used at the reclaim recursion boundaries both to document them and also to remove the necessity of NOFS/NOIO constrains for all allocations within that scope. Instead workarounds were developed to wrap a single allocation instead (like ceph_kvmalloc). First patch implements NOFS/NOIO support for vmalloc. The second one adds NOFAIL support and the third one bundles all together into kvmalloc and drops ceph_kvmalloc which can use kvmalloc directly now. [1] http://lkml.kernel.org/r/163184741778.29351.16920832234899124642.stgit@noble.brown This patch (of 4): vmalloc historically hasn't supported GFP_NO{FS,IO} requests because page table allocations do not support externally provided gfp mask and performed GFP_KERNEL like allocations. Since few years we have scope (memalloc_no{fs,io}_{save,restore}) APIs to enforce NOFS and NOIO constrains implicitly to all allocators within the scope. There was a hope that those scopes would be defined on a higher level when the reclaim recursion boundary starts/stops (e.g. when a lock required during the memory reclaim is required etc.). It seems that not all NOFS/NOIO users have adopted this approach and instead they have taken a workaround approach to wrap a single [k]vmalloc allocation by a scope API. These workarounds do not serve the purpose of a better reclaim recursion documentation and reduction of explicit GFP_NO{FS,IO} usege so let's just provide them with the semantic they are asking for without a need for workarounds. Add support for GFP_NOFS and GFP_NOIO to vmalloc directly. All internal allocations already comply with the given gfp_mask. The only current exception is vmap_pages_range which maps kernel page tables. Infer the proper scope API based on the given gfp mask. [sfr@canb.auug.org.au: mm/vmalloc.c needs linux/sched/mm.h] Link: https://lkml.kernel.org/r/20211217232641.0148710c@canb.auug.org.au Link: https://lkml.kernel.org/r/20211122153233.9924-1-mhocko@kernel.org Link: https://lkml.kernel.org/r/20211122153233.9924-2-mhocko@kernel.org Signed-off-by: Michal Hocko Signed-off-by: Stephen Rothwell Reviewed-by: Uladzislau Rezki (Sony) Acked-by: Vlastimil Babka Cc: Neil Brown Cc: Christoph Hellwig Cc: Ilya Dryomov Cc: Jeff Layton Cc: Dave Chinner Cc: Sebastian Andrzej Siewior Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit cc6266f0322fa9f7f4543564759e881d989ad866 Author: Christian König Date: Fri Jan 14 14:06:54 2022 -0800 mm/dmapool.c: revert "make dma pool to use kmalloc_node" This reverts commit 2618c60b8b5836 ("dma: make dma pool to use kmalloc_node"). While working myself into the dmapool code I've found this little odd kmalloc_node(). What basically happens here is that we allocate the housekeeping structure on the numa node where the device is attached to. Since the device is never doing DMA to or from that memory this doesn't seem to make sense at all. So while this doesn't seem to cause much harm it's probably cleaner to revert the change for consistency. Link: https://lkml.kernel.org/r/20211221110724.97664-1-christian.koenig@amd.com Signed-off-by: Christian König Cc: Yinghai Lu Cc: Andi Kleen Cc: Christoph Lameter Cc: David Rientjes Cc: Greg KH Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit d08d2b62510e2407cf939e693aefd179dc114913 Author: Matthew Wilcox (Oracle) Date: Fri Jan 14 14:06:51 2022 -0800 mm: remove the total_mapcount argument from page_trans_huge_mapcount() All callers pass NULL, so we can stop calculating the value we would store in it. Link: https://lkml.kernel.org/r/20211220205943.456187-3-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: William Kucharski Acked-by: Linus Torvalds Cc: David Hildenbrand Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 66c7f7a6ac6624fc7e226d43913e10f1f047f579 Author: Matthew Wilcox (Oracle) Date: Fri Jan 14 14:06:48 2022 -0800 mm: remove the total_mapcount argument from page_trans_huge_map_swapcount() Now that we don't report it to the caller of reuse_swap_page(), we don't need to request it from page_trans_huge_map_swapcount(). Link: https://lkml.kernel.org/r/20211220205943.456187-2-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: William Kucharski Acked-by: Linus Torvalds Cc: David Hildenbrand Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 020e87650af9f43683546729f959fdc78422a4b7 Author: Matthew Wilcox (Oracle) Date: Fri Jan 14 14:06:44 2022 -0800 mm: remove last argument of reuse_swap_page() None of the callers care about the total_map_swapcount() any more. Link: https://lkml.kernel.org/r/20211220205943.456187-1-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Linus Torvalds Reviewed-by: William Kucharski Reviewed-by: David Hildenbrand Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit d283d422c6c4f0264fe8ecf5ae80036bf73f4594 Author: Pasha Tatashin Date: Fri Jan 14 14:06:41 2022 -0800 x86: mm: add x86_64 support for page table check Add page table check hooks into routines that modify user page tables. Link: https://lkml.kernel.org/r/20211221154650.1047963-5-pasha.tatashin@soleen.com Signed-off-by: Pasha Tatashin Cc: Aneesh Kumar K.V Cc: Dave Hansen Cc: David Rientjes Cc: Frederic Weisbecker Cc: Greg Thelen Cc: "H. Peter Anvin" Cc: Hugh Dickins Cc: Ingo Molnar Cc: Jiri Slaby Cc: Jonathan Corbet Cc: Kees Cook Cc: Masahiro Yamada Cc: Mike Rapoport Cc: Muchun Song Cc: Paul Turner Cc: Peter Zijlstra Cc: Sami Tolvanen Cc: Thomas Gleixner Cc: Wei Xu Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit df4e817b710809425d899340dbfa8504a3ca4ba5 Author: Pasha Tatashin Date: Fri Jan 14 14:06:37 2022 -0800 mm: page table check Check user page table entries at the time they are added and removed. Allows to synchronously catch memory corruption issues related to double mapping. When a pte for an anonymous page is added into page table, we verify that this pte does not already point to a file backed page, and vice versa if this is a file backed page that is being added we verify that this page does not have an anonymous mapping We also enforce that read-only sharing for anonymous pages is allowed (i.e. cow after fork). All other sharing must be for file pages. Page table check allows to protect and debug cases where "struct page" metadata became corrupted for some reason. For example, when refcnt or mapcount become invalid. Link: https://lkml.kernel.org/r/20211221154650.1047963-4-pasha.tatashin@soleen.com Signed-off-by: Pasha Tatashin Cc: Aneesh Kumar K.V Cc: Dave Hansen Cc: David Rientjes Cc: Frederic Weisbecker Cc: Greg Thelen Cc: "H. Peter Anvin" Cc: Hugh Dickins Cc: Ingo Molnar Cc: Jiri Slaby Cc: Jonathan Corbet Cc: Kees Cook Cc: Masahiro Yamada Cc: Mike Rapoport Cc: Muchun Song Cc: Paul Turner Cc: Peter Zijlstra Cc: Sami Tolvanen Cc: Thomas Gleixner Cc: Wei Xu Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 08d5b29eac7dd5e6c79b66d390ecbb9219e05931 Author: Pasha Tatashin Date: Fri Jan 14 14:06:33 2022 -0800 mm: ptep_clear() page table helper We have ptep_get_and_clear() and ptep_get_and_clear_full() helpers to clear PTE from user page tables, but there is no variant for simple clear of a present PTE from user page tables without using a low level pte_clear() which can be either native or para-virtualised. Add a new ptep_clear() that can be used in common code to clear PTEs from page table. We will need this call later in order to add a hook for page table check. Link: https://lkml.kernel.org/r/20211221154650.1047963-3-pasha.tatashin@soleen.com Signed-off-by: Pasha Tatashin Cc: Aneesh Kumar K.V Cc: Dave Hansen Cc: David Rientjes Cc: Frederic Weisbecker Cc: Greg Thelen Cc: "H. Peter Anvin" Cc: Hugh Dickins Cc: Ingo Molnar Cc: Jiri Slaby Cc: Jonathan Corbet Cc: Kees Cook Cc: Masahiro Yamada Cc: Mike Rapoport Cc: Muchun Song Cc: Paul Turner Cc: Peter Zijlstra Cc: Sami Tolvanen Cc: Thomas Gleixner Cc: Wei Xu Cc: Will Deacon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 1eba86c096e35e3cc83de1ad2c26f2d70470211b Author: Pasha Tatashin Date: Fri Jan 14 14:06:29 2022 -0800 mm: change page type prior to adding page table entry Patch series "page table check", v3. Ensure that some memory corruptions are prevented by checking at the time of insertion of entries into user page tables that there is no illegal sharing. We have recently found a problem [1] that existed in kernel since 4.14. The problem was caused by broken page ref count and led to memory leaking from one process into another. The problem was accidentally detected by studying a dump of one process and noticing that one page contains memory that should not belong to this process. There are some other page->_refcount related problems that were recently fixed: [2], [3] which potentially could also lead to illegal sharing. In addition to hardening refcount [4] itself, this work is an attempt to prevent this class of memory corruption issues. It uses a simple state machine that is independent from regular MM logic to check for illegal sharing at time pages are inserted and removed from page tables. [1] https://lore.kernel.org/all/xr9335nxwc5y.fsf@gthelen2.svl.corp.google.com [2] https://lore.kernel.org/all/1582661774-30925-2-git-send-email-akaher@vmware.com [3] https://lore.kernel.org/all/20210622021423.154662-3-mike.kravetz@oracle.com [4] https://lore.kernel.org/all/20211221150140.988298-1-pasha.tatashin@soleen.com This patch (of 4): There are a few places where we first update the entry in the user page table, and later change the struct page to indicate that this is anonymous or file page. In most places, however, we first configure the page metadata and then insert entries into the page table. Page table check, will use the information from struct page to verify the type of entry is inserted. Change the order in all places to first update struct page, and later to update page table. This means that we first do calls that may change the type of page (anon or file): page_move_anon_rmap page_add_anon_rmap do_page_add_anon_rmap page_add_new_anon_rmap page_add_file_rmap hugepage_add_anon_rmap hugepage_add_new_anon_rmap And after that do calls that add entries to the page table: set_huge_pte_at set_pte_at Link: https://lkml.kernel.org/r/20211221154650.1047963-1-pasha.tatashin@soleen.com Link: https://lkml.kernel.org/r/20211221154650.1047963-2-pasha.tatashin@soleen.com Signed-off-by: Pasha Tatashin Cc: David Rientjes Cc: Paul Turner Cc: Wei Xu Cc: Greg Thelen Cc: Ingo Molnar Cc: Jonathan Corbet Cc: Will Deacon Cc: Mike Rapoport Cc: Kees Cook Cc: Thomas Gleixner Cc: Peter Zijlstra Cc: Masahiro Yamada Cc: Sami Tolvanen Cc: Dave Hansen Cc: Frederic Weisbecker Cc: "H. Peter Anvin" Cc: Aneesh Kumar K.V Cc: Jiri Slaby Cc: Muchun Song Cc: Hugh Dickins Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 4b8fec2867c85e081c1c9f800e0ec82eff71134f Author: Shuah Khan Date: Fri Jan 14 14:06:26 2022 -0800 docs/vm: add vmalloced-kernel-stacks document Add a new document to explain Virtually Mapped Kernel Stack Support. This is a compilation of information from the code and original patch series that introduced the Virtually Mapped Kernel Stacks feature. This document summarizes the feature and provides details on allocation, free, and stack overflow handling. Provides reference to available tests. Link: https://lkml.kernel.org/r/20211215002004.47981-1-skhan@linuxfoundation.org Signed-off-by: Shuah Khan Cc: Jonathan Corbet Cc: Andy Lutomirski Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ba535c1caf3ee78aa7719e9e4b07a0dc1d153b9e Author: Suren Baghdasaryan Date: Fri Jan 14 14:06:22 2022 -0800 mm/oom_kill: allow process_mrelease to run under mmap_lock protection With exit_mmap holding mmap_write_lock during free_pgtables call, process_mrelease does not need to elevate mm->mm_users in order to prevent exit_mmap from destrying pagetables while __oom_reap_task_mm is walking the VMA tree. The change prevents process_mrelease from calling the last mmput, which can lead to waiting for IO completion in exit_aio. Link: https://lkml.kernel.org/r/20211209191325.3069345-3-surenb@google.com Signed-off-by: Suren Baghdasaryan Acked-by: Michal Hocko Reviewed-by: Jason Gunthorpe Cc: Andrea Arcangeli Cc: Andy Lutomirski Cc: Christian Brauner 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: Kirill A. Shutemov Cc: Matthew Wilcox 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 cc6dcfee72509868271d42919a3c1081b6b0dc7e Author: Suren Baghdasaryan Date: Fri Jan 14 14:06:18 2022 -0800 mm: document locking restrictions for vm_operations_struct::close Add comments for vm_operations_struct::close documenting locking requirements for this callback and its callers. Link: https://lkml.kernel.org/r/20211209191325.3069345-2-surenb@google.com Signed-off-by: Suren Baghdasaryan Acked-by: Michal Hocko Cc: Andrea Arcangeli Cc: Andy Lutomirski Cc: Christian Brauner 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: Kirill A. Shutemov Cc: Matthew Wilcox Cc: Minchan Kim Cc: Oleg Nesterov Cc: Rik van Riel Cc: Roman Gushchin Cc: Shakeel Butt Cc: Tim Murray Cc: Jason Gunthorpe Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 64591e8605d6e2fba2ff38e3227645f039b8893f Author: Suren Baghdasaryan Date: Fri Jan 14 14:06:14 2022 -0800 mm: protect free_pgtables with mmap_lock write lock in exit_mmap oom-reaper and process_mrelease system call should protect against races with exit_mmap which can destroy page tables while they walk the VMA tree. oom-reaper protects from that race by setting MMF_OOM_VICTIM and by relying on exit_mmap to set MMF_OOM_SKIP before taking and releasing mmap_write_lock. process_mrelease has to elevate mm->mm_users to prevent such race. Both oom-reaper and process_mrelease hold mmap_read_lock when walking the VMA tree. The locking rules and mechanisms could be simpler if exit_mmap takes mmap_write_lock while executing destructive operations such as free_pgtables. Change exit_mmap to hold the mmap_write_lock when calling unlock_range, free_pgtables and remove_vma. Note also that because oom-reaper checks VM_LOCKED flag, unlock_range() should not be allowed to race with it. Before this patch, remove_vma used to be called with no locks held, however with fput being executed asynchronously and vm_ops->close not being allowed to hold mmap_lock (it is called from __split_vma with mmap_sem held for write), changing that should be fine. In most cases this lock should be uncontended. Previously, Kirill reported ~4% regression caused by a similar change [1]. We reran the same test and although the individual results are quite noisy, the percentiles show lower regression with 1.6% being the worst case [2]. The change allows oom-reaper and process_mrelease to execute safely under mmap_read_lock without worries that exit_mmap might destroy page tables from under them. [1] https://lore.kernel.org/all/20170725141723.ivukwhddk2voyhuc@node.shutemov.name/ [2] https://lore.kernel.org/all/CAJuCfpGC9-c9P40x7oy=jy5SphMcd0o0G_6U1-+JAziGKG6dGA@mail.gmail.com/ Link: https://lkml.kernel.org/r/20211209191325.3069345-1-surenb@google.com Signed-off-by: Suren Baghdasaryan Acked-by: Michal Hocko Cc: David Rientjes Cc: Matthew Wilcox Cc: Johannes Weiner Cc: Roman Gushchin Cc: Rik van Riel Cc: Minchan Kim Cc: Kirill A. Shutemov Cc: Andrea Arcangeli 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 Cc: Tim Murray Cc: Jason Gunthorpe Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 36090def7bad06a6346f86a7cfdbfda2d138cb64 Author: Arnd Bergmann Date: Fri Jan 14 14:06:10 2022 -0800 mm: move tlb_flush_pending inline helpers to mm_inline.h linux/mm_types.h should only define structure definitions, to make it cheap to include elsewhere. The atomic_t helper function definitions are particularly large, so it's better to move the helpers using those into the existing linux/mm_inline.h and only include that where needed. As a follow-up, we may want to go through all the indirect includes in mm_types.h and reduce them as much as possible. Link: https://lkml.kernel.org/r/20211207125710.2503446-2-arnd@kernel.org Signed-off-by: Arnd Bergmann Cc: Al Viro Cc: Stephen Rothwell Cc: Suren Baghdasaryan Cc: Colin Cross Cc: Kees Cook Cc: Peter Xu Cc: Peter Zijlstra (Intel) Cc: Yu Zhao Cc: Vlastimil Babka Cc: Matthew Wilcox (Oracle) Cc: Eric Biederman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 17fca131cee21724ee953a17c185c14e9533af5b Author: Arnd Bergmann Date: Fri Jan 14 14:06:07 2022 -0800 mm: move anon_vma declarations to linux/mm_inline.h The patch to add anonymous vma names causes a build failure in some configurations: include/linux/mm_types.h: In function 'is_same_vma_anon_name': include/linux/mm_types.h:924:37: error: implicit declaration of function 'strcmp' [-Werror=implicit-function-declaration] 924 | return name && vma_name && !strcmp(name, vma_name); | ^~~~~~ include/linux/mm_types.h:22:1: note: 'strcmp' is defined in header ''; did you forget to '#include '? This should not really be part of linux/mm_types.h in the first place, as that header is meant to only contain structure defintions and need a minimum set of indirect includes itself. While the header clearly includes more than it should at this point, let's not make it worse by including string.h as well, which would pull in the expensive (compile-speed wise) fortify-string logic. Move the new functions into a separate header that only needs to be included in a couple of locations. Link: https://lkml.kernel.org/r/20211207125710.2503446-1-arnd@kernel.org Fixes: "mm: add a field to store names for private anonymous memory" Signed-off-by: Arnd Bergmann Cc: Al Viro Cc: Colin Cross Cc: Eric Biederman Cc: Kees Cook Cc: Matthew Wilcox (Oracle) Cc: Peter Xu Cc: Peter Zijlstra (Intel) Cc: Stephen Rothwell Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: Yu Zhao Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 78db3412833dc9c479cd17412035f216cfd01a29 Author: Suren Baghdasaryan Date: Fri Jan 14 14:06:03 2022 -0800 mm: add anonymous vma name refcounting While forking a process with high number (64K) of named anonymous vmas the overhead caused by strdup() is noticeable. Experiments with ARM64 Android device show up to 40% performance regression when forking a process with 64k unpopulated anonymous vmas using the max name lengths vs the same process with the same number of anonymous vmas having no name. Introduce anon_vma_name refcounted structure to avoid the overhead of copying vma names during fork() and when splitting named anonymous vmas. When a vma is duplicated, instead of copying the name we increment the refcount of this structure. Multiple vmas can point to the same anon_vma_name as long as they increment the refcount. The name member of anon_vma_name structure is assigned at structure allocation time and is never changed. If vma name changes then the refcount of the original structure is dropped, a new anon_vma_name structure is allocated to hold the new name and the vma pointer is updated to point to the new structure. With this approach the fork() performance regressions is reduced 3-4x times and with usecases using more reasonable number of VMAs (a few thousand) the regressions is not measurable. Link: https://lkml.kernel.org/r/20211019215511.3771969-3-surenb@google.com Signed-off-by: Suren Baghdasaryan Reviewed-by: Kees Cook Cc: Al Viro Cc: Colin Cross Cc: Cyrill Gorcunov Cc: Dave Hansen Cc: David Rientjes Cc: "Eric W. Biederman" Cc: Hugh Dickins Cc: Ingo Molnar Cc: Jan Glauber Cc: Johannes Weiner Cc: John Stultz Cc: Mel Gorman Cc: Minchan Kim Cc: Oleg Nesterov Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Rob Landley Cc: "Serge E. Hallyn" Cc: Shaohua Li Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 9a10064f5625d5572c3626c1516e0bebc6c9fe9b Author: Colin Cross Date: Fri Jan 14 14:05:59 2022 -0800 mm: add a field to store names for private anonymous memory In many userspace applications, and especially in VM based applications like Android uses heavily, there are multiple different allocators in use. At a minimum there is libc malloc and the stack, and in many cases there are libc malloc, the stack, direct syscalls to mmap anonymous memory, and multiple VM heaps (one for small objects, one for big objects, etc.). Each of these layers usually has its own tools to inspect its usage; malloc by compiling a debug version, the VM through heap inspection tools, and for direct syscalls there is usually no way to track them. On Android we heavily use a set of tools that use an extended version of the logic covered in Documentation/vm/pagemap.txt to walk all pages mapped in userspace and slice their usage by process, shared (COW) vs. unique mappings, backing, etc. This can account for real physical memory usage even in cases like fork without exec (which Android uses heavily to share as many private COW pages as possible between processes), Kernel SamePage Merging, and clean zero pages. It produces a measurement of the pages that only exist in that process (USS, for unique), and a measurement of the physical memory usage of that process with the cost of shared pages being evenly split between processes that share them (PSS). If all anonymous memory is indistinguishable then figuring out the real physical memory usage (PSS) of each heap requires either a pagemap walking tool that can understand the heap debugging of every layer, or for every layer's heap debugging tools to implement the pagemap walking logic, in which case it is hard to get a consistent view of memory across the whole system. Tracking the information in userspace leads to all sorts of problems. It either needs to be stored inside the process, which means every process has to have an API to export its current heap information upon request, or it has to be stored externally in a filesystem that somebody needs to clean up on crashes. It needs to be readable while the process is still running, so it has to have some sort of synchronization with every layer of userspace. Efficiently tracking the ranges requires reimplementing something like the kernel vma trees, and linking to it from every layer of userspace. It requires more memory, more syscalls, more runtime cost, and more complexity to separately track regions that the kernel is already tracking. This patch adds a field to /proc/pid/maps and /proc/pid/smaps to show a userspace-provided name for anonymous vmas. The names of named anonymous vmas are shown in /proc/pid/maps and /proc/pid/smaps as [anon:]. Userspace can set the name for a region of memory by calling prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, start, len, (unsigned long)name) Setting the name to NULL clears it. The name length limit is 80 bytes including NUL-terminator and is checked to contain only printable ascii characters (including space), except '[',']','\','$' and '`'. Ascii strings are being used to have a descriptive identifiers for vmas, which can be understood by the users reading /proc/pid/maps or /proc/pid/smaps. Names can be standardized for a given system and they can include some variable parts such as the name of the allocator or a library, tid of the thread using it, etc. The name is stored in a pointer in the shared union in vm_area_struct that points to a null terminated string. Anonymous vmas with the same name (equivalent strings) and are otherwise mergeable will be merged. The name pointers are not shared between vmas even if they contain the same name. The name pointer is stored in a union with fields that are only used on file-backed mappings, so it does not increase memory usage. CONFIG_ANON_VMA_NAME kernel configuration is introduced to enable this feature. It keeps the feature disabled by default to prevent any additional memory overhead and to avoid confusing procfs parsers on systems which are not ready to support named anonymous vmas. The patch is based on the original patch developed by Colin Cross, more specifically on its latest version [1] posted upstream by Sumit Semwal. It used a userspace pointer to store vma names. In that design, name pointers could be shared between vmas. However during the last upstreaming attempt, Kees Cook raised concerns [2] about this approach and suggested to copy the name into kernel memory space, perform validity checks [3] and store as a string referenced from vm_area_struct. One big concern is about fork() performance which would need to strdup anonymous vma names. Dave Hansen suggested experimenting with worst-case scenario of forking a process with 64k vmas having longest possible names [4]. I ran this experiment on an ARM64 Android device and recorded a worst-case regression of almost 40% when forking such a process. This regression is addressed in the followup patch which replaces the pointer to a name with a refcounted structure that allows sharing the name pointer between vmas of the same name. Instead of duplicating the string during fork() or when splitting a vma it increments the refcount. [1] https://lore.kernel.org/linux-mm/20200901161459.11772-4-sumit.semwal@linaro.org/ [2] https://lore.kernel.org/linux-mm/202009031031.D32EF57ED@keescook/ [3] https://lore.kernel.org/linux-mm/202009031022.3834F692@keescook/ [4] https://lore.kernel.org/linux-mm/5d0358ab-8c47-2f5f-8e43-23b89d6a8e95@intel.com/ Changes for prctl(2) manual page (in the options section): PR_SET_VMA Sets an attribute specified in arg2 for virtual memory areas starting from the address specified in arg3 and spanning the size specified in arg4. arg5 specifies the value of the attribute to be set. Note that assigning an attribute to a virtual memory area might prevent it from being merged with adjacent virtual memory areas due to the difference in that attribute's value. Currently, arg2 must be one of: PR_SET_VMA_ANON_NAME Set a name for anonymous virtual memory areas. arg5 should be a pointer to a null-terminated string containing the name. The name length including null byte cannot exceed 80 bytes. If arg5 is NULL, the name of the appropriate anonymous virtual memory areas will be reset. The name can contain only printable ascii characters (including space), except '[',']','\','$' and '`'. This feature is available only if the kernel is built with the CONFIG_ANON_VMA_NAME option enabled. [surenb@google.com: docs: proc.rst: /proc/PID/maps: fix malformed table] Link: https://lkml.kernel.org/r/20211123185928.2513763-1-surenb@google.com [surenb: rebased over v5.15-rc6, replaced userpointer with a kernel copy, added input sanitization and CONFIG_ANON_VMA_NAME config. The bulk of the work here was done by Colin Cross, therefore, with his permission, keeping him as the author] Link: https://lkml.kernel.org/r/20211019215511.3771969-2-surenb@google.com Signed-off-by: Colin Cross Signed-off-by: Suren Baghdasaryan Reviewed-by: Kees Cook Cc: Stephen Rothwell Cc: Al Viro Cc: Cyrill Gorcunov Cc: Dave Hansen Cc: David Rientjes Cc: "Eric W. Biederman" Cc: Hugh Dickins Cc: Ingo Molnar Cc: Jan Glauber Cc: Johannes Weiner Cc: John Stultz Cc: Mel Gorman Cc: Minchan Kim Cc: Oleg Nesterov Cc: Pekka Enberg Cc: Peter Zijlstra Cc: Rob Landley Cc: "Serge E. Hallyn" Cc: Shaohua Li Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ac1e9acc5acf0b41d54de6a4c45471644f8b97ff Author: Colin Cross Date: Fri Jan 14 14:05:55 2022 -0800 mm: rearrange madvise code to allow for reuse Patch series "mm: rearrange madvise code to allow for reuse", v11. Avoid performance regression of the new anon vma name field refcounting it. I checked the image sizes with allnoconfig builds: unpatched Linus' ToT text data bss dec hex filename 1324759 32 73928 1398719 1557bf vmlinux After the first patch is applied (madvise refactoring) text data bss dec hex filename 1322346 32 73928 1396306 154e52 vmlinux >>> 2413 bytes decrease vs ToT <<< After all patches applied with CONFIG_ANON_VMA_NAME=n text data bss dec hex filename 1322337 32 73928 1396297 154e49 vmlinux >>> 2422 bytes decrease vs ToT <<< After all patches applied with CONFIG_ANON_VMA_NAME=y text data bss dec hex filename 1325228 32 73928 1399188 155994 vmlinux >>> 469 bytes increase vs ToT <<< This patch (of 3): Refactor the madvise syscall to allow for parts of it to be reused by a prctl syscall that affects vmas. Move the code that walks vmas in a virtual address range into a function that takes a function pointer as a parameter. The only caller for now is sys_madvise, which uses it to call madvise_vma_behavior on each vma, but the next patch will add an additional caller. Move handling all vma behaviors inside madvise_behavior, and rename it to madvise_vma_behavior. Move the code that updates the flags on a vma, including splitting or merging the vma as necessary, into a new function called madvise_update_vma. The next patch will add support for updating a new anon_name field as well. Link: https://lkml.kernel.org/r/20211019215511.3771969-1-surenb@google.com Signed-off-by: Colin Cross Signed-off-by: Suren Baghdasaryan Cc: Pekka Enberg Cc: Dave Hansen Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Oleg Nesterov Cc: "Eric W. Biederman" Cc: Jan Glauber Cc: John Stultz Cc: Rob Landley Cc: Cyrill Gorcunov Cc: Kees Cook Cc: "Serge E. Hallyn" Cc: David Rientjes Cc: Al Viro Cc: Hugh Dickins Cc: Mel Gorman Cc: Shaohua Li Cc: Johannes Weiner Cc: Minchan Kim Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 36ef159f4408b08eae7f2af6d62bedd3f4343758 Author: Qi Zheng Date: Fri Jan 14 14:05:51 2022 -0800 mm: remove redundant check about FAULT_FLAG_ALLOW_RETRY bit Since commit 4064b9827063 ("mm: allow VM_FAULT_RETRY for multiple times") allowed VM_FAULT_RETRY for multiple times, the FAULT_FLAG_ALLOW_RETRY bit of fault_flag will not be changed in the page fault path, so the following check is no longer needed: flags & FAULT_FLAG_ALLOW_RETRY So just remove it. [akpm@linux-foundation.org: coding style fixes] Link: https://lkml.kernel.org/r/20211110123358.36511-1-zhengqi.arch@bytedance.com Signed-off-by: Qi Zheng Cc: Peter Zijlstra Cc: Ingo Molnar Cc: David Hildenbrand Cc: Kirill Shutemov Cc: Peter Xu Cc: Muchun Song Cc: Chengming Zhou Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 2c769ed7137a75a8297936fb54e6ff1f56d3d0f1 Author: chiminghao Date: Fri Jan 14 14:05:48 2022 -0800 tools/testing/selftests/vm/userfaultfd.c: use swap() to make code cleaner Fix the following coccicheck REVIEW: tools/testing/selftests/vm/userfaultfd.c:1531:21-22:use swap() to make code cleaner Link: https://lkml.kernel.org/r/20211124031632.35317-1-chi.minghao@zte.com.cn Signed-off-by: chiminghao Reported-by: Zeal Robot Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 4e5aa1f4c2b489bc6f3ab5ca54747b18a847289d Author: Shakeel Butt Date: Fri Jan 14 14:05:45 2022 -0800 memcg: add per-memcg vmalloc stat The kvmalloc* allocation functions can fallback to vmalloc allocations and more often on long running machines. In addition the kernel does have __GFP_ACCOUNT kvmalloc* calls. So, often on long running machines, the memory.stat does not tell the complete picture which type of memory is charged to the memcg. So add a per-memcg vmalloc stat. [shakeelb@google.com: page_memcg() within rcu lock, per Muchun] Link: https://lkml.kernel.org/r/20211222052457.1960701-1-shakeelb@google.com [akpm@linux-foundation.org: remove cast, per Muchun] [shakeelb@google.com: remove area->page[0] checks and move to page by page accounting per Michal] Link: https://lkml.kernel.org/r/20220104222341.3972772-1-shakeelb@google.com Link: https://lkml.kernel.org/r/20211221215336.1922823-1-shakeelb@google.com Signed-off-by: Shakeel Butt Acked-by: Roman Gushchin Reviewed-by: Muchun Song Acked-by: Michal Hocko Cc: Johannes Weiner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 06b2c3b08ce134c9555d91a1cf15cd03646cc287 Author: Wang Weiyang Date: Fri Jan 14 14:05:42 2022 -0800 mm/memcg: use struct_size() helper in kzalloc() Make use of the struct_size() helper instead of an open-coded version, in order to avoid any potential type mistakes or integer overflows that, in the worst scenario, could lead to heap overflows. Link: https://github.com/KSPP/linux/issues/160 Link: https://lkml.kernel.org/r/20211216022024.127375-1-wangweiyang2@huawei.com Signed-off-by: Wang Weiyang Reviewed-by: Muchun Song Acked-by: Johannes Weiner Cc: Michal Hocko Cc: Vladimir Davydov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 5b3be698a872c490dbed524f3e2463701ab21339 Author: Shakeel Butt Date: Fri Jan 14 14:05:39 2022 -0800 memcg: better bounds on the memcg stats updates Commit 11192d9c124d ("memcg: flush stats only if updated") added tracking of memcg stats updates which is used by the readers to flush only if the updates are over a certain threshold. However each individual update can correspond to a large value change for a given stat. For example adding or removing a hugepage to an LRU changes the stat by thp_nr_pages (512 on x86_64). Treating the update related to THP as one can keep the stat off, in theory, by (thp_nr_pages * nr_cpus * CHARGE_BATCH) before flush. To handle such scenarios, this patch adds consideration of the stat update value as well instead of just the update event. In addition let the asyn flusher unconditionally flush the stats to put time limit on the stats skew and hopefully a lot less readers would need to flush. Link: https://lkml.kernel.org/r/20211118065350.697046-1-shakeelb@google.com Signed-off-by: Shakeel Butt Cc: Johannes Weiner Cc: Michal Hocko Cc: "Michal Koutný" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b6bf9abb0aa44e53ffe9c1e6e1d32568f5b25e4a Author: Dan Schatzberg Date: Fri Jan 14 14:05:35 2022 -0800 mm/memcg: add oom_group_kill memory event Our container agent wants to know when a container exits if it was OOM killed or not to report to the user. We use memory.oom.group = 1 to ensure that OOM kills within the container's cgroup kill everything. Existing memory.events are insufficient for knowing if this triggered: 1) Our current approach reads memory.events oom_kill and reports the container was killed if the value is non-zero. This is erroneous in some cases where containers create their children cgroups with memory.oom.group=1 as such OOM kills will get counted against the container cgroup's oom_kill counter despite not actually OOM killing the entire container. 2) Reading memory.events.local will fail to identify OOM kills in leaf cgroups (that don't set memory.oom.group) within the container cgroup. This patch adds a new oom_group_kill event when memory.oom.group triggers to allow userspace to cleanly identify when an entire cgroup is oom killed. [schatzberg.dan@gmail.com: changes from Johannes and Chris] Link: https://lkml.kernel.org/r/20211213162511.2492267-1-schatzberg.dan@gmail.com Link: https://lkml.kernel.org/r/20211203162426.3375036-1-schatzberg.dan@gmail.com Signed-off-by: Dan Schatzberg Reviewed-by: Roman Gushchin Acked-by: Johannes Weiner Acked-by: Chris Down Reviewed-by: Shakeel Butt Acked-by: Michal Hocko Cc: Tejun Heo Cc: Zefan Li Cc: Jonathan Corbet Cc: Vladimir Davydov Cc: Matthew Wilcox (Oracle) Cc: Muchun Song Cc: Alex Shi Cc: Wei Yang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 46a53371f3fd9bf873fdd9c4df75b1cd86df1098 Author: Donghai Qiao Date: Fri Jan 14 14:05:32 2022 -0800 mm/page_counter: remove an incorrect call to propagate_protected_usage() propagate_protected_usage() is called to propagate the usage change in the page_counter structure. But there is a call to this function from page_counter_try_charge() when there is actually no usage change. Hence this call should be removed. Link: https://lkml.kernel.org/r/20211118181125.3918222-1-dqiao@redhat.com Signed-off-by: Donghai Qiao Reviewed-by: Roman Gushchin Cc: Michal Hocko Cc: Johannes Weiner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 17c17367758059930246dde937cc7da9b8f3549e Author: Muchun Song Date: Fri Jan 14 14:05:29 2022 -0800 mm: memcontrol: make cgroup_memory_nokmem static Commit 494c1dfe855e ("mm: memcg/slab: create a new set of kmalloc-cg- caches") makes cgroup_memory_nokmem global, however, it is unnecessary because there is already a function mem_cgroup_kmem_disabled() which exports it. Just make it static and replace it with mem_cgroup_kmem_disabled() in mm/slab_common.c. Link: https://lkml.kernel.org/r/20211109065418.21693-1-songmuchun@bytedance.com Signed-off-by: Muchun Song Acked-by: Chris Down Acked-by: Vlastimil Babka Cc: Johannes Weiner Cc: Michal Hocko Cc: Vladimir Davydov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3795f46b83c66a2e4545460dec74c80b839faafe Author: Christophe JAILLET Date: Fri Jan 14 14:05:26 2022 -0800 mm/frontswap.c: use non-atomic '__set_bit()' when possible The 'a' and 'b' bitmaps are local to this function, so no concurrent access can occur. So the non-atomic '__set_bit()' can be used to save a few cycles. Link: https://lkml.kernel.org/r/e52476da5cee57151745c5c3c934a69798dc6fa4.1638132190.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 62c9827cbb996c2c04f615ecd783ce28bcea894b Author: Gang Li Date: Fri Jan 14 14:05:23 2022 -0800 shmem: fix a race between shmem_unused_huge_shrink and shmem_evict_inode Fix a data race in commit 779750d20b93 ("shmem: split huge pages beyond i_size under memory pressure"). Here are call traces causing race: Call Trace 1: shmem_unused_huge_shrink+0x3ae/0x410 ? __list_lru_walk_one.isra.5+0x33/0x160 super_cache_scan+0x17c/0x190 shrink_slab.part.55+0x1ef/0x3f0 shrink_node+0x10e/0x330 kswapd+0x380/0x740 kthread+0xfc/0x130 ? mem_cgroup_shrink_node+0x170/0x170 ? kthread_create_on_node+0x70/0x70 ret_from_fork+0x1f/0x30 Call Trace 2: shmem_evict_inode+0xd8/0x190 evict+0xbe/0x1c0 do_unlinkat+0x137/0x330 do_syscall_64+0x76/0x120 entry_SYSCALL_64_after_hwframe+0x3d/0xa2 A simple explanation: Image there are 3 items in the local list (@list). In the first traversal, A is not deleted from @list. 1) A->B->C ^ | pos (leave) In the second traversal, B is deleted from @list. Concurrently, A is deleted from @list through shmem_evict_inode() since last reference counter of inode is dropped by other thread. Then the @list is corrupted. 2) A->B->C ^ ^ | | evict pos (drop) We should make sure the inode is either on the global list or deleted from any local list before iput(). Fixed by moving inodes back to global list before we put them. [akpm@linux-foundation.org: coding style fixes] Link: https://lkml.kernel.org/r/20211125064502.99983-1-ligang.bdlg@bytedance.com Fixes: 779750d20b93 ("shmem: split huge pages beyond i_size under memory pressure") Signed-off-by: Gang Li Reviewed-by: Muchun Song Acked-by: Kirill A. Shutemov Cc: Hugh Dickins Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a7605426666196c5a460dd3de6f8dac1d3c21f00 Author: Yang Shi Date: Fri Jan 14 14:05:19 2022 -0800 mm: shmem: don't truncate page if memory failure happens The current behavior of memory failure is to truncate the page cache regardless of dirty or clean. If the page is dirty the later access will get the obsolete data from disk without any notification to the users. This may cause silent data loss. It is even worse for shmem since shmem is in-memory filesystem, truncating page cache means discarding data blocks. The later read would return all zero. The right approach is to keep the corrupted page in page cache, any later access would return error for syscalls or SIGBUS for page fault, until the file is truncated, hole punched or removed. The regular storage backed filesystems would be more complicated so this patch is focused on shmem. This also unblock the support for soft offlining shmem THP. [akpm@linux-foundation.org: coding style fixes] [arnd@arndb.de: fix uninitialized variable use in me_pagecache_clean()] Link: https://lkml.kernel.org/r/20211022064748.4173718-1-arnd@kernel.org [Fix invalid pointer dereference in shmem_read_mapping_page_gfp() with a slight different implementation from what Ajay Garg and Muchun Song proposed and reworked the error handling of shmem_write_begin() suggested by Linus] Link: https://lore.kernel.org/linux-mm/20211111084617.6746-1-ajaygargnsit@gmail.com/ Link: https://lkml.kernel.org/r/20211020210755.23964-6-shy828301@gmail.com Link: https://lkml.kernel.org/r/20211116193247.21102-1-shy828301@gmail.com Signed-off-by: Yang Shi Signed-off-by: Arnd Bergmann Cc: Hugh Dickins Cc: Kirill A. Shutemov Cc: Matthew Wilcox Cc: Naoya Horiguchi Cc: Oscar Salvador Cc: Peter Xu Cc: Ajay Garg Cc: Muchun Song Cc: Andy Lavr Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 28b0ee3fb35047bd2bac57cc5a051b26bbd9b194 Author: Li Xinhai Date: Fri Jan 14 14:05:16 2022 -0800 mm/gup.c: stricter check on THP migration entry during follow_pmd_mask When BUG_ON check for THP migration entry, the existing code only check thp_migration_supported case, but not for !thp_migration_supported case. If !thp_migration_supported() and !pmd_present(), the original code may dead loop in theory. To make the BUG_ON check consistent, we need catch both cases. Move the BUG_ON check one step earlier, because if the bug happen we should know it instead of depend on FOLL_MIGRATION been used by caller. Because pmdval instead of *pmd is read by the is_pmd_migration_entry() check, the existing code don't help to avoid useless locking within pmd_migration_entry_wait(), so remove that check. Link: https://lkml.kernel.org/r/20211217062559.737063-1-lixinhai.lxh@gmail.com Signed-off-by: Li Xinhai Reviewed-by: "Huang, Ying" Reviewed-by: Miaohe Lin Cc: Zi Yan Cc: "Kirill A. Shutemov" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 677b2a8c1f25db5b09c1ef5bf72faa39ea81d9cf Author: Christophe Leroy Date: Fri Jan 14 14:05:13 2022 -0800 gup: avoid multiple user access locking/unlocking in fault_in_{read/write}able fault_in_readable() and fault_in_writeable() perform __get_user() and __put_user() in a loop, implying multiple user access locking/unlocking. To avoid that, use user access blocks. Link: https://lkml.kernel.org/r/720dcf79314acca1a78fae56d478cc851952149d.1637084492.git.christophe.leroy@csgroup.eu Signed-off-by: Christophe Leroy Reviewed-by: Andreas Gruenbacher Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 43b93121056c524e2af77d561900ea856d32029c Author: chiminghao Date: Fri Jan 14 14:05:10 2022 -0800 mm/truncate.c: remove unneeded variable Return value directly instead of taking this in another redundant variable. Link: https://lkml.kernel.org/r/20211207083222.401594-1-chi.minghao@zte.com.cn Signed-off-by: chiminghao Reported-by: Zeal Robot Reviewed-by: David Hildenbrand Reviewed-by: Pankaj Gupta Reviewed-by: Muchun Song Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 236476180c0f5d308fb313d5570d0b067307884c Author: Anshuman Khandual Date: Fri Jan 14 14:05:07 2022 -0800 mm/debug_vm_pgtable: update comments regarding migration swap entries Commit 4dd845b5a3e5 ("mm/swapops: rework swap entry manipulation code") had changed migtation entry related helpers. Just update debug_vm_pgatble() synced documentation to reflect those changes. Link: https://lkml.kernel.org/r/1641880417-24848-1-git-send-email-anshuman.khandual@arm.com Signed-off-by: Anshuman Khandual Cc: Jonathan Corbet Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3e9d80a891df3b1a5d77db47fa7fdf33ba71e5cb Author: Matthew Wilcox (Oracle) Date: Fri Jan 14 14:05:04 2022 -0800 mm,fs: split dump_mapping() out from dump_page() dump_mapping() is a big chunk of dump_page(), and it'd be handy to be able to call it when we don't have a struct page. Split it out and move it to fs/inode.c. Take the opportunity to simplify some of the debug messages a little. Link: https://lkml.kernel.org/r/20211121121056.2870061-1-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: William Kucharski Acked-by: Michal Hocko Cc: Vlastimil Babka Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 26dca996ea7b1ac7008b6b6063fc88b849e3ac3e Author: Andrey Konovalov Date: Fri Jan 14 14:05:01 2022 -0800 kasan: fix quarantine conflicting with init_on_free KASAN's quarantine might save its metadata inside freed objects. As this happens after the memory is zeroed by the slab allocator when init_on_free is enabled, the memory coming out of quarantine is not properly zeroed. This causes lib/test_meminit.c tests to fail with Generic KASAN. Zero the metadata when the object is removed from quarantine. Link: https://lkml.kernel.org/r/2805da5df4b57138fdacd671f5d227d58950ba54.1640037083.git.andreyknvl@google.com Fixes: 6471384af2a6 ("mm: security: introduce init_on_alloc=1 and init_on_free=1 boot options") Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver Cc: Alexander Potapenko Cc: Andrey Konovalov Cc: Dmitry Vyukov Cc: Andrey Ryabinin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit f98f966cd75002a71caec1b6d209da5762c0efac Author: Marco Elver Date: Fri Jan 14 14:04:57 2022 -0800 kasan: test: add test case for double-kmem_cache_destroy() Add a test case for double-kmem_cache_destroy() detection. Link: https://lkml.kernel.org/r/20211119142219.1519617-2-elver@google.com Signed-off-by: Marco Elver Reviewed-by: Andrey Konovalov Cc: Andrey Ryabinin Cc: Alexander Potapenko Cc: Dmitry Vyukov Cc: Christoph Lameter Cc: Pekka Enberg Cc: David Rientjes Cc: Joonsoo Kim Cc: Vlastimil Babka Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit bed0a9b591492bb285ea88cd221e0412031396ca Author: Marco Elver Date: Fri Jan 14 14:04:54 2022 -0800 kasan: add ability to detect double-kmem_cache_destroy() Because mm/slab_common.c is not instrumented with software KASAN modes, it is not possible to detect use-after-free of the kmem_cache passed into kmem_cache_destroy(). In particular, because of the s->refcount-- and subsequent early return if non-zero, KASAN would never be able to see the double-free via kmem_cache_free(kmem_cache, s). To be able to detect a double-kmem_cache_destroy(), check accessibility of the kmem_cache, and in case of failure return early. While KASAN_HW_TAGS is able to detect such bugs, by checking accessibility and returning early we fail more gracefully and also avoid corrupting reused objects (where tags mismatch). A recent case of a double-kmem_cache_destroy() was detected by KFENCE: https://lkml.kernel.org/r/0000000000003f654905c168b09d@google.com, which was not detectable by software KASAN modes. Link: https://lkml.kernel.org/r/20211119142219.1519617-1-elver@google.com Signed-off-by: Marco Elver Acked-by: Vlastimil Babka Reviewed-by: Andrey Konovalov Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Christoph Lameter Cc: David Rientjes Cc: Dmitry Vyukov Cc: Joonsoo Kim Cc: Pekka Enberg Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e5f4728767d2ec9e3eb122c74e224242d21ee650 Author: Marco Elver Date: Fri Jan 14 14:04:51 2022 -0800 kasan: test: add globals left-out-of-bounds test Add a test checking that KASAN generic can also detect out-of-bounds accesses to the left of globals. Unfortunately it seems that GCC doesn't catch this (tested GCC 10, 11). The main difference between GCC's globals redzoning and Clang's is that GCC relies on using increased alignment to producing padding, where Clang's redzoning implementation actually adds real data after the global and doesn't rely on alignment to produce padding. I believe this is the main reason why GCC can't reliably catch globals out-of-bounds in this case. Given this is now a known issue, to avoid failing the whole test suite, skip this test case with GCC. Link: https://lkml.kernel.org/r/20211117130714.135656-1-elver@google.com Signed-off-by: Marco Elver Reported-by: Kaiwan N Billimoria Reviewed-by: Andrey Konovalov Cc: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Kaiwan N Billimoria Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 14606001efb48a17be31a5bec626c13ca49d783a Author: Joao Martins Date: Fri Jan 14 14:04:47 2022 -0800 device-dax: compound devmap support Use the newly added compound devmap facility which maps the assigned dax ranges as compound pages at a page size of @align. dax devices are created with a fixed @align (huge page size) which is enforced through as well at mmap() of the device. Faults, consequently happen too at the specified @align specified at the creation, and those don't change throughout dax device lifetime. MCEs unmap a whole dax huge page, as well as splits occurring at the configured page size. Performance measured by gup_test improves considerably for unpin_user_pages() and altmap with NVDIMMs: $ gup_test -f /dev/dax1.0 -m 16384 -r 10 -S -a -n 512 -w (pin_user_pages_fast 2M pages) put:~71 ms -> put:~22 ms [altmap] (pin_user_pages_fast 2M pages) get:~524ms put:~525 ms -> get: ~127ms put:~71ms $ gup_test -f /dev/dax1.0 -m 129022 -r 10 -S -a -n 512 -w (pin_user_pages_fast 2M pages) put:~513 ms -> put:~188 ms [altmap with -m 127004] (pin_user_pages_fast 2M pages) get:~4.1 secs put:~4.12 secs -> get:~1sec put:~563ms .. as well as unpin_user_page_range_dirty_lock() being just as effective as THP/hugetlb[0] pages. [0] https://lore.kernel.org/linux-mm/20210212130843.13865-5-joao.m.martins@oracle.com/ Link: https://lkml.kernel.org/r/20211202204422.26777-12-joao.m.martins@oracle.com Signed-off-by: Joao Martins Reviewed-by: Dan Williams Cc: Christoph Hellwig Cc: Dave Jiang Cc: Jane Chu Cc: Jason Gunthorpe Cc: Jason Gunthorpe Cc: John Hubbard Cc: Jonathan Corbet Cc: Matthew Wilcox (Oracle) Cc: Mike Kravetz Cc: Muchun Song Cc: Naoya Horiguchi Cc: Vishal Verma Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 6ec228b6fef5ad3a1f19e76c29640a9161415240 Author: Joao Martins Date: Fri Jan 14 14:04:43 2022 -0800 device-dax: remove pfn from __dev_dax_{pte,pmd,pud}_fault() After moving the page mapping to be set prior to pte insertion, the pfn in dev_dax_huge_fault() no longer is necessary. Remove it, as well as the @pfn argument passed to the internal fault handler helpers. [akpm@linux-foundation.org: fix CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD=n build] Link: https://lkml.kernel.org/r/20211202204422.26777-11-joao.m.martins@oracle.com Signed-off-by: Joao Martins Suggested-by: Christoph Hellwig Cc: Dan Williams Cc: Dave Jiang Cc: Jane Chu Cc: Jason Gunthorpe Cc: Jason Gunthorpe Cc: John Hubbard Cc: Jonathan Corbet Cc: Matthew Wilcox (Oracle) Cc: Mike Kravetz Cc: Muchun Song Cc: Naoya Horiguchi Cc: Vishal Verma Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 0e7325f03f09802d1667b8860e10fe39c25bf14c Author: Joao Martins Date: Fri Jan 14 14:04:40 2022 -0800 device-dax: set mapping prior to vmf_insert_pfn{,_pmd,pud}() Normally, the @page mapping is set prior to inserting the page into a page table entry. Make device-dax adhere to the same ordering, rather than setting mapping after the PTE is inserted. The address_space never changes and it is always associated with the same inode and underlying pages. So, the page mapping is set once but cleared when the struct pages are removed/freed (i.e. after {devm_}memunmap_pages()). Link: https://lkml.kernel.org/r/20211202204422.26777-10-joao.m.martins@oracle.com Suggested-by: Jason Gunthorpe Signed-off-by: Joao Martins Cc: Christoph Hellwig Cc: Dan Williams Cc: Dave Jiang Cc: Jane Chu Cc: Jason Gunthorpe Cc: John Hubbard Cc: Jonathan Corbet Cc: Matthew Wilcox (Oracle) Cc: Mike Kravetz Cc: Muchun Song Cc: Naoya Horiguchi Cc: Vishal Verma Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a0fb038e50d72f8e60731dc48fb83a3a141b822e Author: Joao Martins Date: Fri Jan 14 14:04:36 2022 -0800 device-dax: factor out page mapping initialization Move initialization of page->mapping into a separate helper. This is in preparation to move the mapping set to be prior to inserting the page table entry and also for tidying up compound page handling into one helper. Link: https://lkml.kernel.org/r/20211202204422.26777-9-joao.m.martins@oracle.com Signed-off-by: Joao Martins Cc: Christoph Hellwig Cc: Dan Williams Cc: Dave Jiang Cc: Jane Chu Cc: Jason Gunthorpe Cc: Jason Gunthorpe Cc: John Hubbard Cc: Jonathan Corbet Cc: Matthew Wilcox (Oracle) Cc: Mike Kravetz Cc: Muchun Song Cc: Naoya Horiguchi Cc: Vishal Verma Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit fc65c4eb0b2a27c30d35636650e3f4ddb07506cd Author: Joao Martins Date: Fri Jan 14 14:04:33 2022 -0800 device-dax: ensure dev_dax->pgmap is valid for dynamic devices Right now, only static dax regions have a valid @pgmap pointer in its struct dev_dax. Dynamic dax case however, do not. In preparation for device-dax compound devmap support, make sure that dev_dax pgmap field is set after it has been allocated and initialized. dynamic dax device have the @pgmap is allocated at probe() and it's managed by devm (contrast to static dax region which a pgmap is provided and dax core kfrees it). So in addition to ensure a valid @pgmap, clear the pgmap when the dynamic dax device is released to avoid the same pgmap ranges to be re-requested across multiple region device reconfigs. Add a static_dev_dax() and use that helper in dev_dax_probe() to ensure the initialization differences between dynamic and static regions are more explicit. While at it, consolidate the ranges initialization when we allocate the @pgmap for the dynamic dax region case. Also take the opportunity to document the differences between static and dynamic da regions. Link: https://lkml.kernel.org/r/20211202204422.26777-8-joao.m.martins@oracle.com Suggested-by: Dan Williams Signed-off-by: Joao Martins Cc: Christoph Hellwig Cc: Dave Jiang Cc: Jane Chu Cc: Jason Gunthorpe Cc: Jason Gunthorpe Cc: John Hubbard Cc: Jonathan Corbet Cc: Matthew Wilcox (Oracle) Cc: Mike Kravetz Cc: Muchun Song Cc: Naoya Horiguchi Cc: Vishal Verma Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 09b80137033dbc5f1d197e99116527c0f8d253f2 Author: Joao Martins Date: Fri Jan 14 14:04:29 2022 -0800 device-dax: use struct_size() Use the struct_size() helper for the size of a struct with variable array member at the end, rather than manually calculating it. Link: https://lkml.kernel.org/r/20211202204422.26777-7-joao.m.martins@oracle.com Suggested-by: Dan Williams Signed-off-by: Joao Martins Cc: Christoph Hellwig Cc: Dave Jiang Cc: Jane Chu Cc: Jason Gunthorpe Cc: Jason Gunthorpe Cc: John Hubbard Cc: Jonathan Corbet Cc: Matthew Wilcox (Oracle) Cc: Mike Kravetz Cc: Muchun Song Cc: Naoya Horiguchi Cc: Vishal Verma Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b9b5777f09be84d0de472ded2253d2f5101427f2 Author: Joao Martins Date: Fri Jan 14 14:04:26 2022 -0800 device-dax: use ALIGN() for determining pgoff Rather than calculating @pgoff manually, switch to ALIGN() instead. Link: https://lkml.kernel.org/r/20211202204422.26777-6-joao.m.martins@oracle.com Suggested-by: Dan Williams Signed-off-by: Joao Martins Reviewed-by: Dan Williams Cc: Christoph Hellwig Cc: Dave Jiang Cc: Jane Chu Cc: Jason Gunthorpe Cc: Jason Gunthorpe Cc: John Hubbard Cc: Jonathan Corbet Cc: Matthew Wilcox (Oracle) Cc: Mike Kravetz Cc: Muchun Song Cc: Naoya Horiguchi Cc: Vishal Verma Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c4386bd8ee3a921c3c799b7197dc898ade76a453 Author: Joao Martins Date: Fri Jan 14 14:04:22 2022 -0800 mm/memremap: add ZONE_DEVICE support for compound pages Add a new @vmemmap_shift property for struct dev_pagemap which specifies that a devmap is composed of a set of compound pages of order @vmemmap_shift, instead of base pages. When a compound page devmap is requested, all but the first page are initialised as tail pages instead of order-0 pages. For certain ZONE_DEVICE users like device-dax which have a fixed page size, this creates an opportunity to optimize GUP and GUP-fast walkers, treating it the same way as THP or hugetlb pages. Additionally, commit 7118fc2906e2 ("hugetlb: address ref count racing in prep_compound_gigantic_page") removed set_page_count() because the setting of page ref count to zero was redundant. devmap pages don't come from page allocator though and only head page refcount is used for compound pages, hence initialize tail page count to zero. Link: https://lkml.kernel.org/r/20211202204422.26777-5-joao.m.martins@oracle.com Signed-off-by: Joao Martins Reviewed-by: Dan Williams Cc: Christoph Hellwig Cc: Dave Jiang Cc: Jane Chu Cc: Jason Gunthorpe Cc: Jason Gunthorpe Cc: John Hubbard Cc: Jonathan Corbet Cc: Matthew Wilcox (Oracle) Cc: Mike Kravetz Cc: Muchun Song Cc: Naoya Horiguchi Cc: Vishal Verma Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 46487e0095f895c25da9feae27dc06d2aa76793d Author: Joao Martins Date: Fri Jan 14 14:04:18 2022 -0800 mm/page_alloc: refactor memmap_init_zone_device() page init Move struct page init to an helper function __init_zone_device_page(). This is in preparation for sharing the storage for compound page metadata. Link: https://lkml.kernel.org/r/20211202204422.26777-4-joao.m.martins@oracle.com Signed-off-by: Joao Martins Reviewed-by: Dan Williams Cc: Christoph Hellwig Cc: Dave Jiang Cc: Jane Chu Cc: Jason Gunthorpe Cc: Jason Gunthorpe Cc: John Hubbard Cc: Jonathan Corbet Cc: Matthew Wilcox (Oracle) Cc: Mike Kravetz Cc: Muchun Song Cc: Naoya Horiguchi Cc: Vishal Verma Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 5b24eeef06701cca6852f1bf768248ccc912819b Author: Joao Martins Date: Fri Jan 14 14:04:15 2022 -0800 mm/page_alloc: split prep_compound_page into head and tail subparts Patch series "mm, device-dax: Introduce compound pages in devmap", v7. This series converts device-dax to use compound pages, and moves away from the 'struct page per basepage on PMD/PUD' that is done today. Doing so 1) unlocks a few noticeable improvements on unpin_user_pages() and makes device-dax+altmap case 4x times faster in pinning (numbers below and in last patch) 2) as mentioned in various other threads it's one important step towards cleaning up ZONE_DEVICE refcounting. I've split the compound pages on devmap part from the rest based on recent discussions on devmap pending and future work planned[5][6]. There is consensus that device-dax should be using compound pages to represent its PMD/PUDs just like HugeTLB and THP, and that leads to less specialization of the dax parts. I will pursue the rest of the work in parallel once this part is merged, particular the GUP-{slow,fast} improvements [7] and the tail struct page deduplication memory savings part[8]. To summarize what the series does: Patch 1: Prepare hwpoisoning to work with dax compound pages. Patches 2-3: Split the current utility function of prep_compound_page() into head and tail and use those two helpers where appropriate to take advantage of caches being warm after __init_single_page(). This is used when initializing zone device when we bring up device-dax namespaces. Patches 4-10: Add devmap support for compound pages in device-dax. memmap_init_zone_device() initialize its metadata as compound pages, and it introduces a new devmap property known as vmemmap_shift which outlines how the vmemmap is structured (defaults to base pages as done today). The property describe the page order of the metadata essentially. While at it do a few cleanups in device-dax in patches 5-9. Finally enable device-dax usage of devmap @vmemmap_shift to a value based on its own @align property. @vmemmap_shift returns 0 by default (which is today's case of base pages in devmap, like fsdax or the others) and the usage of compound devmap is optional. Starting with device-dax (*not* fsdax) we enable it by default. There are a few pinning improvements particular on the unpinning case and altmap, as well as unpin_user_page_range_dirty_lock() being just as effective as THP/hugetlb[0] pages. $ gup_test -f /dev/dax1.0 -m 16384 -r 10 -S -a -n 512 -w (pin_user_pages_fast 2M pages) put:~71 ms -> put:~22 ms [altmap] (pin_user_pages_fast 2M pages) get:~524ms put:~525 ms -> get: ~127ms put:~71ms $ gup_test -f /dev/dax1.0 -m 129022 -r 10 -S -a -n 512 -w (pin_user_pages_fast 2M pages) put:~513 ms -> put:~188 ms [altmap with -m 127004] (pin_user_pages_fast 2M pages) get:~4.1 secs put:~4.12 secs -> get:~1sec put:~563ms Tested on x86 with 1Tb+ of pmem (alongside registering it with RDMA with and without altmap), alongside gup_test selftests with dynamic dax regions and static dax regions. Coupled with ndctl unit tests for dynamic dax devices that exercise all of this. Note, for dynamic dax regions I had to revert commit 8aa83e6395 ("x86/setup: Call early_reserve_memory() earlier"), it is a known issue that this commit broke efi_fake_mem=. This patch (of 11): Split the utility function prep_compound_page() into head and tail counterparts, and use them accordingly. This is in preparation for sharing the storage for compound page metadata. Link: https://lkml.kernel.org/r/20211202204422.26777-1-joao.m.martins@oracle.com Link: https://lkml.kernel.org/r/20211202204422.26777-3-joao.m.martins@oracle.com Signed-off-by: Joao Martins Acked-by: Mike Kravetz Reviewed-by: Dan Williams Reviewed-by: Muchun Song Cc: Vishal Verma Cc: Dave Jiang Cc: Naoya Horiguchi Cc: Matthew Wilcox (Oracle) Cc: Jason Gunthorpe Cc: John Hubbard Cc: Jane Chu Cc: Jonathan Corbet Cc: Christoph Hellwig Cc: Jason Gunthorpe Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 60115fa54ad7b913b7cb5844e6b7ffeb842d55f2 Author: Kefeng Wang Date: Fri Jan 14 14:04:11 2022 -0800 mm: defer kmemleak object creation of module_alloc() Yongqiang reports a kmemleak panic when module insmod/rmmod with KASAN enabled(without KASAN_VMALLOC) on x86[1]. When the module area allocates memory, it's kmemleak_object is created successfully, but the KASAN shadow memory of module allocation is not ready, so when kmemleak scan the module's pointer, it will panic due to no shadow memory with KASAN check. module_alloc __vmalloc_node_range kmemleak_vmalloc kmemleak_scan update_checksum kasan_module_alloc kmemleak_ignore Note, there is no problem if KASAN_VMALLOC enabled, the modules area entire shadow memory is preallocated. Thus, the bug only exits on ARCH which supports dynamic allocation of module area per module load, for now, only x86/arm64/s390 are involved. Add a VM_DEFER_KMEMLEAK flags, defer vmalloc'ed object register of kmemleak in module_alloc() to fix this issue. [1] https://lore.kernel.org/all/6d41e2b9-4692-5ec4-b1cd-cbe29ae89739@huawei.com/ [wangkefeng.wang@huawei.com: fix build] Link: https://lkml.kernel.org/r/20211125080307.27225-1-wangkefeng.wang@huawei.com [akpm@linux-foundation.org: simplify ifdefs, per Andrey] Link: https://lkml.kernel.org/r/CA+fCnZcnwJHUQq34VuRxpdoY6_XbJCDJ-jopksS5Eia4PijPzw@mail.gmail.com Link: https://lkml.kernel.org/r/20211124142034.192078-1-wangkefeng.wang@huawei.com Fixes: 793213a82de4 ("s390/kasan: dynamic shadow mem allocation for modules") Fixes: 39d114ddc682 ("arm64: add KASAN support") Fixes: bebf56a1b176 ("kasan: enable instrumentation of global variables") Signed-off-by: Kefeng Wang Reported-by: Yongqiang Liu Cc: Andrey Konovalov Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Catalin Marinas Cc: Will Deacon Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Christian Borntraeger Cc: Alexander Gordeev Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: Alexander Potapenko Cc: Kefeng Wang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 972fa3a7c17c9d60212e32ecc0205dc585b1e769 Author: Calvin Zhang Date: Fri Jan 14 14:04:08 2022 -0800 mm: kmemleak: alloc gray object for reserved region with direct map Reserved regions with direct mapping may contain references to other regions. CMA region with fixed location is reserved without creating kmemleak_object for it. So add them as gray kmemleak objects. Link: https://lkml.kernel.org/r/20211123090641.3654006-1-calvinzhang.cool@gmail.com Signed-off-by: Calvin Zhang Cc: Rob Herring Cc: Frank Rowand Cc: Catalin Marinas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ad1a3e15fcd3b8ba0f5f60f6a2fe3938274fdf65 Author: Kuan-Ying Lee Date: Fri Jan 14 14:04:04 2022 -0800 kmemleak: fix kmemleak false positive report with HW tag-based kasan enable With HW tag-based kasan enable, We will get the warning when we free object whose address starts with 0xFF. It is because kmemleak rbtree stores tagged object and this freeing object's tag does not match with rbtree object. In the example below, kmemleak rbtree stores the tagged object in the kmalloc(), and kfree() gets the pointer with 0xFF tag. Call sequence: ptr = kmalloc(size, GFP_KERNEL); page = virt_to_page(ptr); offset = offset_in_page(ptr); kfree(page_address(page) + offset); ptr = kmalloc(size, GFP_KERNEL); A sequence like that may cause the warning as following: 1) Freeing unknown object: In kfree(), we will get free unknown object warning in kmemleak_free(). Because object(0xFx) in kmemleak rbtree and pointer(0xFF) in kfree() have different tag. 2) Overlap existing: When we allocate that object with the same hw-tag again, we will find the overlap in the kmemleak rbtree and kmemleak thread will be killed. kmemleak: Freeing unknown object at 0xffff000003f88000 CPU: 5 PID: 177 Comm: cat Not tainted 5.16.0-rc1-dirty #21 Hardware name: linux,dummy-virt (DT) Call trace: dump_backtrace+0x0/0x1ac show_stack+0x1c/0x30 dump_stack_lvl+0x68/0x84 dump_stack+0x1c/0x38 kmemleak_free+0x6c/0x70 slab_free_freelist_hook+0x104/0x200 kmem_cache_free+0xa8/0x3d4 test_version_show+0x270/0x3a0 module_attr_show+0x28/0x40 sysfs_kf_seq_show+0xb0/0x130 kernfs_seq_show+0x30/0x40 seq_read_iter+0x1bc/0x4b0 seq_read_iter+0x1bc/0x4b0 kernfs_fop_read_iter+0x144/0x1c0 generic_file_splice_read+0xd0/0x184 do_splice_to+0x90/0xe0 splice_direct_to_actor+0xb8/0x250 do_splice_direct+0x88/0xd4 do_sendfile+0x2b0/0x344 __arm64_sys_sendfile64+0x164/0x16c invoke_syscall+0x48/0x114 el0_svc_common.constprop.0+0x44/0xec do_el0_svc+0x74/0x90 el0_svc+0x20/0x80 el0t_64_sync_handler+0x1a8/0x1b0 el0t_64_sync+0x1ac/0x1b0 ... kmemleak: Cannot insert 0xf2ff000003f88000 into the object search tree (overlaps existing) CPU: 5 PID: 178 Comm: cat Not tainted 5.16.0-rc1-dirty #21 Hardware name: linux,dummy-virt (DT) Call trace: dump_backtrace+0x0/0x1ac show_stack+0x1c/0x30 dump_stack_lvl+0x68/0x84 dump_stack+0x1c/0x38 create_object.isra.0+0x2d8/0x2fc kmemleak_alloc+0x34/0x40 kmem_cache_alloc+0x23c/0x2f0 test_version_show+0x1fc/0x3a0 module_attr_show+0x28/0x40 sysfs_kf_seq_show+0xb0/0x130 kernfs_seq_show+0x30/0x40 seq_read_iter+0x1bc/0x4b0 kernfs_fop_read_iter+0x144/0x1c0 generic_file_splice_read+0xd0/0x184 do_splice_to+0x90/0xe0 splice_direct_to_actor+0xb8/0x250 do_splice_direct+0x88/0xd4 do_sendfile+0x2b0/0x344 __arm64_sys_sendfile64+0x164/0x16c invoke_syscall+0x48/0x114 el0_svc_common.constprop.0+0x44/0xec do_el0_svc+0x74/0x90 el0_svc+0x20/0x80 el0t_64_sync_handler+0x1a8/0x1b0 el0t_64_sync+0x1ac/0x1b0 kmemleak: Kernel memory leak detector disabled kmemleak: Object 0xf2ff000003f88000 (size 128): kmemleak: comm "cat", pid 177, jiffies 4294921177 kmemleak: min_count = 1 kmemleak: count = 0 kmemleak: flags = 0x1 kmemleak: checksum = 0 kmemleak: backtrace: kmem_cache_alloc+0x23c/0x2f0 test_version_show+0x1fc/0x3a0 module_attr_show+0x28/0x40 sysfs_kf_seq_show+0xb0/0x130 kernfs_seq_show+0x30/0x40 seq_read_iter+0x1bc/0x4b0 kernfs_fop_read_iter+0x144/0x1c0 generic_file_splice_read+0xd0/0x184 do_splice_to+0x90/0xe0 splice_direct_to_actor+0xb8/0x250 do_splice_direct+0x88/0xd4 do_sendfile+0x2b0/0x344 __arm64_sys_sendfile64+0x164/0x16c invoke_syscall+0x48/0x114 el0_svc_common.constprop.0+0x44/0xec do_el0_svc+0x74/0x90 kmemleak: Automatic memory scanning thread ended [akpm@linux-foundation.org: whitespace tweak] Link: https://lkml.kernel.org/r/20211118054426.4123-1-Kuan-Ying.Lee@mediatek.com Signed-off-by: Kuan-Ying Lee Reviewed-by: Catalin Marinas Cc: Doug Berger Cc: Mel Gorman Cc: Peter Zijlstra Cc: Vlastimil Babka Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c29b5b3d33a61e122cb493917ba51c82bcac4121 Author: Muchun Song Date: Fri Jan 14 14:04:01 2022 -0800 mm: slab: make slab iterator functions static There is no external users of slab_start/next/stop(), so make them static. And the memory.kmem.slabinfo is deprecated, which outputs nothing now, so move memcg_slab_show() into mm/memcontrol.c and rename it to mem_cgroup_slab_show to be consistent with other function names. Link: https://lkml.kernel.org/r/20211109133359.32881-1-songmuchun@bytedance.com Signed-off-by: Muchun Song Reviewed-by: Vlastimil Babka Cc: Christoph Lameter Cc: Pekka Enberg Cc: David Rientjes Cc: Joonsoo Kim Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 7302e91f39a81a9c2efcf4bc5749d18128366945 Author: Marco Elver Date: Fri Jan 14 14:03:58 2022 -0800 mm/slab_common: use WARN() if cache still has objects on destroy Calling kmem_cache_destroy() while the cache still has objects allocated is a kernel bug, and will usually result in the entire cache being leaked. While the message in kmem_cache_destroy() resembles a warning, it is currently not implemented using a real WARN(). This is problematic for infrastructure testing the kernel, all of which rely on the specific format of WARN()s to pick up on bugs. Some 13 years ago this used to be a simple WARN_ON() in slub, but commit d629d8195793 ("slub: improve kmem_cache_destroy() error message") changed it into an open-coded warning to avoid confusion with a bug in slub itself. Instead, turn the open-coded warning into a real WARN() with the message preserved, so that test systems can actually identify these issues, and we get all the other benefits of using a normal WARN(). The warning message is extended with "when called from " to make it even clearer where the fault lies. For most configurations this is only a cosmetic change, however, note that WARN() here will now also respect panic_on_warn. Link: https://lkml.kernel.org/r/20211102170733.648216-1-elver@google.com Signed-off-by: Marco Elver Reviewed-by: Vlastimil Babka Acked-by: David Rientjes Cc: Christoph Lameter Cc: Pekka Enberg Cc: Joonsoo Kim Cc: Dmitry Vyukov Cc: Alexander Potapenko Cc: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a12cf8b32ceed9c60c8bba7c46077ebffbfb9db2 Author: Amit Daniel Kachhap Date: Fri Jan 14 14:03:55 2022 -0800 fs/ioctl: remove unnecessary __user annotation __user annotations are used by the checker (e.g sparse) to mark user pointers. However here __user is applied to a struct directly, without a pointer being directly involved. Although the presence of __user does not cause sparse to emit a warning, __user should be removed for consistency with other uses of offsetof(). Note: No functional changes intended. Link: https://lkml.kernel.org/r/20211122101256.7875-1-amit.kachhap@arm.com Signed-off-by: Amit Daniel Kachhap Cc: Vincenzo Frascino Cc: Kevin Brodsky Cc: Al Viro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 9a25d051502ca1f19af3fd8e196c408a4a9c9fbb Author: Colin Ian King Date: Fri Jan 14 14:03:51 2022 -0800 ocfs2: remove redundant assignment to variable free_space The variable 'free_space' is being initialized with a value that is not read, it is being re-assigned later in the two paths of an if statement. The early initialization is redundant and can be removed. Link: https://lkml.kernel.org/r/20220112230411.1090761-1-colin.i.king@gmail.com Signed-off-by: Colin Ian King Acked-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 d141b39b398460391b98b817fa6284773e842c45 Author: Greg Kroah-Hartman Date: Fri Jan 14 14:03:48 2022 -0800 ocfs2: cluster: use default_groups in kobj_type There are currently two ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the ocfs2 cluster sysfs code to use default_groups field which has been the preferred way since aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field. Link: https://lkml.kernel.org/r/20220106102028.3345634-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman Reviewed-by: Joseph Qi Tested-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 f018844f834a2fc3bc7ba5f6915d5020e930a086 Author: Colin Ian King Date: Fri Jan 14 14:03:45 2022 -0800 ocfs2: remove redundant assignment to pointer root_bh The variable 'root_bh' is being initialized with a value that is not read, it is being re-assigned later on closer to its use. The early initialization is redundant and can be removed. Link: https://lkml.kernel.org/r/20211228013719.620923-1-colin.i.king@gmail.com Signed-off-by: Colin Ian King Acked-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 59430cc1141caf75840bd69877b59d7bf292829e Author: Greg Kroah-Hartman Date: Fri Jan 14 14:03:41 2022 -0800 ocfs2: use default_groups in kobj_type There are currently two ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the ocfs2 code to use default_groups field which has been the preferred way since aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field. Link: https://lkml.kernel.org/r/20211228144517.391660-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman Acked-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 e07bf00c40c6cce051ca7f95a6050d2a195b4f98 Author: Joseph Qi Date: Fri Jan 14 14:03:38 2022 -0800 ocfs2: clearly handle ocfs2_grab_pages_for_write() return value ocfs2_grab_pages_for_write() may return -EAGAIN if write context type is mmap and it could not lock the target page. In this case, we exit with no error and no target page. And then trigger the caller page_mkwrite() to retry. Since there are other caller types, e.g. buffer and direct io, make the return value handling more clear. Link: https://lkml.kernel.org/r/20211206065051.103353-1-joseph.qi@linux.alibaba.com Signed-off-by: Joseph Qi Reported-by: Dan Carpenter 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 783cc68d6143da3c8bc6322b80abd96640f6066f Author: Zhang Mingyu Date: Fri Jan 14 14:03:35 2022 -0800 ocfs2: use BUG_ON instead of if condition followed by BUG. This issue was detected with the help of Coccinelle. Link: https://lkml.kernel.org/r/20211105014424.75372-1-zhang.mingyu@zte.com.cn Signed-off-by: Zhang Mingyu Reported-by: Zeal Robot Acked-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 9eec1d897139e5de287af5d559a02b811b844d82 Author: Zheng Liang Date: Fri Jan 14 14:03:31 2022 -0800 squashfs: provide backing_dev_info in order to disable read-ahead Commit c1f6925e1091 ("mm: put readahead pages in cache earlier") causes the read performance of squashfs to deteriorate.Through testing, we find that the performance will be back by closing the readahead of squashfs. So we want to learn the way of ubifs, provides backing_dev_info and disable read-ahead We tested the following data by fio. squashfs image blocksize=128K test command: fio --name basic --bs=? --filename="/mnt/test_file" --rw=? --iodepth=1 --ioengine=psync --runtime=200 --time_based turn on squashfs readahead in 5.10 kernel bs(k) read/randread MB/s 4 randread 271 128 randread 231 1024 randread 246 4 read 310 128 read 245 1024 read 247 turn off squashfs readahead in 5.10 kernel bs(k) read/randread MB/s 4 randread 293 128 randread 330 1024 randread 363 4 read 338 128 read 360 1024 read 365 turn on squashfs readahead and revert the commit c1f6925e1091("mm: put readahead pages in cache earlier") in 5.10 kernel bs(k) read/randread MB/s 4 randread 289 128 randread 306 1024 randread 335 4 read 337 128 read 336 1024 read 338 Link: https://lkml.kernel.org/r/20211116113141.1391026-1-zhengliang6@huawei.com Signed-off-by: Zheng Liang Reviewed-by: Phillip Lougher Cc: Zhang Yi Cc: Hou Tao Cc: Miao Xie Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 7e0af97853954afd995598ac8dac670a734ade17 Author: Yang Li Date: Fri Jan 14 14:03:28 2022 -0800 fs/ntfs/attrib.c: fix one kernel-doc comment The comments for the file should not be in kernel-doc format: /** * attrib.c - NTFS attribute operations. Part of the Linux-NTFS as it causes it to be incorrectly identified for function ntfs_map_runlist_nolock(), causing some warnings found by running scripts/kernel-doc.: fs/ntfs/attrib.c:25: warning: Incorrect use of kernel-doc format: * ntfs_map_runlist_nolock - map (a part of) a runlist of an ntfs inode fs/ntfs/attrib.c:71: warning: Function parameter or member 'ni' not described in 'ntfs_map_runlist_nolock' fs/ntfs/attrib.c:71: warning: Function parameter or member 'vcn' not described in 'ntfs_map_runlist_nolock' fs/ntfs/attrib.c:71: warning: Function parameter or member 'ctx' not described in 'ntfs_map_runlist_nolock' fs/ntfs/attrib.c:71: warning: expecting prototype for attrib.c - NTFS attribute operations. Part of the Linux(). Prototype was for ntfs_map_runlist_nolock() instead Link: https://lkml.kernel.org/r/20220106015145.67067-1-yang.lee@linux.alibaba.com Signed-off-by: Yang Li Reported-by: Abaci Robot Acked-by: Randy Dunlap Cc: Anton Altaparmakov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 9a69f2b0e4180dc289d0f68842f9e8b146e926f7 Author: Drew Fustini Date: Fri Jan 14 14:03:25 2022 -0800 scripts/spelling.txt: add "oveflow" Add typo "oveflow" for "overflow". This typo was found and fixed in tools/testing/selftests/bpf/prog_tests/btf_dump.c Link: https://lore.kernel.org/all/20211122070528.837806-1-dfustini@baylibre.com/ Link: https://lkml.kernel.org/r/20211122072302.839102-1-dfustini@baylibre.com Signed-off-by: Drew Fustini Suggested-by: Gustavo A. R. Silva Cc: Colin Ian King Cc: Drew Fustini Cc: zuoqilin Cc: Tom Saeger Cc: Sven Eckelmann Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit a7eddfc92bbd2463a89dd22011c047509e6c52a8 Author: Greg Kroah-Hartman Date: Fri Jan 14 14:03:22 2022 -0800 ia64: topology: use default_groups in kobj_type There are currently two ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the ia64 topology sysfs code to use default_groups field which has been the preferred way since aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field. Link: https://lkml.kernel.org/r/20220104154800.1287947-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman Cc: Mike Rapoport Cc: David Hildenbrand Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit c5c2135412bdb11b419e41a0c128e423d8bf4f65 Author: Jason Wang Date: Fri Jan 14 14:03:19 2022 -0800 ia64: fix typo in a comment The double `the' in a comment is repeated, thus it should be removed. Link: https://lkml.kernel.org/r/20211113030316.22650-1-wangborong@cdjrlc.com Signed-off-by: Jason Wang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 6c4420b09267050bc47b3999d80457a8dabaeb89 Author: Yang Guang Date: Fri Jan 14 14:03:16 2022 -0800 arch/ia64/kernel/setup.c: use swap() to make code cleaner Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid opencoding it. Link: https://lkml.kernel.org/r/20211104001908.695110-1-yang.guang5@zte.com.cn Reported-by: Zeal Robot Signed-off-by: Yang Guang Cc: David Yang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit f2fed022aa0a1bce86ca02e16f6c5832711e6424 Author: Yang Guang Date: Fri Jan 14 14:03:13 2022 -0800 ia64: module: use swap() to make code cleaner Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid opencoding it. Link: https://lkml.kernel.org/r/20211104062642.1506539-1-yang.guang5@zte.com.cn Signed-off-by: Yang Guang Reported-by: Zeal Robot Cc: David Yang Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ff78f6679d2e223e073fcbdc8f70b6bc0abadf99 Author: Cai Huoqing Date: Fri Jan 14 14:03:10 2022 -0800 trace/hwlat: make use of the helper function kthread_run_on_cpu() Replace kthread_create_on_cpu/wake_up_process() with kthread_run_on_cpu() to simplify the code. Link: https://lkml.kernel.org/r/20211022025711.3673-7-caihuoqing@baidu.com Signed-off-by: Cai Huoqing Cc: Bernard Metzler Cc: Daniel Bristot de Oliveira Cc: Davidlohr Bueso Cc: Doug Ledford Cc: Ingo Molnar Cc: Jason Gunthorpe Cc: Joel Fernandes (Google) Cc: Josh Triplett Cc: Lai Jiangshan Cc: Mathieu Desnoyers Cc: "Paul E . McKenney" Cc: Steven Rostedt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 11e4e3523da98c065a6c249013ace0d388e41c25 Author: Cai Huoqing Date: Fri Jan 14 14:03:06 2022 -0800 trace/osnoise: make use of the helper function kthread_run_on_cpu() Replace kthread_create_on_cpu/wake_up_process() with kthread_run_on_cpu() to simplify the code. Link: https://lkml.kernel.org/r/20211022025711.3673-6-caihuoqing@baidu.com Signed-off-by: Cai Huoqing Cc: Bernard Metzler Cc: Daniel Bristot de Oliveira Cc: Davidlohr Bueso Cc: Doug Ledford Cc: Ingo Molnar Cc: Jason Gunthorpe Cc: Joel Fernandes (Google) Cc: Josh Triplett Cc: Lai Jiangshan Cc: Mathieu Desnoyers Cc: "Paul E . McKenney" Cc: Steven Rostedt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3b9cb4ba4b54ecc6cf7d04ea9085d2ad2be48733 Author: Cai Huoqing Date: Fri Jan 14 14:03:02 2022 -0800 rcutorture: make use of the helper function kthread_run_on_cpu() Replace kthread_create_on_node/kthread_bind/wake_up_process() with kthread_run_on_cpu() to simplify the code. Link: https://lkml.kernel.org/r/20211022025711.3673-5-caihuoqing@baidu.com Signed-off-by: Cai Huoqing Cc: Bernard Metzler Cc: Daniel Bristot de Oliveira Cc: Davidlohr Bueso Cc: Doug Ledford Cc: Ingo Molnar Cc: Jason Gunthorpe Cc: Joel Fernandes (Google) Cc: Josh Triplett Cc: Lai Jiangshan Cc: Mathieu Desnoyers Cc: "Paul E . McKenney" Cc: Steven Rostedt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 64ed3a049e3e81b801e7c5bb052416152443f585 Author: Cai Huoqing Date: Fri Jan 14 14:02:59 2022 -0800 ring-buffer: make use of the helper function kthread_run_on_cpu() Replace kthread_create/kthread_bind/wake_up_process() with kthread_run_on_cpu() to simplify the code. Link: https://lkml.kernel.org/r/20211022025711.3673-4-caihuoqing@baidu.com Signed-off-by: Cai Huoqing Cc: Bernard Metzler Cc: Daniel Bristot de Oliveira Cc: Davidlohr Bueso Cc: Doug Ledford Cc: Ingo Molnar Cc: Jason Gunthorpe Cc: Joel Fernandes (Google) Cc: Josh Triplett Cc: Lai Jiangshan Cc: Mathieu Desnoyers Cc: "Paul E . McKenney" Cc: Steven Rostedt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit e0850113937b843c69b50b5d9087978ae4254be7 Author: Cai Huoqing Date: Fri Jan 14 14:02:55 2022 -0800 RDMA/siw: make use of the helper function kthread_run_on_cpu() Replace kthread_create/kthread_bind/wake_up_process() with kthread_run_on_cpu() to simplify the code. Link: https://lkml.kernel.org/r/20211022025711.3673-3-caihuoqing@baidu.com Signed-off-by: Cai Huoqing Cc: Bernard Metzler Cc: Daniel Bristot de Oliveira Cc: Davidlohr Bueso Cc: Doug Ledford Cc: Ingo Molnar Cc: Jason Gunthorpe Cc: Joel Fernandes (Google) Cc: Josh Triplett Cc: Lai Jiangshan Cc: Mathieu Desnoyers Cc: "Paul E . McKenney" Cc: Steven Rostedt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 800977f6f32e452cba6b04ef21d2f5383ca29209 Author: Cai Huoqing Date: Fri Jan 14 14:02:52 2022 -0800 kthread: add the helper function kthread_run_on_cpu() Add a new helper function kthread_run_on_cpu(), which includes kthread_create_on_cpu/wake_up_process(). In some cases, use kthread_run_on_cpu() directly instead of kthread_create_on_node/kthread_bind/wake_up_process() or kthread_create_on_cpu/wake_up_process() or kthreadd_create/kthread_bind/wake_up_process() to simplify the code. [akpm@linux-foundation.org: export kthread_create_on_cpu to modules] Link: https://lkml.kernel.org/r/20211022025711.3673-2-caihuoqing@baidu.com Signed-off-by: Cai Huoqing Cc: Bernard Metzler Cc: Cai Huoqing Cc: Daniel Bristot de Oliveira Cc: Davidlohr Bueso Cc: Doug Ledford Cc: Ingo Molnar Cc: Jason Gunthorpe Cc: Joel Fernandes (Google) Cc: Josh Triplett Cc: Lai Jiangshan Cc: Mathieu Desnoyers Cc: "Paul E . McKenney" Cc: Steven Rostedt Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 3cdb8e995ee2e393b66d2abe156b90475009ec41 Author: Julia Lawall Date: Sun Dec 26 11:36:48 2021 +0100 drop fen.cocci This semantic patch does not take into account the fact that of_node_put can be safely applied to NULL. Thus it gives only false positives. Drop it. Reported-by: Qing Wang Signed-off-by: Julia Lawall commit 92b2dadaa624d69465dd94ce3d0f30fc2f70170e Author: Julia Lawall Date: Sat Nov 27 19:10:43 2021 +0100 scripts/coccinelle: drop bugon.cocci The BUG_ON script was never safe, in that it was not able to check whether the condition was side-effecting. At this point, BUG_ON should be well known, so it has probably outlived its usefuless. Signed-off-by: Julia Lawall Suggested-by: Matthew Wilcox commit 6fed105a5640e148032ad37208be280ce8cb6915 Author: Julia Lawall Date: Sat Nov 27 19:09:26 2021 +0100 MAINTAINERS: remove Gilles Muller Gilles Muller passed away on November 17, 2021. We would like to thank him for his continued support for the development of Coccinelle. Signed-off-by: Julia Lawall commit a33f5c380c4bd3fa5278d690421b72052456d9fe Merge: 112450df61b73 4a9bca86806fa Author: Linus Torvalds Date: Sat Jan 15 07:47:40 2022 +0200 Merge tag 'xfs-5.17-merge-3' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull xfs fixes from Darrick Wong: "These are the last few obvious fixes that I found while stress testing online fsck for XFS prior to initiating a design review of the whole giant machinery. - Fix a minor locking inconsistency in readdir - Fix incorrect fs feature bit validation for secondary superblocks" * tag 'xfs-5.17-merge-3' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: xfs: fix online fsck handling of v5 feature bits on secondary supers xfs: take the ILOCK when readdir inspects directory mapping data commit 9d6d7f1cb67cdee15f1a0e85aacfb924e0e02435 Author: Eric Dumazet Date: Fri Jan 14 08:43:28 2022 -0800 af_unix: annote lockless accesses to unix_tot_inflight & gc_in_progress wait_for_unix_gc() reads unix_tot_inflight & gc_in_progress without synchronization. Adds READ_ONCE()/WRITE_ONCE() and their associated comments to better document the intent. BUG: KCSAN: data-race in unix_inflight / wait_for_unix_gc write to 0xffffffff86e2b7c0 of 4 bytes by task 9380 on cpu 0: unix_inflight+0x1e8/0x260 net/unix/scm.c:63 unix_attach_fds+0x10c/0x1e0 net/unix/scm.c:121 unix_scm_to_skb net/unix/af_unix.c:1674 [inline] unix_dgram_sendmsg+0x679/0x16b0 net/unix/af_unix.c:1817 unix_seqpacket_sendmsg+0xcc/0x110 net/unix/af_unix.c:2258 sock_sendmsg_nosec net/socket.c:704 [inline] sock_sendmsg net/socket.c:724 [inline] ____sys_sendmsg+0x39a/0x510 net/socket.c:2409 ___sys_sendmsg net/socket.c:2463 [inline] __sys_sendmmsg+0x267/0x4c0 net/socket.c:2549 __do_sys_sendmmsg net/socket.c:2578 [inline] __se_sys_sendmmsg net/socket.c:2575 [inline] __x64_sys_sendmmsg+0x53/0x60 net/socket.c:2575 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae read to 0xffffffff86e2b7c0 of 4 bytes by task 9375 on cpu 1: wait_for_unix_gc+0x24/0x160 net/unix/garbage.c:196 unix_dgram_sendmsg+0x8e/0x16b0 net/unix/af_unix.c:1772 unix_seqpacket_sendmsg+0xcc/0x110 net/unix/af_unix.c:2258 sock_sendmsg_nosec net/socket.c:704 [inline] sock_sendmsg net/socket.c:724 [inline] ____sys_sendmsg+0x39a/0x510 net/socket.c:2409 ___sys_sendmsg net/socket.c:2463 [inline] __sys_sendmmsg+0x267/0x4c0 net/socket.c:2549 __do_sys_sendmmsg net/socket.c:2578 [inline] __se_sys_sendmmsg net/socket.c:2575 [inline] __x64_sys_sendmmsg+0x53/0x60 net/socket.c:2575 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae value changed: 0x00000002 -> 0x00000004 Reported by Kernel Concurrency Sanitizer on: CPU: 1 PID: 9375 Comm: syz-executor.1 Not tainted 5.16.0-rc7-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Fixes: 9915672d4127 ("af_unix: limit unix_tot_inflight") Signed-off-by: Eric Dumazet Reported-by: syzbot Link: https://lore.kernel.org/r/20220114164328.2038499-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit 252745240ba0ae774d2f80c5e185ed59fbc4fb41 Author: Christophe Leroy Date: Fri Jan 14 11:26:25 2022 +0000 powerpc/audit: Fix syscall_get_arch() Commit 770cec16cdc9 ("powerpc/audit: Simplify syscall_get_arch()") and commit 898a1ef06ad4 ("powerpc/audit: Avoid unneccessary #ifdef in syscall_get_arguments()") replaced test_tsk_thread_flag(task, TIF_32BIT)) by is_32bit_task(). But is_32bit_task() applies on current task while be want the test done on task 'task' So add a new macro is_tsk_32bit_task() to check any task. Fixes: 770cec16cdc9 ("powerpc/audit: Simplify syscall_get_arch()") Fixes: 898a1ef06ad4 ("powerpc/audit: Avoid unneccessary #ifdef in syscall_get_arguments()") Cc: stable@vger.kernel.org Reported-by: Dmitry V. Levin Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/c55cddb8f65713bf5859ed675d75a50cb37d5995.1642159570.git.christophe.leroy@csgroup.eu commit 3f5f766d5f7f95a69a630da3544a1a0cee1cdddf Author: Naveen N. Rao Date: Thu Jan 6 17:15:12 2022 +0530 powerpc64/bpf: Limit 'ldbrx' to processors compliant with ISA v2.06 Johan reported the below crash with test_bpf on ppc64 e5500: test_bpf: #296 ALU_END_FROM_LE 64: 0x0123456789abcdef -> 0x67452301 jited:1 Oops: Exception in kernel mode, sig: 4 [#1] BE PAGE_SIZE=4K SMP NR_CPUS=24 QEMU e500 Modules linked in: test_bpf(+) CPU: 0 PID: 76 Comm: insmod Not tainted 5.14.0-03771-g98c2059e008a-dirty #1 NIP: 8000000000061c3c LR: 80000000006dea64 CTR: 8000000000061c18 REGS: c0000000032d3420 TRAP: 0700 Not tainted (5.14.0-03771-g98c2059e008a-dirty) MSR: 0000000080089000 CR: 88002822 XER: 20000000 IRQMASK: 0 <...> NIP [8000000000061c3c] 0x8000000000061c3c LR [80000000006dea64] .__run_one+0x104/0x17c [test_bpf] Call Trace: .__run_one+0x60/0x17c [test_bpf] (unreliable) .test_bpf_init+0x6a8/0xdc8 [test_bpf] .do_one_initcall+0x6c/0x28c .do_init_module+0x68/0x28c .load_module+0x2460/0x2abc .__do_sys_init_module+0x120/0x18c .system_call_exception+0x110/0x1b8 system_call_common+0xf0/0x210 --- interrupt: c00 at 0x101d0acc <...> ---[ end trace 47b2bf19090bb3d0 ]--- Illegal instruction The illegal instruction turned out to be 'ldbrx' emitted for BPF_FROM_[L|B]E, which was only introduced in ISA v2.06. Guard use of the same and implement an alternative approach for older processors. Fixes: 156d0e290e969c ("powerpc/ebpf/jit: Implement JIT compiler for extended BPF") Reported-by: Johan Almbladh Signed-off-by: Naveen N. Rao Tested-by: Johan Almbladh Acked-by: Johan Almbladh Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/d1e51c6fdf572062cf3009a751c3406bda01b832.1641468127.git.naveen.n.rao@linux.vnet.ibm.com commit 88a71086c48ae98e93c0208044827621e9717f7e Author: Naveen N. Rao Date: Thu Jan 6 17:15:08 2022 +0530 tools/bpf: Rename 'struct event' to avoid naming conflict On ppc64le, trying to build bpf seltests throws the below warning: In file included from runqslower.bpf.c:5: ./runqslower.h:7:8: error: redefinition of 'event' struct event { ^ /home/naveen/linux/tools/testing/selftests/bpf/tools/build/runqslower/vmlinux.h:156602:8: note: previous definition is here struct event { ^ This happens since 'struct event' is defined in drivers/net/ethernet/alteon/acenic.h . Rename the one in runqslower to a more appropriate 'runq_event' to avoid the naming conflict. Signed-off-by: Naveen N. Rao Acked-by: Daniel Borkmann Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/c13cb3767d26257ca4387b8296b632b433a58db6.1641468127.git.naveen.n.rao@linux.vnet.ibm.com commit f9320c49993ca3c0ec0f9a7026b313735306bb8b Author: Naveen N. Rao Date: Thu Jan 6 17:15:07 2022 +0530 powerpc/bpf: Update ldimm64 instructions during extra pass These instructions are updated after the initial JIT, so redo codegen during the extra pass. Rename bpf_jit_fixup_subprog_calls() to clarify that this is more than just subprog calls. Fixes: 69c087ba6225b5 ("bpf: Add bpf_for_each_map_elem() helper") Cc: stable@vger.kernel.org # v5.15 Signed-off-by: Naveen N. Rao Tested-by: Jiri Olsa Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/7cc162af77ba918eb3ecd26ec9e7824bc44b1fae.1641468127.git.naveen.n.rao@linux.vnet.ibm.com commit fab07611fb2e6a15fac05c4583045ca5582fd826 Author: Naveen N. Rao Date: Thu Jan 6 17:15:06 2022 +0530 powerpc32/bpf: Fix codegen for bpf-to-bpf calls Pad instructions emitted for BPF_CALL so that the number of instructions generated does not change for different function addresses. This is especially important for calls to other bpf functions, whose address will only be known during extra pass. Fixes: 51c66ad849a703 ("powerpc/bpf: Implement extended BPF on PPC32") Cc: stable@vger.kernel.org # v5.13+ Signed-off-by: Naveen N. Rao Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/52d8fe51f7620a6f27f377791564d79d75463576.1641468127.git.naveen.n.rao@linux.vnet.ibm.com commit b992f01e66150fc5e90be4a96f5eb8e634c8249e Author: Naveen N. Rao Date: Thu Jan 6 17:15:05 2022 +0530 bpf: Guard against accessing NULL pt_regs in bpf_get_task_stack() task_pt_regs() can return NULL on powerpc for kernel threads. This is then used in __bpf_get_stack() to check for user mode, resulting in a kernel oops. Guard against this by checking return value of task_pt_regs() before trying to obtain the call chain. Fixes: fa28dcb82a38f8 ("bpf: Introduce helper bpf_get_task_stack()") Cc: stable@vger.kernel.org # v5.9+ Signed-off-by: Naveen N. Rao Acked-by: Daniel Borkmann Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/d5ef83c361cc255494afd15ff1b4fb02a36e1dcf.1641468127.git.naveen.n.rao@linux.vnet.ibm.com commit b03fc43e73877e180c1803a33aea3e7396642367 Author: Eli Cohen Date: Tue Jan 11 20:34:00 2022 +0200 vdpa/mlx5: Fix tracking of current number of VQs Modify the code such that ndev->cur_num_vqs better reflects the actual number of data virtqueues. The value can be accurately realized after features have been negotiated. This is to prevent possible failures when modifying the RQT object if the cur_num_vqs bears invalid value. No issue was actually encountered but this also makes the code more readable. Fixes: c5a5cd3d3217 ("vdpa/mlx5: Support configuring max data virtqueue") Signed-off-by: Eli Cohen Link: https://lore.kernel.org/r/20220111183400.38418-5-elic@nvidia.com Signed-off-by: Michael S. Tsirkin Reviewed-by: Si-Wei Liu Acked-by: Jason Wang commit f8ae3a489b21b05c39a0a1a7734f2a0188852177 Author: Eli Cohen Date: Tue Jan 11 20:33:59 2022 +0200 vdpa/mlx5: Fix is_index_valid() to refer to features Make sure the decision whether an index received through a callback is valid or not consults the negotiated features. The motivation for this was due to a case encountered where I shut down the VM. After the reset operation was called features were already clear, I got get_vq_state() call which caused out array bounds access since is_index_valid() reported the index value. So this is more of not hit a bug since the call shouldn't have been made first place. Signed-off-by: Eli Cohen Link: https://lore.kernel.org/r/20220111183400.38418-4-elic@nvidia.com Signed-off-by: Michael S. Tsirkin Reviewed-by: Si-Wei Liu Acked-by: Jason Wang commit 680ab9d69a04cfd9f3f5fedaacbc1974b2959121 Author: Eli Cohen Date: Tue Jan 11 20:33:58 2022 +0200 vdpa: Protect vdpa reset with cf_mutex Call reset using the wrapper function vdpa_reset() to make sure the operation is serialized with cf_mutex. This comes to protect from the following possible scenario: vhost_vdpa_set_status() could call the reset op. Since the call is not protected by cf_mutex, a netlink thread calling vdpa_dev_config_fill could get passed the VIRTIO_CONFIG_S_FEATURES_OK check in vdpa_dev_config_fill() and end up reporting wrong features. Fixes: 5f6e85953d8f ("vdpa: Read device configuration only if FEATURES_OK") Signed-off-by: Eli Cohen Link: https://lore.kernel.org/r/20220111183400.38418-3-elic@nvidia.com Signed-off-by: Michael S. Tsirkin Reviewed-by: Si-Wei Liu Acked-by: Jason Wang commit f6d955d80830b6e6f6a170be68cc3628f36365dd Author: Eli Cohen Date: Tue Jan 11 20:33:57 2022 +0200 vdpa: Avoid taking cf_mutex lock on get status Avoid the wrapper holding cf_mutex since it is not protecting anything. To avoid confusion and unnecessary overhead incurred by it, remove. Fixes: f489f27bc0ab ("vdpa: Sync calls set/get config/status with cf_mutex") Signed-off-by: Eli Cohen Link: https://lore.kernel.org/r/20220111183400.38418-2-elic@nvidia.com Signed-off-by: Michael S. Tsirkin Reviewed-by: Si-Wei Liu Acked-by: Jason Wang commit b2ce6197c9c9be0ecc2a636f3b2f35886ce09a98 Author: Eli Cohen Date: Wed Jan 5 13:46:46 2022 +0200 vdpa/vdpa_sim_net: Report max device capabilities Configure max supported virtqueues features on the management device. This info can be retrieved using: $ vdpa mgmtdev show vdpasim_net: supported_classes net max_supported_vqs 2 dev_features MAC ANY_LAYOUT VERSION_1 ACCESS_PLATFORM Signed-off-by: Eli Cohen Link: https://lore.kernel.org/r/20220105114646.577224-15-elic@nvidia.com Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit 47a1401ac95f95936148b813843ee51d516921ea Author: Eli Cohen Date: Wed Jan 5 13:46:45 2022 +0200 vdpa: Use BIT_ULL for bit operations All masks in this file are 64 bits. Change BIT to BIT_ULL. Other occurences use (1 << val) which yields a 32 bit value. Change them to use BIT_ULL too. Reviewed-by: Si-Wei Liu Signed-off-by: Eli Cohen Link: https://lore.kernel.org/r/20220105114646.577224-14-elic@nvidia.com Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit cbe777e98b3a420a6d66b7ce7780334c48eccc88 Author: Eli Cohen Date: Wed Jan 5 13:46:44 2022 +0200 vdpa/vdpa_sim: Configure max supported virtqueues Configure max supported virtqueues on the management device. Signed-off-by: Eli Cohen Link: https://lore.kernel.org/r/20220105114646.577224-13-elic@nvidia.com Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit 79de65edf8891725616f4992cee5d5963900f07a Author: Eli Cohen Date: Wed Jan 5 13:46:43 2022 +0200 vdpa/mlx5: Report max device capabilities Configure max supported virtqueues and features on the management device. This info can be retrieved using: $ vdpa mgmtdev show auxiliary/mlx5_core.sf.1: supported_classes net max_supported_vqs 257 dev_features CSUM GUEST_CSUM MTU HOST_TSO4 HOST_TSO6 STATUS CTRL_VQ MQ \ CTRL_MAC_ADDR VERSION_1 ACCESS_PLATFORM Signed-off-by: Eli Cohen Link: https://lore.kernel.org/r/20220105114646.577224-12-elic@nvidia.com Signed-off-by: Michael S. Tsirkin Reviewed-by: Si-Wei Liu commit cd2629f6df1cab5b3df34705ae7f3bde6147fce3 Author: Eli Cohen Date: Wed Jan 5 13:46:42 2022 +0200 vdpa: Support reporting max device capabilities Add max_supported_vqs and supported_features fields to struct vdpa_mgmt_dev. Upstream drivers need to feel these values according to the device capabilities. These values are reported back in a netlink message when showing management devices. Examples: $ auxiliary/mlx5_core.sf.1: supported_classes net max_supported_vqs 257 dev_features CSUM GUEST_CSUM MTU HOST_TSO4 HOST_TSO6 STATUS CTRL_VQ MQ \ CTRL_MAC_ADDR VERSION_1 ACCESS_PLATFORM $ vdpa -j mgmtdev show {"mgmtdev":{"auxiliary/mlx5_core.sf.1":{"supported_classes":["net"], \ "max_supported_vqs":257,"dev_features":["CSUM","GUEST_CSUM","MTU", \ "HOST_TSO4","HOST_TSO6","STATUS","CTRL_VQ","MQ","CTRL_MAC_ADDR", \ "VERSION_1","ACCESS_PLATFORM"]}}} $ vdpa -jp mgmtdev show { "mgmtdev": { "auxiliary/mlx5_core.sf.1": { "supported_classes": [ "net" ], "max_supported_vqs": 257, "dev_features": ["CSUM","GUEST_CSUM","MTU","HOST_TSO4", \ "HOST_TSO6","STATUS","CTRL_VQ","MQ", \ "CTRL_MAC_ADDR","VERSION_1","ACCESS_PLATFORM"] } } } Signed-off-by: Eli Cohen Link: https://lore.kernel.org/r/20220105114646.577224-11-elic@nvidia.com Signed-off-by: Michael S. Tsirkin Reviewed-by: Si-Wei Liu commit 37e07e705888e4c3502f204e9c6785c9c2d6d86a Author: Eli Cohen Date: Wed Jan 5 13:46:41 2022 +0200 vdpa/mlx5: Restore cur_num_vqs in case of failure in change_num_qps() Restore ndev->cur_num_vqs to the original value in case change_num_qps() fails. Fixes: 52893733f2c5 ("vdpa/mlx5: Add multiqueue support") Reviewed-by: Si-Wei Liu Acked-by: Jason Wang Signed-off-by: Eli Cohen Link: https://lore.kernel.org/r/20220105114646.577224-10-elic@nvidia.com Signed-off-by: Michael S. Tsirkin commit 612f330ec56f12c0d099286c45f82d835845f136 Author: Eli Cohen Date: Wed Jan 5 13:46:40 2022 +0200 vdpa: Add support for returning device configuration information Add netlink attribute to store the negotiated features. This can be used by userspace to get the current state of the vdpa instance. Examples: $ vdpa dev config show vdpa-a vdpa-a: mac 00:00:00:00:88:88 link up link_announce false max_vq_pairs 16 mtu 1500 negotiated_features CSUM GUEST_CSUM MTU MAC HOST_TSO4 HOST_TSO6 STATUS \ CTRL_VQ MQ CTRL_MAC_ADDR VERSION_1 ACCESS_PLATFORM $ vdpa -j dev config show vdpa-a {"config":{"vdpa-a":{"mac":"00:00:00:00:88:88","link ":"up","link_announce":false, \ "max_vq_pairs":16,"mtu":1500,"negotiated_features":["CSUM","GUEST_CSUM","MTU","MAC", \ "HOST_TSO4","HOST_TSO6","STATUS","CTRL_VQ","MQ","CTRL_MAC_ADDR","VERSION_1", \ "ACCESS_PLATFORM"]}}} $ vdpa -jp dev config show vdpa-a { "config": { "vdpa-a": { "mac": "00:00:00:00:88:88", "link ": "up", "link_announce ": false, "max_vq_pairs": 16, "mtu": 1500, "negotiated_features": [ "CSUM","GUEST_CSUM","MTU","MAC","HOST_TSO4","HOST_TSO6","STATUS","CTRL_VQ","MQ", \ "CTRL_MAC_ADDR","VERSION_1","ACCESS_PLATFORM" ] } } } Signed-off-by: Eli Cohen Link: https://lore.kernel.org/r/20220105114646.577224-9-elic@nvidia.com Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit 75560522eaef2f7c7b2fec3c22e1254244f52372 Author: Eli Cohen Date: Wed Jan 5 13:46:39 2022 +0200 vdpa/mlx5: Support configuring max data virtqueue Check whether the max number of data virtqueue pairs was provided when a adding a new device and verify the new value does not exceed device capabilities. In addition, change the arrays holding virtqueue and callback contexts to be dynamically allocated. Signed-off-by: Eli Cohen Link: https://lore.kernel.org/r/20220105114646.577224-8-elic@nvidia.com Includes fixup: vdpa/mlx5: fix error handling in mlx5_vdpa_dev_add() Clang build fails with mlx5_vnet.c:2574:6: error: variable 'mvdev' is used uninitialized whenever 'if' condition is true if (!ndev->vqs || !ndev->event_cbs) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ mlx5_vnet.c:2660:14: note: uninitialized use occurs here put_device(&mvdev->vdev.dev); ^~~~~ This because mvdev is set after trying to allocate ndev->vqs,event_cbs. So move the allocation to after mvdev is set but before the arrays are used in init_mvqs() Signed-off-by: Tom Rix Link: https://lore.kernel.org/r/20220107211352.3940570-1-trix@redhat.com Signed-off-by: Michael S. Tsirkin Includes fixup: vdpa/mlx5: fix endian-ness for max vqs sparse warnings: (new ones prefixed by >>) >> drivers/vdpa/mlx5/net/mlx5_vnet.c:1247:23: sparse: sparse: cast to restricted __le16 >> drivers/vdpa/mlx5/net/mlx5_vnet.c:1247:23: sparse: sparse: cast from restricted __virtio16 > 1247 num = le16_to_cpu(ndev->config.max_virtqueue_pairs); Address this using the appropriate wrapper. Cc: "Eli Cohen" Reported-by: kernel test robot Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang Reviewed-by: Eli Cohen commit e3137056e6dedee205fccd06da031a285c6e34f5 Author: Eli Cohen Date: Wed Jan 5 13:46:38 2022 +0200 vdpa/mlx5: Fix config_attr_mask assignment Fix VDPA_ATTR_DEV_NET_CFG_MACADDR assignment to be explicit 64 bit assignment. No issue was seen since the value is well below 64 bit max value. Nevertheless it needs to be fixed. Fixes: a007d940040c ("vdpa/mlx5: Support configuration of MAC") Reviewed-by: Si-Wei Liu Acked-by: Jason Wang Signed-off-by: Eli Cohen Link: https://lore.kernel.org/r/20220105114646.577224-7-elic@nvidia.com Signed-off-by: Michael S. Tsirkin commit aba21aff772b8622e08f07219069be793429a48f Author: Eli Cohen Date: Wed Jan 5 13:46:37 2022 +0200 vdpa: Allow to configure max data virtqueues Add netlink support to configure the max virtqueue pairs for a device. At least one pair is required. The maximum is dictated by the device. Example: $ vdpa dev add name vdpa-a mgmtdev auxiliary/mlx5_core.sf.1 max_vqp 4 Signed-off-by: Eli Cohen Link: https://lore.kernel.org/r/20220105114646.577224-6-elic@nvidia.com Signed-off-by: Michael S. Tsirkin commit 30ef7a8ac8a07046b9ac9206d3a732a9f76b2e60 Author: Eli Cohen Date: Wed Jan 5 13:46:36 2022 +0200 vdpa: Read device configuration only if FEATURES_OK Avoid reading device configuration during feature negotiation. Read device status and verify that VIRTIO_CONFIG_S_FEATURES_OK is set. Protect the entire operation, including configuration read with cf_mutex to ensure integrity of the results. Signed-off-by: Eli Cohen Link: https://lore.kernel.org/r/20220105114646.577224-5-elic@nvidia.com Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit 73bc0dbb591baea322a7319c735e5f6c7dba9cfb Author: Eli Cohen Date: Wed Jan 5 13:46:35 2022 +0200 vdpa: Sync calls set/get config/status with cf_mutex Add wrappers to get/set status and protect these operations with cf_mutex to serialize these operations with respect to get/set config operations. Signed-off-by: Eli Cohen Link: https://lore.kernel.org/r/20220105114646.577224-4-elic@nvidia.com Signed-off-by: Michael S. Tsirkin commit a7f46ba42485394edf9836969e220878f4908465 Author: Eli Cohen Date: Wed Jan 5 13:46:34 2022 +0200 vdpa/mlx5: Distribute RX virtqueues in RQT object Distribute the available rx virtqueues amongst the available RQT entries. RQTs require to have a power of two entries. When creating or modifying the RQT, use the lowest number of power of two entries that is not less than the number of rx virtqueues. Distribute them in the available entries such that some virtqueus may be referenced twice. This allows to configure any number of virtqueue pairs when multiqueue is used. Reviewed-by: Si-Wei Liu Acked-by: Jason Wang Signed-off-by: Eli Cohen Link: https://lore.kernel.org/r/20220105114646.577224-3-elic@nvidia.com Signed-off-by: Michael S. Tsirkin commit a64917bc2e9b1e0aa716b783c4ec879fdd280300 Author: Eli Cohen Date: Wed Jan 5 13:46:33 2022 +0200 vdpa: Provide interface to read driver features Provide an interface to read the negotiated features. This is needed when building the netlink message in vdpa_dev_net_config_fill(). Also fix the implementation of vdpa_dev_net_config_fill() to use the negotiated features instead of the device features. To make APIs clearer, make the following name changes to struct vdpa_config_ops so they better describe their operations: get_features -> get_device_features set_features -> set_driver_features Finally, add get_driver_features to return the negotiated features and add implementation to all the upstream drivers. Acked-by: Jason Wang Signed-off-by: Eli Cohen Link: https://lore.kernel.org/r/20220105114646.577224-2-elic@nvidia.com Signed-off-by: Michael S. Tsirkin commit 870aaff92e959e29d40f9cfdb5ed06ba2fc2dae0 Author: Laura Abbott Date: Thu Jan 6 08:09:25 2022 -0500 vdpa: clean up get_config_size ret value handling The return type of get_config_size is size_t so it makes sense to change the type of the variable holding its result. That said, this already got taken care of (differently, and arguably not as well) by commit 3ed21c1451a1 ("vdpa: check that offsets are within bounds"). The added 'c->off > size' test in that commit will be done as an unsigned comparison on 32-bit (safe due to not being signed). On a 64-bit platform, it will be done as a signed comparison, but in that case the comparison will be done in 64-bit, and 'c->off' being an u32 it will be valid thanks to the extended range (ie both values will be positive in 64 bits). So this was a real bug, but it was already addressed and marked for stable. Signed-off-by: Laura Abbott Reported-by: Luo Likang Signed-off-by: Michael S. Tsirkin commit 1861ba626ae9b98136f3e504208cdef6b29cd3ec Author: Michael S. Tsirkin Date: Thu Jan 6 07:57:46 2022 -0500 virtio_ring: mark ring unused on error A recently added error path does not mark ring unused when exiting on OOM, which will lead to BUG on the next entry in debug builds. TODO: refactor code so we have START_USE and END_USE in the same function. Fixes: fc6d70f40b3d ("virtio_ring: check desc == NULL when using indirect with packed") Cc: "Xuan Zhuo" Cc: Jiasheng Jiang Reviewed-by: Xuan Zhuo Signed-off-by: Michael S. Tsirkin commit 080063920777af65105e5953e2851e036376e3ea Author: Xianting Tian Date: Tue Dec 28 11:09:24 2021 +0800 vhost/test: fix memory leak of vhost virtqueues We need free the vqs in .release(), which are allocated in .open(). Signed-off-by: Xianting Tian Link: https://lore.kernel.org/r/20211228030924.3468439-1-xianting.tian@linux.alibaba.com Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit 97143b70aa847f2b0a1f959dde126b76ff7b5376 Author: Eli Cohen Date: Thu Dec 30 16:20:24 2021 +0200 vdpa/mlx5: Fix wrong configuration of virtio_version_1_0 Remove overriding of virtio_version_1_0 which forced the virtqueue object to version 1. Fixes: 1a86b377aa21 ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices") Signed-off-by: Eli Cohen Link: https://lore.kernel.org/r/20211230142024.142979-1-elic@nvidia.com Signed-off-by: Michael S. Tsirkin Reviewed-by: Parav Pandit Acked-by: Jason Wang Reviewed-by: Si-Wei Liu commit 49814ce9e21a8b6d6158b2e502fe6bacef4d99b6 Author: Peng Hao Date: Wed Dec 22 19:20:14 2021 +0800 virtio/virtio_pci_legacy_dev: ensure the correct return value When pci_iomap return NULL, the return value is zero. Signed-off-by: Peng Hao Link: https://lore.kernel.org/r/20211222112014.87394-1-flyingpeng@tencent.com Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit cf4a4493ff70874f8af26d75d4346c591c298e89 Author: Peng Hao Date: Wed Dec 22 09:12:25 2021 +0800 virtio/virtio_mem: handle a possible NULL as a memcpy parameter There is a check for vm->sbm.sb_states before, and it should check it here as well. Signed-off-by: Peng Hao Link: https://lore.kernel.org/r/20211222011225.40573-1-flyingpeng@tencent.com Signed-off-by: Michael S. Tsirkin Fixes: 5f1f79bbc9e2 ("virtio-mem: Paravirtualized memory hotplug") Cc: stable@vger.kernel.org # v5.8+ commit 2b68224ec61bb66aa2a24ad099b6af65138fa888 Author: Dapeng Mi Date: Fri Dec 10 15:35:46 2021 +0800 virtio: fix a typo in function "vp_modern_remove" comments. Function name "vp_modern_remove" in comments is written to "vp_modern_probe" incorrectly. Change it. Signed-off-by: Dapeng Mi Link: https://lore.kernel.org/r/20211210073546.700783-1-dapeng1.mi@intel.com Signed-off-by: Michael S. Tsirkin Reviewed-by: Stefano Garzarella commit 6017599bb25c20b7a68cbb8e7d534bdc1c36b5e4 Author: 王贇 Date: Thu Dec 9 11:29:25 2021 +0800 virtio-pci: fix the confusing error message The error message on the failure of pfn check should tell virtio-pci rather than virtio-mmio, just fix it. Signed-off-by: Michael Wang Suggested-by: Michael S. Tsirkin Link: https://lore.kernel.org/r/ae5e154e-ac59-f0fa-a7c7-091a2201f581@linux.alibaba.com Signed-off-by: Michael S. Tsirkin commit 9f8b4ae2ac7dc5ff6e5dfa723c1ef2bad80a8c68 Author: Johan Hovold Date: Wed Dec 1 14:25:28 2021 +0100 firmware: qemu_fw_cfg: remove sysfs entries explicitly Explicitly remove the file entries from sysfs before dropping the final reference for symmetry reasons and for consistency with the rest of the driver. Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20211201132528.30025-5-johan@kernel.org Signed-off-by: Michael S. Tsirkin commit 1b656e9aad7f4886ed466094d1dc5ee4dd900d20 Author: Johan Hovold Date: Wed Dec 1 14:25:27 2021 +0100 firmware: qemu_fw_cfg: fix sysfs information leak Make sure to always NUL-terminate file names retrieved from the firmware to avoid accessing data beyond the entry slab buffer and exposing it through sysfs in case the firmware data is corrupt. Fixes: 75f3e8e47f38 ("firmware: introduce sysfs driver for QEMU's fw_cfg device") Cc: stable@vger.kernel.org # 4.6 Cc: Gabriel Somlo Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20211201132528.30025-4-johan@kernel.org Signed-off-by: Michael S. Tsirkin commit 6004e351da50565fb561be85d45151dc9c370023 Author: Johan Hovold Date: Wed Dec 1 14:25:26 2021 +0100 firmware: qemu_fw_cfg: fix kobject leak in probe error path An initialised kobject must be freed using kobject_put() to avoid leaking associated resources (e.g. the object name). Commit fe3c60684377 ("firmware: Fix a reference count leak.") "fixed" the leak in the first error path of the file registration helper but left the second one unchanged. This "fix" would however result in a NULL pointer dereference due to the release function also removing the never added entry from the fw_cfg_entry_cache list. This has now been addressed. Fix the remaining kobject leak by restoring the common error path and adding the missing kobject_put(). Fixes: 75f3e8e47f38 ("firmware: introduce sysfs driver for QEMU's fw_cfg device") Cc: stable@vger.kernel.org # 4.6 Cc: Gabriel Somlo Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20211201132528.30025-3-johan@kernel.org Signed-off-by: Michael S. Tsirkin commit d3e305592d69e21e36b76d24ca3c01971a2d09be Author: Johan Hovold Date: Wed Dec 1 14:25:25 2021 +0100 firmware: qemu_fw_cfg: fix NULL-pointer deref on duplicate entries Commit fe3c60684377 ("firmware: Fix a reference count leak.") "fixed" a kobject leak in the file registration helper by properly calling kobject_put() for the entry in case registration of the object fails (e.g. due to a name collision). This would however result in a NULL pointer dereference when the release function tries to remove the never added entry from the fw_cfg_entry_cache list. Fix this by moving the list-removal out of the release function. Note that the offending commit was one of the benign looking umn.edu fixes which was reviewed but not reverted. [1][2] [1] https://lore.kernel.org/r/202105051005.49BFABCE@keescook [2] https://lore.kernel.org/all/YIg7ZOZvS3a8LjSv@kroah.com Fixes: fe3c60684377 ("firmware: Fix a reference count leak.") Cc: stable@vger.kernel.org # 5.8 Cc: Qiushi Wu Cc: Kees Cook Cc: Greg Kroah-Hartman Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20211201132528.30025-2-johan@kernel.org Signed-off-by: Michael S. Tsirkin commit 28cc408be72cebb0f3fcc37bc74ab3196d4de726 Author: Eugenio Pérez Date: Thu Nov 4 20:52:48 2021 +0100 vdpa: Mark vdpa_config_ops.get_vq_notification as optional Since vhost_vdpa_mmap checks for its existence before calling it. Signed-off-by: Eugenio Pérez Link: https://lore.kernel.org/r/20211104195248.2088904-1-eperezma@redhat.com Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang Reviewed-by: Stefano Garzarella commit 23118b09e6e11a03cb40a86875d5d342257ae1ec Author: Eugenio Pérez Date: Thu Nov 4 20:58:33 2021 +0100 vdpa: Avoid duplicate call to vp_vdpa get_status It has no sense to call get_status twice, since we already have a variable for that. Signed-off-by: Eugenio Pérez Link: https://lore.kernel.org/r/20211104195833.2089796-1-eperezma@redhat.com Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang Reviewed-by: Stefano Garzarella commit 10aa250b2f7d87d0921c5e991fd49e607050d486 Author: Christophe JAILLET Date: Sun Nov 7 17:14:56 2021 +0100 eni_vdpa: Simplify 'eni_vdpa_probe()' When 'pcim_enable_device()' is used, some resources become automagically managed. There is no need to call 'pci_free_irq_vectors()' when the driver is removed. The same will already be done by 'pcim_release()'. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/02045bdcbbb25f79bae4827f66029cfcddc90381.1636301587.git.christophe.jaillet@wanadoo.fr Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit 60af39c1f4cc92cc2785ef745c0c97558134d539 Author: Eli Cohen Date: Wed Nov 24 19:09:49 2021 +0200 net/mlx5_vdpa: Offer VIRTIO_NET_F_MTU when setting MTU Make sure to offer VIRTIO_NET_F_MTU since we configure the MTU based on what was queried from the device. This allows the virtio driver to allocate large enough buffers based on the reported MTU. Signed-off-by: Eli Cohen Link: https://lore.kernel.org/r/20211124170949.51725-1-elic@nvidia.com Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang Reviewed-by: Si-Wei Liu commit 57c5a5b304b0d3798b2d3dc75bd6c960d78ee8ff Author: David Hildenbrand Date: Fri Nov 26 14:42:09 2021 +0100 virtio-mem: prepare fake page onlining code for granularity smaller than MAX_ORDER - 1 Let's prepare our fake page onlining code for subblock size smaller than MAX_ORDER - 1: we might get called for ranges not covering properly aligned MAX_ORDER - 1 pages. We have to detect the order to use dynamically. Signed-off-by: David Hildenbrand Link: https://lore.kernel.org/r/20211126134209.17332-3-david@redhat.com Signed-off-by: Michael S. Tsirkin Reviewed-by: Zi Yan Reviewed-by: Eric Ren commit 6639032acc085775452a2c92fdb8a6f601c9c075 Author: David Hildenbrand Date: Fri Nov 26 14:42:08 2021 +0100 virtio-mem: prepare page onlining code for granularity smaller than MAX_ORDER - 1 Let's prepare our page onlining code for subblock size smaller than MAX_ORDER - 1: we'll get called for a MAX_ORDER - 1 page but might have some subblocks in the range plugged and some unplugged. In that case, fallback to subblock granularity to properly only expose the plugged parts to the buddy. Signed-off-by: David Hildenbrand Link: https://lore.kernel.org/r/20211126134209.17332-2-david@redhat.com Signed-off-by: Michael S. Tsirkin Reviewed-by: Zi Yan Reviewed-by: Eric Ren commit 539fec78edb4e084e7c532affc56cc42d4ceea4b Author: Stefano Garzarella Date: Fri Nov 26 17:47:53 2021 +0100 vdpa: add driver_override support `driver_override` allows to control which of the vDPA bus drivers binds to a vDPA device. If `driver_override` is not set, the previous behaviour is followed: devices use the first vDPA bus driver loaded (unless auto binding is disabled). Tested on Fedora 34 with driverctl(8): $ modprobe virtio-vdpa $ modprobe vhost-vdpa $ modprobe vdpa-sim-net $ vdpa dev add mgmtdev vdpasim_net name dev1 # dev1 is attached to the first vDPA bus driver loaded $ driverctl -b vdpa list-devices dev1 virtio_vdpa $ driverctl -b vdpa set-override dev1 vhost_vdpa $ driverctl -b vdpa list-devices dev1 vhost_vdpa [*] Note: driverctl(8) integrates with udev so the binding is preserved. Suggested-by: Jason Wang Acked-by: Jason Wang Signed-off-by: Stefano Garzarella Link: https://lore.kernel.org/r/20211126164753.181829-3-sgarzare@redhat.com Signed-off-by: Michael S. Tsirkin commit 9c25cdeb5f3ca9ef0d683ee8c29b7cb61a174165 Author: Stefano Garzarella Date: Fri Nov 26 17:47:52 2021 +0100 docs: document sysfs ABI for vDPA bus Add missing documentation of sysfs ABI for vDPA bus in the new Documentation/ABI/testing/sysfs-bus-vdpa file. Signed-off-by: Stefano Garzarella Link: https://lore.kernel.org/r/20211126164753.181829-2-sgarzare@redhat.com Signed-off-by: Michael S. Tsirkin Acked-by: Jason Wang commit 0f420c383a2bb414ebccedf9289b5b815f1295fe Author: Zhu Lingshan Date: Wed Dec 1 16:12:55 2021 +0800 ifcvf/vDPA: fix misuse virtio-net device config size for blk dev This commit fixes a misuse of virtio-net device config size issue for virtio-block devices. A new member config_size in struct ifcvf_hw is introduced and would be initialized through vdpa_dev_add() to record correct device config size. To be more generic, rename ifcvf_hw.net_config to ifcvf_hw.dev_config, the helpers ifcvf_read/write_net_config() to ifcvf_read/write_dev_config() Signed-off-by: Zhu Lingshan Reported-and-suggested-by: Stefano Garzarella Reviewed-by: Stefano Garzarella Fixes: 6ad31d162a4e ("vDPA/ifcvf: enable Intel C5000X-PL virtio-block for vDPA") Cc: Link: https://lore.kernel.org/r/20211201081255.60187-1-lingshan.zhu@intel.com Signed-off-by: Michael S. Tsirkin commit b4d80c8dda229c830f0ba38c103e5263c2a7bc64 Author: Guanjun Date: Mon Dec 6 16:48:18 2021 +0800 vduse: moving kvfree into caller This free action should be moved into caller 'vduse_ioctl' in concert with the allocation. No functional change. Signed-off-by: Guanjun Link: https://lore.kernel.org/r/1638780498-55571-1-git-send-email-guanjun@linux.alibaba.com Signed-off-by: Michael S. Tsirkin commit 2076207128948b766ef1fe344e0444fc9271a847 Author: Michael S. Tsirkin Date: Thu Nov 25 13:00:17 2021 -0500 hwrng: virtio - unregister device before reset unregister after reset is clearly wrong - device can be used while it's reset. There's an attempt to protect against that using hwrng_removed but it seems racy since access can be in progress when the flag is set. Just unregister, then reset seems simpler and cleaner. NB: we might be able to drop hwrng_removed in a follow-up patch. Signed-off-by: Laurent Vivier Signed-off-by: Michael S. Tsirkin commit d9679d0013a66849f23057978f92e76b255c50aa Author: Michael S. Tsirkin Date: Wed Oct 13 06:55:44 2021 -0400 virtio: wrap config->reset calls This will enable cleanups down the road. The idea is to disable cbs, then add "flush_queued_cbs" callback as a parameter, this way drivers can flush any work queued after callbacks have been disabled. Signed-off-by: Michael S. Tsirkin Link: https://lore.kernel.org/r/20211013105226.20225-1-mst@redhat.com Signed-off-by: Michael S. Tsirkin commit c4849f88164b13dd141885e28210f599741b304b Author: Mario Limonciello Date: Fri Jan 7 10:44:17 2022 -0600 drm/amd/display: Revert W/A for hard hangs on DCN20/DCN21 The WA from commit 2a50edbf10c8 ("drm/amd/display: Apply w/a for hard hang on HPD") and commit 1bd3bc745e7f ("drm/amd/display: Extend w/a for hard hang on HPD to dcn20") causes a regression in s0ix where the system will fail to resume properly on many laptops. Pull the workarounds out to avoid that s0ix regression in the common case. This HPD hang happens with an external device in special circumstances and a new W/A will need to be developed for this in the future. Cc: stable@vger.kernel.org Cc: Qingqing Zhuo Reported-by: Scott Bruce Reported-by: Chris Hixon Reported-by: spasswolf@web.de Link: https://bugzilla.kernel.org/show_bug.cgi?id=215436 Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1821 Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1852 Fixes: 2a50edbf10c8 ("drm/amd/display: Apply w/a for hard hang on HPD") Fixes: 1bd3bc745e7f ("drm/amd/display: Extend w/a for hard hang on HPD to dcn20") Reviewed-by: Nicholas Kazlauskas Signed-off-by: Mario Limonciello Signed-off-by: Alex Deucher commit d82ce3cd30aa28db3e94ffc36ebf0af2ff12801d Author: Alex Deucher Date: Fri Jan 14 09:59:29 2022 -0500 drm/amdgpu: drop flags check for CHIP_IP_DISCOVERY Support for IP based discovery is in place now so this check is no longer required. Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 3993a799fc971bc9b918bd969aa55864447b5dde Author: Lukas Fink Date: Fri Jan 14 07:51:41 2022 +0100 drm/amdgpu: Fix rejecting Tahiti GPUs eb4fd29afd4a ("drm/amdgpu: bind to any 0x1002 PCI diplay class device") added generic bindings to amdgpu so that that it binds to all display class devices with VID 0x1002 and then rejects those in amdgpu_pci_probe. Unfortunately it reuses a driver_data value of 0 to detect those new bindings, which is already used to denote CHIP_TAHITI ASICs. The driver_data value given to those new bindings was changed in dd0761fd24ea1 ("drm/amdgpu: set CHIP_IP_DISCOVERY as the asic type by default") to CHIP_IP_DISCOVERY (=36), but it seems that the check in amdgpu_pci_probe was forgotten to be changed. Therefore, it still rejects Tahiti GPUs. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1860 Fixes: eb4fd29afd4a ("drm/amdgpu: bind to any 0x1002 PCI diplay class device") Cc: stable@vger.kernel.org Signed-off-by: Lukas Fink Signed-off-by: Alex Deucher commit e8309d50e97851ff135c4e33325d37b032666b94 Author: Alex Deucher Date: Wed Jan 12 22:38:51 2022 -0500 drm/amdgpu: don't do resets on APUs which don't support it It can cause a hang. This is normally not enabled for GPU hangs on these asics, but was recently enabled for handling aborted suspends. This causes hangs on some platforms on suspend. Fixes: daf8de0874ab5b ("drm/amdgpu: always reset the asic in suspend (v2)") Cc: stable@vger.kernel.org Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1858 Signed-off-by: Alex Deucher commit 0ffb1fd1582a78649f22253d81515997fff88bc4 Author: Alex Deucher Date: Tue Jan 11 17:41:44 2022 -0500 drm/amdgpu: invert the logic in amdgpu_device_should_recover_gpu() Rather than opting into GPU recovery support, default to on, and opt out if it's not working on a particular GPU. This avoids the need to add new asics to this list since this is a core feature. Reviewed-by: Evan Quan Reviewed-by: Guchun Chen Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 4175c32be5ef0ff254d6931931ec412e8029c32a Author: CHANDAN VURDIGERE NATARAJ Date: Tue Jan 11 19:02:26 2022 +0530 drm/amdgpu: Enable recovery on yellow carp Add yellow carp to devices which support recovery Signed-off-by: CHANDAN VURDIGERE NATARAJ Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit f346f32701ebacf6fe397f6f1d254256f73da321 Author: Helge Deller Date: Fri Jan 14 19:11:21 2022 +0100 MAINTAINERS: Add Helge as fbdev maintainer The fbdev layer is orphaned, but seems to need some care. So I'd like to step up as new maintainer. Signed-off-by: Helge Deller Acked-by: Geert Uytterhoeven commit c862dcd199759d4a45e65dab47b03e3e8a144e3a Author: Yang Zhong Date: Thu Jan 13 13:08:25 2022 -0500 x86/fpu: Fix inline prefix warnings Fix sparse warnings in xstate and remove inline prefix. Fixes: 980fe2fddcff ("x86/fpu: Extend fpu_xstate_prctl() with guest permissions") Signed-off-by: Yang Zhong Reported-by: kernel test robot Message-Id: <20220113180825.322333-1-yang.zhong@intel.com> Signed-off-by: Paolo Bonzini commit bf70636d9443c9e0718fd98765ba634e631ed079 Author: Yang Zhong Date: Thu Dec 23 09:53:22 2021 -0500 selftest: kvm: Add amx selftest This selftest covers two aspects of AMX. The first is triggering #NM exception and checking the MSR XFD_ERR value. The second case is loading tile config and tile data into guest registers and trapping to the host side for a complete save/load of the guest state. TMM0 is also checked against memory data after save/restore. Signed-off-by: Yang Zhong Message-Id: <20211223145322.2914028-4-yang.zhong@intel.com> Signed-off-by: Paolo Bonzini commit 6559b4a523cd65f6005b4592833b16ba970abdf5 Author: Yang Zhong Date: Thu Dec 23 09:53:21 2021 -0500 selftest: kvm: Move struct kvm_x86_state to header Those changes can avoid dereferencing pointer compile issue when amx_test.c reference state->xsave. Move struct kvm_x86_state definition to processor.h. Signed-off-by: Yang Zhong Message-Id: <20211223145322.2914028-3-yang.zhong@intel.com> Signed-off-by: Paolo Bonzini commit 551447cfa5dc208b7fba7aa98391d5cc8149fa5a Author: Paolo Bonzini Date: Thu Dec 23 09:53:20 2021 -0500 selftest: kvm: Reorder vcpu_load_state steps for AMX For AMX support it is recommended to load XCR0 after XFD, so that KVM does not see XFD=0, XCR=1 for a save state that will eventually be disabled (which would lead to premature allocation of the space required for that save state). It is also required to load XSAVE data after XCR0 and XFD, so that KVM can trigger allocation of the extra space required to store AMX state. Adjust vcpu_load_state to obey these new requirements. Signed-off-by: Paolo Bonzini Signed-off-by: Yang Zhong Message-Id: <20211223145322.2914028-2-yang.zhong@intel.com> Signed-off-by: Paolo Bonzini commit b5274b1b7ba89fe8ed38cc470041cd6ba0dfb79b Author: Kevin Tian Date: Wed Jan 5 04:35:32 2022 -0800 kvm: x86: Disable interception for IA32_XFD on demand Always intercepting IA32_XFD causes non-negligible overhead when this register is updated frequently in the guest. Disable r/w emulation after intercepting the first WRMSR(IA32_XFD) with a non-zero value. Disable WRMSR emulation implies that IA32_XFD becomes out-of-sync with the software states in fpstate and the per-cpu xfd cache. This leads to two additional changes accordingly: - Call fpu_sync_guest_vmexit_xfd_state() after vm-exit to bring software states back in-sync with the MSR, before handle_exit_irqoff() is called. - Always trap #NM once write interception is disabled for IA32_XFD. The #NM exception is rare if the guest doesn't use dynamic features. Otherwise, there is at most one exception per guest task given a dynamic feature. p.s. We have confirmed that SDM is being revised to say that when setting IA32_XFD[18] the AMX register state is not guaranteed to be preserved. This clarification avoids adding mess for a creative guest which sets IA32_XFD[18]=1 before saving active AMX state to its own storage. Signed-off-by: Kevin Tian Signed-off-by: Jing Liu Signed-off-by: Yang Zhong Message-Id: <20220105123532.12586-22-yang.zhong@intel.com> Signed-off-by: Paolo Bonzini commit 5429cead01192ff4019ea0b13316268d14fd1ec2 Author: Thomas Gleixner Date: Wed Jan 5 04:35:31 2022 -0800 x86/fpu: Provide fpu_sync_guest_vmexit_xfd_state() KVM can disable the write emulation for the XFD MSR when the vCPU's fpstate is already correctly sized to reduce the overhead. When write emulation is disabled the XFD MSR state after a VMEXIT is unknown and therefore not in sync with the software states in fpstate and the per CPU XFD cache. Provide fpu_sync_guest_vmexit_xfd_state() which has to be invoked after a VMEXIT before enabling interrupts when write emulation is disabled for the XFD MSR. It could be invoked unconditionally even when write emulation is enabled for the price of a pointless MSR read. Signed-off-by: Thomas Gleixner Signed-off-by: Jing Liu Signed-off-by: Yang Zhong Message-Id: <20220105123532.12586-21-yang.zhong@intel.com> Signed-off-by: Paolo Bonzini commit 415a3c33e847349c0f76575b3ebfdfae2f5a681a Author: Wei Wang Date: Wed Jan 5 04:35:30 2022 -0800 kvm: selftests: Add support for KVM_CAP_XSAVE2 When KVM_CAP_XSAVE2 is supported, userspace is expected to allocate buffer for KVM_GET_XSAVE2 and KVM_SET_XSAVE using the size returned by KVM_CHECK_EXTENSION(KVM_CAP_XSAVE2). Signed-off-by: Wei Wang Signed-off-by: Guang Zeng Signed-off-by: Jing Liu Signed-off-by: Yang Zhong Message-Id: <20220105123532.12586-20-yang.zhong@intel.com> Signed-off-by: Paolo Bonzini commit be50b2065dfa3d88428fdfdc340d154d96bf6848 Author: Guang Zeng Date: Wed Jan 5 04:35:29 2022 -0800 kvm: x86: Add support for getting/setting expanded xstate buffer With KVM_CAP_XSAVE, userspace uses a hardcoded 4KB buffer to get/set xstate data from/to KVM. This doesn't work when dynamic xfeatures (e.g. AMX) are exposed to the guest as they require a larger buffer size. Introduce a new capability (KVM_CAP_XSAVE2). Userspace VMM gets the required xstate buffer size via KVM_CHECK_EXTENSION(KVM_CAP_XSAVE2). KVM_SET_XSAVE is extended to work with both legacy and new capabilities by doing properly-sized memdup_user() based on the guest fpu container. KVM_GET_XSAVE is kept for backward-compatible reason. Instead, KVM_GET_XSAVE2 is introduced under KVM_CAP_XSAVE2 as the preferred interface for getting xstate buffer (4KB or larger size) from KVM (Link: https://lkml.org/lkml/2021/12/15/510) Also, update the api doc with the new KVM_GET_XSAVE2 ioctl. Signed-off-by: Guang Zeng Signed-off-by: Wei Wang Signed-off-by: Jing Liu Signed-off-by: Kevin Tian Signed-off-by: Yang Zhong Message-Id: <20220105123532.12586-19-yang.zhong@intel.com> Signed-off-by: Paolo Bonzini commit c60427dd50ba9b20063ccaed0e98d62e886d7a3b Author: Thomas Gleixner Date: Wed Jan 5 04:35:28 2022 -0800 x86/fpu: Add uabi_size to guest_fpu Userspace needs to inquire KVM about the buffer size to work with the new KVM_SET_XSAVE and KVM_GET_XSAVE2. Add the size info to guest_fpu for KVM to access. Signed-off-by: Thomas Gleixner Signed-off-by: Wei Wang Signed-off-by: Jing Liu Signed-off-by: Yang Zhong Message-Id: <20220105123532.12586-18-yang.zhong@intel.com> Signed-off-by: Paolo Bonzini commit 690a757d610e50c2c3acd2e4bc3992cfc63feff2 Author: Jing Liu Date: Wed Jan 5 04:35:27 2022 -0800 kvm: x86: Add CPUID support for Intel AMX Extend CPUID emulation to support XFD, AMX_TILE, AMX_INT8 and AMX_BF16. Adding those bits into kvm_cpu_caps finally activates all previous logics in this series. Hide XFD on 32bit host kernels. Otherwise it leads to a weird situation where KVM tells userspace to migrate MSR_IA32_XFD and then rejects attempts to read/write the MSR. Signed-off-by: Jing Liu Signed-off-by: Yang Zhong Message-Id: <20220105123532.12586-17-yang.zhong@intel.com> Signed-off-by: Paolo Bonzini commit 86aff7a4799286635efd94dab17b513544703cad Author: Jing Liu Date: Wed Jan 5 04:35:26 2022 -0800 kvm: x86: Add XCR0 support for Intel AMX Two XCR0 bits are defined for AMX to support XSAVE mechanism. Bit 17 is for tilecfg and bit 18 is for tiledata. The value of XCR0[17:18] is always either 00b or 11b. Also, SDM recommends that only 64-bit operating systems enable Intel AMX by setting XCR0[18:17]. 32-bit host kernel never sets the tile bits in vcpu->arch.guest_supported_xcr0. Signed-off-by: Jing Liu Signed-off-by: Kevin Tian Signed-off-by: Yang Zhong Message-Id: <20220105123532.12586-16-yang.zhong@intel.com> Signed-off-by: Paolo Bonzini commit 61f208134a871047f1d642ed3b813f4f71e30b0e Author: Jing Liu Date: Wed Jan 5 04:35:25 2022 -0800 kvm: x86: Disable RDMSR interception of IA32_XFD_ERR This saves one unnecessary VM-exit in guest #NM handler, given that the MSR is already restored with the guest value before the guest is resumed. Suggested-by: Paolo Bonzini Signed-off-by: Jing Liu Signed-off-by: Yang Zhong Message-Id: <20220105123532.12586-15-yang.zhong@intel.com> Signed-off-by: Paolo Bonzini commit 548e83650a51dce0d188b9e41b1e2ca5d63597cf Author: Jing Liu Date: Wed Jan 5 04:35:24 2022 -0800 kvm: x86: Emulate IA32_XFD_ERR for guest Emulate read/write to IA32_XFD_ERR MSR. Only the saved value in the guest_fpu container is touched in the emulation handler. Actual MSR update is handled right before entering the guest (with preemption disabled) Signed-off-by: Jing Liu Signed-off-by: Zeng Guang Signed-off-by: Wei Wang Signed-off-by: Jing Liu Signed-off-by: Yang Zhong Message-Id: <20220105123532.12586-14-yang.zhong@intel.com> Signed-off-by: Paolo Bonzini commit ec5be88ab29fd9145c7ced20b58fb96f7c6b6890 Author: Jing Liu Date: Wed Jan 5 04:35:23 2022 -0800 kvm: x86: Intercept #NM for saving IA32_XFD_ERR Guest IA32_XFD_ERR is generally modified in two places: - Set by CPU when #NM is triggered; - Cleared by guest in its #NM handler; Intercept #NM for the first case when a nonzero value is written to IA32_XFD. Nonzero indicates that the guest is willing to do dynamic fpstate expansion for certain xfeatures, thus KVM needs to manage and virtualize guest XFD_ERR properly. The vcpu exception bitmap is updated in XFD write emulation according to guest_fpu::xfd. Save the current XFD_ERR value to the guest_fpu container in the #NM VM-exit handler. This must be done with interrupt disabled, otherwise the unsaved MSR value may be clobbered by host activity. The saving operation is conducted conditionally only when guest_fpu:xfd includes a non-zero value. Doing so also avoids misread on a platform which doesn't support XFD but #NM is triggered due to L1 interception. Queueing #NM to the guest is postponed to handle_exception_nmi(). This goes through the nested_vmx check so a virtual vmexit is queued instead when #NM is triggered in L2 but L1 wants to intercept it. Restore the host value (always ZERO outside of the host #NM handler) before enabling interrupt. Restore the guest value from the guest_fpu container right before entering the guest (with interrupt disabled). Suggested-by: Thomas Gleixner Signed-off-by: Jing Liu Signed-off-by: Kevin Tian Signed-off-by: Yang Zhong Message-Id: <20220105123532.12586-13-yang.zhong@intel.com> Signed-off-by: Paolo Bonzini commit 1df4fd834e8e2c00973ac2003ad0e6feb8750b31 Author: Jing Liu Date: Wed Jan 5 04:35:22 2022 -0800 x86/fpu: Prepare xfd_err in struct fpu_guest When XFD causes an instruction to generate #NM, IA32_XFD_ERR contains information about which disabled state components are being accessed. The #NM handler is expected to check this information and then enable the state components by clearing IA32_XFD for the faulting task (if having permission). If the XFD_ERR value generated in guest is consumed/clobbered by the host before the guest itself doing so, it may lead to non-XFD-related #NM treated as XFD #NM in host (due to non-zero value in XFD_ERR), or XFD-related #NM treated as non-XFD #NM in guest (XFD_ERR cleared by the host #NM handler). Introduce a new field in fpu_guest to save the guest xfd_err value. KVM is expected to save guest xfd_err before interrupt is enabled and restore it right before entering the guest (with interrupt disabled). Signed-off-by: Jing Liu Signed-off-by: Kevin Tian Signed-off-by: Jing Liu Signed-off-by: Yang Zhong Message-Id: <20220105123532.12586-12-yang.zhong@intel.com> Signed-off-by: Paolo Bonzini commit 820a6ee944e74e57255ac2e90916ecdaade57b95 Author: Jing Liu Date: Wed Jan 5 04:35:21 2022 -0800 kvm: x86: Add emulation for IA32_XFD Intel's eXtended Feature Disable (XFD) feature allows the software to dynamically adjust fpstate buffer size for XSAVE features which have large state. Because guest fpstate has been expanded for all possible dynamic xstates at KVM_SET_CPUID2, emulation of the IA32_XFD MSR is straightforward. For write just call fpu_update_guest_xfd() to update the guest fpu container once all the sanity checks are passed. For read simply return the cached value in the container. Signed-off-by: Jing Liu Signed-off-by: Zeng Guang Signed-off-by: Wei Wang Signed-off-by: Jing Liu Signed-off-by: Yang Zhong Message-Id: <20220105123532.12586-11-yang.zhong@intel.com> Signed-off-by: Paolo Bonzini commit 8eb9a48ac1e86a8a59f7123b529d6e498fb1f163 Author: Kevin Tian Date: Wed Jan 5 04:35:20 2022 -0800 x86/fpu: Provide fpu_update_guest_xfd() for IA32_XFD emulation Guest XFD can be updated either in the emulation path or in the restore path. Provide a wrapper to update guest_fpu::fpstate::xfd. If the guest fpstate is currently in-use, also update the per-cpu xfd cache and the actual MSR. Signed-off-by: Kevin Tian Signed-off-by: Jing Liu Signed-off-by: Yang Zhong Message-Id: <20220105123532.12586-10-yang.zhong@intel.com> Signed-off-by: Paolo Bonzini commit 5ab2f45bba4894a0db4af8567da3efd6228dd010 Author: Jing Liu Date: Wed Jan 5 04:35:19 2022 -0800 kvm: x86: Enable dynamic xfeatures at KVM_SET_CPUID2 KVM can request fpstate expansion in two approaches: 1) When intercepting guest updates to XCR0 and XFD MSR; 2) Before vcpu runs (e.g. at KVM_SET_CPUID2); The first option doesn't waste memory for legacy guest if it doesn't support XFD. However doing so introduces more complexity and also imposes an order requirement in the restoring path, i.e. XCR0/XFD must be restored before XSTATE. Given that the agreement is to do the static approach. This is considered a better tradeoff though it does waste 8K memory for legacy guest if its CPUID includes dynamically-enabled xfeatures. Successful fpstate expansion requires userspace VMM to acquire guest xstate permissions before calling KVM_SET_CPUID2. Also take the chance to adjust the indent in kvm_set_cpuid(). Signed-off-by: Jing Liu Signed-off-by: Sean Christopherson Signed-off-by: Kevin Tian Signed-off-by: Yang Zhong Message-Id: <20220105123532.12586-9-yang.zhong@intel.com> Signed-off-by: Paolo Bonzini commit 0781d60f658e25fbad3b6e4261f54eb1cd3dc302 Author: Sean Christopherson Date: Wed Jan 5 04:35:18 2022 -0800 x86/fpu: Provide fpu_enable_guest_xfd_features() for KVM Provide a wrapper for expanding the guest fpstate buffer according to requested xfeatures. KVM wants to call this wrapper to manage any dynamic xstate used by the guest. Suggested-by: Sean Christopherson Signed-off-by: Sean Christopherson Signed-off-by: Kevin Tian Signed-off-by: Yang Zhong Reviewed-by: Paolo Bonzini Message-Id: <20220105123532.12586-8-yang.zhong@intel.com> [Remove unnecessary 32-bit check. - Paolo] Signed-off-by: Paolo Bonzini commit c270ce393dfd700e7510a4579568deeefba954fd Author: Thomas Gleixner Date: Wed Jan 5 04:35:17 2022 -0800 x86/fpu: Add guest support to xfd_enable_feature() Guest support for dynamically enabled FPU features requires a few modifications to the enablement function which is currently invoked from the #NM handler: 1) Use guest permissions and sizes for the update 2) Update fpu_guest state accordingly 3) Take into account that the enabling can be triggered either from a running guest via XSETBV and MSR_IA32_XFD write emulation or from a guest restore. In the latter case the guests fpstate is not the current tasks active fpstate. Split the function and implement the guest mechanics throughout the callchain. Signed-off-by: Thomas Gleixner Signed-off-by: Jing Liu Signed-off-by: Yang Zhong Message-Id: <20220105123532.12586-7-yang.zhong@intel.com> [Add 32-bit stub for __xfd_enable_feature. - Paolo] Signed-off-by: Paolo Bonzini commit b0237dad2d7f8820b5b415291431d8259e787470 Author: Jing Liu Date: Wed Jan 5 04:35:16 2022 -0800 x86/fpu: Make XFD initialization in __fpstate_reset() a function argument vCPU threads are different from native tasks regarding to the initial XFD value. While all native tasks follow a fixed value (init_fpstate::xfd) established by the FPU core at boot, vCPU threads need to obey the reset value (i.e. ZERO) defined by the specification, to meet the expectation of the guest. Let the caller supply an argument and adjust the host and guest related invocations accordingly. Signed-off-by: Jing Liu Signed-off-by: Yang Zhong Signed-off-by: Thomas Gleixner Signed-off-by: Jing Liu Signed-off-by: Yang Zhong Message-Id: <20220105123532.12586-6-yang.zhong@intel.com> Signed-off-by: Paolo Bonzini commit a97ac8cb24a3c3ad74794adb83717ef1605d1b47 Author: Dmitry Torokhov Date: Thu Jan 13 16:51:52 2022 -0800 module: fix signature check failures when using in-kernel decompression The new flag MODULE_INIT_COMPRESSED_FILE unintentionally trips check in module_sig_check(). The check was supposed to catch case when version info or magic was removed from a signed module, making signature invalid, but it was coded too broadly and was catching this new flag as well. Change the check to only test the 2 particular flags affecting signature validity. Fixes: b1ae6dc41eaa ("module: add in-kernel support for decompressing") Signed-off-by: Dmitry Torokhov Reviewed-by: Douglas Anderson Signed-off-by: Luis Chamberlain commit 91502a9a0b0d5252cf3f32ebd898823c2f5aadab Author: Alexander Sergeyev Date: Fri Jan 14 19:50:50 2022 +0300 ALSA: hda/realtek: fix speakers and micmute on HP 855 G8 There are several PCI ids associated with HP EliteBook 855 G8 Notebook PC. Commit 0e68c4b11f1e6 ("ALSA: hda/realtek: fix mute/micmute LEDs for HP 855 G8") covers 0x103c:0x8896, while this commit covers 0x103c:0x8895 which needs some additional work on top of the quirk from 0e68c4b11f1e6. Note that the device can boot up with working speakers and micmute LED without this patch, but the success rate would be quite low (order of 16 working boots across 709 boots) at least for the built-in drivers scenario. This also means that there are some timing issues during early boot and this patch is a workaround. With this patch applied speakers and headphones are consistenly working, as well as mute/micmute LEDs and the internal microphone. Signed-off-by: Alexander Sergeyev Link: https://lore.kernel.org/r/20220114165050.ouw2nknuspclynro@localhost.localdomain Signed-off-by: Takashi Iwai commit 94fd19752b28aa66c98e7991734af91dfc529f8f Author: Miklos Szeredi Date: Fri Jan 14 16:57:56 2022 +0100 ovl: don't fail copy up if no fileattr support on upper Christoph Fritz is reporting that failure to copy up fileattr when upper doesn't support fileattr or xattr results in a regression. Return success in these failure cases; this reverts overlayfs to the old behavior. Add a pr_warn_once() in these cases to still let the user know about the copy up failures. Reported-by: Christoph Fritz Fixes: 72db82115d2b ("ovl: copy up sync/noatime fileattr flags") Cc: # v5.15 Signed-off-by: Miklos Szeredi commit aed28b7a2d620cb5cd0c554cb889075c02e25e8e Author: Chuck Lever Date: Thu Jan 13 12:20:36 2022 -0500 SUNRPC: Don't dereference xprt->snd_task if it's a cookie Fixes: e26d9972720e ("SUNRPC: Clean up scheduling of autoclose") Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit c0f26167ddcf94fb94e80fcb20aaac7f7db13c1a Author: Chuck Lever Date: Thu Jan 13 12:20:30 2022 -0500 xprtrdma: Remove definitions of RPCDBG_FACILITY Deprecated. dprintk is no longer used in xprtrdma. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit c03061e7a210b4fe37440a1940fc198744a55ca4 Author: Chuck Lever Date: Thu Jan 13 12:20:23 2022 -0500 xprtrdma: Remove final dprintk call sites from xprtrdma Deprecated. This information is available via tracepoints. Signed-off-by: Chuck Lever Signed-off-by: Anna Schumaker commit 112450df61b7373529b0fe4c122ad13b89d80a8a Merge: 3bad80dab94a1 bf3c39f5da434 Author: Linus Torvalds Date: Fri Jan 14 16:19:38 2022 +0100 Merge branch 'i2c/for-mergewindow' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux Pull i2c updates from Wolfram Sang: "Mostly driver updates and refactorization. The removal of the XLR driver and the i801 refactoring stand out a little. In the core, we enabled async suspend/resume for I2C controllers and their clients. No issues were reported during the test phase in -next. We will see how this goes for mainline" * 'i2c/for-mergewindow' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (54 commits) i2c: sh_mobile: remove unneeded semicolon i2c: riic: Use platform_get_irq() to get the interrupt i2c: sh_mobile: Use platform_get_irq_optional() to get the interrupt i2c: bcm2835: Use platform_get_irq() to get the interrupt i2c: aspeed: Remove unused includes dt-bindings: i2c: aspeed: Drop stray '#interrupt-cells' i2c: sh_mobile: update to new DMAENGINE API when terminating i2c: rcar: update to new DMAENGINE API when terminating i2c: exynos5: Fix getting the optional clock i2c: designware-pci: Convert to use dev_err_probe() i2c: designware-pci: use __maybe_unused for PM functions i2c: designware-pci: Group MODULE_*() macros i2c: designware-pci: Add a note about struct dw_scl_sda_cfg usage i2c: designware-pci: Fix to change data types of hcnt and lcnt parameters i2c: designware: Do not complete i2c read without RX_FULL interrupt eeprom: at24: Add support for 24c1025 EEPROM dt-bindings: at24: add at24c1025 i2c: tegra: use i2c_timings for bus clock freq dt-bindings: at24: Rework special case compatible handling i2c: i801: Don't clear status flags twice in interrupt mode ... commit 3bad80dab94a16c9b7991105e3bffd5fe5957e9a Merge: 871bfa02d08d9 d47c7407b4c88 Author: Linus Torvalds Date: Fri Jan 14 16:02:28 2022 +0100 Merge tag 'char-misc-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull char/misc and other driver updates from Greg KH: "Here is the large set of char, misc, and other "small" driver subsystem changes for 5.17-rc1. Lots of different things are in here for char/misc drivers such as: - habanalabs driver updates - mei driver updates - lkdtm driver updates - vmw_vmci driver updates - android binder driver updates - other small char/misc driver updates Also smaller driver subsystems have also been updated, including: - fpga subsystem updates - iio subsystem updates - soundwire subsystem updates - extcon subsystem updates - gnss subsystem updates - phy subsystem updates - coresight subsystem updates - firmware subsystem updates - comedi subsystem updates - mhi subsystem updates - speakup subsystem updates - rapidio subsystem updates - spmi subsystem updates - virtual driver updates - counter subsystem updates Too many individual changes to summarize, the shortlog contains the full details. All of these have been in linux-next for a while with no reported issues" * tag 'char-misc-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (406 commits) counter: 104-quad-8: Fix use-after-free by quad8_irq_handler dt-bindings: mux: Document mux-states property dt-bindings: ti-serdes-mux: Add defines for J721S2 SoC counter: remove old and now unused registration API counter: ti-eqep: Convert to new counter registration counter: stm32-lptimer-cnt: Convert to new counter registration counter: stm32-timer-cnt: Convert to new counter registration counter: microchip-tcb-capture: Convert to new counter registration counter: ftm-quaddec: Convert to new counter registration counter: intel-qep: Convert to new counter registration counter: interrupt-cnt: Convert to new counter registration counter: 104-quad-8: Convert to new counter registration counter: Update documentation for new counter registration functions counter: Provide alternative counter registration functions counter: stm32-timer-cnt: Convert to counter_priv() wrapper counter: stm32-lptimer-cnt: Convert to counter_priv() wrapper counter: ti-eqep: Convert to counter_priv() wrapper counter: ftm-quaddec: Convert to counter_priv() wrapper counter: intel-qep: Convert to counter_priv() wrapper counter: microchip-tcb-capture: Convert to counter_priv() wrapper ... commit 4ee7e4a6c9b298da44029ed9ec8ed23ae49cc209 Author: Christoph Fritz Date: Wed Jan 12 19:33:21 2022 +0100 ovl: fix NULL pointer dereference in copy up warning This patch is fixing a NULL pointer dereference to get a recently introduced warning message working. Fixes: 5b0a414d06c3 ("ovl: fix filattr copy-up failure") Signed-off-by: Christoph Fritz Cc: # v5.15 Signed-off-by: Miklos Szeredi commit a6e62743621ea29bea461774c0bcc68e5de59068 Author: Thomas Richter Date: Wed Nov 24 10:03:43 2021 +0100 perf cputopo: Fix CPU topology reading on s/390 Commit fdf1e29b6118c18f ("perf expr: Add metric literals for topology.") fails on s390: # ./perf test -Fv 7 ... # FAILED tests/expr.c:173 #num_dies >= #num_packages ---- end ---- Simple expression parser: FAILED! # Investigating this issue leads to these functions: build_cpu_topology() +--> has_die_topology(void) { struct utsname uts; if (uname(&uts) < 0) return false; if (strncmp(uts.machine, "x86_64", 6)) return false; .... } which always returns false on s390. The caller build_cpu_topology() checks has_die_topology() return value. On false the the struct cpu_topology::die_cpu_list is not contructed and has zero entries. This leads to the failing comparison: #num_dies >= #num_packages. s390 of course has a positive number of packages. Fix this by adding s390 architecture to support CPU die list. Output after: # ./perf test -Fv 7 7: Simple expression parser : --- start --- division by zero syntax error ---- end ---- Simple expression parser: Ok # Fixes: fdf1e29b6118c18f ("perf expr: Add metric literals for topology.") Reviewed-by: Ian Rogers Signed-off-by: Thomas Richter Cc: Heiko Carstens Cc: Ian Rogers Cc: Sumanth Korikkar Cc: Sven Schnelle Cc: Vasily Gorbik Link: https://lore.kernel.org/r/20211124090343.9436-1-tmricht@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit e000ea0beffb5497425054b151369fe37a792ece Author: José Expósito Date: Wed Dec 8 18:11:13 2021 +0100 perf metricgroup: Fix use after free in metric__new() We shouldn't free() something that will be used in the next line, fix it. Fixes: b85a4d61d3022608 ("perf metric: Allow modifiers on metrics") Addresses-Coverity-ID: 1494000 Signed-off-by: José Expósito Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ian Rogers Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20211208171113.22089-1-jose.exposito89@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit 4efdddbce7c1329f00c458e85dcaf105aebdc0ed Merge: 820e690e4eb88 5eb877b282fec Author: Daniel Vetter Date: Fri Jan 14 15:42:27 2022 +0100 Merge tag 'amd-drm-next-5.17-2022-01-12' of https://gitlab.freedesktop.org/agd5f/linux into drm-next amd-drm-next-5.17-2022-01-12: amdgpu: - SR-IOV fixes - Suspend/resume fixes - Display fixes - DMCUB fixes - DP alt mode fixes - RAS fixes - UBSAN fix - Navy Flounder VCN fix - ttm resource manager cleanup - default_groups change for kobj_type - vkms fix - Aldebaran fixes amdkfd: - SDMA ECC interrupt fix - License clarification - Pointer check fix - DQM fixes for hawaii - default_groups change for kobj_type - Typo fixes Signed-off-by: Daniel Vetter From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20220113030537.5758-1-alexander.deucher@amd.com commit 820e690e4eb88eaee68bf0b2d89fa9597bc00a45 Merge: 71e4a7029045e 5d474cc501b90 Author: Daniel Vetter Date: Fri Jan 14 15:41:47 2022 +0100 Merge tag 'drm-misc-next-fixes-2022-01-14' of git://anongit.freedesktop.org/drm/drm-misc into drm-next * atomic helpers: Fix error messages * mipi-dbi: Fix buffer mapping Signed-off-by: Daniel Vetter From: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/YeGHu7qU92pjuQOn@linux-uq9g commit 99fc11bb5b6f19d2c3671d6cf38571cb3dedb472 Author: Ian Rogers Date: Thu Jan 13 22:51:05 2022 -0800 libperf tests: Update a use of the new cpumap API Fixes a build breakage. Fixes: 6d18804b963b78dc ("perf cpumap: Give CPUs their own type") Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: colin ian king Cc: Ian Rogers Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Shunsuke Nakamura Link: http://lore.kernel.org/lkml/20220114065105.1806542-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 46f57d2410150985f81da7cbbb5fdcda01d02ac2 Author: Ian Rogers Date: Thu Jan 13 22:48:22 2022 -0800 perf arm: Fix off-by-one directory path Relative path include works in the regular build due to -I paths but may fail in other situations. Fixes: 83869019c74cc2d0 ("perf arch: Support register names from all archs") Reviewed-by: German Gomez Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Alexandre Truong Cc: Athira Jajeev Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20220114064822.1806019-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit e652ab64e5846d3fe5ac2c0405d55d79ecc52c36 Author: Arnaldo Carvalho de Melo Date: Fri Aug 7 08:45:47 2020 -0300 tools arch x86: Sync the msr-index.h copy with the kernel sources To pick up the changes in: 89aa94b4a218339b ("x86/msr: Add AMD CPPC MSR definitions") Addressing these tools/perf build warnings: diff -u tools/arch/x86/include/asm/msr-index.h arch/x86/include/asm/msr-index.h Warning: Kernel ABI header at 'tools/arch/x86/include/asm/msr-index.h' differs from latest version at 'arch/x86/include/asm/msr-index.h' That makes the beautification scripts to pick some new entries: $ tools/perf/trace/beauty/tracepoints/x86_msr.sh > before $ cp arch/x86/include/asm/msr-index.h tools/arch/x86/include/asm/msr-index.h $ tools/perf/trace/beauty/tracepoints/x86_msr.sh > after $ diff -u before after --- before 2022-01-13 10:59:51.743416890 -0300 +++ after 2022-01-13 11:00:00.776644178 -0300 @@ -303,6 +303,11 @@ [0xc0010299 - x86_AMD_V_KVM_MSRs_offset] = "AMD_RAPL_POWER_UNIT", [0xc001029a - x86_AMD_V_KVM_MSRs_offset] = "AMD_CORE_ENERGY_STATUS", [0xc001029b - x86_AMD_V_KVM_MSRs_offset] = "AMD_PKG_ENERGY_STATUS", + [0xc00102b0 - x86_AMD_V_KVM_MSRs_offset] = "AMD_CPPC_CAP1", + [0xc00102b1 - x86_AMD_V_KVM_MSRs_offset] = "AMD_CPPC_ENABLE", + [0xc00102b2 - x86_AMD_V_KVM_MSRs_offset] = "AMD_CPPC_CAP2", + [0xc00102b3 - x86_AMD_V_KVM_MSRs_offset] = "AMD_CPPC_REQ", + [0xc00102b4 - x86_AMD_V_KVM_MSRs_offset] = "AMD_CPPC_STATUS", [0xc00102f0 - x86_AMD_V_KVM_MSRs_offset] = "AMD_PPIN_CTL", [0xc00102f1 - x86_AMD_V_KVM_MSRs_offset] = "AMD_PPIN", }; $ And this gets rebuilt: CC /tmp/build/perf/trace/beauty/tracepoints/x86_msr.o INSTALL trace_plugins LD /tmp/build/perf/trace/beauty/tracepoints/perf-in.o LD /tmp/build/perf/trace/beauty/perf-in.o LD /tmp/build/perf/perf-in.o LINK /tmp/build/perf/perf Now one can trace systemwide asking to see backtraces to where those MSRs are being read/written with: # perf trace -e msr:*_msr/max-stack=32/ --filter="msr>=AMD_CPPC_CAP1 && msr<=AMD_CPPC_STATUS" ^C# If we use -v (verbose mode) we can see what it does behind the scenes: # perf trace -v -e msr:*_msr/max-stack=32/ --filter="msr>=AMD_CPPC_CAP1 && msr<=AMD_CPPC_STATUS" New filter for msr:read_msr: (msr>=0xc00102b0 && msr<=0xc00102b4) && (common_pid != 2612102 && common_pid != 3841) New filter for msr:write_msr: (msr>=0xc00102b0 && msr<=0xc00102b4) && (common_pid != 2612102 && common_pid != 3841) ^C# Example with a frequent msr: # perf trace -v -e msr:*_msr/max-stack=32/ --filter="msr==IA32_SPEC_CTRL" --max-events 2 Using CPUID AuthenticAMD-25-21-0 0x48 New filter for msr:read_msr: (msr==0x48) && (common_pid != 2612129 && common_pid != 3841) 0x48 New filter for msr:write_msr: (msr==0x48) && (common_pid != 2612129 && common_pid != 3841) mmap size 528384B Looking at the vmlinux_path (8 entries long) symsrc__init: build id mismatch for vmlinux. Using /proc/kcore for kernel data Using /proc/kallsyms for symbols 0.000 Timer/2525383 msr:write_msr(msr: IA32_SPEC_CTRL, val: 6) do_trace_write_msr ([kernel.kallsyms]) do_trace_write_msr ([kernel.kallsyms]) __switch_to_xtra ([kernel.kallsyms]) __switch_to ([kernel.kallsyms]) __schedule ([kernel.kallsyms]) schedule ([kernel.kallsyms]) futex_wait_queue_me ([kernel.kallsyms]) futex_wait ([kernel.kallsyms]) do_futex ([kernel.kallsyms]) __x64_sys_futex ([kernel.kallsyms]) do_syscall_64 ([kernel.kallsyms]) entry_SYSCALL_64_after_hwframe ([kernel.kallsyms]) __futex_abstimed_wait_common64 (/usr/lib64/libpthread-2.33.so) 0.030 :0/0 msr:write_msr(msr: IA32_SPEC_CTRL, val: 2) do_trace_write_msr ([kernel.kallsyms]) do_trace_write_msr ([kernel.kallsyms]) __switch_to_xtra ([kernel.kallsyms]) __switch_to ([kernel.kallsyms]) __schedule ([kernel.kallsyms]) schedule_idle ([kernel.kallsyms]) do_idle ([kernel.kallsyms]) cpu_startup_entry ([kernel.kallsyms]) secondary_startup_64_no_verify ([kernel.kallsyms]) # Acked-by: Huang Rui Acked-by: Rafael J. Wysocki Cc: Adrian Hunter Cc: Ian Rogers Cc: Jiri Olsa Cc: Namhyung Kim Link: https://lore.kernel.org/all/YeA2PAvHV+uHRhLj@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 871bfa02d08d9c0ed981c50082b7afd367d3700b Merge: 29ec39fcf11e4 7f435e42fd6b6 Author: Linus Torvalds Date: Fri Jan 14 15:32:09 2022 +0100 Merge tag 'for-linus' of git://github.com/openrisc/linux Pull OpenRISC updates from Stafford Horne: "A few fixups and enhancements for OpenRISC: - Fix to add proper wrapper for clone3 to save callee saved regs - Cleanups for clone, fork and switch - Add support for common clk so OpenRISC and use more drivers" * tag 'for-linus' of git://github.com/openrisc/linux: openrisc: init: Add support for common clk openrisc: Add clone3 ABI wrapper openrisc: Use delay slot for clone and fork wrappers openrisc: Cleanup switch code and comments commit 29ec39fcf11e4583eb8d5174f756ea109c77cc44 Merge: 3fb561b1e0bf4 f1aa0e47c2926 Author: Linus Torvalds Date: Fri Jan 14 15:17:26 2022 +0100 Merge tag 'powerpc-5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc updates from Michael Ellerman: - Optimise radix KVM guest entry/exit by 2x on Power9/Power10. - Allow firmware to tell us whether to disable the entry and uaccess flushes on Power10 or later CPUs. - Add BPF_PROBE_MEM support for 32 and 64-bit BPF jits. - Several fixes and improvements to our hard lockup watchdog. - Activate HAVE_DYNAMIC_FTRACE_WITH_REGS on 32-bit. - Allow building the 64-bit Book3S kernel without hash MMU support, ie. Radix only. - Add KUAP (SMAP) support for 40x, 44x, 8xx, Book3E (64-bit). - Add new encodings for perf_mem_data_src.mem_hops field, and use them on Power10. - A series of small performance improvements to 64-bit interrupt entry. - Several commits fixing issues when building with the clang integrated assembler. - Many other small features and fixes. Thanks to Alan Modra, Alexey Kardashevskiy, Ammar Faizi, Anders Roxell, Arnd Bergmann, Athira Rajeev, Cédric Le Goater, Christophe JAILLET, Christophe Leroy, Christoph Hellwig, Daniel Axtens, David Yang, Erhard Furtner, Fabiano Rosas, Greg Kroah-Hartman, Guo Ren, Hari Bathini, Jason Wang, Joel Stanley, Julia Lawall, Kajol Jain, Kees Cook, Laurent Dufour, Madhavan Srinivasan, Mark Brown, Minghao Chi, Nageswara R Sastry, Naresh Kamboju, Nathan Chancellor, Nathan Lynch, Nicholas Piggin, Nick Child, Oliver O'Halloran, Peiwei Hu, Randy Dunlap, Ravi Bangoria, Rob Herring, Russell Currey, Sachin Sant, Sean Christopherson, Segher Boessenkool, Thadeu Lima de Souza Cascardo, Tyrel Datwyler, Xiang wangx, and Yang Guang. * tag 'powerpc-5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (240 commits) powerpc/xmon: Dump XIVE information for online-only processors. powerpc/opal: use default_groups in kobj_type powerpc/cacheinfo: use default_groups in kobj_type powerpc/sched: Remove unused TASK_SIZE_OF powerpc/xive: Add missing null check after calling kmalloc powerpc/floppy: Remove usage of the deprecated "pci-dma-compat.h" API selftests/powerpc: Add a test of sigreturning to an unaligned address powerpc/64s: Use EMIT_WARN_ENTRY for SRR debug warnings powerpc/64s: Mask NIP before checking against SRR0 powerpc/perf: Fix spelling of "its" powerpc/32: Fix boot failure with GCC latent entropy plugin powerpc/code-patching: Replace patch_instruction() by ppc_inst_write() in selftests powerpc/code-patching: Move code patching selftests in its own file powerpc/code-patching: Move instr_is_branch_{i/b}form() in code-patching.h powerpc/code-patching: Move patch_exception() outside code-patching.c powerpc/code-patching: Use test_trampoline for prefixed patch test powerpc/code-patching: Fix patch_branch() return on out-of-range failure powerpc/code-patching: Reorganise do_patch_instruction() to ease error handling powerpc/code-patching: Fix unmap_patch_area() error handling powerpc/code-patching: Fix error handling in do_patch_instruction() ... commit 71e4a7029045e3904e0e9242b4a7cd84d47b8fe5 Merge: ad783ff5a20f8 016017a195b86 Author: Daniel Vetter Date: Fri Jan 14 15:15:56 2022 +0100 Merge tag 'drm-misc-fixes-2022-01-14' of git://anongit.freedesktop.org/drm/drm-misc into drm-next Two DT bindings fixes for meson, a device refcounting fix for sun4i, a probe fix for vga16fb, a locking fix for the CMA dma-buf heap and a compilation fix for ttm. Signed-off-by: Daniel Vetter [danvet: I made sure I have exactly the same conflict resolution as Linus in 8d0749b4f83b ("Merge tag 'drm-next-2022-01-07' of git://anongit.freedesktop.org/drm/drm") to avoid further conflict fun. From: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220114125454.zs46ny52lrxk3ljz@houat commit 094d00f8ca58c5d29b25e23b4daaed1ff1f13b41 Author: Marc Zyngier Date: Fri Jan 14 08:57:58 2022 +0000 KVM: arm64: pkvm: Use the mm_ops indirection for cache maintenance CMOs issued from EL2 cannot directly use the kernel helpers, as EL2 doesn't have a mapping of the guest pages. Oops. Instead, use the mm_ops indirection to use helpers that will perform a mapping at EL2 and allow the CMO to be effective. Fixes: 25aa28691bb9 ("KVM: arm64: Move guest CMOs to the fault handlers") Reviewed-by: Quentin Perret Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220114125038.1336965-1-maz@kernel.org commit 3fb561b1e0bf4c75bc5f4d799845b08fa5ab3853 Merge: 3ceff4ea07410 d3115128bdafb Author: Linus Torvalds Date: Fri Jan 14 15:08:36 2022 +0100 Merge tag 'mips_5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux Pull MIPS updates from Thomas Bogendoerfer: - add support for more BCM47XX based devices - add MIPS support for brcmstb PCIe controller - add Loongson 2K1000 reset driver - remove board support for rbtx4938/rbtx4939 - remove support for TX4939 SoCs - fixes and cleanups * tag 'mips_5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: (59 commits) MIPS: ath79: drop _machine_restart again PCI: brcmstb: Augment driver for MIPs SOCs MIPS: bmips: Remove obsolete DMA mapping support MIPS: bmips: Add support PCIe controller device nodes dt-bindings: PCI: Add compatible string for Brcmstb 74[23]5 MIPs SOCs MIPS: compressed: Fix build with ZSTD compression MIPS: BCM47XX: Add support for Netgear WN2500RP v1 & v2 MIPS: BCM47XX: Add support for Netgear R6300 v1 MIPS: BCM47XX: Add LEDs and buttons for Asus RTN-10U MIPS: BCM47XX: Add board entry for Linksys WRT320N v1 MIPS: BCM47XX: Define Linksys WRT310N V2 buttons MIPS: Remove duplicated include in local.h MIPS: retire "asm/llsc.h" MIPS: rework local_t operation on MIPS64 MIPS: fix local_{add,sub}_return on MIPS64 mips/pci: remove redundant ret variable MIPS: Loongson64: Add missing of_node_put() in ls2k_reset_init() MIPS: new Kconfig option ZBOOT_LOAD_ADDRESS MIPS: enable both vmlinux.gz.itb and vmlinuz for generic MIPS: signal: Return immediately if call fails ... commit 3ceff4ea07410763d5d4cccd60349bf7691e7e61 Merge: e1a7aa25ff456 081c73701ef0c Author: Linus Torvalds Date: Fri Jan 14 14:55:38 2022 +0100 Merge tag 'sound-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound updates from Takashi Iwai: "It's a relatively calm development cycle, but still lots of updates in the driver side like Intel SOF. Below are some highlights: ALSA / ASoC core: - A new kselftest for ALSA control API - PCM NO_REWINDS support - Potential race fixes around control removals - Unify x86 SG-buffer memory allocation code - Cleanups and race fixes for ASoC DPCM locking ASoC: - Refinements and cleanups around the delay() APIs - Wider use of dev_err_probe(). - Continuing cleanups and improvements to the SOF code - Support for pin switches in simple-card derived cards - Support for AMD Renoir ACP, Asahi Kasei Microdevices AKM4375, Intel systems using NAU8825 and MAX98390, Mediatek MT8915, nVidia Tegra20 S/PDIF, Qualcomm systems using ALC5682I-VS and Texas Instruments TLV320ADC3xxx HD-audio / USB-audio: - Fix deadlock at HD-audio codec unbinding - Fixes for Tegra194 HD-audio, new HDA support for CS35L41 codec - Quirks for Lenovo and HP machines, Gigabyte mobo, Bose device Misc: - Fix virmidi drain behavior Note that the merge of CS35L41 codec support is still half-baked, and at least one ACPI change is missing. Although this won't hinder the kernel build itself, we're going to catch up before RC1" * tag 'sound-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (415 commits) ALSA: hda: intel-dsp-config: reorder the config table ALSA: hda: intel-dsp-config: add JasperLake support ALSA: hda: cs35l41: fix double free on error in probe() ALSA: hda: Fix dependencies of CS35L41 on SPI/I2C buses ALSA: hda: Fix dependency on ASoC cs35l41 codec ASoC: cs35l41: Add support for hibernate memory retention mode ASoC: cs35l41: Update handling of test key registers ALSA: intel_hdmi: Check for error num after setting mask ASoC: wcd9335: Keep a RX port value for each SLIM RX mux ASoC: amd: acp: acp-mach: Change default RT1019 amp dev id ALSA: virmidi: Remove duplicated code ALSA: seq: virmidi: Add a drain operation ASoC: topology: Fix typo ASoC: fsl_asrc: refine the check of available clock divider ASoC: Intel: bytcr_rt5640: Add support for external GPIO jack-detect ASoC: Intel: bytcr_rt5640: Support retrieving the codec IRQ from the AMCR0F28 ACPI dev ASoC: rt5640: Add support for boards with an external jack-detect GPIO ASoC: rt5640: Allow snd_soc_component_set_jack() to override the codec IRQ ASoC: rt5640: Change jack_work to a delayed_work ASoC: rt5640: Fix possible NULL pointer deref on resume ... commit 791f3465c4afde02d7f16cf7424ca87070b69396 Author: Pavel Begunkov Date: Fri Jan 14 11:59:10 2022 +0000 io_uring: fix UAF due to missing POLLFREE handling Fixes a problem described in 50252e4b5e989 ("aio: fix use-after-free due to missing POLLFREE handling") and copies the approach used there. In short, we have to forcibly eject a poll entry when we meet POLLFREE. We can't rely on io_poll_get_ownership() as can't wait for potentially running tw handlers, so we use the fact that wqs are RCU freed. See Eric's patch and comments for more details. Reported-by: Eric Biggers Link: https://lore.kernel.org/r/20211209010455.42744-6-ebiggers@kernel.org Reported-and-tested-by: syzbot+5426c7ed6868c705ca14@syzkaller.appspotmail.com Fixes: 221c5eb233823 ("io_uring: add support for IORING_OP_POLL") Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/4ed56b6f548f7ea337603a82315750449412748a.1642161259.git.asml.silence@gmail.com [axboe: drop non-functional change from patch] Signed-off-by: Jens Axboe commit 5d474cc501b90b82c182b5d00439eb6790a82e21 Author: Thomas Zimmermann Date: Tue Jan 11 14:26:34 2022 +0100 drm/mipi-dbi: Fix source-buffer address in mipi_dbi_buf_copy Set the source-buffer address after mapping the buffer into the kernel's address space. Makes MIPI DBI helpers work again. Signed-off-by: Thomas Zimmermann Fixes: c47160d8edcd ("drm/mipi-dbi: Remove dependency on GEM CMA helper library") Reviewed-by: Noralf Trønnes Reported-by: Noralf Trønnes Cc: Thomas Zimmermann Cc: Daniel Vetter Cc: Maarten Lankhorst Cc: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220111132634.18302-1-tzimmermann@suse.de (cherry picked from commit 9d31993451f6bb4059a9b9eec4856b2225e36df0) Signed-off-by: Thomas Zimmermann commit e1a7aa25ff45636a6c1930bf2430c8b802e93d9c Merge: fb3b0673b7d5b c77b1f8a8faee Author: Linus Torvalds Date: Fri Jan 14 14:37:34 2022 +0100 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, pm80xx, lpfc, mpi3mr, mpt3sas, hisi_sas, libsas) and minor updates and bug fixes. The most impactful change is likely the switch from GFP_DMA to GFP_KERNEL in a bunch of drivers, but even that shouldn't affect too many people" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (121 commits) scsi: mpi3mr: Bump driver version to 8.0.0.61.0 scsi: mpi3mr: Fixes around reply request queues scsi: mpi3mr: Enhanced Task Management Support Reply handling scsi: mpi3mr: Use TM response codes from MPI3 headers scsi: mpi3mr: Add io_uring interface support in I/O-polled mode scsi: mpi3mr: Print cable mngnt and temp threshold events scsi: mpi3mr: Support Prepare for Reset event scsi: mpi3mr: Add Event acknowledgment logic scsi: mpi3mr: Gracefully handle online FW update operation scsi: mpi3mr: Detect async reset that occurred in firmware scsi: mpi3mr: Add IOC reinit function scsi: mpi3mr: Handle offline FW activation in graceful manner scsi: mpi3mr: Code refactor of IOC init - part2 scsi: mpi3mr: Code refactor of IOC init - part1 scsi: mpi3mr: Fault IOC when internal command gets timeout scsi: mpi3mr: Display IOC firmware package version scsi: mpi3mr: Handle unaligned PLL in unmap cmnds scsi: mpi3mr: Increase internal cmnds timeout to 60s scsi: mpi3mr: Do access status validation before adding devices scsi: mpi3mr: Add support for PCIe Managed Switch SES device ... commit bd672b7559efcd3ae3faf0b0e3846e30983e8ace Author: Claudio Suarez Date: Thu Dec 2 10:51:12 2021 +0100 drm: fix error found in some cases after the patch d1af5cd86997 The patch d1af5cd86997 ("drm: get rid of DRM_DEBUG_* log calls in drm core, files drm_a*.c") fails when the drm_device cannot be found in the parameter plane_state->crtc. Fix it using plane_state->plane. Reported-by: kernel test robot Fixes: 6e22dc358377 ("drm: get rid of DRM_DEBUG_* log calls in drm core, files drm_a*.c") Signed-off-by: Claudio Suarez [danvet: fix Fixes: line] Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/YaiXEARd8z2C463h@gineta.localdomain (cherry picked from commit 521d459b1935628a7caa0753429f880dae2dbfc9) Signed-off-by: Thomas Zimmermann commit ad783ff5a20f851c6d9bca03d12d44f98f494af7 Merge: 8f18a987ca761 69e630016ef4e Author: Daniel Vetter Date: Fri Jan 14 13:39:50 2022 +0100 Merge tag 'drm-misc-next-fixes-2022-01-13' of git://anongit.freedesktop.org/drm/drm-misc into drm-next * Fix use of CRTC state's active vs enable in atomic helper Signed-off-by: Daniel Vetter From: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/Yd/i/zj9vEHisSSB@linux-uq9g commit b2dfc3fe73b5b305b13467e39386f77133590ea8 Merge: 50a0f3f55e382 f5bdb34bf0c93 Author: Petr Mladek Date: Fri Jan 14 13:36:32 2022 +0100 Merge branch 'for-5.17/kallsyms' into for-linus commit 8f18a987ca761583a09d8e41f9938f61480deca3 Merge: cb6846fbb83b5 6ef295e342974 Author: Daniel Vetter Date: Fri Jan 14 13:34:39 2022 +0100 Merge tag 'drm-intel-next-fixes-2022-01-13' of git://anongit.freedesktop.org/drm/drm-intel into drm-next - Hold runtime PM wakelock during PXP unbind (Juston Li) - Three fixes for the TTM backend fault handling (Matthew Auld) - Make sure to unmap when purging in the TTM backend (Matthew Auld) Signed-off-by: Daniel Vetter From: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/Yd/xzyCM87rfrwQT@tursulin-mobl2 commit 016017a195b86d9761e91cb052438bf71207a12f Author: Johannes Berg Date: Mon Dec 20 11:15:22 2021 +0100 drm/ttm: fix compilation on ARCH=um Even if it's probably not really useful, it can get selected by e.g. randconfig builds, and then failing to compile is an annoyance. Unfortunately, it's hard to fix in Kconfig, since DRM_TTM is selected by many things that don't really depend on any specific architecture, and just depend on PCI (which is indeed now available in ARCH=um via simulation/emulation). Fix this in the code instead by just ifdef'ing the relevant two lines that depend on "real X86". Reported-by: Geert Uytterhoeven Signed-off-by: Johannes Berg Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20211220111519.a4c8c6eff702.Ie4cf4e68698f6a9f546b83379bc52c266504424f@changeid commit d90d0c175cf2982789d336dda928c0f69d3e8a9d Author: Kai-Heng Feng Date: Fri Jan 14 15:14:30 2022 +0800 net: stmmac: Fix "Unbalanced pm_runtime_enable!" warning If the device is PCI based like intel-eth-pci, pm_runtime_enable() is already called by pci_pm_init(). So only pm_runtime_enable() when it's not already enabled. Signed-off-by: Kai-Heng Feng Signed-off-by: David S. Miller commit 99218cbf81bf21355a3de61cd46a706d36e900e6 Author: Miaoqian Lin Date: Fri Jan 14 06:57:24 2022 +0000 lib82596: Fix IRQ check in sni_82596_probe platform_get_irq() returns negative error number instead 0 on failure. And the doc of platform_get_irq() provides a usage example: int irq = platform_get_irq(pdev, 0); if (irq < 0) return irq; Fix the check of return value to catch errors correctly. Fixes: 115978859272 ("i825xx: Move the Intel 82586/82593/82596 based drivers") Signed-off-by: Miaoqian Lin Signed-off-by: David S. Miller commit ea938248557a52e231a31f338eac4baee36a8626 Author: Michael Ellerman Date: Fri Jan 14 14:13:16 2022 +1100 net: apple: bmac: Fix build since dev_addr constification Since commit adeef3e32146 ("net: constify netdev->dev_addr") the bmac driver no longer builds with the following errors (pmac32_defconfig): linux/drivers/net/ethernet/apple/bmac.c: In function ‘bmac_probe’: linux/drivers/net/ethernet/apple/bmac.c:1287:20: error: assignment of read-only location ‘*(dev->dev_addr + (sizetype)j)’ 1287 | dev->dev_addr[j] = rev ? bitrev8(addr[j]): addr[j]; | ^ Fix it by making the modifications to a local macaddr variable and then passing that to eth_hw_addr_set(). We don't use the existing addr variable because the bitrev8() would mutate it, but it is already used unreversed later in the function. Signed-off-by: Michael Ellerman Reviewed-by: Jakub Kicinski Signed-off-by: David S. Miller commit 6c8dc12cd925e5fa8c152633338b2b35c4c89258 Author: Michael Ellerman Date: Fri Jan 14 14:12:52 2022 +1100 net: apple: mace: Fix build since dev_addr constification Since commit adeef3e32146 ("net: constify netdev->dev_addr") the mace driver no longer builds with various errors (pmac32_defconfig): linux/drivers/net/ethernet/apple/mace.c: In function ‘mace_probe’: linux/drivers/net/ethernet/apple/mace.c:170:20: error: assignment of read-only location ‘*(dev->dev_addr + (sizetype)j)’ 170 | dev->dev_addr[j] = rev ? bitrev8(addr[j]): addr[j]; | ^ linux/drivers/net/ethernet/apple/mace.c: In function ‘mace_reset’: linux/drivers/net/ethernet/apple/mace.c:349:32: warning: passing argument 2 of ‘__mace_set_address’ discards ‘const’ qualifier from pointer target type 349 | __mace_set_address(dev, dev->dev_addr); | ~~~^~~~~~~~~~ linux/drivers/net/ethernet/apple/mace.c:93:62: note: expected ‘void *’ but argument is of type ‘const unsigned char *’ 93 | static void __mace_set_address(struct net_device *dev, void *addr); | ~~~~~~^~~~ linux/drivers/net/ethernet/apple/mace.c: In function ‘__mace_set_address’: linux/drivers/net/ethernet/apple/mace.c:388:36: error: assignment of read-only location ‘*(dev->dev_addr + (sizetype)i)’ 388 | out_8(&mb->padr, dev->dev_addr[i] = p[i]); | ^ Fix it by making the modifications to a local macaddr variable and then passing that to eth_hw_addr_set(), as well as adding some missing const qualifiers. Signed-off-by: Michael Ellerman Reviewed-by: Jakub Kicinski Signed-off-by: David S. Miller commit 2255634100bffe0abc1a300f20aee26980891ba4 Author: Li Zhijian Date: Fri Jan 14 11:02:46 2022 +0800 kselftests/net: list all available tests in usage() So that users can run/query them easily. $ ./fcnal-test.sh -h usage: fcnal-test.sh OPTS -4 IPv4 tests only -6 IPv6 tests only -t Test name/set to run -p Pause on fail -P Pause after each test -v Be verbose Tests: ipv4_ping ipv4_tcp ipv4_udp ipv4_bind ipv4_runtime ipv4_netfilter ipv6_ping ipv6_tcp ipv6_udp ipv6_bind ipv6_runtime ipv6_netfilter use_cases Suggested-by: David Ahern Signed-off-by: Li Zhijian Signed-off-by: David S. Miller commit 0bf3885324a8599e3af4c7379b8d4f621c9bbffa Author: Markus Reichl Date: Thu Jan 13 21:01:11 2022 +0100 net: usb: Correct reset handling of smsc95xx On boards with LAN9514 and no preconfigured MAC address we don't get an ip address from DHCP after commit a049a30fc27c ("net: usb: Correct PHY handling of smsc95xx") anymore. Adding an explicit reset before starting the phy fixes the issue. [1] https://lore.kernel.org/netdev/199eebbd6b97f52b9119c9fa4fd8504f8a34de18.camel@collabora.com/ From: Gabriel Hojda Fixes: a049a30fc27c ("net: usb: Correct PHY handling of smsc95xx") Signed-off-by: Gabriel Hojda Signed-off-by: Markus Reichl Tested-by: Alexander Stein Signed-off-by: David S. Miller commit 9deb48b53e7f4056c2eaa2dc2ee3338df619e4f6 Author: Sergey Shtylyov Date: Thu Jan 13 22:46:07 2022 +0300 bcmgenet: add WOL IRQ check The driver neglects to check the result of platform_get_irq_optional()'s call and blithely passes the negative error codes to devm_request_irq() (which takes *unsigned* IRQ #), causing it to fail with -EINVAL. Stop calling devm_request_irq() with the invalid IRQ #s. Fixes: 8562056f267d ("net: bcmgenet: request Wake-on-LAN interrupt") Signed-off-by: Sergey Shtylyov Acked-by: Florian Fainelli Signed-off-by: David S. Miller commit e24aeff6db738be7ce24999a41e91299b5fe14be Author: Stephen Boyd Date: Fri Jan 7 15:23:05 2022 -0800 HID: vivaldi: Minor cleanups Perform some minor cleanups on this driver. Include header files for struct definitions that are used, drop a forward declaration that isn't useful, and mark a sysfs attribute static as it isn't used outside this file. Cc: Sean O'Brien Cc: Ting Shen Signed-off-by: Stephen Boyd Signed-off-by: Jiri Kosina commit f37c3bbc635994eda203a6da4ba0f9d05165a8d6 Author: Steven Rostedt Date: Thu Jan 13 20:08:40 2022 -0500 tracing: Add ustring operation to filtering string pointers Since referencing user space pointers is special, if the user wants to filter on a field that is a pointer to user space, then they need to specify it. Add a ".ustring" attribute to the field name for filters to state that the field is pointing to user space such that the kernel can take the appropriate action to read that pointer. Link: https://lore.kernel.org/all/yt9d8rvmt2jq.fsf@linux.ibm.com/ Fixes: 77360f9bbc7e ("tracing: Add test for user space strings when filtering on string pointers") Tested-by: Sven Schnelle Signed-off-by: Steven Rostedt commit 3fe6acd4dc922237b30e55473c9349c6ce0690f3 Author: Dmitry Torokhov Date: Fri Jan 7 12:09:36 2022 -0800 HID: vivaldi: fix handling devices not using numbered reports Unfortunately details of USB HID transport bled into HID core and handling of numbered/unnumbered reports is quite a mess, with hid_report_len() calculating the length according to USB rules, and hid_hw_raw_request() adding report ID to the buffer for both numbered and unnumbered reports. Untangling it all requres a lot of changes in HID, so for now let's handle this in the driver. [jkosina@suse.cz: microoptimize field->report->id to report->id] Fixes: 14c9c014babe ("HID: add vivaldi HID driver") Signed-off-by: Dmitry Torokhov Tested-by: Stephen Boyd # CoachZ Signed-off-by: Jiri Kosina commit 237fe8885a3fdab169bf670790c9f40046af45d3 Author: Colin Ian King Date: Wed Jan 12 23:47:41 2022 +0000 ata: pata_ali: remove redundant return statement A return statement is unnecessarily complicated, currently value in variable mask is bitwise-masked and the variable is being updated and then returned. Just updating the mask is all that is required as the following statement is a return. Signed-off-by: Colin Ian King Signed-off-by: Damien Le Moal commit a17ab7aba5df4135ef77d7f6d7105e1ea414936f Author: Paul Menzel Date: Wed Jan 5 16:36:18 2022 +0100 ata: ahci: Add support for AMD A85 FCH (Hudson D4) Add support for the AMD A85 FCH (Hudson D4) AHCI adapter. Since this adapter does not require the default 200 ms debounce delay in sata_link_resume(), create a new board board_ahci_no_debounce_delay with the link flag ATA_LFLAG_NO_DEBOUNCE_DELAY, and, for now, configure the AMD A85 FCH (Hudson D4) to use it. On the ASUS F2A85-M PRO it reduces the Linux kernel boot time by the expected 200 ms from 787 ms to 585 ms. Signed-off-by: Paul Menzel Cc: Tejun Heo Signed-off-by: Damien Le Moal commit b9ba367c513dbc165dd6c01266a59db4be2a3564 Author: Paul Menzel Date: Wed Jan 5 16:36:16 2022 +0100 ata: libata: Rename link flag ATA_LFLAG_NO_DB_DELAY Rename the link flag ATA_LFLAG_NO_DB_DELAY to ATA_LFLAG_NO_DEBOUNCE_DELAY. The new name is longer, but clearer. Signed-off-by: Paul Menzel Signed-off-by: Damien Le Moal commit 84eac327af543f03172085d5ef9f98ea25a51191 Author: Wenchao Hao Date: Wed Jan 5 19:13:54 2022 -0500 ata: libata-scsi: simplify __ata_scsi_queuecmd() This patch cleans up the code of __ata_scsi_queuecmd(). Since each branch of the "if" condition check that scmd->cmd_len is not zero, move this check out of the "if" to simplify the conditions being checked in the "else" branch. While at it, avoid the if-else-if-else structure using if-else if structure and remove the redundant rc local variable. This patch does not change the function logic. Signed-off-by: Wenchao Hao Signed-off-by: Damien Le Moal commit db6a3f47cecc3da00d13fc68738aaa96e31f7c04 Author: Lad Prabhakar Date: Wed Jan 5 18:17:21 2022 +0000 ata: pata_of_platform: Use platform_get_irq_optional() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq_optional(). Note the code does not set the IRQ flags as this is handled automatically for DT. Signed-off-by: Lad Prabhakar Reviewed-by: Andy Shevchenko Signed-off-by: Damien Le Moal commit b6a64a860e1319dfbabc55b351c8b6583bd67413 Author: Damien Le Moal Date: Tue Jan 4 15:48:17 2022 +0900 ata: pata_samsung_cf: add compile test support Add Kconfig dependendy on COMPILE_TEST to allow compile tests with configs that do not enable SAMSUNG_DEV_IDE. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke commit 7767c73a3565ae975e7f1de7900815be4267cc3c Author: Damien Le Moal Date: Tue Jan 4 15:35:57 2022 +0900 ata: pata_pxa: add compile test support Add Kconfig dependendy on COMPILE_TEST to allow compile tests with configs that do not enable ARCH_PXA. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke commit 7dc3c053bddf735b305bacfc620aa5cf6874ffe6 Author: Damien Le Moal Date: Tue Jan 4 15:31:34 2022 +0900 ata: pata_imx: add compile test support Add Kconfig dependendy on COMPILE_TEST to allow compile tests with configs that do not enable ARCH_MXC. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke commit 2aa566716f43776aee1cb46b3bb40af67b080d06 Author: Damien Le Moal Date: Tue Jan 4 15:24:52 2022 +0900 ata: pata_ftide010: add compile test support Add Kconfig dependendy on COMPILE_TEST to allow compile tests with configs that do not enable ARM. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke commit dc5d7b3cfd7833d41c2e2fad5fd5af5c95d05d04 Author: Damien Le Moal Date: Tue Jan 4 15:19:30 2022 +0900 ata: pata_cs5535: add compile test support Add Kconfig dependendy on X86_64 && COMPILE_TEST to allow compile tests with configs that do not have X86_32 enabled on X86_64 hosts. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke commit 9c2fd3fb43bdf2641093fe287d1944ec3c88eeda Author: Minghao Chi Date: Tue Jan 4 11:25:45 2022 +0000 ata: pata_octeon_cf: remove redundant val variable Return value from DIV_ROUND_UP() directly instead of taking this in another redundant variable. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: CGEL ZTE Signed-off-by: Damien Le Moal commit 0561e514c944da874ccdfbe2922f71b4c333c7e1 Author: Damien Le Moal Date: Tue Jan 4 17:54:18 2022 +0900 ata: fix read_id() ata port operation interface Drivers that need to tweak a device IDENTIFY data implement the read_id() port operation. The IDENTIFY data buffer is passed as an argument to the read_id() operation for drivers to use. However, when this operation is called, the IDENTIFY data is not yet converted to CPU endian and contains le16 words. Change the interface of the read_id operation to pass a __le16 * pointer to the IDENTIFY data buffer to clarify the buffer endianness. Fix the pata_netcell, pata_it821x, ahci_xgene, ahci_ceva and ahci_brcm drivers implementation of this operation and modify the code to corretly deal with identify data words manipulation to avoid sparse warnings such as: drivers/ata/ahci_xgene.c:262:33: warning: invalid assignment: &= drivers/ata/ahci_xgene.c:262:33: left side has type unsigned short drivers/ata/ahci_xgene.c:262:33: right side has type restricted __le16 Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke commit 2bce69072a0db6c3444650023c6f35bfd7a23d29 Author: Damien Le Moal Date: Tue Jan 4 17:49:54 2022 +0900 ata: ahci_xgene: use correct type for port mmio address Sparse complains about an incorrect type for port_mmio pointer variables: drivers/ata/ahci_xgene.c:196:41: warning: incorrect type in initializer (different address spaces) drivers/ata/ahci_xgene.c:196:41: expected void *port_mmio drivers/ata/ahci_xgene.c:196:41: got void [noderef] __iomem * Fix this by declaring port_mmio as "void __iomem *" instead of "void *". Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke commit f8bc938ee6c60ec862fb5311789b6e277555f0b0 Author: Damien Le Moal Date: Tue Jan 4 19:04:49 2022 +0900 ata: sata_fsl: fix cmdhdr_tbl_entry and prde struct definitions The fields of the cmdhdr_tbl_entry structure all store __le32 values, and so are the dba and ddc_and_ext fields of the prde structure. Define these fields using the __le32 type to avoid sparse warnings about incorrect type in assignment. The debug message in sata_fsl_setup_cmd_hdr_entry() is changed to display the correct values of the cmdhdr_tbl_entry fields on big endian systems. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke commit e5b48ee30aec1fe6dff05e36b22e886c665b4736 Author: Damien Le Moal Date: Tue Jan 4 16:14:46 2022 +0900 ata: sata_fsl: fix scsi host initialization When compiling with W=1, the sata_fsl driver compilation throws the warning: drivers/ata/sata_fsl.c:1385:22: error: initialized field overwritten [-Werror=override-init] 1385 | .can_queue = SATA_FSL_QUEUE_DEPTH, This is due to the driver scsi host template initialization overwriting the can_queue field that is already set using the ATA_NCQ_SHT() initializer macro, resulting in the same field being initialized twice in the host template declaration. To remove this warning, introduce the ATA_SUBBASE_SHT_QD() and ATA_NCQ_SHT_QD() initialization macros to allow specifying a queue depth different from the default ATA_DEF_QUEUE using an additional argument to the macro. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke commit a3d11c275b647b5b56b907011b432e00f7ddb683 Author: Damien Le Moal Date: Tue Jan 4 15:17:42 2022 +0900 ata: pata_bk3710: add compile test support Add Kconfig dependendy on COMPILE_TEST to allow compile tests with configs that do not enable ARCH_DAVINCI. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke commit a33a348d0aca38107c435eef20c449cf13dd9447 Author: Damien Le Moal Date: Tue Jan 4 15:11:15 2022 +0900 ata: ahci_seattle: add compile test support Add Kconfig dependendy on COMPILE_TEST to allow compile tests with configs that do not enable ARCH_SEATTLE. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke commit b7c9b00fb050c6b3fea6e32f1adbe0194296eb1f Author: Damien Le Moal Date: Tue Jan 4 15:09:23 2022 +0900 ata: ahci_xgene: add compile test support Add Kconfig dependendy on COMPILE_TEST to allow compile tests with configs that do not enable PHY_XGENE. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke commit 3d98cbf7096ea50bbb4256c7781555bb69a07e52 Author: Damien Le Moal Date: Tue Jan 4 15:08:01 2022 +0900 ata: ahci_tegra: add compile test support Add Kconfig dependendy on COMPILE_TEST to allow compile tests with configs that do not enable ARCH_TEGRA. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke commit c05b911afffa6a1842dd3bb9d54a8db178722e40 Author: Damien Le Moal Date: Tue Jan 4 15:06:12 2022 +0900 ata: ahci_sunxi: add compile test support Add Kconfig dependendy on COMPILE_TEST to allow compile tests with configs that do not enable ARCH_SUNXI. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke commit 368c7edc15e5e505ab56d6caad60fd11ee2bc428 Author: Damien Le Moal Date: Tue Jan 4 15:01:01 2022 +0900 ata: ahci_mvebu: add compile test support Add Kconfig dependendy on COMPILE_TEST to allow compile tests with configs that do not enable ARCH_MVEBU. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke commit 28a53d3160acd7e44a39a146da20e3e672fb0d96 Author: Damien Le Moal Date: Tue Jan 4 14:59:00 2022 +0900 ata: ahci_mtk: add compile test support Add Kconfig dependendy on COMPILE_TEST to allow compile tests with configs that do not enable ARCH_MEDIATEK. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke commit 5dce5904e3b9bc11d9635dd3458c7ff32caebb59 Author: Daniel Bristot de Oliveira Date: Fri Dec 10 19:11:33 2021 +0100 rtla: Add rtla timerlat hist documentation Man page for rtla timerlat hist mode. Link: https://lkml.kernel.org/r/4a184003fdb81e23be3fe5ec882b1c89d5a95458.1639158831.git.bristot@kernel.org Cc: Tao Zhou Cc: Ingo Molnar Cc: Tom Zanussi Cc: Masami Hiramatsu Cc: Juri Lelli Cc: Clark Williams Cc: John Kacur Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Sebastian Andrzej Siewior Cc: Daniel Bristot de Oliveira Cc: linux-rt-users@vger.kernel.org Cc: linux-trace-devel@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt commit df337d014b573fe567cd190753a4f5fa69281870 Author: Daniel Bristot de Oliveira Date: Fri Dec 10 19:11:32 2021 +0100 rtla: Add rtla timerlat top documentation Man page for rtla timerlat top mode. Link: https://lkml.kernel.org/r/58c3d6212e6c6f1f012deb2e998dd082da92075f.1639158831.git.bristot@kernel.org Cc: Tao Zhou Cc: Ingo Molnar Cc: Tom Zanussi Cc: Masami Hiramatsu Cc: Juri Lelli Cc: Clark Williams Cc: John Kacur Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Sebastian Andrzej Siewior Cc: Daniel Bristot de Oliveira Cc: linux-rt-users@vger.kernel.org Cc: linux-trace-devel@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt commit 29380d4055e524de918c76a861df17d14a4b7224 Author: Daniel Bristot de Oliveira Date: Fri Dec 10 19:11:31 2021 +0100 rtla: Add rtla timerlat documentation Man page for rtla timerlat tool. Link: https://lkml.kernel.org/r/78678b8d024bf5a3a79f831ac9441b96e8d2f56e.1639158831.git.bristot@kernel.org Cc: Tao Zhou Cc: Ingo Molnar Cc: Tom Zanussi Cc: Masami Hiramatsu Cc: Juri Lelli Cc: Clark Williams Cc: John Kacur Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Sebastian Andrzej Siewior Cc: Daniel Bristot de Oliveira Cc: linux-rt-users@vger.kernel.org Cc: linux-trace-devel@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt commit e7041c6b3c123ef2160ff7a948e458f8241e4e03 Author: Daniel Bristot de Oliveira Date: Fri Dec 10 19:11:30 2021 +0100 rtla: Add rtla osnoise hist documentation Man page for rtla osnoise hist mode. Link: https://lkml.kernel.org/r/d43cc5d516b8db180575c4b66c4aa67c6a724a8d.1639158831.git.bristot@kernel.org Cc: Tao Zhou Cc: Ingo Molnar Cc: Tom Zanussi Cc: Masami Hiramatsu Cc: Juri Lelli Cc: Clark Williams Cc: John Kacur Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Sebastian Andrzej Siewior Cc: Daniel Bristot de Oliveira Cc: linux-rt-users@vger.kernel.org Cc: linux-trace-devel@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt commit b1be48307de4ccb315036c58bb1363a93c27d188 Author: Daniel Bristot de Oliveira Date: Fri Dec 10 19:11:29 2021 +0100 rtla: Add rtla osnoise top documentation Man page for rtla osnoise top mode. Link: https://lkml.kernel.org/r/445aa2173ca152fc2e68719e3c1a2547dd01efd3.1639158831.git.bristot@kernel.org Cc: Tao Zhou Cc: Ingo Molnar Cc: Tom Zanussi Cc: Masami Hiramatsu Cc: Juri Lelli Cc: Clark Williams Cc: John Kacur Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Sebastian Andrzej Siewior Cc: Daniel Bristot de Oliveira Cc: linux-rt-users@vger.kernel.org Cc: linux-trace-devel@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt commit 496082df01bb08a40f9207d918734cf908c5f107 Author: Daniel Bristot de Oliveira Date: Fri Dec 10 19:11:28 2021 +0100 rtla: Add rtla osnoise man page Man page for rtla osnoise command. Link: https://lkml.kernel.org/r/304747c602e46f6396e3bb75dfdcb42ae3656dca.1639158831.git.bristot@kernel.org Cc: Tao Zhou Cc: Ingo Molnar Cc: Tom Zanussi Cc: Masami Hiramatsu Cc: Juri Lelli Cc: Clark Williams Cc: John Kacur Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Sebastian Andrzej Siewior Cc: Daniel Bristot de Oliveira Cc: linux-rt-users@vger.kernel.org Cc: linux-trace-devel@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt commit d40d48e1f1f25abe755521e33a67f5d2b8b9443c Author: Daniel Bristot de Oliveira Date: Fri Dec 10 19:11:27 2021 +0100 rtla: Add Documentation Adds the basis for rtla documentation. This patch also includes the rtla(1) man page. As suggested by Jonathan Corbet, we are placing these man pages at Documentation/tools/rtla, using rst format. It is not linked to the official documentation, though. The Makefile is based on bpftool's Documentation one. Link: https://lkml.kernel.org/r/5f510f3e962fc0cd531c43f5a815544dd720c3f2.1639158831.git.bristot@kernel.org Cc: Tao Zhou Cc: Ingo Molnar Cc: Tom Zanussi Cc: Masami Hiramatsu Cc: Juri Lelli Cc: Clark Williams Cc: John Kacur Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Sebastian Andrzej Siewior Cc: Daniel Bristot de Oliveira Cc: linux-rt-users@vger.kernel.org Cc: linux-trace-devel@vger.kernel.org Cc: linux-kernel@vger.kernel.org Suggested-by: Steven Rostedt Suggested-by: Jonathan Corbet Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt commit 1eeb6328e8b3a917ba0be4965f272147dbd4cf55 Author: Daniel Bristot de Oliveira Date: Fri Dec 10 19:11:26 2021 +0100 rtla/timerlat: Add timerlat hist mode The rtla hist hist mode displays a histogram of each tracer event occurrence, both for IRQ and timer latencies. The tool also allows many configurations of the timerlat tracer and the collection of the tracer output. Here is one example of the rtla timerlat hist mode output: ---------- %< ---------- [root@alien ~]# rtla timerlat hist -c 0-3 -d 1M # RTLA timerlat histogram # Time unit is microseconds (us) # Duration: 0 00:01:00 Index IRQ-000 Thr-000 IRQ-001 Thr-001 IRQ-002 Thr-002 IRQ-003 Thr-003 0 58572 0 59373 0 58691 0 58895 0 1 1422 57021 628 57241 1310 56160 1102 56805 2 6 2931 0 2695 0 3567 4 3031 3 1 40 0 53 0 260 0 142 4 0 7 0 5 0 6 0 17 5 0 2 0 5 0 7 0 4 6 0 0 0 2 0 1 0 1 8 0 0 0 0 0 0 0 1 over: 0 0 0 0 0 0 0 0 count: 60001 60001 60001 60001 60001 60001 60001 60001 min: 0 1 0 1 0 1 0 1 avg: 0 1 0 1 0 1 0 1 max: 3 5 1 6 1 6 2 8 ---------- >% ---------- Running - rtla timerlat hist --help provides information about the available options. Link: https://lkml.kernel.org/r/7049ed3c46b7d6aceab18ffe7770003dfc4ddceb.1639158831.git.bristot@kernel.org Cc: Tao Zhou Cc: Ingo Molnar Cc: Tom Zanussi Cc: Masami Hiramatsu Cc: Juri Lelli Cc: Clark Williams Cc: John Kacur Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Sebastian Andrzej Siewior Cc: Daniel Bristot de Oliveira Cc: linux-rt-users@vger.kernel.org Cc: linux-trace-devel@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt commit a828cd18bc4ad72ff6d64c0dd23dc814a6741fed Author: Daniel Bristot de Oliveira Date: Fri Dec 10 19:11:25 2021 +0100 rtla: Add timerlat tool and timelart top mode The rtla timerlat tool is an interface for the timerlat tracer. The timerlat tracer dispatches a kernel thread per-cpu. These threads set a periodic timer to wake themselves up and go back to sleep. After the wakeup, they collect and generate useful information for the debugging of operating system timer latency. The timerlat tracer outputs information in two ways. It periodically prints the timer latency at the timer IRQ handler and the Thread handler. It also provides information for each noise via the osnoise tracepoints. The rtla timerlat top mode displays a summary of the periodic output from the timerlat tracer. Here is one example of the rtla timerlat tool output: ---------- %< ---------- [root@alien ~]# rtla timerlat top -c 0-3 -d 1m Timer Latency 0 00:01:00 | IRQ Timer Latency (us) | Thread Timer Latency (us) CPU COUNT | cur min avg max | cur min avg max 0 #60001 | 0 0 0 3 | 1 1 1 6 1 #60001 | 0 0 0 3 | 2 1 1 5 2 #60001 | 0 0 1 6 | 1 1 2 7 3 #60001 | 0 0 0 7 | 1 1 1 11 ---------- >% ---------- Running: # rtla timerlat --help # rtla timerlat top --help provides information about the available options. Link: https://lkml.kernel.org/r/e95032e20c2b88c962195bf7693bb53c9ebcced8.1639158831.git.bristot@kernel.org Cc: Tao Zhou Cc: Ingo Molnar Cc: Tom Zanussi Cc: Masami Hiramatsu Cc: Juri Lelli Cc: Clark Williams Cc: John Kacur Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Sebastian Andrzej Siewior Cc: Daniel Bristot de Oliveira Cc: linux-rt-users@vger.kernel.org Cc: linux-trace-devel@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt commit 829a6c0b5698c7d51aa2bcd16963fcd9de295476 Author: Daniel Bristot de Oliveira Date: Fri Dec 10 19:11:24 2021 +0100 rtla/osnoise: Add the hist mode The rtla osnoise hist tool collects all osnoise:sample_threshold occurrence in a histogram, displaying the results in a user-friendly way. The tool also allows many configurations of the osnoise tracer and the collection of the tracer output. Here is one example of the rtla osnoise hist tool output: ---------- %< ---------- [root@f34 ~]# rtla osnoise hist --bucket-size 10 --entries 100 -c 0-8 -d 1M -r 9000 -P F:1 # RTLA osnoise histogram # Time unit is microseconds (us) # Duration: 0 00:01:00 Index CPU-000 CPU-001 CPU-002 CPU-003 CPU-004 CPU-005 CPU-006 CPU-007 CPU-008 0 430 434 352 455 440 463 467 436 484 10 88 88 92 141 120 100 126 166 100 20 19 7 12 22 8 8 13 13 16 30 6 0 2 0 1 2 2 1 0 50 0 0 0 0 0 0 1 0 0 over: 0 0 0 0 0 0 0 0 0 count: 543 529 458 618 569 573 609 616 600 min: 0 0 0 0 0 0 0 0 0 avg: 0 0 0 0 0 0 0 0 0 max: 30 20 30 20 30 30 50 30 20 ---------- >% ---------- Running - rtla osnoise hist --help provides information about the available options. Link: https://lkml.kernel.org/r/c68060544de89b8b62510ed91c7369f162eb465b.1639158831.git.bristot@kernel.org Cc: Tao Zhou Cc: Ingo Molnar Cc: Tom Zanussi Cc: Masami Hiramatsu Cc: Juri Lelli Cc: Clark Williams Cc: John Kacur Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Sebastian Andrzej Siewior Cc: Daniel Bristot de Oliveira Cc: linux-rt-users@vger.kernel.org Cc: linux-trace-devel@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt commit 1eceb2fc2ca549a170d7ee7cd1fde2daeda646ac Author: Daniel Bristot de Oliveira Date: Fri Dec 10 19:11:23 2021 +0100 rtla/osnoise: Add osnoise top mode The rtla osnoise tool is an interface for the osnoise tracer. The osnoise tracer dispatches a kernel thread per-cpu. These threads read the time in a loop while with preemption, softirqs and IRQs enabled, thus allowing all the sources of osnoise during its execution. The osnoise threads take note of the entry and exit point of any source of interferences, increasing a per-cpu interference counter. The osnoise tracer also saves an interference counter for each source of interference. The rtla osnoise top mode displays information about the periodic summary from the osnoise tracer. One example of rtla osnoise top output is: [root@alien ~]# rtla osnoise top -c 0-3 -d 1m -q -r 900000 -P F:1 Operating System Noise duration: 0 00:01:00 | time is in us CPU Period Runtime Noise % CPU Aval Max Noise Max Single HW NMI IRQ Softirq Thread 0 #58 52200000 1031 99.99802 91 60 0 0 52285 0 101 1 #59 53100000 5 99.99999 5 5 0 9 53122 0 18 2 #59 53100000 7 99.99998 7 7 0 8 53115 0 18 3 #59 53100000 8274 99.98441 277 23 0 9 53778 0 660 "rtla osnoise top --help" works and provide information about the available options. Link: https://lkml.kernel.org/r/0d796993abf587ae5a170bb8415c49368d4999e1.1639158831.git.bristot@kernel.org Cc: Tao Zhou Cc: Ingo Molnar Cc: Tom Zanussi Cc: Masami Hiramatsu Cc: Juri Lelli Cc: Clark Williams Cc: John Kacur Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Sebastian Andrzej Siewior Cc: Daniel Bristot de Oliveira Cc: linux-rt-users@vger.kernel.org Cc: linux-trace-devel@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt commit 0605bf009f18d558758df9edef59698bf1389b28 Author: Daniel Bristot de Oliveira Date: Fri Dec 10 19:11:22 2021 +0100 rtla: Add osnoise tool The osnoise tool is the interface for the osnoise tracer. The osnoise tool will have multiple "modes" with different outputs. At this point, no mode is included. The osnoise.c includes the osnoise_context abstraction. It serves to read-save-change-restore the default values from tracing/osnoise/ directory. When the context is deleted, the default values are restored. It also includes some other helper functions for managing osnoise tracer sessions. With these bits and pieces in place, we can start adding some functionality to rtla. Link: https://lkml.kernel.org/r/2d44c21ff561f503b4c7b1813892761818118460.1639158831.git.bristot@kernel.org Cc: Tao Zhou Cc: Ingo Molnar Cc: Tom Zanussi Cc: Masami Hiramatsu Cc: Juri Lelli Cc: Clark Williams Cc: John Kacur Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Sebastian Andrzej Siewior Cc: Daniel Bristot de Oliveira Cc: linux-rt-users@vger.kernel.org Cc: linux-trace-devel@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt commit b1696371d865fa28bd20adb13d1820ef031f2ee2 Author: Daniel Bristot de Oliveira Date: Fri Dec 10 19:11:21 2021 +0100 rtla: Helper functions for rtla This is a set of utils and tracer helper functions. They are used by rtla mostly to parse config, display data and some trace operations that are not part of libtracefs (because they are only useful it for this case). Link: https://lkml.kernel.org/r/a94c128aba9e6e66d502b7094f2e8c7ac95b12e5.1639158831.git.bristot@kernel.org Cc: Tao Zhou Cc: Ingo Molnar Cc: Tom Zanussi Cc: Masami Hiramatsu Cc: Juri Lelli Cc: Clark Williams Cc: John Kacur Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Sebastian Andrzej Siewior Cc: Daniel Bristot de Oliveira Cc: linux-rt-users@vger.kernel.org Cc: linux-trace-devel@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt commit 79ce8f43ac5ac16d6d63729e858da42b0460d87b Author: Daniel Bristot de Oliveira Date: Fri Dec 10 19:11:20 2021 +0100 rtla: Real-Time Linux Analysis tool The rtla is a meta-tool that includes a set of commands that aims to analyze the real-time properties of Linux. But instead of testing Linux as a black box, rtla leverages kernel tracing capabilities to provide precise information about the properties and root causes of unexpected results. rtla --help works and provide information about the available options. This is just the "main" and the Makefile, no function yet. Link: https://lkml.kernel.org/r/bf9118ed43a09e6c054c9a491cbe7411ad1acd89.1639158831.git.bristot@kernel.org Cc: Tao Zhou Cc: Ingo Molnar Cc: Tom Zanussi Cc: Masami Hiramatsu Cc: Juri Lelli Cc: Clark Williams Cc: John Kacur Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Sebastian Andrzej Siewior Cc: Daniel Bristot de Oliveira Cc: linux-rt-users@vger.kernel.org Cc: linux-trace-devel@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Daniel Bristot de Oliveira Signed-off-by: Steven Rostedt commit 0878355b51f5f26632e652c848a8e174bb02d22d Author: Nikita Yushchenko Date: Sun Jan 9 18:34:59 2022 +0300 tracing/osnoise: Properly unhook events if start_per_cpu_kthreads() fails If start_per_cpu_kthreads() called from osnoise_workload_start() returns error, event hooks are left in broken state: unhook_irq_events() called but unhook_thread_events() and unhook_softirq_events() not called, and trace_osnoise_callback_enabled flag not cleared. On the next tracer enable, hooks get not installed due to trace_osnoise_callback_enabled flag. And on the further tracer disable an attempt to remove non-installed hooks happened, hitting a WARN_ON_ONCE() in tracepoint_remove_func(). Fix the error path by adding the missing part of cleanup. While at this, introduce osnoise_unhook_events() to avoid code duplication between this error path and normal tracer disable. Link: https://lkml.kernel.org/r/20220109153459.3701773-1-nikita.yushchenko@virtuozzo.com Cc: stable@vger.kernel.org Fixes: bce29ac9ce0b ("trace: Add osnoise tracer") Acked-by: Daniel Bristot de Oliveira Signed-off-by: Nikita Yushchenko Signed-off-by: Steven Rostedt commit 6e1b4bd1911d814077d77e2ac6529d74ee68c0f6 Author: Yuntao Wang Date: Mon Jan 10 00:22:32 2022 +0800 tracing: Remove duplicate warnings when calling trace_create_file() Since the same warning message is already printed in the trace_create_file() function, there is no need to print it again. Link: https://lkml.kernel.org/r/20220109162232.361747-1-ytcoode@gmail.com Signed-off-by: Yuntao Wang Signed-off-by: Steven Rostedt commit dfea08a2116fe327f79d8f4d4b2cf6e0c88be11f Author: Xiangyang Zhang Date: Fri Jan 7 23:02:42 2022 +0800 tracing/kprobes: 'nmissed' not showed correctly for kretprobe The 'nmissed' column of the 'kprobe_profile' file for kretprobe is not showed correctly, kretprobe can be skipped by two reasons, shortage of kretprobe_instance which is counted by tk->rp.nmissed, and kprobe itself is missed by some reason, so to show the sum. Link: https://lkml.kernel.org/r/20220107150242.5019-1-xyz.sun.ok@gmail.com Cc: stable@vger.kernel.org Fixes: 4a846b443b4e ("tracing/kprobes: Cleanup kprobe tracer code") Acked-by: Masami Hiramatsu Signed-off-by: Xiangyang Zhang Signed-off-by: Steven Rostedt commit 77360f9bbc7e5e2ab7a2c8b4c0244fbbfcfc6f62 Author: Steven Rostedt Date: Mon Jan 10 11:55:32 2022 -0500 tracing: Add test for user space strings when filtering on string pointers Pingfan reported that the following causes a fault: echo "filename ~ \"cpu\"" > events/syscalls/sys_enter_openat/filter echo 1 > events/syscalls/sys_enter_at/enable The reason is that trace event filter treats the user space pointer defined by "filename" as a normal pointer to compare against the "cpu" string. The following bug happened: kvm-03-guest16 login: [72198.026181] BUG: unable to handle page fault for address: 00007fffaae8ef60 #PF: supervisor read access in kernel mode #PF: error_code(0x0001) - permissions violation PGD 80000001008b7067 P4D 80000001008b7067 PUD 2393f1067 PMD 2393ec067 PTE 8000000108f47867 Oops: 0001 [#1] PREEMPT SMP PTI CPU: 1 PID: 1 Comm: systemd Kdump: loaded Not tainted 5.14.0-32.el9.x86_64 #1 Hardware name: Red Hat KVM, BIOS 0.5.1 01/01/2011 RIP: 0010:strlen+0x0/0x20 Code: 48 89 f9 74 09 48 83 c1 01 80 39 00 75 f7 31 d2 44 0f b6 04 16 44 88 04 11 48 83 c2 01 45 84 c0 75 ee c3 0f 1f 80 00 00 00 00 <80> 3f 00 74 10 48 89 f8 48 83 c0 01 80 38 00 75 f7 48 29 f8 c3 31 RSP: 0018:ffffb5b900013e48 EFLAGS: 00010246 RAX: 0000000000000018 RBX: ffff8fc1c49ede00 RCX: 0000000000000000 RDX: 0000000000000020 RSI: ffff8fc1c02d601c RDI: 00007fffaae8ef60 RBP: 00007fffaae8ef60 R08: 0005034f4ddb8ea4 R09: 0000000000000000 R10: ffff8fc1c02d601c R11: 0000000000000000 R12: ffff8fc1c8a6e380 R13: 0000000000000000 R14: ffff8fc1c02d6010 R15: ffff8fc1c00453c0 FS: 00007fa86123db40(0000) GS:ffff8fc2ffd00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fffaae8ef60 CR3: 0000000102880001 CR4: 00000000007706e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 PKRU: 55555554 Call Trace: filter_pred_pchar+0x18/0x40 filter_match_preds+0x31/0x70 ftrace_syscall_enter+0x27a/0x2c0 syscall_trace_enter.constprop.0+0x1aa/0x1d0 do_syscall_64+0x16/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7fa861d88664 The above happened because the kernel tried to access user space directly and triggered a "supervisor read access in kernel mode" fault. Worse yet, the memory could not even be loaded yet, and a SEGFAULT could happen as well. This could be true for kernel space accessing as well. To be even more robust, test both kernel and user space strings. If the string fails to read, then simply have the filter fail. Note, TASK_SIZE is used to determine if the pointer is user or kernel space and the appropriate strncpy_from_kernel/user_nofault() function is used to copy the memory. For some architectures, the compare to TASK_SIZE may always pick user space or kernel space. If it gets it wrong, the only thing is that the filter will fail to match. In the future, this needs to be fixed to have the event denote which should be used. But failing a filter is much better than panicing the machine, and that can be solved later. Link: https://lore.kernel.org/all/20220107044951.22080-1-kernelfans@gmail.com/ Link: https://lkml.kernel.org/r/20220110115532.536088fd@gandalf.local.home Cc: stable@vger.kernel.org Cc: Ingo Molnar Cc: Andrew Morton Cc: Masami Hiramatsu Cc: Tom Zanussi Reported-by: Pingfan Liu Tested-by: Pingfan Liu Fixes: 87a342f5db69d ("tracing/filters: Support filtering for char * strings") Signed-off-by: Steven Rostedt commit 6840f9094f2bd788a316d8cb0a4e42538d3e47dd Author: Matthew Wilcox (Oracle) Date: Thu Jan 13 16:44:19 2022 -0500 pagevec: Initialise folio_batch->percpu_pvec_drained When UBSAN is enabled, it reports an invalid value in __pagevec_release() when accessing pvec->percpu_pvec_drained, which is simply whatever garbage was on the stack. Initialise it when initialising the rest of the folio_batch. Fixes: 10331795fb79 ("pagevec: Add folio_batch") Reported-by: Randy Dunlap Tested-by: Randy Dunlap Signed-off-by: Matthew Wilcox (Oracle) commit 3e2a56e6f639492311e0a8533f0a7aed60816308 Author: Steven Rostedt Date: Fri Jan 7 17:56:56 2022 -0500 tracing: Have syscall trace events use trace_event_buffer_lock_reserve() Currently, the syscall trace events call trace_buffer_lock_reserve() directly, which means that it misses out on some of the filtering optimizations provided by the helper function trace_event_buffer_lock_reserve(). Have the syscall trace events call that instead, as it was missed when adding the update to use the temp buffer when filtering. Link: https://lkml.kernel.org/r/20220107225839.823118570@goodmis.org Cc: stable@vger.kernel.org Cc: Ingo Molnar Cc: Andrew Morton Cc: Tom Zanussi Reviewed-by: Masami Hiramatsu Fixes: 0fc1b09ff1ff4 ("tracing: Use temp buffer when filtering events") Signed-off-by: Steven Rostedt commit ecbe794e777aab99de3b753110801a9cda747d2d Author: Geliang Tang Date: Wed Dec 22 19:00:25 2021 +0800 tracing: Fix mismatched comment in __string_len Here __assign_str_len() should be used for the __string_len type, instead of __assign_str() in the comment. Link: https://lkml.kernel.org/r/5c012db463392d0e6d4f0636203d778962ad060a.1640170494.git.geliang.tang@suse.com Reviewed-by: Masami Hiramatsu Fixes: 883b4aee4dec6 ("tracing: Add trace_event helper macros __string_len() and __assign_str_len()") Signed-off-by: Geliang Tang Signed-off-by: Steven Rostedt commit 8147dc78e6e4b645f8277bdf377f2193ddfcdee1 Author: Steven Rostedt (VMware) Date: Mon Dec 6 15:18:58 2021 -0500 ftrace: Add test to make sure compiled time sorts work Now that ftrace function pointers are sorted at compile time, add a test that makes sure they are sorted at run time. This test is only run if it is configured in. Link: https://lkml.kernel.org/r/20211206151858.4d21a24d@gandalf.local.home Cc: Yinan Liu Signed-off-by: Steven Rostedt (VMware) commit 72b3942a173c387b27860ba1069636726e208777 Author: Yinan Liu Date: Sun Dec 12 19:33:58 2021 +0800 scripts: ftrace - move the sort-processing in ftrace_init When the kernel starts, the initialization of ftrace takes up a portion of the time (approximately 6~8ms) to sort mcount addresses. We can save this time by moving mcount-sorting to compile time. Link: https://lkml.kernel.org/r/20211212113358.34208-2-yinan@linux.alibaba.com Signed-off-by: Yinan Liu Reported-by: kernel test robot Reported-by: kernel test robot Signed-off-by: Steven Rostedt commit 1c1857d400355e96f0fe8b32adc6fa7594d03b52 Author: Xiaoke Wang Date: Tue Dec 14 10:26:46 2021 +0800 tracing/probes: check the return value of kstrndup() for pbuf kstrndup() is a memory allocation-related function, it returns NULL when some internal memory errors happen. It is better to check the return value of it so to catch the memory error in time. Link: https://lkml.kernel.org/r/tencent_4D6E270731456EB88712ED7F13883C334906@qq.com Acked-by: Masami Hiramatsu Fixes: a42e3c4de964 ("tracing/probe: Add immediate string parameter support") Signed-off-by: Xiaoke Wang Signed-off-by: Steven Rostedt commit 8c7224245557707c613f130431cafbaaa4889615 Author: Xiaoke Wang Date: Tue Dec 14 09:28:02 2021 +0800 tracing/uprobes: Check the return value of kstrdup() for tu->filename kstrdup() returns NULL when some internal memory errors happen, it is better to check the return value of it so to catch the memory error in time. Link: https://lkml.kernel.org/r/tencent_3C2E330722056D7891D2C83F29C802734B06@qq.com Acked-by: Masami Hiramatsu Fixes: 33ea4b24277b ("perf/core: Implement the 'perf_uprobe' PMU") Signed-off-by: Xiaoke Wang Signed-off-by: Steven Rostedt commit 289e7b0f7eb47b87a0441e6c81336316f301eb39 Author: Sebastian Andrzej Siewior Date: Mon Dec 13 11:08:53 2021 +0100 tracing: Account bottom half disabled sections. Disabling only bottom halves via local_bh_disable() disables also preemption but this remains invisible to tracing. On a CONFIG_PREEMPT kernel one might wonder why there is no scheduling happening despite the N flag in the trace. The reason might be the a rcu_read_lock_bh() section. Add a 'b' to the tracing output if in task context with disabled bottom halves. Link: https://lkml.kernel.org/r/YbcbtdtC/bjCKo57@linutronix.de Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Steven Rostedt commit 818d9150f2b22a0053bf568fa11ad3be804ce5c4 Author: Dan Carpenter Date: Tue Jan 11 10:25:29 2022 +0300 clk: visconti: Fix uninitialized variable in printk The "pll_clck" variable is uninitialized. The "ret" error code was supposed to be printed instead. Fixes: b4cbe606dc36 ("clk: visconti: Add support common clock driver and reset driver") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20220111072529.GJ11243@kili Signed-off-by: Stephen Boyd commit 49a8f2bc8d88702783c7e163ec84374e9a022f71 Author: Robert Hancock Date: Wed Jan 12 14:38:16 2022 -0600 clk: si5341: Fix clock HW provider cleanup The call to of_clk_add_hw_provider was not undone on remove or on probe failure, which could cause an oops on a subsequent attempt to retrieve clocks for the removed device. Switch to the devm version of the function to avoid this issue. Fixes: 3044a860fd09 ("clk: Add Si5341/Si5340 driver") Signed-off-by: Robert Hancock Link: https://lore.kernel.org/r/20220112203816.1784610-1-robert.hancock@calian.com Signed-off-by: Stephen Boyd commit a6431e351c6ec5bb6800787d259b343088f369a3 Author: Colin Ian King Date: Thu Jan 13 00:05:45 2022 +0000 aoe: remove redundant assignment on variable n The variable n is being bit-wise or'd with a value and reassigned before being returned. The update of n is redundant, replace the |= operator with | instead. Cleans up clang scan warning: drivers/block/aoe/aoecmd.c:125:9: warning: Although the value stored to 'n' is used in the enclosing expression, the value is never actually read from 'n' [deadcode.DeadStores] Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220113000545.1307091-1-colin.i.king@gmail.com Signed-off-by: Jens Axboe commit 413ec8057bc3d368574abd05dd27e747063b2f59 Author: Colin Ian King Date: Thu Jan 13 00:14:32 2022 +0000 loop: remove redundant initialization of pointer node The pointer node is being initialized with a value that is never read, it is being re-assigned the same value a little futher on. Remove the redundant initialization. Cleans up clang scan warning: drivers/block/loop.c:823:19: warning: Value stored to 'node' during its initialization is never read [deadcode.DeadStores] Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220113001432.1331871-1-colin.i.king@gmail.com Signed-off-by: Jens Axboe commit 180dccb0dba4f5e84a4a70c1be1d34cbb6528b32 Author: Laibin Qiu Date: Thu Jan 13 10:55:36 2022 +0800 blk-mq: fix tag_get wait task can't be awakened In case of shared tags, there might be more than one hctx which allocates from the same tags, and each hctx is limited to allocate at most: hctx_max_depth = max((bt->sb.depth + users - 1) / users, 4U); tag idle detection is lazy, and may be delayed for 30sec, so there could be just one real active hctx(queue) but all others are actually idle and still accounted as active because of the lazy idle detection. Then if wake_batch is > hctx_max_depth, driver tag allocation may wait forever on this real active hctx. Fix this by recalculating wake_batch when inc or dec active_queues. Fixes: 0d2602ca30e41 ("blk-mq: improve support for shared tags maps") Suggested-by: Ming Lei Suggested-by: John Garry Signed-off-by: Laibin Qiu Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20220113025536.1479653-1-qiulaibin@huawei.com Signed-off-by: Jens Axboe commit c84b8a3fef663933007e885535591b9d30bdc860 Author: Jiapeng Chong Date: Fri Jan 14 00:20:05 2022 +0800 io_uring: Remove unused function req_ref_put Fix the following clang warnings: fs/io_uring.c:1195:20: warning: unused function 'req_ref_put' [-Wunused-function]. Fixes: aa43477b0402 ("io_uring: poll rework") Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Link: https://lore.kernel.org/r/20220113162005.3011-1-jiapeng.chong@linux.alibaba.com Signed-off-by: Jens Axboe commit fb3b0673b7d5b477ed104949450cd511337ba3c6 Merge: 747c19eb7539b 869b6ca39c08c Author: Linus Torvalds Date: Thu Jan 13 11:19:07 2022 -0800 Merge tag 'mailbox-v5.17' of git://git.linaro.org/landing-teams/working/fujitsu/integration Pull mailbox updates from Jassi Brar: - qcom: misc updates to qcom-ipcc driver - mpfs: change compatible string - pcc: - fix handling of subtypes - avoid uninitialized variable - mtk: - add missing of_node_put - enable control_by_sw - silent probe-defer prints - fix gce_num for mt8192 - zynq: add missing of_node_put - imx: check for NULL instead of IS_ERR - appple: switch to generic compatibles - hi3660: convert comments to kernel-doc notation * tag 'mailbox-v5.17' of git://git.linaro.org/landing-teams/working/fujitsu/integration: dt-bindings: mailbox: Add more protocol and client ID mailbox: qcom-ipcc: Support interrupt wake up from suspend mailbox: qcom-ipcc: Support more IPCC instance mailbox: qcom-ipcc: Dynamic alloc for channel arrangement mailbox: change mailbox-mpfs compatible string mailbox: pcc: Handle all PCC subtypes correctly in pcc_mbox_irq mailbox: pcc: Avoid using the uninitialized variable 'dev' mailbox: mtk: add missing of_node_put before return mailbox: zynq: add missing of_node_put before return mailbox: imx: Fix an IS_ERR() vs NULL bug mailbox: hi3660: convert struct comments to kernel-doc notation mailbox: add control_by_sw for mt8195 mailbox: mtk-cmdq: Silent EPROBE_DEFER errors for clks mailbox: fix gce_num of mt8192 driver data mailbox: apple: Bind to generic compatibles dt-bindings: mailbox: apple,mailbox: Add generic and t6000 compatibles commit 747c19eb7539b5e6bb15ed57a0a14ebf9f3adb8e Merge: feb7a43de5ef6 c0fe82baaeb27 Author: Linus Torvalds Date: Thu Jan 13 11:09:11 2022 -0800 Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma Pull rdma updates from Jason Gunthorpe: "Another small cycle. Mostly cleanups and bug fixes, quite a bit assisted from bots. There are a few new syzkaller splats that haven't been solved yet but they should get into the rcs in a few weeks, I think. Summary: - Update drivers to use common helpers for GUIDs, pkeys, bitmaps, memset_startat, and others - General code cleanups from bots - Simplify some of the rxe pool code in preparation for a larger rework - Clean out old stuff from hns, including all support for hip06 devices - Fix a bug where GID table entries could be missed if the table had holes in it - Rename paths and sessions in rtrs for better understandability - Consolidate the roce source port selection code - NDR speed support in mlx5" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma: (83 commits) RDMA/irdma: Remove the redundant return RDMA/rxe: Use the standard method to produce udp source port RDMA/irdma: Make the source udp port vary RDMA/hns: Replace get_udp_sport with rdma_get_udp_sport RDMA/core: Calculate UDP source port based on flow label or lqpn/rqpn IB/qib: Fix typos RDMA/rtrs-clt: Rename rtrs_clt to rtrs_clt_sess RDMA/rtrs-srv: Rename rtrs_srv to rtrs_srv_sess RDMA/rtrs-clt: Rename rtrs_clt_sess to rtrs_clt_path RDMA/rtrs-srv: Rename rtrs_srv_sess to rtrs_srv_path RDMA/rtrs: Rename rtrs_sess to rtrs_path RDMA/hns: Modify the hop num of HIP09 EQ to 1 IB/iser: Align coding style across driver IB/iser: Remove un-needed casting to/from void pointer IB/iser: Don't suppress send completions IB/iser: Rename ib_ret local variable IB/iser: Fix RNR errors IB/iser: Remove deprecated pi_guard module param IB/mlx5: Expose NDR speed through MAD RDMA/cxgb4: Set queue pair state when being queried ... commit fb80445c438c78b40b547d12b8d56596ce4ccfeb Author: Kevin Bracey Date: Wed Jan 12 19:02:10 2022 +0200 net_sched: restore "mpu xxx" handling commit 56b765b79e9a ("htb: improved accuracy at high rates") broke "overhead X", "linklayer atm" and "mpu X" attributes. "overhead X" and "linklayer atm" have already been fixed. This restores the "mpu X" handling, as might be used by DOCSIS or Ethernet shaping: tc class add ... htb rate X overhead 4 mpu 64 The code being fixed is used by htb, tbf and act_police. Cake has its own mpu handling. qdisc_calculate_pkt_len still uses the size table containing values adjusted for mpu by user space. iproute2 tc has always passed mpu into the kernel via a tc_ratespec structure, but the kernel never directly acted on it, merely stored it so that it could be read back by `tc class show`. Rather, tc would generate length-to-time tables that included the mpu (and linklayer) in their construction, and the kernel used those tables. Since v3.7, the tables were no longer used. Along with "mpu", this also broke "overhead" and "linklayer" which were fixed in 01cb71d2d47b ("net_sched: restore "overhead xxx" handling", v3.10) and 8a8e3d84b171 ("net_sched: restore "linklayer atm" handling", v3.11). "overhead" was fixed by simply restoring use of tc_ratespec::overhead - this had originally been used by the kernel but was initially omitted from the new non-table-based calculations. "linklayer" had been handled in the table like "mpu", but the mode was not originally passed in tc_ratespec. The new implementation was made to handle it by getting new versions of tc to pass the mode in an extended tc_ratespec, and for older versions of tc the table contents were analysed at load time to deduce linklayer. As "mpu" has always been given to the kernel in tc_ratespec, accompanying the mpu-based table, we can restore system functionality with no userspace change by making the kernel act on the tc_ratespec value. Fixes: 56b765b79e9a ("htb: improved accuracy at high rates") Signed-off-by: Kevin Bracey Cc: Eric Dumazet Cc: Jiri Pirko Cc: Vimalkumar Link: https://lore.kernel.org/r/20220112170210.1014351-1-kevin@bracey.fi Signed-off-by: Jakub Kicinski commit d72d69abfdb6e0375981cfdda8eb45143f12c77d Author: Siva Mullati Date: Fri Jan 7 15:22:35 2022 +0530 drm/i915/gvt: Make DRM_I915_GVT depend on X86 GVT is not supported on non-x86 platforms, So add dependency of X86 on config parameter DRM_I915_GVT. Fixes: 0ad35fed618c ("drm/i915: gvt: Introduce the basic architecture of GVT-g") Signed-off-by: Siva Mullati Signed-off-by: Zhi Wang Link: http://patchwork.freedesktop.org/patch/msgid/20220107095235.243448-1-siva.mullati@intel.com Reviewed-by: Zhi Wang Signed-off-by: Zhi Wang commit 91c64a4f1cb01cf0ec50f0372ff8ca9d3022b7d0 Author: Randy Dunlap Date: Sat Oct 2 22:23:34 2021 -0700 drm/i915/gvt: clean up kernel-doc in gtt.c Fix kernel-doc warnings in gtt.c: gtt.c:1152: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Check if can do 2M page gtt.c:1152: warning: missing initial short description on line: * Check if can do 2M page gtt.c:2209: warning: expecting prototype for intel_vgpu_emulate_gtt_mmio_read(). Prototype was for intel_vgpu_emulate_ggtt_mmio_read() instead Fixes: a752b070a678 ("drm/i915/gvt: Fix function comment doc errors") Fixes: 2707e4446688 ("drm/i915/gvt: vGPU graphics memory virtualization") Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Zhenyu Wang Cc: Zhi Wang Cc: Colin Xu Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Rodrigo Vivi Cc: intel-gfx@lists.freedesktop.org Cc: intel-gvt-dev@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Cc: David Airlie Cc: Daniel Vetter Signed-off-by: Zhi Wang Link: http://patchwork.freedesktop.org/patch/msgid/20211003052334.15764-1-rdunlap@infradead.org Reviewed-by: Zhi Wang Signed-off-by: Zhi Wang commit c4d7f40b250c1a4d74ed259e84807f58032507b6 Author: Masahiro Yamada Date: Mon Jan 10 03:15:29 2022 +0900 kbuild: add cmd_file_size Some architectures support self-extracting kernel, which embeds the compressed vmlinux. It has 4 byte data at the end so the decompressor can know the vmlinux size beforehand. GZIP natively has it in the trailer, but for the other compression algorithms, the hand-crafted trailer is added. It is unneeded to generate such _corrupted_ compressed files because it is possible to pass the size data as a separate file. For example, the assembly code: .incbin "compressed-vmlinux-with-size-data" can be transformed to: .incbin "compressed-vmlinux" .incbin "size-data" My hope is, after some reworks of the decompressors, the macros cmd_{bzip2,lzma,lzo,lz4,xzkern,zstd22}_with_size will go away. This new macro, cmd_file_size, will be useful to generate a separate size-data file. Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier commit 53e7b5dfb752399cd903ecb6e921dcaef57c8ea5 Author: Masahiro Yamada Date: Mon Jan 10 03:15:28 2022 +0900 arch: decompressor: remove useless vmlinux.bin.all-y Presumably, arch/{parisc,s390,sh}/boot/compressed/Makefile copied arch/x86/boot/compressed/Makefile, but vmlinux.bin.all-y is useless here because it is the same as $(obj)/vmlinux.bin. Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier commit 7ce7e984ab2b218d6e92d5165629022fe2daf9ee Author: Masahiro Yamada Date: Mon Jan 10 03:15:27 2022 +0900 kbuild: rename cmd_{bzip2,lzma,lzo,lz4,xzkern,zstd22} GZIP-compressed files end with 4 byte data that represents the size of the original input. The decompressors (the self-extracting kernel) exploit it to know the vmlinux size beforehand. To mimic the GZIP's trailer, Kbuild provides cmd_{bzip2,lzma,lzo,lz4,xzkern,zstd22}. Unfortunately these macros are used everywhere despite the appended size data is only useful for the decompressors. There is no guarantee that such hand-crafted trailers are safely ignored. In fact, the kernel refuses compressed initramdfs with the garbage data. That is why usr/Makefile overrides size_append to make it no-op. To limit the use of such broken compressed files, this commit renames the existing macros as follows: cmd_bzip2 --> cmd_bzip2_with_size cmd_lzma --> cmd_lzma_with_size cmd_lzo --> cmd_lzo_with_size cmd_lz4 --> cmd_lz4_with_size cmd_xzkern --> cmd_xzkern_with_size cmd_zstd22 --> cmd_zstd22_with_size To keep the decompressors working, I updated the following Makefiles accordingly: arch/arm/boot/compressed/Makefile arch/h8300/boot/compressed/Makefile arch/mips/boot/compressed/Makefile arch/parisc/boot/compressed/Makefile arch/s390/boot/compressed/Makefile arch/sh/boot/compressed/Makefile arch/x86/boot/compressed/Makefile I reused the current macro names for the normal usecases; they produce the compressed data in the proper format. I did not touch the following: arch/arc/boot/Makefile arch/arm64/boot/Makefile arch/csky/boot/Makefile arch/mips/boot/Makefile arch/riscv/boot/Makefile arch/sh/boot/Makefile kernel/Makefile This means those Makefiles will stop appending the size data. I dropped the 'override size_append' hack from usr/Makefile. Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier commit 64d8aaa4ef388b22372de4dc9ce3b9b3e5f45b6c Author: Masahiro Yamada Date: Mon Jan 10 03:15:26 2022 +0900 kbuild: drop $(size_append) from cmd_zstd The appended file size is only used by the decompressors, which some architectures support. As the comment "zstd22 is used for kernel compression" says, cmd_zstd22 is used in arch/{mips,s390,x86}/boot/compressed/Makefile. On the other hand, there is no good reason to append the file size to cmd_zstd since it is used for other purposes. Actually cmd_zstd is only used in usr/Makefile, where the appended file size is rather harmful. The initramfs with its file size appended is considered as corrupted data, so commit 65e00e04e5ae ("initramfs: refactor the initramfs build rules") added 'override size_append := :' to make it no-op. As a conclusion, this $(size_append) should not exist here. Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier commit 82977af93a0dc4e70f60ca2137b67f65ebe47fc7 Author: Masahiro Yamada Date: Mon Jan 10 03:15:25 2022 +0900 sh: rename suffix-y to suffix_y 'export suffix-y' does not work reliably because hyphens are disallowed in shell variables. A similar issue was fixed by commit 2bfbe7881ee0 ("kbuild: Do not use hyphen in exported variable name"). If I do similar in dash, ARCH=sh fails to build. $ mv linux linux~ $ cd linux~ $ dash $ make O=foo/bar ARCH=sh CROSS_COMPILE=sh4-linux-gnu- defconfig all make[1]: Entering directory '/home/masahiro/linux~/foo/bar' [ snip ] make[4]: *** No rule to make target 'arch/sh/boot/compressed/vmlinux.bin.', needed by 'arch/sh/boot/compressed/piggy.o'. Stop. make[3]: *** [/home/masahiro/linux~/arch/sh/boot/Makefile:40: arch/sh/boot/compressed/vmlinux] Error 2 make[2]: *** [/home/masahiro/linux~/arch/sh/Makefile:194: zImage] Error 2 make[1]: *** [/home/masahiro/linux~/Makefile:350: __build_one_by_one] Error 2 make[1]: Leaving directory '/home/masahiro/linux~/foo/bar' make: *** [Makefile:219: __sub-make] Error 2 The maintainer of GNU Make stated that there is no consistent way to export variables that do not meet the shell's naming criteria. (https://savannah.gnu.org/bugs/?55719) Consequently, you cannot use hyphens in exported variables. Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier commit a6fadfd757ceb2f206948b1b54b9c13e77292644 Author: Kyoungkyu Park Date: Thu Jan 13 13:17:08 2022 +0900 net: qmi_wwan: Add Hucom Wireless HM-211S/K The Hucom Wireless HM-211S/K is an LTE module based on Qualcomm MDM9207. This module supports LTE Band 1, 3, 5, 7, 8 and WCDMA Band 1. Manual testing showed that only interface number two replies to QMI messages. T: Bus=01 Lev=02 Prnt=02 Port=01 Cnt=01 Dev#= 3 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=22de ProdID=9051 Rev= 3.18 S: Manufacturer=Android S: Product=Android S: SerialNumber=0123456789ABCDEF C:* #Ifs= 4 Cfg#= 1 Atr=80 MxPwr=500mA I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none) E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none) E: Ad=83(I) Atr=03(Int.) MxPS= 10 Ivl=32ms E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan E: Ad=85(I) Atr=03(Int.) MxPS= 8 Ivl=32ms E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none) E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms Signed-off-by: Kyoungkyu Park Acked-by: Bjørn Mork Link: https://lore.kernel.org/r/Yd+nxAA6KorDpQFv@choryu-tfx5470h Signed-off-by: Jakub Kicinski commit c0fe82baaeb2719f910359684c0817057f79a84a Merge: c40238e3b8c98 df0cc57e057f1 Author: Jason Gunthorpe Date: Thu Jan 13 13:21:03 2022 -0400 Merge tag 'v5.16' into rdma.git for-next To resolve minor conflict in: drivers/infiniband/hw/mlx5/mlx5_ib.h By merging both hunks. Signed-off-by: Jason Gunthorpe commit feb7a43de5ef625ad74097d8fd3481d5dbc06a59 Merge: fd04899208d20 74a5257a0c175 Author: Linus Torvalds Date: Thu Jan 13 09:05:29 2022 -0800 Merge tag 'irq-msi-2022-01-13' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull MSI irq updates from Thomas Gleixner: "Rework of the MSI interrupt infrastructure. This is a treewide cleanup and consolidation of MSI interrupt handling in preparation for further changes in this area which are necessary to: - address existing shortcomings in the VFIO area - support the upcoming Interrupt Message Store functionality which decouples the message store from the PCI config/MMIO space" * tag 'irq-msi-2022-01-13' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (94 commits) genirq/msi: Populate sysfs entry only once PCI/MSI: Unbreak pci_irq_get_affinity() genirq/msi: Convert storage to xarray genirq/msi: Simplify sysfs handling genirq/msi: Add abuse prevention comment to msi header genirq/msi: Mop up old interfaces genirq/msi: Convert to new functions genirq/msi: Make interrupt allocation less convoluted platform-msi: Simplify platform device MSI code platform-msi: Let core code handle MSI descriptors bus: fsl-mc-msi: Simplify MSI descriptor handling soc: ti: ti_sci_inta_msi: Remove ti_sci_inta_msi_domain_free_irqs() soc: ti: ti_sci_inta_msi: Rework MSI descriptor allocation NTB/msi: Convert to msi_on_each_desc() PCI: hv: Rework MSI handling powerpc/mpic_u3msi: Use msi_for_each-desc() powerpc/fsl_msi: Use msi_for_each_desc() powerpc/pasemi/msi: Convert to msi_on_each_dec() powerpc/cell/axon_msi: Convert to msi_on_each_desc() powerpc/4xx/hsta: Rework MSI handling ... commit fd04899208d2057b2de808e8447cfd806fd0a607 Merge: 147cc5838c0f5 35e13e9da9afb Author: Linus Torvalds Date: Thu Jan 13 09:02:27 2022 -0800 Merge tag 'timers-core-2022-01-13' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull timer updates from Thomas Gleixner: "Updates for the time(r) subsystem: Core: - Make the clocksource watchdog more robust by better validation checks of the measurement. Drivers: - New drivers for MStar and SSD20xd SOCs - The usual cleanups and improvements all over the place" * tag 'timers-core-2022-01-13' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: dt-bindings: timer: Add Mstar MSC313e timer devicetree bindings documentation clocksource/drivers/msc313e: Add support for ssd20xd-based platforms clocksource/drivers: Add MStar MSC313e timer support clocksource/drivers/pistachio: Fix -Wunused-but-set-variable warning clocksource/drivers/timer-imx-sysctr: Set cpumask to cpu_possible_mask clocksource/drivers/imx-sysctr: Mark two variable with __ro_after_init clocksource/drivers/renesas,ostm: Make RENESAS_OSTM symbol visible clocksource/drivers/renesas-ostm: Add RZ/G2L OSTM support dt-bindings: timer: renesas: ostm: Document Renesas RZ/G2L OSTM clocksource/drivers/exynos_mct: Fix silly typo resulting in checkpatch warning clocksource: Reduce the default clocksource_watchdog() retries to 2 clocksource: Avoid accidental unstable marking of clocksources dt-bindings: timer: tpm-timer: Add imx8ulp compatible string reset: Add of_reset_control_get_optional_exclusive() clocksource/drivers/exynos_mct: Refactor resources allocation dt-bindings: timer: remove rockchip,rk3066-timer compatible string from rockchip,rk-timer.yaml dt-bindings: timer: cadence_ttc: Add power-domains commit 147cc5838c0f5c76e908b816e924ca378e0d4735 Merge: 455e73a07f6e2 67d50b5f9114a Author: Linus Torvalds Date: Thu Jan 13 08:53:45 2022 -0800 Merge tag 'irq-core-2022-01-13' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull irq updates from Thomas Gleixner: "Updates for the interrupt subsystem: Core: - Provide a new interface for affinity hints to provide a separation between hint and actual affinity change which has become a hidden property of the current interface - Fix up the in tree usage of the affinity hint interfaces Drivers: - No new irqchip drivers! - Fix GICv3 redistributor table reservation with RT across kexec - Fix GICv4.1 redistributor view of the VPE table across kexec - Add support for extra interrupts on spear-shirq - Make obtaining some interrupts optional for the Renesas drivers - Various cleanups and bug fixes" * tag 'irq-core-2022-01-13' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (25 commits) irqchip/renesas-intc-irqpin: Use platform_get_irq_optional() to get the interrupt irqchip/renesas-irqc: Use platform_get_irq_optional() to get the interrupt irqchip/gic-v4: Disable redistributors' view of the VPE table at boot time irqchip/ingenic-tcu: Use correctly sized arguments for bit field irqchip/gic-v2m: Add const to of_device_id irqchip/imx-gpcv2: Mark imx_gpcv2_instance with __ro_after_init irqchip/spear-shirq: Add support for IRQ 0..6 irqchip/gic-v3-its: Limit memreserve cpuhp state lifetime irqchip/gic-v3-its: Postpone LPI pending table freeing and memreserve irqchip/gic-v3-its: Give the percpu rdist struct its own flags field net/mlx4: Use irq_update_affinity_hint() net/mlx5: Use irq_set_affinity_and_hint() hinic: Use irq_set_affinity_and_hint() scsi: lpfc: Use irq_set_affinity() mailbox: Use irq_update_affinity_hint() ixgbe: Use irq_update_affinity_hint() be2net: Use irq_update_affinity_hint() enic: Use irq_update_affinity_hint() RDMA/irdma: Use irq_update_affinity_hint() scsi: mpt3sas: Use irq_set_affinity_and_hint() ... commit 87c71931633bd15e9cfd51d4a4d9cd685e8cdb55 Merge: f5d3ca6fffeb7 73a0c2be75cf7 Author: Bjorn Helgaas Date: Thu Jan 13 09:57:53 2022 -0600 Merge branch 'pci/driver-cleanup' - Use of_device_get_match_data(), not of_match_device(), when we only need the device data in altera, artpec6, cadence, designware-plat, dra7xx, keystone, kirin (Fan Fei) - Drop pointless of_device_get_match_data() cast in j721e (Bjorn Helgaas) - Drop redundant struct device * from j721e since struct cdns_pcie already has one (Bjorn Helgaas) - Rename driver structs to *_pcie in intel-gw, iproc, ls-gen4, mediatek-gen3, microchip, mt7621, rcar-gen2, tegra194, uniphier, xgene, xilinx, xilinx-cpm for consistency across drivers (Fan Fei) - Fix invalid address space conversions in hisi, spear13xx (Bjorn Helgaas) * pci/driver-cleanup: PCI: spear13xx: Avoid invalid address space conversions PCI: hisi: Avoid invalid address space conversions PCI: xilinx-cpm: Rename xilinx_cpm_pcie_port to xilinx_cpm_pcie PCI: xilinx: Rename xilinx_pcie_port to xilinx_pcie PCI: xgene: Rename xgene_pcie_port to xgene_pcie PCI: uniphier: Rename uniphier_pcie_priv to uniphier_pcie PCI: tegra194: Rename tegra_pcie_dw to tegra194_pcie PCI: rcar-gen2: Rename rcar_pci_priv to rcar_pci PCI: mt7621: Rename mt7621_pci_ to mt7621_pcie_ PCI: microchip: Rename mc_port to mc_pcie PCI: mediatek-gen3: Rename mtk_pcie_port to mtk_gen3_pcie PCI: ls-gen4: Rename ls_pcie_g4 to ls_g4_pcie PCI: iproc: Rename iproc_pcie_pltfm_ to iproc_pltfm_pcie_ PCI: iproc: Rename iproc_pcie_bcma_ to iproc_bcma_pcie_ PCI: intel-gw: Rename intel_pcie_port to intel_pcie PCI: j721e: Drop redundant struct device * PCI: j721e: Drop pointless of_device_get_match_data() cast PCI: kirin: Prefer of_device_get_match_data() PCI: keystone: Prefer of_device_get_match_data() PCI: dra7xx: Prefer of_device_get_match_data() PCI: designware-plat: Prefer of_device_get_match_data() PCI: cadence: Prefer of_device_get_match_data() PCI: artpec6: Prefer of_device_get_match_data() PCI: altera: Prefer of_device_get_match_data() # Conflicts: # drivers/pci/controller/pcie-mt7621.c commit f5d3ca6fffeb71f304a7accae229c279e70b2216 Merge: da43f08db2369 c78b9a9cbde5f Author: Bjorn Helgaas Date: Thu Jan 13 09:57:52 2022 -0600 Merge branch 'pci/errors' - Add PCI_ERROR_RESPONSE and related definitions for signaling and checking for transaction errors on PCI (Naveen Naidu) - Fabricate PCI_ERROR_RESPONSE data (~0) in config read wrappers, instead of in host controller drivers, when transactions fail on PCI (Naveen Naidu) - Use PCI_POSSIBLE_ERROR() to check for possible failure of config reads (Naveen Naidu) * pci/errors: PCI: xgene: Use PCI_ERROR_RESPONSE to identify config read errors PCI: hv: Use PCI_ERROR_RESPONSE to identify config read errors PCI: keystone: Use PCI_ERROR_RESPONSE to identify config read errors PCI: Use PCI_ERROR_RESPONSE to identify config read errors PCI: cpqphp: Use PCI_POSSIBLE_ERROR() to check config reads PCI/PME: Use PCI_POSSIBLE_ERROR() to check config reads PCI/DPC: Use PCI_POSSIBLE_ERROR() to check config reads PCI: pciehp: Use PCI_POSSIBLE_ERROR() to check config reads PCI: vmd: Use PCI_POSSIBLE_ERROR() to check config reads PCI/ERR: Use PCI_POSSIBLE_ERROR() to check config reads PCI: rockchip-host: Drop error data fabrication when config read fails PCI: rcar-host: Drop error data fabrication when config read fails PCI: altera: Drop error data fabrication when config read fails PCI: mvebu: Drop error data fabrication when config read fails PCI: aardvark: Drop error data fabrication when config read fails PCI: kirin: Drop error data fabrication when config read fails PCI: histb: Drop error data fabrication when config read fails PCI: exynos: Drop error data fabrication when config read fails PCI: mediatek: Drop error data fabrication when config read fails PCI: iproc: Drop error data fabrication when config read fails PCI: thunder: Drop error data fabrication when config read fails PCI: Drop error data fabrication when config read fails PCI: Use PCI_SET_ERROR_RESPONSE() for disconnected devices PCI: Set error response data when config read fails PCI: Add PCI_ERROR_RESPONSE and related definitions commit da43f08db236987f9421ccb14a675ce8bfd51707 Merge: 2709f0338d4c8 560dbc4654fa0 Author: Bjorn Helgaas Date: Thu Jan 13 09:57:52 2022 -0600 Merge branch 'pci/misc' - Sort Intel Device IDs by value (Andy Shevchenko) - Change Capability offsets to hex to match spec (Baruch Siach) - Correct misspellings (Krzysztof Wilczyński) - Terminate statement with semicolon in pci_endpoint_test.c (Ming Wang) * pci/misc: misc: pci_endpoint_test: Terminate statement with semicolon PCI: Correct misspelled words PCI: Change capability register offsets to hex PCI: Sort Intel Device IDs by value commit 2709f0338d4c8cb17e11b448f0257afefae57475 Merge: a99f501f3e4d2 3be9d243b2172 Author: Bjorn Helgaas Date: Thu Jan 13 09:57:51 2022 -0600 Merge branch 'remotes/lorenzo/pci/bridge-emul' - Make emulated ROM BAR read-only by default (Pali Rohár) - Make some emulated legacy PCI bits read-only for PCIe devices (Pali Rohár) - Update reserved bits in emulated PCIe Capability (Pali Rohár) - Allow drivers to emulate different PCIe Capability versions (Pali Rohár) - Set emulated Capabilities List bit for all PCIe devices, since they must have at least a PCIe Capability (Pali Rohár) * remotes/lorenzo/pci/bridge-emul: PCI: pci-bridge-emul: Set PCI_STATUS_CAP_LIST for PCIe device PCI: pci-bridge-emul: Correctly set PCIe capabilities PCI: pci-bridge-emul: Fix definitions of reserved bits PCI: pci-bridge-emul: Properly mark reserved PCIe bits in PCI config space PCI: pci-bridge-emul: Make expansion ROM Base Address register read-only commit a99f501f3e4d203b1306303f27a5d43b2f5d184e Merge: 18b026da34c6b 61f0aa4da397b Author: Bjorn Helgaas Date: Thu Jan 13 09:57:51 2022 -0600 Merge branch 'remotes/lorenzo/pci/xilinx-nwl' - Declare bitmap correctly and as part of struct nwl_msi managed resource (Christophe JAILLET) * remotes/lorenzo/pci/xilinx-nwl: PCI: xilinx-nwl: Simplify code and fix a memory leak commit 18b026da34c6b4b01742572d334d17919d6b5bc0 Merge: ec5d85e7f0952 c7a75d07827a1 Author: Bjorn Helgaas Date: Thu Jan 13 09:57:51 2022 -0600 Merge branch 'remotes/lorenzo/pci/xgene' - Use bitmap ops for MSI allocator (Christophe JAILLET) - Fix IB window setup, which was broken by the fact that IB resources are now sorted in address order instead of DT dma-ranges order (Rob Herring) * remotes/lorenzo/pci/xgene: PCI: xgene: Fix IB window setup PCI: xgene-msi: Use bitmap_zalloc() when applicable commit ec5d85e7f0952ca72407edf9b7f5748ca6611c94 Merge: 4ceca42d396eb 922bfd001d1ac Author: Bjorn Helgaas Date: Thu Jan 13 09:57:50 2022 -0600 Merge branch 'remotes/lorenzo/pci/vmd' - Reset everything below VMD before enumerating to work around failure to enumerate NVMe devices when guest OS reboots (Nirmal Patel) - Honor platform ACPI _OSC feature negotiation for Root Ports below VMD (Kai-Heng Feng) - Add support for Raptor Lake SKUs (Karthik L Gopalakrishnan) * remotes/lorenzo/pci/vmd: PCI: vmd: Add DID 8086:A77F for all Intel Raptor Lake SKU's PCI: vmd: Honor ACPI _OSC on PCIe features PCI: vmd: Clean up domain before enumeration commit 4ceca42d396eb5b7a80301e7d49a6d0012a17a43 Merge: f0eb209fed997 d2a14b54989e9 Author: Bjorn Helgaas Date: Thu Jan 13 09:57:50 2022 -0600 Merge branch 'remotes/lorenzo/pci/rcar' - Fix aarch32 abort handler so it doesn't check the wrong bus clock before accessing the host controller (Marek Vasut) * remotes/lorenzo/pci/rcar: PCI: rcar: Check if device is runtime suspended instead of __clk_is_enabled() commit f0eb209fed997810d7af807e660b60eadad38781 Merge: 0de15dbbd648d 840a720aaa14d Author: Bjorn Helgaas Date: Thu Jan 13 09:57:50 2022 -0600 Merge branch 'remotes/lorenzo/pci/qcom' - Undo PM setup in qcom_pcie_probe() error handling path (Christophe JAILLET) - Use __be16 type to store return value from cpu_to_be16() (Manivannan Sadhasivam) - Constify static dw_pcie_ep_ops (Rikard Falkeborn) * remotes/lorenzo/pci/qcom: PCI: qcom-ep: Constify static dw_pcie_ep_ops PCI: qcom: Use __be16 type to store return value from cpu_to_be16() PCI: qcom: Fix an error handling path in 'qcom_pcie_probe()' commit 0de15dbbd648dc4f941d4d79da5ec0615c966545 Merge: fc10f9d6671a3 0746ae1be1217 Author: Bjorn Helgaas Date: Thu Jan 13 09:57:49 2022 -0600 Merge branch 'remotes/lorenzo/pci/mvebu' - Implement pci_remap_iospace() for ARM so mvebu can use devm_pci_remap_iospace() instead of the previous ARM-specific pci_ioremap_io() interface (Pali Rohár) - Use the standard pci_host_probe() instead of the device-specific mvebu_pci_host_probe() (Pali Rohár) - Replace all uses of ARM-specific pci_ioremap_io() with the ARM implementation of the standard pci_remap_iospace() interface and remove pci_ioremap_io() (Pali Rohár) - Skip initializing invalid Root Ports (Pali Rohár) - Check for errors from pci_bridge_emul_init() (Pali Rohár) - Ignore any bridges at non-zero function numbers (Pali Rohár) - Return ~0 data for invalid config read size (Pali Rohár) - Disallow mapping interrupts on emulated bridges (Pali Rohár) - Clear Root Port Memory & I/O Space Enable and Bus Master Enable at initialization (Pali Rohár) - Make type bits in Root Port I/O Base register read-only (Pali Rohár) - Disable Root Port windows when base/limit set to invalid values (Pali Rohár) - Set controller to Root Complex mode (Pali Rohár) - Set Root Port Class Code to PCI Bridge (Pali Rohár) - Update emulated Root Port secondary bus numbers to better reflect the actual topology (Pali Rohár) - Add PCI_BRIDGE_CTL_BUS_RESET support to emulated Root Ports so pci_reset_secondary_bus() can reset connected devices (Pali Rohár) - Add PCI_EXP_DEVCTL Error Reporting Enable support to emulated Root Ports (Pali Rohár) - Add PCI_EXP_RTSTA PME Status bit support to emulated Root Ports (Pali Rohár) - Add DEVCAP2, DEVCTL2 and LNKCTL2 support to emulated Root Ports on Armada XP and newer devices (Pali Rohár) - Export mvebu-mbus.c symbols to allow pci-mvebu.c to be a module (Pali Rohár) - Add support for compiling as a module (Pali Rohár) * remotes/lorenzo/pci/mvebu: PCI: mvebu: Add support for compiling driver as module bus: mvebu-mbus: Export symbols for public API window functions PCI: mvebu: Fix support for DEVCAP2, DEVCTL2 and LNKCTL2 registers on emulated bridge PCI: mvebu: Fix support for PCI_EXP_RTSTA on emulated bridge PCI: mvebu: Fix support for PCI_EXP_DEVCTL on emulated bridge PCI: mvebu: Fix support for PCI_BRIDGE_CTL_BUS_RESET on emulated bridge PCI: mvebu: Fix configuring secondary bus of PCIe Root Port via emulated bridge PCI: mvebu: Set PCI Bridge Class Code to PCI Bridge PCI: mvebu: Setup PCIe controller to Root Complex mode PCI: mvebu: Propagate errors when updating PCI_IO_BASE and PCI_MEM_BASE registers PCI: mvebu: Do not modify PCI IO type bits in conf_write PCI: mvebu: Fix support for bus mastering and PCI_COMMAND on emulated bridge PCI: mvebu: Disallow mapping interrupts on emulated bridges PCI: mvebu: Handle invalid size of read config request PCI: mvebu: Check that PCI bridge specified in DT has function number zero PCI: mvebu: Check for errors from pci_bridge_emul_init() call PCI: mvebu: Check for valid ports arm: ioremap: Remove unused ARM-specific function pci_ioremap_io() arm: ioremap: Replace pci_ioremap_io() usage by pci_remap_iospace() PCI: mvebu: Remove custom mvebu_pci_host_probe() function PCI: mvebu: Replace pci_ioremap_io() usage by devm_pci_remap_iospace() arm: ioremap: Implement standard PCI function pci_remap_iospace() commit fc10f9d6671a3aacf1161dcc52582c27e3585a64 Merge: 96fe57938406c 44ddb791f8f41 Author: Bjorn Helgaas Date: Thu Jan 13 09:57:49 2022 -0600 Merge branch 'pci/host/mt7621' - Declare mt7621_pci_ops static (Sergio Paracuellos) - Give pcibios_root_bridge_prepare() access to host bridge windows (Sergio Paracuellos) - Move MIPS I/O coherency unit setup from driver to pcibios_root_bridge_prepare() (Sergio Paracuellos) - Add missing MODULE_LICENSE() (Sergio Paracuellos) - Allow COMPILE_TEST for all arches (Sergio Paracuellos) * pci/host/mt7621: PCI: mt7621: Allow COMPILE_TEST for all arches PCI: mt7621: Add missing MODULE_LICENSE() PCI: mt7621: Move MIPS setup to pcibios_root_bridge_prepare() PCI: Let pcibios_root_bridge_prepare() access bridge->windows PCI: mt7621: Declare mt7621_pci_ops static commit 96fe57938406c37507e90da1ac2f325458798025 Merge: fd785c64f3554 ab344fd43f295 Author: Bjorn Helgaas Date: Thu Jan 13 09:57:48 2022 -0600 Merge branch 'remotes/lorenzo/pci/mediatek-gen3' - Disable Mediatek DVFSRC voltage request since lack of DVFSRC to respond to the request causes failure to exit L1 PM Substate (Jianjun Wang) * remotes/lorenzo/pci/mediatek-gen3: PCI: mediatek-gen3: Disable DVFSRC voltage request commit fd785c64f3554a15a70a27486f81d38af397feca Merge: 0dfa6f6e68858 65ace9a85fa7f Author: Bjorn Helgaas Date: Thu Jan 13 09:57:48 2022 -0600 Merge branch 'remotes/lorenzo/pci/mediatek' - Assert PERST# for 100ms to allow power and clock to stabilize (qizhong cheng) * remotes/lorenzo/pci/mediatek: PCI: mediatek: Assert PERST# for 100ms for power and clock to stabilize commit 0dfa6f6e68858e8a7a22cde98e2c0866c29cc9eb Merge: 6553ff3dd95f9 7dcf07ac88676 Author: Bjorn Helgaas Date: Thu Jan 13 09:57:48 2022 -0600 Merge branch 'remotes/lorenzo/pci/keystone' - Add register offset for ti,syscon-pcie-id and ti,syscon-pcie-mode DT properties (Kishon Vijay Abraham I) * remotes/lorenzo/pci/keystone: PCI: keystone: Use phandle argument from "ti,syscon-pcie-id"/"ti,syscon-pcie-mode" dt-bindings: PCI: ti,am65: Fix "ti,syscon-pcie-id"/"ti,syscon-pcie-mode" to take argument commit 6553ff3dd95f9e53faffab50a049222ae2c084f7 Merge: 28b75189f038a d9932b4691566 Author: Bjorn Helgaas Date: Thu Jan 13 09:57:47 2022 -0600 Merge branch 'pci/host/hv' - Add hv-internal interfaces to encapsulate arch IRQ dependencies (Sunil Muthuswamy) - Add arm64 Hyper-V vPCI support (Sunil Muthuswamy) * pci/host/hv: PCI: hv: Add arm64 Hyper-V vPCI support PCI: hv: Make the code arch neutral by adding arch specific interfaces commit 28b75189f038af1392142906d9ff29bea46f8e4c Merge: 2948ce70e636d 50b620303a14e Author: Bjorn Helgaas Date: Thu Jan 13 09:57:47 2022 -0600 Merge branch 'remotes/lorenzo/pci/endpoint' - Return failure from pci_epc_set_msi() if no interrupts are available (Li Chen) * remotes/lorenzo/pci/endpoint: PCI: endpoint: Return -EINVAL when interrupts num is smaller than 1 commit 2948ce70e636d3803a17baa25d5e7d1e8ec844ae Merge: c5f62d30e99cc d23f0c11aca27 Author: Bjorn Helgaas Date: Thu Jan 13 09:57:47 2022 -0600 Merge branch 'remotes/lorenzo/pci/dwc' - Don't ioremap NULL when DT lacks ATU resource (Tim Harvey) - Drop redundant qcom-ep error message for platform_get_irq_byname() failure (Krzysztof Wilczyński) - Add i.MX8MM support (Richard Zhu) - Use DWC common ops instead of layerscape-specific link-up functions (Hou Zhiqiang) * remotes/lorenzo/pci/dwc: PCI: layerscape: Change to use the DWC common link-up check function PCI: imx: Add the imx8mm pcie support dt-bindings: imx6q-pcie: Add PHY phandles and name properties PCI: qcom-ep: Remove surplus dev_err() when using platform_get_irq_byname() PCI: dwc: Do not remap invalid res commit c5f62d30e99cc0d111bfba9d33ed05d576b3f7ee Merge: 3164f27b5fd69 11ed8b8624b80 Author: Bjorn Helgaas Date: Thu Jan 13 09:57:46 2022 -0600 Merge branch 'pci/host/brcmstb' - Declare bitmap correctly for use by bitmap interfaces (Christophe JAILLET) - Clean up computation of legacy and non-legacy MSI bitmasks (Florian Fainelli) - Update suspend/resume/remove error handling to warn about errors and not fail the operation (Jim Quinlan) - Correct the "pcie" and "msi" interrupt descriptions in DT binding (Jim Quinlan) - Add DT bindings for endpoint voltage regulators (Jim Quinlan) - Split brcm_pcie_setup() into two functions (Jim Quinlan) - Add mechanism for turning on voltage regulators for connected devices (Jim Quinlan) - Turn voltage regulators for connected devices on/off when bus is added or removed (Jim Quinlan) - When suspending, don't turn off voltage regulators for wakeup devices (Jim Quinlan) * pci/host/brcmstb: PCI: brcmstb: Do not turn off WOL regulators on suspend PCI: brcmstb: Add control of subdevice voltage regulators PCI: brcmstb: Add mechanism to turn on subdev regulators PCI: brcmstb: Split brcm_pcie_setup() into two funcs dt-bindings: PCI: Add bindings for Brcmstb EP voltage regulators dt-bindings: PCI: Correct brcmstb interrupts, interrupt-map. PCI: brcmstb: Fix function return value handling PCI: brcmstb: Do not use __GENMASK PCI: brcmstb: Declare 'used' as bitmap, not unsigned long commit 3164f27b5fd692ef6e0a5464b31534d09cc73949 Merge: 800cee8b04d18 75d36df680783 Author: Bjorn Helgaas Date: Thu Jan 13 09:57:46 2022 -0600 Merge branch 'remotes/lorenzo/pci/apple' - Enable clock gating to save power (Hector Martin) - Fix REFCLK1 enable/poll logic (Hector Martin) * remotes/lorenzo/pci/apple: PCI: apple: Fix REFCLK1 enable/poll logic PCI: apple: Enable clock gating commit 800cee8b04d18db7ea4140aa6fb294508a2d20eb Merge: d03f92c43f974 2070b2ddea89f Author: Bjorn Helgaas Date: Thu Jan 13 09:57:46 2022 -0600 Merge branch 'remotes/lorenzo/pci/aardvark' - Add bridge emulation definitions for PCIe DEVCAP2, DEVCTL2, DEVSTA2, LNKCAP2, LNKCTL2, LNKSTA2, SLTCAP2, SLTCTL2, SLTSTA2 (Pali Rohár) - Add aardvark support for DEVCAP2, DEVCTL2, LNKCAP2 and LNKCTL2 registers (Pali Rohár) - Clear all MSIs at setup to avoid spurious interrupts (Pali Rohár) - Disable bus mastering when unbinding host controller driver (Pali Rohár) - Mask all interrupts when unbinding host controller driver (Pali Rohár) - Fix memory leak in host controller unbind (Pali Rohár) - Assert PERST# when unbinding host controller driver (Pali Rohár) - Disable link training when unbinding host controller driver (Pali Rohár) - Disable common PHY when unbinding host controller driver (Pali Rohár) - Fix resource type checking to check only IORESOURCE_MEM, not IORESOURCE_MEM_64, which is a flavor of IORESOURCE_MEM (Pali Rohár) * remotes/lorenzo/pci/aardvark: PCI: aardvark: Fix checking for MEM resource type PCI: aardvark: Disable common PHY when unbinding driver PCI: aardvark: Disable link training when unbinding driver PCI: aardvark: Assert PERST# when unbinding driver PCI: aardvark: Fix memory leak in driver unbind PCI: aardvark: Mask all interrupts when unbinding driver PCI: aardvark: Disable bus mastering when unbinding driver PCI: aardvark: Comment actions in driver remove method PCI: aardvark: Clear all MSIs at setup PCI: aardvark: Add support for DEVCAP2, DEVCTL2, LNKCAP2 and LNKCTL2 registers on emulated bridge PCI: pci-bridge-emul: Add definitions for missing capabilities registers PCI: pci-bridge-emul: Add description for class_revision field commit d03f92c43f9741c06ab1e4ff9b51830705cfa176 Merge: 54f98a8b1382b e445375882883 Author: Bjorn Helgaas Date: Thu Jan 13 09:57:45 2022 -0600 Merge branch 'pci/virtualization' - Add function 1 DMA alias quirk for Marvell 88SE9125 SATA controller so it can work with an IOMMU (Yifeng Li) * pci/virtualization: PCI: Add function 1 DMA alias quirk for Marvell 88SE9125 SATA controller commit 54f98a8b1382bbb387dd23d6a289f88ded78cb2f Merge: 05642e2f64600 b76521f6482d2 Author: Bjorn Helgaas Date: Thu Jan 13 09:57:45 2022 -0600 Merge branch 'pci/switchtec' - Add Gen4 automotive device IDs (Kelvin Cao) - Declare state_names[] as static so it's not allocated and initialized for every call (Kelvin Cao) * pci/switchtec: PCI/switchtec: Declare local state_names[] as static PCI/switchtec: Add Gen4 automotive device IDs commit 05642e2f64600a54f076dd0a3bbe2518d4c5cfe7 Merge: c6ff0f8dc05fc 500b55b05d0a2 Author: Bjorn Helgaas Date: Thu Jan 13 09:57:45 2022 -0600 Merge branch 'pci/resource' - Always write Intel I210 ROM BAR on update to work around device defect (Bjorn Helgaas) * pci/resource: PCI: Work around Intel I210 ROM BAR overlap defect commit c6ff0f8dc05fc4137e0bc4a2e2d468430027df98 Merge: 446cc1c51a5a5 69f457b18fa2b Author: Bjorn Helgaas Date: Thu Jan 13 09:57:44 2022 -0600 Merge branch 'pci/p2pdma' - Add Logan Gunthorpe as P2PDMA maintainer (Bjorn Helgaas) - Optimize by using percpu_ref_tryget_live_rcu() inside RCU critical section (Christophe JAILLET) * pci/p2pdma: PCI/P2PDMA: Use percpu_ref_tryget_live_rcu() inside RCU critical section MAINTAINERS: Add Logan Gunthorpe as P2PDMA maintainer commit 446cc1c51a5a562fea13bdf875d77e813615058d Merge: 7475f9319adc8 0aeddbd0cb078 Author: Bjorn Helgaas Date: Thu Jan 13 09:57:44 2022 -0600 Merge branch 'pci/legacy-pm-removal' - Convert amd64-agp, sis-agp, via-agp from legacy PCI power management to generic power management (Vaibhav Gupta) * pci/legacy-pm-removal: via-agp: convert to generic power management sis-agp: convert to generic power management amd64-agp: convert to generic power management commit 7475f9319adc8fc3d3fbb34e6271e4e376c4d7f7 Merge: fb6c45130a4ad 085a9f43433f3 Author: Bjorn Helgaas Date: Thu Jan 13 09:57:43 2022 -0600 Merge branch 'pci/hotplug' - Fix infinite loop in pciehp IRQ handler on power fault (Lukas Wunner) - Removed commented-out ibmphp functions (Vihas Mak) - Fix pciehp lockdep errors on Thunderbolt undock (Hans de Goede) * pci/hotplug: PCI: pciehp: Use down_read/write_nested(reset_lock) to fix lockdep errors PCI: ibmphp: Remove commented-out functions PCI: pciehp: Fix infinite loop in IRQ handler upon power fault commit fb6c45130a4ad48cc7bf27399fe812379de013a8 Merge: 7498e41fb537d 346865f074535 Author: Bjorn Helgaas Date: Thu Jan 13 09:57:43 2022 -0600 Merge branch 'pci/enumeration' - Use pci_find_vsec_capability() instead of open-coding it (Andy Shevchenko) - Convert pci_dev_present() stub from macro to static inline to avoid 'unused variable' errors (Hans de Goede) - Convert sysfs slot attributes from default_attrs to default_groups (Greg Kroah-Hartman) - Use DWORD accesses for LTR, L1 SS to avoid BayHub OZ711LV2 erratum (Rajat Jain) - Remove unnecessary initialization of static variables (Longji Guo) * pci/enumeration: x86/PCI: Remove initialization of static variables to false PCI: Use DWORD accesses for LTR, L1 SS to avoid erratum PCI/sysfs: Use default_groups in kobj_type for slot attrs PCI: Convert pci_dev_present() stub to static inline PCI: Use pci_find_vsec_capability() when looking for TBT devices commit 7498e41fb537d7174d12f564e9dd7009b3a02c5f Merge: fa55b7dcdc43c fa285baf84430 Author: Bjorn Helgaas Date: Thu Jan 13 09:57:43 2022 -0600 Merge branch 'pci/aspm' - Calculate link L0s and L1 exit latencies when needed instead of caching them (Saheed O. Bolarinwa) - Calculate device L0s and L1 acceptable exit latencies when needed instead of caching them (Saheed O. Bolarinwa) - Remove struct aspm_latency since it's no longer needed (Saheed O. Bolarinwa) * pci/aspm: PCI/ASPM: Remove struct aspm_latency PCI/ASPM: Stop caching device L0s, L1 acceptable exit latencies PCI/ASPM: Stop caching link L0s, L1 exit latencies PCI/ASPM: Move pci_function_0() upward commit 285ac8dca4df48e9a29fcc1c7f27602e1299a819 Author: Colin Ian King Date: Thu Jan 13 09:24:17 2022 +0000 kernel: Fix spelling mistake "compresser" -> "compressor" There is a spelling mistake in a pr_err error message. Fix it. Signed-off-by: Colin Ian King Signed-off-by: Luis Chamberlain commit 1a48db3fef499f615b56093947ec4b0d3d8e3021 Author: Anna Schumaker Date: Mon Nov 15 11:54:25 2021 -0500 sunrpc: Fix potential race conditions in rpc_sysfs_xprt_state_change() We need to use test_and_set_bit() when changing xprt state flags to avoid potentially getting xps->xps_nactive out of sync. Signed-off-by: Anna Schumaker commit 776d794f28c95051bc70405a7b1fa40115658a18 Author: Xiyu Yang Date: Thu Sep 9 12:32:38 2021 +0800 net/sunrpc: fix reference count leaks in rpc_sysfs_xprt_state_change The refcount leak issues take place in an error handling path. When the 3rd argument buf doesn't match with "offline", "online" or "remove", the function simply returns -EINVAL and forgets to decrease the reference count of a rpc_xprt object and a rpc_xprt_switch object increased by rpc_sysfs_xprt_kobj_get_xprt() and rpc_sysfs_xprt_kobj_get_xprt_switch(), causing reference count leaks of both unused objects. Fix this issue by jumping to the error handling path labelled with out_put when buf matches none of "offline", "online" or "remove". Signed-off-by: Xiyu Yang Signed-off-by: Xin Xiong Signed-off-by: Xin Tan Signed-off-by: Anna Schumaker commit 4ca9f31a2be66d5fbf34b5b91ef17de7480992e1 Author: Olga Kornievskaia Date: Thu Dec 9 14:53:35 2021 -0500 NFSv4.1 test and add 4.1 trunking transport For each location returned in FS_LOCATION query, establish a transport to the server, send EXCHANGE_ID and test for trunking, if successful, add the transport to the exiting client. Signed-off-by: Olga Kornievskaia Signed-off-by: Anna Schumaker commit b8a09619a56334414cbd7f935a0796240d0cc07e Author: Olga Kornievskaia Date: Thu Dec 9 14:53:34 2021 -0500 SUNRPC allow for unspecified transport time in rpc_clnt_add_xprt If the supplied argument doesn't specify the transport type, use the type of the existing rpc clnt and its existing transport. Signed-off-by: Olga Kornievskaia Signed-off-by: Anna Schumaker commit a8d54baba7c65db2d3278873def61f8d3753d766 Author: Olga Kornievskaia Date: Thu Dec 9 14:53:33 2021 -0500 NFSv4 handle port presence in fs_location server string An fs_location attribute returns a string that can be ipv4, ipv6, or DNS name. An ip location can have a port appended to it and if no port is present a default port needs to be set. If rpc_pton() fails to parse, try calling rpc_uaddr2socaddr() that can convert an universal address. Signed-off-by: Olga Kornievskaia Signed-off-by: Anna Schumaker commit f5b27cc6761e27ee6387a24df1a99ca77b360fea Author: Olga Kornievskaia Date: Thu Dec 9 14:53:32 2021 -0500 NFSv4 expose nfs_parse_server_name function Make nfs_parse_server_name available outside of nfs4namespace.c. Signed-off-by: Olga Kornievskaia Signed-off-by: Anna Schumaker commit 1976b2b31462151403c9fc110204fcc2a77bdfd1 Author: Olga Kornievskaia Date: Wed Jan 12 10:27:38 2022 -0500 NFSv4.1 query for fs_location attr on a new file system Query the server for other possible trunkable locations for a given file system on a 4.1+ mount. v2: -- added missing static to nfs4_discover_trunking, reported by the kernel test robot Signed-off-by: Olga Kornievskaia Signed-off-by: Anna Schumaker commit 486e5ed88827dabd295cd55f368d513ee8c30eb1 Author: Arnaldo Carvalho de Melo Date: Thu Jul 1 13:39:15 2021 -0300 tools headers cpufeatures: Sync with the kernel sources To pick the changes from: d341db8f48ea4331 ("x86/cpufeatures: Add AMD Collaborative Processor Performance Control feature flag") This only causes these perf files to be rebuilt: CC /tmp/build/perf/bench/mem-memcpy-x86-64-asm.o CC /tmp/build/perf/bench/mem-memset-x86-64-asm.o And addresses this perf build warning: Warning: Kernel ABI header at 'tools/arch/x86/include/asm/cpufeatures.h' differs from latest version at 'arch/x86/include/asm/cpufeatures.h' diff -u tools/arch/x86/include/asm/cpufeatures.h arch/x86/include/asm/cpufeatures.h Cc: Huang Rui Cc: Rafael J. Wysocki Signed-off-by: Arnaldo Carvalho de Melo commit f1dcda0f79548c04f585108e2e165cb4fec951e8 Author: Arnaldo Carvalho de Melo Date: Mon May 3 11:48:26 2021 -0300 tools headers UAPI: Update tools's copy of drm.h header Picking the changes from: 43d5ac7d07023cd1 ("drm: document DRM_IOCTL_MODE_GETFB2") It is just a comment, so no changes and silences 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 35cb8c713a496e8c114eed5e2a5a30b359876df2 Author: Arnaldo Carvalho de Melo Date: Sun May 9 10:19:37 2021 -0300 tools arch: Update arch/x86/lib/mem{cpy,set}_64.S copies used in 'perf bench mem memcpy' To bring in the change made in this cset: f94909ceb1ed4bfd ("x86: Prepare asm files for straight-line-speculation") It silences these perf tools build warnings, no change in the tools: Warning: Kernel ABI header at 'tools/arch/x86/lib/memcpy_64.S' differs from latest version at 'arch/x86/lib/memcpy_64.S' diff -u tools/arch/x86/lib/memcpy_64.S arch/x86/lib/memcpy_64.S Warning: Kernel ABI header at 'tools/arch/x86/lib/memset_64.S' differs from latest version at 'arch/x86/lib/memset_64.S' diff -u tools/arch/x86/lib/memset_64.S arch/x86/lib/memset_64.S The code generated was checked before and after using 'objdump -d /tmp/build/perf/bench/mem-memcpy-x86-64-asm.o', no changes. Cc: Borislav Petkov Cc: Peter Zijlstra Signed-off-by: Arnaldo Carvalho de Melo commit 1aa77e716c6f2332f2d4664f747ff4eba731825b Merge: c0dd94558d0e4 455e73a07f6e2 Author: Arnaldo Carvalho de Melo Date: Thu Jan 13 10:20:59 2022 -0300 Merge remote-tracking branch 'torvalds/master' into perf/core To pick up fixes and get in line with other trees, powerpc kernel mostly this time, but BPF as well. Signed-off-by: Arnaldo Carvalho de Melo commit 20c9398d3309d170300d67643b851fd26783af24 Author: Wen Gu Date: Thu Jan 13 16:36:42 2022 +0800 net/smc: Resolve the race between SMC-R link access and clear We encountered some crashes caused by the race between SMC-R link access and link clear that triggered by abnormal link group termination, such as port error. Here is an example of this kind of crashes: BUG: kernel NULL pointer dereference, address: 0000000000000000 Workqueue: smc_hs_wq smc_listen_work [smc] RIP: 0010:smc_llc_flow_initiate+0x44/0x190 [smc] Call Trace: ? __smc_buf_create+0x75a/0x950 [smc] smcr_lgr_reg_rmbs+0x2a/0xbf [smc] smc_listen_work+0xf72/0x1230 [smc] ? process_one_work+0x25c/0x600 process_one_work+0x25c/0x600 worker_thread+0x4f/0x3a0 ? process_one_work+0x600/0x600 kthread+0x15d/0x1a0 ? set_kthread_struct+0x40/0x40 ret_from_fork+0x1f/0x30 smc_listen_work() __smc_lgr_terminate() --------------------------------------------------------------- | smc_lgr_free() | |- smcr_link_clear() | |- memset(lnk, 0) smc_listen_rdma_reg() | |- smcr_lgr_reg_rmbs() | |- smc_llc_flow_initiate() | |- access lnk->lgr (panic) | These crashes are similarly caused by clearing SMC-R link resources when some functions is still accessing to them. This patch tries to fix the issue by introducing reference count of SMC-R links and ensuring that the sensitive resources of links won't be cleared until reference count reaches zero. The operation to the SMC-R link reference count can be concluded as follows: object [hold or initialized as 1] [put] -------------------------------------------------------------------- links smcr_link_init() smcr_link_clear() connections smc_conn_create() smc_conn_free() Through this way, the clear of SMC-R links is later than the free of all the smc connections above it, thus avoiding the unsafe reference to SMC-R links. Signed-off-by: Wen Gu Signed-off-by: David S. Miller commit ea89c6c0983c39702a4a52ccaa4702e0cb71179b Author: Wen Gu Date: Thu Jan 13 16:36:41 2022 +0800 net/smc: Introduce a new conn->lgr validity check helper It is no longer suitable to identify whether a smc connection is registered in a link group through checking if conn->lgr is NULL, because conn->lgr won't be reset even the connection is unregistered from a link group. So this patch introduces a new helper smc_conn_lgr_valid() and replaces all the check of conn->lgr in original implementation with the new helper to judge if conn->lgr is valid to use. Signed-off-by: Wen Gu Signed-off-by: David S. Miller commit 91341fa0003befd097e190ec2a4bf63ad957c49a Author: Eric Dumazet Date: Thu Jan 13 01:22:29 2022 -0800 inet: frags: annotate races around fqdir->dead and fqdir->high_thresh Both fields can be read/written without synchronization, add proper accessors and documentation. Fixes: d5dd88794a13 ("inet: fix various use-after-free in defrags units") Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 3ba8c6258eb19a6212b066a383788174dd9779ab Merge: de0e444706ed9 61f434b0280ed Author: David S. Miller Date: Thu Jan 13 12:55:40 2022 +0000 Merge branch 'smc-race-fixes' Wen Gu says: ==================== net/smc: Fixes for race in smc link group termination We encountered some crashes recently and they are caused by the race between the access and free of link/link group in abnormal smc link group termination. The crashes can be reproduced in frequent abnormal link group termination, like setting RNICs up/down. This set of patches tries to fix this by extending the life cycle of link/link group to ensure that they won't be referred to after cleared or freed. v1 -> v2: - Improve some comments. - Move codes of waking up lgrs_deleted wait queue from smc_lgr_free() to __smc_lgr_free(). - Move codes of waking up links_deleted wait queue from smcr_link_clear() to __smcr_link_clear(). - Move codes of smc_ibdev_cnt_dec() and put_device() from smcr_link_clear() to __smcr_link_clear() - Move smc_lgr_put() to the end of __smcr_link_clear(). - Call smc_lgr_put() after 'out' tag in smcr_link_init() when link initialization fails. - Modify the location where smc connection holds the lgr or link. before: * hold lgr in smc_lgr_register_conn(). * hold link in smcr_lgr_conn_assign_link(). after: * hold both lgr and link in smc_conn_create(). Modify the location to symmetrical with the place where smc connections put the lgr or link, which is smc_conn_free(). - Initialize conn->freed as zero in smc_conn_create(). ==================== Signed-off-by: David S. Miller commit 61f434b0280ed65495831f1b6e1a5c21a90f47c6 Author: Wen Gu Date: Thu Jan 13 16:36:40 2022 +0800 net/smc: Resolve the race between link group access and termination We encountered some crashes caused by the race between the access and the termination of link groups. Here are some of panic stacks we met: 1) Race between smc_clc_wait_msg() and __smc_lgr_terminate() BUG: kernel NULL pointer dereference, address: 00000000000002f0 Workqueue: smc_hs_wq smc_listen_work [smc] RIP: 0010:smc_clc_wait_msg+0x3eb/0x5c0 [smc] Call Trace: ? smc_clc_send_accept+0x45/0xa0 [smc] ? smc_clc_send_accept+0x45/0xa0 [smc] smc_listen_work+0x783/0x1220 [smc] ? finish_task_switch+0xc4/0x2e0 ? process_one_work+0x1ad/0x3c0 process_one_work+0x1ad/0x3c0 worker_thread+0x4c/0x390 ? rescuer_thread+0x320/0x320 kthread+0x149/0x190 ? set_kthread_struct+0x40/0x40 ret_from_fork+0x1f/0x30 smc_listen_work() abnormal case like port error --------------------------------------------------------------- | __smc_lgr_terminate() | |- smc_conn_kill() | |- smc_lgr_unregister_conn() | |- set conn->lgr = NULL smc_clc_wait_msg() | |- access conn->lgr (panic) | 2) Race between smc_setsockopt() and __smc_lgr_terminate() BUG: kernel NULL pointer dereference, address: 00000000000002e8 RIP: 0010:smc_setsockopt+0x17a/0x280 [smc] Call Trace: __sys_setsockopt+0xfc/0x190 __x64_sys_setsockopt+0x20/0x30 do_syscall_64+0x34/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae smc_setsockopt() abnormal case like port error -------------------------------------------------------------- | __smc_lgr_terminate() | |- smc_conn_kill() | |- smc_lgr_unregister_conn() | |- set conn->lgr = NULL mod_delayed_work() | |- access conn->lgr (panic) | There are some other panic places and they are caused by the similar reason as described above, which is accessing link group after termination, thus getting a NULL pointer or invalid resource. Currently, there seems to be no synchronization between the link group access and a sudden termination of it. This patch tries to fix this by introducing reference count of link group and not freeing link group until reference count is zero. Link group might be referred to by links or smc connections. So the operation to the link group reference count can be concluded as follows: object [hold or initialized as 1] [put] ------------------------------------------------------------------- link group smc_lgr_create() smc_lgr_free() connections smc_conn_create() smc_conn_free() links smcr_link_init() smcr_link_clear() Througth this way, we extend the life cycle of link group and ensure it is longer than the life cycle of connections and links above it, so that avoid invalid access to link group after its termination. Signed-off-by: Wen Gu Signed-off-by: David S. Miller commit de0e444706ed98f2a13275a988d8595184be6d5c Author: Li Zhijian Date: Thu Jan 13 15:28:59 2022 +0800 kselftests/net: adapt the timeout to the largest runtime timeout in settings is used by each case under the same directory, so it should adapt to the maximum runtime. A normally running net/fib_nexthops.sh may be killed by this unsuitable timeout. Furthermore, since the defect[1] of kselftests framework, net/fib_nexthops.sh which might take at least (300 * 4) seconds would block the whole kselftests framework previously. $ git grep -w 'sleep 300' tools/testing/selftests/net tools/testing/selftests/net/fib_nexthops.sh: sleep 300 tools/testing/selftests/net/fib_nexthops.sh: sleep 300 tools/testing/selftests/net/fib_nexthops.sh: sleep 300 tools/testing/selftests/net/fib_nexthops.sh: sleep 300 Enlarge the timeout by plus 300 based on the obvious largest runtime to avoid the blocking. [1]: https://www.spinics.net/lists/kernel/msg4185370.html Signed-off-by: Zhou Jie Signed-off-by: Li Zhijian Signed-off-by: David S. Miller commit 33cb0ff30cff104e753f7882c99e54cf67ea7903 Author: Vladimir Oltean Date: Wed Jan 12 22:21:27 2022 +0200 net: mscc: ocelot: don't let phylink re-enable TX PAUSE on the NPI port Since commit b39648079db4 ("net: mscc: ocelot: disable flow control on NPI interface"), flow control should be disabled on the DSA CPU port when used in NPI mode. However, the commit blamed in the Fixes: tag below broke this, because it allowed felix_phylink_mac_link_up() to overwrite SYS_PAUSE_CFG_PAUSE_ENA for the DSA CPU port. This issue became noticeable since the device tree update from commit 8fcea7be5736 ("arm64: dts: ls1028a: mark internal links between Felix and ENETC as capable of flow control"). The solution is to check whether this is the currently configured NPI port from ocelot_phylink_mac_link_up(), and to not modify the statically disabled PAUSE frame transmission if it is. When the port is configured for lossless mode as opposed to tail drop mode, but the link partner (DSA master) doesn't observe the transmitted PAUSE frames, the switch termination throughput is much worse, as can be seen below. Before: root@debian:~# iperf3 -c 192.168.100.2 Connecting to host 192.168.100.2, port 5201 [ 5] local 192.168.100.1 port 37504 connected to 192.168.100.2 port 5201 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 28.4 MBytes 238 Mbits/sec 357 22.6 KBytes [ 5] 1.00-2.00 sec 33.6 MBytes 282 Mbits/sec 426 19.8 KBytes [ 5] 2.00-3.00 sec 34.0 MBytes 285 Mbits/sec 343 21.2 KBytes [ 5] 3.00-4.00 sec 32.9 MBytes 276 Mbits/sec 354 22.6 KBytes [ 5] 4.00-5.00 sec 32.3 MBytes 271 Mbits/sec 297 18.4 KBytes ^C[ 5] 5.00-5.06 sec 2.05 MBytes 270 Mbits/sec 45 19.8 KBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-5.06 sec 163 MBytes 271 Mbits/sec 1822 sender [ 5] 0.00-5.06 sec 0.00 Bytes 0.00 bits/sec receiver After: root@debian:~# iperf3 -c 192.168.100.2 Connecting to host 192.168.100.2, port 5201 [ 5] local 192.168.100.1 port 49470 connected to 192.168.100.2 port 5201 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 112 MBytes 941 Mbits/sec 259 143 KBytes [ 5] 1.00-2.00 sec 110 MBytes 920 Mbits/sec 329 144 KBytes [ 5] 2.00-3.00 sec 112 MBytes 936 Mbits/sec 255 144 KBytes [ 5] 3.00-4.00 sec 110 MBytes 927 Mbits/sec 355 105 KBytes [ 5] 4.00-5.00 sec 110 MBytes 926 Mbits/sec 350 156 KBytes [ 5] 5.00-6.00 sec 110 MBytes 925 Mbits/sec 305 148 KBytes [ 5] 6.00-7.00 sec 110 MBytes 924 Mbits/sec 320 143 KBytes [ 5] 7.00-8.00 sec 110 MBytes 925 Mbits/sec 273 97.6 KBytes [ 5] 8.00-9.00 sec 109 MBytes 913 Mbits/sec 299 141 KBytes [ 5] 9.00-10.00 sec 110 MBytes 922 Mbits/sec 287 146 KBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.00 sec 1.08 GBytes 926 Mbits/sec 3032 sender [ 5] 0.00-10.00 sec 1.08 GBytes 925 Mbits/sec receiver Fixes: de274be32cb2 ("net: dsa: felix: set TX flow control according to the phylink_mac_link_up resolution") Reported-by: Xiaoliang Yang Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit d7b4303411025b675e8c0927307c578a0ce3f75c Author: Colin Ian King Date: Wed Jan 12 23:55:33 2022 +0000 atm: iphase: remove redundant pointer skb The pointer skb is redundant, it is assigned a value that is never read and hence can be removed. Cleans up clang scan warning: drivers/atm/iphase.c:205:18: warning: Although the value stored to 'skb' is used in the enclosing expression, the value is never actually read from 'skb' [deadcode.DeadStores] Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit a0b3a15eab6bc2e90008460b646d53e7d9dcdbbb Author: Jeff Layton Date: Mon Jan 10 18:28:33 2022 -0500 ceph: move CEPH_SUPER_MAGIC definition to magic.h The uapi headers are missing the ceph definition. Move it there so userland apps can ID cephfs. Signed-off-by: Jeff Layton Reviewed-by: Ilya Dryomov Signed-off-by: Ilya Dryomov commit 76bdbc7ac777adb6bc316bfe3f57b3de93c50985 Author: Xiubo Li Date: Thu Jan 6 09:35:52 2022 +0800 ceph: remove redundant Lsx caps check The newcaps has already included the Ls, no need to check it again. Signed-off-by: Xiubo Li Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov commit 94cc0877cad0bc6ca84686c4fa874bf530eb8b88 Author: Jeff Layton Date: Tue Nov 30 14:12:13 2021 -0500 ceph: add new "nopagecache" option CephFS is a bit unlike most other filesystems in that it only conditionally does buffered I/O based on the caps that it gets from the MDS. In most cases, unless there is contended access for an inode the MDS does give Fbc caps to the client, so the unbuffered codepaths are only infrequently traveled and are difficult to test. At one time, the "-o sync" mount option would give you this behavior, but that was removed in commit 7ab9b3807097 ("ceph: Don't use ceph-sync-mode for synchronous-fs."). Add a new mount option to tell the client to ignore Fbc caps when doing I/O, and to use the synchronous codepaths exclusively, even on non-O_DIRECT file descriptors. We already have an ioctl that forces this behavior on a per-file basis, so we can just always set the CEPH_F_SYNC flag in the file description on such mounts. Additionally, this patch also changes the client to not request Fbc when doing direct I/O. We aren't using the cache with O_DIRECT so we don't have any need for those caps. Signed-off-by: Jeff Layton Acked-by: Greg Farnum Reviewed-by: Venky Shankar Signed-off-by: Ilya Dryomov commit 0078ea3b0566e3da09ae8e1e4fbfd708702f2876 Author: Jeff Layton Date: Tue Nov 9 09:54:49 2021 -0500 ceph: don't check for quotas on MDS stray dirs 玮文 胡 reported seeing the WARN_RATELIMIT pop when writing to an inode that had been transplanted into the stray dir. The client was trying to look up the quotarealm info from the parent and that tripped the warning. Change the ceph_vino_is_reserved helper to not throw a warning for MDS stray directories (0x100 - 0x1ff), only for reserved dirs that are not in that range. Also, fix ceph_has_realms_with_quotas to return false when encountering a reserved inode. URL: https://tracker.ceph.com/issues/53180 Reported-by: Hu Weiwen Signed-off-by: Jeff Layton Reviewed-by: Luis Henriques Reviewed-by: Xiubo Li Signed-off-by: Ilya Dryomov commit af9ceae83cd26c9319bb2cdab23bb16d39300cbd Author: Jeff Layton Date: Tue Jan 26 13:41:38 2021 -0500 ceph: drop send metrics debug message This pops every second and isn't very useful. Signed-off-by: Jeff Layton Reviewed-by: Xiubo Li Signed-off-by: Ilya Dryomov commit 435a120a47eed0b3a1ac7b86cf1f7707bf2242ce Author: Colin Ian King Date: Sat Nov 27 17:21:04 2021 +0000 rbd: make const pointer spaces a static const array Don't populate the const array spaces on the stack but make it static const and make the pointer an array to remove a dereference. Shrinks object code a little too. Also clean up intent, currently it is spaces and should be a tab. Signed-off-by: Colin Ian King Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov commit 8e55ba8caae5cd380b1c9c81a426602a667e110e Author: Kotresh HR Date: Wed Nov 10 23:30:21 2021 +0530 ceph: Fix incorrect statfs report for small quota Problem: The statfs reports incorrect free/available space for quota less then CEPH_BLOCK size (4M). Solution: For quota less than CEPH_BLOCK size, smaller block size of 4K is used. But if quota is less than 4K, it is decided to go with binary use/free of 4K block. For quota size less than 4K size, report the total=used=4K,free=0 when quota is full and total=free=4K,used=0 otherwise. Signed-off-by: Kotresh HR Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov commit adbed05ed62d1f3b6f6c5cb88ec52c1ffafc0fd9 Author: Venky Shankar Date: Wed Nov 3 10:30:39 2021 +0530 ceph: mount syntax module parameter Add read-only module parameters for supported mount syntaxes. Primary user is the user-space mount helper for catching v2 syntax bugs during testing by cross verifying if the kernel supports v2 syntax on mount failure. Signed-off-by: Venky Shankar Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov commit e1b9eb50763d108166651ca67aae09893332c6b0 Author: Venky Shankar Date: Wed Jul 14 15:35:54 2021 +0530 doc: document new CephFS mount device syntax Signed-off-by: Venky Shankar Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov commit 2167f2cc686a97911a0b06ba9c97cec304b7c432 Author: Venky Shankar Date: Wed Jul 14 15:35:53 2021 +0530 ceph: record updated mon_addr on remount Note that the new monitors are just shown in /proc/mounts. Ceph does not (re)connect to new monitors yet. [ jlayton: s/printk\(KERN_NOTICE/pr_notice(/ s/strcmp/strcmp_null/ ] Signed-off-by: Venky Shankar Signed-off-by: Jeff Layton Signed-off-by: Ilya Dryomov commit 7b19b4db5add8d9f50e854907a82a10ba4d27c42 Author: Venky Shankar Date: Wed Jul 14 15:35:52 2021 +0530 ceph: new device mount syntax Old mount device syntax (source) has the following problems: - mounts to the same cluster but with different fsnames and/or creds have identical device string which can confuse xfstests. - Userspace mount helper tool resolves monitor addresses and fill in mon addrs automatically, but that means the device shown in /proc/mounts is different than what was used for mounting. New device syntax is as follows: cephuser@fsid.mycephfs2=/path Note, there is no "monitor address" in the device string. That gets passed in as mount option. This keeps the device string same when monitor addresses change (on remounts). Also note that the userspace mount helper tool is backward compatible. I.e., the mount helper will fallback to using old syntax after trying to mount with the new syntax. [ idryomov: drop CEPH_MON_ADDR_MNTOPT_DELIM ] Signed-off-by: Venky Shankar Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov commit 4153c7fc937a2afa077dbdb9fe3189b9981f423c Author: Venky Shankar Date: Wed Jul 14 15:35:51 2021 +0530 libceph: rename parse_fsid() to ceph_parse_fsid() and export ... as it is too generic. also, use __func__ when logging rather than hardcoding the function name. Signed-off-by: Venky Shankar Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov commit 2d7c86a8f9cdce1408c4f3c69d94d007eff2f179 Author: Venky Shankar Date: Wed Jul 14 15:35:50 2021 +0530 libceph: generalize addr/ip parsing based on delimiter ... and remove hardcoded function name in ceph_parse_ips(). [ idryomov: delim parameter, drop CEPH_ADDR_PARSE_DEFAULT_DELIM ] Signed-off-by: Venky Shankar Reviewed-by: Jeff Layton Signed-off-by: Ilya Dryomov commit de2d807b294d3d2ce5e59043ae2634016765d076 Author: Maxim Mikityanskiy Date: Wed Jan 12 12:28:05 2022 +0200 sch_api: Don't skip qdisc attach on ingress The attach callback of struct Qdisc_ops is used by only a few qdiscs: mq, mqprio and htb. qdisc_graft() contains the following logic (pseudocode): if (!qdisc->ops->attach) { if (ingress) do ingress stuff; else do egress stuff; } if (!ingress) { ... if (qdisc->ops->attach) qdisc->ops->attach(qdisc); } else { ... } As we see, the attach callback is not called if the qdisc is being attached to ingress (TC_H_INGRESS). That wasn't a problem for mq and mqprio, since they contain a check that they are attached to TC_H_ROOT, and they can't be attached to TC_H_INGRESS anyway. However, the commit cited below added the attach callback to htb. It is needed for the hardware offload, but in the non-offload mode it simulates the "do egress stuff" part of the pseudocode above. The problem is that when htb is attached to ingress, neither "do ingress stuff" nor attach() is called. It results in an inconsistency, and the following message is printed to dmesg: unregister_netdevice: waiting for lo to become free. Usage count = 2 This commit addresses the issue by running "do ingress stuff" in the ingress flow even in the attach callback is present, which is fine, because attach isn't going to be called afterwards. The bug was found by syzbot and reported by Eric. Fixes: d03b195b5aa0 ("sch_htb: Hierarchical QoS hardware offload") Signed-off-by: Maxim Mikityanskiy Reported-by: Eric Dumazet Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit 078c6a1cbd4cd7496048786beec2e312577bebbf Author: Pawel Dembicki Date: Tue Jan 11 23:11:32 2022 +0100 net: qmi_wwan: add ZTE MF286D modem 19d2:1485 Modem from ZTE MF286D is an Qualcomm MDM9250 based 3G/4G modem. T: Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 3 Spd=5000 MxCh= 0 D: Ver= 3.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 9 #Cfgs= 1 P: Vendor=19d2 ProdID=1485 Rev=52.87 S: Manufacturer=ZTE,Incorporated S: Product=ZTE Technologies MSM S: SerialNumber=MF286DZTED000000 C:* #Ifs= 7 Cfg#= 1 Atr=80 MxPwr=896mA A: FirstIf#= 0 IfCount= 2 Cls=02(comm.) Sub=06 Prot=00 I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=02 Prot=ff Driver=rndis_host E: Ad=82(I) Atr=03(Int.) MxPS= 8 Ivl=32ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=rndis_host E: Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E: Ad=01(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=83(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=85(I) Atr=03(Int.) MxPS= 10 Ivl=32ms E: Ad=84(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E: Ad=03(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=87(I) Atr=03(Int.) MxPS= 10 Ivl=32ms E: Ad=86(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E: Ad=04(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms I:* If#= 5 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan E: Ad=88(I) Atr=03(Int.) MxPS= 8 Ivl=32ms E: Ad=8e(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms E: Ad=0f(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms I:* If#= 6 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=usbfs E: Ad=05(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms E: Ad=89(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms Signed-off-by: Pawel Dembicki Acked-by: Bjørn Mork Signed-off-by: David S. Miller commit 081c73701ef0c2a4f6a127da824a641ae6505fbe Author: Brent Lu Date: Thu Jan 13 18:52:20 2022 +0800 ALSA: hda: intel-dsp-config: reorder the config table Entries without dmi_table nor codec_hid field need to be placed after entries with these two fields or they will be always selected. Signed-off-by: Brent Lu Link: https://lore.kernel.org/r/20220113105220.1114694-3-brent.lu@intel.com Signed-off-by: Takashi Iwai commit 19980aa10d2d944ed8fe345ce2eb87c2cb4bedf8 Author: Brent Lu Date: Thu Jan 13 18:52:19 2022 +0800 ALSA: hda: intel-dsp-config: add JasperLake support Add rules to select SOF driver for Jasper Lake systems if digital microphone is present or the system is a Chromebook. Signed-off-by: Brent Lu Link: https://lore.kernel.org/r/20220113105220.1114694-2-brent.lu@intel.com Signed-off-by: Takashi Iwai commit 7d70984a1ad4c445dff08edb9aacce8906b6a222 Author: Pablo Neira Ayuso Date: Thu Jan 13 12:22:38 2022 +0100 netfilter: nft_connlimit: memleak if nf_ct_netns_get() fails Check if nf_ct_netns_get() fails then release the limit object previously allocated via kmalloc(). Fixes: 37f319f37d90 ("netfilter: nft_connlimit: move stateful fields out of expression data") Signed-off-by: Pablo Neira Ayuso commit 54329e6f7beea6af56c1230da293acc97d6a6ee7 Author: Weizhao Ouyang Date: Tue Jan 4 15:35:45 2022 +0800 dma-buf: cma_heap: Fix mutex locking section Fix cma_heap_buffer mutex locking critical section to protect vmap_cnt and vaddr. Fixes: a5d2d29e24be ("dma-buf: heaps: Move heap-helper logic into the cma_heap implementation") Signed-off-by: Weizhao Ouyang Acked-by: John Stultz Signed-off-by: Sumit Semwal Link: https://patchwork.freedesktop.org/patch/msgid/20220104073545.124244-1-o451686892@gmail.com commit 180d0eb290a5d11e6d3d99fea0841ceae2893901 Author: Helge Deller Date: Thu Jan 13 11:58:05 2022 +0100 parisc: Add visible flag to toc_stack variable Add the visible flag to the toc_stack variable to make it visible for assembly code and to avoid a sparse warning. Reported-by: kernel test robot Signed-off-by: Helge Deller commit 13462ba1815db5a96891293a9cfaa2451f7bd623 Author: Tom Rix Date: Sat Jan 8 07:09:48 2022 -0800 i3c: master: dw: check return of dw_i3c_master_get_free_pos() Clang static analysis reports this problem dw-i3c-master.c:799:9: warning: The result of the left shift is undefined because the left operand is negative COMMAND_PORT_DEV_INDEX(pos) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ pos can be negative because dw_i3c_master_get_free_pos() can return an error. So check for an error. Fixes: 1dd728f5d4d4 ("i3c: master: Add driver for Synopsys DesignWare IP") Signed-off-by: Tom Rix Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220108150948.3988790-1-trix@redhat.com commit 455e73a07f6e288b0061dfcf4fcf54fa9fe06458 Merge: d9b5941bb5933 4afd2a9355a9d Author: Linus Torvalds Date: Wed Jan 12 17:02:27 2022 -0800 Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux Pull clk updates from Stephen Boyd: "We have a couple patches in the framework core this time around but they're mostly minor cleanups and some debugfs stuff. The real work that's in here is the typical pile of clk driver updates and new SoC support. Per usual (or maybe just recent trends), Qualcomm gains a handful of SoC drivers additions and has the largest diffstat. After that there are quite a few updates to the Allwinner (sunxi) drivers to support modular drivers and Renesas is heavily updated to add more support for various clks. Overall it looks pretty normal. New Drivers: - Add MDMA and BDMA clks to Ingenic JZ4760 and JZ4770 - MediaTek mt7986 SoC basic support - Clock and reset driver for Toshiba Visconti SoCs - Initial clock driver for the Exynos7885 SoC (Samsung Galaxy A8) - Allwinner D1 clks - Lan966x Generic Clock Controller driver and associated DT bindings - Qualcomm SDX65, SM8450, and MSM8976 GCC clks - Qualcomm SDX65 and SM8450 RPMh clks Updates: - Set suppress_bind_attrs to true for i.MX8ULP driver - Switch from do_div to div64_ul for throughout all i.MX drivers - Fix imx8mn_clko1_sels for i.MX8MN - Remove unused IPG_AUDIO_ROOT from i.MX8MP - Switch parent for audio_root_clk to audio ahb in i.MX8MP driver - Removal of all remaining uses of __clk_lookup() in drivers/clk/samsung - Refactoring of the CPU clocks registration to use common interface - An update of the Exynos850 driver (support for more clock domains) required by the E850-96 development board - Prep for runtime PM and generic power domains on Tegra - Support modular Allwinner clk drivers via platform bus - Lan966x clock driver extended to support clock gating - Add serial (SCI1), watchdog (WDT), timer (OSTM), SPI (RSPI), and thermal (TSU) clocks and resets on Renesas RZ/G2L - Rework SDHI clock handling in the Renesas R-Car Gen3 and RZ/G2 clock drivers, and in the Renesas SDHI driver - Make the Cortex-A55 (I) clock on Renesas RZ/G2L programmable - Document support for the new Renesas R-Car S4-8 (R8A779F0) SoC - Add support for the new Renesas R-Car S4-8 (R8A779F0) SoC - Add GPU clock and resets on Renesas RZ/G2L - Add clk-provider.h to various Qualcomm clk drivers - devm version of clk_hw_register_gate() - kerneldoc fixes in a couple drivers" * tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: (131 commits) clk: visconti: Remove pointless NULL check in visconti_pll_add_lookup() clk: mediatek: add mt7986 clock support clk: mediatek: add mt7986 clock IDs dt-bindings: clock: mediatek: document clk bindings for mediatek mt7986 SoC clk: mediatek: clk-gate: Use regmap_{set/clear}_bits helpers clk: mediatek: clk-gate: Shrink by adding clockgating bit check helper clk: x86: Fix clk_gate_flags for RV_CLK_GATE clk: x86: Use dynamic con_id string during clk registration ACPI: APD: Add a fmw property clk-name drivers: acpi: acpi_apd: Remove unused device property "is-rv" x86: clk: clk-fch: Add support for newer family of AMD's SOC clk: ingenic: Add MDMA and BDMA clocks dt-bindings: clk/ingenic: Add MDMA and BDMA clocks clk: bm1880: remove kfrees on static allocations clk: Drop unused COMMON_CLK_STM32MP157_SCMI config clk: st: clkgen-mux: search reg within node or parent clk: st: clkgen-fsyn: search reg within node or parent clk: Enable/Disable runtime PM for clk_summary MAINTAINERS: Add entries for Toshiba Visconti PLL and clock controller clk: visconti: Add support common clock driver and reset driver ... commit d9b5941bb5933932051e315de18a43db7d3c9e13 Merge: 4eb766f64d120 9e87a8da747bf Author: Linus Torvalds Date: Wed Jan 12 16:59:22 2022 -0800 Merge tag 'leds-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds Pull LED updates from Pavel Machek: "Nothing major is happening here" * tag 'leds-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds: leds: lp55xx: initialise output direction from dts ARM: dts: omap3-n900: Fix lp5523 for multi color leds: ktd2692: Drop calling dev_of_node() in ktd2692_parse_dt leds: lgm-sso: Get rid of duplicate of_node assignment leds: tca6507: Get rid of duplicate of_node assignment leds: leds-fsg: Drop FSG3 LED driver leds: lp50xx: remove unused variable dt-bindings: leds: Replace moonlight with indicator in mt6360 example leds: led-core: Update fwnode with device_set_node leds: tca6507: use swap() to make code cleaner leds: Add mt6360 driver dt-bindings: leds: Add bindings for MT6360 LED commit 4eb766f64d120f0b80ec24282df789b7db2ff838 Merge: ce990f1de0bc6 e623611b4d3f7 Author: Linus Torvalds Date: Wed Jan 12 16:47:05 2022 -0800 Merge tag 'devicetree-for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux Pull devicetree updates from Rob Herring: "Bindings: - DT schema conversions for Samsung clocks, RNG bindings, Qcom Command DB and rmtfs, gpio-restart, i2c-mux-gpio, i2c-mux-pinctl, Tegra I2C and BPMP, pwm-vibrator, Arm DSU, and Cadence macb - DT schema conversions for Broadcom platforms: interrupt controllers, STB GPIO, STB waketimer, STB reset, iProc MDIO mux, iProc PCIe, Cygnus PCIe PHY, PWM, USB BDC, BCM6328 LEDs, TMON, SYSTEMPORT, AMAC, Northstar 2 PCIe PHY, GENET, moca PHY, GISB arbiter, and SATA - Add binding schemas for Tegra210 EMC table, TI DC-DC converters, - Clean-ups of MDIO bus schemas to fix 'unevaluatedProperties' issues - More fixes due to 'unevaluatedProperties' enabling - Data type fixes and clean-ups of binding examples found in preparation to move to validating DTB files directly (instead of intermediate YAML representation. - Vendor prefixes for T-Head Semiconductor, OnePlus, and Sunplus - Add various new compatible strings DT core: - Silence a warning for overlapping reserved memory regions - Reimplement unittest overlay tracking - Fix stack frame size warning in unittest - Clean-ups of early FDT scanning functions - Fix handling of "linux,usable-memory-range" on EFI booted systems - Add support for 'fail' status on CPU nodes - Improve error message in of_phandle_iterator_next() - kbuild: Disable duplicate unit-address warnings for disabled nodes" * tag 'devicetree-for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (114 commits) dt-bindings: net: mdio: Drop resets/reset-names child properties dt-bindings: clock: samsung: convert S5Pv210 to dtschema dt-bindings: clock: samsung: convert Exynos5410 to dtschema dt-bindings: clock: samsung: convert Exynos5260 to dtschema dt-bindings: clock: samsung: extend Exynos7 bindings with UFS dt-bindings: clock: samsung: convert Exynos7 to dtschema dt-bindings: clock: samsung: convert Exynos5433 to dtschema dt-bindings: i2c: maxim,max96712: Add bindings for Maxim Integrated MAX96712 dt-bindings: iio: adi,ltc2983: Fix 64-bit property sizes dt-bindings: power: maxim,max17040: Fix incorrect type for 'maxim,rcomp' dt-bindings: interrupt-controller: arm,gic-v3: Fix 'interrupts' cell size in example dt-bindings: iio/magnetometer: yamaha,yas530: Fix invalid 'interrupts' in example dt-bindings: clock: imx5: Drop clock consumer node from example dt-bindings: Drop required 'interrupt-parent' dt-bindings: net: ti,dp83869: Drop value on boolean 'ti,max-output-impedance' dt-bindings: net: wireless: mt76: Fix 8-bit property sizes dt-bindings: PCI: snps,dw-pcie-ep: Drop conflicting 'max-functions' schema dt-bindings: i2c: st,stm32-i2c: Make each example a separate entry dt-bindings: net: stm32-dwmac: Make each example a separate entry dt-bindings: net: Cleanup MDIO node schemas ... commit ce990f1de0bc6ff3de43d385e0985efa980fba24 Merge: 64ad9461521b1 54bb4a91b281e Author: Linus Torvalds Date: Wed Jan 12 16:42:00 2022 -0800 Merge tag 'for-linus-5.17-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull xen updates from Juergen Gross: - a fix for the Xen gntdev driver - a fix for running as Xen dom0 booted via EFI and the EFI framebuffer being located above 4GB - a series for support of mapping other guest's memory by using zone device when running as Xen guest on Arm * tag 'for-linus-5.17-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: dt-bindings: xen: Clarify "reg" purpose arm/xen: Read extended regions from DT and init Xen resource xen/unpopulated-alloc: Add mechanism to use Xen resource xen/balloon: Bring alloc(free)_xenballooned_pages helpers back arm/xen: Switch to use gnttab_setup_auto_xlat_frames() for DT xen/unpopulated-alloc: Drop check for virt_addr_valid() in fill_list() xen/x86: obtain upper 32 bits of video frame buffer address for Dom0 xen/gntdev: fix unmap notification order commit 64ad9461521b1a357846ef6cedc4bccd48a046e0 Merge: 8e5b0adeea193 9cdbeec409680 Author: Linus Torvalds Date: Wed Jan 12 16:31:19 2022 -0800 Merge tag 'x86_core_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 core updates from Borislav Petkov: - Get rid of all the .fixup sections because this generates misleading/wrong stacktraces and confuse RELIABLE_STACKTRACE and LIVEPATCH as the backtrace misses the function which is being fixed up. - Add Straight Line Speculation mitigation support which uses a new compiler switch -mharden-sls= which sticks an INT3 after a RET or an indirect branch in order to block speculation after them. Reportedly, CPUs do speculate behind such insns. - The usual set of cleanups and improvements * tag 'x86_core_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (32 commits) x86/entry_32: Fix segment exceptions objtool: Remove .fixup handling x86: Remove .fixup section x86/word-at-a-time: Remove .fixup usage x86/usercopy: Remove .fixup usage x86/usercopy_32: Simplify __copy_user_intel_nocache() x86/sgx: Remove .fixup usage x86/checksum_32: Remove .fixup usage x86/vmx: Remove .fixup usage x86/kvm: Remove .fixup usage x86/segment: Remove .fixup usage x86/fpu: Remove .fixup usage x86/xen: Remove .fixup usage x86/uaccess: Remove .fixup usage x86/futex: Remove .fixup usage x86/msr: Remove .fixup usage x86/extable: Extend extable functionality x86/entry_32: Remove .fixup usage x86/entry_64: Remove .fixup usage x86/copy_mc_64: Remove .fixup usage ... commit 8e5b0adeea19309c8ce0e3c9119061554973efa9 Merge: 13eaa5bda0df8 a9f4a6e92b3b3 Author: Linus Torvalds Date: Wed Jan 12 16:26:58 2022 -0800 Merge tag 'perf_core_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull perf updates from Borislav Petkov: "Cleanup of the perf/kvm interaction." * tag 'perf_core_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf: Drop guest callback (un)register stubs KVM: arm64: Drop perf.c and fold its tiny bits of code into arm.c KVM: arm64: Hide kvm_arm_pmu_available behind CONFIG_HW_PERF_EVENTS=y KVM: arm64: Convert to the generic perf callbacks KVM: x86: Move Intel Processor Trace interrupt handler to vmx.c KVM: Move x86's perf guest info callbacks to generic KVM KVM: x86: More precisely identify NMI from guest when handling PMI KVM: x86: Drop current_vcpu for kvm_running_vcpu + kvm_arch_vcpu variable perf/core: Use static_call to optimize perf_guest_info_callbacks perf: Force architectures to opt-in to guest callbacks perf: Add wrappers for invoking guest callbacks perf/core: Rework guest callbacks to prepare for static_call support perf: Drop dead and useless guest "support" from arm, csky, nds32 and riscv perf: Stop pretending that perf can handle multiple guest callbacks KVM: x86: Register Processor Trace interrupt hook iff PT enabled in guest KVM: x86: Register perf callbacks after calling vendor's hardware_setup() perf: Protect perf_guest_cbs with RCU commit 13eaa5bda0df8f5c1c4f2a4fb4a0bc20787dcc68 Merge: 362f533a2a109 66dc1b791c583 Author: Linus Torvalds Date: Wed Jan 12 16:15:51 2022 -0800 Merge tag 'iommu-updates-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu Pull iommu updates from Joerg Roedel: - Identity domain support for virtio-iommu - Move flush queue code into iommu-dma - Some fixes for AMD IOMMU suspend/resume support when x2apic is used - Arm SMMU Updates from Will Deacon: - Revert evtq and priq back to their former sizes - Return early on short-descriptor page-table allocation failure - Fix page fault reporting for Adreno GPU on SMMUv2 - Make SMMUv3 MMU notifier ops 'const' - Numerous new compatible strings for Qualcomm SMMUv2 implementations - Various smaller fixes and cleanups * tag 'iommu-updates-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: (38 commits) iommu/iova: Temporarily include dma-mapping.h from iova.h iommu: Move flush queue data into iommu_dma_cookie iommu/iova: Move flush queue code to iommu-dma iommu/iova: Consolidate flush queue code iommu/vt-d: Use put_pages_list iommu/amd: Use put_pages_list iommu/amd: Simplify pagetable freeing iommu/iova: Squash flush_cb abstraction iommu/iova: Squash entry_dtor abstraction iommu/iova: Fix race between FQ timeout and teardown iommu/amd: Fix typo in *glues … together* in comment iommu/vt-d: Remove unused dma_to_mm_pfn function iommu/vt-d: Drop duplicate check in dma_pte_free_pagetable() iommu/vt-d: Use bitmap_zalloc() when applicable iommu/amd: Remove useless irq affinity notifier iommu/amd: X2apic mode: mask/unmask interrupts on suspend/resume iommu/amd: X2apic mode: setup the INTX registers on mask/unmask iommu/amd: X2apic mode: re-enable after resume iommu/amd: Restore GA log/tail pointer on host resume iommu/iova: Move fast alloc size roundup into alloc_iova_fast() ... commit 362f533a2a1098fe95020cb59340023e9b11d062 Merge: 3acbdbf42e943 be185c2988b48 Author: Linus Torvalds Date: Wed Jan 12 15:57:59 2022 -0800 Merge tag 'cxl-for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl Pull CXL (Compute Express Link) updates from Dan Williams: "The highlight is initial support for CXL memory hotplug. The static NUMA node (ACPI SRAT Physical Address to Proximity Domain) information known to platform firmware is extended to support the potential performance-class / memory-target nodes dynamically created from available CXL memory device capacity. New unit test infrastructure is added for validating health information payloads. Fixes to module reload stress and stack usage from exposure in -next are included. A symbol rename and some other miscellaneous fixups are included as well. Summary: - Rework ACPI sub-table infrastructure to optionally be used outside of __init scenarios and use it for CEDT.CFMWS sub-table parsing. - Add support for extending num_possible_nodes by the potential hotplug CXL memory ranges - Extend tools/testing/cxl with mock memory device health information - Fix a module-reload workqueue race - Fix excessive stack-frame usage - Rename the driver context data structure from "cxl_mem" since that name collides with a proposed driver name - Use EXPORT_SYMBOL_NS_GPL instead of -DDEFAULT_SYMBOL_NAMESPACE at build time" * tag 'cxl-for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl: cxl/core: Remove cxld_const_init in cxl_decoder_alloc() cxl/pmem: Fix module reload vs workqueue state ACPI: NUMA: Add a node and memblk for each CFMWS not in SRAT cxl/test: Mock acpi_table_parse_cedt() cxl/acpi: Convert CFMWS parsing to ACPI sub-table helpers ACPI: Add a context argument for table parsing handlers ACPI: Teach ACPI table parsing about the CEDT header format ACPI: Keep sub-table parsing infrastructure available for modules tools/testing/cxl: add mock output for the GET_HEALTH_INFO command cxl/memdev: Remove unused cxlmd field cxl/core: Convert to EXPORT_SYMBOL_NS_GPL cxl/memdev: Change cxl_mem to a more descriptive name cxl/mbox: Remove bad comment cxl/pmem: Fix reference counting for delayed work commit 3acbdbf42e943d85174401357a6b6243479d4c76 Merge: 8834147f95056 9e05e95ca8dae Author: Linus Torvalds Date: Wed Jan 12 15:46:11 2022 -0800 Merge tag 'libnvdimm-for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm Pull dax and libnvdimm updates from Dan Williams: "The bulk of this is a rework of the dax_operations API after discovering the obstacles it posed to the work-in-progress DAX+reflink support for XFS and other copy-on-write filesystem mechanics. Primarily the need to plumb a block_device through the API to handle partition offsets was a sticking point and Christoph untangled that dependency in addition to other cleanups to make landing the DAX+reflink support easier. The DAX_PMEM_COMPAT option has been around for 4 years and not only are distributions shipping userspace that understand the current configuration API, but some are not even bothering to turn this option on anymore, so it seems a good time to remove it per the deprecation schedule. Recall that this was added after the device-dax subsystem moved from /sys/class/dax to /sys/bus/dax for its sysfs organization. All recent functionality depends on /sys/bus/dax. Some other miscellaneous cleanups and reflink prep patches are included as well. Summary: - Simplify the dax_operations API: - Eliminate bdev_dax_pgoff() in favor of the filesystem maintaining and applying a partition offset to all its DAX iomap operations. - Remove wrappers and device-mapper stacked callbacks for ->copy_from_iter() and ->copy_to_iter() in favor of moving block_device relative offset responsibility to the dax_direct_access() caller. - Remove the need for an @bdev in filesystem-DAX infrastructure - Remove unused uio helpers copy_from_iter_flushcache() and copy_mc_to_iter() as only the non-check_copy_size() versions are used for DAX. - Prepare XFS for the pending (next merge window) DAX+reflink support - Remove deprecated DEV_DAX_PMEM_COMPAT support - Cleanup a straggling misuse of the GUID api" * tag 'libnvdimm-for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: (38 commits) iomap: Fix error handling in iomap_zero_iter() ACPI: NFIT: Import GUID before use dax: remove the copy_from_iter and copy_to_iter methods dax: remove the DAXDEV_F_SYNC flag dax: simplify dax_synchronous and set_dax_synchronous uio: remove copy_from_iter_flushcache() and copy_mc_to_iter() iomap: turn the byte variable in iomap_zero_iter into a ssize_t memremap: remove support for external pgmap refcounts fsdax: don't require CONFIG_BLOCK iomap: build the block based code conditionally dax: fix up some of the block device related ifdefs fsdax: shift partition offset handling into the file systems dax: return the partition offset from fs_dax_get_by_bdev iomap: add a IOMAP_DAX flag xfs: pass the mapping flags to xfs_bmbt_to_iomap xfs: use xfs_direct_write_iomap_ops for DAX zeroing xfs: move dax device handling into xfs_{alloc,free}_buftarg ext4: cleanup the dax handling in ext4_fill_super ext2: cleanup the dax handling in ext2_fill_super fsdax: decouple zeroing from the iomap buffered I/O code ... commit ed6ae5ca437d9d238117d90e95f7f2cc27da1b31 Author: Ignat Korchagin Date: Fri Jan 7 12:38:42 2022 +0000 sit: allow encapsulated IPv6 traffic to be delivered locally While experimenting with FOU encapsulation Amir noticed that encapsulated IPv6 traffic fails to be delivered, if the peer IP address is configured locally. It can be easily verified by creating a sit interface like below: $ sudo ip link add name fou_test type sit remote 127.0.0.1 encap fou encap-sport auto encap-dport 1111 $ sudo ip link set fou_test up and sending some IPv4 and IPv6 traffic to it $ ping -I fou_test -c 1 1.1.1.1 $ ping6 -I fou_test -c 1 fe80::d0b0:dfff:fe4c:fcbc "tcpdump -i any udp dst port 1111" will confirm that only the first IPv4 ping was encapsulated and attempted to be delivered. This seems like a limitation: for example, in a cloud environment the "peer" service may be arbitrarily scheduled on any server within the cluster, where all nodes are trying to send encapsulated traffic. And the unlucky node will not be able to. Moreover, delivering encapsulated IPv4 traffic locally is allowed. But I may not have all the context about this restriction and this code predates the observable git history. Reported-by: Amir Razmjou Signed-off-by: Ignat Korchagin Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20220107123842.211335-1-ignat@cloudflare.com Signed-off-by: Jakub Kicinski commit 44ddb791f8f41f5f9f2ab4280a27c179ca7a8aed Author: Sergio Paracuellos Date: Wed Jan 12 15:28:10 2022 -0600 PCI: mt7621: Allow COMPILE_TEST for all arches Since all MIPS-specific code has been removed from driver, allow it to be enabled for COMPILE_TEST on all architectures. Mark it as tristate and remove MIPS the MIPS dependency. Signed-off-by: Sergio Paracuellos Signed-off-by: Bjorn Helgaas commit e4b1cd02dc8d7967a79edccd510724831e5cdee8 Author: Sergio Paracuellos Date: Tue Dec 7 11:49:23 2021 +0100 PCI: mt7621: Add missing MODULE_LICENSE() The MT7621 PCIe host controller driver can be built as a module, but it lacks a MODULE_LICENSE(), which causes a build error: ERROR: modpost: missing MODULE_LICENSE() in drivers/pci/controller/pcie-mt7621.o Add MODULE_LICENSE() to the driver. Fixes: 2bdd5238e756 ("PCI: mt7621: Add MediaTek MT7621 PCIe host controller driver") Link: https://lore.kernel.org/r/20211207104924.21327-5-sergio.paracuellos@gmail.com Signed-off-by: Yanteng Si Signed-off-by: Sergio Paracuellos Signed-off-by: Bjorn Helgaas Reviewed-by: Krzysztof Wilczyński commit 8834147f9505661859ce44549bf601e2a06bba7c Merge: 8975f8974888b d7bdba1c81f7e Author: Linus Torvalds Date: Wed Jan 12 13:45:12 2022 -0800 Merge tag 'fscache-rewrite-20220111' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs Pull fscache rewrite from David Howells: "This is a set of patches that rewrites the fscache driver and the cachefiles driver, significantly simplifying the code compared to what's upstream, removing the complex operation scheduling and object state machine in favour of something much smaller and simpler. The series is structured such that the first few patches disable fscache use by the network filesystems using it, remove the cachefiles driver entirely and as much of the fscache driver as can be got away with without causing build failures in the network filesystems. The patches after that recreate fscache and then cachefiles, attempting to add the pieces in a logical order. Finally, the filesystems are reenabled and then the very last patch changes the documentation. [!] Note: I have dropped the cifs patch for the moment, leaving local caching in cifs disabled. I've been having trouble getting that working. I think I have it done, but it needs more testing (there seem to be some test failures occurring with v5.16 also from xfstests), so I propose deferring that patch to the end of the merge window. WHY REWRITE? ============ Fscache's operation scheduling API was intended to handle sequencing of cache operations, which were all required (where possible) to run asynchronously in parallel with the operations being done by the network filesystem, whilst allowing the cache to be brought online and offline and to interrupt service for invalidation. With the advent of the tmpfile capacity in the VFS, however, an opportunity arises to do invalidation much more simply, without having to wait for I/O that's actually in progress: Cachefiles can simply create a tmpfile, cut over the file pointer for the backing object attached to a cookie and abandon the in-progress I/O, dismissing it upon completion. Future work here would involve using Omar Sandoval's vfs_link() with AT_LINK_REPLACE[1] to allow an extant file to be displaced by a new hard link from a tmpfile as currently I have to unlink the old file first. These patches can also simplify the object state handling as I/O operations to the cache don't all have to be brought to a stop in order to invalidate a file. To that end, and with an eye on to writing a new backing cache model in the future, I've taken the opportunity to simplify the indexing structure. I've separated the index cookie concept from the file cookie concept by C type now. The former is now called a "volume cookie" (struct fscache_volume) and there is a container of file cookies. There are then just the two levels. All the index cookie levels are collapsed into a single volume cookie, and this has a single printable string as a key. For instance, an AFS volume would have a key of something like "afs,example.com,1000555", combining the filesystem name, cell name and volume ID. This is freeform, but must not have '/' chars in it. I've also eliminated all pointers back from fscache into the network filesystem. This required the duplication of a little bit of data in the cookie (cookie key, coherency data and file size), but it's not actually that much. This gets rid of problems with making sure we keep netfs data structures around so that the cache can access them. These patches mean that most of the code that was in the drivers before is simply gone and those drivers are now almost entirely new code. That being the case, there doesn't seem any particular reason to try and maintain bisectability across it. Further, there has to be a point in the middle where things are cut over as there's a single point everything has to go through (ie. /dev/cachefiles) and it can't be in use by two drivers at once. ISSUES YET OUTSTANDING ====================== There are some issues still outstanding, unaddressed by this patchset, that will need fixing in future patchsets, but that don't stop this series from being usable: (1) The cachefiles driver needs to stop using the backing filesystem's metadata to store information about what parts of the cache are populated. This is not reliable with modern extent-based filesystems. Fixing this is deferred to a separate patchset as it involves negotiation with the network filesystem and the VM as to how much data to download to fulfil a read - which brings me on to (2)... (2) NFS (and CIFS with the dropped patch) do not take account of how the cache would like I/O to be structured to meet its granularity requirements. Previously, the cache used page granularity, which was fine as the network filesystems also dealt in page granularity, and the backing filesystem (ext4, xfs or whatever) did whatever it did out of sight. However, we now have folios to deal with and the cache will now have to store its own metadata to track its contents. The change I'm looking at making for cachefiles is to store content bitmaps in one or more xattrs and making a bit in the map correspond to something like a 256KiB block. However, the size of an xattr and the fact that they have to be read/updated in one go means that I'm looking at covering 1GiB of data per 512-byte map and storing each map in an xattr. Cachefiles has the potential to grow into a fully fledged filesystem of its very own if I'm not careful. However, I'm also looking at changing things even more radically and going to a different model of how the cache is arranged and managed - one that's more akin to the way, say, openafs does things - which brings me on to (3)... (3) The way cachefilesd does culling is very inefficient for large caches and it would be better to move it into the kernel if I can as cachefilesd has to keep asking the kernel if it can cull a file. Changing the way the backend works would allow this to be addressed. BITS THAT MAY BE CONTROVERSIAL ============================== There are some bits I've added that may be controversial: (1) I've provided a flag, S_KERNEL_FILE, that cachefiles uses to check if a files is already being used by some other kernel service (e.g. a duplicate cachefiles cache in the same directory) and reject it if it is. This isn't entirely necessary, but it helps prevent accidental data corruption. I don't want to use S_SWAPFILE as that has other effects, but quite possibly swapon() should set S_KERNEL_FILE too. Note that it doesn't prevent userspace from interfering, though perhaps it should. (I have made it prevent a marked directory from being rmdir-able). (2) Cachefiles wants to keep the backing file for a cookie open whilst we might need to write to it from network filesystem writeback. The problem is that the network filesystem unuses its cookie when its file is closed, and so we have nothing pinning the cachefiles file open and it will get closed automatically after a short time to avoid EMFILE/ENFILE problems. Reopening the cache file, however, is a problem if this is being done due to writeback triggered by exit(). Some filesystems will oops if we try to open a file in that context because they want to access current->fs or suchlike. To get around this, I added the following: (A) An inode flag, I_PINNING_FSCACHE_WB, to be set on a network filesystem inode to indicate that we have a usage count on the cookie caching that inode. (B) A flag in struct writeback_control, unpinned_fscache_wb, that is set when __writeback_single_inode() clears the last dirty page from i_pages - at which point it clears I_PINNING_FSCACHE_WB and sets this flag. This has to be done here so that clearing I_PINNING_FSCACHE_WB can be done atomically with the check of PAGECACHE_TAG_DIRTY that clears I_DIRTY_PAGES. (C) A function, fscache_set_page_dirty(), which if it is not set, sets I_PINNING_FSCACHE_WB and calls fscache_use_cookie() to pin the cache resources. (D) A function, fscache_unpin_writeback(), to be called by ->write_inode() to unuse the cookie. (E) A function, fscache_clear_inode_writeback(), to be called when the inode is evicted, before clear_inode() is called. This cleans up any lingering I_PINNING_FSCACHE_WB. The network filesystem can then use these tools to make sure that fscache_write_to_cache() can write locally modified data to the cache as well as to the server. For the future, I'm working on write helpers for netfs lib that should allow this facility to be removed by keeping track of the dirty regions separately - but that's incomplete at the moment and is also going to be affected by folios, one way or another, since it deals with pages" Link: https://lore.kernel.org/all/510611.1641942444@warthog.procyon.org.uk/ Tested-by: Dominique Martinet # 9p Tested-by: kafs-testing@auristor.com # afs Tested-by: Jeff Layton # ceph Tested-by: Dave Wysochanski # nfs Tested-by: Daire Byrne # nfs * tag 'fscache-rewrite-20220111' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs: (67 commits) 9p, afs, ceph, nfs: Use current_is_kswapd() rather than gfpflags_allow_blocking() fscache: Add a tracepoint for cookie use/unuse fscache: Rewrite documentation ceph: add fscache writeback support ceph: conversion to new fscache API nfs: Implement cache I/O by accessing the cache directly nfs: Convert to new fscache volume/cookie API 9p: Copy local writes to the cache when writing to the server 9p: Use fscache indexing rewrite and reenable caching afs: Skip truncation on the server of data we haven't written yet afs: Copy local writes to the cache when writing to the server afs: Convert afs to use the new fscache API fscache, cachefiles: Display stat of culling events fscache, cachefiles: Display stats of no-space events cachefiles: Allow cachefiles to actually function fscache, cachefiles: Store the volume coherency data cachefiles: Implement the I/O routines cachefiles: Implement cookie resize for truncate cachefiles: Implement begin and end I/O operation cachefiles: Implement backing file wrangling ... commit fe7498ef791710a8bb79008850ce7fcbd3903657 Author: Sergio Paracuellos Date: Tue Dec 7 11:49:21 2021 +0100 PCI: mt7621: Move MIPS setup to pcibios_root_bridge_prepare() On the MIPS ralink mt7621 platform, we need to set up I/O coherency units based on the host bridge apertures. To remove this arch dependency from the driver itself, move the coherency setup from the driver to pcibios_root_bridge_prepare(). [bhelgaas: squash add/remove into one patch, commit log] Link: https://lore.kernel.org/r/20211207104924.21327-3-sergio.paracuellos@gmail.com Link: https://lore.kernel.org/r/20211207104924.21327-4-sergio.paracuellos@gmail.com Signed-off-by: Sergio Paracuellos Signed-off-by: Bjorn Helgaas Reviewed-by: Guenter Roeck # arch/mips Acked-by: Thomas Bogendoerfer # arch/mips commit 661c4c4f2693a8cdd42a93a2418244b8f5115e6b Author: Sergio Paracuellos Date: Tue Dec 7 11:49:20 2021 +0100 PCI: Let pcibios_root_bridge_prepare() access bridge->windows When pci_register_host_bridge() is called, bridge->windows are already available. However these windows are being moved temporarily from there. To let pcibios_root_bridge_prepare() have access to these windows, move the windows movement after calling this function. This is useful for the MIPS ralink mt7621 platform so it can set up I/O coherence units and avoid custom MIPS code in the mt7621 PCIe controller driver. Link: https://lore.kernel.org/r/20211207104924.21327-2-sergio.paracuellos@gmail.com Signed-off-by: Sergio Paracuellos Signed-off-by: Bjorn Helgaas Acked-by: Arnd Bergmann commit 8975f8974888b3cd25aa8cf9eba24edbb9230bb2 Merge: 1fb38c934c6e6 073c3ab6ae012 Author: Linus Torvalds Date: Wed Jan 12 13:30:58 2022 -0800 Merge tag 'fuse-update-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse Pull fuse updates from Miklos Szeredi: - Fix a regression introduced in 5.15 - Extend the size of the FUSE_INIT request to accommodate for more flags. There's a slight possibility of a regression for obscure fuse servers; if this happens, then more complexity will need to be added to the protocol - Allow the DAX property to be controlled by the server on a per-inode basis in virtiofs - Allow sending security context to the server when creating a file or directory * tag 'fuse-update-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse: Documentation/filesystem/dax: DAX on virtiofs fuse: mark inode DONT_CACHE when per inode DAX hint changes fuse: negotiate per inode DAX in FUSE_INIT fuse: enable per inode DAX fuse: support per inode DAX in fuse protocol fuse: make DAX mount option a tri-state fuse: add fuse_should_enable_dax() helper fuse: Pass correct lend value to filemap_write_and_wait_range() fuse: send security context of inode on file fuse: extend init flags commit 1fb38c934c6e6fad1559f7fe22504b42b7110f8a Merge: 3d3d6733065c9 f05f2429eec60 Author: Linus Torvalds Date: Wed Jan 12 13:28:06 2022 -0800 Merge tag 'fs_for_v5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs Pull UDF / reiserfs updates from Jan Kara: "One UDF fix and one reiserfs cleanup" * tag 'fs_for_v5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: udf: Fix error handling in udf_new_inode() reiserfs: don't use congestion_wait() commit d068eebbd4822b6c14a7ea375dfe53ca5c69c776 Author: Michal Koutný Date: Fri Dec 17 16:48:54 2021 +0100 cgroup/cpuset: Make child cpusets restrict parents on v1 hierarchy The commit 1f1562fcd04a ("cgroup/cpuset: Don't let child cpusets restrict parent in default hierarchy") inteded to relax the check only on the default hierarchy (or v2 mode) but it dropped the check in v1 too. This patch returns and separates the legacy-only validations so that they can be considered only in the v1 mode, which should enforce the old constraints for the sake of compatibility. Fixes: 1f1562fcd04a ("cgroup/cpuset: Don't let child cpusets restrict parent in default hierarchy") Suggested-by: Waiman Long Signed-off-by: Michal Koutný Reviewed-by: Waiman Long Signed-off-by: Tejun Heo commit da48157092e7dd25e8c0fa38e0ccd93219a66046 Author: Sergio Paracuellos Date: Wed Nov 17 16:29:52 2021 +0100 PCI: mt7621: Declare mt7621_pci_ops static Sparse complains about mt7621_pci_ops symbol is not declared and asks if it should be declared as static instead. Sparse is right. Hence declare symbol as static. Link: https://lore.kernel.org/r/20211117152952.12271-1-sergio.paracuellos@gmail.com Reported-by: kernel test robot Signed-off-by: Sergio Paracuellos Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Krzysztof Wilczyński commit 3d3d6733065c9670f8df6630990d4885933b1e55 Merge: f079ab01b5609 8cc3b1ccd930f Author: Linus Torvalds Date: Wed Jan 12 13:19:35 2022 -0800 Merge tag 'fsnotify_for_v5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs Pull fanotify updates from Jan Kara: "Support for new FAN_RENAME fanotify event and support for reporting child info in directory fanotify events (FAN_REPORT_TARGET_FID)" * tag 'fsnotify_for_v5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: fanotify: wire up FAN_RENAME event fanotify: report old and/or new parent+name in FAN_RENAME event fanotify: record either old name new name or both for FAN_RENAME fanotify: record old and new parent and name in FAN_RENAME event fanotify: support secondary dir fh and name in fanotify_info fanotify: use helpers to parcel fanotify_info buffer fanotify: use macros to get the offset to fanotify_info buffer fsnotify: generate FS_RENAME event with rich information fanotify: introduce group flag FAN_REPORT_TARGET_FID fsnotify: separate mark iterator type from object type enum fsnotify: clarify object type argument commit f079ab01b5609fb0c9acc52c88168bf1eed82373 Merge: 6020c204be997 4d7bd0eb72e58 Author: Linus Torvalds Date: Wed Jan 12 12:51:41 2022 -0800 Merge tag 'iomap-5.17' of git://git.infradead.org/users/willy/linux Pull iomap updates from Matthew Wilcox: "Convert xfs/iomap to use folios. This should be all that is needed for XFS to use large folios. There is no code in this pull request to create large folios, but no additional changes should be needed to XFS or iomap once they are created. Usually this would have come from Darrick, and we had intended that it would come that route. Between the holidays and various things which Darrick needed to work on, he asked if I could send things directly. There weren't any other iomap patches pending for this release, which probably also played a role" * tag 'iomap-5.17' of git://git.infradead.org/users/willy/linux: (26 commits) iomap: Inline __iomap_zero_iter into its caller xfs: Support large folios iomap: Support large folios in invalidatepage iomap: Convert iomap_migrate_page() to use folios iomap: Convert iomap_add_to_ioend() to take a folio iomap: Simplify iomap_do_writepage() iomap: Simplify iomap_writepage_map() iomap,xfs: Convert ->discard_page to ->discard_folio iomap: Convert iomap_write_end_inline to take a folio iomap: Convert iomap_write_begin() and iomap_write_end() to folios iomap: Convert __iomap_zero_iter to use a folio iomap: Allow iomap_write_begin() to be called with the full length iomap: Convert iomap_page_mkwrite to use a folio iomap: Convert readahead and readpage to use a folio iomap: Convert iomap_read_inline_data to take a folio iomap: Use folio offsets instead of page offsets iomap: Convert bio completions to use folios iomap: Pass the iomap_page into iomap_set_range_uptodate iomap: Add iomap_invalidate_folio iomap: Convert iomap_releasepage to use a folio ... commit 6020c204be997e3f5129839ff9c801800fb4336e Merge: 81ff0be4b9e3b 6b24ca4a1a8d4 Author: Linus Torvalds Date: Wed Jan 12 12:37:02 2022 -0800 Merge tag 'folio-5.17' of git://git.infradead.org/users/willy/pagecache Pull folio conversion updates from Matthew Wilcox: "Convert much of the page cache to use folios This stops just short of actually enabling large folios. It converts everything that I noticed needs to be converted, but there may still be places I've overlooked which still have page size assumptions. The big change here is using large entries in the page cache XArray instead of many small entries. That only affects shmem for now, but it's a pretty big change for shmem since it changes where memory needs to be allocated (at split time instead of insertion)" * tag 'folio-5.17' of git://git.infradead.org/users/willy/pagecache: (49 commits) mm: Use multi-index entries in the page cache XArray: Add xas_advance() truncate,shmem: Handle truncates that split large folios truncate: Convert invalidate_inode_pages2_range to folios fs: Convert vfs_dedupe_file_range_compare to folios mm: Remove pagevec_remove_exceptionals() mm: Convert find_lock_entries() to use a folio_batch filemap: Return only folios from find_get_entries() filemap: Convert filemap_get_read_batch() to use a folio_batch filemap: Convert filemap_read() to use a folio truncate: Add invalidate_complete_folio2() truncate: Convert invalidate_inode_pages2_range() to use a folio truncate: Skip known-truncated indices truncate,shmem: Add truncate_inode_folio() shmem: Convert part of shmem_undo_range() to use a folio mm: Add unmap_mapping_folio() truncate: Add truncate_cleanup_folio() filemap: Add filemap_release_folio() filemap: Use a folio in filemap_page_mkwrite filemap: Use a folio in filemap_map_pages ... commit 11ed8b8624b8085f706864b4addcd304b1e4fc38 Author: Jim Quinlan Date: Thu Jan 6 11:03:30 2022 -0500 PCI: brcmstb: Do not turn off WOL regulators on suspend If any downstream device can be a wakeup device, do not turn off the regulators as the device will need them on. Link: https://lore.kernel.org/r/20220106160332.2143-8-jim2101024@gmail.com Signed-off-by: Jim Quinlan Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas commit 93e41f3fca3d4a0f927b784012338c37f80a8a80 Author: Jim Quinlan Date: Thu Jan 6 11:03:29 2022 -0500 PCI: brcmstb: Add control of subdevice voltage regulators This Broadcom STB PCIe RC driver has one port and connects directly to one device, be it a switch or an endpoint. We want to be able to leverage the recently added mechanism that allocates and turns on/off subdevice regulators. All that needs to be done is to put the regulator DT nodes in the bridge below host and to set the pci_ops methods add_bus and remove_bus. Note that the pci_subdev_regulators_add_bus() method is wrapped for two reasons: 1. To achieve link up after the voltage regulators are turned on. 2. If, in the case of an unsuccessful link up, to redirect any PCIe accesses to subdevices, e.g. the scan for DEV/ID. This redirection is needed because the Broadcom PCIe HW will issue a CPU abort if such an access is made when the link is down. [bhelgaas: fold in https://lore.kernel.org/r/20220112013100.48029-1-jim2101024@gmail.com] Link: https://lore.kernel.org/r/20220106160332.2143-7-jim2101024@gmail.com Signed-off-by: Jim Quinlan Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas commit 67211aadcb4b968d0fdc57bc27240fa71500c2d4 Author: Jim Quinlan Date: Thu Jan 6 11:03:28 2022 -0500 PCI: brcmstb: Add mechanism to turn on subdev regulators Add a mechanism to identify standard PCIe regulators in the DT, allocate them, and turn them on before the rest of the bus is scanned during pci_host_probe(). The allocated structure that contains the regulators is stored in the port driver dev.driver_data field. Here is a point-by-point of how and when this mechanism is activated: If: -- PCIe RC driver sets pci_ops {add,remove)_bus to pci_subdev_regulators_{add,remove}_bus during its probe. -- There is a DT node "RB" under the host bridge DT node. -- During the RC driver's pci_host_probe() the add_bus callback is invoked where (bus->parent && pci_is_root_bus(bus->parent) is true Then: -- A struct subdev_regulators structure will be allocated and assigned to bus->dev.driver_data. -- regulator_bulk_{get,enable} will be invoked on &bus->dev and the former will search for and process any vpcie{12v,3v3,3v3aux}-supply properties that reside in node "RB". -- The regulators will be turned off/on for any unbind/bind operations. -- The regulators will be turned off/on for any suspend/resumes, but only if the RC driver handles this on its own. This will appear in a later commit for the pcie-brcmstb.c driver. The unabridged reason for doing this is as follows. We would like the Broadcom STB PCIe root complex driver (and others) to be able to turn off/on regulators[1] that provide power to endpoint[2] devices. Typically, the drivers of these endpoint devices are stock Linux drivers that are not aware that these regulator(s) exist and must be turned on for the driver to be probed. The simple solution of course is to turn these regulators on at boot and keep them on. However, this solution does not satisfy at least three of our usage modes: 1. For example, one customer uses multiple PCIe controllers, but wants the ability to, by script invoking and unbind, turn any or all of them and their subdevices off to save power, e.g. when in battery mode. 2. Another example is when a watchdog script discovers that an endpoint device is in an unresponsive state and would like to unbind, power toggle, and re-bind just the PCIe endpoint and controller. 3. Of course we also want power turned off during suspend mode. However, some endpoint devices may be able to "wake" during suspend and we need to recognise this case and veto the nominal act of turning off its regulator. Such is the case with Wake-on-LAN and Wake-on-WLAN support where the PCIe endpoint device needs to be kept powered on in order to receive network packets and wake the system. In all of these cases it is advantageous for the PCIe controller to govern the turning off/on the regulators needed by the endpoint device. The first two cases can be done by simply unbinding and binding the PCIe controller, if the controller has control of these regulators. [1] These regulators typically govern the actual power supply to the endpoint chip. Sometimes they may be the official PCIe socket power -- such as 3.3v or aux-3.3v. Sometimes they are truly the regulator(s) that supply power to the EP chip. [2] The 99% configuration of our boards is a single endpoint device attached to the PCIe controller. I use the term endpoint but it could possibly mean a switch as well. Link: https://lore.kernel.org/r/20220106160332.2143-6-jim2101024@gmail.com Signed-off-by: Jim Quinlan Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas commit 830aa6f29f07a4e2f1a947dfa72b3ccddb46dd21 Author: Jim Quinlan Date: Thu Jan 6 11:03:27 2022 -0500 PCI: brcmstb: Split brcm_pcie_setup() into two funcs We need to take some code in brcm_pcie_setup() and put it in a new function brcm_pcie_linkup(). In future commits the brcm_pcie_linkup() function will be called indirectly by pci_host_probe() as opposed to the host driver invoking it directly. Some code that was executed after the PCIe linkup is now placed so that it executes prior to linkup, since this code has to run prior to the invocation of pci_host_probe(). Link: https://lore.kernel.org/r/20220106160332.2143-5-jim2101024@gmail.com Signed-off-by: Jim Quinlan Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas commit ea372f45cfff7774c57f685b0c1a86951a15e18a Author: Jim Quinlan Date: Thu Jan 6 11:03:26 2022 -0500 dt-bindings: PCI: Add bindings for Brcmstb EP voltage regulators Add bindings for Brcmstb EP voltage regulators. A new mechanism is to be added to the Linux PCI subsystem that will allocate and turn on/off regulators. These are standard regulators -- vpcie12v, vpcie3v3, and vpcie3v3aux -- placed in the DT in the bridge node under the host bridge device. The use of a regulator property in the PCIe EP subnode such as "vpcie12v-supply" depends on a pending pullreq to the pci-bus.yaml file at https://github.com/devicetree-org/dt-schema/pull/63 Link: https://lore.kernel.org/r/20220106160332.2143-4-jim2101024@gmail.com Signed-off-by: Jim Quinlan Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Rob Herring Acked-by: Florian Fainelli commit 504253e44a9dc91e535f84273ebded324de4d2f6 Author: Jim Quinlan Date: Thu Jan 6 11:03:25 2022 -0500 dt-bindings: PCI: Correct brcmstb interrupts, interrupt-map. The "pcie" and "msi" interrupts were given the same interrupt when they are actually different. Interrupt-map only had the INTA entry; add the INTB, INTC, and INTD entries. Link: https://lore.kernel.org/r/20220106160332.2143-3-jim2101024@gmail.com Signed-off-by: Jim Quinlan Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Acked-by: Florian Fainelli Acked-by: Rob Herring commit 41ac424ac188d9d04c9831fd0fe6bce73ae2ec03 Author: Jim Quinlan Date: Thu Jan 6 11:03:24 2022 -0500 PCI: brcmstb: Fix function return value handling Do at least a dev_err() on some calls to reset_control_rearm() and brcm_phy_stop(). In some cases it may not make sense to return this error value "above" as doing so will cause more trouble than is warranted. Link: https://lore.kernel.org/r/20220106160332.2143-2-jim2101024@gmail.com Signed-off-by: Jim Quinlan Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Acked-by: Florian Fainelli commit 09a710d952b985331ff0ffa2b648f2ae4da5507a Author: Florian Fainelli Date: Mon Nov 22 11:04:58 2021 -0800 PCI: brcmstb: Do not use __GENMASK Define the legacy MSI interrupt bitmask as well as the non-legacy interrupt bitmask using GENMASK and then use them in brcm_msi_set_regs() in place of __GENMASK(). Link: https://lore.kernel.org/r/20211122190459.3189616-1-f.fainelli@gmail.com Reported-by: Andy Shevchenko Signed-off-by: Florian Fainelli Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Andy Shevchenko commit bf7325882525b580c4e41cd36845bcf8113307fe Author: Christophe JAILLET Date: Sun Nov 7 09:32:58 2021 +0100 PCI: brcmstb: Declare 'used' as bitmap, not unsigned long The 'used' field of 'struct brcm_msi' is used as a bitmap. Declare it with DECLARE_BITMAP() and adjust users accordingly. This fixes a harmless Coverity warning about array vs singleton usage. This bitmap can be used for either legacy or MSI interrupts, which require a size of BRCM_INT_PCI_MSI_LEGACY_NR or BRCM_INT_PCI_MSI_NR respectively. Add a BUILD_BUG_ON() to ensure it is large enough. Suggested-by: Krzysztof Wilczynski Addresses-Coverity: "Out-of-bounds access (ARRAY_VS_SINGLETON)" Link: https://lore.kernel.org/r/e6d9da2112aab2939d1507b90962d07bfd735b4c.1636273671.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Florian Fainelli commit 81ff0be4b9e3bcfee022d71cf89d72f7e2ed41ba Merge: 57ea81971b729 bc128349588d5 Author: Linus Torvalds Date: Wed Jan 12 11:33:50 2022 -0800 Merge tag 'spdx-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/spdx Pull SPDX/License update from Greg KH: "Here is a single change that fixes up the description of the 'LGPL-2.1 or later' identifiers so that the tools properly acknowledge that this is a valid license. This change has been in linux-next for weeks with no reported problems" * tag 'spdx-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/spdx: LICENSES/LGPL-2.1: Add LGPL-2.1-or-later as valid identifiers commit 57ea81971b7296b42fc77424af44c5915d3d4ae2 Merge: 342465f5337f7 cbb4f5f435995 Author: Linus Torvalds Date: Wed Jan 12 11:27:57 2022 -0800 Merge tag 'usb-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB and Thunderbolt updates from Greg KH: "Here is the big set of USB and Thunderbolt driver changes for 5.17-rc1. Nothing major in here, just lots of little updates and cleanups. These include: - some USB header fixes picked from Ingo's header-splitup work - more USB4/Thunderbolt hardware support added - USB gadget driver updates and additions - USB typec additions (includes some acpi changes, which were acked by the ACPI maintainer) - core USB fixes as found by syzbot that were too late for 5.16-final - USB dwc3 driver updates - USB dwc2 driver updates - platform_get_irq() conversions of some USB drivers - other minor USB driver updates and additions All of these have been in linux-next for a while with no reported issues" * tag 'usb-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (111 commits) docs: ABI: fixed formatting in configfs-usb-gadget-uac2 usb: gadget: u_audio: Subdevice 0 for capture ctls usb: gadget: u_audio: fix calculations for small bInterval usb: dwc2: gadget: initialize max_speed from params usb: dwc2: do not gate off the hardware if it does not support clock gating usb: dwc3: qcom: Fix NULL vs IS_ERR checking in dwc3_qcom_probe headers/deps: USB: Optimize dependencies, remove USB: common: debug: add needed kernel.h include headers/prep: Fix non-standard header section: drivers/usb/host/ohci-tmio.c headers/prep: Fix non-standard header section: drivers/usb/cdns3/core.h headers/prep: usb: gadget: Fix namespace collision USB: core: Fix bug in resuming hub's handling of wakeup requests USB: Fix "slab-out-of-bounds Write" bug in usb_hcd_poll_rh_status usb: dwc3: dwc3-qcom: Add missing platform_device_put() in dwc3_qcom_acpi_register_core usb: gadget: clear related members when goto fail usb: gadget: don't release an existing dev->buf usb: dwc2: Simplify a bitmap declaration usb: Remove usb_for_each_port() usb: typec: port-mapper: Convert to the component framework usb: Link the ports to the connectors they are attached to ... commit 8a59bb93b7e3cca389af44781a429ac12ac49be6 Author: Olga Kornievskaia Date: Thu Dec 9 14:53:30 2021 -0500 NFSv4 store server support for fs_location attribute Define and store if server returns it supports fs_locations attribute as a capability. Signed-off-by: Olga Kornievskaia Signed-off-by: Anna Schumaker commit 90e12a3191040bd3854d3e236c35921e4e92a044 Author: Olga Kornievskaia Date: Thu Dec 9 14:53:29 2021 -0500 NFSv4 remove zero number of fs_locations entries error check Remove the check for the zero length fs_locations reply in the xdr decoding, and instead check for that in the migration code. Signed-off-by: Olga Kornievskaia Signed-off-by: Anna Schumaker commit 342465f5337f7bd5b8bd3b6f939ac12b620cbb43 Merge: 22ef12195e13c 93a770b7e1677 Author: Linus Torvalds Date: Wed Jan 12 11:21:52 2022 -0800 Merge tag 'tty-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull tty/serial driver updates from Greg KH: "Here is the big set of tty/serial driver updates for 5.17-rc1. Nothing major in here, just lots of good updates and fixes, including: - more tty core cleanups from Jiri as well as mxser driver cleanups. This is the majority of the core diffstat - tty documentation updates from Jiri - platform_get_irq() updates - various serial driver updates for new features and hardware - fifo usage for 8250 console, reducing cpu load a lot - LED fix for keyboards, long-time bugfix that went through many revisions - minor cleanups All have been in linux-next for a while with no reported problems" * tag 'tty-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (119 commits) serial: core: Keep mctrl register state and cached copy in sync serial: stm32: correct loop for dma error handling serial: stm32: fix flow control transfer in DMA mode serial: stm32: rework TX DMA state condition serial: stm32: move tx dma terminate DMA to shutdown serial: pl011: Drop redundant DTR/RTS preservation on close/open serial: pl011: Drop CR register reset on set_termios serial: pl010: Drop CR register reset on set_termios serial: liteuart: fix MODULE_ALIAS serial: 8250_bcm7271: Fix return error code in case of dma_alloc_coherent() failure Revert "serdev: BREAK/FRAME/PARITY/OVERRUN notification prototype V2" tty: goldfish: Use platform_get_irq() to get the interrupt serdev: BREAK/FRAME/PARITY/OVERRUN notification prototype V2 tty: serial: meson: Drop the legacy compatible strings and clock code serial: pmac_zilog: Use platform_get_irq() to get the interrupt serial: bcm63xx: Use platform_get_irq() to get the interrupt serial: ar933x: Use platform_get_irq() to get the interrupt serial: vt8500: Use platform_get_irq() to get the interrupt serial: altera_jtaguart: Use platform_get_irq_optional() to get the interrupt serial: pxa: Use platform_get_irq() to get the interrupt ... commit 22ef12195e13c5ec58320dbf99ef85059a2c0820 Merge: 6dc69d3d0d18d fa783154524a7 Author: Linus Torvalds Date: Wed Jan 12 11:18:49 2022 -0800 Merge tag 'staging-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging driver updates from Greg KH: "Here's the big set of staging driver updates for 5.17-rc1 Nothing major in here at all, just lots and lots of tiny cleanups. Overall more code was removed than added, which is always nice, but not a huge change. Majority of the work happened in the r8188eu driver, that had hundreds of cleanups happen on it, but almost all other staging drivers had cleanups as well. No new functionality was added, cleanups only. All of these have been in linux-next for a while with no reported problems" * tag 'staging-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (308 commits) staging: r8188eu: rename camelcase variable uintPeerChannel staging: r8188eu: make BW20_24G_Diff a 1-D array staging: r8188eu: make OFDM_24G_Diff a 1-D array staging: r8188eu: BW40_24G_Diff is set but not used staging: r8188eu: CCK_24G_Diff is set but not used staging: r8188eu: make Index24G_BW40_Base a 1-D array staging: r8188eu: make Index24G_CCK_Base a 1-D array staging: r8188eu: rfPath is always 0 staging: r8188eu: remove unneeded parameter from rtl8188e_SetHalODMVar staging: pi433: add comment to rx_lock mutex definition staging: pi433: fix frequency deviation check staging: vc04_services: rename BM2835 to BCM2835 in headers comments staging: vc04_services: rename string literal containing bm2835_* to bcm2835*_ staging: vc04_services: rename variables containing bm2835_* to bcm2835_* staging: vc04_services: rename functions containing bm2835_* to bcm2835_* staging: vc04_services: rename structures bm2835_mmal_dev and bm2835_mmal_v4l2_ctrl staging: greybus: audio: Check null pointer staging: r8188eu: add spaces around P2P_AP_P2P_CH_SWITCH_PROCESS_WK staging: r8188eu: turbo scan is always off for r8188eu staging: r8188eu: cmd_issued_cnt is set but not used ... commit 6dc69d3d0d18d587ab9d809fe060ba4417cf0279 Merge: e3084ed48fd6b c9512fd032acf Author: Linus Torvalds Date: Wed Jan 12 11:11:34 2022 -0800 Merge tag 'driver-core-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core updates from Greg KH: "Here is the set of changes for the driver core for 5.17-rc1. Lots of little things here, including: - kobj_type cleanups - auxiliary_bus documentation updates - auxiliary_device conversions for some drivers (relevant subsystems all have provided acks for these) - kernfs lock contention reduction for some workloads - other tiny cleanups and changes. All of these have been in linux-next for a while with no reported issues" * tag 'driver-core-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (43 commits) kobject documentation: remove default_attrs information drivers/firmware: Add missing platform_device_put() in sysfb_create_simplefb debugfs: lockdown: Allow reading debugfs files that are not world readable driver core: Make bus notifiers in right order in really_probe() driver core: Move driver_sysfs_remove() after driver_sysfs_add() firmware: edd: remove empty default_attrs array firmware: dmi-sysfs: use default_groups in kobj_type qemu_fw_cfg: use default_groups in kobj_type firmware: memmap: use default_groups in kobj_type sh: sq: use default_groups in kobj_type headers/uninline: Uninline single-use function: kobject_has_children() devtmpfs: mount with noexec and nosuid driver core: Simplify async probe test code by using ktime_ms_delta() nilfs2: use default_groups in kobj_type kobject: remove kset from struct kset_uevent_ops callbacks driver core: make kobj_type constant. driver core: platform: document registration-failure requirement vdpa/mlx5: Use auxiliary_device driver data helpers net/mlx5e: Use auxiliary_device driver data helpers soundwire: intel: Use auxiliary_device driver data helpers ... commit 5865918fe49ed3cb9d7b5d21f41aff8a68fbceb1 Author: Paul Cercueil Date: Fri Jan 7 18:17:23 2022 +0000 iio: pressure: bmp280: Use new PM macros Use the new EXPORT_RUNTIME_DEV_PM_OPS() macro. It allows the underlying dev_pm_ops struct as well as the suspend/resume callbacks to be detected as dead code in the case where CONFIG_PM is disabled, without having to wrap everything inside #ifdef CONFIG_PM guards. Signed-off-by: Paul Cercueil Acked-by: Jonathan Cameron Reviewed-by: Ulf Hansson Signed-off-by: Rafael J. Wysocki commit d59ff7d9d84b03d22c5107f794e28fc8e1fce3a6 Author: Paul Cercueil Date: Fri Jan 7 18:17:22 2022 +0000 PM: runtime: Add EXPORT[_GPL]_RUNTIME_DEV_PM_OPS macros Similar to EXPORT[_GPL]_SIMPLE_DEV_PM_OPS, but for users with runtime-PM suspend/resume callbacks. Signed-off-by: Paul Cercueil Acked-by: Jonathan Cameron Reviewed-by: Ulf Hansson Signed-off-by: Rafael J. Wysocki commit 9d8619190031af0a314bee865262d8975473e4dd Author: Paul Cercueil Date: Fri Jan 7 18:17:21 2022 +0000 PM: runtime: Add DEFINE_RUNTIME_DEV_PM_OPS() macro A lot of drivers create a dev_pm_ops struct with the system sleep suspend/resume callbacks set to pm_runtime_force_suspend() and pm_runtime_force_resume(). These drivers can now use the DEFINE_RUNTIME_DEV_PM_OPS() macro, which will use pm_runtime_force_{suspend,resume}() as the system sleep callbacks, while having the same dead code removal characteristic that is already provided by DEFINE_SIMPLE_DEV_PM_OPS(). Signed-off-by: Paul Cercueil Acked-by: Jonathan Cameron Reviewed-by: Ulf Hansson Signed-off-by: Rafael J. Wysocki commit 0ae101fdd3297b7165755340e05386f1e1379709 Author: Paul Cercueil Date: Fri Jan 7 18:17:20 2022 +0000 PM: core: Add EXPORT[_GPL]_SIMPLE_DEV_PM_OPS macros These macros are defined conditionally, according to CONFIG_PM: - if CONFIG_PM is enabled, these macros resolve to DEFINE_SIMPLE_DEV_PM_OPS(), and the dev_pm_ops symbol will be exported. - if CONFIG_PM is disabled, these macros will result in a dummy static dev_pm_ops to be created with the __maybe_unused flag. The dev_pm_ops will then be discarded by the compiler, along with the provided callback functions if they are not used anywhere else. In the second case, the symbol is not exported, which should be perfectly fine - users of the symbol should all use the pm_ptr() or pm_sleep_ptr() macro, so the dev_pm_ops marked as "extern" in the client's code will never be accessed. Signed-off-by: Paul Cercueil Acked-by: Jonathan Cameron Reviewed-by: Ulf Hansson Signed-off-by: Rafael J. Wysocki commit 52cc1d7f9786d2be44a3ab9b5b48416a7618e713 Author: Paul Cercueil Date: Fri Jan 7 18:17:19 2022 +0000 PM: core: Remove static qualifier in DEFINE_SIMPLE_DEV_PM_OPS macro Keep this macro in line with the other ones. This makes it possible to use them in the cases where the underlying dev_pm_ops structure is exported. Restore the "static" qualifier in the two drivers where the DEFINE_SIMPLE_DEV_PM_OPS macro was used. Signed-off-by: Paul Cercueil Acked-by: Jonathan Cameron Reviewed-by: Ulf Hansson Signed-off-by: Rafael J. Wysocki commit 3f4b32511a77bc5a05cfbf26fec94c4e1b1cf46a Author: Paul Cercueil Date: Fri Jan 7 18:17:18 2022 +0000 PM: core: Remove DEFINE_UNIVERSAL_DEV_PM_OPS() macro The deprecated UNIVERSAL_DEV_PM_OPS() macro uses the provided callbacks for both runtime PM and system sleep, which is very likely to be a mistake, as a system sleep can be triggered while a given device is already PM-suspended, which would cause the suspend callback to be called twice. The amount of users of UNIVERSAL_DEV_PM_OPS() is also tiny (16 occurences) compared to the number of places where SET_SYSTEM_SLEEP_PM_OPS() is used with pm_runtime_force_suspend() and pm_runtime_force_resume(), which makes me think that none of these cases are actually valid. As the new macro DEFINE_UNIVERSAL_DEV_PM_OPS() which was introduced to replace UNIVERSAL_DEV_PM_OPS() is currently unused, remove it before someone starts to use it in yet another invalid case. Signed-off-by: Paul Cercueil Acked-by: Jonathan Cameron Reviewed-by: Ulf Hansson Signed-off-by: Rafael J. Wysocki commit e3084ed48fd6b661fe434da0cb36d7d6706cf27f Merge: 2ab9c9675fe89 7442936633bd1 Author: Linus Torvalds Date: Wed Jan 12 10:56:08 2022 -0800 Merge tag 'pinctrl-v5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl Pull pin control bulk updates from Linus Walleij: "Core changes: - New standard enumerator and corresponding device tree bindings for output impedance pin configuration. (Implemented and used in the Renesas rzg2l driver.) - Cleanup of Kconfig and Makefile to be somewhat orderly and alphabetic. New drivers: - Samsung Exynos 7885 pin controller. - Ocelot LAN966x pin controller. - Qualcomm SDX65 pin controller. - Qualcomm SM8450 pin controller. - Qualcomm PM8019, PM8226 and PM2250 pin controllers. - NXP/Freescale i.MXRT1050 pin controller. - Intel Thunder Bay pin controller. Enhancements: - Introduction of the string library helper function "kasprintf_strarray()" and subsequent use in Rockchip, ST and Armada pin control drivers, as well as the GPIO mockup driver. - The Ocelot pin controller has been extensively rewritten to use regmap and other modern kernel infrastructure. - The Microchip SGPIO driver has been converted to use regmap. - The SPEAr driver had been converted to use regmap. - Substantial cleanups and janitorial on the Apple pin control driver that was merged for v5.16. - Janitorial to remove of_node assignments in the GPIO portions that anyway get this handled in the GPIO core. - Minor cleanups and improvements in several pin controllers" * tag 'pinctrl-v5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (98 commits) pinctrl: imx: fix assigning groups names dt-bindings: pinctrl: mt8195: add wrapping node of pin configurations pinctrl: bcm: ns: use generic groups & functions helpers pinctrl: imx: fix allocation result check pinctrl: samsung: Use platform_get_irq_optional() to get the interrupt pinctrl: Propagate firmware node from a parent device dt-bindings: pinctrl: qcom: Add SDX65 pinctrl bindings pinctrl: add one more "const" for generic function groups pinctrl: keembay: rework loops looking for groups names pinctrl: keembay: comment process of building functions a bit pinctrl: imx: prepare for making "group_names" in "function_desc" const ARM: dts: gpio-ranges property is now required pinctrl: aspeed: fix unmet dependencies on MFD_SYSCON for PINCTRL_ASPEED pinctrl: Get rid of duplicate of_node assignment in the drivers pinctrl-sunxi: don't call pinctrl_gpio_direction() pinctrl-bcm2835: don't call pinctrl_gpio_direction() pinctrl: bcm2835: Silence uninit warning pinctrl: Sort Kconfig and Makefile entries alphabetically pinctrl: Add Intel Thunder Bay pinctrl driver dt-bindings: pinctrl: Add bindings for Intel Thunderbay pinctrl driver ... commit 9e87a8da747bf72365abb79e6f64fcca955b4f56 Author: Merlijn Wajer Date: Sun Dec 12 23:40:07 2021 +0100 leds: lp55xx: initialise output direction from dts Commit a5d3d1adc95f ("leds: lp55xx: Initialize enable GPIO direction to output") attempts to fix this, but the fix did not work since at least for the Nokia N900 the value needs to be set to HIGH, per the device tree. So rather than hardcoding the value to a potentially invalid value for some devices, let's set direction in lp55xx_init_device. Fixes: a5d3d1adc95f ("leds: lp55xx: Initialize enable GPIO direction to output") Fixes: 92a81562e695 ("leds: lp55xx: Add multicolor framework support to lp55xx") Fixes: ac219bf3c9bd ("leds: lp55xx: Convert to use GPIO descriptors") Signed-off-by: Merlijn Wajer Reviewed-by: Linus Walleij Signed-off-by: Pavel Machek commit e9af026a3b24f59d7af4609f73e0ef60a4d6d516 Author: Sicelo A. Mhlongo Date: Sun Dec 12 23:40:06 2021 +0100 ARM: dts: omap3-n900: Fix lp5523 for multi color 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. Fixes: 92a81562e695 ("leds: lp55xx: Add multicolor framework support to lp55xx") Fixes: ac219bf3c9bd ("leds: lp55xx: Convert to use GPIO descriptors") Signed-off-by: Merlijn Wajer Signed-off-by: Sicelo A. Mhlongo Signed-off-by: Pavel Machek commit a05f5d0e6aebd5c562d7f61b0fd3904d3e3994d1 Author: Lad Prabhakar Date: Mon Dec 13 19:03:31 2021 +0000 leds: ktd2692: Drop calling dev_of_node() in ktd2692_parse_dt output of dev_of_node() is already assigned to "np" variable in ktd2692_parse_dt(). Use "np" variable to check if OF node is NULL instead of calling dev_of_node() again. Signed-off-by: Lad Prabhakar Signed-off-by: Pavel Machek commit 2702c9be20acf61c5c4cdee273792c3a4c92db12 Author: Andy Shevchenko Date: Tue Dec 14 16:27:39 2021 +0200 leds: lgm-sso: Get rid of duplicate of_node assignment GPIO library does copy the of_node from the parent device of the GPIO chip, there is no need to repeat this in the individual drivers. Remove assignment here. For the details one may look into the of_gpio_dev_init() implementation. Call graph: --> sso_gpio_gc_init() --> devm_gpiochip_add_data --> devm_gpiochip_add_data_with_key --> gpiochip_add_data_with_key() --> of_gpio_dev_init() Signed-off-by: Andy Shevchenko Signed-off-by: Pavel Machek commit 27d1a6210d27c973f6bb31a24836099fb8c925ab Author: Andy Shevchenko Date: Tue Dec 14 16:27:38 2021 +0200 leds: tca6507: Get rid of duplicate of_node assignment GPIO library does copy the of_node from the parent device of the GPIO chip, there is no need to repeat this in the individual drivers. Remove assignment here. For the details one may look into the of_gpio_dev_init() implementation. Call graph: --> tca6507_probe_gpios() --> gpiochip_add_data() --> gpiochip_add_data_with_key() --> of_gpio_dev_init() Signed-off-by: Andy Shevchenko Signed-off-by: Pavel Machek commit b7f1ac9bb6413b739ea91bd61bdf23c9130a8007 Author: Linus Walleij Date: Mon Nov 22 11:28:51 2021 +0100 leds: leds-fsg: Drop FSG3 LED driver The board file using this driver has been deleted and the FSG3 LEDs can be modeled using a system controller and some register bit LEDs in the device tree so this driver is no longer needed. Reported-by: Lukas Bulwahn Cc: Krzysztof Hałasa Cc: Rod Whitby Signed-off-by: Linus Walleij Signed-off-by: Pavel Machek commit 6212264be7df1d6b5b9eec4f1f1539abb071ff85 Author: Sven Schuchmann Date: Fri Nov 26 16:28:46 2021 +0100 leds: lp50xx: remove unused variable During code review this unused variable was found. Remove it. Signed-off-by: Sven Schuchmann Signed-off-by: Pavel Machek commit 8018708d2d39a08144f39f0a61e49cdb943c2b2e Author: ChiYuan Huang Date: Wed Nov 17 15:22:06 2021 +0800 dt-bindings: leds: Replace moonlight with indicator in mt6360 example Replace moonlight with indicator in mt6360 example to prevent the below build error: Error: Documentation/devicetree/bindings/leds/leds-mt6360.example.dts:114.24-25 syntax error FATAL ERROR: Unable to parse input tree make[1]: *** [scripts/Makefile.lib:385: Documentation/devicetree/bindings/leds/leds-mt6360.example.dt.yaml] Error 1 Link: https://lore.kernel.org/lkml/CAL_JsqJRMVE163LaHTbtFARc4f_qg33bfQx+sD3ukce_xQF+gA@mail.gmail.com/ Signed-off-by: ChiYuan Huang Reviewed-by: Gene Chen Acked-by: Rob Herring Signed-off-by: Pavel Machek commit 495b8966f7ad92cac9ff84b52ce6365b1bf9c68c Author: Sander Vanheule Date: Sat Nov 13 22:11:13 2021 +0100 leds: led-core: Update fwnode with device_set_node Update a newly created device's fwnode and of_node pointers using the recently added device_set_node helper. This keeps some firmware node specifics out of led-class and should help tracking future changes regarding device firmware node updates. Signed-off-by: Sander Vanheule Signed-off-by: Pavel Machek commit fa019ba4f202bce2aa1c6fcaead828d9625b9084 Author: Yihao Han Date: Sun Nov 14 19:24:28 2021 -0800 leds: tca6507: use swap() to make code cleaner Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid opencoding it. Signed-off-by: Yihao Han Signed-off-by: Pavel Machek commit 2ab9c9675fe892e7fe9fa8c0a6125e2b40d2889d Merge: 49008f0cc1ef0 8d4ff8187bb2b Author: Linus Torvalds Date: Wed Jan 12 10:43:08 2022 -0800 Merge tag 'media/v5.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull media fixes from Mauro Carvalho Chehab: - some fixes at si2157 tuning logic - a warning fix on atomisp when used with clang * tag 'media/v5.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: media: si2157: add support for DVB-C Annex C media: si2157: fix bandwidth stored in dev media: si2157: fix 6MHz & 6.1MHz bandwidth setting media: atomisp: Do not define input_system_cfg2400_t twice commit 679f8652064bfa2f622c7b2bab86b1bf3207d6bc Author: Gene Chen Date: Mon Nov 15 15:03:11 2021 +0100 leds: Add mt6360 driver Add MT6360 LED driver include 2-channel Flash LED with torch/strobe mode, 3-channel RGB LED support Register/Flash/Breath Mode, and 1-channel for moonlight LED. Signed-off-by: Gene Chen Acked-by: Jacek Anaszewski Signed-off-by: Pavel Machek commit 415b4b6c447ae03cb1d9cfc91df39616c92f15e2 Author: kernel test robot Date: Thu Jan 6 01:45:56 2022 +0800 ACPI: PCC: pcc_ctx can be static drivers/acpi/acpi_pcc.c:34:22: warning: symbol 'pcc_ctx' was not declared. Should it be static? Reported-by: kernel test robot Signed-off-by: kernel test robot Reviewed-by: Sudeep Holla Signed-off-by: Rafael J. Wysocki commit 49008f0cc1ef0b86ccfa0d1d99e67741d46bd35b Merge: c9193f48e94de eaac0b590a47c Author: Linus Torvalds Date: Wed Jan 12 10:40:11 2022 -0800 Merge tag 'for-5.17/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm Pull device mapper updates from Mike Snitzer: - Fixes and improvements to dm btree and dm space map code in persistent-data library used by thinp and cache. - Update DM integrity to use struct_group() to zero struct journal_sector. - Update DM sysfs to use default_groups in kobj_type. * tag 'for-5.17/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: dm sysfs: use default_groups in kobj_type dm integrity: Use struct_group() to zero struct journal_sector dm space map common: add bounds check to sm_ll_lookup_bitmap() dm btree: add a defensive bounds check to insert_at() dm btree remove: change a bunch of BUG_ON() calls to proper errors dm btree spine: eliminate duplicate le32_to_cpu() in node_check() dm btree spine: remove extra node_check function declaration commit c9193f48e94deaeff0c9abbc67b9584e8ddc42ed Merge: d3c810803576d d85bd8233fff0 Author: Linus Torvalds Date: Wed Jan 12 10:35:23 2022 -0800 Merge tag 'for-5.17/drivers-2022-01-11' of git://git.kernel.dk/linux-block Pull block driver updates from Jens Axboe: - mtip32xx pci cleanups (Bjorn) - mtip32xx conversion to generic power management (Vaibhav) - rsxx pci powermanagement cleanups (Bjorn) - Remove the rsxx driver. This hardware never saw much adoption, and it's been end of lifed for a while. (Christoph) - MD pull request from Song: - REQ_NOWAIT support (Vishal Verma) - raid6 benchmark optimization (Dirk Müller) - Fix for acct bioset (Xiao Ni) - Clean up max_queued_requests (Mariusz Tkaczyk) - PREEMPT_RT optimization (Davidlohr Bueso) - Use default_groups in kobj_type (Greg Kroah-Hartman) - Use attribute groups in pktcdvd and rnbd (Greg) - NVMe pull request from Christoph: - increment request genctr on completion (Keith Busch, Geliang Tang) - add a 'iopolicy' module parameter (Hannes Reinecke) - print out valid arguments when reading from /dev/nvme-fabrics (Hannes Reinecke) - Use struct_group() in drbd (Kees) - null_blk fixes (Ming) - Get rid of congestion logic in pktcdvd (Neil) - Floppy ejection hang fix (Tasos) - Floppy max user request size fix (Xiongwei) - Loop locking fix (Tetsuo) * tag 'for-5.17/drivers-2022-01-11' of git://git.kernel.dk/linux-block: (32 commits) md: use default_groups in kobj_type md: Move alloc/free acct bioset in to personality lib/raid6: Use strict priority ranking for pq gen() benchmarking lib/raid6: skip benchmark of non-chosen xor_syndrome functions md: fix spelling of "its" md: raid456 add nowait support md: raid10 add nowait support md: raid1 add nowait support md: add support for REQ_NOWAIT md: drop queue limitation for RAID1 and RAID10 md/raid5: play nice with PREEMPT_RT block/rnbd-clt-sysfs: use default_groups in kobj_type pktcdvd: convert to use attribute groups block: null_blk: only set set->nr_maps as 3 if active poll_queues is > 0 nvme: add 'iopolicy' module parameter nvme: drop unused variable ctrl in nvme_setup_cmd nvme: increment request genctr on completion nvme-fabrics: print out valid arguments when reading from /dev/nvme-fabrics block: remove the rsxx driver rsxx: Drop PCI legacy power management ... commit d3c810803576d867265277df8e94eee386351c9d Merge: 42a7b4ed45e76 f029cedb9bb5b Author: Linus Torvalds Date: Wed Jan 12 10:26:52 2022 -0800 Merge tag 'for-5.17/block-2022-01-11' of git://git.kernel.dk/linux-block Pull block updates from Jens Axboe: - Unify where the struct request handling code is located in the blk-mq code (Christoph) - Header cleanups (Christoph) - Clean up the io_context handling code (Christoph, me) - Get rid of ->rq_disk in struct request (Christoph) - Error handling fix for add_disk() (Christoph) - request allocation cleanusp (Christoph) - Documentation updates (Eric, Matthew) - Remove trivial crypto unregister helper (Eric) - Reduce shared tag overhead (John) - Reduce poll_stats memory overhead (me) - Known indirect function call for dio (me) - Use atomic references for struct request (me) - Support request list issue for block and NVMe (me) - Improve queue dispatch pinning (Ming) - Improve the direct list issue code (Keith) - BFQ improvements (Jan) - Direct completion helper and use it in mmc block (Sebastian) - Use raw spinlock for the blktrace code (Wander) - fsync error handling fix (Ye) - Various fixes and cleanups (Lukas, Randy, Yang, Tetsuo, Ming, me) * tag 'for-5.17/block-2022-01-11' of git://git.kernel.dk/linux-block: (132 commits) MAINTAINERS: add entries for block layer documentation docs: block: remove queue-sysfs.rst docs: sysfs-block: document virt_boundary_mask docs: sysfs-block: document stable_writes docs: sysfs-block: fill in missing documentation from queue-sysfs.rst docs: sysfs-block: add contact for nomerges docs: sysfs-block: sort alphabetically docs: sysfs-block: move to stable directory block: don't protect submit_bio_checks by q_usage_counter block: fix old-style declaration nvme-pci: fix queue_rqs list splitting block: introduce rq_list_move block: introduce rq_list_for_each_safe macro block: move rq_list macros to blk-mq.h block: drop needless assignment in set_task_ioprio() block: remove unnecessary trailing '\' bio.h: fix kernel-doc warnings block: check minor range in device_add_disk() block: use "unsigned long" for blk_validate_block_size(). block: fix error unwinding in device_add_disk ... commit 42a7b4ed45e7667836fae4fb0e1ac6340588b1b0 Merge: 7e7b69654724c 3cc7fdb9f90a2 Author: Linus Torvalds Date: Wed Jan 12 10:20:35 2022 -0800 Merge tag 'for-5.17/io_uring-2022-01-11' of git://git.kernel.dk/linux-block Pull io_uring updates from Jens Axboe: - Support for prioritized work completions (Hao) - Simplification of reissue (Pavel) - Add support for CQE skip (Pavel) - Memory leak fix going to 5.15-stable (Pavel) - Re-write of internal poll. This both cleans up that code, and gets us ready to fix the POLLFREE issue (Pavel) - Various cleanups (GuoYong, Pavel, Hao) * tag 'for-5.17/io_uring-2022-01-11' of git://git.kernel.dk/linux-block: (31 commits) io_uring: fix not released cached task refs io_uring: remove redundant tab space io_uring: remove unused function parameter io_uring: use completion batching for poll rem/upd io_uring: single shot poll removal optimisation io_uring: poll rework io_uring: kill poll linking optimisation io_uring: move common poll bits io_uring: refactor poll update io_uring: remove double poll on poll update io_uring: code clean for some ctx usage io_uring: batch completion in prior_task_list io_uring: split io_req_complete_post() and add a helper io_uring: add helper for task work execution code io_uring: add a priority tw list for irq completion work io-wq: add helper to merge two wq_lists io_uring: reuse io_req_task_complete for timeouts io_uring: tweak iopoll CQE_SKIP event counting io_uring: simplify selected buf handling io_uring: move up io_put_kbuf() and io_put_rw_kbuf() ... commit e179f045f90d8947d3c2addebd620341b7daa4a1 Author: Yevhen Orlov Date: Tue Jan 11 03:11:29 2022 +0200 net: marvell: prestera: Fix deinit sequence for router * Add missed call prestera_router_fini in prestera_switch_fini * Add prestera_router_hw_fini, which verify lists are empty Fixes: 69204174cc5c ("net: marvell: prestera: Add prestera router infra") Signed-off-by: Yevhen Orlov Link: https://lore.kernel.org/r/20220111011129.5457-1-yevhen.orlov@plvision.eu Signed-off-by: Jakub Kicinski commit 32d098bb2e494cf282968ae654dadf7299bb73b0 Author: Yevhen Orlov Date: Tue Jan 11 03:10:51 2022 +0200 net: marvell: prestera: Refactor router functions * Reverse xmas tree variables order * User friendly messages on error paths * Refactor __prestera_inetaddr_event to use early return Signed-off-by: Yevhen Orlov Link: https://lore.kernel.org/r/20220111011051.4941-1-yevhen.orlov@plvision.eu Signed-off-by: Jakub Kicinski commit 6a1ba8758f67e37a48fd2f940032a2b186bcf021 Author: Yevhen Orlov Date: Tue Jan 11 03:10:14 2022 +0200 net: marvell: prestera: Refactor get/put VR functions * Use refcount, instead of uint * Increment/decrement recount inside get/put * Fix error path in __prestera_vr_create. Remove unnecessary kfree. * Make __prestera_vr_destroy symmetric to "create" Fixes: bca5859bc6c6 ("net: marvell: prestera: add hardware router objects accounting") Signed-off-by: Yevhen Orlov Link: https://lore.kernel.org/r/20220111011014.4418-1-yevhen.orlov@plvision.eu Signed-off-by: Jakub Kicinski commit 9c0c2c7aa23cbf78277557cfe8ec8bb7689225fe Author: Yevhen Orlov Date: Tue Jan 11 03:08:26 2022 +0200 net: marvell: prestera: Cleanup router struct Field "aborted" was added in 69204174cc5c ("net: marvell: prestera: Add prestera router infra"). It will not be used. So remove. Signed-off-by: Yevhen Orlov Link: https://lore.kernel.org/r/20220111010826.3779-1-yevhen.orlov@plvision.eu Signed-off-by: Jakub Kicinski commit 7e7b69654724c72bd3219b71f58937845dca0b2b Merge: daadb3bd0e8d3 f857acfc457ea Author: Linus Torvalds Date: Wed Jan 12 10:08:11 2022 -0800 Merge tag 'dma-mapping-5.17' of git://git.infradead.org/users/hch/dma-mapping Pull dma-mapping updates from Christoph Hellwig: - refactor the dma-direct coherent allocator - turn an macro into an inline in scatterlist.h (Logan Gunthorpe) * tag 'dma-mapping-5.17' of git://git.infradead.org/users/hch/dma-mapping: lib/scatterlist: cleanup macros into static inline functions dma-direct: add a dma_direct_use_pool helper dma-direct: factor the swiotlb code out of __dma_direct_alloc_pages dma-direct: drop two CONFIG_DMA_RESTRICTED_POOL conditionals dma-direct: warn if there is no pool for force unencrypted allocations dma-direct: fail allocations that can't be made coherent dma-direct: refactor the !coherent checks in dma_direct_alloc dma-direct: factor out a helper for DMA_ATTR_NO_KERNEL_MAPPING allocations dma-direct: clean up the remapping checks in dma_direct_alloc dma-direct: always leak memory that can't be re-encrypted dma-direct: don't call dma_set_decrypted for remapped allocations dma-direct: factor out dma_set_{de,en}crypted helpers commit c0dd94558d0e473aa92254e1c48a47900c911e69 Author: Ian Rogers Date: Thu Nov 25 23:13:05 2021 -0800 perf pmu-events: Don't lower case MetricExpr This patch changes MetricExpr to be written out in the same case. This enables events in metrics to use modifiers like 'G' which currently yield parse errors when made lower case. To keep tests passing the literal #smt_on is compared in a non-case sensitive way - #SMT_on is present in at least SkylakeX metrics. Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20211126071305.3733878-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit f56ef30a31d388663e78b9be687d67748c9b7297 Author: Ian Rogers Date: Tue Nov 23 16:12:28 2021 -0800 perf expr: Add debug logging for literals Useful for diagnosing problems with metrics. Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Konstantin Khlebnikov Cc: Mark Rutland Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20211124001231.3277836-1-irogers@google.com [ Fixed up perf_cpu conflict, i.e. we need to append ".cpu" to cpu__max_present_cpu() result ] Signed-off-by: Arnaldo Carvalho de Melo commit 4a9bca86806fa6fc4fbccf050c1bd36a4778948a Author: Darrick J. Wong Date: Fri Jan 7 17:45:51 2022 -0800 xfs: fix online fsck handling of v5 feature bits on secondary supers While I was auditing the code in xfs_repair that adds feature bits to existing V5 filesystems, I decided to have a look at how online fsck handles feature bits, and I found a few problems: 1) ATTR2 is added to the primary super when an xattr is set to a file, but that isn't consistently propagated to secondary supers. This isn't a corruption, merely a discrepancy that repair will fix if it ever has to restore the primary from a secondary. Hence, if we find a mismatch on a secondary, this is a preen condition, not a corruption. 2) There are more compat and ro_compat features now than there used to be, but we mask off the newer features from testing. This means we ignore inconsistencies in the INOBTCOUNT and BIGTIME features, which is wrong. Get rid of the masking and compare directly. 3) NEEDSREPAIR, when set on a secondary, is ignored by everyone. Hence a mismatch here should also be flagged for preening, and online repair should clear the flag. Right now we ignore it due to (2). 4) log_incompat features are ephemeral, since we can clear the feature bit as soon as the log no longer contains live records for a particular log feature. As such, the only copy we care about is the one in the primary super. If we find any bits set in the secondary super, we should flag that for preening, and clear the bits if the user elects to repair it. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit 6dd8646939a770e4ec0220c1c19d6af25c5877b7 Author: Ian Rogers Date: Tue Nov 23 16:12:31 2021 -0800 perf tools: Probe non-deprecated sysfs path 1st Following Documentation/ABI/stable/sysfs-devices-system-cpu the /sys/devices/system/cpu/cpuX/topology/core_cpus is deprecated in favor of thread_siblings, so probe thread_siblings before falling back on core_cpus. Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Konstantin Khlebnikov Cc: Mark Rutland Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Stephane Eranian Link: https://lore.kernel.org/r/20211124001231.3277836-4-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 0ce05781f4905fcfbbb489519e36be71c7b0bbcc Author: Ian Rogers Date: Tue Nov 23 16:12:30 2021 -0800 perf tools: Fix SMT fallback with large core counts strtoull can only read a 64-bit bitmap. On an AMD EPYC core_cpus may look like: 00000000,00000000,00000000,00000001,00000000,00000000,00000000,00000001 and so the sibling wasn't spotted. Fix by writing a simple hweight string parser. Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Konstantin Khlebnikov Cc: Mark Rutland Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Stephane Eranian Link: https://lore.kernel.org/r/20211124001231.3277836-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 6d18804b963b78dcd53851f11e9080408b3d85c2 Author: Ian Rogers Date: Tue Jan 4 22:13:51 2022 -0800 perf cpumap: Give CPUs their own type A common problem is confusing CPU map indices with the CPU, by wrapping the CPU with a struct then this is avoided. This approach is similar to atomic_t. Committer notes: To make it build with BUILD_BPF_SKEL=1 these files needed the conversions to 'struct perf_cpu' usage: tools/perf/util/bpf_counter.c tools/perf/util/bpf_counter_cgroup.c tools/perf/util/bpf_ftrace.c Also perf_env__get_cpu() was removed back in "perf cpumap: Switch cpu_map__build_map to cpu function". Additionally these needed to be fixed for the ARM builds to complete: tools/perf/arch/arm/util/cs-etm.c tools/perf/arch/arm64/util/pmu.c Suggested-by: John Garry Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-49-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit ce37ab3eb2490aba60ab1a622a4c6c6ee9a7cc66 Author: Ian Rogers Date: Tue Jan 4 22:13:50 2022 -0800 perf stat: Correct first_shadow_cpu to return index perf_stat__update_shadow_stats() and perf_stat__print_shadow_stats() use a cpu map index rather than a CPU, but first_shadow_cpu is returning the wrong value for this. Change first_shadow_cpu to first_shadow_cpu_map_idx to make things agree. Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-48-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit b57af1b4017abff969425dffd6f59ddfdedce8cb Author: Ian Rogers Date: Tue Jan 4 22:13:49 2022 -0800 perf script: Fix flipped index and cpu perf_counts are accessed by the densely packed index. Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-47-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 84d2f4f0375d4857f9f9e57a9ad75cbf0f34e108 Author: Ian Rogers Date: Tue Jan 4 22:13:48 2022 -0800 perf c2c: Use more intention revealing iterator Use perf_cpu_map__for_each_cpu() in setup_nodes. Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-46-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 7263f3498ba8b6e65c1d810ccafec64cd61a6dc1 Author: Ian Rogers Date: Tue Jan 4 22:13:47 2022 -0800 perf bpf: Rename 'cpu' to 'cpu_map_idx' Synchronize the caller in evsel with the called function. Shorten 3 lines of code in bperf_read by using perf_cpu_map__for_each_cpu(). This code is frequently using variables named cpu as cpu map indices, which doesn't matter as all CPUs are in the CPU map. It is strange in some cases the cpumap is used at all. Committer notes: Found when building with BUILD_BPF_SKEL=1: Remove unused 'num_cpu' variable in bperf__read(). Make 'j' an 'int' as it is used in perf_cpu_map__for_each_cpu() to compare against an 'int' Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-45-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 91802e73f77146d69afa0be7eafc983ec84b2bb0 Author: Ian Rogers Date: Tue Jan 4 22:13:46 2022 -0800 libperf: Sync evsel documentation cpu was renamed cpu_map_idx, for clarity. Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-44-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 5b1af93dbc7e64ab1b872129cfe1f2318cc29c67 Author: Ian Rogers Date: Tue Jan 4 22:13:45 2022 -0800 perf stat: Swap variable name cpu to index The use of CPU is error prone, switch to cpu_map_idx. Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-43-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 379c224bef724cf52bd3d2364d29fc63f3e743d3 Author: Ian Rogers Date: Tue Jan 4 22:13:44 2022 -0800 perf stat: Correct check_per_pkg() cpu Code was incorrectly using the cpu map index as the CPU. Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-42-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit aa11e55a39950c0151e12abd30c7223dfc6f6a2c Author: Ian Rogers Date: Tue Jan 4 22:13:43 2022 -0800 perf test: Use perf_cpu_map__for_each_cpu() Clean up variable naming to make cpu and index clearer. Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-41-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 6f844b1fdd3bc3a25995ff83edea32a73bfa72d9 Author: Ian Rogers Date: Tue Jan 4 22:13:42 2022 -0800 perf evsel: Rename variable cpu to index Make naming less error prone. Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-40-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 1fa497d4c01d497e25131ccdd5def6f24dd1f330 Author: Ian Rogers Date: Tue Jan 4 22:13:41 2022 -0800 perf evsel: Reduce scope of evsel__ignore_missing_thread Move to being static. Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-39-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 2daa08c4d9cd9d0845094d718920e5d105c11558 Author: Ian Rogers Date: Tue Jan 4 22:13:40 2022 -0800 perf evsel: Rename CPU around get_group_fd CPU is really a cpu map index, change names to make code more intention revealing. Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-38-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit da8c94c065174099853a207d9716a49d339b265f Author: Ian Rogers Date: Tue Jan 4 22:13:39 2022 -0800 perf stat: Correct variable name for read counter Switch from cpu to cpu_map_idx to reduce confusion. Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-37-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 7ac0089d138f80dcd7ba8ca368a9b2bdfe780b16 Author: Ian Rogers Date: Tue Jan 4 22:13:38 2022 -0800 perf evsel: Pass cpu not cpu map index to synthesize evsel__write_stat_event() was incorrectly passing a cpu map index rather than a CPU to perf_event__synthesize_stat(). Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-36-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 472832d2c000b9611feaea66fe521055c3dbf17a Author: Ian Rogers Date: Tue Jan 4 22:13:37 2022 -0800 perf evlist: Refactor evlist__for_each_cpu() Previously evlist__for_each_cpu() needed to iterate over the evlist in an inner loop and call "skip" routines. Refactor this so that the iteratr is smarter and the next function can update both the current CPU and evsel. By using a cpu map index, fix apparent off-by-1 in __run_perf_stat's call to perf_evsel__close_cpu(). Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-35-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 80b82f3b65e94ba22d3f12a98f7ecc56cc14c903 Author: Ian Rogers Date: Tue Jan 4 22:13:36 2022 -0800 libperf: Allow NULL in perf_cpu_map__idx() Return -1, not found, if NULL is passed. Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-34-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit f9551b3f6249cfe8ea5b5f8716675ccf2f6ec737 Author: Ian Rogers Date: Tue Jan 4 22:13:35 2022 -0800 perf script: Use for each cpu to aid readability Use perf_cpu_map__for_each_cpu() to help with readability. Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-33-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 7ea82fbee4598e51e8bf47566b252cd5745d5b17 Author: Ian Rogers Date: Tue Jan 4 22:13:34 2022 -0800 perf stat: Use perf_cpu_map__for_each_cpu() Correct in print_counter() where an index was being used as a cpu. Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-32-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit ab90caa7b2d0b708cfee16b33325ca24de4d8f25 Author: Ian Rogers Date: Tue Jan 4 22:13:33 2022 -0800 perf stat: Rename aggr_data cpu to imply it's an index Trying to make cpu maps less error prone. Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-31-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 7316268ff740c29dfb52649ff8074a5aa17ec0ce Author: Ian Rogers Date: Tue Jan 4 22:13:32 2022 -0800 perf counts: Switch name cpu to cpu_map_idx Try to reduce confusion in particular when the cpu map doesn't contain an entry for every CPU. Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-30-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 47ffe806674f67e729627edd689b10827b1790eb Author: Ian Rogers Date: Tue Jan 4 22:13:31 2022 -0800 libperf: Use cpu not index for evsel mmap Fix issue where evsel's CPU map index was being used as the mmap cpu. Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-29-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 7e3d1784c8a4d9c643a6ed0a2c44ee94dee8f7a6 Author: Ian Rogers Date: Tue Jan 4 22:13:30 2022 -0800 libperf: Switch cpu to more accurate cpu_map_idx Modify variable names and adopt perf_cpu_map__for_each_cpu() in perf_evsel__open(). Renaming is done by looking for consistency in API usage. Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-28-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 2ca0a3718da24953689b1771589ac63b60f17358 Author: Ian Rogers Date: Tue Jan 4 22:13:29 2022 -0800 perf evsel: Derive CPUs and threads in alloc_counts Passing the number of CPUs and threads allows for an evsel's counts to be mismatched to its cpu map. To avoid this always derive the counts size from the cpu map. Change openat-syscall-all-cpus to set the cpus to allow for this to work. Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-27-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 7365f105e37429d28757f7f68d4850723ce18aa1 Author: Ian Rogers Date: Tue Jan 4 22:13:28 2022 -0800 perf stat-display: Avoid use of core for CPU Correct use of cpumap index in print_no_aggr_metric(). Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-26-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 34794913e2dc08a464499f795073a021feeb3b47 Author: Ian Rogers Date: Tue Jan 4 22:13:27 2022 -0800 perf cpumap: Add CPU to aggr_cpu_id With no aggregration, such as 'perf stat -A', the aggr_cpu_id lacks a way to describe per CPU aggregation and the core is set to the CPU in places like print_counter_aggrdata in stat-display.c. Setting the core to the CPU is undesirable as the CPU will exceed valid core values and lead to confusion. Add a CPU variable to address this. Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-25-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit f9e891ea172235f902972069b87be3bdc7c48f5a Author: Ian Rogers Date: Tue Jan 4 22:13:26 2022 -0800 perf stat: Fix memory leak in check_per_pkg() If the key is already present then free the key used for lookup. Found with: $ perf stat -M IO_Read_BW /bin/true ==1749112==ERROR: LeakSanitizer: detected memory leaks Direct leak of 32 byte(s) in 4 object(s) allocated from: #0 0x7f6f6fa7d7cf in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145 #1 0x55acecd9d7a6 in check_per_pkg util/stat.c:343 #2 0x55acecd9d9c5 in process_counter_values util/stat.c:365 #3 0x55acecd9e0ab in process_counter_maps util/stat.c:421 #4 0x55acecd9e292 in perf_stat_process_counter util/stat.c:443 #5 0x55aceca8553e in read_counters ./tools/perf/builtin-stat.c:470 #6 0x55aceca88fe3 in __run_perf_stat ./tools/perf/builtin-stat.c:1023 #7 0x55aceca89146 in run_perf_stat ./tools/perf/builtin-stat.c:1048 #8 0x55aceca90858 in cmd_stat ./tools/perf/builtin-stat.c:2555 #9 0x55acecc05fa5 in run_builtin ./tools/perf/perf.c:313 #10 0x55acecc064fe in handle_internal_command ./tools/perf/perf.c:365 #11 0x55acecc068bb in run_argv ./tools/perf/perf.c:409 #12 0x55acecc070aa in main ./tools/perf/perf.c:539 Reviewed-by: James Clark Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-24-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit bd26bddfd93688d10984251249b84e1f6d91de27 Author: Ian Rogers Date: Tue Jan 4 22:13:25 2022 -0800 perf cpumap: Trim the cpu_aggr_map cpu_aggr_map__new() removes duplicates, when this happens shrink the array. Reviewed-by: James Clark Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-23-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 92aad5c33f531187cc6013c8e51620212cdfefe1 Author: Ian Rogers Date: Tue Jan 4 22:13:24 2022 -0800 perf cpumap: Add some comments to cpu_aggr_map Move cpu_aggr_map__empty_new() to be with other cpu_aggr_map function. Reviewed-by: James Clark Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-22-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit dfc66beff7fa95b9eb507ccb48fb325569bc2f74 Author: Ian Rogers Date: Tue Jan 4 22:13:23 2022 -0800 perf cpumap: Move 'has' function to libperf Make the cpu map argument const for consistency with the rest of the API. Modify cpu_map__idx accordingly. Reviewed-by: James Clark Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-21-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 973aeb3c7ada35b75442126c745bb6074cb3e172 Author: Ian Rogers Date: Tue Jan 4 22:13:22 2022 -0800 perf cpumap: Rename cpu_map__get_X_aggr_by_cpu functions The functions don't use a cpu_map so reduce them to being like constructors of aggr_cpu_id. Reviewed-by: James Clark Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-20-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 5f50e15c1510c77b37e10c6b22912bf4bf11476b Author: Ian Rogers Date: Tue Jan 4 22:13:21 2022 -0800 perf cpumap: Refactor cpu_map__build_map() Turn it into a cpu_aggr_map__new(). Pass helper functions. Refactor builtin-stat calls to manually pass function pointers. Try to reduce some copy-paste code. Reviewed-by: James Clark Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-19-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit adff2c634357115a0f94a9a5054061b497df7f72 Author: Ian Rogers Date: Tue Jan 4 22:13:20 2022 -0800 perf cpumap: Remove cpu_map__cpu(), use libperf function Switch the remaining few users of cpu_map__cpu() to perf_cpu_map__cpu() and remove the function. Reviewed-by: James Clark Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-18-irogers@google.com [ Did the conversion to perf_ftrace__latency_prepare_bpf() as well, used when building with BUILD_BPF_SKEL=1 ] Signed-off-by: Arnaldo Carvalho de Melo commit 4e90e5cc74c6b1c1b9abff8b53cec5be1fb5e839 Author: Ian Rogers Date: Tue Jan 4 22:13:19 2022 -0800 perf cpumap: Remove map from function names that don't use a map Move to the cpu name and document for consistency. Reviewed-by: James Clark Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-17-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 194a3a202564153493789997643181737a6ae4b9 Author: Ian Rogers Date: Tue Jan 4 22:13:18 2022 -0800 perf cpumap: Document cpu__get_node() and remove redundant function cpu_map__get_node_id() isn't used externally and merely delegates to cpu__get_node(). Reviewed-by: James Clark Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-16-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 51b826fadf4fc42c8614b752b6cb0cb516589ade Author: Ian Rogers Date: Tue Jan 4 22:13:17 2022 -0800 perf cpumap: Rename empty functions Remove cpu_map from name as a cpu_map isn't used. Pass a const pointer rather than by value to avoid unnecessary copying. Reviewed-by: James Clark Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-15-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 3ac23d199c2bc3bc2a2b31c803e7c5d841959670 Author: Ian Rogers Date: Tue Jan 4 22:13:16 2022 -0800 perf cpumap: Simplify equal function name Rename cpu_map__compare_aggr_cpu_id() to aggr_cpu_id__equal(), the cpu_map part of the name is misleading. Equal better describes the function than compare. Switch to const pointer rather than value as struct given the number of variables in aggr_cpu_id(). Reviewed-by: James Clark Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-14-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 63e0fa873d8820b996a01a83d832bf1b3969e9b6 Author: Ian Rogers Date: Tue Jan 4 22:13:15 2022 -0800 perf cpumap: Remove unused cpu_map__socket() Unused function so remove. Reviewed-by: James Clark Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-13-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 49679da388f4c45b0ca444dcf8bb5f59a02f8f4e Author: Ian Rogers Date: Tue Jan 4 22:13:14 2022 -0800 perf cpumap: Add comments to aggr_cpu_id() This code is already tested in topology.c. Reviewed-by: James Clark Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-12-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 86d94048e234c94af88a528ab4d5ef16e8a89f8a Author: Ian Rogers Date: Tue Jan 4 22:13:13 2022 -0800 perf cpumap: Remove map+index get_node() Migrate final users to appropriate cpu variant. Reviewed-by: James Clark Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-11-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 3f6233dc7798044637426ae1099d88aa375c467f Author: Ian Rogers Date: Tue Jan 4 22:13:12 2022 -0800 perf cpumap: Remove map+index get_core() Migrate final users to appropriate cpu variant. Reviewed-by: James Clark Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-10-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 1cdae3d6734779a637bc4e6ec24e7f615b4e71be Author: Ian Rogers Date: Tue Jan 4 22:13:11 2022 -0800 perf cpumap: Remove map+index get_die() Migrate final users to appropriate cpu variant. Reviewed-by: James Clark Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-9-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 448a69d9f34d02920cffba741ca0a2e34a5bb316 Author: Ian Rogers Date: Tue Jan 4 22:13:10 2022 -0800 perf cpumap: Remove map+index get_socket() Migrate final users to appropriate cpu variant. Reviewed-by: James Clark Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-8-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit eff54c24bb147afc0a1423b49bfa1b8eaa85a88f Author: Ian Rogers Date: Tue Jan 4 22:13:09 2022 -0800 perf cpumap: Switch cpu_map__build_map() to cpu function Avoid error prone cpu_map + idx variant. Remove now unused functions. Committer notes: Remove by now unused perf_env__get_cpu(). Reviewed-by: James Clark Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-7-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 88031a0de7d68d132014154b9e5307428e8ed70d Author: Ian Rogers Date: Tue Jan 4 22:13:08 2022 -0800 perf stat: Switch to cpu version of cpu_map__get() Avoid possible bugs where the wrong index is passed with the cpu_map. Reviewed-by: James Clark Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-6-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit a023283fadef8a3f6916ba2b0c37955d76ffaf4d Author: Ian Rogers Date: Tue Jan 4 22:13:07 2022 -0800 perf stat: Switch aggregation to use for_each loop Tidy up the use of cpu and index to hopefully make the code less error prone. Avoid unused warnings with (void) which will be removed in a later patch. Reviewed-by: James Clark Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-5-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 01843ca0197783d0951a1948ebeaaed9a47ce55d Author: Ian Rogers Date: Tue Jan 4 22:13:06 2022 -0800 perf stat: Correct aggregation CPU map Switch the perf_cpu_map in aggr_update_shadow from the evlist to the counter's cpu map, so the index is appropriate. This addresses a problem where uncore counts, with a cpumap like: $ cat /sys/devices/uncore_imc_0/cpumask 0,18 Don't aggregate counts in CPUs based on the index of those values in the cpumap (0 and 1) but on the actual CPU (0 and 18). Thereby correcting metric calculations in per-socket mode for counters without a full cpumask. On a SkylakeX with a tweaked DRAM_BW_Use metric, to remove unnecessary scaling, this gives: Before: $ /perf stat --per-socket -M DRAM_BW_Use -I 1000 1.001102293 S0 1 27.01 MiB uncore_imc/cas_count_write/ # 103.00 DRAM_BW_Use 1.001102293 S0 1 30.22 MiB uncore_imc/cas_count_read/ 1.001102293 S0 1 1,001,102,293 ns duration_time 1.001102293 S1 1 20.10 MiB uncore_imc/cas_count_write/ # 0.00 DRAM_BW_Use 1.001102293 S1 1 32.74 MiB uncore_imc/cas_count_read/ 1.001102293 S1 0 ns duration_time 2.003517973 S0 1 83.04 MiB uncore_imc/cas_count_write/ # 920.00 DRAM_BW_Use 2.003517973 S0 1 145.95 MiB uncore_imc/cas_count_read/ 2.003517973 S0 1 1,002,415,680 ns duration_time 2.003517973 S1 1 302.45 MiB uncore_imc/cas_count_write/ # 0.00 DRAM_BW_Use 2.003517973 S1 1 290.99 MiB uncore_imc/cas_count_read/ 2.003517973 S1 0 ns duration_time After: $ perf stat --per-socket -M DRAM_BW_Use -I 1000 1.001080840 S0 1 24.96 MiB uncore_imc/cas_count_write/ # 54.00 DRAM_BW_Use 1.001080840 S0 1 33.64 MiB uncore_imc/cas_count_read/ 1.001080840 S0 1 1,001,080,840 ns duration_time 1.001080840 S1 1 42.43 MiB uncore_imc/cas_count_write/ # 84.00 DRAM_BW_Use 1.001080840 S1 1 47.05 MiB uncore_imc/cas_count_read/ 1.001080840 S1 0 ns duration_time Signed-off-by: Ian Rogers Tested-by: John Garry Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-4-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit ca2c9b76bc3c75ac116ef199b75e7ca4e27e7acb Author: Ian Rogers Date: Tue Jan 4 22:13:05 2022 -0800 perf stat: Add aggr creators that are passed a cpu The cpu_map and index can get confused. Add variants of the cpu_map__get routines that are passed a cpu. Make the existing cpu_map__get routines use the new functions with a view to remove them when no longer used. Reviewed-by: James Clark Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 818ab78c03aad94fabc18d386e9c73b539a1f447 Author: Ian Rogers Date: Tue Jan 4 22:13:04 2022 -0800 libperf: Add comments to 'struct perf_cpu_map' A particular observed problem is confusing the index with the CPU value, documentation should hopefully reduce this type of problem. Reviewed-by: James Clark Reviewed-by: John Garry Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kajol Jain Cc: Kan Liang Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Mike Leach Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Suzuki Poulouse Cc: Vineet Singh Cc: coresight@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: zhengjun.xing@intel.com Link: https://lore.kernel.org/r/20220105061351.120843-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit dcffc5ebb80dd5887b91091b8ecd082c9ed75361 Author: Ian Rogers Date: Thu Dec 23 10:39:48 2021 -0800 perf evsel: Improve error message for uncore events When a group has multiple events and the leader fails it can yield errors like: $ perf stat -e '{uncore_imc/cas_count_read/},instructions' /bin/true Error: The sys_perf_event_open() syscall returned with 22 (Invalid argument) for event (uncore_imc/cas_count_read/). /bin/dmesg | grep -i perf may provide additional information. However, when not the group leader is given: $ perf stat -e '{instructions,uncore_imc/cas_count_read/}' /bin/true ... 1,619,057 instructions MiB uncore_imc/cas_count_read/ This is necessary because get_group_fd will fail if the leader fails and is the direct result of the check on line 750 of builtin-stat.c in stat_handle_error that returns COUNTER_SKIP for the latter case. This patch improves the error message to: $ perf stat -e '{uncore_imc/cas_count_read/},instructions' /bin/true Error: Invalid event (uncore_imc/cas_count_read/) in per-thread mode, enable system wide with '-a'. v2. Changed the test to use !target__has_cpu as suggested by Namhyung Kim. Signed-off-by: Ian Rogers Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: https://lore.kernel.org/r/20211223183948.3423989-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit b4bb6f05e4b25e66825956006c3d5cbe5b73eaec Author: Arnaldo Carvalho de Melo Date: Wed Jan 12 14:21:45 2022 -0300 Revert "perf powerpc: Add data source encodings for power10 platform" This was in a patchkit mixing up kernel with tools/ parts and I mistakenly got it merged in the perf tools tree, revert it, it'll go via the PowerPC kernel tree. This reverts commit af2b24f228a0373ac65eb7a502e0bc31e2c0269d. Cc: kajoljain Cc: Michael Ellerman Cc: Stephen Rothwell Link: http://lore.kernel.org/lkml/20220112171659.531d22ce@canb.auug.org.au Signed-off-by: Arnaldo Carvalho de Melo commit 8de78328f041f10a2b546fdb3791a87ba6b742e6 Author: Arnaldo Carvalho de Melo Date: Wed Jan 12 14:19:21 2022 -0300 Revert "perf powerpc: Add encodings to represent data based on newer composite PERF_MEM_LVLNUM* fields" This was in a patchkit mixing up kernel with tools/ parts and I mistakenly got it merged in the perf tools tree, revert it, it'll go via the PowerPC kernel tree. This reverts commit 0ebce3d65f1f53c936fdd51e975bd876ba7ed64f. Cc: kajoljain Cc: Michael Ellerman Cc: Stephen Rothwell Link: http://lore.kernel.org/lkml/20220112171659.531d22ce@canb.auug.org.au Signed-off-by: Arnaldo Carvalho de Melo commit 62942e9fda9fd1def10ffcbd5e1c025b3c9eec17 Author: Adrian Hunter Date: Wed Jan 12 10:50:57 2022 +0200 perf script: Fix hex dump character output Using grep -C with perf script -D can give erroneous results as grep loses lines due to non-printable characters, for example, below the 0020, 0060 and 0070 lines are missing: $ perf script -D | grep -C10 AUX | head . 0010: 08 00 00 00 00 00 00 00 1f 00 00 00 00 00 00 00 ................ . 0030: 01 00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 ................ . 0040: 00 08 00 00 00 00 00 00 02 00 00 00 00 00 00 00 ................ . 0050: 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 ................ . 0080: 02 00 00 00 00 00 00 00 1b 00 00 00 00 00 00 00 ................ . 0090: 00 00 00 00 00 00 00 00 ........ 0 0 0x450 [0x98]: PERF_RECORD_AUXTRACE_INFO type: 1 PMU Type 8 Time Shift 31 perf's isprint() is a custom implementation from the kernel, but the kernel's _ctype appears to include characters from Latin-1 Supplement which is not compatible with, for example, UTF-8. Fix by checking also isascii(). After: $ tools/perf/perf script -D | grep -C10 AUX | head . 0010: 08 00 00 00 00 00 00 00 1f 00 00 00 00 00 00 00 ................ . 0020: 03 84 32 2f 00 00 00 00 63 7c 4f d2 fa ff ff ff ..2/....c|O..... . 0030: 01 00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 ................ . 0040: 00 08 00 00 00 00 00 00 02 00 00 00 00 00 00 00 ................ . 0050: 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 ................ . 0060: 00 02 00 00 00 00 00 00 00 c0 03 00 00 00 00 00 ................ . 0070: e2 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 ................ . 0080: 02 00 00 00 00 00 00 00 1b 00 00 00 00 00 00 00 ................ . 0090: 00 00 00 00 00 00 00 00 ........ Fixes: 3052ba56bcb58904 ("tools perf: Move from sane_ctype.h obtained from git to the Linux's original") Signed-off-by: Adrian Hunter Cc: Jiri Olsa Link: http://lore.kernel.org/lkml/20220112085057.277205-1-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo commit 2716a5271d54e401856113ef7bdec1e06260f1dd Merge: 4e5bd03ae3465 72f1f7e46c6e9 Author: Jakub Kicinski Date: Wed Jan 12 09:05:06 2022 -0800 Merge branch 'arm-ox810se-add-ethernet-support' Neil Armstrong says: ==================== ARM: ox810se: Add Ethernet support This adds support for the Synopsys DWMAC controller found in the OX820SE SoC, by using almost the same glue code as the OX820. ==================== Link: https://lore.kernel.org/r/20220104145646.135877-1-narmstrong@baylibre.com Signed-off-by: Jakub Kicinski commit 72f1f7e46c6e96b2ae300d750de01ac75d625b4e Author: Neil Armstrong Date: Tue Jan 4 15:56:45 2022 +0100 net: stmmac: dwmac-oxnas: Add support for OX810SE Add support for OX810SE dwmac glue setup, which is a simplified version of the OX820 introduced later with more control on the PHY interface. Signed-off-by: Neil Armstrong Signed-off-by: Jakub Kicinski commit 8973d7b8638f1c2615eec495dfe70122a01a9e1b Author: Neil Armstrong Date: Tue Jan 4 15:56:44 2022 +0100 dt-bindings: net: oxnas-dwmac: Add bindings for OX810SE Add SoC specific bindings for OX810SE support. Signed-off-by: Neil Armstrong Acked-by: Rob Herring Signed-off-by: Jakub Kicinski commit e623611b4d3f722b57ceeaf4368ac787837408e7 Merge: 785576c9356fb b398123bff3bc Author: Rob Herring Date: Wed Jan 12 10:14:09 2022 -0600 Merge branch 'dt/linus' into dt/next Pick a fix which didn't make it into v5.16. commit 785576c9356fb249e2715fe25f47c773385574ce Author: Rob Herring Date: Tue Jan 11 11:02:47 2022 -0600 dt-bindings: net: mdio: Drop resets/reset-names child properties resets/reset-names are device specific and don't belong in the MDIO bus schema. For example, it doesn't match what is defined for the "qca,ar9331-switch" binding which defines "reset-names" to be "switch" rather than "phy". Neither name is that useful IMO. Other child properties are also device specific, but those won't conflict with device schemas. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220111170248.3160841-1-robh@kernel.org commit 9cdbeec4096804083944d05da96bbaf59a1eb4f9 Author: Peter Zijlstra Date: Tue Jan 11 12:11:14 2022 +0100 x86/entry_32: Fix segment exceptions The LKP robot reported that commit in Fixes: caused a failure. Turns out the ldt_gdt_32 selftest turns into an infinite loop trying to clear the segment. As discovered by Sean, what happens is that PARANOID_EXIT_TO_KERNEL_MODE in the handle_exception_return path overwrites the entry stack data with the task stack data, restoring the "bad" segment value. Instead of having the exception retry the instruction, have it emulate the full instruction. Replace EX_TYPE_POP_ZERO with EX_TYPE_POP_REG which will do the equivalent of: POP %reg; MOV $imm, %reg. In order to encode the segment registers, add them as registers 8-11 for 32-bit. By setting regs->[defg]s the (nested) RESTORE_REGS will pop this value at the end of the exception handler and by increasing regs->sp, it will have skipped the stack slot. This was debugged by Sean Christopherson . [ bp: Add EX_REG_GS too. ] Fixes: aa93e2ad7464 ("x86/entry_32: Remove .fixup usage") Reported-by: kernel test robot Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/Yd1l0gInc4zRcnt/@hirez.programming.kicks-ass.net commit c96f195deeefecd8ef95c5aa508671dd246bf119 Author: Rafael J. Wysocki Date: Tue Jan 11 17:53:29 2022 +0100 ACPI: scan: Rename label in acpi_scan_init() Rename the "out" label in acpi_scan_init() to "unlock", which is a better match for its purpose, and fix up its alignment. No functional impact. Signed-off-by: Rafael J. Wysocki Reviewed-by: Mika Westerberg Reviewed-by: Hans de Goede commit 681e7187aef46f8d4e0fd0ddd2f888e3e5533cb2 Author: Rafael J. Wysocki Date: Tue Jan 11 17:52:00 2022 +0100 ACPI: scan: Simplify initialization of power and sleep buttons It should be perfectly fine to use ACPI if the "fixed" power or sleep buttons cannot be initialized. Moreover, running acpi_bus_scan() successfully on ACPI_ROOT_OBJECT generally causes many devices to be enumerated and probed, possibly including the entire PCI bus, so unregistering acpi_root if the registration of the "fixed" buttons fails is rather unhelpful. For this reason, do not fail acpi_scan_init() when acpi_bus_scan_fixed() fails and turn the latter into a void function. While at it, drop the outdated and misleading comment from acpi_bus_scan_fixed(). Signed-off-by: Rafael J. Wysocki Reviewed-by: Mika Westerberg Reviewed-by: Hans de Goede commit b6c55b162bcee62c43c18e59f38a4590be543032 Author: Rafael J. Wysocki Date: Tue Jan 11 17:50:22 2022 +0100 ACPI: scan: Change acpi_scan_init() return value type to void The only caller of acpi_scan_init(), acpi_init(), doesn't check its return value, so turn it into a void function. This avoids complaints from the Smatch static checker that the function should return a negative error code when it fails, which is not really a problem in this particular case. No intentional functional impact. Link: https://lore.kernel.org/linux-acpi/20220106082317.GA9123@kili/ Signed-off-by: Rafael J. Wysocki Reviewed-by: Mika Westerberg Reviewed-by: Hans de Goede commit 4e5bd03ae34652cd932ab4c91c71c511793df75c Author: Jie Wang Date: Wed Jan 12 20:54:18 2022 +0800 net: bonding: fix bond_xmit_broadcast return value error bug In Linux bonding scenario, one packet is copied to several copies and sent by all slave device of bond0 in mode 3(broadcast mode). The mode 3 xmit function bond_xmit_broadcast() only ueses the last slave device's tx result as the final result. In this case, if the last slave device is down, then it always return NET_XMIT_DROP, even though the other slave devices xmit success. It may cause the tx statistics error, and cause the application (e.g. scp) consider the network is unreachable. For example, use the following command to configure server A. echo 3 > /sys/class/net/bond0/bonding/mode ifconfig bond0 up ifenslave bond0 eth0 eth1 ifconfig bond0 192.168.1.125 ifconfig eth0 up ifconfig eth1 down The slave device eth0 and eth1 are connected to server B(192.168.1.107). Run the ping 192.168.1.107 -c 3 -i 0.2 command, the following information is displayed. PING 192.168.1.107 (192.168.1.107) 56(84) bytes of data. 64 bytes from 192.168.1.107: icmp_seq=1 ttl=64 time=0.077 ms 64 bytes from 192.168.1.107: icmp_seq=2 ttl=64 time=0.056 ms 64 bytes from 192.168.1.107: icmp_seq=3 ttl=64 time=0.051 ms 192.168.1.107 ping statistics 0 packets transmitted, 3 received Actually, the slave device eth0 of the bond successfully sends three ICMP packets, but the result shows that 0 packets are transmitted. Also if we use scp command to get remote files, the command end with the following printings. ssh_exchange_identification: read: Connection timed out So this patch modifies the bond_xmit_broadcast to return NET_XMIT_SUCCESS if one slave device in the bond sends packets successfully. If all slave devices send packets fail, the discarded packets stats is increased. The skb is released when there is no slave device in the bond or the last slave device is down. Fixes: ae46f184bc1f ("bonding: propagate transmit status") Signed-off-by: Jie Wang Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 7b9b1d449a7cef675d6926c4538edee8e601d823 Author: Eric Dumazet Date: Wed Jan 12 04:59:39 2022 -0800 net/smc: fix possible NULL deref in smc_pnet_add_eth() I missed that @ndev value can be NULL. I prefer not factorizing this NULL check, and instead clearly document where a NULL might be expected. general protection fault, probably for non-canonical address 0xdffffc00000000ba: 0000 [#1] PREEMPT SMP KASAN KASAN: null-ptr-deref in range [0x00000000000005d0-0x00000000000005d7] CPU: 0 PID: 19875 Comm: syz-executor.2 Not tainted 5.16.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:__lock_acquire+0xd7a/0x5470 kernel/locking/lockdep.c:4897 Code: 14 0e 41 bf 01 00 00 00 0f 86 c8 00 00 00 89 05 5c 20 14 0e e9 bd 00 00 00 48 b8 00 00 00 00 00 fc ff df 4c 89 f2 48 c1 ea 03 <80> 3c 02 00 0f 85 9f 2e 00 00 49 81 3e 20 c5 1a 8f 0f 84 52 f3 ff RSP: 0018:ffffc900057071d0 EFLAGS: 00010002 RAX: dffffc0000000000 RBX: 1ffff92000ae0e65 RCX: 1ffff92000ae0e4c RDX: 00000000000000ba RSI: 0000000000000000 RDI: 0000000000000001 RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000001 R10: fffffbfff1b24ae2 R11: 000000000008808a R12: 0000000000000000 R13: ffff888040ca4000 R14: 00000000000005d0 R15: 0000000000000000 FS: 00007fbd683e0700(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000001b2be22000 CR3: 0000000013fea000 CR4: 00000000003526f0 Call Trace: lock_acquire kernel/locking/lockdep.c:5637 [inline] lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5602 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:110 [inline] _raw_spin_lock_irqsave+0x39/0x50 kernel/locking/spinlock.c:162 ref_tracker_alloc+0x182/0x440 lib/ref_tracker.c:84 netdev_tracker_alloc include/linux/netdevice.h:3859 [inline] smc_pnet_add_eth net/smc/smc_pnet.c:372 [inline] smc_pnet_enter net/smc/smc_pnet.c:492 [inline] smc_pnet_add+0x49a/0x14d0 net/smc/smc_pnet.c:555 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:2494 genl_rcv+0x24/0x40 net/netlink/genetlink.c:803 netlink_unicast_kernel net/netlink/af_netlink.c:1317 [inline] netlink_unicast+0x539/0x7e0 net/netlink/af_netlink.c:1343 netlink_sendmsg+0x904/0xe00 net/netlink/af_netlink.c:1919 sock_sendmsg_nosec net/socket.c:705 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:725 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2413 ___sys_sendmsg+0xf3/0x170 net/socket.c:2467 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2496 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: b60645248af3 ("net/smc: add net device tracker to struct smc_pnetentry") Signed-off-by: Eric Dumazet Reported-by: syzbot Signed-off-by: David S. Miller commit fcfb894d5952786db3b2b2b9cd3a95cdcedb6ff0 Author: Eric Dumazet Date: Wed Jan 12 04:53:00 2022 -0800 net: bridge: fix net device refcount tracking issue in error path I left one dev_put() in br_add_if() error path and sure enough syzbot found its way. As the tracker is allocated in new_nbp(), we must make sure to properly free it. We have to call dev_put_track(dev, &p->dev_tracker) before @p object is freed, of course. This is not an issue because br_add_if() owns a reference on @dev. Fixes: b2dcdc7f731d ("net: bridge: add net device refcount tracker") Signed-off-by: Eric Dumazet Reported-by: syzbot Signed-off-by: David S. Miller commit 0bbed88af55ed804d19aeb23b32b72b29e1435ee Merge: c12837d1bb310 998c0bd2b3715 Author: David S. Miller Date: Wed Jan 12 14:39:54 2022 +0000 Merge branch 'ipa-fixes' Alex Elder says: ==================== net: ipa: fix two replenish bugs This series contains two fixes for bugs in the IPA receive buffer replenishing code. The (new) second patch defines a bitmap to represent endpoint the replenish enabled flag. Its purpose is to prepare for the third patch, which adds an additional flag. Version 2 of this series uses bitmap operations in the second bug fix rather than an atomic variable, as suggested by Jakub. ==================== Signed-off-by: David S. Miller commit 998c0bd2b3715244da7639cc4e6a2062cb79c3f4 Author: Alex Elder Date: Wed Jan 12 07:30:12 2022 -0600 net: ipa: prevent concurrent replenish We have seen cases where an endpoint RX completion interrupt arrives while replenishing for the endpoint is underway. This causes another instance of replenishing to begin as part of completing the receive transaction. If this occurs it can lead to transaction corruption. Use a new flag to ensure only one replenish instance for an endpoint executes at a time. Fixes: 84f9bd12d46db ("soc: qcom: ipa: IPA endpoints") Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit c1aaa01dbf4cef95af3e04a5a43986c290e06ea3 Author: Alex Elder Date: Wed Jan 12 07:30:11 2022 -0600 net: ipa: use a bitmap for endpoint replenish_enabled Define a new replenish_flags bitmap to contain Boolean flags associated with an endpoint's replenishing state. Replace the replenish_enabled field with a flag in that bitmap. This is to prepare for the next patch, which adds another flag. Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit 6c0e3b5ce94947b311348c367db9e11dcb2ccc93 Author: Alex Elder Date: Wed Jan 12 07:30:10 2022 -0600 net: ipa: fix atomic update in ipa_endpoint_replenish() In ipa_endpoint_replenish(), if an error occurs when attempting to replenish a receive buffer, we just quit and try again later. In that case we increment the backlog count to reflect that the attempt was unsuccessful. Then, if the add_one flag was true we increment the backlog again. This second increment is not included in the backlog local variable though, and its value determines whether delayed work should be scheduled. This is a bug. Fix this by determining whether 1 or 2 should be added to the backlog before adding it in a atomic_add_return() call. Reviewed-by: Matthias Kaehlcke Fixes: 84f9bd12d46db ("soc: qcom: ipa: IPA endpoints") Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit c12837d1bb31032bead9060dec99ef310d5b9fb7 Author: Eric Dumazet Date: Wed Jan 12 03:14:45 2022 -0800 ref_tracker: use __GFP_NOFAIL more carefully syzbot was able to trigger this warning from new_slab() /* * All existing users of the __GFP_NOFAIL are blockable, so warn * of any new users that actually require GFP_NOWAIT */ if (WARN_ON_ONCE(!can_direct_reclaim)) goto fail; Indeed, we should use __GFP_NOFAIL if direct reclaim is possible. Hopefully in the future we will be able to use SLAB_NOFAILSLAB option so that syzbot can benefit from full ref_tracker even in the presence of memory fault injections. WARNING: CPU: 0 PID: 13 at mm/page_alloc.c:5081 __alloc_pages_slowpath.constprop.0+0x1b7b/0x20d0 mm/page_alloc.c:5081 mm/page_alloc.c:5081 Modules linked in: CPU: 0 PID: 13 Comm: ksoftirqd/0 Not tainted 5.16.0-rc5-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:__alloc_pages_slowpath.constprop.0+0x1b7b/0x20d0 mm/page_alloc.c:5081 mm/page_alloc.c:5081 Code: 90 08 00 00 48 81 c7 d8 04 00 00 48 89 f8 48 c1 e8 03 42 80 3c 30 00 0f 84 f0 ea ff ff e8 3d 82 09 00 e9 e6 ea ff ff 4d 89 fd <0f> 0b 48 b8 00 00 00 00 00 fc ff df 48 8b 54 24 30 48 c1 ea 03 80 RSP: 0018:ffffc90000d272b8 EFLAGS: 00010246 RAX: 0000000000000000 RBX: ffff88813fffc300 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000002 RDI: ffff88813fffc348 RBP: ffff88813fffc300 R08: 00000000000013dc R09: 00000000000013c8 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: ffffc90000d274e8 R14: dffffc0000000000 R15: ffffc90000d274e8 FS: 0000000000000000(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ffefe6000f8 CR3: 000000001d21e000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __alloc_pages+0x412/0x500 mm/page_alloc.c:5382 mm/page_alloc.c:5382 alloc_pages+0x1a7/0x300 mm/mempolicy.c:2191 mm/mempolicy.c:2191 alloc_slab_page mm/slub.c:1793 [inline] allocate_slab mm/slub.c:1938 [inline] alloc_slab_page mm/slub.c:1793 [inline] mm/slub.c:1993 allocate_slab mm/slub.c:1938 [inline] mm/slub.c:1993 new_slab+0x349/0x4a0 mm/slub.c:1993 mm/slub.c:1993 ___slab_alloc+0x918/0xfe0 mm/slub.c:3022 mm/slub.c:3022 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3109 mm/slub.c:3109 slab_alloc_node mm/slub.c:3200 [inline] slab_alloc mm/slub.c:3242 [inline] slab_alloc_node mm/slub.c:3200 [inline] mm/slub.c:3259 slab_alloc mm/slub.c:3242 [inline] mm/slub.c:3259 kmem_cache_alloc_trace+0x289/0x2c0 mm/slub.c:3259 mm/slub.c:3259 kmalloc include/linux/slab.h:590 [inline] kzalloc include/linux/slab.h:724 [inline] kmalloc include/linux/slab.h:590 [inline] lib/ref_tracker.c:74 kzalloc include/linux/slab.h:724 [inline] lib/ref_tracker.c:74 ref_tracker_alloc+0xe1/0x430 lib/ref_tracker.c:74 lib/ref_tracker.c:74 netdev_tracker_alloc include/linux/netdevice.h:3855 [inline] dev_hold_track include/linux/netdevice.h:3872 [inline] netdev_tracker_alloc include/linux/netdevice.h:3855 [inline] net/core/dst.c:52 dev_hold_track include/linux/netdevice.h:3872 [inline] net/core/dst.c:52 dst_init+0xe0/0x520 net/core/dst.c:52 net/core/dst.c:52 dst_alloc+0x16b/0x1f0 net/core/dst.c:96 net/core/dst.c:96 rt_dst_alloc+0x73/0x450 net/ipv4/route.c:1614 net/ipv4/route.c:1614 ip_route_input_mc net/ipv4/route.c:1720 [inline] ip_route_input_mc net/ipv4/route.c:1720 [inline] net/ipv4/route.c:2465 ip_route_input_rcu.part.0+0x4fe/0xcc0 net/ipv4/route.c:2465 net/ipv4/route.c:2465 ip_route_input_rcu net/ipv4/route.c:2420 [inline] ip_route_input_rcu net/ipv4/route.c:2420 [inline] net/ipv4/route.c:2416 ip_route_input_noref+0x1b8/0x2a0 net/ipv4/route.c:2416 net/ipv4/route.c:2416 ip_rcv_finish_core.constprop.0+0x288/0x1e90 net/ipv4/ip_input.c:354 net/ipv4/ip_input.c:354 ip_rcv_finish+0x135/0x2f0 net/ipv4/ip_input.c:427 net/ipv4/ip_input.c:427 NF_HOOK include/linux/netfilter.h:307 [inline] NF_HOOK include/linux/netfilter.h:301 [inline] NF_HOOK include/linux/netfilter.h:307 [inline] net/ipv4/ip_input.c:540 NF_HOOK include/linux/netfilter.h:301 [inline] net/ipv4/ip_input.c:540 ip_rcv+0xaa/0xd0 net/ipv4/ip_input.c:540 net/ipv4/ip_input.c:540 __netif_receive_skb_one_core+0x114/0x180 net/core/dev.c:5350 net/core/dev.c:5350 __netif_receive_skb+0x24/0x1b0 net/core/dev.c:5464 net/core/dev.c:5464 process_backlog+0x2a5/0x6c0 net/core/dev.c:5796 net/core/dev.c:5796 __napi_poll+0xaf/0x440 net/core/dev.c:6364 net/core/dev.c:6364 napi_poll net/core/dev.c:6431 [inline] napi_poll net/core/dev.c:6431 [inline] net/core/dev.c:6518 net_rx_action+0x801/0xb40 net/core/dev.c:6518 net/core/dev.c:6518 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558 kernel/softirq.c:558 run_ksoftirqd kernel/softirq.c:921 [inline] run_ksoftirqd kernel/softirq.c:921 [inline] kernel/softirq.c:913 run_ksoftirqd+0x2d/0x60 kernel/softirq.c:913 kernel/softirq.c:913 smpboot_thread_fn+0x645/0x9c0 kernel/smpboot.c:164 kernel/smpboot.c:164 kthread+0x405/0x4f0 kernel/kthread.c:327 kernel/kthread.c:327 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 arch/x86/entry/entry_64.S:295 Fixes: 4e66934eaadc ("lib: add reference counting tracking infrastructure") Signed-off-by: Eric Dumazet Cc: Dmitry Vyukov Reported-by: syzbot Signed-off-by: David S. Miller commit d9932b46915664c88709d59927fa67e797adec56 Author: Sunil Muthuswamy Date: Wed Jan 5 11:32:36 2022 -0800 PCI: hv: Add arm64 Hyper-V vPCI support Add arm64 Hyper-V vPCI support by implementing the arch specific interfaces. Introduce an IRQ domain and chip specific to Hyper-v vPCI that is based on SPIs. The IRQ domain parents itself to the arch GIC IRQ domain for basic vector management. [bhelgaas: squash in fix from Yang Li : https://lore.kernel.org/r/20220112003324.62755-1-yang.lee@linux.alibaba.com] Link: https://lore.kernel.org/r/1641411156-31705-3-git-send-email-sunilmut@linux.microsoft.com Signed-off-by: Sunil Muthuswamy Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Marc Zyngier Reviewed-by: Michael Kelley commit 831c1ae725f7d2f8f858b0840692b48e75b49331 Author: Sunil Muthuswamy Date: Wed Jan 5 11:32:35 2022 -0800 PCI: hv: Make the code arch neutral by adding arch specific interfaces Encapsulate arch dependencies in Hyper-V vPCI through a set of arch-dependent interfaces. Adding these arch specific interfaces will allow for an implementation for other architectures, such as arm64. There are no functional changes expected from this patch. Link: https://lore.kernel.org/r/1641411156-31705-2-git-send-email-sunilmut@linux.microsoft.com Signed-off-by: Sunil Muthuswamy Signed-off-by: Lorenzo Pieralisi Signed-off-by: Bjorn Helgaas Reviewed-by: Boqun Feng Reviewed-by: Marc Zyngier Reviewed-by: Michael Kelley commit f7a6021aaf02088870559f82fc13c58cda7fea1a Author: Jiasheng Jiang Date: Tue Jan 11 10:50:48 2022 +0800 ASoC: cpcap: Check for NULL pointer after calling of_get_child_by_name If the device does not exist, of_get_child_by_name() will return NULL pointer. And devm_snd_soc_register_component() does not check it. Also, I have noticed that cpcap_codec_driver has not been used yet. Therefore, it should be better to check it in order to avoid the future dereference of the NULL pointer. Fixes: f6cdf2d3445d ("ASoC: cpcap: new codec") Signed-off-by: Jiasheng Jiang Link: https://lore.kernel.org/r/20220111025048.524134-1-jiasheng@iscas.ac.cn Signed-off-by: Mark Brown commit 4fbcc1a4cb20fe26ad0225679c536c80f1648221 Author: Jordy Zomer Date: Tue Jan 11 17:44:51 2022 +0100 nfc: st21nfca: Fix potential buffer overflows in EVT_TRANSACTION It appears that there are some buffer overflows in EVT_TRANSACTION. This happens because the length parameters that are passed to memcpy come directly from skb->data and are not guarded in any way. Signed-off-by: Jordy Zomer Reviewed-by: Krzysztof Kozlowski Signed-off-by: David S. Miller commit 2a4d75bfe41232608f5596a6d1369f92ccb20817 Author: Miroslav Lichvar Date: Tue Jan 11 16:10:53 2022 +0100 net: fix sock_timestamping_bind_phc() to release device Don't forget to release the device in sock_timestamping_bind_phc() after it was used to get the vclock indices. Fixes: d463126e23f1 ("net: sock: extend SO_TIMESTAMPING for PHC binding") Signed-off-by: Miroslav Lichvar Cc: Yangbo Lu Signed-off-by: David S. Miller commit 3486eb774f9d6c2cafcfed31936c9a9b7adf8f05 Author: Michael Walle Date: Tue Jan 11 09:12:06 2022 +0100 Revert "of: net: support NVMEM cells with MAC in text format" This reverts commit 9ed319e411915e882bb4ed99be3ae78667a70022. We can already post process a nvmem cell value in a particular driver. Instead of having yet another place to convert the values, the post processing hook of the nvmem provider should be used in this case. Signed-off-by: Michael Walle Signed-off-by: David S. Miller commit 085a9f43433f30cbe8a1ade62d9d7827c3217f4d Author: Hans de Goede Date: Fri Dec 17 15:17:09 2021 +0100 PCI: pciehp: Use down_read/write_nested(reset_lock) to fix lockdep errors Use down_read_nested() and down_write_nested() when taking the ctrl->reset_lock rw-sem, passing the number of PCIe hotplug controllers in the path to the PCI root bus as lock subclass parameter. This fixes the following false-positive lockdep report when unplugging a Lenovo X1C8 from a Lenovo 2nd gen TB3 dock: pcieport 0000:06:01.0: pciehp: Slot(1): Link Down pcieport 0000:06:01.0: pciehp: Slot(1): Card not present ============================================ WARNING: possible recursive locking detected 5.16.0-rc2+ #621 Not tainted -------------------------------------------- irq/124-pciehp/86 is trying to acquire lock: ffff8e5ac4299ef8 (&ctrl->reset_lock){.+.+}-{3:3}, at: pciehp_check_presence+0x23/0x80 but task is already holding lock: ffff8e5ac4298af8 (&ctrl->reset_lock){.+.+}-{3:3}, at: pciehp_ist+0xf3/0x180 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(&ctrl->reset_lock); lock(&ctrl->reset_lock); *** DEADLOCK *** May be due to missing lock nesting notation 3 locks held by irq/124-pciehp/86: #0: ffff8e5ac4298af8 (&ctrl->reset_lock){.+.+}-{3:3}, at: pciehp_ist+0xf3/0x180 #1: ffffffffa3b024e8 (pci_rescan_remove_lock){+.+.}-{3:3}, at: pciehp_unconfigure_device+0x31/0x110 #2: ffff8e5ac1ee2248 (&dev->mutex){....}-{3:3}, at: device_release_driver+0x1c/0x40 stack backtrace: CPU: 4 PID: 86 Comm: irq/124-pciehp Not tainted 5.16.0-rc2+ #621 Hardware name: LENOVO 20U90SIT19/20U90SIT19, BIOS N2WET30W (1.20 ) 08/26/2021 Call Trace: dump_stack_lvl+0x59/0x73 __lock_acquire.cold+0xc5/0x2c6 lock_acquire+0xb5/0x2b0 down_read+0x3e/0x50 pciehp_check_presence+0x23/0x80 pciehp_runtime_resume+0x5c/0xa0 device_for_each_child+0x45/0x70 pcie_port_device_runtime_resume+0x20/0x30 pci_pm_runtime_resume+0xa7/0xc0 __rpm_callback+0x41/0x110 rpm_callback+0x59/0x70 rpm_resume+0x512/0x7b0 __pm_runtime_resume+0x4a/0x90 __device_release_driver+0x28/0x240 device_release_driver+0x26/0x40 pci_stop_bus_device+0x68/0x90 pci_stop_bus_device+0x2c/0x90 pci_stop_and_remove_bus_device+0xe/0x20 pciehp_unconfigure_device+0x6c/0x110 pciehp_disable_slot+0x5b/0xe0 pciehp_handle_presence_or_link_change+0xc3/0x2f0 pciehp_ist+0x179/0x180 This lockdep warning is triggered because with Thunderbolt, hotplug ports are nested. When removing multiple devices in a daisy-chain, each hotplug port's reset_lock may be acquired recursively. It's never the same lock, so the lockdep splat is a false positive. Because locks at the same hierarchy level are never acquired recursively, a per-level lockdep class is sufficient to fix the lockdep warning. The choice to use one lockdep subclass per pcie-hotplug controller in the path to the root-bus was made to conserve class keys because their number is limited and the complexity grows quadratically with number of keys according to Documentation/locking/lockdep-design.rst. Link: https://lore.kernel.org/linux-pci/20190402021933.GA2966@mit.edu/ Link: https://lore.kernel.org/linux-pci/de684a28-9038-8fc6-27ca-3f6f2f6400d7@redhat.com/ Link: https://lore.kernel.org/r/20211217141709.379663-1-hdegoede@redhat.com Link: https://bugzilla.kernel.org/show_bug.cgi?id=208855 Reported-by: "Theodore Ts'o" Signed-off-by: Hans de Goede Signed-off-by: Bjorn Helgaas Reviewed-by: Lukas Wunner Cc: stable@vger.kernel.org commit fe75e84a8fe17449ea16b73cfcfc9e7d06a49130 Author: Pablo Neira Ayuso Date: Wed Jan 12 12:29:05 2022 +0100 netfilter: nf_tables: set last expression in register tracking area nft_rule_for_each_expr() sets on last to nft_rule_last(), however, this is coming after track.last field is set on. Use nft_expr_last() to set track.last accordingly. Fixes: 12e4ecfa244b ("netfilter: nf_tables: add register tracking infrastructure") Reported-by: Dan Carpenter Signed-off-by: Pablo Neira Ayuso commit 0499f419b76f94ede08304aad5851144813ac55c Author: Javier Martinez Canillas Date: Mon Jan 10 10:56:25 2022 +0100 video: vga16fb: Only probe for EGA and VGA 16 color graphic cards The vga16fb framebuffer driver only supports Enhanced Graphics Adapter (EGA) and Video Graphics Array (VGA) 16 color graphic cards. But it doesn't check if the adapter is one of those or if a VGA16 mode is used. This means that the driver will be probed even if a VESA BIOS Extensions (VBE) or Graphics Output Protocol (GOP) interface is used. This issue has been present for a long time but it was only exposed by commit d391c5827107 ("drivers/firmware: move x86 Generic System Framebuffers support") since the platform device registration to match the {vesa,efi}fb drivers is done later as a consequence of that change. All non-x86 architectures though treat orig_video_isVGA as a boolean so only do the supported video mode check for x86 and not for other arches. Link: https://bugzilla.kernel.org/show_bug.cgi?id=215001 Fixes: d391c5827107 ("drivers/firmware: move x86 Generic System Framebuffers support") Reported-by: Kris Karas Cc: # 5.15.x Signed-off-by: Javier Martinez Canillas Tested-by: Kris Karas Acked-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220110095625.278836-3-javierm@redhat.com commit f3193ea1b6779023334faa72b214ece457e02656 Author: Karl Kurbjun Date: Sun Jan 9 20:49:35 2022 -0700 HID: Ignore battery for Elan touchscreen on HP Envy X360 15t-dr100 Battery status on Elan tablet driver is reported for the HP ENVY x360 15t-dr100. There is no separate battery for the Elan controller resulting in a battery level report of 0% or 1% depending on whether a stylus has interacted with the screen. These low battery level reports causes a variety of bad behavior in desktop environments. This patch adds the appropriate quirk to indicate that the batery status is unused for this target. Cc: stable@vger.kernel.org Signed-off-by: Karl Kurbjun Signed-off-by: Jiri Kosina commit 869b6ca39c08c5b10eeb29d4b3c4bc433bf8ba5e Author: Huang Yiwei Date: Mon Nov 22 13:05:09 2021 +0800 dt-bindings: mailbox: Add more protocol and client ID Add more protocol and client ID which can be used in device tree properties. Signed-off-by: Huang Yiwei Signed-off-by: Jassi Brar commit afaf2ba5b430c538297cb59012ea17d28a1f8a26 Author: Huang Yiwei Date: Mon Nov 22 13:05:08 2021 +0800 mailbox: qcom-ipcc: Support interrupt wake up from suspend Use IRQF_NO_SUSPEND flag instead of enable_irq_wake to support interrupt wake up from suspend. Signed-off-by: Huang Yiwei Signed-off-by: Jassi Brar commit 1f43e5230aebb17aea35238dc26e297a61095ac0 Author: Huang Yiwei Date: Mon Nov 22 13:05:07 2021 +0800 mailbox: qcom-ipcc: Support more IPCC instance Since hardware is supporting multiple IPCC instance, use ipcc_%d instead of ipcc as the irq name to support in driver. Signed-off-by: Huang Yiwei Signed-off-by: Jassi Brar commit e9d50e4b4d04165097a71e20e0a77e7ad7053dd0 Author: Huang Yiwei Date: Mon Nov 22 13:05:06 2021 +0800 mailbox: qcom-ipcc: Dynamic alloc for channel arrangement Dynamic alloc for channel arrangement instead of static alloced array, it is more flexible and can reduce memory usage. Signed-off-by: Huang Yiwei Signed-off-by: Jassi Brar commit f10b1fc0161cd99e54c5687fcc63368aa255e05e Author: Conor Dooley Date: Fri Dec 17 09:33:12 2021 +0000 mailbox: change mailbox-mpfs compatible string The Polarfire SoC is currently using two different compatible string prefixes. Fix this by changing "polarfire-soc-*" strings to "mpfs-*" in its system controller in order to match the compatible string used in the soc binding and device tree. Signed-off-by: Conor Dooley Reviewed-by: Geert Uytterhoeven Signed-off-by: Jassi Brar commit 7215a7857e796c655ae1184b313556102fa8bc40 Author: Sudeep Holla Date: Thu Dec 9 09:21:46 2021 +0000 mailbox: pcc: Handle all PCC subtypes correctly in pcc_mbox_irq Commit c45ded7e1135 ("mailbox: pcc: Add support for PCCT extended PCC subspaces(type 3/4)") enabled the type3/4 of PCCT, but the change in pcc_mbox_irq breaks the other PCC subtypes. The kernel reports a warning on an Ampere eMag server -->8 CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.16.0-rc4 #127 Hardware name: MiTAC RAPTOR EV-883832-X3-0001/RAPTOR, BIOS 0.14 02/22/2019 Call trace: dump_backtrace+0x0/0x200 show_stack+0x20/0x30 dump_stack_lvl+0x68/0x84 dump_stack+0x18/0x34 __report_bad_irq+0x54/0x17c note_interrupt+0x330/0x428 handle_irq_event_percpu+0x90/0x98 handle_irq_event+0x4c/0x148 handle_fasteoi_irq+0xc4/0x188 generic_handle_domain_irq+0x44/0x68 gic_handle_irq+0x84/0x2ec call_on_irq_stack+0x28/0x34 do_interrupt_handler+0x88/0x90 el1_interrupt+0x48/0xb0 el1h_64_irq_handler+0x18/0x28 el1h_64_irq+0x7c/0x80 Fixes: c45ded7e1135 ("mailbox: pcc: Add support for PCCT extended PCC subspaces(type 3/4)") Reported-by: Justin He Tested-by: Justin He Signed-off-by: Sudeep Holla Signed-off-by: Jassi Brar commit 960c4056aadcf61983f8eaac159927a052f8cf01 Author: Sudeep Holla Date: Thu Dec 9 08:21:43 2021 +0000 mailbox: pcc: Avoid using the uninitialized variable 'dev' Smatch static checker warns: | drivers/mailbox/pcc.c:292 pcc_mbox_request_channel() | error: uninitialized symbol 'dev'. Fix the same by using pr_err instead of dev_err as the variable 'dev' is uninitialized at that stage. Fixes: ce028702ddbc ("mailbox: pcc: Move bulk of PCCT parsing into pcc_mbox_probe") Cc: Jassi Brar Reported-by: Dan Carpenter Signed-off-by: Sudeep Holla Signed-off-by: Jassi Brar commit af8d0f6d222d12ed7bba447e5eb277a5908b8968 Author: Wang Qing Date: Tue Jan 11 23:15:47 2022 -0600 mailbox: mtk: add missing of_node_put before return Fix following coccicheck warning: WARNING: Function "for_each_child_of_node" should have of_node_put() before return. Early exits from for_each_child_of_node should decrement the node reference counter. Signed-off-by: Wang Qing Signed-off-by: Jassi Brar commit 2453128847ca1edbecbe33dbe063a04489d64842 Author: Wang Qing Date: Mon Dec 13 01:44:20 2021 -0800 mailbox: zynq: add missing of_node_put before return Fix following coccicheck warning: WARNING: Function "for_each_available_child_of_node" should have of_node_put() before return. Early exits from for_each_available_child_of_node should decrement the node reference counter. Signed-off-by: Wang Qing Signed-off-by: Jassi Brar commit 05d06f37196b2e3abeff2b98b785c8803865e646 Author: Dan Carpenter Date: Wed Nov 24 17:51:26 2021 +0300 mailbox: imx: Fix an IS_ERR() vs NULL bug The devm_kzalloc() function does not return error pointers, it returns NULL on failure. Fixes: 97961f78e8bc ("mailbox: imx: support i.MX8ULP S4 MU") Signed-off-by: Dan Carpenter Reviewed-by: Peng Fan Signed-off-by: Jassi Brar commit 79daec8b9c02e04e2afb11eefa71698b913b2c55 Author: Randy Dunlap Date: Sun Nov 14 19:31:19 2021 -0800 mailbox: hi3660: convert struct comments to kernel-doc notation Convert hi3660 struct comments to kernel-doc notation and fix other kernel-doc warnings: drivers/mailbox/hi3660-mailbox.c:47: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Hi3660 mailbox channel information drivers/mailbox/hi3660-mailbox.c:62: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Hi3660 mailbox controller data hi3660-mailbox.c:53: warning: contents before sections hi3660-mailbox.c:67: warning: contents before sections Fixes: 41c0e939d70d ("mailbox: Add support for Hi3660 mailbox") Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Ruyi Wang Cc: Kaihua Zhong Reviewed-by: Leo Yan Signed-off-by: Jassi Brar commit 9388501fbb99a1b6a23f28634d125567a3b45a3d Author: jason-jh.lin Date: Fri Dec 10 14:11:38 2021 +0800 mailbox: add control_by_sw for mt8195 To make sure the GCE request signal to SPM is not trigger by other HW modules and cause suspend premature wake. Set 0x7 (the bit 0~2 as 1) to GCE_GCTL_VALUE, to configure the request signal control by SW and release the request to SPM. Signed-off-by: jason-jh.lin Reviewed-by: Tzung-Bi Shih Signed-off-by: Jassi Brar commit 99867e5a87502a3e636059f39b2f668931767868 Author: Hsin-Yi Wang Date: Mon Dec 13 15:05:01 2021 +0800 mailbox: mtk-cmdq: Silent EPROBE_DEFER errors for clks Silent the error if it's EPROBE_DEFER for clks. Signed-off-by: Hsin-Yi Wang Signed-off-by: Jassi Brar commit 35ca43710f792ce183312fdc7e4b2bb0b721a173 Author: jason-jh.lin Date: Thu Dec 23 22:51:55 2021 +0800 mailbox: fix gce_num of mt8192 driver data Because mt8192 only have 1 gce, the gce_num should be 1. Fixes: 85dfdbfc13ea ("mailbox: cmdq: add multi-gce clocks support for mt8195") Signed-off-by: jason-jh.lin Reviewed-by: Matthias Brugger Signed-off-by: Jassi Brar commit 1fa68a3593ae5b9168a08ad4f72d2d7dbbeedb41 Author: Hector Martin Date: Thu Dec 16 00:55:27 2021 +0900 mailbox: apple: Bind to generic compatibles As with other blocks, we intend to have drivers bind to generic compatibles as long as there are no SoC-specific quirks. This allows forward-compatibility with future SoCs. No upstream DTs instantiate this yet, so it's still safe to make this breaking change. Signed-off-by: Hector Martin Reviewed-by: Sven Peter Signed-off-by: Jassi Brar commit b29d644b5589d5b9f002f4a5a53699a33e1c08f0 Author: Hector Martin Date: Thu Dec 16 00:55:26 2021 +0900 dt-bindings: mailbox: apple,mailbox: Add generic and t6000 compatibles Much as we've done with other blocks, let's introduce generic compatibles so drivers can bind to those and still work with future SoCs, as long as the hardware remains the same. Also go ahead and add compatibles for the new t600x SoCs (we group those as t6000). Note that no DTs instantiate devices with this binding yet. Reviewed-by: Mark Kettenis Signed-off-by: Hector Martin Reviewed-by: Sven Peter Reviewed-by: Sven Peter Signed-off-by: Jassi Brar commit edcb501e543cecaff5e3d079c798911e680fea65 Author: Colin Ian King Date: Sun Jan 9 23:17:16 2022 +0000 net: phy: at803x: make array offsets static Don't populate the read-only const array offsets on the stack but instead make it static. Also makes the object code a little smaller. Signed-off-by: Colin Ian King Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220109231716.59012-1-colin.i.king@gmail.com Signed-off-by: Jakub Kicinski commit e110978d6e060a3e633e3e5e427770a66b330d48 Author: Colin Ian King Date: Sun Jan 9 20:24:18 2022 +0000 nfc: pn544: make array rset_cmd static const Don't populate the read-only array rset_cmd on the stack but instead it static const. Also makes the object code a little smaller. Signed-off-by: Colin Ian King Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220109202418.50641-1-colin.i.king@gmail.com Signed-off-by: Jakub Kicinski commit cb963a19d99fc42d9abf4238968ef85fcc2ef3e3 Author: Eric Dumazet Date: Mon Jan 10 01:47:50 2022 -0800 net: sched: do not allocate a tracker in tcf_exts_init() While struct tcf_exts has a net pointer, it is not refcounted until tcf_exts_get_net() is called. Fixes: dbdcda634ce3 ("net: sched: add netns refcount tracker to struct tcf_exts") Signed-off-by: Eric Dumazet Reported-by: syzbot Link: https://lore.kernel.org/r/20220110094750.236478-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit 29b3881b7977db792f93ebe440423811d5cfee56 Merge: 274c224062ff9 48d67543e01d7 Author: Jakub Kicinski Date: Tue Jan 11 20:36:11 2022 -0800 Merge branch 'ipv4-fix-accidental-rto_onlink-flags-passed-to-ip_route_output_key_hash' Guillaume Nault says: ==================== ipv4: Fix accidental RTO_ONLINK flags passed to ip_route_output_key_hash() The IPv4 stack generally uses the last bit of ->flowi4_tos as a flag indicating link scope for route lookups (RTO_ONLINK). Therefore, we have to be careful when copying a TOS value to ->flowi4_tos. In particular, the ->tos field of IPv4 packets may have this bit set because of ECN. Also tunnel keys generally accept any user value for the tos. This series fixes several places where ->flowi4_tos was set from non-sanitised values and the flowi4 structure was later used by ip_route_output_key_hash(). Note that the IPv4 stack usually clears the RTO_ONLINK bit using RT_TOS(). However this macro is based on an obsolete interpretation of the old IPv4 TOS field (RFC 1349) and clears the three high order bits too. Since we don't need to clear these bits and since it doesn't make sense to clear only one of the ECN bits, this patch series uses INET_ECN_MASK instead. All patches were compile tested only. ==================== Link: https://lore.kernel.org/r/cover.1641821242.git.gnault@redhat.com Signed-off-by: Jakub Kicinski commit 48d67543e01d73292e0bb66d3f10fc422e79e031 Author: Guillaume Nault Date: Mon Jan 10 14:43:14 2022 +0100 mlx5: Don't accidentally set RTO_ONLINK before mlx5e_route_lookup_ipv4_get() Mask the ECN bits before calling mlx5e_route_lookup_ipv4_get(). The tunnel key might have the last ECN bit set. This interferes with the route lookup process as ip_route_output_key_hash() interpretes this bit specially (to restrict the route scope). Found by code inspection, compile tested only. Fixes: c7b9038d8af6 ("net/mlx5e: TC preparation refactoring for routing update event") Fixes: 9a941117fb76 ("net/mlx5e: Maximize ip tunnel key usage on the TC offloading path") Signed-off-by: Guillaume Nault Signed-off-by: Jakub Kicinski commit a915deaa9abe4fb3a440312c954253a6a733608e Author: Guillaume Nault Date: Mon Jan 10 14:43:11 2022 +0100 libcxgb: Don't accidentally set RTO_ONLINK in cxgb_find_route() Mask the ECN bits before calling ip_route_output_ports(). The tos variable might be passed directly from an IPv4 header, so it may have the last ECN bit set. This interferes with the route lookup process as ip_route_output_key_hash() interpretes this bit specially (to restrict the route scope). Found by code inspection, compile tested only. Fixes: 804c2f3e36ef ("libcxgb,iw_cxgb4,cxgbit: add cxgb_find_route()") Signed-off-by: Guillaume Nault Signed-off-by: Jakub Kicinski commit f7716b318568b22fbf0e3be99279a979e217cf71 Author: Guillaume Nault Date: Mon Jan 10 14:43:09 2022 +0100 gre: Don't accidentally set RTO_ONLINK in gre_fill_metadata_dst() Mask the ECN bits before initialising ->flowi4_tos. The tunnel key may have the last ECN bit set, which will interfere with the route lookup process as ip_route_output_key_hash() interpretes this bit specially (to restrict the route scope). Found by code inspection, compile tested only. Fixes: 962924fa2b7a ("ip_gre: Refactor collect metatdata mode tunnel xmit to ip_md_tunnel_xmit") Signed-off-by: Guillaume Nault Signed-off-by: Jakub Kicinski commit 23e7b1bfed61e301853b5e35472820d919498278 Author: Guillaume Nault Date: Mon Jan 10 14:43:06 2022 +0100 xfrm: Don't accidentally set RTO_ONLINK in decode_session4() Similar to commit 94e2238969e8 ("xfrm4: strip ECN bits from tos field"), clear the ECN bits from iph->tos when setting ->flowi4_tos. This ensures that the last bit of ->flowi4_tos is cleared, so ip_route_output_key_hash() isn't going to restrict the scope of the route lookup. Use ~INET_ECN_MASK instead of IPTOS_RT_MASK, because we have no reason to clear the high order bits. Found by code inspection, compile tested only. Fixes: 4da3089f2b58 ("[IPSEC]: Use TOS when doing tunnel lookups") Signed-off-by: Guillaume Nault Signed-off-by: Jakub Kicinski commit 274c224062ff9545d8df2a6e4764a5fd660d792e Author: Conley Lee Date: Tue Jan 11 11:05:53 2022 +0800 net: ethernet: sun4i-emac: replace magic number with macro This patch remove magic numbers in sun4i-emac.c and replace with macros defined in sun4i-emac.h Signed-off-by: Conley Lee Tested-by: Corentin Labbe Link: https://lore.kernel.org/r/tencent_71466C2135CD1780B19D7844BE3F167C940A@qq.com Signed-off-by: Jakub Kicinski commit 284a4d94e8e74fbd731ee67e29196656ca823423 Author: Matt Johnston Date: Mon Jan 10 10:18:06 2022 +0800 mctp: test: zero out sockaddr MCTP now requires that padding bytes are zero. Signed-off-by: Matt Johnston Fixes: 1e4b50f06d97 ("mctp: handle the struct sockaddr_mctp padding fields") Link: https://lore.kernel.org/r/20220110021806.2343023-1-matt@codeconstruct.com.au Signed-off-by: Jakub Kicinski commit 96dd8754881022d4372359b1c0efcdbc732a0ea7 Author: Luis Chamberlain Date: Tue Jan 11 19:15:12 2022 -0800 MAINTAINERS: add mailing lists for kmod and modules Add the linux-modules list for kmod and linux modules changes. Signed-off-by: Luis Chamberlain commit ca321ec74322e3c49552fc1ffc80b42d0dbf1a84 Author: Greg Kroah-Hartman Date: Sat Jan 8 15:06:57 2022 +0100 module.h: allow #define strings to work with MODULE_IMPORT_NS The MODULE_IMPORT_NS() macro does not allow defined strings to work properly with it, so add a layer of indirection to allow this to happen. Cc: Luis Chamberlain Cc: Jessica Yu Cc: Matthias Maennich Signed-off-by: Greg Kroah-Hartman Reviewed-by: Matthias Maennich Signed-off-by: Luis Chamberlain commit b1ae6dc41eaaa98bb75671e0f3665bfda248c3e7 Author: Dmitry Torokhov Date: Wed Jan 5 13:55:12 2022 -0800 module: add in-kernel support for decompressing Current scheme of having userspace decompress kernel modules before loading them into the kernel runs afoul of LoadPin security policy, as it loses link between the source of kernel module on the disk and binary blob that is being loaded into the kernel. To solve this issue let's implement decompression in kernel, so that we can pass a file descriptor of compressed module file into finit_module() which will keep LoadPin happy. To let userspace know what compression/decompression scheme kernel supports it will create /sys/module/compression attribute. kmod can read this attribute and decide if it can pass compressed file to finit_module(). New MODULE_INIT_COMPRESSED_DATA flag indicates that the kernel should attempt to decompress the data read from file descriptor prior to trying load the module. To simplify things kernel will only implement single decompression method matching compression method selected when generating modules. This patch implements gzip and xz; more can be added later, Signed-off-by: Dmitry Torokhov Signed-off-by: Luis Chamberlain commit ef307fc2a9bd776114f9c85bc676ad76fe8f0f2a Author: Jessica Yu Date: Thu Dec 9 09:43:13 2021 +0100 MAINTAINERS: Remove myself as modules maintainer Luis has done a great job maintaining modules so far. As I'm planning to take a break from work soon, I think we're ready to transition over fully. Signed-off-by: Jessica Yu Acked-by: Lucas De Marchi Signed-off-by: Luis Chamberlain commit 9dc3c3f691bca10d3aa94887eee33bf629840b23 Author: Yu Chen Date: Mon Nov 22 06:26:48 2021 -0800 module: Remove outdated comment Since commit e513cc1c07e2 ("module: Remove stop_machine from module unloading") this comment is no longer correct. Remove it. Signed-off-by: Yu Chen Signed-off-by: Luis Chamberlain commit 4afd2a9355a9deb16ea42b896820dacf49843a8f Merge: 1d0bd126d9282 b5bc83bb70a5c ec97d23c8e22c Author: Stephen Boyd Date: Tue Jan 11 18:31:00 2022 -0800 Merge branches 'clk-ingenic' and 'clk-mediatek' into clk-next - Add MDMA and BDMA clks to Ingenic JZ4760 and JZ4770 - MediaTek mt7986 SoC basic support * clk-ingenic: clk: ingenic: Add MDMA and BDMA clocks dt-bindings: clk/ingenic: Add MDMA and BDMA clocks * clk-mediatek: clk: mediatek: add mt7986 clock support clk: mediatek: add mt7986 clock IDs dt-bindings: clock: mediatek: document clk bindings for mediatek mt7986 SoC clk: mediatek: clk-gate: Use regmap_{set/clear}_bits helpers clk: mediatek: clk-gate: Shrink by adding clockgating bit check helper commit 1d0bd126d9282ce198c85a6f83036f68e1c6cc3c Merge: f691c9b526627 b739bca9f3344 4e31bfa37662f 5dcc0ef8873ea c861c1be38978 Author: Stephen Boyd Date: Tue Jan 11 18:30:50 2022 -0800 Merge branches 'clk-socfpga', 'clk-toshiba', 'clk-st' and 'clk-bitmain' into clk-next - Clock and reset driver for Toshiba Visconti SoCs * clk-socfpga: clk: socfpga: s10: Make use of the helper function devm_platform_ioremap_resource() clk: socfpga: agilex: Make use of the helper function devm_platform_ioremap_resource() clk: socfpga: remove redundant assignment after a mask operation clk: socfpga: remove redundant assignment on division * clk-toshiba: clk: visconti: Remove pointless NULL check in visconti_pll_add_lookup() MAINTAINERS: Add entries for Toshiba Visconti PLL and clock controller clk: visconti: Add support common clock driver and reset driver dt-bindings: clock: Add DT bindings for SMU of Toshiba Visconti TMPV770x SoC dt-bindings: clock: Add DT bindings for PLL of Toshiba Visconti TMPV770x SoC * clk-st: clk: Drop unused COMMON_CLK_STM32MP157_SCMI config clk: st: clkgen-mux: search reg within node or parent clk: st: clkgen-fsyn: search reg within node or parent * clk-bitmain: clk: bm1880: remove kfrees on static allocations commit f691c9b526627933b332a1e4c3c7f8635021dba3 Merge: 151768f34854e fcfc6ea4a400e 176a3200ef6d8 14350ed95867c 87e55700f3598 Author: Stephen Boyd Date: Tue Jan 11 18:30:43 2022 -0800 Merge branches 'clk-nvidia', 'clk-imx', 'clk-samsung' and 'clk-qcom' into clk-next * clk-nvidia: clk: tegra: Support runtime PM and power domain clk: tegra: Make vde a child of pll_p on tegra114 * clk-imx: clk: imx8mp: Fix the parent clk of the audio_root_clk clk: imx8mp: Remove IPG_AUDIO_ROOT from imx8mp-clock.h clk: imx8mn: Fix imx8mn_clko1_sels clk: imx: Use div64_ul instead of do_div clk: imx: imx8ulp: set suppress_bind_attrs to true * clk-samsung: clk: samsung: Add initial Exynos7885 clock driver clk: samsung: clk-pll: Add support for pll1417x clk: samsung: Make exynos850_register_cmu shared dt-bindings: clock: Document Exynos7885 CMU bindings dt-bindings: clock: Add bindings definitions for Exynos7885 CMU clk: samsung: exynos850: Add missing sysreg clocks dt-bindings: clock: Add bindings for Exynos850 sysreg clocks clk: samsung: exynos850: Register clocks early clk: samsung: exynos850: Keep some crucial clocks running clk: samsung: exynos850: Implement CMU_CMGP domain dt-bindings: clock: Add bindings for Exynos850 CMU_CMGP clk: samsung: exynos850: Implement CMU_APM domain dt-bindings: clock: Add bindings for Exynos850 CMU_APM clk: samsung: Update CPU clk registration clk: samsung: Remove meaningless __init and extern from header files clk: samsung: remove __clk_lookup() usage dt-bindings: clock: samsung: add IDs for some core clocks * clk-qcom: (25 commits) clk: qcom: gcc-sc7280: Mark gcc_cfg_noc_lpass_clk always enabled clk: qcom: clk-alpha-pll: Increase PLL lock detect poll time clk: qcom: turingcc-qcs404: explicitly include clk-provider.h clk: qcom: q6sstop-qcs404: explicitly include clk-provider.h clk: qcom: mmcc-apq8084: explicitly include clk-provider.h clk: qcom: lpasscc-sdm845: explicitly include clk-provider.h clk: qcom: lpasscc-sc7280: explicitly include clk-provider.h clk: qcom: gcc-sm6350: explicitly include clk-provider.h clk: qcom: gcc-msm8994: explicitly include clk-provider.h clk: qcom: gcc-sm8350: explicitly include clk-provider.h clk: qcom: Add MSM8976/56 Global Clock Controller (GCC) driver dt-bindings: clk: qcom: Document MSM8976 Global Clock Controller clk: qcom: Add clock driver for SM8450 clk: qcom: Add SDX65 GCC support clk: qcom: Add LUCID_EVO PLL type for SDX65 dt-bindings: clock: Add SM8450 GCC clock bindings dt-bindings: clock: Add SDX65 GCC clock bindings clk: qcom: rpmh: add support for SM8450 rpmh clocks dt-bindings: clock: Add RPMHCC bindings for SM8450 clk: qcom: smd-rpm: Drop binary value handling for buffered clock ... commit 151768f34854e2c9f466ecfc0827742ec5de302b Merge: 270bbc725328d 1fdaaa13b44fd 6fc058a72f3b7 c1001a62f2f59 4f1e19b658444 Author: Stephen Boyd Date: Tue Jan 11 18:30:35 2022 -0800 Merge branches 'clk-x86', 'clk-stm', 'clk-amlogic' and 'clk-allwinner' into clk-next * clk-x86: clk: x86: Fix clk_gate_flags for RV_CLK_GATE clk: x86: Use dynamic con_id string during clk registration ACPI: APD: Add a fmw property clk-name drivers: acpi: acpi_apd: Remove unused device property "is-rv" x86: clk: clk-fch: Add support for newer family of AMD's SOC clk: Introduce clk-tps68470 driver platform/x86: int3472: Deal with probe ordering issues platform/x86: int3472: Pass tps68470_regulator_platform_data to the tps68470-regulator MFD-cell platform/x86: int3472: Pass tps68470_clk_platform_data to the tps68470-regulator MFD-cell platform/x86: int3472: Add get_sensor_adev_and_name() helper platform/x86: int3472: Split into 2 drivers platform_data: Add linux/platform_data/tps68470.h file i2c: acpi: Add i2c_acpi_new_device_by_fwnode() function i2c: acpi: Use acpi_dev_ready_for_enumeration() helper ACPI: delay enumeration of devices with a _DEP pointing to an INT3472 device * clk-stm: clk: stm32: Fix ltdc's clock turn off by clk_disable_unused() after system enter shell * clk-amlogic: clk: meson: gxbb: Fix the SDM_EN bit for MPLL0 on GXBB * clk-allwinner: clk: sunxi-ng: Add support for the D1 SoC clocks clk: sunxi-ng: gate: Add macros for gates with fixed dividers clk: sunxi-ng: mux: Add macros using clk_parent_data and clk_hw clk: sunxi-ng: mp: Add macros using clk_parent_data and clk_hw clk: sunxi-ng: div: Add macros using clk_parent_data and clk_hw dt-bindings: clk: Add compatibles for D1 CCUs clk: sunxi-ng: Allow the CCU core to be built as a module clk: sunxi-ng: Convert early providers to platform drivers clk: sunxi-ng: Allow drivers to be built as modules clk: sunxi-ng: Export symbols used by CCU drivers commit 270bbc725328d905812ba024acd8f71786912fba Merge: ecb64bbff7ddd a5ce1d5118705 8f6b28c5b1782 d66e4c985dd48 1bb294a7981c7 Author: Stephen Boyd Date: Tue Jan 11 18:30:10 2022 -0800 Merge branches 'clk-doc', 'clk-renesas', 'clk-at91', 'clk-cleanup' and 'clk-debugfs' into clk-next * clk-doc: clk: Gemini: fix struct name in kernel-doc clk: zynq: pll: Fix kernel-doc warnings clk: imx: pllv1: fix kernel-doc notation for struct clk_pllv1 * clk-renesas: (31 commits) clk: renesas: r9a07g044: Add GPU clock and reset entries clk: renesas: r9a07g044: Add mux and divider for G clock clk: renesas: r9a07g044: Rename CLK_PLL3_DIV4 macro clk: renesas: cpg-mssr: Add support for R-Car S4-8 clk: renesas: rcar-gen4: Introduce R-Car Gen4 CPG driver dt-bindings: clock: Add r8a779f0 CPG Core Clock Definitions dt-bindings: power: Add r8a779f0 SYSC power domain definitions clk: renesas: r9a07g044: Add TSU clock and reset entry mmc: renesas_sdhi: Simplify an expression mmc: renesas_sdhi: Use devm_clk_get_optional() to obtain CD clock dt-bindings: clock: renesas,cpg-mssr: Document r8a779f0 clk: renesas: cpg-mssr: propagate return value of_genpd_add_provider_simple() clk: renesas: cpg-mssr: Check return value of pm_genpd_init() clk: renesas: rzg2l: propagate return value of_genpd_add_provider_simple() clk: renesas: rzg2l: Check return value of pm_genpd_init() clk: renesas: r9a07g044: Add RSPI clock and reset entries clk: renesas: r9a07g044: Change core clock "I" from DEF_FIXED->DEF_DIV clk: renesas: rzg2l: Add CPG_PL1_DDIV macro mmc: renesas_sdhi: Parse DT for SDnH mmc: renesas_sdhi: Use dev_err_probe when getting clock fails ... * clk-at91: clk: lan966x: Extend lan966x clock driver for clock gating support dt-bindings: clock: lan966x: Extend includes with clock gates dt-bindings: clock: lan966x: Extend for clock gate support clk: gate: Add devm_clk_hw_register_gate() clk: lan966x: Add lan966x SoC clock driver dt-bindings: clock: lan966x: Add LAN966X Clock Controller dt-bindings: clock: lan966x: Add binding includes for lan966x SoC clock IDs * clk-cleanup: clk: stm32mp1: remove redundant assignment to pointer data clk: __clk_core_init() never takes NULL clk: clk_core_get() can also return NULL clk/ti/adpll: Make const pointer error a static const array * clk-debugfs: clk: Enable/Disable runtime PM for clk_summary clk: Emit a stern warning with writable debugfs enabled clk: Add write operation for clk_parent debugfs node commit daadb3bd0e8d3e317e36bc2c1542e86c528665e5 Merge: 6ae71436cda74 f16cc980d649e Author: Linus Torvalds Date: Tue Jan 11 17:24:45 2022 -0800 Merge tag 'locking_core_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull locking updates from Borislav Petkov: "Lots of cleanups and preparation. Highlights: - futex: Cleanup and remove runtime futex_cmpxchg detection - rtmutex: Some fixes for the PREEMPT_RT locking infrastructure - kcsan: Share owner_on_cpu() between mutex,rtmutex and rwsem and annotate the racy owner->on_cpu access *once*. - atomic64: Dead-Code-Elemination" [ Description above by Peter Zijlstra ] * tag 'locking_core_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: locking/atomic: atomic64: Remove unusable atomic ops futex: Fix additional regressions locking: Allow to include asm/spinlock_types.h from linux/spinlock_types_raw.h x86/mm: Include spinlock_t definition in pgtable. locking: Mark racy reads of owner->on_cpu locking: Make owner_on_cpu() into lockdep/selftests: Adapt ww-tests for PREEMPT_RT lockdep/selftests: Skip the softirq related tests on PREEMPT_RT lockdep/selftests: Unbalanced migrate_disable() & rcu_read_lock(). lockdep/selftests: Avoid using local_lock_{acquire|release}(). lockdep: Remove softirq accounting on PREEMPT_RT. locking/rtmutex: Add rt_mutex_lock_nest_lock() and rt_mutex_lock_killable(). locking/rtmutex: Squash self-deadlock check for ww_rt_mutex. locking: Remove rt_rwlock_is_contended(). sched: Trigger warning if ->migration_disabled counter underflows. futex: Fix sparc32/m68k/nds32 build regression futex: Remove futex_cmpxchg detection futex: Ensure futex_atomic_cmpxchg_inatomic() is present kernel/locking: Use a pointer in ww_mutex_trylock(). commit 6ae71436cda740148640046d58190a5bbc3ac86d Merge: 01367e86e9094 82762d2af31a6 Author: Linus Torvalds Date: Tue Jan 11 17:14:59 2022 -0800 Merge tag 'sched_core_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull scheduler updates from Borislav Petkov: "Mostly minor things this time; some highlights: - core-sched: Add 'Forced Idle' accounting; this allows to track how much CPU time is 'lost' due to core scheduling constraints. - psi: Fix for MEM_FULL; a task running reclaim would be counted as a runnable task and prevent MEM_FULL from being reported. - cpuacct: Long standing fixes for some cgroup accounting issues. - rt: Bandwidth timer could, under unusual circumstances, be failed to armed, leading to indefinite throttling." [ Description above by Peter Zijlstra ] * tag 'sched_core_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched/fair: Replace CFS internal cpu_util() with cpu_util_cfs() sched/fair: Cleanup task_util and capacity type sched/rt: Try to restart rt period timer when rt runtime exceeded sched/fair: Document the slow path and fast path in select_task_rq_fair sched/fair: Fix per-CPU kthread and wakee stacking for asym CPU capacity sched/fair: Fix detection of per-CPU kthreads waking a task sched/cpuacct: Make user/system times in cpuacct.stat more precise sched/cpuacct: Fix user/system in shown cpuacct.usage* cpuacct: Convert BUG_ON() to WARN_ON_ONCE() cputime, cpuacct: Include guest time in user time in cpuacct.stat psi: Fix PSI_MEM_FULL state when tasks are in memstall and doing reclaim sched/core: Forced idle accounting psi: Add a missing SPDX license header psi: Remove repeated verbose comment commit 01367e86e90948b1ae8f66b2c23aadd7e8374e34 Merge: 3e3a138a46906 552a23a0e5d0a Author: Linus Torvalds Date: Tue Jan 11 17:06:42 2022 -0800 Merge tag 'Wcast-function-type-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux Pull cast-function-type warning addition from Gustavo A. R. Silva: "This globally enables -Wcast-function-type. We need to make sure new function cast mismatches are not introduced in the kernel in order to avoid tripping CFI checking" * tag 'Wcast-function-type-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux: Makefile: Enable -Wcast-function-type commit 3e3a138a46906641d95599040f2470a60740c399 Merge: c1eb8f6cff344 b0343ab330ae4 Author: Linus Torvalds Date: Tue Jan 11 16:09:36 2022 -0800 Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm Pull ARM updates from Russell King: - amba bus irq rework - add kfence support - support for Cortex M33 and M55 CPUs - kbuild updates for decompressor - let core code manage thread_info::cpu - avoid unpredictable NOP encoding in decompressor - reduce information printed in calltraces * tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm: ARM: reduce the information printed in call traces ARM: 9168/1: Add support for Cortex-M55 processor ARM: 9167/1: Add support for Cortex-M33 processor ARM: 9166/1: Support KFENCE for ARM ARM: 9165/1: mm: Provide is_write_fault() ARM: 9164/1: mm: Provide set_memory_valid() ARM: 9163/1: amba: Move of_amba_device_decode_irq() into amba_probe() ARM: 9162/1: amba: Kill sysfs attribute file of irq ARM: 9161/1: mm: mark private VM_FAULT_X defines as vm_fault_t ARM: 9159/1: decompressor: Avoid UNPREDICTABLE NOP encoding ARM: 9158/1: leave it to core code to manage thread_info::cpu ARM: 9154/1: decompressor: do not copy source files while building commit c1eb8f6cff3442b0b7eff5b801c9745ea9abcb14 Merge: f18e2d8772696 68d247ad38b1e Author: Linus Torvalds Date: Tue Jan 11 15:42:45 2022 -0800 Merge tag 'for-5.17/parisc-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux Pull parisc architecture updates from Helge Deller: - Fix lpa and lpa_user defines (John David Anglin) - Fix symbol lookup of init functions with an __is_kernel() fix (Helge Deller) - Fix wrong pdc_toc_pim_11 and pdc_toc_pim_20 definitions (Helge Deller) - Add lws_atomic_xchg and lws_atomic_store syscalls (John David Anglin) - Rewrite light-weight syscall and futex code (John David Anglin) - Enable TOC (transfer of contents) feature unconditionally (Helge Deller) - Improve fault handler messages (John David Anglin) - Improve build process (Masahiro Yamada) - Reduce kernel code footprint of user access functions (Helge Deller) - Fix build error due to outX() macros (Bart Van Assche) - Ue default_groups in kobj_type in pdc_stable (Greg Kroah-Hartman) - Default to 16 CPUs on 32-bit kernel (Helge Deller) * tag 'for-5.17/parisc-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: Default to 16 CPUs on 32-bit kernel sections: Fix __is_kernel() to include init ranges parisc: Re-use toc_stack as hpmc_stack parisc: Enable TOC (transfer of contents) feature unconditionally parisc: io: Improve the outb(), outw() and outl() macros parisc: pdc_stable: use default_groups in kobj_type parisc: Add kgdb io_module to read chars via PDC parisc: Fix pdc_toc_pim_11 and pdc_toc_pim_20 definitions parisc: Add lws_atomic_xchg and lws_atomic_store syscalls parisc: Rewrite light-weight syscall and futex code parisc: Enhance page fault termination message parisc: Don't call faulthandler_disabled() in do_page_fault() parisc: Switch user access functions to signal errors in r29 instead of r8 parisc: Avoid calling faulthandler_disabled() twice parisc: Fix lpa and lpa_user defines parisc: Define depi_safe macro parisc: decompressor: do not copy source files while building commit f18e2d877269672597088c308ca75d7d52620028 Merge: f12fc75ef7db4 b6aa86cff44cf Author: Linus Torvalds Date: Tue Jan 11 15:38:11 2022 -0800 Merge tag 'x86_build_for_v5.17_rc1-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull missed x86 build updates from Borislav Petkov: "In the heat of the battle between me and the tip pull requests, I've sent you the tip:x86/build branch without the two top-most commits from Ingo (it appears I hadn't fast-forwarded my local branch, sorry about that). Therefore, here's a part 2 of x86/build for 5.17. - Make x86 defconfigs more useful by enabling CONFIG_LOCALVERSION_AUTO and CONFIG_KALLSYMS_ALL And while you merge that, I'll be at the blackboard, writing: I will always fast-forward local branches before tagging and sending pull requests to Linus. I will always fast-forward local branches before tagging and sending pull requests to Linus. I will always fast-forward local branches before tagging and sending pull requests..." * tag 'x86_build_for_v5.17_rc1-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/kbuild: Enable CONFIG_KALLSYMS_ALL=y in the defconfigs x86/defconfig: Enable CONFIG_LOCALVERSION_AUTO=y in the defconfig commit f12fc75ef7db44d71d5a509e2f1bec6966b73776 Merge: f69212114220e 42f4046bc4ba5 Author: Linus Torvalds Date: Tue Jan 11 15:36:30 2022 -0800 Merge tag 'efi-next-for-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi Pull EFI updates from Ard Biesheuvel: - support taking the measurement of the initrd when loaded via the LoadFile2 protocol - kobject API cleanup from Greg - some header file whitespace fixes * tag 'efi-next-for-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi: efi: use default_groups in kobj_type efi/libstub: measure loaded initrd info into the TPM efi/libstub: consolidate initrd handling across architectures efi/libstub: x86/mixed: increase supported argument count efi/libstub: add prototype of efi_tcg2_protocol::hash_log_extend_event() include/linux/efi.h: Remove unneeded whitespaces before tabs commit f69212114220edf8372867088b97b47760b6839d Merge: 5672cdfba4fef db0dd9cee8227 Author: Linus Torvalds Date: Tue Jan 11 15:26:52 2022 -0800 Merge tag 'for-linus-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml Pull UML updates from Richard Weinberger: - set_fs removal - Devicetree support - Many cleanups from Al - Various virtio and build related fixes * tag 'for-linus-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml: (31 commits) um: virtio_uml: Allow probing from devicetree um: Add devicetree support um: Extract load file helper from initrd.c um: remove set_fs hostfs: Fix writeback of dirty pages um: Use swap() to make code cleaner um: header debriding - sigio.h um: header debriding - os.h um: header debriding - net_*.h um: header debriding - mem_user.h um: header debriding - activate_ipi() um: common-offsets.h debriding... um, x86: bury crypto_tfm_ctx_offset um: unexport handle_page_fault() um: remove a dangling extern of syscall_trace() um: kill unused cpu() uml/i386: missing include in barrier.h um: stop polluting the namespace with registers.h contents logic_io instance of iounmap() needs volatile on argument um: move amd64 variant of mmap(2) to arch/x86/um/syscalls_64.c ... commit 5672cdfba4fefd6178b6c4078cb1bb7bf6ce0573 Merge: 3f67eaed57dae aa39cc675799b Author: Linus Torvalds Date: Tue Jan 11 15:23:27 2022 -0800 Merge tag 'for-linus-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs Pull JFFS2, UBI and UBIFS updates from Richard Weinberger: "JFFS2: - Fix for a deadlock in jffs2_write_begin() UBI: - Fixes in comments UBIFS: - Expose error counters in sysfs - Many bugfixes found by Hulk Robot and others" * tag 'for-linus-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs: jffs2: GC deadlock reading a page that is used in jffs2_write_begin() ubifs: read-only if LEB may always be taken in ubifs_garbage_collect ubifs: fix double return leb in ubifs_garbage_collect ubifs: fix slab-out-of-bounds in ubifs_change_lp ubifs: fix snprintf() length check ubifs: Document sysfs nodes ubifs: Export filesystem error counters ubifs: Error path in ubifs_remount_rw() seems to wrongly free write buffers ubifs: Make use of the helper macro kthread_run() ubi: Fix a mistake in comment ubifs: Fix spelling mistakes commit 3f67eaed57dae339603441cf0c0a74ec77a9fc03 Merge: 8481c323e4ea0 feae43f8aa883 Author: Linus Torvalds Date: Tue Jan 11 15:21:54 2022 -0800 Merge tag 'dlm-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm Pull dlm updates from David Teigland: "This set includes the normal collection of minor fixes and cleanups, new kmem caches for network messaging structs, a start on some basic tracepoints, and some new debugfs files for inserting test messages" * tag 'dlm-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm: (32 commits) fs: dlm: print cluster addr if non-cluster node connects fs: dlm: memory cache for lowcomms hotpath fs: dlm: memory cache for writequeue_entry fs: dlm: memory cache for midcomms hotpath fs: dlm: remove wq_alloc mutex fs: dlm: use event based wait for pending remove fs: dlm: check for pending users filling buffers fs: dlm: use list_empty() to check last iteration fs: dlm: fix build with CONFIG_IPV6 disabled fs: dlm: replace use of socket sk_callback_lock with sock_lock fs: dlm: don't call kernel_getpeername() in error_report() fs: dlm: fix potential buffer overflow fs: dlm:Remove unneeded semicolon fs: dlm: remove double list_first_entry call fs: dlm: filter user dlm messages for kernel locks fs: dlm: add lkb waiters debugfs functionality fs: dlm: add lkb debugfs functionality fs: dlm: allow create lkb with specific id range fs: dlm: add debugfs rawmsg send functionality fs: dlm: let handle callback data as void ... commit 8481c323e4ea0a65f0578107a3e668c1c69cf474 Merge: 1dbfae0113f14 74382e277ae97 Author: Linus Torvalds Date: Tue Jan 11 15:20:32 2022 -0800 Merge tag 'gfs2-v5.16-rc3-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2 Pull gfs2 updates from Andreas Gruenbacher: "Various minor gfs2 cleanups and fixes" * tag 'gfs2-v5.16-rc3-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2: gfs2: dump inode object for iopen glocks gfs2: Fix gfs2_instantiate description gfs2: Remove redundant check for GLF_INSTANTIATE_NEEDED gfs2: remove redundant set of INSTANTIATE_NEEDED gfs2: Fix __gfs2_holder_init function name in kernel-doc comment commit 65552b02a10acea68127081faf414b84a65d1855 Author: Darrick J. Wong Date: Tue Jan 4 17:38:36 2022 -0800 xfs: take the ILOCK when readdir inspects directory mapping data I was poking around in the directory code while diagnosing online fsck bugs, and noticed that xfs_readdir doesn't actually take the directory ILOCK when it calls xfs_dir2_isblock. xfs_dir_open most probably loaded the data fork mappings and the VFS took i_rwsem (aka IOLOCK_SHARED) so we're protected against writer threads, but we really need to follow the locking model like we do in other places. To avoid unnecessarily cycling the ILOCK for fairly small directories, change the block/leaf _getdents functions to consume the ILOCK hold that the parent readdir function took to decide on a _getdents implementation. It is ok to cycle the ILOCK in readdir because the VFS takes the IOLOCK in the appropriate mode during lookups and writes, and we don't want to be holding the ILOCK when we copy directory entries to userspace in case there's a page fault. We really only need it to protect against data fork lookups, like we do for other files. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit 1dbfae0113f1423b42c304989a3cc8a7dd0ea53e Merge: 11fc88c2e49ba 6eeaf88fd586f Author: Linus Torvalds Date: Tue Jan 11 15:07:49 2022 -0800 Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 Pull ext4 updates from Ted Ts'o: "Convert ext4 to use the new mount API, and add support for the FS_IOC_GETFSLABEL and FS_IOC_SETFSLABEL ioctls. In addition the usual large number of clean ups and bug fixes, in particular for the fast_commit feature" * tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (48 commits) ext4: don't use the orphan list when migrating an inode ext4: use BUG_ON instead of if condition followed by BUG ext4: fix a copy and paste typo ext4: set csum seed in tmp inode while migrating to extents ext4: remove unnecessary 'offset' assignment ext4: remove redundant o_start statement ext4: drop an always true check ext4: remove unused assignments ext4: remove redundant statement ext4: remove useless resetting io_end_size in mpage_process_page() ext4: allow to change s_last_trim_minblks via sysfs ext4: change s_last_trim_minblks type to unsigned long ext4: implement support for get/set fs label ext4: only set EXT4_MOUNT_QUOTA when journalled quota file is specified ext4: don't use kfree() on rcu protected pointer sbi->s_qf_names ext4: avoid trim error on fs with small groups ext4: fix an use-after-free issue about data=journal writeback mode ext4: fix null-ptr-deref in '__ext4_journal_ensure_credits' ext4: initialize err_blk before calling __ext4_get_inode_loc ext4: fix a possible ABBA deadlock due to busy PA ... commit 11fc88c2e49ba8e3ca827dc9bdd7b7216be30a36 Merge: d601e58c5f290 7e937bb3cbe1f Author: Linus Torvalds Date: Tue Jan 11 15:01:50 2022 -0800 Merge tag 'xfs-5.17-merge-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux Pull xfs updates from Darrick Wong: "The big new feature here is that the mount code now only bothers to try to free stale COW staging extents if the fs unmounted uncleanly. This should reduce mount times, particularly on filesystems supporting reflink and containing a large number of allocation groups. Everything else this cycle are bugfixes, as the iomap folios conversion should be plenty enough excitement for anyone. That and I ran out of brain bandwidth after Thanksgiving last year. Summary: - Fix log recovery with da btree buffers when metauuid is in use. - Fix type coercion problems in xattr buffer size validation. - Fix a bug in online scrub dir leaf bestcount checking. - Only run COW recovery when recovering the log. - Fix symlink target buffer UAF problems and symlink locking problems by not exposing xfs innards to the VFS. - Fix incorrect quotaoff lock usage. - Don't let transactions cancel cleanly if they have deferred work items attached. - Fix a UAF when we're deciding if we need to relog an intent item. - Reduce kvmalloc overhead for log shadow buffers. - Clean up sysfs attr group usage. - Fix a bug where scrub's bmap/rmap checking could race with a quota file block allocation due to insufficient locking. - Teach scrub to complain about invalid project ids" * tag 'xfs-5.17-merge-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: xfs: warn about inodes with project id of -1 xfs: hold quota inode ILOCK_EXCL until the end of dqalloc xfs: Remove redundant assignment of mp xfs: reduce kvmalloc overhead for CIL shadow buffers xfs: sysfs: use default_groups in kobj_type xfs: prevent UAF in xfs_log_item_in_current_chkpt xfs: prevent a WARN_ONCE() in xfs_ioc_attr_list() xfs: Fix comments mentioning xfs_ialloc xfs: check sb_meta_uuid for dabuf buffer recovery xfs: fix a bug in the online fsck directory leaf1 bestcount check xfs: only run COW extent recovery when there are no live extents xfs: don't expose internal symlink metadata buffers to the vfs xfs: fix quotaoff mutex usage now that we don't support disabling it xfs: shut down filesystem if we xfs_trans_cancel with deferred work items commit d601e58c5f2901783428bc1181e83ff783592b6b Merge: 9149fe8ba7ff7 36c86a9e1be3b Author: Linus Torvalds Date: Tue Jan 11 14:53:40 2022 -0800 Merge tag 'for-5.17-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux Pull btrfs updates from David Sterba: "This end of the year branch is intentionally not that exciting. Most of the changes are under the hood, but there are some minor user visible improvements and several performance improvements too. Features: - make send work with concurrent block group relocation. We're not allowed to prevent send failing or silently producing some bad stream but with more fine grained locking and checks it's possible. The send vs deduplication exclusion could reuse the same logic in the future. - new exclusive operation 'balance paused' to allow adding a device to filesystem with paused balance - new sysfs file for fsid stored in the per-device directory to help distinguish devices when seeding is enabled, the fsid may differ from the one reported by the filesystem Performance improvements: - less metadata needed for directory logging, directory deletion is 20-40% faster - in zoned mode, cache zone information during mount to speed up repeated queries (about 50% speedup) - free space tree entries get indexed and searched by size (latency -30%, search run time -30%) - less contention in tree node locking when inserting a key and no splits are needed (files/sec in fsmark improves by 1-20%) Fixes: - fix ENOSPC failure when attempting direct IO write into NOCOW range - fix deadlock between quota enable and other quota operations - global reserve minimum calculations fixed to account for free space tree - in zoned mode, fix condition for chunk allocation that may not find the right zone for reuse and could lead to early ENOSPC Core: - global reserve stealing got simplified and cleaned up in evict - remove async transaction commit based on manual transaction refs, reuse existing kthread and mechanisms to let it commit transaction before timeout - preparatory work for extent tree v2, add wrappers for global tree roots, truncation path cleanups - remove readahead framework, it's a bit overengineered and used only for scrub, and yet it does not cover all its needs, there is another readahead built in the b-tree search that is now used, performance drop on HDD is about 5% which is acceptable and scrub is often throttled anyway, on SSDs there's no reported drop but slight improvement - self tests report extent tree state when error occurs - replace assert with debugging information when an uncommitted transaction is found at unmount time Other: - error handling improvements - other cleanups and refactoring" * tag 'for-5.17-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux: (115 commits) btrfs: output more debug messages for uncommitted transaction btrfs: respect the max size in the header when activating swap file btrfs: fix argument list that the kdoc format and script verified btrfs: remove unnecessary parameter type from compression_decompress_bio btrfs: selftests: dump extent io tree if extent-io-tree test failed btrfs: scrub: cleanup the argument list of scrub_stripe() btrfs: scrub: cleanup the argument list of scrub_chunk() btrfs: remove reada infrastructure btrfs: scrub: use btrfs_path::reada for extent tree readahead btrfs: scrub: remove the unnecessary path parameter for scrub_raid56_parity() btrfs: refactor unlock_up btrfs: skip transaction commit after failure to create subvolume btrfs: zoned: fix chunk allocation condition for zoned allocator btrfs: add extent allocator hook to decide to allocate chunk or not btrfs: zoned: unset dedicated block group on allocation failure btrfs: zoned: drop redundant check for REQ_OP_ZONE_APPEND and btrfs_is_zoned btrfs: zoned: sink zone check into btrfs_repair_one_zone btrfs: zoned: simplify btrfs_check_meta_write_pointer btrfs: zoned: encapsulate inode locking for zoned relocation btrfs: sysfs: add devinfo/fsid to retrieve actual fsid from the device ... commit 9149fe8ba7ff798ea1c6b1fa05eeb59f95f9a94a Merge: 579f3a6d32a9c 09c543798c3cd Author: Linus Torvalds Date: Tue Jan 11 14:51:10 2022 -0800 Merge tag 'erofs-for-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs Pull erofs updates from Gao Xiang: "In this cycle, tail-packing data inline for compressed files is now supported so that tail pcluster can be stored and read together with inode metadata in order to save data I/O and storage space. In addition to that, to prepare for the upcoming subpage, folio and fscache features, we also introduce meta buffers to get rid of erofs_get_meta_page() since it was too close to the page itself. In addition, in order to show supported kernel features and control sync decompression strategy, new sysfs nodes are introduced in this cycle as well. Summary: - add sysfs interface and a sysfs node to control sync decompression - add tail-packing inline support for compressed files - get rid of erofs_get_meta_page()" * tag 'erofs-for-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs: erofs: use meta buffers for zmap operations erofs: use meta buffers for xattr operations erofs: use meta buffers for super operations erofs: use meta buffers for inode operations erofs: introduce meta buffer operations erofs: add on-disk compressed tail-packing inline support erofs: support inline data decompression erofs: support unaligned data decompression erofs: introduce z_erofs_fixup_insize erofs: tidy up z_erofs_lz4_decompress erofs: clean up erofs_map_blocks tracepoints erofs: Replace zero-length array with flexible-array member erofs: add sysfs node to control sync decompression strategy erofs: add sysfs interface erofs: rename lz4_0pading to zero_padding commit 579f3a6d32a9c3d1cf5c2b1bd66817a2db31a968 Author: Paul E. McKenney Date: Tue Jan 11 13:54:31 2022 -0800 drivers/pcmcia: Fix ifdef covering yenta_pm_ops Currently, yenta_dev_suspend_noirq(), yenta_dev_resume_noirq(), and yenta_pm_ops are covered by "#ifdef CONFIG_PM", which results in compiler warnings in kernels built with CONFIG_PM_SLEEP=n and CONFIG_PM=y: drivers/pcmcia/yenta_socket.c:1322:12: warning: ‘yenta_dev_resume_noirq’ defined but not used [-Wunused-function] 1322 | static int yenta_dev_resume_noirq(struct device *dev) | ^~~~~~~~~~~~~~~~~~~~~~ drivers/pcmcia/yenta_socket.c:1303:12: warning: ‘yenta_dev_suspend_noirq’ defined but not used [-Wunused-function] 1303 | static int yenta_dev_suspend_noirq(struct device *dev) | ^~~~~~~~~~~~~~~~~~~~~~~ This affects kernels built without suspend and hibernation. Avoid these warnings by using "#ifdef CONFIG_PM_SLEEP". Fixes: 3daaf2c7aae8 ("pcmcia: Make use of the helper macro SET_NOIRQ_SYSTEM_SLEEP_PM_OPS()") Signed-off-by: Paul E. McKenney Cc: Masahiro Yamada Signed-off-by: Linus Torvalds commit d7bdba1c81f7e7bad12c7c7ce55afa3c7b0821ef Author: David Howells Date: Wed Dec 22 17:21:04 2021 +0000 9p, afs, ceph, nfs: Use current_is_kswapd() rather than gfpflags_allow_blocking() In 9p, afs ceph, and nfs, gfpflags_allow_blocking() (which wraps a test for __GFP_DIRECT_RECLAIM being set) is used to determine if ->releasepage() should wait for the completion of a DIO write to fscache with something like: if (folio_test_fscache(folio)) { if (!gfpflags_allow_blocking(gfp) || !(gfp & __GFP_FS)) return false; folio_wait_fscache(folio); } Instead, current_is_kswapd() should be used instead. Note that this is based on a patch originally by Zhaoyang Huang[1]. In addition to extending it to the other network filesystems and putting it on top of my fscache rewrite, it also needs to include linux/swap.h in a bunch of places. Can current_is_kswapd() be moved to linux/mm.h? Changes ======= ver #5: - Dropping the changes for cifs. Originally-signed-off-by: Zhaoyang Huang Co-developed-by: David Howells Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: Zhaoyang Huang cc: Dominique Martinet cc: Marc Dionne cc: Steve French cc: Trond Myklebust cc: linux-cachefs@redhat.com cc: v9fs-developer@lists.sourceforge.net cc: linux-afs@lists.infradead.org cc: ceph-devel@vger.kernel.org cc: linux-cifs@vger.kernel.org cc: linux-nfs@vger.kernel.org cc: linux-mm@kvack.org Link: https://lore.kernel.org/r/1638952658-20285-1-git-send-email-huangzhaoyang@gmail.com/ [1] Link: https://lore.kernel.org/r/164021590773.640689.16777975200823659231.stgit@warthog.procyon.org.uk/ # v4 commit 5dfbfe71e32406f08480185d396d94cf7fc7a7d6 Merge: 84bfcc0b69940 bd303368b776e Author: Linus Torvalds Date: Tue Jan 11 14:26:55 2022 -0800 Merge tag 'fs.idmapped.v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux Pull fs idmapping updates from Christian Brauner: "This contains the work to enable the idmapping infrastructure to support idmapped mounts of filesystems mounted with an idmapping. In addition this contains various cleanups that avoid repeated open-coding of the same functionality and simplify the code in quite a few places. We also finish the renaming of the mapping helpers we started a few kernel releases back and move them to a dedicated header to not continue polluting the fs header needlessly with low-level idmapping helpers. With this series the fs header only contains idmapping helpers that interact with fs objects. Currently we only support idmapped mounts for filesystems mounted without an idmapping themselves. This was a conscious decision mentioned in multiple places (cf. [1]). As explained at length in [3] it is perfectly fine to extend support for idmapped mounts to filesystem's mounted with an idmapping should the need arise. The need has been there for some time now (cf. [2]). Before we can port any filesystem that is mountable with an idmapping to support idmapped mounts in the coming cycles, we need to first extend the mapping helpers to account for the filesystem's idmapping. This again, is explained at length in our documentation at [3] and also in the individual commit messages so here's an overview. Currently, the low-level mapping helpers implement the remapping algorithms described in [3] in a simplified manner as we could rely on the fact that all filesystems supporting idmapped mounts are mounted without an idmapping. In contrast, filesystems mounted with an idmapping are very likely to not use an identity mapping and will instead use a non-identity mapping. So the translation step from or into the filesystem's idmapping in the remapping algorithm cannot be skipped for such filesystems. Non-idmapped filesystems and filesystems not supporting idmapped mounts are unaffected by this change as the remapping algorithms can take the same shortcut as before. If the low-level helpers detect that they are dealing with an idmapped mount but the underlying filesystem is mounted without an idmapping we can rely on the previous shortcut and can continue to skip the translation step from or into the filesystem's idmapping. And of course, if the low-level helpers detect that they are not dealing with an idmapped mount they can simply return the relevant id unchanged; no remapping needs to be performed at all. These checks guarantee that only the minimal amount of work is performed. As before, if idmapped mounts aren't used the low-level helpers are idempotent and no work is performed at all" Link: 2ca4dcc4909d ("fs/mount_setattr: tighten permission checks") [1] Link: https://github.com/containers/podman/issues/10374 [2] Link: Documentations/filesystems/idmappings.rst [3] Link: a65e58e791a1 ("fs: document and rename fsid helpers") [4] * tag 'fs.idmapped.v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux: fs: support mapped mounts of mapped filesystems fs: add i_user_ns() helper fs: port higher-level mapping helpers fs: remove unused low-level mapping helpers fs: use low-level mapping helpers docs: update mapping documentation fs: account for filesystem mappings fs: tweak fsuidgid_has_mapping() fs: move mapping helpers fs: add is_idmapped_mnt() helper commit e6435f1e02f410e3507f02a37c0fbb17971ddc7c Author: David Howells Date: Mon Dec 6 15:54:04 2021 +0000 fscache: Add a tracepoint for cookie use/unuse Add a tracepoint to track fscache_use/unuse_cookie(). Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/164021588628.640689.12942919367404043608.stgit@warthog.procyon.org.uk/ # v4 commit e0484344c0413e1fcd5642b77d49c7648fb194ec Author: David Howells Date: Wed Nov 10 13:25:03 2021 +0000 fscache: Rewrite documentation Rewrite the fscache documentation. Changes ======= ver #3: - The volume coherency data is now an arbitrarily-sized blob, not a u64. ver #2: - Put quoting around some bits of C being referred to in the docs[1]. - Stripped the markup off the ref to the netfs lib doc[2]. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/20211130175119.63d0e7aa@canb.auug.org.au/ [1] Link: https://lore.kernel.org/r/20211130162311.105fcfa5@canb.auug.org.au/ [2] Link: https://lore.kernel.org/r/163819672252.215744.15454333549935901588.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906986754.143852.17703291789683936950.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967193834.1823006.15991526817786159772.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021585970.640689.3162537597817521032.stgit@warthog.procyon.org.uk/ # v4 commit 1702e79734104d711a84ff55bd6a93c21947bc01 Author: Jeff Layton Date: Tue Dec 7 08:44:51 2021 -0500 ceph: add fscache writeback support When updating the backing store from the pagecache (a'la writepage or writepages), write to the cache first. This allows us to keep caching files even when they are being written, as long as we have appropriate caps. Signed-off-by: Jeff Layton Signed-off-by: David Howells Link: https://lore.kernel.org/r/20211129162907.149445-3-jlayton@kernel.org/ # v1 Link: https://lore.kernel.org/r/20211207134451.66296-3-jlayton@kernel.org/ # v2 Link: https://lore.kernel.org/r/163906985808.143852.1383891557313186623.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967190257.1823006.16713609520911954804.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021585020.640689.6765214932458435472.stgit@warthog.procyon.org.uk/ # v4 commit 400e1286c0ec3fd13d7ac0705c3c175bcb6d2899 Author: Jeff Layton Date: Tue Dec 7 08:44:50 2021 -0500 ceph: conversion to new fscache API Now that the fscache API has been reworked and simplified, change ceph over to use it. With the old API, we would only instantiate a cookie when the file was open for reads. Change it to instantiate the cookie when the inode is instantiated and call use/unuse when the file is opened/closed. Also, ensure we resize the cached data on truncates, and invalidate the cache in response to the appropriate events. This will allow us to plumb in write support later. Signed-off-by: Jeff Layton Signed-off-by: David Howells Link: https://lore.kernel.org/r/20211129162907.149445-2-jlayton@kernel.org/ # v1 Link: https://lore.kernel.org/r/20211207134451.66296-2-jlayton@kernel.org/ # v2 Link: https://lore.kernel.org/r/163906984277.143852.14697110691303589000.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967188351.1823006.5065634844099079351.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021581427.640689.14128682147127509264.stgit@warthog.procyon.org.uk/ # v4 commit 0046686da0ef692a6381260c3aa44291187eafc9 Author: Ian Rogers Date: Thu Dec 23 10:39:47 2021 -0800 perf test: Enable system wide for metricgroups test Uncore events as group leaders fail in per-thread mode causing exit errors. Enable system-wide for metricgroup testing. This fixes the HPC metric group when tested on skylakex. Fixes: 4a87dea9e60fe100 ("perf test: Workload test of metric and metricgroups") Signed-off-by: Ian Rogers Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Andi Kleen Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Stephane Eranian Link: https://lore.kernel.org/r/20211223183948.3423989-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 7f435e42fd6b65fd8759963156e1ef0fb7d213f8 Author: Stafford Horne Date: Tue Jan 11 11:55:37 2022 +0900 openrisc: init: Add support for common clk When testing the new litex_mmc driver it was found to not work on OpenRISC due to missing support for common clk. This patch does the basic initialization to allow OpenRISC to use the common clk framework. Signed-off-by: Stafford Horne Reviewed-by: Geert Uytterhoeven commit 84bfcc0b6994057905cf98d2c5cedef48b3322b5 Merge: 5d7e52237c59e 65e38e32a959d Author: Linus Torvalds Date: Tue Jan 11 13:11:10 2022 -0800 Merge tag 'integrity-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity Pull integrity subsystem updates from Mimi Zohar: "The few changes are all kexec related: - The MOK keys are loaded onto the .platform keyring in order to verify the kexec kernel image signature. However, the MOK keys should only be trusted when secure boot is enabled. Before loading the MOK keys onto the .platform keyring, make sure the system is booted in secure boot mode. - When carrying the IMA measurement list across kexec, limit dumping the measurement list to when dynamic debug or CONFIG_DEBUG is enabled. - kselftest: add kexec_file_load selftest support for PowerNV and other cleanup" * tag 'integrity-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity: selftests/kexec: Enable secureboot tests for PowerPC ima: silence measurement list hexdump during kexec selftests/kexec: update searching for the Kconfig selftest/kexec: fix "ignored null byte in input" warning integrity: Do not load MOK and MOKx when secure boot be disabled ima: Fix undefined arch_ima_get_secureboot() and co commit 5d7e52237c59e37a25da854196fc70e9b09704d9 Merge: a135ce4400bb8 ed98ea2128b6f Author: Linus Torvalds Date: Tue Jan 11 13:08:21 2022 -0800 Merge tag 'audit-pr-20220110' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit Pull audit updates from Paul Moore: "Four audit patches for v5.17: - Harden the code through additional use of the struct_size() macro and zero-length arrays to flexible-array conversions. - Ensure that processes which generate userspace audit records are not exempt from the kernel's audit throttling when the audit queues are being overrun" * tag 'audit-pr-20220110' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit: audit: replace zero-length array with flexible-array member audit: use struct_size() helper in audit_[send|make]_reply() audit: ensure userspace is penalized the same as the kernel when under pressure audit: use struct_size() helper in kmalloc() commit a135ce4400bb87f229ab33a663987327d9e0b2a0 Merge: dabd40ecaf693 6cd9d4b978915 Author: Linus Torvalds Date: Tue Jan 11 13:03:06 2022 -0800 Merge tag 'selinux-pr-20220110' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux Pull selinux updates from Paul Moore: "Nothing too significant, but five SELinux patches for v5.17 that do the following: - Harden the code through additional use of the struct_size() macro - Plug some memory leaks - Clean up the code via removal of the security_add_mnt_opt() LSM hook and minor tweaks to selinux_add_opt() - Rename security_task_getsecid_subj() to better reflect its actual behavior/use - now called security_current_getsecid_subj()" * tag 'selinux-pr-20220110' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux: selinux: minor tweaks to selinux_add_opt() selinux: fix potential memleak in selinux_add_opt() security,selinux: remove security_add_mnt_opt() selinux: Use struct_size() helper in kmalloc() lsm: security_task_getsecid_subj() -> security_current_getsecid_subj() commit dabd40ecaf693a18afd4c59c8d7280610d95b66e Merge: 4aa1b8257fba5 d99a8af48a3de Author: Linus Torvalds Date: Tue Jan 11 12:58:41 2022 -0800 Merge tag 'tpmdd-next-v5.17-fixed' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd Pull TPM updates from Jarkko Sakkinen: "Other than bug fixes for TPM, this includes a patch for asymmetric keys to allow to look up and verify with self-signed certificates (keys without so called AKID - Authority Key Identifier) using a new "dn:" prefix in the query" * tag 'tpmdd-next-v5.17-fixed' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd: lib: remove redundant assignment to variable ret tpm: fix NPE on probe for missing device tpm: fix potential NULL pointer access in tpm_del_char_device tpm: Add Upgrade/Reduced mode support for TPM2 modules char: tpm: cr50: Set TPM_FIRMWARE_POWER_MANAGED based on device property keys: X.509 public key issuer lookup without AKID tpm_tis: Fix an error handling path in 'tpm_tis_core_init()' tpm: tpm_tis_spi_cr50: Add default RNG quality tpm/st33zp24: drop unneeded over-commenting tpm: add request_locality before write TPM_INT_ENABLE commit 5eb877b282fecc8b8a6ac6d4ce0d5057f9d3bad0 Author: Kent Russell Date: Tue Jan 11 12:28:27 2022 -0500 drm/amdkfd: Fix ASIC name typos Three misspelled ASICs in comments here, so fix the spelling Signed-off-by: Kent Russell Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 6f4cb84ae0f6d56d0b5071a0057df9c7cfb82ce1 Author: Felix Kuehling Date: Tue Dec 7 22:03:52 2021 -0500 drm/amdkfd: Fix DQM asserts on Hawaii start_nocpsch would never set dqm->sched_running on Hawaii due to an early return statement. This would trigger asserts in other functions and end up in inconsistent states. Bug: https://github.com/RadeonOpenCompute/ROCm/issues/1624 Signed-off-by: Felix Kuehling Reviewed-by: Kent Russell Signed-off-by: Alex Deucher commit dc5d4aff2e99c312df8abbe1ee9a731d2913bc1b Author: Harry Wentland Date: Tue Jan 4 10:45:41 2022 -0500 drm/amdgpu: Use correct VIEWPORT_DIMENSION for DCN2 For some reason this file isn't using the appropriate register headers for DCN headers, which means that on DCN2 we're getting the VIEWPORT_DIMENSION offset wrong. This means that we're not correctly carving out the framebuffer memory correctly for a framebuffer allocated by EFI and therefore see corruption when loading amdgpu before the display driver takes over control of the framebuffer scanout. Fix this by checking the DCE_HWIP and picking the correct offset accordingly. Long-term we should expose this info from DC as GMC shouldn't need to know about DCN registers. Cc: stable@vger.kernel.org Signed-off-by: Harry Wentland Reviewed-by: Huang Rui Acked-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 15084a8e1658ddaea42c7d3a72ccbcec2b85f54c Author: Tao Zhou Date: Mon Jan 10 15:12:38 2022 +0800 drm/amd/pm: only send GmiPwrDnControl msg on master die (v3) PMFW only returns 0 on master die and sends NACK back on other dies for the message. v2: only send GmiPwrDnControl msg on master die instead of all dies. v3: remove the pointer check for get_socket_id and get_die_id as they should be present on Aldebaran. Signed-off-by: Tao Zhou Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 2096b74b1da5ca418827b54ac4904493bd9de89c Author: Guchun Chen Date: Fri Jan 7 16:31:20 2022 +0800 drm/amdgpu: use spin_lock_irqsave to avoid deadlock by local interrupt This is observed in SRIOV case with virtual KMS as display. _raw_spin_lock_irqsave+0x37/0x40 drm_handle_vblank+0x69/0x350 [drm] ? try_to_wake_up+0x432/0x5c0 ? amdgpu_vkms_prepare_fb+0x1c0/0x1c0 [amdgpu] drm_crtc_handle_vblank+0x17/0x20 [drm] amdgpu_vkms_vblank_simulate+0x4d/0x80 [amdgpu] __hrtimer_run_queues+0xfb/0x230 hrtimer_interrupt+0x109/0x220 __sysvec_apic_timer_interrupt+0x64/0xe0 asm_call_irq_on_stack+0x12/0x20 Fixes: 84ec374bd580 ("drm/amdgpu: create amdgpu_vkms (v4)") Signed-off-by: Guchun Chen Acked-by: Alex Deucher Tested-by: Kelly Zytaruk Signed-off-by: Alex Deucher commit 4eaf21b752891fffab3d51ac96e81194cda32d1c Author: Prike Liang Date: Fri Nov 26 15:12:22 2021 +0800 drm/amdgpu: not return error on the init_apu_flags In some APU project we needn't always assign flags to identify each other, so we may not need return an error. Signed-off-by: Prike Liang Reviewed-by: Alex Deucher Reviewed-by: Huang Rui Signed-off-by: Alex Deucher commit b121862c787c2a84ed5f42597aeeff5c1ead8f5b Author: Felix Kuehling Date: Wed Dec 8 17:51:43 2021 -0500 drm/amdkfd: Use prange->update_list head for remove_list The remove_list head was only used for keeping track of existing ranges that are to be removed from the svms->list. The update_list was used for new or existing ranges that need updated attributes. These two cases are mutually exclusive (i.e. the same range will never be on both lists). Therefore we can use the update_list head to track the remove_list and save another 16 bytes in the svm_range struct. Signed-off-by: Felix Kuehling Reviewed-by: Philip Yang Signed-off-by: Alex Deucher commit ef3b4137aa09a9ad38f42d4de087cedf1b98c521 Author: Felix Kuehling Date: Wed Dec 8 17:33:48 2021 -0500 drm/amdkfd: Use prange->list head for insert_list There are seven list_heads in struct svm_range: list, update_list, remove_list, insert_list, svm_bo_list, deferred_list, child_list. This patch and the next one remove two of them that are redundant. The insert_list head was only used for new ranges that are not on the svms->list yet. So we can use that list head for keeping track of new ranges before they get added, and use list_move_tail to move them to the svms->list when ready. Signed-off-by: Felix Kuehling Reviewed-by: Philip Yang Signed-off-by: Alex Deucher commit 9b7a4de9f126d8c8d59052088213990159417d5b Author: Lukas Bulwahn Date: Thu Dec 16 10:45:03 2021 +0100 drm/amdkfd: make SPDX License expression more sound Commit b5f57384805a ("drm/amdkfd: Add sysfs bitfields and enums to uAPI") adds include/uapi/linux/kfd_sysfs.h with the "GPL-2.0 OR MIT WITH Linux-syscall-note" SPDX-License expression. The command ./scripts/spdxcheck.py warns: include/uapi/linux/kfd_sysfs.h: 1:48 Exception not valid for license MIT: Linux-syscall-note For a uapi header, the file under GPLv2 License must be combined with the Linux-syscall-note, but combining the MIT License with the Linux-syscall-note makes no sense, as the note provides an exception for GPL-licensed code, not for permissively licensed code. So, reorganize the SPDX expression to only combine the note with the GPL License condition. This makes spdxcheck happy again. Fixes: b5f57384805a ("drm/amdkfd: Add sysfs bitfields and enums to uAPI") Signed-off-by: Lukas Bulwahn Reviewed-by: kstewart@linuxfoundation.org Reviewed-by: Felix Kuehling Signed-off-by: Felix Kuehling Signed-off-by: Alex Deucher commit abfaf0eee97925905e742aa3b0b72e04a918fa9e Author: Jiasheng Jiang Date: Wed Jan 5 17:09:43 2022 +0800 drm/amdkfd: Check for null pointer after calling kmemdup As the possible failure of the allocation, kmemdup() may return NULL pointer. Therefore, it should be better to check the 'props2' in order to prevent the dereference of NULL pointer. Fixes: 3a87177eb141 ("drm/amdkfd: Add topology support for dGPUs") Signed-off-by: Jiasheng Jiang Reviewed-by: Felix Kuehling Signed-off-by: Felix Kuehling Signed-off-by: Alex Deucher commit 978ffac878fd64039f95798b15b430032d2d89d5 Author: José Expósito Date: Sun Jan 9 19:42:45 2022 +0100 drm/amd/display: invalid parameter check in dmub_hpd_callback The function performs a check on the "adev" input parameter, however, it is used before the check. Initialize the "dev" variable after the sanity check to avoid a possible NULL pointer dereference. Fixes: e27c41d5b0681 ("drm/amd/display: Support for DMUB HPD interrupt handling") Addresses-Coverity-ID: 1493909 ("Null pointer dereference") Reviewed-by: Harry Wentland Signed-off-by: José Expósito Signed-off-by: Alex Deucher commit 8b5da5a458c95ad49571a6a6285800bf13409616 Author: Rajneesh Bhardwaj Date: Mon Jan 10 12:14:10 2022 -0500 Revert "drm/amdgpu: Don't inherit GEM object VMAs in child process" This reverts commit fbcdbfde87509d523132b59f661a355c731139d0. Reviewed-by: Felix Kuehling Signed-off-by: Rajneesh Bhardwaj Signed-off-by: Alex Deucher commit 83293f7f3d15fc56e86bd5067a2c88b6b233ac3a Author: Mario Limonciello Date: Fri Jan 7 15:40:10 2022 -0600 drm/amd/display: reset dcn31 SMU mailbox on failures Otherwise future commands may fail as well leading to downstream problems that look like they stemmed from a timeout the first time but really didn't. Signed-off-by: Mario Limonciello Reviewed-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher commit 5fea167ec0a134cb61fde848a3c344f77f0c13a5 Author: Greg Kroah-Hartman Date: Thu Jan 6 10:57:13 2022 +0100 drm/amdkfd: use default_groups in kobj_type There are currently 2 ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the amdkfd sysfs code to use default_groups field which has been the preferred way since aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field. Cc: Felix Kuehling Cc: Alex Deucher Cc: "Christian König" Cc: "Pan, Xinhui" Cc: David Airlie Cc: Daniel Vetter Cc: amd-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Alex Deucher commit 7ff61cdcc8609a19f3eddf3fffc09a05ad6d6865 Author: Greg Kroah-Hartman Date: Thu Jan 6 10:56:10 2022 +0100 drm/amdgpu: use default_groups in kobj_type There are currently 2 ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the amdgpu sysfs code to use default_groups field which has been the preferred way since aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field. Cc: Alex Deucher Cc: "Christian König" Cc: "Pan, Xinhui" Cc: David Airlie Cc: Daniel Vetter Cc: Hawking Zhang Cc: John Clements Cc: Felix Kuehling Cc: Jonathan Kim Cc: Kevin Wang Cc: shaoyunl Cc: Tao Zhou Cc: amd-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Alex Deucher commit 4cc9f86f851847e5ebfb56212d81f1a30b9d392b Author: Tom St Denis Date: Fri Jan 7 06:57:41 2022 -0500 drm/amd/amdgpu: Add pcie indirect support to amdgpu_mm_wreg_mmio_rlc() The function amdgpu_mm_wreg_mmio_rlc() is used by debugfs to write to MMIO registers. It didn't support registers beyond the BAR mapped MMIO space. This adds pcie indirect write support. Signed-off-by: Tom St Denis Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 575e55ee4fbc2c641a29b0054b3473e9fa81ae76 Author: Nirmoy Das Date: Fri Jan 7 09:51:15 2022 +0100 drm/amdgpu: recover gart table at resume Get rid off pin/unpin of gart BO at resume/suspend and instead pin only once and try to recover gart content at resume time. This is much more stable in case there is OOM situation at 2nd call to amdgpu_device_evict_resources() while evicting GART table. v3: remove gart recovery from other places v2: pin gart at amdgpu_gart_table_vram_alloc() Reviewed-by: Christian König Signed-off-by: Nirmoy Das Signed-off-by: Alex Deucher commit ec6aae9711a8e5fca24a537b9ae952e38a1ebb71 Author: Nirmoy Das Date: Fri Jan 7 09:51:14 2022 +0100 drm/amdgpu: do not pass ttm_resource_manager to vram_mgr Do not allow exported amdgpu_vram_mgr_*() to accept any ttm_resource_manager pointer. Also there is no need to force other module to call a ttm function just to eventually call vram_mgr functions. v2: pass adev's vram_mgr instead of adev Reviewed-by: Christian König Signed-off-by: Nirmoy Das Signed-off-by: Alex Deucher commit ffb378fb3069520da3c2be3c1269250ec9c028ab Author: Nirmoy Das Date: Fri Jan 7 09:51:13 2022 +0100 drm/amdkfd: remove unused function Remove unused amdgpu_amdkfd_get_vram_usage() CC: Felix.Kuehling@amd.com Signed-off-by: Nirmoy Das Reviewed-by: Christian König Signed-off-by: Alex Deucher Fixes: dfcbe6d5f4a340 ("drm/amdgpu: Remove unused function pointers") commit 1dd8b1b987fad93b647cb0fa5289d69b4c889dc2 Author: Nirmoy Das Date: Fri Jan 7 17:42:28 2022 -0500 drm/amdgpu: do not pass ttm_resource_manager to gtt_mgr Do not allow exported amdgpu_gtt_mgr_*() to accept any ttm_resource_manager pointer. Also there is no need to force other module to call a ttm function just to eventually call gtt_mgr functions. v4: remove unused adev. v3: upcast mgr from ttm resopurce manager instead of getting it from adev. v2: pass adev's gtt_mgr instead of adev. Reviewed-by: Christian König Signed-off-by: Nirmoy Das Signed-off-by: Alex Deucher commit 62d5f9f7110ad374db67ab4820f4ff2d916c3cdb Author: Leslie Shi Date: Wed Jan 5 10:57:20 2022 +0800 drm/amdgpu: Unmap MMIO mappings when device is not unplugged Patch: 3efb17ae7e92 ("drm/amdgpu: Call amdgpu_device_unmap_mmio() if device is unplugged to prevent crash in GPU initialization failure") makes call to amdgpu_device_unmap_mmio() conditioned on device unplugged. This patch unmaps MMIO mappings even when device is not unplugged. v2: Add condition of drm_dev_enter() to deleted unmaps in patch "drm/amdgpu: Unmap all MMIO mappings" Signed-off-by: Leslie Shi Reviewed-by: Andrey Grodzovsky Signed-off-by: Alex Deucher commit 6638391b9f78abaa41f05fe4e0d2ee6f6390c398 Author: Peng Ju Zhou Date: Thu Jan 6 11:52:26 2022 +0800 drm/amdgpu: Enable second VCN for certain Navy Flounder. Certain Navy Flounder cards have 2 VCNs, enable it. Signed-off-by: Peng Ju Zhou Acked-by: Alex Deucher Reviewed-by: Guchun Chen Signed-off-by: Alex Deucher commit 63ad5371cd1e379519395c49a4b6a652c36c98e5 Author: Mario Limonciello Date: Wed Jan 5 12:48:16 2022 -0600 drm/amd/display: explicitly set is_dsc_supported to false before use When UBSAN is enabled a case is shown on unplugging the display that this variable hasn't been initialized by `update_dsc_caps`, presumably when the display was unplugged it wasn't copied from the DPCD. Link: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1956497 Signed-off-by: Mario Limonciello Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit b54ce6c92cf57ff276e4539750c140c9c96416f3 Author: Jiawei Gu Date: Thu Jan 6 17:07:05 2022 +0800 drm/amdgpu: Clear garbage data in err_data before usage Memory of err_data should be cleaned before usage when there're multiple entry in ras ih. Otherwise garbage data from last loop will be used. Signed-off-by: Jiawei Gu Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit 4aa1b8257fba5931511a7e152bcbbb3dd673c6c1 Merge: c288ea679840d fbb3485f1f931 Author: Linus Torvalds Date: Tue Jan 11 12:41:13 2022 -0800 Merge branch 'pcmcia-next' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux Pull pcmcia updates from Dominik Brodowski: "A number of odd cleanups and fixes, including one for a small race in the handling of the pccardd kernel thread" * 'pcmcia-next' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux: pcmcia: fix setting of kthread task states MAINTAINERS: update PCMCIA tree pcmcia: use sysfs_emit{,_at} for sysfs output pcmcia: make pcmcia_release_io() void, as no-one is interested in return value pcmcia: rsrc_nonstatic: Fix a NULL pointer dereference in nonstatic_find_mem_region() pcmcia: rsrc_nonstatic: Fix a NULL pointer dereference in __nonstatic_find_io_region() pcmcia: comment out unused exca_readw() function pcmcia: Make use of the helper macro SET_NOIRQ_SYSTEM_SLEEP_PM_OPS() pcmcia: clean up dead drivers for CompuLab CM-X255/CM-X270 boards commit 8cd778650ae223cd306588042b55d0290ef81037 Author: Kelvin Cao Date: Thu Dec 23 17:23:34 2021 -0800 ntb_hw_switchtec: Fix a minor issue in config_req_id_table() The req_id_table_size field is 16-bit wide, use ioread16() to read the value. Signed-off-by: Kelvin Cao Signed-off-by: Jon Mason commit 1d3cfc2835c1754d19a743dc346a9e58cf0c07c0 Author: Kelvin Cao Date: Thu Dec 23 17:23:33 2021 -0800 ntb_hw_switchtec: Remove code for disabling ID protection ID protection is a firmware setting for NT window access control. With it enabled, only the posted requests with requester IDs in the requester ID table will be allowed to access the NT windows. Otherwise all posted requests are allowed. Normally user will configure it statically via the Switchtec config file, and it will take effect when the firmware boots up. The driver can also toggle the ID protection setting dynamically, which will overwrite the static setting in the Switchtec config file as a side effect. Currently, the driver disables the ID protection. However, it's not necessary to disable the ID protection at the driver level as the driver has already configured the proper requester IDs in the requester ID table to allow the corresponding posted requests to hit the NT windows. Remove the code that disables the ID protection to make the static setting prevail. Note: ID protection is not applicable to non-posted requests. Signed-off-by: Kelvin Cao Signed-off-by: Jon Mason commit 2f58265e163df2dc3f49118bcb38771b66f7e979 Author: Kelvin Cao Date: Thu Dec 23 17:23:32 2021 -0800 ntb_hw_switchtec: Update the way of getting VEP instance ID Gen4 firmware adds DMA VEP and NVMe VEP support in VEP (virtual EP) instance ID register in addtion to management EP. Update the way of getting management VEP instance ID. Signed-off-by: Kelvin Cao Signed-off-by: Jon Mason commit 857e239c3ef57e6ba0ff148de96e14249a4d669b Author: Jeremy Pallotta Date: Thu Dec 23 17:23:31 2021 -0800 ntb_hw_switchtec: AND with the part_map for a valid tpart_vec Some firmware versions return 1 in the target partition vector for undefined partitions. AND with the part_map to give a valid tpart_vec. Signed-off-by: Jeremy Pallotta Signed-off-by: Kelvin Cao Signed-off-by: Jon Mason commit 7ff351c86b6b258f387502ab2c9b9d04f82c1c3d Author: Wesley Sheng Date: Thu Dec 23 17:23:30 2021 -0800 ntb_hw_switchtec: Fix bug with more than 32 partitions Switchtec could support as mush as 48 partitions, but ffs & fls are for 32 bit argument, in case of partition index larger than 31, the current code could not parse the peer partition index correctly. Change to the 64 bit version __ffs64 & fls64 accordingly to fix this bug. Fixes: 3df54c870f52 ("ntb_hw_switchtec: Allow using Switchtec NTB in multi-partition setups") Signed-off-by: Wesley Sheng Signed-off-by: Kelvin Cao Signed-off-by: Jon Mason commit 32c3d375b0ed84b6acb51ae5ebef35ff0d649d85 Author: Jeremy Pallotta Date: Thu Dec 23 17:23:29 2021 -0800 ntb_hw_switchtec: Fix pff ioread to read into mmio_part_cfg_all Array mmio_part_cfg_all holds the partition configuration of all partitions, with partition number as index. Fix this by reading into mmio_part_cfg_all for pff. Fixes: 0ee28f26f378 ("NTB: switchtec_ntb: Add link management") Signed-off-by: Jeremy Pallotta Signed-off-by: Kelvin Cao Signed-off-by: Jon Mason commit 78c5335b1aa6a2ba60dbad7e5bf10b3ef517c18a Author: Randy Dunlap Date: Wed Dec 22 16:48:02 2021 -0800 ntb_hw_switchtec: fix the spelling of "its" Use the possessive "its" instead of the contraction "it's" (it is) in user messages. Signed-off-by: Randy Dunlap Cc: Kurt Schwemmer Reviewed-by: Logan Gunthorpe Signed-off-by: Jon Mason commit e70dc094265c0418bbd895d9657611ac8d509a1c Author: Yang Li Date: Wed Dec 22 09:55:13 2021 +0800 NTB/msi: Fix ntbm_msi_request_threaded_irq() kernel-doc comment Add the description of @msi_desc and change the @devname to @name in ntbm_msi_request_threaded_irq() kernel-doc comment to remove some warnings found by running scripts/kernel-doc, which is caused by using 'make W=1'. drivers/ntb/msi.c:285: warning: Function parameter or member 'name' not described in 'ntbm_msi_request_threaded_irq' drivers/ntb/msi.c:285: warning: Function parameter or member 'msi_desc' not described in 'ntbm_msi_request_threaded_irq' drivers/ntb/msi.c:285: warning: Excess function parameter 'devname' description in 'ntbm_msi_request_threaded_irq' Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Jon Mason commit 0d5924ec4b89613910366c890305e46821a31f01 Author: Sanjay R Mehta Date: Fri Dec 17 03:56:20 2021 -0600 ntb_hw_amd: Add NTB PCI ID for new gen CPU Add NTB support for new generation of processor Signed-off-by: Sanjay R Mehta Signed-off-by: Jon Mason commit c288ea679840de4dee2ce6da5d0f139e3774ad86 Merge: 1151e3cd5a737 ffe31c9ed35d7 Author: Linus Torvalds Date: Tue Jan 11 12:31:35 2022 -0800 Merge tag 'gpio-updates-for-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux Pull gpio updates from Bartosz Golaszewski: "The gpio-sim module is back, this time without any changes to configfs. This results in a less elegant user-space interface but I never got any follow-up on the committable items and didn't want to delay this module for several more months. Other than that we have support for several new models and some support going away. We started working on converting GPIO drivers to using fwnode exclusively in order to limit references to OF symbols to gpiolib-of.c exclusively. We also have regular tweaks and improvements all over the place. Summary: - new testing module: gpio-sim that is scheduled to replace gpio-mockup - initial changes aiming at converting all GPIO drivers to using the fwnode interface and limiting any references to OF symbols to gpiolib-of.c - add support for Tegra234 and Tegra241 to gpio-tegra186 - add support for new models (SSD201 and SSD202D) to gpio-msc313 - add basic support for interrupts to gpio-aggregator - add support for AMDIF031 HID device to gpio-amdpt - drop support for unused platforms in gpio-xlp - cleanup leftovers from the removal of the legacy Samsung Exynos GPIO driver - use raw spinlocks in gpio-aspeed and gpio-aspeed-sgpio to make PREEMPT_RT happy - generalize the common 'ngpios' device property by reading it in the core gpiolib code so that we can remove duplicate reads from drivers - allow line names from device properties to override names set by drivers - code shrink in gpiod_add_lookup_table() - add new model to the DT bindings for gpio-vf610 - convert DT bindings for tegra devices to YAML - improvements to interrupt handling in gpio-rcar and gpio-rockchip - updates to intel drivers from Andy (details in the merge commit) - some minor tweaks, improvements and coding-style fixes all around the subsystem" * tag 'gpio-updates-for-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: (59 commits) gpio: rcar: Propagate errors from devm_request_irq() gpio: rcar: Use platform_get_irq() to get the interrupt gpio: ts5500: Use platform_get_irq() to get the interrupt gpio: dwapb: Switch to use fwnode instead of of_node gpiolib: acpi: make fwnode take precedence in struct gpio_chip dt-bindings: gpio: samsung: drop unused bindings gpio: max3191x: Use bitmap_free() to free bitmap gpio: regmap: Switch to use fwnode instead of of_node gpio: tegra186: Add support for Tegra241 dt-bindings: gpio: Add Tegra241 support gpio: brcmstb: Use local variable to access OF node gpio: Remove unused local OF node pointers gpio: sim: add missing fwnode_handle_put() in gpio_sim_probe() gpio: msc313: Add support for SSD201 and SSD202D gpio: msc313: Code clean ups dt-bindings: gpio: msc313: Add offsets for ssd20xd dt-bindings: gpio: msc313: Add compatible for ssd20xd gpio: sim: fix uninitialized ret variable gpio: Propagate firmware node from a parent device gpio: Setup parent device and get rid of unnecessary of_node assignment ... commit 1151e3cd5a7375ebc839ad3e6c51d87700fe019e Merge: 1cc8d14c412cf 356f3f2c5756b Author: Linus Torvalds Date: Tue Jan 11 12:27:04 2022 -0800 Merge tag 'mmc-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc Pull MMC updates from Ulf Hansson: "MMC core: - Use common polling loop for CMD1 - Add support for DT compatibles for card quirks and use it for ti,wl1251 - Fixup storing of the OCR mask for MMC_QUIRK_NONSTD_SDIO MMC host: - dw_mmc: Add support for MMC_GEN_CMDs - dw_mmc: Fixup calculation of the data timeout - dw_mmc-exynos: Add support for the ARTPEC-8 variant - jz4740: Add support for bi-directional DMA channels - mmci: Add support for eMMC HS200 mode for the stm32 sdmmc variant - mmci: Add support for stm32 sdmmc variant revision v2.2 - mtk-sd: A couple of various minor improvements - omap_hsmmc: Drop redundant initialization for the ti,wl1251 chip - sdhci-esdhc-imx: Add support for the i.MXRT series variant - sdhci-esdhc-imx: Add Haibo Chen as maintainer - sdhci-pci: Add support for the Intel ADL variant - sdhci-pci-gli: GL975[50]: Add support for the Apple ARM64 variant - sdhci-pci-o2micro: Improve support for SDR104/HS200" * tag 'mmc-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: (54 commits) dt-bindings: mmc: synopsys-dw-mshc: integrate Altera and Imagination mmc: pwrseq: Use bitmap_free() to free bitmap dt-bindings: mmc: PL18x stop relying on order of dma-names dt-bindings: mmc: sdhci-msm: Add compatible string for msm8994 mmc: au1xmmc: propagate errors from platform_get_irq() mmc: sdhci-pci-o2micro: Restore the SD clock's base clock frequency mmc: sdhci-pci-o2micro: Improve card input timing at SDR104/HS200 mode mmc: mtk-sd: Assign src_clk parent to src_clk_cg for legacy DTs mmc: mtk-sd: Fix usage of devm_clk_get_optional() mmc: mtk-sd: Take action for no-sdio device-tree parameter mmc: mtk-sd: Use BIT() and GENMASK() macros to describe fields mmc: mtk-sd: Use readl_poll_timeout instead of open-coded polling MAINTAINERS: Add i.MX sdhci maintainer mmc: jz4740: Support using a bi-directional DMA channel dt-bindings: mmc: ingenic: Support using bi-directional DMA channel mmc: dw_mmc: Do not wait for DTO in case of error mmc: dw_mmc: Add driver callbacks for data read timeout mmc: dw_mmc-exynos: Add support for ARTPEC-8 dt-bindings: mmc: exynos-dw-mshc: Add support for ARTPEC-8 mmc: meson-mx-sdio: add IRQ check ... commit 1cc8d14c412cfb6c4eaad4453c557ff289506741 Merge: fa722ecb93c22 ec961cf324115 Author: Linus Torvalds Date: Tue Jan 11 12:24:20 2022 -0800 Merge tag 'backlight-next-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight Pull backlight updates from Lee Jones: "New Functionality: - Prepare and add support for ACPI enumeration; lp855x_bl Fix-ups: - Use Regmap API to conduct endianess conversions; qcom-wled - Remove superfluous code; qcom-wled - Fix formatting issues; qcom-wled Bug Fixes: - Provide error checking/validation of DT supplied strings; qcom-wled - Request dynamic amount of values when reading from DT; qcom-wled - Fix off-by-one issue when reading from DT; qcom-wled" * tag 'backlight-next-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight: backlight: qcom-wled: Respect enabled-strings in set_brightness backlight: qcom-wled: Remove unnecessary double whitespace backlight: qcom-wled: Provide enabled_strings default for WLED 4 and 5 backlight: qcom-wled: Remove unnecessary 4th default string in WLED3 backlight: qcom-wled: Override default length with qcom,enabled-strings backlight: qcom-wled: Fix off-by-one maximum with default num_strings backlight: qcom-wled: Use cpu_to_le16 macro to perform conversion backlight: qcom-wled: Pass number of elements to read to read_u32_array backlight: qcom-wled: Validate enabled string indices in DT backlight: lp855x: Add support ACPI enumeration backlight: lp855x: Add dev helper variable to lp855x_probe() backlight: lp855x: Move device_config setting out of lp855x_configure() commit fa722ecb93c22f084c9a9913469a940a8f0e1d5b Merge: 282aa44c21708 e565615c54869 Author: Linus Torvalds Date: Tue Jan 11 12:22:06 2022 -0800 Merge tag 'mfd-next-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd Pull MFD updates from Lee Jones: "New Device Support: - Add support for Lakefield PCH to Intel LPSS PCI Remove Device Support: - Remove support for ROHM BD70528 Power Management IC New Functionality: - Add support for SMBus and I2C mode to Dialog DA9062/61 PMIC - Enable I2C4 on Microsoft Surface Go & Go 2 Fix-ups: - Device Tree changes (inc. YAML conversion); maxim,max77686, rohm,bd9571mwv, syscon, brcm,twd, google,cros-ec - Use __maybe_unused instead of #ifery; atmel-flexcom - Allow the Regmap API to handle endianess internally; ntxec - Utilise I2C's .resume_noirq call-back; atmel-flexcom - Remove unused code; ti_am335x_tscadc - Use CPU-id instead of ACPI _HRV to ID variants; intel_soc_pmic_core - Allow device to power-off right from .probe(); tps65910 - Trivial (whitespace, typos, etc); da9063 Bug Fixes: - Fix ordering issues during probe; intel-lpss-acpi - Fix correct clock speed; intel-lpss-pci" * tag 'mfd-next-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (25 commits) mfd: google,cros-ec: Fix property name for MediaTek rpmsg dt-bindings: mfd: Fix typo "DA9093" -> "DA9063" mfd: ntxec: Change return type of ntxec_reg8 from __be16 to u16 mfd: tps65910: Set PWR_OFF bit during driver probe mfd: intel_soc_pmic: Use CPU-id check instead of _HRV check to differentiate variants mfd: intel-lpss: Fix I2C4 not being available on the Microsoft Surface Go & Go 2 dt-bindings: mfd: Add Broadcom's Timer-Watchdog block dt-bindings: mfd: Add Freecom system controller mfd: Kconfig: Change INTEL_SOC_PMIC_CHTDC_TI to bool dt-bindings: mfd: syscon: Add samsung,exynos850-sysreg mfd: da9062: Support SMBus and I2C mode mfd: intel-lpss-pci: Fix clock speed for 38a8 UART mfd: intel-lpss: Fix too early PM enablement in the ACPI ->probe() mfd: ti_am335x_tscadc: Drop the CNTRLREG_TSC_8WIRE macro mfd: stmpe: Support disabling sub-functions mfd: atmel-flexcom: Use .resume_noirq mfd: atmel-flexcom: Remove #ifdef CONFIG_PM_SLEEP dt-bindings: mfd: bd9571mwv: Convert to json-schema mfd: intel-lpss: Add Intel Lakefield PCH PCI IDs dt-bindings: mfd: maxim,max77686: Convert to dtschema ... commit 282aa44c21708835517ffaa31c63ab651248cf5e Merge: fef8dfaea9d6c 19629ae482f18 Author: Linus Torvalds Date: Tue Jan 11 12:19:47 2022 -0800 Merge tag 'spi-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi Pull spi updates from Mark Brown: "This has mostly been a quiet release for the SPI subsystem, almost all cleanups and fixes to existing drivers. A couple of changes that stand out: - Cleanups and support for version specific features in the DesignWare controller. - Removal of support for Netlogic devices from the XLP driver, the platform had previously been removed by MIPS so the support couldn't be used. - Conversion of several DT bindings to YAML format" * tag 'spi-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: (53 commits) spi: don't include ptp_clock_kernel.h in spi.h spi: spi-meson-spifc: Add missing pm_runtime_disable() in meson_spifc_probe spi: atmel: Fix typo spi: dt-bindings: mediatek,spi-mtk-nor: Fix example 'interrupts' property spi: qcom: geni: handle timeout for gpi mode spi: qcom: geni: set the error code for gpi transfer spi: spi-mux: Add reference to spi-peripheral-props.yaml schema spi: ar934x: fix transfer size spi: pxa2xx: Propagate firmware node spi: dw: Propagate firmware node spi: dln2: Propagate firmware node spi: ar934x: fix transfer and word delays spi: uniphier: Fix a bug that doesn't point to private data correctly spi: spi-mtk-nor: add new clock name 'axi' for spi nor spi: atmel,quadspi: Define sama7g5 QSPI spi: atmel,quadspi: Convert to json-schema spi: Fix incorrect cs_setup delay handling dt-bindings: mtd: spi-nor: Add a reference to spi-peripheral-props.yaml spi: dt-bindings: cdns,qspi-nor: Move peripheral-specific properties out spi: dt-bindings: add schema listing peripheral-specific properties ... commit fef8dfaea9d6c444b6c2174b3a2b0fca4d226c5e Merge: 2d7852c379408 bfff546aae50a Author: Linus Torvalds Date: Tue Jan 11 12:17:45 2022 -0800 Merge tag 'regulator-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator Pull regulator updates from Mark Brown: "This has been a fairly quiet release for the regulator API, the main thing has been the addition of helpers for interrupt handling from Matti Vaittinen. We do also have support for quite a few new devices. Summary: - Helpers for trivial interrupt notifications, making it easier for drivers to handle error interrupts. - Support for Dialog DA914x, Maxim MAX2008x, Qualcomm PM8826, PMG1100, and PM8450 and TI TPS68470" * tag 'regulator-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (30 commits) regulator: Add MAX20086-MAX20089 driver dt-bindings: regulators: Add bindings for Maxim MAX20086-MAX20089 regulator: qcom_smd: Align probe function with rpmh-regulator regulator: remove redundant ret variable regulator: qcom-labibb: OCP interrupts are not a failure while disabled regulator: dt-bindings: samsung,s5m8767: Move fixed string BUCK9 to 'properties' regulator: Introduce tps68470-regulator driver drivers/regulator: remove redundant ret variable regulator: fix bullet lists of regulator_ops comment regulator: Fix type of regulator-coupled-max-spread property regulator: maxim,max8973: Document interrupts property regulator: qcom-rpmh: Add support for PM8450 regulators regulator: qcom,rpmh: Add compatible for PM8450 regulator: da9121: Add DA914x binding info regulator: da9121: Remove erroneous compatible from binding regulator: da9121: Add DA914x support regulator: da9121: Prevent current limit change when enabled regulator: qcom-rpmh: Add PMG1110 regulators dt-bindings: regulator: Add compatible for pmg1110 regulator: qcom_spmi: Add pm8226 regulators ... commit bf3c39f5da43499c52d4127b7f2f495b69dfeebf Author: Yang Li Date: Sat Jan 8 13:41:09 2022 +0800 i2c: sh_mobile: remove unneeded semicolon Eliminate the following coccicheck warning: ./drivers/i2c/busses/i2c-sh_mobile.c:849:3-4: Unneeded semicolon Reported-by: Abaci Robot Signed-off-by: Yang Li Reviewed-by: Geert Uytterhoeven Signed-off-by: Wolfram Sang commit 2d7852c3794085920e50e69bd050881d605bd44d Merge: c01d85c2190bf b56a7cbf40c89 Author: Linus Torvalds Date: Tue Jan 11 11:48:51 2022 -0800 Merge tag 'regmap-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap Pull regmap updates from Mark Brown: "A very quiet release for regmap: - Allow a custom _update_bits() operation for devices with no bus. - Fix an issue with creation of the debugfs directory when attaching a device to an existing no device regmap. - A trivial formatting fix" [ The custom _update_bits comit came in earlier through the networking tree that had merged it for its own needs ] * tag 'regmap-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: regmap: debugfs: Fix indentation regmap: Call regmap_debugfs_exit() prior to _init() commit c01d85c2190bf694ccd041e7d19c36eacf005840 Merge: 347708875a2fa 9ce47e43a0f08 Author: Linus Torvalds Date: Tue Jan 11 11:35:28 2022 -0800 Merge tag 'mtd/for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux Pull MTD updates from Miquel Raynal: "MTD core changes: - mtdchar: Prevent unbounded allocation in MEMWRITE ioctl - gen_probe: Use bitmap_zalloc() when applicable - Introduce an expert mode for forensics and debugging purposes - Clear out unregistered devices a bit more - Provide unique name for nvmem device - Remove unused header file - Fixed breaking list in __mtd_del_partition. MTD device changes: - Warn about failure to unregister mtd device in sst25l, mchp48l640, mchp23k256, and dataflash drivers. Raw NAND core changes: - Export nand_read_page_hwecc_oob_first() GPMC memory controller for OMAP2 NAND controller changes: - Add support for AM64 SoC and allow build on K3 platforms - Use a compatible match table when checking for NAND controller - Use platform_get_irq() to get the interrupt Raw NAND controller changes: - OMAP2 NAND controller: - Document the missing 'rb-gpios' DT property - Drop unused variable - Fix force_8bit flag behaviour for DMA mode - Move to exec_op interface - Use platform_get_irq() to get the interrupt - Renesas: - Add new NAND controller driver with its bindings and MAINTAINERS entry - Onenand: - Remove redundant variable ooblen - MPC5121: - Remove unused variable in ads5121_select_chip() - GPMI: - Add ERR007117 protection for nfc_apply_timings - Remove explicit default gpmi clock setting for i.MX6 - Use platform_get_irq_byname() to get the interrupt - Remove unneeded variable - Ingenic: - JZ4740 needs 'oob_first' read page function - Davinci: - Rewrite function description - Avoid duplicated page read - Don't calculate ECC when reading page SPI NOR core changes: - Add Pratyush as SPI NOR co-maintainer. - Flash parameters initialization was done in a spaghetti way. Clean flash parameters initialization. - Rework the flash_info flags and clarify where one should be used. - Initialize all flash parameters based on JESD216 SFDP where possible. Flash parameters and settings that are SFDP discoverable should not be duplicated via flash_info flags at flash declaration. - Remove debugfs entries that duplicate sysfs entries. SPI NOR manufacturer driver changes: - Use late_init() hook in various drivers to make it clear that those flash parameters are either not declared in the JESD216 SFDP standard, or the SFDP tables which define those flash parameters are not defined by the flash. - Fix mtd size for s3an flashes. - Write 2 bytes when disabling Octal DTR mode: 1 byte long transactions are not allowed in 8D-8D-8D mode. Hyperbus changes: - Couple of fixes in Renesas hyperbus rpc-if driver to avoid crash on module remove and for missing check for error value in probe" * tag 'mtd/for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux: (71 commits) mtd: spi-nor: Remove debugfs entries that duplicate sysfs entries mtd: spi-nor: micron-st: write 2 bytes when disabling Octal DTR mode mtd: spi-nor: spansion: write 2 bytes when disabling Octal DTR mode mtd: spi-nor: core: use 2 data bytes for template ops mtd: spi-nor: Constify part specific fixup hooks mtd: spi-nor: core: Remove reference to spi-nor.c mtd: rawnand: gpmi: Use platform_get_irq_byname() to get the interrupt mtd: rawnand: omap_elm: Use platform_get_irq() to get the interrupt mtd: rawnand: omap2: Select GPMC device driver for ARCH_K3 memory: omap-gpmc: Use a compatible match table when checking for NAND controller memory: omap-gpmc: Add support for GPMC on AM64 SoC dt-bindings: memory-controllers: ti,gpmc: Add compatible for AM64 memory: omap-gpmc: Use platform_get_irq() to get the interrupt MAINTAINERS: Add an entry for Renesas NAND controller mtd: rawnand: renesas: Add new NAND controller driver dt-bindings: mtd: renesas: Describe Renesas R-Car Gen3 & RZ/N1 NAND controller mtd: rawnand: gpmi: remove unneeded variable mtd: rawnand: omap2: drop unused variable mtd: rawnand: omap2: fix force_8bit flag behaviour for DMA mode mtd: rawnand: omap2: Add compatible for AM64 SoC ... commit 347708875a2fac81dd99ec826248ec29ac28f441 Merge: 46a67e7648848 3367d1bd738c0 Author: Linus Torvalds Date: Tue Jan 11 11:26:57 2022 -0800 Merge tag 'platform-drivers-x86-v5.17-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: New drivers: - asus-tf103c-dock - intel_crystal_cove_charger - lenovo-yogabook-wmi - simatic-ipc platform-code + led driver + watchdog driver - x86-android-tablets (kernel module to workaround DSDT bugs on these) amd-pmc: - bug-fixes - smar trace buffer support asus-wmi: - support for custom fan curves int3472 (camera info ACPI object for Intel IPU3/SkyCam cameras): - ACPI core + int3472 changes to delay enumeration of camera sensor I2C clients until the PMIC for the sensor has been fully probed - Add support for board data (DSDT info is incomplete) for setting up the tps68470 PMIC used on some boards with these cameras - Add board data for the Microsoft Surface Go (original, v2 and v3) thinkpad_acpi: - various cleanups - support for forced battery discharging (for battery calibration) - support to inhibit battery charging - this includes power_supply core changes to add new APIs for this think_lmi: - enhanced BIOS password support various other small fixes and hardware-id additions" * tag 'platform-drivers-x86-v5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: (78 commits) power: supply: Provide stubs for charge_behaviour helpers platform/x86: x86-android-tablets: Fix GPIO lookup leak on error-exit platform/x86: int3472: Add board data for Surface Go 3 platform/x86: Add Asus TF103C dock driver platform/x86: x86-android-tablets: Add TM800A550L data platform/x86: x86-android-tablets: Add Asus MeMO Pad 7 ME176C data platform/x86: x86-android-tablets: Add Asus TF103C data platform/x86: x86-android-tablets: Add support for preloading modules platform/x86: x86-android-tablets: Add support for registering GPIO lookup tables platform/x86: x86-android-tablets: Add support for instantiating serdevs platform/x86: x86-android-tablets: Add support for instantiating platform-devs platform/x86: x86-android-tablets: Add support for PMIC interrupts platform/x86: x86-android-tablets: Don't return -EPROBE_DEFER from a non probe() function platform/x86: touchscreen_dmi: Remove the Glavey TM800A550L entry platform/x86: touchscreen_dmi: Enable pen support on the Chuwi Hi10 Plus and Pro platform/x86: touchscreen_dmi: Correct min/max values for Chuwi Hi10 Pro (CWI529) tablet platform/x86: Add intel_crystal_cove_charger driver power: supply: fix charge_behaviour attribute initialization platform/x86: intel-uncore-frequency: use default_groups in kobj_type x86/platform/uv: use default_groups in kobj_type ... commit 46a67e764884878b61007c9cea40295d02a24fe1 Merge: 039053c11965a a1ee1c08fcd5a Author: Linus Torvalds Date: Tue Jan 11 11:23:25 2022 -0800 Merge tag 'hsi-for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-hsi Pull HSI update from Sebastian Reichel: - avoid returning free'd object in hsi_new_client error path * tag 'hsi-for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-hsi: HSI: core: Fix return freed object in hsi_new_client commit 039053c11965a33250e75009e37dab8e7580fa4e Merge: 7db48b6b4a03c 25fd330370ac4 Author: Linus Torvalds Date: Tue Jan 11 11:20:27 2022 -0800 Merge tag 'for-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply Pull power supply and reset updates from Sebastian Reichel: "Power-supply core: - introduce "No Battery" health status - use library interpolation - add power_supply_battery_info documentation - migrate power_supply_battery_info to be fully heap allocated making it more obvious that it needs to be free'd manually Drivers: - max77976-charger: new driver - qcom-smbb: add pm8226 charger support - bq25890-charger: support battery temperature readings - ab8500: continue migrating towards using standard core APIs" * tag 'for-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (28 commits) power: supply_core: Pass pointer to battery info power: supply: ab8500: Fix the error handling path of ab8500_charger_probe() power: reset: mt6397: Check for null res pointer power: bq25890: add POWER_SUPPLY_PROP_TEMP power: supply: qcom_smbb: support pm8226 dt-bindings: power: supply: pm8941-charger: add pm8226 power: supply: ab8500: Standardize capacity lookup power: supply: ab8500: Standardize temp res lookup power: supply: ab8500: Standardize CV voltage power: supply: ab8500: Standardize CC current power: supply: ab8500: Make recharge capacity a constant power: supply: ab8500: Standardize termination current power: supply: ab8500: Standardize internal resistance power: supply: ab8500_fg: Init battery data in bind() power: supply: ab8500: Standardize voltages power: supply: ab8500: Standardize technology power: supply: ab8500: Standardize design capacity power: supply: ab8500: Use only one battery type power: supply: ab8500: Drop unused battery types power: supply: ab8500: Standardize operating temperature ... commit 7db48b6b4a03c067159a1dbd8f917453ae3154cb Merge: 26b88fba2ad9b 081c8919b02bc Author: Linus Torvalds Date: Tue Jan 11 11:12:57 2022 -0800 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial Pull trivial tree removal from Jiri Kosina: "Remove any mentions of trivial tree from the documentation and MAINTAINERS. This has been discussed on ksummit-discuss@ some time ago (link is provided in the commit message, together with the reasoning). It's a general agreement that reason for such a tree to exist is currently pretty much non-existent" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: Documentation: remove trivial tree commit 26b88fba2ad9b573b8433926294fe48fbf815deb Merge: 4a110907a1183 cd598d21294e0 Author: Linus Torvalds Date: Tue Jan 11 10:53:57 2022 -0800 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid Pull HID updates from Jiri Kosina: "Highlights: - support for USI style pens (Tero Kristo, Mika Westerberg) - quirk for devices that need inverted X/Y axes (Alistair Francis) - small core code cleanups and deduplication (Benjamin Tissoires) - Apple Magic Keyboard support improvements (José Expósito, Alex Henrie, Benjamin Berg) - locking performance improvement for hidraw code (André Almeida) - PM wakeup support for i2c-hid driver (Matthias Kaehlcke - new driver to support for LetSketch device (Hans de Goede) - proper batter reporting for hid-magicmouse USB-connected devices (José Expósito)" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: (32 commits) HID: magicmouse: Fix an error handling path in magicmouse_probe() HID: address kernel-doc warnings HID: intel-ish-hid: ishtp-fw-loader: Fix a kernel-doc formatting issue HID: intel-ish-hid: ipc: Specify no cache snooping on TGL and ADL HID: hid-uclogic-params: Invalid parameter check in uclogic_params_frame_init_v1_buttonpad HID: hid-uclogic-params: Invalid parameter check in uclogic_params_huion_init HID: hid-uclogic-params: Invalid parameter check in uclogic_params_get_str_desc HID: hid-uclogic-params: Invalid parameter check in uclogic_params_init HID: Add new Letsketch tablet driver HID: apple: Add Magic Keyboard 2021 with fingerprint reader FN key mapping HID: apple: Add 2021 magic keyboard FN key mapping HID: magicmouse: set Magic Trackpad 2021 name HID: magicmouse: set device name when it has been personalized HID: apple: Add 2021 Magic Keyboard with number pad HID: apple: Add 2021 Magic Keyboard with fingerprint reader HID: i2c-hid-of: Expose the touchscreen-inverted properties HID: quirks: Allow inverting the absolute X/Y values HID: hidraw: Replace hidraw device table mutex with a rwsem HID: thrustmaster use swap() to make code cleaner HID: debug: Add USI usages ... commit b579dfe71a6a5c3967ca9ad648673b6ca10ab0d5 Author: Anup Patel Date: Wed Jun 9 17:43:22 2021 +0530 RISC-V: Use SBI SRST extension when available The SBI SRST extension provides a standard way to poweroff and reboot the system irrespective to whether Linux RISC-V S-mode is running natively (HS-mode) or inside Guest/VM (VS-mode). The SBI SRST extension is available in the SBI v0.3 specification. (Refer, https://github.com/riscv/riscv-sbi-doc/releases/tag/v0.3.0-rc1) This patch extends Linux RISC-V SBI implementation to detect and use SBI SRST extension. Signed-off-by: Anup Patel Reviewed-by: Atish Patra Signed-off-by: Palmer Dabbelt commit 4a110907a118346cfafc3aa3a75a632fac11b7a9 Merge: 5c947d0dbae80 00f5117c5f785 Author: Linus Torvalds Date: Tue Jan 11 10:25:36 2022 -0800 Merge tag 'hwmon-for-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging Pull hwmon updates from Guenter Roeck: "New drivers: - PMBus driver for MPS Multi-phase mp5023 - PMBus driver for Delta AHE-50DC fan control module - Driver for NZXT RGB&Fan Controller/Smart Device v2 - Driver for Texas Instruments INA238 - Driver to support X370 Asus WMI - Driver to support B550 Asus WMI Other notable changes: - Cleanup of ntc_thermistor driver, and added support for Samsung 1404-001221 NTC - Improve detection of LM84, MAX1617, and MAX1617A in adm1021 driver - Clean up tmp401 driver, and convert to with_info API - Add support for regulators and IR38060, IR38164 IR38263 to ir38064 PMBus driver - Add support for AMD Family 19h Models 10h-1Fh and A0h-AFh to k10temp driver - Add support for F81966 to f71882fg driver - Add support for ONSEMI N34TS04 to jc42 driver - Clean up and simplify dell-smm driver - Add support for ROG STRIX B550-A/X570-I GAMING to nct6775 driver And various other minor improvements and fixes" * tag 'hwmon-for-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (49 commits) hwmon: (nzxt-smart2) make array detect_fans_report static const hwmon: (xgene-hwmon) Add free before exiting xgene_hwmon_probe hwmon: (nzxt-smart2) Fix "unused function" warning hwmon: (dell-smm) Pack the whole smm_regs struct hwmon: (nct6775) Additional check for ChipID before ASUS WMI usage hwmon: (mr75203) fix wrong power-up delay value hwmon/pmbus: (ir38064) Fix spelling mistake "comaptible" -> "compatible" hwmon/pmbus: (ir38064) Expose a regulator hwmon/pmbus: (ir38064) Add of_match_table hwmon/pmbus: (ir38064) Add support for IR38060, IR38164 IR38263 hwmon: add driver for NZXT RGB&Fan Controller/Smart Device v2. hwmon: (nct6775) add ROG STRIX B550-A/X570-I GAMING hwmon: (pmbus) Add support for MPS Multi-phase mp5023 dt-bindings: add Delta AHE-50DC fan control module hwmon: (pmbus) Add Delta AHE-50DC fan control module driver hwmon: prefix kernel-doc comments for structs with struct hwmon: (ntc_thermistor) Add Samsung 1404-001221 NTC hwmon: (ntc_thermistor) Drop OF dependency hwmon: (dell-smm) Unify i8k_ioctl() and i8k_ioctl_unlocked() hwmon: (dell-smm) Simplify ioctl handler ... commit 5c947d0dbae8038ec1c8b538891f6475350542ee Merge: 6f38be8f2ccd9 5f21d7d283dd8 Author: Linus Torvalds Date: Tue Jan 11 10:21:35 2022 -0800 Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 Pull crypto updates from Herbert Xu: "Algorithms: - Drop alignment requirement for data in aesni - Use synchronous seeding from the /dev/random in DRBG - Reseed nopr DRBGs every 5 minutes from /dev/random - Add KDF algorithms currently used by security/DH - Fix lack of entropy on some AMD CPUs with jitter RNG Drivers: - Add support for the D1 variant in sun8i-ce - Add SEV_INIT_EX support in ccp - PFVF support for GEN4 host driver in qat - Compression support for GEN4 devices in qat - Add cn10k random number generator support" * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (145 commits) crypto: af_alg - rewrite NULL pointer check lib/mpi: Add the return value check of kcalloc() crypto: qat - fix definition of ring reset results crypto: hisilicon - cleanup warning in qm_get_qos_value() crypto: kdf - select SHA-256 required for self-test crypto: x86/aesni - don't require alignment of data crypto: ccp - remove unneeded semicolon crypto: stm32/crc32 - Fix kernel BUG triggered in probe() crypto: s390/sha512 - Use macros instead of direct IV numbers crypto: sparc/sha - remove duplicate hash init function crypto: powerpc/sha - remove duplicate hash init function crypto: mips/sha - remove duplicate hash init function crypto: sha256 - remove duplicate generic hash init function crypto: jitter - add oversampling of noise source MAINTAINERS: update SEC2 driver maintainers list crypto: ux500 - Use platform_get_irq() to get the interrupt crypto: hisilicon/qm - disable qm clock-gating crypto: omap-aes - Fix broken pm_runtime_and_get() usage MAINTAINERS: update caam crypto driver maintainers list crypto: octeontx2 - prevent underflow in get_cores_bmap() ... commit 6f38be8f2ccd9babf04b9b23539108542a59fcb8 Merge: 1be5bdf8cd5a1 87d6576ddf8ac Author: Linus Torvalds Date: Tue Jan 11 10:00:04 2022 -0800 Merge tag 'docs-5.17' of git://git.lwn.net/linux Pull documentation updates from Jonathan Corbet: "This isn't a hugely busy cycle for documentation, but a few significant things still showed up: - A documentation section for ARC processors - Reworked and enhanced KUnit documentation - The ability to pick your own theme for HTML builds; if the default "Read the Docs" theme isn't ugly enough for you, you can now pick an uglier one. - More Chinese translation work Plus the usual assortment of fixes and cleanups" * tag 'docs-5.17' of git://git.lwn.net/linux: (53 commits) scripts: sphinx-pre-install: Fix ctex support on Debian docs: discourage use of list tables docs: 5.Posting.rst: describe Fixes: and Link: tags Documentation: kgdb: Replace deprecated remotebaud docs: automarkup.py: Fix invalid HTML link output and broken URI fragments Documentation: refer to config RANDOMIZE_BASE for kernel address-space randomization Documentation: kgdb: properly capitalize the MAGIC_SYSRQ config docs/zh_CN: Update and fix a couple of typos scripts: sphinx-pre-install: add required ctex dependency Documentation: KUnit: Restyled Frequently Asked Questions Documentation: KUnit: Restyle Test Style and Nomenclature page Documentation: KUnit: Rework writing page to focus on writing tests Documentation: kunit: Reorganize documentation related to running tests Documentation: KUnit: Added KUnit Architecture Documentation: KUnit: Rewrite getting started Documentation: KUnit: Rewrite main page docs/zh_CN: Add zh_CN/accounting/delay-accounting.rst Documentation/sphinx: fix typos of "its" docs/zh_CN: Add sched-domains translation doc: fs: remove bdev_try_to_free_page related doc ... commit 653c3d33893e34e7822b78de6377cbca26231edd Author: Krzysztof Kozlowski Date: Sun Jan 2 12:53:56 2022 +0100 dt-bindings: clock: samsung: convert S5Pv210 to dtschema Convert Samsung S5Pv210 SoC clock controller bindings to DT schema format. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Stephen Boyd Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220102115356.75796-8-krzysztof.kozlowski@canonical.com commit cc190b1f5ac071b12c31052750f1856bd673b980 Author: Krzysztof Kozlowski Date: Sun Jan 2 12:53:55 2022 +0100 dt-bindings: clock: samsung: convert Exynos5410 to dtschema Convert Samsung Exynos5410 SoC clock controller bindings to DT schema format. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Stephen Boyd Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220102115356.75796-7-krzysztof.kozlowski@canonical.com commit 2ae8dab876faf6a069d2dff4dd3e9d38d34779f3 Author: Krzysztof Kozlowski Date: Sun Jan 2 12:53:54 2022 +0100 dt-bindings: clock: samsung: convert Exynos5260 to dtschema Convert Samsung Exynos5260 SoC clock controller bindings to DT schema format. Signed-off-by: Krzysztof Kozlowski Acked-by: Stephen Boyd Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220102115356.75796-6-krzysztof.kozlowski@canonical.com commit c47db13bdf66b32bf2da8e561c13cc1253268b16 Author: Krzysztof Kozlowski Date: Sun Jan 2 12:53:53 2022 +0100 dt-bindings: clock: samsung: extend Exynos7 bindings with UFS The UFS for Exynos7 SoC clock controller requires additional input clocks for the FSYS1 clock controller. Update the bindings to reflect this, at least in theory. In practice, these input clocks are ignored, so it is rather adjusting of bindings to existing DTS, without affecting any real users. I understand that is not how it should be done, though... Signed-off-by: Krzysztof Kozlowski Acked-by: Stephen Boyd Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220102115356.75796-5-krzysztof.kozlowski@canonical.com commit 5de80c3b57eb4a44c1bccf17070c3a62f07bd7df Author: Krzysztof Kozlowski Date: Sun Jan 2 12:53:52 2022 +0100 dt-bindings: clock: samsung: convert Exynos7 to dtschema Convert Samsung Exynos7 SoC clock controller bindings to DT schema format. Signed-off-by: Krzysztof Kozlowski Acked-by: Stephen Boyd Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220102115356.75796-4-krzysztof.kozlowski@canonical.com commit 23652cf52d664b54bb7e7dbb1327966683d6ed7f Author: Krzysztof Kozlowski Date: Sun Jan 2 12:53:51 2022 +0100 dt-bindings: clock: samsung: convert Exynos5433 to dtschema Convert Samsung Exynos5433 SoC clock controller bindings to DT schema format. Signed-off-by: Krzysztof Kozlowski Acked-by: Stephen Boyd Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220102115356.75796-3-krzysztof.kozlowski@canonical.com commit 66bdc2bfdfa5ca8c69a9fe169a23e1c698d26f08 Author: Niklas Söderlund Date: Thu Dec 30 13:33:54 2021 +0100 dt-bindings: i2c: maxim,max96712: Add bindings for Maxim Integrated MAX96712 Add bindings for Maxim Integrated MAX96712 deserializer. The MAX96712 deserializer converts GMSL2 or GMSL1 serial inputs into MIPI CSI-2 D-PHY or C-PHY formatted outputs. Signed-off-by: Niklas Söderlund Reviewed-by: Kieran Bingham Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211230123354.623876-1-niklas.soderlund+renesas@ragnatech.se commit 960616d57eecccb943e76735fbca1790fa0ce31d Author: Rob Herring Date: Thu Jan 6 21:20:26 2022 -0600 dt-bindings: iio: adi,ltc2983: Fix 64-bit property sizes The '/bits/ 64' notation applies the next <> list of values. Another <> list is encoded as 32-bits by default. IOW, each <> list needs to be preceeded with '/bits/ 64'. While the dts format allows this, as a rule we don't mix sizes for DT properties since all size information is lost in the dtb file. Signed-off-by: Rob Herring Acked-by: Jonathan Cameron Reviewed-by: Nuno Sá Link: https://lore.kernel.org/r/20220107032026.2408196-1-robh@kernel.org commit f19638bbd0291e600523e0ea1e868a386d304840 Author: Rob Herring Date: Thu Jan 6 21:04:33 2022 -0600 dt-bindings: power: maxim,max17040: Fix incorrect type for 'maxim,rcomp' The 'maxim,rcomp' is defined as a uint32, but the description and users all say it is uint8-array with 1 or 2 elements. The tools missed checking this case. Signed-off-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20220107030433.2381616-1-robh@kernel.org commit e3a3356d1745befbe62b9f0ada1a38f10a54ff2a Author: Rob Herring Date: Thu Jan 6 12:25:13 2022 -0600 dt-bindings: interrupt-controller: arm,gic-v3: Fix 'interrupts' cell size in example The 2nd example has an interrupts cells size of 4, but the 'interrupts' property has 3 cells. The example should also be separate since the cell size differs in each example. Signed-off-by: Rob Herring Acked-by: Marc Zyngier Link: https://lore.kernel.org/r/20220106182518.1435497-5-robh@kernel.org commit 7b5bfc00e8035fe0369e8944693292cc21f9a41f Author: Rob Herring Date: Thu Jan 6 12:25:12 2022 -0600 dt-bindings: iio/magnetometer: yamaha,yas530: Fix invalid 'interrupts' in example 'interrupts' does not take a phandle, so remove it in the example. Signed-off-by: Rob Herring Acked-by: Jonathan Cameron Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20220106182518.1435497-4-robh@kernel.org commit 9cc9b193d595da2df78853318106a181a3f8c627 Author: Rob Herring Date: Thu Jan 6 12:25:09 2022 -0600 dt-bindings: clock: imx5: Drop clock consumer node from example The example nodes have different sized interrupt cells which is not valid given no interrupt-parent is specified. As provider examples don't need to show the consumer side in the first place, just drop the consumer node. Signed-off-by: Rob Herring Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/20220106182518.1435497-1-robh@kernel.org commit da4b3d88b0862141417f16121f378efffe44240f Author: Rob Herring Date: Thu Jan 6 21:19:04 2022 -0600 dt-bindings: Drop required 'interrupt-parent' 'interrupt-parent' is never required as it can be in a parent node or a parent node itself can be an interrupt provider. Where exactly it lives is outside the scope of a binding schema. Signed-off-by: Rob Herring Acked-by: Lee Jones Acked-by: Bartosz Golaszewski Link: https://lore.kernel.org/r/20220107031905.2406176-1-robh@kernel.org commit 70dfc4177269dc589efef05f128b8d4c61f61056 Author: Rob Herring Date: Thu Jan 6 21:05:13 2022 -0600 dt-bindings: net: ti,dp83869: Drop value on boolean 'ti,max-output-impedance' DT booleans don't have a value and 'ti,max-output-impedance' is defined and used as a boolean. So drop the bogus value in the example. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220107030513.2385482-1-robh@kernel.org commit 434a4010de07b6f5f497f9109aae8cb9868abdc9 Author: Rob Herring Date: Thu Jan 6 21:04:17 2022 -0600 dt-bindings: net: wireless: mt76: Fix 8-bit property sizes The '/bits/ 8' notation applies the next <> list of values. Another <> list is encoded as 32-bits by default. IOW, each <> list needs to be preceeded with '/bits/ 8'. While the dts format allows this, as a rule we don't mix sizes for DT properties since all size information is lost in the dtb file. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220107030419.2380198-1-robh@kernel.org commit 437b168028911c8e622130919e583fb5011bf0a4 Author: Rob Herring Date: Thu Jan 6 21:03:57 2022 -0600 dt-bindings: PCI: snps,dw-pcie-ep: Drop conflicting 'max-functions' schema 'max-functions' is already defined in pci-ep.yaml schema as a uint8 and all users of it expect an uint8. Drop the conflicting schema. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220107030358.2378221-1-robh@kernel.org commit f364d2c622f569a41e513514de4882d5f2f8d986 Author: Rob Herring Date: Thu Jan 6 12:30:36 2022 -0600 dt-bindings: i2c: st,stm32-i2c: Make each example a separate entry Each independent example should be a separate entry. This allows for 'interrupts' to have different cell sizes. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220106183037.1443931-1-robh@kernel.org commit 8b31766c7ac0d231297afc87bef2191c21d304f0 Author: Rob Herring Date: Thu Jan 6 12:25:16 2022 -0600 dt-bindings: net: stm32-dwmac: Make each example a separate entry Each independent example should be a separate entry. This allows for 'interrupts' to have different cell sizes. The first example also has a phandle in 'interrupts', so drop the phandle. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220106182518.1435497-8-robh@kernel.org commit b2d28642d1087e8a95205fa2b1d7453c8723a1ea Author: Rob Herring Date: Wed Jan 5 09:10:09 2022 -0600 dt-bindings: net: Cleanup MDIO node schemas The schemas for MDIO bus nodes range from missing to duplicating everything in mdio.yaml. The MDIO bus node schemas only need to reference mdio.yaml, define any binding specific properties, and define 'unevaluatedProperties: false'. This ensures that MDIO nodes only contain defined properties. With this, any duplicated properties can be removed. Cc: "David S. Miller" Cc: Jakub Kicinski Cc: Maxime Ripard Cc: Chen-Yu Tsai Cc: Vivien Didelot Cc: Florian Fainelli Cc: Vladimir Oltean Cc: Joakim Zhang Cc: Heiner Kallweit Cc: Russell King Cc: Kunihiko Hayashi Cc: Nobuhiro Iwamatsu Cc: Cristian Ciocaltea Cc: "Fernández Rojas" Cc: John Crispin Cc: "G. Jaya Kumaran" Cc: Linus Walleij Cc: Joel Stanley Cc: Bartosz Golaszewski Cc: Oleksij Rempel Cc: Alexandre Torgue Cc: Giuseppe Cavallaro Cc: Jose Abreu Cc: netdev@vger.kernel.org Signed-off-by: Rob Herring Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220105151009.3093506-1-robh@kernel.org commit 343e53754b21ae45530623222aa079fecd3cf942 Author: Christy Lee Date: Fri Jan 7 16:58:54 2022 -0800 bpf: Fix incorrect integer literal used for marking scratched stack. env->scratched_stack_slots is a 64-bit value, we should use ULL instead of UL literal values. Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Christy Lee Acked-by: Song Liu Link: https://lore.kernel.org/r/20220108005854.658596-1-christylee@fb.com Signed-off-by: Alexei Starovoitov commit 1be5bdf8cd5a194d981e65687367b0828c839c37 Merge: 1c824bf768d69 b473a3891c463 Author: Linus Torvalds Date: Tue Jan 11 09:51:26 2022 -0800 Merge tag 'kcsan.2022.01.09a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu Pull KCSAN updates from Paul McKenney: "This provides KCSAN fixes and also the ability to take memory barriers into account for weakly-ordered systems. This last can increase the probability of detecting certain types of data races" * tag 'kcsan.2022.01.09a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu: (29 commits) kcsan: Only test clear_bit_unlock_is_negative_byte if arch defines it kcsan: Avoid nested contexts reading inconsistent reorder_access kcsan: Turn barrier instrumentation into macros kcsan: Make barrier tests compatible with lockdep kcsan: Support WEAK_MEMORY with Clang where no objtool support exists compiler_attributes.h: Add __disable_sanitizer_instrumentation objtool, kcsan: Remove memory barrier instrumentation from noinstr objtool, kcsan: Add memory barrier instrumentation to whitelist sched, kcsan: Enable memory barrier instrumentation mm, kcsan: Enable barrier instrumentation x86/qspinlock, kcsan: Instrument barrier of pv_queued_spin_unlock() x86/barriers, kcsan: Use generic instrumentation for non-smp barriers asm-generic/bitops, kcsan: Add instrumentation for barriers locking/atomics, kcsan: Add instrumentation for barriers locking/barriers, kcsan: Support generic instrumentation locking/barriers, kcsan: Add instrumentation for barriers kcsan: selftest: Add test case to check memory barrier instrumentation kcsan: Ignore GCC 11+ warnings about TSan runtime support kcsan: test: Add test cases for memory barrier instrumentation kcsan: test: Match reordered or normal accesses ... commit 036a05f50bd777134b1955f400e8d24c0149fef4 Author: Toke Høiland-Jørgensen Date: Fri Jan 7 23:11:15 2022 +0100 bpf/selftests: Add check for updating XDP bpf_link with wrong program type Add a check to the xdp_link selftest that the kernel rejects replacing an XDP program with a different program type on link update. v2: - Split this out into its own patch. Signed-off-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/r/20220107221115.326171-3-toke@redhat.com Signed-off-by: Alexei Starovoitov commit 4b27480dcaa71e7ee9f56907e419c6a1511fd2b2 Author: Toke Høiland-Jørgensen Date: Fri Jan 7 23:11:14 2022 +0100 bpf/selftests: convert xdp_link test to ASSERT_* macros Convert the selftest to use the preferred ASSERT_* macros instead of the deprecated CHECK(). v2: - Don't add if statements around checks if they weren't there before. Signed-off-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/r/20220107221115.326171-2-toke@redhat.com Signed-off-by: Alexei Starovoitov commit 382778edc8262b7535f00523e9eb22edba1b9816 Author: Toke Høiland-Jørgensen Date: Fri Jan 7 23:11:13 2022 +0100 xdp: check prog type before updating BPF link The bpf_xdp_link_update() function didn't check the program type before updating the program, which made it possible to install any program type as an XDP program, which is obviously not good. Syzbot managed to trigger this by swapping in an LWT program on the XDP hook which would crash in a helper call. Fix this by adding a check and bailing out if the types don't match. Fixes: 026a4c28e1db ("bpf, xdp: Implement LINK_UPDATE for BPF XDP link") Reported-by: syzbot+983941aa85af6ded1fd9@syzkaller.appspotmail.com Acked-by: Andrii Nakryiko Signed-off-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/r/20220107221115.326171-1-toke@redhat.com Signed-off-by: Alexei Starovoitov commit 1c824bf768d69fce36de748c60c7197a2b838944 Merge: e7d38f16c20bf c438b7d860b4c Author: Linus Torvalds Date: Tue Jan 11 09:38:03 2022 -0800 Merge tag 'lkmm.2022.01.09a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu Pull memory model documentation updates from Paul McKenney: "This series contains documentation and litmus tests for locking, courtesy of Boqun Feng" * tag 'lkmm.2022.01.09a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu: tools/memory-model: litmus: Add two tests for unlock(A)+lock(B) ordering tools/memory-model: doc: Describe the requirement of the litmus-tests directory tools/memory-model: Provide extra ordering for unlock+lock pair on the same CPU commit e7d38f16c20bf2a9b2502bb1d7407360d09a836a Merge: a229327733b86 f80fe66c38d56 Author: Linus Torvalds Date: Tue Jan 11 09:29:44 2022 -0800 Merge tag 'rcu.2022.01.09a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu Pull RCU updates from Paul McKenney: - Documentation updates, perhaps most notably Neil Brown's writeup of the reference-counting analogy to RCU. - Expedited grace-period cleanups. - Remove CONFIG_RCU_FAST_NO_HZ due to lack of valid users. I have asked around, posted a blog entry, and sent this series to LKML without result. - Miscellaneous fixes. - RCU callback offloading updates, perhaps most notably Frederic Weisbecker's updates allowing CPUs booted in the de-offloaded state to be offloaded at runtime. - nolibc fixes from Willy Tarreau and Anmar Faizi, but also including Mark Brown's addition of gettid(). - RCU Tasks Trace fixes, including changes that increase the scalability of call_rcu_tasks_trace() for the BPF folks (Martin Lau and KP Singh). - Various fixes including those from Wander Lairson Costa and Li Zhijian. - Fixes plus addition of tests for the increased call_rcu_tasks_trace() scalability. * tag 'rcu.2022.01.09a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu: (87 commits) rcu/nocb: Merge rcu_spawn_cpu_nocb_kthread() and rcu_spawn_one_nocb_kthread() rcu/nocb: Allow empty "rcu_nocbs" kernel parameter rcu/nocb: Create kthreads on all CPUs if "rcu_nocbs=" or "nohz_full=" are passed rcu/nocb: Optimize kthreads and rdp initialization rcu/nocb: Prepare nocb_cb_wait() to start with a non-offloaded rdp rcu/nocb: Remove rcu_node structure from nocb list when de-offloaded rcu-tasks: Use fewer callbacks queues if callback flood ends rcu-tasks: Use separate ->percpu_dequeue_lim for callback dequeueing rcu-tasks: Use more callback queues if contention encountered rcu-tasks: Avoid raw-spinlocked wakeups from call_rcu_tasks_generic() rcu-tasks: Count trylocks to estimate call_rcu_tasks() contention rcu-tasks: Add rcupdate.rcu_task_enqueue_lim to set initial queueing rcu-tasks: Make rcu_barrier_tasks*() handle multiple callback queues rcu-tasks: Use workqueues for multiple rcu_tasks_invoke_cbs() invocations rcu-tasks: Abstract invocations of callbacks rcu-tasks: Abstract checking of callback lists rcu-tasks: Add a ->percpu_enqueue_lim to the rcu_tasks structure rcu-tasks: Inspect stalled task's trc state in locked state rcu-tasks: Use spin_lock_rcu_node() and friends rcutorture: Combine n_max_cbs from all kthreads in a callback flood ... commit a229327733b86aa585effdb0d27a87b12aa51597 Merge: e9e64f85b416a d12013c80e152 Author: Linus Torvalds Date: Tue Jan 11 09:23:59 2022 -0800 Merge tag 'printk-for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux Pull printk updates from Petr Mladek: - Remove some twists in the console registration code. It does not change the existing behavior except for one corner case. The proper default console (with tty binding) will be registered again even when it has been removed in the meantime. It is actually a bug fix. Anyway, this modified behavior requires some manual interaction. - Optimize gdb extension for huge ring buffers. - Do not use atomic operations for a local bitmap variable. - Update git links in MAINTAINERS. * tag 'printk-for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux: MAINTAIERS/printk: Add link to printk git MAINTAINERS/vsprintf: Update link to printk git tree scripts/gdb: lx-dmesg: read records individually printk/console: Clean up boot console handling in register_console() printk/console: Remove need_default_console variable printk/console: Remove unnecessary need_default_console manipulation printk/console: Rename has_preferred_console to need_default_console printk/console: Split out code that enables default console vsprintf: Use non-atomic bitmap API when applicable commit e9e64f85b416a276329134cd83ef8ad78b95a118 Merge: ea1ca66d3cc07 2a8ab0fbd110d Author: Linus Torvalds Date: Tue Jan 11 09:19:29 2022 -0800 Merge branch 'for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq Pull workqueue updates from Tejun Heo: - The code around workqueue scheduler hooks got reorganized early 2019 which unfortuately introdued a couple subtle and rare race conditions where preemption can mangle internal workqueue state triggering a WARN and possibly causing a stall or at least delay in execution. Frederic fixed both early December and the fixes were sitting in for-5.16-fixes which I forgot to push. They are here now. I'll forward them to stable after they land. - The scheduler hook reorganization has more implicatoins for workqueue code in that the hooks are now more strictly synchronized and thus the interacting operations can become more straight-forward. Lai is in the process of simplifying workqueue code and this pull request contains some of the patches. * 'for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq: workqueue: Remove the cacheline_aligned for nr_running workqueue: Move the code of waking a worker up in unbind_workers() workqueue: Remove schedule() in unbind_workers() workqueue: Remove outdated comment about exceptional workers in unbind_workers() workqueue: Remove the advanced kicking of the idle workers in rebind_workers() workqueue: Remove the outdated comment before wq_worker_sleeping() workqueue: Fix unbind_workers() VS wq_worker_sleeping() race workqueue: Fix unbind_workers() VS wq_worker_running() race workqueue: Upgrade queue_work_on() comment commit ea1ca66d3cc07b00241fcee82328f387359f32f5 Merge: 68514dacf2715 d4296faebd337 Author: Linus Torvalds Date: Tue Jan 11 09:14:37 2022 -0800 Merge branch 'for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup Pull cgroup updates from Tejun Heo: "Nothing too interesting. The only two noticeable changes are a subtle cpuset behavior fix and trace event id field being expanded to u64 from int. Most others are code cleanups" * 'for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: cpuset: convert 'allowed' in __cpuset_node_allowed() to be boolean cgroup/rstat: check updated_next only for root cgroup: rstat: explicitly put loop variant in while cgroup: return early if it is already on preloaded list cgroup/cpuset: Don't let child cpusets restrict parent in default hierarchy cgroup: Trace event cgroup id fields should be u64 cgroup: fix a typo in comment cgroup: get the wrong css for css_alloc() during cgroup_init_subsys() cgroup: rstat: Mark benign data race to silence KCSAN commit 346865f0745357f9f4704614ce1d9a8e6f27dbc4 Author: Longji Guo Date: Fri Dec 3 16:07:58 2021 +0800 x86/PCI: Remove initialization of static variables to false Remove the initialization of pci_ignore_seg to false which is pointless. Link: https://lore.kernel.org/r/20211203080758.962-1-guolongji@uniontech.com Signed-off-by: Longji Guo Signed-off-by: Bjorn Helgaas commit 68514dacf2715d11b91ca50d88de047c086fea9c Author: Jan Kara Date: Mon Jan 10 19:19:23 2022 +0100 select: Fix indefinitely sleeping task in poll_schedule_timeout() A task can end up indefinitely sleeping in do_select() -> poll_schedule_timeout() when the following race happens: TASK1 (thread1) TASK2 TASK1 (thread2) do_select() setup poll_wqueues table with 'fd' write data to 'fd' pollwake() table->triggered = 1 closes 'fd' thread1 is waiting for poll_schedule_timeout() - sees table->triggered table->triggered = 0 return -EINTR loop back in do_select() But at this point when TASK1 loops back, the fdget() in the setup of poll_wqueues fails. So now so we never find 'fd' is ready for reading and sleep in poll_schedule_timeout() indefinitely. Treat an fd that got closed as a fd on which some event happened. This makes sure cannot block indefinitely in do_select(). Another option would be to return -EBADF in this case but that has a potential of subtly breaking applications that excercise this behavior and it happens to work for them. So returning fd as active seems like a safer choice. Suggested-by: Linus Torvalds CC: stable@vger.kernel.org Signed-off-by: Jan Kara Signed-off-by: Linus Torvalds commit 4353594eb0980c80e24ebb20d9c871ff95b3b789 Author: Rajat Jain Date: Tue Dec 21 17:21:05 2021 -0800 PCI: Use DWORD accesses for LTR, L1 SS to avoid erratum Some devices have an erratum such that they only support DWORD accesses to some registers. E.g., this Bayhub O2 device ([VID:DID] = [0x1217:0x8621]) only supports DWORD accesses to LTR latency registers and L1 PM substates control registers: https://github.com/rajatxjain/public_shared/blob/main/OZ711LV2_appnote.pdf The L1 PM substate control registers are DWORD sized, and hence their access in the kernel is already DWORD sized, so we don't need to do anything for them. However, the LTR registers being WORD sized, are in need of a solution. Convert the WORD sized accesses to these registers into DWORD sized accesses while saving and restoring them. Link: https://lore.kernel.org/r/20211222012105.3438916-1-rajatja@google.com Signed-off-by: Rajat Jain Signed-off-by: Bjorn Helgaas commit 560dbc4654fa013fadcbcd9647904051d6fadc11 Author: Ming Wang Date: Sat Jan 8 17:09:37 2022 +0800 misc: pci_endpoint_test: Terminate statement with semicolon Terminate the misc_device->fops assignment statement with a semicolon. Link: https://lore.kernel.org/r/1641632977-6588-1-git-send-email-wangming01@loongson.cn Fixes: 2c156ac71c6b ("misc: Add host side PCI driver for PCI test function device") Signed-off-by: Ming Wang Signed-off-by: Bjorn Helgaas commit 10b1a5a99c6ac42be7a490676aec626fba28b048 Author: Dan Carpenter Date: Tue Jan 11 10:22:32 2022 +0300 ALSA: hda: cs35l41: fix double free on error in probe() If we encounter an error after the kfree(acpi_hw_cfg); then the goto err; will result in a double free. Fixes: 7b2f3eb492da ("ALSA: hda: cs35l41: Add support for CS35L41 in HDA systems") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20220111072232.GG11243@kili Signed-off-by: Takashi Iwai commit 74382e277ae97b4bcfac6f8b61df7a500d392500 Author: Bob Peterson Date: Tue Dec 14 10:40:12 2021 -0500 gfs2: dump inode object for iopen glocks Before this patch, glock dumps would not dump the gl_object for iopen glocks. This information can help us debug problems related to eviction: when AN iopen glock is blocked we can see the status of its underlying inode and its flags, etc. Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher commit ee3fe99ff0a27108ac38d9766ac0e92f5ec35692 Author: Mark Langsdorf Date: Wed Jan 5 11:47:14 2022 -0600 ACPI: SPCR: check if table->serial_port.access_width is too wide If table->serial_port.access_width is more than 29, it causes undefined behavior when ACPI_ACCESS_BIT_WIDTH shifts it to (1 << ((size) + 2)): [ 0.000000] UBSAN: Undefined behaviour in drivers/acpi/spcr.c:114:11 [ 0.000000] shift exponent 102 is too large for 32-bit type 'int' Use the new ACPI_ACCESS_ defines to test that serial_port.access_width is less than 30 and set it to 6 if it is not. Signed-off-by: Mark Langsdorf Signed-off-by: Rafael J. Wysocki commit 69e630016ef4e4a1745310c446f204dc6243e907 Author: Liu Ying Date: Thu Dec 30 12:06:26 2021 +0800 drm/atomic: Check new_crtc_state->active to determine if CRTC needs disable in self refresh mode Actual hardware state of CRTC is controlled by the member 'active' in struct drm_crtc_state instead of the member 'enable', according to the kernel doc of the member 'enable'. In fact, the drm client modeset and atomic helpers are using the member 'active' to do the control. Referencing the member 'enable' of new_crtc_state, the function crtc_needs_disable() may fail to reflect if CRTC needs disable in self refresh mode, e.g., when the framebuffer emulation will be blanked through the client modeset helper with the next commit, the member 'enable' of new_crtc_state is still true while the member 'active' is false, hence the relevant potential encoder and bridges won't be disabled. So, let's check new_crtc_state->active to determine if CRTC needs disable in self refresh mode instead of new_crtc_state->enable. Fixes: 1452c25b0e60 ("drm: Add helpers to kick off self refresh mode in drivers") Cc: Sean Paul Cc: Rob Clark Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: David Airlie Cc: Daniel Vetter Reviewed-by: Alex Deucher Signed-off-by: Liu Ying Signed-off-by: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20211230040626.646807-1-victor.liu@nxp.com commit 2cea3ec5b0099d0e9dd6752aa86e08bce38d6b32 Author: Jiasheng Jiang Date: Fri Jan 7 11:35:16 2022 +0800 ACPI: APD: Check for NULL pointer after calling devm_ioremap() Because devres_alloc() may fail, devm_ioremap() may return NULL. Then, 'clk_data->base' will be assigned to clkdev->data->base in platform_device_register_data(). The PTR_ERR_OR_ZERO() check on clk_data does not cover 'base', so it is better to add an explicit check against NULL after updating it. Fixes: 3f4ba94e3615 ("ACPI: APD: Add AMD misc clock handler support") Signed-off-by: Jiasheng Jiang [ rjw: Changelog rewrite ] Signed-off-by: Rafael J. Wysocki commit 500b55b05d0a21c4adddf4c3b29ee6f32b502046 Author: Bjorn Helgaas Date: Tue Dec 21 10:45:07 2021 -0600 PCI: Work around Intel I210 ROM BAR overlap defect Per PCIe r5, sec 7.5.1.2.4, a device must not claim accesses to its Expansion ROM unless both the Memory Space Enable and the Expansion ROM Enable bit are set. But apparently some Intel I210 NICs don't work correctly if the ROM BAR overlaps another BAR, even if the Expansion ROM is disabled. Michael reported that on a Kontron SMARC-sAL28 ARM64 system with U-Boot v2021.01-rc3, the ROM BAR overlaps BAR 3, and networking doesn't work at all: BAR 0: 0x40000000 (32-bit, non-prefetchable) [size=1M] BAR 3: 0x40200000 (32-bit, non-prefetchable) [size=16K] ROM: 0x40200000 (disabled) [size=1M] NETDEV WATCHDOG: enP2p1s0 (igb): transmit queue 0 timed out Hardware name: Kontron SMARC-sAL28 (Single PHY) on SMARC Eval 2.0 carrier (DT) igb 0002:01:00.0 enP2p1s0: Reset adapter Previously, pci_std_update_resource() wrote the assigned ROM address to the BAR only when the ROM was enabled. This meant that the I210 ROM BAR could be left with an address assigned by firmware, which might overlap with other BARs. Quirk these I210 devices so pci_std_update_resource() always writes the assigned address to the ROM BAR, whether or not the ROM is enabled. Link: https://lore.kernel.org/r/20211223163754.GA1267351@bhelgaas Link: https://lore.kernel.org/r/20201230185317.30915-1-michael@walle.cc Link: https://bugzilla.kernel.org/show_bug.cgi?id=211105 Reported-by: Michael Walle Tested-by: Michael Walle Signed-off-by: Bjorn Helgaas commit 7f7b4236f2040d19df1ddaf30047128b41e78de7 Author: Hans de Goede Date: Fri Dec 17 15:13:48 2021 +0100 x86/PCI: Ignore E820 reservations for bridge windows on newer systems Some BIOS-es contain a bug where they add addresses which map to system RAM in the PCI host bridge window returned by the ACPI _CRS method, see commit 4dc2287c1805 ("x86: avoid E820 regions when allocating address space"). To work around this bug Linux excludes E820 reserved addresses when allocating addresses from the PCI host bridge window since 2010. Recently (2019) some systems have shown-up with E820 reservations which cover the entire _CRS returned PCI bridge memory window, causing all attempts to assign memory to PCI BARs which have not been setup by the BIOS to fail. For example here are the relevant dmesg bits from a Lenovo IdeaPad 3 15IIL 81WE: [mem 0x000000004bc50000-0x00000000cfffffff] reserved pci_bus 0000:00: root bus resource [mem 0x65400000-0xbfffffff window] The ACPI specifications appear to allow this new behavior: The relationship between E820 and ACPI _CRS is not really very clear. ACPI v6.3, sec 15, table 15-374, says AddressRangeReserved means: This range of addresses is in use or reserved by the system and is not to be included in the allocatable memory pool of the operating system's memory manager. and it may be used when: The address range is in use by a memory-mapped system device. Furthermore, sec 15.2 says: Address ranges defined for baseboard memory-mapped I/O devices, such as APICs, are returned as reserved. A PCI host bridge qualifies as a baseboard memory-mapped I/O device, and its apertures are in use and certainly should not be included in the general allocatable pool, so the fact that some BIOS-es reports the PCI aperture as "reserved" in E820 doesn't seem like a BIOS bug. So it seems that the excluding of E820 reserved addresses is a mistake. Ideally Linux would fully stop excluding E820 reserved addresses, but then the old systems this was added for will regress. Instead keep the old behavior for old systems, while ignoring the E820 reservations for any systems from now on. Old systems are defined here as BIOS year < 2018, this was chosen to make sure that E820 reservations will not be used on the currently affected systems, while at the same time also taking into account that the systems for which the E820 checking was originally added may have received BIOS updates for quite a while (esp. CVE related ones), giving them a more recent BIOS year then 2010. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=206459 BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1868899 BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1871793 BugLink: https://bugs.launchpad.net/bugs/1878279 BugLink: https://bugs.launchpad.net/bugs/1931715 BugLink: https://bugs.launchpad.net/bugs/1932069 BugLink: https://bugs.launchpad.net/bugs/1921649 Reviewed-by: Mika Westerberg Acked-by: Bjorn Helgaas Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit d3115128bdafb62628ab41861a4f06f6d02ac320 Author: Lech Perczak Date: Mon Jan 10 23:48:44 2022 +0100 MIPS: ath79: drop _machine_restart again Commit 81424d0ad0d4 ("MIPS: ath79: Use the reset controller to restart OF machines") removed setup of _machine_restart on OF machines to use reset handler in reset controller driver. While removing remnants of non-OF machines in commit 3a77e0d75eed ("MIPS: ath79: drop machfiles"), this was introduced again, making it impossible to use additional restart handlers registered through device tree. Drop setting _machine_restart altogether, and ath79_restart function, which is no longer used after this. Fixes: 3a77e0d75eed ("MIPS: ath79: drop machfiles") Cc: John Crispin Cc: Florian Fainelli Signed-off-by: Lech Perczak Signed-off-by: Thomas Bogendoerfer commit 879cf8006475642b747aaaa4d06f7044ab2de794 Author: Dan Carpenter Date: Tue Jan 11 10:26:58 2022 +0300 regulator: max20086: fix error code in max20086_parse_regulators_dt() This code accidentally returns PTR_ERR(NULL) which is success. It should return a negative error code. Fixes: bfff546aae50 ("regulator: Add MAX20086-MAX20089 driver") Signed-off-by: Dan Carpenter Reviewed-by: Laurent Pinchart Link: https://lore.kernel.org/r/20220111072657.GK11243@kili Signed-off-by: Mark Brown commit a64067f4cecaaa4deed8e33d3266bc0bcc189142 Author: Robert Hancock Date: Fri Jan 7 15:47:10 2022 -0600 ASoC: simple-card: fix probe failure on platform component A previous change to simple-card resulted in asoc_simple_parse_dai attempting to retrieve the dai_name for platform components, which are unlikely to have a valid DAI name. This caused simple-card to fail to probe when using the xlnx_formatter_pcm as the platform component, since it does not register any DAI components. Since the dai_name is not used for platform components, just skip trying to retrieve it for those. Fixes: f107294c6422 ("ASoC: simple-card: support snd_soc_dai_link_component style for cpu") Signed-off-by: Robert Hancock Link: https://lore.kernel.org/r/20220107214711.1100162-6-robert.hancock@calian.com Signed-off-by: Mark Brown commit 68d247ad38b1ef46bd945a5220fa6d28c901c2f2 Author: Helge Deller Date: Tue Jan 11 11:54:48 2022 +0100 parisc: Default to 16 CPUs on 32-bit kernel Qemu currently supports up to 16 CPUs, so increase the default from 4 to 16. Bload-o-meter shows only an increase of 800 bytes with this change. Signed-off-by: Helge Deller commit 16f035d9e264d95d61d5f4056bb00d8169a7a3d1 Author: Helge Deller Date: Fri Jan 7 01:13:02 2022 +0100 sections: Fix __is_kernel() to include init ranges With CONFIG_KALLSYMS_ALL=y, the function is_ksym_addr() is used to determine if a symbol is from inside the kernel range. For that the given symbol address is checked if it's inside the _stext to _end range. Although this is correct, some architectures (e.g. parisc) may have the init area before the _stext address and as such the check in is_ksym_addr() fails. By extending the range check to include the init section, __is_kernel() will now detect symbols in this range as well. This fixes an issue on parisc where addresses of kernel functions in init sections aren't resolved to their symbol names. Signed-off-by: Helge Deller commit e486288d116ab4885e42757de1e0e1ee5541c86e Author: Helge Deller Date: Fri Jan 7 14:16:26 2022 +0100 parisc: Re-use toc_stack as hpmc_stack No need to have an own hpmc_stack. Just re-use the toc_stack of the monarch CPU as either a TOC or a HPMC will happen at the same time. This reduces the kernel memory footprint by 16k. Signed-off-by: Helge Deller commit d6ab9fc74513ae6501afcdae2547334a03b9a5c9 Author: Helge Deller Date: Fri Jan 7 14:05:11 2022 +0100 parisc: Enable TOC (transfer of contents) feature unconditionally Before this patch, the TOC code used a pre-allocated stack of 16kb for each possible CPU. That space overhead was the reason why the TOC feature wasn't enabled by default for 32-bit kernels. This patch rewrites the TOC code to use a per-cpu stack. That way we use much less memory now and as such we enable the TOC feature by default on all kernels. Additionally the dump of the registers and the stacktrace wasn't serialized, which led to multiple CPUs printing the stack backtrace at once which rendered the output unreadable. Now the backtraces are nicely serialized by a lock. Signed-off-by: Helge Deller commit aa8589aac8e335e5e2e9a9de72a53913892e92f9 Author: Jim Quinlan Date: Thu Dec 9 15:47:25 2021 -0500 PCI: brcmstb: Augment driver for MIPs SOCs The current brcmstb driver works for Arm and Arm64. A few things are modified here for us to support MIPs as well. o There are four outbound range register groups and each directs a window of up to 128MB. Even though there are four 128MB DT "ranges" in the bmips PCIe DT node, these ranges are contiguous and are collapsed into a single range by the OF range parser. Now the driver assumes a single range -- for MIPs only -- and splits it back into 128MB sizes. o For bcm7425, the config space accesses must be 32-bit reads or writes. In addition, the 4k config space register array is missing and not used. o The registers for the upper 32-bits of the outbound window address do not exist. o Burst size must be set to 256 (this refers to an internal bus). Signed-off-by: Jim Quinlan Acked-by: Florian Fainelli Signed-off-by: Thomas Bogendoerfer commit d552ddeaab4a15a8dc157ac007833aa0b3706862 Author: Jim Quinlan Date: Thu Dec 9 15:47:24 2021 -0500 MIPS: bmips: Remove obsolete DMA mapping support The code in 'arch/mips/bmips/dma.c' performed DMA mapping for inbound regions. This mapping was and is required for the Broadcom STB PCIe controller HW. This code is removed as the current 'struct device' has a @dma_range_map field which performs the same functionality by processing the "dma-ranges" DT property. Subsequently, ARCH_HAS_PHYS_TO_DMA is now unset since the dma_to_phys() and phys_to_dma() functions are removed. Signed-off-by: Jim Quinlan Acked-by: Florian Fainelli Signed-off-by: Thomas Bogendoerfer commit 6fffb01e3b78ba3a38baf49c1dc7eeb5edfd5818 Author: Jim Quinlan Date: Thu Dec 9 15:47:23 2021 -0500 MIPS: bmips: Add support PCIe controller device nodes For Broadcom STB PCIe HW. The 7425 and 7435 are MIPs-based SOCs. Not much difference between the two for the DT properties except that they have slightly different PCIe interrupt assignments. Signed-off-by: Jim Quinlan Acked-by: Florian Fainelli Signed-off-by: Thomas Bogendoerfer commit 145790e55d82e30182f48b0b94149ba41e3aabcc Author: Jim Quinlan Date: Thu Dec 9 15:47:22 2021 -0500 dt-bindings: PCI: Add compatible string for Brcmstb 74[23]5 MIPs SOCs The Broadcom STB Arm and MIPs SOCs use the same PCIe controller HW, although the MIPs version is older. Signed-off-by: Jim Quinlan Acked-by: Florian Fainelli Acked-by: Rob Herring Signed-off-by: Thomas Bogendoerfer commit a59466ee91aaa9d43889a4c51e01de087d188448 Author: Karolina Drobnik Date: Tue Jan 11 10:28:47 2022 +0000 memblock: Remove #ifdef __KERNEL__ from memblock.h memblock.h is not a uAPI header, so __KERNEL__ guard can be deleted Signed-off-by: Karolina Drobnik Signed-off-by: Mike Rapoport Link: https://lore.kernel.org/r/20220111102847.673746-1-karolinadrobnik@gmail.com commit c71af3dae3e34d2fde0c19623cf7f8483321f0e3 Author: Miaoqian Lin Date: Fri Jan 7 08:36:32 2022 +0000 drm/sun4i: dw-hdmi: Fix missing put_device() call in sun8i_hdmi_phy_get The reference taken by 'of_find_device_by_node()' must be released when not needed anymore. Add the corresponding 'put_device()' in the error handling path. Fixes: 9bf3797796f5 ("drm/sun4i: dw-hdmi: Make HDMI PHY into a platform device") Signed-off-by: Miaoqian Lin Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20220107083633.20843-1-linmq006@gmail.com commit 1e9d74660d4df625b0889e77018f9e94727ceacd Author: Yafang Shao Date: Sat Jan 8 13:46:23 2022 +0000 bpf: Fix mount source show for bpffs We noticed our tc ebpf tools can't start after we upgrade our in-house kernel version from 4.19 to 5.10. That is because of the behaviour change in bpffs caused by commit d2935de7e4fd ("vfs: Convert bpf to use the new mount API"). In our tc ebpf tools, we do strict environment check. If the environment is not matched, we won't allow to start the ebpf progs. One of the check is whether bpffs is properly mounted. The mount information of bpffs in kernel-4.19 and kernel-5.10 are as follows: - kernel 4.19 $ mount -t bpf bpffs /sys/fs/bpf $ mount -t bpf bpffs on /sys/fs/bpf type bpf (rw,relatime) - kernel 5.10 $ mount -t bpf bpffs /sys/fs/bpf $ mount -t bpf none on /sys/fs/bpf type bpf (rw,relatime) The device name in kernel-5.10 is displayed as none instead of bpffs, then our environment check fails. Currently we modify the tools to adopt to the kernel behaviour change, but I think we'd better change the kernel code to keep the behavior consistent. After this change, the mount information will be displayed the same with the behavior in kernel-4.19, for example: $ mount -t bpf bpffs /sys/fs/bpf $ mount -t bpf bpffs on /sys/fs/bpf type bpf (rw,relatime) Fixes: d2935de7e4fd ("vfs: Convert bpf to use the new mount API") Suggested-by: Daniel Borkmann Signed-off-by: Yafang Shao Signed-off-by: Daniel Borkmann Acked-by: Christian Brauner Cc: David Howells Cc: Al Viro Link: https://lore.kernel.org/bpf/20220108134623.32467-1-laoar.shao@gmail.com commit cf46eacbc156a82d6643eb10afe8969abad5a35f Author: Pablo Neira Ayuso Date: Tue Jan 11 10:40:30 2022 +0100 netfilter: nf_tables: remove unused variable > Remove unused variable and fix missing initialization. > > >> net/netfilter/nf_tables_api.c:8266:6: warning: variable 'i' set but not used [-Wunused-but-set-variable] > int i; > ^ Fixes: 2c865a8a28a1 ("netfilter: nf_tables: add rule blob layout") Reported-by: kernel test robot Signed-off-by: Pablo Neira Ayuso commit 0e906607b9c5ee22312c9af4d8adb45c617ea38a Author: Florian Westphal Date: Fri Jan 7 15:51:38 2022 +0100 netfilter: nf_conntrack_netbios_ns: fix helper module alias The helper gets registered as 'netbios-ns', not netbios_ns. Intentionally not adding a fixes-tag because i don't want this to go to stable. This wasn't noticed for a very long time so no so no need to risk regressions. Reported-by: Yi Chen Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit d47c7407b4c88cf66098eba8893bc38279f301fc Merge: 663d8fb0f84c0 547d2167c5c3c Author: Greg Kroah-Hartman Date: Tue Jan 11 10:22:25 2022 +0100 Merge tag 'gnss-5.17-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/gnss into char-misc-next Johan writes: GNSS updates for 5.17-rc1 Here are the GNSS updates for 5.17-rc1, including: - support for GNSS receivers with USB interface - support for Sierra Wireless XM1210 All have been in linux-next with no reported issues. * tag 'gnss-5.17-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/gnss: gnss: usb: add support for Sierra Wireless XM1210 gnss: add USB support gnss: drop stray semicolons commit 19d1c32652bbbf406063025354845fdddbcecd3a Author: Dominique Martinet Date: Mon Jan 10 20:10:31 2022 +0900 9p: fix enodata when reading growing file Reading from a file that was just extended by a write, but the write had not yet reached the server would return ENODATA as illustrated by this command: $ xfs_io -c 'open -ft test' -c 'w 4096 1000' -c 'r 0 1000' wrote 1000/1000 bytes at offset 4096 1000.000000 bytes, 1 ops; 0.0001 sec (5.610 MiB/sec and 5882.3529 ops/sec) pread: No data available Fix this case by having netfs assume zeroes when reads from server come short like AFS and CEPH do Link: https://lkml.kernel.org/r/20220110111444.926753-1-asmadeus@codewreck.org Cc: stable@vger.kernel.org Fixes: eb497943fa21 ("9p: Convert to using the netfs helper lib to do reads and caching") Co-authored-by: David Howells Reviewed-by: David Howells Tested-by: David Howells Signed-off-by: Dominique Martinet commit 7d6019b602de660bfc6a542a68630006ace83b90 Author: Saeed Mahameed Date: Mon Jan 10 12:52:46 2022 -0800 Revert "net: vertexcom: default to disabled on kbuild" This reverts commit 6bf950a8ff72920340dfdec93c18bd3f5f35de6a. To align with other vendors, NET_VENDOR configs are supposed to be ON by default, while their drivers should default to OFF. Suggested-by: Jakub Kicinski Signed-off-by: Saeed Mahameed Link: https://lore.kernel.org/r/20220110205246.66298-1-saeed@kernel.org Signed-off-by: Jakub Kicinski commit 51edb2ff1c6fc27d3fa73f0773a31597ecd8e230 Author: Pablo Neira Ayuso Date: Mon Jan 10 20:48:17 2022 +0100 netfilter: nf_tables: typo NULL check in _clone() function This should check for NULL in case memory allocation fails. Reported-by: Julian Wiedmann Fixes: 3b9e2ea6c11b ("netfilter: nft_limit: move stateful fields out of expression data") Fixes: 37f319f37d90 ("netfilter: nft_connlimit: move stateful fields out of expression data") Fixes: 33a24de37e81 ("netfilter: nft_last: move stateful fields out of expression data") Fixes: ed0a0c60f0e5 ("netfilter: nft_quota: move stateful fields out of expression data") Signed-off-by: Pablo Neira Ayuso Link: https://lore.kernel.org/r/20220110194817.53481-1-pablo@netfilter.org Signed-off-by: Jakub Kicinski commit fe8152b38d3a994c4c6fdbc0cd6551d569a5715a Merge: fe2437ccbd278 3a571fc19673b Author: Linus Torvalds Date: Mon Jan 10 20:48:19 2022 -0800 Merge tag 'devprop-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull device properties framework updates from Rafael Wysocki: "These update the handling of software nodes and graph properties, and the MAINTAINERS entry for the former. Specifics: - Remove device_add_properties() which does not work correctly if software nodes holding additional device properties are shared or reused (Heikki Krogerus). - Fix nargs_prop property handling for software nodes (Clément Léger). - Update documentation of ACPI device properties (Sakari Ailus). - Update the handling of graph properties in the generic framework to match the DT case (Sakari Ailus). - Update software nodes entry in MAINTAINERS (Andy Shevchenko)" * tag 'devprop-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: software node: Update MAINTAINERS data base software node: fix wrong node passed to find nargs_prop device property: Drop fwnode_graph_get_remote_node() device property: Use fwnode_graph_for_each_endpoint() macro device property: Implement fwnode_graph_get_endpoint_count() Documentation: ACPI: Update references Documentation: ACPI: Fix data node reference documentation device property: Fix documentation for FWNODE_GRAPH_DEVICE_DISABLED device property: Fix fwnode_graph_devcon_match() fwnode leak device property: Remove device_add_properties() API driver core: Don't call device_remove_properties() from device_del() PCI: Convert to device_create_managed_software_node() commit fe2437ccbd278af683d32196fdea59a3b95f144e Merge: b35b6d4d71365 fff489ff0722b Author: Linus Torvalds Date: Mon Jan 10 20:43:54 2022 -0800 Merge tag 'thermal-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull thermal control updates from Rafael Wysocki: "These add a new driver for Renesas RZ/G2L TSU, update a few existing thermal control drivers and clean up the tmon utility. Specifics: - Add new TSU driver and DT bindings for the Renesas RZ/G2L platform (Biju Das). - Fix missing check when calling reset_control_deassert() in the rz2gl thermal driver (Biju Das). - In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memcpy(), avoid intentionally writing across neighboring fields in the int340x thermal control driver (Kees Cook). - Fix RFIM mailbox write commands handling in the int340x thermal control driver (Sumeet Pawnikar). - Fix PM issue occurring in the iMX thermal control driver during suspend/resume by implementing PM runtime support in it (Oleksij Rempel). - Add 'const' annotation to thermal_cooling_ops in the Intel powerclamp driver (Rikard Falkeborn). - Fix missing ADC bit set in the iMX8MP thermal driver to enable the sensor (Paul Gerber). - Drop unused local variable definition from tmon (ran jianping)" * tag 'thermal-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: thermal/drivers/int340x: Fix RFIM mailbox write commands thermal/drivers/rz2gl: Add error check for reset_control_deassert() thermal/drivers/imx8mm: Enable ADC when enabling monitor thermal/drivers: Add TSU driver for RZ/G2L dt-bindings: thermal: Document Renesas RZ/G2L TSU thermal/drivers/intel_powerclamp: Constify static thermal_cooling_device_ops thermal/drivers/imx: Implement runtime PM support thermal: tools: tmon: remove unneeded local variable thermal: int340x: Use struct_group() for memcpy() region commit b35b6d4d71365fbfb6f2cc8edc331b3882ca817e Merge: bca21755b9fc0 78e6e4dfd8f0c Author: Linus Torvalds Date: Mon Jan 10 20:34:00 2022 -0800 Merge tag 'pm-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull power management updates from Rafael Wysocki: "The most signigicant change here is the addition of a new cpufreq 'P-state' driver for AMD processors as a better replacement for the venerable acpi-cpufreq driver. There are also other cpufreq updates (in the core, intel_pstate, ARM drivers), PM core updates (mostly related to adding new macros for declaring PM operations which should make the lives of driver developers somewhat easier), and a bunch of assorted fixes and cleanups. Summary: - Add new P-state driver for AMD processors (Huang Rui). - Fix initialization of min and max frequency QoS requests in the cpufreq core (Rafael Wysocki). - Fix EPP handling on Alder Lake in intel_pstate (Srinivas Pandruvada). - Make intel_pstate update cpuinfo.max_freq when notified of HWP capabilities changes and drop a redundant function call from that driver (Rafael Wysocki). - Improve IRQ support in the Qcom cpufreq driver (Ard Biesheuvel, Stephen Boyd, Vladimir Zapolskiy). - Fix double devm_remap() in the Mediatek cpufreq driver (Hector Yuan). - Introduce thermal pressure helpers for cpufreq CPU cooling (Lukasz Luba). - Make cpufreq use default_groups in kobj_type (Greg Kroah-Hartman). - Make cpuidle use default_groups in kobj_type (Greg Kroah-Hartman). - Fix two comments in cpuidle code (Jason Wang, Yang Li). - Allow model-specific normal EPB value to be used in the intel_epb sysfs attribute handling code (Srinivas Pandruvada). - Simplify locking in pm_runtime_put_suppliers() (Rafael Wysocki). - Add safety net to supplier device release in the runtime PM core code (Rafael Wysocki). - Capture device status before disabling runtime PM for it (Rafael Wysocki). - Add new macros for declaring PM operations to allow drivers to avoid guarding them with CONFIG_PM #ifdefs or __maybe_unused and update some drivers to use these macros (Paul Cercueil). - Allow ACPI hardware signature to be honoured during restore from hibernation (David Woodhouse). - Update outdated operating performance points (OPP) documentation (Tang Yizhou). - Reduce log severity for informative message regarding frequency transition failures in devfreq (Tzung-Bi Shih). - Add DRAM frequency controller devfreq driver for Allwinner sunXi SoCs (Samuel Holland). - Add missing COMMON_CLK dependency to sun8i devfreq driver (Arnd Bergmann). - Add support for new layout of Psys PowerLimit Register on SPR to the Intel RAPL power capping driver (Zhang Rui). - Fix typo in a comment in idle_inject.c (Jason Wang). - Remove unused function definition from the DTPM (Dynamit Thermal Power Management) power capping framework (Daniel Lezcano). - Reduce DTPM trace verbosity (Daniel Lezcano)" * tag 'pm-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (53 commits) x86, sched: Fix undefined reference to init_freq_invariance_cppc() build error cpufreq: amd-pstate: Fix Kconfig dependencies for AMD P-State cpufreq: amd-pstate: Fix struct amd_cpudata kernel-doc comment cpuidle: use default_groups in kobj_type x86: intel_epb: Allow model specific normal EPB value MAINTAINERS: Add AMD P-State driver maintainer entry Documentation: amd-pstate: Add AMD P-State driver introduction cpufreq: amd-pstate: Add AMD P-State performance attributes cpufreq: amd-pstate: Add AMD P-State frequencies attributes cpufreq: amd-pstate: Add boost mode support for AMD P-State cpufreq: amd-pstate: Add trace for AMD P-State module cpufreq: amd-pstate: Introduce the support for the processors with shared memory solution cpufreq: amd-pstate: Add fast switch function for AMD P-State cpufreq: amd-pstate: Introduce a new AMD P-State driver to support future processors ACPI: CPPC: Add CPPC enable register function ACPI: CPPC: Check present CPUs for determining _CPC is valid ACPI: CPPC: Implement support for SystemIO registers x86/msr: Add AMD CPPC MSR definitions x86/cpufeatures: Add AMD Collaborative Processor Performance Control feature flag cpufreq: use default_groups in kobj_type ... commit bca21755b9fc00dbe371994b53389eb5d70b8e72 Merge: 63045bfd3c8db 70df8e1bdc941 Author: Linus Torvalds Date: Mon Jan 10 20:26:56 2022 -0800 Merge tag 'acpi-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI updates from Rafael Wysocki: "These are usual ACPICA code updates (although there are more of them than in the last few releases), a noticeable EC driver update (which mostly consists of cleanups, though), the device enumeration quirks handling rework from Hans, some updates eliminating unnecessary CPU cache flushing in some places (processor idle and system-wide PM code) and a bunch of assorted cleanups and fixes. Specifics: - Update ACPICA code in the kernel to the 20211217 upstream release including the following changes: - iASL/Disassembler: Additional support for NHLT table (Bob Moore). - Change a return_ACPI_STATUS (AE_BAD_PARAMETER) (Bob Moore). - Fix a couple of warnings under MSVC (Bob Moore). - iASL: Add TDEL table to both compiler/disassembler (Bob Moore). - iASL/NHLT table: "Specific Data" field support (Bob Moore). - Use original data_table_region pointer for accesses (Jessica Clarke). - Use original pointer for virtual origin tables (Jessica Clarke). - Macros: Remove ACPI_PHYSADDR_TO_PTR (Jessica Clarke). - Avoid subobject buffer overflow when validating RSDP signature (Jessica Clarke). - iASL: Add suppport for AGDI table (Ilkka Koskinen). - Hardware: Do not flush CPU cache when entering S4 and S5 (Kirill A. Shutemov). - Expand the ACPI_ACCESS_ definitions (Mark Langsdorf). - Utilities: Avoid deleting the same object twice in a row (Rafael Wysocki). - Executer: Fix REFCLASS_REFOF case in acpi_ex_opcode_1A_0T_1R() (Rafael Wysocki). - Fix AEST Processor generic resource substructure data field byte length (Shuuichirou Ishii). - Fix wrong interpretation of PCC address (Sudeep Holla). - Add support for PCC Opregion special context data (Sudeep Holla). - Implement OperationRegion handler for PCC Type 3 subtype (Sudeep Holla). - Introduce acpi_fetch_acpi_dev() as a replacement for acpi_bus_get_device() and use it in the ACPI subsystem (Rafael Wysocki). - Avoid using _CID for device enumaration if _HID is missing or invalid (Rafael Wysocki). - Rework quirk handling during ACPI device enumeration and add some new quirks for known broken platforms (Hans de Goede). - Avoid unnecessary or redundant CPU cache flushing during system PM transitions (Kirill A. Shutemov). - Add PM debug messages related to power resources (Rafael Wysocki). - Fix kernel-doc comment in the PCI host bridge ACPI driver (Yang Li). - Rework flushing of EC work while suspended to idle and clean up the handling of events in the ACPI EC driver (Rafael Wysocki). - Prohibit ec_sys module parameter write_support from being used when the system is locked down (Hans de Goede). - Make the ACPI processor thermal driver use cpufreq_cpu_get() to check for presence of cpufreq policy (Manfred Spraul). - Avoid unnecessary CPU cache flushing in the ACPI processor idle driver (Kirill A. Shutemov). - Replace kernel.h with the necessary inclusions in the ACPI processor driver (Andy Shevchenko). - Use swap() instead of open coding it in the ACPI processor idle driver (Guo Zhengkui). - Fix the handling of defective LPAT in the ACPI xpower PMIC driver and clean up some definitions of PMIC data structures (Hans de Goede). - Fix outdated comment in the ACPI DPTF driver (Sumeet Pawnikar). - Add AEST to the list of known ACPI table signatures (Shuuichirou Ishii). - Make ACPI NUMA code take hotpluggable memblocks into account when CONFIG_MEMORY_HOTPLUG is not set (Vitaly Kuznetsov). - Use default_groups in kobj_type in the ACPI sysfs code (Greg Kroah-Hartman). - Rearrange _CPC structure documentation (Andy Shevchenko). - Drop an always true check from the ACPI thermal driver (Adam Borowski). - Add new "not charging" quirk for Lenovo ThinkPads to the ACPI battery driver (Thomas Weißschuh)" * tag 'acpi-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (64 commits) ACPI: PCC: Implement OperationRegion handler for the PCC Type 3 subtype ACPI / x86: Skip AC and battery devices on x86 Android tablets with broken DSDTs ACPI / x86: Introduce an acpi_quirk_skip_acpi_ac_and_battery() helper ACPI: processor: thermal: avoid cpufreq_get_policy() serdev: Do not instantiate serdevs on boards with known bogus DSDT entries i2c: acpi: Do not instantiate I2C-clients on boards with known bogus DSDT entries ACPI / x86: Add acpi_quirk_skip_[i2c_client|serdev]_enumeration() helpers ACPI: scan: Create platform device for BCM4752 and LNV4752 ACPI nodes PCI/ACPI: Fix acpi_pci_osc_control_set() kernel-doc comment ACPI: battery: Add the ThinkPad "Not Charging" quirk ACPI: sysfs: use default_groups in kobj_type ACPICA: Update version to 20211217 ACPICA: iASL/NHLT table: "Specific Data" field support ACPICA: iASL: Add suppport for AGDI table ACPICA: iASL: Add TDEL table to both compiler/disassembler ACPICA: Fixed a couple of warnings under MSVC ACPICA: Change a return_ACPI_STATUS (AE_BAD_PARAMETER) ACPICA: Hardware: Do not flush CPU cache when entering S4 and S5 ACPICA: Add support for PCC Opregion special context data ACPICA: Fix wrong interpretation of PCC address ... commit 63045bfd3c8dbe9c8bee7e33291202725154cb2c Author: Linus Torvalds Date: Mon Jan 10 19:33:36 2022 -0800 netfilter: nf_tables: don't use 'data_size' uninitialized Commit 2c865a8a28a1 ("netfilter: nf_tables: add rule blob layout") never initialized the new 'data_size' variable. I'm not sure how it ever worked, but it might have worked almost by accident - gcc seems to occasionally miss these kinds of 'variable used uninitialized' situations, but I've seen it do so because it ended up zero-initializing them due to some other simplification. But clang is very unhappy about it all, and correctly reports net/netfilter/nf_tables_api.c:8278:4: error: variable 'data_size' is uninitialized when used here [-Werror,-Wuninitialized] data_size += sizeof(*prule) + rule->dlen; ^~~~~~~~~ net/netfilter/nf_tables_api.c:8263:30: note: initialize the variable 'data_size' to silence this warning unsigned int size, data_size; ^ = 0 1 error generated. and this fix just initializes 'data_size' to zero before the loop. Fixes: 2c865a8a28a1 ("netfilter: nf_tables: add rule blob layout") Cc: Pablo Neira Ayuso Cc: Jakub Kicinski Cc: David Miller Signed-off-by: Linus Torvalds commit 8efd0d9c316af470377894a6a0f9ff63ce18c177 Merge: 9bcbf894b6872 8aaaf2f3af2ae Author: Linus Torvalds Date: Mon Jan 10 19:06:09 2022 -0800 Merge tag '5.17-net-next' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next Pull networking updates from Jakub Kicinski: "Core ---- - Defer freeing TCP skbs to the BH handler, whenever possible, or at least perform the freeing outside of the socket lock section to decrease cross-CPU allocator work and improve latency. - Add netdevice refcount tracking to locate sources of netdevice and net namespace refcount leaks. - Make Tx watchdog less intrusive - avoid pausing Tx and restarting all queues from a single CPU removing latency spikes. - Various small optimizations throughout the stack from Eric Dumazet. - Make netdev->dev_addr[] constant, force modifications to go via appropriate helpers to allow us to keep addresses in ordered data structures. - Replace unix_table_lock with per-hash locks, improving performance of bind() calls. - Extend skb drop tracepoint with a drop reason. - Allow SO_MARK and SO_PRIORITY setsockopt under CAP_NET_RAW. BPF --- - New helpers: - bpf_find_vma(), find and inspect VMAs for profiling use cases - bpf_loop(), runtime-bounded loop helper trading some execution time for much faster (if at all converging) verification - bpf_strncmp(), improve performance, avoid compiler flakiness - bpf_get_func_arg(), bpf_get_func_ret(), bpf_get_func_arg_cnt() for tracing programs, all inlined by the verifier - Support BPF relocations (CO-RE) in the kernel loader. - Further the support for BTF_TYPE_TAG annotations. - Allow access to local storage in sleepable helpers. - Convert verifier argument types to a composable form with different attributes which can be shared across types (ro, maybe-null). - Prepare libbpf for upcoming v1.0 release by cleaning up APIs, creating new, extensible ones where missing and deprecating those to be removed. Protocols --------- - WiFi (mac80211/cfg80211): - notify user space about long "come back in N" AP responses, allow it to react to such temporary rejections - allow non-standard VHT MCS 10/11 rates - use coarse time in airtime fairness code to save CPU cycles - Bluetooth: - rework of HCI command execution serialization to use a common queue and work struct, and improve handling errors reported in the middle of a batch of commands - rework HCI event handling to use skb_pull_data, avoiding packet parsing pitfalls - support AOSP Bluetooth Quality Report - SMC: - support net namespaces, following the RDMA model - improve connection establishment latency by pre-clearing buffers - introduce TCP ULP for automatic redirection to SMC - Multi-Path TCP: - support ioctls: SIOCINQ, OUTQ, and OUTQNSD - support socket options: IP_TOS, IP_FREEBIND, IP_TRANSPARENT, IPV6_FREEBIND, and IPV6_TRANSPARENT, TCP_CORK and TCP_NODELAY - support cmsgs: TCP_INQ - improvements in the data scheduler (assigning data to subflows) - support fastclose option (quick shutdown of the full MPTCP connection, similar to TCP RST in regular TCP) - MCTP (Management Component Transport) over serial, as defined by DMTF spec DSP0253 - "MCTP Serial Transport Binding". Driver API ---------- - Support timestamping on bond interfaces in active/passive mode. - Introduce generic phylink link mode validation for drivers which don't have any quirks and where MAC capability bits fully express what's supported. Allow PCS layer to participate in the validation. Convert a number of drivers. - Add support to set/get size of buffers on the Rx rings and size of the tx copybreak buffer via ethtool. - Support offloading TC actions as first-class citizens rather than only as attributes of filters, improve sharing and device resource utilization. - WiFi (mac80211/cfg80211): - support forwarding offload (ndo_fill_forward_path) - support for background radar detection hardware - SA Query Procedures offload on the AP side New hardware / drivers ---------------------- - tsnep - FPGA based TSN endpoint Ethernet MAC used in PLCs with real-time requirements for isochronous communication with protocols like OPC UA Pub/Sub. - Qualcomm BAM-DMUX WWAN - driver for data channels of modems integrated into many older Qualcomm SoCs, e.g. MSM8916 or MSM8974 (qcom_bam_dmux). - Microchip LAN966x multi-port Gigabit AVB/TSN Ethernet Switch driver with support for bridging, VLANs and multicast forwarding (lan966x). - iwlmei driver for co-operating between Intel's WiFi driver and Intel's Active Management Technology (AMT) devices. - mse102x - Vertexcom MSE102x Homeplug GreenPHY chips - Bluetooth: - MediaTek MT7921 SDIO devices - Foxconn MT7922A - Realtek RTL8852AE Drivers ------- - Significantly improve performance in the datapaths of: lan78xx, ax88179_178a, lantiq_xrx200, bnxt. - Intel Ethernet NICs: - igb: support PTP/time PEROUT and EXTTS SDP functions on 82580/i354/i350 adapters - ixgbevf: new PF -> VF mailbox API which avoids the risk of mailbox corruption with ESXi - iavf: support configuration of VLAN features of finer granularity, stacked tags and filtering - ice: PTP support for new E822 devices with sub-ns precision - ice: support firmware activation without reboot - Mellanox Ethernet NICs (mlx5): - expose control over IRQ coalescing mode (CQE vs EQE) via ethtool - support TC forwarding when tunnel encap and decap happen between two ports of the same NIC - dynamically size and allow disabling various features to save resources for running in embedded / SmartNIC scenarios - Broadcom Ethernet NICs (bnxt): - use page frag allocator to improve Rx performance - expose control over IRQ coalescing mode (CQE vs EQE) via ethtool - Other Ethernet NICs: - amd-xgbe: add Ryzen 6000 (Yellow Carp) Ethernet support - Microsoft cloud/virtual NIC (mana): - add XDP support (PASS, DROP, TX) - Mellanox Ethernet switches (mlxsw): - initial support for Spectrum-4 ASICs - VxLAN with IPv6 underlay - Marvell Ethernet switches (prestera): - support flower flow templates - add basic IP forwarding support - NXP embedded Ethernet switches (ocelot & felix): - support Per-Stream Filtering and Policing (PSFP) - enable cut-through forwarding between ports by default - support FDMA to improve packet Rx/Tx to CPU - Other embedded switches: - hellcreek: improve trapping management (STP and PTP) packets - qca8k: support link aggregation and port mirroring - Qualcomm 802.11ax WiFi (ath11k): - qca6390, wcn6855: enable 802.11 power save mode in station mode - BSS color change support - WCN6855 hw2.1 support - 11d scan offload support - scan MAC address randomization support - full monitor mode, only supported on QCN9074 - qca6390/wcn6855: report signal and tx bitrate - qca6390: rfkill support - qca6390/wcn6855: regdb.bin support - Intel WiFi (iwlwifi): - support SAR GEO Offset Mapping (SGOM) and Time-Aware-SAR (TAS) in cooperation with the BIOS - support for Optimized Connectivity Experience (OCE) scan - support firmware API version 68 - lots of preparatory work for the upcoming Bz device family - MediaTek WiFi (mt76): - Specific Absorption Rate (SAR) support - mt7921: 160 MHz channel support - RealTek WiFi (rtw88): - Specific Absorption Rate (SAR) support - scan offload - Other WiFi NICs - ath10k: support fetching (pre-)calibration data from nvmem - brcmfmac: configure keep-alive packet on suspend - wcn36xx: beacon filter support" * tag '5.17-net-next' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next: (2048 commits) tcp: tcp_send_challenge_ack delete useless param `skb` net/qla3xxx: Remove useless DMA-32 fallback configuration rocker: Remove useless DMA-32 fallback configuration hinic: Remove useless DMA-32 fallback configuration lan743x: Remove useless DMA-32 fallback configuration net: enetc: Remove useless DMA-32 fallback configuration cxgb4vf: Remove useless DMA-32 fallback configuration cxgb4: Remove useless DMA-32 fallback configuration cxgb3: Remove useless DMA-32 fallback configuration bnx2x: Remove useless DMA-32 fallback configuration et131x: Remove useless DMA-32 fallback configuration be2net: Remove useless DMA-32 fallback configuration vmxnet3: Remove useless DMA-32 fallback configuration bna: Simplify DMA setting net: alteon: Simplify DMA setting myri10ge: Simplify DMA setting qlcnic: Simplify DMA setting net: allwinner: Fix print format page_pool: remove spinlock in page_pool_refill_alloc_cache() amt: fix wrong return type of amt_send_membership_update() ... commit 9bcbf894b6872216ef61faf17248ec234e3db6bc Merge: 75b950ef6166e 68b9bcc8a534c Author: Linus Torvalds Date: Mon Jan 10 18:55:43 2022 -0800 Merge tag 'media/v5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media Pull media updates from Mauro Carvalho Chehab: - New sensor driver: ov5693 - A new driver for STM32 Chrom-ART Accelerator - Added V4L2 core helper functions for VP9 codec - Hantro driver has gained support for VP9 codecs - Added support for Maxim MAX96712 Quad GMSL2 Deserializer - The staging atomisp driver has gained lots of improvements, fixes and cleanups. It now works with userptr - Lots of random driver improvements as usual * tag 'media/v5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (397 commits) media: ipu3-cio2: Add support for instantiating i2c-clients for VCMs media: ipu3-cio2: Call cio2_bridge_init() before anything else media: ipu3-cio2: Defer probing until the PMIC is fully setup media: hantro: Add support for Allwinner H6 media: dt-bindings: allwinner: document H6 Hantro G2 binding media: hantro: Convert imx8m_vpu_g2_irq to helper media: hantro: move postproc enablement for old cores media: hantro: vp9: add support for legacy register set media: hantro: vp9: use double buffering if needed media: hantro: add support for reset lines media: hantro: Fix probe func error path media: i2c: hi846: use pm_runtime_force_suspend/resume for system suspend media: i2c: hi846: check return value of regulator_bulk_disable() media: hi556: Support device probe in non-zero ACPI D state media: ov5675: Support device probe in non-zero ACPI D state media: imx208: Support device probe in non-zero ACPI D state media: ov2740: support device probe in non-zero ACPI D state media: ov5670: Support device probe in non-zero ACPI D state media: ov8856: support device probe in non-zero ACPI D state media: ov8865: Disable only enabled regulators on error path ... commit 75b950ef6166e4ef52e43e7ec80985c5705f7e81 Author: Linus Torvalds Date: Mon Jan 10 18:50:10 2022 -0800 Revert "drm/amd/display: Fix for otg synchronization logic" This reverts commit a896f870f8a5f23ec961d16baffd3fda1f8be57c. It causes odd flickering on my Radeon RX580 (PCI ID 1002:67df rev e7, subsystem ID 1da2:e353). Bisected right to this commit, and reverting it fixes things. Link: https://lore.kernel.org/all/CAHk-=wg9hDde_L3bK9tAfdJ4N=TJJ+SjO3ZDONqH5=bVoy_Mzg@mail.gmail.com/ Cc: Alex Deucher Cc: Daniel Vetter Cc: Harry Wentland Cc: Dave Airlie Cc: Christian Koenig Cc: Jun Lei Cc: Mustapha Ghaddar Cc: Bhawanpreet Lakha Cc: meenakshikumar somasundaram Cc: Daniel Wheeler Signed-off-by: Linus Torvalds commit 8d0749b4f83bf4768ceae45ee6a79e6e7eddfc2a Merge: bf4eebf8cfa2c cb6846fbb83b5 Author: Linus Torvalds Date: Mon Jan 10 12:58:46 2022 -0800 Merge tag 'drm-next-2022-01-07' of git://anongit.freedesktop.org/drm/drm Pull drm updates from Dave Airlie: "Highlights are support for privacy screens found in new laptops, a bunch of nomodeset refactoring, and i915 enables ADL-P systems by default, while starting to add RPL-S support. vmwgfx adds GEM and support for OpenGL 4.3 features in userspace. Lots of internal refactorings around dma reservations, and lots of driver refactoring as well. Summary: core: - add privacy screen support - move nomodeset option into drm subsystem - clean up nomodeset handling in drivers - make drm_irq.c legacy - fix stack_depot name conflicts - remove DMA_BUF_SET_NAME ioctl restrictions - sysfs: send hotplug event - replace several DRM_* logging macros with drm_* - move hashtable to legacy code - add error return from gem_create_object - cma-helper: improve interfaces, drop CONFIG_DRM_KMS_CMA_HELPER - kernel.h related include cleanups - support XRGB2101010 source buffers ttm: - don't include drm hashtable - stop pruning fences after wait - documentation updates dma-buf: - add dma_resv selftest - add debugfs helpers - remove dma_resv_get_excl_unlocked - documentation - make fences mandatory in dma_resv_add_excl_fence dp: - add link training delay helpers gem: - link shmem/cma helpers into separate modules - use dma_resv iteratior - import dma-buf namespace into gem helper modules scheduler: - fence grab fix - lockdep fixes bridge: - switch to managed MIPI DSI helpers - register and attach during probe fixes - convert to YAML in several places. panel: - add bunch of new panesl simpledrm: - support FB_DAMAGE_CLIPS - support virtual screen sizes - add Apple M1 support amdgpu: - enable seamless boot for DCN 3.01 - runtime PM fixes - use drm_kms_helper_connector_hotplug_event - get all fences at once - use generic drm fb helpers - PSR/DPCD/LTTPR/DSC/PM/RAS/OLED/SRIOV fixes - add smart trace buffer (STB) for supported GPUs - display debugfs entries - new SMU debug option - Documentation update amdkfd: - IP discovery enumeration refactor - interface between driver fixes - SVM fixes - kfd uapi header to define some sysfs bitfields. i915: - support VESA panel backlights - enable ADL-P by default - add eDP privacy screen support - add Raptor Lake S (RPL-S) support - DG2 page table support - lots of GuC/HuC fw refactoring - refactored i915->gt interfaces - CD clock squashing support - enable 10-bit gamma support - update ADL-P DMC fw to v2.14 - enable runtime PM autosuspend by default - ADL-P DSI support - per-lane DP drive settings for ICL+ - add support for pipe C/D DMC firmware - Atomic gamma LUT updates - remove CCS FB stride restrictions on ADL-P - VRR platform support for display 11 - add support for display audio codec keepalive - lots of display refactoring - fix runtime PM handling during PXP suspend - improved eviction performance with async TTM moves - async VMA unbinding improvements - VMA locking refactoring - improved error capture robustness - use per device iommu checks - drop bits stealing from i915_sw_fence function ptr - remove dma_resv_prune - add IC cache invalidation on DG2 nouveau: - crc fixes - validate LUTs in atomic check - set HDMI AVI RGB quant to full tegra: - buffer objects reworks for dma-buf compat - NVDEC driver uAPI support - power management improvements etnaviv: - IOMMU enabled system support - fix > 4GB command buffer mapping - close a DoS vector - fix spurious GPU resets ast: - fix i2c initialization rcar-du: - DSI output support exynos: - replace legacy gpio interface - implement generic GEM object mmap msm: - dpu plane state cleanup in prep for multirect - dpu debugfs cleanups - dp support for sc7280 - a506 support - removal of struct_mutex - remove old eDP sub-driver anx7625: - support MIPI DSI input - support HDMI audio - fix reading EDID lvds: - fix bridge DT bindings megachips: - probe both bridges before registering dw-hdmi: - allow interlace on bridge ps8640: - enable runtime PM - support aux-bus tx358768: - enable reference clock - add pulse mode support ti-sn65dsi86: - use regmap bulk write - add PWM support etnaviv: - get all fences at once gma500: - gem object cleanups kmb: - enable fb console radeon: - use dma_resv_wait_timeout rockchip: - add DSP hold timeout - suspend/resume fixes - PLL clock fixes - implement mmap in GEM object functions - use generic fbdev emulation sun4i: - use CMA helpers without vmap support vc4: - fix HDMI-CEC hang with display is off - power on HDMI controller while disabling - support 4K@60Hz modes - support 10-bit YUV 4:2:0 output vmwgfx: - fix leak on probe errors - fail probing on broken hosts - new placement for MOB page tables - hide internal BOs from userspace - implement GEM support - implement GL 4.3 support virtio: - overflow fixes xen: - implement mmap as GEM object function omapdrm: - fix scatterlist export - support virtual planes mediatek: - MT8192 support - CMDQ refinement" * tag 'drm-next-2022-01-07' of git://anongit.freedesktop.org/drm/drm: (1241 commits) drm/amdgpu: no DC support for headless chips drm/amd/display: fix dereference before NULL check drm/amdgpu: always reset the asic in suspend (v2) drm/amdgpu: put SMU into proper state on runpm suspending for BOCO capable platform drm/amd/display: Fix the uninitialized variable in enable_stream_features() drm/amdgpu: fix runpm documentation amdgpu/pm: Make sysfs pm attributes as read-only for VFs drm/amdgpu: save error count in RAS poison handler drm/amdgpu: drop redundant semicolon drm/amd/display: get and restore link res map drm/amd/display: support dynamic HPO DP link encoder allocation drm/amd/display: access hpo dp link encoder only through link resource drm/amd/display: populate link res in both detection and validation drm/amd/display: define link res and make it accessible to all link interfaces drm/amd/display: 3.2.167 drm/amd/display: [FW Promotion] Release 0.0.98 drm/amd/display: Undo ODM combine drm/amd/display: Add reg defs for DCN303 drm/amd/display: Changed pipe split policy to allow for multi-display pipe split drm/amd/display: Set optimize_pwr_state for DCN31 ... commit b6e43dddaea3dbfa93327f986beb3ec5e8157c4c Author: Qinghua Jin Date: Mon Jan 10 12:46:05 2022 -0800 Input: ti_am335x_tsc - fix a typo in a comment change 'postion' to 'position' Signed-off-by: Qinghua Jin Link: https://lore.kernel.org/r/20220106084215.355295-1-qhjin.dev@gmail.com Signed-off-by: Dmitry Torokhov commit bf4eebf8cfa2cd50e20b7321dfb3effdcdc6e909 Merge: 4369b3cec2134 ad659ccb54128 Author: Linus Torvalds Date: Mon Jan 10 12:16:48 2022 -0800 Merge tag 'linux-kselftest-kunit-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull KUnit updates from Shuah Khan: "This consists of several fixes and enhancements. A few highlights: - Option --kconfig_add option allows easily tweaking kunitconfigs - make build subcommand can reconfigure if needed - doesn't error on tests without test plans - doesn't crash if no parameters are generated - defaults --jobs to # of cups - reports test parameter results as (K)TAP subtests" * tag 'linux-kselftest-kunit-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: kunit: tool: Default --jobs to number of CPUs kunit: tool: fix newly introduced typechecker errors kunit: tool: make `build` subcommand also reconfigure if needed kunit: tool: delete kunit_parser.TestResult type kunit: tool: use dataclass instead of collections.namedtuple kunit: tool: suggest using decode_stacktrace.sh on kernel crash kunit: tool: reconfigure when the used kunitconfig changes kunit: tool: revamp message for invalid kunitconfig kunit: tool: add --kconfig_add to allow easily tweaking kunitconfigs kunit: tool: move Kconfig read_from_file/parse_from_string to package-level kunit: tool: print parsed test results fully incrementally kunit: Report test parameter results as (K)TAP subtests kunit: Don't crash if no parameters are generated kunit: tool: Report an error if any test has no subtests kunit: tool: Do not error on tests without test plans kunit: add run_checks.py script to validate kunit changes Documentation: kunit: remove claims that kunit is a mocking framework kunit: tool: fix --json output for skipped tests commit 4369b3cec2134a6b8ff59b0ed5cca2f816d6e388 Merge: ca1a46d6f5064 e89908201e250 Author: Linus Torvalds Date: Mon Jan 10 12:08:12 2022 -0800 Merge tag 'linux-kselftest-next-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest Pull Kselftest update from Shuah Khan: "Fixes to build errors, false negatives, and several code cleanups, including the ARRAY_SIZE cleanup that removes 25+ duplicates ARRAY_SIZE defines from individual tests" * tag 'linux-kselftest-next-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: selftests/vm: remove ARRAY_SIZE define from individual tests selftests/timens: remove ARRAY_SIZE define from individual tests selftests/sparc64: remove ARRAY_SIZE define from adi-test selftests/seccomp: remove ARRAY_SIZE define from seccomp_benchmark selftests/rseq: remove ARRAY_SIZE define from individual tests selftests/net: remove ARRAY_SIZE define from individual tests selftests/landlock: remove ARRAY_SIZE define from common.h selftests/ir: remove ARRAY_SIZE define from ir_loopback.c selftests/core: remove ARRAY_SIZE define from close_range_test.c selftests/cgroup: remove ARRAY_SIZE define from cgroup_util.h selftests/arm64: remove ARRAY_SIZE define from vec-syscfg.c tools: fix ARRAY_SIZE defines in tools and selftests hdrs selftests: cgroup: build error multiple outpt files selftests/move_mount_set_group remove unneeded conversion to bool selftests/mount: remove unneeded conversion to bool selftests: harness: avoid false negatives if test has no ASSERTs selftests/ftrace: make kprobe profile testcase description unique selftests: clone3: clone3: add case CLONE3_ARGS_NO_TEST selftests: timers: Remove unneeded semicolon kselftests: timers:Remove unneeded semicolon commit ca1a46d6f5064c129f7ca6bcfd8f035d69da175c Merge: d93aebbd76a07 9d6c59c1c0d62 Author: Linus Torvalds Date: Mon Jan 10 11:58:12 2022 -0800 Merge tag 'slab-for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab Pull slab updates from Vlastimil Babka: - Separate struct slab from struct page - an offshot of the page folio work. Struct page fields used by slab allocators are moved from struct page to a new struct slab, that uses the same physical storage. Similar to struct folio, it always is a head page. This brings better type safety, separation of large kmalloc allocations from true slabs, and cleanup of related objcg code. - A SLAB_MERGE_DEFAULT config optimization. * tag 'slab-for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab: (33 commits) mm/slob: Remove unnecessary page_mapcount_reset() function call bootmem: Use page->index instead of page->freelist zsmalloc: Stop using slab fields in struct page mm/slub: Define struct slab fields for CONFIG_SLUB_CPU_PARTIAL only when enabled mm/slub: Simplify struct slab slabs field definition mm/sl*b: Differentiate struct slab fields by sl*b implementations mm/kfence: Convert kfence_guarded_alloc() to struct slab mm/kasan: Convert to struct folio and struct slab mm/slob: Convert SLOB to use struct slab and struct folio mm/memcg: Convert slab objcgs from struct page to struct slab mm: Convert struct page to struct slab in functions used by other subsystems mm/slab: Finish struct page to struct slab conversion mm/slab: Convert most struct page to struct slab by spatch mm/slab: Convert kmem_getpages() and kmem_freepages() to struct slab mm/slub: Finish struct page to struct slab conversion mm/slub: Convert most struct page to struct slab by spatch mm/slub: Convert pfmemalloc_match() to take a struct slab mm/slub: Convert __free_slab() to use struct slab mm/slub: Convert alloc_slab_page() to return a struct slab mm/slub: Convert print_page_info() to print_slab_info() ... commit d93aebbd76a07a8101d2f7393dc18be3e235f11b Merge: 9d3a1e0a88e76 6c8e11e08a5b7 Author: Linus Torvalds Date: Mon Jan 10 11:52:16 2022 -0800 Merge branch 'random-5.17-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random Pull random number generator updates from Jason Donenfeld: "These a bit more numerous than usual for the RNG, due to folks resubmitting patches that had been pending prior and generally renewed interest. There are a few categories of patches in here: 1) Dominik Brodowski and I traded a series back and forth for a some weeks that fixed numerous issues related to seeds being provided at extremely early boot by the firmware, before other parts of the kernel or of the RNG have been initialized, both fixing some crashes and addressing correctness around early boot randomness. One of these is marked for stable. 2) I replaced the RNG's usage of SHA-1 with BLAKE2s in the entropy extractor, and made the construction a bit safer and more standard. This was sort of a long overdue low hanging fruit, as we were supposed to have phased out SHA-1 usage quite some time ago (even if all we needed here was non-invertibility). Along the way it also made extraction 131% faster. This required a bit of Kconfig and symbol plumbing to make things work well with the crypto libraries, which is one of the reasons why I'm sending you this pull early in the cycle. 3) I got rid of a truly superfluous call to RDRAND in the hot path, which resulted in a whopping 370% increase in performance. 4) Sebastian Andrzej Siewior sent some patches regarding PREEMPT_RT, the full series of which wasn't ready yet, but the first two preparatory cleanups were good on their own. One of them touches files in kernel/irq/, which is the other reason why I'm sending you this pull early in the cycle. 5) Other assorted correctness fixes from Eric Biggers, Jann Horn, Mark Brown, Dominik Brodowski, and myself" * 'random-5.17-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random: random: don't reset crng_init_cnt on urandom_read() random: avoid superfluous call to RDRAND in CRNG extraction random: early initialization of ChaCha constants random: use IS_ENABLED(CONFIG_NUMA) instead of ifdefs random: harmonize "crng init done" messages random: mix bootloader randomness into pool random: do not throw away excess input to crng_fast_load random: do not re-init if crng_reseed completes before primary init random: fix crash on multiple early calls to add_bootloader_randomness() random: do not sign extend bytes for rotation when mixing random: use BLAKE2s instead of SHA1 in extraction lib/crypto: blake2s: include as built-in random: fix data race on crng init time random: fix data race on crng_node_pool irq: remove unused flags argument from __handle_irq_event_percpu() random: remove unused irq_flags argument from add_interrupt_randomness() random: document add_hwgenerator_randomness() with other input functions MAINTAINERS: add git tree for random.c commit 9d3a1e0a88e76bcb914e269cba0bfed6f4584a5e Merge: 404dbad38248f 1e6d69c7b9cd7 Author: Linus Torvalds Date: Mon Jan 10 11:50:57 2022 -0800 Merge tag 'seccomp-v5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull seccomp updates from Kees Cook: "The core seccomp code hasn't changed for this cycle, but the selftests were improved while helping to debug the recent signal handling refactoring work Eric did. Summary: - Improve seccomp selftests in support of signal handler refactoring (Kees Cook)" * tag 'seccomp-v5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: selftests/seccomp: Report event mismatches more clearly selftests/seccomp: Stop USER_NOTIF test if kcmp() fails commit 404dbad38248fc07b721f4201318418ce94fcb02 Merge: ff8be964208e6 a5d05b07961a2 Author: Linus Torvalds Date: Mon Jan 10 11:48:37 2022 -0800 Merge tag 'pstore-v5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull pstore update from Kees Cook: - Add boot param for early ftrace recording in pstore (Uwe Kleine-König) * tag 'pstore-v5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: pstore/ftrace: Allow immediate recording commit ff8be964208e6b6f1341f0645857c67830a78379 Merge: 7e740ae635040 da0119a9123c7 Author: Linus Torvalds Date: Mon Jan 10 11:45:23 2022 -0800 Merge tag 'edac_updates_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras Pull EDAC updates from Borislav Petkov: - Add support for version 3 of the Synopsys DDR controller to synopsys_edac - Add support for DRR5 and new models 0x10-0x1f and 0x50-0x5f of AMD family 0x19 CPUs to amd64_edac - The usual set of fixes and cleanups * tag 'edac_updates_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras: EDAC/amd64: Add support for family 19h, models 50h-5fh EDAC/sb_edac: Remove redundant initialization of variable rc RAS/CEC: Remove a repeated 'an' in a comment EDAC/amd64: Add support for AMD Family 19h Models 10h-1Fh and A0h-AFh EDAC: Add RDDR5 and LRDDR5 memory types EDAC/sifive: Fix non-kernel-doc comment dt-bindings: memory: Add entry for version 3.80a EDAC/synopsys: Enable the driver on Intel's N5X platform EDAC/synopsys: Add support for version 3 of the Synopsys EDAC DDR EDAC/synopsys: Use the quirk for version instead of ddr version commit 7e740ae6350407d68d2069ce79a6344bf1b58fe1 Merge: 48a60bdb2be80 3376136300a00 Author: Linus Torvalds Date: Mon Jan 10 11:43:09 2022 -0800 Merge tag 'ras_core_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull RAS updates from Borislav Petkov: "A relatively big amount of movements in RAS-land this time around: - First part of a series to move the AMD address translation code from arch/x86/ to amd64_edac as that is its only user anyway - Some MCE error injection improvements to the AMD side - Reorganization of the #MC handler code and the facilities it calls to make it noinstr-safe - Add support for new AMD MCA bank types and non-uniform banks layout - The usual set of cleanups and fixes" * tag 'ras_core_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (24 commits) x86/mce: Reduce number of machine checks taken during recovery x86/mce/inject: Avoid out-of-bounds write when setting flags x86/MCE/AMD, EDAC/mce_amd: Support non-uniform MCA bank type enumeration x86/MCE/AMD, EDAC/mce_amd: Add new SMCA bank types x86/mce: Check regs before accessing it x86/mce: Mark mce_start() noinstr x86/mce: Mark mce_timed_out() noinstr x86/mce: Move the tainting outside of the noinstr region x86/mce: Mark mce_read_aux() noinstr x86/mce: Mark mce_end() noinstr x86/mce: Mark mce_panic() noinstr x86/mce: Prevent severity computation from being instrumented x86/mce: Allow instrumentation during task work queueing x86/mce: Remove noinstr annotation from mce_setup() x86/mce: Use mce_rdmsrl() in severity checking code x86/mce: Remove function-local cpus variables x86/mce: Do not use memset to clear the banks bitmaps x86/mce/inject: Set the valid bit in MCA_STATUS before error injection x86/mce/inject: Check if a bank is populated before injecting x86/mce: Get rid of cpu_missing ... commit 48a60bdb2be807767eba6878fdf2fe5bea5d8d27 Merge: 5ba13c1c4d848 985faa78687de Author: Linus Torvalds Date: Mon Jan 10 11:34:10 2022 -0800 Merge tag 'core_entry_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull thread_info flag accessor helper updates from Borislav Petkov: "Add a set of thread_info.flags accessors which snapshot it before accesing it in order to prevent any potential data races, and convert all users to those new accessors" * tag 'core_entry_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: powerpc: Snapshot thread flags powerpc: Avoid discarding flags in system_call_exception() openrisc: Snapshot thread flags microblaze: Snapshot thread flags arm64: Snapshot thread flags ARM: Snapshot thread flags alpha: Snapshot thread flags sched: Snapshot thread flags entry: Snapshot thread flags x86: Snapshot thread flags thread_info: Add helpers to snapshot thread flags commit 5ba13c1c4d848870ed4d25e411ac567c473686f0 Merge: 133d9c53c9dcb 5abb065dca730 Author: Linus Torvalds Date: Mon Jan 10 11:32:57 2022 -0800 Merge tag 'core_core_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull notifier fix from Borislav Petkov: "Return an error when a notifier callback has been registered already" * tag 'core_core_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: notifier: Return an error when a callback has already been registered commit d5962fb7d69073bf68fb647531cfd4f0adf84be3 Author: Dario Petrillo Date: Mon Jan 10 00:44:41 2022 +0100 perf annotate: Avoid TUI crash when navigating in the annotation of recursive functions In 'perf report', entering a recursive function from inside of itself (either directly of indirectly through some other function) results in calling symbol__annotate2 multiple() times, and freeing the whole disassembly when exiting from the innermost instance. The first issue causes the function's disassembly to be duplicated, and the latter a heap use-after-free (and crash) when trying to access the disassembly again. I reproduced the bug on perf 5.11.22 (Ubuntu 20.04.3 LTS) and 5.16.rc8 with the following testcase (compile with gcc recursive.c -o recursive). To reproduce: - perf record ./recursive - perf report - enter fibonacci and annotate it - move the cursor on one of the "callq fibonacci" instructions and press enter - at this point there will be two copies of the function in the disassembly - go back by pressing q, and perf will crash #include int fibonacci(int n) { if(n <= 2) return 1; return fibonacci(n-1) + fibonacci(n-2); } int main() { printf("%d\n", fibonacci(40)); } This patch addresses the issue by annotating a function and freeing the associated memory on exit only if no annotation is already present, so that a recursive function is only annotated on entry. Signed-off-by: Dario Petrillo Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: stable@kernel.org Link: http://lore.kernel.org/lkml/20220109234441.325106-1-dario.pk1@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit 136dff3a6b71dc16c30b35cc390feb0bfc32ed50 Author: Yufan Chen Date: Sun Jan 9 11:34:16 2022 +0900 ksmbd: add smb-direct shutdown When killing ksmbd server after connecting rdma, ksmbd threads does not terminate properly because the rdma connection is still alive. This patch add shutdown operation to disconnect rdma connection while ksmbd threads terminate. Signed-off-by: Yufan Chen Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 4d02c4fdc0e256b493f9a3b604c7ff18f0019f17 Author: Hyunchul Lee Date: Fri Jan 7 14:45:31 2022 +0900 ksmbd: smbd: change the default maximum read/write, receive size Due to restriction that cannot handle multiple buffer descriptor structures, decrease the maximum read/write size for Windows clients. And set the maximum fragmented receive size in consideration of the receive queue size. Acked-by: Namjae Jeon Signed-off-by: Hyunchul Lee Signed-off-by: Steve French commit c9f189271cff85d5d735e25dfa4bc95952ec12d8 Author: Hyunchul Lee Date: Fri Jan 7 14:45:30 2022 +0900 ksmbd: smbd: create MR pool Create a memory region pool because rdma_rw_ctx_init() uses memory registration if memory registration yields better performance than using multiple SGE entries. Acked-by: Namjae Jeon Signed-off-by: Hyunchul Lee Signed-off-by: Steve French commit 41dbda16a0902798e732abc6599de256b9dc3b27 Author: Namjae Jeon Date: Thu Jan 6 10:30:31 2022 +0900 ksmbd: add reserved room in ipc request/response Whenever new parameter is added to smb configuration, It is possible to break the execution of the IPC daemon by mismatch size of request/response. This patch tries to reserve space in ipc request/response in advance to prevent that. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 99b7650ac51847e81b4d5139824e321e6cb76130 Author: Hyunchul Lee Date: Tue Jan 4 14:56:26 2022 +0900 ksmbd: smbd: call rdma_accept() under CM handler if CONFIG_LOCKDEP is enabled, the following kernel warning message is generated because rdma_accept() checks whehter the handler_mutex is held by lockdep_assert_held. CM(Connection Manager) holds the mutex before CM handler callback is called. [ 63.211405 ] WARNING: CPU: 1 PID: 345 at drivers/infiniband/core/cma.c:4405 rdma_accept+0x17a/0x350 [ 63.212080 ] RIP: 0010:rdma_accept+0x17a/0x350 ... [ 63.214036 ] Call Trace: [ 63.214098 ] [ 63.214185 ] smb_direct_accept_client+0xb4/0x170 [ksmbd] [ 63.214412 ] smb_direct_prepare+0x322/0x8c0 [ksmbd] [ 63.214555 ] ? rcu_read_lock_sched_held+0x3a/0x70 [ 63.214700 ] ksmbd_conn_handler_loop+0x63/0x270 [ksmbd] [ 63.214826 ] ? ksmbd_conn_alive+0x80/0x80 [ksmbd] [ 63.214952 ] kthread+0x171/0x1a0 [ 63.215039 ] ? set_kthread_struct+0x40/0x40 [ 63.215128 ] ret_from_fork+0x22/0x30 To avoid this, move creating a queue pair and accepting a client from transport_ops->prepare() to smb_direct_handle_connect_request(). Acked-by: Namjae Jeon Signed-off-by: Hyunchul Lee Signed-off-by: Steve French commit b589f5db6d4af8f14d70e31e1276b4c017668a26 Author: Namjae Jeon Date: Fri Dec 31 09:26:25 2021 +0900 ksmbd: limits exceeding the maximum allowable outstanding requests If the client ignores the CreditResponse received from the server and continues to send the request, ksmbd limits the requests if it exceeds smb2 max credits. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 914d7e5709ac59ded70bea7956d408fe2acd7c3c Author: Namjae Jeon Date: Wed Dec 29 23:10:03 2021 +0900 ksmbd: move credit charge deduction under processing request Moves the credit charge deduction from total_credits under the processing a request. When repeating smb2 lock request and other command request, there will be a problem that ->total_credits does not decrease. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 004443b3f6d722b455cf963ed7c3edd7f4772405 Author: Namjae Jeon Date: Wed Dec 29 23:08:46 2021 +0900 ksmbd: add support for smb2 max credit parameter Add smb2 max credits parameter to adjust maximum credits value to limit number of outstanding requests. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit cb097b3dd5ece9596a0a0b7e33893c02a9bde8c6 Author: Namjae Jeon Date: Wed Dec 29 23:02:50 2021 +0900 ksmbd: set 445 port to smbdirect port by default When SMB Direct is used with iWARP, Windows use 5445 port for smb direct port, 445 port for SMB. This patch check ib_device using ib_client to know if NICs type is iWARP or Infiniband. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 31928a001bed0d9642711d2eba520fc46d41c376 Author: Hyunchul Lee Date: Wed Dec 29 23:02:15 2021 +0900 ksmbd: register ksmbd ib client with ib_register_client() Register ksmbd ib client with ib_register_client() to find the rdma capable network adapter. If ops.get_netdev(Chelsio NICs) is NULL, ksmbd will find it using ib_device_get_by_netdev in old way. Signed-off-by: Hyunchul Lee Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit befee3775b6dabd7ec1bd8a44584f7f6f8fc8329 Author: Athira Rajeev Date: Fri Dec 3 07:50:38 2021 +0530 perf powerpc: Update global/local variants for p_stage_cyc Update the arch_support_sort_key() function in powerpc to enable presenting local and global variants of sort key 'p_stage_cyc'. Update the "se_header" strings for these in arch_perf_header_entry() along with instruction latency. Reported-by: Namhyung Kim Signed-off-by: Athira Jajeev Tested-by: Nageswara R Sastry Cc: Jiri Olsa Cc: Kajol Jain Cc: Madhavan Srinivasan Cc: Michael Ellerman Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20211203022038.48240-2-atrajeev@linux.vnet.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit e3304c21357268ecbe156ed6247a03dc78d3fce4 Author: Athira Rajeev Date: Fri Dec 3 07:50:37 2021 +0530 perf sort: Include global and local variants for p_stage_cyc sort key Sort key 'p_stage_cyc' is used to present the latency cycles spent in pipeline stages. perf has local 'p_stage_cyc' sort key to display this info. There is no global variant available for this sort key. The local variant shows latency in a single sample, whereas the global value will be useful to present the total latency (sum of latencies) in the hist entry. It represents the latency number multiplied by the number of samples. Add global ('p_stage_cyc') and local variant ('local_p_stage_cyc') for this sort key. Use 'local_p_stage_cyc' as default option for "mem" sort mode. Also add this to the list of dynamic sort keys and made the "dynamic_headers" and "arch_specific_sort_keys" as static. Reported-by: Namhyung Kim Signed-off-by: Athira Jajeev Tested-by: Nageswara R Sastry Cc: Jiri Olsa Cc: Kajol Jain Cc: Madhavan Srinivasan Cc: Michael Ellerman Cc: linuxppc-dev@lists.ozlabs.org Link: https://lore.kernel.org/r/20211203022038.48240-1-atrajeev@linux.vnet.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit debe70e488968e82282db48fbbcf84b5080f742c Merge: 65f8d08cf838d 133d9c53c9dcb Author: Arnaldo Carvalho de Melo Date: Mon Jan 10 15:35:41 2022 -0300 Merge remote-tracking branch 'torvalds/master' into perf/core To pick up fixes. Signed-off-by: Arnaldo Carvalho de Melo commit 6eeaf88fd586f05aaf1d48cb3a139d2a5c6eb055 Author: Theodore Ts'o Date: Wed Jan 5 23:59:56 2022 -0500 ext4: don't use the orphan list when migrating an inode We probably want to remove the indirect block to extents migration feature after a deprecation window, but until then, let's fix a potential data loss problem caused by the fact that we put the tmp_inode on the orphan list. In the unlikely case where we crash and do a journal recovery, the data blocks belonging to the inode being migrated are also represented in the tmp_inode on the orphan list --- and so its data blocks will get marked unallocated, and available for reuse. Instead, stop putting the tmp_inode on the oprhan list. So in the case where we crash while migrating the inode, we'll leak an inode, which is not a disaster. It will be easily fixed the next time we run fsck, and it's better than potentially having blocks getting claimed by two different files, and losing data as a result. Signed-off-by: Theodore Ts'o Reviewed-by: Lukas Czerner Cc: stable@kernel.org commit a2e3965df40af2f48ee6c97ed573adb91ced5dac Author: xu xin Date: Tue Dec 28 07:32:52 2021 +0000 ext4: use BUG_ON instead of if condition followed by BUG BUG_ON would be better. This issue was detected with the help of Coccinelle. Reported-by: Zeal robot Reviewed-by: Lukas Czerner Signed-off-by: xu xin Link: https://lore.kernel.org/r/20211228073252.580296-1-xu.xin16@zte.com.cn Signed-off-by: Theodore Ts'o commit da9e480212582b336b97848c69fdd4ac8860065b Author: Dan Carpenter Date: Wed Dec 15 14:43:09 2021 +0300 ext4: fix a copy and paste typo This was obviously supposed to be an ext4 struct, not xfs. GCC doesn't care either way so it doesn't affect the build or runtime. Fixes: cebe85d570cf ("ext4: switch to the new mount api") Signed-off-by: Dan Carpenter Reviewed-by: Lukas Czerner Link: https://lore.kernel.org/r/20211215114309.GB14552@kili Signed-off-by: Theodore Ts'o commit e81c9302a6c3c008f5c30beb73b38adb0170ff2d Author: Luís Henriques Date: Tue Dec 14 17:50:58 2021 +0000 ext4: set csum seed in tmp inode while migrating to extents When migrating to extents, the temporary inode will have it's own checksum seed. This means that, when swapping the inodes data, the inode checksums will be incorrect. This can be fixed by recalculating the extents checksums again. Or simply by copying the seed into the temporary inode. Link: https://bugzilla.kernel.org/show_bug.cgi?id=213357 Reported-by: Jeroen van Wolffelaar Signed-off-by: Luís Henriques Link: https://lore.kernel.org/r/20211214175058.19511-1-lhenriques@suse.de Signed-off-by: Theodore Ts'o Cc: stable@kernel.org commit ae6ec194b55273e52351ee70d694594dcabe405d Author: luo penghao Date: Wed Dec 8 07:53:07 2021 +0000 ext4: remove unnecessary 'offset' assignment Although it is in the loop, offset is reassigned at the beginning of the while loop. And after the loop, the value will not be used The clang_analyzer complains as follows: fs/ext4/dir.c:306:3 warning: Value stored to 'offset' is never read Reported-by: Zeal Robot Signed-off-by: luo penghao Link: https://lore.kernel.org/r/20211208075307.404703-1-luo.penghao@zte.com.cn Signed-off-by: Theodore Ts'o commit a6dbc76c4d9cc961bfb31a495fb27ee06e037e35 Author: luo penghao Date: Wed Dec 8 07:51:57 2021 +0000 ext4: remove redundant o_start statement The if will goto out of the loop, and until the end of the function execution, o_start will not be used again. The clang_analyzer complains as follows: fs/ext4/move_extent.c:635:5 warning: Value stored to 'o_start' is never read Reported-by: Zeal Robot Signed-off-by: luo penghao Link: https://lore.kernel.org/r/20211208075157.404535-1-luo.penghao@zte.com.cn Signed-off-by: Theodore Ts'o commit 037e7c525d988867811b3613549971a3253b2f7b Author: Adam Borowski Date: Mon Nov 15 18:20:20 2021 +0100 ext4: drop an always true check EXT_FIRST_INDEX(ptr) is ptr+12, which can't possibly be null; gcc-12 warns about this. Signed-off-by: Adam Borowski Reviewed-by: Andreas Dilger Link: https://lore.kernel.org/r/20211115172020.57853-1-kilobyte@angband.pl Signed-off-by: Theodore Ts'o commit fac888b2be9993d0c740013d26d69c8784acc293 Author: luo penghao Date: Thu Nov 4 06:40:07 2021 +0000 ext4: remove unused assignments The eh assignment in these two places is meaningless, because the function will goto to merge, which will not use eh. The clang_analyzer complains as follows: fs/ext4/extents.c:1988:4 warning: fs/ext4/extents.c:2016:4 warning: Value stored to 'eh' is never read Reported-by: Zeal Robot Signed-off-by: luo penghao Link: https://lore.kernel.org/r/20211104064007.2919-1-luo.penghao@zte.com Signed-off-by: Theodore Ts'o commit a660be97eb00c4d87bf881e1226fbd9d812690b7 Author: luo penghao Date: Thu Nov 4 06:34:06 2021 +0000 ext4: remove redundant statement The local variable assignment at the end of the function is meaningless. The clang_analyzer complains as follows: fs/ext4/fast_commit.c:779:2 warning: Value stored to 'dst' is never read Reported-by: Zeal Robot Signed-off-by: luo penghao Link: https://lore.kernel.org/r/20211104063406.2747-1-luo.penghao@zte.com Signed-off-by: Theodore Ts'o commit effc5b3b0d20ffcb692f107cd347289bfcd6890b Author: Nghia Le Date: Tue Oct 26 05:18:03 2021 +0700 ext4: remove useless resetting io_end_size in mpage_process_page() The command "make clang-analyzer" detects dead stores in mpage_process_page() function. Do not reset io_end_size to 0 in the current paths, as the function exits on those paths without further using io_end_size. Signed-off-by: Nghia Le Link: https://lore.kernel.org/r/20211025221803.3326-1-nghialm78@gmail.com Signed-off-by: Theodore Ts'o commit 4a69aecbfb30a3fc85bf8028386c047d5607a97a Author: Lukas Czerner Date: Wed Nov 3 15:51:22 2021 +0100 ext4: allow to change s_last_trim_minblks via sysfs Ext4 has an optimization mechanism for batched disacrd (FITRIM) that should help speed up subsequent calls of FITRIM ioctl by skipping the groups that were previously trimmed. However because the FITRIM allows to set the minimum size of an extent to trim, ext4 stores the last minimum extent size and only avoids trimming the group if it was previously trimmed with minimum extent size equal to, or smaller than the current call. There is currently no way to bypass the optimization without umount/mount cycle. This becomes a problem when the file system is live migrated to a different storage, because the optimization will prevent possibly useful discard calls to the storage. Fix it by exporting the s_last_trim_minblks via sysfs interface which will allow us to set the minimum size to the number of blocks larger than subsequent FITRIM call, effectively bypassing the optimization. By setting the s_last_trim_minblks to ULONG_MAX the optimization will be effectively cleared regardless of the previous state, or file system configuration. For example: getconf ULONG_MAX > /sys/fs/ext4/dm-1/last_trim_minblks Signed-off-by: Lukas Czerner Reported-by: Laurent GUERBY Reviewed-by: Andreas Dilger Link: https://lore.kernel.org/r/20211103145122.17338-2-lczerner@redhat.com Signed-off-by: Theodore Ts'o commit 2327fb2e23416cfb2795ccca2f77d4d65925be99 Author: Lukas Czerner Date: Wed Nov 3 15:51:21 2021 +0100 ext4: change s_last_trim_minblks type to unsigned long There is no good reason for the s_last_trim_minblks to be atomic. There is no data integrity needed and there is no real danger in setting and reading it in a racy manner. Change it to be unsigned long, the same type as s_clusters_per_group which is the maximum that's allowed. Signed-off-by: Lukas Czerner Suggested-by: Andreas Dilger Reviewed-by: Andreas Dilger Link: https://lore.kernel.org/r/20211103145122.17338-1-lczerner@redhat.com Signed-off-by: Theodore Ts'o commit bbc605cdb1e15aafaec899fedc385dc75dddac0e Author: Lukas Czerner Date: Mon Dec 13 14:56:18 2021 +0100 ext4: implement support for get/set fs label Implement support for FS_IOC_GETFSLABEL and FS_IOC_SETFSLABEL ioctls for online reading and setting of file system label. ext4_ioctl_getlabel() is simple, just get the label from the primary superblock. This might not be the first sb on the file system if 'sb=' mount option is used. In ext4_ioctl_setlabel() we update what ext4 currently views as a primary superblock and then proceed to update backup superblocks. There are two caveats: - the primary superblock might not be the first superblock and so it might not be the one used by userspace tools if read directly off the disk. - because the primary superblock might not be the first superblock we potentialy have to update it as part of backup superblock update. However the first sb location is a bit more complicated than the rest so we have to account for that. The superblock modification is created generic enough so the infrastructure can be used for other potential superblock modification operations, such as chaning UUID. Tested with generic/492 with various configurations. I also checked the behavior with 'sb=' mount options, including very large file systems with and without sparse_super/sparse_super2. Signed-off-by: Lukas Czerner Link: https://lore.kernel.org/r/20211213135618.43303-1-lczerner@redhat.com Signed-off-by: Theodore Ts'o commit 4c1bd5a90c4e716e5bde33f01a40bb66dc4a9903 Author: Lukas Czerner Date: Tue Jan 4 15:35:18 2022 +0100 ext4: only set EXT4_MOUNT_QUOTA when journalled quota file is specified Only set EXT4_MOUNT_QUOTA when journalled quota file is specified, otherwise simply disabling specific quota type (usrjquota=) will also set the EXT4_MOUNT_QUOTA super block option. Signed-off-by: Lukas Czerner Fixes: e6e268cb6822 ("ext4: move quota configuration out of handle_mount_opt()") Link: https://lore.kernel.org/r/20220104143518.134465-2-lczerner@redhat.com Signed-off-by: Theodore Ts'o commit 13b215a9e657808414a2159b0dec90f1c31ebe05 Author: Lukas Czerner Date: Tue Jan 4 15:35:17 2022 +0100 ext4: don't use kfree() on rcu protected pointer sbi->s_qf_names During ext4 mount api rework the commit e6e268cb6822 ("ext4: move quota configuration out of handle_mount_opt()") introduced a bug where we would kfree(sbi->s_qf_names[i]) before assigning the new quota name in ext4_apply_quota_options(). This is wrong because we're using kfree() on rcu prointer that could be simultaneously accessed from ext4_show_quota_options() during remount. Fix it by using rcu_replace_pointer() to replace the old qname with the new one and then kfree_rcu() the old quota name. Also use get_qf_name() instead of sbi->s_qf_names in strcmp() to silence the sparse warning. Fixes: e6e268cb6822 ("ext4: move quota configuration out of handle_mount_opt()") Reported-by: kernel test robot Signed-off-by: Lukas Czerner Link: https://lore.kernel.org/r/20220104143518.134465-1-lczerner@redhat.com Signed-off-by: Theodore Ts'o commit 173b6e383d2a204c9921ffc1eca3b87aa2106c33 Author: Jan Kara Date: Fri Nov 12 16:22:02 2021 +0100 ext4: avoid trim error on fs with small groups A user reported FITRIM ioctl failing for him on ext4 on some devices without apparent reason. After some debugging we've found out that these devices (being LVM volumes) report rather large discard granularity of 42MB and the filesystem had 1k blocksize and thus group size of 8MB. Because ext4 FITRIM implementation puts discard granularity into minlen, ext4_trim_fs() declared the trim request as invalid. However just silently doing nothing seems to be a more appropriate reaction to such combination of parameters since user did not specify anything wrong. CC: Lukas Czerner Fixes: 5c2ed62fd447 ("ext4: Adjust minlen with discard_granularity in the FITRIM ioctl") Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20211112152202.26614-1-jack@suse.cz Signed-off-by: Theodore Ts'o commit 5c48a7df91499e371ef725895b2e2d21a126e227 Author: Zhang Yi Date: Sat Dec 25 17:09:37 2021 +0800 ext4: fix an use-after-free issue about data=journal writeback mode Our syzkaller report an use-after-free issue that accessing the freed buffer_head on the writeback page in __ext4_journalled_writepage(). The problem is that if there was a truncate racing with the data=journalled writeback procedure, the writeback length could become zero and bget_one() refuse to get buffer_head's refcount, then the truncate procedure release buffer once we drop page lock, finally, the last ext4_walk_page_buffers() trigger the use-after-free problem. sync truncate ext4_sync_file() file_write_and_wait_range() ext4_setattr(0) inode->i_size = 0 ext4_writepage() len = 0 __ext4_journalled_writepage() page_bufs = page_buffers(page) ext4_walk_page_buffers(bget_one) <- does not get refcount do_invalidatepage() free_buffer_head() ext4_walk_page_buffers(page_bufs) <- trigger use-after-free After commit bdf96838aea6 ("ext4: fix race between truncate and __ext4_journalled_writepage()"), we have already handled the racing case, so the bget_one() and bput_one() are not needed. So this patch simply remove these hunk, and recheck the i_size to make it safe. Fixes: bdf96838aea6 ("ext4: fix race between truncate and __ext4_journalled_writepage()") Signed-off-by: Zhang Yi Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20211225090937.712867-1-yi.zhang@huawei.com Signed-off-by: Theodore Ts'o commit 298b5c521746d69c07beb2757292fb5ccc1b0f85 Author: Ye Bin Date: Fri Dec 24 18:03:41 2021 +0800 ext4: fix null-ptr-deref in '__ext4_journal_ensure_credits' We got issue as follows when run syzkaller test: [ 1901.130043] EXT4-fs error (device vda): ext4_remount:5624: comm syz-executor.5: Abort forced by user [ 1901.130901] Aborting journal on device vda-8. [ 1901.131437] EXT4-fs error (device vda): ext4_journal_check_start:61: comm syz-executor.16: Detected aborted journal [ 1901.131566] EXT4-fs error (device vda): ext4_journal_check_start:61: comm syz-executor.11: Detected aborted journal [ 1901.132586] EXT4-fs error (device vda): ext4_journal_check_start:61: comm syz-executor.18: Detected aborted journal [ 1901.132751] EXT4-fs error (device vda): ext4_journal_check_start:61: comm syz-executor.9: Detected aborted journal [ 1901.136149] EXT4-fs error (device vda) in ext4_reserve_inode_write:6035: Journal has aborted [ 1901.136837] EXT4-fs error (device vda): ext4_journal_check_start:61: comm syz-fuzzer: Detected aborted journal [ 1901.136915] ================================================================== [ 1901.138175] BUG: KASAN: null-ptr-deref in __ext4_journal_ensure_credits+0x74/0x140 [ext4] [ 1901.138343] EXT4-fs error (device vda): ext4_journal_check_start:61: comm syz-executor.13: Detected aborted journal [ 1901.138398] EXT4-fs error (device vda): ext4_journal_check_start:61: comm syz-executor.1: Detected aborted journal [ 1901.138808] Read of size 8 at addr 0000000000000000 by task syz-executor.17/968 [ 1901.138817] [ 1901.138852] EXT4-fs error (device vda): ext4_journal_check_start:61: comm syz-executor.30: Detected aborted journal [ 1901.144779] CPU: 1 PID: 968 Comm: syz-executor.17 Not tainted 4.19.90-vhulk2111.1.0.h893.eulerosv2r10.aarch64+ #1 [ 1901.146479] Hardware name: linux,dummy-virt (DT) [ 1901.147317] Call trace: [ 1901.147552] dump_backtrace+0x0/0x2d8 [ 1901.147898] show_stack+0x28/0x38 [ 1901.148215] dump_stack+0xec/0x15c [ 1901.148746] kasan_report+0x108/0x338 [ 1901.149207] __asan_load8+0x58/0xb0 [ 1901.149753] __ext4_journal_ensure_credits+0x74/0x140 [ext4] [ 1901.150579] ext4_xattr_delete_inode+0xe4/0x700 [ext4] [ 1901.151316] ext4_evict_inode+0x524/0xba8 [ext4] [ 1901.151985] evict+0x1a4/0x378 [ 1901.152353] iput+0x310/0x428 [ 1901.152733] do_unlinkat+0x260/0x428 [ 1901.153056] __arm64_sys_unlinkat+0x6c/0xc0 [ 1901.153455] el0_svc_common+0xc8/0x320 [ 1901.153799] el0_svc_handler+0xf8/0x160 [ 1901.154265] el0_svc+0x10/0x218 [ 1901.154682] ================================================================== This issue may happens like this: Process1 Process2 ext4_evict_inode ext4_journal_start ext4_truncate ext4_ind_truncate ext4_free_branches ext4_ind_truncate_ensure_credits ext4_journal_ensure_credits_fn ext4_journal_restart handle->h_transaction = NULL; mount -o remount,abort /mnt -> trigger JBD abort start_this_handle -> will return failed ext4_xattr_delete_inode ext4_journal_ensure_credits ext4_journal_ensure_credits_fn __ext4_journal_ensure_credits jbd2_handle_buffer_credits journal = handle->h_transaction->t_journal; ->null-ptr-deref Now, indirect truncate process didn't handle error. To solve this issue maybe simply add check handle is abort in '__ext4_journal_ensure_credits' is enough, and i also think this is necessary. Cc: stable@kernel.org Signed-off-by: Ye Bin Link: https://lore.kernel.org/r/20211224100341.3299128-1-yebin10@huawei.com Signed-off-by: Theodore Ts'o commit c27c29c6af4f3f4ce925a2111c256733c5a5b430 Author: Harshad Shirwadkar Date: Wed Dec 1 08:34:21 2021 -0800 ext4: initialize err_blk before calling __ext4_get_inode_loc It is not guaranteed that __ext4_get_inode_loc will definitely set err_blk pointer when it returns EIO. To avoid using uninitialized variables, let's first set err_blk to 0. Reported-by: Dan Carpenter Signed-off-by: Harshad Shirwadkar Link: https://lore.kernel.org/r/20211201163421.2631661-1-harshads@google.com Signed-off-by: Theodore Ts'o Cc: stable@kernel.org commit 8c80fb312d7abf8bcd66cca1d843a80318a2c522 Author: Chunguang Xu Date: Tue Nov 23 09:17:57 2021 +0800 ext4: fix a possible ABBA deadlock due to busy PA We found on older kernel (3.10) that in the scenario of insufficient disk space, system may trigger an ABBA deadlock problem, it seems that this problem still exists in latest kernel, try to fix it here. The main process triggered by this problem is that task A occupies the PA and waits for the jbd2 transaction finish, the jbd2 transaction waits for the completion of task B's IO (plug_list), but task B waits for the release of PA by task A to finish discard, which indirectly forms an ABBA deadlock. The related calltrace is as follows: Task A vfs_write ext4_mb_new_blocks() ext4_mb_mark_diskspace_used() JBD2 jbd2_journal_get_write_access() -> jbd2_journal_commit_transaction() ->schedule() filemap_fdatawait() | | | Task B | | do_unlinkat() | | ext4_evict_inode() | | jbd2_journal_begin_ordered_truncate() | | filemap_fdatawrite_range() | | ext4_mb_new_blocks() | -ext4_mb_discard_group_preallocations() <----- Here, try to cancel ext4_mb_discard_group_preallocations() internal retry due to PA busy, and do a limited number of retries inside ext4_mb_discard_preallocations(), which can circumvent the above problems, but also has some advantages: 1. Since the PA is in a busy state, if other groups have free PAs, keeping the current PA may help to reduce fragmentation. 2. Continue to traverse forward instead of waiting for the current group PA to be released. In most scenarios, the PA discard time can be reduced. However, in the case of smaller free space, if only a few groups have space, then due to multiple traversals of the group, it may increase CPU overhead. But in contrast, I feel that the overall benefit is better than the cost. Signed-off-by: Chunguang Xu Reported-by: kernel test robot Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/1637630277-23496-1-git-send-email-brookxu.cn@gmail.com Signed-off-by: Theodore Ts'o Cc: stable@kernel.org commit dfac1a167068d60b36cc8f2081394a28b6fc424b Author: Qing Wang Date: Tue Oct 12 20:28:51 2021 -0700 ext4: replace snprintf in show functions with sysfs_emit coccicheck complains about the use of snprintf() in sysfs show functions. Fix the coccicheck warning: WARNING: use scnprintf or sprintf. Use sysfs_emit instead of scnprintf or sprintf makes more sense. Signed-off-by: Qing Wang Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/1634095731-4528-1-git-send-email-wangqing@vivo.com Signed-off-by: Theodore Ts'o commit 4013d47a5307fdb5c13370b5392498b00fedd274 Author: Jan Kara Date: Thu Oct 7 17:53:36 2021 +0200 ext4: make sure to reset inode lockdep class when quota enabling fails When we succeed in enabling some quota type but fail to enable another one with quota feature, we correctly disable all enabled quota types. However we forget to reset i_data_sem lockdep class. When the inode gets freed and reused, it will inherit this lockdep class (i_data_sem is initialized only when a slab is created) and thus eventually lockdep barfs about possible deadlocks. Reported-and-tested-by: syzbot+3b6f9218b1301ddda3e2@syzkaller.appspotmail.com Signed-off-by: Jan Kara Cc: stable@kernel.org Link: https://lore.kernel.org/r/20211007155336.12493-3-jack@suse.cz Signed-off-by: Theodore Ts'o commit 15fc69bbbbbc8c72e5f6cc4e1be0f51283c5448e Author: Jan Kara Date: Thu Oct 7 17:53:35 2021 +0200 ext4: make sure quota gets properly shutdown on error When we hit an error when enabling quotas and setting inode flags, we do not properly shutdown quota subsystem despite returning error from Q_QUOTAON quotactl. This can lead to some odd situations like kernel using quota file while it is still writeable for userspace. Make sure we properly cleanup the quota subsystem in case of error. Signed-off-by: Jan Kara Cc: stable@kernel.org Link: https://lore.kernel.org/r/20211007155336.12493-2-jack@suse.cz Signed-off-by: Theodore Ts'o commit 380a0091cab482489e9b19e07f2a166ad2b76d5c Author: Ye Bin Date: Thu Dec 23 09:55:06 2021 +0800 ext4: Fix BUG_ON in ext4_bread when write quota data We got issue as follows when run syzkaller: [ 167.936972] EXT4-fs error (device loop0): __ext4_remount:6314: comm rep: Abort forced by user [ 167.938306] EXT4-fs (loop0): Remounting filesystem read-only [ 167.981637] Assertion failure in ext4_getblk() at fs/ext4/inode.c:847: '(EXT4_SB(inode->i_sb)->s_mount_state & EXT4_FC_REPLAY) || handle != NULL || create == 0' [ 167.983601] ------------[ cut here ]------------ [ 167.984245] kernel BUG at fs/ext4/inode.c:847! [ 167.984882] invalid opcode: 0000 [#1] PREEMPT SMP KASAN PTI [ 167.985624] CPU: 7 PID: 2290 Comm: rep Tainted: G B 5.16.0-rc5-next-20211217+ #123 [ 167.986823] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS ?-20190727_073836-buildvm-ppc64le-16.ppc.fedoraproject.org-3.fc31 04/01/2014 [ 167.988590] RIP: 0010:ext4_getblk+0x17e/0x504 [ 167.989189] Code: c6 01 74 28 49 c7 c0 a0 a3 5c 9b b9 4f 03 00 00 48 c7 c2 80 9c 5c 9b 48 c7 c6 40 b6 5c 9b 48 c7 c7 20 a4 5c 9b e8 77 e3 fd ff <0f> 0b 8b 04 244 [ 167.991679] RSP: 0018:ffff8881736f7398 EFLAGS: 00010282 [ 167.992385] RAX: 0000000000000094 RBX: 1ffff1102e6dee75 RCX: 0000000000000000 [ 167.993337] RDX: 0000000000000001 RSI: ffffffff9b6e29e0 RDI: ffffed102e6dee66 [ 167.994292] RBP: ffff88816a076210 R08: 0000000000000094 R09: ffffed107363fa09 [ 167.995252] R10: ffff88839b1fd047 R11: ffffed107363fa08 R12: ffff88816a0761e8 [ 167.996205] R13: 0000000000000000 R14: 0000000000000021 R15: 0000000000000001 [ 167.997158] FS: 00007f6a1428c740(0000) GS:ffff88839b000000(0000) knlGS:0000000000000000 [ 167.998238] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 167.999025] CR2: 00007f6a140716c8 CR3: 0000000133216000 CR4: 00000000000006e0 [ 167.999987] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 168.000944] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 168.001899] Call Trace: [ 168.002235] [ 168.007167] ext4_bread+0xd/0x53 [ 168.007612] ext4_quota_write+0x20c/0x5c0 [ 168.010457] write_blk+0x100/0x220 [ 168.010944] remove_free_dqentry+0x1c6/0x440 [ 168.011525] free_dqentry.isra.0+0x565/0x830 [ 168.012133] remove_tree+0x318/0x6d0 [ 168.014744] remove_tree+0x1eb/0x6d0 [ 168.017346] remove_tree+0x1eb/0x6d0 [ 168.019969] remove_tree+0x1eb/0x6d0 [ 168.022128] qtree_release_dquot+0x291/0x340 [ 168.023297] v2_release_dquot+0xce/0x120 [ 168.023847] dquot_release+0x197/0x3e0 [ 168.024358] ext4_release_dquot+0x22a/0x2d0 [ 168.024932] dqput.part.0+0x1c9/0x900 [ 168.025430] __dquot_drop+0x120/0x190 [ 168.025942] ext4_clear_inode+0x86/0x220 [ 168.026472] ext4_evict_inode+0x9e8/0xa22 [ 168.028200] evict+0x29e/0x4f0 [ 168.028625] dispose_list+0x102/0x1f0 [ 168.029148] evict_inodes+0x2c1/0x3e0 [ 168.030188] generic_shutdown_super+0xa4/0x3b0 [ 168.030817] kill_block_super+0x95/0xd0 [ 168.031360] deactivate_locked_super+0x85/0xd0 [ 168.031977] cleanup_mnt+0x2bc/0x480 [ 168.033062] task_work_run+0xd1/0x170 [ 168.033565] do_exit+0xa4f/0x2b50 [ 168.037155] do_group_exit+0xef/0x2d0 [ 168.037666] __x64_sys_exit_group+0x3a/0x50 [ 168.038237] do_syscall_64+0x3b/0x90 [ 168.038751] entry_SYSCALL_64_after_hwframe+0x44/0xae In order to reproduce this problem, the following conditions need to be met: 1. Ext4 filesystem with no journal; 2. Filesystem image with incorrect quota data; 3. Abort filesystem forced by user; 4. umount filesystem; As in ext4_quota_write: ... if (EXT4_SB(sb)->s_journal && !handle) { ext4_msg(sb, KERN_WARNING, "Quota write (off=%llu, len=%llu)" " cancelled because transaction is not started", (unsigned long long)off, (unsigned long long)len); return -EIO; } ... We only check handle if NULL when filesystem has journal. There is need check handle if NULL even when filesystem has no journal. Signed-off-by: Ye Bin Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20211223015506.297766-1-yebin10@huawei.com Signed-off-by: Theodore Ts'o Cc: stable@kernel.org commit ab047d516dea72f011c15c04a929851e4d053109 Author: Sebastian Andrzej Siewior Date: Thu Dec 23 17:44:36 2021 +0100 ext4: destroy ext4_fc_dentry_cachep kmemcache on module removal The kmemcache for ext4_fc_dentry_cachep remains registered after module removal. Destroy ext4_fc_dentry_cachep kmemcache on module removal. Fixes: aa75f4d3daaeb ("ext4: main fast-commit commit path") Signed-off-by: Sebastian Andrzej Siewior Reviewed-by: Lukas Czerner Reviewed-by: Harshad Shirwadkar Link: https://lore.kernel.org/r/20211110134640.lyku5vklvdndw6uk@linutronix.de Link: https://lore.kernel.org/r/YbiK3JetFFl08bd7@linutronix.de Link: https://lore.kernel.org/r/20211223164436.2628390-1-bigeasy@linutronix.de Signed-off-by: Theodore Ts'o Cc: stable@kernel.org commit 9725958bb75cdfa10f2ec11526fdb23e7485e8e4 Author: Xin Yin Date: Thu Dec 23 11:23:37 2021 +0800 ext4: fast commit may miss tracking unwritten range during ftruncate If use FALLOC_FL_KEEP_SIZE to alloc unwritten range at bottom, the inode->i_size will not include the unwritten range. When call ftruncate with fast commit enabled, it will miss to track the unwritten range. Change to trace the full range during ftruncate. Signed-off-by: Xin Yin Reviewed-by: Harshad Shirwadkar Link: https://lore.kernel.org/r/20211223032337.5198-3-yinxin.x@bytedance.com Signed-off-by: Theodore Ts'o Cc: stable@kernel.org commit 0b5b5a62b945a141e64011b2f90ee7e46f14be98 Author: Xin Yin Date: Thu Dec 23 11:23:36 2021 +0800 ext4: use ext4_ext_remove_space() for fast commit replay delete range For now ,we use ext4_punch_hole() during fast commit replay delete range procedure. But it will be affected by inode->i_size, which may not correct during fast commit replay procedure. The following test will failed. -create & write foo (len 1000K) -falloc FALLOC_FL_ZERO_RANGE foo (range 400K - 600K) -create & fsync bar -falloc FALLOC_FL_PUNCH_HOLE foo (range 300K-500K) -fsync foo -crash before a full commit After the fast_commit reply procedure, the range 400K-500K will not be removed. Because in this case, when calling ext4_punch_hole() the inode->i_size is 0, and it just retruns with doing nothing. Change to use ext4_ext_remove_space() instead of ext4_punch_hole() to remove blocks of inode directly. Signed-off-by: Xin Yin Reviewed-by: Harshad Shirwadkar Link: https://lore.kernel.org/r/20211223032337.5198-2-yinxin.x@bytedance.com Signed-off-by: Theodore Ts'o Cc: stable@kernel.org commit 5e4d0eba1ccaf19f93222abdeda5a368be141785 Author: Xin Yin Date: Tue Dec 21 10:28:39 2021 +0800 ext4: fix fast commit may miss tracking range for FALLOC_FL_ZERO_RANGE when call falloc with FALLOC_FL_ZERO_RANGE, to set an range to unwritten, which has been already initialized. If the range is align to blocksize, fast commit will not track range for this change. Also track range for unwritten range in ext4_map_blocks(). Signed-off-by: Xin Yin Reviewed-by: Harshad Shirwadkar Link: https://lore.kernel.org/r/20211221022839.374606-1-yinxin.x@bytedance.com Signed-off-by: Theodore Ts'o Cc: stable@kernel.org commit 74a5257a0c175810d620b5e631c4e7554955ac25 Author: Thomas Gleixner Date: Mon Jan 10 19:12:45 2022 +0100 genirq/msi: Populate sysfs entry only once The MSI entries for multi-MSI are populated en bloc for the MSI descriptor, but the current code invokes the population inside the per interrupt loop which triggers a warning in the sysfs code and causes the interrupt allocation to fail. Move it outside of the loop so it works correctly for single and multi-MSI. Fixes: bf5e758f02fc ("genirq/msi: Simplify sysfs handling") Reported-by: Borislav Petkov Signed-off-by: Thomas Gleixner Tested-by: Borislav Petkov Link: https://lore.kernel.org/r/87leznqx2a.ffs@tglx commit 133d9c53c9dcbb1b8f317e402e79c44d9eb725c9 Merge: 3c6d4056663da 9102fa3460415 Author: Linus Torvalds Date: Mon Jan 10 10:20:15 2022 -0800 Merge tag 'x86_vdso_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 vdso updates from Borislav Petkov: "Remove -nostdlib compiler flag now that the vDSO uses the linker instead of the compiler driver to link files" * tag 'x86_vdso_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/purgatory: Remove -nostdlib compiler flag x86/vdso: Remove -nostdlib compiler flag commit 3c6d4056663dad0ea0b87b21fe98415b9dbcdd5b Merge: 25f8c7785e254 5fe392ff9d1f7 Author: Linus Torvalds Date: Mon Jan 10 10:18:58 2022 -0800 Merge tag 'x86_build_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 build fix from Borislav Petkov: "A fix for cross-compiling the compressed stub on arm64 with clang" * tag 'x86_build_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/boot/compressed: Move CLANG_FLAGS to beginning of KBUILD_CFLAGS commit 25f8c7785e254779fbd2127c4eced81811e8e421 Merge: 308319e990ae9 244122b4d2e52 Author: Linus Torvalds Date: Mon Jan 10 10:09:22 2022 -0800 Merge tag 'x86_cpu_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 cpuid updates from Borislav Petkov: - Enable the short string copies for CPUs which support them, in copy_user_enhanced_fast_string() - Avoid writing MSR_CSTAR on Intel due to TDX guests raising a #VE trap * tag 'x86_cpu_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/lib: Add fast-short-rep-movs check to copy_user_enhanced_fast_string() x86/cpu: Don't write CSTAR MSR on Intel CPUs commit 308319e990ae95b2a752fa0a1730f88598ca0dc7 Merge: 2e97a0c02b94f 0be4838f018c1 Author: Linus Torvalds Date: Mon Jan 10 10:02:27 2022 -0800 Merge tag 'x86_cleanups_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 cleanups from Borislav Petkov: "The mandatory set of random minor cleanups all over tip" * tag 'x86_cleanups_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/events/amd/iommu: Remove redundant assignment to variable shift x86/boot/string: Add missing function prototypes x86/fpu: Remove duplicate copy_fpstate_to_sigframe() prototype x86/uaccess: Move variable into switch case statement commit 2e97a0c02b94f2ecd5cbf29ded90c5db055e8ad0 Merge: 4a692ae360615 4d5cff69fbddb Author: Linus Torvalds Date: Mon Jan 10 10:00:03 2022 -0800 Merge tag 'x86_misc_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull misc x86 updates from Borislav Petkov: "The pile which we cannot find the proper topic for so we stick it in x86/misc: - Add support for decoding instructions which do MMIO accesses in order to use it in SEV and TDX guests - An include fix and reorg to allow for removing set_fs in UML later" * tag 'x86_misc_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/mtrr: Remove the mtrr_bp_init() stub x86/sev-es: Use insn_decode_mmio() for MMIO implementation x86/insn-eval: Introduce insn_decode_mmio() x86/insn-eval: Introduce insn_get_modrm_reg_ptr() x86/insn-eval: Handle insn_get_opcode() failure commit 2a8ab0fbd110dec25795a98aaa232ede36f6c855 Merge: 84f91c62d6754 45c753f5f24d2 Author: Tejun Heo Date: Mon Jan 10 07:54:04 2022 -1000 Merge branch 'workqueue/for-5.16-fixes' into workqueue/for-5.17 for-5.16-fixes contains two subtle race conditions which were introduced by scheduler side code cleanups. The branch didn't get pushed out, so merge into for-5.17. commit 4a692ae360615026b25d64c29fc7c12c0ef63c5f Merge: bfed6efb8e136 b64dfcde1ca9c Author: Linus Torvalds Date: Mon Jan 10 09:51:38 2022 -0800 Merge tag 'x86_mm_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 mm updates from Borislav Petkov: - Flush *all* mappings from the TLB after switching to the trampoline pagetable to prevent any stale entries' presence - Flush global mappings from the TLB, in addition to the CR3-write, after switching off of the trampoline_pgd during boot to clear the identity mappings - Prevent instrumentation issues resulting from the above changes * tag 'x86_mm_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/mm: Prevent early boot triple-faults with instrumentation x86/mm: Include spinlock_t definition in pgtable. x86/mm: Flush global TLB when switching to trampoline page-table x86/mm/64: Flush global TLB on boot and AP bringup x86/realmode: Add comment for Global bit usage in trampoline_pgd x86/mm: Add missing dependency to commit bfed6efb8e136c0e0a4cc854f2aaa2ed6ac1b9e0 Merge: d3c20bfb74935 2056e2989bf47 Author: Linus Torvalds Date: Mon Jan 10 09:44:09 2022 -0800 Merge tag 'x86_sgx_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 SGX updates from Borislav Petkov: - Add support for handling hw errors in SGX pages: poisoning, recovering from poison memory and error injection into SGX pages - A bunch of changes to the SGX selftests to simplify and allow of SGX features testing without the need of a whole SGX software stack - Add a sysfs attribute which is supposed to show the amount of SGX memory in a NUMA node, similar to what /proc/meminfo is to normal memory - The usual bunch of fixes and cleanups too * tag 'x86_sgx_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (24 commits) x86/sgx: Fix NULL pointer dereference on non-SGX systems selftests/sgx: Fix corrupted cpuid macro invocation x86/sgx: Add an attribute for the amount of SGX memory in a NUMA node x86/sgx: Fix minor documentation issues selftests/sgx: Add test for multiple TCS entry selftests/sgx: Enable multiple thread support selftests/sgx: Add page permission and exception test selftests/sgx: Rename test properties in preparation for more enclave tests selftests/sgx: Provide per-op parameter structs for the test enclave selftests/sgx: Add a new kselftest: Unclobbered_vdso_oversubscribed selftests/sgx: Move setup_test_encl() to each TEST_F() selftests/sgx: Encpsulate the test enclave creation selftests/sgx: Dump segments and /proc/self/maps only on failure selftests/sgx: Create a heap for the test enclave selftests/sgx: Make data measurement for an enclave segment optional selftests/sgx: Assign source for each segment selftests/sgx: Fix a benign linker warning x86/sgx: Add check for SGX pages to ghes_do_memory_failure() x86/sgx: Add hook to error injection address validation x86/sgx: Hook arch_memory_failure() into mainline code ... commit d3c20bfb74935e31e47fe979a9d3d74c6d9c9040 Merge: 01d5e7872c1c2 df0114f1f8711 Author: Linus Torvalds Date: Mon Jan 10 09:42:36 2022 -0800 Merge tag 'x86_cache_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 resource control fixlet from Borislav Petkov: "A minor code cleanup removing a redundant assignment" * tag 'x86_cache_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/resctrl: Remove redundant assignment to variable chunks commit 01d5e7872c1c2c04f4fd419c9a4968e148efc5a0 Merge: cd36722d74733 20f07a044a76a Author: Linus Torvalds Date: Mon Jan 10 09:33:40 2022 -0800 Merge tag 'x86_sev_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 SEV updates from Borislav Petkov: "The accumulated pile of x86/sev generalizations and cleanups: - Share the SEV string unrolling logic with TDX as TDX guests need it too - Cleanups and generalzation of code shared by SEV and TDX" * tag 'x86_sev_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/sev: Move common memory encryption code to mem_encrypt.c x86/sev: Rename mem_encrypt.c to mem_encrypt_amd.c x86/sev: Use CC_ATTR attribute to generalize string I/O unroll x86/sev: Remove do_early_exception() forward declarations x86/head64: Carve out the guest encryption postprocessing into a helper x86/sev: Get rid of excessive use of defines x86/sev: Shorten GHCB terminate macro names commit cd36722d74733b748ae812e37dcfe035b420de67 Merge: e59451fd3bfa2 9e4d52a00a021 Author: Linus Torvalds Date: Mon Jan 10 09:21:36 2022 -0800 Merge tag 'x86_platform_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 platform fix from Borislav Petkov: "A single DT compatibility fix for the Intel media processor CE4100 driver" * tag 'x86_platform_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/ce4100: Replace "ti,pcf8575" by "nxp,pcf8575" commit e59451fd3bfa263c775c7dffb7c3df9a787c97bb Merge: 191cf7fab9ef5 6da5175dbe1c2 Author: Linus Torvalds Date: Mon Jan 10 09:09:36 2022 -0800 Merge tag 'x86_paravirt_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 paravirtualization fix from Borislav Petkov: "Define the INTERRUPT_RETURN macro only when CONFIG_XEN_PV is enabled as it is its only user" * tag 'x86_paravirt_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/paravirt: Fix build PARAVIRT_XXL=y without XEN_PV commit fff489ff0722bec127a05667bec00ea45cf9f77e Merge: 125521addcd68 2685c77b80a80 Author: Rafael J. Wysocki Date: Mon Jan 10 18:08:30 2022 +0100 Merge branch 'thermal-int340x' Merge int340x thermal driver update fixing RFIM mailbox write commands handling for 5.17-rc1. * thermal-int340x: thermal/drivers/int340x: Fix RFIM mailbox write commands commit 191cf7fab9ef5f5d4a2b2ad0094ef76ba18a7439 Merge: 8cc1e20765f03 0fe4ff885f8a5 Author: Linus Torvalds Date: Mon Jan 10 09:05:26 2022 -0800 Merge tag 'x86_fpu_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull x86 fpu update from Borislav Petkov: "A single x86/fpu update for 5.17: - Exclude AVX opmask registers use from AVX512 state tracking as they don't contribute to frequency throttling" * tag 'x86_fpu_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/fpu: Correct AVX512 state tracking commit 5fed0be8583f08c1548b4dcd9e5ee0d1133d0730 Author: Jaegeuk Kim Date: Fri Jan 7 20:08:45 2022 -0800 f2fs: do not allow partial truncation on pinned file If the pinned file has a hole by partial truncation, application that has the block map will be broken. Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 78e6e4dfd8f0cbb477a6f9571123edcbd5873c28 Merge: c001a52df4b6f ffb9bfa8e470f 702f21db4995f 36fd3609d0dd7 Author: Rafael J. Wysocki Date: Mon Jan 10 18:00:31 2022 +0100 Merge branches 'pm-opp', 'pm-devfreq' and 'powercap' Merge an operating performance points (OPP) update, devfreq updates and power capping updates for 5.17-rc1: - Update outdated OPP documentation (Tang Yizhou). - Reduce log severity for informative message regarding frequency transition failures in devfreq (Tzung-Bi Shih). - Add DRAM frequency controller devfreq driver for Allwinner sunXi SoCs (Samuel Holland). - Add missing COMMON_CLK dependency to the sun8i devfreq driver (Arnd Bergmann). - Add support for new layout of Psys PowerLimit Register on SPR to the Intel RAPL power capping driver (Zhang Rui). - Fix typo in a comment in idle_inject.c (Jason Wang). - Remove unused function definition from the DTPM (Dynamit Thermal Power Management) power capping framework (Daniel Lezcano). - Reduce DTPM trace verbosity (Daniel Lezcano). * pm-opp: Documentation: power: Update outdated contents in opp.rst * pm-devfreq: PM / devfreq: Reduce log severity for informative message PM / devfreq: sun8i: addd COMMON_CLK dependency PM / devfreq: Add a driver for the sun8i/sun50i MBUS * powercap: powercap/drivers/dtpm: Reduce trace verbosity powercap/drivers/dtpm: Remove unused function definition powercap: fix typo in a comment in idle_inject.c powercap: intel_rapl: support new layout of Psys PowerLimit Register on SPR commit 8cc1e20765f03a29442484a9acbc97e31578af92 Merge: f0d43b3a3809f 1a0ae068bf6b6 Author: Linus Torvalds Date: Mon Jan 10 08:59:33 2022 -0800 Merge tag 'm68k-for-v5.17-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k Pull m68k updates from Geert Uytterhoeven: - enable memtest functionality - defconfig updates * tag 'm68k-for-v5.17-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k: m68k: defconfig: Update defconfigs for v5.16-rc1 m68k: Enable memtest functionality commit f0d43b3a3809f280806825df2454fd83f71874c4 Merge: 9b9e211360044 0704a8586f756 Author: Linus Torvalds Date: Mon Jan 10 08:58:16 2022 -0800 Merge tag 's390-5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux Pull s390 updates from Heiko Carstens: "Besides all the small improvements and cleanups the most notable part is the fast vector/SIMD implementation of the ChaCha20 stream cipher, which is an adaptation of Andy Polyakov's code for the kernel. Summary: - add fast vector/SIMD implementation of the ChaCha20 stream cipher, which mainly adapts Andy Polyakov's code for the kernel - add status attribute to AP queue device so users can easily figure out its status - fix race in page table release code, and and lots of documentation - remove uevent suppress from cio device driver, since it turned out that it generated more problems than it solved problems - quite a lot of virtual vs physical address confusion fixes - various other small improvements and cleanups all over the place" * tag 's390-5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (39 commits) s390/dasd: use default_groups in kobj_type s390/sclp_sd: use default_groups in kobj_type s390/pci: simplify __pciwb_mio() inline asm s390: remove unused TASK_SIZE_OF s390/crash_dump: fix virtual vs physical address handling s390/crypto: fix compile error for ChaCha20 module s390/mm: check 2KB-fragment page on release s390/mm: better annotate 2KB pagetable fragments handling s390/mm: fix 2KB pgtable release race s390/sclp: release SCLP early buffer after kernel initialization s390/nmi: disable interrupts on extended save area update s390/zcrypt: CCA control CPRB sending s390/disassembler: update opcode table s390/uv: fix memblock virtual vs physical address confusion s390/smp: fix memblock_phys_free() vs memblock_free() confusion s390/sclp: fix memblock_phys_free() vs memblock_free() confusion s390/exit: remove dead reference to do_exit from copy_thread s390/ap: add missing virt_to_phys address conversion s390/pgalloc: use pointers instead of unsigned long values s390/pgalloc: add virt/phys address handling to base asce functions ... commit c001a52df4b6f90bfbfb4a6d6721aa7cd2bf2ebd Merge: 5561f25beb30b 7dfc5b6e909e8 50a4606655582 74d9555580c48 Author: Rafael J. Wysocki Date: Mon Jan 10 17:57:13 2022 +0100 Merge branches 'pm-cpuidle', 'pm-core' and 'pm-sleep' Merge cpuidle updates, PM core updates and one hiberation-related update for 5.17-rc1: - Make cpuidle use default_groups in kobj_type (Greg Kroah-Hartman). - Fix two comments in cpuidle code (Jason Wang, Yang Li). - Simplify locking in pm_runtime_put_suppliers() (Rafael Wysocki). - Add safety net to supplier device release in the runtime PM core code (Rafael Wysocki). - Capture device status before disabling runtime PM for it (Rafael Wysocki). - Add new macros for declaring PM operations to allow drivers to avoid guarding them with CONFIG_PM #ifdefs or __maybe_unused and update some drivers to use these macros (Paul Cercueil). - Allow ACPI hardware signature to be honoured during restore from hibernation (David Woodhouse). * pm-cpuidle: cpuidle: use default_groups in kobj_type cpuidle: Fix cpuidle_remove_state_sysfs() kerneldoc comment cpuidle: menu: Fix typo in a comment * pm-core: PM: runtime: Simplify locking in pm_runtime_put_suppliers() mmc: mxc: Use the new PM macros mmc: jz4740: Use the new PM macros PM: runtime: Add safety net to supplier device release PM: runtime: Capture device status before disabling runtime PM PM: core: Add new *_PM_OPS macros, deprecate old ones PM: core: Redefine pm_ptr() macro r8169: Avoid misuse of pm_ptr() macro * pm-sleep: PM: hibernate: Allow ACPI hardware signature to be honoured commit 5561f25beb30bfd95559972858125320411e00d9 Merge: 4ecc933b7d1f4 6c4ab1b86dac3 Author: Rafael J. Wysocki Date: Mon Jan 10 17:54:45 2022 +0100 Merge branch 'pm-cpufreq' Merge cpufreq updates for 5.17-rc1: - Add new P-state driver for AMD processors (Huang Rui). - Fix initialization of min and max frequency QoS requests in the cpufreq core (Rafael Wysocki). - Fix EPP handling on Alder Lake in intel_pstate (Srinivas Pandruvada). - Make intel_pstate update cpuinfo.max_freq when notified of HWP capabilities changes and drop a redundant function call from that driver (Rafael Wysocki). - Improve IRQ support in the Qcom cpufreq driver (Ard Biesheuvel, Stephen Boyd, Vladimir Zapolskiy). - Fix double devm_remap() in the Mediatek cpufreq driver (Hector Yuan). - Introduce thermal pressure helpers for cpufreq CPU cooling (Lukasz Luba). - Make cpufreq use default_groups in kobj_type (Greg Kroah-Hartman). * pm-cpufreq: (32 commits) x86, sched: Fix undefined reference to init_freq_invariance_cppc() build error cpufreq: amd-pstate: Fix Kconfig dependencies for AMD P-State cpufreq: amd-pstate: Fix struct amd_cpudata kernel-doc comment MAINTAINERS: Add AMD P-State driver maintainer entry Documentation: amd-pstate: Add AMD P-State driver introduction cpufreq: amd-pstate: Add AMD P-State performance attributes cpufreq: amd-pstate: Add AMD P-State frequencies attributes cpufreq: amd-pstate: Add boost mode support for AMD P-State cpufreq: amd-pstate: Add trace for AMD P-State module cpufreq: amd-pstate: Introduce the support for the processors with shared memory solution cpufreq: amd-pstate: Add fast switch function for AMD P-State cpufreq: amd-pstate: Introduce a new AMD P-State driver to support future processors ACPI: CPPC: Add CPPC enable register function ACPI: CPPC: Check present CPUs for determining _CPC is valid ACPI: CPPC: Implement support for SystemIO registers x86/msr: Add AMD CPPC MSR definitions x86/cpufeatures: Add AMD Collaborative Processor Performance Control feature flag cpufreq: use default_groups in kobj_type cpufreq: mediatek-hw: Fix double devm_remap in hotplug case cpufreq: intel_pstate: Update cpuinfo.max_freq on HWP_CAP changes ... commit 9b9e211360044c12d7738973c944d6f300134881 Merge: a7ac314061375 945409a6ef442 Author: Linus Torvalds Date: Mon Jan 10 08:49:37 2022 -0800 Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 updates from Catalin Marinas: - KCSAN enabled for arm64. - Additional kselftests to exercise the syscall ABI w.r.t. SVE/FPSIMD. - Some more SVE clean-ups and refactoring in preparation for SME support (scalable matrix extensions). - BTI clean-ups (SYM_FUNC macros etc.) - arm64 atomics clean-up and codegen improvements. - HWCAPs for FEAT_AFP (alternate floating point behaviour) and FEAT_RPRESS (increased precision of reciprocal estimate and reciprocal square root estimate). - Use SHA3 instructions to speed-up XOR. - arm64 unwind code refactoring/unification. - Avoid DC (data cache maintenance) instructions when DCZID_EL0.DZP == 1 (potentially set by a hypervisor; user-space already does this). - Perf updates for arm64: support for CI-700, HiSilicon PCIe PMU, Marvell CN10K LLC-TAD PMU, miscellaneous clean-ups. - Other fixes and clean-ups; highlights: fix the handling of erratum 1418040, correct the calculation of the nomap region boundaries, introduce io_stop_wc() mapped to the new DGH instruction (data gathering hint). * tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (81 commits) arm64: Use correct method to calculate nomap region boundaries arm64: Drop outdated links in comments arm64: perf: Don't register user access sysctl handler multiple times drivers: perf: marvell_cn10k: fix an IS_ERR() vs NULL check perf/smmuv3: Fix unused variable warning when CONFIG_OF=n arm64: errata: Fix exec handling in erratum 1418040 workaround arm64: Unhash early pointer print plus improve comment asm-generic: introduce io_stop_wc() and add implementation for ARM64 arm64: Ensure that the 'bti' macro is defined where linkage.h is included arm64: remove __dma_*_area() aliases docs/arm64: delete a space from tagged-address-abi arm64: Enable KCSAN kselftest/arm64: Add pidbench for floating point syscall cases arm64/fp: Add comments documenting the usage of state restore functions kselftest/arm64: Add a test program to exercise the syscall ABI kselftest/arm64: Allow signal tests to trigger from a function kselftest/arm64: Parameterise ptrace vector length information arm64/sve: Minor clarification of ABI documentation arm64/sve: Generalise vector length configuration prctl() for SME arm64/sve: Make sysctl interface for SVE reusable by SME ... commit c40238e3b8c98993e3c70057f6099e24cc2380f7 Author: Zhu Yanjun Date: Mon Jan 10 02:37:33 2022 -0500 RDMA/irdma: Remove the redundant return The type of the function i40iw_remove is void. So remove the unnecessary return. Link: https://lore.kernel.org/r/20220110073733.3221379-1-yanjun.zhu@linux.dev Signed-off-by: Zhu Yanjun Reviewed-by: Leon Romanovsky Acked-by: Shiraz Saleem Signed-off-by: Jason Gunthorpe commit a7ac314061375c7805e0d3a26aad6eb0c41100df Merge: bb4ed26e7e837 733e417518a69 Author: Linus Torvalds Date: Mon Jan 10 08:42:28 2022 -0800 Merge tag 'asm-generic-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic Pull asm-generic cleanups from Arnd Bergmann: "A few minor cleanups for cross-architecture code: Alexandre Ghiti deals with removing some leftovers from drivers and features that have been removed, and Wasin Thonkaew has a cosmetic change" * tag 'asm-generic-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic: asm-generic/error-injection.h: fix a spelling mistake, and a coding style issue arch: Remove leftovers from prism54 wireless driver arch: Remove leftovers from mandatory file locking Documentation, arch: Remove leftovers from CIFS_WEAK_PW_HASH Documentation, arch: Remove leftovers from raw device commit bb4ed26e7e837ca3034d4105491436d54c430038 Merge: aca48b2dd1e70 299e6f788eab0 Author: Linus Torvalds Date: Mon Jan 10 08:32:37 2022 -0800 Merge tag 'newsoc-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull RISC-V SoC updates from Arnd Bergmann: "Add support for StarFive JH7100 RISC-V SoC This adds support for the StarFive JH7100, including the necessary device drivers and DT files for the BeagleV Starlight prototype board, with additional boards to be added later. This SoC promises to be the first usable low-cost platform for RISC-V. I've taken this through the SoC tree in the anticipation of adding a few other Arm based SoCs as well, but those did not pass the review in time, so it's only this one" * tag 'newsoc-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: reset: starfive-jh7100: Fix 32bit compilation RISC-V: Add BeagleV Starlight Beta device tree RISC-V: Add initial StarFive JH7100 device tree serial: 8250_dw: Add StarFive JH7100 quirk dt-bindings: serial: snps-dw-apb-uart: Add JH7100 uarts pinctrl: starfive: Add pinctrl driver for StarFive SoCs dt-bindings: pinctrl: Add StarFive JH7100 bindings dt-bindings: pinctrl: Add StarFive pinctrl definitions reset: starfive-jh7100: Add StarFive JH7100 reset driver dt-bindings: reset: Add Starfive JH7100 reset bindings dt-bindings: reset: Add StarFive JH7100 reset definitions clk: starfive: Add JH7100 clock generator driver dt-bindings: clock: starfive: Add JH7100 bindings dt-bindings: clock: starfive: Add JH7100 clock definitions dt-bindings: interrupt-controller: Add StarFive JH7100 plic dt-bindings: timer: Add StarFive JH7100 clint RISC-V: Add StarFive SoC Kconfig option commit aca48b2dd1e70bb1be23bf5eb2fa50da9f6c2579 Merge: e85195d5bf897 8b0c59c622dc4 Author: Linus Torvalds Date: Mon Jan 10 08:24:40 2022 -0800 Merge tag 'dt-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC devicetree updates from Arnd Bergmann: "As usual, this is the bulk of the updates for the SoC tree, adding more devices to existing files, addressing issues from ever improving automated checking, and fixing minor issues. The most interesting bits as usual are the new platforms. All the newly supported SoCs belong into existing families this time: - Qualcomm gets support for two newly announced platforms, both of which can now work in production environments: the SDX65 5G modem that can run a minimal Linux on its Cortex-A7 core, and the Snapdragon 8 Gen 1, their latest high-end phone SoC. - Renesas adds support for R-Car S4-8, the most recent automotive Server/Communication SoC. - TI adds support for J721s2, a new automotive SoC in the K3 family. - Mediatek MT7986a/b is a SoC used in Wifi routers, the latest generation following their popular MT76xx series. Only basic support is added for now. - NXP i.MX8 ULP8 is a new low-power variant of the widespread i.MX8 series. - TI SPEAr320s is a minor variant of the old SPEAr320 SoC that we have supported for a long time. New boards with the existing SoCs include - Aspeed AST2500/AST2600 BMCs in TYAN, Facebook and Yadro servers - AT91/SAMA5 based evaluation board - NXP gains twenty new development and industrial boards for their i.MX and Layerscape SoCs - Intel IXP4xx now supports the final two machines in device tree that were previously only supported in old style board files. - Mediatek MT6589 is used in the Fairphone FP1 phone from 2013, while MT8183 is used in the Acer Chromebook 314. - Qualcomm gains support for the reference machines using the two new SoCs, plus a number of Chromebook variants and phones based on the Snapdragon 7c, 845 and 888 SoCs, including various Sony Xperia devices and the Microsoft Surface Duo 2. - ST STM32 now supports the Engicam i.Core STM32MP1 carrier board. - Tegra now boots various older Android devices based on 32-bit chips out of the box, including a number of ASUS Transformer tablets. There is also a new Jetson AGX Orin developer kit. - Apple support adds the missing device trees for all the remaining M1 Macbook and iMac variants, though not yet the M1 Pro/Max versions. - Allwinner now supports another version of the Tanix TX6 set-top box based on the H6 SoC. - Broadcom gains support for the Netgear RAXE500 Wireless router based on BCM4908" * tag 'dt-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (574 commits) Revert "ARM: dts: BCM5301X: define RTL8365MB switch on Asus RT-AC88U" arm64: dts: qcom: sm6125: Avoid using missing SM6125_VDDCX arm64: dts: qcom: sm8450-qrd: Enable USB nodes arm64: dts: qcom: sm8450: Add usb nodes ARM: dts: aspeed: add LCLK setting into LPC KCS nodes dt-bindings: ipmi: bt-bmc: add 'clocks' as a required property ARM: dts: aspeed: add LCLK setting into LPC IBT node ARM: dts: aspeed: p10: Add TPM device ARM: dts: aspeed: p10: Enable USB host ports ARM: dts: aspeed: Add TYAN S8036 BMC machine ARM: dts: aspeed: tyan-s7106: Add uart_routing and fix vuart config ARM: dts: aspeed: Adding Facebook Bletchley BMC ARM: dts: aspeed: g220a: Enable secondary flash ARM: dts: Add openbmc-flash-layout-64-alt.dtsi ARM: dts: aspeed: Add secure boot controller node dt-bindings: aspeed: Add Secure Boot Controller bindings ARM: dts: Remove "spidev" nodes dt-bindings: pinctrl: samsung: Add pin drive definitions for Exynos850 dt-bindings: arm: samsung: Document E850-96 board binding dt-bindings: Add vendor prefix for WinLink ... commit 70df8e1bdc941431af2370270f5140291dcbb282 Merge: af8fefd744448 7e29a225c7508 bcf6f1759adff 17f18417d6da0 1a901c914dfbe e5b5d25444e9e e96c1197aca62 Author: Rafael J. Wysocki Date: Mon Jan 10 17:22:15 2022 +0100 Merge branches 'acpi-tables', 'acpi-numa', 'acpi-sysfs', 'acpi-cppc', 'acpi-thermal' and 'acpi-battery' Merge ACPI tables parsing code update, NUMA-related ACPI update, CPPC documentation update, ACPI sysfs attributes handling update and ACPI thermal and battery drivers updates for 5.17-rc1: - Add AEST to the list of known ACPI table signatures (Shuuichirou Ishii). - Make ACPI NUMA code take hotpluggable memblocks into account when CONFIG_MEMORY_HOTPLUG is not set (Vitaly Kuznetsov). - Use default_groups in kobj_type in the ACPI sysfs code (Greg Kroah-Hartman). - Rearrange _CPC structure documentation (Andy Shevchenko). - Drop an always true check from the ACPI thermal driver (Adam Borowski). - Add new "not charging" quirk for Lenovo ThinkPads to the ACPI battery driver (Thomas Weißschuh). * acpi-tables: ACPI: tables: Add AEST to the list of known table signatures * acpi-numa: ACPI: NUMA: Process hotpluggable memblocks when !CONFIG_MEMORY_HOTPLUG * acpi-sysfs: ACPI: sysfs: use default_groups in kobj_type * acpi-cppc: ACPI: CPPC: Amend documentation in the comments * acpi-thermal: ACPI: thermal: drop an always true check * acpi-battery: ACPI: battery: Add the ThinkPad "Not Charging" quirk commit e85195d5bf8979f6db3f12cf8f1294887bf6b037 Merge: 0dca3c5e017ab 13ee75c7b57c5 Author: Linus Torvalds Date: Mon Jan 10 08:13:52 2022 -0800 Merge tag 'drivers-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC driver updates from Arnd Bergmann: "There are cleanups and minor bugfixes across several SoC specific drivers, for Qualcomm, Samsung, NXP i.MX, AT91, Tegra, Keystone, Renesas, ZynqMP Noteworthy new features are: - The op-tee firmware driver gains support for asynchronous notifications from secure-world firmware. - Qualcomm platforms gain support for new SoC types in various drivers: power domain, cache controller, RPM sleep, soc-info - Samsung SoC drivers gain support for new SoCs in ChipID and PMU, as well as a new USIv2 driver that handles various types of serial communiction (uart, i2c, spi) - Renesas adds support for R-Car S4-8 (R8A779F0) in multiple drivers, as well as memory controller support for RZ/G2L (R9A07G044). - Apple M1 gains support for the PMGR power management driver" * tag 'drivers-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (94 commits) soc: qcom: rpmh-rsc: Fix typo in a comment soc: qcom: socinfo: Add SM6350 and SM7225 dt-bindings: arm: msm: Don't mark LLCC interrupt as required dt-bindings: firmware: scm: Add SM6350 compatible dt-bindings: arm: msm: Add LLCC for SM6350 soc: qcom: rpmhpd: Sort power-domain definitions and lists soc: qcom: rpmhpd: Remove mx/cx relationship on sc7280 soc: qcom: rpmhpd: Rename rpmhpd struct names soc: qcom: rpmhpd: sm8450: Add the missing .peer for sm8450_cx_ao soc: qcom: socinfo: add SM8450 ID soc: qcom: rpmhpd: Add SM8450 power domains dt-bindings: power: rpmpd: Add SM8450 to rpmpd binding soc: qcom: smem: Update max processor count dt-bindings: arm: qcom: Document SM8450 SoC and boards dt-bindings: firmware: scm: Add SM8450 compatible dt-bindings: arm: cpus: Add kryo780 compatible soc: qcom: rpmpd: Add support for sm6125 dt-bindings: qcom-rpmpd: Add sm6125 power domains soc: qcom: aoss: constify static struct thermal_cooling_device_ops PM: AVS: qcom-cpr: Use div64_ul instead of do_div ... commit 0dca3c5e017ab81ebe21eb9096f657c45a6b17a4 Merge: 1135ec008ef37 0d2589aa5ca99 Author: Linus Torvalds Date: Mon Jan 10 08:12:26 2022 -0800 Merge tag 'defconfig-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM defconfig updates from Arnd Bergmann: "These are the usual changes to enable newly added driver by default, and to do some housekeeping around changing Kconfig symbols" * tag 'defconfig-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: arm64: defconfig: Enable Samsung I2C driver ARM: configs: at91: Enable crypto software implementations ARM: configs: at91: sama7: Enable SPI NOR and QSPI controller ARM: config: multi v7: Enable NVIDIA Tegra20 APB DMA driver ARM: config: multi v7: Enable NVIDIA Tegra20 S/PDIF driver ARM: tegra_defconfig: Enable S/PDIF driver ARM: imx_v6_v7_defconfig: Enable for DHCOM devices required RTC_DRV_RV3029C2 ARM: config: multi v7: Enable display drivers used by Tegra devices ARM: tegra_defconfig: Enable drivers wanted by Acer Chromebooks and ASUS tablets ARM: configs: gemini: Activate crypto driver arm64: defconfig: enable drivers for booting i.MX8ULP arm64: defconfig: Enable R-Car S4-8 arm64: defconfig: enable drivers for TQ TQMa8MxML-MBa8Mx arm64: defconfig: Enable OV5640 arm64: defconfig: Enable VIDEO_IMX_MEDIA commit 1135ec008ef3745cd1cee5bc543cfe48427c22a9 Merge: df0cc57e057f1 fe47ec5fa8ec2 Author: Linus Torvalds Date: Mon Jan 10 08:10:20 2022 -0800 Merge tag 'soc-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc Pull ARM SoC updates from Arnd Bergmann: "These are all minor bug fixes and cleanups to code in arch/arm and arch/arm64 that is specific to one SoC, updating Kconfig symbols, the MAINTAINERS file, and removing some dead code" * tag 'soc-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: arm64: exynos: Enable Exynos Multi-Core Timer driver ARM: ixp4xx: remove unused header file pata_ixp4xx_cf.h ARM: ixp4xx: remove dead configs CPU_IXP43X and CPU_IXP46X MAINTAINERS: Add Florian as BCM5301X and BCM53573 maintainer ARM: samsung: Remove HAVE_S3C2410_I2C and use direct dependencies ARM: imx: rename DEBUG_IMX21_IMX27_UART to DEBUG_IMX27_UART ARM: imx: remove dead left-over from i.MX{27,31,35} removal ARM: s3c: add one more "fallthrough" statement in Jive ARM: s3c: include header for prototype of s3c2410_modify_misccr ARM: shmobile: rcar-gen2: Add missing of_node_put() commit 86599dbe2c5272588f859858239d1f52321eb0f9 Author: Tom Zanussi Date: Mon Jan 10 08:04:14 2022 -0600 tracing: Add helper functions to simplify event_command.parse() callback handling The event_command.parse() callback is responsible for parsing and registering triggers. The existing command implementions for this callback duplicate a lot of the same code, so to clean up and consolidate those implementations, introduce a handful of helper functions for implementors to use. This also makes it easier for new commands to be implemented and allows them to focus more on the customizations they provide rather than obscuring and complicating it with boilerplate code. Link: https://lkml.kernel.org/r/c1ff71f594d45177706571132bd3119491097221.1641823001.git.zanussi@kernel.org Signed-off-by: Tom Zanussi Signed-off-by: Steven Rostedt commit 2378a2d6b6cf863bdd566aae495336c72bdaec99 Author: Tom Zanussi Date: Mon Jan 10 08:04:13 2022 -0600 tracing: Remove ops param from event_command reg()/unreg() callbacks The event_trigger_ops for an event_command are already accessible via event_trigger_data.ops so remove the redundant ops from the callback. Link: https://lkml.kernel.org/r/4c6f2a41820452f9cacddc7634ad442928aa2aa6.1641823001.git.zanussi@kernel.org Signed-off-by: Tom Zanussi Signed-off-by: Steven Rostedt commit fb339e531bfccbd12d49b165f37636e62778b69f Author: Tom Zanussi Date: Mon Jan 10 08:04:12 2022 -0600 tracing: Change event_trigger_ops func() to trigger() The name of the func() callback on event_trigger_ops is too generic and is easily confused with other callbacks with that name, so change it to something that reflects its actual purpose. In this case, the main purpose of the callback is to implement an event trigger, so call it trigger() instead. Also add some more documentation to event_trigger_ops describing the callbacks a bit better. Link: https://lkml.kernel.org/r/36ab812e3ee74ee03ae0043fda41a858ee728c00.1641823001.git.zanussi@kernel.org Signed-off-by: Tom Zanussi Signed-off-by: Steven Rostedt commit 9ec5a7d16899ed9062cc4c3dd3a13e1771411ab3 Author: Tom Zanussi Date: Mon Jan 10 08:04:11 2022 -0600 tracing: Change event_command func() to parse() The name of the func() callback on event_command is too generic and is easily confused with other callbacks with that name, so change it to something that reflects its actual purpose. In this case, the main purpose of the callback is to parse an event command, so call it parse() instead. Link: https://lkml.kernel.org/r/7784e321840752ed88aac0b349c0c685fc9247b1.1641823001.git.zanussi@kernel.org Signed-off-by: Tom Zanussi Signed-off-by: Steven Rostedt commit af8fefd7444480bb8fd8d74f977dbac4693ac3ed Merge: 5847d2d2efaab 1b15b69800e2f 5f96ba5655212 75f32fa3a6fba Author: Rafael J. Wysocki Date: Mon Jan 10 17:08:49 2022 +0100 Merge branches 'acpi-x86', 'acpi-pmic' and 'acpi-dptf' Merge x86-specific ACPI updates, PMIC driver ACPI updates and a DPTF driver update for 5.17-rc1: - Rework the handling of device enumeration quirks in the x86-specific code and add new quirks for known-broken platforms (Hans de Goede). - Fix the handling of defective LPAT in the ACPI xpower PMIC driver and clean up some definitions of PMIC data structures (Hans de Goede). - Fix outdated comment in the ACPI DPTF driver (Sumeet Pawnikar). * acpi-x86: ACPI / x86: Skip AC and battery devices on x86 Android tablets with broken DSDTs ACPI / x86: Introduce an acpi_quirk_skip_acpi_ac_and_battery() helper mmc: sdhci-acpi: Use the new soc_intel_is_byt() helper mmc: sdhci-acpi: Remove special handling for GPD win/pocket devices ACPI / x86: Add PWM2 on the Xiaomi Mi Pad 2 to the always_present list ACPI / x86: Add not-present quirk for the PCI0.SDHB.BRC1 device on the GPD win ACPI / x86: Allow specifying acpi_device_override_status() quirks by path ACPI: Change acpi_device_always_present() into acpi_device_override_status() ACPI / x86: Drop PWM2 device on Lenovo Yoga Book from always present table * acpi-pmic: ACPI: PMIC: xpower: Fix _TMP ACPI errors ACPI: PMIC: allow drivers to provide a custom lpat_raw_to_temp() function ACPI: PMIC: constify all struct intel_pmic_opregion_data declarations * acpi-dptf: ACPI: DPTF: Update device ID in a comment commit 2576e153cd982d540b212e989458edc42ad1b390 Author: Jiasheng Jiang Date: Thu Dec 30 10:11:37 2021 +0800 scsi: nsp_cs: Check of ioremap return value Since it is possible for ioremap() to fail, 'data->MmioAddress' could be NULL. Skip entry if ioremap() fails. Link: https://lore.kernel.org/r/20211230021137.1823352-1-jiasheng@iscas.ac.cn Fixes: 0e6f9d270840 ("pcmcia: use pcmcia_loop_config in scsi pcmcia drivers") Signed-off-by: Jiasheng Jiang Signed-off-by: Martin K. Petersen commit 5847d2d2efaab724b7ab374b6fca105e24509c92 Merge: b659ea768ae37 b66f868494148 8120832d8f82a Author: Rafael J. Wysocki Date: Mon Jan 10 16:57:59 2022 +0100 Merge branches 'acpi-ec' and 'acpi-processor' Merge ACPI EC driver updates and ACPI processor driver updates for 5.17-rc1: - Rework flushing of EC work while suspended to idle and clean up the handling of events in the ACPI EC driver (Rafael Wysocki). - Prohibit ec_sys module parameter write_support from being used when the system is locked down (Hans de Goede). - Make the ACPI processor thermal driver use cpufreq_cpu_get() to check for presence of cpufreq policy (Manfred Spraul). - Avoid unnecessary CPU cache flushing in the ACPI processor idle driver (Kirill A. Shutemov). - Replace kernel.h with the necessary inclusions in the ACPI processor driver (Andy Shevchenko). - Use swap() instead of open coding it in the ACPI processor idle driver (Guo Zhengkui). * acpi-ec: ACPI: EC: Mark the ec_sys write_support param as module_param_hw() ACPI: EC: Relocate acpi_ec_create_query() and drop acpi_ec_delete_query() ACPI: EC: Make the event work state machine visible ACPI: EC: Avoid queuing unnecessary work in acpi_ec_submit_event() ACPI: EC: Rename three functions ACPI: EC: Simplify locking in acpi_ec_event_handler() ACPI: EC: Rearrange the loop in acpi_ec_event_handler() ACPI: EC: Fold acpi_ec_check_event() into acpi_ec_event_handler() ACPI: EC: Pass one argument to acpi_ec_query() ACPI: EC: Call advance_transaction() from acpi_ec_dispatch_gpe() ACPI: EC: Rework flushing of EC work while suspended to idle * acpi-processor: ACPI: processor: thermal: avoid cpufreq_get_policy() ACPI: processor: idle: Only flush cache on entering C3 ACPI: processor idle: Use swap() instead of open coding it ACPI: processor: Replace kernel.h with the necessary inclusions commit 16720861675393a35974532b3c837d9fd7bfe08c Author: Chuck Lever Date: Sat Jan 8 16:59:54 2022 -0500 SUNRPC: Fix sockaddr handling in svcsock_accept_class trace points Avoid potentially hazardous memory copying and the needless use of "%pIS" -- in the kernel, an RPC service listener is always bound to ANYADDR. Having the network namespace is helpful when recording errors, though. Fixes: a0469f46faab ("SUNRPC: Replace dprintk call sites in TCP state change callouts") Signed-off-by: Chuck Lever commit dc6c6fb3d639756a532bcc47d4a9bf9f3965881b Author: Chuck Lever Date: Sun Jan 9 13:26:51 2022 -0500 SUNRPC: Fix sockaddr handling in the svc_xprt_create_error trace point While testing, I got an unexpected KASAN splat: Jan 08 13:50:27 oracle-102.nfsv4.dev kernel: BUG: KASAN: stack-out-of-bounds in trace_event_raw_event_svc_xprt_create_err+0x190/0x210 [sunrpc] Jan 08 13:50:27 oracle-102.nfsv4.dev kernel: Read of size 28 at addr ffffc9000008f728 by task mount.nfs/4628 The memcpy() in the TP_fast_assign section of this trace point copies the size of the destination buffer in order that the buffer won't be overrun. In other similar trace points, the source buffer for this memcpy is a "struct sockaddr_storage" so the actual length of the source buffer is always long enough to prevent the memcpy from reading uninitialized or unallocated memory. However, for this trace point, the source buffer can be as small as a "struct sockaddr_in". For AF_INET sockaddrs, the memcpy() reads memory that follows the source buffer, which is not always valid memory. To avoid copying past the end of the passed-in sockaddr, make the source address's length available to the memcpy(). It would be a little nicer if the tracing infrastructure was more friendly about storing socket addresses that are not AF_INET, but I could not find a way to make printk("%pIS") work with a dynamic array. Reported-by: KASAN Fixes: 4b8f380e46e4 ("SUNRPC: Tracepoint to record errors in svc_xpo_create()") Signed-off-by: Chuck Lever commit 3ba880a12df5aa4488c18281701b5b1bc3d4531a Author: Miaoqian Lin Date: Wed Dec 22 07:09:30 2021 +0000 scsi: ufs: ufs-mediatek: Fix error checking in ufs_mtk_init_va09_pwr_ctrl() The function regulator_get() returns an error pointer. Use IS_ERR() to validate the return value. Link: https://lore.kernel.org/r/20211222070930.9449-1-linmq006@gmail.com Fixes: cf137b3ea49a ("scsi: ufs-mediatek: Support VA09 regulator operations") Signed-off-by: Miaoqian Lin Signed-off-by: Martin K. Petersen commit b659ea768ae372e2f82c6346120f2e7272a42ac9 Merge: 77e2a04745ff8 0890186a96586 3c89857a66ef1 5b6a8f1445bc8 843438deebe24 Author: Rafael J. Wysocki Date: Mon Jan 10 16:48:27 2022 +0100 Merge branches 'acpi-scan', 'acpi-pm', 'acpi-power' and 'acpi-pci' Merge ACPI device enumeration updates, ACPI power management updates and PCI host bridge ACPI driver updates for 5.17-rc1: - Introduce acpi_fetch_acpi_dev() as a replacement for acpi_bus_get_device() and use it in the ACPI subsystem (Rafael Wysocki). - Avoid using _CID for device enumaration if _HID is missing or invalid (Rafael Wysocki). - Rework quirk handling during ACPI device enumeration and add some new quirks for known broken platforms (Hans de Goede). - Avoid unnecessary or redundant CPU cache flushing during system PM transitions (Kirill A. Shutemov). - Add PM debug messages related to power resources (Rafael Wysocki). - Fix kernel-doc comment in the PCI host bridge ACPI driver (Yang Li). * acpi-scan: serdev: Do not instantiate serdevs on boards with known bogus DSDT entries i2c: acpi: Do not instantiate I2C-clients on boards with known bogus DSDT entries ACPI / x86: Add acpi_quirk_skip_[i2c_client|serdev]_enumeration() helpers ACPI: scan: Create platform device for BCM4752 and LNV4752 ACPI nodes ACPI: Use acpi_fetch_acpi_dev() instead of acpi_bus_get_device() ACPI: scan: Introduce acpi_fetch_acpi_dev() ACPI: scan: Do not add device IDs from _CID if _HID is not valid * acpi-pm: ACPI: PM: Remove redundant cache flushing ACPI: PM: Avoid CPU cache flush when entering S4 * acpi-power: ACPI: PM: Emit debug messages when enabling/disabling wakeup power * acpi-pci: PCI/ACPI: Fix acpi_pci_osc_control_set() kernel-doc comment commit 9008661e19606bdf6dddd33073b70872da400590 Author: SEO HOYOUNG Date: Fri Jan 7 06:39:24 2022 +0900 scsi: ufs: Modify Tactive time setting conditions The Tactive time determines the waiting time before burst at hibern8 exit and is determined by hardware at linkup time. However, in the case of Samsung devices, increase host's Tactive time +100us for stability. If the HCI's Tactive time is equal or greater than the device, +100us should be set. Link: https://lore.kernel.org/r/20220106213924.186263-1-hy50.seo@samsung.com Reviewed-by: Alim Akhtar Acked-by: Avri Altman Signed-off-by: SEO HOYOUNG Signed-off-by: Martin K. Petersen commit 1aa7d9799e85addc29c06ece99bf1eae1ef9198f Author: Christophe JAILLET Date: Sun Jan 9 19:57:04 2022 +0100 scsi: efct: Remove useless DMA-32 fallback configuration As stated in [1], dma_set_mask() with a 64-bit mask never fails if dev->dma_mask is non-NULL. So, if it fails, the 32 bits case will also fail for the same reason. Simplify code and remove some dead code accordingly. While at it, return the error code returned by dma_set_mask_and_coherent() instead of -1. [1]: https://lkml.org/lkml/2021/6/7/398 Link: https://lore.kernel.org/r/958bcb2a6e86344c14f38369e8e7079615a2b0e3.1641754613.git.christophe.jaillet@wanadoo.fr Reviewed-by: Christoph Hellwig Signed-off-by: Christophe JAILLET Signed-off-by: Martin K. Petersen commit 7bf2e4d5ca1c94a9b0f730498b3d01768a72dcbd Author: Dan Carpenter Date: Fri Jan 7 10:34:07 2022 +0300 ACPI: pfr_telemetry: Fix info leak in pfrt_log_ioctl() The "data_info" struct is copied to the user. It has a 4 byte struct hole after the last struct member so we need to memset that to avoid copying uninitialized stack data to the user. Fixes: b0013e037a8b ("ACPI: Introduce Platform Firmware Runtime Telemetry driver") Signed-off-by: Dan Carpenter Signed-off-by: Rafael J. Wysocki commit 706dc3b91989a1286b0eb75a1cd816596c590e5c Author: Christophe JAILLET Date: Thu Jan 6 22:54:39 2022 +0100 scsi: message: fusion: mptctl: Use dma_alloc_coherent() 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]. When memory is allocated in kbuf_alloc_2_sgl() GFP_KERNEL can be used because this function already uses the GFP_USER flag for some memory allocation and not spin_lock is taken in the between. When memory is allocated in mptctl_do_mpt_command() GFP_KERNEL can be used because this function already uses copy_from_user() and this function can sleep. When memory is allocated in mptctl_hp_hostinfo() GFP_KERNEL can be used because this function already uses mpt_config() and this function has an explicit might_sleep(). When memory is allocated in mptctl_hp_targetinfo() GFP_KERNEL can be used because this function already uses mpt_config() and this function has an explicit might_sleep(). [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/ Link: https://lore.kernel.org/r/516375d6d06114484533baf03aae351306100246.1641500561.git.christophe.jaillet@wanadoo.fr Reviewed-by: Christoph Hellwig Signed-off-by: Christophe JAILLET Signed-off-by: Martin K. Petersen commit 76a334d756c596f2f283e1d0054477ba0f0eacf6 Author: Christophe JAILLET Date: Thu Jan 6 22:54:33 2022 +0100 scsi: message: fusion: mptsas: Use dma_alloc_coherent() 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]. In all these places where some memory is allocated GFP_KERNEL can be used because they already call mpt_config() which has an explicit might_sleep(). [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/ Link: https://lore.kernel.org/r/443b81ecb08b2fe6f789bb2fdff13a53c809e401.1641500561.git.christophe.jaillet@wanadoo.fr Reviewed-by: Christoph Hellwig Signed-off-by: Christophe JAILLET Signed-off-by: Martin K. Petersen commit 7a960b3a5e37f05d7d319bf257a8cf6ee9d18e7c Author: Christophe JAILLET Date: Thu Jan 6 22:54:26 2022 +0100 scsi: message: fusion: Use dma_alloc_coherent() in mptsas_exp_repmanufacture_info() 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]. The only caller of mptsas_exp_repmanufacture_info() is mptsas_probe_one_phy(). This function already calls sas_end_device_alloc() or sas_expander_alloc(). They both already use GFP_KERNEL. As no spin_lock is held at this point, it is safe to also use GFP_KERNEL here. [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/ Link: https://lore.kernel.org/r/d78d4a5b096897932808ed7e3a4540db1687c25d.1641500561.git.christophe.jaillet@wanadoo.fr Reviewed-by: Christoph Hellwig Signed-off-by: Christophe JAILLET Signed-off-by: Martin K. Petersen commit 5c5e6b6f61e0196141db38b84b30ef9b3bcca0f2 Author: Christophe JAILLET Date: Thu Jan 6 22:54:19 2022 +0100 scsi: message: fusion: mptbase: Use dma_alloc_coherent() 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]. In all these places where some memory is allocated GFP_KERNEL can be used because they already call mpt_config() which has an explicit might_sleep(). [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/ Link: https://lore.kernel.org/r/3bea2452deb8cc8be65982e87efa4c6861caa01c.1641500561.git.christophe.jaillet@wanadoo.fr Reviewed-by: Christoph Hellwig Signed-off-by: Christophe JAILLET Signed-off-by: Martin K. Petersen commit 2d50607260a6c142f49222346814fee30eeaba9e Author: Christophe JAILLET Date: Thu Jan 6 22:54:13 2022 +0100 scsi: message: fusion: Use dma_alloc_coherent() in mpt_alloc_fw_memory() 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]. mpt_alloc_fw_memory() should still use GFP_ATOMIC, because it can be called from mpt_do_upload() which might sleep. [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/ Link: https://lore.kernel.org/r/db3db9db219005b75659561d08117d312d0cfb13.1641500561.git.christophe.jaillet@wanadoo.fr Reviewed-by: Christoph Hellwig Signed-off-by: Christophe JAILLET Signed-off-by: Martin K. Petersen commit b114dda6f2f10cc8b2ddcde3285a576fe3f12c5d Author: Christophe JAILLET Date: Thu Jan 6 22:54:05 2022 +0100 scsi: message: fusion: 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. It can be found in [3]. In this patch, all functions but pci_alloc_consistent() are handled. pci_alloc_consistent() needs more attention and explanation. [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/ [3]: https://lore.kernel.org/kernel-janitors/20200716192821.321233-1-christophe.jaillet@wanadoo.fr/ Link: https://lore.kernel.org/r/e38e897fbd3314718315b0e357c824e3f01775d6.1641500561.git.christophe.jaillet@wanadoo.fr Reviewed-by: Christoph Hellwig Signed-off-by: Christophe JAILLET Signed-off-by: Martin K. Petersen commit e958b5884725dac86d36c1e7afe5a55f31feb0b2 Author: Robert Hancock Date: Fri Jan 7 15:47:06 2022 -0600 ASoC: xilinx: xlnx_formatter_pcm: Make buffer bytes multiple of period bytes This patch is based on one in the Xilinx kernel tree, "ASoc: xlnx: Make buffer bytes multiple of period bytes" by Devarsh Thakkar. The same issue exists in the mainline version of the driver. The original patch description is as follows: "The Xilinx Audio Formatter IP has a constraint on period bytes to be multiple of 64. This leads to driver changing the period size to suitable frames such that period bytes are multiple of 64. Now since period bytes and period size are updated but not the buffer bytes, this may make the buffer bytes unaligned and not multiple of period bytes. When this happens we hear popping noise as while DMA is being done the buffer bytes are not enough to complete DMA access for last period of frame within the application buffer boundary. To avoid this, align buffer bytes too as multiple of 64, and set another constraint to always enforce number of periods as integer. Now since, there is already a rule in alsa core to enforce Buffer size = Number of Periods * Period Size this automatically aligns buffer bytes as multiple of period bytes." Fixes: 6f6c3c36f091 ("ASoC: xlnx: add pcm formatter platform driver") Cc: Devarsh Thakkar Signed-off-by: Robert Hancock Link: https://lore.kernel.org/r/20220107214711.1100162-2-robert.hancock@calian.com Signed-off-by: Mark Brown commit 8d4ff8187bb2b0c9025269f0da42ed16c878cb18 Author: Robert Schlabbach Date: Thu Jan 6 23:52:49 2022 +0100 media: si2157: add support for DVB-C Annex C DVB-C Annex C is mostly DVB-C Annex A with only minor differences, so simply add it to the DVB-C Annex A switch case, so that tuning attempts no longer result in -EINVAL. Link: https://lore.kernel.org/linux-media/trinity-fd7dd9e4-c319-4761-89b6-555fa7b23776-1641509569422@3c-app-gmx-bap68 Signed-off-by: Robert Schlabbach Signed-off-by: Mauro Carvalho Chehab commit 9658105d0e5b1437db161b4227721065d44585b9 Author: Robert Schlabbach Date: Thu Jan 6 23:51:39 2022 +0100 media: si2157: fix bandwidth stored in dev Make digital tuning store the bandwidth in Hz in the private dev struct, rather than the hardware-specific bandwidth property code, so that the get_bandwidth() function returns the bandwidth in Hz, just as it already does when using analog tuning. Link: https://lore.kernel.org/linux-media/trinity-931c0e68-88af-46cc-91a1-986754798a4f-1641509499366@3c-app-gmx-bap68 Reported-by: Robert Schlabbach Signed-off-by: Robert Schlabbach Signed-off-by: Mauro Carvalho Chehab commit 95c4cd1d19e3e1d4894457a6f015e3a045bc9b06 Author: Robert Schlabbach Date: Thu Jan 6 23:49:47 2022 +0100 media: si2157: fix 6MHz & 6.1MHz bandwidth setting Commit 98c65a3dac95 ("media: si2157: add support for 1.7MHz and 6.1 MHz") introduced two bugs: The 6.1MHz setting was always used for any bandwidth less than 7MHz due to missing "else" keywords, and then the setting was not specified as decimal 10, but as hexadecimal 0x10, which makes the tuner refuse the tune command. In sum, it is not possible to tune to any channels of less than 7MHz bandwidth anymore. Add the missing "else" keywords and convert all bandwidth settings to decimal to avoid any future decimal vs. hexadecimal confusion. Remove the use of the undefined bandwidth setting 0x0f for bandwidths greater than 8MHz, which is also refused by the tune command, in favour of using the default bandwidth setting 8 for any bandwidths greater than 7MHz. Link: https://lore.kernel.org/linux-media/trinity-d0015ea1-1da5-4c7d-a75b-781fb26dc339-1641509387112@3c-app-gmx-bap68 Fixes: 98c65a3dac95 ("media: si2157: add support for 1.7MHz and 6.1 MHz") Reported-by: Robert Schlabbach Signed-off-by: Robert Schlabbach Signed-off-by: Mauro Carvalho Chehab commit a89eeb9937a0124e609e9355cd48cdfe35c8b8b7 Author: Nathan Chancellor Date: Mon Dec 27 17:42:43 2021 +0100 media: atomisp: Do not define input_system_cfg2400_t twice When CONFIG_VIDEO_ATOMISP_ISP2401 is disabled, clang warns: ./drivers/staging/media/atomisp//pci/isp2400_input_system_local.h:32:40: error: redefinition of typedef 'input_system_cfg2400_t' is a C11 feature [-Werror,-Wtypedef-redefinition] typedef struct input_system_cfg2400_s input_system_cfg2400_t; ^ ./drivers/staging/media/atomisp//pci/input_system_local.h:22:40: note: previous definition is here typedef struct input_system_cfg2400_s input_system_cfg2400_t; ^ 1 error generated. input_system_cfg2400_t's typedef was copied from isp2400_input_system_local.h to input_system_local.h, rather than moved. Remove the one in isp2400_input_system_local.h so that there is no more warning, which can break the build under -Werror. Link: https://github.com/ClangBuiltLinux/linux/issues/1557 Link: https://lore.kernel.org/linux-media/20211227164243.2329724-1-nathan@kernel.org Fixes: 4005ecee616a ("media: atomisp: shift some structs from input_system_local") Reported-by: kernel test robot Signed-off-by: Nathan Chancellor Signed-off-by: Mauro Carvalho Chehab commit 6ef295e34297433c78ea02dfcf1c649a769050bb Author: Matthew Auld Date: Thu Jan 6 17:49:10 2022 +0000 drm/i915/ttm: ensure we unmap when purging Purging can happen during swapping out, or directly invoked with the madvise ioctl. In such cases this doesn't involve a ttm move, which skips umapping the object. v2(Thomas): - add ttm_truncate helper, and just call into i915_ttm_move_notify() to handle the unmapping step Fixes: 213d50927763 ("drm/i915/ttm: Introduce a TTM i915 gem object backend") Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20220106174910.280616-4-matthew.auld@intel.com (cherry picked from commit ab4911b7d411ab2ef3b38322178b9138e156c393) Signed-off-by: Tvrtko Ursulin commit 8ee262ba79a19a4dba9949397b1cf5761679670c Author: Matthew Auld Date: Thu Jan 6 17:49:09 2022 +0000 drm/i915/ttm: add unmap_virtual callback Ensure we call ttm_bo_unmap_virtual when releasing the pages. Importantly this should now handle the ttm swapping case, and all other places that already call into i915_ttm_move_notify(). v2: fix up the selftest Fixes: cf3e3e86d779 ("drm/i915: Use ttm mmap handling for ttm bo's.") Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20220106174910.280616-3-matthew.auld@intel.com (cherry picked from commit 903e0387270eef14a711c0feb23b7bf62d2480df) Signed-off-by: Tvrtko Ursulin commit 03ee5956781b2245b1c77334ecdea6386fd3bfba Author: Matthew Auld Date: Thu Jan 6 17:49:08 2022 +0000 drm/i915/ttm: only fault WILLNEED objects Don't attempt to fault and re-populate purged objects. By some fluke this passes the dontneed-after-mmap IGT, but for the wrong reasons. Fixes: cf3e3e86d779 ("drm/i915: Use ttm mmap handling for ttm bo's.") Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20220106174910.280616-2-matthew.auld@intel.com (cherry picked from commit f3cb4a2de5410147b53e53416a3af0ffe26b5f4e) Signed-off-by: Tvrtko Ursulin commit 4c2602ba8d74c35d550ed3d518809c697de08d88 Author: Matthew Auld Date: Thu Jan 6 17:49:07 2022 +0000 drm/i915: don't call free_mmap_offset when purging The TTM backend is in theory the only user here(also purge should only be called once we have dropped the pages), where it is setup at object creation and is only removed once the object is destroyed. Also resetting the node here might be iffy since the ttm fault handler uses the stored fake offset to determine the page offset within the pages array. This also blows up in the dontneed-before-mmap test, since the expectation is that the vma_node will live on, until the object is destroyed: <2> [749.062902] kernel BUG at drivers/gpu/drm/i915/gem/i915_gem_ttm.c:943! <4> [749.062923] invalid opcode: 0000 [#1] PREEMPT SMP NOPTI <4> [749.062928] CPU: 0 PID: 1643 Comm: gem_madvise Tainted: G U W 5.16.0-rc8-CI-CI_DRM_11046+ #1 <4> [749.062933] Hardware name: Gigabyte Technology Co., Ltd. GB-Z390 Garuda/GB-Z390 Garuda-CF, BIOS IG1c 11/19/2019 <4> [749.062937] RIP: 0010:i915_ttm_mmap_offset.cold.35+0x5b/0x5d [i915] <4> [749.063044] Code: 00 48 c7 c2 a0 23 4e a0 48 c7 c7 26 df 4a a0 e8 95 1d d0 e0 bf 01 00 00 00 e8 8b ec cf e0 31 f6 bf 09 00 00 00 e8 5f 30 c0 e0 <0f> 0b 48 c7 c1 24 4b 56 a0 ba 5b 03 00 00 48 c7 c6 c0 23 4e a0 48 <4> [749.063052] RSP: 0018:ffffc90002ab7d38 EFLAGS: 00010246 <4> [749.063056] RAX: 0000000000000240 RBX: ffff88811f2e61c0 RCX: 0000000000000006 <4> [749.063060] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000009 <4> [749.063063] RBP: ffffc90002ab7e58 R08: 0000000000000001 R09: 0000000000000001 <4> [749.063067] R10: 000000000123d0f8 R11: ffffc90002ab7b20 R12: ffff888112a1a000 <4> [749.063071] R13: 0000000000000004 R14: ffff88811f2e61c0 R15: ffff888112a1a000 <4> [749.063074] FS: 00007f6e5fcad500(0000) GS:ffff8884ad600000(0000) knlGS:0000000000000000 <4> [749.063078] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 <4> [749.063081] CR2: 00007efd264e39f0 CR3: 0000000115fd6005 CR4: 00000000003706f0 <4> [749.063085] Call Trace: <4> [749.063087] <4> [749.063089] __assign_mmap_offset+0x41/0x300 [i915] <4> [749.063171] __assign_mmap_offset_handle+0x159/0x270 [i915] <4> [749.063248] ? i915_gem_dumb_mmap_offset+0x70/0x70 [i915] <4> [749.063325] drm_ioctl_kernel+0xae/0x140 <4> [749.063330] drm_ioctl+0x201/0x3d0 <4> [749.063333] ? i915_gem_dumb_mmap_offset+0x70/0x70 [i915] <4> [749.063409] ? do_user_addr_fault+0x200/0x670 <4> [749.063415] __x64_sys_ioctl+0x6d/0xa0 <4> [749.063419] do_syscall_64+0x3a/0xb0 <4> [749.063423] entry_SYSCALL_64_after_hwframe+0x44/0xae <4> [749.063428] RIP: 0033:0x7f6e5f100317 Testcase: igt/gem_madvise/dontneed-before-mmap Fixes: cf3e3e86d779 ("drm/i915: Use ttm mmap handling for ttm bo's.") Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20220106174910.280616-1-matthew.auld@intel.com (cherry picked from commit 658a0c632625e1db51837ff754fe18a6a7f2ccf8) Signed-off-by: Tvrtko Ursulin commit f9535d28ac93c3cc326f7215fccd0abe1d3a6083 Author: Juston Li Date: Thu Jan 6 12:02:36 2022 -0800 drm/i915/pxp: Hold RPM wakelock during PXP unbind Similar to commit b8d8436840ca ("drm/i915/gt: Hold RPM wakelock during PXP suspend") but to fix the same warning for unbind during shutdown: ------------[ cut here ]------------ RPM wakelock ref not held during HW access WARNING: CPU: 0 PID: 4139 at drivers/gpu/drm/i915/intel_runtime_pm.h:115 gen12_fwtable_write32+0x1b7/0 Modules linked in: 8021q ccm rfcomm cmac algif_hash algif_skcipher af_alg uinput snd_hda_codec_hdmi vf industrialio iwl7000_mac80211 cros_ec_sensorhub lzo_rle lzo_compress zram iwlwifi cfg80211 joydev CPU: 0 PID: 4139 Comm: halt Tainted: G U W 5.10.84 #13 344e11e079c4a03940d949e537eab645f6 RIP: 0010:gen12_fwtable_write32+0x1b7/0x200 Code: 48 c7 c7 fc b3 b5 89 31 c0 e8 2c f3 ad ff 0f 0b e9 04 ff ff ff c6 05 71 e9 1d 01 01 48 c7 c7 d67 RSP: 0018:ffffa09ec0bb3bb0 EFLAGS: 00010246 RAX: 12dde97bbd260300 RBX: 00000000000320f0 RCX: ffffffff89e60ea0 RDX: 0000000000000000 RSI: 00000000ffffdfff RDI: ffffffff89e60e70 RBP: ffffa09ec0bb3bd8 R08: 0000000000000000 R09: ffffa09ec0bb3950 R10: 00000000ffffdfff R11: ffffffff89e91160 R12: 0000000000000000 R13: 0000000028121969 R14: ffff9515c32f0990 R15: 0000000040000000 FS: 0000790dcf225740(0000) GS:ffff951737800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000058b25efae147 CR3: 0000000133ea6001 CR4: 0000000000770ef0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff07f0 DR7: 0000000000000400 PKRU: 55555554 Call Trace: intel_pxp_fini_hw+0x2f/0x39 i915_pxp_tee_component_unbind+0x1c/0x42 component_unbind+0x32/0x48 component_unbind_all+0x80/0x9d take_down_master+0x24/0x36 component_master_del+0x56/0x70 mei_pxp_remove+0x2c/0x68 mei_cl_device_remove+0x35/0x68 device_release_driver_internal+0x100/0x1a1 mei_cl_bus_remove_device+0x21/0x79 mei_cl_bus_remove_devices+0x3b/0x51 mei_stop+0x3b/0xae mei_me_shutdown+0x23/0x58 device_shutdown+0x144/0x1d3 kernel_power_off+0x13/0x4c __se_sys_reboot+0x1d4/0x1e9 do_syscall_64+0x43/0x55 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x790dcf316273 Code: 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 89 fa be 69 19 12 28 bf ad8 RSP: 002b:00007ffca0df9198 EFLAGS: 00000202 ORIG_RAX: 00000000000000a9 RAX: ffffffffffffffda RBX: 000000004321fedc RCX: 0000790dcf316273 RDX: 000000004321fedc RSI: 0000000028121969 RDI: 00000000fee1dead RBP: 00007ffca0df9200 R08: 0000000000000007 R09: 0000563ce8cd8970 R10: 0000000000000000 R11: 0000000000000202 R12: 00007ffca0df9308 R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000003 ---[ end trace 2f501b01b348f114 ]--- ACPI: Preparing to enter system sleep state S5 reboot: Power down Changes since v1: - Rebase to latest drm-tip Fixes: 0cfab4cb3c4e ("drm/i915/pxp: Enable PXP power management") Suggested-by: Lee Shawn C Signed-off-by: Juston Li Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20220106200236.489656-2-juston.li@intel.com (cherry picked from commit 57ded5fc98b11d76dae505ca3591b61c9dbbbda7) Signed-off-by: Tvrtko Ursulin commit f66229aa355f7e0dc0dc20cbc1f4d45c3176eed2 Merge: 2e88c6a805fc5 f517ba4924ad0 Author: Takashi Iwai Date: Mon Jan 10 14:33:42 2022 +0100 Merge tag 'asoc-v5.17-2' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Updates for v5.17 A few more updates for v5.17, nothing hugely stand out in the few days since the initial pull request was sent. commit 19629ae482f1800b50a5bdf2504ac57171d2bb82 Merge: 44ea62813f0ab 80bb73a9fbcde Author: Mark Brown Date: Mon Jan 10 13:00:14 2022 +0000 Merge branch 'for-5.16' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi into spi-5.17 One small fix that didn't get sent separately. commit 35e13e9da9afbce13c1d36465504ece4e65f24fe Merge: 6629c07699263 1a5620671a1b6 Author: Thomas Gleixner Date: Mon Jan 10 13:57:17 2022 +0100 Merge branch 'clocksource' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu into timers/core Pull clocksource watchdog updates from Paul McKenney: - Avoid accidental unstable marking of clocksources by rejecting clocksource measurements where the source of the skew is the delay reading reference clocksource itself. This change avoids many of the current false positives caused by epic cache-thrashing workloads. - Reduce the default clocksource_watchdog() retries to 2, thus offsetting the increased overhead due to #1 above rereading the reference clocksource. Link: https://lore.kernel.org/lkml/20220105001723.GA536708@paulmck-ThinkPad-P17-Gen-1 commit 67d50b5f9114ae55d45e08e1fd1d6ae152622bf3 Merge: 0422fe2666aea cd448b24c621b Author: Thomas Gleixner Date: Mon Jan 10 13:55:41 2022 +0100 Merge tag 'irqchip-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms into irq/core Pull irqchip updates from Marc Zyngier: - Fix GICv3 redistributor table reservation with RT across kexec - Fix GICv4.1 redistributor view of the VPE table across kexec - Add support for extra interrupts on spear-shirq - Make obtaining some interrupts optional for the Renesas drivers - Various cleanups and bug fixes Link: https://lore.kernel.org/lkml/20220108130807.4109738-1-maz@kernel.org commit 6629c0769926306454b113effe1aad243bd49bde Merge: 2585cf9dfaadd 7647204c2e81b Author: Thomas Gleixner Date: Mon Jan 10 13:53:16 2022 +0100 Merge tag 'timers-v5.17-rc1' of https://git.linaro.org/people/daniel.lezcano/linux into timers/core Pull clocksource/events updates from Daniel Lezcano: - Refactor resource allocation on the Exynos_mct driver without functional changes (Marek Szyprowski) - Add imx8ulp compatible string for NPX TPM driver (Jacky Bai) - Fix comma introduced by error by replacing it by the initial semicolon on the Exynos_mct (Will Deacon) - Add OSTM driver support on Renesas. The reset line must be deasserted before accessing the registers. This change depends on an external change resulting in a shared immutable branch 'reset/of-get-optional-exclusive' from git://git.pengutronix.de/pza/linux (Biju Das) - Make the OSTM Kconfig option visible to user in order to let him disable it when ARM architected timers is enabled (Biju Das) - Tag two variables on iMX sysctr _ro_afterinit (Peng Fan) - Set the cpumask to cpu_possible_mask in order to have full benefit of the DYNIRQ flag on iMX sysctr (Peng Fan) - Tag __maybe_unused a variable in the Pistachio timer driver in order to fix a warning reported by the kernel test robot (Drew Fustini) - Add MStar MSC313e timer support and the ssd20xd-based variant, as well as the DT bindings (Romain Perier) - Remove the incompatible compatible string for the rk3066 (Johan Jonker) - Fix dts_check warnings on the cadence ttc driver by adding the power domain bindings (Michal Simek) Link: https://lore.kernel.org/lkml/e093c706-c98d-29ee-0102-78b6d41c6164@linaro.org commit 4eea5332d67d8ae6ba5717ec0f4e671fdbd222e7 Author: Juan Vazquez Date: Sat Jan 8 16:17:58 2022 -0800 scsi: storvsc: Fix storvsc_queuecommand() memory leak Fix possible memory leak in error path of storvsc_queuecommand() when DMA mapping fails. Signed-off-by: Juan Vazquez Reviewed-by: Tianyu Lan Link: https://lore.kernel.org/r/20220109001758.6401-1-juvazq@linux.microsoft.com Signed-off-by: Wei Liu commit 16f2f4e679cfdaa9552574484f104014908a76c6 Author: David Howells Date: Fri Aug 27 15:19:34 2021 +0100 nfs: Implement cache I/O by accessing the cache directly Move NFS to using fscache DIO API instead of the old upstream I/O API as that has been removed. This is a stopgap solution as the intention is that at sometime in the future, the cache will move to using larger blocks and won't be able to store individual pages in order to deal with the potential for data corruption due to the backing filesystem being able insert/remove bridging blocks of zeros into its extent list[1]. NFS then reads and writes cache pages synchronously and one page at a time. The preferred change would be to use the netfs lib, but the new I/O API can be used directly. It's just that as the cache now needs to track data for itself, caching blocks may exceed page size... This code is somewhat borrowed from my "fallback I/O" patchset[2]. Changes ======= ver #3: - Restore lost =n fallback for nfs_fscache_release_page()[2]. Signed-off-by: David Howells Tested-by: Dave Wysochanski Acked-by: Jeff Layton cc: Trond Myklebust cc: Anna Schumaker cc: linux-nfs@vger.kernel.org cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/YO17ZNOcq+9PajfQ@mit.edu [1] Link: https://lore.kernel.org/r/202112100957.2oEDT20W-lkp@intel.com/ [2] Link: https://lore.kernel.org/r/163189108292.2509237.12615909591150927232.stgit@warthog.procyon.org.uk/ [2] Link: https://lore.kernel.org/r/163906981318.143852.17220018647843475985.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967184451.1823006.6450645559828329590.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021577632.640689.11069627070150063812.stgit@warthog.procyon.org.uk/ # v4 commit a6b5a28eb56c3f4988f7ff5290b954ba296e309a Author: Dave Wysochanski Date: Sat Nov 14 13:43:54 2020 -0500 nfs: Convert to new fscache volume/cookie API Change the nfs filesystem to support fscache's indexing rewrite and reenable caching in nfs. The following changes have been made: (1) The fscache_netfs struct is no more, and there's no need to register the filesystem as a whole. (2) The session cookie is now an fscache_volume cookie, allocated with fscache_acquire_volume(). That takes three parameters: a string representing the "volume" in the index, a string naming the cache to use (or NULL) and a u64 that conveys coherency metadata for the volume. For nfs, I've made it render the volume name string as: "nfs,,,
,,,*<,param>[,]" (3) The fscache_cookie_def is no more and needed information is passed directly to fscache_acquire_cookie(). The cache no longer calls back into the filesystem, but rather metadata changes are indicated at other times. fscache_acquire_cookie() is passed the same keying and coherency information as before. (4) fscache_enable/disable_cookie() have been removed. Call fscache_use_cookie() and fscache_unuse_cookie() when a file is opened or closed to prevent a cache file from being culled and to keep resources to hand that are needed to do I/O. If a file is opened for writing, we invalidate it with FSCACHE_INVAL_DIO_WRITE in lieu of doing writeback to the cache, thereby making it cease caching until all currently open files are closed. This should give the same behaviour as the uptream code. Making the cache store local modifications isn't straightforward for NFS, so that's left for future patches. (5) fscache_invalidate() now needs to be given uptodate auxiliary data and a file size. It also takes a flag to indicate if this was due to a DIO write. (6) Call nfs_fscache_invalidate() with FSCACHE_INVAL_DIO_WRITE on a file to which a DIO write is made. (7) Call fscache_note_page_release() from nfs_release_page(). (8) Use a killable wait in nfs_vm_page_mkwrite() when waiting for PG_fscache to be cleared. (9) The functions to read and write data to/from the cache are stubbed out pending a conversion to use netfslib. Changes ======= ver #3: - Added missing =n fallback for nfs_fscache_release_file()[1][2]. ver #2: - Use gfpflags_allow_blocking() rather than using flag directly. - fscache_acquire_volume() now returns errors. - Remove NFS_INO_FSCACHE as it's no longer used. - Need to unuse a cookie on file-release, not inode-clear. Signed-off-by: Dave Wysochanski Co-developed-by: David Howells Signed-off-by: David Howells Tested-by: Dave Wysochanski Acked-by: Jeff Layton cc: Trond Myklebust cc: Anna Schumaker cc: linux-nfs@vger.kernel.org cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/202112100804.nksO8K4u-lkp@intel.com/ [1] Link: https://lore.kernel.org/r/202112100957.2oEDT20W-lkp@intel.com/ [2] Link: https://lore.kernel.org/r/163819668938.215744.14448852181937731615.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906979003.143852.2601189243864854724.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967182112.1823006.7791504655391213379.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021575950.640689.12069642327533368467.stgit@warthog.procyon.org.uk/ # v4 commit 93c846143d8630d1fd465b69703b0f0021a543dc Author: David Howells Date: Wed Nov 18 09:06:42 2020 +0000 9p: Copy local writes to the cache when writing to the server When writing to the server from v9fs_vfs_writepage(), copy the data to the cache object too. To make this possible, the cookie must have its active users count incremented when the page is dirtied and kept incremented until we manage to clean up all the pages. This allows the writeback to take place after the last file struct is released. This is done by taking a use on the cookie in v9fs_set_page_dirty() if we haven't already done so (controlled by the I_PINNING_FSCACHE_WB flag) and dropping the pin in v9fs_write_inode() if __writeback_single_inode() clears all the outstanding dirty pages (conveyed by the unpinned_fscache_wb flag in the writeback_control struct). Inode eviction must also clear the flag after truncating away all the outstanding pages. In the future this will be handled more gracefully by netfslib. Changes ======= ver #3: - Canonicalise the coherency data to make it endianness-independent. ver #2: - Fix an unused-var warning due to CONFIG_9P_FSCACHE=n[1]. Signed-off-by: David Howells Acked-by: Jeff Layton Tested-by: Dominique Martinet cc: Eric Van Hensbergen cc: Latchesar Ionkov cc: v9fs-developer@lists.sourceforge.net cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819667027.215744.13815687931204222995.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906978015.143852.10646669694345706328.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967180760.1823006.5831751873616248910.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021574522.640689.13849966660182529125.stgit@warthog.procyon.org.uk/ # v4 commit 24e42e32d347f0787a6f99aeb590f3aaa7221093 Author: David Howells Date: Wed Nov 18 09:06:42 2020 +0000 9p: Use fscache indexing rewrite and reenable caching Change the 9p filesystem to take account of the changes to fscache's indexing rewrite and reenable caching in 9p. The following changes have been made: (1) The fscache_netfs struct is no more, and there's no need to register the filesystem as a whole. (2) The session cookie is now an fscache_volume cookie, allocated with fscache_acquire_volume(). That takes three parameters: a string representing the "volume" in the index, a string naming the cache to use (or NULL) and a u64 that conveys coherency metadata for the volume. For 9p, I've made it render the volume name string as: "9p,," where the cachetag is replaced by the aname if it wasn't supplied. This probably needs rethinking a bit as the aname can have slashes in it. It might be better to hash the cachetag and use the hash or I could substitute commas for the slashes or something. (3) The fscache_cookie_def is no more and needed information is passed directly to fscache_acquire_cookie(). The cache no longer calls back into the filesystem, but rather metadata changes are indicated at other times. fscache_acquire_cookie() is passed the same keying and coherency information as before. (4) The functions to set/reset/flush cookies are removed and fscache_use_cookie() and fscache_unuse_cookie() are used instead. fscache_use_cookie() is passed a flag to indicate if the cookie is opened for writing. fscache_unuse_cookie() is passed updates for the metadata if we changed it (ie. if the file was opened for writing). These are called when the file is opened or closed. (5) wait_on_page_bit[_killable]() is replaced with the specific wait functions for the bits waited upon. (6) I've got rid of some of the 9p-specific cache helper functions and called things like fscache_relinquish_cookie() directly as they'll optimise away if v9fs_inode_cookie() returns an unconditional NULL (which will be the case if CONFIG_9P_FSCACHE=n). (7) v9fs_vfs_setattr() is made to call fscache_resize() to change the size of the cache object. Notes: (A) We should call fscache_invalidate() if we detect that the server's copy of a file got changed by a third party, but I don't know where to do that. We don't need to do that when allocating the cookie as we get a check-and-invalidate when we initially bind to the cache object. (B) The copy-to-cache-on-writeback side of things will be handled in separate patch. Changes ======= ver #3: - Canonicalise the cookie key and coherency data to make them endianness-independent. ver #2: - Use gfpflags_allow_blocking() rather than using flag directly. - fscache_acquire_volume() now returns errors. Signed-off-by: David Howells Acked-by: Jeff Layton Tested-by: Dominique Martinet cc: Eric Van Hensbergen cc: Latchesar Ionkov cc: v9fs-developer@lists.sourceforge.net cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819664645.215744.1555314582005286846.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906975017.143852.3459573173204394039.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967178512.1823006.17377493641569138183.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021573143.640689.3977487095697717967.stgit@warthog.procyon.org.uk/ # v4 commit 51500b71d500f251037ed339047a4d9e7d7e295b Author: Vitaly Kuznetsov Date: Thu Jan 6 10:46:11 2022 +0100 x86/hyperv: Properly deal with empty cpumasks in hyperv_flush_tlb_multi() KASAN detected the following issue: BUG: KASAN: slab-out-of-bounds in hyperv_flush_tlb_multi+0xf88/0x1060 Read of size 4 at addr ffff8880011ccbc0 by task kcompactd0/33 CPU: 1 PID: 33 Comm: kcompactd0 Not tainted 5.14.0-39.el9.x86_64+debug #1 Hardware name: Microsoft Corporation Virtual Machine/Virtual Machine, BIOS Hyper-V UEFI Release v4.0 12/17/2019 Call Trace: dump_stack_lvl+0x57/0x7d print_address_description.constprop.0+0x1f/0x140 ? hyperv_flush_tlb_multi+0xf88/0x1060 __kasan_report.cold+0x7f/0x11e ? hyperv_flush_tlb_multi+0xf88/0x1060 kasan_report+0x38/0x50 hyperv_flush_tlb_multi+0xf88/0x1060 flush_tlb_mm_range+0x1b1/0x200 ptep_clear_flush+0x10e/0x150 ... Allocated by task 0: kasan_save_stack+0x1b/0x40 __kasan_kmalloc+0x7c/0x90 hv_common_init+0xae/0x115 hyperv_init+0x97/0x501 apic_intr_mode_init+0xb3/0x1e0 x86_late_time_init+0x92/0xa2 start_kernel+0x338/0x3eb secondary_startup_64_no_verify+0xc2/0xcb The buggy address belongs to the object at ffff8880011cc800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 960 bytes inside of 1024-byte region [ffff8880011cc800, ffff8880011ccc00) 'hyperv_flush_tlb_multi+0xf88/0x1060' points to hv_cpu_number_to_vp_number() and '960 bytes' means we're trying to get VP_INDEX for CPU#240. 'nr_cpus' here is exactly 240 so we're trying to access past hv_vp_index's last element. This can (and will) happen when 'cpus' mask is empty and cpumask_last() will return '>=nr_cpus'. Commit ad0a6bad4475 ("x86/hyperv: check cpu mask after interrupt has been disabled") tried to deal with empty cpumask situation but apparently didn't fully fix the issue. 'cpus' cpumask which is passed to hyperv_flush_tlb_multi() is 'mm_cpumask(mm)' (which is '&mm->cpu_bitmap'). This mask changes every time the particular mm is scheduled/unscheduled on some CPU (see switch_mm_irqs_off()), disabling IRQs on the CPU which is performing remote TLB flush has zero influence on whether the particular process can get scheduled/unscheduled on _other_ CPUs so e.g. in the case where the mm was scheduled on one other CPU and got unscheduled during hyperv_flush_tlb_multi()'s execution will lead to cpumask becoming empty. It doesn't seem that there's a good way to protect 'mm_cpumask(mm)' from changing during hyperv_flush_tlb_multi()'s execution. It would be possible to copy it in the very beginning of the function but this is a waste. It seems we can deal with changing cpumask just fine. When 'cpus' cpumask changes during hyperv_flush_tlb_multi()'s execution, there are two possible issues: - 'Under-flushing': we will not flush TLB on a CPU which got added to the mask while hyperv_flush_tlb_multi() was already running. This is not a problem as this is equal to mm getting scheduled on that CPU right after TLB flush. - 'Over-flushing': we may flush TLB on a CPU which is already cleared from the mask. First, extra TLB flush preserves correctness. Second, Hyper-V's TLB flush hypercall takes 'mm->pgd' argument so Hyper-V may avoid the flush if CR3 doesn't match. Fix the immediate issue with cpumask_last()/hv_cpu_number_to_vp_number() and remove the pointless cpumask_empty() check from the beginning of the function as it really doesn't protect anything. Also, avoid the hypercall altogether when 'flush->processor_mask' ends up being empty. Fixes: ad0a6bad4475 ("x86/hyperv: check cpu mask after interrupt has been disabled") Signed-off-by: Vitaly Kuznetsov Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20220106094611.1404218-1-vkuznets@redhat.com Signed-off-by: Wei Liu commit d12013c80e1524e3e85c01d50adcefd70b1a8b6f Merge: 73d86812a3596 5e8ba485b2522 Author: Petr Mladek Date: Mon Jan 10 12:15:08 2022 +0100 Merge branch 'console-registration-cleanup' into for-linus commit 3375aa77135f6aeb1107ed839a2050a4118444bc Author: Martin Blumenstingl Date: Mon Dec 27 19:00:26 2021 +0100 ARM: dts: meson8b: Fix the UART device-tree schema validation The dt-bindings for the UART controller only allow the following values for Meson8 SoCs: - "amlogic,meson8b-uart", "amlogic,meson-ao-uart" - "amlogic,meson8b-uart" Use the correct fallback compatible string "amlogic,meson-ao-uart" for AO UART. Drop the "amlogic,meson-uart" compatible string from the EE domain UART controllers. Also update the order of the clocks to match the order defined in the yaml bindings. Fixes: b02d6e73f5fc96 ("ARM: dts: meson8b: use stable UART bindings with correct gate clock") Signed-off-by: Martin Blumenstingl Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20211227180026.4068352-4-martin.blumenstingl@googlemail.com commit 57007bfb5469ba31cacf69d52195e8b75f43e32d Author: Martin Blumenstingl Date: Mon Dec 27 19:00:25 2021 +0100 ARM: dts: meson8: Fix the UART device-tree schema validation The dt-bindings for the UART controller only allow the following values for Meson8 SoCs: - "amlogic,meson8-uart", "amlogic,meson-ao-uart" - "amlogic,meson8-uart" Use the correct fallback compatible string "amlogic,meson-ao-uart" for AO UART. Drop the "amlogic,meson-uart" compatible string from the EE domain UART controllers. Also update the order of the clocks to match the order defined in the yaml schema. Fixes: 6ca77502050eff ("ARM: dts: meson8: use stable UART bindings with correct gate clock") Signed-off-by: Martin Blumenstingl Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20211227180026.4068352-3-martin.blumenstingl@googlemail.com commit 5225e1b87432dcf0d0fc3440824b91d04c1d6cc1 Author: Martin Blumenstingl Date: Mon Dec 27 19:00:24 2021 +0100 ARM: dts: meson: Fix the UART compatible strings The dt-bindings for the UART controller only allow the following values for Meson6 SoCs: - "amlogic,meson6-uart", "amlogic,meson-ao-uart" - "amlogic,meson6-uart" Use the correct fallback compatible string "amlogic,meson-ao-uart" for AO UART. Drop the "amlogic,meson-uart" compatible string from the EE domain UART controllers. Fixes: ec9b59162fd831 ("ARM: dts: meson6: use stable UART bindings") Signed-off-by: Martin Blumenstingl Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20211227180026.4068352-2-martin.blumenstingl@googlemail.com commit 081c8919b02bc1077279cd03972d7ec6f53a6c6b Author: Jiri Kosina Date: Mon Jan 10 10:18:19 2022 +0100 Documentation: remove trivial tree As has been discussed some time ago on ksumitt-discuss@ mailinglist, the need for trivial tree diminished over time as all the tooling and processess became much more mature and it's quite natural these days for trivial patches to flow through subsystem trees anyway, so the spin-off of a trivial tree doesn't make sense any more, and is not worth the merge conflicts it might sometimes create. So remove any mentions of it from kernel documentation for good. Link: https://lore.kernel.org/all/nycvar.YFH.7.76.2104222334290.18270@cbobk.fhfr.pm/ Signed-off-by: Jiri Kosina commit da0119a9123c73269657fc61f537223d6affef02 Merge: a9e6b3819b365 567617baac2a5 0b8bf9cb142da Author: Borislav Petkov Date: Mon Jan 10 10:07:00 2022 +0100 Merge branches 'edac-misc' and 'edac-amd64' into edac-updates-for-v5.17 Signed-off-by: Borislav Petkov commit cd598d21294e088c3c9e518a7e9098f94ae8cf6a Merge: f7716563441ae 415e701cee522 Author: Jiri Kosina Date: Mon Jan 10 09:59:32 2022 +0100 Merge branch 'for-5.17/thrustmaster' into for-linus commit f7716563441ae29cc91954a7744ff7bfdd344b2d Merge: 50ae0cfc28c8a 33812fc7c8d77 Author: Jiri Kosina Date: Mon Jan 10 09:58:34 2022 +0100 Merge branch 'for-5.17/magicmouse' into for-linus - proper batter reporting for hid-magicmouse USB-connected devices (José Expósito) commit 50ae0cfc28c8a98ded16bf7a47f8bbdbbf3702e1 Merge: 3551a3ff8229e 03dada294d083 Author: Jiri Kosina Date: Mon Jan 10 09:57:51 2022 +0100 Merge branch 'for-5.17/logitech' into for-linus - add Filipe Laíns as a code reviewer for hid-logitech family of drivers commit 3551a3ff8229e15d2a4b47b8234923bc72da65ef Merge: 906095af85e8b 33a5c27934517 Author: Jiri Kosina Date: Mon Jan 10 09:56:57 2022 +0100 Merge branch 'for-5.17/letsketch' into for-linus - new driver to support for LetSketch device (Hans de Goede) commit 906095af85e8b2e53ee9f8c50b3dff365aa09df8 Merge: c524559acd5d0 d951ae1ce8033 Author: Jiri Kosina Date: Mon Jan 10 09:56:27 2022 +0100 Merge branch 'for-5.17/i2c-hid' into for-linus - PM wakeup support for i2c-hid driver (Matthias Kaehlcke) commit c524559acd5d0903fa6e3b8e608bf5851de7217a Merge: fce0d27584371 8590222e4b021 Author: Jiri Kosina Date: Mon Jan 10 09:55:44 2022 +0100 Merge branch 'for-5.17/hidraw' into for-linus - locking performance improvement for hidraw code (André Almeida) commit fce0d275843712db6f9b611856f539da29ad5529 Merge: 8a2094d679d92 7f84e2439ed2e Author: Jiri Kosina Date: Mon Jan 10 09:54:31 2022 +0100 Merge branch 'for-5.17/apple' into for-linus - Apple Magic Keyboard support improvements (José Expósito, Alex Henrie, Benjamin Berg) commit 8a2094d679d921d104d3296528d4fa419702ce1c Merge: 3809fe4798611 b60d3c803d760 Author: Jiri Kosina Date: Mon Jan 10 09:49:13 2022 +0100 Merge branch 'for-5.17/core' into for-linus - support for USI style pens (Tero Kristo, Mika Westerberg) - quirk for devices that need inverted X/Y axes (Alistair Francis) - small core code cleanups and deduplication (Benjamin Tissoires) commit 3d966521a824082952990492442c7b486fefb48c Author: Yuezhang.Mo Date: Mon Aug 16 11:30:51 2021 +0800 exfat: fix missing REQ_SYNC in exfat_update_bhs() If 'dirsync' is enabled, all directory updates within the filesystem should be done synchronously. exfat_update_bh() does as this, but exfat_update_bhs() does not. Reviewed-by: Andy.Wu Reviewed-by: Aoyama, Wataru Reviewed-by: Kobayashi, Kento Reviewed-by: Sungjong Seo Signed-off-by: Yuezhang.Mo Signed-off-by: Namjae Jeon commit c71510b3fa27f96840c5737d8a47dd7b370e376c Author: Yuezhang.Mo Date: Thu Dec 16 21:58:37 2021 +0900 exfat: remove argument 'sector' from exfat_get_dentry() No any function uses argument 'sector', remove it. Reviewed-by: Andy.Wu Reviewed-by: Aoyama, Wataru Acked-by: Sungjong Seo Signed-off-by: Yuezhang.Mo Signed-off-by: Namjae Jeon commit 1ed147e29e505de819aaa5b57919c25348f72e1f Author: Namjae Jeon Date: Thu Nov 25 21:01:11 2021 +0900 exfat: move super block magic number to magic.h Move exfat superblock magic number from local definition to magic.h. It is also needed by userspace programs that call fstatfs(). Acked-by: Christian Brauner Signed-off-by: Namjae Jeon commit 92fba084b79e6bc7b12fc118209f1922c1a2df56 Author: Christophe Vu-Brugier Date: Mon Nov 22 22:02:37 2021 +0900 exfat: fix i_blocks for files truncated over 4 GiB In exfat_truncate(), the computation of inode->i_blocks is wrong if the file is larger than 4 GiB because a 32-bit variable is used as a mask. This is fixed and simplified by using round_up(). Also fix the same buggy computation in exfat_read_root() and another (correct) one in exfat_fill_inode(). The latter was fixed another way last month but can be simplified by using round_up() as well. See: commit 0c336d6e33f4 ("exfat: fix incorrect loading of i_blocks for large files") Fixes: 98d917047e8b ("exfat: add file operations") Cc: stable@vger.kernel.org # v5.7+ Suggested-by: Matthew Wilcox Reviewed-by: Sungjong Seo Signed-off-by: Christophe Vu-Brugier Signed-off-by: Namjae Jeon commit 7dee6f57d7f22a89dd214518c778aec448270d4c Author: Christophe Vu-Brugier Date: Tue Nov 2 22:23:58 2021 +0100 exfat: reuse exfat_inode_info variable instead of calling EXFAT_I() Also add a local "struct exfat_inode_info *ei" variable to exfat_truncate() to simplify the code. Signed-off-by: Christophe Vu-Brugier Signed-off-by: Namjae Jeon commit 8cf058834b11c08b344fc4549b03d723f16c9241 Author: Christophe Vu-Brugier Date: Tue Nov 2 22:23:57 2021 +0100 exfat: make exfat_find_location() static Make exfat_find_location() static. Signed-off-by: Christophe Vu-Brugier Signed-off-by: Namjae Jeon commit 6fa96cd5ad7a0c8f3f3f6b2b5f062721e8f17a54 Author: Christophe Vu-Brugier Date: Tue Nov 2 22:23:56 2021 +0100 exfat: fix typos in comments Fix typos in comments. Signed-off-by: Christophe Vu-Brugier Signed-off-by: Namjae Jeon commit e21a28bbcc0c5dc8ab86af77edb530d6fc0c20ff Author: Christophe Vu-Brugier Date: Tue Nov 2 22:23:55 2021 +0100 exfat: simplify is_valid_cluster() Simplify is_valid_cluster(). Signed-off-by: Christophe Vu-Brugier Signed-off-by: Namjae Jeon commit f029cedb9bb5bab7f1bb3042be348f2dac0ee66e Author: Eric Biggers Date: Wed Dec 8 16:38:33 2021 -0800 MAINTAINERS: add entries for block layer documentation Include Documentation/block/ and Documentation/ABI/stable/sysfs-block in the "BLOCK LAYER" maintainers file entry. Reviewed-by: Greg Kroah-Hartman Reviewed-by: Hannes Reinecke Reviewed-by: Martin K. Petersen Reviewed-by: Bart Van Assche Signed-off-by: Eric Biggers Link: https://lore.kernel.org/r/20211209003833.6396-9-ebiggers@kernel.org Signed-off-by: Jens Axboe commit 208e4f9c0028e9181220460600b1df0bc677e796 Author: Eric Biggers Date: Wed Dec 8 16:38:32 2021 -0800 docs: block: remove queue-sysfs.rst This has been replaced by Documentation/ABI/stable/sysfs-block, which is the correct place for sysfs documentation. Reviewed-by: Greg Kroah-Hartman Reviewed-by: Hannes Reinecke Reviewed-by: Martin K. Petersen Reviewed-by: Bart Van Assche Signed-off-by: Eric Biggers Link: https://lore.kernel.org/r/20211209003833.6396-8-ebiggers@kernel.org Signed-off-by: Jens Axboe commit 8bc2f7c67061cb39e317a45ad9870f529b1fb190 Author: Eric Biggers Date: Wed Dec 8 16:38:31 2021 -0800 docs: sysfs-block: document virt_boundary_mask /sys/block//queue/virt_boundary_mask is completely undocumented. Document it. Reviewed-by: Bart Van Assche Signed-off-by: Eric Biggers Link: https://lore.kernel.org/r/20211209003833.6396-7-ebiggers@kernel.org Signed-off-by: Jens Axboe commit 1163010418a7f0c60c309743498cb6c5cd828ecc Author: Eric Biggers Date: Wed Dec 8 16:38:30 2021 -0800 docs: sysfs-block: document stable_writes /sys/block//queue/stable_writes is completely undocumented. Document it. Reviewed-by: Bart Van Assche Signed-off-by: Eric Biggers Link: https://lore.kernel.org/r/20211209003833.6396-6-ebiggers@kernel.org Signed-off-by: Jens Axboe commit 849ab826e10531f106846e8e9eeae8d00a198f6e Author: Eric Biggers Date: Wed Dec 8 16:38:29 2021 -0800 docs: sysfs-block: fill in missing documentation from queue-sysfs.rst sysfs documentation is supposed to go in Documentation/ABI/. However, /sys/block//queue/* are documented in Documentation/block/queue-sysfs.rst, and sometimes redundantly in Documentation/ABI/stable/sysfs-block too. Let's consolidate this documentation into Documentation/ABI/. Therefore, copy the relevant docs from queue-sysfs.rst into sysfs-block. This primarily means adding the 25 missing files that were documented in queue-sysfs.rst only, as well as mentioning the RO/RW status of files. Documentation/ABI/ requires "Date" and "Contact" fields. For the Date fields, I used the date of the commit which added support for each file. For the "Contact" fields, I used linux-block. Reviewed-by: Greg Kroah-Hartman Reviewed-by: Hannes Reinecke Reviewed-by: Martin K. Petersen Reviewed-by: Bart Van Assche Signed-off-by: Eric Biggers Link: https://lore.kernel.org/r/20211209003833.6396-5-ebiggers@kernel.org Signed-off-by: Jens Axboe commit 8b0551a74b4a9396a7f6ddb0c5f6f3c8465e9d45 Author: Eric Biggers Date: Wed Dec 8 16:38:28 2021 -0800 docs: sysfs-block: add contact for nomerges The nomerges file was missing a "Contact" entry. Use linux-block. Reviewed-by: Greg Kroah-Hartman Reviewed-by: Hannes Reinecke Reviewed-by: Martin K. Petersen Reviewed-by: Bart Van Assche Signed-off-by: Eric Biggers Link: https://lore.kernel.org/r/20211209003833.6396-4-ebiggers@kernel.org Signed-off-by: Jens Axboe commit 07c9093c429361dd405499b1e433e4170b81551f Author: Eric Biggers Date: Wed Dec 8 16:38:27 2021 -0800 docs: sysfs-block: sort alphabetically Sort the documentation for the files alphabetically by file path so that there is a logical order and it's clear where to add new files. With two small exceptions, this patch doesn't change the documentation itself and just reorders it: - In /sys/block///stat, I replaced with to be consistent with the other files. - The description for /sys/block///stat referred to another file "above", which I reworded. Reviewed-by: Greg Kroah-Hartman Reviewed-by: Hannes Reinecke Reviewed-by: Martin K. Petersen Reviewed-by: Bart Van Assche Signed-off-by: Eric Biggers Link: https://lore.kernel.org/r/20211209003833.6396-3-ebiggers@kernel.org Signed-off-by: Jens Axboe commit ae7a7a53498f452eb927cd4b4eed0bccded85ebf Author: Eric Biggers Date: Wed Dec 8 16:38:26 2021 -0800 docs: sysfs-block: move to stable directory The block layer sysfs ABI is widely used by userspace software and is considered stable. Reviewed-by: Martin K. Petersen Reviewed-by: Bart Van Assche Signed-off-by: Eric Biggers Link: https://lore.kernel.org/r/20211209003833.6396-2-ebiggers@kernel.org Signed-off-by: Jens Axboe commit 9d497e2941c30a060ba62d5485b3bc9d91ffb09e Author: Ming Lei Date: Tue Jan 4 21:42:23 2022 +0800 block: don't protect submit_bio_checks by q_usage_counter Commit cc9c884dd7f4 ("block: call submit_bio_checks under q_usage_counter") uses q_usage_counter to protect submit_bio_checks for avoiding IO after disk is deleted by del_gendisk(). Turns out the protection isn't necessary, because once blk_mq_freeze_queue_wait() in del_gendisk() returns: 1) all in-flight IO has been done 2) all new IO will be failed in __bio_queue_enter() because q_usage_counter is dead, and GD_DEAD is set 3) both disk and request queue instance are safe since caller of submit_bio() guarantees that the disk can't be closed. Once submit_bio_checks() needn't the protection of q_usage_counter, we can move submit_bio_checks before calling blk_mq_submit_bio() and ->submit_bio(). With this change, we needn't to throttle queue with holding one allocated request, then precise driver tag or request won't be wasted in throttling. Meantime we can unify the bio check for both bio based and request based driver. Cc: Christoph Hellwig Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20220104134223.590803-1-ming.lei@redhat.com Signed-off-by: Jens Axboe commit 00f5117c5f785b95b13663e52dcdcf684a47d4e3 Author: Colin Ian King Date: Sun Jan 9 19:45:58 2022 +0000 hwmon: (nzxt-smart2) make array detect_fans_report static const Don't populate the read-only array detect_fans_report on the stack but instead it static const. Also makes the object code a little smaller. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20220109194558.45811-1-colin.i.king@gmail.com Signed-off-by: Guenter Roeck commit 8650381f33fba33e162db2266ce74f1b87a2f71c Author: Rob Herring Date: Fri Dec 3 16:45:23 2021 -0600 dt-bindings: net: Add missing properties used in examples With 'unevaluatedProperties' support implemented, the following warnings are generated in the net bindings: Documentation/devicetree/bindings/net/qca,ar71xx.example.dt.yaml: ethernet@19000000: Unevaluated properties are not allowed ('qca,ethcfg' was unexpected) Documentation/devicetree/bindings/net/stm32-dwmac.example.dt.yaml: ethernet@40028000: Unevaluated properties are not allowed ('reg-names', 'snps,pbl' were unexpected) Documentation/devicetree/bindings/net/ti,cpsw-switch.example.dt.yaml: mdio@1000: Unevaluated properties are not allowed ('clocks', 'clock-names' were unexpected) Documentation/devicetree/bindings/net/ti,k3-am654-cpsw-nuss.example.dt.yaml: mdio@f00: Unevaluated properties are not allowed ('clocks', 'clock-names' were unexpected) Add the missing properties/nodes as necessary. Cc: "David S. Miller" Cc: Jakub Kicinski Cc: "Andreas Färber" Cc: Manivannan Sadhasivam Cc: Maxime Coquelin Cc: Alexandre Torgue Cc: Nobuhiro Iwamatsu Cc: Cristian Ciocaltea Cc: "G. Jaya Kumaran" Cc: Oleksij Rempel Cc: Christophe Roullier Cc: Grygorii Strashko Cc: netdev@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-actions@lists.infradead.org Cc: linux-stm32@st-md-mailman.stormreply.com Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211206174153.2296977-1-robh@kernel.org commit 1d01efaf1824aea57cbcf96b27d6f36441898a4b Author: Rob Herring Date: Mon Dec 6 11:41:47 2021 -0600 dt-bindings: net: snps,dwmac: Enable burst length properties for more compatibles With 'unevaluatedProperties' support implemented, the properties 'snps,pbl', 'snps,txpbl', and 'snps,rxpbl' are not allowed in the examples for some of the DWMAC versions: Documentation/devicetree/bindings/net/intel,dwmac-plat.example.dt.yaml: ethernet@3a000000: Unevaluated properties are not allowed ('snps,pbl', 'mdio0' were unexpected) Documentation/devicetree/bindings/net/stm32-dwmac.example.dt.yaml: ethernet@5800a000: Unevaluated properties are not allowed ('reg-names', 'snps,pbl' were unexpected) Documentation/devicetree/bindings/net/stm32-dwmac.example.dt.yaml: ethernet@40028000: Unevaluated properties are not allowed ('reg-names', 'snps,pbl' were unexpected) Documentation/devicetree/bindings/net/stm32-dwmac.example.dt.yaml: ethernet@40027000: Unevaluated properties are not allowed ('reg-names', 'snps,pbl' were unexpected) Documentation/devicetree/bindings/net/toshiba,visconti-dwmac.example.dt.yaml: ethernet@28000000: Unevaluated properties are not allowed ('snps,txpbl', 'snps,rxpbl', 'mdio0' were unexpected) This appears to be an oversight, so fix it by allowing the properties on the v3.50a, v4.10a, and v4.20a versions of the DWMAC. Cc: "David S. Miller" Cc: Jakub Kicinski Cc: Alexandre Torgue Cc: Giuseppe Cavallaro Cc: Jose Abreu Cc: netdev@vger.kernel.org Signed-off-by: Rob Herring Reviewed-by: Thierry Reding Link: https://lore.kernel.org/r/20211206174147.2296770-1-robh@kernel.org commit ad31ce56c434bbd792f3ee79160cedaf20f7f238 Author: Rob Herring Date: Mon Dec 6 11:41:39 2021 -0600 dt-bindings: net: mdio: Allow any child node name An MDIO bus can have devices other than ethernet PHYs on it, so it should allow for any node name rather than just 'ethernet-phy'. Cc: Andrew Lunn Cc: Heiner Kallweit Cc: Russell King Cc: "David S. Miller" Cc: Jakub Kicinski Cc: Florian Fainelli Cc: netdev@vger.kernel.org Signed-off-by: Rob Herring Reviewed-by: Thierry Reding Acked-by: Florian Fainelli Link: https://lore.kernel.org/r/20211206174139.2296497-1-robh@kernel.org commit 8aaaf2f3af2ae212428f4db1af34214225f5cec3 Merge: 208dd45d8d050 dd3ca4c5184ea Author: Jakub Kicinski Date: Sun Jan 9 16:59:30 2022 -0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Merge in fixes directly in prep for the 5.17 merge window. No conflicts. Signed-off-by: Jakub Kicinski commit 15e2721b19acb1bfb18ac90775503b75d8aecbb2 Author: Christian Schoenebeck Date: Thu Dec 30 14:23:18 2021 +0100 net/9p: show error message if user 'msize' cannot be satisfied If user supplied a large value with the 'msize' option, then client would silently limit that 'msize' value to the maximum value supported by transport. That's a bit confusing for users of not having any indication why the preferred 'msize' value could not be satisfied. Link: https://lkml.kernel.org/r/783ba37c1566dd715b9a67d437efa3b77e3cd1a7.1640870037.git.linux_oss@crudebyte.com Reported-by: Vivek Goyal Signed-off-by: Christian Schoenebeck Signed-off-by: Dominique Martinet commit deadd8746ec72bd6cbc351a004809f8a49a61d4b Author: Christian Schoenebeck Date: Tue Jan 4 13:53:59 2022 +0100 MAINTAINERS: 9p: add Christian Schoenebeck as reviewer Volunteering as reviewer for 9p patches. As I am quite familiar with the 9p code base in the Linux kernel already, plus being current maintainer of 9p in QEMU this move probably makes sense. Link: https://lkml.kernel.org/r/E1n4jXv-000445-GK@lizzy.crudebyte.com Signed-off-by: Christian Schoenebeck [Dominique: reworded description] Signed-off-by: Dominique Martinet commit 3cb6ee991496b67ee284c6895a0ba007e2d7bac3 Author: Christian Brauner Date: Mon Nov 29 12:44:34 2021 +0100 9p: only copy valid iattrs in 9P2000.L setattr implementation The 9P2000.L setattr method v9fs_vfs_setattr_dotl() copies struct iattr values without checking whether they are valid causing unitialized values to be copied. The 9P2000 setattr method v9fs_vfs_setattr() method gets this right. Check whether struct iattr fields are valid first before copying in v9fs_vfs_setattr_dotl() too and make sure that all other fields are set to 0 apart from {g,u}id which should be set to INVALID_{G,U}ID. This ensure that they can be safely sent over the wire or printed for debugging later on. Link: https://lkml.kernel.org/r/20211129114434.3637938-1-brauner@kernel.org Link: https://lkml.kernel.org/r/000000000000a0d53f05d1c72a4c%40google.com Cc: Eric Van Hensbergen Cc: Latchesar Ionkov Cc: Dominique Martinet Cc: stable@kernel.org Cc: v9fs-developer@lists.sourceforge.net Reported-by: syzbot+dfac92a50024b54acaa4@syzkaller.appspotmail.com Signed-off-by: Christian Brauner [Dominique: do not set a/mtime with just ATTR_A/MTIME as discussed] Signed-off-by: Dominique Martinet commit a7a427d1543f89ad57fda5d6b9bb70f4cecb2fba Author: Zhang Mingyu Date: Fri Nov 12 09:25:47 2021 +0000 9p: Use BUG_ON instead of if condition followed by BUG. This issue was detected with the help of Coccinelle. Link: https://lkml.kernel.org/r/20211112092547.9153-1-zhang.mingyu@zte.com.cn Reported-by: Zeal Robot Signed-off-by: Zhang Mingyu Signed-off-by: Dominique Martinet commit 019641d1b57dff018972b23c95e898f9ff18222f Author: Thomas Weißschuh Date: Wed Nov 3 20:38:23 2021 +0100 net/p9: load default transports Now that all transports are split into modules it may happen that no transports are registered when v9fs_get_default_trans() is called. When that is the case try to load more transports from modules. Link: https://lkml.kernel.org/r/20211103193823.111007-5-linux@weissschuh.net Signed-off-by: Thomas Weißschuh [Dominique: constify v9fs_get_trans_by_name argument as per patch1v2] Signed-off-by: Dominique Martinet commit 99aa673e2925c89a20eeb5477383c4f2e97d0146 Author: Thomas Weißschuh Date: Wed Nov 3 20:38:22 2021 +0100 9p/xen: autoload when xenbus service is available Link: https://lkml.kernel.org/r/20211103193823.111007-4-linux@weissschuh.net Signed-off-by: Thomas Weißschuh Signed-off-by: Dominique Martinet commit 1c582c6dc4244d88f702dc3afd5b47225332edf6 Author: Thomas Weißschuh Date: Wed Nov 3 20:38:21 2021 +0100 9p/trans_fd: split into dedicated module This allows these transports only to be used when needed. Link: https://lkml.kernel.org/r/20211103193823.111007-3-linux@weissschuh.net Signed-off-by: Thomas Weißschuh [Dominique: Kconfig NET_9P_FD: -depends VIRTIO, +default NET_9P] Signed-off-by: Dominique Martinet commit 0bbeb64cb063d746cdb2fdc8c1e3f4d51e268b23 Author: Qin Jian Date: Wed Dec 22 15:05:57 2021 +0800 dt-bindings: vendor-prefixes: Add Sunplus Add vendor prefix for Sunplus Technology Co., Ltd. (http://www.sunplus.com) Acked-by: Rob Herring Signed-off-by: Qin Jian Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/2e74a1339a5ea54d92fdc4d1998a2b169e23b82b.1640154492.git.qinjian@cqplus1.com commit 208dd45d8d050360b46ded439a057bcc7cbf3b09 Author: Benjamin Yim Date: Sun Jan 9 21:08:24 2022 +0800 tcp: tcp_send_challenge_ack delete useless param `skb` After this parameter is passed in, there is no usage, and deleting it will not bring any impact. Reviewed-by: Eric Dumazet Signed-off-by: Benjamin Yim Link: https://lore.kernel.org/r/20220109130824.2776-1-yan2228598786@gmail.com Signed-off-by: Jakub Kicinski commit 0959a82ab3e569509cbab111564bea1c916bb204 Author: Christophe JAILLET Date: Sun Jan 9 19:49:09 2022 +0100 net/qla3xxx: Remove useless DMA-32 fallback configuration As stated in [1], dma_set_mask() with a 64-bit mask never fails if dev->dma_mask is non-NULL. So, if it fails, the 32 bits case will also fail for the same reason. So, if dma_set_mask_and_coherent() succeeds, 'pci_using_dac' is known to be 1. Simplify code and remove some dead code accordingly. [1]: https://lkml.org/lkml/2021/6/7/398 Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/3011689e8c77d49d7e44509d5a8241320ec408c5.1641754134.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jakub Kicinski commit 7ac2d77c97d0a0eb789dd13b3c1718eb0b3180f7 Author: Christophe JAILLET Date: Sun Jan 9 17:04:48 2022 +0100 rocker: Remove useless DMA-32 fallback configuration As stated in [1], dma_set_mask() with a 64-bit mask never fails if dev->dma_mask is non-NULL. So, if it fails, the 32 bits case will also fail for the same reason. Simplify code and remove some dead code accordingly. [1]: https://lkml.org/lkml/2021/6/7/398 Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/9ba2d13099d216f3df83e50ad33a05504c90fe7c.1641744274.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jakub Kicinski commit 004464835bfc6e24c9fa468153f52f4e4f1d610e Author: Christophe JAILLET Date: Sun Jan 9 16:57:50 2022 +0100 hinic: Remove useless DMA-32 fallback configuration As stated in [1], dma_set_mask() with a 64-bit mask never fails if dev->dma_mask is non-NULL. So, if it fails, the 32 bits case will also fail for the same reason. Simplify code and remove some dead code accordingly. [1]: https://lkml.org/lkml/2021/6/7/398 Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/23541c28df8d0dcd3663b5dbe0f76af71e70e9cc.1641743855.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jakub Kicinski commit e20a471256b0adccfa6b61aa12c4888abb542320 Author: Christophe JAILLET Date: Sun Jan 9 16:50:19 2022 +0100 lan743x: Remove useless DMA-32 fallback configuration As stated in [1], dma_set_mask() with a 64-bit mask never fails if dev->dma_mask is non-NULL. So, if it fails, the 32 bits case will also fail for the same reason. Simplify code and remove some dead code accordingly. [1]: https://lkml.org/lkml/2021/6/7/398 Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/ef548716606f257939df9738a801f15b6edf2568.1641743405.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jakub Kicinski commit cfcfc8f5a54b2e125b3be857f630ffc37822df26 Author: Christophe JAILLET Date: Sun Jan 9 16:41:43 2022 +0100 net: enetc: Remove useless DMA-32 fallback configuration As stated in [1], dma_set_mask() with a 64-bit mask never fails if dev->dma_mask is non-NULL. So, if it fails, the 32 bits case will also fail for the same reason. Simplify code and remove some dead code accordingly. [1]: https://lkml.org/lkml/2021/6/7/398 Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/dbecd4eb49a9586ee343b5473dda4b84c42112e9.1641742884.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jakub Kicinski commit 030f9ce8c739a5cfa420291188023b7741b7bc73 Author: Christophe JAILLET Date: Sun Jan 9 14:59:48 2022 +0100 cxgb4vf: Remove useless DMA-32 fallback configuration As stated in [1], dma_set_mask() with a 64-bit mask never fails if dev->dma_mask is non-NULL. So, if it fails, the 32 bits case will also fail for the same reason. So, if dma_set_mask_and_coherent() succeeds, 'pci_using_dac' is known to be 1. Simplify code and remove some dead code accordingly. [1]: https://lkml.org/lkml/2021/6/7/398 Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/b14986ea39cea2ca9a6cd0476a3fc167c853ee67.1641736772.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jakub Kicinski commit 7fc7fc5da61bfb0ed6056243de3bb17bfbce9f53 Author: Christophe JAILLET Date: Sun Jan 9 14:53:27 2022 +0100 cxgb4: Remove useless DMA-32 fallback configuration As stated in [1], dma_set_mask() with a 64-bit mask never fails if dev->dma_mask is non-NULL. So, if it fails, the 32 bits case will also fail for the same reason. So, if dma_set_mask_and_coherent() succeeds, 'highdma' is known to be true. Simplify code and remove some dead code accordingly. [1]: https://lkml.org/lkml/2021/6/7/398 Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/56db10d53be0897ff1be5f37d64b91cb7e1d932c.1641736387.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jakub Kicinski commit 544bdad074945c341b03a43f98efcc4e067d7b1b Author: Christophe JAILLET Date: Sun Jan 9 14:51:22 2022 +0100 cxgb3: Remove useless DMA-32 fallback configuration As stated in [1], dma_set_mask() with a 64-bit mask never fails if dev->dma_mask is non-NULL. So, if it fails, the 32 bits case will also fail for the same reason. So, if dma_set_mask_and_coherent() succeeds, 'pci_using_dac' is known to be 1. Simplify code and remove some dead code accordingly. [1]: https://lkml.org/lkml/2021/6/7/398 Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/a0e2539aefb0034091aca02c98440ea9459f1258.1641736234.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jakub Kicinski commit 3aa440503be5ee1c63b63ec5da41c50e56bd9ae4 Author: Christophe JAILLET Date: Sun Jan 9 13:19:28 2022 +0100 bnx2x: Remove useless DMA-32 fallback configuration As stated in [1], dma_set_mask() with a 64-bit mask never fails if dev->dma_mask is non-NULL. So, if it fails, the 32 bits case will also fail for the same reason. Moreover, dma_set_mask_and_coherent() returns 0 or -EIO, so the return code of the function can be used directly. Finally, inline bnx2x_set_coherency_mask() because it is now only a wrapper for a single dma_set_mask_and_coherent() call. Simplify code and remove some dead code accordingly. [1]: https://lkml.org/lkml/2021/6/7/398 Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/29608a525876afddceabf8f11b2ba606da8748fc.1641730747.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jakub Kicinski commit 948f6b297f6df4abaac207768ca1b7f7a7f55ffb Author: Christophe JAILLET Date: Sun Jan 9 12:13:47 2022 +0100 et131x: Remove useless DMA-32 fallback configuration As stated in [1], dma_set_mask() with a 64-bit mask never fails if dev->dma_mask is non-NULL. So, if it fails, the 32 bits case will also fail for the same reason. Moreover, dma_set_mask_and_coherent() returns 0 or -EIO, so the return code of the function can be used directly. There is no need to 'rc = -EIO' explicitly. Simplify code and remove some dead code accordingly. [1]: https://lkml.org/lkml/2021/6/7/398 Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/b9aa46e7e5a5aa61f56aac5ea439930f41ad9946.1641726804.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jakub Kicinski commit 942e78916f0c8385c60823082bed0c3f5f0c7fa6 Author: Christophe JAILLET Date: Sun Jan 9 10:03:49 2022 +0100 be2net: Remove useless DMA-32 fallback configuration As stated in [1], dma_set_mask() with a 64-bit mask never fails if dev->dma_mask is non-NULL. So, if it fails, the 32 bits case will also fail for the same reason. So if dma_set_mask_and_coherent() succeeds, 'netdev->features' will have NETIF_F_HIGHDMA in all cases. Move the assignment of this feature in be_netdev_init() instead be_probe() which is a much logical place. Simplify code and remove some dead code accordingly. [1]: https://lkml.org/lkml/2021/6/7/398 Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/637696d7141faa68c29fc34b70f9aa67d5e605f0.1641718999.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jakub Kicinski commit c38f30683956722b2de31f026e73c8622a2fade3 Author: Christophe JAILLET Date: Sun Jan 9 09:50:22 2022 +0100 vmxnet3: Remove useless DMA-32 fallback configuration As stated in [1], dma_set_mask() with a 64-bit mask never fails if dev->dma_mask is non-NULL. So, if it fails, the 32 bits case will also fail for the same reason. So if dma_set_mask_and_coherent() succeeds, 'dma64' is know to be 'true'. Simplify code and remove some dead code accordingly. [1]: https://lkml.org/lkml/2021/6/7/398 Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/43e5dcf1a5e9e9c5d2d86f87810d6e93e3d22e32.1641718188.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jakub Kicinski commit 9aaa82d2e8d5d39472aebef5d3fcf033421b645f Author: Christophe JAILLET Date: Sat Jan 8 17:16:16 2022 +0100 bna: Simplify DMA setting As stated in [1], dma_set_mask() with a 64-bit mask will never fail if dev->dma_mask is non-NULL. So, if it fails, the 32 bits case will also fail for the same reason. So, if dma_set_mask_and_coherent() succeeds, 'using_dac' is known to be 'true'. This variable can be removed. Simplify code and remove some dead code accordingly. [1]: https://lkml.org/lkml/2021/6/7/398 Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/1d5a7b3f4fa735f1233c3eb3fa07e71df95fad75.1641658516.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jakub Kicinski commit ba8a5863497251ca32786ad3db5e24b7375ddde2 Author: Christophe JAILLET Date: Sat Jan 8 15:26:06 2022 +0100 net: alteon: Simplify DMA setting As stated in [1], dma_set_mask() with a 64-bit mask will never fail if dev->dma_mask is non-NULL. So, if it fails, the 32 bits case will also fail for the same reason. If dma_set_mask_and_coherent() succeeds, 'ap->pci_using_dac' is known to be 1. So 'pci_using_dac' can be removed from the 'struct ace_private'. Simplify code and remove some dead code accordingly. [1]: https://lkml.org/lkml/2021/6/7/398 Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/1a414c05c27b21c661aef61dffe1adcd1578b1f5.1641651917.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jakub Kicinski commit 21ef11eaf3f78dda7fd20abe6e60e27038cb06a3 Author: Christophe JAILLET Date: Sat Jan 8 15:22:13 2022 +0100 myri10ge: Simplify DMA setting As stated in [1], dma_set_mask() with a 64-bit mask will never fail if dev->dma_mask is non-NULL. So, if it fails, the 32 bits case will also fail for the same reason. If dma_set_mask_and_coherent() succeeds, 'dac_enabled' is known to be 1. Simplify code and remove some dead code accordingly. [1]: https://lkml.org/lkml/2021/6/7/398 Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/e92b0c3a3c1574a97a4e6fd0c30225f10fa59d18.1641651693.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jakub Kicinski commit a72dc1992de85ca712836c845458fa72824e355e Author: Christophe JAILLET Date: Sat Jan 8 14:48:59 2022 +0100 qlcnic: Simplify DMA setting As stated in [1], dma_set_mask() with a 64-bit mask will never fail if dev->dma_mask is non-NULL. So, if it fails, the 32 bits case will also fail for the same reason. So qlcnic_set_dma_mask(), (in qlcnic_main.c) can be simplified a lot and inlined directly in its only caller. If dma_set_mask_and_coherent() succeeds, 'pci_using_dac' is known to be 1. So it can be removed from all the calling chain. qlcnic_setup_netdev() can finally be simplified as-well. [1]: https://lkml.org/lkml/2021/6/7/398 Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/4996ab0337d62ec6a54b2edf234cd5ced4b4d7ad.1641649611.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jakub Kicinski commit 009e4ee381a0b6176969fe3026fc5eafe05705d0 Author: Jakub Kicinski Date: Fri Jan 7 19:44:38 2022 -0800 net: allwinner: Fix print format Kees reports quoted commit introduced the following warning on arm64: drivers/net/ethernet/allwinner/sun4i-emac.c:922:60: error: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'resource_size_t' {aka 'long long unsigned int'} [-Werror=format=] 922 | netdev_info(ndev, "get io resource from device: 0x%x, size = %u\n", | ~^ | | | unsigned int | %llx 923 | regs->start, resource_size(regs)); | ~~~~~~~~~~~ | | | resource_size_t {aka long long unsigned int} .. and another one like that for resource_size(). Switch to %pa and a cast. Reported-by: Kees Cook Fixes: 47869e82c8b8 ("sun4i-emac.c: add dma support") Link: https://lore.kernel.org/r/20220108034438.2227343-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 07b17f0f7485bcbc7902cf6f56a89f5b716344bd Author: Yunsheng Lin Date: Fri Jan 7 17:00:42 2022 +0800 page_pool: remove spinlock in page_pool_refill_alloc_cache() As page_pool_refill_alloc_cache() is only called by __page_pool_get_cached(), which assumes non-concurrent access as suggested by the comment in __page_pool_get_cached(), and ptr_ring allows concurrent access between consumer and producer, so remove the spinlock in page_pool_refill_alloc_cache(). Signed-off-by: Yunsheng Lin Acked-by: Jesper Dangaard Brouer Link: https://lore.kernel.org/r/20220107090042.13605-1-linyunsheng@huawei.com Signed-off-by: Jakub Kicinski commit dd3ca4c5184ea98e40acb8eb293d85b88ea04ee2 Author: Taehee Yoo Date: Sun Jan 9 16:37:02 2022 +0000 amt: fix wrong return type of amt_send_membership_update() amt_send_membership_update() would return -1 but it's return type is bool. So, it should be used TRUE instead of -1. Fixes: cbc21dc1cfe9 ("amt: add data plane of amt interface") Reported-by: kernel test robot Signed-off-by: Taehee Yoo Link: https://lore.kernel.org/r/20220109163702.6331-1-ap420073@gmail.com Signed-off-by: Jakub Kicinski commit d668769eb9c52b150753f1653f7f5a0aeb8239d2 Author: Pavel Skripkin Date: Fri Jan 7 01:57:16 2022 +0300 net: mcs7830: handle usb read errors properly Syzbot reported uninit value in mcs7830_bind(). The problem was in missing validation check for bytes read via usbnet_read_cmd(). usbnet_read_cmd() internally calls usb_control_msg(), that returns number of bytes read. Code should validate that requested number of bytes was actually read. So, this patch adds missing size validation check inside mcs7830_get_reg() to prevent uninit value bugs Reported-and-tested-by: syzbot+003c0a286b9af5412510@syzkaller.appspotmail.com Fixes: 2a36d7083438 ("USB: driver for mcs7830 (aka DeLOCK) USB ethernet adapter") Signed-off-by: Pavel Skripkin Reviewed-by: Arnd Bergmann Link: https://lore.kernel.org/r/20220106225716.7425-1-paskripkin@gmail.com Signed-off-by: Jakub Kicinski commit 6738fc77ffa2575f38b88d85583450184d59ed94 Merge: 342402c426902 1c7fab70df085 Author: Jakub Kicinski Date: Sun Jan 9 16:30:37 2022 -0800 Merge branch 'net-skb-introduce-kfree_skb_with_reason' Menglong Dong says: ==================== net: skb: introduce kfree_skb_with_reason() In this series patch, the interface kfree_skb_with_reason() is introduced(), which is used to collect skb drop reason, and pass it to 'kfree_skb' tracepoint. Therefor, 'drop_monitor' or eBPF is able to monitor abnormal skb with detail reason. In fact, this series patches are out of the intelligence of David and Steve, I'm just a truck man :/ Previous discussion is here: https://lore.kernel.org/netdev/20211118105752.1d46e990@gandalf.local.home/ https://lore.kernel.org/netdev/67b36bd8-2477-88ac-83a0-35a1eeaf40c9@gmail.com/ In the first patch, kfree_skb_with_reason() is introduced and the 'reason' field is added to 'kfree_skb' tracepoint. In the second patch, 'kfree_skb()' in replaced with 'kfree_skb_with_reason()' in tcp_v4_rcv(). In the third patch, 'kfree_skb_with_reason()' is used in __udp4_lib_rcv(). Changes since v3: - fix some code style problems in skb.h Changes since v2: - rename kfree_skb_with_reason() to kfree_skb_reason() - make kfree_skb() static inline, as Jakub suggested Changes since v1: - rename some drop reason, as David suggested - add the third patch ==================== Link: https://lore.kernel.org/r/20220109063628.526990-1-imagedong@tencent.com Signed-off-by: Jakub Kicinski commit 1c7fab70df085d866a3765955f397ca2b4025b15 Author: Menglong Dong Date: Sun Jan 9 14:36:28 2022 +0800 net: skb: use kfree_skb_reason() in __udp4_lib_rcv() Replace kfree_skb() with kfree_skb_reason() in __udp4_lib_rcv. New drop reason 'SKB_DROP_REASON_UDP_CSUM' is added for udp csum error. Signed-off-by: Menglong Dong Signed-off-by: Jakub Kicinski commit 85125597419aec3aa7b8f3b8713e415f997796f2 Author: Menglong Dong Date: Sun Jan 9 14:36:27 2022 +0800 net: skb: use kfree_skb_reason() in tcp_v4_rcv() Replace kfree_skb() with kfree_skb_reason() in tcp_v4_rcv(). Following drop reasons are added: SKB_DROP_REASON_NO_SOCKET SKB_DROP_REASON_PKT_TOO_SMALL SKB_DROP_REASON_TCP_CSUM SKB_DROP_REASON_TCP_FILTER After this patch, 'kfree_skb' event will print message like this: $ TASK-PID CPU# ||||| TIMESTAMP FUNCTION $ | | | ||||| | | -0 [000] ..s1. 36.113438: kfree_skb: skbaddr=(____ptrval____) protocol=2048 location=(____ptrval____) reason: NO_SOCKET The reason of skb drop is printed too. Signed-off-by: Menglong Dong Signed-off-by: Jakub Kicinski commit c504e5c2f9648a1e5c2be01e8c3f59d394192bd3 Author: Menglong Dong Date: Sun Jan 9 14:36:26 2022 +0800 net: skb: introduce kfree_skb_reason() Introduce the interface kfree_skb_reason(), which is able to pass the reason why the skb is dropped to 'kfree_skb' tracepoint. Add the 'reason' field to 'trace_kfree_skb', therefor user can get more detail information about abnormal skb with 'drop_monitor' or eBPF. All drop reasons are defined in the enum 'skb_drop_reason', and they will be print as string in 'kfree_skb' tracepoint in format of 'reason: XXX'. ( Maybe the reasons should be defined in a uapi header file, so that user space can use them? ) Signed-off-by: Menglong Dong Signed-off-by: Jakub Kicinski commit 342402c426902c59491b43d3056a1039e5ca02db Author: Jakub Kicinski Date: Sun Jan 9 13:33:21 2022 -0800 net/mlx5e: Fix build error in fec_set_block_stats() Build bot reports: drivers/net/ethernet/mellanox/mlx5/core/en_stats.c: In function 'fec_set_block_stats': drivers/net/ethernet/mellanox/mlx5/core/en_stats.c:1235:48: error: 'outl' undeclared (first use in this function); did you mean 'out'? 1235 | if (mlx5_core_access_reg(mdev, in, sz, outl, sz, MLX5_REG_PPCNT, 0, 0)) | ^~~~ | out Reported-by: kernel test robot Suggested-by: Leon Romanovsky Signed-off-by: Jakub Kicinski Link: https://lore.kernel.org/r/20220109213321.2292830-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 8a27c4d226b5aa76a5ea22b6b9cd5d232e040a5f Merge: 4ccdcc8ffd955 8c6f36d93449e Author: Jakub Kicinski Date: Sun Jan 9 16:27:26 2022 -0800 Merge branch 'bnxt_en-update-for-net-next' Michael Chan says: ==================== bnxt_en: Update for net-next This series adds better error and debug logging for firmware messages. We now also use the firmware provided timeout value for long running commands instead of capping it to 40 seconds. ==================== Link: https://lore.kernel.org/r/1641772485-10421-1-git-send-email-michael.chan@broadcom.com Signed-off-by: Jakub Kicinski commit 8c6f36d93449e8de7b49a67727e3d09b67c73126 Author: Edwin Peer Date: Sun Jan 9 18:54:45 2022 -0500 bnxt_en: improve firmware timeout messaging While it has always been possible to infer that an HWRM command was abandoned due to an unhealthy firmware status by the shortened timeout reported, this change improves the log messaging to account for this case explicitly. In the interests of further clarity, the firmware status is now also reported in these new messages. v2: Remove inline keyword for hwrm_wait_must_abort() in .c file. Reviewed-by: Andy Gospodarek Signed-off-by: Edwin Peer Signed-off-by: Michael Chan Signed-off-by: Jakub Kicinski commit bce9a0b7900836df223ab638090df0cb8430d9e8 Author: Edwin Peer Date: Sun Jan 9 18:54:44 2022 -0500 bnxt_en: use firmware provided max timeout for messages Some older devices cannot accommodate the 40 seconds timeout cap for long running commands (such as NVRAM commands) due to hardware limitations. Allow these devices to request more time for these long running commands, but print a warning, since the longer timeout may cause the hung task watchdog to trigger. In the case of a firmware update operation, this is preferable to failing outright. v2: Use bp->hwrm_cmd_max_timeout directly without the constants. Fixes: 881d8353b05e ("bnxt_en: Add an upper bound for all firmware command timeouts.") Signed-off-by: Edwin Peer Signed-off-by: Michael Chan Signed-off-by: Jakub Kicinski commit 662c9b22f5b568fe79e69b06f3c926cad965bfd2 Author: Edwin Peer Date: Sun Jan 9 18:54:43 2022 -0500 bnxt_en: improve VF error messages when PF is unavailable The current driver design relies on the PF netdev being open in order to intercept the following HWRM commands from a VF: - HWRM_FUNC_VF_CFG - HWRM_CFA_L2_FILTER_ALLOC - HWRM_PORT_PHY_QCFG (only if FW_CAP_LINK_ADMIN is not supported) If the PF is closed, then VFs are subjected to rather inscrutable error messages in response to any configuration requests involving the above command types. Recent firmware distinguishes this problem case from other errors by returning HWRM_ERR_CODE_PF_UNAVAILABLE. In most cases, the appropriate course of action is still to fail, but this can now be accomplished with the aid of more user informative log messages. For L2 filter allocations that are already asynchronous, an automatic retry seems more appropriate. v2: Delete extra newline. Signed-off-by: Edwin Peer Signed-off-by: Michael Chan Signed-off-by: Jakub Kicinski commit 8fa4219dba8e621aa1e78dfa7eeab10f55acb3c0 Author: Edwin Peer Date: Sun Jan 9 18:54:42 2022 -0500 bnxt_en: add dynamic debug support for HWRM messages Add logging of firmware messages. These can be useful for diagnosing issues in the field, but due to their verbosity are only appropriate at a debug message level. Signed-off-by: Edwin Peer Signed-off-by: Michael Chan Signed-off-by: Jakub Kicinski commit 4ccdcc8ffd955490feec05380223db6a48961eb5 Author: Nathan Chancellor Date: Mon Dec 27 12:17:57 2021 -0700 iwlwifi: mvm: Use div_s64 instead of do_div in iwl_mvm_ftm_rtt_smoothing() When building ARCH=arm allmodconfig: drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c: In function ‘iwl_mvm_ftm_rtt_smoothing’: ./include/asm-generic/div64.h:222:35: error: comparison of distinct pointer types lacks a cast [-Werror] 222 | (void)(((typeof((n)) *)0) == ((uint64_t *)0)); \ | ^~ drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c:1070:9: note: in expansion of macro ‘do_div’ 1070 | do_div(rtt_avg, 100); | ^~~~~~ do_div() has to be used with an unsigned 64-bit integer dividend but rtt_avg is a signed 64-bit integer. div_s64() expects a signed 64-bit integer dividend and signed 32-bit divisor, which fits this scenario, so use that function here to fix the warning. Fixes: 8b0f92549f2c ("iwlwifi: mvm: fix 32-bit build in FTM") Signed-off-by: Nathan Chancellor Link: https://lore.kernel.org/r/20211227191757.2354329-1-nathan@kernel.org Signed-off-by: Jakub Kicinski commit 6f022c2ddbcefaee79502ce5386dfe351d457070 Author: Paul Blakey Date: Thu Jan 6 17:38:04 2022 +0200 net: openvswitch: Fix ct_state nat flags for conns arriving from tc Netfilter conntrack maintains NAT flags per connection indicating whether NAT was configured for the connection. Openvswitch maintains NAT flags on the per packet flow key ct_state field, indicating whether NAT was actually executed on the packet. When a packet misses from tc to ovs the conntrack NAT flags are set. However, NAT was not necessarily executed on the packet because the connection's state might still be in NEW state. As such, openvswitch wrongly assumes that NAT was executed and sets an incorrect flow key NAT flags. Fix this, by flagging to openvswitch which NAT was actually done in act_ct via tc_skb_ext and tc_skb_cb to the openvswitch module, so the packet flow key NAT flags will be correctly set. Fixes: b57dc7c13ea9 ("net/sched: Introduce action ct") Signed-off-by: Paul Blakey Acked-by: Jamal Hadi Salim Link: https://lore.kernel.org/r/20220106153804.26451-1-paulb@nvidia.com Signed-off-by: Jakub Kicinski commit 77bbcb60f734fe25e1d17a7bdc9a4260868efb0f Merge: 9f3248c9dd519 4a80e026981b7 Author: Jakub Kicinski Date: Sun Jan 9 15:59:22 2022 -0800 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. This includes one patch to update ovs and act_ct to use nf_ct_put() instead of nf_conntrack_put(). 1) Add netns_tracker to nfnetlink_log and masquerade, from Eric Dumazet. 2) Remove redundant rcu read-size lock in nf_tables packet path. 3) Replace BUG() by WARN_ON_ONCE() in nft_payload. 4) Consolidate rule verdict tracing. 5) Replace WARN_ON() by WARN_ON_ONCE() in nf_tables core. 6) Make counter support built-in in nf_tables. 7) Add new field to conntrack object to identify locally generated traffic, from Florian Westphal. 8) Prevent NAT from shadowing well-known ports, from Florian Westphal. 9) Merge nf_flow_table_{ipv4,ipv6} into nf_flow_table_inet, also from Florian. 10) Remove redundant pointer in nft_pipapo AVX2 support, from Colin Ian King. 11) Replace opencoded max() in conntrack, from Jiapeng Chong. 12) Update conntrack to use refcount_t API, from Florian Westphal. 13) Move ip_ct_attach indirection into the nf_ct_hook structure. 14) Constify several pointer object in the netfilter codebase, from Florian Westphal. 15) Tree-wide replacement of nf_conntrack_put() by nf_ct_put(), also from Florian. 16) Fix egress splat due to incorrect rcu notation, from Florian. 17) Move stateful fields of connlimit, last, quota, numgen and limit out of the expression data area. 18) Build a blob to represent the ruleset in nf_tables, this is a requirement of the new register tracking infrastructure. 19) Add NFT_REG32_NUM to define the maximum number of 32-bit registers. 20) Add register tracking infrastructure to skip redundant store-to-register operations, this includes support for payload, meta and bitwise expresssions. * git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next: (32 commits) netfilter: nft_meta: cancel register tracking after meta update netfilter: nft_payload: cancel register tracking after payload update netfilter: nft_bitwise: track register operations netfilter: nft_meta: track register operations netfilter: nft_payload: track register operations netfilter: nf_tables: add register tracking infrastructure netfilter: nf_tables: add NFT_REG32_NUM netfilter: nf_tables: add rule blob layout netfilter: nft_limit: move stateful fields out of expression data netfilter: nft_limit: rename stateful structure netfilter: nft_numgen: move stateful fields out of expression data netfilter: nft_quota: move stateful fields out of expression data netfilter: nft_last: move stateful fields out of expression data netfilter: nft_connlimit: move stateful fields out of expression data netfilter: egress: avoid a lockdep splat net: prefer nf_ct_put instead of nf_conntrack_put netfilter: conntrack: avoid useless indirection during conntrack destruction netfilter: make function op structures const netfilter: core: move ip_ct_attach indirection to struct nf_ct_hook netfilter: conntrack: convert to refcount_t api ... ==================== Link: https://lore.kernel.org/r/20220109231640.104123-1-pablo@netfilter.org Signed-off-by: Jakub Kicinski commit 4a80e026981b791da3937470ace84796490c7796 Author: Pablo Neira Ayuso Date: Sun Jan 9 17:11:26 2022 +0100 netfilter: nft_meta: cancel register tracking after meta update The meta expression might mangle the packet metadata, cancel register tracking since any metadata in the registers is stale. Finer grain register tracking cancellation by inspecting the meta type on the register is also possible. Signed-off-by: Pablo Neira Ayuso commit cc003c7ee6094bca65435ca4bdbba8c98a7c859f Author: Pablo Neira Ayuso Date: Sun Jan 9 17:11:25 2022 +0100 netfilter: nft_payload: cancel register tracking after payload update The payload expression might mangle the packet, cancel register tracking since any payload data in the registers is stale. Finer grain register tracking cancellation by inspecting the payload base, offset and length on the register is also possible. Signed-off-by: Pablo Neira Ayuso commit be5650f8f47e8cffbbbcad08b71103685e971f20 Author: Pablo Neira Ayuso Date: Sun Jan 9 17:11:24 2022 +0100 netfilter: nft_bitwise: track register operations Check if the destination register already contains the data that this bitwise expression performs. This allows to skip this redundant operation. If the destination contains a different bitwise operation, cancel the register tracking information. If the destination contains no bitwise operation, update the register tracking information. Update the payload and meta expression to check if this bitwise operation has been already performed on the register. Hence, both the payload/meta and the bitwise expressions are reduced. There is also a special case: If source register != destination register and source register is not updated by a previous bitwise operation, then transfer selector from the source register to the destination register. Signed-off-by: Pablo Neira Ayuso commit 9b17afb2c88bbadcc15b96f0275c426ae3d89a33 Author: Pablo Neira Ayuso Date: Sun Jan 9 17:11:23 2022 +0100 netfilter: nft_meta: track register operations Check if the destination register already contains the data that this meta store expression performs. This allows to skip this redundant operation. If the destination contains a different selector, update the register tracking information. Signed-off-by: Pablo Neira Ayuso commit a7c176bf9f0e916f7544f6a00d898b0c90de1887 Author: Pablo Neira Ayuso Date: Sun Jan 9 17:11:22 2022 +0100 netfilter: nft_payload: track register operations Check if the destination register already contains the data that this payload store expression performs. This allows to skip this redundant operation. If the destination contains a different selector, update the register tracking information. Signed-off-by: Pablo Neira Ayuso commit 12e4ecfa244be2f117ef5304d2d866b65e70bff3 Author: Pablo Neira Ayuso Date: Sun Jan 9 17:11:21 2022 +0100 netfilter: nf_tables: add register tracking infrastructure This patch adds new infrastructure to skip redundant selector store operations on the same register to achieve a performance boost from the packet path. This is particularly noticeable in pure linear rulesets but it also helps in rulesets which are already heaving relying in maps to avoid ruleset linear inspection. The idea is to keep data of the most recurrent store operations on register to reuse them with cmp and lookup expressions. This infrastructure allows for dynamic ruleset updates since the ruleset blob reduction happens from the kernel. Userspace still needs to be updated to maximize register utilization to cooperate to improve register data reuse / reduce number of store on register operations. Signed-off-by: Pablo Neira Ayuso commit 642c8eff5c6099dfde386ca3906fa55dc98f9ade Author: Pablo Neira Ayuso Date: Sun Jan 9 17:11:20 2022 +0100 netfilter: nf_tables: add NFT_REG32_NUM Add a definition including the maximum number of 32-bits registers that are used a scratchpad memory area to store data. Signed-off-by: Pablo Neira Ayuso commit 2c865a8a28a10e9800a3dd07ca339d24563e3d65 Author: Pablo Neira Ayuso Date: Sun Jan 9 17:11:19 2022 +0100 netfilter: nf_tables: add rule blob layout This patch adds a blob layout per chain to represent the ruleset in the packet datapath. size (unsigned long) struct nft_rule_dp struct nft_expr ... struct nft_rule_dp struct nft_expr ... struct nft_rule_dp (is_last=1) The new structure nft_rule_dp represents the rule in a more compact way (smaller memory footprint) compared to the control-plane nft_rule structure. The ruleset blob is a read-only data structure. The first field contains the blob size, then the rules containing expressions. There is a trailing rule which is used by the tracing infrastructure which is equivalent to the NULL rule marker in the previous representation. The blob size field does not include the size of this trailing rule marker. The ruleset blob is generated from the commit path. This patch reuses the infrastructure available since 0cbc06b3faba ("netfilter: nf_tables: remove synchronize_rcu in commit phase") to build the array of rules per chain. Signed-off-by: Pablo Neira Ayuso commit 3b9e2ea6c11bff72ac1d607f6b954e7666b47409 Author: Pablo Neira Ayuso Date: Sun Jan 9 17:11:18 2022 +0100 netfilter: nft_limit: move stateful fields out of expression data In preparation for the rule blob representation. Signed-off-by: Pablo Neira Ayuso commit 369b6cb5d391750fc01ce951c2500281d2975705 Author: Pablo Neira Ayuso Date: Sun Jan 9 17:11:17 2022 +0100 netfilter: nft_limit: rename stateful structure From struct nft_limit to nft_limit_priv. Signed-off-by: Pablo Neira Ayuso commit 567882eb3d441fef2aa42a75a9688a31979d29f5 Author: Pablo Neira Ayuso Date: Sun Jan 9 17:11:16 2022 +0100 netfilter: nft_numgen: move stateful fields out of expression data In preparation for the rule blob representation. Signed-off-by: Pablo Neira Ayuso commit ed0a0c60f0e50fa52853620672af97edde3d3a03 Author: Pablo Neira Ayuso Date: Sun Jan 9 17:11:15 2022 +0100 netfilter: nft_quota: move stateful fields out of expression data In preparation for the rule blob representation. Signed-off-by: Pablo Neira Ayuso commit 33a24de37e814572491bcb35f42c0de74ad67586 Author: Pablo Neira Ayuso Date: Sun Jan 9 17:11:14 2022 +0100 netfilter: nft_last: move stateful fields out of expression data In preparation for the rule blob representation. Signed-off-by: Pablo Neira Ayuso commit 37f319f37d9005693dff085bb72852eeebc803ef Author: Pablo Neira Ayuso Date: Sun Jan 9 17:11:13 2022 +0100 netfilter: nft_connlimit: move stateful fields out of expression data In preparation for the rule blob representation. Signed-off-by: Pablo Neira Ayuso commit 6316136ec6e3dd1c302f7e7289a9ee46ecc610ae Author: Florian Westphal Date: Fri Jan 7 15:46:16 2022 +0100 netfilter: egress: avoid a lockdep splat include/linux/netfilter_netdev.h:97 suspicious rcu_dereference_check() usage! 2 locks held by sd-resolve/1100: 0: ..(rcu_read_lock_bh){1:3}, at: ip_finish_output2 1: ..(rcu_read_lock_bh){1:3}, at: __dev_queue_xmit __dev_queue_xmit+0 .. The helper has two callers, one uses rcu_read_lock, the other rcu_read_lock_bh(). Annotate the dereference to reflect this. Fixes: 42df6e1d221dd ("netfilter: Introduce egress hook") Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 408bdcfce8dfd6902f75fbcd3b99d8b24b506597 Author: Florian Westphal Date: Fri Jan 7 05:03:26 2022 +0100 net: prefer nf_ct_put instead of nf_conntrack_put Its the same as nf_conntrack_put(), but without the need for an indirect call. The downside is a module dependency on nf_conntrack, but all of these already depend on conntrack anyway. Cc: Paul Blakey Cc: dev@openvswitch.org Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 6ae7989c9af0d98ab64196f4f4c6f6499454bd23 Author: Florian Westphal Date: Fri Jan 7 05:03:25 2022 +0100 netfilter: conntrack: avoid useless indirection during conntrack destruction nf_ct_put() results in a usesless indirection: nf_ct_put -> nf_conntrack_put -> nf_conntrack_destroy -> rcu readlock + indirect call of ct_hooks->destroy(). There are two _put helpers: nf_ct_put and nf_conntrack_put. The latter is what should be used in code that MUST NOT cause a linker dependency on the conntrack module (e.g. calls from core network stack). Everyone else should call nf_ct_put() instead. A followup patch will convert a few nf_conntrack_put() calls to nf_ct_put(), in particular from modules that already have a conntrack dependency such as act_ct or even nf_conntrack itself. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 285c8a7a58158cb1805c97ff03875df2ba2ea1fe Author: Florian Westphal Date: Fri Jan 7 05:03:24 2022 +0100 netfilter: make function op structures const No functional changes, these structures should be const. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 3fce16493dc1aa2c9af3d7e7bd360dfe203a3e6a Author: Florian Westphal Date: Fri Jan 7 05:03:23 2022 +0100 netfilter: core: move ip_ct_attach indirection to struct nf_ct_hook ip_ct_attach predates struct nf_ct_hook, we can place it there and remove the exported symbol. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 719774377622bc4025d2a74f551b5dc2158c6c30 Author: Florian Westphal Date: Fri Jan 7 05:03:22 2022 +0100 netfilter: conntrack: convert to refcount_t api Convert nf_conn reference counting from atomic_t to refcount_t based api. refcount_t api provides more runtime sanity checks and will warn on certain constructs, e.g. refcount_inc() on a zero reference count, which usually indicates use-after-free. For this reason template allocation is changed to init the refcount to 1, the subsequenct add operations are removed. Likewise, init_conntrack() is changed to set the initial refcount to 1 instead refcount_inc(). This is safe because the new entry is not (yet) visible to other cpus. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 613a0c67d12f33dcbeec2836f5fe60d05b4c18c0 Author: Jiapeng Chong Date: Sun Dec 26 01:12:41 2021 +0800 netfilter: conntrack: Use max() instead of doing it manually Fix following coccicheck warning: ./include/net/netfilter/nf_conntrack.h:282:16-17: WARNING opportunity for max(). Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Pablo Neira Ayuso commit 9f3248c9dd51912ded87562a892ad947da2eebfa Merge: d5c8725cc913f b9f9dbad0bd1c Author: Jakub Kicinski Date: Sun Jan 9 14:14:08 2022 -0800 Merge tag 'for-net-next-2022-01-07' 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 QCA 0xe0d0 - Fix HCI init sequence on MacBook Air 8,1 and 8,2 - Fix Intel firmware loading on legacy ROM devices * tag 'for-net-next-2022-01-07' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next: Bluetooth: hci_sock: fix endian bug in hci_sock_setsockopt() Bluetooth: L2CAP: uninitialized variables in l2cap_sock_setsockopt() Bluetooth: btqca: sequential validation Bluetooth: btusb: Add support for Foxconn QCA 0xe0d0 Bluetooth: btintel: Fix broken LED quirk for legacy ROM devices Bluetooth: hci_event: Rework hci_inquiry_result_with_rssi_evt Bluetooth: btbcm: disable read tx power for MacBook Air 8,1 and 8,2 Bluetooth: hci_qca: Fix NULL vs IS_ERR_OR_NULL check in qca_serdev_probe Bluetooth: hci_bcm: Check for error irq ==================== Link: https://lore.kernel.org/r/20220107210942.3750887-1-luiz.dentz@gmail.com Signed-off-by: Jakub Kicinski commit f4bb93a82f94a1e23e532f0b4b1859f1f4605968 Merge: 6dc9a23e29061 89d58aebe14a3 Author: Jakub Kicinski Date: Sun Jan 9 14:00:49 2022 -0800 Merge tag 'linux-can-fixes-for-5.16-20220109' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can Marc Kleine-Budde says: ==================== pull-request: can 2022-01-09 The first patch is by Johan Hovold and fixes a mem leak in the error path of the softing_cs driver. The next patch is by me and fixes a set but not used variable warning in the softing driver. Jiasheng Jiang's patch for the xilinx_can driver adds the missing error checking when getting the IRQ. Lad Prabhakar contributes a patch for the rcar_canfd driver to fix a mem leak in the error path. The last patch is by Brian Silverman and properly initializes the send USB messages to avoid spurious CAN error frames. * tag 'linux-can-fixes-for-5.16-20220109' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can: can: gs_usb: gs_can_start_xmit(): zero-initialize hf->{flags,reserved} can: rcar_canfd: rcar_canfd_channel_probe(): make sure we free CAN network device can: xilinx_can: xcan_probe(): check for error irq can: softing: softing_startstop(): fix set but not used variable warning can: softing_cs: softingcs_probe(): fix memleak on registration failure ==================== Link: https://lore.kernel.org/r/20220109134040.1945428-1-mkl@pengutronix.de Signed-off-by: Jakub Kicinski commit b0fd4b1bf995172b9efcee23600d4f69571c321c Author: Jisheng Zhang Date: Thu Dec 2 23:36:41 2021 +0800 riscv: mm: fix wrong phys_ram_base value for RV64 Currently, if 64BIT and !XIP_KERNEL, the phys_ram_base is always 0, no matter the real start of dram reported by memblock is. Fixes: 6d7f91d914bc ("riscv: Get rid of CONFIG_PHYS_RAM_BASE in kernel physical address conversion") Signed-off-by: Jisheng Zhang Reviewed-by: Alexandre Ghiti Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit fbb3485f1f931102d8ba606f1c28123f5b48afa3 Author: Dominik Brodowski Date: Sun Jan 9 10:02:51 2022 +0100 pcmcia: fix setting of kthread task states We need to set TASK_INTERRUPTIBLE before calling kthread_should_stop(). Otherwise, kthread_stop() might see that the pccardd thread is still in TASK_RUNNING state and fail to wake it up. Additionally, we only need to set the state back to TASK_RUNNING if kthread_should_stop() breaks the loop. Cc: Greg Kroah-Hartman Reported-by: Al Viro Reviewed-by: Matthew Wilcox (Oracle) Fixes: d3046ba809ce ("pcmcia: fix a boot time warning in pcmcia cs code") Signed-off-by: Dominik Brodowski commit 869c70609248102f3a2e95a39b6233ff6ea2c932 Author: Sean Christopherson Date: Mon Nov 29 21:43:42 2021 +0000 RISC-V: Use common riscv_cpuid_to_hartid_mask() for both SMP=y and SMP=n Use what is currently the SMP=y version of riscv_cpuid_to_hartid_mask() for both SMP=y and SMP=n to fix a build failure with KVM=m and SMP=n due to boot_cpu_hartid not being exported. This also fixes a second bug where the SMP=n version assumes the sole CPU in the system is in the incoming mask, which may not hold true in kvm_riscv_vcpu_sbi_ecall() if the KVM guest VM has multiple vCPUs (on a SMP=n system). Fixes: 1ef46c231df4 ("RISC-V: Implement new SBI v0.2 extensions") Reported-by: Adam Borowski Reviewed-by: Anup Patel Signed-off-by: Sean Christopherson Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit 51f23e5318a0882068254e20d3999e9421cfd66e Author: Jisheng Zhang Date: Mon Nov 29 00:07:41 2021 +0800 riscv: head: remove useless __PAGE_ALIGNED_BSS and .balign After commit 83e7b8769a08 ("RISC-V: move empty_zero_page definition to C and export it"), the empty_zero_page has been moved outside head.S, the __PAGE_ALIGNED_BSS and .balign LoCs are useless, clean up them. Signed-off-by: Jisheng Zhang Signed-off-by: Palmer Dabbelt commit 1546541fbc90b0dcadcdadf1c828daf0a8f9d88d Author: Jisheng Zhang Date: Mon Nov 29 00:07:40 2021 +0800 riscv: errata: alternative: mark vendor_patch_func __initdata The function pointer vendor_patch_func is only used during init, so mark it as __initdata. Signed-off-by: Jisheng Zhang Signed-off-by: Palmer Dabbelt commit 153c46faf6ae4961451bed2878ff9e93736efe50 Author: Jisheng Zhang Date: Mon Nov 29 00:07:38 2021 +0800 riscv: head: make secondary_start_common() static There are no users outside head.S so make secondary_start_common() static. Signed-off-by: Jisheng Zhang Signed-off-by: Palmer Dabbelt commit 7f3de1adb377960bc061b1d7ee477527d499d2bd Author: Jisheng Zhang Date: Mon Nov 29 00:07:37 2021 +0800 riscv: remove cpu_stop() Except arch_cpu_idle_dead(), no users of this function. So remove cpu_stop() and fold its code into arch_cpu_idle_dead(). Signed-off-by: Jisheng Zhang Signed-off-by: Palmer Dabbelt commit decf89f86ecd3c3c3de81c562010d5797bea3de1 Author: Nick Kossifidis Date: Fri Nov 26 20:04:11 2021 +0200 riscv: try to allocate crashkern region from 32bit addressible memory When allocating crash kernel region without explicitly specifying its base address/size, memblock_phys_alloc_range will attempt to allocate memory top to bottom (memblock.bottom_up is false), so the crash kernel region will end up in highmem on 64bit systems. This way swiotlb can't work on the crash kernel, since there won't be any 32bit addressible memory available for the bounce buffers. Try to allocate 32bit addressible memory if available, for the crash kernel by restricting the top search address to be less than SZ_4G. If that fails fallback to the previous behavior. I tested this on HiFive Unmatched where the pci-e controller needs swiotlb to work, with this patch it's possible to access the pci-e controller on crash kernel and mount the rootfs from the nvme. Signed-off-by: Nick Kossifidis Fixes: e53d28180d4d ("RISC-V: Add kdump support") Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit 0e105f1d0037d677dff3c697d22f9551e6c39af8 Author: Nick Kossifidis Date: Fri Nov 26 20:04:10 2021 +0200 riscv: use hart id instead of cpu id on machine_kexec raw_smp_processor_id() doesn't return the hart id as stated in arch/riscv/include/asm/smp.h, use smp_processor_id() instead to get the cpu id, and cpuid_to_hartid_map() to pass the hart id to the next kernel. This fixes kexec on HiFive Unleashed/Unmatched where cpu ids and hart ids don't match (on qemu-virt they match). Fixes: fba8a8674f68 ("RISC-V: Add kexec support") Signed-off-by: Nick Kossifidis Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit a11c07f032a0e9a562a32ece73af96b0e754c4b3 Author: Nick Kossifidis Date: Fri Nov 26 20:04:09 2021 +0200 riscv: Don't use va_pa_offset on kdump On kdump instead of using an intermediate step to relocate the kernel, that lives in a "control buffer" outside the current kernel's mapping, we jump to the crash kernel directly by calling riscv_kexec_norelocate(). The current implementation uses va_pa_offset while switching to physical addressing, however since we moved the kernel outside the linear mapping this won't work anymore since riscv_kexec_norelocate() is part of the kernel mapping and we should use kernel_map.va_kernel_pa_offset, and also take XIP kernel into account. We don't really need to use va_pa_offset on riscv_kexec_norelocate, we can just set STVEC to the physical address of the new kernel instead and let the hart jump to the new kernel on the next instruction after setting SATP to zero. This fixes kdump and is also simpler/cleaner. I tested this on the latest qemu and HiFive Unmatched and works as expected. Fixes: 2bfc6cd81bd1 ("riscv: Move kernel mapping outside of linear mapping") Signed-off-by: Nick Kossifidis Reviewed-by: Alexandre Ghiti Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt commit 0ea9fc15b1d7d6636d429e74ffe3f86bf2f2f7d6 Author: Arnd Bergmann Date: Tue Nov 23 17:05:07 2021 +0100 fs/locks: fix fcntl_getlk64/fcntl_setlk64 stub prototypes My patch to rework oabi fcntl64() introduced a harmless sparse warning when file locking is disabled: arch/arm/kernel/sys_oabi-compat.c:251:51: sparse: sparse: incorrect type in argument 3 (different address spaces) @@ expected struct flock64 [noderef] __user *user @@ got struct flock64 * @@ arch/arm/kernel/sys_oabi-compat.c:251:51: sparse: expected struct flock64 [noderef] __user *user arch/arm/kernel/sys_oabi-compat.c:251:51: sparse: got struct flock64 * arch/arm/kernel/sys_oabi-compat.c:265:55: sparse: sparse: incorrect type in argument 4 (different address spaces) @@ expected struct flock64 [noderef] __user *user @@ got struct flock64 * @@ arch/arm/kernel/sys_oabi-compat.c:265:55: sparse: expected struct flock64 [noderef] __user *user arch/arm/kernel/sys_oabi-compat.c:265:55: sparse: got struct flock64 * When file locking is enabled, everything works correctly and the right data gets passed, but the stub declarations in linux/fs.h did not get modified when the calling conventions changed in an earlier patch. Reported-by: kernel test robot Fixes: 7e2d8c29ecdd ("ARM: 9111/1: oabi-compat: rework fcntl64() emulation") Fixes: a75d30c77207 ("fs/locks: pass kernel struct flock to fcntl_getlk/setlk") Cc: Christoph Hellwig Reviewed-by: Christoph Hellwig Acked-by: Christian Brauner Signed-off-by: Arnd Bergmann Signed-off-by: Jeff Layton Signed-off-by: Chuck Lever commit 893eae9ac7e4c23c70874c3981fdcf3311655874 Author: Geert Uytterhoeven Date: Fri Dec 17 13:49:32 2021 +0100 riscv: dts: sifive: fu540-c000: Fix PLIC node Fix the device node for the Platform-Level Interrupt Controller (PLIC): - Add missing "#address-cells" property, - Sort properties according to DT bindings. Signed-off-by: Geert Uytterhoeven Signed-off-by: Palmer Dabbelt commit 8fc6e62a549c61abd594e8435017a31cfca43475 Author: Geert Uytterhoeven Date: Fri Dec 17 13:49:31 2021 +0100 riscv: dts: sifive: fu540-c000: Drop bogus soc node compatible values "make dtbs_check": arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dt.yaml: soc: $nodename:0: '/' was expected From schema: Documentation/devicetree/bindings/riscv/sifive.yaml arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dt.yaml: soc: compatible: 'oneOf' conditional failed, one must be fixed: 'sifive,fu540-c000' is not one of ['sifive,hifive-unleashed-a00'] 'sifive,fu540-c000' is not one of ['sifive,hifive-unmatched-a00'] 'sifive,fu540-c000' was expected 'sifive,fu740-c000' was expected 'sifive,fu540' was expected 'sifive,fu740' was expected From schema: Documentation/devicetree/bindings/riscv/sifive.yaml This happens because the "soc" subnode declares compatibility with "sifive,fu540-c000" and "sifive,fu540", while these are only intended for the root node. Fix this by removing the bogus compatible values from the "soc" node. Signed-off-by: Geert Uytterhoeven Reviewed-by: Krzysztof Kozlowski Signed-off-by: Palmer Dabbelt commit 8e9b1c9555c1128bcda473383ae9ba3742b59fa8 Author: Geert Uytterhoeven Date: Fri Dec 17 13:49:30 2021 +0100 riscv: dts: sifive: Group tuples in register properties To improve human readability and enable automatic validation, the tuples in "reg" properties containing register blocks should be grouped using angle brackets. Signed-off-by: Geert Uytterhoeven Reviewed-by: Krzysztof Kozlowski Signed-off-by: Palmer Dabbelt commit cc79be0e0c9f9e529641b286af54dc5ed26d9407 Author: Geert Uytterhoeven Date: Fri Dec 17 13:49:29 2021 +0100 riscv: dts: sifive: Group tuples in interrupt properties To improve human readability and enable automatic validation, the tuples in the various properties containing interrupt specifiers should be grouped. Fix this by grouping the tuples of "interrupts" and "interrupts-extended" properties using angle brackets. Signed-off-by: Geert Uytterhoeven Reviewed-by: Krzysztof Kozlowski Signed-off-by: Palmer Dabbelt commit e35b07a7df9b8accce88d30a4cfa9000c34e6cf3 Author: Geert Uytterhoeven Date: Fri Dec 17 13:49:28 2021 +0100 riscv: dts: microchip: mpfs: Group tuples in interrupt properties To improve human readability and enable automatic validation, the tuples in the various properties containing interrupt specifiers should be grouped. Fix this by grouping the tuples of "interrupts" and "interrupts-extended" properties using angle brackets. Signed-off-by: Geert Uytterhoeven Reviewed-by: Krzysztof Kozlowski Reviewed-by: Conor Dooley Tested-by: Conor Dooley Signed-off-by: Palmer Dabbelt commit 9e85020ccf8c83b89867cd69f54b3ac4a9cf7580 Author: Geert Uytterhoeven Date: Fri Dec 17 13:49:27 2021 +0100 riscv: dts: microchip: mpfs: Fix clock controller node Fix the device node for the clock controller: - Remove bogus "reg-names" property, - Remove unneeded "clock-output-names" property. Signed-off-by: Geert Uytterhoeven Reviewed-by: Conor Dooley Tested-by: Conor Dooley Signed-off-by: Palmer Dabbelt commit 9d7b3078628f591e4007210c0d5d3f94805cff55 Author: Geert Uytterhoeven Date: Fri Dec 17 13:49:26 2021 +0100 riscv: dts: microchip: mpfs: Fix reference clock node "make dtbs_check" reports: arch/riscv/boot/dts/microchip/microchip-mpfs-icicle-kit.dt.yaml: soc: refclk: {'compatible': ['fixed-clock'], '#clock-cells': [[0]], 'clock-frequency': [[600000000]], 'clock-output-names': ['msspllclk'], 'phandle': [[7]]} should not be valid under {'type': 'object'} From schema: dtschema/schemas/simple-bus.yaml Fix this by moving the node out of the "soc" subnode. While at it, rename it to "msspllclk", and drop the now superfluous "clock-output-names" property. Move the actual clock-frequency value to the board DTS, since it is not set until bitstream programming time. Signed-off-by: Geert Uytterhoeven Acked-by: Krzysztof Kozlowski Reviewed-by: Conor Dooley Tested-by: Conor Dooley Signed-off-by: Palmer Dabbelt commit 53abf98005a6bcabb4ddeff642ba36cd1cf4184a Author: Geert Uytterhoeven Date: Fri Dec 17 13:49:25 2021 +0100 riscv: dts: microchip: mpfs: Fix PLIC node Fix the device node for the Platform-Level Interrupt Controller (PLIC): - Add missing "#address-cells" property, - Sort properties according to DT bindings. Signed-off-by: Geert Uytterhoeven Reviewed-by: Krzysztof Kozlowski Reviewed-by: Conor Dooley Tested-by: Conor Dooley Signed-off-by: Palmer Dabbelt commit 53ef07326ad0d6ae7fefded22bc53b427d542761 Author: Geert Uytterhoeven Date: Fri Dec 17 13:49:24 2021 +0100 riscv: dts: microchip: mpfs: Drop empty chosen node It does not make sense to have an (empty) chosen node in an SoC-specific .dtsi, as chosen is meant for system-specific configuration. It is already provided in microchip-mpfs-icicle-kit.dts anyway. Fixes: 0fa6107eca4186ad ("RISC-V: Initial DTS for Microchip ICICLE board") Signed-off-by: Geert Uytterhoeven Reviewed-by: Conor Dooley Tested-by: Conor Dooley Reviewed-by: Krzysztof Kozlowski Signed-off-by: Palmer Dabbelt commit 75c0dc0437e69fd87e9f4563216978532ec6609d Author: Geert Uytterhoeven Date: Fri Dec 17 13:49:23 2021 +0100 riscv: dts: canaan: Group tuples in interrupt properties To improve human readability and enable automatic validation, the tuples in the various properties containing interrupt specifiers should be grouped. Fix this by grouping the tuples of "interrupts" and "interrupts-extended" properties using angle brackets. Signed-off-by: Geert Uytterhoeven Reviewed-by: Damien Le Moal Reviewed-by: Krzysztof Kozlowski Tested-by: Damien Le Moal Signed-off-by: Palmer Dabbelt commit fe38b4d6129ce0cbe2a1d1d91d4160acbacbb37b Author: Geert Uytterhoeven Date: Fri Dec 17 13:49:22 2021 +0100 riscv: dts: canaan: Fix SPI FLASH node names "make dtbs_check": arch/riscv/boot/dts/canaan/sipeed_maix_bit.dt.yaml: spi-flash@0: $nodename:0: 'spi-flash@0' does not match '^flash(@.*)?$' From schema: Documentation/devicetree/bindings/mtd/jedec,spi-nor.yaml Fix this by renaming all SPI FLASH nodes to "flash". Signed-off-by: Geert Uytterhoeven Reviewed-by: Damien Le Moal Reviewed-by: Krzysztof Kozlowski Tested-by: Damien Le Moal Signed-off-by: Palmer Dabbelt commit 292c33c95defd0b814fec1fc8cd60d16556cf7b8 Author: Yang Li Date: Fri Jan 7 08:52:28 2022 +0800 block: fix old-style declaration Move the 'inline' keyword to the front of 'void'. Remove a warning found by clang(make W=1 LLVM=1) ./include/linux/blk-mq.h:259:1: warning: ‘inline’ is not at beginning of declaration Reported-by: Abaci Robot Signed-off-by: Yang Li Link: https://lore.kernel.org/r/20220107005228.103927-1-yang.lee@linux.alibaba.com Signed-off-by: Jens Axboe commit d5c8725cc913f1ab8e2f10a4eda2930bfdc03f1f Merge: 82192cb497f9e bc3897f79f790 Author: David S. Miller Date: Sun Jan 9 16:57:50 2022 +0000 Merge tag 'linux-can-next-for-5.17-20220108' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next Marc Kleine-Budde says: ==================== pull-request: can-next 2022-01-08 this is a pull request of 22 patches for net-next/master. The first patch is by Tom Rix and fixes an uninitialized variable in the janz-ican3 driver (introduced in linux-can-next-for-5.17-20220105). The next 13 patches are by my and target the mcp251xfd driver. First several cleanup patches, then the driver is prepared for the upcoming ethtool ring parameter and IRQ coalescing support, which is added in a later pull request. The remaining 8 patches are by Dario Binacchi and me and enhance the flexcan driver. The driver is moved into a sub directory. An ethtool private flag is added to optionally disable CAN RTR frame reception, to make use of more RX buffers. The resulting RX buffer configuration can be read by ethtool ring parameter support. Finally documentation for the ethtool private flag is added to the Documentation/networking/device_drivers/can directory. ==================== Signed-off-by: David S. Miller commit 3cc7fdb9f90a25ae92250bf9e6cf3b9556b230e9 Author: Pavel Begunkov Date: Sun Jan 9 00:53:22 2022 +0000 io_uring: fix not released cached task refs tctx_task_work() may get run after io_uring cancellation and so there will be no one to put cached in tctx task refs that may have been added back by tw handlers using inline completion infra, Call io_uring_drop_tctx_refs() at the end of the main tw handler to release them. Cc: stable@vger.kernel.org # 5.15+ Reported-by: Lukas Bulwahn Fixes: e98e49b2bbf7 ("io_uring: extend task put optimisations") Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/69f226b35fbdb996ab799a8bbc1c06bf634ccec1.1641688805.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit c5c7440fe7f74645940d5c9e2c49cd7efb706a4f Author: Paul Cercueil Date: Fri Jan 7 18:57:22 2022 +0000 MIPS: compressed: Fix build with ZSTD compression Fix the following build issues: mips64el-linux-ld: arch/mips/boot/compressed/decompress.o: in function `FSE_buildDTable_internal': decompress.c:(.text.FSE_buildDTable_internal+0x2cc): undefined reference to `__clzdi2' mips64el-linux-ld: arch/mips/boot/compressed/decompress.o: in function `BIT_initDStream': decompress.c:(.text.BIT_initDStream+0x7c): undefined reference to `__clzdi2' mips64el-linux-ld: decompress.c:(.text.BIT_initDStream+0x158): undefined reference to `__clzdi2' mips64el-linux-ld: arch/mips/boot/compressed/decompress.o: in function `ZSTD_buildFSETable_body_default.constprop.0': decompress.c:(.text.ZSTD_buildFSETable_body_default.constprop.0+0x2a8): undefined reference to `__clzdi2' mips64el-linux-ld: arch/mips/boot/compressed/decompress.o: in function `FSE_readNCount_body_default': decompress.c:(.text.FSE_readNCount_body_default+0x130): undefined reference to `__ctzdi2' mips64el-linux-ld: decompress.c:(.text.FSE_readNCount_body_default+0x1a4): undefined reference to `__ctzdi2' mips64el-linux-ld: decompress.c:(.text.FSE_readNCount_body_default+0x2e4): undefined reference to `__clzdi2' mips64el-linux-ld: arch/mips/boot/compressed/decompress.o: in function `HUF_readStats_body_default': decompress.c:(.text.HUF_readStats_body_default+0x184): undefined reference to `__clzdi2' mips64el-linux-ld: decompress.c:(.text.HUF_readStats_body_default+0x1b4): undefined reference to `__clzdi2' mips64el-linux-ld: arch/mips/boot/compressed/decompress.o: in function `ZSTD_DCtx_getParameter': decompress.c:(.text.ZSTD_DCtx_getParameter+0x60): undefined reference to `__clzdi2' Fixes: a510b616131f ("MIPS: Add support for ZSTD-compressed kernels") Reported-by: kernel test robot Reported-by: Nick Terrell Signed-off-by: Paul Cercueil Signed-off-by: Thomas Bogendoerfer commit 4da27b6d550427a0560a15df36de99cb17629216 Author: Florian Fainelli Date: Thu Jan 6 19:51:41 2022 -0800 MIPS: BCM47XX: Add support for Netgear WN2500RP v1 & v2 Add support for the Netgear WN2500 RP v1 and v2 Wi-Fi range extenders based on the BCM5357 chipset and supporting 802.11n and 802.11ac. Signed-off-by: Florian Fainelli Signed-off-by: Thomas Bogendoerfer commit 15e690af5cc3cd8f5d14ee2aa3a093f80196110e Author: Florian Fainelli Date: Thu Jan 6 19:51:40 2022 -0800 MIPS: BCM47XX: Add support for Netgear R6300 v1 Add support for the Netgear R6300 v1 Wi-Fi router using a Broadcom BCM4706 chipset and supporting 802.11n and 802.11ac. Signed-off-by: Florian Fainelli Signed-off-by: Thomas Bogendoerfer commit aecf89f2f8e8a604c33085c230a1f04ea325de64 Author: Florian Fainelli Date: Thu Jan 6 19:51:39 2022 -0800 MIPS: BCM47XX: Add LEDs and buttons for Asus RTN-10U Add the definitions for the buttons and LEDs used on the Asus RTN-10U router. Signed-off-by: Florian Fainelli Signed-off-by: Thomas Bogendoerfer commit 3829e4f10a232964cc728c0479c8097922e5e073 Author: Florian Fainelli Date: Thu Jan 6 19:51:38 2022 -0800 MIPS: BCM47XX: Add board entry for Linksys WRT320N v1 This router is based on a Broadcom BCM4717A1 chipset and supports 802.11n Wi-Fi. Add a board entry for that router and register LEDs and buttons accordingly. Signed-off-by: Florian Fainelli Signed-off-by: Thomas Bogendoerfer commit eea175eedf3e2f71b9538d21e643e7a1be4923df Author: Florian Fainelli Date: Thu Jan 6 19:51:37 2022 -0800 MIPS: BCM47XX: Define Linksys WRT310N V2 buttons Update the buttons registration code to register the two buttons (WPS, system rester) using the existing BCM47XX_BOARD_LINKSYS_WRT310NV2 board entry. Signed-off-by: Florian Fainelli Signed-off-by: Thomas Bogendoerfer commit f1da418b0c418d8c73b6314ea4e7391720dafe4f Author: Yang Li Date: Fri Jan 7 08:31:28 2022 +0800 MIPS: Remove duplicated include in local.h Fix following includecheck warning: ./arch/mips/include/asm/local.h: asm/asm.h is included more than once. Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Thomas Bogendoerfer commit 89d58aebe14a365c25ba6645414afdbf4e41cea4 Author: Brian Silverman Date: Wed Jan 5 16:29:50 2022 -0800 can: gs_usb: gs_can_start_xmit(): zero-initialize hf->{flags,reserved} No information is deliberately sent in hf->flags in host -> device communications, but the open-source candleLight firmware echoes it back, which can result in the GS_CAN_FLAG_OVERFLOW flag being set and generating spurious ERRORFRAMEs. While there also initialize the reserved member with 0. Fixes: d08e973a77d1 ("can: gs_usb: Added support for the GS_USB CAN devices") Link: https://lore.kernel.org/all/20220106002952.25883-1-brian.silverman@bluerivertech.com Link: https://github.com/candle-usb/candleLight_fw/issues/87 Cc: stable@vger.kernel.org Signed-off-by: Brian Silverman [mkl: initialize the reserved member, too] Signed-off-by: Marc Kleine-Budde commit 72b1e360572f9fa7d08ee554f1da29abce23f288 Author: Lad Prabhakar Date: Thu Jan 6 11:48:00 2022 +0000 can: rcar_canfd: rcar_canfd_channel_probe(): make sure we free CAN network device Make sure we free CAN network device in the error path. There are several jumps to fail label after allocating the CAN network device successfully. This patch places the free_candev() under fail label so that in failure path a jump to fail label frees the CAN network device. Fixes: 76e9353a80e9 ("can: rcar_canfd: Add support for RZ/G2L family") Link: https://lore.kernel.org/all/20220106114801.20563-1-prabhakar.mahadev-lad.rj@bp.renesas.com Reported-by: Pavel Machek Signed-off-by: Lad Prabhakar Reviewed-by: Kieran Bingham Signed-off-by: Marc Kleine-Budde commit c6564c13dae25cd7f8e1de5127b4da4500ee5844 Author: Jiasheng Jiang Date: Fri Dec 24 10:13:24 2021 +0800 can: xilinx_can: xcan_probe(): check for error irq For the possible failure of the platform_get_irq(), the returned irq could be error number and will finally cause the failure of the request_irq(). Consider that platform_get_irq() can now in certain cases return -EPROBE_DEFER, and the consequences of letting request_irq() effectively convert that into -EINVAL, even at probe time rather than later on. So it might be better to check just now. Fixes: b1201e44f50b ("can: xilinx CAN controller support") Link: https://lore.kernel.org/all/20211224021324.1447494-1-jiasheng@iscas.ac.cn Signed-off-by: Jiasheng Jiang Signed-off-by: Marc Kleine-Budde commit 370d988cc529598ebaec6487d4f84c2115dc696b Author: Marc Kleine-Budde Date: Sat Jan 8 21:57:51 2022 +0100 can: softing: softing_startstop(): fix set but not used variable warning In the function softing_startstop() the variable error_reporting is assigned but not used. The code that uses this variable is commented out. Its stated that the functionality is not finally verified. To fix the warning: | drivers/net/can/softing/softing_fw.c:424:9: error: variable 'error_reporting' set but not used [-Werror,-Wunused-but-set-variable] remove the comment, activate the code, but add a "0 &&" to the if expression and rely on the optimizer rather than the preprocessor to remove the code. Link: https://lore.kernel.org/all/20220109103126.1872833-1-mkl@pengutronix.de Fixes: 03fd3cf5a179 ("can: add driver for Softing card") Cc: Kurt Van Dijck Signed-off-by: Marc Kleine-Budde commit 2e88c6a805fc5311e27e0f6efe243842634052ab Author: Takashi Iwai Date: Sun Jan 9 09:13:37 2022 +0100 ALSA: hda: Fix dependencies of CS35L41 on SPI/I2C buses CS35L41 SPI and I2C drivers depend on those buses, hence they have to have dependencies in Kconfig; otherwise it may result in missing symbols. Fixes: 7b2f3eb492da ("ALSA: hda: cs35l41: Add support for CS35L41 in HDA systems") Reported-by: kernel test robot Link: https://lore.kernel.org/r/20220109081337.30623-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 9df136b555221e8eb3f4e5d3958d8fe11783abcf Author: Nikita Travkin Date: Sat Jan 8 23:23:49 2022 -0800 Input: zinitix - add compatible for bt532 Zinitix BT532 is another touch controller that seem to implement the same interface as an already supported BT541. Add it to the driver. Reviewed-by: Linus Walleij Signed-off-by: Nikita Travkin Link: https://lore.kernel.org/r/20220106072840.36851-5-nikita@trvn.ru Signed-off-by: Dmitry Torokhov commit c54be0e32e54abdf7b89d56fe9edebc2f319acee Author: Linus Walleij Date: Sat Jan 8 23:23:10 2022 -0800 Input: zinitix - handle proper supply names The supply names of the Zinitix touchscreen were a bit confused, the new bindings rectifies this. To deal with old and new devicetrees, first check if we have "vddo" and in case that exists assume the old supply names. Else go and look for the new ones. We cannot just get the regulators since we would get an OK and a dummy regulator: we need to check explicitly for the old supply name. Use struct device *dev as a local variable instead of the I2C client since the device is what we are actually obtaining the resources from. Signed-off-by: Linus Walleij [Slightly changed the legacy regulator detection] Signed-off-by: Nikita Travkin Link: https://lore.kernel.org/r/20220106072840.36851-4-nikita@trvn.ru Signed-off-by: Dmitry Torokhov commit fdbb8025263246d770b802567757871db7a05913 Author: Linus Walleij Date: Sat Jan 8 23:21:55 2022 -0800 dt-bindings: input/ts/zinitix: Convert to YAML, fix and extend This converts the Zinitix BT4xx and BT5xx touchscreen bindings to YAML, fix them up a bit and extends them. We list all the existing BT4xx and BT5xx components with compatible strings. These are all similar, use the same bindings and work in similar ways. We rename the supplies from the erroneous vdd/vddo to the actual supply names vcca/vdd as specified on the actual component. It is long established that supplies shall be named after the supply pin names of a component. The confusion probably stems from that in a certain product the rails to the component were named vdd/vddo. Drop some notes on how OS implementations should avoid confusion by first looking for vddo, and if that exists assume the legacy binding pair and otherwise use vcca/vdd. Add reset-gpios as sometimes manufacturers pulls a GPIO line to the reset line on the chip. Add optional touchscreen-fuzz-x and touchscreen-fuzz-y properties. Reviewed-by: Rob Herring Signed-off-by: Linus Walleij [Fixed dt_schema_check] Signed-off-by: Nikita Travkin Link: https://lore.kernel.org/r/20220106072840.36851-3-nikita@trvn.ru Signed-off-by: Dmitry Torokhov commit 8a78050ee257c8d4292ea8a6b52bb9c894306b9b Author: Hans de Goede Date: Sat Jan 8 23:09:20 2022 -0800 Input: axp20x-pek - revert "always register interrupt handlers" change The power button on Cherry Trail systems with an AXP288 PMIC is connected to both the power button pin of the PMIC as well as to a power button GPIO on the Cherry Trail SoC itself. This leads to double power button event reporting which is a problem. Since reporting power button presses through the PMIC is not supported on all PMICs used on Cherry Trail systems, we want to keep the GPIO power button events, so the axp20x-pek code checks for the presence of a GPIO power button and in that case does not register its input-device. On most systems the GPIO power button also can wake-up the system from suspend, so the axp20x-pek driver would also not register its interrupt handler. But on some systems there was a bug causing wakeup by the GPIO power button handler to not work. Commit 9747070c11d6 ("Input: axp20x-pek - always register interrupt handlers") was added as a work around for this registering the axp20x-pek interrupts, but not the input-device on Cherry Trail systems. In the mean time the root-cause of the GPIO power button wakeup events not working has been found and fixed by the "pinctrl: cherryview: Do not allow the same interrupt line to be used by 2 pins" patch, so this is no longer necessary. This reverts the workaround going back to only registering the interrupt handlers on systems where we also register the input-device. Signed-off-by: Hans de Goede Acked-by: Chen-Yu Tsai Link: https://lore.kernel.org/r/20220106111647.66520-1-hdegoede@redhat.com Signed-off-by: Dmitry Torokhov commit d99a8af48a3de727173415ccb17f6b6ba60d5573 Author: Colin Ian King Date: Thu Dec 30 13:45:57 2021 +0000 lib: remove redundant assignment to variable ret Variable ret is being assigned a value that is never read. If the for-loop is entered then ret is immediately re-assigned a new value. If the for-loop is not executed ret is never read. The assignment is redundant and can be removed. Signed-off-by: Colin Ian King Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit 84cc69589700b90a4c8d27b481a51fce8cca6051 Author: Patrick Williams Date: Thu Dec 23 09:49:31 2021 -0600 tpm: fix NPE on probe for missing device When using the tpm_tis-spi driver on a system missing the physical TPM, a null pointer exception was observed. [ 0.938677] Unable to handle kernel NULL pointer dereference at virtual address 00000004 [ 0.939020] pgd = 10c753cb [ 0.939237] [00000004] *pgd=00000000 [ 0.939808] Internal error: Oops: 5 [#1] SMP ARM [ 0.940157] CPU: 0 PID: 48 Comm: kworker/u4:1 Not tainted 5.15.10-dd1e40c #1 [ 0.940364] Hardware name: Generic DT based system [ 0.940601] Workqueue: events_unbound async_run_entry_fn [ 0.941048] PC is at tpm_tis_remove+0x28/0xb4 [ 0.941196] LR is at tpm_tis_core_init+0x170/0x6ac This is due to an attempt in 'tpm_tis_remove' to use the drvdata, which was not initialized in 'tpm_tis_core_init' prior to the first error. Move the initialization of drvdata earlier so 'tpm_tis_remove' has access to it. Signed-off-by: Patrick Williams Fixes: 79ca6f74dae0 ("tpm: fix Atmel TPM crash caused by too frequent queries") Cc: stable@vger.kernel.org Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit eabad7ba2c752392ae50f24a795093fb115b686d Author: Lino Sanfilippo Date: Mon Dec 20 16:06:35 2021 +0100 tpm: fix potential NULL pointer access in tpm_del_char_device Some SPI controller drivers unregister the controller in the shutdown handler (e.g. BCM2835). If such a controller is used with a TPM 2 slave chip->ops may be accessed when it is already NULL: At system shutdown the pre-shutdown handler tpm_class_shutdown() shuts down TPM 2 and sets chip->ops to NULL. Then at SPI controller unregistration tpm_tis_spi_remove() is called and eventually calls tpm_del_char_device() which tries to shut down TPM 2 again. Thereby it accesses chip->ops again: (tpm_del_char_device calls tpm_chip_start which calls tpm_clk_enable which calls chip->ops->clk_enable). Avoid the NULL pointer access by testing if chip->ops is valid and skipping the TPM 2 shutdown procedure in case it is NULL. Cc: stable@vger.kernel.org Signed-off-by: Lino Sanfilippo Fixes: 39d0099f9439 ("powerpc/pseries: Add shutdown() to vio_driver and vio_bus") Reviewed-by: Stefan Berger Tested-by: Stefan Berger Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit 0aa698787aa2a9e8840987e54ba2982559de6404 Author: axelj Date: Mon Dec 13 08:09:25 2021 +0100 tpm: Add Upgrade/Reduced mode support for TPM2 modules If something went wrong during the TPM firmware upgrade, like power failure or the firmware image file get corrupted, the TPM might end up in Upgrade or Failure mode upon the next start. The state is persistent between the TPM power cycle/restart. According to TPM specification: * If the TPM is in Upgrade mode, it will answer with TPM2_RC_UPGRADE to all commands except TPM2_FieldUpgradeData(). It may also accept other commands if it is able to complete them using the previously installed firmware. * If the TPM is in Failure mode, it will allow performing TPM initialization but will not provide any crypto operations. Will happily respond to Field Upgrade calls. Change the behavior of the tpm2_auto_startup(), so it detects the active running mode of the TPM by adding the following checks. If tpm2_do_selftest() call returns TPM2_RC_UPGRADE, the TPM is in Upgrade mode. If the TPM is in Failure mode, it will successfully respond to both tpm2_do_selftest() and tpm2_startup() calls. Although, will fail to answer to tpm2_get_cc_attrs_tbl(). Use this fact to conclude that TPM is in Failure mode. If detected that the TPM is in the Upgrade or Failure mode, the function sets TPM_CHIP_FLAG_FIRMWARE_UPGRADE_MODE flag. The TPM_CHIP_FLAG_FIRMWARE_UPGRADE_MODE flag is used later during driver initialization/deinitialization to disable functionality which makes no sense or will fail in the current TPM state. Following functionality is affected: * Do not register TPM as a hwrng * Do not register sysfs entries which provide information impossible to obtain in limited mode * Do not register resource managed character device Signed-off-by: axelj Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit 5887d7f4a8c4310a75ca45f576f26b3d21250881 Author: Rob Barnes Date: Mon Dec 6 12:03:09 2021 +0000 char: tpm: cr50: Set TPM_FIRMWARE_POWER_MANAGED based on device property Set TPM_FIRMWARE_POWER_MANAGED flag based on 'firmware-power-managed' ACPI DSD property. For the CR50 TPM, this flag defaults to true when the property is unset. When this flag is set to false, the CR50 TPM driver will always send a shutdown command whenever the system suspends. Signed-off-by: Rob Barnes Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit 7d30198ee24f2ddcc4fefcd38a9b76bd8ab31360 Author: Andrew Zaborowski Date: Tue Nov 9 16:16:49 2021 +0100 keys: X.509 public key issuer lookup without AKID There are non-root X.509 v3 certificates in use out there that contain no Authority Key Identifier extension (RFC5280 section 4.2.1.1). For trust verification purposes the kernel asymmetric key type keeps two struct asymmetric_key_id instances that the key can be looked up by, and another two to look up the key's issuer. The x509 public key type and the PKCS7 type generate them from the SKID and AKID extensions in the certificate. In effect current code has no way to look up the issuer certificate for verification without the AKID. To remedy this, add a third asymmetric_key_id blob to the arrays in both asymmetric_key_id's (for certficate subject) and in the public_keys_signature's auth_ids (for issuer lookup), using just raw subject and issuer DNs from the certificate. Adapt asymmetric_key_ids() and its callers to use the third ID for lookups when none of the other two are available. Attempt to keep the logic intact when they are, to minimise behaviour changes. Adapt the restrict functions' NULL-checks to include that ID too. Do not modify the lookup logic in pkcs7_verify.c, the AKID extensions are still required there. Internally use a new "dn:" prefix to the search specifier string generated for the key lookup in find_asymmetric_key(). This tells asymmetric_key_match_preparse to only match the data against the raw DN in the third ID and shouldn't conflict with search specifiers already in use. In effect implement what (2) in the struct asymmetric_key_id comment (include/keys/asymmetric-type.h) is probably talking about already, so do not modify that comment. It is also how "openssl verify" looks up issuer certificates without the AKID available. Lookups by the raw DN are unambiguous only provided that the CAs respect the condition in RFC5280 4.2.1.1 that the AKID may only be omitted if the CA uses a single signing key. The following is an example of two things that this change enables. A self-signed ceritficate is generated following the example from https://letsencrypt.org/docs/certificates-for-localhost/, and can be looked up by an identifier and verified against itself by linking to a restricted keyring -- both things not possible before due to the missing AKID extension: $ openssl req -x509 -out localhost.crt -outform DER -keyout localhost.key \ -newkey rsa:2048 -nodes -sha256 \ -subj '/CN=localhost' -extensions EXT -config <( \ echo -e "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\n" \ "subjectAltName=DNS:localhost\nkeyUsage=digitalSignature\n" \ "extendedKeyUsage=serverAuth") $ keyring=`keyctl newring test @u` $ trusted=`keyctl padd asymmetric trusted $keyring < localhost.crt`; \ echo $trusted 39726322 $ keyctl search $keyring asymmetric dn:3112301006035504030c096c6f63616c686f7374 39726322 $ keyctl restrict_keyring $keyring asymmetric key_or_keyring:$trusted $ keyctl padd asymmetric verified $keyring < localhost.crt Signed-off-by: Andrew Zaborowski Reviewed-by: Jarkko Sakkinen Acked-by: Jarkko Sakkinen Acked-by: David Howells Signed-off-by: Jarkko Sakkinen commit e96d52822f5ac0a25de78f95cd23421bcbc93584 Author: Christophe Jaillet Date: Sat Nov 6 17:42:04 2021 +0100 tpm_tis: Fix an error handling path in 'tpm_tis_core_init()' Commit 79ca6f74dae0 ("tpm: fix Atmel TPM crash caused by too frequent queries") has moved some code around without updating the error handling path. This is now pointless to 'goto out_err' when neither 'clk_enable()' nor 'ioremap()' have been called yet. Make a direct return instead to avoid undoing things that have not been done. Fixes: 79ca6f74dae0 ("tpm: fix Atmel TPM crash caused by too frequent queries") Signed-off-by: Christophe Jaillet Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit d2704808f24fbc869ba54df82d4b1af49ab496e2 Author: AngeloGioacchino Del Regno Date: Fri Oct 29 10:09:15 2021 +0200 tpm: tpm_tis_spi_cr50: Add default RNG quality To allow this device to fill the kernel's entropy pool at boot, setup a default quality for the hwrng found in Cr50. After some testing with rngtest and dieharder it was, in short, discovered that the RNG produces fair quality randomness, giving around 99.93% successes in rngtest FIPS140-2. Notably, though, when testing with dieharder it was noticed that we get 3 WEAK results over 114, which isn't optimal, and also the p-values distribution wasn't uniform in all the cases, so a conservative quality value was chosen by applying an arbitrary penalty to the calculated values. For reference, this is how the values were calculated: The dieharder results were averaged, then normalized (0-1000) and re-averaged with the rngtest result (where the result was given a score of 99.93% of 1000, so 999.3), then aggregated together and averaged again. An arbitrary penalty of -100 was applied due to the retrieved value, which brings us finally to 700. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit f04510f26f82aa7cd0bf932760f01b01a010869f Author: Sohaib Mohamed Date: Wed Oct 13 11:21:50 2021 +0200 tpm/st33zp24: drop unneeded over-commenting Remove parameter descriptions from all static functions. Remove the comment altogether that does not tell what the function does. Suggested-by: Jarkko Sakkinen Signed-off-by: Sohaib Mohamed Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit 0ef333f5ba7f24f5d8478425c163d3097f1c7afd Author: Chen Jun Date: Wed Oct 13 06:25:56 2021 +0000 tpm: add request_locality before write TPM_INT_ENABLE Locality is not appropriately requested before writing the int mask. Add the missing boilerplate. Fixes: e6aef069b6e9 ("tpm_tis: convert to using locality callbacks") Signed-off-by: Chen Jun Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen commit b6aa86cff44cf099299d3a5e66348cb709cd7964 Author: Ingo Molnar Date: Wed Jan 5 01:35:58 2022 +0100 x86/kbuild: Enable CONFIG_KALLSYMS_ALL=y in the defconfigs Most distro kernels have this option enabled, to improve debug output. Lockdep also selects it. Enable this in the defconfig kernel as well, to make it more representative of what people are using on x86. Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/YdTn7gssoMVDMgMw@gmail.com commit ced4913efb0acc844ed65cc01d091a85d83a2082 Author: Johan Hovold Date: Wed Dec 22 11:48:43 2021 +0100 can: softing_cs: softingcs_probe(): fix memleak on registration failure In case device registration fails during probe, the driver state and the embedded platform device structure needs to be freed using platform_device_put() to properly free all resources (e.g. the device name). Fixes: 0a0b7a5f7a04 ("can: add driver for Softing card") Link: https://lore.kernel.org/all/20211222104843.6105-1-johan@kernel.org Cc: stable@vger.kernel.org # 2.6.38 Signed-off-by: Johan Hovold Reviewed-by: Greg Kroah-Hartman Signed-off-by: Marc Kleine-Budde commit bc3897f79f7901902bb44d62dd1ad1b2b48e9378 Author: Dario Binacchi Date: Fri Jan 7 09:13:06 2022 +0100 docs: networking: device drivers: can: add flexcan Add initial documentation for Flexcan driver. Link: https://lore.kernel.org/all/20220107193105.1699523-8-mkl@pengutronix.de Signed-off-by: Dario Binacchi Signed-off-by: Marc Kleine-Budde commit 32db1660ee01acebd18fc5759254930c874368af Author: Dario Binacchi Date: Fri Jan 7 09:13:05 2022 +0100 docs: networking: device drivers: add can sub-folder Add the container for CAN drivers documentation. Link: https://lore.kernel.org/all/20220107193105.1699523-7-mkl@pengutronix.de Signed-off-by: Dario Binacchi Signed-off-by: Marc Kleine-Budde commit 74fc5a452ec3d7c051fed5e97494effb2e747d1d Author: Dario Binacchi Date: Sat Jan 8 19:16:33 2022 +0100 can: flexcan: add ethtool support to get rx/tx ring parameters This patch adds ethtool support to get the number of message buffers configured for reception/transmission, which may also depends on runtime configurations such as the 'rx-rtr' flag state. Link: https://lore.kernel.org/all/20220108181633.420433-1-dario.binacchi@amarulasolutions.com Signed-off-by: Dario Binacchi [mkl: port to net-next/master, replace __sw_hweight64 by simpler calculation] Signed-off-by: Marc Kleine-Budde commit 1c45f5778a3be5a67e8b318ab83664014ffa1f3e Author: Marc Kleine-Budde Date: Tue Jan 4 16:28:00 2022 +0100 can: flexcan: add ethtool support to change rx-rtr setting during runtime This patch adds a private flag to the flexcan driver to switch the "rx-rtr" setting on and off. "rx-rtr" on - Receive RTR frames. (default) The CAN controller can and will receive RTR frames. On some IP cores the controller cannot receive RTR frames in the more performant "RX mailbox" mode and will use "RX FIFO" mode instead. "rx-rtr" off - Waive ability to receive RTR frames. (not supported on all IP cores) This mode activates the "RX mailbox mode" for better performance, on some IP cores RTR frames cannot be received anymore. The "RX FIFO" mode uses a FIFO with a depth of 6 CAN frames. The "RX mailbox" mode uses up to 62 mailboxes. Link: https://lore.kernel.org/all/20220107193105.1699523-6-mkl@pengutronix.de Signed-off-by: Dario Binacchi Co-developed-by: Dario Binacchi Signed-off-by: Marc Kleine-Budde commit 074b07d94e0bb6ddce5690a9b7e2373088e8b33a Author: J. Bruce Fields Date: Wed Jan 5 14:15:03 2022 -0500 nfsd: fix crash on COPY_NOTIFY with special stateid RTM says "If the special ONE stateid is passed to nfs4_preprocess_stateid_op(), it returns status=0 but does not set *cstid. nfsd4_copy_notify() depends on stid being set if status=0, and thus can crash if the client sends the right COPY_NOTIFY RPC." RFC 7862 says "The cna_src_stateid MUST refer to either open or locking states provided earlier by the server. If it is invalid, then the operation MUST fail." The RFC doesn't specify an error, and the choice doesn't matter much as this is clearly illegal client behavior, but bad_stateid seems reasonable. Simplest is just to guarantee that nfs4_preprocess_stateid_op, called with non-NULL cstid, errors out if it can't return a stateid. Reported-by: rtm@csail.mit.edu Fixes: 624322f1adc5 ("NFSD add COPY_NOTIFY operation") Signed-off-by: J. Bruce Fields Signed-off-by: Chuck Lever Reviewed-by: Olga Kornievskaia Tested-by: Olga Kornievskaia commit 7f4f5d70adfd88a08d6e122cfe2cf637ff84dd11 Author: J. Bruce Fields Date: Wed Jan 5 20:12:13 2022 -0500 MAINTAINERS: remove bfields I'm cutting back on my responsibilities. The NFS server and file locking code are in good hands. Signed-off-by: J. Bruce Fields Signed-off-by: Chuck Lever commit fcb5e3fa012351f3b96024c07bc44834c2478213 Author: Chuck Lever Date: Fri Dec 24 14:36:49 2021 -0500 NFSD: Move fill_pre_wcc() and fill_post_wcc() These functions are related to file handle processing and have nothing to do with XDR encoding or decoding. Also they are no longer NFSv3-specific. As a clean-up, move their definitions to a more appropriate location. WCC is also an NFSv3-specific term, so rename them as general-purpose helpers. Signed-off-by: Chuck Lever commit 58f258f65267542959487dbe8b5641754411843d Author: Chuck Lever Date: Fri Dec 24 14:22:28 2021 -0500 Revert "nfsd: skip some unnecessary stats in the v4 case" On the wire, I observed NFSv4 OPEN(CREATE) operations sometimes returning a reasonable-looking value in the cinfo.before field and zero in the cinfo.after field. RFC 8881 Section 10.8.1 says: > When a client is making changes to a given directory, it needs to > determine whether there have been changes made to the directory by > other clients. It does this by using the change attribute as > reported before and after the directory operation in the associated > change_info4 value returned for the operation. and > ... The post-operation change > value needs to be saved as the basis for future change_info4 > comparisons. A good quality client implementation therefore saves the zero cinfo.after value. During a subsequent OPEN operation, it will receive a different non-zero value in the cinfo.before field for that directory, and it will incorrectly believe the directory has changed, triggering an undesirable directory cache invalidation. There are filesystem types where fs_supports_change_attribute() returns false, tmpfs being one. On NFSv4 mounts, this means the fh_getattr() call site in fill_pre_wcc() and fill_post_wcc() is never invoked. Subsequently, nfsd4_change_attribute() is invoked with an uninitialized @stat argument. In fill_pre_wcc(), @stat contains stale stack garbage, which is then placed on the wire. In fill_post_wcc(), ->fh_post_wc is all zeroes, so zero is placed on the wire. Both of these values are meaningless. This fix can be applied immediately to stable kernels. Once there are more regression tests in this area, this optimization can be attempted again. Fixes: 428a23d2bf0c ("nfsd: skip some unnecessary stats in the v4 case") Signed-off-by: Chuck Lever commit 75acacb6583df0b9328dc701d8eeea05af49b8b5 Author: Chuck Lever Date: Tue Dec 28 14:27:56 2021 -0500 NFSD: Trace boot verifier resets According to commit bbf2f098838a ("nfsd: Reset the boot verifier on all write I/O errors"), the Linux NFS server forces all clients to resend pending unstable writes if any server-side write or commit operation encounters an error (say, ENOSPC). This is a rare and quite exceptional event that could require administrative recovery action, so it should be made trace-able. Example trace event: nfsd-938 [002] 7174.945558: nfsd_writeverf_reset: boot_time= 61cc920d xid=0xdcd62036 error=-28 new verifier=0x08aecc6142515904 Signed-off-by: Chuck Lever commit 3988a57885eeac05ef89f0ab4d7e47b52fbcf630 Author: Chuck Lever Date: Thu Dec 30 10:22:05 2021 -0500 NFSD: Rename boot verifier functions Clean up: These functions handle what the specs call a write verifier, which in the Linux NFS server implementation is now divorced from the server's boot instance Signed-off-by: Chuck Lever commit 91d2e9b56cf5c80f9efc530d494968369a8a0e0d Author: Chuck Lever Date: Wed Dec 29 14:43:16 2021 -0500 NFSD: Clean up the nfsd_net::nfssvc_boot field There are two boot-time fields in struct nfsd_net: one called boot_time and one called nfssvc_boot. The latter is used only to form write verifiers, but its documenting comment declares: /* Time of server startup */ Since commit 27c438f53e79 ("nfsd: Support the server resetting the boot verifier"), this field can be reset at any time; it's no longer tied to server restart. So that comment is stale. Also, according to pahole, struct timespec64 is 16 bytes long on x86_64. The nfssvc_boot field is used only to form a write verifier, which is 8 bytes long. Let's clarify this situation by manufacturing an 8-byte verifier in nfs_reset_boot_verifier() and storing only that in struct nfsd_net. We're grabbing 128 bits of time, so compress all of those into a 64-bit verifier instead of throwing out the high-order bits. In the future, the siphash_key can be re-used for other hashed objects per-nfsd_net. Signed-off-by: Chuck Lever commit cdc556600c0133575487cc69fb3128440b3c3e92 Author: Chuck Lever Date: Thu Dec 30 10:26:18 2021 -0500 NFSD: Write verifier might go backwards When vfs_iter_write() starts to fail because a file system is full, a bunch of writes can fail at once with ENOSPC. These writes repeatedly invoke nfsd_reset_boot_verifier() in quick succession. Ensure that the time it grabs doesn't go backwards due to an ntp adjustment going on at the same time. Signed-off-by: Chuck Lever commit a2f4c3fa4db94ba44d32a72201927cfd132a8e82 Author: Trond Myklebust Date: Sat Dec 18 20:38:00 2021 -0500 nfsd: Add a tracepoint for errors in nfsd4_clone_file_range() Since a clone error commit can cause the boot verifier to change, we should trace those errors. Signed-off-by: Trond Myklebust Signed-off-by: Chuck Lever [ cel: Addressed a checkpatch.pl splat in fs/nfsd/vfs.h ] commit 2c445a0e72cb1fbfbdb7f9473c53556ee27c1d90 Author: Chuck Lever Date: Tue Dec 28 14:26:03 2021 -0500 NFSD: De-duplicate net_generic(nf->nf_net, nfsd_net_id) Since this pointer is used repeatedly, move it to a stack variable. Signed-off-by: Chuck Lever commit fb7622c2dbd1aa41133a8c73e1137b833c074519 Author: Chuck Lever Date: Tue Dec 28 12:41:32 2021 -0500 NFSD: De-duplicate net_generic(SVC_NET(rqstp), nfsd_net_id) Since this pointer is used repeatedly, move it to a stack variable. Signed-off-by: Chuck Lever commit 33388b3aefefd4d83764dab8038cb54068161a44 Author: Chuck Lever Date: Tue Dec 28 14:19:41 2021 -0500 NFSD: Clean up nfsd_vfs_write() The RWF_SYNC and !RWF_SYNC arms are now exactly alike except that the RWF_SYNC arm resets the boot verifier twice in a row. Fix that redundancy and de-duplicate the code. Signed-off-by: Chuck Lever commit 555dbf1a9aac6d3150c8b52fa35f768a692f4eeb Author: Trond Myklebust Date: Sat Dec 18 20:38:01 2021 -0500 nfsd: Replace use of rwsem with errseq_t The nfsd_file nf_rwsem is currently being used to separate file write and commit instances to ensure that we catch errors and apply them to the correct write/commit. We can improve scalability at the expense of a little accuracy (some extra false positives) by replacing the nf_rwsem with more careful use of the errseq_t mechanism to track errors across the different operations. Signed-off-by: Trond Myklebust Signed-off-by: Chuck Lever [ cel: rebased on zero-verifier fix ] commit f11ad7aa653130b71e2e89bed207f387718216d5 Author: Chuck Lever Date: Tue Dec 28 12:35:43 2021 -0500 NFSD: Fix verifier returned in stable WRITEs RFC 8881 explains the purpose of the write verifier this way: > The final portion of the result is the field writeverf. This field > is the write verifier and is a cookie that the client can use to > determine whether a server has changed instance state (e.g., server > restart) between a call to WRITE and a subsequent call to either > WRITE or COMMIT. But then it says: > This cookie MUST be unchanged during a single instance of the > NFSv4.1 server and MUST be unique between instances of the NFSv4.1 > server. If the cookie changes, then the client MUST assume that > any data written with an UNSTABLE4 value for committed and an old > writeverf in the reply has been lost and will need to be > recovered. RFC 1813 has similar language for NFSv3. NFSv2 does not have a write verifier since it doesn't implement the COMMIT procedure. Since commit 19e0663ff9bc ("nfsd: Ensure sampling of the write verifier is atomic with the write"), the Linux NFS server has returned a boot-time-based verifier for UNSTABLE WRITEs, but a zero verifier for FILE_SYNC and DATA_SYNC WRITEs. FILE_SYNC and DATA_SYNC WRITEs are not followed up with a COMMIT, so there's no need for clients to compare verifiers for stable writes. However, by returning a different verifier for stable and unstable writes, the above commit puts the Linux NFS server a step farther out of compliance with the first MUST above. At least one NFS client (FreeBSD) noticed the difference, making this a potential regression. Reported-by: Rick Macklem Link: https://lore.kernel.org/linux-nfs/YQXPR0101MB096857EEACF04A6DF1FC6D9BDD749@YQXPR0101MB0968.CANPRD01.PROD.OUTLOOK.COM/T/ Fixes: 19e0663ff9bc ("nfsd: Ensure sampling of the write verifier is atomic with the write") Signed-off-by: Chuck Lever commit 12bcbd40fd931472c7fc9cf3bfe66799ece93ed8 Author: Jeff Layton Date: Sat Dec 18 20:37:56 2021 -0500 nfsd: Retry once in nfsd_open on an -EOPENSTALE return If we get back -EOPENSTALE from an NFSv4 open, then we either got some unhandled error or the inode we got back was not the same as the one associated with the dentry. We really have no recourse in that situation other than to retry the open, and if it fails to just return nfserr_stale back to the client. Signed-off-by: Jeff Layton Signed-off-by: Lance Shelton Signed-off-by: Trond Myklebust Signed-off-by: Chuck Lever commit a2694e51f60c5a18c7e43d1a9feaa46d7f153e65 Author: Jeff Layton Date: Sat Dec 18 20:37:55 2021 -0500 nfsd: Add errno mapping for EREMOTEIO The NFS client can occasionally return EREMOTEIO when signalling issues with the server. ...map to NFSERR_IO. Signed-off-by: Jeff Layton Signed-off-by: Lance Shelton Signed-off-by: Trond Myklebust Signed-off-by: Chuck Lever commit b3d0db706c77d02055910fcfe2f6eb5155ff9d5e Author: Peng Tao Date: Sat Dec 18 20:37:54 2021 -0500 nfsd: map EBADF Now that we have open file cache, it is possible that another client deletes the file and DP will not know about it. Then IO to MDS would fail with BADSTATEID and knfsd would start state recovery, which should fail as well and then nfs read/write will fail with EBADF. And it triggers a WARN() in nfserrno(). -----------[ cut here ]------------ WARNING: CPU: 0 PID: 13529 at fs/nfsd/nfsproc.c:758 nfserrno+0x58/0x70 [nfsd]() nfsd: non-standard errno: -9 modules linked in: nfsv3 nfs_layout_flexfiles rpcsec_gss_krb5 nfsv4 dns_resolver nfs fscache ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 xt_connt pata_acpi floppy CPU: 0 PID: 13529 Comm: nfsd Tainted: G W 4.1.5-00307-g6e6579b #7 Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 09/30/2014 0000000000000000 00000000464e6c9c ffff88079085fba8 ffffffff81789936 0000000000000000 ffff88079085fc00 ffff88079085fbe8 ffffffff810a08ea ffff88079085fbe8 ffff88080f45c900 ffff88080f627d50 ffff880790c46a48 all Trace: [] dump_stack+0x45/0x57 [] warn_slowpath_common+0x8a/0xc0 [] warn_slowpath_fmt+0x55/0x70 [] ? splice_direct_to_actor+0x148/0x230 [] ? fsid_source+0x60/0x60 [nfsd] [] nfserrno+0x58/0x70 [nfsd] [] nfsd_finish_read+0x97/0xb0 [nfsd] [] nfsd_splice_read+0x76/0xa0 [nfsd] [] nfsd_read+0xc1/0xd0 [nfsd] [] ? svc_tcp_adjust_wspace+0x12/0x30 [sunrpc] [] nfsd3_proc_read+0xba/0x150 [nfsd] [] nfsd_dispatch+0xc3/0x210 [nfsd] [] ? svc_tcp_adjust_wspace+0x12/0x30 [sunrpc] [] svc_process_common+0x453/0x6f0 [sunrpc] [] svc_process+0x113/0x1b0 [sunrpc] [] nfsd+0xff/0x170 [nfsd] [] ? nfsd_destroy+0x80/0x80 [nfsd] [] kthread+0xd8/0xf0 [] ? kthread_create_on_node+0x1b0/0x1b0 [] ret_from_fork+0x42/0x70 [] ? kthread_create_on_node+0x1b0/0x1b0 Signed-off-by: Peng Tao Signed-off-by: Lance Shelton Signed-off-by: Trond Myklebust Signed-off-by: Chuck Lever commit 6a2f774424bfdcc2df3e17de0cefe74a4269cad5 Author: Chuck Lever Date: Tue Dec 21 11:52:06 2021 -0500 NFSD: Fix zero-length NFSv3 WRITEs The Linux NFS server currently responds to a zero-length NFSv3 WRITE request with NFS3ERR_IO. It responds to a zero-length NFSv4 WRITE with NFS4_OK and count of zero. RFC 1813 says of the WRITE procedure's @count argument: count The number of bytes of data to be written. If count is 0, the WRITE will succeed and return a count of 0, barring errors due to permissions checking. RFC 8881 has similar language for NFSv4, though NFSv4 removed the explicit @count argument because that value is already contained in the opaque payload array. The synthetic client pynfs's WRT4 and WRT15 tests do emit zero- length WRITEs to exercise this spec requirement. Commit fdec6114ee1f ("nfsd4: zero-length WRITE should succeed") addressed the same problem there with the same fix. But interestingly the Linux NFS client does not appear to emit zero- length WRITEs, instead squelching them. I'm not aware of a test that can generate such WRITEs for NFSv3, so I wrote a naive C program to generate a zero-length WRITE and test this fix. Fixes: 8154ef2776aa ("NFSD: Clean up legacy NFS WRITE argument XDR decoders") Reported-by: Trond Myklebust Signed-off-by: Chuck Lever Cc: stable@vger.kernel.org Signed-off-by: Chuck Lever commit 47446d74f1707049067fee038507cdffda805631 Author: Vasily Averin Date: Fri Dec 17 09:49:39 2021 +0300 nfsd4: add refcount for nfsd4_blocked_lock nbl allocated in nfsd4_lock can be released by a several ways: directly in nfsd4_lock(), via nfs4_laundromat(), via another nfs command RELEASE_LOCKOWNER or via nfsd4_callback. This structure should be refcounted to be used and released correctly in all these cases. Refcount is initialized to 1 during allocation and is incremented when nbl is added into nbl_list/nbl_lru lists. Usually nbl is linked into both lists together, so only one refcount is used for both lists. However nfsd4_lock() should keep in mind that nbl can be present in one of lists only. This can happen if nbl was handled already by nfs4_laundromat/nfsd4_callback/etc. Refcount is decremented if vfs_lock_file() returns FILE_LOCK_DEFERRED, because nbl can be handled already by nfs4_laundromat/nfsd4_callback/etc. Refcount is not changed in find_blocked_lock() because of it reuses counter released after removing nbl from lists. Signed-off-by: Vasily Averin Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever commit 40595cdc93edf4110c0f0c0b06f8d82008f23929 Author: J. Bruce Fields Date: Thu Dec 16 12:20:13 2021 -0500 nfs: block notification on fs with its own ->lock NFSv4.1 supports an optional lock notification feature which notifies the client when a lock comes available. (Normally NFSv4 clients just poll for locks if necessary.) To make that work, we need to request a blocking lock from the filesystem. We turned that off for NFS in commit f657f8eef3ff ("nfs: don't atempt blocking locks on nfs reexports") [sic] because it actually blocks the nfsd thread while waiting for the lock. Thanks to Vasily Averin for pointing out that NFS isn't the only filesystem with that problem. Any filesystem that leaves ->lock NULL will use posix_lock_file(), which does the right thing. Simplest is just to assume that any filesystem that defines its own ->lock is not safe to request a blocking lock from. So, this patch mostly reverts commit f657f8eef3ff ("nfs: don't atempt blocking locks on nfs reexports") [sic] and commit b840be2f00c0 ("lockd: don't attempt blocking locks on nfs reexports"), and instead uses a check of ->lock (Vasily's suggestion) to decide whether to support blocking lock notifications on a given filesystem. Also add a little documentation. Perhaps someday we could add back an export flag later to allow filesystems with "good" ->lock methods to support blocking lock notifications. Reported-by: Vasily Averin Signed-off-by: J. Bruce Fields [ cel: Description rewritten to address checkpatch nits ] [ cel: Fixed warning when SUNRPC debugging is disabled ] [ cel: Fixed NULL check ] Signed-off-by: Chuck Lever Reviewed-by: Vasily Averin commit cd2e999c7c394ae916d8be741418b3c6c1dddea8 Author: Chuck Lever Date: Mon Dec 13 10:20:45 2021 -0500 NFSD: De-duplicate nfsd4_decode_bitmap4() Clean up. Trond points out that xdr_stream_decode_uint32_array() does the same thing as nfsd4_decode_bitmap4(). Suggested-by: Trond Myklebust Signed-off-by: Chuck Lever commit 3dcd1d8aab00c5d3a0a3725253c86440b1a0f5a7 Author: J. Bruce Fields Date: Tue Dec 7 17:32:21 2021 -0500 nfsd: improve stateid access bitmask documentation The use of the bitmaps is confusing. Add a cross-reference to make it easier to find the existing comment. Add an updated reference with URL to make it quicker to look up. And a bit more editorializing about the value of this. Signed-off-by: J. Bruce Fields Signed-off-by: Chuck Lever commit 70e94d757b3e1f46486d573729d84c8955c81dce Author: Chuck Lever Date: Thu Oct 21 12:11:45 2021 -0400 NFSD: Combine XDR error tracepoints Clean up: The garbage_args and cant_encode tracepoints report the same information as each other, so combine them into a single tracepoint class to reduce code duplication and slightly reduce the size of trace.o. Signed-off-by: Chuck Lever commit c5c88591040ee7d84d037328eed9019d3ffab821 Author: Marc Kleine-Budde Date: Fri Jan 7 14:29:15 2022 +0100 can: flexcan: add more quirks to describe RX path capabilities Most flexcan IP cores support 2 RX modes: - FIFO - mailbox Some IP core versions cannot receive CAN RTR messages via mailboxes. This patch adds quirks to document this. This information will be used in a later patch to switch from FIFO to more performant mailbox mode at the expense of losing the ability to receive RTR messages. This trade off is beneficial in certain use cases. Link: https://lore.kernel.org/all/20220107193105.1699523-5-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 34ea4e1c99f1f177f87e4ae7896caef238dd741a Author: Marc Kleine-Budde Date: Thu Jan 6 12:45:46 2022 +0100 can: flexcan: rename RX modes Most flexcan IP cores support 2 RX modes: - FIFO - mailbox The names for these modes were chosen to reflect the name of the rx-offload mode they are using. The name of the RX modes should better reflect their difference with regards the flexcan IP core. So this patch renames the various occurrences of OFF_FIFO to RX_FIFO and OFF_TIMESTAMP to RX_MAILBOX: | FLEXCAN_TX_MB_RESERVED_OFF_FIFO -> FLEXCAN_TX_MB_RESERVED_RX_FIFO | FLEXCAN_TX_MB_RESERVED_OFF_TIMESTAMP -> FLEXCAN_TX_MB_RESERVED_RX_MAILBOX | FLEXCAN_QUIRK_USE_OFF_TIMESTAMP -> FLEXCAN_QUIRK_USE_RX_MAILBOX Link: https://lore.kernel.org/all/20220107193105.1699523-4-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 01bb4dccd92b4dc21f6af3312e5696924e371111 Author: Dario Binacchi Date: Tue Jan 4 14:20:25 2022 +0100 can: flexcan: allow to change quirks at runtime This is a preparation patch for the upcoming support to change the rx-rtr capability via the ethtool API. Link: https://lore.kernel.org/all/20220107193105.1699523-3-mkl@pengutronix.de Signed-off-by: Dario Binacchi Signed-off-by: Marc Kleine-Budde commit bfd00e021cf162049946a9e0047b0997d2b35fec Author: Marc Kleine-Budde Date: Tue Jan 4 16:15:01 2022 +0100 can: flexcan: move driver into separate sub directory This patch moves the flexcan driver into a separate directory, a later patch will add more files. Link: https://lore.kernel.org/all/20220107193105.1699523-2-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 3044a4f271d278858321675d367b37bcafca186c Author: Marc Kleine-Budde Date: Sat Oct 23 00:27:13 2021 +0200 can: mcp251xfd: introduce and make use of mcp251xfd_is_fd_mode() This patch replaces the open coded check, if the chip's FIFOs are configured for CAN-FD mode, by the newly introduced function mcp251xfd_is_fd_mode(). Link: https://lore.kernel.org/all/20220105154300.1258636-14-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 55bc37c85587d0c53a666a685a49752e28a31396 Author: Marc Kleine-Budde Date: Fri May 21 19:58:06 2021 +0200 can: mcp251xfd: move ring init into separate function This patch moves the ring initialization from the mcp251xfd core file into a separate one to make the driver a bit more orderly. Link: https://lore.kernel.org/all/20220105154300.1258636-13-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 335c818c5a7ace740da837a8bb8591d5896938db Author: Marc Kleine-Budde Date: Fri May 21 19:51:32 2021 +0200 can: mcp251xfd: move chip FIFO init into separate file This patch moves the chip FIFO initialization from the mcp251xfd core file into a separate one to make the driver a bit more orderly. Link: https://lore.kernel.org/all/20220105154300.1258636-12-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 1e846c7aeb067fefbd53f03db56e69d160781d9d Author: Marc Kleine-Budde Date: Fri May 21 19:51:32 2021 +0200 can: mcp251xfd: move TEF handling into separate file This patch moves the TEF handling from the mcp251xfd core file into a separate one to make the driver a bit more orderly. Link: https://lore.kernel.org/all/20220105154300.1258636-11-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 09b0eb92fec7d5d8e6307c369e62e7c3926dd447 Author: Marc Kleine-Budde Date: Fri May 21 19:51:32 2021 +0200 can: mcp251xfd: move TX handling into separate file This patch moves the TX handling from the mcp251xfd core file into a separate one to make the driver a bit more orderly. Link: https://lore.kernel.org/all/20220105154300.1258636-10-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 319fdbc9433c6a74fdb3993c9f5d9a1334068a21 Author: Marc Kleine-Budde Date: Fri May 21 19:51:32 2021 +0200 can: mcp251xfd: move RX handling into separate file This patch moves the RX handling from the mcp251xfd core file into a separate one to make the driver a bit more orderly. Link: https://lore.kernel.org/all/20220105154300.1258636-9-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde commit cae9071bc5ea3096a5604e48e854740c12f7c1ec Author: Marc Kleine-Budde Date: Sat May 1 11:57:49 2021 +0200 can: mcp251xfd: mcp251xfd.h: sort function prototypes The .c files in the Makefile are ordered alphabetically. This patch groups the function prototypes by their corresponding .c file and brings the into the same order. Link: https://lore.kernel.org/all/20220105154300.1258636-8-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 58d0b0a99275c35971d2e27d317013331bd3a8c0 Author: Marc Kleine-Budde Date: Mon Nov 15 20:12:05 2021 +0100 can: mcp251xfd: mcp251xfd_handle_rxovif(): denote RX overflow message to debug + add rate limiting A RX overflow usually happens during high system load. Printing overflow messages to the kernel log, which on embedded systems often is outputted on the serial console, even increases the system load. To decrease the system load in these situations, denote the messages to debug level and wrap them with net_ratelimit(). Link: https://lore.kernel.org/all/20220105154300.1258636-7-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde commit d84ca2217b0065ec0f27a7c34ed073ed6449e213 Author: Marc Kleine-Budde Date: Sun Apr 25 21:39:19 2021 +0200 can: mcp251xfd: mcp251xfd_open(): make use of pm_runtime_resume_and_get() With patch | dd8088d5a896 PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter the usual pm_runtime_get_sync() and pm_runtime_put_noidle() in-case-of-error dance is no longer needed. Convert the mcp251xfd driver to use this function. Link: https://lore.kernel.org/all/20220105154300.1258636-6-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde commit e91aae8efc4eebd33bdebe067ab248c242cc0135 Author: Marc Kleine-Budde Date: Fri Oct 22 18:45:05 2021 +0200 can: mcp251xfd: mcp251xfd_open(): open_candev() first This patch exchanges the order of open_candev() and pm_runtime_get_sync(), so that open_candev() is called first. A usual reason why open_candev() fails is missing CAN bit rate configuration. It makes no sense to resume the device from PM sleep first just to put it to sleep if the bit rate is not configured. Link: https://lore.kernel.org/all/20220105154300.1258636-5-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 3bd9d8ce6f8c5c43ee2f1106021db0f98882cc75 Author: Marc Kleine-Budde Date: Tue Oct 19 17:05:25 2021 +0200 can: mcp251xfd: add missing newline to printed strings This patch adds the missing newline to printed strings. Fixes: 55e5b97f003e ("can: mcp25xxfd: add driver for Microchip MCP25xxFD SPI CAN") Link: https://lore.kernel.org/all/20220105154300.1258636-4-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde commit 99e7cc3b3f85d9a583ab83f386315c59443509ae Author: Marc Kleine-Budde Date: Fri Apr 23 11:26:56 2021 +0200 can: mcp251xfd: mcp251xfd_tef_obj_read(): fix typo in error message This patch fixes a typo in the error message in mcp251xfd_tef_obj_read(), if trying to read too many objects. Link: https://lore.kernel.org/all/20220105154300.1258636-3-mkl@pengutronix.de Fixes: 55e5b97f003e ("can: mcp25xxfd: add driver for Microchip MCP25xxFD SPI CAN") Signed-off-by: Marc Kleine-Budde commit 2d2116691adff8c3e24a5cb9076ea01b217b985d Author: Marc Kleine-Budde Date: Sat Nov 27 19:59:34 2021 +0100 can: mcp251xfd: remove double blank lines This patch removes double blank lines from the driver. Link: https://lore.kernel.org/all/20220105154300.1258636-2-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde commit c579792562837ec2e64b006cfc9423e4177a4d26 Author: Tom Rix Date: Sat Jan 8 06:33:19 2022 -0800 can: janz-ican3: initialize dlc variable Clang static analysis reports this problem janz-ican3.c:1311:2: warning: Undefined or garbage value returned to caller return dlc; ^~~~~~~~~~ dlc is only set with this conditional if (!(cf->can_id & CAN_RTR_FLAG)) dlc = cf->len; But is always returned. So initialize dlc to 0. Fixes: cc4b08c31b5c ("can: do not increase tx_bytes statistics for RTR frames") Link: https://lore.kernel.org/all/20220108143319.3986923-1-trix@redhat.com Signed-off-by: Tom Rix Acked-by: Vincent Mailhol Signed-off-by: Marc Kleine-Budde commit a403df29789ba38796edb97dad9bfb47836b68c0 Author: Eric W. Biederman Date: Mon Dec 20 16:29:29 2021 -0600 ptrace/m68k: Stop open coding ptrace_report_syscall The generic function ptrace_report_syscall does a little more than syscall_trace on m68k. The function ptrace_report_syscall stops early if PT_TRACED is not set, it sets ptrace_message, and returns the result of fatal_signal_pending. Setting ptrace_message to a passed in value of 0 is effectively not setting ptrace_message, making that additional work a noop. Returning the result of fatal_signal_pending and letting the caller ignore the result becomes a noop in this change. When a process is ptraced, the flag PT_PTRACED is always set in current->ptrace. Testing for PT_PTRACED in ptrace_report_syscall is just an optimization to fail early if the process is not ptraced. Later on in ptrace_notify, ptrace_stop will test current->ptrace under tasklist_lock and skip performing any work if the task is not ptraced. Cc: Geert Uytterhoeven Link: https://lkml.kernel.org/r/20220103213312.9144-8-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" commit 4264178416cd52a55a3eccbefb3973866e060280 Author: Eric W. Biederman Date: Mon Dec 20 16:28:53 2021 -0600 ptrace: Remove unused regs argument from ptrace_report_syscall Link: https://lkml.kernel.org/r/20220103213312.9144-7-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" commit 6707d0fc60576fa8ef2dfa2f9009b606df35ba24 Author: Eric W. Biederman Date: Mon Dec 20 17:15:09 2021 -0600 ptrace: Remove second setting of PT_SEIZED in ptrace_attach The code is totally redundant remove it. Link: https://lkml.kernel.org/r/20220103213312.9144-6-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" commit 1b5a42d9c85f0e731f01c8d1129001fd8531a8a0 Author: Eric W. Biederman Date: Mon Jan 3 11:32:36 2022 -0600 taskstats: Cleanup the use of task->exit_code In the function bacct_add_task the code reading task->exit_code was introduced in commit f3cef7a99469 ("[PATCH] csa: basic accounting over taskstats"), and it is not entirely clear what the taskstats interface is trying to return as only returning the exit_code of the first task in a process doesn't make a lot of sense. As best as I can figure the intent is to return task->exit_code after a task exits. The field is returned with per task fields, so the exit_code of the entire process is not wanted. Only the value of the first task is returned so this is not a useful way to get the per task ptrace stop code. The ordinary case of returning this value is returning after a task exits, which also precludes use for getting a ptrace value. It is common to for the first task of a process to also be the last task of a process so this field may have done something reasonable by accident in testing. Make ac_exitcode a reliable per task value by always returning it for every exited task. Setting ac_exitcode in a sensible mannter makes it possible to continue to provide this value going forward. Cc: Balbir Singh Fixes: f3cef7a99469 ("[PATCH] csa: basic accounting over taskstats") Link: https://lkml.kernel.org/r/20220103213312.9144-5-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" commit 2d18f7f456209ed8a8fc138b8bc535dbdaf84695 Author: Eric W. Biederman Date: Mon Dec 20 19:16:34 2021 -0600 exit: Use the correct exit_code in /proc//stat Since do_proc_statt was modified to return process wide values instead of per task values the exit_code calculation has never been updated. Update it now to return the process wide exit_code when it is requested and available. History-Tree: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git Fixes: bf719d26a5c1 ("[PATCH] distinct tgid/tid CPU usage") Link: https://lkml.kernel.org/r/20220103213312.9144-4-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" commit 907c311f37ba04ccebd00a9b9f3ba718e318a1de Author: Eric W. Biederman Date: Tue Dec 21 10:11:01 2021 -0600 exit: Fix the exit_code for wait_task_zombie The function wait_task_zombie is defined to always returns the process not thread exit status. Unfortunately when process group exit support was added to wait_task_zombie the WNOWAIT case was overlooked. Usually tsk->exit_code and tsk->signal->group_exit_code will be in sync so fixing this is bug probably has no effect in practice. But fix it anyway so that people aren't scratching their heads about why the two code paths are different. History-Tree: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git Fixes: 2c66151cbc2c ("[PATCH] sys_exit() threading improvements, BK-curr") Link: https://lkml.kernel.org/r/20220103213312.9144-3-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" commit 270b6541e603a7fae0cad7af3dc3bca6adb343f3 Author: Eric W. Biederman Date: Thu Dec 23 10:05:19 2021 -0600 exit: Coredumps reach do_group_exit The comment about coredumps not reaching do_group_exit and the corresponding BUG_ON are bogus. What happens and has happened for years is that get_signal calls do_coredump (which sets SIGNAL_GROUP_EXIT and group_exit_code) and then do_group_exit passing the signal number. Then do_group_exit ignores the exit_code it is passed and uses signal->group_exit_code from the coredump. The comment and BUG_ON were correct when they were added during the 2.5 development cycle, but became obsolete and incorrect when get_signal was changed to fall through to do_group_exit after do_coredump in 2.6.10-rc2. So remove the stale comment and BUG_ON Fixes: 63bd6144f191 ("[PATCH] Invalid BUG_ONs in signal.c") History-Tree: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git Link: https://lkml.kernel.org/r/20220103213312.9144-2-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" commit 2873cd31a20c25b5e763b35e5fb886f0938c6dd5 Author: Eric W. Biederman Date: Sat Jan 8 10:03:24 2022 -0600 exit: Remove profile_handoff_task All profile_handoff_task does is notify the task_free_notifier chain. The helpers task_handoff_register and task_handoff_unregister are used to add and delete entries from that chain and are never called. So remove the dead code and make it much easier to read and reason about __put_task_struct. Suggested-by: Al Viro Link: https://lkml.kernel.org/r/87fspyw6m0.fsf@email.froward.int.ebiederm.org Signed-off-by: "Eric W. Biederman" commit 2d4bcf886e42f0f4846a3d9bdc3a90d278903a2e Author: Eric W. Biederman Date: Sat Jan 8 11:23:02 2022 -0600 exit: Remove profile_task_exit & profile_munmap When I say remove I mean remove. All profile_task_exit and profile_munmap do is call a blocking notifier chain. The helpers profile_task_register and profile_task_unregister are not called anywhere in the tree. Which means this is all dead code. So remove the dead code and make it easier to read do_exit. Reviewed-by: Christoph Hellwig Link: https://lkml.kernel.org/r/20220103213312.9144-1-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" commit 6410349ea5e177f3e53c2006d2041eed47e986ae Author: Randy Dunlap Date: Tue Dec 21 19:10:27 2021 -0800 signal: clean up kernel-doc comments Fix kernel-doc warnings in kernel/signal.c: kernel/signal.c:1830: warning: Function parameter or member 'force_coredump' not described in 'force_sig_seccomp' kernel/signal.c:2873: warning: missing initial short description on line: * signal_delivered - Also add a closing parenthesis to the comments in signal_delivered(). Signed-off-by: Randy Dunlap Cc: Alexander Viro Cc: Richard Weinberger Cc: Andrew Morton Cc: "Eric W. Biederman" Cc: Jens Axboe Cc: Peter Zijlstra Cc: Marco Elver Cc: Thomas Gleixner Link: https://lkml.kernel.org/r/20211222031027.29694-1-rdunlap@infradead.org Signed-off-by: Eric W. Biederman commit 49697335e0b441b0553598c1b48ee9ebb053d2f1 Author: Eric W. Biederman Date: Thu Jun 24 02:14:30 2021 -0500 signal: Remove the helper signal_group_exit This helper is misleading. It tests for an ongoing exec as well as the process having received a fatal signal. Sometimes it is appropriate to treat an on-going exec differently than a process that is shutting down due to a fatal signal. In particular taking the fast path out of exit_signals instead of retargeting signals is not appropriate during exec, and not changing the the exit code in do_group_exit during exec. Removing the helper makes it more obvious what is going on as both cases must be coded for explicitly. While removing the helper fix the two cases where I have observed using signal_group_exit resulted in the wrong result. In exit_signals only test for SIGNAL_GROUP_EXIT so that signals are retargetted during an exec. In do_group_exit use 0 as the exit code during an exec as de_thread does not set group_exit_code. As best as I can determine group_exit_code has been is set to 0 most of the time during de_thread. During a thread group stop group_exit_code is set to the stop signal and when the thread group receives SIGCONT group_exit_code is reset to 0. Link: https://lkml.kernel.org/r/20211213225350.27481-8-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" commit 60700e38fb68e800607ca7a027060d5419fc5798 Author: Eric W. Biederman Date: Sun Jun 6 13:47:53 2021 -0500 signal: Rename group_exit_task group_exec_task The only remaining user of group_exit_task is exec. Rename the field so that it is clear which part of the code uses it. Update the comment above the definition of group_exec_task to document how it is currently used. Link: https://lkml.kernel.org/r/20211213225350.27481-7-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" commit 6ac79ec5378b675f91021c8073cde0eea59f81ad Author: Eric W. Biederman Date: Fri Nov 19 12:11:54 2021 -0600 coredump: Stop setting signal->group_exit_task Currently the coredump code sets group_exit_task so that signal_group_exit() will return true during a coredump. Now that the coredump code always sets SIGNAL_GROUP_EXIT there is no longer a need to set signal->group_exit_task. Link: https://lkml.kernel.org/r/20211213225350.27481-6-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" commit 2f824d4d197e02275562359a2ae5274177ce500c Author: Eric W. Biederman Date: Sat Jan 8 09:48:31 2022 -0600 signal: Remove SIGNAL_GROUP_COREDUMP After the previous cleanups "signal->core_state" is set whenever SIGNAL_GROUP_COREDUMP is set and "signal->core_state" is tested whenver the code wants to know if a coredump is in progress. The remaining tests of SIGNAL_GROUP_COREDUMP also test to see if SIGNAL_GROUP_EXIT is set. Similarly the only place that sets SIGNAL_GROUP_COREDUMP also sets SIGNAL_GROUP_EXIT. Which makes SIGNAL_GROUP_COREDUMP unecessary and redundant. So stop setting SIGNAL_GROUP_COREDUMP, stop testing SIGNAL_GROUP_COREDUMP, and remove it's definition. With the setting of SIGNAL_GROUP_COREDUMP gone, coredump_finish no longer needs to clear SIGNAL_GROUP_COREDUMP out of signal->flags by setting SIGNAL_GROUP_EXIT. Link: https://lkml.kernel.org/r/20211213225350.27481-5-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" commit 752dc9707567f39ed7850e21796cf2b467d71ad5 Author: Eric W. Biederman Date: Sat Jan 8 09:44:58 2022 -0600 signal: During coredumps set SIGNAL_GROUP_EXIT in zap_process There are only a few places that test SIGNAL_GROUP_EXIT and are not also already testing SIGNAL_GROUP_COREDUMP. This will not affect the callers of signal_group_exit as zap_process also sets group_exit_task so signal_group_exit will continue to return true at the same times. This does not affect wait_task_zombie as the none of the threads wind up in EXIT_ZOMBIE state during a coredump. This does not affect oom_kill.c:__task_will_free_mem as sig->core_state is tested and handled before SIGNAL_GROUP_EXIT is tested for. This does not affect complete_signal as signal->core_state is tested for to ensure the coredump case is handled appropriately. Link: https://lkml.kernel.org/r/20211213225350.27481-4-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" commit 7ba03471ac4ad2432e5ccf67d9d4ab03c177578a Author: Eric W. Biederman Date: Sat Jan 8 11:01:12 2022 -0600 signal: Make coredump handling explicit in complete_signal Ever since commit 6cd8f0acae34 ("coredump: ensure that SIGKILL always kills the dumping thread") it has been possible for a SIGKILL received during a coredump to set SIGNAL_GROUP_EXIT and trigger a process shutdown (for a second time). Update the logic to explicitly allow coredumps so that coredumps can set SIGNAL_GROUP_EXIT and shutdown like an ordinary process. Link: https://lkml.kernel.org/r/87zgo6ytyf.fsf_-_@email.froward.int.ebiederm.org Signed-off-by: "Eric W. Biederman" commit a0287db0f1d6918919203ba31fd7cda59bf889e8 Author: Eric W. Biederman Date: Sat Jan 8 09:34:50 2022 -0600 signal: Have prepare_signal detect coredumps using signal->core_state In preparation for removing the flag SIGNAL_GROUP_COREDUMP, change prepare_signal to test signal->core_state instead of the flag SIGNAL_GROUP_COREDUMP. Both fields are protected by siglock and both live in signal_struct so there are no real tradeoffs here, just a change to which field is being tested. Link: https://lkml.kernel.org/r/20211213225350.27481-1-ebiederm@xmission.com Link: https://lkml.kernel.org/r/875yqu14co.fsf_-_@email.froward.int.ebiederm.org Signed-off-by: "Eric W. Biederman" commit 98b24b16b2aebffabf5b8670f44f19666c1e029f Author: Eric W. Biederman Date: Fri Nov 19 11:29:48 2021 -0600 signal: Have the oom killer detect coredumps using signal->core_state In preparation for removing the flag SIGNAL_GROUP_COREDUMP, change __task_will_free_mem to test signal->core_state instead of the flag SIGNAL_GROUP_COREDUMP. Both fields are protected by siglock and both live in signal_struct so there are no real tradeoffs here, just a change to which field is being tested. Link: https://lkml.kernel.org/r/20211213225350.27481-3-ebiederm@xmission.com Signed-off-by: "Eric W. Biederman" commit bbd0ff07ed12fda9dbd0cc5f239bb678a775833a Author: Rob Herring Date: Thu Jan 6 12:25:10 2022 -0600 dt-bindings: dma-controller: Split interrupt fields in example Best practice for multi-cell property values is to bracket each multi-cell value. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220106182518.1435497-2-robh@kernel.org Signed-off-by: Vinod Koul commit de77c3a5b95c95a4915142071643d94e3e1ada35 Author: Eric W. Biederman Date: Fri Jan 7 12:18:12 2022 -0600 exit: Move force_uaccess back into do_exit With kernel threads on architectures that still have set_fs/get_fs running as KERNEL_DS moving force_uaccess_begin does not appear safe. Calling force_uaccess_begin is a noop on anything people care about. Update the comment to explain why this code while looking like an obvious candidate for moving to make_task_dead probably needs to remain in do_exit until set_fs/get_fs are entirely removed from the kernel. Fixes: 05ea0424f0e2 ("exit: Move oops specific logic from do_exit into make_task_dead") Suggested-by: Al Viro Link: https://lkml.kernel.org/r/YdUxGKRcSiDy8jGg@zeniv-ca.linux.org.uk Signed-off-by: "Eric W. Biederman" commit 912616f142bfeb1dc41f40dbe7ce38331886a94a Author: Eric W. Biederman Date: Wed Jan 5 16:30:21 2022 -0600 exit: Guarantee make_task_dead leaks the tsk when calling do_task_exit Change the task state to EXIT_DEAD and take an extra rcu_refernce to guarantee the task will not be reaped and that it will not be freed. Link: https://lkml.kernel.org/r/YdUzjrLAlRiNLQp2@zeniv-ca.linux.org.uk Pointed-out-by: Al Viro Fixes: 7f80a2fd7db9 ("exit: Stop poorly open coding do_task_dead in make_task_dead") Signed-off-by: "Eric W. Biederman" commit 64aa8f4b6df107f46b6ac3e5331819824626b0af Author: Christophe JAILLET Date: Thu Jan 6 22:52:10 2022 +0100 dmaengine: pch_dma: 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. It can be found in [3]. [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/ [3]: https://lore.kernel.org/kernel-janitors/20200716192821.321233-1-christophe.jaillet@wanadoo.fr/ Signed-off-by: Christophe JAILLET Reviewed-by: Arnd Bergmann Link: https://lore.kernel.org/r/b88f25f3d07be92dd75494dc129a85619afb1366.1641500561.git.christophe.jaillet@wanadoo.fr Signed-off-by: Vinod Koul commit 85be9ae7b63092895b6e7ac87a3ef383c679866c Author: Eric W. Biederman Date: Wed Jan 5 14:59:48 2022 -0600 exit/xtensa: In arch/xtensa/entry.S:Linvalid_mask call make_task_dead There have historically been two big uses of do_exit. The first is it's design use to be the guts of the exit(2) system call. The second use is to terminate a task after something catastrophic has happened like a NULL pointer in kernel code. The function make_task_dead has been added to accomidate the second use. The call to do_exit in Linvalidmask is clearly not a normal userspace exit. As failure handling there are two possible ways to go. If userspace can trigger the issue force_exit_sig should be called. Otherwise make_task_dead probably from the implementation of die is appropriate. Replace the call of do_exit in Linvalidmask with make_task_dead as I don't know xtensa and especially xtensa assembly language well enough to do anything else. Link: https://lkml.kernel.org/r/YdUmN7n4W5YETUhW@zeniv-ca.linux.org.uk Suggested-by: Al Viro Signed-off-by: "Eric W. Biederman" commit 0704a8586f75663cf30a283bbeeca09eb4e60a07 Author: Greg Kroah-Hartman Date: Thu Jan 6 10:54:01 2022 +0100 s390/dasd: use default_groups in kobj_type There are currently 2 ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the s390 dasd sysfs code to use default_groups field which has been the preferred way since commit aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field. Cc: Stefan Haberland Cc: Jan Hoeppner Cc: Vasily Gorbik Cc: Christian Borntraeger Cc: Alexander Gordeev Signed-off-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20220106095401.3274637-1-gregkh@linuxfoundation.org Signed-off-by: Heiko Carstens commit 1350f36d3825e8f9563bbffb047d6ee634949667 Author: Greg Kroah-Hartman Date: Thu Jan 6 10:52:52 2022 +0100 s390/sclp_sd: use default_groups in kobj_type There are currently 2 ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the sclp_sd sysfs code to use default_groups field which has been the preferred way since commit aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field. Cc: Vasily Gorbik Cc: Christian Borntraeger Cc: Alexander Gordeev Cc: Peter Oberparleiter Signed-off-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20220106095252.3273905-1-gregkh@linuxfoundation.org Signed-off-by: Heiko Carstens commit 3367d1bd738c01b2737eaab7d922bfe5f1a41f38 Author: Thomas Weißschuh Date: Sat Jan 8 16:31:58 2022 +0100 power: supply: Provide stubs for charge_behaviour helpers When CONFIG_SYSFS is not enabled provide stubs for the helper functions to not break their callers. Fixes: 539b9c94ac83 ("power: supply: add helpers for charge_behaviour sysfs") Reported-by: kernel test robot Signed-off-by: Thomas Weißschuh Link: https://lore.kernel.org/r/20220108153158.189489-1-linux@weissschuh.net Signed-off-by: Hans de Goede commit 02fb09459435add44bb00191ce9b040c6b4f3aae Author: Hans de Goede Date: Sat Jan 8 16:49:47 2022 +0100 platform/x86: x86-android-tablets: Fix GPIO lookup leak on error-exit Fix leaking the registered gpiod_lookup tables when the kcalloc() for the i2c_clients array fails. Fixes: ef2ac11493e2 ("platform/x86: x86-android-tablets: Add support for registering GPIO lookup tables") Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220108154947.136593-1-hdegoede@redhat.com commit 62ac88a7b4619627ad2fc87f9910d63664805e85 Author: Daniel Scally Date: Thu Jan 6 23:20:45 2022 +0000 platform/x86: int3472: Add board data for Surface Go 3 The Surface Go 3 needs some board data in order to configure the TPS68470 PMIC - add entries to the tables in tps68470_board_data.c that define the configuration that's needed. Signed-off-by: Daniel Scally Link: https://lore.kernel.org/r/20220106232045.41291-1-djrscally@gmail.com Signed-off-by: Hans de Goede commit 751971af2e3615dc5bd12674080bc795505fefeb Author: Nathan Chancellor Date: Mon Dec 27 11:48:51 2021 -0700 csky: Fix function name in csky_alignment() and die() When building ARCH=csky defconfig: arch/csky/kernel/traps.c: In function 'die': arch/csky/kernel/traps.c:112:17: error: implicit declaration of function 'make_dead_task' [-Werror=implicit-function-declaration] 112 | make_dead_task(SIGSEGV); | ^~~~~~~~~~~~~~ The function's name is make_task_dead(), change it so there is no more build error. Fixes: 0e25498f8cd4 ("exit: Add and use make_task_dead.") Signed-off-by: Nathan Chancellor Reviewed-by: Guo Ren Link: https://lkml.kernel.org/r/20211227184851.2297759-4-nathan@kernel.org Signed-off-by: Eric W. Biederman commit ab4ababdf77ccc56c7301c751dff49c79709c51c Author: Nathan Chancellor Date: Mon Dec 27 11:48:50 2021 -0700 h8300: Fix build errors from do_exit() to make_task_dead() transition When building ARCH=h8300 defconfig: arch/h8300/kernel/traps.c: In function 'die': arch/h8300/kernel/traps.c:109:2: error: implicit declaration of function 'make_dead_task' [-Werror=implicit-function-declaration] 109 | make_dead_task(SIGSEGV); | ^~~~~~~~~~~~~~ arch/h8300/mm/fault.c: In function 'do_page_fault': arch/h8300/mm/fault.c:54:2: error: implicit declaration of function 'make_dead_task' [-Werror=implicit-function-declaration] 54 | make_dead_task(SIGKILL); | ^~~~~~~~~~~~~~ The function's name is make_task_dead(), change it so there is no more build error. Additionally, include linux/sched/task.h in arch/h8300/kernel/traps.c to avoid the same error because do_exit()'s declaration is in kernel.h but make_task_dead()'s is in task.h, which is not included in traps.c. Fixes: 0e25498f8cd4 ("exit: Add and use make_task_dead.") Signed-off-by: Nathan Chancellor Link: https://lkml.kernel.org/r/20211227184851.2297759-3-nathan@kernel.org Signed-off-by: Eric W. Biederman commit 4f0712ccec09c071e221242a2db9a6779a55a949 Author: Nathan Chancellor Date: Mon Dec 27 11:48:49 2021 -0700 hexagon: Fix function name in die() When building ARCH=hexagon defconfig: arch/hexagon/kernel/traps.c:217:2: error: implicit declaration of function 'make_dead_task' [-Werror,-Wimplicit-function-declaration] make_dead_task(err); ^ The function's name is make_task_dead(), change it so there is no more build error. Fixes: 0e25498f8cd4 ("exit: Add and use make_task_dead.") Signed-off-by: Nathan Chancellor Link: https://lkml.kernel.org/r/20211227184851.2297759-2-nathan@kernel.org Signed-off-by: Eric W. Biederman commit e32cf5dfbe227b355776948b2c9b5691b84d1cbd Author: Eric W. Biederman Date: Wed Dec 22 22:10:09 2021 -0600 kthread: Generalize pf_io_worker so it can point to struct kthread The point of using set_child_tid to hold the kthread pointer was that it already did what is necessary. There are now restrictions on when set_child_tid can be initialized and when set_child_tid can be used in schedule_tail. Which indicates that continuing to use set_child_tid to hold the kthread pointer is a bad idea. Instead of continuing to use the set_child_tid field of task_struct generalize the pf_io_worker field of task_struct and use it to hold the kthread pointer. Rename pf_io_worker (which is a void * pointer) to worker_private so it can be used to store kthreads struct kthread pointer. Update the kthread code to store the kthread pointer in the worker_private field. Remove the places where set_child_tid had to be dealt with carefully because kthreads also used it. Link: https://lkml.kernel.org/r/CAHk-=wgtFAA9SbVYg0gR1tqPMC17-NYcs0GQkaYg1bGhh1uJQQ@mail.gmail.com Link: https://lkml.kernel.org/r/87a6grvqy8.fsf_-_@email.froward.int.ebiederm.org Suggested-by: Linus Torvalds Signed-off-by: "Eric W. Biederman" commit da17d6905d29ddcdc04b2fdc37ed8cf1e8437cc8 Author: Stephen Boyd Date: Fri Jan 7 11:42:32 2022 -0800 of/fdt: Don't worry about non-memory region overlap for no-map In commit 8a5a75e5e9e5 ("of/fdt: Make sure no-map does not remove already reserved regions") we returned -EBUSY when trying to mark regions as no-map when they intersect with reserved memory. The goal was to find bad no-map reserved memory DT nodes that would unmap the kernel text/data sections. The problem is the reserved memory check will still trigger if the DT has a /memreserve/ that completely subsumes the no-map memory carveouts in the reserved memory node _and_ that region is also not part of the memory reg property. For example in sc7180.dtsi we have the following reserved-memory and memory node: memory@80000000 { /* We expect the bootloader to fill in the size */ reg = <0 0x80000000 0 0>; }; smem_mem: memory@80900000 { reg = <0x0 0x80900000 0x0 0x200000>; no-map; }; and the memreserve filled in by the bootloader is /memreserve/ 0x80800000 0x400000; while the /memory node is transformed into memory@80000000 { /* The bootloader fills in the size, and adds another region */ reg = <0 0x80000000 0 0x00800000>, <0 0x80c00000 0 0x7f200000>; }; The smem region is doubly reserved via /memreserve/ and by not being part of the /memory reg property. This leads to the following warning printed at boot. OF: fdt: Reserved memory: failed to reserve memory for node 'memory@80900000': base 0x0000000080900000, size 2 MiB Otherwise nothing really goes wrong because the smem region is not going to be mapped by the kernel's direct linear mapping given that it isn't part of the memory node. Therefore, let's only consider this to be a problem if we're trying to mark a region as no-map and it is actually memory that we're intending to keep out of the kernel's direct mapping but it's already been reserved. Acked-by: Mike Rapoport Cc: Douglas Anderson Cc: Nicolas Boichat Cc: Quentin Perret Cc: Jan Kiszka Fixes: 8a5a75e5e9e5 ("of/fdt: Make sure no-map does not remove already reserved regions") Signed-off-by: Stephen Boyd Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220107194233.2793146-1-swboyd@chromium.org commit 2b35e9684d093569fd4743719bccdd7409eb9f8e Author: Yang Li Date: Fri Jan 7 08:28:26 2022 +0800 of: unittest: remove unneeded semicolon Eliminate the following coccicheck warning: ./drivers/of/unittest.c:1961:2-3: Unneeded semicolon Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220107002826.77939-1-yang.lee@linux.alibaba.com commit 5d05b811b5acb92fc581a7b328b36646c86f5ab9 Author: Baruch Siach Date: Thu Dec 30 18:31:53 2021 +0200 of: base: Improve argument length mismatch error The cells_name field of of_phandle_iterator might be NULL. Use the phandle name instead. With this change instead of: OF: /soc/pinctrl@1000000: (null) = 3 found 2 We get: OF: /soc/pinctrl@1000000: phandle pinctrl@1000000 needs 3, found 2 Which is a more helpful messages making DT debugging easier. In this particular example the phandle name looks like duplicate of the same node name. But note that the first node is the parent node (it->parent), while the second is the phandle target (it->node). They happen to be the same in the case that triggered this improvement. See commit 72cb4c48a46a ("arm64: dts: qcom: ipq6018: Fix gpio-ranges property"). Signed-off-by: Baruch Siach Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/f6a68e0088a552ea9dfd4d8e3b5b586d92594738.1640881913.git.baruch@tkos.co.il commit cbb4f5f435995a56ef770e35bfafb4bcff8f0ada Author: Pavel Hofman Date: Sat Jan 8 11:56:08 2022 +0100 docs: ABI: fixed formatting in configfs-usb-gadget-uac2 Added missing tab, line breaks. Fixes: e3088ebc1b97 ("docs: ABI: added missing num_requests param to UAC2") Reported-by: Stephen Rothwell Signed-off-by: Pavel Hofman Link: https://lore.kernel.org/r/20220108105608.10726-1-pavel.hofman@ivitera.com Signed-off-by: Greg Kroah-Hartman commit 94a4950a4acff39b5847cc1fee4f65e160813493 Author: Baruch Siach Date: Thu Dec 30 18:31:52 2021 +0200 of: base: Fix phandle argument length mismatch error message The cell_count field of of_phandle_iterator is the number of cells we expect in the phandle arguments list when cells_name is missing. The error message should show the number of cells we actually see. Fixes: af3be70a3211 ("of: Improve of_phandle_iterator_next() error message") Cc: Florian Fainelli Signed-off-by: Baruch Siach Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/96519ac55be90a63fa44afe01480c30d08535465.1640881913.git.baruch@tkos.co.il commit 0422fe2666aea4c0986f4c89dc107731aa6a7a81 Merge: 4b3ddc6462e83 d1587f7bfe9a0 Author: Ingo Molnar Date: Sat Jan 8 10:53:57 2022 +0100 Merge branch 'linus' into irq/core, to fix conflict Conflicts: drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c Signed-off-by: Ingo Molnar commit c199d5d0a79d4eb11623e0eb645b27d271f8d713 Author: Miguel Ojeda Date: Fri Dec 31 20:59:25 2021 +0100 doc: kbuild: fix default in `imply` table `BAZ` takes `FOO`'s value as default (as far as `BAR` allows it). Signed-off-by: Miguel Ojeda Signed-off-by: Masahiro Yamada commit c0ee9bba55e1fda8ca22a2ac714d54737def50d4 Author: Masahiro Yamada Date: Tue Dec 14 11:53:55 2021 +0900 microblaze: use built-in function to get CPU_{MAJOR,MINOR,REV} Use built-in functions instead of shell commands to avoid forking processes. Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier commit 340a02535ee785c64c62a9c45706597a0139e972 Author: Masahiro Yamada Date: Tue Dec 14 11:53:54 2021 +0900 certs: move scripts/extract-cert to certs/ extract-cert is only used in certs/Makefile. Move it there and build extract-cert on demand. Signed-off-by: Masahiro Yamada commit 129ab0d2d9f38b9d43df35235fc66c6740d6928b Author: Masahiro Yamada Date: Tue Dec 14 11:53:53 2021 +0900 kbuild: do not quote string values in include/config/auto.conf The previous commit fixed up all shell scripts to not include include/config/auto.conf. Now that include/config/auto.conf is only included by Makefiles, we can change it into a more Make-friendly form. Previously, Kconfig output string values enclosed with double-quotes (both in the .config and include/config/auto.conf): CONFIG_X="foo bar" Unlike shell, Make handles double-quotes (and single-quotes as well) verbatim. We must rip them off when used. There are some patterns: [1] $(patsubst "%",%,$(CONFIG_X)) [2] $(CONFIG_X:"%"=%) [3] $(subst ",,$(CONFIG_X)) [4] $(shell echo $(CONFIG_X)) These are not only ugly, but also fragile. [1] and [2] do not work if the value contains spaces, like CONFIG_X=" foo bar " [3] does not work correctly if the value contains double-quotes like CONFIG_X="foo\"bar" [4] seems to work better, but has a cost of forking a process. Anyway, quoted strings were always PITA for our Makefiles. This commit changes Kconfig to stop quoting in include/config/auto.conf. These are the string type symbols referenced in Makefiles or scripts: ACPI_CUSTOM_DSDT_FILE ARC_BUILTIN_DTB_NAME ARC_TUNE_MCPU BUILTIN_DTB_SOURCE CC_IMPLICIT_FALLTHROUGH CC_VERSION_TEXT CFG80211_EXTRA_REGDB_KEYDIR EXTRA_FIRMWARE EXTRA_FIRMWARE_DIR EXTRA_TARGETS H8300_BUILTIN_DTB INITRAMFS_SOURCE LOCALVERSION MODULE_SIG_HASH MODULE_SIG_KEY NDS32_BUILTIN_DTB NIOS2_DTB_SOURCE OPENRISC_BUILTIN_DTB SOC_CANAAN_K210_DTB_SOURCE SYSTEM_BLACKLIST_HASH_LIST SYSTEM_REVOCATION_KEYS SYSTEM_TRUSTED_KEYS TARGET_CPU UNUSED_KSYMS_WHITELIST XILINX_MICROBLAZE0_FAMILY XILINX_MICROBLAZE0_HW_VER XTENSA_VARIANT_NAME I checked them one by one, and fixed up the code where necessary. Signed-off-by: Masahiro Yamada commit 7d153696e5db1e37387c2f7ec06ffc8d4aac70a4 Author: Masahiro Yamada Date: Tue Dec 14 11:53:52 2021 +0900 kbuild: do not include include/config/auto.conf from shell scripts Richard Weinberger pointed out the risk of sourcing the kernel config from shell scripts [1], and proposed some patches [2], [3]. It is a good point, but it took a long time because I was wondering how to fix this. This commit goes with simple grep approach because there are only a few scripts including the kernel configuration. scripts/link_vmlinux.sh has references to a bunch of CONFIG options, all of which are boolean. I added is_enabled() helper as scripts/package/{mkdebian,builddeb} do. scripts/gen_autoksyms.sh uses 'eval', stating "to expand the whitelist path". I removed it since it is the issue we are trying to fix. I was a bit worried about the cost of invoking the grep command over again. I extracted the grep parts from it, and measured the cost. It was approximately 0.03 sec, which I hope is acceptable. [test code] $ cat test-grep.sh #!/bin/sh is_enabled() { grep -q "^$1=y" include/config/auto.conf } is_enabled CONFIG_LTO_CLANG is_enabled CONFIG_LTO_CLANG is_enabled CONFIG_STACK_VALIDATION is_enabled CONFIG_UNWINDER_ORC is_enabled CONFIG_FTRACE_MCOUNT_USE_OBJTOOL is_enabled CONFIG_VMLINUX_VALIDATION is_enabled CONFIG_FRAME_POINTER is_enabled CONFIG_GCOV_KERNEL is_enabled CONFIG_LTO_CLANG is_enabled CONFIG_RETPOLINE is_enabled CONFIG_X86_SMAP is_enabled CONFIG_LTO_CLANG is_enabled CONFIG_VMLINUX_MAP is_enabled CONFIG_KALLSYMS_ALL is_enabled CONFIG_KALLSYMS_ABSOLUTE_PERCPU is_enabled CONFIG_KALLSYMS_BASE_RELATIVE is_enabled CONFIG_DEBUG_INFO_BTF is_enabled CONFIG_KALLSYMS is_enabled CONFIG_DEBUG_INFO_BTF is_enabled CONFIG_BPF is_enabled CONFIG_BUILDTIME_TABLE_SORT is_enabled CONFIG_KALLSYMS $ time ./test-grep.sh real 0m0.036s user 0m0.027s sys m0.009s [1]: https://lore.kernel.org/all/1919455.eZKeABUfgV@blindfold/ [2]: https://lore.kernel.org/all/20180219092245.26404-1-richard@nod.at/ [3]: https://lore.kernel.org/all/20210920213957.1064-2-richard@nod.at/ Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier commit b8c96a6b466ca3b91530a4ec7f7404f40f8f4d0b Author: Masahiro Yamada Date: Tue Dec 14 11:53:51 2021 +0900 certs: simplify $(srctree)/ handling and remove config_filename macro The complex macro, config_filename, was introduced to do: [1] drop double-quotes from the string value [2] add $(srctree)/ prefix in case the file is not found in $(objtree) [3] escape spaces and more [1] will be more generally handled by Kconfig later. As for [2], Kbuild uses VPATH to search for files in $(objtree), $(srctree) in this order. GNU Make can natively handle it. As for [3], converting $(space) to $(space_escape) back and forth looks questionable to me. It is well-known that GNU Make cannot handle file paths with spaces in the first place. Instead of using the complex macro, use $< so it will be expanded to the file path of the key. Remove config_filename, finally. Signed-off-by: Masahiro Yamada commit 4db9c2e3d055cc11e64b5c9bbaa70b5a552adf0f Author: Masahiro Yamada Date: Tue Dec 14 11:53:50 2021 +0900 kbuild: stop using config_filename in scripts/Makefile.modsign Toward the goal of removing the config_filename macro, drop the double-quotes and add $(srctree)/ prefix in an ad hoc way. Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier commit 5410f3e810f64366ada353efa5e7559be040fb71 Author: Masahiro Yamada Date: Tue Dec 14 11:53:49 2021 +0900 certs: remove misleading comments about GCC PR This dependency is necessary irrespective of the mentioned GCC PR because the embedded certificates are build artifacts and must be generated by extract_certs before *.S files are compiled. The comment sounds like we are hoping to remove these dependencies someday. No, we cannot remove them. Signed-off-by: Masahiro Yamada commit 5cca36069d4c2942a46f98f47b9e7160fd547e03 Author: Masahiro Yamada Date: Tue Dec 14 11:53:48 2021 +0900 certs: refactor file cleaning 'make clean' removes files listed in 'targets'. It is redundant to specify both 'targets' and 'clean-files'. Move 'targets' assignments out of the ifeq-conditionals so scripts/Makefile.clean can see them. One effective change is that certs/certs/signing_key.x509 is now deleted by 'make clean' instead of 'make mrproper. This certificate is embedded in the kernel. It is not used in any way by external module builds. Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier commit 3958f2156b418c9dce0a4402a59d95b122a92a04 Author: Masahiro Yamada Date: Tue Dec 14 11:53:47 2021 +0900 certs: remove unneeded -I$(srctree) option for system_certificates.o The .incbin directive in certs/system_certificates.S includes certs/signing_key.x509 and certs/x509_certificate_list, both of which are generated by extract_certs, i.e. exist in $(objtree). This option -I$(srctree) is unneeded. Signed-off-by: Masahiro Yamada commit 1c4bd9f77a1c1b8502ca929fdbe2ef45bfebd09a Author: Masahiro Yamada Date: Tue Dec 14 11:53:46 2021 +0900 certs: unify duplicated cmd_extract_certs and improve the log cmd_extract_certs is defined twice. Unify them. The current log shows the input file $(2), which might be empty. You cannot know what is being created from the log, "EXTRACT_CERTS". Change the log to show the output file with better alignment. [Before] EXTRACT_CERTS certs/signing_key.pem CC certs/system_keyring.o EXTRACT_CERTS AS certs/system_certificates.o CC certs/common.o CC certs/blacklist.o EXTRACT_CERTS AS certs/revocation_certificates.o [After] CERT certs/signing_key.x509 CC certs/system_keyring.o CERT certs/x509_certificate_list AS certs/system_certificates.o CC certs/common.o CC certs/blacklist.o CERT certs/x509_revocation_list AS certs/revocation_certificates.o Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier commit c537e4d04eb75274bf03e6a2a8d6ece25d9d16f6 Author: Masahiro Yamada Date: Tue Dec 14 11:53:45 2021 +0900 certs: use $< and $@ to simplify the key generation rule Do not repeat $(obj)/x509.genkey or $(obj)/signing_key.pem Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier commit 4fbce819337a6705559788ff7e9583a4703edcb7 Author: Masahiro Yamada Date: Mon Dec 6 11:35:07 2021 +0900 kbuild: remove headers_check stub Linux 5.15 is out. Remove this stub now. Signed-off-by: Masahiro Yamada Reviewed-by: Nick Desaulniers commit 50a483405c420f5f35b8dbb71425459835ae44eb Author: Masahiro Yamada Date: Mon Dec 6 11:35:06 2021 +0900 kbuild: move headers_check.pl to usr/include/ This script is only used by usr/include/Makefile. Make it local to the directory. Update the comment in include/uapi/linux/soundcard.h because 'make headers_check' is no longer functional. Signed-off-by: Masahiro Yamada commit 3e4518035a23e02ef818ea22570868a82956c6b0 Author: Takashi Iwai Date: Fri Jan 7 10:26:47 2022 +0100 ALSA: hda: Fix dependency on ASoC cs35l41 codec The recently added support for CS35L41 codec unconditionally selects CONFIG_SND_SOC_CS35L41_LIB, but this can't work unless the top-level CONFIG_SND_SOC is enabled. This patch adds the proper dependency. Fixes: 7b2f3eb492da ("ALSA: hda: cs35l41: Add support for CS35L41 in HDA systems") Link: https://lore.kernel.org/r/20220107092647.20258-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 6b24ca4a1a8d4ee3221d6d44ddbb99f542e4bda3 Author: Matthew Wilcox (Oracle) Date: Sat Jun 27 22:19:08 2020 -0400 mm: Use multi-index entries in the page cache We currently store large folios as 2^N consecutive entries. While this consumes rather more memory than necessary, it also turns out to be buggy. A writeback operation which starts within a tail page of a dirty folio will not write back the folio as the xarray's dirty bit is only set on the head index. With multi-index entries, the dirty bit will be found no matter where in the folio the operation starts. This does end up simplifying the page cache slightly, although not as much as I had hoped. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: William Kucharski commit 25a8de7f8d970ffa7263bd9d32a08138cd949f17 Author: Matthew Wilcox (Oracle) Date: Fri Aug 27 07:21:49 2021 -0400 XArray: Add xas_advance() Add a new helper function to help iterate over multi-index entries. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski commit b9a8a4195c7d3a51235a4fc974a46ad4e9689ffd Author: Matthew Wilcox (Oracle) Date: Wed May 27 17:59:22 2020 -0400 truncate,shmem: Handle truncates that split large folios Handle folio splitting in the parts of the truncation functions which already handle partial pages. Factor all that code out into a new function called truncate_inode_partial_folio(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Jan Kara Reviewed-by: William Kucharski commit f6357c3a9d3ea5a00c5bf52845b633d649da6722 Author: Matthew Wilcox (Oracle) Date: Thu May 20 08:17:44 2021 -0400 truncate: Convert invalidate_inode_pages2_range to folios If we're going to unmap a folio, we have to be sure to unmap the entire folio, not just the part of it which lies after the search index. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski commit 338f379cf7c21e3bc31186f303ac99dc5d2cc613 Author: Matthew Wilcox (Oracle) Date: Mon Dec 14 07:57:07 2020 -0500 fs: Convert vfs_dedupe_file_range_compare to folios We still only operate on a single page of data at a time due to using kmap(). A more complex implementation would work on each page in a folio, but it's not clear that such a complex implementation would be worthwhile. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski commit 1613fac9aaf840af76faa747ea428a714af98dbd Author: Matthew Wilcox (Oracle) Date: Tue Dec 7 14:28:49 2021 -0500 mm: Remove pagevec_remove_exceptionals() All of its callers now call folio_batch_remove_exceptionals(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski commit 51dcbdac28d4dde915f78adf08bb3fac87f516e9 Author: Matthew Wilcox (Oracle) Date: Tue Dec 7 14:15:07 2021 -0500 mm: Convert find_lock_entries() to use a folio_batch find_lock_entries() already only returned the head page of folios, so convert it to return a folio_batch instead of a pagevec. That cascades through converting truncate_inode_pages_range() to delete_from_page_cache_batch() and page_cache_delete_batch(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski commit 0e499ed3d7a216706e02eeded562627d3e69dcfd Author: Matthew Wilcox (Oracle) Date: Tue Sep 1 23:17:50 2020 -0400 filemap: Return only folios from find_get_entries() The callers have all been converted to work on folios, so convert find_get_entries() to return a batch of folios instead of pages. We also now return multiple large folios in a single call. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Jan Kara Reviewed-by: William Kucharski Reviewed-by: Christoph Hellwig commit 25d6a23e8d280861dfe81193e18143afb2c0d777 Author: Matthew Wilcox (Oracle) Date: Mon Dec 6 15:25:33 2021 -0500 filemap: Convert filemap_get_read_batch() to use a folio_batch This change ripples all the way through the filemap_read() call chain and removes a lot of messing about converting folios to pages and back again. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski commit d996fc7f615feb5986f67829e18a8d8400f41361 Author: Matthew Wilcox (Oracle) Date: Sun Oct 31 22:22:19 2021 -0400 filemap: Convert filemap_read() to use a folio We know the pagevec always contains folios, but use page_folio() anyway instead of casting. Removes a few calls to legacy functions. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski commit 78f426608f21c997975adb96641b7ac82d4d15b1 Author: Matthew Wilcox (Oracle) Date: Wed Jul 28 15:52:34 2021 -0400 truncate: Add invalidate_complete_folio2() Convert invalidate_complete_page2() to invalidate_complete_folio2(). Use filemap_free_folio() to free the page instead of calling ->freepage manually. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski commit fae9bc4a90176868cbbbecc693acb0ff2607818d Author: Matthew Wilcox (Oracle) Date: Thu Dec 2 23:25:01 2021 -0500 truncate: Convert invalidate_inode_pages2_range() to use a folio If we're going to unmap a folio, we have to be sure to unmap the entire folio, not just the part of it which lies after the search index. We cannot yet remove the struct page from invalidate_inode_pages2_range() because the page pointer in the pvec might be a shadow/dax/swap entry instead of actually a page. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski commit ccbbf761d440b0d5afcbf232db37435dc38d6161 Author: Matthew Wilcox (Oracle) Date: Fri Nov 26 13:25:38 2021 -0500 truncate: Skip known-truncated indices If we've truncated an entire folio, we can skip over all the indices covered by this folio. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski commit 1e84a3d997b74c33491899e31d48774f252213ab Author: Matthew Wilcox (Oracle) Date: Thu Dec 2 16:01:55 2021 -0500 truncate,shmem: Add truncate_inode_folio() Convert all callers of truncate_inode_page() to call truncate_inode_folio() instead, and move the declaration to mm/internal.h. Move the assertion that the caller is not passing in a tail page to generic_error_remove_page(). We can't entirely remove the struct page from the callers yet because the page pointer in the pvec might be a shadow/dax/swap entry instead of actually a page. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski commit 7b774aab7941e195d3130caa856da6904333988b Author: Matthew Wilcox (Oracle) Date: Fri Dec 3 08:50:01 2021 -0500 shmem: Convert part of shmem_undo_range() to use a folio find_lock_entries() never returns tail pages. We cannot use page_folio() here as the pagevec may also contain swap entries, so simply cast for now. This is an intermediate step which will be fully removed by the end of this series. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski commit 3506659e18a61ae525f3b9b4f5af23b4b149d4db Author: Matthew Wilcox (Oracle) Date: Sun Nov 28 14:53:35 2021 -0500 mm: Add unmap_mapping_folio() Convert both callers of unmap_mapping_page() to call unmap_mapping_folio() instead. Also move zap_details from linux/mm.h to mm/memory.c Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: William Kucharski commit 6dc701ee9fabfc929cae2d7acc957bf38e4c3264 Author: Sven Peter Date: Sat Dec 11 13:36:32 2021 +0100 MAINTAINERS: Add Apple watchdog to ARM/APPLE MACHINE SUPPORT Add apple_wdt.c under the ARM/APPLE MACHINE SUPPORT entry. Signed-off-by: Sven Peter Signed-off-by: Hector Martin commit 82192cb497f9eca6c0d44dbc173e68d59ea2f3c9 Merge: bf44077c1b3ae 9fe890cc5bb84 Author: Jakub Kicinski Date: Fri Jan 7 19:25:57 2022 -0800 Merge branch 'ena-capabilities-field-and-cosmetic-changes' Arthur Kiyanovski says: ==================== ENA: capabilities field and cosmetic changes Add a new capabilities bitmask field to get indication of capabilities supported by the device. Use the capabilities field to query the device for ENI stats support. Other patches are cosmetic changes like fixing readme mistakes, removing unused variables etc... ==================== Link: https://lore.kernel.org/r/20220107202346.3522-1-akiyano@amazon.com Signed-off-by: Jakub Kicinski commit 9fe890cc5bb84d6859d9a2422830b7fd6fd20521 Author: Arthur Kiyanovski Date: Fri Jan 7 20:23:46 2022 +0000 net: ena: Extract recurring driver reset code into a function Create an inline function for resetting the driver to reduce code duplication. Signed-off-by: Nati Koler Signed-off-by: Arthur Kiyanovski Signed-off-by: Jakub Kicinski commit d0e8831d6c93b030bc757b89aec4dc304d6e55b6 Author: Arthur Kiyanovski Date: Fri Jan 7 20:23:45 2022 +0000 net: ena: Change the name of bad_csum variable Changed bad_csum to csum_bad to align with csum_unchecked & csum_good Signed-off-by: Nati Koler Signed-off-by: Arthur Kiyanovski Signed-off-by: Jakub Kicinski commit 9b648bb1d89ef058196cff4fe3bd678ab7ebdb19 Author: Arthur Kiyanovski Date: Fri Jan 7 20:23:44 2022 +0000 net: ena: Add debug prints for invalid req_id resets Add qid and req_id to error prints when ENA_REGS_RESET_INV_TX_REQ_ID reset occurs. Switch from %hu to %u, since u16 should be printed with %u, as explained in [1]. [1] - https://www.kernel.org/doc/html/latest/core-api/printk-formats.html Signed-off-by: Arthur Kiyanovski Signed-off-by: Jakub Kicinski commit c215941abacff64b686004731d42e68dcda5b8d8 Author: Arthur Kiyanovski Date: Fri Jan 7 20:23:43 2022 +0000 net: ena: Remove ena_calc_queue_size_ctx struct This struct was used to pass data from callee function to its caller. Its usage can be avoided. Removing it results in less code without any damage to code readability. Also it allows to consolidate ring size calculation into a single function (ena_calc_io_queue_size()). Signed-off-by: Shay Agroskin Signed-off-by: Arthur Kiyanovski Signed-off-by: Jakub Kicinski commit e3445469803387ce4940fdb30081498104c57abf Author: Arthur Kiyanovski Date: Fri Jan 7 20:23:42 2022 +0000 net: ena: Move reset completion print to the reset function The print that indicates that device reset has finished is currently called from ena_restore_device(). Move it to ena_fw_reset_device() as it is the more natural location for it. Signed-off-by: Shay Agroskin Signed-off-by: Arthur Kiyanovski Signed-off-by: Jakub Kicinski commit 09f8676eae1d20f840c418503001d29d1ecaa584 Author: Arthur Kiyanovski Date: Fri Jan 7 20:23:41 2022 +0000 net: ena: Remove redundant return code check The ena_com_indirect_table_fill_entry() function only returns -EINVAL or 0, no need to check for -EOPNOTSUPP. Signed-off-by: Shay Agroskin Signed-off-by: Arthur Kiyanovski Signed-off-by: Jakub Kicinski commit 273a2397fc9157c04e904b6ae37f723aa910a0d1 Author: Arthur Kiyanovski Date: Fri Jan 7 20:23:40 2022 +0000 net: ena: Update LLQ header length in ena documentation LLQ entry length is 128 bytes. Therefore the maximum header in the entry is calculated by: tx_max_header_size = LLQ_ENTRY_SIZE - DESCRIPTORS_NUM_BEFORE_HEADER * 16 = 128 - 2 * 16 = 96 This patch updates the documentation so that it states the correct max header length. Signed-off-by: Shay Agroskin Signed-off-by: Arthur Kiyanovski Signed-off-by: Jakub Kicinski commit 394c48e08bbcbf4c235cd667adb8a826a49d3fd4 Author: Arthur Kiyanovski Date: Fri Jan 7 20:23:39 2022 +0000 net: ena: Change ENI stats support check to use capabilities field Use the capabilities field to query the device for ENI stats support. This replaces the previous method that tried to get the ENI stats during ena_probe() and used the success or failure as an indication for support by the device. Remove eni_stats_supported field from struct ena_adapter. This field was used for the previous method of queriying for ENI stats support. Change the severity level of the print in case of ena_com_get_eni_stats() failure from info to error. With the previous method of querying form ENI stats support, failure to get ENI stats was normal for devices that don't support it. With the use of the capabilities field such a failure is unexpected, as it is called only if the device reported that it supports ENI stats. Signed-off-by: Shay Agroskin Signed-off-by: Arthur Kiyanovski Signed-off-by: Jakub Kicinski commit a2d5d6a70fa5211e071747876fa6a7621c7257fd Author: Arthur Kiyanovski Date: Fri Jan 7 20:23:38 2022 +0000 net: ena: Add capabilities field with support for ENI stats capability This bitmask field indicates what capabilities are supported by the device. The capabilities field differs from the 'supported_features' field which indicates what sub-commands for the set/get feature commands are supported. The sub-commands are specified in the 'feature_id' field of the 'ena_admin_set_feat_cmd' struct in the following way: struct ena_admin_set_feat_cmd cmd; cmd.aq_common_descriptor.opcode = ENA_ADMIN_SET_FEATURE; cmd.feat_common.feature_ The 'capabilities' field, on the other hand, specifies different capabilities of the device. For example, whether the device supports querying of ENI stats. Also add an enumerator which contains all the capabilities. The first added capability macro is for ENI stats feature. Capabilities are queried along with the other device attributes (in ena_com_get_dev_attr_feat()) during device initialization and are stored in the ena_com_dev struct. They can be later queried using the ena_com_get_cap() helper function. Signed-off-by: Shay Agroskin Signed-off-by: Arthur Kiyanovski Signed-off-by: Jakub Kicinski commit 7dcf922152278a54acad15ce0b7864dc6baafd12 Author: Arthur Kiyanovski Date: Fri Jan 7 20:23:37 2022 +0000 net: ena: Change return value of ena_calc_io_queue_size() to void ena_calc_io_queue_size() always returns 0, therefore make it a void function and update the calling function to stop checking the return value. Signed-off-by: Shay Agroskin Signed-off-by: Arthur Kiyanovski Signed-off-by: Jakub Kicinski commit bf44077c1b3ae86668bce02d9466e7134a6569ec Author: Eric Dumazet Date: Fri Jan 7 10:39:53 2022 -0800 af_packet: fix tracking issues in packet_do_bind() It appears that my changes in packet_do_bind() were slightly wrong. syzbot found that calling bind() twice would trigger a false positive. Remove proto_curr/dev_curr variables and rewrite things to be less confusing (like not having to use netdev_tracker_alloc(), and instead use the standard dev_hold_track()) Fixes: f1d9268e0618 ("net: add net device refcount tracker to struct packet_type") Signed-off-by: Eric Dumazet Reported-by: syzbot Link: https://lore.kernel.org/r/20220107183953.3886647-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit 6dc9a23e29061e50c36523270de60039ccf536fa Author: Sunil Goutham Date: Fri Jan 7 12:25:05 2022 +0530 octeontx2-af: Fix interrupt name strings Fixed interrupt name string logic which currently results in wrong memory location being accessed while dumping /proc/interrupts. Fixes: 4826090719d4 ("octeontx2-af: Enable CPT HW interrupts") Signed-off-by: Sunil Goutham Signed-off-by: Subbaraya Sundeep Link: https://lore.kernel.org/r/1641538505-28367-1-git-send-email-sbhatta@marvell.com Signed-off-by: Jakub Kicinski commit d8caa2ed47de0e55828a3bd0a81bbb81aa9e7e11 Merge: 5cad43a52ee3c 8401e87f5a36d Author: Jakub Kicinski Date: Fri Jan 7 19:00:46 2022 -0800 Merge branch 'mptcp-refactoring-for-one-selftest-and-csum-validation' Mat Martineau says: ==================== mptcp: Refactoring for one selftest and csum validation Patch 1 changes the MPTCP join self tests to depend more on events rather than delays, so the script runs faster and has more consistent results. Patches 2 and 3 get rid of some duplicate code in MPTCP's checksum validation by modifying and leveraging an existing helper function. ==================== Link: https://lore.kernel.org/r/20220107192524.445137-1-mathew.j.martineau@linux.intel.com Signed-off-by: Jakub Kicinski commit 8401e87f5a36d370cbf1e9d4ba602a553ce9324a Author: Geliang Tang Date: Fri Jan 7 11:25:24 2022 -0800 mptcp: reuse __mptcp_make_csum in validate_data_csum This patch reused __mptcp_make_csum() in validate_data_csum() instead of open-coding. Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit c312ee219100e86143a1d3cc10b367bc43a0e0b8 Author: Geliang Tang Date: Fri Jan 7 11:25:23 2022 -0800 mptcp: change the parameter of __mptcp_make_csum This patch changed the type of the last parameter of __mptcp_make_csum() from __sum16 to __wsum. And export this function in protocol.h. Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 327b9a94e2a805dea5238940c9660ca367dbfdef Author: Paolo Abeni Date: Fri Jan 7 11:25:22 2022 -0800 selftests: mptcp: more stable join tests-cases MPTCP join self-tests are a bit fragile as they reply on delays instead of events to catch-up with the expected sockets states. Replace the delay with state checking where possible and reduce the number of sleeps in the most complex scenarios. This will both reduce the tests run-time and will improve stability. Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 5cad43a52ee3caf451cd645baa4beb53a1733dae Author: Vladimir Oltean Date: Fri Jan 7 16:42:29 2022 +0200 net: dsa: felix: add port fast age support Add support for flushing the MAC table on a given port in the ocelot switch library, and use this functionality in the felix DSA driver. This operation is needed when a port leaves a bridge to become standalone, and when the learning is disabled, and when the STP state changes to a state where no FDB entry should be present. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20220107144229.244584-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit a14e6b69f393d651913edcbe4ec0dec27b8b4b40 Author: Vladimir Oltean Date: Fri Jan 7 18:43:32 2022 +0200 net: mscc: ocelot: fix incorrect balancing with down LAG ports Assuming the test setup described here: https://patchwork.kernel.org/project/netdevbpf/cover/20210205130240.4072854-1-vladimir.oltean@nxp.com/ (swp1 and swp2 are in bond0, and bond0 is in a bridge with swp0) it can be seen that when swp1 goes down (on either board A or B), then traffic that should go through that port isn't forwarded anywhere. A dump of the PGID table shows the following: PGID_DST[0] = ports 0 PGID_DST[1] = ports 1 PGID_DST[2] = ports 2 PGID_DST[3] = ports 3 PGID_DST[4] = ports 4 PGID_DST[5] = ports 5 PGID_DST[6] = no ports PGID_AGGR[0] = ports 0, 1, 2, 3, 4, 5 PGID_AGGR[1] = ports 0, 1, 2, 3, 4, 5 PGID_AGGR[2] = ports 0, 1, 2, 3, 4, 5 PGID_AGGR[3] = ports 0, 1, 2, 3, 4, 5 PGID_AGGR[4] = ports 0, 1, 2, 3, 4, 5 PGID_AGGR[5] = ports 0, 1, 2, 3, 4, 5 PGID_AGGR[6] = ports 0, 1, 2, 3, 4, 5 PGID_AGGR[7] = ports 0, 1, 2, 3, 4, 5 PGID_AGGR[8] = ports 0, 1, 2, 3, 4, 5 PGID_AGGR[9] = ports 0, 1, 2, 3, 4, 5 PGID_AGGR[10] = ports 0, 1, 2, 3, 4, 5 PGID_AGGR[11] = ports 0, 1, 2, 3, 4, 5 PGID_AGGR[12] = ports 0, 1, 2, 3, 4, 5 PGID_AGGR[13] = ports 0, 1, 2, 3, 4, 5 PGID_AGGR[14] = ports 0, 1, 2, 3, 4, 5 PGID_AGGR[15] = ports 0, 1, 2, 3, 4, 5 PGID_SRC[0] = ports 1, 2 PGID_SRC[1] = ports 0 PGID_SRC[2] = ports 0 PGID_SRC[3] = no ports PGID_SRC[4] = no ports PGID_SRC[5] = no ports PGID_SRC[6] = ports 0, 1, 2, 3, 4, 5 Whereas a "good" PGID configuration for that setup should have looked like this: PGID_DST[0] = ports 0 PGID_DST[1] = ports 1, 2 PGID_DST[2] = ports 1, 2 PGID_DST[3] = ports 3 PGID_DST[4] = ports 4 PGID_DST[5] = ports 5 PGID_DST[6] = no ports PGID_AGGR[0] = ports 0, 2, 3, 4, 5 PGID_AGGR[1] = ports 0, 2, 3, 4, 5 PGID_AGGR[2] = ports 0, 2, 3, 4, 5 PGID_AGGR[3] = ports 0, 2, 3, 4, 5 PGID_AGGR[4] = ports 0, 2, 3, 4, 5 PGID_AGGR[5] = ports 0, 2, 3, 4, 5 PGID_AGGR[6] = ports 0, 2, 3, 4, 5 PGID_AGGR[7] = ports 0, 2, 3, 4, 5 PGID_AGGR[8] = ports 0, 2, 3, 4, 5 PGID_AGGR[9] = ports 0, 2, 3, 4, 5 PGID_AGGR[10] = ports 0, 2, 3, 4, 5 PGID_AGGR[11] = ports 0, 2, 3, 4, 5 PGID_AGGR[12] = ports 0, 2, 3, 4, 5 PGID_AGGR[13] = ports 0, 2, 3, 4, 5 PGID_AGGR[14] = ports 0, 2, 3, 4, 5 PGID_AGGR[15] = ports 0, 2, 3, 4, 5 PGID_SRC[0] = ports 1, 2 PGID_SRC[1] = ports 0 PGID_SRC[2] = ports 0 PGID_SRC[3] = no ports PGID_SRC[4] = no ports PGID_SRC[5] = no ports PGID_SRC[6] = ports 0, 1, 2, 3, 4, 5 In other words, in the "bad" configuration, the attempt is to remove the inactive swp1 from the destination ports via PGID_DST. But when a MAC table entry is learned, it is learned towards PGID_DST 1, because that is the logical port id of the LAG itself (it is equal to the lowest numbered member port). So when swp1 becomes inactive, if we set PGID_DST[1] to contain just swp1 and not swp2, the packet will not have any chance to reach the destination via swp2. The "correct" way to remove swp1 as a destination is via PGID_AGGR (remove swp1 from the aggregation port groups for all aggregation codes). This means that PGID_DST[1] and PGID_DST[2] must still contain both swp1 and swp2. This makes the MAC table still treat packets destined towards the single-port LAG as "multicast", and the inactive ports are removed via the aggregation code tables. The change presented here is a design one: the ocelot_get_bond_mask() function used to take an "only_active_ports" argument. We don't need that. The only call site that specifies only_active_ports=true, ocelot_set_aggr_pgids(), must retrieve the entire bonding mask, because it must program that into PGID_DST. Additionally, it must also clear the inactive ports from the bond mask here, which it can't do if bond_mask just contains the active ports: ac = ocelot_read_rix(ocelot, ANA_PGID_PGID, i); ac &= ~bond_mask; <---- here /* Don't do division by zero if there was no active * port. Just make all aggregation codes zero. */ if (num_active_ports) ac |= BIT(aggr_idx[i % num_active_ports]); ocelot_write_rix(ocelot, ac, ANA_PGID_PGID, i); So it becomes the responsibility of ocelot_set_aggr_pgids() to take ocelot_port->lag_tx_active into consideration when populating the aggr_idx array. Fixes: 23ca3b727ee6 ("net: mscc: ocelot: rebalance LAGs on link up/down events") Signed-off-by: Vladimir Oltean Link: https://lore.kernel.org/r/20220107164332.402133-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit a5e7d9bbc38eddd19a094191477fbd799c07b90b Merge: ffef737fd0372 5322c68e588dd Author: Jakub Kicinski Date: Fri Jan 7 18:51:46 2022 -0800 Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== 40GbE Intel Wired LAN Driver Updates 2022-01-07 This series contains updates to i40e and iavf drivers. Karen limits per VF MAC filters so that one VF does not consume all filters for i40e. Jedrzej reduces busy wait time for admin queue calls for i40e. Mateusz updates firmware versions to reflect new supported NVM images and renames an error to remove non-inclusive language for i40e. Yang Li fixes a set but not used warning for i40e. Jason Wang removes an unneeded variable for iavf. * '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue: iavf: remove an unneeded variable i40e: remove variables set but not used i40e: Remove non-inclusive language i40e: Update FW API version i40e: Minimize amount of busy-waiting during AQ send i40e: Add ensurance of MacVlan resources for every trusted VF ==================== Link: https://lore.kernel.org/r/20220107175704.438387-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit ccd36795be48956248dc308f4525c06c7f419d76 Author: Krzysztof Wilczyński Date: Fri Jan 7 22:59:42 2022 +0000 PCI: Correct misspelled words Fix a number of misspelled words, and while at it, correct two phrases used to indicate a status of an operation where words used have been cleverly truncated and thus always trigger a spellchecking error while performing a static code analysis over the PCI tree. [bhelgaas: reverse sense of quirk ternary] Link: https://lore.kernel.org/r/20220107225942.121484-1-kw@linux.com Signed-off-by: Krzysztof Wilczyński Signed-off-by: Bjorn Helgaas commit ffef737fd0372ca462b5be3e7a592a8929a82752 Author: Gal Pressman Date: Sun Jan 2 10:12:53 2022 +0200 net/tls: Fix skb memory leak when running kTLS traffic The cited Fixes commit introduced a memory leak when running kTLS traffic (with/without hardware offloads). I'm running nginx on the server side and wrk on the client side and get the following: unreferenced object 0xffff8881935e9b80 (size 224): comm "softirq", pid 0, jiffies 4294903611 (age 43.204s) hex dump (first 32 bytes): 80 9b d0 36 81 88 ff ff 00 00 00 00 00 00 00 00 ...6............ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<00000000efe2a999>] build_skb+0x1f/0x170 [<00000000ef521785>] mlx5e_skb_from_cqe_mpwrq_linear+0x2bc/0x610 [mlx5_core] [<00000000945d0ffe>] mlx5e_handle_rx_cqe_mpwrq+0x264/0x9e0 [mlx5_core] [<00000000cb675b06>] mlx5e_poll_rx_cq+0x3ad/0x17a0 [mlx5_core] [<0000000018aac6a9>] mlx5e_napi_poll+0x28c/0x1b60 [mlx5_core] [<000000001f3369d1>] __napi_poll+0x9f/0x560 [<00000000cfa11f72>] net_rx_action+0x357/0xa60 [<000000008653b8d7>] __do_softirq+0x282/0x94e [<00000000644923c6>] __irq_exit_rcu+0x11f/0x170 [<00000000d4085f8f>] irq_exit_rcu+0xa/0x20 [<00000000d412fef4>] common_interrupt+0x7d/0xa0 [<00000000bfb0cebc>] asm_common_interrupt+0x1e/0x40 [<00000000d80d0890>] default_idle+0x53/0x70 [<00000000f2b9780e>] default_idle_call+0x8c/0xd0 [<00000000c7659e15>] do_idle+0x394/0x450 I'm not familiar with these areas of the code, but I've added this sk_defer_free_flush() to tls_sw_recvmsg() based on a hunch and it resolved the issue. Fixes: f35f821935d8 ("tcp: defer skb freeing after socket lock is released") Signed-off-by: Gal Pressman Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/20220102081253.9123-1-gal@nvidia.com Signed-off-by: Jakub Kicinski commit bda487ac4bebf871255cc6f23e16f702cea0ca7c Author: Shyam Prasad N Date: Mon Oct 25 05:44:10 2021 +0000 cifs: avoid race during socket reconnect between send and recv When a TCP connection gets reestablished by the sender in cifs_reconnect, There is a chance for race condition with demultiplex thread waiting in cifs_readv_from_socket on the old socket. It will now return -ECONNRESET. This condition is handled by comparing socket pointer before and after sock_recvmsg. If the socket pointer has changed, we should not call cifs_reconnect again, but instead retry with new socket. Also fixed another bug in my prev mchan commits. We should always reestablish session (even if binding) on a channel that needs reconnection. Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit 73f9bfbe3d818bb52266d5c9f3ba57d97842ffe7 Author: Shyam Prasad N Date: Mon Jul 19 17:37:52 2021 +0000 cifs: maintain a state machine for tcp/smb/tcon sessions If functions like cifs_negotiate_protocol, cifs_setup_session, cifs_tree_connect are called in parallel on different channels, each of these will be execute the requests. This maybe unnecessary in some cases, and only the first caller may need to do the work. This is achieved by having more states for the tcp/smb/tcon session status fields. And tracking the state of reconnection based on the state machine. For example: for tcp connections: CifsNew/CifsNeedReconnect -> CifsNeedNegotiate -> CifsInNegotiate -> CifsNeedSessSetup -> CifsInSessSetup -> CifsGood for smb sessions: CifsNew/CifsNeedReconnect -> CifsGood for tcon: CifsNew/CifsNeedReconnect -> CifsInFilesInvalidate -> CifsNeedTcon -> CifsInTcon -> CifsGood If any channel reconnect sees that it's in the middle of transition to CifsGood, then they can skip the function. Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit 1913e1116a3174648cf2e6faedf29204f31cc438 Author: Enzo Matsumiya Date: Fri Jan 7 19:51:39 2022 -0300 cifs: fix hang on cifs_get_next_mid() Mount will hang if using SMB1 and DFS. This is because every call to get_next_mid() will, unconditionally, mark tcpStatus to CifsNeedReconnect before even establishing the initial connect, because "reconnect" variable was not initialized. Initializing "reconnect" to false fix this issue. Fixes: 220c5bc25d87 ("cifs: take cifs_tcp_ses_lock for status checks") Signed-off-by: Enzo Matsumiya Signed-off-by: Steve French commit 080dc5e5656c1cc1cdefb501b9b645a07519f763 Author: Shyam Prasad N Date: Mon Jul 19 17:05:53 2021 +0000 cifs: take cifs_tcp_ses_lock for status checks While checking/updating status for tcp ses, smb ses or tcon, we take GlobalMid_Lock. This doesn't make any sense. Replaced it with cifs_tcp_ses_lock. Ideally, we should take a spin lock per struct. But since tcp ses, smb ses and tcon objects won't add up to a lot, I think there should not be too much contention. Also, in few other places, these are checked without locking. Added locking for these. Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit 4e31bfa37662f72e8e7e3ae46eb5f845a5854229 Author: Nathan Chancellor Date: Fri Jan 7 11:33:03 2022 -0700 clk: visconti: Remove pointless NULL check in visconti_pll_add_lookup() Clang warns: drivers/clk/visconti/pll.c:292:20: warning: address of array 'ctx->clk_data.hws' will always evaluate to 'true' [-Wpointer-bool-conversion] if (ctx->clk_data.hws && id) ~~~~~~~~~~~~~~^~~ ~~ 1 warning generated. This array cannot be NULL if ctx is not NULL, which is allocated in visconti_init_pll(), so just remove the check, which matches other clk drivers. Fixes: b4cbe606dc36 ("clk: visconti: Add support common clock driver and reset driver") Link: https://github.com/ClangBuiltLinux/linux/issues/1564 Reported-by: kernel test robot Signed-off-by: Nathan Chancellor Link: https://lore.kernel.org/r/20220107183303.2337676-1-nathan@kernel.org Signed-off-by: Stephen Boyd commit d062a79b7c80064d5b40bcd78009fe30adde5cea Author: Nanyong Sun Date: Tue Nov 23 22:06:38 2021 +0800 riscv/mm: Enable THP migration Add two THP helpers required to create PMD migration swap entries, and enable THP migration via ARCH_ENABLE_THP_MIGRATION. This can reduce time of THP migration without splitting and guarantee the migrated pages are still contiguous. Signed-off-by: Nanyong Sun Signed-off-by: Palmer Dabbelt commit fba88ede6a312705e147860c45ed9b3c3d9c6f85 Author: Nanyong Sun Date: Tue Nov 23 22:06:37 2021 +0800 riscv/mm: Adjust PAGE_PROT_NONE to comply with THP semantics This is a preparation for enabling THP migration. As the commit b65399f6111b("arm64/mm: Change THP helpers to comply with generic MM semantics") mentioned, pmd_present() and pmd_trans_huge() are expected to behave in the following manner: ------------------------------------------------------------------------- | PMD states | pmd_present | pmd_trans_huge | ------------------------------------------------------------------------- | Mapped | Yes | Yes | ------------------------------------------------------------------------- | Splitting | Yes | Yes | ------------------------------------------------------------------------- | Migration/Swap | No | No | ------------------------------------------------------------------------- At present the PROT_NONE bit reuses the READ bit could not comply with above semantics with two problems: 1. When splitting a PMD THP, PMD is first invalidated with pmdp_invalidate()->pmd_mkinvalid(), which clears the PRESENT bit and PROT_NONE bit/READ bit, if the PMD is read-only, then the PAGE_LEAF property is also cleared, which results in pmd_present() return false. 2. When migrating, the swap entry only clear the PRESENT bit and PROT_NONE bit/READ bit, the W/X bit may be set, so _PAGE_LEAF may be true which results in pmd_present() return true. Solution: Adjust PROT_NONE bit from READ to GLOBAL bit can satisfy the above rules: 1. GLOBAL bit has no other meanings, not like the R/W/X bit, which is also relative with _PAGE_LEAF property. 2. GLOBAL bit is at bit 5, making swap entry start from bit 6, bit 0-5 are zero, which means the PRESENT, PROT_NONE, and PAGE_LEAF are all false, then the pmd_present() and pmd_trans_huge() return false when in migration/swap. Signed-off-by: Nanyong Sun Signed-off-by: Palmer Dabbelt commit 104f062fd1b9c8571dba6a3020649da6bbc66259 Author: Zhu Yanjun Date: Thu Jan 6 13:03:59 2022 -0500 RDMA/rxe: Use the standard method to produce udp source port Use the standard method to produce udp source port. Link: https://lore.kernel.org/r/20220106180359.2915060-5-yanjun.zhu@linux.dev Signed-off-by: Zhu Yanjun Signed-off-by: Jason Gunthorpe commit 69e609ba96620aaca3c3bdcbaba5f8dee3b12f5f Author: Zhu Yanjun Date: Thu Jan 6 13:03:58 2022 -0500 RDMA/irdma: Make the source udp port vary Get the source udp port number for a QP based on the grh.flow_label or lqpn/rqrpn. This provides a better spread of traffic across NIC RX queues. Link: https://lore.kernel.org/r/20220106180359.2915060-4-yanjun.zhu@linux.dev Signed-off-by: Zhu Yanjun Reviewed-by: Leon Romanovsky Acked-by: Shiraz Saleem Signed-off-by: Jason Gunthorpe commit 93f8df548187f6aca50d3398a88cf5ebf130525e Author: Zhu Yanjun Date: Thu Jan 6 13:03:57 2022 -0500 RDMA/hns: Replace get_udp_sport with rdma_get_udp_sport Several drivers have the same function xxx_get_udp_sport. So this function is moved to ib_verbs.h. Link: https://lore.kernel.org/r/20220106180359.2915060-3-yanjun.zhu@linux.dev Signed-off-by: Zhu Yanjun Reviewed-by: Leon Romanovsky Acked-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe commit 18451db82ef7f943c60a7fce685f16172bda5106 Author: Zhu Yanjun Date: Thu Jan 6 13:03:56 2022 -0500 RDMA/core: Calculate UDP source port based on flow label or lqpn/rqpn Calculate and set UDP source port based on the flow label. If flow label is not defined in GRH then calculate it based on lqpn/rqpn. Link: https://lore.kernel.org/r/20220106180359.2915060-2-yanjun.zhu@linux.dev Signed-off-by: Zhu Yanjun Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 19e43f1276b38716ad558c2018535e475cb9f3cf Author: Nicholas Kazlauskas Date: Thu Dec 16 11:19:30 2021 -0500 drm/amd/display: Add version check before using DP alt query interface [Why] To maintain compatibility with firmware older than 4.0.11. Those firmware may have interrmittent hangs with RDCSPIPE or the PHY, but we shouldn't regress their previous behavior. [How] Use the new path if firmware is development or 4.0.11 or newer. Use the legacy path otherwise. Fixes: 41f91315b5be5a ("drm/amd/display: Query DMCUB for dp alt status") Tested-by: Daniel Wheeler Reviewed-by: Hansen Dsouza Acked-by: Rodrigo Siqueira Signed-off-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher commit 214993e106ea84a82e2c644bff3dbbe601b11e04 Author: Mikita Lipski Date: Wed Dec 15 11:01:45 2021 -0500 drm/amd/display: introduce mpo detection flags [why] We want to know if new crtc state is enabling MPO configuration before enabling it. [how] Detect if both primary and overlay planes are enabled on the same CRTC. Tested-by: Daniel Wheeler Reviewed-by: Bhawanpreet Lakha Acked-by: Rodrigo Siqueira Signed-off-by: Mikita Lipski Signed-off-by: Alex Deucher commit 46a74381e5ea54dc78ad7c29659dad0b1eb66b0d Author: Charlene Liu Date: Thu Dec 16 16:33:04 2021 -0500 drm/amd/display: Add check for forced_clocks debug option [why] driver missed the check. [how] add the check. add min display clock = 100mhz check based on dccg doc. [note] add SetPhyclkVoltageByFreq as confirmed with smu, but not enabled in this change. Tested-by: Daniel Wheeler Reviewed-by: Dmytro Laktyushkin Acked-by: Rodrigo Siqueira Signed-off-by: Charlene Liu Signed-off-by: Alex Deucher commit 79d6b9351f086e0f914a26915d96ab52286ec46c Author: Nicholas Kazlauskas Date: Wed Dec 15 18:18:41 2021 -0500 drm/amd/display: Don't reinitialize DMCUB on s0ix resume [Why] PSP will suspend and resume DMCUB. Driver should just wait for DMCUB to finish the auto load before continuining instead of placing it into reset, wiping its firmware state and reinitializing. If we don't let DMCUB fully finish initializing for S0ix then some state will be lost and screen corruption can occur due to incorrect address translation. [How] Use dmub_srv callbacks to determine in DMCUB is running and wait for auto-load to complete before continuining. In S0ix DMCUB will be running and DAL fw so initialize will skip. In S3 DMCUB will not be running and we will do a full hardware init. In S3 DMCUB will be running but will not be DAL fw so we will also do a full hardware init. Tested-by: Daniel Wheeler Reviewed-by: Mikita Lipski Acked-by: Rodrigo Siqueira Signed-off-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher commit 580013b2cef8babc204b7b78ff093140e112b194 Author: Wenjing Liu Date: Mon Dec 13 18:29:27 2021 -0500 drm/amd/display: unhard code link to phy idx mapping in dc link and clean up [why] 1. Current code hard codes link to PHY mapping in dc link level per asic per revision. This is not scalable. In long term the mapping will be obatined from DMUB and store in dc resource. 2. Depending on DCN revision and endpoint type, the definition of dio_output_idx dio_output_type and phy_idx are not consistent. We need to unify the meaning of these hardware indices across different system configuration. [how] 1. Temporarly move the hardcoded mapping to dc_resource level, which should have full awareness of asic specific configuration and add a TODO comment to move the mapping to DMUB. 2. populate dio_output_idx/phy_idx for all configuration, define usb4_enabled bit instead of dio_output_type as an external enum. Tested-by: Daniel Wheeler Reviewed-by: Eric Yang Acked-by: Rodrigo Siqueira Signed-off-by: Wenjing Liu Signed-off-by: Alex Deucher commit 771ced73fccd0ac19bb956eaacce3669cfccc805 Author: Yi-Ling Chen Date: Mon Dec 13 16:13:26 2021 +0800 drm/amd/display: Fix underflow for fused display pipes case [Why] Depend on res_pool->res_cap->num_timing_generator to query timing gernerator information, it would case underflow at the fused display pipes case. Due to the res_pool->res_cap->num_timing_generator records default timing generator resource built in driver, not the current chip. [How] Some ASICs would be fused display pipes less than the default setting. In dcnxx_resource_construct function, driver would obatin real timing generator count and store it into res_pool->timing_generator_count. Tested-by: Daniel Wheeler Reviewed-by: Anthony Koo Acked-by: Rodrigo Siqueira Signed-off-by: Yi-Ling Chen Signed-off-by: Alex Deucher commit eac4c54bf7f17fb4681b85e5fe383b74d6261a2b Author: Mario Limonciello Date: Wed Dec 29 13:56:09 2021 -0600 drm/amdgpu: don't set s3 and s0ix at the same time This makes it clearer which codepaths are in use specifically in one state or the other. Signed-off-by: Mario Limonciello Acked-by: Evan Quan Signed-off-by: Alex Deucher commit e53d9665ab003df0ece8f869fcd3c2bbbecf7190 Author: Mario Limonciello Date: Wed Dec 29 13:58:02 2021 -0600 drm/amdgpu: explicitly check for s0ix when evicting resources This codepath should be running in both s0ix and s3, but only does currently because s3 and s0ix are both set in the s0ix case. Signed-off-by: Mario Limonciello Acked-by: Evan Quan Signed-off-by: Alex Deucher commit f38b0d48cae88395a05e49cb885fa6ce657e1cc9 Author: Evan Quan Date: Thu Dec 30 17:53:54 2021 +0800 drm/amd/pm: keep the BACO feature enabled for suspend To pair with the workaround which always reset the ASIC in suspend. Otherwise, the reset which relies on BACO will fail. Fixes: daf8de0874ab5b ("drm/amdgpu: always reset the asic in suspend (v2)") Signed-off-by: Evan Quan Reviewed-by: Alex Deucher Reviewed-by: Guchun Chen Signed-off-by: Alex Deucher commit 216a9873198bdc5c670a9f71d58fafd30227c9c8 Author: James Yao Date: Wed Dec 29 18:10:32 2021 +0800 drm/amdgpu: add dummy event6 for vega10 [why] Malicious mailbox event1 fails driver loading on vega10. A dummy event6 prevent driver from taking response from malicious event1 as its own. [how] On vega10, send a mailbox event6 before sending event1. Signed-off-by: James Yao Reviewed-by: Jingwen Chen Signed-off-by: Alex Deucher commit 5b0ce2d41b70bba49b91b10c55984714490354ed Author: yipechai Date: Wed Dec 29 16:17:28 2021 +0800 drm/amdkfd: enable sdma ecc interrupt event can be handled by event_interrupt_wq_v9 Enable sdma ecc interrupt event can be handled by event_interrupt_wq_v9. Signed-off-by: yipechai Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit d4296faebd337e5f76c0fddb815de33d2b0ad118 Author: Qi Zheng Date: Sun Dec 19 10:41:54 2021 +0800 cpuset: convert 'allowed' in __cpuset_node_allowed() to be boolean Convert 'allowed' in __cpuset_node_allowed() to be boolean since the return types of node_isset() and __cpuset_node_allowed() are both boolean. Signed-off-by: Qi Zheng Signed-off-by: Tejun Heo commit b56a7cbf40c895cbe8b67ce5649a26b7a7bc48be Author: Mark Brown Date: Fri Jan 7 19:11:45 2022 +0000 regmap: debugfs: Fix indentation Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220107191145.813876-1-broonie@kernel.org Signed-off-by: Mark Brown commit 445ecdf79be0c71ca248f7611aeefceaea3ec59f Author: Jing Liu Date: Wed Jan 5 04:35:15 2022 -0800 kvm: x86: Exclude unpermitted xfeatures at KVM_GET_SUPPORTED_CPUID KVM_GET_SUPPORTED_CPUID should not include any dynamic xstates in CPUID[0xD] if they have not been requested with prctl. Otherwise a process which directly passes KVM_GET_SUPPORTED_CPUID to KVM_SET_CPUID2 would now fail even if it doesn't intend to use a dynamically enabled feature. Userspace must know that prctl is required and allocate >4K xstate buffer before setting any dynamic bit. Suggested-by: Paolo Bonzini Signed-off-by: Jing Liu Signed-off-by: Yang Zhong Message-Id: <20220105123532.12586-5-yang.zhong@intel.com> Signed-off-by: Paolo Bonzini commit cc04b6a21d431359eceeec0d812b492088b04af5 Author: Jing Liu Date: Wed Jan 5 04:35:14 2022 -0800 kvm: x86: Fix xstate_required_size() to follow XSTATE alignment rule CPUID.0xD.1.EBX enumerates the size of the XSAVE area (in compacted format) required by XSAVES. If CPUID.0xD.i.ECX[1] is set for a state component (i), this state component should be located on the next 64-bytes boundary following the preceding state component in the compacted layout. Fix xstate_required_size() to follow the alignment rule. AMX is the first state component with 64-bytes alignment to catch this bug. Signed-off-by: Jing Liu Signed-off-by: Yang Zhong Message-Id: <20220105123532.12586-4-yang.zhong@intel.com> Signed-off-by: Paolo Bonzini commit 36487e6228c4cb04257c92266a04078a384bc4ec Author: Thomas Gleixner Date: Wed Jan 5 04:35:13 2022 -0800 x86/fpu: Prepare guest FPU for dynamically enabled FPU features To support dynamically enabled FPU features for guests prepare the guest pseudo FPU container to keep track of the currently enabled xfeatures and the guest permissions. Signed-off-by: Thomas Gleixner Signed-off-by: Jing Liu Signed-off-by: Yang Zhong Message-Id: <20220105123532.12586-3-yang.zhong@intel.com> Signed-off-by: Paolo Bonzini commit 980fe2fddcff21937c93532b4597c8ea450346c1 Author: Thomas Gleixner Date: Wed Jan 5 04:35:12 2022 -0800 x86/fpu: Extend fpu_xstate_prctl() with guest permissions KVM requires a clear separation of host user space and guest permissions for dynamic XSTATE components. Add a guest permissions member to struct fpu and a separate set of prctl() arguments: ARCH_GET_XCOMP_GUEST_PERM and ARCH_REQ_XCOMP_GUEST_PERM. The semantics are equivalent to the host user space permission control except for the following constraints: 1) Permissions have to be requested before the first vCPU is created 2) Permissions are frozen when the first vCPU is created to ensure consistency. Any attempt to expand permissions via the prctl() after that point is rejected. Signed-off-by: Thomas Gleixner Signed-off-by: Jing Liu Signed-off-by: Yang Zhong Message-Id: <20220105123532.12586-2-yang.zhong@intel.com> Signed-off-by: Paolo Bonzini commit 96c1a6285568d31a8125c36974a140fccbe548af Author: Michael Roth Date: Fri Dec 10 10:46:12 2021 -0600 kvm: selftests: move ucall declarations into ucall_common.h Now that core kvm_util declarations have special home in kvm_util_base.h, move ucall-related declarations out into a separate header. Signed-off-by: Michael Roth Message-Id: <20211210164620.11636-3-michael.roth@amd.com> Signed-off-by: Paolo Bonzini commit 7d9a662ed9f0403e7b94940dceb81552b8edb931 Author: Michael Roth Date: Fri Dec 10 10:46:11 2021 -0600 kvm: selftests: move base kvm_util.h declarations to kvm_util_base.h Between helper macros and interfaces that will be introduced in subsequent patches, much of kvm_util.h would end up being declarations specific to ucall. Ideally these could be separated out into a separate header since they are not strictly required for writing guest tests and are mostly self-contained interfaces other than a reliance on a few core declarations like struct kvm_vm. This doesn't make a big difference as far as how tests will be compiled/written since all these interfaces will still be packaged up into a single/common libkvm.a used by all tests, but it is still nice to be able to compartmentalize to improve readabilty and reduce merge conflicts in the future for common tasks like adding new interfaces to kvm_util.h. Furthermore, some of the ucall declarations will be arch-specific, requiring various #ifdef'ery in kvm_util.h. Ideally these declarations could live in separate arch-specific headers, e.g. include//ucall.h, which would handle arch-specific declarations as well as pulling in common ucall-related declarations shared by all archs. One simple way to do this would be to #include ucall.h at the bottom of kvm_util.h, after declarations it relies upon like struct kvm_vm. This is brittle however, and doesn't scale easily to other sets of interfaces that may be added in the future. Instead, move all declarations currently in kvm_util.h into kvm_util_base.h, then have kvm_util.h #include it. With this change, non-base declarations can be selectively moved/introduced into separate headers, which can then be included in kvm_util.h so that individual tests don't need to be touched. Subsequent patches will then move ucall-related declarations into a separate header to meet the above goals. Signed-off-by: Michael Roth Message-Id: <20211210164620.11636-2-michael.roth@amd.com> Signed-off-by: Paolo Bonzini commit 8ee304396e2f3db9c2856fb8f63548f906e6f2e1 Author: hasheddan Date: Sat Nov 20 09:26:05 2021 -0500 riscv/head: fix misspelling of guaranteed Fixes misspelling of guaranteed in comment describing why fetching fence is guaranteed to work when switching to kernel page tables. Signed-off-by: hasheddan Signed-off-by: Palmer Dabbelt commit 44ea62813f0ab3d718de480504f4dfd0bdd01858 Author: Jakub Kicinski Date: Fri Sep 3 18:31:40 2021 -0700 spi: don't include ptp_clock_kernel.h in spi.h Commit b42faeee718c ("spi: Add a PTP system timestamp to the transfer structure") added an include of ptp_clock_kernel.h to spi.h for struct ptp_system_timestamp but a forward declaration is enough. Let's use that to limit the number of objects we have to rebuild every time we touch networking headers. Signed-off-by: Jakub Kicinski Tested-by: Vladimir Oltean Link: https://lore.kernel.org/r/20210904013140.2377609-1-kuba@kernel.org Signed-off-by: Mark Brown commit 530792efa6cb86f5612ff093333fec735793b582 Author: Fabio Estevam Date: Fri Jan 7 13:33:07 2022 -0300 regmap: Call regmap_debugfs_exit() prior to _init() Since commit cffa4b2122f5 ("regmap: debugfs: Fix a memory leak when calling regmap_attach_dev"), the following debugfs error is seen on i.MX boards: debugfs: Directory 'dummy-iomuxc-gpr@20e0000' with parent 'regmap' already present! In the attempt to fix the memory leak, the above commit added a NULL check for map->debugfs_name. For the first debufs entry, map->debugfs_name is NULL and then the new name is allocated via kasprintf(). For the second debugfs entry, map->debugfs_name() is no longer NULL, so it will keep using the old entry name and the duplicate name error is seen. Quoting Mark Brown: "That means that if the device gets freed we'll end up with the old debugfs file hanging around pointing at nothing. ... To be more explicit this means we need a call to regmap_debugfs_exit() which will clean up all the existing debugfs stuff before we loose references to it." Call regmap_debugfs_exit() prior to regmap_debugfs_init() to fix the problem. Tested on i.MX6Q and i.MX6SX boards. Fixes: cffa4b2122f5 ("regmap: debugfs: Fix a memory leak when calling regmap_attach_dev") Suggested-by: Mark Brown Signed-off-by: Fabio Estevam Link: https://lore.kernel.org/r/20220107163307.335404-1-festevam@gmail.com Signed-off-by: Mark Brown commit f517ba4924ad026f2583553db02f3c8bc69de88b Author: Charles Keepax Date: Fri Jan 7 16:06:36 2022 +0000 ASoC: cs35l41: Add support for hibernate memory retention mode The cs35l41 supports a low power DSP memory retention mode. Add support for entering this mode when then device is not in use. Co-authored-by: David Rhodes Signed-off-by: David Rhodes Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220107160636.6555-3-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit d92321bbe46b0ecae0941461379d39599610d869 Author: Charles Keepax Date: Fri Jan 7 16:06:35 2022 +0000 ASoC: cs35l41: Update handling of test key registers In preparation for the addition of PM runtime support move the test key out of the register patches themselves. This is necessary to allow the test key to be held during cache synchronisation, which is required by the OTP settings which were unpacked from the device and written by the driver. Also whilst at it, the driver uses a mixture of accessing the test key register by name and by address, consistently use the name. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220107160636.6555-2-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 5322c68e588dd018365fe59f9a9930ef11813337 Author: Jason Wang Date: Sun Dec 12 16:10:01 2021 +0800 iavf: remove an unneeded variable The variable `ret_code' used for returning is never changed in function `iavf_shutdown_adminq'. So that it can be removed and just return its initial value 0 at the end of `iavf_shutdown_adminq' function. Signed-off-by: Jason Wang Signed-off-by: Tony Nguyen commit a127adf2fc836eafffffc43d449ab1a3d20d6f3b Author: Yang Li Date: Mon Dec 13 11:11:07 2021 +0800 i40e: remove variables set but not used The code that uses variables pe_cntx_size and pe_filt_size has been removed, so they should be removed as well. Eliminate the following clang warnings: drivers/net/ethernet/intel/i40e/i40e_common.c:4139:20: warning: variable 'pe_filt_size' set but not used. drivers/net/ethernet/intel/i40e/i40e_common.c:4139:6: warning: variable 'pe_cntx_size' set but not used. Reported-by: Abaci Robot Signed-off-by: Yang Li Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit 17b33d4319605f1f60d1348a50c49e22666b694b Author: Mateusz Palczewski Date: Mon Dec 6 11:36:42 2021 +0100 i40e: Remove non-inclusive language Remove non-inclusive language from the driver. Signed-off-by: Aleksandr Loktionov Signed-off-by: Mateusz Palczewski Signed-off-by: Tony Nguyen commit 9c83ca8a638d84a43e8e2631d357865cf8fc5b3a Author: Mateusz Palczewski Date: Tue Nov 23 15:00:13 2021 +0100 i40e: Update FW API version Update FW API versions to the newest supported NVM images. Signed-off-by: Sylwester Dziedziuch Signed-off-by: Mateusz Palczewski Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit ef39584ddb15bddba6b1482dc78cc0633a8f13ef Author: Jedrzej Jagielski Date: Tue Nov 16 13:13:29 2021 +0000 i40e: Minimize amount of busy-waiting during AQ send The i40e_asq_send_command will now use a non blocking usleep_range if possible (non-atomic context), instead of busy-waiting udelay. The usleep_range function uses hrtimers to provide better performance and removes the negative impact of busy-waiting in time-critical environments. 1. Rename i40e_asq_send_command to i40e_asq_send_command_atomic and add 5th parameter to inform if called from an atomic context. Call inside usleep_range (if non-atomic) or udelay (if atomic). 2. Change i40e_asq_send_command to invoke i40e_asq_send_command_atomic(..., false). 3. Change two functions: - i40e_aq_set_vsi_uc_promisc_on_vlan - i40e_aq_set_vsi_mc_promisc_on_vlan to explicitly use i40e_asq_send_command_atomic(..., true) instead of i40e_asq_send_command, as they use spinlocks and do some work in an atomic context. All other calls to i40e_asq_send_command remain unchanged. Signed-off-by: Dawid Lukwinski Signed-off-by: Jedrzej Jagielski Tested-by: Tony Brelinski Signed-off-by: Tony Nguyen commit cfb1d572c986a39fd288f48a6305d81e6f8d04a3 Author: Karen Sornek Date: Thu Jun 17 09:19:26 2021 +0200 i40e: Add ensurance of MacVlan resources for every trusted VF Trusted VF can use up every resource available, leaving nothing to other trusted VFs. Introduce define, which calculates MacVlan resources available based on maximum available MacVlan resources, bare minimum for each VF and number of currently allocated VFs. Signed-off-by: Przemyslaw Patynowski Signed-off-by: Karen Sornek Tested-by: Tony Brelinski Signed-off-by: Tony Nguyen commit 1751fc1db36f6f411709e143d5393f92d12137a9 Author: Trond Myklebust Date: Thu Jan 6 18:24:03 2022 -0500 NFSv4: nfs_atomic_open() can race when looking up a non-regular file If the file type changes back to being a regular file on the server between the failed OPEN and our LOOKUP, then we need to re-run the OPEN. Fixes: 0dd2b474d0b6 ("nfs: implement i_op->atomic_open()") Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit ac795161c93699d600db16c1a8cc23a65a1eceaf Author: Trond Myklebust Date: Thu Jan 6 18:24:02 2022 -0500 NFSv4: Handle case where the lookup of a directory fails If the application sets the O_DIRECTORY flag, and tries to open a regular file, nfs_atomic_open() will punt to doing a regular lookup. If the server then returns a regular file, we will happily return a file descriptor with uninitialised open state. The fix is to return the expected ENOTDIR error in these cases. Reported-by: Lyu Tao Fixes: 0dd2b474d0b6 ("nfs: implement i_op->atomic_open()") Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit 2056e2989bf47ad7274ecc5e9dda2add53c112f9 Author: Dave Hansen Date: Tue Jan 4 09:15:27 2022 -0800 x86/sgx: Fix NULL pointer dereference on non-SGX systems == Problem == Nathan Chancellor reported an oops when aceessing the 'sgx_total_bytes' sysfs file: https://lore.kernel.org/all/YbzhBrimHGGpddDM@archlinux-ax161/ The sysfs output code accesses the sgx_numa_nodes[] array unconditionally. However, this array is allocated during SGX initialization, which only occurs on systems where SGX is supported. If the sysfs file is accessed on systems without SGX support, sgx_numa_nodes[] is NULL and an oops occurs. == Solution == To fix this, hide the entire nodeX/x86/ attribute group on systems without SGX support using the ->is_visible attribute group callback. Unfortunately, SGX is initialized via a device_initcall() which occurs _after_ the ->is_visible() callback. Instead of moving SGX initialization earlier, call sysfs_update_group() during SGX initialization to update the group visiblility. This update requires moving the SGX sysfs code earlier in sgx/main.c. There are no code changes other than the addition of arch_update_sysfs_visibility() and a minor whitespace fixup to arch_node_attr_is_visible() which checkpatch caught. CC: Greg Kroah-Hartman Cc: linux-sgx@vger.kernel.org Cc: x86@kernel.org Fixes: 50468e431335 ("x86/sgx: Add an attribute for the amount of SGX memory in a NUMA node") Reported-by: Nathan Chancellor Signed-off-by: Dave Hansen Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jarkko Sakkinen Tested-by: Nathan Chancellor Tested-by: Jarkko Sakkinen Link: https://lkml.kernel.org/r/20220104171527.5E8416A8@davehans-spike.ostc.intel.com commit c25af830ab2608ef1dd5e4dada702ce1437ea8e7 Author: Kevin Bracey Date: Thu Jan 6 23:56:37 2022 +0200 sch_cake: revise Diffserv docs Documentation incorrectly stated that CS1 is equivalent to LE for diffserv8. But when LE was added to the table, CS1 was pushed into tin 1, leaving only LE in tin 0. Also "TOS1" no longer exists, as that is the same codepoint as LE. Make other tweaks properly distinguishing codepoints from classes and putting current Diffserve codepoints ahead of legacy ones. Signed-off-by: Kevin Bracey Acked-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/r/20220106215637.3132391-1-kevin@bracey.fi Signed-off-by: Jakub Kicinski commit 87d6576ddf8ac25f36597bc93ca17f6628289c16 Author: Mauro Carvalho Chehab Date: Thu Jan 6 01:41:02 2022 +0100 scripts: sphinx-pre-install: Fix ctex support on Debian The name of the package with ctexhook.sty is different on Debian/Ubuntu. Reported-by: Akira Yokosawa Signed-off-by: Mauro Carvalho Chehab Tested-by: Akira Yokosawa Link: https://lore.kernel.org/r/63882425609a2820fac78f5e94620abeb7ed5f6f.1641429634.git.mchehab@kernel.org Signed-off-by: Jonathan Corbet commit db67eb748e7a8e9310accf3eff606b40008ef145 Author: Jonathan Corbet Date: Mon Jan 3 15:33:47 2022 -0700 docs: discourage use of list tables Our documentation encourages the use of list-table formats, but that advice runs counter to the objective of keeping the plain-text documentation as useful and readable as possible. Turn that advice around the other way so that people don't keep adding these tables. Acked-by: Christoph Hellwig Acked-by: Randy Dunlap Signed-off-by: Jonathan Corbet commit bf33a9d42d0c1003bca4aebfabcd22e69aae979f Author: Thorsten Leemhuis Date: Tue Jan 4 17:53:33 2022 +0100 docs: 5.Posting.rst: describe Fixes: and Link: tags Explain Fixes: and Link: tags in Documentation/process/5.Posting.rst, which are missing in this file for unknown reasons and only described in Documentation/process/submitting-patches.rst. Signed-off-by: Thorsten Leemhuis CC: Konstantin Ryabitsev Link: https://lore.kernel.org/r/c4a5f5e25fa84b26fd383bba6eafde4ab57c9de7.1641314856.git.linux@leemhuis.info Signed-off-by: Jonathan Corbet commit 689d8014d92ae9e0a861e82a81d8b4410c0f790e Author: Christian Löhle Date: Wed Jan 5 09:58:38 2022 +0000 Documentation: kgdb: Replace deprecated remotebaud Using set remotebaud to set the baud rate was deprecated in gdb-7.7 and completely removed from the command parser in gdb-7.8 (released in 2014). Adopt set serial baud instead. Signed-off-by: Christian Loehle Reviewed-by: Daniel Thompson Link: https://lore.kernel.org/r/4050689967ed46baaa3bfadda53a0e73@hyperstone.com Signed-off-by: Jonathan Corbet commit 7cc4c09269109d31fc325fb8390e452d7e558de0 Author: James Clark Date: Wed Jan 5 14:36:39 2022 +0000 docs: automarkup.py: Fix invalid HTML link output and broken URI fragments Since commit d18b01789ae5 ("docs: Add automatic cross-reference for documentation pages"), references that were already explicitly defined with "ref:" and referred to other pages with a path have been doubled. This is reported as the following error by Firefox: Start tag "a" seen but an element of the same type was already open. End tag "a" violates nesting rules. As well as the invalid HTML, this also obscures the URI fragment links to subsections because the second link overrides the first. For example on the page admin-guide/hw-vuln/mds.html the last link should be to the "Default Mitigations" subsection using a # URI fragment: admin-guide/hw-vuln/l1tf.html#default-mitigations But it is obsured by a second link to the whole page: admin-guide/hw-vuln/l1tf.html The full HTML with the double tags looks like this: L1TF - L1 Terminal Fault After this commit, there is only a single link: Documentation/admin-guide/hw-vuln//l1tf.rst Now that the second link is removed, the browser correctly jumps to the default-mitigations subsection when clicking the link. The fix is to check that nodes in the document to be modified are not already references. A reference is counted as any text that is a descendant of a reference type node. Only plain text should be converted to new references, otherwise the doubling occurs. Testing ======= * Test that the build stdout is the same (ignoring ordering), and that no new warnings are printed. * Diff all .html files and check that the only modifications occur to the bad double links. * The auto linking of bare references to pages without "ref:" is still working. Fixes: d18b01789ae5 ("docs: Add automatic cross-reference for documentation pages") Reviewed-by: Nícolas F. R. A. Prado Signed-off-by: James Clark Link: https://lore.kernel.org/r/20220105143640.330602-2-james.clark@arm.com Signed-off-by: Jonathan Corbet commit 405329fc9aeef1e3e2eccaadf32b539ad6c7120f Author: Michael Roth Date: Thu Dec 16 11:13:54 2021 -0600 KVM: SVM: include CR3 in initial VMSA state for SEV-ES guests Normally guests will set up CR3 themselves, but some guests, such as kselftests, and potentially CONFIG_PVH guests, rely on being booted with paging enabled and CR3 initialized to a pre-allocated page table. Currently CR3 updates via KVM_SET_SREGS* are not loaded into the guest VMCB until just prior to entering the guest. For SEV-ES/SEV-SNP, this is too late, since it will have switched over to using the VMSA page prior to that point, with the VMSA CR3 copied from the VMCB initial CR3 value: 0. Address this by sync'ing the CR3 value into the VMCB save area immediately when KVM_SET_SREGS* is issued so it will find it's way into the initial VMSA. Suggested-by: Tom Lendacky Signed-off-by: Michael Roth Message-Id: <20211216171358.61140-10-michael.roth@amd.com> [Remove vmx_post_set_cr3; add a remark about kvm_set_cr3 not calling the new hook. - Paolo] Signed-off-by: Paolo Bonzini commit 907d139318b5109e5b676b32b0f4a2c666a8d9ac Author: Peter Zijlstra Date: Mon Dec 13 11:07:40 2021 +0100 KVM: VMX: Provide vmread version using asm-goto-with-outputs Use asm-goto-output for smaller fast path code. Message-Id: Signed-off-by: Paolo Bonzini commit 55749769fe608fa3f4a075e42e89d237c8e37637 Author: David Woodhouse Date: Fri Dec 10 16:36:24 2021 +0000 KVM: x86: Fix wall clock writes in Xen shared_info not to mark page dirty When dirty ring logging is enabled, any dirty logging without an active vCPU context will cause a kernel oops. But we've already declared that the shared_info page doesn't get dirty tracking anyway, since it would be kind of insane to mark it dirty every time we deliver an event channel interrupt. Userspace is supposed to just assume it's always dirty any time a vCPU can run or event channels are routed. So stop using the generic kvm_write_wall_clock() and just write directly through the gfn_to_pfn_cache that we already have set up. We can make kvm_write_wall_clock() static in x86.c again now, but let's not remove the 'sec_hi_ofs' argument even though it's not used yet. At some point we *will* want to use that for KVM guests too. Fixes: 629b5348841a ("KVM: x86/xen: update wallclock region") Reported-by: butt3rflyh4ck Signed-off-by: David Woodhouse Message-Id: <20211210163625.2886-6-dwmw2@infradead.org> Signed-off-by: Paolo Bonzini commit 14243b387137a4afbe1df5d9dc15182d6657bb79 Author: David Woodhouse Date: Fri Dec 10 16:36:23 2021 +0000 KVM: x86/xen: Add KVM_IRQ_ROUTING_XEN_EVTCHN and event channel delivery This adds basic support for delivering 2 level event channels to a guest. Initially, it only supports delivery via the IRQ routing table, triggered by an eventfd. In order to do so, it has a kvm_xen_set_evtchn_fast() function which will use the pre-mapped shared_info page if it already exists and is still valid, while the slow path through the irqfd_inject workqueue will remap the shared_info page if necessary. It sets the bits in the shared_info page but not the vcpu_info; that is deferred to __kvm_xen_has_interrupt() which raises the vector to the appropriate vCPU. Add a 'verbose' mode to xen_shinfo_test while adding test cases for this. Signed-off-by: David Woodhouse Message-Id: <20211210163625.2886-5-dwmw2@infradead.org> Signed-off-by: Paolo Bonzini commit 1cfc9c4b9d4606a1e90e7dbc50058b9f0c1d43a6 Author: David Woodhouse Date: Fri Dec 10 16:36:22 2021 +0000 KVM: x86/xen: Maintain valid mapping of Xen shared_info page Use the newly reinstated gfn_to_pfn_cache to maintain a kernel mapping of the Xen shared_info page so that it can be accessed in atomic context. Note that we do not participate in dirty tracking for the shared info page and we do not explicitly mark it dirty every single tim we deliver an event channel interrupts. We wouldn't want to do that even if we *did* have a valid vCPU context with which to do so. Signed-off-by: David Woodhouse Message-Id: <20211210163625.2886-4-dwmw2@infradead.org> Signed-off-by: Paolo Bonzini commit 982ed0de4753ed6e71dbd40f82a5a066baf133ed Author: David Woodhouse Date: Fri Dec 10 16:36:21 2021 +0000 KVM: Reinstate gfn_to_pfn_cache with invalidation support This can be used in two modes. There is an atomic mode where the cached mapping is accessed while holding the rwlock, and a mode where the physical address is used by a vCPU in guest mode. For the latter case, an invalidation will wake the vCPU with the new KVM_REQ_GPC_INVALIDATE, and the architecture will need to refresh any caches it still needs to access before entering guest mode again. Only one vCPU can be targeted by the wake requests; it's simple enough to make it wake all vCPUs or even a mask but I don't see a use case for that additional complexity right now. Invalidation happens from the invalidate_range_start MMU notifier, which needs to be able to sleep in order to wake the vCPU and wait for it. This means that revalidation potentially needs to "wait" for the MMU operation to complete and the invalidate_range_end notifier to be invoked. Like the vCPU when it takes a page fault in that period, we just spin — fixing that in a future patch by implementing an actual *wait* may be another part of shaving this particularly hirsute yak. As noted in the comments in the function itself, the only case where the invalidate_range_start notifier is expected to be called *without* being able to sleep is when the OOM reaper is killing the process. In that case, we expect the vCPU threads already to have exited, and thus there will be nothing to wake, and no reason to wait. So we clear the KVM_REQUEST_WAIT bit and send the request anyway, then complain loudly if there actually *was* anything to wake up. Signed-off-by: David Woodhouse Message-Id: <20211210163625.2886-3-dwmw2@infradead.org> Signed-off-by: Paolo Bonzini commit 2efd61a608b0039911924d2e5d7028eb37496e85 Author: David Woodhouse Date: Fri Dec 10 16:36:20 2021 +0000 KVM: Warn if mark_page_dirty() is called without an active vCPU The various kvm_write_guest() and mark_page_dirty() functions must only ever be called in the context of an active vCPU, because if dirty ring tracking is enabled it may simply oops when kvm_get_running_vcpu() returns NULL for the vcpu and then kvm_dirty_ring_get() dereferences it. This oops was reported by "butt3rflyh4ck" in https://lore.kernel.org/kvm/CAFcO6XOmoS7EacN_n6v4Txk7xL7iqRa2gABg3F7E3Naf5uG94g@mail.gmail.com/ That actual bug will be fixed under separate cover but this warning should help to prevent new ones from being added. Signed-off-by: David Woodhouse Message-Id: <20211210163625.2886-2-dwmw2@infradead.org> Signed-off-by: Paolo Bonzini commit f3f26dae05e39f0f286f588669b54d49b61dcfb8 Author: David Woodhouse Date: Thu Dec 9 15:09:38 2021 +0000 x86/kvm: Silence per-cpu pr_info noise about KVM clocks and steal time I made the actual CPU bringup go nice and fast... and then Linux spends half a minute printing stupid nonsense about clocks and steal time for each of 256 vCPUs. Don't do that. Nobody cares. Signed-off-by: David Woodhouse Message-Id: <20211209150938.3518-12-dwmw2@infradead.org> Signed-off-by: Paolo Bonzini commit 018d70ffcfec8a01f77b0d840527203d337dd7f9 Author: Eric Hankland Date: Tue Nov 30 15:42:21 2021 +0800 KVM: x86: Update vPMCs when retiring branch instructions When KVM retires a guest branch instruction through emulation, increment any vPMCs that are configured to monitor "branch instructions retired," and update the sample period of those counters so that they will overflow at the right time. Signed-off-by: Eric Hankland [jmattson: - Split the code to increment "branch instructions retired" into a separate commit. - Moved/consolidated the calls to kvm_pmu_trigger_event() in the emulation of VMLAUNCH/VMRESUME to accommodate the evolution of that code. ] Fixes: f5132b01386b ("KVM: Expose a version 2 architectural PMU to a guests") Signed-off-by: Jim Mattson Message-Id: <20211130074221.93635-7-likexu@tencent.com> Signed-off-by: Paolo Bonzini commit 9cd803d496e72cd1dd3287c9a6cb4afa636ee16a Author: Eric Hankland Date: Tue Nov 30 15:42:20 2021 +0800 KVM: x86: Update vPMCs when retiring instructions When KVM retires a guest instruction through emulation, increment any vPMCs that are configured to monitor "instructions retired," and update the sample period of those counters so that they will overflow at the right time. Signed-off-by: Eric Hankland [jmattson: - Split the code to increment "branch instructions retired" into a separate commit. - Added 'static' to kvm_pmu_incr_counter() definition. - Modified kvm_pmu_incr_counter() to check pmc->perf_event->state == PERF_EVENT_STATE_ACTIVE. ] Fixes: f5132b01386b ("KVM: Expose a version 2 architectural PMU to a guests") Signed-off-by: Jim Mattson [likexu: - Drop checks for pmc->perf_event or event state or event type - Increase a counter once its umask bits and the first 8 select bits are matched - Rewrite kvm_pmu_incr_counter() with a less invasive approach to the host perf; - Rename kvm_pmu_record_event to kvm_pmu_trigger_event; - Add counter enable and CPL check for kvm_pmu_trigger_event(); ] Cc: Peter Zijlstra Signed-off-by: Like Xu Message-Id: <20211130074221.93635-6-likexu@tencent.com> Signed-off-by: Paolo Bonzini commit 40ccb96d5483c7ef773f50db15f82f0ab587cf8a Author: Like Xu Date: Tue Nov 30 15:42:19 2021 +0800 KVM: x86/pmu: Add pmc->intr to refactor kvm_perf_overflow{_intr}() Depending on whether intr should be triggered or not, KVM registers two different event overflow callbacks in the perf_event context. The code skeleton of these two functions is very similar, so the pmc->intr can be stored into pmc from pmc_reprogram_counter() which provides smaller instructions footprint against the u-architecture branch predictor. The __kvm_perf_overflow() can be called in non-nmi contexts and a flag is needed to distinguish the caller context and thus avoid a check on kvm_is_in_guest(), otherwise we might get warnings from suspicious RCU or check_preemption_disabled(). Suggested-by: Paolo Bonzini Signed-off-by: Like Xu Message-Id: <20211130074221.93635-5-likexu@tencent.com> Signed-off-by: Paolo Bonzini commit 6ed1298eb0bf6641b0a66c2c38369f5767a2575c Author: Like Xu Date: Tue Nov 30 15:42:18 2021 +0800 KVM: x86/pmu: Reuse pmc_perf_hw_id() and drop find_fixed_event() Since we set the same semantic event value for the fixed counter in pmc->eventsel, returning the perf_hw_id for the fixed counter via find_fixed_event() can be painlessly replaced by pmc_perf_hw_id() with the help of pmc_is_fixed() check. Signed-off-by: Like Xu Message-Id: <20211130074221.93635-4-likexu@tencent.com> Signed-off-by: Paolo Bonzini commit 7c174f305cbee6bdba5018aae02b84369e7ab995 Author: Like Xu Date: Tue Nov 30 15:42:17 2021 +0800 KVM: x86/pmu: Refactoring find_arch_event() to pmc_perf_hw_id() The find_arch_event() returns a "unsigned int" value, which is used by the pmc_reprogram_counter() to program a PERF_TYPE_HARDWARE type perf_event. The returned value is actually the kernel defined generic perf_hw_id, let's rename it to pmc_perf_hw_id() with simpler incoming parameters for better self-explanation. Signed-off-by: Like Xu Message-Id: <20211130074221.93635-3-likexu@tencent.com> Signed-off-by: Paolo Bonzini commit 761875634a5e2c3fed36c439fc4acac6f85a96eb Author: Like Xu Date: Tue Nov 30 15:42:16 2021 +0800 KVM: x86/pmu: Setup pmc->eventsel for fixed PMCs The current pmc->eventsel for fixed counter is underutilised. The pmc->eventsel can be setup for all known available fixed counters since we have mapping between fixed pmc index and the intel_arch_events array. Either gp or fixed counter, it will simplify the later checks for consistency between eventsel and perf_hw_id. Signed-off-by: Like Xu Message-Id: <20211130074221.93635-2-likexu@tencent.com> Signed-off-by: Paolo Bonzini commit 006a0f0607e1504950dd8fa3b6ca8e438ec6c9d2 Author: Paolo Bonzini Date: Thu Dec 9 14:10:04 2021 -0500 KVM: x86: avoid out of bounds indices for fixed performance counters Because IceLake has 4 fixed performance counters but KVM only supports 3, it is possible for reprogram_fixed_counters to pass to reprogram_fixed_counter an index that is out of bounds for the fixed_pmc_events array. Ultimately intel_find_fixed_event, which is the only place that uses fixed_pmc_events, handles this correctly because it checks against the size of fixed_pmc_events anyway. Every other place operates on the fixed_counters[] array which is sized according to INTEL_PMC_MAX_FIXED. However, it is cleaner if the unsupported performance counters are culled early on in reprogram_fixed_counters. Signed-off-by: Paolo Bonzini commit 5b61178cd2fd67890a70ae9febbd4df20bbd8c40 Author: Lai Jiangshan Date: Thu Dec 16 10:19:38 2021 +0800 KVM: VMX: Mark VCPU_EXREG_CR3 dirty when !CR0_PG -> CR0_PG if EPT + !URG When !CR0_PG -> CR0_PG, vcpu->arch.cr3 becomes active, but GUEST_CR3 is still vmx->ept_identity_map_addr if EPT + !URG. So VCPU_EXREG_CR3 is considered to be dirty and GUEST_CR3 needs to be updated in this case. Reported-by: Maxim Levitsky Suggested-by: Sean Christopherson Signed-off-by: Lai Jiangshan Message-Id: <20211216021938.11752-4-jiangshanlai@gmail.com> Fixes: c62c7bd4f95b ("KVM: VMX: Update vmcs.GUEST_CR3 only when the guest CR3 is dirty") Signed-off-by: Paolo Bonzini commit 6b123c3a89a90ac6418e4d64b1e23f09d458a77d Author: Lai Jiangshan Date: Thu Dec 16 10:19:37 2021 +0800 KVM: x86/mmu: Reconstruct shadow page root if the guest PDPTEs is changed For shadow paging, the page table needs to be reconstructed before the coming VMENTER if the guest PDPTEs is changed. But not all paths that call load_pdptrs() will cause the page tables to be reconstructed. Normally, kvm_mmu_reset_context() and kvm_mmu_free_roots() are used to launch later reconstruction. The commit d81135a57aa6("KVM: x86: do not reset mmu if CR0.CD and CR0.NW are changed") skips kvm_mmu_reset_context() after load_pdptrs() when changing CR0.CD and CR0.NW. The commit 21823fbda552("KVM: x86: Invalidate all PGDs for the current PCID on MOV CR3 w/ flush") skips kvm_mmu_free_roots() after load_pdptrs() when rewriting the CR3 with the same value. The commit a91a7c709600("KVM: X86: Don't reset mmu context when toggling X86_CR4_PGE") skips kvm_mmu_reset_context() after load_pdptrs() when changing CR4.PGE. Guests like linux would keep the PDPTEs unchanged for every instance of pagetable, so this missing reconstruction has no problem for linux guests. Fixes: d81135a57aa6("KVM: x86: do not reset mmu if CR0.CD and CR0.NW are changed") Fixes: 21823fbda552("KVM: x86: Invalidate all PGDs for the current PCID on MOV CR3 w/ flush") Fixes: a91a7c709600("KVM: X86: Don't reset mmu context when toggling X86_CR4_PGE") Suggested-by: Sean Christopherson Signed-off-by: Lai Jiangshan Message-Id: <20211216021938.11752-3-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini commit a9f2705ec84449e3b8d70c804766f8e97e23080d Author: Lai Jiangshan Date: Thu Dec 16 10:19:36 2021 +0800 KVM: VMX: Save HOST_CR3 in vmx_set_host_fs_gs() The host CR3 in the vcpu thread can only be changed when scheduling, so commit 15ad9762d69f ("KVM: VMX: Save HOST_CR3 in vmx_prepare_switch_to_guest()") changed vmx.c to only save it in vmx_prepare_switch_to_guest(). However, it also has to be synced in vmx_sync_vmcs_host_state() when switching VMCS. vmx_set_host_fs_gs() is called in both places, so rename it to vmx_set_vmcs_host_state() and make it update HOST_CR3. Fixes: 15ad9762d69f ("KVM: VMX: Save HOST_CR3 in vmx_prepare_switch_to_guest()") Signed-off-by: Lai Jiangshan Message-Id: <20211216021938.11752-2-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini commit 46cbc0400f85987954f6e2c110409f8f60725232 Author: Paolo Bonzini Date: Fri Dec 10 18:13:37 2021 -0500 Revert "KVM: X86: Update mmu->pdptrs only when it is changed" This reverts commit 24cd19a28cb7174df502162641d6e1e12e7ffbd9. Sean Christopherson reports: "Commit 24cd19a28cb7 ('KVM: X86: Update mmu->pdptrs only when it is changed') breaks nested VMs with EPT in L0 and PAE shadow paging in L2. Reproducing is trivial, just disable EPT in L1 and run a VM. I haven't investigating how it breaks things." Reviewed-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit a6fec53947cf48e14cc41e2a69dd7d2aa7a00e65 Author: Peter Gonda Date: Wed Dec 8 11:16:42 2021 -0800 selftests: KVM: sev_migrate_tests: Add mirror command tests Add tests to confirm mirror vms can only run correct subset of commands. Cc: Paolo Bonzini Cc: Sean Christopherson Cc: Marc Orr Signed-off-by: Peter Gonda Message-Id: <20211208191642.3792819-4-pgonda@google.com> Signed-off-by: Paolo Bonzini commit 427d046a41bbad295552fa0a7496e15d98eae389 Author: Peter Gonda Date: Wed Dec 8 11:16:41 2021 -0800 selftests: KVM: sev_migrate_tests: Fix sev_ioctl() TEST_ASSERT in SEV ioctl was allowing errors because it checked return value was good OR the FW error code was OK. This TEST_ASSERT should require both (aka. AND) values are OK. Removes the LAUNCH_START from the mirror VM because this call correctly fails because mirror VMs cannot call this command. Currently issues with the PSP driver functions mean the firmware error is not always reset to SEV_RET_SUCCESS when a call is successful. Mainly sev_platform_init() doesn't correctly set the fw error if the platform has already been initialized. Cc: Paolo Bonzini Cc: Sean Christopherson Cc: Marc Orr Signed-off-by: Peter Gonda Message-Id: <20211208191642.3792819-3-pgonda@google.com> Signed-off-by: Paolo Bonzini commit 4c66b56781eb114d478d8488e614a4f832a44a2c Author: Peter Gonda Date: Wed Dec 8 11:16:40 2021 -0800 selftests: KVM: sev_migrate_tests: Fix test_sev_mirror() Mirrors should not be able to call LAUNCH_START. Remove the call on the mirror to correct the test before fixing sev_ioctl() to correctly assert on this failed ioctl. Cc: Paolo Bonzini Cc: Sean Christopherson Cc: Marc Orr Signed-off-by: Peter Gonda Message-Id: <20211208191642.3792819-2-pgonda@google.com> Signed-off-by: Paolo Bonzini commit 1b0c9d00aa2cf93dd26760dc9e4cf4725fc5ec03 Merge: 7fd55a02a426f 497685f2c743f Author: Paolo Bonzini Date: Fri Jan 7 10:43:02 2022 -0500 Merge tag 'kvm-riscv-5.17-1' of https://github.com/kvm-riscv/linux into HEAD KVM/riscv changes for 5.17, take #1 - Use common KVM implementation of MMU memory caches - SBI v0.2 support for Guest - Initial KVM selftests support - Fix to avoid spurious virtual interrupts after clearing hideleg CSR - Update email address for Anup and Atish commit 7fd55a02a426ffff378e0acceff4a381bcbbfca0 Merge: 5e4e84f1124aa 1c53a1ae36120 Author: Paolo Bonzini Date: Fri Jan 7 10:42:19 2022 -0500 Merge tag 'kvmarm-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD KVM/arm64 updates for Linux 5.16 - Simplification of the 'vcpu first run' by integrating it into KVM's 'pid change' flow - Refactoring of the FP and SVE state tracking, also leading to a simpler state and less shared data between EL1 and EL2 in the nVHE case - Tidy up the header file usage for the nvhe hyp object - New HYP unsharing mechanism, finally allowing pages to be unmapped from the Stage-1 EL2 page-tables - Various pKVM cleanups around refcounting and sharing - A couple of vgic fixes for bugs that would trigger once the vcpu xarray rework is merged, but not sooner - Add minimal support for ARMv8.7's PMU extension - Rework kvm_pgtable initialisation ahead of the NV work - New selftest for IRQ injection - Teach selftests about the lack of default IPA space and page sizes - Expand sysreg selftest to deal with Pointer Authentication - The usual bunch of cleanups and doc update commit 4d2a3c169b9ad27dfdf2bf8d9362596477840656 Author: Qinghua Jin Date: Thu Jan 6 16:27:22 2022 +0800 IB/qib: Fix typos Change 'postion' to 'position'. Link: https://lore.kernel.org/r/20220106082722.354680-1-qhjin.dev@gmail.com Signed-off-by: Qinghua Jin Acked-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe commit 315d049ad1951cef02d9337a2469cac51cca6932 Author: Kees Cook Date: Wed Jan 5 09:36:33 2022 -0800 scsi: megaraid: Avoid mismatched storage type sizes Remove needless use of mbox_t, replacing with just struct mbox_out. Silences compiler warnings under a -Warray-bounds build: drivers/scsi/megaraid.c: In function 'megaraid_probe_one': drivers/scsi/megaraid.c:3615:30: error: array subscript 'mbox_t[0]' is partly outside array bounds of 'unsigned char[15]' [-Werror=array-bounds] 3615 | mbox->m_out.xferaddr = (u32)adapter->buf_dma_handle; | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/scsi/megaraid.c:3599:23: note: while referencing 'raw_mbox' 3599 | unsigned char raw_mbox[sizeof(struct mbox_out)]; | ^~~~~~~~ Link: https://lore.kernel.org/r/20220105173633.2421129-1-keescook@chromium.org Cc: Kashyap Desai Cc: Sumit Saxena Cc: Shivasharan S Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: megaraidlinux.pdl@broadcom.com Cc: linux-scsi@vger.kernel.org Signed-off-by: Kees Cook Signed-off-by: Martin K. Petersen commit dc35616e6c2907b0c0c391a205802d8880f7fd85 Author: Dan Carpenter Date: Fri Jan 7 10:12:10 2022 +0300 netrom: fix api breakage in nr_setsockopt() This needs to copy an unsigned int from user space instead of a long to avoid breaking user space with an API change. I have updated all the integer overflow checks from ULONG to UINT as well. This is a slight API change but I do not expect it to affect anything in real life. Fixes: 3087a6f36ee0 ("netrom: fix copying in user data in nr_setsockopt") Signed-off-by: Dan Carpenter Signed-off-by: David S. Miller commit 9371937092d5fd502032c1bb4475b36b39b1f1b3 Author: Dan Carpenter Date: Fri Jan 7 10:13:12 2022 +0300 ax25: uninitialized variable in ax25_setsockopt() The "opt" variable is unsigned long but we only copy 4 bytes from the user so the lower 4 bytes are uninitialized. I have changed the integer overflow checks from ULONG to UINT as well. This is a slight API change but I don't expect it to break anything. Fixes: a7b75c5a8c41 ("net: pass a sockptr_t into ->setsockopt") Signed-off-by: Dan Carpenter Signed-off-by: David S. Miller commit 5d9224fb076e9a2023e0b06d6a164d644612c0c0 Author: Xiang Chen Date: Tue Jan 4 20:42:06 2022 +0800 scsi: hisi_sas: Remove unused variable and check in hisi_sas_send_ata_reset_each_phy() In commit 29e2bac87421 ("scsi: hisi_sas: Fix some issues related to asd_sas_port->phy_list"), we use asd_sas_port->phy_mask instead of accessing asd_sas_port->phy_list, and it is enough to use asd_sas_port->phy_mask to check the state of phy, so remove the unused check and variable. Link: https://lore.kernel.org/r/1641300126-53574-1-git-send-email-chenxiang66@hisilicon.com Fixes: 29e2bac87421 ("scsi: hisi_sas: Fix some issues related to asd_sas_port->phy_list") Reported-by: Nathan Chancellor Reported-by: Colin King Acked-by: John Garry Signed-off-by: Xiang Chen Signed-off-by: Martin K. Petersen commit f3433d79cd50d399f0bec5b784db2aa9f923feb9 Author: Vaishali Thakkar Date: Wed Jan 5 19:07:08 2022 +0100 RDMA/rtrs-clt: Rename rtrs_clt to rtrs_clt_sess Structure rtrs_clt is used for sessions. So to avoid confusions rename it to rtrs_clt_sess. Transformations are done with the help of following coccinelle script. @@ @@ struct - rtrs_clt + rtrs_clt_sess Link: https://lore.kernel.org/r/20220105180708.7774-6-jinpu.wang@ionos.com Signed-off-by: Vaishali Thakkar Signed-off-by: Jack Wang Signed-off-by: Jason Gunthorpe commit f7ecac6a0927fba05321fd2997d33688ee547f21 Author: Vaishali Thakkar Date: Wed Jan 5 19:07:07 2022 +0100 RDMA/rtrs-srv: Rename rtrs_srv to rtrs_srv_sess Structure rtrs_srv is used for sessions so in order to avoid confusions rename it to rtrs_srv_sess. All changes were done with the help of following Coccinelle script: @@ @@ struct - rtrs_srv + rtrs_srv_sess Link: https://lore.kernel.org/r/20220105180708.7774-5-jinpu.wang@ionos.com Signed-off-by: Vaishali Thakkar Signed-off-by: Jack Wang Signed-off-by: Jason Gunthorpe commit caa84d95c78f35168847e2ab861a3a7f87033d36 Author: Vaishali Thakkar Date: Wed Jan 5 19:07:06 2022 +0100 RDMA/rtrs-clt: Rename rtrs_clt_sess to rtrs_clt_path rtrs_clt_sess is used for paths and not sessions on the client side. This creates confusion so let's rename it to rtrs_clt_path. Also, rename related variables and functions. Coccinelle is used to do the transformations for most of the occurrences and remaining ones were handled manually. Link: https://lore.kernel.org/r/20220105180708.7774-4-jinpu.wang@ionos.com Signed-off-by: Vaishali Thakkar Signed-off-by: Jack Wang Signed-off-by: Jason Gunthorpe commit ae4c81644e9105d9f7f713bb0d444737bb6a0cf1 Author: Vaishali Thakkar Date: Wed Jan 5 19:07:05 2022 +0100 RDMA/rtrs-srv: Rename rtrs_srv_sess to rtrs_srv_path rtrs_srv_sess is used for paths and not sessions on the server side. This creates confusion so let's rename it to rtrs_srv_path. Also, rename related variables and functions. Coccinelle is used to do the transformations for most of the occurrences and remaining ones were handled manually. Link: https://lore.kernel.org/r/20220105180708.7774-3-jinpu.wang@ionos.com Signed-off-by: Vaishali Thakkar Signed-off-by: Jack Wang Signed-off-by: Jason Gunthorpe commit d9372794717f44b6e746d8fbab66763b6d753e71 Author: Vaishali Thakkar Date: Wed Jan 5 19:07:04 2022 +0100 RDMA/rtrs: Rename rtrs_sess to rtrs_path rtrs_sess is in fact a path. This makes it confusing and difficult to get into the code. So let's rename the structure and related use cases of it. Coccinelle was used to do the transformation for most of the occurrences and remaining ones were handled manually. Link: https://lore.kernel.org/r/20220105180708.7774-2-jinpu.wang@ionos.com Signed-off-by: Vaishali Thakkar Signed-off-by: Jack Wang Signed-off-by: Jason Gunthorpe commit b69c5b5886f3986f94ded29896211d520c57aea1 Merge: fff63521cd6e1 eabd0f88b0d2d Author: David S. Miller Date: Fri Jan 7 14:04:19 2022 +0000 Merge branch 'octeontx2-ptp-bugs' Subbaraya Sundeep says: ==================== octeontx2: Fix PTP bugs This patchset addresses two problems found when using ptp. Patch 1 - Increases the refcount of ptp device before use which was missing and it lead to refcount increment after use bug when module is loaded and unloaded couple of times. Patch 2 - PTP resources allocated by VF are not being freed during VF teardown. This patch fixes that. ==================== Signed-off-by: David S. Miller commit eabd0f88b0d2d433c5dfe88218d4ce1c11ef04b8 Author: Rakesh Babu Saladi Date: Fri Jan 7 12:00:30 2022 +0530 octeontx2-nicvf: Free VF PTP resources. When a VF is removed respective PTP resources are not being freed currently. This patch fixes it. Fixes: 43510ef4ddad ("octeontx2-nicvf: Add PTP hardware clock support to NIX VF") Signed-off-by: Rakesh Babu Saladi Signed-off-by: Subbaraya Sundeep Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit 93440f4888cf049dbd22b41aaf94d2e2153b3eb8 Author: Subbaraya Sundeep Date: Fri Jan 7 12:00:29 2022 +0530 octeontx2-af: Increment ptp refcount before use Before using the ptp pci device by AF driver increment the reference count of it. Fixes: a8b90c9d26d6 ("octeontx2-af: Add PTP device id for CN10K and 95O silcons") Signed-off-by: Subbaraya Sundeep Signed-off-by: Sunil Goutham Signed-off-by: David S. Miller commit 8a3fa72f4b389a17b8bab5ebfb8b660eeb9f9921 Author: Wenpeng Liang Date: Fri Dec 31 18:13:41 2021 +0800 RDMA/hns: Modify the hop num of HIP09 EQ to 1 HIP09 EQ does not support level 2 addressing. Link: https://lore.kernel.org/r/20211231101341.45759-3-liangwenpeng@huawei.com Signed-off-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe commit 0770bd4187c555e6df087f7abc252eeacb0842ec Author: David Howells Date: Wed Jul 22 10:44:34 2020 +0100 afs: Skip truncation on the server of data we haven't written yet Don't send a truncation RPC to the server if we're only shortening data that's in the pagecache and is beyond the server's EOF. Also don't automatically force writeback on setattr, but do wait to store RPCs that are in the region to be removed on a shortening truncation. Signed-off-by: David Howells Tested-by: kafs-testing@auristor.com Acked-by: Jeff Layton cc: Marc Dionne cc: linux-afs@lists.infradead.org Link: https://lore.kernel.org/r/163819663275.215744.4781075713714590913.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906972600.143852.14237659724463048094.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967177522.1823006.15336589054269480601.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021571880.640689.1837025861707111004.stgit@warthog.procyon.org.uk/ # v4 commit c7f75ef33b6dcd4269d0f6ee8c50221ee3390733 Author: David Howells Date: Thu Feb 6 14:22:30 2020 +0000 afs: Copy local writes to the cache when writing to the server When writing to the server from afs_writepage() or afs_writepages(), copy the data to the cache object too. To make this possible, the cookie must have its active users count incremented when the page is dirtied and kept incremented until we manage to clean up all the pages. This allows the writeback to take place after the last file struct is released. Signed-off-by: David Howells Tested-by: kafs-testing@auristor.com Acked-by: Jeff Layton cc: Marc Dionne cc: linux-afs@lists.infradead.org cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819662333.215744.7531373404219224438.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906970998.143852.674420788614608063.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967176564.1823006.16666056085593949570.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021570208.640689.9193494979708031862.stgit@warthog.procyon.org.uk/ # v4 commit 523d27cda149cfc8c99159c0f68f690e4d3b9d14 Author: David Howells Date: Thu Feb 6 14:22:21 2020 +0000 afs: Convert afs to use the new fscache API Change the afs filesystem to support the new afs driver. The following changes have been made: (1) The fscache_netfs struct is no more, and there's no need to register the filesystem as a whole. There's also no longer a cell cookie. (2) The volume cookie is now an fscache_volume cookie, allocated with fscache_acquire_volume(). This function takes three parameters: a string representing the "volume" in the index, a string naming the cache to use (or NULL) and a u64 that conveys coherency metadata for the volume. For afs, I've made it render the volume name string as: "afs,," and the coherency data is currently 0. (3) The fscache_cookie_def is no more and needed information is passed directly to fscache_acquire_cookie(). The cache no longer calls back into the filesystem, but rather metadata changes are indicated at other times. fscache_acquire_cookie() is passed the same keying and coherency information as before, except that these are now stored in big endian form instead of cpu endian. This makes the cache more copyable. (4) fscache_use_cookie() and fscache_unuse_cookie() are called when a file is opened or closed to prevent a cache file from being culled and to keep resources to hand that are needed to do I/O. fscache_use_cookie() is given an indication if the cache is likely to be modified locally (e.g. the file is open for writing). fscache_unuse_cookie() is given a coherency update if we had the file open for writing and will update that. (5) fscache_invalidate() is now given uptodate auxiliary data and a file size. It can also take a flag to indicate if this was due to a DIO write. This is wrapped into afs_fscache_invalidate() now for convenience. (6) fscache_resize() now gets called from the finalisation of afs_setattr(), and afs_setattr() does use/unuse of the cookie around the call to support this. (7) fscache_note_page_release() is called from afs_release_page(). (8) Use a killable wait in nfs_vm_page_mkwrite() when waiting for PG_fscache to be cleared. Render the parts of the cookie key for an afs inode cookie as big endian. Changes ======= ver #2: - Use gfpflags_allow_blocking() rather than using flag directly. - fscache_acquire_volume() now returns errors. Signed-off-by: David Howells Acked-by: Jeff Layton Tested-by: kafs-testing@auristor.com cc: Marc Dionne cc: linux-afs@lists.infradead.org cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819661382.215744.1485608824741611837.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906970002.143852.17678518584089878259.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967174665.1823006.1301789965454084220.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021568841.640689.6684240152253400380.stgit@warthog.procyon.org.uk/ # v4 commit 9f08ebc3438baaaefcc79654b330209b83397f17 Author: David Howells Date: Fri Oct 22 09:17:58 2021 +0100 fscache, cachefiles: Display stat of culling events Add a stat counter of culling events whereby the cache backend culls a file to make space (when asked by cachefilesd in this case) and display in /proc/fs/fscache/stats. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819654165.215744.3797804661644212436.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906961387.143852.9291157239960289090.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967168266.1823006.14436200166581605746.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021567619.640689.4339228906248763197.stgit@warthog.procyon.org.uk/ # v4 commit 3929eca769b5a231010b4978acc61c0735da198f Author: David Howells Date: Thu Oct 21 21:58:29 2021 +0100 fscache, cachefiles: Display stats of no-space events Add stat counters of no-space events that caused caching not to happen and display in /proc/fs/fscache/stats. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819653216.215744.17210522251617386509.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906958369.143852.7257100711818401748.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967166917.1823006.14842444049198947892.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021566184.640689.4417328329632709265.stgit@warthog.procyon.org.uk/ # v4 commit ecd1a5f62eed35d812de8fe20703e21b551c6560 Author: David Howells Date: Fri Nov 26 21:04:23 2021 +0000 cachefiles: Allow cachefiles to actually function Remove the block that allowed cachefiles to be compiled but prevented it from actually starting a cache. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819649497.215744.2872504990762846767.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906956491.143852.4951522864793559189.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967165374.1823006.14248189932202373809.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021564379.640689.7921380491176827442.stgit@warthog.procyon.org.uk/ # v4 commit 32e150037dce368d129996ffe5f98217b1974d9e Author: David Howells Date: Tue Dec 14 09:51:43 2021 +0000 fscache, cachefiles: Store the volume coherency data Store the volume coherency data in an xattr and check it when we rebind the volume. If it doesn't match the cache volume is moved to the graveyard and rebuilt anew. Changes ======= ver #4: - Remove a couple of debugging prints. Signed-off-by: David Howells Reviewed-by: Jeff Layton Link: https://lore.kernel.org/r/163967164397.1823006.2950539849831291830.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021563138.640689.15851092065380543119.stgit@warthog.procyon.org.uk/ # v4 commit 047487c947e8b96b94579c3a33207bd4e266b4c6 Author: David Howells Date: Thu Oct 21 00:19:46 2021 +0100 cachefiles: Implement the I/O routines Implement the I/O routines for cachefiles. There are two sets of routines here: preparation and actual I/O. Preparation for read involves looking to see whether there is data present, and how much. Netfslib tells us what it wants us to do and we have the option of adjusting shrinking and telling it whether to read from the cache, download from the server or simply clear a region. Preparation for write involves checking for space and defending against possibly running short of space, if necessary punching out a hole in the file so that we don't leave old data in the cache if we update the coherency information. Then there's a read routine and a write routine. They wait for the cookie state to move to something appropriate and then start a potentially asynchronous direct I/O operation upon it. Changes ======= ver #2: - Fix a misassigned variable[1]. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/YaZOCk9zxApPattb@archlinux-ax161/ [1] Link: https://lore.kernel.org/r/163819647945.215744.17827962047487125939.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906954666.143852.1504887120569779407.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967163110.1823006.9206718511874339672.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021562168.640689.8802250542405732391.stgit@warthog.procyon.org.uk/ # v4 commit 7623ed6772de31cadcc474b87bcbc1db84cc1e8e Author: David Howells Date: Thu Oct 21 08:50:10 2021 +0100 cachefiles: Implement cookie resize for truncate Implement resizing an object, using truncate and/or fallocate to adjust the object. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819646631.215744.13819016478175576761.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906952877.143852.4140962906331914859.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967162168.1823006.5941985259926902274.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021560394.640689.9972155785508094960.stgit@warthog.procyon.org.uk/ # v4 commit 287fd611238dd4b7e32fd3a8985aa387d26c4f29 Author: David Howells Date: Thu Oct 21 11:05:53 2021 +0100 cachefiles: Implement begin and end I/O operation Implement the methods for beginning and ending an I/O operation. When called to begin an I/O operation, we are guaranteed that the cookie has reached a certain stage (we're called by fscache after it has done a suitable wait). If a file is available, we paste a ref over into the cache resources for the I/O routines to use. This means that the object can be invalidated whilst the I/O is ongoing without the need to synchronise as the file pointer in the object is replaced, but the file pointer in the cache resources is unaffected. Ending the operation just requires ditching any refs we have and dropping the access guarantee that fscache got for us on the cookie. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819645033.215744.2199344081658268312.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906951916.143852.9531384743995679857.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967161222.1823006.4461476204800357263.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021559030.640689.3684291785218094142.stgit@warthog.procyon.org.uk/ # v4 commit 1f08c925e7a38002bde509e66f6f891468848511 Author: David Howells Date: Thu Oct 21 08:50:10 2021 +0100 cachefiles: Implement backing file wrangling Implement the wrangling of backing files, including the following pieces: (1) Lookup and creation of a file on disk, using a tmpfile if the file isn't yet present. The file is then opened, sized for DIO and the file handle is attached to the cachefiles_object struct. The inode is marked to indicate that it's in use by a kernel service. (2) Invalidation of an object, creating a tmpfile and switching the file pointer in the cachefiles object. (3) Committing a file to disk, including setting the coherency xattr on it and, if necessary, creating a hard link to it. Note that this would be a good place to use Omar Sandoval's vfs_link() with AT_LINK_REPLACE[1] as I may have to unlink an old file before I can link a tmpfile into place. (4) Withdrawal of open objects when a cache is being withdrawn or a cookie is relinquished. This involves committing or discarding the file. Changes ======= ver #2: - Fix logging of wrong error[1]. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/20211203094950.GA2480@kili/ [1] Link: https://lore.kernel.org/r/163819644097.215744.4505389616742411239.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906949512.143852.14222856795032602080.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967158526.1823006.17482695321424642675.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021557060.640689.16373541458119269871.stgit@warthog.procyon.org.uk/ # v4 commit 07a90e97400c15967c8754fa271ba24d9df71ab5 Author: David Howells Date: Thu Oct 21 08:50:10 2021 +0100 cachefiles: Implement culling daemon commands Implement the ability for the userspace daemon to try and cull a file or directory in the cache. Two daemon commands are implemented: (1) The "inuse" command. This queries if a file is in use or whether it can be deleted. It checks the S_KERNEL_FILE flag on the inode referred to by the specified filename. (2) The "cull" command. This asks for a file or directory to be removed, where removal means either unlinking it or moving it to the graveyard directory for userspace to dismantle. Changes ======= ver #2: - Fix logging of wrong error[1]. - Need to unmark an inode we've moved to the graveyard before unlocking. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/20211203094950.GA2480@kili/ [1] Link: https://lore.kernel.org/r/163819643179.215744.13641580295708315695.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906945705.143852.8177595531814485350.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967155792.1823006.1088936326902550910.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021555037.640689.9472627499842585255.stgit@warthog.procyon.org.uk/ # v4 commit 169379eaef933ca98c279257cacb313a02f9984d Author: David Howells Date: Thu Nov 18 08:58:08 2021 +0000 cachefiles: Mark a backing file in use with an inode flag Use an inode flag, S_KERNEL_FILE, to mark that a backing file is in use by the kernel to prevent cachefiles or other kernel services from interfering with that file. Using S_SWAPFILE instead isn't really viable as that has other effects in the I/O paths. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819642273.215744.6414248677118690672.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906943215.143852.16972351425323967014.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967154118.1823006.13227551961786743991.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021541207.640689.564689725898537127.stgit@warthog.procyon.org.uk/ # v4 Link: https://lore.kernel.org/r/164021552299.640689.10578652796777392062.stgit@warthog.procyon.org.uk/ # v4 commit 72b957856b0c09eee542afcff29705dd0adda654 Author: David Howells Date: Wed Nov 17 16:11:07 2021 +0000 cachefiles: Implement metadata/coherency data storage in xattrs Use an xattr on each backing file in the cache to store some metadata, such as the content type and the coherency data. Five content types are defined: (0) No content stored. (1) The file contains a single monolithic blob and must be all or nothing. This would be used for something like an AFS directory or a symlink. (2) The file is populated with content completely up to a point with nothing beyond that. (3) The file has a map attached and is sparsely populated. This would be stored in one or more additional xattrs. (4) The file is dirty, being in the process of local modification and the contents are not necessarily represented correctly by the metadata. The file should be deleted if this is seen on binding. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819641320.215744.16346770087799536862.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906942248.143852.5423738045012094252.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967151734.1823006.9301249989443622576.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021550471.640689.553853918307994335.stgit@warthog.procyon.org.uk/ # v4 commit 5d439467b802f5c6393b20d57662500dfb177c8f Author: David Howells Date: Wed Nov 17 15:48:06 2021 +0000 cachefiles: Implement key to filename encoding Implement a function to encode a binary cookie key as something that can be used as a filename. Four options are considered: (1) All printable chars with no '/' characters. Prepend a 'D' to indicate the encoding but otherwise use as-is. (2) Appears to be an array of __be32. Encode as 'S' plus a list of hex-encoded 32-bit ints separated by commas. If a number is 0, it is rendered as "" instead of "0". (3) Appears to be an array of __le32. Encoded as (2) but with a 'T' encoding prefix. (4) Encoded as base64 with an 'E' prefix plus a second char indicating how much padding is involved. A non-standard base64 encoding is used because '/' cannot be used in the encoded form. If (1) is not possible, whichever of (2), (3) or (4) produces the shortest string is selected (hex-encoding a number may be less dense than base64 encoding it). Note that the prefix characters have to be selected from the set [DEIJST@] lest cachefilesd remove the files because it recognise the name. Changes ======= ver #2: - Fix a short allocation that didn't allow for a string terminator[1] Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/bcefb8f2-576a-b3fc-cc29-89808ebfd7c1@linux.alibaba.com/ [1] Link: https://lore.kernel.org/r/163819640393.215744.15212364106412961104.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906940529.143852.17352132319136117053.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967149827.1823006.6088580775428487961.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021549223.640689.14762875188193982341.stgit@warthog.procyon.org.uk/ # v4 commit df98e87f2091774c377ddfaedfe64bd90ed4bdca Author: David Howells Date: Wed Nov 17 16:22:21 2021 +0000 cachefiles: Implement object lifecycle funcs Implement allocate, get, see and put functions for the cachefiles_object struct. The members of the struct we're going to need are also added. Additionally, implement a lifecycle tracepoint. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819639457.215744.4600093239395728232.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906939569.143852.3594314410666551982.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967148857.1823006.6332962598220464364.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021547762.640689.8422781599594931000.stgit@warthog.procyon.org.uk/ # v4 commit 13871bad1ef7f41947c816a9e342aa9fa8643c5e Author: David Howells Date: Tue Nov 16 16:30:25 2021 +0000 cachefiles: Add tracepoints for calls to the VFS Add tracepoints in cachefiles to monitor when it does various VFS operations, such as mkdir. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819638517.215744.12773133137536579766.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906938316.143852.17227990869551737803.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967147139.1823006.4909879317496543392.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021546287.640689.3501604495002415631.stgit@warthog.procyon.org.uk/ # v4 commit fe2140e2f57fef8562e0f9b7cd447d2b08dc2f35 Author: David Howells Date: Thu Oct 21 09:55:21 2021 +0100 cachefiles: Implement volume support Implement support for creating the directory layout for a volume on disk and setting up and withdrawing volume caching. Each volume has a directory named for the volume key under the root of the cache (prefixed with an 'I' to indicate to cachefilesd that it's an index) and then creates a bunch of hash bucket subdirectories under that (named as '@' plus a hex number) in which cookie files will be created. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819635314.215744.13081522301564537723.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906936397.143852.17788457778396467161.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967143860.1823006.7185205806080225038.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021545212.640689.5064821392307582927.stgit@warthog.procyon.org.uk/ # v4 commit d1065b0a6fd9397edd3094c56b777d0d8ec1290d Author: David Howells Date: Fri Nov 26 14:29:06 2021 +0000 cachefiles: Implement cache registration and withdrawal Do the following: (1) Fill out cachefiles_daemon_add_cache() so that it sets up the cache directories and registers the cache with cachefiles. (2) Add a function to do the top-level part of cache withdrawal and unregistration. (3) Add a function to sync a cache. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819633175.215744.10857127598041268340.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906935445.143852.15545194974036410029.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967142904.1823006.244055483596047072.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021543872.640689.14370017789605073222.stgit@warthog.procyon.org.uk/ # v4 commit 32759f7d7af5454c616574190c388e1a59184f92 Author: David Howells Date: Thu Oct 21 08:34:55 2021 +0100 cachefiles: Implement a function to get/create a directory in the cache Implement a function to get/create structural directories in the cache. This is used for setting up a cache and creating volume substructures. The directory in memory are marked with the S_KERNEL_FILE inode flag whilst they're in use to tell rmdir to reject attempts to remove them. Changes ======= ver #3: - Return an indication as to whether the directory was freshly created. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819631182.215744.3322471539523262619.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906933130.143852.962088616746509062.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967141952.1823006.7832985646370603833.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021542169.640689.18266858945694357839.stgit@warthog.procyon.org.uk/ # v4 commit 1bd9c4e4f0494915b2391f373d25096579f835ff Author: David Howells Date: Thu Nov 18 08:58:08 2021 +0000 vfs, cachefiles: Mark a backing file in use with an inode flag Use an inode flag, S_KERNEL_FILE, to mark that a backing file is in use by the kernel to prevent cachefiles or other kernel services from interfering with that file. Alter rmdir to reject attempts to remove a directory marked with this flag. This is used by cachefiles to prevent cachefilesd from removing them. Using S_SWAPFILE instead isn't really viable as that has other effects in the I/O paths. Changes ======= ver #3: - Check for the object pointer being NULL in the tracepoints rather than the caller. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819630256.215744.4815885535039369574.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906931596.143852.8642051223094013028.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967141000.1823006.12920680657559677789.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021541207.640689.564689725898537127.stgit@warthog.procyon.org.uk/ # v4 commit 80f94f29f677d32a1edabc055acfe91c00803592 Author: David Howells Date: Thu Oct 21 08:59:46 2021 +0100 cachefiles: Provide a function to check how much space there is Provide a function to check how much space there is. This also flips the state on the cache and will signal the daemon to inform it of the change and to ask it to do some culling if necessary. We will also need to subtract the amount of data currently being written to the cache (cache->b_writing) from the amount of available space to avoid hitting ENOSPC accidentally. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819629322.215744.13457425294680841213.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906930100.143852.1681026700865762069.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967140058.1823006.7781243664702837128.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021539957.640689.12477177372616805706.stgit@warthog.procyon.org.uk/ # v4 commit 8667d434b2a993b34a9dae6f6673bf93870fac25 Author: David Howells Date: Fri Nov 26 15:12:07 2021 +0000 cachefiles: Register a miscdev and parse commands over it Register a misc device with which to talk to the daemon. The misc device holds a cache set up through it around and closing the device kills the cache. cachefilesd communicates with the kernel by passing it single-line text commands. Parse these and use them to parameterise the cache state. This does not implement the command to actually bring a cache online. That's left for later. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819628388.215744.17712097043607299608.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906929128.143852.14065207858943654011.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967139085.1823006.3514846391807454287.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021538400.640689.9172006906288062041.stgit@warthog.procyon.org.uk/ # v4 commit 254947d47945f2fa02e9b3366594fad2ed127618 Author: David Howells Date: Fri Nov 26 14:59:10 2021 +0000 cachefiles: Add security derivation Implement code to derive a new set of creds for the cachefiles to use when making VFS or I/O calls and to change the auditing info since the application interacting with the network filesystem is not accessing the cache directly. Cachefiles uses override_creds() to change the effective creds temporarily. set_security_override_from_ctx() is called to derive the LSM 'label' that the cachefiles driver will act with. set_create_files_as() is called to determine the LSM 'label' that will be applied to files and directories created in the cache. These functions alter the new creds. Also implement a couple of functions to wrap the calls to begin/end cred overriding. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819627469.215744.3603633690679962985.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906928172.143852.15886637013364286786.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967138138.1823006.7620933448261939504.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021537001.640689.4081334436031700558.stgit@warthog.procyon.org.uk/ # v4 commit 1493bf74bcf2434a840eacef60c0f56966faa11a Author: David Howells Date: Thu Oct 21 09:08:54 2021 +0100 cachefiles: Add cache error reporting macro Add a macro to report a cache I/O error and to tell fscache that the cache is in trouble. Also add a pointer to the fscache cache cookie from the cachefiles_cache struct as we need that to pass to fscache_io_error(). Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819626562.215744.1503690975344731661.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906927235.143852.13694625647880837563.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967137158.1823006.2065038830569321335.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021536053.640689.5306822604644352548.stgit@warthog.procyon.org.uk/ # v4 commit ecf5a6ce15f90d1fe6bc326c720d21fc0e73fc88 Author: David Howells Date: Thu Oct 21 08:42:18 2021 +0100 cachefiles: Add a couple of tracepoints for logging errors Add two trace points to log errors, one for vfs operations like mkdir or create, and one for I/O operations, like read, write or truncate. Also add the beginnings of a struct that is going to represent a data file and place a debugging ID in it for the tracepoints to record. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819625632.215744.17907340966178411033.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906926297.143852.18267924605548658911.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967135390.1823006.2512120406360156424.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021534029.640689.1875723624947577095.stgit@warthog.procyon.org.uk/ # v4 commit a70f6526267e9f5fbf958a69c6112938b0b14bc4 Author: David Howells Date: Thu Oct 21 08:15:26 2021 +0100 cachefiles: Add some error injection support Add support for injecting ENOSPC or EIO errors. This needs to be enabled by CONFIG_CACHEFILES_ERROR_INJECTION=y. Once enabled, ENOSPC on things like write and mkdir can be triggered by: echo 1 >/proc/sys/cachefiles/error_injection and EIO can be triggered on most operations by: echo 2 >/proc/sys/cachefiles/error_injection Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819624706.215744.6911916249119962943.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906925343.143852.5465695512984025812.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967134412.1823006.7354285948280296595.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021532340.640689.18209494225772443698.stgit@warthog.procyon.org.uk/ # v4 commit 8390fbc46570dca6f1c7b170f19c612f9ec91a92 Author: David Howells Date: Fri Nov 26 14:45:38 2021 +0000 cachefiles: Define structs Define the cachefiles_cache struct that's going to carry the cache-level parameters and state of a cache. Define the beginning of the cachefiles_object struct that's going to carry the state for a data storage object. For the moment this is just a debugging ID for logging purposes. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819623690.215744.2824739137193655547.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906924292.143852.15881439716653984905.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967131405.1823006.4480555941533935597.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021530610.640689.846094074334176928.stgit@warthog.procyon.org.uk/ # v4 commit 77443f6171f32626f24b2f97494c71a6bd83831a Author: David Howells Date: Fri Nov 26 14:32:29 2021 +0000 cachefiles: Introduce rewritten driver Introduce basic skeleton of the rewritten cachefiles driver including config options so that it can be enabled for compilation. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819622766.215744.9108359326983195047.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906923341.143852.3856498104256721447.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967130320.1823006.15791456613198441566.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021528993.640689.9069695476048171884.stgit@warthog.procyon.org.uk/ # v4 commit 16a96bdf92d5af06f9fa6a01a4b08e2fdfed2e5b Author: David Howells Date: Wed Oct 20 14:06:34 2021 +0100 fscache: Provide a function to resize a cookie Provide a function to change the size of the storage attached to a cookie, to match the size of the file being cached when it's changed by truncate or fallocate: void fscache_resize_cookie(struct fscache_cookie *cookie, loff_t new_size); This acts synchronously and is expected to run under the inode lock of the caller. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819621839.215744.7895597119803515402.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906922387.143852.16394459879816147793.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967128998.1823006.10740669081985775576.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021527861.640689.3466382085497236267.stgit@warthog.procyon.org.uk/ # v4 commit 1f67e6d0b18853c641d861a671f46a4964a88510 Author: David Howells Date: Wed Oct 20 14:06:34 2021 +0100 fscache: Provide a function to note the release of a page Provide a function to be called from a network filesystem's releasepage method to indicate that a page has been released that might have been a reflection of data upon the server - and now that data must be reloaded from the server or the cache. This is used to end an optimisation for empty files, in particular files that have just been created locally, whereby we know there cannot yet be any data that we would need to read from the server or the cache. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819617128.215744.4725572296135656508.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906920354.143852.7511819614661372008.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967128061.1823006.611781655060034988.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021525963.640689.9264556596205140044.stgit@warthog.procyon.org.uk/ # v4 commit 69c1b87516e327a60b39f96b778fe683259408bf Author: Miaoqian Lin Date: Fri Jan 7 07:54:24 2022 +0000 spi: spi-meson-spifc: Add missing pm_runtime_disable() in meson_spifc_probe If the probe fails, we should use pm_runtime_disable() to balance pm_runtime_enable(). Add missing pm_runtime_disable() for meson_spifc_probe. Fixes: c3e4bc5434d2 ("spi: meson: Add support for Amlogic Meson SPIFC") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220107075424.7774-1-linmq006@gmail.com Signed-off-by: Mark Brown commit c8c9cb6d9fbeace1c5509f4bb2f3c32095cda0d0 Author: Qinghua Jin Date: Fri Jan 7 10:46:31 2022 +0800 spi: atmel: Fix typo Change 'actualy' to 'actually' Signed-off-by: Qinghua Jin Link: https://lore.kernel.org/r/20220107024631.396862-1-qhjin.dev@gmail.com Signed-off-by: Mark Brown commit bfff546aae50ae68ed395bf0e0848188d27b0ba3 Author: Watson Chow Date: Fri Jan 7 00:43:50 2022 +0200 regulator: Add MAX20086-MAX20089 driver The MAX20086-MAX20089 are dual/quad power protectors for cameras. Add a driver that supports controlling the outputs individually. Additional features, such as overcurrent detection, may be added later if needed. Signed-off-by: Watson Chow Signed-off-by: Laurent Pinchart Link: https://lore.kernel.org/r/20220106224350.16957-3-laurent.pinchart+renesas@ideasonboard.com Signed-off-by: Mark Brown commit 764aaa4e031a9acd26babc622cabe652f57bbb04 Author: Laurent Pinchart Date: Fri Jan 7 00:43:49 2022 +0200 dt-bindings: regulators: Add bindings for Maxim MAX20086-MAX20089 The MAX20086-MAX20089 are dual/quad power protectors for cameras. Add corresponding DT bindings. Signed-off-by: Laurent Pinchart Link: https://lore.kernel.org/r/20220106224350.16957-2-laurent.pinchart+renesas@ideasonboard.com Signed-off-by: Mark Brown commit 36c86a9e1be3b29f9f075a946df55dfe1d818019 Author: Qu Wenruo Date: Thu Dec 16 19:47:36 2021 +0800 btrfs: output more debug messages for uncommitted transaction Print extra information about how many dirty bytes an uncommitted has at the end of mount. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit c2f822635df873c510bda6fb7fd1b10b7c31be2d Author: Filipe Manana Date: Thu Dec 16 15:00:32 2021 +0000 btrfs: respect the max size in the header when activating swap file If we extended the size of a swapfile after its header was created (by the mkswap utility) and then try to activate it, we will map the entire file when activating the swap file, instead of limiting to the max size defined in the swap file's header. Currently test case generic/643 from fstests fails because we do not respect that size limit defined in the swap file's header. So fix this by not mapping file ranges beyond the max size defined in the swap header. This is the same type of bug that iomap used to have, and was fixed in commit 36ca7943ac18ae ("mm/swap: consider max pages in iomap_swapfile_add_extent"). Fixes: ed46ff3d423780 ("Btrfs: support swap files") CC: stable@vger.kernel.org # 5.4+ Reviewed-and-tested-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit be8d1a2ab98998d369c14c3deb600a31708a66c5 Author: Yang Li Date: Mon Dec 20 15:23:06 2021 +0800 btrfs: fix argument list that the kdoc format and script verified The warnings were found by running scripts/kernel-doc, which is caused by using 'make W=1'. fs/btrfs/extent_io.c:3210: warning: Function parameter or member 'bio_ctrl' not described in 'btrfs_bio_add_page' fs/btrfs/extent_io.c:3210: warning: Excess function parameter 'bio' description in 'btrfs_bio_add_page' fs/btrfs/extent_io.c:3210: warning: Excess function parameter 'prev_bio_flags' description in 'btrfs_bio_add_page' fs/btrfs/space-info.c:1602: warning: Excess function parameter 'root' description in 'btrfs_reserve_metadata_bytes' fs/btrfs/space-info.c:1602: warning: Function parameter or member 'fs_info' not described in 'btrfs_reserve_metadata_bytes' Note: this is fixing only the warnings regarding parameter list, the first line is not strictly conforming to the kdoc format as the btrfs codebase does not stick to that and keeps the first line more free form (because it's only for internal use). Reported-by: Abaci Robot Signed-off-by: Yang Li Reviewed-by: David Sterba [ add note ] Signed-off-by: David Sterba commit 4a9e803e5b392e2b1e511d0097f6d2c7e6ea41e7 Author: Su Yue Date: Mon Dec 27 18:18:39 2021 +0800 btrfs: remove unnecessary parameter type from compression_decompress_bio btrfs_decompress_bio, the only caller of compression_decompress_bio gets type from @cb and passes it to compression_decompress_bio. However, compression_decompress_bio can get compression type directly from @cb. So remove the parameter and access it through @cb. No functional change. Reviewed-by: Qu Wenruo Signed-off-by: Su Yue Reviewed-by: David Sterba Signed-off-by: David Sterba commit 856e47946c6da280816ed9b9c32083c102838ba0 Author: Qu Wenruo Date: Thu Dec 30 16:45:13 2021 +0800 btrfs: selftests: dump extent io tree if extent-io-tree test failed When code modifying extent-io-tree get modified and got that selftest failed, it can take some time to pin down the cause. To make it easier to expose the problem, dump the extent io tree if the selftest failed. This can save developers debug time, especially since the selftest we can not use the trace events, thus have to manually add debug trace points. Reviewed-by: Josef Bacik Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 2ae8ae3d3def4c3ba73a58cc2531c42f0916f14e Author: Qu Wenruo Date: Wed Dec 15 14:59:42 2021 +0800 btrfs: scrub: cleanup the argument list of scrub_stripe() The argument list of btrfs_stripe() has similar problems of scrub_chunk(): - Duplicated and ambiguous @base argument Can be fetched from btrfs_block_group::bg. - Ambiguous argument @length It's again device extent length - Ambiguous argument @num The instinctive guess would be mirror number, but in fact it's stripe index. Fix it by: - Remove @base parameter - Rename @length to @dev_extent_len - Rename @num to @stripe_index Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit d04fbe19aefd28570a442e79aae226dd742ddc4c Author: Qu Wenruo Date: Wed Dec 15 14:59:41 2021 +0800 btrfs: scrub: cleanup the argument list of scrub_chunk() The argument list of scrub_chunk() has the following problems: - Duplicated @chunk_offset It is the same as btrfs_block_group::start. - Confusing @length The most instinctive guess is chunk length, and one may want to delete it, but the truth is, it's the device extent length. Fix this by: - Remove @chunk_offset Use btrfs_block_group::start instead. - Rename @length to @dev_extent_len Also rename the caller to remove the ambiguous naming. - Rename @cache to @bg The "_cache" suffix for btrfs_block_group has been removed for a while. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit f26c92386028563a1e988bb277c6c5ce2e8010ee Author: Qu Wenruo Date: Tue Dec 14 21:01:45 2021 +0800 btrfs: remove reada infrastructure Currently there is only one user for btrfs metadata readahead, and that's scrub. But even for the single user, it's not providing the correct functionality it needs, as scrub needs reada for commit root, which current readahead can't provide. (Although it's pretty easy to add such feature). Despite this, there are some extra problems related to metadata readahead: - Duplicated feature with btrfs_path::reada - Partly duplicated feature of btrfs_fs_info::buffer_radix Btrfs already caches its metadata in buffer_radix, while readahead tries to read the tree block no matter if it's already cached. - Poor layer separation Metadata readahead works kinda at device level. This is definitely not the correct layer it should be, since metadata is at btrfs logical address space, it should not bother device at all. This brings extra chance for bugs to sneak in, while brings unnecessary complexity. - Dead code In the very beginning of scrub.c we have #undef DEBUG, rendering all the debug related code useless and unable to test. Thus here I purpose to remove the metadata readahead mechanism completely. [BENCHMARK] There is a full benchmark for the scrub performance difference using the old btrfs_reada_add() and btrfs_path::reada. For the worst case (no dirty metadata, slow HDD), there could be a 5% performance drop for scrub. For other cases (even SATA SSD), there is no distinguishable performance difference. The number is reported scrub speed, in MiB/s. The resolution is limited by the reported duration, which only has a resolution of 1 second. Old New Diff SSD 455.3 466.332 +2.42% HDD 103.927 98.012 -5.69% Comprehensive test methodology is in the cover letter of the patch. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit dcf62b204c06ac22a988c8563b20e479d206befc Author: Qu Wenruo Date: Tue Dec 14 21:01:44 2021 +0800 btrfs: scrub: use btrfs_path::reada for extent tree readahead For scrub, we trigger two readaheads for two trees, extent tree to get where to scrub, and csum tree to get the data checksum. For csum tree we already trigger readahead in btrfs_lookup_csums_range(), by setting path->reada. But for extent tree we don't have any path based readahead. Add the readahead for extent tree as well, so we can later remove the btrfs_reada_add() based readahead. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 2522dbe86b54ff07eb0819a20534c0d33c5414cd Author: Qu Wenruo Date: Tue Dec 14 21:01:43 2021 +0800 btrfs: scrub: remove the unnecessary path parameter for scrub_raid56_parity() In function scrub_stripe() we allocated two btrfs_path's, one @path for extent tree search and another @ppath for full stripe extent tree search for RAID56. This is totally umncessary, as the @ppath usage is completely inside scrub_raid56_parity(), thus we can move the path allocation into scrub_raid56_parity() completely. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit c1227996438050ee1a592db40404a088a205e66f Author: Nikolay Borisov Date: Tue Dec 14 15:39:39 2021 +0200 btrfs: refactor unlock_up The purpose of this function is to unlock all nodes in a btrfs path which are above 'lowest_unlock' and whose slot used is different than 0. As such it used slightly awkward structure of 'if' as well as somewhat cryptic "no_skip" control variable which denotes whether we should check the current level of skipability or no. This patch does the following (cosmetic) refactorings: * Renames 'no_skip' to 'check_skip' and makes it a boolean. This variable controls whether we are below the lowest_unlock/skip_level levels. * Consolidates the 2 conditions which warrant checking whether the current level should be skipped under 1 common if (check_skip) branch, this increase indentation level but is not critical. * Consolidates the 'skip_level < i && i >= lowest_unlock' and 'i >= lowest_unlock && i > skip_level' condition into a common branch since those are identical. * Eliminates the local extent_buffer variable as in this case it doesn't bring anything to function readability. Reviewed-by: Josef Bacik Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 1b58ae0e4d3ede95ee968a3f097298a57cf711ba Author: Filipe Manana Date: Mon Dec 13 08:45:14 2021 +0000 btrfs: skip transaction commit after failure to create subvolume At ioctl.c:create_subvol(), when we fail to create a subvolume we always commit the transaction. In most cases this is a no-op, since all the error paths, except for one, abort the transaction - the only exception is when we fail to insert the new root item into the root tree, in that case we don't abort the transaction because we didn't do anything that is irreversible - however we end up committing the transaction which although is not a functional problem, it adds unnecessary rotation of the backup roots in the superblock and unnecessary work. So change that to commit a transaction only when no error happened, otherwise just call btrfs_end_transaction() to release our reference on the transaction. Reviewed-by: Nikolay Borisov Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 82187d2ecdfb22ab7ee05f388402a39236d31428 Author: Naohiro Aota Date: Wed Dec 8 00:35:49 2021 +0900 btrfs: zoned: fix chunk allocation condition for zoned allocator The ZNS specification defines a limit on the number of "active" zones. That limit impose us to limit the number of block groups which can be used for an allocation at the same time. Not to exceed the limit, we reuse the existing active block groups as much as possible when we can't activate any other zones without sacrificing an already activated block group in commit a85f05e59bc1 ("btrfs: zoned: avoid chunk allocation if active block group has enough space"). However, the check is wrong in two ways. First, it checks the condition for every raid index (ffe_ctl->index). Even if it reaches the condition and "ffe_ctl->max_extent_size >= ffe_ctl->min_alloc_size" is met, there can be other block groups having enough space to hold ffe_ctl->num_bytes. (Actually, this won't happen in the current zoned code as it only supports SINGLE profile. But, it can happen once it enables other RAID types.) Second, it checks the active zone availability depending on the raid index. The raid index is just an index for space_info->block_groups, so it has nothing to do with chunk allocation. These mistakes are causing a faulty allocation in a certain situation. Consider we are running zoned btrfs on a device whose max_active_zone == 0 (no limit). And, suppose no block group have a room to fit ffe_ctl->num_bytes but some room to meet ffe_ctl->min_alloc_size (i.e. max_extent_size > num_bytes >= min_alloc_size). In this situation, the following occur: - With SINGLE raid_index, it reaches the chunk allocation checking code - The check returns true because we can activate a new zone (no limit) - But, before allocating the chunk, it iterates to the next raid index (RAID5) - Since there are no RAID5 block groups on zoned mode, it again reaches the check code - The check returns false because of btrfs_can_activate_zone()'s "if (raid_index != BTRFS_RAID_SINGLE)" part - That results in returning -ENOSPC without allocating a new chunk As a result, we end up hitting -ENOSPC too early. Move the check to the right place in the can_allocate_chunk() hook, and do the active zone check depending on the allocation flag, not on the raid index. CC: stable@vger.kernel.org # 5.16 Signed-off-by: Naohiro Aota Signed-off-by: David Sterba commit 50475cd57706359d6cc652be88369dace7a4c2eb Author: Naohiro Aota Date: Wed Dec 8 00:35:48 2021 +0900 btrfs: add extent allocator hook to decide to allocate chunk or not Introduce a new hook for an extent allocator policy. With the new hook, a policy can decide to allocate a new block group or not. If not, it will return -ENOSPC, so btrfs_reserve_extent() will cut the allocation size in half and retry the allocation if min_alloc_size is large enough. The hook has a place holder and will be replaced with the real implementation in the next patch. CC: stable@vger.kernel.org # 5.16 Signed-off-by: Naohiro Aota Signed-off-by: David Sterba commit 1ada69f61c88abb75a1038ee457633325658a183 Author: Naohiro Aota Date: Wed Dec 8 00:35:47 2021 +0900 btrfs: zoned: unset dedicated block group on allocation failure Allocating an extent from a block group can fail for various reasons. When an allocation from a dedicated block group (for tree-log or relocation data) fails, we need to unregister it as a dedicated one so that we can allocate a new block group for the dedicated one. However, we are returning early when the block group in case it is read-only, fully used, or not be able to activate the zone. As a result, we keep the non-usable block group as a dedicated one, leading to further allocation failure. With many block groups, the allocator will iterate hopeless loop to find a free extent, results in a hung task. Fix the issue by delaying the return and doing the proper cleanups. CC: stable@vger.kernel.org # 5.16 Signed-off-by: Naohiro Aota Signed-off-by: David Sterba commit 736727100067267708d221632ffff4083fc0b278 Author: Johannes Thumshirn Date: Tue Dec 7 06:28:37 2021 -0800 btrfs: zoned: drop redundant check for REQ_OP_ZONE_APPEND and btrfs_is_zoned REQ_OP_ZONE_APPEND can only work on zoned devices, so it is redundant to check if the filesystem is zoned when REQ_OP_ZONE_APPEND is set as the bio's bio_op. Reviewed-by: Josef Bacik Signed-off-by: Johannes Thumshirn Reviewed-by: David Sterba Signed-off-by: David Sterba commit 554aed7da29bcadb3ee3cfdc1376da660d3fc849 Author: Johannes Thumshirn Date: Tue Dec 7 06:28:36 2021 -0800 btrfs: zoned: sink zone check into btrfs_repair_one_zone Sink zone check into btrfs_repair_one_zone() so we don't need to do it in all callers. Also as btrfs_repair_one_zone() doesn't return a sensible error, make it a boolean function and return false in case it got called on a non-zoned filesystem and true on a zoned filesystem. Reviewed-by: Josef Bacik Signed-off-by: Johannes Thumshirn Reviewed-by: David Sterba Signed-off-by: David Sterba commit 8fdf54fe69a7a0f11542c2dd322b590a5b935918 Author: Johannes Thumshirn Date: Tue Dec 7 06:28:35 2021 -0800 btrfs: zoned: simplify btrfs_check_meta_write_pointer btrfs_check_meta_write_pointer() will always be called with a NULL 'cache_ret' argument. As there's no need to check if we have a valid block_group passed in remove these checks. Reviewed-by: Josef Bacik Signed-off-by: Johannes Thumshirn Reviewed-by: David Sterba Signed-off-by: David Sterba commit 869f4cdc73f9378986755030c684c011f0b71517 Author: Johannes Thumshirn Date: Tue Dec 7 06:28:34 2021 -0800 btrfs: zoned: encapsulate inode locking for zoned relocation Encapsulate the inode lock needed for serializing the data relocation writes on a zoned filesystem into a helper. This streamlines the code reading flow and hides special casing for zoned filesystems. Reviewed-by: Josef Bacik Signed-off-by: Johannes Thumshirn Reviewed-by: David Sterba Signed-off-by: David Sterba commit a26d60dedf9af81df7aeaef66353eb391f85e7a9 Author: Anand Jain Date: Thu Oct 21 23:31:17 2021 +0800 btrfs: sysfs: add devinfo/fsid to retrieve actual fsid from the device In the case of the seed device, the fsid can be different from the mounted sprout fsid. The userland has to read the device superblock to know the fsid but, that idea fails if the device is missing. So add a sysfs interface devinfo//fsid to show the fsid of the device. For example: $ cd /sys/fs/btrfs/b10b02a5-f9de-4276-b9e8-2bfd09a578a8 $ cat devinfo/1/fsid c44d771f-639d-4df3-99ec-5bc7ad2af93b $ cat devinfo/3/fsid b10b02a5-f9de-4276-b9e8-2bfd09a578a8 Though it's related to seeding, the name of the sysfs file is plain fsid as it matches what blkid says. A path to the device's fsid will aid scripting. Reviewed-by: Josef Bacik Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: David Sterba commit c18e3235646a8ba74d013067a6475c8d262d3776 Author: Josef Bacik Date: Thu Dec 2 15:34:32 2021 -0500 btrfs: reserve extra space for the free space tree Filipe reported a problem where sometimes he'd get an ENOSPC abort when running delayed refs with generic/619 and the free space tree enabled. This is partly because we do not reserve space for modifying the free space tree, nor do we have a block rsv associated with that tree. The delayed_refs_rsv tracks the amount of space required to run delayed refs. This means 1 modification means 1 change to the extent root. With the free space tree this turns into 2 changes, because modifying 1 extent means updating the extent tree and potentially updating the free space tree to either remove that entry or add the free space. Thus if we have the FST enabled, simply double the reservation size for our modification. Reviewed-by: Nikolay Borisov Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit 9506f9538206acb9a3c24d1ffbd587733b185732 Author: Josef Bacik Date: Thu Dec 2 15:34:31 2021 -0500 btrfs: include the free space tree in the global rsv minimum calculation Filipe reported a problem where generic/619 was failing with an ENOSPC abort while running delayed refs, like the following BTRFS: Transaction aborted (error -28) WARNING: CPU: 3 PID: 522920 at fs/btrfs/free-space-tree.c:1049 add_to_free_space_tree+0xe5/0x110 [btrfs] CPU: 3 PID: 522920 Comm: kworker/u16:19 Tainted: G W 5.16.0-rc2-btrfs-next-106 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 Workqueue: events_unbound btrfs_async_reclaim_metadata_space [btrfs] RIP: 0010:add_to_free_space_tree+0xe5/0x110 [btrfs] RSP: 0000:ffffa65087fb7b20 EFLAGS: 00010282 RAX: 0000000000000000 RBX: 0000000000001000 RCX: 0000000000000000 RDX: 0000000000000001 RSI: ffffffff9131eeaa RDI: 00000000ffffffff RBP: ffff8d62e26481b8 R08: ffffffff9ad97ce0 R09: 0000000000000001 R10: 0000000000000000 R11: 0000000000000001 R12: 00000000ffffffe4 R13: ffff8d61c25fe688 R14: ffff8d61ebd88800 R15: ffff8d61ebd88a90 FS: 0000000000000000(0000) GS:ffff8d64ed400000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fa46a8b1000 CR3: 0000000148d18003 CR4: 0000000000370ee0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __btrfs_free_extent+0x516/0x950 [btrfs] __btrfs_run_delayed_refs+0x2b1/0x1250 [btrfs] btrfs_run_delayed_refs+0x86/0x210 [btrfs] flush_space+0x403/0x630 [btrfs] ? call_rcu_tasks_generic+0x50/0x80 ? lock_release+0x223/0x4a0 ? btrfs_get_alloc_profile+0xb5/0x290 [btrfs] ? do_raw_spin_unlock+0x4b/0xa0 btrfs_async_reclaim_metadata_space+0x139/0x320 [btrfs] process_one_work+0x24c/0x5b0 worker_thread+0x55/0x3c0 ? process_one_work+0x5b0/0x5b0 kthread+0x17c/0x1a0 ? set_kthread_struct+0x40/0x40 ret_from_fork+0x22/0x30 There's a couple of reasons for this, but in generic/619's case the largest reason is because it is a very small file system, ad we do not reserve enough space for the global reserve. With the free space tree we now have the free space tree that we need to modify when running delayed refs. This means we need the global reserve to take this into account when it calculates the minimum size it needs to be. This is especially important for very small file systems. Fix this by adjusting the minimum global block rsv size math to include the size of the free space tree when calculating the size. Reviewed-by: Nikolay Borisov Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit c9d328c0c4b0dc2e27c219d041855e74bb073ab0 Author: Qu Wenruo Date: Mon Dec 6 13:52:58 2021 +0800 btrfs: scrub: merge SCRUB_PAGES_PER_RD_BIO and SCRUB_PAGES_PER_WR_BIO These two values were introduced in commit ff023aac3119 ("Btrfs: add code to scrub to copy read data to another disk") as an optimization. But the truth is, block layer scheduler can do whatever it wants to merge/split bios to improve performance. Doing such "optimization" is not really going to affect much, especially considering how good current block layer optimizations are doing. Remove such old and immature optimization from our code. Since we're here, also change BUG_ON()s using these two macros to use ASSERT()s. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 0bb3acdc48243c0db9fd93fc904ce81bdb4049c9 Author: Qu Wenruo Date: Mon Dec 6 13:52:57 2021 +0800 btrfs: update SCRUB_MAX_PAGES_PER_BLOCK Use BTRFS_MAX_METADATA_BLOCKSIZE and SZ_4K (minimal sectorsize) to calculate this value. And remove one stale comment on the value, in fact with recent subpage support, BTRFS_MAX_METADATA_BLOCKSIZE * PAGE_SIZE is already beyond BTRFS_STRIPE_LEN, just we don't use the full page. Also since we're here, update the BUG_ON() related to SCRUB_MAX_PAGES_PER_BLOCK to ASSERT(). As those ASSERT() are really only for developers to catch early obvious bugs, not to let end users suffer. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba commit 8697b8f88e2a750685b73c16c2a1bd438795ae90 Author: Josef Bacik Date: Fri Dec 3 17:18:20 2021 -0500 btrfs: do not check -EAGAIN when truncating inodes in the log root We only throttle the btrfs_truncate_inode_items if the root is SHAREABLE, which isn't set on the log root, which means this loop is unnecessary. Reviewed-by: Filipe Manana Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit e48dac7f6f4c0410aa38dbd59b991f2b24b286ae Author: Josef Bacik Date: Fri Dec 3 17:18:19 2021 -0500 btrfs: make should_throttle loop local in btrfs_truncate_inode_items We reset this bool on every loop through the truncate loop, make this variable local to the loop. Reviewed-by: Filipe Manana Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 0adbc6190c34b2e39f67b086cefc260e30045f48 Author: Josef Bacik Date: Fri Dec 3 17:18:18 2021 -0500 btrfs: combine extra if statements in btrfs_truncate_inode_items We have if (del_item) // do something else // something else if (del_item) // do yet another thing else // something else entirely back to back in btrfs_truncate_inode_items, collapse these two sets of if statements into one. Reviewed-by: Filipe Manana Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 376b91d5702f8db14beb55148039684f808e0693 Author: Josef Bacik Date: Fri Dec 3 17:18:17 2021 -0500 btrfs: convert BUG() for pending_del_nr into an ASSERT This is a logic correctness check, convert it into an ASSERT() instead of a BUG(). Reviewed-by: Filipe Manana Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 56e1edb0e3334db479b8400abc5a9c03602e5ae8 Author: Josef Bacik Date: Fri Dec 3 17:18:16 2021 -0500 btrfs: convert BUG_ON() in btrfs_truncate_inode_items to ASSERT We have a correctness BUG_ON() in btrfs_truncate_inode_items to make sure that we're always using min_type == BTRFS_EXTENT_DATA_KEY if new_size is > 0. Convert this to an ASSERT. Reviewed-by: Filipe Manana Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 71d18b53540f106a394cb35ed93b487b76678b06 Author: Josef Bacik Date: Fri Dec 3 17:18:15 2021 -0500 btrfs: add inode to truncate control In the future we're going to want to use btrfs_truncate_inode_items without looking up the associated inode. In order to accommodate this add the inode to btrfs_truncate_control and handle the case where control->inode is NULL appropriately. This is fairly straightforward, we simply need to add a helper for the trace points, as the file extent map update is controlled by a flag on btrfs_truncate_control. Reviewed-by: Filipe Manana Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 487e81d2a4009d17dcfe7c67b78b75cd96bcdde3 Author: Josef Bacik Date: Fri Dec 3 17:18:14 2021 -0500 btrfs: pass the ino via truncate control In the future we are going to want to truncate inode items without needing to have an btrfs_inode to pass in, so add ino to the btrfs_truncate_control and use that to look up the inode items to truncate. Reviewed-by: Filipe Manana Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 655807b8957ba84a583104c422a8f53725997d55 Author: Josef Bacik Date: Fri Dec 3 17:18:13 2021 -0500 btrfs: use a flag to control when to clear the file extent range We only care about updating the file extent range when we are doing a normal truncation. We skip this for tree logging currently, but we can also skip this for eviction as well. Using a flag makes it more explicit when we want to do this work. Reviewed-by: Filipe Manana Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 5caa490ed8f07488e47378999bd4ad451bf8858b Author: Josef Bacik Date: Fri Dec 3 17:18:12 2021 -0500 btrfs: control extent reference updates with a control flag for truncate We've had weird bugs in the past where we forgot to adjust the truncate path to deal with the fact that we can be called by the tree log path. Instead of checking if our root is a LOG_ROOT use a flag on the btrfs_truncate_control to indicate that we don't want to do extent reference updates during this truncate. Reviewed-by: Filipe Manana Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 462b728ea83fa85f1c0d2b79efb6187745444ce5 Author: Josef Bacik Date: Fri Dec 3 17:18:11 2021 -0500 btrfs: only call inode_sub_bytes in truncate paths that care We currently have a bunch of awkward checks to make sure we only update the inode i_bytes if we're truncating the real inode. Instead keep track of the number of bytes we need to sub in the btrfs_truncate_control, and then do the appropriate adjustment in the truncate paths that care. Reviewed-by: Filipe Manana Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit c2ddb612a8b320dde8641a74c35e107aa496d5f3 Author: Josef Bacik Date: Fri Dec 3 17:18:10 2021 -0500 btrfs: only update i_size in truncate paths that care We currently will update the i_size of the inode as we truncate it down, however we skip this if we're calling btrfs_truncate_inode_items from the tree log code. However we also don't care about this in the case of evict. Instead keep track of this value in the btrfs_truncate_control and then have btrfs_truncate() and the free space cache truncate path both do the i_size update themselves. Reviewed-by: Filipe Manana Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit d9ac19c3806434af2a92b4008dbf39c2a67c60cf Author: Josef Bacik Date: Fri Dec 3 17:18:09 2021 -0500 btrfs: add truncate control struct I'm going to be adding more arguments and counters to btrfs_truncate_inode_items, so add a control struct to handle all of the extra arguments to make it easier to follow. Reviewed-by: Filipe Manana Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 7097a941bf75ed1f632342937984a24f0b1d76a4 Author: Josef Bacik Date: Fri Dec 3 17:18:08 2021 -0500 btrfs: remove found_extent from btrfs_truncate_inode_items We only set this if we find a normal file extent, del_item == 1, and the file extent points to a real extent and isn't a hole extent. We can use del_item == 1 && extent_start != 0 to get the same information that found_extent provides, so remove this variable and use the other variables instead. Reviewed-by: Filipe Manana Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 2adc75d61203a7d7d0178e1c5402e1f792ac4636 Author: Josef Bacik Date: Fri Dec 3 17:18:07 2021 -0500 btrfs: move btrfs_kill_delayed_inode_items into evict We have a special case in btrfs_truncate_inode_items() to call btrfs_kill_delayed_inode_items() if min_type == 0, which is only called during evict. Instead move this out into evict proper, and add some comments because I erroneously attempted to remove this code altogether without understanding what we were doing. Evict is updating the inode only because we only care about making sure the i_nlink count has hit disk. If we had pending deletions we don't want to process those via the delayed inode updates, we simply want to drop all of them and reclaim the reserved metadata space. Then from there the btrfs_truncate_inode_items() will do the work to remove all of the items as appropriate. Reviewed-by: Filipe Manana Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit 275312a03c625a35c33440d3937804b17f894e4f Author: Josef Bacik Date: Fri Dec 3 17:18:06 2021 -0500 btrfs: remove free space cache inode check in btrfs_truncate_inode_items We no longer have inode cache feature, so this check is extraneous as the only inode cache is in the tree_root, which is not marked as SHAREABLE. Reviewed-by: Filipe Manana Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 9a4a1429acbe0508095dbb2c54e9e8b78dfe52f0 Author: Josef Bacik Date: Fri Dec 3 17:18:05 2021 -0500 btrfs: move extent locking outside of btrfs_truncate_inode_items Currently we are locking the extent and dropping the extent cache for any inodes we truncate, unless they're in the tree log. We call this helper from: - truncate - evict - tree log - free space cache truncation For evict we've already dropped all of the extent cache for this inode once we've gotten here, and we're the only one accessing this inode, so this step is unnecessary. For the tree log code we already skip this part. Pull this work into the truncate path and the free space cache truncation path. Reviewed-by: Filipe Manana Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 54f03ab1e19b04dea546f83ae70b3285bc61b9f8 Author: Josef Bacik Date: Fri Dec 3 17:18:04 2021 -0500 btrfs: move btrfs_truncate_inode_items to inode-item.c This is an inode item related manipulation with a few vfs related adjustments. I'm going to remove the vfs related code from this helper and simplify it a lot, but I want those changes to be easily seen via git blame, so move this function now and then the simplification work can be done. Reviewed-by: Filipe Manana Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 26c2c4540d6d5c85a22a857ccda304361f1afeaf Author: Josef Bacik Date: Fri Dec 3 17:18:03 2021 -0500 btrfs: add an inode-item.h We have a few helpers in inode-item.c, and I'm going to make a few changes to how we do truncate in the future, so break out these definitions into their own header file to trim down ctree.h some and make it easier to do the work on truncate in the future. Reviewed-by: Filipe Manana Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 727e60604f6a61b8e4330e8fe63a8cf0a067d29d Author: Filipe Manana Date: Thu Dec 2 10:30:40 2021 +0000 btrfs: remove stale comment about locking at btrfs_search_slot() The comment refers to the old extent buffer locking code, where we used to have custom locks that had blocking and spinning behaviour modes. That is not the case anymore, since we have transitioned to rw semaphores, so the comment does not offer any value anymore. Remove it. Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit bb8e9a608055e016aace6db269432ba52a57dcc1 Author: Filipe Manana Date: Thu Dec 2 10:30:39 2021 +0000 btrfs: remove BUG_ON() after splitting leaf After calling split_leaf() we BUG_ON() if the returned value is greater than zero. However split_leaf() only returns 0, in case of success, or a negative value in case of an error. The reason for the BUG_ON() is that if we ever get a positive return value from split_leaf(), we can not simply propagate it to the callers of btrfs_search_slot(), as that would be interpreted as "key not found" and not as an error. That means it could result in callers ending up causing some potential silent corruption. So change the BUG_ON() to an ASSERT(), and in case assertions are disabled, produce a warning and set the return value to an error, to make it not possible to get into a silent corruption and having the error not noticed. Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 109324cfda067b84b948002584849a02dd0a6641 Author: Filipe Manana Date: Thu Dec 2 10:30:38 2021 +0000 btrfs: move leaf search logic out of btrfs_search_slot() There's quite a significant amount of code for doing the key search for a leaf at btrfs_search_slot(), with a couple labels and gotos in it, plus btrfs_search_slot() is already big enough. So move the logic that does the key search on a leaf into a new helper function. This makes it better organized, removing the need for the labels and the gotos, as well as reducing the indentation level and the size of btrfs_search_slot(). Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit e5e1c1741b3de3f8d06fe4b700d83709a7da0610 Author: Filipe Manana Date: Thu Dec 2 10:30:37 2021 +0000 btrfs: remove useless condition check before splitting leaf When inserting a key, we check if the write_lock_level is less than 1, and if so we set it to 1, release the path and retry the tree traversal. However that is unnecessary, because when ins_len is greater than 0, we know that write_lock_level can never be less than 1. The logic to retry is also buggy, because in case ins_len was decremented, due to an exact key match and the search is not meant for item extension (path->search_for_extension is 0), we retry without incrementing ins_len, which would make the next retry decrement it again by the same amount. So remove the check for write_lock_level being less than 1 and add an assertion to assert it's always >= 1. Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit e2e58d0f8dc55533c24fc7b3e101092f571b4a43 Author: Filipe Manana Date: Thu Dec 2 10:30:36 2021 +0000 btrfs: try to unlock parent nodes earlier when inserting a key When inserting a new key, we release the write lock on the leaf's parent only after doing the binary search on the leaf. This is because if the key ends up at slot 0, we will have to update the key at slot 0 of the parent node. The same reasoning applies to any other upper level nodes when their slot is 0. We also need to keep the parent locked in case the leaf does not have enough free space to insert the new key/item, because in that case we will split the leaf and we will need to add a new key to the parent due to a new leaf resulting from the split operation. However if the leaf has enough space for the new key and the key does not end up at slot 0 of the leaf we could release our write lock on the parent before doing the binary search on the leaf to figure out the destination slot. That leads to reducing the amount of time other tasks are blocked waiting to lock the parent, therefore increasing parallelism when there are other tasks that are trying to access other leaves accessible through the same parent. This also applies to other upper nodes besides the immediate parent, when their slot is 0, since we keep locks on them until we figure out if the leaf slot is slot 0 or not. In fact, having the key ending at up slot 0 when is rare. Typically it only happens when the key is less than or equals to the smallest, the "left most", key of the entire btree, during a split attempt when we try to push to the right sibling leaf or when the caller just wants to update the item of an existing key. It's also very common that a leaf has enough space to insert a new key, since after a split we move about half of the keys from one into the new leaf. So unlock the parent, and any other upper level nodes, when during a key insertion we notice the key is greater then the first key in the leaf and the leaf has enough free space. After unlocking the upper level nodes, do the binary search using a low boundary of slot 1 and not slot 0, to figure out the slot where the key will be inserted (or where the key already is in case it exists and the caller wants to modify its item data). This extra comparison, with the first key, is cheap and the key is very likely already in a cache line because it immediately follows the header of the extent buffer and we have recently read the level field of the header (which in fact is the last field of the header). The following fs_mark test was run on a non-debug kernel (debian's default kernel config), with a 12 cores intel CPU, and using a NVMe device: $ cat run-fsmark.sh #!/bin/bash DEV=/dev/nvme0n1 MNT=/mnt/nvme0n1 MOUNT_OPTIONS="-o ssd" MKFS_OPTIONS="-O no-holes -R free-space-tree" FILES=100000 THREADS=$(nproc --all) FILE_SIZE=0 echo "performance" | \ tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor mkfs.btrfs -f $MKFS_OPTIONS $DEV mount $MOUNT_OPTIONS $DEV $MNT OPTS="-S 0 -L 10 -n $FILES -s $FILE_SIZE -t $THREADS -k" for ((i = 1; i <= $THREADS; i++)); do OPTS="$OPTS -d $MNT/d$i" done fs_mark $OPTS umount $MNT Before this change: FSUse% Count Size Files/sec App Overhead 0 1200000 0 165273.6 5958381 0 2400000 0 190938.3 6284477 0 3600000 0 181429.1 6044059 0 4800000 0 173979.2 6223418 0 6000000 0 139288.0 6384560 0 7200000 0 163000.4 6520083 1 8400000 0 57799.2 5388544 1 9600000 0 66461.6 5552969 2 10800000 0 49593.5 5163675 2 12000000 0 57672.1 4889398 After this change: FSUse% Count Size Files/sec App Overhead 0 1200000 0 167987.3 (+1.6%) 6272730 0 2400000 0 198563.9 (+4.0%) 6048847 0 3600000 0 197436.6 (+8.8%) 6163637 0 4800000 0 202880.7 (+16.6%) 6371771 1 6000000 0 167275.9 (+20.1%) 6556733 1 7200000 0 204051.2 (+25.2%) 6817091 1 8400000 0 69622.8 (+20.5%) 5525675 1 9600000 0 69384.5 (+4.4%) 5700723 1 10800000 0 61454.1 (+23.9%) 5363754 3 12000000 0 61908.7 (+7.3%) 5370196 Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit fb81212c07b1d1870fefdf883d2d4e8a9386308b Author: Filipe Manana Date: Thu Dec 2 10:30:35 2021 +0000 btrfs: allow generic_bin_search() to take low boundary as an argument Right now generic_bin_search() always uses a low boundary slot of 0, but in the next patch we'll want to often skip slot 0 when searching for a key. So make generic_bin_search() have the low boundary slot specified as an argument, and move the check for the extent buffer level from btrfs_bin_search() to generic_bin_search() to avoid adding another wrapper around generic_bin_search(). Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba commit 120de408e4b97504a2d9b5ca534b383de2c73d49 Author: Josef Bacik Date: Wed Nov 24 14:14:24 2021 -0500 btrfs: check the root node for uptodate before returning it Now that we clear the extent buffer uptodate if we fail to write it out we need to check to see if our root node is uptodate before we search down it. Otherwise we could return stale data (or potentially corrupt data that was caught by the write verification step) and think that the path is OK to search down. CC: stable@vger.kernel.org # 5.4+ Reviewed-by: Nikolay Borisov Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit a174c0a2e857081195db6888323802f0fae793ef Author: Nikolay Borisov Date: Thu Nov 25 11:14:43 2021 +0200 btrfs: allow device add if balance is paused Currently paused balance precludes adding a device since they are both considered exclusive ops and we can have at most one running at a time. This is problematic in case a filesystem encounters an ENOSPC situation while balance is running, in this case the only thing the user can do is mount the fs with "skip_balance" which pauses balance and delete some data to free up space for balance. However, it should be possible to add a new device when balance is paused. Fix this by allowing device add to proceed when balance is paused. Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 621a1ee1d399c77dd4604aeab3e0f6319f649dbc Author: Nikolay Borisov Date: Thu Nov 25 11:14:42 2021 +0200 btrfs: make device add compatible with paused balance in btrfs_exclop_start_try_lock This is needed to enable device add to work in cases when a file system has been mounted with 'skip_balance' mount option. Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit efc0e69c2feab8efcdbb9efdb9aae892d11b1545 Author: Nikolay Borisov Date: Thu Nov 25 11:14:41 2021 +0200 btrfs: introduce exclusive operation BALANCE_PAUSED state Current set of exclusive operation states is not sufficient to handle all practical use cases. In particular there is a need to be able to add a device to a filesystem that have paused balance. Currently there is no way to distinguish between a running and a paused balance. Fix this by introducing BTRFS_EXCLOP_BALANCE_PAUSED which is going to be set in 2 occasions: 1. When a filesystem is mounted with skip_balance and there is an unfinished balance it will now be into BALANCE_PAUSED instead of simply BALANCE state. 2. When a running balance is paused. Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit d96b34248c2f4ea8cd09286090f2f6f77102eaab Author: Filipe Manana Date: Mon Nov 22 12:03:38 2021 +0000 btrfs: make send work with concurrent block group relocation We don't allow send and balance/relocation to run in parallel in order to prevent send failing or silently producing some bad stream. This is because while send is using an extent (specially metadata) or about to read a metadata extent and expecting it belongs to a specific parent node, relocation can run, the transaction used for the relocation is committed and the extent gets reallocated while send is still using the extent, so it ends up with a different content than expected. This can result in just failing to read a metadata extent due to failure of the validation checks (parent transid, level, etc), failure to find a backreference for a data extent, and other unexpected failures. Besides reallocation, there's also a similar problem of an extent getting discarded when it's unpinned after the transaction used for block group relocation is committed. The restriction between balance and send was added in commit 9e967495e0e0 ("Btrfs: prevent send failures and crashes due to concurrent relocation"), kernel 5.3, while the more general restriction between send and relocation was added in commit 1cea5cf0e664 ("btrfs: ensure relocation never runs while we have send operations running"), kernel 5.14. Both send and relocation can be very long running operations. Relocation because it has to do a lot of IO and expensive backreference lookups in case there are many snapshots, and send due to read IO when operating on very large trees. This makes it inconvenient for users and tools to deal with scheduling both operations. For zoned filesystem we also have automatic block group relocation, so send can fail with -EAGAIN when users least expect it or send can end up delaying the block group relocation for too long. In the future we might also get the automatic block group relocation for non zoned filesystems. This change makes it possible for send and relocation to run in parallel. This is achieved the following way: 1) For all tree searches, send acquires a read lock on the commit root semaphore; 2) After each tree search, and before releasing the commit root semaphore, the leaf is cloned and placed in the search path (struct btrfs_path); 3) After releasing the commit root semaphore, the changed_cb() callback is invoked, which operates on the leaf and writes commands to the pipe (or file in case send/receive is not used with a pipe). It's important here to not hold a lock on the commit root semaphore, because if we did we could deadlock when sending and receiving to the same filesystem using a pipe - the send task blocks on the pipe because it's full, the receive task, which is the only consumer of the pipe, triggers a transaction commit when attempting to create a subvolume or reserve space for a write operation for example, but the transaction commit blocks trying to write lock the commit root semaphore, resulting in a deadlock; 4) Before moving to the next key, or advancing to the next change in case of an incremental send, check if a transaction used for relocation was committed (or is about to finish its commit). If so, release the search path(s) and restart the search, to where we were before, so that we don't operate on stale extent buffers. The search restarts are always possible because both the send and parent roots are RO, and no one can add, remove of update keys (change their offset) in RO trees - the only exception is deduplication, but that is still not allowed to run in parallel with send; 5) Periodically check if there is contention on the commit root semaphore, which means there is a transaction commit trying to write lock it, and release the semaphore and reschedule if there is contention, so as to avoid causing any significant delays to transaction commits. This leaves some room for optimizations for send to have less path releases and re searching the trees when there's relocation running, but for now it's kept simple as it performs quite well (on very large trees with resulting send streams in the order of a few hundred gigabytes). Test case btrfs/187, from fstests, stresses relocation, send and deduplication attempting to run in parallel, but without verifying if send succeeds and if it produces correct streams. A new test case will be added that exercises relocation happening in parallel with send and then checks that send succeeds and the resulting streams are correct. A final note is that for now this still leaves the mutual exclusion between send operations and deduplication on files belonging to a root used by send operations. A solution for that will be slightly more complex but it will eventually be built on top of this change. Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit fff63521cd6e197738db9297076d83b4081ac80f Merge: 14676c04783c6 269bda9e7da48 Author: David S. Miller Date: Fri Jan 7 11:29:45 2022 +0000 Merge branch 'mptcp-fixes' Mat Martineau says: ==================== mptcp: Fixes for buffer reclaim and option writing Here are three fixes dealing with a syzkaller crash MPTCP triggers in the memory manager in 5.16-rc8, and some option writing problems. Patches 1 and 2 fix some corner cases in MPTCP option writing. Patch 3 addresses a crash that syzkaller found a way to trigger in the mm subsystem by passing an invalid value to __sk_mem_reduce_allocated(). ==================== Signed-off-by: David S. Miller commit 269bda9e7da48eafb599d01c96199caa2f7547e5 Author: Mat Martineau Date: Thu Jan 6 14:06:38 2022 -0800 mptcp: Check reclaim amount before reducing allocation syzbot found a page counter underflow that was triggered by MPTCP's reclaim code: page_counter underflow: -4294964789 nr_pages=4294967295 WARNING: CPU: 2 PID: 3785 at mm/page_counter.c:56 page_counter_cancel+0xcf/0xe0 mm/page_counter.c:56 Modules linked in: CPU: 2 PID: 3785 Comm: kworker/2:6 Not tainted 5.16.0-rc1-syzkaller #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 Workqueue: events mptcp_worker RIP: 0010:page_counter_cancel+0xcf/0xe0 mm/page_counter.c:56 Code: c7 04 24 00 00 00 00 45 31 f6 eb 97 e8 2a 2b b5 ff 4c 89 ea 48 89 ee 48 c7 c7 00 9e b8 89 c6 05 a0 c1 ba 0b 01 e8 95 e4 4b 07 <0f> 0b eb a8 4c 89 e7 e8 25 5a fb ff eb c7 0f 1f 00 41 56 41 55 49 RSP: 0018:ffffc90002d4f918 EFLAGS: 00010082 RAX: 0000000000000000 RBX: ffff88806a494120 RCX: 0000000000000000 RDX: ffff8880688c41c0 RSI: ffffffff815e8f28 RDI: fffff520005a9f15 RBP: ffffffff000009cb R08: 0000000000000000 R09: 0000000000000000 R10: ffffffff815e2cfe R11: 0000000000000000 R12: ffff88806a494120 R13: 00000000ffffffff R14: 0000000000000000 R15: 0000000000000001 FS: 0000000000000000(0000) GS:ffff88802cc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000001b2de21000 CR3: 000000005ad59000 CR4: 0000000000150ee0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: page_counter_uncharge+0x2e/0x60 mm/page_counter.c:160 drain_stock+0xc1/0x180 mm/memcontrol.c:2219 refill_stock+0x139/0x2f0 mm/memcontrol.c:2271 __sk_mem_reduce_allocated+0x24d/0x550 net/core/sock.c:2945 __mptcp_rmem_reclaim net/mptcp/protocol.c:167 [inline] __mptcp_mem_reclaim_partial+0x124/0x410 net/mptcp/protocol.c:975 mptcp_mem_reclaim_partial net/mptcp/protocol.c:982 [inline] mptcp_alloc_tx_skb net/mptcp/protocol.c:1212 [inline] mptcp_sendmsg_frag+0x18c6/0x2190 net/mptcp/protocol.c:1279 __mptcp_push_pending+0x232/0x720 net/mptcp/protocol.c:1545 mptcp_release_cb+0xfe/0x200 net/mptcp/protocol.c:2975 release_sock+0xb4/0x1b0 net/core/sock.c:3306 mptcp_worker+0x51e/0xc10 net/mptcp/protocol.c:2443 process_one_work+0x9b2/0x1690 kernel/workqueue.c:2298 worker_thread+0x658/0x11f0 kernel/workqueue.c:2445 kthread+0x405/0x4f0 kernel/kthread.c:327 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 __mptcp_mem_reclaim_partial() could call __mptcp_rmem_reclaim() with a negative value, which passed that negative value to __sk_mem_reduce_allocated() and triggered the splat above. Check for a reclaim amount that is positive and large enough for __mptcp_rmem_reclaim() to actually adjust rmem_fwd_alloc (much like the sk_mem_reclaim_partial() code the function is based on). v2: Use '>' instead of '>=', since SK_MEM_QUANTUM - 1 would get right-shifted into nothing by __mptcp_rmem_reclaim. Fixes: 6511882cdd82 ("mptcp: allocate fwd memory separately on the rx and tx path") Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/252 Reported-and-tested-by: syzbot+bc9e2d2dbcb347dd215a@syzkaller.appspotmail.com Cc: Andrew Morton Cc: Michal Hocko Acked-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 110b6d1fe98fd7af9893992459b651594d789293 Author: Geliang Tang Date: Thu Jan 6 14:06:37 2022 -0800 mptcp: fix a DSS option writing error 'ptr += 1;' was omitted in the original code. If the DSS is the last option -- which is what we have most of the time -- that's not an issue. But it is if we need to send something else after like a RM_ADDR or an MP_PRIO. Fixes: 1bff1e43a30e ("mptcp: optimize out option generation") Reviewed-by: Matthieu Baerts Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 04fac2cae9422a3401c172571afbcfdd58fa5c7e Author: Matthieu Baerts Date: Thu Jan 6 14:06:36 2022 -0800 mptcp: fix opt size when sending DSS + MP_FAIL When these two options had to be sent -- which is not common -- the DSS size was not being taken into account in the remaining size. Additionally in this situation, the reported size was only the one of the MP_FAIL which can cause issue if at the end, we need to write more in the TCP options than previously said. Here we use a dedicated variable for MP_FAIL size to keep the WARN_ON_ONCE() just after. Fixes: c25aeb4e0953 ("mptcp: MP_FAIL suboption sending") Acked-and-tested-by: Geliang Tang Signed-off-by: Matthieu Baerts Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit ca1a6705b271d458d54bbeb072af97ec468d3b37 Merge: 26abf15c49e0f e9d09baca6762 Author: David S. Miller Date: Fri Jan 7 11:27:07 2022 +0000 Merge branch 'mptcp-next' Mat Martineau says: ==================== mptcp: New features and cleanup These patches have been tested in the MPTCP tree for a longer than usual time (thanks to holiday schedules), and are ready for the net-next branch. Changes include feature updates, small fixes, refactoring, and some selftest changes. Patch 1 fixes an OUTQ ioctl issue with TCP fallback sockets. Patches 2, 3, and 6 add support of the MPTCP fastclose option (quick shutdown of the full MPTCP connection, similar to TCP RST in regular TCP), and a related self test. Patch 4 cleans up some accept and poll code that is no longer needed after the fastclose changes. Patch 5 add userspace disconnect using AF_UNSPEC, which is used when testing fastclose and makes the MPTCP socket's handling of AF_UNSPEC in connect() more TCP-like. Patches 7-11 refactor subflow creation to make better use of multiple local endpoints and to better handle individual connection failures when creating multiple subflows. Includes self test updates. Patch 12 cleans up the way subflows are added to the MPTCP connection list, eliminating the need for calls throughout the MPTCP code that had to check the intermediate "join list" for entries to shift over to the main "connection list". Patch 13 refactors the MPTCP release_cb flags to use separate storage for values only accessed with the socket lock held (no atomic ops needed), and for values that need atomic operations. ==================== Signed-off-by: David S. Miller commit e9d09baca67625cfb41c0f2b547b9dbb4043ae95 Author: Paolo Abeni Date: Thu Jan 6 16:20:26 2022 -0800 mptcp: avoid atomic bit manipulation when possible Currently the msk->flags bitmask carries both state for the mptcp_release_cb() - mostly touched under the mptcp data lock - and others state info touched even outside such lock scope. As a consequence, msk->flags is always manipulated with atomic operations. This change splits such bitmask in two separate fields, so that we use plain bit operations when touching the cb-related info. The MPTCP_PUSH_PENDING bit needs additional care, as it is the only CB related field currently accessed either under the mptcp data lock or the mptcp socket lock. Let's add another mask just for such bit's sake. Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 3e5014909b5661b3da59990d72a317a45ba3b284 Author: Paolo Abeni Date: Thu Jan 6 16:20:25 2022 -0800 mptcp: cleanup MPJ subflow list handling We can simplify the join list handling leveraging the mptcp_release_cb(): if we can acquire the msk socket lock at mptcp_finish_join time, move the new subflow directly into the conn_list, otherwise place it on join_list and let the release_cb process such list. Since pending MPJ connection are now always processed in a timely way, we can avoid flushing the join list every time we have to process all the current subflows. Additionally we can now use the mptcp data lock to protect the join_list, removing the additional spin lock. Finally, the MPJ handshake is now always finalized under the msk socket lock, we can drop the additional synchronization between mptcp_finish_join() and mptcp_close(). Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 46e967d187ed1693b34379ac4e27fd4e1fb40a45 Author: Paolo Abeni Date: Thu Jan 6 16:20:24 2022 -0800 selftests: mptcp: add tests for subflow creation failure Verify that, when multiple endpoints are available, subflows creation proceed even when the first additional subflow creation fails - due to packet drop on the relevant link 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 a88c9e49693759f9eb49dcda6c45a0d32b07634c Author: Paolo Abeni Date: Thu Jan 6 16:20:23 2022 -0800 mptcp: do not block subflows creation on errors If the MPTCP configuration allows for multiple subflows creation, and the first additional subflows never reach the fully established status - e.g. due to packets drop or reset - the in kernel path manager do not move to the next subflow. This patch introduces a new PM helper to cope with MPJ subflow creation failure and delay and hook it where appropriate. Such helper triggers additional subflow creation, as needed and updates the PM subflow counter, if the current one is closing. Additionally start all the needed additional subflows as soon as the MPTCP socket is fully established, so we don't have to cope with slow MPJ handshake blocking the next subflow creation. Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 86e39e04482b0aadf3ee3ed5fcf2d63816559d36 Author: Paolo Abeni Date: Thu Jan 6 16:20:22 2022 -0800 mptcp: keep track of local endpoint still available for each msk Include into the path manager status a bitmap tracking the list of local endpoints still available - not yet used - for the relevant mptcp socket. Keep such map updated at endpoint creation/deletion time, so that we can easily skip already used endpoint at local address selection time. The endpoint used by the initial subflow is lazyly accounted at subflow creation time: the usage bitmap is be up2date before endpoint selection and we avoid such unneeded task in some relevant scenarios - e.g. busy servers accepting incoming subflows but not creating any additional ones nor annuncing additional addresses. Overall this allows for fair local endpoints usage in case of subflow failure. As a side effect, this patch also enforces that each endpoint is used at most once for each mptcp connection. Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 71b077e48377222c5fdae9ddcc58fe03cdff6932 Author: Paolo Abeni Date: Thu Jan 6 16:20:21 2022 -0800 mptcp: clean-up MPJ option writing Check for all MPJ variant at once, this reduces the number of conditionals traversed on average and will simplify the next patch. No functional change intended. Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit f7d6a237d7422809d458d754016de2844017cb4d Author: Paolo Abeni Date: Thu Jan 6 16:20:20 2022 -0800 mptcp: fix per socket endpoint accounting Since full-mesh endpoint support, the reception of a single ADD_ADDR option can cause multiple subflows creation. When such option is accepted we increment 'add_addr_accepted' by one. When we received a paired RM_ADDR option, we deleted all the relevant subflows, decrementing 'add_addr_accepted' by one for each of them. We have a similar issue for 'local_addr_used' Fix them moving the pm endpoint accounting outside the subflow traversal. Fixes: 1a0d6136c5f0 ("mptcp: local addresses fullmesh") Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 05be5e273c84f6329b3cac4f5bb7b1fe6eaefd5d Author: Paolo Abeni Date: Thu Jan 6 16:20:19 2022 -0800 selftests: mptcp: add disconnect tests Performs several disconnect/reconnect on the same socket, ensuring the overall transfer is succesful. The new test leverages ioctl(SIOCOUTQ) to ensure all the pending data is acked before disconnecting. Additionally order alphabetically the test program arguments list for better maintainability. Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 3d1d6d66e15612801bec79b190af746622f0d427 Author: Paolo Abeni Date: Thu Jan 6 16:20:18 2022 -0800 mptcp: implement support for user-space disconnect Handle explicitly AF_UNSPEC in mptcp_stream_connnect() to allow user-space to disconnect established MPTCP connections Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 71ba088ce0aa87370b18a1d35cd742f352d51c24 Author: Paolo Abeni Date: Thu Jan 6 16:20:17 2022 -0800 mptcp: cleanup accept and poll After the previous patch, msk->subflow will never be deleted during the whole msk lifetime. We don't need anymore to acquire references to it in mptcp_stream_accept() and we can use the listener subflow accept queue to simplify mptcp_poll() for listener socket. Overall this removes a lock pair and 4 more atomic operations per accept(). Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit b29fcfb54cd70caca5b11c80d8d238854938884a Author: Paolo Abeni Date: Thu Jan 6 16:20:16 2022 -0800 mptcp: full disconnect implementation The current mptcp_disconnect() implementation lacks several steps, we additionally need to reset the msk socket state and flush the subflow list. Factor out the needed helper to avoid code duplication. Additionally ensure that the initial subflow is disposed only after mptcp_close(), just reset it at disconnect time. Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit f284c0c7732189fa77567dc061c5f4205c4fa05b Author: Paolo Abeni Date: Thu Jan 6 16:20:15 2022 -0800 mptcp: implement fastclose xmit path Allow the MPTCP xmit path to add MP_FASTCLOSE suboption on RST egress packets. Additionally reorder related options writing to reduce the number of conditionals required in the fast path. Co-developed-by: Geliang Tang Signed-off-by: Geliang Tang Co-developed-by: Matthieu Baerts Signed-off-by: Matthieu Baerts Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 58cd405b83b388c75a4c24926e5d4aeae8d1eaf5 Author: Paolo Abeni Date: Thu Jan 6 16:20:14 2022 -0800 mptcp: keep snd_una updated for fallback socket After shutdown, for fallback MPTCP sockets, we always have write_seq == snd_una+1 The above will foul OUTQ ioctl(). Keep snd_una in sync with write_seq even after shutdown. Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 26abf15c49e0fbbcb6dbd70c52ecbde221f1b0fa Merge: e4a3d6a6a19a8 745a13061aa07 Author: David S. Miller Date: Fri Jan 7 11:10:57 2022 +0000 Merge tag 'mlx5-updates-2022-01-06' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5-updates-2022-01-06 1) Expose FEC per lane block counters via ethtool 2) Trivial fixes/updates/cleanup to mlx5e netdev driver 3) Fix htmldoc build warning 4) Spread mlx5 SFs (sub-functions) to all available CPU cores: Commits 1..5 Shay Drory Says: ================ Before this patchset, mlx5 subfunction shared the same IRQs (MSI-X) with their peers subfunctions, causing them to use same CPU cores. In large scale, this is very undesirable, SFs use small number of cpu cores and all of them will be packed on the same CPU cores, not utilizing all CPU cores in the system. In this patchset we want to achieve two things. a) Spread IRQs used by SFs to all cpu cores b) Pack less SFs in the same IRQ, will result in multiple IRQs per core. In this patchset, we spread SFs over all online cpus available to mlx5 irqs in Round-Robin manner. e.g.: Whenever a SF is created, pick the next CPU core with least number of SF IRQs bound to it, SFs will share IRQs on the same core until a certain limit, when such limit is reached, we request a new IRQ and add it to that CPU core IRQ pool, when out of IRQs, pick any IRQ with least number of SF users. This enhancement is done in order to achieve a better distribution of the SFs over all the available CPUs, which reduces application latency, as shown bellow. Machine details: Intel(R) Xeon(R) CPU E5-2697 v3 @ 2.60GHz with 56 cores. PCI Express 3 with BW of 126 Gb/s. ConnectX-5 Ex; EDR IB (100Gb/s) and 100GbE; dual-port QSFP28; PCIe4.0 x16. Base line test description: Single SF on the system. One instance of netperf is running on-top the SF. Numbers: latency = 15.136 usec, CPU Util = 35% Test description: There are 250 SFs on the system. There are 3 instances of netperf running, on-top three different SFs, in parallel. Perf numbers: # netperf SFs latency(usec) latency CPU utilization affinity affinity (lower is better) increase % 1 cpu=0 cpu={0} ~23 (app 1-3) 35% 75% 2 cpu=0,2,4 cpu={0} app 1: 21.625 30% 68% (CPU 0) app 2-3: 16.5 9% 15% (CPU 2,4) 3 cpu=0 cpu={0,2,4} app 1: ~16 7% 84% (CPU 0) app 2-3: ~17.9 14% 22% (CPU 2,4) 4 cpu=0,2,4 cpu={0,2,4} 15.2 (app 1-3) 0% 33% (CPU 0,2,4) - The first two entries (#1 and #2) show current state. e.g.: SFs are using the same CPU. The last two entries (#3 and #4) shows the latency reduction improvement of this patch. e.g.: SFs are on different CPUs. - Whenever we use several CPUs, in case there is a different CPU utilization, write the utilization of each CPU separately. - Whenever the latency result of the netperf instances were different, write the latency of each netperf instances separately. Commands: - for netperf CPU=0: $ for i in {1..3}; do taskset -c 0 netperf -H 1${i}.1.1.1 -t TCP_RR -- \ -o RT_LATENCY -r8 & done - for netperf CPU=0,2,4 $ for i in {1..3}; do taskset -c $(( ($i - 1) * 2 )) netperf -H \ 1${i}.1.1.1 -t TCP_RR -- -o RT_LATENCY -r8 & done ================ ==================== Signed-off-by: David S. Miller commit 14676c04783c6363b71072c01b42bb7838eb56eb Merge: 29507144c9981 4f6626b0e1408 Author: David S. Miller Date: Fri Jan 7 11:09:37 2022 +0000 Merge tag 'mlx5-fixes-2022-01-06' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5 fixes 2022-01-06 This series provides bug fixes to mlx5 driver. Please pull and let me know if there is any problem. ==================== Signed-off-by: David S. Miller commit f5bdb34bf0c9314548f2d8e2360b703ff3610303 Author: David Vernet Date: Wed Dec 29 13:56:47 2021 -0800 livepatch: Avoid CPU hogging with cond_resched When initializing a 'struct klp_object' in klp_init_object_loaded(), and performing relocations in klp_resolve_symbols(), klp_find_object_symbol() is invoked to look up the address of a symbol in an already-loaded module (or vmlinux). This, in turn, calls kallsyms_on_each_symbol() or module_kallsyms_on_each_symbol() to find the address of the symbol that is being patched. It turns out that symbol lookups often take up the most CPU time when enabling and disabling a patch, and may hog the CPU and cause other tasks on that CPU's runqueue to starve -- even in paths where interrupts are enabled. For example, under certain workloads, enabling a KLP patch with many objects or functions may cause ksoftirqd to be starved, and thus for interrupts to be backlogged and delayed. This may end up causing TCP retransmits on the host where the KLP patch is being applied, and in general, may cause any interrupts serviced by softirqd to be delayed while the patch is being applied. So as to ensure that kallsyms_on_each_symbol() does not end up hogging the CPU, this patch adds a call to cond_resched() in kallsyms_on_each_symbol() and module_kallsyms_on_each_symbol(), which are invoked when doing a symbol lookup in vmlinux and a module respectively. Without this patch, if a live-patch is applied on a 36-core Intel host with heavy TCP traffic, a ~10x spike is observed in TCP retransmits while the patch is being applied. Additionally, collecting sched events with perf indicates that ksoftirqd is awakened ~1.3 seconds before it's eventually scheduled. With the patch, no increase in TCP retransmit events is observed, and ksoftirqd is scheduled shortly after it's awakened. Signed-off-by: David Vernet Acked-by: Miroslav Benes Acked-by: Song Liu Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20211229215646.830451-1-void@manifault.com commit 7dcf07ac88676a365ce3245b44af2be432f21120 Author: Kishon Vijay Abraham I Date: Fri Nov 26 14:01:16 2021 +0530 PCI: keystone: Use phandle argument from "ti,syscon-pcie-id"/"ti,syscon-pcie-mode" Get "syscon" pcie_mode and pcie_id offset from the argument of "ti,syscon-pcie-id" and "ti,syscon-pcie-mode" phandle respectively. Previously a subnode to "syscon" node was added which has the exact memory mapped address of pcie_mode and pcie_id but now the offset of pcie_mode and pcie_id within "syscon" is now being passed as argument to "ti,syscon-pcie-id" and "ti,syscon-pcie-mode" phandle. If the offset is not provided in "ti,syscon-pcie-id"/"ti,syscon-pcie-mode", the full memory mapped address of pcie_ctrl is used in order to maintain old DT compatibility. Similar change for J721E is as discussed in [1] [1] -> http://lore.kernel.org/r/CAL_JsqKiUcO76bo1GoepWM1TusJWoty_BRy2hFSgtEVMqtrvvQ@mail.gmail.com Link: https://lore.kernel.org/r/20211126083119.16570-3-kishon@ti.com Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Lorenzo Pieralisi commit d91e775e661f6dc2c2f83e9dcf7339af14dc41de Author: Kishon Vijay Abraham I Date: Fri Nov 26 14:01:15 2021 +0530 dt-bindings: PCI: ti,am65: Fix "ti,syscon-pcie-id"/"ti,syscon-pcie-mode" to take argument Fix binding documentation of "ti,syscon-pcie-id" and "ti,syscon-pcie-mode" to take phandle with argument. The argument is the register offset within "syscon" used to configure PCIe controller. Similar change for j721e is discussed in [1] [1] -> http://lore.kernel.org/r/CAL_JsqKiUcO76bo1GoepWM1TusJWoty_BRy2hFSgtEVMqtrvvQ@mail.gmail.com Link: https://lore.kernel.org/r/20211126083119.16570-2-kishon@ti.com Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Lorenzo Pieralisi Reviewed-by: Rob Herring commit 7b2932162f66ab33a00a7cdb6d3b2db6dfdbf634 Author: Niklas Schnelle Date: Wed Jan 5 16:10:54 2022 +0100 s390/pci: simplify __pciwb_mio() inline asm The PCI Write Barrier instruction ignores the registers encoded in it. There is thus no need to explicitly set the register to zero or to associate it with a variable at all. In the resulting binary this removes an unnecessary lghi and it makes the code simpler. Signed-off-by: Niklas Schnelle Signed-off-by: Heiko Carstens commit 50b620303a14e885529410d26800f92a735724d6 Author: Li Chen Date: Tue Dec 21 02:59:56 2021 +0000 PCI: endpoint: Return -EINVAL when interrupts num is smaller than 1 In pci_epc_set_msi() we should return immediately if there are no interrupts to configure; update the code to return early. Link: https://lore.kernel.org/r/CH2PR19MB402491B9E503694DBCAC6005A07C9@CH2PR19MB4024.namprd19.prod.outlook.com Signed-off-by: Li Chen Signed-off-by: Lorenzo Pieralisi Reviewed-by: Kishon Vijay Abraham I commit c9512fd032acfe6f5198c30b6e7e52e0a7df5d31 Author: Greg Kroah-Hartman Date: Tue Jan 4 11:50:24 2022 +0100 kobject documentation: remove default_attrs information Since commit aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") we have been encouraging the use of default_groups instead of default_attrs, so reflect that information in the documentation as well so that no new users get added while the kernel is converted over to not use this field anymore. Cc: "Rafael J. Wysocki" Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Signed-off-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20220104105024.1014313-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit 65ace9a85fa7f88aec4d9d842061108161fa47bc Author: qizhong cheng Date: Mon Dec 27 21:31:10 2021 +0800 PCI: mediatek: Assert PERST# for 100ms for power and clock to stabilize Described in PCIe CEM specification sections 2.2 (PERST# Signal) and 2.2.1 (Initial Power-Up (G3 to S0)). The deassertion of PERST# should be delayed 100ms (TPVPERL) for the power and clock to become stable. Link: https://lore.kernel.org/r/20211227133110.14500-1-qizhong.cheng@mediatek.com Signed-off-by: qizhong cheng Signed-off-by: Lorenzo Pieralisi Acked-by: Pali Rohár commit 9d6c59c1c0d62a314a2b46839699b200cccd2d08 Merge: eb52c0fc2331f b01af5c0b0414 Author: Vlastimil Babka Date: Fri Jan 7 11:13:28 2022 +0100 Merge branch 'for-5.17/struct-slab' into for-linus Series "Separate struct slab from struct page" v4 This is originally an offshoot of the folio work by Matthew. One of the more complex parts of the struct page definition are the parts used by the slab allocators. It would be good for the MM in general if struct slab were its own data type, and it also helps to prevent tail pages from slipping in anywhere. As Matthew requested in his proof of concept series, I have taken over the development of this series, so it's a mix of patches from him (often modified by me) and my own. One big difference is the use of coccinelle to perform the relatively trivial parts of the conversions automatically and at once, instead of a larger number of smaller incremental reviewable steps. Thanks to Julia Lawall and Luis Chamberlain for all their help! Another notable difference is (based also on review feedback) I don't represent with a struct slab the large kmalloc allocations which are not really a slab, but use page allocator directly. When going from an object address to a struct slab, the code tests first folio slab flag, and only if it's set it converts to struct slab. This makes the struct slab type stronger. Finally, although Matthew's version didn't use any of the folio work, the initial support has been merged meanwhile so my version builds on top of it where appropriate. This eliminates some of the redundant compound_head() being performed e.g. when testing the slab flag. To sum up, after this series, struct page fields used by slab allocators are moved from struct page to a new struct slab, that uses the same physical storage. The availability of the fields is further distinguished by the selected slab allocator implementation. The advantages include: - Similar to folios, if the slab is of order > 0, struct slab always is guaranteed to be the head page. Additionally it's guaranteed to be an actual slab page, not a large kmalloc. This removes uncertainty and potential for bugs. - It's not possible to accidentally use fields of the slab implementation that's not configured. - Other subsystems cannot use slab's fields in struct page anymore (some existing non-slab usages had to be adjusted in this series), so slab implementations have more freedom in rearranging them in the struct slab. Link: https://lore.kernel.org/all/20220104001046.12263-1-vbabka@suse.cz/ commit 08276bdae68b022a7726edf7416b6748e3df5395 Author: David Howells Date: Wed Oct 20 23:50:01 2021 +0100 vfs, fscache: Implement pinning of cache usage for writeback Cachefiles has a problem in that it needs to keep the backing file for a cookie open whilst there are local modifications pending that need to be written to it. However, we don't want to keep the file open indefinitely, as that causes EMFILE/ENFILE/ENOMEM problems. Reopening the cache file, however, is a problem if this is being done due to writeback triggered by exit(). Some filesystems will oops if we try to open a file in that context because they want to access current->fs or other resources that have already been dismantled. To get around this, I added the following: (1) An inode flag, I_PINNING_FSCACHE_WB, to be set on a network filesystem inode to indicate that we have a usage count on the cookie caching that inode. (2) A flag in struct writeback_control, unpinned_fscache_wb, that is set when __writeback_single_inode() clears the last dirty page from i_pages - at which point it clears I_PINNING_FSCACHE_WB and sets this flag. This has to be done here so that clearing I_PINNING_FSCACHE_WB can be done atomically with the check of PAGECACHE_TAG_DIRTY that clears I_DIRTY_PAGES. (3) A function, fscache_set_page_dirty(), which if it is not set, sets I_PINNING_FSCACHE_WB and calls fscache_use_cookie() to pin the cache resources. (4) A function, fscache_unpin_writeback(), to be called by ->write_inode() to unuse the cookie. (5) A function, fscache_clear_inode_writeback(), to be called when the inode is evicted, before clear_inode() is called. This cleans up any lingering I_PINNING_FSCACHE_WB. The network filesystem can then use these tools to make sure that fscache_write_to_cache() can write locally modified data to the cache as well as to the server. For the future, I'm working on write helpers for netfs lib that should allow this facility to be removed by keeping track of the dirty regions separately - but that's incomplete at the moment and is also going to be affected by folios, one way or another, since it deals with pages Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819615157.215744.17623791756928043114.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906917856.143852.8224898306177154573.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967124567.1823006.14188359004568060298.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021524705.640689.17824932021727663017.stgit@warthog.procyon.org.uk/ # v4 commit b6e16652d6c0e4f9e9b120f66966ec153f0623fc Author: David Howells Date: Wed Oct 20 14:06:34 2021 +0100 fscache: Implement higher-level write I/O interface Provide a higher-level function than fscache_write() to perform a write from an inode's pagecache to the cache, whilst fending off concurrent writes by means of the PG_fscache mark on a page: void fscache_write_to_cache(struct fscache_cookie *cookie, struct address_space *mapping, loff_t start, size_t len, loff_t i_size, netfs_io_terminated_t term_func, void *term_func_priv, bool caching); If caching is false, this function does nothing except call (*term_func)() if given. It assumes that, in such a case, PG_fscache will not have been set on the pages. Otherwise, if caching is true, this function requires the source pages to have had PG_fscache set on them before calling. start and len define the region of the file to be modified and i_size indicates the new file size. The source pages are extracted from the mapping. term_func and term_func_priv work as for fscache_write(). The PG_fscache marks will be cleared at the end of the operation, before term_func is called or the function otherwise returns. There is an additonal helper function to clear the PG_fscache bits from a range of pages: void fscache_clear_page_bits(struct fscache_cookie *cookie, struct address_space *mapping, loff_t start, size_t len, bool caching); If caching is true, the pages to be managed are expected to be located on mapping in the range defined by start and len. If caching is false, it does nothing. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819614155.215744.5528123235123721230.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906916346.143852.15632773570362489926.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967123599.1823006.12946816026724657428.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021522672.640689.4381958316198807813.stgit@warthog.procyon.org.uk/ # v4 commit 9af1c6c3089b294ffa240e0fbba356666698b6d0 Author: David Howells Date: Wed Oct 20 14:06:34 2021 +0100 fscache: Implement raw I/O interface Provide a pair of functions to perform raw I/O on the cache. The first function allows an arbitrary asynchronous direct-IO read to be made against a cache object, though the read should be aligned and sized appropriately for the backing device: int fscache_read(struct netfs_cache_resources *cres, loff_t start_pos, struct iov_iter *iter, enum netfs_read_from_hole read_hole, netfs_io_terminated_t term_func, void *term_func_priv); The cache resources must have been previously initialised by fscache_begin_read_operation(). A read operation is sent to the backing filesystem, starting at start_pos within the file. The size of the read is specified by the iterator, as is the location of the output buffer. If there is a hole in the data it can be ignored and left to the backing filesystem to deal with (NETFS_READ_HOLE_IGNORE), a hole at the beginning can be skipped over and the buffer padded with zeros (NETFS_READ_HOLE_CLEAR) or -ENODATA can be given (NETFS_READ_HOLE_FAIL). If term_func is not NULL, the operation may be performed asynchronously. Upon completion, successful or otherwise, (*term_func)() will be called and passed term_func_priv, along with an error or the amount of data transferred. If the op is run asynchronously, fscache_read() will return -EIOCBQUEUED. The second function allows an arbitrary asynchronous direct-IO write to be made against a cache object, though the write should be aligned and sized appropriately for the backing device: int fscache_write(struct netfs_cache_resources *cres, loff_t start_pos, struct iov_iter *iter, netfs_io_terminated_t term_func, void *term_func_priv); This works in very similar way to fscache_read(), except that there's no need to deal with holes (they're just overwritten). The caller is responsible for preventing concurrent overlapping writes. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819613224.215744.7877577215582621254.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906915386.143852.16936177636106480724.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967122632.1823006.7487049517698562172.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021521420.640689.12747258780542678309.stgit@warthog.procyon.org.uk/ # v4 commit 3a11b3a86366ccbf0818b088ffecadf8b2d61177 Author: David Howells Date: Tue Sep 14 09:47:45 2021 +0100 netfs: Pass more information on how to deal with a hole in the cache Pass more information to the cache on how to deal with a hole if it encounters one when trying to read from the cache. Three options are provided: (1) NETFS_READ_HOLE_IGNORE. Read the hole along with the data, assuming it to be a punched-out extent by the backing filesystem. (2) NETFS_READ_HOLE_CLEAR. If there's a hole, erase the requested region of the cache and clear the read buffer. (3) NETFS_READ_HOLE_FAIL. Fail the read if a hole is detected. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819612321.215744.9738308885948264476.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906914460.143852.6284247083607910189.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967119923.1823006.15637375885194297582.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021519762.640689.16994364383313159319.stgit@warthog.procyon.org.uk/ # v4 commit ed1235eb78a7421cd0ac2ad09e931f8f07ccdc7c Author: David Howells Date: Wed Oct 20 23:10:46 2021 +0100 fscache: Provide a function to let the netfs update its coherency data Provide a function to let the netfs update its coherency data: void fscache_update_cookie(struct fscache_cookie *cookie, const void *aux_data, const loff_t *object_size); This will update the auxiliary data and/or the size of the object attached to a cookie if either pointer is not-NULL and flag that the disk needs to be updated. Note that fscache_unuse_cookie() also allows this to be done. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819610438.215744.4223265964131424954.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906913530.143852.18150303220217653820.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967117795.1823006.7493373142653442595.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021518440.640689.6369952464473039268.stgit@warthog.procyon.org.uk/ # v4 commit 8e7a867bb7309fbf47e8c2a68798b919fc02523f Author: David Howells Date: Wed Oct 20 23:06:16 2021 +0100 fscache: Provide read/write stat counters for the cache Provide read/write stat counters for the cache backend to use. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819609532.215744.10821082637727410554.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906912598.143852.12960327989649429069.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967113830.1823006.3222957649202368162.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021517502.640689.6077928311710357342.stgit@warthog.procyon.org.uk/ # v4 commit cdf262f29488e6c3432911ec487ea41918fcbcd7 Author: David Howells Date: Thu Nov 11 23:14:29 2021 +0000 fscache: Count data storage objects in a cache Count the data storage objects that are currently allocated in a cache. This is used to pin certain cache structures until cache withdrawal is complete. Three helpers are provided to manage and make use of the count: (1) void fscache_count_object(struct fscache_cache *cache); This should be called by the cache backend to note that an object has been allocated and attached to the cache. (2) void fscache_uncount_object(struct fscache_cache *cache); This should be called by the backend to note that an object has been destroyed. This sends a wakeup event that allows cache withdrawal to proceed if it was waiting for that object. (3) void fscache_wait_for_objects(struct fscache_cache *cache); This can be used by the backend to wait for all outstanding cache object to be destroyed. Each cache's counter is displayed as part of /proc/fs/fscache/caches. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819608594.215744.1812706538117388252.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906911646.143852.168184059935530127.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967111846.1823006.9868154941573671255.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021516219.640689.4934796654308958158.stgit@warthog.procyon.org.uk/ # v4 commit d64f4554dd177c5891c02424a8d9e80590b55b35 Author: David Howells Date: Wed Oct 20 14:06:34 2021 +0100 fscache: Provide a means to begin an operation Provide a function to begin a read operation: int fscache_begin_read_operation( struct netfs_cache_resources *cres, struct fscache_cookie *cookie) This is primarily intended to be called by network filesystems on behalf of netfslib, but may also be called to use the I/O access functions directly. It attaches the resources required by the cache to cres struct from the supplied cookie. This holds access to the cache behind the cookie for the duration of the operation and forces cache withdrawal and cookie invalidation to perform synchronisation on the operation. cres->inval_counter is set from the cookie at this point so that it can be compared at the end of the operation. Note that this does not guarantee that the cache state is fully set up and able to perform I/O immediately; looking up and creation may be left in progress in the background. The operations intended to be called by the network filesystem, such as reading and writing, are expected to wait for the cookie to move to the correct state. This will, however, potentially sleep, waiting for a certain minimum state to be set or for operations such as invalidate to advance far enough that I/O can resume. Also provide a function for the cache to call to wait for the cache object to get to a state where it can be used for certain things: bool fscache_wait_for_operation(struct netfs_cache_resources *cres, enum fscache_want_stage stage); This looks at the cache resources provided by the begin function and waits for them to get to an appropriate stage. There's a choice of wanting just some parameters (FSCACHE_WANT_PARAM) or the ability to do I/O (FSCACHE_WANT_READ or FSCACHE_WANT_WRITE). Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819603692.215744.146724961588817028.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906910672.143852.13856103384424986357.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967110245.1823006.2239170567540431836.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021513617.640689.16627329360866150606.stgit@warthog.procyon.org.uk/ # v4 commit d24af13e2e2358a602740c7817ea90da43d3e740 Author: David Howells Date: Wed Oct 20 15:53:34 2021 +0100 fscache: Implement cookie invalidation Add a function to invalidate the cache behind a cookie: void fscache_invalidate(struct fscache_cookie *cookie, const void *aux_data, loff_t size, unsigned int flags) This causes any cached data for the specified cookie to be discarded. If the cookie is marked as being in use, a new cache object will be created if possible and future I/O will use that instead. In-flight I/O should be abandoned (writes) or reconsidered (reads). Each time it is called cookie->inval_counter is incremented and this can be used to detect invalidation at the end of an I/O operation. The coherency data attached to the cookie can be updated and the cookie size should be reset. One flag is available, FSCACHE_INVAL_DIO_WRITE, which should be used to indicate invalidation due to a DIO write on a file. This will temporarily disable caching for this cookie. Changes ======= ver #2: - Should only change to inval state if can get access to cache. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819602231.215744.11206598147269491575.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906909707.143852.18056070560477964891.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967107447.1823006.5945029409592119962.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021512640.640689.11418616313147754172.stgit@warthog.procyon.org.uk/ # v4 commit 12bb21a29c19aae50cfad4e2bb5c943108f34a7d Author: David Howells Date: Wed Oct 20 15:53:34 2021 +0100 fscache: Implement cookie user counting and resource pinning Provide a pair of functions to count the number of users of a cookie (open files, writeback, invalidation, resizing, reads, writes), to obtain and pin resources for the cookie and to prevent culling for the whilst there are users. The first function marks a cookie as being in use: void fscache_use_cookie(struct fscache_cookie *cookie, bool will_modify); The caller should indicate the cookie to use and whether or not the caller is in a context that may modify the cookie (e.g. a file open O_RDWR). If the cookie is not already resourced, fscache will ask the cache backend in the background to do whatever it needs to look up, create or otherwise obtain the resources necessary to access data. This is pinned to the cookie and may not be culled, though it may be withdrawn if the cache as a whole is withdrawn. The second function removes the in-use mark from a cookie and, optionally, updates the coherency data: void fscache_unuse_cookie(struct fscache_cookie *cookie, const void *aux_data, const loff_t *object_size); If non-NULL, the aux_data buffer and/or the object_size will be saved into the cookie and will be set on the backing store when the object is committed. If this removes the last usage on a cookie, the cookie is placed onto an LRU list from which it will be removed and closed after a couple of seconds if it doesn't get reused. This prevents resource overload in the cache - in particular it prevents it from holding too many files open. Changes ======= ver #2: - Fix fscache_unuse_cookie() to use atomic_dec_and_lock() to avoid a potential race if the cookie gets reused before it completes the unusement. - Added missing transition to LRU_DISCARDING state. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819600612.215744.13678350304176542741.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906907567.143852.16979631199380722019.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967106467.1823006.6790864931048582667.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021511674.640689.10084988363699111860.stgit@warthog.procyon.org.uk/ # v4 commit 5d00e426f95e7ea036fec2a0aceb3f71d6dbdf92 Author: David Howells Date: Wed Oct 20 15:53:34 2021 +0100 fscache: Implement simple cookie state machine Implement a very simple cookie state machine to handle lookup, invalidation, withdrawal, relinquishment and, to be added later, commit on LRU discard. Three cache methods are provided: ->lookup_cookie() to look up and, if necessary, create a data storage object; ->withdraw_cookie() to free the resources associated with that object and potentially delete it; and ->prepare_to_write(), to do prepare for changes to the cached data to be modified locally. Changes ======= ver #3: - Fix a race between LRU discard and relinquishment whereby the former would override the latter and thus the latter would never happen[1]. ver #2: - Don't hold n_accesses elevated whilst cache is bound to a cookie, but rather add a flag that prevents the state machine from being queued when n_accesses reaches 0. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/599331.1639410068@warthog.procyon.org.uk/ [1] Link: https://lore.kernel.org/r/163819599657.215744.15799615296912341745.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906903925.143852.1805855338154353867.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967105456.1823006.14730395299835841776.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021510706.640689.7961423370243272583.stgit@warthog.procyon.org.uk/ # v4 commit 29f18e79fe7c5f8011befeda9be6b220a350f947 Author: David Howells Date: Wed Oct 20 15:00:26 2021 +0100 fscache: Add a function for a cache backend to note an I/O error Add a function to the backend API to note an I/O error in a cache. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819598741.215744.891281275151382095.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906901316.143852.15225412215771586528.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967100721.1823006.16435671567428949398.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021508840.640689.11902836226570620424.stgit@warthog.procyon.org.uk/ # v4 commit bfa22da3ed652aa15acd4246fa13a0de6dbe4a59 Author: David Howells Date: Wed Oct 20 15:26:17 2021 +0100 fscache: Provide and use cache methods to lookup/create/free a volume Add cache methods to lookup, create and remove a volume. Looking up or creating the volume requires the cache pinning for access; freeing the volume requires the volume pinning for access. The ->acquire_volume() method is used to ask the cache backend to lookup and, if necessary, create a volume; the ->free_volume() method is used to free the resources for a volume. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819597821.215744.5225318658134989949.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906898645.143852.8537799955945956818.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967099771.1823006.1455197910571061835.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021507345.640689.4073511598838843040.stgit@warthog.procyon.org.uk/ # v4 commit 2e0c76aee25f33c482abda6224bd87732359354d Author: David Howells Date: Wed Oct 20 15:00:26 2021 +0100 fscache: Implement functions add/remove a cache Implement functions to allow the cache backend to add or remove a cache: (1) Declare a cache to be live: int fscache_add_cache(struct fscache_cache *cache, const struct fscache_cache_ops *ops, void *cache_priv); Take a previously acquired cache cookie, set the operations table and private data and mark the cache open for access. (2) Withdraw a cache from service: void fscache_withdraw_cache(struct fscache_cache *cache); This marks the cache as withdrawn and thus prevents further cache-level and volume-level accesses. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819596022.215744.8799712491432238827.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906896599.143852.17049208999019262884.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967097870.1823006.3470041000971522030.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021505541.640689.1819714759326331054.stgit@warthog.procyon.org.uk/ # v4 commit a7733fb632722a2f085f9324f14783effe268ed3 Author: David Howells Date: Wed Oct 20 15:53:34 2021 +0100 fscache: Implement cookie-level access helpers Add a number of helper functions to manage access to a cookie, pinning the cache object in place for the duration to prevent cache withdrawal from removing it: (1) void fscache_init_access_gate(struct fscache_cookie *cookie); This function initialises the access count when a cache binds to a cookie. An extra ref is taken on the access count to prevent wakeups while the cache is active. We're only interested in the wakeup when a cookie is being withdrawn and we're waiting for it to quiesce - at which point the counter will be decremented before the wait. The FSCACHE_COOKIE_NACC_ELEVATED flag is set on the cookie to keep track of the extra ref in order to handle a race between relinquishment and withdrawal both trying to drop the extra ref. (2) bool fscache_begin_cookie_access(struct fscache_cookie *cookie, enum fscache_access_trace why); This function attempts to begin access upon a cookie, pinning it in place if it's cached. If successful, it returns true and leaves a the access count incremented. (3) void fscache_end_cookie_access(struct fscache_cookie *cookie, enum fscache_access_trace why); This function drops the access count obtained by (2), permitting object withdrawal to take place when it reaches zero. A tracepoint is provided to track changes to the access counter on a cookie. Changes ======= ver #2: - Don't hold n_accesses elevated whilst cache is bound to a cookie, but rather add a flag that prevents the state machine from being queued when n_accesses reaches 0. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819595085.215744.1706073049250505427.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906895313.143852.10141619544149102193.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967095980.1823006.1133648159424418877.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021503063.640689.8870918985269528670.stgit@warthog.procyon.org.uk/ # v4 commit e6acd3299badbfb5fb0231d42481d4f5dedf5599 Author: David Howells Date: Wed Oct 20 15:26:17 2021 +0100 fscache: Implement volume-level access helpers Add a pair of helper functions to manage access to a volume, pinning the volume in place for the duration to prevent cache withdrawal from removing it: bool fscache_begin_volume_access(struct fscache_volume *volume, enum fscache_access_trace why); void fscache_end_volume_access(struct fscache_volume *volume, enum fscache_access_trace why); The way the access gate on the volume works/will work is: (1) If the cache tests as not live (state is not FSCACHE_CACHE_IS_ACTIVE), then we return false to indicate access was not permitted. (2) If the cache tests as live, then we increment the volume's n_accesses count and then recheck the cache liveness, ending the access if it ceased to be live. (3) When we end the access, we decrement the volume's n_accesses and wake up the any waiters if it reaches 0. (4) Whilst the cache is caching, the volume's n_accesses is kept artificially incremented to prevent wakeups from happening. (5) When the cache is taken offline, the state is changed to prevent new accesses, the volume's n_accesses is decremented and we wait for it to become 0. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819594158.215744.8285859817391683254.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906894315.143852.5454793807544710479.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967095028.1823006.9173132503876627466.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021501546.640689.9631510472149608443.stgit@warthog.procyon.org.uk/ # v4 commit 23e12e285a6ab7320a8bceead29cfe13190a6e3c Author: David Howells Date: Wed Oct 20 15:00:26 2021 +0100 fscache: Implement cache-level access helpers Add a pair of functions to pin/unpin a cache that we're wanting to do a high-level access to (such as creating or removing a volume): bool fscache_begin_cache_access(struct fscache_cache *cache, enum fscache_access_trace why); void fscache_end_cache_access(struct fscache_cache *cache, enum fscache_access_trace why); The way the access gate works/will work is: (1) If the cache tests as not live (state is not FSCACHE_CACHE_IS_ACTIVE), then we return false to indicate access was not permitted. (2) If the cache tests as live, then we increment the n_accesses count and then recheck the liveness, ending the access if it ceased to be live. (3) When we end the access, we decrement n_accesses and wake up the any waiters if it reaches 0. (4) Whilst the cache is caching, n_accesses is kept artificially incremented to prevent wakeups from happening. (5) When the cache is taken offline, the state is changed to prevent new accesses, n_accesses is decremented and we wait for n_accesses to become 0. Note that some of this is implemented in a later patch. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819593239.215744.7537428720603638088.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906893368.143852.14164004598465617981.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967093977.1823006.6967886507023056409.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021499995.640689.18286203753480287850.stgit@warthog.procyon.org.uk/ # v4 commit 7f3283aba39a0f395700c3b5defa4ec49d9914b3 Author: David Howells Date: Wed Oct 20 15:53:34 2021 +0100 fscache: Implement cookie registration Add functions to the fscache API to allow data file cookies to be acquired and relinquished by the network filesystem. It is intended that the filesystem will create such cookies per-inode under a volume. To request a cookie, the filesystem should call: struct fscache_cookie * fscache_acquire_cookie(struct fscache_volume *volume, u8 advice, const void *index_key, size_t index_key_len, const void *aux_data, size_t aux_data_len, loff_t object_size) The filesystem must first have created a volume cookie, which is passed in here. If it passes in NULL then the function will just return a NULL cookie. A binary key should be passed in index_key and is of size index_key_len. This is saved in the cookie and is used to locate the associated data in the cache. A coherency data buffer of size aux_data_len will be allocated and initialised from the buffer pointed to by aux_data. This is used to validate cache objects when they're opened and is stored on disk with them when they're committed. The data is stored in the cookie and will be updateable by various functions in later patches. The object_size must also be given. This is also used to perform a coherency check and to size the backing storage appropriately. This function disallows a cookie from being acquired twice in parallel, though it will cause the second user to wait if the first is busy relinquishing its cookie. When a network filesystem has finished with a cookie, it should call: void fscache_relinquish_cookie(struct fscache_volume *volume, bool retire) If retire is true, any backing data will be discarded immediately. Changes ======= ver #3: - fscache_hash()'s size parameter is now in bytes. Use __le32 as the unit to round up to. - When comparing cookies, simply see if the attributes are the same rather than subtracting them to produce a strcmp-style return[1]. - Add a check to see if the cookie is still hashed at the point of freeing. ver #2: - Don't hold n_accesses elevated whilst cache is bound to a cookie, but rather add a flag that prevents the state machine from being queued when n_accesses reaches 0. - Remove the unused cookie pointer field from the fscache_acquire tracepoint. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/CAHk-=whtkzB446+hX0zdLsdcUJsJ=8_-0S1mE_R+YurThfUbLA@mail.gmail.com/ [1] Link: https://lore.kernel.org/r/163819590658.215744.14934902514281054323.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906891983.143852.6219772337558577395.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967088507.1823006.12659006350221417165.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021498432.640689.12743483856927722772.stgit@warthog.procyon.org.uk/ # v4 commit 62ab63352350e881ae693a8236b35d7d0516c78b Author: David Howells Date: Wed Oct 20 15:26:17 2021 +0100 fscache: Implement volume registration Add functions to the fscache API to allow volumes to be acquired and relinquished by the network filesystem. A volume is an index of data storage cache objects. A volume is represented by a volume cookie in the API. A filesystem would typically create a volume for a superblock and then create per-inode cookies within it. To request a volume, the filesystem calls: struct fscache_volume * fscache_acquire_volume(const char *volume_key, const char *cache_name, const void *coherency_data, size_t coherency_len) The volume_key is a printable string used to match the volume in the cache. It should not contain any '/' characters. For AFS, for example, this would be "afs,,", e.g. "afs,example.com,523001". The cache_name can be NULL, but if not it should be a string indicating the name of the cache to use if there's more than one available. The coherency data, if given, is an arbitrarily-sized blob that's attached to the volume and is compared when the volume is looked up. If it doesn't match, the old volume is judged to be out of date and it and everything within it is discarded. Acquiring a volume twice concurrently is disallowed, though the function will wait if an old volume cookie is being relinquishing. When a network filesystem has finished with a volume, it should return the volume cookie by calling: void fscache_relinquish_volume(struct fscache_volume *volume, const void *coherency_data, bool invalidate) If invalidate is true, the entire volume will be discarded; if false, the volume will be synced and the coherency data will be updated. Changes ======= ver #4: - Removed an extraneous param from kdoc on fscache_relinquish_volume()[3]. ver #3: - fscache_hash()'s size parameter is now in bytes. Use __le32 as the unit to round up to. - When comparing cookies, simply see if the attributes are the same rather than subtracting them to produce a strcmp-style return[2]. - Make the coherency data an arbitrary blob rather than a u64, but don't store it for the moment. ver #2: - Fix error check[1]. - Make a fscache_acquire_volume() return errors, including EBUSY if a conflicting volume cookie already exists. No error is printed now - that's left to the netfs. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/20211203095608.GC2480@kili/ [1] Link: https://lore.kernel.org/r/CAHk-=whtkzB446+hX0zdLsdcUJsJ=8_-0S1mE_R+YurThfUbLA@mail.gmail.com/ [2] Link: https://lore.kernel.org/r/20211220224646.30e8205c@canb.auug.org.au/ [3] Link: https://lore.kernel.org/r/163819588944.215744.1629085755564865996.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906890630.143852.13972180614535611154.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967086836.1823006.8191672796841981763.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021495816.640689.4403156093668590217.stgit@warthog.procyon.org.uk/ # v4 commit 9549332df4ed4e761a1d41c83f2c25d28bb22431 Author: David Howells Date: Wed Oct 20 15:00:26 2021 +0100 fscache: Implement cache registration Implement a register of caches and provide functions to manage it. Two functions are provided for the cache backend to use: (1) Acquire a cache cookie: struct fscache_cache *fscache_acquire_cache(const char *name) This gets the cache cookie for a cache of the specified name and moves it to the preparation state. If a nameless cache cookie exists, that will be given this name and used. (2) Relinquish a cache cookie: void fscache_relinquish_cache(struct fscache_cache *cache); This relinquishes a cache cookie, cleans it and makes it available if it's still referenced by a network filesystem. Note that network filesystems don't deal with cache cookies directly, but rather go straight to the volume registration. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819587157.215744.13523139317322503286.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906889665.143852.10378009165231294456.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967085081.1823006.2218944206363626210.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021494847.640689.10109692261640524343.stgit@warthog.procyon.org.uk/ # v4 commit e8a07c9d22afdace966353231d0273d29efe0890 Author: David Howells Date: Wed Oct 20 15:45:28 2021 +0100 fscache: Implement a hash function Implement a function to generate hashes. It needs to be stable over time and endianness-independent as the hashes will appear on disk in future patches. It can assume that its input is a multiple of four bytes in size and alignment. This is borrowed from the VFS and simplified. le32_to_cpu() is added to make it endianness-independent. Changes ======= ver #3: - Read the data being hashed in an endianness-independent way[1]. - Change the size parameter to be in bytes rather than words. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/CAHk-=whtkzB446+hX0zdLsdcUJsJ=8_-0S1mE_R+YurThfUbLA@mail.gmail.com [1] Link: https://lore.kernel.org/r/163819586113.215744.1699465806130102367.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906888735.143852.10944614318596881429.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967082342.1823006.8915671045444488742.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021493624.640689.9990442668811178628.stgit@warthog.procyon.org.uk/ # v4 commit 1e1236b841166f1d2daf36fdf6bb3e656bc5f5ca Author: David Howells Date: Wed Oct 20 14:34:41 2021 +0100 fscache: Introduce new driver Introduce basic skeleton of the new, rewritten fscache driver. Changes ======= ver #3: - Use remove_proc_subtree(), not remove_proc_entry() to remove a populated dir. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819584034.215744.4290533472390439030.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906887770.143852.3577888294989185666.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967080039.1823006.5702921801104057922.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021491014.640689.4292699878317589512.stgit@warthog.procyon.org.uk/ # v4 commit a39c41b853ee51f4dcd19f5556f860ae8e2f23d3 Author: David Howells Date: Wed Oct 20 14:30:37 2021 +0100 netfs: Pass a flag to ->prepare_write() to say if there's no alloc'd space Pass a flag to ->prepare_write() to indicate if there's definitely no space allocated in the cache yet (for instance if we've already checked as we were asked to do a read). Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819583123.215744.12783808230464471417.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906886835.143852.6689886781122679769.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967079100.1823006.12889542712309574359.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021489334.640689.3131206613015409076.stgit@warthog.procyon.org.uk/ # v4 commit 9e1aa6b8f484dde5ada1212092d20ea3f55c24e8 Author: David Howells Date: Tue Oct 12 12:05:27 2021 +0100 netfs: Display the netfs inode number in the netfs_read tracepoint Display the netfs inode number in the netfs_read tracepoint so that this can be used to correlate with the cachefiles_prep_read tracepoint. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819581097.215744.17476611915583897051.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906885903.143852.12229407815154182247.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967078164.1823006.15286989199782861123.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021487412.640689.7544388469390936443.stgit@warthog.procyon.org.uk/ # v4 commit 2cee6fbb7f01bcb25f11ef1439e89a29de4c0c1d Author: David Howells Date: Mon Oct 25 21:53:44 2021 +0100 fscache: Remove the contents of the fscache driver, pending rewrite Remove the code that comprises the fscache driver as it's going to be substantially rewritten, with the majority of the code being erased in the rewrite. A small piece of linux/fscache.h is left as that is #included by a bunch of network filesystems. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819578724.215744.18210619052245724238.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906884814.143852.6727245089843862889.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967077097.1823006.1377665951499979089.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021485548.640689.13876080567388696162.stgit@warthog.procyon.org.uk/ # v4 commit 850cba069c266d6f31b81c5a199052a3482a63fc Author: David Howells Date: Sun Oct 31 12:58:05 2021 +0000 cachefiles: Delete the cachefiles driver pending rewrite Delete the code from the cachefiles driver to make it easier to rewrite and resubmit in a logical manner. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819577641.215744.12718114397770666596.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906883770.143852.4149714614981373410.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967076066.1823006.7175712134577687753.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021483619.640689.7586546280515844702.stgit@warthog.procyon.org.uk/ # v4 commit 01491a756578d8602dfdfc79f2638c519bfdadb7 Author: David Howells Date: Mon Oct 25 21:41:26 2021 +0100 fscache, cachefiles: Disable configuration Disable fscache and cachefiles in Kconfig whilst it is rewritten. Signed-off-by: David Howells Reviewed-by: Jeff Layton cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/163819576672.215744.12444272479560406780.stgit@warthog.procyon.org.uk/ # v1 Link: https://lore.kernel.org/r/163906882835.143852.11073015983885872901.stgit@warthog.procyon.org.uk/ # v2 Link: https://lore.kernel.org/r/163967075113.1823006.277316290062782998.stgit@warthog.procyon.org.uk/ # v3 Link: https://lore.kernel.org/r/164021481179.640689.2004199594774033658.stgit@warthog.procyon.org.uk/ # v4 commit b9f9dbad0bd1c302d357fdd327c398f51f5fc2b1 Author: Dan Carpenter Date: Fri Jan 7 10:17:27 2022 +0300 Bluetooth: hci_sock: fix endian bug in hci_sock_setsockopt() This copies a u16 into the high bits of an int, which works on a big endian system but not on a little endian system. Fixes: 09572fca7223 ("Bluetooth: hci_sock: Add support for BT_{SND,RCV}BUF") Signed-off-by: Dan Carpenter Signed-off-by: Marcel Holtmann commit 2b70d4f9b20635ac328836e50d183632e1930f94 Author: Dan Carpenter Date: Fri Jan 7 10:16:44 2022 +0300 Bluetooth: L2CAP: uninitialized variables in l2cap_sock_setsockopt() The "opt" variable is a u32, but on some paths only the top bytes were initialized and the others contained random stack data. Fixes: a7b75c5a8c41 ("net: pass a sockptr_t into ->setsockopt") Signed-off-by: Dan Carpenter Signed-off-by: Marcel Holtmann commit 4fac8a7ac80b18068fce4feb2376e41c48d67c31 Author: Sai Teja Aluvala Date: Fri Jan 7 11:50:53 2022 +0530 Bluetooth: btqca: sequential validation Added Sequential validation support & patch command config Signed-off-by: Sai Teja Aluvala Signed-off-by: Marcel Holtmann commit 1cd563ebd0dc062127a85e84f934f4c697bb43ef Author: Aaron Ma Date: Fri Jan 7 11:59:09 2022 +0800 Bluetooth: btusb: Add support for Foxconn QCA 0xe0d0 Add an ID of Qualcomm Bluetooth SoC WCN6855. T: Bus=05 Lev=01 Prnt=01 Port=03 Cnt=02 Dev#= 4 Spd=12 MxCh= 0 D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=0489 ProdID=e0d0 Rev= 0.01 C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms I: If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms I:* If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms I: If#= 1 Alt= 6 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 63 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 63 Ivl=1ms I: If#= 1 Alt= 7 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 65 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 65 Ivl=1ms Signed-off-by: Aaron Ma Signed-off-by: Marcel Holtmann commit 95655456e7cee858a23793f67025765b4c4c227b Author: Tedd Ho-Jeong An Date: Thu Jan 6 16:34:54 2022 -0800 Bluetooth: btintel: Fix broken LED quirk for legacy ROM devices This patch fixes the broken LED quirk for Intel legacy ROM devices. To fix the LED issue that doesn't turn off immediately, the host sends the SW RFKILL command while shutting down the interface and it puts the devices in SW RFKILL state. Once the device is in SW RFKILL state, it can only accept HCI_Reset to exit from the SW RFKILL state. This patch checks the quirk for broken LED and sends the HCI_Reset before sending the HCI_Intel_Read_Version command. The affected legacy ROM devices are - 8087:07dc - 8087:0a2a - 8087:0aa7 Fixes: ffcba827c0a1d ("Bluetooth: btintel: Fix the LED is not turning off immediately") Signed-off-by: Tedd Ho-Jeong An Signed-off-by: Marcel Holtmann commit 1b1f98dd70dcfd25476adabcbe72484312e879f7 Author: Jiasheng Jiang Date: Fri Jan 7 10:08:51 2022 +0800 ALSA: intel_hdmi: Check for error num after setting mask To maintain the consistency of the code, it should be better to add the sanity check after calling dma_set_mask_and_coherent(), like tegra_pcm_dma_allocate() in `sound/soc/tegra/tegra_pcm.c`. Signed-off-by: Jiasheng Jiang Link: https://lore.kernel.org/r/20220107020851.3095591-1-jiasheng@iscas.ac.cn Signed-off-by: Takashi Iwai commit e4a3d6a6a19a88cd021a3f4332c1c9b68faa8ae0 Merge: 8947c390b2202 0dbc416218751 Author: Jakub Kicinski Date: Thu Jan 6 20:06:32 2022 -0800 Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== 100GbE Intel Wired LAN Driver Updates 2022-01-06 Victor adds restoring of advanced rules after reset. Wojciech improves usage of switchdev control VSI by utilizing the device's advanced rules for forwarding. Christophe Jaillet removes some unneeded calls to zero bitmaps, changes some bitmap operations that don't need to be atomic, and converts a kfree() to a more appropriate bitmap_free(). * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue: ice: Use bitmap_free() to free bitmap ice: Optimize a few bitmap operations ice: Slightly simply ice_find_free_recp_res_idx ice: improve switchdev's slow-path ice: replay advanced rules after reset ==================== Link: https://lore.kernel.org/r/20220106183013.3777622-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 8947c390b22021cfcee3abe83e52acb38cc308be Merge: 42379b9542283 4735402173e6e Author: Jakub Kicinski Date: Thu Jan 6 20:00:48 2022 -0800 Merge branch 'mlxsw-add-spectrum-4-support' Ido Schimmel says: ==================== mlxsw: Add Spectrum-4 support This patchset adds Spectrum-4 support in mlxsw. It builds on top of a previous patchset merged in commit 10184da91666 ("Merge branch 'mlxsw-Spectrum-4-prep'") and makes two additional changes before adding Spectrum-4 support. Patchset overview: Patches #1-#2 add a few Spectrum-4 specific variants of existing ACL keys. The new variants are needed because the size of certain key elements (e.g., local port) was increased in Spectrum-4. Patches #3-#6 are preparations. Patch #7 implements the Spectrum-4 variant of the Bloom filter hash function. The Bloom filter is used to optimize ACL lookups by potentially skipping certain lookups if they are guaranteed not to match. See additional info in merge commit ae6750e0a5ef ("Merge branch 'mlxsw-spectrum_acl-Add-Bloom-filter-support'"). Patch #8 finally adds Spectrum-4 support. ==================== Link: https://lore.kernel.org/r/20220106160652.821176-1-idosch@nvidia.com Signed-off-by: Jakub Kicinski commit 4735402173e6eed18d7e04cfc4bc358d8b2965db Author: Amit Cohen Date: Thu Jan 6 18:06:52 2022 +0200 mlxsw: spectrum: Extend to support Spectrum-4 ASIC Extend existing driver for Spectrum, Spectrum-2 and Spectrum-3 ASICs to support Spectrum-4 ASIC as well. Currently there is no released firmware version for Spectrum-4, so the driver is not enforcing a minimum version. Signed-off-by: Amit Cohen Signed-off-by: Ido Schimmel Signed-off-by: Jakub Kicinski commit 852ee4191dd2046203c2fece6a9402ce28118f80 Author: Amit Cohen Date: Thu Jan 6 18:06:51 2022 +0200 mlxsw: spectrum_acl_bloom_filter: Add support for Spectrum-4 calculation Spectrum-4 will calculate hash function for bloom filter differently from the existing ASICs. First, two hash functions will be used to calculate 16 bits result. The final result will be combination of the two results - 6 bits which are result of CRC-6 will be used as MSB and 10 bits which are result of CRC-10 will be used as LSB. Second, while in Spectrum{2,3}, there is a padding in each chunk, so the chunks use a sequence of whole bytes, in Spectrum-4 there is no padding, so each chunk use 20 bytes minus 2 bits, so it is necessary to align the chunks to be without holes. Add dedicated 'mlxsw_sp_acl_bf_ops' for Spectrum-4 and add the required tables for CRC calculations. All the details are documented as part of the code for future use. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: Jakub Kicinski commit 58723d2f77717373d44721a2c65f8af5917102b7 Author: Amit Cohen Date: Thu Jan 6 18:06:50 2022 +0200 mlxsw: Add operations structure for bloom filter calculation Spectrum-4 will calculate hash function for bloom filter differently from the existing ASICs. There are two changes: 1. Instead of using one hash function to calculate 16 bits output (CRC-16), two functions will be used. 2. The chunks will be built differently, without padding. As preparation for support of Spectrum-4 bloom filter, add 'ops' structure to allow handling different calculation for different ASICs. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: Jakub Kicinski commit 29409f363e2dfdab41bb2f3019116a0a585e8d0b Author: Amit Cohen Date: Thu Jan 6 18:06:49 2022 +0200 mlxsw: spectrum_acl_bloom_filter: Rename Spectrum-2 specific objects for future use Spectrum-4 will calculate hash function for bloom filter differently from the existing ASICs. There are two changes: 1. Instead of using one hash function to calculate 16 bits output (CRC-16), two functions will be used. 2. The chunks will be built differently, without padding. As preparation for support of Spectrum-4 bloom filter, rename CRC table to include "sp2" prefix and "crc16", as next patch will add two additional tables. In addition, rename all the dedicated functions and defines for Spectrum-{2,3} to include "sp2" prefix. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: Jakub Kicinski commit 5d5c3ba9e4121b7738d10be3825f4d9a5a1d80ef Author: Amit Cohen Date: Thu Jan 6 18:06:48 2022 +0200 mlxsw: spectrum_acl_bloom_filter: Make mlxsw_sp_acl_bf_key_encode() more flexible Spectrum-4 will calculate hash function for bloom filter differently from the existing ASICs. One of the changes is related to the way that the chunks will be build - without padding. As preparation for support of Spectrum-4 bloom filter, make mlxsw_sp_acl_bf_key_encode() more flexible, so it will be able to use it for Spectrum-4 as well. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: Jakub Kicinski commit 4711671297ecfe5a5e9976f449c6161133f5ebb1 Author: Amit Cohen Date: Thu Jan 6 18:06:47 2022 +0200 mlxsw: spectrum_acl_bloom_filter: Reorder functions to make the code more aesthetic Currently, mlxsw_sp_acl_bf_rule_count_index_get() is implemented before mlxsw_sp_acl_bf_index_get() but is used after it. Adding a new function for Spectrum-4 would make them further apart still. Fix by moving them around. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: Jakub Kicinski commit 07ff135958dd293988f21ca74c51499a8bb90f88 Author: Amit Cohen Date: Thu Jan 6 18:06:46 2022 +0200 mlxsw: Introduce flex key elements for Spectrum-4 Spectrum-4 ASIC will support more virtual routers and local ports compared to the existing ASICs. Therefore, the virtual router and local port ACL key elements need to be increased. Introduce new key elements for Spectrum-4 to be aligned with the elements used already for other Spectrum ASICs. The key blocks layout is the same for Spectrum-4, so use the existing code for encode_block() and clear_block(), just create separate blocks. Note that size of `VIRT_ROUTER_MSB` is 4 bits in Spectrum-4, therefore declare it using `MLXSW_AFK_ELEMENT_INST_U32()`, in order to be able to set `.avoid_size_check` to true. Otherwise, `mlxsw_afk_blocks_check()` will fail and warn. Signed-off-by: Amit Cohen Signed-off-by: Ido Schimmel Signed-off-by: Jakub Kicinski commit 6d5d8ebb881c425df10980c0188f7495caf2232f Author: Amit Cohen Date: Thu Jan 6 18:06:45 2022 +0200 mlxsw: Rename virtual router flex key element In Spectrum-4, the size of the virtual router ACL key element increased from 11 bits to 12 bits. In order to reuse the existing virtual router ACL key element enumerators for Spectrum-4, rename 'VIRT_ROUTER_8_10' and 'VIRT_ROUTER_0_7' to 'VIRT_ROUTER_MSB' and 'VIRT_ROUTER_LSB', respectively. No functional changes intended. Signed-off-by: Amit Cohen Signed-off-by: Ido Schimmel Signed-off-by: Jakub Kicinski commit 42379b9542283bcb86ceedb245ff644d6f59037d Merge: 257367c0c9d80 d1a9b84183e81 Author: Jakub Kicinski Date: Thu Jan 6 19:56:31 2022 -0800 Merge branch 'dpaa2-eth-small-cleanup' Ioana Ciornei says: ==================== dpaa2-eth: small cleanup These 3 patches are just part of a small cleanup on the dpaa2-eth and the dpaa2-switch drivers. In case we are hitting a case in which the fwnode of the root dprc device we initiate a deferred probe. On the dpaa2-switch side, if we are on the remove path, make sure that we check for a non-NULL pointer before accessing the port private structure. ==================== Link: https://lore.kernel.org/r/20220106135905.81923-1-ioana.ciornei@nxp.com Signed-off-by: Jakub Kicinski commit d1a9b84183e818c6c3540a454d6ad278b56718b2 Author: Ioana Ciornei Date: Thu Jan 6 15:59:05 2022 +0200 dpaa2-switch: check if the port priv is valid Before accessing the port private structure make sure that there is still a non-NULL pointer there. A NULL pointer access can happen when we are on the remove path, some switch ports are unregistered and some are in the process of unregistering. Signed-off-by: Ioana Ciornei Signed-off-by: Jakub Kicinski commit 4e30e98c4b4c8c3bd2ff048e4f4bc74c8948a9fb Author: Ioana Ciornei Date: Thu Jan 6 15:59:04 2022 +0200 dpaa2-mac: return -EPROBE_DEFER from dpaa2_mac_open in case the fwnode is not set We could get into a situation when the fwnode of the parent device is not yet set because its probe didn't yet finish. When this happens, any caller of the dpaa2_mac_open() will not have the fwnode available, thus cause problems at the PHY connect time. Avoid this by just returning -EPROBE_DEFER from the dpaa2_mac_open when this happens. Signed-off-by: Ioana Ciornei Signed-off-by: Jakub Kicinski commit 5b1e38c0792cc7a44997328de37d393f81b2501a Author: Robert-Ionut Alexa Date: Thu Jan 6 15:59:03 2022 +0200 dpaa2-mac: bail if the dpmacs fwnode is not found The parent pointer node handler must be declared with a NULL initializer. Before using it, a check must be performed to make sure that a valid address has been assigned to it. Signed-off-by: Robert-Ionut Alexa Signed-off-by: Jakub Kicinski commit 5f21d7d283dd82865bdb0123795b3accf0d42b67 Author: Jiasheng Jiang Date: Fri Dec 31 09:40:36 2021 +0800 crypto: af_alg - rewrite NULL pointer check Because of the possible alloc failure of the alloc_page(), it could return NULL pointer. And there is a check below the sg_assign_page(). But it will be more logical to move the NULL check before the sg_assign_page(). Signed-off-by: Jiasheng Jiang Signed-off-by: Herbert Xu commit dd827abe296fe4249b2f8c9b95f72f814ea8348c Author: Zizhuang Deng Date: Thu Dec 30 15:03:31 2021 +0800 lib/mpi: Add the return value check of kcalloc() Add the return value check of kcalloc() to avoid potential NULL ptr dereference. Fixes: a8ea8bdd9df9 ("lib/mpi: Extend the MPI library") Signed-off-by: Zizhuang Deng Reviewed-by: Tianjia Zhang Signed-off-by: Herbert Xu commit ec97d23c8e22c96e8c9cad7d3f93d593abfc8b06 Author: Sam Shih Date: Fri Dec 17 20:11:48 2021 +0800 clk: mediatek: add mt7986 clock support Add MT7986 clock support, include topckgen, apmixedsys, infracfg, and ethernet subsystem clocks. Signed-off-by: Sam Shih Link: https://lore.kernel.org/r/20211217121148.6753-4-sam.shih@mediatek.com Reviewed-by: Ryder Lee [sboyd@kernel.org: Fix typos in Kconfig, there are more existing typos from where they were copied from of but whatever] Signed-off-by: Stephen Boyd commit 29507144c99814cd5e1ed9873db21ffc634f6c95 Merge: 36595d8ad46d9 23c54263efd7c Author: Jakub Kicinski Date: Thu Jan 6 18:37:44 2022 -0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf Pablo Neira Ayuso says: ==================== Netfilter fixes for net The following patchset contains Netfilter fixes for net: 1) Refcount leak in ipt_CLUSTERIP rule loading path, from Xin Xiong. 2) Use socat in netfilter selftests, from Hangbin Liu. 3) Skip layer checksum 4 update for IP fragments. 4) Missing allocation of pcpu scratch maps on clone in nft_set_pipapo, from Florian Westphal. * git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf: netfilter: nft_set_pipapo: allocate pcpu scratch maps on clone netfilter: nft_payload: do not update layer 4 checksum when mangling fragments selftests: netfilter: switch to socat for tests using -q option netfilter: ipt_CLUSTERIP: fix refcount leak in clusterip_tg_check() ==================== Link: https://lore.kernel.org/r/20220106215139.170824-1-pablo@netfilter.org Signed-off-by: Jakub Kicinski commit 4470c830f9791203e7514c6b4d3a0df194e3ee0d Author: Sam Shih Date: Fri Dec 17 20:11:47 2021 +0800 clk: mediatek: add mt7986 clock IDs Add MT7986 clock dt-bindings, include topckgen, apmixedsys, infracfg, and ethernet subsystem clocks. Signed-off-by: Sam Shih Acked-by: Rob Herring Link: https://lore.kernel.org/r/20211217121148.6753-3-sam.shih@mediatek.com Reviewed-by: Ryder Lee Signed-off-by: Stephen Boyd commit 261446b2653e7b9d594f1de764691477775e2f07 Author: Sam Shih Date: Fri Dec 17 20:11:46 2021 +0800 dt-bindings: clock: mediatek: document clk bindings for mediatek mt7986 SoC This patch adds the binding documentation for topckgen, apmixedsys, infracfg, and ethernet subsystem clocks. Signed-off-by: Sam Shih Acked-by: Rob Herring Link: https://lore.kernel.org/r/20211217121148.6753-2-sam.shih@mediatek.com Reviewed-by: Ryder Lee Signed-off-by: Stephen Boyd commit d95abcab7b4aef11b29a5342b11fa60fd211929f Author: AngeloGioacchino Del Regno Date: Mon Jan 3 15:37:12 2022 +0100 clk: mediatek: clk-gate: Use regmap_{set/clear}_bits helpers Appropriately change calls to regmap_update_bits() with regmap_set_bits() and regmap_clear_bits() for improved readability. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220103143712.46675-2-angelogioacchino.delregno@collabora.com Reviewed-by: Chen-Yu Tsai Signed-off-by: Stephen Boyd commit 4233463866796affc6674888e4cbaa24e0ff7965 Author: AngeloGioacchino Del Regno Date: Mon Jan 3 15:37:11 2022 +0100 clk: mediatek: clk-gate: Shrink by adding clockgating bit check helper Add a clockgating bit check helper and use it in functions mtk_cg_bit_is_cleared(), mtk_cg_bit_is_set() to shrink the file size. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20220103143712.46675-1-angelogioacchino.delregno@collabora.com Signed-off-by: Stephen Boyd commit 257367c0c9d800ef3065b440161596896e179038 Merge: 710ad98c363a6 eff14fcd032bc Author: Jakub Kicinski Date: Thu Jan 6 18:07:25 2022 -0800 Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next Alexei Starovoitov says: ==================== pull-request: bpf-next 2022-01-06 We've added 41 non-merge commits during the last 2 day(s) which contain a total of 36 files changed, 1214 insertions(+), 368 deletions(-). The main changes are: 1) Various fixes in the verifier, from Kris and Daniel. 2) Fixes in sockmap, from John. 3) bpf_getsockopt fix, from Kuniyuki. 4) INET_POST_BIND fix, from Menglong. 5) arm64 JIT fix for bpf pseudo funcs, from Hou. 6) BPF ISA doc improvements, from Christoph. * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next: (41 commits) bpf: selftests: Add bind retry for post_bind{4, 6} bpf: selftests: Use C99 initializers in test_sock.c net: bpf: Handle return value of BPF_CGROUP_RUN_PROG_INET{4,6}_POST_BIND() bpf/selftests: Test bpf_d_path on rdonly_mem. libbpf: Add documentation for bpf_map batch operations selftests/bpf: Don't rely on preserving volatile in PT_REGS macros in loop3 xdp: Add xdp_do_redirect_frame() for pre-computed xdp_frames xdp: Move conversion to xdp_frame out of map functions page_pool: Store the XDP mem id page_pool: Add callback to init pages when they are allocated xdp: Allow registering memory model without rxq reference samples/bpf: xdpsock: Add timestamp for Tx-only operation samples/bpf: xdpsock: Add time-out for cleaning Tx samples/bpf: xdpsock: Add sched policy and priority support samples/bpf: xdpsock: Add cyclic TX operation capability samples/bpf: xdpsock: Add clockid selection support samples/bpf: xdpsock: Add Dest and Src MAC setting for Tx-only operation samples/bpf: xdpsock: Add VLAN support for Tx-only operation libbpf 1.0: Deprecate bpf_object__find_map_by_offset() API libbpf 1.0: Deprecate bpf_map__is_offload_neutral() ... ==================== Link: https://lore.kernel.org/r/20220107013626.53943-1-alexei.starovoitov@gmail.com Signed-off-by: Jakub Kicinski commit 1fdaaa13b44fdcbe3b6bed9cf5b67f9efac50610 Author: Ajit Kumar Pandey Date: Sun Dec 12 23:35:27 2021 +0530 clk: x86: Fix clk_gate_flags for RV_CLK_GATE In newer SoC we have to clear bit for disabling 48MHz oscillator clock gate. Remove CLK_GATE_SET_TO_DISABLE flag for proper enable and disable of 48MHz clock. Signed-off-by: Ajit Kumar Pandey Reviewed-by: Mario Limonciello Link: https://lore.kernel.org/r/20211212180527.1641362-6-AjitKumar.Pandey@amd.com Signed-off-by: Stephen Boyd commit c33917b439e0cd24182e40726e18104f66d48933 Author: Ajit Kumar Pandey Date: Sun Dec 12 23:35:26 2021 +0530 clk: x86: Use dynamic con_id string during clk registration Replace hard coded con_id string with fch_data->name. We have clk consumers looking up with different clock names, hence use dynamic con_id string during clk lookup registration. fch_data->name will be initialized in acpi driver based on fmw property value. Signed-off-by: Ajit Kumar Pandey Reviewed-by: Mario Limonciello Link: https://lore.kernel.org/r/20211212180527.1641362-5-AjitKumar.Pandey@amd.com Signed-off-by: Stephen Boyd commit 7fdb98e8a768b3ccc05494d3ea4436047f512b9d Author: Ajit Kumar Pandey Date: Sun Dec 12 23:35:25 2021 +0530 ACPI: APD: Add a fmw property clk-name Add a new device property to fetch clk-name from firmware. Signed-off-by: Ajit Kumar Pandey Reviewed-by: Mario Limonciello Link: https://lore.kernel.org/r/20211212180527.1641362-4-AjitKumar.Pandey@amd.com Signed-off-by: Stephen Boyd commit 3663f26b389b3951426971b44bb9312fdff0efec Author: Ajit Kumar Pandey Date: Sun Dec 12 23:35:24 2021 +0530 drivers: acpi: acpi_apd: Remove unused device property "is-rv" Initially "is-rv" device property is added for 48MHz fixed clock support on Raven or RV architecture. It's unused now as we moved to pci device_id based selection to extend such support on other architectures. This change removed unused code from acpi driver. Signed-off-by: Ajit Kumar Pandey Reviewed-by: Mario Limonciello Link: https://lore.kernel.org/r/20211212180527.1641362-3-AjitKumar.Pandey@amd.com Signed-off-by: Stephen Boyd commit 65ab884ac9cd8454435b5159ade540004f1a24fe Author: Ajit Kumar Pandey Date: Sun Dec 12 23:35:23 2021 +0530 x86: clk: clk-fch: Add support for newer family of AMD's SOC FCH controller clock configuration slightly differs across AMD's SOC architectures. Newer family of SOC only support a 48MHz fix clock while stoney SOC family has a clk_mux to choose 48MHz and 25 MHz clk. At present fixed clk support is only enabled for RV architecture using "is-rv" device property initialized from boot loader. This limit 48MHz fixed clock gate support to RV platform unless we add similar device property in boot loader for other architectures. Add pci_device_id table with Stoney platform id and replace "is-rv" device property check with pci id match to add clk mux support with 25MHz and 48MHz clk support based on clk mux selection. This enable 48Mhz fixed fch clock support by default on all newer SOC's except stoney. Also replace RV with FIXED as a generic naming conventions across all platforms and changed module description. Signed-off-by: Ajit Kumar Pandey Reviewed-by: Mario Limonciello Link: https://lore.kernel.org/r/20211212180527.1641362-2-AjitKumar.Pandey@amd.com Signed-off-by: Stephen Boyd commit b5bc83bb70a5ca8fc090de3221fd8f1d4400241a Author: Paul Cercueil Date: Mon Dec 20 19:33:19 2021 +0000 clk: ingenic: Add MDMA and BDMA clocks The Ingenic JZ4760 and JZ4770 both have an extra DMA core named BDMA dedicated to the NAND and BCH controller, but which can also do memory-to-memory transfers. The JZ4760 additionally has a DMA core named MDMA dedicated to memory-to-memory transfers. The programming manual for the JZ4770 does have a bit for a MDMA clock, but does not seem to have the hardware wired in. Add the BDMA and MDMA clocks to the JZ4760 CGU code, and the BDMA clock to the JZ4770 code, so that the BDMA and MDMA controllers can be used. Signed-off-by: Paul Cercueil Link: https://lore.kernel.org/r/20211220193319.114974-3-paul@crapouillou.net Signed-off-by: Stephen Boyd commit 51d04bcfb82a005d38b6f1011dc04a810d359aea Author: Paul Cercueil Date: Mon Dec 20 19:33:18 2021 +0000 dt-bindings: clk/ingenic: Add MDMA and BDMA clocks The Ingenic JZ4760 and JZ4770 both have an extra DMA core named BDMA dedicated to the NAND and BCH controller, but which can also do memory-to-memory transfers. The JZ4760 additionally has a DMA core named MDMA dedicated to memory-to-memory transfers. The programming manual for the JZ4770 does have a bit for a MDMA clock, but does not seem to have the hardware wired in. Add macros for the MDMA and BDMA clocks to the dt-bindings include files, so that they can be used within Device Tree files. Signed-off-by: Paul Cercueil Link: https://lore.kernel.org/r/20211220193319.114974-2-paul@crapouillou.net Acked-by: Rob Herring Signed-off-by: Stephen Boyd commit c861c1be3897845313a0df47804b1db37c7052e1 Author: Conor Dooley Date: Thu Dec 23 15:42:44 2021 +0000 clk: bm1880: remove kfrees on static allocations bm1880_clk_unregister_pll & bm1880_clk_unregister_div both try to free statically allocated variables, so remove those kfrees. For example, if we take L703 kfree(div_hw): - div_hw is a bm1880_div_hw_clock pointer - in bm1880_clk_register_plls this is pointed to an element of arg1: struct bm1880_div_hw_clock *clks - in the probe, where bm1880_clk_register_plls is called arg1 is bm1880_div_clks, defined on L371: static struct bm1880_div_hw_clock bm1880_div_clks[] Signed-off-by: Conor Dooley Fixes: 1ab4601da55b ("clk: Add common clock driver for BM1880 SoC") Link: https://lore.kernel.org/r/20211223154244.1024062-1-conor.dooley@microchip.com Signed-off-by: Stephen Boyd commit eff14fcd032bc1b403c1716f6823b3c72c58096a Merge: 44bab87d8ca6f f734248174936 Author: Alexei Starovoitov Date: Thu Jan 6 17:08:35 2022 -0800 Merge branch 'net: bpf: handle return value of post_bind{4,6} and add selftests for it' Menglong Dong says: ==================== From: Menglong Dong The return value of BPF_CGROUP_RUN_PROG_INET{4,6}_POST_BIND() in __inet_bind() is not handled properly. While the return value is non-zero, it will set inet_saddr and inet_rcv_saddr to 0 and exit: err = BPF_CGROUP_RUN_PROG_INET4_POST_BIND(sk); if (err) { inet->inet_saddr = inet->inet_rcv_saddr = 0; goto out_release_sock; } Let's take UDP for example and see what will happen. For UDP socket, it will be added to 'udp_prot.h.udp_table->hash' and 'udp_prot.h.udp_table->hash2' after the sk->sk_prot->get_port() called success. If 'inet->inet_rcv_saddr' is specified here, then 'sk' will be in the 'hslot2' of 'hash2' that it don't belong to (because inet_saddr is changed to 0), and UDP packet received will not be passed to this sock. If 'inet->inet_rcv_saddr' is not specified here, the sock will work fine, as it can receive packet properly, which is wired, as the 'bind()' is already failed. To undo the get_port() operation, introduce the 'put_port' field for 'struct proto'. For TCP proto, it is inet_put_port(); For UDP proto, it is udp_lib_unhash(); For icmp proto, it is ping_unhash(). Therefore, after sys_bind() fail caused by BPF_CGROUP_RUN_PROG_INET4_POST_BIND(), it will be unbinded, which means that it can try to be binded to another port. The second patch use C99 initializers in test_sock.c The third patch is the selftests for this modification. Changes since v4: - use C99 initializers in test_sock.c before adding the test case Changes since v3: - add the third patch which use C99 initializers in test_sock.c Changes since v2: - NULL check for sk->sk_prot->put_port Changes since v1: - introduce 'put_port' field for 'struct proto' - add selftests for it ==================== Signed-off-by: Alexei Starovoitov commit f7342481749365d9ac5f24fb971659a64e045bb5 Author: Menglong Dong Date: Thu Jan 6 21:20:22 2022 +0800 bpf: selftests: Add bind retry for post_bind{4, 6} With previous patch, kernel is able to 'put_port' after sys_bind() fails. Add the test for that case: rebind another port after sys_bind() fails. If the bind success, it means previous bind operation is already undoed. Signed-off-by: Menglong Dong Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220106132022.3470772-4-imagedong@tencent.com commit 6fd92c7f0c3846340fee20f62dacb17d0a15c0d3 Author: Menglong Dong Date: Thu Jan 6 21:20:21 2022 +0800 bpf: selftests: Use C99 initializers in test_sock.c Use C99 initializers for the initialization of 'tests' in test_sock.c. Signed-off-by: Menglong Dong Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220106132022.3470772-3-imagedong@tencent.com commit 91a760b26926265a60c77ddf016529bcf3e17a04 Author: Menglong Dong Date: Thu Jan 6 21:20:20 2022 +0800 net: bpf: Handle return value of BPF_CGROUP_RUN_PROG_INET{4,6}_POST_BIND() The return value of BPF_CGROUP_RUN_PROG_INET{4,6}_POST_BIND() in __inet_bind() is not handled properly. While the return value is non-zero, it will set inet_saddr and inet_rcv_saddr to 0 and exit: err = BPF_CGROUP_RUN_PROG_INET4_POST_BIND(sk); if (err) { inet->inet_saddr = inet->inet_rcv_saddr = 0; goto out_release_sock; } Let's take UDP for example and see what will happen. For UDP socket, it will be added to 'udp_prot.h.udp_table->hash' and 'udp_prot.h.udp_table->hash2' after the sk->sk_prot->get_port() called success. If 'inet->inet_rcv_saddr' is specified here, then 'sk' will be in the 'hslot2' of 'hash2' that it don't belong to (because inet_saddr is changed to 0), and UDP packet received will not be passed to this sock. If 'inet->inet_rcv_saddr' is not specified here, the sock will work fine, as it can receive packet properly, which is wired, as the 'bind()' is already failed. To undo the get_port() operation, introduce the 'put_port' field for 'struct proto'. For TCP proto, it is inet_put_port(); For UDP proto, it is udp_lib_unhash(); For icmp proto, it is ping_unhash(). Therefore, after sys_bind() fail caused by BPF_CGROUP_RUN_PROG_INET4_POST_BIND(), it will be unbinded, which means that it can try to be binded to another port. Signed-off-by: Menglong Dong Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220106132022.3470772-2-imagedong@tencent.com commit 4f6626b0e140867fd6d5a2e9d4ceaef97f10f46a Author: Moshe Shemesh Date: Sun Dec 5 11:20:59 2021 +0200 Revert "net/mlx5: Add retry mechanism to the command entry index allocation" This reverts commit 410bd754cd73c4a2ac3856d9a03d7b08f9c906bf. The reverted commit had added a retry mechanism to the command entry index allocation. The previous patch ensures that there is a free command entry index once the command work handler holds the command semaphore. Thus the retry mechanism is not needed. Fixes: 410bd754cd73 ("net/mlx5: Add retry mechanism to the command entry index allocation") Signed-off-by: Moshe Shemesh Reviewed-by: Eran Ben Elisha Signed-off-by: Saeed Mahameed commit 8e715cd613a1e872b9d918e912d90b399785761a Author: Moshe Shemesh Date: Sun Dec 5 12:07:49 2021 +0200 net/mlx5: Set command entry semaphore up once got index free Avoid a race where command work handler may fail to allocate command entry index, by holding the command semaphore down till command entry index is being freed. Fixes: 410bd754cd73 ("net/mlx5: Add retry mechanism to the command entry index allocation") Signed-off-by: Moshe Shemesh Reviewed-by: Eran Ben Elisha Signed-off-by: Saeed Mahameed commit 07f6dc4024ea1d2314b9c8b81fd4e492864fcca1 Author: Maor Dickman Date: Mon Jan 3 15:04:18 2022 +0200 net/mlx5e: Sync VXLAN udp ports during uplink representor profile change Currently during NIC profile disablement all VXLAN udp ports offloaded to the HW are flushed and during its enablement the driver send notification to the stack to inform the core that the entire UDP tunnel port state has been lost, uplink representor doesn't have the same behavior which can cause VXLAN udp ports offload to be in bad state while moving between modes while VXLAN interface exist. Fixed by aligning the uplink representor profile behavior to the NIC behavior. Fixes: 84db66124714 ("net/mlx5e: Move set vxlan nic info to profile init") Signed-off-by: Maor Dickman Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit a1c7c49c2091926962f8c1c866d386febffec5d8 Author: Shay Drory Date: Thu Dec 30 08:54:08 2021 +0200 net/mlx5: Fix access to sf_dev_table on allocation failure Even when SF devices are supported, the SF device table allocation can still fail. In such case mlx5_sf_dev_supported still reports true, but SF device table is invalid. This can result in NULL table access. Hence, fix it by adding NULL table check. Fixes: 1958fc2f0712 ("net/mlx5: SF, Add auxiliary device driver") Signed-off-by: Shay Drory Reviewed-by: Parav Pandit Signed-off-by: Saeed Mahameed commit b6dfff21a170af5c695ebaa153b7f5e297ddca03 Author: Paul Blakey Date: Wed Jun 16 10:55:56 2021 +0300 net/mlx5e: Fix matching on modified inner ip_ecn bits Tunnel device follows RFC 6040, and during decapsulation inner ip_ecn might change depending on inner and outer ip_ecn as follows: +---------+----------------------------------------+ |Arriving | Arriving Outer Header | | Inner +---------+---------+---------+----------+ | Header | Not-ECT | ECT(0) | ECT(1) | CE | +---------+---------+---------+---------+----------+ | Not-ECT | Not-ECT | Not-ECT | Not-ECT | | | ECT(0) | ECT(0) | ECT(0) | ECT(1) | CE* | | ECT(1) | ECT(1) | ECT(1) | ECT(1)* | CE* | | CE | CE | CE | CE | CE | +---------+---------+---------+---------+----------+ Cells marked above are changed from original inner packet ip_ecn value. Tc then matches on the modified inner ip_ecn, but hw offload which matches the inner ip_ecn value before decap, will fail. Fix that by mapping all the cases of outer and inner ip_ecn matching, and only supporting cases where we know inner wouldn't be changed by decap, or in the outer ip_ecn=CE case, inner ip_ecn didn't matter. Fixes: bcef735c59f2 ("net/mlx5e: Offload TC matching on tos/ttl for ip tunnels") Signed-off-by: Paul Blakey Reviewed-by: Oz Shlomo Reviewed-by: Eli Cohen Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 01c3fd113ef50490ffd43f78f347ef6bb008510b Author: Aya Levin Date: Sun Oct 24 16:52:23 2021 +0300 Revert "net/mlx5e: Block offload of outer header csum for GRE tunnel" This reverts commit 54e1217b90486c94b26f24dcee1ee5ef5372f832. Although the NIC doesn't support offload of outer header CSUM, using gso_partial_features allows offloading the tunnel's segmentation. The driver relies on the stack CSUM calculation of the outer header. For this, NETIF_F_GSO_GRE_CSUM must be a member of the device's features. Fixes: 54e1217b9048 ("net/mlx5e: Block offload of outer header csum for GRE tunnel") Signed-off-by: Aya Levin Reviewed-by: Gal Pressman Signed-off-by: Saeed Mahameed commit 64050cdad0983ad8060e33c3f4b5aee2366bcebd Author: Aya Levin Date: Sun Oct 24 11:47:41 2021 +0300 Revert "net/mlx5e: Block offload of outer header csum for UDP tunnels" This reverts commit 6d6727dddc7f93fcc155cb8d0c49c29ae0e71122. Although the NIC doesn't support offload of outer header CSUM, using gso_partial_features allows offloading the tunnel's segmentation. The driver relies on the stack CSUM calculation of the outer header. For this, NETIF_F_GSO_UDP_TUNNEL_CSUM must be a member of the device's features. Fixes: 6d6727dddc7f ("net/mlx5e: Block offload of outer header csum for UDP tunnels") Signed-off-by: Aya Levin Reviewed-by: Gal Pressman Signed-off-by: Saeed Mahameed commit 9e72a55a3c9d54b38a704bb7292d984574a81d9d Author: Maor Dickman Date: Thu Dec 30 11:20:10 2021 +0200 net/mlx5e: Don't block routes with nexthop objects in SW Routes with nexthop objects is currently not supported by multipath offload and any attempts to use it is blocked, however this also block adding SW routes with nexthop. Resolve this by returning NOTIFY_DONE instead of an error which will allow such a route to be created in SW but not offloaded. This fix also solve an issue which block adding such routes on different devices due to missing check if the route FIB device is one of multipath devices. Fixes: 6a87afc072c3 ("mlx5: Fail attempts to use routes with nexthop objects") Signed-off-by: Maor Dickman Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 885751eb1b01d276e38f57d78c583e4ce006c5ed Author: Maor Dickman Date: Wed Dec 29 16:10:41 2021 +0200 net/mlx5e: Fix wrong usage of fib_info_nh when routes with nexthop objects are used Creating routes with nexthop objects while in switchdev mode leads to access to un-allocated memory and trigger bellow call trace due to hitting WARN_ON. This is caused due to illegal usage of fib_info_nh in TC tunnel FIB event handling to resolve the FIB device while fib_info built in with nexthop. Fixed by ignoring attempts to use nexthop objects with routes until support can be properly added. WARNING: CPU: 1 PID: 1724 at include/net/nexthop.h:468 mlx5e_tc_tun_fib_event+0x448/0x570 [mlx5_core] CPU: 1 PID: 1724 Comm: ip Not tainted 5.15.0_for_upstream_min_debug_2021_11_09_02_04 #1 RIP: 0010:mlx5e_tc_tun_fib_event+0x448/0x570 [mlx5_core] RSP: 0018:ffff8881349f7910 EFLAGS: 00010202 RAX: ffff8881492f1980 RBX: ffff8881349f79e8 RCX: 0000000000000000 RDX: ffff8881349f79e8 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffff8881349f7950 R08: 00000000000000fe R09: 0000000000000001 R10: 0000000000000000 R11: 0000000000000000 R12: ffff88811e9d0000 R13: ffff88810eb62000 R14: ffff888106710268 R15: 0000000000000018 FS: 00007f1d5ca6e800(0000) GS:ffff88852c880000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ffedba44ff8 CR3: 0000000129808004 CR4: 0000000000370ea0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: atomic_notifier_call_chain+0x42/0x60 call_fib_notifiers+0x21/0x40 fib_table_insert+0x479/0x6d0 ? try_charge_memcg+0x480/0x6d0 inet_rtm_newroute+0x65/0xb0 rtnetlink_rcv_msg+0x2af/0x360 ? page_add_file_rmap+0x13/0x130 ? do_set_pte+0xcd/0x120 ? rtnl_calcit.isra.0+0x120/0x120 netlink_rcv_skb+0x4e/0xf0 netlink_unicast+0x1ee/0x2b0 netlink_sendmsg+0x22e/0x460 sock_sendmsg+0x33/0x40 ____sys_sendmsg+0x1d1/0x1f0 ___sys_sendmsg+0xab/0xf0 ? __mod_memcg_lruvec_state+0x40/0x60 ? __mod_lruvec_page_state+0x95/0xd0 ? page_add_new_anon_rmap+0x4e/0xf0 ? __handle_mm_fault+0xec6/0x1470 __sys_sendmsg+0x51/0x90 ? internal_get_user_pages_fast+0x480/0xa10 do_syscall_64+0x3d/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae Fixes: 8914add2c9e5 ("net/mlx5e: Handle FIB events to update tunnel endpoint device") Signed-off-by: Maor Dickman Reviewed-by: Vlad Buslov Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit de31854ece175e12ff3c35d07f340988823aed34 Author: Dima Chumak Date: Wed Nov 24 09:37:26 2021 +0200 net/mlx5e: Fix nullptr on deleting mirroring rule Deleting a Tc rule with multiple outputs, one of which is internal port, like this one: tc filter del dev enp8s0f0_0 ingress protocol ip pref 5 flower \ dst_mac 0c:42:a1:d1:d0:88 \ src_mac e4:ea:09:08:00:02 \ action tunnel_key set \ src_ip 0.0.0.0 \ dst_ip 7.7.7.8 \ id 8 \ dst_port 4789 \ action mirred egress mirror dev vxlan_sys_4789 pipe \ action mirred egress redirect dev enp8s0f0_1 Triggers a call trace: BUG: kernel NULL pointer dereference, address: 0000000000000230 RIP: 0010:del_sw_hw_rule+0x2b/0x1f0 [mlx5_core] Call Trace: tree_remove_node+0x16/0x30 [mlx5_core] mlx5_del_flow_rules+0x51/0x160 [mlx5_core] __mlx5_eswitch_del_rule+0x4b/0x170 [mlx5_core] mlx5e_tc_del_fdb_flow+0x295/0x550 [mlx5_core] mlx5e_flow_put+0x1f/0x70 [mlx5_core] mlx5e_delete_flower+0x286/0x390 [mlx5_core] tc_setup_cb_destroy+0xac/0x170 fl_hw_destroy_filter+0x94/0xc0 [cls_flower] __fl_delete+0x15e/0x170 [cls_flower] fl_delete+0x36/0x80 [cls_flower] tc_del_tfilter+0x3a6/0x6e0 rtnetlink_rcv_msg+0xe5/0x360 ? rtnl_calcit.isra.0+0x110/0x110 netlink_rcv_skb+0x46/0x110 netlink_unicast+0x16b/0x200 netlink_sendmsg+0x202/0x3d0 sock_sendmsg+0x33/0x40 ____sys_sendmsg+0x1c3/0x200 ? copy_msghdr_from_user+0xd6/0x150 ___sys_sendmsg+0x88/0xd0 ? ___sys_recvmsg+0x88/0xc0 ? do_futex+0x10c/0x460 __sys_sendmsg+0x59/0xa0 do_syscall_64+0x48/0x140 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Fix by disabling offloading for flows matching esw_is_chain_src_port_rewrite() which have more than one output. Fixes: 10742efc20a4 ("net/mlx5e: VF tunnel TX traffic offloading") Signed-off-by: Dima Chumak Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 0b7cfa4082fbf550595bc0e40f05614bd83bf0cd Author: Aya Levin Date: Thu Dec 23 14:38:28 2021 +0200 net/mlx5e: Fix page DMA map/unmap attributes Driver initiates DMA sync, hence it may skip CPU sync. Add DMA_ATTR_SKIP_CPU_SYNC as input attribute both to dma_map_page and dma_unmap_page to avoid redundant sync with the CPU. When forcing the device to work with SWIOTLB, the extra sync might cause data corruption. The driver unmaps the whole page while the hardware used just a part of the bounce buffer. So syncing overrides the entire page with bounce buffer that only partially contains real data. Fixes: bc77b240b3c5 ("net/mlx5e: Add fragmented memory support for RX multi packet WQE") Fixes: db05815b36cb ("net/mlx5e: Add XSK zero-copy support") Signed-off-by: Aya Levin Reviewed-by: Gal Pressman Signed-off-by: Saeed Mahameed commit 6968e707d371ef80511448c6771daf445b4a5cf5 Author: Bart Van Assche Date: Thu Jan 6 09:29:00 2022 -0800 parisc: io: Improve the outb(), outw() and outl() macros This patch fixes the following build error for source file drivers/scsi/pcmcia/sym53c500_cs.c: In file included from ./include/linux/bug.h:5, from ./include/linux/cpumask.h:14, from ./include/linux/mm_types_task.h:14, from ./include/linux/mm_types.h:5, from ./include/linux/buildid.h:5, from ./include/linux/module.h:14, from drivers/scsi/pcmcia/sym53c500_cs.c:42: drivers/scsi/pcmcia/sym53c500_cs.c: In function ‘SYM53C500_intr’: ./arch/parisc/include/asm/bug.h:28:2: error: expected expression before ‘do’ 28 | do { \ | ^~ ./arch/parisc/include/asm/io.h:276:20: note: in expansion of macro ‘BUG’ 276 | #define outb(x, y) BUG() | ^~~ drivers/scsi/pcmcia/sym53c500_cs.c:124:19: note: in expansion of macro ‘outb’ 124 | #define REG0(x) (outb(C4_IMG, (x) + CONFIG4)) | ^~~~ drivers/scsi/pcmcia/sym53c500_cs.c:362:2: note: in expansion of macro ‘REG0’ 362 | REG0(port_base); | ^~~~ Cc: James E.J. Bottomley Cc: Helge Deller Cc: Geert Uytterhoeven Cc: linux-parisc@vger.kernel.org Signed-off-by: Bart Van Assche Signed-off-by: Helge Deller commit 75c09aad79e4686367cbadb7dfe69c59d1537902 Author: Greg Kroah-Hartman Date: Thu Jan 6 10:51:17 2022 +0100 parisc: pdc_stable: use default_groups in kobj_type There are currently 2 ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the parisc pdc_stable sysfs code to use default_groups field which has been the preferred way since aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field. Cc: "James E.J. Bottomley" Cc: Helge Deller Cc: linux-parisc@vger.kernel.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Helge Deller commit c1c72d9bbf2bf91670ac589adf037f433642fff5 Author: Helge Deller Date: Wed Jan 5 22:44:12 2022 +0100 parisc: Add kgdb io_module to read chars via PDC Add a simplistic keyboard driver for usage of PDC I/O functions with kgdb. This driver makes it possible to use KGDB with QEMU. Signed-off-by: Helge Deller commit 712a270d2db967b387338c26c3dc04ccac3fcec3 Author: Helge Deller Date: Wed Jan 5 22:38:10 2022 +0100 parisc: Fix pdc_toc_pim_11 and pdc_toc_pim_20 definitions The definitions for pdc_toc_pim_11 and pdc_toc_pim_20 are wrong since they include an entry for a hversion field which doesn't exist in the specification. Fix this and clean up some whitespaces so that the whole file will be in sync with it's copy in the SeaBIOS-hppa sources. Signed-off-by: Helge Deller Cc: stable@vger.kernel.org # v5.16 commit 72c3dd8207de4178ae50553666129af7231f86e7 Author: John David Anglin Date: Tue Jan 4 21:48:11 2022 +0000 parisc: Add lws_atomic_xchg and lws_atomic_store syscalls This patch adds two new LWS routines - lws_atomic_xchg and lws_atomic_store. These are simpler than the CAS routines. Currently, we use the CAS routines for atomic stores. This is inefficient since it requires both winning the spinlock and a successful CAS operation. Change has been tested on c8000 and rp3440. In v2, I moved the code to disble/enable page faults inside the spinlocks. Signed-off-by: John David Anglin Signed-off-by: Helge Deller commit d0585d742ff2d82accd26c661c60a6d260429c4a Author: John David Anglin Date: Tue Jan 4 21:44:32 2022 +0000 parisc: Rewrite light-weight syscall and futex code The parisc architecture lacks general hardware support for compare and swap. Particularly for userspace, it is difficult to implement software atomic support. Page faults in critical regions can cause processes to sleep and block the forward progress of other processes. Thus, it is essential that page faults be disabled in critical regions. For performance reasons, we also need to disable external interrupts in critical regions. In order to do this, we need a mechanism to trigger COW breaks outside the critical region. Fortunately, parisc has the "stbys,e" instruction. When the leftmost byte of a word is addressed, this instruction triggers all the exceptions of a normal store but it does not write to memory. Thus, we can use it to trigger COW breaks outside the critical region without modifying the data that is to be updated atomically. COW breaks occur randomly. So even if we have priviously executed a "stbys,e" instruction, we still need to disable pagefaults around the critical region. If a fault occurs in the critical region, we return -EAGAIN. I had to add a wrapper around _arch_futex_atomic_op_inuser() as I found in testing that returning -EAGAIN caused problems for some processes even though it is listed as a possible return value. The patch implements the above. The code no longer attempts to sleep with interrupts disabled and I haven't seen any stalls with the change. I have attempted to merge common code and streamline the fast path. In the futex code, we only compute the spinlock address once. I eliminated some debug code in the original CAS routine that just made the flow more complicated. I don't clip the arguments when called from wide mode. As a result, the LWS routines should work when called from 64-bit processes. I defined TASK_PAGEFAULT_DISABLED offset for use in the lws_pagefault_disable and lws_pagefault_enable macros. Since we now disable interrupts on the gateway page where necessary, it might be possible to allow processes to be scheduled when they are on the gateway page. Change has been tested on c8000 and rp3440. It improves glibc build and test time by about 10%. In v2, I removed the lws_atomic_xchg and and lws_atomic_store calls. I also removed the bug fixes that were not directly related to this patch. In v3, I removed the code to force interruptions from arch_futex_atomic_op_inuser(). It is always called with page faults disabled, so this code had no effect. In v4, I fixed a typo in depi_safe line. In v5, I moved the code to disable/enable page faults inside the spinlocks. Signed-off-by: John David Anglin Signed-off-by: Helge Deller commit 20dda87bdc6567e864942ead40bc149ebbe3ae79 Author: John David Anglin Date: Tue Jan 4 21:40:02 2022 +0000 parisc: Enhance page fault termination message In debugging kernel panics, I believe it is useful to know what type of page fault caused the termination. "Bad Address" is too vague. Signed-off-by: John David Anglin Signed-off-by: Helge Deller commit 9d90a90855ceb9ce0fb9b46b0591ac211e4b4612 Author: John David Anglin Date: Tue Jan 4 21:34:26 2022 +0000 parisc: Don't call faulthandler_disabled() in do_page_fault() It is dangerous to call faulthandler_disabled() when user_mode(regs) is true. The task pagefault_disabled counter is racy and it is not updated atomically on parisc. As a result, calling faulthandler_disabled() may cause erroneous termination. We now handle execption fixups and termination when user_mode(regs) is false in handle_interruption(). Thus, we can just remove the faulthandler_disabled() check from do_page_fault(). Signed-off-by: John David Anglin Signed-off-by: Helge Deller commit 4b9d2a731c3d22a05c1bccdb11b6e00054ff5fda Author: Helge Deller Date: Thu Dec 23 21:46:35 2021 +0100 parisc: Switch user access functions to signal errors in r29 instead of r8 Use register r29 instead of register r8 to signal faults when accessing user memory. In case of faults, the fixup routine will store -EFAULT in this register. This change saves up to 752 bytes on a 32bit kernel, partly because the compiler doesn't need to save and restore the old r8 value on the stack. bloat-o-meter results for usage with r29 register: add/remove: 0/0 grow/shrink: 23/86 up/down: 228/-980 (-752) bloat-o-meter results for usage with r28 register: add/remove: 0/0 grow/shrink: 28/83 up/down: 296/-956 (-660) Signed-off-by: Helge Deller commit 9e9d4b460f23bab61672eae397417d03917d116c Author: John David Anglin Date: Wed Dec 22 16:52:26 2021 +0000 parisc: Avoid calling faulthandler_disabled() twice In handle_interruption(), we call faulthandler_disabled() to check whether the fault handler is not disabled. If the fault handler is disabled, we immediately call do_page_fault(). It then calls faulthandler_disabled(). If disabled, do_page_fault() attempts to fixup the exception by jumping to no_context: no_context: if (!user_mode(regs) && fixup_exception(regs)) { return; } parisc_terminate("Bad Address (null pointer deref?)", regs, code, address); Apart from the error messages, the two blocks of code perform the same function. We can avoid two calls to faulthandler_disabled() by a simple revision to the code in handle_interruption(). Note: I didn't try to fix the formatting of this code block. Signed-off-by: John David Anglin Signed-off-by: Helge Deller commit db19c6f1a2a353cc8dec35b4789733a3cf6e2838 Author: John David Anglin Date: Wed Dec 22 16:01:31 2021 +0000 parisc: Fix lpa and lpa_user defines While working on the rewrite to the light-weight syscall and futex code, I experimented with using a hash index based on the user physical address of atomic variable. This exposed two problems with the lpa and lpa_user defines. Because of the copy instruction, the pa argument needs to be an early clobber argument. This prevents gcc from allocating the va and pa arguments to the same register. Secondly, the lpa instruction can cause a page fault so we need to catch exceptions. Signed-off-by: John David Anglin Fixes: 116d753308cf ("parisc: Use lpa instruction to load physical addresses in driver code") Signed-off-by: Helge Deller Cc: stable@vger.kernel.org # v5.2+ commit 45458aa49abe3b0ac68ce86b3d4ca3a97eaeac53 Author: John David Anglin Date: Tue Dec 21 15:04:53 2021 -0500 parisc: Define depi_safe macro The depi instruction is similar to the extru instruction on 64-bit machines. It leaves the most-significant 32 bits of the target register in an undefined state. On 64-bit machines, the macro uses depdi to perform safe deposits in the least-significant 32 bits. Signed-off-by: John David Anglin Signed-off-by: Helge Deller commit 745a13061aa079b36d83ba7f36dc051dbfccd888 Author: Saeed Mahameed Date: Thu Jan 6 15:07:07 2022 -0800 Documentation: devlink: mlx5.rst: Fix htmldoc build warning Fix the following build warning: Documentation/networking/devlink/mlx5.rst:13: WARNING: Error parsing content block for the "list-table" directive: +uniform two-level bullet list expected, but row 2 does not contain the same number of items as row 1 (2 vs 3). ... Add the missing item in the first row. Fixes: 0844fa5f7b89 ("net/mlx5: Let user configure io_eq_size param") Reported-by: Stephen Rothwell Signed-off-by: Saeed Mahameed commit 5dd29f40b25f91f1b65043f2225b843a8d0cb1df Author: Gal Pressman Date: Wed Dec 22 14:03:39 2021 +0200 net/mlx5e: Add recovery flow in case of error CQE The rep legacy RQ completion handling was missing the appropriate handling of error CQEs (dump the CQE and queue a recover work), fix it by calling trigger_report() when needed. Since all CQE handling flows do the exact same error CQE handling, extract it to a common helper function. Signed-off-by: Gal Pressman Reviewed-by: Aya Levin Signed-off-by: Saeed Mahameed commit 68511b48bfbe8ebce9c1a55f2ea656b0144f046c Author: Roi Dayan Date: Mon Jan 3 10:57:01 2022 +0200 net/mlx5e: TC, Remove redundant error logging Remove redundant and trivial error logging when trying to offload mirred device with unsupported devices. Using OVS could hit those a lot and the errors are still logged in extack. Signed-off-by: Roi Dayan Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed commit be23511eb5c460db42bb29c2c208667a27163b10 Author: Saeed Mahameed Date: Tue Sep 14 23:26:17 2021 -0700 net/mlx5e: Refactor set_pflag_cqe_based_moder Rearrange the code and use cqe_mode_to_period_mode() helper. Signed-off-by: Saeed Mahameed commit b5f42903704f868fcb45f78d6f782958b282d382 Author: Gal Pressman Date: Mon Nov 29 10:57:31 2021 +0200 net/mlx5e: Move HW-GRO and CQE compression check to fix features flow Feature dependencies should be resolved in fix features rather than in set features flow. Move the check that disables HW-GRO in case CQE compression is enabled from set_feature_hw_gro() to mlx5e_fix_features(). Signed-off-by: Gal Pressman Signed-off-by: Saeed Mahameed commit bc2a7b5c6b379d0f6e685b29fe04d2f7310c693d Author: Aya Levin Date: Tue Dec 21 15:16:32 2021 +0200 net/mlx5e: Fix feature check per profile Remove redundant space when constructing the feature's enum. Validate against the indented enum value. Fixes: 6c72cb05d4b8 ("net/mlx5e: Use bitmap field for profile features") Signed-off-by: Aya Levin Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 7846665d3504812acaebf920d1141851379a7f37 Author: Maor Dickman Date: Thu Dec 9 14:03:01 2021 +0200 net/mlx5e: Unblock setting vid 0 for VF in case PF isn't eswitch manager When using libvirt to passthrough VF to VM it will always set the VF vlan to 0 even if user didn’t request it, this will cause libvirt to fail to boot in case the PF isn't eswitch owner. Example of such case is the DPU host PF which isn't eswitch manager, so any attempt to passthrough VF of it using libvirt will fail. Fix it by not returning error in case set VF vlan is called with vid 0. Signed-off-by: Maor Dickman Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 0a1498ebfa55b860e8ec929d73585bcd3fd81a4e Author: Lama Kayal Date: Mon Sep 13 16:06:35 2021 +0300 net/mlx5e: Expose FEC counters via ethtool Add FEC counters' statistics of corrected_blocks and uncorrectable_blocks, along with their lanes via ethtool. HW supports corrected_blocks and uncorrectable_blocks counters both for RS-FEC mode and FC-FEC mode. In FC mode these counters are accumulated per lane, while in RS mode the correction method crosses lanes, thus only total corrected_blocks and uncorrectable_blocks are reported in this mode. Signed-off-by: Lama Kayal Reviewed-by: Gal Pressman Signed-off-by: Saeed Mahameed commit f79a609ea6bf54ad2d2c24e4de4524288b221666 Author: Maher Sanalla Date: Wed Jan 5 14:50:11 2022 +0200 net/mlx5: Update log_max_qp value to FW max capability log_max_qp in driver's default profile #2 was set to 18, but FW actually supports 17 at the most - a situation that led to the concerning print when the driver is loaded: "log_max_qp value in current profile is 18, changing to HCA capabaility limit (17)" The expected behavior from mlx5_profile #2 is to match the maximum FW capability in regards to log_max_qp. Thus, log_max_qp in profile #2 is initialized to a defined static value (0xff) - which basically means that when loading this profile, log_max_qp value will be what the currently installed FW supports at most. Signed-off-by: Maher Sanalla Reviewed-by: Maor Gottlieb Signed-off-by: Saeed Mahameed commit 061f5b23588a2b2a499643c8c798dcdb271bc059 Author: Shay Drory Date: Tue Nov 23 12:50:19 2021 +0200 net/mlx5: SF, Use all available cpu for setting cpu affinity Currently all SFs are using the same CPUs. Spreading SF over CPUs, in round-robin manner, in order to achieve better distribution of the SFs over available CPUs. Signed-off-by: Shay Drory Reviewed-by: Moshe Shemesh Reviewed-by: Parav Pandit Signed-off-by: Saeed Mahameed commit 79b60ca83b6fa63ef307d2edcc77ee6581da8971 Author: Shay Drory Date: Sun Dec 12 14:51:27 2021 +0200 net/mlx5: Introduce API for bulk request and release of IRQs Currently IRQs are requested one by one. To balance spreading IRQs among cpus using such scheme requires remembering cpu mask for the cpus used for a given device. This complicates the IRQ allocation scheme in subsequent patch. Hence, prepare the code for bulk IRQs allocation. This enables spreading IRQs among cpus in subsequent patch. Signed-off-by: Shay Drory Reviewed-by: Parav Pandit Signed-off-by: Saeed Mahameed commit 424544df97b0197b1d87d2fd1c18c6b936aa02b1 Author: Shay Drory Date: Tue Nov 23 10:48:07 2021 +0200 net/mlx5: Split irq_pool_affinity logic to new file The downstream patches add more functionality to irq_pool_affinity. Move the irq_pool_affinity logic to a new file in order to ease the coding and maintenance of it. Signed-off-by: Shay Drory Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed commit 30c6afa735db60b4fb6ca81da568d11d19aa2c15 Author: Shay Drory Date: Tue Nov 23 09:14:58 2021 +0200 net/mlx5: Move affinity assignment into irq_request Move affinity binding of the IRQ to irq_request function in order to bind the IRQ before inserting it to the xarray. After this change, the IRQ is ready for use when inserted to the xarray. Signed-off-by: Shay Drory Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed commit 5256a46bf53872d9888c0d9c34382262b3006599 Author: Shay Drory Date: Sun Nov 14 13:01:21 2021 +0200 net/mlx5: Introduce control IRQ request API Currently, IRQ layer have a separate flow for ctrl and comp IRQs, and the distinction between ctrl and comp IRQs is done in the IRQ layer. In order to ease the coding and maintenance of the IRQ layer, introduce a new API for requesting control IRQs - mlx5_ctrl_irq_request(struct mlx5_core_dev *dev). Signed-off-by: Shay Drory Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed commit 20f80ffcedfaaa3d15acccd5b622ebb769ac759b Author: Saeed Mahameed Date: Thu Dec 23 11:28:09 2021 -0800 net/mlx5: mlx5e_hv_vhca_stats_create return type to void Callers of this functions ignore its return value, as reported by Wang Qing, in one of the return paths, it returns positive values. Since return value is ignored anyways, void out the return type of the function. Reported-by: Wang Qing Signed-off-by: Saeed Mahameed commit 6c8e11e08a5b74bb8a5cdd5cbc1e5143df0fba72 Author: Jann Horn Date: Mon Jan 3 16:59:31 2022 +0100 random: don't reset crng_init_cnt on urandom_read() At the moment, urandom_read() (used for /dev/urandom) resets crng_init_cnt to zero when it is called at crng_init<2. This is inconsistent: We do it for /dev/urandom reads, but not for the equivalent getrandom(GRND_INSECURE). (And worse, as Jason pointed out, we're only doing this as long as maxwarn>0.) crng_init_cnt is only read in crng_fast_load(); it is relevant at crng_init==0 for determining when to switch to crng_init==1 (and where in the RNG state array to write). As far as I understand: - crng_init==0 means "we have nothing, we might just be returning the same exact numbers on every boot on every machine, we don't even have non-cryptographic randomness; we should shove every bit of entropy we can get into the RNG immediately" - crng_init==1 means "well we have something, it might not be cryptographic, but at least we're not gonna return the same data every time or whatever, it's probably good enough for TCP and ASLR and stuff; we now have time to build up actual cryptographic entropy in the input pool" - crng_init==2 means "this is supposed to be cryptographically secure now, but we'll keep adding more entropy just to be sure". The current code means that if someone is pulling data from /dev/urandom fast enough at crng_init==0, we'll keep resetting crng_init_cnt, and we'll never make forward progress to crng_init==1. It seems to be intended to prevent an attacker from bruteforcing the contents of small individual RNG inputs on the way from crng_init==0 to crng_init==1, but that's misguided; crng_init==1 isn't supposed to provide proper cryptographic security anyway, RNG users who care about getting secure RNG output have to wait until crng_init==2. This code was inconsistent, and it probably made things worse - just get rid of it. Signed-off-by: Jann Horn Signed-off-by: Jason A. Donenfeld commit 2ee25b6968b1b3c66ffa408de23d023c1bce81cf Author: Jason A. Donenfeld Date: Thu Dec 30 17:50:52 2021 +0100 random: avoid superfluous call to RDRAND in CRNG extraction RDRAND is not fast. RDRAND is actually quite slow. We've known this for a while, which is why functions like get_random_u{32,64} were converted to use batching of our ChaCha-based CRNG instead. Yet CRNG extraction still includes a call to RDRAND, in the hot path of every call to get_random_bytes(), /dev/urandom, and getrandom(2). This call to RDRAND here seems quite superfluous. CRNG is already extracting things based on a 256-bit key, based on good entropy, which is then reseeded periodically, updated, backtrack-mutated, and so forth. The CRNG extraction construction is something that we're already relying on to be secure and solid. If it's not, that's a serious problem, and it's unlikely that mixing in a measly 32 bits from RDRAND is going to alleviate things. And in the case where the CRNG doesn't have enough entropy yet, we're already initializing the ChaCha key row with RDRAND in crng_init_try_arch_early(). Removing the call to RDRAND improves performance on an i7-11850H by 370%. In other words, the vast majority of the work done by extract_crng() prior to this commit was devoted to fetching 32 bits of RDRAND. Reviewed-by: Theodore Ts'o Acked-by: Ard Biesheuvel Signed-off-by: Jason A. Donenfeld commit 96562f286884e2db89c74215b199a1084b5fb7f7 Author: Dominik Brodowski Date: Fri Dec 31 09:26:08 2021 +0100 random: early initialization of ChaCha constants Previously, the ChaCha constants for the primary pool were only initialized in crng_initialize_primary(), called by rand_initialize(). However, some randomness is actually extracted from the primary pool beforehand, e.g. by kmem_cache_create(). Therefore, statically initialize the ChaCha constants for the primary pool. Cc: Herbert Xu Cc: "David S. Miller" Cc: Signed-off-by: Dominik Brodowski Signed-off-by: Jason A. Donenfeld commit 7b87324112df2e1f9b395217361626362dcfb9fb Author: Jason A. Donenfeld Date: Thu Dec 30 15:59:26 2021 +0100 random: use IS_ENABLED(CONFIG_NUMA) instead of ifdefs Rather than an awkward combination of ifdefs and __maybe_unused, we can ensure more source gets parsed, regardless of the configuration, by using IS_ENABLED for the CONFIG_NUMA conditional code. This makes things cleaner and easier to follow. I've confirmed that on !CONFIG_NUMA, we don't wind up with excess code by accident; the generated object file is the same. Reviewed-by: Dominik Brodowski Signed-off-by: Jason A. Donenfeld commit 161212c7fd1d9069b232785c75492e50941e2ea8 Author: Dominik Brodowski Date: Wed Dec 29 22:10:07 2021 +0100 random: harmonize "crng init done" messages We print out "crng init done" for !TRUST_CPU, so we should also print out the same for TRUST_CPU. Signed-off-by: Dominik Brodowski Signed-off-by: Jason A. Donenfeld commit 57826feeedb63b091f807ba8325d736775d39afd Author: Jason A. Donenfeld Date: Wed Dec 29 22:10:06 2021 +0100 random: mix bootloader randomness into pool If we're trusting bootloader randomness, crng_fast_load() is called by add_hwgenerator_randomness(), which sets us to crng_init==1. However, usually it is only called once for an initial 64-byte push, so bootloader entropy will not mix any bytes into the input pool. So it's conceivable that crng_init==1 when crng_initialize_primary() is called later, but then the input pool is empty. When that happens, the crng state key will be overwritten with extracted output from the empty input pool. That's bad. In contrast, if we're not trusting bootloader randomness, we call crng_slow_load() *and* we call mix_pool_bytes(), so that later crng_initialize_primary() isn't drawing on nothing. In order to prevent crng_initialize_primary() from extracting an empty pool, have the trusted bootloader case mirror that of the untrusted bootloader case, mixing the input into the pool. [linux@dominikbrodowski.net: rewrite commit message] Signed-off-by: Dominik Brodowski Signed-off-by: Jason A. Donenfeld commit 73c7733f122e8d0107f88655a12011f68f69e74b Author: Jason A. Donenfeld Date: Wed Dec 29 22:10:05 2021 +0100 random: do not throw away excess input to crng_fast_load When crng_fast_load() is called by add_hwgenerator_randomness(), we currently will advance to crng_init==1 once we've acquired 64 bytes, and then throw away the rest of the buffer. Usually, that is not a problem: When add_hwgenerator_randomness() gets called via EFI or DT during setup_arch(), there won't be any IRQ randomness. Therefore, the 64 bytes passed by EFI exactly matches what is needed to advance to crng_init==1. Usually, DT seems to pass 64 bytes as well -- with one notable exception being kexec, which hands over 128 bytes of entropy to the kexec'd kernel. In that case, we'll advance to crng_init==1 once 64 of those bytes are consumed by crng_fast_load(), but won't continue onward feeding in bytes to progress to crng_init==2. This commit fixes the issue by feeding any leftover bytes into the next phase in add_hwgenerator_randomness(). [linux@dominikbrodowski.net: rewrite commit message] Signed-off-by: Dominik Brodowski Signed-off-by: Jason A. Donenfeld commit 9c3ddde3f811aabbb83778a2a615bf141b4909ef Author: Jason A. Donenfeld Date: Wed Dec 29 22:10:04 2021 +0100 random: do not re-init if crng_reseed completes before primary init If the bootloader supplies sufficient material and crng_reseed() is called very early on, but not too early that wqs aren't available yet, then we might transition to crng_init==2 before rand_initialize()'s call to crng_initialize_primary() made. Then, when crng_initialize_primary() is called, if we're trusting the CPU's RDRAND instructions, we'll needlessly reinitialize the RNG and emit a message about it. This is mostly harmless, as numa_crng_init() will allocate and then free what it just allocated, and excessive calls to invalidate_batched_entropy() aren't so harmful. But it is funky and the extra message is confusing, so avoid the re-initialization all together by checking for crng_init < 2 in crng_initialize_primary(), just as we already do in crng_reseed(). Reviewed-by: Dominik Brodowski Signed-off-by: Jason A. Donenfeld commit f7e67b8e803185d0aabe7f29d25a35c8be724a78 Author: Dominik Brodowski Date: Wed Dec 29 22:10:03 2021 +0100 random: fix crash on multiple early calls to add_bootloader_randomness() Currently, if CONFIG_RANDOM_TRUST_BOOTLOADER is enabled, multiple calls to add_bootloader_randomness() are broken and can cause a NULL pointer dereference, as noted by Ivan T. Ivanov. This is not only a hypothetical problem, as qemu on arm64 may provide bootloader entropy via EFI and via devicetree. On the first call to add_hwgenerator_randomness(), crng_fast_load() is executed, and if the seed is long enough, crng_init will be set to 1. On subsequent calls to add_bootloader_randomness() and then to add_hwgenerator_randomness(), crng_fast_load() will be skipped. Instead, wait_event_interruptible() and then credit_entropy_bits() will be called. If the entropy count for that second seed is large enough, that proceeds to crng_reseed(). However, both wait_event_interruptible() and crng_reseed() depends (at least in numa_crng_init()) on workqueues. Therefore, test whether system_wq is already initialized, which is a sufficient indicator that workqueue_init_early() has progressed far enough. If we wind up hitting the !system_wq case, we later want to do what would have been done there when wqs are up, so set a flag, and do that work later from the rand_initialize() call. Reported-by: Ivan T. Ivanov Fixes: 18b915ac6b0a ("efi/random: Treat EFI_RNG_PROTOCOL output as bootloader randomness") Cc: stable@vger.kernel.org Signed-off-by: Dominik Brodowski [Jason: added crng_need_done state and related logic.] Signed-off-by: Jason A. Donenfeld commit 0d9488ffbf2faddebc6bac055bfa6c93b94056a3 Author: Jason A. Donenfeld Date: Fri Dec 24 19:17:58 2021 +0100 random: do not sign extend bytes for rotation when mixing By using `char` instead of `unsigned char`, certain platforms will sign extend the byte when `w = rol32(*bytes++, input_rotate)` is called, meaning that bit 7 is overrepresented when mixing. This isn't a real problem (unless the mixer itself is already broken) since it's still invertible, but it's not quite correct either. Fix this by using an explicit unsigned type. Signed-off-by: Jason A. Donenfeld commit 9f9eff85a008b095eafc5f4ecbaf5aca689271c1 Author: Jason A. Donenfeld Date: Tue Dec 21 16:31:27 2021 +0100 random: use BLAKE2s instead of SHA1 in extraction This commit addresses one of the lower hanging fruits of the RNG: its usage of SHA1. BLAKE2s is generally faster, and certainly more secure, than SHA1, which has [1] been [2] really [3] very [4] broken [5]. Additionally, the current construction in the RNG doesn't use the full SHA1 function, as specified, and allows overwriting the IV with RDRAND output in an undocumented way, even in the case when RDRAND isn't set to "trusted", which means potential malicious IV choices. And its short length means that keeping only half of it secret when feeding back into the mixer gives us only 2^80 bits of forward secrecy. In other words, not only is the choice of hash function dated, but the use of it isn't really great either. This commit aims to fix both of these issues while also keeping the general structure and semantics as close to the original as possible. Specifically: a) Rather than overwriting the hash IV with RDRAND, we put it into BLAKE2's documented "salt" and "personal" fields, which were specifically created for this type of usage. b) Since this function feeds the full hash result back into the entropy collector, we only return from it half the length of the hash, just as it was done before. This increases the construction's forward secrecy from 2^80 to a much more comfortable 2^128. c) Rather than using the raw "sha1_transform" function alone, we instead use the full proper BLAKE2s function, with finalization. This also has the advantage of supplying 16 bytes at a time rather than SHA1's 10 bytes, which, in addition to having a faster compression function to begin with, means faster extraction in general. On an Intel i7-11850H, this commit makes initial seeding around 131% faster. BLAKE2s itself has the nice property of internally being based on the ChaCha permutation, which the RNG is already using for expansion, so there shouldn't be any issue with newness, funkiness, or surprising CPU behavior, since it's based on something already in use. [1] https://eprint.iacr.org/2005/010.pdf [2] https://www.iacr.org/archive/crypto2005/36210017/36210017.pdf [3] https://eprint.iacr.org/2015/967.pdf [4] https://shattered.io/static/shattered.pdf [5] https://www.usenix.org/system/files/sec20-leurent.pdf Reviewed-by: Theodore Ts'o Reviewed-by: Eric Biggers Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jean-Philippe Aumasson Signed-off-by: Jason A. Donenfeld commit 6048fdcc5f269c7f31d774c295ce59081b36e6f9 Author: Jason A. Donenfeld Date: Wed Dec 22 14:56:58 2021 +0100 lib/crypto: blake2s: include as built-in In preparation for using blake2s in the RNG, we change the way that it is wired-in to the build system. Instead of using ifdefs to select the right symbol, we use weak symbols. And because ARM doesn't need the generic implementation, we make the generic one default only if an arch library doesn't need it already, and then have arch libraries that do need it opt-in. So that the arch libraries can remain tristate rather than bool, we then split the shash part from the glue code. Acked-by: Herbert Xu Acked-by: Ard Biesheuvel Acked-by: Greg Kroah-Hartman Cc: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org Cc: linux-crypto@vger.kernel.org Signed-off-by: Jason A. Donenfeld commit 009ba8568be497c640cab7571f7bfd18345d7b24 Author: Eric Biggers Date: Mon Dec 20 16:41:57 2021 -0600 random: fix data race on crng init time _extract_crng() does plain loads of crng->init_time and crng_global_init_time, which causes undefined behavior if crng_reseed() and RNDRESEEDCRNG modify these corrently. Use READ_ONCE() and WRITE_ONCE() to make the behavior defined. Don't fix the race on crng->init_time by protecting it with crng->lock, since it's not a problem for duplicate reseedings to occur. I.e., the lockless access with READ_ONCE() is fine. Fixes: d848e5f8e1eb ("random: add new ioctl RNDRESEEDCRNG") Fixes: e192be9d9a30 ("random: replace non-blocking pool with a Chacha20-based CRNG") Cc: stable@vger.kernel.org Signed-off-by: Eric Biggers Acked-by: Paul E. McKenney Signed-off-by: Jason A. Donenfeld commit 5d73d1e320c3fd94ea15ba5f79301da9a8bcc7de Author: Eric Biggers Date: Mon Dec 20 16:41:56 2021 -0600 random: fix data race on crng_node_pool extract_crng() and crng_backtrack_protect() load crng_node_pool with a plain load, which causes undefined behavior if do_numa_crng_init() modifies it concurrently. Fix this by using READ_ONCE(). Note: as per the previous discussion https://lore.kernel.org/lkml/20211219025139.31085-1-ebiggers@kernel.org/T/#u, READ_ONCE() is believed to be sufficient here, and it was requested that it be used here instead of smp_load_acquire(). Also change do_numa_crng_init() to set crng_node_pool using cmpxchg_release() instead of mb() + cmpxchg(), as the former is sufficient here but is more lightweight. Fixes: 1e7f583af67b ("random: make /dev/urandom scalable for silly userspace programs") Cc: stable@vger.kernel.org Signed-off-by: Eric Biggers Acked-by: Paul E. McKenney Signed-off-by: Jason A. Donenfeld commit 5320eb42dec7a7ef3ab7da3c5c0d7f889a5181e5 Author: Sebastian Andrzej Siewior Date: Tue Dec 7 13:17:34 2021 +0100 irq: remove unused flags argument from __handle_irq_event_percpu() The __IRQF_TIMER bit from the flags argument was used in add_interrupt_randomness() to distinguish the timer interrupt from other interrupts. This is no longer the case. Remove the flags argument from __handle_irq_event_percpu(). Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Jason A. Donenfeld commit 703f7066f40599c290babdb79dd61319264987e9 Author: Sebastian Andrzej Siewior Date: Tue Dec 7 13:17:33 2021 +0100 random: remove unused irq_flags argument from add_interrupt_randomness() Since commit ee3e00e9e7101 ("random: use registers from interrupted code for CPU's w/o a cycle counter") the irq_flags argument is no longer used. Remove unused irq_flags. Cc: Borislav Petkov Cc: Dave Hansen Cc: Dexuan Cui Cc: H. Peter Anvin Cc: Haiyang Zhang Cc: Ingo Molnar Cc: K. Y. Srinivasan Cc: Stephen Hemminger Cc: Thomas Gleixner Cc: Wei Liu Cc: linux-hyperv@vger.kernel.org Cc: x86@kernel.org Signed-off-by: Sebastian Andrzej Siewior Acked-by: Wei Liu Signed-off-by: Jason A. Donenfeld commit 2b6c6e3d9ce3aa0e547ac25d60e06fe035cd9f79 Author: Mark Brown Date: Wed Dec 1 17:44:49 2021 +0000 random: document add_hwgenerator_randomness() with other input functions The section at the top of random.c which documents the input functions available does not document add_hwgenerator_randomness() which might lead a reader to overlook it. Add a brief note about it. Signed-off-by: Mark Brown [Jason: reorganize position of function in doc comment and also document add_bootloader_randomness() while we're at it.] Signed-off-by: Jason A. Donenfeld commit 9bafaa9375cbf892033f188d8cb624ae328754b5 Author: Jason A. Donenfeld Date: Sat Dec 25 01:50:07 2021 +0100 MAINTAINERS: add git tree for random.c This is handy not just for humans, but also so that the 0-day bot can automatically test posted mailing list patches against the right tree. Signed-off-by: Jason A. Donenfeld commit 44bab87d8ca6f0544a9f8fc97bdf33aa5b3c899e Author: Hao Luo Date: Thu Jan 6 12:55:25 2022 -0800 bpf/selftests: Test bpf_d_path on rdonly_mem. The second parameter of bpf_d_path() can only accept writable memories. Rdonly_mem obtained from bpf_per_cpu_ptr() can not be passed into bpf_d_path for modification. This patch adds a selftest to verify this behavior. Signed-off-by: Hao Luo Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20220106205525.2116218-1-haoluo@google.com commit e59618f0f46fa6cf86d5b82380e0f453756b282b Author: Grant Seltzer Date: Thu Jan 6 15:13:05 2022 -0500 libbpf: Add documentation for bpf_map batch operations This adds documention for: - bpf_map_delete_batch() - bpf_map_lookup_batch() - bpf_map_lookup_and_delete_batch() - bpf_map_update_batch() This also updates the public API for the `keys` parameter of `bpf_map_delete_batch()`, and both the `keys` and `values` parameters of `bpf_map_update_batch()` to be constants. Signed-off-by: Grant Seltzer Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20220106201304.112675-1-grantseltzer@gmail.com commit f5f60d235e7058da13a643c33fc7599c05ec0b73 Author: Wei Yang Date: Sat Dec 25 00:09:32 2021 +0000 cgroup/rstat: check updated_next only for root After commit dc26532aed0a ("cgroup: rstat: punt root-level optimization to individual controllers"), each rstat on updated_children list has its ->updated_next not NULL. This means we can remove the check on ->updated_next, if we make sure the subtree from @root is on list, which could be done by checking updated_next for root. tj: Coding style fixes. Signed-off-by: Wei Yang Reviewed-by: Michal Koutný Signed-off-by: Tejun Heo commit 70bc793382a0e37ba4e35e4d1a317b280b829a44 Author: Andrii Nakryiko Date: Thu Jan 6 12:51:56 2022 -0800 selftests/bpf: Don't rely on preserving volatile in PT_REGS macros in loop3 PT_REGS*() macro on some architectures force-cast struct pt_regs to other types (user_pt_regs, etc) and might drop volatile modifiers, if any. Volatile isn't really required as pt_regs value isn't supposed to change during the BPF program run, so this is correct behavior. But progs/loop3.c relies on that volatile modifier to ensure that loop is preserved. Fix loop3.c by declaring i and sum variables as volatile instead. It preserves the loop and makes the test pass on all architectures (including s390x which is currently broken). Fixes: 3cc31d794097 ("libbpf: Normalize PT_REGS_xxx() macro definitions") Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220106205156.955373-1-andrii@kernel.org commit 0da41f7348fff193d01d031ce255088fa98324b7 Author: Wei Yang Date: Sat Dec 25 00:09:31 2021 +0000 cgroup: rstat: explicitly put loop variant in while Instead of do while unconditionally, let's put the loop variant in while. Signed-off-by: Wei Yang Reviewed-by: Michal Koutný Signed-off-by: Tejun Heo commit f6fdf773daa399e688de70098ef4feaa5ea8e67c Merge: 3b247eeaecfef 3969341813eb5 Author: Mark Brown Date: Thu Jan 6 20:26:24 2022 +0000 ASoC: imx-card: several improvement and fixes Merge series from Shengjiu Wang : Several improvement and fixes for AK codecs supported on i.MX platfroms commit 42f4046bc4ba56c6e4d2af7a9d7f70eaa563daec Author: Greg Kroah-Hartman Date: Wed Jan 5 19:37:16 2022 +0100 efi: use default_groups in kobj_type There are currently 2 ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the firmware efi sysfs code to use default_groups field which has been the preferred way since aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field. Cc: Ard Biesheuvel Cc: linux-efi@vger.kernel.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Ard Biesheuvel commit f046fff8bc4c4d8f8a478022e76e40b818f692df Author: Ilias Apalodimas Date: Fri Nov 19 13:47:45 2021 +0200 efi/libstub: measure loaded initrd info into the TPM In an effort to ensure the initrd observed and used by the OS is the same one that was meant to be loaded, which is difficult to guarantee otherwise, let's measure the initrd if the EFI stub and specifically the newly introduced LOAD_FILE2 protocol was used. Modify the initrd loading sequence so that the contents of the initrd are measured into PCR9. Note that the patch is currently using EV_EVENT_TAG to create the eventlog entry instead of EV_IPL. According to the TCP PC Client specification this is used for PCRs defined for OS and application usage. Co-developed-by: Ard Biesheuvel Signed-off-by: Ard Biesheuvel Signed-off-by: Ilias Apalodimas Link: https://lore.kernel.org/r/20211119114745.1560453-5-ilias.apalodimas@linaro.org [ardb: add braces to initializer of tagged_event_data] Link: https://github.com/ClangBuiltLinux/linux/issues/1547 Signed-off-by: Ard Biesheuvel commit d85bd8233fff000567cda4e108112bcb33478616 Merge: 050f461e28c5d 1745e857e73a2 Author: Jens Axboe Date: Thu Jan 6 12:36:04 2022 -0700 Merge branch 'md-next' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/song/md into for-5.17/drivers Pull MD updates from Song: "The major changes are: - REQ_NOWAIT support, by Vishal Verma - raid6 benchmark optimization, by Dirk Müller - Fix for acct bioset, by Xiao Ni - Clean up max_queued_requests, by Mariusz Tkaczyk - PREEMPT_RT optimization, by Davidlohr Bueso - Use default_groups in kobj_type, by Greg Kroah-Hartman" * 'md-next' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/song/md: md: use default_groups in kobj_type md: Move alloc/free acct bioset in to personality lib/raid6: Use strict priority ranking for pq gen() benchmarking lib/raid6: skip benchmark of non-chosen xor_syndrome functions md: fix spelling of "its" md: raid456 add nowait support md: raid10 add nowait support md: raid1 add nowait support md: add support for REQ_NOWAIT md: drop queue limitation for RAID1 and RAID10 md/raid5: play nice with PREEMPT_RT commit 34bf20ce986c441c1088ed09a33e0bb96e52f99a Author: Trond Myklebust Date: Mon Dec 27 14:40:52 2021 -0500 NFSv42: Fallocate and clone should also request 'blocks used' Both fallocate and clone can end up updating the blocks used attribute. Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit 85847280b11666ae24aac519e06f0742fab72064 Author: Trond Myklebust Date: Mon Dec 27 14:40:51 2021 -0500 NFSv4: Allow writebacks to request 'blocks used' When doing a non-pNFS write, allow the writeback code to specify that it also needs to update 'blocks used'. Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit 86439fa2678d1ae752ac9c787aac1c145b87b4c2 Author: Greg Kroah-Hartman Date: Tue Dec 28 15:48:23 2021 +0100 SUNRPC: use default_groups in kobj_type There are currently 2 ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the sunrpc sysfs code to use default_groups field which has been the preferred way since aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field. Cc: "J. Bruce Fields" Cc: Chuck Lever Cc: Trond Myklebust Cc: Anna Schumaker Cc: linux-nfs@vger.kernel.org Cc: netdev@vger.kernel.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Anna Schumaker commit 01f34245722b9dac0b2667db4dc17d2049b99c76 Author: Greg Kroah-Hartman Date: Tue Dec 28 15:41:38 2021 +0100 NFS: use default_groups in kobj_type There are currently 2 ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the NFS code to use default_groups field which has been the preferred way since aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field. Cc: Trond Myklebust Cc: Anna Schumaker Cc: linux-nfs@vger.kernel.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Anna Schumaker commit 68eaba4ca924a97a863c5c81c0b23a11dcb6db90 Author: Trond Myklebust Date: Fri Dec 17 15:36:58 2021 -0500 NFS: Fix the verifier for case sensitive filesystem in nfs_atomic_open() Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit 00bdadc7accfce944dc30fbc205cd28a7eed657b Author: Trond Myklebust Date: Fri Dec 17 15:36:57 2021 -0500 NFS: Add a helper to remove case-insensitive aliases When dealing with case insensitive names, the client has no idea how the server performs the mapping, so cannot collapse the dentries into a single representative. So both rename and unlink need to deal with the fact that there could be several dentries representing the file, and have to somehow force them to be revalidated. Use d_prune_aliases() as a big hammer approach. Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit 8ce37abdeb4c73842d16620e1da151765ac86b5e Author: Trond Myklebust Date: Fri Dec 17 15:36:56 2021 -0500 NFS: Invalidate negative dentries on all case insensitive directory changes If we create a file, rename it, or hardlink it, then we need to assume that cached negative dentries need to be revalidated. Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit 98ca3ee60b9e4b039cc3ef21a169e775afa9bd0c Author: Trond Myklebust Date: Fri Dec 17 15:36:55 2021 -0500 NFSv4: Just don't cache negative dentries on case insensitive servers If the directory contents change, we cannot rely on the negative dentry being cacheable. Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit 1ab5be4ac5b1c9ce39ce1037c45b68d2ce6eede0 Author: Trond Myklebust Date: Fri Dec 17 15:36:54 2021 -0500 NFSv4: Add some support for case insensitive filesystems Add capabilities to allow the NFS client to recognise when it is dealing with case insensitive and case preserving filesystems. Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit b05bf5c63b326ce1da84ef42498d8e0e292e694c Author: Trond Myklebust Date: Mon Jan 3 14:50:16 2022 -0500 NFSv4.1: Fix uninitialised variable in devicenotify When decode_devicenotify_args() exits with no entries, we need to ensure that the struct cb_devicenotifyargs is initialised to { 0, NULL } in order to avoid problems in nfs4_callback_devicenotify(). Reported-by: Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit fbd2057e5329d3502a27491190237b6be52a1cb6 Author: Xiaoke Wang Date: Fri Dec 17 01:01:33 2021 +0800 nfs: nfs4clinet: check the return value of kstrdup() kstrdup() returns NULL when some internal memory errors happen, it is better to check the return value of it so to catch the memory error in time. Signed-off-by: Xiaoke Wang Signed-off-by: Anna Schumaker commit 2c52c8376db7160a1dd8a681c61c9258405ef143 Author: Olga Kornievskaia Date: Mon Nov 29 15:33:56 2021 -0500 NFSv4 only print the label when its queried When the bitmask of the attributes doesn't include the security label, don't bother printing it. Since the label might not be null terminated, adjust the printing format accordingly. Signed-off-by: Olga Kornievskaia Signed-off-by: Anna Schumaker commit c4f0396688b5916b3a95bcb004d158634f2234ff Author: Jiapeng Chong Date: Thu Nov 18 17:37:41 2021 +0800 SUNRPC: clean up some inconsistent indenting Eliminate the follow smatch warning: net/sunrpc/xprtsock.c:1912 xs_local_connect() warn: inconsistent indenting. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Anna Schumaker commit 35e0f9a9af4869a4b1a3943da08d3a29ac6c4a42 Author: Xu Wang Date: Wed Nov 10 09:32:17 2021 +0000 sunrpc: Remove unneeded null check In g_verify_token_header, the null check of 'ret' is unneeded to be done twice. Signed-off-by: Xu Wang Signed-off-by: Anna Schumaker commit c72a826829ccfb38019187a3a5ba6d3584b7b7dc Author: Gustavo A. R. Silva Date: Tue Aug 10 18:31:01 2021 -0500 nfs41: pnfs: filelayout: 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 nfs4_file_layout_dsaddr 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 Signed-off-by: Gustavo A. R. Silva Signed-off-by: Anna Schumaker commit 4b0c359b813bbf115f5e2219ea8c0e4fad92400b Author: Pierguido Lambri Date: Mon Dec 13 08:38:48 2021 +0000 SUNRPC: Add source address/port to rpc_socket* traces The rpc_socket* traces now show also the source address and port. An example is: kworker/u17:1-951 [005] 134218.925343: rpc_socket_close: socket:[46913] srcaddr=192.168.100.187:793 dstaddr=192.168.100.129:2049 state=4 (DISCONNECTING) sk_state=7 (CLOSE) kworker/u17:0-242 [006] 134360.841370: rpc_socket_connect: error=-115 socket:[56322] srcaddr=192.168.100.187:769 dstaddr=192.168.100.129:2049 state=2 (CONNECTING) sk_state=2 (SYN_SENT) -0 [006] 134360.841859: rpc_socket_state_change: socket:[56322] srcaddr=192.168.100.187:769 dstaddr=192.168.100.129:2049 state=2 (CONNECTING) sk_state=1 (ESTABLISHED) Signed-off-by: Pierguido Lambri Signed-off-by: Anna Schumaker commit 6ff9d99bb88faebf134ca668842349d9718e5464 Author: Trond Myklebust Date: Wed Dec 15 16:38:16 2021 -0500 NFS: Ensure the server has an up to date ctime before renaming Renaming a file is required by POSIX to update the file ctime, so ensure that the file data is synced to disk so that we don't clobber the updated ctime by writing back after creating the hard link. Fixes: f2c2c552f119 ("NFS: Move delegation recall into the NFSv4 callback for rename_setup()") Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit 204975036b34f55237bc44c8a302a88468ef21b5 Author: Trond Myklebust Date: Wed Dec 15 16:38:15 2021 -0500 NFS: Ensure the server has an up to date ctime before hardlinking Creating a hard link is required by POSIX to update the file ctime, so ensure that the file data is synced to disk so that we don't clobber the updated ctime by writing back after creating the hard link. Fixes: 9f7682728728 ("NFS: Move the delegation return down into nfs4_proc_link()") Signed-off-by: Trond Myklebust Signed-off-by: Anna Schumaker commit 6238aec83f3fb12132f964937e5bbcf248fea8f9 Author: NeilBrown Date: Tue Sep 28 09:47:57 2021 +1000 NFS: don't store 'struct cred *' in struct nfs_access_entry Storing the 'struct cred *' in nfs_access_entry is problematic. An active 'cred' can keep a 'struct key *' active, and a quota is imposed on the number of such keys that a user can maintain. Cached 'nfs_access_entry' structs have indefinite lifetime, and having these keep 'struct key's alive imposes on that quota. So remove the 'struct cred *' and replace it with the fields we need: kuid_t, kgid_t, and struct group_info * This makes the 'struct nfs_access_entry' 64 bits larger. New function "access_cmp" is introduced which is identical to cred_fscmp() except that the second arg is an 'nfs_access_entry', rather than a 'cred' Fixes: b68572e07c58 ("NFS: change access cache to use 'struct cred'.") Signed-off-by: NeilBrown Signed-off-by: Anna Schumaker commit 73fbb3fa647bdb5b60469af8101c741ece03a825 Author: NeilBrown Date: Tue Sep 28 09:47:57 2021 +1000 NFS: pass cred explicitly for access tests Storing the 'struct cred *' in nfs_access_entry is problematic. An active 'cred' can keep a 'struct key *' active, and a quota is imposed on the number of such keys that a user can maintain. Cached 'nfs_access_entry' structs have indefinite lifetime, and having these keep 'struct key's alive imposes on that quota. So a future patch will remove the ->cred ref from nfs_access_entry. To prepare, change various functions to not assume there is a 'cred' in the nfs_access_entry, but to pass the cred around explicitly. Signed-off-by: NeilBrown Signed-off-by: Anna Schumaker commit b5e7b59c3480f355910f9d2c6ece5857922a5e54 Author: NeilBrown Date: Tue Sep 28 09:47:57 2021 +1000 NFS: change nfs_access_get_cached to only report the mask Currently the nfs_access_get_cached family of functions report a 'struct nfs_access_entry' as the result, with both .mask and .cred set. However the .cred is never used. This is probably good and there is no guarantee that it won't be freed before use. Change to only report the 'mask' - as this is all that is used or needed. Signed-off-by: NeilBrown Signed-off-by: Anna Schumaker commit 7e937bb3cbe1f6b9840a43f879aa6e3f1a5e6537 Author: Darrick J. Wong Date: Wed Jan 5 11:14:19 2022 -0800 xfs: warn about inodes with project id of -1 Inodes aren't supposed to have a project id of -1U (aka 4294967295) but the kernel hasn't always validated FSSETXATTR correctly. Flag this as something for the sysadmin to check out. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit eae44cb341ec49f993867b44398b13c6d28600dc Author: Darrick J. Wong Date: Wed Jan 5 11:13:57 2022 -0800 xfs: hold quota inode ILOCK_EXCL until the end of dqalloc Online fsck depends on callers holding ILOCK_EXCL from the time they decide to update a block mapping until after they've updated the reverse mapping records to guarantee the stability of both mapping records. Unfortunately, the quota code drops ILOCK_EXCL at the first transaction roll in the dquot allocation process, which breaks that assertion. This leads to sporadic failures in the online rmap repair code if the repair code grabs the AGF after bmapi_write maps a new block into the quota file's data fork but before it can finish the deferred rmap update. Fix this by rewriting the function to hold the ILOCK until after the transaction commit like all other bmap updates do, and get rid of the dqread wrapper that does nothing but complicate the codebase. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit f4901a182d33d05a3b7020e2af97c635f6c47959 Author: Jiapeng Chong Date: Wed Jan 5 11:12:37 2022 -0800 xfs: Remove redundant assignment of mp mp is being initialized to log->l_mp but this is never read as record is overwritten later on. Remove the redundant assignment. Cleans up the following clang-analyzer warning: fs/xfs/xfs_log_recover.c:3543:20: warning: Value stored to 'mp' during its initialization is never read [clang-analyzer-deadcode.DeadStores]. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 8dc9384b7d75012856b02ff44c37566a55fc2abf Author: Dave Chinner Date: Tue Jan 4 17:22:18 2022 -0800 xfs: reduce kvmalloc overhead for CIL shadow buffers Oh, let me count the ways that the kvmalloc API sucks dog eggs. The problem is when we are logging lots of large objects, we hit kvmalloc really damn hard with costly order allocations, and behaviour utterly sucks: - 49.73% xlog_cil_commit - 31.62% kvmalloc_node - 29.96% __kmalloc_node - 29.38% kmalloc_large_node - 29.33% __alloc_pages - 24.33% __alloc_pages_slowpath.constprop.0 - 18.35% __alloc_pages_direct_compact - 17.39% try_to_compact_pages - compact_zone_order - 15.26% compact_zone 5.29% __pageblock_pfn_to_page 3.71% PageHuge - 1.44% isolate_migratepages_block 0.71% set_pfnblock_flags_mask 1.11% get_pfnblock_flags_mask - 0.81% get_page_from_freelist - 0.59% _raw_spin_lock_irqsave - do_raw_spin_lock __pv_queued_spin_lock_slowpath - 3.24% try_to_free_pages - 3.14% shrink_node - 2.94% shrink_slab.constprop.0 - 0.89% super_cache_count - 0.66% xfs_fs_nr_cached_objects - 0.65% xfs_reclaim_inodes_count 0.55% xfs_perag_get_tag 0.58% kfree_rcu_shrink_count - 2.09% get_page_from_freelist - 1.03% _raw_spin_lock_irqsave - do_raw_spin_lock __pv_queued_spin_lock_slowpath - 4.88% get_page_from_freelist - 3.66% _raw_spin_lock_irqsave - do_raw_spin_lock __pv_queued_spin_lock_slowpath - 1.63% __vmalloc_node - __vmalloc_node_range - 1.10% __alloc_pages_bulk - 0.93% __alloc_pages - 0.92% get_page_from_freelist - 0.89% rmqueue_bulk - 0.69% _raw_spin_lock - do_raw_spin_lock __pv_queued_spin_lock_slowpath 13.73% memcpy_erms - 2.22% kvfree On this workload, that's almost a dozen CPUs all trying to compact and reclaim memory inside kvmalloc_node at the same time. Yet it is regularly falling back to vmalloc despite all that compaction, page and shrinker reclaim that direct reclaim is doing. Copying all the metadata is taking far less CPU time than allocating the storage! Direct reclaim should be considered extremely harmful. This is a high frequency, high throughput, CPU usage and latency sensitive allocation. We've got memory there, and we're using kvmalloc to allow memory allocation to avoid doing lots of work to try to do contiguous allocations. Except it still does *lots of costly work* that is unnecessary. Worse: the only way to avoid the slowpath page allocation trying to do compaction on costly allocations is to turn off direct reclaim (i.e. remove __GFP_RECLAIM_DIRECT from the gfp flags). Unfortunately, the stupid kvmalloc API then says "oh, this isn't a GFP_KERNEL allocation context, so you only get kmalloc!". This cuts off the vmalloc fallback, and this leads to almost instant OOM problems which ends up in filesystems deadlocks, shutdowns and/or kernel crashes. I want some basic kvmalloc behaviour: - kmalloc for a contiguous range with fail fast semantics - no compaction direct reclaim if the allocation enters the slow path. - run normal vmalloc (i.e. GFP_KERNEL) if kmalloc fails The really, really stupid part about this is these kvmalloc() calls are run under memalloc_nofs task context, so all the allocations are always reduced to GFP_NOFS regardless of the fact that kvmalloc requires GFP_KERNEL to be passed in. IOWs, we're already telling kvmalloc to behave differently to the gfp flags we pass in, but it still won't allow vmalloc to be run with anything other than GFP_KERNEL. So, this patch open codes the kvmalloc() in the commit path to have the above described behaviour. The result is we more than halve the CPU time spend doing kvmalloc() in this path and transaction commits with 64kB objects in them more than doubles. i.e. we get ~5x reduction in CPU usage per costly-sized kvmalloc() invocation and the profile looks like this: - 37.60% xlog_cil_commit 16.01% memcpy_erms - 8.45% __kmalloc - 8.04% kmalloc_order_trace - 8.03% kmalloc_order - 7.93% alloc_pages - 7.90% __alloc_pages - 4.05% __alloc_pages_slowpath.constprop.0 - 2.18% get_page_from_freelist - 1.77% wake_all_kswapds .... - __wake_up_common_lock - 0.94% _raw_spin_lock_irqsave - 3.72% get_page_from_freelist - 2.43% _raw_spin_lock_irqsave - 5.72% vmalloc - 5.72% __vmalloc_node_range - 4.81% __get_vm_area_node.constprop.0 - 3.26% alloc_vmap_area - 2.52% _raw_spin_lock - 1.46% _raw_spin_lock 0.56% __alloc_pages_bulk - 4.66% kvfree - 3.25% vfree - __vfree - 3.23% __vunmap - 1.95% remove_vm_area - 1.06% free_vmap_area_noflush - 0.82% _raw_spin_lock - 0.68% _raw_spin_lock - 0.92% _raw_spin_lock - 1.40% kfree - 1.36% __free_pages - 1.35% __free_pages_ok - 1.02% _raw_spin_lock_irqsave It's worth noting that over 50% of the CPU time spent allocating these shadow buffers is now spent on spinlocks. So the shadow buffer allocation overhead is greatly reduced by getting rid of direct reclaim from kmalloc, and could probably be made even less costly if vmalloc() didn't use global spinlocks to protect it's structures. Signed-off-by: Dave Chinner Reviewed-by: Allison Henderson Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 219aac5d469f7c0bc8ca299dcdeab70380076d24 Author: Greg Kroah-Hartman Date: Mon Jan 3 11:10:18 2022 -0800 xfs: sysfs: use default_groups in kobj_type There are currently 2 ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the xfs sysfs code to use default_groups field which has been the preferred way since aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field. Cc: "Darrick J. Wong" Cc: linux-xfs@vger.kernel.org Signed-off-by: Greg Kroah-Hartman Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 1745e857e73a2e29379013438ee271e9aadab2e0 Author: Greg Kroah-Hartman Date: Thu Jan 6 11:03:35 2022 +0100 md: use default_groups in kobj_type There are currently 2 ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the md rdev sysfs code to use default_groups field which has been the preferred way since commit aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field. Cc: Song Liu Cc: linux-raid@vger.kernel.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Song Liu commit 3e718b44756e2829e7189a9504aa7a6d7f394d6c Author: Rob Herring Date: Thu Jan 6 12:25:17 2022 -0600 spi: dt-bindings: mediatek,spi-mtk-nor: Fix example 'interrupts' property A phandle for 'interrupts' value is wrong and should be one or more numbers. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220106182518.1435497-9-robh@kernel.org Signed-off-by: Mark Brown commit 0dbc41621875122f68a653997eb3c3010d76e86a Author: Christophe JAILLET Date: Sun Dec 26 15:38:57 2021 +0100 ice: Use bitmap_free() to free bitmap kfree() and bitmap_free() are the same. But using the latter is more consistent when freeing memory allocated with bitmap_zalloc(). Signed-off-by: Christophe JAILLET Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit e75ed29db5315b4706953a5462f9c783532cb776 Author: Christophe JAILLET Date: Thu Dec 23 10:03:37 2021 +0100 ice: Optimize a few bitmap operations When a bitmap is local to a function, it is safe to use the non-atomic __[set|clear]_bit(). No concurrent accesses can occur. Signed-off-by: Christophe JAILLET Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit a5c259b162844f3ceaf3d082344bf6938728aca9 Author: Christophe JAILLET Date: Wed Nov 17 22:21:19 2021 +0100 ice: Slightly simply ice_find_free_recp_res_idx The 'possible_idx' bitmap is set just after it is zeroed, so we can save the first step. The 'free_idx' bitmap is used only at the end of the function as the result of a bitmap xor operation. So there is no need to explicitly zero it before. So, slightly simply the code and remove 2 useless 'bitmap_zero()' call Signed-off-by: Christophe JAILLET Tested-by: Sandeep Penigalapati Signed-off-by: Tony Nguyen commit c1e5da5dd4659753407534e323c0579aa79c3bd1 Author: Wojciech Drewek Date: Tue Oct 26 12:38:40 2021 +0200 ice: improve switchdev's slow-path In current switchdev implementation, every VF PR is assigned to individual ring on switchdev ctrl VSI. For slow-path traffic, there is a mapping VF->ring done in software based on src_vsi value (by calling ice_eswitch_get_target_netdev function). With this change, HW solution is introduced which is more efficient. For each VF, src MAC (VF's MAC) filter will be created, which forwards packets to the corresponding switchdev ctrl VSI queue based on src MAC address. This filter has to be removed and then replayed in case of resetting one VF. Keep information about this rule in repr->mac_rule, thanks to that we know which rule has to be removed and replayed for a given VF. In case of CORE/GLOBAL all rules are removed automatically. We have to take care of readding them. This is done by ice_replay_vsi_adv_rule. When driver leaves switchdev mode, remove all advanced rules from switchdev ctrl VSI. This is done by ice_rem_adv_rule_for_vsi. Flag repr->rule_added is needed because in some cases reset might be triggered before VF sends request to add MAC. Co-developed-by: Grzegorz Nitka Signed-off-by: Grzegorz Nitka Signed-off-by: Wojciech Drewek Tested-by: Sandeep Penigalapati Signed-off-by: Tony Nguyen commit 31834aaa4e2a26d8d1f6b36703bb35cfdb8fc98c Author: Yang Yingliang Date: Thu Jan 6 15:54:48 2022 +0800 ACPI: pfr_update: Fix return value check in pfru_write() In case of error, memremap() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Fixes: 0db89fa243e5 ("ACPI: Introduce Platform Firmware Runtime Update device driver") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Acked-by: Chen Yu Signed-off-by: Rafael J. Wysocki commit 6c4ab1b86dac3954d15c00c1a6396d60a1023fab Author: Huang Rui Date: Thu Jan 6 15:43:06 2022 +0800 x86, sched: Fix undefined reference to init_freq_invariance_cppc() build error The init_freq_invariance_cppc function is implemented in smpboot and depends on CONFIG_SMP. MODPOST vmlinux.symvers MODINFO modules.builtin.modinfo GEN modules.builtin LD .tmp_vmlinux.kallsyms1 ld: drivers/acpi/cppc_acpi.o: in function `acpi_cppc_processor_probe': /home/ray/brahma3/linux/drivers/acpi/cppc_acpi.c:819: undefined reference to `init_freq_invariance_cppc' make: *** [Makefile:1161: vmlinux] Error 1 See https://lore.kernel.org/lkml/484af487-7511-647e-5c5b-33d4429acdec@infradead.org/. Fixes: 41ea667227ba ("x86, sched: Calculate frequency invariance for AMD systems") Reported-by: kernel test robot Reported-by: Randy Dunlap Reported-by: Stephen Rothwell Signed-off-by: Huang Rui [ rjw: Subject edits ] Signed-off-by: Rafael J. Wysocki commit ca2770c65b56374374fa00c349883e67c16943de Author: Max Gurtovoy Date: Wed Dec 15 15:57:21 2021 +0200 IB/iser: Align coding style across driver The following changes were made: 1. Align function signatures to 80 characters per line. 2. Remove tabs for variable assignment and use 1 space instead. 3. Don't compare to NULL in "if" clause. 4. Remove strange indentations. This will ease on the maintenance of the driver for the future. Link: https://lore.kernel.org/r/20211215135721.3662-7-mgurtovoy@nvidia.com Signed-off-by: Max Gurtovoy Signed-off-by: Jason Gunthorpe commit d4cb5d3630ec135c3c1f9a2669695cd36feaf897 Merge: 5a7ac592c56c6 ce3fe7a4ac6a4 Author: Palmer Dabbelt Date: Thu Jan 6 09:42:26 2022 -0800 RISC-V: Clean up the defconfigs It's been a while since cleaning up the defconfigs, so I manually checked up on each change. This found a handful of minor issues, which have been fixed in-line. commit ce3fe7a4ac6a4ddea2aa21d34a6076e87cd206e5 Author: Palmer Dabbelt Date: Fri Nov 19 08:44:13 2021 -0800 RISC-V: defconfigs: Remove redundant K210 DT source The "k210_generic" DT has been the default in Kconfig since 67d96729a9e ("riscv: Update Canaan Kendryte K210 device tree"), so drop it from the defconfigs to avoid diff with savedefconfig. Reviewed-by: Anup Patel Signed-off-by: Palmer Dabbelt commit a2e6840b37b45d04e095c47f961211b7697cb063 Author: Huang Rui Date: Thu Jan 6 15:43:05 2022 +0800 cpufreq: amd-pstate: Fix Kconfig dependencies for AMD P-State The AMD P-State driver is based on ACPI CPPC function, so ACPI should be dependence of this driver in the kernel config. In file included from ../drivers/cpufreq/amd-pstate.c:40:0: ../include/acpi/processor.h:226:2: error: unknown type name ‘phys_cpuid_t’ phys_cpuid_t phys_id; /* CPU hardware ID such as APIC ID for x86 */ ^~~~~~~~~~~~ ../include/acpi/processor.h:355:1: error: unknown type name ‘phys_cpuid_t’; did you mean ‘phys_addr_t’? phys_cpuid_t acpi_get_phys_id(acpi_handle, int type, u32 acpi_id); ^~~~~~~~~~~~ phys_addr_t CC drivers/rtc/rtc-rv3029c2.o ../include/acpi/processor.h:356:1: error: unknown type name ‘phys_cpuid_t’; did you mean ‘phys_addr_t’? phys_cpuid_t acpi_map_madt_entry(u32 acpi_id); ^~~~~~~~~~~~ phys_addr_t ../include/acpi/processor.h:357:20: error: unknown type name ‘phys_cpuid_t’; did you mean ‘phys_addr_t’? int acpi_map_cpuid(phys_cpuid_t phys_id, u32 acpi_id); ^~~~~~~~~~~~ phys_addr_t See https://lore.kernel.org/lkml/20e286d4-25d7-fb6e-31a1-4349c805aae3@infradead.org/. Reported-by: Randy Dunlap Reported-by: Stephen Rothwell Signed-off-by: Huang Rui [ rjw: Subject edits ] Signed-off-by: Rafael J. Wysocki commit bdc4fd3d48e7e97dd7efc14affe384280e197071 Author: Yang Li Date: Thu Jan 6 10:16:05 2022 +0800 cpufreq: amd-pstate: Fix struct amd_cpudata kernel-doc comment Add the description of @req and @boost_supported in struct amd_cpudata kernel-doc comment to remove warnings found by running scripts/kernel-doc, which is caused by using 'make W=1'. drivers/cpufreq/amd-pstate.c:104: warning: Function parameter or member 'req' not described in 'amd_cpudata' drivers/cpufreq/amd-pstate.c:104: warning: Function parameter or member 'boost_supported' not described in 'amd_cpudata' Reported-by: Abaci Robot Signed-off-by: Yang Li Acked-by: Huang Rui Signed-off-by: Rafael J. Wysocki commit c36a2b97162720ff373985f13d819e05f1ba128d Author: Victor Raj Date: Tue Oct 26 12:38:39 2021 +0200 ice: replay advanced rules after reset ice_replay_vsi_adv_rule will replay advanced rules for a given VSI. Exit this function when list of rules for given recipe is empty. Do not add rule when given vsi_handle does not match vsi_handle from the rule info. Use ICE_MAX_NUM_RECIPES instead of ICE_SW_LKUP_LAST in order to find advanced rules as well. Signed-off-by: Victor Raj Signed-off-by: Wojciech Drewek Tested-by: Sandeep Penigalapati Signed-off-by: Tony Nguyen commit 07f910f9b7295b6a28b337fedb56e612684c5659 Author: Matthew Wilcox (Oracle) Date: Mon Oct 4 14:46:50 2021 +0100 mm: Remove slab from struct page All members of struct slab can now be removed from struct page. This shrinks the definition of struct page by 30 LOC, making it easier to understand. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Vlastimil Babka commit 9cc960a164f1e8491c22d0fdb57a1a50dfe5d7c0 Merge: b01af5c0b0414 aade40b62745c Author: Vlastimil Babka Date: Thu Jan 6 18:03:29 2022 +0100 Merge branch 'core' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu into slab-struct_slab-part2-v1 Merge iommu tree for a series that removes usage of struct page 'freelist' field. commit 3b247eeaecfefe35ecca1578b0ed48be65bc6ca3 Author: Yassine Oudjana Date: Tue Jan 4 03:35:36 2022 +0000 ASoC: wcd9335: Keep a RX port value for each SLIM RX mux Currently, rx_port_value is a single unsigned int that gets overwritten when slim_rx_mux_put() is called for any RX mux, then the same value is read when slim_rx_mux_get() is called for any of them. This results in slim_rx_mux_get() reporting the last value set by slim_rx_mux_put() regardless of which SLIM RX mux is in question. Turn rx_port_value into an array and store a separate value for each SLIM RX mux. Signed-off-by: Yassine Oudjana Link: https://lore.kernel.org/r/20220104033356.343685-1-y.oudjana@protonmail.com Signed-off-by: Mark Brown commit 0c031fd37f69deb0cd8c43bbfcfccd62ebd7e952 Author: Xiao Ni Date: Fri Dec 10 17:31:15 2021 +0800 md: Move alloc/free acct bioset in to personality bioset acct is only needed for raid0 and raid5. Therefore, md_run only allocates it for raid0 and raid5. However, this does not cover personality takeover, which may cause uninitialized bioset. For example, the following repro steps: mdadm -CR /dev/md0 -l1 -n2 /dev/loop0 /dev/loop1 mdadm --wait /dev/md0 mkfs.xfs /dev/md0 mdadm /dev/md0 --grow -l5 mount /dev/md0 /mnt causes panic like: [ 225.933939] BUG: kernel NULL pointer dereference, address: 0000000000000000 [ 225.934903] #PF: supervisor instruction fetch in kernel mode [ 225.935639] #PF: error_code(0x0010) - not-present page [ 225.936361] PGD 0 P4D 0 [ 225.936677] Oops: 0010 [#1] PREEMPT SMP DEBUG_PAGEALLOC KASAN PTI [ 225.937525] CPU: 27 PID: 1133 Comm: mount Not tainted 5.16.0-rc3+ #706 [ 225.938416] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-2.module_el8.4.0+547+a85d02ba 04/01/2014 [ 225.939922] RIP: 0010:0x0 [ 225.940289] Code: Unable to access opcode bytes at RIP 0xffffffffffffffd6. [ 225.941196] RSP: 0018:ffff88815897eff0 EFLAGS: 00010246 [ 225.941897] RAX: 0000000000000000 RBX: 0000000000092800 RCX: ffffffff81370a39 [ 225.942813] RDX: dffffc0000000000 RSI: 0000000000000000 RDI: 0000000000092800 [ 225.943772] RBP: 1ffff1102b12fe04 R08: fffffbfff0b43c01 R09: fffffbfff0b43c01 [ 225.944807] R10: ffffffff85a1e007 R11: fffffbfff0b43c00 R12: ffff88810eaaaf58 [ 225.945757] R13: 0000000000000000 R14: ffff88810eaaafb8 R15: ffff88815897f040 [ 225.946709] FS: 00007ff3f2505080(0000) GS:ffff888fb5e00000(0000) knlGS:0000000000000000 [ 225.947814] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 225.948556] CR2: ffffffffffffffd6 CR3: 000000015aa5a006 CR4: 0000000000370ee0 [ 225.949537] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 225.950455] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 225.951414] Call Trace: [ 225.951787] [ 225.952120] mempool_alloc+0xe5/0x250 [ 225.952625] ? mempool_resize+0x370/0x370 [ 225.953187] ? rcu_read_lock_sched_held+0xa1/0xd0 [ 225.953862] ? rcu_read_lock_bh_held+0xb0/0xb0 [ 225.954464] ? sched_clock_cpu+0x15/0x120 [ 225.955019] ? find_held_lock+0xac/0xd0 [ 225.955564] bio_alloc_bioset+0x1ed/0x2a0 [ 225.956080] ? lock_downgrade+0x3a0/0x3a0 [ 225.956644] ? bvec_alloc+0xc0/0xc0 [ 225.957135] bio_clone_fast+0x19/0x80 [ 225.957651] raid5_make_request+0x1370/0x1b70 [ 225.958286] ? sched_clock_cpu+0x15/0x120 [ 225.958797] ? __lock_acquire+0x8b2/0x3510 [ 225.959339] ? raid5_get_active_stripe+0xce0/0xce0 [ 225.959986] ? lock_is_held_type+0xd8/0x130 [ 225.960528] ? rcu_read_lock_sched_held+0xa1/0xd0 [ 225.961135] ? rcu_read_lock_bh_held+0xb0/0xb0 [ 225.961703] ? sched_clock_cpu+0x15/0x120 [ 225.962232] ? lock_release+0x27a/0x6c0 [ 225.962746] ? do_wait_intr_irq+0x130/0x130 [ 225.963302] ? lock_downgrade+0x3a0/0x3a0 [ 225.963815] ? lock_release+0x6c0/0x6c0 [ 225.964348] md_handle_request+0x342/0x530 [ 225.964888] ? set_in_sync+0x170/0x170 [ 225.965397] ? blk_queue_split+0x133/0x150 [ 225.965988] ? __blk_queue_split+0x8b0/0x8b0 [ 225.966524] ? submit_bio_checks+0x3b2/0x9d0 [ 225.967069] md_submit_bio+0x127/0x1c0 [...] Fix this by moving alloc/free of acct bioset to pers->run and pers->free. While we are on this, properly handle md_integrity_register() error in raid0_run(). Fixes: daee2024715d (md: check level before create and exit io_acct_set) Cc: stable@vger.kernel.org Acked-by: Guoqing Jiang Signed-off-by: Xiao Ni Signed-off-by: Song Liu commit 36dacddbf0bdba86cd00f066b4d724157eeb63f1 Author: Dirk Müller Date: Wed Jan 5 17:38:47 2022 +0100 lib/raid6: Use strict priority ranking for pq gen() benchmarking On x86_64, currently 3 variants of AVX512, 3 variants of AVX2 and 3 variants of SSE2 are benchmarked on initialization, taking between 144-153 jiffies. Testing across a hardware pool of various generations of intel cpus I could not find a single case where SSE2 won over AVX2 or AVX512. There are cases where AVX2 wins over AVX512 however. Change "prefer" into an integer priority field (similar to how recov selection works) to have more than one ranking level available, which is backwards compatible with existing behavior. Give AVX2/512 variants higher priority over SSE2 in order to skip SSE testing when AVX is available. in a AVX2/x86_64/HZ=250 case this saves in the order of 200ms of initialization time. Signed-off-by: Dirk Müller Acked-by: Paul Menzel Signed-off-by: Song Liu commit 38640c480939d56cc8b03d58642fc5261761a697 Author: Dirk Müller Date: Wed Jan 5 17:38:46 2022 +0100 lib/raid6: skip benchmark of non-chosen xor_syndrome functions In commit fe5cbc6e06c7 ("md/raid6 algorithms: delta syndrome functions") a xor_syndrome() benchmarking was added also to the raid6_choose_gen() function. However, the results of that benchmarking were intentionally discarded and did not influence the choice. It picked the xor_syndrome() variant related to the best performing gen_syndrome(). Reduce runtime of raid6_choose_gen() without modifying its outcome by only benchmarking the xor_syndrome() of the best gen_syndrome() variant. For a HZ=250 x86_64 system with avx2 and without avx512 this removes 5 out of 6 xor() benchmarks, saving 340ms of raid6 initialization time. Signed-off-by: Dirk Müller Signed-off-by: Song Liu commit dd3dc5f416b7247a4b5d7bac6698be623c180572 Author: Randy Dunlap Date: Sat Dec 25 18:24:11 2021 -0800 md: fix spelling of "its" Use the possessive "its" instead of the contraction "it's" in printed messages. Signed-off-by: Randy Dunlap Cc: Song Liu Cc: linux-raid@vger.kernel.org Signed-off-by: Song Liu commit bf2c411bb1cfc45f73eb6c55b5755bcb990063ae Author: Vishal Verma Date: Tue Dec 21 20:06:22 2021 +0000 md: raid456 add nowait support Returns EAGAIN in case the raid456 driver would block waiting for reshape. Reviewed-by: Jens Axboe Signed-off-by: Vishal Verma Signed-off-by: Song Liu commit c9aa889b035fca4598ae985a0f0c76ebbb547ad2 Author: Vishal Verma Date: Tue Dec 21 20:06:21 2021 +0000 md: raid10 add nowait support This adds nowait support to the RAID10 driver. Very similar to raid1 driver changes. It makes RAID10 driver return with EAGAIN for situations where it could wait for eg: - Waiting for the barrier, - Reshape operation, - Discard operation. wait_barrier() and regular_request_wait() fn are modified to return bool to support error for wait barriers. They returns true in case of wait or if wait is not required and returns false if wait was required but not performed to support nowait. Reviewed-by: Jens Axboe Signed-off-by: Vishal Verma Signed-off-by: Song Liu commit 5aa705039c4fca84575539bfa2b8a28454a3d2ca Author: Vishal Verma Date: Tue Dec 21 20:06:20 2021 +0000 md: raid1 add nowait support This adds nowait support to the RAID1 driver. It makes RAID1 driver return with EAGAIN for situations where it could wait for eg: - Waiting for the barrier, wait_barrier() fn is modified to return bool to support error for wait barriers. It returns true in case of wait or if wait is not required and returns false if wait was required but not performed to support nowait. Reviewed-by: Jens Axboe Signed-off-by: Vishal Verma Signed-off-by: Song Liu commit f51d46d0e7cb5b8494aa534d276a9d8915a2443d Author: Vishal Verma Date: Tue Dec 21 20:06:19 2021 +0000 md: add support for REQ_NOWAIT commit 021a24460dc2 ("block: add QUEUE_FLAG_NOWAIT") added support for checking whether a given bdev supports handling of REQ_NOWAIT or not. Since then commit 6abc49468eea ("dm: add support for REQ_NOWAIT and enable it for linear target") added support for REQ_NOWAIT for dm. This uses a similar approach to incorporate REQ_NOWAIT for md based bios. This patch was tested using t/io_uring tool within FIO. A nvme drive was partitioned into 2 partitions and a simple raid 0 configuration /dev/md0 was created. md0 : active raid0 nvme4n1p1[1] nvme4n1p2[0] 937423872 blocks super 1.2 512k chunks Before patch: $ ./t/io_uring /dev/md0 -p 0 -a 0 -d 1 -r 100 Running top while the above runs: $ ps -eL | grep $(pidof io_uring) 38396 38396 pts/2 00:00:00 io_uring 38396 38397 pts/2 00:00:15 io_uring 38396 38398 pts/2 00:00:13 iou-wrk-38397 We can see iou-wrk-38397 io worker thread created which gets created when io_uring sees that the underlying device (/dev/md0 in this case) doesn't support nowait. After patch: $ ./t/io_uring /dev/md0 -p 0 -a 0 -d 1 -r 100 Running top while the above runs: $ ps -eL | grep $(pidof io_uring) 38341 38341 pts/2 00:10:22 io_uring 38341 38342 pts/2 00:10:37 io_uring After running this patch, we don't see any io worker thread being created which indicated that io_uring saw that the underlying device does support nowait. This is the exact behaviour noticed on a dm device which also supports nowait. For all the other raid personalities except raid0, we would need to train pieces which involves make_request fn in order for them to correctly handle REQ_NOWAIT. Reviewed-by: Jens Axboe Signed-off-by: Vishal Verma Signed-off-by: Song Liu commit a92ce0feffeed8b91f02dac85246d1205e4a64b6 Author: Mariusz Tkaczyk Date: Fri Dec 17 10:29:55 2021 +0100 md: drop queue limitation for RAID1 and RAID10 As suggested by Neil Brown[1], this limitation seems to be deprecated. With plugging in use, writes are processed behind the raid thread and conf->pending_count is not increased. This limitation occurs only if caller doesn't use plugs. It can be avoided and often it is (with plugging). There are no reports that queue is growing to enormous size so remove queue limitation for non-plugged IOs too. [1] https://lore.kernel.org/linux-raid/162496301481.7211.18031090130574610495@noble.neil.brown.name Signed-off-by: Mariusz Tkaczyk Signed-off-by: Song Liu commit 770b1d216d7371c94c88713824da4be4bc39a4e0 Author: Davidlohr Bueso Date: Mon Nov 15 17:23:17 2021 -0800 md/raid5: play nice with PREEMPT_RT raid_run_ops() relies on the implicitly disabled preemption for its percpu ops, although this is really about CPU locality. This breaks RT semantics as it can take regular (and thus sleeping) spinlocks, such as stripe_lock. Add a local_lock such that non-RT does not change and continues to be just map to preempt_disable/enable, but makes RT happy as the region will use a per-CPU spinlock and thus be preemptible and still guarantee CPU locality. Signed-off-by: Davidlohr Bueso Signed-off-by: Song Liu commit 7112550890d7e415188a3351ec0a140be60f6deb Author: Ajit Kumar Pandey Date: Thu Jan 6 20:35:21 2022 +0530 ASoC: amd: acp: acp-mach: Change default RT1019 amp dev id RT1019 components was initially registered with i2c1 and i2c2 but now changed to i2c0 and i2c1 in most of our AMD platforms. Change default rt1019 components to 10EC1019:00 and 10EC1019:01 which is aligned with most of AMD machines. Any exception to rt1019 device ids in near future board design can be handled using dmi based quirk for that machine. Signed-off-by: Ajit Kumar Pandey Link: https://lore.kernel.org/r/20220106150525.396170-1-AjitKumar.Pandey@amd.com Signed-off-by: Mark Brown commit f8039ea55d4ccac2238a247a574f0acb3bc1dc4b Author: Vinod Koul Date: Mon Jan 3 12:41:18 2022 +0530 spi: qcom: geni: handle timeout for gpi mode We missed adding handle_err for gpi mode, so add a new function spi_geni_handle_err() which would call handle_fifo_timeout() or newly added handle_gpi_timeout() based on mode Fixes: b59c122484ec ("spi: spi-geni-qcom: Add support for GPI dma") Reported-by: Douglas Anderson Reviewed-by: Douglas Anderson Signed-off-by: Vinod Koul Link: https://lore.kernel.org/r/20220103071118.27220-2-vkoul@kernel.org Signed-off-by: Mark Brown commit 74b86d6af81be73bb74995ebeba74417e84b6b6f Author: Vinod Koul Date: Mon Jan 3 12:41:17 2022 +0530 spi: qcom: geni: set the error code for gpi transfer Before we invoke spi_finalize_current_transfer() in spi_gsi_callback_result() we should set the spi->cur_msg->status as appropriate (0 for success, error otherwise). The helps to return error on transfer and not wait till it timesout on error Fixes: b59c122484ec ("spi: spi-geni-qcom: Add support for GPI dma") Signed-off-by: Vinod Koul Reviewed-by: Douglas Anderson Link: https://lore.kernel.org/r/20220103071118.27220-1-vkoul@kernel.org Signed-off-by: Mark Brown commit 4b46daf028e2f4a051047791b8a3bfc9bc37d684 Author: Stefan Sauer Date: Thu Jan 6 13:38:21 2022 +0100 ALSA: virmidi: Remove duplicated code seq_virmidi.c: snd_virmidi_new() is already setting seq_mode to SNDRV_VIRMIDI_SEQ_DISPATCH. Signed-off-by: Stefan Sauer Link: https://lore.kernel.org/r/20220106123821.16691-1-st_kost@gmx.de Signed-off-by: Takashi Iwai commit 7560ee032b3f87fa5c4f03e99a064c6cd326951e Author: Stefan Sauer Date: Thu Jan 6 13:41:45 2022 +0100 ALSA: seq: virmidi: Add a drain operation If a driver does not supply a drain operation for outputs, a default code path will execute msleep(50). Especially for a virtual midi device this severely limmits the throughput. This implementation for the virtual midi driver simply flushes the output workqueue. Signed-off-by: Stefan Sauer Link: https://lore.kernel.org/r/20220106124145.17254-1-st_kost@gmx.de Signed-off-by: Takashi Iwai commit 93a770b7e16772530196674ffc79bb13fa927dc6 Author: Lukas Wunner Date: Sun Jan 2 18:52:44 2022 +0100 serial: core: Keep mctrl register state and cached copy in sync struct uart_port contains a cached copy of the Modem Control signals. It is used to skip register writes in uart_update_mctrl() if the new signal state equals the old signal state. It also avoids a register read to obtain the current state of output signals. When a uart_port is registered, uart_configure_port() changes signal state but neglects to keep the cached copy in sync. That may cause a subsequent register write to be incorrectly skipped. Fix it before it trips somebody up. This behavior has been present ever since the serial core was introduced in 2002: https://git.kernel.org/history/history/c/33c0d1b0c3eb So far it was never an issue because the cached copy is initialized to 0 by kzalloc() and when uart_configure_port() is executed, at most DTR has been set by uart_set_options() or sunsu_console_setup(). Therefore, a stable designation seems unnecessary. Signed-off-by: Lukas Wunner Link: https://lore.kernel.org/r/bceeaba030b028ed810272d55d5fc6f3656ddddb.1641129752.git.lukas@wunner.de Signed-off-by: Greg Kroah-Hartman commit 195437d14fb424a2ee50d51441181f16fd549789 Author: Valentin Caron Date: Tue Jan 4 19:24:45 2022 +0100 serial: stm32: correct loop for dma error handling In this error handling, "transmit_chars_dma" function will call "transmit_chars_pio" once per characters. But "transmit_chars_pio" will continue to send characters while xmit buffer is not empty. Remove this useless loop, one call is sufficient. Signed-off-by: Valentin Caron Link: https://lore.kernel.org/r/20220104182445.4195-5-valentin.caron@foss.st.com Signed-off-by: Greg Kroah-Hartman commit 2a3bcfe03725472607110507b6860d823e0deb41 Author: Valentin Caron Date: Tue Jan 4 19:24:44 2022 +0100 serial: stm32: fix flow control transfer in DMA mode If flow control is enabled, framework will call stop_tx to pause transfer and then call start_tx to resume transfer. Clear USART_CR3_DMAT bit in stop_tx ops to pause DMA transfer. Signed-off-by: Erwan Le Ray Signed-off-by: Valentin Caron Link: https://lore.kernel.org/r/20220104182445.4195-4-valentin.caron@foss.st.com Signed-off-by: Greg Kroah-Hartman commit 9a135f16d228857c5c1212a58050196883343d1e Author: Valentin Caron Date: Tue Jan 4 19:24:43 2022 +0100 serial: stm32: rework TX DMA state condition TX DMA state condition is handled by tx_dma_busy boolean. This boolean is set when dma descriptor is requested and reset when dma channel is stopped (dma_terminate). In stm32_usart_serial_remove(), stm32_usart_stop_tx() and stm32_usart_transmit_chars_dma() fallback error case, DMA channel is stopped but tx_dma_busy is not handled. Rework the driver by using two new functions to solve this issue: - stm32_usart_tx_dma_started return true if DMA TX have a descriptor. - stm32_usart_tx_dma_enabled return true if DMAT bit is set. stm32_usart_tx_dma_started uses tx_dma_busy flag to prevent dual DMA transaction at the same time. This flag is set when a DMA transaction begins and is unset when dmaengine_terminate_async function is called. A new DMA transaction cannot be created if this flag is set. Create a new function "stm32_usart_tx_dma_terminate" to be sure the flag is unset after each call of dmaengine_terminate_async. Signed-off-by: Erwan Le Ray Signed-off-by: Valentin Caron Link: https://lore.kernel.org/r/20220104182445.4195-3-valentin.caron@foss.st.com Signed-off-by: Greg Kroah-Hartman commit 56a23f9319e86e1d62a109896e2c7e52c414e67d Author: Valentin Caron Date: Tue Jan 4 19:24:42 2022 +0100 serial: stm32: move tx dma terminate DMA to shutdown Terminate DMA transaction and clear CR3_DMAT when shutdown is requested, instead of when remove is requested. If DMA transfer is not stopped in shutdown ops, driver will fail to start a new DMA transfer after next startup ops. Fixes: 3489187204eb ("serial: stm32: adding dma support") Signed-off-by: Erwan Le Ray Signed-off-by: Valentin Caron Link: https://lore.kernel.org/r/20220104182445.4195-2-valentin.caron@foss.st.com Signed-off-by: Greg Kroah-Hartman commit 49a80424e3ec23ee2748f360348e167d5c748256 Author: Lukas Wunner Date: Sun Jan 2 18:49:44 2022 +0100 serial: pl011: Drop redundant DTR/RTS preservation on close/open Commit d8d8ffa47783 ("amba-pl011: do not disable RTS during shutdown") amended the PL011 serial driver to leave DTR/RTS polarity untouched on tty close. That change made sense. But the commit also added code to save DTR/RTS state to an internal variable on tty close and restore it on tty open. That part of the commit makes less sense: The driver has no ->pm() callback, so the uart remains powered after tty close and automatically preserves register state, including DTR/RTS. Saving and restoring registers isn't the job of the ->startup() and ->shutdown() callbacks anyway. Rather, it should happen in ->pm(). Additionally, after pl011_startup() restores the state, the serial core overrides it in uart_port_dtr_rts() if a baud rate has been set: tty_port_open() uart_port_activate() uart_startup() uart_port_startup() pl011_startup() # restores DTR/RTS from uap->old_cr tty_port_block_til_ready() tty_port_raise_dtr_rts # if (C_BAUD(tty)) uart_dtr_rts() uart_port_dtr_rts() # raises DTR/RTS The serial core also overrides DTR/RTS on tty close in uart_shutdown() if C_HUPCL(tty) is set. So a user-defined DTR/RTS polarity won't survive a close/open cycle anyway, unless the user has set the baud rate to zero and disabled hupcl on the tty. Bottom line is, the code to save and restore DTR/RTS has no effect. Remove it. Cc: Linus Walleij Cc: Russell King Signed-off-by: Lukas Wunner Link: https://lore.kernel.org/r/e22089ab49e6e78822c50c8c4db46bf3ee885623.1641129328.git.lukas@wunner.de Signed-off-by: Greg Kroah-Hartman commit e368cc656fd6d0075f1c3ab9676e2001451e3e04 Author: Lukas Wunner Date: Sun Jan 2 18:45:44 2022 +0100 serial: pl011: Drop CR register reset on set_termios pl011_set_termios() briefly resets the CR register to zero, thereby glitching DTR/RTS signals. With rs485 this may result in the bus being occupied for no reason. Where does this register write originate from? The PL011 driver was forked from the PL010 driver in 2004: https://git.kernel.org/history/history/c/157c0342e591 Until this commit, the PL010 driver's IRQ handler ambauart_int() modified the CR register without holding the port spinlock. ambauart_set_termios() also modified that register. To prevent concurrent read-modify-writes by the IRQ handler and to prevent transmission while changing baudrate, ambauart_set_termios() had to disable interrupts. On the PL010, that is achieved by writing zero to the CR register. However, on the PL011, interrupts are disabled in the IMSC register, not in the CR register. Additionally, the commit amended both the PL010 and PL011 driver to acquire the port spinlock in the IRQ handler, obviating the need to disable interrupts in ->set_termios(). So the CR register write is obsolete for two reasons. Drop it. Cc: Russell King Signed-off-by: Lukas Wunner Link: https://lore.kernel.org/r/f49f945375f5ccb979893c49f1129f51651ac738.1641129062.git.lukas@wunner.de Signed-off-by: Greg Kroah-Hartman commit 08a0c6dff91c965e39905cf200d22db989203ccb Author: Lukas Wunner Date: Sun Jan 2 18:42:44 2022 +0100 serial: pl010: Drop CR register reset on set_termios pl010_set_termios() briefly resets the CR register to zero. Where does this register write come from? The PL010 driver's IRQ handler ambauart_int() originally modified the CR register without holding the port spinlock. ambauart_set_termios() also modified that register. To prevent concurrent read-modify-writes by the IRQ handler and to prevent transmission while changing baudrate, ambauart_set_termios() had to disable interrupts. That is achieved by writing zero to the CR register. However in 2004 the PL010 driver was amended to acquire the port spinlock in the IRQ handler, obviating the need to disable interrupts in ->set_termios(): https://git.kernel.org/history/history/c/157c0342e591 That rendered the CR register write obsolete. Drop it. Cc: Russell King Signed-off-by: Lukas Wunner Link: https://lore.kernel.org/r/fcaff16e5b1abb4cc3da5a2879ac13f278b99ed0.1641128728.git.lukas@wunner.de Signed-off-by: Greg Kroah-Hartman commit 556172fabd226ba14b70c1740d0826a4717473dc Author: Alyssa Ross Date: Tue Jan 4 13:10:28 2022 +0000 serial: liteuart: fix MODULE_ALIAS modprobe can't handle spaces in aliases. Fixes: 1da81e5562fa ("drivers/tty/serial: add LiteUART driver") Signed-off-by: Alyssa Ross Link: https://lore.kernel.org/r/20220104131030.1674733-1-hi@alyssa.is Signed-off-by: Greg Kroah-Hartman commit 0e479b460e342c5fe138391b29d7bfa0a6204af2 Author: Lad Prabhakar Date: Wed Jan 5 18:07:03 2022 +0000 serial: 8250_bcm7271: Fix return error code in case of dma_alloc_coherent() failure In case of dma_alloc_coherent() failure return -ENOMEM instead of returning -EINVAL. Reported-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Acked-by: Florian Fainelli Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20220105180704.8989-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Greg Kroah-Hartman commit 663d8fb0f84c0f3aade8974fbf3a2ddb255f54a5 Author: William Breathitt Gray Date: Wed Jan 5 18:30:52 2022 +0900 counter: 104-quad-8: Fix use-after-free by quad8_irq_handler On unbind an irq might be pending which results in quad8_irq_handler() calling counter_push_event() for a counter that is already unregistered. This patch fixes that situation by passing the struct counter_device dev to devm_request_irq() rather than the parent's so that the irq handler is cleaned before the counter is unregistered. Fixes: 7aa2ba0df651 ("counter: 104-quad-8: Add IRQ support for the ACCES 104-QUAD-8") Cc: Syed Nayyar Waris Reported-by: Uwe Kleine-König Signed-off-by: William Breathitt Gray Link: https://lore.kernel.org/r/20220105093052.258791-1-vilhelm.gray@gmail.com Signed-off-by: Greg Kroah-Hartman commit eaac0b590a47c717ef36cbfd1c528cd154c965a1 Author: Greg Kroah-Hartman Date: Thu Jan 6 11:02:31 2022 +0100 dm sysfs: use default_groups in kobj_type There are currently 2 ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the dm sysfs code to use default_groups field which has been the preferred way since aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field. Signed-off-by: Greg Kroah-Hartman Signed-off-by: Mike Snitzer commit f069c7ab6cfb07edf9e3dc2071928225587794f1 Author: Kees Cook Date: Mon Dec 13 14:33:25 2021 -0800 dm integrity: Use struct_group() to zero struct journal_sector In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Add struct_group() to mark region of struct journal_sector that should be initialized to zero. Signed-off-by: Kees Cook Signed-off-by: Mike Snitzer commit 0589e8889dce8e0f0ea5bbf757f38865e2a469c1 Author: Miaoqian Lin Date: Fri Dec 31 08:04:25 2021 +0000 drivers/firmware: Add missing platform_device_put() in sysfb_create_simplefb Add the missing platform_device_put() before return from sysfb_create_simplefb() in the error handling case. Fixes: 8633ef82f101 ("drivers/firmware: consolidate EFI framebuffer setup for all arches") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20211231080431.15385-1-linmq006@gmail.com Signed-off-by: Greg Kroah-Hartman commit 358fcf5ddbec4e6706405847d6a666f5933a6c25 Author: Michal Suchanek Date: Tue Jan 4 18:05:05 2022 +0100 debugfs: lockdown: Allow reading debugfs files that are not world readable When the kernel is locked down the kernel allows reading only debugfs files with mode 444. Mode 400 is also valid but is not allowed. Make the 444 into a mask. Fixes: 5496197f9b08 ("debugfs: Restrict debugfs when the kernel is locked down") Signed-off-by: Michal Suchanek Link: https://lore.kernel.org/r/20220104170505.10248-1-msuchanek@suse.de Signed-off-by: Greg Kroah-Hartman commit 00eb74ea2c14418042347eaa34c6b73ac6ec1e76 Author: Lu Baolu Date: Fri Dec 31 11:39:01 2021 +0800 driver core: Make bus notifiers in right order in really_probe() If a driver cannot be bound to a device, the correct bus notifier order should be: - BUS_NOTIFY_BIND_DRIVER: driver is about to be bound - BUS_NOTIFY_DRIVER_NOT_BOUND: driver failed to be bound or no notifier if the failure happens before the actual binding. The really_probe() notifies a BUS_NOTIFY_DRIVER_NOT_BOUND event without a BUS_NOTIFY_BIND_DRIVER if .dma_configure() returns failure. This change makes the notifiers in order. Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20211231033901.2168664-3-baolu.lu@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 885e50253bfd6750327a265405461496d6af1639 Author: Lu Baolu Date: Fri Dec 31 11:39:00 2021 +0800 driver core: Move driver_sysfs_remove() after driver_sysfs_add() The driver_sysfs_remove() should be called after driver_sysfs_add() in really_probe(). The out-of-order driver_sysfs_remove() tries to remove some nonexistent nodes under the device and driver sysfs nodes. This is allowed, hence this change doesn't fix any problem, just a cleanup. Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20211231033901.2168664-2-baolu.lu@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 33812fc7c8d77a43b7e2bf36a0d5a57c277a4b0c Author: Christophe JAILLET Date: Tue Dec 28 22:09:17 2021 +0100 HID: magicmouse: Fix an error handling path in magicmouse_probe() If the timer introduced by the commit below is started, then it must be deleted in the error handling of the probe. Otherwise it would trigger once the driver is no more. Fixes: 0b91b4e4dae6 ("HID: magicmouse: Report battery level over USB") Signed-off-by: Christophe JAILLET Tested-by: José Expósito Reported-by: Signed-off-by: Jiri Kosina commit 3809fe479861194e310c23ed48b010c7c0f72d22 Author: Lukas Bulwahn Date: Thu Dec 16 10:21:57 2021 +0100 HID: address kernel-doc warnings The command ./scripts/kernel-doc -none include/linux/hid.h reports: include/linux/hid.h:818: warning: cannot understand function prototype: 'struct hid_ll_driver ' include/linux/hid.h:1135: warning: expecting prototype for hid_may_wakeup(). Prototype was for hid_hw_may_wakeup() instead Address those kernel-doc warnings. Signed-off-by: Lukas Bulwahn Signed-off-by: Jiri Kosina commit 98b6b62cd5569a158868b62dc7866b5aae5d9a38 Author: Yang Li Date: Thu Dec 16 12:01:46 2021 +0800 HID: intel-ish-hid: ishtp-fw-loader: Fix a kernel-doc formatting issue This function had kernel-doc that not used a hash to separate the function name from the one line description. The warning was found by running scripts/kernel-doc, which is caused by using 'make W=1'. drivers/hid/intel-ish-hid/ishtp-fw-loader.c:271: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Jiri Kosina commit bcad6d1bd9177740176ea79f6d0fc9f5b07e0c43 Author: Ye Xiang Date: Fri Dec 17 15:45:41 2021 +0800 HID: intel-ish-hid: ipc: Specify no cache snooping on TGL and ADL Specify that both TGL and ADL don't support DMA cache snooping. Signed-off-by: Ye Xiang Signed-off-by: Jiri Kosina commit aa320fdbbbb482c19100f51461bd0069753ce3d7 Author: José Expósito Date: Wed Jan 5 18:29:15 2022 +0100 HID: hid-uclogic-params: Invalid parameter check in uclogic_params_frame_init_v1_buttonpad The function performs a check on the hdev input parameters, however, it is used before the check. Initialize the udev variable after the sanity check to avoid a possible NULL pointer dereference. Fixes: 9614219e9310e ("HID: uclogic: Extract tablet parameter discovery into a module") Addresses-Coverity-ID: 1443763 ("Null pointer dereference") Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit ff6b548afe4d9d1ff3a0f6ef79e8cbca25d8f905 Author: José Expósito Date: Wed Jan 5 18:29:14 2022 +0100 HID: hid-uclogic-params: Invalid parameter check in uclogic_params_huion_init The function performs a check on its input parameters, however, the hdev parameter is used before the check. Initialize the stack variables after checking the input parameters to avoid a possible NULL pointer dereference. Fixes: 9614219e9310e ("HID: uclogic: Extract tablet parameter discovery into a module") Addresses-Coverity-ID: 1443804 ("Null pointer dereference") Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit 0a94131d6920916ccb6a357037c535533af08819 Author: José Expósito Date: Wed Jan 5 18:29:13 2022 +0100 HID: hid-uclogic-params: Invalid parameter check in uclogic_params_get_str_desc The function performs a check on the hdev input parameters, however, it is used before the check. Initialize the udev variable after the sanity check to avoid a possible NULL pointer dereference. Fixes: 9614219e9310e ("HID: uclogic: Extract tablet parameter discovery into a module") Addresses-Coverity-ID: 1443827 ("Null pointer dereference") Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit f364c571a5c77e96de2d32062ff019d6b8d2e2bc Author: José Expósito Date: Wed Jan 5 18:29:12 2022 +0100 HID: hid-uclogic-params: Invalid parameter check in uclogic_params_init The function performs a check on its input parameters, however, the hdev parameter is used before the check. Initialize the stack variables after checking the input parameters to avoid a possible NULL pointer dereference. Fixes: 9614219e9310e ("HID: uclogic: Extract tablet parameter discovery into a module") Addresses-Coverity-ID: 1443831 ("Null pointer dereference") Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit 601a5bc1aeef772ab1f47582fd322957799f5ab5 Author: Pavel Hofman Date: Wed Jan 5 11:46:43 2022 +0100 usb: gadget: u_audio: Subdevice 0 for capture ctls Both capture and playback alsa devices use subdevice 0. Yet capture-side ctls are defined for subdevice 1. The patch sets subdevice 0 for them. Fixes: 02de698ca812 ("usb: gadget: u_audio: add bi-directional volume and mute support") Signed-off-by: Pavel Hofman Link: https://lore.kernel.org/r/20220105104643.90125-1-pavel.hofman@ivitera.com Signed-off-by: Greg Kroah-Hartman commit f2f69bf65df12176843ca11eab99949ba69e128b Author: John Keeping Date: Tue Jan 4 18:32:42 2022 +0000 usb: gadget: u_audio: fix calculations for small bInterval If bInterval is 1, then p_interval is 8000 and p_interval_mil is 8E9, which is too big for a 32-bit value. While the storage is indeed 64-bit, this value is used as the divisor in do_div() which will truncate it into a uint32_t leading to incorrect calculated values. Switch back to keeping the base value in struct snd_uac_chip which fits easily into an int, meaning that the division can be done in two steps with the divisor fitting safely into a uint32_t on both steps. Fixes: 6fec018a7e70 ("usb: gadget: u_audio.c: Adding Playback Pitch ctl for sync playback") Tested-by: Pavel Hofman Signed-off-by: John Keeping Link: https://lore.kernel.org/r/20220104183243.718258-1-john@metanate.com Signed-off-by: Greg Kroah-Hartman commit 92ef98a4caacad6d4a1490dda45d81ae5ccf5bc9 Author: John Keeping Date: Thu Jan 6 11:57:31 2022 +0000 usb: dwc2: gadget: initialize max_speed from params DWC2 may be paired with a full-speed PHY which is not capable of high-speed operation. Report this correctly to the gadget core by setting max_speed from the core parameters. Prior to commit 5324bad66f09f ("usb: dwc2: gadget: implement udc_set_speed()") this didn't cause the hardware to be configured incorrectly, although the speed may have been reported incorrectly. But after that commit params.speed is updated based on a value passed in by the gadget core which may set it to a faster speed than is supported by the hardware. Initialising the max_speed parameter ensures the speed passed to dwc2_gadget_set_speed() will be one supported by the hardware. Fixes: 5324bad66f09f ("usb: dwc2: gadget: implement udc_set_speed()") Acked-by: Minas Harutyunyan Signed-off-by: John Keeping Link: https://lore.kernel.org/r/20220106115731.1473909-1-john@metanate.com Signed-off-by: Greg Kroah-Hartman commit 34146c68083f1aef6709196b3dc888c1ceffd357 Author: Dinh Nguyen Date: Tue Jan 4 07:59:22 2022 -0600 usb: dwc2: do not gate off the hardware if it does not support clock gating We should not be clearing the HCD_FLAG_HW_ACCESSIBLE bit if the hardware does not support clock gating. Fixes: 50fb0c128b6e ("usb: dwc2: Add clock gating entering flow by system suspend") Acked-by: Minas Harutyunyan Signed-off-by: Dinh Nguyen Link: https://lore.kernel.org/r/20220104135922.734776-1-dinguyen@kernel.org Signed-off-by: Greg Kroah-Hartman commit b52fe2dbb3e655eb1483000adfab68a219549e13 Author: Miaoqian Lin Date: Wed Dec 22 11:18:23 2021 +0000 usb: dwc3: qcom: Fix NULL vs IS_ERR checking in dwc3_qcom_probe Since the acpi_create_platform_device() function may return error pointers, dwc3_qcom_create_urs_usb_platdev() function may return error pointers too. Using IS_ERR_OR_NULL() to check the return value to fix this. Fixes: c25c210f590e ("usb: dwc3: qcom: add URS Host support for sdm845 ACPI boot") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20211222111823.22887-1-linmq006@gmail.com Signed-off-by: Greg Kroah-Hartman commit fa783154524a71ab74e293cd8251155e5971952b Author: Alberto Merciai Date: Tue Jan 4 17:09:39 2022 +0100 staging: r8188eu: rename camelcase variable uintPeerChannel Rename camelcase hungarian notated variable uintPeerChannel into peer_channel. Signed-off-by: Alberto Merciai Link: https://lore.kernel.org/r/20220104160945.460113-1-alb3rt0.m3rciai@gmail.com Signed-off-by: Greg Kroah-Hartman commit 27aad6cef4b54f8fa8ea5cf0ef8acf2aa8058992 Author: Martin Kaiser Date: Wed Jan 5 09:34:26 2022 +0100 staging: r8188eu: make BW20_24G_Diff a 1-D array Make BW20_24G_Diff a one-dimensional array. This driver uses only BW20_24G_Diff[0]. Acked-by: Michael Straube Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220105083426.177128-8-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 2c02b728b648bab403fc9316fc984b5eab643395 Author: Martin Kaiser Date: Wed Jan 5 09:34:25 2022 +0100 staging: r8188eu: make OFDM_24G_Diff a 1-D array Make OFDM_24G_Diff one-dimensional array. This driver uses only OFDM_24G_Diff[0]. Acked-by: Michael Straube Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220105083426.177128-7-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 41b7c4edff83bb2d8f622a0b426fefc6b076c42b Author: Martin Kaiser Date: Wed Jan 5 09:34:24 2022 +0100 staging: r8188eu: BW40_24G_Diff is set but not used The BW40_24G_Diff array is set but not used. Remove it. Acked-by: Michael Straube Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220105083426.177128-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit ef2efa86392a93c1d31a66dd8748eeaf78cb8ae0 Author: Martin Kaiser Date: Wed Jan 5 09:34:23 2022 +0100 staging: r8188eu: CCK_24G_Diff is set but not used The CCK_24G_Diff array is set but not used. Remove it. Acked-by: Michael Straube Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220105083426.177128-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit eeb35e4a2742e2a977d3d540873c25bd50dd2fbc Author: Martin Kaiser Date: Wed Jan 5 09:34:22 2022 +0100 staging: r8188eu: make Index24G_BW40_Base a 1-D array Make Index24G_BW40_Base a one-dimensional array. This driver uses only Index24G_BW40_Base[0]. Acked-by: Michael Straube Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220105083426.177128-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit e9a14094c724ab4d519882d6f67ba3e6b9cc38be Author: Martin Kaiser Date: Wed Jan 5 09:34:21 2022 +0100 staging: r8188eu: make Index24G_CCK_Base a 1-D array Make Index24G_CCK_Base a one-dimensional array. This driver uses only Index24G_CCK_Base[0]. Acked-by: Michael Straube Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220105083426.177128-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit d1dfe7fb11598a9575750a711bd2d0d06a2c1325 Author: Martin Kaiser Date: Wed Jan 5 09:34:20 2022 +0100 staging: r8188eu: rfPath is always 0 The rfPath variable in Hal_ReadTxPowerInfo88E is always 0. Remove the variable and use 0 directly. Acked-by: Michael Straube Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220105083426.177128-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 6a0d9b79bff6ff64bf65b66776af88b21c1ff581 Author: Michael Straube Date: Tue Jan 4 10:07:32 2022 +0100 staging: r8188eu: remove unneeded parameter from rtl8188e_SetHalODMVar Function rtl8188e_SetHalODMVar is always called with HAL_ODM_STA_INFO. Remove the unneeded parameter eVariable from the function. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220104090732.13994-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6b2ad1636995895dba74f9c65f4a5cb22fd3f677 Author: Paulo Miguel Almeida Date: Tue Jan 4 12:26:16 2022 +1300 staging: pi433: add comment to rx_lock mutex definition Checkpatch reports: CHECK: struct mutex definition without comment. Fix this by documenting what rx_mutex struct is used for in pi433 driver. Signed-off-by: Paulo Miguel Almeida Link: https://lore.kernel.org/r/20220103232616.GA11161@mail.google.com Signed-off-by: Greg Kroah-Hartman commit 70d8e20c24a4ef42ee200cc7b7b93a01f0ebaa0e Author: Paulo Miguel Almeida Date: Tue Jan 4 11:23:34 2022 +1300 staging: pi433: fix frequency deviation check rf69 datasheet states that frequency deviation must exceed 600 Hz but also that frequency deviation + (bitrate / 2) should be less than equal to 500 kHz to ensure proper modulation. This patch validates that both conditions are met so RF intersymbol interference is less likely to happen due to misconfiguration of the uC Signed-off-by: Paulo Miguel Almeida Link: https://lore.kernel.org/r/20220103222334.GA6814@mail.google.com Signed-off-by: Greg Kroah-Hartman commit 72279d17df54d5e4e7910b39c61a3f3464e36633 Author: Luiz Augusto von Dentz Date: Wed Jan 5 14:59:53 2022 -0800 Bluetooth: hci_event: Rework hci_inquiry_result_with_rssi_evt This rework the handling of hci_inquiry_result_with_rssi_evt to not use a union to represent the different inquiry responses. Signed-off-by: Luiz Augusto von Dentz Tested-by: Soenke Huster Signed-off-by: Marcel Holtmann commit 709c81b55c6aa74a6cdad27bdc224f50962b6ad9 Author: Rob Herring Date: Wed Jan 5 12:32:33 2022 -0600 spi: spi-mux: Add reference to spi-peripheral-props.yaml schema The spi-mux serves as both a SPI peripheral and controller, so add a reference to spi-peripheral-props.yaml in addition to spi-controller.yaml. This is necessary to avoid unevaluatedProperties warnings once those are fully enabled. Signed-off-by: Rob Herring Reviewed-by: Chris Packham Link: https://lore.kernel.org/r/20220105183234.3426649-1-robh@kernel.org Signed-off-by: Mark Brown commit 14e2976fbabdacb01335d7f91eeebbc89c67ddb1 Author: Konrad Dybcio Date: Thu Dec 30 03:34:42 2021 +0100 regulator: qcom_smd: Align probe function with rpmh-regulator The RPMh regulator driver is much newer and gets more attention, which in consequence makes it do a few things better. Update qcom_smd-regulator's probe function to mimic what rpmh-regulator does to address a couple of issues: - Probe defer now works correctly, before it used to, well, kinda just die.. This fixes reliable probing on (at least) PM8994, because Linux apparently cannot deal with supply map dependencies yet.. - Regulator data is now matched more sanely: regulator data is matched against each individual regulator node name and throwing an -EINVAL if data is missing, instead of just assuming everything is fine and iterating over all subsequent array members. - status = "disabled" will now work for disabling individual regulators in DT. Previously it didn't seem to do much if anything at all. Signed-off-by: Konrad Dybcio Link: https://lore.kernel.org/r/20211230023442.1123424-1-konrad.dybcio@somainline.org Signed-off-by: Mark Brown commit 00ac838924f73b51e82994c7fc870f0a994e4d34 Author: Qinghua Jin Date: Thu Jan 6 17:28:47 2022 +0800 ASoC: topology: Fix typo change 'postion' to 'position' Signed-off-by: Qinghua Jin Link: https://lore.kernel.org/r/20220106092847.357035-1-qhjin.dev@gmail.com Signed-off-by: Mark Brown commit 320386343451ab6a3577e0ee200dac56a6182944 Author: Shengjiu Wang Date: Wed Jan 5 19:08:03 2022 +0800 ASoC: fsl_asrc: refine the check of available clock divider According to RM, the clock divider range is from 1 to 8, clock prescaling ratio may be any power of 2 from 1 to 128. So the supported divider is not all the value between 1 and 1024, just limited value in that range. Create table for the supported divder and add function to check the clock divider is available by comparing with the table. Fixes: d0250cf4f2ab ("ASoC: fsl_asrc: Add an option to select internal ratio mode") Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1641380883-20709-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit 44125fd5315154c6b8326b5c27646af3b33ba25c Author: Hans de Goede Date: Thu Jan 6 12:01:28 2022 +0100 ASoC: Intel: bytcr_rt5640: Add support for external GPIO jack-detect Some boards have the codec IRQ hooked-up as normally, so the driver can still do things like headset vs headphones and button-press detection, but instead of using one of the JD pins of the codec, an external GPIO is used to report the jack-presence switch status of the jack. Add support for boards which have this setup and which specify which external GPIO to use in the special Android AMCR0F28 ACPI device. And add a quirk for the Asus TF103C tablet which uses this setup. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220106110128.66049-7-hdegoede@redhat.com Signed-off-by: Mark Brown commit 45ed0166c39f878162872babc88830d91426beb5 Author: Hans de Goede Date: Thu Jan 6 12:01:27 2022 +0100 ASoC: Intel: bytcr_rt5640: Support retrieving the codec IRQ from the AMCR0F28 ACPI dev Some X86 tablets, which ship with Android as factory installed OS, specify codec IRQs/GPIOS in a special Android AMCR0F28 ACPI device. Add support for retrieving the codec IRQ from this ACPI device instead of from the 10EC5640 device describing the codec itself and enable this on Asus MemoPad 7 ME176C tablets. This fixes jack-detect not working on these tablets. Cc: Stephan Gerhold Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220106110128.66049-6-hdegoede@redhat.com Signed-off-by: Mark Brown commit 701d636a224a77a4371f57ca2d4322ab0401a866 Author: Hans de Goede Date: Thu Jan 6 12:01:26 2022 +0100 ASoC: rt5640: Add support for boards with an external jack-detect GPIO Some boards have the codec IRQ hooked-up as normally, so the driver can still do things like headset vs headphones and button-press detection, but instead of using one of the JD pins of the codec, an external GPIO is used to report the jack-presence switch status of the jack. Add support for this. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220106110128.66049-5-hdegoede@redhat.com Signed-off-by: Mark Brown commit b35a9ab4904973a68b4473c2985b8ac0b6d57089 Author: Hans de Goede Date: Thu Jan 6 12:01:25 2022 +0100 ASoC: rt5640: Allow snd_soc_component_set_jack() to override the codec IRQ On some boards where the firmware/fwnode information is in essence read-only (x86 + ACPI boards) the i2c_client for the codec may contain the wrong IRQ or no IRQ at all. Since we only request the IRQ once snd_soc_component_set_jack() gets called, allow machine drivers to override the IRQ with the proper one through the data parameter to snd_soc_component_set_jack(). Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220106110128.66049-4-hdegoede@redhat.com Signed-off-by: Mark Brown commit a3b1aaf7aef9fa945810de3fd7c15b2e93ecdbfd Author: Hans de Goede Date: Thu Jan 6 12:01:24 2022 +0100 ASoC: rt5640: Change jack_work to a delayed_work Change jack_work from a struct work_struct to a struct delayed_work, this is a preparation patch for adding support for boards where an external GPIO is used for jack-detect, rather then one of the JD pins of the codec. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220106110128.66049-3-hdegoede@redhat.com Signed-off-by: Mark Brown commit a2d6d84db2e7bcc831aed90f33334c70a1b060a3 Author: Hans de Goede Date: Thu Jan 6 12:01:23 2022 +0100 ASoC: rt5640: Fix possible NULL pointer deref on resume Commit 2b9c8d2b3c89 ("ASoC: rt5640: Add the HDA header support") adds re-queuing of the jack_work on resume when rt5640->jd_src != 0. But the jack_work will unconditionally deref rt5640->jack and that might be NULL. E.g. the sound/soc/intel/boards/bytcr_rt5640.c machine driver call snd_soc_component_set_jack(codec, NULL, NULL) from pre_suspend to disable the IRQ to avoid spurious wakeups, so when rt5640_resume() runs rt5640->jack will be NULL in this case. Make the queueing of the work conditional on rt5640->jack instead of on rt5640->jd_src to fix this. Fixes: 2b9c8d2b3c89 ("ASoC: rt5640: Add the HDA header support") Cc: Oder Chiou Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220106110128.66049-2-hdegoede@redhat.com Signed-off-by: Mark Brown commit 3969341813eb56d2dfc39bb64229359a6ae3c195 Author: Shengjiu Wang Date: Tue Jan 4 18:40:35 2022 +0800 ASoC: imx-card: improve the sound quality for low rate According to RM, on auto mode: For codec AK4458 and AK4497, the lowest ratio of MLCK/FS is 256 if sample rate is 8kHz-48kHz, For codec AK5558, the lowest ratio of MLCK/FS is 512 if sample rate is 8kHz-48kHz. With these setting the sound quality for 8kHz-48kHz can be improved. Fixes: aa736700f42f ("ASoC: imx-card: Add imx-card machine driver") Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1641292835-19085-4-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit f331ae5fa59fbfb748317b290648fc3f1a50d932 Author: Shengjiu Wang Date: Tue Jan 4 18:40:34 2022 +0800 ASoC: imx-card: Fix mclk calculation issue for akcodec Transfer the refined slots and slot_width to akcodec_get_mclk_rate() for mclk calculation, otherwise the mclk frequency does not match with the slots and slot_width for S16_LE format, because the default slot_width is 32. Fixes: aa736700f42f ("ASoC: imx-card: Add imx-card machine driver") Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1641292835-19085-3-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit 3349b3d0c63b8b6fcca58156d72407f0b2e101ac Author: Shengjiu Wang Date: Tue Jan 4 18:40:33 2022 +0800 ASoC: imx-card: Need special setting for ak4497 on i.MX8MQ The SAI on i.MX8MQ don't support one2one ratio for mclk:bclk, so the mclk frequency exceeds the supported range of codec for the case that sample rate is larger than 705kHZ and format is S32_LE. Update the supported width for such case. Fixes: aa736700f42f ("ASoC: imx-card: Add imx-card machine driver") Signed-off-by: Shengjiu Wang Link: https://lore.kernel.org/r/1641292835-19085-2-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown commit 3318ae23bbcb14b7f68e9006756ba6d970955635 Author: Aditya Garg Date: Mon Jan 3 13:28:42 2022 +0000 Bluetooth: btbcm: disable read tx power for MacBook Air 8,1 and 8,2 The MacBook Air 8,1 and 8,2 also need querying of LE Tx power to be disabled for Bluetooth to work. Signed-off-by: Aditya Garg Signed-off-by: Marcel Holtmann Cc: stable@vger.kernel.org commit 36595d8ad46d9e4c41cc7c48c4405b7c3322deac Author: Wen Gu Date: Thu Jan 6 20:42:08 2022 +0800 net/smc: Reset conn->lgr when link group registration fails SMC connections might fail to be registered in a link group due to unable to find a usable link during its creation. As a result, smc_conn_create() will return a failure and most resources related to the connection won't be applied or initialized, such as conn->abort_work or conn->lnk. If smc_conn_free() is invoked later, it will try to access the uninitialized resources related to the connection, thus causing a warning or crash. This patch tries to fix this by resetting conn->lgr to NULL if an abnormal exit occurs in smc_lgr_register_conn(), thus avoiding the access to uninitialized resources in smc_conn_free(). Meanwhile, the new created link group should be terminated if smc connections can't be registered in it. So smc_lgr_cleanup_early() is modified to take care of link group only and invoked to terminate unusable link group by smc_conn_create(). The call to smc_conn_free() is moved out from smc_lgr_cleanup_early() to smc_conn_abort(). Fixes: 56bc3b2094b4 ("net/smc: assign link to a new connection") Suggested-by: Karsten Graul Signed-off-by: Wen Gu Acked-by: Karsten Graul Signed-off-by: David S. Miller commit 6845667146a28c09b5dfc401c1ad112374087944 Author: Miaoqian Lin Date: Fri Dec 24 08:02:49 2021 +0000 Bluetooth: hci_qca: Fix NULL vs IS_ERR_OR_NULL check in qca_serdev_probe The function devm_gpiod_get_index() return error pointers on error. Thus devm_gpiod_get_index_optional() could return NULL and error pointers. The same as devm_gpiod_get_optional() function. Using IS_ERR_OR_NULL() check to catch error pointers. Fixes: 77131dfe ("Bluetooth: hci_qca: Replace devm_gpiod_get() with devm_gpiod_get_optional()") Signed-off-by: Miaoqian Lin Signed-off-by: Marcel Holtmann commit b38cd3b42fba66cc538edb9cf77e07881f43f8e2 Author: Jiasheng Jiang Date: Fri Dec 24 10:53:18 2021 +0800 Bluetooth: hci_bcm: Check for error irq For the possible failure of the platform_get_irq(), the returned irq could be error number and will finally cause the failure of the request_irq(). Consider that platform_get_irq() can now in certain cases return -EPROBE_DEFER, and the consequences of letting request_irq() effectively convert that into -EINVAL, even at probe time rather than later on. So it might be better to check just now. Fixes: 0395ffc1ee05 ("Bluetooth: hci_bcm: Add PM for BCM devices") Signed-off-by: Jiasheng Jiang Signed-off-by: Marcel Holtmann commit d5a73ec96cc57cf67e51b12820fc2354e7ca46f8 Author: Jiasheng Jiang Date: Thu Jan 6 18:04:10 2022 +0800 fsl/fman: Check for null pointer after calling devm_ioremap As the possible failure of the allocation, the devm_ioremap() may return NULL pointer. Take tgec_initialization() as an example. If allocation fails, the params->base_addr will be NULL pointer and will be assigned to tgec->regs in tgec_config(). Then it will cause the dereference of NULL pointer in set_mac_address(), which is called by tgec_init(). Therefore, it should be better to add the sanity check after the calling of the devm_ioremap(). Fixes: 3933961682a3 ("fsl/fman: Add FMan MAC driver") Signed-off-by: Jiasheng Jiang Signed-off-by: David S. Miller commit 710ad98c363a66a0cd8526465426c5c5f8377ee0 Author: Daniel Borkmann Date: Thu Jan 6 01:46:06 2022 +0100 veth: Do not record rx queue hint in veth_xmit Laurent reported that they have seen a significant amount of TCP retransmissions at high throughput from applications residing in network namespaces talking to the outside world via veths. The drops were seen on the qdisc layer (fq_codel, as per systemd default) of the phys device such as ena or virtio_net due to all traffic hitting a _single_ TX queue _despite_ multi-queue device. (Note that the setup was _not_ using XDP on veths as the issue is generic.) More specifically, after edbea9220251 ("veth: Store queue_mapping independently of XDP prog presence") which made it all the way back to v4.19.184+, skb_record_rx_queue() would set skb->queue_mapping to 1 (given 1 RX and 1 TX queue by default for veths) instead of leaving at 0. This is eventually retained and callbacks like ena_select_queue() will also pick single queue via netdev_core_pick_tx()'s ndo_select_queue() once all the traffic is forwarded to that device via upper stack or other means. Similarly, for others not implementing ndo_select_queue() if XPS is disabled, netdev_pick_tx() might call into the skb_tx_hash() and check for prior skb_rx_queue_recorded() as well. In general, it is a _bad_ idea for virtual devices like veth to mess around with queue selection [by default]. Given dev->real_num_tx_queues is by default 1, the skb->queue_mapping was left untouched, and so prior to edbea9220251 the netdev_core_pick_tx() could do its job upon __dev_queue_xmit() on the phys device. Unbreak this and restore prior behavior by removing the skb_record_rx_queue() from veth_xmit() altogether. If the veth peer has an XDP program attached, then it would return the first RX queue index in xdp_md->rx_queue_index (unless configured in non-default manner). However, this is still better than breaking the generic case. Fixes: edbea9220251 ("veth: Store queue_mapping independently of XDP prog presence") Fixes: 638264dc9022 ("veth: Support per queue XDP ring") Reported-by: Laurent Bernaille Signed-off-by: Daniel Borkmann Cc: Maciej Fijalkowski Cc: Toshiaki Makita Cc: Eric Dumazet Cc: Paolo Abeni Cc: John Fastabend Cc: Willem de Bruijn Acked-by: John Fastabend Reviewed-by: Eric Dumazet Acked-by: Toshiaki Makita Signed-off-by: David S. Miller commit b33721baccd5d4e6651cd8f619524a316ff22cd3 Author: Gaston Gonzalez Date: Wed Jan 5 17:35:48 2022 -0300 staging: vc04_services: rename BM2835 to BCM2835 in headers comments In the kernel, when referring to the chip BCM2835, it is more suitable to use BCM2835 to BM2835. To avoid confusion, and to make things more consistent, rename the headers titles accordingly. Suggested-by: Stefan Wahren Signed-off-by: Gaston Gonzalez Link: https://lore.kernel.org/r/19acea9e9da0d3ebb1a7e6bce511a3c09e8c80c3.1641414449.git.gascoar@gmail.com Signed-off-by: Greg Kroah-Hartman commit 948d91b66b1f48e88774ba95cb392da0d4411b74 Author: Gaston Gonzalez Date: Wed Jan 5 17:35:46 2022 -0300 staging: vc04_services: rename string literal containing bm2835_* to bcm2835*_ In the kernel, all names related to the chip BCM2835 are always named bcm2835_*. To avoid confusion, and to make things more consistent, rename the string term bm2835_* to bcm2835_*. While at it, some realignments were made to improve readability. Suggested-by: Stefan Wahren Signed-off-by: Gaston Gonzalez Link: https://lore.kernel.org/r/91caae07fce0e4511f283388304e935526ba29ed.1641414449.git.gascoar@gmail.com Signed-off-by: Greg Kroah-Hartman commit eccbcf75a75b6b0327ae7aa6d2cf96a3b99eda84 Author: Gaston Gonzalez Date: Wed Jan 5 17:35:45 2022 -0300 staging: vc04_services: rename variables containing bm2835_* to bcm2835_* In the kernel, all names related to the chip BCM2835 are always named bcm2835_*. To avoid confusion, and to make things more consistent, rename all variables using bm2835_* to bcm2835_*. While at it, some realignments were made to improve readability. Suggested-by: Stefan Wahren Signed-off-by: Gaston Gonzalez Link: https://lore.kernel.org/r/a0af5deacebc2da9b21772c7677e1a9627edbed6.1641414449.git.gascoar@gmail.com Signed-off-by: Greg Kroah-Hartman commit d6776424667cbbfe15d2482a220b620d3257a9bb Author: Gaston Gonzalez Date: Wed Jan 5 17:35:44 2022 -0300 staging: vc04_services: rename functions containing bm2835_* to bcm2835_* In the kernel, all names related to the chip BCM2835 are always named bcm2835_*. To avoid confusion, and to make things more consistent, rename functions using bm2835_* to bcm2835_*. While at it, some realignments were made to improve readability. Suggested-by: Stefan Wahren Signed-off-by: Gaston Gonzalez Link: https://lore.kernel.org/r/d3b6f67421c75829105f793cfb9ec1414b926bf6.1641414449.git.gascoar@gmail.com Signed-off-by: Greg Kroah-Hartman commit 710ec044517e0b9f34203d885a3d18e6dcbe1e66 Author: Gaston Gonzalez Date: Wed Jan 5 17:35:43 2022 -0300 staging: vc04_services: rename structures bm2835_mmal_dev and bm2835_mmal_v4l2_ctrl In the kernel, all names related to the chip BCM2835 are always named bcm2835_*. To avoid confusion, and to make things more consistent, rename the structures bm2835_mmal_dev and bm2835_mmal_v4l2_ctrl accordingly. While at it, one realignment was made to improve readability. Suggested-by: Stefan Wahren Signed-off-by: Gaston Gonzalez Link: https://lore.kernel.org/r/a893f24fc5ee6c276ea982f141b42ec0a00d7194.1641414449.git.gascoar@gmail.com Signed-off-by: Greg Kroah-Hartman commit c288bc0db2d1938691ef283ce61ae6122e562bc3 Author: Greg Kroah-Hartman Date: Wed Jan 5 19:41:01 2022 +0100 ethernet: ibmveth: use default_groups in kobj_type There are currently 2 ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the ibmveth sysfs code to use default_groups field which has been the preferred way since aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field. Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Cristobal Forno Cc: "David S. Miller" Cc: Jakub Kicinski Cc: linuxppc-dev@lists.ozlabs.org Cc: netdev@vger.kernel.org Signed-off-by: Greg Kroah-Hartman Reviewed-by: Tyrel Datwyler Signed-off-by: David S. Miller commit 2e81948177d769106754085c3e03534e6cc1f623 Author: Jiasheng Jiang Date: Tue Jan 4 23:06:28 2022 +0800 staging: greybus: audio: Check null pointer As the possible alloc failure of devm_kcalloc(), it could return null pointer. Therefore, 'strings' should be checked and return NULL if alloc fails to prevent the dereference of the NULL pointer. Also, the caller should also deal with the return value of the gb_generate_enum_strings() and return -ENOMEM if returns NULL. Moreover, because the memory allocated with devm_kzalloc() will be freed automatically when the last reference to the device is dropped, the 'gbe' in gbaudio_tplg_create_enum_kctl() and gbaudio_tplg_create_enum_ctl() do not need to free manually. But the 'control' in gbaudio_tplg_create_widget() and gbaudio_tplg_process_kcontrols() has a specially error handle to cleanup. So it should be better to cleanup 'control' when fails. Fixes: e65579e335da ("greybus: audio: topology: Enable enumerated control support") Reviewed-by: Alex Elder Signed-off-by: Jiasheng Jiang Link: https://lore.kernel.org/r/20220104150628.1987906-1-jiasheng@iscas.ac.cn Signed-off-by: Greg Kroah-Hartman commit 43d012123122cc69feacab55b71369f386c19566 Author: Dan Carpenter Date: Thu Jan 6 14:57:54 2022 +0300 rocker: fix a sleeping in atomic bug This code is holding the &ofdpa->flow_tbl_lock spinlock so it is not allowed to sleep. That means we have to pass the OFDPA_OP_FLAG_NOWAIT flag to ofdpa_flow_tbl_del(). Fixes: 936bd486564a ("rocker: use FIB notifications instead of switchdev calls") Signed-off-by: Dan Carpenter Signed-off-by: David S. Miller commit 0746ae1be12177ebda0666eefa82583cbaeeefd6 Author: Pali Rohár Date: Fri Nov 26 15:43:07 2021 +0100 PCI: mvebu: Add support for compiling driver as module Now when driver uses devm_pci_remap_iospace() function, it is possible implement ->remove() callback for unbinding device from driver. Implement mvebu_pcie_remove() callback with proper cleanup phase, drop driver's suppress_bind_attrs flag and switch type of CONFIG_PCI_MVEBU option from bool to tristate. This allows to compile pci-mvebu.c driver as loadable module pci-mvebu.ko with ability to unload it. Link: https://lore.kernel.org/r/20211126144307.7568-3-pali@kernel.org Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi commit 859186e238ffb7ca980dbb7af9abd799ceedbcb3 Author: Pali Rohár Date: Fri Nov 26 15:43:06 2021 +0100 bus: mvebu-mbus: Export symbols for public API window functions This would allow to compile pci-mvebu.c driver as module. Link: https://lore.kernel.org/r/20211126144307.7568-2-pali@kernel.org Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi commit 3407d826c18d9aed3c51545cc26ff9a2fda65463 Author: Greg Kroah-Hartman Date: Wed Jan 5 19:26:34 2022 +0100 firmware: edd: remove empty default_attrs array The default_attrs array of attributes for the edd sysfs entries is totally empty for some reason, and a list of attributes is added later after the object is created (which should be fixed up later as it's racy). Because this pointer is never used, and is empty, and we are trying to remove all default_attrs usages, just delete it. Link: https://lore.kernel.org/r/20220105182634.2802684-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit ab6d0f57be58c075bd249a97c81c3557b5e3e7cf Author: Greg Kroah-Hartman Date: Wed Jan 5 19:17:19 2022 +0100 firmware: dmi-sysfs: use default_groups in kobj_type There are currently 2 ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the firmware dmi-sysfs sysfs code to use default_groups field which has been the preferred way since aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field. Link: https://lore.kernel.org/r/20220105181719.2737782-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit f68ae7823a9dc7737d0e4265cf65119a50c9ec69 Merge: 8ab1ff9b1ec81 d08aea21c89dc Author: Wolfram Sang Date: Thu Jan 6 14:26:39 2022 +0100 Merge tag 'at24-updates-for-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into i2c/for-mergewindow at24 updates for v5.17 - add support for a new model: Microchip 24c1025 - reorganize the compatible definitions in the DT binding document - drop the at24_client structure by retrieving the struct device associated with the chip's regmap commit ad8a5d1d2f577843dba14e4727c86e952ffbd5f1 Author: Greg Kroah-Hartman Date: Wed Jan 5 19:31:33 2022 +0100 qemu_fw_cfg: use default_groups in kobj_type There are currently 2 ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the firmware qemu_fw_cfg sysfs code to use default_groups field which has been the preferred way since aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field. Cc: Gabriel Somlo Cc: "Michael S. Tsirkin" Cc: qemu-devel@nongnu.org Acked-by: Michael S. Tsirkin Link: https://lore.kernel.org/r/20220105183133.2812848-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit 33a5c2793451770cb6dcf0cc35c76cfd4b045513 Author: Hans de Goede Date: Sun Dec 12 22:23:33 2021 +0100 HID: Add new Letsketch tablet driver Add a new driver for the LetSketch / VSON WP9620N drawing tablet. This drawing tablet is also sold under other brand names such as Case U, presumably this driver will work for all of them. But it has only been tested with a LetSketch WP9620N model. These tablets also work without a special HID driver, but then only part of the active area works and both the pad and stylus buttons are hardwired to special key-combos. E.g. the 2 stylus buttons send right mouse clicks / resp. "e" key presses. BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=2005575 BugLink: https://github.com/DIGImend/digimend-kernel-drivers/issues/528 Signed-off-by: Hans de Goede Signed-off-by: Jiri Kosina commit 7f84e2439ed2e2c7afdced9564dda1220e932704 Author: José Expósito Date: Sun Jan 2 18:51:13 2022 +0100 HID: apple: Add Magic Keyboard 2021 with fingerprint reader FN key mapping Use the function key table introduced for the Magic Keyboard 2021 without fingerprint reader in the models with fingerprint reader and/or numpad. Tested with the ANSI variant of the keyboard with and without numpad. Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit 531cb56972f2773c941499fcfb639cd5128dfb27 Author: Benjamin Berg Date: Mon Nov 8 13:50:38 2021 +0100 HID: apple: Add 2021 magic keyboard FN key mapping The new 2021 apple models have a different FN key assignment. Add a new translation table and use that for the 2021 magic keyboard. Signed-off-by: Benjamin Berg Signed-off-by: Jiri Kosina commit 5768701edcb7d7ff8abaa085996a5c1cb30d765e Author: José Expósito Date: Sun Dec 12 19:21:00 2021 +0100 HID: magicmouse: set Magic Trackpad 2021 name The Apple Magic Trackpad 2021 (3rd generation) has the same product ID as the 2nd generation. However, when connected through Bluetooth, the version has changed from 0x107 to 0x110. The other meaningful change is that the name has dropped the generation number and now it is just "Apple Inc. Magic Trackpad", like the first generation model. Set the device name correctly to ensure the same driver settings are loaded, whether connected via Bluetooth or USB. Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit 0aa45fcc42d82753a257abbc7138922d8250e06f Author: José Expósito Date: Sun Dec 12 19:20:59 2021 +0100 HID: magicmouse: set device name when it has been personalized If the Apple Magic Trackpad 2 has been connected to a Mac, the name is automatically personalized showing its owner name. For example: "José Expósito's Trackpad". When connected through Bluetooth, the personalized name is reported, however, when connected through USB the generic name is reported. Set the device name correctly to ensure the same driver settings are loaded, whether connected via Bluetooth or USB. Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit b2dcadef207719a9b3520cb9f1c9237c320d3ccd Author: Alex Henrie Date: Wed Dec 1 23:16:51 2021 -0700 HID: apple: Add 2021 Magic Keyboard with number pad Signed-off-by: Alex Henrie Signed-off-by: Jiri Kosina commit 9f92d61f01dd31305e53d3d6c036e93269070167 Author: Alex Henrie Date: Wed Dec 1 23:16:50 2021 -0700 HID: apple: Add 2021 Magic Keyboard with fingerprint reader Signed-off-by: Alex Henrie Tested-by: José Expósito Signed-off-by: Jiri Kosina commit 0cf765fb00ce083c017f2571ac449cf7912cdb06 Author: Jiapeng Chong Date: Wed Jan 5 23:22:37 2022 +0800 sfc: Use swap() instead of open coding it Clean the following coccicheck warning: ./drivers/net/ethernet/sfc/efx_channels.c:870:36-37: WARNING opportunity for swap(). ./drivers/net/ethernet/sfc/efx_channels.c:824:36-37: WARNING opportunity for swap(). Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Acked-by: Martin Habets Signed-off-by: David S. Miller commit ccd21ec5b8dd9b8a528a70315cee95fc1dd79d20 Author: Tom Rix Date: Wed Jan 5 06:10:20 2022 -0800 ethtool: use phydev variable In ethtool_get_phy_stats(), the phydev varaible is set to dev->phydev but dev->phydev is still used. Replace dev->phydev uses with phydev. Signed-off-by: Tom Rix Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 8876769bf93687d8b17d8143d39ca7a1aaeaecc6 Author: Russell King (Oracle) Date: Wed Jan 5 13:15:15 2022 +0000 net: macb: use .mac_select_pcs() interface Convert the PCS selection to use mac_select_pcs, which allows the PCS to perform any validation it needs. We must use separate phylink_pcs instances for the USX and SGMII PCS, rather than just changing the "ops" pointer before re-setting it to phylink as this interface queries the PCS, rather than requesting it to be changed. Acked-by: Nicolas Ferre Signed-off-by: Russell King (Oracle) Signed-off-by: David S. Miller commit 44073187990d5629804ce0627525f6ea5cfef171 Author: Eric Dumazet Date: Wed Jan 5 03:48:42 2022 -0800 ppp: ensure minimum packet size in ppp_write() It seems pretty clear ppp layer assumed user space would always be kind to provide enough data in their write() to a ppp device. This patch makes sure user provides at least 2 bytes. It adds PPP_PROTO_LEN macro that could replace in net-next many occurrences of hard-coded 2 value. I replaced only one occurrence to ease backports to stable kernels. The bug manifests in the following report: BUG: KMSAN: uninit-value in ppp_send_frame+0x28d/0x27c0 drivers/net/ppp/ppp_generic.c:1740 ppp_send_frame+0x28d/0x27c0 drivers/net/ppp/ppp_generic.c:1740 __ppp_xmit_process+0x23e/0x4b0 drivers/net/ppp/ppp_generic.c:1640 ppp_xmit_process+0x1fe/0x480 drivers/net/ppp/ppp_generic.c:1661 ppp_write+0x5cb/0x5e0 drivers/net/ppp/ppp_generic.c:513 do_iter_write+0xb0c/0x1500 fs/read_write.c:853 vfs_writev fs/read_write.c:924 [inline] do_writev+0x645/0xe00 fs/read_write.c:967 __do_sys_writev fs/read_write.c:1040 [inline] __se_sys_writev fs/read_write.c:1037 [inline] __x64_sys_writev+0xe5/0x120 fs/read_write.c:1037 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x54/0xd0 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x44/0xae Uninit was created at: slab_post_alloc_hook mm/slab.h:524 [inline] slab_alloc_node mm/slub.c:3251 [inline] __kmalloc_node_track_caller+0xe0c/0x1510 mm/slub.c:4974 kmalloc_reserve net/core/skbuff.c:354 [inline] __alloc_skb+0x545/0xf90 net/core/skbuff.c:426 alloc_skb include/linux/skbuff.h:1126 [inline] ppp_write+0x11d/0x5e0 drivers/net/ppp/ppp_generic.c:501 do_iter_write+0xb0c/0x1500 fs/read_write.c:853 vfs_writev fs/read_write.c:924 [inline] do_writev+0x645/0xe00 fs/read_write.c:967 __do_sys_writev fs/read_write.c:1040 [inline] __se_sys_writev fs/read_write.c:1037 [inline] __x64_sys_writev+0xe5/0x120 fs/read_write.c:1037 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 Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Eric Dumazet Cc: Paul Mackerras Cc: linux-ppp@vger.kernel.org Reported-by: syzbot Acked-by: Guillaume Nault Signed-off-by: David S. Miller commit eac1b93c14d645ef147b049ace0d5230df755548 Author: Coco Li Date: Wed Jan 5 02:48:38 2022 -0800 gro: add ability to control gro max packet size Eric Dumazet suggested to allow users to modify max GRO packet size. We have seen GRO being disabled by users of appliances (such as wifi access points) because of claimed bufferbloat issues, or some work arounds in sch_cake, to split GRO/GSO packets. Instead of disabling GRO completely, one can chose to limit the maximum packet size of GRO packets, depending on their latency constraints. This patch adds a per device gro_max_size attribute that can be changed with ip link command. ip link set dev eth0 gro_max_size 16000 Suggested-by: Eric Dumazet Signed-off-by: Coco Li Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 007747a984ea5e895b7d8b056b24ebf431e1e71d Author: Miroslav Lichvar Date: Wed Jan 5 11:33:26 2022 +0100 net: fix SOF_TIMESTAMPING_BIND_PHC to work with multiple sockets When multiple sockets using the SOF_TIMESTAMPING_BIND_PHC flag received a packet with a hardware timestamp (e.g. multiple PTP instances in different PTP domains using the UDPv4/v6 multicast or L2 transport), the timestamps received on some sockets were corrupted due to repeated conversion of the same timestamp (by the same or different vclocks). Fix ptp_convert_timestamp() to not modify the shared skb timestamp and return the converted timestamp as a ktime_t instead. If the conversion fails, return 0 to not confuse the application with timestamps corresponding to an unexpected PHC. Fixes: d7c088265588 ("net: socket: support hardware timestamp conversion to PHC bound") Signed-off-by: Miroslav Lichvar Cc: Yangbo Lu Cc: Richard Cochran Acked-by: Richard Cochran Signed-off-by: David S. Miller commit 1b26d364e4e9bd6540a8e7bcaf50e7f35041feb5 Author: Vladimir Oltean Date: Thu Jan 6 00:11:50 2022 +0200 net: dsa: warn about dsa_port and dsa_switch bit fields being non atomic As discussed during review here: https://patchwork.kernel.org/project/netdevbpf/patch/20220105132141.2648876-3-vladimir.oltean@nxp.com/ we should inform developers about pitfalls of concurrent access to the boolean properties of dsa_switch and dsa_port, now that they've been converted to bit fields. No other measure than a comment needs to be taken, since the code paths that update these bit fields are not concurrent with each other. Suggested-by: Florian Fainelli Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 63cfc65753d604edc6cfe07e6fba2bf8ececb293 Author: Vladimir Oltean Date: Thu Jan 6 00:11:49 2022 +0200 net: dsa: don't enumerate dsa_switch and dsa_port bit fields using commas This is a cosmetic incremental fixup to commits 7787ff776398 ("net: dsa: merge all bools of struct dsa_switch into a single u32") bde82f389af1 ("net: dsa: merge all bools of struct dsa_port into a single u8") The desire to make this change was enunciated after posting these patches here: https://patchwork.kernel.org/project/netdevbpf/cover/20220105132141.2648876-1-vladimir.oltean@nxp.com/ but due to a slight timing overlap (message posted at 2:28 p.m. UTC, merge commit is at 2:46 p.m. UTC), that comment was missed and the changes were applied as-is. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit af8c6db1975160753995932f43e1cd40d508aa6d Merge: d093d17c9554b 11fd667dac315 Author: David S. Miller Date: Thu Jan 6 11:59:10 2022 +0000 Merge branch 'dsa-init-cleanups' Vladimir Oltean says: ==================== DSA initialization cleanups These patches contain miscellaneous work that makes the DSA init code path symmetric with the teardown path, and some additional patches carried by Ansuel Smith for his register access over Ethernet work, but those patches can be applied as-is too. https://patchwork.kernel.org/project/netdevbpf/patch/20211214224409.5770-3-ansuelsmth@gmail.com/ ==================== Signed-off-by: David S. Miller commit 11fd667dac315ea3f2469961f6d2869271a46cae Author: Vladimir Oltean Date: Thu Jan 6 01:11:17 2022 +0200 net: dsa: setup master before ports It is said that as soon as a network interface is registered, all its resources should have already been prepared, so that it is available for sending and receiving traffic. One of the resources needed by a DSA slave interface is the master. dsa_tree_setup -> dsa_tree_setup_ports -> dsa_port_setup -> dsa_slave_create -> register_netdevice -> dsa_tree_setup_master -> dsa_master_setup -> sets up master->dsa_ptr, which enables reception Therefore, there is a short period of time after register_netdevice() during which the master isn't prepared to pass traffic to the DSA layer (master->dsa_ptr is checked by eth_type_trans). Same thing during unregistration, there is a time frame in which packets might be missed. Note that this change opens us to another race: dsa_master_find_slave() will get invoked potentially earlier than the slave creation, and later than the slave deletion. Since dp->slave starts off as a NULL pointer, the earlier calls aren't a problem, but the later calls are. To avoid use-after-free, we should zeroize dp->slave before calling dsa_slave_destroy(). In practice I cannot really test real life improvements brought by this change, since in my systems, netdevice creation races with PHY autoneg which takes a few seconds to complete, and that masks quite a few races. Effects might be noticeable in a setup with fixed links all the way to an external system. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 1e3f407f3cacc5dcfe27166c412ed9bc263d82bf Author: Vladimir Oltean Date: Thu Jan 6 01:11:16 2022 +0200 net: dsa: first set up shared ports, then non-shared ports After commit a57d8c217aad ("net: dsa: flush switchdev workqueue before tearing down CPU/DSA ports"), the port setup and teardown procedure became asymmetric. The fact of the matter is that user ports need the shared ports to be up before they can be used for CPU-initiated termination. And since we register net devices for the user ports, those won't be functional until we also call the setup for the shared (CPU, DSA) ports. But we may do that later, depending on the port numbering scheme of the hardware we are dealing with. It just makes sense that all shared ports are brought up before any user port is. I can't pinpoint any issue due to the current behavior, but let's change it nonetheless, for consistency's sake. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit c146f9bc195a9dc3ad7fd000a14540e7c9df952d Author: Vladimir Oltean Date: Thu Jan 6 01:11:15 2022 +0200 net: dsa: hold rtnl_mutex when calling dsa_master_{setup,teardown} DSA needs to simulate master tracking events when a binding is first with a DSA master established and torn down, in order to give drivers the simplifying guarantee that ->master_state_change calls are made only when the master's readiness state to pass traffic changes. master_state_change() provide a operational bool that DSA driver can use to understand if DSA master is operational or not. To avoid races, we need to block the reception of NETDEV_UP/NETDEV_CHANGE/NETDEV_GOING_DOWN events in the netdev notifier chain while we are changing the master's dev->dsa_ptr (this changes what netdev_uses_dsa(dev) reports). The dsa_master_setup() and dsa_master_teardown() functions optionally require the rtnl_mutex to be held, if the tagger needs the master to be promiscuous, these functions call dev_set_promiscuity(). Move the rtnl_lock() from that function and make it top-level. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit a1ff94c2973c43bc1e2677ac63ebb15b1d1ff846 Author: Vladimir Oltean Date: Thu Jan 6 01:11:14 2022 +0200 net: dsa: stop updating master MTU from master.c At present there are two paths for changing the MTU of the DSA master. The first is: dsa_tree_setup -> dsa_tree_setup_ports -> dsa_port_setup -> dsa_slave_create -> dsa_slave_change_mtu -> dev_set_mtu(master) The second is: dsa_tree_setup -> dsa_tree_setup_master -> dsa_master_setup -> dev_set_mtu(dev) So the dev_set_mtu() call from dsa_master_setup() has been effectively superseded by the dsa_slave_change_mtu(slave_dev, ETH_DATA_LEN) that is done from dsa_slave_create() for each user port. The later function also updates the master MTU according to the largest user port MTU from the tree. Therefore, updating the master MTU through a separate code path isn't needed. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit e31dbd3b6aba585231cd84a87adeb22e7c6a8c19 Author: Vladimir Oltean Date: Thu Jan 6 01:11:13 2022 +0200 net: dsa: merge rtnl_lock sections in dsa_slave_create Currently dsa_slave_create() has two sequences of rtnl_lock/rtnl_unlock in a row. Remove the rtnl_unlock() and rtnl_lock() in between, such that the operation can execute slighly faster. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit 904e112ad431492b34f235f59738e8312802bbf9 Author: Vladimir Oltean Date: Thu Jan 6 01:11:12 2022 +0200 net: dsa: reorder PHY initialization with MTU setup in slave.c In dsa_slave_create() there are 2 sections that take rtnl_lock(): MTU change and netdev registration. They are separated by PHY initialization. There isn't any strict ordering requirement except for the fact that netdev registration should be last. Therefore, we can perform the MTU change a bit later, after the PHY setup. A future change will then be able to merge the two rtnl_lock sections into one. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit c4251db3b9d2ad4411f95e65ca00ea0f6800319b Merge: 502a2ce9cdf42 45a98ef4922de Author: David S. Miller Date: Thu Jan 6 11:55:45 2022 +0000 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec Steffen Klassert says: ==================== pull request (net): ipsec 2022-01-06 1) Fix xfrm policy lookups for ipv6 gre packets by initializing fl6_gre_key properly. From Ghalem Boudour. 2) Fix the dflt policy check on forwarding when there is no policy configured. The check was done for the wrong direction. From Nicolas Dichtel. 3) Use the correct 'struct xfrm_user_offload' when calculating netlink message lenghts in xfrm_sa_len(). From Eric Dumazet. 4) Tread inserting xfrm interface id 0 as an error. From Antony Antony. 5) Fail if xfrm state or policy is inserted with XFRMA_IF_ID 0, xfrm interfaces with id 0 are not allowed. From Antony Antony. 6) Fix inner_ipproto setting in the sec_path for tunnel mode. From Raed Salem. ==================== Signed-off-by: David S. Miller commit d093d17c9554be794b1bd83971fb6d0ae3ea77b1 Merge: 4e023b44d5cec 4e484b3e969b5 Author: David S. Miller Date: Thu Jan 6 11:54:20 2022 +0000 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next Steffen Klassert says: ==================== pull request (net-next): ipsec-next 2022-01-06 1) Fix some clang_analyzer warnings about never read variables. From luo penghao. 2) Check for pols[0] only once in xfrm_expand_policies(). From Jean Sacren. 3) The SA curlft.use_time was updated only on SA cration time. Update whenever the SA is used. From Antony Antony 4) Add support for SM3 secure hash. From Xu Jia. 5) Add support for SM4 symmetric cipher algorithm. From Xu Jia. 6) Add a rate limit for SA mapping change messages. From Antony Antony. ==================== Signed-off-by: David S. Miller commit b01af5c0b0414f96e6c3891e704d1c40faa18813 Author: Hyeonggon Yoo <42.hyeyoo@gmail.com> Date: Sun Dec 12 06:52:41 2021 +0000 mm/slob: Remove unnecessary page_mapcount_reset() function call After commit 401fb12c68c2 ("mm/sl*b: Differentiate struct slab fields by sl*b implementations"), we can reorder fields of struct slab depending on slab allocator. For now, page_mapcount_reset() is called because page->_mapcount and slab->units have same offset. But this is not necessary for struct slab. Use unused field for units instead. Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Signed-off-by: Vlastimil Babka Link: https://lore.kernel.org/r/20211212065241.GA886691@odroid commit c5e97ed154589524a1df4ae2be55c4cfdb0d0573 Author: Matthew Wilcox (Oracle) Date: Mon Oct 4 14:46:48 2021 +0100 bootmem: Use page->index instead of page->freelist page->freelist is for the use of slab. Using page->index is the same set of bits as page->freelist, and by using an integer instead of a pointer, we can avoid casts. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Vlastimil Babka Acked-by: Johannes Weiner Cc: Dave Hansen Cc: Andy Lutomirski Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Cc: "H. Peter Anvin" commit ffedd09fa9b06d0d79e123bbf4ec81125456d982 Author: Matthew Wilcox (Oracle) Date: Mon Oct 4 14:46:47 2021 +0100 zsmalloc: Stop using slab fields in struct page The ->freelist and ->units members of struct page are for the use of slab only. I'm not particularly familiar with zsmalloc, so generate the same code by using page->index to store 'page' (page->index and page->freelist are at the same offset in struct page). This should be cleaned up properly at some point by somebody who is familiar with zsmalloc. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Vlastimil Babka Acked-by: Minchan Kim Acked-by: Johannes Weiner Cc: Nitin Gupta Cc: Sergey Senozhatsky commit 9c01e9af171f13cf6573f404ecaf96dfa48233ab Author: Vlastimil Babka Date: Wed Nov 10 14:12:45 2021 +0100 mm/slub: Define struct slab fields for CONFIG_SLUB_CPU_PARTIAL only when enabled The fields 'next' and 'slabs' are only used when CONFIG_SLUB_CPU_PARTIAL is enabled. We can put their definition to #ifdef to prevent accidental use when disabled. Currenlty show_slab_objects() and slabs_cpu_partial_show() contain code accessing the slabs field that's effectively dead with CONFIG_SLUB_CPU_PARTIAL=n through the wrappers slub_percpu_partial() and slub_percpu_partial_read_once(), but to prevent a compile error, we need to hide all this code behind #ifdef. Signed-off-by: Vlastimil Babka Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Roman Gushchin Tested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> commit 662188c3a20eba75babc5a910a5f1b4278069f85 Author: Vlastimil Babka Date: Wed Nov 10 12:57:43 2021 +0100 mm/slub: Simplify struct slab slabs field definition Before commit b47291ef02b0 ("mm, slub: change percpu partial accounting from objects to pages") we had to fit two integer fields into a native word size, so we used short int on 32-bit and int on 64-bit via #ifdef. After that commit there is only one integer field, so we can simply define it as int everywhere. Signed-off-by: Vlastimil Babka Acked-by: Johannes Weiner Reviewed-by: Roman Gushchin commit 401fb12c68c257b9c9116b1475c0ac26b646fcc0 Author: Vlastimil Babka Date: Thu Nov 4 11:30:58 2021 +0100 mm/sl*b: Differentiate struct slab fields by sl*b implementations With a struct slab definition separate from struct page, we can go further and define only fields that the chosen sl*b implementation uses. This means everything between __page_flags and __page_refcount placeholders now depends on the chosen CONFIG_SL*B. Some fields exist in all implementations (slab_list) but can be part of a union in some, so it's simpler to repeat them than complicate the definition with ifdefs even more. The patch doesn't change physical offsets of the fields, although it could be done later - for example it's now clear that tighter packing in SLOB could be possible. This should also prevent accidental use of fields that don't exist in given implementation. Before this patch virt_to_cache() and cache_from_obj() were visible for SLOB (albeit not used), although they rely on the slab_cache field that isn't set by SLOB. With this patch it's now a compile error, so these functions are now hidden behind an #ifndef CONFIG_SLOB. Signed-off-by: Vlastimil Babka Reviewed-by: Roman Gushchin Tested-by: Marco Elver # kfence Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Tested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: Alexander Potapenko Cc: Marco Elver Cc: Dmitry Vyukov Cc: commit 8dae0cfed57357c0a627f377386ade1591f4d9ea Author: Vlastimil Babka Date: Wed Nov 3 18:19:48 2021 +0100 mm/kfence: Convert kfence_guarded_alloc() to struct slab The function sets some fields that are being moved from struct page to struct slab so it needs to be converted. Signed-off-by: Vlastimil Babka Tested-by: Marco Elver Cc: Alexander Potapenko Cc: Marco Elver Cc: Dmitry Vyukov Cc: commit 6e48a966dfd18987fec9385566a67d36e2b5fc11 Author: Matthew Wilcox (Oracle) Date: Mon Oct 4 14:46:46 2021 +0100 mm/kasan: Convert to struct folio and struct slab KASAN accesses some slab related struct page fields so we need to convert it to struct slab. Some places are a bit simplified thanks to kasan_addr_to_slab() encapsulating the PageSlab flag check through virt_to_slab(). When resolving object address to either a real slab or a large kmalloc, use struct folio as the intermediate type for testing the slab flag to avoid unnecessary implicit compound_head(). [ vbabka@suse.cz: use struct folio, adjust to differences in previous patches ] Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Vlastimil Babka Reviewed-by: Andrey Konovalov Reviewed-by: Roman Gushchin Tested-by: Hyeongogn Yoo <42.hyeyoo@gmail.com> Cc: Andrey Ryabinin Cc: Alexander Potapenko Cc: Andrey Konovalov Cc: Dmitry Vyukov Cc: commit 50757018b4c9b02dbf7fcc0514e0fc45b8689c62 Author: Matthew Wilcox (Oracle) Date: Mon Oct 4 14:46:43 2021 +0100 mm/slob: Convert SLOB to use struct slab and struct folio Use struct slab throughout the slob allocator. Where non-slab page can appear use struct folio instead of struct page. [ vbabka@suse.cz: don't introduce wrappers for PageSlobFree in mm/slab.h just for the single callers being wrappers in mm/slob.c ] [ Hyeonggon Yoo <42.hyeyoo@gmail.com>: fix NULL pointer deference ] Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Vlastimil Babka Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Tested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> commit 4b5f8d9a895ada8e0abb58ccd35d9fe229e3a595 Author: Vlastimil Babka Date: Tue Nov 2 22:42:04 2021 +0100 mm/memcg: Convert slab objcgs from struct page to struct slab page->memcg_data is used with MEMCG_DATA_OBJCGS flag only for slab pages so convert all the related infrastructure to struct slab. Also use struct folio instead of struct page when resolving object pointers. This is not just mechanistic changing of types and names. Now in mem_cgroup_from_obj() we use folio_test_slab() to decide if we interpret the folio as a real slab instead of a large kmalloc, instead of relying on MEMCG_DATA_OBJCGS bit that used to be checked in page_objcgs_check(). Similarly in memcg_slab_free_hook() where we can encounter kmalloc_large() pages (here the folio slab flag check is implied by virt_to_slab()). As a result, page_objcgs_check() can be dropped instead of converted. To avoid include cycles, move the inline definition of slab_objcgs() from memcontrol.h to mm/slab.h. Signed-off-by: Vlastimil Babka Reviewed-by: Roman Gushchin Cc: Johannes Weiner Cc: Michal Hocko Cc: Vladimir Davydov Cc: commit 40f3bf0cb04c91d33531b1b95788ad2f0e4062cf Author: Vlastimil Babka Date: Tue Nov 2 15:42:04 2021 +0100 mm: Convert struct page to struct slab in functions used by other subsystems KASAN, KFENCE and memcg interact with SLAB or SLUB internals through functions nearest_obj(), obj_to_index() and objs_per_slab() that use struct page as parameter. This patch converts it to struct slab including all callers, through a coccinelle semantic patch. // Options: --include-headers --no-includes --smpl-spacing include/linux/slab_def.h include/linux/slub_def.h mm/slab.h mm/kasan/*.c mm/kfence/kfence_test.c mm/memcontrol.c mm/slab.c mm/slub.c // Note: needs coccinelle 1.1.1 to avoid breaking whitespace @@ @@ -objs_per_slab_page( +objs_per_slab( ... ) { ... } @@ @@ -objs_per_slab_page( +objs_per_slab( ... ) @@ identifier fn =~ "obj_to_index|objs_per_slab"; @@ fn(..., - const struct page *page + const struct slab *slab ,...) { <... ( - page_address(page) + slab_address(slab) | - page + slab ) ...> } @@ identifier fn =~ "nearest_obj"; @@ fn(..., - struct page *page + const struct slab *slab ,...) { <... ( - page_address(page) + slab_address(slab) | - page + slab ) ...> } @@ identifier fn =~ "nearest_obj|obj_to_index|objs_per_slab"; expression E; @@ fn(..., ( - slab_page(E) + E | - virt_to_page(E) + virt_to_slab(E) | - virt_to_head_page(E) + virt_to_slab(E) | - page + page_slab(page) ) ,...) Signed-off-by: Vlastimil Babka Reviewed-by: Andrey Konovalov Reviewed-by: Roman Gushchin Acked-by: Johannes Weiner Cc: Julia Lawall Cc: Luis Chamberlain Cc: Andrey Ryabinin Cc: Alexander Potapenko Cc: Andrey Konovalov Cc: Dmitry Vyukov Cc: Marco Elver Cc: Johannes Weiner Cc: Michal Hocko Cc: Vladimir Davydov Cc: Cc: commit dd35f71a1d98b87e0e3ee3d87fff1bc7004cf626 Author: Vlastimil Babka Date: Tue Nov 2 13:26:56 2021 +0100 mm/slab: Finish struct page to struct slab conversion Change cache_free_alien() to use slab_nid(virt_to_slab()). Otherwise just update of comments and some remaining variable names. Signed-off-by: Vlastimil Babka Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Roman Gushchin commit 7981e67efb85908d9c4924c8e6669c5d5fe365b7 Author: Vlastimil Babka Date: Tue Nov 2 13:23:10 2021 +0100 mm/slab: Convert most struct page to struct slab by spatch The majority of conversion from struct page to struct slab in SLAB internals can be delegated to a coccinelle semantic patch. This includes renaming of variables with 'page' in name to 'slab', and similar. Big thanks to Julia Lawall and Luis Chamberlain for help with coccinelle. // Options: --include-headers --no-includes --smpl-spacing mm/slab.c // Note: needs coccinelle 1.1.1 to avoid breaking whitespace, and ocaml for the // embedded script // build list of functions for applying the next rule @initialize:ocaml@ @@ let ok_function p = not (List.mem (List.hd p).current_element ["kmem_getpages";"kmem_freepages"]) // convert the type in selected functions @@ position p : script:ocaml() { ok_function p }; @@ - struct page@p + struct slab @@ @@ -PageSlabPfmemalloc(page) +slab_test_pfmemalloc(slab) @@ @@ -ClearPageSlabPfmemalloc(page) +slab_clear_pfmemalloc(slab) @@ @@ obj_to_index( ..., - page + slab_page(slab) ,...) // for all functions, change any "struct slab *page" parameter to "struct slab // *slab" in the signature, and generally all occurences of "page" to "slab" in // the body - with some special cases. @@ identifier fn; expression E; @@ fn(..., - struct slab *page + struct slab *slab ,...) { <... ( - int page_node; + int slab_node; | - page_node + slab_node | - page_slab(page) + slab | - page_address(page) + slab_address(slab) | - page_size(page) + slab_size(slab) | - page_to_nid(page) + slab_nid(slab) | - virt_to_head_page(E) + virt_to_slab(E) | - page + slab ) ...> } // rename a function parameter @@ identifier fn; expression E; @@ fn(..., - int page_node + int slab_node ,...) { <... - page_node + slab_node ...> } // functions converted by previous rules that were temporarily called using // slab_page(E) so we want to remove the wrapper now that they accept struct // slab ptr directly @@ identifier fn =~ "index_to_obj"; expression E; @@ fn(..., - slab_page(E) + E ,...) // functions that were returning struct page ptr and now will return struct // slab ptr, including slab_page() wrapper removal @@ identifier fn =~ "cache_grow_begin|get_valid_first_slab|get_first_slab"; expression E; @@ fn(...) { <... - slab_page(E) + E ...> } // rename any former struct page * declarations @@ @@ struct slab * -page +slab ; // all functions (with exceptions) with a local "struct slab *page" variable // that will be renamed to "struct slab *slab" @@ identifier fn !~ "kmem_getpages|kmem_freepages"; expression E; @@ fn(...) { <... ( - page_slab(page) + slab | - page_to_nid(page) + slab_nid(slab) | - kasan_poison_slab(page) + kasan_poison_slab(slab_page(slab)) | - page_address(page) + slab_address(slab) | - page_size(page) + slab_size(slab) | - page->pages + slab->slabs | - page = virt_to_head_page(E) + slab = virt_to_slab(E) | - virt_to_head_page(E) + virt_to_slab(E) | - page + slab ) ...> } Signed-off-by: Vlastimil Babka Reviewed-by: Roman Gushchin Tested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: Julia Lawall Cc: Luis Chamberlain commit 42c0faac3192352867f6e6ba815b28ed58bf7388 Author: Vlastimil Babka Date: Fri Oct 29 17:54:55 2021 +0200 mm/slab: Convert kmem_getpages() and kmem_freepages() to struct slab These functions sit at the boundary to page allocator. Also use folio internally to avoid extra compound_head() when dealing with page flags. Signed-off-by: Vlastimil Babka Reviewed-by: Roman Gushchin Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Tested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> commit c2092c12064a9728b2928979f88575cc1c2247fa Author: Vlastimil Babka Date: Mon Nov 15 16:55:15 2021 +0100 mm/slub: Finish struct page to struct slab conversion Update comments mentioning pages to mention slabs where appropriate. Also some goto labels. Signed-off-by: Vlastimil Babka Reviewed-by: Roman Gushchin commit bb192ed9aa7191a5d65548f82c42b6750d65f569 Author: Vlastimil Babka Date: Wed Nov 3 15:39:59 2021 +0100 mm/slub: Convert most struct page to struct slab by spatch The majority of conversion from struct page to struct slab in SLUB internals can be delegated to a coccinelle semantic patch. This includes renaming of variables with 'page' in name to 'slab', and similar. Big thanks to Julia Lawall and Luis Chamberlain for help with coccinelle. // Options: --include-headers --no-includes --smpl-spacing include/linux/slub_def.h mm/slub.c // Note: needs coccinelle 1.1.1 to avoid breaking whitespace, and ocaml for the // embedded script // build list of functions to exclude from applying the next rule @initialize:ocaml@ @@ let ok_function p = not (List.mem (List.hd p).current_element ["nearest_obj";"obj_to_index";"objs_per_slab_page";"__slab_lock";"__slab_unlock";"free_nonslab_page";"kmalloc_large_node"]) // convert the type from struct page to struct page in all functions except the // list from previous rule // this also affects struct kmem_cache_cpu, but that's ok @@ position p : script:ocaml() { ok_function p }; @@ - struct page@p + struct slab // in struct kmem_cache_cpu, change the name from page to slab // the type was already converted by the previous rule @@ @@ struct kmem_cache_cpu { ... -struct slab *page; +struct slab *slab; ... } // there are many places that use c->page which is now c->slab after the // previous rule @@ struct kmem_cache_cpu *c; @@ -c->page +c->slab @@ @@ struct kmem_cache { ... - unsigned int cpu_partial_pages; + unsigned int cpu_partial_slabs; ... } @@ struct kmem_cache *s; @@ - s->cpu_partial_pages + s->cpu_partial_slabs @@ @@ static void - setup_page_debug( + setup_slab_debug( ...) {...} @@ @@ - setup_page_debug( + setup_slab_debug( ...); // for all functions (with exceptions), change any "struct slab *page" // parameter to "struct slab *slab" in the signature, and generally all // occurences of "page" to "slab" in the body - with some special cases. @@ identifier fn !~ "free_nonslab_page|obj_to_index|objs_per_slab_page|nearest_obj"; @@ fn(..., - struct slab *page + struct slab *slab ,...) { <... - page + slab ...> } // similar to previous but the param is called partial_page @@ identifier fn; @@ fn(..., - struct slab *partial_page + struct slab *partial_slab ,...) { <... - partial_page + partial_slab ...> } // similar to previous but for functions that take pointer to struct page ptr @@ identifier fn; @@ fn(..., - struct slab **ret_page + struct slab **ret_slab ,...) { <... - ret_page + ret_slab ...> } // functions converted by previous rules that were temporarily called using // slab_page(E) so we want to remove the wrapper now that they accept struct // slab ptr directly @@ identifier fn =~ "slab_free|do_slab_free"; expression E; @@ fn(..., - slab_page(E) + E ,...) // similar to previous but for another pattern @@ identifier fn =~ "slab_pad_check|check_object"; @@ fn(..., - folio_page(folio, 0) + slab ,...) // functions that were returning struct page ptr and now will return struct // slab ptr, including slab_page() wrapper removal @@ identifier fn =~ "allocate_slab|new_slab"; expression E; @@ static -struct slab * +struct slab * fn(...) { <... - slab_page(E) + E ...> } // rename any former struct page * declarations @@ @@ struct slab * ( - page + slab | - partial_page + partial_slab | - oldpage + oldslab ) ; // this has to be separate from previous rule as page and page2 appear at the // same line @@ @@ struct slab * -page2 +slab2 ; // similar but with initial assignment @@ expression E; @@ struct slab * ( - page + slab | - flush_page + flush_slab | - discard_page + slab_to_discard | - page_to_unfreeze + slab_to_unfreeze ) = E; // convert most of struct page to struct slab usage inside functions (with // exceptions), including specific variable renames @@ identifier fn !~ "nearest_obj|obj_to_index|objs_per_slab_page|__slab_(un)*lock|__free_slab|free_nonslab_page|kmalloc_large_node"; expression E; @@ fn(...) { <... ( - int pages; + int slabs; | - int pages = E; + int slabs = E; | - page + slab | - flush_page + flush_slab | - partial_page + partial_slab | - oldpage->pages + oldslab->slabs | - oldpage + oldslab | - unsigned int nr_pages; + unsigned int nr_slabs; | - nr_pages + nr_slabs | - unsigned int partial_pages = E; + unsigned int partial_slabs = E; | - partial_pages + partial_slabs ) ...> } // this has to be split out from the previous rule so that lines containing // multiple matching changes will be fully converted @@ identifier fn !~ "nearest_obj|obj_to_index|objs_per_slab_page|__slab_(un)*lock|__free_slab|free_nonslab_page|kmalloc_large_node"; @@ fn(...) { <... ( - slab->pages + slab->slabs | - pages + slabs | - page2 + slab2 | - discard_page + slab_to_discard | - page_to_unfreeze + slab_to_unfreeze ) ...> } // after we simply changed all occurences of page to slab, some usages need // adjustment for slab-specific functions, or use slab_page() wrapper @@ identifier fn !~ "nearest_obj|obj_to_index|objs_per_slab_page|__slab_(un)*lock|__free_slab|free_nonslab_page|kmalloc_large_node"; @@ fn(...) { <... ( - page_slab(slab) + slab | - kasan_poison_slab(slab) + kasan_poison_slab(slab_page(slab)) | - page_address(slab) + slab_address(slab) | - page_size(slab) + slab_size(slab) | - PageSlab(slab) + folio_test_slab(slab_folio(slab)) | - page_to_nid(slab) + slab_nid(slab) | - compound_order(slab) + slab_order(slab) ) ...> } Signed-off-by: Vlastimil Babka Reviewed-by: Roman Gushchin Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Tested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: Julia Lawall Cc: Luis Chamberlain commit 01b34d1631f7a8d83467a04394a07408e2054673 Author: Matthew Wilcox (Oracle) Date: Mon Oct 4 14:46:40 2021 +0100 mm/slub: Convert pfmemalloc_match() to take a struct slab Preparatory for mass conversion. Use the new slab_test_pfmemalloc() helper. As it doesn't do VM_BUG_ON(!PageSlab()) we no longer need the pfmemalloc_match_unsafe() variant. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Vlastimil Babka Reviewed-by: Roman Gushchin Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> commit 4020b4a22604f832bacd8e3d8577ee8b15b829e2 Author: Vlastimil Babka Date: Fri Oct 29 12:18:24 2021 +0200 mm/slub: Convert __free_slab() to use struct slab __free_slab() is on the boundary of distinguishing struct slab and struct page so start with struct slab but convert to folio for working with flags and folio_page() to call functions that require struct page. Signed-off-by: Vlastimil Babka Reviewed-by: Roman Gushchin Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Tested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> commit 45387b8c14143623dfe905b5260836f9d62e1371 Author: Vlastimil Babka Date: Tue Oct 26 16:35:02 2021 +0200 mm/slub: Convert alloc_slab_page() to return a struct slab Preparatory, callers convert back to struct page for now. Also move setting page flags to alloc_slab_page() where we still operate on a struct page. This means the page->slab_cache pointer is now set later than the PageSlab flag, which could theoretically confuse some pfn walker assuming PageSlab means there would be a valid cache pointer. But as the code had no barriers and used __set_bit() anyway, it could have happened already, so there shouldn't be such a walker. Signed-off-by: Vlastimil Babka Reviewed-by: Roman Gushchin Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Tested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> commit fb012e278dbfc80194bf34c7ade4f261bbc747ea Author: Matthew Wilcox (Oracle) Date: Mon Oct 4 14:46:34 2021 +0100 mm/slub: Convert print_page_info() to print_slab_info() Improve the type safety and prepare for further conversion. For flags access, convert to folio internally. [ vbabka@suse.cz: access flags via folio_flags() ] Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Vlastimil Babka Reviewed-by: Roman Gushchin Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> commit 0393895b091227e8a77dfd5e6a6ab61bd11b8df0 Author: Vlastimil Babka Date: Tue Oct 26 13:39:14 2021 +0200 mm/slub: Convert __slab_lock() and __slab_unlock() to struct slab These functions operate on the PG_locked page flag, but make them accept struct slab to encapsulate this implementation detail. Signed-off-by: Vlastimil Babka Reviewed-by: Roman Gushchin commit d835eef4fc26241258c524cb32b91cbb3551ca62 Author: Matthew Wilcox (Oracle) Date: Mon Oct 4 14:45:59 2021 +0100 mm/slub: Convert kfree() to use a struct slab Convert kfree(), kmem_cache_free() and ___cache_free() to resolve object addresses to struct slab, using folio as intermediate step where needed. Keep passing the result as struct page for now in preparation for mass conversion of internal functions. [ vbabka@suse.cz: Use folio as intermediate step when checking for large kmalloc pages, and when freeing them - rename free_nonslab_page() to free_large_kmalloc() that takes struct folio ] Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Vlastimil Babka Reviewed-by: Roman Gushchin commit cc465c3b23f8db1896c1197d2f5799e97f6e617b Author: Matthew Wilcox (Oracle) Date: Mon Oct 4 14:45:58 2021 +0100 mm/slub: Convert detached_freelist to use a struct slab This gives us a little bit of extra typesafety as we know that nobody called virt_to_page() instead of virt_to_head_page(). [ vbabka@suse.cz: Use folio as intermediate step when filtering out large kmalloc pages ] Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Vlastimil Babka Reviewed-by: Roman Gushchin commit 0b3eb091d5759479d44cb793fad2c51ea06bdcec Author: Matthew Wilcox (Oracle) Date: Mon Oct 4 14:45:56 2021 +0100 mm: Convert check_heap_object() to use struct slab Ensure that we're not seeing a tail page inside __check_heap_object() by converting to a slab instead of a page. Take the opportunity to mark the slab as const since we're not modifying it. Also move the declaration of __check_heap_object() to mm/slab.h so it's not available to the wider kernel. [ vbabka@suse.cz: in check_heap_object() only convert to struct slab for actual PageSlab pages; use folio as intermediate step instead of page ] Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Vlastimil Babka Reviewed-by: Roman Gushchin commit 7213230af5e1e83ff010b3448260b9d3f95dd036 Author: Matthew Wilcox (Oracle) Date: Mon Oct 4 14:45:55 2021 +0100 mm: Use struct slab in kmem_obj_info() All three implementations of slab support kmem_obj_info() which reports details of an object allocated from the slab allocator. By using the slab type instead of the page type, we make it obvious that this can only be called for slabs. [ vbabka@suse.cz: also convert the related kmem_valid_obj() to folios ] Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Vlastimil Babka Reviewed-by: Roman Gushchin commit 0c24811b12ba29a6881e8ec0d01ad3f3b091da02 Author: Matthew Wilcox (Oracle) Date: Mon Oct 4 14:45:54 2021 +0100 mm: Convert __ksize() to struct slab In SLUB, use folios, and struct slab to access slab_cache field. In SLOB, use folios to properly resolve pointers beyond PAGE_SIZE offset of the object. [ vbabka@suse.cz: use folios, and only convert folio_test_slab() == true folios to struct slab ] Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Vlastimil Babka Acked-by: Johannes Weiner Reviewed-by: Roman Gushchin commit 82c1775dc11a954f3d8c4cb875dff24ea97bc82b Author: Matthew Wilcox (Oracle) Date: Mon Oct 4 14:45:53 2021 +0100 mm: Convert virt_to_cache() to use struct slab This function is entirely self-contained, so can be converted from page to slab. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Vlastimil Babka Acked-by: Johannes Weiner Reviewed-by: Roman Gushchin Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> commit b918653b4f32881afb383b7b5853a7edfe0937a6 Author: Matthew Wilcox (Oracle) Date: Mon Oct 4 14:45:52 2021 +0100 mm: Convert [un]account_slab_page() to struct slab Convert the parameter of these functions to struct slab instead of struct page and drop _page from the names. For now their callers just convert page to slab. [ vbabka@suse.cz: replace existing functions instead of calling them ] Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Vlastimil Babka Acked-by: Johannes Weiner Reviewed-by: Roman Gushchin commit d122019bf061cccc4583eb9ad40bf58c2fe517be Author: Matthew Wilcox (Oracle) Date: Mon Oct 4 14:45:51 2021 +0100 mm: Split slab into its own type Make struct slab independent of struct page. It still uses the underlying memory in struct page for storing slab-specific data, but slab and slub can now be weaned off using struct page directly. Some of the wrapper functions (slab_address() and slab_order()) still need to cast to struct folio, but this is a significant disentanglement. [ vbabka@suse.cz: Rebase on folios, use folio instead of page where possible. Do not duplicate flags field in struct slab, instead make the related accessors go through slab_folio(). For testing pfmemalloc use the folio_*_active flag accessors directly so the PageSlabPfmemalloc wrappers can be removed later. Make folio_slab() expect only folio_test_slab() == true folios and virt_to_slab() return NULL when folio_test_slab() == false. Move struct slab to mm/slab.h. Don't represent with struct slab pages that are not true slab pages, but just a compound page obtained directly rom page allocator (with large kmalloc() for SLUB and SLOB). ] Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Vlastimil Babka Acked-by: Johannes Weiner Reviewed-by: Roman Gushchin commit ae16d059f8c9409eba0c412639def0494765b761 Author: Vlastimil Babka Date: Tue Oct 26 18:22:44 2021 +0200 mm/slub: Make object_err() static There are no callers outside of mm/slub.c anymore. Move freelist_corrupted() that calls object_err() to avoid a need for forward declaration. Signed-off-by: Vlastimil Babka Reviewed-by: Roman Gushchin commit c798154311e10ddba56a515c8ddce14e592bbe25 Author: Vlastimil Babka Date: Mon Nov 1 17:02:30 2021 +0100 mm/slab: Dissolve slab_map_pages() in its caller The function no longer does what its name and comment suggests, and just sets two struct page fields, which can be done directly in its sole caller. Signed-off-by: Vlastimil Babka Reviewed-by: Roman Gushchin Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> commit f1aa0e47c29268776205698f2453dc07fab49855 Author: Sachin Sant Date: Wed Jan 5 19:47:48 2022 +0530 powerpc/xmon: Dump XIVE information for online-only processors. dxa command in XMON debugger iterates through all possible processors. As a result, empty lines are printed even for processors which are not online. CPU 47:pp=00 CPPR=ff IPI=0x0040002f PQ=-- EQ idx=699 T=0 00000000 00000000 CPU 48: CPU 49: Restrict XIVE information(dxa) to be displayed for online processors only. Signed-off-by: Sachin Sant Reviewed-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/164139226833.12930.272224382183014664.sendpatchset@MacBook-Pro.local commit 497685f2c743f552ec5626d60fc12e7c00faaf06 Author: Anup Patel Date: Mon Jan 3 18:54:58 2022 +0530 MAINTAINERS: Update Anup's email address I am no longer work at Western Digital so update my email address to personal one and add entries to .mailmap as well. Signed-off-by: Anup Patel Acked-by: Atish Patra commit 33e5b5746cc2336660c8710ba109d9a3923627b5 Author: Vincent Chen Date: Mon Dec 27 11:05:14 2021 +0800 KVM: RISC-V: Avoid spurious virtual interrupts after clearing hideleg CSR When the last VM is terminated, the host kernel will invoke function hardware_disable_nolock() on each CPU to disable the related virtualization functions. Here, RISC-V currently only clears hideleg CSR and hedeleg CSR. This behavior will cause the host kernel to receive spurious interrupts if hvip CSR has pending interrupts and the corresponding enable bits in vsie CSR are asserted. To avoid it, hvip CSR and vsie CSR must be cleared before clearing hideleg CSR. Fixes: 99cdc6c18c2d ("RISC-V: Add initial skeletal KVM support") Signed-off-by: Vincent Chen Reviewed-by: Anup Patel Signed-off-by: Anup Patel commit 3e06cdf10520e629e711b76b21070d6e67ae7d06 Author: Anup Patel Date: Tue Oct 5 18:09:56 2021 +0530 KVM: selftests: Add initial support for RISC-V 64-bit We add initial support for RISC-V 64-bit in KVM selftests using which we can cross-compile and run arch independent tests such as: demand_paging_test dirty_log_test kvm_create_max_vcpus, kvm_page_table_test set_memory_region_test kvm_binary_stats_test All VM guest modes defined in kvm_util.h require at least 48-bit guest virtual address so to use KVM RISC-V selftests hardware need to support at least Sv48 MMU for guest (i.e. VS-mode). Signed-off-by: Anup Patel Reviewed-and-tested-by: Atish Patra commit 788490e798a707cea75d80448f5c6c5f322ada6e Author: Anup Patel Date: Fri Nov 26 18:33:45 2021 +0530 KVM: selftests: Add EXTRA_CFLAGS in top-level Makefile We add EXTRA_CFLAGS to the common CFLAGS of top-level Makefile which will allow users to pass additional compile-time flags such as "-static". Signed-off-by: Anup Patel Reviewed-and-tested-by: Atish Patra Reviewed-and-tested-by: Sean Christopherson commit a457fd5660efa9cf960d2461156a1025bfdb13fa Author: Anup Patel Date: Fri Nov 26 17:05:51 2021 +0530 RISC-V: KVM: Add VM capability to allow userspace get GPA bits The number of GPA bits supported for a RISC-V Guest/VM is based on the MMU mode used by the G-stage translation. The KVM RISC-V will detect and use the best possible MMU mode for the G-stage in kvm_arch_init(). We add a generic VM capability KVM_CAP_VM_GPA_BITS which can be used by the KVM userspace to get the number of GPA (guest physical address) bits supported for a Guest/VM. Signed-off-by: Anup Patel Reviewed-and-tested-by: Atish Patra commit ef8949a986f0e325b1d535389101541849d611d3 Author: Anup Patel Date: Fri Nov 26 10:48:41 2021 +0530 RISC-V: KVM: Forward SBI experimental and vendor extensions The SBI experimental extension space is for temporary (or experimental) stuff whereas SBI vendor extension space is for hardware vendor specific stuff. Both these SBI extension spaces won't be standardized by the SBI specification so let's blindly forward such SBI calls to the userspace. Signed-off-by: Anup Patel Reviewed-and-tested-by: Atish Patra commit 637ad6551b2801cdf9c76046cffc1abe1f5c2243 Author: Jisheng Zhang Date: Mon Nov 29 00:07:39 2021 +0800 RISC-V: KVM: make kvm_riscv_vcpu_fp_clean() static There are no users outside vcpu_fp.c so make kvm_riscv_vcpu_fp_clean() static. Signed-off-by: Jisheng Zhang Signed-off-by: Anup Patel commit 4abed558b2cedebde400856e52800115d92e994a Author: Atish Patra Date: Thu Dec 2 15:58:23 2021 -0800 MAINTAINERS: Update Atish's email address I am no longer employed by western digital. Update my email address to personal one and add entries to .mailmap as well. Signed-off-by: Atish Patra Signed-off-by: Anup Patel commit 23c54263efd7cb605e2f7af72717a2a951999217 Author: Florian Westphal Date: Wed Jan 5 14:19:54 2022 +0100 netfilter: nft_set_pipapo: allocate pcpu scratch maps on clone This is needed in case a new transaction is made that doesn't insert any new elements into an already existing set. Else, after second 'nft -f ruleset.txt', lookups in such a set will fail because ->lookup() encounters raw_cpu_ptr(m->scratch) == NULL. For the initial rule load, insertion of elements takes care of the allocation, but for rule reloads this isn't guaranteed: we might not have additions to the set. Fixes: 3c4287f62044a90e ("nf_tables: Add set type for arbitrary concatenation of ranges") Reported-by: etkaar Signed-off-by: Florian Westphal Reviewed-by: Stefano Brivio Signed-off-by: Pablo Neira Ayuso commit 4e1860a3863707e8177329c006d10f9e37e097a8 Author: Pablo Neira Ayuso Date: Wed Jan 5 16:09:57 2022 +0100 netfilter: nft_payload: do not update layer 4 checksum when mangling fragments IP fragments do not come with the transport header, hence skip bogus layer 4 checksum updates. Fixes: 1814096980bb ("netfilter: nft_payload: layer 4 checksum adjustment for pseudoheader fields") Reported-and-tested-by: Steffen Weinreich Signed-off-by: Pablo Neira Ayuso commit 1585f590a2e5dcae5833b05e030c47229299dd09 Author: Hangbin Liu Date: Mon Dec 27 11:52:53 2021 +0800 selftests: netfilter: switch to socat for tests using -q option The nc cmd(nmap-ncat) that distributed with Fedora/Red Hat does not have option -q. This make some tests failed with: nc: invalid option -- 'q' Let's switch to socat which is far more dependable. Signed-off-by: Hangbin Liu Acked-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 3e1d86569c210ec64398091bd035e539f0e26e81 Author: Atish Patra Date: Thu Nov 18 00:39:12 2021 -0800 RISC-V: KVM: Add SBI HSM extension in KVM SBI HSM extension allows OS to start/stop harts any time. It also allows ordered booting of harts instead of random booting. Implement SBI HSM exntesion and designate the vcpu 0 as the boot vcpu id. All other non-zero non-booting vcpus should be brought up by the OS implementing HSM extension. If the guest OS doesn't implement HSM extension, only single vcpu will be available to OS. Signed-off-by: Atish Patra Signed-off-by: Atish Patra Signed-off-by: Anup Patel commit 5f862df5585cf9d74b97ecaf3078243591f1009f Author: Atish Patra Date: Thu Nov 18 00:39:11 2021 -0800 RISC-V: KVM: Add v0.1 replacement SBI extensions defined in v0.2 The SBI v0.2 contains some of the improved versions of required v0.1 extensions such as remote fence, timer and IPI. This patch implements those extensions. Signed-off-by: Atish Patra Signed-off-by: Atish Patra Signed-off-by: Anup Patel commit c62a76859723fb732bfeda847f22192e24e121a7 Author: Atish Patra Date: Thu Nov 18 00:39:10 2021 -0800 RISC-V: KVM: Add SBI v0.2 base extension SBI v0.2 base extension defined to allow backward compatibility and probing of future extensions. This is also the only mandatory SBI extension that must be implemented by SBI implementors. Signed-off-by: Atish Patra Signed-off-by: Atish Patra Signed-off-by: Anup Patel commit a046c2d8578c93b85ab9272a818c821c254931d0 Author: Atish Patra Date: Thu Nov 18 00:39:09 2021 -0800 RISC-V: KVM: Reorganize SBI code by moving SBI v0.1 to its own file With SBI v0.2, there may be more SBI extensions in future. It makes more sense to group related extensions in separate files. Guest kernel will choose appropriate SBI version dynamically. Move the existing implementation to a separate file so that it can be removed in future without much conflict. Signed-off-by: Atish Patra Signed-off-by: Atish Patra Signed-off-by: Anup Patel commit 73d86812a35965a3eab179abb462b77b4dd8a740 Author: Petr Mladek Date: Wed Jan 5 10:41:57 2022 +0100 MAINTAIERS/printk: Add link to printk git It might also help to avoid confusion with the historic pmladek/printk.git that has got obsoleted by printk/linux.git in February 2020. Acked-by: Andy Shevchenko Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20220105094157.26216-3-pmladek@suse.com commit c5b990c71179763d0dab368ccb85ef46ee055335 Author: Petr Mladek Date: Wed Jan 5 10:41:56 2022 +0100 MAINTAINERS/vsprintf: Update link to printk git tree printk git tree has moved to printk/linux.git in February 2020. Acked-by: Andy Shevchenko Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20220105094157.26216-2-pmladek@suse.com commit cf70be9d214c3ba8dd228cb373f7dc0edfa8da6b Author: Atish Patra Date: Thu Nov 18 00:39:08 2021 -0800 RISC-V: KVM: Mark the existing SBI implementation as v0.1 The existing SBI specification impelementation follows v0.1 specification. The latest specification allows more scalability and performance improvements. Rename the existing implementation as v0.1 and provide a way to allow future extensions. Signed-off-by: Atish Patra Signed-off-by: Atish Patra Signed-off-by: Anup Patel commit cc4f602bc4365d9a8665803a49dddc70eb56f7f1 Author: Sean Christopherson Date: Thu Nov 4 16:41:07 2021 +0000 KVM: RISC-V: Use common KVM implementation of MMU memory caches Use common KVM's implementation of the MMU memory caches, which for all intents and purposes is semantically identical to RISC-V's version, the only difference being that the common implementation will fall back to an atomic allocation if there's a KVM bug that triggers a cache underflow. RISC-V appears to have based its MMU code on arm64 before the conversion to the common caches in commit c1a33aebe91d ("KVM: arm64: Use common KVM implementation of MMU memory caches"), despite having also copy-pasted the definition of KVM_ARCH_NR_OBJS_PER_MEMORY_CACHE in kvm_types.h. Opportunistically drop the superfluous wrapper kvm_riscv_stage2_flush_cache(), whose name is very, very confusing as "cache flush" in the context of MMU code almost always refers to flushing hardware caches, not freeing unused software objects. No functional change intended. Signed-off-by: Sean Christopherson Signed-off-by: Anup Patel commit 54bb4a91b281e1b21235a4bc175e1293e787c016 Author: Oleksandr Tyshchenko Date: Thu Dec 9 22:05:36 2021 +0200 dt-bindings: xen: Clarify "reg" purpose Xen on Arm has gained new support recently to calculate and report extended regions (unused address space) safe to use for external mappings. These regions are reported via "reg" property under "hypervisor" node in the guest device-tree. As region 0 is reserved for grant table space (always present), the indexes for extended regions are 1...N. No device-tree bindings update is needed (except clarifying the text) as guest infers the presence of extended regions from the number of regions in "reg" property. While at it, remove the following sentence: "This property is unnecessary when booting Dom0 using ACPI." for "reg" and "interrupts" properties as the initialization is not done via device-tree "hypervisor" node in that case anyway. Signed-off-by: Oleksandr Tyshchenko Reviewed-by: Stefano Stabellini Acked-by: Rob Herring Link: https://lore.kernel.org/r/1639080336-26573-7-git-send-email-olekstysh@gmail.com Signed-off-by: Juergen Gross commit b2371587fe0c02657db89b67b72efc581bd3f7a0 Author: Oleksandr Tyshchenko Date: Thu Dec 9 22:05:35 2021 +0200 arm/xen: Read extended regions from DT and init Xen resource This patch implements arch_xen_unpopulated_init() on Arm where the extended regions (if any) are gathered from DT and inserted into specific Xen resource to be used as unused address space for Xen scratch pages by unpopulated-alloc code. The extended region (safe range) is a region of guest physical address space which is unused and could be safely used to create grant/foreign mappings instead of wasting real RAM pages from the domain memory for establishing these mappings. The extended regions are chosen by the hypervisor at the domain creation time and advertised to it via "reg" property under hypervisor node in the guest device-tree. As region 0 is reserved for grant table space (always present), the indexes for extended regions are 1...N. If arch_xen_unpopulated_init() fails for some reason the default behaviour will be restored (allocate xenballooned pages). This patch also removes XEN_UNPOPULATED_ALLOC dependency on x86. Signed-off-by: Oleksandr Tyshchenko Reviewed-by: Stefano Stabellini Link: https://lore.kernel.org/r/1639080336-26573-6-git-send-email-olekstysh@gmail.com Signed-off-by: Juergen Gross commit d1a928eac72962b562162c25baf45ce147e27247 Author: Oleksandr Tyshchenko Date: Thu Dec 9 22:05:34 2021 +0200 xen/unpopulated-alloc: Add mechanism to use Xen resource The main reason of this change is that unpopulated-alloc code cannot be used in its current form on Arm, but there is a desire to reuse it to avoid wasting real RAM pages for the grant/foreign mappings. The problem is that system "iomem_resource" is used for the address space allocation, but the really unallocated space can't be figured out precisely by the domain on Arm without hypervisor involvement. For example, not all device I/O regions are known by the time domain starts creating grant/foreign mappings. And following the advise from "iomem_resource" we might end up reusing these regions by a mistake. So, the hypervisor which maintains the P2M for the domain is in the best position to provide unused regions of guest physical address space which could be safely used to create grant/foreign mappings. Introduce new helper arch_xen_unpopulated_init() which purpose is to create specific Xen resource based on the memory regions provided by the hypervisor to be used as unused space for Xen scratch pages. If arch doesn't define arch_xen_unpopulated_init() the default "iomem_resource" will be used. Update the arguments list of allocate_resource() in fill_list() to always allocate a region from the hotpluggable range (maximum possible addressable physical memory range for which the linear mapping could be created). If arch doesn't define arch_get_mappable_range() the default range (0,-1) will be used. The behaviour on x86 won't be changed by current patch as both arch_xen_unpopulated_init() and arch_get_mappable_range() are not implemented for it. Also fallback to allocate xenballooned pages (balloon out RAM pages) if we do not have any suitable resource to work with (target_resource is invalid) and as the result we won't be able to provide unpopulated pages on a request. Signed-off-by: Oleksandr Tyshchenko Reviewed-by: Stefano Stabellini Link: https://lore.kernel.org/r/1639080336-26573-5-git-send-email-olekstysh@gmail.com Signed-off-by: Juergen Gross commit 9dd060afe2dfd4e3f67b6732fdc681e52cd7cbd9 Author: Oleksandr Tyshchenko Date: Thu Dec 9 22:05:33 2021 +0200 xen/balloon: Bring alloc(free)_xenballooned_pages helpers back This patch rolls back some of the changes introduced by commit 121f2faca2c0a "xen/balloon: rename alloc/free_xenballooned_pages" in order to make possible to still allocate xenballooned pages if CONFIG_XEN_UNPOPULATED_ALLOC is enabled. On Arm the unpopulated pages will be allocated on top of extended regions provided by Xen via device-tree (the subsequent patches will add required bits to support unpopulated-alloc feature on Arm). The problem is that extended regions feature has been introduced into Xen quite recently (during 4.16 release cycle). So this effectively means that Linux must only use unpopulated-alloc on Arm if it is running on "new Xen" which advertises these regions. But, it will only be known after parsing the "hypervisor" node at boot time, so before doing that we cannot assume anything. In order to keep working if CONFIG_XEN_UNPOPULATED_ALLOC is enabled and the extended regions are not advertised (Linux is running on "old Xen", etc) we need the fallback to alloc_xenballooned_pages(). This way we wouldn't reduce the amount of memory usable (wasting RAM pages) for any of the external mappings anymore (and eliminate XSA-300) with "new Xen", but would be still functional ballooning out RAM pages with "old Xen". Also rename alloc(free)_xenballooned_pages to xen_alloc(free)_ballooned_pages and make xen_alloc(free)_unpopulated_pages static inline in xen.h if CONFIG_XEN_UNPOPULATED_ALLOC is disabled. Signed-off-by: Oleksandr Tyshchenko Reviewed-by: Stefano Stabellini Link: https://lore.kernel.org/r/1639080336-26573-4-git-send-email-olekstysh@gmail.com Signed-off-by: Juergen Gross commit 5e1cdb8ee5e76bffbc11d300eebbb5193c7de530 Author: Oleksandr Tyshchenko Date: Thu Dec 9 22:05:32 2021 +0200 arm/xen: Switch to use gnttab_setup_auto_xlat_frames() for DT Read the start address of the grant table space from DT (region 0). This patch mostly restores behaviour before commit 3cf4095d7446 ("arm/xen: Use xen_xlate_map_ballooned_pages to setup grant table") but trying not to break the ACPI support added after that commit. So the patch touches DT part only and leaves the ACPI part with xen_xlate_map_ballooned_pages(). Also in order to make a code more resilient use a fallback to xen_xlate_map_ballooned_pages() if grant table region wasn't found. This is a preparation for using Xen extended region feature where unused regions of guest physical address space (provided by the hypervisor) will be used to create grant/foreign/whatever mappings instead of wasting real RAM pages from the domain memory for establishing these mappings. The immediate benefit of this change: - Avoid superpage shattering in Xen P2M when establishing stage-2 mapping (GFN <-> MFN) for the grant table space - Avoid wasting real RAM pages (reducing the amount of memory usuable) for mapping grant table space - The grant table space is always mapped at the exact same place (region 0 is reserved for the grant table) Signed-off-by: Oleksandr Tyshchenko Reviewed-by: Stefano Stabellini Link: https://lore.kernel.org/r/1639080336-26573-3-git-send-email-olekstysh@gmail.com Signed-off-by: Juergen Gross commit fbf3a5c301685f7e9224bf5de9c426cf8f11ae15 Author: Oleksandr Tyshchenko Date: Thu Dec 9 22:05:31 2021 +0200 xen/unpopulated-alloc: Drop check for virt_addr_valid() in fill_list() If memremap_pages() succeeds the range is guaranteed to have proper page table, there is no need for an additional virt_addr_valid() check. Signed-off-by: Oleksandr Tyshchenko Reviewed-by: Boris Ostrovsky Link: https://lore.kernel.org/r/1639080336-26573-2-git-send-email-olekstysh@gmail.com Signed-off-by: Juergen Gross commit 05159e32aa3f7de2bf3f9a5429921d50bf545ced Author: Tom Saeger Date: Thu May 6 15:32:43 2021 -0600 MAINTAINERS: update PCMCIA tree Update location of PCMCIA tree. Signed-off-by: Tom Saeger Signed-off-by: Dominik Brodowski commit 78e0185c25af8d1e20d3bb390c6c1e6b69ae3a52 Author: Dominik Brodowski Date: Fri Oct 15 09:13:23 2021 +0200 pcmcia: use sysfs_emit{,_at} for sysfs output Convert the PCMCIA core and yenta_socket.c to use sysfs_emit or sysfs_emit_at when providing output in sysfs. Signed-off-by: Dominik Brodowski commit 335e4dd67b480c8fa571ea7e71af0d22047fcfb7 Author: Jan Beulich Date: Tue Jan 4 09:46:06 2022 +0100 xen/x86: obtain upper 32 bits of video frame buffer address for Dom0 The hypervisor has been supplying this information for a couple of major releases. Make use of it. The need to set a flag in the capabilities field also points out that the prior setting of that field from the hypervisor interface's gbl_caps one was wrong, so that code gets deleted (there's also no equivalent of this in native boot code). Signed-off-by: Jan Beulich Reviewed-by: Boris Ostrovsky Link: https://lore.kernel.org/r/a3df8bf3-d044-b7bb-3383-cd5239d6d4af@suse.com Signed-off-by: Juergen Gross commit ce2f46f3531a03781181b7f4bd1ff9f8c5086e7e Author: Oleksandr Andrushchenko Date: Fri Dec 10 11:28:17 2021 +0200 xen/gntdev: fix unmap notification order While working with Xen's libxenvchan library I have faced an issue with unmap notifications sent in wrong order if both UNMAP_NOTIFY_SEND_EVENT and UNMAP_NOTIFY_CLEAR_BYTE were requested: first we send an event channel notification and then clear the notification byte which renders in the below inconsistency (cli_live is the byte which was requested to be cleared on unmap): [ 444.514243] gntdev_put_map UNMAP_NOTIFY_SEND_EVENT map->notify.event 6 libxenvchan_is_open cli_live 1 [ 444.515239] __unmap_grant_pages UNMAP_NOTIFY_CLEAR_BYTE at 14 Thus it is not possible to reliably implement the checks like - wait for the notification (UNMAP_NOTIFY_SEND_EVENT) - check the variable (UNMAP_NOTIFY_CLEAR_BYTE) because it is possible that the variable gets checked before it is cleared by the kernel. To fix that we need to re-order the notifications, so the variable is first gets cleared and then the event channel notification is sent. With this fix I can see the correct order of execution: [ 54.522611] __unmap_grant_pages UNMAP_NOTIFY_CLEAR_BYTE at 14 [ 54.537966] gntdev_put_map UNMAP_NOTIFY_SEND_EVENT map->notify.event 6 libxenvchan_is_open cli_live 0 Cc: stable@vger.kernel.org Signed-off-by: Oleksandr Andrushchenko Reviewed-by: Boris Ostrovsky Link: https://lore.kernel.org/r/20211210092817.580718-1-andr2000@gmail.com Signed-off-by: Juergen Gross commit d4b22b2f01de89831052ac28bc40cafbcc043e29 Author: Palmer Dabbelt Date: Fri Nov 19 08:44:12 2021 -0800 RISC-V: defconfigs: Remove redundant CONFIG_EFI=y We've always had CONFIG_EFI as "def_bool y" so this has always been redundant. It's removed by savedefconfig, so drop it to keep things clean. Reviewed-by: Anup Patel Signed-off-by: Palmer Dabbelt commit c2e4ff7fb5c009e59c2ad718ae4cce9fe737d540 Author: Palmer Dabbelt Date: Fri Nov 19 08:44:11 2021 -0800 RISC-V: defconfigs: Remove redundant CONFIG_POWER_RESET As of ab7fbad0c7d7 ("riscv: Fix unmet direct dependencies built based on SOC_VIRT") we select CONFIG_POWER_RESET=y along with CONFIG_SOC_VIRT, which is already in defconfig. This make setting CONFIG_POWER_RESET in the defconfigs redundant, so remove it to remain consistent with savedefconfig. Reviewed-by: Anup Patel Signed-off-by: Palmer Dabbelt commit bd72a95f96abefa36f52b092d1300d6752485999 Author: Palmer Dabbelt Date: Fri Nov 19 08:44:10 2021 -0800 RISC-V: defconfigs: Sort CONFIG_BLK_DEV_BSG This should have no functional change, it just sorts CONFIG_BLK_DEV_BSG the same way savedefconfig does. Reviewed-by: Anup Patel Signed-off-by: Palmer Dabbelt commit 2fadc6ea4a082fa84df29ff40cfd67268770fa16 Author: Palmer Dabbelt Date: Fri Nov 19 08:44:09 2021 -0800 RISC-V: defconfigs: Sort CONFIG_SURFACE_PLATFORMS This should have no functional change, it just sorts CONFIG_SURFACE_PLATFORMS the same way savedefconfig does. Reviewed-by: Anup Patel Signed-off-by: Palmer Dabbelt commit a7e9fbef867d2e1af316f9009bd714328aa0507a Author: Palmer Dabbelt Date: Fri Nov 19 08:44:08 2021 -0800 RISC-V: defconfigs: Sort CONFIG_MMC This should have no functional change, it just sorts CONFIG_MMC the same way savedefconfig does. This only touches the rv64 defconfig because rv32_defconfig was already sorted correctly. Reviewed-by: Anup Patel Signed-off-by: Palmer Dabbelt commit 23592d5add3d87e90cb4129dbe352e1088ca7264 Author: Palmer Dabbelt Date: Fri Nov 19 08:44:07 2021 -0800 RISC-V: defconfigs: Sort CONFIG_PTP_1588_CLOCK This should have no functional change, it just sorts CONFIG_PTP_1588_CLOCK the same way savedefconfig does. This only touches the rv64 defconfig because rv32_defconfig was already sorted correctly. Reviewed-by: Anup Patel Signed-off-by: Palmer Dabbelt commit a669a1f4ea80d22310b6ec0bd65e05cd3725e187 Author: Palmer Dabbelt Date: Fri Nov 19 08:44:06 2021 -0800 RISC-V: defconfigs: Sort CONFIG_SOC_POLARFIRE This should have no functional change, it just sorts CONFIG_SOC_POLARFIRE the same way savedefconfig does. Reviewed-by: Anup Patel Signed-off-by: Palmer Dabbelt commit f8bbea649c9f9d35f026adaf77bae13b3586d9b1 Author: Palmer Dabbelt Date: Fri Nov 19 08:44:05 2021 -0800 RISC-V: defconfigs: Sort CONFIG_SYSFS_SYSCALL This should have no functional change, it just sorts CONFIG_SYSFS_SYSCALL the same way savedefconfig does. Reviewed-by: Anup Patel Signed-off-by: Palmer Dabbelt commit 61063ad3e90af1a335dafd00b38eecf545088519 Author: Palmer Dabbelt Date: Fri Nov 19 08:44:04 2021 -0800 RISC-V: defconfigs: Sort CONFIG_BPF_SYSCALL This should have no functional change, it just sorts CONFIG_BPF_SYSCALL the same way savedefconfig does. Reviewed-by: Anup Patel Signed-off-by: Palmer Dabbelt commit 9f36b96bc70f9707e618d22cd6a6baf86706ade2 Author: Palmer Dabbelt Date: Fri Nov 19 08:44:03 2021 -0800 RISC-V: MAXPHYSMEM_2GB doesn't depend on CMODEL_MEDLOW For non-relocatable kernels we need to be able to link the kernel at approximately PAGE_OFFSET, thus requiring medany (as medlow requires the code to be linked within 2GiB of 0). The inverse doesn't apply, though: since medany code can be linked anywhere it's fine to link it close to 0, so we can support the smaller memory config. Fixes: de5f4b8f634b ("RISC-V: Define MAXPHYSMEM_1GB only for RV32") Reviewed-by: Anup Patel Signed-off-by: Palmer Dabbelt commit 3d12b634fe8206ea974c6061a3f3eea529ffbc48 Author: Palmer Dabbelt Date: Fri Nov 19 08:44:02 2021 -0800 RISC-V: defconfigs: Set CONFIG_FB=y, for FB console We have CONFIG_FRAMEBUFFER_CONSOLE=y in the defconfigs, but that depends on CONFIG_FB so it's not actually getting set. I'm assuming most users on real systems want a framebuffer console, so this enables CONFIG_FB to allow that to take effect. Fixes: 33c57c0d3c67 ("RISC-V: Add a basic defconfig") Reviewed-by: Anup Patel Signed-off-by: Palmer Dabbelt commit 1372d34ccf6dd480332b2bcb2fd59a2b9a0df415 Author: Toke Høiland-Jørgensen Date: Mon Jan 3 16:08:10 2022 +0100 xdp: Add xdp_do_redirect_frame() for pre-computed xdp_frames Add an xdp_do_redirect_frame() variant which supports pre-computed xdp_frame structures. This will be used in bpf_prog_run() to avoid having to write to the xdp_frame structure when the XDP program doesn't modify the frame boundaries. Signed-off-by: Toke Høiland-Jørgensen Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220103150812.87914-6-toke@redhat.com commit d53ad5d8b218a885e95080d4d3d556b16b91b1b9 Author: Toke Høiland-Jørgensen Date: Mon Jan 3 16:08:09 2022 +0100 xdp: Move conversion to xdp_frame out of map functions All map redirect functions except XSK maps convert xdp_buff to xdp_frame before enqueueing it. So move this conversion of out the map functions and into xdp_do_redirect(). This removes a bit of duplicated code, but more importantly it makes it possible to support caller-allocated xdp_frame structures, which will be added in a subsequent commit. Signed-off-by: Toke Høiland-Jørgensen Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220103150812.87914-5-toke@redhat.com commit 64693ec7774e471f817a725686d93903e919a2e5 Author: Toke Høiland-Jørgensen Date: Mon Jan 3 16:08:08 2022 +0100 page_pool: Store the XDP mem id Store the XDP mem ID inside the page_pool struct so it can be retrieved later for use in bpf_prog_run(). Signed-off-by: Toke Høiland-Jørgensen Signed-off-by: Alexei Starovoitov Acked-by: Jesper Dangaard Brouer Link: https://lore.kernel.org/bpf/20220103150812.87914-4-toke@redhat.com commit 35b2e549894b7ef0b6e7f3a70c2ab75b767cfce9 Author: Toke Høiland-Jørgensen Date: Mon Jan 3 16:08:07 2022 +0100 page_pool: Add callback to init pages when they are allocated Add a new callback function to page_pool that, if set, will be called every time a new page is allocated. This will be used from bpf_test_run() to initialise the page data with the data provided by userspace when running XDP programs with redirect turned on. Signed-off-by: Toke Høiland-Jørgensen Signed-off-by: Alexei Starovoitov Acked-by: John Fastabend Acked-by: Jesper Dangaard Brouer Link: https://lore.kernel.org/bpf/20220103150812.87914-3-toke@redhat.com commit 4a48ef70b93b8c7ed5190adfca18849e76387b80 Author: Toke Høiland-Jørgensen Date: Mon Jan 3 16:08:06 2022 +0100 xdp: Allow registering memory model without rxq reference The functions that register an XDP memory model take a struct xdp_rxq as parameter, but the RXQ is not actually used for anything other than pulling out the struct xdp_mem_info that it embeds. So refactor the register functions and export variants that just take a pointer to the xdp_mem_info. This is in preparation for enabling XDP_REDIRECT in bpf_prog_run(), using a page_pool instance that is not connected to any network device. Signed-off-by: Toke Høiland-Jørgensen Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220103150812.87914-2-toke@redhat.com commit 5a7ac592c56c62935fea9b1ce9c24579986083b8 Author: Kefeng Wang Date: Mon Sep 27 11:03:25 2021 +0800 riscv: mm: Enable PMD split page table lock for RV64 After commit 1355c31eeb7e ("asm-generic: pgalloc: provide generic pmd_alloc_one() and pmd_free_one()"), the main part to support PMD split page table lock is in asm-generic/pgalloc.h. The only change is add pgtable_pmd_page_ctor() into alloc_pmd_late(), then we could enable ARCH_ENABLE_SPLIT_PMD_PTLOCK for RV64. Reviewed-by: Alexandre Ghiti Signed-off-by: Kefeng Wang Signed-off-by: Palmer Dabbelt commit 7cc8c75b54fa6d2c0a802b915feecad3abe6ddd7 Author: Alexandre Ghiti Date: Thu Nov 18 14:45:39 2021 +0100 riscv: Make vmalloc/vmemmap end equal to the start of the next region We used to define VMALLOC_END equal to the start of the next region *minus one* which is inconsistent with the use of this define in the core code (for example, see the definitions of VMALLOC_TOTAL and is_vmalloc_addr). And then make the definition of VMEMMAP_END consistent with VMALLOC_END and all other regions actually. Signed-off-by: Alexandre Ghiti Reviewed-by: Jisheng Zhang Signed-off-by: Palmer Dabbelt commit 1f77ed9422cbc41e1a5d17654b7e527a4a23b665 Merge: dacef016c088f a2ceb8c4efce9 Author: Palmer Dabbelt Date: Wed Jan 5 19:14:31 2022 -0800 riscv: switch to relative extable and other improvements Similar as other architectures such as arm64, x86 and so on, use offsets relative to the exception table entry values rather than absolute addresses for both the exception locationand the fixup. And recently, arm64 and x86 remove anonymous out-of-line fixups, we want to acchieve the same result. commit a2ceb8c4efce97a9392084f45c072b0ec8e36701 Author: Jisheng Zhang Date: Thu Nov 18 19:27:21 2021 +0800 riscv: vmlinux.lds.S|vmlinux-xip.lds.S: remove `.fixup` section These are no longer necessary now that we have a more standard extable mechanism. Signed-off-by: Jisheng Zhang Signed-off-by: Palmer Dabbelt commit 20802d8d477d5771368fdac8d476285adc713af0 Author: Jisheng Zhang Date: Thu Nov 18 19:26:51 2021 +0800 riscv: extable: add a dedicated uaccess handler Inspired by commit 2e77a62cb3a6 ("arm64: extable: add a dedicated uaccess handler"), do similar to riscv to add a dedicated uaccess exception handler to update registers in exception context and subsequently return back into the function which faulted, so we remove the need for fixups specialized to each faulting instruction. Signed-off-by: Jisheng Zhang Signed-off-by: Palmer Dabbelt commit 640a171c9347b52da668dbf83473a05572f06055 Merge: 5f60826428140 eb68db45b7477 Author: Alexei Starovoitov Date: Wed Jan 5 17:53:25 2022 -0800 Merge branch 'samples/bpf: xdpsock app enhancements' Ong Boon says: ==================== First of all, sorry for taking more time to get back to this series and thanks to all valuble feedback in series-1 at [1] from Jesper and Song Liu. Since then I have looked into what Jesper suggested in [2] and worked on revising the patch series into several patches for ease of review: v1->v2: 1/7: [No change]. Add VLAN tag (ID & Priority) to the generated Tx-Only frames. 2/7: [No change]. Add DMAC and SMAC setting to the generated Tx-Only frames. If parameters are not set, previous DMAC and SMAC are used. 3/7: [New]. Add support for selecting different CLOCK for clock_gettime() used in get_nsecs. 4/7: [New]. This is a total rework from series-1 3/4-patch [3]. It uses clock_nanosleep() suggested by Jesper. In addition, added statistic for Tx schedule variance under application stat (-a|--app-stats). Make the cyclic Tx operation and --poll mode to be mutually- exclusive. Still, the ability to specify TX cycle time and used together with batch size and packet count remain the same. 5/7: [New]. Add the support for TX process schedule policy and priority setting. By default, SCHED_OTHER policy is used. This too is matching the schedule policy setting in [2]. 6/7: [Change]. This is update from series-1 4/4-patch [4]. Added TX clean process time-out in 1s granularity with configurable retries count (-O|--retries). 7/7: [New]. Added timestamp for TX packet following pktgen_hdr format matching the implementation in [2]. However, the sequence ID remains the same as it is instead of process schedule diff in [2]. To summarize on what program options have been added with v2 series using an example below:- DMAC (-G) = fa:8d:f1:e2:0b:e8 SMAC (-H) = ce:17:07:17:3e:3a VLAN tagged (-V) VLAN ID (-J) = 12 VLAN Pri (-K) = 3 Tx Queue (-q) = 3 Cycle Time in us (-T) = 1000 Batch (-b) = 2 Packet Count = 6 Tx schedule policy (-W) = FIFO Tx schedule priority (-U) = 50 Clock selection (-w) = REALTIME Tx timeout retries(-O) = 5 Tx timestamp (-y) Cyclic Tx schedule stat (-a) Note: xdpsock sets UDP dest-port and src-port to 0x1000 as default. Sending Board ============= $ xdpsock -i eth0 -t -N -z -H ce:17:07:17:3e:3a -G fa:8d:f1:e2:0b:e8 \ -V -J 12 -K 3 -q 3 \ -T 1000 -b 2 -C 6 -W FIFO -U 50 -w REALTIME \ -O 5 -y -a sock0@eth0:3 txonly xdp-drv pps pkts 0.00 rx 0 0 tx 0 6 calls/s count rx empty polls 0 0 fill fail polls 0 0 copy tx sendtos 0 0 tx wakeup sendtos 0 5 opt polls 0 0 period min ave max cycle Cyclic TX 1000000 31033 32009 33397 3 Receiving Board =============== $ tcpdump -nei eth0 udp port 0x1000 -vv -Q in -X \ --time-stamp-precision nano tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes 03:46:40.520111580 ce:17:07:17:3e:3a > fa:8d:f1:e2:0b:e8, ethertype 802.1Q (0x8100), length 62: vlan 12, p 3, ethertype IPv4, (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto UDP (17), length 44) 10.10.10.16.4096 > 10.10.10.32.4096: [udp sum ok] UDP, length 16 0x0000: 4500 002c 0000 0000 4011 527e 0a0a 0a10 E..,....@.R~.... 0x0010: 0a0a 0a20 1000 1000 0018 e997 be9b e955 ...............U 0x0020: 0000 0000 61cd 2ba1 0006 987c ....a.+....| 03:46:40.520112163 ce:17:07:17:3e:3a > fa:8d:f1:e2:0b:e8, ethertype 802.1Q (0x8100), length 62: vlan 12, p 3, ethertype IPv4, (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto UDP (17), length 44) 10.10.10.16.4096 > 10.10.10.32.4096: [udp sum ok] UDP, length 16 0x0000: 4500 002c 0000 0000 4011 527e 0a0a 0a10 E..,....@.R~.... 0x0010: 0a0a 0a20 1000 1000 0018 e996 be9b e955 ...............U 0x0020: 0000 0001 61cd 2ba1 0006 987c ....a.+....| 03:46:40.521066860 ce:17:07:17:3e:3a > fa:8d:f1:e2:0b:e8, ethertype 802.1Q (0x8100), length 62: vlan 12, p 3, ethertype IPv4, (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto UDP (17), length 44) 10.10.10.16.4096 > 10.10.10.32.4096: [udp sum ok] UDP, length 16 0x0000: 4500 002c 0000 0000 4011 527e 0a0a 0a10 E..,....@.R~.... 0x0010: 0a0a 0a20 1000 1000 0018 e5af be9b e955 ...............U 0x0020: 0000 0002 61cd 2ba1 0006 9c62 ....a.+....b 03:46:40.521067012 ce:17:07:17:3e:3a > fa:8d:f1:e2:0b:e8, ethertype 802.1Q (0x8100), length 62: vlan 12, p 3, ethertype IPv4, (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto UDP (17), length 44) 10.10.10.16.4096 > 10.10.10.32.4096: [udp sum ok] UDP, length 16 0x0000: 4500 002c 0000 0000 4011 527e 0a0a 0a10 E..,....@.R~.... 0x0010: 0a0a 0a20 1000 1000 0018 e5ae be9b e955 ...............U 0x0020: 0000 0003 61cd 2ba1 0006 9c62 ....a.+....b 03:46:40.522061935 ce:17:07:17:3e:3a > fa:8d:f1:e2:0b:e8, ethertype 802.1Q (0x8100), length 62: vlan 12, p 3, ethertype IPv4, (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto UDP (17), length 44) 10.10.10.16.4096 > 10.10.10.32.4096: [udp sum ok] UDP, length 16 0x0000: 4500 002c 0000 0000 4011 527e 0a0a 0a10 E..,....@.R~.... 0x0010: 0a0a 0a20 1000 1000 0018 e1c5 be9b e955 ...............U 0x0020: 0000 0004 61cd 2ba1 0006 a04a ....a.+....J 03:46:40.522062173 ce:17:07:17:3e:3a > fa:8d:f1:e2:0b:e8, ethertype 802.1Q (0x8100), length 62: vlan 12, p 3, ethertype IPv4, (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto UDP (17), length 44) 10.10.10.16.4096 > 10.10.10.32.4096: [udp sum ok] UDP, length 16 0x0000: 4500 002c 0000 0000 4011 527e 0a0a 0a10 E..,....@.R~.... 0x0010: 0a0a 0a20 1000 1000 0018 e1c4 be9b e955 ...............U 0x0020: 0000 0005 61cd 2ba1 0006 a04a ....a.+....J I have tested the above with both tagged and untagged packet format and based on the timestamp in tcpdump found that the timing of the batch cyclic transmission is correct. Appreciate if community can give the patch series v2 a try and point out any gap. Thanks Boon Leong [1] https://patchwork.kernel.org/project/netdevbpf/cover/20211124091821.3916046-1-boon.leong.ong@intel.com/ [2] https://github.com/netoptimizer/network-testing/blob/master/src/udp_pacer.c [3] https://patchwork.kernel.org/project/netdevbpf/patch/20211124091821.3916046-4-boon.leong.ong@intel.com/ [4] https://patchwork.kernel.org/project/netdevbpf/patch/20211124091821.3916046-5-boon.leong.ong@intel.com/ ==================== Signed-off-by: Alexei Starovoitov commit eb68db45b747756c351ea84e9af55a69468d0549 Author: Ong Boon Leong Date: Thu Dec 30 11:54:47 2021 +0800 samples/bpf: xdpsock: Add timestamp for Tx-only operation It may be useful to add timestamp for Tx packets for continuous or cyclic transmit operation. The timestamp and sequence ID of a Tx packet are stored according to pktgen header format. To enable per-packet timestamp, use -y|--tstamp option. If timestamp is off, pktgen header is not included in the UDP payload. This means receiving side can use the magic number for pktgen for differentiation. The implementation supports both VLAN tagged and untagged option. By default, the minimum packet size is set at 64B. However, if VLAN tagged is on (-V), the minimum packet size is increased to 66B just so to fit the pktgen_hdr size. Added hex_dump() into the code path just for future cross-checking. As before, simply change to "#define DEBUG_HEXDUMP 1" to inspect the accuracy of TX packet. Signed-off-by: Ong Boon Leong Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211230035447.523177-8-boon.leong.ong@intel.com commit 8121e78932018df48758985e00651e16ff34ae5f Author: Ong Boon Leong Date: Thu Dec 30 11:54:46 2021 +0800 samples/bpf: xdpsock: Add time-out for cleaning Tx When user sets tx-pkt-count and in case where there are invalid Tx frame, the complete_tx_only_all() process polls indefinitely. So, this patch adds a time-out mechanism into the process so that the application can terminate automatically after it retries 3*polling interval duration. v1->v2: Thanks to Jesper's and Song Liu's suggestion. - clean-up git message to remove polling log - make the Tx time-out retries configurable with 1s granularity Signed-off-by: Ong Boon Leong Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211230035447.523177-7-boon.leong.ong@intel.com commit fa24d0b1d57825d1a5b802339728d4d8ac20b6d6 Author: Ong Boon Leong Date: Thu Dec 30 11:54:45 2021 +0800 samples/bpf: xdpsock: Add sched policy and priority support By default, TX schedule policy is SCHED_OTHER (round-robin time-sharing). To improve TX cyclic scheduling, we add SCHED_FIFO policy and its priority by using -W FIFO or --policy=FIFO and -U or --schpri=. A) From xdpsock --app-stats, for SCHED_OTHER policy: $ xdpsock -i eth0 -t -N -z -T 1000 -b 16 -C 100000 -a period min ave max cycle Cyclic TX 1000000 53507 75334 712642 6250 B) For SCHED_FIFO policy and schpri=50: $ xdpsock -i eth0 -t -N -z -T 1000 -b 16 -C 100000 -a -W FIFO -U 50 period min ave max cycle Cyclic TX 1000000 3699 24859 54397 6250 Signed-off-by: Ong Boon Leong Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211230035447.523177-6-boon.leong.ong@intel.com commit fa0d27a1d5a8c1f07b0229348b0d178233694fbc Author: Ong Boon Leong Date: Thu Dec 30 11:54:44 2021 +0800 samples/bpf: xdpsock: Add cyclic TX operation capability Tx cycle time is in micro-seconds unit. By combining the batch size (-b M) and Tx cycle time (-T|--tx-cycle N), xdpsock now can transmit batch-size of packets every N-us periodically. Cyclic TX operation is not applicable if --poll mode is used. To transmit 16 packets every 1ms cycle time for total of 100000 packets silently: $ xdpsock -i eth0 -T -N -z -T 1000 -b 16 -C 100000 To print cyclic TX schedule variance stats, use --app-stats|-a: $ xdpsock -i eth0 -T -N -z -T 1000 -b 16 -C 100000 -a sock0@eth0:0 txonly xdp-drv pps pkts 0.00 rx 0 0 tx 0 100000 calls/s count rx empty polls 0 0 fill fail polls 0 0 copy tx sendtos 0 0 tx wakeup sendtos 0 6254 opt polls 0 0 period min ave max cycle Cyclic TX 1000000 53507 75334 712642 6250 Signed-off-by: Ong Boon Leong Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211230035447.523177-5-boon.leong.ong@intel.com commit 5a3882542acda1ac5f0a22dddf7f7f8533d3a8cc Author: Ong Boon Leong Date: Thu Dec 30 11:54:43 2021 +0800 samples/bpf: xdpsock: Add clockid selection support User specifies the clock selection by using -w CLOCK or --clock=CLOCK where CLOCK=[REALTIME, TAI, BOOTTIME, MONOTONIC]. The default CLOCK selection is MONOTONIC. The implementation of clock selection parsing is borrowed from iproute2/tc/q_taprio.c Signed-off-by: Ong Boon Leong Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211230035447.523177-4-boon.leong.ong@intel.com commit 6440a6c23f6c72c57dbdf7928d92d3fc1aef6edc Author: Ong Boon Leong Date: Thu Dec 30 11:54:42 2021 +0800 samples/bpf: xdpsock: Add Dest and Src MAC setting for Tx-only operation To set Dest MAC address (-G|--tx-dmac) only: $ xdpsock -i eth0 -t -N -z -G aa:bb:cc:dd:ee:ff To set Source MAC address (-H|--tx-smac) only: $ xdpsock -i eth0 -t -N -z -H 11:22:33:44:55:66 To set both Dest and Source MAC address: $ xdpsock -i eth0 -t -N -z -G aa:bb:cc:dd:ee:ff \ -H 11:22:33:44:55:66 The default Dest and Source MAC address remain the same as before. Signed-off-by: Ong Boon Leong Signed-off-by: Alexei Starovoitov Acked-by: Song Liu Acked-by: Jesper Dangaard Brouer Link: https://lore.kernel.org/bpf/20211230035447.523177-3-boon.leong.ong@intel.com commit 2741a0493c04067d7acb0e44035aa27618b7d204 Author: Ong Boon Leong Date: Thu Dec 30 11:54:41 2021 +0800 samples/bpf: xdpsock: Add VLAN support for Tx-only operation In multi-queue environment testing, the support for VLAN-tag based steering is useful. So, this patch adds the capability to add VLAN tag (VLAN ID and Priority) to the generated Tx frame. To set the VLAN ID=10 and Priority=2 for Tx only through TxQ=3: $ xdpsock -i eth0 -t -N -z -q 3 -V -J 10 -K 2 If VLAN ID (-J) and Priority (-K) is set, it default to VLAN ID = 1 VLAN Priority = 0. For example, VLAN-tagged Tx only, xdp copy mode through TxQ=1: $ xdpsock -i eth0 -t -N -c -q 1 -V Signed-off-by: Ong Boon Leong Signed-off-by: Alexei Starovoitov Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20211230035447.523177-2-boon.leong.ong@intel.com commit ff4b8cad3a81b3e55b143c689686134d134e2416 Author: Jisheng Zhang Date: Thu Nov 18 19:26:29 2021 +0800 riscv: add gpr-num.h This defines the mapping from ABI names to X registers. Signed-off-by: Jisheng Zhang Signed-off-by: Palmer Dabbelt commit 2bf847db0c7437c28b10fba2981b9a7db4b4e0e2 Author: Jisheng Zhang Date: Thu Nov 18 19:26:05 2021 +0800 riscv: extable: add `type` and `data` fields This is a riscv port of commit d6e2cc564775 ("arm64: extable: add `type` and `data` fields"). Signed-off-by: Jisheng Zhang Signed-off-by: Palmer Dabbelt commit 6dd10d9166a0c06260e0ac6b1fac454117c8024a Author: Jisheng Zhang Date: Thu Nov 18 19:25:45 2021 +0800 riscv: extable: consolidate definitions This is a riscv port of commit 819771cc2892 ("arm64: extable: consolidate definitions"). Signed-off-by: Jisheng Zhang Signed-off-by: Palmer Dabbelt commit 9d504f9aa5c1b76673018da9503e76b351a24b8c Author: Jisheng Zhang Date: Thu Nov 18 19:25:14 2021 +0800 riscv: lib: uaccess: fold fixups into body uaccess functions such __asm_copy_to_user(), __arch_copy_from_user() and __clear_user() place their exception fixups in the `.fixup` section without any clear association with themselves. If we backtrace the fixup code, it will be symbolized as an offset from the nearest prior symbol. Similar as arm64 does, we must move fixups into the body of the functions themselves, after the usual fast-path returns. Signed-off-by: Jisheng Zhang Signed-off-by: Palmer Dabbelt commit 4c2e7ce8b9864fa1c5f9fc5ea19af11205730cd6 Author: Jisheng Zhang Date: Thu Nov 18 19:24:42 2021 +0800 riscv: extable: use `ex` for `exception_table_entry` The var name "fixup" is a bit confusing, since this is a exception_table_entry. Use "ex" instead to refer to an entire entry. In subsequent patches we'll use `fixup` to refer to the fixup field specifically. Signed-off-by: Jisheng Zhang Signed-off-by: Palmer Dabbelt commit ef127bca1129d3d15f909f9215b9431a2f67555a Author: Jisheng Zhang Date: Thu Nov 18 19:24:14 2021 +0800 riscv: extable: make fixup_exception() return bool The return values of fixup_exception() and riscv_bpf_fixup_exception() represent a boolean condition rather than an error code, so it's better to return `bool` rather than `int`. Signed-off-by: Jisheng Zhang Signed-off-by: Palmer Dabbelt commit c07935cb3ccf37acc5df079074ba20a720716f7a Author: Jisheng Zhang Date: Thu Nov 18 19:23:21 2021 +0800 riscv: bpf: move rv_bpf_fixup_exception signature to extable.h This is to group riscv related extable related functions signature into one file. Signed-off-by: Jisheng Zhang Signed-off-by: Palmer Dabbelt commit bb1f85d6046f0db757ac52ed60a5eba5df394819 Author: Jisheng Zhang Date: Thu Nov 18 19:22:51 2021 +0800 riscv: switch to relative exception tables Similar as other architectures such as arm64, x86 and so on, use offsets relative to the exception table entry values rather than absolute addresses for both the exception locationand the fixup. However, RISCV label difference will actually produce two relocations, a pair of R_RISCV_ADD32 and R_RISCV_SUB32. Take below simple code for example: $ cat test.S .section .text 1: nop .section __ex_table,"a" .balign 4 .long (1b - .) .previous $ riscv64-linux-gnu-gcc -c test.S $ riscv64-linux-gnu-readelf -r test.o Relocation section '.rela__ex_table' at offset 0x100 contains 2 entries: Offset Info Type Sym. Value Sym. Name + Addend 000000000000 000600000023 R_RISCV_ADD32 0000000000000000 .L1^B1 + 0 000000000000 000500000027 R_RISCV_SUB32 0000000000000000 .L0 + 0 The modpost will complain the R_RISCV_SUB32 relocation, so we need to patch modpost.c to skip this relocation for .rela__ex_table section. After this patch, the __ex_table section size of defconfig vmlinux is reduced from 7072 Bytes to 3536 Bytes. Signed-off-by: Jisheng Zhang Reviewed-by: Kefeng Wang Signed-off-by: Palmer Dabbelt commit f8f2ad02ee438b7dbceaac947077eaf77c823646 Author: Jisheng Zhang Date: Thu Nov 18 19:22:27 2021 +0800 riscv: consolidate __ex_table construction Consolidate all the __ex_table constuction code with a _ASM_EXTABLE helper. There should be no functional change as a result of this patch. Signed-off-by: Jisheng Zhang Reviewed-by: Kefeng Wang Signed-off-by: Palmer Dabbelt commit ddad0b88d5032e1c4a2a94b46aeadada4e4d8a72 Author: Jisheng Zhang Date: Thu Nov 18 19:22:00 2021 +0800 riscv: remove unused __cmpxchg_user() macro This macro is defined but not used, remove it. Signed-off-by: Jisheng Zhang Signed-off-by: Palmer Dabbelt commit 5dcc0ef8873ea4753a4f60f049c3acb5476cfa7b Author: Sudeep Holla Date: Fri Oct 15 16:00:43 2021 +0100 clk: Drop unused COMMON_CLK_STM32MP157_SCMI config Commit 21e743300dd0 ("clk: stm32mp1: new compatible for secure RCC support") introduced a new Kconfig option COMMON_CLK_STM32MP157_SCMI which is not used anywhere. Further, it looks like this Kconfig option is just to select bunch of other options which doesn't sound correct to me. There is no need for another SCMI firmware based clock driver and hence the same applies for the config option too. Let us just drop the unused COMMON_CLK_STM32MP157_SCMI before it gives someone idea to write a specific clock driver for this SoC/platform. Cc: Etienne Carriere Cc: Gabriel Fernandez Cc: Stephen Boyd Signed-off-by: Sudeep Holla Link: https://lore.kernel.org/r/20211015150043.140793-1-sudeep.holla@arm.com Reviewed-by: Cristian Marussi Signed-off-by: Stephen Boyd commit 810251b0d36af694ece65146112a2bb541f758fb Author: Alain Volmat Date: Sat Dec 18 22:11:57 2021 +0100 clk: st: clkgen-mux: search reg within node or parent In order to avoid having duplicated addresses within the DT, only have one unit-address per clockgen and each driver within the clockgen should look at the parent node (overall clockgen) to figure out the reg property. Such behavior is already in place in other STi platform clock drivers such as clk-flexgen and clkgen-pll. Keep backward compatibility by first looking at reg within the node before looking into the parent node. Signed-off-by: Alain Volmat Link: https://lore.kernel.org/r/20211218211157.188214-3-avolmat@me.com Reviewed-by: Patrice Chotard Signed-off-by: Stephen Boyd commit 3efe64ef5186c20c9ed4aeb771a7bc3225d0671b Author: Alain Volmat Date: Sat Dec 18 22:11:56 2021 +0100 clk: st: clkgen-fsyn: search reg within node or parent In order to avoid having duplicated addresses within the DT, only have one unit-address per clockgen and each driver within the clockgen should look at the parent node (overall clockgen) to figure out the reg property. Such behavior is already in place in other STi platform clock drivers such as clk-flexgen and clkgen-pll. Keep backward compatibility by first looking at reg within the node before looking into the parent node. Signed-off-by: Alain Volmat Link: https://lore.kernel.org/r/20211218211157.188214-2-avolmat@me.com Reviewed-by: Patrice Chotard Signed-off-by: Stephen Boyd commit 1bb294a7981c737e2311a78e4086635ac0220ace Author: Taniya Das Date: Mon Dec 20 22:13:55 2021 +0530 clk: Enable/Disable runtime PM for clk_summary The registers for some clocks in the SOC area, which are under the power domain are required to be enabled before accessing them. During the clk_summary if the power-domains are not enabled they could result into NoC errors. Thus ensure the register access of the clock controller is done with pm_untime_get/put functions. Signed-off-by: Taniya Das Link: https://lore.kernel.org/r/1640018638-19436-3-git-send-email-tdas@codeaurora.org Signed-off-by: Stephen Boyd commit 4e023b44d5cec470df1366a93112293cceddc3e8 Merge: 87eee9c5589e1 e015593573b3e Author: Jakub Kicinski Date: Wed Jan 5 17:18:07 2022 -0800 Merge branch 'net-lantiq_xrx200-improve-ethernet-performance' Aleksander Jan Bajkowski says: ==================== net: lantiq_xrx200: improve ethernet performance This patchset improves Ethernet performance by 15%. NAT Performance results on BT Home Hub 5A (kernel 5.10.89, mtu 1500): Down Up Before 539 Mbps 599 Mbps After 624 Mbps 695 Mbps ==================== Link: https://lore.kernel.org/r/20220104151144.181736-1-olek2@wp.pl Signed-off-by: Jakub Kicinski commit e015593573b3e3f74bd8a63c05fa92902194a354 Author: Aleksander Jan Bajkowski Date: Tue Jan 4 16:11:44 2022 +0100 net: lantiq_xrx200: convert to build_skb We can increase the efficiency of rx path by using buffers to receive packets then build SKBs around them just before passing into the network stack. In contrast, preallocating SKBs too early reduces CPU cache efficiency. NAT Performance results on BT Home Hub 5A (kernel 5.10.89, mtu 1500): Down Up Before 577 Mbps 648 Mbps After 624 Mbps 695 Mbps Signed-off-by: Aleksander Jan Bajkowski Signed-off-by: Jakub Kicinski commit 768818d772d5d4ddc0c7eb2e62848929270ab7a3 Author: Aleksander Jan Bajkowski Date: Tue Jan 4 16:11:43 2022 +0100 net: lantiq_xrx200: increase napi poll weigth NAT Performance results on BT Home Hub 5A (kernel 5.10.89, mtu 1500): Down Up Before 545 Mbps 625 Mbps After 577 Mbps 648 Mbps Signed-off-by: Aleksander Jan Bajkowski Signed-off-by: Jakub Kicinski commit 5112e9234bbb89f8dd15c983206bd9107b8436d5 Author: Aleksander Jan Bajkowski Date: Tue Jan 4 16:11:42 2022 +0100 MIPS: lantiq: dma: increase descritor count NAT Performance results on BT Home Hub 5A (kernel 5.10.89, mtu 1500): Down Up Before 539 Mbps 599 Mbps After 545 Mbps 625 Mbps Signed-off-by: Aleksander Jan Bajkowski Signed-off-by: Jakub Kicinski commit 70faf946ad975c64efb2eb809f9139f304a494b0 Author: Nobuhiro Iwamatsu Date: Mon Oct 25 12:10:38 2021 +0900 MAINTAINERS: Add entries for Toshiba Visconti PLL and clock controller Add entries for Toshiba Visconti PLL and clock controller binding and driver. Signed-off-by: Nobuhiro Iwamatsu Link: https://lore.kernel.org/r/20211025031038.4180686-5-nobuhiro1.iwamatsu@toshiba.co.jp Signed-off-by: Stephen Boyd commit b4cbe606dc3674b25cb661e7cd1a1c6ddaaafaaa Author: Nobuhiro Iwamatsu Date: Mon Oct 25 12:10:37 2021 +0900 clk: visconti: Add support common clock driver and reset driver Add support for common interface of the common clock and reset driver for Toshiba Visconti5 and its SoC, TMPV7708. The PIPLLCT provides the PLL, and the PISMU provides clock and reset functionality. Each drivers are provided in this patch. Signed-off-by: Nobuhiro Iwamatsu Link: https://lore.kernel.org/r/20211025031038.4180686-4-nobuhiro1.iwamatsu@toshiba.co.jp [sboyd@kernel.org: Add bitfield.h include to pll.c] Signed-off-by: Stephen Boyd commit 87eee9c5589e1e546537a38a72e7ea3f0a7cac60 Author: Miroslav Lichvar Date: Wed Jan 5 16:25:06 2022 +0100 testptp: set pin function before other requests When the -L option of the testptp utility is specified with other options (e.g. -p to enable PPS output), the user probably wants to apply it to the pin configured by the -L option. Reorder the code to set the pin function before other function requests to avoid confusing users. Signed-off-by: Miroslav Lichvar Reviewed-by: Vladimir Oltean Acked-by: Richard Cochran Link: https://lore.kernel.org/r/20220105152506.3256026-1-mlichvar@redhat.com Signed-off-by: Jakub Kicinski commit ffa81a03267b450cb8c7bc0d327c05c99de579a4 Author: Nobuhiro Iwamatsu Date: Mon Oct 25 12:10:36 2021 +0900 dt-bindings: clock: Add DT bindings for SMU of Toshiba Visconti TMPV770x SoC Add device tree bindings for SMU (System Management Unit) controller of Toshiba Visconti TMPV770x SoC series. Signed-off-by: Nobuhiro Iwamatsu Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211025031038.4180686-3-nobuhiro1.iwamatsu@toshiba.co.jp Signed-off-by: Stephen Boyd commit fd87c29a7900ffa53cc481f8ef350ebe397cfe93 Author: Nobuhiro Iwamatsu Date: Mon Oct 25 12:10:35 2021 +0900 dt-bindings: clock: Add DT bindings for PLL of Toshiba Visconti TMPV770x SoC Add device tree bindings for PLL of Toshiba Visconti TMPV770x SoC series. Signed-off-by: Nobuhiro Iwamatsu Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211025031038.4180686-2-nobuhiro1.iwamatsu@toshiba.co.jp Signed-off-by: Stephen Boyd commit 502a2ce9cdf4225983a07c8d99ea2afd53f48837 Merge: 75acfdb6fd922 5f33a09e769a9 Author: Jakub Kicinski Date: Wed Jan 5 17:04:32 2022 -0800 Merge tag 'linux-can-fixes-for-5.16-20220105' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can Marc Kleine-Budde says: ==================== pull-request: can 2022-01-05 It consists of 2 patches, both by me. The first one fixes the use of an uninitialized variable in the gs_usb driver the other one a skb_over_panic in the ISOTP stack in case of reception of too large ISOTP messages. * tag 'linux-can-fixes-for-5.16-20220105' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can: can: isotp: convert struct tpcon::{idx,len} to unsigned int can: gs_usb: fix use of uninitialized variable, detach device on reception of invalid USB data ==================== Link: https://lore.kernel.org/r/20220105205443.1274709-1-mkl@pengutronix.de Signed-off-by: Jakub Kicinski commit b739bca9f3344c6fe08b69e726b5d90bd3d92734 Author: Cai Huoqing Date: Tue Sep 7 16:51:43 2021 +0800 clk: socfpga: s10: Make use of the helper function devm_platform_ioremap_resource() Use the devm_platform_ioremap_resource() helper instead of calling platform_get_resource() and devm_ioremap_resource() separately Signed-off-by: Cai Huoqing Link: https://lore.kernel.org/r/20210907085144.4458-1-caihuoqing@baidu.com Signed-off-by: Stephen Boyd commit ee4abc4c5cf6a745be64a4f537c08040357827c3 Author: Cai Huoqing Date: Tue Sep 7 16:51:36 2021 +0800 clk: socfpga: agilex: Make use of the helper function devm_platform_ioremap_resource() Use the devm_platform_ioremap_resource() helper instead of calling platform_get_resource() and devm_ioremap_resource() separately Signed-off-by: Cai Huoqing Link: https://lore.kernel.org/r/20210907085137.4407-1-caihuoqing@baidu.com Signed-off-by: Stephen Boyd commit 5c58585090a9ac3fbdf45ef584caa3a755b8ceda Author: Colin Ian King Date: Thu Dec 30 15:03:21 2021 +0000 clk: socfpga: remove redundant assignment after a mask operation The assignment operation after a & mask operation is redundant, the variables being assigned are not used afterwards. Replace the &= operator with just & operator. Cleans up two clang-scan warnings: drivers/clk/socfpga/clk-gate.c:37:10: warning: Although the value stored to 'l4_src' is used in the enclosing expression, the value is never actually read from 'l4_src' [deadcode.DeadStores] return l4_src &= 0x1; ^ ~~~ drivers/clk/socfpga/clk-gate.c:46:10: warning: Although the value stored to 'perpll_src' is used in the enclosing expression, the value is never actually read from 'perpll_src' [deadcode.DeadStores] return perpll_src &= 0x3; Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20211230150321.167576-1-colin.i.king@gmail.com Acked-by: Dinh Nguyen Signed-off-by: Stephen Boyd commit 08d92c7a47375ac98aa5b9cdeb3a8736b37cf6d4 Author: Colin Ian King Date: Tue Dec 21 00:37:50 2021 +0000 clk: socfpga: remove redundant assignment on division The variable parent_rate is being divided by div and the result is re-assigned to parent_rate before being returned. The assignment is redundant, replace /= operator with just / operator. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20211221003750.212780-1-colin.i.king@gmail.com Acked-by: Dinh Nguyen Signed-off-by: Stephen Boyd commit 5f6082642814050352a3e29f8713796b55ebf788 Author: Christy Lee Date: Tue Jan 4 16:31:20 2022 -0800 libbpf 1.0: Deprecate bpf_object__find_map_by_offset() API API created with simplistic assumptions about BPF map definitions. It hasn’t worked for a while, deprecate it in preparation for libbpf 1.0. [0] Closes: https://github.com/libbpf/libbpf/issues/302 Signed-off-by: Christy Lee Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220105003120.2222673-1-christylee@fb.com commit 9855c131b9c8b0327ff5182f88bb1991f212415b Author: Christy Lee Date: Tue Jan 4 16:06:01 2022 -0800 libbpf 1.0: Deprecate bpf_map__is_offload_neutral() Deprecate bpf_map__is_offload_neutral(). It’s most probably broken already. PERF_EVENT_ARRAY isn’t the only map that’s not suitable for hardware offloading. Applications can directly check map type instead. [0] Closes: https://github.com/libbpf/libbpf/issues/306 Signed-off-by: Christy Lee Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20220105000601.2090044-1-christylee@fb.com commit 87e55700f359820cf44e386a8cc996108be55556 Merge: 9c337073d9d81 96ea2a4291343 Author: Stephen Boyd Date: Wed Jan 5 16:05:19 2022 -0800 Merge tag 'qcom-clk-for-5.17' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into clk-qcom Pull qcom clk driver updates from Bjorn Andersson: This introduces bindings and drivers for the global clock controllers found in SDX65, SM8450 and MSM8976, as well as RPMh clock support for SDX65 and SM8450. It cleans up the SMD RPM clock driver and it adds includes for clk-provider.h throughout the clock providers that was lacking this. * tag 'qcom-clk-for-5.17' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: (23 commits) clk: qcom: turingcc-qcs404: explicitly include clk-provider.h clk: qcom: q6sstop-qcs404: explicitly include clk-provider.h clk: qcom: mmcc-apq8084: explicitly include clk-provider.h clk: qcom: lpasscc-sdm845: explicitly include clk-provider.h clk: qcom: lpasscc-sc7280: explicitly include clk-provider.h clk: qcom: gcc-sm6350: explicitly include clk-provider.h clk: qcom: gcc-msm8994: explicitly include clk-provider.h clk: qcom: gcc-sm8350: explicitly include clk-provider.h clk: qcom: Add MSM8976/56 Global Clock Controller (GCC) driver dt-bindings: clk: qcom: Document MSM8976 Global Clock Controller clk: qcom: Add clock driver for SM8450 clk: qcom: Add SDX65 GCC support clk: qcom: Add LUCID_EVO PLL type for SDX65 dt-bindings: clock: Add SM8450 GCC clock bindings dt-bindings: clock: Add SDX65 GCC clock bindings clk: qcom: rpmh: add support for SM8450 rpmh clocks dt-bindings: clock: Add RPMHCC bindings for SM8450 clk: qcom: smd-rpm: Drop binary value handling for buffered clock clk: qcom: smd-rpm: Drop the use of struct rpm_cc clk: qcom: smd-rpm: Drop MFD qcom-rpm reference ... commit 9c337073d9d81a145434b22f42dc3128ecd17730 Author: Taniya Das Date: Mon Dec 20 22:13:56 2021 +0530 clk: qcom: gcc-sc7280: Mark gcc_cfg_noc_lpass_clk always enabled The gcc cfg noc lpass clock is required to be always enabled for the LPASS core and audio drivers to be functional. Fixes: a3cc092196ef ("clk: qcom: Add Global Clock controller (GCC) driver for SC7280") Signed-off-by: Taniya Das Link: https://lore.kernel.org/r/1640018638-19436-4-git-send-email-tdas@codeaurora.org Signed-off-by: Stephen Boyd commit a5273ed2fed221317203c120670fc9a09488be3b Author: Taniya Das Date: Mon Dec 20 22:13:54 2021 +0530 clk: qcom: clk-alpha-pll: Increase PLL lock detect poll time PLL poll for lock detection can take more than 100us for certain type of Lucid PLLs and also the new PLLs types(Lucid EVO), thus update to 200us. Signed-off-by: Taniya Das Link: https://lore.kernel.org/r/1640018638-19436-2-git-send-email-tdas@codeaurora.org Signed-off-by: Stephen Boyd commit 51a33c60f1c22c0d2dafad774315ba1537765442 Author: Qiang Wang Date: Mon Dec 27 21:07:13 2021 +0800 libbpf: Support repeated legacy kprobes on same function If repeated legacy kprobes on same function in one process, libbpf will register using the same probe name and got -EBUSY error. So append index to the probe name format to fix this problem. Co-developed-by: Chengming Zhou Signed-off-by: Qiang Wang Signed-off-by: Chengming Zhou Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211227130713.66933-2-wangqiang.wq.frank@bytedance.com commit 71cff670baff5cc6a6eeb0181e2cc55579c5e1e0 Author: Qiang Wang Date: Mon Dec 27 21:07:12 2021 +0800 libbpf: Use probe_name for legacy kprobe Fix a bug in commit 46ed5fc33db9, which wrongly used the func_name instead of probe_name to register legacy kprobe. Fixes: 46ed5fc33db9 ("libbpf: Refactor and simplify legacy kprobe code") Co-developed-by: Chengming Zhou Signed-off-by: Qiang Wang Signed-off-by: Chengming Zhou Signed-off-by: Andrii Nakryiko Tested-by: Hengqi Chen Reviewed-by: Hengqi Chen Link: https://lore.kernel.org/bpf/20211227130713.66933-1-wangqiang.wq.frank@bytedance.com commit 48886a84a3f62be386a428ba861ad3dae76609fd Author: Max Gurtovoy Date: Wed Dec 15 15:57:20 2021 +0200 IB/iser: Remove un-needed casting to/from void pointer The void pointer can be typecasted to/from any type. Link: https://lore.kernel.org/r/20211215135721.3662-6-mgurtovoy@nvidia.com Signed-off-by: Max Gurtovoy Signed-off-by: Jason Gunthorpe commit 433dc0efd1e041d39a1e993d6879a8c7692b0d2f Author: Max Gurtovoy Date: Wed Dec 15 15:57:19 2021 +0200 IB/iser: Don't suppress send completions In order to complete a scsi command and guarantee that the HCA will never perform an access violation when retrying a send operation we must complete a scsi request only when both send and receive completions has arrived. This is a preparation commit that remove the send completions suppression. Next step will be taking care of the local invalidation mechanism and adding a reference counter for commands. Currently, we don't do anything upon getting the send completion and just "consume" it. Link: https://lore.kernel.org/r/20211215135721.3662-5-mgurtovoy@nvidia.com Signed-off-by: Max Gurtovoy Reviewed-by: Israel Rukshin Signed-off-by: Jason Gunthorpe commit cf9962cfd5365990d36462c83d27f13503d26e09 Author: Max Gurtovoy Date: Wed Dec 15 15:57:18 2021 +0200 IB/iser: Rename ib_ret local variable Use more common name for return values ("ret"). This commit doesn't change any logic. Link: https://lore.kernel.org/r/20211215135721.3662-4-mgurtovoy@nvidia.com Signed-off-by: Max Gurtovoy Reviewed-by: Israel Rukshin Signed-off-by: Jason Gunthorpe commit 39b169ea0d36b9c445ab6849002e4edf00c7fcc1 Author: Sergey Gorenko Date: Wed Dec 15 15:57:17 2021 +0200 IB/iser: Fix RNR errors Some users complain about RNR errors on the target, when heavy high-priority tasks run on the initiator. After the investigation, we found out that the receive WRs were exhausted, because the initiator could not post them on time. Receive work reqeusts are posted in chunks to reduce the number of hits to the HCA. The WRs are posted in the receive completion handler when the number of free receive buffers reaches the threshold. But on a high-loaded host, receive CQEs processing can be delayed and all receive WRs will be exhausted. In this case, the target will get an RNR error. To avoid this, we post receive WR, as soon as possible and not in a batch. This increases the number of hits to the HCA, but also the common implementation in most of Linux ULPs (e.g. NVMe-oF/RDMA). As a rule of thumb, performance improvements and heuristics are being added to the RDMA core layer or vendors low level drivers and it's about time to align iSER as well. Link: https://lore.kernel.org/r/20211215135721.3662-3-mgurtovoy@nvidia.com Signed-off-by: Sergey Gorenko Signed-off-by: Max Gurtovoy Reviewed-by: Israel Rukshin Signed-off-by: Jason Gunthorpe commit b28801a08924e887d7e3d33f43f510ccd12bbce8 Author: Max Gurtovoy Date: Wed Dec 15 15:57:16 2021 +0200 IB/iser: Remove deprecated pi_guard module param No need for this dead code. This commit doesn't change any functionality since one can still run "modprobe ib_iser pi_guard=". Link: https://lore.kernel.org/r/20211215135721.3662-2-mgurtovoy@nvidia.com Signed-off-by: Max Gurtovoy Signed-off-by: Jason Gunthorpe commit 7218c28c87f57c131879a75a226b9033ac90b266 Author: Christy Lee Date: Wed Dec 29 12:41:56 2021 -0800 libbpf: Deprecate bpf_perf_event_read_simple() API With perf_buffer__poll() and perf_buffer__consume() APIs available, there is no reason to expose bpf_perf_event_read_simple() API to users. If users need custom perf buffer, they could re-implement the function. Mark bpf_perf_event_read_simple() and move the logic to a new static function so it can still be called by other functions in the same file. [0] Closes: https://github.com/libbpf/libbpf/issues/310 Signed-off-by: Christy Lee Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211229204156.13569-1-christylee@fb.com commit b9adba350a841e8233d3e4d8d3c8dede3fc88c46 Merge: 4e4f325a0a559 75acfdb6fd922 Author: Jakub Kicinski Date: Wed Jan 5 14:36:10 2022 -0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net No conflicts. Signed-off-by: Jakub Kicinski commit 28479934f26bcf9ddeb94125e05ddc5c4312b1f3 Author: Kuniyuki Iwashima Date: Tue Jan 4 10:31:49 2022 +0900 bpf: Add SO_RCVBUF/SO_SNDBUF in _bpf_getsockopt(). This patch exposes SO_RCVBUF/SO_SNDBUF through bpf_getsockopt(). Signed-off-by: Kuniyuki Iwashima Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220104013153.97906-3-kuniyu@amazon.co.jp commit 04c350b1ae6bdb12b84009a4d0bf5ab4e621c47b Author: Kuniyuki Iwashima Date: Tue Jan 4 10:31:48 2022 +0900 bpf: Fix SO_RCVBUF/SO_SNDBUF handling in _bpf_setsockopt(). The commit 4057765f2dee ("sock: consistent handling of extreme SO_SNDBUF/SO_RCVBUF values") added a change to prevent underflow in setsockopt() around SO_SNDBUF/SO_RCVBUF. This patch adds the same change to _bpf_setsockopt(). Fixes: 4057765f2dee ("sock: consistent handling of extreme SO_SNDBUF/SO_RCVBUF values") Signed-off-by: Kuniyuki Iwashima Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220104013153.97906-2-kuniyu@amazon.co.jp commit a5bebc4f00dee47113eed48098c68e88b5ba70e8 Author: Kris Van Hees Date: Wed Jan 5 16:01:50 2022 -0500 bpf: Fix verifier support for validation of async callbacks Commit bfc6bb74e4f1 ("bpf: Implement verifier support for validation of async callbacks.") added support for BPF_FUNC_timer_set_callback to the __check_func_call() function. The test in __check_func_call() is flaweed because it can mis-interpret a regular BPF-to-BPF pseudo-call as a BPF_FUNC_timer_set_callback callback call. Consider the conditional in the code: if (insn->code == (BPF_JMP | BPF_CALL) && insn->imm == BPF_FUNC_timer_set_callback) { The BPF_FUNC_timer_set_callback has value 170. This means that if you have a BPF program that contains a pseudo-call with an instruction delta of 170, this conditional will be found to be true by the verifier, and it will interpret the pseudo-call as a callback. This leads to a mess with the verification of the program because it makes the wrong assumptions about the nature of this call. Solution: include an explicit check to ensure that insn->src_reg == 0. This ensures that calls cannot be mis-interpreted as an async callback call. Fixes: bfc6bb74e4f1 ("bpf: Implement verifier support for validation of async callbacks.") Signed-off-by: Kris Van Hees Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220105210150.GH1559@oracle.com commit 58d8a3fc4a40dcfebf333ab2dc2c7c338249be51 Author: Christoph Hellwig Date: Mon Jan 3 19:35:56 2022 +0100 bpf, docs: Fully document the JMP mode modifiers Add a description for all the modifiers. Signed-off-by: Christoph Hellwig Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220103183556.41040-7-hch@lst.de commit 9e533e22b5700097e84b8a841d9e1c251cc132c6 Author: Christoph Hellwig Date: Mon Jan 3 19:35:55 2022 +0100 bpf, docs: Fully document the JMP opcodes Add pseudo-code to document all the different BPF_JMP / BPF_JMP64 opcodes. Signed-off-by: Christoph Hellwig Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220103183556.41040-6-hch@lst.de commit 03c517ee9eedd95472c36c6291fc97368b48c9e4 Author: Christoph Hellwig Date: Mon Jan 3 19:35:54 2022 +0100 bpf, docs: Fully document the ALU opcodes Add pseudo-code to document all the different BPF_ALU / BPF_ALU64 opcodes. Signed-off-by: Christoph Hellwig Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220103183556.41040-5-hch@lst.de commit 894cda554c3c3dc836f3cc873c47a465ba9433b4 Author: Christoph Hellwig Date: Mon Jan 3 19:35:53 2022 +0100 bpf, docs: Document the opcode classes Add a description for each opcode class. Signed-off-by: Christoph Hellwig Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220103183556.41040-4-hch@lst.de commit be3193cded9d5c030be1713bf52d307427e88d19 Author: Christoph Hellwig Date: Mon Jan 3 19:35:52 2022 +0100 bpf, docs: Add subsections for ALU and JMP instructions Add a little more stucture to the ALU/JMP documentation with sections and improve the example text. Signed-off-by: Christoph Hellwig Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220103183556.41040-3-hch@lst.de commit 62e4683849b6516c71e91f36e4fc0393a5883cfb Author: Christoph Hellwig Date: Mon Jan 3 19:35:51 2022 +0100 bpf, docs: Add a setion to explain the basic instruction encoding The eBPF instruction set document does not currently document the basic instruction encoding. Add a section to do that. Signed-off-by: Christoph Hellwig Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20220103183556.41040-2-hch@lst.de commit 5f33a09e769a9da0482f20a6770a342842443776 Author: Marc Kleine-Budde Date: Wed Jan 5 14:01:12 2022 +0100 can: isotp: convert struct tpcon::{idx,len} to unsigned int In isotp_rcv_ff() 32 bit of data received over the network is assigned to struct tpcon::len. Later in that function the length is checked for the maximal supported length against MAX_MSG_LENGTH. As struct tpcon::len is an "int" this check does not work, if the provided length overflows the "int". Later on struct tpcon::idx is compared against struct tpcon::len. To fix this problem this patch converts both struct tpcon::{idx,len} to unsigned int. Fixes: e057dd3fc20f ("can: add ISO 15765-2:2016 transport protocol") Link: https://lore.kernel.org/all/20220105132429.1170627-1-mkl@pengutronix.de Cc: stable@vger.kernel.org Acked-by: Oliver Hartkopp Reported-by: syzbot+4c63f36709a642f801c5@syzkaller.appspotmail.com Signed-off-by: Marc Kleine-Budde commit 4a8737ff068724f509d583fef404d349adba80d6 Author: Marc Kleine-Budde Date: Fri Dec 10 10:03:09 2021 +0100 can: gs_usb: fix use of uninitialized variable, detach device on reception of invalid USB data The received data contains the channel the received data is associated with. If the channel number is bigger than the actual number of channels assume broken or malicious USB device and shut it down. This fixes the error found by clang: | drivers/net/can/usb/gs_usb.c:386:6: error: variable 'dev' is used | uninitialized whenever 'if' condition is true | if (hf->channel >= GS_MAX_INTF) | ^~~~~~~~~~~~~~~~~~~~~~~~~~ | drivers/net/can/usb/gs_usb.c:474:10: note: uninitialized use occurs here | hf, dev->gs_hf_size, gs_usb_receive_bulk_callback, | ^~~ Link: https://lore.kernel.org/all/20211210091158.408326-1-mkl@pengutronix.de Fixes: d08e973a77d1 ("can: gs_usb: Added support for the GS_USB CAN devices") Cc: stable@vger.kernel.org Signed-off-by: Marc Kleine-Budde commit fbdb0ba7051e9b0881708c1c7bb491363cb7e486 Author: Maher Sanalla Date: Wed Dec 15 09:54:31 2021 +0200 IB/mlx5: Expose NDR speed through MAD Under MAD query port, Report NDR speed when NDR is supported in the port capability mask. Link: https://lore.kernel.org/r/a2ab630d2a634547db9b581faa9d65da2edb9d05.1639554831.git.leonro@nvidia.com Signed-off-by: Maher Sanalla Reviewed-by: Michael Guralnik Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 6a27e396ebb149fc47baccc1957a7a9dd70049a7 Author: Juan Vazquez Date: Wed Jan 5 11:27:46 2022 -0800 Drivers: hv: vmbus: Initialize request offers message for Isolation VM Initialize memory of request offers message to be sent to the host so padding or uninitialized fields do not leak guest memory contents. Signed-off-by: Juan Vazquez Link: https://lore.kernel.org/r/20220105192746.23046-1-juvazq@linux.microsoft.com Signed-off-by: Wei Liu commit ca796fe66f7fceff17679ee6cc5fe4b4023de44d Author: Daniel Borkmann Date: Wed Jan 5 11:33:34 2022 -0800 bpf, selftests: Add verifier test for mem_or_null register with offset. Add a new test case with mem_or_null typed register with off > 0 to ensure it gets rejected by the verifier: # ./test_verifier 1011 #1009/u check with invalid reg offset 0 OK #1009/p check with invalid reg offset 0 OK Summary: 2 PASSED, 0 SKIPPED, 0 FAILED Signed-off-by: Daniel Borkmann Signed-off-by: Alexei Starovoitov commit e60b0d12a95dcf16a63225cead4541567f5cb517 Author: Daniel Borkmann Date: Wed Jan 5 11:35:13 2022 -0800 bpf: Don't promote bogus looking registers after null check. If we ever get to a point again where we convert a bogus looking _or_null typed register containing a non-zero fixed or variable offset, then lets not reset these bounds to zero since they are not and also don't promote the register to a type, but instead leave it as _or_null. Converting to a unknown register could be an avenue as well, but then if we run into this case it would allow to leak a kernel pointer this way. Fixes: f1174f77b50c ("bpf/verifier: rework value tracking") Signed-off-by: Daniel Borkmann Signed-off-by: Alexei Starovoitov commit e375b9c92985e409c4bb95dd43d34915ea7f5e28 Author: Kamal Heib Date: Mon Dec 20 17:25:30 2021 +0200 RDMA/cxgb4: Set queue pair state when being queried The API for ib_query_qp requires the driver to set cur_qp_state on return, add the missing set. Fixes: 67bbc05512d8 ("RDMA/cxgb4: Add query_qp support") Link: https://lore.kernel.org/r/20211220152530.60399-1-kamalheib1@gmail.com Signed-off-by: Kamal Heib Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 38d220882426422927db85b0dd04ec6ab18a5c69 Author: Chengchang Tang Date: Mon Dec 20 21:05:58 2021 +0800 RDMA/hns: Remove support for HIP06 HIP06 is no longer supported. In order to reduce unnecessary maintenance, the code of HIP06 is removed. Link: https://lore.kernel.org/r/20211220130558.61585-1-liangwenpeng@huawei.com Signed-off-by: Chengchang Tang Signed-off-by: Wenpeng Liang Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 218d747a4142f281a256687bb513a135c905867b Author: John Fastabend Date: Tue Jan 4 13:46:45 2022 -0800 bpf, sockmap: Fix double bpf_prog_put on error case in map_link sock_map_link() is called to update a sockmap entry with a sk. But, if the sock_map_init_proto() call fails then we return an error to the map_update op against the sockmap. In the error path though we need to cleanup psock and dec the refcnt on any programs associated with the map, because we refcnt them early in the update process to ensure they are pinned for the psock. (This avoids a race where user deletes programs while also updating the map with new socks.) In current code we do the prog refcnt dec explicitely by calling bpf_prog_put() when the program was found in the map. But, after commit '38207a5e81230' in this error path we've already done the prog to psock assignment so the programs have a reference from the psock as well. This then causes the psock tear down logic, invoked by sk_psock_put() in the error path, to similarly call bpf_prog_put on the programs there. To be explicit this logic does the prog->psock assignment: if (msg_*) psock_set_prog(...) Then the error path under the out_progs label does a similar check and dec with: if (msg_*) bpf_prog_put(...) And the teardown logic sk_psock_put() does ... psock_set_prog(msg_*, NULL) ... triggering another bpf_prog_put(...). Then KASAN gives us this splat, found by syzbot because we've created an inbalance between bpf_prog_inc and bpf_prog_put calling put twice on the program. BUG: KASAN: vmalloc-out-of-bounds in __bpf_prog_put kernel/bpf/syscall.c:1812 [inline] BUG: KASAN: vmalloc-out-of-bounds in __bpf_prog_put kernel/bpf/syscall.c:1812 [inline] kernel/bpf/syscall.c:1829 BUG: KASAN: vmalloc-out-of-bounds in bpf_prog_put+0x8c/0x4f0 kernel/bpf/syscall.c:1829 kernel/bpf/syscall.c:1829 Read of size 8 at addr ffffc90000e76038 by task syz-executor020/3641 To fix clean up error path so it doesn't try to do the bpf_prog_put in the error path once progs are assigned then it relies on the normal psock tear down logic to do complete cleanup. For completness we also cover the case whereh sk_psock_init_strp() fails, but this is not expected because it indicates an incorrect socket type and should be caught earlier. Fixes: 38207a5e8123 ("bpf, sockmap: Attach map progs to psock early for feature probes") Reported-by: syzbot+bb73e71cf4b8fd376a4f@syzkaller.appspotmail.com Signed-off-by: John Fastabend Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220104214645.290900-1-john.fastabend@gmail.com commit 5b2c5540b8110eea0d67a78fb0ddb9654c58daeb Author: John Fastabend Date: Tue Jan 4 12:59:18 2022 -0800 bpf, sockmap: Fix return codes from tcp_bpf_recvmsg_parser() Applications can be confused slightly because we do not always return the same error code as expected, e.g. what the TCP stack normally returns. For example on a sock err sk->sk_err instead of returning the sock_error we return EAGAIN. This usually means the application will 'try again' instead of aborting immediately. Another example, when a shutdown event is received we should immediately abort instead of waiting for data when the user provides a timeout. These tend to not be fatal, applications usually recover, but introduces bogus errors to the user or introduces unexpected latency. Before 'c5d2177a72a16' we fell back to the TCP stack when no data was available so we managed to catch many of the cases here, although with the extra latency cost of calling tcp_msg_wait_data() first. To fix lets duplicate the error handling in TCP stack into tcp_bpf so that we get the same error codes. These were found in our CI tests that run applications against sockmap and do longer lived testing, at least compared to test_sockmap that does short-lived ping/pong tests, and in some of our test clusters we deploy. Its non-trivial to do these in a shorter form CI tests that would be appropriate for BPF selftests, but we are looking into it so we can ensure this keeps working going forward. As a preview one idea is to pull in the packetdrill testing which catches some of this. Fixes: c5d2177a72a16 ("bpf, sockmap: Fix race in ingress receive verdict with redirect to self") Signed-off-by: John Fastabend Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20220104205918.286416-1-john.fastabend@gmail.com commit e4a41c2c1fa916547e63440c73a51a5eb06247af Author: Hou Tao Date: Fri Dec 31 23:10:18 2021 +0800 bpf, arm64: Use emit_addr_mov_i64() for BPF_PSEUDO_FUNC The following error is reported when running "./test_progs -t for_each" under arm64: bpf_jit: multi-func JIT bug 58 != 56 [...] JIT doesn't support bpf-to-bpf calls The root cause is the size of BPF_PSEUDO_FUNC instruction increases from 2 to 3 after the address of called bpf-function is settled and there are two bpf-to-bpf calls in test_pkt_access. The generated instructions are shown below: 0x48: 21 00 C0 D2 movz x1, #0x1, lsl #32 0x4c: 21 00 80 F2 movk x1, #0x1 0x48: E1 3F C0 92 movn x1, #0x1ff, lsl #32 0x4c: 41 FE A2 F2 movk x1, #0x17f2, lsl #16 0x50: 81 70 9F F2 movk x1, #0xfb84 Fixing it by using emit_addr_mov_i64() for BPF_PSEUDO_FUNC, so the size of jited image will not change. Fixes: 69c087ba6225 ("bpf: Add bpf_for_each_map_elem() helper") Signed-off-by: Hou Tao Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20211231151018.3781550-1-houtao1@huawei.com commit c0235652ee5194fc75926daa580817e63ceb37ab Author: GuoYong Zheng Date: Wed Jan 5 18:13:05 2022 +0800 io_uring: remove redundant tab space When show fdinfo, SqMask follow two tab space, which is inconsistent with other parameters. Remove one, so it lines up nicely. Signed-off-by: GuoYong Zheng Link: https://lore.kernel.org/r/1641377585-1891-1-git-send-email-zhenggy@chinatelecom.cn Signed-off-by: Jens Axboe commit 00f6e68b8d59bf006db54e3e257684f44d26195c Author: GuoYong Zheng Date: Wed Jan 5 18:12:02 2022 +0800 io_uring: remove unused function parameter Parameter res2 is not used in __io_complete_rw, remove it. Fixes: 6b19b766e8f0 ("fs: get rid of the res2 iocb->ki_complete argument") Signed-off-by: GuoYong Zheng Link: https://lore.kernel.org/r/1641377522-1851-1-git-send-email-zhenggy@chinatelecom.cn Signed-off-by: Jens Axboe commit 050f461e28c5d13f327353d660ffad2603ce7ac1 Author: Greg Kroah-Hartman Date: Tue Jan 4 17:29:47 2022 +0100 block/rnbd-clt-sysfs: use default_groups in kobj_type There are currently 2 ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the rnbd controller sysfs code to use default_groups field which has been the preferred way since aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field. Cc: "Md. Haris Iqbal" Cc: Jack Wang Cc: Jens Axboe Cc: linux-block@vger.kernel.org Signed-off-by: Greg Kroah-Hartman Acked-by: Jack Wang Link: https://lore.kernel.org/r/20220104162947.1320936-1-gregkh@linuxfoundation.org Signed-off-by: Jens Axboe commit 6bfec7992ec79b63fb07330ae97f3fb43120aa37 Author: Keith Busch Date: Wed Jan 5 09:05:18 2022 -0800 nvme-pci: fix queue_rqs list splitting If command prep fails, current handling will orphan subsequent requests in the list. Consider a simple example: rqlist = [ 1 -> 2 ] When prep for request '1' fails, it will be appended to the 'requeue_list', leaving request '2' disconnected from the original rqlist and no longer tracked. Meanwhile, rqlist is still pointing to the failed request '1' and will attempt to submit the unprepped command. Fix this by updating the rqlist accordingly using the request list helper functions. Fixes: d62cbcf62f2f ("nvme: add support for mq_ops->queue_rqs()") Signed-off-by: Keith Busch Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220105170518.3181469-5-kbusch@kernel.org Signed-off-by: Jens Axboe commit d2528be7a8b09af9796a270debd14101a72bb552 Author: Keith Busch Date: Wed Jan 5 09:05:17 2022 -0800 block: introduce rq_list_move When iterating a list, a particular request may need to be moved for special handling. Provide a helper function to achieve that so drivers don't need to reimplement rqlist manipulation. Signed-off-by: Keith Busch Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220105170518.3181469-4-kbusch@kernel.org Signed-off-by: Jens Axboe commit 3764fd05e1f89530e2ee5cbff0b638f2b1141b90 Author: Keith Busch Date: Wed Jan 5 09:05:16 2022 -0800 block: introduce rq_list_for_each_safe macro While iterating a list, a particular request may need to be removed for special handling. Provide an iterator that can safely handle that. Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch Link: https://lore.kernel.org/r/20220105170518.3181469-3-kbusch@kernel.org Signed-off-by: Jens Axboe commit edce22e19bfa86efa2522d041d6367f2f099e8ed Author: Keith Busch Date: Wed Jan 5 09:05:15 2022 -0800 block: move rq_list macros to blk-mq.h Move the request list macros to the header file that defines that struct they operate on. Signed-off-by: Keith Busch Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20220105170518.3181469-2-kbusch@kernel.org Signed-off-by: Jens Axboe commit 36783dec8d7932099d920dd44bc4c457b8272938 Author: Leon Romanovsky Date: Wed Jan 5 10:50:35 2022 +0200 RDMA/rxe: Delete deprecated module parameters interface Starting from the commit 66920e1b2586 ("rdma_rxe: Use netlink messages to add/delete links") from the 2019, the RXE modules parameters are marked as deprecated in favour of rdmatool. So remove the kernel code too. Link: https://lore.kernel.org/r/c8376d7517aebe7cc851f0baaeef7b13707cf767.1641372460.git.leonro@nvidia.com Signed-off-by: Leon Romanovsky Reviewed-by: Zhu Yanjun Signed-off-by: Jason Gunthorpe commit d82e2b27ad3a4fdd745332e0c310ae05660a1bf1 Author: Leon Romanovsky Date: Wed Jan 5 10:04:56 2022 +0200 RDMA/mad: Delete duplicated init_query_mad functions Several drivers used same function to initialize query MAD, so move that function to global header file. Link: https://lore.kernel.org/r/af6f35c590ff5ef56d0137351b8b295af0f7c13c.1641369858.git.leonro@nvidia.com Signed-off-by: Leon Romanovsky Reviewed-by: Håkon Bugge Signed-off-by: Jason Gunthorpe commit d8b0afd29c1d6d61890f259360388bde57f5dc90 Author: Li Zhijian Date: Wed Jan 5 12:26:04 2022 +0800 RDMA/rxe: Fix indentations and operators sytle * Fix these up to always have the '+', and '|' on the continuing line which is the normal kernel style. * Fix indentations correspondingly NOTE: this patch also remove the 2 redundant plus in IB_OPCODE_RD_FETCH_ADD and IB_OPCODE_RD_COMPARE_SWAP Link: https://lore.kernel.org/r/20220105042605.14343-1-lizhijian@fujitsu.com Signed-off-by: Li Zhijian Reviewed-by: Christoph Hellwig Signed-off-by: Jason Gunthorpe commit 01097139e772ac0082175c01eefb989f78e4437a Author: Greg Kroah-Hartman Date: Mon Jan 3 16:22:59 2022 +0100 RDMA: Use default_groups in kobj_type There are currently 2 ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the IB code to use default_groups field which has been the preferred way since commit aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field. Link: https://lore.kernel.org/r/20220103152259.531034-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 4e4f325a0a55907b14f579e6b1a38c53755e3de2 Author: Russell King (Oracle) Date: Tue Jan 4 16:38:31 2022 +0000 net: gemini: allow any RGMII interface mode The four RGMII interface modes take care of the required RGMII delay configuration at the PHY and should not be limited by the network MAC driver. Sadly, gemini was only permitting RGMII mode with no delays, which would require the required delay to be inserted via PCB tracking or by the MAC. However, there are designs that require the PHY to add the delay, which is impossible without Gemini permitting the other three PHY interface modes. Fix the driver to allow these. Signed-off-by: Russell King (Oracle) Reviewed-by: Linus Walleij Tested-by: Corentin Labbe Link: https://lore.kernel.org/r/E1n4mpT-002PLd-Ha@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski commit aa298b557bdeb5690e0fc51dac87e55b086ede0c Merge: 2d6ec25539b0e f22725c95ecec Author: Jakub Kicinski Date: Wed Jan 5 10:30:31 2022 -0800 Merge branch 'fix-rgmii-delays-for-88e1118' Russell King says: ==================== Fix RGMII delays for 88E1118 This series fixes the RGMII delays for 88E1118 Marvell PHYs, after a report by Corentin Labbe that the Marvell driver fails to work. Patch 1 cleans up the paged register accesses in m88e1118_config_init() and patch 2 adds the RGMII delay configuration. This comes with an element of risk as existing DT may need to be fixed for this in a similar way as we have done in the recent past for other PHY drivers that have misinterpreted the RGMII interface modes. ==================== Link: https://lore.kernel.org/r/YdR3wYFkm4eJApwb@shell.armlinux.org.uk Signed-off-by: Jakub Kicinski commit f22725c95ececb703c3f741e8f946d23705630b7 Author: Russell King (Oracle) Date: Tue Jan 4 16:38:19 2022 +0000 net: phy: marvell: configure RGMII delays for 88E1118 Corentin Labbe reports that the SSI 1328 does not work when allowing the PHY to operate at gigabit speeds, but does work with the generic PHY driver. This appears to be because m88e1118_config_init() writes a fixed value to the MSCR register, claiming that this is to enable 1G speeds. However, this always sets bits 4 and 5, enabling RGMII transmit and receive delays. The suspicion is that the original board this was added for required the delays to make 1G speeds work. Add the necessary configuration for RGMII delays for the 88E1118 to bring this into line with the requirements for RGMII support, and thus make the SSI 1328 work. Corentin Labbe has tested this on gemini-ssi1328 and gemini-ns2502. Reported-by: Corentin Labbe Tested-by: Corentin Labbe Signed-off-by: Russell King (Oracle) Reviewed-by: Andrew Lunn Signed-off-by: Jakub Kicinski commit 5b8f970309ddfffd92cb3c12cb7cf4101fe0f8bf Author: Russell King (Oracle) Date: Tue Jan 4 16:38:13 2022 +0000 net: phy: marvell: use phy_write_paged() to set MSCR Use phy_write_paged() in m88e1118_config_init() to set the MSCR value. We leave the other paged write for the LEDs in case the DT register parsing is relying on this page. Signed-off-by: Russell King (Oracle) Reviewed-by: Andrew Lunn Tested-by: Corentin Labbe Signed-off-by: Jakub Kicinski commit f54dfdf7c625aad722a7d1508f99e8272bc4800c Author: Greg Kroah-Hartman Date: Wed Jan 5 18:56:50 2022 +0100 firmware: memmap: use default_groups in kobj_type There are currently 2 ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the firmware memmap sysfs code to use default_groups field which has been the preferred way since aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field. Link: https://lore.kernel.org/r/20220105175650.2640758-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit 945409a6ef442cfe5f2f14e5626d4306d53100f0 Merge: 3da4390bcdf4d daa149dd8cd4a 685e2564daa14 d2d1d2645cfd7 2c54b423cf85b 07b742a4d9126 1175011a7d003 053f58bab331e dd73d18e7fc7a aed34d9e52b80 2c94ebedc844d dd03762ab608e Author: Catalin Marinas Date: Wed Jan 5 18:14:32 2022 +0000 Merge branches 'for-next/misc', 'for-next/cache-ops-dzp', 'for-next/stacktrace', 'for-next/xor-neon', 'for-next/kasan', 'for-next/armv8_7-fp', 'for-next/atomics', 'for-next/bti', 'for-next/sve', 'for-next/kselftest' and 'for-next/kcsan', remote-tracking branch 'arm64/for-next/perf' into for-next/core * arm64/for-next/perf: (32 commits) arm64: perf: Don't register user access sysctl handler multiple times drivers: perf: marvell_cn10k: fix an IS_ERR() vs NULL check perf/smmuv3: Fix unused variable warning when CONFIG_OF=n arm64: perf: Support new DT compatibles arm64: perf: Simplify registration boilerplate arm64: perf: Support Denver and Carmel PMUs drivers/perf: hisi: Add driver for HiSilicon PCIe PMU docs: perf: Add description for HiSilicon PCIe PMU driver dt-bindings: perf: Add YAML schemas for Marvell CN10K LLC-TAD pmu bindings drivers: perf: Add LLC-TAD perf counter support perf/smmuv3: Synthesize IIDR from CoreSight ID registers perf/smmuv3: Add devicetree support dt-bindings: Add Arm SMMUv3 PMCG binding perf/arm-cmn: Add debugfs topology info perf/arm-cmn: Add CI-700 Support dt-bindings: perf: arm-cmn: Add CI-700 perf/arm-cmn: Support new IP features perf/arm-cmn: Demarcate CMN-600 specifics perf/arm-cmn: Move group validation data off-stack perf/arm-cmn: Optimise DTC counter accesses ... * for-next/misc: : Miscellaneous patches arm64: Use correct method to calculate nomap region boundaries arm64: Drop outdated links in comments arm64: errata: Fix exec handling in erratum 1418040 workaround arm64: Unhash early pointer print plus improve comment asm-generic: introduce io_stop_wc() and add implementation for ARM64 arm64: remove __dma_*_area() aliases docs/arm64: delete a space from tagged-address-abi arm64/fp: Add comments documenting the usage of state restore functions arm64: mm: Use asid feature macro for cheanup arm64: mm: Rename asid2idx() to ctxid2asid() arm64: kexec: reduce calls to page_address() arm64: extable: remove unused ex_handler_t definition arm64: entry: Use SDEI event constants arm64: Simplify checking for populated DT arm64/kvm: Fix bitrotted comment for SVE handling in handle_exit.c * for-next/cache-ops-dzp: : Avoid DC instructions when DCZID_EL0.DZP == 1 arm64: mte: DC {GVA,GZVA} shouldn't be used when DCZID_EL0.DZP == 1 arm64: clear_page() shouldn't use DC ZVA when DCZID_EL0.DZP == 1 * for-next/stacktrace: : Unify the arm64 unwind code arm64: Make some stacktrace functions private arm64: Make dump_backtrace() use arch_stack_walk() arm64: Make profile_pc() use arch_stack_walk() arm64: Make return_address() use arch_stack_walk() arm64: Make __get_wchan() use arch_stack_walk() arm64: Make perf_callchain_kernel() use arch_stack_walk() arm64: Mark __switch_to() as __sched arm64: Add comment for stack_info::kr_cur arch: Make ARCH_STACKWALK independent of STACKTRACE * for-next/xor-neon: : Use SHA3 instructions to speed up XOR arm64/xor: use EOR3 instructions when available * for-next/kasan: : Log potential KASAN shadow aliases arm64: mm: log potential KASAN shadow alias arm64: mm: use die_kernel_fault() in do_mem_abort() * for-next/armv8_7-fp: : Add HWCAPS for ARMv8.7 FEAT_AFP amd FEAT_RPRES arm64: cpufeature: add HWCAP for FEAT_RPRES arm64: add ID_AA64ISAR2_EL1 sys register arm64: cpufeature: add HWCAP for FEAT_AFP * for-next/atomics: : arm64 atomics clean-ups and codegen improvements arm64: atomics: lse: define RETURN ops in terms of FETCH ops arm64: atomics: lse: improve constraints for simple ops arm64: atomics: lse: define ANDs in terms of ANDNOTs arm64: atomics lse: define SUBs in terms of ADDs arm64: atomics: format whitespace consistently * for-next/bti: : BTI clean-ups arm64: Ensure that the 'bti' macro is defined where linkage.h is included arm64: Use BTI C directly and unconditionally arm64: Unconditionally override SYM_FUNC macros arm64: Add macro version of the BTI instruction arm64: ftrace: add missing BTIs arm64: kexec: use __pa_symbol(empty_zero_page) arm64: update PAC description for kernel * for-next/sve: : SVE code clean-ups and refactoring in prepararation of Scalable Matrix Extensions arm64/sve: Minor clarification of ABI documentation arm64/sve: Generalise vector length configuration prctl() for SME arm64/sve: Make sysctl interface for SVE reusable by SME * for-next/kselftest: : arm64 kselftest additions kselftest/arm64: Add pidbench for floating point syscall cases kselftest/arm64: Add a test program to exercise the syscall ABI kselftest/arm64: Allow signal tests to trigger from a function kselftest/arm64: Parameterise ptrace vector length information * for-next/kcsan: : Enable KCSAN for arm64 arm64: Enable KCSAN commit 99a6a4b39575b39c34fc024400b25a52343fbe07 Author: Greg Kroah-Hartman Date: Tue Jan 4 17:22:40 2022 +0100 sh: sq: use default_groups in kobj_type There are currently 2 ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the sh sq sysfs code to use default_groups field which has been the preferred way since aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field. Cc: Yoshinori Sato Cc: Rich Felker Cc: linux-sh@vger.kernel.org Tested-by: Rob Landley Link: https://lore.kernel.org/r/20220104162240.1309639-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit eb52c0fc2331f8ad1f5f9fd79ba9ce90681ed50b Author: Hyeonggon Yoo <42.hyeyoo@gmail.com> Date: Sat Dec 25 06:09:21 2021 +0000 mm: Make SLAB_MERGE_DEFAULT depend on SL[AU]B SLOB always manage objects of different caches in same page regardless of SLAB_MERGE_DEFAULT. Because it has no effect on SLOB, make it depend on SLAB || SLUB. Signed-off-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: Vlastimil Babka Signed-off-by: Vlastimil Babka Link: https://lore.kernel.org/r/20211225060921.13584-1-42.hyeyoo@gmail.com commit a7ad9ddeb528b91de03cedeef34532dc0ba77bfd Author: Dust Li Date: Mon Dec 27 20:38:06 2021 +0800 RDMA/mlx5: Print wc status on CQE error and dump needed mlx5_handle_error_cqe() only dump the content of the CQE which is raw hex data, and not straighforward for debug. Print WC status message when we got CQE error and dump is need. Here is an example of how the dmesg log looks like with this: infiniband mlx5_0: mlx5_handle_error_cqe:333:(pid 0): WC error: 10, message: remote access error infiniband mlx5_0: dump_cqe:272:(pid 0): dump error cqe 00000000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00000010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00000030: 00 00 00 00 00 00 88 13 08 03 61 b3 1e a1 42 d3 Link: https://lore.kernel.org/r/20211227123806.47530-1-dust.li@linux.alibaba.com Signed-off-by: Dust Li Acked-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit e232333be69ee9ccd4281032af0d2416940cb98d Author: Mark Rutland Date: Mon Nov 8 11:42:20 2021 +0000 scripts/sorttable: Unify arm64 & x86 sort functions The format of the arm64 and x86 exception table entries is essentially the same as of commits: 46d28947d9876fc0 ("x86/extable: Rework the exception table mechanics") d6e2cc5647753825 ("arm64: extable: add `type` and `data` fields") Both use a 12-byte entry consisting of two 32-bit relative offsets and 32 bits of (absolute) data, and their sort functions are identical aside from commentary, with arm64 saying: /* Don't touch the fixup type or data */ ... and x86 saying: /* Don't touch the fixup type */ Unify the two behind a common sort_relative_table_with_data() function, retaining the arm64 commentary. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Cc: Ard Biesheuvel Cc: Borislav Petkov Cc: Catalin Marinas Cc: Thomas Gleixner Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Palmer Dabbelt commit 8d1cfb884e881efd69a3be4ef10772c71cb22216 Author: Chengguang Xu Date: Sat Dec 18 19:23:20 2021 +0800 RDMA/rxe: Fix a typo in opcode name There is a redundant ']' in the name of opcode IB_OPCODE_RC_SEND_MIDDLE, so just fix it. Fixes: 8700e3e7c485 ("Soft RoCE driver") Link: https://lore.kernel.org/r/20211218112320.3558770-1-cgxu519@mykernel.net Signed-off-by: Chengguang Xu Acked-by: Zhu Yanjun Reviewed-by: Bob Pearson Signed-off-by: Jason Gunthorpe commit 8803836fe75413f7e78a18ce81c0b41ab978a2d0 Author: Zhu Yanjun Date: Thu Dec 16 00:48:42 2021 -0500 RDMA/rxe: Remove the unused xmit_errors member The member variable xmit_errors can be replaced with rxe_counter_inc(rxe, RXE_CNT_SEND_ERR) Link: https://lore.kernel.org/r/20211216054842.1099428-1-yanjun.zhu@linux.dev Signed-off-by: Zhu Yanjun Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 2d6ec25539b0e7a4b4ad670abbcb3ec27b33e8ce Author: Eric Dumazet Date: Wed Jan 5 09:08:49 2022 -0800 netlink: do not allocate a device refcount tracker in ethnl_default_notify() As reported by Johannes, the tracker allocated in ethnl_default_notify() is not really needed, as this function is not expected to change a device reference count. Fixes: e4b8954074f6 ("netlink: add net device refcount tracker to struct ethnl_req_info") Signed-off-by: Eric Dumazet Reported-by: Johannes Berg Tested-by: Johannes Berg Link: https://lore.kernel.org/r/20220105170849.2610470-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit 47920e4d2cbfe64e85c8b536a792a91a94c7c187 Author: Minghao Chi Date: Wed Dec 15 06:06:25 2021 +0000 RDMA/rxe: Remove redundant err variable Return value directly instead of taking this in another redundant variable. Link: https://lore.kernel.org/20211215075258.442930-1-chi.minghao@zte.com.cn Reported-by: Zeal Robot Signed-off-by: Minghao Chi Acked-by: Zhu Yanjun Reviewed-by: Devesh Sharma Signed-off-by: Jason Gunthorpe commit 37c995ed19fdd4695d18fad24c7eaa441ea86564 Author: Minghao Chi Date: Wed Dec 15 05:54:21 2021 +0000 RDMA/ocrdma: Remove unneeded variable Return status directly from function called. Link: https://lore.kernel.org/r/20211215055421.441375-1-chi.minghao@zte.com.cn Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: Jason Gunthorpe commit 88248c357c2a8dbff899770dc02e2edf89d989aa Author: Eric Dumazet Date: Tue Jan 4 09:04:39 2022 -0800 net/sched: add missing tracker information in qdisc_create() qdisc_create() error path needs to use dev_put_track() because qdisc_alloc() allocated the tracker. Fixes: 606509f27f67 ("net/sched: add net device refcount tracker to struct Qdisc") Signed-off-by: Eric Dumazet Link: https://lore.kernel.org/r/20220104170439.3790052-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit c2abcf30efb8bdd8dfe8d1796e29fd26aea03702 Author: Rob Herring Date: Tue Dec 21 08:51:26 2021 -0400 dt-bindings: display: novatek,nt36672a: Fix unevaluated properties warning With 'unevaluatedProperties' support enabled, the novatek,nt36672a binding has a new warning: Documentation/devicetree/bindings/display/panel/novatek,nt36672a.example.dt.yaml: panel@0: Unevaluated properties are not allowed ('vddi0-supply', '#address-cells', '#size-cells' were unexpected) Based on dts files, 'vddi0-supply' does appear to be the correct name. Drop '#address-cells' and '#size-cells' which aren't needed. Signed-off-by: Rob Herring Acked-by: Sam Ravnborg Link: https://lore.kernel.org/r/20211221125125.1194554-1-robh@kernel.org commit 7dfc5b6e909e8c434ce458d61c7d7c8cd95d5ad6 Author: Greg Kroah-Hartman Date: Tue Jan 4 17:43:51 2022 +0100 cpuidle: use default_groups in kobj_type There are currently 2 ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the cpuidle sysfs code to use default_groups field which has been the preferred way since aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field. Signed-off-by: Greg Kroah-Hartman Signed-off-by: Rafael J. Wysocki commit b81e9e5c723de936652653241d3dc4f33ae05e8c Author: Bart Kroon Date: Mon Dec 13 19:20:43 2021 +0100 ALSA: hda: ALC287: Add Lenovo IdeaPad Slim 9i 14ITL5 speaker quirk The speaker fixup that is used for the Yoga 7 14ITL5 also applies to the IdeaPad Slim 9i 14ITL5. The attached patch applies the quirk to initialise the amplifier on the IdeaPad Slim 9i as well. This is validated to work on my laptop. [ corrected the quirk entry position by tiwai ] Signed-off-by: Bart Kroon Cc: Link: https://lore.kernel.org/r/JAG24R.7NLJGWBF4G8U@tarmack.eu Signed-off-by: Takashi Iwai commit 65e38e32a959dbbb0bf5cf1ae699789f81759be6 Author: Nageswara R Sastry Date: Wed Nov 24 12:38:01 2021 +0530 selftests/kexec: Enable secureboot tests for PowerPC Existing test cases determine secureboot state using efi variable, which is available only on x86 architecture. Add support for determining secureboot state using device tree property on PowerNV architecture. Signed-off-by: Nageswara R Sastry Reviewed-by: Nayna Jain Tested-by: Nayna Jain Signed-off-by: Mimi Zohar commit e4c35e75209bda13e57c9bc8d280366c2b9275a5 Author: Takashi Iwai Date: Wed Jan 5 17:24:09 2022 +0100 ASoC: ak4375: Fix unused function error A randconfig caught a compile warning that is now treated as a fatal error: sound/soc/codecs/ak4375.c:415:13: error: ‘ak4375_power_off’ defined but not used [-Werror=unused-function] where ak4375_power_off() is used only from the PM handler. As both suspend and resumes are already marked with __maybe_unused, let's rip off the superfluous ifdef CONFIG_PM, so that the error above can be avoided. Fixes: 53778b8292b5 ("ASoC: Add AK4375 support") Signed-off-by: Takashi Iwai Link: https://lore.kernel.org/r/20220105162409.20635-1-tiwai@suse.de Signed-off-by: Mark Brown commit 922bfd001d1ac02111ebbe0524aaab6ca7925521 Author: Karthik L Gopalakrishnan Date: Fri Dec 17 15:12:11 2021 -0800 PCI: vmd: Add DID 8086:A77F for all Intel Raptor Lake SKU's Add support for this VMD device which supports the bus restriction mode. The feature that turns off vector 0 for MSI-X remapping is also enabled. Link: https://lore.kernel.org/r/20211217231211.46018-1-francisco.munoz.ruiz@linux.intel.com Signed-off-by: Karthik L Gopalakrishnan Signed-off-by: Francisco Munoz Signed-off-by: Lorenzo Pieralisi Reviewed-by: Jon Derrick commit d94a69cb2cfa77294921aae9afcfb866e723a2da Author: Xin Xiong Date: Thu Dec 23 10:48:12 2021 +0800 netfilter: ipt_CLUSTERIP: fix refcount leak in clusterip_tg_check() The issue takes place in one error path of clusterip_tg_check(). When memcmp() returns nonzero, the function simply returns the error code, forgetting to decrease the reference count of a clusterip_config object, which is bumped earlier by clusterip_config_find_get(). This may incur reference count leak. Fix this issue by decrementing the refcount of the object in specific error path. Fixes: 06aa151ad1fc74 ("netfilter: ipt_CLUSTERIP: check MAC address when duplicate config is set") Signed-off-by: Xin Xiong Signed-off-by: Xiyu Yang Signed-off-by: Xin Tan Signed-off-by: Pablo Neira Ayuso commit ae7abe36e352eddf8e30d3b1ea3fb402514ba13b Author: Stefan Binding Date: Fri Dec 17 11:57:08 2021 +0000 ALSA: hda/realtek: Add CS35L41 support for Thinkpad laptops Add support for two CS35L41 using I2C bus and the component binding method [ Fix the entries to be sorted order by tiwai ] Signed-off-by: Stefan Binding Signed-off-by: Lucas Tanure Link: https://lore.kernel.org/r/20211217115708.882525-11-tanureal@opensource.cirrus.com Signed-off-by: Takashi Iwai commit d3dca026375f2be550041b75833f2e3238738a70 Author: Lucas Tanure Date: Fri Dec 17 11:57:07 2021 +0000 ALSA: hda/realtek: Add support for Legion 7 16ACHg6 laptop Add Support for CS35L41 using the component binding method [ corrected the quirk entry position by tiwai ] Signed-off-by: Lucas Tanure Link: https://lore.kernel.org/r/20211217115708.882525-10-tanureal@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 7b2f3eb492dac7665c75df067e4d8e4869589f4a Author: Lucas Tanure Date: Fri Dec 17 11:57:05 2021 +0000 ALSA: hda: cs35l41: Add support for CS35L41 in HDA systems Add support for CS35L41 using a new separated driver that can be used in all upcoming designs Signed-off-by: Lucas Tanure Link: https://lore.kernel.org/r/20211217115708.882525-8-tanureal@opensource.cirrus.com Signed-off-by: Takashi Iwai commit 2aac550da3257ab46e8c7944365eb4a79ccbb3a1 Author: Takashi Iwai Date: Wed Jan 5 17:03:21 2022 +0100 ALSA: hda/realtek: Re-order quirk entries for Lenovo The recent few quirk entries for Lenovo haven't been put in the right order. Let's arrange the table again. Fixes: ad7cc2d41b7a ("ALSA: hda/realtek: Quirks to enable speaker output...") Fixes: 6dc86976220c ("ALSA: hda/realtek: Add speaker fixup for some Yoga 15ITL5 devices") Fixes: 8f4c90427a8f ("ALSA: hda/realtek: Add quirk for Legion Y9000X 2020") Cc: Signed-off-by: Takashi Iwai commit 570010b82e8a04206eb228da23e4ef0264df7d25 Merge: a319cb32e7cfd ba235634b138c Author: Mark Brown Date: Wed Jan 5 15:59:21 2022 +0000 Add low power hibernation support to cs35l41 Merge series from Charles Keepax : This patch series adds support for the low power hibernation feature on cs35l41. This allows the DSP memory to be retained whilst the device enters a very low power state. commit d23f0c11aca27d3f599d33b67856bf8374b62cc4 Author: Hou Zhiqiang Date: Fri Dec 24 17:40:00 2021 +0800 PCI: layerscape: Change to use the DWC common link-up check function The current Layerscape PCIe driver directly uses the physical layer LTSSM code to check the link-up state, which treats the > L0 states as link-up. This is not correct, since there is not explicit map between link-up state and LTSSM. So this patch changes to use the DWC common link-up check function. Link: https://lore.kernel.org/r/20211224094000.8513-1-Zhiqiang.Hou@nxp.com Signed-off-by: Hou Zhiqiang Signed-off-by: Lorenzo Pieralisi Reviewed-by: Rob Herring commit 01ec4a2e8f01f027a0f06cad237c935da8d643bf Author: Ingo Molnar Date: Sat Jul 3 00:23:39 2021 +0200 headers/deps: USB: Optimize dependencies, remove The header is used over 1,400 times in a typical distro build, but few of its users actually need the full header. -------------------------------------------------------------------- | Combined, preprocessed C code size of header, without line markers, | with comments stripped: ------------------------- before: | #include | LOC: 7,078 | headers: 172 after: | #include | LOC: 812 | headers: 38 Remove it and add it to the places that need it. Signed-off-by: Ingo Molnar Signed-off-by: Greg Kroah-Hartman commit 66b13ce8fe25341a8c4c8ceb00d611461ad86dcc Author: Greg Kroah-Hartman Date: Wed Jan 5 16:20:27 2022 +0100 USB: common: debug: add needed kernel.h include drivers/usb/common/debug.c was only including one usb .h file, which would then accidentally drag in other .h files that were really needed. Fix up the implict dependancy by correctly adding kernel.h to the file. Signed-off-by: Greg Kroah-Hartman commit 6184f15d877c6fec0af43ef3e10c10183758263d Author: Ingo Molnar Date: Tue Sep 7 18:47:20 2021 +0200 headers/prep: Fix non-standard header section: drivers/usb/host/ohci-tmio.c Signed-off-by: Ingo Molnar Signed-off-by: Greg Kroah-Hartman commit cd33707d0fd1b65c419f30816dd7f8123472caab Author: Ingo Molnar Date: Tue Sep 7 19:00:27 2021 +0200 headers/prep: Fix non-standard header section: drivers/usb/cdns3/core.h Signed-off-by: Ingo Molnar Signed-off-by: Greg Kroah-Hartman commit 452785d0400aa467a0ea7534e2bac206af552cfa Author: Ingo Molnar Date: Fri Nov 26 11:01:56 2021 +0100 headers/prep: usb: gadget: Fix namespace collision Avoid namespace collision with dev_ioctl() and dev_open(), also provided by generic headers. Signed-off-by: Ingo Molnar Signed-off-by: Greg Kroah-Hartman commit c487b6530ddf65790e1f7da34a107e9671404d04 Merge: d43e4271747ac a68dc7b938fbb Author: David S. Miller Date: Wed Jan 5 15:04:51 2022 +0000 Merge branch 'dsa-notifier-cleanup' Vladimir Oltean says: ==================== DSA cross-chip notifier cleanup This series deletes the no-op cross-chip notifier support for MRP and HSR, features which were introduced relatively recently and did not get full review at the time. The new code is functionally equivalent, but simpler. Cc: Horatiu Vultur Cc: George McCollister ==================== Signed-off-by: David S. Miller commit a68dc7b938fbbf3d4d74b81a9b5d0d6fdd78566c Author: Vladimir Oltean Date: Wed Jan 5 15:18:13 2022 +0200 net: dsa: remove cross-chip support for HSR The cross-chip notifiers for HSR are bypass operations, meaning that even though all switches in a tree are notified, only the switch specified in the info structure is targeted. We can eliminate the unnecessary complexity by deleting the cross-chip notifier logic and calling the ds->ops straight from port.c. Cc: George McCollister Signed-off-by: Vladimir Oltean Reviewed-by: George McCollister Signed-off-by: David S. Miller commit cad69019f2f8c8c36006fa67b4b5ce04ac2e262b Author: Vladimir Oltean Date: Wed Jan 5 15:18:12 2022 +0200 net: dsa: remove cross-chip support for MRP The cross-chip notifiers for MRP are bypass operations, meaning that even though all switches in a tree are notified, only the switch specified in the info structure is targeted. We can eliminate the unnecessary complexity by deleting the cross-chip notifier logic and calling the ds->ops straight from port.c. Cc: Horatiu Vultur Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit ff91e1b68490b97c18c649b769618815eb945f11 Author: Vladimir Oltean Date: Wed Jan 5 15:18:11 2022 +0200 net: dsa: fix incorrect function pointer check for MRP ring roles The cross-chip notifier boilerplate code meant to check the presence of ds->ops->port_mrp_add_ring_role before calling it, but checked ds->ops->port_mrp_add instead, before calling ds->ops->port_mrp_add_ring_role. Therefore, a driver which implements one operation but not the other would trigger a NULL pointer dereference. There isn't any such driver in DSA yet, so there is no reason to backport the change. Issue found through code inspection. Cc: Horatiu Vultur Fixes: c595c4330da0 ("net: dsa: add MRP support") Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit d43e4271747ace01a27a49a97a397cb4219f6487 Author: Danielle Ratson Date: Wed Jan 5 12:22:27 2022 +0200 mlxsw: pci: Avoid flow control for EMAD packets Locally generated packets ingress the device through its CPU port. When the CPU port is congested and there are not enough credits in its headroom buffer, packets can be dropped. While this might be acceptable for data packets that traverse the network, configuration packets exchanged between the host and the device (EMADs) should not be subjected to this flow control. The "sdq_lp" bit in the SDQ (Send Descriptor Queue) context allows the host to instruct the device to treat packets sent on this queue as "local processing" and always process them, regardless of the state of the CPU port's headroom. Add the definition of this bit and set it for the dedicated SDQ reserved for the transmission of EMAD packets. This makes the "local processing" bit in the WQE (Work Queue Element) redundant, so clear it. Signed-off-by: Danielle Ratson Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 7da0694c01681166eebc7dc6130b329f2291c7c4 Merge: 53928cddda07a 383f0993fc771 Author: David S. Miller Date: Wed Jan 5 14:49:37 2022 +0000 Merge tag 'linux-can-next-for-5.17-20220105' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next Marc Kleine-Budde says: ==================== pull-request: can-next 2022-01-05 this is a pull request of 15 patches for net-next/master. The first patch is by me and removed an unused variable from the usb_8dev driver. Andy Shevchenko contributes a patch for the mcp251x driver, which removes an unneeded assignment. Jimmy Assarsson's patch for the kvaser_usb makes use of units.h in the assignment of frequencies. Lad Prabhakar provides 2 patches, converting the ti_hecc and the sja1000 driver to make use of platform_get_irq(). The 10 remaining patches are by Vincent Mailhol. First the etas_es58x driver populates the net_device::dev_port. The next 5 patches cleanup the handling of CAN error and CAN RTR messages of all drivers. The remaining 4 patches enhance the CAN controller mode flag handling and export it via netlink to user space. ==================== Signed-off-by: David S. Miller commit 53928cddda07a7d7bcb4714003af55b9b560d7f9 Merge: 5be9963d9e170 4b026e82893b2 Author: David S. Miller Date: Wed Jan 5 14:46:23 2022 +0000 Merge branch 'dsa-cleanups' Vladimir Oltean says: ==================== Cleanup to main DSA structures This series contains changes that do the following: - struct dsa_port reduced from 576 to 544 bytes, and first cache line a bit better organized - struct dsa_switch from 160 to 136 bytes, and first cache line a bit better organized - struct dsa_switch_tree from 112 to 104 bytes, and first cache line a bit better organized ==================== Signed-off-by: David S. Miller commit 4b026e82893b2e084fcc48bc26f91612b62ecc4f Author: Vladimir Oltean Date: Wed Jan 5 15:21:41 2022 +0200 net: dsa: combine two holes in struct dsa_switch_tree There is a 7 byte hole after dst->setup and a 4 byte hole after dst->default_proto. Combining them, we have a single hole of just 3 bytes on 64 bit machines. Before: pahole -C dsa_switch_tree net/dsa/slave.o struct dsa_switch_tree { struct list_head list; /* 0 16 */ struct list_head ports; /* 16 16 */ struct raw_notifier_head nh; /* 32 8 */ unsigned int index; /* 40 4 */ struct kref refcount; /* 44 4 */ struct net_device * * lags; /* 48 8 */ bool setup; /* 56 1 */ /* XXX 7 bytes hole, try to pack */ /* --- cacheline 1 boundary (64 bytes) --- */ const struct dsa_device_ops * tag_ops; /* 64 8 */ enum dsa_tag_protocol default_proto; /* 72 4 */ /* XXX 4 bytes hole, try to pack */ struct dsa_platform_data * pd; /* 80 8 */ struct list_head rtable; /* 88 16 */ unsigned int lags_len; /* 104 4 */ unsigned int last_switch; /* 108 4 */ /* size: 112, cachelines: 2, members: 13 */ /* sum members: 101, holes: 2, sum holes: 11 */ /* last cacheline: 48 bytes */ }; After: pahole -C dsa_switch_tree net/dsa/slave.o struct dsa_switch_tree { struct list_head list; /* 0 16 */ struct list_head ports; /* 16 16 */ struct raw_notifier_head nh; /* 32 8 */ unsigned int index; /* 40 4 */ struct kref refcount; /* 44 4 */ struct net_device * * lags; /* 48 8 */ const struct dsa_device_ops * tag_ops; /* 56 8 */ /* --- cacheline 1 boundary (64 bytes) --- */ enum dsa_tag_protocol default_proto; /* 64 4 */ bool setup; /* 68 1 */ /* XXX 3 bytes hole, try to pack */ struct dsa_platform_data * pd; /* 72 8 */ struct list_head rtable; /* 80 16 */ unsigned int lags_len; /* 96 4 */ unsigned int last_switch; /* 100 4 */ /* size: 104, cachelines: 2, members: 13 */ /* sum members: 101, holes: 1, sum holes: 3 */ /* last cacheline: 40 bytes */ }; Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit b035c88c6a303d39d511ef71ac4e2e0176756661 Author: Vladimir Oltean Date: Wed Jan 5 15:21:40 2022 +0200 net: dsa: move dsa_switch_tree :: ports and lags to first cache line dst->ports is accessed most notably by dsa_master_find_slave(), which is invoked in the RX path. dst->lags is accessed by dsa_lag_dev(), which is invoked in the RX path of tag_dsa.c. dst->tag_ops, dst->default_proto and dst->pd don't need to be in the first cache line, so they are moved out by this change. Before: pahole -C dsa_switch_tree net/dsa/slave.o struct dsa_switch_tree { struct list_head list; /* 0 16 */ struct raw_notifier_head nh; /* 16 8 */ unsigned int index; /* 24 4 */ struct kref refcount; /* 28 4 */ bool setup; /* 32 1 */ /* XXX 7 bytes hole, try to pack */ const struct dsa_device_ops * tag_ops; /* 40 8 */ enum dsa_tag_protocol default_proto; /* 48 4 */ /* XXX 4 bytes hole, try to pack */ struct dsa_platform_data * pd; /* 56 8 */ /* --- cacheline 1 boundary (64 bytes) --- */ struct list_head ports; /* 64 16 */ struct list_head rtable; /* 80 16 */ struct net_device * * lags; /* 96 8 */ unsigned int lags_len; /* 104 4 */ unsigned int last_switch; /* 108 4 */ /* size: 112, cachelines: 2, members: 13 */ /* sum members: 101, holes: 2, sum holes: 11 */ /* last cacheline: 48 bytes */ }; After: pahole -C dsa_switch_tree net/dsa/slave.o struct dsa_switch_tree { struct list_head list; /* 0 16 */ struct list_head ports; /* 16 16 */ struct raw_notifier_head nh; /* 32 8 */ unsigned int index; /* 40 4 */ struct kref refcount; /* 44 4 */ struct net_device * * lags; /* 48 8 */ bool setup; /* 56 1 */ /* XXX 7 bytes hole, try to pack */ /* --- cacheline 1 boundary (64 bytes) --- */ const struct dsa_device_ops * tag_ops; /* 64 8 */ enum dsa_tag_protocol default_proto; /* 72 4 */ /* XXX 4 bytes hole, try to pack */ struct dsa_platform_data * pd; /* 80 8 */ struct list_head rtable; /* 88 16 */ unsigned int lags_len; /* 104 4 */ unsigned int last_switch; /* 108 4 */ /* size: 112, cachelines: 2, members: 13 */ /* sum members: 101, holes: 2, sum holes: 11 */ /* last cacheline: 48 bytes */ }; Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 258030acc93b459ca070924921f214bd05a2d56c Author: Vladimir Oltean Date: Wed Jan 5 15:21:39 2022 +0200 net: dsa: make dsa_switch :: num_ports an unsigned int Currently, num_ports is declared as size_t, which is defined as __kernel_ulong_t, therefore it occupies 8 bytes of memory. Even switches with port numbers in the range of tens are exotic, so there is no need for this amount of storage. Additionally, because the max_num_bridges member right above it is also 4 bytes, it means the compiler needs to add padding between the last 2 fields. By reducing the size, we don't need that padding and can reduce the struct size. Before: pahole -C dsa_switch net/dsa/slave.o struct dsa_switch { struct device * dev; /* 0 8 */ struct dsa_switch_tree * dst; /* 8 8 */ unsigned int index; /* 16 4 */ u32 setup:1; /* 20: 0 4 */ u32 vlan_filtering_is_global:1; /* 20: 1 4 */ u32 needs_standalone_vlan_filtering:1; /* 20: 2 4 */ u32 configure_vlan_while_not_filtering:1; /* 20: 3 4 */ u32 untag_bridge_pvid:1; /* 20: 4 4 */ u32 assisted_learning_on_cpu_port:1; /* 20: 5 4 */ u32 vlan_filtering:1; /* 20: 6 4 */ u32 pcs_poll:1; /* 20: 7 4 */ u32 mtu_enforcement_ingress:1; /* 20: 8 4 */ /* XXX 23 bits hole, try to pack */ struct notifier_block nb; /* 24 24 */ /* XXX last struct has 4 bytes of padding */ void * priv; /* 48 8 */ void * tagger_data; /* 56 8 */ /* --- cacheline 1 boundary (64 bytes) --- */ struct dsa_chip_data * cd; /* 64 8 */ const struct dsa_switch_ops * ops; /* 72 8 */ u32 phys_mii_mask; /* 80 4 */ /* XXX 4 bytes hole, try to pack */ struct mii_bus * slave_mii_bus; /* 88 8 */ unsigned int ageing_time_min; /* 96 4 */ unsigned int ageing_time_max; /* 100 4 */ struct dsa_8021q_context * tag_8021q_ctx; /* 104 8 */ struct devlink * devlink; /* 112 8 */ unsigned int num_tx_queues; /* 120 4 */ unsigned int num_lag_ids; /* 124 4 */ /* --- cacheline 2 boundary (128 bytes) --- */ unsigned int max_num_bridges; /* 128 4 */ /* XXX 4 bytes hole, try to pack */ size_t num_ports; /* 136 8 */ /* size: 144, cachelines: 3, members: 27 */ /* sum members: 132, holes: 2, sum holes: 8 */ /* sum bitfield members: 9 bits, bit holes: 1, sum bit holes: 23 bits */ /* paddings: 1, sum paddings: 4 */ /* last cacheline: 16 bytes */ }; After: pahole -C dsa_switch net/dsa/slave.o struct dsa_switch { struct device * dev; /* 0 8 */ struct dsa_switch_tree * dst; /* 8 8 */ unsigned int index; /* 16 4 */ u32 setup:1; /* 20: 0 4 */ u32 vlan_filtering_is_global:1; /* 20: 1 4 */ u32 needs_standalone_vlan_filtering:1; /* 20: 2 4 */ u32 configure_vlan_while_not_filtering:1; /* 20: 3 4 */ u32 untag_bridge_pvid:1; /* 20: 4 4 */ u32 assisted_learning_on_cpu_port:1; /* 20: 5 4 */ u32 vlan_filtering:1; /* 20: 6 4 */ u32 pcs_poll:1; /* 20: 7 4 */ u32 mtu_enforcement_ingress:1; /* 20: 8 4 */ /* XXX 23 bits hole, try to pack */ struct notifier_block nb; /* 24 24 */ /* XXX last struct has 4 bytes of padding */ void * priv; /* 48 8 */ void * tagger_data; /* 56 8 */ /* --- cacheline 1 boundary (64 bytes) --- */ struct dsa_chip_data * cd; /* 64 8 */ const struct dsa_switch_ops * ops; /* 72 8 */ u32 phys_mii_mask; /* 80 4 */ /* XXX 4 bytes hole, try to pack */ struct mii_bus * slave_mii_bus; /* 88 8 */ unsigned int ageing_time_min; /* 96 4 */ unsigned int ageing_time_max; /* 100 4 */ struct dsa_8021q_context * tag_8021q_ctx; /* 104 8 */ struct devlink * devlink; /* 112 8 */ unsigned int num_tx_queues; /* 120 4 */ unsigned int num_lag_ids; /* 124 4 */ /* --- cacheline 2 boundary (128 bytes) --- */ unsigned int max_num_bridges; /* 128 4 */ unsigned int num_ports; /* 132 4 */ /* size: 136, cachelines: 3, members: 27 */ /* sum members: 128, holes: 1, sum holes: 4 */ /* sum bitfield members: 9 bits, bit holes: 1, sum bit holes: 23 bits */ /* paddings: 1, sum paddings: 4 */ /* last cacheline: 8 bytes */ }; Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 7787ff7763989fe61db94a82d70d6fa80848d7c9 Author: Vladimir Oltean Date: Wed Jan 5 15:21:38 2022 +0200 net: dsa: merge all bools of struct dsa_switch into a single u32 struct dsa_switch has 9 boolean properties, many of which are in fact set by drivers for custom behavior (vlan_filtering_is_global, needs_standalone_vlan_filtering, etc etc). The binary layout of the structure could be improved. For example, the "bool setup" at the beginning introduces a gratuitous 7 byte hole in the first cache line. The change merges all boolean properties into bitfields of an u32, and places that u32 in the first cache line of the structure, since many bools are accessed from the data path (untag_bridge_pvid, vlan_filtering, vlan_filtering_is_global). We place this u32 after the existing ds->index, which is also 4 bytes in size. As a positive side effect, ds->tagger_data now fits into the first cache line too, because 4 bytes are saved. Before: pahole -C dsa_switch net/dsa/slave.o struct dsa_switch { bool setup; /* 0 1 */ /* XXX 7 bytes hole, try to pack */ struct device * dev; /* 8 8 */ struct dsa_switch_tree * dst; /* 16 8 */ unsigned int index; /* 24 4 */ /* XXX 4 bytes hole, try to pack */ struct notifier_block nb; /* 32 24 */ /* XXX last struct has 4 bytes of padding */ void * priv; /* 56 8 */ /* --- cacheline 1 boundary (64 bytes) --- */ void * tagger_data; /* 64 8 */ struct dsa_chip_data * cd; /* 72 8 */ const struct dsa_switch_ops * ops; /* 80 8 */ u32 phys_mii_mask; /* 88 4 */ /* XXX 4 bytes hole, try to pack */ struct mii_bus * slave_mii_bus; /* 96 8 */ unsigned int ageing_time_min; /* 104 4 */ unsigned int ageing_time_max; /* 108 4 */ struct dsa_8021q_context * tag_8021q_ctx; /* 112 8 */ struct devlink * devlink; /* 120 8 */ /* --- cacheline 2 boundary (128 bytes) --- */ unsigned int num_tx_queues; /* 128 4 */ bool vlan_filtering_is_global; /* 132 1 */ bool needs_standalone_vlan_filtering; /* 133 1 */ bool configure_vlan_while_not_filtering; /* 134 1 */ bool untag_bridge_pvid; /* 135 1 */ bool assisted_learning_on_cpu_port; /* 136 1 */ bool vlan_filtering; /* 137 1 */ bool pcs_poll; /* 138 1 */ bool mtu_enforcement_ingress; /* 139 1 */ unsigned int num_lag_ids; /* 140 4 */ unsigned int max_num_bridges; /* 144 4 */ /* XXX 4 bytes hole, try to pack */ size_t num_ports; /* 152 8 */ /* size: 160, cachelines: 3, members: 27 */ /* sum members: 141, holes: 4, sum holes: 19 */ /* paddings: 1, sum paddings: 4 */ /* last cacheline: 32 bytes */ }; After: pahole -C dsa_switch net/dsa/slave.o struct dsa_switch { struct device * dev; /* 0 8 */ struct dsa_switch_tree * dst; /* 8 8 */ unsigned int index; /* 16 4 */ u32 setup:1; /* 20: 0 4 */ u32 vlan_filtering_is_global:1; /* 20: 1 4 */ u32 needs_standalone_vlan_filtering:1; /* 20: 2 4 */ u32 configure_vlan_while_not_filtering:1; /* 20: 3 4 */ u32 untag_bridge_pvid:1; /* 20: 4 4 */ u32 assisted_learning_on_cpu_port:1; /* 20: 5 4 */ u32 vlan_filtering:1; /* 20: 6 4 */ u32 pcs_poll:1; /* 20: 7 4 */ u32 mtu_enforcement_ingress:1; /* 20: 8 4 */ /* XXX 23 bits hole, try to pack */ struct notifier_block nb; /* 24 24 */ /* XXX last struct has 4 bytes of padding */ void * priv; /* 48 8 */ void * tagger_data; /* 56 8 */ /* --- cacheline 1 boundary (64 bytes) --- */ struct dsa_chip_data * cd; /* 64 8 */ const struct dsa_switch_ops * ops; /* 72 8 */ u32 phys_mii_mask; /* 80 4 */ /* XXX 4 bytes hole, try to pack */ struct mii_bus * slave_mii_bus; /* 88 8 */ unsigned int ageing_time_min; /* 96 4 */ unsigned int ageing_time_max; /* 100 4 */ struct dsa_8021q_context * tag_8021q_ctx; /* 104 8 */ struct devlink * devlink; /* 112 8 */ unsigned int num_tx_queues; /* 120 4 */ unsigned int num_lag_ids; /* 124 4 */ /* --- cacheline 2 boundary (128 bytes) --- */ unsigned int max_num_bridges; /* 128 4 */ /* XXX 4 bytes hole, try to pack */ size_t num_ports; /* 136 8 */ /* size: 144, cachelines: 3, members: 27 */ /* sum members: 132, holes: 2, sum holes: 8 */ /* sum bitfield members: 9 bits, bit holes: 1, sum bit holes: 23 bits */ /* paddings: 1, sum paddings: 4 */ /* last cacheline: 16 bytes */ }; Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 0625125877da9c1c09611a4acfd101571b7d1e16 Author: Vladimir Oltean Date: Wed Jan 5 15:21:37 2022 +0200 net: dsa: move dsa_port :: type near dsa_port :: index Both dsa_port :: type and dsa_port :: index introduce a 4 octet hole after them, so we can group them together and the holes would be eliminated, turning 16 octets of storage into just 8. This makes the cpu_dp pointer fit in the first cache line, which is good, because dsa_slave_to_master(), called by dsa_enqueue_skb(), uses it. Before: pahole -C dsa_port net/dsa/slave.o struct dsa_port { union { struct net_device * master; /* 0 8 */ struct net_device * slave; /* 0 8 */ }; /* 0 8 */ const struct dsa_device_ops * tag_ops; /* 8 8 */ struct dsa_switch_tree * dst; /* 16 8 */ struct sk_buff * (*rcv)(struct sk_buff *, struct net_device *); /* 24 8 */ enum { DSA_PORT_TYPE_UNUSED = 0, DSA_PORT_TYPE_CPU = 1, DSA_PORT_TYPE_DSA = 2, DSA_PORT_TYPE_USER = 3, } type; /* 32 4 */ /* XXX 4 bytes hole, try to pack */ struct dsa_switch * ds; /* 40 8 */ unsigned int index; /* 48 4 */ /* XXX 4 bytes hole, try to pack */ const char * name; /* 56 8 */ /* --- cacheline 1 boundary (64 bytes) --- */ struct dsa_port * cpu_dp; /* 64 8 */ u8 mac[6]; /* 72 6 */ u8 stp_state; /* 78 1 */ u8 vlan_filtering:1; /* 79: 0 1 */ u8 learning:1; /* 79: 1 1 */ u8 lag_tx_enabled:1; /* 79: 2 1 */ u8 devlink_port_setup:1; /* 79: 3 1 */ u8 setup:1; /* 79: 4 1 */ /* XXX 3 bits hole, try to pack */ struct device_node * dn; /* 80 8 */ unsigned int ageing_time; /* 88 4 */ /* XXX 4 bytes hole, try to pack */ struct dsa_bridge * bridge; /* 96 8 */ struct devlink_port devlink_port; /* 104 288 */ /* --- cacheline 6 boundary (384 bytes) was 8 bytes ago --- */ struct phylink * pl; /* 392 8 */ struct phylink_config pl_config; /* 400 40 */ struct net_device * lag_dev; /* 440 8 */ /* --- cacheline 7 boundary (448 bytes) --- */ struct net_device * hsr_dev; /* 448 8 */ struct list_head list; /* 456 16 */ const struct ethtool_ops * orig_ethtool_ops; /* 472 8 */ const struct dsa_netdevice_ops * netdev_ops; /* 480 8 */ struct mutex addr_lists_lock; /* 488 32 */ /* --- cacheline 8 boundary (512 bytes) was 8 bytes ago --- */ struct list_head fdbs; /* 520 16 */ struct list_head mdbs; /* 536 16 */ /* size: 552, cachelines: 9, members: 30 */ /* sum members: 539, holes: 3, sum holes: 12 */ /* sum bitfield members: 5 bits, bit holes: 1, sum bit holes: 3 bits */ /* last cacheline: 40 bytes */ }; After: pahole -C dsa_port net/dsa/slave.o struct dsa_port { union { struct net_device * master; /* 0 8 */ struct net_device * slave; /* 0 8 */ }; /* 0 8 */ const struct dsa_device_ops * tag_ops; /* 8 8 */ struct dsa_switch_tree * dst; /* 16 8 */ struct sk_buff * (*rcv)(struct sk_buff *, struct net_device *); /* 24 8 */ struct dsa_switch * ds; /* 32 8 */ unsigned int index; /* 40 4 */ enum { DSA_PORT_TYPE_UNUSED = 0, DSA_PORT_TYPE_CPU = 1, DSA_PORT_TYPE_DSA = 2, DSA_PORT_TYPE_USER = 3, } type; /* 44 4 */ const char * name; /* 48 8 */ struct dsa_port * cpu_dp; /* 56 8 */ /* --- cacheline 1 boundary (64 bytes) --- */ u8 mac[6]; /* 64 6 */ u8 stp_state; /* 70 1 */ u8 vlan_filtering:1; /* 71: 0 1 */ u8 learning:1; /* 71: 1 1 */ u8 lag_tx_enabled:1; /* 71: 2 1 */ u8 devlink_port_setup:1; /* 71: 3 1 */ u8 setup:1; /* 71: 4 1 */ /* XXX 3 bits hole, try to pack */ struct device_node * dn; /* 72 8 */ unsigned int ageing_time; /* 80 4 */ /* XXX 4 bytes hole, try to pack */ struct dsa_bridge * bridge; /* 88 8 */ struct devlink_port devlink_port; /* 96 288 */ /* --- cacheline 6 boundary (384 bytes) --- */ struct phylink * pl; /* 384 8 */ struct phylink_config pl_config; /* 392 40 */ struct net_device * lag_dev; /* 432 8 */ struct net_device * hsr_dev; /* 440 8 */ /* --- cacheline 7 boundary (448 bytes) --- */ struct list_head list; /* 448 16 */ const struct ethtool_ops * orig_ethtool_ops; /* 464 8 */ const struct dsa_netdevice_ops * netdev_ops; /* 472 8 */ struct mutex addr_lists_lock; /* 480 32 */ /* --- cacheline 8 boundary (512 bytes) --- */ struct list_head fdbs; /* 512 16 */ struct list_head mdbs; /* 528 16 */ /* size: 544, cachelines: 9, members: 30 */ /* sum members: 539, holes: 1, sum holes: 4 */ /* sum bitfield members: 5 bits, bit holes: 1, sum bit holes: 3 bits */ /* last cacheline: 32 bytes */ }; Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit bde82f389af1225df0798851eedbcd03445530d9 Author: Vladimir Oltean Date: Wed Jan 5 15:21:36 2022 +0200 net: dsa: merge all bools of struct dsa_port into a single u8 struct dsa_port has 5 bool members which create quite a number of 7 byte holes in the structure layout. By merging them all into bitfields of an u8, and placing that u8 in the 1-byte hole after dp->mac and dp->stp_state, we can reduce the structure size from 576 bytes to 552 bytes on arm64. Before: pahole -C dsa_port net/dsa/slave.o struct dsa_port { union { struct net_device * master; /* 0 8 */ struct net_device * slave; /* 0 8 */ }; /* 0 8 */ const struct dsa_device_ops * tag_ops; /* 8 8 */ struct dsa_switch_tree * dst; /* 16 8 */ struct sk_buff * (*rcv)(struct sk_buff *, struct net_device *); /* 24 8 */ enum { DSA_PORT_TYPE_UNUSED = 0, DSA_PORT_TYPE_CPU = 1, DSA_PORT_TYPE_DSA = 2, DSA_PORT_TYPE_USER = 3, } type; /* 32 4 */ /* XXX 4 bytes hole, try to pack */ struct dsa_switch * ds; /* 40 8 */ unsigned int index; /* 48 4 */ /* XXX 4 bytes hole, try to pack */ const char * name; /* 56 8 */ /* --- cacheline 1 boundary (64 bytes) --- */ struct dsa_port * cpu_dp; /* 64 8 */ u8 mac[6]; /* 72 6 */ u8 stp_state; /* 78 1 */ /* XXX 1 byte hole, try to pack */ struct device_node * dn; /* 80 8 */ unsigned int ageing_time; /* 88 4 */ bool vlan_filtering; /* 92 1 */ bool learning; /* 93 1 */ /* XXX 2 bytes hole, try to pack */ struct dsa_bridge * bridge; /* 96 8 */ struct devlink_port devlink_port; /* 104 288 */ /* --- cacheline 6 boundary (384 bytes) was 8 bytes ago --- */ bool devlink_port_setup; /* 392 1 */ /* XXX 7 bytes hole, try to pack */ struct phylink * pl; /* 400 8 */ struct phylink_config pl_config; /* 408 40 */ /* --- cacheline 7 boundary (448 bytes) --- */ struct net_device * lag_dev; /* 448 8 */ bool lag_tx_enabled; /* 456 1 */ /* XXX 7 bytes hole, try to pack */ struct net_device * hsr_dev; /* 464 8 */ struct list_head list; /* 472 16 */ const struct ethtool_ops * orig_ethtool_ops; /* 488 8 */ const struct dsa_netdevice_ops * netdev_ops; /* 496 8 */ struct mutex addr_lists_lock; /* 504 32 */ /* --- cacheline 8 boundary (512 bytes) was 24 bytes ago --- */ struct list_head fdbs; /* 536 16 */ struct list_head mdbs; /* 552 16 */ bool setup; /* 568 1 */ /* size: 576, cachelines: 9, members: 30 */ /* sum members: 544, holes: 6, sum holes: 25 */ /* padding: 7 */ }; After: pahole -C dsa_port net/dsa/slave.o struct dsa_port { union { struct net_device * master; /* 0 8 */ struct net_device * slave; /* 0 8 */ }; /* 0 8 */ const struct dsa_device_ops * tag_ops; /* 8 8 */ struct dsa_switch_tree * dst; /* 16 8 */ struct sk_buff * (*rcv)(struct sk_buff *, struct net_device *); /* 24 8 */ enum { DSA_PORT_TYPE_UNUSED = 0, DSA_PORT_TYPE_CPU = 1, DSA_PORT_TYPE_DSA = 2, DSA_PORT_TYPE_USER = 3, } type; /* 32 4 */ /* XXX 4 bytes hole, try to pack */ struct dsa_switch * ds; /* 40 8 */ unsigned int index; /* 48 4 */ /* XXX 4 bytes hole, try to pack */ const char * name; /* 56 8 */ /* --- cacheline 1 boundary (64 bytes) --- */ struct dsa_port * cpu_dp; /* 64 8 */ u8 mac[6]; /* 72 6 */ u8 stp_state; /* 78 1 */ u8 vlan_filtering:1; /* 79: 0 1 */ u8 learning:1; /* 79: 1 1 */ u8 lag_tx_enabled:1; /* 79: 2 1 */ u8 devlink_port_setup:1; /* 79: 3 1 */ u8 setup:1; /* 79: 4 1 */ /* XXX 3 bits hole, try to pack */ struct device_node * dn; /* 80 8 */ unsigned int ageing_time; /* 88 4 */ /* XXX 4 bytes hole, try to pack */ struct dsa_bridge * bridge; /* 96 8 */ struct devlink_port devlink_port; /* 104 288 */ /* --- cacheline 6 boundary (384 bytes) was 8 bytes ago --- */ struct phylink * pl; /* 392 8 */ struct phylink_config pl_config; /* 400 40 */ struct net_device * lag_dev; /* 440 8 */ /* --- cacheline 7 boundary (448 bytes) --- */ struct net_device * hsr_dev; /* 448 8 */ struct list_head list; /* 456 16 */ const struct ethtool_ops * orig_ethtool_ops; /* 472 8 */ const struct dsa_netdevice_ops * netdev_ops; /* 480 8 */ struct mutex addr_lists_lock; /* 488 32 */ /* --- cacheline 8 boundary (512 bytes) was 8 bytes ago --- */ struct list_head fdbs; /* 520 16 */ struct list_head mdbs; /* 536 16 */ /* size: 552, cachelines: 9, members: 30 */ /* sum members: 539, holes: 3, sum holes: 12 */ /* sum bitfield members: 5 bits, bit holes: 1, sum bit holes: 3 bits */ /* last cacheline: 40 bytes */ }; Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit b08db33dabd18c5bd9a419b46302c186801eab10 Author: Vladimir Oltean Date: Wed Jan 5 15:21:35 2022 +0200 net: dsa: move dsa_port :: stp_state near dsa_port :: mac The MAC address of a port is 6 octets in size, and this creates a 2 octet hole after it. There are some other u8 members of struct dsa_port that we can put in that hole. One such member is the stp_state. Before: pahole -C dsa_port net/dsa/slave.o struct dsa_port { union { struct net_device * master; /* 0 8 */ struct net_device * slave; /* 0 8 */ }; /* 0 8 */ const struct dsa_device_ops * tag_ops; /* 8 8 */ struct dsa_switch_tree * dst; /* 16 8 */ struct sk_buff * (*rcv)(struct sk_buff *, struct net_device *); /* 24 8 */ enum { DSA_PORT_TYPE_UNUSED = 0, DSA_PORT_TYPE_CPU = 1, DSA_PORT_TYPE_DSA = 2, DSA_PORT_TYPE_USER = 3, } type; /* 32 4 */ /* XXX 4 bytes hole, try to pack */ struct dsa_switch * ds; /* 40 8 */ unsigned int index; /* 48 4 */ /* XXX 4 bytes hole, try to pack */ const char * name; /* 56 8 */ /* --- cacheline 1 boundary (64 bytes) --- */ struct dsa_port * cpu_dp; /* 64 8 */ u8 mac[6]; /* 72 6 */ /* XXX 2 bytes hole, try to pack */ struct device_node * dn; /* 80 8 */ unsigned int ageing_time; /* 88 4 */ bool vlan_filtering; /* 92 1 */ bool learning; /* 93 1 */ u8 stp_state; /* 94 1 */ /* XXX 1 byte hole, try to pack */ struct dsa_bridge * bridge; /* 96 8 */ struct devlink_port devlink_port; /* 104 288 */ /* --- cacheline 6 boundary (384 bytes) was 8 bytes ago --- */ bool devlink_port_setup; /* 392 1 */ /* XXX 7 bytes hole, try to pack */ struct phylink * pl; /* 400 8 */ struct phylink_config pl_config; /* 408 40 */ /* --- cacheline 7 boundary (448 bytes) --- */ struct net_device * lag_dev; /* 448 8 */ bool lag_tx_enabled; /* 456 1 */ /* XXX 7 bytes hole, try to pack */ struct net_device * hsr_dev; /* 464 8 */ struct list_head list; /* 472 16 */ const struct ethtool_ops * orig_ethtool_ops; /* 488 8 */ const struct dsa_netdevice_ops * netdev_ops; /* 496 8 */ struct mutex addr_lists_lock; /* 504 32 */ /* --- cacheline 8 boundary (512 bytes) was 24 bytes ago --- */ struct list_head fdbs; /* 536 16 */ struct list_head mdbs; /* 552 16 */ bool setup; /* 568 1 */ /* size: 576, cachelines: 9, members: 30 */ /* sum members: 544, holes: 6, sum holes: 25 */ /* padding: 7 */ }; After: pahole -C dsa_port net/dsa/slave.o struct dsa_port { union { struct net_device * master; /* 0 8 */ struct net_device * slave; /* 0 8 */ }; /* 0 8 */ const struct dsa_device_ops * tag_ops; /* 8 8 */ struct dsa_switch_tree * dst; /* 16 8 */ struct sk_buff * (*rcv)(struct sk_buff *, struct net_device *); /* 24 8 */ enum { DSA_PORT_TYPE_UNUSED = 0, DSA_PORT_TYPE_CPU = 1, DSA_PORT_TYPE_DSA = 2, DSA_PORT_TYPE_USER = 3, } type; /* 32 4 */ /* XXX 4 bytes hole, try to pack */ struct dsa_switch * ds; /* 40 8 */ unsigned int index; /* 48 4 */ /* XXX 4 bytes hole, try to pack */ const char * name; /* 56 8 */ /* --- cacheline 1 boundary (64 bytes) --- */ struct dsa_port * cpu_dp; /* 64 8 */ u8 mac[6]; /* 72 6 */ u8 stp_state; /* 78 1 */ /* XXX 1 byte hole, try to pack */ struct device_node * dn; /* 80 8 */ unsigned int ageing_time; /* 88 4 */ bool vlan_filtering; /* 92 1 */ bool learning; /* 93 1 */ /* XXX 2 bytes hole, try to pack */ struct dsa_bridge * bridge; /* 96 8 */ struct devlink_port devlink_port; /* 104 288 */ /* --- cacheline 6 boundary (384 bytes) was 8 bytes ago --- */ bool devlink_port_setup; /* 392 1 */ /* XXX 7 bytes hole, try to pack */ struct phylink * pl; /* 400 8 */ struct phylink_config pl_config; /* 408 40 */ /* --- cacheline 7 boundary (448 bytes) --- */ struct net_device * lag_dev; /* 448 8 */ bool lag_tx_enabled; /* 456 1 */ /* XXX 7 bytes hole, try to pack */ struct net_device * hsr_dev; /* 464 8 */ struct list_head list; /* 472 16 */ const struct ethtool_ops * orig_ethtool_ops; /* 488 8 */ const struct dsa_netdevice_ops * netdev_ops; /* 496 8 */ struct mutex addr_lists_lock; /* 504 32 */ /* --- cacheline 8 boundary (512 bytes) was 24 bytes ago --- */ struct list_head fdbs; /* 536 16 */ struct list_head mdbs; /* 552 16 */ bool setup; /* 568 1 */ /* size: 576, cachelines: 9, members: 30 */ /* sum members: 544, holes: 6, sum holes: 25 */ /* padding: 7 */ }; Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit daa149dd8cd4ad8dc4f8dd47bd24f15992b3a8c1 Author: Huacai Chen Date: Fri Oct 22 15:06:46 2021 +0800 arm64: Use correct method to calculate nomap region boundaries Nomap regions are treated as "reserved". When region boundaries are not page aligned, we usually increase the "reserved" regions rather than decrease them. So, we should use memblock_region_reserved_base_pfn()/ memblock_region_reserved_end_pfn() instead of memblock_region_memory_ base_pfn()/memblock_region_memory_base_pfn() to calculate boundaries. Signed-off-by: Huacai Chen Link: https://lore.kernel.org/r/20211022070646.41923-1-chenhuacai@loongson.cn Signed-off-by: Catalin Marinas commit 8f4c90427a8f0ca0fcdd89d8966fcdab35fb2d4c Author: Baole Fang Date: Wed Jan 5 22:08:54 2022 +0800 ALSA: hda/realtek: Add quirk for Legion Y9000X 2020 Legion Y9000X 2020 has a speaker, but the speaker doesn't work. This can be fixed by applying alc285_fixup_ideapad_s740_coef to fix the speaker's coefficients. Besides, to support the transition between the speaker and the headphone, alc287_fixup_legion_15imhg05_speakers needs to be run. Signed-off-by: Baole Fang Cc: Link: https://lore.kernel.org/r/20220105140856.4855-1-fbl718@163.com Signed-off-by: Takashi Iwai commit dec36c09a5313e811d0e0ecb313b8accc8d0fefb Merge: f81483aaeb59d 9f3d45318dd9e Author: Takashi Iwai Date: Wed Jan 5 15:39:24 2022 +0100 Merge tag 'asoc-v5.17' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Updates for v5.17 Not much going on framework release this time, but a big update for drivers especially the Intel and SOF ones. - Refinements and cleanups around the delay() APIs. - Wider use of dev_err_probe(). - Continuing cleanups and improvements to the SOF code. - Support for pin switches in simple-card derived cards. - Support for AMD Renoir ACP, Asahi Kasei Microdevices AKM4375, Intel systems using NAU8825 and MAX98390, Mediatek MT8915, nVidia Tegra20 S/PDIF, Qualcomm systems using ALC5682I-VS and Texas Instruments TLV320ADC3xxx. commit f81483aaeb59da530b286fe5d081e1705eb5c886 Merge: 08977fe8cfb7d 57f234248ff92 Author: Takashi Iwai Date: Wed Jan 5 15:38:11 2022 +0100 Merge branch 'for-next' into for-linus Pull 5.17 materials. Signed-off-by: Takashi Iwai commit 5be9963d9e170a2193a98ffdc71cdb07896db0cc Merge: c5bcdd8228d80 43710bfebf235 Author: David S. Miller Date: Wed Jan 5 14:36:37 2022 +0000 Merge branch 'hns3-stats-refactor' Jie Wang says: ==================== net: hns3: refactor rss/tqp stats functions Currently, hns3 PF and VF module have two sets of rss and tqp stats APIs to provide get and set functions. Most of these APIs are the same. There is no need to keep these two sets of same functions for double development and bugfix work. This series refactor the rss and tqp stats APIs in hns3 PF and VF by implementing one set of common APIs for PF and VF reuse and deleting the old APIs. ==================== Signed-off-by: David S. Miller commit 43710bfebf235112a2c640f43bda0408e2f9fce4 Author: Jie Wang Date: Wed Jan 5 22:20:15 2022 +0800 net: hns3: create new common cmd code for PF and VF modules Currently PF and VF use two sets of command code for modules to interact with firmware. These codes values are same espect the macro names. It is redundent to keep two sets of command code for same functions between PF and VF. So this patch firstly creates a unified command code for PF and VF module. We keep the macro name same with the PF command code name to avoid too many meaningless modifications. Secondly the new common command codes are used to replace the old ones in VF and deletes the old ones. Signed-off-by: Jie Wang Signed-off-by: David S. Miller commit 4afc310cf9a83108d3cd6327a790eb89eaea7726 Author: Jie Wang Date: Wed Jan 5 22:20:14 2022 +0800 net: hns3: refactor VF tqp stats APIs with new common tqp stats APIs This patch firstly uses new tqp struct(hclge_comm_tqp) and removes the old VF tqp struct(hclgevf_tqp). All the tqp stats members used in VF module are modified according to the new hclge_comm_tqp. Secondly VF tqp stats APIs are refactored to use new common tqp stats APIs. The old tqp stats APIs in VF are deleted. Signed-off-by: Jie Wang Signed-off-by: David S. Miller commit add7645c841cc481fbe927bd5c9b127800e2964d Author: Jie Wang Date: Wed Jan 5 22:20:13 2022 +0800 net: hns3: refactor PF tqp stats APIs with new common tqp stats APIs This patch firstly uses new tqp struct(hclge_comm_tqp) and deletes the old PF tqp struct(hclge_tqp). All the tqp stats members used in PF module are modified according to the new hclge_comm_tqp. Secondly PF tqp stats APIs are refactored to use new common tqp stats APIs. The old tqp stats APIs in PF are deleted. Signed-off-by: Jie Wang Signed-off-by: David S. Miller commit 287db5c40d15cb5ee2d3125133347b73194cba1d Author: Jie Wang Date: Wed Jan 5 22:20:12 2022 +0800 net: hns3: create new set of common tqp stats APIs for PF and VF reuse This patch creates new set of common tqp stats structures and APIs for PF and VF tqp stats module. Subfunctions such as get tqp stats, update tqp stats and reset tqp stats are inclued in this patch. These new common tqp stats APIs will be used to replace the old PF and VF tqp stats APIs in next patches. Signed-off-by: Jie Wang Signed-off-by: David S. Miller commit 93969dc14fcd7fddc081e5a7e003e0e144cc401b Author: Jie Wang Date: Wed Jan 5 22:20:11 2022 +0800 net: hns3: refactor VF rss init APIs with new common rss init APIs This patch uses common rss init APIs to replace the old APIs in VF rss module and removes the old VF rss init APIs. Several related Subfunctions and macros are also modified in this patch. Signed-off-by: Jie Wang Signed-off-by: David S. Miller commit 07dce03cd5aa47259f7f835247f4781d7fe82017 Author: Jie Wang Date: Wed Jan 5 22:20:10 2022 +0800 net: hns3: refactor PF rss init APIs with new common rss init APIs This patch uses common rss init APIs to replace the old APIs in PF rss module and deletes the old PF rss init APIs. Some related subfunctions and macros are also modified in this patch. Signed-off-by: Jie Wang Signed-off-by: David S. Miller commit 2c0d3f4cd25fc779da9bf9459f7a677b00aa9b02 Author: Jie Wang Date: Wed Jan 5 22:20:09 2022 +0800 net: hns3: create new set of common rss init APIs for PF and VF reuse This patch creates new set of common rss init APIs for PF and VF rss module. Subfunctions called by rss init process are also created include rss tuple configuration and rss indirect table configuration. These new common rss init APIs will be used to replace the old PF and VF rss init APIs in next patches. Signed-off-by: Jie Wang Signed-off-by: David S. Miller commit 7428d6c9366560143b9dbb6dbf2141fa811d4bc8 Author: Jie Wang Date: Wed Jan 5 22:20:08 2022 +0800 net: hns3: refactor VF rss set APIs with new common rss set APIs This patch uses new common rss set APIs to replace the old APIs in VF rss module and removes those old rss set APIs. The related macros in VF are also modified. Signed-off-by: Jie Wang Signed-off-by: David S. Miller commit 1813ee52433103d389da7c9c7ee5f81d113d9566 Author: Jie Wang Date: Wed Jan 5 22:20:07 2022 +0800 net: hns3: refactor PF rss set APIs with new common rss set APIs This patch uses new common rss set APIs to replace the old APIs in PF rss module and deletes the old rss set APIs. The related macros are also modified. Signed-off-by: Jie Wang Signed-off-by: David S. Miller commit 6de06004286798ac4b4b10c8c74a6eb03c5035f2 Author: Jie Wang Date: Wed Jan 5 22:20:06 2022 +0800 net: hns3: create new set of common rss set APIs for PF and VF module Currently, hns3 PF and VF rss module have two sets of rss set APIs to configure rss. There is no need to keep two sets of these same APIs. So this patch creates new set of common rss set APIs for PF and VF reuse. These new APIs will be used to unify old APIs in next patches. Signed-off-by: Jie Wang Signed-off-by: David S. Miller commit 027733b12a10855feffd09ee56384df1dd73c084 Author: Jie Wang Date: Wed Jan 5 22:20:05 2022 +0800 net: hns3: refactor VF rss get APIs with new common rss get APIs This patch firstly uses new rss parameter struct(hclge_comm_rss_cfg) as child member of hclgevf_dev and deletes the original child rss parameter member(hclgevf_rss_cfg). All the rss parameter members used in VF rss module is modified according to the new hclge_comm_rss_cfg. Secondly VF rss get APIs are refactored to use new common rss get APIs. The old rss get APIs in VF are deleted. Signed-off-by: Jie Wang Signed-off-by: David S. Miller commit 7347255ea38947140837b3ce9e61ade694c33189 Author: Jie Wang Date: Wed Jan 5 22:20:04 2022 +0800 net: hns3: refactor PF rss get APIs with new common rss get APIs This patch firstly uses new rss parameter struct(hclge_comm_rss_cfg) as child member of hclge_dev and deletes the original child rss parameter members in vport. All the vport child rss parameter members used in PF rss module is modified according to the new hclge_comm_rss_cfg. Secondly PF rss get APIs are refactored to use new common rss get APIs. The old rss get APIs in PF are deleted. Signed-off-by: Jie Wang Signed-off-by: David S. Miller commit 1bfd6682e9b5d42d07fa986709c9df88b18f9bc3 Author: Jie Wang Date: Wed Jan 5 22:20:03 2022 +0800 net: hns3: create new set of common rss get APIs for PF and VF rss module The PF and VF rss get APIs are almost the same espect the suffixes of API names. These same impementions bring double development and bugfix work. So this patch creates new common rss get APIs for PF and VF rss module. Subfunctions called by rss query process are also created(e.g. rss tuple conversion APIs). These new common rss get APIs will be used to replace PF and VF old rss APIs in next patches. Signed-off-by: Jie Wang Signed-off-by: David S. Miller commit 9970308fe6a5903d5f747eed5568a8bcc9457380 Author: Jie Wang Date: Wed Jan 5 22:20:02 2022 +0800 net: hns3: refactor hclge_comm_send function in PF/VF drivers Currently, there are two different sets of special command codes in PF and VF cmdq modules, this is because VF driver only uses small part of all the command codes. In other words, these not used command codes in VF are also sepcial command codes theoretically. So this patch unifes the special command codes and deletes the bool param is_pf of hclge_comm_send. All the related functions are refactored according to the new hclge_comm_send function prototype. Signed-off-by: Jie Wang Signed-off-by: David S. Miller commit 9667b814387c1d7436b0c171d64d7a02d2a21a76 Author: Jie Wang Date: Wed Jan 5 22:20:01 2022 +0800 net: hns3: create new rss common structure hclge_comm_rss_cfg Currently PF stores its rss parameters in vport structure. VF stores rss configurations in hclgevf_rss_cfg structure. Actually hns3 rss parameters are same beween PF and VF. The two set of rss parameters are redundent and may add extra bugfix work. So this patch creates new common rss parameter struct(hclge_comm_rss_cfg) to unify PF and VF rss configurations. These new structures will be used to unify rss configurations in PF and VF rss APIs in next patches. Signed-off-by: Jie Wang Signed-off-by: David S. Miller commit a319cb32e7cfd2703db3a883ce260a7b06729895 Author: Fabio Estevam Date: Tue Jan 4 15:06:13 2022 -0300 ASoC: cs4265: Add a remove() function When the reset_gpio GPIO is used, it is better to put the codec back into reset state when the driver unbinds. Add a remove() function to accomplish that. Suggested-by: Charles Keepax Signed-off-by: Fabio Estevam Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20220104180613.639317-1-festevam@gmail.com Signed-off-by: Mark Brown commit ba235634b138cd9d012dbe983e7920481211e132 Author: Charles Keepax Date: Wed Jan 5 11:30:24 2022 +0000 ASoC: wm_adsp: Add support for "toggle" preloaders In the case a device can support retaining the firmware memory across low power states it is useful for the preloader widget to only power up whilst actually loading/unloading the core, as opposed to the normal operation where the widget is powered for the entire time a firmware is preloaded onto the core. Add support for this mode and a flag to enable it. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220105113026.18955-7-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 7aa1cc1091e0a424e9e7711ca381ebe98b6865bc Author: Charles Keepax Date: Wed Jan 5 11:30:23 2022 +0000 firmware: cs_dsp: Clear core reset for cache If the Halo registers are kept in the register cache the HALO_CORE_RESET bit will be retained as 1 after reset is triggered in cs_dsp_halo_start_core. This will cause subsequent writes to reset the core which is not desired. Apart from this bit the rest of the register bits are cacheable, so for safety sake clear the bit to ensure the cache is consistent. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220105113026.18955-6-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 5f2f539901b0d9bda722637521a11b7f7cf753f1 Author: Charles Keepax Date: Wed Jan 5 11:30:22 2022 +0000 ASoC: cs35l41: Correct handling of some registers in the cache It makes no sense to cache the test/user key registers, since they require values written at specific times, mark them volatile. It is probably best if they can't be accessed from user-space either, so mark them precious as well. The interrupt force, edge, polarity and debounce are all settings applied to the IRQ rather than status bits and as such should not be volatile. The OTP trim values will require re-application in the event of a cache sync and as such should not be volatile. The OTPID however should be volatile. The DSP scratch registers are used to read back an error/debug code from the DSP on shutdown, as such these should be marked volatile. Finally, add some missing defaults, add TST_FS_MON0, and allow the DSP core control register to be cached. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220105113026.18955-5-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 56852cf4b2179fb90068a49538501f31c2de18ea Author: Charles Keepax Date: Wed Jan 5 11:30:21 2022 +0000 ASoC: cs35l41: Correct DSP power down The wm_adsp_event should be called before the early_event on power down, event stops the core running and early_event then powers down the core. Additionally, the core should only be stopped if it was actually running in the first place. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220105113026.18955-4-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 4e7c3cd87db8d9350062a25a8476f90fd1cbc4c9 Author: Charles Keepax Date: Wed Jan 5 11:30:20 2022 +0000 ASoC: cs35l41: Remove incorrect comment The IRQ is not used for the PDN_DONE bit, this is polled during the DAPM sequence, remove the misleading comment. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220105113026.18955-3-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit dcf821319474edde7e85b95608a4539703a2b67d Author: David Rhodes Date: Wed Jan 5 11:30:19 2022 +0000 ASoC: cs35l41: Add cs35l51/53 IDs Add IDs for the CS35L51/53 variants, the functionality is shared with CS35L41. Signed-off-by: David Rhodes Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220105113026.18955-2-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 8ba694e5b7fb5c9b516e59ef9cc6978a7de81b21 Author: Krzysztof Kozlowski Date: Mon Dec 27 19:32:51 2021 +0100 dt-bindings: rng: timeriomem_rng: convert TimerIO RNG to dtschema Convert the TimerIO RNG bindings to DT schema. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211227183251.132525-8-krzysztof.kozlowski@canonical.com commit fb13b5babb97f182b6d61bf4efc9ccf8ed4b1270 Author: Krzysztof Kozlowski Date: Mon Dec 27 19:32:50 2021 +0100 dt-bindings: rng: st,rng: convert ST RNG to dtschema Convert the ST RNG bindings to DT schema. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211227183251.132525-7-krzysztof.kozlowski@canonical.com commit 8000f55a3c6bc13d211547fd38ba092e47427117 Author: Krzysztof Kozlowski Date: Mon Dec 27 19:32:49 2021 +0100 dt-bindings: rng: ti,omap-rom-rng: convert OMAP ROM RNG to dtschema Convert the OMAP ROM RNG bindings to DT schema. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211227183251.132525-6-krzysztof.kozlowski@canonical.com commit ff95e85e6c4668abc20e63d828039a4573b15258 Author: Krzysztof Kozlowski Date: Mon Dec 27 19:32:48 2021 +0100 dt-bindings: rng: nuvoton,npcm-rng: convert Nuvoton NPCM RNG to dtschema Convert the Nuvoton NPCM RNG bindings to DT schema. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211227183251.132525-5-krzysztof.kozlowski@canonical.com commit d5c010ede10ac8c4558f61bda8d50e0d21f8b6ce Author: Krzysztof Kozlowski Date: Mon Dec 27 19:32:47 2021 +0100 dt-bindings: rng: ti,keystone-rng: convert TI Keystone RNG to dtschema Convert the TI Keystone RNG bindings to DT schema. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211227183251.132525-4-krzysztof.kozlowski@canonical.com commit 25b32931c5fec9b99bcc17b1e9db668d49448f3c Author: Krzysztof Kozlowski Date: Mon Dec 27 19:32:46 2021 +0100 dt-bindings: rng: atmel,at91-trng: document sama7g5 TRNG Add compatbile for Microchip sama7g5 TRNG. Signed-off-by: Krzysztof Kozlowski Acked-by: Nicolas Ferre Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211227183251.132525-3-krzysztof.kozlowski@canonical.com commit c92664a9e86265a096e9b66e5154aaed0885a0f2 Author: Krzysztof Kozlowski Date: Mon Dec 27 19:32:45 2021 +0100 dt-bindings: rng: atmel,at91-trng: convert Atmel TRNG to dtschema Convert the Atmel TRNG bindings to DT schema. Signed-off-by: Krzysztof Kozlowski Acked-by: Nicolas Ferre Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211227183251.132525-2-krzysztof.kozlowski@canonical.com commit 4b483349c820a8b5e3a0b4582b642c90d43eac81 Author: Krzysztof Kozlowski Date: Mon Dec 27 19:32:44 2021 +0100 dt-bindings: rng: apm,x-gene-rng: convert APM RNG to dtschema Convert the APM X-Gene RNG bindings to DT schema. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211227183251.132525-1-krzysztof.kozlowski@canonical.com commit 5e22dd18626726028a93ff1350a8a71a00fd843d Author: Jiri Olsa Date: Tue Jan 4 13:10:30 2022 +0100 bpf/selftests: Fix namespace mount setup in tc_redirect The tc_redirect umounts /sys in the new namespace, which can be mounted as shared and cause global umount. The lazy umount also takes down mounted trees under /sys like debugfs, which won't be available after sysfs mounts again and could cause fails in other tests. # cat /proc/self/mountinfo | grep debugfs 34 23 0:7 / /sys/kernel/debug rw,nosuid,nodev,noexec,relatime shared:14 - debugfs debugfs rw # cat /proc/self/mountinfo | grep sysfs 23 86 0:22 / /sys rw,nosuid,nodev,noexec,relatime shared:2 - sysfs sysfs rw # mount | grep debugfs debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime) # ./test_progs -t tc_redirect #164 tc_redirect:OK Summary: 1/4 PASSED, 0 SKIPPED, 0 FAILED # mount | grep debugfs # cat /proc/self/mountinfo | grep debugfs # cat /proc/self/mountinfo | grep sysfs 25 86 0:22 / /sys rw,relatime shared:2 - sysfs sysfs rw Making the sysfs private under the new namespace so the umount won't trigger the global sysfs umount. Reported-by: Hangbin Liu Signed-off-by: Jiri Olsa Signed-off-by: Daniel Borkmann Cc: Jussi Maki Link: https://lore.kernel.org/bpf/20220104121030.138216-1-jolsa@kernel.org commit 0fd800b2456cf90ed738a1260b53acaa8843b5ae Author: Paul Chaignon Date: Tue Jan 4 19:00:13 2022 +0100 bpftool: Probe for instruction set extensions This patch introduces new probes to check whether the kernel supports instruction set extensions v2 and v3. The first introduced eBPF instructions BPF_J{LT,LE,SLT,SLE} in commit 92b31a9af73b ("bpf: add BPF_J{LT,LE,SLT,SLE} instructions"). The second introduces 32-bit variants of all jump instructions in commit 092ed0968bb6 ("bpf: verifier support JMP32"). These probes are useful for userspace BPF projects that want to use newer instruction set extensions on newer kernels, to reduce the programs' sizes or their complexity. LLVM already provides an mcpu=probe option to automatically probe the kernel and select the newest-supported instruction set extension. That is however not flexible enough for all use cases. For example, in Cilium, we only want to use the v3 instruction set extension on v5.10+, even though it is supported on all kernels v5.1+. Signed-off-by: Paul Chaignon Signed-off-by: Daniel Borkmann Reviewed-by: Quentin Monnet Link: https://lore.kernel.org/bpf/3bfedcd9898c1f41ac67ca61f144fec84c6c3a92.1641314075.git.paul@isovalent.com commit c04fb2b0bd9275969be3b0a95f9c3ef76b1bfb73 Author: Paul Chaignon Date: Tue Jan 4 18:59:57 2022 +0100 bpftool: Probe for bounded loop support This patch introduces a new probe to check whether the verifier supports bounded loops as introduced in commit 2589726d12a1 ("bpf: introduce bounded loops"). This patch will allow BPF users such as Cilium to probe for loop support on startup and only unconditionally unroll loops on older kernels. The results are displayed as part of the miscellaneous section, as shown below. $ bpftool feature probe | grep loops Bounded loop support is available $ bpftool feature probe macro | grep LOOPS #define HAVE_BOUNDED_LOOPS $ bpftool feature probe -j | jq .misc { "have_large_insn_limit": true, "have_bounded_loops": true } Signed-off-by: Paul Chaignon Signed-off-by: Daniel Borkmann Reviewed-by: Quentin Monnet Link: https://lore.kernel.org/bpf/f7807c0b27d79f48e71de7b5a99c680ca4bd0151.1641314075.git.paul@isovalent.com commit b22bf1b9979a608827dea98c61ed9ec297bcc513 Author: Paul Chaignon Date: Tue Jan 4 18:59:29 2022 +0100 bpftool: Refactor misc. feature probe There is currently a single miscellaneous feature probe, HAVE_LARGE_INSN_LIMIT, to check for the 1M instructions limit in the verifier. Subsequent patches will add additional miscellaneous probes, which follow the same pattern at the existing probe. This patch therefore refactors the probe to avoid code duplication in subsequent patches. The BPF program type and the checked error numbers in the HAVE_LARGE_INSN_LIMIT probe are changed to better generalize to other probes. The feature probe retains its current behavior despite those changes. Signed-off-by: Paul Chaignon Signed-off-by: Daniel Borkmann Reviewed-by: Quentin Monnet Link: https://lore.kernel.org/bpf/956c9329a932c75941194f91790d01f31dfbe01b.1641314075.git.paul@isovalent.com commit 0bd2fbee9d0b7f801a9c0264d90b1e0d8053f395 Author: YueHaibing Date: Mon Dec 27 12:03:11 2021 +0800 scsi: storvsc: Fix unsigned comparison to zero The unsigned variable sg_count is being assigned a return value from the call to scsi_dma_map() that can return -ENOMEM. Signed-off-by: YueHaibing Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20211227040311.54584-1-yuehaibing@huawei.com Signed-off-by: Wei Liu commit 89d30b11507db7c24fe54cd4ccc498c145406028 Author: Kees Cook Date: Wed Dec 15 11:18:35 2021 -0800 arm64: Drop outdated links in comments As started by commit 05a5f51ca566 ("Documentation: Replace lkml.org links with lore"), an effort was made to replace lkml.org links with lore to better use a single source that's more likely to stay available long-term. However, it seems these links don't offer much value here, so just remove them entirely. Cc: Joe Perches Suggested-by: Will Deacon Link: https://lore.kernel.org/lkml/20210211100213.GA29813@willie-the-truck/ Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20211215191835.1420010-1-keescook@chromium.org [catalin.marinas@arm.com: removed the arch/arm changes] Signed-off-by: Catalin Marinas commit c5bcdd8228d80432471d646646a1203dce5b449f Merge: 2a5ab39beb277 7aacb894b1adf Author: David S. Miller Date: Wed Jan 5 11:25:14 2022 +0000 Merge branch 'lan966x-extend-switchdev-and-mdb-support' Horatiu Vultur says: ==================== net: lan966x: Extend switchdev with mdb support This patch series extends lan966x with mdb support by implementing the switchdev callbacks: SWITCHDEV_OBJ_ID_PORT_MDB and SWITCHDEV_OBJ_ID_HOST_MDB. It adds support for both ipv4/ipv6 entries and l2 entries. v2->v3: - rename PGID_FIRST and PGID_LAST to PGID_GP_START and PGID_GP_END - don't forget and relearn an entry for the CPU if there are more references to the cpu. v1->v2: - rename lan966x_mac_learn_impl to __lan966x_mac_learn - rename lan966x_mac_cpu_copy to lan966x_mac_ip_learn - fix grammar and typos in comments and commit messages - add reference counter for entries that copy frames to CPU ==================== Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit 7aacb894b1adf8b0f46e6370417350a6bac20c55 Author: Horatiu Vultur Date: Tue Jan 4 16:33:38 2022 +0100 net: lan966x: Extend switchdev with mdb support Extend lan966x driver with mdb support by implementing the switchdev calls: SWITCHDEV_OBJ_ID_PORT_MDB and SWITCHDEV_OBJ_ID_HOST_MDB. It is allowed to add both ipv4/ipv6 entries and l2 entries. To add ipv4/ipv6 entries is not required to use the PGID table while for l2 entries it is required. The PGID table is much smaller than MAC table so only fewer l2 entries can be added. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 11b0a27772f5ea294816aabe0f47892ef9b8e65b Author: Horatiu Vultur Date: Tue Jan 4 16:33:37 2022 +0100 net: lan966x: Add PGID_GP_START and PGID_GP_END The first entries in the PGID table are used by the front ports while the last entries are used for different purposes like flooding mask, copy to CPU, etc. So add these macros to define which entries can be used for general purpose. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit fc0c3fe7486f2d3eacef7ef13571f79e92e139cd Author: Horatiu Vultur Date: Tue Jan 4 16:33:36 2022 +0100 net: lan966x: Add function lan966x_mac_ip_learn() Extend mac functionality with the function lan966x_mac_ip_learn. This function adds an entry in the MAC table for IP multicast addresses. These entries can copy a frame to the CPU but also can forward on the front ports. This functionality is needed for mdb support. In case the CPU and some of the front ports subscribe to an IP multicast address. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 2a5ab39beb277528d58cac609c0862f8a6c231d3 Merge: ffd32ea6b13c9 e2e7f6e29c99a Author: David S. Miller Date: Wed Jan 5 11:22:17 2022 +0000 Merge branch 'mtk_eth_soc-refactoring-and-clause45' Daniel Golle says: ==================== net: ethernet: mtk_eth_soc: refactoring and Clause 45 Rework value and type of mdio read and write functions in mtk_eth_soc and generally clean up and unify both functions. Then add support to access Clause 45 phy registers, using newly introduced helper inline functions added by a patch Russell King has suggested in a reply to an earlier version of this series [1]. All three commits are tested on the Bananapi BPi-R64 board having MediaTek MT7531BE DSA gigE switch using clause 22 MDIO and Ubiquiti UniFi 6 LR access point having Aquantia AQR112C PHY using clause 45 MDIO. [1]: https://lore.kernel.org/netdev/Ycr5Cna76eg2B0An@shell.armlinux.org.uk/ v11: also address return value of mtk_mdio_busy_wait v10: correct order of SoB lines in 2/3, change patch order in series v9: improved formatting and Cc missing maintainer v8: add patch from Russel King, switch to bitfield helper macros v7: remove unneeded variables and order OR-ed call parameters v6: further clean up functions and more cleanly separate patches v5: fix wrong variable name in first patch covered by follow-up patch v4: clean-up return values and types, split into two commits v3: return -1 instead of 0xffff on error in _mtk_mdio_write v2: use MII_DEVADDR_C45_SHIFT and MII_REGADDR_C45_MASK to extract device id and register address. Unify read and write functions to have identical types and parameter names where possible as we are anyway already replacing both function bodies. ==================== Signed-off-by: David S. Miller commit e2e7f6e29c99a1c6afc0e0aa4b9ea80302d28720 Author: Daniel Golle Date: Tue Jan 4 12:07:46 2022 +0000 net: ethernet: mtk_eth_soc: implement Clause 45 MDIO access Implement read and write access to IEEE 802.3 Clause 45 Ethernet phy registers while making use of new mdiobus_c45_regad and mdiobus_c45_devad helpers. Tested on the Ubiquiti UniFi 6 LR access point featuring MediaTek MT7622BV WiSoC with Aquantia AQR112C. Signed-off-by: Daniel Golle Signed-off-by: David S. Miller commit c6af53f038aa32cec12e8a305ba07c7ef168f1b0 Author: Russell King (Oracle) Date: Tue Jan 4 12:07:00 2022 +0000 net: mdio: add helpers to extract clause 45 regad and devad fields Add a couple of helpers and definitions to extract the clause 45 regad and devad fields from the regnum passed into MDIO drivers. Tested-by: Daniel Golle Reviewed-by: Andrew Lunn Signed-off-by: Russell King (Oracle) Signed-off-by: Daniel Golle Signed-off-by: David S. Miller commit eda80b249df7bbc7b3dd13907343a3e59bfc57fd Author: Daniel Golle Date: Tue Jan 4 12:06:22 2022 +0000 net: ethernet: mtk_eth_soc: fix return values and refactor MDIO ops Instead of returning -1 (-EPERM) when MDIO bus is stuck busy while writing or 0xffff if it happens while reading, return the appropriate -ETIMEDOUT. Also fix return type to int instead of u32. Refactor functions to use bitfield helpers instead of having various masking and shifting constants in the code, which also results in the register definitions in the header file being more obviously related to what is stated in the MediaTek's Reference Manual. Fixes: 656e705243fd0 ("net-next: mediatek: add support for MT7623 ethernet") Signed-off-by: Daniel Golle Signed-off-by: David S. Miller commit 520451e90cbe9da018a045825626afb354b3465c Author: Bruno Meneguele Date: Tue Dec 28 23:03:03 2021 -0300 ima: silence measurement list hexdump during kexec Directly calling print_hex_dump() dumps the IMA measurement list on soft resets (kexec) straight to the syslog (kmsg/dmesg) without considering the DEBUG flag or the dynamic debug state, causing the output to be always printed, including during boot time. Since this output is only valid for IMA debugging, but not necessary on normal kexec operation, print_hex_dump_debug() adheres to the pr_debug() behavior: the dump is only printed to syslog when DEBUG is defined or when explicitly requested by the user through dynamic debugging. Signed-off-by: Bruno Meneguele Signed-off-by: Mimi Zohar commit 383f0993fc77152b0773c85ed69d6734baf9cb48 Author: Vincent Mailhol Date: Tue Dec 14 01:02:26 2021 +0900 can: netlink: report the CAN controller mode supported flags Currently, the CAN netlink interface provides no easy ways to check the capabilities of a given controller. The only method from the command line is to try each CAN_CTRLMODE_* individually to check whether the netlink interface returns an -EOPNOTSUPP error or not (alternatively, one may find it easier to directly check the source code of the driver instead...) This patch introduces a method for the user to check both the supported and the static capabilities. The proposed method introduces a new IFLA nest: IFLA_CAN_CTRLMODE_EXT which extends the current IFLA_CAN_CTRLMODE. This is done to guaranty a full forward and backward compatibility between the kernel and the user land applications. The IFLA_CAN_CTRLMODE_EXT nest contains one single entry: IFLA_CAN_CTRLMODE_SUPPORTED. Because this entry is only used in one direction: kernel to userland, no new struct nla_policy are introduced. Below table explains how IFLA_CAN_CTRLMODE_SUPPORTED (hereafter: "supported") and can_ctrlmode::flags (hereafter: "flags") allow us to identify both the supported and the static capabilities, when masked with any of the CAN_CTRLMODE_* bit flags: supported & flags & Controller capabilities CAN_CTRLMODE_* CAN_CTRLMODE_* ----------------------------------------------------------------------- false false Feature not supported (always disabled) false true Static feature (always enabled) true false Feature supported but disabled true true Feature supported and enabled Link: https://lore.kernel.org/all/20211213160226.56219-5-mailhol.vincent@wanadoo.fr Signed-off-by: Vincent Mailhol Signed-off-by: Marc Kleine-Budde commit 5fe1be81efd28bf2afcac218f23118dca6b1b648 Author: Vincent Mailhol Date: Tue Dec 14 01:02:25 2021 +0900 can: dev: reorder struct can_priv members for better packing Save eight bytes of holes on x86-64 architectures by reordering the members of struct can_priv. Before: | $ pahole -C can_priv drivers/net/can/dev/dev.o | struct can_priv { | struct net_device * dev; /* 0 8 */ | struct can_device_stats can_stats; /* 8 24 */ | const struct can_bittiming_const * bittiming_const; /* 32 8 */ | const struct can_bittiming_const * data_bittiming_const; /* 40 8 */ | struct can_bittiming bittiming; /* 48 32 */ | /* --- cacheline 1 boundary (64 bytes) was 16 bytes ago --- */ | struct can_bittiming data_bittiming; /* 80 32 */ | const struct can_tdc_const * tdc_const; /* 112 8 */ | struct can_tdc tdc; /* 120 12 */ | /* --- cacheline 2 boundary (128 bytes) was 4 bytes ago --- */ | unsigned int bitrate_const_cnt; /* 132 4 */ | const u32 * bitrate_const; /* 136 8 */ | const u32 * data_bitrate_const; /* 144 8 */ | unsigned int data_bitrate_const_cnt; /* 152 4 */ | u32 bitrate_max; /* 156 4 */ | struct can_clock clock; /* 160 4 */ | unsigned int termination_const_cnt; /* 164 4 */ | const u16 * termination_const; /* 168 8 */ | u16 termination; /* 176 2 */ | | /* XXX 6 bytes hole, try to pack */ | | struct gpio_desc * termination_gpio; /* 184 8 */ | /* --- cacheline 3 boundary (192 bytes) --- */ | u16 termination_gpio_ohms[2]; /* 192 4 */ | enum can_state state; /* 196 4 */ | u32 ctrlmode; /* 200 4 */ | u32 ctrlmode_supported; /* 204 4 */ | int restart_ms; /* 208 4 */ | | /* XXX 4 bytes hole, try to pack */ | | struct delayed_work restart_work; /* 216 88 */ | | /* XXX last struct has 4 bytes of padding */ | | /* --- cacheline 4 boundary (256 bytes) was 48 bytes ago --- */ | int (*do_set_bittiming)(struct net_device *); /* 304 8 */ | int (*do_set_data_bittiming)(struct net_device *); /* 312 8 */ | /* --- cacheline 5 boundary (320 bytes) --- */ | int (*do_set_mode)(struct net_device *, enum can_mode); /* 320 8 */ | int (*do_set_termination)(struct net_device *, u16); /* 328 8 */ | int (*do_get_state)(const struct net_device *, enum can_state *); /* 336 8 */ | int (*do_get_berr_counter)(const struct net_device *, struct can_berr_counter *); /* 344 8 */ | unsigned int echo_skb_max; /* 352 4 */ | | /* XXX 4 bytes hole, try to pack */ | | struct sk_buff * * echo_skb; /* 360 8 */ | | /* size: 368, cachelines: 6, members: 32 */ | /* sum members: 354, holes: 3, sum holes: 14 */ | /* paddings: 1, sum paddings: 4 */ | /* last cacheline: 48 bytes */ | }; After: | $ pahole -C can_priv drivers/net/can/dev/dev.o | struct can_priv { | struct net_device * dev; /* 0 8 */ | struct can_device_stats can_stats; /* 8 24 */ | const struct can_bittiming_const * bittiming_const; /* 32 8 */ | const struct can_bittiming_const * data_bittiming_const; /* 40 8 */ | struct can_bittiming bittiming; /* 48 32 */ | /* --- cacheline 1 boundary (64 bytes) was 16 bytes ago --- */ | struct can_bittiming data_bittiming; /* 80 32 */ | const struct can_tdc_const * tdc_const; /* 112 8 */ | struct can_tdc tdc; /* 120 12 */ | /* --- cacheline 2 boundary (128 bytes) was 4 bytes ago --- */ | unsigned int bitrate_const_cnt; /* 132 4 */ | const u32 * bitrate_const; /* 136 8 */ | const u32 * data_bitrate_const; /* 144 8 */ | unsigned int data_bitrate_const_cnt; /* 152 4 */ | u32 bitrate_max; /* 156 4 */ | struct can_clock clock; /* 160 4 */ | unsigned int termination_const_cnt; /* 164 4 */ | const u16 * termination_const; /* 168 8 */ | u16 termination; /* 176 2 */ | | /* XXX 6 bytes hole, try to pack */ | | struct gpio_desc * termination_gpio; /* 184 8 */ | /* --- cacheline 3 boundary (192 bytes) --- */ | u16 termination_gpio_ohms[2]; /* 192 4 */ | unsigned int echo_skb_max; /* 196 4 */ | struct sk_buff * * echo_skb; /* 200 8 */ | enum can_state state; /* 208 4 */ | u32 ctrlmode; /* 212 4 */ | u32 ctrlmode_supported; /* 216 4 */ | int restart_ms; /* 220 4 */ | struct delayed_work restart_work; /* 224 88 */ | | /* XXX last struct has 4 bytes of padding */ | | /* --- cacheline 4 boundary (256 bytes) was 56 bytes ago --- */ | int (*do_set_bittiming)(struct net_device *); /* 312 8 */ | /* --- cacheline 5 boundary (320 bytes) --- */ | int (*do_set_data_bittiming)(struct net_device *); /* 320 8 */ | int (*do_set_mode)(struct net_device *, enum can_mode); /* 328 8 */ | int (*do_set_termination)(struct net_device *, u16); /* 336 8 */ | int (*do_get_state)(const struct net_device *, enum can_state *); /* 344 8 */ | int (*do_get_berr_counter)(const struct net_device *, struct can_berr_counter *); /* 352 8 */ | | /* size: 360, cachelines: 6, members: 32 */ | /* sum members: 354, holes: 1, sum holes: 6 */ | /* paddings: 1, sum paddings: 4 */ | /* last cacheline: 40 bytes */ | }; Link: https://lore.kernel.org/all/20211213160226.56219-4-mailhol.vincent@wanadoo.fr Signed-off-by: Vincent Mailhol Signed-off-by: Marc Kleine-Budde commit 7d4a101c0bd3c6e5c6e45c705a54f7bc8f6c128d Author: Vincent Mailhol Date: Tue Dec 14 01:02:24 2021 +0900 can: dev: add sanity check in can_set_static_ctrlmode() Previous patch removed can_priv::ctrlmode_static to replace it with can_get_static_ctrlmode(). A condition sine qua non for this to work is that the controller static modes should never be set in can_priv::ctrlmode_supported (c.f. the comment on can_priv::ctrlmode_supported which states that it is for "options that can be *modified* by netlink"). Also, this condition is already correctly fulfilled by all existing drivers which rely on the ctrlmode_static feature. Nonetheless, we added an extra safeguard in can_set_static_ctrlmode() to return an error value and to warn the developer who would be adventurous enough to set to static a given feature that is already set to supported. The drivers which rely on the static controller mode are then updated to check the return value of can_set_static_ctrlmode(). Link: https://lore.kernel.org/all/20211213160226.56219-3-mailhol.vincent@wanadoo.fr Signed-off-by: Vincent Mailhol Signed-off-by: Marc Kleine-Budde commit c9e1d8ed304cc6106c3241add170193995953325 Author: Vincent Mailhol Date: Tue Dec 14 01:02:23 2021 +0900 can: dev: replace can_priv::ctrlmode_static by can_get_static_ctrlmode() The statically enabled features of a CAN controller can be retrieved using below formula: | u32 ctrlmode_static = priv->ctrlmode & ~priv->ctrlmode_supported; As such, there is no need to store this information. This patch remove the field ctrlmode_static of struct can_priv and provides, in replacement, the inline function can_get_static_ctrlmode() which returns the same value. Link: https://lore.kernel.org/all/20211213160226.56219-2-mailhol.vincent@wanadoo.fr Signed-off-by: Vincent Mailhol Signed-off-by: Marc Kleine-Budde commit cc4b08c31b5c51352f258032cc65e884b3e61e6a Author: Vincent Mailhol Date: Tue Dec 7 21:15:31 2021 +0900 can: do not increase tx_bytes statistics for RTR frames The actual payload length of the CAN Remote Transmission Request (RTR) frames is always 0, i.e. no payload is transmitted on the wire. However, those RTR frames still use the DLC to indicate the length of the requested frame. As such, net_device_stats::tx_bytes should not be increased when sending RTR frames. The function can_get_echo_skb() already returns the correct length, even for RTR frames (c.f. [1]). However, for historical reasons, the drivers do not use can_get_echo_skb()'s return value and instead, most of them store a temporary length (or dlc) in some local structure or array. Using the return value of can_get_echo_skb() solves the issue. After doing this, such length/dlc fields become unused and so this patch does the adequate cleaning when needed. This patch fixes all the CAN drivers. Finally, can_get_echo_skb() is decorated with the __must_check attribute in order to force future drivers to correctly use its return value (else the compiler would emit a warning). [1] commit ed3320cec279 ("can: dev: __can_get_echo_skb(): fix real payload length return value for RTR frames") Link: https://lore.kernel.org/all/20211207121531.42941-6-mailhol.vincent@wanadoo.fr Cc: Nicolas Ferre Cc: Alexandre Belloni Cc: Ludovic Desroches Cc: Maxime Ripard Cc: Chen-Yu Tsai Cc: Jernej Skrabec Cc: Yasushi SHOJI Cc: Oliver Hartkopp Cc: Stephane Grosjean Cc: Andreas Larsson Tested-by: Jimmy Assarsson # kvaser Signed-off-by: Vincent Mailhol Acked-by: Stefan Mätje # esd_usb2 Tested-by: Stefan Mätje # esd_usb2 [mkl: add conversion for grcan] Signed-off-by: Marc Kleine-Budde commit 8e674ca74244eac1cd85c6e9a89b588a03c55ff7 Author: Vincent Mailhol Date: Tue Dec 7 21:15:30 2021 +0900 can: do not increase rx_bytes statistics for RTR frames The actual payload length of the CAN Remote Transmission Request (RTR) frames is always 0, i.e. no payload is transmitted on the wire. However, those RTR frames still use the DLC to indicate the length of the requested frame. As such, net_device_stats::rx_bytes should not be increased for the RTR frames. This patch fixes all the CAN drivers. Link: https://lore.kernel.org/all/20211207121531.42941-5-mailhol.vincent@wanadoo.fr Cc: Marc Kleine-Budde Cc: Nicolas Ferre Cc: Alexandre Belloni Cc: Ludovic Desroches Cc: Chandrasekar Ramakrishnan Cc: Maxime Ripard Cc: Chen-Yu Tsai Cc: Jernej Skrabec Cc: Yasushi SHOJI Cc: Appana Durga Kedareswara rao Cc: Naga Sureshkumar Relli Cc: Michal Simek Cc: Stephane Grosjean Tested-by: Jimmy Assarsson # kvaser Signed-off-by: Vincent Mailhol Acked-by: Stefan Mätje # esd_usb2 Tested-by: Stefan Mätje # esd_usb2 Signed-off-by: Marc Kleine-Budde commit f68eafeb9759717227cc4cdda9d47c523709c29f Author: Vincent Mailhol Date: Tue Dec 7 21:15:29 2021 +0900 can: do not copy the payload of RTR frames The actual payload length of the CAN Remote Transmission Request (RTR) frames is always 0, i.e. no payload is transmitted on the wire. However, those RTR frames still use the DLC to indicate the length of the requested frame. For this reason, it is incorrect to copy the payload of RTR frames (the payload buffer would only contain garbage data). This patch encapsulates the payload copy in a check toward the RTR flag. Link: https://lore.kernel.org/all/20211207121531.42941-4-mailhol.vincent@wanadoo.fr Cc: Yasushi SHOJI Tested-by: Yasushi SHOJI Signed-off-by: Vincent Mailhol Signed-off-by: Marc Kleine-Budde commit 0b0ce2c67795672115ac6ca28351a78799cd114b Author: Vincent Mailhol Date: Tue Dec 7 21:15:28 2021 +0900 can: kvaser_usb: do not increase tx statistics when sending error message frames The CAN error message frames (i.e. error skb) are an interface specific to socket CAN. The payload of the CAN error message frames does not correspond to any actual data sent on the wire. Only an error flag and a delimiter are transmitted when an error occurs (c.f. ISO 11898-1 section 10.4.4.2 "Error flag"). For this reason, it makes no sense to increment the tx_packets and tx_bytes fields of struct net_device_stats when sending an error message frame because no actual payload will be transmitted on the wire. N.B. Sending error message frames is a very specific feature which, at the moment, is only supported by the Kvaser Hydra hardware. Please refer to [1] for more details on the topic. [1] https://lore.kernel.org/linux-can/CAMZ6RqK0rTNg3u3mBpZOoY51jLZ-et-J01tY6-+mWsM4meVw-A@mail.gmail.com/t/#u Link: https://lore.kernel.org/all/20211207121531.42941-3-mailhol.vincent@wanadoo.fr Co-developed-by: Jimmy Assarsson Signed-off-by: Jimmy Assarsson Signed-off-by: Vincent Mailhol Signed-off-by: Marc Kleine-Budde commit 676068db69b847f06fe054fca15bf6b107bd24da Author: Vincent Mailhol Date: Tue Dec 7 21:15:27 2021 +0900 can: do not increase rx statistics when generating a CAN rx error message frame The CAN error message frames (i.e. error skb) are an interface specific to socket CAN. The payload of the CAN error message frames does not correspond to any actual data sent on the wire. Only an error flag and a delimiter are transmitted when an error occurs (c.f. ISO 11898-1 section 10.4.4.2 "Error flag"). For this reason, it makes no sense to increment the rx_packets and rx_bytes fields of struct net_device_stats because no actual payload were transmitted on the wire. This patch fixes all the CAN drivers. Link: https://lore.kernel.org/all/20211207121531.42941-2-mailhol.vincent@wanadoo.fr CC: Marc Kleine-Budde CC: Nicolas Ferre CC: Alexandre Belloni CC: Ludovic Desroches CC: Chandrasekar Ramakrishnan CC: Maxime Ripard CC: Chen-Yu Tsai CC: Jernej Skrabec CC: Appana Durga Kedareswara rao CC: Naga Sureshkumar Relli CC: Michal Simek CC: Stephane Grosjean Tested-by: Jimmy Assarsson # kvaser Signed-off-by: Vincent Mailhol Acked-by: Stefan Mätje # esd_usb2 Tested-by: Stefan Mätje # esd_usb2 Signed-off-by: Marc Kleine-Budde commit e233640cd3034ae65924316a0d95ccacb86ae4bd Author: Vincent Mailhol Date: Wed Oct 27 03:05:53 2021 +0900 can: etas_es58x: es58x_init_netdev: populate net_device::dev_port The field dev_port of struct net_device indicates the port number of a network device [1]. This patch populates this field. This field can be helpful to distinguish between the two network interfaces of a dual channel device (i.e. ES581.4 or ES582.1). Indeed, at the moment, all the network interfaces of a same device share the same static udev attributes c.f. output of: | udevadm info --attribute-walk /sys/class/net/canX The dev_port attribute can then be used to write some udev rules to, for example, assign a permanent name to each network interface based on the serial/dev_port pair (which is convenient when you have a test bench with several CAN devices connected simultaneously and wish to keep consistent interface names upon reboot). [1] https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-class-net Link: https://lore.kernel.org/all/20211026180553.1953189-1-mailhol.vincent@wanadoo.fr Suggested-by: Lukas Magel Signed-off-by: Vincent Mailhol Signed-off-by: Marc Kleine-Budde commit decdcaeedce41884d4a5e04b8846271642e09030 Author: Lad Prabhakar Date: Tue Dec 21 20:00:16 2021 +0000 can: sja1000: sp_probe(): use platform_get_irq() to get the interrupt It is preferred that drivers use platform_get_irq() instead of irq_of_parse_and_map(), so replace. Link: https://lore.kernel.org/all/20211221200016.13459-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Lad Prabhakar Signed-off-by: Marc Kleine-Budde commit eff104cf3cf328ade52469b269c1b9b81f78a3f5 Author: Lad Prabhakar Date: Tue Dec 21 19:45:08 2021 +0000 can: ti_hecc: ti_hecc_probe(): use platform_get_irq() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Link: https://lore.kernel.org/all/20211221194508.11737-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Lad Prabhakar Signed-off-by: Marc Kleine-Budde commit 0a6509b0926dea5ebbd2c86551b7681b00585961 Author: Hans de Goede Date: Sun Dec 26 15:18:49 2021 +0100 platform/x86: Add Asus TF103C dock driver Add a driver for the keyboard, touchpad and USB port of the keyboard dock for the Asus TF103C 2-in-1 tablet. This keyboard dock has its own I2C attached embedded controller and the keyboard and touchpad are also connected over I2C, instead of using the usual USB connection. This means that the keyboard dock requires this special driver to function. Cc: Michał Mirosław Cc: Ion Agorria Cc: Svyatoslav Ryhel Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211226141849.156407-1-hdegoede@redhat.com commit 56e18702b0c240dc3c4fde0619e8a78f5f13be97 Author: Damien Le Moal Date: Tue Jan 4 14:53:49 2022 +0900 ata: ahci_dm816: add compile test support Add Kconfig dependendy on COMPILE_TEST to allow compile tests with configs that do not enable ARCH_OMAP2PLUS. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke commit e73d737894dc4a59f232e1a1b16d968569fa0ffd Author: Damien Le Moal Date: Tue Jan 4 14:51:43 2022 +0900 ata: ahci_da850: add compile test support Add Kconfig dependendy on COMPILE_TEST to allow compile tests with configs that do not enable ARCH_DAVINCI_DA850. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke commit 641ba1a5e2f88039b0d62524b2eb668680c94ea9 Author: Damien Le Moal Date: Tue Jan 4 14:48:17 2022 +0900 ata: ahci_brcm: add compile test support Add Kconfig dependendy on COMPILE_TEST to allow compile tests with configs that do not enable ARCH_BRCMSTB, BMIPS_GENERIC or ARCH_BCM_XXX. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke commit 87924c5b4094f195507bebcab96e141e48c947d7 Author: Damien Le Moal Date: Tue Jan 4 13:46:18 2022 +0900 ata: sata_fsl: add compile test support Add dependendy on COMPILE_TEST to allow compile tests with configs that do not enable FSL_SOC. Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke commit 1d009eb6fefb64fb8db1cf9ee179133fc7270f2f Author: Hannes Reinecke Date: Tue Dec 21 08:21:31 2021 +0100 ata: sata_dwc_460ex: Remove debug compile options Driver has been converted to dynamic debugging, so the compile-time options don't have any functionality left. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit d4caa9054e4f9405e8d3d93a5891fe20256257f2 Author: Hannes Reinecke Date: Tue Dec 21 08:21:30 2021 +0100 ata: sata_dwc_460ex: remove 'check_status' argument Remove the 'check_status' argument from sata_dwc_qc_complete() and sata_dwc_dma_xfer_complete() as it has no functionality. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 898a276d4304263e83edffa0bc1792aa8116cc90 Author: Hannes Reinecke Date: Tue Dec 21 08:21:29 2021 +0100 ata: sata_dwc_460ex: drop DEBUG_NCQ Obsolete, and has been converted to tracepoints. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 41d4c60f8623d8a42f649376f678e27d802b8163 Author: Hannes Reinecke Date: Tue Dec 21 08:21:28 2021 +0100 ata: libata-scsi: rework ata_dump_status to avoid using pr_cont() pr_cont() has the problem that individual calls will be disrupted under high load, causing each call to end up on a single line and thereby mangling the output. So rework ata_dump_status() to have just one call to ata_port_warn() and avoid this problem. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit cbc59b8c20863cca43b8b9552cf409a2c8d1be7a Author: Hannes Reinecke Date: Tue Dec 21 08:21:27 2021 +0100 ata: pata_hpt366: convert pr_warn() calls Convert pr_warn() calls to ata_dev_warn() Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 97b7925a5cb44dae4b9f0c8f1b22427521b1de8d Author: Hannes Reinecke Date: Tue Dec 21 08:21:26 2021 +0100 ata: sata_gemini: convert pr_err() calls Convert pr_err() calls to dev_err() Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit cb8d5daae9adcc5dac44c068d5d795056aa6d30c Author: Hannes Reinecke Date: Tue Dec 21 08:21:25 2021 +0100 ata: pata_hpt3x2n: convert pr_XXX() calls Convert pr_XXX() calls to structured logging. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit cb3f48fc57508aea8698e0bee99068fddde30ad9 Author: Hannes Reinecke Date: Tue Dec 21 08:21:24 2021 +0100 ata: pata_octeon_cf: Replace pr_XXX() calls with structured logging Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit f06c13aa01a9855e816fda296e3eda2e656b4c53 Author: Hannes Reinecke Date: Tue Dec 21 08:21:23 2021 +0100 ata: pata_hpt37x: convert pr_XXX() calls Convert pr_XXX() calls to structured logging. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit f76ba003d1b6ac81a8532e49878659c66a361664 Author: Hannes Reinecke Date: Tue Dec 21 08:21:22 2021 +0100 ata: sata_mv: convert remaining printk() to structured logging Refactor the .reset_hc() callback and convert the remaining printk() calls to structured logging. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 16d6623fe958b7fffb35ef4e0120385497295685 Author: Hannes Reinecke Date: Tue Dec 21 08:21:21 2021 +0100 ata: sata_sx4: convert printk() calls Convert printk() calls to structured logging. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 3156234b61036a6db5f229c47f2ad8052962949a Author: Hannes Reinecke Date: Tue Dec 21 08:21:20 2021 +0100 ata: pata_sil680: convert printk() calls Convert printk() calls to structured logging. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit f9bcf5ba2d5f83a694312814fe2e1573891cd054 Author: Hannes Reinecke Date: Tue Dec 21 08:21:19 2021 +0100 ata: pata_serverworks: convert printk() calls Convert printk() calls to structured logging. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 71306ae27c8716f92852dd18978fc5171c26849f Author: Hannes Reinecke Date: Tue Dec 21 08:21:18 2021 +0100 ata: pata_rz1000: convert printk() calls Convert printk() calls to structured logging. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 21f0e60a925ba76ad2ff0c2cd9fbead1fd2cbca0 Author: Hannes Reinecke Date: Tue Dec 21 08:21:17 2021 +0100 ata: pata_marvell: convert printk() calls Convert the printk() call to structured logging and drop the pointless PCI bar debug messages. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 3697aaafc368b66e5d76b749d2b0275a03ce6af1 Author: Hannes Reinecke Date: Tue Dec 21 08:21:16 2021 +0100 ata: pata_it821x: convert printk() calls Convert printk() calls to structured logging. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 3dede7f9b37fbf7e0471e1d14f8eff540fcc87ea Author: Hannes Reinecke Date: Tue Dec 21 08:21:15 2021 +0100 ata: pata_cypress: convert printk() calls Convert printk() calls to structured logging. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 0d43bff5196d2d2c00055470281a11ccfafa740f Author: Hannes Reinecke Date: Tue Dec 21 08:21:14 2021 +0100 ata: pata_cs5536: convert printk() calls Convert printk() calls to structured logging. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 56f7979e770b21b1b420b82ddd83a1b4a301fdb5 Author: Hannes Reinecke Date: Tue Dec 21 08:21:13 2021 +0100 ata: pata_cs5520: convert printk() calls Convert printk() calls to structured logging. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 8705cb7f1b49e03b721ff1891331263dad83f875 Author: Hannes Reinecke Date: Tue Dec 21 08:21:12 2021 +0100 ata: pata_cmd64x: convert printk() calls Convert printk() calls to structured logging. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 0f1c1294c78d1510490e466e167a668dfc0ac5ae Author: Hannes Reinecke Date: Tue Dec 21 08:21:11 2021 +0100 ata: pata_cmd640: convert printk() calls Convert printk() calls to structured logging. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit f2f01a52f28121770c5cd48352a60b87e1fa204b Author: Hannes Reinecke Date: Tue Dec 21 08:21:10 2021 +0100 ata: pata_atp867x: convert printk() calls Convert printk() calls to structured logging. [Damien] Fix ata_port_dbg() format in atp867x_check_ports() to avoid compile warnings with 32-bits arch. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 870bb833c0acb29d8471eac5c2d2e6274826dbb6 Author: Hannes Reinecke Date: Tue Dec 21 08:21:09 2021 +0100 ata: libata: remove debug compilation switches Unused now, so remove and drop any references to them. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit db45905e74e6ae035305719bc683eca40f526669 Author: Hannes Reinecke Date: Tue Dec 21 08:21:08 2021 +0100 ata: libata: remove 'new' ata message handling Remove the remaining bits for the 'new' ata message handling. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 1c95a27c1e544f723f6e0e5a4384098f92996ec0 Author: Hannes Reinecke Date: Tue Dec 21 08:21:07 2021 +0100 ata: libata: drop ata_msg_drv() Callers are already protected by ata_dev_print_info(), so no need to have an additional configuration parameter here. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 96c810f216cb6da15bfa8fe8ef3bf73ca91c5dd8 Author: Hannes Reinecke Date: Tue Dec 21 08:21:06 2021 +0100 ata: libata: drop ata_msg_info() Convert the sole caller to ata_dev_dbg() and remove the definition. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 17a1e1be2fc7dc99945b41df0485037dcb6044d0 Author: Hannes Reinecke Date: Tue Dec 21 08:21:05 2021 +0100 ata: libata: drop ata_msg_probe() All callsites have been converted to dynamic debugging. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 16d424672716dc886fb58ec4a47a408db4781cc0 Author: Hannes Reinecke Date: Tue Dec 21 08:21:04 2021 +0100 ata: libata: drop ata_msg_warn() The WARN level was always enabled, so drop ata_msg_warn(). Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 2f784b923d50cdef1f6bd24d7c18614321b0833a Author: Hannes Reinecke Date: Tue Dec 21 08:21:03 2021 +0100 ata: libata: drop ata_msg_malloc() Unused. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 5cef96b4207e01c9cdb7752acaa178056fe94632 Author: Hannes Reinecke Date: Tue Dec 21 08:21:02 2021 +0100 ata: libata: drop ata_msg_ctl() The one caller have been converted to dynamic debugging. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit d97c75edd806669c9f4b56c0ddae37725c0b708c Author: Hannes Reinecke Date: Tue Dec 21 08:21:01 2021 +0100 ata: libata: drop ata_msg_error() and ata_msg_intr() Unused. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit f11c5403a1f0c5dc4cf8c38f14b26dc9abe8cf75 Author: Hannes Reinecke Date: Tue Dec 21 08:21:00 2021 +0100 ata: sata_sx4: add module parameter 'dimm_test' Add module parameter 'dimm_test' to enable DIMM testing during startup. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit bc21c1056d08525d9c5a5d74db4b8f14e6691991 Author: Hannes Reinecke Date: Tue Dec 21 08:20:59 2021 +0100 ata: sata_sx4: Drop pointless VPRINTK() calls and convert the remaining ones Drop pointless VPRINTK() calls for setting up SG tables and convert the remaining calls to structured logging. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 0b8e9cc71c237105340a40afc2a387e9ceffb595 Author: Hannes Reinecke Date: Tue Dec 21 08:20:58 2021 +0100 ata: sata_sil: Drop pointless VPRINTK() calls Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 14d3630608db7928b26a6e2272ff0e4d298ff910 Author: Hannes Reinecke Date: Tue Dec 21 08:20:57 2021 +0100 ata: sata_fsl: convert VPRINTK() calls to ata_port_dbg() Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 47013c580c73c3870796ca5193a24e3334da4105 Author: Hannes Reinecke Date: Tue Dec 21 08:20:56 2021 +0100 ata: sata_nv: drop pointless VPRINTK() calls and convert remaining ones Quite some information from the VPRINTK() is already covered by tracepoints, so remove the pointless calls and convert the remaining ones to structured logging. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 23b87b9f6ffe89806f8707e5963e509881e2e0fd Author: Hannes Reinecke Date: Tue Dec 21 08:20:55 2021 +0100 ata: sata_mv: Drop pointless VPRINTK() call and convert the remaining one Drop pointless VPRINTK() call and convert the remaining one to dev_dbg(). Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit a0a8005d8642ce29596827a100c6cdc84bbbfb5c Author: Hannes Reinecke Date: Tue Dec 21 08:20:54 2021 +0100 ata: sata_inic162x: Drop pointless VPRINTK() calls Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 559ba1830e4bd7ad71b44ab5d0f75d7a206f75ed Author: Hannes Reinecke Date: Tue Dec 21 08:20:53 2021 +0100 ata: sata_rcar: Drop pointless VPRINTK() calls Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 05d8501fbf063914c19c633e0e6078e9948c129b Author: Hannes Reinecke Date: Tue Dec 21 08:20:52 2021 +0100 ata: sata_qstor: Drop pointless VPRINTK() calls Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 156e67cc0dba1463fbc9bf3b327b642079b5a9fb Author: Hannes Reinecke Date: Tue Dec 21 08:20:51 2021 +0100 ata: sata_promise: Drop pointless VPRINTK() calls and convert the remaining ones Drop pointless VPRINTK() calls for entering and existing interrupt routines and convert the remaining calls to ata_port_dbg(). Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 9913d3902f8f5e30984ae8a716e34935f553cc48 Author: Hannes Reinecke Date: Tue Dec 21 08:20:50 2021 +0100 ata: pata_via: Drop pointless VPRINTK() calls Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit d3e140f2b008e06072af9bfadf2294961bade897 Author: Hannes Reinecke Date: Tue Dec 21 08:20:49 2021 +0100 ata: pata_octeon_cf: Drop pointless VPRINTK() calls and convert the remaining one Drop pointless VPRINTK() calls and convert the remaining calls to the existing bmdma tracepoint. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 51d628f10d55fc3c18685f63000efbd5c848320d Author: Hannes Reinecke Date: Tue Dec 21 08:20:48 2021 +0100 ata: pdc_adma: Drop pointless VPRINTK() calls and remove disabled NCQ debugging Drop pointless VPRINTK() calls for entering routines and setting up sg tables. And while we're at it, remove the disabled debugging messages. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 93c7711494f47f9c829321e2a8711671b02f6e4c Author: Hannes Reinecke Date: Tue Dec 21 08:20:47 2021 +0100 ata: ahci: Drop pointless VPRINTK() calls and convert the remaining ones Drop pointless VPRINTK() calls for entering and existing interrupt routines and convert the remaining calls to dev_dbg(). Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit e1553351d747cbcd62db01d579dff916edcc782c Author: Hannes Reinecke Date: Tue Dec 21 08:20:46 2021 +0100 ata: libata: remove pointless VPRINTK() calls Most of the information is already covered by tracepoints (if not downright pointless), so remove the VPRINTK() calls. And while we're at it, remove ata_scsi_dump_cdb(), too, as this information can be retrieved from scsi tracing. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit b5a5fc8b0f8175e4b3aaf182c1b23de4ccdd3347 Author: Hannes Reinecke Date: Tue Dec 21 08:20:45 2021 +0100 ata: pata_pdc2027x: Replace PDPRINTK() with standard ata logging Use standard ata logging macros instead of the hand-crafted PDPRINTK and remove duplicate logging messages. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 1891b92a4cffaacd6c54684621440e6805a15e3b Author: Hannes Reinecke Date: Tue Dec 21 08:20:44 2021 +0100 ata: sata_qstor: replace DPRINTK() with dev_dbg() Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit fa538d4020e61ff3f71eb29516b4fc02ba129c33 Author: Hannes Reinecke Date: Tue Dec 21 08:20:43 2021 +0100 ata: sata_rcar: replace DPRINTK() with ata_port_dbg() Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 65945144fa849d87b23cac4fbc8565807eefee02 Author: Hannes Reinecke Date: Tue Dec 21 08:20:42 2021 +0100 ata: sata_fsl: move DPRINTK to ata debugging Replace all DPRINTK calls with the ata_XXX_dbg functions. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 774f6bac2ed39ab1d1a7c41cc986279866486c07 Author: Hannes Reinecke Date: Tue Dec 21 08:20:41 2021 +0100 ata: pdc_adma: Remove DPRINTK call The DPRINTK call doesn't print information which isn't already covered by tracepoints later on. Remove it. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit e392e3944f8b1c2075f8e361a2255ca9037e3fc8 Author: Hannes Reinecke Date: Tue Dec 21 08:20:40 2021 +0100 ata: pata_octeon_cf: remove DPRINTK() macro in interrupt context There is only so much information to be glanced when the interrupt routine is called and exited, so remove these DPRINTK() calls. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit a2715a42380bed98be4797287f97c07a388d5695 Author: Hannes Reinecke Date: Tue Dec 21 08:20:39 2021 +0100 ata: sata_mv: replace DPRINTK with dynamic debugging Move the DPRINTK calls over to dynamic debugging. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 37fcfade40f77679f9a3942cbe630f4f4be11452 Author: Hannes Reinecke Date: Tue Dec 21 08:20:38 2021 +0100 ata: sata_mv: kill 'port' argument in mv_dump_all_regs() Always '-1', so drop it and simplify the function. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 4633778b254d6183eb1dd6b538b8e04583167f51 Author: Hannes Reinecke Date: Tue Dec 21 08:20:37 2021 +0100 ata: libata: move DPRINTK to ata debugging Replace all DPRINTK calls with ata_dev_dbg(). Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit d452090301fa19e99a1a1422f70cd7b1092a0f9b Author: Hannes Reinecke Date: Tue Dec 21 08:20:36 2021 +0100 ata: libata: revamp ata_get_cmd_descript() Rename ata_get_cmd_descrip() to ata_get_cmd_name() and simplify it to return "unknown" instead of NULL. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 742bef476ca5352b16063161fb73a56629a6d995 Author: Hannes Reinecke Date: Tue Dec 21 08:20:35 2021 +0100 ata: libata: move ata_{port,link,dev}_dbg to standard pr_XXX() macros Use standard pr_{debug,info,notice,warn,err} macros instead of the hand-crafted printk helpers. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit c318458c9359ce3d10943b0c15a9b9f43dda7b2e Author: Hannes Reinecke Date: Tue Dec 21 08:20:34 2021 +0100 ata: libata: add tracepoints for ATA error handling Add tracepoints for ATA error handling. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 1fe9fb71b2ffcedd794daacf4db2056a6cb5199e Author: Hannes Reinecke Date: Tue Dec 21 08:20:33 2021 +0100 ata: libata-scsi: drop DPRINTK calls for cdb translation Drop DPRINTK calls for cdb translation as they are already covered by other traces, and also drop the DPRINTK calls in ata_scsi_hotplug(). Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 7fad6ad6a357c73f0bdf55476238ae2884de78a3 Author: Hannes Reinecke Date: Tue Dec 21 08:20:32 2021 +0100 ata: libata-sff: tracepoints for HSM state machine Add tracepoints for the HSM state machine and drop DPRINTK calls Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit c206a389c97c9533971cd05eed69b49f535cc193 Author: Hannes Reinecke Date: Tue Dec 21 08:20:31 2021 +0100 ata: libata: tracepoints for bus-master DMA Add tracepoints for bus-master DMA and taskfile related functions. That allows us to drop the relevant DPRINTK() calls. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit b40082d0b033486f8ee4eed5d38278b3164b0e8c Author: Hans de Goede Date: Thu Dec 30 00:14:31 2021 +0100 platform/x86: x86-android-tablets: Add TM800A550L data The whitelabel (sold as various brands) TM800A550L tablets's DSDT contains a whole bunch of bogus ACPI I2C devices and the ACPI node describing the touchscreen is bad (the IRQ is missing). Enumeration of these is skipped through the acpi_quirk_skip_i2c_client_enumeration(). Add support for manually instantiating the (now) missing I2C devices by adding the necessary device info to the x86-android-tablets module, including instantiating an actually working i2c-client for the touchscreen. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211229231431.437982-13-hdegoede@redhat.com commit f359c40bf872fc702efb9cf6aa8576613747580d Author: Hans de Goede Date: Thu Dec 30 00:14:30 2021 +0100 platform/x86: x86-android-tablets: Add Asus MeMO Pad 7 ME176C data Asus MeMO Pad 7 ME176C tablets have an Android factory img with everything hardcoded in the kernel instead of properly described in the DSDT. Add support for manually instantiating all the missing I2C devices by adding the necessary device info to the x86-android-tablets module. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211229231431.437982-12-hdegoede@redhat.com commit 29272d642468cfdf59853630511830780f09c92a Author: Hans de Goede Date: Thu Dec 30 00:14:29 2021 +0100 platform/x86: x86-android-tablets: Add Asus TF103C data Asus TF103C tablets have an Android factory img with everything hardcoded in the kernel instead of properly described in the DSDT. Add support for manually instantiating all the missing I2C devices by adding the necessary device info to the x86-android-tablets module. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211229231431.437982-11-hdegoede@redhat.com commit f08aebe9af935422ec58ff3003eda4dfb91d2dd2 Author: Hans de Goede Date: Thu Dec 30 00:14:28 2021 +0100 platform/x86: x86-android-tablets: Add support for preloading modules Since the x86-android-tablets code does all it work from module_init() it cannot use -EPROBE_DEFER to wait for e.g. interrupt providing GPIO-chips or PMIC-cells to show up. To make sure things will still work when some necessary resource providers are build as module allow the per board info to specify a list of modules to pre-load before instantiating the I2C clients. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211229231431.437982-10-hdegoede@redhat.com commit ef2ac11493e24f6c5ad850761aab39a9095010fe Author: Hans de Goede Date: Thu Dec 30 00:14:27 2021 +0100 platform/x86: x86-android-tablets: Add support for registering GPIO lookup tables Add support for registering GPIO lookup tables. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211229231431.437982-9-hdegoede@redhat.com commit c2138b25d5a42e527588bd26cb2409352d8c0743 Author: Hans de Goede Date: Thu Dec 30 00:14:26 2021 +0100 platform/x86: x86-android-tablets: Add support for instantiating serdevs Add support for instantiating serdevs, this is necessary on some boards where the serdev info in the DSDT has issues. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211229231431.437982-8-hdegoede@redhat.com commit 5eba0141206ea521bbcfcf5067c174e825e943dd Author: Hans de Goede Date: Thu Dec 30 00:14:25 2021 +0100 platform/x86: x86-android-tablets: Add support for instantiating platform-devs Add support for instantiating platform-devs, note this also makes some small changes to the i2c_client instantiating code to make the 2 flows identical. Specifically for the pdevs flow pdev_count must only be set after allocating the pdevs array, to avoid a NULL ptr deref in x86_android_tablet_cleanup() and the i2c_clients flow is updated to work the same way. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211229231431.437982-7-hdegoede@redhat.com commit cd26465fbc03beaa68979c06fc983be86eafcb4b Author: Hans de Goede Date: Thu Dec 30 00:14:24 2021 +0100 platform/x86: x86-android-tablets: Add support for PMIC interrupts The Crystal Cove PMIC has a pin which can be used to connect the IRQ of an external charger IC. On some boards this is used so we need a way to look this up. Note that the Intel PMICs have 2 levels of interrupts and thus 2 levels of IRQ domains all tied to a single fwnode. Level 1 is the irqchip which demultiplexes the actual PMIC interrupt into interrupts for the various MFD cells. Level 2 are the irqchips used in the cell drivers which themselves export IRQs, such as the crystal_cove_gpio driver, which de-multiplexes the level 2 interrupts for the GPIOs into individual per GPIO IRQs. The crystal_cove_charger driver registers an irqchip with a single IRQ for the charger driver to consume. Note the MFD cell IRQ cannot be consumed directly because the level 2 interrupts must be explicitly acked. To allow finding the right IRQ domain when looking up the IRQ for the charger, the crystal_cove_charger driver sets a DOMAIN_BUS_WIRED token on its IRQ domain. Add support for looking up the IRQ from the crystal_cove_charger driver. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211229231431.437982-6-hdegoede@redhat.com commit fc64a2b21603dc1e1bae6f34b4bccfadc992894f Author: Hans de Goede Date: Thu Dec 30 00:14:23 2021 +0100 platform/x86: x86-android-tablets: Don't return -EPROBE_DEFER from a non probe() function The x86-android-tablets code all runs from module_init, so returning -EPROBE_DEFER is not appropriate. Instead log an error and bail. This path should never get hit since PINCTRL_BAYTRAIL is a bool. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211229231431.437982-5-hdegoede@redhat.com commit 7a4af4b891b875b50ddfeb9b566fcc454744ab04 Author: Hans de Goede Date: Mon Jan 3 12:27:00 2022 +0100 platform/x86: touchscreen_dmi: Remove the Glavey TM800A550L entry The Glavey TM800A550L tablet is a tablet which ships with Android as factory OS. As such it has the typical broken DSDT which x86 Android tablets tend to have. Specifically the touchscreen ACPI device node is missing the IRQ for the touchscreen. So far users were expected to fix this with a DSDT overlay, but support for the TM800A550L has been added to the new x86-android-modules kernel-module and that will now automatically instantiate a proper i2c-client with the IRQ set for the touchscreen, including the necessary device-properties for the firmware loading. This means that the touchscreen_dmi entry for the TM800A550L is no longer necessary (and it no longer matches either since the touchscreen is no longer enumerated through ACPI), remove it. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20220103112700.111414-1-hdegoede@redhat.com commit bfe92170c939297a9623d973a122fbe1d9da8c14 Author: Hans de Goede Date: Sat Dec 25 13:02:47 2021 +0100 platform/x86: touchscreen_dmi: Enable pen support on the Chuwi Hi10 Plus and Pro Both the Chuwi Hi10 Plus (CWI527) and the Chuwi Hi10 Pro (CWI529) tablets support being used together with the Hi H2 pen. Add the necessary properties to enable the new support for this in the silead touchscreen driver. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211225120247.95380-2-hdegoede@redhat.com commit 16bbe382bb22af695d4001a52389cee56dd8310b Author: Hans de Goede Date: Sat Dec 25 13:02:46 2021 +0100 platform/x86: touchscreen_dmi: Correct min/max values for Chuwi Hi10 Pro (CWI529) tablet The firmware distributed as part of the Windows and Android drivers uses significantly different min and max values for the x- and y-axis, compared to the EFI's embedded touchscreen firmware. The difference is large enough that e.g. typing on an onscreen keyboard results in the wrong "keys" getting pressed. Adjust the values to match those of the firmware distributed with the Windows and Android drivers (which is necessary for pen support) and put the EFI-fw version's min/max values in the new "silead,efi-fw-min-max" property. The silead driver will use these when it is using the EFI embedded firmware, so as to not regress functionality in that case. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211225120247.95380-1-hdegoede@redhat.com commit 761db353d9e286c1ce26d6f30d6c8b2bb60dcb23 Author: Hans de Goede Date: Sat Dec 25 12:55:09 2021 +0100 platform/x86: Add intel_crystal_cove_charger driver Driver for the external-charger IRQ pass-through function of the Intel Bay Trail Crystal Cove PMIC. Note this is NOT a power_supply class driver, it just deals with IRQ pass-through, this requires this separate driver because the PMIC's level 2 interrupt for this must be explicitly acked. This new driver gets enabled by the existing X86_ANDROID_TABLETS Kconfig option because the x86-android-tablets module is the only consumer of the exported external-charger IRQ. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211225115509.94891-5-hdegoede@redhat.com commit c8e2d921aa968bacc869a0e07baac2ff66a5d6c6 Author: Thomas Weißschuh Date: Wed Jan 5 07:42:38 2022 +0100 power: supply: fix charge_behaviour attribute initialization All properties have to be added to power_supply_attrs which was missed before. Fixes: 1b0b6cc8030d ("power: supply: add charge_behaviour attributes") Reported-by: Heiner Kallweit Suggested-by: Heiner Kallweit Signed-off-by: Thomas Weißschuh Link: https://lore.kernel.org/r/20220105064239.2689-1-linux@weissschuh.net Signed-off-by: Hans de Goede commit e77e561925df2faf77a41896df24a59141a445c9 Author: Tudor Ambarus Date: Wed Dec 15 13:01:15 2021 +0200 dmaengine: at_xdmac: Fix race over irq_status Tasklets run with interrupts enabled, so we need to protect atchan->irq_status with spin_lock_irq() otherwise the tasklet can be interrupted by the IRQ that modifies irq_status. Move the dev_dbg that prints the irq_status in at_xdmac_handle_cyclic() and lower in at_xdmac_tasklet() where the IRQ is disabled. Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20211215110115.191749-13-tudor.ambarus@microchip.com Signed-off-by: Vinod Koul commit a61210cae80cac0701d5aca9551466a389717fd2 Author: Tudor Ambarus Date: Wed Dec 15 13:01:14 2021 +0200 dmaengine: at_xdmac: Remove a level of indentation in at_xdmac_tasklet() Apart of making the code easier to read, this patch is a prerequisite for a functional change: tasklets run with interrupts enabled, so we need to protect atchan->irq_status with spin_lock_irq() otherwise the tasklet can be interrupted by the IRQ that modifies irq_status. atchan->irq_status will be protected in a further patch. Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20211215110115.191749-12-tudor.ambarus@microchip.com Signed-off-by: Vinod Koul commit 912f7c6f7fac273f40e621447cf17d14b50d6e5b Author: Tudor Ambarus Date: Wed Dec 15 13:01:13 2021 +0200 dmaengine: at_xdmac: Fix at_xdmac_lld struct definition The hardware channel next descriptor view structure contains just fields of 32 bits, while dma_addr_t can be of type u64 or u32 depending on CONFIG_ARCH_DMA_ADDR_T_64BIT. Force u32 to comply with what the hardware expects. Fixes: e1f7c9eee707 ("dmaengine: at_xdmac: creation of the atmel eXtended DMA Controller driver") Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20211215110115.191749-11-tudor.ambarus@microchip.com Signed-off-by: Vinod Koul commit 1385eb4d14d447cc5d744bc2ac34f43be66c9963 Author: Tudor Ambarus Date: Wed Dec 15 13:01:12 2021 +0200 dmaengine: at_xdmac: Fix lld view setting AT_XDMAC_CNDC_NDVIEW_NDV3 was set even for AT_XDMAC_MBR_UBC_NDV2, because of the wrong bit handling. Fix it. Fixes: ee0fe35c8dcd ("dmaengine: xdmac: Handle descriptor's view 3 registers") Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20211215110115.191749-10-tudor.ambarus@microchip.com Signed-off-by: Vinod Koul commit 42468aa8b1aa4d7d4d9b56b1d2959d34b7e27575 Author: Tudor Ambarus Date: Wed Dec 15 13:01:11 2021 +0200 dmaengine: at_xdmac: Remove a level of indentation in at_xdmac_advance_work() It's easier to read code with fewer levels of indentation, remove a level of indentation in at_xdmac_advance_work() if (!foo() & !bar()) { } was replaced by: if (foo() || bar()) return; Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20211215110115.191749-9-tudor.ambarus@microchip.com Signed-off-by: Vinod Koul commit 18deddea9184b62941395889ff7659529c877326 Author: Tudor Ambarus Date: Wed Dec 15 13:01:10 2021 +0200 dmaengine: at_xdmac: Fix concurrency over xfers_list Since tx_submit can be called from a hard IRQ, xfers_list must be protected with a lock to avoid concurency on the list's elements. Since at_xdmac_handle_cyclic() is called from a tasklet, spin_lock_irq is enough to protect from a hard IRQ. Fixes: e1f7c9eee707 ("dmaengine: at_xdmac: creation of the atmel eXtended DMA Controller driver") Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20211215110115.191749-8-tudor.ambarus@microchip.com Signed-off-by: Vinod Koul commit 801db90bf294f647b967e8d99b9ae121bea63d0d Author: Tudor Ambarus Date: Wed Dec 15 13:01:09 2021 +0200 dmaengine: at_xdmac: Move the free desc to the tail of the desc list Move the free desc to the tail of the list, so that the sequence of descriptors is more track-able in case of debug. One would know which descriptor should come next and could easier catch concurrency over descriptors for example. virt-dma uses list_splice_tail_init() as well, follow the core driver. Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20211215110115.191749-7-tudor.ambarus@microchip.com Signed-off-by: Vinod Koul commit b63e5cb94ad6947ab5fe38b5a9417dcfd0bc6122 Author: Tudor Ambarus Date: Wed Dec 15 13:01:08 2021 +0200 dmaengine: at_xdmac: Fix race for the tx desc callback The transfer descriptors were wrongly moved to the free descriptors list before calling the tx desc callback. As the DMA engine drivers drop any locks before calling the callback function, txd could be taken again, resulting in its callback called prematurely. Fix the race for the tx desc callback by moving the xfer desc into the free desc list after the callback is invoked. Fixes: e1f7c9eee707 ("dmaengine: at_xdmac: creation of the atmel eXtended DMA Controller driver") Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20211215110115.191749-6-tudor.ambarus@microchip.com Signed-off-by: Vinod Koul commit 506875c30fc5bf92246060bc3b4c38799646266b Author: Tudor Ambarus Date: Wed Dec 15 13:01:07 2021 +0200 dmaengine: at_xdmac: Fix concurrency over chan's completed_cookie Caller of dma_cookie_complete is expected to hold a lock to prevent concurrency over the channel's completed cookie marker. Call dma_cookie_complete() with the lock held. Fixes: e1f7c9eee707 ("dmaengine: at_xdmac: creation of the atmel eXtended DMA Controller driver") Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20211215110115.191749-5-tudor.ambarus@microchip.com Signed-off-by: Vinod Koul commit 5edc24ac876a928f36f407a0fcdb33b94a3a210f Author: Tudor Ambarus Date: Wed Dec 15 13:01:06 2021 +0200 dmaengine: at_xdmac: Print debug message after realeasing the lock It is desirable to do the prints without the lock held if possible, so move the print after the lock is released. Fixes: e1f7c9eee707 ("dmaengine: at_xdmac: creation of the atmel eXtended DMA Controller driver") Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20211215110115.191749-4-tudor.ambarus@microchip.com Signed-off-by: Vinod Koul commit e6af9b05bec63cd4d1de2a33968cd0be2a91282a Author: Tudor Ambarus Date: Wed Dec 15 13:01:05 2021 +0200 dmaengine: at_xdmac: Start transfer for cyclic channels in issue_pending Cyclic channels must too call issue_pending in order to start a transfer. Start the transfer in issue_pending regardless of the type of channel. This wrongly worked before, because in the past the transfer was started at tx_submit level when only a desc in the transfer list. Fixes: e1f7c9eee707 ("dmaengine: at_xdmac: creation of the atmel eXtended DMA Controller driver") Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20211215110115.191749-3-tudor.ambarus@microchip.com Signed-off-by: Vinod Koul commit bccfb96b59179d4f96cbbd1ddff8fac6d335eae4 Author: Tudor Ambarus Date: Wed Dec 15 13:01:04 2021 +0200 dmaengine: at_xdmac: Don't start transactions at tx_submit level tx_submit is supposed to push the current transaction descriptor to a pending queue, waiting for issue_pending() to be called. issue_pending() must start the transfer, not tx_submit(), thus remove at_xdmac_start_xfer() from at_xdmac_tx_submit(). Clients of at_xdmac that assume that tx_submit() starts the transfer must be updated and call dma_async_issue_pending() if they miss to call it (one example is atmel_serial). As the at_xdmac_start_xfer() is now called only from at_xdmac_advance_work() when !at_xdmac_chan_is_enabled(), the at_xdmac_chan_is_enabled() check is no longer needed in at_xdmac_start_xfer(), thus remove it. Fixes: e1f7c9eee707 ("dmaengine: at_xdmac: creation of the atmel eXtended DMA Controller driver") Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20211215110115.191749-2-tudor.ambarus@microchip.com Signed-off-by: Vinod Koul commit f0b7ddbd794bdffade370f22bb7a774002208ef4 Author: Huang Pei Date: Wed Dec 15 16:45:00 2021 +0800 MIPS: retire "asm/llsc.h" all that "asm/llsc.h" does is just to help inline asm, which can be stringifyed from "asm/asm.h" +. Since "asm/asm.h" has all we need, retire "asm/llsc.h" +. remove unused header file Inspired-by: Maciej W. Rozycki Signed-off-by: Huang Pei Signed-off-by: Thomas Bogendoerfer commit 45a98ef4922def8c679ca7c454403d1957fe70e7 Author: Raed Salem Date: Mon Jan 3 13:19:29 2022 +0200 net/xfrm: IPsec tunnel mode fix inner_ipproto setting in sec_path The inner_ipproto saves the inner IP protocol of the plain text packet. This allows vendor's IPsec feature making offload decision at skb's features_check and configuring hardware at ndo_start_xmit, current code implenetation did not handle the case where IPsec is used in tunnel mode. Fix by handling the case when IPsec is used in tunnel mode by reading the protocol of the plain text packet IP protocol. Fixes: fa4535238fb5 ("net/xfrm: Add inner_ipproto into sec_path") Signed-off-by: Raed Salem Signed-off-by: Steffen Klassert commit ffd264bd152cbf88fcf5ced04d3d380c77020231 Author: Daniel Palmer Date: Tue Dec 28 16:34:27 2021 +0900 watchdog: msc313e: Check if the WDT was running at boot Check if the WDT was running at boot and set the running flag if it was. This prevents the system from getting rebooted if the userland daemon doesn't take over soon enough or there isn't a userland daemon at all. Signed-off-by: Daniel Palmer Reviewed-by: Romain Perier Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20211228073427.2443174-1-daniel@0x0f.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 4ed224aeaf661b63c2229df24a4d11a07e2653df Author: Sven Peter Date: Sat Dec 11 13:36:33 2021 +0100 watchdog: Add Apple SoC watchdog driver Add support for the watchdog timer found in Apple SoCs. This driver is also required to reboot these machines. Signed-off-by: Sven Peter Tested-by: Janne Grunau Reviewed-by: Hector Martin Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20211211123633.4392-2-sven@svenpeter.dev Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit b05e69f822914eb9a327ea325b8289ffc5e4b646 Author: Luca Weiss Date: Mon Dec 13 09:26:08 2021 +0100 dt-bindings: watchdog: Add SM6350 and SM8250 compatible Add devicetree compatible for the watchdog on SM6350 and SM8250 SoC. Signed-off-by: Luca Weiss Acked-by: Konrad Dybcio Acked-by: Rob Herring Link: https://lore.kernel.org/r/20211213082614.22651-8-luca.weiss@fairphone.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit f7bcb02390ad319ecc4161b9c9989f710fa6edb2 Author: Sam Protsenko Date: Sun Dec 12 19:02:47 2021 +0200 watchdog: s3c2410: Fix getting the optional clock "watchdog_src" clock is optional and may not be present for some SoCs supported by this driver. Nevertheless, in case the clock is provided but some error happens during its getting, that error should be handled properly. Use devm_clk_get_optional() API for that. Also report possible errors using dev_err_probe() to handle properly -EPROBE_DEFER error (if clock provider is not ready by the time WDT probe function is executed). Fixes: e249d01b5e8b ("watchdog: s3c2410: Support separate source clock") Reported-by: kernel test robot Reported-by: Dan Carpenter Suggested-by: Guenter Roeck Signed-off-by: Sam Protsenko Reviewed-by: Guenter Roeck Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20211212170247.30646-1-semen.protsenko@linaro.org Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit a51f589693899a0325a4381098bbb96e06204983 Author: Lad Prabhakar Date: Thu Dec 16 21:47:47 2021 +0000 watchdog: s3c2410: Use platform_get_irq() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypassed the hierarchical setup and messed up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Signed-off-by: Lad Prabhakar Reviewed-by: Guenter Roeck Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20211216214747.10454-1-prabhakar.mahadev-lad.rj@bp.renesas.com [groeck: Fixed context conflicts] Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit af5bb1c207997c179f1b5b40fced9c39e1d09383 Author: Rob Herring Date: Mon Dec 6 11:40:45 2021 -0600 dt-bindings: watchdog: atmel: Add missing 'interrupts' property With 'unevaluatedProperties' support implemented, the atmel,sama5d4-wdt example has the following warning: /home/rob/proj/git/linux-dt/.build-arm64/Documentation/devicetree/bindings/watchdog/atmel,sama5d4-wdt.example.dt.yaml: watchdog@fc068640: Unevaluated properties are not allowed ('interrupts' was unexpected) Document the missing 'interrupts' property. Cc: Wim Van Sebroeck Cc: Guenter Roeck Cc: Nicolas Ferre Cc: Alexandre Belloni Cc: Ludovic Desroches Cc: Eugen Hristev Cc: linux-watchdog@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Rob Herring Acked-by: Guenter Roeck Reviewed-by: Thierry Reding Acked-by: Nicolas Ferre Link: https://lore.kernel.org/r/20211206174045.2294873-1-robh@kernel.org Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 1bafac47a4f70a169427ffcf59fb673d23e39105 Author: Tzung-Bi Shih Date: Wed Dec 8 17:55:55 2021 +0800 watchdog: mtk_wdt: use platform_get_irq_optional The watchdog pre-timeout (bark) interrupt is optional. Use platform_get_irq_optional() to avoid seeing such following error message: >>> mtk-wdt 10007000.watchdog: IRQ index 0 not found Signed-off-by: Tzung-Bi Shih Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20211208095555.4099551-1-tzungbi@google.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 2cbc5cd0b55fa2310cc557c77b0665f5e00272de Author: Biju Das Date: Tue Nov 30 19:53:57 2021 +0000 watchdog: Add Watchdog Timer driver for RZ/G2L Add Watchdog Timer driver for RZ/G2L SoC. WDT IP block supports normal watchdog timer function and reset request function due to CPU parity error. This driver currently supports normal watchdog timer function and later will add support for reset request function due to CPU parity error. Signed-off-by: Biju Das Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20211130195357.18626-3-biju.das.jz@bp.renesas.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit ab02a00c9e32a5eb1525689b990ad9d345f0832e Author: Biju Das Date: Tue Nov 30 19:53:56 2021 +0000 dt-bindings: watchdog: renesas,wdt: Add support for RZ/G2L Describe the WDT hardware in the RZ/G2L series. Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Reviewed-by: Rob Herring Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20211130195357.18626-2-biju.das.jz@bp.renesas.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 7d608c33cb5843cc9a7f4d86d4cd6a8514cd04a7 Author: Andrej Picej Date: Mon Nov 29 14:49:38 2021 +0100 watchdog: da9063: Add hard dependency on I2C Commit 5ea29919c294 ("watchdog: da9063: use atomic safe i2c transfer in reset handler") implements atomic save i2c transfer which uses i2c functions directly. Add I2C hard dependency which overrides COMPILE_TEST. Reported-by: kernel test robot Fixes: 968011a291f3 ("watchdog: da9063: use atomic safe i2c transfer in reset handler") Signed-off-by: Andrej Picej Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20211129134938.3273289-1-andrej.picej@norik.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 7d7267ae639d569d74fc549f7c56cb39508c4b21 Author: Sander Vanheule Date: Thu Nov 18 17:29:52 2021 +0100 watchdog: Add Realtek Otto watchdog timer Realtek MIPS SoCs (platform name Otto) have a watchdog timer with pretimeout notifitication support. The WDT can (partially) hard reset, or soft reset the SoC. This driver implements all features as described in the devicetree binding, except the phase2 interrupt, and also functions as a restart handler. The cpu reset mode is considered to be a "warm" restart, since this mode does not reset all peripherals. Being an embedded system though, the "cpu" and "software" modes will still cause the bootloader to run on restart. It is not known how a forced system reset can be disabled on the supported platforms. This means that the phase2 interrupt will only fire at the same time as reset, so implementing phase2 is of little use. Signed-off-by: Sander Vanheule Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/6d060bccbdcc709cfa79203485db85aad3c3beb5.1637252610.git.sander@svanheule.net Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 1da9bf73033d9867096c47236c5e04fbf90ca790 Author: Sander Vanheule Date: Thu Nov 18 17:29:51 2021 +0100 dt-bindings: watchdog: Realtek Otto WDT binding Add a binding description for Realtek's watchdog timer as found on several of their MIPS-based SoCs (codenamed Otto), such as the RTL838x, RTL839x, and RTL930x series of switch SoCs. Signed-off-by: Sander Vanheule Reviewed-by: Rob Herring Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/d832d5b02976dd2c2674d46778f61e5cfcd9b651.1637252610.git.sander@svanheule.net Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 10657660c16e689bfad204190e7031b9b1622a35 Author: Huang Pei Date: Wed Dec 15 16:44:59 2021 +0800 MIPS: rework local_t operation on MIPS64 +. remove "asm/war.h" since R10000_LLSC_WAR became a config option +. clean up Suggested-by: Maciej W. Rozycki Signed-off-by: Huang Pei Signed-off-by: Thomas Bogendoerfer commit 277c8cb3e8ac199f075bf9576ad286687ed17173 Author: Huang Pei Date: Wed Dec 15 16:44:57 2021 +0800 MIPS: fix local_{add,sub}_return on MIPS64 Use "daddu/dsubu" for long int on MIPS64 instead of "addu/subu" Fixes: 7232311ef14c ("local_t: mips extension") Signed-off-by: Huang Pei Signed-off-by: Thomas Bogendoerfer commit b8f91799687eeb6ffe73b66420db46d8c0292295 Author: Jimmy Assarsson Date: Wed Dec 8 12:56:05 2021 +0100 can: kvaser_usb: make use of units.h in assignment of frequency Use the MEGA define plus the comment /* Hz */ when assigning frequencies. Link: https://lore.kernel.org/all/20211210075803.343841-1-mkl@pengutronix.de Signed-off-by: Jimmy Assarsson Signed-off-by: Marc Kleine-Budde commit 68fa39ea9124c9794b31016650e4464ebc40ae1d Author: Andy Shevchenko Date: Thu Dec 2 22:58:55 2021 +0200 can: mcp251x: mcp251x_gpio_setup(): Get rid of duplicate of_node assignment GPIO library does copy the of_node from the parent device of the GPIO chip, there is no need to repeat this in the individual drivers. Remove assignment here. For the details one may look into the of_gpio_dev_init() implementation. Link: https://lore.kernel.org/all/20211202205855.76946-1-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Signed-off-by: Marc Kleine-Budde commit 617dbee5c7acfa0a884a423e93fc4dede8e6d4de Author: Marc Kleine-Budde Date: Sun Dec 12 15:56:01 2021 +0100 can: usb_8dev: remove unused member echo_skb from struct usb_8dev_priv This patch removes the unused memberecho_skb from the struct usb_8dev_priv. Fixes: 0024d8ad1639 ("can: usb_8dev: Add support for USB2CAN interface from 8 devices") Link: https://lore.kernel.org/all/20220104230753.956520-1-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde commit ffe31c9ed35d70069ee76d6b6d41ac86a17d7a07 Author: Lad Prabhakar Date: Tue Jan 4 15:36:15 2022 +0000 gpio: rcar: Propagate errors from devm_request_irq() The driver overrides the error code returned by devm_request_irq() to -ENOENT. Switch to propagating the error code upstream. Suggested-by: Andy Shevchenko Signed-off-by: Lad Prabhakar Reviewed-by: Andy Shevchenko Reviewed-by: Sergey Shtylyov Signed-off-by: Bartosz Golaszewski commit f1ff272c60eded6ba1aa4c64a313910ce6e85bff Author: Lad Prabhakar Date: Wed Dec 22 17:19:15 2021 +0000 gpio: rcar: Use platform_get_irq() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypassed the hierarchical setup and messed up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Signed-off-by: Lad Prabhakar Signed-off-by: Bartosz Golaszewski commit 6408693f95275ffec5327d97a4ed22def8b20692 Author: Lad Prabhakar Date: Wed Dec 22 17:19:14 2021 +0000 gpio: ts5500: Use platform_get_irq() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypassed the hierarchical setup and messed up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Signed-off-by: Lad Prabhakar Signed-off-by: Bartosz Golaszewski commit 7a2bccd1a27f0c8fc87e4ed56abd6ea9fa7314a6 Author: Lukas Bulwahn Date: Mon Jan 3 10:45:04 2022 +0100 i3c: master: mipi-i3c-hci: correct the config reference for endianness The referred config BIG_ENDIAN does not exist. The config for the endianness of the CPU architecture is called CPU_BIG_ENDIAN. Correct the config name to the existing config for the endianness. Signed-off-by: Lukas Bulwahn Acked-by: Nicolas Pitre Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220103094504.3602-1-lukas.bulwahn@gmail.com commit 6bcfdc49f38e274e3016c45284bfb286aa5a35d6 Author: Minghao Chi Date: Tue Jan 4 11:20:24 2022 +0000 mips/pci: remove redundant ret variable Return value from rt3883_pci_r32() directly instead of taking this in another redundant variable. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: CGEL ZTE Signed-off-by: Thomas Bogendoerfer commit a029ccc810b65172e02336d9caa0fe2331dc58b7 Author: Yang Yingliang Date: Tue Jan 4 21:34:15 2022 +0800 MIPS: Loongson64: Add missing of_node_put() in ls2k_reset_init() This node pointer is returned by of_find_compatible_node() with refcount incremented in ls2k_reset_init(). Calling of_node_put() to aovid the refcount leak. Fixes: 7eb7819a2e12 ("MIPS: Loongson64: Add Loongson-2K1000 reset platform driver") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Signed-off-by: Thomas Bogendoerfer commit 7ff730ca458e841dbcdc87f264d7afe3eaed525e Author: Clark Wang Date: Mon Dec 27 15:45:29 2021 +0800 i3c: master: svc: enable the interrupt in the enable ibi function If enable interrupt in the svc_i3c_master_bus_init() but do not call enable ibi in the device driver, it will cause a kernel dump in the svc_i3c_master_handle_ibi() when a slave start occurs on the i3c bus, because the data->ibi_pool is not initialized. So only enable the interrupt in svc_i3c_master_enable_ibi() function. Signed-off-by: Clark Wang Reviewed-by: Miquel Raynal Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20211227074529.1660398-9-xiaoning.wang@nxp.com commit c5d4587bb9a9a03b30bbc928b4a007fcd1f8c279 Author: Clark Wang Date: Mon Dec 27 15:45:28 2021 +0800 i3c: master: svc: add the missing module device table The missing MODULE_DEVICE_TABLE() will cause the svc-i3c-master cannot be auto probed when it is built in moudle. So add it. Signed-off-by: Clark Wang Reviewed-by: Miquel Raynal Reviewed-by: Jun Li Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20211227074529.1660398-8-xiaoning.wang@nxp.com commit 05be23ef78f76a741d529226a8764d81c719a1e3 Author: Clark Wang Date: Mon Dec 27 15:45:27 2021 +0800 i3c: master: svc: add runtime pm support Add runtime pm support to dynamically manage the clock. Signed-off-by: Clark Wang Reviewed-by: Miquel Raynal Reviewed-by: Jun Li Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20211227074529.1660398-7-xiaoning.wang@nxp.com commit 173fcb27210b18b38f1080f1c8f806e02cf8a53b Author: Clark Wang Date: Mon Dec 27 15:45:26 2021 +0800 i3c: master: svc: set ODSTOP to let I2C device see the STOP signal If using I2C/I3C mixed mode, need to set ODSTOP. Otherwise, the I2C devices cannot see the stop signal. It may cause message sending errors. Signed-off-by: Clark Wang Reviewed-by: Miquel Raynal Reviewed-by: Jun Li Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20211227074529.1660398-6-xiaoning.wang@nxp.com commit d5e512574dd2eb06ace859b27cafb0de41743bb5 Author: Clark Wang Date: Mon Dec 27 15:45:25 2021 +0800 i3c: master: svc: add support for slave to stop returning data When i3c controller reads data from slave device, slave device can stop returning data with an ACK after any byte. Add this support for svc i3c controller. Otherwise, it will timeout when the slave device ends the read operation early. Signed-off-by: Clark Wang Reviewed-by: Jun Li Reviewed-by: Miquel Raynal Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20211227074529.1660398-5-xiaoning.wang@nxp.com commit 9fd6b5ce8523460b024361a802f5e5738d2da543 Author: Clark Wang Date: Mon Dec 27 15:45:24 2021 +0800 i3c: master: svc: separate err, fifo and disable interrupt of reset function Sometimes only need to reset err and fifo regs, so split the origin reset function to three functions. Put them at the top of the file, to let more functions can call them. Signed-off-by: Clark Wang Reviewed-by: Miquel Raynal Reviewed-by: Jun Li Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20211227074529.1660398-4-xiaoning.wang@nxp.com commit a84a9222b2be2949f11f2d7c487052ac2afed4d4 Author: Clark Wang Date: Mon Dec 27 15:45:23 2021 +0800 i3c: master: svc: fix atomic issue do_daa_locked() function is in a spin lock environment, use readl_poll_timeout_atomic() to replace the origin readl_poll_timeout(). Signed-off-by: Clark Wang Reviewed-by: Miquel Raynal Reviewed-by: Jun Li Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20211227074529.1660398-3-xiaoning.wang@nxp.com commit 57d8d3fc060c7337bc78376ccc699ab80162b7d5 Author: Clark Wang Date: Mon Dec 27 15:45:22 2021 +0800 i3c: master: svc: move module reset behind clk enable Reset I3C module will R/W its regs, so enable its clocks first. Signed-off-by: Clark Wang Reviewed-by: Miquel Raynal Reviewed-by: Jun Li Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20211227074529.1660398-2-xiaoning.wang@nxp.com commit fde212e44f45e491f8e3875084b587c0c2189078 Author: Dave Jiang Date: Tue Dec 14 13:23:14 2021 -0700 dmaengine: idxd: deprecate token sysfs attributes for read buffers The following sysfs attributes will be obsolete due to the name change of tokens to read buffers: max_tokens token_limit group/tokens_allowed group/tokens_reserved group/use_token_limit Create new entries and have old entry print warning of deprecation. New attributes to replace the token ones: max_read_buffers read_buffer_limit group/read_buffers_allowed group/read_buffers_reserved group/use_read_buffer_limit Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/163951339488.2988321.2424012059911316373.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 7ed6f1b85fb613e5e44ef3e14d73f2dc96860935 Author: Dave Jiang Date: Tue Dec 14 13:23:09 2021 -0700 dmaengine: idxd: change bandwidth token to read buffers DSA spec v1.2 has changed the term of "bandwidth tokens" to "read buffers" in order to make the concept clearer. Deprecate bandwidth token naming in the driver and convert to read buffers in order to match with the spec and reduce confusion when reading the spec. Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/163951338932.2988321.6162640806935567317.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 0f225705cf6536826318180831e18a74595efc8d Author: Dave Jiang Date: Tue Dec 14 13:15:17 2021 -0700 dmaengine: idxd: fix wq settings post wq disable By the spec, wq size and group association is not changeable unless device is disabled. Exclude clearing the shadow copy on wq disable/reset. This allows wq type to be changed after disable to be re-enabled. Move the size and group association to its own cleanup and only call it during device disable. Fixes: 0dcfe41e9a4c ("dmanegine: idxd: cleanup all device related bits after disabling device") Reported-by: Lucas Van Tested-by: Lucas Van Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/163951291732.2987775.13576571320501115257.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 403a2e236538c6b479ea5bfc8b75a75540cfba6b Author: Dave Jiang Date: Mon Dec 13 11:51:34 2021 -0700 dmaengine: idxd: change MSIX allocation based on per wq activation Change the driver where WQ interrupt is requested only when wq is being enabled. This new scheme set things up so that request_threaded_irq() is only called when a kernel wq type is being enabled. This also sets up for future interrupt request where different interrupt handler such as wq occupancy interrupt can be setup instead of the wq completion interrupt. Not calling request_irq() until the WQ actually needs an irq also prevents wasting of CPU irq vectors on x86 systems, which is a limited resource. idxd_flush_pending_descs() is moved to device.c since descriptor flushing is now part of wq disable rather than shutdown(). Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/163942149487.2412839.6691222855803875848.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 23a50c8035655c5a1d9b52c878b3ebf7b6b83eea Author: Dave Jiang Date: Mon Dec 13 11:51:29 2021 -0700 dmaengine: idxd: fix descriptor flushing locking The descriptor flushing for shutdown is not holding the irq_entry list lock. If there's ongoing interrupt completion handling, this can corrupt the list. Add locking to protect list walking. Also refactor the code so it's more compact. Fixes: 8f47d1a5e545 ("dmaengine: idxd: connect idxd to dmaengine subsystem") Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/163942148935.2412839.18282664745572777280.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit ec0d64231615e50539d83516b974e7947d45fbce Author: Dave Jiang Date: Mon Dec 13 11:51:23 2021 -0700 dmaengine: idxd: embed irq_entry in idxd_wq struct With irq_entry already being associated with the wq in a 1:1 relationship, embed the irq_entry in the idxd_wq struct and remove back pointers for idxe_wq and idxd_device. In the process of this work, clean up the interrupt handle assignment so that there's no decision to be made during submit call on where interrupt handle value comes from. Set the interrupt handle during irq request initialization time. irq_entry 0 is designated as special and is tied to the device itself. Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/163942148362.2412839.12055447853311267866.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 26e9baa849a262f75b781c7292c36f4fdfbbf03b Author: Greg Kroah-Hartman Date: Tue Jan 4 17:33:30 2022 +0100 dmaengine: ioatdma: use default_groups in kobj_type There are currently 2 ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the ioatdma sysfs code to use default_groups field which has been the preferred way since aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field. Cc: Vinod Koul Cc: dmaengine@vger.kernel.org Signed-off-by: Greg Kroah-Hartman Acked-by: Dave Jiang Link: https://lore.kernel.org/r/20220104163330.1338824-1-gregkh@linuxfoundation.org Signed-off-by: Vinod Koul commit 5cb664fbeba0a11592c1d2774833a4cc49d1ca19 Merge: 105a8c525675b 822c9f2b833c5 Author: Vinod Koul Date: Wed Jan 5 12:48:05 2022 +0530 Merge branch 'fixes' into next We have a conflict in idxd driver between 'fixes' and 'next' and there are patches dependent on this so, merge the 'fixes' branch into next commit c3b48443ba7c4467d44f7faa16fea204ea6c239c Author: Minghao Chi Date: Tue Jan 4 11:24:52 2022 +0000 scsi: aic79xx: Remove redundant error variable Return the value from ahd_linux_queue_abort_cmd() directly instead of using a redundant variable. Link: https://lore.kernel.org/r/20220104112452.601899-1-chi.minghao@zte.com.cn Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: CGEL ZTE Signed-off-by: Martin K. Petersen commit ee05cb71f9f7eb0c257f6b80b70edb4659151b26 Author: Ajish Koshy Date: Tue Dec 28 16:47:53 2021 +0530 scsi: pm80xx: Port reset timeout error handling correction Error handling steps were not in sequence as per the programmers manual. Expected sequence: - PHY_DOWN (PORT_IN_RESET) - PORT_RESET_TIMER_TMO - Host aborts pending I/Os - Host deregister the device - Host sends HW_EVENT_PHY_DOWN ACK Previously we were sending HW_EVENT_PHY_DOWN ACK first and then deregister the device. Fix this to use the expected sequence. Link: https://lore.kernel.org/r/20211228111753.10802-1-Ajish.Koshy@microchip.com Signed-off-by: Ajish Koshy Signed-off-by: Viswas G Signed-off-by: Martin K. Petersen commit 3bb3c24e268ab64305eec670be253eef2238b013 Author: Yang Li Date: Fri Dec 31 16:23:50 2021 +0800 scsi: mpi3mr: Fix formatting problems in some kernel-doc comments Remove some warnings found by running scripts/kernel-doc, which is caused by using 'make W=1'. drivers/scsi/mpi3mr/mpi3mr_fw.c:2188: warning: Function parameter or member 'reason_code' not described in 'mpi3mr_check_rh_fault_ioc' drivers/scsi/mpi3mr/mpi3mr_fw.c:3650: warning: Excess function parameter 'init_type' description in 'mpi3mr_init_ioc' drivers/scsi/mpi3mr/mpi3mr_fw.c:4177: warning: bad line Link: https://lore.kernel.org/r/20211231082350.19315-1-yang.lee@linux.alibaba.com Signed-off-by: Yang Li Signed-off-by: Martin K. Petersen commit 5867b8569e6480d3926b0508ee896532c59fde32 Author: Colin Ian King Date: Fri Dec 24 17:52:40 2021 +0000 scsi: mpi3mr: Fix some spelling mistakes There are some spelling mistakes in some literal strings. Fix them. Link: https://lore.kernel.org/r/20211224175240.1348942-1-colin.i.king@gmail.com Signed-off-by: Colin Ian King Signed-off-by: Martin K. Petersen commit 9211faa39a0350fb2239a0bce03b9459cd14fc40 Author: Suganath Prabu S Date: Mon Dec 27 11:00:55 2021 +0530 scsi: mpt3sas: Update persistent trigger pages from sysfs interface Store sysfs-provided trigger values into the corresponding persistent trigger pages. Otherwise trigger entries are not persistent across system reboots. Link: https://lore.kernel.org/r/20211227053055.289537-1-suganath-prabu.subramani@broadcom.com Signed-off-by: Suganath Prabu S Signed-off-by: Martin K. Petersen commit 81d3f500ee98cf9f5388f0fb0548ba5a57598827 Author: Damien Le Moal Date: Wed Sep 29 18:17:44 2021 +0900 scsi: core: Fix scsi_mode_select() interface The modepage argument is unused. Remove it. Link: https://lore.kernel.org/r/20210929091744.706003-3-damien.lemoal@wdc.com Reviewed-by: Himanshu Madhani Signed-off-by: Damien Le Moal Signed-off-by: Martin K. Petersen commit 4d516e495235a8e95b482a1e9441c4043c7a8235 Author: Randy Dunlap Date: Wed Dec 22 22:11:19 2021 -0800 scsi: aacraid: Fix spelling of "its" Use the possessive "its" instead of the contraction "it's" in user messages. Link: https://lore.kernel.org/r/20211223061119.18304-1-rdunlap@infradead.org Cc: Adaptec OEM Raid Solutions Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Signed-off-by: Randy Dunlap Signed-off-by: Martin K. Petersen commit aa7069d840dab6bef4887657b94e439c82ae985a Author: Jiasheng Jiang Date: Thu Dec 16 18:14:49 2021 +0800 scsi: qedf: Fix potential dereference of NULL pointer The return value of dma_alloc_coherent() needs to be checked to avoid use of NULL pointer in case of an allocation failure. Link: https://lore.kernel.org/r/20211216101449.375953-1-jiasheng@iscas.ac.cn Fixes: 61d8658b4a43 ("scsi: qedf: Add QLogic FastLinQ offload FCoE driver framework.") Acked-by: Saurav Kashyap Signed-off-by: Jiasheng Jiang Signed-off-by: Martin K. Petersen commit ffd32ea6b13c97904cae59bdb13a843d52756578 Author: M Chetan Kumar Date: Tue Jan 4 20:32:13 2022 +0530 Revert "net: wwan: iosm: Keep device at D0 for s2idle case" Depending on BIOS configuration IOSM driver exchanges protocol required for putting device into D3L2 or D3L1.2. ipc_pcie_suspend_s2idle() is implemented to put device to D3L1.2. This patch forces PCI core know this device should stay at D0. - pci_save_state()is expensive since it does a lot of slow PCI config reads. The reported issue is not observed on x86 platform. The supurios wake on AMD platform needs to be futher debugged with orignal patch submitter [1]. Also the impact of adding pci_save_state() needs to be assessed by testing it on other platforms. This reverts commit f4dd5174e273("net: wwan: iosm: Keep device at D0 for s2idle case"). [1] https://lore.kernel.org/all/20211224081914.345292-2-kai.heng.feng@canonical.com/ Signed-off-by: M Chetan Kumar Link: https://lore.kernel.org/r/20220104150213.1894-1-m.chetan.kumar@linux.intel.com Signed-off-by: Jakub Kicinski commit be185c2988b48db65348d94168c793bdbc8d23c3 Author: Nathan Chancellor Date: Fri Dec 10 14:36:27 2021 -0700 cxl/core: Remove cxld_const_init in cxl_decoder_alloc() Commit 48667f676189 ("cxl/core: Split decoder setup into alloc + add") aimed to fix a large stack frame warning but from v5 to v6, it introduced a new instance of the warning due to allocating cxld_const_init on the stack, which was done due to the use of const on the nr_target member of the cxl_decoder struct. With ARCH=arm allmodconfig minus CONFIG_KASAN: GCC 11.2.0: drivers/cxl/core/bus.c: In function ‘cxl_decoder_alloc’: drivers/cxl/core/bus.c:523:1: error: the frame size of 1032 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] 523 | } | ^ cc1: all warnings being treated as errors Clang 12.0.1: drivers/cxl/core/bus.c:486:21: error: stack frame size of 1056 bytes in function 'cxl_decoder_alloc' [-Werror,-Wframe-larger-than=] struct cxl_decoder *cxl_decoder_alloc(struct cxl_port *port, int nr_targets) ^ 1 error generated. Revert that part of the change, which makes the stack frame of cxl_decoder_alloc() much more reasonable. Fixes: 48667f676189 ("cxl/core: Split decoder setup into alloc + add") Link: https://github.com/ClangBuiltLinux/linux/issues/1539 Signed-off-by: Nathan Chancellor Link: https://lore.kernel.org/r/20211210213627.2477370-1-nathan@kernel.org Signed-off-by: Dan Williams commit cca549335f5e00d2c716908d112a6b9366fa263d Author: Frank Rowand Date: Fri Dec 31 21:33:29 2021 -0600 of: unittest: re-implement overlay tracking Some overlays are tracked when they are applied. The tracked overlays are later removed after the overlay tests are completed. The old implementation makes assumptions about the expected values for overlay changeset id created by the overlay apply which result in fragile code. The new code removes the assumptions. A symptom that exposes a problem with the tracking code is a warning "UBSAN: shift-out-of-bounds in drivers/of/unittest.c:1933:36", Kernel Version: 5.15-rc7, PPC-64, Talos II. This results from variable "id" value of -1 in the final line of of_unittest_untrack_overlay(). Reported-by: erhard_f@mailbox.org Signed-off-by: Frank Rowand Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220101033329.1277779-3-frowand.list@gmail.com commit 137b1566c5012dc8dbcaa492afd15be3517b6332 Author: Frank Rowand Date: Fri Dec 31 21:33:28 2021 -0600 of: unittest: change references to obsolete overlay id Unittest inconsistently interchanges overlay changeset id and overlay id. Change variable names of overlay id to overlay changeset id. Do not fix variable names in the overlay tracking functions of_unittest_overlay_tracked(), of_unittest_track_overlay(), and of_unittest_destroy_tracked_overlays() which will be replaced in a following commit. Signed-off-by: Frank Rowand Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20220101033329.1277779-2-frowand.list@gmail.com commit 52864f251d8424c8e47782c7be24bcf37aee2200 Author: David Heidelberg Date: Fri Dec 24 20:53:54 2021 +0100 dt-bindings: display: enable port jdi,lt070me05000 Enable port inside panel bindings. Fixes warnings generated by `make qcom-apq8064-asus-nexus7-flo.dtb` as: arch/arm/boot/dts/qcom-apq8064-asus-nexus7-flo.dt.yaml: panel@0: 'port' does not match any of the regexes: 'pinctrl-[0-9]+' From schema: Documentation/devicetree/bindings/display/panel/jdi,lt070me05000.yaml Signed-off-by: David Heidelberg Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211224195354.78362-1-david@ixit.cz commit 20f3507fdbf918353fc748aa99756955b8a273fa Author: Stanislav Jakubek Date: Thu Dec 23 15:10:02 2021 +0100 dt-bindings: vendor-prefixes: add OnePlus Add vendor prefix for OnePlus (https://www.oneplus.com/) Signed-off-by: Stanislav Jakubek Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211223141002.GA5979@standask-GA-A55M-S2HP commit b29f4889f8860486686adb056030215d413bb928 Author: Rob Herring Date: Tue Dec 21 08:51:45 2021 -0400 dt-bindings: display: st,stm32-dsi: Fix panel node name in example With 'unevaluatedProperties' support enabled, the st,stm32-dsi binding has a new warning: Documentation/devicetree/bindings/display/st,stm32-dsi.example.dt.yaml: dsi@5a000000: Unevaluated properties are not allowed ('panel-dsi@0' was unexpected) The documented child node name is 'panel', so update the example. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211221125145.1195234-1-robh@kernel.org commit 4d4ea94fa6fc8192f7855cba5acaa5e62a0b5e78 Author: Thierry Reding Date: Fri Dec 17 17:59:15 2021 +0100 dt-bindings: memory: Document Tegra210 EMC table Add device tree bindings for the Tegra210 EMC table that is passed via a reserved-memory device tree node. Signed-off-by: Thierry Reding Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211217165919.2700920-1-thierry.reding@gmail.com commit 3cbadd20e3db4ca20901d0f05d921be55ad07237 Author: Masahiro Yamada Date: Mon Dec 13 12:09:15 2021 +0900 parisc: decompressor: do not copy source files while building As commit 7ae4a78daacf ("ARM: 8969/1: decompressor: simplify libfdt builds") stated, copying source files during the build time may not end up with as clean code as expected. Do similar for parisc to clean up the Makefile. Signed-off-by: Masahiro Yamada Acked-by: Helge Deller Signed-off-by: Helge Deller commit a12ac1f0ffa41b7aab3f69c4aac5bb72369bd117 Author: David Heidelberg Date: Mon Dec 13 20:29:45 2021 +0100 dt-bindings: rtc: qcom-pm8xxx-rtc: update register numbers Extend registers up to 2, also document their names. Also fixes warnings generated by `make qcom/sdm845-oneplus-fajita.dtb`: arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dt.yaml: rtc@6000: reg: [[24576], [24832]] is too long From schema: Documentation/devicetree/bindings/rtc/qcom-pm8xxx-rtc.yaml arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dt.yaml: rtc@6000: 'reg-names' does not match any of the regexes: 'pinctrl-[0-9]+' From schema: Documentation/devicetree/bindings/rtc/qcom-pm8xxx-rtc.yaml Signed-off-by: David Heidelberg Reviewed-by: Rob Herring Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20211213192946.111320-1-david@ixit.cz commit 34127b3632b21e5c391756e724b1198eb9917981 Author: Laurence de Bruxelles Date: Sat Jan 1 15:41:49 2022 +0000 rtc: pxa: fix null pointer dereference With the latest stable kernel versions the rtc on the PXA based Zaurus does not work, when booting I see the following kernel messages: pxa-rtc pxa-rtc: failed to find rtc clock source pxa-rtc pxa-rtc: Unable to init SA1100 RTC sub-device pxa-rtc: probe of pxa-rtc failed with error -2 hctosys: unable to open rtc device (rtc0) I think this is because commit f2997775b111 ("rtc: sa1100: fix possible race condition") moved the allocation of the rtc_device struct out of sa1100_rtc_init and into sa1100_rtc_probe. This means that pxa_rtc_probe also needs to do allocation for the rtc_device struct, otherwise sa1100_rtc_init will try to dereference a null pointer. This patch adds that allocation by copying how sa1100_rtc_probe in drivers/rtc/rtc-sa1100.c does it; after the IRQs are set up a managed rtc_device is allocated. I've tested this patch with `qemu-system-arm -machine akita` and with a real Zaurus SL-C1000 applied to 4.19, 5.4, and 5.10. Signed-off-by: Laurence de Bruxelles Fixes: f2997775b111 ("rtc: sa1100: fix possible race condition") Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20220101154149.12026-1-lfdebrux@gmail.com commit 05020a733b02cf7a474305e620fb306cd3abfe84 Author: Lad Prabhakar Date: Mon Dec 20 01:15:24 2021 +0000 rtc: ftrtc010: Use platform_get_irq() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Signed-off-by: Lad Prabhakar Reviewed-by: Linus Walleij Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20211220011524.17206-1-prabhakar.mahadev-lad.rj@bp.renesas.com commit ba52eac083e1598e748811ff58d259f77e4c5c4d Author: Kees Cook Date: Wed Dec 8 20:39:15 2021 -0800 rtc: Move variable into switch case statement When building with automatic stack variable initialization, GCC 12 complains about variables defined outside of switch case statements. Move the variable into the case that uses it, which silences the warning: drivers/rtc/dev.c: In function 'rtc_dev_ioctl': drivers/rtc/dev.c:394:30: warning: statement will never be executed [-Wswitch-unreachable] 394 | long offset; | ^~~~~~ Fixes: 6a8af1b6568a ("rtc: add parameter ioctl") Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20211209043915.1378393-1-keescook@chromium.org commit 7b69b54aaa48979f5e3cebb7225e11cbbdc9f5fb Author: Hugo Villeneuve Date: Tue Dec 7 16:56:25 2021 -0500 rtc: pcf2127: Fix typo in comment Replace TFS2 with TSF2. Signed-off-by: Hugo Villeneuve Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20211207215626.2619819-1-hugo@hugovil.com commit 8462904204abd8cc7f75947d7005c71e8a77da7b Author: Vincent Shih Date: Fri Dec 3 15:46:19 2021 +0800 dt-bindings: rtc: Add Sunplus RTC json-schema Add Sunplus RTC json-schema Signed-off-by: Vincent Shih Reviewed-by: Rob Herring Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/1638517579-10316-3-git-send-email-vincent.sunplus@gamil.com commit fad6cbe9b2b4137f5af5355d4ee7e4eb38221e7e Author: Vincent Shih Date: Fri Dec 3 15:46:18 2021 +0800 rtc: Add driver for RTC in Sunplus SP7021 Add driver for RTC in Sunplus SP7021 Signed-off-by: Vincent Shih Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/1638517579-10316-2-git-send-email-vincent.sunplus@gamil.com commit 32a1bda4b12a3d324bd585e1aa20dac824ab719c Author: Greg Kroah-Hartman Date: Tue Jan 4 17:13:18 2022 +0100 powerpc/opal: use default_groups in kobj_type There are currently 2 ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the powerpc opal dump and elog sysfs code to use default_groups field which has been the preferred way since aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field. Signed-off-by: Greg Kroah-Hartman Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220104161318.1306023-1-gregkh@linuxfoundation.org commit 2bdf3f9e9df0a4ce7709fc916b9997ca2dc30d25 Author: Greg Kroah-Hartman Date: Tue Jan 4 16:54:50 2022 +0100 powerpc/cacheinfo: use default_groups in kobj_type There are currently 2 ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the powerpc cacheinfo sysfs code to use default_groups field which has been the preferred way since aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field. Signed-off-by: Greg Kroah-Hartman Reviewed-by: Tyrel Datwyler Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20220104155450.1291277-1-gregkh@linuxfoundation.org commit ed06106614341301b3c4b84b6c0b497a72caec7d Author: Camel Guo Date: Mon Dec 6 13:58:31 2021 +0100 rtc: rs5c372: fix incorrect oscillation value on r2221tl The XSL bit only exists in RS5C372A/B. On other Ricoh RTC chips supported in rs5c372, this bit has different meaning. For example, on R2221x and R2223x, this bit of oscillation adjustment register determines the operation frequency of oscillation adjustment circuit and the oscillation is always 32768HZ. But rs5c372_get_trim gives 32000HZ to osc when DEV is 1. Signed-off-by: Camel Guo Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20211206125832.6461-1-camel.guo@axis.com commit dd93849d47ce1517c1383ef30bd7497a001d213f Author: Camel Guo Date: Thu Dec 2 16:22:52 2021 +0100 rtc: rs5c372: add offset correction support In order for linux userspace application to be able to adjust offset to keep rtc precision as high as possible, this commit adds support of offset correction by adjusting the time trimming register on rs5c372[a|b] and oscilluation adjustment register on r2025x, r222[1|3]x, rv5c38[6|7]a. Signed-off-by: Camel Guo Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20211202152252.31264-1-camel.guo@axis.com commit 2b642898e5ea206d04684e55235878ea3425659c Author: Fengnan Chang Date: Wed Dec 29 17:47:00 2021 +0800 f2fs: remove redunant invalidate compress pages Compress page will invalidate in truncate block process too, so remove redunant invalidate compress pages in f2fs_evict_inode. Signed-off-by: Fengnan Chang Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit d361b690b6fcd0acdb34a56e9054a6eb6be4b0c3 Author: Yang Li Date: Wed Dec 15 10:38:58 2021 +0800 f2fs: Simplify bool conversion Fix the following coccicheck warning: ./fs/f2fs/sysfs.c:491:41-46: WARNING: conversion to bool not needed here Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Jaegeuk Kim commit 2a64e303e3051550c75897239174e399dfcb8b7e Author: Chao Yu Date: Thu Dec 16 17:13:56 2021 +0800 f2fs: don't drop compressed page cache in .{invalidate,release}page For compressed inode, in .{invalidate,release}page, we will call f2fs_invalidate_compress_pages() to drop all compressed page cache of current inode. But we don't need to drop compressed page cache synchronously in .invalidatepage, because, all trancation paths of compressed physical block has been covered with f2fs_invalidate_compress_page(). And also we don't need to drop compressed page cache synchronously in .releasepage, because, if there is out-of-memory, we can count on page cache reclaim on sbi->compress_inode. BTW, this patch may fix the issue reported below: https://lore.kernel.org/linux-f2fs-devel/20211202092812.197647-1-changfengnan@vivo.com/T/#u Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 300a842937fbcfb5a189cea9ba15374fdb0b5c6b Author: Chao Yu Date: Sat Dec 11 21:27:36 2021 +0800 f2fs: fix to reserve space for IO align feature https://bugzilla.kernel.org/show_bug.cgi?id=204137 With below script, we will hit panic during new segment allocation: DISK=bingo.img MOUNT_DIR=/mnt/f2fs dd if=/dev/zero of=$DISK bs=1M count=105 mkfs.f2fe -a 1 -o 19 -t 1 -z 1 -f -q $DISK mount -t f2fs $DISK $MOUNT_DIR -o "noinline_dentry,flush_merge,noextent_cache,mode=lfs,io_bits=7,fsync_mode=strict" for (( i = 0; i < 4096; i++ )); do name=`head /dev/urandom | tr -dc A-Za-z0-9 | head -c 10` mkdir $MOUNT_DIR/$name done umount $MOUNT_DIR rm $DISK --- Core dump --- Call Trace: allocate_segment_by_default+0x9d/0x100 [f2fs] f2fs_allocate_data_block+0x3c0/0x5c0 [f2fs] do_write_page+0x62/0x110 [f2fs] f2fs_outplace_write_data+0x43/0xc0 [f2fs] f2fs_do_write_data_page+0x386/0x560 [f2fs] __write_data_page+0x706/0x850 [f2fs] f2fs_write_cache_pages+0x267/0x6a0 [f2fs] f2fs_write_data_pages+0x19c/0x2e0 [f2fs] do_writepages+0x1c/0x70 __filemap_fdatawrite_range+0xaa/0xe0 filemap_fdatawrite+0x1f/0x30 f2fs_sync_dirty_inodes+0x74/0x1f0 [f2fs] block_operations+0xdc/0x350 [f2fs] f2fs_write_checkpoint+0x104/0x1150 [f2fs] f2fs_sync_fs+0xa2/0x120 [f2fs] f2fs_balance_fs_bg+0x33c/0x390 [f2fs] f2fs_write_node_pages+0x4c/0x1f0 [f2fs] do_writepages+0x1c/0x70 __writeback_single_inode+0x45/0x320 writeback_sb_inodes+0x273/0x5c0 wb_writeback+0xff/0x2e0 wb_workfn+0xa1/0x370 process_one_work+0x138/0x350 worker_thread+0x4d/0x3d0 kthread+0x109/0x140 ret_from_fork+0x25/0x30 The root cause here is, with IO alignment feature enables, in worst case, we need F2FS_IO_SIZE() free blocks space for single one 4k write due to IO alignment feature will fill dummy pages to make IO being aligned. So we will easily run out of free segments during non-inline directory's data writeback, even in process of foreground GC. In order to fix this issue, I just propose to reserve additional free space for IO alignment feature to handle worst case of free space usage ratio during FGGC. Fixes: 0a595ebaaa6b ("f2fs: support IO alignment for DATA and NODE writes") Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit b702c83e2eaa2fa2d72e957c55c0321535cc8b9f Author: Chao Yu Date: Sun Dec 12 20:28:12 2021 +0800 f2fs: fix to check available space of CP area correctly in update_ckpt_flags() Otherwise, nat_bit area may be persisted across boundary of CP area during nat_bit rebuilding. Fixes: 94c821fb286b ("f2fs: rebuild nat_bits during umount") Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 3e0203893e0dc4f64e7dc65ff5ac70e970019827 Author: Chao Yu Date: Sun Dec 12 17:17:51 2021 +0800 f2fs: support fault injection to f2fs_trylock_op() f2fs: support fault injection for f2fs_trylock_op() This patch supports to inject fault into f2fs_trylock_op(). Usage: a) echo 65536 > /sys/fs/f2fs//inject_type or b) mount -o fault_type=65536 Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit dd9d4a3a30d009c77139d0cab0f2d08b30fa3941 Author: Chao Yu Date: Sun Dec 12 17:16:56 2021 +0800 f2fs: clean up __find_inline_xattr() with __find_xattr() Just cleanup, no logic change. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 645a3c40ca3d40cc32b4b5972bf2620f2eb5dba6 Author: Chao Yu Date: Sun Dec 12 17:16:30 2021 +0800 f2fs: fix to do sanity check on last xattr entry in __f2fs_setxattr() As Wenqing Liu reported in bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=215235 - Overview page fault in f2fs_setxattr() when mount and operate on corrupted image - Reproduce tested on kernel 5.16-rc3, 5.15.X under root 1. unzip tmp7.zip 2. ./single.sh f2fs 7 Sometimes need to run the script several times - Kernel dump loop0: detected capacity change from 0 to 131072 F2FS-fs (loop0): Found nat_bits in checkpoint F2FS-fs (loop0): Mounted with checkpoint version = 7548c2ee BUG: unable to handle page fault for address: ffffe47bc7123f48 RIP: 0010:kfree+0x66/0x320 Call Trace: __f2fs_setxattr+0x2aa/0xc00 [f2fs] f2fs_setxattr+0xfa/0x480 [f2fs] __f2fs_set_acl+0x19b/0x330 [f2fs] __vfs_removexattr+0x52/0x70 __vfs_removexattr_locked+0xb1/0x140 vfs_removexattr+0x56/0x100 removexattr+0x57/0x80 path_removexattr+0xa3/0xc0 __x64_sys_removexattr+0x17/0x20 do_syscall_64+0x37/0xb0 entry_SYSCALL_64_after_hwframe+0x44/0xae The root cause is in __f2fs_setxattr(), we missed to do sanity check on last xattr entry, result in out-of-bound memory access during updating inconsistent xattr data of target inode. After the fix, it can detect such xattr inconsistency as below: F2FS-fs (loop11): inode (7) has invalid last xattr entry, entry_size: 60676 F2FS-fs (loop11): inode (8) has corrupted xattr F2FS-fs (loop11): inode (8) has corrupted xattr F2FS-fs (loop11): inode (8) has invalid last xattr entry, entry_size: 47736 Cc: stable@vger.kernel.org Reported-by: Wenqing Liu Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit a9419b63bf414775e8aeee95d8c4a5e0df690748 Author: Jaegeuk Kim Date: Mon Dec 13 14:16:32 2021 -0800 f2fs: do not bother checkpoint by f2fs_get_node_info This patch tries to mitigate lock contention between f2fs_write_checkpoint and f2fs_get_node_info along with nat_tree_lock. The idea is, if checkpoint is currently running, other threads that try to grab nat_tree_lock would be better to wait for checkpoint. Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 0df035c7208c5e3e2ae7685548353ae536a19015 Author: Jaegeuk Kim Date: Mon Dec 13 13:28:40 2021 -0800 f2fs: avoid down_write on nat_tree_lock during checkpoint Let's cache nat entry if there's no lock contention only. Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 14350ed95867c48f18dfbe86f91c9b9d1880e5c8 Merge: fa55b7dcdc43c 45bd8166a1d82 Author: Stephen Boyd Date: Tue Jan 4 13:05:28 2022 -0800 Merge tag 'clk-v5.17-samsung' of https://git.kernel.org/pub/scm/linux/kernel/git/snawrocki/clk into clk-samsung Pull Samsung clk driver updates from Sylwester Nawrocki: - removal of all remaining uses of __clk_lookup() in drivers/clk/samsung - refactoring of the CPU clocks registration to use common interface - an update of the Exynos850 driver (support for more clock domains) required by the E850-96 development board - initial clock driver for the Exynos7885 SoC (Samsung Galaxy A8) * tag 'clk-v5.17-samsung' of https://git.kernel.org/pub/scm/linux/kernel/git/snawrocki/clk: clk: samsung: Add initial Exynos7885 clock driver clk: samsung: clk-pll: Add support for pll1417x clk: samsung: Make exynos850_register_cmu shared dt-bindings: clock: Document Exynos7885 CMU bindings dt-bindings: clock: Add bindings definitions for Exynos7885 CMU clk: samsung: exynos850: Add missing sysreg clocks dt-bindings: clock: Add bindings for Exynos850 sysreg clocks clk: samsung: exynos850: Register clocks early clk: samsung: exynos850: Keep some crucial clocks running clk: samsung: exynos850: Implement CMU_CMGP domain dt-bindings: clock: Add bindings for Exynos850 CMU_CMGP clk: samsung: exynos850: Implement CMU_APM domain dt-bindings: clock: Add bindings for Exynos850 CMU_APM clk: samsung: Update CPU clk registration clk: samsung: Remove meaningless __init and extern from header files clk: samsung: remove __clk_lookup() usage dt-bindings: clock: samsung: add IDs for some core clocks commit 77e2a04745ff8e391ad402e2d2d1157a5d3a7ebc Author: Sudeep Holla Date: Tue Jan 4 19:51:08 2022 +0000 ACPI: PCC: Implement OperationRegion handler for the PCC Type 3 subtype PCC OpRegion provides a mechanism to communicate with the platform directly from the AML. PCCT provides the list of PCC channel available in the platform, a subset or all of them can be used in PCC Opregion. This patch registers the PCC OpRegion handler before ACPI tables are loaded. This relies on the special context data passed to identify and set up the PCC channel before the OpRegion handler is executed for the first time. Typical PCC Opregion declaration looks like this: OperationRegion (PFRM, PCC, 2, 0x74) Field (PFRM, ByteAcc, NoLock, Preserve) { SIGN, 32, FLGS, 32, LEN, 32, CMD, 32, DATA, 800 } It contains four named double words followed by 100 bytes of buffer names DATA. ASL can fill out the buffer something like: /* Create global or local buffer */ Name (BUFF, Buffer (0x0C){}) /* Create double word fields over the buffer */ CreateDWordField (BUFF, 0x0, WD0) CreateDWordField (BUFF, 0x04, WD1) CreateDWordField (BUFF, 0x08, WD2) /* Fill the named fields */ WD0 = 0x50434300 SIGN = BUFF WD0 = 1 FLGS = BUFF WD0 = 0x10 LEN = BUFF /* Fill the payload in the DATA buffer */ WD0 = 0 WD1 = 0x08 WD2 = 0 DATA = BUFF /* Write to CMD field to trigger handler */ WD0 = 0x4404 CMD = BUFF This buffer is received by acpi_pcc_opregion_space_handler. This handler will fetch the complete buffer via internal_pcc_buffer. The setup handler will receive the special PCC context data which will contain the PCC channel index which used to set up the channel. The buffer pointer and length is saved in region context which is then used in the handler. (kernel test robot: Build failure with CONFIG_ACPI_DEBUGGER) Link: https://lore.kernel.org/r/202201041539.feAV0l27-lkp@intel.com Reported-by: kernel test robot Signed-off-by: Sudeep Holla Signed-off-by: Rafael J. Wysocki commit cba23ac158db7f3cd48a923d6861bee2eb7a2978 Author: Joe Thornber Date: Fri Dec 10 13:49:53 2021 +0000 dm space map common: add bounds check to sm_ll_lookup_bitmap() Corrupted metadata could warrant returning error from sm_ll_lookup_bitmap(). Signed-off-by: Joe Thornber Signed-off-by: Mike Snitzer commit 85bca3c05b6cca31625437eedf2060e846c4bbad Author: Joe Thornber Date: Fri Dec 10 13:44:13 2021 +0000 dm btree: add a defensive bounds check to insert_at() Corrupt metadata could trigger an out of bounds write. Signed-off-by: Joe Thornber Signed-off-by: Mike Snitzer commit c671ffa55d8b0dd3ed0a329e15dfe9c58f7483cd Author: Joe Thornber Date: Fri Dec 10 13:36:06 2021 +0000 dm btree remove: change a bunch of BUG_ON() calls to proper errors Abuse of BUG_ON() is never appropriate, best to propagate errors to fail gracefully (rather than take the entire system down). Signed-off-by: Joe Thornber Signed-off-by: Mike Snitzer commit efe99bba2862aef24f1b05b786f6bf5acb076209 Author: Matthew Wilcox (Oracle) Date: Fri Nov 26 13:58:10 2021 -0500 truncate: Add truncate_cleanup_folio() Convert both callers of truncate_cleanup_page() to use truncate_cleanup_folio() instead. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski commit 82c50f8b443359ec99348cd9b1289f55cd47779d Author: Matthew Wilcox (Oracle) Date: Wed Jul 28 15:14:48 2021 -0400 filemap: Add filemap_release_folio() Reimplement try_to_release_page() as a wrapper around filemap_release_folio(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski commit 960ea971fa6cdac8d4825a6aaf99b92882e79fbb Author: Matthew Wilcox (Oracle) Date: Fri Mar 12 23:57:44 2021 -0500 filemap: Use a folio in filemap_page_mkwrite This fixes a bug for tail pages. They always have a NULL mapping, so the check would fail and we would never mark the folio as dirty. Ends up growing the kernel by 19 bytes although there will be fewer calls to compound_head() dynamically. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski commit 820b05e92bdf07de94bc52c17d935d9ca0a481b3 Author: Matthew Wilcox (Oracle) Date: Fri Mar 12 23:46:45 2021 -0500 filemap: Use a folio in filemap_map_pages Saves 61 bytes due to fewer calls to compound_head(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski commit 9184a307768bf66af1f67d903d7b00725b7a6e8c Author: Matthew Wilcox (Oracle) Date: Fri Mar 12 23:33:43 2021 -0500 filemap: Use folios in next_uptodate_page This saves 105 bytes of text. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski commit 1afd7ae51f63f345afd1a22049ac01065c8a5d1b Author: Matthew Wilcox (Oracle) Date: Fri Mar 12 23:13:46 2021 -0500 filemap: Convert page_cache_delete_batch to folios Saves one call to compound_head() and reduces text size by 15 bytes. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski commit 65bca53b5f634aea13946359278818f225e08695 Author: Matthew Wilcox (Oracle) Date: Wed Mar 10 14:01:22 2021 -0500 filemap: Convert filemap_get_pages to use folios This saves a few calls to compound_head(), including one in filemap_update_page(). Shrinks the kernel by 78 bytes. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski commit 81f4c03b7de75727be438f8f3e1683e0b0d1556a Author: Matthew Wilcox (Oracle) Date: Thu Dec 23 15:17:28 2021 -0500 filemap: Drop the refcount while waiting for page lock Commit bd8a1f3655a7 ("mm/filemap: support readpage splitting a page") changed the read_iter path to drop the refcount while waiting for the page lock. However, it missed the same pattern in read_mapping_page() and friends. Use the same pattern in do_read_cache_folio() that is used in filemap_update_page(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: William Kucharski commit 539a3322f208db478db88c4a76239476defce6b1 Author: Matthew Wilcox (Oracle) Date: Wed Dec 16 11:45:30 2020 -0500 filemap: Add read_cache_folio and read_mapping_folio Reimplement read_cache_page() as a wrapper around read_cache_folio(). Saves over 400 bytes of text from do_read_cache_folio() which more than makes up for the extra 100 bytes of text added to the various wrapper functions. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: William Kucharski commit e292e6d644ce7ba4036494dc1b6ae1dcd79e0a86 Author: Matthew Wilcox (Oracle) Date: Wed Mar 10 10:46:41 2021 -0500 filemap: Convert filemap_fault to folio Instead of converting back-and-forth between the actual page and the head page, just convert once at the end of the function where we set the vmf->page. Saves 241 bytes of text, or 15% of the size of filemap_fault(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski commit 79598cedad85d192dac2b85799f44aa31f7f2279 Author: Matthew Wilcox (Oracle) Date: Thu Jul 29 14:57:01 2021 -0400 filemap: Convert do_async_mmap_readahead to take a folio Call page_cache_async_ra() directly instead of indirecting through page_cache_async_readahead(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski commit 0387df1d1fa7d6371a7f0603c30c1d8b3bd54eba Author: Matthew Wilcox (Oracle) Date: Wed Mar 10 16:06:51 2021 -0500 readahead: Convert page_cache_ra_unbounded to folios This saves 99 bytes of kernel text. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski commit 7836d9990079ed611199819ccf487061b748193a Author: Matthew Wilcox (Oracle) Date: Thu May 27 12:30:54 2021 -0400 readahead: Convert page_cache_async_ra() to take a folio Using the folio here avoids checking whether it's a tail page. This patch mostly just enables some of the following patches. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski commit 2fa4eeb800c0f8279f396abde010360f48b4b1d4 Author: Matthew Wilcox (Oracle) Date: Wed Mar 10 11:04:19 2021 -0500 filemap: Convert filemap_range_uptodate to folios The only caller was already passing a head page, so this simply avoids a call to compound_head(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski commit a5d4ad098528f5753340e7df1bf903fa2c03f599 Author: Matthew Wilcox (Oracle) Date: Wed Mar 10 10:34:00 2021 -0500 filemap: Convert filemap_create_page to folio This is all internal to filemap and saves 100 bytes of text. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski commit 9d427b4eb45689c5fca08ef0afe9215e72545df2 Author: Matthew Wilcox (Oracle) Date: Wed Mar 10 10:19:30 2021 -0500 filemap: Convert filemap_read_page to take a folio One of the callers already had a folio; the other two grow by a few bytes, but filemap_read_page() shrinks by 50 bytes for a net reduction of 27 bytes. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski commit e1c37722b0687ea77cd2be9389ead58ea85da465 Author: Matthew Wilcox (Oracle) Date: Sat Mar 6 16:38:38 2021 -0500 filemap: Convert find_get_pages_contig to folios None of the callers of find_get_pages_contig() want tail pages. They all use order-0 pages today, but if they were converted, they'd want folios. So just remove the call to find_subpage() instead of replacing it with folio_page(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski commit bdb72932976943d4db371e18a5321489351c43da Author: Matthew Wilcox (Oracle) Date: Fri Mar 5 10:29:41 2021 -0500 filemap: Convert filemap_get_read_batch to use folios The page cache only stores folios, never tail pages. Saves 29 bytes due to removing calls to compound_head(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski commit bb2e98b613a3c76c904dfa82eb4b86773817598b Author: Matthew Wilcox (Oracle) Date: Sun Nov 28 16:14:50 2021 -0500 filemap: Remove thp_contains() This function is now unused, so delete it. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski commit f5e6429a51145178a3593ec83865a731fd7d01d3 Author: Matthew Wilcox (Oracle) Date: Thu Dec 17 00:12:26 2020 -0500 filemap: Convert find_get_entry to return a folio Convert callers to cope. Saves 580 bytes of kernel text; all five callers are reduced in size. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski commit 452e9e6992fe058a650c81d01a9982e3faf10278 Author: Matthew Wilcox (Oracle) Date: Sun May 9 09:33:42 2021 -0400 filemap: Add filemap_remove_folio and __filemap_remove_folio Reimplement __delete_from_page_cache() as a wrapper around __filemap_remove_folio() and delete_from_page_cache() as a wrapper around filemap_remove_folio(). Remove the EXPORT_SYMBOL as delete_from_page_cache() was not used by any in-tree modules. Convert page_cache_free_page() into filemap_free_folio(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski commit a0580c6f9babaf4413c8a7e2ab21d68e31f4c754 Author: Matthew Wilcox (Oracle) Date: Fri Jul 23 09:29:46 2021 -0400 filemap: Convert tracing of page cache operations to folio Pass the folio instead of a page. The page was already implicitly a folio as it accessed page->mapping directly. Add the order of the folio to the tracepoint, as this is important information. Also drop printing the address of the struct page as the pfn provides better information than the struct page address. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski commit 621db4880d305bc37b343b1671e03b7eb5d61389 Author: Matthew Wilcox (Oracle) Date: Sat May 8 20:04:05 2021 -0400 filemap: Add filemap_unaccount_folio() Replace unaccount_page_cache_page() with filemap_unaccount_folio(). The bug handling path could be a bit more robust (eg taking into account the mapcounts of tail pages), but it's really never supposed to happen. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski commit a548b615834548c202548ca2acbf7b42a17003d7 Author: Matthew Wilcox (Oracle) Date: Sat May 8 00:35:49 2021 -0400 filemap: Convert page_cache_delete to take a folio It was already assuming a head page, so this is a straightforward conversion. Convert the one caller to call page_folio(), even though it must currently be passing in a head page. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski commit 9f2b04a25a41b1f41b3cead4f56854a4192ec5b0 Author: Matthew Wilcox (Oracle) Date: Mon Aug 16 23:36:31 2021 -0400 filemap: Add folio_put_wait_locked() Convert all three callers of put_and_wait_on_page_locked() to folio_put_wait_locked(). This shrinks the kernel overall by 19 bytes. filemap_update_page() shrinks by 19 bytes while __migration_entry_wait() is unchanged. folio_put_wait_locked() is 14 bytes smaller than put_and_wait_on_page_locked(), but pmd_migration_entry_wait() grows by 14 bytes. It removes the assumption from pmd_migration_entry_wait() that pages cannot be larger than a PMD (which is true today, but may be interesting to explore in the future). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski commit 5bf34d7c7ffe773c3b3c1b6ebf39e0f34a2436ec Author: Matthew Wilcox (Oracle) Date: Sun Nov 28 14:24:43 2021 -0500 mm: Add folio_test_pmd_mappable() Add a predicate to determine if the folio might be mapped by a PMD entry. If CONFIG_TRANSPARENT_HUGEPAGE is disabled, we know it can't be, even if it's large enough. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski commit 821979f5098b05dd1cc83075369304ed65dfef4e Author: Matthew Wilcox (Oracle) Date: Sun Nov 28 19:18:27 2021 -0500 iov_iter: Convert iter_xarray to use folios Take advantage of how kmap_local_folio() works to simplify the loop. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski commit d9c19d32d86fa54934b632c4314beb067bf98378 Author: Matthew Wilcox (Oracle) Date: Mon Oct 18 10:39:06 2021 -0400 iov_iter: Add copy_folio_to_iter() This wrapper around copy_page_to_iter() works because copy_page_to_iter() handles compound pages correctly. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: William Kucharski commit e36649b6483c68f9d4978785083972e72adbdbd2 Author: Joe Thornber Date: Fri Dec 10 13:14:57 2021 +0000 dm btree spine: eliminate duplicate le32_to_cpu() in node_check() Signed-off-by: Joe Thornber Signed-off-by: Mike Snitzer commit 851a8cd3f05bf21a0829f91dcab76d83313cd6ce Author: Joe Thornber Date: Fri Dec 10 13:11:19 2021 +0000 dm btree spine: remove extra node_check function declaration Should have been removed as part of commit f73e2e70ec48 ("dm btree spine: remove paranoid node_check call in node_prep_for_write()") Signed-off-by: Joe Thornber Signed-off-by: Mike Snitzer commit 1c53a1ae36120997a82f936d044c71075852e521 Merge: ad7937dc77452 6c9eeb5f4a9bb Author: Marc Zyngier Date: Tue Jan 4 17:16:15 2022 +0000 Merge branch kvm-arm64/misc-5.17 into kvmarm-master/next * kvm-arm64/misc-5.17: : . : Misc fixes and improvements: : - Add minimal support for ARMv8.7's PMU extension : - Constify kvm_io_gic_ops : - Drop kvm_is_transparent_hugepage() prototype : - Drop unused workaround_flags field : - Rework kvm_pgtable initialisation : - Documentation fixes : - Replace open-coded SCTLR_EL1.EE useage with its defined macro : - Sysreg list selftest update to handle PAuth : - Include cleanups : . KVM: arm64: vgic: Replace kernel.h with the necessary inclusions KVM: arm64: Fix comment typo in kvm_vcpu_finalize_sve() KVM: arm64: selftests: get-reg-list: Add pauth configuration KVM: arm64: Fix comment on barrier in kvm_psci_vcpu_on() KVM: arm64: Fix comment for kvm_reset_vcpu() KVM: arm64: Use defined value for SCTLR_ELx_EE KVM: arm64: Rework kvm_pgtable initialisation KVM: arm64: Drop unused workaround_flags vcpu field Signed-off-by: Marc Zyngier commit 6c9eeb5f4a9bb2b11a40fd0f15efde7bd33ee908 Author: Andy Shevchenko Date: Tue Jan 4 17:19:40 2022 +0200 KVM: arm64: vgic: Replace kernel.h with the necessary inclusions arm_vgic.h does not require all the stuff that kernel.h provides. Replace kernel.h inclusion with the list of what is really being used. Signed-off-by: Andy Shevchenko Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20220104151940.55399-1-andriy.shevchenko@linux.intel.com commit 18343b80691560f41c3339119a2e9314d4672c77 Merge: 416b27439df9e b3c1906ed02ad Author: Jakub Kicinski Date: Tue Jan 4 08:13:02 2022 -0800 Merge tag 'mac80211-next-for-net-next-2022-01-04' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next Johannes Berg says: ==================== Just a few more changes: - mac80211: allow non-standard VHT MCSes 10/11 - mac80211: add sleepable station iterator for drivers - nl80211: clarify a comment - mac80211: small cleanup to use typed element helpers * tag 'mac80211-next-for-net-next-2022-01-04' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next: mac80211: use ieee80211_bss_get_elem() nl80211: clarify comment for mesh PLINK_BLOCKED state mac80211: Add stations iterator where the iterator function may sleep mac80211: allow non-standard VHT MCS-10/11 ==================== Link: https://lore.kernel.org/r/20220104153403.69749-1-johannes@sipsolutions.net Signed-off-by: Jakub Kicinski commit 2deb55d9f57bb7a877c0d77115cc4077e1e974ff Author: Wei Liu Date: Tue Jan 4 16:11:19 2022 +0000 swiotlb: Add CONFIG_HAS_IOMEM check around swiotlb_mem_remap() HAS_IOMEM option may not be selected on some platforms (e.g, s390) and this will cause compilation failure due to missing memremap() implementation. Fix it by stubbing out swiotlb_mem_remap when CONFIG_HAS_IOMEM is not set. Reported-by: kernel test robot Signed-off-by: Tianyu Lan Acked-by: Christoph Hellwig Signed-off-by: Wei Liu commit 57f234248ff925d88caedf4019ec84e6ecb83909 Author: Christian A. Ehrhardt Date: Fri Dec 31 14:44:32 2021 +0100 ALSA: hda/cs8409: Fix Jack detection after resume The suspend code unconditionally sets ->hp_jack_in and ->mic_jack_in to zero but without reporting this status change to the HDA core. To compensate for this, always assume a status change on the first unsol event after boot or resume. Fixes: 424e531b47f8 ("ALSA: hda/cs8409: Ensure Type Detection is only run on startup when necessary") Signed-off-by: Christian A. Ehrhardt Link: https://lore.kernel.org/r/20211231134432.atwmuzeceqiklcoa@cae.in-ulm.de Signed-off-by: Takashi Iwai commit 8cd07657177006b67cc1610e4466cc75ad781c05 Author: Christian A. Ehrhardt Date: Fri Dec 31 14:12:21 2021 +0100 ALSA: hda/cs8409: Increase delay during jack detection Commit c8b4f0865e82 reduced delays related to cs42l42 jack detection. However, the change was too aggressive. As a result internal speakers on DELL Inspirion 3501 are not detected. Increase the delay in cs42l42_run_jack_detect() a bit. Fixes: c8b4f0865e82 ("ALSA: hda/cs8409: Remove unnecessary delays") Signed-off-by: Christian A. Ehrhardt Link: https://lore.kernel.org/r/20211231131221.itwotyfk5qomn7n6@cae.in-ulm.de Signed-off-by: Takashi Iwai commit 09c543798c3cde19aae575a0f76d5fc7c130ff18 Author: Gao Xiang Date: Sun Jan 2 12:00:17 2022 +0800 erofs: use meta buffers for zmap operations Get rid of old erofs_get_meta_page() within zmap operations by using on-stack meta buffers in order to prepare subpage and folio features. Finally, erofs_get_meta_page() is useless. Get rid of it! Link: https://lore.kernel.org/r/20220102040017.51352-6-hsiangkao@linux.alibaba.com Reviewed-by: Yue Hu Reviewed-by: Liu Bo Reviewed-by: Chao Yu Signed-off-by: Gao Xiang commit bb88e8da00253bea0e7f0f4cdfd7910572d7799f Author: Gao Xiang Date: Sun Jan 2 12:00:16 2022 +0800 erofs: use meta buffers for xattr operations Get rid of old erofs_get_meta_page() within xattr operations by using on-stack meta buffers in order to prepare subpage and folio features. Link: https://lore.kernel.org/r/20220102040017.51352-5-hsiangkao@linux.alibaba.com Reviewed-by: Liu Bo Reviewed-by: Chao Yu Signed-off-by: Gao Xiang commit 2b5379f7860d8e95571a4837ac4c07167b4233bd Author: Gao Xiang Date: Sun Jan 2 16:13:17 2022 +0800 erofs: use meta buffers for super operations Get rid of old erofs_get_meta_page() within super operations by using on-stack meta buffers in order to prepare subpage and folio features. Link: https://lore.kernel.org/r/20220102081317.109797-1-hsiangkao@linux.alibaba.com Reviewed-by: Yue Hu Reviewed-by: Liu Bo Reviewed-by: Chao Yu Signed-off-by: Gao Xiang commit c521e3ad6cc980df6f3bdd2616808ecb973af880 Author: Gao Xiang Date: Sun Jan 2 12:00:14 2022 +0800 erofs: use meta buffers for inode operations Get rid of old erofs_get_meta_page() within inode operations by using on-stack meta buffers in order to prepare subpage and folio features. Link: https://lore.kernel.org/r/20220102040017.51352-3-hsiangkao@linux.alibaba.com Reviewed-by: Yue Hu Reviewed-by: Liu Bo Reviewed-by: Chao Yu Signed-off-by: Gao Xiang commit fdf80a4793021c2f27953b3075f401a497519ba4 Author: Gao Xiang Date: Sun Jan 2 12:00:13 2022 +0800 erofs: introduce meta buffer operations In order to support subpage and folio for all uncompressed files, introduce meta buffer descriptors, which can be effectively stored on stack, in place of meta page operations. This converts the uncompressed data path to meta buffers. Link: https://lore.kernel.org/r/20220102040017.51352-2-hsiangkao@linux.alibaba.com Reviewed-by: Liu Bo Reviewed-by: Chao Yu Signed-off-by: Gao Xiang commit feae43f8aa88309224b27bbe3a59fcb9aefab6f5 Author: Alexander Aring Date: Tue Jan 4 09:09:47 2022 -0500 fs: dlm: print cluster addr if non-cluster node connects This patch prints the cluster node address if a non-cluster node (according to the dlm config setting) tries to connect. The current hexdump call will print in a different loglevel and only available if dynamic debug is enabled. Additional we using the ip address format strings to print an IETF ip4/6 string represenation. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 4ecc933b7d1f4793c51f6f716501b73aaa6ca5d0 Author: Srinivas Pandruvada Date: Sat Dec 11 08:33:27 2021 -0800 x86: intel_epb: Allow model specific normal EPB value The current EPB "normal" is defined as 6 and set whenever power-up EPB value is 0. This setting resulted in the desired out of box power and performance for several CPU generations. But this value is not suitable for AlderLake mobile CPUs, as this resulted in higher uncore power. Since EPB is model specific, this is not unreasonable to have different behavior. Allow a capability where "normal" EPB can be redefined. For AlderLake mobile CPUs this desired normal value is 7. Signed-off-by: Srinivas Pandruvada Signed-off-by: Rafael J. Wysocki commit 840a720aaa14dbc6c79782210d759fe9cf181838 Author: Rikard Falkeborn Date: Sat Dec 4 23:03:16 2021 +0100 PCI: qcom-ep: Constify static dw_pcie_ep_ops The only usage of pci_ep_ops is to assign its address to the ops field in the dw_pcie_ep struct which is a pointer to const struct dw_pcie_ep_ops. Make it const to allow the compiler to put it in read-only memory. Link: https://lore.kernel.org/r/20211204220316.88655-1-rikard.falkeborn@gmail.com Signed-off-by: Rikard Falkeborn Signed-off-by: Lorenzo Pieralisi Reviewed-by: Krzysztof Wilczyński commit 04b12ef163d10e348db664900ae7f611b83c7a0e Author: Kai-Heng Feng Date: Fri Dec 3 11:15:41 2021 +0800 PCI: vmd: Honor ACPI _OSC on PCIe features When Samsung PCIe Gen4 NVMe is connected to Intel ADL VMD, the combination causes AER message flood and drags the system performance down. The issue doesn't happen when VMD mode is disabled in BIOS, since AER isn't enabled by acpi_pci_root_create() . When VMD mode is enabled, AER is enabled regardless of _OSC: [ 0.410076] acpi PNP0A08:00: _OSC: platform does not support [AER] ... [ 1.486704] pcieport 10000:e0:06.0: AER: enabled with IRQ 146 Since VMD is an aperture to regular PCIe root ports, honor ACPI _OSC to disable PCIe features accordingly to resolve the issue. Suggested-by: Rafael J. Wysocki Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=215027 Link: https://lore.kernel.org/r/20211203031541.1428904-1-kai.heng.feng@canonical.com Signed-off-by: Kai-Heng Feng Signed-off-by: Lorenzo Pieralisi Reviewed-by: Rafael J. Wysocki commit 1f156b4285865dc2eb66e7a78c7ba80c17bb2b0a Author: Minghao Chi Date: Tue Jan 4 10:41:39 2022 +0000 regulator: remove redundant ret variable Return value from regmap_update_bits() directly instead of taking this in another redundant variable. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: CGEL ZTE Link: https://lore.kernel.org/r/20220104104139.601031-1-chi.minghao@zte.com.cn Signed-off-by: Mark Brown commit 4ab34548c55fbbb3898306a47dfaccd4860e1ccb Author: Pali Rohár Date: Thu Nov 25 13:46:05 2021 +0100 PCI: mvebu: Fix support for DEVCAP2, DEVCTL2 and LNKCTL2 registers on emulated bridge Armada XP and new hardware supports access to DEVCAP2, DEVCTL2 and LNKCTL2 configuration registers of PCIe core via PCIE_CAP_PCIEXP. So export them via emulated software root bridge. Pre-XP hardware does not support these registers and returns zeros. Link: https://lore.kernel.org/r/20211125124605.25915-16-pali@kernel.org Fixes: 1f08673eef12 ("PCI: mvebu: Convert to PCI emulated bridge config space") Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi commit 838ff44a398ff47fe9b924961d91aee325821220 Author: Pali Rohár Date: Thu Nov 25 13:46:04 2021 +0100 PCI: mvebu: Fix support for PCI_EXP_RTSTA on emulated bridge PME Status bit in Root Status Register (PCIE_RC_RTSTA_OFF) is read-only and can be cleared only by writing 0b to the Interrupt Cause RW0C register (PCIE_INT_CAUSE_OFF). Link: https://lore.kernel.org/r/20211125124605.25915-15-pali@kernel.org Fixes: 1f08673eef12 ("PCI: mvebu: Convert to PCI emulated bridge config space") Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi commit ebe33e5a98dcf14a9630845f3f10c193584ac054 Author: Oskari Lemmela Date: Wed Dec 22 07:59:57 2021 +0200 spi: ar934x: fix transfer size If bits_per_word is configured, transfer only word amount of data per iteration. Signed-off-by: Oskari Lemmela Link: https://lore.kernel.org/r/20211222055958.1383233-2-oskari@lemmela.net Signed-off-by: Mark Brown commit 9f3d45318dd9e739ed62e4218839a7a824d3cced Author: Alyssa Ross Date: Tue Jan 4 13:22:16 2022 +0000 ASoC: fsl_mqs: fix MODULE_ALIAS modprobe can't handle spaces in aliases. Fixes: 9e28f6532c61 ("ASoC: fsl_mqs: Add MQS component driver") Signed-off-by: Alyssa Ross Link: https://lore.kernel.org/r/20220104132218.1690103-1-hi@alyssa.is Signed-off-by: Mark Brown commit ecae073e393e65ee7be7ebf3fdd5258ab99f1636 Author: Pali Rohár Date: Thu Nov 25 13:46:03 2021 +0100 PCI: mvebu: Fix support for PCI_EXP_DEVCTL on emulated bridge Comment in Armada 370 functional specification is misleading. PCI_EXP_DEVCTL_*RE bits are supported and configures receiving of error interrupts. Link: https://lore.kernel.org/r/20211125124605.25915-14-pali@kernel.org Fixes: 1f08673eef12 ("PCI: mvebu: Convert to PCI emulated bridge config space") Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi commit d75404cc08832206f173668bd35391c581fea121 Author: Pali Rohár Date: Thu Nov 25 13:46:02 2021 +0100 PCI: mvebu: Fix support for PCI_BRIDGE_CTL_BUS_RESET on emulated bridge Hardware supports PCIe Hot Reset via PCIE_CTRL_OFF register. Use it for implementing PCI_BRIDGE_CTL_BUS_RESET bit of PCI_BRIDGE_CONTROL register on emulated bridge. With this change the function pci_reset_secondary_bus() starts working and can reset connected PCIe card. Link: https://lore.kernel.org/r/20211125124605.25915-13-pali@kernel.org Fixes: 1f08673eef12 ("PCI: mvebu: Convert to PCI emulated bridge config space") Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi commit 91a8d79fc797d3486ae978beebdfc55261c7d65b Author: Pali Rohár Date: Thu Nov 25 13:46:01 2021 +0100 PCI: mvebu: Fix configuring secondary bus of PCIe Root Port via emulated bridge It looks like that mvebu PCIe controller has for each PCIe link fully independent PCIe host bridge and so every PCIe Root Port is isolated not only on its own bus but also isolated from each others. But in past device tree structure was defined to put all PCIe Root Ports (as PCI Bridge devices) into one root bus 0 and this bus is emulated by pci-mvebu.c driver. Probably reason for this decision was incorrect understanding of PCIe topology of these Armada SoCs and also reason of misunderstanding how is PCIe controller generating Type 0 and Type 1 config requests (it is fully different compared to other drivers). Probably incorrect setup leaded to very surprised things like having PCIe Root Port (PCI Bridge device, with even incorrect Device Class set to Memory Controller) and the PCIe device behind the Root Port on the same PCI bus, which obviously was needed to somehow hack (as these two devices cannot be in reality on the same bus). Properly set mvebu local bus number and mvebu local device number based on PCI Bridge secondary bus number configuration. Also correctly report configured secondary bus number in config space. And explain in driver comment why this setup is correct. Link: https://lore.kernel.org/r/20211125124605.25915-12-pali@kernel.org Fixes: 1f08673eef12 ("PCI: mvebu: Convert to PCI emulated bridge config space") Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi commit f587775828219d4e2d7a796c7fff97e50c7f76f1 Author: Pali Rohár Date: Thu Nov 25 13:46:00 2021 +0100 PCI: mvebu: Set PCI Bridge Class Code to PCI Bridge The default value of Class Code of this bridge corresponds to a Memory controller, though. This is probably relict from the past when old Marvell/Galileo PCI-based controllers were used as standalone PCI device for connecting SDRAM or workaround for PCs with broken BIOS. Details are in commit 36de23a4c5f0 ("MIPS: Cobalt: Explain GT64111 early PCI fixup"). Change the Class Code to correspond to a PCI Bridge. Add comment explaining this change. Link: https://lore.kernel.org/r/20211125124605.25915-11-pali@kernel.org Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi commit df08ac016124bd88b8598ac0599d7b89c0642774 Author: Pali Rohár Date: Thu Nov 25 13:45:59 2021 +0100 PCI: mvebu: Setup PCIe controller to Root Complex mode This driver operates only in Root Complex mode, so ensure that hardware is properly configured in Root Complex mode. Link: https://lore.kernel.org/r/20211125124605.25915-10-pali@kernel.org Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi commit e7a01876729c3e650c5f6ee446b71a309d1c55ab Author: Pali Rohár Date: Thu Nov 25 13:45:58 2021 +0100 PCI: mvebu: Propagate errors when updating PCI_IO_BASE and PCI_MEM_BASE registers Properly propagate failure from mvebu_pcie_add_windows() function back to the caller mvebu_pci_bridge_emul_base_conf_write() and correctly updates PCI_IO_BASE, PCI_MEM_BASE and PCI_IO_BASE_UPPER16 registers on error. On error set base value higher than limit value which indicates that address range is disabled. When IO is unsupported then let IO registers zeroed as required by PCIe base specification. Link: https://lore.kernel.org/r/20211125124605.25915-9-pali@kernel.org Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi commit 2cf150216e5b5619d7c25180ccf2cc8ac7bebc13 Author: Pali Rohár Date: Thu Nov 25 13:45:57 2021 +0100 PCI: mvebu: Do not modify PCI IO type bits in conf_write PCI IO type bits are already initialized in mvebu_pci_bridge_emul_init() function and only when IO support is enabled. These type bits are read-only and pci-bridge-emul.c code already does not allow to modify them from upper layers. When IO support is disabled then all IO registers should be read-only and return zeros. Therefore do not modify PCI IO type bits in mvebu_pci_bridge_emul_base_conf_write() callback. Link: https://lore.kernel.org/r/20211125124605.25915-8-pali@kernel.org Fixes: 1f08673eef12 ("PCI: mvebu: Convert to PCI emulated bridge config space") Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi commit e42b85583719adb87ab88dc7bcd41b38011f7d11 Author: Pali Rohár Date: Thu Nov 25 13:45:56 2021 +0100 PCI: mvebu: Fix support for bus mastering and PCI_COMMAND on emulated bridge According to PCI specifications bits [0:2] of Command Register, this should be by default disabled on reset. So explicitly disable these bits at early beginning of driver initialization. Also remove code which unconditionally enables all 3 bits and let kernel code (via pci_set_master() function) to handle bus mastering of PCI Bridge via emulated PCI_COMMAND on emulated bridge. Adjust existing functions mvebu_pcie_handle_iobase_change() and mvebu_pcie_handle_membase_change() to handle PCI_IO_BASE and PCI_MEM_BASE registers correctly even when bus mastering on emulated bridge is disabled. Link: https://lore.kernel.org/r/20211125124605.25915-7-pali@kernel.org Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi commit 319e6046bd5a59e09c1a08fd6f6929df4ae9a1dc Author: Pali Rohár Date: Thu Nov 25 13:45:55 2021 +0100 PCI: mvebu: Disallow mapping interrupts on emulated bridges Interrupt support on mvebu emulated bridges is not implemented yet. So properly indicate return value to callers that they cannot request interrupts from emulated bridge. Link: https://lore.kernel.org/r/20211125124605.25915-6-pali@kernel.org Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi commit 11c2bf4a20c256eea258a4332244c0deb9af0da8 Author: Pali Rohár Date: Thu Nov 25 13:45:54 2021 +0100 PCI: mvebu: Handle invalid size of read config request Function mvebu_pcie_hw_rd_conf() does not handle invalid size. So correctly set read value to all-ones and return appropriate error return value PCIBIOS_BAD_REGISTER_NUMBER like in mvebu_pcie_hw_wr_conf() function. Link: https://lore.kernel.org/r/20211125124605.25915-5-pali@kernel.org Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi commit 489bfc51870b96cd3ad2ef63cf443b5f5d1a8e21 Author: Pali Rohár Date: Thu Nov 25 13:45:53 2021 +0100 PCI: mvebu: Check that PCI bridge specified in DT has function number zero Driver cannot handle PCI bridges at non-zero function address. So add appropriate check. Currently all in-tree kernel DTS files set PCI bridge function to zero. Link: https://lore.kernel.org/r/20211125124605.25915-4-pali@kernel.org Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi commit 5d18d702e5c9309f4195653475c7a7fdde4ca71f Author: Pali Rohár Date: Thu Nov 25 13:45:52 2021 +0100 PCI: mvebu: Check for errors from pci_bridge_emul_init() call Function pci_bridge_emul_init() may fail so correctly check for errors. Link: https://lore.kernel.org/r/20211125124605.25915-3-pali@kernel.org Fixes: 1f08673eef12 ("PCI: mvebu: Convert to PCI emulated bridge config space") Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi commit 8cdabfdd5a22ded53ab18f50df48e04dba744ad4 Author: Pali Rohár Date: Thu Nov 25 13:45:51 2021 +0100 PCI: mvebu: Check for valid ports Some mvebu ports do not have to be initialized. So skip these uninitialized mvebu ports in every port iteration function to prevent access to unmapped memory or dereferencing NULL pointers. Uninitialized mvebu port has base address set to NULL. Link: https://lore.kernel.org/r/20211125124605.25915-2-pali@kernel.org Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi commit 3da4390bcdf4dcea5eb7961f1ba05f75c642a39d Author: Will Deacon Date: Tue Jan 4 14:57:14 2022 +0000 arm64: perf: Don't register user access sysctl handler multiple times Commit e2012600810c ("arm64: perf: Add userspace counter access disable switch") introduced a new 'perf_user_access' sysctl file to enable and disable direct userspace access to the PMU counters. Sadly, Geert reports that on his big.LITTLE SoC ('Renesas Salvator-XS w/ R-Car H3'), the file is created for each PMU type probed, resulting in a splat during boot: | hw perfevents: enabled with armv8_cortex_a53 PMU driver, 7 counters available | sysctl duplicate entry: /kernel//perf_user_access | CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.16.0-rc3-arm64-renesas-00003-ge2012600810c #1420 | Hardware name: Renesas Salvator-X 2nd version board based on r8a77951 (DT) | Call trace: | dump_backtrace+0x0/0x190 | show_stack+0x14/0x20 | dump_stack_lvl+0x88/0xb0 | dump_stack+0x14/0x2c | __register_sysctl_table+0x384/0x818 | register_sysctl+0x20/0x28 | armv8_pmu_init.constprop.0+0x118/0x150 | armv8_a57_pmu_init+0x1c/0x28 | arm_pmu_device_probe+0x1b4/0x558 | armv8_pmu_device_probe+0x18/0x20 | platform_probe+0x64/0xd0 | hw perfevents: enabled with armv8_cortex_a57 PMU driver, 7 counters available Introduce a state variable to track creation of the sysctl file and ensure that it is only created once. Reported-by: Geert Uytterhoeven Fixes: e2012600810c ("arm64: perf: Add userspace counter access disable switch") Link: https://lore.kernel.org/r/CAMuHMdVcDxR9sGzc5pcnORiotonERBgc6dsXZXMd6wTvLGA9iw@mail.gmail.com Signed-off-by: Will Deacon commit b3c1906ed02ad2b9f4db2f652cb7ea7b333963e5 Author: Johannes Berg Date: Mon Dec 20 11:36:10 2021 +0100 mac80211: use ieee80211_bss_get_elem() Instead of ieee80211_bss_get_ie(), use the more typed ieee80211_bss_get_elem(). Link: https://lore.kernel.org/r/20211220113609.56f8e2a70152.Id5a56afb8a4f9b38d10445e5a1874e93e84b5251@changeid Signed-off-by: Johannes Berg commit 5bc03b28ec24670e67c453ecb2bfbb9053b86838 Author: Felix Fietkau Date: Mon Dec 20 11:51:47 2021 +0100 nl80211: clarify comment for mesh PLINK_BLOCKED state When a mesh link is in blocked state, it is very useful to still allow auth requests from the peer to re-establish it. When a remote node is power cycled, the peer state can easily end up in blocked state if multiple auth attempts are performed. Since this can lead to several minutes of downtime, we should accept auth attempts of the peer after it has come back. Signed-off-by: Felix Fietkau Link: https://lore.kernel.org/r/20211220105147.88625-1-nbd@nbd.name Signed-off-by: Johannes Berg commit acb99b9b2a08f439a13eafffd2a59b798d983462 Author: Martin Blumenstingl Date: Tue Dec 28 22:14:53 2021 +0100 mac80211: Add stations iterator where the iterator function may sleep ieee80211_iterate_active_interfaces() and ieee80211_iterate_active_interfaces_atomic() already exist, where the former allows the iterator function to sleep. Add ieee80211_iterate_stations() which is similar to ieee80211_iterate_stations_atomic() but allows the iterator to sleep. This is needed for adding SDIO support to the rtw88 driver. Some interators there are reading or writing registers. With the SDIO ops (sdio_readb, sdio_writeb and friends) this means that the iterator function may sleep. Signed-off-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20211228211501.468981-2-martin.blumenstingl@googlemail.com Signed-off-by: Johannes Berg commit 04be6d337d37400ad5b3d5f27ca87645ee5a18a3 Author: Ping-Ke Shih Date: Mon Jan 3 09:36:21 2022 +0800 mac80211: allow non-standard VHT MCS-10/11 Some AP can possibly try non-standard VHT rate and mac80211 warns and drops packets, and leads low TCP throughput. Rate marked as a VHT rate but data is invalid: MCS: 10, NSS: 2 WARNING: CPU: 1 PID: 7817 at net/mac80211/rx.c:4856 ieee80211_rx_list+0x223/0x2f0 [mac8021 Since commit c27aa56a72b8 ("cfg80211: add VHT rate entries for MCS-10 and MCS-11") has added, mac80211 adds this support as well. After this patch, throughput is good and iw can get the bitrate: rx bitrate: 975.1 MBit/s VHT-MCS 10 80MHz short GI VHT-NSS 2 or rx bitrate: 1083.3 MBit/s VHT-MCS 11 80MHz short GI VHT-NSS 2 Buglink: https://bugzilla.suse.com/show_bug.cgi?id=1192891 Reported-by: Goldwyn Rodrigues Signed-off-by: Ping-Ke Shih Link: https://lore.kernel.org/r/20220103013623.17052-1-pkshih@realtek.com Signed-off-by: Johannes Berg commit 1b15b69800e2f9320b3d1fc0611c177c70c24424 Author: Hans de Goede Date: Thu Dec 30 20:31:20 2021 +0100 ACPI / x86: Skip AC and battery devices on x86 Android tablets with broken DSDTs So far all of the tablets for which the skip i2c-client/serdev enumeration quirks have been added also all have broken ACPI AC / battery devices extend the existing quirks for these tablets to also skip the broken AC / battery devices. Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit 57a18322227134e37b693ef8ef216ed7ce7ba7d6 Author: Hans de Goede Date: Thu Dec 30 20:31:19 2021 +0100 ACPI / x86: Introduce an acpi_quirk_skip_acpi_ac_and_battery() helper Some x86 ACPI boards have broken AC and battery ACPI devices in their ACPI tables. This is often tied to these devices using certain PMICs where the factory OS image seems to be using native charger and fuel-gauge drivers instead. So far both the AC and battery drivers have almost identical checks for these PMICs including both of them having a DMI based mechanism to force usage of the ACPI AC and battery drivers on some boards even though one of these PMICs is present, with the same 2 boards listed in both driver's DMI tables for this. The only difference is that the AC driver checks for 2 PMICs and the battery driver only for one. This has grown this way because the other (Whiskey Cove) PMIC is only used on a few boards (3 known boards) and although some of these do have non working ACPI battery devices, their _STA method always returns 0, but that really should not be relied on. This patch factors out the shared checks into a new acpi_quirk_skip_acpi_ac_and_battery() helper and moves the AC and battery drivers over to this new helper. Note the DMI table is shared with acpi_quirk_skip_i2c_client_enumeration() and acpi_quirk_skip_serdev_enumeration(), because boards needing DMI quirks for either of these typically also have broken AC and battery ACPI devices. The ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY quirk is not set yet on boards already in this DMI table, to avoid introducing any functional changes in this refactoring patch. Besided sharing the code between the AC and battery drivers this refactoring also moves this quirk handling to under #ifdef CONFIG_X86, removing this x86 specific code from non x86 ACPI builds. Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit 8e0feb25172b51978b9240aea1f0628c5b45b5b1 Merge: 9f6875660c412 0890186a96586 Author: Rafael J. Wysocki Date: Tue Jan 4 15:37:09 2022 +0100 Merge branch 'acpi-scan' into acpi-x86 Merge recent device enumeration changes to satisfy dependencies. commit ad7937dc774527abd324a7e56d18bad136f3c364 Merge: 089606c0de9e4 728fcc46d2c22 Author: Marc Zyngier Date: Tue Jan 4 14:03:43 2022 +0000 Merge branch kvm-arm64/selftest/irq-injection into kvmarm-master/next * kvm-arm64/selftest/irq-injection: : . : New tests from Ricardo Koller: : "This series adds a new test, aarch64/vgic-irq, that validates the injection of : different types of IRQs from userspace using various methods and configurations" : . KVM: selftests: aarch64: Add test for restoring active IRQs KVM: selftests: aarch64: Add ISPENDR write tests in vgic_irq KVM: selftests: aarch64: Add tests for IRQFD in vgic_irq KVM: selftests: Add IRQ GSI routing library functions KVM: selftests: aarch64: Add test_inject_fail to vgic_irq KVM: selftests: aarch64: Add tests for LEVEL_INFO in vgic_irq KVM: selftests: aarch64: Level-sensitive interrupts tests in vgic_irq KVM: selftests: aarch64: Add preemption tests in vgic_irq KVM: selftests: aarch64: Cmdline arg to set EOI mode in vgic_irq KVM: selftests: aarch64: Cmdline arg to set number of IRQs in vgic_irq test KVM: selftests: aarch64: Abstract the injection functions in vgic_irq KVM: selftests: aarch64: Add vgic_irq to test userspace IRQ injection KVM: selftests: aarch64: Add vGIC library functions to deal with vIRQ state KVM: selftests: Add kvm_irq_line library function KVM: selftests: aarch64: Add GICv3 register accessor library functions KVM: selftests: aarch64: Add function for accessing GICv3 dist and redist registers KVM: selftests: aarch64: Move gic_v3.h to shared headers Signed-off-by: Marc Zyngier commit 089606c0de9e4857aa2d7b0161c3919cbcbadabc Merge: 43d8ac22125e3 aa674de1dc3d2 Author: Marc Zyngier Date: Tue Jan 4 14:03:26 2022 +0000 Merge branch kvm-arm64/selftest/ipa into kvmarm-master/next * kvm-arm64/selftest/ipa: : . : Expand the KVM/arm64 selftest infrastructure to discover : supported page sizes at runtime, support 16kB pages, and : find out about the original M1 stupidly small IPA space. : . KVM: selftests: arm64: Add support for various modes with 16kB page size KVM: selftests: arm64: Add support for VM_MODE_P36V48_{4K,64K} KVM: selftests: arm64: Rework TCR_EL1 configuration KVM: selftests: arm64: Check for supported page sizes KVM: selftests: arm64: Introduce a variable default IPA size KVM: selftests: arm64: Initialise default guest mode at test startup time Signed-off-by: Marc Zyngier commit 2da56881a7f8fdd887e6c2d250db58f1abdad0b6 Author: Dan Carpenter Date: Fri Dec 17 17:59:08 2021 +0300 drivers: perf: marvell_cn10k: fix an IS_ERR() vs NULL check The devm_ioremap() function does not return error pointers. It returns NULL. Fixes: 036a7584bede ("drivers: perf: Add LLC-TAD perf counter support") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20211217145907.GA16611@kili Signed-off-by: Will Deacon commit e938eddbeb85f4c0c47e56cd9e09ee196ea1bc1a Author: Zenghui Yu Date: Thu Dec 30 22:15:35 2021 +0800 KVM: arm64: Fix comment typo in kvm_vcpu_finalize_sve() kvm_arm_init_arch_resources() was renamed to kvm_arm_init_sve() in commit a3be836df7cb ("KVM: arm/arm64: Demote kvm_arm_init_arch_resources() to just set up SVE"). Fix the function name in comment of kvm_vcpu_finalize_sve(). Signed-off-by: Zenghui Yu Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211230141535.1389-1-yuzenghui@huawei.com commit f15dcf1b5853e770ed614e23ab2e90f0ca1b7b0b Author: Marc Zyngier Date: Tue Dec 28 12:14:14 2021 +0000 KVM: arm64: selftests: get-reg-list: Add pauth configuration The get-reg-list test ignores the Pointer Authentication features, which is a shame now that we have relatively common HW with this feature. Define two new configurations (with and without PMU) that exercise the KVM capabilities. Signed-off-by: Marc Zyngier Reviewed-by: Andrew Jones Link: https://lore.kernel.org/r/20211228121414.1013250-1-maz@kernel.org commit 527a7f52529fd661d200e6c4412b6d2528d1a6e8 Author: Will Deacon Date: Tue Jan 4 13:34:12 2022 +0000 perf/smmuv3: Fix unused variable warning when CONFIG_OF=n The kbuild robot reports that building the SMMUv3 PMU driver with CONFIG_OF=n results in a warning for W=1 builds: >> drivers/perf/arm_smmuv3_pmu.c:889:34: warning: unused variable 'smmu_pmu_of_match' [-Wunused-const-variable] static const struct of_device_id smmu_pmu_of_match[] = { ^ Guard the match table with #ifdef CONFIG_OF. Link: https://lore.kernel.org/r/202201041700.01KZEzhb-lkp@intel.com Fixes: 3f7be4356176 ("perf/smmuv3: Add devicetree support") Reported-by: kernel test robot Signed-off-by: Will Deacon commit f083266487690124481eac0869da850406fb3ed3 Author: Ingo Molnar Date: Sun Aug 29 09:18:53 2021 +0200 headers/uninline: Uninline single-use function: kobject_has_children() This was the only usage of in , so we'll able to decouple the two after this change. Signed-off-by: Ingo Molnar Signed-off-by: Greg Kroah-Hartman commit 50a0f3f55e382b313e7cbebdf8ccf1593296e16f Author: Yang Yingliang Date: Sat Dec 25 10:51:15 2021 +0800 livepatch: Fix missing unlock on error in klp_enable_patch() Add missing unlock when try_module_get() fails in klp_enable_patch(). Fixes: 5ef3dd20555e8e8 ("livepatch: Fix kobject refcount bug on klp_init_patch_early failure path") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Acked-by: David Vernet Reviewed-by: Petr Mladek Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20211225025115.475348-1-yangyingliang@huawei.com commit 5ef3dd20555e8e878ac390a71e658db5fd02845c Author: David Vernet Date: Tue Dec 21 07:39:31 2021 -0800 livepatch: Fix kobject refcount bug on klp_init_patch_early failure path When enabling a klp patch with klp_enable_patch(), klp_init_patch_early() is invoked to initialize the kobjects for the patch itself, as well as the 'struct klp_object' and 'struct klp_func' objects that comprise it. However, there are some error paths in klp_enable_patch() where some kobjects may have been initialized with kobject_init(), but an error code is still returned due to e.g. a 'struct klp_object' having a NULL funcs pointer. In these paths, the initial reference of the kobject of the 'struct klp_patch' may never be released, along with one or more of its objects and their functions, as kobject_put() is not invoked on the cleanup path if klp_init_patch_early() returns an error code. For example, if an object entry such as the following were added to the sample livepatch module's klp patch, it would cause the vmlinux klp_object, and its klp_func which updates 'cmdline_proc_show', to never be released: static struct klp_object objs[] = { { /* name being NULL means vmlinux */ .funcs = funcs, }, { /* NULL funcs -- would cause reference leak */ .name = "kvm", }, { } }; Without this change, if CONFIG_DEBUG_KOBJECT is enabled, and the sample klp patch is loaded, the kobjects (the patch, the vmlinux 'struct klp_object', and its func) are observed as initialized, but never released, in the dmesg log output. With the change, these kobject references no longer fail to be released as the error case is properly handled before they are initialized. Signed-off-by: David Vernet Reviewed-by: Petr Mladek Acked-by: Miroslav Benes Acked-by: Josh Poimboeuf Signed-off-by: Petr Mladek commit 416b27439df9ecb36b03da63dc37a8840b6f2efe Author: Minghao Chi Date: Tue Jan 4 11:35:43 2022 +0000 ethernet/sfc: remove redundant rc variable Return value from efx_mcdi_rpc() directly instead of taking this in another redundant variable. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: CGEL ZTE Signed-off-by: David S. Miller commit a0619a9e9e3f557a16dd9c60a76ddd4519e225e9 Merge: 7d714ff14d642 1135fad204805 Author: David S. Miller Date: Tue Jan 4 12:40:22 2022 +0000 Merge branch 'namespacify-mtu-ipv4' xu xin says: ==================== ipv4: Namespaceify two sysctls related with mtu The following patch series enables the min_pmtu and mtu_expires to be visible and configurable per net namespace. Different namespace application might have different requirements on the setting of min_pmtu and mtu_expires. If these two patches are applied, inside a net namespace we create, we can see two more sysctls under /proc/sys/net/ipv4/route: 1. min_pmtu 2. mtu_expires where min_pmtu and mtu_expires are configurable. ==================== Signed-off-by: David S. Miller commit 1135fad204805518462c1f0caaca6bcd52ba78cf Author: xu xin Date: Tue Jan 4 10:59:47 2022 +0000 Namespaceify mtu_expires sysctl This patch enables the sysctl mtu_expires to be configured per net namespace. Signed-off-by: xu xin Signed-off-by: David S. Miller commit 1de6b15a434c0068253fea5d719f71143e7e3a79 Author: xu xin Date: Tue Jan 4 10:59:34 2022 +0000 Namespaceify min_pmtu sysctl This patch enables the sysctl min_pmtu to be configured per net namespace. Signed-off-by: xu xin Signed-off-by: David S. Miller commit 7d714ff14d6427d6d4898e47d439d9e530616aac Author: Jakub Kicinski Date: Mon Jan 3 19:48:27 2022 -0800 net: fixup build after bpf header changes Recent bpf-next merge brought in header changes which uncovered includes missing in net-next which were not present in bpf-next. Build problems happen only on less-popular arches like hppa, sparc, alpha etc. I could repro the build problem with ice but not the mlx5 problem Abdul was reporting. mlx5 does look like it should include filter.h, anyway. Reported-by: Abdul Haleem Fixes: e63a02348958 ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next") Link: https://lore.kernel.org/all/7c03768d-d948-c935-a7ab-b1f963ac7eed@linux.vnet.ibm.com/ Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit c3e6b2c35b34214c58c1e90d65dab5f5393608e7 Author: Aleksander Jan Bajkowski Date: Mon Jan 3 20:43:16 2022 +0100 net: lantiq_xrx200: add ingress SG DMA support This patch adds support for scatter gather DMA. DMA in PMAC splits the packet into several buffers when the MTU on the CPU port is less than the MTU of the switch. The first buffer starts at an offset of NET_IP_ALIGN. In subsequent buffers, dma ignores the offset. Thanks to this patch, the user can still connect to the device in such a situation. For normal configurations, the patch has no effect on performance. Signed-off-by: Aleksander Jan Bajkowski Signed-off-by: David S. Miller commit 7a71c8aa0a75c8bb53de50042ff86ba047969c69 Author: Radu Pirea (NXP OSS) Date: Mon Jan 3 18:01:25 2022 +0200 phy: nxp-c45-tja11xx: add extts and perout support Add support for external timestamp and periodic signal output. TJA1103 have one periodic signal and one external time stamp signal that can be multiplexed on all 11 gpio pins. The periodic signal can be only enabled or disabled. Have no start time and if is enabled will be generated with a period of one second in sync with the LTC seconds counter. The phase change is possible only with a half of a second. The external timestamp signal has no interrupt and no valid bit and that's why the timestamps are handled by polling in .do_aux_work. Signed-off-by: Radu Pirea (NXP OSS) Acked-by: Richard Cochran Signed-off-by: David S. Miller commit dfb55f9984f53eb2fd2b6df64196e6eb0edf0b65 Merge: 9d2c27aad0ea2 c9c079b4deaae Author: David S. Miller Date: Tue Jan 4 12:12:56 2022 +0000 Merge branch 'act_tc-offload-originating-device' Paul Blakey says: ==================== net/sched: Pass originating device to drivers offloading ct connection Currently, drivers register to a ct zone that can be shared by multiple devices. This can be inefficient for the driver to offload, as it needs to handle all the cases where the tuple can come from, instead of where it's most likely will arive from. For example, consider the following tc rules: tc filter add dev dev1 ... flower action ct commit zone 5 \ action mirred egress redirect dev dev2 tc filter add dev dev2 ... flower action ct zone 5 \ action goto chain chain 2 tc filter add dev dev2 ... flower ct_state +trk+est ... \ action mirred egress redirect dev dev1 Both dev2 and dev1 register to the zone 5 flow table (created by act_ct). A tuple originating on dev1, going to dev2, will be offloaded to both devices, and both will need to offload both directions, resulting in 4 total rules. The traffic will only hit originiating tuple on dev1, and reply tuple on dev2. By passing the originating device that created the connection with the tuple, dev1 can choose to offload only the originating tuple, and dev2 only the reply tuple. Resulting in a more efficient offload. The first patch adds an act_ct nf conntrack extension, to temporarily store the originiating device from the skb before offloading the connection once the connection is established. Once sent to offload, it fills the tuple originating device. The second patch get this information from tuples which pass in openvswitch. The third patch is Mellanox driver ct offload implementation using this information to provide a hint to firmware of where this offloaded tuple packets will arrive from (LOCAL or UPLINK port), and thus increase insertion rate. ==================== Signed-off-by: David S. Miller commit c9c079b4deaae3e9e29286829aff1c2b55169fc5 Author: Paul Blakey Date: Mon Jan 3 13:44:52 2022 +0200 net/mlx5: CT: Set flow source hint from provided tuple device Get originating device from tuple offload metadata match ingress_ifindex, and set flow_source hint to either LOCAL for vf/sf reps, UPLINK for uplink/wire/tunnel devices/bond, or ANY (as before this patch) for all others. This allows lower layer (software steering or firmware) to insert the tuple rule only in one table (either rx or tx) instead of two (rx and tx). Signed-off-by: Paul Blakey Signed-off-by: David S. Miller commit b702436a51dfdf1e2960fb8e228009e09eedb462 Author: Paul Blakey Date: Mon Jan 3 13:44:51 2022 +0200 net: openvswitch: Fill act ct extension To give drivers the originating device information for optimized connection tracking offload, fill in act ct extension with ifindex from skb. Signed-off-by: Paul Blakey Signed-off-by: David S. Miller commit 9795ded7f924b6486e54976619b1b094fcc1969d Author: Paul Blakey Date: Mon Jan 3 13:44:50 2022 +0200 net/sched: act_ct: Fill offloading tuple iifidx Driver offloading ct tuples can use the information of which devices received the packets that created the offloaded connections, to more efficiently offload them only to the relevant device. Add new act_ct nf conntrack extension, which is used to store the skb devices before offloading the connection, and then fill in the tuple iifindex so drivers can get the device via metadata dissector match. Signed-off-by: Oz Shlomo Signed-off-by: Paul Blakey Signed-off-by: David S. Miller commit 08035a67f35a8765cac39bb12e56c61ee880227a Author: Guo Ren Date: Tue Dec 28 14:47:25 2021 +0800 powerpc/sched: Remove unused TASK_SIZE_OF This macro isn't used in Linux sched, now. Delete in include/linux/sched.h and arch's include/asm. Signed-off-by: Guo Ren Signed-off-by: Guo Ren Reviewed-by: Arnd Bergmann Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211228064730.2882351-5-guoren@kernel.org commit fc914faad67f237528739ec717222a560c97e723 Author: Hannes Reinecke Date: Tue Dec 21 08:20:30 2021 +0100 ata: libata: add qc_prep tracepoint Convert the existing ata_qc_issue() tracepoint into a template, and add tracepoints for ata_qc_prep() and ata_qc_issue() based on that template. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit f8ec26d0f5bcdb864f771fb6d250d9ed3165eb61 Author: Hannes Reinecke Date: Tue Dec 21 08:20:29 2021 +0100 ata: libata: add reset tracepoints To follow the flow of control we should be using tracepoints, as they will tie in with the actual I/O flow and deliver a better overview about what it happening. This patch adds tracepoints for hard reset, soft reset, and postreset and adds them in the libata-eh control flow. With that we can drop the reset DPRINTK calls in the various drivers. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 4baa5745ec21efdce3470945a3ff6831b3e6c071 Author: Hannes Reinecke Date: Tue Dec 21 08:20:28 2021 +0100 ata: libata: sanitize ATA_HORKAGE_DUMP_ID With moving ata_dev_dbg() over to dynamic debugging ATA_HORKAGE_DUMP_ID will now print out the raw IDENTIFY data without a header unless explicitly enable via dyndebug. So move the logging level up to INFO and have the header printed always. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 6044f3c456dc5f4a013e629da8632fab1d50d08e Author: Hannes Reinecke Date: Tue Dec 21 08:20:27 2021 +0100 ata: libata: move ata_dump_id() to dynamic debugging Use ata_dev_dbg() to print out the information in ata_dump_id() and remove the ata_msg_probe() conditional. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit 6c952a0dc9c3ced98c4c8aa7cd11c25c59157f1f Author: Hannes Reinecke Date: Tue Dec 21 08:20:26 2021 +0100 ata: libata: Add ata_port_classify() helper Add an ata_port_classify() helper to print out the results from the device classification and remove the debugging statements from ata_dev_classify(). Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit bb6a42d7104644bb8d59fac9a93b69d7790ff15e Author: Hannes Reinecke Date: Tue Dec 21 08:20:25 2021 +0100 ata: libata: whitespace cleanup Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit f3b9db5f4fd1f65b44935d22b6fe0016aa62d5c0 Author: Hannes Reinecke Date: Tue Dec 21 08:20:24 2021 +0100 ata: libata: remove pointless debugging messages Debugging messages in pci init functions or sg setup are pretty much pointless, as the workflow pretty much decides what happened. So drop them. Signed-off-by: Hannes Reinecke Signed-off-by: Damien Le Moal commit da29947057950232f4ad8e0e118d2d5002daaf2b Author: Changcheng Deng Date: Mon Dec 20 11:33:58 2021 +0000 ata: libata: use min() to make code cleaner Use min() in order to make code cleaner. Reported-by: Zeal Robot Signed-off-by: Changcheng Deng Signed-off-by: Damien Le Moal commit 7b6acb4e7faa8590ac9b56874a2129a977da8890 Author: Andy Shevchenko Date: Fri Dec 17 13:28:32 2021 +0200 ata: libahci_platform: Get rid of dup message when IRQ can't be retrieved platform_get_irq() will print a message when it fails. No need to repeat this. Signed-off-by: Andy Shevchenko Signed-off-by: Damien Le Moal commit ea63a8990151948b87dfc0502028bcc7d6724dbc Author: Andy Shevchenko Date: Thu Dec 9 16:59:37 2021 +0200 ata: libahci_platform: Remove bogus 32-bit DMA mask attempt If 64-bit mask attempt fails, the 32-bit will fail by the very same reason. Don't even try the latter. It's a continuation of the changes that contains, e.g. dcc02c19cc06 ("sata_sil24: use dma_set_mask_and_coherent"). Signed-off-by: Andy Shevchenko Reviewed-by: Hans de Goede Signed-off-by: Damien Le Moal commit 0805e945651d6cf3a08349fd041c2049dadc76d9 Author: Andy Shevchenko Date: Thu Dec 9 16:35:19 2021 +0200 ata: sata_dwc_460ex: Remove unused forward declaration sata_dwc_port_stop() is not used before being defined, remove redundant forward declaration. Signed-off-by: Andy Shevchenko Signed-off-by: Damien Le Moal commit f1550f27f8a92a4d29329aeeb28b743365abceae Author: Andy Shevchenko Date: Thu Dec 9 16:35:18 2021 +0200 ata: sata_dwc_460ex: Use temporary variable for struct device Use temporary variable for struct device to make code neater. Signed-off-by: Andy Shevchenko Signed-off-by: Damien Le Moal commit f713961de5057765bc663db72b7e540f27827750 Author: Andy Shevchenko Date: Thu Dec 9 16:35:17 2021 +0200 ata: sata_dwc_460ex: Use devm_platform_*ioremap_resource() APIs Use devm_platform_get_and_ioremap_resource() and devm_platform_ioremap_resource() APIs instead of their open coded analogues. Signed-off-by: Andy Shevchenko Signed-off-by: Damien Le Moal commit ab0efc068ebf73dcec6198c05b8a8111f0d48aea Author: Damien Le Moal Date: Thu Dec 2 15:05:03 2021 +0900 ata: sata_fsl: use sysfs_emit() Use sysfs_emit() instead of sprintf() in fsl_sata_intr_coalescing_show() and fsl_sata_rx_watermark_show(). Signed-off-by: Damien Le Moal commit 179a028225c145171a2e95abbc69b579f72cdf5a Author: Damien Le Moal Date: Thu Dec 2 15:02:17 2021 +0900 ata: ahci: use sysfs_emit() Use sysfs_emit() instead of sprintf in remapped_nvme_show(). Signed-off-by: Damien Le Moal commit 0667391e191c00fb80d5a227bef977ecb12b5b70 Author: Damien Le Moal Date: Thu Dec 2 14:56:47 2021 +0900 ata: libata-scsi: use sysfs_emit() Use sysfs_emit() instead of snprintf() in ata_scsi_park_show(). Signed-off-by: Damien Le Moal commit 58c541146b6601ad0b12f2a1f8fc925a3a3e0006 Author: Damien Le Moal Date: Thu Dec 2 14:52:57 2021 +0900 ata: libata-sata: use sysfs_emit() Use sysfs_emit() instead of snprintf() in sysfs attibute show() functions. Signed-off-by: Damien Le Moal commit 23c72ffedeed6d513144fa09834b1eb0cb2b7373 Author: Kees Cook Date: Thu Nov 18 10:38:07 2021 -0800 ata: sata_fsl: Use struct_group() for memcpy() region 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. Use struct_group() in struct command_desc around members acmd and fill, so they can be referenced together. This will allow memset(), memcpy(), and sizeof() to more easily reason about sizes, improve readability, and avoid future warnings about writing beyond the end of acmd: In function 'fortify_memset_chk', inlined from 'sata_fsl_qc_prep' at drivers/ata/sata_fsl.c:534:3: ./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(); | ^~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Kees Cook Signed-off-by: Damien Le Moal commit 66dc1b791c5839d64d261c8b40250a33e6da050b Merge: c9e6606c7fe92 91d6988558d7e 4cb3600e5eaf6 664c0b58e0252 c95a9c278df87 aade40b62745c Author: Joerg Roedel Date: Tue Jan 4 10:33:45 2022 +0100 Merge branches 'arm/smmu', 'virtio', 'x86/amd', 'x86/vt-d' and 'core' into next commit 08a6df09063818d55c1f0aa8cf3385d8d217b506 Author: Christophe JAILLET Date: Mon Jan 3 21:35:37 2022 -0800 Input: gpio-keys - avoid clearing twice some memory bitmap_parselist() already clears the 'bits' bitmap, so there is no need to clear it when it is allocated. This just wastes some cycles. Signed-off-by: Christophe JAILLET Acked-by: Paul Cercueil Link: https://lore.kernel.org/r/d6ee621b9dd75b92f8831db365cee58dc2025322.1640813136.git.christophe.jaillet@wanadoo.fr Signed-off-by: Dmitry Torokhov commit 18dbfcdedc802f9500b2c29794f22a31d27639c0 Author: Ammar Faizi Date: Sun Dec 26 20:54:02 2021 +0700 powerpc/xive: Add missing null check after calling kmalloc Commit 930914b7d528fc ("powerpc/xive: Add a debugfs file to dump internal XIVE state") forgot to add a null check. Add it. Fixes: 930914b7d528fc6b0249bffc00564100bcf6ef75 ("powerpc/xive: Add a debugfs file to dump internal XIVE state") Signed-off-by: Ammar Faizi Reviewed-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211226135314.251221-1-ammar.faizi@intel.com commit e57c2fd6cdf8db581ac93b909b2664751e7cf30c Author: Christophe JAILLET Date: Sun Jan 2 11:29:54 2022 +0100 powerpc/floppy: 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. @@ @@ - 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 Reviewed-by: Christoph Hellwig Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/9e24eedeab44cbb840598bb188561a48811de845.1641119338.git.christophe.jaillet@wanadoo.fr commit d5dbcca70182501bed99de85c224cef04c38ed92 Author: Greg Kroah-Hartman Date: Mon Jan 3 17:24:08 2022 +0100 pktcdvd: convert to use attribute groups There is no need to create kobject children of the pktcdvd device just to display a subdirectory name. Instead, use a named attribute group which removes the extra kobjects and also fixes the userspace race where the device is created yet tools like libudev can not see the attributes as they think the subdirectories are some other sort of device. Cc: linux-block@vger.kernel.org Cc: Jens Axboe Signed-off-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20220103162408.742003-1-gregkh@linuxfoundation.org Signed-off-by: Jens Axboe commit 49737f261c412ea7c4ca583317a9b094c0aaed49 Author: Jason Wang Date: Sat Nov 13 14:26:14 2021 +0800 ata: pata_ali: no need to initialise statics to 0 Static variables do not need to be initialized to 0. Signed-off-by: Jason Wang Signed-off-by: Damien Le Moal commit 9d2c27aad0ea2c84413d0971be7fa340ba4617bc Merge: 7590fc6f80ac2 cde3fac565a7d Author: Jakub Kicinski Date: Mon Jan 3 19:52:15 2022 -0800 Merge tag 'batadv-next-pullrequest-20220103' of git://git.open-mesh.org/linux-merge Simon Wunderlich says: ==================== This cleanup patchset includes the following patches: - bump version strings, by Simon Wunderlich - allow netlink usage in unprivileged containers, by Linus Lüssing - remove unneeded variable, by Minghao Chi * tag 'batadv-next-pullrequest-20220103' of git://git.open-mesh.org/linux-merge: batman-adv: remove unneeded variable in batadv_nc_init batman-adv: allow netlink usage in unprivileged containers batman-adv: Start new development cycle ==================== Link: https://lore.kernel.org/r/20220103171722.1126109-1-sw@simonwunderlich.de Signed-off-by: Jakub Kicinski commit 7590fc6f80ac2cbf23e6b42b668bbeded070850b Author: Florian Fainelli Date: Mon Jan 3 11:40:24 2022 -0800 net: mdio: Demote probed message to debug print On systems with large numbers of MDIO bus/muxes the message indicating that a given MDIO bus has been successfully probed is repeated for as many buses we have, which can eat up substantial boot time for no reason, demote to a debug print. Reported-by: Maxime Bizon Signed-off-by: Florian Fainelli Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20220103194024.2620-1-f.fainelli@gmail.com Signed-off-by: Jakub Kicinski commit 82ca67321f55a8d1da6ac3ed611da3c32818bb37 Author: Lukas Bulwahn Date: Thu Dec 30 18:19:40 2021 +0100 Documentation: refer to config RANDOMIZE_BASE for kernel address-space randomization The config RANDOMIZE_SLAB does not exist, the authors probably intended to refer to the config RANDOMIZE_BASE, which provides kernel address-space randomization. They probably just confused SLAB with BASE (these two four-letter words coincidentally share three common letters), as they also point out the config SLAB_FREELIST_RANDOM as further randomization within the same sentence. Fix the reference of the config for kernel address-space randomization to the config that provides that. Fixes: 6e88559470f5 ("Documentation: Add section about CPU vulnerabilities for Spectre") Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20211230171940.27558-1-lukas.bulwahn@gmail.com Signed-off-by: Jonathan Corbet commit e765c747d11012adcf743406c4aa4011afc2893b Author: Lukas Bulwahn Date: Thu Dec 30 18:24:23 2021 +0100 Documentation: kgdb: properly capitalize the MAGIC_SYSRQ config Most readers are probably going to figure out that the config is actually all upper-case letters, as all Kconfig symbols are this way. Properly capitalizing makes the script ./scripts/checkkconfigsymbols.py happy, which otherwise would report this as a reference to a non-existing Kconfig symbol. So, use the right capitalization for the MAGIC_SYSRQ config in the kgdb documentation. Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20211230172423.30430-1-lukas.bulwahn@gmail.com Signed-off-by: Jonathan Corbet commit 09fec26e4ef5712126f06edc1274e773b6f38d3e Author: Shile Zhang Date: Thu Dec 30 10:57:02 2021 +0800 docs/zh_CN: Update and fix a couple of typos Update to the original README.rst and fix some typos. Signed-off-by: Shile Zhang Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/20211230025702.186158-1-shile.zhang@linux.alibaba.com Signed-off-by: Jonathan Corbet commit 7baab965896eaeea60a54b8fe742feea2f79060f Author: Mauro Carvalho Chehab Date: Mon Jan 3 22:01:57 2022 +0100 scripts: sphinx-pre-install: add required ctex dependency After a change meant to fix support for oriental characters (Chinese, Japanese, Korean), ctex stylesheet is now a requirement for PDF output. Reported-by: Christoph Hellwig Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/165aa6167f21e3892a6e308688c93c756e94f4e0.1641243581.git.mchehab@kernel.org Signed-off-by: Jonathan Corbet commit 73a0c2be75cf777fa03eb86487dfbe7fbb88d8a2 Author: Bjorn Helgaas Date: Thu Dec 23 15:37:49 2021 -0600 PCI: spear13xx: Avoid invalid address space conversions The sparse checker complains about converting pointers between address spaces. We correctly stored an __iomem pointer in struct spear13xx_pcie, but discarded the __iomem when extracting app_base, causing one warning. Then we passed the non-__iomem pointer to writel(), which expects an __iomem pointer, causing another warning. Add the appropriate annotations. The sparse warnings look like this: $ make C=2 drivers/pci/controller/ drivers/pci/controller/dwc/pcie-spear13xx.c:72:54: warning: incorrect type in initializer (different address spaces) drivers/pci/controller/dwc/pcie-spear13xx.c:72:54: expected struct pcie_app_reg *app_reg drivers/pci/controller/dwc/pcie-spear13xx.c:72:54: got void [noderef] __iomem *app_base drivers/pci/controller/dwc/pcie-spear13xx.c:78:26: warning: incorrect type in argument 2 (different address spaces) drivers/pci/controller/dwc/pcie-spear13xx.c:78:26: expected void volatile [noderef] __iomem *addr drivers/pci/controller/dwc/pcie-spear13xx.c:78:26: got unsigned int * Link: https://lore.kernel.org/r/20211223213749.1314142-3-helgaas@kernel.org Signed-off-by: Bjorn Helgaas Cc: Pratyush Anand commit 088c8405990d9d62ad26dff3c883d2409fa11e06 Author: Bjorn Helgaas Date: Thu Dec 23 15:37:48 2021 -0600 PCI: hisi: Avoid invalid address space conversions The sparse checker complains about converting pointers between address spaces. The pci_config_window.priv pointer is a generic void *, but hisi_pcie_map_bus() needs a void __iomem *. This isn't a problem in other drivers because they store the __iomem pointer in a driver struct. Add a trivial struct hisi_pcie to avoid the warning. The sparse warning looks like this: $ make C=2 drivers/pci/controller/ drivers/pci/controller/dwc/pcie-hisi.c:61:37: warning: incorrect type in initializer (different address spaces) drivers/pci/controller/dwc/pcie-hisi.c:61:37: expected void [noderef] __iomem *reg_base drivers/pci/controller/dwc/pcie-hisi.c:61:37: got void *priv Link: https://lore.kernel.org/r/20211223213749.1314142-2-helgaas@kernel.org Signed-off-by: Bjorn Helgaas Cc: Zhou Wang commit dacee5872d896b1aaec982829f3b4a3e8e14e53c Author: Bjorn Helgaas Date: Wed Dec 22 19:10:54 2021 -0600 PCI: xilinx-cpm: Rename xilinx_cpm_pcie_port to xilinx_cpm_pcie Rename struct xilinx_cpm_pcie_port to xilinx_cpm_pcie to match the convention of _pcie. No functional change intended. Link: https://lore.kernel.org/r/20211223011054.1227810-24-helgaas@kernel.org Signed-off-by: Bjorn Helgaas Acked-by: Michal Simek commit 0519f73adbd85308b279768d8214e1be8d477ae6 Author: Fan Fei Date: Wed Dec 22 19:10:53 2021 -0600 PCI: xilinx: Rename xilinx_pcie_port to xilinx_pcie Rename struct xilinx_pcie_port to xilinx_pcie to match the convention of _pcie. No functional change intended. Link: https://lore.kernel.org/r/20211223011054.1227810-23-helgaas@kernel.org Signed-off-by: Fan Fei Signed-off-by: Bjorn Helgaas Acked-by: Michal Simek commit 24d174a116f6f0dd05c46b00d054f4ba85f9d010 Author: Fan Fei Date: Wed Dec 22 19:10:52 2021 -0600 PCI: xgene: Rename xgene_pcie_port to xgene_pcie Rename struct xgene_pcie_port to xgene_pcie to match the convention of _pcie. No functional change intended. Link: https://lore.kernel.org/r/20211223011054.1227810-22-helgaas@kernel.org Signed-off-by: Fan Fei Signed-off-by: Bjorn Helgaas Cc: Toan Le commit de8bd0c6c343ce83f022a00ba21f8c1bcebc8cbc Author: Fan Fei Date: Wed Dec 22 19:10:51 2021 -0600 PCI: uniphier: Rename uniphier_pcie_priv to uniphier_pcie Rename struct uniphier_pcie_priv to uniphier_pcie to match the convention of _pcie. No functional change intended. [bhelgaas: drop extraneous uniphier_pcie_irq_ack() from patch] Link: https://lore.kernel.org/r/20211223011054.1227810-21-helgaas@kernel.org Signed-off-by: Fan Fei Signed-off-by: Bjorn Helgaas Cc: Kunihiko Hayashi Cc: Masami Hiramatsu commit b572569183993b68dec0e990b33641e6f77744ba Author: Fan Fei Date: Wed Dec 22 19:10:50 2021 -0600 PCI: tegra194: Rename tegra_pcie_dw to tegra194_pcie Rename tegra_pcie_dw to tegra194_pcie to match the convention of _pcie. No functional change intended. [bhelgaas: rename functions similarly] Link: https://lore.kernel.org/r/20211223011054.1227810-20-helgaas@kernel.org Signed-off-by: Fan Fei Signed-off-by: Bjorn Helgaas Cc: Thierry Reding Cc: Jonathan Hunter commit 7025ecb658c2d42ed9ded89686501af16a36e6e2 Author: Bjorn Helgaas Date: Wed Dec 22 19:10:49 2021 -0600 PCI: rcar-gen2: Rename rcar_pci_priv to rcar_pci Rename struct rcar_pci_priv to rcar_pci to match the convention of _pci. No functional change intended. Link: https://lore.kernel.org/r/20211223011054.1227810-19-helgaas@kernel.org Signed-off-by: Bjorn Helgaas Cc: Marek Vasut Cc: Yoshihiro Shimoda commit 4793895f597d42eb54a0f54711b61263b6a8dd03 Author: Bjorn Helgaas Date: Wed Dec 22 19:10:48 2021 -0600 PCI: mt7621: Rename mt7621_pci_ to mt7621_pcie_ Rename mt7621_pci_* structs and functions to mt7621_pcie_* for consistency with the rest of the file. Link: https://lore.kernel.org/r/20211223011054.1227810-18-helgaas@kernel.org Signed-off-by: Bjorn Helgaas Reviewed-by: Sergio Paracuellos Cc: Matthias Brugger commit 5fe714fd9223604c04c454434e09da245d5f96ce Author: Bjorn Helgaas Date: Wed Dec 22 19:10:46 2021 -0600 PCI: microchip: Rename mc_port to mc_pcie Rename struct mc_port to mc_pcie to match the convention of _pcie. No functional change intended. Link: https://lore.kernel.org/r/20211223011054.1227810-16-helgaas@kernel.org Signed-off-by: Bjorn Helgaas Cc: Daire McNamara commit d5a4835b5ed05b1f14a00e0db9f2c91ae7d1ede6 Author: Fan Fei Date: Wed Dec 22 19:10:45 2021 -0600 PCI: mediatek-gen3: Rename mtk_pcie_port to mtk_gen3_pcie Rename struct mtk_pcie_port to mtk_gen3_pcie to match the convention of _pcie. No functional change intended. Link: https://lore.kernel.org/r/20211223011054.1227810-15-helgaas@kernel.org Signed-off-by: Fan Fei Signed-off-by: Bjorn Helgaas Cc: Ryder Lee Cc: Jianjun Wang commit 4688594ff4768b951731a55a19d72767ef8903d4 Author: Bjorn Helgaas Date: Wed Dec 22 19:10:44 2021 -0600 PCI: ls-gen4: Rename ls_pcie_g4 to ls_g4_pcie Rename struct ls_pcie_g4 to ls_g4_pcie to match the convention of _pcie. No functional change intended. Link: https://lore.kernel.org/r/20211223011054.1227810-14-helgaas@kernel.org Signed-off-by: Bjorn Helgaas Cc: Hou Zhiqiang commit 05463a768ff2524f49fb5ea067db83676b2d0a4f Author: Bjorn Helgaas Date: Wed Dec 22 19:10:43 2021 -0600 PCI: iproc: Rename iproc_pcie_pltfm_ to iproc_pltfm_pcie_ Rename iproc_pcie_pltfm_* to iproc_pltfm_pcie_* for consistency with other drivers. No functional change intended. Link: https://lore.kernel.org/r/20211223011054.1227810-13-helgaas@kernel.org Signed-off-by: Bjorn Helgaas Cc: Ray Jui Cc: Scott Branden commit 8fa96635202800947382df155ff161ac2d5bbbd3 Author: Bjorn Helgaas Date: Wed Dec 22 19:10:42 2021 -0600 PCI: iproc: Rename iproc_pcie_bcma_ to iproc_bcma_pcie_ Rename iproc_pcie_bcma_* to iproc_bcma_pcie_* for consistency with other drivers. No functional change intended. Link: https://lore.kernel.org/r/20211223011054.1227810-12-helgaas@kernel.org Signed-off-by: Bjorn Helgaas Cc: Ray Jui Cc: Scott Branden commit 733770d4a2bea0ce45050f47f49f38b64b3d0cd3 Author: Fan Fei Date: Wed Dec 22 19:10:41 2021 -0600 PCI: intel-gw: Rename intel_pcie_port to intel_pcie Rename struct intel_pcie_port to intel_pcie to match the convention of _pcie. No functional change intended. Link: https://lore.kernel.org/r/20211223011054.1227810-11-helgaas@kernel.org Signed-off-by: Fan Fei Signed-off-by: Bjorn Helgaas Cc: Rahul Tanwar commit 19e863828acf6d8ac8475ba1fd93c0fe17fdc4ef Author: Bjorn Helgaas Date: Wed Dec 22 19:10:40 2021 -0600 PCI: j721e: Drop redundant struct device * The struct cdns_pcie already contains the struct device for the j721e PCIe controller. There's no need to store another copy in struct j721e_pcie. Remove the redundant copy from struct j721e_pcie. Link: https://lore.kernel.org/r/20211223011054.1227810-10-helgaas@kernel.org Signed-off-by: Bjorn Helgaas Cc: Kishon Vijay Abraham I Cc: Tom Joseph commit 72de208f2bda3c6a0d99e744ce7bedf3d3b8011a Author: Bjorn Helgaas Date: Wed Dec 22 19:10:39 2021 -0600 PCI: j721e: Drop pointless of_device_get_match_data() cast of_device_get_match_data() returns "void *", so no cast is needed when assigning the result to a pointer type. Drop the unnecessary cast. Link: https://lore.kernel.org/r/20211223011054.1227810-9-helgaas@kernel.org Signed-off-by: Bjorn Helgaas Cc: Kishon Vijay Abraham I Cc: Tom Joseph commit a622435fbe1a230d656d47edbb50370a432aec80 Author: Fan Fei Date: Wed Dec 22 19:10:38 2021 -0600 PCI: kirin: Prefer of_device_get_match_data() The kirin driver only needs the device data, not the whole struct of_device_id. Use of_device_get_match_data() instead of of_match_device(). No functional change intended. [bhelgaas: commit log] Link: https://lore.kernel.org/r/20211223011054.1227810-8-helgaas@kernel.org Signed-off-by: Fan Fei Signed-off-by: Bjorn Helgaas Cc: Xiaowei Song Cc: Binghui Wang commit 39a29fbd4e3123f77cfd7df1d1597e70e372361a Author: Fan Fei Date: Wed Dec 22 19:10:37 2021 -0600 PCI: keystone: Prefer of_device_get_match_data() The keystone driver only needs the device data, not the whole struct of_device_id. Use of_device_get_match_data() instead of of_match_device(). No functional change intended. [bhelgaas: commit log] Link: https://lore.kernel.org/r/20211223011054.1227810-7-helgaas@kernel.org Signed-off-by: Fan Fei Signed-off-by: Bjorn Helgaas Cc: Kishon Vijay Abraham I commit dc078f15715a8efe432f9b8c94f2691b17787218 Author: Fan Fei Date: Wed Dec 22 19:10:36 2021 -0600 PCI: dra7xx: Prefer of_device_get_match_data() The dra7xx driver only needs the device data, not the whole struct of_device_id. Use of_device_get_match_data() instead of of_match_device(). No functional change intended. [bhelgaas: commit log] Link: https://lore.kernel.org/r/20211223011054.1227810-6-helgaas@kernel.org Signed-off-by: Fan Fei Signed-off-by: Bjorn Helgaas Cc: Kishon Vijay Abraham I commit 5c204204cf243136804b3a9da77d091e3f803668 Author: Fan Fei Date: Wed Dec 22 19:10:35 2021 -0600 PCI: designware-plat: Prefer of_device_get_match_data() The designware-plat driver only needs the device data, not the whole struct of_device_id. Use of_device_get_match_data() instead of of_match_device(). No functional change intended. [bhelgaas: commit log] Link: https://lore.kernel.org/r/20211223011054.1227810-5-helgaas@kernel.org Signed-off-by: Fan Fei Signed-off-by: Bjorn Helgaas Cc: Jingoo Han Cc: Gustavo Pimentel commit 131748ad2939dfaf20b3178112dbd52591d39148 Author: Fan Fei Date: Wed Dec 22 19:10:34 2021 -0600 PCI: cadence: Prefer of_device_get_match_data() The cadence driver only needs the device data, not the whole struct of_device_id. Use of_device_get_match_data() instead of of_match_device(). No functional change intended. [bhelgaas: commit log] Link: https://lore.kernel.org/r/20211223011054.1227810-4-helgaas@kernel.org Signed-off-by: Fan Fei Signed-off-by: Bjorn Helgaas Cc: Tom Joseph commit 7073f2ceca380bcba5caa2110e86d62fff6e430c Author: Fan Fei Date: Wed Dec 22 19:10:33 2021 -0600 PCI: artpec6: Prefer of_device_get_match_data() The artpec6 driver only needs the device data, not the whole struct of_device_id. Use of_device_get_match_data() instead of of_match_device(). No functional change intended. [bhelgaas: commit log] Link: https://lore.kernel.org/r/20211223011054.1227810-3-helgaas@kernel.org Signed-off-by: Fan Fei Signed-off-by: Bjorn Helgaas Acked-by: Jesper Nilsson commit c31990dbeb78e435b541c27f6611134037f1f0ac Author: Fan Fei Date: Wed Dec 22 19:10:32 2021 -0600 PCI: altera: Prefer of_device_get_match_data() The altera driver only needs the device data, not the whole struct of_device_id. Use of_device_get_match_data() instead of of_match_device(). No functional change intended. [bhelgaas: commit log] Link: https://lore.kernel.org/r/20211223011054.1227810-2-helgaas@kernel.org Signed-off-by: Fan Fei Signed-off-by: Bjorn Helgaas Cc: Joyce Ooi commit cfcabbb24d5f4e52ce2e7797cbcfacd8fe932fb6 Author: Arnaud Pouliquen Date: Tue Dec 21 15:31:29 2021 +0100 remoteproc: stm32: Improve crash recovery time When a stop is requested on a crash, it is useless to try to shutdown it gracefully, it is crashed. In this case don't send the STM32_MBX_SHUTDOWN mailbox message that will block the recovery during 500 ms, waiting an answer from the coprocessor. Signed-off-by: Arnaud Pouliquen Link: https://lore.kernel.org/r/20211221143129.18415-1-arnaud.pouliquen@foss.st.com Signed-off-by: Mathieu Poirier commit 25fd330370ac40653671f323acc7fb6db27ef6fe Author: Linus Walleij Date: Wed Dec 15 02:01:18 2021 +0100 power: supply_core: Pass pointer to battery info The function to retrieve battery info (from the device tree) assumes we have a static info struct that gets populated by calling into power_supply_get_battery_info(). This is awkward since I want to support tables of static battery info by just assigning a pointer to all info based on e.g. a compatible value in the device tree. We also have a mixture of static and dynamically allocated variables here. Bite the bullet and let power_supply_get_battery_info() allocate also the memory used for the very top level struct power_supply_battery_info container. Pass pointers around and lifecycle this with the psy device just like the stuff we allocate inside it. Change all current users over. As part of the change, initializers need to be added to some previously uninitialized fields in struct power_supply_battery_info. Reviewed-By: Matti Vaittinen Signed-off-by: Linus Walleij Signed-off-by: Sebastian Reichel commit be2c0d5418b1f44b01154a71e4501de139d0a7c9 Author: Christophe JAILLET Date: Tue Dec 28 21:43:22 2021 +0100 power: supply: ab8500: Fix the error handling path of ab8500_charger_probe() Since the commit below, ab8500_bm_of_remove() needs to be called after a successful ab8500_bm_of_probe() call. This commit has only updated the remove function. Fix the error handling path of the probe the same way. Fixes: 6252c706cdb0 ("power: supply: ab8500: Standardize operating temperature") Signed-off-by: Christophe JAILLET Reviewed-by: Linus Walleij Signed-off-by: Sebastian Reichel commit 1c1348bf056dee665760a3bd1cd30b0be7554fc2 Author: Jiasheng Jiang Date: Mon Dec 20 16:38:11 2021 +0800 power: reset: mt6397: Check for null res pointer The return value of platform_get_resource() needs to be checked. To avoid use of error pointer in case that there is no suitable resource. Fixes: d28c74c10751 ("power: reset: add driver for mt6323 poweroff") Signed-off-by: Jiasheng Jiang Signed-off-by: Sebastian Reichel commit 65f8d08cf838df3c3d728cdef908090237931496 Merge: af2b24f228a03 c9e6606c7fe92 Author: Arnaldo Carvalho de Melo Date: Mon Jan 3 11:54:30 2022 -0300 Merge remote-tracking branch 'torvalds/master' into perf/core To pick up fixes. Signed-off-by: Arnaldo Carvalho de Melo commit c1933008679586b20437280463110c967d66f865 Author: Christian Lachner Date: Mon Jan 3 15:05:17 2022 +0100 ALSA: hda/realtek - Fix silent output on Gigabyte X570 Aorus Master after reboot from Windows This patch addresses an issue where after rebooting from Windows into Linux there would be no audio output. It turns out that the Realtek Audio driver on Windows changes some coeffs which are not being reset/reinitialized when rebooting the machine. As a result, there is no audio output until these coeffs are being reset to their initial state. This patch takes care of that by setting known-good (initial) values to the coeffs. We initially relied upon alc1220_fixup_clevo_p950() to fix some pins in the connection list. However, it also sets coef 0x7 which does not need to be touched. Furthermore, to prevent mixing device-specific quirks I introduced a new alc1220_fixup_gb_x570() which is heavily based on alc1220_fixup_clevo_p950() but does not set coeff 0x7 and fixes the coeffs that are actually needed instead. This new alc1220_fixup_gb_x570() is believed to also work for other boards, like the Gigabyte X570 Aorus Extreme and the newer Gigabyte Aorus X570S Master. However, as there is no way for me to test these I initially only enable this new behaviour for the mainboard I have which is the Gigabyte X570(non-S) Aorus Master. I tested this patch on the 5.15 branch as well as on master and it is working well for me. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=205275 Signed-off-by: Christian Lachner Fixes: 0d45e86d2267d ("ALSA: hda/realtek - Fix silent output on Gigabyte X570 Aorus Master") Cc: Link: https://lore.kernel.org/r/20220103140517.30273-2-gladiac@gmail.com Signed-off-by: Takashi Iwai commit 364be8421192d11ff2aa2973f00efc7cf3b01f52 Author: Nikolay Borisov Date: Tue Nov 23 14:44:22 2021 +0200 btrfs: change name and type of private member of btrfs_free_space_ctl btrfs_free_space_ctl::private is either unset or it always points to struct btrfs_block_group when it is set. So there's no point in keeping the unhelpful 'private' name and keeping it an untyped pointer. Change both the type and name to be self-describing. No functional changes. Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 290ef19add7649e2e75653b92ffcfa6417c451d1 Author: Nikolay Borisov Date: Tue Nov 23 14:44:21 2021 +0200 btrfs: make __btrfs_add_free_space take just block group reference There is no point in the function taking an fs_info and a btrfs_free_space because the ctl passed always belongs to the block group. Furthermore fs_info can be referenced from the block group. No functional changes. Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 32e1649b5356d805320b58b407a9bdb164d270f5 Author: Nikolay Borisov Date: Tue Nov 23 14:44:20 2021 +0200 btrfs: consolidate unlink_free_space/__unlink_free_space functions The only difference between the two is whether btrfs_free_space::bytes is adjusted. Instead of having 2 separate functions control this behavior via an additional parameter and make them one function instead. No functional changes. Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit f594f13c194e50186d52e7995c9b7fbdd315a8dc Author: Nikolay Borisov Date: Tue Nov 23 14:44:19 2021 +0200 btrfs: consolidate bitmap_clear_bits/__bitmap_clear_bits The only difference is the former adjusts btrfs_free_space::bytes member. Consolidate the two function into 1 and add a bool parameter which controls whether the adjustment is made or not. No functional changes. Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit abed4aaae4f71a7bcdbe90a65319b6e772a2689d Author: Josef Bacik Date: Fri Nov 5 16:45:51 2021 -0400 btrfs: track the csum, extent, and free space trees in a rb tree In the future we are going to have multiple copies of these trees. To facilitate this we need a way to lookup the different roots we are looking for. Handle this by adding a global root rb tree that is indexed on the root->root_key. Then instead of loading the roots at mount time with individually targeted keys, simply search the tree_root for anything with the specific objectid we want. This will make it straightforward to support both old style and new style file systems. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 7fcf8a0050df003776d10602c9c52b57212f3345 Author: Josef Bacik Date: Fri Nov 5 16:45:50 2021 -0400 btrfs: remove useless WARN_ON in record_root_in_trans We don't set SHAREABLE on the extent root, we don't need to have this safety check here. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 7939dd9f35f6f76f5ee199851bcb4d89cd7be061 Author: Josef Bacik Date: Fri Nov 5 16:45:49 2021 -0400 btrfs: stop accessing ->free_space_root directly We're going to have multiple free space roots in the future, so adjust all the users of the free space root to use a helper to access the root. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit fc28b25e1f428651133326300d9572b42aae6d8f Author: Josef Bacik Date: Fri Nov 5 16:45:48 2021 -0400 btrfs: stop accessing ->csum_root directly We are going to have multiple csum roots in the future, so convert all users of ->csum_root to btrfs_csum_root() and rename ->csum_root to ->_csum_root so we can easily find remaining users in the future. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 056c83111648a92233f0445bb4a6c1aeafe6be98 Author: Josef Bacik Date: Fri Nov 5 16:45:47 2021 -0400 btrfs: set BTRFS_FS_STATE_NO_CSUMS if we fail to load the csum root We have a few places where we skip doing csums if we mounted with one of the rescue options that ignores bad csum roots. In the future when there are multiple csum roots it'll be costly to check and see if there are any missing csum roots, so simply add a flag to indicate the fs should skip loading csums in case of errors. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 84d2d6c7016513f59d98da30da486af3f5244b04 Author: Josef Bacik Date: Fri Nov 5 16:45:46 2021 -0400 btrfs: fix csum assert to check objectid of the root In the future we may have multiple csum roots, so simply check the objectid is for a csum root instead of checking against ->csum_root. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 29cbcf401793f4e2c871c846edc2191731df2c41 Author: Josef Bacik Date: Fri Nov 5 16:45:45 2021 -0400 btrfs: stop accessing ->extent_root directly When we start having multiple extent roots we'll need to use a helper to get to the correct extent_root. Rename fs_info->extent_root to _extent_root and convert all of the users of the extent root to using the btrfs_extent_root() helper. This will allow us to easily clean up the remaining direct accesses in the future. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 2e608bd1dd51ee962bded788caee4aa812729e87 Author: Josef Bacik Date: Fri Nov 5 16:45:44 2021 -0400 btrfs: init root block_rsv at init root time In the future we're going to have multiple csum and extent root trees, so init the roots block_rsv at setup_root time based on their root key objectid. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit ce5603d015edc44faa0b46157f9ab7a9355a3e28 Author: Josef Bacik Date: Fri Nov 5 16:45:43 2021 -0400 btrfs: don't use the extent_root in flush_space We only need the root to start a transaction, and since it's a global root we can pick anything, change to the tree_root as we'll have a lot of extent roots in the future. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 30a9da5d8d494dda15d4b79a8596445140d3aac9 Author: Josef Bacik Date: Fri Nov 5 16:45:42 2021 -0400 btrfs: don't use extent_root in iterate_extent_inodes We are going to have many extent_roots soon, and we don't need a root here necessarily as we're not modifying anything, we're just getting the trans handle so we can have an accurate view of references, so use the tree_root here. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit fd51eb2f07c7deb8af97ab699e6239e03aa7c5f6 Author: Josef Bacik Date: Fri Nov 5 16:45:41 2021 -0400 btrfs: don't use the extent root in btrfs_chunk_alloc_add_chunk_item We're just using the extent_root to set the chunk owner to root_key->objectid, which is BTRFS_EXTENT_TREE_OBJECTID, so use that directly instead of using the root. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 3478c732520a01561bb49f8c5d469f02419fd922 Author: Josef Bacik Date: Fri Nov 5 16:45:40 2021 -0400 btrfs: remove unnecessary extent root check in btrfs_defrag_leaves We only defrag leaves on roots that have SHAREABLE set, so we don't need to check if we're the extent root as it doesn't have SHAREABLE set. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 826582cabc22e741ef3d420fd53b83de988b5647 Author: Josef Bacik Date: Fri Nov 5 16:45:39 2021 -0400 btrfs: do not special case the extent root for switch commit roots This is a leftover from when we used to independently swap the extent root's commit root and the fs tree commit roots. At the time I simply changed the helper to a list_add. There's actually no reason to not add the extent root to the switch commit root at this point, we don't care about the order we do the switching since it's all done under the commit_root_sem. If we re-mark the extent root dirty after adding it to the switch_commits list we'll see that BTRFS_ROOT_DIRTY isn't set and then list_move it back onto the dirty list, and then we'll redo the tree update and everything will be ok. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 8e1d02909185bddc76e98e680d7fea38be0e87da Author: Josef Bacik Date: Fri Nov 5 16:45:38 2021 -0400 btrfs: use chunk_root in find_free_extent_update_loop We're only using this to start the transaction with to possibly allocate a chunk. It doesn't really matter which root to use, but with extent tree v2 we'll need a bytenr to look up a extent root which makes the usage of the extent_root awkward here. Simply change it to the chunk_root. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 76d76e789d1f251f66d3bc3bd53e582ca0625622 Author: Josef Bacik Date: Fri Nov 5 16:45:37 2021 -0400 btrfs: make remove_extent_backref pass the root With extent tree v2 we'll have a different extent root based on where the bytenr is located, so adjust the remove_extent_backref() helper and it's helpers to pass the extent_root around. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit dfe8aec4520bff8e69c8704421ef7f47c65ca778 Author: Josef Bacik Date: Fri Nov 5 16:45:36 2021 -0400 btrfs: add a btrfs_block_group_root() helper With extent tree v2 we will have a separate root to hold the block group items. Add a btrfs_block_group_root() that will return the appropriate root given the flags of the fs, and convert all functions that need to modify block group items to use the helper. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 9f05c09d6baef789726346397438cca4ec43c3ee Author: Josef Bacik Date: Fri Nov 5 16:45:35 2021 -0400 btrfs: remove BUG_ON(!eie) in find_parent_nodes If we're looking for leafs that point to a data extent we want to record the extent items that point at our bytenr. At this point we have the reference and we know for a fact that this leaf should have a reference to our bytenr. However if there's some sort of corruption we may not find any references to our leaf, and thus could end up with eie == NULL. Replace this BUG_ON() with an ASSERT() and then return -EUCLEAN for the mortals. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit fcba0120edf88328524a4878d1d6f4ad39f2ec81 Author: Josef Bacik Date: Fri Nov 5 16:45:34 2021 -0400 btrfs: remove BUG_ON() in find_parent_nodes() We search for an extent entry with .offset = -1, which shouldn't be a thing, but corruption happens. Add an ASSERT() for the developers, return -EUCLEAN for mortals. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit e0b7661d44dab027febaf37f6f7766a3007af932 Author: Josef Bacik Date: Fri Nov 5 16:45:33 2021 -0400 btrfs: remove SANITY_TESTS check form find_parent_nodes We define __TRANS_DUMMY always, so this extra ifdef stuff is not needed. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 9665ebd5dba6a2c36cf67827ab074680c4fc2197 Author: Josef Bacik Date: Fri Nov 5 16:45:32 2021 -0400 btrfs: move comment in find_parent_nodes() This comment was much closer to the related code when it was originally added, but has slowly migrated north far from its ancestral lands. Move it back down with its people. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 98cc42227a1b9b0fb6e89729d08f87f9356bb846 Author: Josef Bacik Date: Fri Nov 5 16:45:31 2021 -0400 btrfs: pass the root to add_keyed_refs We pass in the path, but use btrfs_next_item() using the root we searched with. Pass the root down to add_keyed_refs() instead of the fs_info so we can continue to use the same root we searched with. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 7a60751a33d9fdd1e17e77bd379aefe4ede44aa7 Author: Josef Bacik Date: Fri Nov 5 16:45:30 2021 -0400 btrfs: remove trans_handle->root Nobody is using this anymore, remove it. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 2e4e97abac4c95f8b87b2912ea013f7836a6f10b Author: Josef Bacik Date: Fri Nov 5 16:45:29 2021 -0400 btrfs: pass fs_info to trace_btrfs_transaction_commit The root on the trans->root can be anything, and generally we're committing from the transaction kthread so it's usually the tree_root. Change this to just take an fs_info, and to maintain compatibility simply put the ROOT_TREE_OBJECTID as the root objectid for the tracepoint. This will allow use to remove trans->root. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit fdfbf020664b92336ac4f554ffec2d2f890960b9 Author: Josef Bacik Date: Fri Nov 5 16:45:28 2021 -0400 btrfs: rework async transaction committing Currently we do this awful thing where we get another ref on a trans handle, async off that handle and commit the transaction from that work. Because we do this we have to mess with current->journal_info and the freeze counting stuff. We already have an async thing to kick for the transaction commit, the transaction kthread. Replace this work struct with a flag on the fs_info to tell the kthread to go ahead and commit even if it's before our timeout. Then we can drastically simplify the async transaction commit path. Note: this can be simplified and functionality based on the pending operation COMMIT. Signed-off-by: Josef Bacik [ add note ] Reviewed-by: David Sterba Signed-off-by: David Sterba commit 0af4769da6b29a5e091f3e404e8d5426bdeccac7 Author: Josef Bacik Date: Fri Nov 5 16:45:27 2021 -0400 btrfs: remove unused BTRFS_FS_BARRIER flag This is no longer used, the -o nobarrier is handled by BTRFS_MOUNT_NOBARRIER. Remove the flag. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit f1a8fc626586fcc62dd7eb44ebeddb4517784015 Author: Nikolay Borisov Date: Tue Nov 23 09:23:42 2021 +0200 btrfs: eliminate if in main loop in tree_search_offset Reshuffle the code inside the first loop of tree_search_offset so that one if() is eliminated and the becomes more linear. Reviewed-by: Josef Bacik Signed-off-by: Nikolay Borisov Signed-off-by: David Sterba commit bf08387fb462ac7ab7dd4d3e4ac32728585bf625 Author: Qu Wenruo Date: Fri Nov 19 14:19:33 2021 +0800 btrfs: don't check stripe length if the profile is not stripe based [BUG] When debugging calc_bio_boundaries(), I found that even for RAID1 metadata, we're following stripe length to calculate stripe boundary. # mkfs.btrfs -m raid1 -d raid1 /dev/test/scratch[12] # mount /dev/test/scratch /mnt/btrfs # xfs_io -f -c "pwrite 0 64K" /mnt/btrfs/file # umount Above very basic operations will make calc_bio_boundaries() to report the following result: submit_extent_page: r/i=1/1 file_offset=22036480 len_to_stripe_boundary=49152 submit_extent_page: r/i=1/1 file_offset=30474240 len_to_stripe_boundary=65536 ... submit_extent_page: r/i=1/1 file_offset=30523392 len_to_stripe_boundary=16384 submit_extent_page: r/i=1/1 file_offset=30457856 len_to_stripe_boundary=16384 submit_extent_page: r/i=5/257 file_offset=0 len_to_stripe_boundary=65536 submit_extent_page: r/i=5/257 file_offset=65536 len_to_stripe_boundary=65536 submit_extent_page: r/i=1/1 file_offset=30490624 len_to_stripe_boundary=49152 submit_extent_page: r/i=1/1 file_offset=30507008 len_to_stripe_boundary=32768 Where "r/i" is the rootid and inode, 1/1 means they metadata. The remaining names match the member used in kernel. Even all data/metadata are using RAID1, we're still following stripe length. [CAUSE] This behavior is caused by a wrong condition in btrfs_get_io_geometry(): if (map->type & BTRFS_BLOCK_GROUP_PROFILE_MASK) { /* Fill using stripe_len */ len = min_t(u64, em->len - offset, max_len); } else { len = em->len - offset; } This means, only for SINGLE we will not follow stripe_len. However for profiles like RAID1*, DUP, they don't need to bother stripe_len. This can lead to unnecessary bio split for RAID1*/DUP profiles, and can even be a blockage for future zoned RAID support. [FIX] Introduce one single-use macro, BTRFS_BLOCK_GROUP_STRIPE_MASK, and change the condition to only calculate the length using stripe length for stripe based profiles. Reviewed-by: Johannes Thumshirn Reviewed-by: Anand Jain Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 167c0bd3775dc4ffedfd179c370994226d02a5c9 Author: Nikolay Borisov Date: Mon Nov 22 17:16:46 2021 +0200 btrfs: get next entry in tree_search_offset before doing checks This is a small optimisation since the currently 'entry' is already checked in the if () {} else if {} construct above the loop. In essence the first iteration of the final while loop is redundant. To eliminate this extra check simply get the next entry at the beginning of the loop. Reviewed-by: Josef Bacik Signed-off-by: Nikolay Borisov Signed-off-by: David Sterba commit bbf27275f246a105a1e906f22a4f814f89bf4b55 Author: Josef Bacik Date: Thu Nov 18 16:33:16 2021 -0500 btrfs: add self test for bytes_index free space cache I noticed a few corner cases when looking at my bytes_index patch for obvious bugs, so add a bunch of tests to validate proper behavior of the bytes_index tree. A couple of basic tests to make sure it puts things in the correct order, and then more complicated tests to make sure it re-arranges bitmap entries properly and does the right thing when we try to make allocations. Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit 59c7b566a3b653fe7865cef007c053fd88de8317 Author: Josef Bacik Date: Thu Nov 18 16:33:15 2021 -0500 btrfs: index free space entries on size Currently we index free space on offset only, because usually we have a hint from the allocator that we want to honor for locality reasons. However if we fail to use this hint we have to go back to a brute force search through the free space entries to find a large enough extent. With sufficiently fragmented free space this becomes quite expensive, as we have to linearly search all of the free space entries to find if we have a part that's long enough. To fix this add a cached rb tree to index based on free space entry bytes. This will allow us to quickly look up the largest chunk in the free space tree for this block group, and stop searching once we've found an entry that is too small to satisfy our allocation. We simply choose to use this tree if we're searching from the beginning of the block group, as we know we do not care about locality at that point. I wrote an allocator test that creates a 10TiB ram backed null block device and then fallocates random files until the file system is full. I think go through and delete all of the odd files. Then I spawn 8 threads that fallocate 64MiB files (1/2 our extent size cap) until the file system is full again. I use bcc's funclatency to measure the latency of find_free_extent. The baseline results are nsecs : count distribution 0 -> 1 : 0 | | 2 -> 3 : 0 | | 4 -> 7 : 0 | | 8 -> 15 : 0 | | 16 -> 31 : 0 | | 32 -> 63 : 0 | | 64 -> 127 : 0 | | 128 -> 255 : 0 | | 256 -> 511 : 10356 |**** | 512 -> 1023 : 58242 |************************* | 1024 -> 2047 : 74418 |******************************** | 2048 -> 4095 : 90393 |****************************************| 4096 -> 8191 : 79119 |*********************************** | 8192 -> 16383 : 35614 |*************** | 16384 -> 32767 : 13418 |***** | 32768 -> 65535 : 12811 |***** | 65536 -> 131071 : 17090 |******* | 131072 -> 262143 : 26465 |*********** | 262144 -> 524287 : 40179 |***************** | 524288 -> 1048575 : 55469 |************************ | 1048576 -> 2097151 : 48807 |********************* | 2097152 -> 4194303 : 26744 |*********** | 4194304 -> 8388607 : 35351 |*************** | 8388608 -> 16777215 : 13918 |****** | 16777216 -> 33554431 : 21 | | avg = 908079 nsecs, total: 580889071441 nsecs, count: 639690 And the patch results are nsecs : count distribution 0 -> 1 : 0 | | 2 -> 3 : 0 | | 4 -> 7 : 0 | | 8 -> 15 : 0 | | 16 -> 31 : 0 | | 32 -> 63 : 0 | | 64 -> 127 : 0 | | 128 -> 255 : 0 | | 256 -> 511 : 6883 |** | 512 -> 1023 : 54346 |********************* | 1024 -> 2047 : 79170 |******************************** | 2048 -> 4095 : 98890 |****************************************| 4096 -> 8191 : 81911 |********************************* | 8192 -> 16383 : 27075 |********** | 16384 -> 32767 : 14668 |***** | 32768 -> 65535 : 13251 |***** | 65536 -> 131071 : 15340 |****** | 131072 -> 262143 : 26715 |********** | 262144 -> 524287 : 43274 |***************** | 524288 -> 1048575 : 53870 |********************* | 1048576 -> 2097151 : 55368 |********************** | 2097152 -> 4194303 : 41036 |**************** | 4194304 -> 8388607 : 24927 |********** | 8388608 -> 16777215 : 33 | | 16777216 -> 33554431 : 9 | | avg = 623599 nsecs, total: 397259314759 nsecs, count: 637042 There's a little variation in the amount of calls done because of timing of the threads with metadata requirements, but the avg, total, and count's are relatively consistent between runs (usually within 2-5% of each other). As you can see here we have around a 30% decrease in average latency with a 30% decrease in overall time spent in find_free_extent. Reviewed-by: Filipe Manana Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit 950575c023aabfeac506cae02917c32eae1f553e Author: Josef Bacik Date: Thu Nov 18 16:33:14 2021 -0500 btrfs: only use ->max_extent_size if it is set in the bitmap While adding self tests for my space index change I was hitting a problem where the space indexed tree wasn't returning the expected ->max_extent_size. This is because we will skip searching any entry that doesn't have ->bytes >= the amount of bytes we want. However we'll still set the max_extent_size based on that entry. The problem is if we don't search the bitmap we won't have ->max_extent_size set properly, so we can't really trust it. This doesn't really result in a problem per-se, it can just result in us not finding contiguous area that may exist. Fix the max_extent_size helper to return ->bytes if ->max_extent_size isn't set, and add a big comment explaining why we're doing this. Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit 83f1b68002c208329412cf9f998c90b3326828d2 Author: Qu Wenruo Date: Fri Nov 12 13:33:14 2021 +0800 btrfs: remove unnecessary @nr_written parameters We use @nr_written to record how many pages have been started by btrfs_run_delalloc_range(). Currently there are only two cases that would populate @nr_written: - Inline extent creation - Compressed write But both cases will also set @page_started to one. In fact, in writepage_delalloc() we have the following code, showing that @nr_written is really only utilized for above two cases: /* did the fill delalloc function already unlock and start * the IO? */ if (page_started) { /* * we've unlocked the page, so we can't update * the mapping's writeback index, just update * nr_to_write. */ wbc->nr_to_write -= nr_written; return 1; } But for such cases, writepage_delalloc() will return 1, and exit __extent_writepage() without going through __extent_writepage_io(). Thus this means, inside __extent_writepage_io(), we always get @nr_written as 0. So this patch is going to remove the unnecessary parameter from the following functions: - writepage_delalloc() As @nr_written passed in is always the initial value 0. Although inside that function, we still need a local @nr_written to update wbc->nr_to_write. - __extent_writepage_io() As explained above, @nr_written passed in can only be 0. This also means we can remove one update_nr_written() call. Signed-off-by: Qu Wenruo Signed-off-by: David Sterba commit 9270501c163b67f48fd5fb2f98b1b48d6530f460 Author: Josef Bacik Date: Tue Nov 9 10:12:07 2021 -0500 btrfs: change root to fs_info for btrfs_reserve_metadata_bytes We used to need the root for btrfs_reserve_metadata_bytes to check the orphan cleanup state, but we no longer need that, we simply need the fs_info. Change btrfs_reserve_metadata_bytes() to use the fs_info, and change both btrfs_block_rsv_refill() and btrfs_block_rsv_add() to do the same as they simply call btrfs_reserve_metadata_bytes() and then manipulate the block_rsv that is being used. Reviewed-by: Nikolay Borisov Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 54230013d41fb6eb231755dfec8615db9dcfb020 Author: Josef Bacik Date: Tue Nov 9 10:12:06 2021 -0500 btrfs: get rid of root->orphan_cleanup_state Now that we don't care about the stage of the orphan_cleanup_state, simply replace it with a bit on ->state to make sure we don't call the orphan cleanup every time we wander into this root. Reviewed-by: Nikolay Borisov Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 6dbdd578cd4fcb88ad9e57777a140e3349323e28 Author: Josef Bacik Date: Tue Nov 9 10:12:05 2021 -0500 btrfs: remove global rsv stealing logic for orphan cleanup This is very old code before we were stealing from the global reserve during evict. We have proper ways to steal from the global reserve while we're evicting, so rip out this code as it's no longer necessary. Reviewed-by: Nikolay Borisov Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit ee6adbfd6a2c15a71fb26d9321c97bef09ae0534 Author: Josef Bacik Date: Tue Nov 9 10:12:04 2021 -0500 btrfs: make BTRFS_RESERVE_FLUSH_EVICT use the global rsv stealing code I forgot to convert this over when I introduced the global reserve stealing code to the space flushing code. Evict was simply trying to make its reservation and then if it failed it would steal from the global rsv, which is racey because it's outside of the normal ticketing code. Fix this by setting ticket->steal if we are BTRFS_RESERVE_FLUSH_EVICT, and then make the priority flushing path do the steal for us. Reviewed-by: Nikolay Borisov Signed-off-by: Josef Bacik Signed-off-by: David Sterba commit 1b0309eaa426242e168cf6a51dd707962d81578b Author: Josef Bacik Date: Tue Nov 9 10:12:03 2021 -0500 btrfs: check ticket->steal in steal_from_global_block_rsv We're going to use this helper in the priority flushing loop, move this check into the helper to simplify the logic. Reviewed-by: Nikolay Borisov Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 9cd8dcdc5e5c459bcd01a97c8c8d6bc2c8d73fdf Author: Josef Bacik Date: Tue Nov 9 10:12:02 2021 -0500 btrfs: check for priority ticket granting before flushing Since we're dropping locks before we enter the priority flushing loops we could have had our ticket granted before we got the space_info->lock. So add this check to avoid doing some extra flushing in the priority flushing cases. The case in priority_reclaim_metadata_space is an optimization. Think we came in to reserve, we didn't have the space, we added our ticket to the list. But at the same time somebody was waiting on the space_info lock to add space and do btrfs_try_granting_ticket(), so we drop the lock, get satisfied, come in to do our loop, and we have been satisfied. This is the priority reclaim path, so to_reclaim could be !0 still because we may have only satisfied the priority tickets and still left non priority tickets on the list. We would then have to_reclaim but ->bytes == 0. Reviewed-by: Nikolay Borisov Signed-off-by: Josef Bacik [ add note about the optimization ] Signed-off-by: David Sterba commit 9f35f76d7df66507b698ac7298fb6c175a6aae7d Author: Josef Bacik Date: Tue Nov 9 10:12:01 2021 -0500 btrfs: handle priority ticket failures in their respective helpers Currently the error case for the priority tickets is handled where we deal with all of the tickets, priority and non-priority. This is OK in general, but it makes for some awkward locking. We take and drop the space_info->lock back to back because of these different types of tickets. Rework the code to handle priority ticket failures in their respective helpers. This allows us to be less wonky with our space_info->lock usage, and means that the main handler simply has to check ticket->error, as the ticket is guaranteed to be off any list and completely handled by the time it exits one of the handlers. Reviewed-by: Nikolay Borisov Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 16beac87e95e2fb278b552397c8260637f8a63f7 Author: Naohiro Aota Date: Thu Nov 11 14:14:38 2021 +0900 btrfs: zoned: cache reported zone during mount When mounting a device, we are reporting the zones twice: once for checking the zone attributes in btrfs_get_dev_zone_info and once for loading block groups' zone info in btrfs_load_block_group_zone_info(). With a lot of block groups, that leads to a lot of REPORT ZONE commands and slows down the mount process. This patch introduces a zone info cache in struct btrfs_zoned_device_info. The cache is populated while in btrfs_get_dev_zone_info() and used for btrfs_load_block_group_zone_info() to reduce the number of REPORT ZONE commands. The zone cache is then released after loading the block groups, as it will not be much effective during the run time. Benchmark: Mount an HDD with 57,007 block groups Before patch: 171.368 seconds After patch: 64.064 seconds While it still takes a minute due to the slowness of loading all the block groups, the patch reduces the mount time by 1/3. Link: https://lore.kernel.org/linux-btrfs/CAHQ7scUiLtcTqZOMMY5kbWUBOhGRwKo6J6wYPT5WY+C=cD49nQ@mail.gmail.com/ Fixes: 5b316468983d ("btrfs: get zone information of zoned block devices") CC: stable@vger.kernel.org Signed-off-by: Naohiro Aota Signed-off-by: David Sterba commit d21deec5e7e6f9b02259cff171cbf1e53fb98429 Author: Su Yue Date: Wed Nov 10 14:42:17 2021 +0800 btrfs: remove unused parameter fs_devices from btrfs_init_workqueues Since commit ba8a9d079543 ("Btrfs: delete the entire async bio submission framework") removed submit workqueues, the parameter fs_devices is not used anymore. Remove it, no functional changes. Reviewed-by: Anand Jain Signed-off-by: Su Yue Reviewed-by: David Sterba Signed-off-by: David Sterba commit dfba78dc1c3bd6a61669970cfb61e766322c9231 Author: Filipe Manana Date: Wed Nov 10 10:05:21 2021 +0000 btrfs: reduce the scope of the tree log mutex during transaction commit In the transaction commit path we are acquiring the tree log mutex too early and we have a stale comment because: 1) It mentions a function named btrfs_commit_tree_roots(), which does not exists anymore, it was the old name of commit_cowonly_roots(), renamed a very long time ago by commit 5d4f98a28c7d33 ("Btrfs: Mixed back reference (FORWARD ROLLING FORMAT CHANGE)")); 2) It mentions that we need to acquire the tree log mutex at that point to ensure we have no running log writers. That is not correct anymore, for many years at least, since we are guaranteed that we do not have any log writers at that point simply because we have set the state of the transaction to TRANS_STATE_COMMIT_DOING and have waited for all writers to complete - meaning no one can log until we change the state of the transaction to TRANS_STATE_UNBLOCKED. Any attempts to join the transaction or start a new one will block until we do that state transition; 3) The comment mentions a "trans mutex" which doesn't exists since 2011, commit a4abeea41adf ("Btrfs: kill trans_mutex") removed it; 4) The current use of the tree log mutex is to ensure proper serialization of super block writes - if someone started a new transaction and uses it for logging, it will wait for the previous transaction to write its super block before writing the super block when attempting to sync the log. So acquire the tree log mutex only when it's absolutely needed, before setting the transaction state to TRANS_STATE_UNBLOCKED, fix and move the stale comment, add some assertions and new comments where appropriate. Also, this has no effect on concurrency or performance, since the new start of the critical section is still when the transaction is in the state TRANS_STATE_COMMIT_DOING. Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 849eae5e57a703105aa6cdce0d860ab95f44d81c Author: Anand Jain Date: Tue Nov 9 17:51:58 2021 +0800 btrfs: consolidate device_list_mutex in prepare_sprout to its parent btrfs_prepare_sprout() splices seed devices into its own struct fs_devices, so that its parent function btrfs_init_new_device() can add the new sprout device to fs_info->fs_devices. Both btrfs_prepare_sprout() and btrfs_init_new_device() need device_list_mutex. But they are holding it separately, thus create a small race window. Close it and hold device_list_mutex across both functions btrfs_init_new_device() and btrfs_prepare_sprout(). Split btrfs_prepare_sprout() into btrfs_init_sprout() and btrfs_setup_sprout(). This split is essential because device_list_mutex must not be held for allocations in btrfs_init_sprout() but must be held for btrfs_setup_sprout(). So now a common device_list_mutex can be used between btrfs_init_new_device() and btrfs_setup_sprout(). Reviewed-by: Josef Bacik Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: David Sterba commit fd8808097ad23ad8ae79f002b7b2a62e50f2c7eb Author: Anand Jain Date: Tue Sep 21 12:33:23 2021 +0800 btrfs: switch seeding_dev in init_new_device to bool Declare int seeding_dev as a bool. Also, move its declaration a line below to adjust packing. Reviewed-by: Nikolay Borisov Signed-off-by: Anand Jain Reviewed-by: David Sterba Signed-off-by: David Sterba commit b1dea4e7322d034c02a46d03a0da14ed1872fb6a Author: Omar Sandoval Date: Thu Nov 4 17:00:13 2021 -0700 btrfs: send: remove unused type parameter to iterate_inode_ref_t Again, I don't think this was ever used since iterate_dir_item() is only used for xattrs. No functional change. Reviewed-by: Josef Bacik Reviewed-by: Nikolay Borisov Signed-off-by: Omar Sandoval Reviewed-by: David Sterba Signed-off-by: David Sterba commit eab67c06456850621146465d122e58d64e269cab Author: Omar Sandoval Date: Thu Nov 4 17:00:12 2021 -0700 btrfs: send: remove unused found_type parameter to lookup_dir_item_inode() As far as I can tell, this was never used. No functional change. Reviewed-by: Josef Bacik Reviewed-by: Nikolay Borisov Signed-off-by: Omar Sandoval Reviewed-by: David Sterba Signed-off-by: David Sterba commit dc2e724e0fc070b63fad892389e047909a1de07b Author: Josef Bacik Date: Thu Oct 21 14:58:37 2021 -0400 btrfs: rename btrfs_item_end_nr to btrfs_item_data_end The name btrfs_item_end_nr() is a bit of a misnomer, as it's actually the offset of the end of the data the item points to. In fact all of the helpers that we use btrfs_item_end_nr() use data in their name, like BTRFS_LEAF_DATA_SIZE() and leaf_data(). Rename to btrfs_item_data_end() to make it clear what this helper is giving us. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 5a08663d01c544bc1d0e552d060ccdda20e9103f Author: Josef Bacik Date: Thu Oct 21 14:58:36 2021 -0400 btrfs: remove the btrfs_item_end() helper We're only using btrfs_item_end() from btrfs_item_end_nr(), so this can be collapsed. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 3212fa14e772913b69e85e080678472f8f1aecde Author: Josef Bacik Date: Thu Oct 21 14:58:35 2021 -0400 btrfs: drop the _nr from the item helpers Now that all call sites are using the slot number to modify item values, rename the SETGET helpers to raw_item_*(), and then rework the _nr() helpers to be the btrfs_item_*() btrfs_set_item_*() helpers, and then rename all of the callers to the new helpers. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 747942073608167af3cdbaace2556b13c0cff9f0 Author: Josef Bacik Date: Thu Oct 21 14:58:34 2021 -0400 btrfs: introduce item_nr token variant helpers The last remaining place where we have the pattern of item = btrfs_item_nr(slot) are the token helpers. Handle this by introducing token helpers that will do the btrfs_item_nr() work inside of the helper itself, and then convert all users of the btrfs_item token helpers to the new _nr() variants. Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 437bd07e6c52512f6faf9d3355f34deaa6537ff5 Author: Josef Bacik Date: Thu Oct 21 14:58:33 2021 -0400 btrfs: make btrfs_file_extent_inline_item_len take a slot Instead of getting the btrfs_item for this, simply pass in the slot of the item and then use the btrfs_item_size_nr() helper inside of btrfs_file_extent_inline_item_len(). Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit c91666b1f61915f2b2f2358f922c9d7d44480d0a Author: Josef Bacik Date: Thu Oct 21 14:58:32 2021 -0400 btrfs: add btrfs_set_item_*_nr() helpers We have the pattern of item = btrfs_item_nr(slot); btrfs_set_item_*(leaf, item); in a bunch of places in our code. Fix this by adding btrfs_set_item_*_nr() helpers which will do the appropriate work, and replace those calls with btrfs_set_item_*_nr(leaf, slot); Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit 227f3cd0d5a157c30480e2cd95f4271be1ace7bc Author: Josef Bacik Date: Thu Oct 21 14:58:31 2021 -0400 btrfs: use btrfs_item_size_nr/btrfs_item_offset_nr everywhere We have this pattern in a lot of places item = btrfs_item_nr(slot); btrfs_item_size(leaf, item); when we could simply use btrfs_item_size(leaf, slot); Fix all callers of btrfs_item_size() and btrfs_item_offset() to use the _nr variation of the helpers. Reviewed-by: Qu Wenruo Signed-off-by: Josef Bacik Reviewed-by: David Sterba Signed-off-by: David Sterba commit ccae4a19c9140a34a0c5f0658812496dd8bbdeaf Author: Filipe Manana Date: Mon Oct 25 17:31:54 2021 +0100 btrfs: remove no longer needed logic for replaying directory deletes Now that we log only dir index keys when logging a directory, we no longer need to deal with dir item keys in the log replay code for replaying directory deletes. This is also true for the case when we replay a log tree created by a kernel that still logs dir items. So remove the remaining code of the replay of directory deletes algorithm that deals with dir item keys. Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 339d035424849c89fe29913d07b08b153596bfb8 Author: Filipe Manana Date: Mon Oct 25 17:31:53 2021 +0100 btrfs: only copy dir index keys when logging a directory Currently, when logging a directory, we copy both dir items and dir index items from the fs/subvolume tree to the log tree. Both items have exactly the same data (same struct btrfs_dir_item), the difference lies in the key values, where a dir index key contains the index number of a directory entry while the dir item key does not, as it's used for doing fast lookups of an entry by name, while the former is used for sorting entries when listing a directory. We can exploit that and log only the dir index items, since they contain all the information needed to correctly add, replace and delete directory entries when replaying a log tree. Logging only the dir index items is also backward and forward compatible: an unpatched kernel (without this change) can correctly replay a log tree generated by a patched kernel (with this patch), and a patched kernel can correctly replay a log tree generated by an unpatched kernel. The backward compatibility is ensured because: 1) For inserting a new dentry: a dentry is only inserted when we find a new dir index key - we can only insert if we know the dir index offset, which is encoded in the dir index key's offset; 2) For deleting dentries: during log replay, before adding or replacing dentries, we first replay dentry deletions. Whenever we find a dir item key or a dir index key in the subvolume/fs tree that is not logged in a range for which the log tree is authoritative, we do the unlink of the dentry, which removes both the existing dir item key and the dir index key. Therefore logging just dir index keys is enough to ensure dentry deletions are correctly replayed; 3) For dentry replacements: they work when we log only dir index keys and this is mostly due to a combination of 1) and 2). If we replace a dentry with name "foobar" to point from inode A to inode B, then we know the dir index key for the new dentry is different from the old one, as it has an index number (key offset) larger than the old one. This results in replaying a deletion, through replay_dir_deletes(), that causes the old dentry to be removed, both the dir item key and the dir index key, as mentioned at 2). Then when processing the new dir index key, we add the new dentry, adding both a new dir item key and a new index key pointing to inode B, as stated in 1). The forward compatibility, the ability for a patched kernel to replay a log created by an older, unpatched kernel, comes from the changes required for making sure we are able to replay a log that only contains dir index keys - we simply ignore every dir item key we find. So modify directory logging to log only dir index items, and modify the log replay process to ignore dir item keys, from log trees created by an unpatched kernel, and process only with dir index keys. This reduces the amount of logged metadata by about half, and therefore the time spent logging or fsyncing large directories (less CPU time and less IO). The following test script was used to measure this change: #!/bin/bash DEV=/dev/nvme0n1 MNT=/mnt/nvme0n1 NUM_NEW_FILES=1000000 NUM_FILE_DELETES=10000 mkfs.btrfs -f $DEV mount -o ssd $DEV $MNT mkdir $MNT/testdir for ((i = 1; i <= $NUM_NEW_FILES; i++)); do echo -n > $MNT/testdir/file_$i done start=$(date +%s%N) xfs_io -c "fsync" $MNT/testdir end=$(date +%s%N) dur=$(( (end - start) / 1000000 )) echo "dir fsync took $dur ms after adding $NUM_NEW_FILES files" # sync to force transaction commit and wipeout the log. sync del_inc=$(( $NUM_NEW_FILES / $NUM_FILE_DELETES )) for ((i = 1; i <= $NUM_NEW_FILES; i += $del_inc)); do rm -f $MNT/testdir/file_$i done start=$(date +%s%N) xfs_io -c "fsync" $MNT/testdir end=$(date +%s%N) dur=$(( (end - start) / 1000000 )) echo "dir fsync took $dur ms after deleting $NUM_FILE_DELETES files" echo umount $MNT The tests were run on a physical machine, with a non-debug kernel (Debian's default kernel config), for different values of $NUM_NEW_FILES and $NUM_FILE_DELETES, and the results were the following: ** Before patch, NUM_NEW_FILES = 1 000 000, NUM_DELETE_FILES = 10 000 ** dir fsync took 8412 ms after adding 1000000 files dir fsync took 500 ms after deleting 10000 files ** After patch, NUM_NEW_FILES = 1 000 000, NUM_DELETE_FILES = 10 000 ** dir fsync took 4252 ms after adding 1000000 files (-49.5%) dir fsync took 269 ms after deleting 10000 files (-46.2%) ** Before patch, NUM_NEW_FILES = 100 000, NUM_DELETE_FILES = 1 000 ** dir fsync took 745 ms after adding 100000 files dir fsync took 59 ms after deleting 1000 files ** After patch, NUM_NEW_FILES = 100 000, NUM_DELETE_FILES = 1 000 ** dir fsync took 404 ms after adding 100000 files (-45.8%) dir fsync took 31 ms after deleting 1000 files (-47.5%) ** Before patch, NUM_NEW_FILES = 10 000, NUM_DELETE_FILES = 1 000 ** dir fsync took 67 ms after adding 10000 files dir fsync took 9 ms after deleting 1000 files ** After patch, NUM_NEW_FILES = 10 000, NUM_DELETE_FILES = 1 000 ** dir fsync took 36 ms after adding 10000 files (-46.3%) dir fsync took 5 ms after deleting 1000 files (-44.4%) ** Before patch, NUM_NEW_FILES = 1 000, NUM_DELETE_FILES = 100 ** dir fsync took 9 ms after adding 1000 files dir fsync took 4 ms after deleting 100 files ** After patch, NUM_NEW_FILES = 1 000, NUM_DELETE_FILES = 100 ** dir fsync took 7 ms after adding 1000 files (-22.2%) dir fsync took 3 ms after deleting 100 files (-25.0%) Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 17130a65f0cd71f9c26bec8f0f097fc61013b6f8 Author: Nikolay Borisov Date: Thu Oct 14 10:03:11 2021 +0300 btrfs: remove spurious unlock/lock of unused_bgs_lock Since both unused block groups and reclaim bgs lists are protected by unused_bgs_lock then free them in the same critical section without doing an extra unlock/lock pair. Reviewed-by: Josef Bacik Signed-off-by: Nikolay Borisov Reviewed-by: David Sterba Signed-off-by: David Sterba commit 232796df8c1437c41d308d161007f0715bac0a54 Author: Filipe Manana Date: Wed Oct 27 18:30:25 2021 +0100 btrfs: fix deadlock between quota enable and other quota operations When enabling quotas, we attempt to commit a transaction while holding the mutex fs_info->qgroup_ioctl_lock. This can result on a deadlock with other quota operations such as: - qgroup creation and deletion, ioctl BTRFS_IOC_QGROUP_CREATE; - adding and removing qgroup relations, ioctl BTRFS_IOC_QGROUP_ASSIGN. This is because these operations join a transaction and after that they attempt to lock the mutex fs_info->qgroup_ioctl_lock. Acquiring that mutex after joining or starting a transaction is a pattern followed everywhere in qgroups, so the quota enablement operation is the one at fault here, and should not commit a transaction while holding that mutex. Fix this by making the transaction commit while not holding the mutex. We are safe from two concurrent tasks trying to enable quotas because we are serialized by the rw semaphore fs_info->subvol_sem at btrfs_ioctl_quota_ctl(), which is the only call site for enabling quotas. When this deadlock happens, it produces a trace like the following: INFO: task syz-executor:25604 blocked for more than 143 seconds. Not tainted 5.15.0-rc6 #4 "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. task:syz-executor state:D stack:24800 pid:25604 ppid: 24873 flags:0x00004004 Call Trace: context_switch kernel/sched/core.c:4940 [inline] __schedule+0xcd9/0x2530 kernel/sched/core.c:6287 schedule+0xd3/0x270 kernel/sched/core.c:6366 btrfs_commit_transaction+0x994/0x2e90 fs/btrfs/transaction.c:2201 btrfs_quota_enable+0x95c/0x1790 fs/btrfs/qgroup.c:1120 btrfs_ioctl_quota_ctl fs/btrfs/ioctl.c:4229 [inline] btrfs_ioctl+0x637e/0x7b70 fs/btrfs/ioctl.c:5010 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:874 [inline] __se_sys_ioctl fs/ioctl.c:860 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:860 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f86920b2c4d RSP: 002b:00007f868f61ac58 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f86921d90a0 RCX: 00007f86920b2c4d RDX: 0000000020005e40 RSI: 00000000c0109428 RDI: 0000000000000008 RBP: 00007f869212bd80 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f86921d90a0 R13: 00007fff6d233e4f R14: 00007fff6d233ff0 R15: 00007f868f61adc0 INFO: task syz-executor:25628 blocked for more than 143 seconds. Not tainted 5.15.0-rc6 #4 "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. task:syz-executor state:D stack:29080 pid:25628 ppid: 24873 flags:0x00004004 Call Trace: context_switch kernel/sched/core.c:4940 [inline] __schedule+0xcd9/0x2530 kernel/sched/core.c:6287 schedule+0xd3/0x270 kernel/sched/core.c:6366 schedule_preempt_disabled+0xf/0x20 kernel/sched/core.c:6425 __mutex_lock_common kernel/locking/mutex.c:669 [inline] __mutex_lock+0xc96/0x1680 kernel/locking/mutex.c:729 btrfs_remove_qgroup+0xb7/0x7d0 fs/btrfs/qgroup.c:1548 btrfs_ioctl_qgroup_create fs/btrfs/ioctl.c:4333 [inline] btrfs_ioctl+0x683c/0x7b70 fs/btrfs/ioctl.c:5014 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:874 [inline] __se_sys_ioctl fs/ioctl.c:860 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:860 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Reported-by: Hao Sun Link: https://lore.kernel.org/linux-btrfs/CACkBjsZQF19bQ1C6=yetF3BvL10OSORpFUcWXTP6HErshDB4dQ@mail.gmail.com/ Fixes: 340f1aa27f36 ("btrfs: qgroups: Move transaction management inside btrfs_quota_enable/disable") CC: stable@vger.kernel.org # 4.19 Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit f0bfa76a11e93d0fe2c896fcb566568c5e8b5d3f Author: Filipe Manana Date: Thu Oct 28 16:03:41 2021 +0100 btrfs: fix ENOSPC failure when attempting direct IO write into NOCOW range When doing a direct IO write against a file range that either has preallocated extents in that range or has regular extents and the file has the NOCOW attribute set, the write fails with -ENOSPC when all of the following conditions are met: 1) There are no data blocks groups with enough free space matching the size of the write; 2) There's not enough unallocated space for allocating a new data block group; 3) The extents in the target file range are not shared, neither through snapshots nor through reflinks. This is wrong because a NOCOW write can be done in such case, and in fact it's possible to do it using a buffered IO write, since when failing to allocate data space, the buffered IO path checks if a NOCOW write is possible. The failure in direct IO write path comes from the fact that early on, at btrfs_dio_iomap_begin(), we try to allocate data space for the write and if it that fails we return the error and stop - we never check if we can do NOCOW. But later, at btrfs_get_blocks_direct_write(), we check if we can do a NOCOW write into the range, or a subset of the range, and then release the previously reserved data space. Fix this by doing the data reservation only if needed, when we must COW, at btrfs_get_blocks_direct_write() instead of doing it at btrfs_dio_iomap_begin(). This also simplifies a bit the logic and removes the inneficiency of doing unnecessary data reservations. The following example test script reproduces the problem: $ cat dio-nocow-enospc.sh #!/bin/bash DEV=/dev/sdj MNT=/mnt/sdj # Use a small fixed size (1G) filesystem so that it's quick to fill # it up. # Make sure the mixed block groups feature is not enabled because we # later want to not have more space available for allocating data # extents but still have enough metadata space free for the file writes. mkfs.btrfs -f -b $((1024 * 1024 * 1024)) -O ^mixed-bg $DEV mount $DEV $MNT # Create our test file with the NOCOW attribute set. touch $MNT/foobar chattr +C $MNT/foobar # Now fill in all unallocated space with data for our test file. # This will allocate a data block group that will be full and leave # no (or a very small amount of) unallocated space in the device, so # that it will not be possible to allocate a new block group later. echo echo "Creating test file with initial data..." xfs_io -c "pwrite -S 0xab -b 1M 0 900M" $MNT/foobar # Now try a direct IO write against file range [0, 10M[. # This should succeed since this is a NOCOW file and an extent for the # range was previously allocated. echo echo "Trying direct IO write over allocated space..." xfs_io -d -c "pwrite -S 0xcd -b 10M 0 10M" $MNT/foobar umount $MNT When running the test: $ ./dio-nocow-enospc.sh (...) Creating test file with initial data... wrote 943718400/943718400 bytes at offset 0 900 MiB, 900 ops; 0:00:01.43 (625.526 MiB/sec and 625.5265 ops/sec) Trying direct IO write over allocated space... pwrite: No space left on device A test case for fstests will follow, testing both this direct IO write scenario as well as the buffered IO write scenario to make it less likely to get future regressions on the buffered IO case. Reviewed-by: Josef Bacik Signed-off-by: Filipe Manana Signed-off-by: David Sterba commit 0f663729bb4afc92a9986b66131ebd5b8a9254d1 Author: Alan Stern Date: Sat Jan 1 14:52:14 2022 -0500 USB: core: Fix bug in resuming hub's handling of wakeup requests Bugzilla #213839 reports a 7-port hub that doesn't work properly when devices are plugged into some of the ports; the kernel goes into an unending disconnect/reinitialize loop as shown in the bug report. This "7-port hub" comprises two four-port hubs with one plugged into the other; the failures occur when a device is plugged into one of the downstream hub's ports. (These hubs have other problems too. For example, they bill themselves as USB-2.0 compliant but they only run at full speed.) It turns out that the failures are caused by bugs in both the kernel and the hub. The hub's bug is that it reports a different bmAttributes value in its configuration descriptor following a remote wakeup (0xe0 before, 0xc0 after -- the wakeup-support bit has changed). The kernel's bug is inside the hub driver's resume handler. When hub_activate() sees that one of the hub's downstream ports got a wakeup request from a child device, it notes this fact by setting the corresponding bit in the hub->change_bits variable. But this variable is meant for connection changes, not wakeup events; setting it causes the driver to believe the downstream port has been disconnected and then connected again (in addition to having received a wakeup request). Because of this, the hub driver then tries to check whether the device currently plugged into the downstream port is the same as the device that had been attached there before. Normally this check succeeds and wakeup handling continues with no harm done (which is why the bug remained undetected until now). But with these dodgy hubs, the check fails because the config descriptor has changed. This causes the hub driver to reinitialize the child device, leading to the disconnect/reinitialize loop described in the bug report. The proper way to note reception of a downstream wakeup request is to set a bit in the hub->event_bits variable instead of hub->change_bits. That way the hub driver will realize that something has happened to the port but will not think the port and child device have been disconnected. This patch makes that change. Cc: Tested-by: Jonathan McDowell Signed-off-by: Alan Stern Link: https://lore.kernel.org/r/YdCw7nSfWYPKWQoD@rowland.harvard.edu Signed-off-by: Greg Kroah-Hartman commit 1d7d4c07932e04355d6e6528d44a2f2c9e354346 Author: Alan Stern Date: Fri Dec 31 21:07:12 2021 -0500 USB: Fix "slab-out-of-bounds Write" bug in usb_hcd_poll_rh_status When the USB core code for getting root-hub status reports was originally written, it was assumed that the hub driver would be its only caller. But this isn't true now; user programs can use usbfs to communicate with root hubs and get status reports. When they do this, they may use a transfer_buffer that is smaller than the data returned by the HCD, which will lead to a buffer overflow error when usb_hcd_poll_rh_status() tries to store the status data. This was discovered by syzbot: BUG: KASAN: slab-out-of-bounds in memcpy include/linux/fortify-string.h:225 [inline] BUG: KASAN: slab-out-of-bounds in usb_hcd_poll_rh_status+0x5f4/0x780 drivers/usb/core/hcd.c:776 Write of size 2 at addr ffff88801da403c0 by task syz-executor133/4062 This patch fixes the bug by reducing the amount of status data if it won't fit in the transfer_buffer. If some data gets discarded then the URB's completion status is set to -EOVERFLOW rather than 0, to let the user know what happened. Reported-and-tested-by: syzbot+3ae6a2b06f131ab9849f@syzkaller.appspotmail.com Signed-off-by: Alan Stern Cc: Link: https://lore.kernel.org/r/Yc+3UIQJ2STbxNua@rowland.harvard.edu Signed-off-by: Greg Kroah-Hartman commit fa0ef93868a6062babe1144df2807a8b1d4924d2 Author: Miaoqian Lin Date: Fri Dec 31 11:36:41 2021 +0000 usb: dwc3: dwc3-qcom: Add missing platform_device_put() in dwc3_qcom_acpi_register_core Add the missing platform_device_put() before return from dwc3_qcom_acpi_register_core in the error handling case. Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20211231113641.31474-1-linmq006@gmail.com Signed-off-by: Greg Kroah-Hartman commit 501e38a5531efbd77d5c73c0ba838a889bfc1d74 Author: Hangyu Hua Date: Sat Jan 1 01:21:38 2022 +0800 usb: gadget: clear related members when goto fail dev->config and dev->hs_config and dev->dev need to be cleaned if dev_config fails to avoid UAF. Acked-by: Alan Stern Signed-off-by: Hangyu Hua Link: https://lore.kernel.org/r/20211231172138.7993-3-hbh25y@gmail.com Signed-off-by: Greg Kroah-Hartman commit 89f3594d0de58e8a57d92d497dea9fee3d4b9cda Author: Hangyu Hua Date: Sat Jan 1 01:21:37 2022 +0800 usb: gadget: don't release an existing dev->buf dev->buf does not need to be released if it already exists before executing dev_config. Acked-by: Alan Stern Signed-off-by: Hangyu Hua Link: https://lore.kernel.org/r/20211231172138.7993-2-hbh25y@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0640d18b15d86ab76275e63f36f5841db5f52e74 Author: Alberto Merciai Date: Mon Jan 3 12:56:25 2022 +0100 staging: r8188eu: add spaces around P2P_AP_P2P_CH_SWITCH_PROCESS_WK Remove checkpatch.pl error by adding spaces around P2P_AP_P2P_CH_SWITCH_PROCESS_WK. Signed-off-by: Alberto Merciai Link: https://lore.kernel.org/r/20220103115633.221853-1-alb3rt0.m3rciai@gmail.com Signed-off-by: Greg Kroah-Hartman commit 51edf56ea9df14babeadfc92897e85fdd5143508 Author: Martin Kaiser Date: Sun Jan 2 18:59:32 2022 +0100 staging: r8188eu: turbo scan is always off for r8188eu Turbo scan is always disabled. Remove the TurboScanOff variable and related checks. Acked-by: Michael Straube Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220102175932.89127-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 0d6bd7b2deedf44c0386162285a0ea79cae45c0d Author: Martin Kaiser Date: Sun Jan 2 18:59:31 2022 +0100 staging: r8188eu: cmd_issued_cnt is set but not used cmd_issued_cnt in struct cmd_priv is set but not used. It can be removed. Acked-by: Michael Straube Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220102175932.89127-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 89e32f6db9840eea19dfe43c1fc35959086557a8 Author: Martin Kaiser Date: Sun Jan 2 18:59:30 2022 +0100 staging: r8188eu: fix_rate is set but not used. fix_rate in struct adapter is set but not used. Remove the variable and the private ioctl code to set it. Acked-by: Michael Straube Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220102175932.89127-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit fdf101f5cefcbe85d2217057a0b16980a2769dbb Author: Martin Kaiser Date: Sun Jan 2 18:59:29 2022 +0100 staging: r8188eu: internal autosuspend is always false bInternalAutoSuspend is always false. Remove the variable and related checks. Acked-by: Michael Straube Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220102175932.89127-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 881bc5e02f401fce141046ab3fb4c884ab79a97c Author: Martin Kaiser Date: Sun Jan 2 18:59:28 2022 +0100 staging: r8188eu: remove unused power management defines Remove unused defines from enum power_mgnt. Acked-by: Michael Straube Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20220102175932.89127-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit c8f15f0e9d9cc49812d05e04d431cb9b448a0539 Author: Michael Straube Date: Sun Jan 2 14:11:41 2022 +0100 staging: r8188eu: remove unused defines from rtw_eeprom.h Remove unused defines from rtw_eeprom.h. Acked-by: Martin Kaiser Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220102131141.12310-12-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 403a5e8554c833bcb31feefec81c7034cfaabde3 Author: Michael Straube Date: Sun Jan 2 14:11:40 2022 +0100 staging: r8188eu: remove unused defines from Hal8188EPhyCfg.h Remove unused defines from Hal8188EPhyCfg.h. Acked-by: Martin Kaiser Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220102131141.12310-11-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 69a3a726adcf8986255b486fcdeb82d44cecd694 Author: Michael Straube Date: Sun Jan 2 14:11:39 2022 +0100 staging: r8188eu: remove unneeded comments from Hal8188EPhyCfg.h Remove unneeded comments from Hal8188EPhyCfg.h. Acked-by: Martin Kaiser Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220102131141.12310-10-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 44742d88819fd49d020be1afb1e75793d1605275 Author: Michael Straube Date: Sun Jan 2 14:11:38 2022 +0100 staging: r8188eu: enum hw90_block is not used The enumeration hw90_block is not used. Remove it. Acked-by: Martin Kaiser Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220102131141.12310-9-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6e5499917bf2bfccdeb1f5d993aab19a77bf61dc Author: Michael Straube Date: Sun Jan 2 14:11:37 2022 +0100 staging: r8188eu: struct odm_sta_info is not used The structure odm_sta_info is not used. Remove it. Acked-by: Martin Kaiser Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220102131141.12310-8-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit d23d390a5c7545dc0233ae48e3a35053cfa8a52b Author: Michael Straube Date: Sun Jan 2 14:11:36 2022 +0100 staging: r8188eu: clean up struct sw_ant_switch Remove unused fields from struct sw_ant_switch. Acked-by: Martin Kaiser Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220102131141.12310-7-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 4b224bcbcafd99edb031712e010800edc5a30110 Author: Michael Straube Date: Sun Jan 2 14:11:35 2022 +0100 staging: r8188eu: clean up struct rtw_dig Remove unused and set but never used fields from struct rtw_dig. Acked-by: Martin Kaiser Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220102131141.12310-6-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 73157fe89f4e4d683ab8338f72b02cd7e4b144b4 Author: Michael Straube Date: Sun Jan 2 14:11:34 2022 +0100 staging: r8188eu: struct rx_hpc is not used The structure rx_hpc is not used. Remove it. Acked-by: Martin Kaiser Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220102131141.12310-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6de349e6800c52e758ad5715de99c22ec7f11f19 Author: Michael Straube Date: Sun Jan 2 14:11:33 2022 +0100 staging: r8188eu: remove unused enum and defines Remove the unused enum rf90_radio_path and some unused defines. Acked-by: Martin Kaiser Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220102131141.12310-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit e174a4349438afb276a817b564296d2dd61c90a7 Author: Michael Straube Date: Sun Jan 2 14:11:32 2022 +0100 staging: r8188eu: remove struct rt_channel_plan_2g The structures rt_channel_plan and rt_channel_plan_2g are identical. Keep rt_channel_plan and remove rt_channel_plan_2g. Acked-by: Martin Kaiser Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220102131141.12310-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7e8785d5e40bcf9fbb17cd8eedb94017882c4891 Author: Michael Straube Date: Sun Jan 2 14:11:31 2022 +0100 staging: r8188eu: remove MAX_CHANNEL_NUM_2G The constants MAX_CHANNEL_NUM_2G and MAX_CHANNEL_NUM have the same value. Remove MAX_CHANNEL_NUM_2G and fix the place where it is used. Acked-by: Martin Kaiser Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220102131141.12310-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 65935347844eba55c2182edac668090ad5b184c9 Author: Michael Straube Date: Sat Jan 1 09:49:37 2022 +0100 staging: r8188eu: FwRsvdPageStartOffset is set but never used The field FwRsvdPageStartOffset of struct hal_data_8188e is set but never used. Remove it. Acked-by: Martin Kaiser Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220101084937.3411-8-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 4483319375f3faba3830ce36426cf81fe6eb8b9b Author: Michael Straube Date: Sat Jan 1 09:49:36 2022 +0100 staging: r8188eu: IntArray and C2hArray are set but never used The fields IntArray and C2hArray of struct hal_data_8188e are set but never used. Remove them and remove interrupt_handler_8188eu() since it does nothing now. While at it, remove the unsed defines USB_INTR_CONTENT_CPWM1_OFFSET and USB_INTR_CONTENT_CPWM2_OFFSET as well. Acked-by: Martin Kaiser Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220101084937.3411-7-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit f606b319ef4d24c072e74ca7e9eb6dfd63bf4282 Author: Michael Straube Date: Sat Jan 1 09:49:35 2022 +0100 staging: r8188eu: remove unused fields from struct hal_data_8188e Remove unused fields from struct hal_data_8188e. Acked-by: Martin Kaiser Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220101084937.3411-6-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit cfd060fe2edb8b752f99af249097a2c701101102 Author: Michael Straube Date: Sat Jan 1 09:49:34 2022 +0100 staging: r8188eu: bAPKThermalMeterIgnore is set but never used The field bAPKThermalMeterIgnore of struct hal_data_8188e is set but never used. Remove it. Acked-by: Martin Kaiser Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220101084937.3411-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit a056e41a0928cd7382ff644575c90eba586ff952 Author: Michael Straube Date: Sat Jan 1 09:49:33 2022 +0100 staging: r8188eu: bTXPowerDataReadFromEEPORM is set but never used The field bTXPowerDataReadFromEEPORM of struct hal_data_8188e is set but never used. Remove it. Acked-by: Martin Kaiser Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220101084937.3411-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit ffcdb1b194ec77a53b4693977dc68e6009d7963d Author: Michael Straube Date: Sat Jan 1 09:49:32 2022 +0100 staging: r8188eu: UsbRxHighSpeedMode is set but never used The field UsbRxHighSpeedMode of struct hal_data_8188e is set but never used. Remove it. Acked-by: Martin Kaiser Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220101084937.3411-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit b376bd63774b7a5cf02f503369b429fa3a1ee6cc Author: Michael Straube Date: Sat Jan 1 09:49:31 2022 +0100 staging: r8188eu: bRDGEnable is always false The field bRDGEnable in struct hal_data_8188e is never set. It stays at its default value 0. Remove bRDGEnable and related dead code. Acked-by: Martin Kaiser Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20220101084937.3411-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit a0c43a469239ab6fedaaa101b15bc6cc9e8baa1d Author: Paulo Miguel Almeida Date: Fri Dec 31 13:19:33 2021 +1300 staging: pi433: add docs to packet_format and tx_start_condition enum While pi433 driver deals with the nuances of the different possible config combinations, it's hard (at first) to understand the rationale for some of the tx/rx-related source code unless you're fairly familiar with the rf69's inner workings. This patch documents the expected behaviour and limits of both packet_format and tx_start_condition enum fields. Signed-off-by: Paulo Miguel Almeida Link: https://lore.kernel.org/r/20211231001933.GA6779@mail.google.com Signed-off-by: Greg Kroah-Hartman commit 8f2cade5da97713e77ca5be576438f194b8873d7 Author: Aswath Govindraju Date: Sun Jan 2 23:38:18 2022 +0100 dt-bindings: mux: Document mux-states property In some cases, it is required to provide the state to which the mux controller has to be set to, from the consumer device tree node. Document the property mux-states that can be used for adding this support. Signed-off-by: Aswath Govindraju Reviewed-by: Rob Herring Signed-off-by: Peter Rosin Link: https://lore.kernel.org/r/f4d02ac8-23ee-d891-4056-75c672cc59c9@axentia.se Signed-off-by: Greg Kroah-Hartman commit 04ce4a6b9b7b84eb6be7b544d3d0e748b6837764 Author: Aswath Govindraju Date: Sun Jan 2 23:38:12 2022 +0100 dt-bindings: ti-serdes-mux: Add defines for J721S2 SoC There are 4 lanes in the single instance of J721S2 SERDES. Each SERDES lane mux can select upto 4 different IPs. Define all the possible functions. Signed-off-by: Aswath Govindraju Acked-by: Rob Herring Signed-off-by: Peter Rosin Link: https://lore.kernel.org/r/0571fd6b-ec4d-71b3-5cf7-6fa48ed5592c@axentia.se Signed-off-by: Greg Kroah-Hartman commit 824adf37ee9ddf3ecba1bc245507bc5953dda268 Merge: f2ee4759fb700 c9e6606c7fe92 Author: Greg Kroah-Hartman Date: Mon Jan 3 13:44:38 2022 +0100 Merge 5.16-rc8 into char-misc-next We need the fixes in here as well for testing. Signed-off-by: Greg Kroah-Hartman commit e0d07ba76bd1b074505e4b3b32fe45c3b5d087bd Merge: e681a9d2050cd fa487b2a900d7 Author: Greg Kroah-Hartman Date: Mon Jan 3 13:21:58 2022 +0100 Merge tag 'thunderbolt-for-v5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt into usb-next Mika writes: thunderbolt: Changes for v5.17 merge window This includes following Thunderbolt/USB4 changes for the v5.17 merge window: * Enable low-power link state (CL0s) for USB4 and Intel Titan Ridge devices * Add support for TMU (Time Management Unit) uni-directional mode * Power management improvements (suspend-to-disk, runtime PM) * USB4 compatibility fixes * Minor fixes and cleanups. All these have been in linux-next with no reported issues. * tag 'thunderbolt-for-v5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt: thunderbolt: Add module parameter for CLx disabling thunderbolt: Enable CL0s for Intel Titan Ridge thunderbolt: Rename Intel TB_VSE_CAP_IECS capability thunderbolt: Implement TMU time disruption for Intel Titan Ridge thunderbolt: Move usb4_switch_wait_for_bit() to switch.c thunderbolt: Add CL0s support for USB4 routers thunderbolt: Add TMU uni-directional mode thunderbolt: Check return value of kmemdup() in icm_handle_event() thunderbolt: Do not dereference fwnode in struct device thunderbolt: Add debug logging of DisplayPort resource allocation thunderbolt: Do not program path HopIDs for USB4 routers thunderbolt: Do not allow subtracting more NFC credits than configured thunderbolt: Runtime resume USB4 port when retimers are scanned thunderbolt: Tear down existing tunnels when resuming from hibernate thunderbolt: Runtime PM activate both ends of the device link thunderbolt: xdomain: Avoid potential stack OOB read commit 105a8c525675bb7d4d64871f9b2edf39460de881 Author: Kunihiko Hayashi Date: Tue Dec 14 13:42:43 2021 +0900 dmaengine: uniphier-xdmac: Fix type of address variables The variables src_addr and dst_addr handle DMA addresses, so these should be declared as dma_addr_t. Fixes: 667b9251440b ("dmaengine: uniphier-xdmac: Add UniPhier external DMA controller driver") Signed-off-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/1639456963-10232-1-git-send-email-hayashi.kunihiko@socionext.com Signed-off-by: Vinod Koul commit e681a9d2050cdcaf24adeabc9f1aea6cff94be22 Merge: db3e8244bd1c4 c9e6606c7fe92 Author: Greg Kroah-Hartman Date: Mon Jan 3 13:02:29 2022 +0100 Merge 5.16-rc8 into usb-next We need the USB fixes in here as well. Signed-off-by: Greg Kroah-Hartman commit 22bf4047d26980807611b7e2030803db375afd87 Author: Alexander Stein Date: Thu Dec 23 13:24:32 2021 +0100 dt-bindings: display: meson-dw-hdmi: add missing sound-name-prefix property This is used in meson-gx and meson-g12. Add the property to the binding. This fixes the dtschema warning: hdmi-tx@c883a000: 'sound-name-prefix' does not match any of the regexes: 'pinctrl-[0-9]+' Signed-off-by: Alexander Stein Fixes: 376bf52deef5 ("dt-bindings: display: amlogic, meson-dw-hdmi: convert to yaml") Acked-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20211223122434.39378-2-alexander.stein@mailbox.org commit e66d70c034dbdfe1a48863f0865ac86aaf2fef1a Author: Vinod Koul Date: Mon Dec 13 10:51:41 2021 +0530 dmaengine: xilinx_dpdma: use correct SDPX tag for header file Commit 188c310bdd5d ("dmaengine: xilinx_dpdma: stop using slave_id field") add the header file with incorrect format for SPDX tag, fix that WARNING: Improper SPDX comment style for 'include/linux/dma/xilinx_dpdma.h', please use '/*' instead #1: FILE: include/linux/dma/xilinx_dpdma.h:1: +// SPDX-License-Identifier: GPL-2.0 WARNING: Missing or malformed SPDX-License-Identifier tag in line 1 #1: FILE: include/linux/dma/xilinx_dpdma.h:1: +// SPDX-License-Identifier: GPL-2.0 Fixes: 188c310bdd5d ("dmaengine: xilinx_dpdma: stop using slave_id field") Signed-off-by: Vinod Koul Link: https://lore.kernel.org/r/20211213052141.850807-1-vkoul@kernel.org Signed-off-by: Vinod Koul commit 29f306340fa896e1edd9473cd7956f34c52f40ab Author: Rob Herring Date: Fri Dec 17 11:06:43 2021 -0600 dt-bindings: dma: pl330: Convert to DT schema Convert the Arm PL330 DMA controller binding to DT schema. The '#dma-channels' and '#dma-requests' properties are unused as they are discoverable and are non-standard (the standard props don't have '#'). So drop them from the binding. Cc: Vinod Koul Cc: dmaengine@vger.kernel.org Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211217170644.3145332-1-robh@kernel.org Signed-off-by: Vinod Koul commit e7f110889a87307fb0fed408a5dee1707796ca04 Author: Amelie Delaunay Date: Mon Dec 20 17:58:27 2021 +0100 dmaengine: stm32-mdma: fix STM32_MDMA_CTBR_TSEL_MASK This patch fixes STM32_MDMA_CTBR_TSEL_MASK, which is [5:0], not [7:0]. Fixes: a4ffb13c8946 ("dmaengine: Add STM32 MDMA driver") Signed-off-by: Amelie Delaunay Link: https://lore.kernel.org/r/20211220165827.1238097-1-amelie.delaunay@foss.st.com Signed-off-by: Vinod Koul commit 2fe6777b8d4967f88d00c315dda11db180262811 Author: Yoshihiro Shimoda Date: Wed Dec 22 20:45:07 2021 +0900 dmaengine: rcar-dmac: Add support for R-Car S4-8 Add support for R-Car S4-8. We can reuse R-Car V3U code so that renames variable names as "gen4". Note that some registers of R-Car V3U do not exist on R-Car S4-8, but none of them are used by the driver for now. Signed-off-by: Yoshihiro Shimoda Reviewed-by: Ulrich Hecht Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20211222114507.1252947-3-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Vinod Koul commit 401c151164f20f71b5d6a0bc8ff6abe7e180a535 Author: Yoshihiro Shimoda Date: Wed Dec 22 20:45:06 2021 +0900 dt-bindings: renesas,rcar-dmac: Add r8a779f0 support Document the compatible value for the Direct Memory Access Controller blocks in the Renesas R-Car S4-8 (R8A779F0) SoC. The most visible difference with DMAC blocks on other R-Car SoCs (except R8A779A0) is the move of the per-channel registers to a separate register block. Signed-off-by: Yoshihiro Shimoda Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20211222114507.1252947-2-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Vinod Koul commit 640f35b871d29cd685ce0ea0762636381beeb98a Author: Alexander Stein Date: Sun Dec 19 10:41:55 2021 +0100 dt-bindings: display: meson-vpu: Add missing amlogic,canvas property This property was already mentioned in the old textual bindings amlogic,meson-vpu.txt, but got dropped during conversion. Adding it back similar to amlogic,gx-vdec.yaml. Fixes: 6b9ebf1e0e67 ("dt-bindings: display: amlogic, meson-vpu: convert to yaml") Signed-off-by: Alexander Stein Acked-by: Rob Herring Reviewed-by: Neil Armstrong Reviewed-by: Martin Blumenstingl Signed-off-by: Neil Armstrong Link: https://patchwork.freedesktop.org/patch/msgid/20211219094155.177206-1-alexander.stein@mailbox.org commit 3d694552fd8fe502e7ffd22ffa0e085bfd73b19a Author: Christophe JAILLET Date: Sun Jan 2 22:07:05 2022 +0100 net: vxge: Use dma_set_mask_and_coherent() and simplify code Use dma_set_mask_and_coherent() instead of unrolling it with some dma_set_mask()+dma_set_coherent_mask(). Moreover, as stated in [1], dma_set_mask() with a 64-bit mask will never fail if dev->dma_mask is non-NULL. So, if it fails, the 32 bits case will also fail for the same reason. That said, 'high_dma' can only be 1 after a successful dma_set_mask_and_coherent(). Simplify code and remove some dead code accordingly, including a now useless parameter to vxge_device_register(). [1]: https://lkml.org/lkml/2021/6/7/398 Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller commit 7120075ec41aed3bf377df7924d213f1c43f7462 Author: Christophe JAILLET Date: Sun Jan 2 21:27:39 2022 +0100 ethernet: s2io: Use dma_set_mask_and_coherent() and simplify code Use dma_set_mask_and_coherent() instead of unrolling it with some dma_set_mask()+dma_set_coherent_mask(). Moreover, as stated in [1], dma_set_mask() with a 64-bit mask will never fail if dev->dma_mask is non-NULL. So, if it fails, the 32 bits case will also fail for the same reason. That said, 'dma_flag' can only be 'true' after a successful dma_set_mask_and_coherent(). Simplify code and remove some dead code accordingly, including the now useless 'high_dma_flag' field in 'struct s2io_nic'. [1]: https://lkml.org/lkml/2021/6/7/398 Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller commit 6bf950a8ff72920340dfdec93c18bd3f5f35de6a Author: Saeed Mahameed Date: Sun Jan 2 14:11:26 2022 -0800 net: vertexcom: default to disabled on kbuild Sorry for being rude but new vendors/drivers are supposed to be disabled by default, otherwise we will have to manually keep track of all vendors we are not interested in building. Fixes: 2f207cbf0dd4 ("net: vertexcom: Add MSE102x SPI support") CC: Stefan Wahren Signed-off-by: Saeed Mahameed Signed-off-by: David S. Miller commit 80f60eba9ceea670092f599a6c90ca2cd7794004 Author: Andy Shevchenko Date: Thu Dec 23 12:38:09 2021 +0200 gpio: dwapb: Switch to use fwnode instead of of_node GPIO library now accepts fwnode as a firmware node, so switch the driver to use it and hence rectify the ACPI case which uses software nodes. Note, in this case it's rather logical fix that doesn't affect functionality, thus no backporting required. Signed-off-by: Andy Shevchenko Acked-by: Serge Semin Signed-off-by: Bartosz Golaszewski commit 4a08d63c243ae8525c40016ce57b50df515fafaf Author: Andy Shevchenko Date: Thu Dec 23 12:38:08 2021 +0200 gpiolib: acpi: make fwnode take precedence in struct gpio_chip If the driver sets the fwnode in struct gpio_chip, let it take precedence over the parent's fwnode. This is a follow up to the commit 9126a738edc1 ("gpiolib: of: make fwnode take precedence in struct gpio_chip"). Signed-off-by: Andy Shevchenko Reviewed-by: Mika Westerberg Signed-off-by: Bartosz Golaszewski commit 0f7b1d1a5998c469347b0c13ef929cd8b5c71166 Author: Krzysztof Kozlowski Date: Sun Jan 2 16:56:53 2022 +0100 dt-bindings: gpio: samsung: drop unused bindings The commit 6c56c6cd8031 ("gpio: samsung: Drop support for Exynos SoCs") removed support for the Samsung Exynos SoC in lrgacy GPIO driver, since it was moved to new pinctrl driver. Remove old, unused bindings. Signed-off-by: Krzysztof Kozlowski Signed-off-by: Bartosz Golaszewski commit 01d130a31adeeee09fb27294751e2adad2100c50 Author: Christophe JAILLET Date: Sun Dec 26 15:19:38 2021 +0100 gpio: max3191x: Use bitmap_free() to free bitmap kfree() and bitmap_free() are the same. But using the later is more consistent when freeing memory allocated with bitmap_alloc(). Signed-off-by: Christophe JAILLET Signed-off-by: Bartosz Golaszewski commit 8ab1ff9b1ec819bf431cf6c370ba3d9f8c8a108b Author: Lad Prabhakar Date: Tue Dec 21 17:53:22 2021 +0000 i2c: riic: Use platform_get_irq() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Signed-off-by: Lad Prabhakar Reviewed-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Signed-off-by: Wolfram Sang commit aab799e44ce3953ac56c42721742c9cd9208b2f4 Author: Lad Prabhakar Date: Tue Dec 21 17:53:21 2021 +0000 i2c: sh_mobile: Use platform_get_irq_optional() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq_optional() for DT users only. Signed-off-by: Lad Prabhakar Reviewed-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Tested-by: Wolfram Sang Signed-off-by: Wolfram Sang commit c3b2f911ac11892b672df7829becf28d3a830073 Author: Lad Prabhakar Date: Tue Dec 21 17:53:20 2021 +0000 i2c: bcm2835: Use platform_get_irq() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Signed-off-by: Lad Prabhakar Reviewed-by: Florian Fainelli Signed-off-by: Wolfram Sang commit 183eea2ee5ba968ca7c31f04a0f01fd3e5c1d014 Author: Shyam Prasad N Date: Mon Jul 19 14:14:46 2021 +0000 cifs: reconnect only the connection and not smb session where possible With the new per-channel bitmask for reconnect, we have an option to reconnect the tcp session associated with the channel without reconnecting the smb session. i.e. if there are still channels to operate on, we can continue to use the smb session and tcon. However, there are cases where it makes sense to reconnect the smb session even when there are active channels underneath. For example for SMB session expiry. With this patch, we'll have an option to do either, and use the correct option for specific cases. Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit 2e0fa298d149e07005504350358066f380f72b52 Author: Shyam Prasad N Date: Mon Jul 19 14:04:11 2021 +0000 cifs: add WARN_ON for when chan_count goes below minimum chan_count keeps track of the total number of channels. Since at least the primary channel will always be connected, this value can never go below 1. Warn if that happens. Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit 66eb0c6e66617cace0d626d48819bf2b5fbf9307 Author: Shyam Prasad N Date: Mon Jul 19 14:01:32 2021 +0000 cifs: adjust DebugData to use chans_need_reconnect for conn status Use ses->chans_need_reconnect bitmask to print the connection status of each channel under an SMB session. Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit f486ef8e2003f6c308d0db81ea116c880a760d4f Author: Shyam Prasad N Date: Mon Jul 19 13:54:16 2021 +0000 cifs: use the chans_need_reconnect bitmap for reconnect status We use the concept of "binding" when one of the secondary channel is in the process of connecting/reconnecting to the server. Till this binding process completes, and the channel is bound to an existing session, we redirect traffic from other established channels on the binding channel, effectively blocking all traffic till individual channels get reconnected. With my last set of commits, we can get rid of this binding serialization. We now have a bitmap of connection states for each channel. We will use this bitmap instead for tracking channel status. Having a bitmap also now enables us to keep the session alive, as long as even a single channel underneath is alive. Unfortunately, this also meant that we need to supply the tcp connection info for the channel during all negotiate and session setup functions. These changes have resulted in a slightly bigger code churn. However, I expect perf and robustness improvements in the mchan scenario after this change. Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit d1a931ce2e3b7761d293ba8e0bde2b0180f456e9 Author: Shyam Prasad N Date: Mon Jul 19 12:46:53 2021 +0000 cifs: track individual channel status using chans_need_reconnect We needed a way to identify the channels under the smb session which are in reconnect, so that the traffic to other channels can continue. So I replaced the bool need_reconnect with a bitmask identifying all the channels that need reconnection (named chans_need_reconnect). When a channel needs reconnection, the bit corresponding to the index of the server in ses->chans is used to set this bitmask. Checking if no channels or all the channels need reconnect then becomes very easy. Also wrote some helper macros for checking and setting the bits. Signed-off-by: Shyam Prasad N Signed-off-by: Steve French commit 0b66fa776c361824a700793e34f866bf479dac92 Author: Colin Ian King Date: Tue Dec 21 00:48:09 2021 +0000 cifs: remove redundant assignment to pointer p The pointer p is being assigned with a value that is never read. The pointer is being re-assigned a different value inside the do-while loop. The assignment is redundant and can be removed. Signed-off-by: Colin Ian King Signed-off-by: Steve French commit 10331795fb7991a39ebd0330fdb074cbd81fef48 Author: Matthew Wilcox (Oracle) Date: Mon Dec 6 15:24:51 2021 -0500 pagevec: Add folio_batch The folio_batch is the same as the pagevec, except that it is typed to contain folios and not pages. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: William Kucharski commit a229a4f00d1eab3f665b92dc9f8dbceca9b8f49c Author: Matthew Wilcox (Oracle) Date: Sun Dec 20 06:44:51 2020 -0500 mm/writeback: Improve __folio_mark_dirty() comment Add some notes about how this function needs to be called. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski commit ece014141cd4b49f2d763f28b19e417b84460560 Author: Matthew Wilcox (Oracle) Date: Mon May 3 07:29:47 2021 -0400 mm/doc: Add documentation for folio_test_uptodate Move the PG_uptodate documentation to be documentation for folio_test_uptodate() and expand on it a little. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski commit 22b3c8d6612e09f5fcecba1009d399aaf7f934f6 Author: Matthew Wilcox (Oracle) Date: Fri Mar 19 08:58:36 2021 -0400 fs/writeback: Convert inode_switch_wbs_work_fn to folios This gets the statistics correct for large folios by modifying the counters by the number of pages in the folio instead of by 1. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski commit 9144785b02765409f63b2fe16948bc746248cf1f Author: Matthew Wilcox (Oracle) Date: Tue May 25 10:11:25 2021 -0400 filemap: Remove PageHWPoison check from next_uptodate_page() Pages are individually marked as suffering from hardware poisoning. Checking that the head page is not hardware poisoned doesn't make sense; we might be after a subpage. We check each page individually before we use it, so this was an optimisation gone wrong. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski commit 0d6f01ff4147890698bbc7631166167d5da1d229 Merge: 60c332029c8da 0699b3e06f220 Author: David S. Miller Date: Sun Jan 2 18:48:47 2022 +0000 Merge branch 'lynx-pcs-interface-cleanup' Colin Foster says: ==================== lynx pcs interface cleanup The current Felix driver (and Seville) rely directly on the lynx_pcs device. There are other possible PCS interfaces that can be used with this hardware, so this should be abstracted from felix. The generic phylink_pcs is used instead. While going through the code, there were some opportunities to change some misleading variable names. Those are included in this patch set. v1->v2 * compile-time fixes for freescale parts ==================== Signed-off-by: David S. Miller commit 0699b3e06f220a66150b718ac26569cf73e81bd2 Author: Colin Foster Date: Tue Dec 28 21:03:10 2021 -0800 net: pcs: lynx: use a common naming scheme for all lynx_pcs variables pcs-lynx.c used lynx_pcs and lynx as a variable name within the same file. This standardizes all internal variables to just "lynx" Signed-off-by: Colin Foster Signed-off-by: David S. Miller commit 82cc453753c574fec6e808bd6ce6f3dbb448b1b6 Author: Colin Foster Date: Tue Dec 28 21:03:09 2021 -0800 net: ethernet: enetc: name change for clarity from pcs to mdio_device A simple variable update from "pcs" to "mdio_device" for the mdio device will make things a little cleaner. Signed-off-by: Colin Foster Signed-off-by: David S. Miller commit 2c1415e67f9341072ad057617c4fd440ea5e6043 Author: Colin Foster Date: Tue Dec 28 21:03:08 2021 -0800 net: dsa: seville: name change for clarity from pcs to mdio_device A simple variable update from "pcs" to "mdio_device" for the mdio device will make things a little cleaner. Signed-off-by: Colin Foster Signed-off-by: David S. Miller commit 61f0d0c304a2394b30c236aec684d570a3f40c19 Author: Colin Foster Date: Tue Dec 28 21:03:07 2021 -0800 net: dsa: felix: name change for clarity from pcs to mdio_device Simple rename of a variable to make things more logical. Signed-off-by: Colin Foster Signed-off-by: David S. Miller commit e7026f15564fbe0c8b091f218203111f77b84eda Author: Colin Foster Date: Tue Dec 28 21:03:06 2021 -0800 net: phy: lynx: refactor Lynx PCS module to use generic phylink_pcs Remove references to lynx_pcs structures so drivers like the Felix DSA can reference alternate PCS drivers. Signed-off-by: Colin Foster Signed-off-by: David S. Miller commit fffbcee9335ccf97adf2b5b342099b6430e8dbfd Author: Dominik Brodowski Date: Sun Jan 2 18:48:58 2022 +0100 pcmcia: make pcmcia_release_io() void, as no-one is interested in return value As the only user of pcmcia_release_io() is not interested in its return value, and we cannot do anything on failure, convert the function to return void. Reported-by: Jason Wang Signed-off-by: Dominik Brodowski commit 977d2e7c63c3d04d07ba340b39987742e3241554 Author: Zhou Qingyang Date: Wed Dec 1 02:11:40 2021 +0800 pcmcia: rsrc_nonstatic: Fix a NULL pointer dereference in nonstatic_find_mem_region() In nonstatic_find_mem_region(), pcmcia_make_resource() is assigned to res and used in pci_bus_alloc_resource(). There a dereference of res in pci_bus_alloc_resource(), which could lead to a NULL pointer dereference on failure of pcmcia_make_resource(). Fix this bug by adding a check of res. This bug was found by a static analyzer. The analysis employs differential checking to identify inconsistent security operations (e.g., checks or kfrees) between two code paths and confirms that the inconsistent operations are not recovered in the current function or the callers, so they constitute bugs. Note that, as a bug found by static analysis, it can be a false positive or hard to trigger. Multiple researchers have cross-reviewed the bug. Builds with CONFIG_PCCARD_NONSTATIC=y show no new warnings, and our static analyzer no longer warns about this code. Fixes: 49b1153adfe1 ("pcmcia: move all pcmcia_resource_ops providers into one module") Signed-off-by: Zhou Qingyang Signed-off-by: Dominik Brodowski commit ca0fe0d7c35c97528bdf621fdca75f13157c27af Author: Zhou Qingyang Date: Wed Dec 1 00:59:23 2021 +0800 pcmcia: rsrc_nonstatic: Fix a NULL pointer dereference in __nonstatic_find_io_region() In __nonstatic_find_io_region(), pcmcia_make_resource() is assigned to res and used in pci_bus_alloc_resource(). There is a dereference of res in pci_bus_alloc_resource(), which could lead to a NULL pointer dereference on failure of pcmcia_make_resource(). Fix this bug by adding a check of res. This bug was found by a static analyzer. The analysis employs differential checking to identify inconsistent security operations (e.g., checks or kfrees) between two code paths and confirms that the inconsistent operations are not recovered in the current function or the callers, so they constitute bugs. Note that, as a bug found by static analysis, it can be a false positive or hard to trigger. Multiple researchers have cross-reviewed the bug. Builds with CONFIG_PCCARD_NONSTATIC=y show no new warnings, and our static analyzer no longer warns about this code. Fixes: 49b1153adfe1 ("pcmcia: move all pcmcia_resource_ops providers into one module") Signed-off-by: Zhou Qingyang [linux@dominikbrodowski.net: Fix typo in commit message] Signed-off-by: Dominik Brodowski commit 468c14d82c931073b759e03e421788f5dbb9ad45 Author: Dominik Brodowski Date: Sun Jan 2 18:39:12 2022 +0100 pcmcia: comment out unused exca_readw() function The exca_readw() function is currently unused; therefore, comment it out. Reported-by: kernel test robot Signed-off-by: Dominik Brodowski commit 3daaf2c7aae8f16845a59b57d3ae92e3d0965d21 Author: Cai Huoqing Date: Sat Aug 28 17:00:11 2021 +0800 pcmcia: Make use of the helper macro SET_NOIRQ_SYSTEM_SLEEP_PM_OPS() Use the helper macro SET_NOIRQ_SYSTEM_SLEEP_PM_OPS() instead of the verbose operators ".suspend_noirq /.resume_noirq/.freeze_noirq/ .thaw_noirq/.poweroff_noirq/.restore_noirq", because the SET_NOIRQ_SYSTEM_SLEEP_PM_OPS() is a nice helper macro that could be brought in to make code a little clearer, a little more concise. Signed-off-by: Cai Huoqing Signed-off-by: Dominik Brodowski commit 93e4d69400fdfd721616200fe27809ce139fd734 Author: Lukas Bulwahn Date: Mon Aug 16 17:01:15 2021 +0200 pcmcia: clean up dead drivers for CompuLab CM-X255/CM-X270 boards Commit 9d3239147d6d ("ARM: pxa: remove Compulab pxa2xx boards") removes the config MACH_ARMCORE in ./arch/arm/mach-pxa/Kconfig. Hence, ./scripts/checkkconfigsymbols.py warns on non-existing configs: MACH_ARMCORE Referencing files: drivers/pcmcia/Kconfig, drivers/pcmcia/Makefile Clean up the dead remains of pcmcia drivers for Compulab pxa2xx boards. Signed-off-by: Lukas Bulwahn Signed-off-by: Dominik Brodowski commit 60c332029c8da6f4ef791807fcbfbd98e71a5fbd Author: Christophe JAILLET Date: Sun Jan 2 11:23:39 2022 +0100 enic: 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. @@ 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 Signed-off-by: David S. Miller commit 4f9f531e1505a126b4d66d8a8a29e8e54fa4075c Author: Christophe JAILLET Date: Sun Jan 2 10:20:05 2022 +0100 qed: Use dma_set_mask_and_coherent() and simplify code Use dma_set_mask_and_coherent() instead of unrolling it with some dma_set_mask()+dma_set_coherent_mask(). Moreover, as stated in [1], dma_set_mask() with a 64-bit mask will never fail if dev->dma_mask is non-NULL. So, if it fails, the 32 bits case will also fail for the same reason. Simplify code and remove some dead code accordingly. Now that qed_set_coherency_mask() is mostly a single call to dma_set_mask_and_coherent(), fold it in its only caller. [1]: https://lkml.org/lkml/2021/6/7/398 Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller commit 1aae5cc0a55c097f16ccce1493415c63d60babc9 Author: Christophe JAILLET Date: Sat Jan 1 22:15:29 2022 +0100 chelsio: cxgb: Use dma_set_mask_and_coherent() and simplify code Use dma_set_mask_and_coherent() instead of unrolling it with some dma_set_mask()+dma_set_coherent_mask(). Moreover, as stated in [1], dma_set_mask() with a 64-bit mask will never fail if dev->dma_mask is non-NULL. So, if it fails, the 32 bits case will also fail for the same reason. That said, 'pci_using_dac' can only be 1 after a successful dma_set_mask_and_coherent(). Simplify code and remove some dead code accordingly. [1]: https://lkml.org/lkml/2021/6/7/398 Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller commit 584c61cedb12f983e97a01762457b75dfdef626b Author: Christophe JAILLET Date: Sat Jan 1 20:04:45 2022 +0100 sun/cassini: Use dma_set_mask_and_coherent() and simplify code Use dma_set_mask_and_coherent() instead of unrolling it with some dma_set_mask()+dma_set_coherent_mask(). Moreover, as stated in [1], dma_set_mask() with a 64-bit mask will never fail if dev->dma_mask is non-NULL. So, if it fails, the 32 bits case will also fail for the same reason. That said, 'pci_using_dac' can only be 1 after a successful dma_set_mask_and_coherent(). Simplify code and remove some dead code accordingly. [1]: https://lkml.org/lkml/2021/6/7/398 Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller commit 1f52a9380ff19b6fc00c1614488d5940773ba3ab Author: Dust Li Date: Fri Dec 31 14:08:53 2021 +0800 net/smc: add comments for smc_link_{usable|sendable} Add comments for both smc_link_sendable() and smc_link_usable() to help better distinguish and use them. No function changes. Signed-off-by: Dust Li Signed-off-by: David S. Miller commit 79876cc1d7b801b28511440e5aec1b31d8df7a73 Author: YunQiang Su Date: Wed Dec 22 13:43:46 2021 +0000 MIPS: new Kconfig option ZBOOT_LOAD_ADDRESS If this option is not 0x0, it will be used for zboot load address. Otherwise, the result of calc_vmlinuz_load_addr will be used. The zload-y value for generic are also removed then, as the current value breaks booting on qemu -M boston. The result of calc_vmlinuz_load_addr works well for most of cases. The default value of bcm47xx keeps as it currently. Signed-off-by: YunQiang Su Signed-off-by: Thomas Bogendoerfer commit 31b2f3dc851c65fee288612432c4fc956f1a264e Author: YunQiang Su Date: Wed Dec 22 13:43:45 2021 +0000 MIPS: enable both vmlinux.gz.itb and vmlinuz for generic vmlinux.gz.itb should be appended to all-$(CONFIG_MIPS_GENERIC) instead of replacing. Otherwise, no vmlinuz will be built. Signed-off-by: YunQiang Su Signed-off-by: Thomas Bogendoerfer commit 408bd9ddc2476c2de80ae88cdd3c74717e86ef91 Author: Tiezhu Yang Date: Mon Dec 20 12:27:39 2021 +0800 MIPS: signal: Return immediately if call fails When debug sigaltstack(), copy_siginfo_to_user() fails first in setup_rt_frame() if the alternate signal stack is too small, so it should return immediately if call fails, no need to call the following functions. Signed-off-by: Tiezhu Yang Signed-off-by: Thomas Bogendoerfer commit 0ebd37a2222f6b6f1b55b385e40d16a5ce15cb6a Author: Tiezhu Yang Date: Mon Dec 20 12:27:38 2021 +0800 MIPS: signal: Protect against sigaltstack wraparound If a process uses alternative signal stack by using sigaltstack(), then that stack overflows and stack wraparound occurs. Simple Explanation: The accurate sp order is A,B,C,D,... But now the sp points to A,B,C and A,B,C again. This problem can reproduce by the following code: $ cat test_sigaltstack.c #include #include #include #include volatile int counter = 0; void print_sp() { unsigned long sp; __asm__ __volatile__("move %0, $sp" : "=r" (sp)); printf("sp = 0x%08lx\n", sp); } void segv_handler() { int *c = NULL; print_sp(); counter++; printf("%d\n", counter); if (counter == 23) abort(); *c = 1; // SEGV } int main() { int *c = NULL; char *s = malloc(SIGSTKSZ); stack_t stack; struct sigaction action; memset(s, 0, SIGSTKSZ); stack.ss_sp = s; stack.ss_flags = 0; stack.ss_size = SIGSTKSZ; if (sigaltstack(&stack, NULL)) { printf("Failed to use sigaltstack!\n"); return -1; } memset(&action, 0, sizeof(action)); action.sa_handler = segv_handler; action.sa_flags = SA_ONSTACK | SA_NODEFER; sigemptyset(&action.sa_mask); sigaction(SIGSEGV, &action, NULL); *c = 0; //SEGV if (!s) free(s); return 0; } $ gcc test_sigaltstack.c -o test_sigaltstack $ ./test_sigaltstack sp = 0x120015c80 1 sp = 0x120015900 2 sp = 0x120015580 3 sp = 0x120015200 4 sp = 0x120014e80 5 sp = 0x120014b00 6 sp = 0x120014780 7 sp = 0x120014400 8 sp = 0x120014080 9 sp = 0x120013d00 10 sp = 0x120015c80 11 # wraparound occurs! the 11nd output is same as 1st. sp = 0x120015900 12 sp = 0x120015580 13 sp = 0x120015200 14 sp = 0x120014e80 15 sp = 0x120014b00 16 sp = 0x120014780 17 sp = 0x120014400 18 sp = 0x120014080 19 sp = 0x120013d00 20 sp = 0x120015c80 21 # wraparound occurs! the 21nd output is same as 1st. sp = 0x120015900 22 sp = 0x120015580 23 Aborted With this patch: $ ./test_sigaltstack sp = 0x120015c80 1 sp = 0x120015900 2 sp = 0x120015580 3 sp = 0x120015200 4 sp = 0x120014e80 5 sp = 0x120014b00 6 sp = 0x120014780 7 sp = 0x120014400 8 sp = 0x120014080 9 Segmentation fault If we are on the alternate signal stack and would overflow it, don't. Return an always-bogus address instead so we will die with SIGSEGV. This patch is similar with commit 83bd01024b1f ("x86: protect against sigaltstack wraparound"). Signed-off-by: Tiezhu Yang Signed-off-by: Thomas Bogendoerfer commit 6f03055d508ff4feb8db02ba3df9303a1db8d381 Author: Randy Dunlap Date: Tue Dec 28 16:05:53 2021 -0800 mips: bcm63xx: add support for clk_set_parent() The MIPS BMC63XX subarch does not provide/support clk_set_parent(). This causes build errors in a few drivers, so add a simple implementation of that function so that callers of it will build without errors. Fixes these build errors: ERROR: modpost: "clk_set_parent" [sound/soc/jz4740/snd-soc-jz4740-i2s.ko] undefined! ERROR: modpost: "clk_set_parent" [sound/soc/atmel/snd-soc-atmel-i2s.ko] undefined! Fixes: e7300d04bd08 ("MIPS: BCM63xx: Add support for the Broadcom BCM63xx family of SOCs." ) Signed-off-by: Randy Dunlap Reviewed-by: Jonathan Cameron Acked-by: Florian Fainelli Signed-off-by: Thomas Bogendoerfer commit 76f66dfd60dc5d2f9dec22d99091fea1035c5d03 Author: Randy Dunlap Date: Tue Dec 28 16:03:45 2021 -0800 mips: lantiq: add support for clk_set_parent() Provide a simple implementation of clk_set_parent() in the lantiq subarch so that callers of it will build without errors. Fixes these build errors: ERROR: modpost: "clk_set_parent" [sound/soc/jz4740/snd-soc-jz4740-i2s.ko] undefined! ERROR: modpost: "clk_set_parent" [sound/soc/atmel/snd-soc-atmel-i2s.ko] undefined! Fixes: 171bb2f19ed6 ("MIPS: Lantiq: Add initial support for Lantiq SoCs") Signed-off-by: Randy Dunlap Reported-by: kernel test robot --to=linux-mips@vger.kernel.org --cc="John Crispin " --cc="Jonathan Cameron " --cc="Russell King " --cc="Andy Shevchenko " --cc=alsa-devel@alsa-project.org --to="Thomas Bogendoerfer " Reviewed-by: Jonathan Cameron Signed-off-by: Thomas Bogendoerfer commit 75d4a175ff0609b0f11f6154737e6d15df9c185d Author: Qing Zhang Date: Fri Nov 26 09:52:16 2021 +0800 dt-bindings: mips: Add Loongson-2K1000 reset support Switch the DT binding to a YAML schema to enable the DT validation. Signed-off-by: Qing Zhang Reviewed-by: Rob Herring Signed-off-by: Thomas Bogendoerfer commit a8f4fcdd8ba7d191c29ae87a2315906fe90368d6 Author: Qing Zhang Date: Fri Nov 26 09:52:15 2021 +0800 MIPS: Loongson64: DTS: Add pm block node for Loongson-2K1000 The module is now supported, enable it. Signed-off-by: Qing Zhang Signed-off-by: Thomas Bogendoerfer commit 7eb7819a2e12461a43eb701e401460ed424a425d Author: Qing Zhang Date: Fri Nov 26 09:52:14 2021 +0800 MIPS: Loongson64: Add Loongson-2K1000 reset platform driver Add power management register operations to support reboot and poweroff. Signed-off-by: Qing Zhang Signed-off-by: Thomas Bogendoerfer commit fc5bb239d5b3500d034559e0c5ecb67bbae69de7 Author: Thomas Bogendoerfer Date: Tue Nov 30 17:45:56 2021 +0100 MIPS: TXX9: Remove TX4939 SoC support After removal of RBTX4939 board support remove code for the TX4939 SoC. Signed-off-by: Thomas Bogendoerfer Tested-by: Geert Uytterhoeven commit 5a8df9281b052ff3d498e0d6b22e1546843b89ce Author: Thomas Bogendoerfer Date: Tue Nov 30 17:45:55 2021 +0100 MIPS: TXX9: Remove rbtx4939 board support No active MIPS user own this board, so let's remove it. Signed-off-by: Thomas Bogendoerfer Reviewed-by: Geert Uytterhoeven Tested-by: Geert Uytterhoeven commit c95e078069bf9bfcb66272fac162c79be6c9170b Author: Christophe JAILLET Date: Sat Jan 1 15:48:25 2022 +0100 tehuti: Use dma_set_mask_and_coherent() and simplify code Use dma_set_mask_and_coherent() instead of unrolling it with some dma_set_mask()+dma_set_coherent_mask(). Moreover, as stated in [1], dma_set_mask_and_coherent() with a 64-bit mask will never fail if dev->dma_mask is non-NULL. So, if it fails, the 32 bits case will also fail for the same reason. That said, 'pci_using_dac' can only be 1 after a successful dma_set_mask_and_coherent(). Simplify code and remove some dead code accordingly. [1]: https://lkml.org/lkml/2021/6/7/398 Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller commit c5180ad0c2784924b3526ec2bd3ee9e0aa05724b Author: Christophe JAILLET Date: Sat Jan 1 15:02:45 2022 +0100 enic: Use dma_set_mask_and_coherent() Use dma_set_mask_and_coherent() instead of unrolling it with some dma_set_mask()+dma_set_coherent_mask(). This simplifies code and removes some dead code (dma_set_coherent_mask() can not fail after a successful dma_set_mask()) Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller commit e44ef1d4de577aca369199b16da382d6e5aafaa3 Author: Hamish MacDonald Date: Sat Jan 1 22:38:25 2022 +1000 net: socket.c: style fix Removed spaces and added a tab that was causing an error on checkpatch Signed-off-by: Hamish MacDonald Signed-off-by: David S. Miller commit b63c5478e9cb1d1504eb02d9dac827ad24612b32 Author: Justin Iurman Date: Thu Dec 30 18:10:04 2021 +0100 ipv6: ioam: Support for Queue depth data field v3: - Report 'backlog' (bytes) instead of 'qlen' (number of packets) v2: - Fix sparse warning (use rcu_dereference) This patch adds support for the queue depth in IOAM trace data fields. The draft [1] says the following: The "queue depth" field is a 4-octet unsigned integer field. This field indicates the current length of the egress interface queue of the interface from where the packet is forwarded out. The queue depth is expressed as the current amount of memory buffers used by the queue (a packet could consume one or more memory buffers, depending on its size). An existing function (i.e., qdisc_qstats_qlen_backlog) is used to retrieve the current queue length without reinventing the wheel. Note: it was tested and qlen is increasing when an artificial delay is added on the egress with tc. [1] https://datatracker.ietf.org/doc/html/draft-ietf-ippm-ioam-data#section-5.4.2.7 Signed-off-by: Justin Iurman Reviewed-by: Ido Schimmel Signed-off-by: David S. Miller commit 3a856c14c31bb8ba35534e9a2f2273c1b322f372 Author: Colin Ian King Date: Thu Dec 30 15:39:00 2021 +0000 net/smc: remove redundant re-assignment of pointer link The pointer link is being re-assigned the same value that it was initialized with in the previous declaration statement. The re-assignment is redundant and can be removed. Fixes: 387707fdf486 ("net/smc: convert static link ID to dynamic references") Signed-off-by: Colin Ian King Reviewed-by: Tony Lu Signed-off-by: David S. Miller commit d7cd421da9da2cc7b4d25b8537f66db5c8331c40 Author: Tony Lu Date: Tue Dec 28 21:44:36 2021 +0800 net/smc: Introduce TCP ULP support This implements TCP ULP for SMC, helps applications to replace TCP with SMC protocol in place. And we use it to implement transparent replacement. This replaces original TCP sockets with SMC, reuse TCP as clcsock when calling setsockopt with TCP_ULP option, and without any overhead. To replace TCP sockets with SMC, there are two approaches: - use setsockopt() syscall with TCP_ULP option, if error, it would fallback to TCP. - use BPF prog with types BPF_CGROUP_INET_SOCK_CREATE or others to replace transparently. BPF hooks some points in create socket, bind and others, users can inject their BPF logics without modifying their applications, and choose which connections should be replaced with SMC by calling setsockopt() in BPF prog, based on rules, such as TCP tuples, PID, cgroup, etc... BPF doesn't support calling setsockopt with TCP_ULP now, I will send the patches after this accepted. Signed-off-by: Tony Lu Signed-off-by: David S. Miller commit ab6dd952b2d044d04a9906a997d16f1e6e4db48d Merge: e63a02348958c a838f5084828a Author: David S. Miller Date: Sun Jan 2 12:07:39 2022 +0000 Merge branch 'smc-RDMA-net-namespace' Tony Lu says: ==================== RDMA device net namespace support for SMC This patch set introduces net namespace support for linkgroups. Path 1 is the main approach to implement net ns support. Path 2 - 4 are the additional modifications to let us know the netns. Also, I will submit changes of smc-tools to github later. Currently, smc doesn't support net namespace isolation. The ibdevs registered to smc are shared for all linkgroups and connections. When running applications in different net namespaces, such as container environment, applications should only use the ibdevs that belongs to the same net namespace. This adds a new field, net, in smc linkgroup struct. During first contact, it checks and find the linkgroup has same net namespace, if not, it is going to create and initialized the net field with first link's ibdev net namespace. When finding the rdma devices, it also checks the sk net device's and ibdev's net namespaces. After net namespace destroyed, the net device and ibdev move to root net namespace, linkgroups won't be matched, and wait for lgr free. If rdma net namespace exclusive mode is not enabled, it behaves as before. Steps to enable and test net namespaces: 1. enable RDMA device net namespace exclusive support rdma system set netns exclusive # default is shared 2. create new net namespace, move and initialize them ip netns add test1 rdma dev set mlx5_1 netns test1 ip link set dev eth2 netns test1 ip netns exec test1 ip link set eth2 up ip netns exec test1 ip addr add ${HOST_IP}/26 dev eth2 3. setup server and client, connect N <-> M ip netns exec test1 smc_run sockperf server --tcp # server ip netns exec test1 smc_run sockperf pp --tcp -i ${SERVER_IP} # client 4. netns isolated linkgroups (2 * 2 mesh) with their own linkgroups - server LG-ID LG-Role LG-Type VLAN #Conns PNET-ID 00000100 SERV SINGLE 0 0 00000200 SERV SINGLE 0 0 00000300 SERV SINGLE 0 0 00000400 SERV SINGLE 0 0 - client LG-ID LG-Role LG-Type VLAN #Conns PNET-ID 00000100 CLNT SINGLE 0 0 00000200 CLNT SINGLE 0 0 00000300 CLNT SINGLE 0 0 00000400 CLNT SINGLE 0 0 ==================== Signed-off-by: David S. Miller commit a838f5084828ac987af0903c523d6a2f7882705c Author: Tony Lu Date: Tue Dec 28 21:06:12 2021 +0800 net/smc: Add net namespace for tracepoints This prints net namespace ID, helps us to distinguish different net namespaces when using tracepoints. Signed-off-by: Tony Lu Signed-off-by: David S. Miller commit de2fea7b39bfa1ee9db8726f7b71d54fec385d80 Author: Tony Lu Date: Tue Dec 28 21:06:11 2021 +0800 net/smc: Print net namespace in log This adds net namespace ID to the kernel log, net_cookie is unique in the whole system. It is useful in container environment. Signed-off-by: Tony Lu Signed-off-by: David S. Miller commit 79d39fc503b43b566feae5bc9a57dfcffdf41bd1 Author: Tony Lu Date: Tue Dec 28 21:06:10 2021 +0800 net/smc: Add netlink net namespace support This adds net namespace ID to diag of linkgroup, helps us to distinguish different namespaces, and net_cookie is unique in the whole system. Signed-off-by: Tony Lu Signed-off-by: David S. Miller commit 0237a3a683e4844ddc52782d83d439d6192e11f9 Author: Tony Lu Date: Tue Dec 28 21:06:09 2021 +0800 net/smc: Introduce net namespace support for linkgroup Currently, rdma device supports exclusive net namespace isolation, however linkgroup doesn't know and support ibdev net namespace. Applications in the containers don't want to share the nics if we enabled rdma exclusive mode. Every net namespaces should have their own linkgroups. This patch introduce a new field net for linkgroup, which is standing for the ibdev net namespace in the linkgroup. The net in linkgroup is initialized with the net namespace of link's ibdev. It compares the net of linkgroup and sock or ibdev before choose it, if no matched, create new one in current net namespace. If rdma net namespace exclusive mode is not enabled, it behaves as before. Signed-off-by: Tony Lu Signed-off-by: David S. Miller commit 7442936633bd1906a2571116ae334b68c56c8a72 Author: Rafał Miłecki Date: Mon Dec 27 13:22:37 2021 +0100 pinctrl: imx: fix assigning groups names This fixes regression caused by incorrect array indexing. Reported-by: Fabio Estevam Fixes: 02f117134952 ("pinctrl: imx: prepare for making "group_names" in "function_desc" const") Signed-off-by: Rafał Miłecki Tested-by: Fabio Estevam Link: https://lore.kernel.org/r/20211227122237.6363-1-zajec5@gmail.com Signed-off-by: Linus Walleij commit 79dcd4e840ccfaf8018ec96415fdc0250e945c77 Author: Tinghan Shen Date: Mon Dec 20 20:18:24 2021 +0800 dt-bindings: pinctrl: mt8195: add wrapping node of pin configurations On mt8195, the pinctrl node has pinctrl groups to group pin configurations by users' need. In each pinctrl group, it has subnode(s) to list pins needed and pin configurations. By supporting multiple subnodes, we can configure different pin characteristics (driving/pull-up/pull-down/etc.) in a pinctrl group. Update pinctrl-mt8195.yaml to add subnode in pinctrl groups and an example to illustrate the usage. Signed-off-by: Tinghan Shen Acked-by: AngeloGioacchino Del Regno Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211220121825.6446-4-tinghan.shen@mediatek.com Signed-off-by: Linus Walleij commit 146b3a77af8091cabbd1decc51d67799e69682d2 Author: Sameer Pujar Date: Thu Dec 23 17:23:51 2021 +0530 arm64: tegra: Remove non existent Tegra194 reset Tegra194 does not really have "hda2codec_2x" related reset. Hence drop this entry to reflect actual HW. Fixes: 4878cc0c9fab ("arm64: tegra: Add HDA controller on Tegra194") Signed-off-by: Sameer Pujar Link: https://lore.kernel.org/r/1640260431-11613-4-git-send-email-spujar@nvidia.com Signed-off-by: Takashi Iwai commit 6088ddfb6d8f004184a55857b6c64d8cf5f9a8d8 Author: Sameer Pujar Date: Thu Dec 23 17:23:50 2021 +0530 dt-bindings: sound: tegra: Add minItems for resets Tegra194 HDA has only two resets unlike the previous generations of Tegra SoCs. To take care of this set minItems field to two. Signed-off-by: Sameer Pujar Link: https://lore.kernel.org/r/1640260431-11613-3-git-send-email-spujar@nvidia.com Signed-off-by: Takashi Iwai commit d278dc9151a034674b31ffeda24cdfb0073570f3 Author: Sameer Pujar Date: Thu Dec 23 17:23:49 2021 +0530 ALSA: hda/tegra: Fix Tegra194 HDA reset failure HDA regression is recently reported on Tegra194 based platforms. This happens because "hda2codec_2x" reset does not really exist in Tegra194 and it causes probe failure. All the HDA based audio tests fail at the moment. This underlying issue is exposed by commit c045ceb5a145 ("reset: tegra-bpmp: Handle errors in BPMP response") which now checks return code of BPMP command response. Fix this issue by skipping unavailable reset on Tegra194. Cc: stable@vger.kernel.org Signed-off-by: Sameer Pujar Reviewed-by: Dmitry Osipenko Link: https://lore.kernel.org/r/1640260431-11613-2-git-send-email-spujar@nvidia.com Signed-off-by: Takashi Iwai commit 40a74870b2d1d3d44e13b3b73c6571dd34f5614d Author: Christophe JAILLET Date: Mon Dec 27 19:09:18 2021 +0100 orangefs: Fix the size of a memory allocation in orangefs_bufmap_alloc() 'buffer_index_array' really looks like a bitmap. So it should be allocated as such. When kzalloc is called, a number of bytes is expected, but a number of longs is passed instead. In get(), if not enough memory is allocated, un-allocated memory may be read or written. So use bitmap_zalloc() to safely allocate the correct memory size and avoid un-expected behavior. While at it, change the corresponding kfree() into bitmap_free() to keep the semantic. Fixes: ea2c9c9f6574 ("orangefs: bufmap rewrite") Signed-off-by: Christophe JAILLET Signed-off-by: Mike Marshall commit 063e458c7aafc694f2491de7f8f10ff470263d8d Author: Greg Kroah-Hartman Date: Tue Dec 28 15:44:07 2021 +0100 orangefs: use default_groups in kobj_type There are currently 2 ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the orangfs code to use default_groups field which has been the preferred way since aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field. Cc: Mike Marshall Cc: Martin Brandenburg Cc: devel@lists.orangefs.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Mike Marshall commit 9be6dc8059bb235ffb0666690a26c0df15cc6d9e Author: Mimi Zohar Date: Fri Dec 3 10:20:42 2021 -0500 selftests/kexec: update searching for the Kconfig First check /lib/modules/`uname -r`/config, before using the IKCONFIG. In addition, the configs.ko might be compressed. Fix the configs.ko name. Reviewed-by: Petr Vorel Signed-off-by: Mimi Zohar commit cef5cd25a453805237f0c4e789218d987d674290 Author: Mimi Zohar Date: Wed Nov 24 12:38:00 2021 +0530 selftest/kexec: fix "ignored null byte in input" warning Instead of assigning the string to a variable, which might contain a null character, redirect the output and grep for the string directly. Reviewed-by: Petr Vorel Signed-off-by: Mimi Zohar commit 3376136300a00df9a864b88fa969177d6c3be8e5 Author: Youquan Song Date: Thu Dec 23 12:07:01 2021 -0800 x86/mce: Reduce number of machine checks taken during recovery When any of the copy functions in arch/x86/lib/copy_user_64.S take a fault, the fixup code copies the remaining byte count from %ecx to %edx and unconditionally jumps to .Lcopy_user_handle_tail to continue the copy in case any more bytes can be copied. If the fault was #PF this may copy more bytes (because the page fault handler might have fixed the fault). But when the fault is a machine check the original copy code will have copied all the way to the poisoned cache line. So .Lcopy_user_handle_tail will just take another machine check for no good reason. Every code path to .Lcopy_user_handle_tail comes from an exception fixup path, so add a check there to check the trap type (in %eax) and simply return the count of remaining bytes if the trap was a machine check. Doing this reduces the number of machine checks taken during synthetic tests from four to three. As well as reducing the number of machine checks, this also allows Skylake generation Xeons to recover some cases that currently fail. The is because REP; MOVSB is only recoverable when source and destination are well aligned and the byte count is large. That useless call to .Lcopy_user_handle_tail may violate one or more of these conditions and generate a fatal machine check. [ Tony: Add more details to commit message. ] [ bp: Fixup comment. Also, another tip patchset which is adding straight-line speculation mitigation changes the "ret" instruction to an all-caps macro "RET". But, since gas is case-insensitive, use "RET" in the newly added asm block already in order to simplify tip branch merging on its way upstream. ] Signed-off-by: Youquan Song Signed-off-by: Tony Luck Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/YcTW5dh8yTGucDd+@agluck-desk2.amr.corp.intel.com commit a155b7526e6502c235540440f7eba78333d1ddc8 Merge: 85b57de33265a db5e1c209b92a Author: Mark Brown Date: Fri Dec 31 14:38:47 2021 +0000 ASoC: mediatek: mt8195: repair pcmif BE dai Merge series from Trevor Wu : This series of patches repairs some problems for pcmif BE dai. The unexpected control flow is corrected, and the missing playback support of DPCM is added. commit 85b57de33265a0baf4a5e140d9477f43c73da593 Merge: 8b974c122bc64 e8e4fcc047c6e Author: Mark Brown Date: Fri Dec 31 14:38:45 2021 +0000 ASoC: Add support for CS35L41 in HDA systems Merge series from Lucas Tanure : Initial refactoring to support use of cs35l41 from the HDA driver stack. commit e63a02348958cd7cc8c8401c94de57ad97b5d06c Merge: ce2b6eb409ad4 9e6b19a66d9b6 Author: David S. Miller Date: Fri Dec 31 14:35:40 2021 +0000 Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next Alexei Starovoitov says: ==================== pull-request: bpf-next 2021-12-30 The following pull-request contains BPF updates for your *net-next* tree. We've added 72 non-merge commits during the last 20 day(s) which contain a total of 223 files changed, 3510 insertions(+), 1591 deletions(-). The main changes are: 1) Automatic setrlimit in libbpf when bpf is memcg's in the kernel, from Andrii. 2) Beautify and de-verbose verifier logs, from Christy. 3) Composable verifier types, from Hao. 4) bpf_strncmp helper, from Hou. 5) bpf.h header dependency cleanup, from Jakub. 6) get_func_[arg|ret|arg_cnt] helpers, from Jiri. 7) Sleepable local storage, from KP. 8) Extend kfunc with PTR_TO_CTX, PTR_TO_MEM argument support, from Kumar. ==================== Signed-off-by: David S. Miller commit ce2b6eb409ad40607193641c3ec18c3457e1f57c Merge: 20a9013ebad76 aa36c94853b2b Author: David S. Miller Date: Fri Dec 31 14:29:31 2021 +0000 Merge tag 'mlx5-updates-2021-12-28' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5 Software steering, New features and optimizations This patch series brings various SW steering features, optimizations and debug-ability focused improvements. 1) Expose debugfs for dumping the SW steering resources 2) Removing unused fields 3) support for matching on new fields 4) steering optimization for RX/TX-only rules 5) Make Software steering the default steering mechanism when available, applies only to Switchdev mode FDB From Yevgeny Kliteynik and Muhammad Sammar: - Patch 1 fixes an error flow in creating matchers - Patch 2 fix lower case macro prefix "mlx5_" to "MLX5_" - Patch 3 removes unused struct member in mlx5dr_matcher - Patch 4 renames list field in matcher struct to list_node to reflect the fact that is field is for list node that is stored on another struct's lists - Patch 5 adds checking for valid Flex parser ID value - Patch 6 adds the missing reserved fields to dr_match_param and aligns it to the format that is defined by HW spec - Patch 7 adds support for dumping SW steering (SMFS) resources using debugfs in CSV format: domain and its tables, matchers and rules - Patch 8 adds support for a new destination type - UPLINK - Patch 9 adds WARN_ON_ONCE on refcount checks in SW steering object destructors - Patches 10, 11, 12 add misc5 flow table match parameters and add support for matching on tunnel headers 0 and 1 - Patch 13 adds support for matching on geneve_tlv_option_0_exist field - Patch 14 implements performance optimization for for empty or RX/TX-only matchers by splitting RX and TX matchers handling: matcher connection in the matchers chain is split into two separate lists (RX only and TX only), which solves a usecase of many RX or TX only rules that create a long chain of RX/TX-only paths w/o the actual rules - Patch 15 ignores modify TTL if device doesn't support it instead of adding and unsupported action - Patch 16 sets SMFS as a default steering mode ==================== Signed-off-by: David S. Miller commit 20a9013ebad7625384ba569db5f13f9106f6cbc0 Merge: af30f8eaa8fe4 aab8d1c6a5e3a Author: David S. Miller Date: Fri Dec 31 14:25:47 2021 +0000 Merge branch 'hnsd3-next' Guangbin Huang says: ==================== net: hns3: refactor cmdq functions in PF/VF Currently, hns3 PF and VF module have two sets of cmdq APIs to provide cmdq message interaction functions. Most of these APIs are the same. The only differences are the function variables and names with pf and vf suffixes. These two sets of cmdq APIs are redundent and add extra bug fix work. This series refactor the cmdq APIs in hns3 PF and VF by implementing one set of common cmdq APIs for PF and VF reuse and deleting the old APIs. ==================== Signed-off-by: David S. Miller commit aab8d1c6a5e3aaf67c4c18f6b03cf6486c435755 Author: Jie Wang Date: Fri Dec 31 18:22:43 2021 +0800 net: hns3: delete the hclge_cmd.c and hclgevf_cmd.c currently most cmdq APIs are unified in hclge_comm_cmd.c. Newly developed cmdq APIs should also be placed in hclge_comm_cmd.c. So there is no need to keep hclge_cmd.c and hclgevf_cmd.c. This patch moves the hclge(vf)_cmd_send to hclge(vf)_main.c and deletes the source files and makefile scripts. Signed-off-by: Jie Wang Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit cb413bfa6e8b8198a08f2f9ce0ef3c567e3d26eb Author: Jie Wang Date: Fri Dec 31 18:22:42 2021 +0800 net: hns3: refactor VF cmdq init and uninit APIs with new common APIs This patch uses common cmdq init and uninit APIs to replace the old APIs in VF cmdq module init and uninit module. Then the old VF init and uninit APIs is deleted. Signed-off-by: Jie Wang Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 8e2288cad6cb9863a38048140297f5ce8a9b00d3 Author: Jie Wang Date: Fri Dec 31 18:22:41 2021 +0800 net: hns3: refactor PF cmdq init and uninit APIs with new common APIs This patch uses common cmdq init and uninit APIs to replace the old APIs in PF cmdq module init and uninit modules. Then the old PF init and uninit APIs is deleted. Signed-off-by: Jie Wang Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 0b04224c131269efeab0571dcff9377f9c6d911c Author: Jie Wang Date: Fri Dec 31 18:22:40 2021 +0800 net: hns3: create common cmdq init and uninit APIs The PF and VF cmdq init and uninit APIs are also almost same espect the suffixes of API names. This patch creates common cmdq init and uninit APIs needed by PF and VF cmdq modules. The next patch will use the new unified APIs to replace init and uninit APIs in PF module. Signed-off-by: Jie Wang Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 745f0a19ee9abee4bf0dc9676f4cfdc67c541061 Author: Jie Wang Date: Fri Dec 31 18:22:39 2021 +0800 net: hns3: refactor VF cmdq resource APIs with new common APIs This patch uses common cmdq resource allocate/free/query APIs to replace the old APIs in VF cmdq module and deletes the old cmdq resource APIs. Still we kept hclgevf_cmd_setup_basic_desc name as a seam API to avoid too many meaningless replacement. Signed-off-by: Jie Wang Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit d3c69a8812c22d84eb12f1a60f91889a63a5fc51 Author: Jie Wang Date: Fri Dec 31 18:22:38 2021 +0800 net: hns3: refactor PF cmdq resource APIs with new common APIs This patch uses common cmdq resource allocate/free/query APIs to replace the old APIs in PF cmdq module and deletes the old cmdq resource APIs. Still we kept hclge_cmd_setup_basic_desc name as a seam API to avoid too many meaningless replacement. Signed-off-by: Jie Wang Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit da77aef9cc58ed820097b3d905e9fa474d42dbd4 Author: Jie Wang Date: Fri Dec 31 18:22:37 2021 +0800 net: hns3: create common cmdq resource allocate/free/query APIs The PF and VF cmdq module resource allocate/free/query APIs are almost the same espect the suffixes of API names. These same implementations bring double development and bugfix work. This patch creates common cmdq resource allocate/free/query APIs called by PF and VF cmdq init/uninit APIs. The next patch will use the new unified APIs to replace init/uninit APIs. Signed-off-by: Jie Wang Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 076bb537577f6eae1714613f02a74621c0c1922a Author: Jie Wang Date: Fri Dec 31 18:22:36 2021 +0800 net: hns3: refactor hclgevf_cmd_send with new hclge_comm_cmd_send API This patch firstly uses new hardware description struct hclge_comm_hw as child member of hclgevf_hw and deletes the old hardware description child members. All the hclgevf_hw variables used in VF module is modified according to the new hclgevf_hw. Secondly hclgevf_cmd_send is refactored to use hclge_comm_cmd_send APIs. The old functions called by hclgevf_cmd_send are all deleted. Still we kept hclgevf_cmd_send to avoid too many meaningless modifications. Signed-off-by: Jie Wang Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit eaa5607db377a73e639162a459d8b125c6a67bfb Author: Jie Wang Date: Fri Dec 31 18:22:35 2021 +0800 net: hns3: refactor hclge_cmd_send with new hclge_comm_cmd_send API This patch firstly uses new hardware description struct hclge_comm_hw as child member of hclge_hw and deletes the original child memebers of hclge_hw. All the hclge_hw variables used in PF module is modified according to the new hclge_hw. Secondly hclge_cmd_send is refactored to use hclge_comm_cmd_send APIs. The old functions called by hclge_cmd_send are deleted and hclge_cmd_send is kept to avoid too many meaningless modifications. Signed-off-by: Jie Wang Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 8d307f8e8cf195921b10939dde673f1f039bd732 Author: Jie Wang Date: Fri Dec 31 18:22:34 2021 +0800 net: hns3: create new set of unified hclge_comm_cmd_send APIs This patch create new set of unified hclge_comm_cmd_send APIs for PF and VF cmdq module. Subfunctions called by hclge_comm_cmd_send are also created include cmdq result check, cmdq return code conversion and ring space opertaion APIs. These new common cmdq APIs will be used to replace the old PF and VF cmdq APIs in next patches. Signed-off-by: Jie Wang Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 6befad603d79be43cfece9f41309e5cc9546beba Author: Jie Wang Date: Fri Dec 31 18:22:33 2021 +0800 net: hns3: use struct hclge_desc to replace hclgevf_desc in VF cmdq module This patch use new common struct hclge_desc to replace struct hclgevf_desc in VF cmdq module and then delete the old struct hclgevf_desc. Signed-off-by: Jie Wang Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 0a7b6d221868be6aa3249c70ffab707a265b89d6 Author: Jie Wang Date: Fri Dec 31 18:22:32 2021 +0800 net: hns3: create new cmdq hardware description structure hclge_comm_hw Currently PF and VF cmdq APIs use struct hclge(vf)_hw to describe cmdq hardware information needed by hclge(vf)_cmd_send. There are a little differences between its child struct hclge_cmq_ring and hclgevf_cmq_ring. It is redundent to use two sets of structures to support same functions. So this patch creates new set of common cmdq hardware description structures(hclge_comm_hw) to unify PF and VF cmdq functions. The struct hclge_desc is still kept to avoid too many meaningless replacement. These new structures will be used to unify hclge(vf)_hw structures in PF and VF cmdq APIs in next patches. Signed-off-by: Jie Wang Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 5f20be4e90e603d8967962f81ac89307fd4f8af9 Author: Jie Wang Date: Fri Dec 31 18:22:31 2021 +0800 net: hns3: refactor hns3 makefile to support hns3_common module Currently we plan to refactor PF and VF cmdq module. A new file folder hns3_common will be created to store new common APIs used by PF and VF cmdq module. Thus the PF and VF compilation process will both depends on the hns3_common. This may cause parallel building problems if we add a new makefile building unit. So this patch combined the PF and VF makefile scripts to the top level makefile to support the new hns3_common which will be created in the next patch. Signed-off-by: Jie Wang Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 8b974c122bc649895bc07191ec34633d8087323e Merge: cc5c9788106fb 30e693ee82d20 Author: Mark Brown Date: Fri Dec 31 13:21:39 2021 +0000 ASoC: Merge fixes So we can send to Linus. commit e8e4fcc047c6e0c5411faeb8cc29aed2e5036a00 Author: Lucas Tanure Date: Fri Dec 17 11:57:04 2021 +0000 ASoC: cs35l41: Create shared function for boost configuration ASoC and HDA will use the same registers to configure internal boost for the device Signed-off-by: Lucas Tanure Link: https://lore.kernel.org/r/20211217115708.882525-7-tanureal@opensource.cirrus.com Signed-off-by: Mark Brown commit 3bc3e3da657f17c14df8ae8fab58183407bd7521 Author: Lucas Tanure Date: Fri Dec 17 11:57:03 2021 +0000 ASoC: cs35l41: Create shared function for setting channels ASoC and HDA will use the same register to set channels for the device Signed-off-by: Lucas Tanure Link: https://lore.kernel.org/r/20211217115708.882525-6-tanureal@opensource.cirrus.com Signed-off-by: Mark Brown commit 8b2278604b6de27329ec7ed82ca696c4751111b6 Author: Lucas Tanure Date: Fri Dec 17 11:57:02 2021 +0000 ASoC: cs35l41: Create shared function for errata patches ASoC and HDA systems require the same errata patches, so move it to the shared code using a function the correctly applies the patches by revision Also, move CS35L41_DSP1_CCM_CORE_CTRL write to errata patch function as is required to be written at boot, but not in regmap_register_patch sequence as will affect waking up from hibernation Signed-off-by: Lucas Tanure Link: https://lore.kernel.org/r/20211217115708.882525-5-tanureal@opensource.cirrus.com Signed-off-by: Mark Brown commit 062ce0593315e22aac527389dd6dd4328c49f0fb Author: Lucas Tanure Date: Fri Dec 17 11:57:01 2021 +0000 ASoC: cs35l41: Move power initializations to reg_sequence ASoC and HDA systems for all revisions of CS35L41 will benefit from having this initialization, so add it to reg_sequence of each revision By moving to reg_sequence all gains are set to zero. And boost, monitoring parts, and class D amplifier are disabled. Signed-off-by: Lucas Tanure Link: https://lore.kernel.org/r/20211217115708.882525-4-tanureal@opensource.cirrus.com Signed-off-by: Mark Brown commit fe120d4cb6f6cd03007239e7c578b8703fe6d336 Author: Lucas Tanure Date: Fri Dec 17 11:57:00 2021 +0000 ASoC: cs35l41: Move cs35l41_otp_unpack to shared code ASoC and HDA will do the same cs35l41_otp_unpack, so move it to shared code Signed-off-by: Lucas Tanure Link: https://lore.kernel.org/r/20211217115708.882525-3-tanureal@opensource.cirrus.com Signed-off-by: Mark Brown commit a87d42227cf5614fe0040ddd1fe642c54298b42c Author: Lucas Tanure Date: Fri Dec 17 11:56:59 2021 +0000 ASoC: cs35l41: Convert tables to shared source code To support CS35L41 in HDA systems the HDA driver for CS35L41 would have to duplicate some functions that already exist on ASoC driver So instead of duplicate the code, use the new lib source as a shared resource for both ASoC and HDA Also, change the way CONFIG_SND_SOC_CS35L41 is selected, as reported by Intel Kernel test robot, it is possible to build SND_SOC_CS35L41_SPI/I2C without the main driver, which would lead to build failures. Signed-off-by: Lucas Tanure Reported-by: kernel test robot Link: https://lore.kernel.org/r/20211217115708.882525-2-tanureal@opensource.cirrus.com Signed-off-by: Mark Brown commit db5e1c209b92a67ab7c1d7771a48294c9c093f7c Author: Trevor Wu Date: Thu Dec 30 16:47:31 2021 +0800 ASoC: mediatek: mt8195: add playback support to PCM1_BE dai_link PCM1_BE should be a dai_link for both playback and capture. In the patch, the missing DPCM playback support is added. Signed-off-by: Trevor Wu Link: https://lore.kernel.org/r/20211230084731.31372-3-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit 2355028c0c54c03afb66c589347f1dc9f6fe2e38 Author: Trevor Wu Date: Thu Dec 30 16:47:30 2021 +0800 ASoC: mediatek: mt8195: correct pcmif BE dai control flow Originally, the conditions for preventing reentry are not correct. dai->component->active is not the state specifically for pcmif dai, so it is not a correct condition to indicate the status of pcmif dai. On the other hand, snd_soc_dai_stream_actvie() in prepare ops for both playback and capture possibly return true at the first entry when these two streams are opened at the same time. In the patch, I refer to the implementation in mt8192-dai-pcm.c. Clock and enabling bit for PCMIF are managed by DAPM, and the condition for prepare ops is replaced by the status of dai widget. Fixes: 1f95c019115c ("ASoC: mediatek: mt8195: support pcm in platform driver") Signed-off-by: Trevor Wu Link: https://lore.kernel.org/r/20211230084731.31372-2-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit 99a507a8ea28542ec196e2dd80096708e2482735 Author: Greg Kroah-Hartman Date: Fri Dec 31 13:42:30 2021 +0100 Revert "serdev: BREAK/FRAME/PARITY/OVERRUN notification prototype V2" This reverts commit d8e9a406a931f687945703a4bac45042eb81ce92. It needs some future changes as pointed out by Johan and is not ready to be merged just yet. Reported-by: Johan Hovold Cc: Magnus Damm Link: https://lore.kernel.org/r/Yc7oZ/1tu95Z4wPS@hovoldconsulting.com Signed-off-by: Greg Kroah-Hartman commit 9ce47e43a0f088653aa25ca465836a84114e0940 Merge: bee387131abe0 2997e4871621b Author: Miquel Raynal Date: Fri Dec 31 13:31:23 2021 +0100 Merge tag 'nand/for-5.17' into mtd/next Raw NAND core: * Export nand_read_page_hwecc_oob_first() GPMC memory controller for OMAP2 NAND controller: * GPMC: - Add support for AM64 SoC and allow build on K3 platforms - Use a compatible match table when checking for NAND controller - Use platform_get_irq() to get the interrupt Raw NAND controller drivers: * OMAP2 NAND controller: - Document the missing 'rb-gpios' DT property - Drop unused variable - Fix force_8bit flag behaviour for DMA mode - Move to exec_op interface - Use platform_get_irq() to get the interrupt * Renesas: - Add new NAND controller driver with its bindings and MAINTAINERS entry * Onenand: - Remove redundant variable ooblen * MPC5121: - Remove unused variable in ads5121_select_chip() * GPMI: - Add ERR007117 protection for nfc_apply_timings - Remove explicit default gpmi clock setting for i.MX6 - Use platform_get_irq_byname() to get the interrupt - Remove unneeded variable * Ingenic: - JZ4740 needs 'oob_first' read page function * Davinci: - Rewrite function description - Avoid duplicated page read - Don't calculate ECC when reading page Signed-off-by: Miquel Raynal commit bee387131abe02f43da0ba784446ed4c0dd06dbb Merge: 2dc6de1cd303b 5f340402bbfc1 Author: Miquel Raynal Date: Fri Dec 31 13:29:26 2021 +0100 Merge tag 'spi-nor/for-5.17' into mtd/next SPI NOR core changes: - Add Pratyush as SPI NOR co-maintainer. - Flash parameters initialization was done in a spaghetti way. Clean flash parameters initialization. - Rework the flash_info flags and clarify where one should be used. - Initialize all flash parameters based on JESD216 SFDP where possible. Flash parameters and settings that are SFDP discoverable should not be duplicated via flash_info flags at flash declaration. - Remove debugfs entries that duplicate sysfs entries. SPI NOR manufacturer drivers changes: - Use late_init() hook in various drivers to make it clear that those flash parameters are either not declared in the JESD216 SFDP standard, or the SFDP tables which define those flash parameters are not defined by the flash. - Fix mtd size for s3an flashes. - Write 2 bytes when disabling Octal DTR mode: 1 byte long transactions are not allowed in 8D-8D-8D mode. Signed-off-by: Miquel Raynal commit 2dc6de1cd303bf9298eee4b4ad4bbe911e8a8a1d Merge: 6420ac0af95db baaf965f94308 Author: Miquel Raynal Date: Fri Dec 31 13:28:36 2021 +0100 Merge tag 'cfi/for-5.17' into mtd/next Hyperbus changes for v5.17-rc1 Hyperbus changes: Couple of fixes in Renesas hyperbus rpc-if driver to avoid crash on module remove and for missing check for error value in probe. Signed-off-by: Miquel Raynal commit 2997e4871621bc56d3c19b447355091dafb6e505 Merge: ecb78b290bb56 dbcb124acebd8 Author: Miquel Raynal Date: Fri Dec 31 12:31:38 2021 +0100 Merge tag 'memory-controller-drv-omap-5.17' into nand/next Memory controller drivers for v5.17 - OMAP GPMC 1. Add support for AM64 SoC. 2. Minor improvement: use platform_get_irq(). [miquel.raynal@bootlin.com: A first commit introduced a new omap compatible and another moved the IDs to a header which created a conflict: moving the new ID as well in the header fixed it.] Signed-off-by: Miquel Raynal commit aa36c94853b2bcc4953e065c462deb1ade7f55be Author: Yevgeny Kliteynik Date: Sun Nov 28 21:48:47 2021 +0200 net/mlx5: Set SMFS as a default steering mode if device supports it Set SMFS (SW-managed flow steering) as a default steering mode instead of DMFS (device-managed flow steering) In SMFS, the driver writes the STEs (Steering Table Entries) directly to the device's ICM, which allows for a higher rule insertion rate than through using FW command interface, as it is done in DMFS. SMFS/DMFS steering modes can be configured through devlink param 'flow_steering_mode'. The possible values are 'smfs' or 'dmfs'. The desired 'flow_steering_mode' param value should be set before enabling switchdev mode. Example: # devlink dev param set pci/0000:05:00.0 name flow_steering_mode smfs # devlink dev eswitch set pci/0000:05:00.0 mode switchdev Signed-off-by: Yevgeny Kliteynik commit 4ff725e1d4adfd313bc9767523fc8d6e90d50f9c Author: Yevgeny Kliteynik Date: Tue Nov 23 02:11:12 2021 +0200 net/mlx5: DR, Ignore modify TTL if device doesn't support it When modifying TTL, packet's csum has to be recalculated. Due to HW issue in ConnectX-5, csum recalculation for modify TTL is supported through a work-around that is specifically enabled by configuration. If the work-around isn't enabled, ignore the modify TTL action rather than adding an unsupported action. Signed-off-by: Yevgeny Kliteynik commit cc2295cd54e4832108831fd0a119bc4e0d5f8d50 Author: Yevgeny Kliteynik Date: Thu Oct 14 02:34:00 2021 +0300 net/mlx5: DR, Improve steering for empty or RX/TX-only matchers Every matcher has RX and TX paths. When a new matcher is created, its RX and TX start/end anchors are connected to the respective RX and TX anchors of the previous and next matchers. This creates a potential performance issue: when a certain rule is added to a matcher, in many cases it is RX or TX only rule, which may create a long chain of RX/TX-only paths w/o the actual rules. This patch aims to handle this issue. RX and TX matchers are now handled separately: matcher connection in the matchers chain is split into two separate lists: RX only and TX only. when a new matcher is created, it is initially created 'detached' - its RX/TX members are not inserted into the table's matcher list. When an actual rule is added, only its appropriate RX or TX nic matchers are then added to the table's nic matchers list and inserted into its place in the chain of matchers. I.e., if the rule that is being added is an RX-only rule, only the RX part of the matcher will be connected to the chain, while TX part of the matcher remains detached and doesn't prolong the TX chain of the matchers. Same goes for rule deletion: when the last RX/TX rule of the nic matcher is destroyed, the nic matcher is removed from its list. Signed-off-by: Yevgeny Kliteynik commit f59464e257bdbd4df6df9a4505d7858a0baf6cf7 Author: Yevgeny Kliteynik Date: Mon Nov 8 02:42:50 2021 +0200 net/mlx5: DR, Add support for matching on geneve_tlv_option_0_exist field Match on geneve_tlv_option_0_exist field on devices that support STEv1. Signed-off-by: Muhammad Sammar Signed-off-by: Yevgeny Kliteynik commit 09753babaf464177b5998c7ebb25d495c4811833 Author: Muhammad Sammar Date: Sun Sep 5 17:07:49 2021 +0300 net/mlx5: DR, Support matching on tunnel headers 0 and 1 Tunnel headers are generic encapsulation headers, applies for all tunneling protocols identified by the device native parser or by the programmable parser, this support will enable raw matching headers 0 and 1. Signed-off-by: Muhammad Sammar Signed-off-by: Yevgeny Kliteynik commit 8c2b4fee9c4bb541ff027da0d906081f5363b182 Author: Muhammad Sammar Date: Sun Sep 5 14:54:59 2021 +0300 net/mlx5: DR, Add misc5 to match_param structs Add misc5 match params to enable matching tunnel headers. Signed-off-by: Muhammad Sammar commit 0f2a6c3b9219bdf497750258cd2ad513f0056b42 Author: Muhammad Sammar Date: Sun Sep 5 15:16:21 2021 +0300 net/mlx5: Add misc5 flow table match parameters Add support for misc5 match parameter as per HW spec, this will allow matching on tunnel_header fields. Signed-off-by: Muhammad Sammar Signed-off-by: Yevgeny Kliteynik commit b54128275ef86dd699fcb23d7e6df21f251dc038 Author: Yevgeny Kliteynik Date: Wed Sep 29 15:36:32 2021 +0300 net/mlx5: DR, Warn on failure to destroy objects due to refcount Add WARN_ON_ONCE on refcount checks in SW steering object destructors Signed-off-by: Paul Blakey Signed-off-by: Yevgeny Kliteynik commit e3a0f40b2f90de86c1603126a5ad137d9677f605 Author: Yevgeny Kliteynik Date: Sun Oct 24 21:36:30 2021 +0300 net/mlx5: DR, Add support for UPLINK destination type Add support for a new destination type - UPLINK. Signed-off-by: Yevgeny Kliteynik commit 9222f0b27da22579bea02cd2f1bc87beced2ef8d Author: Muhammad Sammar Date: Wed Dec 9 13:40:50 2020 +0200 net/mlx5: DR, Add support for dumping steering info Extend mlx5 debugfs support to present Software Steering resources: dr_domain including it's tables, matchers and rules. The interface is read-only. While dump is being presented, new steering rules cannot be inserted/deleted. The steering information is dumped in the CSV form with the following format: ,, ,..., This data can be read at the following path: /sys/kernel/debug/mlx5//steering/fdb/ Example: # cat /sys/kernel/debug/mlx5/0000:82:00.0/steering/fdb/dmn_000018644 3100,0x55caa4621c50,0xee802,4,65533 3101,0x55caa4621c50,0xe0100008 Changes in V2: - Reduce temp hex buffer size and avoid unnecessary memset - Use bin2hex() instead of DIY loop - Don't check debugfs functions return values Signed-off-by: Muhammad Sammar Signed-off-by: Yevgeny Kliteynik commit 7766c9b922febe18b4eb124eb731dd9a1ec71373 Author: Muhammad Sammar Date: Mon Jul 5 15:37:56 2021 +0300 net/mlx5: DR, Add missing reserved fields to dr_match_param Add the reserved fields to dr_match_param and arrange as mlx5_ifc_dr_match_param_bits. Signed-off-by: Muhammad Sammar commit 89cdba3224f07703e2272212db131cabe152979e Author: Yevgeny Kliteynik Date: Thu Nov 11 00:22:29 2021 +0200 net/mlx5: DR, Add check for flex parser ID value Allow only legal values for flex parser ID - values from 0 to 7. For other values skip the parser, and as a result the matcher creation will fail for using invalid flex parser ID. Signed-off-by: Hamdan Igbaria Signed-off-by: Yevgeny Kliteynik commit 08fac109f7bb5e12ae14def56b3ad57ce67cd9fe Author: Yevgeny Kliteynik Date: Tue Nov 16 17:57:57 2021 +0200 net/mlx5: DR, Rename list field in matcher struct to list_node In dr_types structs, some list fields are list heads, and some are just list nodes that are stored on the other structs' lists. Rename the appropriate list field to reflect this distinction. Signed-off-by: Yevgeny Kliteynik commit 32e9bd58530720d9a78d051ac6743ae0ffcb7531 Author: Yevgeny Kliteynik Date: Thu Nov 11 00:52:59 2021 +0200 net/mlx5: DR, Remove unused struct member in matcher Signed-off-by: Yevgeny Kliteynik commit c3fb0e280b4cdbf382f59eb6b276e4c6047bc219 Author: Yevgeny Kliteynik Date: Thu Nov 18 02:32:37 2021 +0200 net/mlx5: DR, Fix lower case macro prefix "mlx5_" to "MLX5_" Macros prefix should be capital letters - fix the prefix in mlx5_FLEX_PARSER_MPLS_OVER_UDP_ENABLED. Signed-off-by: Yevgeny Kliteynik commit 84dfac39c61fde04126e23723138128b50cd036f Author: Yevgeny Kliteynik Date: Tue Dec 14 12:56:18 2021 +0200 net/mlx5: DR, Fix error flow in creating matcher The error code of nic matcher init functions wasn't checked. This patch improves the matcher init function and fix error flow bug: the handling of match parameter is moved into a separate function and error flow is simplified. Signed-off-by: Yevgeny Kliteynik commit 4cab5dfd15b77cde2b965bbf71a86876a42684da Author: Giovanni Cabiddu Date: Fri Dec 24 11:05:32 2021 +0000 crypto: qat - fix definition of ring reset results The ring reset result values are defined starting from 0x1 instead of 0. This causes out-of-tree drivers that support this message to understand that a ring reset failed even if the operation was successful. Fix by starting the definition of ring reset result values from 0. Fixes: 0bba03ce9739 ("crypto: qat - add PFVF support to enable the reset of ring pairs") Signed-off-by: Giovanni Cabiddu Reported-by: Adam Guerin Reviewed-by: Marco Chiappero Signed-off-by: Herbert Xu commit c5d692a2335d64ac390aeb8ab6c4ac9f662e1be4 Author: Tom Rix Date: Wed Dec 22 09:29:23 2021 -0800 crypto: hisilicon - cleanup warning in qm_get_qos_value() Building with clang static analysis returns this warning: qm.c:4382:11: warning: The left operand of '==' is a garbage value if (*val == 0 || *val > QM_QOS_MAX_VAL || ret) { ~~~~ ^ The call to qm_qos_value_init() can return an error without setting *val. So check ret before checking *val. Fixes: 72b010dc33b9 ("crypto: hisilicon/qm - supports writing QoS int the host") Signed-off-by: Tom Rix Signed-off-by: Herbert Xu commit 304b4acee2f023a67f122d15a37b40ce460244d9 Author: Stephan Müller Date: Tue Dec 21 20:31:42 2021 +0100 crypto: kdf - select SHA-256 required for self-test The self test of the KDF is based on SHA-256. Thus, this algorithm must be present as otherwise a warning is issued. Reported-by: kernel test robot Signed-off-by: Stephan Mueller Signed-off-by: Herbert Xu commit d480a26bdf872529919e7c30e17f79d0d7b8c4da Author: Jakub Kicinski Date: Tue Dec 21 07:06:11 2021 -0800 crypto: x86/aesni - don't require alignment of data x86 AES-NI routines can deal with unaligned data. Crypto context (key, iv etc.) have to be aligned but we take care of that separately by copying it onto the stack. We were feeding unaligned data into crypto routines up until commit 83c83e658863 ("crypto: aesni - refactor scatterlist processing") switched to use the full skcipher API which uses cra_alignmask to decide data alignment. This fixes 21% performance regression in kTLS. Tested by booting with CONFIG_CRYPTO_MANAGER_EXTRA_TESTS=y (and running thru various kTLS packets). CC: stable@vger.kernel.org # 5.15+ Fixes: 83c83e658863 ("crypto: aesni - refactor scatterlist processing") Signed-off-by: Jakub Kicinski Acked-by: Ard Biesheuvel Signed-off-by: Herbert Xu commit ef4d891499442a156655b0c0df56bdf539897495 Author: Yang Li Date: Tue Dec 21 08:38:28 2021 +0800 crypto: ccp - remove unneeded semicolon Eliminate the following coccicheck warning: ./drivers/crypto/ccp/sev-dev.c:263:2-3: Unneeded semicolon Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Herbert Xu commit 29009604ad4e3ef784fd9b9fef6f23610ddf633d Author: Marek Vasut Date: Mon Dec 20 20:50:22 2021 +0100 crypto: stm32/crc32 - Fix kernel BUG triggered in probe() The include/linux/crypto.h struct crypto_alg field cra_driver_name description states "Unique name of the transformation provider. " ... " this contains the name of the chip or provider and the name of the transformation algorithm." In case of the stm32-crc driver, field cra_driver_name is identical for all registered transformation providers and set to the name of the driver itself, which is incorrect. This patch fixes it by assigning a unique cra_driver_name to each registered transformation provider. The kernel crash is triggered when the driver calls crypto_register_shashes() which calls crypto_register_shash(), which calls crypto_register_alg(), which calls __crypto_register_alg(), which returns -EEXIST, which is propagated back through this call chain. Upon -EEXIST from crypto_register_shash(), the crypto_register_shashes() starts unregistering the providers back, and calls crypto_unregister_shash(), which calls crypto_unregister_alg(), and this is where the BUG() triggers due to incorrect cra_refcnt. Fixes: b51dbe90912a ("crypto: stm32 - Support for STM32 CRC32 crypto module") Signed-off-by: Marek Vasut Cc: # 4.12+ Cc: Alexandre Torgue Cc: Fabien Dessenne Cc: Herbert Xu Cc: Lionel Debieve Cc: Nicolas Toromanoff Cc: linux-arm-kernel@lists.infradead.org Cc: linux-stm32@st-md-mailman.stormreply.com To: linux-crypto@vger.kernel.org Acked-by: Nicolas Toromanoff Signed-off-by: Herbert Xu commit db1eafb8c512f53c4b0e8673b5a89f9ad14de4fe Author: Tianjia Zhang Date: Mon Dec 20 17:23:18 2021 +0800 crypto: s390/sha512 - Use macros instead of direct IV numbers In the init functions of sha512 and sha384, the initial hash value use macros instead of numbers. Signed-off-by: Tianjia Zhang Signed-off-by: Herbert Xu commit e0583b6acb92683ba192c745f12ef31997e9b8b1 Author: Tianjia Zhang Date: Mon Dec 20 17:23:17 2021 +0800 crypto: sparc/sha - remove duplicate hash init function sha*_base_init() series functions has implemented the initialization of the hash context, this commit use sha*_base_init() function to replace repeated implementations. Signed-off-by: Tianjia Zhang Signed-off-by: Herbert Xu commit 41ea0f6c19f6fa403370a9e40e4d500041eb4fc8 Author: Tianjia Zhang Date: Mon Dec 20 17:23:16 2021 +0800 crypto: powerpc/sha - remove duplicate hash init function sha*_base_init() series functions has implemented the initialization of the hash context, this commit use sha*_base_init() function to replace repeated implementations. Signed-off-by: Tianjia Zhang Signed-off-by: Herbert Xu commit 63bdbfc146aec8a414f07af8208f2488ffeacf32 Author: Tianjia Zhang Date: Mon Dec 20 17:23:15 2021 +0800 crypto: mips/sha - remove duplicate hash init function sha*_base_init() series functions has implemented the initialization of the hash context, this commit use sha*_base_init() function to replace repeated implementations. Signed-off-by: Tianjia Zhang Signed-off-by: Herbert Xu commit 96ede30f4b172ab6c83789f6bb420b3c3c029653 Author: Tianjia Zhang Date: Mon Dec 20 17:23:14 2021 +0800 crypto: sha256 - remove duplicate generic hash init function crypto_sha256_init() and sha256_base_init() are the same repeated implementations, remove the crypto_sha256_init() in generic implementation, sha224 is the same process. Signed-off-by: Tianjia Zhang Signed-off-by: Herbert Xu commit 908dffaf88a248e542bdae3ca174f27b8f4ccf37 Author: Stephan Müller Date: Mon Dec 20 07:21:53 2021 +0100 crypto: jitter - add oversampling of noise source The output n bits can receive more than n bits of min entropy, of course, but the fixed output of the conditioning function can only asymptotically approach the output size bits of min entropy, not attain that bound. Random maps will tend to have output collisions, which reduces the creditable output entropy (that is what SP 800-90B Section 3.1.5.1.2 attempts to bound). The value "64" is justified in Appendix A.4 of the current 90C draft, and aligns with NIST's in "epsilon" definition in this document, which is that a string can be considered "full entropy" if you can bound the min entropy in each bit of output to at least 1-epsilon, where epsilon is required to be <= 2^(-32). Note, this patch causes the Jitter RNG to cut its performance in half in FIPS mode because the conditioning function of the LFSR produces 64 bits of entropy in one block. The oversampling requires that additionally 64 bits of entropy are sampled from the noise source. If the conditioner is changed, such as using SHA-256, the impact of the oversampling is only one fourth, because for the 256 bit block of the conditioner, only 64 additional bits from the noise source must be sampled. This patch is derived from the user space jitterentropy-library. Signed-off-by: Stephan Mueller Reviewed-by: Simo Sorce Signed-off-by: Herbert Xu commit 25d04a382ebb409f7512dd668d81997bf5494df1 Author: Kai Ye Date: Mon Dec 20 10:14:18 2021 +0800 MAINTAINERS: update SEC2 driver maintainers list Adding Kai Ye as SEC2 maintainer. Signed-off-by: Kai Ye Signed-off-by: Zaibo Xu Signed-off-by: Herbert Xu commit 9e6b19a66d9b6b94395478fe79c5a3ccba181ad3 Author: Leon Huayra Date: Wed Dec 29 22:44:22 2021 +0800 bpf: Fix typo in a comment in bpf lpm_trie. Fix typo in a comment in trie_update_elem(). Signed-off-by: Leon Huayra Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211229144422.70339-1-hffilwlqm@gmail.com commit af30f8eaa8fe4ff1987280f716309711997bd979 Author: Rafał Miłecki Date: Wed Dec 29 18:16:42 2021 +0100 net: dsa: bcm_sf2: refactor LED regs access 1. Define more regs. Some switches (e.g. BCM4908) have up to 6 regs. 2. Add helper for handling non-lineral port <-> reg mappings. 3. Add support for 12 B LED reg blocks on BCM4908 (different layout) Complete support for LEDs setup will be implemented once Linux receives a proper design & implementation for "hardware" LEDs. Signed-off-by: Rafał Miłecki Acked-by: Florian Fainelli Link: https://lore.kernel.org/r/20211229171642.22942-1-zajec5@gmail.com Signed-off-by: Jakub Kicinski commit d6c6d0bb2cb3af91c9c1546af7cdf4770d0df443 Author: Lukas Bulwahn Date: Wed Dec 29 12:36:20 2021 +0100 net: remove references to CONFIG_IRDA in network header files Commit d64c2a76123f ("staging: irda: remove the irda network stack and drivers") removes the config IRDA. Remove the remaining references to this non-existing config in the network header files. Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20211229113620.19368-1-lukas.bulwahn@gmail.com Signed-off-by: Jakub Kicinski commit 314fbde95769e0cff68ef74ccc261935bb0c6852 Author: Colin Ian King Date: Thu Dec 30 16:12:30 2021 +0000 nfc: st21nfca: remove redundant assignment to variable i Variable i is being assigned a value that is never read, the assignment is redundant and can be removed. Cleans up clang-scan build warning: drivers/nfc/st21nfca/i2c.c:319:4: warning: Value stored to 'i' is never read [deadcode.DeadStores] i = 0; Signed-off-by: Colin Ian King Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20211230161230.428457-1-colin.i.king@gmail.com Signed-off-by: Jakub Kicinski commit cb6846fbb83b574c85c2a80211b402a6347b60b1 Merge: 011e8c3239ed3 0637d41786a3a Author: Dave Airlie Date: Fri Dec 31 10:59:16 2021 +1000 Merge tag 'amd-drm-next-5.17-2021-12-30' of ssh://gitlab.freedesktop.org/agd5f/linux into drm-next amd-drm-next-5.17-2021-12-30: amdgpu: - Suspend/resume fixes - Fence fix - Misc code cleanups - IP discovery fixes - SRIOV fixes - RAS fixes - GMC 8 VRAM detection fix - FRU fixes for Aldebaran - Display fixes amdkfd: - SVM fixes - IP discovery fixes Signed-off-by: Dave Airlie From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20211230141032.613596-1-alexander.deucher@amd.com commit 63d000c3dc0a8ddd2f3778982ce6d19593656eda Author: Christoph Hellwig Date: Thu Dec 23 11:19:06 2021 +0100 bpf, docs: Move the packet access instructions last in instruction-set.rst The packet access instructions are a convoluted leftover from classic BPF. Move them last past the much more important atomic operations, and improve the rendering of the code example. Signed-off-by: Christoph Hellwig Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211223101906.977624-5-hch@lst.de commit 5e4dd19f00491faf10912e1f15a47ab010e0e9ce Author: Christoph Hellwig Date: Thu Dec 23 11:19:05 2021 +0100 bpf, docs: Generate nicer tables for instruction encodings Use RST tables that are nicely readable both in plain ascii as well as in html to render the instruction encodings, and add a few subheadings to better structure the text. Signed-off-by: Christoph Hellwig Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211223101906.977624-4-hch@lst.de commit 41db511a3a1622aa97064a3447e878eeb1a594b7 Author: Christoph Hellwig Date: Thu Dec 23 11:19:04 2021 +0100 bpf, docs: Split the comparism to classic BPF from instruction-set.rst Split the introductory that explain eBPF vs classic BPF and how it maps to hardware from the instruction set specification into a standalone document. This duplicates a little bit of information but gives us a useful reference for the eBPF instrution set that is not encumbered by classic BPF. Signed-off-by: Christoph Hellwig Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211223101906.977624-3-hch@lst.de commit fa86aa77d4da211fc814325cdb3a572b1b851058 Author: Christoph Hellwig Date: Thu Dec 23 11:19:03 2021 +0100 bpf, docs: Fix verifier references Use normal RST file reference instead of linkage copied from the old filter.rst document that does not actually work when using HTML output. Signed-off-by: Christoph Hellwig Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211223101906.977624-2-hch@lst.de commit aec53e60e0e665b359328b946654bc3ef77aed57 Merge: 49dc9013e34b2 74c78b4291b44 Author: Jakub Kicinski Date: Thu Dec 30 12:12:12 2021 -0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net drivers/net/ethernet/mellanox/mlx5/core/en_tc.c commit 077cdda764c7 ("net/mlx5e: TC, Fix memory leak with rules with internal port") commit 31108d142f36 ("net/mlx5: Fix some error handling paths in 'mlx5e_tc_add_fdb_flow()'") commit 4390c6edc0fb ("net/mlx5: Fix some error handling paths in 'mlx5e_tc_add_fdb_flow()'") https://lore.kernel.org/all/20211229065352.30178-1-saeed@kernel.org/ net/smc/smc_wr.c commit 49dc9013e34b ("net/smc: Use the bitmap API when applicable") commit 349d43127dac ("net/smc: fix kernel panic caused by race of smc_sock") bitmap_zero()/memset() is removed by the fix Signed-off-by: Jakub Kicinski commit 8120832d8f82aa7316c578fbccf11e385a5b3601 Author: Manfred Spraul Date: Wed Dec 22 15:09:31 2021 +0100 ACPI: processor: thermal: avoid cpufreq_get_policy() cpu_has_cpufreq() stores a 'struct cpufreq_policy' on the stack. Unfortunately, with debugging options enabled, the structure can be larger than 1024 bytes, which causes a compiler warning/error. (actually observed: 1184 bytes). Therefore: Switch to cpufreq_cpu_get(). Signed-off-by: Manfred Spraul Signed-off-by: Rafael J. Wysocki commit 998e7ea8c641fc6bbca1acd478c6824733ac9851 Author: Greg Kroah-Hartman Date: Wed Dec 29 15:14:54 2021 +0100 platform/x86: intel-uncore-frequency: use default_groups in kobj_type There are currently 2 ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the uncore-frequency sysfs code to use default_groups field which has been the preferred way since aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field. Cc: Srinivas Pandruvada Cc: Hans de Goede Cc: Mark Gross Cc: platform-driver-x86@vger.kernel.org Signed-off-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20211229141454.2552950-1-gregkh@linuxfoundation.org Signed-off-by: Hans de Goede commit afca4cbe3a25dbe16424e6199793b38f41a17ed9 Author: Greg Kroah-Hartman Date: Wed Dec 29 15:13:32 2021 +0100 x86/platform/uv: use default_groups in kobj_type There are currently 2 ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the uv sysfs code to use default_groups field which has been the preferred way since aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field. Cc: Justin Ernst Cc: Hans de Goede Cc: Mark Gross Cc: platform-driver-x86@vger.kernel.org Signed-off-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20211229141332.2552428-1-gregkh@linuxfoundation.org Signed-off-by: Hans de Goede commit 0890186a965868fa464582d5610c74eeff252c93 Author: Hans de Goede Date: Thu Dec 30 15:17:22 2021 +0100 serdev: Do not instantiate serdevs on boards with known bogus DSDT entries x86 ACPI devices which ship with only Android as their factory image use older kernels which do not yet support ACPI serdev enumeration, as such the serdev information in their ACPI tables is not reliable. For example on the Asus ME176C tablet the serdev describing the Bluetooth HCI points to the serdev_controller connected to the GPS and the other way around. Use the new acpi_quirk_skip_serdev_enumeration() helper to identify known boards with this issue and then either abort adding the serdev controller (creating a tty cdev instead) or only create the controller leaving the instantation of the serdev itself up to platform code. In the case where only the serdev controller is created the necessary serdevs will instead be instantiated by the drivers/platform/x86/x86-android-tablets.c kernel module. Acked-by: Greg Kroah-Hartman Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit a6e1445c445678f211f0aac79713e8c2fcab0c13 Author: Hans de Goede Date: Thu Dec 30 15:17:21 2021 +0100 i2c: acpi: Do not instantiate I2C-clients on boards with known bogus DSDT entries x86 ACPI devices which ship with only Android as their factory image usually declare a whole bunch of bogus I2C devices in their ACPI tables. Instantiating I2C clients for these bogus devices causes various issues, e.g. GPIO/IRQ resource conflicts because sometimes drivers do bind to them. The Android x86 kernel fork shipped on these devices has some special code to remove these bogus devices, instead of just fixing the DSDT . Use the new acpi_quirk_skip_i2c_client_enumeration() helper to identify known boards / acpi devices with this issue, and skip enumerating these. Note these boards typically do actually have I2C devices, just different ones then the ones described in their DSDT. The devices which are actually present are manually instantiated by the drivers/platform/x86/x86-android-tablets.c kernel module. Reviewed-by: Mika Westerberg Signed-off-by: Hans de Goede Reviewed-by: Wolfram Sang Signed-off-by: Rafael J. Wysocki commit 35f9e773bb883a1be87410570f92c8c438e0478b Author: Hans de Goede Date: Thu Dec 30 15:17:20 2021 +0100 ACPI / x86: Add acpi_quirk_skip_[i2c_client|serdev]_enumeration() helpers x86 ACPI boards which ship with only Android as their factory image usually declare a whole bunch of bogus I2C devs in their ACPI tables and sometimes there are issues with serdev devices on these boards too, e.g. the resource points to the wrong serdev_controller. Instantiating I2C / serdev devs for these bogus devs causes various issues, e.g. GPIO/IRQ resource conflicts because sometimes drivers do bind to them. The Android x86 kernel fork shipped on these devices has some special code to remove the bogus I2C clients (and serdevs are ignored completely). Introduce acpi_quirk_skip_i2c_client_enumeration() and acpi_quirk_skip_serdev_enumeration() helpers. Which can be used by the I2C/ serdev code to skip instantiating any I2C or serdev devs on broken boards. These 2 helpers are added to drivers/acpi/x86/utils.c so that the DMI table can be shared between the I2C and serdev code. Note these boards typically do actually have I2C and serdev devices, just different ones then the ones described in their DSDT. The devices which are actually present are manually instantiated by the drivers/platform/x86/x86-android-tablets.c kernel module. The new helpers are only build if CONFIG_X86_ANDROID_TABLETS is enabled, otherwise they are empty stubs to not unnecessarily grow the kernel size. Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit 38fec059bb69793f38cfa7a671d4bdbfe2a647aa Author: Huang Rui Date: Fri Dec 24 09:05:08 2021 +0800 MAINTAINERS: Add AMD P-State driver maintainer entry I will continue to add new feature and processor support, optimize the performance, and handle the issues for AMD P-State driver. Signed-off-by: Huang Rui Signed-off-by: Rafael J. Wysocki commit c22760885fd6f7161fabde8e7db63d7f085b125a Author: Huang Rui Date: Fri Dec 24 09:05:07 2021 +0800 Documentation: amd-pstate: Add AMD P-State driver introduction Introduce the AMD P-State driver design and implementation. Signed-off-by: Huang Rui Signed-off-by: Rafael J. Wysocki commit 3ad7fde16a04aa70df8a59cba99e225ef9adf42f Author: Huang Rui Date: Fri Dec 24 09:05:06 2021 +0800 cpufreq: amd-pstate: Add AMD P-State performance attributes Introduce sysfs attributes to get the different level AMD P-State performances. Signed-off-by: Huang Rui Signed-off-by: Rafael J. Wysocki commit ec4e3326a95507ea96fbad21b9472f5ba25500a7 Author: Huang Rui Date: Fri Dec 24 09:05:05 2021 +0800 cpufreq: amd-pstate: Add AMD P-State frequencies attributes Introduce sysfs attributes to get the different level processor frequencies. Signed-off-by: Huang Rui Signed-off-by: Rafael J. Wysocki commit 41271016dfa4a08487bf2862f817edc9070489d1 Author: Huang Rui Date: Fri Dec 24 09:05:04 2021 +0800 cpufreq: amd-pstate: Add boost mode support for AMD P-State If the sbios supports the boost mode of AMD P-State, let's switch to boost enabled by default. Signed-off-by: Huang Rui Signed-off-by: Rafael J. Wysocki commit 60e10f896dbf6d78f912e4972081bd4119131376 Author: Huang Rui Date: Fri Dec 24 09:05:03 2021 +0800 cpufreq: amd-pstate: Add trace for AMD P-State module Add trace event to monitor the performance value changes which is controlled by cpu governors. Signed-off-by: Huang Rui Signed-off-by: Rafael J. Wysocki commit e059c184da47e92c6236f26b0fdaf9e92f0d55b5 Author: Huang Rui Date: Fri Dec 24 09:05:02 2021 +0800 cpufreq: amd-pstate: Introduce the support for the processors with shared memory solution In some of Zen2 and Zen3 based processors, they are using the shared memory that exposed from ACPI SBIOS. In this kind of the processors, there is no MSR support, so we add acpi cppc function as the backend for them. It is using a module param (shared_mem) to enable related processors manually. We will enable this by default once we address performance issue on this solution. Signed-off-by: Jinzhou Su Signed-off-by: Huang Rui Signed-off-by: Rafael J. Wysocki commit 1d215f0319c20662b701692a2fafc7b3b8a58ae1 Author: Huang Rui Date: Fri Dec 24 09:05:01 2021 +0800 cpufreq: amd-pstate: Add fast switch function for AMD P-State Introduce the fast switch function for AMD P-State on the AMD processors which support the full MSR register control. It's able to decrease the latency on interrupt context. Signed-off-by: Huang Rui Signed-off-by: Rafael J. Wysocki commit ec437d71db77a181227bf6d0ac9d4a80e58ecf0f Author: Huang Rui Date: Fri Dec 24 09:05:00 2021 +0800 cpufreq: amd-pstate: Introduce a new AMD P-State driver to support future processors AMD P-State is the AMD CPU performance scaling driver that introduces a new CPU frequency control mechanism on AMD Zen based CPU series in Linux kernel. The new mechanism is based on Collaborative processor performance control (CPPC) which is finer grain frequency management than legacy ACPI hardware P-States. Current AMD CPU platforms are using the ACPI P-states driver to manage CPU frequency and clocks with switching only in 3 P-states. AMD P-State is to replace the ACPI P-states controls, allows a flexible, low-latency interface for the Linux kernel to directly communicate the performance hints to hardware. AMD P-State leverages the Linux kernel governors such as *schedutil*, *ondemand*, etc. to manage the performance hints which are provided by CPPC hardware functionality. The first version for AMD P-State is to support one of the Zen3 processors, and we will support more in future after we verify the hardware and SBIOS functionalities. There are two types of hardware implementations for AMD P-State: one is full MSR support and another is shared memory support. It can use X86_FEATURE_CPPC feature flag to distinguish the different types. Using the new AMD P-State method + kernel governors (*schedutil*, *ondemand*, ...) to manage the frequency update is the most appropriate bridge between AMD Zen based hardware processor and Linux kernel, the processor is able to adjust to the most efficiency frequency according to the kernel scheduler loading. Please check the detailed CPU feature and MSR register description in Processor Programming Reference (PPR) for AMD Family 19h Model 51h, Revision A1 Processors: https://www.amd.com/system/files/TechDocs/56569-A1-PUB.zip Signed-off-by: Huang Rui Signed-off-by: Rafael J. Wysocki commit fb0b00af04d083770d6e2762b2838357519f7d2d Author: Jinzhou Su Date: Fri Dec 24 09:04:59 2021 +0800 ACPI: CPPC: Add CPPC enable register function Add a new function to enable CPPC feature. This function will write Continuous Performance Control package EnableRegister field on the processor. CPPC EnableRegister register described in section 8.4.7.1 of ACPI 6.4: This element is optional. If supported, contains a resource descriptor with a single Register() descriptor that describes a register to which OSPM writes a One to enable CPPC on this processor. Before this register is set, the processor will be controlled by legacy mechanisms (ACPI Pstates, firmware, etc.). This register will be used for AMD processors to enable AMD P-State function instead of legacy ACPI P-States. Signed-off-by: Jinzhou Su Signed-off-by: Huang Rui Signed-off-by: Rafael J. Wysocki commit 2aeca6bd02776d7f56a49a32be0dd184f204d888 Author: Mario Limonciello Date: Fri Dec 24 09:04:58 2021 +0800 ACPI: CPPC: Check present CPUs for determining _CPC is valid As this is a static check, it should be based upon what is currently present on the system. This makes probeing more deterministic. While local APIC flags field (lapic_flags) of cpu core in MADT table is 0, then the cpu core won't be enabled. In this case, _CPC won't be found in this core, and return back to _CPC invalid with walking through possible cpus (include disable cpus). This is not expected, so switch to check present CPUs instead. Reported-by: Jinzhou Su Signed-off-by: Mario Limonciello Signed-off-by: Huang Rui Signed-off-by: Rafael J. Wysocki commit a2c8f92bea5f8f1a87fc3caf063d67876dbf5d47 Author: Steven Noonan Date: Fri Dec 24 09:04:57 2021 +0800 ACPI: CPPC: Implement support for SystemIO registers According to the ACPI v6.2 (and later) specification, SystemIO can be used for _CPC registers. This teaches cppc_acpi how to handle such registers. This patch was tested using the amd_pstate driver on my Zephyrus G15 (model GA503QS) using the current version 410 BIOS, which uses a SystemIO register for the HighestPerformance element in _CPC. Signed-off-by: Steven Noonan Signed-off-by: Huang Rui Signed-off-by: Rafael J. Wysocki commit 89aa94b4a218339b08f052a28c55322d5a13fc9e Author: Huang Rui Date: Fri Dec 24 09:04:56 2021 +0800 x86/msr: Add AMD CPPC MSR definitions AMD CPPC (Collaborative Processor Performance Control) function uses MSR registers to manage the performance hints. So add the MSR register macro here. Signed-off-by: Huang Rui Acked-by: Borislav Petkov Signed-off-by: Rafael J. Wysocki commit ab92184ff8f12979f3d3dd5ed601ed85770d81ba Author: Yue Hu Date: Tue Dec 28 13:46:04 2021 +0800 erofs: add on-disk compressed tail-packing inline support Introduces erofs compressed tail-packing inline support. This approach adds a new field called `h_idata_size' in the per-file compression header to indicate the encoded size of each tail-packing pcluster. At runtime, it will find the start logical offset of the tail pcluster when initializing per-inode zmap and record such extent (headlcn, idataoff) information to the in-memory inode. Therefore, follow-on requests can directly recognize if one pcluster is a tail-packing inline pcluster or not. Link: https://lore.kernel.org/r/20211228054604.114518-6-hsiangkao@linux.alibaba.com Reviewed-by: Chao Yu Signed-off-by: Yue Hu Signed-off-by: Gao Xiang commit cecf864d3d76d50e3d9c58145e286a0b8c284e92 Author: Yue Hu Date: Wed Dec 29 07:29:19 2021 +0800 erofs: support inline data decompression Currently, we have already support tail-packing inline for uncompressed file, let's also implement this for compressed files to save I/Os and storage space. Different from normal pclusters, compressed data is available in advance because of other metadata I/Os. Therefore, they directly move into the bypass queue without extra I/O submission. It's the last compression feature before folio/subpage support. Link: https://lore.kernel.org/r/20211228232919.21413-1-xiang@kernel.org Reviewed-by: Chao Yu Signed-off-by: Yue Hu Signed-off-by: Gao Xiang commit ab749badf9f41f32509cd103391b81ea7e684b76 Author: Gao Xiang Date: Tue Dec 28 13:46:02 2021 +0800 erofs: support unaligned data decompression Previously, compressed data was assumed as block-aligned. This should be changed due to in-block tail-packing inline data. Link: https://lore.kernel.org/r/20211228054604.114518-4-hsiangkao@linux.alibaba.com Reviewed-by: Chao Yu Signed-off-by: Yue Hu Signed-off-by: Gao Xiang commit f2ee4759fb700b32a1bd830960fe86bf6bdfd0ab Author: Uwe Kleine-König Date: Thu Dec 30 16:03:00 2021 +0100 counter: remove old and now unused registration API Usage of counter_register() yields issues in device lifetime tracking. All drivers were converted to the new API, so the old one can go away. Reviewed-by: Jonathan Cameron Acked-by: William Breathitt Gray Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20211230150300.72196-24-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 02758cb20dff4852e5dceed6e828f9a2eb34d6e4 Author: Uwe Kleine-König Date: Thu Dec 30 16:02:59 2021 +0100 counter: ti-eqep: Convert to new counter registration This fixes device lifetime issues where it was possible to free a live struct device. Fixes: f213729f6796 ("counter: new TI eQEP driver") Reviewed-by: Jonathan Cameron Acked-by: William Breathitt Gray Acked-by: David Lechner Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20211230150300.72196-23-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit e75d678d041fe55c7289e2a3d36de9c4f0abbf97 Author: Uwe Kleine-König Date: Thu Dec 30 16:02:58 2021 +0100 counter: stm32-lptimer-cnt: Convert to new counter registration This fixes device lifetime issues where it was possible to free a live struct device. Fixes: 597f55e3f36c ("counter: stm32-lptimer: add counter device") Reviewed-by: Jonathan Cameron Acked-by: William Breathitt Gray Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20211230150300.72196-22-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit e1717d2ea09fb83f3211bcc9ceeaf42fce58fae5 Author: Uwe Kleine-König Date: Thu Dec 30 16:02:57 2021 +0100 counter: stm32-timer-cnt: Convert to new counter registration This fixes device lifetime issues where it was possible to free a live struct device. Fixes: ad29937e206f ("counter: Add STM32 Timer quadrature encoder") Reviewed-by: Jonathan Cameron Acked-by: William Breathitt Gray Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20211230150300.72196-21-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 5998ea6214249e2fe4d23ad43319f0bf4c7d5903 Author: Uwe Kleine-König Date: Thu Dec 30 16:02:56 2021 +0100 counter: microchip-tcb-capture: Convert to new counter registration This fixes device lifetime issues where it was possible to free a live struct device. Fixes: 106b104137fd ("counter: Add microchip TCB capture counter") Reviewed-by: Jonathan Cameron Acked-by: William Breathitt Gray Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20211230150300.72196-20-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit b5d6547c8e545269caca7eadc9c490e1201673cf Author: Uwe Kleine-König Date: Thu Dec 30 16:02:55 2021 +0100 counter: ftm-quaddec: Convert to new counter registration This fixes device lifetime issues where it was possible to free a live struct device. Fixes: a3b9a99980d9 ("counter: add FlexTimer Module Quadrature decoder counter driver") Reviewed-by: Jonathan Cameron Acked-by: William Breathitt Gray Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20211230150300.72196-19-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit e99dec87a9d6890e9cfb806be07e692a6decb92f Author: Uwe Kleine-König Date: Thu Dec 30 16:02:54 2021 +0100 counter: intel-qep: Convert to new counter registration This fixes device lifetime issues where it was possible to free a live struct device. Fixes: b711f687a1c1 ("counter: Add support for Intel Quadrature Encoder Peripheral") Tested-by: Jarkko Nikula Reviewed-by: Jonathan Cameron Acked-by: William Breathitt Gray Acked-by: Jarkko Nikula Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20211230150300.72196-18-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit aefc7e1797243eaa7a5e03629819d4aaa3c3feae Author: Uwe Kleine-König Date: Thu Dec 30 16:02:53 2021 +0100 counter: interrupt-cnt: Convert to new counter registration This fixes device lifetime issues where it was possible to free a live struct device. Fixes: a55ebd47f21f ("counter: add IRQ or GPIO based counter") Reviewed-by: Jonathan Cameron Acked-by: William Breathitt Gray Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20211230150300.72196-17-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 9e884bb19ca84bbba179b8ccccb2694badd4150f Author: Uwe Kleine-König Date: Thu Dec 30 16:02:52 2021 +0100 counter: 104-quad-8: Convert to new counter registration This fixes device lifetime issues where it was possible to free a live struct device. Fixes: f1d8a071d45b ("counter: 104-quad-8: Add Generic Counter interface support") Reviewed-by: Jonathan Cameron Acked-by: William Breathitt Gray Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20211230150300.72196-16-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 98644726044e7f08322ccfb683773514810744e8 Author: Uwe Kleine-König Date: Thu Dec 30 16:02:51 2021 +0100 counter: Update documentation for new counter registration functions In order to replace the counter registration API also update the documentation to the new way. Reviewed-by: Jonathan Cameron Acked-by: William Breathitt Gray Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20211230150300.72196-15-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit c18e2760308e30f007fa24b558b87c39d7e86ff1 Author: Uwe Kleine-König Date: Thu Dec 30 16:02:50 2021 +0100 counter: Provide alternative counter registration functions The current implementation gets device lifetime tracking wrong. The problem is that allocation of struct counter_device is controlled by the individual drivers but this structure contains a struct device that might have to live longer than a driver is bound. As a result a command sequence like: { sleep 5; echo bang; } > /dev/counter0 & sleep 1; echo 40000000.timer:counter > /sys/bus/platform/drivers/stm32-timer-counter/unbind can keep a reference to the struct device and unbinding results in freeing the memory occupied by this device resulting in an oops. This commit provides two new functions (plus some helpers): - counter_alloc() to allocate a struct counter_device that is automatically freed once the embedded struct device is released - counter_add() to register such a device. Note that this commit doesn't fix any issues, all drivers have to be converted to these new functions to correct the lifetime problems. Reviewed-by: Jonathan Cameron Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20211230150300.72196-14-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit e152833b2c97b043bdc5f650eda2f432cf1a21a3 Author: Uwe Kleine-König Date: Thu Dec 30 16:02:49 2021 +0100 counter: stm32-timer-cnt: Convert to counter_priv() wrapper This is a straight forward conversion to the new counter_priv() wrapper. Acked-by: Jonathan Cameron Acked-by: William Breathitt Gray Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20211230150300.72196-13-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit e98ea385f8543b11d42edff35b4ae771697d3ab9 Author: Uwe Kleine-König Date: Thu Dec 30 16:02:48 2021 +0100 counter: stm32-lptimer-cnt: Convert to counter_priv() wrapper This is a straight forward conversion to the new counter_priv() wrapper. Acked-by: Jonathan Cameron Acked-by: William Breathitt Gray Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20211230150300.72196-12-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 8817c2d03a85a1311a4be30125e9299f795c7ae9 Author: Uwe Kleine-König Date: Thu Dec 30 16:02:47 2021 +0100 counter: ti-eqep: Convert to counter_priv() wrapper This is a straight forward conversion to the new counter_priv() wrapper. Acked-by: William Breathitt Gray Acked-by: David Lechner Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20211230150300.72196-11-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 1f1b40c0571ade98fcb6b4241d59b6d3a2fab5e7 Author: Uwe Kleine-König Date: Thu Dec 30 16:02:46 2021 +0100 counter: ftm-quaddec: Convert to counter_priv() wrapper This is a straight forward conversion to the new counter_priv() wrapper. Acked-by: Jonathan Cameron Acked-by: William Breathitt Gray Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20211230150300.72196-10-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 53ada0955270007bbc84c64b3646ac7c70f96442 Author: Uwe Kleine-König Date: Thu Dec 30 16:02:45 2021 +0100 counter: intel-qep: Convert to counter_priv() wrapper This is a straight forward conversion to the new counter_priv() wrapper. Acked-by: Jonathan Cameron Acked-by: William Breathitt Gray Acked-by: Jarkko Nikula Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20211230150300.72196-9-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit a49ede8208117f48d3a9bc3b514c68d45019ee44 Author: Uwe Kleine-König Date: Thu Dec 30 16:02:44 2021 +0100 counter: microchip-tcb-capture: Convert to counter_priv() wrapper This is a straight forward conversion to the new counter_priv() wrapper. Acked-by: Jonathan Cameron Acked-by: William Breathitt Gray Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20211230150300.72196-8-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 63f0e2b6c0334a35d00e81b4347e34f745bca274 Author: Uwe Kleine-König Date: Thu Dec 30 16:02:43 2021 +0100 counter: interrupt-cnt: Convert to counter_priv() wrapper This is a straight forward conversion to the new counter_priv() wrapper. Acked-by: Jonathan Cameron Acked-by: William Breathitt Gray Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20211230150300.72196-7-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit aea8334b24feb0e43870e04823611f9a78bd21e8 Author: Uwe Kleine-König Date: Thu Dec 30 16:02:42 2021 +0100 counter: 104-quad-8: Convert to counter_priv() wrapper This is a straight forward conversion to the new counter_priv() wrapper. Acked-by: Jonathan Cameron Acked-by: William Breathitt Gray Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20211230150300.72196-6-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 5207fb2f311b0c45a9abfa1c84b7a7b657ffa550 Author: Uwe Kleine-König Date: Thu Dec 30 16:02:41 2021 +0100 counter: Provide a wrapper to access device private data For now this just wraps accessing struct counter_device::priv. However this is about to change and converting drivers to this helper individually makes fixing device lifetime issues result in easier to review patches. Reviewed-by: Jonathan Cameron Acked-by: William Breathitt Gray Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20211230150300.72196-5-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 0880603c8401505d237c8bfd29538a064e3aaf0f Author: Uwe Kleine-König Date: Thu Dec 30 16:02:40 2021 +0100 counter: microchip-tcb-capture: Drop unused platform_set_drvdata() The driver doesn't ever use platform_get_drvdata, so drop this unused call. Reviewed-by: Jonathan Cameron Acked-by: William Breathitt Gray Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20211230150300.72196-4-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit 8b2bc10ca2aa8eb6119d943141e2805c593a54e2 Author: Uwe Kleine-König Date: Thu Dec 30 16:02:39 2021 +0100 counter: ftm-quaddec: Drop unused platform_set_drvdata() The driver doesn't ever use platform_get_drvdata, so drop this unused call. Reviewed-by: Jonathan Cameron Acked-by: William Breathitt Gray Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20211230150300.72196-3-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit b56346ddbd82f674db02453ecce60dd91f97b78c Author: Uwe Kleine-König Date: Thu Dec 30 16:02:38 2021 +0100 counter: Use container_of instead of drvdata to track counter_device The counter core uses drvdata to find a struct counter_device from a struct device. However as the device is a member of struct counter_device, the lookup can be done faster (and a bit type safe) using container_of. There are no other users of drvdata, so the call to dev_set_drvdata can go away, too. Reviewed-by: Jonathan Cameron Acked-by: William Breathitt Gray Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20211230150300.72196-2-u.kleine-koenig@pengutronix.de Signed-off-by: Greg Kroah-Hartman commit f85196bdd5a50da74670250564740fc852b3c239 Author: Hans de Goede Date: Thu Dec 30 12:57:47 2021 +0100 ACPI: scan: Create platform device for BCM4752 and LNV4752 ACPI nodes BCM4752 and LNV4752 ACPI nodes describe a Broadcom 4752 GPS module attached to an UART of the system. The GPS modules talk a custom protocol which only works with a closed- source Android gpsd daemon which knows this protocol. The ACPI nodes also describe GPIOs to turn the GPS on/off these are handled by the net/rfkill/rfkill-gpio.c code. This handling predates the addition of enumeration of ACPI instantiated serdevs to the kernel and was broken by that addition, because the ACPI scan code now no longer instantiates platform_device-s for these nodes. Rename the i2c_multi_instantiate_ids HID list to ignore_serial_bus_ids and add the BCM4752 and LNV4752 HIDs, so that rfkill-gpio gets a platform_device to bind to again; and so that a tty cdev for gpsd gets created for these. Fixes: e361d1f85855 ("ACPI / scan: Fix enumeration for special UART devices") Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit 843438deebe247fcf7e4d3dd5655c9df4b5412fd Author: Yang Li Date: Thu Dec 23 10:28:56 2021 +0800 PCI/ACPI: Fix acpi_pci_osc_control_set() kernel-doc comment Add the description of @support and remove @req in acpi_pci_osc_control_set() kernel-doc comment to remove warnings found by running scripts/kernel-doc, which is caused by using 'make W=1'. drivers/acpi/pci_root.c:337: warning: Excess function parameter 'req' description in 'acpi_pci_osc_control_set' drivers/acpi/pci_root.c:337: warning: Function parameter or member 'support' not described in 'acpi_pci_osc_control_set' Reported-by: Abaci Robot Fixes: 6bc779ee05d4 ("PCI/ACPI: Check for _OSC support in acpi_pci_osc_control_set()") Signed-off-by: Yang Li Signed-off-by: Rafael J. Wysocki commit e96c1197aca628f7d2480a1cc3214912b40b3414 Author: Thomas Weißschuh Date: Wed Dec 22 22:20:14 2021 +0100 ACPI: battery: Add the ThinkPad "Not Charging" quirk The EC/ACPI firmware on Lenovo ThinkPads used to report a status of "Unknown" when the battery is between the charge start and charge stop thresholds. On Windows, it reports "Not Charging" so the quirk has been added to also report correctly. Now the "status" attribute returns "Not Charging" when the battery on ThinkPads is not physicaly charging. Signed-off-by: Thomas Weißschuh Reviewed-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit d341db8f48ea43314f489921962c7f8f4ec27239 Author: Huang Rui Date: Fri Dec 24 09:04:55 2021 +0800 x86/cpufeatures: Add AMD Collaborative Processor Performance Control feature flag Add Collaborative Processor Performance Control feature flag for AMD processors. This feature flag will be used on the following AMD P-State driver. The AMD P-State driver has two approaches to implement the frequency control behavior. That depends on the CPU hardware implementation. One is "Full MSR Support" and another is "Shared Memory Support". The feature flag indicates the current processors with "Full MSR Support". Acked-by: Borislav Petkov Signed-off-by: Huang Rui Signed-off-by: Rafael J. Wysocki commit 2685c77b80a80c57e2a25a726b82fb31e6e212ab Author: Sumeet Pawnikar Date: Thu Dec 23 15:12:36 2021 +0530 thermal/drivers/int340x: Fix RFIM mailbox write commands The existing mail mechanism only supports writing of workload types. However, mailbox command for RFIM (cmd = 0x08) also requires write operation which is ignored. This results in failing to store RFI restriction. Fixint this requires enhancing mailbox writes for non workload commands too, so remove the check for MBOX_CMD_WORKLOAD_TYPE_WRITE in mailbox write to allow this other write commands to be supoorted. At the same time, however, we have to make sure that there is no impact on read commands, by avoiding to write anything into the mailbox data register. To properly implement that, add two separate functions for mbox read and write commands for the processor thermal workload command type. This helps to distinguish the read and write workload command types from each other while sending mbox commands. Fixes: 5d6fbc96bd36 ("thermal/drivers/int340x: processor_thermal: Export additional attributes") Signed-off-by: Sumeet Pawnikar Cc: 5.14+ # 5.14+ Acked-by: Srinivas Pandruvada [ rjw: Changelog edits ] Signed-off-by: Rafael J. Wysocki commit ffb9bfa8e470fe3035a551f655a6b4c4885bfc2f Merge: fc74e0a40e4f9 489a00ef46c93 Author: Rafael J. Wysocki Date: Thu Dec 30 15:53:41 2021 +0100 Merge branch 'opp/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm Pull OPP (operating performance points) updates for 5.17-rc1 from Viresh Kumar: "This updates the documentation to match the latest code." * 'opp/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm: Documentation: power: Update outdated contents in opp.rst commit 5ee22fa4a9b826e91007083876e9539a57c174fa Merge: fe262d5c1fc54 d776790a55367 Author: Rafael J. Wysocki Date: Thu Dec 30 15:49:54 2021 +0100 Merge branch 'cpufreq/arm/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm Pull ARM cpufreq updates for 5.17-rc1 from Viresh Kumar: "- Qcom cpufreq driver updates improve irq support (Ard Biesheuvel, Stephen Boyd, and Vladimir Zapolskiy). - Fixes double devm_remap for mediatek driver (Hector Yuan). - Introduces thermal pressure helpers (Lukasz Luba)." * 'cpufreq/arm/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm: cpufreq: mediatek-hw: Fix double devm_remap in hotplug case cpufreq: qcom-hw: Use optional irq API cpufreq: qcom-hw: Set CPU affinity of dcvsh interrupts cpufreq: qcom-hw: Fix probable nested interrupt handling cpufreq: qcom-cpufreq-hw: Avoid stack buffer for IRQ name arch_topology: Remove unused topology_set_thermal_pressure() and related cpufreq: qcom-cpufreq-hw: Use new thermal pressure update function cpufreq: qcom-cpufreq-hw: Update offline CPUs per-cpu thermal pressure thermal: cpufreq_cooling: Use new thermal pressure update function arch_topology: Introduce thermal pressure update function commit 0637d41786a3a9551f33ad8e15bdb40416362028 Author: Alex Deucher Date: Thu Dec 23 14:13:02 2021 -0500 drm/amdgpu: no DC support for headless chips Chips with no display hardware should return false for DC support. v2: drop Arcturus and Aldebaran Fixes: f7f12b25823c0d ("drm/amdgpu: default to true in amdgpu_device_asic_has_dc_support") Reviewed-by: Evan Quan Reviewed-by: Guchun Chen Reported-by: Tareque Md.Hanif Signed-off-by: Alex Deucher commit f28cad86ada1a7345d7bbd379bef5a8babfa791b Author: José Expósito Date: Sun Dec 26 12:16:14 2021 +0100 drm/amd/display: fix dereference before NULL check The "plane_state" pointer was access before checking if it was NULL. Avoid a possible NULL pointer dereference by accessing the plane address after the check. Addresses-Coverity-ID: 1493892 ("Dereference before null check") Fixes: 3f68c01be9a22 ("drm/amd/display: add cyan_skillfish display support") Signed-off-by: José Expósito Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 6dc8265f9803ccb7e5da804e01601f0c14f270e0 Author: Alex Deucher Date: Fri Nov 12 11:25:30 2021 -0500 drm/amdgpu: always reset the asic in suspend (v2) If the platform suspend happens to fail and the power rail is not turned off, the GPU will be in an unknown state on resume, so reset the asic so that it will be in a known good state on resume even if the platform suspend failed. v2: handle s0ix Acked-by: Luben Tuikov Acked-by: Evan Quan Signed-off-by: Alex Deucher commit 4a700546ec9b8fafedf569f363f905b9ec7f5ee8 Author: Evan Quan Date: Fri Dec 17 19:05:06 2021 +0800 drm/amdgpu: put SMU into proper state on runpm suspending for BOCO capable platform By setting mp1_state as PP_MP1_STATE_UNLOAD, MP1 will do some proper cleanups and put itself into a state ready for PNP. That can workaround some random resuming failure observed on BOCO capable platforms. Signed-off-by: Evan Quan Acked-by: Alex Deucher Reviewed-by: Guchun Chen Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 0726ed3065eeb910f9cea0c933bc021a848e00b3 Author: Yizhuo Zhai Date: Fri Dec 17 20:22:23 2021 -0800 drm/amd/display: Fix the uninitialized variable in enable_stream_features() In function enable_stream_features(), the variable "old_downspread.raw" could be uninitialized if core_link_read_dpcd() fails, however, it is used in the later if statement, and further, core_link_write_dpcd() may write random value, which is potentially unsafe. Fixes: 6016cd9dba0f ("drm/amd/display: add helper for enabling mst stream features") Cc: stable@vger.kernel.org Signed-off-by: Yizhuo Zhai Signed-off-by: Alex Deucher commit 937ed9c8660a27ac4d36e8339c970a2ae7903c4d Author: Alex Deucher Date: Tue Dec 21 09:54:40 2021 -0500 drm/amdgpu: fix runpm documentation It's not only supported by HG/PX laptops. It's supported by all dGPUs which supports BOCO/BACO functionality (runtime D3). BOCO - Bus Off, Chip Off. The entire chip is powered off. This is controlled by ACPI. BACO - Bus Active, Chip Off. The chip still shows up on the PCI bus, but the device itself is powered down. v2: fix missed HG/PX reference Reviewed-by: Evan Quan Signed-off-by: Alex Deucher commit 11c9cc95f818f0f187e9b579a7f136f532b42445 Author: Marina Nikolic Date: Tue Dec 14 20:57:53 2021 +0800 amdgpu/pm: Make sysfs pm attributes as read-only for VFs == Description == Setting values of pm attributes through sysfs should not be allowed in SRIOV mode. These calls will not be processed by FW anyway, but error handling on sysfs level should be improved. == Changes == This patch prohibits performing of all set commands in SRIOV mode on sysfs level. It offers better error handling as calls that are not allowed will not be propagated further. == Test == Writing to any sysfs file in passthrough mode will succeed. Writing to any sysfs file in ONEVF mode will yield error: "calling process does not have sufficient permission to execute a command". Signed-off-by: Marina Nikolic Acked-by: Evan Quan Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit fec8c5244fc07b1f6a3249a8714489f594ff5c4f Author: Tao Zhou Date: Mon Dec 20 16:36:54 2021 +0800 drm/amdgpu: save error count in RAS poison handler Otherwise the RAS error count couldn't be queried from sysfs. Signed-off-by: Tao Zhou Reviewed-by: Stanley.Yang Signed-off-by: Alex Deucher commit 45e3d1db7d3ca013f1439248a268b0cdada5d5a3 Author: Guchun Chen Date: Mon Dec 20 22:32:29 2021 +0800 drm/amdgpu: drop redundant semicolon A minor typo. Signed-off-by: Guchun Chen Reviewed-by: Evan Quan Signed-off-by: Alex Deucher commit 4c3adc0b846ba22a8a92764495950b7c2482153b Author: Wenjing Liu Date: Fri Dec 10 14:22:19 2021 -0500 drm/amd/display: get and restore link res map [why] When reboot the link res map should be persisted. So during boot up, driver will look at the map to determine which link should take priority to use certain link res. This is to ensure that link res remains unshuffled after a reboot. Tested-by: Daniel Wheeler Reviewed-by: Jun Lei Acked-by: Rodrigo Siqueira Signed-off-by: Wenjing Liu Signed-off-by: Alex Deucher commit 6dd8931b1ceebbb92e4e0a9d12a236d82a072ea4 Author: Wenjing Liu Date: Mon Nov 29 14:43:02 2021 -0500 drm/amd/display: support dynamic HPO DP link encoder allocation [why] When there are more DP2.0 RXs connected than the number HPO DP link encoders we have, we need to dynamically allocate HPO DP link encoder to the port that needs it. [how] Only allocate HPO DP link encoder when it is needed. Tested-by: Daniel Wheeler Reviewed-by: Jun Lei Acked-by: Rodrigo Siqueira Signed-off-by: Wenjing Liu Signed-off-by: Alex Deucher commit 3d38a5839ea8afe58fa59abc0a3453f44cae81e8 Author: Wenjing Liu Date: Fri Nov 26 19:10:34 2021 -0500 drm/amd/display: access hpo dp link encoder only through link resource [why] Update all accesses to use hpo dp link encoder through link resource only. Tested-by: Daniel Wheeler Reviewed-by: Jun Lei Acked-by: Rodrigo Siqueira Signed-off-by: Wenjing Liu Signed-off-by: Alex Deucher commit f3fac9481bc7b9518df18f33b71a6109a245ccc6 Author: Wenjing Liu Date: Fri Nov 26 18:46:22 2021 -0500 drm/amd/display: populate link res in both detection and validation [why] This commit is to populate link res in preparation of the next commit. The next commit will replace all existing code to use link res instead Tested-by: Daniel Wheeler Reviewed-by: Jun Lei Acked-by: Rodrigo Siqueira Signed-off-by: Wenjing Liu Signed-off-by: Alex Deucher commit ef30f441f6ac12875c9901e8ea1b9cfae6f0e8bf Author: Wenjing Liu Date: Thu Nov 25 12:30:50 2021 -0500 drm/amd/display: define link res and make it accessible to all link interfaces [why] There will be a series of re-arch changes in Link Resource Management. They are more and more muxable link resource objects and the resource is insufficient for a one to one allocation to all links created. Therefore a link resource sharing logic is required to determine which link should use certain link resource. This commit is the first one in this series that starts by defining a link resource struct, this struct will be available to all interfaces that need to perform link programming sequence. In later commits, we will granduately decouple link resource objects out of dc link. So instead of access a link resource from dc link. Current link's resource can be accessible through pipe_ctx->link_res during commit, or by calling dc_link_get_cur_link_res function with current link passed in after commit. Tested-by: Daniel Wheeler Reviewed-by: Jun Lei Acked-by: Rodrigo Siqueira Signed-off-by: Wenjing Liu Signed-off-by: Alex Deucher commit 19afe66ddb8f18c7ad5cd07322c6d8d2a2905ce8 Author: Aric Cyr Date: Sat Dec 11 18:07:10 2021 -0500 drm/amd/display: 3.2.167 This version brings along the following: - Fixes and improvements in the LTTPR code - Improve z-state - Fix null pointer check - Improve communication with s0i2 - Update multiple-display split policy - Add missing registers Tested-by: Daniel Wheeler Acked-by: Rodrigo Siqueira Signed-off-by: Aric Cyr Signed-off-by: Alex Deucher commit aca05d338b3226255fdba56771378a2dc4c9caa5 Author: Anthony Koo Date: Sat Dec 11 12:24:59 2021 -0500 drm/amd/display: [FW Promotion] Release 0.0.98 Tested-by: Daniel Wheeler Reviewed-by: Aric Cyr Acked-by: Rodrigo Siqueira Signed-off-by: Anthony Koo Signed-off-by: Alex Deucher commit 47547c56739a4dbf1e96a170f5b16811e04c5024 Author: Martin Leung Date: Thu Dec 9 12:11:50 2021 -0500 drm/amd/display: Undo ODM combine Undo ODM Combine regression causing causing pipe allocation issues. Tested-by: Daniel Wheeler Reviewed-by: Aric Cyr Acked-by: Rodrigo Siqueira Signed-off-by: Martin Leung Signed-off-by: Alex Deucher commit 2ca6c483ed2d73ff263457c166527abdb82bba06 Author: Wesley Chalmers Date: Wed Dec 8 14:25:08 2021 -0500 drm/amd/display: Add reg defs for DCN303 [WHY] These registers are currently missing from the DCN303 header files Tested-by: Daniel Wheeler Reviewed-by: George Shen Acked-by: Rodrigo Siqueira Signed-off-by: Wesley Chalmers Signed-off-by: Alex Deucher commit 458c79a86ae1081636942ba3c42bf0424f3c6970 Author: Angus Wang Date: Thu Dec 9 17:27:01 2021 -0500 drm/amd/display: Changed pipe split policy to allow for multi-display pipe split [WHY] Current implementation of pipe split policy prevents pipe split with multiple displays connected, which caused the MCLK speed to be stuck at max [HOW] Changed the pipe split policies so that pipe split is allowed for multi-display configurations Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1522 Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1709 Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1655 Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1403 Tested-by: Daniel Wheeler Reviewed-by: Aric Cyr Acked-by: Rodrigo Siqueira Signed-off-by: Angus Wang Signed-off-by: Alex Deucher commit c856f16c33e6ed4bcfe3f0e51afeb9b08ac48f0d Author: Nicholas Kazlauskas Date: Thu Dec 9 16:05:36 2021 -0500 drm/amd/display: Set optimize_pwr_state for DCN31 [Why] We'll exit optimized power state to do link detection but we won't enter back into the optimized power state. This could potentially block s2idle entry depending on the sequencing, but it also means we're losing some power during the transition period. [How] Hook up the handler like DCN21. It was also missed like the exit_optimized_pwr_state callback. Fixes: 64b1d0e8d500 ("drm/amd/display: Add DCN3.1 HWSEQ") Tested-by: Daniel Wheeler Reviewed-by: Eric Yang Acked-by: Rodrigo Siqueira Signed-off-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher commit 0d988e5de7aa5ee8865cbc664180ae67918a6b19 Author: George Shen Date: Wed Dec 8 20:28:14 2021 -0500 drm/amd/display: Remove CR AUX RD Interval limit for LTTPR [Why] DP spec specifies that DPRX shall use the read interval in the TRAINING_AUX_RD_INTERVAL_PHY_REPEATER LTTPR DPCD register. This register's bit definition is the same as the AUX read interval register for DPRX. [How} Remove logic which forces AUX read interval to 100us for repeaters when in LTTPR non-transparent mode. Tested-by: Daniel Wheeler Reviewed-by: Wesley Chalmers Acked-by: Rodrigo Siqueira Signed-off-by: George Shen Signed-off-by: Alex Deucher commit 3db817fce43ec3d423b969911151dd849f4d7351 Author: Nicholas Kazlauskas Date: Thu Dec 9 13:53:36 2021 -0500 drm/amd/display: Send s0i2_rdy in stream_count == 0 optimization [Why] Otherwise SMU won't mark Display as idle when trying to perform s2idle. [How] Mark the bit in the dcn31 codepath, doesn't apply to older ASIC. It needed to be split from phy refclk off to prevent entering s2idle when PSR was engaged but driver was not ready. Fixes: 118a33151658 ("drm/amd/display: Add DCN3.1 clock manager support") Tested-by: Daniel Wheeler Reviewed-by: Eric Yang Acked-by: Rodrigo Siqueira Signed-off-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher commit e56e9ad0370a29a4bee3a99fd517d8583804fd74 Author: Alvin Lee Date: Fri Dec 3 16:29:05 2021 -0500 drm/amd/display: Fix check for null function ptr [Why] Bug fix for null function ptr (should check for NULL instead of not NULL) [How] Fix if condition Tested-by: Daniel Wheeler Reviewed-by: Samson Tam Acked-by: Rodrigo Siqueira Signed-off-by: Alvin Lee Signed-off-by: Alex Deucher commit cdbc58386bdcd33e8d9b0e0764a32aba537f3cae Author: Lai, Derek Date: Mon Dec 6 17:10:59 2021 +0800 drm/amd/display: Added power down for DCN10 [Why] The change of setting a timer callback on boot for 10 seconds is still working, just lacked power down for DCN10. [How] Added power down for DCN10. Tested-by: Daniel Wheeler Reviewed-by: Anthony Koo Acked-by: Rodrigo Siqueira Signed-off-by: Derek Lai Signed-off-by: Alex Deucher commit 2d0158497a9b9a80a92b02e55513dee4599eec96 Author: Nicholas Kazlauskas Date: Tue Dec 7 12:58:07 2021 -0500 drm/amd/display: Block z-states when stutter period exceeds criteria [Why] Stutter period won't be less than 5000.0, but if PSR is enabled then we can potentially enter Z9 when MPO is enabled. SMU will try to enter Z9 too early in these cases (before PSR is enabled) and we'll see underflow. [How] Block z-states (z9, z10) until we can add a new interface to SMU to signal when we can support z10 but not z9. We can revert this once the interface change is in. Tested-by: Daniel Wheeler Reviewed-by: Eric Yang Acked-by: Rodrigo Siqueira Signed-off-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher commit 21bf3e6f1454b8f472ff7e6cbc95931dcaf7eb47 Author: Shen, George Date: Tue Dec 7 16:53:12 2021 -0500 drm/amd/display: Refactor vendor specific link training sequence [Why] Current implementation is not scalable and retrofits the existing standard link training code for purposes outside of its original design. [How] Refactor vendor specific link training sequence into its own separate function to be called instead of the standard link training function. Tested-by: Daniel Wheeler Reviewed-by: Wenjing Liu Acked-by: Rodrigo Siqueira Signed-off-by: George Shen Signed-off-by: Alex Deucher commit fddb024537f121995957d816fcf8e2e230451db2 Author: George Shen Date: Thu Dec 2 23:07:35 2021 -0500 drm/amd/display: Limit max link cap with LTTPR caps [Why] Max link rate should be limited to the maximum link rate support by any LTTPR that are connected, including when operating in transparent mode. [How] Include transparent mode when factoring in LTTPR max supported link rate. Tested-by: Daniel Wheeler Reviewed-by: Wesley Chalmers Acked-by: Rodrigo Siqueira Signed-off-by: George Shen Signed-off-by: Alex Deucher commit bf252ce1fa8ac68baee3f8525fc6453d278b619d Author: Charlene Liu Date: Sun Dec 5 21:19:30 2021 -0500 drm/amd/display: fix B0 TMDS deepcolor no dislay issue [why] B0 PHY C map to F, D map to G driver use logic instance, dmub does the remap. Driver still need use the right PHY instance to access right HW. [how] use phyical instance when program PHY register. [note] could move resync_control programming to dmub next. Tested-by: Daniel Wheeler Reviewed-by: Dmytro Laktyushkin Reviewed-by: Jun Lei Acked-by: Rodrigo Siqueira Signed-off-by: Charlene Liu Signed-off-by: Alex Deucher commit b6fd6e0f5eb8c6d10575d08a2c6df8ed83877e07 Author: Surbhi Kakarya Date: Fri Dec 17 12:01:09 2021 -0500 drm/amdgpu: Check the memory can be accesssed by ttm_device_clear_dma_mappings. If the event guard is enabled and VF doesn't receive an ack from PF for full access, the guest driver load crashes. This is caused due to the call to ttm_device_clear_dma_mappings with non-initialized mman during driver tear down. This patch adds the necessary condition to check if the mman initialization passed or not and takes the path based on the condition output. Signed-off-by: Surbhi Kakarya Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit f89c6bf73420c597769033dcc811ce691597ccf3 Author: Guchun Chen Date: Fri Dec 17 13:21:20 2021 +0800 drm/amdkfd: correct sdma queue number in kfd device init (v3) This patch keeps the setting of sdma queue number to the same after recent KFD code refactor. Additionally, improve code to use switch case to list IP version to complete kfd device_info structure filling for IH version assignment. This makes consistency with the IP parse code in amdgpu_discovery.c. v2: use dev_warn for the default switch case; set default sdma queue per engine(8) and IH handler to v9. (Jonathan) v3: Fix missed IP version check of Raven. Fixes: f0dc99a6f742bc ("drm/amdkfd: add kfd_device_info_init function") Signed-off-by: Guchun Chen Reviewed-by: Jonathan Kim Reviewed-by: Graham Sider Signed-off-by: Alex Deucher commit 67416bf85345b6990fe2adc42ab082bfefc578bd Author: Kent Russell Date: Mon Dec 13 13:59:43 2021 -0500 drm/amdgpu: Access the FRU on Aldebaran This is supported, although the offset is different from VG20, so fix that with a variable and enable getting the product name and serial number from the FRU. Do this for all SKUs since all SKUs have the FRU Signed-off-by: Kent Russell Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit de0af8a65ea3c56e85517d23316679eacddb7a45 Author: Kent Russell Date: Mon Dec 13 13:58:40 2021 -0500 drm/amdgpu: Only overwrite serial if field is empty On Aldebaran, the serial may be obtained from the FRU. Only overwrite the serial with the unique_id if the serial is empty. This will support printing serial numbers for mGPU devices where there are 2 unique_ids for the 2 GPUs, but only one serial number for the board Signed-off-by: Kent Russell Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 4ad31fa15ba472866d538b3cee05708a9d8e8197 Author: Kent Russell Date: Mon Dec 13 13:15:20 2021 -0500 drm/amdgpu: Enable unique_id for Aldebaran It's supported, so support the unique_id sysfs file Signed-off-by: Kent Russell Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 6c92fe5fa5a1f24e50296de9d24d36a1b605b208 Author: Kent Russell Date: Mon Dec 13 13:14:17 2021 -0500 drm/amdgpu: Increase potential product_name to 64 characters Having seen at least 1 42-character product_name, bump the number up to 64, and put that definition into amdgpu.h to make future adjustments simpler. Signed-off-by: Kent Russell Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit fd5256cbe19609bfff0cc51e9d999a46020719da Author: yipechai Date: Wed Dec 8 16:04:14 2021 +0800 drm/amdgpu: Remove the redundant code of psp bootloader functions The psp bootloader functions code of psp_v13_0.c had been optimized before. According the code style of psp_v13_0.c to remove the redundant code of psp_v11_0.c. v2: squash in drop unused variable (Alex) Signed-off-by: yipechai Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 87172e89dcc7b09b32a4eb5f21e35d310e3cb024 Author: Leslie Shi Date: Thu Dec 16 14:03:41 2021 +0800 drm/amdgpu: Call amdgpu_device_unmap_mmio() if device is unplugged to prevent crash in GPU initialization failure [Why] In amdgpu_driver_load_kms, when amdgpu_device_init returns error during driver modprobe, it will start the error handle path immediately and call into amdgpu_device_unmap_mmio as well to release mapped VRAM. However, in the following release callback, driver stills visits the unmapped memory like vcn.inst[i].fw_shared_cpu_addr in vcn_v3_0_sw_fini. So a kernel crash occurs. [How] call amdgpu_device_unmap_mmio() if device is unplugged to prevent invalid memory address in vcn_v3_0_sw_fini() when GPU initialization failure. Signed-off-by: Leslie Shi Reviewed-by: Andrey Grodzovsky Reviewed-by: Guchun Chen Acked-by: Christian König Signed-off-by: Alex Deucher commit 49dc9013e34b205bae9d7a5f365a3da33c508c9d Author: Christophe JAILLET Date: Thu Dec 30 11:40:40 2021 +0100 net/smc: Use the bitmap API when applicable Using the bitmap API is less verbose than hand writing them. It also improves the semantic. Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller commit c09f103e89f4554b17c68c3a0a50140fc9133352 Author: luo penghao Date: Thu Dec 30 06:26:44 2021 +0000 ethtool: Remove redundant ret assignments The assignment here will be overwritten, so it should be deleted The clang_analyzer complains as follows: net/ethtool/netlink.c: Value stored to 'ret' is never read Reported-by: Zeal Robot Signed-off-by: luo penghao Signed-off-by: David S. Miller commit dda0c2e7ed21d7db1568920366e616c6c037b814 Author: Aleksander Jan Bajkowski Date: Thu Dec 30 00:52:06 2021 +0100 net: lantiq_etop: remove unnecessary space in cast As reported by checkpatch.pl, no space is necessary after a cast. Signed-off-by: Aleksander Jan Bajkowski Signed-off-by: David S. Miller commit 7a6653adde03c18997ff4afa4f61c2e7dc02de00 Author: Aleksander Jan Bajkowski Date: Thu Dec 30 00:39:52 2021 +0100 net: lantiq_etop: make alignment match open parenthesis checkpatch.pl complains as the following: Alignment should match open parenthesis Signed-off-by: Aleksander Jan Bajkowski Signed-off-by: David S. Miller commit 370509b267fafa3ca7122cf0b91cafadf52cfacc Author: Aleksander Jan Bajkowski Date: Thu Dec 30 00:36:26 2021 +0100 net: lantiq_etop: remove multiple assignments Documentation/process/coding-style.rst says (in line 88) "Don't put multiple assignments on a single line either." This patch fixes the coding style issue reported by checkpatch.pl. Signed-off-by: Aleksander Jan Bajkowski Signed-off-by: David S. Miller commit b1cb12a27134bc996bea70b5f3e66d7e7edf297c Author: Aleksander Jan Bajkowski Date: Thu Dec 30 00:27:25 2021 +0100 net: lantiq_etop: avoid precedence issues Add () around macro argument to avoid precedence issues Signed-off-by: Aleksander Jan Bajkowski Signed-off-by: David S. Miller commit 7b1cd6a644f765e189904ffe2b612ec4183ebfaa Author: Aleksander Jan Bajkowski Date: Thu Dec 30 00:22:57 2021 +0100 net: lantiq_etop: replace strlcpy with strscpy strlcpy is marked as deprecated in Documentation/process/deprecated.rst, and there is no functional difference when the caller expects truncation (when not checking the return value). strscpy is relatively better as it also avoids scanning the whole source string. This silences the related checkpatch warnings from: commit 5dbdb2d87c29 ("checkpatch: prefer strscpy to strlcpy") Signed-off-by: Aleksander Jan Bajkowski Signed-off-by: David S. Miller commit 12b31d07b0ceb723821394b414c02db64468f1f2 Author: Gaston Gonzalez Date: Thu Dec 30 08:31:29 2021 -0300 staging: vc04_services: update TODO file There are no struct typedef remaining inside vc04_services/. Hence, remove the task from the TODO file. While at it, fix the items sequential numbering. Signed-off-by: Gaston Gonzalez Link: https://lore.kernel.org/r/3f560a75063a0bb744bb34c410e49f792d2c3d21.1640776340.git.gascoar@gmail.com Signed-off-by: Greg Kroah-Hartman commit 072590cc4f701ae35818f87d56c22b0f3dfeaa3d Author: Gaston Gonzalez Date: Thu Dec 30 08:31:27 2021 -0300 staging: vc04_services: bcm2835-camera: avoid the use of typedef for function pointers Replace typedef bm2835_mmal_v4l2_ctrl_cb with equivalent declaration to better align with the linux kernel coding style. Signed-off-by: Gaston Gonzalez Link: https://lore.kernel.org/r/0418e6e19e1580fff4abfc4bb2f4269dc206df44.1640776340.git.gascoar@gmail.com Signed-off-by: Greg Kroah-Hartman commit 95b47a04673fa46b2f8a0bb19cacebb714a91ed8 Author: Gaston Gonzalez Date: Thu Dec 30 08:31:25 2021 -0300 staging: vc04_services: bcm2835-audio: avoid the use of typedef for function pointers Replace typedefs bcm2835_audio_newpcm_func and bcm2835_audio_newctl_func with equivalent declarations to better align with the linux kernel coding style. Signed-off-by: Gaston Gonzalez Link: https://lore.kernel.org/r/b53a77682994bbc3ccb9b89d617dec23d0785059.1640776340.git.gascoar@gmail.com Signed-off-by: Greg Kroah-Hartman commit 40319796b7321e25d23671e525e01a1f4d85f6b6 Author: Kiran Patil Date: Wed Dec 29 10:54:33 2021 -0800 ice: Add flow director support for channel mode Add support to enable flow-director filter when multiple TCs are configured. Flow director filter can be configured using ethtool (--config-ntuple option). When multiple TCs are configured, each TC is mapped to an unique HW VSI. So VSI corresponding to queue used in filter is identified and flow director context is updated with correct VSI while configuring ntuple filter in HW. Signed-off-by: Kiran Patil Signed-off-by: Amritha Nambiar Signed-off-by: Sudheer Mogilappagari Tested-by: Bharathi Sreenivas Signed-off-by: Tony Nguyen Signed-off-by: David S. Miller commit a1f18c5fe554750eb14f6b41d2526a13a697c185 Merge: c67939eff8023 38970eac41db0 Author: David S. Miller Date: Thu Dec 30 13:13:25 2021 +0000 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-12-29 Ruud Bos says: The igb driver provides support for PEROUT and EXTTS pin functions that allow adapter external use of timing signals. At Hottinger Bruel & Kjaer we are using the PEROUT function to feed a PTP corrected 1pps signal into an FPGA as cross system synchronized time source. Support for the PEROUT and EXTTS SDP functions is currently limited to i210/i211 based adapters. This patch series enables these functions also for 82580/i354/i350 based ones. Because the time registers of these adapters do not have the nice split in second rollovers as the i210 has, the implementation is slightly more complex compared to the i210 implementation. The PEROUT function has been successfully tested on an i350 based ethernet adapter. Using the following user space code excerpt, the driver outputs a PTP corrected 1pps signal on the SDP0 pin of an i350: struct ptp_pin_desc desc; memset(&desc, 0, sizeof(desc)); desc.index = 0; desc.func = PTP_PF_PEROUT; desc.chan = 0; if (ioctl(fd, PTP_PIN_SETFUNC, &desc) == 0) { struct timespec ts; if (clock_gettime(clkid, &ts) == 0) { struct ptp_perout_request rq; memset(&rq, 0, sizeof(rq)); rq.index = 0; rq.start.sec = ts.tv_sec + 1; rq.start.nsec = 500000000; rq.period.sec = 1; rq.period.nsec = 0; if (ioctl(fd, PTP_PEROUT_REQUEST, &rq) == 0) { /* 1pps signal is now available on SDP0 */ } } } The added EXTTS function has not been tested. However, looking at the data sheets, the layout of the registers involved match the i210 exactly except for the time registers mentioned before. Hence the almost identical implementation. --- Note: I made changes to fix RCT and checkpatch messages regarding unnecessary parenthesis. ==================== Acked-by: Richard Cochran Signed-off-by: David S. Miller commit 9102fa34604159642625f42d7f801f1e04d9ca12 Author: Masahiro Yamada Date: Mon Nov 8 01:26:41 2021 +0900 x86/purgatory: Remove -nostdlib compiler flag The -nostdlib option requests the compiler to not use the standard system startup files or libraries when linking. It is effective only when $(CC) is used as a linker driver. $(LD) is directly used for linking purgatory.{ro,chk} here, hence -nostdlib is unneeded. Signed-off-by: Masahiro Yamada Signed-off-by: Borislav Petkov Reviewed-by: Nick Desaulniers Link: https://lore.kernel.org/r/20211107162641.324688-2-masahiroy@kernel.org commit c67939eff8023fd4aaff8ad0fb1c61448efda9ca Merge: 47869e82c8b86 15fa9e8c5ffbe Author: David S. Miller Date: Thu Dec 30 13:12:42 2021 +0000 Merge branch 'prestera-router-driver' Yevhen Orlov says: ==================== prestera: add basic router driver support Add initial router support for Marvell Prestera driver. Subscribe on inetaddr notifications. TRAP packets, that has to be routed (if packet has router's destination MAC address). Add features: - Support ip address adding on port. e.g.: "ip address add PORT 1.1.1.1/24" Limitations: - Only regular port supported. Vlan will be added soon. - It is routing through CPU. Offloading will be added in next patches. Co-developed-by: Taras Chornyi Signed-off-by: Taras Chornyi Co-developed-by: Oleksandr Mazur Signed-off-by: Oleksandr Mazur Signed-off-by: Yevhen Orlov Changes for v2: * Remove useless assignment ==================== Signed-off-by: David S. Miller commit 6b0b80ac103b2a40c72a47c301745fd1f4ef4697 Author: Alexander Usyskin Date: Tue Dec 28 10:20:47 2021 +0200 mei: hbm: fix client dma reply status Don't blindly copy status value received from the firmware into internal client status field, It may be positive and ERR_PTR(ret) will translate it into an invalid address and the caller will crash. Put the error code into the client status on failure. Fixes: 369aea845951 ("mei: implement client dma setup.") Cc: # v5.11+ Reported-by: Emmanuel Grumbach Tested-by: : Emmanuel Grumbach Acked-by: Tomas Winkler Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler Link: https://lore.kernel.org/r/20211228082047.378115-1-tomas.winkler@intel.com Signed-off-by: Greg Kroah-Hartman commit 15fa9e8c5ffbe0c90a0887c509ab95f150953963 Author: Yevhen Orlov Date: Mon Dec 27 23:52:31 2021 +0200 net: marvell: prestera: Implement initial inetaddr notifiers Add inetaddr notifiers to support add/del IPv4 address on switchdev port. We create TRAP on first address, added on port and delete TRAP, when last address removed. Currently, driver supports only regular port to became routed. Other port type support will be added later Co-developed-by: Taras Chornyi Signed-off-by: Taras Chornyi Co-developed-by: Oleksandr Mazur Signed-off-by: Oleksandr Mazur Signed-off-by: Yevhen Orlov Signed-off-by: David S. Miller commit da3c16398602a0d6d4707c8beff527fa51f70ba2 Author: Yevhen Orlov Date: Mon Dec 27 23:52:30 2021 +0200 net: marvell: prestera: Register inetaddr stub notifiers Initial implementation of notification handlers. For now this is just stub. So that we can move forward and add prestera_router_hw's objects manipulations. We support several addresses on interface. We just have nothing to do for second address, because rif is already enabled on this interface, after first one. Co-developed-by: Taras Chornyi Signed-off-by: Taras Chornyi Co-developed-by: Oleksandr Mazur Signed-off-by: Oleksandr Mazur Signed-off-by: Yevhen Orlov Signed-off-by: David S. Miller commit bca5859bc6c60956585b57220b6ed619e23a6a7b Author: Yevhen Orlov Date: Mon Dec 27 23:52:29 2021 +0200 net: marvell: prestera: add hardware router objects accounting Add prestera_router_hw.c. This file contains functions, which track HW objects relations and links. This include implicity creation of objects, that needed by requested one and implicity removing of objects, which reference counter is became zero. We need this layer, because kernel callbacks not always mapped to creation of single HW object. So let it be two different layers - one for subscribing and parsing kernel structures, and another (prestera_router_hw.c) for HW objects relations tracking. There is two types of objects on router_hw layer: - Explicit objects (rif_entry) : created by higher layer. - Implicit objects (vr) : created on demand by explicit objects. Co-developed-by: Taras Chornyi Signed-off-by: Taras Chornyi Co-developed-by: Oleksandr Mazur Signed-off-by: Oleksandr Mazur Signed-off-by: Yevhen Orlov Signed-off-by: David S. Miller commit 69204174cc5cb3905f18a3a123f8b95c6622dba2 Author: Yevhen Orlov Date: Mon Dec 27 23:52:28 2021 +0200 net: marvell: prestera: Add prestera router infra Add prestera_router.c, which contains code to subscribe/unsubscribe on kernel notifiers for router. This handle kernel notifications, parse structures to make key to manipulate prestera_router_hw's objects. Also prestera_router is container for router's objects database. Co-developed-by: Taras Chornyi Signed-off-by: Taras Chornyi Co-developed-by: Oleksandr Mazur Signed-off-by: Oleksandr Mazur Signed-off-by: Yevhen Orlov Signed-off-by: David S. Miller commit 0f07bd6bcb15970738e29fbac687483285583b14 Author: Yevhen Orlov Date: Mon Dec 27 23:52:27 2021 +0200 net: marvell: prestera: Add router interface ABI Add functions to enable routing on port, which is not in vlan. Also we can enable routing on vlan. prestera_hw_rif_create() take index of allocated virtual router. Co-developed-by: Taras Chornyi Signed-off-by: Taras Chornyi Co-developed-by: Oleksandr Mazur Signed-off-by: Oleksandr Mazur Signed-off-by: Yevhen Orlov Signed-off-by: David S. Miller commit 6d1b3eb53fc65fcf3684968eabe71ebd8ccb5744 Author: Yevhen Orlov Date: Mon Dec 27 23:52:26 2021 +0200 net: marvell: prestera: add virtual router ABI Add functions and structures to allocate virtual router. prestera_hw_vr_create() return index of allocated VR so that we can move forward and also add another objects (e.g. router interface), which has link to VR. Co-developed-by: Taras Chornyi Signed-off-by: Taras Chornyi Co-developed-by: Oleksandr Mazur Signed-off-by: Oleksandr Mazur Signed-off-by: Yevhen Orlov Signed-off-by: David S. Miller commit fcee5ce50bdb21116711e38635e3865594af907e Author: Wei Yongjun Date: Tue Dec 28 12:55:22 2021 +0000 misc: lattice-ecp3-config: Fix task hung when firmware load failed When firmware load failed, kernel report task hung as follows: INFO: task xrun:5191 blocked for more than 147 seconds. Tainted: G W 5.16.0-rc5-next-20211220+ #11 "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. task:xrun state:D stack: 0 pid: 5191 ppid: 270 flags:0x00000004 Call Trace: __schedule+0xc12/0x4b50 kernel/sched/core.c:4986 schedule+0xd7/0x260 kernel/sched/core.c:6369 (discriminator 1) schedule_timeout+0x7aa/0xa80 kernel/time/timer.c:1857 wait_for_completion+0x181/0x290 kernel/sched/completion.c:85 lattice_ecp3_remove+0x32/0x40 drivers/misc/lattice-ecp3-config.c:221 spi_remove+0x72/0xb0 drivers/spi/spi.c:409 lattice_ecp3_remove() wait for signals from firmware loading, but when load failed, firmware_load() does not send this signal. This cause device remove hung. Fix it by sending signal even if load failed. Fixes: 781551df57c7 ("misc: Add Lattice ECP3 FPGA configuration via SPI") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun Link: https://lore.kernel.org/r/20211228125522.3122284-1-weiyongjun1@huawei.com Signed-off-by: Greg Kroah-Hartman commit a41f5b78ac5ba65986b31ddc6325a0b8cc8b8864 Author: Masahiro Yamada Date: Mon Nov 8 01:26:40 2021 +0900 x86/vdso: Remove -nostdlib compiler flag The -nostdlib option requests the compiler to not use the standard system startup files or libraries when linking. It is effective only when $(CC) is used as a linker driver. Since 379d98ddf413 ("x86: vdso: Use $LD instead of $CC to link") $(LD) is directly used, hence -nostdlib is unneeded. Signed-off-by: Masahiro Yamada Signed-off-by: Borislav Petkov Reviewed-by: Nick Desaulniers Link: https://lore.kernel.org/r/20211107162641.324688-1-masahiroy@kernel.org commit e75a58db41df67e6282104aaae073bc8b43b8dc8 Merge: 1563fca2346c3 09d976b3e8e25 Author: Greg Kroah-Hartman Date: Thu Dec 30 14:02:16 2021 +0100 Merge tag 'phy-for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy into char-misc-next Vinod writes: phy-for-5.17 - New support: - Qualcomm eDP PHY driver - Qualcomm SM8450 UFS, USB2, USB3, PCIe0 and PCIe1 phy support - Lan966x ethernet serdes PHY driver - Support for uniphier NXI & Pro4 SoC - Qualcomm SM6350 USB2 support - Amlogic Meson8 HDMI TX PHY driver - Rockchip rk3568 usb2 support - Intel Thunder Bay eMMC PHY driver - Freescale IMX8 PCIe phy driver - Updates: - Cadence Sierra driver updates for multilink configurations - Bcm usb2 updates for Phy reg space * tag 'phy-for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy: (72 commits) phy: cadence: Sierra: Add support for derived reference clock output dt-bindings: phy: cadence-sierra: Add clock ID for derived reference clock phy: cadence: Sierra: Add PCIe + QSGMII PHY multilink configuration phy: cadence: Sierra: Add support for PHY multilink configurations phy: cadence: Sierra: Fix to get correct parent for mux clocks phy: cadence: Sierra: Update single link PCIe register configuration phy: cadence: Sierra: Check PIPE mode PHY status to be ready for operation phy: cadence: Sierra: Check cmn_ready assertion during PHY power on phy: cadence: Sierra: Add PHY PCS common register configurations phy: cadence: Sierra: Rename some regmap variables to be in sync with Sierra documentation phy: cadence: Sierra: Add support to get SSC type from device tree dt-bindings: phy: cadence-sierra: Add binding to specify SSC mode dt-bindings: phy: cadence-torrent: Rename SSC macros to use generic names phy: cadence: Sierra: Prepare driver to add support for multilink configurations phy: cadence: Sierra: Use of_device_get_match_data() to get driver data phy: mediatek: Fix missing check in mtk_mipi_tx_probe phy: uniphier-usb3ss: fix unintended writing zeros to PHY register phy: phy-mtk-tphy: use new io helpers to access register phy: phy-mtk-xsphy: use new io helpers to access register phy: mediatek: add helpers to update bits of registers ... commit 1563fca2346c31da30324cefe2e59a2afe0f61fa Merge: 0fa328796b985 bb349fd2d5806 Author: Greg Kroah-Hartman Date: Thu Dec 30 14:00:44 2021 +0100 Merge tag 'soundwire-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire into char-misc-next Vinod writes: soundwire updates for 5.17-rc1 - Remove redundant version number read in qcom driver * tag 'soundwire-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/soundwire: soundwire: qcom: remove redundant version number read commit 28f0c335dd4a1a4b44b3e6c6402825a93132e1a4 Author: Kees Cook Date: Wed Dec 22 17:50:20 2021 +0500 devtmpfs: mount with noexec and nosuid devtmpfs is writable. Add the noexec and nosuid as default mount flags to prevent code execution from /dev. The systems who don't use systemd and who rely on CONFIG_DEVTMPFS_MOUNT=y are the ones to be protected by this patch. Other systems are fine with the udev solution. No sane program should be relying on executing from /dev. So this patch reduces the attack surface. It doesn't prevent any specific attack, but it reduces the possibility that someone can use /dev as a place to put executable code. Chrome OS has been carrying this patch for several years. It seems trivial and simple solution to improve the protection of /dev when CONFIG_DEVTMPFS_MOUNT=y. Original patch: https://lore.kernel.org/lkml/20121120215059.GA1859@www.outflux.net/ Cc: ellyjones@chromium.org Cc: Kay Sievers Cc: Roland Eggner Co-developed-by: Muhammad Usama Anjum Signed-off-by: Kees Cook Signed-off-by: Muhammad Usama Anjum Link: https://lore.kernel.org/r/YcMfDOyrg647RCmd@debian-BULLSEYE-live-builder-AMD64 Signed-off-by: Greg Kroah-Hartman commit 5acb78dc72b48bc44226a86368fb442800981a0c Author: Lad Prabhakar Date: Fri Dec 24 15:37:53 2021 +0000 tty: goldfish: Use platform_get_irq() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211224153753.22210-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Greg Kroah-Hartman commit d8e9a406a931f687945703a4bac45042eb81ce92 Author: Magnus Damm Date: Sun Dec 12 22:21:28 2021 +0900 serdev: BREAK/FRAME/PARITY/OVERRUN notification prototype V2 Allow serdev device drivers get notified by hardware errors such as BREAK, FRAME, PARITY and OVERRUN. With this patch, in the event of an error detected in the UART device driver the serdev_device_driver will get the newly introduced ->error() callback invoked if serdev_device_set_error_mask() has previously been used to enable the type of error. The errors are taken straight from the TTY layer and fed into the serdev_device_driver after filtering out only enabled errors. Without this patch the hardware errors never reach the serdev_device_driver. Signed-off-by: Magnus Damm Link: https://lore.kernel.org/r/163931528842.27756.3665040315954968747.sendpatchset@octo Signed-off-by: Greg Kroah-Hartman commit ad234e2bac274a43c9fa540bde8cd9f0c627b71f Author: Yu Tu Date: Thu Dec 30 18:21:05 2021 +0800 tty: serial: meson: Drop the legacy compatible strings and clock code All mainline .dts files have been using the stable UART since Linux 4.16. Drop the legacy compatible strings and related clock code. Signed-off-by: Yu Tu Link: https://lore.kernel.org/r/20211230102110.3861-2-yu.tu@amlogic.com Signed-off-by: Greg Kroah-Hartman commit e3b27e2f56a5337d2ecdbe3feddc7c75e2205d59 Author: Lad Prabhakar Date: Fri Dec 24 14:29:16 2021 +0000 serial: pmac_zilog: Use platform_get_irq() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211224142917.6966-11-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Greg Kroah-Hartman commit fc67c913298c97bf5c1aac419ff260b7845613f5 Author: Lad Prabhakar Date: Fri Dec 24 14:29:15 2021 +0000 serial: bcm63xx: Use platform_get_irq() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Acked-by: Florian Fainelli Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211224142917.6966-10-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Greg Kroah-Hartman commit 1129a63e3a4c636f71c8d399313046f7b55f3009 Author: Lad Prabhakar Date: Fri Dec 24 14:29:14 2021 +0000 serial: ar933x: Use platform_get_irq() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211224142917.6966-9-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Greg Kroah-Hartman commit f63f1ddb5c2a9713c4cafce71d1eb3c1471d42e5 Author: Lad Prabhakar Date: Fri Dec 24 14:29:13 2021 +0000 serial: vt8500: Use platform_get_irq() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211224142917.6966-8-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Greg Kroah-Hartman commit 60302276caff50f907bc3391a364691ab4a21b43 Author: Lad Prabhakar Date: Fri Dec 24 14:29:12 2021 +0000 serial: altera_jtaguart: Use platform_get_irq_optional() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq_optional(). Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211224142917.6966-7-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Greg Kroah-Hartman commit 6050efac12c6bd1cdb75cf217c37cf3ee9f408c9 Author: Lad Prabhakar Date: Fri Dec 24 14:29:11 2021 +0000 serial: pxa: Use platform_get_irq() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211224142917.6966-6-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Greg Kroah-Hartman commit 5b68061983471470d4109bac776145245f06bc09 Author: Lad Prabhakar Date: Fri Dec 24 14:29:10 2021 +0000 serial: meson: Use platform_get_irq() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211224142917.6966-5-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Greg Kroah-Hartman commit c195438f1e84de8fa46b4f5264d12379bee6e9a1 Author: Lad Prabhakar Date: Fri Dec 24 14:29:09 2021 +0000 serial: 8250_bcm7271: Propagate error codes from brcmuart_probe() In case of failures brcmuart_probe() always returned -ENODEV, this isn't correct for example platform_get_irq_byname() may return -EPROBE_DEFER to handle such cases propagate error codes in brcmuart_probe() in case of failures. Fixes: 41a469482de25 ("serial: 8250: Add new 8250-core based Broadcom STB driver") Acked-by: Florian Fainelli Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211224142917.6966-4-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Greg Kroah-Hartman commit 56c8b1c10e95f9a56952a15b0a1656e04b98208d Author: Lad Prabhakar Date: Fri Dec 24 14:29:08 2021 +0000 serial: 8250_bcm7271: Use platform_get_irq() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Acked-by: Florian Fainelli Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211224142917.6966-3-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Greg Kroah-Hartman commit 257538544d42987e740491838519ceee5e97d04e Author: Lad Prabhakar Date: Fri Dec 24 14:29:07 2021 +0000 serial: altera: Use platform_get_irq_optional() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq_optional(). Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211224142917.6966-2-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Greg Kroah-Hartman commit a359101c7c6404d917a19d52133305ea284a0197 Author: Biju Das Date: Tue Dec 21 09:47:08 2021 +0000 dt-bindings: serial: renesas,sci: Document RZ/V2L SoC Add SCI binding documentation for Renesas RZ/V2L SoC. No driver changes are required as generic compatible string "renesas,sci" will be used as a fallback. Signed-off-by: Biju Das Signed-off-by: Lad Prabhakar Acked-by: Rob Herring Link: https://lore.kernel.org/r/20211221094717.16187-8-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Greg Kroah-Hartman commit b0c86a6083229db0518e2754b2b6298e40e8d637 Author: Biju Das Date: Tue Dec 21 09:47:07 2021 +0000 dt-bindings: serial: renesas,scif: Document RZ/V2L SoC Add SCIF binding documentation for Renesas RZ/V2L SoC. SCIF block on RZ/V2L is identical to one found on the RZ/G2L SoC. No driver changes are required as RZ/G2L compatible string "renesas,scif-r9a07g044" will be used as a fallback. Signed-off-by: Biju Das Signed-off-by: Lad Prabhakar Acked-by: Rob Herring Link: https://lore.kernel.org/r/20211221094717.16187-7-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Greg Kroah-Hartman commit cb559bb974536d75c8385b2caa57ab5a3862c29a Author: Muhammad Usama Anjum Date: Tue Dec 21 23:41:51 2021 +0500 serial: lantiq: store and compare return status correctly platform_get_irq() returns signed status. It should be stored and compared as signed value before storing to unsigned variable. Implicit conversion from signed to unsigned and then comparison with less than zero is wrong as unsigned value can never be less than zero. Fixes: f087f01ca2c5 ("serial: lantiq: Use platform_get_irq() to get the interrupt") Acked-by: Rob Herring Signed-off-by: Muhammad Usama Anjum Link: https://lore.kernel.org/r/YcIf7+oSWWn34ND6@debian-BULLSEYE-live-builder-AMD64 Signed-off-by: Greg Kroah-Hartman commit b4a29b94804c4774f22555651296b838df6ec0e4 Author: Lukas Wunner Date: Tue Dec 28 18:22:00 2021 +0100 serial: 8250: Move Alpha-specific quirk out of the core struct uart_8250_port contains mcr_mask and mcr_force members whose sole purpose is to work around an Alpha-specific quirk. This code doesn't belong in the core where it is executed by everyone else, so move it to a proper ->set_mctrl callback which is used on the affected Alpha machine only. The quirk was introduced in January 1995: https://git.kernel.org/pub/scm/linux/kernel/git/history/history.git/diff/drivers/char/serial.c?h=1.1.83 The members in struct uart_8250_port were added in 2002: https://git.kernel.org/history/history/c/4524aad27854 The quirk applies to non-PCI Alphas and arch/alpha/Kconfig specifies "select FORCE_PCI if !ALPHA_JENSEN". So apparently the only affected machine is the EISA-based Jensen that Linus was working on back then: https://lore.kernel.org/all/CAHk-=wj1JWZ3sCrGz16nxEj7=0O+srMg6Ah3iPTDXSPKEws_SA@mail.gmail.com/ Up until now the quirk is not applied unless CONFIG_PCI is disabled. If users forget to do that or run a generic Alpha kernel, the serial ports aren't usable on Jensen. Avoid by confining the quirk to CONFIG_ALPHA_JENSEN instead of !CONFIG_PCI. On generic Alpha kernels, auto-detect at runtime whether the quirk needs to be applied. Cc: Russell King Cc: Ulrich Teichert Cc: Linus Torvalds Signed-off-by: Lukas Wunner Link: https://lore.kernel.org/r/b83d069cb516549b8a5420e097bb6bdd806f36fc.1640695609.git.lukas@wunner.de Signed-off-by: Greg Kroah-Hartman commit d3b3404df318504ec084213ab1065b73f49b0f1d Author: Lukas Wunner Date: Sat Dec 18 10:58:56 2021 +0100 serial: Fix incorrect rs485 polarity on uart open Commit a6845e1e1b78 ("serial: core: Consider rs485 settings to drive RTS") sought to deassert RTS when opening an rs485-enabled uart port. That way, the transceiver does not occupy the bus until it transmits data. Unfortunately, the commit mixed up the logic and *asserted* RTS instead of *deasserting* it: The commit amended uart_port_dtr_rts(), which raises DTR and RTS when opening an rs232 port. "Raising" actually means lowering the signal that's coming out of the uart, because an rs232 transceiver not only changes a signal's voltage level, it also *inverts* the signal. See the simplified schematic in the MAX232 datasheet for an example: https://www.ti.com/lit/ds/symlink/max232.pdf So, to raise RTS on an rs232 port, TIOCM_RTS is *set* in port->mctrl and that results in the signal being driven low. In contrast to rs232, the signal level for rs485 Transmit Enable is the identity, not the inversion: If the transceiver expects a "high" RTS signal for Transmit Enable, the signal coming out of the uart must also be high, so TIOCM_RTS must be *cleared* in port->mctrl. The commit did the exact opposite, but it's easy to see why given the confusing semantics of rs232 and rs485. Fix it. Fixes: a6845e1e1b78 ("serial: core: Consider rs485 settings to drive RTS") Cc: stable@vger.kernel.org # v4.14+ Cc: Rafael Gago Castano Cc: Jan Kiszka Cc: Su Bao Cheng Signed-off-by: Lukas Wunner Link: https://lore.kernel.org/r/9395767847833f2f3193c49cde38501eeb3b5669.1639821059.git.lukas@wunner.de Signed-off-by: Greg Kroah-Hartman commit 5021d709b31b8a14317998a33cbc78be0de9ab30 Author: Wander Lairson Costa Date: Wed Dec 22 08:28:30 2021 -0300 tty: serial: Use fifo in 8250 console driver Note: I am using a small test app + driver located at [0] for the problem description. serco is a driver whose write function dispatches to the serial controller. sertest is a user-mode app that writes n bytes to the serial console using the serco driver. While investigating a bug in the RHEL kernel, I noticed that the serial console throughput is way below the configured speed of 115200 bps in a HP Proliant DL380 Gen9. I was expecting something above 10KB/s, but I got 2.5KB/s. $ time ./sertest -n 2500 /tmp/serco real 0m0.997s user 0m0.000s sys 0m0.997s With the help of the function tracer, I then noticed the serial controller was taking around 410us seconds to dispatch one single byte: $ trace-cmd record -p function_graph -g serial8250_console_write \ ./sertest -n 1 /tmp/serco $ trace-cmd report | serial8250_console_write() { 0.384 us | _raw_spin_lock_irqsave(); 1.836 us | io_serial_in(); 1.667 us | io_serial_out(); | uart_console_write() { | serial8250_console_putchar() { | wait_for_xmitr() { 1.870 us | io_serial_in(); 2.238 us | } 1.737 us | io_serial_out(); 4.318 us | } 4.675 us | } | wait_for_xmitr() { 1.635 us | io_serial_in(); | __const_udelay() { 1.125 us | delay_tsc(); 1.429 us | } ... ... ... 1.683 us | io_serial_in(); | __const_udelay() { 1.248 us | delay_tsc(); 1.486 us | } 1.671 us | io_serial_in(); 411.342 us | } In another machine, I measured a throughput of 11.5KB/s, with the serial controller taking between 80-90us to send each byte. That matches the expected throughput for a configuration of 115200 bps. This patch changes the serial8250_console_write to use the 16550 fifo if available. In my benchmarks I got around 25% improvement in the slow machine, and no performance penalty in the fast machine. Signed-off-by: Wander Lairson Costa Link: https://lore.kernel.org/r/20211222112831.1968392-2-wander@redhat.com Signed-off-by: Greg Kroah-Hartman commit db3e8244bd1c46f5a416fd1e6821036ecc59884a Author: Christophe JAILLET Date: Thu Dec 23 08:40:41 2021 +0100 usb: dwc2: Simplify a bitmap declaration Use DECLARE_BITMAP() instead of hand writing it. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/a2bf604d26dbe9816fdaae0faf4b4837ecacc6d3.1640245180.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman commit 510a0bdb2bfcff8d7be822c72adc3add7a97d559 Author: Heikki Krogerus Date: Thu Dec 23 11:24:32 2021 +0300 usb: Remove usb_for_each_port() There are no more users for the function. Reviewed-by: Andy Shevchenko Acked-by: Rafael J. Wysocki Signed-off-by: Heikki Krogerus Link: https://lore.kernel.org/r/20211223082432.45653-1-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 730b49aac426e1e8016d3c2dd6b407e500423821 Author: Heikki Krogerus Date: Thu Dec 23 11:24:22 2021 +0300 usb: typec: port-mapper: Convert to the component framework Instead of trying to keep track of the connections to the USB Type-C connectors separately, letting the component framework take care of that. From now on every USB Type-C connector will register itself as "aggregate" - component master - and anything that can be connected to it inside the system can then simply register itself as a generic component. The matching of the components and the connector shall rely on ACPI _PLD initially. Before registering itself as the aggregate, the connector will find all other ACPI devices that have matching _PLD crc hash with it (matching value in the pld_crc member of struct acpi_device), and add a component match entry for each one of them. Because only ACPI is supported for now, the driver shall only be build when ACPI is supported. This removes the need for the custom API that the driver exposed. The components and the connector can therefore exist completely independently of each other. The order in which they are registered, as well as are they modules or not, is now irrelevant. Acked-by: Rafael J. Wysocki Signed-off-by: Heikki Krogerus Link: https://lore.kernel.org/r/20211223082422.45637-1-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 8c67d06f3fd9639c44d8147483fb1c132d71388f Author: Heikki Krogerus Date: Thu Dec 23 11:23:49 2021 +0300 usb: Link the ports to the connectors they are attached to Creating link to the USB Type-C connector for every new port that is added when possible. Reviewed-by: Andy Shevchenko Acked-by: Rafael J. Wysocki Signed-off-by: Heikki Krogerus Link: https://lore.kernel.org/r/20211223082349.45616-1-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 882c982dada4d53079c56de94ccbce1e21cc675f Author: Heikki Krogerus Date: Thu Dec 23 11:16:17 2021 +0300 acpi: Store CRC-32 hash of the _PLD in struct acpi_device Storing CRC-32 hash of the Physical Location of Device object (_PLD) with devices that have it. The hash is stored to a new struct acpi_device member "pld_crc". The hash makes it easier to find devices that share a location, as there is no need to evaluate the entire object every time. Knowledge about devices that share a location can be used in device drivers that need to know the connections to other components inside a system. USB3 ports will for example always share their location with a USB2 port. Acked-by: Rafael J. Wysocki Signed-off-by: Heikki Krogerus Link: https://lore.kernel.org/r/20211223081620.45479-3-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 13068b7472f9720f807fe72b9bf3f76b9fd6d6ab Author: Heikki Krogerus Date: Thu Dec 23 11:16:16 2021 +0300 acpi: Export acpi_bus_type So we can use bus_for_each_dev() and others from modules. Acked-by: Rafael J. Wysocki Signed-off-by: Heikki Krogerus Link: https://lore.kernel.org/r/20211223081620.45479-2-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit a8cf05160336535fc352c0af66115d0ec0299404 Author: Pavel Hofman Date: Sat Dec 25 14:09:29 2021 +0100 docs: ABI: fixed req_number desc in UAC1 Fixed wording of the req_number description in UAC1 docs. Signed-off-by: Pavel Hofman Link: https://lore.kernel.org/r/20211225130929.205629-2-pavel.hofman@ivitera.com Signed-off-by: Greg Kroah-Hartman commit e3088ebc1b97a3e5df13f2e218ed8430ab3a4ad2 Author: Pavel Hofman Date: Sat Dec 25 14:09:28 2021 +0100 docs: ABI: added missing num_requests param to UAC2 The existing configfs-usb-gadget-uac2 ABI doc for testing was missing the num_requests param. The patch adds the parameter to the document. Signed-off-by: Pavel Hofman Link: https://lore.kernel.org/r/20211225130929.205629-1-pavel.hofman@ivitera.com Signed-off-by: Greg Kroah-Hartman commit 3254a73fb2caef71c5cf3bd7868f3d5d5a724932 Author: luo penghao Date: Thu Dec 30 06:38:19 2021 +0000 usb-storage: Remove redundant assignments The assignments in these two places will be overwritten, so they should be deleted. The clang_analyzer complains as follows: drivers/usb/storage/sierra_ms.c: Value stored to 'retries' is never read Value stored to 'result' is never read Reported-by: Zeal Robot Signed-off-by: luo penghao Link: https://lore.kernel.org/r/20211230063819.586428-1-luo.penghao@zte.com.cn Signed-off-by: Greg Kroah-Hartman commit 512cdc60e65bb9bf3f65e70b6b161f3a7561a998 Author: Michael Straube Date: Wed Dec 29 21:51:08 2021 +0100 staging: r8188eu: remove header odm_precomp.h After previous cleanups the header odm_precomp.h only contains includes and one unused define now. Remove the header and adjust the includes in affected files. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211229205108.26373-33-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 489257e6832cac659a75ee1db11271ecaa6fc968 Author: Michael Straube Date: Wed Dec 29 21:51:07 2021 +0100 staging: r8188eu: remove unnecessary comments Remove some unnecessary comments in odm.c. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211229205108.26373-32-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit dc481cb55b688351ff91e74969aa200a648915e1 Author: Michael Straube Date: Wed Dec 29 21:51:06 2021 +0100 staging: r8188eu: make odm_EdcaTurboCheck() static Function odm_EdcaTurboCheck() is only used in odm.c. Make it static. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211229205108.26373-31-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit f24eec9cd679efdc3e4e70c6fbe28912b019a2ec Author: Michael Straube Date: Wed Dec 29 21:51:05 2021 +0100 staging: r8188eu: make ODM_EdcaTurboInit() static Function ODM_EdcaTurboInit() is only used in odm.c. Make it static. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211229205108.26373-30-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit bccd2be7842d5f74f928c723c3962f8e0f0c6add Author: Michael Straube Date: Wed Dec 29 21:51:04 2021 +0100 staging: r8188eu: make odm_HwAntDiv() static Function odm_HwAntDiv() is only used in odm.c. Make it static. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211229205108.26373-29-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 42f88b7927725100fb940fd7179ef38d00398f09 Author: Michael Straube Date: Wed Dec 29 21:51:03 2021 +0100 staging: r8188eu: make odm_InitHybridAntDiv() static Function odm_InitHybridAntDiv() is only used in odm.c. Make it static. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211229205108.26373-28-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0956ab4d36ed22a6fa6d9ac09dd48ead9aa0b77f Author: Michael Straube Date: Wed Dec 29 21:51:02 2021 +0100 staging: r8188eu: make odm_TXPowerTrackingThermalMeterInit() static Function odm_TXPowerTrackingThermalMeterInit() is only used in odm.c. Make it static. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211229205108.26373-27-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 52a4ccac8a195ef5d674ebd2cdde22bbd9de7fc4 Author: Michael Straube Date: Wed Dec 29 21:51:01 2021 +0100 staging: r8188eu: remove odm_TXPowerTrackingInit() odm_TXPowerTrackingInit() is just a wrapper around odm_TXPowerTrackingThermalMeterInit(). Remove it. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211229205108.26373-26-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit b0515ff422387245711c05a3d4bdb39fedd46887 Author: Michael Straube Date: Wed Dec 29 21:51:00 2021 +0100 staging: r8188eu: make odm_RSSIMonitorCheck() static Function odm_RSSIMonitorCheck() is only used in odm.c. Make it static. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211229205108.26373-25-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 9afafc05a79dbb7cfe467aa70d203cdbd2fe2ceb Author: Michael Straube Date: Wed Dec 29 21:50:59 2021 +0100 staging: r8188eu: make odm_CCKPacketDetectionThresh() static Function odm_CCKPacketDetectionThresh() is only used in odm.c. Make it static. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211229205108.26373-24-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 86f0bea75fd9f93f8c004e94e20f8cd1bf02dbfa Author: Michael Straube Date: Wed Dec 29 21:50:58 2021 +0100 staging: r8188eu: make odm_FalseAlarmCounterStatistics() static Function odm_FalseAlarmCounterStatistics() is only used in odm.c. Make it static. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211229205108.26373-23-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit e6b5ad5eeb1c86d32ead2486e303da27b0f43b89 Author: Michael Straube Date: Wed Dec 29 21:50:57 2021 +0100 staging: r8188eu: make odm_DynamicBBPowerSavingInit() static Function odm_DynamicBBPowerSavingInit() is only used in odm.c. Make it static. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211229205108.26373-22-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 78865587d080b73af9bcbcb2900e5d4cdbd756dc Author: Michael Straube Date: Wed Dec 29 21:50:56 2021 +0100 staging: r8188eu: make odm_RefreshRateAdaptiveMask() static Function odm_RefreshRateAdaptiveMask() is only used in odm.c. Make it static. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211229205108.26373-21-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit b82d0bc677ce98c97491447654d796e1c467cd6d Author: Michael Straube Date: Wed Dec 29 21:50:55 2021 +0100 staging: r8188eu: make odm_RateAdaptiveMaskInit() static Function odm_RateAdaptiveMaskInit() is only used in odm.c. Make it static. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211229205108.26373-20-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 5ab68d92cdfc5896b9e21d4dc337e7390f6d2800 Author: Michael Straube Date: Wed Dec 29 21:50:54 2021 +0100 staging: r8188eu: make odm_CommonInfoSelfUpdate() static Function odm_CommonInfoSelfUpdate() is only used in odm.c. Make it static. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211229205108.26373-19-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7d3cbea17567297a7020e6e8b8e71dc60ca3b5c0 Author: Michael Straube Date: Wed Dec 29 21:50:53 2021 +0100 staging: r8188eu: make odm_CommonInfoSelfInit() static Function odm_CommonInfoSelfInit() is only used in odm.c. Make it static. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211229205108.26373-18-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 8badd69b53d618eb6986a3c9355d12f95d81fd7e Author: Michael Straube Date: Wed Dec 29 21:50:52 2021 +0100 staging: r8188eu: make odm_DIG() static Function odm_DIG() is used only in odm.c. Make it static. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211229205108.26373-17-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 51d260d2426d5ded8cb9cf78704ac0ffe0a123e4 Author: Michael Straube Date: Wed Dec 29 21:50:51 2021 +0100 staging: r8188eu: make odm_DIGInit() static Function odm_DIGInit() is used only in odm.c. Make it static. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211229205108.26373-16-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit b1be5b8ff901a6f986d5be3313eb6641edb43aa7 Author: Michael Straube Date: Wed Dec 29 21:50:50 2021 +0100 staging: r8188eu: remove unused prototypes Remove some unused function prototypes. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211229205108.26373-15-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 106a28479d83a9a497128548e99f55b34bca8151 Author: Michael Straube Date: Wed Dec 29 21:50:49 2021 +0100 staging: r8188eu: make odm_ConfigRFReg_8188E() static Function odm_ConfigRFReg_8188E() is only used in odm_RegConfig8188E.c. Make it static. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211229205108.26373-14-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 1bcf699d222fcb3568b2d8ab1db37e431d833968 Author: Michael Straube Date: Wed Dec 29 21:50:48 2021 +0100 staging: r8188eu: remove odm_interface After previous cleanups the file odm_interface.c is emtpy now and the header odm_interface.h just contains an unused typedef. Remove both files. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211229205108.26373-13-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 85dbc7e3abdc24160fea1ba93bacc36e2f3c499c Author: Michael Straube Date: Wed Dec 29 21:50:47 2021 +0100 staging: r8188eu: remove ODM_CompareMemory() ODM_CompareMemory() is just a wrapper around memcmp(). Remove ODM_CompareMemory() and call memcmp() directly. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211229205108.26373-12-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit fec9f472fb1eefc1bfdf194cf0182963764194e7 Author: Michael Straube Date: Wed Dec 29 21:50:46 2021 +0100 staging: r8188eu: remove ODM_delay_ms() ODM_delay_ms() is just a wrapper around mdelay(). Remove ODM_delay_ms() and call mdelay() directly. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211229205108.26373-11-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2e0ed5adb9ede506796d45e358158d8f7b3d8abb Author: Michael Straube Date: Wed Dec 29 21:50:45 2021 +0100 staging: r8188eu: remove ODM_delay_us() ODM_delay_us() is just a wrapper around udelay(). Remove ODM_delay_us() and call udelay() directly. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211229205108.26373-10-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 182861b1495b5b17b7771c28ce446843f2e351fc Author: Michael Straube Date: Wed Dec 29 21:50:44 2021 +0100 staging: r8188eu: remove ODM_sleep_ms() ODM_sleep_ms() is just a wrapper around msleep(). Remove ODM_sleep_ms() and call msleep() directly. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211229205108.26373-9-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 420108ef3b5653886e41223f7b8a2d4f7ce6c2b7 Author: Michael Straube Date: Wed Dec 29 21:50:43 2021 +0100 staging: r8188eu: clean up coding style issues Clean up coding style issues in odm_ConfigRFReg_8188E() reported by checkpatch. WARNING: please, no spaces at the start of a line WARNING: suspect code indent for conditional statements (4, 16) Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211229205108.26373-8-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 502ddefa5085d24616877bd10ac89b030eba838e Author: Michael Straube Date: Wed Dec 29 21:50:42 2021 +0100 staging: r8188eu: remove ODM_SetBBReg() ODM_SetBBReg() is just a wrapper around rtl8188e_PHY_SetBBReg(). Remove ODM_SetBBReg() and call rtl8188e_PHY_SetBBReg() directly. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211229205108.26373-7-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 8aedc08edfcd0b768b1bc18ad1279643a706c5dd Author: Michael Straube Date: Wed Dec 29 21:50:41 2021 +0100 staging: r8188eu: remove ODM_GetBBReg() ODM_GetBBReg() is just a wrapper around rtl8188e_PHY_QueryBBReg(). Remove ODM_GetBBReg() and call rtl8188e_PHY_QueryBBReg() directly. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211229205108.26373-6-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 4c4ab3f449a3d23d4709de8fc36a5313d93b4cb0 Author: Michael Straube Date: Wed Dec 29 21:50:40 2021 +0100 staging: r8188eu: remove ODM_SetRFReg() ODM_SetRFReg() is just a wrapper around rtl8188e_PHY_SetRFReg(). Remove ODM_SetRFReg() and call rtl8188e_PHY_SetRFReg() directly. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211229205108.26373-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit e83545b1ae62e4f913eb7941aa331f759ffccfce Author: Michael Straube Date: Wed Dec 29 21:50:39 2021 +0100 staging: r8188eu: remove ODM_GetRFReg() ODM_GetRFReg() is just a wrapper around rtl8188e_PHY_QueryRFReg(). Remove ODM_GetRFReg() and call rtl8188e_PHY_QueryRFReg() directly. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211229205108.26373-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0575b39908ea7742735760de640293ae3ed21f87 Author: Michael Straube Date: Wed Dec 29 21:50:38 2021 +0100 staging: r8188eu: remove ODM_GetMACReg() ODM_GetMACReg() is just a wrapper around rtl8188e_PHY_QueryBBReg(). Remove ODM_GetMACReg() and call rtl8188e_PHY_QueryBBReg() directly. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211229205108.26373-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 9d68ce358c4d126cb9205e67fd310bc5ac293574 Author: Michael Straube Date: Wed Dec 29 21:50:37 2021 +0100 staging: r8188eu: remove ODM_SetMACReg() ODM_SetMACReg() is just a wrapper around rtl8188e_PHY_SetBBReg(). Remove ODM_SetMACReg() and call rtl8188e_PHY_SetBBReg() directly. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211229205108.26373-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 790ada0e6ec33e069a0deeaa1ec714a8f52bfd46 Author: Lad Prabhakar Date: Fri Dec 24 16:13:34 2021 +0000 staging: axis-fifo: Use platform_get_irq() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211224161334.31123-4-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Greg Kroah-Hartman commit 683fade1a2f3a5685cddf98c8fd432af61444026 Author: Greg Kroah-Hartman Date: Tue Dec 28 14:55:41 2021 +0100 staging: greybus: auto_manager: use default_groups in kobj_type There are currently 2 ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the greybus audio code to use default_groups field which has been the preferred way since aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field. Cc: Vaibhav Agarwal Cc: Johan Hovold Reviewed-by: Alex Elder Acked-by: Mark Greer Link: https://lore.kernel.org/r/20211228135541.380275-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit ff936357b49681cf823ca82a565dbdd0fd439819 Author: Ingo Molnar Date: Thu Dec 30 08:25:52 2021 +0100 x86/defconfig: Enable CONFIG_LOCALVERSION_AUTO=y in the defconfig With CONFIG_LOCALVERSION_AUTO=y enabled, 'uname' provides much more useful output on debug kernels: Before: # CONFIG_LOCALVERSION_AUTO is not set $ uname -a Linux localhost 5.16.0-rc7+ #4563 SMP PREEMPT Thu Dec 30 08:28:38 CET 2021 x86_64 GNU/Linux After: # CONFIG_LOCALVERSION_AUTO=y $ uname -a Linux localhost 5.16.0-rc7-02294-g5537f9709b16 #4562 SMP PREEMPT Thu Dec 30 08:27:17 CET 2021 x86_64 GNU/Linux This is particularly valuable during bisection, if we want to double check the exact kernel version we are testing. (Just remove the config line, the global Kconfig default for this is default-y.) Cc: Thomas Gleixner Cc: Borislav Petkov Cc: Dave Hansen Cc: x86@kernel.org Cc: "H. Peter Anvin" Cc: Linus Torvalds Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar commit 011e8c3239ed36b4720113cafc5539d22cbb76cd Merge: 2b534e90a1e31 c65fe9cbbfd61 Author: Dave Airlie Date: Thu Dec 30 15:20:18 2021 +1000 Merge tag 'drm-intel-next-fixes-2021-12-29' of git://anongit.freedesktop.org/drm/drm-intel into drm-next drm/i915 fixes for the v5.17-rc1: - Update FBC state even when not reallocating CFB Signed-off-by: Dave Airlie From: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/87ee5vk54u.fsf@intel.com commit 35580f90a247db40f983bbbb17c22d272f0e2caa Merge: 1705c62e30055 aebb51ec3db2a Author: Alexei Starovoitov Date: Wed Dec 29 20:03:05 2021 -0800 Merge branch 'lighten uapi/bpf.h rebuilds' Jakub Kicinski says: ==================== Last change in the bpf headers - disentangling BPF uapi from netdevice.h. Both linux/bpf.h and uapi/bpf.h changes should now rebuild ~1k objects down from the original ~18k. There's probably more that can be done but it's diminishing returns. Split into two patches for ease of review. ==================== Signed-off-by: Alexei Starovoitov commit aebb51ec3db2a871d74b4afad3f9914812acf120 Author: Jakub Kicinski Date: Wed Dec 29 17:27:42 2021 -0800 bpf: Invert the dependency between bpf-netns.h and netns/bpf.h netns/bpf.h gets included by netdevice.h (thru net_namespace.h) which in turn gets included in a lot of places. We should keep netns/bpf.h as light-weight as possible. bpf-netns.h seems to contain more implementation details than deserves to be included in a netns header. It needs to pull in uapi/bpf.h to get various enum types. Move enum netns_bpf_attach_type to netns/bpf.h and invert the dependency. This makes netns/bpf.h fit the mold of a struct definition header more clearly, and drops the number of objects rebuilt when uapi/bpf.h is touched from 7.7k to 1.1k. Signed-off-by: Jakub Kicinski Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211230012742.770642-3-kuba@kernel.org commit 3b80b73a4b3de38f72cd79e1a157449917f2bcb5 Author: Jakub Kicinski Date: Wed Dec 29 17:27:41 2021 -0800 net: Add includes masked by netdevice.h including uapi/bpf.h Add missing includes unmasked by the subsequent change. Mostly network drivers missing an include for XDP_PACKET_HEADROOM. Signed-off-by: Jakub Kicinski Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211230012742.770642-2-kuba@kernel.org commit 1705c62e300550e8cfac0d9d1c3869fb860f3162 Merge: 3ccdcee28415c 0ae6eff2978ee Author: Alexei Starovoitov Date: Wed Dec 29 17:54:41 2021 -0800 Merge branch 'Sleepable local storage' KP Singh says: ==================== Local storage is currently unusable in sleepable helpers. One of the important use cases of local_storage is to attach security (or performance) contextual information to kernel objects in LSM / tracing programs to be used later in the life-cyle of the object. Sometimes this context can only be gathered from sleepable programs (because it needs accesing __user pointers or helpers like bpf_ima_inode_hash). Allowing local storage to be used from sleepable programs allows such context to be managed with the benefits of local_storage. # v2 -> v3 * Fixed some RCU issues pointed by Martin * Added Martin's ack # v1 -> v2 * Generalize RCU checks (will send a separate patch for updating non local storage code where this can be used). * Add missing RCU lock checks from v1 ==================== Signed-off-by: Alexei Starovoitov commit 0ae6eff2978ee118ce2b536090af0682db13bb83 Author: KP Singh Date: Fri Dec 24 15:29:16 2021 +0000 bpf/selftests: Update local storage selftest for sleepable programs Remove the spin lock logic and update the selftests to use sleepable programs to use a mix of sleepable and non-sleepable programs. It's more useful to test the sleepable programs since the tests don't really need spinlocks. Signed-off-by: KP Singh Signed-off-by: Alexei Starovoitov Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20211224152916.1550677-3-kpsingh@kernel.org commit 0fe4b381a59ebc53522fce579b281a67a9e1bee6 Author: KP Singh Date: Fri Dec 24 15:29:15 2021 +0000 bpf: Allow bpf_local_storage to be used by sleepable programs Other maps like hashmaps are already available to sleepable programs. Sleepable BPF programs run under trace RCU. Allow task, sk and inode storage to be used from sleepable programs. This allows sleepable and non-sleepable programs to provide shareable annotations on kernel objects. Sleepable programs run in trace RCU where as non-sleepable programs run in a normal RCU critical section i.e. __bpf_prog_enter{_sleepable} and __bpf_prog_exit{_sleepable}) (rcu_read_lock or rcu_read_lock_trace). In order to make the local storage maps accessible to both sleepable and non-sleepable programs, one needs to call both call_rcu_tasks_trace and call_rcu to wait for both trace and classical RCU grace periods to expire before freeing memory. Paul's work on call_rcu_tasks_trace allows us to have per CPU queueing for call_rcu_tasks_trace. This behaviour can be achieved by setting rcupdate.rcu_task_enqueue_lim= boot parameter. In light of these new performance changes and to keep the local storage code simple, avoid adding a new flag for sleepable maps / local storage to select the RCU synchronization (trace / classical). Also, update the dereferencing of the pointers to use rcu_derference_check (with either the trace or normal RCU locks held) with a common bpf_rcu_lock_held helper method. Signed-off-by: KP Singh Signed-off-by: Alexei Starovoitov Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20211224152916.1550677-2-kpsingh@kernel.org commit 47869e82c8b86a4b07eb18d92dbfabe5cc1ed587 Author: Conley Lee Date: Wed Dec 29 09:43:51 2021 +0800 sun4i-emac.c: add dma support Thanks for your review. Here is the new version for this patch. This patch adds support for the emac rx dma present on sun4i. The emac is able to move packets from rx fifo to RAM by using dma. Change since v4. - rename sbk field to skb - rename alloc_emac_dma_req to emac_alloc_dma_req - using kzalloc(..., GPF_ATOMIC) in interrupt context to avoid sleeping - retry by using emac_inblk_32bit when emac_dma_inblk_32bit fails - fix some code style issues Change since v5. - fix some code style issue Signed-off-by: Conley Lee Link: https://lore.kernel.org/r/tencent_DE05ADA53D5B084D4605BE6CB11E49EF7408@qq.com Signed-off-by: Jakub Kicinski commit e2dfb94f27f778e18e47b0c7ff8679099981073d Merge: cfcad56b20895 5d1dd2e5a681b Author: Jakub Kicinski Date: Wed Dec 29 14:14:38 2021 -0800 Merge tag 'for-net-next-2021-12-29' 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 MT7922A - Add support for Realtek RTL8852AE - Rework HCI event handling to use skb_pull_data * tag 'for-net-next-2021-12-29' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next: (62 commits) Bluetooth: MGMT: Fix spelling mistake "simultanous" -> "simultaneous" Bluetooth: vhci: Set HCI_QUIRK_VALID_LE_STATES Bluetooth: MGMT: Fix LE simultaneous roles UUID if not supported Bluetooth: hci_sync: Add check simultaneous roles support Bluetooth: hci_sync: Wait for proper events when connecting LE Bluetooth: hci_sync: Add support for waiting specific LE subevents Bluetooth: hci_sync: Add hci_le_create_conn_sync Bluetooth: hci_event: Use skb_pull_data when processing inquiry results Bluetooth: hci_sync: Push sync command cancellation to workqueue Bluetooth: hci_qca: Stop IBS timer during BT OFF Bluetooth: btusb: Add support for Foxconn MT7922A Bluetooth: btintel: Add missing quirks and msft ext for legacy bootloader Bluetooth: btusb: Add two more Bluetooth parts for WCN6855 Bluetooth: L2CAP: Fix using wrong mode Bluetooth: hci_sync: Fix not always pausing advertising when necessary Bluetooth: mgmt: Make use of mgmt_send_event_skb in MGMT_EV_DEVICE_CONNECTED Bluetooth: mgmt: Make use of mgmt_send_event_skb in MGMT_EV_DEVICE_FOUND Bluetooth: mgmt: Introduce mgmt_alloc_skb and mgmt_send_event_skb Bluetooth: btusb: Return error code when getting patch status failed Bluetooth: btusb: Handle download_firmware failure cases ... ==================== Link: https://lore.kernel.org/r/20211229211258.2290966-1-luiz.dentz@gmail.com Signed-off-by: Jakub Kicinski commit cfcad56b208957b410ce251e895a728993d72298 Merge: 9ed319e411915 cfe355c56e3a5 Author: Jakub Kicinski Date: Wed Dec 29 12:31:39 2021 -0800 Merge branch 'net-define-new-hwtstamp-flag-and-return-it-to-userspace' Hangbin Liu says: ==================== net: define new hwtstamp flag and return it to userspace This patchset defined the new hwtstamp flag HWTSTAMP_FLAG_BONDED_PHC_INDEX to make userspace program build pass with old kernel header by settting ifdef. Let's also return the flag when do SIOC[G/S]HWTSTAMP to let userspace know that it's necessary for a given netdev. ==================== Link: https://lore.kernel.org/r/20211229080938.231324-1-liuhangbin@gmail.com Signed-off-by: Jakub Kicinski commit cfe355c56e3a5eb993fd4ea807b60f34f91b0cde Author: Hangbin Liu Date: Wed Dec 29 16:09:38 2021 +0800 Bonding: return HWTSTAMP_FLAG_BONDED_PHC_INDEX to notify user space If the userspace program is distributed in binary form (distro package), there is no way to know on which kernel versions it will run. Let's only check if the flag was set when do SIOCSHWTSTAMP. And return hwtstamp_config with flag HWTSTAMP_FLAG_BONDED_PHC_INDEX to notify userspace whether the new feature is supported or not. Suggested-by: Jakub Kicinski Fixes: 085d61000845 ("Bonding: force user to add HWTSTAMP_FLAG_BONDED_PHC_INDEX when get/set HWTSTAMP") Signed-off-by: Hangbin Liu Acked-by: Richard Cochran Signed-off-by: Jakub Kicinski commit 1bb412d46ca9df90a3fe4b704f5385f03621455d Author: Hangbin Liu Date: Wed Dec 29 16:09:37 2021 +0800 net_tstamp: define new flag HWTSTAMP_FLAG_BONDED_PHC_INDEX As we defined the new hwtstamp_config flag HWTSTAMP_FLAG_BONDED_PHC_INDEX as enum, it's not easy for userspace program to check if the flag is supported when build. Let's define the new flag so user space could build it on old kernel with ifdef check. Fixes: 9c9211a3fc7a ("net_tstamp: add new flag HWTSTAMP_FLAG_BONDED_PHC_INDEX") Signed-off-by: Hangbin Liu Acked-by: Richard Cochran Signed-off-by: Jakub Kicinski commit 0cf948aab9a0049456d9a498af3da6b403e2a0ed Author: Greg Kroah-Hartman Date: Tue Dec 28 14:57:22 2021 +0100 PCI/sysfs: Use default_groups in kobj_type for slot attrs There are currently two ways to create a set of sysfs files for a kobj_type: through the default_attrs field, and the default_groups field. Move the PCI slot code to use the default_groups field which has been the preferred way since aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field. Link: https://lore.kernel.org/r/20211228135722.381023-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Bjorn Helgaas commit 0fa328796b985930a62aafc4775a1ef8ac8077cc Merge: 63064451d0b83 38ac2f0386665 Author: Greg Kroah-Hartman Date: Wed Dec 29 19:29:20 2021 +0100 Merge tag 'iio-for-5.17b' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-next Jonathan writes: 2nd set of new device support etc for IIO in the 5.17 cycle. A small additional set of things that just missed the previous pull request and have mostly been through plenty of review before the holiday period began (or are trivial). I've not taken some other series on the list to allow for more eyes after the holiday period. New device support * adi,admv1013 - New driver for this wideband microwave upconverter including dt-bindings and some device specific ABI due to the need to describe phase calibrations of a differential channel on both i and q phases. Previously we could do differential or i/q but not both on the same channel. The driver ABI uses a workaround for core support which will do until we know if this is a common requirement for which a more generic solution is needed. MAINTAINERS: * Add Haibo Chen as a maintainer for various NXP SoC ADCs. Minor cleanup: * sunrise_co2 - Make sure an uninitialized value isn't used to set *val in read_raw(). Not a real bug, but a compiler or reviewer can't tell that based on what they can see locally. * tag 'iio-for-5.17b' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: iio: chemical: sunrise_co2: set val parameter only on success dt-bindings:iio:adc: update the maintainer of vf610-adc MAINTAINERS: add imx7d/imx6sx/imx6ul/imx8qxp and vf610 adc maintainer Documentation:ABI:testing:admv1013: add ABI docs dt-bindings: iio: frequency: add admv1013 doc iio: frequency: admv1013: add support for ADMV1013 commit 38970eac41db0031dcd337e124fab92a7105ed85 Author: Ruud Bos Date: Thu Oct 28 16:34:59 2021 +0200 igb: support EXTTS on 82580/i354/i350 Support for the PTP pin function on 82580/i354/i350 based adapters. Because the time registers of these adapters do not have the nice split in second rollovers as the i210 has, the implementation is slightly more complex compared to the i210 implementation. Signed-off-by: Ruud Bos Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit 1819fc753aca18e6dcd283c98040e1ac4b963058 Author: Ruud Bos Date: Thu Oct 28 16:34:58 2021 +0200 igb: support PEROUT on 82580/i354/i350 Support for the PEROUT PTP pin function on 82580/i354/i350 based adapters. Because the time registers of these adapters do not have the nice split in second rollovers as the i210 has, the implementation is slightly more complex compared to the i210 implementation. Signed-off-by: Ruud Bos Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit cf99c1dd7b7729091043374b90807c7a5f9fd9b1 Author: Ruud Bos Date: Thu Oct 28 16:34:57 2021 +0200 igb: move PEROUT and EXTTS isr logic to separate functions Remove code duplication in the tsync interrupt handler function by moving this logic to separate functions. This keeps the interrupt handler readable and allows the new functions to be extended for adapter types other than i210. Signed-off-by: Ruud Bos Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit 8ab55aba31eeb0b9b734c0c0526be1915d076305 Author: Ruud Bos Date: Thu Oct 28 16:34:56 2021 +0200 igb: move SDP config initialization to separate function Allow reuse of SDP config struct initialization by moving it to a separate function. Signed-off-by: Ruud Bos Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit 498860df8edc069ba63449891e531706594f6791 Merge: 19768f80cf238 e3d347943919f Author: Jens Axboe Date: Wed Dec 29 09:50:50 2021 -0800 Merge tag 'nvme-5.17-2021-12-29' of git://git.infradead.org/nvme into for-5.17/drivers Pull NVMe updates from Christoph: "nvme updates for Linux 5.17 - increment request genctr on completion (Keith Busch, Geliang Tang) - add a 'iopolicy' module parameter (Hannes Reinecke) - print out valid arguments when reading from /dev/nvme-fabrics (Hannes Reinecke)" * tag 'nvme-5.17-2021-12-29' of git://git.infradead.org/nvme: nvme: add 'iopolicy' module parameter nvme: drop unused variable ctrl in nvme_setup_cmd nvme: increment request genctr on completion nvme-fabrics: print out valid arguments when reading from /dev/nvme-fabrics commit 3ccdcee28415c4226de05438b4d89eb5514edf73 Author: Haimin Zhang Date: Wed Dec 29 19:20:02 2021 +0800 bpf: Add missing map_get_next_key method to bloom filter map. Without it, kernel crashes in map_get_next_key(). Fixes: 9330986c0300 ("bpf: Add bloom filter map implementation") Reported-by: TCS Robot Signed-off-by: Haimin Zhang Signed-off-by: Alexei Starovoitov Acked-by: Joanne Koong Link: https://lore.kernel.org/bpf/1640776802-22421-1-git-send-email-tcs.kernel@gmail.com commit b6459415b384cb829f0b2a4268f211c789f6cf0b Author: Jakub Kicinski Date: Tue Dec 28 16:49:13 2021 -0800 net: Don't include filter.h from net/sock.h sock.h is pretty heavily used (5k objects rebuilt on x86 after it's touched). We can drop the include of filter.h from it and add a forward declaration of struct sk_filter instead. This decreases the number of rebuilt objects when bpf.h is touched from ~5k to ~1k. There's a lot of missing includes this was masking. Primarily in networking tho, this time. Signed-off-by: Jakub Kicinski Signed-off-by: Alexei Starovoitov Acked-by: Marc Kleine-Budde Acked-by: Florian Fainelli Acked-by: Nikolay Aleksandrov Acked-by: Stefano Garzarella Link: https://lore.kernel.org/bpf/20211229004913.513372-1-kuba@kernel.org commit e565615c5486935e3b6080dc06a94c6fbd0b4264 Author: Matthias Brugger Date: Sat Dec 18 09:15:43 2021 +0100 mfd: google,cros-ec: Fix property name for MediaTek rpmsg The MediaTek rpmsg-name is defined as mediatek,rpmsg-name in mtk,scp.yaml. Fix the binding documentation to match the new property Signed-off-by: Matthias Brugger Acked-by: Rob Herring Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20211218081543.3851-1-matthias.bgg@kernel.org commit 46d89ac8e02ff917e6b4726299b2383fbcb38271 Author: Alexandre Ghiti Date: Thu Dec 16 17:40:36 2021 +0100 dt-bindings: mfd: Fix typo "DA9093" -> "DA9063" The device described is the "DA9063", not "DA9093", so fix this typo. Signed-off-by: Alexandre Ghiti Acked-by: Rob Herring Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20211216164037.2888316-1-alexandre.ghiti@canonical.com commit b92e301633f0f454aa1cfedac2e096bb9649b367 Author: Jonathan Neuschäfer Date: Sat Dec 18 16:25:53 2021 +0100 mfd: ntxec: Change return type of ntxec_reg8 from __be16 to u16 Register values in NTXEC are big-endian on the I2C bus, but the regmap subsystem handles the conversion between CPU-endian and big-endian data internally. ntxec_reg8 should thus return u16, not __be16. Reported-by: kernel test robot Signed-off-by: Jonathan Neuschäfer Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20211218152553.744615-1-j.neuschaefer@gmx.net commit 7620ad0bdfac1efff4a1228cd36ae62a9d8206b0 Author: Dmitry Osipenko Date: Wed Nov 24 22:01:04 2021 +0300 mfd: tps65910: Set PWR_OFF bit during driver probe The PWR_OFF bit needs to be set in order to power off properly, without hanging PMIC. This bit needs to be set early in order to allow thermal protection of NVIDIA Terga SoCs to power off hardware properly, otherwise a battery re-plug may be needed on some devices to recover after the hang. Cc: Signed-off-by: Dmitry Osipenko Tested-by: Svyatoslav Ryhel # ASUS TF201 Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20211124190104.23554-1-digetx@gmail.com commit 5b78223f55a0f516a1639dbe11cd4324d4aaee20 Author: Hans de Goede Date: Mon Dec 6 18:48:06 2021 +0100 mfd: intel_soc_pmic: Use CPU-id check instead of _HRV check to differentiate variants The Intel Crystal Cove PMIC has 2 different variants, one for use with Bay Trail (BYT) SoCs and one for use with Cherry Trail (CHT) SoCs. So far we have been using an ACPI _HRV check to differentiate between the 2, but at least on the Microsoft Surface 3, which is a CHT device, the wrong _HRV value is reported by ACPI. So instead switch to a CPU-ID check which prevents us from relying on the possibly wrong ACPI _HRV value. Signed-off-by: Hans de Goede Reported-by: Tsuchiya Yuto Reviewed-by: Andy Shevchenko Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20211206174806.197772-2-hdegoede@redhat.com commit e6b142060b24014bfcf86ae5b1facc5e99e84176 Author: Hans de Goede Date: Fri Dec 3 12:51:08 2021 +0100 mfd: intel-lpss: Fix I2C4 not being available on the Microsoft Surface Go & Go 2 Many DSDTs for Kaby Lake and Kaby Lake Refresh models contain a _SB.PCI0.GEXP ACPI Device node describing an I2C attached PCA953x GPIO expander. This seems to be something which is copy and pasted from the DSDT from some reference design since this ACPI Device is present even on models where no such GPIO expander is used at all, such as on the Microsoft Surface Go & Go 2. This ACPI Device is a problem because it contains a SystemMemory OperationRegion which covers the MMIO for the I2C4 I2C controller. This causes the MFD cell for the I2C4 controller to not be instantiated due to a resource conflict, requiring the use of acpi_enforce_resources=lax to work around this. I have done an extensive analysis of all the ACPI tables on the Microsoft Surface Go and the _SB.PCI0.GEXP ACPI Device's methods are not used by any code in the ACPI tables, neither are any of them directly called by any Linux kernel code. This is unsurprising since running i2cdetect on the I2C4 bus shows that there is no GPIO expander chip present on these devices at all. This commit adds a PCI subsystem vendor:device table listing PCI devices where it is known to be safe to ignore resource conflicts with ACPI declared SystemMemory regions. This makes the I2C4 bus work out of the box on the Microsoft Surface Go & Go 2, which is necessary for the cameras on these devices to work. Signed-off-by: Hans de Goede Reviewed-by: Laurent Pinchart Reviewed-by: Andy Shevchenko Acked-by: Mika Westerberg Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20211203115108.89661-1-hdegoede@redhat.com commit 244122b4d2e5221e6abd6e21d6a58170104db781 Author: Tony Luck Date: Thu Dec 16 09:24:31 2021 -0800 x86/lib: Add fast-short-rep-movs check to copy_user_enhanced_fast_string() Commit f444a5ff95dc ("x86/cpufeatures: Add support for fast short REP; MOVSB") fixed memmove() with an ALTERNATIVE that will use REP MOVSB for all string lengths. copy_user_enhanced_fast_string() has a similar run time check to avoid using REP MOVSB for copies less that 64 bytes. Add an ALTERNATIVE to patch out the short length check and always use REP MOVSB on X86_FEATURE_FSRM CPUs. Signed-off-by: Tony Luck Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20211216172431.1396371-1-tony.luck@intel.com commit cc5c9788106fb1b9e03c8c57d8d7166073a54416 Author: Derek Fang Date: Mon Dec 27 13:54:46 2021 +0800 ASoC: rt5682: Register wclk with its parent_hws instead of parent_data The mclk might not be registered as a fixed clk name "mclk" on some platforms. In those platforms, if the mclk needed to be controlled by codec driver and acquired by a fixed name, it would be a problem. This patch to fix the issue that wclk becomes an orphan due to the fixed mclk's name. Signed-off-by: Derek Fang Link: https://lore.kernel.org/r/20211227055446.27563-1-derek.fang@realtek.com Signed-off-by: Mark Brown commit c5ab93e289ce554a4e0d47330dde120284541aa1 Author: Trevor Wu Date: Tue Dec 28 14:48:21 2021 +0800 ASoC: mediatek: mt8195: update control for RT5682 series Playback pop is observed and the root cause is the reference clock provided by MT8195 is diabled before RT5682 finishes the control flow. To ensure the reference clock supplied to RT5682 is disabled after RT5682 finishes all register controls. We replace BCLK with MCLK for RT5682 reference clock, and makes use of set_bias_level_post to handle MCLK which guarantees MCLK is off after all RT5682 register access. Signed-off-by: Trevor Wu Reviewed-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20211228064821.27865-1-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit 3ecb46755eb85456b459a1a9f952c52986bce8ec Author: Jiasheng Jiang Date: Tue Dec 28 11:40:26 2021 +0800 ASoC: samsung: idma: Check of ioremap return value Because of the potential failure of the ioremap(), the buf->area could be NULL. Therefore, we need to check it and return -ENOMEM in order to transfer the error. Fixes: f09aecd50f39 ("ASoC: SAMSUNG: Add I2S0 internal dma driver") Signed-off-by: Jiasheng Jiang Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20211228034026.1659385-1-jiasheng@iscas.ac.cn Signed-off-by: Mark Brown commit 3667a037e50a31555276a7989435126e501f0f15 Author: Tzung-Bi Shih Date: Mon Dec 27 14:21:53 2021 +0800 ASoC: mediatek: use of_device_get_match_data() Uses of_device_get_match_data() helper to clean some boilerplate code. Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20211227062153.3887447-1-tzungbi@google.com Signed-off-by: Mark Brown commit 8f85317292f1d99e8a70a400a46ee697d64e3326 Author: Fabio Estevam Date: Wed Dec 22 11:19:19 2021 -0300 ASoC: cs4265: Fix part number ID error message The Chip ID - Register 01h contains the following description as per the CS4265 datasheet: "Bits 7 through 4 are the part number ID, which is 1101b (0Dh)" The current error message is incorrect as it prints CS4265_CHIP_ID, which is the register number, instead of printing the expected part number ID value. To make it clearer, also do a shift by 4, so that the error message would become: [ 4.218083] cs4265 1-004f: CS4265 Part Number ID: 0x0 Expected: 0xd Signed-off-by: Fabio Estevam Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20211222141920.1482451-1-festevam@gmail.com Signed-off-by: Mark Brown commit 9ed319e411915e882bb4ed99be3ae78667a70022 Author: Rafał Miłecki Date: Thu Dec 23 13:27:47 2021 +0100 of: net: support NVMEM cells with MAC in text format Some NVMEM devices have text based cells. In such cases MAC is stored in a XX:XX:XX:XX:XX:XX format. Use mac_pton() to parse such data and support those NVMEM cells. This is required to support e.g. a very popular U-Boot and its environment variables. Signed-off-by: Rafał Miłecki Signed-off-by: David S. Miller commit 67aa58e8d4b07b436971326af6319258e0926f33 Author: Mark-PK Tsai Date: Tue Dec 28 17:27:07 2021 +0800 driver core: Simplify async probe test code by using ktime_ms_delta() Simplify async probe test code by using ktime_ms_delta(). Signed-off-by: Mark-PK Tsai Link: https://lore.kernel.org/r/20211228092707.29987-1-mark-pk.tsai@mediatek.com Signed-off-by: Greg Kroah-Hartman commit 63064451d0b8359999e7e8c4fd92951d96f5a057 Author: Greg Kroah-Hartman Date: Tue Dec 28 14:13:50 2021 +0100 cxl: use default_groups in kobj_type There are currently 2 ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the cxl code to use default_groups field which has been the preferred way since aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field. Cc: Frederic Barrat Cc: Andrew Donnellan Cc: Arnd Bergmann Link: https://lore.kernel.org/r/20211228131350.249532-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit 0ac467447dde20d3b186b13cb315644483416c52 Author: Greg Kroah-Hartman Date: Tue Dec 28 14:13:19 2021 +0100 UIO: use default_groups in kobj_type There are currently 2 ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the UIO code to use default_groups field which has been the preferred way since aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field. Link: https://lore.kernel.org/r/20211228131319.249324-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit a6b9a6149d850ab94acc4db9473f124a062be322 Author: Greg Kroah-Hartman Date: Tue Dec 28 15:42:52 2021 +0100 nilfs2: use default_groups in kobj_type There are currently 2 ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the nilfs2 code to use default_groups field which has been the preferred way since aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field. Acked-by: Ryusuke Konishi Link: https://lore.kernel.org/r/20211228144252.390554-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit ad4ddfac646a9e177cb322e7234d87ed4f282da4 Author: Rafał Miłecki Date: Mon Nov 15 06:53:54 2021 +0100 dt-bindings: mfd: Add Broadcom's Timer-Watchdog block It's a block implementing few time related functions depending on a (SoC specific) variant. At this point there is ready binding for a watchdog only. Work on remaining subblocks (e.g. "reg" based reboot) is in progress. Signed-off-by: Rafał Miłecki Reviewed-by: Rob Herring Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20211115055354.6089-2-zajec5@gmail.com commit 5abb065dca7301de90b7c44bbcdc378e49e4d362 Author: Borislav Petkov Date: Wed Dec 1 22:28:14 2021 +0100 notifier: Return an error when a callback has already been registered Return -EEXIST when a notifier callback has already been registered on a notifier chain. This should avoid any homegrown registration tracking at the callsite like https://lore.kernel.org/amd-gfx/20210512013058.6827-1-mukul.joshi@amd.com for example. This version is an alternative of https://lore.kernel.org/r/20211108101157.15189-1-bp@alien8.de which needed to touch every caller not checking the registration routine's return value. Signed-off-by: Borislav Petkov Reviewed-by: Sebastian Andrzej Siewior Acked-by: Alan Stern Link: https://lore.kernel.org/r/YcSWNdUBS8A2ZB3s@zn.tnic commit c4538d0f19010f22854360d99551eb293228b946 Author: Guo Ren Date: Tue Dec 28 14:47:26 2021 +0800 s390: remove unused TASK_SIZE_OF This macro isn't used in Linux sched, now. Delete in include/linux/sched.h and arch's include/asm. Signed-off-by: Guo Ren Signed-off-by: Guo Ren Reviewed-by: Arnd Bergmann Link: https://lore.kernel.org/r/20211228064730.2882351-6-guoren@kernel.org Signed-off-by: Heiko Carstens commit 5f340402bbfc1ee75e7b62b98f6ad85e14ce587c Author: Tudor Ambarus Date: Fri Dec 17 14:26:35 2021 +0200 mtd: spi-nor: Remove debugfs entries that duplicate sysfs entries SPI NOR sysfs defines partname and jedec_id device attributes, which duplicate the information from debugfs. Since the sysfs directory structure and the attributes in each directory define an ABI between the kernel and user space, thus it can never be removed, remove the debugfs entries so that we don't duplicate the information. Signed-off-by: Tudor Ambarus Reviewed-by: Pratyush Yadav Link: https://lore.kernel.org/r/20211217122636.474976-2-tudor.ambarus@microchip.com commit 176a3200ef6d8b4530d613bae13a08edd54c15ab Merge: fa55b7dcdc43c 9dd81021084ff Author: Stephen Boyd Date: Tue Dec 28 21:53:29 2021 -0800 Merge tag 'clk-imx-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/abelvesa/linux into clk-imx Pull i.MX clk driver updates from Abel Vesa: - Set suppress_bind_attrs to true for i.MX8ULP driver - Switch from do_div to div64_ul for throughout all drivers - Fix imx8mn_clko1_sels for i.MX8MN - Remove unused IPG_AUDIO_ROOT from i.MX8MP - Switch parent for audio_root_clk to audio ahb in i.MX8MP driver * tag 'clk-imx-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/abelvesa/linux: clk: imx8mp: Fix the parent clk of the audio_root_clk clk: imx8mp: Remove IPG_AUDIO_ROOT from imx8mp-clock.h clk: imx8mn: Fix imx8mn_clko1_sels clk: imx: Use div64_ul instead of do_div clk: imx: imx8ulp: set suppress_bind_attrs to true commit fcfc6ea4a400ee368043c939d50c15a311157142 Merge: fa55b7dcdc43c b1bc04a2ac5b1 Author: Stephen Boyd Date: Tue Dec 28 21:47:05 2021 -0800 Merge tag 'for-5.17-clk' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into clk-nvidia Pull Tegra clk driver updates from Thierry Reding: This contains a simple fix for the VDE clock on Tegra114 and some preparation work to support runtime PM and generic power domains. * tag 'for-5.17-clk' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: clk: tegra: Support runtime PM and power domain clk: tegra: Make vde a child of pll_p on tegra114 commit a5ce1d51187051384e18c9aceedd145787599c03 Merge: 1dfeb03e86adc f0b62b0bbedcd Author: Stephen Boyd Date: Tue Dec 28 21:42:12 2021 -0800 Merge tag 'renesas-clk-for-v5.17-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into clk-renesas Pull Renesas clk driver updates from Geert Uytterhoeven: - Add support for the new Renesas R-Car S4-8 (R8A779F0) SoC - Add GPU clock and resets on Renesas RZ/G2L - Miscellaneous fixes and improvements * tag 'renesas-clk-for-v5.17-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers: clk: renesas: r9a07g044: Add GPU clock and reset entries clk: renesas: r9a07g044: Add mux and divider for G clock clk: renesas: r9a07g044: Rename CLK_PLL3_DIV4 macro clk: renesas: cpg-mssr: Add support for R-Car S4-8 clk: renesas: rcar-gen4: Introduce R-Car Gen4 CPG driver dt-bindings: clock: Add r8a779f0 CPG Core Clock Definitions dt-bindings: power: Add r8a779f0 SYSC power domain definitions commit 4f1e19b6584449248d69aff2b2190994c2ebb7a6 Merge: fa55b7dcdc43c 35b97bb941110 Author: Stephen Boyd Date: Tue Dec 28 21:37:42 2021 -0800 Merge tag 'sunxi-clk-for-5.17-1' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into clk-allwinner Pull Allwinner clk driver updates from Maxime Ripard: Our usual PR for the Allwinner SoCs, this time enabling our sub-framework to be built as a module, converting most drivers to platform drivers and allow them to be built as modules, and support for the Allwinner D1 * tag 'sunxi-clk-for-5.17-1' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: clk: sunxi-ng: Add support for the D1 SoC clocks clk: sunxi-ng: gate: Add macros for gates with fixed dividers clk: sunxi-ng: mux: Add macros using clk_parent_data and clk_hw clk: sunxi-ng: mp: Add macros using clk_parent_data and clk_hw clk: sunxi-ng: div: Add macros using clk_parent_data and clk_hw dt-bindings: clk: Add compatibles for D1 CCUs clk: sunxi-ng: Allow the CCU core to be built as a module clk: sunxi-ng: Convert early providers to platform drivers clk: sunxi-ng: Allow drivers to be built as modules clk: sunxi-ng: Export symbols used by CCU drivers commit c1001a62f2f59513fc3ecdd3cde345411b70b7f7 Merge: fa55b7dcdc43c ff54938dd190d Author: Stephen Boyd Date: Tue Dec 28 21:36:40 2021 -0800 Merge tag 'clk-meson-v5.17-1' of https://github.com/BayLibre/clk-meson into clk-amlogic Pull an Amlogic clock driver update from Jerome Brunet: - Fix MPLL0 gxbb SDM enable * tag 'clk-meson-v5.17-1' of https://github.com/BayLibre/clk-meson: clk: meson: gxbb: Fix the SDM_EN bit for MPLL0 on GXBB commit d4eeb82674acadf789277b577986e8e7d3faf695 Author: Yang Li Date: Tue Dec 21 20:48:57 2021 +0900 ksmbd: Fix smb2_get_name() kernel-doc comment Remove some warnings found by running scripts/kernel-doc, which is caused by using 'make W=1'. fs/ksmbd/smb2pdu.c:623: warning: Function parameter or member 'local_nls' not described in 'smb2_get_name' fs/ksmbd/smb2pdu.c:623: warning: Excess function parameter 'nls_table' description in 'smb2_get_name' Reported-by: Abaci Robot Acked-by: Namjae Jeon Signed-off-by: Yang Li Signed-off-by: Steve French commit f5c381392948dcae19f854b9586b806654f08a11 Author: Yang Li Date: Tue Dec 21 17:07:13 2021 +0800 ksmbd: Delete an invalid argument description in smb2_populate_readdir_entry() A warning is reported because an invalid argument description, it is found by running scripts/kernel-doc, which is caused by using 'make W=1'. fs/ksmbd/smb2pdu.c:3406: warning: Excess function parameter 'user_ns' description in 'smb2_populate_readdir_entry' Reported-by: Abaci Robot Fixes: 475d6f98804c ("ksmbd: fix translation in smb2_populate_readdir_entry()") Acked-by: Namjae Jeon Signed-off-by: Yang Li Signed-off-by: Steve French commit 4bfd9eed15e163969156e976c62db5ef423e5b0f Author: Yang Li Date: Tue Dec 21 17:07:12 2021 +0800 ksmbd: Fix smb2_set_info_file() kernel-doc comment Fix argument list that the kdoc format and script verified in smb2_set_info_file(). The warnings were found by running scripts/kernel-doc, which is caused by using 'make W=1'. fs/ksmbd/smb2pdu.c:5862: warning: Function parameter or member 'req' not described in 'smb2_set_info_file' fs/ksmbd/smb2pdu.c:5862: warning: Excess function parameter 'info_class' description in 'smb2_set_info_file' Reported-by: Abaci Robot Fixes: 9496e268e3af ("ksmbd: add request buffer validation in smb2_set_info") Acked-by: Namjae Jeon Signed-off-by: Yang Li Signed-off-by: Steve French commit e230d013378489bcd4b5589ca1d2a5b91ff8d098 Author: Yang Li Date: Tue Dec 21 17:07:11 2021 +0800 ksmbd: Fix buffer_check_err() kernel-doc comment Add the description of @rsp_org in buffer_check_err() kernel-doc comment to remove a warning found by running scripts/kernel-doc, which is caused by using 'make W=1'. fs/ksmbd/smb2pdu.c:4028: warning: Function parameter or member 'rsp_org' not described in 'buffer_check_err' Reported-by: Abaci Robot Fixes: cb4517201b8a ("ksmbd: remove smb2_buf_length in smb2_hdr") Acked-by: Namjae Jeon Signed-off-by: Yang Li Signed-off-by: Steve French commit ce53d365378cde71bb6596d79c257e600d951d29 Author: Namjae Jeon Date: Wed Dec 15 14:57:27 2021 +0900 ksmbd: fix multi session connection failure When RSS mode is enable, windows client do simultaneously send several session requests to server. There is racy issue using sess->ntlmssp.cryptkey on N connection : 1 session. So authetication failed using wrong cryptkey on some session. This patch move cryptkey to ksmbd_conn structure to use each cryptkey on connection. Tested-by: Ziwei Xie Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 71cd9cb680cb5d536c0dcbddb1c1d0010d79b214 Author: Namjae Jeon Date: Thu Dec 16 10:31:44 2021 +0900 ksmbd: set both ipv4 and ipv6 in FSCTL_QUERY_NETWORK_INTERFACE_INFO Set ipv4 and ipv6 address in FSCTL_QUERY_NETWORK_INTERFACE_INFO. Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit a58b45a4dbfd0bf2ebb157789da4d8e6368afb1b Author: Namjae Jeon Date: Thu Dec 16 10:26:43 2021 +0900 ksmbd: set RSS capable in FSCTL_QUERY_NETWORK_INTERFACE_INFO Set RSS capable in FSCTL_QUERY_NETWORK_INTERFACE_INFO if netdev has multi tx queues. And add ksmbd_compare_user() to avoid racy condition issue in ksmbd_free_user(). because windows client is simultaneously used to send session setup requests for multichannel connection. Tested-by: Ziwei Xie Signed-off-by: Namjae Jeon Signed-off-by: Steve French commit 305f8bda15ebbe4004681286a5c67d0dc296c771 Author: Marios Makassikis Date: Wed Dec 1 21:40:50 2021 +0100 ksmbd: Remove unused fields from ksmbd_file struct definition These fields are remnants of the not upstreamed SMB1 code. Acked-by: Namjae Jeon Signed-off-by: Marios Makassikis Signed-off-by: Steve French commit 80917f17e3f99027661a45262c310139e53a9faa Author: Marios Makassikis Date: Wed Dec 1 21:41:19 2021 +0100 ksmbd: Remove unused parameter from smb2_get_name() The 'share' parameter is no longer used by smb2_get_name() since commit 265fd1991c1d ("ksmbd: use LOOKUP_BENEATH to prevent the out of share access"). Acked-by: Namjae Jeon Signed-off-by: Marios Makassikis Signed-off-by: Steve French commit 294277410cf3b46bee2b8282ab754e52975c0a70 Author: Hyunchul Lee Date: Tue Nov 23 11:10:13 2021 +0900 ksmbd: use oid registry functions to decode OIDs Use look_up_OID to decode OIDs rather than implementing functions. Acked-by: Namjae Jeon Signed-off-by: Hyunchul Lee Signed-off-by: Steve French commit 2b534e90a1e31c7fc9536b512b72274cc3575f4c Merge: 040bf2a9446f6 6ed95285382d6 Author: Dave Airlie Date: Wed Dec 29 14:02:10 2021 +1000 Merge tag 'drm-msm-next-2021-12-26' of ssh://gitlab.freedesktop.org/drm/msm into drm-next * dpu plane state cleanup in prep for multirect * dpu debugfs cleanup (and moving things to atomic_print_state) in prep for multirect * dp support for sc7280 * struct_mutex removal * include more GMU state in gpu devcore dumps * add support for a506 * remove old eDP sub-driver (never was used in any upstream supported devices and modern things with eDP will use DP sub-driver instead) * debugfs to disable hw gpu hang detect for (igt tests) * debugfs for dumping display hw state * and the usual assortment of cleanup and bug fixes There still seems to be a timing issue with dpu, showing up on sc7180 devices, after the bridge probe-order change. Ie. things work great if loglevel is high enough (or enough debug options are enabled, etc). We'll continue to debug this in the new year. Signed-off-by: Dave Airlie From: Rob Clark Link: https://patchwork.freedesktop.org/patch/msgid/CAF6AEGs+vwr0nkwgYzuYAsCoHtypWpWav+yVvLZGsEJy8tJ56A@mail.gmail.com commit 8f67f65d121cc3bbb4ffaae80e880aeb307d49f4 Author: Yihao Han Date: Tue Nov 9 19:07:12 2021 -0800 arc: use swap() to make code cleaner Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid opencoding it. Signed-off-by: Yihao Han Signed-off-by: Vineet Gupta commit ca295ffb9102c8cf619e2a38d5383bf7c08ceb62 Author: Alexey Brodkin Date: Mon Nov 29 12:37:07 2021 -0800 arc: perf: Move static structs to where they're really used It is all well described by Stephen Rothwell who initially spotted that: ----------------------------->8---------------------------- After merging the origin tree, today's linux-next build (arc haps_hs_smp_defconfig+kselftest) produced these warnings: arch/arc/include/asm/perf_event.h:126:27: warning: 'arc_pmu_cache_map' defined but not used [-Wunused-const-variable=] arch/arc/include/asm/perf_event.h:91:27: warning: 'arc_pmu_ev_hw_map' defined but not used [-Wunused-const-variable=] Introduced by commit 0dd450fe13da ("ARC: Add perf support for ARC700 cores") The 2 static arrays should be moved into arch/arc/kernel/perf_event.c (the only place that uses them). We get the warning because perf_event.h is also included by arch/arc/kernel/unaligned.c. ----------------------------->8---------------------------- Could be easily reproduced by running make with "W=1" on any up-to-date sources, when extra warnings get enabled (in particular "-Wunused-const-variable"), otherwise disabled by default in the top-level Makefile as "These warnings generated too much noise in a regular build". Cc: Mischa Jonker Reported-by: Stephen Rothwell Signed-off-by: Alexey Brodkin Signed-off-by: Vineet Gupta commit 1b2a62becacef79c2340ba39f662cfc313b72fb6 Author: Vineet Gupta Date: Thu Dec 16 13:33:45 2021 -0800 ARC: perf: fix misleading comment about pmu vs counter stop Signed-off-by: Vineet Gupta commit 7e5b06b8c1f8f58fa7b7bcec3ccf490ae6f0810e Author: Kees Cook Date: Wed Feb 10 15:28:49 2021 -0800 arc: Replace lkml.org links with lore As started by commit 05a5f51ca566 ("Documentation: Replace lkml.org links with lore"), replace lkml.org links with lore to better use a single source that's more likely to stay available long-term. Signed-off-by: Kees Cook Signed-off-by: Vineet Gupta commit e296c2e1cd70b2dd9b3c294c37ed4e14833b3f31 Author: Colin Ian King Date: Fri Nov 26 22:23:12 2021 +0000 ARC: perf: Remove redundant initialization of variable idx The variable idx is being initialized with a value that is never read, it is being updated later on. The assignment is redundant and can be removed. Reviewed-by: Vladimir Isaev Signed-off-by: Colin Ian King Signed-off-by: Vineet Gupta commit 753150ada5e9c43ffa4cd3de552923656e962519 Author: Randy Dunlap Date: Fri Oct 29 17:31:34 2021 -0700 ARC: thread_info.h: correct two typos in a comment Fix typos of "separately" and "remains". Signed-off-by: Randy Dunlap Suggested-by: Matthew Wilcox # "remains" Cc: Vineet Gupta Cc: linux-snps-arc@lists.infradead.org Signed-off-by: Vineet Gupta commit 5b3d72987701d51bf31823b39db49d10970f5c2d Author: Andrii Nakryiko Date: Wed Dec 22 15:10:03 2021 -0800 libbpf: Improve LINUX_VERSION_CODE detection Ubuntu reports incorrect kernel version through uname(), which on older kernels leads to kprobe BPF programs failing to load due to the version check mismatch. Accommodate Ubuntu's quirks with LINUX_VERSION_CODE by using Ubuntu-specific /proc/version_code to fetch major/minor/patch versions to form LINUX_VERSION_CODE. While at it, consolide libbpf's kernel version detection code between libbpf.c and libbpf_probes.c. [0] Closes: https://github.com/libbpf/libbpf/issues/421 Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20211222231003.2334940-1-andrii@kernel.org commit f60edf5b53848f2cf53e7e4b716ed8e45563bb12 Author: Andrii Nakryiko Date: Wed Dec 22 13:39:24 2021 -0800 libbpf: Use 100-character limit to make bpf_tracing.h easier to read Improve bpf_tracing.h's macro definition readability by keeping them single-line and better aligned. This makes it easier to follow all those variadic patterns. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20211222213924.1869758-2-andrii@kernel.org commit 3cc31d794097a0de5ac619d4a20b1975139e6b05 Author: Andrii Nakryiko Date: Wed Dec 22 13:39:23 2021 -0800 libbpf: Normalize PT_REGS_xxx() macro definitions Refactor PT_REGS macros definitions in bpf_tracing.h to avoid excessive duplication. We currently have classic PT_REGS_xxx() and CO-RE-enabled PT_REGS_xxx_CORE(). We are about to add also _SYSCALL variants, which would require excessive copying of all the per-architecture definitions. Instead, separate architecture-specific field/register names from the final macro that utilize them. That way for upcoming _SYSCALL variants we'll be able to just define x86_64 exception and otherwise have one common set of _SYSCALL macro definitions common for all architectures. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Tested-by: Ilya Leoshkevich Acked-by: Yonghong Song Acked-by: Ilya Leoshkevich Link: https://lore.kernel.org/bpf/20211222213924.1869758-1-andrii@kernel.org commit 271d3be1c3b6b0be083a99254a0ecac41789929b Merge: 4c46625bb586a c15500198916c Author: Jakub Kicinski Date: Tue Dec 28 16:16:57 2021 -0800 Merge branch '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== 10GbE Intel Wired LAN Driver Updates 2021-12-28 Alexander Lobakin says: napi_build_skb() I introduced earlier this year ([0]) aims to decrease MM pressure and the overhead from in-place kmem_cache_alloc() on each Rx entry processing by decaching skbuff_heads from NAPI per-cpu cache filled prior to that by napi_consume_skb() (so it is sort of a direct shortcut for free -> mm -> alloc cycle). Currently, no in-tree drivers use it. Switch all Intel Ethernet drivers to it to get slight-to-medium perf boosts depending on the frame size. ice driver, 50 Gbps link, pktgen + XDP_PASS (local in) sample: frame_size/nthreads 64/42 128/20 256/8 512/4 1024/2 1532/1 net-next (Kpps) 46062 34654 18248 9830 5343 2714 series 47438 34708 18330 9875 5435 2777 increase 2.9% 0.15% 0.45% 0.46% 1.72% 2.32% Additionally, e1000's been switched to napi_consume_skb() as it's safe and works fine there, and there's no point in napi_build_skb() without paired NAPI cache feeding point. [0] https://lore.kernel.org/all/20210213141021.87840-1-alobakin@pm.me * '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue: ixgbevf: switch to napi_build_skb() ixgbe: switch to napi_build_skb() igc: switch to napi_build_skb() igb: switch to napi_build_skb() ice: switch to napi_build_skb() iavf: switch to napi_build_skb() i40e: switch to napi_build_skb() e1000: switch to napi_build_skb() e1000: switch to napi_consume_skb() ==================== Link: https://lore.kernel.org/r/20211228175815.281449-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit 4c46625bb586a741b8d0e6bdbddbcb2549fa1d36 Author: Aleksander Jan Bajkowski Date: Tue Dec 28 23:00:31 2021 +0100 net: lantiq_etop: add blank line after declaration This patch adds a missing line after the declaration and fixes the checkpatch warning: WARNING: Missing a blank line after declarations + int desc; + for (desc = 0; desc < LTQ_DESC_NUM; desc++) Signed-off-by: Aleksander Jan Bajkowski Link: https://lore.kernel.org/r/20211228220031.71576-1-olek2@wp.pl Signed-off-by: Jakub Kicinski commit 723955913e77fec6659be7531458997df6748d5c Author: Aleksander Jan Bajkowski Date: Tue Dec 28 22:49:10 2021 +0100 net: lantiq_etop: add missing comment for wmb() This patch adds the missing code comment for memory barrier call and fixes checkpatch warning: WARNING: memory barrier without comment + wmb(); Signed-off-by: Aleksander Jan Bajkowski Link: https://lore.kernel.org/r/20211228214910.70810-1-olek2@wp.pl Signed-off-by: Jakub Kicinski commit 1bd32771884187eacda045046805ca493b38e083 Author: Thomas Gleixner Date: Tue Dec 28 22:02:30 2021 +0100 r8169: don't use pci_irq_vector() in atomic context Since referenced change pci_irq_vector() can't be used in atomic context any longer. This conflicts with our usage of this function in rtl8169_netpoll(). Therefore store the interrupt number in struct rtl8169_private. Fixes: 495c66aca3da ("genirq/msi: Convert to new functions") Signed-off-by: Thomas Gleixner Signed-off-by: Heiner Kallweit Link: https://lore.kernel.org/r/3cd24763-f307-78f5-76ed-a5fbf315fb28@gmail.com Signed-off-by: Jakub Kicinski commit 10e5f6e482e18dcdee9a9b7ff1a66f4977dd1ec2 Author: Gao Xiang Date: Tue Dec 28 13:46:01 2021 +0800 erofs: introduce z_erofs_fixup_insize To prepare for the upcoming ztailpacking feature, introduce z_erofs_fixup_insize() and pageofs_in to wrap up the process to get the exact compressed size via zero padding. Link: https://lore.kernel.org/r/20211228054604.114518-3-hsiangkao@linux.alibaba.com Reviewed-by: Chao Yu Signed-off-by: Gao Xiang commit d67aee76d41861cda99b1ea13f8bf33fd06c5f20 Author: Gao Xiang Date: Tue Dec 28 13:46:00 2021 +0800 erofs: tidy up z_erofs_lz4_decompress To prepare for the upcoming ztailpacking feature and further cleanups, introduce a unique z_erofs_lz4_decompress_ctx to keep the context, including inpages, outpages and oend, which are frequently used by the lz4 decompressor. No logic changes. Link: https://lore.kernel.org/r/20211228054604.114518-2-hsiangkao@linux.alibaba.com Reviewed-by: Chao Yu Signed-off-by: Gao Xiang commit 11544d77e3974924c5a9c8a8320b996a3e9b2f8b Author: Zongmin Zhou Date: Wed Dec 15 17:23:37 2021 +0800 drm/amdgpu: fixup bad vram size on gmc v8 Some boards(like RX550) seem to have garbage in the upper 16 bits of the vram size register. Check for this and clamp the size properly. Fixes boards reporting bogus amounts of vram. after add this patch,the maximum GPU VRAM size is 64GB, otherwise only 64GB vram size will be used. Signed-off-by: Zongmin Zhou Signed-off-by: Alex Deucher commit 88eabcb8e6965b38331618f60567dfe92ad3c42c Author: Nicholas Kazlauskas Date: Fri Dec 17 14:18:59 2021 -0500 drm/amd/display: Fix USB4 null pointer dereference in update_psp_stream_config [Why] A porting error on a previous patch left the block of code that causes the crash from a NULL pointer dereference. More specifically, we try to access link_enc before it's assigned in the USB4 case in the following assignment: config.dio_output_idx = link_enc->transmitter - TRANSMITTER_UNIPHY_A; [How] That assignment occurs later depending on the ASIC version. It's only needed on DCN31 and only after link_enc is already assigned. Fixes: 986430446c917b ("drm/amd/display: fix a crash on USB4 over C20 PHY") Reviewed-by: Harry Wentland Signed-off-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher commit 4da8b63944a4f4482303c9ad6efb18aa547d4630 Author: sashank saye Date: Fri Dec 17 07:50:09 2021 -0500 drm/amdgpu: Send Message to SMU on aldebaran passthrough for sbr handling For Aldebaran chip passthrough case we need to intimate SMU about special handling for SBR.On older chips we send LightSBR to SMU, enabling the same for Aldebaran. Slight difference, compared to previous chips, is on Aldebaran, SMU would do a heavy reset on SBR. Hence, the word Heavy instead of Light SBR is used for SMU to differentiate. Reviewed by: Shaoyun.liu Signed-off-by: sashank saye Signed-off-by: Alex Deucher commit fbcdbfde87509d523132b59f661a355c731139d0 Author: Rajneesh Bhardwaj Date: Fri Nov 26 15:15:04 2021 -0500 drm/amdgpu: Don't inherit GEM object VMAs in child process When an application having open file access to a node forks, its shared mappings also get reflected in the address space of child process even though it cannot access them with the object permissions applied. With the existing permission checks on the gem objects, it might be reasonable to also create the VMAs with VM_DONTCOPY flag so a user space application doesn't need to explicitly call the madvise(addr, len, MADV_DONTFORK) system call to prevent the pages in the mapped range to appear in the address space of the child process. It also prevents the memory leaks due to additional reference counts on the mapped BOs in the child process that prevented freeing the memory in the parent for which we had worked around earlier in the user space inside the thunk library. Additionally, we faced this issue when using CRIU to checkpoint restore an application that had such inherited mappings in the child which confuse CRIU when it mmaps on restore. Having this flag set for the render node VMAs helps. VMAs mapped via KFD already take care of this so this is needed only for the render nodes. To limit the impact of the change to user space consumers such as OpenGL etc, limit it to KFD BOs only. Acked-by: Felix Kuehling Reviewed-by: Christian König Signed-off-by: David Yat Sin Signed-off-by: Rajneesh Bhardwaj Signed-off-by: Alex Deucher commit b6485bed40d7859735bdbfedbd55dcc8366a88a7 Author: Tao Zhou Date: Mon Dec 6 15:54:54 2021 +0800 drm/amdkfd: reset queue which consumes RAS poison (v2) CP supports unmap queue with reset mode which only destroys specific queue without affecting others. Replacing whole gpu reset with reset queue mode for RAS poison consumption saves much time, and we can also fallback to gpu reset solution if reset queue fails. v2: Return directly if process is NULL; Reset queue solution is not applicable to SDMA, fallback to legacy way; Call kfd_unref_process after lookup process. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Acked-by: Felix Kuehling Signed-off-by: Alex Deucher commit dec63443380cf2ce6bc41258159cda4165fa4279 Author: Tao Zhou Date: Thu Dec 16 14:34:10 2021 +0800 drm/amdkfd: add reset queue function for RAS poison (v2) The new interface unmaps queues with reset mode for the process consumes RAS poison, it's only for compute queue. v2: rename the function to reset_queues. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Acked-by: Felix Kuehling Signed-off-by: Alex Deucher commit f6b80c04aabb4fdd18ed8fcbaa5efef64e5d0b36 Author: Tao Zhou Date: Thu Dec 9 11:40:41 2021 +0800 drm/amdkfd: add reset parameter for unmap queues So we can set reset mode for unmap operation, no functional change. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Acked-by: Felix Kuehling Signed-off-by: Alex Deucher commit f4409ee84658ff95d92daace9f094fa6bf80b0e3 Author: Tao Zhou Date: Fri Dec 10 17:01:15 2021 +0800 drm/amdgpu: add gpu reset control for umc page retirement Add a reset parameter for umc page retirement, let user decide whether call gpu reset in umc page retirement. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Acked-by: Felix Kuehling Signed-off-by: Alex Deucher commit d764fb2af6cd92eee080978856f24b0cc6d555ad Author: Victor Skvortsov Date: Wed Dec 15 18:49:36 2021 +0000 drm/amdgpu: Modify indirect register access for gfx9 sriov Expand RLCG interface for new GC read & write commands. New interface will only be used if the PF enables the flag in pf2vf msg. v2: Added a description for the scratch registers Signed-off-by: Victor Skvortsov Reviewed-by: David Nieto Signed-off-by: Alex Deucher commit 4a0165f0603f333c6b36a420b4e348b67ddf6fc8 Author: Victor Skvortsov Date: Wed Dec 15 18:42:44 2021 +0000 drm/amdgpu: get xgmi info before ip_init Driver needs to call get_xgmi_info() before ip_init to determine whether it needs to handle a pending hive reset. Signed-off-by: Victor Skvortsov Reviewed-by: David Nieto Reviewed by: shaoyun.liu Signed-off-by: Alex Deucher commit 4aa325ae541378166b3a84186bc1157a1d524f8b Author: Victor Skvortsov Date: Mon Dec 13 22:43:06 2021 +0000 drm/amdgpu: Modify indirect register access for amdkfd_gfx_v9 sriov Modify GC register access from MMIO to RLCG if the indirect flag is set Signed-off-by: Victor Skvortsov Reviewed-by: David Nieto Signed-off-by: Alex Deucher commit 92f153bb5a4bff4df8c67dcec5a9de1dde3b300b Author: Victor Skvortsov Date: Mon Dec 13 22:40:09 2021 +0000 drm/amdgpu: Modify indirect register access for gmc_v9_0 sriov Modify GC register access from MMIO to RLCG if the indirect flag is set v2: Replaced ternary operator with if-else for better readability Signed-off-by: Victor Skvortsov Reviewed-by: David Nieto Signed-off-by: Alex Deucher commit 0da6f6e5872e8c1e794bc3a705ea27a156b6a8e4 Author: Victor Skvortsov Date: Mon Dec 13 22:35:10 2021 +0000 drm/amdgpu: Add *_SOC15_IP_NO_KIQ() macro definitions Add helper macros to change register access from direct to indirect. Signed-off-by: Victor Skvortsov Reviewed-by: David Nieto Signed-off-by: Alex Deucher commit b18ff6925d84492d845debe2dbb81122b1d141fa Author: Bokun Zhang Date: Thu Dec 16 15:09:41 2021 -0500 drm/amdgpu: Filter security violation registers Recently, there is security policy update under SRIOV. We need to filter the registers that hit the violation and move the code to the host driver side so that the guest driver can execute correctly. Signed-off-by: Bokun Zhang Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 0be4838f018c10d7f138a213c006d345db35ef5b Author: Colin Ian King Date: Tue Dec 7 18:50:01 2021 +0000 x86/events/amd/iommu: Remove redundant assignment to variable shift Variable shift is being initialized with a value that is never read, it is being re-assigned later inside a loop. The assignment is redundant and can be removed. Signed-off-by: Colin Ian King Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20211207185001.1412413-1-colin.i.king@gmail.com commit 728fcc46d2c2292d1ac73f3491b8f4332066fdad Author: Ricardo Koller Date: Mon Nov 8 18:39:06 2021 -0800 KVM: selftests: aarch64: Add test for restoring active IRQs Add a test that restores multiple IRQs in active state, it does it by writing into ISACTIVER from the guest and using KVM ioctls. This test tries to emulate what would happen during a live migration: restore active IRQs. Signed-off-by: Ricardo Koller Acked-by: Andrew Jones Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211109023906.1091208-18-ricarkol@google.com commit bebd8f3f869361e0249efe423ba76a0d991ce3e6 Author: Ricardo Koller Date: Mon Nov 8 18:39:05 2021 -0800 KVM: selftests: aarch64: Add ISPENDR write tests in vgic_irq Add injection tests that use writing into the ISPENDR register (to mark IRQs as pending). This is typically used by migration code. Signed-off-by: Ricardo Koller Acked-by: Andrew Jones Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211109023906.1091208-17-ricarkol@google.com commit 6a5a47188caca7be4bbe28cdb31d5df09868ed5c Author: Ricardo Koller Date: Mon Nov 8 18:39:04 2021 -0800 KVM: selftests: aarch64: Add tests for IRQFD in vgic_irq Add injection tests for the KVM_IRQFD ioctl into vgic_irq. Signed-off-by: Ricardo Koller Acked-by: Andrew Jones Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211109023906.1091208-16-ricarkol@google.com commit 88209c104e9b3e95502c0e924fb1cd8bd5a01d82 Author: Ricardo Koller Date: Mon Nov 8 18:39:03 2021 -0800 KVM: selftests: Add IRQ GSI routing library functions Add an architecture independent wrapper function for creating and writing IRQ GSI routing tables. Also add a function to add irqchip entries. Signed-off-by: Ricardo Koller Acked-by: Andrew Jones Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211109023906.1091208-15-ricarkol@google.com commit 90f50acac9ee9f81192098c22b2cbf2491a40263 Author: Ricardo Koller Date: Mon Nov 8 18:39:02 2021 -0800 KVM: selftests: aarch64: Add test_inject_fail to vgic_irq Add tests for failed injections to vgic_irq. This tests that KVM can handle bogus IRQ numbers. Signed-off-by: Ricardo Koller Acked-by: Andrew Jones Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211109023906.1091208-14-ricarkol@google.com commit 6830fa915912587a7aa304bade01b366cf0b9214 Author: Ricardo Koller Date: Mon Nov 8 18:39:01 2021 -0800 KVM: selftests: aarch64: Add tests for LEVEL_INFO in vgic_irq Add injection tests for the LEVEL_INFO ioctl (level-sensitive specific) into vgic_irq. Signed-off-by: Ricardo Koller Acked-by: Andrew Jones Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211109023906.1091208-13-ricarkol@google.com commit 92f2cc4aa7964d4d13681eeb38582bb989b01b98 Author: Ricardo Koller Date: Mon Nov 8 18:39:00 2021 -0800 KVM: selftests: aarch64: Level-sensitive interrupts tests in vgic_irq Add a cmdline arg for using level-sensitive interrupts (vs the default edge-triggered). Then move the handler into a generic handler function that takes the type of interrupt (level vs. edge) as an arg. When handling line-sensitive interrupts it sets the line to low after acknowledging the IRQ. Signed-off-by: Ricardo Koller Acked-by: Andrew Jones Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211109023906.1091208-12-ricarkol@google.com commit 0ad3ff4a6adc4922808ef8b2f91880c25195f509 Author: Ricardo Koller Date: Mon Nov 8 18:38:59 2021 -0800 KVM: selftests: aarch64: Add preemption tests in vgic_irq Add tests for IRQ preemption (having more than one activated IRQ at the same time). This test injects multiple concurrent IRQs and handles them without handling the actual exceptions. This is done by masking interrupts for the whole test. Signed-off-by: Ricardo Koller Acked-by: Andrew Jones Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211109023906.1091208-11-ricarkol@google.com commit 8a35b2877d9a15fa885cea744f1e578e035856fe Author: Ricardo Koller Date: Mon Nov 8 18:38:58 2021 -0800 KVM: selftests: aarch64: Cmdline arg to set EOI mode in vgic_irq Add a new cmdline arg to set the EOI mode for all vgic_irq tests. This specifies whether a write to EOIR will deactivate IRQs or not. Signed-off-by: Ricardo Koller Acked-by: Andrew Jones Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211109023906.1091208-10-ricarkol@google.com commit e5410ee2806d74a749fa39ca6fdb73be2f88611f Author: Ricardo Koller Date: Mon Nov 8 18:38:57 2021 -0800 KVM: selftests: aarch64: Cmdline arg to set number of IRQs in vgic_irq test Add the ability to specify the number of vIRQs exposed by KVM (arg defaults to 64). Then extend the KVM_IRQ_LINE test by injecting all available SPIs at once (specified by the nr-irqs arg). As a bonus, inject all SGIs at once as well. Signed-off-by: Ricardo Koller Acked-by: Andrew Jones Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211109023906.1091208-9-ricarkol@google.com commit e1cb399eed1eda29568b17bdb75d16cee1fc3da4 Author: Ricardo Koller Date: Mon Nov 8 18:38:56 2021 -0800 KVM: selftests: aarch64: Abstract the injection functions in vgic_irq Build an abstraction around the injection functions, so the preparation and checking around the actual injection can be shared between tests. All functions are stored as pointers in arrays of kvm_inject_desc's which include the pointer and what kind of interrupts they can inject. Signed-off-by: Ricardo Koller Acked-by: Andrew Jones Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211109023906.1091208-8-ricarkol@google.com commit 50b020cdb7f72077e16133f1d88c9359cf415a53 Author: Ricardo Koller Date: Mon Nov 8 18:38:55 2021 -0800 KVM: selftests: aarch64: Add vgic_irq to test userspace IRQ injection Add a new KVM selftest, vgic_irq, for testing userspace IRQ injection. This particular test injects an SPI using KVM_IRQ_LINE on GICv3 and verifies that the IRQ is handled in the guest. The next commits will add more types of IRQs and different modes. Signed-off-by: Ricardo Koller Acked-by: Andrew Jones Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211109023906.1091208-7-ricarkol@google.com commit e95def3a904dea467309bbe382a9032d301ba9cd Author: Ricardo Koller Date: Mon Nov 8 18:38:54 2021 -0800 KVM: selftests: aarch64: Add vGIC library functions to deal with vIRQ state Add a set of library functions for userspace code in selftests to deal with vIRQ state (i.e., ioctl wrappers). Signed-off-by: Ricardo Koller Acked-by: Andrew Jones Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211109023906.1091208-6-ricarkol@google.com commit 227895ed6d03b46fa619614a41a3b8e1074d6151 Author: Ricardo Koller Date: Mon Nov 8 18:38:53 2021 -0800 KVM: selftests: Add kvm_irq_line library function Add an architecture independent wrapper function for the KVM_IRQ_LINE ioctl. Signed-off-by: Ricardo Koller Acked-by: Andrew Jones Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211109023906.1091208-5-ricarkol@google.com commit 17ce617bf76a7c1d3b553ed01607706434b9ed59 Author: Ricardo Koller Date: Mon Nov 8 18:38:52 2021 -0800 KVM: selftests: aarch64: Add GICv3 register accessor library functions Add library functions for accessing GICv3 registers: DIR, PMR, CTLR, ISACTIVER, ISPENDR. Signed-off-by: Ricardo Koller Acked-by: Andrew Jones Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211109023906.1091208-4-ricarkol@google.com commit 745068367ccbf33d69cf4acf7b1a3d5478978e8e Author: Ricardo Koller Date: Mon Nov 8 18:38:51 2021 -0800 KVM: selftests: aarch64: Add function for accessing GICv3 dist and redist registers Add a generic library function for reading and writing GICv3 distributor and redistributor registers. Then adapt some functions to use it; more will come and use it in the next commit. Signed-off-by: Ricardo Koller Acked-by: Andrew Jones Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211109023906.1091208-3-ricarkol@google.com commit 33a1ca736e74839d08948973d30f6def820b8b14 Author: Ricardo Koller Date: Mon Nov 8 18:38:50 2021 -0800 KVM: selftests: aarch64: Move gic_v3.h to shared headers Move gic_v3.h to the shared headers location. There are some definitions that will be used in the vgic-irq test. Signed-off-by: Ricardo Koller Acked-by: Andrew Jones Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211109023906.1091208-2-ricarkol@google.com commit 38ac2f038666521f94d4fa37b5a9441cef832ccf Author: Tom Rix Date: Fri Dec 24 07:08:33 2021 -0800 iio: chemical: sunrise_co2: set val parameter only on success Clang static analysis reports this representative warning sunrise_co2.c:410:9: warning: Assigned value is garbage or undefined *val = value; ^ ~~~~~ The ealier call to sunrise_read_word can fail without setting value. So defer setting val until we know the read was successful. Fixes: c397894e24f1 ("iio: chemical: Add Senseair Sunrise 006-0-007 driver") Signed-off-by: Tom Rix Link: https://lore.kernel.org/r/20211224150833.3278236-1-trix@redhat.com Signed-off-by: Jonathan Cameron commit 17f18417d6da07bbaafce84f80fa25d860b6e6d1 Author: Greg Kroah-Hartman Date: Tue Dec 28 14:14:23 2021 +0100 ACPI: sysfs: use default_groups in kobj_type There are currently 2 ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the ACPI sysfs code to use default_groups field which has been the preferred way since aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field. Signed-off-by: Greg Kroah-Hartman Signed-off-by: Rafael J. Wysocki commit fe262d5c1fc54fac8703d3d82a14aaad9627a168 Author: Greg Kroah-Hartman Date: Tue Dec 28 14:19:12 2021 +0100 cpufreq: use default_groups in kobj_type There are currently 2 ways to create a set of sysfs files for a kobj_type, through the default_attrs field, and the default_groups field. Move the cpufreq code to use default_groups field which has been the preferred way since aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type") so that we can soon get rid of the obsolete default_attrs field. Signed-off-by: Greg Kroah-Hartman Signed-off-by: Rafael J. Wysocki commit cc8e9ba71a8626bd322d1945a8fc0c8a52131a63 Author: Pavel Begunkov Date: Wed Dec 15 22:08:50 2021 +0000 io_uring: use completion batching for poll rem/upd Use __io_req_complete() in io_poll_update(), so we can utilise completion batching for both update/remove request and the poll we're killing (if any). Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/e2bdc6c5abd9e9b80f09b86d8823eb1c780362cd.1639605189.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit eb0089d629ba413ebf820733ad11b4b2bed45514 Author: Pavel Begunkov Date: Wed Dec 15 22:08:49 2021 +0000 io_uring: single shot poll removal optimisation We don't need to poll oneshot request if we've got a desired mask in io_poll_wake(), task_work will clean it up correctly, but as we already hold a wq spinlock, we can remove ourselves and save on additional spinlocking in io_poll_remove_entries(). Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/ee170a344a18c9ef36b554d806c64caadfd61c31.1639605189.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit aa43477b040251f451db0d844073ac00a8ab66ee Author: Pavel Begunkov Date: Wed Dec 15 22:08:48 2021 +0000 io_uring: poll rework It's not possible to go forward with the current state of io_uring polling, we need a more straightforward and easier synchronisation. There are a lot of problems with how it is at the moment, including missing events on rewait. The main idea here is to introduce a notion of request ownership while polling, no one but the owner can modify any part but ->poll_refs of struct io_kiocb, that grants us protection against all sorts of races. Main users of such exclusivity are poll task_work handler, so before queueing a tw one should have/acquire ownership, which will be handed off to the tw handler. The other user is __io_arm_poll_handler() do initial poll arming. It starts taking the ownership, so tw handlers won't be run until it's released later in the function after vfs_poll. note: also prevents races in __io_queue_proc(). Poll wake/etc. may not be able to get ownership, then they need to increase the poll refcount and the task_work should notice it and retry if necessary, see io_poll_check_events(). There is also IO_POLL_CANCEL_FLAG flag to notify that we want to kill request. It makes cancellations more reliable, enables double multishot polling, fixes double poll rewait, fixes missing poll events and fixes another bunch of races. Even though it adds some overhead for new refcounting, and there are a couple of nice performance wins: - no req->refs refcounting for poll requests anymore - if the data is already there (once measured for some test to be 1-2% of all apoll requests), it removes it doesn't add atomics and removes spin_lock/unlock pair. - works well with multishots, we don't do remove from queue / add to queue for each new poll event. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/6b652927c77ed9580ea4330ac5612f0e0848c946.1639605189.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit ab1dab960b8352cee082db0f8a54dc92a948bfd7 Author: Pavel Begunkov Date: Wed Dec 15 22:08:47 2021 +0000 io_uring: kill poll linking optimisation With IORING_FEAT_FAST_POLL in place, io_put_req_find_next() for poll requests doesn't make much sense, and in any case re-adding it shouldn't be a problem considering batching in tctx_task_work(). We can remove it. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/15699682bf81610ec901d4e79d6da64baa9f70be.1639605189.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 5641897a5e8fb8abeb07e89c71a788d3db3ec75e Author: Pavel Begunkov Date: Wed Dec 15 22:08:46 2021 +0000 io_uring: move common poll bits Move some poll helpers/etc up, we'll need them there shortly Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/6c5c3dba24c86aad5cd389a54a8c7412e6a0621d.1639605189.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 2bbb146d96f4b45e17d6aeede300796bc1a96d68 Author: Pavel Begunkov Date: Wed Dec 15 22:08:45 2021 +0000 io_uring: refactor poll update Clean up io_poll_update() and unify cancellation paths for remove and update. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/5937138b6265a1285220e2fab1b28132c1d73ce3.1639605189.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit e840b4baf3cfb37e2ead4f649a45bb78178677ff Author: Pavel Begunkov Date: Wed Dec 15 22:08:44 2021 +0000 io_uring: remove double poll on poll update Before updating a poll request we should remove it from poll queues, including the double poll entry. Fixes: b69de288e913 ("io_uring: allow events and user_data update of running poll requests") Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/ac39e7f80152613603b8a6cc29a2b6063ac2434f.1639605189.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit c15500198916cb6f553b43f63070990b8d079b49 Author: Alexander Lobakin Date: Tue Nov 23 18:18:40 2021 +0100 ixgbevf: switch to napi_build_skb() napi_build_skb() reuses per-cpu NAPI skbuff_head cache in order to save some cycles on freeing/allocating skbuff_heads on every new Rx or completed Tx. ixgbevf driver runs Tx completion polling cycle right before the Rx one and uses napi_consume_skb() to feed the cache with skbuff_heads of completed entries, so it's never empty and always warm at that moment. Switch to the napi_build_skb() to relax mm pressure on heavy Rx. Signed-off-by: Alexander Lobakin Reviewed-by: Michal Swiatkowski Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit a39363367a377ceda6b58ec15edf07fae1d61b1b Author: Alexander Lobakin Date: Tue Nov 23 18:18:39 2021 +0100 ixgbe: switch to napi_build_skb() napi_build_skb() reuses per-cpu NAPI skbuff_head cache in order to save some cycles on freeing/allocating skbuff_heads on every new Rx or completed Tx. ixgbe driver runs Tx completion polling cycle right before the Rx one and uses napi_consume_skb() to feed the cache with skbuff_heads of completed entries, so it's never empty and always warm at that moment. Switch to the napi_build_skb() to relax mm pressure on heavy Rx. Signed-off-by: Alexander Lobakin Reviewed-by: Michal Swiatkowski Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit 4dd330a7e8944ee4e3409d4c99c03f247def9c3b Author: Alexander Lobakin Date: Tue Nov 23 18:18:38 2021 +0100 igc: switch to napi_build_skb() napi_build_skb() reuses per-cpu NAPI skbuff_head cache in order to save some cycles on freeing/allocating skbuff_heads on every new Rx or completed Tx. igc driver runs Tx completion polling cycle right before the Rx one and uses napi_consume_skb() to feed the cache with skbuff_heads of completed entries, so it's never empty and always warm at that moment. Switch to the napi_build_skb() to relax mm pressure on heavy Rx. Signed-off-by: Alexander Lobakin Reviewed-by: Michal Swiatkowski Tested-by: Nechama Kraus Signed-off-by: Tony Nguyen commit fa441f0fa8bc4d8231734aa8512d55dfb74fb598 Author: Alexander Lobakin Date: Tue Nov 23 18:18:37 2021 +0100 igb: switch to napi_build_skb() napi_build_skb() reuses per-cpu NAPI skbuff_head cache in order to save some cycles on freeing/allocating skbuff_heads on every new Rx or completed Tx. igb driver runs Tx completion polling cycle right before the Rx one and uses napi_consume_skb() to feed the cache with skbuff_heads of completed entries, so it's never empty and always warm at that moment. Switch to the napi_build_skb() to relax mm pressure on heavy Rx. Signed-off-by: Alexander Lobakin Reviewed-by: Michal Swiatkowski Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit 5ce666315848a4cb44485d8cd2c5887998da6606 Author: Alexander Lobakin Date: Tue Nov 23 18:18:36 2021 +0100 ice: switch to napi_build_skb() napi_build_skb() reuses per-cpu NAPI skbuff_head cache in order to save some cycles on freeing/allocating skbuff_heads on every new Rx or completed Tx. ice driver runs Tx completion polling cycle right before the Rx one and uses napi_consume_skb() to feed the cache with skbuff_heads of completed entries, so it's never empty and always warm at that moment. Switch to the napi_build_skb() to relax mm pressure on heavy Rx. Signed-off-by: Alexander Lobakin Reviewed-by: Michal Swiatkowski Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit ef687d61e0e999575c8d781e1edd04b4a388440f Author: Alexander Lobakin Date: Tue Nov 23 18:18:35 2021 +0100 iavf: switch to napi_build_skb() napi_build_skb() reuses per-cpu NAPI skbuff_head cache in order to save some cycles on freeing/allocating skbuff_heads on every new Rx or completed Tx. iavf driver runs Tx completion polling cycle right before the Rx one and uses napi_consume_skb() to feed the cache with skbuff_heads of completed entries, so it's never empty and always warm at that moment. Switch to the napi_build_skb() to relax mm pressure on heavy Rx. Signed-off-by: Alexander Lobakin Reviewed-by: Michal Swiatkowski Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit 6e19cf7d3815c009bfd213832a6feac4bafc37ae Author: Alexander Lobakin Date: Tue Nov 23 18:18:34 2021 +0100 i40e: switch to napi_build_skb() napi_build_skb() reuses per-cpu NAPI skbuff_head cache in order to save some cycles on freeing/allocating skbuff_heads on every new Rx or completed Tx. i40e driver runs Tx completion polling cycle right before the Rx one and uses napi_consume_skb() to feed the cache with skbuff_heads of completed entries, so it's never empty and always warm at that moment. Switch to the napi_build_skb() to relax mm pressure on heavy Rx. Signed-off-by: Alexander Lobakin Reviewed-by: Michal Swiatkowski Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit 89a354c03b2d097f9d580cc48249ca396d027e68 Author: Alexander Lobakin Date: Tue Nov 23 18:18:33 2021 +0100 e1000: switch to napi_build_skb() napi_build_skb() reuses per-cpu NAPI skbuff_head cache in order to save some cycles on freeing/allocating skbuff_heads on every new Rx or completed Tx element. e1000 driver runs Tx completion polling cycle right before the Rx one. Now that e1000 uses napi_consume_skb() to put skbuff_heads of completed entries into the cache, it will never empty and always warm at that moment. Switch to the napi_build_skb() to relax mm pressure on heavy Rx and increase throughput. Signed-off-by: Alexander Lobakin Reviewed-by: Michal Swiatkowski Tested-by: Tony Brelinski Signed-off-by: Tony Nguyen commit dcb95f06eab84bb3283273a63af8f930bf27c9d7 Author: Alexander Lobakin Date: Tue Nov 23 18:18:32 2021 +0100 e1000: switch to napi_consume_skb() In order to take the best from per-cpu NAPI skbuff_head caches and CPU cycles, let's switch from dev_kfree_skb_any(), which passes skb back to the mm layer, to napi_consume_skb(), which feeds those caches on non-zero budget instead (falls back to the former on 0). Do the replacement in e1000_unmap_and_free_tx_resource(). There are 4 call sites of this function throughout the driver: * e1000_clean_tx_ring(). Slowpath, process context, cleans the whole Tx ring on ifdown. Use budget of 0 here; * e1000_tx_map(). Hotpath, net Tx softirq, unmaps the buffers in case of error. Use 0 as well; * e1000_clean_tx_irq(). Hotpath, NAPI Tx completion polling cycle. As the driver doesn't count completed Tx entries towards the NAPI budget, just use the poll budget of 64 to utilize caches. Apart from being a preparation for switching to napi_build_skb(), this is useful on its own as well, as napi_consume_skb() flushes skb caches by batches of 32 instead of one-at-a-time. Signed-off-by: Alexander Lobakin Reviewed-by: Michal Swiatkowski Tested-by: Tony Brelinski Signed-off-by: Tony Nguyen commit 356f3f2c5756bbb67a515760966a40fc7043cdda Author: Krzysztof Kozlowski Date: Mon Dec 27 14:35:48 2021 +0100 dt-bindings: mmc: synopsys-dw-mshc: integrate Altera and Imagination The bindings for Altera and Imagination extensions are the same as for the original Synopsys Designware Mobile Storage Host Controller. Integrate them into Synopsys bindings to have dtschema coverage. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20211227133558.135185-3-krzysztof.kozlowski@canonical.com Signed-off-by: Ulf Hansson commit 28df143340b5acb7003aa8a83d0910c112be0504 Author: Christophe JAILLET Date: Sun Dec 26 15:15:36 2021 +0100 mmc: pwrseq: Use bitmap_free() to free bitmap kfree() and bitmap_free() are the same. But using the later is more consistent when freeing memory allocated with bitmap_alloc(). Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/07a8e48db446888bd77f16b88568e80904f52103.1640528089.git.christophe.jaillet@wanadoo.fr Signed-off-by: Ulf Hansson commit 33a48bd897de79a6ca5aa3f3350a323ed83b8a38 Author: David Heidelberg Date: Fri Dec 24 20:25:45 2021 +0100 dt-bindings: mmc: PL18x stop relying on order of dma-names We don't care in which order are "rx" and "tx" DMA names supplied. Fixes: 4df297aaeb9c ("dt-bindings: mmc: Add missing properties used in examples") Signed-off-by: David Heidelberg Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20211224192545.74528-1-david@ixit.cz Signed-off-by: Ulf Hansson commit 5733c41d5c18c3e49b9e9d467591d42d014335ca Author: Petr Vorel Date: Thu Dec 23 23:55:24 2021 +0100 dt-bindings: mmc: sdhci-msm: Add compatible string for msm8994 Add msm8994 SoC specific compatible strings for qcom-sdhci controller. Signed-off-by: Petr Vorel Link: https://lore.kernel.org/r/20211223225524.9860-1-pvorel@suse.cz Signed-off-by: Ulf Hansson commit a1ab47ac99dc66eadc36a5d48842e69b5429eb44 Author: Sergey Shtylyov Date: Thu Dec 23 21:45:21 2021 +0300 mmc: au1xmmc: propagate errors from platform_get_irq() The driver overrides the error codes returned by platform_get_irq() to -ENODEV. Switch to propagating the error codes upstream. Signed-off-by: Sergey Shtylyov Tested-by: Manuel Lauss commit a7c18e5cbb23ec467fb0671ee72ee7790b37335e Author: Fred Ai Date: Wed Dec 15 22:08:24 2021 -0800 mmc: sdhci-pci-o2micro: Restore the SD clock's base clock frequency Drop the SD clock's base clock for an SDR104 card, as frequency is wrong when inserting and SD2.0/SDR50 card. Signed-off-by: Fred Ai Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/20211216060824.357-2-fred.ai@bayhubtech.com Signed-off-by: Ulf Hansson commit 4be33cf187036744b4ed84824e7157cfc09c6f4c Author: Fred Ai Date: Mon Dec 20 20:09:40 2021 -0800 mmc: sdhci-pci-o2micro: Improve card input timing at SDR104/HS200 mode Card input timing is margin, need to adjust the hold timing of card input. Signed-off-by: Fred Ai Link: https://lore.kernel.org/r/20211221040940.484-1-fred.ai@bayhubtech.com Signed-off-by: Ulf Hansson commit e5e8b2246f672224e93bca5a1414934addab41a7 Author: AngeloGioacchino Del Regno Date: Thu Dec 16 13:57:48 2021 +0100 mmc: mtk-sd: Assign src_clk parent to src_clk_cg for legacy DTs In commit 3c1a88443698 ("mmc: mediatek: add support of source_cg clock") an independent cg was introduced to avoid a hardware hang issue during clock mode switches (subsequent commits will set that clock as optional). When this clock is not present in device-tree, any operation is being done on src_clk's parent (calling clk_get_parent()): to simplify this and avoid checking for src_clk_cg presence everytime, just assign the parent clock to src_clk_cg and remove the now useless checks. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20211216125748.179602-5-angelogioacchino.delregno@collabora.com Signed-off-by: Ulf Hansson commit 996be7b75e8d4c44851f8a50bf7f896e32af8812 Author: AngeloGioacchino Del Regno Date: Thu Dec 16 13:57:47 2021 +0100 mmc: mtk-sd: Fix usage of devm_clk_get_optional() If we get an error during probe of an optional clock with function devm_clk_get_optional(), this means that the clock was provided, but an error occurred: this has to be escalated to the probe function for the driver probe to fail accordingly, or unexpected hardware behavior may happen. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20211216125748.179602-4-angelogioacchino.delregno@collabora.com Signed-off-by: Ulf Hansson commit 83b27217158876f903fa9c91e326db00ecc57396 Author: AngeloGioacchino Del Regno Date: Thu Dec 16 13:57:46 2021 +0100 mmc: mtk-sd: Take action for no-sdio device-tree parameter This driver was unconditionally enabling support for SDIO mode, but we do have a generic "no-sdio" DT parameter that sets caps2 MMC_CAP2_NO_SDIO. Modify the HW initialization sequence to enable SDIO support only if it hasn't been explicitly disabled in device-tree. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20211216125748.179602-3-angelogioacchino.delregno@collabora.com Signed-off-by: Ulf Hansson commit 4fe54318496004593b2072a724ce26f7abc29778 Author: AngeloGioacchino Del Regno Date: Thu Dec 16 13:57:45 2021 +0100 mmc: mtk-sd: Use BIT() and GENMASK() macros to describe fields Register fields are currently represented with open-coded bit shifting: replace all occurrences of that to make use of kernel provided macros BIT and GENMASK to increase human readability. This patch provides no functional change. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20211216125748.179602-2-angelogioacchino.delregno@collabora.com Signed-off-by: Ulf Hansson commit ffaea6ebfe9ce06ebb3a54811a47688f2b0893cd Author: AngeloGioacchino Del Regno Date: Thu Dec 16 13:57:44 2021 +0100 mmc: mtk-sd: Use readl_poll_timeout instead of open-coded polling Replace all instances of open-coded while loops for polling registers with calls to readl_poll_timeout() and, while at it, also fix some possible infinite loop instances. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20211216125748.179602-1-angelogioacchino.delregno@collabora.com Signed-off-by: Ulf Hansson commit 20a77667bbd7c28ec4f76c3c811dc22c65b4bee6 Author: Michael Straube Date: Tue Dec 28 11:11:20 2021 +0100 staging: r8188eu: merge _ReadLEDSetting() into ReadAdapterInfo8188EU() Function _ReadLEDSetting() sets only a single variable and the only user is ReadAdapterInfo8188EU(). Remove _ReadLEDSetting() and set the variable in ReadAdapterInfo8188EU() directly. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211228101120.9120-11-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6a3631bdacb10fcbddb8df3cab44d344d355f732 Author: Michael Straube Date: Tue Dec 28 11:11:19 2021 +0100 staging: r8188eu: RSSI_test is always false The field RSSI_test of struct odm_dm_struct is never set. It stays at the default value 0. Remove it and remove a related if test that is always true. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211228101120.9120-10-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit f4b1b1f3336a96b822f14c5da428e57b85a4c6ab Author: Michael Straube Date: Tue Dec 28 11:11:18 2021 +0100 staging: r8188eu: TrainIdx is set but never used The field TrainIdx of struct fast_ant_train is set but never used. Remove it. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211228101120.9120-9-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6afdd3ca9c3bb60e1613e65bda506a3338dee038 Author: Michael Straube Date: Tue Dec 28 11:11:17 2021 +0100 staging: r8188eu: FAT_State is set but never used The field FAT_State of struct fast_ant_train is set but never used. Remove it. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211228101120.9120-8-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit a4a44a1c15adc919e19c86d56d518dab80ced77f Author: Michael Straube Date: Tue Dec 28 11:11:16 2021 +0100 staging: r8188eu: FAT_State is always FAT_NORMAL_STATE In this driver pDM_FatTable->FAT_State is always FAT_NORMAL_STATE. So the check 'if (pDM_FatTable->FAT_State == FAT_TRAINING_STATE)' is always false. Remove dead code that is executed only if that check is true. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211228101120.9120-7-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 9e357d4c8f789c6f36e9c606cc813f1899465b67 Author: Michael Straube Date: Tue Dec 28 11:11:15 2021 +0100 staging: r8188eu: remove write-only fields from struct rtl_ps The fields pre_cca_state, cur_cca_state and rssi_val_min of struct rtl_ps are set but never used. Remove them. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211228101120.9120-6-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit f795060dd42dcfb64ebbb5b9b9cb41982060441b Author: Michael Straube Date: Tue Dec 28 11:11:14 2021 +0100 staging: r8188eu: remove ODM_CMNINFO_ABILITY from ODM_CmnInfoInit() ODM_CmnInfoInit() is never called with ODM_CMNINFO_ABILITY. Remove that unused case from ODM_CmnInfoInit(). Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211228101120.9120-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit b01b5c10218e6a635ebdee42d84b4daea5611311 Author: Michael Straube Date: Tue Dec 28 11:11:13 2021 +0100 staging: r8188eu: remove unused enum odm_h2c_cmd The enum odm_h2c_cmd is not used in this driver. Remove it. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211228101120.9120-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 786880da775d193b190977c810d2f3cd7da7ac4e Author: Michael Straube Date: Tue Dec 28 11:11:12 2021 +0100 staging: r8188eu: remove GET_CVID_ROM_VERSION The macro GET_CVID_ROM_VERSION is not used. Remove it. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211228101120.9120-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit d1315cb9f3edf788cfd600c1d092e47400b2b632 Author: Michael Straube Date: Tue Dec 28 11:11:11 2021 +0100 staging: r8188eu: DM_PriCCA is set but never used The field DM_PriCCA of struct odm_dm_struct is set but never used. Remove it and remove related dead code. Acked-by: Martin Kaiser Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211228101120.9120-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 944a1e54b8719f1837bcc8b23e333e6b54bbcc3d Author: Martin Kaiser Date: Sun Dec 26 22:25:35 2021 +0100 staging: r8188eu: remove unused prototype Remove the prototype for wifirate2_ratetbl_inx, it is not needed. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211226212535.197989-11-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 752925690005a723e57259e7f628fec93c298666 Author: Martin Kaiser Date: Sun Dec 26 22:25:34 2021 +0100 staging: r8188eu: remove the private "test" ioctl Remove the private "test" ioctl. It copies data from user space, this data is not used. We can now remove a number of NULL entries at the end of the private ioctl list. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211226212535.197989-10-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 649071f78ab2fc61e65bdced2c615876c23c7375 Author: Martin Kaiser Date: Sun Dec 26 22:25:33 2021 +0100 staging: r8188eu: remove the private ioctl "tdls" Remove the private ioctl "tdls", it is mapped to an empty function. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211226212535.197989-9-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 08ea4a2c62b660eac3c6cd747bfdaabae2c29cac Author: Martin Kaiser Date: Sun Dec 26 22:25:32 2021 +0100 staging: r8188eu: remove the private ioctl "tdls_get" Remove the private ioctl "tdls_get", it is mapped to an empty function. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211226212535.197989-8-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit e269f7acdc53623769da31135f60afeb3a65eaff Author: Martin Kaiser Date: Sun Dec 26 22:25:31 2021 +0100 staging: r8188eu: remove the private ioctl "wps_assoc_req_ie" Remove the private ioctl "wps_assoc_req_ie", it is mapped to an empty function. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211226212535.197989-7-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit ec970aa39eabccaec9e3a856a67ab8889c641d9c Author: Martin Kaiser Date: Sun Dec 26 22:25:30 2021 +0100 staging: r8188eu: remove private ioctls that return -1 Remove the private ioctls that are mapped to rtw_wx_priv_null. rtw_wx_priv_null itself can also be removed. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211226212535.197989-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit a40f670989b2bbfd50d696956ff365718f12d583 Author: Martin Kaiser Date: Sun Dec 26 22:25:29 2021 +0100 staging: r8188eu: remove the private ioctl "wps_prob_req_ie" Remove the private ioctl "wps_prob_req_ie", it is mapped to an empty function. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211226212535.197989-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit d8c92147bda2b2294f79fbb35b4d1982c1a9e2f7 Author: Martin Kaiser Date: Sun Dec 26 22:25:28 2021 +0100 staging: r8188eu: remove the private drvext_hdl ioctl Remove the private drvext_hdl ioctl, it is mapped to an empty function. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211226212535.197989-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit c757fa413a147e691363355d5c0ef9c2fd9b2547 Author: Martin Kaiser Date: Sun Dec 26 22:25:27 2021 +0100 staging: r8188eu: remove the private ioctl "get sensitivity" Remove the private ioctl "get sensitivity", it is mapped to an empty function. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211226212535.197989-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 3618e07e88ee56034d94ec6aca66cbaab058929e Author: Martin Kaiser Date: Sun Dec 26 22:25:26 2021 +0100 staging: r8188eu: remove unused rtw_private_args entries Remove the entries of the rtw_private_args array that refer to non-existing private ioctls. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211226212535.197989-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit b0d60d3dc3d3ac9a9cf2ebde5fdacbaefa2fd2c5 Author: Martin Kaiser Date: Sun Dec 26 20:55:56 2021 +0100 staging: r8188eu: rfoff_reason is never initialised rfoff_reason in struct pwrctrl_priv is never set, its value remains 0. Remove rfoff_reason, related defines and a check in rtw_led_control that is always false. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211226195556.159471-22-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 2cca8b85ed7f1a1b5bab443c2757ac72380aabfb Author: Martin Kaiser Date: Sun Dec 26 20:55:55 2021 +0100 staging: r8188eu: merge rtw_led_control and SwLedControlMode1 rtw_led_control is the only caller of SwLedControlMode1. Pull SwLedControlMode1 into rtw_led_control. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211226195556.159471-21-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 334a7f00a5b36c6f06b475983170ad3b508f8d7d Author: Martin Kaiser Date: Sun Dec 26 20:55:54 2021 +0100 staging: r8188eu: merge blink_work and SwLedBlink1 blink_work is the only caller of SwLedBlink1. Merge the two functions. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211226195556.159471-20-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit e8b0b484f498815ec75c6651b15bf3e3638af936 Author: Martin Kaiser Date: Sun Dec 26 20:55:53 2021 +0100 staging: r8188eu: summarize some BlinkingLedState Move BlinkingLedState updates out of if clauses where the same update is done for all possible paths. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211226195556.159471-19-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit f7b8dc039995961848f9d63ad2821815529883db Author: Martin Kaiser Date: Sun Dec 26 20:55:52 2021 +0100 staging: r8188eu: remove bStopBlinking Remove the temporary variable bStopBlinking and check the conditions directly in the if clauses. There's no need to save the result of these checks. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211226195556.159471-18-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit a4299e0e3fd8294ead4087a1ea5dae5c7ab2e715 Author: Martin Kaiser Date: Sun Dec 26 20:55:51 2021 +0100 staging: r8188eu: LED_CTL_START_WPS_BOTTON is not used None of the callers sets LED_CTL_START_WPS_BOTTON. Remove the define and related dead code. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211226195556.159471-17-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 6b3449d1715ac6968f38424c93f657778df34bf3 Author: Martin Kaiser Date: Sun Dec 26 20:55:50 2021 +0100 staging: r8188eu: LED_CTL_POWER_ON is not used The LED_CTL_POWER_ON mode is not used by this driver. Remove the define and related dead code. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211226195556.159471-16-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 517da66148f8da94d0a27761601c3b0fdd66c4fc Author: Martin Kaiser Date: Sun Dec 26 20:55:49 2021 +0100 staging: r8188eu: remove LedControlHandler Export the function that other layers use for setting the led. Remove the function pointer and the macro to make the led control function configurable. This driver supports only a single configuration. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211226195556.159471-15-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 74752a36662cf9e7140e0bf5e24e88a7a38bcd78 Author: Martin Kaiser Date: Sun Dec 26 20:55:48 2021 +0100 staging: r8188eu: remove obsolete comments Remove some comments that don't make sense any more. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211226195556.159471-14-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 88514247c1426d8478636eff55d91e0b03c3e7f7 Author: Martin Kaiser Date: Sun Dec 26 20:55:47 2021 +0100 staging: r8188eu: use bool for boolean values Change some boolean variables from u8 to bool. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211226195556.159471-13-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit e83c8ef4411fd76c614e2db211c2caa0d9a96542 Author: Martin Kaiser Date: Sun Dec 26 20:55:46 2021 +0100 staging: r8188eu: make blink interval defines internal The defines for led blink intervals are used only by the led layer. Move them into rtw_led.c. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211226195556.159471-12-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit e3a12865a9c0eaa95807c88986490a96738d16bd Author: Martin Kaiser Date: Sun Dec 26 20:55:45 2021 +0100 staging: r8188eu: bLedStartToLinkBlinkInProgress is set but not used Remove bLedStartToLinkBlinkInProgress from struct LED_871x. It's set but not used. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211226195556.159471-11-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 07a33118b4c507c3a2b25040dd43546c000486eb Author: Martin Kaiser Date: Sun Dec 26 20:55:44 2021 +0100 staging: r8188eu: remove unused blink mode defines Remove defines for led blink modes which are not used by this driver. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211226195556.159471-10-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 0a7a87c418f8fbbb124ccd5f032e358cfdb81dac Author: Martin Kaiser Date: Sun Dec 26 20:55:43 2021 +0100 staging: r8188eu: clean up blinking macros Clean up the macros that check the blinking mode of a LED. The macro IS_LED_BLINKING is not used and can be removed. The IS_LED_WPS_BLINKING macro is used only by rtw_led.c. Move the macro into this file. The macro parameter is always a struct LED_871x *, there's no need for a cast. Rename the parameter to l and put it in parentheses, which is good practice for macro parameters. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211226195556.159471-9-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 98731fa612476989063ebe3040d4ba9966965970 Author: Martin Kaiser Date: Sun Dec 26 20:55:42 2021 +0100 staging: r8188eu: clean up the blink worker code Merge the BlinkWorkItemCallback and BlinkHandler functions. Rename the resulting function to blink_work and make it internal to the led layer. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211226195556.159471-8-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit c87adbe4bf1384a99cbd8daa78d8412f95c9db4f Author: Martin Kaiser Date: Sun Dec 26 20:55:41 2021 +0100 staging: r8188eu: make ResetLedStatus static The ResetLedStatus function is used only by the led layer. Make it static. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211226195556.159471-7-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 0b8d8a17d628146a0bb2a769f6135e0212643b3a Author: Martin Kaiser Date: Sun Dec 26 20:55:40 2021 +0100 staging: r8188eu: merge DeInitLed871x and rtl8188eu_DeInitSwLeds Merge DeInitLed871x and rtl8188eu_DeInitSwLeds, both of which are small and simple. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211226195556.159471-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit ed5a214e55a6fbcc44765144d109543b0413b21f Author: Martin Kaiser Date: Sun Dec 26 20:55:39 2021 +0100 staging: r8188eu: merge InitLed871x and rtl8188eu_InitSwLeds Copy InitLed871x into rtl8188eu_InitSwLeds. There's no need for two separate functions. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211226195556.159471-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 2232e50bd1170279e8debdcc3252336fda868873 Author: Martin Kaiser Date: Sun Dec 26 20:55:38 2021 +0100 staging: r8188eu: move (de)init functions from hal to rtw_led Move the led init and deinit functions from the hal layer to rtw_led.c. rtl8188eu_led.c and rtl8188e_led.h can now be removed. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211226195556.159471-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit b3505203320d6e74a3c83e39c63ef64b6fcd82ac Author: Martin Kaiser Date: Sun Dec 26 20:55:37 2021 +0100 staging: r8188eu: move SwLedOn and SwLedOff into rtw_led.c Move the low-level functions SwLedOn and SwLedOff from the hal layer into rtw_led.c. This is the only place where they're used. There's no need to go through the hal layer for a simple register access if the driver supports only a single chipset. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211226195556.159471-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 9d36de31130542fc060f7cd17e72db670202c682 Author: Martin Kaiser Date: Sun Dec 26 20:55:36 2021 +0100 staging: r8188eu: switch the led off during deinit When the driver is unloaded or when the system goes into standby mode, DeInitLed871x is called to stop the led layer. In this case, we stop the blinking worker but we do not switch the led off explicitly. On my system, I can go into standby mode with the LED enabled. Add a call to SwLedOff to fix this. Fixes: 15865124feed ("staging: r8188eu: introduce new core dir for RTL8188eu driver") Cc: stable@vger.kernel.org Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211226195556.159471-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 0dbd880cb51388ef13d7b1d450dde9afe884f62b Author: Tommaso Merciai Date: Sat Dec 25 18:34:57 2021 +0100 staging: vt6655: drop off byRxMode var in device.h Drop off unused variable byRxMode in device.h Signed-off-by: Tommaso Merciai Link: https://lore.kernel.org/r/20211225173500.5459-1-tomm.merciai@gmail.com Signed-off-by: Greg Kroah-Hartman commit 25f5de0de91e86445a916ad61e10a6bc438ed475 Author: Nikita Yushchenko Date: Sun Dec 26 11:25:29 2021 +0300 staging: most: dim2: use consistent routine naming Rename init routines and enum values to reflect that those are for Renesas R-Car Gen2 and R-Car Gen3 SoCs. Signed-off-by: Nikita Yushchenko Link: https://lore.kernel.org/r/20211226082530.2245198-3-nikita.yoush@cogentembedded.com Signed-off-by: Greg Kroah-Hartman commit 12e5241b8b362693fec23cccd4b35ce95a7f9bd2 Author: Nikita Yushchenko Date: Sun Dec 26 11:25:28 2021 +0300 staging: most: dim2: update renesas compatible string Use "renesas,rcar-gen3-mlp" instead of "rcar,medialb-dim2" - the documented vendor prefix for Renesas is "renesas," - existing r-car devices use "rcar-genN-XXX" pattern. There are currently no in-tree users to update. Signed-off-by: Nikita Yushchenko Link: https://lore.kernel.org/r/20211226082530.2245198-2-nikita.yoush@cogentembedded.com Signed-off-by: Greg Kroah-Hartman commit a1f0906447efe5e53f4d491cf9b131b95898d742 Author: Abdun Nihaal Date: Fri Dec 24 17:40:43 2021 +0530 staging: r8188eu: include variable declarations from Hal8188EPwrSeq.h Variable declarations of rtl8188E_power_on_flow, rtl8188E_card_disable_flow and rtl8188E_enter_lps_flow are present in Hal8188EPwrSeq.h. A previous commit changed Hal8188EPwrSeq.c to include HalPwrSeqCmd.h directly instead of Hal8188EPwrSeq.h, causing these sparse warnings: - symbol 'rtl8188E_power_on_flow' was not declared. Should it be static? - symbol 'rtl8188E_card_disable_flow' was not declared.Should it be static? - symbol 'rtl8188E_enter_lps_flow' was not declared. Should it be static? This patch reverts the include line to include the declarations. Fixes: 4f458ec5f497 ("staging: r8188: move the steps into Hal8188EPwrSeq.c") Acked-by: Martin Kaiser Signed-off-by: Abdun Nihaal Link: https://lore.kernel.org/r/20211224121043.175650-1-abdun.nihaal@gmail.com Signed-off-by: Greg Kroah-Hartman commit b846c0bd43f29225d385972b5ee2b47c74b75d64 Author: Ismayil Mirzali Date: Wed Dec 22 20:51:15 2021 +0200 staging: rtl8723bs: removed unused if blocks Deleted the commented if blocks that weren't being used as suggested by the maintainers. Signed-off-by: Ismayil Mirzali Link: https://lore.kernel.org/r/b4652b7490f3574445d567ef662270605533bfa4.1640197297.git.ismayilmirzeli@gmail.com Signed-off-by: Greg Kroah-Hartman commit 11907481851a4701d5fce56e1ee718ff9f72fa99 Author: Paulo Miguel Almeida Date: Wed Dec 22 20:02:56 2021 +1300 staging: pi433: remove unnecessary parentheses pointed out by checkpatch.pl Checkpatch reports 'Unnecessary parentheses around '. Fix this by removing extraneous parentheses where applicable. Signed-off-by: Paulo Miguel Almeida Link: https://lore.kernel.org/r/20211222070256.GA7644@localhost.localdomain Signed-off-by: Greg Kroah-Hartman commit 6350e6f6d14fb41e071bb104cfffb7aa2019480f Author: Gautam Menghani Date: Tue Dec 28 15:46:15 2021 +0530 staging: vc04_services: Remove repeated word in vchiq log warning In a log warning in vhciq code, the word 'count' is repeated twice. Remove repeated word 'count' from vhciq log warning. This change has been suggested by checkpatch.pl Signed-off-by: Gautam Menghani Link: https://lore.kernel.org/r/20211228101615.5073-1-gautammenghani14@gmail.com Signed-off-by: Greg Kroah-Hartman commit 660d187887cf28bcd71e56008a71657811953189 Author: Peiwei Hu Date: Tue Dec 28 16:59:10 2021 +0800 hwmon: (xgene-hwmon) Add free before exiting xgene_hwmon_probe Call kfifo_free(&ctx->async_msg_fifo) before error exiting instead of returning directly. Signed-off-by: Peiwei Hu Link: https://lore.kernel.org/r/tencent_C851C0324431466CBC22D60C5C6AC4A8E808@qq.com Signed-off-by: Guenter Roeck commit e1878402ab2dca12d1426f2fea39757943f3332c Author: Michael Kelley Date: Mon Dec 27 19:31:55 2021 -0800 x86/hyperv: Fix definition of hv_ghcb_pg variable The percpu variable hv_ghcb_pg is incorrectly defined. The __percpu qualifier should be associated with the union hv_ghcb * (i.e., a pointer), not with the target of the pointer. This distinction makes no difference to gcc and the generated code, but sparse correctly complains. Fix the definition in the interest of general correctness in addition to making sparse happy. No functional change. Fixes: 0cc4f6d9f0b9 ("x86/hyperv: Initialize GHCB page in Isolation VM") Reported-by: kernel test robot Signed-off-by: Michael Kelley Link: https://lore.kernel.org/r/1640662315-22260-2-git-send-email-mikelley@microsoft.com Signed-off-by: Wei Liu commit db3c65bc3a1308db8c914b2bf477b5a36005c3d3 Author: Michael Kelley Date: Mon Dec 27 19:31:54 2021 -0800 Drivers: hv: Fix definition of hypercall input & output arg variables The percpu variables hyperv_pcpu_input_arg and hyperv_pcpu_output_arg have been incorrectly defined since their inception. The __percpu qualifier should be associated with the void * (i.e., a pointer), not with the target of the pointer. This distinction makes no difference to gcc and the generated code, but sparse correctly complains. Fix the definitions in the interest of general correctness in addition to making sparse happy. No functional change. Reported-by: kernel test robot Signed-off-by: Michael Kelley Link: https://lore.kernel.org/r/1640662315-22260-1-git-send-email-mikelley@microsoft.com Signed-off-by: Wei Liu commit cd4eadf228dbfc6e81a2730a1fa635e9a593a449 Author: Sam Protsenko Date: Sun Nov 21 18:56:47 2021 +0200 watchdog: s3c2410: Add Exynos850 support Exynos850 is a bit different from SoCs already supported in WDT driver: - AUTOMATIC_WDT_RESET_DISABLE register is removed, so its value is always 0; .disable_auto_reset callback is not set for that reason - MASK_WDT_RESET_REQUEST register is replaced with CLUSTERx_NONCPU_IN_EN register; instead of masking (disabling) WDT reset interrupt it's now enabled with the same value; .mask_reset callback is reused for that functionality though - To make WDT functional, WDT counter needs to be enabled in CLUSTERx_NONCPU_OUT register; it's done using .enable_counter callback Also Exynos850 has two CPU clusters, each has its own dedicated WDT instance. Different PMU registers and bits are used for each cluster. So driver data is now modified in probe, adding needed info depending on cluster index passed from device tree. Signed-off-by: Sam Protsenko Reviewed-by: Krzysztof Kozlowski Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20211121165647.26706-13-semen.protsenko@linaro.org Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 968011a291f3c80afe9446968d21422569f1bc1c Author: Yunus Bas Date: Wed Nov 24 09:06:54 2021 +0100 watchdog: da9063: use atomic safe i2c transfer in reset handler This patch is based on commit 057b52b4b3d5 ("watchdog: da9062: make restart handler atomic safe"), which uses the atomic transfer capability of the i2c framework. Signed-off-by: Yunus Bas Signed-off-by: Andrej Picej Reviewed-by: Adam Thomson Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20211124080654.2601135-1-andrej.picej@norik.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 1fc8a2c021c3abb8083ef4d9b6d4c93f88f33dc7 Author: Changcheng Deng Date: Thu Nov 25 01:49:24 2021 +0000 watchdog: davinci: Use div64_ul instead of do_div do_div() does a 64-by-32 division. Here the divisor is an unsigned long which on some platforms is 64 bit wide. So use div64_ul instead of do_div to avoid a possible truncation. Reported-by: Zeal Robot Signed-off-by: Changcheng Deng Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20211125014924.46297-1-deng.changcheng@zte.com.cn Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit f8d9ba7fedd2a5c21759ce3f39a37663c895d3dd Author: Florian Fainelli Date: Fri Nov 12 14:46:36 2021 -0800 watchdog: Remove BCM63XX_WDT Now that we can utilize the BCM7038_WDT driver, remove that one which was not converted to the watchdog APIs. There are a couple of notable differences with how the bcm7038_wdt driver proceeds: - bcm63xx_wdt would register with the ad-hoc BCM63xx hardware timer API, but this would only be used in order to catch the interrupt *before* a SoC reset and make the kernel "die" - bcm6xx_wdt would register a software timer and kick it every second in order to pet the watchdog, thus offering a two step watchdog process. This is not something that is brought over to the bcm7038_wdt as it is deemed unnecessary. If user-space cannot pet the watchdog, but a kernel timer can, the system is still in a bad shape anyway. bcm7038_wdt is simpler in its behavior and behaves as a standard watchdog driver and is not making use of any specific platform APIs, therefore making it more maintainable and extensible. Signed-off-by: Florian Fainelli Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20211112224636.395101-8-f.fainelli@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit b844f9181b4a1014d501a26dc25b39f363626b8c Author: Florian Fainelli Date: Fri Nov 12 14:46:35 2021 -0800 MIPS: BCM63XX: Provide platform data to watchdog device In order to utilize the bcm7038_wdt.c driver which needs to know the clock name to obtain, pass it via platform data using the bcm7038_wdt_platform_data structure. Signed-off-by: Florian Fainelli Acked-by: Thomas Bogendoerfer Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20211112224636.395101-7-f.fainelli@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit e764faef774b931994d31a856d786734691ab26e Author: Florian Fainelli Date: Fri Nov 12 14:46:34 2021 -0800 watchdog: bcm7038_wdt: Add platform device id for bcm63xx-wdt In order to phase out bcm63xx_wdt and use bcm7038_wdt instead, introduce a platform_device_id table that allows both names to be matched. Signed-off-by: Florian Fainelli Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20211112224636.395101-6-f.fainelli@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit bc0bf9e9ac3ba49d1c7ab267a58204b525ac054b Author: Florian Fainelli Date: Fri Nov 12 14:46:33 2021 -0800 watchdog: Allow building BCM7038_WDT for BCM63XX CONFIG_BCM63XX denotes the legacy MIPS-based DSL SoCs which utilize the same piece of hardware as a watchdog, make it possible to select that driver for those platforms. Signed-off-by: Florian Fainelli Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20211112224636.395101-5-f.fainelli@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit d6b9c679bbac1d1d2fcac64391b4cadb91763a6f Author: Florian Fainelli Date: Fri Nov 12 14:46:32 2021 -0800 watchdog: bcm7038_wdt: Support platform data configuration The BCM7038 watchdog driver needs to be able to obtain a specific clock name on BCM63xx platforms which is the "periph" clock ticking at 50MHz. make it possible to specify the clock name to obtain via platform data. Signed-off-by: Florian Fainelli Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20211112224636.395101-4-f.fainelli@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 17fffe91ba36d11c7b17be154ecc7c1ed31527eb Author: Florian Fainelli Date: Fri Nov 12 14:46:31 2021 -0800 dt-bindings: watchdog: Add BCM6345 compatible to BCM7038 binding The BCM7038 watchdog binding is updated to include a "brcm,bcm6345-wdt" compatible string which is the first instance of a DSL (BCM63xx) SoC seeing the integration of such a watchdog timer block. Reviewed-by: Rob Herring Signed-off-by: Florian Fainelli Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20211112224636.395101-3-f.fainelli@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 9439c9fde835977467e077cc622ffff95e4c2925 Author: Rafał Miłecki Date: Sat Nov 13 12:46:44 2021 +0100 dt-bindings: watchdog: convert Broadcom's WDT to the json-schema This helps validating DTS files. Signed-off-by: Rafał Miłecki Acked-by: Florian Fainelli Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211115055354.6089-1-zajec5@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit aeaacc064d8502b3f3ee662325df8fab24ad9006 Author: Artem Lapkin Date: Wed Nov 10 10:25:18 2021 +0800 watchdog: meson_gxbb_wdt: remove stop_on_reboot Remove watchdog_stop_on_reboot() The Meson platform still has some hardware drivers problems for some configurations which can freeze devices on shutdown/reboot. Remove watchdog_stop_on_reboot() to catch this situation and ensure that the reboot happens anyway. Users who still want to stop the watchdog on reboot can still do so using the watchdog.stop_on_reboot=1 module parameter. https://lore.kernel.org/linux-watchdog/20210729072308.1908904-1-art@khadas.com/T/#t Signed-off-by: Artem Lapkin Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20211110022518.1676834-1-art@khadas.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 15ebdc43d703e95e4ec9bae1b5411f1afb07c0b8 Author: Luca Ceresoli Date: Sat Dec 11 18:59:48 2021 +0100 watchdog: Kconfig: fix help text indentation Some entries indent their help text with 1 tab + 1 space or 1 tab only instead of 1 tab + 2 spaces. Add the missing spaces. Signed-off-by: Luca Ceresoli Acked-by: Randy Dunlap Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20211111225852.3128201-7-luca@lucaceresoli.net Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 5c9348157b9dc7a5f526934729bf4e5433b3a5b8 Author: Jacky Bai Date: Fri Nov 26 15:39:59 2021 +0800 dt-bindings: watchdog: imx7ulp-wdt: Add imx8ulp compatible string The wdog on i.MX8ULP is derived from i.MX7ULP, it uses two compatible strings, so update the compatible string for i.MX8ULP. Reviewed-by: Dong Aisheng Acked-by: Rob Herring Signed-off-by: Jacky Bai Signed-off-by: Peng Fan Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20211112082930.3809351-7-peng.fan@oss.nxp.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 1a47cda07af4d81a49a140b52220ca56cd6e79a6 Author: Sam Protsenko Date: Sun Nov 21 18:56:46 2021 +0200 watchdog: s3c2410: Remove superfluous err label 'err' label in probe function is not really need, it just returns. Remove it and replace all 'goto' statements with actual returns in place. No functional change here, just a cleanup patch. Signed-off-by: Sam Protsenko Reviewed-by: Krzysztof Kozlowski Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20211107202943.8859-12-semen.protsenko@linaro.org [groeck: Fixed context conflicts] Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit e249d01b5e8b8263ee2fdb787c954450940a7677 Author: Sam Protsenko Date: Sun Nov 21 18:56:45 2021 +0200 watchdog: s3c2410: Support separate source clock Right now all devices supported in the driver have the single clock: it acts simultaneously as a bus clock (providing register interface clocking) and source clock (driving watchdog counter). Some newer Exynos chips, like Exynos850, have two separate clocks for that. In that case two clocks will be passed to the driver from the resource provider, e.g. Device Tree. Provide necessary infrastructure to support that case: - use source clock's rate for all timer related calculations - use bus clock to gate/ungate the register interface All devices that use the single clock are kept intact: if only one clock is passed from Device Tree, it will be used for both purposes as before. Signed-off-by: Sam Protsenko Reviewed-by: Krzysztof Kozlowski Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20211107202943.8859-11-semen.protsenko@linaro.org Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit cf3fad4e62d363e2e79aed8b7af4eb5bec905df0 Author: Sam Protsenko Date: Wed Nov 24 01:26:13 2021 +0200 watchdog: s3c2410: Cleanup PMU related code Now that PMU enablement code was extended for new Exynos SoCs, it doesn't look very cohesive and consistent anymore. Do a bit of renaming, grouping and style changes, to make it look good again. While at it, add quirks documentation as well. No functional change, just a refactoring commit. Signed-off-by: Sam Protsenko Reviewed-by: Krzysztof Kozlowski Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20211123232613.22438-1-semen.protsenko@linaro.org Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit aa220bc6b7581eb1ac2eb98a8d002af95d5d8c8d Author: Sam Protsenko Date: Sun Nov 21 18:56:43 2021 +0200 watchdog: s3c2410: Add support for WDT counter enable register On new Exynos chips (e.g. Exynos850) new CLUSTERx_NONCPU_OUT register is introduced, where CNT_EN_WDT bit must be enabled to make watchdog counter running. Add corresponding quirk and proper infrastructure to handle that register if the quirk is set. This commit doesn't bring any functional change to existing devices, but merely provides an infrastructure for upcoming chips support. Signed-off-by: Sam Protsenko Reviewed-by: Krzysztof Kozlowski Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20211107202943.8859-9-semen.protsenko@linaro.org Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 370bc7f50f475711c970c8e88b2f4b29b53b5791 Author: Sam Protsenko Date: Sun Nov 21 18:56:42 2021 +0200 watchdog: s3c2410: Implement a way to invert mask reg value On new Exynos chips (like Exynos850) the MASK_WDT_RESET_REQUEST register is replaced with CLUSTERx_NONCPU_INT_EN, and its mask bit value meaning was reversed: for new register the bit value "1" means "Interrupt enabled", while for MASK_WDT_RESET_REQUEST register "1" means "Mask the interrupt" (i.e. "Interrupt disabled"). Introduce "mask_reset_inv" boolean field in driver data structure; when that field is "true", mask register handling function will invert the value before setting it to the register. This commit doesn't bring any functional change to existing devices, but merely provides an infrastructure for upcoming chips support. Signed-off-by: Sam Protsenko Reviewed-by: Krzysztof Kozlowski Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20211107202943.8859-8-semen.protsenko@linaro.org Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 2bd33bb4bc1cdb34b6781f6c1fc1ad475d0ad55b Author: Sam Protsenko Date: Sun Nov 21 18:56:41 2021 +0200 watchdog: s3c2410: Extract disable and mask code into separate functions The s3c2410wdt_mask_and_disable_reset() function content is bound to be changed further. Prepare it for upcoming changes by splitting into separate "mask reset" and "disable reset" functions. But keep s3c2410wdt_mask_and_disable_reset() function present as a facade. This commit doesn't bring any functional change to existing devices, but merely provides an infrastructure for upcoming chips support. Signed-off-by: Sam Protsenko Reviewed-by: Krzysztof Kozlowski Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20211107202943.8859-7-semen.protsenko@linaro.org Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 8d9fdf60e37c7752931738c1dc202b4c6066f0d2 Author: Sam Protsenko Date: Sun Nov 21 18:56:40 2021 +0200 watchdog: s3c2410: Make reset disable register optional On new Exynos chips (e.g. Exynos850 and Exynos9) the AUTOMATIC_WDT_RESET_DISABLE register was removed, and its value can be thought of as "always 0x0". Add correspondig quirk bit, so that the driver can omit accessing it if it's not present. This commit doesn't bring any functional change to existing devices, but merely provides an infrastructure for upcoming chips support. Signed-off-by: Sam Protsenko Reviewed-by: Krzysztof Kozlowski Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20211107202943.8859-6-semen.protsenko@linaro.org Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit a90102e358ee336b96e2447104f47dee7a347aac Author: Sam Protsenko Date: Sun Nov 21 18:56:39 2021 +0200 watchdog: s3c2410: Let kernel kick watchdog When "tmr_atboot" module param is set, the watchdog is started in driver's probe. In that case, also set WDOG_HW_RUNNING bit to let watchdog core driver know it's running. This way watchdog core can kick the watchdog for us (if CONFIG_WATCHDOG_HANDLE_BOOT_ENABLED option is enabled), until user space takes control. WDOG_HW_RUNNING bit must be set before registering the watchdog. So the "tmr_atboot" handling code is moved before watchdog registration, to avoid performing the same check twice. This is also logical because WDOG_HW_RUNNING bit makes WDT core expect actually running watchdog. Signed-off-by: Sam Protsenko Reviewed-by: Krzysztof Kozlowski Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20211107202943.8859-5-semen.protsenko@linaro.org Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit f197d47584be621d634ad7fdfad3e62c8c13ce24 Author: Sam Protsenko Date: Sun Nov 21 18:56:38 2021 +0200 watchdog: s3c2410: Fail probe if can't find valid timeout Driver can't work properly if there no valid timeout was found in s3c2410wdt_set_heartbeat(). Ideally, that function should be reworked in a way that it's always able to find some valid timeout. As a temporary solution let's for now just fail the driver probe in case the valid timeout can't be found in s3c2410wdt_set_heartbeat() function. Signed-off-by: Sam Protsenko Reported-by: Guenter Roeck Suggested-by: Guenter Roeck Reviewed-by: Krzysztof Kozlowski Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20211107202943.8859-4-semen.protsenko@linaro.org Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 0b595831c2c8f81c252818d3575c689741a7efeb Author: Sam Protsenko Date: Sun Nov 21 18:56:37 2021 +0200 dt-bindings: watchdog: Document Exynos850 watchdog bindings Exynos850 SoC has two CPU clusters: - cluster 0: contains CPUs #0, #1, #2, #3 - cluster 1: contains CPUs #4, #5, #6, #7 Each cluster has its own dedicated watchdog timer. Those WDT instances are controlled using different bits in PMU registers, new "samsung,index" property is added to tell the driver which bits to use for defined watchdog node. Also on Exynos850 the peripheral clock and the source clock are two different clocks. Provide a way to specify two clocks in watchdog device tree node. Signed-off-by: Sam Protsenko Reviewed-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20211107202943.8859-3-semen.protsenko@linaro.org Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 33950f9a36aca55c2b1e6062d9b29f3e97f91c40 Author: Sam Protsenko Date: Sun Nov 21 18:56:36 2021 +0200 dt-bindings: watchdog: Require samsung,syscon-phandle for Exynos7 Exynos7 watchdog driver is clearly indicating that its dts node must define syscon phandle property. That was probably forgotten, so add it. Signed-off-by: Sam Protsenko Fixes: 2b9366b66967 ("watchdog: s3c2410_wdt: Add support for Watchdog device on Exynos7") Reviewed-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20211107202943.8859-2-semen.protsenko@linaro.org Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit cea62f9fee0dae304d03def042f8a36f89dd337a Author: AaeonIot Date: Wed Nov 17 10:40:52 2021 +0800 watchdog: f71808e_wdt: Add F81966 support This adds watchdog support the Fintek F81966 Super I/O chip. Testing was done on the Aaeon SSE-OPTI Signed-off-by: AaeonIot Signed-off-by: Chia-Lin Kao (AceLan) Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20211117024052.2427539-1-acelan.kao@canonical.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit ab571cbc098cd862397a73451f47b69ad581f35f Author: Kevin Hilman Date: Wed Nov 3 16:03:53 2021 -0700 watchdog: Kconfig: enable MTK watchdog Enable CONFIG_MEDIATEK_WATCHDOG when ARCH_MEDIATEK is enabled. On some platforms (e.g. mt8183-pumpkin), watchdog is enabled by bootloader, so kernel driver needs to be enabled to avoid watchdog firing and causing reboot part way through kernel boot. Signed-off-by: Kevin Hilman Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20211103230354.915658-1-khilman@baylibre.com Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck commit 0f1eae8e565e632f64670a5730894f22819fcaad Author: Colin Ian King Date: Tue Dec 28 00:45:42 2021 +0000 net: caif: remove redundant assignment to variable expectlen Variable expectlen is being assigned a value that is never read, the assignment occurs before a return statement. The assignment is redundant and can be removed. Signed-off-by: Colin Ian King Signed-off-by: David S. Miller commit aa674de1dc3d2bdf2c67ad195dc81977972323c6 Author: Marc Zyngier Date: Mon Dec 27 12:48:09 2021 +0000 KVM: selftests: arm64: Add support for various modes with 16kB page size The 16kB page size is not a popular choice, due to only a few CPUs actually implementing support for it. However, it can lead to some interesting performance improvements given the right uarch choices. Add support for this page size for various PA/VA combinations. Signed-off-by: Marc Zyngier Reviewed-by: Andrew Jones Link: https://lore.kernel.org/r/20211227124809.1335409-7-maz@kernel.org commit e7f58a6bd28bfd2e4f60312abf48f07de2c4121c Author: Marc Zyngier Date: Mon Dec 27 12:48:08 2021 +0000 KVM: selftests: arm64: Add support for VM_MODE_P36V48_{4K,64K} Some of the arm64 systems out there have an IPA space that is positively tiny. Nonetheless, they make great KVM hosts. Add support for 36bit IPA support with 4kB pages, which makes some of the fruity machines happy. Whilst we're at it, add support for 64kB pages as well, though these boxes have no support for it. Reviewed-by: Andrew Jones Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211227124809.1335409-6-maz@kernel.org commit 2f41a61c54fb6410202b2cc08be80ae9554d599d Author: Marc Zyngier Date: Mon Dec 27 12:48:07 2021 +0000 KVM: selftests: arm64: Rework TCR_EL1 configuration The current way we initialise TCR_EL1 is a bit cumbersome, as we mix setting TG0 and IPS in the same swtch statement. Split it into two statements (one for the base granule size, and another for the IPA size), allowing new modes to be added in a more elegant way. No functional change intended. Signed-off-by: Marc Zyngier Reviewed-by: Andrew Jones Link: https://lore.kernel.org/r/20211227124809.1335409-5-maz@kernel.org commit 0303ffdb9ecffac4654b16bbf69ba84d131eb8b7 Author: Marc Zyngier Date: Mon Dec 27 12:48:06 2021 +0000 KVM: selftests: arm64: Check for supported page sizes Just as arm64 implemenations don't necessary support all IPA ranges, they don't all support the same page sizes either. Fun. Create a dummy VM to snapshot the page sizes supported by the host, and filter the supported modes. Signed-off-by: Marc Zyngier Reviewed-by: Andrew Jones Link: https://lore.kernel.org/r/20211227124809.1335409-4-maz@kernel.org commit 357c628e1248dd53f5c43a768246a83478a7f489 Author: Marc Zyngier Date: Mon Dec 27 12:48:05 2021 +0000 KVM: selftests: arm64: Introduce a variable default IPA size Contrary to popular belief, there is no such thing as a default IPA size on arm64. Anything goes, and implementations are the usual Wild West. The selftest infrastructure default to 40bit IPA, which obviously doesn't work for some systems out there. Turn VM_MODE_DEFAULT from a constant into a variable, and let guest_modes_append_default() populate it, depending on what the HW can do. In order to preserve the current behaviour, we still pick 40bits IPA as the default if it is available, and the largest supported IPA space otherwise. Signed-off-by: Marc Zyngier Reviewed-by: Andrew Jones Link: https://lore.kernel.org/r/20211227124809.1335409-3-maz@kernel.org commit cb7c4f364abd09abd1865fa049ef492fb43e6bf3 Author: Marc Zyngier Date: Mon Dec 27 12:48:04 2021 +0000 KVM: selftests: arm64: Initialise default guest mode at test startup time As we are going to add support for a variable default mode on arm64, let's make sure it is setup first by using a constructor that gets called before the actual test runs. Suggested-by: Andrew Jones Signed-off-by: Marc Zyngier Reviewed-by: Andrew Jones Link: https://lore.kernel.org/r/20211227124809.1335409-2-maz@kernel.org commit de768416b203ac84e02a757b782a32efb388476f Author: Zhang Zixun Date: Mon Dec 27 22:02:49 2021 +0100 x86/mce/inject: Avoid out-of-bounds write when setting flags A contrived zero-length write, for example, by using write(2): ... ret = write(fd, str, 0); ... to the "flags" file causes: BUG: KASAN: stack-out-of-bounds in flags_write Write of size 1 at addr ffff888019be7ddf by task writefile/3787 CPU: 4 PID: 3787 Comm: writefile Not tainted 5.16.0-rc7+ #12 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-2 04/01/2014 due to accessing buf one char before its start. Prevent such out-of-bounds access. [ bp: Productize into a proper patch. Link below is the next best thing because the original mail didn't get archived on lore. ] Fixes: 0451d14d0561 ("EDAC, mce_amd_inj: Modify flags attribute to use string arguments") Signed-off-by: Zhang Zixun Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/linux-edac/YcnePfF1OOqoQwrX@zn.tnic/ commit cf6299b6101903c31bddb0065804b2121ed510c7 Author: Greg Kroah-Hartman Date: Mon Dec 27 17:39:24 2021 +0100 kobject: remove kset from struct kset_uevent_ops callbacks There is no need to pass the pointer to the kset in the struct kset_uevent_ops callbacks as no one uses it, so just remove that pointer entirely. Reviewed-by: Rafael J. Wysocki Reviewed-by: Wedson Almeida Filho Link: https://lore.kernel.org/r/20211227163924.3970661-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit fa487b2a900d7b22fe7db678d2134fbf56ae9da0 Author: Gil Fine Date: Fri Dec 17 03:16:44 2021 +0200 thunderbolt: Add module parameter for CLx disabling Add a module parameter that allows user to completely disable CLx functionality in case problems are found. Signed-off-by: Gil Fine Signed-off-by: Mika Westerberg commit 43f977bc60b1cfd3c1d220a9a0a06493fbf3985d Author: Gil Fine Date: Fri Dec 17 03:16:43 2021 +0200 thunderbolt: Enable CL0s for Intel Titan Ridge Low power link states (called collectively CLx) are used to reduce transmitter and receiver power when a high-speed lane is idle. The simplest one being called CL0s. Follow what we already do for USB4 device routers and enable CL0s for Intel Titan Ridge device router too. This allows better thermal management. Signed-off-by: Gil Fine Signed-off-by: Mika Westerberg commit f103b2e5a6197586effb0b9a1b72c30b5d65b0cd Author: Aleksandr Mezin Date: Tue Dec 28 07:48:13 2021 +0600 hwmon: (nzxt-smart2) Fix "unused function" warning Fix warning when building with CONFIG_PM=n (and CONFIG_WERROR=y): drivers/hwmon/nzxt-smart2.c:707:12: error: ‘nzxt_smart2_hid_reset_resume’ defined but not used [-Werror=unused-function] 707 | static int nzxt_smart2_hid_reset_resume(struct hid_device *hdev) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Aleksandr Mezin Link: https://lore.kernel.org/r/20211228014813.832491-1-mezin.alexander@gmail.com Signed-off-by: Guenter Roeck commit 53e8558837be58c1d44d50ad87247a8c56c95c13 Author: Chen Yu Date: Wed Dec 22 12:32:34 2021 +0800 ACPI: tools: Introduce utility for firmware updates/telemetry Introduce a user space tool to make use of the interface exposed by Platform Firmware Runtime Update and Telemetry drivers. It can be used for firmware code injection, driver updates and to retrieve platform firmware telemetry data. Tested-by: Hongyu Ning Signed-off-by: Chen Yu [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki commit b0013e037a8b07772c74ce24f1ae4743b30fc3cf Author: Chen Yu Date: Wed Dec 22 12:32:02 2021 +0800 ACPI: Introduce Platform Firmware Runtime Telemetry driver This driver allows user space to fetch telemetry data from the firmware with the help of the Platform Firmware Runtime Telemetry interface. Both PFRU and PFRT are based on ACPI _DSM interfaces located under special device objects in the ACPI Namespace, but these interfaces are different from each other, so it is better to provide a separate driver from each of them, even though they share some common definitions and naming conventions. Tested-by: Hongyu Ning Signed-off-by: Chen Yu [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki commit 0db89fa243e5edc5de38c88b369e4c3755c5fb74 Author: Chen Yu Date: Wed Dec 22 12:31:41 2021 +0800 ACPI: Introduce Platform Firmware Runtime Update device driver Introduce the pfr_update driver which can be used for Platform Firmware Runtime code injection and driver update [1]. The user is expected to provide the EFI capsule, and pass it to the driver by writing the capsule to a device special file. The capsule is transferred by the driver to the platform firmware with the help of an ACPI _DSM method under the special ACPI Platform Firmware Runtime Update device (INTC1080), and the actual firmware update is carried out by the low-level Management Mode code in the platform firmware. This change allows certain pieces of the platform firmware to be updated on the fly while the system is running (runtime) without the need to restart it, which is key in the cases when the system needs to be available 100% of the time and it cannot afford the downtime related to restarting it, or when the work carried out by the system is particularly important, so it cannot be interrupted, and it is not practical to wait until it is complete. Link: https://uefi.org/sites/default/files/resources/Intel_MM_OS_Interface_Spec_Rev100.pdf # [1] Tested-by: Hongyu Ning Signed-off-by: Chen Yu [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki commit 1882de7fc56c2b0ea91dd9fd9922d434fc3feb15 Author: Chen Yu Date: Wed Dec 22 12:31:03 2021 +0800 efi: Introduce EFI_FIRMWARE_MANAGEMENT_CAPSULE_HEADER and corresponding structures Platform Firmware Runtime Update image starts with UEFI headers, and the headers are defined in UEFI specification, but some of them have not been defined in the kernel yet. For example, the header layout of a capsule file looks like this: EFI_CAPSULE_HEADER EFI_FIRMWARE_MANAGEMENT_CAPSULE_HEADER EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER EFI_FIRMWARE_IMAGE_AUTHENTICATION These structures would be used by the Platform Firmware Runtime Update driver to parse the format of capsule file to verify if the corresponding version number is valid. In this way, if the user provides an invalid capsule image, the kernel could be used as a guard to reject it, without switching to the Management Mode (which might be costly). EFI_CAPSULE_HEADER has been defined in the kernel, but the other structures have not been defined yet, so do that. Besides, EFI_FIRMWARE_MANAGEMENT_CAPSULE_HEADER and EFI_FIRMWARE_MANAGEMENT_CAPSULE_IMAGE_HEADER are required to be packed in the uefi specification. For this reason, use the __packed attribute to indicate to the compiler that the entire structure can appear misaligned in memory (as suggested by Ard) in case one of them follows the other directly in a capsule header. Acked-by: Ard Biesheuvel Signed-off-by: Chen Yu Signed-off-by: Rafael J. Wysocki commit c95545a036705e1a78b40a83701c8d3868898114 Author: Bob Moore Date: Wed Dec 22 17:38:29 2021 +0100 ACPICA: Update version to 20211217 ACPICA commit 90088defcb99e122edf41038ae5c901206c86dc9 Version 20211217. Link: https://github.com/acpica/acpica/commit/90088def Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit 0c9a672729d62d27d0c9993e106707be0b0c2bc0 Author: Bob Moore Date: Wed Dec 22 17:37:56 2021 +0100 ACPICA: iASL/NHLT table: "Specific Data" field support ACPICA commit 26f8c721fb01e4a26eec8c85dffcbe950d5e61a9 Add support for optional "Specific Data" field for the optional Linux-specific structure that appears at the end of an Endpoint Descriptor. Link: https://github.com/acpica/acpica/commit/26f8c721 Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit 5579649e7eb756a4e3d5784b6958374e5bfc41de Author: Ilkka Koskinen Date: Wed Dec 22 17:37:21 2021 +0100 ACPICA: iASL: Add suppport for AGDI table ACPICA commit cf36a6d658ca5aa8c329c2edfc3322c095ffd844 Add support for Arm Generic Diagnostic Dump and Reset Interface, which is described by "ACPI for Arm Components 1.1 Platform Design Document" ARM DEN0093. Add the necessary types in the ACPICA header files and support for compiling and decompiling the table. Link: https://github.com/acpica/acpica/commit/cf36a6d6 Signed-off-by: Ilkka Koskinen Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit 2de6bb92ebbb0e8803554bb24391514b552cb481 Author: Bob Moore Date: Wed Dec 22 17:36:30 2021 +0100 ACPICA: iASL: Add TDEL table to both compiler/disassembler ACPICA commit 403f9965aba7ff9d2ed5b41bbffdd2a1ed0f596f Added struct acpi_pcc_info to acpi_src. Link: https://github.com/acpica/acpica/commit/403f9965 Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit b70d6f07ed31f74b5d702a2bda1d592cc6622a02 Author: Bob Moore Date: Wed Dec 22 17:35:49 2021 +0100 ACPICA: Fixed a couple of warnings under MSVC ACPICA commit 86c919d2bad08491fc91ffa53e9b169092de8622 Repaired with casts. Link: https://github.com/acpica/acpica/commit/86c919d2 Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit 9f52815422a4b81dc9093fae338a9c41a9ff6657 Author: Bob Moore Date: Wed Dec 22 17:35:12 2021 +0100 ACPICA: Change a return_ACPI_STATUS (AE_BAD_PARAMETER) ACPICA commit ff803279dde7a3e068a6a698d8c69503cd159ad7 To simply return (AE_BAD_PARAMETER); to fix compilation on MSVC. Link: https://github.com/acpica/acpica/commit/ff803279 Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit 1d4e0b3abb168b2ee1eca99c527cffa1b80b6161 Author: Kirill A. Shutemov Date: Wed Dec 22 17:33:51 2021 +0100 ACPICA: Hardware: Do not flush CPU cache when entering S4 and S5 ACPICA commit 3dd7e1f3996456ef81bfe14cba29860e8d42949e According to ACPI 6.4, Section 16.2, the CPU cache flushing is required on entering to S1, S2, and S3, but the ACPICA code flushes the CPU cache regardless of the sleep state. Blind cache flush on entering S5 causes problems for TDX. Flushing happens with WBINVD that is not supported in the TDX environment. TDX only supports S5 and adjusting ACPICA code to conform to the spec more strictly fixes the issue. Link: https://github.com/acpica/acpica/commit/3dd7e1f3 Signed-off-by: Kirill A. Shutemov [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit 0acf24ad7e10f547809faefb8069f8f5482eb4d9 Author: Sudeep Holla Date: Wed Dec 22 17:32:54 2021 +0100 ACPICA: Add support for PCC Opregion special context data ACPICA commit 55526e8a6133cbf5a9cc0fb75a95dbbac6eb98e6 PCC Opregion added in ACPIC 6.3 requires special context data similar to GPIO and Generic Serial Bus as it needs to know the internal PCC buffer and its length as well as the PCC channel index when the opregion handler is being executed by the OSPM. Lets add support for the special context data needed by PCC Opregion. Link: https://github.com/acpica/acpica/commit/55526e8a Signed-off-by: Sudeep Holla Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit 9a3b8655db1ada31c82189ae13f40eb25da48c35 Author: Sudeep Holla Date: Wed Dec 22 17:31:54 2021 +0100 ACPICA: Fix wrong interpretation of PCC address ACPICA commit 41be6afacfdaec2dba3a5ed368736babc2a7aa5c With the PCC Opregion in the firmware and we are hitting below kernel crash: -->8 Unable to handle kernel NULL pointer dereference at virtual address 0000000000000010 Workqueue: pm pm_runtime_work pstate: 80000005 (Nzcv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : __memcpy+0x54/0x260 lr : acpi_ex_write_data_to_field+0xb8/0x194 Call trace: __memcpy+0x54/0x260 acpi_ex_store_object_to_node+0xa4/0x1d4 acpi_ex_store+0x44/0x164 acpi_ex_opcode_1A_1T_1R+0x25c/0x508 acpi_ds_exec_end_op+0x1b4/0x44c acpi_ps_parse_loop+0x3a8/0x614 acpi_ps_parse_aml+0x90/0x2f4 acpi_ps_execute_method+0x11c/0x19c acpi_ns_evaluate+0x1ec/0x2b0 acpi_evaluate_object+0x170/0x2b0 acpi_device_set_power+0x118/0x310 acpi_dev_suspend+0xd4/0x180 acpi_subsys_runtime_suspend+0x28/0x38 __rpm_callback+0x74/0x328 rpm_suspend+0x2d8/0x624 pm_runtime_work+0xa4/0xb8 process_one_work+0x194/0x25c worker_thread+0x260/0x49c kthread+0x14c/0x30c ret_from_fork+0x10/0x20 Code: f9000006 f81f80a7 d65f03c0 361000c2 (b9400026) ---[ end trace 24d8a032fa77b68a ]--- The reason for the crash is that the PCC channel index passed via region.address in acpi_ex_store_object_to_node is interpreted as the channel subtype incorrectly. Assuming the PCC op_region support is not used by any other type, let us remove the subtype check as the AML has no access to the subtype information. Once we remove it, the kernel crash disappears and correctly complains about missing PCC Opregion handler. ACPI Error: No handler for Region [PFRM] ((____ptrval____)) [PCC] (20210730/evregion-130) ACPI Error: Region PCC (ID=10) has no handler (20210730/exfldio-261) ACPI Error: Aborting method \_SB.ETH0._PS3 due to previous error (AE_NOT_EXIST) (20210730/psparse-531) Link: https://github.com/acpica/acpica/commit/41be6afa Signed-off-by: Sudeep Holla Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit 24ea5f90ec9548044a6209685c5010edd66ffe8f Author: Rafael J. Wysocki Date: Wed Dec 22 17:31:05 2021 +0100 ACPICA: Executer: Fix the REFCLASS_REFOF case in acpi_ex_opcode_1A_0T_1R() ACPICA commit d984f12041392fa4156b52e2f7e5c5e7bc38ad9e If Operand[0] is a reference of the ACPI_REFCLASS_REFOF class, acpi_ex_opcode_1A_0T_1R () calls acpi_ns_get_attached_object () to obtain return_desc which may require additional resolution with the help of acpi_ex_read_data_from_field (). If the latter fails, the reference counter of the original return_desc is decremented which is incorrect, because acpi_ns_get_attached_object () does not increment the reference counter of the object returned by it. This issue may lead to premature deletion of the attached object while it is still attached and a use-after-free and crash in the host OS. For example, this may happen when on evaluation of ref_of() a local region field where there is no registered handler for the given Operation Region. Fix it by making acpi_ex_opcode_1A_0T_1R () return Status right away after a acpi_ex_read_data_from_field () failure. Link: https://github.com/acpica/acpica/commit/d984f120 Link: https://github.com/acpica/acpica/pull/685 Reported-by: Lenny Szubowicz Signed-off-by: Rafael J. Wysocki Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit 1cdfe9e346b4c5509ffe19ccde880fd259d9f7a3 Author: Rafael J. Wysocki Date: Wed Dec 22 17:29:45 2021 +0100 ACPICA: Utilities: Avoid deleting the same object twice in a row ACPICA commit c11af67d8f7e3d381068ce7771322f2b5324d687 If original_count is 0 in acpi_ut_update_ref_count (), acpi_ut_delete_internal_obj () is invoked for the target object, which is incorrect, because that object has been deleted once already and the memory allocated to store it may have been reclaimed and allocated for a different purpose by the host OS. Moreover, a confusing debug message following the "Reference Count is already zero, cannot decrement" warning is printed in that case. To fix this issue, make acpi_ut_update_ref_count () return after finding that original_count is 0 and printing the above warning. Link: https://github.com/acpica/acpica/commit/c11af67d Link: https://github.com/acpica/acpica/pull/652 Reported-by: Mark Asselstine Signed-off-by: Rafael J. Wysocki Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit 00395b74d57ff81795ec392627db7e1764c94941 Author: Shuuichirou Ishii Date: Wed Dec 22 17:28:34 2021 +0100 ACPICA: Fix AEST Processor generic resource substructure data field byte length ACPICA commit 13b9327761955f6e1e5dbf748b3112940c0dc539 The byte length of the Data field in the AEST Processor generic resource substructure defined in ACPI for the Armv8 RAS Extensions 1.1 is 4Byte. However, it is defined as a pointer type, and on a 64-bit machine, it is interpreted as 8 bytes. Therefore, it is changed from a pointer type unsigned integer 1 byte to an unsigned integer 4 bytes. Link: https://github.com/acpica/acpica/commit/13b93277 Signed-off-by: Shuuichirou Ishii Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit e4a07f5acd730802ada629d52a29c4873f9826a4 Author: Bob Moore Date: Wed Dec 22 17:25:40 2021 +0100 ACPICA: iASL/Disassembler: Additional support for NHLT table ACPICA commit 0420852ffc520b81960e877852703b739c16025c Added support for Vendor-defined microphone arrays and SNR (signal-to-noise) extension. Link: https://github.com/acpica/acpica/commit/0420852f Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit a3e525feaeec436cd9f82f84e345f0d18dc2638f Author: Jessica Clarke Date: Wed Dec 22 17:24:44 2021 +0100 ACPICA: Avoid subobject buffer overflow when validating RSDP signature ACPICA commit 6bb72909c1e3d415aee214104a01bc9834b2d4ce Since the Signature member is accessed through an struct acpi_table_header, the pointer to it is only to a 4-char array, and so trying to read past the 4th character, as will be done when it is an RSDP, reads beyond the bounds of the accessed member. On CHERI, and thus Arm's experimental Morello prototype architecture, pointers are represented as capabilities, which are unforgeable bounded pointers, providing always-on fine-grained spatial memory safety. By default, subobject bounds enforcement is not enabled, only bounds on allocations, but it is enabled in the cheri_BSD (a port of free_BSD) kernel as intra-object overflow attacks are common on operating system kernels, and so this overflow is detected there and traps. Link: https://github.com/acpica/acpica/commit/6bb72909 Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit 339651be3704f336634d90c000a7778b86e1be99 Author: Jessica Clarke Date: Wed Dec 22 17:23:28 2021 +0100 ACPICA: Macros: Remove ACPI_PHYSADDR_TO_PTR ACPICA commit 52abebd410945ec55afb4dd8b7150e8a39b5c960 This macro was only ever used when stuffing pointers into physical addresses and trying to later reconstruct the pointer, which is implementation-defined as to whether that can be done. Now that all such operations are gone, the macro is unused, and should be removed to avoid such practices being reintroduced. Link: https://github.com/acpica/acpica/commit/52abebd4 Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit 5d6e59665d8bb0f8fa4d47726a93326f8ddfb448 Author: Jessica Clarke Date: Wed Dec 22 17:22:28 2021 +0100 ACPICA: Use original pointer for virtual origin tables ACPICA commit dfa3feffa8f760b686207d09dc880cd2f26c72af Currently the pointer to the table is cast to acpi_physical_address and later cast back to a pointer to be dereferenced. Whether or not this is supported is implementation-defined. On CHERI, and thus Arm's experimental Morello prototype architecture, pointers are represented as capabilities, which are unforgeable bounded pointers, providing always-on fine-grained spatial memory safety. This means that any pointer cast to a plain integer will lose all its associated metadata, and when cast back to a pointer it will give a null-derived pointer (one that has the same metadata as null but an address equal to the integer) that will trap on any dereference. As a result, this is an implementation where acpi_physical_address cannot be used as a hack to store real pointers. Thus, alter the lifecycle of table descriptors. Internal physical tables keep the current behaviour where only the address is set on install, and the pointer is set on acquire. Virtual tables (internal and external) now store the pointer on initialisation and use that on acquire (which will redundantly set *table_ptr to itself, but changing that is both unnecessary and overly complicated as acpi_tb_acquire_table is called with both a pointer to a variable and a pointer to Table->Pointer itself). This requires propagating the (possible) table pointer everywhere in order to make sure pointers make it through to acpi_tb_acquire_temp_table, which requires a change to the acpi_install_table interface. Instead of taking an ACPI_PHYSADDR_TYPE and a boolean indicating whether it's physical or virtual, it is now split into acpi_install_table (that takes an external virtual table pointer) and acpi_install_physical_table (that takes an ACPI_PHYSADDR_TYPE for an internal physical table address). This also has the benefit of providing a cleaner API. Link: https://github.com/acpica/acpica/commit/dfa3feff Signed-off-by: Bob Moore [ rjw: Adjust the code in tables.c to match interface changes ] Signed-off-by: Rafael J. Wysocki commit ca25f92b72d25457653dbf2a81f322235804fb05 Author: Jessica Clarke Date: Wed Dec 22 17:21:25 2021 +0100 ACPICA: Use original data_table_region pointer for accesses ACPICA commit d9eb82bd7515989f0b29d79deeeb758db4d6529c Currently the pointer to the table is cast to acpi_physical_address and later cast back to a pointer to be dereferenced. Whether or not this is supported is implementation-defined. On CHERI, and thus Arm's experimental Morello prototype architecture, pointers are represented as capabilities, which are unforgeable bounded pointers, providing always-on fine-grained spatial memory safety. This means that any pointer cast to a plain integer will lose all its associated metadata, and when cast back to a pointer it will give a null-derived pointer (one that has the same metadata as null but an address equal to the integer) that will trap on any dereference. As a result, this is an implementation where acpi_physical_address cannot be used as a hack to store real pointers. Thus, add a new field to struct acpi_object_region to store the pointer for table regions, and propagate it to acpi_ex_data_table_space_handler via the region context, to use a more portable implementation that supports CHERI. Link: https://github.com/acpica/acpica/commit/d9eb82bd Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit f81bdeaf816142e0729eea0cc84c395ec9673151 Author: Mark Langsdorf Date: Wed Dec 22 16:57:34 2021 +0100 ACPICA: actypes.h: Expand the ACPI_ACCESS_ definitions ACPICA commit bc02c76d518135531483dfc276ed28b7ee632ce1 The current ACPI_ACCESS_*_WIDTH defines do not provide a way to test that size is small enough to not cause an overflow when applied to a 32-bit integer. Rather than adding more magic numbers, add ACPI_ACCESS_*_SHIFT, ACPI_ACCESS_*_MAX, and ACPI_ACCESS_*_DEFAULT #defines and redefine ACPI_ACCESS_*_WIDTH in terms of the new #defines. This was inititally reported on Linux where a size of 102 in ACPI_ACCESS_BIT_WIDTH caused an overflow error in the SPCR initialization code. Link: https://github.com/acpica/acpica/commit/bc02c76d Signed-off-by: Mark Langsdorf Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki commit 702f21db4995f2784b4d24d3517ba1c6e938a464 Merge: fc74e0a40e4f9 4667431419e93 Author: Rafael J. Wysocki Date: Mon Dec 27 16:54:09 2021 +0100 Merge tag 'devfreq-next-for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux Pull devfreq updates for 5.17-rc1 from Chanwoo Choi: "1. Add new DRAM controller driver for sunXi SoCs - Add DRAM frequency controller devfreq driver for Allwinner sunXi SoCs in order to support dynamic frequency scaling of DRAM frequency. It calculates the supported frequency list from source clock in the range of full speed to quarter speed instead of devicetree. - Add COMMON_CLK dependency to fix build error 2. Reduce log severity for informative message about frequency transition failures" * tag 'devfreq-next-for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux: PM / devfreq: Reduce log severity for informative message PM / devfreq: sun8i: addd COMMON_CLK dependency PM / devfreq: Add a driver for the sun8i/sun50i MBUS commit 36fd3609d0dd768404c205c805893e63e078d201 Merge: b8470e98e192a 86ffed3de3acb Author: Rafael J. Wysocki Date: Mon Dec 27 16:51:12 2021 +0100 Merge back earlier power capping changes for v5.17 commit b8470e98e192a19a2ac9e32943557d7be3be4c46 Merge: a7904a538933c c1af85e442278 Author: Rafael J. Wysocki Date: Mon Dec 27 16:50:06 2021 +0100 Merge tag 'dtpm-v5.17' of https://git.linaro.org/people/daniel.lezcano/linux Pull DTPM (Dynamic Thermal Power Management) changes for 5.17-rc1 from Daniel Lezcano: - Clean up and reduce trace verbosity (Daniel Lezcano) * tag 'dtpm-v5.17' of https://git.linaro.org/people/daniel.lezcano/linux: powercap/drivers/dtpm: Reduce trace verbosity powercap/drivers/dtpm: Remove unused function definition commit 125521addcd685af81b4734e82db14c156da4b50 Merge: 3f0bb496ee41d 8ee1c0f6526ce Author: Rafael J. Wysocki Date: Mon Dec 27 16:42:30 2021 +0100 Merge tag 'thermal-v5.17-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux Pull thermal control material for 5.17-rc1 from Daniel Lezcano: - Fix PM issue on the iMX driver when suspend/resume is happening by implementing PM runtime support (Oleksij Rempel) - Add 'const' annotation to the thermal_cooling_ops in the Intel powerclamp driver (Rikard Falkeborn) - Add TSU driver and bindings for the RZ/G2L platform (Biju Das) - Fix missing ADC bit set on iMX8MP to enable the sensor (Paul Gerber) - Fix missing check when calling reset_control_deassert() (Biju Das) * tag 'thermal-v5.17-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux: thermal/drivers/rz2gl: Add error check for reset_control_deassert() thermal/drivers/imx8mm: Enable ADC when enabling monitor thermal/drivers: Add TSU driver for RZ/G2L dt-bindings: thermal: Document Renesas RZ/G2L TSU thermal/drivers/intel_powerclamp: Constify static thermal_cooling_device_ops thermal/drivers/imx: Implement runtime PM support commit 3f0bb496ee41d0eb99d308768c9f8593cbd3eb9f Merge: d7fbdc575b33c 9c33eef84e311 Author: Rafael J. Wysocki Date: Mon Dec 27 16:35:44 2021 +0100 Merge branches 'thermal-tools' and 'thermal-int340x' Merge tmon fix and int340x driver improvement for 5.17-rc1. * thermal-tools: thermal: tools: tmon: remove unneeded local variable * thermal-int340x: thermal: int340x: Use struct_group() for memcpy() region commit b4aadd207322d243c3ceef107c495117898a36f1 Author: Wen Zhiwei Date: Mon Dec 27 16:22:01 2021 +0800 net:Remove initialization of static variables to 0 Delete the initialization of three static variables because it is meaningless. Signed-off-by: Wen Zhiwei Signed-off-by: David S. Miller commit fd3a459000557ff12c1d4b41f1bd30f439f6c942 Author: Remi Pommarel Date: Fri Dec 24 12:46:40 2021 +0100 net: bridge: Get SIOCGIFBR/SIOCSIFBR ioctl working in compat mode In compat mode SIOC{G,S}IFBR ioctls were only supporting BRCTL_GET_VERSION returning an artificially version to spur userland tool to use SIOCDEVPRIVATE instead. But some userland tools ignore that and use SIOC{G,S}IFBR unconditionally as seen with busybox's brctl. Example of non working 32-bit brctl with CONFIG_COMPAT=y: $ brctl show brctl: SIOCGIFBR: Invalid argument Example of fixed 32-bit brctl with CONFIG_COMPAT=y: $ brctl show bridge name bridge id STP enabled interfaces br0 Signed-off-by: Remi Pommarel Co-developed-by: Arnd Bergmann Signed-off-by: Arnd Bergmann Acked-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit 32f52e8e78d3350e3e74985b0314ba15cea3bc8d Author: Lad Prabhakar Date: Fri Dec 24 19:26:26 2021 +0000 net: ethernet: ti: davinci_emac: Use platform_get_irq() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq() for DT users only. While at it propagate error code in case request_irq() fails instead of returning -EBUSY. Signed-off-by: Lad Prabhakar Signed-off-by: David S. Miller commit 7801302b9a01ff69fd33d53a7601da1e9bacde2f Author: Lad Prabhakar Date: Fri Dec 24 19:26:23 2021 +0000 net: xilinx: emaclite: Use platform_get_irq() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Signed-off-by: Lad Prabhakar Signed-off-by: David S. Miller commit 6c119fbdb805499308b1d395ed36649aedb198ca Author: Lad Prabhakar Date: Fri Dec 24 19:26:22 2021 +0000 net: ethoc: Use platform_get_irq() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Signed-off-by: Lad Prabhakar Signed-off-by: David S. Miller commit 441faddaadd7343d98e97725e3de265838fe32b8 Author: Lad Prabhakar Date: Fri Dec 24 19:26:21 2021 +0000 fsl/fman: Use platform_get_irq() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). While doing so return error pointer from read_dts_node() as platform_get_irq() may return -EPROBE_DEFER. Signed-off-by: Lad Prabhakar Signed-off-by: David S. Miller commit f83b4348116d2345ec8e3294c19c5c5306917efa Author: Lad Prabhakar Date: Fri Dec 24 19:26:20 2021 +0000 net: pxa168_eth: Use platform_get_irq() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Signed-off-by: Lad Prabhakar Signed-off-by: David S. Miller commit c0032d6e87d63676e982c8e44e080f703a2d66b7 Author: Lad Prabhakar Date: Fri Dec 24 19:26:19 2021 +0000 ethernet: netsec: Use platform_get_irq() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Signed-off-by: Lad Prabhakar Signed-off-by: David S. Miller commit f4dd5174e2739ab0aeda14b32847e587e78ff3d9 Author: Kai-Heng Feng Date: Fri Dec 24 16:19:14 2021 +0800 net: wwan: iosm: Keep device at D0 for s2idle case We are seeing spurious wakeup caused by Intel 7560 WWAN on AMD laptops. This prevent those laptops to stay in s2idle state. >From what I can understand, the intention of ipc_pcie_suspend() is to put the device to D3cold, and ipc_pcie_suspend_s2idle() is to keep the device at D0. However, the device can still be put to D3hot/D3cold by PCI core. So explicitly let PCI core know this device should stay at D0, to solve the spurious wakeup. Signed-off-by: Kai-Heng Feng Signed-off-by: David S. Miller commit 8f58e29ed7fc37d3ca3e86668e63250a53f51fd7 Author: Kai-Heng Feng Date: Fri Dec 24 16:19:13 2021 +0800 net: wwan: iosm: Let PCI core handle PCI power transition pci_pm_suspend_noirq() and pci_pm_resume_noirq() already handle power transition for system-wide suspend and resume, so it's not necessary to do it in the driver. Signed-off-by: Kai-Heng Feng Signed-off-by: David S. Miller commit 0c94d657d2a416c861df4789fd310f09f5dfad59 Author: Horatiu Vultur Date: Thu Dec 23 15:01:13 2021 +0100 net: lan966x: Fix the vlan used by host ports The blamed commit changed the vlan used by the host ports to be 4095 instead of 0. Because of this change the following issues are seen: - when the port is probed first it was adding an entry in the MAC table with the wrong vlan (port->pvid which is default 0) and not HOST_PVID - when the port is removed from a bridge, it was using the wrong vlan to add entries in the MAC table. It was using the old PVID and not the HOST_PVID This patch fixes this two issues by using the HOST_PVID instead of port->pvid. Fixes: 6d2c186afa5d5d ("net: lan966x: Add vlan support.") Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 099eac91bcda67bde5dc7db158a7c42a1dba4d51 Merge: 7c63f26cb518f 720908e5f816d Author: David S. Miller Date: Mon Dec 27 12:00:29 2021 +0000 Merge branch 'bnxt_en-next' Michael Chan says: ==================== bnxt_en: Update for net-next This series includes some added error logging for firmware error reports, DIM interrupt sampling for the latest 5750X chips, CQE interrupt coalescing mode support, and to use RX page frag buffers for better software GRO performance. ==================== Signed-off-by: David S. Miller commit 720908e5f816d56579e098e32bd3b56bad2be8f0 Author: Jakub Kicinski Date: Mon Dec 27 03:00:32 2021 -0500 bnxt_en: Use page frag RX buffers for better software GRO performance If NETIF_F_GRO_HW is disabled, the existing driver code uses kmalloc'ed data for RX buffers. This causes inefficient SW GRO performance because the GRO data is merged using the less efficient frag_list. Use netdev_alloc_frag() and friends instead so that GRO data can be merged into skb_shinfo(skb)->frags for better performance. [Use skb_free_frag() - Vikas Gupta] Signed-off-by: Jakub Kicinski Reviewed-by: Pavan Chebbi Reviewed-by: Andy Gospodarek Signed-off-by: Vikas Gupta Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit b976969bed83e90fffb9e750e1d1562956500cd9 Author: Edwin Peer Date: Mon Dec 27 03:00:31 2021 -0500 bnxt_en: convert to xdp_do_flush The xdp_do_flush_map function has been replaced with the more general xdp_do_flush(). Signed-off-by: Edwin Peer Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 3fcbdbd5d8d51d14ad5687a253990e89da9b7661 Author: Michael Chan Date: Mon Dec 27 03:00:30 2021 -0500 bnxt_en: Support CQE coalescing mode in ethtool Support showing and setting the CQE mode in ethtool. Reviewed-by: Edwin Peer Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit df78ea22460b6c625bd2079686bec0d834e56946 Author: Michael Chan Date: Mon Dec 27 03:00:29 2021 -0500 bnxt_en: Support configurable CQE coalescing mode CQE coalescing mode is the same as the timer reset coalescing mode on Broadcom devices. Currently this mode is always enabled if it is supported by the device. Restructure the code slightly to support dynamically changing this mode. Add a flags field to struct bnxt_coal. Initially, the CQE flag will be set for the RX and TX side if the device supports it. We need to move bnxt_init_dflt_coal() to set up default coalescing until the capability is determined. Reviewed-by: Andy Gospodarek Reviewed-by: Edwin Peer Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit dc1f5d1ebc5c7f70cd352b2b71097f972b244c94 Author: Andy Gospodarek Date: Mon Dec 27 03:00:28 2021 -0500 bnxt_en: enable interrupt sampling on 5750X for DIM 5750X (P5) chips handle receiving packets on the NQ rather than the main completion queue so we need to get and set stats from the correct spots for dynamic interrupt moderation. Signed-off-by: Andy Gospodarek Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 0fb8582ae5b9bf0dc5a4fededabe7db16a8b430a Author: Michael Chan Date: Mon Dec 27 03:00:27 2021 -0500 bnxt_en: Log error report for dropped doorbell Log the unrecognized error report type value as well. Reviewed-by: Andy Gospodarek Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 5a717f4a8e00f563962b736961a12b6798c839a0 Author: Somnath Kotur Date: Mon Dec 27 03:00:26 2021 -0500 bnxt_en: Add event handler for PAUSE Storm event FW has been modified to send a new async event when it detects a pause storm. Register for this new event and log it upon receipt. Reviewed-by: Andy Gospodarek Reviewed-by: Edwin Peer Signed-off-by: Somnath Kotur Signed-off-by: Michael Chan Signed-off-by: David S. Miller commit 09d976b3e8e257ff44405b6506bbaae6be1a6b3c Author: Swapnil Jakhade Date: Thu Dec 23 07:01:37 2021 +0100 phy: cadence: Sierra: Add support for derived reference clock output Sierra has derived differential reference clock output which is sourced after the spread spectrum generation has been added. Add support to drive derived reference clock out of serdes. Model this derived clock as a "clock" so that platforms using this can enable it. Sierra Main LC VCO PLL divider 1 clock is programmed to output 100MHz clock output. Signed-off-by: Swapnil Jakhade Reviewed-by: Aswath Govindraju Link: https://lore.kernel.org/r/20211223060137.9252-16-sjakhade@cadence.com Signed-off-by: Vinod Koul commit 637feefb8ac53fbe1147edb707b03dc09839fdf5 Author: Swapnil Jakhade Date: Thu Dec 23 07:01:36 2021 +0100 dt-bindings: phy: cadence-sierra: Add clock ID for derived reference clock Add clock ID for Sierra derived reference clock. Signed-off-by: Swapnil Jakhade Acked-by: Rob Herring Link: https://lore.kernel.org/r/20211223060137.9252-15-sjakhade@cadence.com Signed-off-by: Vinod Koul commit 8a1b82d744a97949f13acee6644b19eb3b5a4102 Author: Swapnil Jakhade Date: Thu Dec 23 07:01:35 2021 +0100 phy: cadence: Sierra: Add PCIe + QSGMII PHY multilink configuration Add register sequences for PCIe + QSGMII PHY multilink configuration. PHY configuration for multi-link operation is done in two steps. e.g. Consider a case for a 4 lane PHY with PCIe using 2 lanes and QSGMII other 2 lanes. Sierra PHY has 2 PLLs, viz. PLLLC and PLLLC1. So in this case, PLLLC is used for PCIe and PLLLC1 is used for QSGMII. PHY is configured in two steps as described below. [1] For first step, the register values are selected as [TYPE_PCIE][TYPE_QSGMII][ssc]. This will configure PHY registers associated for PCIe involving PLLLC registers and registers for first 2 lanes of PHY. [2] In second step, the register values are selected as [TYPE_QSGMII][TYPE_PCIE][ssc]. This will configure PHY registers associated for QSGMII involving PLLLC1 registers and registers for other 2 lanes of PHY. This completes the PHY configuration for multilink operation. Signed-off-by: Swapnil Jakhade Reviewed-by: Aswath Govindraju Link: https://lore.kernel.org/r/20211223060137.9252-14-sjakhade@cadence.com Signed-off-by: Vinod Koul commit 6b81f05a8755a63d1acbcc1604f1e0f4534d36d8 Author: Swapnil Jakhade Date: Thu Dec 23 07:01:34 2021 +0100 phy: cadence: Sierra: Add support for PHY multilink configurations Add support for multilink configuration of Sierra PHY. Currently, maximum two links are supported. Signed-off-by: Swapnil Jakhade Reviewed-by: Aswath Govindraju Link: https://lore.kernel.org/r/20211223060137.9252-13-sjakhade@cadence.com Signed-off-by: Vinod Koul commit da08aab940092a050a4fb2857ed9479d2b0e03c4 Author: Swapnil Jakhade Date: Thu Dec 23 07:01:33 2021 +0100 phy: cadence: Sierra: Fix to get correct parent for mux clocks Fix get_parent() callback to return the correct index of the parent for PLL_CMNLC1 clock. Add a separate table of register values corresponding to the parent index for PLL_CMNLC1. Update set_parent() callback accordingly. Fixes: 28081b72859f ("phy: cadence: Sierra: Model PLL_CMNLC and PLL_CMNLC1 as clocks (mux clocks)") Signed-off-by: Swapnil Jakhade Reviewed-by: Aswath Govindraju Link: https://lore.kernel.org/r/20211223060137.9252-12-sjakhade@cadence.com Signed-off-by: Vinod Koul commit 7a5ad9b4b98cd95f02ec12c895e80bc521fbf9ec Author: Swapnil Jakhade Date: Thu Dec 23 07:01:32 2021 +0100 phy: cadence: Sierra: Update single link PCIe register configuration Add single link PCIe register configurations for no SSC and internal SSC. Also, add missing PMA lane registers for external SSC. Signed-off-by: Swapnil Jakhade Reviewed-by: Aswath Govindraju Link: https://lore.kernel.org/r/20211223060137.9252-11-sjakhade@cadence.com Signed-off-by: Vinod Koul commit 36ce416330da5b27d84af519f61e94b73596a297 Author: Swapnil Jakhade Date: Thu Dec 23 07:01:31 2021 +0100 phy: cadence: Sierra: 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 Reviewed-by: Aswath Govindraju Link: https://lore.kernel.org/r/20211223060137.9252-10-sjakhade@cadence.com Signed-off-by: Vinod Koul commit f1cc6c3f082c3d84d73c67a39407ff71210bcb49 Author: Swapnil Jakhade Date: Thu Dec 23 07:01:30 2021 +0100 phy: cadence: Sierra: Check cmn_ready assertion during PHY power on Check if PMA cmn_ready is set indicating the startup process is complete. Signed-off-by: Swapnil Jakhade Reviewed-by: Aswath Govindraju Link: https://lore.kernel.org/r/20211223060137.9252-9-sjakhade@cadence.com Signed-off-by: Vinod Koul commit fa10517211f72f9480677796b97cbe5a8f3a298f Author: Swapnil Jakhade Date: Thu Dec 23 07:01:29 2021 +0100 phy: cadence: Sierra: Add PHY PCS common register configurations Add PHY PCS common register configuration sequences for single link. Update single link PCIe register sequence accordingly. Signed-off-by: Swapnil Jakhade Reviewed-by: Aswath Govindraju Link: https://lore.kernel.org/r/20211223060137.9252-8-sjakhade@cadence.com Signed-off-by: Vinod Koul commit 8c95e1722689f1b1e63a6206acba2b6200ed7864 Author: Swapnil Jakhade Date: Thu Dec 23 07:01:28 2021 +0100 phy: cadence: Sierra: Rename some regmap variables to be in sync with Sierra documentation No functional change. Rename some regmap variables as mentioned in Sierra register description documentation. Signed-off-by: Swapnil Jakhade Reviewed-by: Aswath Govindraju Link: https://lore.kernel.org/r/20211223060137.9252-7-sjakhade@cadence.com Signed-off-by: Vinod Koul commit 1e902b2ae3e9c0873d38b415b2af0811b4897ad4 Author: Swapnil Jakhade Date: Thu Dec 23 07:01:27 2021 +0100 phy: cadence: Sierra: Add support to get SSC type from device tree Add support to get SSC type from DT. Signed-off-by: Swapnil Jakhade Reviewed-by: Aswath Govindraju Link: https://lore.kernel.org/r/20211223060137.9252-6-sjakhade@cadence.com Signed-off-by: Vinod Koul commit 262303b92945f4d05bec78ead17f5c7c0d098d54 Author: Swapnil Jakhade Date: Thu Dec 23 07:01:26 2021 +0100 dt-bindings: phy: cadence-sierra: Add binding to specify SSC mode Add binding to specify Spread Spectrum Clocking mode used. Signed-off-by: Swapnil Jakhade Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211223060137.9252-5-sjakhade@cadence.com Signed-off-by: Vinod Koul commit 253f06c7b1c1729b50e7ec52638e046239327bb1 Author: Swapnil Jakhade Date: Thu Dec 23 07:01:25 2021 +0100 dt-bindings: phy: cadence-torrent: Rename SSC macros to use generic names Rename SSC macros to use generic names instead of PHY specific names, so that they can be used to specify SSC modes for both Torrent and Sierra. Renaming the macros should not affect the things as these are not being used in any DTS file yet. Signed-off-by: Swapnil Jakhade Acked-by: Rob Herring Link: https://lore.kernel.org/r/20211223060137.9252-4-sjakhade@cadence.com Signed-off-by: Vinod Koul commit 078e9e92119ae39e5c816242a7a5cf73b3cc4f5c Author: Swapnil Jakhade Date: Thu Dec 23 07:01:24 2021 +0100 phy: cadence: Sierra: Prepare driver to add support for multilink configurations Sierra driver currently supports single link configurations only. Prepare driver to support multilink multiprotocol configurations along with different SSC modes. Signed-off-by: Swapnil Jakhade Reviewed-by: Aswath Govindraju Link: https://lore.kernel.org/r/20211223060137.9252-3-sjakhade@cadence.com Signed-off-by: Vinod Koul commit c3c11d5534343e56ce8f4eb8cadfabe455150e3d Author: Swapnil Jakhade Date: Thu Dec 23 07:01:23 2021 +0100 phy: cadence: Sierra: Use of_device_get_match_data() to get driver data Use of_device_get_match_data() to get driver data instead of boilerplate code. Signed-off-by: Swapnil Jakhade Reviewed-by: Aswath Govindraju Link: https://lore.kernel.org/r/20211223060137.9252-2-sjakhade@cadence.com Signed-off-by: Vinod Koul commit 399c91c3f30531593e5ff6ca7b53f47092128669 Author: Miaoqian Lin Date: Fri Dec 24 08:21:03 2021 +0000 phy: mediatek: Fix missing check in mtk_mipi_tx_probe The of_device_get_match_data() function may return NULL. Add check to prevent potential null dereference. Signed-off-by: Miaoqian Lin Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20211224082103.7658-1-linmq006@gmail.com Signed-off-by: Vinod Koul commit c65fe9cbbfd61dbc12868f9ed4940c80fcb249e8 Author: Ville Syrjälä Date: Thu Dec 16 13:08:22 2021 +0200 drm/i915/fbc: Remember to update FBC state even when not reallocating CFB We mustn't forget to update our FBC state even if we don't have to reallocate the CFB. Otherwise we won't refresh our notion of what eg. the new fence or the new override CFB stride should be. Using the wrong CFB stride in particular can cause underruns and could even corrupt other stuff in stolen. Fixes: f4cfdbb02ca8 ("drm/i915/fbc: Nuke state_cache") Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/4774 Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211216110822.8461-1-ville.syrjala@linux.intel.com Reviewed-by: Mika Kahola (cherry picked from commit 798c5daf3cddff3f39c5542a50a2dbd83879b05d) Signed-off-by: Jani Nikula commit ee6d3dd4ed48ab24b74bab3c3977b8218518247d Author: Wedson Almeida Filho Date: Fri Dec 24 23:13:45 2021 +0000 driver core: make kobj_type constant. This way instances of kobj_type (which contain function pointers) can be stored in .rodata, which means that they cannot be [easily/accidentally] modified at runtime. Signed-off-by: Wedson Almeida Filho Link: https://lore.kernel.org/r/20211224231345.777370-1-wedsonaf@google.com Signed-off-by: Greg Kroah-Hartman commit 43aa323e315bec40779fe2899f7b531773d7b733 Author: Alexander Usyskin Date: Thu Dec 23 11:47:05 2021 +0200 mei: cleanup status before client dma setup call The upper layer may retry call to mei_cl_dma_alloc_and_map(), in that case the client status may be non-zero after the previous call and the wait condition will be true immediately. Set cl->status to zero to allow waiting for an actual result from the firmware. Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler Link: https://lore.kernel.org/r/20211223094705.204624-2-tomas.winkler@intel.com Signed-off-by: Greg Kroah-Hartman commit 38be5687da839bfcafeabb34a5a21e8396613ce3 Author: Alexander Usyskin Date: Thu Dec 23 11:47:04 2021 +0200 mei: add POWERING_DOWN into device state print The POWERING_DOWN state string was missing from the device states list, add it. Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler Link: https://lore.kernel.org/r/20211223094705.204624-1-tomas.winkler@intel.com Signed-off-by: Greg Kroah-Hartman commit 651425fb24b2152637685886fab9108cda9096a7 Merge: 372c73b469e4d ce80098db2439 Author: Greg Kroah-Hartman Date: Mon Dec 27 10:28:13 2021 +0100 Merge tag 'misc-habanalabs-next-2021-12-27' 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.17: - Support reset-during-reset. In case the f/w notifies the driver that the f/w is going to reset the device, the driver should support that even if it is in the middle of doing another reset - Support events from f/w that arrive during device resets. These events would be ignored which is bad as critical errors would not be reported and treated by the driver. - Don't kill processes that hold the control device open during hard-reset of the device. The control device operations can't crash if done during hard-reset. And usually, only monitoring applications are using the control device, so killing them defies their purpose. - Fix handling of hwmon nodes when working with legacy f/w - Change the compute context pointer to be boolean. This pointer was abused by multiple code paths that wanted fast access to the compute context structure. - Add uapi to fetch historical errors. This is necessary as errors sometimes result in hard-reset where the user application is being terminated. - Optimize GAUDI's MMU cache invalidation. - Add support for loading the latest f/w. - Add uapi to fetch HBM replacement and pending rows information. - Multiple bug fixes to the reset code. - Multiple bug fixes for Multi-CS ioctl code. - Multiple bug fixes for wait-for-interrupt ioctl code. - Many small bug fixes and cleanups. * tag 'misc-habanalabs-next-2021-12-27' of https://git.kernel.org/pub/scm/linux/kernel/git/ogabbay/linux: (70 commits) habanalabs: support hard-reset scheduling during soft-reset habanalabs: add a lock to protect multiple reset variables habanalabs: refactor reset information variables habanalabs: handle skip multi-CS if handling not done habanalabs: add CPU-CP packet for engine core ASID cfg habanalabs: replace some -ENOTTY with -EINVAL habanalabs: fix comments according to kernel-doc habanalabs: fix endianness when reading cpld version habanalabs: change wait_for_interrupt implementation habanalabs: prevent wait if CS in multi-CS list completed habanalabs: modify cpu boot status error print habanalabs: clean MMU headers definitions habanalabs: expose soft reset sysfs nodes for inference ASIC habanalabs: sysfs support for two infineon versions habanalabs: keep control device alive during hard reset habanalabs: fix hwmon handling for legacy f/w habanalabs: add current PI value to cpu packets habanalabs: remove in_debug check in device open habanalabs: return correct clock throttling period habanalabs: wait again for multi-CS if no CS completed ... commit 372c73b469e4d519d5cac7b52defa202668ba8d3 Merge: 1bc4deedc2d8c 2da3db7f498d8 Author: Greg Kroah-Hartman Date: Mon Dec 27 10:27:01 2021 +0100 Merge tag 'extcon-next-for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon into char-misc-next Chanwoo writes: Update extcon next for v5.17 Detailed description for this pull request: 1. Remove duplicate code in extcon_set_state_sync() in extcon core 2. Fix non-kernel-doc comment for extcon-usb-gpio.c * tag 'extcon-next-for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon: extcon: Deduplicate code in extcon_set_state_sync() extcon: usb-gpio: fix a non-kernel-doc comment commit 1bc4deedc2d8c2615feb5c9fa5eb93a9ac38ebe7 Merge: 1bb866dcb8cf5 01f8938ad036e Author: Greg Kroah-Hartman Date: Mon Dec 27 10:23:35 2021 +0100 Merge tag 'icc-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc into char-misc-next Georgi writes: interconnect changes for 5.17 Here are the interconnect changes for the 5.17-rc1 merge window consisting of new drivers, minor changes and fixes. New drivers: - New driver for MSM8996 platforms - New driver for SC7280 EPSS L3 hardware - New driver for QCM2290 platforms - New driver for SM8450 platforms Driver changes: - dt-bindings: interconnect: Combine SDM660 bindings into RPM schema - icc-rpm: Add support for bus power domain - icc-rpm: Use NOC_QOS_MODE_INVALID for qos_mode check - icc-rpm: Define ICC device type - icc-rpm: Add QNOC type QoS support - icc-rpm: Support child NoC device probe - icc-rpm: Prevent integer overflow in rate - icc-rpmh: Add BCMs to commit list in pre_aggregate Signed-off-by: Georgi Djakov * tag 'icc-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/djakov/icc: interconnect: qcom: Add QCM2290 driver support dt-bindings: interconnect: Add Qualcomm QCM2290 NoC support interconnect: icc-rpm: Support child NoC device probe interconnect: icc-rpm: Add QNOC type QoS support interconnect: icc-rpm: Define ICC device type interconnect: qcom: Add SM8450 interconnect provider driver dt-bindings: interconnect: Add Qualcomm SM8450 DT bindings interconnect: qcom: rpm: Prevent integer overflow in rate interconnect: icc-rpm: Use NOC_QOS_MODE_INVALID for qos_mode check interconnect: qcom: icc-rpmh: Add BCMs to commit list in pre_aggregate interconnect: qcom: Add MSM8996 interconnect provider driver dt-bindings: interconnect: Add Qualcomm MSM8996 DT bindings interconnect: icc-rpm: Add support for bus power domain dt-bindings: interconnect: Combine SDM660 bindings into RPM schema interconnect: qcom: Add EPSS L3 support on SC7280 dt-bindings: interconnect: Add EPSS L3 DT binding on SC7280 commit 489a00ef46c93e85ed540d91836317cc469371ac Author: Tang Yizhou Date: Sun Dec 26 16:18:39 2021 +0800 Documentation: power: Update outdated contents in opp.rst Three problems have been revised: 1. CONFIG_PM_OPP no longer depends on CONFIG_PM. 2. opp_find_freq_{ceil, floor} is renamed as dev_pm_opp_find_freq_{ceil, floor}. 3. Make it clear that the 'opp' struct is actually dev_pm_opp. Signed-off-by: Tang Yizhou Signed-off-by: Viresh Kumar commit d776790a55367b9313d03c364c04ff47e7f5ea83 Author: Hector.Yuan Date: Fri Oct 29 19:42:23 2021 +0800 cpufreq: mediatek-hw: Fix double devm_remap in hotplug case When hotpluging policy cpu, cpu policy init will be called multiple times. Unplug CPU7 -> CPU6 -> CPU5 -> CPU4, then plug CPU4 again. In this case, devm_remap will double remap and resource allocate fail. So replace devm_remap to ioremap and release resources in cpu policy exit. Signed-off-by: Hector.Yuan Signed-off-by: Viresh Kumar commit 565210c7812013aac7969320ac5b86fff7a74cc6 Author: Armin Wolf Date: Tue Dec 21 17:28:05 2021 +0100 hwmon: (dell-smm) Pack the whole smm_regs struct When desiring the whole struct to be packed, __packed should be applied to the whole struct, not just every struct member except the first one. Tested on a Dell Inspiron 3505. Signed-off-by: Armin Wolf Link: https://lore.kernel.org/r/20211221162805.104202-1-W_Armin@gmx.de Signed-off-by: Guenter Roeck commit 20f2e67cbc7599217d5a764c76e9c2bbe85e3761 Author: Denis Pauk Date: Sat Dec 18 22:52:06 2021 +0200 hwmon: (nct6775) Additional check for ChipID before ASUS WMI usage WMI monitoring methods can be changed or removed in new ASUS boards BIOS versions. Such versions return zero instead of a real one as Chip ID. Commit adds additional validation for the result of Chip ID call before enabling access by ASUS WMI methods. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=204807 Signed-off-by: Denis Pauk Link: https://lore.kernel.org/r/20211218205206.615865-1-pauk.denis@gmail.com Signed-off-by: Guenter Roeck commit a8d6d4992ad9d92356619ac372906bd29687bb46 Author: Arseny Demidov Date: Sun Dec 19 13:22:39 2021 +0300 hwmon: (mr75203) fix wrong power-up delay value In the file mr75203.c we have a macro named POWER_DELAY_CYCLE_256, the correct value should be 0x100. The register ip_tmr is expressed in units of IP clk cycles, in accordance with the datasheet. Typical power-up delays for Temperature Sensor are 256 cycles i.e. 0x100. Fixes: 9d823351a337 ("hwmon: Add hardware monitoring driver for Moortec MR75203 PVT controller") Signed-off-by: Arseny Demidov Link: https://lore.kernel.org/r/20211219102239.1112-1-a.demidov@yadro.com Signed-off-by: Guenter Roeck commit 23c7df14f696dd64c691be34368c835cfac5017e Author: Colin Ian King Date: Mon Dec 20 15:55:27 2021 +0000 hwmon/pmbus: (ir38064) Fix spelling mistake "comaptible" -> "compatible" There is a spelling mistake in the module description, fix it. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20211220155527.179125-1-colin.i.king@gmail.com Signed-off-by: Guenter Roeck commit 0ee7f624263e6492b5e541c86b0fc716349da7bf Author: Patrick Rudolph Date: Mon Dec 13 15:28:14 2021 +0100 hwmon/pmbus: (ir38064) Expose a regulator The chip series supported by this driver are voltage regulators, so expose them to the regulator subsystem. Signed-off-by: Patrick Rudolph Link: https://lore.kernel.org/r/20211213142814.264802-4-arthur.heymans@9elements.com [groeck: Added brief patch description] Signed-off-by: Guenter Roeck commit e65de225ef2f7eade2888b00970eec37aeca0044 Author: Arthur Heymans Date: Mon Dec 13 15:28:13 2021 +0100 hwmon/pmbus: (ir38064) Add of_match_table Add the missing of_match_table to allow device tree probing. Signed-off-by: Arthur Heymans Link: https://lore.kernel.org/r/20211213142814.264802-3-arthur.heymans@9elements.com Signed-off-by: Guenter Roeck commit ca003af3aa1574646b784abee861626a52d345ea Author: Patrick Rudolph Date: Mon Dec 13 15:28:12 2021 +0100 hwmon/pmbus: (ir38064) Add support for IR38060, IR38164 IR38263 The IR38060, IR38164 and IR38263 can be supported using this driver. Signed-off-by: Patrick Rudolph Signed-off-by: Arthur Heymans Link: https://lore.kernel.org/r/20211213142814.264802-2-arthur.heymans@9elements.com Signed-off-by: Guenter Roeck commit 53e68c20aeb1e23419bed811aa3a309ceda200f9 Author: Aleksandr Mezin Date: Sun Oct 31 09:30:58 2021 +0600 hwmon: add driver for NZXT RGB&Fan Controller/Smart Device v2. This driver implements monitoring and control of fans plugged into the device. Besides typical speed monitoring and PWM duty cycle control, voltage and current are reported for every fan. The device also has 2 connectors for RGB LEDs, support for them isn't implemented (mainly because there is no standardized sysfs interface). Also, the device has a noise sensor, but the sensor seems to be completely useless (and very imprecise), so support for it isn't implemented too. The driver coexists with userspace tools that access the device through hidraw interface with no known issues. The driver has been tested on x86_64, built in and as a module. Some changes/improvements were suggested by Jonas Malaco. Signed-off-by: Aleksandr Mezin Link: https://lore.kernel.org/r/20211031033058.151014-1-mezin.alexander@gmail.com Signed-off-by: Guenter Roeck commit 1e7c94b251d15e01e8dd13940d544c865467e339 Author: Denis Pauk Date: Sat Dec 11 20:00:36 2021 +0200 hwmon: (nct6775) add ROG STRIX B550-A/X570-I GAMING ASUS ROG STRIX B550-A/X570-I GAMING boards have got an nct6775 chip, but by default there's no use of it because of resource conflict with WMI method. This commit adds "ROG STRIX B550-A GAMING" and "ROG STRIX X570-I GAMING" to the list of boards that can be monitored using ASUS WMI. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=204807 Signed-off-by: Denis Pauk Tested-by: Daniel Gibson Tested-by: Michael Altizer Tested-by: Mikhail Gavrilov Link: https://lore.kernel.org/r/20211211180037.367062-1-pauk.denis@gmail.com Signed-off-by: Guenter Roeck commit e1c5cd7e8af0f50a1deb15369b1cdcef4e6a7f85 Author: Howard.Chiu@quantatw.com Date: Thu Dec 9 04:48:54 2021 +0000 hwmon: (pmbus) Add support for MPS Multi-phase mp5023 Add support for mp5023 device from Monolithic Power Systems, Inc. (MPS) vendor. This is a Hot-Swap Controller. Signed-off-by: Howard Chiu Link: https://lore.kernel.org/r/HKAPR04MB400349AA406694FB976D78D096709@HKAPR04MB4003.apcprd04.prod.outlook.com [groeck: Added MODULE_IMPORT_NS, entry in index.rst] Signed-off-by: Guenter Roeck commit 0710e2b9f9b7d48e666a5f4b5de742050be3d66b Author: Zev Weiss Date: Wed Dec 8 13:37:03 2021 -0800 dt-bindings: add Delta AHE-50DC fan control module This is the integrated fan control module of the Delta AHE-50DC Open19 power shelf. Signed-off-by: Zev Weiss Acked-by: Rob Herring Link: https://lore.kernel.org/r/20211208213703.2577-3-zev@bewilderbeest.net Signed-off-by: Guenter Roeck commit d387d88ed045a0a2db0698d079b06822f75d940b Author: Zev Weiss Date: Wed Dec 8 13:37:02 2021 -0800 hwmon: (pmbus) Add Delta AHE-50DC fan control module driver This device is an integrated module of the Delta AHE-50DC Open19 power shelf. I haven't been able to procure any proper documentation for it, but it seems to be a (somewhat minimally) PMBus-compliant device. It provides four fan speeds, four temperatures (three standard and one manufacturer-specific via a virtual second page), and a vin reading. Signed-off-by: Zev Weiss Link: https://lore.kernel.org/r/20211208213703.2577-2-zev@bewilderbeest.net Signed-off-by: Guenter Roeck commit 130d168866a11829b844ffdb19b9aefe384f754c Author: Lukas Bulwahn Date: Thu Dec 16 16:42:57 2021 +0100 hwmon: prefix kernel-doc comments for structs with struct The command ./scripts/kernel-doc -none include/linux/hwmon.h warns: include/linux/hwmon.h:406: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Channel information include/linux/hwmon.h:425: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Chip configuration Address those kernel-doc warnings by prefixing kernel-doc descriptions for structs with the keyword 'struct'. Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20211216154257.26758-1-lukas.bulwahn@gmail.com Signed-off-by: Guenter Roeck commit e13e979b2b3dafc9b5e7a4ec0ff17c875fedcf67 Author: Linus Walleij Date: Wed Dec 15 18:42:41 2021 +0100 hwmon: (ntc_thermistor) Add Samsung 1404-001221 NTC This adds the Samsung 1404-001221 NTC thermistor to the NTC thermistor driver. As far as I can tell it is electrically compatible with the Murata 47K NTC thermistor. This thermistor is mounted in a variety of Samsung products. Cc: Peter Rosin Cc: Chris Lesiak Cc: devicetree@vger.kernel.org Signed-off-by: Linus Walleij Acked-by: Rob Herring Link: https://lore.kernel.org/r/20211215174241.1496169-1-linus.walleij@linaro.org Signed-off-by: Guenter Roeck commit 8569e5558d9fa5be2d57ce7195566861a45984c1 Author: Linus Walleij Date: Wed Dec 15 15:29:33 2021 +0100 hwmon: (ntc_thermistor) Drop OF dependency The driver has been augmented to just use device properties so the OF dependency can be dropped. Cc: Peter Rosin Cc: Chris Lesiak Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20211215142933.1409324-1-linus.walleij@linaro.org Signed-off-by: Guenter Roeck commit 87b93329fdd64bbb87db72d06ca084a06d183d6d Author: Armin Wolf Date: Sat Dec 11 16:54:22 2021 +0100 hwmon: (dell-smm) Unify i8k_ioctl() and i8k_ioctl_unlocked() The only purpose of i8k_ioctl() is to call i8k_ioctl_unlocked() with i8k_mutex held. Judging from the hwmon code, this mutex only needs to be held when setting the fan speed/mode, so the operation of I8K_SET_FAN is guaranteed to be atomic. Unify both functions and reduce the locking of i8k_mutex to I8K_SET_FAN. Tested on a Dell Inspiron 3505. Signed-off-by: Armin Wolf Reviewed-by: Pali Rohár Link: https://lore.kernel.org/r/20211211155422.16830-3-W_Armin@gmx.de Signed-off-by: Guenter Roeck commit 02405387746915b93b283c18780b6cef90394ea1 Author: Armin Wolf Date: Sat Dec 11 16:54:21 2021 +0100 hwmon: (dell-smm) Simplify ioctl handler The second switch-case has no real purpose: - for I8K_BIOS_VERSION, val does not represent a return value, making the check for error values unnecessary. - for I8K_MACHINE_ID, val remains zero, so the error check is unnecessary too. Remove the switch-case and move the calls to copy_to_user() into the first switch-case for I8K_BIOS_VERSION/_MACHINE_ID. Omit buff[] since data->bios_machineid already contains the string with the necessary zero padding through devm_kzalloc(). Tested on a Dell Inspiron 3505. Signed-off-by: Armin Wolf Reviewed-by: Pali Rohár Link: https://lore.kernel.org/r/20211211155422.16830-2-W_Armin@gmx.de Signed-off-by: Guenter Roeck commit 9c6d555187f504b880ca506b0b2d0edbdb5d2d5f Author: Armin Wolf Date: Sat Dec 11 19:44:49 2021 +0100 hwmon: (raspberrypi) Exit immediately in case of error in init Exit immediately if devm_hwmon_device_register_with_info() fails since registering a delayed work whould be useless in such a case anyway. Signed-off-by: Armin Wolf Link: https://lore.kernel.org/r/20211211184449.18211-1-W_Armin@gmx.de Signed-off-by: Guenter Roeck commit c2fe0f63cafe3fc3adbd0aff6f1758b504ee3cdb Author: Dan Carpenter Date: Wed Dec 15 14:40:50 2021 +0300 hwmon: (nct6775) delete some extension lines This code can fit on one line. No need to break it up. Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20211215114050.GB14967@kili Signed-off-by: Guenter Roeck commit 9f448e796cf9d525fb9e1aa0d4fee073b80f1cab Author: Linus Walleij Date: Mon Dec 6 00:59:48 2021 +0100 hwmon: (ntc_thermistor) Move DT matches to the driver block This moves the device tree match data toward the end of the driver which is the convention, here we can also add ACPI and similar match data in a conforming manner. Cc: Peter Rosin Cc: Chris Lesiak Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20211205235948.4167075-3-linus.walleij@linaro.org Signed-off-by: Guenter Roeck commit 70760e80db06247b0c7b1933a9be81b5c22fc25e Author: Linus Walleij Date: Mon Dec 6 03:04:22 2021 +0100 hwmon: (ntc_thermistor) Switch to generic firmware props This switches to retrieveing the configuration of the NTC from generic firmware properties so that we get neutral from device tree: now ACPI or, more importantly, software nodes can be used to spawn NTC devices provided they have the required properties. This was inspired by the similar changes made to the IIO drivers. This was tested on the Ux500 HREF with the NTC devices probing from device tree just as fine after this as before. Cc: Peter Rosin Cc: Chris Lesiak Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20211206020423.62402-2-linus.walleij@linaro.org Signed-off-by: Guenter Roeck commit e0149eebe47b9fe50cf85f23bcaeed81d7356c99 Author: Linus Walleij Date: Mon Dec 6 03:04:21 2021 +0100 hwmon: (ntc_thermistor) Move and refactor DT parsing Move the parsing of the DT config right above probe(). Allocate the state container for the driver in probe() instead of inside the DT config parsing function: as a result return an int instead of a pointer. Drop the check for !np: we can only probe from DT right now so no risk of ending up here. Cc: Peter Rosin Cc: Chris Lesiak Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20211206020423.62402-1-linus.walleij@linaro.org Signed-off-by: Guenter Roeck commit d75553790b9f44f9a6023a51ca5283ef4688f339 Author: Colin Ian King Date: Sat Dec 4 23:31:55 2021 +0000 hwmon: (adm1031) Remove redundant assignment to variable range Variable range is being initialized with a value that is never read, it is being re-assigned in the next statement. The assignment is redundant, remove it and initialize range using the second assigned value. Clean up the formatting too by adding missing spaces. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20211204233155.55454-1-colin.i.king@gmail.com Signed-off-by: Guenter Roeck commit 3315e716999d98d628abebbffaa82bef52962c95 Author: Dan Carpenter Date: Tue Nov 30 13:51:17 2021 +0300 hwmon: (asus_wmi_sensors) fix an array overflow Smatch detects this array overflow: drivers/hwmon/asus_wmi_sensors.c:569 asus_wmi_configure_sensor_setup() error: buffer overflow 'hwmon_attributes' 8 <= 9 The hwmon_attributes[] array should have "hwmon_max" so that it gets larger when more attributes are added. Fixes: 9d07e54a25b8 ("hwmon: (asus_wmi_sensors) Support X370 Asus WMI.") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20211130105117.GH5827@kili Signed-off-by: Guenter Roeck commit 34e2bd10ab6005d2967c2f203fea664fd44d0b0f Author: Dan Carpenter Date: Tue Nov 30 13:50:34 2021 +0300 hwmon: (asus_wmi_ec_sensors) fix array overflow Smatch detected an array out of bounds error: drivers/hwmon/asus_wmi_ec_sensors.c:562 asus_wmi_ec_configure_sensor_setup() error: buffer overflow 'hwmon_attributes' 8 <= 9 The hwmon_attributes[] array needs to be declared with "hwmon_max" elements. Fixes: c04c7f7bfcbe ("hwmon: (asus_wmi_ec_sensors) Support B550 Asus WMI.") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20211130105034.GG5827@kili Signed-off-by: Guenter Roeck commit 62cfc0576393e57a4c5622a08b6c4ba20fe5f880 Author: David Mosberger-Tang Date: Sun Nov 21 16:07:02 2021 +0000 hwmon: (sht4x) Add device tree match table This patch enables automatic loading of the sht4x module via a device tree table entry. Signed-off-by: David Mosberger-Tang Link: https://lore.kernel.org/r/20211121160637.2312106-1-davidm@egauge.net Signed-off-by: Guenter Roeck commit e380095b8018acd9f962a9020251c5d8f1191e49 Author: Linus Walleij Date: Thu Nov 25 03:08:41 2021 +0100 hwmon: (ntc_thermistor) Merge platform data Allocate one state container for the device: struct ntc_data. Move all items from struct ntc_thermistor_platform_data into this struct and simplify. Cc: Peter Rosin Cc: Chris Lesiak Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20211125020841.3616359-5-linus.walleij@linaro.org Signed-off-by: Guenter Roeck commit 209218efd6ac8bebfe85fd2bc3ad64e5c3bad0a8 Author: Linus Walleij Date: Thu Nov 25 03:08:40 2021 +0100 hwmon: (ntc_thermistor) Drop read_uv() depend on OF and IIO The only possible assignment of a function to get a voltage to convert to a resistance is to use the internal function ntc_adc_iio_read() which is only available when using IIO and OF. Bite the bullet and mandate OF and IIO, drop the read_uv() callback abstraction and some ifdefs. As no board is using the platform data, all users are using OF and IIO anyway. Cc: Peter Rosin Cc: Chris Lesiak Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20211125020841.3616359-4-linus.walleij@linaro.org Signed-off-by: Guenter Roeck commit 76f240ff9523673106385120bc9af15ada9ca2f8 Author: Linus Walleij Date: Thu Nov 25 03:08:39 2021 +0100 hwmon: (ntc_thermistor) Drop get_ohm() Nothing in the kernel (this driver) is using the callback to read ohms directly. We always read a voltage and convert it to a resistance. Drop this callback. Cc: Peter Rosin Cc: Chris Lesiak Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20211125020841.3616359-3-linus.walleij@linaro.org Signed-off-by: Guenter Roeck commit 11a24ca7e34d968991a7d437b950d1924396bd81 Author: Linus Walleij Date: Thu Nov 25 03:08:38 2021 +0100 hwmon: (ntc_thermistor) Merge platform data into driver Platform data is supposed to be used with "board files", device descriptions in C. Since the introduction of the NTC driver in 2011, no such platforms have been submitted to the Linux kernel, and their use is strongly discouraged in favor of Device Tree, ACPI or as last resort software firmware nodes. Drop the external header and copy the platform data into the driver file. Cc: Peter Rosin Cc: Chris Lesiak Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20211125020841.3616359-2-linus.walleij@linaro.org Signed-off-by: Guenter Roeck commit bf4d843050af4fde7e8514b4b5ffe79874ee3936 Author: Guenter Roeck Date: Mon Nov 8 07:17:52 2021 -0800 hwmon: (jc42) Add support for ONSEMI N34TS04 N34TS04 is a JC42.4 compatible temperature sensor from ONSEMI. Signed-off-by: Guenter Roeck commit 8bb050cd5cf494f3d0cb45a6b54a476af09edb8d Author: Babu Moger Date: Wed Nov 24 10:03:13 2021 -0600 hwmon: (k10temp) Support up to 12 CCDs on AMD Family of processors The current driver can read the temperatures from upto 8 CCDs (Core-Complex Die). The newer AMD Family 19h Models 10h-1Fh and A0h-AFh can support up to 12 CCDs. Update the driver to read up to 12 CCDs. Signed-off-by: Babu Moger Link: https://lore.kernel.org/r/163776976762.904164.5618896687524494215.stgit@bmoger-ubuntu Signed-off-by: Guenter Roeck commit 548820e21ce10582f4b4bd257cb290d4257bcd93 Author: Denis Pauk Date: Tue Nov 16 22:57:44 2021 +0200 hwmon: (asus_wmi_sensors) Support X370 Asus WMI. Provides a Linux kernel module "asus_wmi_sensors" that provides sensor readouts via ASUS' WMI interface present in the UEFI of X370/X470/B450/X399 Ryzen motherboards. Supported motherboards: * ROG CROSSHAIR VI HERO, * PRIME X399-A, * PRIME X470-PRO, * ROG CROSSHAIR VI EXTREME, * ROG CROSSHAIR VI HERO (WI-FI AC), * ROG CROSSHAIR VII HERO, * ROG CROSSHAIR VII HERO (WI-FI), * ROG STRIX B450-E GAMING, * ROG STRIX B450-F GAMING, * ROG STRIX B450-I GAMING, * ROG STRIX X399-E GAMING, * ROG STRIX X470-F GAMING, * ROG STRIX X470-I GAMING, * ROG ZENITH EXTREME, * ROG ZENITH EXTREME ALPHA. Co-developed-by: Ed Brindley Signed-off-by: Ed Brindley Signed-off-by: Denis Pauk [groeck: Squashed: "hwmon: Fix warnings in asus_wmi_sensors.rst documetation."] Signed-off-by: Guenter Roeck commit b87611d43757c131e5f272b42f0561faed52029e Author: Denis Pauk Date: Tue Nov 16 22:57:43 2021 +0200 hwmon: (asus_wmi_ec_sensors) Support B550 Asus WMI. Linux HWMON sensors driver for ASUS motherboards to read sensors from the embedded controller. Many ASUS motherboards do not publish all the available sensors via the Super I/O chip but the missing ones are available through the embedded controller (EC) registers. This driver implements reading those sensor data via the WMI method BREC, which is known to be present in all ASUS motherboards based on the AMD 500 series chipsets (and probably is available in other models too). The driver needs to know exact register addresses for the sensors and thus support for each motherboard has to be added explicitly. The EC registers do not provide critical values for the sensors and as such they are not published to the HWMON. Supported motherboards: * PRIME X570-PRO * Pro WS X570-ACE * ROG CROSSHAIR VIII HERO * ROG CROSSHAIR VIII DARK HERO * ROG CROSSHAIR VIII FORMULA * ROG STRIX X570-E GAMING * ROG STRIX B550-I GAMING * ROG STRIX B550-E GAMING Co-developed-by: Eugene Shalygin Signed-off-by: Eugene Shalygin Co-developed-by: Andy Shevchenko Signed-off-by: Andy Shevchenko Signed-off-by: Denis Pauk Tested-by: Tor Vic Tested-by: Oleksandr Natalenko Signed-off-by: Guenter Roeck commit df293076a903530d7d12966ca19aa9570a6c70b3 Author: Menghui Wu Date: Wed Nov 17 10:43:20 2021 +0800 hwmon: (f71882fg) Add F81966 support This adds hardware monitor support the Fintek F81966 Super I/O chip. Testing was done on the Aaeon SSE-IPTI Signed-off-by: Menghui Wu Signed-off-by: Chia-Lin Kao (AceLan) Link: https://lore.kernel.org/r/20211117024320.2428144-1-acelan.kao@canonical.com Signed-off-by: Guenter Roeck commit ff9b8778797940628934205010d12b7084c85447 Author: Guenter Roeck Date: Sun Nov 14 22:06:35 2021 -0800 hwmon: (adm1021) Improve detection of LM84, MAX1617, and MAX1617A The adm1021 driver is quite generous with its automatic chip detection and easily misdetects several chips. Strengthen detection of MAX1617, MAX1617A, and LM84 to make the driver less vulnerable to false matches. Signed-off-by: Guenter Roeck commit ff300b71ba3860d282f77774d2b02ec49ad0e9cf Author: Guenter Roeck Date: Tue Nov 9 13:18:26 2021 -0800 hwmon: (tmp401) Hide register write address differences in regmap code Since we are using regmap access functions to write into chip registers, we can hide the difference in register write addresses within regmap code. By doing this we do not need to clear the regmap cache on register writes, and the high level code does not need to bother about different read/write register addresses. Signed-off-by: Guenter Roeck commit 50152fb6c1a197271b8916b8225525a6ca71e9ee Author: Guenter Roeck Date: Sat Oct 16 14:56:29 2021 -0700 hwmon: (tmp401) Use regmap Use regmap for register accesses to be able to utilize its caching functionality. This also lets us hide register access differences in regmap code. Signed-off-by: Guenter Roeck commit ca53e7640de7579f7e3ee467c82618e1ad98857a Author: Guenter Roeck Date: Sat Oct 16 10:51:27 2021 -0700 hwmon: (tmp401) Convert to _info API The new API is cleaner and reduces code size significantly. All chip accesses are 'hidden' in chip access to prepare for using regmap. Local caching code is removed, to be replaced by regmap based caching in a follow-up patch. Signed-off-by: Guenter Roeck commit bcb31e680837b71648158f2fedfc078cf6699207 Author: Guenter Roeck Date: Sun Oct 17 07:47:43 2021 -0700 hwmon: (tmp401) Simplify temperature register arrays The difference between TMP431 and other chips of this series is that the TMP431 has an additional sensor. The register addresses for other sensors are the same for all chips. It is therefore unnecessary to maintain two different arrays for TMP431 and the other chips. Just use the same array for all chips and add the TMP431 register addresses as third column. Signed-off-by: Guenter Roeck commit eacb52f010a80752e77a86aee9cb01f4864b0ca4 Author: Nathan Rossi Date: Tue Nov 2 05:27:54 2021 +0000 hwmon: Driver for Texas Instruments INA238 The INA238 is a I2C power monitor similar to other INA2xx devices, providing shunt voltage, bus voltage, current, power and temperature measurements. Signed-off-by: Nathan Rossi Link: https://lore.kernel.org/r/20211102052754.817220-3-nathan@nathanrossi.com Signed-off-by: Guenter Roeck commit 8be23b9b3114952c92c13fac2d37854aba208b9e Author: Nathan Rossi Date: Tue Nov 2 05:27:54 2021 +0000 dt-bindings: hwmon: ti,ina2xx: Add ti,shunt-gain property Add a property to the binding to define the selected shunt voltage gain. This specifies the range and accuracy that applies to the shunt circuit. This property only applies to devices that have a selectable shunt voltage range via PGA or ADCRANGE register configuration. Signed-off-by: Nathan Rossi Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211102052754.817220-2-nathan@nathanrossi.com Signed-off-by: Guenter Roeck commit ed68a0effe51be3c89f7fa03dfc630b2ef1f1ee8 Author: Nathan Rossi Date: Tue Nov 2 05:27:54 2021 +0000 dt-bindings: hwmon: ti,ina2xx: Document ti,ina238 compatible string Document the compatible string for the Texas Instruments INA238, this device is a variant of the existing INA2xx devices and has the same device tree bindings (shunt resistor). Signed-off-by: Nathan Rossi Acked-by: Rob Herring Link: https://lore.kernel.org/r/20211102052754.817220-1-nathan@nathanrossi.com Signed-off-by: Guenter Roeck commit 3cf90efa13678d2de2f9f7e44e26353996db842a Author: Babu Moger Date: Mon Nov 8 15:51:34 2021 -0600 hwmon: (k10temp) Add support for AMD Family 19h Models 10h-1Fh and A0h-AFh Add thermal info support for AMD Family 19h Models 10h-1Fh and A0h-AFh. Thermal info is supported via a new PCI device ID at offset 0x300h. Signed-off-by: Babu Moger Link: https://lore.kernel.org/r/163640829419.955062.12539219969781039915.stgit@bmoger-ubuntu Signed-off-by: Guenter Roeck commit f707bcb5d1cb4c47d27c688c859dcdb70e3c7065 Author: Babu Moger Date: Mon Nov 8 15:51:27 2021 -0600 hwmon: (k10temp) Remove unused definitions Usage of these definitions were removed after the commit 0a4e668b5d52 ("hwmon: (k10temp) Remove support for displaying voltage and current on Zen CPUs"). So, cleanup them up. Signed-off-by: Babu Moger Link: https://lore.kernel.org/r/163640828776.955062.15863375803675701204.stgit@bmoger-ubuntu Signed-off-by: Guenter Roeck commit 4fb0abfee424b05f0ec6d2d09e38f04ee2b82a8a Author: Yazen Ghannam Date: Mon Nov 8 15:51:21 2021 -0600 x86/amd_nb: Add AMD Family 19h Models (10h-1Fh) and (A0h-AFh) PCI IDs Add the new PCI Device IDs to support new generation of AMD 19h family of processors. Signed-off-by: Yazen Ghannam Signed-off-by: Babu Moger Acked-by: Krzysztof Wilczyński Acked-by: Borislav Petkov Acked-by: Bjorn Helgaas # pci_ids.h Link: https://lore.kernel.org/r/163640828133.955062.18349019796157170473.stgit@bmoger-ubuntu Signed-off-by: Guenter Roeck commit ce80098db2439ee44403ec6fccd3a10be21c7aff Author: Ofir Bitton Date: Tue Nov 23 16:34:28 2021 +0200 habanalabs: support hard-reset scheduling during soft-reset As hard-reset can be requested during soft-reset, driver must allow it or else critical events received during soft-reset will be ignored. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 42eb2872e0867679c996bb19ee9063e6141fa974 Author: Ofir Bitton Date: Tue Nov 23 15:15:22 2021 +0200 habanalabs: add a lock to protect multiple reset variables Atomic operations during reset are replaced by a spinlock in order to have the ability to protect more than a single variable. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit eb135291912f7554e2a2472befc44818098baa8d Author: Ofir Bitton Date: Tue Nov 23 15:15:22 2021 +0200 habanalabs: refactor reset information variables Unify variables related to device reset, which will help us to add some new reset functionality in future patches. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 60bf3bfb5a37965fc33fa00f19a2074dd48077c5 Author: Ohad Sharabi Date: Mon Dec 20 13:30:35 2021 +0200 habanalabs: handle skip multi-CS if handling not done This patch fixes issue in which we have timeout for multi-CS although the CS in the list actually completed. Example scenario (the two threads marked as WAIT for the thread that handles the wait_for_multi_cs and CMPL as the thread that signal completion for both CS and multi-CS): 1. Submit CS with sequence X 2. [WAIT]: call wait_for_multi_cs with single CS X 3. [CMPL]: CS X do invoke complete_all for both CS and multi-CS (multi_cs_completion_done still false) 4. [WAIT]: enter poll_fences, reinit the completion and find the CS as completed when asking on the fence but multi_cs_done is still false it returns that no CS actually completed 5. [CMPL]: set multi_cs_handling_done as true 6. [WAIT]: wait for completion but no CS to awake the wait context and hence wait till timeout Solution: if CS detected as completed in poll_fences but multi_cs_done is still false invoke complete_all to the multi-CS completion and so it will not go to sleep in wait_for_completion but rather will have a "second chance" to wait for multi_cs_completion_done. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit f297a0e9fe7d4b4d8a24d2ce97446f2faaf9d51b Author: Tomer Tayar Date: Thu Dec 16 16:31:18 2021 +0200 habanalabs: add CPU-CP packet for engine core ASID cfg In some cases the driver cannot configure ASID of some engines due to the security level of the relevant registers. For this a new CPU-CP packet is introduced, which will allow the driver to ask the F/W to do this configuration instead. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 178e244cb6e209971b0ded9977e5146b73fe1f45 Author: Richard Zhu Date: Fri Dec 24 10:28:05 2021 +0800 PCI: imx: Add the imx8mm pcie support i.MX8MM PCIe works mostly like the i.MX8MQ one, but has a different PHY and allows to output the internal PHY reference clock via the refclk pad. Add the i.MX8MM PCIe support based on the standalone PHY driver. Link: https://lore.kernel.org/r/1640312885-31142-2-git-send-email-hongxing.zhu@nxp.com Tested-by: Marcel Ziswiler Tested-by: Tim Harvey Signed-off-by: Richard Zhu Signed-off-by: Lorenzo Pieralisi Reviewed-by: Tim Harvey commit 519f4ed0a09cdf3834c5cbde1416acd9a979a709 Author: Oded Gabbay Date: Sun Dec 19 16:06:59 2021 +0200 habanalabs: replace some -ENOTTY with -EINVAL -ENOTTY is returned in case of error in the ioctl arguments themselves, such as function that doesn't exists. In all other cases, where the error is in the arguments of the custom data structures that we define that are passed in the various ioctls, we need to return -EINVAL. Signed-off-by: Oded Gabbay commit 0a63ac769b4cb79dfe68efd06528e9174fb88162 Author: Ofir Bitton Date: Sun Dec 19 11:38:01 2021 +0200 habanalabs: fix comments according to kernel-doc Fix missing fields, descriptions not according to kernel-doc style. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit a7224c21161b3576cb6875ac86f5ba5e757e4fce Author: Ofir Bitton Date: Wed Dec 15 14:48:27 2021 +0200 habanalabs: fix endianness when reading cpld version Current sysfs implementation does not take endianness into consideration when dumping the cpld version. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit b9d31cada7d9f137028c11534fff77fec8511690 Author: farah kassabri Date: Tue Nov 2 11:34:18 2021 +0200 habanalabs: change wait_for_interrupt implementation Currently the cq counters are allocated in userspace memory, and mapped by the driver to the device address space. A new requirement that is part of new future API related to this one, requires that cq counters will be allocated in kernel memory. We leverage the existing cb_create API with KERNEL_MAPPED flag set to allocate this memory. That way we gain two things: 1. The memory cannot be freed while in use since it's protected by refcount in driver. 2. No need to wake up the user thread upon each interrupt from CQ, because the kernel has direct access to the counter. Therefore, it can make comparison with the target value in the interrupt handler and wake up the user thread only if the counter reaches the target value. This is instead of waking the thread up to copy counter value from user then go sleep again if target value wasn't reached. Signed-off-by: farah kassabri Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit e2558f0f84d85bfe2407b91d57798f133d8ad32a Author: Ohad Sharabi Date: Tue Dec 7 14:30:20 2021 +0200 habanalabs: prevent wait if CS in multi-CS list completed By the original design we assumed that if we "miss" multi CS completion it is of no severe consequence as we'll just call wait_for_multi_cs again. Sequence of events for such scenario: 1. user submit CS with sequence N 2. user calls wait for multi-CS with only CS #N in the list 3. the multi CS call starts with poll of the CSs but find that none completed (while CS #N did not completed yet) 4. now, multi CS #N complete but multi CS CTX was not yet created for the above multi-CS. so, attempt to complete multi-CS fails (as no multi CS CTX exist) 5. wait_for_multi_cs call now does init_wait_multi_cs_completion (and for this create the multi-CS CTX) 6. wait_for_multi_cs wits on completion but will not get one as CS #N already completed To fix the issue we initialize the multi-CS CTX prior polling the fences. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 86c00b2c3639e33a7b51a06b1ebff0bae87686b7 Author: Ofir Bitton Date: Mon Dec 13 15:43:06 2021 +0200 habanalabs: modify cpu boot status error print As BTL can be replaced by ROM we should modify relevant error print. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit d636a932b3ab96523fe09c6148a0fa01f938b4f6 Author: Ohad Sharabi Date: Wed Dec 8 09:06:03 2021 +0200 habanalabs: clean MMU headers definitions During the MMU development the MMU header files were left with unclean definitions: - MMU "version specific" definitions that were left in the mmu_general file - unused definitions This patch attempts, where possible, to keep definitions that can serve multiple MMU versions (but that are not tightly bound with specific MMU arch) in the mmu_general header file (e.g. different definitions for number of HOPs). Otherwise, move MMU version specific definitions (e.g. HOPs masks and shifts) to the specific MMU version file. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 9993f27de104d8d0f83c332ec5bc7642de20fae4 Author: Ofir Bitton Date: Sun Dec 12 17:46:21 2021 +0200 habanalabs: expose soft reset sysfs nodes for inference ASIC As we allow soft-reset to be performed only on inference devices, having the sysfs nodes may cause a confusion. Hence, we remove those nodes on training ASICs. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit b5c92b88823028bea4c74f3516c640406205933c Author: Ofir Bitton Date: Wed Dec 8 15:00:10 2021 +0200 habanalabs: sysfs support for two infineon versions Currently sysfs support dumping a single infineon version, in future asics we will have two infineon versions. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 707c1252868d885c47b80613b60bdcb19e133397 Author: Dani Liberman Date: Wed Dec 8 09:52:03 2021 +0200 habanalabs: keep control device alive during hard reset Need to allow user retrieve data during reset and afterwards without the need to reopen the device. Did it by seperating the user peocesses list into two lists: 1. fpriv_list which contains list of user processes that opened the device (currently only one). 2. fpriv_ctrl_list which contains list of user processes that opened the control device. This processes in this list shall not be killed during reset, only when the device is suddenly removed from PCI chain. Signed-off-by: Dani Liberman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit bb099a805104568c8babbf94824507b0d72ba232 Author: Oded Gabbay Date: Sun Dec 12 16:40:24 2021 +0200 habanalabs: fix hwmon handling for legacy f/w In legacy f/w that use old hwmon.h file, the values of the hwmon enums are different than the values that are in newer kernels (5.6 and above). Therefore, to support working with those f/w, we need to do some fixup before registering with the hwmon subsystem and also when calling the functions that communicate with the f/w to retrieve sensors information. Signed-off-by: Oded Gabbay commit 9acdc21b0b04f370c306b7d95c296c7f22660fc0 Author: Ofir Bitton Date: Wed Dec 8 21:46:29 2021 +0200 habanalabs: add current PI value to cpu packets In order to increase cpucp messaging reliability we will add the current PI value to the descriptor sent to F/W. F/W will wait for the PI value as an indication of a valid packet. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 7363805b8a52c9f5650f957a34a30788cc7ce4c2 Author: Oded Gabbay Date: Wed Dec 8 16:25:07 2021 +0200 habanalabs: remove in_debug check in device open The driver supports only a single user anyway, so there is no point in checking whether we are in_debug state when a user tries to open the device, because if we are in_debug, it means a user is already using the device. Signed-off-by: Oded Gabbay commit 7c623ef732bdba440b1f0e74a99265cb7587df7e Author: Ofir Bitton Date: Tue Dec 7 11:20:46 2021 +0200 habanalabs: return correct clock throttling period Current clock throttling period returned from driver was wrong due to wrong time comparison. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit b02220536cb66ce1e357d78c944d6be07f1e1051 Author: Ohad Sharabi Date: Wed Dec 1 10:52:27 2021 +0200 habanalabs: wait again for multi-CS if no CS completed The original multi-CS design assumption that stream masters are used exclusively (i.e. multi-CS with set of stream master QIDs will not get completed by CS not from the multi-CS set) is inaccurate. Thus multi-CS behavior is now modified not to treat such case as an error. Instead, if we have multi-CS completion but we detect that no CS from the list is actually completed we will do another multi-CS wait (with modified timeout). Signed-off-by: Ohad Sharabi Reviewed-by: Dani Liberman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 5b90e59d55d94aa939fae941db4a0e613e6ecc1e Author: Oded Gabbay Date: Tue Nov 30 23:08:21 2021 +0200 habanalabs: remove compute context pointer It was an error to save the compute context's pointer in the device structure, as it allowed its use without proper ref-cnt. Change the variable to a flag that only indicates whether there is an active compute context. Code that needs the pointer will now be forced to use proper internal APIs to get the pointer. Signed-off-by: Oded Gabbay commit 4337b50b5fe5ee64c821790f601ee6153bb9f027 Author: Oded Gabbay Date: Tue Nov 30 23:02:21 2021 +0200 habanalabs: add helper to get compute context There are multiple places where the code needs to get the context's pointer and increment its ref cnt. This is the proper way instead of using the compute context pointer in the device structure. Signed-off-by: Oded Gabbay commit 6798676f7ef5916133e0c915be73b7a3b7e2a312 Author: Oded Gabbay Date: Tue Nov 30 22:32:13 2021 +0200 habanalabs: fix etr asid configuration Pass the user's context pointer into the etr configuration function to extract its ASID. Using the compute_ctx pointer is an error as it is just an indication of whether a user has opened the compute device. Signed-off-by: Oded Gabbay commit 357ff3dc9ae5dc1a0d990801b32431f5eecc7ee9 Author: Oded Gabbay Date: Tue Nov 30 15:28:23 2021 +0200 habanalabs: save ctx inside encaps signal Compute context pointer in hdev shouldn't be used for fetching the context's pointer. If an object needs the context's pointer, it should get it while incrementing its kref, and when the object is released, put it. Signed-off-by: Oded Gabbay commit a4dd2ecf36c4458db14df3aae81ec3e3f4b4688e Author: Oded Gabbay Date: Tue Nov 30 17:04:13 2021 +0200 habanalabs: remove redundant check on ctx_fini The driver supports only a single context. Therefore, no need to check if the user context that is closed is the compute context. The user context, if exists, is always the compute context. Signed-off-by: Oded Gabbay commit fee187fe460b6b72a62e7d7b7193f8d675752544 Author: Oded Gabbay Date: Tue Nov 30 14:54:53 2021 +0200 habanalabs: free signal handle on failure Fix a bug where in case of failure to allocate idr, the handle's memory wasn't freed as part of the error handling code. Signed-off-by: Oded Gabbay commit b166465452ac27415bc747c4c47c96d1314d06f1 Author: Tomer Tayar Date: Mon Nov 29 11:20:27 2021 +0200 habanalabs: add missing kernel-doc comments for hl_device fields Add missing kernel-doc comments for the "last_error" and "stream_master_qid_arr" fields of the "hl_device" structure". Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit d214636be8a6102d726c8aeb59000f2fb80d94a9 Author: Tomer Tayar Date: Mon Nov 22 12:29:22 2021 +0200 habanalabs: pass reset flags to reset thread The reset flags used by the reset thread are currently a mix of hard-coded values and a specific flag which is passed from the context that initiates the reset. To make it easier to pass more flags in future from this context to the reset thread, modify it to pass all the original reset flags to the thread. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 2487f4a2812e520cb5b77b2b5dfcdc05c215cd83 Author: Dani Liberman Date: Mon Nov 22 21:47:30 2021 +0200 habanalabs: enable access to info ioctl during hard reset Because info ioctl is used to retrieve data, some of its opcodes may be used during hard reset. Other ioctls should be blocked while device is not operational. Signed-off-by: Dani Liberman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 1880f7acd7e0edacbd46385036253801ddc4273f Author: Dani Liberman Date: Tue Nov 9 11:33:28 2021 +0200 habanalabs: add SOB information to signal submission uAPI For debug purpose, add SOB address and SOB initial counter value before current submission to uAPI output. Using SOB address and initial counter, user can calculate how much of the submmision has been completed. Signed-off-by: Dani Liberman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 4fac990f604e6c10538026835a8a30f3c1b6fcf5 Author: Ohad Sharabi Date: Mon Nov 22 12:23:51 2021 +0200 habanalabs: skip read fw errors if dynamic descriptor invalid Reporting FW errors involves reading of the error registers. In case we have a corrupted FW descriptor we cannot do that since the dynamic scratchpad is potentially corrupted as well and may cause kernel crush when attempting access to a corrupted register offset. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 3416d4b59b8fbf0ad360353da4fa0f7293831230 Author: Ofir Bitton Date: Sun Nov 21 16:02:32 2021 +0200 habanalabs: handle events during soft-reset Driver should handle events during soft-reset as F/W is not going through reset and it keeps sending events towards host. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit b13bef204158e0c9d8a9149d134b260cec7ff6a9 Author: Ofir Bitton Date: Thu Nov 18 08:46:15 2021 +0200 habanalabs: change misleading IRQ warning during reset Currently we dump the physical IRQ line index in host if an event is received during reset. This ID is confusing as it means nothing to the user. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 75a5c44d143bc1818e8004a8bee6993aba3a75cf Author: Tomer Tayar Date: Thu Nov 18 10:44:05 2021 +0200 habanalabs: add power information type to POWER_GET packet In new f/w versions, it is required to explicitly indicate the power information type when querying the F/W for power info. When getting the current power level it should be set to power_input. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 411943344599d1a3340b4f720157cd24f4768c92 Author: Ofir Bitton Date: Mon Nov 15 19:36:25 2021 +0200 habanalabs: add more info ioctls support during reset Some info ioctls can be served even if the device is disabled or in reset. Hence, we enable more info ioctls during reset, as these ioctls do not require any H/W nor F/W communication. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 3beaf903a3a07dc5c6500691b0b465d36292e3f8 Author: Dani Liberman Date: Wed Nov 17 09:59:10 2021 +0200 habanalabs: fix race condition in multi CS completion Race example scenario: 1. User have 2 threads that waits on multi CS: - thread_0 waits on QID 0 and uses multi CS context 0. - thread_1 waits on QID 1 and uses multi CS context 1. 2. thread_1 got completion and release multi CS context 1. 3. CS related to multi CS of thread_0 starts executing complete_multi_cs function, the first iteration of the loop completes the multi CS of thread_0, hence multi CS context 0 is released. 4. thread_1 waits on QID 1 and uses multi CS context 0. 5. thread_0 waits on QID 0 and uses multi CS context 1. 6. The second iterattion of the loop (from step 3) starts, which means, start checking multi CS context 1: - multi CS contetxt is being used by thread_0 waiting on QID 0. - The fence of the CS (still CS from step 3) has QID map the same as the multi CS context 1. - multi CS context 1 (thread_0) gets completion on CS that triggered already thread_0 (with multi CS context 0) and is no longer being waited on. Fixed by exiting the loop in complete_multi_cs after getting completion Signed-off-by: Dani Liberman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit cad9eb4a8d9f745c2548f905534f981758e2afec Author: Ofir Bitton Date: Tue Nov 16 15:48:42 2021 +0200 habanalabs: move device boot warnings to the correct location As device boot warnings clears the indication from the error mask, they must be located together before the unknown error validation. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 9eade72e7246a25b8a13678d52a947033d6de710 Author: Oded Gabbay Date: Tue Nov 16 10:30:26 2021 +0200 habanalabs/gaudi: return EPERM on non hard-reset GAUDI supports only hard-reset. Therefore, this function should return an error of operation not permitted. Signed-off-by: Oded Gabbay commit 6c1bad35e691d908785e20258027d29c8b8beb08 Author: Oded Gabbay Date: Tue Nov 16 09:59:32 2021 +0200 habanalabs: rename late init after reset function The ASIC-specific soft_reset_late_init() is now called after either soft-reset or reset-upon-device-release. Therefore, it needs a more appropriate name. No need to split it to two functions, as an ASIC either supports soft-reset or reset-upon-device-release. Signed-off-by: Oded Gabbay commit 60e0431f41fff930537b4292c711200da87b195f Author: Oded Gabbay Date: Tue Nov 16 09:46:02 2021 +0200 habanalabs: fix soft reset accounting Reset upon device release is not a soft-reset from user/system point of view. As such, we shouldn't count that reset in the statistics we gather and expose to the monitoring applications. We also shouldn't print soft-reset when doing the reset upon device release. Signed-off-by: Oded Gabbay commit d8eb50f31cc7b0f01e610327376a49ac3f0865a2 Author: Rajaravi Krishna Katta Date: Thu Aug 5 10:24:16 2021 +0300 habanalabs: Move frequency change thread to goya_late_init Changing the frequency automatically is only done in Goya. In future ASICs this is done inside the firmware. Therefore, move the common code into the Goya specific files. Main changes as part of the commit are: 1. The thread for setting frequency is moved from device_late_init to goya_late_init 2. hl_device_set_frequency is removed from hl_device_open as it is not relevant for other ASICs and for Goya it is taken care by the thread 3. hl_device_set_frequency is renamed as goya_set_frequency Signed-off-by: Rajaravi Krishna Katta Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit ab440d3e39f61018b1f4c1c6bed6ab037f69a82e Author: Oded Gabbay Date: Mon Nov 15 17:13:37 2021 +0200 habanalabs: abort reset on invalid request Hard-reset is mutually exclusive with reset-on-device-release. Therefore, if such a request arrives to the reset function, abort the reset and return an error to the callee. Signed-off-by: Oded Gabbay commit a1b838adb080ee4320f257a8280821e47bfb9a1f Author: Ofir Bitton Date: Tue Nov 9 13:12:38 2021 +0200 habanalabs: fix possible deadlock in cache invl failure Currently there is a deadlock in driver in scenarios where MMU cache invalidation fails. The issue is basically device reset being performed without releasing the MMU mutex. The solution is to skip device reset as it is not necessary. In addition we introduce a slight code refactor that prints the invalidation error from a single location. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 6f61e47a68b403f8aa7956b4b6502511fcf19bb7 Author: Ohad Sharabi Date: Sun Nov 14 09:37:33 2021 +0200 habanalabs: skip PLL freq fetch Getting the used PLL index with which to send the CPUPU packet relies on the CPUCP info packet. In case CPU queues are not enabled getting the PLL index will issue an error and in some ASICs will also fail the driver load. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit a9ecddb9e30af1485c8f41afb0264ec53ae6f5ed Author: Tomer Tayar Date: Sun Nov 14 09:29:48 2021 +0200 habanalabs: align debugfs documentation to alphabetical order Move an entry in the debugfs documentation to align with the alphabetical order which is kept this file. Signed-off-by: Tomer Tayar Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit fe8d70873c4919086d5929c49e1c6cd6bb7d1de3 Author: Oded Gabbay Date: Sat Nov 13 17:58:43 2021 +0200 habanalabs: prevent false heartbeat message If a device reset has started, there is a chance that the heartbeat function will fail because the device is disabled at the beginning of the reset function. In that case, we don't want the error message to appear in the log. Signed-off-by: Oded Gabbay commit 3e55b5dbf929a40966b8eb7d4de94fad3bb404bd Author: Dani Liberman Date: Wed Nov 3 10:09:59 2021 +0200 habanalabs: add support for fetching historic errors A new uAPI is added for debug purposes of the user-space to retrieve errors related data from previous session (before device reset was performed). Inforamtion is filled when a razwi or CS timeout happens and can contain one of the following: 1. Retrieve timestamp of last time the device was opened and razwi or CS timeout happened. 2. Retrieve information about last CS timeout. 3. Retrieve information about last razwi error. This information doesn't contain user data, so no danger of data leakage between users. Signed-off-by: Dani Liberman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit e2637fdca70aa5357b26c57e44fcec0ed673eb22 Author: Ofir Bitton Date: Wed Nov 10 11:41:43 2021 +0200 habanalabs: handle device TPM boot error as warning AS TPM error indication is not fatal, driver should dump a warning and continue booting. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 3eb7754ff43827294bebcb2760969e9dc2283027 Author: Ofir Bitton Date: Tue Oct 12 20:52:46 2021 +0300 habanalabs: debugfs support for larger I2C transactions I2C debugfs support is limited to 1 byte. We extend functionality to more than 1 byte by using one of the pad fields as a length. No backward compatibility issues as new F/W versions will treat 0 length as a 1 byte length transaction. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit e617f5f4c144c3f185da67292dff09dc6cbb3296 Author: Oded Gabbay Date: Thu Nov 4 09:48:22 2021 +0200 habanalabs: make hdev creation code more readable Divide the code into 3 different parts: - Copy kernel parameters - Setting device behaivor per asic - Fixup of various device parameters according to the device behaivor. In addition, remove non-relevant code for upstream (simulator support). Signed-off-by: Oded Gabbay commit 49c052dad691ba1a3dc3559b74e99f2ec2fa0319 Author: farah kassabri Date: Sun Oct 24 19:02:32 2021 +0300 habanalabs: add new opcodes for INFO IOCTL Add implementation for new opcodes in the INFO IOCTL: 1. Retrieve the replaced DRAM rows from f/w. 2. Retrieve the pending DRAM rows from f/w. Signed-off-by: farah kassabri Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit d4194f21400e9b2caef2d48c63ec5ef102eead22 Author: Bharat Jauhari Date: Wed Sep 8 17:32:54 2021 +0300 habanalabs: refactor wait-for-user-interrupt function Refactor the wait-for-user-interrupt routine to make it more generic for re-use for other user exposed h/w interfaces in future ASICs. Signed-off-by: Bharat Jauhari Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 792512459fb2a62a5ea08264a0cdfb7e46a391a9 Author: farah kassabri Date: Wed Nov 3 13:15:55 2021 +0200 habanalabs/gaudi: Fix collective wait bug In Signaling-From-Graph case, the driver didn't set the hw_sob pointer at the right place, which is needed for the cs completion check prior to start sending all the master/slaves jobs to device. Signed-off-by: farah kassabri Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 1679c7ee580fdaa2a5df398a526b2eddc857f2a1 Author: Ofir Bitton Date: Mon Oct 25 09:47:04 2021 +0300 habanalabs: expand clock throttling information uAPI In addition to the clock throttling reason, user should be able to obtain also the start time and the duration of the throttling event. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 48f31169830f589e4c7ac475ccc7414951ded3f0 Author: Dani Liberman Date: Thu Oct 14 22:38:41 2021 +0300 habanalabs: change wait for interrupt timeout to 64 bit In order to increase maximum wait-for-interrupt timeout, change it to 64 bit variable. This wait is used only by newer ASICs, so no problem in changing this interface at this time. Signed-off-by: Dani Liberman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 234caa52736b8d413892fb1b2471066dc4b46629 Author: Bharat Jauhari Date: Thu Sep 16 14:00:38 2021 +0300 habanalabs: rename reset flags Rename reset flags for better readability as compared to HL_RESET_CAUSE* enum shared with the f/w. Signed-off-by: Bharat Jauhari Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit e84e31a9123bda35a1e61f391e7c30e8b3a8ea5b Author: Rajaravi Krishna Katta Date: Tue Oct 26 14:11:06 2021 +0300 habanalabs: add dedicated message towards f/w to set power CPUCP_PACKET_POWER_GET packet type was used for both hl_get_power() and hl_set_power(). To align with other sensor functions hl_set_power() should use CPUCP_PACKET_POWER_SET. This packet will only be used with newer ASICs, so need to add a compatibility flag to the asic properties to indicate whether to use this packet or the GET packet. Signed-off-by: Rajaravi Krishna Katta Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 138858226414bd026e63acebb7540093c97c69fd Author: Bharat Jauhari Date: Wed Sep 8 17:16:51 2021 +0300 habanalabs: handle abort scenario for user interrupt In case of device reset, the driver does a force trigger on all waiting users to release them from waiting. However, the driver does not handle error scenario while waiting. hl_interrupt_wait_ioctl() now exits the wait in case of an error with abort status. Signed-off-by: Bharat Jauhari Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 5edd95a4abb332fb683cf7a35eed2ae4ff7b4dcb Author: Ohad Sharabi Date: Tue Oct 26 10:42:24 2021 +0300 habanalabs: don't clear previous f/w indications Once we read indication of whether f/w is doing the reset, we don't want to clear it, until the next time we read this indication. Otherwise, we might be in a state of wrong indication. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit f4e7906dbe7e922b057e4533a585f7943fe90c90 Author: Ohad Sharabi Date: Tue Oct 26 15:33:23 2021 +0300 habanalabs: use variable poll interval for fw loading Using a variable poll interval for fw loading allows us to support much slower environments (emulation) while changing only a single line in the code, instead of choosing a different interval in each function that polls. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 8f82ff75dfd27afecb90246889c0c15d28e15ca7 Author: Ohad Sharabi Date: Thu Oct 21 11:24:41 2021 +0300 habanalabs: adding indication of boot fit loaded Up until now the driver stored indication if Linux was loaded on the device CPU. This was needed in order to coordinate some tasks that are performed by the Linux. In future ASICs, many of those tasks will be performed by the boot fit, so now we need the same indication of boot fit load status. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 6ccba9a3bca95a24fd936e3c3542cf2ff2941b0f Author: Yuri Nudelman Date: Mon Oct 25 11:37:25 2021 +0300 habanalabs: partly skip cache flush when in PMMU map flow The PCI MMU cache is two layered. The upper layer, memcache, uses cache lines, the bottom layer doesn't. Hence, after PMMU map operation we have to invalidate memcache, to avoid the situation where the new entry is already in the cache due to its cache line being fully in the cache. However, we do not have to invalidate the lower cache, and here we can optimize, since cache invalidation is time consuming. Signed-off-by: Yuri Nudelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 82e5169e8adfff331169613808b45a6cfb030e81 Author: Yuri Nudelman Date: Thu Sep 30 15:52:25 2021 +0300 habanalabs: add enum mmu_op_flags The enum vm_type was abused, used once as a value (indication memory type for map) and once as a flag (for cache invalidation). This makes it hard to add new and still keep it meaningful, hence it is better to split into one enum for values and one for flags. Signed-off-by: Yuri Nudelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 89d6decdb7346082c1f168a27d1386c34550bbd3 Author: Yuri Nudelman Date: Thu Oct 21 15:08:51 2021 +0300 habanalabs: make last_mask an MMU property Currently LAST_MASK is a global, but really it is an MMU implementation specific. We need this change for future ASICs. Signed-off-by: Yuri Nudelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit f06bad02b58733ed9e65b4c8d083270c8e9d0fa7 Author: Yuri Nudelman Date: Thu Oct 14 10:33:27 2021 +0300 habanalabs: wrong VA size calculation VA blocks are currently stored in an inconsistent way. Sometimes block end is inclusive, sometimes exclusive. This leads to wrong size calculations in certain cases, plus could lead to a segmentation fault in case mapping process fails in the middle and we try to roll it back. Need to make this consistent - start inclusive till end inclusive. For example, the regions table may now look like this: 0x0000 - 0x1fff : allocated 0x2000 - 0x2fff : free 0x3000 - 0x3fff : allocated Signed-off-by: Yuri Nudelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 90d283b6726fc2e963042b6884951aa81afd0ff7 Author: Guy Zadicario Date: Tue Oct 12 10:30:28 2021 +0300 habanalabs/gaudi: fix debugfs dma channel selection Do not use a dma channel for debugfs requested transfer if it's QM is not idle. Signed-off-by: Guy Zadicario Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit bfd5110682ca75cece49fe0e3f5ef478ec43c9ae Author: Ohad Sharabi Date: Sun Oct 17 09:00:43 2021 +0300 habanalabs: revise and document use of boot status flags The boot status flag "SRAM available" can be set by f/w Linux (in the general case) or by f/w uboot (in some specific debug scenario) but never by f/w preboot. Hence, when polling the boot status flags in the preboot stage we do not want to poll on "SRAM Avialable". The special case in which uboot set this flag is when we are running special debug scenario without Linux. In this case, at some point during the boot, the uboot relocates its code to the DRAM and then set the specified flag. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit ba3aca31f91ceef072970c1688bff40afc2ea275 Author: Yuri Nudelman Date: Thu Oct 14 12:10:31 2021 +0300 habanalabs: print va_range in vm node debugfs VA range info could assist in debugging VA allocation bugs. Signed-off-by: Yuri Nudelman Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit 4cd454a205069965463515e2068190f56b0e4206 Author: Oded Gabbay Date: Thu Oct 21 14:02:40 2021 +0300 habanalabs/gaudi: recover from CPU WD event There are rare cases where the device CPU's watchdog has expired and as a result, the watchdog reset has happened and the CPU will now move to running its preboot f/w. When that happens, the driver will only know that a heartbeat failure occurred. As a result, the driver will send a message to the CPU's main f/w asking it to reset the device, but because the CPU is now running preboot, it won't respond and the re-initialization process will later fail when trying to load the f/w. The solution is to send the request to the preboot as well, only if the reset was caused because of HB failure. Signed-off-by: Oded Gabbay commit c9d1383c75c95be55d9207e8a8d5c7c1659a029e Author: Ohad Sharabi Date: Sun Oct 17 08:40:28 2021 +0300 habanalabs: modify wait for boot fit in dynamic FW load In the dynamic FW load protocol the boot status is updated to "Ready to Boot" once uboot is active. Polling on other boot status values is a residue of code duplication from the static protocol and should be removed. Signed-off-by: Ohad Sharabi Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay commit c8eefdbfa18e3c8d39133ee2a3143489fab3d911 Merge: 4b1643cb57da8 a382d568f144b Author: Linus Walleij Date: Sun Dec 26 04:34:01 2021 +0100 Merge tag 'samsung-pinctrl-5.17' of https://git.kernel.org/pub/scm/linux/kernel/git/pinctrl/samsung into devel Samsung pinctrl drivers changes for v5.17 1. Add support for Exynos7885. 2. Drop usage of platform_get_resource(). commit 4b1643cb57da8df86c02a0826cb12ed750abaed7 Author: Rafał Miłecki Date: Wed Dec 22 07:43:44 2021 +0100 pinctrl: bcm: ns: use generic groups & functions helpers This simplifies ns driver and gets rid of ~70 lines of code. "const" had to be dropped from "struct ns_pinctrl_group" @pins to match "struct group_desc" @pins and pinctrl_generic_add_group(). Otherwise it would cause: drivers/pinctrl/bcm/pinctrl-ns.c: In function 'ns_pinctrl_probe': drivers/pinctrl/bcm/pinctrl-ns.c:277:13: warning: passing argument 3 of 'pinctrl_generic_add_group' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] 277 | group->pins, group->num_pins, NULL); | ~~~~~^~~~~~ Signed-off-by: Rafał Miłecki Link: https://lore.kernel.org/r/20211222064344.14624-1-zajec5@gmail.com Signed-off-by: Linus Walleij commit aa63e6562ab38f838fd7e3e5d6708495dd144c05 Author: Rafał Miłecki Date: Wed Dec 22 22:28:07 2021 +0100 pinctrl: imx: fix allocation result check Fix code to check correct variable value. Reported-by: Abel Vesa Fixes: 02f117134952 ("pinctrl: imx: prepare for making "group_names" in "function_desc" const") Signed-off-by: Rafał Miłecki Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20211222212807.27122-1-zajec5@gmail.com Signed-off-by: Linus Walleij commit 55fa3c9665bfcf32b21af8ecdeb48d5c5177d8d7 Author: Hans de Goede Date: Thu Dec 23 20:07:50 2021 +0100 platform/x86: x86-android-tablets: New driver for x86 Android tablets x86 tablets which ship with Android as (part of) the factory image typically have various problems with their DSDTs. The factory kernels shipped on these devices typically have device addresses and GPIOs hardcoded in the kernel, rather then specified in their DSDT. With the DSDT containing a random collection of devices which may or may not actually be present as well as missing devices which are actually present. This driver, which loads only on affected models based on DMI matching, adds DMI based instantiating of kernel devices for devices which are missing from the DSDT, fixing e.g. battery monitoring, touchpads and/or accelerometers not working. Note the Kconfig help text also refers to "various fixes" ATM there are no such fixes, but there are also known cases where entries are present in the DSDT but they contain bugs, such as missing/wrong GPIOs. The plan is to also add fixes for things like this here in the future. This is the least ugly option to get these devices to fully work and to do so without adding any extra code to the main kernel image (vmlinuz) when built as a module. Link: https://lore.kernel.org/platform-driver-x86/20211031162428.22368-1-hdegoede@redhat.com/ Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211223190750.397487-1-hdegoede@redhat.com commit a382d568f144b9e533ad210117c6c50d8dbdcaf1 Author: Lad Prabhakar Date: Fri Dec 24 14:57:47 2021 +0000 pinctrl: samsung: Use platform_get_irq_optional() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq_optional(). Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211224145748.18754-2-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Krzysztof Kozlowski commit 08977fe8cfb7d9fe9337470eec4843081cf3a76d Author: Kai-Heng Feng Date: Fri Dec 24 11:50:13 2021 +0800 ALSA: hda/realtek: Use ALC285_FIXUP_HP_GPIO_LED on another HP laptop The audio mute and mic mute LEDs don't work, so use the quirk to make them work. Signed-off-by: Kai-Heng Feng Cc: Link: https://lore.kernel.org/r/20211224035015.310068-1-kai.heng.feng@canonical.com Signed-off-by: Takashi Iwai commit 6dc86976220cc904e87ee58e4be19dd90d6a36d5 Author: Arie Geiger Date: Thu Dec 23 15:28:57 2021 -0800 ALSA: hda/realtek: Add speaker fixup for some Yoga 15ITL5 devices This patch adds another possible subsystem ID for the ALC287 used by the Lenovo Yoga 15ITL5. It uses the same initalization as the others. This patch has been tested and works for my device. Signed-off-by: Arie Geiger Cc: Link: https://lore.kernel.org/r/20211223232857.30741-1-arsgeiger@gmail.com Signed-off-by: Takashi Iwai commit ca1ece24d9bc5bd1d5257494654bb2b73942ddea Author: Kai Vehmanen Date: Thu Dec 23 09:34:24 2021 +0200 ALSA: hda: Add new AlderLake-P variant PCI ID Add HD Audio PCI ID for a variant of Intel AlderLake-P. Use same driver match rules as for existing AlderLake-P devices. Signed-off-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20211223073424.1738125-2-kai.vehmanen@linux.intel.com Signed-off-by: Takashi Iwai commit 4d5a628d96532607b2e01e507f951ab19a33fc12 Author: Kai Vehmanen Date: Thu Dec 23 09:34:23 2021 +0200 ALSA: hda: Add AlderLake-N PCI ID Add HD Audio PCI ID for Intel AlderLake-N. Add rules to snd_intel_dsp_find_config() to choose DSP-based SOF driver for ADL-N systems with PCH-DMIC or Soundwire codecs, and plain HDA driver for the rest (DSP not used). Signed-off-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20211223073424.1738125-1-kai.vehmanen@linux.intel.com Signed-off-by: Takashi Iwai commit 6c3a0c39130c9f29d52269cca7cf29c0e1c8d966 Author: Ville Syrjälä Date: Wed Dec 22 16:53:50 2021 +0200 ALSA: hda/hdmi: Disable silent stream on GLK The silent stream stuff recurses back into i915 audio component .get_power() from the .pin_eld_notify() hook. On GLK this will deadlock as i915 may already be holding the relevant modeset locks during .pin_eld_notify() and the GLK audio vs. CDCLK workaround will try to grab the same locks from .get_power(). Until someone comes up with a better fix just disable the silent stream support on GLK. Cc: stable@vger.kernel.org Cc: Harsha Priya Cc: Emmanuel Jillela Cc: Kai Vehmanen Cc: Takashi Iwai Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/2623 Fixes: 951894cf30f4 ("ALSA: hda/hdmi: Add Intel silent stream support") Signed-off-by: Ville Syrjälä Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20211222145350.24342-1-ville.syrjala@linux.intel.com Signed-off-by: Takashi Iwai commit 5dcdc4600c3a7773a7b901d6b7eb29340be95cf6 Author: Yang Guang Date: Sat Dec 18 09:54:16 2021 +0800 ALSA: hda: use swap() to make code cleaner Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid opencoding it. Reported-by: Zeal Robot Signed-off-by: David Yang Signed-off-by: Yang Guang Link: https://lore.kernel.org/r/ebc9db44b802dfc88e1538629b517e000acb27b3.1639790796.git.yang.guang5@zte.com.cn Signed-off-by: Takashi Iwai commit 10f2f194663af178f32aeb4086fc3f6687d25056 Author: Mark Brown Date: Fri Dec 17 13:02:13 2021 +0000 kselftest: alsa: Validate values read from enumerations Enumerations should return a value between 0 and items-1, check that this is the case. Signed-off-by: Mark Brown Reviewed-by: Cezary Rojewski Link: https://lore.kernel.org/r/20211217130213.3893415-3-broonie@kernel.org Signed-off-by: Takashi Iwai commit 3f48b137d88e710b67b2bcc01aa3d77b4db610c4 Author: Mark Brown Date: Fri Dec 17 13:02:12 2021 +0000 kselftest: alsa: Factor out check that values meet constraints To simplify the code a bit and allow future reuse factor the checks that values we read are valid out of test_ctl_get_value() into a separate function which can be reused later. As part of this extend the test to check all the values for the control, not just the first one. Signed-off-by: Mark Brown Reviewed-by: Cezary Rojewski Link: https://lore.kernel.org/r/20211217130213.3893415-2-broonie@kernel.org Signed-off-by: Takashi Iwai commit 0f7e5ee62f4c24ca9db58351c86653cc3ee0bd0e Author: Pierre-Louis Bossart Date: Thu Dec 16 17:11:28 2021 -0600 ALSA: HDA: hdac_ext_stream: use consistent prefixes for variables The existing code maximizes confusion by using 'stream' and 'hstream' variables of different types. Examples: struct hdac_stream *stream; struct hdac_ext_stream *stream; struct hdac_stream *hstream; struct hdac_ext_stream *hstream; with some additional copy/paste remains: struct hdac_ext_stream *azx_dev; This patch suggests a consistent naming across all 'hdac_ext_stream' functions. The convention is: struct hdac_stream *hstream; struct hdac_ext_stream *hext_stream; No functionality change - just renaming of variables and more consistent indentation. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Reviewed-by: Rander Wang Link: https://lore.kernel.org/r/20211216231128.344321-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai commit 12054f0ce8be7d2003ec068ab27c9eb608397b98 Author: Pierre-Louis Bossart Date: Thu Dec 16 17:11:27 2021 -0600 ALSA/ASoC: hda: move/rename snd_hdac_ext_stop_streams to hdac_stream.c snd_hdac_ext_stop_streams() has really nothing to do with the extension, it just loops over the bus streams. Move it to the hdac_stream layer and rename to remove the 'ext' prefix and add the precision that the chip will also be stopped. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Reviewed-by: Péter Ujfalusi Reviewed-by: Ranjani Sridharan Reviewed-by: Cezary Rojewski Link: https://lore.kernel.org/r/20211216231128.344321-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Takashi Iwai commit beeac538c366cd2828092adecd1edab28326c55b Author: Michael Ellerman Date: Wed Dec 22 00:51:01 2021 +1100 selftests/powerpc: Add a test of sigreturning to an unaligned address Add a test of sigreturning to an unaligned address (low two bits set). This should have no effect because the hardware will mask those bits. However it previously falsely triggered a warning when CONFIG_PPC_RFI_SRR_DEBUG=y. Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211221135101.2085547-3-mpe@ellerman.id.au commit fd1eaaaaa6864b5fb8f99880fcefb49760b8fe4e Author: Michael Ellerman Date: Wed Dec 22 00:51:00 2021 +1100 powerpc/64s: Use EMIT_WARN_ENTRY for SRR debug warnings When CONFIG_PPC_RFI_SRR_DEBUG=y we check the SRR values before returning from interrupts. This is done in asm using EMIT_BUG_ENTRY, and passing BUGFLAG_WARNING. However that fails to create an exception table entry for the warning, and so do_program_check() fails the exception table search and proceeds to call _exception(), resulting in an oops like: Oops: Exception in kernel mode, sig: 5 [#1] LE PAGE_SIZE=64K MMU=Radix SMP NR_CPUS=2048 NUMA pSeries Modules linked in: CPU: 2 PID: 1204 Comm: sigreturn_unali Tainted: P 5.16.0-rc2-00194-g91ca3d4f77c5 #12 NIP: c00000000000c5b0 LR: 0000000000000000 CTR: 0000000000000000 ... NIP [c00000000000c5b0] system_call_common+0x150/0x268 LR [0000000000000000] 0x0 Call Trace: [c00000000db73e10] [c00000000000c558] system_call_common+0xf8/0x268 (unreliable) ... Instruction dump: 7cc803a6 888d0931 2c240000 4082001c 38800000 988d0931 e8810170 e8a10178 7c9a03a6 7cbb03a6 7d7a02a6 e9810170 <7f0b6088> 7d7b02a6 e9810178 7f0b6088 We should instead use EMIT_WARN_ENTRY, which creates an exception table entry for the warning, allowing the warning to be correctly recognised, and the code to resume after printing the warning. Note however that because this warning is buried deep in the interrupt return path, we are not able to recover from it (due to MSR_RI being clear), so we still end up in die() with an unrecoverable exception. Fixes: 59dc5bfca0cb ("powerpc/64s: avoid reloading (H)SRR registers if they are still valid") Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211221135101.2085547-2-mpe@ellerman.id.au commit 314f6c23dd8d417281eb9e8a516dd98036f2e7b3 Author: Michael Ellerman Date: Wed Dec 22 00:50:59 2021 +1100 powerpc/64s: Mask NIP before checking against SRR0 When CONFIG_PPC_RFI_SRR_DEBUG=y we check that NIP and SRR0 match when returning from interrupts. This can trigger falsely if NIP has either of its two low bits set via sigreturn or ptrace, while SRR0 has its low two bits masked in hardware. As a quick fix make sure to mask the low bits before doing the check. Fixes: 59dc5bfca0cb ("powerpc/64s: avoid reloading (H)SRR registers if they are still valid") Reported-by: Sachin Sant Signed-off-by: Michael Ellerman Tested-by: Sachin Sant Link: https://lore.kernel.org/r/20211221135101.2085547-1-mpe@ellerman.id.au commit 7c63f26cb518f57aa5feaef7e0abe2697155df35 Author: Christophe JAILLET Date: Thu Dec 23 22:33:42 2021 +0100 lib: objagg: Use the bitmap API when applicable Use 'bitmap_zalloc()' to simplify code, improve the semantic and reduce some open-coded arithmetic in allocator arguments. Also change the corresponding 'kfree()' into 'bitmap_free()' to keep consistency. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/f9541b085ec68e573004e1be200c11c9c901181a.1640295165.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jakub Kicinski commit 10674ca9ea02491fd3f8ffe303861b7a6837994b Merge: 5c5f08f7fc0be 63a6aa963dd01 Author: Mark Brown Date: Fri Dec 24 16:15:47 2021 +0000 ASoC/SoundWire: improve suspend flows and use set_stream() instead of set_tdm_slots() for HDAudio Merge series from Bard Liao : This series contains three topics. 1. SoundWire: Intel: remove pdm support 2. ASoC/SoundWire: dai: expand 'stream' concept beyond SoundWire 3. ASoC/SOF/SoundWire: fix suspend-resume on pause with dynamic pipelines The topics are independent but the changes are dependent. So please allow me to send them in one series. commit 2b71e2c7b56cabe0aef95b79af98da921b87bc30 Author: Colin Ian King Date: Tue Dec 21 19:37:57 2021 +0000 netfilter: nft_set_pipapo_avx2: remove redundant pointer lt The pointer lt is being assigned a value and then later updated but that value is never read. The pointer is redundant and can be removed. Signed-off-by: Colin Ian King Signed-off-by: Pablo Neira Ayuso commit 92ad19559ea9a8ec6f158480934ae26ebfe2c14f Author: Lee, Chun-Yi Date: Sat Dec 18 10:09:05 2021 +0800 integrity: Do not load MOK and MOKx when secure boot be disabled The security of Machine Owner Key (MOK) relies on secure boot. When secure boot is disabled, EFI firmware will not verify binary code. Then arbitrary efi binary code can modify MOK when rebooting. This patch prevents MOK/MOKx be loaded when secure boot be disabled. Signed-off-by: "Lee, Chun-Yi" Reviewed-by: Petr Vorel Signed-off-by: Mimi Zohar commit 54bf7fa3efd08eea03e4bac04e188ee3db6173a7 Author: Takashi Iwai Date: Mon Dec 13 17:11:45 2021 +0100 ima: Fix undefined arch_ima_get_secureboot() and co Currently arch_ima_get_secureboot() and arch_get_ima_policy() are defined only when CONFIG_IMA is set, and this makes any code calling those functions without CONFIG_IMA fail. Move the declaration and the dummy definition of those functions outside ifdef-CONFIG_IMA block for fixing the undefined symbols. Signed-off-by: Takashi Iwai [zohar@linux.ibm.com: removed in-tree/out-of-tree comment in patch description] Reviewed-by: Petr Vorel Signed-off-by: Mimi Zohar commit d27bb69dc83f00f86a830298c967052cded6e784 Author: Marijn Suijten Date: Fri Dec 24 12:34:50 2021 +0100 regulator: qcom-labibb: OCP interrupts are not a failure while disabled Receiving the Over-Current Protection interrupt while the regulator is disabled does not count as unhandled/failure (IRQ_NONE, or 0 as it were) but a "fake event", usually due to inrush as the is regulator about to be enabled. Fixes: 390af53e0411 ("regulator: qcom-labibb: Implement short-circuit and over-current IRQs") Signed-off-by: Marijn Suijten Reviewed-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20211224113450.107958-1-marijn.suijten@somainline.org Signed-off-by: Mark Brown commit 5c5f08f7fc0bee9a1bc3fbdcb7a21cfd0648ab14 Author: V sujith kumar Reddy Date: Fri Dec 24 20:30:43 2021 +0530 ASoC: amd: acp: Power on/off the speaker enable gpio pin based on DAPM callback. Configure the speaker gpio pin based on power sequence of the DAPM speaker events. Enable speaker after widget power up and Disable before widget powerdown. Signed-off-by: V sujith kumar Reddy Link: https://lore.kernel.org/r/20211224150058.2444776-1-vsujithkumar.reddy@amd.com Signed-off-by: Mark Brown commit b2fde4deff854ca7d49ec735a8252d944418b64d Author: chiminghao Date: Thu Dec 9 01:57:07 2021 +0000 ASoC: remove unneeded variable return value form directly instead of taking this in another redundant variable. Reported-by: Zeal Robot Signed-off-by: chiminghao Link: https://lore.kernel.org/r/20211209015707.409870-1-chi.minghao@zte.com.cn Signed-off-by: Mark Brown commit 9de2b9286a6dd16966959b3cb34fc2ddfd39213e Author: Jiasheng Jiang Date: Wed Dec 22 09:51:57 2021 +0800 ASoC: mediatek: Check for error clk pointer Yes, you are right and now the return code depending on the init_clks(). Fixes: 6078c651947a ("soc: mediatek: Refine scpsys to support multiple platform") Signed-off-by: Jiasheng Jiang Link: https://lore.kernel.org/r/20211222015157.1025853-1-jiasheng@iscas.ac.cn Signed-off-by: Mark Brown commit 082482a5022780d42180a394fe6843e71fe963d8 Author: Tzung-Bi Shih Date: Fri Dec 24 14:47:19 2021 +0800 ASoC: mediatek: mt8195: release device_node after snd_soc_register_card Device nodes can be released after components have bound. Shortens the lifecycle of the device nodes. Releases the reference counts after snd_soc_register_card. Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20211224064719.2031210-5-tzungbi@google.com Signed-off-by: Mark Brown commit db3f5abe68ea5ea39d84e6af4f0f2ce5d5e2daf4 Author: Tzung-Bi Shih Date: Fri Dec 24 14:47:18 2021 +0800 ASoC: mediatek: mt8173: reduce log verbosity in probe() Eliminates error messages if snd_soc_register_card() failed. Kernel emits messages if device probe error anyway. Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20211224064719.2031210-4-tzungbi@google.com Signed-off-by: Mark Brown commit cb006006fe6221f092fadaffd3f219288304c9ad Author: Tzung-Bi Shih Date: Fri Dec 24 14:47:17 2021 +0800 ASoC: mediatek: mt8183: fix device_node leak Fixes the device_node leak. Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20211224064719.2031210-3-tzungbi@google.com Signed-off-by: Mark Brown commit 493433785df0075afc0c106ab65f10a605d0b35d Author: Tzung-Bi Shih Date: Fri Dec 24 14:47:16 2021 +0800 ASoC: mediatek: mt8173: fix device_node leak Fixes the device_node leak. Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20211224064719.2031210-2-tzungbi@google.com Signed-off-by: Mark Brown commit 63a6aa963dd01b66019b7834cc84d032e145bb00 Author: Pierre-Louis Bossart Date: Fri Dec 24 10:10:34 2021 +0800 soundwire: intel: remove PDM support While the hardware supports PDM streams, this capability has never been tested or enabled on any product, so this is dead-code. Let's remove all this. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Péter Ujfalusi Reviewed-by: Rander Wang Signed-off-by: Bard Liao Acked-By: Vinod Koul Link: https://lore.kernel.org/r/20211224021034.26635-8-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit 9283b6f923f3bdd92bdeaf259c6b7a5e9dac6900 Author: Pierre-Louis Bossart Date: Fri Dec 24 10:10:33 2021 +0800 soundwire: intel: remove unnecessary init cppcheck warning: drivers/soundwire/intel.c:1487:10: style: Variable 'ret' is assigned a value that is never used. [unreadVariable] int ret = 0; ^ Signed-off-by: Pierre-Louis Bossart Reviewed-by: Péter Ujfalusi Reviewed-by: Rander Wang Signed-off-by: Bard Liao Acked-By: Vinod Koul Link: https://lore.kernel.org/r/20211224021034.26635-7-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit 636110411ca726f19ef8e87b0be51bb9a4cdef06 Author: Pierre-Louis Bossart Date: Fri Dec 24 10:10:32 2021 +0800 ASoC: Intel/SOF: use set_stream() instead of set_tdm_slots() for HDAudio Overloading the tx_mask with a linear value is asking for trouble and only works because the codec_dai hw_params() is called before the cpu_dai hw_params(). Move to the more generic set_stream() API to pass the hdac_stream information. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20211224021034.26635-6-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit e8444560b4d9302a511f0996f4cfdf85b628f4ca Author: Pierre-Louis Bossart Date: Fri Dec 24 10:10:31 2021 +0800 ASoC/SoundWire: dai: expand 'stream' concept beyond SoundWire The HDAudio ASoC support relies on the set_tdm_slots() helper to store the HDaudio stream tag in the tx_mask. This only works because of the pre-existing order in soc-pcm.c, where the hw_params() is handled for codec_dais *before* cpu_dais. When the order is reversed, the stream_tag is used as a mask in the codec fixup functions: /* fixup params based on TDM slot masks */ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && codec_dai->tx_mask) soc_pcm_codec_params_fixup(&codec_params, codec_dai->tx_mask); As a result of this confusion, the codec_params_fixup() ends-up generating bad channel masks, depending on what stream_tag was allocated. We could add a flag to state that the tx_mask is really not a mask, but it would be quite ugly to persist in overloading concepts. Instead, this patch suggests a more generic get/set 'stream' API based on the existing model for SoundWire. We can expand the concept to store 'stream' opaque information that is specific to different DAI types. In the case of HDAudio DAIs, we only need to store a stream tag as an unsigned char pointer. The TDM rx_ and tx_masks should really only be used to store masks. Rename get_sdw_stream/set_sdw_stream callbacks and helpers as get_stream/set_stream. No functionality change beyond the rename. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Acked-By: Vinod Koul Link: https://lore.kernel.org/r/20211224021034.26635-5-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit 8ddeafb957a9a6dd33b2c80309d726d3141df08f Author: Ranjani Sridharan Date: Fri Dec 24 10:10:30 2021 +0800 soundwire: intel: improve suspend flows This patch provides both a simplification of the suspend flows and a better balanced operation during suspend/resume transition, as part of the transition of Sound Open Firmware (SOF) to dynamic pipelines: the DSP resources are only enabled when required instead of enabled on startup. The exiting code relies on a convoluted way of dealing with suspend signals. Since there is no .suspend DAI callback, we used the component .suspend and marked all the component DAI dmas as 'suspended'. The information was used in the .prepare stage to differentiate resume operations from xrun handling, and only reinitialize SHIM registers and DMA in the former case. While this solution has been working reliably for about 2 years, there is a much better solution consisting in trapping the TRIGGER_SUSPEND in the .trigger DAI ops. The DMA is still marked in the same way for the .prepare op to run, but in addition the callbacks sent to DSP firmware are now balanced. Normal operation: hw_params -> intel_params_stream hw_free -> intel_free_stream suspend -> intel_free_stream prepare -> intel_params_stream This balanced operation was not required with existing SOF firmware relying on static pipelines instantiated at every boot. With the on-going transition to dynamic pipelines, it's however a requirement to keep the use count for the DAI widget balanced across all transitions. The component suspend is not removed but instead modified to deal with a corner case: when a substream is PAUSED, the ALSA core does not throw the TRIGGER_SUSPEND. This is problematic since the refcount for all pipelines and widgets is not balanced, leading to issues on resume. The trigger callback keeps track of the 'paused' state with a new flag, which is tested during the component suspend called later to release the remaining DSP resources. These resources will be re-enabled in the .prepare step. The IPC used in the TRIGGER_SUSPEND to release DSP resources is not a problem since the BE dailink is already marked as non-atomic. Co-developed-by: Pierre-Louis Bossart Signed-off-by: Pierre-Louis Bossart Signed-off-by: Ranjani Sridharan Signed-off-by: Bard Liao Acked-By: Vinod Koul Link: https://lore.kernel.org/r/20211224021034.26635-4-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit b86947b52f0d0e5b6e6f0510933ca13aad266e47 Author: Pierre-Louis Bossart Date: Fri Dec 24 10:10:29 2021 +0800 ASoC/soundwire: intel: simplify callbacks for params/hw_free We don't really need to pass a substream to the callback, we only need the direction. No functionality change, only simplification to enable improve suspend with paused streams. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Acked-By: Vinod Koul Link: https://lore.kernel.org/r/20211224021034.26635-3-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit da893a93eaf8eb2bce03862e00b9998463eeaecf Author: Pierre-Louis Bossart Date: Fri Dec 24 10:10:28 2021 +0800 ASOC: SOF: Intel: use snd_soc_dai_get_widget() We have a helper, use it to simplify widget lookup Suggested-by: Peter Ujfalusi Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20211224021034.26635-2-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit da78fc797fa4126f626303fe4d6cb474c1a80d26 Author: Srinivas Pandruvada Date: Wed Dec 15 17:46:56 2021 -0800 tools/power/x86/intel-speed-select: v1.11 release This release adds following change: - Update max performance when BIOS disabled turbo Signed-off-by: Srinivas Pandruvada Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 9734213ed413da5ac791a984c8cecf1612fe4888 Author: Srinivas Pandruvada Date: Wed Dec 15 17:28:02 2021 -0800 tools/power/x86/intel-speed-select: Update max frequency When BIOS disables turbo, the cpuinfo_max_freq will also be same as the power up base frequency. When SST-PP causes increase in base frequency the performance will be still limited to the old base frequency as the cpuinfo_max_freq will not be updated. In this case we need to update scaling_max frequency to the new base_frequency. This will result in setting updated max performance limit in the Pstate driver. So performance will not be limited to the old base frequency. Signed-off-by: Srinivas Pandruvada Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 7467d716583eec12ae84a33fb1fb27d22333fc64 Author: Horatiu Vultur Date: Thu Dec 23 09:28:26 2021 +0100 net: phy: micrel: Add config_init for LAN8814 Add config_init for LAN8814. This function is required for the following reasons: - we need to make sure that the PHY is reset, - disable ANEG with QSGMII PCS Host side - swap the MDI-X A,B transmit so that there will not be any link flip-flaps when the PHY gets a link. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 24d8a9001a91716d9399d1606b32ec27e9f6d125 Author: Randy Dunlap Date: Wed Dec 22 22:26:11 2021 -0800 net: wan/lmc: fix spelling of "its" Use the possessive "its" instead of the contraction of "it is" ("it's") in user messages. Signed-off-by: Randy Dunlap Cc: Krzysztof Halasa Cc: "David S. Miller" Cc: Jakub Kicinski Signed-off-by: David S. Miller commit 0b8bf9cb142da59a14622bba168ebcd6d0a54499 Author: Marc Bevand Date: Tue Dec 21 15:31:12 2021 -0800 EDAC/amd64: Add support for family 19h, models 50h-5fh Add the new family 19h models 50h-5fh PCI IDs (device 18h functions 0 and 6) to support Ryzen 5000 APUs ("Cezanne"). Signed-off-by: Marc Bevand Signed-off-by: Borislav Petkov Reviewed-by: Yazen Ghannam Link: https://lore.kernel.org/r/20211221233112.556927-1-m@zorinaq.com commit 2da3db7f498d8b6137566b4869d289938b69de13 Author: Alexander Stein Date: Tue Nov 23 15:53:01 2021 +0100 extcon: Deduplicate code in extcon_set_state_sync() Finding the cable index and checking for changed status is also done in extcon_set_state(). So calling extcon_set_state_sync() will do these checks twice. Remove them and use these checks from extcon_set_state(). Signed-off-by: Alexander Stein Signed-off-by: Chanwoo Choi commit 38b1a3c6197af61b41a166279bc8f5859106b116 Author: Randy Dunlap Date: Sun Nov 14 19:05:36 2021 -0800 extcon: usb-gpio: fix a non-kernel-doc comment Do not use "/**" to begin a non-kernel-doc comment. Fixes this build warning: drivers/extcon/extcon-usb-gpio.c:23: warning: expecting prototype for drivers/extcon/extcon-usb-gpio.c(). Signed-off-by: Randy Dunlap Reported-by: kernel test robot Signed-off-by: Chanwoo Choi commit 19768f80cf23834e65482f1667ff54192d469fee Author: Ming Lei Date: Fri Dec 24 09:08:31 2021 +0800 block: null_blk: only set set->nr_maps as 3 if active poll_queues is > 0 It isn't correct to set set->nr_maps as 3 if g_poll_queues is > 0 since we can change it via configfs for null_blk device created there, so only set it as 3 if active poll_queues is > 0. Fixes divide zero exception reported by Shinichiro. Fixes: 2bfdbe8b7ebd ("null_blk: allow zero poll queues") Reported-by: Shinichiro Kawasaki Signed-off-by: Ming Lei Reviewed-by: Shin'ichiro Kawasaki Link: https://lore.kernel.org/r/20211224010831.1521805-1-ming.lei@redhat.com Signed-off-by: Jens Axboe commit 898c7a9ec81620125f2463714a0f4dea18ad6e54 Author: Ryuta NAKANISHI Date: Wed Dec 22 14:19:29 2021 +0900 phy: uniphier-usb3ss: fix unintended writing zeros to PHY register Similar to commit 4a90bbb478db ("phy: uniphier-pcie: Fix updating phy parameters"), in function uniphier_u3ssphy_set_param(), unintentionally write zeros to other fields when writing PHY registers. Fixes: 5ab43d0f8697 ("phy: socionext: add USB3 PHY driver for UniPhier SoC") Signed-off-by: Ryuta NAKANISHI Signed-off-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/1640150369-4134-1-git-send-email-hayashi.kunihiko@socionext.com Signed-off-by: Vinod Koul commit 33d18746fa514d21df9931a88d20530981f8a064 Author: Chunfeng Yun Date: Sat Dec 18 16:28:02 2021 +0800 phy: phy-mtk-tphy: use new io helpers to access register Use new helpers mtk_phy_clear/set/update_bits() to access registers Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/20211218082802.5256-5-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit 9520bbf3cb2c12fdc41096262fb384b360279329 Author: Chunfeng Yun Date: Sat Dec 18 16:28:01 2021 +0800 phy: phy-mtk-xsphy: use new io helpers to access register Use new helpers mtk_phy_clear/set/update_bits() to access registers Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/20211218082802.5256-4-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit 1371b9a5632a637a93e3a7592c91f64d7067c369 Author: Chunfeng Yun Date: Sat Dec 18 16:28:00 2021 +0800 phy: mediatek: add helpers to update bits of registers Add three helpers mtk_phy_clear/set/update_bits() for registers operation Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/20211218082802.5256-3-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit 6f2b033cb883f64ad084a75f13634242c7e179a6 Author: Chunfeng Yun Date: Sat Dec 18 16:27:59 2021 +0800 phy: phy-mtk-tphy: add support efuse setting Due to some SoCs have a bit shift issue that will drop a bit for usb3 phy or pcie phy, fix it by adding software efuse reading and setting, but only support it optionally for version 2/3. Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/20211218082802.5256-2-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit c6d92a287ae718c3207dddea3f36ea1689ac59a8 Author: Chunfeng Yun Date: Sat Dec 18 16:27:58 2021 +0800 dt-bindings: phy: mediatek: tphy: support software efuse load Add optional property nvmem-cells and nvmem-cell-names to support software efuse load, this helps to fix the efuse bit shift issue on mt8195 etc. Acked-by: Rob Herring Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/20211218082802.5256-1-chunfeng.yun@mediatek.com Signed-off-by: Vinod Koul commit 2c91bf6bf290ffd0a566fe5d7518d2484522816c Author: Dmitry Baryshkov Date: Sat Dec 18 17:17:55 2021 +0300 phy: qcom-qmp: Add SM8450 PCIe1 PHY support There are two different PCIe PHYs on SM8450, one having one lane (v5) and another with two lanes (v5.20). This commit adds support for the second PCIe phy. Signed-off-by: Dmitry Baryshkov Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211218141754.503661-3-dmitry.baryshkov@linaro.org Signed-off-by: Vinod Koul commit 3ba4c0a8f4c91dc4c274bea7a8766463356d6704 Author: Dmitry Baryshkov Date: Sat Dec 18 17:17:54 2021 +0300 dt-bindings: phy: qcom,qmp: Add SM8450 PCIe PHY bindings There are two different PCIe PHYs on SM8450, one having one lane and another with two lanes. Add support for second (gen4, two lanes) PHY. Signed-off-by: Dmitry Baryshkov Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211218141754.503661-2-dmitry.baryshkov@linaro.org Signed-off-by: Vinod Koul commit d7779e22e89a78aa2d3f80584a8d1672ac39c3cf Author: Lad Prabhakar Date: Sat Dec 18 15:06:25 2021 +0000 crypto: ux500 - Use platform_get_irq() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq() so that interrupt mapping is created on demand. While at it also store the IRQ number in struct cryp_device_data so that we don't have to call platform_get_irq() frequently. Signed-off-by: Lad Prabhakar Signed-off-by: Herbert Xu commit 4cee0700cf1d23b36f2c85507ff83b466a0e63a7 Author: Weili Qian Date: Sat Dec 18 18:17:20 2021 +0800 crypto: hisilicon/qm - disable qm clock-gating For Kunpeng930, if qm clock-gating is enabled, rate limiter will be inaccurate. Therefore, disable clock-gating before doing task. Signed-off-by: Weili Qian Signed-off-by: Herbert Xu commit c2aec59be093bd44627bc4f6bc67e4614a93a7b6 Author: Heiner Kallweit Date: Fri Dec 17 10:03:30 2021 +0100 crypto: omap-aes - Fix broken pm_runtime_and_get() usage This fix is basically the same as 3d6b661330a7 ("crypto: stm32 - Revert broken pm_runtime_resume_and_get changes"), just for the omap driver. If the return value isn't used, then pm_runtime_get_sync() has to be used for ensuring that the usage count is balanced. Fixes: 1f34cc4a8da3 ("crypto: omap-aes - Fix PM reference leak on omap-aes.c") Cc: stable@vger.kernel.org Signed-off-by: Heiner Kallweit Signed-off-by: Herbert Xu commit ace7660691f8a23f1a72e065babd176aed3605b9 Author: Pankaj Gupta Date: Fri Dec 17 13:42:33 2021 +0530 MAINTAINERS: update caam crypto driver maintainers list Adding Gaurav as caam maintainer. Signed-off-by: Pankaj Gupta Reviewed-by: Horia Geantă Signed-off-by: Herbert Xu commit 10371b6212bb682f13247733d6b76b91b2b80f9a Author: Dan Carpenter Date: Fri Dec 17 10:13:32 2021 +0300 crypto: octeontx2 - prevent underflow in get_cores_bmap() If we're going to cap "eng_grp->g->engs_num" upper bounds then we should cap the lower bounds as well. Fixes: 43ac0b824f1c ("crypto: octeontx2 - load microcode and create engine groups") Signed-off-by: Dan Carpenter Signed-off-by: Herbert Xu commit 3438e7220b3183b1ee80227e3a0d742b18df4623 Author: Dan Carpenter Date: Fri Dec 17 10:12:32 2021 +0300 crypto: octeontx2 - out of bounds access in otx2_cpt_dl_custom_egrp_delete() If "egrp" is negative then it is causes an out of bounds access in eng_grps->grp[]. Fixes: d9d7749773e8 ("crypto: octeontx2 - add apis for custom engine groups") Signed-off-by: Dan Carpenter Signed-off-by: Herbert Xu commit 0cec19c761e5cc8d6fa43df622791e941b7a8033 Author: Tomasz Kowalik Date: Thu Dec 16 09:13:34 2021 +0000 crypto: qat - add support for compression for 4xxx Add the logic required to enable the compression service for 4xxx devices. This allows to load the compression firmware image and report the appropriate compression capabilities. The firmware image selection for a given device is based on the 'ServicesEnabled' key stored in the internal configuration, which is added statically at the probe of the device according to the following rule, by default: - odd numbered devices assigned to compression services - even numbered devices assigned to crypto services In addition, restore the 'ServicesEnabled' key, if present, when SRIOV is enabled on the device. Signed-off-by: Tomasz Kowalik Co-developed-by: Mateuszx Potrola Signed-off-by: Mateuszx Potrola Co-developed-by: Giovanni Cabiddu Signed-off-by: Giovanni Cabiddu Signed-off-by: Marco Chiappero Reviewed-by: Fiona Trahe Reviewed-by: Marco Chiappero Signed-off-by: Herbert Xu commit beb1e6d71f0ef906ff986710fdd4ad4fc1542302 Author: Giovanni Cabiddu Date: Thu Dec 16 09:13:33 2021 +0000 crypto: qat - allow detection of dc capabilities for 4xxx Add logic to allow the detection of data compression capabilities for 4xxx devices. The capability detection logic has been refactored to separate the crypto capabilities from the compression ones. This patch is not updating the returned capability mask as, up to now, 4xxx devices are configured only to handle crypto operations. Signed-off-by: Giovanni Cabiddu Signed-off-by: Marco Chiappero Reviewed-by: Fiona Trahe Reviewed-by: Marco Chiappero Signed-off-by: Herbert Xu commit 0bba03ce9739be004d7e7060a1a127418fd0055c Author: Marco Chiappero Date: Thu Dec 16 09:13:32 2021 +0000 crypto: qat - add PFVF support to enable the reset of ring pairs Extend support for resetting ring pairs on the device to VFs. Such reset happens by sending a request to the PF over the PFVF protocol. This patch defines two new PFVF messages and adds the PFVF logic for handling the request on PF, triggering the reset, and VFs, accepting the 'success'/'error' response. This feature is GEN4 specific. This patch is based on earlier work done by Zelin Deng. Signed-off-by: Marco Chiappero Reviewed-by: Giovanni Cabiddu Reviewed-by: Fiona Trahe Signed-off-by: Herbert Xu commit a9dc0d966605377e9aa512efdcaf9653f40cc2d5 Author: Marco Chiappero Date: Thu Dec 16 09:13:31 2021 +0000 crypto: qat - add PFVF support to the GEN4 host driver So far PFVF support for GEN4 devices has been kept effectively disabled due to lack of support. This patch adds all the GEN4 specific logic to make PFVF fully functional on PF. 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 925b3069cf6e37a86fc752a35578ec875772bc7c Author: Marco Chiappero Date: Thu Dec 16 09:13:30 2021 +0000 crypto: qat - config VFs based on ring-to-svc mapping Change the configuration logic for the VF driver to leverage the ring-to-service mappings now received via PFVF. While the driver config logic is not yet capable of supporting configurations other than the default mapping, make sure that both VF and PF share the same default configuration in order to work properly. Signed-off-by: Marco Chiappero Reviewed-by: Giovanni Cabiddu Reviewed-by: Fiona Trahe Signed-off-by: Herbert Xu commit e1b176af3d7ecf9f9c0c0db374b37a40073ac960 Author: Marco Chiappero Date: Thu Dec 16 09:13:29 2021 +0000 crypto: qat - exchange ring-to-service mappings over PFVF In addition to retrieving the device capabilities, a VF may also need to retrieve the mapping of its ring pairs to crypto and or compression services in order to work properly. Make the VF receive the ring-to-service mappings from the PF by means of a new REQ_RING_SVC_MAP Block Message and add the request and response logic on VF and PF respectively. This change requires to bump the PFVF protocol to version 4. Signed-off-by: Marco Chiappero Reviewed-by: Giovanni Cabiddu Reviewed-by: Fiona Trahe Signed-off-by: Herbert Xu commit 73ef8f3382d10dbed6fff0b606f9a3351068a0b9 Author: Marco Chiappero Date: Thu Dec 16 09:13:28 2021 +0000 crypto: qat - support fast ACKs in the PFVF protocol The original design and current implementation of the PFVF protocol expects the sender to both acquire and relinquish the ownership of the shared CSR by setting and clearing the "in use" pattern on the remote half of the register when sending a message. This happens regardless of the acknowledgment of the reception, to guarantee changes, including collisions, are surely detected. However, in the case of a request that requires a response, collisions can also be detected by the lack of a reply. This can be exploited to speed up and simplify the above behaviour, letting the receiver both acknowledge the message and release the CSR in a single transaction: 1) the sender can return as soon as the message has been acknowledged 2) the receiver doesn't have to wait long before acquiring ownership of the CSR for the response message, greatly improving the overall throughput. Howerver, this improvement cannot be leveraged for fire-and-forget notifications, as it would be impossible for the sender to clearly distinguish between a collision and an ack immediately followed by a new message. This patch implements this optimization in a new version of the protocol (v3), which applies the fast-ack logic only whenever possible and guarantees backward compatibility with older versions. For requests, a new retry loop guarantees a correct behaviour. Signed-off-by: Marco Chiappero Reviewed-by: Giovanni Cabiddu Reviewed-by: Fiona Trahe Signed-off-by: Herbert Xu commit 851ed498dba11b96d2f696e23f9084e0add1896f Author: Marco Chiappero Date: Thu Dec 16 09:13:27 2021 +0000 crypto: qat - exchange device capabilities over PFVF Allow the VF driver to get the supported device capabilities through PFVF, by adding a new block message, the Capability Summary. This messages allows to exchange the capability through masks, which report, depending on the Capability Summary version, up to the following information: - algorithms and/or services that are supported by the device (e.g. symmetric crypto, data compression, etc.) - (extended) compression capabilities, with details about the compression service (e.g. if compress and verify is supported by this device) - the frequency of the device This patch supports the latest Capabilities Summary version 3 for VFs, but will limit support for the PF driver to version 2. This change also increases the PFVF protocol to version 2. Signed-off-by: Marco Chiappero Reviewed-by: Giovanni Cabiddu Reviewed-by: Fiona Trahe Signed-off-by: Herbert Xu commit 673184a2a58f93f0c170d30247155b3f86ba69ee Author: Marco Chiappero Date: Thu Dec 16 09:13:26 2021 +0000 crypto: qat - introduce support for PFVF block messages GEN2 devices use a single CSR for PFVF messages, which leaves up to 10 bits of payload per single message. While such amount is sufficient for the currently defined messages, the transfer of bigger and more complex data streams from the PF to the VF requires a new mechanism that extends the protocol. This patch adds a new layer on top of the basic PFVF messaging, called Block Messages, to encapsulate up to 126 bytes of data in a single logical message across multiple PFVF messages of new types (SMALL, MEDIUM and LARGE BLOCK), including (sub)types (BLKMSG_TYPE) to carry the information about the actual Block Message. Regardless of the size, each Block Message uses a two bytes header, containing the version and size, to allow for extension while maintaining compatibility. The size and the types of Block Messages are defined as follow: - small block messages: up to 16 BLKMSG types of up to 30 bytes - medium block messages: up to 8 BLKMSG types of up to 62 bytes - large block messages: up to 4 BLKMSG types of up to 126 bytes It effectively works as reading a byte at a time from a block device and for each of these new Block Messages: - the requestor (always a VF) can either request a specific byte of the larger message, in order to retrieve the full message, or request the value of the CRC calculated for a specific message up to the provided size (to allow for messages to grow while maintaining forward compatibility) - the responder (always the PF) will either return a single data or CRC byte, along with the indication of response type (or error). This patch provides the basic infrastructure to perform the above operations, without defining any new message. As CRCs are required, this code now depends on the CRC8 module. Note: as a consequence of the Block Messages design, sending multiple PFVF messages in bursts, the interrupt rate limiting values on the PF are increased. 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 3a5b2a0883288527e71450978c0f5c442aab1218 Author: Marco Chiappero Date: Thu Dec 16 09:13:25 2021 +0000 crypto: qat - store the ring-to-service mapping This driver relies on either the FW (on the PF) or the PF (on the VF) to know how crypto services and rings map to one another. Store this information so that it can be referenced in the future at runtime for checks or extensions. Signed-off-by: Marco Chiappero Reviewed-by: Giovanni Cabiddu Reviewed-by: Fiona Trahe Signed-off-by: Herbert Xu commit 4d03135faa059443a2cfcbee758d9db8bada7fe1 Author: Marco Chiappero Date: Thu Dec 16 09:13:24 2021 +0000 crypto: qat - store the PFVF protocol version of the endpoints This patch adds an entry for storing the PFVF protocol version for both PF and VFs. While not currently used, knowing and storing the remote protocol version enables more complex compatibility checks and/or newer features for compatible PFVF endpoints in the future. Signed-off-by: Marco Chiappero Reviewed-by: Giovanni Cabiddu Reviewed-by: Fiona Trahe Signed-off-by: Herbert Xu commit 6f87979129d10cff5b4b0b49343720b99b5357b8 Author: Marco Chiappero Date: Thu Dec 16 09:13:23 2021 +0000 crypto: qat - improve the ACK timings in PFVF send Review the ACK timings in adf_gen2_pfvf_send() to improve the latency by reducing the polling interval. Also increase the timeout, for higher tolerance in highly loaded systems, and reposition these new values to allow for inclusion by the future GEN4 devices too. 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 1c94d8035905c10f4930708a9944f2ee65d26f47 Author: Marco Chiappero Date: Thu Dec 16 09:13:22 2021 +0000 crypto: qat - leverage read_poll_timeout in PFVF send Replace the polling loop, waiting for the remote end to acknowledge the reception of the message, with the equivalent and standard read_poll_timeout() in adf_gen2_pfvf_send(). Also, the use of the read_poll_timeout(): - implies the use of microseconds for the timings, so update the previous values from ms to us - allows to leverage the return value for both success and error, removing the need for the reset of the 'ret' variable soon after the 'start' label. 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 952f4e81274131eda4ab0d751d6f2700b0356542 Author: Marco Chiappero Date: Thu Dec 16 09:13:21 2021 +0000 crypto: qat - leverage bitfield.h utils for PFVF messages The PFVF protocol defines messages composed of a number of control bitfields. Replace all the code setting and retrieving such bits with the utilities from bitfield.h, to improve code quality and readability. Signed-off-by: Marco Chiappero Reviewed-by: Giovanni Cabiddu Reviewed-by: Fiona Trahe Signed-off-by: Herbert Xu commit db1c034801c402b1f600ef7f753494479950f78e Author: Marco Chiappero Date: Thu Dec 16 09:13:20 2021 +0000 crypto: qat - abstract PFVF messages with struct pfvf_message This implementation of the PFVF protocol was designed around the GEN2 devices and its CSR format. In order to support future generations, which come with differently sized fields, change the definition of the PFVF message and make it abstract by means of a new pfvf_message struct. Also, introduce some utilities to translate to and from the new message format and the device specific CSR format. Signed-off-by: Marco Chiappero Reviewed-by: Giovanni Cabiddu Reviewed-by: Fiona Trahe Signed-off-by: Herbert Xu commit 0aeda694f1870f50900603c276423ffc05035f90 Author: Marco Chiappero Date: Thu Dec 16 09:13:19 2021 +0000 crypto: qat - set PFVF_MSGORIGIN just before sending In this implementation of the PFVF protocol every egressing message must include the ADF_PFVF_MSGORIGIN_SYSTEM flag. However, this flag can be set on all the outbound messages just before sending them rather than at message build time, as currently done. Remove the unnecessary code duplication by setting the ADF_PFVF_MSGORIGIN_SYSTEM flag only once at send time in adf_gen2_pfvf_send(). Signed-off-by: Marco Chiappero Reviewed-by: Giovanni Cabiddu Reviewed-by: Fiona Trahe Signed-off-by: Herbert Xu commit 028042856802c4731c6afebe15d95fed4d39a614 Author: Marco Chiappero Date: Thu Dec 16 09:13:18 2021 +0000 crypto: qat - make PFVF send and receive direction agnostic Currently PF and VF share the same send and receive logic for the PFVF protocol. However, the inner behaviour still depends on the specific direction, requiring a test to determine the if the sender is a PF or a VF. Moreover the vf_nr parameter is only required for PF2VF messages and ignored for the opposite direction. Make the GEN2 send and recv completely direction agnostic, by calculating and determining any direction specific input in the caller instead, and feeding the send and the receive functions with the same arguments for both PF and VF. In order to accommodate for this change, the API of the pfvf_ops send and recv has been modified to remove any reference to vf_nr. Signed-off-by: Marco Chiappero Reviewed-by: Giovanni Cabiddu Reviewed-by: Fiona Trahe Signed-off-by: Herbert Xu commit 6ed942ed3c47b3ebb4e8de3ff10e761cdf82ba74 Author: Marco Chiappero Date: Thu Dec 16 09:13:17 2021 +0000 crypto: qat - make PFVF message construction direction agnostic Currently PFVF messages are created upfront in the CSR format, that is PF2VF messages starting from bit 0 and VF2PF from bit 16, and passed along unmodified to the PFVF send function. Refactor the code to allow the VF2PF messages to be built starting from bit 0, as for the PF2VF messages. Shift the VF to PF messages just before sending them, and refactor the send logic to handle messages properly depending on the direction. As a result all the messages are composed the same way regardless of the direction. Signed-off-by: Marco Chiappero Reviewed-by: Giovanni Cabiddu Reviewed-by: Fiona Trahe Signed-off-by: Herbert Xu commit 448588adcdf4a025b0b5517a5c9557b036b3cf79 Author: Marco Chiappero Date: Thu Dec 16 09:13:16 2021 +0000 crypto: qat - add the adf_get_pmisc_base() helper function Add and use the new helper function adf_get_pmisc_base() where convenient. Also: - remove no longer shared variables - leverage other utilities, such as GET_PFVF_OPS(), as a consequence - consistently use the "pmisc_addr" name for the returned value of this new helper 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 03125541ca29fda7b98bea08dfed68ae0e39b46c Author: Marco Chiappero Date: Thu Dec 16 09:13:15 2021 +0000 crypto: qat - support the reset of ring pairs on PF Add support for triggering a HW reset of a specific ring pair. Being a device specific feature, add it to the hw_device_data struct. This feature is supported only by QAT GEN4 devices. This patch is based on earlier work done by Zelin Deng. 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 4b44d28c715d3db2c8de1e4ec9ccfdf230001007 Author: Giovanni Cabiddu Date: Thu Dec 16 09:13:14 2021 +0000 crypto: qat - extend crypto capability detection for 4xxx Extended the capability detection logic for 4xxx devices. Mask out unsupported algorithms and services based on the value read in the fuse register. This includes only capabilities for the crypto service. Signed-off-by: Giovanni Cabiddu Signed-off-by: Marco Chiappero Reviewed-by: Fiona Trahe Reviewed-by: Marco Chiappero Signed-off-by: Herbert Xu commit cfe4894eccdc7fa5cd35bf34e918614d06ecce38 Author: Giovanni Cabiddu Date: Thu Dec 16 09:13:13 2021 +0000 crypto: qat - set COMPRESSION capability for QAT GEN2 Enhance the device capability detection for QAT GEN2 devices to detect if a device supports the compression service. This is done by checking both the fuse and the strap registers for c62x and c3xxx and only the fuse register for dh895xcc. Signed-off-by: Giovanni Cabiddu Signed-off-by: Marco Chiappero Reviewed-by: Fiona Trahe Reviewed-by: Marco Chiappero Signed-off-by: Herbert Xu commit 547bde7bd4ecd78f36f98744e6c9a0999e52da5a Author: Giovanni Cabiddu Date: Thu Dec 16 09:13:12 2021 +0000 crypto: qat - set CIPHER capability for QAT GEN2 Set the CIPHER capability for QAT GEN2 devices if the hardware supports it. This is done if both the CIPHER and the AUTHENTICATION engines are available on the device. Signed-off-by: Giovanni Cabiddu Signed-off-by: Marco Chiappero Reviewed-by: Fiona Trahe Reviewed-by: Marco Chiappero Signed-off-by: Herbert Xu commit e0441e2be1553d34341bc5b60d279f3561d1b8b7 Author: Giovanni Cabiddu Date: Thu Dec 16 09:13:11 2021 +0000 crypto: qat - get compression extended capabilities Get compression extended capabilities mask from firmware through the init/admin channel. These capabilities are stored in the accel_dev structure and will be communicated to VF through the PFVF channel. Signed-off-by: Giovanni Cabiddu Signed-off-by: Marco Chiappero Reviewed-by: Fiona Trahe Reviewed-by: Marco Chiappero Signed-off-by: Herbert Xu commit 3954ab6d9fce7df915a35a6ad4d657753340b011 Author: Jiapeng Chong Date: Thu Dec 16 15:48:14 2021 +0800 crypto: octeontx2 - Use swap() instead of swap_engines() Fix the following coccicheck warning: ./drivers/crypto/marvell/octeontx2/otx2_cptpf_ucode.c:1523:16-17: WARNING opportunity for swap(). Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Herbert Xu commit eca568a39481728224edd5c2053ead5479dd8e07 Author: Corentin Labbe Date: Wed Dec 15 10:42:39 2021 +0000 crypto: omap - increase priority of DES/3DES Give the same priority of OMAP DES/3DES than OMAP AES for being sure it is picked before software implementation. Signed-off-by: Corentin Labbe Signed-off-by: Herbert Xu commit acd93f8a4ca784d8eff303c6cae49f3bf7b3a499 Author: Jason A. Donenfeld Date: Tue Dec 14 17:01:46 2021 +0100 crypto: x86/curve25519 - use in/out register constraints more precisely Rather than passing all variables as modified, pass ones that are only read into that parameter. This helps with old gcc versions when alternatives are additionally used, and lets gcc's codegen be a little bit more efficient. This also syncs up with the latest Vale/EverCrypt output. Reported-by: Mathias Krause Cc: Aymeric Fromherz Link: https://lore.kernel.org/wireguard/1554725710.1290070.1639240504281.JavaMail.zimbra@inria.fr/ Link: https://github.com/project-everest/hacl-star/pull/501 Signed-off-by: Jason A. Donenfeld Reviewed-by: Mathias Krause Signed-off-by: Herbert Xu commit 38e9791a02090414d1e3433549001689cad71098 Author: Sunil Goutham Date: Tue Dec 14 16:21:08 2021 +0530 hwrng: cn10k - Add random number generator support CN10K series of silicons support true random number generators. This patch adds support for the same. Also supports entropy health status checking. Signed-off-by: Sunil Goutham Signed-off-by: Bharat Bhushan Signed-off-by: Joseph Longever Signed-off-by: Herbert Xu commit 223a41f54946a22616c2b9a0abc86e55f74efc69 Author: Yang Shen Date: Tue Dec 14 14:45:09 2021 +0800 crypto: hisilicon/zip - add new algorithms for uacce device Enable deflate/lz77_zstd algorithm for uacce device on Kunpeng930. Signed-off-by: Yang Shen Signed-off-by: Herbert Xu commit 8b3f91332291fa280a56215f5189baca185998f5 Merge: f2b551fad8d8f 391e5975c0208 Author: Jakub Kicinski Date: Thu Dec 23 16:09:58 2021 -0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net include/net/sock.h commit 8f905c0e7354 ("inet: fully convert sk->sk_rx_dst to RCU rules") commit 43f51df41729 ("net: move early demux fields close to sk_refcnt") https://lore.kernel.org/all/20211222141641.0caa0ab3@canb.auug.org.au/ Signed-off-by: Jakub Kicinski commit d1199b94474ac4513b8491a4b751a8a466e1886b Author: Harshad Shirwadkar Date: Thu Dec 23 12:21:40 2021 -0800 ext4: update fast commit TODOs This series takes care of a couple of TODOs and adds new ones. Update the TODOs section to reflect current state and future work that needs to happen. Signed-off-by: Harshad Shirwadkar Link: https://lore.kernel.org/r/20211223202140.2061101-5-harshads@google.com Signed-off-by: Theodore Ts'o commit 0915e464cb274648e1ef1663e1356e53ff400983 Author: Harshad Shirwadkar Date: Thu Dec 23 12:21:39 2021 -0800 ext4: simplify updating of fast commit stats Move fast commit stats updating logic to a separate function from ext4_fc_commit(). This significantly improves readability of ext4_fc_commit(). Signed-off-by: Harshad Shirwadkar Link: https://lore.kernel.org/r/20211223202140.2061101-4-harshads@google.com Signed-off-by: Theodore Ts'o commit 7bbbe241ec7ce0def9f71464c878fdbd2b0dcf37 Author: Harshad Shirwadkar Date: Thu Dec 23 12:21:38 2021 -0800 ext4: drop ineligible txn start stop APIs This patch drops ext4_fc_start_ineligible() and ext4_fc_stop_ineligible() APIs. Fast commit ineligible transactions should simply call ext4_fc_mark_ineligible() after starting the trasaction. Signed-off-by: Harshad Shirwadkar Link: https://lore.kernel.org/r/20211223202140.2061101-3-harshads@google.com Signed-off-by: Theodore Ts'o commit 2729cfdcfa1cc49bef5a90d046fa4a187fdfcc69 Author: Harshad Shirwadkar Date: Thu Dec 23 12:21:37 2021 -0800 ext4: use ext4_journal_start/stop for fast commit transactions This patch drops all calls to ext4_fc_start_update() and ext4_fc_stop_update(). To ensure that there are no ongoing journal updates during fast commit, we also make jbd2_fc_begin_commit() lock journal for updates. This way we don't have to maintain two different transaction start stop APIs for fast commit and full commit. This patch doesn't remove the functions altogether since in future we want to have inode level locking for fast commits. Signed-off-by: Harshad Shirwadkar Link: https://lore.kernel.org/r/20211223202140.2061101-2-harshads@google.com Signed-off-by: Theodore Ts'o commit 9e05e95ca8dae8de4a7a1645014e1bbd9c8a4dab Author: Matthew Wilcox (Oracle) Date: Tue Dec 21 04:44:50 2021 +0000 iomap: Fix error handling in iomap_zero_iter() iomap_write_end() does not return a negative errno to indicate an error, but the number of bytes successfully copied. It cannot return an error today, so include a debugging assertion like the one in iomap_unshare_iter(). Fixes: c6f40468657d ("fsdax: decouple zeroing from the iomap buffered I/O code") Reported-by: Dan Carpenter Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211221044450.517558-1-willy@infradead.org Signed-off-by: Dan Williams commit aa39cc675799bc92da153af9a13d6f969c348e82 Author: Kyeong Yoo Date: Tue Jul 4 16:22:38 2017 +1200 jffs2: GC deadlock reading a page that is used in jffs2_write_begin() GC task can deadlock in read_cache_page() because it may attempt to release a page that is actually allocated by another task in jffs2_write_begin(). The reason is that in jffs2_write_begin() there is a small window a cache page is allocated for use but not set Uptodate yet. This ends up with a deadlock between two tasks: 1) A task (e.g. file copy) - jffs2_write_begin() locks a cache page - jffs2_write_end() tries to lock "alloc_sem" from jffs2_reserve_space() <-- STUCK 2) GC task (jffs2_gcd_mtd3) - jffs2_garbage_collect_pass() locks "alloc_sem" - try to lock the same cache page in read_cache_page() <-- STUCK So to avoid this deadlock, hold "alloc_sem" in jffs2_write_begin() while reading data in a cache page. Signed-off-by: Kyeong Yoo Signed-off-by: Richard Weinberger commit 50cb4373254433ad015dd50a061194c693b37c16 Author: Baokun Li Date: Mon Nov 15 09:31:44 2021 +0800 ubifs: read-only if LEB may always be taken in ubifs_garbage_collect If ubifs_garbage_collect_leb() returns -EAGAIN and ubifs_return_leb returns error, a LEB will always has a "taken" flag. In this case, set the ubifs to read-only to prevent a worse situation. Signed-off-by: Baokun Li Signed-off-by: Richard Weinberger commit 0d76502172d83e1e09aedbdced3d8be0ef1abcb5 Author: Baokun Li Date: Mon Nov 15 09:31:43 2021 +0800 ubifs: fix double return leb in ubifs_garbage_collect If ubifs_garbage_collect_leb() returns -EAGAIN and enters the "out" branch, ubifs_return_leb will execute twice on the same lnum. This can cause data loss in concurrency situations. Reported-by: Hulk Robot Signed-off-by: Baokun Li Signed-off-by: Richard Weinberger commit 88618feecf44e774e03cf49872567398b0177d25 Author: Baokun Li Date: Mon Nov 15 09:31:42 2021 +0800 ubifs: fix slab-out-of-bounds in ubifs_change_lp Hulk Robot reported a KASAN report about slab-out-of-bounds: ================================================================== BUG: KASAN: slab-out-of-bounds in ubifs_change_lp+0x3a9/0x1390 [ubifs] Read of size 8 at addr ffff888101c961f8 by task fsstress/1068 [...] Call Trace: check_memory_region+0x1c1/0x1e0 ubifs_change_lp+0x3a9/0x1390 [ubifs] ubifs_change_one_lp+0x170/0x220 [ubifs] ubifs_garbage_collect+0x7f9/0xda0 [ubifs] ubifs_budget_space+0xfe4/0x1bd0 [ubifs] ubifs_write_begin+0x528/0x10c0 [ubifs] Allocated by task 1068: kmemdup+0x25/0x50 ubifs_lpt_lookup_dirty+0x372/0xb00 [ubifs] ubifs_update_one_lp+0x46/0x260 [ubifs] ubifs_tnc_end_commit+0x98b/0x1720 [ubifs] do_commit+0x6cb/0x1950 [ubifs] ubifs_run_commit+0x15a/0x2b0 [ubifs] ubifs_budget_space+0x1061/0x1bd0 [ubifs] ubifs_write_begin+0x528/0x10c0 [ubifs] [...] ================================================================== In ubifs_garbage_collect(), if ubifs_find_dirty_leb returns an error, lp is an uninitialized variable. But lp.num might be used in the out branch, which is a random value. If the value is -1 or another value that can pass the check, soob may occur in the ubifs_change_lp() in the following procedure. To solve this problem, we initialize lp.lnum to -1, and then initialize it correctly in ubifs_find_dirty_leb, which is not equal to -1, and ubifs_return_leb is executed only when lp.lnum != -1. if find a retained or indexing LEB and continue to next loop, but break before find another LEB, the "taken" flag of this LEB will be cleaned in ubi_return_lebi(). This bug has also been fixed in this patch. Reported-by: Hulk Robot Signed-off-by: Baokun Li Signed-off-by: Richard Weinberger commit d3de970bcba0fb171e6aceaa0723d2cd842dc25c Author: Dan Carpenter Date: Tue Nov 9 14:50:51 2021 +0300 ubifs: fix snprintf() length check The snprintf() function returns the number of bytes (not including the NUL terminator) which would have been printed if there were enough space. So it can be greater than UBIFS_DFS_DIR_LEN. And actually if it equals UBIFS_DFS_DIR_LEN then that's okay so this check is too strict. Fixes: 9a620291fc01 ("ubifs: Export filesystem error counters") Signed-off-by: Dan Carpenter Signed-off-by: Richard Weinberger commit 040bf2a9446f6ba267225d34dc4a9b14d11e5092 Merge: 4817c37d71b55 5da8b49de472c Author: Dave Airlie Date: Fri Dec 24 06:23:59 2021 +1000 Merge tag 'drm-misc-next-fixes-2021-12-23' of git://anongit.freedesktop.org/drm/drm-misc into drm-next Short summary of fixes pull: * bridge/lvds: Fix DT bindings * vmwgfx: Fix several issues with the recent conversion to GEM Signed-off-by: Dave Airlie From: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/YcRAH8lYbsoSCeY9@linux-uq9g.fritz.box commit 4817c37d71b554fe46ea494f6b2c8562b26640bf Merge: 78942ae41d45e 6cb12fbda1c2e Author: Dave Airlie Date: Fri Dec 24 06:08:29 2021 +1000 Merge tag 'drm-intel-gt-next-2021-12-23' of git://anongit.freedesktop.org/drm/drm-intel into drm-next Driver Changes: - Added bits of DG2 support around page table handling (Stuart Summers, Matthew Auld) - Fixed wakeref leak in PMU busyness during reset in GuC mode (Umesh Nerlige Ramappa) - Fixed debugfs access crash if GuC failed to load (John Harrison) - Bring back GuC error log to error capture, undoing accidental earlier breakage (Thomas Hellström) - Fixed memory leak in error capture caused by earlier refactoring (Thomas Hellström) - Exclude reserved stolen from driver use (Chris Wilson) - Add memory region sanity checking and optional full test (Chris Wilson) - Fixed buffer size truncation in TTM shmemfs backend (Robert Beckett) - Use correct lock and don't overwrite internal data structures when stealing GuC context ids (Matthew Brost) - Don't hog IRQs when destroying GuC contexts (John Harrison) - Make GuC to Host communication more robust (Matthew Brost) - Continuation of locking refactoring around VMA and backing store handling (Maarten Lankhorst) - Improve performance of reading GuC log from debugfs (John Harrison) - Log when GuC fails to reset an engine (John Harrison) - Speed up GuC/HuC firmware loading by requesting RP0 (Vinay Belgaumkar) - Further work on asynchronous VMA unbinding (Thomas Hellström, Christian König) - Refactor GuC/HuC firmware handling to prepare for future platforms (John Harrison) - Prepare for future different GuC/HuC firmware signing key sizes (Daniele Ceraolo Spurio, Michal Wajdeczko) - Add noreclaim annotations (Matthew Auld) - Remove racey GEM_BUG_ON between GPU reset and GuC communication handling (Matthew Brost) - Refactor i915->gt with to_gt(i915) to prepare for future platforms (Michał Winiarski, Andi Shyti) - Increase GuC log size for CONFIG_DEBUG_GEM (John Harrison) - Fixed engine busyness in selftests when in GuC mode (Umesh Nerlige Ramappa) - Make engine parking work with PREEMPT_RT (Sebastian Andrzej Siewior) - Replace X86_FEATURE_PAT with pat_enabled() (Lucas De Marchi) - Selftest for stealing of guc ids (Matthew Brost) Signed-off-by: Dave Airlie From: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/YcRvKO5cyPvIxVCi@tursulin-mobl2 commit 78942ae41d45e135d1db26b4fe147d1ef48b3b2f Merge: 236f0f4eac19c cdd156955f946 Author: Dave Airlie Date: Fri Dec 24 06:01:39 2021 +1000 Merge branch 'etnaviv/next' of https://git.pengutronix.de/git/lst/linux into drm-next - make etnaviv work on IOMMU enabled systems - fix mapping of command buffers on systems with more than 4GB RAM - close a DoS vector - fix spurious GPU resets Signed-off-by: Dave Airlie From: Lucas Stach Link: https://patchwork.freedesktop.org/patch/msgid/59619f8e9eb1d7ed7ea72cbead1f0aabc49f4e68.camel@pengutronix.de commit b36064425a18e29a3bad9c007b4dd1223f8aadc5 Author: Harinder Singh Date: Fri Dec 17 04:49:11 2021 +0000 Documentation: KUnit: Restyled Frequently Asked Questions Reword to align with other chapters. Signed-off-by: Harinder Singh Reviewed-by: Brendan Higgins Link: https://lore.kernel.org/r/20211217044911.798817-8-sharinder@google.com Signed-off-by: Jonathan Corbet commit 39150e80edf8bf8865a7d023e014f6dd13ef8a12 Author: Harinder Singh Date: Fri Dec 17 04:49:10 2021 +0000 Documentation: KUnit: Restyle Test Style and Nomenclature page Rewrite page to enhance content consistency. Signed-off-by: Harinder Singh Reviewed-by: Brendan Higgins Link: https://lore.kernel.org/r/20211217044911.798817-7-sharinder@google.com Signed-off-by: Jonathan Corbet commit 9535743906345f02f7bea2469a2137509db0ac4c Author: Harinder Singh Date: Fri Dec 17 04:49:09 2021 +0000 Documentation: KUnit: Rework writing page to focus on writing tests We now have dedicated pages on running tests. Therefore refocus the usage page on writing tests and add content from tips page and information on other architectures. Signed-off-by: Harinder Singh Reviewed-by: Tim Bird Reviewed-by: Brendan Higgins Link: https://lore.kernel.org/r/20211217044911.798817-6-sharinder@google.com Signed-off-by: Jonathan Corbet commit 46201d47d6c4be594c1d57b7f3251c371626a9c4 Author: Harinder Singh Date: Fri Dec 17 04:49:08 2021 +0000 Documentation: kunit: Reorganize documentation related to running tests Consolidate documentation running tests into two pages: "run tests with kunit_tool" and "run tests without kunit_tool". Signed-off-by: Harinder Singh Reviewed-by: Tim Bird Reviewed-by: Brendan Higgins Link: https://lore.kernel.org/r/20211217044911.798817-5-sharinder@google.com Signed-off-by: Jonathan Corbet commit bc145b370c11b92e497315f54636253f5af4323a Author: Harinder Singh Date: Fri Dec 17 04:49:07 2021 +0000 Documentation: KUnit: Added KUnit Architecture Describe the components of KUnit and how the kernel mode parts interact with kunit_tool. Signed-off-by: Harinder Singh Co-developed-by: Marco Elver Signed-off-by: Marco Elver Reviewed-by: Brendan Higgins Link: https://lore.kernel.org/r/20211217044911.798817-4-sharinder@google.com Signed-off-by: Jonathan Corbet commit c48b9ef1f7949e9024121702031775735e5d7418 Author: Harinder Singh Date: Fri Dec 17 04:49:06 2021 +0000 Documentation: KUnit: Rewrite getting started Clarify the purpose of kunit_tool and fixed consistency issues Signed-off-by: Harinder Singh Reviewed-by: Brendan Higgins Link: https://lore.kernel.org/r/20211217044911.798817-3-sharinder@google.com Signed-off-by: Jonathan Corbet commit 6c6213f4a29b60d321ab2f2f20cdccd7604a7f95 Author: Harinder Singh Date: Fri Dec 17 04:49:05 2021 +0000 Documentation: KUnit: Rewrite main page Add a section on advantages of unit testing, how to write unit tests, KUnit features and Prerequisites. Signed-off-by: Harinder Singh Reviewed-by: Brendan Higgins Link: https://lore.kernel.org/r/20211217044911.798817-2-sharinder@google.com Signed-off-by: Jonathan Corbet commit 422d98c187d5e8ff9a60f4c363fd38a6bc2b81e7 Author: Yang Yang Date: Fri Dec 17 11:09:50 2021 +0000 docs/zh_CN: Add zh_CN/accounting/delay-accounting.rst Add translation zh_CN/accounting/delay-accounting.rst and links it to zh_CN/accounting/index.rst while clean its todo entry. Signed-off-by: Yang Yang Reviewed-by: Alex Shi Reviewed-by: Yanteng Si Link: https://lore.kernel.org/r/20211217110949.453361-1-yang.yang29@zte.com.cn Signed-off-by: Jonathan Corbet commit 32211146e12c7099482a719e07a52800ae7e87bc Author: Randy Dunlap Date: Tue Dec 21 22:23:54 2021 -0800 Documentation/sphinx: fix typos of "its" Use "its" for possessive form instead of the contraction "it's". Signed-off-by: Randy Dunlap Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Link: https://lore.kernel.org/r/20211222062354.23224-1-rdunlap@infradead.org Signed-off-by: Jonathan Corbet commit 8ac383b4db7a854cf92a2ee1d1cbc9d0b3942acc Author: Tang Yizhou Date: Wed Dec 22 22:11:31 2021 +0800 docs/zh_CN: Add sched-domains translation Translate scheduler/sched-domains.rst into Chinese. Signed-off-by: Tang Yizhou Reviewed-by: Alex Shi Reviewed-by: Yanteng Si Link: https://lore.kernel.org/r/20211222141131.10134-1-tangyizhou@huawei.com Signed-off-by: Jonathan Corbet commit fe1cf923da767bedf92113214bcdbb9fa4b46f85 Author: Zhiqiang Liu Date: Thu Dec 23 11:51:00 2021 +0800 doc: fs: remove bdev_try_to_free_page related doc In commit acc6100d3ffa ("fs: remove bdev_try_to_free_page callback"), bdev_try_to_free_page has been removed. We should remove its doc. Signed-off-by: Zhiqiang Liu Reviewed-by: Jens Axboe Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/c45e6351-b0f8-3410-787e-02c6aeb3efe6@huawei.com Signed-off-by: Jonathan Corbet commit 5d1dd2e5a681b126a04192e37abb2011c2fb719c Author: Colin Ian King Date: Thu Dec 23 09:47:17 2021 +0000 Bluetooth: MGMT: Fix spelling mistake "simultanous" -> "simultaneous" There is a spelling mistake in a bt_dev_info message. Fix it. Signed-off-by: Colin Ian King Signed-off-by: Luiz Augusto von Dentz commit 2f15d3cebd45f773a2e27cce84ca851164dd5acd Merge: 4e28491a7a198 319a05330f4ff Author: Mark Brown Date: Thu Dec 23 19:38:13 2021 +0000 ASoC: qcom: Parse "pin-switches" and "widgets" from DT Merge series from Stephan Gerhold : Some sound card setups might require extra pin switches to allow turning off certain audio components. simple-card supports this already using the "pin-switches" and "widgets" device tree property. This series makes it possible to use the same properties for the Qcom sound cards. To implement that, the function that parses the "pin-switches" property in simple-card-utils.c is first moved into the ASoC core. Then two simple function calls are added to the common Qcom sound card DT parser. Finally there is a small patch for the msm8916-wcd-analog codec to make it possible to model sound card setups used in some MSM8916 smartphones. (See PATCH 2/4 for an explanation of some real example use cases.) Using pin switches rather than patching codec drivers with switches was originally suggested by Mark Brown on a patch for the tfa989x codec: https://lore.kernel.org/alsa-devel/YXaMVHo9drCIuD3u@sirena.org.uk/ commit 58225631cf9ae45f98ea04b38b7986e3e7646ee2 Author: Stefan Schaeckeler Date: Thu Oct 28 00:44:04 2021 -0700 ubifs: Document sysfs nodes Add documentation for the new sysfs nodes /sys/fs/ubifs/ubiX_Y/errors_magic /sys/fs/ubifs/ubiX_Y/errors_node /sys/fs/ubifs/ubiX_Y/errors_crc Signed-off-by: Stefan Schaeckeler Signed-off-by: Richard Weinberger commit 2e3cbf425804fb44a005e252f88f93dff108c911 Author: Stefan Schaeckeler Date: Sat Oct 9 21:22:39 2021 -0700 ubifs: Export filesystem error counters Not all ubifs filesystem errors are propagated to userspace. Export bad magic, bad node and crc errors via sysfs. This allows userspace to notice filesystem errors: /sys/fs/ubifs/ubiX_Y/errors_magic /sys/fs/ubifs/ubiX_Y/errors_node /sys/fs/ubifs/ubiX_Y/errors_crc The counters are reset to 0 with a remount. Signed-off-by: Stefan Schaeckeler Signed-off-by: Richard Weinberger commit 3fea4d9d160186617ff40490ae01f4f4f36b28ff Author: Petr Cvachoucek Date: Mon Aug 30 21:20:37 2021 +0200 ubifs: Error path in ubifs_remount_rw() seems to wrongly free write buffers it seems freeing the write buffers in the error path of the ubifs_remount_rw() is wrong. It leads later to a kernel oops like this: [10016.431274] UBIFS (ubi0:0): start fixing up free space [10090.810042] UBIFS (ubi0:0): free space fixup complete [10090.814623] UBIFS error (ubi0:0 pid 512): ubifs_remount_fs: cannot spawn "ubifs_bgt0_0", error -4 [10101.915108] UBIFS (ubi0:0): background thread "ubifs_bgt0_0" started, PID 517 [10105.275498] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000030 [10105.284352] Mem abort info: [10105.287160] ESR = 0x96000006 [10105.290252] EC = 0x25: DABT (current EL), IL = 32 bits [10105.295592] SET = 0, FnV = 0 [10105.298652] EA = 0, S1PTW = 0 [10105.301848] Data abort info: [10105.304723] ISV = 0, ISS = 0x00000006 [10105.308573] CM = 0, WnR = 0 [10105.311564] user pgtable: 4k pages, 48-bit VAs, pgdp=00000000f03d1000 [10105.318034] [0000000000000030] pgd=00000000f6cee003, pud=00000000f4884003, pmd=0000000000000000 [10105.326783] Internal error: Oops: 96000006 [#1] PREEMPT SMP [10105.332355] Modules linked in: ath10k_pci ath10k_core ath mac80211 libarc4 cfg80211 nvme nvme_core cryptodev(O) [10105.342468] CPU: 3 PID: 518 Comm: touch Tainted: G O 5.4.3 #1 [10105.349517] Hardware name: HYPEX CPU (DT) [10105.353525] pstate: 40000005 (nZcv daif -PAN -UAO) [10105.358324] pc : atomic64_try_cmpxchg_acquire.constprop.22+0x8/0x34 [10105.364596] lr : mutex_lock+0x1c/0x34 [10105.368253] sp : ffff000075633aa0 [10105.371563] x29: ffff000075633aa0 x28: 0000000000000001 [10105.376874] x27: ffff000076fa80c8 x26: 0000000000000004 [10105.382185] x25: 0000000000000030 x24: 0000000000000000 [10105.387495] x23: 0000000000000000 x22: 0000000000000038 [10105.392807] x21: 000000000000000c x20: ffff000076fa80c8 [10105.398119] x19: ffff000076fa8000 x18: 0000000000000000 [10105.403429] x17: 0000000000000000 x16: 0000000000000000 [10105.408741] x15: 0000000000000000 x14: fefefefefefefeff [10105.414052] x13: 0000000000000000 x12: 0000000000000fe0 [10105.419364] x11: 0000000000000fe0 x10: ffff000076709020 [10105.424675] x9 : 0000000000000000 x8 : 00000000000000a0 [10105.429986] x7 : ffff000076fa80f4 x6 : 0000000000000030 [10105.435297] x5 : 0000000000000000 x4 : 0000000000000000 [10105.440609] x3 : 0000000000000000 x2 : ffff00006f276040 [10105.445920] x1 : ffff000075633ab8 x0 : 0000000000000030 [10105.451232] Call trace: [10105.453676] atomic64_try_cmpxchg_acquire.constprop.22+0x8/0x34 [10105.459600] ubifs_garbage_collect+0xb4/0x334 [10105.463956] ubifs_budget_space+0x398/0x458 [10105.468139] ubifs_create+0x50/0x180 [10105.471712] path_openat+0x6a0/0x9b0 [10105.475284] do_filp_open+0x34/0x7c [10105.478771] do_sys_open+0x78/0xe4 [10105.482170] __arm64_sys_openat+0x1c/0x24 [10105.486180] el0_svc_handler+0x84/0xc8 [10105.489928] el0_svc+0x8/0xc [10105.492808] Code: 52800013 17fffffb d2800003 f9800011 (c85ffc05) [10105.498903] ---[ end trace 46b721d93267a586 ]--- To reproduce the problem: 1. Filesystem initially mounted read-only, free space fixup flag set. 2. mount -o remount,rw 3. it takes some time (free space fixup running) ... try to terminate running mount by CTRL-C ... does not respond, only after free space fixup is complete ... then "ubifs_remount_fs: cannot spawn "ubifs_bgt0_0", error -4" 4. mount -o remount,rw ... now finished instantly (fixup already done). 5. Create file or just unmount the filesystem and we get the oops. Cc: Fixes: b50b9f408502 ("UBIFS: do not free write-buffers when in R/O mode") Signed-off-by: Petr Cvachoucek Signed-off-by: Richard Weinberger commit d98c6c35c881b944933edd1bbc438aa1f12e3c47 Author: Cai Huoqing Date: Thu Oct 21 16:43:43 2021 +0800 ubifs: Make use of the helper macro kthread_run() Repalce kthread_create/wake_up_process() with kthread_run() to simplify the code. Signed-off-by: Cai Huoqing Signed-off-by: Richard Weinberger commit bc7849e280434289936b5cbe1b3701336741aba9 Author: Kai Song Date: Tue Oct 5 14:56:55 2021 +0800 ubi: Fix a mistake in comment Fixes: 2a734bb8d502 ("UBI: use debugfs for the extra checks knobs") There is a mistake in docstrings, it should be ubi_debugfs_exit_dev instead of dbg_debug_exit_dev. Signed-off-by: Kai Song Signed-off-by: Richard Weinberger commit 7296c8af6a341e30b517afc1ccd107cf10926d03 Author: Alexander Dahl Date: Mon Sep 20 09:05:55 2021 +0200 ubifs: Fix spelling mistakes Found with `codespell -i 3 -w fs/ubifs/**` and proof reading that parts. Signed-off-by: Alexander Dahl Signed-off-by: Richard Weinberger commit cdd156955f946beaa5f3a00d8ccf90e5a197becc Author: Lucas Stach Date: Wed Dec 22 01:17:28 2021 +0100 drm/etnaviv: consider completed fence seqno in hang check Some GPU heavy test programs manage to trigger the hangcheck quite often. If there are no other GPU users in the system and the test program exhibits a very regular structure in the commandstreams that are being submitted, we can end up with two distinct submits managing to trigger the hangcheck with the FE in a very similar address range. This leads the hangcheck to believe that the GPU is stuck, while in reality the GPU is already busy working on a different job. To avoid those spurious GPU resets, also remember and consider the last completed fence seqno in the hang check. Reported-by: Joerg Albert Signed-off-by: Lucas Stach Reviewed-by: Christian Gmeiner commit 319a05330f4ff3f951f9c42094958c6cdef393b3 Author: Stephan Gerhold Date: Tue Dec 14 15:20:49 2021 +0100 ASoC: msm8916-wcd-analog: Use separate outputs for HPH_L/HPH_R The analog codec has separate output paths for the left headphone channel (HPH_L) and the right headphone channel (HPH_R). While they are usually used together for actual headphones output, some devices also have an analog speaker amplifier connected to one of the headphone channels. To allow modelling that properly (and to avoid powering on the unneeded output path), HPH_L and HPH_R should be represented by separate outputs rather than a shared HEADPHONE output that always activates both paths. Cc: Srinivas Kandagatla Signed-off-by: Stephan Gerhold Link: https://lore.kernel.org/r/20211214142049.20422-5-stephan@gerhold.net Signed-off-by: Mark Brown commit 2623e66de125ba153e41be6a0b8af24cae8aa436 Author: Stephan Gerhold Date: Tue Dec 14 15:20:48 2021 +0100 ASoC: qcom: common: Parse "pin-switches" and "widgets" from DT Use the DT helpers in the ASoC core to parse the "pin-switches" and "widgets" properties from the device tree. This allows adding extra mixers to disable e.g. an extra speaker amplifier that would be normally powered on automatically because it is connected to a shared output pin. Cc: Srinivas Kandagatla Signed-off-by: Stephan Gerhold Link: https://lore.kernel.org/r/20211214142049.20422-4-stephan@gerhold.net Signed-off-by: Mark Brown commit 37a49da9a7d5ac1f7128000de42ff222da46ba7a Author: Stephan Gerhold Date: Tue Dec 14 15:20:47 2021 +0100 ASoC: dt-bindings: qcom: sm8250: Document "pin-switches" and "widgets" Some sound card setups might require extra pin switches to allow turning off certain audio components. There are two real examples for this in smartphones/tablets based on MSM8916: 1. Analog speaker amplifiers connected to headphone outputs. The MSM8916 analog codec does not have a separate "Line Out" port so some devices have an analog speaker amplifier connected to one of the headphone outputs. A pin switch is necessary to allow playback on headphones without also activating the speaker. 2. External speaker codec also used as earpiece. Some smartphones have two front-facing (stereo) speakers that can be also configured to act as an earpiece during voice calls. A pin switch is needed to allow disabling the second speaker during voice calls. There are existing bindings that allow setting up such pin switches in simple-card.yaml. Document the same for Qcom sound cards. One variant of example 1 above is added to the examples in the DT schema: There is an analog speaker amplifier connected to the HPH_R (right headphone channel) output. Adding a "Speaker" pin switch and widget allows turning off the speaker when audio should be only played via the connected headphones. Cc: Srinivas Kandagatla Signed-off-by: Stephan Gerhold Acked-by: Rob Herring Link: https://lore.kernel.org/r/20211214142049.20422-3-stephan@gerhold.net Signed-off-by: Mark Brown commit 3d4641a42ccf1593b3f3a474ee7541727acbb8e0 Author: Stephan Gerhold Date: Tue Dec 14 15:20:46 2021 +0100 ASoC: core: Add snd_soc_of_parse_pin_switches() from simple-card-utils The ASoC core already has several helpers to parse card properties from the device tree. Move the parsing code for "pin-switches" from simple-card-utils to a shared snd_soc_of_parse_pin_switches() function so other drivers can also use it to set up pin switches configured in the device tree. Cc: Paul Cercueil Signed-off-by: Stephan Gerhold Link: https://lore.kernel.org/r/20211214142049.20422-2-stephan@gerhold.net Signed-off-by: Mark Brown commit 7c4f5cd18cb169a4ce8610b1696ec152d62b4820 Author: Johan Hovold Date: Wed Dec 22 11:50:23 2021 +0100 platform/x86: intel_pmc_core: fix memleak on registration failure In case device registration fails during module initialisation, the platform device structure needs to be freed using platform_device_put() to properly free all resources (e.g. the device name). Fixes: 938835aa903a ("platform/x86: intel_pmc_core: do not create a static struct device") Cc: stable@vger.kernel.org # 5.9 Signed-off-by: Johan Hovold Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20211222105023.6205-1-johan@kernel.org Signed-off-by: Hans de Goede commit ecf45e60a62dfeb65658abac02f0bdb45b786911 Author: Jiri Olsa Date: Thu Dec 23 14:17:36 2021 +0100 selftests/bpf: Add btf_dump__new to test_cpp Adding btf_dump__new call to test_cpp, so we can test C++ compilation with that. Signed-off-by: Jiri Olsa Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20211223131736.483956-2-jolsa@kernel.org commit 5652b807b7576f14c8b96e769470affef3287b7e Author: Jiri Olsa Date: Thu Dec 23 14:17:35 2021 +0100 libbpf: Do not use btf_dump__new() macro in C++ mode As reported in here [0], C++ compilers don't support __builtin_types_compatible_p(), so at least don't screw up compilation for them and let C++ users pick btf_dump__new vs btf_dump__new_deprecated explicitly. [0] https://github.com/libbpf/libbpf/issues/283#issuecomment-986100727 Fixes: 6084f5dc928f ("libbpf: Ensure btf_dump__new() and btf_dump_opts are future-proof") Signed-off-by: Jiri Olsa Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20211223131736.483956-1-jolsa@kernel.org commit fc5a40694ba684fb3b7009819965ec38e829118f Author: Stanislav Jakubek Date: Thu Dec 23 18:33:39 2021 +0100 Revert "dt-bindings: arm: qcom: Document SDX65 platform and boards" This reverts commit 3b338c9a6a2afd6db46d5d8e39ae4f5eef420bf8. This was a duplicate of 61339f368d59d25e22401731f89de44e3215508b, causing the sdx65 compatible and its board to be documented twice. Signed-off-by: Stanislav Jakubek Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211223173339.GA3925@standask-GA-A55M-S2HP commit 4e28491a7a198c668437f2be8a91a76aa52f20eb Author: Tzung-Bi Shih Date: Tue Dec 14 12:00:28 2021 +0800 ASoC: mediatek: mt8192-mt6359: fix device_node leak The of_parse_phandle() document: >>> Use of_node_put() on it when done. The driver didn't call of_node_put(). Fixes the leak. Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20211214040028.2992627-1-tzungbi@google.com Signed-off-by: Mark Brown commit 8102d8cd8f26117a7d74142878b4efe7fdeda6cf Merge: 1d194b6b3d3af 559ec82aa47d7 Author: Mark Brown Date: Thu Dec 23 17:16:00 2021 +0000 ASoC: More amlogic sound-name-prefix DT fixes Merge series from Alexander Stein : Following up [1] here are more fix for missing sound-name-prefix properties in the arch/arm64/boot/dts/amlogic/ subtree. [1] https://www.spinics.net/lists/devicetree/msg466125.html commit 1d194b6b3d3afe3c4fe546385cae970d00641911 Merge: 8a2d8e4fed6d5 34bfba9a63ece Author: Mark Brown Date: Thu Dec 23 17:15:58 2021 +0000 ASoC: SOF: Re-visit firmware state and panic tracking/handling Merge series from Peter Ujfalusi : this series will improve how we are tracking the firmware's state to be able to avoid communication with it when it is not going to answer due to a panic and we will attempt to force power cycle the DSP to recover at the next runtime suspend time. The state handling brings in other improvements on the way the kernel reports errors and DSP panics to reduce the printed lines for normal users, but at the same time allowing developers (or for bug reports) to have more precise information available to track down the issue. We can now place messages easily in the correct debug level and not bound to the static ERROR for some of the print chains, causing excess amount or partial information to be printed, confusing users and machines (CI). I would have prefered to split this series up, but it was developed together to achieve a single goal to reduce the noise, but also provide the details we need to be able to rootcause issues. commit f2b551fad8d8f2ac5e1f810ad595298381e0b0c5 Merge: bb53bcb2b104d d430dffbe9dd3 Author: Jakub Kicinski Date: Thu Dec 23 09:12:36 2021 -0800 Merge tag 'wireless-drivers-next-2021-12-23' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next Kalle Valo says: ==================== wireless-drivers-next patches for v5.17 Third set of patches for v5.17, and the final one if all goes well. We have Specific Absorption Rate (SAR) support for both mt76 and rtw88. Also iwlwifi should be now W=1 warning free. But otherwise nothing really special this time, business as usual. Major changes: mt76 * Specific Absorption Rate (SAR) support * mt7921: new PCI ids * mt7921: 160 MHz channel support iwlwifi * fix W=1 and sparse warnings * BNJ hardware support * add new killer device ids * support for Time-Aware-SAR (TAS) from the BIOS * Optimized Connectivity Experience (OCE) scan support rtw88 * hardware scan * Specific Absorption Rate (SAR) support ath11k * qca6390/wcn6855: report signal and tx bitrate * qca6390: rfkill support * qca6390/wcn6855: regdb.bin support ath5k * switch to rate table based lookup wilc1000 * spi: reset/enable GPIO support * tag 'wireless-drivers-next-2021-12-23' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next: (148 commits) mt76: mt7921: fix a possible race enabling/disabling runtime-pm wilc1000: Document enable-gpios and reset-gpios properties wilc1000: Add reset/enable GPIO support to SPI driver wilc1000: Convert static "chipid" variable to device-local variable rtw89: 8852a: correct bit definition of dfs_en rtw88: don't consider deep PS mode when transmitting packet ath11k: Fix unexpected return buffer manager error for QCA6390 ath11k: add support of firmware logging for WCN6855 ath11k: Fix napi related hang ath10k: replace strlcpy with strscpy rtw88: support SAR via kernel common API rtw88: 8822c: add ieee80211_ops::hw_scan iwlwifi: mei: wait before mapping the shared area iwlwifi: mei: clear the ownership when the driver goes down iwlwifi: yoyo: fix issue with new DBGI_SRAM region read. iwlwifi: fw: fix some scan kernel-doc iwlwifi: pcie: make sure prph_info is set when treating wakeup IRQ iwlwifi: mvm: remove card state notification code iwlwifi: mvm: drop too short packets silently iwlwifi: mvm: fix AUX ROC removal ... ==================== Link: https://lore.kernel.org/r/20211223141108.78808C36AE9@smtp.kernel.org Signed-off-by: Jakub Kicinski commit 4ba0b8187d98cb4c5e33c0e98895ac5dcb86af83 Author: Henning Schild Date: Mon Dec 13 13:05:02 2021 +0100 platform/x86: pmc_atom: improve critclk_systems matching for Siemens PCs Siemens industrial PCs unfortunately can not always be properly identified the way we used to. An earlier commit introduced code that allows proper identification without looking at DMI strings that could differ based on product branding. Switch over to that proper way and revert commits that used to collect the machines based on unstable strings. Fixes: 648e921888ad ("clk: x86: Stop marking clocks as CLK_IS_CRITICAL") Fixes: e8796c6c69d1 ("platform/x86: pmc_atom: Add Siemens CONNECT ...") Fixes: f110d252ae79 ("platform/x86: pmc_atom: Add Siemens SIMATIC ...") Fixes: ad0d315b4d4e ("platform/x86: pmc_atom: Add Siemens SIMATIC ...") Tested-by: Michael Haener Signed-off-by: Henning Schild Link: https://lore.kernel.org/r/20211213120502.20661-5-henning.schild@siemens.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 2ebd32ce2aecd5ee57d9bdcac80e0df26c351061 Author: Henning Schild Date: Mon Dec 13 13:05:01 2021 +0100 watchdog: simatic-ipc-wdt: add new driver for Siemens Industrial PCs This driver adds initial support for several devices from Siemens. It is based on a platform driver introduced in an earlier commit. One of the supported machines does access a GPIO pin to enable the watchdog. Here we poke GPIO memory because pinctrl does not come up. Signed-off-by: Henning Schild Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20211213120502.20661-4-henning.schild@siemens.com Signed-off-by: Hans de Goede commit 8c78e0614edc628b13313afd28856720b85d86a3 Author: Henning Schild Date: Mon Dec 13 13:05:00 2021 +0100 leds: simatic-ipc-leds: add new driver for Siemens Industial PCs This driver adds initial support for several devices from Siemens. It is based on a platform driver introduced in an earlier commit. One of the supported machines has GPIO connected LEDs, here we poke GPIO memory directly because pinctrl does not come up. Signed-off-by: Henning Schild Acked-by: Pavel Machek Link: https://lore.kernel.org/r/20211213120502.20661-3-henning.schild@siemens.com Signed-off-by: Hans de Goede commit dd123e62bdedcd3a486e48e883ec63138ec2c14c Author: Henning Schild Date: Mon Dec 13 13:04:59 2021 +0100 platform/x86: simatic-ipc: add main driver for Siemens devices This mainly implements detection of these devices and will allow secondary drivers to work on such machines. The identification is DMI-based with a vendor specific way to tell them apart in a reliable way. Drivers for LEDs and Watchdogs will follow to make use of that platform detection. There is also some code to allow secondary drivers to find GPIO memory, that needs to be in place because the pinctrl drivers do not come up. Signed-off-by: Henning Schild Link: https://lore.kernel.org/r/20211213120502.20661-2-henning.schild@siemens.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit c0518b21fba5351c8544a18c1bdf20b73088d5d9 Author: Andy Shevchenko Date: Wed Dec 22 21:49:41 2021 +0200 platform/x86/intel: Remove X86_PLATFORM_DRIVERS_INTEL While introduction of this menu brings a nice view in the configuration tools, it brought more issues than solves, i.e. it prevents to locate files in the intel/ subfolder without touching non-related Kconfig dependencies elsewhere. Drop X86_PLATFORM_DRIVERS_INTEL altogether. Note, on x86 it's enabled by default and it's quite unlikely anybody wants to disable all of the modules in this submenu. Fixes: 8bd836feb6ca ("platform/x86: intel_skl_int3472: Move to intel/ subfolder") Suggested-by: Hans de Goede Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211222194941.76054-1-andriy.shevchenko@linux.intel.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit ba8cfebd9d9fdc9f5aa960ab388a5e50b017aaa6 Author: Tim Crawford Date: Wed Dec 22 11:51:54 2021 -0700 platform/x86: system76_acpi: Guard System76 EC specific functionality Certain functionality or its implementation in System76 EC firmware may be different to the proprietary ODM EC firmware. Introduce a new bool, `has_open_ec`, to guard our specific logic. Detect the use of this by looking for a custom ACPI method name used in System76 firmware. Signed-off-by: Tim Crawford Link: https://lore.kernel.org/r/20211222185154.4560-1-tcrawford@system76.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit f21ecad451c9b33d56165da61b0f5a9a535bfd3c Author: Andy Shevchenko Date: Thu Dec 23 14:16:06 2021 +0200 gpio: regmap: Switch to use fwnode instead of of_node GPIO library now accepts fwnode as a firmware node, so switch the driver to use it. Signed-off-by: Andy Shevchenko Reviewed-by: Michael Walle Signed-off-by: Bartosz Golaszewski commit d1056b771ddbe119f733fd980c854d1bcf33d13e Author: Akhil R Date: Thu Dec 16 15:10:09 2021 +0100 gpio: tegra186: Add support for Tegra241 Extend the existing Tegra186 GPIO controller driver with support for the GPIO controller found on Tegra241 (Grace). While the programming model remains the same, the number of pins has slightly changed. Signed-off-by: Akhil R Signed-off-by: Thierry Reding Signed-off-by: Bartosz Golaszewski commit 9f01881beae9e40c87f3edfb81e87e973f85d272 Author: Akhil R Date: Thu Dec 16 15:10:08 2021 +0100 dt-bindings: gpio: Add Tegra241 support Add the port definitions for the main and AON GPIO controllers found on Tegra241 (Grace). Signed-off-by: Akhil R Signed-off-by: Thierry Reding Signed-off-by: Bartosz Golaszewski commit e85dd53a38bc32f411f90bd095b738fee46785f8 Author: Andy Shevchenko Date: Thu Dec 23 15:15:38 2021 +0200 gpio: brcmstb: Use local variable to access OF node We already have a local variable that contains a copy of OF node pointer. Use it instead of dereferencing it again from struct device. Signed-off-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit 7821f3a0b52519612683a879bdedd0107448d1a2 Author: David Heidelberg Date: Mon Dec 20 19:43:55 2021 +0100 dt-bindings: crypto: convert Qualcomm PRNG to yaml Convert Qualcomm PRNG documentation to yaml format. Signed-off-by: David Heidelberg Acked-By: Vinod Koul Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211220184355.86582-1-david@ixit.cz commit 39b86309a4f148e057230e8dad29b3c14720964b Author: David Heidelberg Date: Mon Dec 20 19:42:20 2021 +0100 dt-bindings: msm: disp: remove bus from dpu bindings Driver and dts has been already adjusted and bus moved out of dpu, let's update also dt-bindings. Fixes warnings as: arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dt.yaml: mdss @ae00000: clock-names: ['iface', 'core'] is too short From schema: Documentation/devicetree/bindings/display/msm/dpu-sdm845.yaml Ref: https://lore.kernel.org/all/20210803101657.1072358-1-dmitry.baryshkov@linaro.org/ Signed-off-by: David Heidelberg Reviewed-by: Dmitry Baryshkov Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211220184220.86328-1-david@ixit.cz commit 92c3974ceea8cbae2ef1c4320711836d40becce3 Author: David Heidelberg Date: Sat Dec 18 19:46:16 2021 +0100 dt-binding: soc: qcom: convert Qualcomm Command DB documentation to yaml Convert Qualcomm Command DB documentation into yaml format. Signed-off-by: David Heidelberg Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211218184617.19923-1-david@ixit.cz commit f3a9f2b23c3c14629a229641e0be5d58af5d9871 Author: David Heidelberg Date: Sat Dec 18 19:28:16 2021 +0100 dt-binding: soc: qcom: convert rmtfs documentation to yaml Convert Qualcomm Remote File System Memory binding to the yaml format. Signed-off-by: David Heidelberg Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211218182816.17151-1-david@ixit.cz commit c1af85e442278fe120974358cf71c41bc48e0580 Author: Daniel Lezcano Date: Tue Nov 23 11:16:01 2021 +0100 powercap/drivers/dtpm: Reduce trace verbosity The traces when registering a powerzone is at the pr_info level and should be changed to pr_debug as requested by Greg-KH. Cc: Greg KH Reviewed-by: Greg Kroah-Hartman Link: https://lkml.kernel.org/r/YGAnRx8SiZHFPpY6@kroah.com Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20211123101601.2433340-2-daniel.lezcano@linaro.org commit 66b354064a35b6379963cba27b5d37a278fc9bd9 Author: Daniel Lezcano Date: Tue Nov 23 11:16:00 2021 +0100 powercap/drivers/dtpm: Remove unused function definition The dtpm.h header file is exporting a function which is not implemented neither needed. Remove it. Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20211123101601.2433340-1-daniel.lezcano@linaro.org commit 960e0ab63b2e5d8476bc873743f812e9e90cd047 Author: Lukas Czerner Date: Wed Dec 22 11:45:17 2021 +0100 ext4: fix i_version handling on remount i_version mount option is getting lost on remount. This is because the 'i_version' mount option differs from the util-linux mount option 'iversion', but it has exactly the same functionality. We have to specifically notify the vfs that this is what we want by setting appropriate flag in fc->sb_flags. Fix it and as a result we can remove *flags argument from __ext4_remount(); do the same for __ext4_fill_super(). In addition set out to deprecate ext4 specific 'i_version' mount option in favor or 'iversion' by kernel version 5.20. Signed-off-by: Lukas Czerner Fixes: cebe85d570cf ("ext4: switch to the new mount api") Link: https://lore.kernel.org/r/20211222104517.11187-2-lczerner@redhat.com Signed-off-by: Theodore Ts'o commit 4437992be7ca3ac5dd0a62cad10357112d4fb43e Author: Lukas Czerner Date: Wed Dec 22 11:45:16 2021 +0100 ext4: remove lazytime/nolazytime mount options handled by MS_LAZYTIME The lazytime and nolazytime mount options were added temporarily back in 2015 with commit a26f49926da9 ("ext4: add optimization for the lazytime mount option"). It think it has been enough time for the util-linux with lazytime support to get widely used. Remove the mount options. Signed-off-by: Lukas Czerner Link: https://lore.kernel.org/r/20211222104517.11187-1-lczerner@redhat.com Signed-off-by: Theodore Ts'o commit 4c2467287779f744cdd70c8ec70903034d6584f0 Author: Lukas Czerner Date: Mon Dec 20 16:26:57 2021 +0100 ext4: don't fail remount if journalling mode didn't change Switching to the new mount api introduced inconsistency in how the journalling mode mount option (data=) is handled during a remount. Ext4 always prevented changing the journalling mode during the remount, however the new code always fails the remount when the journalling mode is specified, even if it remains unchanged. Fix it. Signed-off-by: Lukas Czerner Reported-by: Heiner Kallweit Fixes: cebe85d570cf ("ext4: switch to the new mount api") Link: https://lore.kernel.org/r/20211220152657.101599-1-lczerner@redhat.com Signed-off-by: Theodore Ts'o commit 669a064625fa3a06ddf8a4ac1f35b7436b99f133 Author: Lukas Bulwahn Date: Thu Dec 23 13:53:00 2021 +0100 block: drop needless assignment in set_task_ioprio() Commit 5fc11eebb4a9 ("block: open code create_task_io_context in set_task_ioprio") introduces a needless assignment 'ioc = task->io_context', as the local variable ioc is not further used before returning. Even after the further fix, commit a957b61254a7 ("block: fix error in handling dead task for ioprio setting"), the assignment still remains needless. Drop this needless assignment in set_task_ioprio(). This code smell was identified with 'make clang-analyzer'. Fixes: 5fc11eebb4a9 ("block: open code create_task_io_context in set_task_ioprio") Signed-off-by: Lukas Bulwahn Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211223125300.20691-1-lukas.bulwahn@gmail.com Signed-off-by: Jens Axboe commit 12baee68b2df6847f9a26ee82f30aa5f52c6d0d2 Author: Andy Shevchenko Date: Wed Dec 22 17:57:39 2021 +0200 spi: pxa2xx: Propagate firmware node Propagate firmware node by using a specific API call, i.e. device_set_node(). Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211222155739.7699-3-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit 27b6965ccb72e658eb2235f564a04d2775c956cf Author: Andy Shevchenko Date: Wed Dec 22 17:57:38 2021 +0200 spi: dw: Propagate firmware node Propagate firmware node by using a specific API call, i.e. device_set_node(). Signed-off-by: Andy Shevchenko Tested-by: Serge Semin Acked-by: Serge Semin Link: https://lore.kernel.org/r/20211222155739.7699-2-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit e6609c26b3ab71aa3ef2f7f9524a066a863a7f18 Author: Andy Shevchenko Date: Wed Dec 22 17:57:37 2021 +0200 spi: dln2: Propagate firmware node Propagate firmware node by using a specific API call, i.e. device_set_node(). Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211222155739.7699-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit 8a2d8e4fed6d5829ec3681af313d63e02bc22dad Author: Yang Yingliang Date: Thu Dec 23 16:22:12 2021 +0800 ASoC: codec: tlv320adc3xxx: Fix missing clk_disable_unprepare() on error in adc3xxx_i2c_probe() Fix the missing clk_disable_unprepare() before return from adc3xxx_i2c_probe() in the error handling case. Fixes: e9a3b57efd28 ("ASoC: codec: tlv320adc3xxx: New codec driver") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20211223082212.3342184-1-yangyingliang@huawei.com Signed-off-by: Mark Brown commit 559ec82aa47d7c9ce39f3c769f1ba5f3237f6869 Author: Alexander Stein Date: Thu Dec 23 13:24:34 2021 +0100 ASoC: dt-bindings: aiu: spdif-dit: add missing sound-name-prefix property This is used in meson-gx. Add the property to the binding. This fixes the dtschema warning: audio-controller@5400: 'sound-name-prefix' does not match any of the regexes: 'pinctrl-[0-9]+' Signed-off-by: Alexander Stein Link: https://lore.kernel.org/r/20211223122434.39378-4-alexander.stein@mailbox.org Signed-off-by: Mark Brown commit c6cef35bf723ef0152258d15179c725c5f8cbeba Author: Alexander Stein Date: Thu Dec 23 13:24:33 2021 +0100 ASoC: dt-bindings: spdif-dit: add missing sound-name-prefix property This is used in meson-axg, meson-g12 and meson-gx. Add the property to the binding. This fixes the dtschema warning: audio-codec-0: 'sound-name-prefix' does not match any of the regexes: 'pinctrl-[0-9]+' Signed-off-by: Alexander Stein Link: https://lore.kernel.org/r/20211223122434.39378-3-alexander.stein@mailbox.org Signed-off-by: Mark Brown commit 34bfba9a63ece79c683591e757899e61fbcaa753 Author: Peter Ujfalusi Date: Thu Dec 23 13:36:28 2021 +0200 ASoC: SOF: Intel: hda: Use DEBUG log level for optional prints If the user requested to see all dumps (even the optional ones) then use KERN_DEBUG level for the optional dumps as they are only for debugging purposes. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Chao Song Reviewed-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20211223113628.18582-21-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 0152b8a2f0831b03bb7483159ef28167dcd33ab0 Author: Peter Ujfalusi Date: Thu Dec 23 13:36:27 2021 +0200 ASoC: SOF: debug: Use DEBUG log level for optional prints If the user requested to see all dumps (even the optional ones) then use KERN_DEBUG level for the optional dumps as they are only for debugging purposes. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Chao Song Reviewed-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20211223113628.18582-20-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit beb6ade168177bf6c43abe78b3c9512b260b8068 Author: Peter Ujfalusi Date: Thu Dec 23 13:36:26 2021 +0200 ASoC: SOF: Add clarifying comments for sof_core_debug and DSP dump flags Update the comment for the global SOF level debug flags and add one for the flags used to control the DSP dump functionality. Document the expected behavior when the SOF_DBG_DUMP_OPTIONAL is passed for the DSP dump: Only print the dump if SOF_DBG_PRINT_ALL_DUMPS is set Print must use KERN_DEBUG log level Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Chao Song Reviewed-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20211223113628.18582-19-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 4995ffce2ce2164fa507a5dbaf1aa38bab679cca Author: Peter Ujfalusi Date: Thu Dec 23 13:36:25 2021 +0200 ASoC: SOF: Rename snd_sof_get_status() and add kernel log level parameter The snd_sof_get_status() is not the best name for a function which in fact is tasked to print out DSP oops and stack. Rename it to sof_print_oops_and_stack(). At the same time add a new parameter to specify the desired kernel log level to be used for the prints. When updating the users of the function, pass KERN_ERR for now to make sure that there is no functional change happens. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Chao Song Reviewed-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20211223113628.18582-18-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit b9f0bfd16d8b390b35dbec67c3ed74e74a0ade24 Author: Peter Ujfalusi Date: Thu Dec 23 13:36:24 2021 +0200 ASoC: SOF: dsp_arch_ops: add kernel log level parameter for oops and stack To allow custom log level to be used for the DSP oops and stack print, add a kernel log level parameter to the two ops. Modify the xtensa oops and stack functions tom use this new log level parameter. Pass KER_ERR from snd_sof_get_status() to make sure that there is no functional change with this new parameter. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Chao Song Reviewed-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20211223113628.18582-17-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit fdc573b1c26a8859996de6fbae2d436511b74e00 Author: Peter Ujfalusi Date: Thu Dec 23 13:36:23 2021 +0200 ASoC: SOF: ops: Always print DSP Panic message but use different message Never suppress the DSP panic dump as it is always originates from an assert() or panic() call within the firmware. Use different message for DSP panics when there will be recovery attempt going to be done compared to a definitive DSP panic. Suggested-by: Chao Song Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Chao Song Reviewed-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20211223113628.18582-16-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 9f89a988d5c222f2fba495bbc861a476bdf1bd30 Author: Peter Ujfalusi Date: Thu Dec 23 13:36:22 2021 +0200 ASoc: SOF: core: Update the FW boot state transition diagram Update the state flow diagram to reflect the current implementation. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20211223113628.18582-15-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit b54b3a4e08bc0210768a1839af2ff888376cae4c Author: Peter Ujfalusi Date: Thu Dec 23 13:36:21 2021 +0200 ASoC: SOF: pm: Force DSP off on suspend in BOOT_FAILED state also Try to force the DSP to be turned off next time if the fw_state is either CRASHED or BOOT_FAILED when a suspend happens in order to attempt a clean boot to recover. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20211223113628.18582-14-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit e2406275be2b6b15d985f33aec921e6555e4f87a Author: Peter Ujfalusi Date: Thu Dec 23 13:36:20 2021 +0200 ASoC: SOF: Set SOF_FW_BOOT_FAILED in case we have failure during boot Change the fw_state to SOF_FW_BOOT_FAILED if we encountered an error during booting the firmware. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20211223113628.18582-13-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 9421ff7665f66452f61ee40566c6f562d3847873 Author: Peter Ujfalusi Date: Thu Dec 23 13:36:19 2021 +0200 ASoC: SOF: ipc: Only allow sending of an IPC in SOF_FW_BOOT_COMPLETE state If the state of the firmware is not BOOT_COMPLETE, it means that the firmware is not functioning, thus it is not capable of handling IPC messages. Do not try to send IPC if the state is not BOOT_COMPLETE Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20211223113628.18582-12-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit d41607d37c1385da799f9a2ddb10c460e573687e Author: Peter Ujfalusi Date: Thu Dec 23 13:36:18 2021 +0200 ASoC: SOF: Rename 'enum snd_sof_fw_state' to 'enum sof_fw_state' Since there is nothing SND about the firmware state, rename the enum from `snd_sof_fw_state` to simply `sof_fw_state` Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Reviewed-by: Paul Olaru Link: https://lore.kernel.org/r/20211223113628.18582-11-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit fc179420fde3821c4d191e81b4f7b05c1dab87e2 Author: Peter Ujfalusi Date: Thu Dec 23 13:36:17 2021 +0200 ASoC: SOF: Move the definition of enum snd_sof_fw_state to global header Move the enum snd_sof_fw_state to include/sound/sof.h to be accessible outside of the core SOF stack. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Reviewed-by: Paul Olaru Link: https://lore.kernel.org/r/20211223113628.18582-10-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit b2e9eb3adb9a498b997b18852773e75d7af3b60d Author: Peter Ujfalusi Date: Thu Dec 23 13:36:16 2021 +0200 ASoC: SOF: Introduce new firmware state: SOF_FW_BOOT_READY_OK The SOF_FW_BOOT_READY_OK fw_state indicates that the boot ready message has been received and there were no errors found. The SOF_FW_BOOT_COMPLETE state will be reached after the snd_sof_dsp_post_fw_run() completes without error. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Reviewed-by: Paul Olaru Link: https://lore.kernel.org/r/20211223113628.18582-9-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 4e1f86482189ddbef73f7be8c6e62e8e3730e6b9 Author: Peter Ujfalusi Date: Thu Dec 23 13:36:15 2021 +0200 ASoC: SOF: Introduce new firmware state: SOF_FW_CRASHED The SOF_FW_CRASHED state is meant to indicate the unfortunate case when the firmware has crashed after a successful boot. IPC tx timeout is not treated as indication of a firmware crash as it tends to happen regularly while the firmware is operational. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Reviewed-by: Paul Olaru Link: https://lore.kernel.org/r/20211223113628.18582-8-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 2f148430b96e975e895163d763bfc9c5088100eb Author: Peter Ujfalusi Date: Thu Dec 23 13:36:14 2021 +0200 ASoC: SOF: Add a 'message' parameter to snd_sof_dsp_dbg_dump() When snd_sof_dsp_dbg_dump() is called we have an explanatory message to give some hint on the reason why we have the dump on the caller level. Pass this message to snd_sof_dsp_dbg_dump() and handle the print according to the dump rules. This way we can finally print information on the HDA boot iteration if all dumps are enabled. Signed-off-by: Peter Ujfalusi Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20211223113628.18582-7-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit b2b10aa79fe2fb3d3393d0e90ffb5c1802992412 Author: Peter Ujfalusi Date: Thu Dec 23 13:36:13 2021 +0200 ASoC: SOF: Add 'non_recoverable' parameter to snd_sof_dsp_panic() Some platforms use retries during firmware boot to overcome DSP startup issues. In these cases we might receive a DSP panic message which should not be treated as fatal if it happens during boot. Pass this information to snd_sof_dsp_panic() and omit the panic print if it is not fatal or the user does not want to see all dumps. Signed-off-by: Peter Ujfalusi Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20211223113628.18582-6-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 12b401f4de787627f4a25784a0278bbbf93122b6 Author: Peter Ujfalusi Date: Thu Dec 23 13:36:12 2021 +0200 ASoC: SOF: Use sof_debug_check_flag() instead of sof_core_debug directly The sof_debug_check_flag() is available for checking flags set in sof_core_debug. sof_core_debug can be marked static in core.c Signed-off-by: Peter Ujfalusi Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20211223113628.18582-5-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit f902b21adba98f28eaa1cf5e509d99eaa7b1b36e Author: Peter Ujfalusi Date: Thu Dec 23 13:36:11 2021 +0200 ASoC: SOF: core: Add simple wrapper to check flags in sof_core_debug The sof_debug_check_flag() can be used to check a flag or a combination of them in sof_core_debug. Signed-off-by: Peter Ujfalusi Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20211223113628.18582-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit b2539ef00e4427350b26896540ccabd98e88c7bb Author: Peter Ujfalusi Date: Thu Dec 23 13:36:10 2021 +0200 ASoC: SOF: Intel: hda-loader: Avoid re-defining the HDA_FW_BOOT_ATTEMPTS HDA_FW_BOOT_ATTEMPTS is defined in hda.h, do not define it again locally in hda-loader.c At the same time correct the indentation for the define in hda.h Signed-off-by: Peter Ujfalusi Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20211223113628.18582-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 72b8ed83f7eccf84c54b68a551beae400949cc29 Author: Peter Ujfalusi Date: Thu Dec 23 13:36:09 2021 +0200 ASoC: SOF: ops: Use dev_warn() if the panic offsets differ Catch the cases when the stored sdev->dsp_oops_offset and the offset received via the panic message differs and print a warning, but keep using the dsp_oops_offset for the oops query. Signed-off-by: Peter Ujfalusi Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20211223113628.18582-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 9de3cb1cc95bc815ff6d29cfe6c5e1f171ac2b09 Author: Pratyush Yadav Date: Mon May 31 23:47:54 2021 +0530 mtd: spi-nor: micron-st: write 2 bytes when disabling Octal DTR mode The Octal DTR configuration is stored in the CFR0V register. This register is 1 byte wide. But 1 byte long transactions are not allowed in 8D-8D-8D mode. The next byte address contains the CFR1V register, which contains the number of dummy cycles. This is very fortunate since the enable path changes the value of this register. Reset the value to its default when disabling Octal DTR mode. This way, both changes to the flash state made when enabling can be reverted in one single transaction. Signed-off-by: Pratyush Yadav Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20210531181757.19458-4-p.yadav@ti.com commit 63017068a6d991fdf31147c4996cd29bfde61ac2 Author: Pratyush Yadav Date: Mon May 31 23:47:53 2021 +0530 mtd: spi-nor: spansion: write 2 bytes when disabling Octal DTR mode The Octal DTR configuration is stored in the CFR5V register. This register is 1 byte wide. But 1 byte long transactions are not allowed in 8D-8D-8D mode. Since the next byte address does not contain any register, it is safe to write any value to it. Write a 0 to it. Signed-off-by: Pratyush Yadav Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20210531181757.19458-3-p.yadav@ti.com commit 0d051a49829a96b26716a724df286be30da42f0e Author: Pratyush Yadav Date: Mon May 31 23:47:52 2021 +0530 mtd: spi-nor: core: use 2 data bytes for template ops The template ops used in spi_nor_spimem_check_pp() and spi_nor_spimem_check_readop() currently set the data phase to 1 byte long. This is problematic for 8D-8D-8D protocol where odd length data phase is invalid since one cycle transfers 2 bytes and odd number of bytes would mean half a cycle is left over. This could result in a controller rejecting the op as "not supported" even though it actually supports the protocol. Change the data length to 2 bytes in these templates. One might argue that this should only be done for 8D-8D-8D operations but when talking about these templates, there is no functional difference between one and two bytes, even in STR modes. Signed-off-by: Pratyush Yadav Signed-off-by: Tudor Ambarus Reviewed-by: Michael Walle Link: https://lore.kernel.org/r/20210531181757.19458-2-p.yadav@ti.com commit 088879292a0a3672a6acc9215174fbc355ed3daa Author: Haibo Chen Date: Tue Dec 21 15:50:00 2021 +0800 dt-bindings:iio:adc: update the maintainer of vf610-adc Drop Fugang Duan as the vf610-adc maintainer, and add my self as the maintainer. Signed-off-by: Haibo Chen Acked-by: Rob Herring Link: https://lore.kernel.org/r/1640073000-32629-2-git-send-email-haibo.chen@nxp.com Signed-off-by: Jonathan Cameron commit bde65965b8ec59637c9b785dfbb9ce82a61af50f Author: Haibo Chen Date: Tue Dec 21 15:49:59 2021 +0800 MAINTAINERS: add imx7d/imx6sx/imx6ul/imx8qxp and vf610 adc maintainer Add myself as imx7d/imx6sx/imx6ul/imx8qxp and vf610 adc maintainer. Signed-off-by: Haibo Chen Reviewed-by: Cai Huoqing Link: https://lore.kernel.org/r/1640073000-32629-1-git-send-email-haibo.chen@nxp.com Signed-off-by: Jonathan Cameron commit f407c2374af64202c7b278580d22f81eec6f33c0 Author: Antoniu Miclaus Date: Tue Dec 21 13:22:06 2021 +0200 Documentation:ABI:testing:admv1013: add ABI docs Add documentation for the use of the Local Oscillator Feedthrough Offset calibration. Signed-off-by: Antoniu Miclaus Link: https://lore.kernel.org/r/20211221112206.97066-3-antoniu.miclaus@analog.com Signed-off-by: Jonathan Cameron commit ce6d7056cc806099acff8cd89d95bdc6f53593db Author: Antoniu Miclaus Date: Tue Dec 21 13:22:05 2021 +0200 dt-bindings: iio: frequency: add admv1013 doc Add device tree bindings for the ADMV1013 Upconverter. Signed-off-by: Antoniu Miclaus Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211221112206.97066-2-antoniu.miclaus@analog.com Signed-off-by: Jonathan Cameron commit da35a7b526d9b258a2cb8b7816f736a41b32176b Author: Antoniu Miclaus Date: Tue Dec 21 13:22:04 2021 +0200 iio: frequency: admv1013: add support for ADMV1013 The ADMV1013 is a wideband, microwave upconverter optimized for point to point microwave radio designs operating in the 24 GHz to 44 GHz radio frequency (RF) range. Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/ADMV1013.pdf Signed-off-by: Antoniu Miclaus Link: https://lore.kernel.org/r/20211221112206.97066-1-antoniu.miclaus@analog.com Signed-off-by: Jonathan Cameron commit 5b09250cca85ae6f91c9562cf1f5e5747de0a75d Author: Randy Dunlap Date: Wed Dec 22 16:39:42 2021 -0800 powerpc/perf: Fix spelling of "its" Use the possessive "its" instead of the contraction of "it is" (it's). Signed-off-by: Randy Dunlap Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211223003942.22098-1-rdunlap@infradead.org commit bba496656a73fc1d1330b49c7f82843836e9feb1 Author: Christophe Leroy Date: Wed Dec 22 13:07:31 2021 +0000 powerpc/32: Fix boot failure with GCC latent entropy plugin Boot fails with GCC latent entropy plugin enabled. This is due to early boot functions trying to access 'latent_entropy' global data while the kernel is not relocated at its final destination yet. As there is no way to tell GCC to use PTRRELOC() to access it, disable latent entropy plugin in early_32.o and feature-fixups.o and code-patching.o Fixes: 38addce8b600 ("gcc-plugins: Add latent_entropy plugin") Cc: stable@vger.kernel.org # v4.9+ Reported-by: Erhard Furtner Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://bugzilla.kernel.org/show_bug.cgi?id=215217 Link: https://lore.kernel.org/r/2bac55483b8daf5b1caa163a45fa5f9cdbe18be4.1640178426.git.christophe.leroy@csgroup.eu commit 309a0a601864831510209531dd72da486225d8ae Author: Christophe Leroy Date: Thu Dec 2 13:00:27 2021 +0100 powerpc/code-patching: Replace patch_instruction() by ppc_inst_write() in selftests The purpose of selftests is to check that instructions are properly formed. Not to check that they properly run. For that test it uses normal memory, not special test memory. In preparation of a future patch enforcing patch_instruction() to be used only on valid text areas, implement a ppc_inst_write() instruction which is the complement of ppc_inst_read(). This new function writes the formated instruction in valid kernel memory and doesn't bother about icache. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/7cf5335cc07ca9b6f8cdaa20ca9887fce4df3bea.1638446239.git.christophe.leroy@csgroup.eu commit f30a578d7653f7dbb253a20daad4bcd9f881d6c9 Author: Christophe Leroy Date: Thu Dec 2 13:00:26 2021 +0100 powerpc/code-patching: Move code patching selftests in its own file Code patching selftests are half of code-patching.c. As they are guarded by CONFIG_CODE_PATCHING_SELFTESTS, they'd be better in their own file. Also add a missing __init for instr_is_branch_to_addr() Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/c0c30504f04eb546a48ff77127a8bccd12a3d809.1638446239.git.christophe.leroy@csgroup.eu commit 31acc599564120fa41f9df2c567842d003728dab Author: Christophe Leroy Date: Thu Dec 2 13:00:25 2021 +0100 powerpc/code-patching: Move instr_is_branch_{i/b}form() in code-patching.h To enable moving selftests in their own C file in following patch, move instr_is_branch_iform() and instr_is_branch_bform() to code-patching.h Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/fca0f3b191211b3681020885a611bf73eef20563.1638446239.git.christophe.leroy@csgroup.eu commit 29562a9da29478834e57f81e3804e9ec7a6b350b Author: Christophe Leroy Date: Thu Dec 2 13:00:24 2021 +0100 powerpc/code-patching: Move patch_exception() outside code-patching.c patch_exception() is dedicated to book3e/64 is nothing more than a normal use of patch_branch(), so move it into a place dedicated to book3e/64. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/0968622b98b1fb51838c35b844c42ad6609de62e.1638446239.git.christophe.leroy@csgroup.eu commit ff14a9c09fe91a70bfc6381809877e5a19e38cdb Author: Christophe Leroy Date: Thu Dec 2 13:00:23 2021 +0100 powerpc/code-patching: Use test_trampoline for prefixed patch test Use the dedicated test_trampoline function for testing prefixed patching like other tests and remove the hand coded assembly stuff. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/a450ef3f8653f75e1bd9aaf7a3889d379752f33b.1638446239.git.christophe.leroy@csgroup.eu commit d5937db114e4b6446c62809484729955f1aeb108 Author: Christophe Leroy Date: Thu Dec 2 13:00:22 2021 +0100 powerpc/code-patching: Fix patch_branch() return on out-of-range failure Do not silentely ignore a failure of create_branch() in patch_branch(). Return -ERANGE. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/8540cb64b1f06710eaf41e3835c7ba3e21fa2b05.1638446239.git.christophe.leroy@csgroup.eu commit 6b21af74495b556f9d496d97d74e7a3d0ab16d7c Author: Christophe Leroy Date: Thu Dec 2 13:00:21 2021 +0100 powerpc/code-patching: Reorganise do_patch_instruction() to ease error handling Split do_patch_instruction() in two functions, the caller doing the spin locking and the callee doing everything else. And remove a few unnecessary initialisations and intermediate variables. This allows the callee to return from anywhere in the function. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/dbc85980a0d2a935731b272e8907e8bb1d8fc8c5.1638446239.git.christophe.leroy@csgroup.eu commit a3483c3dd18c136785a31406fe27210649fc4fba Author: Christophe Leroy Date: Thu Dec 2 13:00:20 2021 +0100 powerpc/code-patching: Fix unmap_patch_area() error handling pXd_offset() doesn't return NULL. When the base is NULL, it still adds the offset. Use pXd_none() to check validity instead. It also improves performance by folding out none existing levels as pXd_none() always returns 0 in that case. Such an error is unexpected, use WARN_ON() so that the caller doesn't have to worry about it, and drop the returned value. And now that unmap_patch_area() doesn't return error, we can take into account the error returned by __patch_instruction(). While at it, remove the 'inline' property which is useless. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/299804b117fae35c786c827536c91f25352e279b.1638446239.git.christophe.leroy@csgroup.eu commit 285672f99327d5b8febdf83cadba61a68abe5d69 Author: Christophe Leroy Date: Thu Dec 2 13:00:19 2021 +0100 powerpc/code-patching: Fix error handling in do_patch_instruction() Use real errors instead of using -1 as error, so that errors returned by callees can be used towards callers. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/85259d894069e47f915ea580b169e1adbeec7a61.1638446239.git.christophe.leroy@csgroup.eu commit af5304a7506588221d8317ef3f76585eb4483506 Author: Christophe Leroy Date: Thu Dec 2 13:00:18 2021 +0100 powerpc/code-patching: Remove init_mem_is_free A new state has been added by commit d2635f2012a4 ("mm: create a new system state and fix core_kernel_text()"). That state tells when initmem is about to be released and is redundant with init_mem_is_free. Remove init_mem_is_free. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/ad8c3ccb39c8edaa89fd3eda1cc7218baea1cde5.1638446239.git.christophe.leroy@csgroup.eu commit edecd2d6d6f4a122dd62bce654b4f63301e8ad9a Author: Christophe Leroy Date: Thu Dec 2 13:00:17 2021 +0100 powerpc/code-patching: Remove pr_debug()/pr_devel() messages and fix check() code-patching has been working for years now, time has come to remove debugging messages. Change useful message to KERN_INFO and remove other ones. Also add KERN_ERR to check() macro and change it into a do/while to make checkpatch happy. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/3ff9823c0a812a8a145d979a9600a6d4591b80ee.1638446239.git.christophe.leroy@csgroup.eu commit 62479e6e26ef18f00e2e540c0e30156254533a43 Author: Alexey Kardashevskiy Date: Tue Dec 21 16:59:04 2021 +1100 powerpc/mm/book3s64/hash: Switch pre 2.06 tlbiel to .long The llvm integrated assembler does not recognise the ISA 2.05 tlbiel version. Work around it by switching to .long when an old arch level detected. Signed-off-by: Daniel Axtens [aik: did "Eventually do this more smartly"] Signed-off-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211221055904.555763-7-aik@ozlabs.ru commit d51f86cfd8e378d4907958db77da3074f6dce3ba Author: Alexey Kardashevskiy Date: Tue Dec 21 16:59:03 2021 +1100 powerpc/mm: Switch obsolete dssall to .long The dssall ("Data Stream Stop All") instruction is obsolete altogether with other Data Cache Instructions since ISA 2.03 (year 2006). LLVM IAS does not support it but PPC970 seems to be using it. This switches dssall to .long as there is no much point in fixing LLVM. Signed-off-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211221055904.555763-6-aik@ozlabs.ru commit d72c4a36d7ab560127885473a310ece28988b604 Author: Daniel Axtens Date: Tue Dec 21 16:59:02 2021 +1100 powerpc/64/asm: Do not reassign labels The LLVM integrated assembler really does not like us reassigning things to the same label: :7:9: error: invalid reassignment of non-absolute variable 'fs_label' This happens across a bunch of platforms: https://github.com/ClangBuiltLinux/linux/issues/1043 https://github.com/ClangBuiltLinux/linux/issues/1008 https://github.com/ClangBuiltLinux/linux/issues/920 https://github.com/ClangBuiltLinux/linux/issues/1050 There is no hope of getting this fixed in LLVM (see https://github.com/ClangBuiltLinux/linux/issues/1043#issuecomment-641571200 and https://bugs.llvm.org/show_bug.cgi?id=47798#c1 ) so if we want to build with LLVM_IAS, we need to hack around it ourselves. For us the big problem comes from this: \#define USE_FIXED_SECTION(sname) \ fs_label = start_##sname; \ fs_start = sname##_start; \ use_ftsec sname; \#define USE_TEXT_SECTION() fs_label = start_text; \ fs_start = text_start; \ .text and in particular fs_label. This works around it by not setting those 'variables' and requiring that users of the variables instead track for themselves what section they are in. This isn't amazing, by any stretch, but it gets us further in the compilation. Note that even though users have to keep track of the section, using a wrong one produces an error with both binutils and llvm which prevents from using wrong section at the compile time: llvm error example: AS arch/powerpc/kernel/head_64.o :0: error: Cannot represent a difference across sections make[3]: *** [/home/aik/p/kernels-llvm/llvm/scripts/Makefile.build:388: arch/powerpc/kernel/head_64.o] Error 1 binutils error example: /home/aik/p/kernels-llvm/llvm/arch/powerpc/kernel/exceptions-64s.S: Assembler messages: /home/aik/p/kernels-llvm/llvm/arch/powerpc/kernel/exceptions-64s.S:1974: Error: can't resolve `system_call_common' {.text section} - `start_r eal_vectors' {.head.text.real_vectors section} make[3]: *** [/home/aik/p/kernels-llvm/llvm/scripts/Makefile.build:388: arch/powerpc/kernel/head_64.o] Error 1 Signed-off-by: Daniel Axtens Signed-off-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211221055904.555763-5-aik@ozlabs.ru commit fd983957971632088908c646116383402f04084b Author: Alexey Kardashevskiy Date: Tue Dec 21 16:59:01 2021 +1100 powerpc/64/asm: Inline BRANCH_TO_C000 It is used just once and does not really help with readability, remove it. Signed-off-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211221055904.555763-4-aik@ozlabs.ru commit f5140cab448e4819ca6f158cb4130352f73c92e4 Author: Daniel Axtens Date: Tue Dec 21 16:59:00 2021 +1100 powerpc: check for support for -Wa,-m{power4,any} LLVM's integrated assembler does not like either -Wa,-mpower4 or -Wa,-many. So just don't pass them if they're not supported. Signed-off-by: Daniel Axtens Signed-off-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211221055904.555763-3-aik@ozlabs.ru commit a3ad84da076009c94969fa97f604257667e2980f Author: Alan Modra Date: Tue Dec 21 16:58:59 2021 +1100 powerpc/toc: Future proof kernel toc This patch future-proofs the kernel against linker changes that might put the toc pointer at some location other than .got+0x8000, by replacing __toc_start+0x8000 with .TOC. throughout. If the kernel's idea of the toc pointer doesn't agree with the linker, bad things happen. prom_init.c code relocating its toc is also changed so that a symbolic __prom_init_toc_start toc-pointer relative address is calculated rather than assuming that it is always at toc-pointer - 0x8000. The length calculations loading values from the toc are also avoided. It's a little incestuous to do that with unreloc_toc picking up adjusted values (which is fine in practice, they both adjust by the same amount if all goes well). I've also changed the way .got is aligned in vmlinux.lds and zImage.lds, mostly so that dumping out section info by objdump or readelf plainly shows the alignment is 256. This linker script feature was added 2005-09-27, available in FSF binutils releases from 2.17 onwards. Should be safe to use in the kernel, I think. Finally, put *(.got) before the prom_init.o entry which only needs *(.toc), so that the GOT header goes in the correct place. I don't believe this makes any difference for the kernel as it would for dynamic objects being loaded by ld.so. That change is just to stop lusers who blindly copy kernel scripts being led astray. Of course, this change needs the prom_init.c changes. Some notes on .toc and .got. .toc is a compiler generated section of addresses. .got is a linker generated section of addresses, generally built when the linker sees R_*_*GOT* relocations. In the case of powerpc64 ld.bfd, there are multiple generated .got sections, one per input object file. So you can somewhat reasonably write in a linker script an input section statement like *prom_init.o(.got .toc) to mean "the .got and .toc section for files matching *prom_init.o". On other architectures that doesn't make sense, because the linker generally has just one .got section. Even on powerpc64, note well that the GOT entries for prom_init.o may be merged with GOT entries from other objects. That means that if prom_init.o references, say, _end via some GOT relocation, and some other object also references _end via a GOT relocation, the GOT entry for _end may be in the range __prom_init_toc_start to __prom_init_toc_end and if the kernel does something special to GOT/TOC entries in that range then the value of _end as seen by objects other than prom_init.o will be affected. On the other hand the GOT entry for _end may not be in the range __prom_init_toc_start to __prom_init_toc_end. Which way it turns out is deterministic but a detail of linker operation that should not be relied on. A feature of ld.bfd is that input .toc (and .got) sections matching one linker input section statement may be sorted, to put entries used by small-model code first, near the toc base. This is why scripts for powerpc64 normally use *(.got .toc) rather than *(.got) *(.toc), since the first form allows more freedom to sort. Another feature of ld.bfd is that indirect addressing sequences using the GOT/TOC may be edited by the linker to relative addressing. In many cases relative addressing would be emitted by gcc for -mcmodel=medium if you appropriately decorate variable declarations with non-default visibility. The original patch is here: https://lore.kernel.org/linuxppc-dev/20210310034813.GM6042@bubble.grove.modra.org/ Signed-off-by: Alan Modra [aik: removed non-relocatable which is gone in 24d33ac5b8ffb] [aik: added <=2.24 check] [aik: because of llvm-as, kernel_toc_addr() uses "mr" instead of global register variable] Signed-off-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211221055904.555763-2-aik@ozlabs.ru commit 7da1d1ddd1f02e5de7497a0c849256912652fb6c Author: Nick Child Date: Thu Dec 16 17:00:35 2021 -0500 cuda/pmu: Make find_via_cuda/pmu init functions Make `find_via_cuda` and `find_via_pmu` initialization functions. Previously, their definitions in `drivers/macintosh/via-cuda.h` include the `__init` attribute but their alternative definitions in `arch/powerpc/powermac/sectup./c` and prototypes in `include/linux/ cuda.h` and `include/linux/pmu.h` do not use the `__init` macro. Since, only initialization functions call `find_via_cuda` and `find_via_pmu` it is safe to label these functions with `__init`. Signed-off-by: Nick Child Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211216220035.605465-21-nick.child@ibm.com commit 2493a24271dab3d5c1235a13cf6ee2d12773c9a1 Author: Nick Child Date: Thu Dec 16 17:00:34 2021 -0500 powerpc/512x: Add __init attribute to eligible functions Some functions defined in 'arch/powerpc/platforms/512x' are deserving of an `__init` macro attribute. These functions are only called by other initialization functions and therefore should inherit the attribute. Also, change function declarations in header files to include `__init`. Signed-off-by: Nick Child Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211216220035.605465-20-nick.child@ibm.com commit 407454cafd3f1878dae6bb839d8bac2db264300f Author: Nick Child Date: Thu Dec 16 17:00:33 2021 -0500 powerpc/85xx: Add __init attribute to eligible functions Some functions defined in 'arch/powerpc/platforms/85xx' are deserving of an `__init` macro attribute. These functions are only called by other initialization functions and therefore should inherit the attribute. Also, change function declarations in header files to include `__init`. Signed-off-by: Nick Child Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211216220035.605465-19-nick.child@ibm.com commit f4a88b0ef5c5f7ce218aced7d811a31dd311a0b0 Author: Nick Child Date: Thu Dec 16 17:00:32 2021 -0500 powerpc/83xx: Add __init attribute to eligible functions Some functions defined in 'arch/powerpc/platforms/83xx' are deserving of an `__init` macro attribute. These functions are only called by other initialization functions and therefore should inherit the attribute. Also, change function declarations in header files to include `__init`. Signed-off-by: Nick Child Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211216220035.605465-18-nick.child@ibm.com commit c0dc225ae7dd9f01d46ea779f7f169d49aa59b78 Author: Nick Child Date: Thu Dec 16 17:00:31 2021 -0500 powerpc/embedded6xx: Add __init attribute to eligible functions Some functions defined in 'arch/powerpc/platforms/embedded6xx' are deserving of an `__init` macro attribute. These functions are only called by other initialization functions and therefore should inherit the attribute. Also, change function declarations in header files to include `__init`. Signed-off-by: Nick Child Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211216220035.605465-17-nick.child@ibm.com commit 1ee969be25ed21a1192ca569ad827013eb7fac04 Author: Nick Child Date: Thu Dec 16 17:00:30 2021 -0500 powerpc/44x: Add __init attribute to eligible functions Some functions defined in 'arch/powerpc/platforms/44x/' are deserving of an `__init` macro attribute. These functions are only called by other initialization functions and therefore should inherit the attribute. Signed-off-by: Nick Child Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211216220035.605465-16-nick.child@ibm.com commit 1e3d992d213928851f7ddec6f150fb54fe759b64 Author: Nick Child Date: Thu Dec 16 17:00:29 2021 -0500 powerpc/4xx: Add __init attribute to eligible functions Some functions defined in 'arch/powerpc/platforms/4xx' are deserving of an `__init` macro attribute. These functions are only called by other initialization functions and therefore should inherit the attribute. Signed-off-by: Nick Child Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211216220035.605465-15-nick.child@ibm.com commit f1ba9b9474a9e32b9c173c91e71f713bfa7b2463 Author: Nick Child Date: Thu Dec 16 17:00:28 2021 -0500 powerpc/ps3: Add __init attribute to eligible functions Some functions defined in 'arch/powerpc/platforms/ps3' are deserving of an `__init` macro attribute. These functions are only called by other initialization functions and therefore should inherit the attribute. Also, change function declarations in header files to include `__init`. Signed-off-by: Nick Child Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211216220035.605465-14-nick.child@ibm.com commit e14ff96d08f0ade9dd33081d909ad65a02a858c1 Author: Nick Child Date: Thu Dec 16 17:00:27 2021 -0500 powerpc/pseries: Add __init attribute to eligible functions Some functions defined in 'arch/powerpc/platforms/pseries' are deserving of an `__init` macro attribute. These functions are only called by other initialization functions and therefore should inherit the attribute. Also, change function declarations in header files to include `__init`. Signed-off-by: Nick Child Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211216220035.605465-13-nick.child@ibm.com commit e5913db1ef22817e128f0a794752f7393205e00b Author: Nick Child Date: Thu Dec 16 17:00:26 2021 -0500 powerpc/powernv: Add __init attribute to eligible functions Some functions defined in 'arch/powerpc/platforms/powernv' are deserving of an `__init` macro attribute. These functions are only called by other initialization functions and therefore should inherit the attribute. Also, change function declarations in header files to include `__init`. Signed-off-by: Nick Child Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211216220035.605465-12-nick.child@ibm.com commit b346f57100e9417f23ee9051f0efe621a492be96 Author: Nick Child Date: Thu Dec 16 17:00:25 2021 -0500 powerpc/powermac: Add __init attribute to eligible functions Some functions defined in 'arch/powerpc/platforms/powermac` are only called by other initialization functions and therefore should inherit the attribute. Also, change function declarations in header files to include `__init`. Signed-off-by: Nick Child Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211216220035.605465-11-nick.child@ibm.com commit e37e06af9b0d6b7828159455d33f8ef45c456460 Author: Nick Child Date: Thu Dec 16 17:00:24 2021 -0500 powerpc/pasemi: Add __init attribute to eligible functions Some functions defined in 'arch/powerpc/platforms/pasemi' are deserving of an `__init` macro attribute. These functions are only called by other initialization functions and therefore should inherit the attribute. Also, change function declarations in header files to include `__init`. Signed-off-by: Nick Child Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211216220035.605465-10-nick.child@ibm.com commit d3aa3c5edf0cb7ac0b0b5b0d144bba60b0ee77da Author: Nick Child Date: Thu Dec 16 17:00:23 2021 -0500 powerpc/chrp: Add __init attribute to eligible functions The function `Enable_SRAM` defined in 'arch/powerpc/platforms/chrp' is deserving of an `__init` macro attribute. This function is only called by other initialization functions and therefore should inherit the attribute. Signed-off-by: Nick Child Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211216220035.605465-9-nick.child@ibm.com commit 7c1ab16b2d035c6bc3b6b6980ab7e72f547edc45 Author: Nick Child Date: Thu Dec 16 17:00:22 2021 -0500 powerpc/cell: Add __init attribute to eligible functions Some functions defined in 'arch/powerpc/platforms/cell' are deserving of an `__init` macro attribute. These functions are only called by other initialization functions and therefore should inherit the attribute. Signed-off-by: Nick Child Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211216220035.605465-8-nick.child@ibm.com commit 456e8eb324a47573b377f7041f4c038fac403f86 Author: Nick Child Date: Thu Dec 16 17:00:21 2021 -0500 powerpc/xmon: Add __init attribute to eligible functions `xmon_register_spus` defined in 'arch/powerpc/xmon' is deserving of an `__init` macro attribute. This functions is only called by other initialization functions and therefore should inherit the attribute. Also, change the function declaration in the header file to include `__init`. Signed-off-by: Nick Child Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211216220035.605465-7-nick.child@ibm.com commit 6c552983d0e65a8c923dfacc4f69b694205672c1 Author: Nick Child Date: Thu Dec 16 17:00:20 2021 -0500 powerpc/sysdev: Add __init attribute to eligible functions Some files functions in 'arch/powerpc/sysdev' are deserving of an `__init` macro attribute. These functions are only called by other initialization functions and therefore should inherit the attribute. Also, change function declarations in header files to include `__init`. Signed-off-by: Nick Child Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211216220035.605465-6-nick.child@ibm.com commit c49f5d88ff0166ffa4e48ee8ce84d63719f346be Author: Nick Child Date: Thu Dec 16 17:00:19 2021 -0500 powerpc/perf: Add __init attribute to eligible functions Some functions defined in 'arch/powerpc/perf' are deserving of an `__init` macro attribute. These functions are only called by other initialization functions and therefore should inherit the attribute. Also, change function declarations in header files to include `__init`. Signed-off-by: Nick Child Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211216220035.605465-5-nick.child@ibm.com commit c13f2b2bb5afd90f152c389c1c9245a0d43bce80 Author: Nick Child Date: Thu Dec 16 17:00:18 2021 -0500 powerpc/mm: Add __init attribute to eligible functions Some functions defined in 'arch/powerpc/mm' are deserving of an `__init` macro attribute. These functions are only called by other initialization functions and therefore should inherit the attribute. Also, change function declarations in header files to include `__init`. Signed-off-by: Nick Child Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211216220035.605465-4-nick.child@ibm.com commit ce0c6be9c69883df38e7631d1d7364b52f6db135 Author: Nick Child Date: Thu Dec 16 17:00:17 2021 -0500 powerpc/lib: Add __init attribute to eligible functions Some functions defined in 'arch/powerpc/lib' are deserving of an `__init` macro attribute. These functions are only called by other initialization functions and therefore should inherit the attribute. Also, change function declarations in header files to include `__init`. Signed-off-by: Nick Child Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211216220035.605465-3-nick.child@ibm.com commit d276960d9296b6a9074795fe60a513abf8474e35 Author: Nick Child Date: Thu Dec 16 17:00:16 2021 -0500 powerpc/kernel: Add __init attribute to eligible functions Some functions defined in `arch/powerpc/kernel` (and one in `arch/powerpc/ kexec`) are deserving of an `__init` macro attribute. These functions are only called by other initialization functions and therefore should inherit the attribute. Also, change function declarations in header files to include `__init`. Signed-off-by: Nick Child Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211216220035.605465-2-nick.child@ibm.com commit 6cb12fbda1c2e2fcb6d3adfe01f18eef6812e278 Author: Maarten Lankhorst Date: Wed Dec 22 16:56:22 2021 +0100 drm/i915: Use trylock instead of blocking lock for __i915_gem_free_objects. Convert free_work into delayed_work, similar to ttm to allow converting the blocking lock in __i915_gem_free_objects to a trylock. Unlike ttm, the object should already be idle, as it's kept alive by a reference through struct i915_vma->active, which is dropped after all vma's are idle. Because of this, we can use a no wait by default, or when the lock is contested, we use ttm's 10 ms. The trylock should only fail when the object is sharing it's resv with other objects, and typically objects are not kept locked for a long time, so we can safely retry on failure. Fixes: be7612fd6665 ("drm/i915: Require object lock when freeing pages during destruction") Testcase: igt/gem_exec_alignment/pi* Signed-off-by: Maarten Lankhorst Reviewed-by: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20211222155622.2960379-1-maarten.lankhorst@linux.intel.com commit 42b559727a45d79c811f493515eb9b7e56016421 Author: Peter Geis Date: Wed Dec 15 16:02:50 2021 -0500 phy: phy-rockchip-inno-usb2: add rk3568 support The rk3568 usb2phy is a standalone device with a single muxed interrupt. Add support for the registers to the usb2phy driver. Signed-off-by: Peter Geis Tested-by: Michael Riesch Link: https://lore.kernel.org/r/20211215210252.120923-7-pgwipeout@gmail.com Signed-off-by: Vinod Koul commit ed2b5a8e6b98d042b323afbe177a5dc618921b31 Author: Peter Geis Date: Wed Dec 15 16:02:49 2021 -0500 phy: phy-rockchip-inno-usb2: support muxed interrupts The rk3568 usb2phy has a single muxed interrupt that handles all interrupts. Allow the driver to plug in only a single interrupt as necessary. Signed-off-by: Peter Geis Tested-by: Michael Riesch Link: https://lore.kernel.org/r/20211215210252.120923-6-pgwipeout@gmail.com Signed-off-by: Vinod Koul commit e6915e1acca57bc4fdb61dccd5cc2e49f72ef743 Author: Peter Geis Date: Wed Dec 15 16:02:48 2021 -0500 phy: phy-rockchip-inno-usb2: support standalone phy nodes New Rockchip devices have the usb2 phy devices as standalone nodes instead of children of the grf node. Allow the driver to find the grf node from a phandle. Signed-off-by: Peter Geis Tested-by: Michael Riesch Link: https://lore.kernel.org/r/20211215210252.120923-5-pgwipeout@gmail.com Signed-off-by: Vinod Koul commit 9c19c531dc98d7ba49b44802a607042e763ebe21 Author: Peter Geis Date: Wed Dec 15 16:02:47 2021 -0500 phy: phy-rockchip-inno-usb2: support #address_cells = 2 New Rockchip devices have the usb phy nodes as standalone devices. These nodes have register nodes with #address_cells = 2, but only use 32 bit addresses. Adjust the driver to check if the returned address is "0", and adjust the index in that case. Signed-off-by: Peter Geis Tested-by: Michael Riesch Link: https://lore.kernel.org/r/20211215210252.120923-4-pgwipeout@gmail.com Signed-off-by: Vinod Koul commit 8eff5b99042dd2fe6494e82ab1dc39bcdd5b976c Author: Peter Geis Date: Wed Dec 15 16:02:46 2021 -0500 dt-bindings: phy: phy-rockchip-inno-usb2: add rk3568 documentation The rk3568 usb2phy node is a standalone node with a single muxed interrupt. Add documentation for it to phy-rockchip-inno-usb2. Signed-off-by: Peter Geis Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211215210252.120923-3-pgwipeout@gmail.com Signed-off-by: Vinod Koul commit bb53bcb2b104d9b175d0f8362e5fedcca38e6367 Merge: 30be4551f9e26 810ef9552dece Author: David S. Miller Date: Thu Dec 23 11:24:01 2021 +0000 Merge branch 'mlxsw-tests' Amit Cohen says: ==================== mlxsw: Add tests for VxLAN with IPv6 underlay mlxsw driver lately added support for VxLAN with IPv6 underlay. This set adds tests for IPv6, which are dedicated for mlxsw. Patch set overview: Patches #1-#2 make vxlan.sh test more flexible and extend it for IPv6 Patches #3-#4 make vxlan_fdb_veto.sh test more flexible and extend it for IPv6 Patches #5-#6 add tests for VxLAN flooding for different ASICs Patches #7-#8 add test for VxLAN related traps and align the existing test ==================== Signed-off-by: David S. Miller commit 810ef9552dece4e9bb3ef37d008dc2cf4b317dc6 Author: Amit Cohen Date: Thu Dec 23 09:30:02 2021 +0200 selftests: mlxsw: devlink_trap_tunnel_vxlan: Fix 'decap_error' case Change the case that sends packets with "too short inner packet" to include part of ethernet header, to make the trap to be triggered due to the correct reason. According to ASIC arch, the trap is triggered if overlay packet length is less than 18B, and the minimum inner packet should include source MAC and destination MAC. Till now the case passed because one of the reserved bits in VxLAN header was used. This issue was found while adding an equivalent test for IPv6. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit c777d726267c0a5ca9216a5f17ed12d67bc97c99 Author: Amit Cohen Date: Thu Dec 23 09:30:01 2021 +0200 selftests: mlxsw: Add test for VxLAN related traps for IPv6 The test configures VxLAN with IPv6 underlay and verifies that the expected traps are triggered under the right conditions. The test is similar to the existing IPv4 test. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit d01724dd2a66087ac6b3c4b45e25d475be7dd2f4 Author: Amit Cohen Date: Thu Dec 23 09:30:00 2021 +0200 selftests: mlxsw: spectrum-2: Add a test for VxLAN flooding with IPv6 The device stores flood records in a singly linked list where each record stores up to X IP addresses of remote VTEPs. The number of records is changed according to ASIC type and address family. Add a test which is similar to the existing IPv4 test to check IPv6. The test is dedicated for Spectrum-2 and above, which support up to four IPv6 addresses in one record. The test verifies that packets are correctly flooded in various cases such as deletion of a record in the middle of the list. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit 7ae23eddfa3e5c1d1892c19a50cfe52b4af300cf Author: Amit Cohen Date: Thu Dec 23 09:29:59 2021 +0200 selftests: mlxsw: spectrum: Add a test for VxLAN flooding with IPv6 The device stores flood records in a singly linked list where each record stores up to X IP addresses of remote VTEPs. The number of records is changed according to ASIC type and address family. Add a test which is similar to the existing IPv4 test to check IPv6. The test is dedicated for Spectrum-1 switches, which support up to five IPv6 addresses in one record. The test verifies that packets are correctly flooded in various cases such as deletion of a record in the middle of the list. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit 1c7b183dac8917f6329cc809ac61cdf9d3ce9f3f Author: Amit Cohen Date: Thu Dec 23 09:29:58 2021 +0200 selftests: mlxsw: Add VxLAN FDB veto test for IPv6 Add test to verify FDB vetos of VxLAN with IPv6 underlay. Use the existing test which checks IPv4. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit 696285305b32f4fc1ddfb2d158ef4bbb6085ab92 Author: Amit Cohen Date: Thu Dec 23 09:29:57 2021 +0200 selftests: mlxsw: vxlan_fdb_veto: Make the test more flexible for future use vxlan_fdb_veto.sh cases are dedicated to test VxLAN with IPv4 underlay. The main changes to test IPv6 underlay are IP addresses and some flags. Add variables to define all the values which supposed to be different for IPv6 testing, set them to use the existing values by default. The next patch will define the new added variables in a separated file, so the same tests can be used for IPv6 also. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit 21d4282dc1b81249184525da1acdb308288a952c Author: Amit Cohen Date: Thu Dec 23 09:29:56 2021 +0200 selftests: mlxsw: Add VxLAN configuration test for IPv6 Add test to verify configuration of VxLAN with IPv6 underlay. Use the existing test which checks IPv4. Add separated test cases for learning which is not supported for IPv6 and for UDP checksum flags which are different from IPv4 flags. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit 8e059d64bee4a71064423ed34e04868cff478678 Author: Amit Cohen Date: Thu Dec 23 09:29:55 2021 +0200 selftests: mlxsw: vxlan: Make the test more flexible for future use vxlan.sh cases are dedicated to test VxLAN with IPv4 underlay. The main changes to test IPv6 underlay are IP addresses and some flags. Add variables to define all the values which supposed to be different for IPv6 testing, set them to use the existing values by default. The next patch will define the new added variables in a separated file, so the same tests can be used for IPv6 also. Rename some functions to include "ipv4", so the next patch will add equivalent functions for IPv6. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Signed-off-by: David S. Miller commit 30be4551f9e26292599e666985119a5b559a2e4a Author: Andy Shevchenko Date: Wed Dec 22 18:32:56 2021 +0200 wwan: Replace kernel.h with the necessary inclusions When kernel.h is used in the headers it adds a lot into dependency hell, especially when there are circular dependencies are involved. Replace kernel.h inclusion with the list of what is really being used. Signed-off-by: Andy Shevchenko Reviewed-by: Sergey Ryazanov Signed-off-by: David S. Miller commit e48cb313fde3e6f9434bb41c858d5c791d83f2d0 Author: Ong Boon Leong Date: Wed Dec 22 22:43:10 2021 +0800 net: stmmac: add tc flower filter for EtherType matching This patch adds basic support for EtherType RX frame steering for LLDP and PTP using the hardware offload capabilities. Example steps for setting up RX frame steering for LLDP and PTP: $ IFDEVNAME=eth0 $ tc qdisc add dev $IFDEVNAME ingress $ tc qdisc add dev $IFDEVNAME root mqprio num_tc 8 \ map 0 1 2 3 4 5 6 7 0 0 0 0 0 0 0 0 \ queues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7 hw 0 For LLDP $ tc filter add dev $IFDEVNAME parent ffff: protocol 0x88cc \ flower hw_tc 5 OR $ tc filter add dev $IFDEVNAME parent ffff: protocol LLDP \ flower hw_tc 5 For PTP $ tc filter add dev $IFDEVNAME parent ffff: protocol 0x88f7 \ flower hw_tc 6 Show tc ingress filter $ tc filter show dev $IFDEVNAME ingress v1->v2: Thanks to Kurt's and Sebastian's suggestion. - change from __be16 to u16 etype - change ETHER_TYPE_FULL_MASK to use cpu_to_be16() macro Signed-off-by: Ong Boon Leong Signed-off-by: David S. Miller commit 2e49761e4fd156d0be61810ad6958b5a57f7cc9e Author: Horatiu Vultur Date: Wed Dec 22 12:07:59 2021 +0100 net: lan966x: Add support for multiple bridge flags This patch series extends the current supported bridge flags with the following flags: BR_FLOOD, BR_BCAST_FLOOD and BR_LEARNING. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 963178a06352a059c688eb36f1f8c2f03212b60b Author: Baowen Zheng Date: Wed Dec 22 12:25:46 2021 +0800 flow_offload: fix suspicious RCU usage when offloading tc action Fix suspicious rcu_dereference_protected() usage when offloading tc action. We should hold tcfa_lock to offload tc action in action initiation. Without these changes, the following warning will be observed: WARNING: suspicious RCU usage 5.16.0-rc5-net-next-01504-g7d1f236dcffa-dirty #50 Tainted: G I ----------------------------- include/net/tc_act/tc_tunnel_key.h:33 suspicious rcu_dereference_protected() usage! 1 lock held by tc/12108: CPU: 4 PID: 12108 Comm: tc Tainted: G Hardware name: Dell Inc. PowerEdge R740/07WCGN, BIOS 1.6.11 11/20/2018 Call Trace: dump_stack_lvl+0x49/0x5e dump_stack+0x10/0x12 lockdep_rcu_suspicious+0xed/0xf8 tcf_tunnel_key_offload_act_setup+0x1de/0x300 [act_tunnel_key] tcf_action_offload_add_ex+0xc0/0x1f0 tcf_action_init+0x26a/0x2f0 tcf_action_add+0xa9/0x1f0 tc_ctl_action+0xfb/0x170 rtnetlink_rcv_msg+0x169/0x510 ? sched_clock+0x9/0x10 ? rtnl_newlink+0x70/0x70 netlink_rcv_skb+0x55/0x100 rtnetlink_rcv+0x15/0x20 netlink_unicast+0x1a8/0x270 netlink_sendmsg+0x245/0x490 sock_sendmsg+0x65/0x70 ____sys_sendmsg+0x219/0x260 ? __import_iovec+0x2c/0x150 ___sys_sendmsg+0xb7/0x100 ? __lock_acquire+0x3d5/0x1f40 ? __this_cpu_preempt_check+0x13/0x20 ? lock_is_held_type+0xe4/0x140 ? sched_clock+0x9/0x10 ? ktime_get_coarse_real_ts64+0xbe/0xd0 ? __this_cpu_preempt_check+0x13/0x20 ? lockdep_hardirqs_on+0x7e/0x100 ? ktime_get_coarse_real_ts64+0xbe/0xd0 ? trace_hardirqs_on+0x2a/0xf0 __sys_sendmsg+0x5a/0xa0 ? syscall_trace_enter.constprop.0+0x1dd/0x220 __x64_sys_sendmsg+0x1f/0x30 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f4db7bb7a60 Fixes: 8cbfe939abe9 ("flow_offload: allow user to offload tc action to net device") Reported-by: Eric Dumazet Signed-off-by: Baowen Zheng Signed-off-by: Louis Peens Signed-off-by: David S. Miller commit 3d3b2f57d4447e6e9f4096ad01d0e4129f7bc7e9 Author: Xin Long Date: Tue Dec 21 16:40:30 2021 -0500 sctp: move hlist_node and hashent out of sctp_ep_common Struct sctp_ep_common is included in both asoc and ep, but hlist_node and hashent are only needed by ep after asoc_hashtable was dropped by Commit b5eff7128366 ("sctp: drop the old assoc hashtable of sctp"). So it is better to move hlist_node and hashent from sctp_ep_common to sctp_endpoint, and it saves some space for each asoc. Signed-off-by: Xin Long Signed-off-by: David S. Miller commit e368cd72880360ffe9b298349ae96286dd121499 Author: David Vernet Date: Tue Dec 21 06:57:45 2021 -0800 Documentation: livepatch: Add livepatch API page The livepatch subsystem has several exported functions and objects with kerneldoc comments. Though the livepatch documentation contains handwritten descriptions of all of these exported functions, they are currently not pulled into the docs build using the kernel-doc directive. In order to allow readers of the documentation to see the full kerneldoc comments in the generated documentation files, this change adds a new Documentation/livepatch/api.rst page which contains kernel-doc directives to link the kerneldoc comments directly in the documentation. With this, all of the hand-written descriptions of the APIs now cross-reference the kerneldoc comments on the new Livepatching APIs page, and running ./scripts/find-unused-docs.sh on kernel/livepatch no longer shows any files as missing documentation. Note that all of the handwritten API descriptions were left alone with the exception of Documentation/livepatch/system-state.rst, which was updated to allow the cross-referencing to work correctly. The file now follows the cross-referencing formatting guidance specified in Documentation/doc-guide/kernel-doc.rst. Furthermore, some comments around klp_shadow_free_all() were updated to say <_, id> rather than <*, id> to match the rest of the file, and to prevent the docs build from emitting an "Inline emphasis start-string without end string" error. Signed-off-by: David Vernet Reviewed-by: Petr Mladek Acked-by: Miroslav Benes Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20211221145743.4098360-1-void@manifault.com commit e3d347943919f35ccdeed8d2cc62e8c6c12b36cd Author: Hannes Reinecke Date: Mon Dec 20 13:51:45 2021 +0100 nvme: add 'iopolicy' module parameter While the 'iopolicy' sysfs attribute can be set at runtime, most storage arrays prefer to use the 'round-robin' iopolicy per default. We can use udev rules to set this, but is getting rather unwieldy for rebranded arrays as we would have to update the udev rules anytime a new array shows up, leading to the same mess we currently have in multipathd for configuring the RDAC arrays. Hence this patch adds a module parameter 'iopolicy' to allow the admin to switch the default, and to do away with the need for a udev rule here. Signed-off-by: Hannes Reinecke Reviewed-by: Sagi Grimberg Reviewed-by: Daniel Wagner Signed-off-by: Christoph Hellwig commit 3a605e32a7f8f78d844b4272c257029c337a4352 Author: Geliang Tang Date: Wed Dec 22 17:32:44 2021 +0800 nvme: drop unused variable ctrl in nvme_setup_cmd The variable 'ctrl' became useless since the code using it was dropped from nvme_setup_cmd() in the commit 292ddf67bbd5 ("nvme: increment request genctr on completion"). Fix it to get rid of this compilation warning in the nvme-5.17 branch: drivers/nvme/host/core.c: In function ‘nvme_setup_cmd’: drivers/nvme/host/core.c:993:20: warning: unused variable ‘ctrl’ [-Wunused-variable] struct nvme_ctrl *ctrl = nvme_req(req)->ctrl; ^~~~ Fixes: 292ddf67bbd5 ("nvme: increment request genctr on completion") Signed-off-by: Geliang Tang Signed-off-by: Christoph Hellwig commit e4fdb2b167ed225a3793a249c4342da915940b6b Author: Keith Busch Date: Mon Dec 13 09:08:47 2021 -0800 nvme: increment request genctr on completion The nvme request generation counter is intended to catch duplicate completions. Incrementing the counter on submission means duplicates can only be caught if the request tag is reallocated and dispatched prior to the driver observing the corrupted CQE. Incrementing on completion removes this window, making it possible to detect duplicate completions in consecutive entries. Signed-off-by: Keith Busch Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig commit f18ee3d988157ebcadc9b7e5fd34811938f50223 Author: Hannes Reinecke Date: Tue Dec 7 14:55:49 2021 +0100 nvme-fabrics: print out valid arguments when reading from /dev/nvme-fabrics Currently applications have a hard time figuring out which nvme-over-fabrics arguments are supported for any given kernel; the ioctl will return an error code on failure, and the application has to guess whether this was due to an invalid argument or due to a connection or controller error. With this patch applications can read a list of supported arguments by simply reading from /dev/nvme-fabrics, allowing them to validate the connection string. Signed-off-by: Hannes Reinecke Reviewed-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig commit 5fe392ff9d1f7254a1fbb3f72d9893088e4d23eb Author: Nathan Chancellor Date: Wed Dec 22 09:30:41 2021 -0700 x86/boot/compressed: Move CLANG_FLAGS to beginning of KBUILD_CFLAGS When cross compiling i386_defconfig on an arm64 host with clang, there are a few instances of '-Waddress-of-packed-member' and '-Wgnu-variable-sized-type-not-at-end' in arch/x86/boot/compressed/, which should both be disabled with the cc-disable-warning calls in that directory's Makefile, which indicates that cc-disable-warning is failing at the point of testing these flags. The cc-disable-warning calls fail because at the point that the flags are tested, KBUILD_CFLAGS has '-march=i386' without $(CLANG_FLAGS), which has the '--target=' flag to tell clang what architecture it is targeting. Without the '--target=' flag, the host architecture (arm64) is used and i386 is not a valid value for '-march=' in that case. This error can be seen by adding some logging to try-run: clang-14: error: the clang compiler does not support '-march=i386' Invoking the compiler has to succeed prior to calling cc-option or cc-disable-warning in order to accurately test whether or not the flag is supported; if it doesn't, the requested flag can never be added to the compiler flags. Move $(CLANG_FLAGS) to the beginning of KBUILD_FLAGS so that any new flags that might be added in the future can be accurately tested. Fixes: d5cbd80e302d ("x86/boot: Add $(CLANG_FLAGS) to compressed KBUILD_CFLAGS") Signed-off-by: Nathan Chancellor Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20211222163040.1961481-1-nathan@kernel.org commit 4e484b3e969b52effd95c17f7a86f39208b2ccf4 Author: Antony Antony Date: Wed Dec 22 14:11:18 2021 +0100 xfrm: rate limit SA mapping change message to user space Kernel generates mapping change message, XFRM_MSG_MAPPING, when a source port chage is detected on a input state with UDP encapsulation set. Kernel generates a message for each IPsec packet with new source port. For a high speed flow per packet mapping change message can be excessive, and can overload the user space listener. Introduce rate limiting for XFRM_MSG_MAPPING message to the user space. The rate limiting is configurable via netlink, when adding a new SA or updating it. Use the new attribute XFRMA_MTIMER_THRESH in seconds. v1->v2 change: update xfrm_sa_len() v2->v3 changes: use u32 insted unsigned long to reduce size of struct xfrm_state fix xfrm_ompat size Reported-by: kernel test robot accept XFRM_MSG_MAPPING only when XFRMA_ENCAP is present Co-developed-by: Thomas Egerer Signed-off-by: Thomas Egerer Signed-off-by: Antony Antony Signed-off-by: Steffen Klassert commit 23b6a6df94c6ce434e7947cfad14b1640fb9f794 Author: Xu Jia Date: Wed Dec 22 17:06:59 2021 +0800 xfrm: Add support for SM4 symmetric cipher algorithm This patch adds SM4 encryption algorithm entry to ealg_list. Signed-off-by: Xu Jia Signed-off-by: Steffen Klassert commit e6911affa416dc4e0c0b3f04cbe6b02ce13277f1 Author: Xu Jia Date: Wed Dec 22 17:06:58 2021 +0800 xfrm: Add support for SM3 secure hash This patch allows IPsec to use SM3 HMAC authentication algorithm. Signed-off-by: Xu Jia Signed-off-by: Steffen Klassert commit af734a26a1a95a9fda51f2abb0c22a7efcafd5ca Author: Antony Antony Date: Fri Dec 17 18:02:09 2021 +0100 xfrm: update SA curlft.use_time SA use_time was only updated once, for the first packet. with this fix update the use_time for every packet. Signed-off-by: Antony Antony Signed-off-by: Steffen Klassert commit 65b54ff67afab2754d61289ec59806d71c7dc0e8 Author: Tudor Ambarus Date: Sat Nov 6 12:29:15 2021 +0200 mtd: spi-nor: Constify part specific fixup hooks Constify 'struct spi_nor_fixups' in order to respect flash_info structure declaration. Signed-off-by: Tudor Ambarus Reviewed-by: Pratyush Yadav Link: https://lore.kernel.org/r/20211106102915.153552-1-tudor.ambarus@microchip.com commit e7ad9f59f746f07055c361bc3b32491448310b8f Author: Flavio Suligoi Date: Tue Jan 26 10:25:16 2021 +0100 mtd: spi-nor: core: Remove reference to spi-nor.c Remove the references to the old spi-nor.c file. The old drivers/mtd/spi-nor/spi-nor.c file is not more present and now some of its code is contained in: drivers/mtd/spi-nor/core.c Signed-off-by: Flavio Suligoi [tudor.ambarus@microchip.com: - remove change in Documentation/driver-api/mtd/spi-nor.rst. The documentation has to be rewritten entirely. - update commit message] Signed-off-by: Tudor Ambarus Reviewed-by: Jonathan Neuschäfer Link: https://lore.kernel.org/r/20210126092516.1431913-1-f.suligoi@asem.it commit c77b1f8a8faeeba43c694d9d09d0b25a4f52cf37 Author: Sreekanth Reddy Date: Mon Dec 20 19:41:59 2021 +0530 scsi: mpi3mr: Bump driver version to 8.0.0.61.0 Update the driver version to newer version format i.e. 8.0.0.61.0. Link: https://lore.kernel.org/r/20211220141159.16117-26-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit 243bcc8efdb1f44b1a1d415e6821a246714c68ce Author: Sreekanth Reddy Date: Mon Dec 20 19:41:58 2021 +0530 scsi: mpi3mr: Fixes around reply request queues Set reply queue depth of 1K for B0 and 4K for A0. While freeing the segmented request queues use the actual queue depth that is used while creating them. Link: https://lore.kernel.org/r/20211220141159.16117-25-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit a91603a5d504a81b5760aa4e25a46676a41395fc Author: Sreekanth Reddy Date: Mon Dec 20 19:41:57 2021 +0530 scsi: mpi3mr: Enhanced Task Management Support Reply handling Enhance driver to consider MPI3_IOCSTATUS_SCSI_IOC_TERMINATED as a success for TMs issued by it and check the pending I/Os to decide the success or failure of the task management requests instead of just considering the MPI3_IOCSTATUS_SCSI_IOC_TERMINATED as a failure of the task management request. Link: https://lore.kernel.org/r/20211220141159.16117-24-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit c86651345ca55be6670faffa4aba104616461243 Author: Sreekanth Reddy Date: Mon Dec 20 19:41:56 2021 +0530 scsi: mpi3mr: Use TM response codes from MPI3 headers Remove locally defined TM response codes and use codes from MPI3 headers. Link: https://lore.kernel.org/r/20211220141159.16117-23-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit afd3a5793fe2a217513bc5eb2228a5ca8e8b556a Author: Sreekanth Reddy Date: Mon Dec 20 19:41:55 2021 +0530 scsi: mpi3mr: Add io_uring interface support in I/O-polled mode Add support for the io_uring interface in I/O-polled mode. This feature is disabled in the driver by default. To enable the feature, a module parameter "poll_queues" has to be set with the desired number of polling queues. When the feature is enabled, the driver reserves a certain number of operational queue pairs for the poll_queues either from the available queue pairs or creates additional queue pairs based on the operational queue availability. The Polling queues will have corresponding IRQ and ISR functions as similar to default queues. However, the IRQ line is disabled by the driver for poll_queues. Link: https://lore.kernel.org/r/20211220141159.16117-22-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit 95cca8d5542a4cde0d3dd685f4108295ca28b63d Author: Sreekanth Reddy Date: Mon Dec 20 19:41:54 2021 +0530 scsi: mpi3mr: Print cable mngnt and temp threshold events Print cable management & temperature threshold event data. Use vendor id & device id macro definitions from MPI3 headers. Link: https://lore.kernel.org/r/20211220141159.16117-21-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit 78b76a0768ef8a25ab92a28da4ac9a74db762c47 Author: Sreekanth Reddy Date: Mon Dec 20 19:41:53 2021 +0530 scsi: mpi3mr: Support Prepare for Reset event The IOC sends a Prepare for Reset Event to the host to prepare for a Soft Reset. This event data has two reason codes: 1. Start - The host is expected to gracefully quiesce all I/O within approximately 1 second. 2. Abort - The IOC is requesting to abort a previous Prepare for Reset Event request. Normal I/O may be resumed. Link: https://lore.kernel.org/r/20211220141159.16117-20-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit c1af985d27da2d530c22604644e9025810f57d7c Author: Sreekanth Reddy Date: Mon Dec 20 19:41:52 2021 +0530 scsi: mpi3mr: Add Event acknowledgment logic Add Event acknowledgment logic. Link: https://lore.kernel.org/r/20211220141159.16117-19-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit c5758fc72b9256aae85f5565f5715a3798d337e0 Author: Sreekanth Reddy Date: Mon Dec 20 19:41:51 2021 +0530 scsi: mpi3mr: Gracefully handle online FW update operation Enhance driver to gracefully handle discrepancies in certain key data sizes between firmware update operations as mentioned below: - The driver displays an error message and marks the controller as unrecoverable if the firmware reports ReplyFrameSize that is greater than the current ReplyFrameSize. - If the firmware reports ReplyFrameSize greater than the current ReplyFrameSize then the driver uses the current ReplyFrameSize while copying the reply messages. - The driver displays an error message and marks the controller as unrecoverable if the firmware reports MaxOperationalReplyQueues less than the currently allocated operational reply queues count. - If the firmware reports MaxOperationalReplyQueues that is greater than the currently allocated operational reply queue count then the driver ignores the new increased value and uses the previously allocated number of operational queues only. - If the firmware reports MaxDevHandle greater than the previously used MaxDevHandle value after a reset then the driver re-allocates the 'device remove pending bitmap' buffer with the newer size using krealloc(). Link: https://lore.kernel.org/r/20211220141159.16117-18-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit b64845a7d4039ab9667bafff9d7bb59365f17c0f Author: Sreekanth Reddy Date: Mon Dec 20 19:41:50 2021 +0530 scsi: mpi3mr: Detect async reset that occurred in firmware Detect asynchronous reset that occurred in the firmware by polling for reset history bit of IOC status register is set and if that bit is set, then the driver waits for the controller to become ready and then re-initializes the controller. Also reduce the time driver is waiting for the controller to acknowledge the reset action after issuing a specific reset action to the controller. The wait time is reduced from 510 seconds to 30 seconds. If the controller didn't acknowledge a specific reset action within the time interval then the driver marks the controller as unrecoverable instead of retrying two more times prior to giving up. Link: https://lore.kernel.org/r/20211220141159.16117-17-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit c0b00a931e5e5fc143ed5563389ef72e40de9814 Author: Sreekanth Reddy Date: Mon Dec 20 19:41:49 2021 +0530 scsi: mpi3mr: Add IOC reinit function Add IOC reinitialization function. Link: https://lore.kernel.org/r/20211220141159.16117-16-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit fe6db615156573d3f6a37564b8a590cb03bbaf25 Author: Sreekanth Reddy Date: Mon Dec 20 19:41:48 2021 +0530 scsi: mpi3mr: Handle offline FW activation in graceful manner Currently the driver marks the controller as unrecoverable if there is an asynchronous reset or fault during the initialization, reinitialization post reset, and OS resume. Enhance driver to retry the initialization, re-initialization, and resume sequences for a maximum of 3 times if the controller became faulty or asynchronously reset due to a firmware activation during the initialization sequence. Link: https://lore.kernel.org/r/20211220141159.16117-15-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit 59bd9cfe3fa07234e34cc2406e97481b3398c2d6 Author: Sreekanth Reddy Date: Mon Dec 20 19:41:47 2021 +0530 scsi: mpi3mr: Code refactor of IOC init - part2 Move the IOC initialization's bring up logic to mpi3mr_bring_ioc_ready() routine. Link: https://lore.kernel.org/r/20211220141159.16117-14-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit e3605f65ef69f399aaade423f19f6db6eb3c11cb Author: Sreekanth Reddy Date: Mon Dec 20 19:41:46 2021 +0530 scsi: mpi3mr: Code refactor of IOC init - part1 Separate out reply and sense buffer allocation and initialization into two routines and call only initialization routine while issuing the IOC Init request message. Also move out the event enable logic to a separate function. Link: https://lore.kernel.org/r/20211220141159.16117-13-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit a6856cc4507be044497fcde48aa3d33e900cbc45 Author: Sreekanth Reddy Date: Mon Dec 20 19:41:45 2021 +0530 scsi: mpi3mr: Fault IOC when internal command gets timeout Save snapdump and fault the controller with the given reason code if it is already not in the fault or not in asynchronous reset. This ensures that soft reset is issued from the watchdog thread. This will also be used to handle initialization time faults/resets/timeout as in those cases immediate soft reset invocation is not required. Link: https://lore.kernel.org/r/20211220141159.16117-12-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit 2ac794baaec97c70faf17b56fba4adefd6b7ba3a Author: Sreekanth Reddy Date: Mon Dec 20 19:41:44 2021 +0530 scsi: mpi3mr: Display IOC firmware package version Display IOC firmware package version by reading component image upload data. Link: https://lore.kernel.org/r/20211220141159.16117-11-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit 13fd7b1555b6c1121c0f823bbfa3ee36e178df44 Author: Sreekanth Reddy Date: Mon Dec 20 19:41:43 2021 +0530 scsi: mpi3mr: Handle unaligned PLL in unmap cmnds The following special handling is needed for UNMAP commands issued to NVMe drives: - On B0 boards, if the parameter list length is greater than 24 and not a 16-byte multiple, then truncate the parameter list length to a 16-byte multiple. - On A0 boards, if the parameter list length is greater than block descriptor data length + 8, then truncate the parameter list length to block descriptor data length + 8 value. Link: https://lore.kernel.org/r/20211220141159.16117-10-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit 4f08b9637f639fed9c36fde4e238274c47ca5f53 Author: Sreekanth Reddy Date: Mon Dec 20 19:41:42 2021 +0530 scsi: mpi3mr: Increase internal cmnds timeout to 60s - Increase internal command timeout to 60 seconds. - Enable 16 device removal handshake processing in parallel in the device removal handshake infrastructure. Link: https://lore.kernel.org/r/20211220141159.16117-9-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit ba68779a518d9ebe734c1fca9f5e199826723b5b Author: Sreekanth Reddy Date: Mon Dec 20 19:41:41 2021 +0530 scsi: mpi3mr: Do access status validation before adding devices Add validation for various access statuses prior to exposing attached target device to the operating system. Link: https://lore.kernel.org/r/20211220141159.16117-8-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit 17d6b9cf89cfdb5a52298bb4abe7f1621f92ba93 Author: Sreekanth Reddy Date: Mon Dec 20 19:41:40 2021 +0530 scsi: mpi3mr: Add support for PCIe Managed Switch SES device The SAS4 Controller firmware exposes the SES devices in Managed PCIe Switch as a PCIe Device Type SCSI Device (MPI3_DEVICE0_PCIE_DEVICE_INFO_TYPE_SCSI_DEVICE). Driver is enhanced to handle this device type by: - Exposing the device to the upper layers and - Not updating any hardware sectors & virtual boundary settings as these settings are needed only for NVMe devices. Link: https://lore.kernel.org/r/20211220141159.16117-7-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit ec5ebd2c14a9123c0a8e2ae29202adf0ac242565 Author: Sreekanth Reddy Date: Mon Dec 20 19:41:39 2021 +0530 scsi: mpi3mr: Update MPI3 headers - part2 Continued updating MPI3 headers. Link: https://lore.kernel.org/r/20211220141159.16117-6-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit d00ff7c31195e2f5098b2c034f547a83c30b8adb Author: Sreekanth Reddy Date: Mon Dec 20 19:41:38 2021 +0530 scsi: mpi3mr: Update MPI3 headers - part1 Update MPI3 headers. Link: https://lore.kernel.org/r/20211220141159.16117-5-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit fbaa9aa48bb43a021847195704c10908ded3c2ba Author: Sreekanth Reddy Date: Mon Dec 20 19:41:37 2021 +0530 scsi: mpi3mr: Don't reset IOC if cmnds flush with reset status Don't issue the soft reset if internal commands are flushed out with reset status. Soft reset needs to be issued only if commands are really timed out. Link: https://lore.kernel.org/r/20211220141159.16117-4-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit a83ec831b24a8142e0871544b19ee5671607588e Author: Sreekanth Reddy Date: Mon Dec 20 19:41:36 2021 +0530 scsi: mpi3mr: Replace spin_lock() with spin_lock_irqsave() Use spin_lock_irqsave() instead of spin_lock() while acquiring reply_free_queue_lock & sbq_lock locks. Link: https://lore.kernel.org/r/20211220141159.16117-3-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit 9cf0666f34b1991d73db8b19dc53387724aaefae Author: Sreekanth Reddy Date: Mon Dec 20 19:41:35 2021 +0530 scsi: mpi3mr: Add debug APIs based on logging_level bits Add debug print functions which will print messages based on logging_level bits enabled. Link: https://lore.kernel.org/r/20211220141159.16117-2-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen commit 657b44d651eb284443d62895d9d47897729ef35a Author: Christoph Hellwig Date: Wed Dec 22 10:22:47 2021 +0100 scsi: pmcraid: Don't use GFP_DMA in pmcraid_alloc_sglist() The driver doesn't express DMA addressing limitation under 32-bits anywhere else, so remove the spurious GFP_DMA allocation. Link: https://lore.kernel.org/r/20211222092247.928711-1-hch@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 1964777e107a7125fb0753a27cdede213d05248c Author: Christoph Hellwig Date: Wed Dec 22 10:20:48 2021 +0100 scsi: snic: Don't use GFP_DMA in snic_queue_report_tgt_req() The driver doesn't express DMA addressing limitation under 32-bits anywhere else, so remove the spurious GFP_DMA allocation. Link: https://lore.kernel.org/r/20211222092048.925829-1-hch@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 0298b7daf8091f895d20a1b512cba6ab4af5aca9 Author: Christoph Hellwig Date: Wed Dec 22 10:19:35 2021 +0100 scsi: myrs: Don't use GFP_DMA The myrs devices supports 64-bit addressing, so remove the spurious GFP_DMA allocations. Link: https://lore.kernel.org/r/20211222091935.925624-1-hch@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 27363ba89f3472c39737e0bc34f75c5728e1cffb Author: Christoph Hellwig Date: Wed Dec 22 10:18:01 2021 +0100 scsi: myrb: Don't use GFP_DMA in myrb_pdev_slave_alloc() The driver doesn't express DMA addressing limitation under 32-bits anywhere else, so remove the spurious GFP_DMA allocation. Link: https://lore.kernel.org/r/20211222091801.924745-1-hch@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit c981e9e0f823a8300569c04e59f78c5faa52ada5 Author: Christoph Hellwig Date: Wed Dec 22 10:16:30 2021 +0100 scsi: initio: Don't use GFP_DMA in initio_probe_one() The driver doesn't express DMA addressing limitation under 32-bits anywhere else, so remove the spurious GFP_DMA allocation. Link: https://lore.kernel.org/r/20211222091630.922788-1-hch@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit d94d94969a4ba07a43d62429c60372320519c391 Author: Christoph Hellwig Date: Wed Dec 22 10:08:42 2021 +0100 scsi: sr: Don't use GFP_DMA The allocated buffers are used as a command payload, for which the block layer and/or DMA API do the proper bounce buffering if needed. Link: https://lore.kernel.org/r/20211222090842.920724-1-hch@lst.de Reported-by: Baoquan He Reviewed-by: Baoquan He Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit bc7806b39589f4960d7f583c2381edf2300be48c Author: Christoph Hellwig Date: Wed Dec 22 10:03:11 2021 +0100 scsi: ch: Don't use GFP_DMA The allocated buffers are used as a command payload, for which the block layer and/or DMA API do the proper bounce buffering if needed. Link: https://lore.kernel.org/r/20211222090311.916624-1-hch@lst.de Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit b4cc09492263e07bad4fc4bf34fed3246fa95057 Author: Xiang Chen Date: Mon Dec 20 19:21:38 2021 +0800 scsi: hisi_sas: Use autosuspend for the host controller The controller may frequently enter and exit suspend for each I/O which we need to deal with. This is inefficient and may cause too much suspend and resume activity for the controller. To avoid this, use a default 5s autosuspend for the controller to stop frequently suspending and resuming. This value may still be modified via sysfs interfaces. Link: https://lore.kernel.org/r/1639999298-244569-16-git-send-email-chenxiang66@hisilicon.com Acked-by: John Garry Signed-off-by: Xiang Chen Signed-off-by: Martin K. Petersen commit 307d9f49cce966c2ba969f58bd6227bc0092afaa Author: Xiang Chen Date: Mon Dec 20 19:21:37 2021 +0800 scsi: libsas: Keep host active while processing events Processing events such as PORTE_BROADCAST_RCVD may cause dependency issues for runtime power management support. Such a problem would be that handling a PORTE_BROADCAST_RCVD event requires that the host is resumed to send SMP commands. However, in resuming the host, the phyup events generated from re-enabling the phys are processed in the same workqueue as the original PORTE_BROADCAST_RCVD event. As such, the host will never finish resuming (as it waits for the phyup event processing), and then the PORTE_BROADCAST_RCVD event can't be processed as the SMP commands are blocked, and so we have a deadlock. Solve this problem by ensuring that libsas keeps the host active until completely finished phy or port events, such as PORTE_BYTES_DMAED. As such, we don't have to worry about resuming the host for processing individual SMP commands in this example. Link: https://lore.kernel.org/r/1639999298-244569-15-git-send-email-chenxiang66@hisilicon.com Reviewed-by: John Garry Signed-off-by: Xiang Chen Signed-off-by: Martin K. Petersen commit ae9b69e85eb7ecb32ddce7c04a10a3c69ad60e52 Author: Xiang Chen Date: Mon Dec 20 19:21:36 2021 +0800 scsi: hisi_sas: Keep controller active between ISR of phyup and the event being processed It is possible that controller may become suspended between processing a phyup interrupt and the event being processed by libsas. As such, we can't ensure the controller is active when processing the phyup event - this may cause the phyup event to be lost or other issues. To avoid any possible issues, add pm_runtime_get_noresume() in phyup interrupt handler and pm_runtime_put_sync() in the work handler exit to ensure that we stay always active. Since we only want to call pm_runtime_get_noresume() for v3 hw, signal this will a new event, HISI_PHYE_PHY_UP_PM. Link: https://lore.kernel.org/r/1639999298-244569-14-git-send-email-chenxiang66@hisilicon.com Acked-by: John Garry Signed-off-by: Xiang Chen Signed-off-by: Martin K. Petersen commit bf19aea4607cb5f4a652ab70d8d8035a72a6b8da Author: Xiang Chen Date: Mon Dec 20 19:21:35 2021 +0800 scsi: libsas: Defer works of new phys during suspend During the processing of event PORT_BYTES_DMAED, the driver queues work DISCE_DISCOVER_DOMAIN and then flushes workqueue ha->disco_q. If a new phyup event occurs during resuming the controller, the work PORTE_BYTES_DMAED of new phy occurs before suspended phy's. The work DISCE_DISCOVER_DOMAIN of new phy requires an active SAS controller (it needs to resume SAS controller by function scsi_sysfs_add_sdev() and some other functions such as function add_device_link()). However, the activation of the SAS controller requires completion of work PORTE_BYTES_DMAED of suspended phys while it is blocked by new phy's work on ha->event_q. So there is a deadlock and it is released only after resume timeout. To solve the issue, defer works of new phys during suspend and queue those defer works after SAS controller becomes active. Link: https://lore.kernel.org/r/1639999298-244569-13-git-send-email-chenxiang66@hisilicon.com Reviewed-by: John Garry Signed-off-by: Xiang Chen Signed-off-by: Martin K. Petersen commit 1bc35475c6bf6d078b3800e516978f37c1ecda36 Author: Xiang Chen Date: Mon Dec 20 19:21:34 2021 +0800 scsi: libsas: Refactor sas_queue_deferred_work() In the second part of function __sas_drain_work(), deferred work is queued. This functionality is required other places so factor it out into the function sas_queue_deferred_work(). Link: https://lore.kernel.org/r/1639999298-244569-12-git-send-email-chenxiang66@hisilicon.com Reviewed-by: John Garry Signed-off-by: Xiang Chen Signed-off-by: Martin K. Petersen commit 4ea775abbb5c50c26edbf043d5a2ae7fde407f4a Author: Xiang Chen Date: Mon Dec 20 19:21:33 2021 +0800 scsi: libsas: Add flag SAS_HA_RESUMING Add a flag SAS_HA_RESUMING and use it to indicate the state of resuming the host controller. Link: https://lore.kernel.org/r/1639999298-244569-11-git-send-email-chenxiang66@hisilicon.com Reviewed-by: John Garry Signed-off-by: Xiang Chen Signed-off-by: Martin K. Petersen commit 0da7ca4c4fd95d70d473dc07488ad94ba3ee9b82 Author: Xiang Chen Date: Mon Dec 20 19:21:32 2021 +0800 scsi: libsas: Resume host while sending SMP I/Os When sending SMP I/Os to the host we need to ensure that the host is not suspended and can process the commands. This is a better approach than replying on the host to resume itself to handle such commands. Use pm_runtime_get_sync() and pm_runtime_put_sync() calls for the host when executing SMP I/Os. Link: https://lore.kernel.org/r/1639999298-244569-10-git-send-email-chenxiang66@hisilicon.com Reviewed-by: John Garry Signed-off-by: Xiang Chen Signed-off-by: Martin K. Petersen commit 97f4100939844a6381ba61b99d6d2b1f2fccb79f Author: Xiang Chen Date: Mon Dec 20 19:21:31 2021 +0800 scsi: hisi_sas: Add more logs for runtime suspend/resume Add some logs at the beginning and end of suspend/resume. Link: https://lore.kernel.org/r/1639999298-244569-9-git-send-email-chenxiang66@hisilicon.com Acked-by: John Garry Signed-off-by: Xiang Chen Signed-off-by: Martin K. Petersen commit e31e18128eb9dbcda8c169cb33421ae4813afa71 Author: Xiang Chen Date: Mon Dec 20 19:21:30 2021 +0800 scsi: libsas: Insert PORTE_BROADCAST_RCVD event for resuming host If a new disk is inserted through an expander when the host was suspended, it will not necessarily be detected as the topology is not re-scanned during resume. To detect possible changes in topology during suspension, insert a PORTE_BROADCAST_RCVD event per port when resuming to trigger a revalidation. Link: https://lore.kernel.org/r/1639999298-244569-8-git-send-email-chenxiang66@hisilicon.com Reviewed-by: John Garry Signed-off-by: Xiang Chen Signed-off-by: Martin K. Petersen commit 133b688b2d03f7ae2a6c9d344f92c1949ec05a51 Author: Xiang Chen Date: Mon Dec 20 19:21:29 2021 +0800 scsi: mvsas: Add spin_lock/unlock() to protect asd_sas_port->phy_list phy_list_lock is not held when using asd_sas_port->phy_list in the mvsas driver. Add spin_lock/unlock in those places. Link: https://lore.kernel.org/r/1639999298-244569-7-git-send-email-chenxiang66@hisilicon.com Signed-off-by: Xiang Chen Signed-off-by: Martin K. Petersen commit 29e2bac87421c613782ccb510c76c5efbecac0cf Author: Xiang Chen Date: Mon Dec 20 19:21:28 2021 +0800 scsi: hisi_sas: Fix some issues related to asd_sas_port->phy_list Most places that use asd_sas_port->phy_list are protected by spinlock asd_sas_port->phy_list_lock, however there are still some places which miss grabbing the lock. Add it in function hisi_sas_refresh_port_id() when accessing asd_sas_port->phy_list. This carries a risk that list mutates while at the same time dropping the lock in function hisi_sas_send_ata_reset_each_phy(). Read asd_sas_port->phy_mask instead of accessing asd_sas_port->phy_list to avoid this risk. Link: https://lore.kernel.org/r/1639999298-244569-6-git-send-email-chenxiang66@hisilicon.com Acked-by: John Garry Signed-off-by: Xiang Chen Signed-off-by: Martin K. Petersen commit 42159d3c8d879e8d5fc225733f0cedc8baf19002 Author: Xiang Chen Date: Mon Dec 20 19:21:27 2021 +0800 scsi: libsas: Add spin_lock/unlock() to protect asd_sas_port->phy_list Most places that use asd_sas_port->phy_list in libsas are protected by spinlock asd_sas_port->phy_list_lock. However, there are still a few places which miss the lock. Add it in those places. Link: https://lore.kernel.org/r/1639999298-244569-5-git-send-email-chenxiang66@hisilicon.com Reviewed-by: John Garry Signed-off-by: Xiang Chen Signed-off-by: Martin K. Petersen commit 6e1fcab00a23f7fe9f4fe9704905a790efa1eeab Author: Alan Stern Date: Mon Dec 20 19:21:26 2021 +0800 scsi: block: pm: Always set request queue runtime active in blk_post_runtime_resume() John Garry reported a deadlock that occurs when trying to access a runtime-suspended SATA device. For obscure reasons, the rescan procedure causes the link to be hard-reset, which disconnects the device. The rescan tries to carry out a runtime resume when accessing the device. scsi_rescan_device() holds the SCSI device lock and won't release it until it can put commands onto the device's block queue. This can't happen until the queue is successfully runtime-resumed or the device is unregistered. But the runtime resume fails because the device is disconnected, and __scsi_remove_device() can't do the unregistration because it can't get the device lock. The best way to resolve this deadlock appears to be to allow the block queue to start running again even after an unsuccessful runtime resume. The idea is that the driver or the SCSI error handler will need to be able to use the queue to resolve the runtime resume failure. This patch removes the err argument to blk_post_runtime_resume() and makes the routine act as though the resume was successful always. This fixes the deadlock. Link: https://lore.kernel.org/r/1639999298-244569-4-git-send-email-chenxiang66@hisilicon.com Fixes: e27829dc92e5 ("scsi: serialize ->rescan against ->remove") Reported-and-tested-by: John Garry Reviewed-by: Bart Van Assche Signed-off-by: Alan Stern Signed-off-by: Xiang Chen Signed-off-by: Martin K. Petersen commit 6cc739087784160eff296c7fbd7a95b209f44ba5 Author: John Garry Date: Mon Dec 20 19:21:25 2021 +0800 scsi: Revert "scsi: hisi_sas: Filter out new PHY up events during suspend" This reverts commit b14a37e011d829404c29a5ae17849d7efb034893. In that commit, we had to filter out phy-up events during suspend, as it work cause a deadlock between processing the phyup event and the resume HA function try to drain the HA event workqueue to complete the resume process. Now that we no longer try to drain the HA event queue during the HA resume processor, the deadlock would not occur, so remove the special handling for it. Link: https://lore.kernel.org/r/1639999298-244569-3-git-send-email-chenxiang66@hisilicon.com Signed-off-by: John Garry Signed-off-by: Xiang Chen Signed-off-by: Martin K. Petersen commit fbefe22811c3140a686e407e114789ebf328a9a2 Author: John Garry Date: Mon Dec 20 19:21:24 2021 +0800 scsi: libsas: Don't always drain event workqueue for HA resume For the hisi_sas driver, if a directly attached disk is removed during suspend, a hang will occur in the resume process: The background is that in commit 16fd4a7c5917 ("scsi: hisi_sas: Add device link between SCSI devices and hisi_hba"), it is ensured that the HBA device cannot be runtime suspended when any SCSI device associated is active. Other drivers which use libsas don't worry about this as none support runtime suspend. The mentioned hang occurs when an disk is removed during suspend. In the removal process - from PHYE_RESUME_TIMEOUT event processing - we call into scsi_remove_device(), which is being processed in the HA event workqueue. Here we wait for all suppliers of the SCSI device to resume, which includes the HBA device (from the above commit). However the HBA device cannot resume, as it is waiting for the PHYE_RESUME_TIMEOUT to be processed (from calling sas_resume_ha() -> sas_drain_work()). This is the deadlock. There does not appear to be any need for the sas_drain_work() to be called at all in sas_resume_ha() as it is not syncing against anything, so allow LLDDs to avoid this by providing a variant of sas_resume_ha() which does "sync", i.e. doesn't drain the event workqueue. Link: https://lore.kernel.org/r/1639999298-244569-2-git-send-email-chenxiang66@hisilicon.com Signed-off-by: John Garry Signed-off-by: Xiang Chen Signed-off-by: Martin K. Petersen commit 236f0f4eac19c972687369124853aa817b5bdf85 Merge: 63b0951b6e590 760cceff99613 Author: Dave Airlie Date: Thu Dec 23 12:40:45 2021 +1000 Merge tag 'exynos-drm-next-for-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-next Four cleanups - Replacing lagacy gpio interface of dsi driver with gpiod one. - Implementing a generic GEM object mmap and use it instead of exynos specific one. - Dropping the use of label from dsi driver. Which also fixes a build warning. - Just trivial cleanup by dropping unnecessay code. Signed-off-by: Dave Airlie From: Inki Dae Link: https://patchwork.freedesktop.org/patch/msgid/20211222035345.26595-1-inki.dae@samsung.com commit 63b0951b6e590ddf0671d118804294e58b9e13da Merge: b06103b532536 d210919dbdc8a Author: Dave Airlie Date: Thu Dec 23 12:30:56 2021 +1000 Merge tag 'drm/tegra/for-5.17-rc1' of https://gitlab.freedesktop.org/drm/tegra into drm-next drm/tegra: Changes for v5.17-rc1 This contains a fairly large rework that makes the buffer objects behave more according to what the DMA-BUF infrastructure expects. A buffer object cache is implemented on top of that to make certain operations such as page-flipping more efficient by avoiding needless map/unmap operations. This in turn is useful to implement asynchronous commits to support legacy cursor updates. Another fairly big addition is the NVDEC driver. This uses the updated UABI introduced in v5.15-rc1 to provide access to the video decode engines found on Tegra210 and later. This also includes some power management improvements that are useful on older devices in particular because they, together with a bunch of other changes across the kernel, allow the system to scale down frequency and voltages when mostly idle and prevent these devices from becoming excessively hot. The remainder of these changes is an assortment of cleanups and minor fixes. Signed-off-by: Dave Airlie From: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20211217142912.558095-1-thierry.reding@gmail.com commit b06103b5325364e0b9944024db41b400b9028df9 Merge: 1c405ca11bf56 a342655865b2f Author: Dave Airlie Date: Thu Dec 23 11:55:28 2021 +1000 Merge tag 'amd-drm-next-5.17-2021-12-16' of https://gitlab.freedesktop.org/agd5f/linux into drm-next amdgpu: - Add some display debugfs entries - RAS fixes - SR-IOV fixes - W=1 fixes - Documentation fixes - IH timestamp fix - Misc power fixes - IP discovery fixes - Large driver documentation updates - Multi-GPU memory use reductions - Misc display fixes and cleanups - Add new SMU debug option amdkfd: - SVM fixes radeon: - Fix typo in comment From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20211216202731.5900-1-alexander.deucher@amd.com commit e087cba11677217bf100888bc679d3013abffa5e Merge: 5de24da1b3a5f bf0a8b9bf2c3e Author: Jakub Kicinski Date: Wed Dec 22 17:14:44 2021 -0800 Merge branch 'add-tests-for-vxlan-with-ipv6-underlay' Amit Cohen says: ==================== Add tests for VxLAN with IPv6 underlay mlxsw driver lately added support for VxLAN with IPv6 underlay. This set adds the relevant tests for IPv6, most of them are same to IPv4 tests with the required changes. Patch set overview: Patch #1 relaxes requirements for offloading TC filters that match on 802.1q fields. The following selftests make use of these newly-relaxed filters. Patch #2 adds preparation as part of selftests API, which will be used later. Patches #3-#4 add tests for VxLAN with bridge aware and unaware. Patche #5 cleans unused function. Patches #6-#7 add tests for VxLAN symmetric and asymmetric. Patch #8 adds test for Q-in-VNI. ==================== Link: https://lore.kernel.org/r/20211221144949.2527545-1-amcohen@nvidia.com Signed-off-by: Jakub Kicinski commit bf0a8b9bf2c3e36923982943b26919467c281199 Author: Amit Cohen Date: Tue Dec 21 16:49:49 2021 +0200 selftests: forwarding: Add Q-in-VNI test for IPv6 Add test to check Q-in-VNI traffic with IPv6 underlay and overlay. The test is similar to the existing IPv4 test. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Signed-off-by: Jakub Kicinski commit 6c6ea78a116164f6672e05554ec32bed1b195432 Author: Amit Cohen Date: Tue Dec 21 16:49:48 2021 +0200 selftests: forwarding: Add a test for VxLAN symmetric routing with IPv6 In a similar fashion to the asymmetric test, add a test for symmetric routing. In symmetric routing both the ingress and egress VTEPs perform routing in the overlay network into / from the VxLAN tunnel. Packets in different directions use the same VNI - the L3 VNI. Different tenants (VRFs) use different L3 VNIs. Add a test which is similar to the existing IPv4 test to check IPv6. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Signed-off-by: Jakub Kicinski commit 2902bae465c0aa718d18c72cceab95c7c2686afc Author: Amit Cohen Date: Tue Dec 21 16:49:47 2021 +0200 selftests: forwarding: Add a test for VxLAN asymmetric routing with IPv6 In asymmetric routing the ingress VTEP routes the packet into the correct VxLAN tunnel, whereas the egress VTEP only bridges the packet to the correct host. Therefore, packets in different directions use different VNIs - the target VNI. Add a test which is similar to the existing IPv4 test to check IPv6. The test uses a simple topology with two VTEPs and two VNIs and verifies that ping passes between hosts (local / remote) in the same VLAN (VNI) and in different VLANs belonging to the same tenant (VRF). While the test does not check VM mobility, it does configure an anycast gateway using a macvlan device on both VTEPs. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Signed-off-by: Jakub Kicinski commit dc498cdda0ce76527e276e504324de681482d48a Author: Amit Cohen Date: Tue Dec 21 16:49:46 2021 +0200 selftests: forwarding: vxlan_bridge_1q: Remove unused function Remove `vxlan_ping_test()` which is not used and probably was copied mistakenly from vxlan_bridge_1d.sh. This was found while adding an equivalent test for IPv6. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Signed-off-by: Jakub Kicinski commit 728b35259e28b6e85b6dbae9caf944548cebc9c6 Author: Amit Cohen Date: Tue Dec 21 16:49:45 2021 +0200 selftests: forwarding: Add VxLAN tests with a VLAN-aware bridge for IPv6 The tests are very similar to their VLAN-unaware counterpart (vxlan_bridge_1d_ipv6.sh and vxlan_bridge_1d_port_8472_ipv6.sh), but instead of using multiple VLAN-unaware bridges, a single VLAN-aware bridge is used with multiple VLANs. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Signed-off-by: Jakub Kicinski commit b07e9957f2207aa5965abe55578d6efb0d88460d Author: Amit Cohen Date: Tue Dec 21 16:49:44 2021 +0200 selftests: forwarding: Add VxLAN tests with a VLAN-unaware bridge for IPv6 Add tests similar to vxlan_bridge_1d.sh and vxlan_bridge_1d_port_8472.sh. The tests set up a topology with three VxLAN endpoints: one "local", possibly offloaded, and two "remote", formed using veth pairs and likely purely software bridges. The "local" endpoint is connected to host systems by a VLAN-unaware bridge. Since VxLAN tunnels must be unique per namespace, each of the "remote" endpoints is in its own namespace. H3 forms the bridge between the three domains. Send IPv4 packets and IPv6 packets with IPv6 underlay. Use `TC_FLAG`, which is defined in `forwarding.config` file, for TC checks. `TC_FLAG` allows testing that on HW datapath, the traffic actually goes through HW. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Signed-off-by: Jakub Kicinski commit 0cd0b1f7a6e4e9b3b3ce62d6130af60259e103cd Author: Amit Cohen Date: Tue Dec 21 16:49:43 2021 +0200 selftests: lib.sh: Add PING_COUNT to allow sending configurable amount of packets Currently `ping_do()` and `ping6_do()` send 10 packets. There are cases that it is not possible to catch only the interesting packets using tc rule, so then, it is possible to send many packets and verify that at least this amount of packets hit the rule. Add `PING_COUNT` variable, which is set to 10 by default, to allow tests sending more than 10 packets using the existing ping API. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Signed-off-by: Jakub Kicinski commit 70ec72d5b6c25822184f7adf9ec3ba207138e7ff Author: Amit Cohen Date: Tue Dec 21 16:49:42 2021 +0200 mlxsw: spectrum_flower: Make vlan_id limitation more specific Spectrum ASICs do not support matching of VLAN ID at egress. Currently, mlxsw driver forbids matching of all VLAN related fields at egress, which is too strict check. For example, the following filter is not supported by the driver: $ tc filter add dev swpX egress protocol 802.1q pref 1 handle 101 flower vlan_ethtype ipv4 src_ip .. dst_ip .. skip_sw action pass Error: mlxsw_spectrum: vlan_id key is not supported on egress. We have an error talking to the kernel The filter above does not match on VLAN ID, but is bounced anyway. Make the check more specific, forbid only matching of 'vlan_id' at egress. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Signed-off-by: Jakub Kicinski commit 5de24da1b3a5ffc121a36a7dfcebc76ef6b0d351 Merge: e6e5904455815 1f08917ab929a Author: Jakub Kicinski Date: Wed Dec 22 17:13:00 2021 -0800 Merge tag 'mlx5-updates-2021-12-21' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5-updates-2021-12-21 1) From Shay Drory: Devlink user knobs to control device's EQ size This series provides knobs which will enable users to minimize memory consumption of mlx5 Functions (PF/VF/SF). mlx5 exposes two new generic devlink params for EQ size configuration and uses devlink generic param max_macs. LINK: https://lore.kernel.org/netdev/20211208141722.13646-1-shayd@nvidia.com/ 2) From Tariq and Lama, allocate software channel objects and statistics of a mlx5 netdevice private data dynamically upon first demand to save on memory. * tag 'mlx5-updates-2021-12-21' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux: net/mlx5e: Take packet_merge params directly from the RX res struct net/mlx5e: Allocate per-channel stats dynamically at first usage net/mlx5e: Use dynamic per-channel allocations in stats net/mlx5e: Allow profile-specific limitation on max num of channels net/mlx5e: Save memory by using dynamic allocation in netdev priv net/mlx5e: Add profile indications for PTP and QOS HTB features net/mlx5e: Use bitmap field for profile features net/mlx5: Remove the repeated declaration net/mlx5: Let user configure max_macs generic param devlink: Clarifies max_macs generic devlink param net/mlx5: Let user configure event_eq_size param devlink: Add new "event_eq_size" generic device param net/mlx5: Let user configure io_eq_size param devlink: Add new "io_eq_size" generic device param ==================== Link: https://lore.kernel.org/r/20211222031604.14540-1-saeed@kernel.org Signed-off-by: Jakub Kicinski commit c42ba4290b2147aa033d17f22151494515655d77 Author: Florian Westphal Date: Fri Dec 17 15:10:55 2021 +0100 netfilter: flowtable: remove ipv4/ipv6 modules Just place the structs and registration in the inet module. nf_flow_table_ipv6, nf_flow_table_ipv4 and nf_flow_table_inet share same module dependencies: nf_flow_table, nf_tables. before: text data bss dec hex filename 2278 1480 0 3758 eae nf_flow_table_inet.ko 1159 1352 0 2511 9cf nf_flow_table_ipv6.ko 1154 1352 0 2506 9ca nf_flow_table_ipv4.ko after: 2369 1672 0 4041 fc9 nf_flow_table_inet.ko Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 878aed8db324bec64f3c3f956e64d5ae7375a5de Author: Florian Westphal Date: Fri Dec 17 11:29:57 2021 +0100 netfilter: nat: force port remap to prevent shadowing well-known ports If destination port is above 32k and source port below 16k assume this might cause 'port shadowing' where a 'new' inbound connection matches an existing one, e.g. inbound X:41234 -> Y:53 matches existing conntrack entry Z:53 -> X:4123, where Z got natted to X. In this case, new packet is natted to Z:53 which is likely unwanted. We avoid the rewrite for connections that originate from local host: port-shadowing is only possible with forwarded connections. Also adjust test case. v3: no need to call tuple_force_port_remap if already in random mode (Phil) Signed-off-by: Florian Westphal Acked-by: Phil Sutter Acked-by: Eric Garver Signed-off-by: Pablo Neira Ayuso commit 4a6fbdd801e882ee6ca5cdfdc3374f0ae263174c Author: Florian Westphal Date: Fri Dec 17 11:29:56 2021 +0100 netfilter: conntrack: tag conntracks picked up in local out hook This allows to identify flows that originate from local machine in a followup patch. It would be possible to make this a ->status bit instead. For now I did not do that yet because I don't have a use-case for exposing this info to userspace. If one comes up the toggle can be replaced with a status bit. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 023223dfbfb34fcc9b7dd41e21fbf9a5d5237989 Author: Pablo Neira Ayuso Date: Fri Dec 17 20:37:34 2021 +0100 netfilter: nf_tables: make counter support built-in Make counter support built-in to allow for direct call in case of CONFIG_RETPOLINE. Signed-off-by: Pablo Neira Ayuso commit 690d541739a36e23b0c81ab7c5a7d2a72dd22107 Author: Pablo Neira Ayuso Date: Fri Dec 10 00:11:45 2021 +0100 netfilter: nf_tables: replace WARN_ON by WARN_ON_ONCE for unknown verdicts Bug might trigger warning for each packet, call WARN_ON_ONCE instead. Signed-off-by: Pablo Neira Ayuso commit 4765473fefd4403b5eeca371637065b561522c50 Author: Pablo Neira Ayuso Date: Fri Dec 10 00:10:12 2021 +0100 netfilter: nf_tables: consolidate rule verdict trace call Add function to consolidate verdict tracing. Signed-off-by: Pablo Neira Ayuso commit 8801d791b48732acb3741cad06170fce880ed148 Author: Pablo Neira Ayuso Date: Fri Dec 10 00:09:49 2021 +0100 netfilter: nft_payload: WARN_ON_ONCE instead of BUG BUG() is too harsh for unknown payload base, use WARN_ON_ONCE() instead. Signed-off-by: Pablo Neira Ayuso commit 0d1873a52289f7214e7e70d2d0552b617582269a Author: Pablo Neira Ayuso Date: Fri Dec 10 00:06:44 2021 +0100 netfilter: nf_tables: remove rcu read-size lock Chain stats are updated from the Netfilter hook path which already run under rcu read-size lock section. Signed-off-by: Pablo Neira Ayuso commit a16c7246368db8935652c805bc446928d0e1c0aa Author: Keith Busch Date: Wed Dec 22 13:52:39 2021 -0800 block: remove unnecessary trailing '\' While harmless, the blank line is certainly not intended to be part of the rq_list_for_each() macro. Remove it. Signed-off-by: Keith Busch Link: https://lore.kernel.org/r/20211222215239.1768164-1-kbusch@kernel.org Signed-off-by: Jens Axboe commit 6fd3c510ee4b37f2f9fe3d3cafbfa459e15c5e11 Author: Randy Dunlap Date: Wed Dec 22 13:15:32 2021 -0800 bio.h: fix kernel-doc warnings Fix all kernel-doc warnings in : include/linux/bio.h:136: warning: Function parameter or member 'nbytes' not described in 'bio_advance' include/linux/bio.h:136: warning: Excess function parameter 'bytes' description in 'bio_advance' include/linux/bio.h:391: warning: No description found for return value of 'bio_next_split' Signed-off-by: Randy Dunlap Cc: Kent Overstreet Cc: Jens Axboe Cc: linux-block@vger.kernel.org Link: https://lore.kernel.org/r/20211222211532.24060-1-rdunlap@infradead.org Signed-off-by: Jens Axboe commit 8b0c59c622dc4dab970ec63264fb5b152944ac80 Author: Arnd Bergmann Date: Thu Dec 23 00:17:17 2021 +0100 Revert "ARM: dts: BCM5301X: define RTL8365MB switch on Asus RT-AC88U" This reverts commit 3d2d52a0d1835b56f6bd67d268f6c39df0e41692, it caused a build regression: arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts:109.4-14: Warning (reg_format): /switch/ports:reg: property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1) arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dtb: Warning (pci_device_reg): Failed prerequisite 'reg_format' arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dtb: Warning (pci_device_bus_num): Failed prerequisite 'reg_format' arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dtb: Warning (i2c_bus_reg): Failed prerequisite 'reg_format' arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dtb: Warning (spi_bus_reg): Failed prerequisite 'reg_format' arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts:106.9-149.5: Warning (avoid_default_addr_size): /switch/ports: Relying on default #address-cells value arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts:106.9-149.5: Warning (avoid_default_addr_size): /switch/ports: Relying on default #size-cells value Reported-by: Stephen Rothwell Signed-off-by: Arnd Bergmann commit e6e5904455815626b711c7d48cacd253f4d72f84 Author: Jakub Kicinski Date: Tue Dec 21 11:39:41 2021 -0800 codel: remove unnecessary pkt_sched.h include Commit d068ca2ae2e6 ("codel: split into multiple files") moved all Qdisc-related code to codel_qdisc.h, move the include of pkt_sched.h as well. This is similar to the previous commit, although we don't care as much about incremental builds after pkt_sched.h was touched itself it is included by net/sch_generic.h which is modified ~20 times a year. This decreases the incremental build size after touching pkt_sched.h from 1592 to 617 objects. Fix unmasked missing includes in WiFi drivers. Acked-by: Kalle Valo Link: https://lore.kernel.org/r/20211221193941.3805147-2-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 15fcb1031178f2a42425c2993b2ec7bb894c04d6 Author: Jakub Kicinski Date: Tue Dec 21 11:39:40 2021 -0800 codel: remove unnecessary sock.h include Since sock.h is modified relatively often (60 times in the last 12 months) it seems worthwhile to decrease the incremental build work. CoDel's header includes net/inet_ecn.h which in turn includes net/sock.h. codel.h is itself included by mac80211 which is included by much of the WiFi stack and drivers. Removing the net/inet_ecn.h include from CoDel breaks the dependecy between WiFi and sock.h. Commit d068ca2ae2e6 ("codel: split into multiple files") moved all the code which actually needs ECN helpers out to net/codel_impl.h, the include can be moved there as well. This decreases the incremental build size after touching sock.h from 4999 objects to 4051 objects. Fix unmasked missing includes in WiFi drivers. Acked-by: Kalle Valo Link: https://lore.kernel.org/r/20211221193941.3805147-1-kuba@kernel.org Signed-off-by: Jakub Kicinski commit 62a3106697f3c6f9af64a2cd0f9ff58552010dc8 Author: Colin Ian King Date: Wed Dec 22 00:39:37 2021 +0000 net: broadcom: bcm4908enet: remove redundant variable bytes The variable bytes is being used to summate slot lengths, however the value is never used afterwards. The summation is redundant so remove variable bytes. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20211222003937.727325-1-colin.i.king@gmail.com Signed-off-by: Jakub Kicinski commit 0092db5fac2284c1906072141b017eba6afe02c5 Author: Jesse Brandeburg Date: Tue Dec 21 15:05:38 2021 -0800 ice: trivial: fix odd indenting Fix an odd indent where some code was left indented, and causes smatch to warn: ice_log_pkg_init() warn: inconsistent indenting While here, for consistency, add a break after the default case. This commit has a Fixes: but we caught this while it was only in net-next. Fixes: 247dd97d713c ("ice: Refactor status flow for DDP load") Signed-off-by: Jesse Brandeburg Link: https://lore.kernel.org/r/20211221230538.2546315-1-jesse.brandeburg@intel.com Signed-off-by: Jakub Kicinski commit 00580f03af5eb2a527875b4a80a5effd95bda2fa Author: Eric W. Biederman Date: Wed Dec 22 16:57:50 2021 -0600 kthread: Never put_user the set_child_tid address Kernel threads abuse set_child_tid. Historically that has been fine as set_child_tid was initialized after the kernel thread had been forked. Unfortunately storing struct kthread in set_child_tid after the thread is running makes struct kthread being unusable for storing result codes of the thread. When set_child_tid is set to struct kthread during fork that results in schedule_tail writing the thread id to the beggining of struct kthread (if put_user does not realize it is a kernel address). Solve this by skipping the put_user for all kthreads. Reported-by: Nathan Chancellor Link: https://lkml.kernel.org/r/YcNsG0Lp94V13whH@archlinux-ax161 Signed-off-by: "Eric W. Biederman" commit 2030eddced0ad5ee076bea370cf8714481d1f316 Merge: f4f2970dfd87e 13a64f0b98948 Author: Jakub Kicinski Date: Wed Dec 22 14:25:41 2021 -0800 Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== 100GbE Intel Wired LAN Driver Updates 2021-12-21 This series contains updates to ice driver only. Karol modifies the reset flow to correct issues with PTP reset. Jake extends PTP support for E822 based devices. This includes a few cleanup patches, that fix some minor issues. In addition, there are some slight refactors to ease the addition of E822 support, followed by adding the new hardware implementation ice_ptp_hw.c. There are a few major differences with E822 support compared to E810 support: *) The E822 device has a Clock Generation Unit which must be initialized in order to generate proper clock frequencies on the output that drives the PTP hardware clock registers *) The E822 PHY is a bit different and requires a more complex initialization procedure which must be rerun any time the link configuration changes. *) The E822 devices support enhanced timestamp calibration by making use of a process called Vernier offset measurement. This allows the hardware to measure phase offset related to the PHY clocks for Serdes and FEC, reducing the inaccuracy of the timestamp relative to the actual packet transmission and receipt. Making use of this requires data gathered from the first transmitted and received packets, and waiting for the PHY to complete the calibration measurements. This is done as part of a new kthread, ov_work. Note that to avoid delay in enabling timestamps, we start the PHY in 'bypass' mode which allows timestamps to be captured without the Vernier calibration measurement. Once the first packets have been sent and received, we then complete the calibration setup and exit bypass mode and begin using the more precise timestamps. According to the datasheet, timestamps without calibration data can be incorrect relative to actual receipt or transmission by up to 1 clock cycle (~1.25 nanoseconds), while calibrated timestamps should be correct to within 1/8th of a clock cycle (~0.15 nanoseconds). *) E822 devices support crosstimestamping via PCIe PTM, which we enable when available on the platform. There is a fair amount of logic required to perform PHY and CGU initialization, which is the vast majority of the new code, but it is fairly self contained within ice_ptp_hw.c, with the exception of monitoring for offset validity being handled by a kthread. * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue: ice: support crosstimestamping on E822 devices if supported ice: exit bypass mode once hardware finishes timestamp calibration ice: ensure the hardware Clock Generation Unit is configured ice: implement basic E822 PTP support ice: convert clk_freq capability into time_ref ice: introduce ice_ptp_init_phc function ice: use 'int err' instead of 'int status' in ice_ptp_hw.c ice: PTP: move setting of tstamp_config ice: introduce ice_base_incval function ice: Fix E810 PTP reset flow ==================== Link: https://lore.kernel.org/r/20211221174845.3063640-1-anthony.l.nguyen@intel.com Acked-by: Richard Cochran Signed-off-by: Jakub Kicinski commit f8d92a66e810acbef6ddbc0bd0cbd9b117ce8acd Author: Darrick J. Wong Date: Wed Dec 15 11:53:15 2021 -0800 xfs: prevent UAF in xfs_log_item_in_current_chkpt While I was running with KASAN and lockdep enabled, I stumbled upon an KASAN report about a UAF to a freed CIL checkpoint. Looking at the comment for xfs_log_item_in_current_chkpt, it seems pretty obvious to me that the original patch to xfs_defer_finish_noroll should have done something to lock the CIL to prevent it from switching the CIL contexts while the predicate runs. For upper level code that needs to know if a given log item is new enough not to need relogging, add a new wrapper that takes the CIL context lock long enough to sample the current CIL context. This is kind of racy in that the CIL can switch the contexts immediately after sampling, but that's ok because the consequence is that the defer ops code is a little slow to relog items. ================================================================== BUG: KASAN: use-after-free in xfs_log_item_in_current_chkpt+0x139/0x160 [xfs] Read of size 8 at addr ffff88804ea5f608 by task fsstress/527999 CPU: 1 PID: 527999 Comm: fsstress Tainted: G D 5.16.0-rc4-xfsx #rc4 Call Trace: dump_stack_lvl+0x45/0x59 print_address_description.constprop.0+0x1f/0x140 kasan_report.cold+0x83/0xdf xfs_log_item_in_current_chkpt+0x139/0x160 xfs_defer_finish_noroll+0x3bb/0x1e30 __xfs_trans_commit+0x6c8/0xcf0 xfs_reflink_remap_extent+0x66f/0x10e0 xfs_reflink_remap_blocks+0x2dd/0xa90 xfs_file_remap_range+0x27b/0xc30 vfs_dedupe_file_range_one+0x368/0x420 vfs_dedupe_file_range+0x37c/0x5d0 do_vfs_ioctl+0x308/0x1260 __x64_sys_ioctl+0xa1/0x170 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f2c71a2950b Code: 0f 1e fa 48 8b 05 85 39 0d 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 55 39 0d 00 f7 d8 64 89 01 48 RSP: 002b:00007ffe8c0e03c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00005600862a8740 RCX: 00007f2c71a2950b RDX: 00005600862a7be0 RSI: 00000000c0189436 RDI: 0000000000000004 RBP: 000000000000000b R08: 0000000000000027 R09: 0000000000000003 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000000005a R13: 00005600862804a8 R14: 0000000000016000 R15: 00005600862a8a20 Allocated by task 464064: kasan_save_stack+0x1e/0x50 __kasan_kmalloc+0x81/0xa0 kmem_alloc+0xcd/0x2c0 [xfs] xlog_cil_ctx_alloc+0x17/0x1e0 [xfs] xlog_cil_push_work+0x141/0x13d0 [xfs] process_one_work+0x7f6/0x1380 worker_thread+0x59d/0x1040 kthread+0x3b0/0x490 ret_from_fork+0x1f/0x30 Freed by task 51: kasan_save_stack+0x1e/0x50 kasan_set_track+0x21/0x30 kasan_set_free_info+0x20/0x30 __kasan_slab_free+0xed/0x130 slab_free_freelist_hook+0x7f/0x160 kfree+0xde/0x340 xlog_cil_committed+0xbfd/0xfe0 [xfs] xlog_cil_process_committed+0x103/0x1c0 [xfs] xlog_state_do_callback+0x45d/0xbd0 [xfs] xlog_ioend_work+0x116/0x1c0 [xfs] process_one_work+0x7f6/0x1380 worker_thread+0x59d/0x1040 kthread+0x3b0/0x490 ret_from_fork+0x1f/0x30 Last potentially related work creation: kasan_save_stack+0x1e/0x50 __kasan_record_aux_stack+0xb7/0xc0 insert_work+0x48/0x2e0 __queue_work+0x4e7/0xda0 queue_work_on+0x69/0x80 xlog_cil_push_now.isra.0+0x16b/0x210 [xfs] xlog_cil_force_seq+0x1b7/0x850 [xfs] xfs_log_force_seq+0x1c7/0x670 [xfs] xfs_file_fsync+0x7c1/0xa60 [xfs] __x64_sys_fsync+0x52/0x80 do_syscall_64+0x35/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff88804ea5f600 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 8 bytes inside of 256-byte region [ffff88804ea5f600, ffff88804ea5f700) The buggy address belongs to the page: page:ffffea00013a9780 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88804ea5ea00 pfn:0x4ea5e head:ffffea00013a9780 order:1 compound_mapcount:0 flags: 0x4fff80000010200(slab|head|node=1|zone=1|lastcpupid=0xfff) raw: 04fff80000010200 ffffea0001245908 ffffea00011bd388 ffff888004c42b40 raw: ffff88804ea5ea00 0000000000100009 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88804ea5f500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88804ea5f580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88804ea5f600: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88804ea5f680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88804ea5f700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== Fixes: 4e919af7827a ("xfs: periodically relog deferred intent items") Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit cfb4c313be670fd4bd09650216620fa4514cdb93 Author: Luiz Augusto von Dentz Date: Wed Dec 22 12:22:01 2021 -0800 Bluetooth: vhci: Set HCI_QUIRK_VALID_LE_STATES This set HCI_QUIRK_VALID_LE_STATES quirk which is required for the likes of experimental LE simultaneous roles. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 76d0685bbac8ae017e5d12eba25fb3c4f0ec77ac Author: Luiz Augusto von Dentz Date: Wed Dec 22 12:22:00 2021 -0800 Bluetooth: MGMT: Fix LE simultaneous roles UUID if not supported If controller/driver don't support LE simultaneous roles its UUID shall be omitted when responding to MGMT_OP_READ_EXP_FEATURES_INFO. This also rework the support introducing HCI_LE_SIMULTANEOUS_ROLES flag so it can be detected when userspace wants to use or not. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 4fc9857ab8c6cfe2152df3288c8cf3300b929f1a Author: Luiz Augusto von Dentz Date: Wed Dec 22 12:21:59 2021 -0800 Bluetooth: hci_sync: Add check simultaneous roles support This attempts to check if the controller can act as both central and peripheral simultaneously and in case it does skip suspending advertising or in case of directed advertising don't fail if scanning. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 6cd29ec6ae5e3694b779e02da9f3e50ae4398b59 Author: Luiz Augusto von Dentz Date: Wed Dec 22 12:21:58 2021 -0800 Bluetooth: hci_sync: Wait for proper events when connecting LE When using HCI_OP_LE_CREATE_CONN wait for HCI_EV_LE_CONN_COMPLETE before completing it and for HCI_OP_LE_EXT_CREATE_CONN wait for HCI_EV_LE_ENHANCED_CONN_COMPLETE before resuming advertising. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 85b56857e194635b772be8af1c7650535d5d112a Author: Luiz Augusto von Dentz Date: Wed Dec 22 12:21:57 2021 -0800 Bluetooth: hci_sync: Add support for waiting specific LE subevents This adds support for waiting for specific LE subevents instead of command status which may only indicate that the commands is in progress and a different event is used to complete the operation. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 8e8b92ee60de5341e9db83c11f75a525e555e2b3 Author: Luiz Augusto von Dentz Date: Wed Dec 22 12:21:56 2021 -0800 Bluetooth: hci_sync: Add hci_le_create_conn_sync This adds hci_le_create_conn_sync and make hci_le_connect use it instead of queueing multiple commands which may conflict with the likes of hci_update_passive_scan which uses hci_cmd_sync_queue. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit fee645033e2c57fdbd8bace4d5ddc2b18bc4032a Author: Luiz Augusto von Dentz Date: Mon Dec 13 13:38:57 2021 -0800 Bluetooth: hci_event: Use skb_pull_data when processing inquiry results This makes each result entry to be checked using skb_pull_data instead of acessing them by index. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 744451c162a514044a912cbbd64b7a386035cc5b Author: Benjamin Berg Date: Fri Dec 17 16:28:09 2021 +0100 Bluetooth: hci_sync: Push sync command cancellation to workqueue syzbot reported that hci_cmd_sync_cancel may sleep from the wrong context. To avoid this, create a new work item that pushes the relevant parts into a different context. Note that we keep the old implementation with the name __hci_cmd_sync_cancel as the sleeping behaviour is desired in some cases. Reported-and-tested-by: syzbot+485cc00ea7cf41dfdbf1@syzkaller.appspotmail.com Fixes: c97a747efc93 ("Bluetooth: btusb: Cancel sync commands for certain URB errors") Signed-off-by: Benjamin Berg Signed-off-by: Marcel Holtmann commit df1e5c51492fd93ffc293acdcc6f00698d19fedc Author: Panicker Harish Date: Wed Dec 22 12:59:05 2021 +0530 Bluetooth: hci_qca: Stop IBS timer during BT OFF The IBS timers are not stopped properly once BT OFF is triggered. we could see IBS commands being sent along with version command, so stopped IBS timers while Bluetooth is off. Fixes: 3e4be65eb82c ("Bluetooth: hci_qca: Add poweroff support during hci down for wcn3990") Signed-off-by: Panicker Harish Signed-off-by: Marcel Holtmann commit 6932627425d6d3849aecd43c02158a5312895ad4 Author: Aaron Ma Date: Fri Dec 17 17:51:50 2021 +0800 Bluetooth: btusb: Add support for Foxconn MT7922A Add 2 USB IDs for MT7922A chip. These 2 devices got the same description. T: Bus=01 Lev=01 Prnt=01 Port=02 Cnt=01 Dev#= 2 Spd=480 MxCh= 0 D: Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=0489 ProdID=e0d8 Rev= 1.00 T: Bus=03 Lev=01 Prnt=01 Port=02 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=e0d9 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 db0dd9cee82270e032123169ceff659eced5115d Author: Vincent Whitchurch Date: Tue Dec 21 10:04:46 2021 +0100 um: virtio_uml: Allow probing from devicetree Allow the virtio_uml device to be probed from the devicetree so that sub-devices can be specified using the standard virtio bindings, for example: virtio@1 { compatible = "virtio,uml"; socket-path = "i2c.sock"; virtio-device-id = <0x22>; i2c-controller { compatible = "virtio,device22"; #address-cells = <0x01>; #size-cells = <0x00>; light-sensor@01 { compatible = "ti,opt3001"; reg = <0x01>; }; }; }; Signed-off-by: Vincent Whitchurch Signed-off-by: Richard Weinberger commit b31297f04e86e4115ece79ca530d8ae1c454db75 Author: Vincent Whitchurch Date: Wed Dec 8 16:11:23 2021 +0100 um: Add devicetree support Add a dtb= option to boot UML with a devicetree blob. This can be used for testing driver code using UML. Signed-off-by: Vincent Whitchurch [rw: Add dependency on CONFIG_OF] Signed-off-by: Richard Weinberger commit 361640b4fdc86167b0c25d8e73c08dcaa4ecd28a Author: Vincent Whitchurch Date: Wed Dec 8 16:11:22 2021 +0100 um: Extract load file helper from initrd.c The file loading support in initrd.c can be re-used for loading devicetrees. Move it out of initrd.c. Signed-off-by: Vincent Whitchurch Signed-off-by: Richard Weinberger commit 4d5cff69fbddbbefef2903faa48263cc5d3ca382 Author: Christoph Hellwig Date: Wed Dec 15 17:56:11 2021 +0100 x86/mtrr: Remove the mtrr_bp_init() stub Add an IS_ENABLED() check in setup_arch() and call pat_disable() directly if MTRRs are not supported. This allows to remove the include in , which pull in lowlevel x86 headers that should not be included for UML builds and will cause build warnings with a following patch. Signed-off-by: Christoph Hellwig Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20211215165612.554426-2-hch@lst.de commit 5da8b49de472c1da8658466d4f63ef8d9251a819 Author: Thierry Reding Date: Mon Dec 20 13:51:47 2021 +0100 dt-bindings: display: bridge: lvds-codec: Fix duplicate key In order to validate multiple "if" conditionals, they must be part of an "allOf:" list, otherwise they will cause a failure in parsing the schema because of the duplicated "if" property. Fixes: d7df3948eb49 ("dt-bindings: display: bridge: lvds-codec: Document pixel data sampling edge select") Signed-off-by: Thierry Reding Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211220125147.519880-1-thierry.reding@gmail.com commit d430dffbe9dd30759f3c64b65bf85b0245c8d8ab Author: Lorenzo Bianconi Date: Tue Dec 21 14:57:09 2021 +0100 mt76: mt7921: fix a possible race enabling/disabling runtime-pm Fix a possible race enabling/disabling runtime-pm between mt7921_pm_set() and mt7921_poll_rx() since mt7921_pm_wake_work() always schedules rx-napi callback and it will trigger mt7921_pm_power_save_work routine putting chip to in low-power state during mt7921_pm_set processing. Suggested-by: Deren Wu Tested-by: Deren Wu Fixes: 1d8efc741df8 ("mt76: mt7921: introduce Runtime PM support") Signed-off-by: Lorenzo Bianconi Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/0f3e075a2033dc05f09dab4059e5be8cbdccc239.1640094847.git.lorenzo@kernel.org commit f31ee3c0a5552f80cce12f11594df360adf302e0 Author: David Mosberger-Tang Date: Tue Dec 21 21:25:34 2021 +0000 wilc1000: Document enable-gpios and reset-gpios properties Add documentation for the ENABLE and RESET GPIOs that may be needed by wilc1000-spi. Signed-off-by: David Mosberger-Tang Reviewed-by: Rob Herring Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211221212531.4011609-3-davidm@egauge.net commit ec031ac4792c72d9e925313366df8064e092f685 Author: David Mosberger-Tang Date: Tue Dec 21 21:25:34 2021 +0000 wilc1000: Add reset/enable GPIO support to SPI driver For the SDIO driver, the RESET/ENABLE pins of WILC1000 are controlled through the SDIO power sequence driver. This commit adds analogous support for the SPI driver. Specifically, during initialization, the chip will be ENABLEd and taken out of RESET and during deinitialization, the chip will be placed back into RESET and disabled (both to reduce power consumption and to ensure the WiFi radio is off). Both RESET and ENABLE GPIOs are optional. However, if the ENABLE GPIO is specified, then the RESET GPIO should normally also be specified as otherwise there is no way to ensure proper timing of the ENABLE/RESET sequence. Signed-off-by: David Mosberger-Tang Reviewed-by: Claudiu Beznea Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211221212531.4011609-2-davidm@egauge.net commit 4d2cd7b06ce0d539b70619f7662fa67508d9008a Author: David Mosberger-Tang Date: Tue Dec 21 21:05:41 2021 +0000 wilc1000: Convert static "chipid" variable to device-local variable Move "chipid" variable into the per-driver structure so the code doesn't break if more than one wilc1000 module is present. Signed-off-by: David Mosberger-Tang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211221210538.4011227-1-davidm@egauge.net commit 5f48d7bbec3775c9388c91c6920a64076f7ae339 Author: Chung-Hsuan Hung Date: Tue Dec 21 10:48:00 2021 +0800 rtw89: 8852a: correct bit definition of dfs_en Since there are other protections in the set channel flow, fortunately old wrong setting won't affect the performance. Signed-off-by: Chung-Hsuan Hung Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211221024800.23814-1-pkshih@realtek.com commit 5d5d68bcff1f7ff27ba0b938a4df5849849b47e3 Author: Chin-Yen Lee Date: Tue Dec 21 10:02:30 2021 +0800 rtw88: don't consider deep PS mode when transmitting packet In original flow, driver needs to ensure chip leave deep ps mode before transmitting any packet, and don't enter deep ps mode beofre PCIE DMA is finished. Now with the support of 8822ce's hardware setting and firmware after v9.9.11, these limits are removed. Signed-off-by: Chin-Yen Lee Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211221020230.20764-1-pkshih@realtek.com commit 68b930ad46b6615a3ef3fb05ac229a7b17df6c9c Merge: 8704d0befb593 71c748b5e01e3 Author: Kalle Valo Date: Wed Dec 22 19:46:02 2021 +0200 Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath.git patches for v5.17. Major changes: ath11k * qca6390/wcn6855: report signal and tx bitrate * qca6390: rfkill support * qca6390/wcn6855: regdb.bin support ath5k * switch to rate table based lookup commit 71c748b5e01e3e28838a8e26a8966fb5adb03df7 Author: Baochen Qiang Date: Wed Dec 22 09:35:35 2021 +0800 ath11k: Fix unexpected return buffer manager error for QCA6390 We are seeing below error on QCA6390: ... [70211.671189] ath11k_pci 0000:72:00.0: failed to parse rx error in wbm_rel ring desc -22 [70212.696154] ath11k_pci 0000:72:00.0: failed to parse rx error in wbm_rel ring desc -22 [70213.092941] ath11k_pci 0000:72:00.0: failed to parse rx error in wbm_rel ring desc -22 ... The reason is that, with commit 734223d78428 ("ath11k: change return buffer manager for QCA6390"), ath11k expects the return buffer manager (RBM) field of descriptor configured as HAL_RX_BUF_RBM_SW1_BM when parsing error frames from WBM2SW3_RELEASE ring. This is a wrong change cause the RBM field is set as HAL_RX_BUF_RBM_SW3_BM. The same issue also applies to REO2TCL ring though we have not got any error reported. Fix it by changing RBM from HAL_RX_BUF_RBM_SW1_BM to HAL_RX_BUF_RBM_SW3_BM for these two rings. Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Fixes: 734223d78428 ("ath11k: change return buffer manager for QCA6390") Signed-off-by: Baochen Qiang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211222013536.582527-1-quic_bqiang@quicinc.com commit 50a4606655582f310b3f07c9492af9a72b40003b Author: Rafael J. Wysocki Date: Fri Dec 17 20:16:02 2021 +0100 PM: runtime: Simplify locking in pm_runtime_put_suppliers() Notice that pm_runtime_put_suppliers() cannot be called with disabled interrupts, because it may sleep (due to the device links read locking in the non-SRCU case), and so it can use spin_lock_irq() and spin_unlock_irq() for the locking. Update the function accordingly and while at it move the "put" local variable in it into the inner block where it is used. This change is not expected to have any visible functional impact. Signed-off-by: Rafael J. Wysocki Reviewed-by: Ulf Hansson commit e4719b52b144d90923fcd6a276b84a28308f7322 Merge: 544e737dea5ad 2cdbd92c2d1df Author: Rafael J. Wysocki Date: Wed Dec 22 18:37:12 2021 +0100 Merge back PM core changes for v5.17. commit dfeeedc1bf5772226bddf51ed3f853e5a6707bf1 Author: Rafael J. Wysocki Date: Fri Dec 17 20:06:08 2021 +0100 cpufreq: intel_pstate: Update cpuinfo.max_freq on HWP_CAP changes With HWP enabled, when the turbo range of performance levels is disabled by the platform firmware, the CPU capacity is given by the "guaranteed performance" field in MSR_HWP_CAPABILITIES which is generally dynamic. When it changes, the kernel receives an HWP notification interrupt handled by notify_hwp_interrupt(). When the "guaranteed performance" value changes in the above configuration, the CPU performance scaling needs to be adjusted so as to use the new CPU capacity in computations, which means that the cpuinfo.max_freq value needs to be updated for that CPU. Accordingly, modify intel_pstate_notify_work() to read MSR_HWP_CAPABILITIES and update cpuinfo.max_freq to reflect the new configuration (this update can be carried out even if the configuration doesn't actually change, because it simply doesn't matter then and it takes less time to update it than to do extra checks to decide whether or not a change has really occurred). Reported-by: Srinivas Pandruvada Tested-by: Srinivas Pandruvada Signed-off-by: Rafael J. Wysocki commit 1a901c914dfbee04f20200a116dc9d30679c8cc6 Author: Andy Shevchenko Date: Wed Dec 22 16:04:45 2021 +0200 ACPI: CPPC: Amend documentation in the comments Currently it's too hard to read the _CPC structure as it's commented. Reshuffle indentation and style to make it readable. Signed-off-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit 3a571fc19673bc00c36b2cd8a2b9811c013115d7 Author: Andy Shevchenko Date: Tue Dec 21 15:32:15 2021 +0200 software node: Update MAINTAINERS data base There are two updates to the MAINTAINERS regarding to software node API: - add Daniel Scally to be designated reviewer - add Sakari Ailus to be designated reviewer - add rather tightly related device property files to the list - due to above adjust section name accordingly Signed-off-by: Andy Shevchenko Acked-by: Heikki Krogerus Acked-by: Daniel Scally Acked-by: Sakari Ailus Signed-off-by: Rafael J. Wysocki commit c5fc5ba8b6b7bebc05e45036a33405b4c5036c2f Author: Clément Léger Date: Mon Dec 20 22:05:33 2021 +0100 software node: fix wrong node passed to find nargs_prop nargs_prop refers to a property located in the reference that is found within the nargs property. Use the correct reference node in call to property_entry_read_int_array() to retrieve the correct nargs value. Fixes: b06184acf751 ("software node: Add software_node_get_reference_args()") Signed-off-by: Clément Léger Reviewed-by: Sakari Ailus Reviewed-by: Daniel Scally Acked-by: Heikki Krogerus Signed-off-by: Rafael J. Wysocki commit 8bb227ac34c062b466a0d5fd21f060010375880b Author: Christoph Hellwig Date: Wed Dec 15 17:56:12 2021 +0100 um: remove set_fs Remove address space overrides using set_fs() for User Mode Linux. Note that just like the existing kernel access case of the uaccess routines the new nofault kernel handlers do not actually have any exception handling. This is probably broken, but not change to the status quo. Signed-off-by: Christoph Hellwig Signed-off-by: Richard Weinberger commit d8db5d8a012b04d594d23eeca5430fb9298ea471 Merge: 862d7e5434154 45cd8bbaaa18a Author: Arnd Bergmann Date: Wed Dec 22 17:29:44 2021 +0100 Merge tag 'aspeed-5.17-devicetree' of git://git.kernel.org/pub/scm/linux/kernel/git/joel/bmc into arm/dt ASPEED device tree updates for 5.17 - New machines: * TYAN S8036 AST2500 BMC * Facebook Bletchley AST2600 BMC * Yadro VEGMAN series of AST2500 BMC for x86 servers - LPC clock additions, to fix long standing missed irq on boot issue - Secure boot controller description for AST2600 - Alternate chip flash layout, used by Bytedance's G220A - Various additions to Rainier, Everest, S7106 * tag 'aspeed-5.17-devicetree' of git://git.kernel.org/pub/scm/linux/kernel/git/joel/bmc: ARM: dts: aspeed: add LCLK setting into LPC KCS nodes dt-bindings: ipmi: bt-bmc: add 'clocks' as a required property ARM: dts: aspeed: add LCLK setting into LPC IBT node ARM: dts: aspeed: p10: Add TPM device ARM: dts: aspeed: p10: Enable USB host ports ARM: dts: aspeed: Add TYAN S8036 BMC machine ARM: dts: aspeed: tyan-s7106: Add uart_routing and fix vuart config ARM: dts: aspeed: Adding Facebook Bletchley BMC ARM: dts: aspeed: g220a: Enable secondary flash ARM: dts: Add openbmc-flash-layout-64-alt.dtsi ARM: dts: aspeed: Add secure boot controller node dt-bindings: aspeed: Add Secure Boot Controller bindings ARM: dts: aspeed: add device tree for YADRO VEGMAN BMC dt-bindings: vendor-prefixes: add YADRO ARM: dts: aspeed: mtjade: Add uefi partition ARM: dts: aspeed: mtjade: Add I2C buses for NVMe devices ARM: dts: aspeed: tyan-s7106: Update nct7802 config Signed-off-by: Arnd Bergmann commit ecb78b290bb56ccc835cf3fdc2dbcaaa610b65a6 Author: Lad Prabhakar Date: Tue Dec 21 21:26:09 2021 +0000 mtd: rawnand: gpmi: Use platform_get_irq_byname() to get the interrupt platform_get_resource_byname(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq_byname(). Signed-off-by: Lad Prabhakar Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20211221212609.31290-3-prabhakar.mahadev-lad.rj@bp.renesas.com commit 3b2af5c6174c821134eb62f69f830bdb96662187 Author: Lad Prabhakar Date: Tue Dec 21 21:26:08 2021 +0000 mtd: rawnand: omap_elm: Use platform_get_irq() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Signed-off-by: Lad Prabhakar Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20211221212609.31290-2-prabhakar.mahadev-lad.rj@bp.renesas.com commit 91f75eb481cfaee5c4ed8fb5214bf2fbfa04bd7b Author: Yazen Ghannam Date: Thu Dec 16 16:29:05 2021 +0000 x86/MCE/AMD, EDAC/mce_amd: Support non-uniform MCA bank type enumeration AMD systems currently lay out MCA bank types such that the type of bank number "i" is either the same across all CPUs or is Reserved/Read-as-Zero. For example: Bank # | CPUx | CPUy 0 LS LS 1 RAZ UMC 2 CS CS 3 SMU RAZ Future AMD systems will lay out MCA bank types such that the type of bank number "i" may be different across CPUs. For example: Bank # | CPUx | CPUy 0 LS LS 1 RAZ UMC 2 CS NBIO 3 SMU RAZ Change the structures that cache MCA bank types to be per-CPU and update smca_get_bank_type() to handle this change. Move some SMCA-specific structures to amd.c from mce.h, since they no longer need to be global. Break out the "count" for bank types from struct smca_hwid, since this should provide a per-CPU count rather than a system-wide count. Apply the "const" qualifier to the struct smca_hwid_mcatypes array. The values in this array should not change at runtime. Signed-off-by: Yazen Ghannam Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20211216162905.4132657-3-yazen.ghannam@amd.com commit 5176a93ab27aef1b9f4496fc68e6c303a011d7cc Author: Yazen Ghannam Date: Thu Dec 16 16:29:04 2021 +0000 x86/MCE/AMD, EDAC/mce_amd: Add new SMCA bank types Add HWID and McaType values for new SMCA bank types, and add their error descriptions to edac_mce_amd. The "PHY" bank types all have the same error descriptions, and the NBIF and SHUB bank types have the same error descriptions. So reuse the same arrays where appropriate. [ bp: Remove useless comments over hwid types. ] Signed-off-by: Yazen Ghannam Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20211216162905.4132657-2-yazen.ghannam@amd.com commit fe47ec5fa8ec223691f280bb8395fdc79548ecd4 Merge: ce96a964682ac bfc3a3f93ef7d Author: Arnd Bergmann Date: Wed Dec 22 17:18:43 2021 +0100 Merge tag 'arm-soc/for-5.17/maintainers' of https://github.com/Broadcom/stblinux into arm/soc This pull request contains MAINTAINERS file sections updates for Broadcom SoCs for v5.17, please pull the following: - Rafal updates the BCM5301X and BCM53573 SoCs sections to list Florian as second mainainer * tag 'arm-soc/for-5.17/maintainers' of https://github.com/Broadcom/stblinux: MAINTAINERS: Add Florian as BCM5301X and BCM53573 maintainer commit 862d7e5434154109c644cf2d28e3b94ab436263c Merge: e9aff54425f06 f5029f62d9ba9 Author: Arnd Bergmann Date: Wed Dec 22 17:14:59 2021 +0100 Merge tag 'arm-soc/for-5.17/drivers' of https://github.com/Broadcom/stblinux into arm/dt This pull request contains Broadcom SoCs drivers changes for v5.17, please pull the following changes: - Wan adds a missing of_node_put() in the power management driver for MIPS SoCs. * tag 'arm-soc/for-5.17/drivers' of https://github.com/Broadcom/stblinux: soc: bcm: brcmstb: Add of_node_put() in pm-mips Signed-off-by: Arnd Bergmann commit e9aff54425f062f2e8758d77e406df4ded00bd85 Merge: e5a8aa778d463 d0e68d354f345 Author: Arnd Bergmann Date: Wed Dec 22 17:13:21 2021 +0100 Merge tag 'arm-soc/for-5.17/devicetree-arm64' of https://github.com/Broadcom/stblinux into arm/dt This pull request contains Broadcom ARM64-based SoCs Device Tree changes for 5.17, please pull the following: - Rafal adds and documents the Netgear RAXE500 Wireless router based on the BCM4908 SoC. * tag 'arm-soc/for-5.17/devicetree-arm64' of https://github.com/Broadcom/stblinux: arm64: dts: broadcom: bcm4908: add DT for Netgear RAXE500 dt-bindings: arm: bcm: document Netgear RAXE500 binding Signed-off-by: Arnd Bergmann commit e5a8aa778d46383c1f901f1fecd6e0db991f8f40 Merge: c03b7ba969764 5e33f1c4a7cb9 Author: Arnd Bergmann Date: Wed Dec 22 17:06:11 2021 +0100 Merge tag 'arm-soc/for-5.17/devicetree' of https://github.com/Broadcom/stblinux into arm/dt This pull request contains Broadcom ARM-based SocS Device Tree changes for v5.17, please pull the following: - Matthew enables the QCA8337 switch of the Merak MX65 to have the appropriate PLL properties for it to be enabled and set the SGMII transmit clock to falling edge. - Arinc removes unnecessary properties of the GPIO keyboard Device Tree node, adds the external Realtek RTM8365MB switch on the Ausus RT-AC88U, including fixing the RX delay on the Realtek switch side and enabling flow control on the Broadcom internal switch port connecting to the Realtek switch. - Christian updates the Meraki MR32 Device Tree node to make use of the hardware I2C controller instead of bitbanging - Rafal updates the BCM5310X Device Tree files to have the CRU node not generate warnings, updates the USB 2.0 PHY to use the non-deprecated binding - Uwe adds GPIO offset to the gpio names properties for readability - Stefan updates the BCM2835 VCHIQ Device Tree binding to YAML - Florian fixes the iProc PCIe Device Tree nodes in Cygnus, Hurricane 2 and Northstar Plus to be compliant with the iProc PCIe YAML binding (merged in RobH's tree) as well as the SATA controller node unit name. * tag 'arm-soc/for-5.17/devicetree' of https://github.com/Broadcom/stblinux: ARM: dts: BCM5301X: correct RX delay and enable flow control on Asus RT-AC88U ARM: dts: NSP: Rename SATA unit name ARM: dts: NSP: Fixed iProc PCIe MSI sub-node ARM: dts: HR2: Fixed iProc PCIe MSI sub-node ARM: dts: Cygnus: Update PCIe PHY node unit name(s) ARM: dts: Cygnus: Fixed iProc PCIe controller properties dt-bindings: soc: bcm: Convert brcm,bcm2835-vchiq to json-schema ARM: dts: bcm2711-rpi-4-b: Add gpio offsets to line name array ARM: dts: BCM5301X: use non-deprecated USB 2.0 PHY binding ARM: dts: BCM5301X: update CRU block description ARM: BCM53016: MR32: convert to Broadcom iProc I2C Driver ARM: dts: BCM5301X: define RTL8365MB switch on Asus RT-AC88U ARM: dts: BCM5301X: remove unnecessary address & size cells from Asus RT-AC88U ARM: dts: NSP: MX65: add qca8k falling-edge, PLL properties commit dbcb124acebd8148e9e858a231f1798956dd3ca6 Author: Roger Quadros Date: Tue Dec 21 15:17:57 2021 +0200 mtd: rawnand: omap2: Select GPMC device driver for ARCH_K3 The GPMC device driver is required for NAND controller to work on K3 Architecture. Select it if required. Signed-off-by: Roger Quadros Acked-by: Miquel Raynal Link: https://lore.kernel.org/r/20211221131757.2030-5-rogerq@kernel.org Signed-off-by: Krzysztof Kozlowski commit f2f8115fe8b390af27d013411045bd712a812103 Author: Roger Quadros Date: Tue Dec 21 15:17:56 2021 +0200 memory: omap-gpmc: Use a compatible match table when checking for NAND controller As more compatibles can be added to the GPMC NAND controller driver use a compatible match table. Signed-off-by: Roger Quadros Acked-by: Miquel Raynal Link: https://lore.kernel.org/r/20211221131757.2030-4-rogerq@kernel.org [krzysztof: remove "is_nand" variable] Signed-off-by: Krzysztof Kozlowski commit 8ae4069acdee89dd54c3fab93a64cbe51b92fadc Author: Linus Walleij Date: Mon Nov 22 11:22:10 2021 +0100 dt-bindings: mfd: Add Freecom system controller This adds a DT binding for the Freecom FSG3 system controller found at CS2 in the Freecom FSG3 Intel IXP42x-based router. Cc: devicetree@vger.kernel.org Signed-off-by: Linus Walleij Acked-by: Rob Herring Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20211122102210.3137559-1-linus.walleij@linaro.org commit c03b7ba96976406a7e38e3086051ec742d0e495a Merge: dfdded9b0b3fe c23f1b77358c1 Author: Arnd Bergmann Date: Wed Dec 22 16:42:07 2021 +0100 Merge tag 'qcom-arm64-for-5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/dt Qualcomm ARM64 DeviceTree updates for v5.17 This introduces initial support for the brand new Snapdragon 8 Gen 1, aka SM8450 platform, with SMP, CPUfreq, cluster idling, low speed buses, TLMM pinctrl, SMMU, regulators, clocks, power-domains, UFS storage and USB currently supported. SDM845 adds new support for Sony Xperia XZ2, XZ2C and XZ3. The Lenovo Yoga C630 gains a few audio related fixes. The PMIC's VADC channels are described as thermal zones. OnePlus devices gains msm-id and board-id, to facilitate a single firmware image for the multiple devices. On SM8350 the Sony Xperia 1 III and 5 III, as well as initial description of Microsoft's Surface Duo 2 are introduced. On the platform side, LLCC, QUP nodes, redistributor stride and all the low-speed QUPs are added MSM8996 gained various regulator fixes, and adsp firmware name to faciliate pushing firmware to linux-firmware. Xiaomi Mi Note 2 gained touchkey controller definition. On SDM660 the Xiaomi Redmi Note 7 gained power and volume keys, RPM and regulator definitions, USB, eMMC and SD-card and a simple-framebuffer description. MSM8916 has the mmc aliases corrected, to stop the storage devices to move around and the RPM sleep stats memory is described. Support for the Samsung J5 2015 smartphone is introduced. SM6350 validation errors are fixed and and description of the audio, compute and modem remoteprocs are added. A couple new revisions of the SC7180 based Google devices are added. The SC7280 platform gains venus and a few fixes. The CRD development device is introduced, with the EC, touchscreen and touchpad. On SM8250 CPU opp-tables, for scaling L3 cache and DDR frequency based on CPU frequency, are added. As is TX, RX macros and SoundWire blocks and used to enable audio on the SM8350 MTP. * tag 'qcom-arm64-for-5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: (92 commits) arm64: dts: qcom: sm6125: Avoid using missing SM6125_VDDCX arm64: dts: qcom: sm8450-qrd: Enable USB nodes arm64: dts: qcom: sm8450: Add usb nodes arm64: dts: qcom: sm8450: add i2c13 and i2c14 device nodes arm64: dts: qcom: sm8450: add cpufreq support arm64: dts: qcom: sm8450: Add rpmhpd node arm64: dts: qcom: sm8450-qrd: enable ufs nodes arm64: dts: qcom: sm8450: add ufs nodes arm64: dts: qcom: sm8450-qrd: Add rpmh regulator nodes arm64: dts: qcom: Add base SM8450 QRD DTS arm64: dts: qcom: sm8450: add smmu nodes arm64: dts: qcom: sm8450: Add reserved memory nodes arm64: dts: qcom: sm8450: Add tlmm nodes arm64: dts: qcom: Add base SM8450 DTSI arm64: dts: qcom: ipq6018: Fix gpio-ranges property arm64: dts: qcom: sdm845: add QFPROM chipset specific compatible arm64: dts: qcom: sdm845: mtp: Add vadc channels and thermal zones arm64: dts: qcom: pm8998: Add ADC Thermal Monitor node arm64: qcom: dts: drop legacy property #stream-id-cells Revert "arm64: dts: qcom: sm8350: Specify clock-frequency for arch timer" ... Signed-off-by: Arnd Bergmann commit 38e0257e0e6f4fef2aa2966b089b56a8b1cfb75c Author: D Scott Phillips Date: Mon Dec 20 15:41:14 2021 -0800 arm64: errata: Fix exec handling in erratum 1418040 workaround The erratum 1418040 workaround enables CNTVCT_EL1 access trapping in EL0 when executing compat threads. The workaround is applied when switching between tasks, but the need for the workaround could also change at an exec(), when a non-compat task execs a compat binary or vice versa. Apply the workaround in arch_setup_new_exec(). This leaves a small window of time between SET_PERSONALITY and arch_setup_new_exec where preemption could occur and confuse the old workaround logic that compares TIF_32BIT between prev and next. Instead, we can just read cntkctl to make sure it's in the state that the next task needs. I measured cntkctl read time to be about the same as a mov from a general-purpose register on N1. Update the workaround logic to examine the current value of cntkctl instead of the previous task's compat state. Fixes: d49f7d7376d0 ("arm64: Move handling of erratum 1418040 into C code") Cc: # 5.9.x Signed-off-by: D Scott Phillips Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20211220234114.3926-1-scott@os.amperecomputing.com Signed-off-by: Catalin Marinas commit c23f1b77358c173a25ef21303d2a8cc893e9ce22 Author: Bjorn Andersson Date: Wed Dec 22 09:08:13 2021 -0600 arm64: dts: qcom: sm6125: Avoid using missing SM6125_VDDCX The SM6125_VDDCX constant is introduced through a separate branch and is not available in the dts branch. Temporarily replace the constant with it's value to avoid the build breakage. Signed-off-by: Bjorn Andersson commit 37daf8d9e0bd85a2859721aec28e1eb6e9973262 Author: Vincent Knecht Date: Wed Dec 22 14:54:03 2021 +0100 ASoC: codecs: ak4375: Change invert controls to a stereo switch Don't use enums for DACL/DACR Signal Invert controls, and change them into a stereo "DAC Signal Invert Switch" control. Signed-off-by: Vincent Knecht Link: https://lore.kernel.org/r/20211222135403.2991657-1-vincent.knecht@mailoo.org Signed-off-by: Mark Brown commit 547d2167c5c3cd879ed5e86e88cfa7daaf1228a5 Author: Johan Hovold Date: Mon Dec 20 12:19:01 2021 +0100 gnss: usb: add support for Sierra Wireless XM1210 Add support for the USB interface of the Sierra Wireless XM1210 receiver. Note that the device only supports NMEA. Bus 002 Device 003: ID 1199:b000 Sierra Wireless, Inc. Sierra Wireless_GNSS Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 1.00 bDeviceClass 0 bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x1199 Sierra Wireless, Inc. idProduct 0xb000 bcdDevice 0.01 iManufacturer 1 Sierra-wireless iProduct 2 Sierra Wireless_GNSS iSerial 0 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 0x0020 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0xc0 Self Powered MaxPower 50mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 0 bInterfaceSubClass 0 bInterfaceProtocol 0 iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 255 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 255 can't get debug descriptor: Resource temporarily unavailable Device Status: 0x0001 Self Powered Reported-by: Marc Ferland Link: https://lore.kernel.org/r/20211027200223.72701-1-ferlandm@amotus.ca Link: https://lore.kernel.org/r/20211220111901.23206-3-johan@kernel.org Reviewed-by: Greg Kroah-Hartman Tested-by: Marc Ferland Signed-off-by: Johan Hovold commit ee4736e50ba261944ddae75469b3eb47a9e2847d Author: Johan Hovold Date: Mon Dec 20 12:19:00 2021 +0100 gnss: add USB support Add a generic driver for GNSS receivers with a USB interface with two bulk endpoints. The driver currently assumes that the device protocol is NMEA (only) but this can be generalised later as needed. Link: https://lore.kernel.org/r/20211220111901.23206-2-johan@kernel.org Reviewed-by: Greg Kroah-Hartman Tested-by: Marc Ferland Signed-off-by: Johan Hovold commit 483c9d8275aff428df433e9d7c718609345500e2 Author: Gil Fine Date: Fri Dec 17 03:16:42 2021 +0200 thunderbolt: Rename Intel TB_VSE_CAP_IECS capability Rename the VSC capability: TB_VSE_CAP_IECS to TB_VSE_CAP_CP_LP to follow the Intel devices namings as appear in the datasheet. This capability is used for controlling CLx (Low Power states of the link). Signed-off-by: Gil Fine Signed-off-by: Mika Westerberg commit 23ccd21ccb56fbfd32cb9016dcb1ccb08c662396 Author: Gil Fine Date: Fri Dec 17 03:16:41 2021 +0200 thunderbolt: Implement TMU time disruption for Intel Titan Ridge Intel Titan Ridge based routers have slightly different flow for time disruption than USB4 compliant routers. This makes it work on Titan Ridge too. Needed to enable link low power states on Titan Ridge. Signed-off-by: Gil Fine Signed-off-by: Mika Westerberg commit 1639664fb74f30eaf82231fccbcf4e34a6e71f7f Author: Gil Fine Date: Fri Dec 17 03:16:40 2021 +0200 thunderbolt: Move usb4_switch_wait_for_bit() to switch.c Currently usb4_switch_wait_for_bit() used only in usb4.c Moving to switch.c to call it from other files. Also change the prefix to "tb_" to follow to the naming convention. Signed-off-by: Gil Fine Signed-off-by: Mika Westerberg commit 8a90e4fa3b4d6a10c96b0a04abf57bb5a16a8f4e Author: Gil Fine Date: Fri Dec 17 03:16:39 2021 +0200 thunderbolt: Add CL0s support for USB4 routers In this patch we add enabling of CL0s - a low power state of the link. Low power states (called collectively CLx) are used to reduce transmitter and receiver power when a high-speed lane is idle. For now, we add support only for first low power state: CL0s. We enable it, if both sides of the link support it, and only for the first hop router. (i.e. the first device that connected to the host router). This is needed for better thermal management. Signed-off-by: Gil Fine Signed-off-by: Mika Westerberg commit a28ec0e165ba2f90568828a2578aaa8540e13bc5 Author: Gil Fine Date: Fri Dec 17 03:16:38 2021 +0200 thunderbolt: Add TMU uni-directional mode Up until Titan Ridge (Thunderbolt 3) device routers only supported bi-directional mode. In this patch we add to TMU a uni-directional mode. The uni-directional mode is needed for enabling of low power state of the link (CLx). Signed-off-by: Gil Fine Signed-off-by: Mika Westerberg commit b398123bff3bcbc1facb0f29bf6e7b9f1bc55931 Author: Pingfan Liu Date: Wed Dec 15 10:13:48 2021 +0800 efi: apply memblock cap after memblock_add() On arm64, during kdump kernel saves vmcore, it runs into the following bug: ... [ 15.148919] usercopy: Kernel memory exposure attempt detected from SLUB object 'kmem_cache_node' (offset 0, size 4096)! [ 15.159707] ------------[ cut here ]------------ [ 15.164311] kernel BUG at mm/usercopy.c:99! [ 15.168482] Internal error: Oops - BUG: 0 [#1] SMP [ 15.173261] Modules linked in: xfs libcrc32c crct10dif_ce ghash_ce sha2_ce sha256_arm64 sha1_ce sbsa_gwdt ast i2c_algo_bit drm_vram_helper drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops cec drm_ttm_helper ttm drm nvme nvme_core xgene_hwmon i2c_designware_platform i2c_designware_core dm_mirror dm_region_hash dm_log dm_mod overlay squashfs zstd_decompress loop [ 15.206186] CPU: 0 PID: 542 Comm: cp Not tainted 5.16.0-rc4 #1 [ 15.212006] Hardware name: GIGABYTE R272-P30-JG/MP32-AR0-JG, BIOS F12 (SCP: 1.5.20210426) 05/13/2021 [ 15.221125] pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 15.228073] pc : usercopy_abort+0x9c/0xa0 [ 15.232074] lr : usercopy_abort+0x9c/0xa0 [ 15.236070] sp : ffff8000121abba0 [ 15.239371] x29: ffff8000121abbb0 x28: 0000000000003000 x27: 0000000000000000 [ 15.246494] x26: 0000000080000400 x25: 0000ffff885c7000 x24: 0000000000000000 [ 15.253617] x23: 000007ff80400000 x22: ffff07ff80401000 x21: 0000000000000001 [ 15.260739] x20: 0000000000001000 x19: ffff07ff80400000 x18: ffffffffffffffff [ 15.267861] x17: 656a626f2042554c x16: 53206d6f72662064 x15: 6574636574656420 [ 15.274983] x14: 74706d6574746120 x13: 2129363930342065 x12: 7a6973202c302074 [ 15.282105] x11: ffffc8b041d1b148 x10: 00000000ffff8000 x9 : ffffc8b04012812c [ 15.289228] x8 : 00000000ffff7fff x7 : ffffc8b041d1b148 x6 : 0000000000000000 [ 15.296349] x5 : 0000000000000000 x4 : 0000000000007fff x3 : 0000000000000000 [ 15.303471] x2 : 0000000000000000 x1 : ffff07ff8c064800 x0 : 000000000000006b [ 15.310593] Call trace: [ 15.313027] usercopy_abort+0x9c/0xa0 [ 15.316677] __check_heap_object+0xd4/0xf0 [ 15.320762] __check_object_size.part.0+0x160/0x1e0 [ 15.325628] __check_object_size+0x2c/0x40 [ 15.329711] copy_oldmem_page+0x7c/0x140 [ 15.333623] read_from_oldmem.part.0+0xfc/0x1c0 [ 15.338142] __read_vmcore.constprop.0+0x23c/0x350 [ 15.342920] read_vmcore+0x28/0x34 [ 15.346309] proc_reg_read+0xb4/0xf0 [ 15.349871] vfs_read+0xb8/0x1f0 [ 15.353088] ksys_read+0x74/0x100 [ 15.356390] __arm64_sys_read+0x28/0x34 ... This bug introduced by commit b261dba2fdb2 ("arm64: kdump: Remove custom linux,usable-memory-range handling"), which moves memblock_cap_memory_range() to fdt, but it breaches the rules that memblock_cap_memory_range() should come after memblock_add() etc as said in commit e888fa7bb882 ("memblock: Check memory add/cap ordering"). As a consequence, the virtual address set up by copy_oldmem_page() does not bail out from the test of virt_addr_valid() in check_heap_object(), and finally hits the BUG_ON(). Since memblock allocator has no idea about when the memblock is fully populated, while efi_init() is aware, so tackling this issue by calling the interface early_init_dt_check_for_usable_mem_range() exposed by of/fdt. Fixes: b261dba2fdb2 ("arm64: kdump: Remove custom linux,usable-memory-range handling") Signed-off-by: Pingfan Liu Cc: Rob Herring Cc: Zhen Lei Cc: Catalin Marinas Cc: Will Deacon Cc: Andrew Morton Cc: Mike Rapoport Cc: Geert Uytterhoeven Cc: Frank Rowand Cc: Ard Biesheuvel Cc: Nick Terrell Cc: linux-arm-kernel@lists.infradead.org To: devicetree@vger.kernel.org To: linux-efi@vger.kernel.org Acked-by: Ard Biesheuvel Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211215021348.8766-1-kernelfans@gmail.com commit 8347b41748c3019157312fbe7f8a6792ae396eb7 Author: Zhen Lei Date: Tue Dec 14 12:01:56 2021 +0800 of: fdt: Aggregate the processing of "linux,usable-memory-range" Currently, we parse the "linux,usable-memory-range" property in early_init_dt_scan_chosen(), to obtain the specified memory range of the crash kernel. We then reserve the required memory after early_init_dt_scan_memory() has identified all available physical memory. Because the two pieces of code are separated far, the readability and maintainability are reduced. So bring them together. Suggested-by: Rob Herring Signed-off-by: Zhen Lei (change the prototype of early_init_dt_check_for_usable_mem_range(), in order to use it outside) Signed-off-by: Pingfan Liu Tested-by: Dave Kleikamp Acked-by: John Donnelly Reviewed-by: Rob Herring Cc: Catalin Marinas Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org To: devicetree@vger.kernel.org To: linux-efi@vger.kernel.org Signed-off-by: Rob Herring commit 67e532a42cf4c6c214ed39e33e617bca29508f4e Author: Johan Hovold Date: Wed Dec 22 11:42:13 2021 +0100 driver core: platform: document registration-failure requirement Add an explicit comment to document that the reference initialised by platform_device_register() needs to be released by a call to platform_device_put() also when registration fails (cf. device_register()). Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20211222104213.5673-1-johan@kernel.org Signed-off-by: Greg Kroah-Hartman commit 45e3a279841f13243c45928d7ec2e67d56b37067 Author: David E. Box Date: Tue Dec 21 15:58:52 2021 -0800 vdpa/mlx5: Use auxiliary_device driver data helpers Use auxiliary_get_drvdata and auxiliary_set_drvdata helpers. Reviewed-by: Cezary Rojewski Signed-off-by: David E. Box Link: https://lore.kernel.org/r/20211221235852.323752-5-david.e.box@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit a5f8ef0baf9a018cde00bd0a960060a306d9021f Author: David E. Box Date: Tue Dec 21 15:58:51 2021 -0800 net/mlx5e: Use auxiliary_device driver data helpers Use auxiliary_get_drvdata and auxiliary_set_drvdata helpers. Reviewed-by: Cezary Rojewski Signed-off-by: David E. Box Link: https://lore.kernel.org/r/20211221235852.323752-4-david.e.box@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 3edac08e18961b3f2ac883f1dc209f36deb218be Author: David E. Box Date: Tue Dec 21 15:58:50 2021 -0800 soundwire: intel: Use auxiliary_device driver data helpers Use auxiliary_get_drvdata and auxiliary_set_drvdata helpers. Reviewed-by: Andy Shevchenko Reviewed-by: Cezary Rojewski Signed-off-by: David E. Box Link: https://lore.kernel.org/r/20211221235852.323752-3-david.e.box@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 27963d3da4d2e0602948cf5f346a7035e694c3b4 Author: David E. Box Date: Tue Dec 21 15:58:49 2021 -0800 RDMA/irdma: Use auxiliary_device driver data helpers Use auxiliary_get_drvdata and auxiliary_set_drvdata helpers. Reviewed-by: Cezary Rojewski Signed-off-by: David E. Box Link: https://lore.kernel.org/r/20211221235852.323752-2-david.e.box@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit a3c8f906ed5fc1d4895b5e1a5c6ad6e942d6c0ca Author: David E. Box Date: Tue Dec 7 17:50:12 2021 -0800 platform/x86/intel: Move intel_pmt from MFD to Auxiliary Bus Intel Platform Monitoring Technology (PMT) support is indicated by presence of an Intel defined PCIe Designated Vendor Specific Extended Capabilities (DVSEC) structure with a PMT specific ID. The current MFD implementation creates child devices for each PMT feature, currently telemetry, watcher, and crashlog. However DVSEC structures may also be used by Intel to indicate support for other features. The Out Of Band Management Services Module (OOBMSM) uses DVSEC to enumerate several features, including PMT. In order to support them it is necessary to modify the intel_pmt driver to handle the creation of the child devices more generically. To that end, modify the driver to create child devices for any VSEC/DVSEC features on supported devices (indicated by PCI ID). Additionally, move the implementation from MFD to the Auxiliary bus. VSEC/DVSEC features are really multifunctional PCI devices, not platform devices as MFD was designed for. Auxiliary bus gives more flexibility by allowing the definition of custom structures that can be shared between associated auxiliary devices and the parent device. Also, rename the driver from intel_pmt to intel_vsec to better reflect the purpose. This series also removes the current runtime pm support which was not complete to begin with. None of the current devices require runtime pm. However the support will be replaced when a device is added that requires it. Reviewed-by: Mark Gross Acked-by: Hans de Goede Signed-off-by: David E. Box Link: https://lore.kernel.org/r/20211208015015.891275-4-david.e.box@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 365481e42a8a95c55e43e8cc236138718e762e7b Author: David E. Box Date: Tue Dec 7 17:50:11 2021 -0800 driver core: auxiliary bus: Add driver data helpers Adds get/set driver data helpers for auxiliary devices. Reviewed-by: Mark Gross Reviewed-by: Andy Shevchenko Signed-off-by: David E. Box Link: https://lore.kernel.org/r/20211208015015.891275-3-david.e.box@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 80b3485f7d7bdb2468f2a9d6a346a1132d248309 Author: David E. Box Date: Tue Dec 7 17:50:10 2021 -0800 PCI: Add #defines for accessing PCIe DVSEC fields Add #defines for accessing Vendor ID, Revision, Length, and ID offsets in the Designated Vendor Specific Extended Capability (DVSEC). Defined in PCIe r5.0, sec 7.9.6. Reviewed-by: Rafael J. Wysocki Acked-by: Bjorn Helgaas Signed-off-by: David E. Box Link: https://lore.kernel.org/r/20211208015015.891275-2-david.e.box@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit c70282457c380db7deb57c81a6894debc8f88efa Author: Oskari Lemmela Date: Wed Dec 22 07:59:58 2021 +0200 spi: ar934x: fix transfer and word delays Add missing delay between transferred messages and words. Signed-off-by: Oskari Lemmela Link: https://lore.kernel.org/r/20211222055958.1383233-3-oskari@lemmela.net Signed-off-by: Mark Brown commit 1f6532073e3e9caee1dbc3f9b4be28359a181ea4 Author: Alexander Stein Date: Sat Dec 18 15:34:23 2021 +0100 ASoC: meson: g12a: add missing sound-name-prefix property This is used in meson-sm1 and meson-g12 .dtsi. Add the property to the binding. This fixes the dtschema warning: audio-controller@740: 'sound-name-prefix' does not match any of the regexes: 'pinctrl-[0-9]+' Signed-off-by: Alexander Stein Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211218143423.18768-3-alexander.stein@mailbox.org Signed-off-by: Mark Brown commit 847cbea6459d5beb3f0f960fde4337f28b663eae Author: Alexander Stein Date: Sat Dec 18 15:34:22 2021 +0100 ASoC: meson: t9015: add missing sound-name-prefix property This is used in meson-gxl and meson-g12-common .dtsi. Add the property to the binding. This fixes the dtschema warning: audio-controller@32000: 'sound-name-prefix' does not match any of the regexes: 'pinctrl-[0-9]+' Signed-off-by: Alexander Stein Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211218143423.18768-2-alexander.stein@mailbox.org Signed-off-by: Mark Brown commit 0d422a466ef7fdbbe402194ac06144d1bbcdc227 Author: Alexander Stein Date: Sat Dec 18 15:34:21 2021 +0100 ASoC: dt-bindings: Use name-prefix schema name-prefix.txt does not exist anymore, just reference the schema instead. Signed-off-by: Alexander Stein Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211218143423.18768-1-alexander.stein@mailbox.org Signed-off-by: Mark Brown commit 80bb73a9fbcde4ecc55e12f10c73fabbe68a24d1 Author: Kunihiko Hayashi Date: Wed Dec 22 13:48:12 2021 +0900 spi: uniphier: Fix a bug that doesn't point to private data correctly In uniphier_spi_remove(), there is a wrong code to get private data from the platform device, so the driver can't be removed properly. The driver should get spi_master from the platform device and retrieve the private data from it. Cc: Fixes: 5ba155a4d4cc ("spi: add SPI controller driver for UniPhier SoC") Signed-off-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/1640148492-32178-1-git-send-email-hayashi.kunihiko@socionext.com Signed-off-by: Mark Brown commit af2b24f228a0373ac65eb7a502e0bc31e2c0269d Author: Kajol Jain Date: Mon Dec 6 14:47:49 2021 +0530 perf powerpc: Add data source encodings for power10 platform The code represent memory/cache level data based on PERF_MEM_LVL_* namespace, which is in the process of deprication in the favour of newer composite PERF_MEM_{LVLNUM_,REMOTE_,SNOOPX_,HOPS_} fields. Add data source encodings to represent cache/memory data based on newer composite PERF_MEM_{LVLNUM_,REMOTE_,SNOOPX_,HOPS_} fields. Add data source encodings to represent data coming from local memory/Remote memory/distant memory and remote/distant cache hits. Inorder to represent data coming from OpenCAPI cache/memory, we use LVLNUM "PMEM" field which is used to present persistent memory accesses. Result in power10 system with patch changes: localhost:# ./perf mem report --sort="mem,sym,dso" --stdio # Overhead Samples Memory access Symbol Shared Object # ........ ....... ...................................... ........................... ................. # 29.46% 2331 L1 or L1 hit [.] __random libc-2.28.so 23.11% 2121 L1 or L1 hit [.] producer_populate_cache producer_consumer 18.56% 1758 L1 or L1 hit [.] __random_r libc-2.28.so 15.64% 1559 L2 or L2 hit [.] __random libc-2.28.so ..... 0.09% 5 Remote socket, same board Any cache hit [.] __random libc-2.28.so 0.07% 4 Remote socket, same board Any cache hit [.] __random libc-2.28.so ..... Reviewed-by: Madhavan Srinivasan Signed-off-by: Kajol Jain Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: Andi Kleen Cc: Athira Jajeev Cc: Daniel Borkmann Cc: Jin Yao Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Michael Ellerman Cc: Nageswara R Sastry Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Song Liu Cc: linuxppc-dev@lists.ozlabs.org Link: http://lore.kernel.org/lkml/20211206091749.87585-5-kjain@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit 0ebce3d65f1f53c936fdd51e975bd876ba7ed64f Author: Kajol Jain Date: Mon Dec 6 14:47:48 2021 +0530 perf powerpc: Add encodings to represent data based on newer composite PERF_MEM_LVLNUM* fields The code represent data coming from L1/L2/L3 cache hits based on PERF_MEM_LVL_* namespace, which is in the process of deprecation in the favour of newer composite PERF_MEM_{LVLNUM_,REMOTE_,SNOOPX_,HOPS_} fields. Add data source encodings to represent L1/L2/L3 cache hits based on newer composite PERF_MEM_{LVLNUM_,REMOTE_,SNOOPX_,HOPS_} fields for power10 and older platforms Result in power9 system without patch changes: localhost:# ./perf mem report --sort="mem,sym,dso" --stdio # Overhead Samples Memory access Symbol Shared Object # ........ ....... ............. ................................. ................ # 29.51% 1 L2 hit [k] perf_event_exec [kernel.vmlinux] 27.05% 1 L1 hit [k] perf_ctx_unlock [kernel.vmlinux] 13.93% 1 L1 hit [k] vtime_delta [kernel.vmlinux] 13.11% 1 L1 hit [k] prepend_path.isra.11 [kernel.vmlinux] 8.20% 1 L1 hit [.] 00000038.plt_call.__GI_strlen libc-2.28.so 8.20% 1 L1 hit [k] perf_event_interrupt [kernel.vmlinux] Result in power9 system with patch changes: localhost:# ./perf mem report --sort="mem,sym,dso" --stdio # Overhead Samples Memory access Symbol Shared Object # ........ ....... ............. .......................... ................ # 36.63% 1 L2 or L2 hit [k] perf_event_exec [kernel.vmlinux] 25.50% 1 L1 or L1 hit [k] vtime_delta [kernel.vmlinux] 13.12% 1 L1 or L1 hit [k] unmap_region [kernel.vmlinux] 12.62% 1 L1 or L1 hit [k] perf_sample_event_took [kernel.vmlinux] 6.93% 1 L1 or L1 hit [k] perf_ctx_unlock [kernel.vmlinux] 5.20% 1 L1 or L1 hit [.] __memcpy_power7 libc-2.28.so Reviewed-by: Madhavan Srinivasan Signed-off-by: Kajol Jain Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: Andi Kleen Cc: Athira Jajeev Cc: Daniel Borkmann Cc: Jin Yao Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Michael Ellerman Cc: Nageswara R Sastry Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Song Liu Cc: linuxppc-dev@lists.ozlabs.org Link: http://lore.kernel.org/lkml/20211206091749.87585-4-kjain@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit 7fbddf40b881a2430daf1bd03ba80e871a2fadce Author: Kajol Jain Date: Mon Dec 6 14:47:47 2021 +0530 tools headers UAPI: Add new macros for mem_hops field to perf_event.h Add new macros for mem_hops field which can be used to represent remote-node, socket and board level details. Currently the code had macro for HOPS_0 which, corresponds to data coming from another core but same node. Add new macros for HOPS_1 to HOPS_3 to represent remote-node, socket and board level data. Also add corresponding strings in the mem_hops array to represent mem_hop field data in perf_mem__lvl_scnprintf function Incase mem_hops field is used, PERF_MEM_LVLNUM field also need to be set inorder to represent the data source. Hence printing data source via PERF_MEM_LVL field can be skip in that scenario. For ex: Encodings for mem_hops fields with L2 cache: L2 - local L2 L2 | REMOTE | HOPS_0 - remote core, same node L2 L2 | REMOTE | HOPS_1 - remote node, same socket L2 L2 | REMOTE | HOPS_2 - remote socket, same board L2 L2 | REMOTE | HOPS_3 - remote board L2 Signed-off-by: Kajol Jain Acked-by: Peter Zijlstra (Intel) Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: Andi Kleen Cc: Athira Jajeev Cc: Daniel Borkmann Cc: Jin Yao Cc: Jiri Olsa Cc: Kan Liang Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Michael Ellerman Cc: Nageswara R Sastry Cc: Namhyung Kim Cc: Paul Mackerras Cc: Song Liu Cc: linuxppc-dev@lists.ozlabs.org Link: http://lore.kernel.org/lkml/20211206091749.87585-3-kjain@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit bb516937c2ef229a7ab2617f716468b808c27c43 Merge: b9f6fbb3b2c29 2f47a9a4dfa36 Author: Arnaldo Carvalho de Melo Date: Wed Dec 22 09:32:43 2021 -0300 Merge remote-tracking branch 'torvalds/master' into perf/core To pick up fixes. Signed-off-by: Arnaldo Carvalho de Melo commit 7e58accf4547b75070e5cc1e04f97e890d7f719a Author: Roger Quadros Date: Tue Dec 21 15:17:55 2021 +0200 memory: omap-gpmc: Add support for GPMC on AM64 SoC The TI's AM64 SoC has the GPMC module. Add compatible for it. Traditionally GPMC external addresses have always been mapped to first 1GB physical address. However newer platforms, can have it mapped at different locations. Support this address provision via device tree. Signed-off-by: Roger Quadros Link: https://lore.kernel.org/r/20211221131757.2030-3-rogerq@kernel.org Signed-off-by: Krzysztof Kozlowski commit 4892242784786f3cbaa3b79ea03f8b0c145f6cfd Author: Roger Quadros Date: Tue Dec 21 15:17:54 2021 +0200 dt-bindings: memory-controllers: ti,gpmc: Add compatible for AM64 AM64 SoC contains the GPMC module. Add compatible for it. Newer SoCs don't necessarily map GPMC data region at the same place as legacy SoCs. Add reg-names "data", to provide this information to the device driver. Signed-off-by: Roger Quadros Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211221131757.2030-2-rogerq@kernel.org Signed-off-by: Krzysztof Kozlowski commit 19d398dca521167420fb8458842c7fe4b002a0f5 Author: Lad Prabhakar Date: Tue Dec 21 20:39:15 2021 +0000 memory: omap-gpmc: Use platform_get_irq() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Signed-off-by: Lad Prabhakar Acked-by: Roger Quadros Link: https://lore.kernel.org/r/20211221203916.18588-2-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Krzysztof Kozlowski commit 1bb866dcb8cf5054de88f592fc0ec1f275ad9d63 Merge: e233897b1f7a8 c9791a94384af Author: Greg Kroah-Hartman Date: Wed Dec 22 12:33:01 2021 +0100 Merge tag 'iio-for-5.17a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-next Jonathan writes: 1st set of IIO new device support, features and cleanup for 5.17 Includes some fixes that were either late breaking, low priority or complex enough to not be good to rush in late in the cycle. Tree rebased today to fix up some trivial issues + pull in a fix that was previously on the fixes-togreg branch. Vast majority have been in linux-next for some time now. New device support * adi,ad7293 - New driver and bindings for this Power Amplifier drain current controller. A complex device with various related monitoring functions. * adi,ad75513R - New driver and bindings for this combined ADC and DAC device. - A few follow up fixes. * adi,admv8818 - New driver (and type) for this 2-18GHz filter device. Includes bindings and ABI documentation to allow clk_notifier based auto adjustment of the filters in appropriate applications. * liteon,ltr501 - Support for the ltr303. ID and chip specific info table. * xilinx,ams - New generic firmware function fwnode_iomap() as used in this driver. - New driver and bindings for this ADC and on-chip sensors as found in various Xilinx devices. Core * Introduced IIO_VAL_INT_64 which uses val and val2 in IIO callbacks to form a 64 bit integer when higher precision needed. * Allow IIO_ENUM_AVAILABLE to be used with different shared values. * Fix a long term issue with scheduling whilst atomic when iio_trig_poll() is called but no trigger consumers are actually enabled and hence the trigger may be reenabled from the interrupt handler. Seen in the wild on the tsc2046. * Mark iio_device_type const. * buffer: Use a separate index variable to simplify code. * buffer-dma: Clear out unused struct iio_buffer_block * buffer-dmaengine: Switch to cheaper round_down() as power of 2 values. Tests/tools * format_value - Check against NULL returns from allocations in tests. - Add IIO_VAL_INT_64 test case. * event_monitor - Flush the output after event to given more consistent latency when tool output piped to other programs. Driver Features * axp20x - Add support for NTC thermistor channel and document TS pin binding. * arm,scmi - Add reading of raw channel values (using IIO_VAL_INT_64) * liteon,ltr501 - Add proximity-near-level support and dt-binding. Tree wide cleanup * Remove no-op trigger ops from multiple drivers. * Stop using dev_get_drvdata() on the iio_dev->dev in various drivers and then stop assigning it to allow this to be used for other purposes. We can always get to the indio_dev using dev_to_iio_dev() which is a container_of() based approach. Also cleanup up some related unnecessary convoluted cases. - atmel,at91-sam5d2 - nxp,imx7d - meas,ms5611 - st,st_sensors * Where available (or easy to introduce) use the scan_type.* values in place of a second copy for read_raw and similar paths. - adi,ad7266 - bosch,bma220 - fsl,mac3110 - fsl,mma7455 - fsl,mpl3115 - kionix,kcjk-1013 - sensortek,stk8ba50 - sensortek,stk8312 - ti,adc12138 - ti,ads1015 - vti,sca3000 - xilinx,xadc-core * Switch drives over to generic firmware properties including appropriate header changes to avoid including of.h - Various DACs had false CONFIG_OF dependencies. - dpot-dac - envelope-detector - adi,ad5755 - adi,ad5758 - capella,cm3605 - maxim,max9611 - microchip,mcp41010 - microchip,mcp3911 - ti,adc12138 * Trivial clang warning fixes for W=1 warnings. Driver specific cleanup and minor fixes * adi,ad7606 - Comment fixes. * ams,ad3935 - Drop pointless cast to the same type. * atmel,at91-sama5d2 - Fix wrong cast of iio_dev->dev to platform_device that happened to be harmless. * fsl,mma7660 - Stop i2c remove() function returning an error code. Part of a rework to eventually stop returning anything from these. * fsl,mma8452 - Use correct type for local irqreturn_t. * nxp,imx8mq - Maintainer email address update. * nxp,lpc18xx_adc - Ensure clk_prepare_enable() called before clk_get_rate(). - Switch of.h for mod_devicetable.h to reflect no of specific functions, just the id table. * renesas,rzg2l - Drop a dev_err() that just duplicates error printed in platform_get_irq() * sgx,vz89x - Drop pointless cast. * st,lsm6dsx - Make it possible to disable the sensorhub from DT to avoid a corner case where the address of a slave device many be accidentally modified. * st,stm32-adc - Stop leaking an of_node in an error path. * st,stmp2 - Avoid wrong sized type for bit field which could result in over-reading (harmless). Precursor to enabling -Warray-bounds. * ti,adc081c - Put back some ACPI support for non standards compliant ADC081C ID because it is known to be in the wild on some Aaeon boards. * ti,ads8688 - Cleanup redundant local ret variable assignment. * ti,ina2xx-adc - Use helper macro kthread_run() to replace some boilerplate. - Avoid double reference counting. - Drop pointless cast. * xilinx,xadc - Make the IRQ optional as not always wired to the host system. * tag 'iio-for-5.17a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (103 commits) iio: adc: ti-adc081c: Partial revert of removal of ACPI IDs iio:addac:ad74413r: Fix uninitialized ret in a path that won't be hit. MAINTAINERS: Add maintainer for xilinx-ams dt-bindings: iio: adc: Add Xilinx AMS binding documentation iio: adc: Add Xilinx AMS driver device property: Add fwnode_iomap() iio:accel:kxcjk-1013: Mark struct __maybe_unused to avoid warning. iio:accel:bmc150: Mark structure __maybe_unused as only needed with for pm ops. iio:dummy: Drop set but unused variable len. iio:magn:ak8975: Suppress clang W=1 warning about pointer to enum conversion. iio:imu:inv_mpu6050: Suppress clang W=1 warning about pointer to enum conversion. iio:imu:inv_icm42600: Suppress clang W=1 warning about pointer to enum conversion. iio:dac:mcp4725: Suppress clang W=1 warning about pointer to enum conversion. iio:amplifiers:hmc425a: Suppress clang W=1 warning about pointer to enum conversion. iio:adc:ti-ads1015: Suppress clang W=1 warning about pointer to enum conversion. iio:adc:rcar: Suppress clang W=1 warning about pointer to enum conversion. iio:adc:ina2xx-adc: Suppress clang W=1 warning about pointer to enum conversion. iio:accel:bma180: Suppress clang W=1 warning about pointer to enum conversion. drivers:iio:dac: Add AD3552R driver support dt-bindings: iio: dac: Add adi,ad3552r.yaml ... commit ec961cf3241153e0f27d850f1bf0f172e7d27a21 Author: Marijn Suijten Date: Mon Nov 15 21:34:59 2021 +0100 backlight: qcom-wled: Respect enabled-strings in set_brightness The hardware is capable of controlling any non-contiguous sequence of LEDs specified in the DT using qcom,enabled-strings as u32 array, and this also follows from the DT-bindings documentation. The numbers specified in this array represent indices of the LED strings that are to be enabled and disabled. Its value is appropriately used to setup and enable string modules, but completely disregarded in the set_brightness paths which only iterate over the number of strings linearly. Take an example where only string 2 is enabled with qcom,enabled_strings=<2>: this string is appropriately enabled but subsequent brightness changes would have only touched the zero'th brightness register because num_strings is 1 here. This is simply addressed by looking up the string for this index in the enabled_strings array just like the other codepaths that iterate over num_strings. Likewise enabled_strings is now also used in the autodetection path for consistent behaviour: when a list of strings is specified in DT only those strings will be probed for autodetection, analogous to how the number of strings that need to be probed is already bound by qcom,num-strings. After all autodetection uses the set_brightness helpers to set an initial value, which could otherwise end up changing brightness on a different set of strings. Fixes: 775d2ffb4af6 ("backlight: qcom-wled: Restructure the driver for WLED3") Fixes: 03b2b5e86986 ("backlight: qcom-wled: Add support for WLED4 peripheral") Signed-off-by: Marijn Suijten Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20211115203459.1634079-10-marijn.suijten@somainline.org commit b7002cd5e9d80b790349b0a77a2eba34dc0471c0 Author: Marijn Suijten Date: Mon Nov 15 21:34:58 2021 +0100 backlight: qcom-wled: Remove unnecessary double whitespace Remove redundant spaces inside for loop conditions. No other double spaces were found that are not part of indentation with `[^\s] `. Signed-off-by: Marijn Suijten Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20211115203459.1634079-9-marijn.suijten@somainline.org commit c70aefdedb24ec545d0958f17faae3b3a3141d2e Author: Marijn Suijten Date: Mon Nov 15 21:34:57 2021 +0100 backlight: qcom-wled: Provide enabled_strings default for WLED 4 and 5 Only WLED 3 sets a sensible default that allows operating this driver with just qcom,num-strings in the DT; WLED 4 and 5 require qcom,enabled-strings to be provided otherwise enabled_strings remains zero-initialized, resulting in every string-specific register write (currently only the setup and config functions, brightness follows in a future patch) to only configure the zero'th string multiple times. Signed-off-by: Marijn Suijten Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20211115203459.1634079-8-marijn.suijten@somainline.org commit 96571489a06999bf5c62e2058622990734556f8f Author: Marijn Suijten Date: Mon Nov 15 21:34:56 2021 +0100 backlight: qcom-wled: Remove unnecessary 4th default string in WLED3 The previous commit improves num_strings parsing to not go over the maximum of 3 strings for WLED3 anymore. Likewise this default index for a hypothetical 4th string is invalid and could access registers that are not mapped to the desired purpose. Removing this value gets rid of undesired confusion and avoids the possibility of accessing registers at this offset even if the 4th array element is used by accident. Signed-off-by: Marijn Suijten Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20211115203459.1634079-7-marijn.suijten@somainline.org commit 2b4b49602f9feca7b7a84eaa33ad9e666c8aa695 Author: Marijn Suijten Date: Mon Nov 15 21:34:55 2021 +0100 backlight: qcom-wled: Override default length with qcom,enabled-strings The length of qcom,enabled-strings as property array is enough to determine the number of strings to be enabled, without needing to set qcom,num-strings to override the default number of strings when less than the default (which is also the maximum) is provided in DT. This also introduces an extra warning when qcom,num-strings is set, denoting that it is not necessary to set both anymore. It is usually more concise to set just qcom,num-length when a zero-based, contiguous range of strings is needed (the majority of the cases), or to only set qcom,enabled-strings when a specific set of indices is desired. Fixes: 775d2ffb4af6 ("backlight: qcom-wled: Restructure the driver for WLED3") Signed-off-by: Marijn Suijten Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20211115203459.1634079-6-marijn.suijten@somainline.org commit 5ada78b26f935f8751852dffa24f6b545b1d2517 Author: Marijn Suijten Date: Mon Nov 15 21:34:54 2021 +0100 backlight: qcom-wled: Fix off-by-one maximum with default num_strings When not specifying num-strings in the DT the default is used, but +1 is added to it which turns WLED3 into 4 and WLED4/5 into 5 strings instead of 3 and 4 respectively, causing out-of-bounds reads and register read/writes. This +1 exists for a deficiency in the DT parsing code, and is simply omitted entirely - solving this oob issue - by parsing the property separately much like qcom,enabled-strings. This also enables more stringent checks on the maximum value when qcom,enabled-strings is provided in the DT, by parsing num-strings after enabled-strings to allow it to check against (and in a subsequent patch override) the length of enabled-strings: it is invalid to set num-strings higher than that. The DT currently utilizes it to get around an incorrect fixed read of four elements from that array (has been addressed in a prior patch) by setting a lower num-strings where desired. Fixes: 93c64f1ea1e8 ("leds: add Qualcomm PM8941 WLED driver") Signed-off-by: Marijn Suijten Reviewed-By: AngeloGioacchino Del Regno Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20211115203459.1634079-5-marijn.suijten@somainline.org commit 0a139358548968b2ff308257b4fbeec7badcc3e1 Author: Marijn Suijten Date: Mon Nov 15 21:34:53 2021 +0100 backlight: qcom-wled: Use cpu_to_le16 macro to perform conversion The kernel already provides appropriate primitives to perform endianness conversion which should be used in favour of manual bit-wrangling. Signed-off-by: Marijn Suijten Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20211115203459.1634079-4-marijn.suijten@somainline.org commit e29e24bdabfeddbf8b1a4ecac1af439a85150438 Author: Marijn Suijten Date: Mon Nov 15 21:34:52 2021 +0100 backlight: qcom-wled: Pass number of elements to read to read_u32_array of_property_read_u32_array takes the number of elements to read as last argument. This does not always need to be 4 (sizeof(u32)) but should instead be the size of the array in DT as read just above with of_property_count_elems_of_size. To not make such an error go unnoticed again the driver now bails accordingly when of_property_read_u32_array returns an error. Surprisingly the indentation of newlined arguments is lining up again after prepending `rc = `. Fixes: 775d2ffb4af6 ("backlight: qcom-wled: Restructure the driver for WLED3") Signed-off-by: Marijn Suijten Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20211115203459.1634079-3-marijn.suijten@somainline.org commit c05b21ebc5bce3ecc78c2c71afd76d92c790a2ac Author: Marijn Suijten Date: Mon Nov 15 21:34:51 2021 +0100 backlight: qcom-wled: Validate enabled string indices in DT The strings passed in DT may possibly cause out-of-bounds register accesses and should be validated before use. Fixes: 775d2ffb4af6 ("backlight: qcom-wled: Restructure the driver for WLED3") Signed-off-by: Marijn Suijten Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20211115203459.1634079-2-marijn.suijten@somainline.org commit 6202b5de73cfb0d83245b8ea834017183ec67885 Author: Hans de Goede Date: Tue Nov 2 23:55:04 2021 +0100 backlight: lp855x: Add support ACPI enumeration The Xiaomi Mi Pad 2 tablet uses an ACPI enumerated LP8556 backlight controller for its LCD-panel, with a Xiaomi specific ACPI HID of "XMCC0001", add support for this. Note the new "if (id)" check also fixes a NULL pointer deref when a user tries to manually bind the driver from sysfs. When CONFIG_ACPI is disabled acpi_match_device() will always return NULL, so the lp855x_parse_acpi() call will get optimized away. Reviewed-by: Daniel Thompson Signed-off-by: Hans de Goede Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20211102225504.18920-3-hdegoede@redhat.com commit 92add941b6be185e511a7564bf68963fa1633d53 Author: Hans de Goede Date: Tue Nov 2 23:55:03 2021 +0100 backlight: lp855x: Add dev helper variable to lp855x_probe() Add a dev local variable to the lp855x_probe(), to replace "&cl->dev" and "lp->dev" in various places. Also switch to dev_err_probe() in one case which takes care of not printing -EPROBE_DEFER errors for us. This is mostly a preparation for adding ACPI enumeration support which will use the new "dev" variable more. Signed-off-by: Hans de Goede Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20211102225504.18920-2-hdegoede@redhat.com commit dec5779e6a7b73c6c64c4f75e7fcbf04d3b0aa7c Author: Hans de Goede Date: Tue Nov 2 23:55:02 2021 +0100 backlight: lp855x: Move device_config setting out of lp855x_configure() Move the setting of the lp->cfg pointer to the chip specific lp855x_device_config struct from lp855x_configure() to lp855x_probe(), before calling lp855x_parse_dt(). This is a preperation patch for adding ACPI enumeration support. Signed-off-by: Hans de Goede Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20211102225504.18920-1-hdegoede@redhat.com commit 31e833b2031232493f2c30e53401e1f5ba293f97 Author: Guilherme G. Piccoli Date: Tue Dec 21 12:52:30 2021 -0300 arm64: Unhash early pointer print plus improve comment When facing a really early issue on DT parsing we have currently a message that shows both the physical and virtual address of the FDT. The printk pointer modifier for the virtual address shows a hashed address there unless the user provides "no_hash_pointers" parameter in the command-line. The situation in which this message shows-up is a bit more serious though: the boot process is broken, nothing can be done (even an oops is too much for this early stage) so we have this message as a last resort in order to help debug bootloader issues, for example. Hence, we hereby change that to "%px" in order to make debugging easy, there's not much information leak risk in such early boot failure. Also, we tried to improve a bit the commenting on that function, given that if kernel fails there, it just hangs forever in a cpu_relax() loop. The reason we cannot BUG/panic is that is too early to do so; thanks to Mark Brown for pointing that on IRC and thanks Robin Murphy for the good pointer hash discussion in the mailing-list. Cc: Mark Brown Cc: Robin Murphy Signed-off-by: Guilherme G. Piccoli Reviewed-by: Robin Murphy Acked-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20211221155230.1532850-1-gpiccoli@igalia.com Signed-off-by: Catalin Marinas commit b64dfcde1ca9cb82e38e573753f0c0db8fb841c2 Author: Borislav Petkov Date: Fri Dec 17 16:48:29 2021 +0100 x86/mm: Prevent early boot triple-faults with instrumentation Commit in Fixes added a global TLB flush on the early boot path, after the kernel switches off of the trampoline page table. Compiler profiling options enabled with GCOV_PROFILE add additional measurement code on clang which needs to be initialized prior to use. The global flush in x86_64_start_kernel() happens before those initializations can happen, leading to accessing invalid memory. GCOV_PROFILE builds with gcc are still ok so this is clang-specific. The second issue this fixes is with KASAN: for a similar reason, kasan_early_init() needs to have happened before KASAN-instrumented functions are called. Therefore, reorder the flush to happen after the KASAN early init and prevent the compilers from adding profiling instrumentation to native_write_cr4(). Fixes: f154f290855b ("x86/mm/64: Flush global TLB on boot and AP bringup") Reported-by: "J. Bruce Fields" Reported-by: kernel test robot Signed-off-by: Borislav Petkov Tested-by: Carel Si Tested-by: "J. Bruce Fields" Link: https://lore.kernel.org/r/20211209144141.GC25654@xsang-OptiPlex-9020 commit d5624bb29f49b849ac8d1e9783dbf9c65cf33457 Author: Xiongfeng Wang Date: Tue Dec 21 11:55:56 2021 +0800 asm-generic: introduce io_stop_wc() and add implementation for ARM64 For memory accesses with write-combining attributes (e.g. those returned by ioremap_wc()), the CPU may wait for prior accesses to be merged with subsequent ones. But in some situation, such wait is bad for the performance. We introduce io_stop_wc() to prevent the merging of write-combining memory accesses before this macro with those after it. We add implementation for ARM64 using DGH instruction and provide NOP implementation for other architectures. Signed-off-by: Xiongfeng Wang Suggested-by: Will Deacon Suggested-by: Catalin Marinas Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/20211221035556.60346-1-wangxiongfeng2@huawei.com Signed-off-by: Catalin Marinas commit 9804456e60670cc73f13361a3e628ecdf1bf7ee1 Author: Andy Shevchenko Date: Mon Dec 20 15:24:39 2021 +0200 gpio: Remove unused local OF node pointers After the commit 448cf90513d9 ("gpio: Get rid of duplicate of_node assignment in the drivers") the OF node local pointers become unused. Remove them for good and make compiler happy about. Fixes: 448cf90513d9 ("gpio: Get rid of duplicate of_node assignment in the drivers") Reported-by: Stephen Rothwell Signed-off-by: Andy Shevchenko [Bart: removed unrelated change in gpio-brcmstb] Signed-off-by: Bartosz Golaszewski commit f857acfc457ea63fa5b862d77f055665d863acfe Author: Logan Gunthorpe Date: Wed Nov 17 14:53:48 2021 -0700 lib/scatterlist: cleanup macros into static inline functions Convert the sg_is_chain(), sg_is_last() and sg_chain_ptr() macros into static inline functions. There's no reason for these to be macros and static inline are generally preferred these days. Also introduce the SG_PAGE_LINK_MASK define so the P2PDMA work, which is adding another bit to this mask, can do so more easily. Suggested-by: Jason Gunthorpe Signed-off-by: Logan Gunthorpe Reviewed-by: Chaitanya Kulkarni Signed-off-by: Christoph Hellwig commit 3547a008c8962df2175db1e78b80f27e027ec549 Author: Tedd Ho-Jeong An Date: Mon Dec 13 23:32:14 2021 -0800 Bluetooth: btintel: Add missing quirks and msft ext for legacy bootloader This patch add missing HCI quirks and MSFT extension for legacy bootloader when it is running in the operational firmware. Signed-off-by: Tedd Ho-Jeong An Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit c2ea703dcafccf18d7d77d8b68fb08c2d9842b7a Author: Thomas Hellström Date: Tue Dec 21 21:00:50 2021 +0100 drm/i915: Require the vm mutex for i915_vma_bind() Protect updates of struct i915_vma flags and async binding / unbinding with the vm::mutex. This means that i915_vma_bind() needs to assert vm::mutex held. In order to make that possible drop the caching of kmap_atomic() maps around i915_vma_bind(). An alternative would be to use kmap_local() but since we block cpu unplugging during sleeps inside kmap_local() sections this may have unwanted side-effects. Particularly since we might wait for gpu while holding the vm mutex. This change may theoretically increase execbuf cpu-usage on snb, but at least on non-highmem systems that increase should be very small. Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20211221200050.436316-5-thomas.hellstrom@linux.intel.com commit 63cf4cad7301edafeb0650f32154006f1b5e6e78 Author: Thomas Hellström Date: Tue Dec 21 21:00:49 2021 +0100 drm/i915: Break out the i915_deps utility Since it's starting to be used outside the i915 TTM move code, move it to a separate set of files. v2: - Update the documentation. v4: - Rebase. Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20211221200050.436316-4-thomas.hellstrom@linux.intel.com commit 33654ef470a97f9fcb19abc7e7ef660ea37e3aed Author: Christian König Date: Tue Dec 21 21:00:48 2021 +0100 drm/i915: remove questionable fence optimization during copy First of all as discussed multiple times now kernel copies *must* always wait for all fences in a BO before actually doing the copy. This is mandatory. Additional to that drop the handling when there can't be a shared slot allocated on the source BO and just properly return an error code. Otherwise this code path would only be tested under out of memory conditions. Signed-off-by: Christian König Reviewed-by: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20211221200050.436316-3-thomas.hellstrom@linux.intel.com Signed-off-by: Thomas Hellström commit 1193081710b361ddb4b81d3e2f929b6d6e1f89e1 Author: Thomas Hellström Date: Tue Dec 21 21:00:47 2021 +0100 drm/i915: Avoid using the i915_fence_array when collecting dependencies Since the gt migration code was using only a single fence for dependencies, these were collected in a dma_fence_array. However, it turns out that it's illegal to use some dma_fences in a dma_fence_array, in particular other dma_fence_arrays and dma_fence_chains, and this causes trouble for us moving forward. Have the gt migration code instead take a const struct i915_deps for dependencies. This means we can skip the dma_fence_array creation and instead pass the struct i915_deps instead to circumvent the problem. v2: - Make the prev_deps() function static. (kernel test robot ) - Update the struct i915_deps kerneldoc. v4: - Rebase. Fixes: 5652df829b3c ("drm/i915/ttm: Update i915_gem_obj_copy_ttm() to be asynchronous") Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20211221200050.436316-2-thomas.hellstrom@linux.intel.com commit 31aa7056bbec0259e2ec91db7d3571f66b14f93f Author: Tony Lindgren Date: Fri Dec 17 13:55:59 2021 +0200 ARM: dts: Don't use legacy clock defines for dra7 clkctrl Looks like we are still using legacy clock defines for dra7. We want to stop using these as it prevents dropping the legacy clocks. Note that this is just a cosmetic fix. Cc: Tero Kristo Signed-off-by: Tony Lindgren commit 9206a3af4fc0cebbefca2d79876d279bdd8d582b Author: Tony Lindgren Date: Fri Dec 17 13:55:58 2021 +0200 clk: ti: Move dra7 clock devices out of the legacy section I accidentally added some dra7 clock defines to the legacy section that we want to stop using. Let's move the defines to the right location. Note that this is just a cosmetic fix. Cc: linux-clk@vger.kernel.org Cc: Stephen Boyd Cc: Tero Kristo Acked-by: Rob Herring Signed-off-by: Tony Lindgren commit 42da1cc7bd537ea63ddebf88aedcdafcccb00131 Author: Cheng Wang Date: Mon Dec 20 20:10:53 2021 +0800 ath11k: add support of firmware logging for WCN6855 Host enables WMI firmware logging feature via QMI message. Host receives firmware logging messages on WMI_DIAG_EVENTID, then sends logging messages to user space via event tracing infrastructure. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Signed-off-by: Cheng Wang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211220121053.357087-1-quic_chengwan@quicinc.com commit d943fdad7589653065be0e20aadc6dff37725ed4 Author: Ben Greear Date: Thu Sep 3 12:52:54 2020 -0700 ath11k: Fix napi related hang Similar to the same bug in ath10k, a napi disable w/out it being enabled will hang forever. I believe I saw this while trying rmmod after driver had some failure on startup. Fix it by keeping state on whether napi is enabled or not. And, remove un-used napi pointer in ath11k driver base struct. Signed-off-by: Ben Greear Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20200903195254.29379-1-greearb@candelatech.com commit 9d364b828ae5c51ef732fea2830d278849ca8a3a Author: Jason Wang Date: Tue Dec 21 12:04:20 2021 +0200 ath10k: replace strlcpy with strscpy The strlcpy should not be used because it doesn't limit the source length. So that it 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, replace strlcpy with strscpy. Signed-off-by: Jason Wang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211221070931.725720-1-wangborong@cdjrlc.com commit 1f08917ab929a6939cb0c95d47f928db43f6d3c9 Author: Tariq Toukan Date: Tue Sep 14 14:46:05 2021 +0300 net/mlx5e: Take packet_merge params directly from the RX res struct As packet_merge params structure is saved on the RX resources structure, there is no need to pass it separately. Signed-off-by: Tariq Toukan Reviewed-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed commit fa691d0c9c0812b9045f3a9420862e47b3b92518 Author: Lama Kayal Date: Wed Sep 22 09:32:33 2021 +0300 net/mlx5e: Allocate per-channel stats dynamically at first usage Make stats allocation per-channel dynamic on demand, at channel open operation. Previously the stats array was pre-allocated for the maximum possible number of channels. Here we defer the per-channel stats instance allocation upon its first usage, so that it's allocated only if really needed. Allocating stats on demand helps maintain a more memory-efficient code, as we're saving memory when the used number of channels is smaller than the maximum. The stats memory instances are still freed in mlx5e_priv_arrays_free(), so that they are persistent to channels' closure. Memory size allocated for struct mlx5e_channel_stats is 3648 bytes. If maximum number of channel stands for 64, the total memory space allocated for stats is 3648x64 = 228K bytes. In scenarios where the number of channels in use is significantly smaller than maximum number, the memory saved can be remarkable. Signed-off-by: Lama Kayal Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit be98737a4faa3a0dc1781ced5bbf5c47865e29d7 Author: Tariq Toukan Date: Sun Dec 5 16:04:14 2021 +0200 net/mlx5e: Use dynamic per-channel allocations in stats Make stats array an array of pointer. This patch comes in to prepare for the next patch where allocations of the stats are to be performed dynamically on first usage. Signed-off-by: Lama Kayal Signed-off-by: Tariq Toukan Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed commit 473baf2e9e8c5b3240f443658e9b59dabba9eb9e Author: Tariq Toukan Date: Wed Sep 29 17:29:24 2021 +0300 net/mlx5e: Allow profile-specific limitation on max num of channels Let SF/VF representor's netdev use profile-specific limitation on max_nch to reduce its memory and HW resources consumption. This is particularly important for environments with limited memory and high number of SFs. Signed-off-by: Tariq Toukan Signed-off-by: Vu Pham Reviewed-by: Moshe Shemesh Reviewed-by: Parav Pandit Signed-off-by: Saeed Mahameed commit 0246a57ab5174ea6fe260e946900d5d3d5483dbf Author: Tariq Toukan Date: Thu Sep 2 10:24:06 2021 +0300 net/mlx5e: Save memory by using dynamic allocation in netdev priv Many arrays in priv are statically allocated with a pre-defined maximum (for num channels, num TCs, etc...), that is in some cases significantly larger than the actual maximum. Examples: - The more VFs are supported, the less MSIX vectors each of them could have. This limits the max_nch for each. - Systems with limited number of cores or MSIX (< 64). - Netdev profiles that do not support: QoS (DCB / HTB), PTP TX port timestamping. Here we save some amount of memory by moving several structures and arrays to follow the actual maximum instead. This patch also prepares the code for even more savings to follow. For example, on a system where the maximum num of channel is 8, the channels stats structs alone go down from 3648*64 = 228 KB to 3648*8 = 28.5 KB per interface. This is important for environments with high number of VFs/SFs or limited memory. Signed-off-by: Tariq Toukan Reviewed-by: Moshe Shemesh Reviewed-by: Parav Pandit Signed-off-by: Saeed Mahameed commit 1958c2bddfa260f210c59f10a8ef41e08551aab1 Author: Tariq Toukan Date: Tue Dec 7 08:38:42 2021 +0200 net/mlx5e: Add profile indications for PTP and QOS HTB features Let the profile indicate support of the PTP and HTB (QOS) features. This unifies the logic that calculates the number of netdev queues needed for the features, and allows simplification of mlx5e_create_netdev(), which no longer requires number of rx/tx queues as parameters. Signed-off-by: Tariq Toukan Reviewed-by: Moshe Shemesh Reviewed-by: Aya Levin Signed-off-by: Saeed Mahameed commit 6c72cb05d4b877300cb23df32f7451bdc55d2940 Author: Tariq Toukan Date: Sun Dec 5 12:31:47 2021 +0200 net/mlx5e: Use bitmap field for profile features Use a features bitmap field in mlx5e_profile to declare profile support state of the different features. Let it replace the existing rx_ptp_support boolean. It will be extended to cover more features in a downstream patch. Signed-off-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit 08ab0ff47bf72aa404e35247a48a7070b07fccbf Author: Shaokun Zhang Date: Tue Dec 7 20:35:15 2021 +0800 net/mlx5: Remove the repeated declaration Function 'mlx5_esw_vport_match_metadata_supported' and 'mlx5_esw_offloads_vport_metadata_set' are declared twice, so remove the repeated declaration and blank line. Cc: Saeed Mahameed Cc: Leon Romanovsky Cc: "David S. Miller" Cc: Jakub Kicinski Signed-off-by: Shaokun Zhang Reviewed-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit 8680a60fc1fc19b5bcf50f6cfd9b5d08fc799926 Author: Shay Drory Date: Thu Dec 9 12:09:29 2021 +0200 net/mlx5: Let user configure max_macs generic param Currently, max_macs is taking 70Kbytes of memory per function. This size is not needed in all use cases, and is critical with large scale. Hence, allow user to configure the number of max_macs. For example, to reduce the number of max_macs to 1, execute:: $ devlink dev param set pci/0000:00:0b.0 name max_macs value 1 \ cmode driverinit $ devlink dev reload pci/0000:00:0b.0 Signed-off-by: Shay Drory Reviewed-by: Moshe Shemesh Reviewed-by: Parav Pandit Signed-off-by: Saeed Mahameed commit 0ad598d0be228aca56086ead4e164f7354cd3b57 Author: Shay Drory Date: Thu Dec 9 12:09:28 2021 +0200 devlink: Clarifies max_macs generic devlink param The generic param max_macs documentation isn't clear. Replace it with a more descriptive documentation Signed-off-by: Shay Drory Reviewed-by: Jiri Pirko Signed-off-by: Saeed Mahameed commit 57ca767820ade09ee3e3c53bfeb5543ba7c00ab0 Author: Shay Drory Date: Thu Dec 9 12:09:27 2021 +0200 net/mlx5: Let user configure event_eq_size param Event EQ is an EQ which received the notification of almost all the events generated by the NIC. Currently, each event EQ is taking 512KB of memory. This size is not needed in most use cases, and is critical with large scale. Hence, allow user to configure the size of the event EQ. For example to reduce event EQ size to 64, execute:: $ devlink dev param set pci/0000:00:0b.0 name event_eq_size value 64 \ cmode driverinit $ devlink dev reload pci/0000:00:0b.0 Signed-off-by: Shay Drory Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed commit 0b5705ebc355e79b71bf946058acec6820e27869 Author: Shay Drory Date: Thu Dec 9 12:09:26 2021 +0200 devlink: Add new "event_eq_size" generic device param Add new device generic parameter to determine the size of the asynchronous control events EQ. For example, to reduce event EQ size to 64, execute: $ devlink dev param set pci/0000:06:00.0 \ name event_eq_size value 64 cmode driverinit $ devlink dev reload pci/0000:06:00.0 Signed-off-by: Shay Drory Reviewed-by: Moshe Shemesh Reviewed-by: Jiri Pirko Signed-off-by: Saeed Mahameed commit 0844fa5f7b8921e730d971adb5267002b6dd66a0 Author: Shay Drory Date: Thu Dec 9 12:09:25 2021 +0200 net/mlx5: Let user configure io_eq_size param Currently, each I/O EQ is taking 128KB of memory. This size is not needed in all use cases, and is critical with large scale. Hence, allow user to configure the size of I/O EQs. For example, to reduce I/O EQ size to 64, execute: $ devlink dev param set pci/0000:00:0b.0 name io_eq_size value 64 \ cmode driverinit $ devlink dev reload pci/0000:00:0b.0 Signed-off-by: Shay Drory Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed commit 47402385d0b18ba46c6bfc4cff073c9359571fe4 Author: Shay Drory Date: Thu Dec 9 12:09:24 2021 +0200 devlink: Add new "io_eq_size" generic device param Add new device generic parameter to determine the size of the I/O completion EQs. For example, to reduce I/O EQ size to 64, execute: $ devlink dev param set pci/0000:06:00.0 \ name io_eq_size value 64 cmode driverinit $ devlink dev reload pci/0000:06:00.0 Signed-off-by: Shay Drory Reviewed-by: Moshe Shemesh Reviewed-by: Jiri Pirko Signed-off-by: Saeed Mahameed commit 760cceff996135fd4830f3d339446a04bd37ca0c Author: Inki Dae Date: Wed Dec 1 11:32:14 2021 +0900 drm/exynos: drop the use of label from exynos_dsi_register_te_irq Dropped the use of 'out' label from exynos_dsi_register_te_irq function because the label isn't needed. This patch returns an error in each error case directly not going to 'out' label. With this patch build warning[1] is also fixed, which was reported by kernel test robot [1] https://www.spinics.net/lists/dri-devel/msg323803.html Reported-by: kernel test robot Signed-off-by: Inki Dae commit 28b0d549f94a368dea4b999fbd60fe9ff49b243d Author: Bernard Zhao Date: Sun Nov 14 23:23:59 2021 -0800 drm/exynos: remove useless type conversion This change is to cleanup the code a bit. Signed-off-by: Bernard Zhao Signed-off-by: Inki Dae commit 2043e6f6d5c5fb037c6459e2aa54b1c034c6759d Author: Thomas Zimmermann Date: Mon Nov 8 11:28:44 2021 +0100 drm/exynos: 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 exynos functions are being removed. The file_operations structure exynos_drm_driver_fops is now being created by the helper macro DEFINE_DRM_GEM_FOPS(). Signed-off-by: Thomas Zimmermann Acked-by: Daniel Vetter Fixed merge conflict. Signed-off-by: Inki Dae commit ee6c8b5afa62f4227174c68f1db75fe775c68328 Author: Maíra Canal Date: Mon Nov 1 23:20:03 2021 -0300 drm/exynos: Replace legacy gpio interface for gpiod interface Considering the current transition of the GPIO subsystem, remove all dependencies of the legacy GPIO interface (linux/gpio.h and linux /of_gpio.h) and replace it with the descriptor-based GPIO approach. Signed-off-by: Maíra Canal Signed-off-by: Inki Dae commit ce852837335abc874e4d943ebbbe7432465a413b Author: Andy Shevchenko Date: Thu Dec 16 17:12:27 2021 +0200 pinctrl: Propagate firmware node from a parent device When creating MFD platform devices the firmware node is left unset. This, in particular, prevents GPIO library to use it for different purposes. Propagate firmware node from the parent device and let GPIO library do the right thing. While at it, slightly modify the headers to reflect the usage of APIs. Signed-off-by: Andy Shevchenko Acked-by: Charles Keepax Reviewed-by: Adam Thomson Link: https://lore.kernel.org/r/20211216151227.58687-1-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 744d04fb4836cc1778cbe853fcac503794ba6fdf Author: Vamsi Krishna Lanka Date: Thu Dec 16 15:18:45 2021 -0800 dt-bindings: pinctrl: qcom: Add SDX65 pinctrl bindings Add device tree binding Documentation details for Qualcomm SDX65 pinctrl driver. Signed-off-by: Vamsi Krishna Lanka Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/ff9abf953c274a1e34f59114642f67ecf02acb6f.1639696427.git.quic_vamslank@quicinc.com Signed-off-by: Linus Walleij commit bd0aae66c4820897797ab550acddd8c659a10b10 Author: Rafał Miłecki Date: Thu Dec 16 17:22:06 2021 +0100 pinctrl: add one more "const" for generic function groups Generic code doesn't modify those strings and .get_function_groups callback has that extra "const" as well. This allows more flexibility in GENERIC_PINMUX_FUNCTIONS users. Signed-off-by: Rafał Miłecki Link: https://lore.kernel.org/r/20211216162206.8027-4-zajec5@gmail.com Signed-off-by: Linus Walleij commit c26c4bfc10401415b3a5c5a83b94095d7c425617 Author: Rafał Miłecki Date: Thu Dec 16 17:22:05 2021 +0100 pinctrl: keembay: rework loops looking for groups names Make the outer loop iterate over functions as that's the real subject. This simplifies code (and reduces amount of lines of code) as allocating memory for names doesn't require extra checks anymore. While at it use local "group_names" variable. The plan for "struct function_desc" is to make its "group_names" /double/ const. That will allow drivers to use it with static const data. This keembay "group_names" change is required to avoid: drivers/pinctrl/pinctrl-keembay.c: In function 'keembay_add_functions': drivers/pinctrl/pinctrl-keembay.c:1594:8: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] 1594 | grp = func->group_names; | ^ Signed-off-by: Rafał Miłecki Link: https://lore.kernel.org/r/20211216162206.8027-3-zajec5@gmail.com Signed-off-by: Linus Walleij commit 5d0674999cc5caec72130ad8ff3a211d153bcef5 Author: Rafał Miłecki Date: Thu Dec 16 17:22:04 2021 +0100 pinctrl: keembay: comment process of building functions a bit This should make code a bit easier to follow. While at it use some "for" loops to simplify array iteration loops. Signed-off-by: Rafał Miłecki Link: https://lore.kernel.org/r/20211216162206.8027-2-zajec5@gmail.com Signed-off-by: Linus Walleij commit 02f117134952c06faef2adb322630c51fcd3c197 Author: Rafał Miłecki Date: Thu Dec 16 17:22:03 2021 +0100 pinctrl: imx: prepare for making "group_names" in "function_desc" const The plan for "struct function_desc" is to make its "group_names" /double/ const. That will allow drivers to use it with static const data. This imx change is required to avoid: drivers/pinctrl/freescale/pinctrl-imx.c: In function 'imx_pinctrl_parse_functions': drivers/pinctrl/freescale/pinctrl-imx.c:672:24: error: assignment of read-only location '*(func->group_names + (sizetype)(i * 4))' 672 | func->group_names[i] = child->name; | ^ Signed-off-by: Rafał Miłecki Link: https://lore.kernel.org/r/20211216162206.8027-1-zajec5@gmail.com Signed-off-by: Linus Walleij commit f4f2970dfd87e5132c436e6125148914596a9863 Merge: b3ec7248f1f4b 37cf276df1014 Author: Jakub Kicinski Date: Tue Dec 21 17:20:31 2021 -0800 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-12-21 This series contains updates to igc, igb, igbvf, and fm10k drivers. Sasha removes unused defines and enum values from igc driver. Jason Wang removes a variable whose value never changes and, instead, returns the value directly for igb. Karen adjusts a reset message from warning to info for igbvf. Xiang wangx removes a repeated word for fm10k. * '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue: fm10k: Fix syntax errors in comments igbvf: Refactor trace igb: remove never changed variable `ret_val' igc: Remove obsolete define igc: Remove obsolete mask igc: Remove obsolete nvm type igc: Remove unused phy type igc: Remove unused _I_PHY_ID define ==================== Link: https://lore.kernel.org/r/20211221180200.3176851-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski commit b3ec7248f1f4b9d0352793b95d8ad063e89e9f6f Author: Divya Koppera Date: Tue Dec 21 16:52:17 2021 +0530 net: phy: micrel: Adding interrupt support for Link up/Link down in LAN8814 Quad phy This patch add support for Link up or Link down interrupt support in LAN8814 Quad phy Signed-off-by: Divya Koppera Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20211221112217.9502-1-Divya.Koppera@microchip.com Signed-off-by: Jakub Kicinski commit 1a1a0b0364ad291bd8e509da104ac8b5b1afec5d Author: Paul Chaignon Date: Mon Dec 20 22:45:28 2021 +0100 bpftool: Enable line buffering for stdout The output of bpftool prog tracelog is currently buffered, which is inconvenient when piping the output into other commands. A simple tracelog | grep will typically not display anything. This patch fixes it by enabling line buffering on stdout for the whole bpftool binary. Fixes: 30da46b5dc3a ("tools: bpftool: add a command to dump the trace pipe") Signed-off-by: Quentin Monnet Signed-off-by: Paul Chaignon Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20211220214528.GA11706@Mem commit 0dd668d2080c46cf914e131f341fa114a34c5a20 Author: Xiu Jianfeng Date: Mon Dec 20 19:30:48 2021 +0800 bpf: Use struct_size() helper In an effort to avoid open-coded arithmetic in the kernel, use the struct_size() helper instead of open-coded calculation. Signed-off-by: Xiu Jianfeng Signed-off-by: Andrii Nakryiko Acked-by: Yonghong Song Link: https://github.com/KSPP/linux/issues/160 Link: https://lore.kernel.org/bpf/20211220113048.2859-1-xiujianfeng@huawei.com commit dd621ee0cf8eb32445c8f5f26d3b7555953071d8 Author: Eric W. Biederman Date: Tue Dec 21 11:41:14 2021 -0600 kthread: Warn about failed allocations for the init kthread Failed allocates are not expected when setting up the initial task and it is not really possible to handle them either. So I added a warning to report if such an allocation failure ever happens. Correct the sense of the warning so it warns when an allocation failure happens not when the allocation succeeded. Oops. Reported-by: kernel test robot Reported-by: Stephen Rothwell Reported-by: Naresh Kamboju Link: https://lkml.kernel.org/r/20211221231611.785b74cf@canb.auug.org.au Link: https://lkml.kernel.org/r/CA+G9fYvLaR5CF777CKeWTO+qJFTN6vAvm95gtzN+7fw3Wi5hkA@mail.gmail.com Link: https://lkml.kernel.org/r/20211216102956.GC10708@xsang-OptiPlex-9020 Fixes: 40966e316f86 ("kthread: Ensure struct kthread is present for all kthreads") Signed-off-by: "Eric W. Biederman" commit d2666be51d5f09662929888dd84d1f4d38c97127 Author: Zijun Hu Date: Thu Dec 9 14:34:01 2021 +0800 Bluetooth: btusb: Add two more Bluetooth parts for WCN6855 Add USB IDs (0x10ab, 0x9309) and (0x10ab, 0x9409) to usb_device_id table for WCN6855. * /sys/kernel/debug/usb/devices T: Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 10 Spd=12 MxCh= 0 D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=10ab ProdID=9309 Rev= 0.01 C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms I: If#= 1 Alt= 6 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 63 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 63 Ivl=1ms I: If#= 1 Alt= 7 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 65 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 65 Ivl=1ms T: Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 11 Spd=12 MxCh= 0 D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=10ab ProdID=9409 Rev= 0.01 C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms I: If#= 1 Alt= 6 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 63 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 63 Ivl=1ms I: If#= 1 Alt= 7 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 65 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 65 Ivl=1ms Signed-off-by: Zijun Hu Signed-off-by: Marcel Holtmann Signed-off-by: Luiz Augusto von Dentz commit 30d57722732d9736554f85f75f9d7ad5402d192e Author: Luiz Augusto von Dentz Date: Wed Dec 8 15:35:48 2021 -0800 Bluetooth: L2CAP: Fix using wrong mode If user has a set to use SOCK_STREAM the socket would default to L2CAP_MODE_ERTM which later needs to be adjusted if the destination address is LE which doesn't support such mode. Fixes: 15f02b9105625 ("Bluetooth: L2CAP: Add initial code for Enhanced Credit Based Mode") Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 9446bdde51ac9cc8023c732ec0cc05e820ae8d20 Author: Luiz Augusto von Dentz Date: Wed Dec 8 15:43:24 2021 -0800 Bluetooth: hci_sync: Fix not always pausing advertising when necessary hci_pause_advertising_sync shall always pause advertising until hci_resume_advertising_sync but instance 0x00 doesn't count in adv_instance_cnt so it was causing it to be skipped. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit e96741437ef0a5d18144e790ac894397efda0924 Author: Luiz Augusto von Dentz Date: Fri Dec 3 16:15:42 2021 -0800 Bluetooth: mgmt: Make use of mgmt_send_event_skb in MGMT_EV_DEVICE_CONNECTED This makes use of mgmt_alloc_skb to build MGMT_EV_DEVICE_CONNECTED so the data is copied directly to skb that is then sent using mgmt_send_event_skb eliminating the necessity of intermediary buffers. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit cf1bce1de7eeb9b48259662cdce5c9d6842a1599 Author: Luiz Augusto von Dentz Date: Fri Dec 3 16:15:41 2021 -0800 Bluetooth: mgmt: Make use of mgmt_send_event_skb in MGMT_EV_DEVICE_FOUND This makes use of mgmt_alloc_skb to build MGMT_EV_DEVICE_FOUND so the data is copied directly to skb that is then sent using mgmt_send_event_skb eliminating the necessity of intermediary buffers. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit b9f6fbb3b2c29736970ae9fcc0e82b0bd459442b Author: Alexandre Truong Date: Fri Dec 17 15:45:20 2021 +0000 perf arm64: Inject missing frames when using 'perf record --call-graph=fp' When unwinding using frame pointers on ARM64, the return address of the current function may not have been pushed into the stack when a function was interrupted, which makes perf show an incorrect call graph to the user. Consider the following example program: void leaf() { /* long computation */ } void parent() { // (1) leaf(); // (2) } ... could be compiled into (using gcc -fno-inline -fno-omit-frame-pointer): leaf: /* long computation */ nop ret parent: // (1) stp x29, x30, [sp, -16]! mov x29, sp bl parent nop ldp x29, x30, [sp], 16 // (2) ret If the program is interrupted at (1), (2), or any point in "leaf:", the call graph will skip the callers of the current function. We can unwind using the dwarf info and check if the return addr is the same as the LR register, and inject the missing frame into the call graph. Before this patch, the above example shows the following call-graph when recording using "--call-graph fp" mode in ARM64: # Children Self Command Shared Object Symbol # ........ ........ ........ ................ ...................... # 99.86% 99.86% program3 program3 [.] leaf | ---_start __libc_start_main main leaf As can be seen, the "parent" function is missing. This is specially problematic in "leaf" because for leaf functions the compiler may always omit pushing the return addr into the stack. After this patch, it shows the correct graph: # Children Self Command Shared Object Symbol # ........ ........ ........ ................ ...................... # 99.86% 99.86% program3 program3 [.] leaf | ---_start __libc_start_main main parent leaf Reviewed-by: James Clark Signed-off-by: Alexandre Truong Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: John Garry Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Namhyung Kim Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20211217154521.80603-7-german.gomez@arm.com Signed-off-by: German Gomez [ Rename machine__normalize_is() to machine__normalized_is(), as suggested by James Clark ] Signed-off-by: Arnaldo Carvalho de Melo commit ffc60350489db9f6e3010ac1e795078cb0d06efe Author: German Gomez Date: Fri Dec 17 15:45:19 2021 +0000 perf tools: Refactor SMPL_REG macro in perf_regs.h Refactor the SAMPL_REG macro so that it can be used in a followup commit to obtain the masks for ARM64 registers. Reviewed-by: James Clark Signed-off-by: German Gomez Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: John Garry Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Namhyung Kim Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20211217154521.80603-6-german.gomez@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit aa8db3e41dae953b636ff68e944479900d149a37 Author: Alexandre Truong Date: Fri Dec 17 15:45:18 2021 +0000 perf callchain: Enable dwarf_callchain_users on arm64 Enable dwarf_callchain_users on arm64 which will be needed to do a DWARF unwind in order to get the caller of the leaf frame. Reviewed-by: James Clark Signed-off-by: Alexandre Truong Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: John Garry Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Namhyung Kim Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20211217154521.80603-5-german.gomez@arm.com Signed-off-by: German Gomez Signed-off-by: Arnaldo Carvalho de Melo commit ab23692134489f0f563168449fc27bfb5d6b04dd Author: Alexandre Truong Date: Fri Dec 17 15:45:17 2021 +0000 perf script: Use callchain_param_setup() instead of open coded equivalent Refactoring script__setup_sample_type() by using callchain_param_setup() to replace the duplicate code for callchain parameter setting up. Reviewed-by: James Clark Signed-off-by: Alexandre Truong Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: John Garry Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Namhyung Kim Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20211217154521.80603-4-german.gomez@arm.com Signed-off-by: German Gomez Signed-off-by: Arnaldo Carvalho de Melo commit 32bfa5bf71db672c646751da131a17aace8cceac Author: Alexandre Truong Date: Fri Dec 17 15:45:16 2021 +0000 perf machine: Add a mechanism to inject stack frames Add a mechanism for platforms to inject stack frames for the leaf frame caller if there is enough information to determine a frame is missing from dwarf or other post processing mechanisms. Reviewed-by: James Clark Signed-off-by: Alexandre Truong Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: John Garry Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Namhyung Kim Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20211217154521.80603-3-german.gomez@arm.com Signed-off-by: German Gomez Signed-off-by: Arnaldo Carvalho de Melo commit 7248e308a57587615431b83689cd57e957815bfc Author: Alexandre Truong Date: Fri Dec 17 15:45:15 2021 +0000 perf tools: Record ARM64 LR register automatically On ARM64, automatically record the link register if the frame pointer mode is on. It will be used to do a dwarf unwind to find the caller of the leaf frame if the frame pointer was omitted. Reviewed-by: James Clark Signed-off-by: Alexandre Truong Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: John Garry Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Namhyung Kim Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20211217154521.80603-2-german.gomez@arm.com Signed-off-by: German Gomez Signed-off-by: Arnaldo Carvalho de Melo commit f8464e084dd3c4cf37bdbeb06fea0afbd2e0f4e8 Author: Carsten Haitzler Date: Wed Dec 15 16:03:54 2021 +0000 perf test: Use 3 digits for test numbering now we can have more tests This is in preparation for adding more tests that will need the test number to be 3 digts so they align nicely in the output. Reviewed-by: Leo Yan Signed-off-by: Carsten Haitzler Cc: Mathieu Poirier Cc: Mike Leach Cc: Suzuki Poulouse Cc: coresight@lists.linaro.org Link: http://lore.kernel.org/lkml/20211215160403.69264-3-carsten.haitzler@foss.arm.com Signed-off-by: Arnaldo Carvalho de Melo commit ce72750f04d68a45ef971c3547fe2d6f9cd4756e Author: Sjoerd Simons Date: Fri Nov 5 09:10:51 2021 +0100 hostfs: Fix writeback of dirty pages Hostfs was not setting up the backing device information, which means it uses the noop bdi. The noop bdi does not have the writeback capability enabled, which in turns means dirty pages never got written back to storage. In other words programs using mmap to write to files on hostfs never actually got their data written out... Fix this by simply setting up the bdi with default settings as all the required code for writeback is already in place. Signed-off-by: Sjoerd Simons Reviewed-by: Christopher Obbard Tested-by: Ritesh Raj Sarraf Acked-By: Anton Ivanov Signed-off-by: Richard Weinberger commit 9b0da3f22307af693be80f5d3a89dc4c7f360a85 Author: Yang Guang Date: Fri Nov 5 14:12:59 2021 +0800 um: Use swap() to make code cleaner Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid opencoding it. Reported-by: Zeal Robot Signed-off-by: Yang Guang Signed-off-by: Richard Weinberger commit 4c1f795773b3ef6e206ef84bc6a928803fa31b7d Author: Al Viro Date: Mon Sep 20 21:33:01 2021 +0000 um: header debriding - sigio.h Signed-off-by: Al Viro Signed-off-by: Richard Weinberger commit 021fdaef807387113d8e7ec27b954b03cff7ff88 Author: Al Viro Date: Mon Sep 20 21:33:00 2021 +0000 um: header debriding - os.h Signed-off-by: Al Viro Signed-off-by: Richard Weinberger commit b31ef6d89ddd3c24f28c969336d5f4bf6054a9d1 Author: Al Viro Date: Mon Sep 20 21:32:59 2021 +0000 um: header debriding - net_*.h externs dead since before the initial merge Signed-off-by: Al Viro Signed-off-by: Richard Weinberger commit bb1a2c4e2d48349f522fed3146a059135e0e5ac9 Author: Al Viro Date: Mon Sep 20 21:32:58 2021 +0000 um: header debriding - mem_user.h get_vm(), add_iomem(), phys_offset() dead since 2004; init_mem_user() and setup_memory() - since before the initial merge. Signed-off-by: Al Viro Signed-off-by: Richard Weinberger commit ed4b1cc5900ecf67b70906a01850ba4ee11503c0 Author: Al Viro Date: Mon Sep 20 21:32:57 2021 +0000 um: header debriding - activate_ipi() ... had been dead for 15 years. Signed-off-by: Al Viro Signed-off-by: Richard Weinberger commit 8e5d7cf3479abfc9c331a2d7faec0bac2b6f327a Author: Al Viro Date: Mon Sep 20 21:32:56 2021 +0000 um: common-offsets.h debriding... Signed-off-by: Al Viro Signed-off-by: Richard Weinberger commit 2610ed63ead1e394f9f4a7e3518f2f589d10ee32 Author: Al Viro Date: Mon Sep 20 21:32:55 2021 +0000 um, x86: bury crypto_tfm_ctx_offset unused since 2011 Signed-off-by: Al Viro Signed-off-by: Richard Weinberger commit 21cba62bea84339ccdb7c40237dda8d5ba167c75 Author: Al Viro Date: Mon Sep 20 21:32:54 2021 +0000 um: unexport handle_page_fault() Signed-off-by: Al Viro Signed-off-by: Richard Weinberger commit 7f5f156daec393d3f3433866dcc4d5c452f7feb6 Author: Al Viro Date: Mon Sep 20 21:32:53 2021 +0000 um: remove a dangling extern of syscall_trace() the function had been gone since 2012... Signed-off-by: Al Viro Signed-off-by: Richard Weinberger commit 6605a448668b9d03aa94fbd6be42612d49aa45c6 Author: Al Viro Date: Mon Sep 20 21:32:52 2021 +0000 um: kill unused cpu() Signed-off-by: Al Viro Signed-off-by: Richard Weinberger commit 2098e213dd64b1d10b8fc6fc66e3a2a80f841dbe Author: Al Viro Date: Mon Sep 20 21:32:51 2021 +0000 uml/i386: missing include in barrier.h we need cpufeatures.h there Signed-off-by: Al Viro Signed-off-by: Richard Weinberger commit dbba7f704aa0c38e36c9908012e7592c8f6efc43 Author: Al Viro Date: Mon Sep 20 21:32:50 2021 +0000 um: stop polluting the namespace with registers.h contents Only one extern in there is needed in processor-generic.h, and it's not needed anywhere else. So move it over there and get rid of the include in processor-generic.h, adding includes of registers.h to the few files that need the declarations in it. Signed-off-by: Al Viro Signed-off-by: Richard Weinberger commit 5f174ec3c1d62013f86db6597249174d8cb227b2 Author: Al Viro Date: Mon Sep 20 21:32:49 2021 +0000 logic_io instance of iounmap() needs volatile on argument ... same as the rest of implementations Signed-off-by: Al Viro Signed-off-by: Richard Weinberger commit 577ade59b99e3473b2f1342b1eb9e496eed39b68 Author: Al Viro Date: Mon Sep 20 21:32:48 2021 +0000 um: move amd64 variant of mmap(2) to arch/x86/um/syscalls_64.c Signed-off-by: Al Viro Signed-off-by: Richard Weinberger commit 8f5c84f3678e72bbba96b0755135adae66d35c0e Author: Al Viro Date: Mon Sep 20 21:32:47 2021 +0000 uml: trim unused junk from arch/x86/um/sys_call_table_*.c a bunch of detritus there - definitions that are never expanded or checked. Signed-off-by: Al Viro Signed-off-by: Richard Weinberger commit 85e73968a040c642fd38f6cba5b73b61f5d0f052 Author: Johannes Berg Date: Thu Sep 16 13:09:22 2021 +0200 um: virtio_uml: Fix time-travel external time propagation When creating an external event, the current time needs to be propagated to other participants of a simulation. This is done in the places here where we kick a virtq etc. However, it must be done for _all_ external events, and that includes making the initial socket connection and later closing it. Call time_travel_propagate_time() to do this before making or closing the socket connection. Apparently, at least for the initial connection creation, due to the remote side in my use cases using microseconds (rather than nanoseconds), this wasn't a problem yet; only started failing between 5.14-rc1 and 5.15-rc1 (didn't test others much), or possibly depending on the configuration, where more delays happen before the virtio devices are initialized. Fixes: 88ce64249233 ("um: Implement time-travel=ext") Signed-off-by: Johannes Berg Signed-off-by: Richard Weinberger commit 4e8a5edac5010820e7c5303fc96f5a262e096bb6 Author: Johannes Berg Date: Wed Sep 15 20:30:22 2021 +0200 lib/logic_iomem: Fix operation on 32-bit On 32-bit, the first entry might be at 0/NULL, but that's strange and leads to issues, e.g. where we check "if (ret)". Use a IOREMAP_BIAS/IOREMAP_MASK of 0x80000000UL to avoid this. This then requires reducing the number of areas (via MAX_AREAS), but we still have 128 areas, which is enough. Fixes: ca2e334232b6 ("lib: add iomem emulation (logic_iomem)") Signed-off-by: Johannes Berg Signed-off-by: Richard Weinberger commit 4e84139e14af5ea60772cc4f33d7059aec76e0eb Author: Johannes Berg Date: Wed Sep 15 20:30:21 2021 +0200 lib/logic_iomem: Fix 32-bit build On a 32-bit build, the (unsigned long long) casts throw warnings (or errors) due to being to a different integer size. Cast to uintptr_t first (with the __force for sparse) and then further to get the consistent print on 32 and 64-bit. Fixes: ca2e334232b6 ("lib: add iomem emulation (logic_iomem)") Reported-by: Al Viro Signed-off-by: Johannes Berg Signed-off-by: Richard Weinberger commit d73820df6437b5d0a57be53faf39db46a0264b3a Author: Johannes Berg Date: Wed Sep 15 20:30:20 2021 +0200 um: virt-pci: Fix 32-bit compile There were a few 32-bit compile warnings that of course turned into errors with -Werror, fix the 32-bit build. Fixes: 68f5d3f3b654 ("um: add PCI over virtio emulation driver") Reported-by: Al Viro Signed-off-by: Johannes Berg Signed-off-by: Richard Weinberger commit 4b86366fdfbedec42f8f7ee037775f2839921d34 Author: Johannes Berg Date: Mon Sep 13 10:17:29 2021 +0200 um: gitignore: Add kernel/capflags.c This file is generated, we should ignore it. Fixes: d8fb32f4790f ("um: Add support for host CPU flags and alignment") Signed-off-by: Johannes Berg Acked-By: anton.ivanov@cambridgegreys.com Signed-off-by: Richard Weinberger commit 077b7320942b64b0da182aefd83c374462a65535 Author: Randy Dunlap Date: Sun Sep 12 23:12:52 2021 -0700 um: registers: Rename function names to avoid conflicts and build problems The function names init_registers() and restore_registers() are used in several net/ethernet/ and gpu/drm/ drivers for other purposes (not calls to UML functions), so rename them. This fixes multiple build errors. Signed-off-by: Randy Dunlap Cc: Jeff Dike Cc: Richard Weinberger Cc: Anton Ivanov Cc: linux-um@lists.infradead.org Signed-off-by: Richard Weinberger commit 8bd18ef9eaac2e812b42da9eb19b2d59293aa25b Author: Changcheng Deng Date: Fri Aug 27 18:11:08 2021 -0700 um: Replace if (cond) BUG() with BUG_ON() Fix the following coccinelle reports: ./arch/um/kernel/mem.c:89:2-5: WARNING: Use BUG_ON instead of if condition followed by BUG. Reported-by: Zeal Robot Signed-off-by: Changcheng Deng Signed-off-by: Richard Weinberger commit 6cd9d4b97891560b61681cad9cc4307ce0719abc Author: Paul Moore Date: Tue Dec 21 15:01:29 2021 -0500 selinux: minor tweaks to selinux_add_opt() Two minor edits to selinux_add_opt(): use "sizeof(*ptr)" instead of "sizeof(type)" in the kzalloc() call, and rename the "Einval" jump target to "err" for the sake of consistency. Signed-off-by: Paul Moore commit 494545aa9b50a1dcaafcb235e2cb40b246c65169 Author: Johannes Berg Date: Tue Sep 28 11:51:46 2021 +0200 uml: x86: add FORCE to user_constants.h The build system has started warning when filechk is called without FORCE: arch/x86/um/Makefile:44: FORCE prerequisite is missing Add FORCE to make sure the file is checked/rebuilt when necessary (and to quiet up the warning.) Signed-off-by: Johannes Berg Reviewed-by: David Gow Signed-off-by: Richard Weinberger commit bbe33504d4a7fdab9011211e55e262c869b3f6cc Author: Johannes Berg Date: Tue Aug 31 09:11:15 2021 +0200 um: rename set_signals() to um_set_signals() Rename set_signals() as there's at least one driver that uses the same name and can now be built on UM due to PCI support, and thus we can get symbol conflicts. Also rename set_signals_trace() to be consistent. Reported-by: kernel test robot Fixes: 68f5d3f3b654 ("um: add PCI over virtio emulation driver") Signed-off-by: Johannes Berg Signed-off-by: Richard Weinberger commit 5f8539e2ff962e25b57742ca7106456403abbc94 Author: Johannes Berg Date: Tue Aug 31 09:27:53 2021 +0200 um: fix ndelay/udelay defines Many places in the kernel use 'udelay' as an identifier, and are broken with the current "#define udelay um_udelay". Fix this by adding an argument to the macro, and do the same to 'ndelay' as well, just in case. Fixes: 0bc8fb4dda2b ("um: Implement ndelay/udelay in time-travel mode") Reported-by: kernel test robot Signed-off-by: Johannes Berg Signed-off-by: Richard Weinberger commit 07979f09a01e3a3e3bc87064663ffcb7388e0f7f Author: Rob Herring Date: Fri Dec 17 10:54:18 2021 -0600 dt-bindings: arm,cci-400: Drop the PL330 from example The PL330 was commented out because its binding wasn't converted to a schema. With the binding converted, the example now needs several updates. However, while it's possible that the PL330 has a 'cci-control-port', there aren't any platforms upstream which do. So rather than allowing 'cci-control-port' in the PL330 binding, let's just drop the example. Cc: Lorenzo Pieralisi Signed-off-by: Rob Herring commit 034c253915db0aaf99e3358d6d53d3428b643fcf Author: Stanislav Jakubek Date: Sat Dec 18 15:49:27 2021 +0100 dt-bindings: arm: ux500: Document missing compatibles These compatibles are used in Ux500 device trees, but were not documented so far. Add them to the schema to document them. Signed-off-by: Stanislav Jakubek Reviewed-by: Linus Walleij Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211218144927.GA6388@standask-GA-A55M-S2HP commit 3a8e53e21fc8f894d1522f44eff5c3692b70afe9 Author: Thierry Reding Date: Fri Dec 17 18:00:42 2021 +0100 dt-bindings: power: reset: gpio-restart: Convert to json-schema Convert the GPIO restart bindings from the free-form text format to json-schema. Signed-off-by: Thierry Reding Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211217170042.2740058-1-thierry.reding@gmail.com commit 2e08df3c7c4e4e74e3dd5104c100f0bf6288aaa8 Author: Bernard Zhao Date: Fri Dec 10 04:03:58 2021 -0800 selinux: fix potential memleak in selinux_add_opt() This patch try to fix potential memleak in error branch. Fixes: ba6418623385 ("selinux: new helper - selinux_add_opt()") Signed-off-by: Bernard Zhao [PM: tweak the subject line, add Fixes tag] Signed-off-by: Paul Moore commit 2bed2ced40c97b8540ff38df0149e8ecb2bf4c65 Author: Jiacheng Shi Date: Sun Dec 12 01:16:00 2021 -0800 vfio/iommu_type1: replace kfree with kvfree Variables allocated by kvzalloc should not be freed by kfree. Because they may be allocated by vmalloc. So we replace kfree with kvfree here. Fixes: d6a4c185660c ("vfio iommu: Implementation of ioctl for dirty pages tracking") Signed-off-by: Jiacheng Shi Link: https://lore.kernel.org/r/20211212091600.2560-1-billsjc@sjtu.edu.cn Signed-off-by: Alex Williamson commit 21ab799585762e097387da82a4e0fd6c2ffb4000 Author: Alex Williamson Date: Wed Dec 1 16:45:41 2021 -0700 vfio/pci: Resolve sparse endian warnings in IGD support Sparse warns: sparse warnings: (new ones prefixed by >>) >> drivers/vfio/pci/vfio_pci_igd.c:146:21: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [addressable] [usertype] val @@ got restricted __le16 [usertype] @@ drivers/vfio/pci/vfio_pci_igd.c:146:21: sparse: expected unsigned short [addressable] [usertype] val drivers/vfio/pci/vfio_pci_igd.c:146:21: sparse: got restricted __le16 [usertype] >> drivers/vfio/pci/vfio_pci_igd.c:161:21: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int [addressable] [usertype] val @@ got restricted __le32 [usertype] @@ drivers/vfio/pci/vfio_pci_igd.c:161:21: sparse: expected unsigned int [addressable] [usertype] val drivers/vfio/pci/vfio_pci_igd.c:161:21: sparse: got restricted __le32 [usertype] drivers/vfio/pci/vfio_pci_igd.c:176:21: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [addressable] [usertype] val @@ got restricted __le16 [usertype] @@ drivers/vfio/pci/vfio_pci_igd.c:176:21: sparse: expected unsigned short [addressable] [usertype] val drivers/vfio/pci/vfio_pci_igd.c:176:21: sparse: got restricted __le16 [usertype] These are due to trying to use an unsigned to store the result of a cpu_to_leXX() conversion. These are small variables, so pointer tricks are wasteful and casting just generates different sparse warnings. Store to and copy results from a separate little endian variable. Reported-by: kernel test robot Link: https://lore.kernel.org/r/202111290026.O3vehj03-lkp@intel.com/ Link: https://lore.kernel.org/r/163840226123.138003.7668320168896210328.stgit@omen Signed-off-by: Alex Williamson commit 1c40d40f6835cdee99c6966b48b98d0e38c35f47 Author: Vinay Belgaumkar Date: Thu Dec 16 15:30:22 2021 -0800 drm/i915/guc: Request RP0 before loading firmware By default, GT (and GuC) run at RPn. Requesting for RP0 before firmware load can speed up DMA and HuC auth as well. In addition to writing to 0xA008, we also need to enable swreq in 0xA024 so that Punit will pay heed to our request. SLPC will restore the frequency back to RPn after initialization, but we need to manually do that for the non-SLPC path. We don't need a manual override in the SLPC disabled case, just use the intel_rps_set function to ensure consistent RPS state. Signed-off-by: Vinay Belgaumkar Reviewed-by: Sujaritha Sundaresan Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20211216233022.21351-1-vinay.belgaumkar@intel.com commit 4d7bd0eb72e5831ddb1288786a96448b48440825 Author: Matthew Wilcox (Oracle) Date: Mon Dec 20 19:03:46 2021 -0500 iomap: Inline __iomap_zero_iter into its caller To make the merge easier, replicate the inlining of __iomap_zero_iter() into iomap_zero_iter() that is currently in the nvdimm tree. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Darrick J. Wong commit c545a70dd2a1211c33de3a09102691145acc5b35 Author: Andy Shevchenko Date: Fri Dec 10 18:30:09 2021 +0200 platform/x86: asus-wmi: Reshuffle headers for better maintenance Reshuffle headers in alphabetical order for better maintenance. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211210163009.19894-3-andriy.shevchenko@linux.intel.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 522fbca4f769027356359bc99c55445645e5369d Author: Andy Shevchenko Date: Fri Dec 10 18:30:08 2021 +0200 platform/x86: asus-wmi: Split MODULE_AUTHOR() on per author basis There are as many as needed MODULE_AUTHOR() macro entries allowed in the single driver. Split author list to a few macro entries. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211210163009.19894-2-andriy.shevchenko@linux.intel.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 3ac7bf0d47be0383de078e153dae8aecc1853033 Author: Andy Shevchenko Date: Fri Dec 10 18:30:07 2021 +0200 platform/x86: asus-wmi: Join string literals back For easy grepping on debug purposes join string literals back in the messages. No functional change. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211210163009.19894-1-andriy.shevchenko@linux.intel.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 8704d0befb59304eed60204e5524d5051de1d171 Author: Zong-Zhe Yang Date: Mon Dec 20 17:36:56 2021 +0800 rtw88: support SAR via kernel common API Register cfg80211_sar_capa with type NL80211_SAR_TYPE_POWER and four frequency ranges for configurations in unit of 0.25 dBm. And handle callback set_sar_specs. Originally, TX power has three main parameters, i.e. power base, power by rate, and power limit. The formula can be simply considered as TX power = power base + min(power by rate, power limit). With the support of SAR which can be treated as another power limit, there is one more parameter for TX power. And the formula will evolve into TX power = power base + min(power by rate, power limit, power sar). Besides, debugfs tx_pwr_tbl is also refined to show SAR information. The following is an example for the difference. Before supporting SAR, ----------------------------------- ... path rate pwr base (byr lmt ) rem A CCK_1M 66(0x42) 78 -12 ( 12 -12) 0 A CCK_2M 66(0x42) 78 -12 ( 8 -12) 0 ... ----------------------------------- After supporting SAR and making some configurations, ----------------------------------- ... path rate pwr base (byr lmt sar ) rem A CCK_1M 62(0x3e) 78 -16 ( 12 -12 -16) 0 A CCK_2M 62(0x3e) 78 -16 ( 8 -12 -16) 0 ... ----------------------------------- Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211220093656.65312-1-pkshih@realtek.com commit 10d162b2ed395e69720926b4f8d87f1f25ca920f Author: Po-Hao Huang Date: Tue Dec 21 16:50:10 2021 +0800 rtw88: 8822c: add ieee80211_ops::hw_scan Declare this function allows us to use customized scanning policy. By doing so we can be more time efficient on each scan. In order to make existing coex mechanism work as usual, firmware notifies driver on each channel switch event, then decide antenna ownership based on the current channel/band. Do note that this new mechanism affects throughput more than the sw_scan we used to have, but the overall average throughput is not affected since each scan take less time. Since the firmware size is limited, we only support probe requests with custom IEs length under 128 bytes for now, if any user space tools requires more than that, we'll introduce related changes afterwards. For backward compatibility, we fallback to sw_scan when using older firmware that does not support this feature. Signed-off-by: Po-Hao Huang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211221085010.39421-1-pkshih@realtek.com commit bc11517bc8219314948780570ec92814d14d6602 Merge: 8b144dedb928e bcbddc4f9d020 Author: Kalle Valo Date: Tue Dec 21 20:07:09 2021 +0200 Merge tag 'iwlwifi-next-for-kalle-2021-12-21-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next wlwifi patches for v5.17 v2 * Support for Time-Aware-SAR (TAS) as read from the BIOS; * Fix scan timeout issue when 6GHz is enabled; * Work continues for new HW family Bz; * Support for Optimized Connectivity Experience (OCE) scan; * A bunch of FW debugging improvements and fixes; * Fix one 32-bit compilation issue; * Some RX changes for new HW family * Some fixes for 6 GHz scan; * Fix SAR table fixes with newer platforms; * Fix early restart crash; * Small fix in the debugging code; * Add new Killer device IDs; * Datapath updates for Bz family continues; * A couple of important fixes in iwlmei; * Some other small fixes, clean-ups and improvements. commit 53778b8292b5492ec3ecf1efb84163eac2a6e422 Author: Vincent Knecht Date: Mon Dec 20 20:37:25 2021 +0100 ASoC: Add AK4375 support AK4375 is a 32-bit stereo DAC with headphones amplifier. There's no documentation for it on akm.com, and only a brief datasheet can be found floating on the internets [1]. Thanks to Oriane BAYERD for finally answering my inquiries through akm.com, if only to tell me that this chip is EOL following AKM factory burning in october 2020 and thus no detailed documentation is available anymore... AK4331 is advertised [2] as pin and register compatible with AK4375 so some scraps of its datasheet were used and this driver might be used as a base for it, but this is totally untested. So this driver is mainly based on downstream code [3] and [4] by Hu Jin from AKM (no known email). Tested on msm8916-alcatel-idol347 and msm8939-alcatel-idol3, which both use PLL driven clock with bypass of SRC (sample rate converter), so only this setup is supported for now. [1] https://datasheetspdf.com/pdf-file/1400317/AKM/AK4375A/1 [2] https://www.akm.com/content/dam/documents/products/audio/audio-dac/ak4331ecb/ak4331ecb-en-datasheet.pdf [3] https://github.com/msm8916-mainline/android_kernel_qcom_msm8916/blob/alcatel-idol347/sound/soc/codecs/idol347/ak4375.c [4] https://github.com/msm8916-mainline/android_kernel_qcom_msm8916/blob/alcatel-idol347/sound/soc/codecs/ak4375.c Signed-off-by: Vincent Knecht Link: https://lore.kernel.org/r/20211220193725.2650356-2-vincent.knecht@mailoo.org Signed-off-by: Mark Brown commit 70ba14cf6dfd7ebd1275562bb9637b8d0ddb8f49 Author: Vincent Knecht Date: Mon Dec 20 20:37:24 2021 +0100 ASoC: dt-bindings: codecs: Add bindings for ak4375 AK4375 is an audio DAC with headphones amplifier controlled via I2C. Add simple device tree bindings that describe how to set it up. Reviewed-by: Rob Herring Signed-off-by: Vincent Knecht Link: https://lore.kernel.org/r/20211220193725.2650356-1-vincent.knecht@mailoo.org Signed-off-by: Mark Brown commit 5de035c270047e7ae754fbfb69031707aa5b54f7 Author: Lad Prabhakar Date: Tue Dec 21 17:01:00 2021 +0000 ASoC: bcm: Use platform_get_irq() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). While at it also drop "r_irq" member from struct bcm_i2s_priv as there are no users of it. Signed-off-by: Lad Prabhakar Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20211221170100.27423-3-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Mark Brown commit c2efaf8f2d53ffa2ecc487e21c62d13bbb8d88c3 Author: Lad Prabhakar Date: Tue Dec 21 17:00:59 2021 +0000 ASoC: xlnx: Use platform_get_irq() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211221170100.27423-2-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Mark Brown commit 15443f6cab25762272312373226d3fd2a742404f Author: Ajit Kumar Pandey Date: Tue Dec 21 22:49:10 2021 +0530 ASoC: amd: acp: Remove duplicate dependency in Kconfig Remove duplicate depends on statement in Kconfig file. Signed-off-by: Ajit Kumar Pandey Link: https://lore.kernel.org/r/20211221171912.237792-1-AjitKumar.Pandey@amd.com Signed-off-by: Mark Brown commit ac1e6bc146d45e15f0a5c0908338f918f6261388 Author: Dan Carpenter Date: Fri Dec 17 18:00:07 2021 +0300 ASoC: qdsp6: fix a use after free bug in open() This code frees "graph" and then dereferences to save the error code. Save the error code first and then use gotos to unwind the allocation. Fixes: 59716aa3f976 ("ASoC: qdsp6: Fix an IS_ERR() vs NULL bug") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20211217150007.GB16611@kili Signed-off-by: Mark Brown commit 2dc643cd756398c3013fcc2d3c2a07c9c4a0a3bd Author: Pierre-Louis Bossart Date: Tue Dec 21 22:27:57 2021 +0530 ASoC: SOF: AMD: simplify return status handling cppcheck warning: sound/soc/sof/amd/acp.c:222:9: warning: Identical condition and return expression 'ret', return value is always 0 [identicalConditionAfterEarlyExit] return ret; ^ sound/soc/sof/amd/acp.c:213:6: note: If condition 'ret' is true, the function will return/exit if (ret) ^ sound/soc/sof/amd/acp.c:222:9: note: Returning identical expression 'ret' return ret; ^ Just return 0; on success. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Signed-off-by: Ajit Kumar Pandey Link: https://lore.kernel.org/r/20211221165802.236843-1-AjitKumar.Pandey@amd.com Signed-off-by: Mark Brown commit 5e4e84f1124aa02643833b7ea40abd5a8e964388 Merge: 855fb0384a3db 812de04661c4d Author: Paolo Bonzini Date: Tue Dec 21 12:59:53 2021 -0500 Merge tag 'kvm-s390-next-5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into HEAD KVM: s390: Fix and cleanup - fix sigp sense/start/stop/inconsistency - cleanups commit 72e4d07d9499d979a3fc38c77f4120707c709ea5 Author: Dan Carpenter Date: Fri Dec 17 10:12:09 2021 +0300 platform/x86: think-lmi: Prevent underflow in index_store() There needs to be a check to prevent negative offsets for setting->index. I have reviewed this code and I think that the "if (block->instance_count <= instance)" check in __query_block() will prevent this from resulting in an out of bounds access. But it's still worth fixing. Fixes: 640a5fa50a42 ("platform/x86: think-lmi: Opcode support") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20211217071209.GF26548@kili Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 855045873b54b9f8dd71a0468db9ff52aa27444f Author: Wang Qing Date: Tue Dec 14 04:18:36 2021 -0800 platform/x86: apple-gmux: use resource_size() with res This should be (res->end - res->start + 1) here actually, use resource_size() derectly. Signed-off-by: Wang Qing Link: https://lore.kernel.org/r/1639484316-75873-1-git-send-email-wangqing@vivo.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit d386f7ef9f410266bc1f364ad6a11cb28dae09a8 Author: Mario Limonciello Date: Fri Dec 10 08:35:29 2021 -0600 platform/x86: amd-pmc: only use callbacks for suspend This driver is intended to be used exclusively for suspend to idle so callbacks to send OS_HINT during hibernate and S5 will set OS_HINT at the wrong time leading to an undefined behavior. Cc: stable@vger.kernel.org Signed-off-by: Mario Limonciello Link: https://lore.kernel.org/r/20211210143529.10594-1-mario.limonciello@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit cfc643aa23c8855b92f9302e99a54dbf5857c1ab Author: Miaoqian Lin Date: Fri Dec 10 07:07:53 2021 +0000 platform/mellanox: mlxbf-pmc: Fix an IS_ERR() vs NULL bug in mlxbf_pmc_map_counters The devm_ioremap() function returns NULL on error, it doesn't return error pointers. Also according to doc of device_property_read_u64_array, values in info array are properties of device or NULL. Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20211210070753.10761-1-linmq006@gmail.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 855fb0384a3db2ae33b42f7b9bb6ecb753a40880 Merge: 5a213b9220e0b fdba608f15e24 Author: Paolo Bonzini Date: Tue Dec 21 12:51:09 2021 -0500 Merge remote-tracking branch 'kvm/master' into HEAD Pick commit fdba608f15e2 ("KVM: VMX: Wake vCPU when delivering posted IRQ even if vCPU == this vCPU"). In addition to fixing a bug, it also aligns the non-nested and nested usage of triggering posted interrupts, allowing for additional cleanups. Signed-off-by: Paolo Bonzini commit 6ed6356b07714e0198be3bc3ecccc8b40a212de4 Author: Dan Carpenter Date: Tue Dec 21 09:38:19 2021 -0800 xfs: prevent a WARN_ONCE() in xfs_ioc_attr_list() The "bufsize" comes from the root user. If "bufsize" is negative then, because of type promotion, neither of the validation checks at the start of the function are able to catch it: if (bufsize < sizeof(struct xfs_attrlist) || bufsize > XFS_XATTR_LIST_MAX) return -EINVAL; This means "bufsize" will trigger (WARN_ON_ONCE(size > INT_MAX)) in kvmalloc_node(). Fix this by changing the type from int to size_t. Signed-off-by: Dan Carpenter Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 132c460e49649685bf4b02ba43dea59062f797d9 Author: Yang Xu Date: Tue Dec 21 09:38:19 2021 -0800 xfs: Fix comments mentioning xfs_ialloc Since kernel commit 1abcf261016e ("xfs: move on-disk inode allocation out of xfs_ialloc()"), xfs_ialloc has been renamed to xfs_init_new_inode. So update this in comments. Signed-off-by: Yang Xu Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit 09654ed8a18cfd45027a67d6cbca45c9ea54feab Author: Dave Chinner Date: Thu Dec 16 17:32:18 2021 -0800 xfs: check sb_meta_uuid for dabuf buffer recovery Got a report that a repeated crash test of a container host would eventually fail with a log recovery error preventing the system from mounting the root filesystem. It manifested as a directory leaf node corruption on writeback like so: XFS (loop0): Mounting V5 Filesystem XFS (loop0): Starting recovery (logdev: internal) XFS (loop0): Metadata corruption detected at xfs_dir3_leaf_check_int+0x99/0xf0, xfs_dir3_leaf1 block 0x12faa158 XFS (loop0): Unmount and run xfs_repair XFS (loop0): First 128 bytes of corrupted metadata buffer: 00000000: 00 00 00 00 00 00 00 00 3d f1 00 00 e1 9e d5 8b ........=....... 00000010: 00 00 00 00 12 fa a1 58 00 00 00 29 00 00 1b cc .......X...).... 00000020: 91 06 78 ff f7 7e 4a 7d 8d 53 86 f2 ac 47 a8 23 ..x..~J}.S...G.# 00000030: 00 00 00 00 17 e0 00 80 00 43 00 00 00 00 00 00 .........C...... 00000040: 00 00 00 2e 00 00 00 08 00 00 17 2e 00 00 00 0a ................ 00000050: 02 35 79 83 00 00 00 30 04 d3 b4 80 00 00 01 50 .5y....0.......P 00000060: 08 40 95 7f 00 00 02 98 08 41 fe b7 00 00 02 d4 .@.......A...... 00000070: 0d 62 ef a7 00 00 01 f2 14 50 21 41 00 00 00 0c .b.......P!A.... XFS (loop0): Corruption of in-memory data (0x8) detected at xfs_do_force_shutdown+0x1a/0x20 (fs/xfs/xfs_buf.c:1514). Shutting down. XFS (loop0): Please unmount the filesystem and rectify the problem(s) XFS (loop0): log mount/recovery failed: error -117 XFS (loop0): log mount failed Tracing indicated that we were recovering changes from a transaction at LSN 0x29/0x1c16 into a buffer that had an LSN of 0x29/0x1d57. That is, log recovery was overwriting a buffer with newer changes on disk than was in the transaction. Tracing indicated that we were hitting the "recovery immediately" case in xfs_buf_log_recovery_lsn(), and hence it was ignoring the LSN in the buffer. The code was extracting the LSN correctly, then ignoring it because the UUID in the buffer did not match the superblock UUID. The problem arises because the UUID check uses the wrong UUID - it should be checking the sb_meta_uuid, not sb_uuid. This filesystem has sb_uuid != sb_meta_uuid (which is fine), and the buffer has the correct matching sb_meta_uuid in it, it's just the code checked it against the wrong superblock uuid. The is no corruption in the filesystem, and failing to recover the buffer due to a write verifier failure means the recovery bug did not propagate the corruption to disk. Hence there is no corruption before or after this bug has manifested, the impact is limited simply to an unmountable filesystem.... This was missed back in 2015 during an audit of incorrect sb_uuid usage that resulted in commit fcfbe2c4ef42 ("xfs: log recovery needs to validate against sb_meta_uuid") that fixed the magic32 buffers to validate against sb_meta_uuid instead of sb_uuid. It missed the magicda buffers.... Fixes: ce748eaa65f2 ("xfs: create new metadata UUID field and incompat flag") Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong commit e5d1802c70f50e0660ee7f598dc2c40312c9e0af Author: Darrick J. Wong Date: Wed Dec 15 11:53:15 2021 -0800 xfs: fix a bug in the online fsck directory leaf1 bestcount check When xfs_scrub encounters a directory with a leaf1 block, it tries to validate that the leaf1 block's bestcount (aka the best free count of each directory data block) is the correct size. Previously, this author believed that comparing bestcount to the directory isize (since directory data blocks are under isize, and leaf/bestfree blocks are above it) was sufficient. Unfortunately during testing of online repair, it was discovered that it is possible to create a directory with a hole between the last directory block and isize. The directory code seems to handle this situation just fine and xfs_repair doesn't complain, which effectively makes this quirk part of the disk format. Fix the check to work properly. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit 7993f1a431bc5271369d359941485a9340658ac3 Author: Darrick J. Wong Date: Wed Dec 15 11:52:23 2021 -0800 xfs: only run COW extent recovery when there are no live extents As part of multiple customer escalations due to file data corruption after copy on write operations, I wrote some fstests that use fsstress to hammer on COW to shake things loose. Regrettably, I caught some filesystem shutdowns due to incorrect rmap operations with the following loop: mount # (0) fsstress & # (1) while true; do fsstress mount -o remount,ro # (2) fsstress mount -o remount,rw # (3) done When (2) happens, notice that (1) is still running. xfs_remount_ro will call xfs_blockgc_stop to walk the inode cache to free all the COW extents, but the blockgc mechanism races with (1)'s reader threads to take IOLOCKs and loses, which means that it doesn't clean them all out. Call such a file (A). When (3) happens, xfs_remount_rw calls xfs_reflink_recover_cow, which walks the ondisk refcount btree and frees any COW extent that it finds. This function does not check the inode cache, which means that incore COW forks of inode (A) is now inconsistent with the ondisk metadata. If one of those former COW extents are allocated and mapped into another file (B) and someone triggers a COW to the stale reservation in (A), A's dirty data will be written into (B) and once that's done, those blocks will be transferred to (A)'s data fork without bumping the refcount. The results are catastrophic -- file (B) and the refcount btree are now corrupt. In the first patch, we fixed the race condition in (2) so that (A) will always flush the COW fork. In this second patch, we move the _recover_cow call to the initial mount call in (0) for safety. As mentioned previously, xfs_reflink_recover_cow walks the refcount btree looking for COW staging extents, and frees them. This was intended to be run at mount time (when we know there are no live inodes) to clean up any leftover staging events that may have been left behind during an unclean shutdown. As a time "optimization" for readonly mounts, we deferred this to the ro->rw transition, not realizing that any failure to clean all COW forks during a rw->ro transition would result in catastrophic corruption. Therefore, remove this optimization and only run the recovery routine when we're guaranteed not to have any COW staging extents anywhere, which means we always run this at mount time. While we're at it, move the callsite to xfs_log_mount_finish because any refcount btree expansion (however unlikely given that we're removing records from the right side of the index) must be fed by a per-AG reservation, which doesn't exist in its current location. Fixes: 174edb0e46e5 ("xfs: store in-progress CoW allocations in the refcount btree") Signed-off-by: Darrick J. Wong Reviewed-by: Chandan Babu R Reviewed-by: Dave Chinner commit 7b7820b83f230036fc48c3e7fb280c48c58adebf Author: Darrick J. Wong Date: Wed Dec 15 12:07:41 2021 -0800 xfs: don't expose internal symlink metadata buffers to the vfs Ian Kent reported that for inline symlinks, it's possible for vfs_readlink to hang on to the target buffer returned by _vn_get_link_inline long after it's been freed by xfs inode reclaim. This is a layering violation -- we should never expose XFS internals to the VFS. When the symlink has a remote target, we allocate a separate buffer, copy the internal information, and let the VFS manage the new buffer's lifetime. Let's adapt the inline code paths to do this too. It's less efficient, but fixes the layering violation and avoids the need to adapt the if_data lifetime to rcu rules. Clearly I don't care about readlink benchmarks. As a side note, this fixes the minor locking violation where we can access the inode data fork without taking any locks; proper locking (and eliminating the possibility of having to switch inode_operations on a live inode) is essential to online repair coordinating repairs correctly. Reported-by: Ian Kent Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit 59d7fab2dff96ed2ca732168859489d71fabd33b Author: Darrick J. Wong Date: Wed Dec 15 11:53:16 2021 -0800 xfs: fix quotaoff mutex usage now that we don't support disabling it Prior to commit 40b52225e58c ("xfs: remove support for disabling quota accounting on a mounted file system"), we used the quotaoff mutex to protect dquot operations against quotaoff trying to pull down dquots as part of disabling quota. Now that we only support turning off quota enforcement, the quotaoff mutex only protects changes in m_qflags/sb_qflags. We don't need it to protect dquots, which means we can remove it from setqlimits and the dquot scrub code. While we're at it, fix the function that forces quotacheck, since it should have been taking the quotaoff mutex. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit 47a6df7cd3174b91c6c862eae0b8d4e13591df52 Author: Darrick J. Wong Date: Wed Dec 15 11:53:14 2021 -0800 xfs: shut down filesystem if we xfs_trans_cancel with deferred work items While debugging some very strange rmap corruption reports in connection with the online directory repair code. I root-caused the error to the following incorrect sequence: Obviously, we should have committed the transaction instead of cancelling it. Thinking more broadly, however, xfs_trans_cancel should have warned us that we were throwing away work item that we already committed to performing. This is not correct, and we need to shut down the filesystem. Change xfs_trans_cancel to complain in the loudest manner if we're cancelling any transaction with deferred work items attached. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner commit 426c0ff27b833939ed434b4a468bdc010864922a Author: Sanket Goswami Date: Tue Nov 30 16:53:18 2021 +0530 platform/x86: amd-pmc: Add support for AMD Smart Trace Buffer STB (Smart Trace Buffer), is a debug trace buffer that isolates the failures by analyzing the last running feature of a system. This non-intrusive way always runs in the background and stores the trace into the SoC. This patch enables the STB feature by passing module param "enable_stb=1" while loading the driver and provides mechanism to access the STB buffer using the read and write routines. Co-developed-by: Shyam Sundar S K Signed-off-by: Shyam Sundar S K Signed-off-by: Sanket Goswami Link: https://lore.kernel.org/r/20211130112318.92850-3-Sanket.Goswami@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 6a5a14b18972ae03861e2ed15152f731de29baaa Author: Sanket Goswami Date: Tue Nov 30 16:53:17 2021 +0530 platform/x86: amd-pmc: Simplify error handling and store the pci_dev in amd_pmc_dev structure Handle error-exits in the amd_pmc_probe() to avoid duplication and store the root port information in amd_pmc_probe() so that the information can be used across multiple routines. Suggested-by: Hans de Goede Signed-off-by: Sanket Goswami Link: https://lore.kernel.org/r/20211130112318.92850-2-Sanket.Goswami@amd.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 37cf276df1014aa4647ae364bde878041053b40d Author: Xiang wangx Date: Tue Dec 14 20:50:04 2021 +0800 fm10k: Fix syntax errors in comments Delete the redundant word 'by'. Signed-off-by: Xiang wangx Signed-off-by: Tony Nguyen commit 630f6edc485133363d4cd14766db031c7da47c41 Author: Karen Sornek Date: Wed Jul 7 08:40:25 2021 +0200 igbvf: Refactor trace Refactoring "PF still resetting" message, because previous version looked like a bug - it informed about changes that worked as designed but might confuse users. Changes requested to make message more user-friendly. Signed-off-by: Karen Sornek Tested-by: Tony Brelinski Signed-off-by: Tony Nguyen commit 890781af31a069555163b23cb513c7ee1927fb24 Author: Jason Wang Date: Sun Nov 14 14:02:22 2021 +0800 igb: remove never changed variable `ret_val' The variable used for return status in `igb_write_xmdio_reg' function is never changed and this function is just need return 0. Thus, the `ret_val' can be removed and return 0 at the end of the `igb_write_xmdio_reg' function. Signed-off-by: Jason Wang Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit b8773a66f651d0e410796562c1e1f6097619caba Author: Sasha Neftin Date: Tue Dec 7 08:19:18 2021 +0200 igc: Remove obsolete define 'MII_CR_FULL_DUPLEX' define not in use. This patch comes to tidy up obsolete define. Signed-off-by: Sasha Neftin Signed-off-by: Tony Nguyen commit d2a66dd3fdd6ce77b2018d5fcf9cdc91cc9bf0a9 Author: Sasha Neftin Date: Tue Nov 9 11:42:16 2021 +0200 igc: Remove obsolete mask 'IGC_CTRL_EXT_LINK_MODE_MASK' not in use. This patch comes to tidy up obsolete define. Signed-off-by: Sasha Neftin Tested-by: Nechama Kraus Signed-off-by: Tony Nguyen commit 2a8807a7658903e77a4b21bc820cb321005ed19f Author: Sasha Neftin Date: Sun Oct 31 12:45:56 2021 +0200 igc: Remove obsolete nvm type i225 devices use only spi nvm type. This patch comes to tidy up obsolete nvm types. Signed-off-by: Sasha Neftin Tested-by: Nechama Kraus Signed-off-by: Tony Nguyen commit 8e153faf5827cadb873aed2d28a5fb774ca7ca55 Author: Sasha Neftin Date: Mon Oct 25 10:16:36 2021 +0300 igc: Remove unused phy type _phy_none type not in use. Clean up the code accordingly, and get rid of the unused enum line Signed-off-by: Sasha Neftin Reviewed-by: Paul Menzel Tested-by: Nechama Kraus Signed-off-by: Tony Nguyen commit 7a34cda1ee8abf2381af12e9e86b2bdf789a9b0b Author: Sasha Neftin Date: Wed Oct 13 09:19:26 2021 +0300 igc: Remove unused _I_PHY_ID define _I_PHY_ID not in use. Clean up the code accordingly, and get rid of the unused define Signed-off-by: Sasha Neftin Tested-by: Nechama Kraus Signed-off-by: Tony Nguyen commit 3bf4fb25d5c2455396a1decd43f5e6b775f0b377 Author: Dmitry Osipenko Date: Thu Dec 16 19:02:29 2021 +0300 ASoC: tegra-audio-rt5677: Correct example Remove non-existent properties from the example of the binding. These properties were borrower from the old txt binding, but they were never used in practice and aren't documented in the new binding. They aren't reported by the binding checker because dtschema needs extra patch that hasn't been upstreamed yet to make unevaluatedProperties work properly. Signed-off-by: Dmitry Osipenko Acked-by: Rob Herring Link: https://lore.kernel.org/r/20211216160229.17049-1-digetx@gmail.com Signed-off-by: Mark Brown commit 13a64f0b9894886b2c08ab84de209735abf5a789 Author: Jacob Keller Date: Wed Oct 13 09:00:08 2021 -0700 ice: support crosstimestamping on E822 devices if supported E822 devices on supported platforms can generate a cross timestamp between the platform ART and the device time. This process allows for very precise measurement of the difference between the PTP hardware clock and the platform time. This is only supported if we know the TSC frequency relative to ART, so we do not enable this unless the boot CPU has a known TSC frequency (as required by convert_art_ns_to_tsc). Because PCIe PTM support is not available on all platforms, introduce CONFIG_ICE_HWTS and make it depend on X86 where we know the support exists. Signed-off-by: Jacob Keller Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit a69f1cb62aecedddaec445aff28f095793b1c28c Author: Jacob Keller Date: Wed Oct 13 08:56:58 2021 -0700 ice: exit bypass mode once hardware finishes timestamp calibration Once the E822 device has sent and received one packet, the hardware computes the internal delay of the PHY using a process known as Vernier calibration. This calibration calculates a more accurate offset for the Tx and Rx timestamps. To make use of this offset, we need to exit the bypass mode. This cannot be done until the PHY has completed offset calibration, as indicated by the offset valid bits. To handle this, introduce a kthread work item which will poll the offset valid bits every few milliseconds seeing if it is safe to exit bypass mode. Once we have finished calibrating the offsets, we can program the total Tx and Rx offset registers and turn off the bypass bit. This allows the hardware to include the more precise vernier calibration offset, and improves the timestamp precision. Signed-off-by: Jacob Keller Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit b111ab5a11eb8f7261940c95ada9fbf5ca784731 Author: Jacob Keller Date: Wed Oct 13 08:55:58 2021 -0700 ice: ensure the hardware Clock Generation Unit is configured The E822 device has a Clock Generation Unit (CGU) responsible for determining the clock frequency that drives the timers. Ensure this function is initialized when bringing up the PTP support, so that the clock has a known frequency. Signed-off-by: Jacob Keller Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit 3a7496234d179a7dd6a7bb152f62422c3f38e15a Author: Jacob Keller Date: Wed Oct 13 08:54:51 2021 -0700 ice: implement basic E822 PTP support Implement support for the basic operations needed to enable the PTP hardware clock on E822 devices. This includes implementations for the various PHY access functions, as well as the ability to start and stop the PHY timers. This is different from the E810 device because the configuration depends on link speed, so we cannot just start the PHYs immediately. We must wait until the link is up to get proper values for the speed based initialization. Signed-off-by: Jacob Keller Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit 405efa49b54bb3f769d00cfe6536820848db0648 Author: Jacob Keller Date: Wed Oct 13 08:53:41 2021 -0700 ice: convert clk_freq capability into time_ref Convert the clk_freq value into the associated time_ref frequency value for E822 devices. This simplifies determining the time reference value for the clock. Signed-off-by: Jacob Keller Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit b2ee72565cd0ee24d2067e3de9094a14644493a8 Author: Jacob Keller Date: Wed Oct 13 08:52:29 2021 -0700 ice: introduce ice_ptp_init_phc function When we enable support for E822 devices, there are some additional steps required to initialize the PTP hardware clock. To make this easier to implement as device-specific behavior, refactor the register setups in ice_ptp_init_owner to a new ice_ptp_init_phc function defined in ice_ptp_hw.c This function will have a common section, and an e810 specific sub-implementation. This will enable easily extending the functionality to cover the E822 specific setup required to initialize the hardware clock generation unit. It also makes it clear which steps are E810 specific vs which ones are necessary for all ice devices. Signed-off-by: Jacob Keller Reviewed-by: Paul Menzel Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit 39b2810642e85f8191cc5494bc4019888ec57cbf Author: Jacob Keller Date: Wed Oct 13 08:51:36 2021 -0700 ice: use 'int err' instead of 'int status' in ice_ptp_hw.c The ice_ptp_hw.c file introduced a bunch of uses of "int status" instead of the more traditional "int err" or "int ret". These are actually traditional Linux error codes (as opposed to the recently removed ice_status enumeration values). We're about to add a bunch of new functions to ice_ptp_hw.c. It's normally preferred in the ice driver to use "int ret" or "int err" when dealing with error code values. Instead of making the new functions use "int status" lets just fix all of ice_ptp_hw.c to use "int err". This will match the new functions and ensures a consistent style across at least the PTP related files. Signed-off-by: Jacob Keller Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit e59d75dd410eadf57fa4a6a374a480f6503355b5 Author: Jacob Keller Date: Wed Oct 13 08:48:13 2021 -0700 ice: PTP: move setting of tstamp_config The tstamp_config structure is being set inside of ice_ptp_cfg_timestamp, which is the function used to set Tx and Rx timestamping during initialization. This function is also used in order to set the PHY port timestamping status. However, it makes sense to always set the tstamp_config directly whenever the ice_set_tx_tstamp or ice_set_rx_tstamp functions are called. Move assignment of tstamp_config into the related functions and out of ice_ptp_cfg_timestamp. Now that we assign the timestamp mode in the relevant functions, we no longer modify the config value in ice_set_timestamp_mode. In turn, we no longer want to copy that config value into the PF cached structure. Instead, this is now the source of truth for actual configuration. On success of ice_set_timestamp_mode, copy the real configured mode back to report it out to userspace. Signed-off-by: Jacob Keller Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit 78267d0c9cabf09e85559e7ac24e4c712d5eadad Author: Jacob Keller Date: Wed Oct 13 08:47:20 2021 -0700 ice: introduce ice_base_incval function A future change will add additional possible increment values for the E822 device support. To handle this, we want to look up the increment value to use instead of hard coding it to the nominal value for E810 devices. Introduce ice_base_incval as a function to get the best nominal increment value to use. For now, it just returns the E810 value, but will be refactored in the future to look up the value based on the device type and configured clock frequency. Signed-off-by: Jacob Keller Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit 4809671015a1bd2e7ab811f8a998375cec10f54f Author: Karol Kolacinski Date: Mon Dec 20 08:58:27 2021 -0800 ice: Fix E810 PTP reset flow The PF reset does not reset PHC and PHY clocks so it's unnecessary to stop them and reinitialize after the reset. Configuring timestamping changes the VSI fields so it needs to be performed after VSIs are initialized, which was not done in case of a reset. Suggested-by: Patrick Talbert Signed-off-by: Karol Kolacinski Tested-by: Pasi Vaananen Signed-off-by: Tony Nguyen commit b90c42c7476122db8e993cb025a0179cc4356339 Author: Miquel Raynal Date: Fri Dec 17 15:20:32 2021 +0100 MAINTAINERS: Add an entry for Renesas NAND controller Point to the driver and the bindings. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20211217142033.353599-4-miquel.raynal@bootlin.com commit d8701fe890ecbab239086e7053d62d0f08587d7c Author: Miquel Raynal Date: Fri Dec 17 15:20:31 2021 +0100 mtd: rawnand: renesas: Add new NAND controller driver Introduce Renesas NAND controller driver which currently supports the following features on R-Car Gen3 and RZ/N1 SoCs: - All ONFI timing modes - Different configurations of its internal ECC controller - On-die (not tested) and software ECC support - Several chips (not tested) - Subpage accesses - DMA and PIO This controller was originally provided by Evatronix before being bought by Cadence. Signed-off-by: Miquel Raynal Tested-by: Ralph Siemsen Acked-by: Wolfram Sang Link: https://lore.kernel.org/linux-mtd/20211217142033.353599-3-miquel.raynal@bootlin.com commit 6b85a71cace75c9e06eb02f76216be1e26530058 Author: Miquel Raynal Date: Fri Dec 17 15:20:30 2021 +0100 dt-bindings: mtd: renesas: Describe Renesas R-Car Gen3 & RZ/N1 NAND controller Add a Yaml description for this Renesas NAND controller. As this controller is embedded on different SoC families, provide: * a family-specific "r-car-gen3" compatible and a more specific "r8a77951" one * a family-specific "rzn1" compatible and a more specific "r9a06g032" one More compatibles can be added later if new SoCs with this controller must be supported. Signed-off-by: Miquel Raynal Reviewed-by: Geert Uytterhoeven Reviewed-by: Rob Herring Acked-by: Wolfram Sang Link: https://lore.kernel.org/linux-mtd/20211217142033.353599-2-miquel.raynal@bootlin.com commit 0082e3299a49286a7761f4d237530b07c00676fb Author: Ajit Kumar Pandey Date: Tue Dec 21 21:48:09 2021 +0530 ASoC: amd: acp-config: Update sof_tplg_filename for SOF machines SOF machines support different codec end points and hence required different topologies configuration. Update tplg filename in machine struct to load different topology files for SOF machines. Signed-off-by: Ajit Kumar Pandey Reviewed-by: Curtis Malainey Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20211221161814.236318-3-AjitKumar.Pandey@amd.com Signed-off-by: Mark Brown commit f487201343312faa697ac40124085a834e0e26d8 Author: Ajit Kumar Pandey Date: Tue Dec 21 21:48:08 2021 +0530 ASoC: amd: acp-config: Enable SOF audio for Google chrome boards. We need to support sof audio on different variants of Google boards. Add new entry in dmi table to enable SOF flag on Google chrome boards. Also add newer machines to sof_machines list with codecs and amps acpi id check to register sof sound cards on different variants. Signed-off-by: Ajit Kumar Pandey Reviewed-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20211221161814.236318-2-AjitKumar.Pandey@amd.com Signed-off-by: Mark Brown commit e338924bd05d6e71574bc13e310c89e10e49a8a5 Author: Tetsuo Handa Date: Fri Dec 17 23:51:25 2021 +0900 block: check minor range in device_add_disk() ioctl(fd, LOOP_CTL_ADD, 1048576) causes sysfs: cannot create duplicate filename '/dev/block/7:0' message because such request is treated as if ioctl(fd, LOOP_CTL_ADD, 0) due to MINORMASK == 1048575. Verify that all minor numbers for that device fit in the minor range. Reported-by: wangyangbo Signed-off-by: Tetsuo Handa Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/b1b19379-23ee-5379-0eb5-94bf5f79f1b4@i-love.sakura.ne.jp Signed-off-by: Jens Axboe commit 37ae5a0f5287a52cf51242e76ccf198d02ffe495 Author: Tetsuo Handa Date: Sat Dec 18 18:41:56 2021 +0900 block: use "unsigned long" for blk_validate_block_size(). Since lo_simple_ioctl(LOOP_SET_BLOCK_SIZE) and ioctl(NBD_SET_BLKSIZE) pass user-controlled "unsigned long arg" to blk_validate_block_size(), "unsigned long" should be used for validation. Signed-off-by: Tetsuo Handa Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/9ecbf057-4375-c2db-ab53-e4cc0dff953d@i-love.sakura.ne.jp Signed-off-by: Jens Axboe commit 99d8690aae4b2f0d1d90075de355ac087f820a66 Author: Christoph Hellwig Date: Tue Dec 21 17:18:51 2021 +0100 block: fix error unwinding in device_add_disk One device_add is called disk->ev will be freed by disk_release, so we should free it twice. Fix this by allocating disk->ev after device_add so that the extra local unwinding can be removed entirely. Based on an earlier patch from Tetsuo Handa. Reported-by: syzbot Tested-by: syzbot Fixes: 83cbce9574462c6b ("block: add error handling for device_add_disk / add_disk") Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211221161851.788424-1-hch@lst.de Signed-off-by: Jens Axboe commit 294e70c952b494918f139670cf5a89839a2e03e6 Merge: c48c94b0ab75e 701fdfe348f7e Author: Jakub Kicinski Date: Tue Dec 21 07:41:47 2021 -0800 Merge tag 'mac80211-next-for-net-next-2021-12-21' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next Johannes Berg says: ==================== This time we have: * ndo_fill_forward_path support in mac80211, to let drivers use it * association comeback notification for userspace, to be able to react more sensibly to long delays * support for background radar detection hardware in some chipsets * SA Query Procedures offload on the AP side * more logging if we find problems with HT/VHT/HE * various cleanups and minor fixes Conflicts: net/wireless/reg.c: e08ebd6d7b90 ("cfg80211: Acquire wiphy mutex on regulatory work") 701fdfe348f7 ("cfg80211: Enable regulatory enforcement checks for drivers supporting mesh iface") https://lore.kernel.org/r/20211221111950.57ecc6a7@canb.auug.org.au drivers/net/wireless/ath/ath10k/wmi.c: 7f599aeccbd2 ("cfg80211: Use the HE operation IE to determine a 6GHz BSS channel") 3bf2537ec2e3 ("ath10k: drop beacon and probe response which leak from other channel") https://lore.kernel.org/r/20211221115004.1cd6b262@canb.auug.org.au * tag 'mac80211-next-for-net-next-2021-12-21' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next: (32 commits) cfg80211: Enable regulatory enforcement checks for drivers supporting mesh iface rfkill: allow to get the software rfkill state cfg80211: refactor cfg80211_get_ies_channel_number() nl82011: clarify interface combinations wrt. channels nl80211: Add support to offload SA Query procedures for AP SME device nl80211: Add support to set AP settings flags with single attribute mac80211: add more HT/VHT/HE state logging cfg80211: Use the HE operation IE to determine a 6GHz BSS channel cfg80211: rename offchannel_chain structs to background_chain to avoid confusion with ETSI standard mac80211: Notify cfg80211 about association comeback cfg80211: Add support for notifying association comeback mac80211: introduce channel switch disconnect function cfg80211: Fix order of enum nl80211_band_iftype_attr documentation cfg80211: simplify cfg80211_chandef_valid() mac80211: Remove a couple of obsolete TODO mac80211: fix FEC flag in radio tap header mac80211: use coarse boottime for airtime fairness code ieee80211: change HE nominal packet padding value defines cfg80211: use ieee80211_bss_get_elem() instead of _get_ie() mac80211: Use memset_after() to clear tx status ... ==================== Link: https://lore.kernel.org/r/20211221112532.28708-1-johannes@sipsolutions.net Signed-off-by: Jakub Kicinski commit 400cffd5f4eaf34939530b3a044e31655188b1f9 Author: Thomas Weißschuh Date: Wed Nov 24 00:27:04 2021 +0100 platform/x86: thinkpad_acpi: support inhibit-charge This adds support for the inhibit-charge charge_behaviour through the embedded controller of ThinkPads. Co-developed-by: Thomas Koch Signed-off-by: Thomas Koch Co-developed-by: Nicolò Piazzalunga Signed-off-by: Nicolò Piazzalunga Signed-off-by: Thomas Weißschuh Acked-by: Sebastian Reichel Link: https://lore.kernel.org/r/20211123232704.25394-5-linux@weissschuh.net Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit b55d416d48f5907f66218ae3d878e3bfb69ae4e6 Author: Thomas Weißschuh Date: Wed Nov 24 00:27:03 2021 +0100 platform/x86: thinkpad_acpi: support force-discharge This adds support for the force-discharge charge_behaviour through the embedded controller of ThinkPads. Co-developed-by: Thomas Koch Signed-off-by: Thomas Koch Co-developed-by: Nicolò Piazzalunga Signed-off-by: Nicolò Piazzalunga Signed-off-by: Thomas Weißschuh Acked-by: Sebastian Reichel Link: https://lore.kernel.org/r/20211123232704.25394-4-linux@weissschuh.net Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 539b9c94ac83563842a27e8cc3de5164b15c4de0 Author: Thomas Weißschuh Date: Wed Nov 24 00:27:02 2021 +0100 power: supply: add helpers for charge_behaviour sysfs These helper functions can be used by drivers to implement their own sysfs-attributes. This is useful for ACPI-drivers extending the default ACPI-battery with their own charge_behaviour attributes. Signed-off-by: Thomas Weißschuh Acked-by: Sebastian Reichel Link: https://lore.kernel.org/r/20211123232704.25394-3-linux@weissschuh.net Signed-off-by: Hans de Goede commit 1b0b6cc8030d08d2a24e9e5f85dc36c5a58200ba Author: Thomas Weißschuh Date: Wed Nov 24 00:27:01 2021 +0100 power: supply: add charge_behaviour attributes This a revised version of "[RFC] add standardized attributes for force_discharge and inhibit_charge" [0], incorporating discussion results. The biggest change is the switch from two boolean attributes to a single enum attribute. [0] https://lore.kernel.org/platform-driver-x86/21569a89-8303-8573-05fb-c2fec29983d1@gmail.com/ Signed-off-by: Thomas Weißschuh Acked-by: Sebastian Reichel Link: https://lore.kernel.org/r/20211123232704.25394-2-linux@weissschuh.net Signed-off-by: Hans de Goede commit a2d05fb73493ca89b36c7d2c3ffc76effbfcd763 Author: Yang Yingliang Date: Tue Dec 21 19:38:25 2021 +0800 gpio: sim: add missing fwnode_handle_put() in gpio_sim_probe() Calling fwnode_handle_put() when break out of device_for_each_child_node(), or the device node reference will be leakd. Fixes: 83960fcf4818 ("gpio: sim: new testing module") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Signed-off-by: Bartosz Golaszewski commit c9791a94384af07592d29504004d2255dbaf8663 Author: Jonathan Cameron Date: Sun Dec 5 17:27:28 2021 +0000 iio: adc: ti-adc081c: Partial revert of removal of ACPI IDs Unfortuanately a non standards compliant ACPI ID is known to be in the wild on some AAEON boards. Partly revert the removal of these IDs so that ADC081C will again work + add a comment to that affect for future reference. Whilst here use generic firmware properties rather than the ACPI specific handling previously found in this driver. Reported-by: Kunyang Fan Fixes: c458b7ca3fd0 ("iio:adc:ti-adc081c: Drop ACPI ids that seem very unlikely to be official.") Signed-off-by: Jonathan Cameron Cc: Andy Shevchenko Tested-by: Kunyang Fan #UP-extremei11 Link: https://lore.kernel.org/r/20211205172728.2826512-1-jic23@kernel.org Cc: commit f4a73a97accf5635815de148cf077fa6d076812d Author: Jonathan Cameron Date: Mon Dec 20 16:47:26 2021 +0000 iio:addac:ad74413r: Fix uninitialized ret in a path that won't be hit. I don't believe it's possible to hit this, because we drop out of __iio_update_buffers() earlier in the event of an empty list. However, that is not visible to the compiler so lets return an error if we do hit the loop with an empty bitmask. Fixes: 5d97d9e9a703 ("iio: addac: ad74413r: fix off by one in ad74413r_parse_channel_config()") Signed-off-by: Jonathan Cameron Cc: Cosmin Tanislav Link: https://lore.kernel.org/r/20211220164726.3136307-1-jic23@kernel.org commit bfcacdd64df8df91311449642da70a8512431fa9 Author: Anand Ashok Dumbre Date: Fri Dec 3 21:23:58 2021 +0000 MAINTAINERS: Add maintainer for xilinx-ams Add maintaner entry for xilinx-ams driver. Signed-off-by: Anand Ashok Dumbre Link: https://lore.kernel.org/r/20211203212358.31444-6-anand.ashok.dumbre@xilinx.com Signed-off-by: Jonathan Cameron commit 39dd2d1e251d3ad7910aadac1d723e93e201dafa Author: Anand Ashok Dumbre Date: Fri Dec 3 21:23:57 2021 +0000 dt-bindings: iio: adc: Add Xilinx AMS binding documentation Xilinx AMS have several ADC channels that can be used for measurement of different voltages and temperatures. Document the same in the bindings. Signed-off-by: Anand Ashok Dumbre Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211203212358.31444-5-anand.ashok.dumbre@xilinx.com Signed-off-by: Jonathan Cameron commit d5c70627a79455154f5f636096abe6fe57510605 Author: Anand Ashok Dumbre Date: Fri Dec 3 21:23:56 2021 +0000 iio: adc: Add Xilinx AMS driver The AMS includes an ADC as well as on-chip sensors that can be used to sample external voltages and monitor on-die operating conditions, such as temperature and supply voltage levels. The AMS has two SYSMON blocks. PL-SYSMON block is capable of monitoring off chip voltage and temperature. PL-SYSMON block has DRP, JTAG and I2C interface to enable monitoring from an external master. Out of these interfaces currently only DRP is supported. Other block PS-SYSMON is memory mapped to PS. The AMS can use internal channels to monitor voltage and temperature as well as one primary and up to 16 auxiliary channels for measuring external voltages. The voltage and temperature monitoring channels also have event capability which allows to generate an interrupt when their value falls below or raises above a set threshold. Co-developed-by: Manish Narani Signed-off-by: Manish Narani Signed-off-by: Anand Ashok Dumbre Link: https://lore.kernel.org/r/20211203212358.31444-4-anand.ashok.dumbre@xilinx.com Signed-off-by: Jonathan Cameron commit eca6e2d4a4a4b824f055eeaaa24f1c2327fb91a2 Author: Anand Ashok Dumbre Date: Fri Dec 3 21:23:54 2021 +0000 device property: Add fwnode_iomap() This patch introduces a new helper routine - fwnode_iomap(), which allows to map the memory mapped IO for a given device node. This implementation does not cover the ACPI case and may be expanded in the future. The main purpose here is to be able to develop resource provider agnostic drivers. Suggested-by: Andy Shevchenko Signed-off-by: Anand Ashok Dumbre Reviewed-by: Andy Shevchenko Acked-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/20211203212358.31444-2-anand.ashok.dumbre@xilinx.com Signed-off-by: Jonathan Cameron commit 8ebbfb9882f8f0e52195d08f02a030e617381b3b Author: Jonathan Cameron Date: Sun Nov 28 17:24:45 2021 +0000 iio:accel:kxcjk-1013: Mark struct __maybe_unused to avoid warning. This structure is only used in PM ops, so may not be used depending on build configuration. Signed-off-by: Jonathan Cameron Cc: Stephan Gerhold Reviewed-by: Nathan Chancellor Link: https://lore.kernel.org/r/20211128172445.2616166-13-jic23@kernel.org commit f3d29c85e6eb5d83d29e2c2bbdf9c824df4cc442 Author: Jonathan Cameron Date: Sun Nov 28 17:24:44 2021 +0000 iio:accel:bmc150: Mark structure __maybe_unused as only needed with for pm ops. If CONFIG_PM not set then clang warns this structure is unused. Signed-off-by: Jonathan Cameron Cc: Stephan Gerhold Reviewed-by: Nathan Chancellor Link: https://lore.kernel.org/r/20211128172445.2616166-12-jic23@kernel.org commit e8ffca613cd8dfc27adbfc6cee08b659abed3d88 Author: Jonathan Cameron Date: Sun Nov 28 17:24:43 2021 +0000 iio:dummy: Drop set but unused variable len. Not sure what the thinking was here, as lost to history, but the variable is clearly not used so get rid of it. Warning seen with clang W=1 tests (may be present with other compilers and build options). Signed-off-by: Jonathan Cameron Reviewed-by: Nathan Chancellor Link: https://lore.kernel.org/r/20211128172445.2616166-11-jic23@kernel.org commit ea011add51bc8980c067a1c2df9ec84219062b53 Author: Jonathan Cameron Date: Sun Nov 28 17:24:42 2021 +0000 iio:magn:ak8975: Suppress clang W=1 warning about pointer to enum conversion. Cast to a uintptr_t rather than directly to the enum. As per the discussion in below linked media patch. Link: https://lore.kernel.org/linux-media/CAK8P3a2ez6nEw4d+Mqa3XXAz0RFTZHunqqRj6sCt7Y_Eqqs0rw@mail.gmail.com/ Signed-off-by: Jonathan Cameron Cc: Arnd Bergmann Cc: Mauro Carvalho Chehab Cc: Jonathan Albrieux Cc: Linus Walleij Reviewed-by: Nathan Chancellor Link: https://lore.kernel.org/r/20211128172445.2616166-10-jic23@kernel.org commit 6713847817e0ab66b853294137f58c4d3211ad24 Author: Jonathan Cameron Date: Sun Nov 28 17:24:41 2021 +0000 iio:imu:inv_mpu6050: Suppress clang W=1 warning about pointer to enum conversion. Cast to a uintptr_t rather than directly to the enum. As per the discussion in below linked media patch. Link: https://lore.kernel.org/linux-media/CAK8P3a2ez6nEw4d+Mqa3XXAz0RFTZHunqqRj6sCt7Y_Eqqs0rw@mail.gmail.com/ Signed-off-by: Jonathan Cameron Cc: Arnd Bergmann Cc: Mauro Carvalho Chehab Cc: Baptiste Mansuy Cc: Jean-Baptiste Maneyrol Cc: Linus Walleij Reviewed-by: Nathan Chancellor Link: https://lore.kernel.org/r/20211128172445.2616166-9-jic23@kernel.org commit 072cc9816c902103bbc41112fe914e884b3f9882 Author: Jonathan Cameron Date: Sun Nov 28 17:24:40 2021 +0000 iio:imu:inv_icm42600: Suppress clang W=1 warning about pointer to enum conversion. Cast to a uintptr_t rather than directly to the enum. As per the discussion in below linked media patch. Link: https://lore.kernel.org/linux-media/CAK8P3a2ez6nEw4d+Mqa3XXAz0RFTZHunqqRj6sCt7Y_Eqqs0rw@mail.gmail.com/ Signed-off-by: Jonathan Cameron Cc: Arnd Bergmann Cc: Mauro Carvalho Chehab Cc: Jean-Baptiste Maneyrol Reviewed-by: Nathan Chancellor Link: https://lore.kernel.org/r/20211128172445.2616166-8-jic23@kernel.org commit e064222dcc165ba2feee7f9ecc90121a7dfbc334 Author: Jonathan Cameron Date: Sun Nov 28 17:24:39 2021 +0000 iio:dac:mcp4725: Suppress clang W=1 warning about pointer to enum conversion. Cast to a uintptr_t rather than directly to the enum. As per the discussion in below linked media patch. Link: https://lore.kernel.org/linux-media/CAK8P3a2ez6nEw4d+Mqa3XXAz0RFTZHunqqRj6sCt7Y_Eqqs0rw@mail.gmail.com/ Signed-off-by: Jonathan Cameron Cc: Arnd Bergmann Cc: Mauro Carvalho Chehab Reviewed-by: Nathan Chancellor Link: https://lore.kernel.org/r/20211128172445.2616166-7-jic23@kernel.org commit dce71a5fe3b07c3ade6df2687704853fb6fcfd74 Author: Jonathan Cameron Date: Sun Nov 28 17:24:38 2021 +0000 iio:amplifiers:hmc425a: Suppress clang W=1 warning about pointer to enum conversion. Cast to a uintptr_t rather than directly to the enum. As per the discussion in below linked media patch. Link: https://lore.kernel.org/linux-media/CAK8P3a2ez6nEw4d+Mqa3XXAz0RFTZHunqqRj6sCt7Y_Eqqs0rw@mail.gmail.com/ Signed-off-by: Jonathan Cameron Cc: Arnd Bergmann Cc: Mauro Carvalho Chehab Reviewed-by: Nathan Chancellor Link: https://lore.kernel.org/r/20211128172445.2616166-6-jic23@kernel.org commit 7926f8a8c7060896a45ffad9d0ac1154b9d67190 Author: Jonathan Cameron Date: Sun Nov 28 17:24:37 2021 +0000 iio:adc:ti-ads1015: Suppress clang W=1 warning about pointer to enum conversion. Cast to a uintptr_t rather than directly to the enum. As per the discussion in below linked media patch. Link: https://lore.kernel.org/linux-media/CAK8P3a2ez6nEw4d+Mqa3XXAz0RFTZHunqqRj6sCt7Y_Eqqs0rw@mail.gmail.com/ Signed-off-by: Jonathan Cameron Cc: Arnd Bergmann Cc: Mauro Carvalho Chehab Reviewed-by: Nathan Chancellor Link: https://lore.kernel.org/r/20211128172445.2616166-5-jic23@kernel.org commit 835122a333dc3a0866398b41047e5b293286a9ce Author: Jonathan Cameron Date: Sun Nov 28 17:24:36 2021 +0000 iio:adc:rcar: Suppress clang W=1 warning about pointer to enum conversion. Cast to a uintptr_t rather than directly to the enum. As per the discussion in below linked media patch. Link: https://lore.kernel.org/linux-media/CAK8P3a2ez6nEw4d+Mqa3XXAz0RFTZHunqqRj6sCt7Y_Eqqs0rw@mail.gmail.com/ Signed-off-by: Jonathan Cameron Cc: Arnd Bergmann Cc: Mauro Carvalho Chehab Reviewed-by: Nathan Chancellor Link: https://lore.kernel.org/r/20211128172445.2616166-4-jic23@kernel.org commit 702bab85d6cdb8aba464f3c8758399edc7368ff2 Author: Jonathan Cameron Date: Sun Nov 28 17:24:35 2021 +0000 iio:adc:ina2xx-adc: Suppress clang W=1 warning about pointer to enum conversion. Cast to a uintptr_t rather than directly to the enum. As per the discussion in below linked media patch. Link: https://lore.kernel.org/linux-media/CAK8P3a2ez6nEw4d+Mqa3XXAz0RFTZHunqqRj6sCt7Y_Eqqs0rw@mail.gmail.com/ Signed-off-by: Jonathan Cameron Cc: Arnd Bergmann Cc: Mauro Carvalho Chehab Reviewed-by: Nathan Chancellor Link: https://lore.kernel.org/r/20211128172445.2616166-3-jic23@kernel.org commit dfdded9b0b3fe355b72790218d3577f9d7975371 Merge: 5c4a5b36e43e0 ef5ad26085115 Author: Arnd Bergmann Date: Tue Dec 21 15:37:20 2021 +0100 Merge tag 'qcom-dts-for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/dt Qualcomm DeviceTree updates for v5.17 To SDX55 this introduces the description of the IPA, PCIe PHY and PCIe endpoint controller, as well as enables these for the FN960 device. The SDX65 5G platform is introduced, currently with definitions necessary to boot to a shell. The undocumented property "input-name" is dropped throughout the dts files, dwc3 nodes throughout gains more specific compatibles and lastly building of the Dragonboard 410c DTB on ARM32 is enabled, in addition to its normal operation in 64-bit mode. * tag 'qcom-dts-for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: ARM: dts: qcom: Drop input-name property ARM: dts: qcom: sdx65: Add pincontrol node ARM: dts: qcom: Add SDX65 platform and MTP board support dt-bindings: arm: qcom: Document SDX65 platform and boards dt-bindings: clock: Add SDX65 GCC clock bindings ARM: dts: qcom: Build apq8016-sbc/DragonBoard 410c DTB on ARM32 ARM: dts: qcom: sdx55-t55: Enable IPA ARM: dts: qcom: sdx55-fn980: Enable IPA ARM: dts: qcom: sdx55-fn980: Enable PCIe EP ARM: dts: qcom: sdx55: Add support for PCIe EP ARM: dts: qcom: sdx55-fn980: Enable PCIE0 PHY ARM: dts: qcom: sdx55: Add support for PCIe PHY ARM: dts: qcom: update USB nodes with new platform specific compatible Link: https://lore.kernel.org/r/20211221042154.3621955-1-bjorn.andersson@linaro.org Signed-off-by: Arnd Bergmann commit 5d55cbc720cc3650aafed6c1f5dbcf7e3f276312 Author: Rob Herring Date: Tue Dec 21 08:07:43 2021 -0400 regulator: dt-bindings: samsung,s5m8767: Move fixed string BUCK9 to 'properties' There's no need for a fixed string like 'BUCK9' to be under 'patternProperties', so move it under 'properties' instead. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211221120744.1118518-1-robh@kernel.org Signed-off-by: Mark Brown commit 585cba9d424e6cd9eda50c3397280ac320cbf832 Author: Haibo Chen Date: Tue Dec 21 16:44:48 2021 +0800 MAINTAINERS: Add i.MX sdhci maintainer Add myself as the i.MX sdhci driver maintainer. Signed-off-by: Haibo Chen Link: https://lore.kernel.org/r/1640076288-32714-1-git-send-email-haibo.chen@nxp.com Signed-off-by: Ulf Hansson commit 18c7e03400aeb48f9d51df453b7ace5391ef4d29 Author: Sander Vanheule Date: Sat Dec 18 11:05:11 2021 +0100 MIPS: generic: enable SMP on SMVP systems In addition to CPS SMP setups, also try to initialise MT SMP setups with multiple VPEs per CPU core. CMP SMP support is not provided as it is considered deprecated. Additionally, rework the code by dropping the err variable and make it similar to how other platforms perform this initialisation. Co-developed-by: INAGAKI Hiroshi Signed-off-by: INAGAKI Hiroshi Signed-off-by: Sander Vanheule Signed-off-by: Thomas Bogendoerfer commit 047ff68b43d4dc912dd89d8e156e74af9f69ca93 Author: Sander Vanheule Date: Sat Dec 18 11:05:10 2021 +0100 MIPS: only register MT SMP ops if MT is supported Verify that the current CPU actually supports multi-threading before registering MT SMP ops, instead of unconditionally registering them if the kernel is compiled with CONFIG_MIPS_MT_SMP. Suggested-by: Jiaxun Yang Signed-off-by: Sander Vanheule Signed-off-by: Thomas Bogendoerfer commit 95339b70677dc6f9a2d669c4716058e71b8dc1c7 Author: Tianjia Zhang Date: Thu Dec 16 17:50:14 2021 +0800 MIPS: Octeon: Fix build errors using clang A large number of the following errors is reported when compiling with clang: cvmx-bootinfo.h:326:3: error: adding 'int' to a string does not append to the string [-Werror,-Wstring-plus-int] ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NULL) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cvmx-bootinfo.h:321:20: note: expanded from macro 'ENUM_BRD_TYPE_CASE' case x: return(#x + 16); /* Skip CVMX_BOARD_TYPE_ */ ~~~^~~~ cvmx-bootinfo.h:326:3: note: use array indexing to silence this warning cvmx-bootinfo.h:321:20: note: expanded from macro 'ENUM_BRD_TYPE_CASE' case x: return(#x + 16); /* Skip CVMX_BOARD_TYPE_ */ ^ Follow the prompts to use the address operator '&' to fix this error. Signed-off-by: Tianjia Zhang Reviewed-by: Nathan Chancellor Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Bogendoerfer commit 13ee75c7b57c546f7973984d9a87cfa7d73cbf5c Merge: 9593bdfa1d146 e395f021ccebc Author: Arnd Bergmann Date: Tue Dec 21 13:42:51 2021 +0100 Merge tag 'qcom-drivers-for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/drivers Qualcomm driver updates for v5.17 This introduces RPM power-domain support for the SM8450, SM6125 and QCM2290 platforms. It them clean up the platform-based naming of the resources definitions throughout the RPMh PD driver. The last-level cache controller driver gains SM8350 support. The RPM sleep stats driver gains support for several older systems that had a slightly different memory layout for this information. The socinfo gains SM8450, SM6350 and SM7227 definitions. In addition to the DeviceTree binding updates related to these changes new compatibles was added to describe the SM8450 and the Kryo 780 CPU. Lastly a few typo and style fixes are introduced. * tag 'qcom-drivers-for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: (27 commits) soc: qcom: rpmh-rsc: Fix typo in a comment soc: qcom: socinfo: Add SM6350 and SM7225 dt-bindings: arm: msm: Don't mark LLCC interrupt as required dt-bindings: firmware: scm: Add SM6350 compatible dt-bindings: arm: msm: Add LLCC for SM6350 soc: qcom: rpmhpd: Sort power-domain definitions and lists soc: qcom: rpmhpd: Remove mx/cx relationship on sc7280 soc: qcom: rpmhpd: Rename rpmhpd struct names soc: qcom: rpmhpd: sm8450: Add the missing .peer for sm8450_cx_ao soc: qcom: socinfo: add SM8450 ID soc: qcom: rpmhpd: Add SM8450 power domains dt-bindings: power: rpmpd: Add SM8450 to rpmpd binding soc: qcom: smem: Update max processor count dt-bindings: arm: qcom: Document SM8450 SoC and boards dt-bindings: firmware: scm: Add SM8450 compatible dt-bindings: arm: cpus: Add kryo780 compatible soc: qcom: rpmpd: Add support for sm6125 dt-bindings: qcom-rpmpd: Add sm6125 power domains soc: qcom: aoss: constify static struct thermal_cooling_device_ops PM: AVS: qcom-cpr: Use div64_ul instead of do_div ... Link: https://lore.kernel.org/r/20211221040452.3620633-1-bjorn.andersson@linaro.org Signed-off-by: Arnd Bergmann commit a474e52c3109870946755925ce379d730a6dcaf7 Author: Paul Cercueil Date: Mon Dec 20 19:08:40 2021 +0000 mmc: jz4740: Support using a bi-directional DMA channel Since the MMC/SD controller in Ingenic SoCs work in half-duplex, it is possible to use one single DMA channel for both TX and RX operations, instead of using separate channels. As some older Ingenic SoCs offer only a handful of DMA channels, supporting bi-directional channels allow more hardware to use the channels that would otherwise be used for the MMC/SD operation. Signed-off-by: Paul Cercueil Link: https://lore.kernel.org/r/20211220190840.108061-3-paul@crapouillou.net Signed-off-by: Ulf Hansson commit 34ce29302323b9bf438a3c16dbd6a95d08c4ab66 Author: Paul Cercueil Date: Mon Dec 20 19:08:39 2021 +0000 dt-bindings: mmc: ingenic: Support using bi-directional DMA channel Update the binding documentation and the examples to support bi-directional DMA channels. Signed-off-by: Paul Cercueil Link: https://lore.kernel.org/r/20211220190840.108061-2-paul@crapouillou.net Signed-off-by: Ulf Hansson commit 1a6fe7bbc7d28e619377232a9810c822299112aa Author: Mårten Lindahl Date: Mon Dec 20 12:30:26 2021 +0100 mmc: dw_mmc: Do not wait for DTO in case of error When running the ARTPEC-8 DWMMC IP version, and a data error interrupt comes during a data read transfer, there is no guarantee for the data transfer over interrupt (DTO) to come within the specified data timeout. This case is handled by the dto_timer handler which will complete the request with the comment: /* * If DTO interrupt does NOT come in sending data state, * we should notify the driver to terminate current transfer * and report a data timeout to the core. */ But since the ARTPEC-8 DWMMC IP version, supports an extended TMOUT register which allows longer timeouts than the non ARTPEC-8 version does, waiting for the dto_timer to complete the request in error cases may cause the request to take significantly longer time than necessary. This is specifically true for the failing steps during tuning of a device. Fix this by completing the request when the error interrupt comes. Since this fix is specific for the ARTPEC-8, a quirk is added. Signed-off-by: Mårten Lindahl Link: https://lore.kernel.org/r/20211220113026.21129-5-marten.lindahl@axis.com Signed-off-by: Ulf Hansson commit 25d5417a90fd44cefa9af670ca358cae2f184f8b Author: Mårten Lindahl Date: Mon Dec 20 12:30:25 2021 +0100 mmc: dw_mmc: Add driver callbacks for data read timeout Current dw_mci driver supports a TMOUT register which consists of a 24 bit field (TMOUT[31:8]) for the DATA_TIMEOUT. The maximum value of this field is 0xFFFFFF, which with a 200MHz clock will give a full DRTO of: 0xFFFFFF / 200000000 => ~84 ms However, the ARTPEC-8 SoC DWMMC IP version has a TMOUT register with an extended DATA_TIMEOUT field, which supports longer timers for the DRTO. In this version the DATA_TIMEOUT field is split into two, which with the same 200MHz clock as above will allow a maximum timeout of: ((TMOUT[10:8] -1) * 0xFFFFFF + TMOUT[31:11] * 8) / 200000000 => ~587 ms Add driver callbacks for implementation specific data timeout, and implement callback functions for the ARTPEC-8 SoC. Signed-off-by: Mårten Lindahl Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20211220113026.21129-4-marten.lindahl@axis.com Signed-off-by: Ulf Hansson commit 91e2ca227b4112640b2acb7a8698651ce814e93a Author: Mårten Lindahl Date: Mon Dec 20 12:30:24 2021 +0100 mmc: dw_mmc-exynos: Add support for ARTPEC-8 The ARTPEC-8 SoC has a DWMMC controller that is compatible with the Exynos 7 version v2.70a. The main differences from Exynos 7 is that it does not support HS400 and has extended data read timeout. This patch adds compatibility string "axis,artpec8-dw-mshc" for ARTPEC-8, and DW_MCI_TYPE_ARTPEC8 is added to the dw_mci_exynos_type. Signed-off-by: Mårten Lindahl Acked-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20211220113026.21129-3-marten.lindahl@axis.com Signed-off-by: Ulf Hansson commit d7d87484bea9a8fd25f58f045b371a6be5c354a9 Author: Mårten Lindahl Date: Mon Dec 20 12:30:23 2021 +0100 dt-bindings: mmc: exynos-dw-mshc: Add support for ARTPEC-8 The ARTPEC-8 SoC has a DWMMC controller that is compatible with the Exynos 7 version v2.70a. The main differences from Exynos 7 is that it does not support HS400 and has extended data read timeout. Add compatibility string "axis,artpec8-dw-mshc" for ARTPEC-8. Signed-off-by: Mårten Lindahl Reviewed-by: Krzysztof Kozlowski Acked-by: Rob Herring Link: https://lore.kernel.org/r/20211220113026.21129-2-marten.lindahl@axis.com Signed-off-by: Ulf Hansson commit d8be1357edc891b4259e3ecc1b831452361379ac Author: Maarten Lankhorst Date: Thu Dec 16 15:27:43 2021 +0100 drm/i915: Add ww ctx to i915_gem_object_trylock This is required for i915_gem_evict_vm, to be able to evict the entire VM, including objects that are already locked to the current ww ctx. Signed-off-by: Maarten Lankhorst Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20211216142749.1966107-12-maarten.lankhorst@linux.intel.com commit be7612fd6665f5ef3f6c89e78bb4ec4dbff6cd16 Author: Maarten Lankhorst Date: Thu Dec 16 15:27:42 2021 +0100 drm/i915: Require object lock when freeing pages during destruction TTM already requires this, and we require it for delayed destroy. Signed-off-by: Maarten Lankhorst Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20211216142749.1966107-11-maarten.lankhorst@linux.intel.com commit 2c3849baf2908d646b7466be52989835341551c4 Author: Maarten Lankhorst Date: Thu Dec 16 15:27:41 2021 +0100 drm/i915: Trylock the object when shrinking We're working on requiring the obj->resv lock during unbind, fix the shrinker to take the object lock. Signed-off-by: Maarten Lankhorst Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20211216142749.1966107-10-maarten.lankhorst@linux.intel.com commit 8fc9a77bc64e1f23d07953439817d8402ac9706f Author: Sergey Shtylyov Date: Fri Dec 17 23:27:17 2021 +0300 mmc: meson-mx-sdio: 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: ed80a13bb4c4 ("mmc: meson-mx-sdio: Add a driver for the Amlogic Meson8 and Meson8b SoC") Signed-off-by: Sergey Shtylyov Reviewed-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20211217202717.10041-3-s.shtylyov@omp.ru Signed-off-by: Ulf Hansson commit 77bed755e0f06135faccdd3948863703f9a6e640 Author: Sergey Shtylyov Date: Fri Dec 17 23:27:16 2021 +0300 mmc: meson-mx-sdhc: 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: e4bf1b0970ef ("mmc: host: meson-mx-sdhc: new driver for the Amlogic Meson SDHC host") Signed-off-by: Sergey Shtylyov Reviewed-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20211217202717.10041-2-s.shtylyov@omp.ru Signed-off-by: Ulf Hansson commit ebc4dcf1625a30de23510175abe6fd0035d72cdb Author: Dan Carpenter Date: Fri Dec 17 18:03:48 2021 +0300 mmc: dw_mmc: clean up a debug message The "0x" prefix is redundant when # flag is used. It prints "0x0x". Signed-off-by: Dan Carpenter Reviewed-by: Mårten Lindahl Link: https://lore.kernel.org/r/20211217150348.GD16611@kili Signed-off-by: Ulf Hansson commit c064bb5c78c1b1e11a359993e5022795c65c5475 Author: Hector Martin Date: Thu Dec 16 01:10:45 2021 +0900 mmc: sdhci-pci-gli: GL975[50]: Issue 8/16-bit MMIO reads as 32-bit reads. For some reason, <32-bit reads do not work on Apple ARM64 platforms with these chips (even though they do on other PCIe devices). Issue them as 32-bit reads instead. This is done unconditionally, as it shouldn't hurt even if not necessary. Acked-by: Adrian Hunter Signed-off-by: Hector Martin Link: https://lore.kernel.org/r/20211215161045.38843-3-marcan@marcan.st Signed-off-by: Ulf Hansson commit 189f1d9bc3a5ea3e442e119e4a5deda63da8c462 Author: Hector Martin Date: Thu Dec 16 01:10:44 2021 +0900 mmc: sdhci-pci-gli: GL9755: Support for CD/WP inversion on OF platforms This is required on some Apple ARM64 laptops using this controller. As is typical on DT platforms, pull these quirks from the device tree using the standard mmc bindings. See Documentation/devicetree/bindings/mmc/mmc-controller.yaml Acked-by: Adrian Hunter Signed-off-by: Hector Martin Link: https://lore.kernel.org/r/20211215161045.38843-2-marcan@marcan.st Signed-off-by: Ulf Hansson commit 1ccaa1bdcc42d22c7f96b0444ae3ff082cb2a122 Author: Joel Stanley Date: Wed Dec 15 11:43:36 2021 +1030 mmc: core: Fix blk_status_t handling Sparse spits out this following warning: drivers/mmc/core/queue.c:311:21: warning: incorrect type in assignment (different base types) drivers/mmc/core/queue.c:311:21: expected int ret drivers/mmc/core/queue.c:311:21: got restricted blk_status_t [usertype] drivers/mmc/core/queue.c:314:21: warning: incorrect type in assignment (different base types) drivers/mmc/core/queue.c:314:21: expected int ret drivers/mmc/core/queue.c:314:21: got restricted blk_status_t [usertype] drivers/mmc/core/queue.c:336:16: warning: incorrect type in return expression (different base types) drivers/mmc/core/queue.c:336:16: expected restricted blk_status_t drivers/mmc/core/queue.c:336:16: got int [assigned] ret ret is only used for blk_status_t types, so make it that type. Signed-off-by: Joel Stanley Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211215011336.194089-1-joel@jms.id.au Signed-off-by: Ulf Hansson commit 36240ef8665b24d42ee3ac03b85f25bc6761ed13 Author: Yann Gautier Date: Wed Dec 15 15:17:27 2021 +0100 mmc: mmci: add hs200 support for stm32 sdmmc Use feedback clock for HS200 mode, as for SDR104. The HS200 mode can be enabled through DT by using mmc-hs200-1_8v. It is possible to use it on STM32MP13, but not STM32MP15 platforms. Signed-off-by: Ludovic Barre Signed-off-by: Yann Gautier Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20211215141727.4901-5-yann.gautier@foss.st.com Signed-off-by: Ulf Hansson commit 4481ab602cedf93bd8fdb9ded6977dd4b14a27e3 Author: Yann Gautier Date: Wed Dec 15 15:17:25 2021 +0100 mmc: mmci: increase stm32 sdmmcv2 clock max freq The variant->f_max is dependent on the IP, not on the SoC where it is embedded. Set the max frequency of its source clock to 267MHz. The frequency used will be limited by the IOs max frequency, set in the SoC device tree. Signed-off-by: Yann Gautier Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20211215141727.4901-3-yann.gautier@foss.st.com Signed-off-by: Ulf Hansson commit 5471fe8b383f82d9a20f8ac577c1f1cc3b9dbe5c Author: Yann Gautier Date: Wed Dec 15 15:17:24 2021 +0100 mmc: mmci: Add support for sdmmc variant revision v2.2 The change is only hardware, and does not need driver change: Added hardware flow control during transmit packet with variable delay. The new id is then added to the ids list structure. Signed-off-by: Yann Gautier Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20211215141727.4901-2-yann.gautier@foss.st.com Signed-off-by: Ulf Hansson commit b59a8c90537fc2018a09fba3f425aef69b93768e Merge: 552bc46484b3a ff31ee0a0f471 Author: Ulf Hansson Date: Tue Dec 21 13:04:51 2021 +0100 Merge branch 'fixes' into next commit 552bc46484b3a303b9d20d58c69fdd16c6690200 Author: Yann Gautier Date: Fri Dec 10 10:18:34 2021 +0100 dt-bindings: mmc: mmci: Add st,stm32-sdmmc2 compatible Although this compatible is not used in kernel, as we use the common MMCI driver, it is used by bootloaders. The U-Boot driver was merged before the kernel driver and uses this compatible. To avoid issues when aligning device tree files between kernel and boot loader, the ST dedicated compatible is added to bindings file. Signed-off-by: Yann Gautier Acked-by: Linus Walleij Acked-by: Rob Herring Link: https://lore.kernel.org/r/20211210091834.28958-1-yann.gautier@foss.st.com Signed-off-by: Ulf Hansson commit ce96a964682ac11a7f6823397dfdb5026d459f37 Author: Marek Szyprowski Date: Mon Dec 20 17:50:04 2021 +0100 arm64: exynos: Enable Exynos Multi-Core Timer driver Some ARM64 Exynos SoCs have MCT timer block, e.g. Exynos850 and Exynos5433. CLKSRC_EXYNOS_MCT option is not visible unless COMPILE_TEST is enabled. Select CLKSRC_EXYNOS_MCT option for ARM64 ARCH_EXYNOS like it's done in arch/arm/mach-exynos/Kconfig, to enable MCT timer support for ARM64 Exynos SoCs. Even though ARM architected timer is available on all ARM64 SoCs, and used for managing timer hardware and clock source events, MCT timer still can be used as a wakeup source, as stated in commitae460fd9164b ("clocksource/drivers/exynos_mct: Prioritise Arm arch timer on arm64"). It's also nice to be able to test available MCT IP-core. Signed-off-by: Marek Szyprowski Signed-off-by: Sam Protsenko Signed-off-by: Krzysztof Kozlowski Tested-by: Chanwoo Choi Reviewed-by: Krzysztof Kozlowski Reviewed-by: Chanwoo Choi Link: https://lore.kernel.org/r/20211101193531.15078-3-semen.protsenko@linaro.org Link: https://lore.kernel.org/r/20211220165004.17005-2-krzysztof.kozlowski@canonical.com' Signed-off-by: Arnd Bergmann commit 0d2589aa5ca99821486be8b7ff9c747665b9c2c9 Author: Sam Protsenko Date: Mon Dec 20 17:50:03 2021 +0100 arm64: defconfig: Enable Samsung I2C driver i2c-s3c2410 driver is needed for some arm64 Exynos SoCs, e.g. Exynos850. Signed-off-by: Sam Protsenko Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20211121150558.21801-1-semen.protsenko@linaro.org Link: https://lore.kernel.org/r/20211220165004.17005-1-krzysztof.kozlowski@canonical.com' Signed-off-by: Arnd Bergmann commit 567617baac2a55a63119f1516fe5395baa1f3205 Author: Colin Ian King Date: Fri Nov 26 22:18:48 2021 +0000 EDAC/sb_edac: Remove redundant initialization of variable rc The variable rc is being initialized with a value that is never read, it is being updated later on. The assignment is redundant and thus remove it. Signed-off-by: Colin Ian King Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20211126221848.1125321-1-colin.i.king@gmail.com commit bcbddc4f9d020a4a0b881cc065729c3aaeb28098 Author: Emmanuel Grumbach Date: Mon Dec 20 14:33:18 2021 +0200 iwlwifi: mei: wait before mapping the shared area The shared area is a DMA memory allocated in the host and mapped so that the host and the CSME firmware can exchange data. It is mapped through a dedicated PCI device that is driven by the mei bus driver. The bus driver is in charge of allocating and mapping this memory. It also needs to configure the CSME firmware with a specific set of commands, so that the CSME firmware will know that this memory is meant to be used by its internal WLAN module. For this, the CSME firmware first needs to completely initialize its WLAN module and only then get the mapping request. The problem is that the mei bus enumeration completes before the WLAN is completely ready. This means that the WLAN module's initialization is racing with iwlmei's allocation and mapping flow. Testing showed a problem in resume flows where iwlmei was too fast and the DMA mapping failed. Add a delay to avoid this. This is still racy, but our measurements showed that we have a good margin and we should now be safe. Fixes: 2da4366f9e2c ("iwlwifi: mei: add the driver to allow cooperation with CSME") Signed-off-by: Emmanuel Grumbach Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211220142940.8b6279e3d0be.I6fe128b0b86149a85535104822c8355b367887c8@changeid Signed-off-by: Luca Coelho commit 013f9e63553185f351ef5cd695bda2caba7758fc Author: Emmanuel Grumbach Date: Mon Dec 20 14:33:17 2021 +0200 iwlwifi: mei: clear the ownership when the driver goes down When the driver is unregistered, CSME will take ownership on the device. Reflect this in the iwlmei object so that we will remember to re-ask for ownership when the driver will register again. Not doing so will cause CSME not to give the host ownership and we will see the following error message when trying to bring up the interface: iwlwifi 0000:a9:00.0: iwl_pcie_prepare_card_hw iwl_trans_prepare_card_hw enter iwlwifi 0000:a9:00.0: iwl_pcie_set_hw_ready hardware not ready iwlwifi 0000:a9:00.0: iwl_pcie_set_hw_ready hardware not ready iwlwifi 0000:a9:00.0: iwl_pcie_prepare_card_hw Couldn't prepare the card but SAP is connected iwlwifi 0000:a9:00.0: Error while preparing HW: -16 Signed-off-by: Emmanuel Grumbach Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211220142940.c7bb5b7644df.I48498d9fd6e3959562205af67aa5f1a822eb762d@changeid Signed-off-by: Luca Coelho commit c3c3e9a7d0b1a3aadad334e54331bb654004880c Author: Mukesh Sisodiya Date: Sun Dec 19 13:28:36 2021 +0200 iwlwifi: yoyo: fix issue with new DBGI_SRAM region read. NIC has been grabbed for reading twice which is leading to NIC hang. Code correction are done for reading data with no grab function. Signed-off-by: Mukesh Sisodiya Link: https://lore.kernel.org/r/iwlwifi.20211219132536.55527214f8c9.I1748215ccb3fa20a3491a46a49b12e04eb560ac6@changeid Signed-off-by: Luca Coelho commit 0c91204517df3cb8db30d348e79ec5a9a524518c Author: Johannes Berg Date: Sun Dec 19 13:28:35 2021 +0200 iwlwifi: fw: fix some scan kernel-doc Some devices also use iwl_scan_config_v2 struct, so link it in the documentation for SCAN_CFG_CMD. Fix a bunch of kernel-doc as well. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211219132536.3331df94b106.If6c96b0d386e1c5988c8da6b69257e8f2e737f07@changeid Signed-off-by: Luca Coelho commit 459fc0f2c6b0f6e280bfa0f230c100c9dfe3a199 Author: Luca Coelho Date: Sun Dec 19 13:28:34 2021 +0200 iwlwifi: pcie: make sure prph_info is set when treating wakeup IRQ In some rare cases when the HW is in a bad state, we may get this interrupt when prph_info is not set yet. Then we will try to dereference it to check the sleep_notif element, which will cause an oops. Fix that by ignoring the interrupt if prph_info is not set yet. Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211219132536.0537aa562313.I183bb336345b9b3da196ba9e596a6f189fbcbd09@changeid Signed-off-by: Luca Coelho commit 73ca8763eb5a524c2cfadb6ee429ab0da3a42102 Author: Johannes Berg Date: Sun Dec 19 13:28:33 2021 +0200 iwlwifi: mvm: remove card state notification code This notification ID was actually used for something else we never implemented, but luckily we only had some debug code here. Just remove it. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211219132536.a67b5b9db259.Ic55b306fcd2a3525b3993f4b7e00622dd95053ba@changeid Signed-off-by: Luca Coelho commit 8ccb768c2368b1c3b2341852c2bcdfb48d028bae Author: Johannes Berg Date: Sun Dec 19 13:28:32 2021 +0200 iwlwifi: mvm: drop too short packets silently There's little value in this warning, we get a warning here if firmware passes us a short packet, particularly in monitor mode. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211219132536.305d12cf51ac.I2e4e6874113b1e5d8ee467b8a2d90820cc6ddde9@changeid Signed-off-by: Luca Coelho commit f0337cb48f3bf5f0bbccc985d8a0a8c4aa4934b7 Author: Avraham Stern Date: Sun Dec 19 13:28:31 2021 +0200 iwlwifi: mvm: fix AUX ROC removal When IWL_UCODE_TLV_CAPA_SESSION_PROT_CMD is set, removing a time event always tries to cancel session protection. However, AUX ROC does not use session protection so it was never removed. As a result, if the driver tries to allocate another AUX ROC event right after cancelling the first one, it will fail with a warning. In addition, the time event data passed to iwl_mvm_remove_aux_roc_te() is incorrect. Fix it. Signed-off-by: Avraham Stern Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211219132536.915e1f69f062.Id837e917f1c2beaca7c1eb33333d622548918a76@changeid Signed-off-by: Luca Coelho commit 22a1ee8e1e59ccbe6eb9072604e0625ac736228c Author: Mordechay Goodstein Date: Sun Dec 19 13:28:30 2021 +0200 iwlwifi: return op_mode only in case the failure is from MEI Currently we always return the op_mode with valid pointer in case getting NVM failed, while it's only relevant for cases that CSME is the owner of the nic. Fix this by checking also who's the owner of the nic. Signed-off-by: Mordechay Goodstein Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211219132536.b1e96021b616.Id0164855f2dd01ecdecf79b239d6ee5974882245@changeid Signed-off-by: Luca Coelho commit 0792df6881d0f9fe75df6b1431f4ee099c2caeb2 Author: Johannes Berg Date: Sun Dec 19 13:28:29 2021 +0200 iwlwifi: mvm: support Bz TX checksum offload Support TX checksum offload for Bz devices, where we have full checksum offload (NETIF_F_HW_CSUM) and the hardware doesn't need to parse the IP headers or anything. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211219132536.c0f44c98b36d.I75a688f3ac80cbe824c459ece4bb67843b9fce76@changeid Signed-off-by: Luca Coelho commit c3f40c3e0273392b8c01351cf53f5183e1b06289 Author: Miri Korenblit Date: Sun Dec 19 13:28:28 2021 +0200 iwlwifi: mvm: add US/CA to TAS block list if OEM isn't allowed If OEM isn't in the allowed list, TAS should be disabled in US/CA. Currently, if the OEM isn't allowed - we're sending the TAS only if we are not in US or CA. But this country check is done before we even know the country (usually the configuration is ZZ in that stage). So do the following instead: 1. Check if the current OEM is in the allowed list 2. If not - add US and CA to tas_block_list_array 3. Send the TAS table to FW. Signed-off-by: Miri Korenblit Signed-off-by: Luca Coelho commit b0ae61dd59734085b211f26caf8a0b5fd35548e8 Author: Ayala Beker Date: Sun Dec 19 13:28:27 2021 +0200 iwlwifi: mvm: correctly set schedule scan profiles Set scan offload profiles auth algorithms with valid algorithms only. Signed-off-by: Ayala Beker Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211219132536.525f2d468d22.I4d497d6a0a14ffb833f7edc7e980d26bbf8d7527@changeid Signed-off-by: Luca Coelho commit 6bb2ea37c02db98cb677f978cfcb833ca608c5eb Author: Avraham Stern Date: Sun Dec 19 13:28:26 2021 +0200 iwlwifi: mvm: set protected flag only for NDP ranging Don't use protected ranging negotiation for FTM ranging as responders that support only FTM ranging don't expect the FTM request to be protected. Signed-off-by: Avraham Stern Fixes: 517a5eb9fab2 ("iwlwifi: mvm: when associated with PMF, use protected NDP ranging negotiation") Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211219132536.f50ed0e3c6b3.Ibff247ee9d4e6e0a1a2d08a3c8a4bbb37e6829dd@changeid Signed-off-by: Luca Coelho commit dbe6f76a23ce8adbd77dcbb9a9ca5927c89dfd25 Author: Yaara Baruch Date: Sun Dec 19 13:28:25 2021 +0200 iwlwifi: pcie: add killer devices to the driver add killer subsystem devices from the 1675i and 1675s family to the driver. Signed-off-by: Yaara Baruch Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211219132536.2d5bec2d7b68.Icffb4e27390e6a5c76a0cbe7abf7472558f323d6@changeid Signed-off-by: Luca Coelho commit f4745cbb17572209a7fa27a6796ed70e7ada860b Author: Avraham Stern Date: Sun Dec 19 12:18:20 2021 +0200 iwlwifi: mvm: perform 6GHz passive scan after suspend The 6GHz passive scan is performed only once every 50 minutes. However, in case of suspend/resume, the regulatory information is reset, so 6GHz channels may become disabled. Fix it by performing a 6GHz passive scan within 60 seconds after suspend/resume even if the 50 minutes timeout did not expire yet. Signed-off-by: Avraham Stern Fixes: e8fe3b41c3a3 ("iwlwifi: mvm: Add support for 6GHz passive scan") Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211219121514.6d5c043372cf.I251dd5618a3f0b8febbcca788eb861f1cd6039bc@changeid Signed-off-by: Luca Coelho commit 39e9e7962d55764e590f3e95bbb7d1e37d920909 Author: Ayala Beker Date: Sun Dec 19 12:18:19 2021 +0200 iwlwifi: mvm: correctly set channel flags In case of forced passive scan on a UHB channel, don't set the direct probe option for this channel. Signed-off-by: Ayala Beker Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211219121514.0ede76a9ca92.Ie64a4df79ea9c485ae3d2fc043319e8f79cefa8e@changeid Signed-off-by: Luca Coelho commit 8bdc52b90db8cdca4475dffadb549c183b0b7aac Author: Miri Korenblit Date: Sun Dec 19 12:18:18 2021 +0200 iwlwifi: mvm: always store the PPAG table as the latest version. In case of a conflict between BIOS version and FW version of the PPAG table - the values arrive in the FW in the wrong places. This happens because we're storing the table in different structures depending on the BIOS version, not on the FW version, and so the FW doesn't get what it expect to. Always store the table in a v2 structure (which is a superset of v1 and v0). Also store the table in a structured way and in it's own structure, rather then storing it in the ppag command structure, similarly to the WRDS, EWRD and WGDS tables. Signed-off-by: Miri Korenblit Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211219121514.793a509da7bd.Ia176746a28b816b5f788cce9a281139735909e2a@changeid Signed-off-by: Luca Coelho commit c286aecae21009f7126ccb58c4377ac512fb247f Author: Luca Coelho Date: Sun Dec 19 12:18:17 2021 +0200 iwlwifi: bump FW API to 69 for AX devices Start supporting API version 69 for AX devices. Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211219121514.7d8fe0dffaea.I2de65c1efd9ab464d4158a3d852f73efe63024f8@changeid Signed-off-by: Luca Coelho commit 40a0b38d7a7f91a6027287e0df54f5f547e8d27e Author: Ilan Peer Date: Sun Dec 19 12:18:16 2021 +0200 iwlwifi: mvm: Fix calculation of frame length The RADA might include in the Rx frame the MIC and CRC bytes. These bytes should be removed for non monitor interfaces and should not be passed to mac80211. Fix the Rx processing to remove the extra bytes on non monitor cases. Signed-off-by: Ilan Peer Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211219121514.098be12c801e.I1d81733d8a75b84c3b20eb6e0d14ab3405ca6a86@changeid Signed-off-by: Luca Coelho commit 998e1aba6e5eb35370eaf30ccc1823426ec11f90 Author: Nathan Errera Date: Sun Dec 19 12:18:15 2021 +0200 iwlwifi: mvm: test roc running status bits before removing the sta In some cases the sta is being removed twice since we do not test the roc aux running before removing it. Start looking at the bit before removing the sta. Signed-off-by: Nathan Errera Fixes: 2c2c3647cde4 ("iwlwifi: mvm: support ADD_STA_CMD_API_S ver 12") Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211219121514.d5376ac6bcb0.Ic5f8470ea60c072bde9d1503e5f528b65e301e20@changeid Signed-off-by: Luca Coelho commit ac9952f6954216be72a8bde210e1ef2c949d8ee0 Author: Luca Coelho Date: Sun Dec 19 12:18:14 2021 +0200 iwlwifi: don't pass actual WGDS revision number in table_revision The FW API for PER_CHAIN_LIMIT_OFFSET_CMD is misleading. The element name is table_rev, but it shouldn't actually contain the table revision number, but whether we should use the South Korea scheme or not. Fix the driver so that we only set this value to either 0 or 1. It will only be 1 (meaning South Korea) if the ACPI WGDS table revision is 1. Signed-off-by: Luca Coelho Fixes: 664c011b763e ("iwlwifi: acpi: support reading and storing WGDS revision 2") Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211219121514.abed3b8119c7.I1fdc2c14577523fcffdfe8fb5902c2d8efde7e09@changeid Signed-off-by: Luca Coelho commit ddb6b76b6f96afb2977c3c460acf18cc0dd13cae Author: Mukesh Sisodiya Date: Sun Dec 19 12:18:13 2021 +0200 iwlwifi: yoyo: support TLV-based firmware reset Support resetting the firmware via TLV-based debugging. When applied, this will cause the driver to reset the firmware when the debugging is triggered. Signed-off-by: Mukesh Sisodiya Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211219121514.d59b29653a1e.I7b3be4a1ad1a9d5d0e86259740e89ac113c9348b@changeid Signed-off-by: Luca Coelho commit 3efdf03bf68b5752ce150f94939f21247e5a0d4a Author: Johannes Berg Date: Sun Dec 19 12:18:12 2021 +0200 iwlwifi: mvm: change old-SN drop threshold Increment the threshold to avoid dropping too eagerly. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211219121514.0e947ed458c4.Ia376cbea5f59df4b4474f0bd33ab033e84535cce@changeid Signed-off-by: Luca Coelho commit 6438e3e0c5e8171d461428bc83f90d2a52a4db5a Author: Johannes Berg Date: Sun Dec 19 12:18:11 2021 +0200 iwlwifi: mvm: don't trust hardware queue number We don't really have much reason to mistrust the hardware queue number, but if it gets mixed up we still don't want to access some data out of bounds, so drop such frames. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211219121514.539aecb91247.I6e555a5185bad30d7d1a4659f9c0b99325425f18@changeid Signed-off-by: Luca Coelho commit b6f5b647f694fdee06ddfdcb1cb3162b00de29fb Author: Johannes Berg Date: Sun Dec 19 12:18:10 2021 +0200 iwlwifi: mvm: handle RX checksum on Bz devices On Bz devices, the hardware checksums including the SNAP header, starting directly after the MAC header, so we don't need the extra checks and can just pass the checksum to mac80211. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211219121514.8ef59da4e05e.Ide87c2dc8fa08eae55c013a625f4ece5184b1b63@changeid Signed-off-by: Luca Coelho commit 6772aab732e0e0db74ccc5c018307187e0e43910 Author: Johannes Berg Date: Sun Dec 19 12:18:09 2021 +0200 iwlwifi: mvm: use a define for checksum flags mask For the upcoming Bz devices, we will set NETIF_F_HW_CSUM instead of NETIF_F_IP_CSUM and NETIF_F_IPV6_CSUM. However, we still need to be able to remove all the checksum bits, so add a mask for the removal, and keep the old define for the feature advertisement. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211219121514.f05488ce8b83.I65bb83721498d8433e4ee2b09415eb74ab579445@changeid Signed-off-by: Luca Coelho commit 6518f83ffa51131daaf439b66094f684da3fb0ae Author: Johannes Berg Date: Fri Dec 10 11:12:45 2021 +0200 iwlwifi: remove module loading failure message When CONFIG_DEBUG_TEST_DRIVER_REMOVE is set, iwlwifi crashes when the opmode module cannot be loaded, due to completing the completion before using drv->dev, which can then already be freed. Fix this by removing the (fairly useless) message. Moving the completion later causes a deadlock instead, so that's not an option. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/20211210091245.289008-2-luca@coelho.fi Signed-off-by: Luca Coelho commit fbdacb30b4e733cb18d10d739fd4824f7787d384 Author: Johannes Berg Date: Fri Dec 10 11:12:44 2021 +0200 iwlwifi: mvm: isolate offload assist (checksum) calculation Isolate the entire calculation of the offload_assist field used for HW checksumming to the iwl_mvm_tx_csum function. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211210110539.796ae29c90d9.Icb2f07905bebd9ed4537ca4c453069211ea71799@changeid Signed-off-by: Luca Coelho commit 773a042fddf25b452987bce418bd8a4a41767d6e Author: Avraham Stern Date: Fri Dec 10 11:12:43 2021 +0200 iwlwifi: mvm: add support for OCE scan In case the fw supports OCE scan and one of the OCE feature flags are set in the scan request, set the corresponding flag in the firmware scan request. Note that new firmware that indicates OCE support does not support the probe deferral and suppression feature (which is optional). Signed-off-by: Avraham Stern Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211210110539.3dd63c381839.Id79b39f650103bb9b851e31ed6a0178e81988587@changeid Signed-off-by: Luca Coelho commit ab07506b0454bea606095951e19e72c282bfbb42 Author: Johannes Berg Date: Fri Dec 10 11:12:42 2021 +0200 iwlwifi: fix leaks/bad data after failed firmware load If firmware load fails after having loaded some parts of the firmware, e.g. the IML image, then this would leak. For the host command list we'd end up running into a WARN on the next attempt to load another firmware image. Fix this by calling iwl_dealloc_ucode() on failures, and make that also clear the data so we start fresh on the next round. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211210110539.1f742f0eb58a.I1315f22f6aa632d94ae2069f85e1bca5e734dce0@changeid Signed-off-by: Luca Coelho commit ccbffd690ec21b0891bf437ef5df9e5c63e0a980 Author: Johannes Berg Date: Fri Dec 10 11:12:41 2021 +0200 iwlwifi: fix debug TLV parsing Debug TLV parsing was missing size checks, so if a valid but too short TLV was encountered, it would attempt to read it. If the firmware file was arranged to be a multiple of pages long with this happening just before the end, it could crash reading out-of-bounds of a vmalloc area. Fix this by adding the relevant size check. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211210110539.84848da8067f.Ifb4f80c95d283ec62e495a7928069af711b5fee2@changeid Signed-off-by: Luca Coelho commit 8b0f92549f2c2458200935c12a2e2a6e80234cf5 Author: Johannes Berg Date: Sun Dec 19 11:14:18 2021 +0200 iwlwifi: mvm: fix 32-bit build in FTM On a 32-bit build, the division here needs to be done using do_div(), otherwise the compiler will try to call a function that doesn't exist, thus failing to build. Fixes: b68bd2e3143a ("iwlwifi: mvm: Add FTM initiator RTT smoothing logic") Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211219111352.e56cbf614a4d.Ib98004ccd2c7a55fd883a8ea7eebd810f406dec6@changeid Signed-off-by: Luca Coelho commit 4cd177b43a1443924c56c6d94b8a77be762a3976 Author: Johannes Berg Date: Fri Dec 10 11:12:39 2021 +0200 iwlwifi: dump RCM error tables There's another set of error tables on newer (Bz) hardware, support finding and dumping those error tables if present. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211210110539.c727a975b434.Ie5ad3fd974b700f1b90867b2b52ef7607799e8fe@changeid Signed-off-by: Luca Coelho commit 57417e1bf9d95449e1d9e4547a69886f9bd16f87 Author: Johannes Berg Date: Fri Dec 10 11:12:38 2021 +0200 iwlwifi: dump both TCM error tables if present There can be two TCMs in a given device, dump both of the error tables if present. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211210110539.887cba319301.Ifdc3f617f7e0e3e39c90e8c208e60f11b3bb9404@changeid Signed-off-by: Luca Coelho commit 9ae4862b95a3536f036f81ed3e487bcd5314602f Author: Johannes Berg Date: Fri Dec 10 11:12:37 2021 +0200 iwlwifi: dump CSR scratch from outer function We shouldn't dump this twice if we have two TCMs, and it really doesn't belong to the TCM dump anyway, so move this out. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211210110539.b58a02f27512.Idbfbc430776a7abda0eb086215fb64f2c9307ac0@changeid Signed-off-by: Luca Coelho commit aece8927a6512e194309751f5981be4482efbf19 Author: Johannes Berg Date: Fri Dec 10 11:12:36 2021 +0200 iwlwifi: parse error tables from debug TLVs With more things being added, we're no longer going to duplicate the error tables from the debug TLVs nor send them at runtime. Use the debug TLVs to find the locations of the error tables. As we've never released firmware using IWL_UCODE_TLV_TCM_DEBUG_ADDRS just remove that entirely. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211210110539.779d68490f68.I472c7d9cbaca46000a10ec18808ef54836b33a8a@changeid Signed-off-by: Luca Coelho commit ced50f1133af12f7521bb777fcf4046ca908fb77 Author: Ilan Peer Date: Fri Dec 10 09:06:21 2021 +0200 iwlwifi: mvm: Increase the scan timeout guard to 30 seconds With the introduction of 6GHz channels the scan guard timeout should be adjusted to account for the following extreme case: - All 6GHz channels are scanned passively: 58 channels. - The scan is fragmented with the following parameters: 3 fragments, 95 TUs suspend time, 44 TUs maximal out of channel time. The above would result with scan time of more than 24 seconds. Thus, set the timeout to 30 seconds. Cc: stable@vger.kernel.org Signed-off-by: Ilan Peer Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211210090244.3c851b93aef5.I346fa2e1d79220a6770496e773c6f87a2ad9e6c4@changeid Signed-off-by: Luca Coelho commit 1db385c668d3ccb04ccdb5f0f190fd17b2db29c6 Author: Luca Coelho Date: Fri Dec 10 09:06:20 2021 +0200 iwlwifi: recognize missing PNVM data and then log filename We can detect that a FW SYSASSERT is due to missing PNVM data by checking the assertion code. When this happens, it's is useful for the user if we print the filename where the driver is looking for the data. Add the PNVM missing assertion code to the dump list and print out the name of the file we're looking for when this happens. Reported-by: Sam Edwards Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211210090244.1d8725b7518a.I0c36617a7282bd445cda484d97ac4a83022706ee@changeid Signed-off-by: Luca Coelho commit ae4c1bb06b66ccf3b6de73f246c2d862d958abfe Author: Mordechay Goodstein Date: Fri Dec 10 09:06:19 2021 +0200 iwlwifi: rs: add support for TLC config command ver 4 The new version enables support for EHT mode configurations. The name of IWL_TLC_HT_BW_NONE_160 change to IWL_TLC_MCS_PER_BW_80 to make the difference from 80 bandwidth (non 160), and the new bandwidth 320 which is also non 160. Signed-off-by: Mordechay Goodstein Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211210090244.7d1a57f3df1b.Ibc01dde2b064329ad5f5bcefa83d1998d557cbdb@changeid Signed-off-by: Luca Coelho commit 5c3310c2b7c98d8f1be4c8c131c6b33fd9578591 Author: Gregory Greenman Date: Fri Dec 10 09:06:18 2021 +0200 iwlwifi: mvm: rfi: update rfi table After some lab experimentation with different DDRs, need to update the table. Also, arrange it by frequency and not by DDR type since now the table contains a super-set of all possible conflicts. Signed-off-by: Gregory Greenman Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211210090244.6f2fca102739.I8b5e37a00c50b7b51f7d377216dde91e71faffba@changeid Signed-off-by: Luca Coelho commit 92fd0ce96da7c806ee5f95300d1efd40ae63c935 Author: Mike Golant Date: Fri Dec 10 09:06:17 2021 +0200 iwlwifi: add support for BNJ HW Add support for BNJ HW with GF, GF4, HR1, FM and FM4 RF modules Signed-off-by: Mike Golant Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211210090244.e94c1f921245.I8cba209b1366dc0636a04711fc6a85539ca878d0@changeid Signed-off-by: Luca Coelho commit 2856f623ce4888253b68cc2214f9297be7f8562a Author: Ayala Barazani Date: Fri Dec 10 09:06:16 2021 +0200 iwlwifi: mvm: Add list of OEMs allowed to use TAS Add list of vendors that are allowed to use TAS and check it against the value provided in the SMBIOS manufacturer field. Initially add the following approved vendors: HP, Dell, Lenovo and Samsung. Signed-off-by: Ayala Barazani Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211210090244.27fe6abf2e4c.I806e4b47dabddaa8ac27172e7cfa3d719c100e8f@changeid Signed-off-by: Luca Coelho commit 7c530588405d2c8230c42c3014311c22d79c6d2b Author: Miri Korenblit Date: Fri Dec 10 09:06:15 2021 +0200 iwlwifi: mvm: support revision 1 of WTAS table A new revision of WTAS was added in order to support IEC optimisation. Add support for reading the new revision from ACPI and passing it to the FW. Signed-off-by: Miri Korenblit Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211210090244.ff455b9d66bd.Ic7c1460e89f6b22101f3c5a2ea438031c7f11771@changeid Signed-off-by: Luca Coelho commit f1c0bb74b38fbb53d7590a579a464a3dc59f249c Author: Matti Gottlieb Date: Fri Dec 10 09:06:14 2021 +0200 iwlwifi: Read the correct addresses when getting the crf id The original implementation checked the HW family, and as a result of that used different addresses for the prph registers. The old HWs addresses start with 0xa****** and the newer ones start with 0xd******. For this there are iwl_read/write_umac_prph functions that just add the diff in the address automatically (in this case 0x300000), so the code will be common for all HWs In the original implementation the address given already had the 0xd****** causing the address to become 0x10***** (after adding the offset) Change the registers to start with 0xa*****. Signed-off-by: Matti Gottlieb Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211210090244.db2722547eb2.I03dce63698befc2fd9105111c3015b8d6e36868a@changeid Signed-off-by: Luca Coelho commit 2b0ceda953d527bb440f9ab6b5839a713f532117 Author: Mike Golant Date: Fri Dec 10 09:06:13 2021 +0200 iwlwifi: pcie: add jacket bit to device configuration parsing Some devices have same HW ID's and the only way to differentiate them is by checking the jacket bit. Signed-off-by: Mike Golant Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211210090244.cffa843734d3.I01963e494c459efde5d909c1085cd561e0df9df9@changeid Signed-off-by: Luca Coelho commit 15664c1cbc732a3ed6b70354320fea36818588ff Author: Johannes Berg Date: Fri Dec 10 09:06:12 2021 +0200 iwlwifi: fw: remove dead error log code The struct iwl_error_event_table_v1 is unused, remove it. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211210090244.eb33452fcdc6.I8133ef3aaa0234cb116189c87d22c3f10235105e@changeid Signed-off-by: Luca Coelho commit fdfde0cb79264f88992e72b5a056a3a3284fcaad Author: Johannes Berg Date: Fri Dec 10 09:06:11 2021 +0200 iwlwifi: fix Bz NMI behaviour Contrary to what was stated before, the hardware hasn't changed the bits here yet. In any case, the new CSR is also directly (lower 16 bits) connected to UREG_DOORBELL_TO_ISR6, so if it still changes the changes would be there. Adjust the code and comments accordingly. Signed-off-by: Johannes Berg Fixes: 6c0795f1a524 ("iwlwifi: implement Bz NMI behaviour") Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211210090244.75b6207536e3.I7d170a48a9096e6b7269c3a9f447c326f929b171@changeid Signed-off-by: Luca Coelho commit 9160955a80e2819434dd1897080a8fc6cadbb86f Author: Bjoern A. Zeeb Date: Wed Mar 10 14:39:58 2021 +0000 iwlwifi: do not use __unused as variable name On various systems __unused is a define to __attribute__((__unused__)) and yields compile errors as a result. Use __spare instead to describe that these bits are "unused". Sponsored by: The FreeBSD Foundation Signed-off-by: Bjoern A. Zeeb Signed-off-by: Luca Coelho commit ff1676391aa9a59c36c755724807f349a6b5a1b6 Author: Bjoern A. Zeeb Date: Wed Mar 10 14:40:23 2021 +0000 iwlwifi: iwl-eeprom-parse: mostly dvm only Most of iwl-eeprom-parse.c is only used for dvm but not for mvm. Hide the parts under #if IS_ENABLED(CONFIG_IWLDVM) to reduce size and code surface for mvm-only builds. Sponsored by: The FreeBSD Foundation Signed-off-by: Bjoern A. Zeeb Signed-off-by: Luca Coelho commit 2ac885f4f49137c23251fd1dff7632abe2efebea Author: Dan Carpenter Date: Wed Nov 10 11:09:22 2021 +0300 iwlwifi: mvm: clean up indenting in iwl_mvm_tlc_update_notif() These lines need to be indented one more tab. Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20211110080922.GF5176@kili Signed-off-by: Luca Coelho commit 18c11e2f4c659ae12eb1427974c34c93526330b8 Author: Dan Carpenter Date: Wed Nov 10 11:07:59 2021 +0300 iwlwifi: mvm: fix a stray tab This line was indented too far and was a bit confusing. Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20211110080759.GE5176@kili Signed-off-by: Luca Coelho commit c48c94b0ab75ef3bbfa539e6e212184e315fd5bd Author: Yang Li Date: Tue Dec 21 09:14:55 2021 +0800 net/sched: use min() macro instead of doing it manually Fix following coccicheck warnings: ./net/sched/cls_api.c:3333:17-18: WARNING opportunity for min() ./net/sched/cls_api.c:3389:17-18: WARNING opportunity for min() ./net/sched/cls_api.c:3427:17-18: WARNING opportunity for min() Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: David S. Miller commit e233897b1f7a859092bd20b10bfd412013381a10 Author: Yang Guang Date: Tue Dec 21 17:15:59 2021 +0800 w1: w1_therm: use swap() to make code cleaner Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid opencoding it. Reported-by: Zeal Robot Signed-off-by: David Yang Signed-off-by: Yang Guang Link: https://lore.kernel.org/r/cb14f9e6e86cf8494ed2ddce6eec8ebd988908d9.1640077704.git.yang.guang5@zte.com.cn Signed-off-by: Greg Kroah-Hartman commit 79f1c7304295bbbc611bc53cfd5425b777b3e840 Author: Andy Shevchenko Date: Thu Dec 9 14:30:08 2021 +0200 kernfs: Replace kernel.h with the necessary inclusions When kernel.h is used in the headers it adds a lot into dependency hell, especially when there are circular dependencies are involved. Replace kernel.h inclusion with the list of what is really being used. Acked-by: Tejun Heo Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211209123008.3391-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit c95cc0d95702523f8f361b802c9b7d4eeae07f5d Author: William Breathitt Gray Date: Tue Dec 21 17:16:48 2021 +0900 counter: 104-quad-8: Fix persistent enabled events bug A bug exists if the user executes a COUNTER_ADD_WATCH_IOCTL ioctl call, and then executes a COUNTER_DISABLE_EVENTS_IOCTL ioctl call. Disabling the events should disable the 104-QUAD-8 interrupts, but because of this bug the interrupts are not disabling. The reason this bug is occurring is because quad8_events_configure() is called when COUNTER_DISABLE_EVENTS_IOCTL is handled, but the next_irq_trigger[] array has not been cleared before it is checked in the loop. This patch fixes the bug by removing the next_irq_trigger array and instead utilizing a different algorithm of walking the events_list list for the current requested events. When a COUNTER_DISABLE_EVENTS_IOCTL is handled, events_list will be empty and thus all device channels end up with interrupts disabled. Fixes: 7aa2ba0df651 ("counter: 104-quad-8: Add IRQ support for the ACCES 104-QUAD-8") Cc: Syed Nayyar Waris Signed-off-by: William Breathitt Gray Link: https://lore.kernel.org/r/5fd5731cec1c251acee30eefb7c19160d03c9d39.1640072891.git.vilhelm.gray@gmail.com Signed-off-by: Greg Kroah-Hartman commit 60f07e74f86b47973bc1dc82e2128973932be55f Author: Uwe Kleine-König Date: Tue Dec 21 17:16:47 2021 +0900 counter: ti-eqep: Use container_of instead of struct counter_device::priv Using counter->priv is a memory read and so more expensive than container_of which is only an addition. (In this case even a noop because the offset is 0.) So container_of is expected to be a tad faster, it's type-safe, and produces smaller code (ARCH=arm allmodconfig): $ source/scripts/bloat-o-meter drivers/counter/ti-eqep.o-pre drivers/counter/ti-eqep.o add/remove: 0/0 grow/shrink: 0/9 up/down: 0/-108 (-108) Function old new delta ti_eqep_position_enable_write 132 120 -12 ti_eqep_position_enable_read 260 248 -12 ti_eqep_position_ceiling_write 132 120 -12 ti_eqep_position_ceiling_read 236 224 -12 ti_eqep_function_write 220 208 -12 ti_eqep_function_read 372 360 -12 ti_eqep_count_write 312 300 -12 ti_eqep_count_read 236 224 -12 ti_eqep_action_read 664 652 -12 Total: Before=4598, After=4490, chg -2.35% Acked-by: David Lechner Signed-off-by: Uwe Kleine-König Signed-off-by: William Breathitt Gray Link: https://lore.kernel.org/r/4bde7cbd9e43a5909208102094444219d3154466.1640072891.git.vilhelm.gray@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0032ca576a79946492194ae4860b462d32815c66 Author: Yanteng Si Date: Tue Dec 21 17:16:46 2021 +0900 counter: Add the necessary colons and indents to the comments of counter_compi Since commit aaec1a0f76ec ("counter: Internalize sysfs interface code") introduce a warning as: linux-next/Documentation/driver-api/generic-counter:234: ./include/linux/counter.h:43: WARNING: Unexpected indentation. linux-next/Documentation/driver-api/generic-counter:234: ./include/linux/counter.h:45: WARNING: Block quote ends without a blank line; unexpected unindent. Add the necessary colons and indents. Fixes: aaec1a0f76ec ("counter: Internalize sysfs interface code") Signed-off-by: Yanteng Si Signed-off-by: William Breathitt Gray Link: https://lore.kernel.org/r/26011e814d6eca02c7ebdbb92f171a49928a7e89.1640072891.git.vilhelm.gray@gmail.com Signed-off-by: Greg Kroah-Hartman commit 15c00b681760b4e0c0127439ab18cdce73ae1f0b Author: Rob Herring Date: Thu Dec 9 17:42:35 2021 +0000 dt-bindings: nvmem: Add missing 'reg' property With 'unevaluatedProperties' support implemented, the following warnings are generated in the nvmem examples: Documentation/devicetree/bindings/nvmem/st,stm32-romem.example.dt.yaml: efuse@1fff7800: Unevaluated properties are not allowed ('reg' was unexpected) Documentation/devicetree/bindings/nvmem/rmem.example.dt.yaml: nvram@10000000: Unevaluated properties are not allowed ('reg' was unexpected) Documentation/devicetree/bindings/nvmem/brcm,nvram.example.dt.yaml: nvram@1eff0000: Unevaluated properties are not allowed ('reg' was unexpected) Add the missing 'reg' property definition. Cc: Srinivas Kandagatla Cc: Maxime Coquelin Cc: Alexandre Torgue Cc: Rafał Miłecki Cc: Saenz Julienne Cc: Fabrice Gasnier Cc: linux-stm32@st-md-mailman.stormreply.com Cc: linux-arm-kernel@lists.infradead.org Reviewed-by: Fabrice Gasnier Reviewed-by: Thierry Reding Signed-off-by: Rob Herring Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20211209174235.14049-5-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 98e2c4efae214fb7086cac9117616eb6ea11475d Author: Chunfeng Yun Date: Thu Dec 9 17:42:34 2021 +0000 nvmem: mtk-efuse: support minimum one byte access stride and granularity In order to support nvmem bits property, should support minimum 1 byte read stride and minimum 1 byte read granularity at the same time. Signed-off-by: Chunfeng Yun Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20211209174235.14049-4-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 9d87b0ac80e3949b372108eb6b7ae172dc71ec5c Author: Chunfeng Yun Date: Thu Dec 9 17:42:33 2021 +0000 dt-bindings: nvmem: mediatek: add support for mt8195 Add compatible for mt8195 Acked-by: Rob Herring Signed-off-by: Chunfeng Yun Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20211209174235.14049-3-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit ae807879e6be321308ee4196275bfb8408858ba7 Author: Chunfeng Yun Date: Thu Dec 9 17:42:32 2021 +0000 dt-bindings: nvmem: mediatek: add support bits property Add support bits property, will satisfy more consumers. Acked-by: Rob Herring Signed-off-by: Chunfeng Yun Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20211209174235.14049-2-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 81e7b7f5dfbdadab1ac9e0c60b0e30633bab1183 Author: Minghao Chi Date: Wed Dec 15 06:04:38 2021 +0000 drivers/misc/ocxl: remove redundant rc variable Return value from ocxl_context_attach() directly instead of taking this in another redundant variable. Reported-by: Zeal Robot Acked-by: Andrew Donnellan Signed-off-by: Minghao Chi Link: https://lore.kernel.org/r/20211215060438.441918-1-chi.minghao@zte.com.cn Signed-off-by: Greg Kroah-Hartman commit 6da3f33770e08348691d90455ef6149e15551854 Author: Uladzislau Rezki (Sony) Date: Wed Dec 15 12:18:42 2021 +0100 misc: vmw_vmci: Switch to kvfree_rcu() API Instead of invoking a synchronize_rcu() to free a pointer after a grace period we can directly make use of new API that does the same but in more efficient way. Signed-off-by: Uladzislau Rezki (Sony) Link: https://lore.kernel.org/r/20211215111845.2514-6-urezki@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6d1e4927dedf5bf8998759961e3b28b967321cdd Author: Greg Kroah-Hartman Date: Tue Nov 30 09:46:26 2021 +0100 paride: fix up build warning on mips platforms MIPS include files define "PC" so when building the paride driver the following build warning shows up: rivers/block/paride/bpck.c:32: warning: "PC" redefined Fix this by undefining PC before redefining it as is done for other defines in this driver. Cc: Tim Waugh Acked-by: Jens Axboe Link: https://lore.kernel.org/r/20211130084626.3215987-1-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman commit 612d4904191ff9aca01b1e087d8687b3a223cb33 Author: Tiezhu Yang Date: Thu Dec 16 11:33:01 2021 +0800 rapidio: remove not used code about RIO_VID_TUNDRA According to https://rapidio.org/vendor-id/, there is no 0x000d vendor id in the complete and current list of VendorIDs, it means that the related code is dead code now, so just remove them. Signed-off-by: Tiezhu Yang Link: https://lore.kernel.org/r/1639625581-22867-3-git-send-email-yangtiezhu@loongson.cn Signed-off-by: Greg Kroah-Hartman commit 80a5ca99c5c04be6777df225ab932142a9d60c3f Author: Tiezhu Yang Date: Thu Dec 16 11:33:00 2021 +0800 rapidio: remove not used macro definition in rio_ids.h The definition of RIO_VID_FREESCALE, RIO_DID_MPC8560, RIO_DID_TSI500, RIO_DID_TSI576 and RIO_DID_TSI721 are not used for many years in the current code, so just remove them. Signed-off-by: Tiezhu Yang Link: https://lore.kernel.org/r/1639625581-22867-2-git-send-email-yangtiezhu@loongson.cn Signed-off-by: Greg Kroah-Hartman commit adbfddc757aec1ed54ccb35c4a7ca9170df827e0 Author: Yanteng Si Date: Thu Dec 9 17:24:39 2021 +0800 docs/driver-api: Replace a comma in the n_gsm.rst with a double colon Since b9e851cd4a87 ("tty: n_gsm: Add some instructions and code for requester") which introduced a warning: linux/Documentation/driver-api/serial/n_gsm.rst:23: WARNING: Definition list ends without a blank line; unexpected unindent. linux/Documentation/driver-api/serial/n_gsm.rst:100: WARNING: Definition list ends without a blank line; unexpected unindent. linux/Documentation/driver-api/serial/n_gsm.rst:115: WARNING: Inline emphasis start-string without end-string. linux/Documentation/driver-api/serial/n_gsm.rst:118: WARNING: Inline emphasis start-string without end-string. linux/Documentation/driver-api/serial/n_gsm.rst:120: WARNING: Inline emphasis start-string without end-string. linux/Documentation/driver-api/serial/n_gsm.rst:122: WARNING: Inline emphasis start-string without end-string. linux/Documentation/driver-api/serial/n_gsm.rst:125: WARNING: Inline emphasis start-string without end-string. linux/Documentation/driver-api/serial/n_gsm.rst:139: WARNING: Inline emphasis start-string without end-string. A paragraph consisting of two colons ("::") signifies that the following text block(s) comprise a literal block. Add soome blank lines. Signed-off-by: Yanteng Si Link: https://lore.kernel.org/r/20211209092439.562433-1-siyanteng@loongson.cn Signed-off-by: Greg Kroah-Hartman commit a8968521cfdc3e339fe69473d6632e0aa8d7202a Author: Michael Ellerman Date: Thu Dec 9 22:59:44 2021 +1100 selftests/powerpc: Add a test of sigreturning to the kernel We have a general signal fuzzer, sigfuz, which can modify the MSR & NIP before sigreturn. But the chance of it hitting a kernel address and also clearing MSR_PR is fairly slim. So add a specific test of sigreturn to a kernel address, both with and without attempting to clear MSR_PR (which the kernel must block). Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211209115944.4062384-1-mpe@ellerman.id.au commit 9cbbe6bae938dd335a5092b0ce41f88cb39ba40c Author: Rob Herring Date: Fri Dec 17 16:14:00 2021 -0600 powerpc/dts: Remove "spidev" nodes "spidev" is not a real device, but a Linux implementation detail. It has never been documented either. The kernel has WARNed on the use of it for over 6 years. Time to remove its usage from the tree. Signed-off-by: Rob Herring Reviewed-by: Mark Brown Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211217221400.3667133-1-robh@kernel.org commit bb84e64f8fb3b1341eb75075219a1f060afe9895 Author: Johan Hovold Date: Wed Dec 1 14:25:28 2021 +0100 firmware: qemu_fw_cfg: remove sysfs entries explicitly Explicitly remove the file entries from sysfs before dropping the final reference for symmetry reasons and for consistency with the rest of the driver. Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20211201132528.30025-5-johan@kernel.org Signed-off-by: Greg Kroah-Hartman commit 433b7cd1e702b0918ef90cbf06c3da24313625d2 Author: Johan Hovold Date: Wed Dec 1 14:25:27 2021 +0100 firmware: qemu_fw_cfg: fix sysfs information leak Make sure to always NUL-terminate file names retrieved from the firmware to avoid accessing data beyond the entry slab buffer and exposing it through sysfs in case the firmware data is corrupt. Fixes: 75f3e8e47f38 ("firmware: introduce sysfs driver for QEMU's fw_cfg device") Cc: stable@vger.kernel.org # 4.6 Cc: Gabriel Somlo Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20211201132528.30025-4-johan@kernel.org Signed-off-by: Greg Kroah-Hartman commit 47a1db8e797da01a1309bf42e0c0d771d4e4d4f3 Author: Johan Hovold Date: Wed Dec 1 14:25:26 2021 +0100 firmware: qemu_fw_cfg: fix kobject leak in probe error path An initialised kobject must be freed using kobject_put() to avoid leaking associated resources (e.g. the object name). Commit fe3c60684377 ("firmware: Fix a reference count leak.") "fixed" the leak in the first error path of the file registration helper but left the second one unchanged. This "fix" would however result in a NULL pointer dereference due to the release function also removing the never added entry from the fw_cfg_entry_cache list. This has now been addressed. Fix the remaining kobject leak by restoring the common error path and adding the missing kobject_put(). Fixes: 75f3e8e47f38 ("firmware: introduce sysfs driver for QEMU's fw_cfg device") Cc: stable@vger.kernel.org # 4.6 Cc: Gabriel Somlo Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20211201132528.30025-3-johan@kernel.org Signed-off-by: Greg Kroah-Hartman commit a57ac7acdcc1665662e369993898194def56e888 Author: Johan Hovold Date: Wed Dec 1 14:25:25 2021 +0100 firmware: qemu_fw_cfg: fix NULL-pointer deref on duplicate entries Commit fe3c60684377 ("firmware: Fix a reference count leak.") "fixed" a kobject leak in the file registration helper by properly calling kobject_put() for the entry in case registration of the object fails (e.g. due to a name collision). This would however result in a NULL pointer dereference when the release function tries to remove the never added entry from the fw_cfg_entry_cache list. Fix this by moving the list-removal out of the release function. Note that the offending commit was one of the benign looking umn.edu fixes which was reviewed but not reverted. [1][2] [1] https://lore.kernel.org/r/202105051005.49BFABCE@keescook [2] https://lore.kernel.org/all/YIg7ZOZvS3a8LjSv@kroah.com Fixes: fe3c60684377 ("firmware: Fix a reference count leak.") Cc: stable@vger.kernel.org # 5.8 Cc: Qiushi Wu Cc: Kees Cook Cc: Greg Kroah-Hartman Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20211201132528.30025-2-johan@kernel.org Signed-off-by: Greg Kroah-Hartman commit cab00a3e5e5efabecdbfe9d54dc8d779b2e59be3 Author: Jason Wang Date: Sun Dec 12 15:18:38 2021 +0800 applicom: unneed to initialise statics to 0 Static variables do not need to be initialised to 0, because compilers will initialise all uninitialised statics to 0. Thus, remove the unneeded initializations. Signed-off-by: Jason Wang Link: https://lore.kernel.org/r/20211212071838.304307-1-wangborong@cdjrlc.com Signed-off-by: Greg Kroah-Hartman commit 2d2802fb24de8cbacb4a2d6da2e002acc1c17143 Author: Kai Ye Date: Mon Dec 6 18:47:24 2021 +0800 uacce: use sysfs_emit instead of sprintf Use the sysfs_emit to replace sprintf. sprintf may cause output defect in sysfs content, it is better to use new added sysfs_emit function which knows the size of the temporary buffer. Signed-off-by: Kai Ye Link: https://lore.kernel.org/r/20211206104724.11559-1-yekai13@huawei.com Signed-off-by: Greg Kroah-Hartman commit 909c648e03e8eda8eb72678b3e95042739d6eb71 Author: Jason Wang Date: Sun Dec 12 11:16:57 2021 +0800 greybus: es2: fix typo in a comment The double `for' in the comment in line 81 is repeated. Remove one of them from the comment. Reviewed-by: Alex Elder Signed-off-by: Jason Wang Link: https://lore.kernel.org/r/20211212031657.41169-1-wangborong@cdjrlc.com Signed-off-by: Greg Kroah-Hartman commit d185a3466f0cd5af8f1c5c782c53bc0e6f2e7136 Author: Ben Hutchings Date: Mon Jun 18 23:55:40 2018 +0100 firmware: Update Kconfig help text for Google firmware The help text for GOOGLE_FIRMWARE states that it should only be enabled when building a kernel for Google's own servers. However, many of the drivers dependent on it are also useful on Chromebooks or on any platform using coreboot. Update the help text to reflect this double duty. Fixes: d384d6f43d1e ("firmware: google memconsole: Add coreboot support") Reviewed-by: Julius Werner Signed-off-by: Ben Hutchings Link: https://lore.kernel.org/r/20180618225540.GD14131@decadent.org.uk Signed-off-by: Greg Kroah-Hartman commit e80ca2e932056346f021d933b591d9d82b9cc93a Author: Ajith P V Date: Wed Dec 15 18:50:18 2021 +0530 binder: use proper cacheflush header file binder.c uses instead of . Hence change cacheflush header file to proper one. This change also avoid warning from checkpatch that shown below: WARNING: Use #include instead of Signed-off-by: Ajith P V Link: https://lore.kernel.org/r/20211215132018.31522-1-ajithpv.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit fdcee305c08a27c8d5d2d03eb5b2656ac3e4a0cc Merge: a4c1aaf97bf1d efa56eddf5d5c Author: Greg Kroah-Hartman Date: Tue Dec 21 10:07:07 2021 +0100 Merge tag 'coresight-next-v5.17' of gitolite.kernel.org:pub/scm/linux/kernel/git/coresight/linux into char-misc-next Mathieu writes: Coresight changes for v5.17 This pull request includes: - A patch that uses devm_bitmap_zalloc() instead of the open-coded equivalent. - Work to make coresight complex configuration loadable via modules. - Some coresight documentation updates. Signed-off-by: Mathieu Poirier * tag 'coresight-next-v5.17' of gitolite.kernel.org:pub/scm/linux/kernel/git/coresight/linux: coresight: core: Fix typo in a comment Documentation: coresight: Update coresight configuration docs coresight: configfs: Allow configfs to activate configuration coresight: syscfg: Example CoreSight configuration loadable module coresight: syscfg: Update load API for config loadable modules coresight: configuration: Update API to permit dynamic load/unload coresight: configuration: Update API to introduce load owner concept Documentation: coresight: Fix documentation issue coresight: Use devm_bitmap_zalloc when applicable commit a4c1aaf97bf1d7102ac538beaf7846b7c5d8c97d Merge: 1b18af40c1db1 98ceca2f29325 Author: Greg Kroah-Hartman Date: Tue Dec 21 10:05:01 2021 +0100 Merge tag 'fpga-for-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mdf/linux-fpga into char-misc-next Moritz writes: FPGA Manager changes for 5.17-rc1 Russ' patches rework the way we register FPGA managers, regions and bridges by simplifying the functions into a single register call. Nathan's patch addresses an unused variable warning that was introduced by Russ' patches. Yang's patch addresses a kernel doc warning. All patches have been reviewed on the mailing list, and have been in the last few linux-next releases (as part of our for-next branch) without issues. Signed-off-by: Moritz Fischer * tag 'fpga-for-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/mdf/linux-fpga: fpga: region: fix kernel-doc fpga: stratix10-soc: Do not use ret uninitialized in s10_probe() fpga: region: Use standard dev_release for class driver fpga: bridge: Use standard dev_release for class driver fpga: mgr: Use standard dev_release for class driver commit fb09d0ac07725b442b32dbf53f0ab0bea54804e9 Author: lianzhi chang Date: Wed Dec 15 20:51:25 2021 +0800 tty: Fix the keyboard led light display problem Use the "ctrl+alt+Fn" key combination to switch the system from tty to desktop or switch the system from desktop to tty. After the switch is completed, it is found that the state of the keyboard lock is inconsistent with the state of the keyboard Led light.The reasons are as follows: * The desktop environment (Xorg and other services) is bound to a tty (assuming it is tty1), and the kb->kbdmode attribute value of tty1 will be set to VC_OFF. According to the current code logic, in the desktop environment, the values of ledstate and kb->ledflagstate of tty1 will not be modified anymore, so they are always 0. * When switching between each tty, the final value of ledstate set by the previous tty is compared with the kb->ledflagstate value of the current tty to determine whether to set the state of the keyboard light. The process of switching between desktop and tty is also the process of switching between tty1 and other ttys. There are two situations: - (1) In the desktop environment, tty1 will not set the ledstate, which will cause when switching from the desktop to other ttys, if the desktop lights up the keyboard's led, after the switch is completed, the keyboard's led light will always be on; - (2) When switching from another tty to the desktop, this mechanism will trigger tty1 to set the led state. If other tty lights up the led of the keyboard before switching to the desktop, the led will be forcibly turned off. This situation should be avoided. * The current patch is to solve these problems: When VT is switched, the keyboard led needs to be set once.Ensure that after the switch is completed, the state of the keyboard LED is consistent with the state of the keyboard lock. Suggested-by: Dmitry Torokhov Reviewed-by: Dmitry Torokhov Signed-off-by: lianzhi chang Link: https://lore.kernel.org/r/20211215125125.10554-1-changlianzhi@uniontech.com Signed-off-by: Greg Kroah-Hartman commit 34de6666843d47a4564f540574402f621c689ea0 Author: Xianwei Zhao Date: Tue Dec 21 11:01:45 2021 +0800 dt-bindings: serial: amlogic, meson-uart: support S4 Add serial bindings support menson S4 SoC family. Signed-off-by: Xianwei Zhao Link: https://lore.kernel.org/r/20211221030146.522-1-xianwei.zhao@amlogic.com Signed-off-by: Greg Kroah-Hartman commit d6d9d17abac8d337ecb052b47e918ca9c0b4ba1b Author: Andy Shevchenko Date: Mon Dec 20 15:32:50 2021 +0200 tty: tty_io: Switch to vmalloc() fallback in case of TTY_NO_WRITE_SPLIT When TTY_NO_WRITE_SPLIT is set and 64 KiB chunks are used, allow vmalloc() fallback. Supply __GFP_RETRY_MAYFAIL to make kmalloc() preferable over vmalloc() since we may want a better performance. Note, both current users copy data to another buffer anyway, so the type of our allocation doesn't affect their expectations. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211220133250.3070-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit e822b4973f49015e1c6f63b91c8641ed9bfaf229 Author: Xiang wangx Date: Wed Dec 8 22:20:36 2021 +0800 tty/ldsem: Fix syntax errors in comments Delete the redundant word 'are'. Signed-off-by: Xiang wangx Link: https://lore.kernel.org/r/20211208142036.7956-1-wangxiang@cdjrlc.com Signed-off-by: Greg Kroah-Hartman commit ce1d37cb7697abcc3d892558acd33a1333596534 Author: Lad Prabhakar Date: Mon Dec 20 01:04:11 2021 +0000 usb: musb: dsps: Use platform_get_irq_byname() to get the interrupt platform_get_resource_byname(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq_byname(). Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211220010411.12075-7-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Greg Kroah-Hartman commit 78e17d69999521b52b9db9656e9b9b397f59f228 Author: Lad Prabhakar Date: Mon Dec 20 01:04:10 2021 +0000 usb: cdns3: Use platform_get_irq_byname() to get the interrupt platform_get_resource_byname(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq_byname(). Reviewed-by: Roger Quadros Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211220010411.12075-6-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Greg Kroah-Hartman commit d057ac484a370f90d0353b30ad0fab2b4f1adf27 Author: Lad Prabhakar Date: Mon Dec 20 01:04:09 2021 +0000 usb: isp1760: Use platform_get_irq() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Also use irq_get_trigger_type to get the IRQ trigger flags. Reviewed-by: Rui Miguel Silva Reviewed-by: Geert Uytterhoeven Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211220010411.12075-5-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Greg Kroah-Hartman commit 74b39dfabd76b8820aa96e6a8f8cc3cae8908710 Author: Lad Prabhakar Date: Mon Dec 20 01:04:08 2021 +0000 usb: dwc3: Drop unneeded calls to platform_get_resource_byname() Drop unneeded calls to platform_get_resource_byname() from dwc3_host_init(). dwc3_host_init() already calls dwc3_host_get_irq() which gets the irq number, just use this to get the IRQ resource data and fill the xhci_resources[1] Reviewed-by: Roger Quadros Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211220010411.12075-4-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Greg Kroah-Hartman commit 22ae6415c702680b1d3170717ce34ee31656f8b6 Author: Lad Prabhakar Date: Mon Dec 20 01:04:07 2021 +0000 usb: renesas_usbhs: Use platform_get_irq() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Drop irqflags member from struct usbhs_priv as this driver is used by two non DT users sh7757lcr and ecovec24 which do not pass IORESOURCE_IRQ_SHAREABLE as part of their pdata. Along this drop the IRQF_SHARED flag handling in the code. Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211220010411.12075-3-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Greg Kroah-Hartman commit 9198e0298efcc7108bf23f76badacd1717bbb281 Author: Lad Prabhakar Date: Mon Dec 20 01:04:06 2021 +0000 usb: host: fotg210: Use platform_get_irq() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq(). Reviewed-by: Geert Uytterhoeven Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211220010411.12075-2-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Greg Kroah-Hartman commit f28fb27ef72a045dc2a3db5621f178bb3216a00e Author: Changcheng Deng Date: Wed Dec 15 09:16:02 2021 +0000 xhci: use max() to make code cleaner Use max() in order to make code cleaner. Reported-by: Zeal Robot Signed-off-by: Changcheng Deng Link: https://lore.kernel.org/r/20211215091602.445009-1-deng.changcheng@zte.com.cn Signed-off-by: Greg Kroah-Hartman commit 01417e57939faffebfdeb2aef1f4388e95cf9271 Author: Wen Gong Date: Mon Dec 20 01:23:55 2021 -0500 ath11k: add regdb.bin download for regdb offload The regdomain is self-managed type for ath11k, the regdomain info is reported from firmware, it is not from wireless regdb. Firmware fetch the regdomain info from board data file before. Currently most of the regdomain info has moved to another file regdb.bin from board data file for some chips such as QCA6390 and WCN6855, so the regdomain info left in board data file is not enough to support the feature which need more regdomain info. After download regdb.bin, firmware will fetch the regdomain info from regdb.bin instead of board data file and report to ath11k. If it does not have the file regdb.bin, it also can initialize wlan success and firmware then fetch regdomain info from board data file. Add download the regdb.bin before download board data for some specific chip which support supports_regdb in hardware parameters. download regdb.bin log: [430082.334162] ath11k_pci 0000:05:00.0: chip_id 0x2 chip_family 0xb board_id 0x106 soc_id 0x400c0200 [430082.334169] ath11k_pci 0000:05:00.0: fw_version 0x110c8b4c fw_build_timestamp 2021-10-25 07:41 fw_build_id QC_IMAGE_VERSION_STRING=WLAN.HSP.1.1-02892-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3 [430082.334414] ath11k_pci 0000:05:00.0: boot firmware request ath11k/WCN6855/hw2.0/regdb.bin size 24310 output of "iw reg get" global country US: DFS-FCC (2402 - 2472 @ 40), (N/A, 30), (N/A) (5170 - 5250 @ 80), (N/A, 23), (N/A), AUTO-BW (5250 - 5330 @ 80), (N/A, 23), (0 ms), DFS, AUTO-BW (5490 - 5730 @ 160), (N/A, 23), (0 ms), DFS (5735 - 5835 @ 80), (N/A, 30), (N/A) (57240 - 63720 @ 2160), (N/A, 40), (N/A) phy#0 (self-managed) country US: DFS-FCC (2402 - 2472 @ 40), (6, 30), (N/A) (5170 - 5250 @ 80), (N/A, 24), (N/A), AUTO-BW (5250 - 5330 @ 80), (N/A, 24), (0 ms), DFS, AUTO-BW (5490 - 5730 @ 160), (N/A, 24), (0 ms), DFS, AUTO-BW (5735 - 5895 @ 160), (N/A, 30), (N/A), AUTO-BW (5945 - 7125 @ 160), (N/A, 24), (N/A), NO-OUTDOOR, AUTO-BW Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211220062355.17021-1-quic_wgong@quicinc.com commit 4daf08a0afa898d52f1f40db3ddf00489f2dc712 Author: Greg Kroah-Hartman Date: Tue Dec 21 07:14:05 2021 +0100 Revert "usb: host: ehci-sh: propagate errors from platform_get_irq()" This reverts commit 1aebf115afd730d1e0f773b8273b04b8681e1128 as the prerequsite commit for it is not in the tree. Cc: Alan Stern Reported-by: Sergey Shtylyov Signed-off-by: Greg Kroah-Hartman commit 27a0d0b846d9add93a65c25149aae14ec3f75524 Author: Vinod Koul Date: Thu Dec 16 16:38:13 2021 +0530 arm64: dts: qcom: sm8450-qrd: Enable USB nodes Enable the usb phy and usb controller in peripheral mode. This helps to get the adb working with the QRD board. Signed-off-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211216110813.658384-2-vkoul@kernel.org commit 19fd04fb9247fb5dce01919fa83ed037ec569247 Author: Vinod Koul Date: Thu Dec 16 16:38:12 2021 +0530 arm64: dts: qcom: sm8450: Add usb nodes SM8450 features a single USB controller which connects to both HS and SS phy. Add the USB and the phy nodes for Qualcomm SM8450 SoC. Signed-off-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211216110813.658384-1-vkoul@kernel.org commit 96ea2a4291343613a7c2da03c03f23dc259171ff Author: Vinod Koul Date: Wed Dec 15 17:08:03 2021 +0530 clk: qcom: turingcc-qcs404: explicitly include clk-provider.h Per Stephen, clk providers need to include clk-provider.h, so include in this driver as well Signed-off-by: Vinod Koul Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211215113803.620032-9-vkoul@kernel.org commit 737a2267581ac145db337081ae6fbf9f62feb47b Author: Vinod Koul Date: Wed Dec 15 17:08:02 2021 +0530 clk: qcom: q6sstop-qcs404: explicitly include clk-provider.h Per Stephen, clk providers need to include clk-provider.h, so include in this driver as well Signed-off-by: Vinod Koul Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211215113803.620032-8-vkoul@kernel.org commit 5bcc2521ec7053b0a99e20bbf8f18d6001a78e6c Author: Vinod Koul Date: Wed Dec 15 17:08:01 2021 +0530 clk: qcom: mmcc-apq8084: explicitly include clk-provider.h Per Stephen, clk providers need to include clk-provider.h, so include in this driver as well Signed-off-by: Vinod Koul Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211215113803.620032-7-vkoul@kernel.org commit 3333607bdd4f1a64a13741a252f2eee1bb0a442c Author: Vinod Koul Date: Wed Dec 15 17:08:00 2021 +0530 clk: qcom: lpasscc-sdm845: explicitly include clk-provider.h Per Stephen, clk providers need to include clk-provider.h, so include in this driver as well Signed-off-by: Vinod Koul Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211215113803.620032-6-vkoul@kernel.org commit 27f239a4c5e79a8e2f721b0ded24e1f34437d7f1 Author: Vinod Koul Date: Wed Dec 15 17:07:59 2021 +0530 clk: qcom: lpasscc-sc7280: explicitly include clk-provider.h Per Stephen, clk providers need to include clk-provider.h, so include in this driver as well Signed-off-by: Vinod Koul Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211215113803.620032-5-vkoul@kernel.org commit 1fc8887c04b28d294b71b802fca29a5fa667d7fa Author: Vinod Koul Date: Wed Dec 15 17:07:58 2021 +0530 clk: qcom: gcc-sm6350: explicitly include clk-provider.h Per Stephen, clk providers need to include clk-provider.h, so include in this driver as well Signed-off-by: Vinod Koul Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211215113803.620032-4-vkoul@kernel.org commit d7a49c8d2c67ab504b3959aafda290018d42b0e7 Author: Vinod Koul Date: Wed Dec 15 17:07:57 2021 +0530 clk: qcom: gcc-msm8994: explicitly include clk-provider.h Per Stephen, clk providers need to include clk-provider.h, so include in this driver as well Signed-off-by: Vinod Koul Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211215113803.620032-3-vkoul@kernel.org commit 33aa94fd94d7c1ca1af77f398c194bd82ebc6a98 Author: Vinod Koul Date: Wed Dec 15 17:07:56 2021 +0530 clk: qcom: gcc-sm8350: explicitly include clk-provider.h Per Stephen, clk providers need to include clk-provider.h, so include in this driver as well Signed-off-by: Vinod Koul Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211215113803.620032-2-vkoul@kernel.org commit 45cd8bbaaa18ab1c4f4387529db72b33be463197 Author: Jae Hyun Yoo Date: Mon Nov 8 11:01:58 2021 -0800 ARM: dts: aspeed: add LCLK setting into LPC KCS nodes If LPC KCS driver is registered ahead of lpc-ctrl module, LPC KCS hardware block will be enabled without heart beating of LCLK until lpc-ctrl enables the LCLK. This issue causes improper handling on host interrupts when the host sends interrupts in that time frame. Then kernel eventually forcibly disables the interrupt with dumping stack and printing a 'nobody cared this irq' message out. To prevent this issue, all LPC sub drivers should enable LCLK individually so this patch adds 'clocks' property setting into LPC KCS node as one of required properties to enable the LCLK by the LPC KCS driver. Note: dtbs should be re-compiled after applying this change since it's adding a new required property otherwise the driver will not be probed correctly. Signed-off-by: Jae Hyun Yoo Reviewed-by: Joel Stanley Reviewed-by: Andrew Jeffery Link: https://lore.kernel.org/r/20211108190200.290957-5-jae.hyun.yoo@intel.com Signed-off-by: Joel Stanley commit 002c42d37e45ff5b5248576c77437ccafb651454 Author: Jae Hyun Yoo Date: Mon Nov 8 11:01:56 2021 -0800 dt-bindings: ipmi: bt-bmc: add 'clocks' as a required property If LPC BT driver is registered ahead of lpc-ctrl module, LPC BT hardware block will be enabled without heart beating of LCLK until lpc-ctrl enables the LCLK. This issue causes improper handling on host interrupts when the host sends interrupts in that time frame. Then kernel eventually forcibly disables the interrupt with dumping stack and printing a 'nobody cared this irq' message out. To prevent this issue, all LPC sub drivers should enable LCLK individually so this patch adds 'clocks' property as one of required properties to enable the LCLK by the LPC IBT driver. Note: dtsi change in this patch series should be applied along with, and dtbs should be re-compiled after applying this series since it's adding a new required property otherwise the driver will not be probed correctly. Signed-off-by: Jae Hyun Yoo Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211108190200.290957-3-jae.hyun.yoo@intel.com Signed-off-by: Joel Stanley commit a350dc623e3678b9bc6c6385df72a66a1ee69c7f Author: Jae Hyun Yoo Date: Mon Nov 8 11:01:55 2021 -0800 ARM: dts: aspeed: add LCLK setting into LPC IBT node If LPC BT driver is registered ahead of lpc-ctrl module, LPC BT hardware block will be enabled without heart beating of LCLK until lpc-ctrl enables the LCLK. This issue causes improper handling on host interrupts when the host sends interrupts in that time frame. Then kernel eventually forcibly disables the interrupt with dumping stack and printing a 'nobody cared this irq' message out. To prevent this issue, all LPC sub drivers should enable LCLK individually so this patch adds 'clocks' property setting into LPC IBT node as one of required properties to enable the LCLK by the LPC IBT driver. Note: dtbs should be re-compiled after applying this change since it's adding a new required property otherwise the driver will not be probed correctly. Signed-off-by: Jae Hyun Yoo Reviewed-by: Joel Stanley Reviewed-by: Andrew Jeffery Link: https://lore.kernel.org/r/20211108190200.290957-2-jae.hyun.yoo@intel.com Signed-off-by: Joel Stanley commit 62589e873d8e7cef7efd583ace1bb6ec90f252b7 Author: Eddie James Date: Wed Dec 8 13:17:57 2021 -0600 ARM: dts: aspeed: p10: Add TPM device Add the Nuvoton NPCT75X, a TIS I2C TPM. Modified Eddie's change to include the general compatible string, and combine the rainier and everest patches. Signed-off-by: Eddie James Link: https://lore.kernel.org/r/20211208191758.20517-8-eajames@linux.ibm.com Signed-off-by: Joel Stanley commit 1fe5c05c7c25b5ffa66d623c790f39babd2f5e7f Author: Eddie James Date: Wed Dec 8 11:06:40 2021 -0600 ARM: dts: aspeed: p10: Enable USB host ports Ensure both controllers are enabled on, and add GPIO hog for USB power control to set the USB power to always on. Signed-off-by: Eddie James Link: https://lore.kernel.org/r/20211208170641.13322-1-eajames@linux.ibm.com Signed-off-by: Joel Stanley commit 30daf3cd8997d0ba4bda2b4a7f7c5122c81216f1 Author: Ali El-Haj-Mahmoud Date: Tue Nov 30 13:01:10 2021 -0500 ARM: dts: aspeed: Add TYAN S8036 BMC machine The TYAN S8036 is a server platform with an ASPEED AST2500 BMC. Signed-off-by: Ali El-Haj-Mahmoud Reviewed-by: Joel Stanley Link: https://lore.kernel.org/r/20211130180110.2217042-1-aaelhaj@google.com Signed-off-by: Joel Stanley commit 4fcbe1f5b6ba71e0c464a303e3769bf1ce1fe54c Author: Oskar Senft Date: Tue Nov 30 13:48:55 2021 -0500 ARM: dts: aspeed: tyan-s7106: Add uart_routing and fix vuart config Configure the vuart in such a way that it does not inhibit the SuperIO's UART from functioning correctly. This allows the same DTS to be used for both configurations with SuperIO and VUART (depending on the BIOS build). The decision on whether to actually enable VUART can then be made at runtime. This change also enables the new uart_routing driver for the SuperIO case. Signed-off-by: Oskar Senft Link: https://lore.kernel.org/r/20211130184855.1779353-1-osk@google.com Signed-off-by: Joel Stanley commit a8c729e966c4e9d033242d948b0e53c2a62d32e2 Author: Howard Chiu Date: Tue Dec 7 17:49:24 2021 +0800 ARM: dts: aspeed: Adding Facebook Bletchley BMC Initial introduction of Facebook Bletchley equipped with Aspeed 2600 BMC SoC. Signed-off-by: Howard Chiu Link: https://lore.kernel.org/r/20211207094923.422422-1-howard.chiu@quantatw.com Signed-off-by: Joel Stanley commit b26965e99788ea163fc217bdca1c2b17a5d70c90 Author: Lei YU Date: Fri Dec 10 17:36:23 2021 +0800 ARM: dts: aspeed: g220a: Enable secondary flash Enable the secondary flash of the g220a's BMC and the wdt2. Signed-off-by: Lei YU Link: https://lore.kernel.org/r/20211210093623.2140640-1-yulei.sh@bytedance.com Signed-off-by: Joel Stanley commit 0720caa3f81d6b8c1ee5d51d3d251dc43030e687 Author: Lei YU Date: Fri Dec 10 17:34:43 2021 +0800 ARM: dts: Add openbmc-flash-layout-64-alt.dtsi Add openbmc-flash-layout-64-alt.dtsi to describe the partitions of the secondary flash for OpenBMC's 64M static layout. The layout is the same as openbmc-flash-layout-64.dtsi and the labels are prepended with "alt-" for the partitions. Signed-off-by: Lei YU Reviewed-by: Patrick Williams Link: https://lore.kernel.org/r/20211210093443.2140557-1-yulei.sh@bytedance.com Signed-off-by: Joel Stanley commit fea289467608ffddb2f8d3a740912047974bb183 Author: Joel Stanley Date: Wed Nov 17 11:51:05 2021 +0800 ARM: dts: aspeed: Add secure boot controller node The ast2600 has a secure boot controller. Signed-off-by: Joel Stanley Reviewed-by: Ryan Chen Link: https://lore.kernel.org/r/20211117035106.321454-3-joel@jms.id.au Signed-off-by: Joel Stanley commit bc9fd597b3009d3412022c7beb3fbb01c9d27b31 Author: Joel Stanley Date: Wed Nov 17 11:51:04 2021 +0800 dt-bindings: aspeed: Add Secure Boot Controller bindings The secure boot controller was first introduced in the AST2600. Signed-off-by: Joel Stanley Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211117035106.321454-2-joel@jms.id.au Signed-off-by: Joel Stanley commit 37e11c3616f6182b6bd7f95a04df035b43464f39 Author: Ming Lei Date: Tue Dec 21 12:04:36 2021 +0800 block: call blk_exit_queue() before freeing q->stats blk_stat_disable_accounting() is added in commit 68497092bde9 ("block: make queue stat accounting a reference"), and called in kyber_exit_sched(). So we have to free q->stats after elevator is unloaded from blk_exit_queue() in blk_release_queue(). Otherwise kernel panic is caused. Fixes: 68497092bde9 ("block: make queue stat accounting a reference") Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20211221040436.1333880-1-ming.lei@redhat.com Signed-off-by: Jens Axboe commit a957b61254a7d59a6c14ee2ac2db20a62eb299a1 Author: Jens Axboe Date: Mon Dec 20 20:32:24 2021 -0700 block: fix error in handling dead task for ioprio setting Don't combine the task exiting and "already have io_context" case, we need to just abort if the task is marked as dead. Return -ESRCH, which is the documented value for ioprio_set() if the specified task could not be found. Reported-by: Dan Carpenter Reported-by: syzbot+8836466a79f4175961b0@syzkaller.appspotmail.com Fixes: 5fc11eebb4a9 ("block: open code create_task_io_context in set_task_ioprio") Signed-off-by: Jens Axboe commit 38fa8d3cacc0ee5a92068e1049c85aaff6bec6e0 Merge: 98bf33ca3f00d 11a95c583c1de Author: Mark Brown Date: Tue Dec 21 02:48:48 2021 +0000 ASoC: Use dev_err_probe() helper Merge series from Kuninori Morimoto : This patch-set tries to use dev_err_probe() helper function instead of manual dev_err() code. I hope ASoC will be more clean code by this patch-set. commit f7a5319b4477f7ebda28d7170c26394d1f240487 Merge: dbcefdeb2a580 6f60ecf233f9a Author: Jakub Kicinski Date: Mon Dec 20 18:42:43 2021 -0800 Merge branch 'net-amd-xgbe-add-support-for-yellow-carp-ethernet-device' Raju Rangoju says: ==================== net: amd-xgbe: Add support for Yellow Carp Ethernet device Add support for newer version of Hardware, the Yellow Carp Ethernet device ==================== Link: https://lore.kernel.org/r/20211220135428.1123575-1-rrangoju@amd.com Signed-off-by: Jakub Kicinski commit 6f60ecf233f9a8c6b75c08f4133865dbe0f1fdab Author: Raju Rangoju Date: Mon Dec 20 19:24:28 2021 +0530 net: amd-xgbe: Disable the CDR workaround path for Yellow Carp Devices Yellow Carp Ethernet devices do not require Autonegotiation CDR workaround, hence disable the same. Co-developed-by: Shyam Sundar S K Signed-off-by: Shyam Sundar S K Signed-off-by: Raju Rangoju Signed-off-by: Jakub Kicinski commit 2d4a0b79dc6194048f7aa49c38d827cd5b7db6f1 Author: Raju Rangoju Date: Mon Dec 20 19:24:27 2021 +0530 net: amd-xgbe: Alter the port speed bit range Newer generation Hardware uses the slightly different port speed bit widths, so alter the existing port speed bit range to extend support to the newer generation hardware while maintaining the backward compatibility with older generation hardware. The previously reserved bits are now being used which then requires the adjustment to the BIT values, e.g.: Before: PORT_PROPERTY_0[22:21] - Reserved PORT_PROPERTY_0[26:23] - Supported Speeds After: PORT_PROPERTY_0[21] - Reserved PORT_PROPERTY_0[26:22] - Supported Speeds To make this backwards compatible, the existing BIT definitions for the port speeds are incremented by one to maintain the original position. Co-developed-by: Shyam Sundar S K Signed-off-by: Shyam Sundar S K Signed-off-by: Raju Rangoju Signed-off-by: Jakub Kicinski commit dbb6c58b5a61d0c26a3da65ebb728727c305c3a1 Author: Raju Rangoju Date: Mon Dec 20 19:24:26 2021 +0530 net: amd-xgbe: Add Support for Yellow Carp Ethernet device Yellow Carp Ethernet devices use the existing PCI ID but the window settings for the indirect PCS access have been altered. Add the check for Yellow Carp Ethernet devices to use the new register values. Co-developed-by: Shyam Sundar S K Signed-off-by: Shyam Sundar S K Signed-off-by: Raju Rangoju Signed-off-by: Jakub Kicinski commit dbcefdeb2a58039f4c81d0361056fbdd9be906a1 Author: Matt Johnston Date: Mon Dec 20 10:31:04 2021 +0800 mctp: emit RTM_NEWADDR and RTM_DELADDR Userspace can receive notification of MCTP address changes via RTNLGRP_MCTP_IFADDR rtnetlink multicast group. Signed-off-by: Matt Johnston Link: https://lore.kernel.org/r/20211220023104.1965509-1-matt@codeconstruct.com.au Signed-off-by: Jakub Kicinski commit e395f021ccebc239e4fec02fec47f5f0eef44ebd Author: Jason Wang Date: Sat Dec 11 17:06:26 2021 +0800 soc: qcom: rpmh-rsc: Fix typo in a comment The double `for' in the comment in line 694 is repeated. Remove one of them from the comment. Signed-off-by: Jason Wang Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211211090626.248801-1-wangborong@cdjrlc.com commit d39cec003ab0d6b91f9709c59daa6f0480d232e2 Author: Luca Weiss Date: Mon Dec 13 09:11:11 2021 +0100 soc: qcom: socinfo: Add SM6350 and SM7225 Both SoCs are known as 'lagoon' downstream. Add their ids to the socinfo driver. Signed-off-by: Luca Weiss Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211213081111.20217-1-luca.weiss@fairphone.com commit 1e20b28d2e0e3e2996841df92f3af9050303f864 Author: Luca Weiss Date: Mon Dec 13 09:26:09 2021 +0100 dt-bindings: arm: msm: Don't mark LLCC interrupt as required Newer SoCs like SM6350 or SM8250 don't provide an interrupt for LLCC. Signed-off-by: Luca Weiss Acked-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211213082614.22651-9-luca.weiss@fairphone.com commit bd0d04d4144d3db5b461b21d528607fe994d9afa Author: Luca Weiss Date: Mon Dec 13 09:26:03 2021 +0100 dt-bindings: firmware: scm: Add SM6350 compatible Add devicetree compatible for SCM on SM6350 SoC. Signed-off-by: Luca Weiss Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211213082614.22651-3-luca.weiss@fairphone.com commit 492c995ab1ed1a149d5e8808953ce8837e310c06 Author: Konrad Dybcio Date: Mon Dec 13 09:26:02 2021 +0100 dt-bindings: arm: msm: Add LLCC for SM6350 Add LLCC compatible for SM6350 SoC. Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Konrad Dybcio Acked-by: Rob Herring Signed-off-by: Luca Weiss Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211213082614.22651-2-luca.weiss@fairphone.com commit 90c74c1c2574e9454fb3a7ae2cddc9433aa89d49 Author: Rajendra Nayak Date: Thu Dec 9 21:01:57 2021 +0530 soc: qcom: rpmhpd: Sort power-domain definitions and lists Sort all power-domain defines and the SoC specific lists in alphabetical order for better readability. No functional changes. Signed-off-by: Rajendra Nayak Reviewed-by: Bjorn Andersson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1639063917-9011-5-git-send-email-quic_rjendra@quicinc.com commit 7d6a0a4dcf148681bb7760f9aad100ee3d3ce836 Author: Rajendra Nayak Date: Thu Dec 9 21:01:56 2021 +0530 soc: qcom: rpmhpd: Remove mx/cx relationship on sc7280 The requirement to specify the active + sleep and active-only MX power-domains as the parents of the corresponding CX power domains is not applicable on sc7280. Fix it by using the cx/cx_ao structs for sc7280 instead of the _w_mx_parent ones. Signed-off-by: Rajendra Nayak Reviewed-by: Bjorn Andersson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1639063917-9011-4-git-send-email-quic_rjendra@quicinc.com commit 09bb67c104b5d27718a7191eff057ee7a45fc035 Author: Rajendra Nayak Date: Thu Dec 9 21:01:55 2021 +0530 soc: qcom: rpmhpd: Rename rpmhpd struct names The rpmhpd structs were named with a SoC-name prefix, but then they got reused across multiple SoC families making things confusing. Rename all the struct names to remove SoC-name prefixes. While we do this we end up with some power-domains without parents, and some with and at times different parents across SoCs. use a _w__parent suffix for such cases. No functional change as part of this patch. Signed-off-by: Rajendra Nayak Reviewed-by: Matthias Kaehlcke Reviewed-by: Bjorn Andersson Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1639063917-9011-3-git-send-email-quic_rjendra@quicinc.com commit 84e3b09292a481df5afe8a6b6fff8ded746506e3 Author: Rajendra Nayak Date: Thu Dec 9 21:01:54 2021 +0530 soc: qcom: rpmhpd: sm8450: Add the missing .peer for sm8450_cx_ao sm8450_cx and sm8450_cx_ao should be peers of each other, add the missing .peer entry for sm8450_cx_ao Cc: Dmitry Baryshkov Cc: Vinod Koul Signed-off-by: Rajendra Nayak Reviewed-by: Dmitry Baryshkov Reviewed-by: Bjorn Andersson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1639063917-9011-2-git-send-email-quic_rjendra@quicinc.com commit 9e4cdb4ca7e1fc4cca021cd8fefc4488c6c63bfa Author: Dmitry Baryshkov Date: Wed Dec 1 12:57:45 2021 +0530 soc: qcom: socinfo: add SM8450 ID Add the ID for the Qualcomm SM8450 SoC. Signed-off-by: Dmitry Baryshkov Signed-off-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211201072745.3969077-8-vkoul@kernel.org commit 5d12289516d943dd6f348826a9f56f84199af0b1 Author: Dmitry Baryshkov Date: Wed Dec 1 12:57:44 2021 +0530 soc: qcom: rpmhpd: Add SM8450 power domains Add the power domains exposed by RPMH in the Qualcomm SM8450 platform. Unlike previous generations CX domain is not a child of MX domain. Signed-off-by: Dmitry Baryshkov Signed-off-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211201072745.3969077-7-vkoul@kernel.org commit 22c755708c2395c58eb7670357baa110ba1ca2e0 Author: Dmitry Baryshkov Date: Wed Dec 1 12:57:43 2021 +0530 dt-bindings: power: rpmpd: Add SM8450 to rpmpd binding Add compatible and constants for the power domains exposed by the RPMH in the Qualcomm SM8450 platform. Signed-off-by: Dmitry Baryshkov Signed-off-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211201072745.3969077-6-vkoul@kernel.org commit aa9fc2c7e5777ae44a2f03e041d3f4b3e4a02860 Author: Dmitry Baryshkov Date: Wed Dec 1 12:57:42 2021 +0530 soc: qcom: smem: Update max processor count Update max processor count to reflect the number of co-processors on SM8450 SoCs. Signed-off-by: Dmitry Baryshkov Signed-off-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211201072745.3969077-5-vkoul@kernel.org commit 0e57fe4d11e59a9625b30be18b84aa69e32f0c37 Author: Vinod Koul Date: Wed Dec 1 12:57:41 2021 +0530 dt-bindings: arm: qcom: Document SM8450 SoC and boards Document the SM8450 SoC binding and also the boards using it. Signed-off-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211201072745.3969077-4-vkoul@kernel.org commit 028e4c664906331fb6623982b8486cd86efa14b3 Author: Vinod Koul Date: Wed Dec 1 12:57:40 2021 +0530 dt-bindings: firmware: scm: Add SM8450 compatible Add compatible for SM8450 SoCs. Signed-off-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211201072745.3969077-3-vkoul@kernel.org commit 71ca61c4d009ef914bab95b875ef4411c6cb7b2f Author: Vinod Koul Date: Wed Dec 1 12:57:39 2021 +0530 dt-bindings: arm: cpus: Add kryo780 compatible Kryo780 is found in SM8450, so add it to the list of cpu compatibles Signed-off-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211201072745.3969077-2-vkoul@kernel.org commit 82c6bf7585cdb5e1bc8f8b1a2925ad692585e1f4 Author: Martin Botka Date: Tue Nov 30 22:23:30 2021 +0100 soc: qcom: rpmpd: Add support for sm6125 Add RPM power domains located in Qualcomm SM6125 SoC. Signed-off-by: Martin Botka Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211130212332.25401-2-martin.botka@somainline.org commit 8712107740ad272bd89c873ec850146ac3d8832a Author: Martin Botka Date: Tue Nov 30 22:23:29 2021 +0100 dt-bindings: qcom-rpmpd: Add sm6125 power domains Add dt-bindings for sm6125 SoC RPM Power Domains Signed-off-by: Martin Botka [bjorn: Added compatible to binding as well] Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211130212332.25401-1-martin.botka@somainline.org commit 3925b909f75800e69bd1a65130a0440191a9e60a Author: Rikard Falkeborn Date: Sun Nov 28 22:03:17 2021 +0100 soc: qcom: aoss: constify static struct thermal_cooling_device_ops The only usage of qmp_cooling_device_ops is to pass its address to devm_thermal_of_cooling_device_register() which takes a pointer to const struct thermal_cooling_device_ops as argument. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211128210317.25504-1-rikard.falkeborn@gmail.com commit 92c550f9ffd2884bb5def52b5c0485a35e452784 Author: Changcheng Deng Date: Thu Nov 25 01:43:11 2021 +0000 PM: AVS: qcom-cpr: Use div64_ul instead of do_div do_div() does a 64-by-32 division. Here the divisor is an unsigned long which on some platforms is 64 bit wide. So use div64_ul instead of do_div to avoid a possible truncation. Reported-by: Zeal Robot Signed-off-by: Changcheng Deng Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211125014311.45942-1-deng.changcheng@zte.com.cn commit 6fc61c39ee1adb5f4115d288c876772fcd8b6979 Author: Konrad Dybcio Date: Sun Nov 21 01:20:46 2021 +0100 soc: qcom: llcc: Add configuration data for SM8350 Add LLCC configuration data for SM8350 SoC. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211121002050.36977-2-konrad.dybcio@somainline.org commit 708dbf4490c8ddf55d79b9f3855219b92d108760 Author: Stephan Gerhold Date: Fri Nov 19 22:39:52 2021 +0100 soc: qcom: stats: Add fixed sleep stats offset for older RPM firmwares Not all RPM firmware versions have the dynamic sleep stats offset available. Most older versions use a fixed offset of 0xdba0. Add support for this using new SoC-specific compatibles for APQ8084, MSM8226, MSM8916 and MSM8974. Even older SoCs seem to use a different offset and stats format. If needed those could be supported in the future by adding separate compatibles for those with a different stats_config. Cc: Maulik Shah Signed-off-by: Stephan Gerhold Reviewed-by: Bjorn Andersson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211119213953.31970-3-stephan@gerhold.net commit 2e8f2d3a691e521fa49f825010759192e86cf102 Author: Stephan Gerhold Date: Fri Nov 19 22:39:51 2021 +0100 dt-bindings: soc: qcom: stats: Document compatibles with fixed offset Document additional compatibles that can be used similarly to qcom,rpm-stats for older RPM firmware versions that have the sleep stats at a fixed offset rather than a dynamic one. The exact offset might vary depending on the SoC so use SoC-specific compatible names to avoid confusion. Cc: Maulik Shah Signed-off-by: Stephan Gerhold Acked-by: Rob Herring Reviewed-by: Bjorn Andersson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211119213953.31970-2-stephan@gerhold.net commit fb3965f9ae28b83290e5b5431a77aace66071ca1 Author: John Harrison Date: Fri Dec 10 22:58:58 2021 -0800 drm/i915/guc: Flag an error if an engine reset fails If GuC encounters an error during engine reset, the i915 driver promotes to full GT reset. This includes an info message about why the reset is happening. However, that is not treated as a failure by any of the CI systems because resets are an expected occurrance during testing. This kind of failure is a major problem and should never happen. So, complain more loudly and make sure CI notices. Signed-off-by: John Harrison Reviewed-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20211211065859.2248188-4-John.C.Harrison@Intel.com commit 0dd8674f2fc926b8a2404570c3cd0129a75dc70b Author: John Harrison Date: Fri Dec 10 22:58:57 2021 -0800 drm/i915/guc: Increase GuC log size for CONFIG_DEBUG_GEM Lots of testing is done with the DEBUG_GEM config option enabled but not the DEBUG_GUC option. That means we only get teeny-tiny GuC logs which are not hugely useful. Enabling full DEBUG_GUC also spews lots of other detailed output that is not generally desired. However, bigger GuC logs are extremely useful for almost any regression debug. So enable bigger logs for DEBUG_GEM builds as well. Signed-off-by: John Harrison Reviewed-by: Matthew Brost Link: https://patchwork.freedesktop.org/patch/msgid/20211211065859.2248188-3-John.C.Harrison@Intel.com commit 57b427a705ce98308328fc4fa93524a9a8a3bf84 Author: John Harrison Date: Fri Dec 10 22:58:56 2021 -0800 drm/i915/guc: Speed up GuC log dumps Add support for telling the debugfs interface the size of the GuC log dump in advance. Without that, the underlying framework keeps calling the 'show' function with larger and larger buffer allocations until it fits. That means reading the log from graphics memory many times - 16 times with the full 18MB log size. v2: Don't return error codes from size query. Report overflow in the error dump as well (review feedback from Daniele). Signed-off-by: John Harrison Reviewed-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20211211065859.2248188-2-John.C.Harrison@Intel.com commit 518579a9af10a4b7b952a8366566fdcc7cfce3ca Author: Keith Busch Date: Mon Dec 20 12:59:19 2021 -0800 blk-mq: blk-mq: check quiesce state before queue_rqs The low level drivers don't expect to see new requests after a successful quiesce completes. Check the queue quiesce state within the rcu protected area prior to calling the driver's queue_rqs(). Fixes: 3c67d44de787 ("block: add mq_ops->queue_rqs hook") Signed-off-by: Keith Busch Link: https://lore.kernel.org/r/20211220205919.180191-1-kbusch@kernel.org Signed-off-by: Jens Axboe commit 6dfa2fab8ddd46faa771a102672176bee7a065de Author: Lucas Stach Date: Fri Dec 17 11:59:28 2021 +0100 drm/etnaviv: limit submit sizes Currently we allow rediculous amounts of kernel memory being allocated via the etnaviv GEM_SUBMIT ioctl, which is a pretty easy DoS vector. Put some reasonable limits in to fix this. The commandstream size is limited to 64KB, which was already a soft limit on older kernels after which the kernel only took submits on a best effort base, so there is no userspace that tries to submit commandstreams larger than this. Even if the whole commandstream is a single incrementing address load, the size limit also limits the number of potential relocs and referenced buffers to slightly under 64K, so use the same limit for those arguments. The performance monitoring infrastructure currently supports less than 50 performance counter signals, so limiting them to 128 on a single submit seems like a reasonably future-proof number for now. This number can be bumped if needed without breaking the interface. Cc: stable@vger.kernel.org Reported-by: Dan Carpenter Signed-off-by: Lucas Stach Reviewed-by: Christian Gmeiner commit 361c81dbc58c8aa230e1f2d556045fa7bc3eb4a3 Author: Wander Lairson Costa Date: Mon Dec 20 16:28:27 2021 -0300 blktrace: switch trace spinlock to a raw spinlock The running_trace_lock protects running_trace_list and is acquired within the tracepoint which implies disabled preemption. The spinlock_t typed lock can not be acquired with disabled preemption on PREEMPT_RT because it becomes a sleeping lock. The runtime of the tracepoint depends on the number of entries in running_trace_list and has no limit. The blk-tracer is considered debug code and higher latencies here are okay. Make running_trace_lock a raw_spinlock_t. Signed-off-by: Wander Lairson Costa Link: https://lore.kernel.org/r/20211220192827.38297-1-wander@redhat.com Signed-off-by: Jens Axboe commit 98bf33ca3f00d76659aa1be1586a433efa74d34e Author: Tzung-Bi Shih Date: Mon Dec 20 17:34:07 2021 +0800 ASoC: mediatek: mt8195-mt6359: reduce log verbosity in probe() Eliminates error messages if snd_soc_register_card() failed. Kernel emits messages if device probe error anyway. This is mainly for removing the following error messages during boot. >>> snd_soc_register_card fail -517 Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20211220093408.207206-1-tzungbi@google.com Signed-off-by: Mark Brown commit 6008cb4c98d935a844edf2f3c13639104f533e30 Author: Tinghan Shen Date: Mon Dec 20 20:18:23 2021 +0800 spi: spi-mtk-nor: add new clock name 'axi' for spi nor Some mtk spi nor has dedicated dma(s) inside. Add a new clock name, axi, for spi nor dma bus clock. Signed-off-by: Tinghan Shen Link: https://lore.kernel.org/r/20211220121825.6446-3-tinghan.shen@mediatek.com Signed-off-by: Mark Brown commit ed98ea2128b6fd83bce13716edf8f5fe6c47f574 Author: Xiu Jianfeng Date: Fri Dec 17 09:01:52 2021 +0800 audit: replace zero-length array with flexible-array member Zero-length arrays are deprecated and should be replaced with flexible-array members. Link: https://github.com/KSPP/linux/issues/78 Signed-off-by: Xiu Jianfeng Signed-off-by: Paul Moore commit 30561b51cc8d1daa27a48eb29dd9424858576b19 Author: Xiu Jianfeng Date: Fri Dec 17 09:01:51 2021 +0800 audit: use struct_size() helper in audit_[send|make]_reply() Make use of struct_size() helper instead of an open-coded calculation. Link: https://github.com/KSPP/linux/issues/160 Signed-off-by: Xiu Jianfeng Signed-off-by: Paul Moore commit 8b144dedb928e4e2f433a328d58f44c3c098d63e Author: Larry Finger Date: Wed Dec 15 11:11:05 2021 -0600 rtlwifi: rtl8192cu: Fix WARNING when calling local_irq_restore() with interrupts enabled Syzbot reports the following WARNING: [200~raw_local_irq_restore() called with IRQs enabled WARNING: CPU: 1 PID: 1206 at kernel/locking/irqflag-debug.c:10 warn_bogus_irq_restore+0x1d/0x20 kernel/locking/irqflag-debug.c:10 Hardware initialization for the rtl8188cu can run for as long as 350 ms, and the routine may be called with interrupts disabled. To avoid locking the machine for this long, the current routine saves the interrupt flags and enables local interrupts. The problem is that it restores the flags at the end without disabling local interrupts first. This patch fixes commit a53268be0cb9 ("rtlwifi: rtl8192cu: Fix too long disable of IRQs"). Reported-by: syzbot+cce1ee31614c171f5595@syzkaller.appspotmail.com Cc: stable@vger.kernel.org Fixes: a53268be0cb9 ("rtlwifi: rtl8192cu: Fix too long disable of IRQs") Signed-off-by: Larry Finger Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211215171105.20623-1-Larry.Finger@lwfinger.net commit b250200e2ee4579932ba38c610cb90bef642011b Author: Chris Chiu Date: Wed Dec 15 16:58:19 2021 +0800 rtl8xxxu: Improve the A-MPDU retransmission rate with RTS/CTS protection The A-MPDU TX retransmission rate is always high (> 20%) even in a very clean environment. However, the vendor driver retransimission rate is < 10% in the same test bed. The difference is the vendor driver starts the A-MPDU TXOP with initial RTS/CTS handshake which is observed in the air capture and the TX descriptor. Since the driver does not know how many frames will be aggregated and the estimated duration, forcing the RTS/CTS protection for A-MPDU helps to lower the retransmission rate from > 20% to ~12% in the same test setup with the vendor driver. Signed-off-by: Chris Chiu Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211215085819.729345-1-chris.chiu@canonical.com commit 426b87b111b0523f957354bc97ec7eb16e8be1e2 Author: Pu Lehui Date: Mon Dec 20 05:08:03 2021 +0000 selftests/bpf: Correct the INDEX address in vmtest.sh Migration of vmtest to libbpf/ci will change the address of INDEX in vmtest.sh, which will cause vmtest.sh to not work due to the failure of rootfs fetching. Signed-off-by: Pu Lehui Signed-off-by: Andrii Nakryiko Tested-by: Lorenzo Fontana Link: https://lore.kernel.org/bpf/20211220050803.2670677-1-pulehui@huawei.com commit c1afb26727d9e507d3e17a9890e7aaf7fc85cd55 Author: Po-Hao Huang Date: Fri Dec 17 09:27:08 2021 +0800 rtw88: 8822c: update rx settings to prevent potential hw deadlock These settings enables mac to detect and recover when rx fifo circuit deadlock occurs. Previous version missed this, so we fix it. Signed-off-by: Po-Hao Huang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211217012708.8623-1-pkshih@realtek.com commit a3fd1f9aa79a7d3885faa486acb02c838533f332 Author: Chin-Yen Lee Date: Fri Dec 17 09:24:21 2021 +0800 rtw88: don't check CRC of VHT-SIG-B in 802.11ac signal Currently all realtek wifi chip is set to check CRC of VHT-SIG-B in 802.11ac signal, but some AP don't calculate the CRC and packets from these AP can't be received and lead to disconnection. We disable the check defaultly to avoid this case. Signed-off-by: Chin-Yen Lee Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211217012421.7859-1-pkshih@realtek.com commit 24f5e38a13b5ae2b6105cda8bb47c19108e62a9a Author: Kai-Heng Feng Date: Wed Dec 15 19:46:34 2021 +0800 rtw88: Disable PCIe ASPM while doing NAPI poll on 8821CE Many Intel based platforms face system random freeze after commit 9e2fd29864c5 ("rtw88: add napi support"). The commit itself shouldn't be the culprit. My guess is that the 8821CE only leaves ASPM L1 for a short period when IRQ is raised. Since IRQ is masked during NAPI polling, the PCIe link stays at L1 and makes RX DMA extremely slow. Eventually the RX ring becomes messed up: [ 1133.194697] rtw_8821ce 0000:02:00.0: pci bus timeout, check dma status Since the 8821CE hardware may fail to leave ASPM L1, manually do it in the driver to resolve the issue. Fixes: 9e2fd29864c5 ("rtw88: add napi support") Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=215131 BugLink: https://bugs.launchpad.net/bugs/1927808 Signed-off-by: Kai-Heng Feng Acked-by: Jian-Hong Pan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211215114635.333767-1-kai.heng.feng@canonical.com commit 4894edacfa93d7046bec4fc61fc402ac6a2ac9e8 Author: Dan Carpenter Date: Fri Dec 17 18:03:12 2021 +0300 wilc1000: fix double free error in probe() Smatch complains that there is a double free in probe: drivers/net/wireless/microchip/wilc1000/spi.c:186 wilc_bus_probe() error: double free of 'spi_priv' drivers/net/wireless/microchip/wilc1000/sdio.c:163 wilc_sdio_probe() error: double free of 'sdio_priv' The problem is that wilc_netdev_cleanup() function frees "wilc->bus_data". That's confusing and a layering violation. Leave the frees in probe(), delete the free in wilc_netdev_cleanup(), and add some new frees to the remove() functions. Fixes: dc8b338f3bcd ("wilc1000: use goto labels on error path") Signed-off-by: Dan Carpenter Reviewed-by: Claudiu Beznea Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211217150311.GC16611@kili commit 97c0979d0d729cded6eae0d7b22d06a2eeeca3a4 Author: Luca Coelho Date: Sun Dec 19 11:01:28 2021 +0200 iwlwifi: mvm: fix imbalanced locking in iwl_mvm_start_get_nvm() If iwl_transt_start_hw() failed, we were returning without calling wiphy_unlock() and rtnl_unlock(), causing a locking imbalance: drivers/net/wireless/intel/iwlwifi/mvm/ops.c:686:12: warning: context imbalance in 'iwl_mvm_start_get_nvm' - wrong count at exit Fix that by adding the unlock calls. Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211219090128.42417-2-luca@coelho.fi commit ab2c42618ab9ff112c2c8b6887e7ff4bf4a8fd7f Author: Johannes Berg Date: Sun Dec 19 11:01:27 2021 +0200 iwlwifi: mvm: add dbg_time_point to debugfs We forgot to link this to debugfs, so the code is all dead. Add it for real. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/iwlwifi.20211219110000.d0f314101410.I7357c01179c35621686265d4da4a64d2333a5f1a@changeid commit 80cba44ff61bb2fd84af7b5f7d59511a8553d3f3 Author: Johannes Berg Date: Sun Dec 19 11:01:26 2021 +0200 iwlwifi: mvm: add missing min_size to kernel-doc On struct iwl_rx_handlers we should document the min_size member, do that. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/iwlwifi.20211219110000.0c42c428bc6b.I8bfa49d534acc5f513f2fb3dff2d6f22f6c45071@changeid commit 991bbbeccc2499a54e401d551df16d0bd564bc29 Author: Johannes Berg Date: Sun Dec 19 11:01:25 2021 +0200 iwlwifi: mei: fix W=1 warnings There are a few warnings due to kernel-doc not understanding the constructs the way they're done here, fix them. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/iwlwifi.20211219110000.1ef2bb24771c.I6a59ad2d64f719d3e27398951c8f1b678b0b1092@changeid commit d8f9bb98cb7a8427f884dc2e1b49f2f3c383e599 Merge: f85b244ee395c b1460bb4eadf4 Author: Kalle Valo Date: Mon Dec 20 20:38:06 2021 +0200 Merge tag 'mt76-for-kvalo-2021-12-18' of https://github.com/nbd168/wireless mt76 patches for 5.17 * decap offload fixes * mt7915 fixes * mt7921 fixes * eeprom fixes * powersave handling fixes * SAR support * code cleanups commit ec038c6127fa772d2c5604e329f22371830d5fa6 Author: Wen Gong Date: Mon Dec 20 18:11:09 2021 +0200 ath11k: add support for hardware rfkill for QCA6390 When hardware rfkill is enabled in the firmware it will report the capability via using WMI_SYS_CAP_INFO_RFKILL bit in the WMI_SERVICE_READY event to the host. ath11k will check the capability, and if it is enabled then ath11k will set the GPIO information to firmware using WMI_PDEV_SET_PARAM. When the firmware detects hardware rfkill is enabled by the user, it will report it via WMI_RFKILL_STATE_CHANGE_EVENTID. Once ath11k receives the event it will send wmi command WMI_PDEV_SET_PARAM to the firmware and also notifies cfg80211. This only enable rfkill feature for QCA6390, rfkill_pin is all initialized to 0 for other chips in ath11k_hw_params. Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211217102334.14907-1-quic_wgong@quicinc.com commit 1b8bb94c0612cf32e418e90ae93cf37214d84669 Author: Wen Gong Date: Mon Dec 20 18:11:09 2021 +0200 ath11k: report tx bitrate for iw wlan station dump HTT_T2H_MSG_TYPE_PPDU_STATS_IND is a message which include the ppdu info, currently it is not report from firmware for ath11k, then the tx bitrate of "iw wlan0 station dump" always show an invalid value "tx bitrate: 6.0 MBit/s". To address the issue, this is to parse the info of tx complete report from firmware and indicate the tx rate to mac80211. After that, "iw wlan0 station dump" show the correct tx bit rate such as: tx bitrate: 78.0 MBit/s MCS 12 tx bitrate: 144.4 MBit/s VHT-MCS 7 short GI VHT-NSS 2 tx bitrate: 286.7 MBit/s HE-MCS 11 HE-NSS 2 HE-GI 0 HE-DCM 0 tx bitrate: 1921.5 MBit/s 160MHz HE-MCS 9 HE-NSS 2 HE-GI 0 HE-DCM 0 Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211217093722.5739-1-quic_wgong@quicinc.com commit 846da38de0e8224f2f94b885125cf1fd2d7b0d39 Author: Tianyu Lan Date: Mon Dec 13 02:14:06 2021 -0500 net: netvsc: Add Isolation VM support for netvsc driver In Isolation VM, all shared memory with host needs to mark visible to host via hvcall. vmbus_establish_gpadl() has already done it for netvsc rx/tx ring buffer. The page buffer used by vmbus_sendpacket_ pagebuffer() stills need to be handled. Use DMA API to map/umap these memory during sending/receiving packet and Hyper-V swiotlb bounce buffer dma address will be returned. The swiotlb bounce buffer has been masked to be visible to host during boot up. rx/tx ring buffer is allocated via vzalloc() and they need to be mapped into unencrypted address space(above vTOM) before sharing with host and accessing. Add hv_map/unmap_memory() to map/umap rx /tx ring buffer. Signed-off-by: Tianyu Lan Reviewed-by: Haiyang Zhang Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20211213071407.314309-6-ltykernel@gmail.com Signed-off-by: Wei Liu commit 743b237c3a7b0f5b44aa704aae8a1058877b6322 Author: Tianyu Lan Date: Mon Dec 13 02:14:05 2021 -0500 scsi: storvsc: Add Isolation VM support for storvsc driver In Isolation VM, all shared memory with host needs to mark visible to host via hvcall. vmbus_establish_gpadl() has already done it for storvsc rx/tx ring buffer. The page buffer used by vmbus_sendpacket_ mpb_desc() still needs to be handled. Use DMA API(scsi_dma_map/unmap) to map these memory during sending/receiving packet and return swiotlb bounce buffer dma address. In Isolation VM, swiotlb bounce buffer is marked to be visible to host and the swiotlb force mode is enabled. Set device's dma min align mask to HV_HYP_PAGE_SIZE - 1 in order to keep the original data offset in the bounce buffer. Signed-off-by: Tianyu Lan Reviewed-by: Long Li Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20211213071407.314309-5-ltykernel@gmail.com Signed-off-by: Wei Liu commit 062a5c4260cdb734a4727230c58e38accf413315 Author: Tianyu Lan Date: Mon Dec 13 02:14:04 2021 -0500 hyper-v: Enable swiotlb bounce buffer for Isolation VM hyperv Isolation VM requires bounce buffer support to copy data from/to encrypted memory and so enable swiotlb force mode to use swiotlb bounce buffer for DMA transaction. In Isolation VM with AMD SEV, the bounce buffer needs to be accessed via extra address space which is above shared_gpa_boundary (E.G 39 bit address line) reported by Hyper-V CPUID ISOLATION_CONFIG. The access physical address will be original physical address + shared_gpa_boundary. The shared_gpa_boundary in the AMD SEV SNP spec is called virtual top of memory(vTOM). Memory addresses below vTOM are automatically treated as private while memory above vTOM is treated as shared. Swiotlb bounce buffer code calls set_memory_decrypted() to mark bounce buffer visible to host and map it in extra address space via memremap. Populate the shared_gpa_boundary (vTOM) via swiotlb_unencrypted_base variable. The map function memremap() can't work in the early place (e.g ms_hyperv_init_platform()) and so call swiotlb_update_mem_ attributes() in the hyperv_init(). Signed-off-by: Tianyu Lan Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20211213071407.314309-4-ltykernel@gmail.com Signed-off-by: Wei Liu commit c789b90a69045d1924bc0802ae0dce2bba05a04e Author: Tianyu Lan Date: Mon Dec 13 02:14:03 2021 -0500 x86/hyper-v: Add hyperv Isolation VM check in the cc_platform_has() Hyper-V provides Isolation VM for confidential computing support and guest memory is encrypted in it. Places checking cc_platform_has() with GUEST_MEM_ENCRYPT attr should return "True" in Isolation VM. Hyper-V Isolation VMs need to adjust the SWIOTLB size just like SEV guests. Add a hyperv_cc_platform_has() variant which enables that. Signed-off-by: Tianyu Lan Acked-by: Borislav Petkov Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20211213071407.314309-3-ltykernel@gmail.com Signed-off-by: Wei Liu commit 1a5e91d8375fc8369207cc0b9894a324f2bbf1d9 Author: Tianyu Lan Date: Mon Dec 13 02:14:02 2021 -0500 swiotlb: Add swiotlb bounce buffer remap function for HV IVM In Isolation VM with AMD SEV, bounce buffer needs to be accessed via extra address space which is above shared_gpa_boundary (E.G 39 bit address line) reported by Hyper-V CPUID ISOLATION_CONFIG. The access physical address will be original physical address + shared_gpa_boundary. The shared_gpa_boundary in the AMD SEV SNP spec is called virtual top of memory(vTOM). Memory addresses below vTOM are automatically treated as private while memory above vTOM is treated as shared. Expose swiotlb_unencrypted_base for platforms to set unencrypted memory base offset and platform calls swiotlb_update_mem_attributes() to remap swiotlb mem to unencrypted address space. memremap() can not be called in the early stage and so put remapping code into swiotlb_update_mem_attributes(). Store remap address and use it to copy data from/to swiotlb bounce buffer. Signed-off-by: Tianyu Lan Acked-by: Christoph Hellwig Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20211213071407.314309-2-ltykernel@gmail.com Signed-off-by: Wei Liu commit 144779edf598e0896302c35a0926ef0b68f17c4b Author: Arnd Bergmann Date: Thu Dec 9 12:51:42 2021 -0700 staging: greybus: fix stack size warning with UBSAN clang warns about excessive stack usage in this driver when UBSAN is enabled: drivers/staging/greybus/audio_topology.c:977:12: error: stack frame size of 1836 bytes in function 'gbaudio_tplg_create_widget' [-Werror,-Wframe-larger-than=] Rework this code to no longer use compound literals for initializing the structure in each case, but instead keep the common bits in a preallocated constant array and copy them as needed. Link: https://github.com/ClangBuiltLinux/linux/issues/1535 Link: https://lore.kernel.org/r/20210103223541.2790855-1-arnd@kernel.org/ Reviewed-by: Nick Desaulniers Reviewed-by: Alex Elder Signed-off-by: Arnd Bergmann [nathan: Address review comments from v1] Signed-off-by: Nathan Chancellor Link: https://lore.kernel.org/r/20211209195141.1165233-1-nathan@kernel.org Signed-off-by: Greg Kroah-Hartman commit 4f458ec5f4970d28d78048ebfd3251b5edb0083f Author: Martin Kaiser Date: Sun Dec 19 19:39:26 2021 +0100 staging: r8188: move the steps into Hal8188EPwrSeq.c Move the power transition steps into Hal8188EPwrSeq.c where the arrays are defined. There's no point in having defines for sequences of steps in the include file. All of these sequences are used only once (apart from the end sequence). Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211219183926.4746-10-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 885b7b852137accc05e563e4f3382acb4ec23df3 Author: Martin Kaiser Date: Sun Dec 19 19:39:25 2021 +0100 staging: r8188: reformat the power transition steps Clean up the definitions of the power transition steps and address some checkpatch warnings. Reduce the line lengths where possible. Add spaces between elements. Rewrite comments that are in contradiction with the definition they describe. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211219183926.4746-9-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit ada58e3b5da9098226c3994ae91ff9c96390f324 Author: Martin Kaiser Date: Sun Dec 19 19:39:24 2021 +0100 staging: r8188: remove unused power command None of the remaining power transition steps used PWR_CMD_READ. It can be removed. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211219183926.4746-8-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit d1d617f48e77bf888f1583f530a95c4f1842c66a Author: Martin Kaiser Date: Sun Dec 19 19:39:23 2021 +0100 staging: r8188: remove base address from power transitions Remove the base entry from the power transition steps. This field is not used. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211219183926.4746-7-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 7cd8b6158d4f679062280db9390c674caee82053 Author: Martin Kaiser Date: Sun Dec 19 19:39:22 2021 +0100 staging: r8188: remove interface mask from power transitions For the r8188 driver, we always have a usb interface. We can remove the power transition steps that are not applicable for a usb interface. We can then remove the interface mask itself. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211219183926.4746-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 13b420f466eb9fadcdd41f52969bc9fae92013f4 Author: Martin Kaiser Date: Sun Dec 19 19:39:21 2021 +0100 staging: r8188: remove fab mask from power transitions Remove the fab mask from the steps of the power transitions. The fab mask is not used, all values are allowed for all steps. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211219183926.4746-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 78ad6a17cd913fba3e5714a2d21da6656b17f7cb Author: Martin Kaiser Date: Sun Dec 19 19:39:20 2021 +0100 staging: r8188: remove cut mask from power transitions Remove the power cut mask from the steps of the power transitions. The power cut mask is not used, all values are allowed for all steps. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211219183926.4746-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit f51da6473838928c5dcd99013cbfe8b26d8d4369 Author: Martin Kaiser Date: Sun Dec 19 19:39:19 2021 +0100 staging: r8188: remove sizes from power transition arrays There's no need to set the array size explicitly if an array is initialized with a constant value. Remove the array sizes and related definitions for the power transition arrays. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211219183926.4746-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 18c1249fba26ab649d0b31f881b319163e2f5667 Author: Martin Kaiser Date: Sun Dec 19 19:39:18 2021 +0100 staging: r8188: remove unused power transitions The r8188 driver defines a number of transitions between different power states. Remove the transitions which are not used by the rest of the code. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211219183926.4746-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 738b35a3ebe2c8b1199e55b5d467ba7da8987434 Author: Martin Kaiser Date: Sat Dec 18 13:04:23 2021 +0100 staging: r8188: ODM_BB_RA_MASK is always set Remove the ODM_BB_RA_MASK capability. It is always set for this driver. Like for ODM_BB_DIG before, we can be sure that ODM_BB_RA_MASK was never checked before it was set. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211218120423.29906-10-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 64bdd3a256c23ab0ae678e3ac2fa4fa32910b2b1 Author: Martin Kaiser Date: Sat Dec 18 13:04:22 2021 +0100 staging: r8188: ODM_BB_DIG is always set Remove the ODM_BB_DIG capability. It is always set for this driver. (ODM_BB_DIG was set in Update_ODM_ComInfo_88E and checked in odm_DIG, which was always called after the capability was set.) Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211218120423.29906-9-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 72e4ae15871ef495ea51777d541f854bb3479717 Author: Martin Kaiser Date: Sat Dec 18 13:04:21 2021 +0100 staging: r8188: remove unused odm capabilities Remove odm capabilities which are either unused or set but never checked. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211218120423.29906-8-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit af3ad88c35c5770c826b5640bc91f18beddea7ab Author: Martin Kaiser Date: Sat Dec 18 13:04:20 2021 +0100 staging: r8188: Bssid in struct fast_ant_train is set but not used Bssid in struct fast_ant_train is set but not used. Remove it. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211218120423.29906-7-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 8b6ad791ee1a506410c275ed537f6b46d0daf40d Author: Martin Kaiser Date: Sat Dec 18 13:04:19 2021 +0100 staging: r8188: antSumRSSI is set but not used antSumRSSI in struct fast_ant_train is set but not used. Remove it. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211218120423.29906-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 6630263c126ea22591aedcdb3a0ea01c08b280ce Author: Martin Kaiser Date: Sat Dec 18 13:04:18 2021 +0100 staging: r8188: antRSSIcnt is set but not used antRSSIcnt in struct fast_ant_train is set but not used. Remove it. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211218120423.29906-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit c35220ad42c48125da41f427c138ba074c201f9c Author: Martin Kaiser Date: Sat Dec 18 13:04:17 2021 +0100 staging: r8188: antAveRSSI is set but not used antAveRSSI in struct fast_ant_train is set but not used. Remove it. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211218120423.29906-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit e87261086e95b3cac939870379acf785e6a145a5 Author: Martin Kaiser Date: Sat Dec 18 13:04:16 2021 +0100 staging: r8188: remove the dummy ioctl handler The r8188 driver installs a dummy handler for some unused ioctls. All that the dummy handler does is return -1. Remove the dummy handler and let the wext core handle unused ioctls. This way, user space gets a consistent errno for an unused wext ioctl, regardless of which driver is used for the interface. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211218120423.29906-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 4218817c70a5bdc8c3601ec0a44c65ec4de5dd17 Author: Martin Kaiser Date: Sat Dec 18 13:04:15 2021 +0100 staging: r8188: make rx signal strength function static The _linked_rx_signal_strength_display function is used only in rtw_mlme_ext.c. Make the function static and remove the prototype. While at it, fix a typo in the function name. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211218120423.29906-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit ff8288ff475e47544569359772f88f2b39fd2cf9 Author: Eric W. Biederman Date: Mon Dec 20 10:42:18 2021 -0600 fork: Rename bad_fork_cleanup_threadgroup_lock to bad_fork_cleanup_delayacct I just fixed a bug in copy_process when using the label bad_fork_cleanup_threadgroup_lock. While fixing the bug I looked closer at the label and realized it has been misnamed since 568ac888215c ("cgroup: reduce read locked section of cgroup_threadgroup_rwsem during fork"). Fix the name so that fork is easier to understand. Signed-off-by: "Eric W. Biederman" commit 6692c98c7df53502adb8b8b73ab9bcbd399f7a06 Author: Eric W. Biederman Date: Mon Dec 20 10:20:14 2021 -0600 fork: Stop protecting back_fork_cleanup_cgroup_lock with CONFIG_NUMA Mark Brown reported: > This is also causing further build errors including but not limited to: > > /tmp/next/build/kernel/fork.c: In function 'copy_process': > /tmp/next/build/kernel/fork.c:2106:4: error: label 'bad_fork_cleanup_threadgroup_lock' used but not defined > 2106 | goto bad_fork_cleanup_threadgroup_lock; > | ^~~~ It turns out that I messed up and was depending upon a label protected by an ifdef. Move the label out of the ifdef as the ifdef around the label no longer makes sense (if it ever did). Link: https://lkml.kernel.org/r/YbugCP144uxXvRsk@sirena.org.uk Fixes: 40966e316f86 ("kthread: Ensure struct kthread is present for all kthreads") Signed-off-by: "Eric W. Biederman" commit ed7d6119aa8bca3f8eec03b83248f09d2d39e88e Author: Martin Kaiser Date: Sun Dec 12 19:58:33 2021 +0100 staging: r8188eu: clean up rtl8188e_sreset_linked_status_check Clean up the rtl8188e_sreset_linked_status_check, which has just been moved to rtw_mlme_ext. Don't initialise variables to 0 if the first access sets a new value. Check the value of fw_status only once. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211212185833.22000-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit b66fbc855ee5ef29006f6d0148fff89c05bf47c7 Author: Martin Kaiser Date: Sun Dec 12 19:58:32 2021 +0100 staging: r8188eu: move linked status check from hal to rtw_mlme_ext Move rtl8188e_sreset_linked_status_check from the hal layer into rtw_mlme_ext.c. Like the xmit status check, this is a simple function that's only called from one place. With this function gone, hal/rtl8188e_sreset.c and include/rtl8188e_sreset.h are now empty and can be removed. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211212185833.22000-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 22f92b77479a1f869663cb6a09fb522e296ab242 Author: Martin Kaiser Date: Sun Dec 12 19:58:31 2021 +0100 staging: r8188eu: move xmit status check from hal to rtw_cmd Move rtl8188e_sreset_xmit_status_check from the hal layer into rtw_cmd.c. As this driver supports only the 8188 chipset, there's no need to go through the hal layer for simple operations that have only one caller. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211212185833.22000-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit a299fedca15711fe592dd4bf00e20d101eb7f47a Author: Jason Wang Date: Sat Dec 11 17:16:32 2021 +0800 staging: rtl8723bs: fix typo in a comment The double `for' in the comment in line 2203 is repeated. Remove one of them from the comment. Signed-off-by: Jason Wang Link: https://lore.kernel.org/r/20211211091632.264035-1-wangborong@cdjrlc.com Signed-off-by: Greg Kroah-Hartman commit 74565794023c51f9b0ab23cc11b6a8a5445b360e Author: Jason Wang Date: Sat Dec 11 17:14:22 2021 +0800 staging: rtl8192u: remove some repeated words in some comments The double `new' in the comment in line 1349 and `to' in the comment in line 2030 are repeated. Remove the repeated words from these comments. Signed-off-by: Jason Wang Link: https://lore.kernel.org/r/20211211091422.260442-1-wangborong@cdjrlc.com Signed-off-by: Greg Kroah-Hartman commit ba635863779871a4f873511199f3e0ae84d5e592 Author: Julien Massot Date: Thu Dec 16 17:07:21 2021 +0100 remoteproc: rcar_rproc: Remove trailing semicolon Remove trailing semicolon. Signed-off-by: Julien Massot Link: https://lore.kernel.org/r/20211216160721.203794-1-julien.massot@iot.bzh Reviewed-by: Geert Uytterhoeven Signed-off-by: Mathieu Poirier commit b0229605b1436438f24d9a97d8ecf220e0ea5900 Author: Julien Massot Date: Thu Dec 16 17:06:53 2021 +0100 remoteproc: rcar_rproc: Fix pm_runtime_get_sync error check pm_runtime_get_sync can also return 1 on success, change to use pm_runtime_resume_and_get which return 0 only on success. This bug has been discovered by Dan Carpenter by using Smatch static checker. Fixes: 285892a74f13 ("remoteproc: Add Renesas rcar driver") Signed-off-by: Julien Massot Reviewed-by: Geert Uytterhoeven [Fixed blank line between tags] Link: https://lore.kernel.org/r/20211216160653.203768-1-julien.massot@iot.bzh Signed-off-by: Mathieu Poirier commit 5c4a5b36e43e0ee94d98325845ad48732d8d9c99 Merge: 0fd319105fde3 bd048487af68a Author: Arnd Bergmann Date: Mon Dec 20 17:14:05 2021 +0100 Merge tag 'tegra-for-5.17-arm-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/dt ARM: tegra: Changes for v5.17-rc1 A large part of this is cleanups to existing device trees in order to improve validation of the device trees using the dt-schema tooling. This also contains a set of new device trees for various boards that have been contributed by community members as well as fixes to existing devices. * tag 'tegra-for-5.17-arm-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: (55 commits) ARM: tegra: Add host1x hotflush reset on Tegra124 ARM: tegra: Add memory client hotflush resets on Tegra114 ARM: tegra: Add back gpio-ranges properties ARM: tegra: paz00: Enable S/PDIF and HDMI audio ARM: tegra: acer-a500: Enable S/PDIF and HDMI audio ARM: tegra: Add HDMI audio graph to Tegra20 device-tree ARM: tegra: Add S/PDIF node to Tegra20 device-tree ARM: tegra20/30: Disable unused host1x hardware ARM: tegra: Add Memory Client resets to Tegra30 GR2D, GR3D and Host1x ARM: tegra: Add Memory Client resets to Tegra20 GR2D, GR3D and Host1x ARM: tegra: Add OPP tables and power domains to Tegra30 device-trees ARM: tegra: Add OPP tables and power domains to Tegra20 device-trees ARM: tegra: Add 500 MHz entry to Tegra30 memory OPP table ARM: tegra: Enable video decoder on Tegra114 ARM: tegra: nexus7: Use common LVDS display device-tree ARM: tegra: Add CPU thermal zones to Nyan device-tree ARM: tegra: Enable CPU DFLL on Nyan ARM: tegra: Enable HDMI CEC on Nyan ARM: tegra: Add usb-role-switch property to USB OTG ports ARM: tegra: Add device-tree for 1080p version of Nyan Big ... Link: https://lore.kernel.org/r/20211217162253.1801077-5-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit 6ce708f54cc8d73beca213cec66ede5ce100a781 Author: Zekun Shen Date: Thu Oct 28 18:21:42 2021 -0400 ath9k: Fix out-of-bound memcpy in ath9k_hif_usb_rx_stream Large pkt_len can lead to out-out-bound memcpy. Current ath9k_hif_usb_rx_stream allows combining the content of two urb inputs to one pkt. The first input can indicate the size of the pkt. Any remaining size is saved in hif_dev->rx_remain_len. While processing the next input, memcpy is used with rx_remain_len. 4-byte pkt_len can go up to 0xffff, while a single input is 0x4000 maximum in size (MAX_RX_BUF_SIZE). Thus, the patch adds a check for pkt_len which must not exceed 2 * MAX_RX_BUG_SIZE. BUG: KASAN: slab-out-of-bounds in ath9k_hif_usb_rx_cb+0x490/0xed7 [ath9k_htc] Read of size 46393 at addr ffff888018798000 by task kworker/0:1/23 CPU: 0 PID: 23 Comm: kworker/0:1 Not tainted 5.6.0 #63 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.10.2-0-g5f4c7b1-prebuilt.qemu-project.org 04/01/2014 Workqueue: events request_firmware_work_func Call Trace: dump_stack+0x76/0xa0 print_address_description.constprop.0+0x16/0x200 ? ath9k_hif_usb_rx_cb+0x490/0xed7 [ath9k_htc] ? ath9k_hif_usb_rx_cb+0x490/0xed7 [ath9k_htc] __kasan_report.cold+0x37/0x7c ? ath9k_hif_usb_rx_cb+0x490/0xed7 [ath9k_htc] kasan_report+0xe/0x20 check_memory_region+0x15a/0x1d0 memcpy+0x20/0x50 ath9k_hif_usb_rx_cb+0x490/0xed7 [ath9k_htc] ? hif_usb_mgmt_cb+0x2d9/0x2d9 [ath9k_htc] ? _raw_spin_lock_irqsave+0x7b/0xd0 ? _raw_spin_trylock_bh+0x120/0x120 ? __usb_unanchor_urb+0x12f/0x210 __usb_hcd_giveback_urb+0x1e4/0x380 usb_giveback_urb_bh+0x241/0x4f0 ? __hrtimer_run_queues+0x316/0x740 ? __usb_hcd_giveback_urb+0x380/0x380 tasklet_action_common.isra.0+0x135/0x330 __do_softirq+0x18c/0x634 irq_exit+0x114/0x140 smp_apic_timer_interrupt+0xde/0x380 apic_timer_interrupt+0xf/0x20 I found the bug using a custome USBFuzz port. It's a research work to fuzz USB stack/drivers. I modified it to fuzz ath9k driver only, providing hand-crafted usb descriptors to QEMU. After fixing the value of pkt_tag to ATH_USB_RX_STREAM_MODE_TAG in QEMU emulation, I found the KASAN report. The bug is triggerable whenever pkt_len is above two MAX_RX_BUG_SIZE. I used the same input that crashes to test the driver works when applying the patch. Signed-off-by: Zekun Shen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/YXsidrRuK6zBJicZ@10-18-43-117.dynapool.wireless.nyu.edu commit 8b3046abc99eefe11438090bcc4ec3a3994b55d0 Author: Tetsuo Handa Date: Tue Sep 21 22:06:26 2021 +0900 ath9k_htc: fix NULL pointer dereference at ath9k_htc_tx_get_packet() syzbot is reporting lockdep warning at ath9k_wmi_event_tasklet() followed by kernel panic at get_htc_epid_queue() from ath9k_htc_tx_get_packet() from ath9k_htc_txstatus() [1], for ath9k_wmi_event_tasklet(WMI_TXSTATUS_EVENTID) depends on spin_lock_init() from ath9k_init_priv() being already completed. Since ath9k_wmi_event_tasklet() is set by ath9k_init_wmi() from ath9k_htc_probe_device(), it is possible that ath9k_wmi_event_tasklet() is called via tasklet interrupt before spin_lock_init() from ath9k_init_priv() from ath9k_init_device() from ath9k_htc_probe_device() is called. Let's hold ath9k_wmi_event_tasklet(WMI_TXSTATUS_EVENTID) no-op until ath9k_tx_init() completes. Link: https://syzkaller.appspot.com/bug?extid=31d54c60c5b254d6f75b [1] Reported-by: syzbot Signed-off-by: Tetsuo Handa Tested-by: syzbot Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/77b76ac8-2bee-6444-d26c-8c30858b8daa@i-love.sakura.ne.jp commit b0ec7e55fce65f125bd1d7f02e2dc4de62abee34 Author: Tetsuo Handa Date: Tue Sep 21 22:06:23 2021 +0900 ath9k_htc: fix NULL pointer dereference at ath9k_htc_rxep() syzbot is reporting lockdep warning followed by kernel panic at ath9k_htc_rxep() [1], for ath9k_htc_rxep() depends on ath9k_rx_init() being already completed. Since ath9k_htc_rxep() is set by ath9k_htc_connect_svc(WMI_BEACON_SVC) from ath9k_init_htc_services(), it is possible that ath9k_htc_rxep() is called via timer interrupt before ath9k_rx_init() from ath9k_init_device() is called. Since we can't call ath9k_init_device() before ath9k_init_htc_services(), let's hold ath9k_htc_rxep() no-op until ath9k_rx_init() completes. Link: https://syzkaller.appspot.com/bug?extid=4d2d56175b934b9a7bf9 [1] Reported-by: syzbot Signed-off-by: Tetsuo Handa Tested-by: syzbot Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/2b88f416-b2cb-7a18-d688-951e6dc3fe92@i-love.sakura.ne.jp commit 01e782c891083f1847c0b62902bfe3c2812566c6 Author: Wen Gong Date: Fri Dec 17 20:27:21 2021 +0200 ath11k: fix warning of RCU usage for ath11k_mac_get_arvif_by_vdev_id() When enable more debug config, it happen below warning. It is because the caller does not add rcu_read_lock()/rcu_read_unlock() to wrap the rcu_dereference(). Add rcu_read_lock()/rcu_read_unlock() to wrap rcu_dereference(), then fixed it. [ 180.716604] ============================= [ 180.716670] WARNING: suspicious RCU usage [ 180.716734] 5.16.0-rc4-wt-ath+ #542 Not tainted [ 180.716895] ----------------------------- [ 180.716957] drivers/net/wireless/ath/ath11k/mac.c:506 suspicious rcu_dereference_check() usage! [ 180.717023] other info that might help us debug this: [ 180.717087] rcu_scheduler_active = 2, debug_locks = 1 [ 180.717151] no locks held by swapper/0/0. [ 180.717215] stack backtrace: [ 180.717279] CPU: 0 PID: 0 Comm: swapper/0 Kdump: loaded Not tainted 5.16.0-rc4-wt-ath+ #542 [ 180.717346] Hardware name: Intel(R) Client Systems NUC8i7HVK/NUC8i7HVB, BIOS HNKBLi70.86A.0067.2021.0528.1339 05/28/2021 [ 180.717411] Call Trace: [ 180.717475] [ 180.717541] dump_stack_lvl+0x57/0x7d [ 180.717610] ath11k_mac_get_arvif_by_vdev_id+0x1ab/0x2d0 [ath11k] [ 180.717694] ? ath11k_mac_get_arvif+0x140/0x140 [ath11k] [ 180.717798] ? ath11k_wmi_tlv_op_rx+0xc1b/0x2520 [ath11k] [ 180.717888] ? kfree+0xe8/0x2c0 [ 180.717959] ath11k_wmi_tlv_op_rx+0xc27/0x2520 [ath11k] [ 180.718038] ? ath11k_mgmt_rx_event+0xda0/0xda0 [ath11k] [ 180.718113] ? __lock_acquire+0xb72/0x1870 [ 180.718182] ? lockdep_hardirqs_on_prepare.part.0+0x18c/0x370 [ 180.718250] ? sched_clock_cpu+0x15/0x1b0 [ 180.718314] ? find_held_lock+0x33/0x110 [ 180.718381] ? __lock_release+0x4bd/0x9f0 [ 180.718447] ? lock_downgrade+0x130/0x130 [ 180.718517] ath11k_htc_rx_completion_handler+0x38f/0x5b0 [ath11k] [ 180.718596] ? __local_bh_enable_ip+0xa0/0x110 [ 180.718662] ath11k_ce_recv_process_cb+0x5ac/0x920 [ath11k] [ 180.718783] ? __lock_acquired+0x205/0x890 [ 180.718864] ? ath11k_ce_rx_post_pipe+0x970/0x970 [ath11k] [ 180.718949] ? __wake_up_bit+0x100/0x100 [ 180.719020] ath11k_pci_ce_tasklet+0x5f/0xf0 [ath11k_pci] [ 180.719085] ? tasklet_clear_sched+0x42/0xe0 [ 180.719148] tasklet_action_common.constprop.0+0x204/0x2f0 [ 180.719217] __do_softirq+0x276/0x86a [ 180.719281] ? __common_interrupt+0x92/0x1d0 [ 180.719350] __irq_exit_rcu+0x11c/0x180 [ 180.719418] irq_exit_rcu+0x5/0x20 [ 180.719482] common_interrupt+0xa4/0xc0 [ 180.719547] [ 180.719609] [ 180.719671] asm_common_interrupt+0x1e/0x40 [ 180.719772] RIP: 0010:cpuidle_enter_state+0x1f3/0x8d0 [ 180.719838] Code: 00 41 8b 77 04 bf ff ff ff ff e8 78 f1 ff ff 31 ff e8 81 fa 52 fe 80 7c 24 08 00 0f 85 9e 01 00 00 e8 11 13 78 fe fb 45 85 e4 <0f> 88 8c 02 00 00 49 63 ec 48 8d 44 6d 00 48 8d 44 85 00 48 8d 7c [ 180.719909] RSP: 0018:ffffffffa4607dd0 EFLAGS: 00000202 [ 180.719982] RAX: 00000000002aea91 RBX: ffffffffa4a5fec0 RCX: 1ffffffff49ca501 [ 180.720047] RDX: 0000000000000000 RSI: ffffffffa3c6e4e0 RDI: ffffffffa3dcf2a0 [ 180.720110] RBP: 0000000000000002 R08: 0000000000000001 R09: ffffffffa4e54d17 [ 180.720173] R10: fffffbfff49ca9a2 R11: 0000000000000001 R12: 0000000000000002 [ 180.720236] R13: ffff8881169ccc04 R14: 0000002a13899598 R15: ffff8881169ccc00 [ 180.720321] cpuidle_enter+0x45/0xa0 [ 180.720413] cpuidle_idle_call+0x274/0x3f0 [ 180.720503] ? arch_cpu_idle_exit+0x30/0x30 [ 180.720869] ? tsc_verify_tsc_adjust+0x97/0x2e0 [ 180.720935] ? lockdep_hardirqs_off+0x90/0xd0 [ 180.721002] do_idle+0xe0/0x150 [ 180.721069] cpu_startup_entry+0x14/0x20 [ 180.721134] start_kernel+0x3a2/0x3c2 [ 180.721200] secondary_startup_64_no_verify+0xb0/0xbb [ 180.721274] Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-02892.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211217064132.30911-1-quic_wgong@quicinc.com commit c3b39553fc7712a9621a19d9670d6f250943d50e Author: Wen Gong Date: Fri Dec 17 20:27:21 2021 +0200 ath11k: add signal report to mac80211 for QCA6390 and WCN6855 IEEE80211_HW_USES_RSS is set in ath11k, then the device uses RSS and thus requires parallel RX which implies using per-CPU station statistics in sta_get_last_rx_stats() of mac80211. Currently signal is only set in ath11k_mgmt_rx_event(), and not set for RX data packet, then it show signal as 0 for iw command easily. Change to get signal from firmware and report to mac80211. For QCA6390 and WCN6855, the rssi value is already in dbm unit, so don't need to convert it again. Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211216070535.31732-1-quic_wgong@quicinc.com commit b488c766442f7d9c07ea0708aa2a1a6bff1baef5 Author: Wen Gong Date: Fri Dec 17 20:27:21 2021 +0200 ath11k: report rssi of each chain to mac80211 for QCA6390/WCN6855 Command "iw wls1 station dump" does not show each chain's rssi currently. If the rssi of each chain from mon status which parsed in function ath11k_hal_rx_parse_mon_status_tlv() is invalid, then ath11k send wmi cmd WMI_REQUEST_STATS_CMDID with flag WMI_REQUEST_RSSI_PER_CHAIN_STAT to firmware, and parse the rssi of chain in wmi WMI_UPDATE_STATS_EVENTID, then report them to mac80211. WMI_REQUEST_STATS_CMDID is only sent when CONFIG_ATH11K_DEBUGFS is set, it is only called by ath11k_mac_op_sta_statistics(). It does not effect performance and power consumption. Because after STATION connected to AP, it is only called every 6 seconds by NetworkManager in below stack. [ 797.005587] CPU: 0 PID: 701 Comm: NetworkManager Tainted: G W OE 5.13.0-rc6-wt-ath+ #2 [ 797.005596] Hardware name: LENOVO 418065C/418065C, BIOS 83ET63WW (1.33 ) 07/29/2011 [ 797.005600] RIP: 0010:ath11k_mac_op_sta_statistics+0x2f/0x1b0 [ath11k] [ 797.005644] Code: 41 56 41 55 4c 8d aa 58 01 00 00 41 54 55 48 89 d5 53 48 8b 82 58 01 00 00 48 89 cb 4c 8b 70 20 49 8b 06 4c 8b a0 90 08 00 00 <0f> 0b 48 8b 82 b8 01 00 00 48 ba 00 00 00 00 01 00 00 00 48 89 81 [ 797.005651] RSP: 0018:ffffb1fc80a4b890 EFLAGS: 00010282 [ 797.005658] RAX: ffff8a5726200000 RBX: ffffb1fc80a4b958 RCX: ffffb1fc80a4b958 [ 797.005664] RDX: ffff8a5726a609f0 RSI: ffff8a581247f598 RDI: ffff8a5702878800 [ 797.005668] RBP: ffff8a5726a609f0 R08: 0000000000000000 R09: 0000000000000000 [ 797.005672] R10: 0000000000000000 R11: 0000000000000007 R12: 02dd68024f75f480 [ 797.005676] R13: ffff8a5726a60b48 R14: ffff8a5702879f40 R15: ffff8a5726a60000 [ 797.005681] FS: 00007f632c52a380(0000) GS:ffff8a583a200000(0000) knlGS:0000000000000000 [ 797.005687] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 797.005692] CR2: 00007fb025d69000 CR3: 00000001124f6005 CR4: 00000000000606f0 [ 797.005698] Call Trace: [ 797.005710] sta_set_sinfo+0xa7/0xb80 [mac80211] [ 797.005820] ieee80211_get_station+0x50/0x70 [mac80211] [ 797.005925] nl80211_get_station+0xd1/0x200 [cfg80211] [ 797.006045] genl_family_rcv_msg_doit.isra.15+0x111/0x140 [ 797.006059] genl_rcv_msg+0xe6/0x1e0 [ 797.006065] ? nl80211_dump_station+0x220/0x220 [cfg80211] [ 797.006223] ? nl80211_send_station.isra.72+0xf50/0xf50 [cfg80211] [ 797.006348] ? genl_family_rcv_msg_doit.isra.15+0x140/0x140 [ 797.006355] netlink_rcv_skb+0xb9/0xf0 [ 797.006363] genl_rcv+0x24/0x40 [ 797.006369] netlink_unicast+0x18e/0x290 [ 797.006375] netlink_sendmsg+0x30f/0x450 [ 797.006382] sock_sendmsg+0x5b/0x60 [ 797.006393] ____sys_sendmsg+0x219/0x240 [ 797.006403] ? copy_msghdr_from_user+0x5c/0x90 [ 797.006413] ? ____sys_recvmsg+0xf5/0x190 [ 797.006422] ___sys_sendmsg+0x88/0xd0 [ 797.006432] ? copy_msghdr_from_user+0x5c/0x90 [ 797.006443] ? ___sys_recvmsg+0x9e/0xd0 [ 797.006454] ? __fget_files+0x58/0x90 [ 797.006461] ? __fget_light+0x2d/0x70 [ 797.006466] ? do_epoll_wait+0xce/0x720 [ 797.006476] ? __sys_sendmsg+0x63/0xa0 [ 797.006485] __sys_sendmsg+0x63/0xa0 [ 797.006497] do_syscall_64+0x3c/0xb0 [ 797.006509] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 797.006519] RIP: 0033:0x7f632d99912d [ 797.006526] Code: 28 89 54 24 1c 48 89 74 24 10 89 7c 24 08 e8 ca ee ff ff 8b 54 24 1c 48 8b 74 24 10 41 89 c0 8b 7c 24 08 b8 2e 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 2f 44 89 c7 48 89 44 24 08 e8 fe ee ff ff 48 [ 797.006533] RSP: 002b:00007ffd80808c00 EFLAGS: 00000293 ORIG_RAX: 000000000000002e [ 797.006540] RAX: ffffffffffffffda RBX: 0000563dab99d840 RCX: 00007f632d99912d [ 797.006545] RDX: 0000000000000000 RSI: 00007ffd80808c50 RDI: 000000000000000b [ 797.006549] RBP: 00007ffd80808c50 R08: 0000000000000000 R09: 0000000000001000 [ 797.006552] R10: 0000563dab96f010 R11: 0000000000000293 R12: 0000563dab99d840 [ 797.006556] R13: 0000563dabbb28c0 R14: 00007f632dad4280 R15: 0000563dabab11c0 [ 797.006563] ---[ end trace c9dcf08920c9945c ]--- Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01230-QCAHSTSWPLZ_V2_TO_X86-1 Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-02892.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211215090944.19729-1-quic_wgong@quicinc.com commit a5d862da91058a855ab00bf46b5383543bbf3979 Author: Jonas Jelonek Date: Fri Dec 17 20:27:20 2021 +0200 ath5k: switch to rate table based lookup Switching from legacy usage of ieee80211_get_tx_rates() lookup to direct rate table lookup in struct ieee80211_sta->rates. The current rate control API allows drivers to directly get rates from ieee80211_sta->rates. ath5k is currently one of the legacy drivers that perform translation/merge with the internal rate table via ieee80211_get_tx_rates provided by rate control API. For our upcoming changes to rate control API and the implementation of transmit power control, this patch changes the behaviour. The call to ieee80211_get_tx_rates and subsequent calls are also avoided. ath5k now directly reads rates from sta->rates into its internal rate table. Cause ath5k does not rely on the rate array in SKB->CB, this is not considered anymore except for the first entry (used for probing). Tested this on a PCEngines ALIX with CMP9-GP miniPCI wifi card (Atheros AR5213A). Generated traffic between AP and multiple STAs before and after applying the patch and simultaneously measured throughput and captured rc_stats. Comparison resulted in same rate selection and no performance loss between both runs. Co-developed-by: Thomas Huehn Signed-off-by: Thomas Huehn Signed-off-by: Jonas Jelonek Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211215215042.637-1-jelonek.jonas@gmail.com commit 712fe4c849829352dd45dc14e027d61500931f85 Author: Magnus Damm Date: Tue Dec 7 11:02:20 2021 +0900 serial: sh-sci: Remove BREAK/FRAME/PARITY/OVERRUN printouts Update the SCIF serial driver to remove printouts for break, frame, parity and overrun errors. This reduces the amount of console printouts generated by the defconfig kernel on R-Car Gen3 for certain use cases. To retrieve more information about such errors the user may inspect counters. Also these errors are fed into the TTY layer for further application specific handling. Reviewed-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Signed-off-by: Magnus Damm Link: https://lore.kernel.org/r/163884254093.18109.2982470198301927679.sendpatchset@octo Signed-off-by: Greg Kroah-Hartman commit 46dacba8fea90d4b2562d45e8ca132f20a9ff5ce Author: Andy Shevchenko Date: Mon Nov 22 15:35:12 2021 +0200 serial: 8250_pericom: Use serial_dl_write() instead of open coded It's better to stick with standard API to write and read DL value when the hardware is compatible with it. In case any quirks are needed it may be easily added in one place rather than modifying code here and there. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211122133512.8947-4-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit b4ccaf5aa2d795ee7f47a6eeb209f3de981e1929 Author: Jay Dolan Date: Mon Nov 22 15:35:11 2021 +0200 serial: 8250_pericom: Re-enable higher baud rates Add UPF_MAGIC_MULTIPLIER to the port flags since there is now range checking in serial8250_get_baud_rate() in 8250_port.c. Signed-off-by: Jay Dolan Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211122133512.8947-3-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit fcfd3c09f40786f8a296bfc93909612cc571c087 Author: Andy Shevchenko Date: Mon Nov 22 15:35:10 2021 +0200 serial: 8250_pci: Split out Pericom driver Pericom along with Acces I/O support consumes a lot of LOCs in 8250_pci.c. For the sake of easier maintenance, split it to a separate driver. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211122133512.8947-2-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 8cf8d3c4a634042f37ba34429e6a36412640ede4 Author: Sam Protsenko Date: Sat Dec 4 21:57:57 2021 +0200 tty: serial: samsung: Fix console registration from module On modern Exynos SoCs (like Exynos850) the UART can be implemented as a part of USI IP-core. In such case, USI driver is used to initialize USI registers, and it also calls of_platform_populate() to instantiate all sub-nodes (e.g. serial node) of USI node. When serial driver is built-in, but USI driver is a module, and CONFIG_SERIAL_SAMSUNG_CONSOLE is enabled, next call chain will happen when loading USI module from user space: usi_init v usi_probe v of_platform_populate v s3c24xx_serial_probe v uart_add_one_port v uart_configure_port v register_console v try_enable_new_console v s3c24xx_serial_console_setup But because the serial driver is built-in, and s3c24xx_serial_console_setup() is marked with __init keyword, that symbol will discarded and long gone by that time already, causing failed paging request. That happens during the next config combination: EXYNOS_USI=m SERIAL_SAMSUNG=y SERIAL_SAMSUNG_CONSOLE=y That config should be completely possible, so rather than limiting SERIAL_SAMSUNG choice to "m" only when USI=m, remove __init keyword for all affected functions. Signed-off-by: Sam Protsenko Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20211204195757.8600-6-semen.protsenko@linaro.org Signed-off-by: Greg Kroah-Hartman commit 0882b473b084df31288003b3bee974aabac9dcf9 Author: Sam Protsenko Date: Sat Dec 4 21:57:56 2021 +0200 tty: serial: samsung: Enable console as module Enable serial driver to be built as a module. To do so, init the console support on driver/module load instead of using console_initcall(). Inspired by commit 87a0b9f98ac5 ("tty: serial: meson: enable console as module"). Signed-off-by: Sam Protsenko Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20211204195757.8600-5-semen.protsenko@linaro.org Signed-off-by: Greg Kroah-Hartman commit 59f37b7370ef56e6faf25d0e18bc597a0af40bb8 Author: Sam Protsenko Date: Sat Dec 4 21:57:55 2021 +0200 tty: serial: samsung: Remove USI initialization USI control is now extracted to the dedicated USI driver. Remove USI related code from serial driver to avoid conflicts and code duplication. Signed-off-by: Sam Protsenko Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20211204195757.8600-4-semen.protsenko@linaro.org Signed-off-by: Greg Kroah-Hartman commit 9606ca2ea190e439f90426e2a740a48c800a0aab Author: Maarten Lankhorst Date: Thu Dec 16 15:27:39 2021 +0100 drm/i915: Ensure i915_vma tests do not get -ENOSPC with the locking changes. Now that we require locking to evict, multiple vmas from the same object might not be evicted. This is expected and required, because execbuf will move to short-term pinning by using the lock only. This will cause these tests to fail, because they create a ton of vma's for the same object. Unbind manually to prevent spurious -ENOSPC in those mock tests. Signed-off-by: Maarten Lankhorst Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20211216142749.1966107-8-maarten.lankhorst@linux.intel.com commit fd06ccf15987dd94dfb902f328ef06c010bc7972 Author: Maarten Lankhorst Date: Thu Dec 16 15:27:38 2021 +0100 drm/i915: Ensure gem_contexts selftests work with unbind changes, v2. In the next commits, we may not evict when refcount = 0. igt_vm_isolation() continuously tries to pin/unpin at same address, but also calls put() on the object, which means the object may not be unpinned in time. Instead of this, re-use the same object over and over, so they can be unbound as required. Changes since v1: - Fix cleaning up obj_b on failure. (Matt) Signed-off-by: Maarten Lankhorst Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20211216142749.1966107-7-maarten.lankhorst@linux.intel.com commit 576c4ef510d7ad7f43730ba799441b0f24a29b1d Author: Maarten Lankhorst Date: Thu Dec 16 15:27:37 2021 +0100 drm/i915: Force ww lock for i915_gem_object_ggtt_pin_ww, v2. We will need the lock to unbind the vma, and wait for bind to complete. Remove the special casing for the !ww path, and force ww locking for all. Changes since v1: - Pass err to for_i915_gem_ww handling for -EDEADLK handling. Signed-off-by: Maarten Lankhorst Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20211216142749.1966107-6-maarten.lankhorst@linux.intel.com commit 2abb6195512d14f0da45a27ca1be7cfca6658c5f Author: Maarten Lankhorst Date: Thu Dec 16 15:27:36 2021 +0100 drm/i915: Take object lock in i915_ggtt_pin if ww is not set i915_vma_wait_for_bind needs the vma lock held, fix the caller. Signed-off-by: Maarten Lankhorst Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20211216142749.1966107-5-maarten.lankhorst@linux.intel.com commit e91aad4b604a62661eb3e51027840bbd4173a78a Merge: 9193b2b75e062 3ac5f9db26bb7 Author: Arnd Bergmann Date: Mon Dec 20 16:31:40 2021 +0100 Merge tag 'samsung-soc-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into arm/soc Samsung mach/soc changes for v5.17 1. Minor fixes for S3C platforms. 2. Remove HAVE_S3C2410_I2C Kconfig symbol - not really useful. * tag 'samsung-soc-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: ARM: samsung: Remove HAVE_S3C2410_I2C and use direct dependencies ARM: s3c: add one more "fallthrough" statement in Jive ARM: s3c: include header for prototype of s3c2410_modify_misccr Link: https://lore.kernel.org/r/20211220115530.30961-3-krzysztof.kozlowski@canonical.com Signed-off-by: Arnd Bergmann commit 0b4d1f0e936e5c6beaebc32785465228ae0fdd16 Author: Maarten Lankhorst Date: Thu Dec 16 15:27:35 2021 +0100 drm/i915: Remove pages_mutex and intel_gtt->vma_ops.set/clear_pages members, v3. Big delta, but boils down to moving set_pages to i915_vma.c, and removing the special handling, all callers use the defaults anyway. We only remap in ggtt, so default case will fall through. Because we still don't require locking in i915_vma_unpin(), handle this by using xchg in get_pages(), as it's locked with obj->mutex, and cmpxchg in unpin, which only fails if we race a against a new pin. Changes since v1: - aliasing gtt sets ZERO_SIZE_PTR, not -ENODEV, remove special case from __i915_vma_get_pages(). (Matt) Changes since v2: - Free correct old pages in __i915_vma_get_pages(). (Matt) Remove race of clearing vma->pages accidentally from put, free it but leave it set, as only get has the lock. Signed-off-by: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/20211216142749.1966107-4-maarten.lankhorst@linux.intel.com Reviewed-by: Matthew Auld commit 9193b2b75e062992289785022e6859a48dba235a Merge: 4d4872fef9d17 b0100bce4ff82 Author: Arnd Bergmann Date: Mon Dec 20 16:30:38 2021 +0100 Merge tag 'imx-soc-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/soc i.MX SoC update for 5.17: - A couple of cleanups from Lukas Bulwahn to remove left-over from i.MX{27,31,35} board file removal, and rename DEBUG_IMX21_IMX27_UART to DEBUG_IMX27_UART. * tag 'imx-soc-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: ARM: imx: rename DEBUG_IMX21_IMX27_UART to DEBUG_IMX27_UART ARM: imx: remove dead left-over from i.MX{27,31,35} removal Link: https://lore.kernel.org/r/20211218071427.26745-2-shawnguo@kernel.org Signed-off-by: Arnd Bergmann commit c6abaad5e992f39e3ae01b469989a636a8c38632 Merge: 6f6287b8b403c c720e38f4c2dd Author: Arnd Bergmann Date: Mon Dec 20 16:28:30 2021 +0100 Merge tag 'imx-defconfig-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/defconfig i.MX defconfig update for 5.17: - Enable pinctrl and clock drivers for i.MX8 ULP SoC. - A couple of patches from Adam Ford to enable Camera driver support for Beacon EmbeddedWorks i.MX8MM development kit. - Enable drivers for devices found on TQMa8MxML-MBa8Mx board. - Enable RTC_DRV_RV3029C2 driver support for DHCOM devices. * tag 'imx-defconfig-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: ARM: imx_v6_v7_defconfig: Enable for DHCOM devices required RTC_DRV_RV3029C2 arm64: defconfig: enable drivers for booting i.MX8ULP arm64: defconfig: enable drivers for TQ TQMa8MxML-MBa8Mx arm64: defconfig: Enable OV5640 arm64: defconfig: Enable VIDEO_IMX_MEDIA Link: https://lore.kernel.org/r/20211218071427.26745-6-shawnguo@kernel.org Signed-off-by: Arnd Bergmann commit e4e80625300390d8846b72d7076fd1a75af6ea60 Author: Maarten Lankhorst Date: Thu Dec 16 15:27:34 2021 +0100 drm/i915: Change shrink ordering to use locking around unbinding. Call drop_pages with the gem object lock held, instead of the other way around. This will allow us to drop the vma bindings with the gem object lock held. We plan to require the object lock for unpinning in the future, and this is an easy target. Signed-off-by: Maarten Lankhorst Reviewed-by: Niranjana Vishwanathapura Link: https://patchwork.freedesktop.org/patch/msgid/20211216142749.1966107-3-maarten.lankhorst@linux.intel.com commit ad5c99e02047f33bf7043543545e3b17f37c8d5c Author: Maarten Lankhorst Date: Thu Dec 16 15:27:33 2021 +0100 drm/i915: Remove unused bits of i915_vma/active api When reworking the code to move the eviction fence to the object, the best code is removed code. Remove some functions that are unused, and change the function definition if it's only used in 1 place. Signed-off-by: Maarten Lankhorst Reviewed-by: Niranjana Vishwanathapura [mlankhorst: Remove new use of i915_active_has_exclusive] Link: https://patchwork.freedesktop.org/patch/msgid/20211216142749.1966107-2-maarten.lankhorst@linux.intel.com commit 6f6287b8b403c6e4ff4acd82339e6fd0f6d6c28e Merge: 9ca65b682d36a e1137bcefa025 Author: Arnd Bergmann Date: Mon Dec 20 16:18:56 2021 +0100 Merge tag 'at91-defconfig-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into arm/defconfig AT91 defconfig #1 for 5.17: - Sama7: addition of QSPI SPI-NOR and the QSPI controller for this product - Addition of the crypto algorithms that are fallbacks for HW engines * tag 'at91-defconfig-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: ARM: configs: at91: Enable crypto software implementations ARM: configs: at91: sama7: Enable SPI NOR and QSPI controller Link: https://lore.kernel.org/r/20211217165850.29694-1-nicolas.ferre@microchip.com Signed-off-by: Arnd Bergmann commit 9ca65b682d36a7c0897dc29cc526033a97bfb005 Merge: a60c67fe3acf9 8ed567fbea94a Author: Arnd Bergmann Date: Mon Dec 20 16:17:27 2021 +0100 Merge tag 'tegra-for-5.17-arm-defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/defconfig ARM: tegra: Default configuration changes for v5.17-rc1 These patches enable various drivers used by new and existing boards in both the Tegra default configuration and the multi-v7 configuration. * tag 'tegra-for-5.17-arm-defconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: ARM: config: multi v7: Enable NVIDIA Tegra20 APB DMA driver ARM: config: multi v7: Enable NVIDIA Tegra20 S/PDIF driver ARM: tegra_defconfig: Enable S/PDIF driver ARM: config: multi v7: Enable display drivers used by Tegra devices ARM: tegra_defconfig: Enable drivers wanted by Acer Chromebooks and ASUS tablets Link: https://lore.kernel.org/r/20211217162253.1801077-6-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit 0fd319105fde3a6a0f8cc929bf46d1d6595c0984 Merge: d07156eb8aeca 51b1a5729469c Author: Arnd Bergmann Date: Mon Dec 20 16:13:25 2021 +0100 Merge tag 'samsung-dt64-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into arm/dt Samsung DTS ARM64 changes for v5.17 1. Add bindings for: Exynos USI, Samsung Galaxy A8 (2018) board, WinLink E850-96 board and WinLink vendor prefix. 2. Add pinctrl definitions used for Exynos850. 3. Minor fixes and improvements. 4. Convert serial on ExynosAutov9 to new hierarchy where serial is part of USI node. * tag 'samsung-dt64-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: dt-bindings: pinctrl: samsung: Add pin drive definitions for Exynos850 dt-bindings: arm: samsung: Document E850-96 board binding dt-bindings: Add vendor prefix for WinLink dt-bindings: arm: samsung: document jackpotlte board binding dt-bindings: soc: samsung: Fix I2C clocks order in USI binding example arm64: dts: exynos: convert serial_0 to USI on ExynosAutov9 dt-bindings: soc: samsung: Add Exynos USI bindings arm64: dts: exynos: Rename hsi2c nodes to i2c for Exynos5433 and Exynos7 Link: https://lore.kernel.org/r/20211220115530.30961-2-krzysztof.kozlowski@canonical.com Signed-off-by: Arnd Bergmann commit d07156eb8aecafe5c62652c99aff565562763296 Merge: aa7bb116f041d 29bf0ff5ae18a Author: Arnd Bergmann Date: Mon Dec 20 16:12:37 2021 +0100 Merge tag 'samsung-dt-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into arm/dt Samsung DTS ARM changes for v5.17 1. Fix Bluetooth GPIO on GT-I9100. 2. Minor improvements and dtschema fixes. * tag 'samsung-dt-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: ARM: dts: exynos: Rename hsi2c nodes to i2c for Exynos5260 ARM: dts: exynos: Use interrupt for BCM4330 host wakeup in I9100 ARM: dts: exynos: Fix BCM4330 Bluetooth reset polarity in I9100 Link: https://lore.kernel.org/r/20211220115530.30961-1-krzysztof.kozlowski@canonical.com Signed-off-by: Arnd Bergmann commit aa7bb116f041dd51d8ccf795c86ee68bec338a9b Merge: 505596c8d3cb8 aa67bacb482ae Author: Arnd Bergmann Date: Mon Dec 20 16:11:14 2021 +0100 Merge tag 'v5.16-next-dts32' of git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux into arm/dt - add device tree for Fairphone 1 (mt6589) * tag 'v5.16-next-dts32' of git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux: arm: dts: mt6589: Add device tree for Fairphone 1 Link: https://lore.kernel.org/r/9ea1efa3-492b-7204-58f8-5253cd5b05f9@gmail.com Signed-off-by: Arnd Bergmann commit 505596c8d3cb84ba54074f7843fc0c25310b3d7e Merge: 33f8b4862a8b4 f40c0f800f15e Author: Arnd Bergmann Date: Mon Dec 20 16:08:20 2021 +0100 Merge tag 'v5.16-next-dts64' of git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux into arm/dt mt8183: - add Acer Chromebook 314 - evb: add node to read thermisor from AUXIN0 - add several sku's for Lenovo IdeaPad Flex 3 Chromebook and ASUS Chromebook Detachable CM3 - update sensor mapping of the board temperature sensor - add some coresight nodes for CPU debugging - USB Type C connector description to all Chromebooks mt8192, mt8516: - smaller i2c related fixes mt8173: - enable backlight enable pin to all Chromebooks mt7986[a,b]: - add basic support * tag 'v5.16-next-dts64' of git://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux: (21 commits) arm64: dts: mediatek: add pinctrl support for mt7986b arm64: dts: mediatek: add pinctrl support for mt7986a arm64: dts: mt8183: kukui: Add Type C node arm64: dts: mediatek: add basic mt7986 support dt-bindings: arm64: dts: mediatek: Add mt7986 series arm64: dts: mt8183: support coresight-cpu-debug for mt8183 arm64: dts: mediatek: mt8173-elm: Add backlight enable pin config arm64: dts: mediatek: mt8173-elm: Move pwm pinctrl to pwm0 node arm64: dts: mt8183-kukui: Update Tboard sensor mapping table arm64: dts: mediatek: mt8173: Add gce-client-reg to display od/ufo dt-bindings: arm64: dts: mediatek: Add sku22 for mt8183 kakadu board dt-bindings: arm64: dts: mediatek: Add more SKUs for mt8183 fennel board dt-bindings: arm64: dts: mediatek: Add mt8183-kukui-jacuzzi-cozmo arm64: dts: mt8183: Add kakadu sku22 arm64: dts: mt8183: Add more fennel SKUs arm64: dts: mt8183: Add kukui-jacuzzi-cozmo board arm64: dts: mt8183: jacuzzi: remove unused ddc-i2c-bus arm64: dts: mediatek: mt8183-evb: Add node for thermistor arm64: dts: mediatek: mt8516: remove 2 invalid i2c clocks arm64: dts: mediatek: mt8192: fix i2c node names ... Link: https://lore.kernel.org/r/0d05e8b6-c56f-bad7-00c1-44682cedb38f@suse.com Signed-off-by: Arnd Bergmann commit 572006bce34caee37af84a8946895a495c56624a Author: Daniel Palmer Date: Mon Dec 13 18:40:35 2021 +0900 gpio: msc313: Add support for SSD201 and SSD202D This adds GPIO support for the SSD201 and SSD202D chips. Signed-off-by: Daniel Palmer Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 33f8b4862a8b4edceec9030c8e42e724aafe819e Merge: a5a44f4d509e9 0bc3e333a0c82 Author: Arnd Bergmann Date: Mon Dec 20 16:06:27 2021 +0100 Merge tag 'imx-dt64-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/dt i.MX arm64 device tree change for 5.17: - New SoC support: i.MX8 ULP. - New board support: i.MX8MM/MN based TQMa8Mx boards, iMX8MN BSH SMM S2, i.MX8 ULP EVK. - A series from Adam Ford to enable Camera and USB support for imx8mm-beacon device. - Add overlays for various serdes protocols on LS1028A QDS board using different PHY cards. - A series from Biwen Li to update LS1028A devices around RTC, flextimer and PWM support. - A series from Joakim Zhang to update ENET/FEC suppport on i.MX8M devices. - A couple of changes from Lucas Stach to update nitrogen8-som Ethernet PHY and I2C1 pad configuration. - A series from Martin Kepplinger to split out a shared imx8mq-librem5-r3 dtsi for Librem5 devices. - Add cache descriptions for i.MX8 SoCs. - A series from Vladimir Oltean to update ls1028a-rdb device tree in order to share the DTS between Linux and U-Boot. - Random device addtion to various i.MX8 and LX2160A based devices. * tag 'imx-dt64-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: (56 commits) arm64: dts: imx8mp-evk: configure multiple queues on eqos arm64: dts: ls1028a-qds: add overlays for various serdes protocols arm64: dts: ls1028a-qds: enable lpuart1 arm64: dts: ls1028a-qds: move rtc node to the correct i2c bus arm64: dts: ls1028a-rdb: enable pwm0 arm64: dts: ls1028a: add flextimer based pwm nodes arm64: dts: ls1028a: add ftm_alarm1 node to be used as wakeup source arm64: dts: ls1028a: Add PCIe EP nodes arm64: dts: lx2162a-qds: add interrupt line for RTC node arm64: dts: lx2162a-qds: support SD UHS-I and eMMC HS400 modes arm64: dts: lx2160a: enable usb3-lpm-capable for usb3 nodes arm64: dts: lx2160a-qds: Add mdio mux nodes arm64: dts: lx2160a: add optee-tz node arm64: dts: lx2160a-rdb: Add Inphi PHY node arm64: dts: imx8mm: don't assign PLL2 in SoC dtsi arm64: dts: nitrogen8-som: correct i2c1 pad-ctrl arm64: dts: nitrogen8-som: correct network PHY reset arm64: dts: imx8mn-bsh-smm-s2/pro: Add iMX8MN BSH SMM S2 boards arm64: dts: imx8mm/n: Remove the 'pm-ignore-notify' property arm64: dts: imx8ulp: add power domain entry for usdhc ... Link: https://lore.kernel.org/r/20211218071427.26745-5-shawnguo@kernel.org Signed-off-by: Arnd Bergmann commit a5a44f4d509e9aa1341d4347bce6802f192fd5cf Merge: 9018001ee03ee 3951cc6bae4cd Author: Arnd Bergmann Date: Mon Dec 20 16:04:56 2021 +0100 Merge tag 'imx-dt-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/dt i.MX arm device tree change for 5.17: - New board support: TQ-Systems MBa6x, Y Soft IOTA Crux/Crux+ board, JOZ Access Point, Phytec PEB-WLBT-05 support, BSH SMM-M2 IMX6ULZ SystemMaster. - Update SPBA bus node name to match binding schema. - A series from Christoph Niedermaier to update imx6qdl-dhcom board around Ethernet and USB support. - A series from Giulio Benetti to clean up undocumented/unused fixed clock compatibles. - A series from Laurent Pinchart to update i.MX7 MIPI_CSI support. - A couple of changes from Russell to update phy-mode for vf610-zii-dev-rev-b board. - Add Wacom digitizer support for imx7d-remarkable2 device. * tag 'imx-dt-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: (36 commits) ARM: dts: imx6: phytec: Add PEB-WLBT-05 support ARM: dts: imx6qdl: phytec: Add support for optional PEB-AV-02 LCD adapter ARM: dts: imx6qdl: phytec: Add support for optional PEB-EVAL-01 board ARM: dts: imx6qdl-dhcom: Add USB overcurrent pin on SoM layer ARM: dts: imx7d-remarkable2: add wacom digitizer device ARM: dts: imx6ulz-bsh-smm-m2: Add BSH SMM-M2 IMX6ULZ SystemMaster ARM: dts: imx6qdl-dhcom: Identify the PHY by ethernet-phy-id0007.c0f0 ARM: dts: imx6qdl-dhcom: Align PHY reset timing with other DHCOM SoMs ARM: dts: imx6qdl: drop "fsl,imx-ckih1" ARM: dts: imx6qdl: drop "fsl,imx-ckil" ARM: dts: imx6qdl: drop "fsl,imx-osc" ARM: dts: imx53: drop "fsl,imx-ckih2" ARM: dts: imx53: drop "fsl,imx-ckih1" ARM: dts: imx53: drop "fsl,imx-ckil" ARM: dts: imx53: drop "fsl,imx-osc" ARM: dts: imx51: drop "fsl,imx-ckih2" ARM: dts: imx51: drop "fsl,imx-ckih1" ARM: dts: imx51: drop "fsl,imx-ckil" ARM: dts: imx51: drop "fsl,imx-osc" ARM: dts: imx50: drop "fsl,imx-ckih2" ... Link: https://lore.kernel.org/r/20211218071427.26745-4-shawnguo@kernel.org Signed-off-by: Arnd Bergmann commit 9018001ee03eed5e3822bcf1de03e76ee2369d90 Merge: 8a3804c030e44 e1e06edd94d5b Author: Arnd Bergmann Date: Mon Dec 20 16:02:24 2021 +0100 Merge tag 'imx-bindings-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/dt i.MX dt-bindings update for 5.17: - New bindings for i.MX SPBA bus and i.MX8MN DISP blk-ctrl. - New vendor prefix for BSH Hausgeraete GmbH and JOZ BV. - New compatibles for various i.MX6 and i.MX8 boards. - Add optional 'fsl,continuous-burst-clk' property support for imx-weim binding. * tag 'imx-bindings-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: dt-bindings: soc: add binding for i.MX8MN DISP blk-ctrl dt-bindings: arm: fsl: Add BSH SMM-M2 IMX6ULZ SystemMaster board dt-bindings: arm: fsl: Add iMX8MN BSH SMM S2 boards dt-bindings: Add vendor prefix for BSH Hausgeraete GmbH dt-bindings: soc: imx: Add binding doc for spba bus dt-bindings: bus: imx-weim: add words about continuous bclk dt-bindings: arm: fsl: add TQMa8Mx boards dt-bindings: arm: fsl: add TQMa8MxNL boards dt-bindings: arm: fsl: add TQMa8MxML boards dt-bindings: arm: fsl: Add binding for imx8ulp evk dt-bindings: arm: fsl: Add Y Soft IOTA Crux/Crux+ boards dt-bindings: arm: fsl: add TQ-Systems boards based on i.MX6Q/QP/DL dt-bindings: arm: fsl: add JOZ Access Point dt-bindings: vendor-prefixes: Add an entry for JOZ BV Link: https://lore.kernel.org/r/20211218071427.26745-3-shawnguo@kernel.org Signed-off-by: Arnd Bergmann commit 8a3804c030e44335890bc9ca70cfa987488d9ec6 Author: Rob Herring Date: Fri Dec 17 16:12:32 2021 -0600 ARM: dts: Remove "spidev" nodes "spidev" is not a real device, but a Linux implementation detail. It has never been documented either. The kernel has WARNed on the use of it for over 6 years. Time to remove its usage from the tree. Signed-off-by: Rob Herring Acked-by: Nicolas Ferre Acked-by: Viresh Kumar Cc: Mark Brown Link: https://lore.kernel.org/r/20211217221232.3664417-1-robh@kernel.org' Reviwed-by: Mark Brown Signed-off-by: Arnd Bergmann commit 8d5c175fe19ac171af1ecf4b4c7693f1b7d0bcb0 Merge: 0724f8a147260 62480772263ab Author: Arnd Bergmann Date: Mon Dec 20 16:00:13 2021 +0100 Merge tag 'mvebu-dt-5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/gclement/mvebu into arm/dt mvebu dt for 5.17 (part 1) Add generic compatible to UART nodes on Armada 38x * tag 'mvebu-dt-5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/gclement/mvebu: ARM: dts: armada-38x: Add generic compatible to UART nodes Link: https://lore.kernel.org/r/875yrnm8uq.fsf@BL-laptop Signed-off-by: Arnd Bergmann commit 0724f8a14726038a5d95dea3695465bf5f09aa3e Merge: 990102a792c81 0734f8311ce72 Author: Arnd Bergmann Date: Mon Dec 20 15:58:27 2021 +0100 Merge tag 'mvebu-dt64-5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/gclement/mvebu into arm/dt mvebu dt64 for 5.17 (part 1) Enable more network hardware and gpios on CN9130-CRB Add new clock node needed by comphy on armada-37xx * tag 'mvebu-dt64-5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/gclement/mvebu: arm64: dts: marvell: cn9130: enable CP0 GPIO controllers arm64: dts: marvell: cn9130: add GPIO and SPI aliases arm64: dts: marvell: armada-37xx: Add xtal clock to comphy node arm/arm64: dts: Add MV88E6393X to CN9130-CRB device tree arm/arm64: dts: Enable CP0 GPIOs for CN9130-CRB Link: https://lore.kernel.org/r/878rwjm8vj.fsf@BL-laptop Signed-off-by: Arnd Bergmann commit 990102a792c8155a91654cadabcaf7c072dec672 Merge: a862e81808862 effb32e931dd4 Author: Arnd Bergmann Date: Mon Dec 20 15:55:51 2021 +0100 Merge tag 'ti-k3-dt-for-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/ti/linux into arm/dt Devicetree changes for TI K3 platforms for v5.17 merge window: * New Platforms: - J721s2 SoC, SoM and Common Processor Board support * New features: - CAN support on AM64 EVM and SK - TimeSync Router on AM64 * Fixes: - Correct d-cache-sets info on J7200 - Fix L2 cache-sets value for J721e/J7200/AM64 - Fixes for dtbs_check warnings wrt serdes_ln_ctrl node on J721e/J7200 - Disable McASP on IoT2050 board to fix dtbs_check warnings * tag 'ti-k3-dt-for-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/ti/linux: arch: arm64: ti: Add support J721S2 Common Processor Board arm64: dts: ti: Add initial support for J721S2 System on Module arm64: dts: ti: Add initial support for J721S2 SoC dt-bindings: pinctrl: k3: Introduce pinmux definitions for J721S2 dt-bindings: arm: ti: Add bindings for J721s2 SoC arm64: dts: ti: iot2050: Disable mcasp nodes at dtsi level arm64: dts: ti: k3-am642-evm/sk: Add support for main domain mcan nodes in EVM and disable them on SK arm64: dts: ti: k3-am64-main: Add support for MCAN arm64: dts: ti: k3-j721e-common-proc-board: Add support for mcu and main mcan nodes arm64: dts: ti: k3-j721e: Add support for MCAN nodes arm64: dts: ti: am654-base-board/am65-iot2050-common: Disable mcan nodes arm64: dts: ti: k3-am65-mcu: Add Support for MCAN arm64: dts: ti: k3-am64-main: add timesync router node arm64: dts: ti: k3-j7200: Correct the d-cache-sets info arm64: dts: ti: k3-j721e: Fix the L2 cache sets arm64: dts: ti: k3-j7200: Fix the L2 cache sets arm64: dts: ti: k3-am642: Fix the L2 cache sets arm64: dts: ti: j721e-main: Fix 'dtbs_check' in serdes_ln_ctrl node arm64: dts: ti: j7200-main: Fix 'dtbs_check' serdes_ln_ctrl node arm64: dts: ti: k3-j721e: correct cache-sets info Link: https://lore.kernel.org/r/20211217172806.10023-2-vigneshr@ti.com Signed-off-by: Arnd Bergmann commit a862e818088620ef196def9dc855fd278f9b15da Merge: b87cd3759d9d4 914ed1f56581f Author: Arnd Bergmann Date: Mon Dec 20 15:49:16 2021 +0100 Merge tag 'tegra-for-5.17-arm64-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/dt arm64: tegra: Device tree changes for v5.17-rc1 The vast majority of this contains various updates and cleanups to the Tegra device trees that will eventually help validate all of them using the dt-schema infrastructure. Another notable chunk of this contains additional Tegra234 support as well as support for the new Jetson AGX Orin Developer Kit. * tag 'tegra-for-5.17-arm64-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: (47 commits) arm64: tegra: Add host1x hotflush reset on Tegra210 arm64: tegra: Hook up MMC and BPMP to memory controller arm64: tegra: Add memory controller on Tegra234 arm64: tegra: Add EMC general interrupt on Tegra194 arm64: tegra: Update SDMMC4 speeds for Tegra194 arm64: tegra: Add dma-coherent for Tegra194 VIC arm64: tegra: Rename Ethernet PHY nodes arm64: tegra: Remove unused only-1-8-v properties arm64: tegra: Sort Tegra210 XUSB clocks correctly arm64: tegra: Add missing TSEC properties on Tegra210 arm64: tegra: jetson-nano: Remove extra PLL power supplies for PCIe and XUSB arm64: tegra: smaug: Remove extra PLL power supplies for XUSB arm64: tegra: jetson-tx1: Remove extra PLL power supplies for PCIe and XUSB arm64: tegra: Rename GPIO hog nodes to match schema arm64: tegra: Remove unsupported regulator properties arm64: tegra: Rename TCU node to "serial" arm64: tegra: Remove undocumented Tegra194 PCIe "core_m" clock arm64: tegra: Drop unused properties for Tegra194 PCIe arm64: tegra: Fix Tegra194 HSP compatible string arm64: tegra: Drop unsupported nvidia,lpdr property ... Link: https://lore.kernel.org/r/20211217162253.1801077-4-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit bef4460b85501759d0441125c739dff8b088d11e Author: Daniel Palmer Date: Mon Dec 13 18:40:34 2021 +0900 gpio: msc313: Code clean ups - Remove the unneeded assignment of ret before returning it. - Remove an unneeded blank line Signed-off-by: Daniel Palmer Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit e82513696eadcf71048be174b4b71f9903ba4afd Author: Daniel Palmer Date: Mon Dec 13 18:40:33 2021 +0900 dt-bindings: gpio: msc313: Add offsets for ssd20xd Add the gpio offsets for the SSD201 and SSD202D chips. Signed-off-by: Daniel Palmer Acked-by: Rob Herring Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 8e6458cd8ce827f1c2d0230f155a1579064f0727 Author: Daniel Palmer Date: Mon Dec 13 18:40:32 2021 +0900 dt-bindings: gpio: msc313: Add compatible for ssd20xd Add a compatible string for "ssd20xd" for the SigmaStar SSD201 and SSD202D chips. These chips are the same die with different memory bonded so they don't need their own strings. Signed-off-by: Daniel Palmer Acked-by: Rob Herring Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit b87cd3759d9d45cbf763bb592129e02871e69261 Merge: 79309f5bf43d3 c9059a6bb993d Author: Arnd Bergmann Date: Mon Dec 20 15:37:23 2021 +0100 Merge tag 'tegra-for-5.17-dt-bindings' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/dt dt-bindings: Changes for v5.17-rc1 This contains a bunch of json-schema conversions for various Tegra- related DT bindings and additions for new SoC and board support. * tag 'tegra-for-5.17-dt-bindings' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: (30 commits) media: dt: bindings: tegra-vde: Document OPP and power domain media: dt: bindings: tegra-vde: Convert to schema dt-bindings: host1x: Document Memory Client resets of Host1x, GR2D and GR3D dt-bindings: host1x: Document OPP and power domain properties dt-bindings: clock: tegra-car: Document new clock sub-nodes dt-bindings: ARM: tegra: Document Pegatron Chagall dt-bindings: ARM: tegra: Document ASUS Transformers dt-bindings: usb: tegra-xudc: Document interconnects and iommus properties dt-bindings: serial: Document Tegra234 TCU dt-bindings: serial: tegra-tcu: Convert to json-schema dt-bindings: thermal: tegra186-bpmp: Convert to json-schema dt-bindings: firmware: tegra: Convert to json-schema dt-bindings: tegra: pmc: Convert to json-schema dt-bindings: serial: 8250: Document Tegra234 UART dt-bindings: mmc: tegra: Document Tegra234 SDHCI dt-bindings: fuse: tegra: Document Tegra234 FUSE dt-bindings: fuse: tegra: Convert to json-schema dt-bindings: rtc: tegra: Document Tegra234 RTC dt-bindings: rtc: tegra: Convert to json-schema dt-bindings: mailbox: tegra: Document Tegra234 HSP ... Link: https://lore.kernel.org/r/20211217162253.1801077-3-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit 9593bdfa1d146beb8773dc900e62608afcaa47a3 Merge: 87e1287614ae0 96c8bddb6cdef Author: Arnd Bergmann Date: Mon Dec 20 15:33:33 2021 +0100 Merge tag 'samsung-drivers-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux into arm/drivers Samsung SoC drivers changes for v5.17 1. Exynos ChipID: add Exynos7885 support. 2. Exynos PMU: add Exynos850 support. 3. Minor bindings cleanup. 4. Add Exynos USIv2 (Universal Serial Interface) driver. The USI block is a shared IP block between I2C, UART/serial and SPI. Basically one has to choose which feature the USI block will support and later the regular I2C/serial/SPI driver will bind and work. This merges also one commit with dt-binding headers from my dts64 pull request. Together with a future serial driver change, this will break the ABI. Affected: Serial on ExynosAutov9 SADK and out-of-tree ExynosAutov9 boards Why: To properly and efficiently support the USI with new hierarchy of USI-{serial,SPI,I2C} devicetree nodes. Rationale: Recently added serial and USI support was short-sighted and did not allow to smooth support of other features (SPI and I2C). Adding support for USI-SPI and USI-I2C would effect in code duplication. Adding support for different USI versions (currently supported is USIv2 but support for v1 is planned) would cause even more code duplication and create a solution difficult to maintain. Since USI-serial and ExynosAutov9 have been added recently, are considered fresh development features and there are no supported products using them, the code/solution is being refactored in non-backwards compatible way. The compatibility is not broken yet. It will be when serial driver changes are accepted. The ABI break was discussed with only known users of ExynosAutov9 and received their permission. * tag 'samsung-drivers-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux: dt-bindings: soc: samsung: keep SoC driver bindings together soc: samsung: Add USI driver dt-bindings: soc: samsung: Add Exynos USI bindings soc: samsung: exynos-pmu: Add Exynos850 support dt-bindings: samsung: pmu: Document Exynos850 soc: samsung: exynos-chipid: add Exynos7885 SoC support soc: samsung: exynos-chipid: describe which SoCs go with compatibles Link: https://lore.kernel.org/r/20211220115405.30434-2-krzysztof.kozlowski@canonical.com Signed-off-by: Arnd Bergmann commit 87e1287614ae07787d0b13dcf4fecc174139a05d Merge: a904c5f099e04 7f511d514e8c3 Author: Arnd Bergmann Date: Mon Dec 20 15:07:57 2021 +0100 Merge tag 'imx-drivers-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/drivers i.MX drivers update for 5.17: - A number of patches from Adam Ford to update gpcv2 and blk-ctrl driver to keep i.MX8MM VPU-H1 and i.MX8MN GPUMIX bus clocks active, and add i.MX8MN display related domain support. - Add optional continuous burst clock support for imx-weim bus driver. - Call pm_runtime_put_sync_suspend() instead of pm_runtime_put() in gpcv2 driver to prevent a sequence issue seen with i.MX8MM GPU and MIX domain. * tag 'imx-drivers-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: soc: imx: imx8m-blk-ctrl: add i.MX8MN DISP blk-ctrl dt-bindings: power: imx8mn: add defines for DISP blk-ctrl domains soc: imx: gpcv2: Add dispmix and mipi domains to imx8mn soc: imx: gpcv2: keep i.MX8MN gpumix bus clock enabled bus: imx-weim: optionally enable continuous burst clock soc: imx: gpcv2: keep i.MX8MM VPU-H1 bus clock active soc: imx: gpcv2: Synchronously suspend MIX domains Link: https://lore.kernel.org/r/20211218071427.26745-1-shawnguo@kernel.org Signed-off-by: Arnd Bergmann commit a904c5f099e0479e857f8b1e8eb1f26d604c473e Merge: b118863d2fcfb bb29e4091079d Author: Arnd Bergmann Date: Mon Dec 20 15:06:46 2021 +0100 Merge tag 'at91-soc-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into arm/drivers AT91 SoC #1 for 5.17: - one low priority fix about of_node_put() missing in PM code * tag 'at91-soc-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: ARM: at91: pm: Add of_node_put() before goto Link: https://lore.kernel.org/r/20211217164134.28566-1-nicolas.ferre@microchip.com Signed-off-by: Arnd Bergmann commit cd448b24c621b2b676b4fa50a4ab4e9e9da114e2 Merge: 16e3613a39fd1 31bd548f40cd0 Author: Marc Zyngier Date: Mon Dec 20 14:00:47 2021 +0000 Merge branch irq/misc-5.17 into irq/irqchip-next * irq/misc-5.17: : . : Misc irqchip fixes: : : - Disable GICv4.1 RD's VPE table at boot time to avoid RAS errors : - Fix Ingenic TCU's u32/unsigned long abuse : - Some GICv2m constifying : - Mark imx_gpcv2_instance as __ro_after_init : - Enable a few missing IRQs on Spear : - Conversion to platform_get_irq_optional() for the Renesas irqchips : . irqchip/renesas-intc-irqpin: Use platform_get_irq_optional() to get the interrupt irqchip/renesas-irqc: Use platform_get_irq_optional() to get the interrupt irqchip/gic-v4: Disable redistributors' view of the VPE table at boot time irqchip/ingenic-tcu: Use correctly sized arguments for bit field irqchip/gic-v2m: Add const to of_device_id irqchip/imx-gpcv2: Mark imx_gpcv2_instance with __ro_after_init irqchip/spear-shirq: Add support for IRQ 0..6 Signed-off-by: Marc Zyngier commit dda0190d7ff7f26c221f9ab1659a73d4517920e7 Author: Fuad Tabba Date: Wed Dec 8 19:32:57 2021 +0000 KVM: arm64: Fix comment on barrier in kvm_psci_vcpu_on() The barrier is there for power_off rather than power_state. Probably typo in commit 358b28f09f0ab074 ("arm/arm64: KVM: Allow a VCPU to fully reset itself"). Signed-off-by: Fuad Tabba Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211208193257.667613-3-tabba@google.com commit a080e323be8d66415944ad862fcf750825f871e7 Author: Fuad Tabba Date: Wed Dec 8 19:32:56 2021 +0000 KVM: arm64: Fix comment for kvm_reset_vcpu() The comment for kvm_reset_vcpu() refers to the sysreg table as being the table above, probably because of the code extracted at commit f4672752c321ea36 ("arm64: KVM: virtual CPU reset"). Fix the comment to remove the potentially confusing reference. Signed-off-by: Fuad Tabba Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211208193257.667613-2-tabba@google.com commit 500ca5241bf8054c8a973e54cb28629614f43178 Author: Fuad Tabba Date: Wed Dec 8 19:28:10 2021 +0000 KVM: arm64: Use defined value for SCTLR_ELx_EE Replace the hardcoded value with the existing definition. No functional change intended. Signed-off-by: Fuad Tabba Acked-by: Will Deacon Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211208192810.657360-1-tabba@google.com commit b118863d2fcfbe80da171c16b2ffaa3c7c7cef6b Merge: a1539b2e2631b 81c4c86c66650 Author: Arnd Bergmann Date: Mon Dec 20 14:38:17 2021 +0100 Merge tag 'tegra-for-5.17-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/drivers soc/tegra: Changes for v5.17-rc1 This set of changes contains some preparatory work that is shared by several branches and trees to support DVFS via power domains. There's also a bit of cleanup and improvements to reboot on chips that use PSCI. * tag 'tegra-for-5.17-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: soc/tegra: pmc: Rename core power domain soc/tegra: pmc: Rename 3d power domains soc/tegra: regulators: Prepare for suspend soc/tegra: fuse: Use resource-managed helpers soc/tegra: fuse: Reset hardware soc/tegra: pmc: Add reboot notifier soc/tegra: Don't print error message when OPPs not available Link: https://lore.kernel.org/r/20211217162253.1801077-1-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit aade40b62745cf0b4e8a17d43652c5faff354e6b Author: Joerg Roedel Date: Mon Dec 20 13:34:48 2021 +0100 iommu/iova: Temporarily include dma-mapping.h from iova.h Some users of iova.h still expect that dma-mapping.h is also included. Re-add the include until these users are updated to fix compile failures in the iommu tree. Acked-by: Robin Murphy Link: https://lore.kernel.org/r/20211220123448.19996-1-joro@8bytes.org Signed-off-by: Joerg Roedel commit e9a3b57efd28fe889a98171bdc1e9e0dd7eb9a50 Author: Ricard Wanderlof Date: Wed Dec 15 18:04:23 2021 +0100 ASoC: codec: tlv320adc3xxx: New codec driver New codec driver for Texas Instruments TLV320ADC3001 and TLV320ADC3101 audio ADCs. Signed-off-by: Ricard Wanderlof Link: https://lore.kernel.org/r/alpine.DEB.2.21.2112151801370.27889@lap5cg0092dnk.se.axis.com Signed-off-by: Mark Brown commit e047d0372689f5d4231eefb731b60ac64720bbf0 Author: Ricard Wanderlof Date: Wed Dec 15 18:01:24 2021 +0100 ASoC: tlv320adc3xxx: New codec bindings DT bindings for Texas Instruments TLV320ADC3001 and TLV320ADC3101 audio ADCs. Signed-off-by: Ricard Wanderlof Link: https://lore.kernel.org/r/alpine.DEB.2.21.2112151759170.27889@lap5cg0092dnk.se.axis.com Signed-off-by: Mark Brown commit 11a95c583c1de215d2c338bf5cb9f929312616f8 Author: Kuninori Morimoto Date: Tue Dec 14 11:08:43 2021 +0900 ASoC: sunxi: Use dev_err_probe() helper Use the dev_err_probe() helper, instead of open-coding the same operation. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/20211214020843.2225831-23-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit efc162cbd480f1fb47d439c193ec9731bcc6c749 Author: Kuninori Morimoto Date: Tue Dec 14 11:08:42 2021 +0900 ASoC: stm: Use dev_err_probe() helper Use the dev_err_probe() helper, instead of open-coding the same operation. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/20211214020843.2225831-22-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 27c6eaebcf75e4fac145d17c7fa76bc64b60d24c Author: Kuninori Morimoto Date: Tue Dec 14 11:08:41 2021 +0900 ASoC: samsung: Use dev_err_probe() helper Use the dev_err_probe() helper, instead of open-coding the same operation. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/20211214020843.2225831-21-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit b3a66d22a2fd5435bf4d0a357e220cfca88ae5e2 Author: Kuninori Morimoto Date: Tue Dec 14 11:08:40 2021 +0900 ASoC: rockchip: Use dev_err_probe() helper Use the dev_err_probe() helper, instead of open-coding the same operation. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/20211214020843.2225831-20-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit ab6c3e68ab6e3c545b044a00814946e2998c8c53 Author: Kuninori Morimoto Date: Tue Dec 14 11:08:39 2021 +0900 ASoC: qcom: Use dev_err_probe() helper Use the dev_err_probe() helper, instead of open-coding the same operation. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/20211214020843.2225831-19-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 7a17f6a95a6136cb0a5c41be2b0ac131f9238ae8 Author: Kuninori Morimoto Date: Tue Dec 14 11:08:38 2021 +0900 ASoC: mxs: Use dev_err_probe() helper Use the dev_err_probe() helper, instead of open-coding the same operation. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/20211214020843.2225831-18-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 2ff4e003e8e105fb65c682c876a5cb0e00f854bf Author: Kuninori Morimoto Date: Tue Dec 14 11:08:37 2021 +0900 ASoC: meson: Use dev_err_probe() helper Use the dev_err_probe() helper, instead of open-coding the same operation. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/20211214020843.2225831-17-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit ef12f373f21d66e9d14eeace517c05fc2c9cf258 Author: Kuninori Morimoto Date: Tue Dec 14 11:08:36 2021 +0900 ASoC: img: Use dev_err_probe() helper Use the dev_err_probe() helper, instead of open-coding the same operation. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/20211214020843.2225831-16-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 7a0299e13bc740caebbbba24b3df85fc9ffa7759 Author: Kuninori Morimoto Date: Tue Dec 14 11:08:35 2021 +0900 ASoC: generic: Use dev_err_probe() helper Use the dev_err_probe() helper, instead of open-coding the same operation. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/20211214020843.2225831-15-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 2e6f557ca35aa330dbf31c5e1cc8119eff1526fa Author: Kuninori Morimoto Date: Tue Dec 14 11:08:34 2021 +0900 ASoC: fsl: Use dev_err_probe() helper Use the dev_err_probe() helper, instead of open-coding the same operation. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/20211214020843.2225831-14-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 88fb6da3f4313feb885f432cfc3051b33fdb2df7 Author: Kuninori Morimoto Date: Tue Dec 14 11:08:33 2021 +0900 ASoC: ti: Use dev_err_probe() helper Use the dev_err_probe() helper, instead of open-coding the same operation. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/20211214020843.2225831-13-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 0624dafa6a85be94e98822075c08006b5b528e2d Author: Kuninori Morimoto Date: Tue Dec 14 11:08:32 2021 +0900 ASoC: ateml: Use dev_err_probe() helper Use the dev_err_probe() helper, instead of open-coding the same operation. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/20211214020843.2225831-12-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 7ff27faec8cccbbf499d0b4cd8ef951f1d5f5d05 Author: Kuninori Morimoto Date: Tue Dec 14 11:08:31 2021 +0900 ASoC: codecs: tlv320aic31xx: Use dev_err_probe() helper Use the dev_err_probe() helper, instead of open-coding the same operation. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/20211214020843.2225831-11-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 382ae995597fbe214596f794ee5a38b4b64195be Author: Kuninori Morimoto Date: Tue Dec 14 11:08:30 2021 +0900 ASoC: codecs: ssm2305: Use dev_err_probe() helper Use the dev_err_probe() helper, instead of open-coding the same operation. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/20211214020843.2225831-10-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 17d7044715c5b1e0321f8e56060260e39bba54b7 Author: Kuninori Morimoto Date: Tue Dec 14 11:08:29 2021 +0900 ASoC: codecs: simple-mux: Use dev_err_probe() helper Use the dev_err_probe() helper, instead of open-coding the same operation. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/20211214020843.2225831-9-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 2c16636a8bbd85573376363420c8e9f6006d3753 Author: Kuninori Morimoto Date: Tue Dec 14 11:08:28 2021 +0900 ASoC: codecs: simple-amplifier: Use dev_err_probe() helper Use the dev_err_probe() helper, instead of open-coding the same operation. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/20211214020843.2225831-8-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit ec1e0e72a8d4180c65aee01e9563ddfb47f87709 Author: Kuninori Morimoto Date: Tue Dec 14 11:08:27 2021 +0900 ASoC: codecs: sgtl5000: Use dev_err_probe() helper Use the dev_err_probe() helper, instead of open-coding the same operation. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/20211214020843.2225831-7-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 526f6ca95a9d0c85ccb0a83ed48936394e4185e6 Author: Kuninori Morimoto Date: Tue Dec 14 11:08:26 2021 +0900 ASoC: codecs: pcm3168a: Use dev_err_probe() helper Use the dev_err_probe() helper, instead of open-coding the same operation. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/20211214020843.2225831-6-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit edfe9f451a8c6174fad43689fb5af5c096940e13 Author: Kuninori Morimoto Date: Tue Dec 14 11:08:25 2021 +0900 ASoC: codecs: max9860: Use dev_err_probe() helper Use the dev_err_probe() helper, instead of open-coding the same operation. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/20211214020843.2225831-5-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 6df96c8f5b50574c196607f036a09b5626124a24 Author: Kuninori Morimoto Date: Tue Dec 14 11:08:24 2021 +0900 ASoC: codecs: max9759: Use dev_err_probe() helper Use the dev_err_probe() helper, instead of open-coding the same operation. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/20211214020843.2225831-4-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 900b4b911aca2270ae3f966df5f31081a086c3cf Author: Kuninori Morimoto Date: Tue Dec 14 11:08:23 2021 +0900 ASoC: codecs: es7241: Use dev_err_probe() helper Use the dev_err_probe() helper, instead of open-coding the same operation. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/20211214020843.2225831-3-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 5ea4e76b73cd6f2cf29b02a57040c1a11fa8c3f0 Author: Kuninori Morimoto Date: Tue Dec 14 11:08:22 2021 +0900 ASoC: codecs: ak4118: Use dev_err_probe() helper Use the dev_err_probe() helper, instead of open-coding the same operation. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/20211214020843.2225831-2-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 30e693ee82d20361f2caacca3b68c79e1a7cb16c Author: Trevor Wu Date: Thu Dec 16 10:24:24 2021 +0800 ASoC: mediatek: mt8195: correct default value mt8195_cg_patch is used to reset the default value of audio cg, so the register value could be consistent with CCF reference count. Nevertheless, AUDIO_TOP_CON1[1:0] is used to control an internal mux, and it's expected to keep the default value 0. This patch corrects the default value in case an unexpected behavior happens in the future. Fixes: 6746cc8582599 ("ASoC: mediatek: mt8195: add platform driver") Signed-off-by: Trevor Wu Link: https://lore.kernel.org/r/20211216022424.28470-1-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit 299e6f788eab0b0aef97efb29ddc6971e7d0daf3 Author: Emil Renner Berthing Date: Mon Dec 20 13:17:59 2021 +0100 reset: starfive-jh7100: Fix 32bit compilation We need to include linux/io-64-nonatomic-lo-hi.h or readq/writeq won't be defined when compiling on 32bit architectures: On i386: ../drivers/reset/reset-starfive-jh7100.c: In function ‘jh7100_reset_update’: ../drivers/reset/reset-starfive-jh7100.c:81:10: error: implicit declaration of function ‘readq’; did you mean ‘readl’? [-Werror=implicit-function-declaration] value = readq(reg_assert); ^~~~~ ../drivers/reset/reset-starfive-jh7100.c:86:2: error: implicit declaration of function ‘writeq’; did you mean ‘writel’? [-Werror=implicit-function-declaration] writeq(value, reg_assert); ^~~~~~ On m68k: drivers/reset/reset-starfive-jh7100.c:81:17: error: implicit declaration of function 'readq'; did you mean 'readb'? [-Werror=implicit-function-declaration] drivers/reset/reset-starfive-jh7100.c:86:9: error: implicit declaration of function 'writeq'; did you mean 'writel'? [-Werror=implicit-function-declaration] cc1: all warnings being treated as errors make[3]: *** [scripts/Makefile.build:289: drivers/reset/reset-starfive-jh7100.o] Error 1 make[2]: *** [scripts/Makefile.build:572: drivers/reset] Error 2 make[1]: *** [Makefile:1969: drivers] Error 2 make: *** [Makefile:226: __sub-make] Error 2 Fixes: 0be3a1595bf8 ("reset: starfive-jh7100: Add StarFive JH7100 reset driver") Reported-by: Randy Dunlap Signed-off-by: Emil Renner Berthing Link: https://lore.kernel.org/r/20211220121800.760846-1-kernel@esmil.dk' Signed-off-by: Arnd Bergmann commit 7647204c2e81b28b4a7c4eec7d539f998d48eaf0 Author: Romain Perier Date: Fri Dec 17 20:57:25 2021 +0100 dt-bindings: timer: Add Mstar MSC313e timer devicetree bindings documentation This adds the documentation for the devicetree bindings of the Mstar MSC313e timer driver, found from MSC313e SoCs and newer. Signed-off-by: Romain Perier Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211217195727.8955-5-romain.perier@gmail.com Signed-off-by: Daniel Lezcano commit e64da64f410cf4f9697e25ab76cdfc679f4fb6db Author: Romain Perier Date: Fri Dec 17 20:57:23 2021 +0100 clocksource/drivers/msc313e: Add support for ssd20xd-based platforms On SSD20X family SoCs the timers are connected to a 432MHz clock instead of 12MHz that all the previous chips used. There is no way to reduce or divide these clocks in the clktree yet as we do not know exactly where the 432MHz clock comes from but it is enabled at boot. The SSD20X timers have an input clock divider within the timer itself to configure the frequency. timer0 is preconfigured at power up to run at 12MHz so it is backwards compatible and doesn't need special handling right now. timer1 and timer2 run at 432Mhz at power up so are not backward compatible. This commit adds support for the input clock divider register and sets timer1 and timer2 to run at 48Mhz for clockevents. Signed-off-by: Romain Perier Link: https://lore.kernel.org/r/20211217195727.8955-3-romain.perier@gmail.com Signed-off-by: Daniel Lezcano commit 5fc1f93f69989e72be7a84ded6ee867d6415f690 Author: Romain Perier Date: Fri Dec 17 20:57:22 2021 +0100 clocksource/drivers: Add MStar MSC313e timer support The MSC313e-compatible SoCs have 3 timer hardware blocks. All of these are free running 32-bit increasing counters and can generate interrupts. Based onto a maximum value register, each timer can either count from 0 to max, one time then stop (which generates interrupts) or can count from 0 to max and then roll. This commit adds basic support for these timers, the first timer block being used as clocksource/sched_clock and delay, while the others will be used as clockevents. Signed-off-by: Romain Perier Co-developed-by: Daniel Palmer Signed-off-by: Daniel Palmer Link: https://lore.kernel.org/r/20211217195727.8955-2-romain.perier@gmail.com Signed-off-by: Daniel Lezcano commit 31bd548f40cd0b754ed80a372bc2019e7c4fa31d Author: Lad Prabhakar Date: Thu Dec 16 18:21:20 2021 +0000 irqchip/renesas-intc-irqpin: Use platform_get_irq_optional() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypassed the hierarchical setup and messed up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq_optional(). Signed-off-by: Lad Prabhakar Reviewed-by: Geert Uytterhoeven Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211216182121.5323-1-prabhakar.mahadev-lad.rj@bp.renesas.com commit befbfe6f8f744acb65c4334cc224b855d31aff1b Author: Lad Prabhakar Date: Thu Dec 16 18:21:21 2021 +0000 irqchip/renesas-irqc: Use platform_get_irq_optional() to get the interrupt platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypassed the hierarchical setup and messed up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq_optional(). Signed-off-by: Lad Prabhakar Reviewed-by: Geert Uytterhoeven Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211216182121.5323-2-prabhakar.mahadev-lad.rj@bp.renesas.com commit a1539b2e2631bd825c25b2683d88ebab3a90b84c Merge: 4f34ebadff067 e0abae1953550 Author: Arnd Bergmann Date: Mon Dec 20 12:53:18 2021 +0100 Merge tag 'tegra-for-5.17-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into arm/drivers drivers: Changes for v5.17-rc1 This is an assortment of driver patches that rely on some of the changes in the for-5.17/soc branch. These have all been acked by the respective maintainers and go through the Tegra tree to more easily handle the build dependency. * tag 'tegra-for-5.17-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: media: staging: tegra-vde: Support generic power domain spi: tegra20-slink: Add OPP support mtd: rawnand: tegra: Add runtime PM and OPP support mmc: sdhci-tegra: Add runtime PM and OPP support pwm: tegra: Add runtime PM and OPP support bus: tegra-gmi: Add runtime PM and OPP support usb: chipidea: tegra: Add runtime PM and OPP support soc/tegra: Add devm_tegra_core_dev_init_opp_table_common() soc/tegra: Enable runtime PM during OPP state-syncing Link: https://lore.kernel.org/r/20211217162253.1801077-2-thierry.reding@gmail.com Signed-off-by: Arnd Bergmann commit 4f34ebadff06776974076acca3fd91f61817d8eb Merge: 5a17799462f80 1bb0b8b195d82 Author: Arnd Bergmann Date: Mon Dec 20 12:51:18 2021 +0100 Merge tag 'ti-driver-soc-fixes-for-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/ti/linux into arm/drivers SoC: Keystone driver update for v5.17 * k3-socinfo: Add entry for J721S2 SoC family * Misc fixups for tisci, pruss, knav_dma * tag 'ti-driver-soc-fixes-for-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/ti/linux: soc: ti: knav_dma: Fix NULL vs IS_ERR() checking in dma_init soc: ti: k3-socinfo: Add entry for J721S2 SoC family firmware: ti_sci: rm: remove unneeded semicolon soc: ti: pruss: fix referenced node in error message Link: https://lore.kernel.org/r/20211217154921.cagzppcensxx6wm4@pension Signed-off-by: Arnd Bergmann commit 4b430f5c968047c162cdaf236d59d2d95035d090 Merge: 5f89b389006dd 811ba27711829 Author: David S. Miller Date: Mon Dec 20 11:44:06 2021 +0000 Merge branch 'lan966x-switchdev-and-vlan' Horatiu Vultur says: ==================== net: lan966x: Add switchdev and vlan support This patch series extends lan966x with switchdev and vlan support. The first patches just adds new registers and extend the MAC table to handle the interrupts when a new address is learn/forget. v7->v8: - remove extra mac learn when the port leaves the bridge - replace memcpy with ether_addr_copy - change the order of operations in lan966x_switch_driver_init/exit - refactor lan966x_port_bridge_flags v6->v7: - fix build issues when compiling as a module v5->v6: - fix issues with the singletones, they were not really singletons - simplify the case where lan966x ports are added to bridges with foreign ports - drop the cases NETDEV_PRE_UP and NETDEV_DOWN - fix the change of MAC address - drop the callbacks .ndo_set_features, .ndo_vlan_rx_add_vid, .ndo_vlan_rx_kill_vid - remove duplicate code when port was added in a vlan, the MAC entries will be added by the fdb v4->v5: - make the notifier_block from lan966x to be singletones - use switchdev_handle_port_obj_add and switchdev_handle_fdb_event_to_device when getting callbacks in the lan966x - merge the two vlan patches in a single one v3->v4: - split the last patch in multiple patches - replace spin_lock_irqsave/restore with spin_lock/spin_unlock - remove lan966x_port_change_rx_flags because it was copying all the frames to the CPU instead of removing all RX filters. - implement SWITCHDEV_ATTR_ID_PORT_PRE_BRIDGE_FLAGS - remove calls to __dev_mc_unsync/sync as they are not needed - replace 0/1 with false/true - make sure that the lan966x ports are not added to bridges that have other interfaces except lan966x - and allow the lan966x ports to be part of only the same bridge. v2->v3: - separate the PVID used when the port is in host mode or vlan unaware - fix issue when the port was leaving the bridge v1->v2: - when allocating entries for the mac table use kzalloc instead of devm_kzalloc - also use GFP_KERNEL instead of GFP_ATOMIC, because is never called in atomic context - when deleting an mac table entry, the order of operations was wrong - if ana irq is enabled make sure it gets disabled when the driver is removed ==================== Signed-off-by: David S. Miller commit 811ba2771182900edebdc1be17fa2cec0568c643 Author: Horatiu Vultur Date: Sat Dec 18 22:49:46 2021 +0100 net: lan966x: Extend switchdev with fdb support Extend lan966x driver with fdb support by implementing the switchdev calls SWITCHDEV_FDB_ADD_TO_DEVICE and SWITCHDEV_FDB_DEL_TO_DEVICE. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit e14f72398df4aaa0063a324a3ba4b37e3c86514a Author: Horatiu Vultur Date: Sat Dec 18 22:49:45 2021 +0100 net: lan966x: Extend switchdev bridge flags Currently allow a port to be part or not of the multicast flooding mask. By implementing the switchdev calls SWITCHDEV_ATTR_ID_PORT_BRIDGE_FLAGS and SWITCHDEV_ATTR_ID_PORT_PRE_BRIDGE_FLAGS. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 6d2c186afa5d5dd416c9e854e428095a117c57b3 Author: Horatiu Vultur Date: Sat Dec 18 22:49:44 2021 +0100 net: lan966x: Add vlan support. Extend the driver to support vlan filtering by implementing the switchdev calls SWITCHDEV_OBJ_ID_PORT_VLAN, SWITCHDEV_ATTR_ID_BRIDGE_VLAN_FILTERING Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit cf2f60897e921e338f2bcca9f2acbb3fc1686131 Author: Horatiu Vultur Date: Sat Dec 18 22:49:43 2021 +0100 net: lan966x: Add support to offload the forwarding. This patch adds basic support to offload in the HW the forwarding of the frames. The driver registers to the switchdev callbacks and implements the callbacks for attributes SWITCHDEV_ATTR_ID_PORT_STP_STATE and SWITCHDEV_ATTR_ID_BRIDGE_AGEING_TIME. It is not allowed to add a lan966x port to a bridge that contains a different interface than lan966x. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 571bb516a869a67accba9cd907242596f3782605 Author: Horatiu Vultur Date: Sat Dec 18 22:49:42 2021 +0100 net: lan966x: Remove .ndo_change_rx_flags The function lan966x_port_change_rx_flags() was used only when IFF_PROMISC flag was set. In that case it was setting to copy all the frames to the CPU instead of removing any RX filters. Therefore remove it. Fixes: d28d6d2e37d10d ("net: lan966x: add port module support") Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 25ee9561ec6226d68ae4ae3464772b1cff9fb393 Author: Horatiu Vultur Date: Sat Dec 18 22:49:41 2021 +0100 net: lan966x: More MAC table functionality This patch adds support for adding/removing mac entries in the SW list of entries and in the HW table. This is used by the bridge functionality. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 5ccd66e01cbef8b10adc9787b6e3ba1889a63742 Author: Horatiu Vultur Date: Sat Dec 18 22:49:40 2021 +0100 net: lan966x: add support for interrupts from analyzer This patch adds support for handling the interrupts generated by the analyzer. Currently, only the MAC table generates these interrupts. The MAC table will generate an interrupt whenever it learns or forgets an entry in the table. It is the SW responsibility figure out which entries were added/removed. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 40304e984ab4ac4bf7303c6bf438eeff20af58ac Author: Horatiu Vultur Date: Sat Dec 18 22:49:39 2021 +0100 dt-bindings: net: lan966x: Extend with the analyzer interrupt Extend dt-bindings for lan966x with analyzer interrupt. This interrupt can be generated for example when the HW learn/forgets an entry in the MAC table. Acked-by: Rob Herring Reviewed-by: Vladimir Oltean Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit ef14049f4db9b9661f0f7cdf8c72a902a6c2deeb Author: Horatiu Vultur Date: Sat Dec 18 22:49:38 2021 +0100 net: lan966x: Add registers that are used for switch and vlan functionality This patch adds the registers that will be used to enable switchdev and vlan functionality in the HW. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 5f89b389006ddea6205ac7a96cafebd0b5e98283 Merge: 802d4d207e75d 239cdd3f4cb0f Author: David S. Miller Date: Mon Dec 20 11:32:22 2021 +0000 Merge branch 'mlxsw-devlink=health-reporter-extensions' Ido Schimmel says: ==================== mlxsw: devlink health reporter extensions This patchset extends the devlink health reporter registered by mlxsw to report new health events and their related parameters. These are meant to aid in debugging hardware and firmware issues. Patches #1-#2 are preparations. Patch #3 adds the definitions of the new events and parameters. Patch #4 extends the health reporter to report the new events and parameters. ==================== Signed-off-by: David S. Miller commit 239cdd3f4cb0fe87da95e9a64a41644ee5a744ec Author: Danielle Ratson Date: Mon Dec 20 12:56:14 2021 +0200 mlxsw: core: Extend devlink health reporter with new events and parameters Extend the devlink health reporter registered by mlxsw to report new health events and their related parameters. These are meant to aid in debugging of hardware / firmware issues. Beside the test event ('MLXSW_REG_MFDE_EVENT_ID_TEST') that is triggered following the devlink health 'test' sub-command, the new events are used to report the triggering of asserts in firmware code ('MLXSW_REG_MFDE_EVENT_ID_FW_ASSERT') and hardware issues ('MLXSW_REG_MFDE_EVENT_ID_FATAL_CAUSE'). Each event is accompanied with a severity parameter and per-event parameters that are meant to help root cause the detected issue. Signed-off-by: Danielle Ratson Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit e25c060c5f24b19d2596445c6d0cf40da6f13cc1 Author: Danielle Ratson Date: Mon Dec 20 12:56:13 2021 +0200 mlxsw: reg: Extend MFDE register with new events and parameters Extend the Monitoring Firmware Debug (MFDE) register with new events and their related parameters. These events will be utilized by devlink-health in the next patch. Signed-off-by: Danielle Ratson Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 4bcbf50291f3b61ad231d31267842fcc73d7e6fd Author: Danielle Ratson Date: Mon Dec 20 12:56:12 2021 +0200 mlxsw: core: Convert a series of if statements to switch case Convert a series of if statements that handle different events to a switch case statement. Encapsulate the per-event code in different functions to simplify the code. This is a preparation for subsequent patches that will add more events that need to be handled. Signed-off-by: Danielle Ratson Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit cbbd5fff86e8fd22152982d077ed06b1210f2779 Author: Danielle Ratson Date: Mon Dec 20 12:56:11 2021 +0200 mlxsw: Fix naming convention of MFDE fields Currently, the MFDE register field names are using the convention: reg_mfde_, and do not consider the name of the MFDE event. Fix the field names so they fit the more accurate convention: reg_mfde__. Signed-off-by: Danielle Ratson Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 802d4d207e75d7208ff75adb712b556c1e91cf1c Author: Manish Chopra Date: Fri Dec 17 08:55:52 2021 -0800 bnx2x: Invalidate fastpath HSI version for VFs Commit 0a6890b9b4df ("bnx2x: Utilize FW 7.13.15.0.") added validation for fastpath HSI versions for different client init which was not meant for SR-IOV VF clients, which resulted in firmware asserts when running VF clients with different fastpath HSI version. This patch along with the new firmware support in patch #1 fixes this behavior in order to not validate fastpath HSI version for the VFs. Fixes: 0a6890b9b4df ("bnx2x: Utilize FW 7.13.15.0.") Signed-off-by: Manish Chopra Signed-off-by: Prabhakar Kushwaha Signed-off-by: Alok Prasad Signed-off-by: Ariel Elior Signed-off-by: David S. Miller commit b7a49f73059fe6147b6b78e8f674ce0d21237432 Author: Manish Chopra Date: Fri Dec 17 08:55:51 2021 -0800 bnx2x: Utilize firmware 7.13.21.0 This new firmware addresses few important issues and enhancements as mentioned below - - Support direct invalidation of FP HSI Ver per function ID, required for invalidating FP HSI Ver prior to each VF start, as there is no VF start - BRB hardware block parity error detection support for the driver - Fix the FCOE underrun flow - Fix PSOD during FCoE BFS over the NIC ports after preboot driver - Maintains backward compatibility This patch incorporates this new firmware 7.13.21.0 in bnx2x driver. Signed-off-by: Manish Chopra Signed-off-by: Prabhakar Kushwaha Signed-off-by: Alok Prasad Signed-off-by: Ariel Elior Signed-off-by: David S. Miller commit 1acd85feba81084fcef00b73fc1601e42b77c5d8 Author: Borislav Petkov Date: Fri Dec 17 16:49:25 2021 +0100 x86/mce: Check regs before accessing it Commit in Fixes accesses pt_regs before checking whether it is NULL or not. Make sure the NULL pointer check happens first. Fixes: 0a5b288e85bb ("x86/mce: Prevent severity computation from being instrumented") Reported-by: Dan Carpenter Signed-off-by: Borislav Petkov Reviewed-by: Tony Luck Link: https://lore.kernel.org/r/20211217102029.GA29708@kili commit 077d8e1227fed7a3b797bbe9cb62f56682bafe03 Author: Martin Blumenstingl Date: Sun Dec 19 16:34:42 2021 +0100 mmc: meson-mx-sdhc: Drop unused MESON_SDHC_NUM_BUILTIN_CLKS macro Remove MESON_SDHC_NUM_BUILTIN_CLKS because it is not used anywhere in the driver. Signed-off-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20211219153442.463863-3-martin.blumenstingl@googlemail.com Signed-off-by: Ulf Hansson commit 3c5b742f5577f101bcbd7a961bfa314647292480 Merge: 5479a013c874d f89b548ca66be Author: Ulf Hansson Date: Mon Dec 20 11:18:44 2021 +0100 Merge branch 'fixes' into next commit 701fdfe348f7e5c9fe71caa3558d63dbb4bc4b81 Author: Sriram R Date: Thu Dec 2 07:08:40 2021 +0530 cfg80211: Enable regulatory enforcement checks for drivers supporting mesh iface Currently cfg80211 checks for invalid channels whenever there is a regulatory update and stops the active interfaces if it is operating on an unsupported channel in the new regulatory domain. This is done based on a regulatory flag REGULATORY_IGNORE_STALE_KICKOFF set during wiphy registration which disables this enforcement when unsupported interface modes are supported by driver. Add support to enable this enforcement when Mesh Point interface type is advertised by drivers. Signed-off-by: Sriram R Link: https://lore.kernel.org/r/1638409120-28997-1-git-send-email-quic_srirrama@quicinc.com Signed-off-by: Johannes Berg commit 5bc9a9dd75351023793d8aa4116ead005d659729 Author: Emmanuel Grumbach Date: Sun Dec 19 21:51:24 2021 +0200 rfkill: allow to get the software rfkill state iwlwifi needs to be able to differentiate between the software rfkill state and the hardware rfkill state. The reason for this is that iwlwifi needs to notify any change in the software rfkill state even when it doesn't own the device (which means even when the hardware rfkill is asserted). In order to be able to know the software rfkill when the host does not own the device, iwlwifi needs to be able to ask the state of the software rfkill ignoring the state of the hardware rfkill. Signed-off-by: Emmanuel Grumbach Link: https://lore.kernel.org/r/20211219195124.125689-1-emmanuel.grumbach@intel.com Signed-off-by: Johannes Berg commit 75cca1fac2e11039fefb4f2118a8af50949345dc Author: Johannes Berg Date: Thu Dec 2 13:09:14 2021 +0100 cfg80211: refactor cfg80211_get_ies_channel_number() Now that this is no longer part of the bigger function, we can get rid of the channel_num variable. Also change the function to use the struct element helpers, instead of open-coding the element handling. Link: https://lore.kernel.org/r/20211202130913.a0adf67a9319.I6db0340a34fff18d78e9cd512f4abf855da4e43a@changeid Signed-off-by: Johannes Berg commit d9a8297e873eda9d47aa5895ca47dc12eca0b198 Author: Johannes Berg Date: Wed Dec 1 11:09:25 2021 +0100 nl82011: clarify interface combinations wrt. channels Thinking about MLD (Draft 802.11be) now, it's clear that we'll have new limitations where different stations (or links) must be on _different_ channels (or in different frequency ranges even.) Clarify that the current limit of multiple channels is a maximum and the same one is OK. Signed-off-by: Johannes Berg Link: https://lore.kernel.org/r/20211201110924.2816d91b6862.I2d997abd525574529f88e941d90aeb640dbb1abf@changeid Signed-off-by: Johannes Berg commit 87c1aec15dee8bdb245aabbd181f9f9e1a4770ae Author: Veerendranath Jakkam Date: Fri Nov 26 12:55:19 2021 +0530 nl80211: Add support to offload SA Query procedures for AP SME device Add a flag attribute to use in ap settings to indicate userspace supports offloading of SA Query procedures to driver. Also add AP SME device feature flag to advertise that the SA Query procedures offloaded to driver when userspace indicates support for offloading of SA Query procedures. Driver handles SA Query procedures in driver's SME it self and skip sending SA Query request or response frames to userspace when userspace indicates support for SA Query procedures offload. But if userspace doesn't advertise support for SA Query procedures offload driver shall not offload SA Query procedures handling. Also userspace with SA Query procedures offload capability shall skip SA Query specific validations when driver indicates support for handling SA Query procedures. Signed-off-by: Veerendranath Jakkam Link: https://lore.kernel.org/r/1637911519-21306-2-git-send-email-vjakkam@codeaurora.org Signed-off-by: Johannes Berg commit 47301a74bbfa80cef876e646a8c5fec03c20fc8d Author: Veerendranath Jakkam Date: Fri Nov 26 12:55:18 2021 +0530 nl80211: Add support to set AP settings flags with single attribute In previous method each AP settings flag is represented by a top-level flag attribute and conversion to enum cfg80211_ap_settings_flags had to be done before sending them to driver. This commit is to make it easier to define new AP settings flags and sending them to driver. This commit also deprecate sending of %NL80211_ATTR_EXTERNAL_AUTH_SUPPORT in %NL80211_CMD_START_AP. But to maintain backwards compatibility checks for %NL80211_ATTR_EXTERNAL_AUTH_SUPPORT in %NL80211_CMD_START_AP when %NL80211_ATTR_AP_SETTINGS_FLAGS not present in %NL80211_CMD_START_AP. Signed-off-by: Veerendranath Jakkam Link: https://lore.kernel.org/r/1637911519-21306-1-git-send-email-vjakkam@codeaurora.org Signed-off-by: Johannes Berg commit 636ccdae4e17398fea4d55c7224fbac897e519df Author: Johannes Berg Date: Tue Nov 30 13:16:59 2021 +0200 mac80211: add more HT/VHT/HE state logging Add more logging in places that affect HT/VHT/HE state, so things get easier to debug. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211130131608.ac51d574458c.If197b45c5b31d2fbd254fa12c2d7c736f304d4ae@changeid Signed-off-by: Johannes Berg commit 7f599aeccbd2bcba800c6c7ecc4586fd8cafc1d8 Author: Ayala Beker Date: Thu Dec 2 14:36:10 2021 +0200 cfg80211: Use the HE operation IE to determine a 6GHz BSS channel A non-collocated AP whose primary channel is not a PSC channel may transmit a duplicated beacon on the corresponding PSC channel in which it would indicate its true primary channel. Use this inforamtion contained in the HE operation IE to determine the primary channel of the AP. In case of invalid infomration ignore it and use the channel the frame was received on. Signed-off-by: Ayala Beker Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211202143322.71eb2176e54e.I130f678e4aa390973ab39d838bbfe7b2d54bff8e@changeid Signed-off-by: Johannes Berg commit a95bfb876fa87e2d0fa718ee61a8030ddf162d2b Author: Lorenzo Bianconi Date: Mon Nov 29 14:11:24 2021 +0100 cfg80211: rename offchannel_chain structs to background_chain to avoid confusion with ETSI standard ETSI standard defines "Offchannel CAC" as: "Off-Channel CAC is performed by a number of non-continuous checks spread over a period in time. This period, which is required to determine the presence of radar signals, is defined as the Off-Channel CAC Time.. Minimum Off-Channel CAC Time 6 minutes and Maximum Off-Channel CAC Time 4 hours..". mac80211 implementation refers to a dedicated hw chain used for continuous radar monitoring. Rename offchannel_* references to background_* in order to avoid confusion with ETSI standard. Signed-off-by: Lorenzo Bianconi Link: https://lore.kernel.org/r/4204cc1d648d76b44557981713231e030a3bd991.1638190762.git.lorenzo@kernel.org Signed-off-by: Johannes Berg commit 852a07c10d62b2d041f7cbf284a2723f5bcc483f Author: Ilan Peer Date: Mon Nov 29 15:32:35 2021 +0200 mac80211: Notify cfg80211 about association comeback Signed-off-by: Ilan Peer Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211129152938.d76eac9e51ee.I986cffab95d51adfee6d84964711644392005113@changeid Signed-off-by: Johannes Berg commit a083ee8a4e03348fb90a4b24cbe957b3252c7b04 Author: Ilan Peer Date: Mon Nov 29 15:32:34 2021 +0200 cfg80211: Add support for notifying association comeback Thought the underline driver MLME can handle association temporal rejection with comeback, it is still useful to notify this to user space, as user space might want to handle the temporal rejection differently. For example, in case the comeback time is too long, user space can deauthenticate immediately and try to associate with a different AP. Signed-off-by: Ilan Peer Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211129152938.2467809e8cb3.I45574185b582666bc78eef0c29a4c36b478e5382@changeid Signed-off-by: Johannes Berg commit 6d501764288cf7869c7f54f1fcabd77bcd91b90e Author: Nathan Errera Date: Mon Nov 29 15:32:38 2021 +0200 mac80211: introduce channel switch disconnect function Introduce a disconnect function that can be used when a channel switch error occurs. The channel switch can request to block the tx, and so, we need to make sure we do not send a deauth frame in this case. Signed-off-by: Nathan Errera Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211129152938.cd2a615a0702.I9edb14785586344af17644b610ab5be109dcef00@changeid Signed-off-by: Johannes Berg commit 28f350a67d291575492057c92ceb8518ecbace95 Author: Ilan Peer Date: Mon Nov 29 15:32:41 2021 +0200 cfg80211: Fix order of enum nl80211_band_iftype_attr documentation And fix the comment. Signed-off-by: Ilan Peer Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211129152938.4ef43aff0c5d.I96dcb743bcd4f387ba4cfaa61987aeb642ad762b@changeid Signed-off-by: Johannes Berg commit 3bb1ccc4ed8fbc2d26a0cce369313e80e412b4f1 Author: Johannes Berg Date: Mon Nov 29 15:32:43 2021 +0200 cfg80211: simplify cfg80211_chandef_valid() There are a lot of duplicate checks in this function to check the delta between the control channel and CF1. With the addition of 320 MHz, this will become even more. Simplify the code so that the common checks are done only once for multiple bandwidths. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211129152938.2d0240b07f11.I759e8e990f5386ba2b56ffb2488a8d4e16e22c1b@changeid Signed-off-by: Johannes Berg commit cee04f3c3a00ffd2a2a6ed1028e0ab58a3a28d25 Author: Ilan Peer Date: Mon Nov 29 15:32:44 2021 +0200 mac80211: Remove a couple of obsolete TODO The HE capability IE is an extension IE so remove an irrelevant comments. Signed-off-by: Ilan Peer Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211129152938.550b95b5fca7.Ia31395e880172aefcc0a8c70ed060f84b94bdb83@changeid Signed-off-by: Johannes Berg commit 51b1a5729469cef57a3c97aa014aa6e1d2b8d864 Author: Sam Protsenko Date: Fri Dec 17 18:15:47 2021 +0200 dt-bindings: pinctrl: samsung: Add pin drive definitions for Exynos850 All Exynos850 GPIO blocks can use EXYNOS5420_PIN_DRV* definitions, except GPIO_HSI block. Add pin drive strength definitions for GPIO_HSI block correspondingly. Signed-off-by: Sam Protsenko Acked-by: Rob Herring Link: https://lore.kernel.org/r/20211217161549.24836-6-semen.protsenko@linaro.org Signed-off-by: Krzysztof Kozlowski commit e1ba2f940ba4c4c3b4d0a520301a920591c421f9 Author: Sam Protsenko Date: Fri Dec 17 18:15:46 2021 +0200 dt-bindings: arm: samsung: Document E850-96 board binding Add binding for the WinLink E850-96 board, which is based on Samsung Exynos850 SoC. Signed-off-by: Sam Protsenko Link: https://lore.kernel.org/r/20211217161549.24836-5-semen.protsenko@linaro.org Signed-off-by: Krzysztof Kozlowski commit 2d6a1c7d57723efcb23a345d0ea5a10d76350390 Author: Sam Protsenko Date: Fri Dec 17 18:15:45 2021 +0200 dt-bindings: Add vendor prefix for WinLink WinLink Co., Ltd is a hardware design and manufacturing company based in South Korea. Official web-site: [1]. [1] http://win-link.net/ Signed-off-by: Sam Protsenko Acked-by: Rob Herring Link: https://lore.kernel.org/r/20211217161549.24836-4-semen.protsenko@linaro.org Signed-off-by: Krzysztof Kozlowski commit 57553c3a6cfe5a30c40c334e4f3b4ece06764b36 Author: P Praneesh Date: Tue Nov 30 23:20:47 2021 +0530 mac80211: fix FEC flag in radio tap header In mac80211, while building radiotap header IEEE80211_RADIOTAP_MCS_HAVE_FEC flag is missing when LDPC enabled from driver, hence LDPC is not updated properly in radiotap header. Fix that by adding HAVE_FEC flag while building radiotap header. Signed-off-by: P Praneesh Link: https://lore.kernel.org/r/1638294648-844-2-git-send-email-quic_ppranees@quicinc.com Signed-off-by: Johannes Berg commit 6a789ba679d652587532cec2a0e0274fda172f3b Author: Felix Fietkau Date: Fri Dec 17 12:42:58 2021 +0100 mac80211: use coarse boottime for airtime fairness code The time values used by the airtime fairness code only need to be accurate enough to cover station activity detection. Using ktime_get_coarse_boottime_ns instead of ktime_get_boottime_ns will drop the accuracy down to jiffies intervals, but at the same time saves a lot of CPU cycles in a hot path Signed-off-by: Felix Fietkau Acked-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/r/20211217114258.14619-1-nbd@nbd.name Signed-off-by: Johannes Berg commit a0e45d40d5f8461aeee9374c0ffa7b1da87c203c Author: Heiko Carstens Date: Thu Dec 16 13:27:10 2021 +0100 s390/crash_dump: fix virtual vs physical address handling Signal processor STORE STATUS requires a physical address where register contents are supposed to be written to, however the kernel must read the data via the corresponding virtual address. Also the allocated save_area, where register contents are copied to, resides in virtual address space. Fix this by using proper __pa() conversion, or correct memblock_alloc() invocation. Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens commit 39d02827ed40fd421a758a36264c255d69f5d035 Author: Heiko Carstens Date: Thu Dec 16 19:28:20 2021 +0100 s390/crypto: fix compile error for ChaCha20 module The clgfi instruction used within the ChaCha20 assembly is only available for z9-109 and newer machines, and therefore this will generate a compile error if compiled e.g. with MARCH_Z900. Given that the assembler code will only be executed on machines with vector instructions, which became much later available than z9-109, use insn notation to generate the clgfi instruction, and avoid compile errors due to unknown instructions. Fixes: b087dfab4d39 ("s390/crypto: add SIMD implementation for ChaCha20") Reported-by: kernel test robot Reviewed-by: Harald Freudenberger Signed-off-by: Heiko Carstens commit 35eaa42c4a1017c08d0572008db375becb621744 Merge: 4b95391c8ef0f a7904a538933c Author: Greg Kroah-Hartman Date: Mon Dec 20 10:00:30 2021 +0100 Merge 5.16-rc6 into tty-next We need the tty/serial fixes in here as well. Signed-off-by: Greg Kroah-Hartman commit 652c0441de588dafb68516eccd4a89662830d23b Author: Xiang wangx Date: Sun Dec 19 18:06:45 2021 -0800 Input: byd - fix typo in a comment The double `the' in a comment is repeated, thus it should be removed. Signed-off-by: Xiang wangx Link: https://lore.kernel.org/r/20211216082735.11948-1-wangxiang@cdjrlc.com Signed-off-by: Dmitry Torokhov commit 236c9ad1f87088bb07ebdd136b8432f83dfd1e14 Merge: f2b42379c5768 a7904a538933c Author: Greg Kroah-Hartman Date: Mon Dec 20 09:58:10 2021 +0100 Merge 5.16-rc6 into usb-next We need the USB fixes in here as well. Signed-off-by: Greg Kroah-Hartman commit a17e3026bc4da9135ca9a42ec0b1fa67f95172e3 Author: Robin Murphy Date: Fri Dec 17 15:31:03 2021 +0000 iommu: Move flush queue data into iommu_dma_cookie Complete the move into iommu-dma by refactoring the flush queues themselves to belong to the DMA cookie rather than the IOVA domain. The refactoring may as well extend to some minor cosmetic aspects too, to help us stay one step ahead of the style police. Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/24304722005bc6f144e2a1fdd865d1465722fc2e.1639753638.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit f7f07484542fae833025da86eb4bd068f5253fe0 Author: Robin Murphy Date: Fri Dec 17 15:31:02 2021 +0000 iommu/iova: Move flush queue code to iommu-dma Flush queues are specific to DMA ops, which are now handled exclusively by iommu-dma. As such, now that the historical artefacts from being shared directly with drivers have been cleaned up, move the flush queue code into iommu-dma itself to get it out of the way of other IOVA users. This is pure code movement with no functional change; refactoring to clean up the headers and definitions will follow. Reviewed-by: John Garry Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/1d9a1ee1392e96eaae5e6467181b3e83edfdfbad.1639753638.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit ea4d71bb5e3fc5c2b7b856bc7506439298f47a23 Author: Robin Murphy Date: Fri Dec 17 15:31:01 2021 +0000 iommu/iova: Consolidate flush queue code Squash and simplify some of the freeing code, and move the init and free routines down into the rest of the flush queue code to obviate the forward declarations. Reviewed-by: John Garry Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/b0dd4565e6646b6489599d7a1eaa362c75f53c95.1639753638.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit 87f60cc65d24939353b40aa1d9297fea080cdf8d Author: Matthew Wilcox (Oracle) Date: Fri Dec 17 15:31:00 2021 +0000 iommu/vt-d: Use put_pages_list page->freelist is for the use of slab. We already have the ability to free a list of pages in the core mm, but it requires the use of a list_head and for the pages to be chained together through page->lru. Switch the Intel IOMMU and IOVA code over to using free_pages_list(). Signed-off-by: Matthew Wilcox (Oracle) [rm: split from original patch, cosmetic tweaks, fix fq entries] Signed-off-by: Robin Murphy Reviewed-by: Lu Baolu Link: https://lore.kernel.org/r/2115b560d9a0ce7cd4b948bd51a2b7bde8fdfd59.1639753638.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit ce00eece6909c266da123fd147172d745a4f14a0 Author: Matthew Wilcox (Oracle) Date: Fri Dec 17 15:30:59 2021 +0000 iommu/amd: Use put_pages_list page->freelist is for the use of slab. We already have the ability to free a list of pages in the core mm, but it requires the use of a list_head and for the pages to be chained together through page->lru. Switch the AMD IOMMU code over to using free_pages_list(). Signed-off-by: Matthew Wilcox (Oracle) [rm: split from original patch, cosmetic tweaks] Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/73af128f651aaa1f38f69e586c66765a88ad2de0.1639753638.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit 6b3106e9ba2de7320a71291cedcefdcf1195ad58 Author: Robin Murphy Date: Fri Dec 17 15:30:58 2021 +0000 iommu/amd: Simplify pagetable freeing For reasons unclear, pagetable freeing is an effectively recursive method implemented via an elaborate system of templated functions that turns out to account for 25% of the object file size. Implementing it using regular straightforward recursion makes the code simpler, and seems like a good thing to do before we work on it further. As part of that, also fix the types to avoid all the needless casting back and forth which just gets in the way. Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/d3d00c9f3fa0df4756b867072c201e6e82f9ce39.1639753638.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit 649ad9835a3783bcb6c69368fa939e0010abb2c6 Author: Robin Murphy Date: Fri Dec 17 15:30:57 2021 +0000 iommu/iova: Squash flush_cb abstraction Once again, with iommu-dma now being the only flush queue user, we no longer need the extra level of indirection through flush_cb. Squash that and let the flush queue code call the domain method directly. This does mean temporarily having to carry an additional copy of the IOMMU domain pointer around instead, but only until a later patch untangles it again. Reviewed-by: John Garry Reviewed-by: Christoph Hellwig Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/e3f9b4acdd6640012ef4fbc819ac868d727b64a9.1639753638.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit d5c383f2c98ac58c210b266cdaf7b86bc32d1ad1 Author: Robin Murphy Date: Fri Dec 17 15:30:56 2021 +0000 iommu/iova: Squash entry_dtor abstraction All flush queues are driven by iommu-dma now, so there is no need to abstract entry_dtor or its data any more. Squash the now-canonical implementation directly into the IOVA code to get it out of the way. Reviewed-by: John Garry Reviewed-by: Christoph Hellwig Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/2260f8de00ab5e0f9d2a1cf8978e6ae7cd4f182c.1639753638.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit d7061627d701c90e1cac1e1e60c45292f64f3470 Author: Xiongfeng Wang Date: Fri Dec 17 15:30:55 2021 +0000 iommu/iova: Fix race between FQ timeout and teardown It turns out to be possible for hotplugging out a device to reach the stage of tearing down the device's group and default domain before the domain's flush queue has drained naturally. At this point, it is then possible for the timeout to expire just before the del_timer() call in free_iova_flush_queue(), such that we then proceed to free the FQ resources while fq_flush_timeout() is still accessing them on another CPU. Crashes due to this have been observed in the wild while removing NVMe devices. Close the race window by using del_timer_sync() to safely wait for any active timeout handler to finish before we start to free things. We already avoid any locking in free_iova_flush_queue() since the FQ is supposed to be inactive anyway, so the potential deadlock scenario does not apply. Fixes: 9a005a800ae8 ("iommu/iova: Add flush timer") Reviewed-by: John Garry Signed-off-by: Xiongfeng Wang [ rm: rewrite commit message ] Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/0a365e5b07f14b7344677ad6a9a734966a8422ce.1639753638.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel commit 664c0b58e0252f20c66084b467525fd9fb2892eb Author: Paul Menzel Date: Fri Dec 17 14:49:16 2021 +0100 iommu/amd: Fix typo in *glues … together* in comment Signed-off-by: Paul Menzel Link: https://lore.kernel.org/r/20211217134916.43698-1-pmenzel@molgen.mpg.de Signed-off-by: Joerg Roedel commit 53b90bd9767007b87610a46b7d013123742d2802 Author: Colin Ian King Date: Sun Dec 12 21:20:31 2021 -0800 Input: ucb1400_ts - remove redundant variable penup Variable penup is assigned a value but penup is never read later, it is redundant and can be removed. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20211205000525.153999-1-colin.i.king@gmail.com Signed-off-by: Dmitry Torokhov commit 23dee6c6b183e41fa7e3d758e70216f670851a3f Author: Dario Binacchi Date: Sun Dec 12 21:15:01 2021 -0800 Input: ti_am335x_tsc - lower the X and Y sampling time The open delay time has to be applied only on the first sample of the X/Y coordinates because on the following samples the ADC channel is not changed. Removing this time from the samples after the first one, "ti,coordinate-readouts" greater than 1, decreases the total acquisition time, allowing to increase the number of acquired coordinates in the time unit. Signed-off-by: Dario Binacchi Link: https://lore.kernel.org/r/20211212125358.14416-4-dariobin@libero.it Signed-off-by: Dmitry Torokhov commit 6bfeb6c21e1bdc11c328b7d996d20f0f73c6b9b0 Author: Dario Binacchi Date: Sun Dec 12 21:14:48 2021 -0800 Input: ti_am335x_tsc - fix STEPCONFIG setup for Z2 The Z2 step configuration doesn't erase the SEL_INP_SWC_3_0 bit-field before setting the ADC channel. This way its value could be corrupted by the ADC channel selected for the Z1 coordinate. Fixes: 8c896308feae ("input: ti_am335x_adc: use only FIFO0 and clean up a little") Signed-off-by: Dario Binacchi Link: https://lore.kernel.org/r/20211212125358.14416-3-dariobin@libero.it Signed-off-by: Dmitry Torokhov commit 73cca71a903202cddc8279fc76b2da4995da5bea Author: Dario Binacchi Date: Sun Dec 12 21:14:35 2021 -0800 Input: ti_am335x_tsc - set ADCREFM for X configuration As reported by the STEPCONFIG[1-16] registered field descriptions of the TI reference manual, for the ADC "in single ended, SEL_INM_SWC_3_0 must be 1xxx". Unlike the Y and Z coordinates, this bit has not been set for the step configuration registers used to sample the X coordinate. Fixes: 1b8be32e6914 ("Input: add support for TI Touchscreen controller") Signed-off-by: Dario Binacchi Link: https://lore.kernel.org/r/20211212125358.14416-2-dariobin@libero.it Signed-off-by: Dmitry Torokhov commit facb4e40e4a2f379160ba15c355279206a3d88c5 Merge: e8f24c58d1b69 ea7e26ebe6a90 Author: Linus Walleij Date: Mon Dec 20 03:14:33 2021 +0100 Merge tag 'renesas-pinctrl-for-v5.17-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into devel pinctrl: renesas: Updates for v5.17 (take two) - Align comments in the R-Car V3U pin control driver. commit 30e120e6a9d247cec7effd55fd6783d5c619ed4c Author: Minghao Chi Date: Wed Dec 15 06:04:38 2021 +0000 ocxl: remove redundant rc variable Return value from ocxl_context_attach() directly instead of taking this in another redundant variable. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Acked-by: Andrew Donnellan Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211215060438.441918-1-chi.minghao@zte.com.cn commit 467ba14e1660b52a2f9338b484704c461bd23019 Author: Nicholas Piggin Date: Thu Dec 16 20:33:42 2021 +1000 powerpc/64s/radix: Fix huge vmap false positive pmd_huge() is defined to false when HUGETLB_PAGE is not configured, but the vmap code still installs huge PMDs. This leads to false bad PMD errors when vunmapping because it is not seen as a huge PTE, and the bad PMD check catches it. The end result may not be much more serious than some bad pmd warning messages, because the pmd_none_or_clear_bad() does what we wanted and clears the huge PTE anyway. Fix this by checking pmd_is_leaf(), which checks for a PTE regardless of config options. The whole huge/large/leaf stuff is a tangled mess but that's kernel-wide and not something we can improve much in arch/powerpc code. pmd_page(), pud_page(), etc., called by vmalloc_to_page() on huge vmaps can similarly trigger a false VM_BUG_ON when CONFIG_HUGETLB_PAGE=n, so those checks are adjusted. The checks were added by commit d6eacedd1f0e ("powerpc/book3s: Use config independent helpers for page table walk"), while implementing a similar fix for other page table walking functions. Fixes: d909f9109c30 ("powerpc/64s/radix: Enable HAVE_ARCH_HUGE_VMAP") Cc: stable@vger.kernel.org # v5.3+ Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211216103342.609192-1-npiggin@gmail.com commit a605b39e8ef703828b9e26750ea1925a6a5ef848 Author: Yang Guang Date: Sat Dec 18 09:59:17 2021 +0800 powerpc: use swap() to make code cleaner Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid opencoding it. Reported-by: Zeal Robot Signed-off-by: David Yang Signed-off-by: Yang Guang [mpe: Add include of linux/minmax.h] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/71a702c2189b16c152affd8a8cda1d84ce32741c.1639792543.git.yang.guang5@zte.com.cn commit 2fe4ca6ad7f6a0b98f97c498320051e5066e4b95 Author: Christophe JAILLET Date: Fri Dec 17 22:54:12 2021 +0100 powerpc/mpic: Use bitmap_zalloc() when applicable 'mpic->protected' is a bitmap. So use 'bitmap_zalloc()' to simplify code and improve the semantic, instead of hand writing it. Signed-off-by: Christophe JAILLET Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/aa145f674e08044c98f13f1a985faa9cc29c3708.1639777976.git.christophe.jaillet@wanadoo.fr commit 7d4203c13435c0bdae61bf16bbd0408d5b958ade Author: Vlastimil Babka Date: Thu Nov 25 18:15:37 2021 +0100 mm: add virt_to_folio() and folio_address() These two wrappers around their respective struct page variants will be useful in the following patches. Signed-off-by: Vlastimil Babka Acked-by: Johannes Weiner Reviewed-by: Roman Gushchin commit 45bd8166a1d821eb8fada3092514a7c8543f537c Author: David Virag Date: Mon Dec 6 16:31:20 2021 +0100 clk: samsung: Add initial Exynos7885 clock driver This is an initial implementation adding basic clocks, such as UART, USI, I2C, WDT, ect. and their parent clocks. It is heavily based on the Exynos850 clock driver at 'drivers/clk/samsung/clk-exynos850.c' which was made by Sam Protsenko, thus the copyright and author lines were kept. Bus clocks are enabled by default as well to avoid hangs while trying to access CMU registers. Only the parts of CMU_TOP needed for CMU_CORE and CMU_PERI, a bit of CMU_CORE, and most of CMU_PERI is implemented as of now. Signed-off-by: David Virag Signed-off-by: Sylwester Nawrocki Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20211206153124.427102-7-virag.david003@gmail.com commit c703a2f44cce4693c8d974ed1f583143261d81c1 Author: David Virag Date: Mon Dec 6 16:31:19 2021 +0100 clk: samsung: clk-pll: Add support for pll1417x pll1417x is used in Exynos7885 SoC for top-level integer PLLs. It is similar enough to pll0822x that practically the same code can handle both. The difference that's to be noted is that when defining a pl1417x PLL, the "con" parameter of the PLL macro should be set to the CON1 register instead of CON3, like this: PLL(pll_1417x, CLK_FOUT_SHARED0_PLL, "fout_shared0_pll", "oscclk", PLL_LOCKTIME_PLL_SHARED0, PLL_CON0_PLL_SHARED0, NULL), Signed-off-by: David Virag Signed-off-by: Sylwester Nawrocki Reviewed-by: Krzysztof Kozlowski Reviewed-by: Sam Protsenko Link: https://lore.kernel.org/r/20211206153124.427102-6-virag.david003@gmail.com commit cfe238e4e7ff1701b010a5ff7c64ae11d53ed8cb Author: David Virag Date: Mon Dec 6 16:31:18 2021 +0100 clk: samsung: Make exynos850_register_cmu shared Rename exynos850_register_cmu to exynos_arm64_register_cmu and move it to a new file called "clk-exynos-arm64.c". This should have no functional changes, but it will allow this code to be shared between other arm64 Exynos SoCs, like the Exynos7885 and possibly ExynosAuto V9. Signed-off-by: David Virag Signed-off-by: Sylwester Nawrocki Reviewed-by: Sam Protsenko Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20211206153124.427102-5-virag.david003@gmail.com commit 77624aa1d81f4036d83d9868053199eacf2ae2ed Author: David Virag Date: Mon Dec 6 16:31:16 2021 +0100 dt-bindings: clock: Document Exynos7885 CMU bindings Provide dt-schema documentation for Exynos7885 SoC clock controller. Description is modified from Exynos850 clock controller documentation as I couldn't describe it any better, that was written by Sam Protsenko. Signed-off-by: David Virag Signed-off-by: Sylwester Nawrocki Reviewed-by: Krzysztof Kozlowski Reviewed-by: Sam Protsenko Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211206153124.427102-3-virag.david003@gmail.com commit 591020a516720e9eba1c4b1748cb73b6748e445f Author: David Virag Date: Mon Dec 6 16:31:15 2021 +0100 dt-bindings: clock: Add bindings definitions for Exynos7885 CMU Just like on Exynos850, the clock controller driver is designed to have separate instances for each particular CMU, so clock IDs start from 1 for each CMU in this bindings header too. Signed-off-by: David Virag Signed-off-by: Sylwester Nawrocki Reviewed-by: Krzysztof Kozlowski Reviewed-by: Sam Protsenko Acked-by: Rob Herring Link: https://lore.kernel.org/r/20211206153124.427102-2-virag.david003@gmail.com commit bc471d1fe210a917266ddcebc7bfafb7ac238edc Author: Sam Protsenko Date: Fri Dec 17 18:15:44 2021 +0200 clk: samsung: exynos850: Add missing sysreg clocks System Register is used to configure system behavior, like USI protocol, etc. SYSREG clocks should be provided to corresponding syscon nodes, to make it possible to modify SYSREG registers. While at it, add also missing PMU and GPIO clocks, which looks necessary and might be needed for corresponding Exynos850 features soon. Signed-off-by: Sam Protsenko Signed-off-by: Sylwester Nawrocki Reviewed-by: Krzysztof Kozlowski Acked-by: Chanwoo Choi Link: https://lore.kernel.org/r/20211217161549.24836-3-semen.protsenko@linaro.org commit a949f2cf1ab9b3afd894427a64fce24fd8bae0a6 Author: Sam Protsenko Date: Fri Dec 17 18:15:43 2021 +0200 dt-bindings: clock: Add bindings for Exynos850 sysreg clocks System Register is used to configure system behavior, like USI protocol, etc. SYSREG clocks should be provided to corresponding syscon nodes, to make it possible to modify SYSREG registers. While at it, add also missing PMU and GPIO clocks, which looks necessary and might be needed for corresponding Exynos850 features soon. Signed-off-by: Sam Protsenko Signed-off-by: Sylwester Nawrocki Reviewed-by: Krzysztof Kozlowski Acked-by: Rob Herring Acked-by: Chanwoo Choi Link: https://lore.kernel.org/r/20211217161549.24836-2-semen.protsenko@linaro.org commit 5e33f1c4a7cb914a003a304ab8eef705b17aabb7 Author: Arınç ÜNAL Date: Fri Dec 17 00:03:19 2021 +0800 ARM: dts: BCM5301X: correct RX delay and enable flow control on Asus RT-AC88U The current 'rx-internal-delay-ps' property value on the Realtek switch node, 2000, will be divided by 300, resulting in 6.66, which will be rounded to the closest step value, 7. Change it to 2100 to be accurate. See ef136837aaf6 ("net: dsa: rtl8365mb: set RGMII RX delay in steps of 0.3 ns") for reference. Flow control needs to be enabled on both sides of the internal and external switch. It is already enabled on the CPU port of the Realtek switch so we also enable it on the external switch port of the Broadcom switch as well. Signed-off-by: Arınç ÜNAL Signed-off-by: Florian Fainelli commit e138d78ffee6451400c1c91f02b8dcaf8b1af07f Merge: 9a68c53f875e8 eafba51c545a1 Author: Florian Fainelli Date: Sun Dec 19 10:49:46 2021 -0800 Merge tag 'tags/bcm2835-bindings-2021-12-18' into devicetree/next Stefan Wahren converts VCHIQ's bindings to YAML format. Signed-off-by: Florian Fainelli commit 9a68c53f875e88edd3403c001ad85f4ac0ed3486 Author: Florian Fainelli Date: Tue Dec 7 10:19:09 2021 -0800 ARM: dts: NSP: Rename SATA unit name Rename the SATA controller unit name from ahci to sata in preparation for adding the Broadcom SATA3 controller YAML binding which will bring validation. Signed-off-by: Florian Fainelli commit 69c4e53bdd055ecc27761f6971a50c631ff9072e Author: Florian Fainelli Date: Thu Dec 2 15:16:27 2021 -0800 ARM: dts: NSP: Fixed iProc PCIe MSI sub-node Rename the msi controller unit name to 'msi' to avoid collisions with the 'msi-controller' boolean property. Signed-off-by: Florian Fainelli commit d2b820bb16c509b313b87f616dcf6aa612d01fb9 Author: Florian Fainelli Date: Thu Dec 2 15:15:27 2021 -0800 ARM: dts: HR2: Fixed iProc PCIe MSI sub-node Rename the msi controller unit name to 'msi' to avoid collisions with the 'msi-controller' boolean property. Signed-off-by: Florian Fainelli commit 89b9492c113c4a22361f32639c6af041bcada2b6 Author: Florian Fainelli Date: Tue Dec 7 16:06:22 2021 -0800 ARM: dts: Cygnus: Update PCIe PHY node unit name(s) Update the PCIe PHY node unit name and its sub-nodes to help with upcoming changes converting the Cygnus PCIe PHY DT binding to YAML and later the iProc PCIe controller binding to YAML. Signed-off-by: Florian Fainelli commit 13391025039fe86c68741e45a8b7bc158c69d68e Author: Florian Fainelli Date: Thu Dec 2 15:14:13 2021 -0800 ARM: dts: Cygnus: Fixed iProc PCIe controller properties Rename the msi controller unit name to 'msi' to avoid collisions with the 'msi-controller' boolean property. We also need to re-arrange the 'ranges' property to show the two cells as being separate instead of combined since the DT checker is not able to differentiate otherwise. Signed-off-by: Florian Fainelli commit 5a213b9220e0bf4c924412d83d7c9a90acb553e8 Merge: d8f6ef45a623d 63fa47ba886b8 Author: Paolo Bonzini Date: Sun Dec 19 15:27:21 2021 +0100 Merge branch 'topic/ppc-kvm' of https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux into HEAD Fix conflicts between memslot overhaul and commit 511d25d6b789f ("KVM: PPC: Book3S: Suppress warnings when allocating too big memory slots") from the powerpc tree. commit b1460bb4eadf4b0bf5afe79fb4d25b9d985f2879 Author: Deren Wu Date: Fri Dec 17 01:02:09 2021 +0800 mt76: mt7921s: fix cmd timeout in throughput test During heavy loading throughtput test, the RX buffer (128) would be exhausted and some RX pkts dropped randomly. Increase buffer size from 128 to 512 (a safer length) to avoid tput degrade or cmd-timeout problem. Signed-off-by: Deren Wu Signed-off-by: Felix Fietkau commit 1bb42a354d8ca2888c7c2fcbf0add410176a33dc Author: Sean Wang Date: Thu Dec 16 05:25:37 2021 +0800 mt76: mt7921s: fix suspend error with enlarging mcu timeout value Fix the false positive suspend error that may occur on mt7921s with enlarging mcu timeout value. The reason why we have to enlarge mcu timeout from HZ / 3 to HZ is we should consider the additional overhead caused by running concurrently with btmtksdio (a MT7921 bluetooth SDIO driver) that would compete for the same SDIO bus in process context to complete the suspend procedure. Fixes: 48fab5bbef40 ("mt76: mt7921: introduce mt7921s support") Signed-off-by: Sean Wang Signed-off-by: Felix Fietkau commit 3fb47c883806e97499365506c6c57f3b4907bf1e Author: Sean Wang Date: Thu Dec 16 05:25:36 2021 +0800 mt76: mt7921s: make pm->suspended usage consistent Update pm->suspended usage to be consistent with mt7921e driver. Signed-off-by: Sean Wang Signed-off-by: Felix Fietkau commit 5375001bb4ce22801bf3bb566cc3e67d2d3a5dc0 Author: Sean Wang Date: Thu Dec 16 05:25:35 2021 +0800 mt76: mt7921: fix possible resume failure Fix the possible resume failure due to mt76_connac_mcu_set_hif_suspend timeout. That is because clearing the flag pm->suspended too early opened up a race window, where mt7921_poll_tx/rx scheduled a ps_work to put the device in doze mode, that is unexpected for the device is being resumed from the suspend state and would make the remaining MCU comamnds in resume handler failed to execute. Fixes: ffa1bf97425b ("mt76: mt7921: introduce PM support") Co-developed-by: YN Chen Signed-off-by: YN Chen Signed-off-by: Sean Wang Signed-off-by: Felix Fietkau commit f2cd4abca01b85312f493c13b9d2a7375c6c760d Author: Sean Wang Date: Thu Dec 16 05:25:34 2021 +0800 mt76: mt7921: clear pm->suspended in mt7921_mac_reset_work clear pm->suspended in mt7921_mac_reset_work to allow pm runtime can be enabled after wifi reset in any circumstance. Signed-off-by: Sean Wang Signed-off-by: Felix Fietkau commit 25702d9c55dc5fda2ad9ad8de115e50dc7394ef9 Author: Lorenzo Bianconi Date: Wed Dec 15 20:08:02 2021 +0100 mt76: connac: rely on le16_add_cpu in mt76_connac_mcu_add_nested_tlv Rely on le16_add_cpu() in mt76_connac_mcu_add_nested_tlv routine. Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 3c312f4395f850ef711e31572d2a6ae2abccfc6f Author: Lorenzo Bianconi Date: Wed Dec 15 14:52:47 2021 +0100 mt76: mt7921: remove dead definitions to_wcid_lo and to_wcid_hi are no longer used in mt7921/mcu.c Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 1966a5078f2d2dcebb40beff632755ab155abfc9 Author: MeiChia Chiu Date: Wed Dec 15 16:45:30 2021 +0800 mt76: mt7915: add mu-mimo and ofdma debugfs knobs Add mu-mimo and ofdma packet counters statistics. The statistics are clear on read. Reviewed-by: Money Wang Reviewed-by: Ryder Lee Signed-off-by: MeiChia Chiu Signed-off-by: Felix Fietkau commit 6cf4392f248903baf5a32902de0c97180b9ea257 Author: Lorenzo Bianconi Date: Tue Dec 14 11:41:06 2021 +0100 mt76: mt7915: introduce mt76_vif in mt7915_vif Align mt7915_vif layout to mt7921_vif and mt7615_vif Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 81a88b1e75bdb62035d3d5ab4c90086bafe0374b Author: Tzung-Bi Shih Date: Fri Dec 10 17:17:46 2021 +0800 mt76: mt7921: reduce log severity levels for informative messages "ASIC revision" and "Firmware init done" shouldn't be error messages. Reduces the severity levels. Signed-off-by: Tzung-Bi Shih Signed-off-by: Felix Fietkau commit 5562d5f6c71b0a4c93a7280b7de8710c2eb6b35d Author: Lorenzo Bianconi Date: Thu Dec 9 14:06:29 2021 +0100 mt76: mt7915: rely on mt76_connac definitions Remove duplicated mcu definitions in mt7915 mcu.h and reused connac ones. Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit ffc2198d7b81c282386430e32f27df08c08b52cb Author: Lorenzo Bianconi Date: Thu Dec 9 14:06:28 2021 +0100 mt76: connac: rely on MCU_CMD macro Similar to mt7915 driver, rely on MCU_CMD macro and do not command definitions directly Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 680a2ead741ad9b479a53adf154ed5eee74d2b9a Author: Lorenzo Bianconi Date: Thu Dec 9 14:06:27 2021 +0100 mt76: connac: introduce MCU_CE_CMD macro Similar to MCU_EXT_CMD, introduce MCU_CE_CMD for CE commands Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 5472240245793c13e9986c61dd34c697296deed4 Author: Lorenzo Bianconi Date: Thu Dec 9 14:06:26 2021 +0100 mt76: connac: introduce MCU_UNI_CMD macro Similar to MCU_EXT_CMD, introduce MCU_UNI_CMD for unified commands Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 7159eb828d21ad8fb3c1c1782a286a658ba6bf66 Author: Lorenzo Bianconi Date: Thu Dec 9 14:06:25 2021 +0100 mt76: connac: remove MCU_FW_PREFIX bit Get rid of MCU_FW_PREFIX bit since it is no longer used Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 9d8d136cf0b6d5578442f38ea9eefdf67cc84fc4 Author: Lorenzo Bianconi Date: Thu Dec 9 14:06:24 2021 +0100 mt76: connac: align MCU_EXT definitions with 7915 driver Align MCU_EXT and MCU_FW definitions between mt76_connac and mt7915 driver. This is a preliminary patch to reuse mt76_connac in mt7915 driver. Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit e6d2070d9d64aad04c12424865cfd9684ba64bea Author: Lorenzo Bianconi Date: Thu Dec 9 14:06:23 2021 +0100 mt76: connac: introduce MCU_EXT macros Introduce MCU_EXT_CMD and MCU_EXT_QUERY macros in mt76_connac module. This is a preliminary patch to reuse mt76_connac module in mt7915 driver. Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit e0bf699ad8e52330d848144a9624a067ad588bd6 Author: Deren Wu Date: Wed Dec 8 22:59:55 2021 +0800 mt76: mt7921: fix network buffer leak by txs missing TXS in mt7921 may be forwared to tx_done event. Should try to catch TXS information in tx_done event as well. Signed-off-by: Deren Wu Signed-off-by: Felix Fietkau commit b7263a2982bc8b6f2ba58eb2e066eb55ff598193 Author: Felix Fietkau Date: Fri Dec 3 20:09:04 2021 +0100 mt76: mt7615: in debugfs queue stats, skip wmm index 3 on mt7663 The hardware only supports WMM index 0-2 and registers for index 3 return bogus data. Signed-off-by: Felix Fietkau commit e4232f05207daa2ccc45a32ee70a64ff7df62a71 Author: Felix Fietkau Date: Fri Dec 3 18:02:41 2021 +0100 mt76: mt7915: process txfree and txstatus without allocating skbs Reduces pressure on the memory allocator Signed-off-by: Felix Fietkau commit fbe50d9aff0c7dfb0665dd18f606b9ddbbb3ace7 Author: Felix Fietkau Date: Fri Dec 3 18:01:52 2021 +0100 mt76: allow drivers to drop rx packets early This can be used to free received events without allocating an extra skb Signed-off-by: Felix Fietkau commit 5360522a2ce29d7dc20badfac718a473bfaaaffe Author: Lorenzo Bianconi Date: Fri Dec 3 11:12:54 2021 +0100 mt76: mt7663: disable 4addr capability 4addr is not supported by the offload firmware yet Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 2dc24ee64147c21e8ba9bcb28afdb6ad80af0d27 Author: Felix Fietkau Date: Fri Dec 3 10:37:24 2021 +0100 mt76: mt7615: clear mcu error interrupt status on mt7663 Should fix issues with error recovery Signed-off-by: Felix Fietkau commit 087baf9b6d373f9c9b7c45eccfe04231af60f022 Author: Ryder Lee Date: Fri Dec 3 14:04:54 2021 +0800 mt76: only access ieee80211_hdr after mt76_insert_ccmp_hdr Get rid of unsafe access since mt76_insert_ccmp_hdr moves the header. Signed-off-by: Ryder Lee Signed-off-by: Felix Fietkau commit d43de9cffbc1e1d10a9336ca4d47773ced096eda Author: Lorenzo Bianconi Date: Wed Dec 1 18:14:31 2021 +0100 mt76: move sar_capa configuration in common code Move wiphy SAR capability configuration in mt76 module and remove duplicated code. Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 73c7c0443685d8d152c3451e7305a2c2bc47b32e Author: Lorenzo Bianconi Date: Tue Nov 30 10:36:15 2021 +0100 mt76: connac: fix last_chan configuration in mt76_connac_mcu_rate_txpower_band last_ch configuration must not be dependent on the current configured band but it is defined by hw capabilities since the fw always expects the following order: - 2GHz - 5GHz - 6GHz Fixes: 9b2ea8eee42a1 ("mt76: connac: set 6G phymode in single-sku support") Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 2b7f3574ca9a7ff4a6b4ec1ae4dfdfde481ac80b Author: Sean Wang Date: Tue Nov 30 07:05:28 2021 +0800 mt76: mt7921s: fix possible kernel crash due to invalid Rx count Return the proper error code when out-of-range the Rx aggregation count are reported from the hardware that would create the unreasonable extreme large Rx buffer. [ 100.873810] show_stack+0x20/0x2c [ 100.873823] dump_stack+0xc4/0x140 [ 100.873839] bad_page+0x110/0x114 [ 100.873854] check_new_pages+0xf8/0xfc [ 100.873869] rmqueue+0x5a0/0x640 [ 100.873884] get_page_from_freelist+0x124/0x20c [ 100.873898] __alloc_pages_nodemask+0x114/0x2a4 [ 100.873918] mt76s_rx_run_queue+0xd4/0x2e4 [mt76_sdio 8280a88a0c8c9cf203f16e194f99ac293bdbb2f5] [ 100.873938] mt76s_rx_handler+0xd4/0x2a0 [mt76_sdio 8280a88a0c8c9cf203f16e194f99ac293bdbb2f5] [ 100.873957] mt76s_txrx_worker+0xac/0x17c [mt76_sdio 8280a88a0c8c9cf203f16e194f99ac293bdbb2f5] [ 100.873977] mt7921s_txrx_worker+0x5c/0xd8 [mt7921s d0bdbc018082dbc8dc1407614be3c2e7bd64423b] [ 100.874003] __mt76_worker_fn+0xe8/0x170 [mt76 b80af3483a8f9d48e916c12d8dbfaa0d3cd15337] [ 100.874018] kthread+0x148/0x3ac [ 100.874032] ret_from_fork+0x10/0x30 [ 100.874067] Kernel Offset: 0x1fe2000000 from 0xffffffc010000000 [ 100.874079] PHYS_OFFSET: 0xffffffe800000000 [ 100.874090] CPU features: 0x0240002,2188200c Fixes: 48fab5bbef40 ("mt76: mt7921: introduce mt7921s support") Signed-off-by: Sean Wang Signed-off-by: Felix Fietkau commit 78b217580c50994ae22dde4ecaaf147de0f355f6 Author: Deren Wu Date: Sun Nov 28 15:43:59 2021 +0800 mt76: mt7921s: fix bus hang with wrong privilege Accroding to chip hw flow, mt7921s need to re-acquire privilege again before normal running. Otherwise, the bus may be stuck in an abnormal status. Tested-by: Leon Yen Co-developed-by: Eric-SY Chang Signed-off-by: Eric-SY Chang Co-developed-by: YN Chen Signed-off-by: YN Chen Signed-off-by: Deren Wu Signed-off-by: Felix Fietkau commit 00ff52346d74c38787ff8b4acde8c5671d9b7fe2 Author: Shayne Chen Date: Sat Nov 27 00:53:16 2021 +0800 mt76: mt7921: use correct iftype data on 6GHz cap init Set 6GHz cap to iftype data which is matched to the type of current interface. Fixes: 50ac15a511e3 ("mt76: mt7921: add 6GHz support") Signed-off-by: Shayne Chen Acked-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 9b5271f3c35957dc27d913eb526c186610ec410d Author: Changcheng Deng Date: Fri Nov 26 08:02:01 2021 +0000 mt76: mt7921: fix boolreturn.cocci warning ./drivers/net/wireless/mediatek/mt76/mt7921/sdio_mac.c: 223: 8-9: WARNING: return of 0/1 in function 'mt7921s_tx_status_data' with return type bool Return statements in functions returning bool should use true/false instead of 1/0. Reported-by: Zeal Robot Signed-off-by: Changcheng Deng Signed-off-by: Felix Fietkau commit 5b595b66394096258d0ad555a41e52ea387aeb9e Author: Daniel Golle Date: Thu Nov 25 19:45:03 2021 +0000 mt76: eeprom: tolerate corrected bit-flips mtd_read() returns -EUCLEAN in case of corrected bit-flips. As data was read, don't error out in this case. Signed-off-by: Daniel Golle Acked-by: Hauke Mehrtens Signed-off-by: Felix Fietkau commit 15965d8c9c0d4a18f940f8dbe2661209f8504525 Author: Felix Fietkau Date: Thu Nov 25 20:07:42 2021 +0100 mt76: mt7603: improve reliability of tx powersave filtering Leave more time to abort transmissions (which could happen at low CCK rates) Only warn if the last filter command is stuck Signed-off-by: Felix Fietkau commit 608f7c47dfad80444f6d7bd3234314b273c7286b Author: Felix Fietkau Date: Thu Nov 25 13:42:32 2021 +0100 mt76: clear sta powersave flag after notifying driver If the driver has configured the hardware to drop packets for a sta that was in powersave mode, then clearing the flag too early opens up a small race window during which packets could be dropped on wakeup Signed-off-by: Felix Fietkau commit 2c70627b09aced3593d8b9419b908f5e1a13318a Author: Lorenzo Bianconi Date: Tue Nov 23 17:24:31 2021 +0100 mt76: mt7915: introduce SAR support Add SAR spec support to mt7915 driver to allow configuring SAR power limitations on the frequency ranges from the userland. Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 4bbd6d83afc773f39a4bb49140ac9bbb8934f0c9 Author: Lorenzo Bianconi Date: Tue Nov 23 20:09:51 2021 +0100 mt76: mt7603: introduce SAR support Add SAR spec support to mt7603 driver to allow configuring SAR power limitations on the frequency ranges from the userland. Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 92610d6df8a69cbd7df7d07c72567eaf33f57e5e Author: Felix Fietkau Date: Thu Nov 25 10:47:14 2021 +0100 mt76: mt7915: improve wmm index allocation Typically all AP interfaces on a PHY will share the same WMM settings, while sta/mesh interfaces will usually inherit the settings from a remote device. In order minimize the likelihood of conflicting WMM settings, make all AP interfaces share one slot, and all non-AP interfaces another one. Signed-off-by: Felix Fietkau commit 70fb028707c8871ef9e56b3ffa3d895e14956cc4 Author: Felix Fietkau Date: Thu Nov 25 10:42:12 2021 +0100 mt76: mt7615: improve wmm index allocation Typically all AP interfaces on a PHY will share the same WMM settings, while sta/mesh interfaces will usually inherit the settings from a remote device. In order minimize the likelihood of conflicting WMM settings, make all AP interfaces share one slot, and all non-AP interfaces another one. This also fixes running multiple AP interfaces on MT7613, which only has 3 WMM slots. Signed-off-by: Felix Fietkau commit 792e1d21aadecaf4100cdff5bbcd43d14f3bcf01 Author: Shayne Chen Date: Tue Nov 23 13:53:00 2021 +0800 mt76: mt7615: fix unused tx antenna mask in testmode The mask variable is assigned but not used after testmode disabled: if (!en) mask = phy->mt76->chainmask; Signed-off-by: Shayne Chen Signed-off-by: Felix Fietkau commit 5ad4faca7690a88b4529238c757b6b8ead8056ec Author: Sean Wang Date: Sat Nov 20 07:22:11 2021 +0800 mt76: mt7921s: fix the device cannot sleep deeply in suspend According to the MT7921S firmware, the cmd MCU_UNI_CMD_HIF_CTRL have to be last MCU command to execute in suspend handler and all data traffic have to be stopped before the cmd MCU_UNI_CMD_HIF_CTRL starts as well in order that mt7921 can successfully fall into the deep sleep mode. Where we reuse the flag MT76_STATE_SUSPEND and avoid creating another global flag to stop all of the traffic onto the SDIO bus. Fixes: 48fab5bbef40 ("mt76: mt7921: introduce mt7921s support") Reported-by: Leon Yen Signed-off-by: Sean Wang Signed-off-by: Felix Fietkau commit 6906aa93eb93d54a42ce1902f00d6ea04ecb039b Author: Sean Wang Date: Sat Nov 20 07:22:10 2021 +0800 mt76: mt7921: move mt76_connac_mcu_set_hif_suspend to bus-related files This is a preliminary patch for the following patch ("mt76: mt7921s: fix the device cannot sleep deeply in suspend). mt76_connac_mcu_set_hif_suspend eventually would be handled in each bus-level suspend/resume handler in either mt7921/sdio.c or mt7921/pci.c depending on what type of the bus the device is running on. We can move mt76_connac_mcu_set_hif_suspend to bus-related files to simplify the logic. Signed-off-by: Sean Wang Signed-off-by: Felix Fietkau commit 838fcae7f51ced6d011f7f0e4d705f8072426a16 Author: Felix Fietkau Date: Tue Nov 23 11:49:04 2021 +0100 mt76: mt7615: fix decap offload corner case with 4-addr VLAN frames With 4-address mode VLAN frames, an internal header translation step fails, leaving behind an extra 2-byte length field that must be reomved by the driver. Add a check for this condition to fix receiving such packets Signed-off-by: Felix Fietkau commit 1eeff0b4c1a6c64d24fc562c2ebb019d35fc93fc Author: Felix Fietkau Date: Tue Nov 23 11:37:47 2021 +0100 mt76: mt7915: fix decap offload corner case with 4-addr VLAN frames With 4-address mode VLAN frames, an internal header translation step fails, leaving behind an extra 2-byte length field that must be reomved by the driver. Add a check for this condition to fix receiving such packets Signed-off-by: Felix Fietkau commit 633f77b517ac704086c267b70a6dfe1924cfed0b Author: Lorenzo Bianconi Date: Sun Nov 21 13:12:25 2021 +0100 mt76: mt76x02: introduce SAR support Add SAR spec support to mt76x02 driver to allow configuring SAR power limitations on the frequency ranges from the userland. Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit b3cb885e56d5f64880109da9516ef2df1e9db7b9 Author: Lorenzo Bianconi Date: Sun Nov 21 13:12:24 2021 +0100 mt76: move sar utilities to mt76-core module Move mt76_get_sar_power and mt76_init_sar_power in the common code. This is a preliminary patch to add sar support to mt76x02 drivers. Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 5d461321c93013edf839a7a3fea2845cc3073ca8 Author: Lorenzo Bianconi Date: Sat Nov 20 19:57:17 2021 +0100 mt76: mt7921: honor mt76_connac_mcu_set_rate_txpower return value in mt7921_config Check return code from mt76_connac_mcu_set_rate_txpower() in mt7921_config routine. Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 0a57d636012edd147e553d22bfcd3f589b03e676 Author: Bo Jiao Date: Fri Nov 19 16:53:23 2021 +0800 mt76: fix the wiphy's available antennas to the correct value the wiphy's available antennas may be incorrect When ext phy's antenna_mask is different from main phy Signed-off-by: Bo Jiao Signed-off-by: Felix Fietkau commit dd28dea52ad9376d2b243a8981726646e1f60b1a Author: Xing Song Date: Fri Nov 19 14:37:06 2021 +0800 mt76: do not pass the received frame with decryption error MAC80211 doesn't care any decryption error in 802.3 path, so received frame will be dropped if HW tell us that the cipher configuration is not matched as well as the header has been translated to 802.3. This case only appears when IEEE80211_FCTL_PROTECTED is 0 and cipher suit is not none in the corresponding HW entry. The received frame is only reported to monitor interface if HW decryption block tell us there is ICV error or CCMP/BIP/WPI MIC error. Note in this case the reported frame is decrypted 802.11 frame and the payload may be malformed due to mismatched key. Signed-off-by: Xing Song Signed-off-by: Felix Fietkau commit dfdf6725d5e0e1465507ea57dbd64119cf8e19a9 Author: Lorenzo Bianconi Date: Thu Nov 18 16:21:43 2021 +0100 mt76: connac: remove PHY_MODE_AX_6G configuration in mt76_connac_get_phy_mode Get rid of PHY_MODE_AX_6G configuration in mt76_connac_get_phy_mode routine since mode is an u8 and PHY_MODE_AX_6G is set in phymode_ext field in mt76_connac_bss_basic_tlv. Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit e4fce22b5beba9cffbfedb04dc2ad217bf02c854 Author: Lorenzo Bianconi Date: Thu Nov 18 14:07:59 2021 +0100 mt76: mt7615: remove dead code in get_omac_idx Remove always false if condition in get_omac_idx for sta type Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit c9dbeac4988f6d4c4211b3747ec9c9c75ea87967 Author: Lorenzo Bianconi Date: Thu Nov 18 13:49:41 2021 +0100 mt76: connac: fix a theoretical NULL pointer dereference in mt76_connac_get_phy_mode Even if it is not a real bug since mt76_connac_get_phy_mode runs just for mt7921 where only STA is supported, fix a theoretical NULL pointer dereference if new added modes do not support HE Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit ec2ebc1c5a5ce49538fa78108c53eaf722eee908 Author: Lorenzo Bianconi Date: Thu Nov 18 11:50:27 2021 +0100 mt76: mt7921: fix possible NULL pointer dereference in mt7921_mac_write_txwi Fix a possible NULL pointer deference issue in mt7921_mac_write_txwi routine if vif is NULL. Fixes: 33920b2bf0483 ("mt76: add support for setting mcast rate") Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit d4f3d1c4d3c2bcce76a96a6562170664b25112f0 Author: Lorenzo Bianconi Date: Thu Nov 18 11:42:06 2021 +0100 mt76: fix possible OOB issue in mt76_calculate_default_rate Cap max offset value to ARRAY_SIZE(mt76_rates) - 1 in mt76_calculate_default_rate routine in order to avoid possible Out Of Bound accesses. Fixes: 33920b2bf0483 ("mt76: add support for setting mcast rate") Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 7f96905068ab826b270b41d70d46e2849e5db7df Author: Deren Wu Date: Tue Nov 16 22:31:18 2021 +0800 mt76: mt7921: introduce 160 MHz channel bandwidth support Introduce the basic configuration for BW160 capability in 7922 Signed-off-by: Deren Wu Signed-off-by: Felix Fietkau commit eae7df016c30468e09481a75b1339f0ab5ece222 Author: Lorenzo Bianconi Date: Mon Nov 8 11:03:52 2021 +0100 mt76: debugfs: fix queue reporting for mt76-usb Fix number of rx-queued frames reported by mt76_usb driver. Reported-by: kernel test robot Fixes: 2d8be76c1674 ("mt76: debugfs: improve queue node readability") Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit 434ed21389948a45c238f63258bd5aae4237e20b Merge: f85b244ee395c eb473bac4a4b2 Author: David S. Miller Date: Sun Dec 19 14:08:48 2021 +0000 Merge branch 'tc-action-offload' Simon Horman says: ==================== allow user to offload tc action to net device Baowen Zheng says: Allow use of flow_indr_dev_register/flow_indr_dev_setup_offload to offload tc actions independent of flows. The motivation for this work is to prepare for using TC police action instances to provide hardware offload of OVS metering feature - which calls for policers that may be used by multiple flows and whose lifecycle is independent of any flows that use them. This patch includes basic changes to offload drivers to return EOPNOTSUPP if this feature is used - it is not yet supported by any driver. Tc cli command to offload and quote an action: # tc qdisc del dev $DEV ingress && sleep 1 || true # tc actions delete action police index 200 || true # tc qdisc add dev $DEV ingress # tc qdisc show dev $DEV ingress # tc actions add action police rate 100mbit burst 10000k index 200 skip_sw # tc -s -d actions list action police total acts 1 action order 0: police 0xc8 rate 100Mbit burst 10000Kb mtu 2Kb action reclassify overhead 0b linklayer ethernet ref 1 bind 0 installed 142 sec used 0 sec Action statistics: Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 skip_sw in_hw in_hw_count 1 used_hw_stats delayed # tc filter add dev $DEV protocol ip parent ffff: \ flower skip_sw ip_proto tcp action police index 200 # tc -s -d filter show dev $DEV protocol ip parent ffff: filter pref 49152 flower chain 0 filter pref 49152 flower chain 0 handle 0x1 eth_type ipv4 ip_proto tcp skip_sw in_hw in_hw_count 1 action order 1: police 0xc8 rate 100Mbit burst 10000Kb mtu 2Kb action reclassify overhead 0b linklayer ethernet ref 2 bind 1 installed 300 sec used 0 sec Action statistics: Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 skip_sw in_hw in_hw_count 1 used_hw_stats delayed # tc filter add dev $DEV protocol ipv6 parent ffff: \ flower skip_sw ip_proto tcp action police index 200 # tc -s -d filter show dev $DEV protocol ipv6 parent ffff: filter pref 49151 flower chain 0 filter pref 49151 flower chain 0 handle 0x1 eth_type ipv6 ip_proto tcp skip_sw in_hw in_hw_count 1 action order 1: police 0xc8 rate 100Mbit burst 10000Kb mtu 2Kb action reclassify overhead 0b linklayer ethernet ref 3 bind 2 installed 761 sec used 0 sec Action statistics: Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 skip_sw in_hw in_hw_count 1 used_hw_stats delayed # tc -s -d actions list action police total acts 1 action order 0: police 0xc8 rate 100Mbit burst 10000Kb mtu 2Kb action reclassify overhead 0b linklayer ethernet ref 3 bind 2 installed 917 sec used 0 sec Action statistics: Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 skip_sw in_hw in_hw_count 1 used_hw_stats delayed Changes between v7 and v8: * Rename enum offload_act_command as enum flow_offload_act_command * Add a single patch to rename exts stats update function for readability. * Fix the kernel test robot issue reported by Oliver Sang. Changes between v6 and v7: * Add a single patch to rename offload functions with offload for readability. * Post 166b6a46b78b ("flow_offload: return EOPNOTSUPP for the unsupported mpls action type") as a bug fix to netdev. * Rename enum flow_act_command as enum flow_offload_act_command * Rename the new added action offload setup ops with offload instead of flow * Rename the new added action offload function with offload instead of flow. * Add more selftest cases for validate filter and actions. Changes between v5 and v6: * Fix issue reported by Dan Carpenter found using Smatch. Changes beteeen v4 and v5: * Made changes of code style according to the public review comments. * Add a fix for unsupported mpls action type in flow action setup stage. * Add ops to tc_action_ops for flow action setup to facilitate adding a standalone action module. * Add notification process when deleting action in reoffload process. Changes between v3 and v4: * Made changes according to the public review comments. * Validate flags inside tcf_action_init() instead of creating new tcf_exts_validate_actions() function. * Exactly match when validating flags of actions and filters. * Add index to flow_action_entry for driver to identify actions. Changes between v2 and v3: * Made changes according to the review comments. * Delete in_hw and not_in_hw flag and user can judge if the action is offloaded to any hardware by in_hw_count. * Split the main patch of the action offload to three single patch to facilitate code review. Changes between v1 and v2: * Add the skip_hw/skip_sw for user to specify if the action should be in hardware or software. * Fix issue of sleeping function called from invalid context. * Change the action offload/delete from batch to one by one. * Add some parameters to the netlink message for user space to look up the offload status of the actions. * Add reoffload process to update action hw_count when driver is inserted or removed. Changes between v1 and RFC: * Fix robot test failure. * Change actions offload process in action add function rather than action init. * Change actions offload delete process after tcf_del_notify to keep undeleted actions. * Add process to update actions stats from hardware. ==================== Signed-off-by: David S. Miller commit eb473bac4a4b28eafb104e35410de3bc111b2e08 Author: Baowen Zheng Date: Fri Dec 17 19:16:29 2021 +0100 selftests: tc-testing: add action offload selftest for action and filter Add selftest cases in action police with skip_hw. Add selftest case to validate flags of filter and action. These tests depend on corresponding iproute2 command support. Signed-off-by: Baowen Zheng Signed-off-by: Simon Horman Signed-off-by: David S. Miller commit c86e0209dc7725c91583e3c0c78c3da6a28daeb4 Author: Baowen Zheng Date: Fri Dec 17 19:16:28 2021 +0100 flow_offload: validate flags of filter and actions Add process to validate flags of filter and actions when adding a tc filter. We need to prevent adding filter with flags conflicts with its actions. Signed-off-by: Baowen Zheng Signed-off-by: Louis Peens Signed-off-by: Simon Horman Acked-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit 13926d19a11e303f12571df61b7bb64f17cb4561 Author: Baowen Zheng Date: Fri Dec 17 19:16:27 2021 +0100 flow_offload: add reoffload process to update hw_count Add reoffload process to update hw_count when driver is inserted or removed. We will delete the action if it is with skip_sw flag and not offloaded to any hardware in reoffload process. When reoffloading actions, we still offload the actions that are added independent of filters. Signed-off-by: Baowen Zheng Signed-off-by: Louis Peens Signed-off-by: Simon Horman Signed-off-by: David S. Miller commit e8cb5bcf6ed6d42227c453a3a3170105462f69df Author: Baowen Zheng Date: Fri Dec 17 19:16:26 2021 +0100 net: sched: save full flags for tc action Save full action flags and return user flags when return flags to user space. Save full action flags to distinguish if the action is created independent from classifier. We made this change mainly for further patch to reoffload tc actions. Signed-off-by: Baowen Zheng Signed-off-by: Simon Horman Acked-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit c7a66f8d8a946edafb38150480145ab9801e4e52 Author: Baowen Zheng Date: Fri Dec 17 19:16:25 2021 +0100 flow_offload: add process to update action stats from hardware When collecting stats for actions update them using both hardware and software counters. Stats update process should not run in context of preempt_disable. Signed-off-by: Baowen Zheng Signed-off-by: Louis Peens Signed-off-by: Simon Horman Signed-off-by: David S. Miller commit bcd64368584bab38bdd095c88df702fb64271694 Author: Baowen Zheng Date: Fri Dec 17 19:16:24 2021 +0100 flow_offload: rename exts stats update functions with hw Rename exts stats update functions with hw for readability. We make this change also to update stats from hw for an action when it is offloaded to hw as a single action. Signed-off-by: Baowen Zheng Signed-off-by: Simon Horman Signed-off-by: David S. Miller commit 7adc576512110ef32b0424a727ee1d04359fc205 Author: Baowen Zheng Date: Fri Dec 17 19:16:23 2021 +0100 flow_offload: add skip_hw and skip_sw to control if offload the action We add skip_hw and skip_sw for user to control if offload the action to hardware. We also add in_hw_count for user to indicate if the action is offloaded to any hardware. Signed-off-by: Baowen Zheng Signed-off-by: Simon Horman Acked-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit 8cbfe939abe905280279e84a297b1cb34e0d0ec9 Author: Baowen Zheng Date: Fri Dec 17 19:16:22 2021 +0100 flow_offload: allow user to offload tc action to net device Use flow_indr_dev_register/flow_indr_dev_setup_offload to offload tc action. We need to call tc_cleanup_flow_action to clean up tc action entry since in tc_setup_action, some actions may hold dev refcnt, especially the mirror action. Signed-off-by: Baowen Zheng Signed-off-by: Louis Peens Signed-off-by: Simon Horman Signed-off-by: David S. Miller commit c54e1d920f04d528ab558f09326a78d2ae59e323 Author: Baowen Zheng Date: Fri Dec 17 19:16:21 2021 +0100 flow_offload: add ops to tc_action_ops for flow action setup Add a new ops to tc_action_ops for flow action setup. Refactor function tc_setup_flow_action to use this new ops. We make this change to facilitate to add standalone action module. We will also use this ops to offload action independent of filter in following patch. Signed-off-by: Baowen Zheng Signed-off-by: Simon Horman Signed-off-by: David S. Miller commit 9c1c0e124ca25589e6cf040e105ab0857f9e9c3e Author: Baowen Zheng Date: Fri Dec 17 19:16:20 2021 +0100 flow_offload: rename offload functions with offload instead of flow To improves readability, we rename offload functions with offload instead of flow. The term flow is related to exact matches, so we rename these functions with offload. We make this change to facilitate single action offload functions naming. Signed-off-by: Baowen Zheng Signed-off-by: Simon Horman Signed-off-by: David S. Miller commit 5a9959008fb63191538ab0f7800f4cf26afe7750 Author: Baowen Zheng Date: Fri Dec 17 19:16:19 2021 +0100 flow_offload: add index to flow_action_entry structure Add index to flow_action_entry structure and delete index from police and gate child structure. We make this change to offload tc action for driver to identify a tc action. Signed-off-by: Baowen Zheng Signed-off-by: Simon Horman Signed-off-by: David S. Miller commit 144d4c9e800da1230d817bbd50068a22e4cc688e Author: Baowen Zheng Date: Fri Dec 17 19:16:18 2021 +0100 flow_offload: reject to offload tc actions in offload drivers A follow-up patch will allow users to offload tc actions independent of classifier in the software datapath. In preparation for this, teach all drivers that support offload of the flow tables to reject such configuration as currently none of them support it. Signed-off-by: Baowen Zheng Signed-off-by: Simon Horman Acked-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit 40bd094d65fc9f83941b024cde7c24516f036879 Author: Baowen Zheng Date: Fri Dec 17 19:16:17 2021 +0100 flow_offload: fill flags to action structure Fill flags to action structure to allow user control if the action should be offloaded to hardware or not. Signed-off-by: Baowen Zheng Signed-off-by: Louis Peens Signed-off-by: Simon Horman Acked-by: Jamal Hadi Salim Signed-off-by: David S. Miller commit c08995bff202f102c0eff7b799b6b91b748a02a2 Author: Tom Rix Date: Sat Dec 18 07:27:12 2021 -0800 gpio: sim: fix uninitialized ret variable Building with clang returns this error: gpio-sim.c:889:7: error: variable 'ret' is uninitialized when used here ret should be the status of the call to gpio_sim_make_bank_swnode stored in bank->swnode. Fixes: 83960fcf4818 ("gpio: sim: new testing module") Signed-off-by: Tom Rix Reviewed-by: Nathan Chancellor Signed-off-by: Bartosz Golaszewski commit 3363bd0cfbb80dfcd25003cd3815b0ad8b68d0ff Author: Kumar Kartikeya Dwivedi Date: Fri Dec 17 07:20:24 2021 +0530 bpf: Extend kfunc with PTR_TO_CTX, PTR_TO_MEM argument support Allow passing PTR_TO_CTX, if the kfunc expects a matching struct type, and punt to PTR_TO_MEM block if reg->type does not fall in one of PTR_TO_BTF_ID or PTR_TO_SOCK* types. This will be used by future commits to get access to XDP and TC PTR_TO_CTX, and pass various data (flags, l4proto, netns_id, etc.) encoded in opts struct passed as pointer to kfunc. For PTR_TO_MEM support, arguments are currently limited to pointer to scalar, or pointer to struct composed of scalars. This is done so that unsafe scenarios (like passing PTR_TO_MEM where PTR_TO_BTF_ID of in-kernel valid structure is expected, which may have pointers) are avoided. Since the argument checking happens basd on argument register type, it is not easy to ascertain what the expected type is. In the future, support for PTR_TO_MEM for kfunc can be extended to serve other usecases. The struct type whose pointer is passed in may have maximum nesting depth of 4, all recursively composed of scalars or struct with scalars. Future commits will add negative tests that check whether these restrictions imposed for kfunc arguments are duly rejected by BPF verifier or not. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211217015031.1278167-4-memxor@gmail.com commit 7f16d2aa4089a882b6a9899876ac455036a8c34d Merge: e967a20a8fabc 9497c458c10b0 Author: Alexei Starovoitov Date: Sat Dec 18 13:40:42 2021 -0800 Merge branch 'Introduce composable bpf types' Hao Luo says: ==================== This patch set consists of two changes: - a cleanup of arg_type, ret_type and reg_type which try to make those types composable. (patch 1/9 - patch 6/9) - a bug fix that prevents bpf programs from writing kernel memory. (patch 7/9 - patch 9/9) The purpose of the cleanup is to find a scalable way to express type nullness and read-onliness. This patchset introduces two flags that can be applied on all three types: PTR_MAYBE_NULL and MEM_RDONLY. Previous types such as ARG_XXX_OR_NULL can now be written as ARG_XXX | PTR_MAYBE_NULL Similarly, PTR_TO_RDONLY_BUF is now "PTR_TO_BUF | MEM_RDONLY". Flags can be composed, as ARGs can be both MEM_RDONLY and MAYBE_NULL. ARG_PTR_TO_MEM | PTR_MAYBE_NULL | MEM_RDONLY Based on this new composable types, patch 7/9 applies MEM_RDONLY on PTR_TO_MEM, in order to tag the returned memory from per_cpu_ptr as read-only. Therefore fixing a previous bug that one can leverage per_cpu_ptr to modify kernel memory within BPF programs. Patch 8/9 generalizes the use of MEM_RDONLY further by tagging a set of helper arguments ARG_PTR_TO_MEM with MEM_RDONLY. Some helper functions may override their arguments, such as bpf_d_path, bpf_snprintf. In this patch, we narrow the ARG_PTR_TO_MEM to be compatible with only a subset of memory types. This prevents these helpers from writing read-only memories. For the helpers that do not write its arguments, we add tag MEM_RDONLY to allow taking a RDONLY memory as argument. Changes since v1: - use %u to print base_type(type) instead of %lu. (Andrii, patch 3/9) - improve reg_type_str() by appending '_or_null' and prepending 'rdonly_'. use preallocated buffer in 'bpf_env'. - unified handling of the previous XXX_OR_NULL in adjust_ptr_min_max_vals (Andrii, patch 4/9) - move PTR_TO_MAP_KEY up to PTR_TO_MAP_VALUE so that we don't have to change to drivers that assume the numeric values of bpf_reg. (patch 4/9) - reintroduce the typo from previous commits in fixes tags (Andrii, patch 7/9) - extensive comments on the reason behind folding flags in check_reg_type (Andrii, patch 8/9) Changes since RFC v2: - renamed BPF_BASE_TYPE to a more succinct name base_type and move its definition to bpf_verifier.h. Same for BPF_TYPE_FLAG. (Alexei) - made checking MEM_RDONLY in check_reg_type() universal (Alexei) - ran through majority of test_progs and fixed bugs in RFC v2: - fixed incorrect BPF_BASE_TYPE_MASK. The high bit of GENMASK should be BITS - 1, rather than BITS. patch 1/9. - fixed incorrect conditions when checking ARG_PTR_TO_MAP_VALUE in check_func_arg(). See patch 2/9. - fixed a bug where PTR_TO_BTF_ID may be combined with MEM_RDONLY, causing the check in check_mem_access() to fall through to the 'else' branch. See check_helper_call() in patch 7/9. - fixed build failure on netronome driver. Entries in bpf_reg_type have been ordered. patch 4/9. - fixed build warnings of using '%d' to print base_type. patch 4/9 - unify arg_type_may_be_null() and reg_type_may_be_null() into a single type_may_be_null(). Previous versions: v1: https://lwn.net/Articles/877938/ RFC v2: https://lwn.net/Articles/877171/ RFC v1: https://lore.kernel.org/bpf/20211109003052.3499225-1-haoluo@google.com/T/ https://lore.kernel.org/bpf/20211109021624.1140446-8-haoluo@google.com/T/ ==================== Signed-off-by: Alexei Starovoitov commit 9497c458c10b049438ef6e6ddda898edbc3ec6a8 Author: Hao Luo Date: Thu Dec 16 16:31:52 2021 -0800 bpf/selftests: Test PTR_TO_RDONLY_MEM This test verifies that a ksym of non-struct can not be directly updated. Signed-off-by: Hao Luo Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211217003152.48334-10-haoluo@google.com commit 216e3cd2f28dbbf1fe86848e0e29e6693b9f0a20 Author: Hao Luo Date: Thu Dec 16 16:31:51 2021 -0800 bpf: Add MEM_RDONLY for helper args that are pointers to rdonly mem. Some helper functions may modify its arguments, for example, bpf_d_path, bpf_get_stack etc. Previously, their argument types were marked as ARG_PTR_TO_MEM, which is compatible with read-only mem types, such as PTR_TO_RDONLY_BUF. Therefore it's legitimate, but technically incorrect, to modify a read-only memory by passing it into one of such helper functions. This patch tags the bpf_args compatible with immutable memory with MEM_RDONLY flag. The arguments that don't have this flag will be only compatible with mutable memory types, preventing the helper from modifying a read-only memory. The bpf_args that have MEM_RDONLY are compatible with both mutable memory and immutable memory. Signed-off-by: Hao Luo Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211217003152.48334-9-haoluo@google.com commit 34d3a78c681e8e7844b43d1a2f4671a04249c821 Author: Hao Luo Date: Thu Dec 16 16:31:50 2021 -0800 bpf: Make per_cpu_ptr return rdonly PTR_TO_MEM. Tag the return type of {per, this}_cpu_ptr with RDONLY_MEM. The returned value of this pair of helpers is kernel object, which can not be updated by bpf programs. Previously these two helpers return PTR_OT_MEM for kernel objects of scalar type, which allows one to directly modify the memory. Now with RDONLY_MEM tagging, the verifier will reject programs that write into RDONLY_MEM. Fixes: 63d9b80dcf2c ("bpf: Introducte bpf_this_cpu_ptr()") Fixes: eaa6bcb71ef6 ("bpf: Introduce bpf_per_cpu_ptr()") Fixes: 4976b718c355 ("bpf: Introduce pseudo_btf_id") Signed-off-by: Hao Luo Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211217003152.48334-8-haoluo@google.com commit cf9f2f8d62eca810afbd1ee6cc0800202b000e57 Author: Hao Luo Date: Thu Dec 16 16:31:49 2021 -0800 bpf: Convert PTR_TO_MEM_OR_NULL to composable types. Remove PTR_TO_MEM_OR_NULL and replace it with PTR_TO_MEM combined with flag PTR_MAYBE_NULL. Signed-off-by: Hao Luo Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211217003152.48334-7-haoluo@google.com commit 20b2aff4bc15bda809f994761d5719827d66c0b4 Author: Hao Luo Date: Thu Dec 16 16:31:48 2021 -0800 bpf: Introduce MEM_RDONLY flag This patch introduce a flag MEM_RDONLY to tag a reg value pointing to read-only memory. It makes the following changes: 1. PTR_TO_RDWR_BUF -> PTR_TO_BUF 2. PTR_TO_RDONLY_BUF -> PTR_TO_BUF | MEM_RDONLY Signed-off-by: Hao Luo Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211217003152.48334-6-haoluo@google.com commit c25b2ae136039ffa820c26138ed4a5e5f3ab3841 Author: Hao Luo Date: Thu Dec 16 16:31:47 2021 -0800 bpf: Replace PTR_TO_XXX_OR_NULL with PTR_TO_XXX | PTR_MAYBE_NULL We have introduced a new type to make bpf_reg composable, by allocating bits in the type to represent flags. One of the flags is PTR_MAYBE_NULL which indicates a pointer may be NULL. This patch switches the qualified reg_types to use this flag. The reg_types changed in this patch include: 1. PTR_TO_MAP_VALUE_OR_NULL 2. PTR_TO_SOCKET_OR_NULL 3. PTR_TO_SOCK_COMMON_OR_NULL 4. PTR_TO_TCP_SOCK_OR_NULL 5. PTR_TO_BTF_ID_OR_NULL 6. PTR_TO_MEM_OR_NULL 7. PTR_TO_RDONLY_BUF_OR_NULL 8. PTR_TO_RDWR_BUF_OR_NULL Signed-off-by: Hao Luo Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/r/20211217003152.48334-5-haoluo@google.com commit 3c4807322660d4290ac9062c034aed6b87243861 Author: Hao Luo Date: Thu Dec 16 16:31:46 2021 -0800 bpf: Replace RET_XXX_OR_NULL with RET_XXX | PTR_MAYBE_NULL We have introduced a new type to make bpf_ret composable, by reserving high bits to represent flags. One of the flag is PTR_MAYBE_NULL, which indicates a pointer may be NULL. When applying this flag to ret_types, it means the returned value could be a NULL pointer. This patch switches the qualified arg_types to use this flag. The ret_types changed in this patch include: 1. RET_PTR_TO_MAP_VALUE_OR_NULL 2. RET_PTR_TO_SOCKET_OR_NULL 3. RET_PTR_TO_TCP_SOCK_OR_NULL 4. RET_PTR_TO_SOCK_COMMON_OR_NULL 5. RET_PTR_TO_ALLOC_MEM_OR_NULL 6. RET_PTR_TO_MEM_OR_BTF_ID_OR_NULL 7. RET_PTR_TO_BTF_ID_OR_NULL This patch doesn't eliminate the use of these names, instead it makes them aliases to 'RET_PTR_TO_XXX | PTR_MAYBE_NULL'. Signed-off-by: Hao Luo Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211217003152.48334-4-haoluo@google.com commit 48946bd6a5d695c50b34546864b79c1f910a33c1 Author: Hao Luo Date: Thu Dec 16 16:31:45 2021 -0800 bpf: Replace ARG_XXX_OR_NULL with ARG_XXX | PTR_MAYBE_NULL We have introduced a new type to make bpf_arg composable, by reserving high bits of bpf_arg to represent flags of a type. One of the flags is PTR_MAYBE_NULL which indicates a pointer may be NULL. When applying this flag to an arg_type, it means the arg can take NULL pointer. This patch switches the qualified arg_types to use this flag. The arg_types changed in this patch include: 1. ARG_PTR_TO_MAP_VALUE_OR_NULL 2. ARG_PTR_TO_MEM_OR_NULL 3. ARG_PTR_TO_CTX_OR_NULL 4. ARG_PTR_TO_SOCKET_OR_NULL 5. ARG_PTR_TO_ALLOC_MEM_OR_NULL 6. ARG_PTR_TO_STACK_OR_NULL This patch does not eliminate the use of these arg_types, instead it makes them an alias to the 'ARG_XXX | PTR_MAYBE_NULL'. Signed-off-by: Hao Luo Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211217003152.48334-3-haoluo@google.com commit d639b9d13a39cf15639cbe6e8b2c43eb60148a73 Author: Hao Luo Date: Thu Dec 16 16:31:44 2021 -0800 bpf: Introduce composable reg, ret and arg types. There are some common properties shared between bpf reg, ret and arg values. For instance, a value may be a NULL pointer, or a pointer to a read-only memory. Previously, to express these properties, enumeration was used. For example, in order to test whether a reg value can be NULL, reg_type_may_be_null() simply enumerates all types that are possibly NULL. The problem of this approach is that it's not scalable and causes a lot of duplication. These properties can be combined, for example, a type could be either MAYBE_NULL or RDONLY, or both. This patch series rewrites the layout of reg_type, arg_type and ret_type, so that common properties can be extracted and represented as composable flag. For example, one can write ARG_PTR_TO_MEM | PTR_MAYBE_NULL which is equivalent to the previous ARG_PTR_TO_MEM_OR_NULL The type ARG_PTR_TO_MEM are called "base type" in this patch. Base types can be extended with flags. A flag occupies the higher bits while base types sits in the lower bits. This patch in particular sets up a set of macro for this purpose. The following patches will rewrite arg_types, ret_types and reg_types respectively. Signed-off-by: Hao Luo Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211217003152.48334-2-haoluo@google.com commit d558285413ea2f934ab90223ba908c30c5113aee Author: Thomas Gleixner Date: Sat Dec 18 11:25:14 2021 +0100 PCI/MSI: Unbreak pci_irq_get_affinity() The recent cleanup of pci_irq_get_affinity() broke the function for PCI/MSI-X and indices > 0. Only the MSI descriptor for PCI/MSI has more than one affinity mask which can be retrieved via the MSI index. PCI/MSI-X has one descriptor per vector and each has a single affinity mask. Use index 0 when accessing the affinity mask in the MSI descriptor when MSI-X is enabled. Fixes: f48235900182 ("PCI/MSI: Simplify pci_irq_get_affinity()") Reported-by: Nathan Chancellor Signed-off-by: Thomas Gleixner Tested-by: Nathan Chancellor Link: https://lore.kernel.org/r/87v8zm9pmd.ffs@tglx commit eafba51c545a165b29777cde1fc8b04781a0a8db Author: Stefan Wahren Date: Wed Dec 15 10:44:49 2021 +0100 dt-bindings: soc: bcm: Convert brcm,bcm2835-vchiq to json-schema This converts the VCHIQ bindings to YAML format. Signed-off-by: Stefan Wahren Co-developed-by: Nicolas Saenz Julienne Signed-off-by: Nicolas Saenz Julienne Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211215094448.280796-1-nsaenz@kernel.org commit abc14eb1e01286819a671019e78a23542685eee2 Author: Andy Shevchenko Date: Mon Dec 13 22:46:32 2021 +0200 ACPI: NFIT: Import GUID before use Strictly speaking the comparison between guid_t and raw buffer is not correct. Import GUID to variable of guid_t type and then compare. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211213204632.56735-1-andriy.shevchenko@linux.intel.com Signed-off-by: Dan Williams commit 7ac5360cd4d02cc7e0eaf10867f599e041822f12 Author: Christoph Hellwig Date: Wed Dec 15 09:45:08 2021 +0100 dax: remove the copy_from_iter and copy_to_iter methods These methods indirect the actual DAX read/write path. In the end pmem uses magic flush and mc safe variants and fuse and dcssblk use plain ones while device mapper picks redirects to the underlying device. Add set_dax_nocache() and set_dax_nomc() APIs to control which copy routines are used to remove indirect call from the read/write fast path as well as a lot of boilerplate code. Signed-off-by: Christoph Hellwig Reviewed-by: Vivek Goyal [virtiofs] Link: https://lore.kernel.org/r/20211215084508.435401-5-hch@lst.de Signed-off-by: Dan Williams commit 30c6828a17a572aeb9e3a3bacce05fdcf1106541 Author: Christoph Hellwig Date: Wed Dec 15 09:45:07 2021 +0100 dax: remove the DAXDEV_F_SYNC flag Remove the DAXDEV_F_SYNC flag and thus the flags argument to alloc_dax and just let the drivers call set_dax_synchronous directly. Signed-off-by: Christoph Hellwig Reviewed-by: Pankaj Gupta Reviewed-by: Dan Williams Link: https://lore.kernel.org/r/20211215084508.435401-4-hch@lst.de Signed-off-by: Dan Williams commit fd1d00ec92002d8fe28ca981a72395eaa7ae3d11 Author: Christoph Hellwig Date: Wed Dec 15 09:45:06 2021 +0100 dax: simplify dax_synchronous and set_dax_synchronous Remove the pointless wrappers. Signed-off-by: Christoph Hellwig Reviewed-by: Pankaj Gupta Reviewed-by: Dan Williams Link: https://lore.kernel.org/r/20211215084508.435401-3-hch@lst.de Signed-off-by: Dan Williams commit e17f7a0bc4daa44a4809f5f2f947aa2aa74d1369 Author: Christoph Hellwig Date: Wed Dec 15 09:45:05 2021 +0100 uio: remove copy_from_iter_flushcache() and copy_mc_to_iter() These two wrappers are never used. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211215084508.435401-2-hch@lst.de Signed-off-by: Dan Williams commit f85b244ee395c774a0039c176f46fc0d3747a0ae Author: Yajun Deng Date: Fri Dec 17 17:25:45 2021 +0800 xdp: move the if dev statements to the first The xdp_rxq_info_unreg() called by xdp_rxq_info_reg() is meaningless when dev is NULL, so move the if dev statements to the first. Signed-off-by: Yajun Deng Signed-off-by: David S. Miller commit 23044d77d6062ad1a5e26466931a7b75deaddbd7 Merge: 7e1c5d7b6926f 92fc50859872e Author: David S. Miller Date: Sat Dec 18 12:22:17 2021 +0000 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-12-17 Brett Creeley says: This patch series adds support in the iavf driver for communicating and using VIRTCHNL_VF_OFFLOAD_VLAN_V2. The current VIRTCHNL_VF_OFFLOAD_VLAN is very limited and covers all 802.1Q VLAN offloads and filtering with no granularity. The new VIRTCHNL_VF_OFFLOAD_VLAN_V2 adds more granularity, flexibility, and support for 802.1ad offloads and filtering. This includes the VF negotiating which VLAN offloads/filtering it's allowed, where VLAN tags should be inserted and/or stripped into and from descriptors, and the supported VLAN protocols. ==================== Signed-off-by: David S. Miller commit 90d6cf349c5604bd79f1191d09ff1be0165a0513 Author: Changcheng Deng Date: Tue Nov 9 11:43:43 2021 +0000 fs: 9p: remove unneeded variable Fix the following coccicheck review: ./fs/9p/vfs_file.c: 117: 5-8: Unneeded variable Remove unneeded variable used to store return value. Link: https://lkml.kernel.org/r/20211109114343.132844-1-deng.changcheng@zte.com.cn Reported-by: Zeal Robot Signed-off-by: Changcheng Deng Signed-off-by: Dominique Martinet commit f27456693b960ce4022d40b943808b3362ce80f9 Author: zhuxinran Date: Thu Dec 16 14:14:39 2021 +0800 9p/trans_virtio: Fix typo in the comment for p9_virtio_create() couldlook ==> could look Link: https://lkml.kernel.org/r/20211216061439.4186-1-zhuran@mail.ustc.edu.cn Signed-off-by: zhuxinran Signed-off-by: Dominique Martinet commit 96c8bddb6cdefb029cc7e411a5ee2183477368ea Author: Krzysztof Kozlowski Date: Mon Dec 13 12:20:57 2021 +0100 dt-bindings: soc: samsung: keep SoC driver bindings together Recently added Samsung Exynos USI driver devicetree bindings were added under ../bindings/soc/samsung/exynos-usi.yaml, so move there also two other bindings for Exynos SoC drivers: the PMU and ChipID. Update Samsung Exynos MAINTAINERS entry to include this new path. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Sam Protsenko Link: https://lore.kernel.org/r/20211213112057.16709-1-krzysztof.kozlowski@canonical.com commit b603377e408fb41dbb0971635c57e123edbb5bf8 Author: Sam Protsenko Date: Sat Dec 4 21:57:54 2021 +0200 soc: samsung: Add USI driver USIv2 IP-core is found on modern ARM64 Exynos SoCs (like Exynos850) and provides selectable serial protocol (one of: UART, SPI, I2C). USIv2 registers usually reside in the same register map as a particular underlying protocol it implements, but have some particular offset. E.g. on Exynos850 the USI_UART has 0x13820000 base address, where UART registers have 0x00..0x40 offsets, and USI registers have 0xc0..0xdc offsets. Desired protocol can be chosen via SW_CONF register from System Register block of the same domain as USI. Before starting to use a particular protocol, USIv2 must be configured properly: 1. Select protocol to be used via System Register 2. Clear "reset" flag in USI_CON 3. Configure HWACG behavior (e.g. for UART Rx the HWACG must be disabled, so that the IP clock is not gated automatically); this is done using USI_OPTION register 4. Keep both USI clocks (PCLK and IPCLK) running during USI registers modification This driver implements the above behavior. Of course, USIv2 driver should be probed before UART/I2C/SPI drivers. It can be achieved by embedding UART/I2C/SPI nodes inside of the USI node (in Device Tree); driver then walks underlying nodes and instantiates those. Driver also handles USI configuration on PM resume, as register contents can be lost during CPU suspend. This driver is designed with different USI versions in mind. So it should be relatively easy to add new USI revisions to it later. Signed-off-by: Sam Protsenko Link: https://lore.kernel.org/r/20211204195757.8600-3-semen.protsenko@linaro.org Tested-by: Chanho Park Signed-off-by: Krzysztof Kozlowski commit f395d41f2a0343fa9d989d8f53e5640329554dd8 Author: Deren Wu Date: Sun Nov 14 10:46:57 2021 +0800 mt76: mt7921: add support for PCIe ID 0x0608/0x0616 New mt7921 serials chip support Signed-off-by: Deren Wu Signed-off-by: Felix Fietkau commit c40b42c2b808bb4056aaa8dcf4f93863cc48981d Author: Shayne Chen Date: Sun Nov 14 22:59:09 2021 +0800 mt76: testmode: add support to set MAC Add support to set SA/DA/BSSID in testmode. During mass production stage, some test scripts or test equipments need to set fixed addresses to detect or parse if a test is passed. Also, MAC setting is necessary for some tx/rx tests with rx filter, to make sure rx site only receives expected packets. Signed-off-by: Shayne Chen Signed-off-by: Felix Fietkau commit bbc1d4154ec1fcffbec7abf07bcb7cdc5b531400 Author: Shayne Chen Date: Mon Nov 1 01:48:42 2021 +0800 mt76: mt7915: add default calibrated data support Load the default eeprom data when the content of flash/efuse is invalid. This could help to eliminate some issues due to incorrect or insufficient rf values. Co-developed-by: Bo Jiao Signed-off-by: Bo Jiao Signed-off-by: Shayne Chen Reviewed-by: Ryder Lee Signed-off-by: Felix Fietkau commit c23fa1bbc5d6040398a3a1131d220a1ac5c90b3d Author: Ryder Lee Date: Mon Nov 15 01:58:58 2021 +0800 mt76: only set rx radiotap flag from within decoder functions Only set RX_FLAG_RADIOTAP_HE and RX_FLAG_RADIOTAP_HE_MU from with their own decoder functions to prevent header calculation error. Signed-off-by: Ryder Lee Signed-off-by: Felix Fietkau commit dc5399a50b45fa7656375612f0c9eb9bf47c0f9f Author: Xing Song Date: Wed Nov 10 12:19:31 2021 +0800 mt76: reverse the first fragmented frame to 802.11 The HW can apply header translation to first fragmented frame, and ramaining fragmented frame can only keep 802.11 format. Check and reverse the first fragmented frame to 802.11 format to make sure them can be defragmented by mac80211. Signed-off-by: Xing Song Signed-off-by: Felix Fietkau commit 8f05835425ce3f669e4b6d7c2c39a9aa22e1506c Author: Ryder Lee Date: Fri Nov 12 03:45:31 2021 +0800 mt76: mt7915: fix SMPS operation fail TGn fails sending SM power save mode action frame to the AP to switch from dynamic SMPS mode to static mode. Reported-by: Fang Zhao Signed-off-by: Fang Zhao Signed-off-by: Ryder Lee Signed-off-by: Felix Fietkau commit edc083183048a42eb136ff4dfd31e15c8a551f34 Author: Shayne Chen Date: Fri Nov 5 18:37:26 2021 +0800 mt76: mt7915: fix return condition in mt7915_tm_reg_backup_restore() Fix the issue that some registers not configured properly after restarting testmode. (e.g. change state from idle to off, and off to idle) Signed-off-by: Shayne Chen Signed-off-by: Felix Fietkau commit 0efaf31dec572d3aac4316c6d952e06d1c33adc4 Author: Sean Wang Date: Wed Nov 3 08:05:16 2021 +0800 mt76: mt7921: fix MT7921E reset failure There is a missing mt7921e_driver_own in the MT7921E reset procedure since the mt7921 mcu.c has been refactored for MT7921S, that will result in MT7921E reset failure, so add it back now. Fixes: dfc7743de1eb ("mt76: mt7921: refactor mcu.c to be bus independent") Reported-by: YN Chen Signed-off-by: Sean Wang Signed-off-by: Felix Fietkau commit 8c55516de3f9b76b9d9444e7890682ec2efc809f Author: Peter Chiu Date: Mon Nov 1 10:01:13 2021 +0800 mt76: mt7615: fix possible deadlock while mt7615_register_ext_phy() ieee80211_register_hw() is called with rtnl_lock held, and this could be caused lockdep from a work item that's on a workqueue that is flushed with the rtnl held. Move mt7615_register_ext_phy() outside the init_work(). Signed-off-by: Peter Chiu Signed-off-by: Felix Fietkau commit 2363b6a646b65a207345b9a9024dff0eff3fec44 Author: Sean Wang Date: Fri Oct 29 06:29:58 2021 +0800 mt76: mt7921: drop offload_flags overwritten offload_flags have to be dropped for mt7921 because mt76.omac_idx 0 would always run as station mode that would cause Tx encapsulation setting is not applied to mac80211. Also, drop IEEE80211_OFFLOAD_ENCAP_4ADDR too because it is not really being supported. Fixes: e0f9fdda81bd ("mt76: mt7921: add ieee80211_ops") Signed-off-by: Sean Wang Signed-off-by: Felix Fietkau commit e42603af7eccc3df20b7423faade95799dc213db Author: Lorenzo Bianconi Date: Sat Oct 23 15:49:38 2021 +0200 mt76: mt7915: get rid of mt7915_mcu_set_fixed_rate routine Fix the following sparse warning removing mt7915_mcu_set_fixed_rate since it is no longer used: warning: symbol 'mt7915_mcu_set_fixed_rate' was not declared. Should it be static? Signed-off-by: Lorenzo Bianconi Signed-off-by: Felix Fietkau commit f16cc980d649e664b8f41e1bbaba50255d24e5d1 Merge: 5fb6e8cf53b00 8f556a326c932 Author: Thomas Gleixner Date: Sat Dec 18 10:57:03 2021 +0100 Merge branch 'locking/urgent' into locking/core Pick up the spin loop condition fix. Signed-off-by: Thomas Gleixner commit 107ba9bf49c211bebfab24b8e3525c320069f53a Author: Dmitry Baryshkov Date: Wed Dec 15 01:58:39 2021 +0300 phy: qcom-qmp: Add SM8450 PCIe0 PHY support There are two different PCIe PHYs on SM8450, one having one lane (v5) and another with two lanes (v5.20). This commit adds support for the first PCIe phy only, support for the second PCIe PHY is coming in next commits. Signed-off-by: Dmitry Baryshkov Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211214225846.2043361-4-dmitry.baryshkov@linaro.org Signed-off-by: Vinod Koul commit 9710b162c8b93cda554146520cddbc68c95dc6a6 Author: Dmitry Baryshkov Date: Wed Dec 15 01:58:38 2021 +0300 dt-bindings: phy: qcom,qmp: Add SM8450 PCIe PHY bindings There are two different PCIe PHYs on SM8450, one having one lane and another with two lanes. Add DT bindings for the first one. Support for second PCIe host and PHY will be submitted separately. Signed-off-by: Dmitry Baryshkov Reviewed-by: Bjorn Andersson Acked-by: Rob Herring Link: https://lore.kernel.org/r/20211214225846.2043361-3-dmitry.baryshkov@linaro.org Signed-off-by: Vinod Koul commit f54ffa12168dc52f0d48d9fe32eacbbecd2c2c1d Author: Andi Shyti Date: Tue Dec 14 21:33:40 2021 +0200 drm/i915: Rename i915->gt to i915->gt0 In preparation of the multitile support, highlight the root GT by calling it gt0 inside the drm i915 private data. Signed-off-by: Andi Shyti Cc: Chris Wilson Cc: Joonas Lahtinen Cc: Lucas De Marchi Cc: Rodrigo Vivi Cc: Tvrtko Ursulin Reviewed-by: Matt Roper Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20211214193346.21231-11-andi.shyti@linux.intel.com commit 2cbc876daa715d50543e1d4d73f4e692860a51e5 Author: Michał Winiarski Date: Tue Dec 14 21:33:39 2021 +0200 drm/i915: Use to_gt() helper Use to_gt() helper consistently throughout the codebase. Pure mechanical s/i915->gt/to_gt(i915). No functional changes. Signed-off-by: Michał Winiarski Signed-off-by: Andi Shyti Reviewed-by: Matt Roper Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20211214193346.21231-10-andi.shyti@linux.intel.com commit c68c74f5b91ba56dab3ca9a219462e08c9b3cc9a Author: Andi Shyti Date: Tue Dec 14 21:33:38 2021 +0200 drm/i915/pxp: Use to_gt() helper Use to_gt() helper consistently throughout the codebase. Pure mechanical s/i915->gt/to_gt(i915). No functional changes. Signed-off-by: Andi Shyti Reviewed-by: Matt Roper Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20211214193346.21231-9-andi.shyti@linux.intel.com commit 8c2699fad60e3f3e55481b49a38d46f49ebba77d Author: Andi Shyti Date: Tue Dec 14 21:33:37 2021 +0200 drm/i915/selftests: Use to_gt() helper Use to_gt() helper consistently throughout the codebase. Pure mechanical s/i915->gt/to_gt(i915). No functional changes. Signed-off-by: Andi Shyti Cc: Michał Winiarski Reviewed-by: Matt Roper Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20211214193346.21231-8-andi.shyti@linux.intel.com commit 93b76b13cfc13bf02d91aa544efbb067e3382141 Author: Michał Winiarski Date: Tue Dec 14 21:33:36 2021 +0200 drm/i915/gvt: Use to_gt() helper Use to_gt() helper consistently throughout the codebase. Pure mechanical s/i915->gt/to_gt(i915). No functional changes. Signed-off-by: Michał Winiarski Signed-off-by: Andi Shyti Reviewed-by: Matt Roper Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20211214193346.21231-7-andi.shyti@linux.intel.com commit 1a9c4db4caf0a504e35f0cfd97e54e07ebc85044 Author: Michał Winiarski Date: Tue Dec 14 21:33:35 2021 +0200 drm/i915/gem: Use to_gt() helper Use to_gt() helper consistently throughout the codebase. Pure mechanical s/i915->gt/to_gt(i915). No functional changes. Signed-off-by: Michał Winiarski Signed-off-by: Andi Shyti Reviewed-by: Matt Roper Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20211214193346.21231-6-andi.shyti@linux.intel.com commit c14adcbd1a9648dc9d16dfd12c1e9bc0c14ef6aa Author: Michał Winiarski Date: Tue Dec 14 21:33:34 2021 +0200 drm/i915/gt: Use to_gt() helper Use to_gt() helper consistently throughout the codebase. Pure mechanical s/i915->gt/to_gt(i915). No functional changes. Signed-off-by: Michał Winiarski Signed-off-by: Andi Shyti Reviewed-by: Matt Roper Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20211214193346.21231-5-andi.shyti@linux.intel.com commit 62e94f92e3977dbe67a6974ba7e5aa60c9a5e687 Author: Michał Winiarski Date: Tue Dec 14 21:33:33 2021 +0200 drm/i915/display: Use to_gt() helper Use to_gt() helper consistently throughout the codebase. Pure mechanical s/i915->gt/to_gt(i915). No functional changes. Signed-off-by: Michał Winiarski Signed-off-by: Andi Shyti Reviewed-by: Matt Roper Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20211214193346.21231-4-andi.shyti@linux.intel.com commit c0f0dab8ba4858863579170dcffb23c1002879b7 Author: Michał Winiarski Date: Tue Dec 14 21:33:32 2021 +0200 drm/i915: Introduce to_gt() helper To allow further refactoring and abstract away the fact that GT is stored inside i915 private. No functional changes. Signed-off-by: Michał Winiarski Signed-off-by: Andi Shyti Reviewed-by: Matt Roper Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20211214193346.21231-3-andi.shyti@linux.intel.com commit 030def2cc91f5185c697f29d3c485c63559cff1d Author: Michał Winiarski Date: Tue Dec 14 21:33:31 2021 +0200 drm/i915: Store backpointer to GT in uncore We now support a per-gt uncore, yet we're not able to infer which GT we're operating upon. Let's store a backpointer for now. At this point the early initialization of the gt needs to be broken in two parts where the first is needed to assign to the gt the i915 private data pointer and the uncore. A temporary function has been made and the two parts are __intel_gt_init_early() and intel_gt_init_early(). This split will be fixed in the future with the multitile patch. Signed-off-by: Michał Winiarski Signed-off-by: Matt Roper Reviewed-by: Andi Shyti Signed-off-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20211214193346.21231-2-andi.shyti@linux.intel.com commit 6795801366da0cd3d99e27c37f020a8f16714886 Author: Matthew Wilcox (Oracle) Date: Wed May 19 18:38:43 2021 -0400 xfs: Support large folios Now that iomap has been converted, XFS is large folio safe. Indicate to the VFS that it can now create large folios for XFS. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong commit 60d8231089f0d955e0cce033421df4b19e9adfb0 Author: Matthew Wilcox (Oracle) Date: Wed Jan 13 10:48:49 2021 -0500 iomap: Support large folios in invalidatepage If we're punching a hole in a large folio, we need to remove the per-folio iomap data as the folio is about to be split and each page will need its own. If a dirty folio is only partially-uptodate, the iomap data contains the information about which blocks cannot be written back, so assert that a dirty folio is fully uptodate. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong commit 589110e897ff9cf7c3500c5fce1c688d1ffca6f4 Author: Matthew Wilcox (Oracle) Date: Fri May 7 15:08:09 2021 -0400 iomap: Convert iomap_migrate_page() to use folios The arguments are still pages for now, but we can use folios internally and cut out a lot of calls to compound_head(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong commit e735c0079465900d78d687f00aba625d46426b29 Author: Matthew Wilcox (Oracle) Date: Tue Nov 2 12:45:12 2021 -0400 iomap: Convert iomap_add_to_ioend() to take a folio We still iterate one block at a time, but now we call compound_head() less often. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong commit 81d4782a741b21c101eb368c120f65f7d624c219 Author: Matthew Wilcox (Oracle) Date: Tue Nov 2 11:41:16 2021 -0400 iomap: Simplify iomap_do_writepage() Rename end_offset to end_pos and offset_into_page to poff to match the rest of the file. Simplify the handling of the last page straddling i_size by doing the EOF check based on the byte granularity i_size instead of converting to a pgoff prematurely. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong commit 926550362d609bba6aa3f8cab99ae324adadc343 Author: Matthew Wilcox (Oracle) Date: Tue Nov 2 10:51:55 2021 -0400 iomap: Simplify iomap_writepage_map() Rename end_offset to end_pos and file_offset to pos to match the rest of the file. Simplify the loop by calculating nblocks up front instead of each time around the loop. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong commit 6e478521df535b9d5ef5eb84d4352f235bbbef99 Author: Matthew Wilcox (Oracle) Date: Fri Jul 30 09:56:05 2021 -0400 iomap,xfs: Convert ->discard_page to ->discard_folio XFS has the only implementation of ->discard_page today, so convert it to use folios in the same patch as converting the API. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong commit 9c4ce08dd21145d10775c6ce6f21330a9558f8d9 Author: Matthew Wilcox (Oracle) Date: Sun May 2 11:44:44 2021 -0400 iomap: Convert iomap_write_end_inline to take a folio This conversion is only safe because iomap only supports writes to inline data which starts at the beginning of the file. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit bc6123a84a71b5dd39192c02ea8f9f4266980b0e Author: Matthew Wilcox (Oracle) Date: Sun May 2 11:33:08 2021 -0400 iomap: Convert iomap_write_begin() and iomap_write_end() to folios These functions still only work in PAGE_SIZE chunks, but there are fewer conversions from tail to head pages as a result of this patch. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong commit a25def1fe56858efa40a8490e875da4a711487f8 Author: Matthew Wilcox (Oracle) Date: Fri Nov 5 14:24:09 2021 -0400 iomap: Convert __iomap_zero_iter to use a folio The zero iterator can work in folio-sized chunks instead of page-sized chunks. This will save a lot of page cache lookups if the file is cached in large folios. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong commit d454ab82bc7f4aa7af9f539d5cf9a1e237cdcbc2 Author: Matthew Wilcox (Oracle) Date: Thu Dec 9 15:47:44 2021 -0500 iomap: Allow iomap_write_begin() to be called with the full length In the future, we want write_begin to know the entire length of the write so that it can choose to allocate large folios. Pass the full length in from __iomap_zero_iter() and limit it where necessary. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Darrick J. Wong commit 7e1c5d7b6926f63d3750a273486a143e50d216ad Merge: ab9d0e2171be5 59060a47ca50b Author: Jakub Kicinski Date: Fri Dec 17 19:27:07 2021 -0800 Merge branch 'mptcp-miscellaneous-changes-for-5-17' Mat Martineau says: ==================== mptcp: Miscellaneous changes for 5.17 These are three unrelated patches that we've been testing in the MPTCP tree. Patch 1 modifies the packet scheduler that picks which TCP subflow is used for each chunk of outgoing data. The updated scheduler improves throughput on multiple-subflow connections. Patch 2 updates a selftest to verify recent TCP_ULP sockopt changes on MPTCP fallback sockets. Patch 3 cleans up some unnecessary comparisons with an 8-bit value. ==================== Link: https://lore.kernel.org/r/20211217233702.299461-1-mathew.j.martineau@linux.intel.com Signed-off-by: Jakub Kicinski commit 59060a47ca50bbdb1d863b73667a1065873ecc06 Author: Jean Sacren Date: Fri Dec 17 15:37:02 2021 -0800 mptcp: clean up harmless false expressions entry->addr.id is u8 with a range from 0 to 255 and MAX_ADDR_ID is 255. We should drop both false expressions of (entry->addr.id > MAX_ADDR_ID). We should also remove the obsolete parentheses in the first if branch. Use U8_MAX for MAX_ADDR_ID and add a comment to show the link to mptcp_addr_info.id as suggested by Mr. Matthieu Baerts. Reviewed-by: Matthieu Baerts Signed-off-by: Jean Sacren Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit f730b65c9d85c84d6e5fd5f6fee20e2d62ffe558 Author: Florian Westphal Date: Fri Dec 17 15:37:01 2021 -0800 selftests: mptcp: try to set mptcp ulp mode in different sk states The kernel will crash without 'mptcp: clear 'kern' flag from fallback sockets' change. Since this doesn't slow down testing in a noticeable way, run this unconditionally. The explicit test did not catch this, because the check was done for tcp socket returned by 'socket(.. IPPROTO_TCP) rather than a tcp socket returned by accept() on a mptcp listen fd. Signed-off-by: Florian Westphal Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 3ce0852c86b926aed7bb8c69b09c5ad4ba0a9dfb Author: Paolo Abeni Date: Fri Dec 17 15:37:00 2021 -0800 mptcp: enforce HoL-blocking estimation The MPTCP packet scheduler has sub-optimal behavior with asymmetric subflows: if the faster subflow-level cwin is closed, the packet scheduler can enqueue "too much" data on a slower subflow. When all the data on the faster subflow is acked, if the mptcp-level cwin is closed, and link utilization becomes suboptimal. The solution is implementing blest-like[1] HoL-blocking estimation, transmitting only on the subflow with the shorter estimated time to flush the queued memory. If such subflows cwin is closed, we wait even if other subflows are available. This is quite simpler than the original blest implementation, as we leverage the pacing rate provided by the TCP socket. To get a more accurate estimation for the subflow linger-time, we maintain a per-subflow weighted average of such info. Additionally drop magic numbers usage in favor of newly defined macros and use more meaningful names for status variable. [1] http://dl.ifip.org/db/conf/networking/networking2016/1570234725.pdf Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/137 Reviewed-by: Matthieu Baerts Signed-off-by: Paolo Abeni Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit ab9d0e2171be56bb3bcd0fe4bd8ae5d2f24e5a80 Author: Dan Carpenter Date: Fri Dec 17 10:10:37 2021 +0300 net: ethernet: mtk_eth_soc: delete some dead code The debugfs_create_dir() function never returns NULL. It does return error pointers but in normal situations like this there is no need to check for errors. Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20211217071037.GE26548@kili Signed-off-by: Jakub Kicinski commit ddfbe18da55cbea41aaf57d442228edbd6cbbff1 Author: Dan Carpenter Date: Fri Dec 17 10:07:35 2021 +0300 net: mtk_eth_soc: delete an unneeded variable There is already an "int err" declared at the start of the function so re-use that instead of declaring a shadow err variable. Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20211217070735.GC26548@kili Signed-off-by: Jakub Kicinski commit 00315e1627583c6ed5381bccf55c725aa4f45290 Author: Gerhard Engleder Date: Thu Dec 16 21:01:54 2021 +0100 tsnep: Fix s390 devm_ioremap_resource warning The following warning is fixed with additional config dependencies: s390-linux-ld: drivers/net/ethernet/engleder/tsnep_main.o: in function `tsnep_probe': tsnep_main.c:(.text+0x1de6): undefined reference to `devm_ioremap_resource' Reported-by: kernel test robot Signed-off-by: Gerhard Engleder Link: https://lore.kernel.org/r/20211216200154.1520-1-gerhard@engleder-embedded.com Signed-off-by: Jakub Kicinski commit ff8752d7617da301ad3b7ef18caa58d135ee8c3c Author: German Gomez Date: Thu Dec 16 15:24:04 2021 +0000 perf arm-spe: Synthesize SPE instruction events Synthesize instruction events for every ARM SPE record. Arm SPE implements a hardware-based sample period, and perf implements a software-based one. Add a warning message to inform the user of this. Signed-off-by: German Gomez Tested-by: Leo Yan Acked-by: Namhyung Kim Cc: Alexander Shishkin Cc: Jiri Olsa Cc: John Garry Cc: Mark Rutland Cc: Mathieu Poirier Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20211216152404.52474-1-german.gomez@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 6ed95285382d6f90a3c3a11d5806a5eb7db715c3 Author: Vladimir Lypak Date: Sun Dec 12 16:03:17 2021 +0000 drm/msm/a5xx: Fix missing CP_PROTECT for SMMU on A540 A CP_PROTECT entry for SMMU registers is missing for A540. According to downstream sources its length is same as on A530 - 0x20000 bytes. On all other revisions SMMU region length is 0x10000 bytes. Despite this, we setup region of length 0x20000 on all revisions. This doesn't cause any issues on those GPUs. As for preventing accesses to the region from protected mode it was tested to work the same. This patch drops the "if" condition in setup of CP_PROTECT entry because it already includes all supported revisions except A540. Signed-off-by: Vladimir Lypak Link: https://lore.kernel.org/r/20211212160333.980343-2-vladimir.lypak@gmail.com Signed-off-by: Rob Clark commit 6bf7805321b96e4144c1232d7c3f66b2dce35761 Author: Vladimir Lypak Date: Sun Dec 12 16:03:16 2021 +0000 drm/msm/a5xx: Add support for Adreno 506 GPU This GPU is found on SoCs such as MSM8953 (650 MHz), SDM450 (600 MHz), SDM632 (725 MHz). Signed-off-by: Vladimir Lypak Link: https://lore.kernel.org/r/20211212160333.980343-1-vladimir.lypak@gmail.com Signed-off-by: Rob Clark commit f91030ed4494a0698cc5b3df173f3e125fbd4c87 Author: Thierry Reding Date: Fri Dec 17 17:56:58 2021 +0100 dt-bindings: i2c: i2c-mux-gpio: Convert to json-schema Convert the GPIO-based I2C mux bindings from the free-form text format to json-schema. Signed-off-by: Thierry Reding Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211217165658.2650677-4-thierry.reding@gmail.com commit 8b82b8416f2cb1fdfa2709c7a96e022561e3ed24 Author: Thierry Reding Date: Fri Dec 17 17:56:56 2021 +0100 dt-bindings: i2c: i2c-mux-pinctrl: Convert to json-schema Convert the pinctrl-based I2C mux bindings from the free-form text format to json-schema. Signed-off-by: Thierry Reding Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211217165658.2650677-2-thierry.reding@gmail.com commit f10a9b722f808dd3a02648f073a84b2fe56dddd4 Author: Thierry Reding Date: Fri Dec 17 17:56:55 2021 +0100 dt-bindings: i2c: tegra: Convert to json-schema Convert the Tegra I2C controller bindings from plain text to json-schema format. Signed-off-by: Thierry Reding Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211217165658.2650677-1-thierry.reding@gmail.com commit 94360916fadd5cc3158608ee91c36d04836f14c1 Author: Florian Fainelli Date: Fri Dec 17 08:05:46 2021 -0800 dt-bindings: interrupt-controller: Merge BCM3380 with BCM7120 The two bindings are very similar and should be covered by the same document, do that so we can get rid of an additional binding file. Signed-off-by: Florian Fainelli Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211217160546.497012-3-f.fainelli@gmail.com commit 07f7f6867ecabe9c807bb17ce7449bd6bfd3a8dc Author: Florian Fainelli Date: Fri Dec 17 08:05:45 2021 -0800 dt-bindings: interrupt-controller: Convert BCM7120 L2 to YAML Convert the Broadcom BCM7120 Level 2 interrupt controller Device Tree binding to YAML to help with validation. Signed-off-by: Florian Fainelli Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211217160546.497012-2-f.fainelli@gmail.com commit e967a20a8fabc6442a78e2e2059e63a4bb6aed08 Author: Andrii Nakryiko Date: Fri Dec 17 09:12:02 2021 -0800 bpftool: Reimplement large insn size limit feature probing Reimplement bpf_probe_large_insn_limit() in bpftool, as that libbpf API is scheduled for deprecation in v0.8. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: Dave Marchevsky Link: https://lore.kernel.org/bpf/20211217171202.3352835-4-andrii@kernel.org commit 5a8ea82f9d25e88e502d1c3a1a9ba639f69a63c0 Author: Andrii Nakryiko Date: Fri Dec 17 09:12:01 2021 -0800 selftests/bpf: Add libbpf feature-probing API selftests Add selftests for prog/map/prog+helper feature probing APIs. Prog and map selftests are designed in such a way that they will always test all the possible prog/map types, based on running kernel's vmlinux BTF enum definition. This way we'll always be sure that when adding new BPF program types or map types, libbpf will be always updated accordingly to be able to feature-detect them. BPF prog_helper selftest will have to be manually extended with interesting and important prog+helper combinations, it's easy, but can't be completely automated. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: Dave Marchevsky Link: https://lore.kernel.org/bpf/20211217171202.3352835-3-andrii@kernel.org commit 878d8def0603eebf11e19903e7a8886b3e9728e4 Author: Andrii Nakryiko Date: Fri Dec 17 09:12:00 2021 -0800 libbpf: Rework feature-probing APIs Create three extensible alternatives to inconsistently named feature-probing APIs: - libbpf_probe_bpf_prog_type() instead of bpf_probe_prog_type(); - libbpf_probe_bpf_map_type() instead of bpf_probe_map_type(); - libbpf_probe_bpf_helper() instead of bpf_probe_helper(). Set up return values such that libbpf can report errors (e.g., if some combination of input arguments isn't possible to validate, etc), in addition to whether the feature is supported (return value 1) or not supported (return value 0). Also schedule deprecation of those three APIs. Also schedule deprecation of bpf_probe_large_insn_limit(). Also fix all the existing detection logic for various program and map types that never worked: - BPF_PROG_TYPE_LIRC_MODE2; - BPF_PROG_TYPE_TRACING; - BPF_PROG_TYPE_LSM; - BPF_PROG_TYPE_EXT; - BPF_PROG_TYPE_SYSCALL; - BPF_PROG_TYPE_STRUCT_OPS; - BPF_MAP_TYPE_STRUCT_OPS; - BPF_MAP_TYPE_BLOOM_FILTER. Above prog/map types needed special setups and detection logic to work. Subsequent patch adds selftests that will make sure that all the detection logic keeps working for all current and future program and map types, avoiding otherwise inevitable bit rot. [0] Closes: https://github.com/libbpf/libbpf/issues/312 Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: Dave Marchevsky Cc: Julia Kartseva Link: https://lore.kernel.org/bpf/20211217171202.3352835-2-andrii@kernel.org commit 877fee2a0c65a3b0b6ac0e90d7d7718b5a0341d3 Author: Hans de Goede Date: Fri Dec 17 15:15:15 2021 +0100 PCI: Convert pci_dev_present() stub to static inline Change the pci_dev_present() stub which is used when CONFIG_PCI is not set from a #define to a static inline stub. Thix should fix clang -Werror builds failing due to errors like this: drivers/platform/x86/thinkpad_acpi.c:4475:35: error: unused variable 'fwbug_cards_ids' [-Werror,-Wunused-const-variable] Where fwbug_cards_ids is an array of pci_device_id passed to pci_dev_present() during a quirk check. Link: https://lore.kernel.org/r/20211217141515.379586-1-hdegoede@redhat.com Reported-by: kernel test robot Signed-off-by: Hans de Goede Signed-off-by: Bjorn Helgaas Reviewed-by: Andy Shevchenko Cc: platform-driver-x86@vger.kernel.org commit 92fc50859872e93cdad115cca0a9317b8a3a90ec Author: Brett Creeley Date: Mon Nov 29 16:16:04 2021 -0800 iavf: Restrict maximum VLAN filters for VIRTCHNL_VF_OFFLOAD_VLAN_V2 For VIRTCHNL_VF_OFFLOAD_VLAN, PF's would limit the number of VLAN filters a VF was allowed to add. However, by the time the opcode failed, the VLAN netdev had already been added. VIRTCHNL_VF_OFFLOAD_VLAN_V2 added the ability for a PF to tell the VF how many VLAN filters it's allowed to add. Make changes to support that functionality. Signed-off-by: Brett Creeley Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit 8afadd1cd8ba1df757011eb58c471eca0ac81872 Author: Brett Creeley Date: Mon Nov 29 16:16:03 2021 -0800 iavf: Add support for VIRTCHNL_VF_OFFLOAD_VLAN_V2 offload enable/disable The new VIRTCHNL_VF_OFFLOAD_VLAN_V2 capability added support that allows the VF to support 802.1Q and 802.1ad VLAN insertion and stripping if successfully negotiated via VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS. Multiple changes were needed to support this new functionality. 1. Added new aq_required flags to support any kind of VLAN stripping and insertion offload requests via virtchnl. 2. Added the new method iavf_set_vlan_offload_features() that's used during VF initialization, VF reset, and iavf_set_features() to set the aq_required bits based on the current VLAN offload configuration of the VF's netdev. 3. Added virtchnl handling for VIRTCHNL_OP_ENABLE_STRIPPING_V2, VIRTCHNL_OP_DISABLE_STRIPPING_V2, VIRTCHNL_OP_ENABLE_INSERTION_V2, and VIRTCHNL_OP_ENABLE_INSERTION_V2. Signed-off-by: Brett Creeley Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit ccd219d2ea13a69881012569ea6ea33f46d684de Author: Brett Creeley Date: Mon Nov 29 16:16:02 2021 -0800 iavf: Add support for VIRTCHNL_VF_OFFLOAD_VLAN_V2 hotpath The new VIRTCHNL_VF_OFFLOAD_VLAN_V2 capability added support that allows the PF to set the location of the Tx and Rx VLAN tag for insertion and stripping offloads. In order to support this functionality a few changes are needed. 1. Add a new method to cache the VLAN tag location based on negotiated capabilities for the Tx and Rx ring flags. This needs to be called in the initialization and reset paths. 2. Refactor the transmit hotpath to account for the new Tx ring flags. When IAVF_TXR_FLAGS_VLAN_LOC_L2TAG2 is set, then the driver needs to insert the VLAN tag in the L2TAG2 field of the transmit descriptor. When the IAVF_TXRX_FLAGS_VLAN_LOC_L2TAG1 is set, then the driver needs to use the l2tag1 field of the data descriptor (same behavior as before). 3. Refactor the iavf_tx_prepare_vlan_flags() function to simplify transmit hardware VLAN offload functionality by only depending on the skb_vlan_tag_present() function. This can be done because the OS won't request transmit offload for a VLAN unless the driver told the OS it's supported and enabled. 4. Refactor the receive hotpath to account for the new Rx ring flags and VLAN ethertypes. This requires checking the Rx ring flags and descriptor status bits to determine the location of the VLAN tag. Also, since only a single ethertype can be supported at a time, check the enabled netdev features before specifying a VLAN ethertype in __vlan_hwaccel_put_tag(). Signed-off-by: Brett Creeley Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit 48ccc43ecf1096e8e2cdf46844125c2dc9fa49f6 Author: Brett Creeley Date: Mon Nov 29 16:16:01 2021 -0800 iavf: Add support VIRTCHNL_VF_OFFLOAD_VLAN_V2 during netdev config Based on VIRTCHNL_VF_OFFLOAD_VLAN_V2, the VF can now support more VLAN capabilities (i.e. 802.1AD offloads and filtering). In order to communicate these capabilities to the netdev layer, the VF needs to parse its VLAN capabilities based on whether it was able to negotiation VIRTCHNL_VF_OFFLOAD_VLAN or VIRTCHNL_VF_OFFLOAD_VLAN_V2 or neither of these. In order to support this, add the following functionality: iavf_get_netdev_vlan_hw_features() - This is used to determine the VLAN features that the underlying hardware supports and that can be toggled off/on based on the negotiated capabiltiies. For example, if VIRTCHNL_VF_OFFLOAD_VLAN_V2 was negotiated, then any capability marked with VIRTCHNL_VLAN_TOGGLE can be toggled on/off by the VF. If VIRTCHNL_VF_OFFLOAD_VLAN was negotiated, then only VLAN insertion and/or stripping can be toggled on/off. iavf_get_netdev_vlan_features() - This is used to determine the VLAN features that the underlying hardware supports and that should be enabled by default. For example, if VIRTHCNL_VF_OFFLOAD_VLAN_V2 was negotiated, then any supported capability that has its ethertype_init filed set should be enabled by default. If VIRTCHNL_VF_OFFLOAD_VLAN was negotiated, then filtering, stripping, and insertion should be enabled by default. Also, refactor iavf_fix_features() to take into account the new capabilities. To do this, query all the supported features (enabled by default and toggleable) and make sure the requested change is supported. If VIRTCHNL_VF_OFFLOAD_VLAN_V2 is successfully negotiated, there is no need to check VIRTCHNL_VLAN_TOGGLE here because the driver already told the netdev layer which features can be toggled via netdev->hw_features during iavf_process_config(), so only those features will be requested to change. Signed-off-by: Brett Creeley Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit 209f2f9c718138ddbd8586e5a1463bd079a17241 Author: Brett Creeley Date: Mon Nov 29 16:16:00 2021 -0800 iavf: Add support for VIRTCHNL_VF_OFFLOAD_VLAN_V2 negotiation In order to support the new VIRTCHNL_VF_OFFLOAD_VLAN_V2 capability the VF driver needs to rework it's initialization state machine and reset flow. This has to be done because successful negotiation of VIRTCHNL_VF_OFFLOAD_VLAN_V2 requires the VF driver to perform a second capability request via VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS before configuring the adapter and its netdev. Add the VIRTCHNL_VF_OFFLOAD_VLAN_V2 bit when sending the VIRTHCNL_OP_GET_VF_RESOURECES message. The underlying PF will either support VIRTCHNL_VF_OFFLOAD_VLAN or VIRTCHNL_VF_OFFLOAD_VLAN_V2 or neither. Both of these offloads should never be supported together. Based on this, add 2 new states to the initialization state machine: __IAVF_INIT_GET_OFFLOAD_VLAN_V2_CAPS __IAVF_INIT_CONFIG_ADAPTER The __IAVF_INIT_GET_OFFLOAD_VLAN_V2_CAPS state is used to request/store the new VLAN capabilities if and only if VIRTCHNL_VLAN_OFFLOAD_VLAN_V2 was successfully negotiated in the __IAVF_INIT_GET_RESOURCES state. The __IAVF_INIT_CONFIG_ADAPTER state is used to configure the adapter/netdev after the resource requests have finished. The VF will move into this state regardless of whether it successfully negotiated VIRTCHNL_VF_OFFLOAD_VLAN or VIRTCHNL_VF_OFFLOAD_VLAN_V2. Also, add a the new flag IAVF_FLAG_AQ_GET_OFFLOAD_VLAN_V2_CAPS and set it during VF reset. If VIRTCHNL_VF_OFFLOAD_VLAN_V2 was successfully negotiated then the VF will request its VLAN capabilities via VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS during the reset. This is needed because the PF may change/modify the VF's configuration during VF reset (i.e. modifying the VF's port VLAN configuration). This also, required the VF to call netdev_update_features() since its VLAN features may change during VF reset. Make sure to call this under rtnl_lock(). Signed-off-by: Brett Creeley Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit bd0b536dc2e1e9828a85b1e3470ee7bafc3b36f6 Author: Brett Creeley Date: Mon Nov 29 16:15:59 2021 -0800 virtchnl: Add support for new VLAN capabilities Currently VIRTCHNL only allows for VLAN filtering and offloads to happen on a single 802.1Q VLAN. Add support to filter and offload on inner, outer, and/or inner + outer VLANs. This is done by introducing the new capability VIRTCHNL_VF_OFFLOAD_VLAN_V2. The flow to negotiate this new capability is shown below. 1. VF - sets the VIRTCHNL_VF_OFFLOAD_VLAN_V2 bit in the virtchnl_vf_resource.vf_caps_flags during the VIRTCHNL_OP_GET_VF_RESOURCES request message. The VF should also set the VIRTCHNL_VF_OFFLOAD_VLAN bit in case the PF driver doesn't support the new capability. 2. PF - sets the VLAN capability bit it supports in the VIRTCHNL_OP_GET_VF_RESOURCES response message. This will either be VIRTCHNL_VF_OFFLOAD_VLAN_V2, VIRTCHNL_VF_OFFLOAD_VLAN, or none. 3. VF - If the VIRTCHNL_VF_OFFLOAD_VLAN_V2 capability was ACK'd by the PF, then the VF needs to request the VLAN capabilities of the PF/Device by issuing a VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS request. If the VIRTCHNL_VF_OFFLOAD_VLAN capability was ACK'd then the VF knows only single 802.1Q VLAN filtering/offloads are supported. If no VLAN capability is ACK'd then the PF/Device doesn't support hardware VLAN filtering/offloads for this VF. 4. PF - Populates the virtchnl_vlan_caps structure based on what it allows/supports for that VF and sends that response via VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS. After VIRTCHNL_OP_GET_OFFLOAD_VLAN_V2_CAPS is successfully negotiated the VF driver needs to interpret the capabilities supported by the underlying PF/Device. The VF will be allowed to filter/offload the inner 802.1Q, outer (various ethertype), inner 802.1Q + outer (various ethertypes), or none based on which fields are set. The VF will also need to interpret where the VLAN tag should be inserted and/or stripped based on the negotiated capabilities. Signed-off-by: Brett Creeley Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit 2cdbd92c2d1dff07ad56c39f5857ee644bbd2c8a Author: Paul Cercueil Date: Tue Dec 7 00:21:02 2021 +0000 mmc: mxc: Use the new PM macros Use DEFINE_SIMPLE_DEV_PM_OPS() instead of the SIMPLE_DEV_PM_OPS() macro, along with using pm_sleep_ptr() as this driver doesn't handle runtime PM. This makes it possible to remove the #ifdef CONFIG_PM guard around the suspend/resume functions. Signed-off-by: Paul Cercueil Acked-by: Ulf Hansson Signed-off-by: Rafael J. Wysocki commit e0d64ecc621715e9c7807e952b68475c62bbf630 Author: Paul Cercueil Date: Tue Dec 7 00:21:01 2021 +0000 mmc: jz4740: Use the new PM macros - Use DEFINE_SIMPLE_DEV_PM_OPS() instead of the SIMPLE_DEV_PM_OPS() macro. This makes it possible to remove the __maybe_unused flags on the callback functions. - Since we only have callbacks for suspend/resume, we can conditionally compile the dev_pm_ops structure for when CONFIG_PM_SLEEP is enabled; so use the pm_sleep_ptr() macro instead of pm_ptr(). Signed-off-by: Paul Cercueil Acked-by: Ulf Hansson Signed-off-by: Rafael J. Wysocki commit bcf6f1759adff0ec3f73ab7b4a873405ee26ff5c Author: Vitaly Kuznetsov Date: Thu Dec 16 10:58:26 2021 +0100 ACPI: NUMA: Process hotpluggable memblocks when !CONFIG_MEMORY_HOTPLUG Some systems (e.g. Hyper-V guests) have all their memory marked as hotpluggable in SRAT. acpi_numa_memory_affinity_init(), however, ignores all such regions when !CONFIG_MEMORY_HOTPLUG and this is unfortunate as memory affinity (NUMA) information gets lost. 'Hot Pluggable' flag in SRAT only means that "system hardware supports hot-add and hot-remove of this memory region", it doesn't prevent memory from being cold-plugged there. Ignore 'Hot Pluggable' bit instead of skipping the whole memory affinity information when !CONFIG_MEMORY_HOTPLUG. Signed-off-by: Vitaly Kuznetsov Signed-off-by: Rafael J. Wysocki commit 3c89857a66ef15bcf54c8fd255a1fd70dbc823a6 Author: Kirill A. Shutemov Date: Thu Dec 9 16:08:02 2021 +0300 ACPI: PM: Remove redundant cache flushing ACPICA code takes care about cache flushing on S1/S2/S3 in acpi_hw_extended_sleep() and acpi_hw_legacy_sleep(). acpi_suspend_enter() calls into ACPICA code via acpi_enter_sleep_state() for S1 or x86_acpi_suspend_lowlevel() for S3. acpi_sleep_prepare() call tree: __acpi_pm_prepare() acpi_pm_prepare() acpi_suspend_ops::prepare_late() acpi_hibernation_ops::pre_snapshot() acpi_hibernation_ops::prepare() acpi_suspend_begin_old() acpi_suspend_begin_old::begin() acpi_hibernation_begin_old() acpi_hibernation_ops_old::acpi_hibernation_begin_old() acpi_power_off_prepare() pm_power_off_prepare() Hibernation (S4) and Power Off (S5) don't require cache flushing, so the only interesting callsites are acpi_suspend_ops::prepare_late() and acpi_suspend_begin_old::begin(). Both of them have cache flush on ->enter() operation in acpi_suspend_enter(). Remove redundant ACPI_FLUSH_CPU_CACHE() in acpi_sleep_prepare() and acpi_suspend_enter(). Signed-off-by: Kirill A. Shutemov Signed-off-by: Rafael J. Wysocki commit 87ebbb8c612b1214f227ebb8f25442c6d163e802 Author: Kirill A. Shutemov Date: Mon Dec 6 15:29:51 2021 +0300 ACPI: processor: idle: Only flush cache on entering C3 According to ACPI 6.4, Section 8.2, CPU cache flushing required on entering the C3 power state. Avoid flushing the cache on entering other C-states. Signed-off-by: Kirill A. Shutemov [ rjw: Changelog edits ] Signed-off-by: Rafael J. Wysocki commit 99ece713773bfa17fdb4ee2a1fb3b7bee82e4b1a Author: Rafael J. Wysocki Date: Fri Dec 3 17:37:10 2021 +0100 ACPI: Use acpi_fetch_acpi_dev() instead of acpi_bus_get_device() Modify the ACPI code to use acpi_fetch_acpi_dev() instead of acpi_bus_get_device() where applicable. Signed-off-by: Rafael J. Wysocki Reviewed-by: Mika Westerberg Reviewed-by: Hans de Goede commit e3c963c498871e0d4b2eceb32e2b989493838ccc Author: Rafael J. Wysocki Date: Fri Dec 3 17:36:20 2021 +0100 ACPI: scan: Introduce acpi_fetch_acpi_dev() Introduce acpi_fetch_acpi_dev() as a more reasonable replacement for acpi_bus_get_device() and modify the code in scan.c to use it instead of the latter. No expected functional impact. Signed-off-by: Rafael J. Wysocki Reviewed-by: Mika Westerberg Reviewed-by: Hans de Goede commit c49eea6ffec626c059ace085fce1bf501b05dbc7 Author: Sakari Ailus Date: Wed Dec 1 15:01:15 2021 +0200 device property: Drop fwnode_graph_get_remote_node() fwnode_graph_get_remote_node() is only used by the tegra-video driver. Convert it to use newer fwnode_graph_get_endpoint_by_id() and drop now-unused fwnode_graph_get_remote_node(). Signed-off-by: Sakari Ailus Reviewed-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit 0d82017b70517b9b209ce7181d798a050ce23234 Author: Sakari Ailus Date: Wed Dec 1 14:59:34 2021 +0200 device property: Use fwnode_graph_for_each_endpoint() macro Now that we have fwnode_graph_for_each_endpoint() macro, use it instead of calling fwnode_graph_get_next_endpoint() directly. It manages the iterator variable for the user without manual intervention. Signed-off-by: Sakari Ailus Reviewed-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit c87b8fc569667610b4891cad1e4a663e5a94d8f8 Author: Sakari Ailus Date: Wed Dec 1 14:59:33 2021 +0200 device property: Implement fwnode_graph_get_endpoint_count() Add fwnode_graph_get_endpoint_count() function to provide generic implementation of of_graph_get_endpoint_count(). The former by default only counts endpoints to available devices which is consistent with the rest of the fwnode graph API. By providing FWNODE_GRAPH_DEVICE_DISABLED flag, also unconnected endpoints and endpoints to disabled devices are counted. Signed-off-by: Sakari Ailus Reviewed-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit 59f3f98284baa29da60410d04e498467c044aac2 Author: Sakari Ailus Date: Wed Dec 1 14:59:32 2021 +0200 Documentation: ACPI: Update references Update references for the ACPI _DSD documentation. In particular: - Substitute _DSD property and hierarchical data extension documents with the newer DSD guide that replaces both, and use its HTML form. - Refer to the latest ACPI spec. - Add data node reference documentation reference to graph documentation. Signed-off-by: Sakari Ailus Reviewed-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit a11174952205d082f1658fab4314f0caf706e0a8 Author: Sakari Ailus Date: Wed Dec 1 14:59:31 2021 +0200 Documentation: ACPI: Fix data node reference documentation The data node reference documentation was missing a package that must contain the property values, instead property name and multiple values being present in a single package. This is not aligned with the _DSD spec. Fix it by adding the package for the values. Also add the missing "reg" properties to two numbered nodes. Fixes: b10134a3643d ("ACPI: property: Document hierarchical data extension references") Signed-off-by: Sakari Ailus Reviewed-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit 49f39cb0ef198ae3c73765c9b9ee3034e4c9f076 Author: Sakari Ailus Date: Wed Dec 1 14:59:30 2021 +0200 device property: Fix documentation for FWNODE_GRAPH_DEVICE_DISABLED FWNODE_GRAPH_DEVICE_DISABLED flag was meant for also returning endpoints connected to disabled devices, but it also may return endpoints that are not connected. Fix this in documentation. Also fwnode_graph_get_endpoint_by_id() was affeced by this. Also improve the language a little bit. Fixes: 0fcc2bdc8aff ("device property: Add fwnode_graph_get_endpoint_by_id()") Signed-off-by: Sakari Ailus Reviewed-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit 4a7f4110f79163fd53ea65438041994ed615e3af Author: Sakari Ailus Date: Wed Dec 1 14:59:29 2021 +0200 device property: Fix fwnode_graph_devcon_match() fwnode leak For each endpoint it encounters, fwnode_graph_devcon_match() checks whether the endpoint's remote port parent device is available. If it is not, it ignores the endpoint but does not put the reference to the remote endpoint port parent fwnode. For available devices the fwnode handle reference is put as expected. Put the reference for unavailable devices now. Fixes: 637e9e52b185 ("device connection: Find device connections also from device graphs") Cc: 5.1+ # 5.1+ Signed-off-by: Sakari Ailus Reviewed-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit c50384d7e331aceeb4072bf363d5235eddda65bf Merge: be1d03eecc1cb a62a02986d399 Author: Mark Brown Date: Fri Dec 17 17:32:48 2021 +0000 ASoC: Intel: catpt: Dma-transfer fix and couple Merge series from Cezary Rojewski : Set is made of one fix for dma-transfer so that result of dmaengine_submit() is tested before moving on, and few cleanups: - two non-impactful, where catpt_component_open() layout gets improved slightly as well as relocation of couple of locals found in PCM-functions so that they look more cohesive - no need to expose catpt-driver board-matching information globally. Most fields are not by it and it's the sole user of haswell_machines table. By having them locally it is clear what is actually being used Cezary Rojewski (5): ASoC: Intel: catpt: Test dmaengine_submit() result before moving on ASoC: Intel: catpt: Reduce size of catpt_component_open() ASoC: Intel: catpt: Streamline locals declaration for PCM-functions ASoC: Intel: catpt: Drop SND_SOC_ACPI_INTEL_MATCH dependency ASoC: Intel: Drop legacy HSW/BDW board-match information include/sound/soc-acpi-intel-match.h | 1 - sound/soc/intel/Kconfig | 2 +- sound/soc/intel/catpt/device.c | 33 +++++++++++++++-- sound/soc/intel/catpt/dsp.c | 14 ++++++- sound/soc/intel/catpt/pcm.c | 37 +++++++++---------- .../common/soc-acpi-intel-hsw-bdw-match.c | 16 -------- 6 files changed, 61 insertions(+), 42 deletions(-) -- 2.25.1 commit be1d03eecc1cb55bd7ff7a419209fb027892e14d Merge: a92c1cd33520a bfa4671db1eff Author: Mark Brown Date: Fri Dec 17 17:32:46 2021 +0000 Support HDMI audio on NVIDIA Tegra20 Merge series from Dmitry Osipenko : This series revives Tegra20 S/PDIF driver which was upstreamed long time ago, but never was used. It also turns Tegra DRM HDMI driver into HDMI audio CODEC provider. Finally, HDMI audio is enabled in device-trees. For now the audio is enable only for Acer A500 tablet and Toshiba AC100 netbook because they're already supported by upstream, later on ASUS TF101 tablet will join them. I based S/PDIF patches on Arnd's Bergmann patch from a separate series [1] that removes obsolete slave_id. This eases merging of the patches by removing the merge conflict. This is a note for Mark Brown. I also based this series on top of power management series [2]. I.e. [2] should be applied first, otherwise "Add S/PDIF node to Tegra20 device-tree" patch should have merge conflict. This is a note for Thierry. [1] https://patchwork.ozlabs.org/project/linux-tegra/list/?series=273312 [2] https://patchwork.ozlabs.org/project/linux-tegra/list/?series=274534 Changelog: v4: - Added patches that update multi_v7_defconfig with the enabled S/PDIF and APB DMA drivers. v3: - Renamed S/PDIF device-tree clocks as was suggested by Rob Herring. - Added r-bs and acks that were given by Rob Herring to v2. v2: - Corrected I2S yaml problem that was reported by the DT bot for v1 by removing the non-existent required clock-names property. - Removed assigned-clocks property from S/PDIF yaml since this property is now inherited from the clocks property. - Reordered the "tegra20: spdif: Set FIFO trigger level" patch, making it the first sound/soc patch in the series, like it was suggested by Mark Brown in the comment to v1. Also reworded commit message of this patch to *not* make it looks like it should be backported to stable kernels. Arnd Bergmann (1): ASoC: tegra20-spdif: stop setting slave_id Dmitry Osipenko (21): ASoC: dt-bindings: Add binding for Tegra20 S/PDIF ASoC: dt-bindings: tegra20-i2s: Convert to schema ASoC: dt-bindings: tegra20-i2s: Document new nvidia,fixed-parent-rate property dt-bindings: host1x: Document optional HDMI sound-dai-cells ASoC: tegra20: spdif: Set FIFO trigger level ASoC: tegra20: spdif: Support device-tree ASoC: tegra20: spdif: Improve driver's code ASoC: tegra20: spdif: Use more resource-managed helpers ASoC: tegra20: spdif: Reset hardware ASoC: tegra20: spdif: Support system suspend ASoC: tegra20: spdif: Filter out unsupported rates ASoC: tegra20: i2s: Filter out unsupported rates drm/tegra: hdmi: Unwind tegra_hdmi_init() errors drm/tegra: hdmi: Register audio CODEC on Tegra20 ARM: tegra_defconfig: Enable S/PDIF driver ARM: config: multi v7: Enable NVIDIA Tegra20 S/PDIF driver ARM: config: multi v7: Enable NVIDIA Tegra20 APB DMA driver ARM: tegra: Add S/PDIF node to Tegra20 device-tree ARM: tegra: Add HDMI audio graph to Tegra20 device-tree ARM: tegra: acer-a500: Enable S/PDIF and HDMI audio ARM: tegra: paz00: Enable S/PDIF and HDMI audio .../display/tegra/nvidia,tegra20-host1x.txt | 1 + .../bindings/sound/nvidia,tegra20-i2s.txt | 30 --- .../bindings/sound/nvidia,tegra20-i2s.yaml | 77 +++++++ .../bindings/sound/nvidia,tegra20-spdif.yaml | 85 ++++++++ .../boot/dts/tegra20-acer-a500-picasso.dts | 8 + arch/arm/boot/dts/tegra20-paz00.dts | 8 + arch/arm/boot/dts/tegra20.dtsi | 40 +++- arch/arm/configs/multi_v7_defconfig | 2 + arch/arm/configs/tegra_defconfig | 1 + drivers/gpu/drm/tegra/Kconfig | 3 + drivers/gpu/drm/tegra/hdmi.c | 168 +++++++++++++-- sound/soc/tegra/tegra20_i2s.c | 49 +++++ sound/soc/tegra/tegra20_spdif.c | 197 ++++++++++++------ sound/soc/tegra/tegra20_spdif.h | 1 + sound/soc/tegra/tegra_pcm.c | 6 + sound/soc/tegra/tegra_pcm.h | 1 + 16 files changed, 574 insertions(+), 103 deletions(-) delete mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra20-i2s.txt create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra20-i2s.yaml create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra20-spdif.yaml -- 2.33.1 commit a92c1cd33520a3e80caa6cea3113eb173a908141 Merge: f7c7ecaba4690 60ded273e4c04 Author: Mark Brown Date: Fri Dec 17 17:32:45 2021 +0000 ASoC: SOF: couple of cleanups Merge series from Pierre-Louis Bossart : Guennadi spotted inconsistencies with our 'const' handling, Ajit Kumar flagged a missing check for a null pointer and we missed the definition of debug zones. commit f7c7ecaba4690f8156ab4b049c53a121c154fda0 Merge: f04b4fb47d83b 35218cf61869c Author: Mark Brown Date: Fri Dec 17 17:32:44 2021 +0000 ASoC: SOF: remove suport for TRIGGER_RESUME Merge series from Pierre-Louis Bossart : None of the SOF platforms support INFO_RESUME, and rely on the indirect path used by the ALSA core with the prepare and TRIGGER_START steps. Let's remove the left-over dead code. commit 62480772263ab6b52e758f2346c70a526abd1d28 Author: Marek Behún Date: Tue Nov 9 17:46:04 2021 +0100 ARM: dts: armada-38x: Add generic compatible to UART nodes Add generic compatible string "ns16550a" to serial port nodes of Armada 38x. This makes it possible to use earlycon. Fixes: 0d3d96ab0059 ("ARM: mvebu: add Device Tree description of the Armada 380/385 SoCs") Signed-off-by: Pali Rohár Signed-off-by: Marek Behún Signed-off-by: Gregory CLEMENT commit 0734f8311ce72c9041e5142769eff2083889c172 Author: Robert Marko Date: Fri Nov 12 14:44:03 2021 +0100 arm64: dts: marvell: cn9130: enable CP0 GPIO controllers CN9130 has a built-in CP115 which has 2 GPIO controllers, but unlike in Armada 7k and 8k both are left disabled by the SoC DTSI. This first of all makes no sense as they are always present due to being SoC built-in and its an issue as boards like CN9130-CRB use the CPO GPIO2 pins for regulators and SD card support without enabling them first. So, enable both of them like Armada 7k and 8k do. Fixes: 6b8970bd8d7a ("arm64: dts: marvell: Add support for Marvell CN9130 SoC support") Signed-off-by: Robert Marko Signed-off-by: Gregory CLEMENT commit effd42600b987c1e95f946b14fefc1c7639e7439 Author: Robert Marko Date: Fri Nov 12 14:44:02 2021 +0100 arm64: dts: marvell: cn9130: add GPIO and SPI aliases CN9130 has one CP115 built in, which like the CP110 has 2 GPIO and 2 SPI controllers built-in. However, unlike the Armada 7k and 8k the SoC DTSI doesn't add the required aliases as both the Orion SPI driver and MVEBU GPIO drivers require the aliases to be present. So add the required aliases for GPIO and SPI controllers. Fixes: 6b8970bd8d7a ("arm64: dts: marvell: Add support for Marvell CN9130 SoC support") Signed-off-by: Robert Marko Signed-off-by: Gregory CLEMENT commit 73a78b6130d9e13daca22b86ad52f063b9403e03 Author: Pali Rohár Date: Wed Dec 8 03:40:35 2021 +0100 arm64: dts: marvell: armada-37xx: Add xtal clock to comphy node Kernel driver phy-mvebu-a3700-comphy.c needs to know the rate of the reference xtal clock. So add missing xtal clock source into comphy device tree node. If the property is not present, the driver defaults to 25 MHz xtal rate (which, as far as we know, is used by all the existing boards). Signed-off-by: Pali Rohár Signed-off-by: Marek Behún Signed-off-by: Gregory CLEMENT commit 35d544a273eafc3d00074973771ebaa7e358d0fd Author: Chris Packham Date: Mon Dec 6 11:56:18 2021 +1300 arm/arm64: dts: Add MV88E6393X to CN9130-CRB device tree The CN9130-CRB boards have a MV88E6393X switch connected to eth0. Add the necessary dts nodes and properties for this. Signed-off-by: Chris Packham Reviewed-by: Russell King (Oracle) Reviewed-by: Andrew Lunn Signed-off-by: Gregory CLEMENT commit 1f1cb308abc5272551b7db9c0d31733478f829bf Author: Chris Packham Date: Mon Dec 6 11:56:17 2021 +1300 arm/arm64: dts: Enable CP0 GPIOs for CN9130-CRB Enable the CP0 GPIO devices for the CN9130-CRB. This is needed for a number of the peripheral devices to function. Signed-off-by: Chris Packham Reviewed-by: Andrew Lunn Signed-off-by: Gregory CLEMENT commit 4b95391c8ef0f270ed58234597aef58976abe01c Author: Colin Ian King Date: Sun Dec 5 23:28:22 2021 +0000 serial: 8250_pci: remove redundant assignment to tmp after the mask operation The variable tmp is being masked with a bitmask and the value is being written to port base + 0x3c. However, the masked value is being written back to tmp and tmp is never used after this. The assignmentment is redundant, replace the &= operator with just &. Signed-off-by: Colin Ian King Reviewesd-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211205232822.110099-1-colin.i.king@gmail.com Signed-off-by: Greg Kroah-Hartman commit e5ce127e5f7bc0afee21e9363a2aa415c1a32a36 Author: Abel Vesa Date: Thu Dec 16 20:48:05 2021 +0200 dt-bindings: serial: fsl-lpuart: Fix i.MX 8QM compatible matching The i.MX 8QM DTS files use two compatibles, so update the binding to fix dtbs_check warnings like: arch/arm64/boot/dts/freescale/imx8qm-mek.dt.yaml: serial@5a060000: compatible: ['fsl,imx8qm-lpuart', 'fsl,imx8qxp-lpuart'] is too long Signed-off-by: Abel Vesa Acked-by: Rob Herring Link: https://lore.kernel.org/r/1639680494-23183-2-git-send-email-abel.vesa@nxp.com Signed-off-by: Greg Kroah-Hartman commit 443df57b31d14a920f23eaa265f4cb0dc3f94823 Author: Jesse Taube Date: Wed Dec 15 17:05:36 2021 -0500 tty: serial: fsl_lpuart: Add i.MXRT1050 support Add support for i.MXRT1050's uart. Cc: Giulio Benetti Signed-off-by: Jesse Taube Link: https://lore.kernel.org/r/20211215220538.4180616-8-Mr.Bossman075@gmail.com Signed-off-by: Greg Kroah-Hartman commit 9629eeb0b191f1b3f9f136f0ececd71994534be0 Author: Jesse Taube Date: Wed Dec 15 17:05:35 2021 -0500 dt-bindings: serial: fsl-lpuart: add i.MXRT1050 compatible Add i.MXRT1050 documentation for compatible string. Cc: Giulio Benetti Reviewed-by: Rob Herring Signed-off-by: Jesse Taube Link: https://lore.kernel.org/r/20211215220538.4180616-7-Mr.Bossman075@gmail.com Signed-off-by: Greg Kroah-Hartman commit 5bb221b0ad655b47a1b7601223feb7dbd9ac232e Author: Rob Herring Date: Wed Dec 15 16:48:31 2021 -0600 serial: atmel: Use platform_get_irq() to get the interrupt Accessing platform device resources directly has long been deprecated for DT as IRQ resources may not be available at device creation time. Drivers continuing to use static IRQ resources is blocking removing the static setup from the DT core code. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211215224832.1985402-1-robh@kernel.org Signed-off-by: Greg Kroah-Hartman commit 8a1dcae95c2ea4cb5d499833ad3c9a28f248ba7c Author: Geert Uytterhoeven Date: Thu Dec 16 15:17:34 2021 +0100 serial: sh-sci: Use devm_clk_get_optional() The sh-sci driver supports up to four input clocks, of which only the first one is mandatory. Replace devm_clk_get() and custom error checking by devm_clk_get_optional(), to simplify the code and to catch all real errors. Reviewed-by: Wolfram Sang Reviewed-by: Laurent Pinchart Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/bce27288cb570952dd96b441e1af8768ad8b4870.1639663832.git.geert+renesas@glider.be Signed-off-by: Greg Kroah-Hartman commit 0d1bc829a755de826582c1c48ec40601d9b2fc29 Author: Geert Uytterhoeven Date: Thu Dec 16 15:17:33 2021 +0100 serial: sh-sci: Use dev_err_probe() Use the dev_err_probe() helper to streamline error handling. Reviewed-by: Laurent Pinchart Reviewed-by: Wolfram Sang Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/5c4dd8df1f8d0d14786f26ee80b77f3eb8e06cd5.1639663832.git.geert+renesas@glider.be Signed-off-by: Greg Kroah-Hartman commit 09c7bda4ddefb1e326378e2aaf1e7814f850d750 Author: Geert Uytterhoeven Date: Thu Dec 16 15:17:32 2021 +0100 serial: sh-sci: Drop support for "sci_ick" clock Since commit 1b463bd51042927e ("ARM: dts: r8a7794: Rename the serial port clock to fck") in v4.6, all upstream DTS files call the SCIF functional clock "fck". Hence the time is ripe to drop backward-compatibility with old DTBs that use the old "sci_ick" name. Reviewed-by: Laurent Pinchart Reviewed-by: Wolfram Sang Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/b4103e44d6ac46b6c1c264e2aeac80b39941fe74.1639663832.git.geert+renesas@glider.be Signed-off-by: Greg Kroah-Hartman commit f087f01ca2c5ea846fb798f09f4106b551c32147 Author: Rob Herring Date: Wed Dec 15 16:48:00 2021 -0600 serial: lantiq: Use platform_get_irq() to get the interrupt Use the preferred platform_get_irq() call to retrieve the interrupts. These have the advantage of working with deferred probe and gets us one step closer to removing of_irq_to_resource_table(). Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211215224800.1984391-1-robh@kernel.org Signed-off-by: Greg Kroah-Hartman commit 26baf4b66c57596d7827a8e4f60a2d2b0401fe6e Author: Yoshihiro Shimoda Date: Thu Dec 9 16:08:17 2021 +0900 tty: serial: sh-sci: Add support for R-Car Gen4 Add serial support for R-Car Gen4 SoC. Reviewed-by: Geert Uytterhoeven Signed-off-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20211209070817.1223888-3-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Greg Kroah-Hartman commit 6aa7cee60c3e10c77240aad7136629f207005ee2 Author: Yoshihiro Shimoda Date: Thu Dec 9 16:08:16 2021 +0900 dt-bindings: serial: renesas,scif: Document r8a779f0 bindings R-Car S4-8 (R8A779F0) SoC has the R-Car Gen4 compatible SCIF ports, so document the SoC specific bindings. Reviewed-by: Geert Uytterhoeven Acked-by: Rob Herring Signed-off-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20211209070817.1223888-2-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Greg Kroah-Hartman commit 572a0a647b9b491729d24c083c8410c55bf16326 Author: Jarkko Sakkinen Date: Sat Dec 4 22:23:55 2021 +0200 selftests/sgx: Fix corrupted cpuid macro invocation The SGX selftest fails to build on tip/x86/sgx: main.c: In function ‘get_total_epc_mem’: main.c:296:17: error: implicit declaration of function ‘__cpuid’ [-Werror=implicit-function-declaration] 296 | __cpuid(&eax, &ebx, &ecx, &edx); | ^~~~~~~ Include cpuid.h and use __cpuid_count() macro in order to fix the compilation issue. [ dhansen: tweak commit message ] Fixes: f0ff2447b861 ("selftests/sgx: Add a new kselftest: Unclobbered_vdso_oversubscribed") Signed-off-by: Jarkko Sakkinen Signed-off-by: Dave Hansen Acked-by: Reinette Chatre Link: https://lkml.kernel.org/r/20211204202355.23005-1-jarkko@kernel.org Cc: Shuah Khan commit e1137bcefa025ec4c583e85d6c86c9ba11133224 Author: Tudor Ambarus Date: Wed Dec 15 15:43:11 2021 +0200 ARM: configs: at91: Enable crypto software implementations Enable at least the same amount of algs as the hardware IPs are supporting so that they are able to fallback to the software implementations in case they need it. Signed-off-by: Tudor Ambarus Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20211215134311.304427-1-tudor.ambarus@microchip.com commit 6dbe6c07f94f349098b512d88a1e1c5e2312b13d Author: Andy Shevchenko Date: Mon Dec 6 15:18:52 2021 +0200 gpio: Propagate firmware node from a parent device When creating MFD platform devices the firmware node is left unset. This, in particular, prevents GPIO library to use it for different purposes. Propagate firmware node from the parent device and let GPIO library do the right thing. Signed-off-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit 3b2e5d74e25fe6aae6e9427cdbdc2d82586ddc16 Author: Tudor Ambarus Date: Thu Dec 9 17:37:44 2021 +0200 ARM: configs: at91: sama7: Enable SPI NOR and QSPI controller sama7g5ek comes with a SPI NOR flash connected to the QSPI controller. Enable the SPI NOR subsystem and the QSPI controller. Signed-off-by: Tudor Ambarus Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20211209153744.357465-2-tudor.ambarus@microchip.com commit 45a541a610af8156ee623b5906515796405ae9f5 Author: Andy Shevchenko Date: Mon Dec 6 15:18:51 2021 +0200 gpio: Setup parent device and get rid of unnecessary of_node assignment Some of the drivers do not set parent device. This may lead to obstacles during debugging or understanding the device relations from the Linux point of view. Assign parent device for GPIO chips created by these drivers. While at it, let GPIO library to assign of_node from the parent device. Signed-off-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit 448cf90513d954ba5a61ce392809d6936902a9e6 Author: Andy Shevchenko Date: Fri Dec 17 17:39:35 2021 +0100 gpio: Get rid of duplicate of_node assignment in the drivers GPIO library does copy the of_node from the parent device of the GPIO chip, there is no need to repeat this in the individual drivers. Remove these assignment all at once. For the details one may look into the of_gpio_dev_init() implementation. While at it, remove duplicate parent device assignment where it is the case. Signed-off-by: Andy Shevchenko Reviewed-By: Matti Vaittinen Signed-off-by: Bartosz Golaszewski commit f04b4fb47d83b110a5b007fb2eddea862cfeb151 Author: Heiner Kallweit Date: Fri Dec 17 10:22:31 2021 +0100 ASoC: sh: rz-ssi: Check return value of pm_runtime_resume_and_get() The return value of pm_runtime_resume_and_get() needs to be checked to avoid a usage count imbalance in the error case. This fix is basically the same as 92c959bae2e5 ("reset: renesas: Fix Runtime PM usage"), and the last step before pm_runtime_resume_and_get() can be annotated as __must_check. Signed-off-by: Heiner Kallweit Link: https://lore.kernel.org/r/9fed506d-b780-55cd-45a4-9bd2407c910f@gmail.com Signed-off-by: Mark Brown commit dd73d18e7fc7adc7e70711ff2c92373ce8862c3f Author: Catalin Marinas Date: Fri Dec 17 16:20:45 2021 +0000 arm64: Ensure that the 'bti' macro is defined where linkage.h is included Not all .S files include asm/assembler.h, however the SYM_FUNC_* definitions invoke the 'bti' macro. Include asm/assembler.h in asm/linkage.h. Fixes: 9be34be87cc8 ("arm64: Add macro version of the BTI instruction") Signed-off-by: Catalin Marinas commit a62a02986d3990f4b55c2d75610f8fb2074b0870 Author: Cezary Rojewski Date: Thu Dec 16 12:57:41 2021 +0100 ASoC: Intel: catpt: Streamline locals declaration for PCM-functions Group all the catpt_xxx structs together in PCM related functions so they look more cohesive. Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20211216115743.2130622-4-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit dad492cfd24caf1b62d598555cde279bcca4755e Author: Cezary Rojewski Date: Thu Dec 16 12:57:40 2021 +0100 ASoC: Intel: catpt: Reduce size of catpt_component_open() With some improved if-logy, function's size can be reduced slightly. Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20211216115743.2130622-3-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit 2a9a72e290d4a4741e673f86b9fba9bfb319786d Author: Cezary Rojewski Date: Thu Dec 16 12:57:39 2021 +0100 ASoC: Intel: catpt: Test dmaengine_submit() result before moving on After calling dmaengine_submit(), the submitted transfer descriptor belongs to the DMA engine. Pointer to that descriptor may no longer be valid after the call and should be tested before awaiting transfer completion. Reported-by: Kevin Tian Suggested-by: Dave Jiang Fixes: 4fac9b31d0b9 ("ASoC: Intel: Add catpt base members") Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20211216115743.2130622-2-cezary.rojewski@intel.com Signed-off-by: Mark Brown commit 1b18af40c1db195619e611faaeae624d6319b1f1 Author: David Collins Date: Thu Dec 16 11:08:12 2021 -0800 spmi: spmi-pmic-arb: fix irq_set_type race condition The qpnpint_irq_set_type() callback function configures the type (edge vs level) and polarity (high, low, or both) of a particular PMIC interrupt within a given peripheral. To do this, it reads the three consecutive IRQ configuration registers, modifies the specified IRQ bit within the register values, and finally writes the three modified register values back to the PMIC. While a spinlock is used to provide mutual exclusion on the SPMI bus during the register read and write calls, there is no locking around the overall read, modify, write sequence. This opens up the possibility of a race condition if two tasks set the type of a PMIC IRQ within the same peripheral simultaneously. When the race condition is encountered, both tasks will read the old value of the registers and IRQ bits set by one of the tasks will be dropped upon the register write of the other task. This then leads to PMIC IRQs being enabled with an incorrect type and polarity configured. Such misconfiguration can lead to an IRQ storm that overwhelms the system and causes it to crash. This race condition and IRQ storm have been observed when using a pair of pm8941-pwrkey devices to handle PMK8350 pwrkey and resin interrupts. The independent devices probe asynchronously in parallel and can simultaneously request and configure PMIC IRQs in the same PMIC peripheral. For a good case, the IRQ configuration calls end up serialized due to timing deltas and the register read/write sequence looks like this: 1. pwrkey probe: SPMI read(0x1311): 0x00, 0x00, 0x00 2. pwrkey probe: SPMI write(0x1311): 0x80, 0x80, 0x80 3. resin probe: SPMI read(0x1311): 0x80, 0x80, 0x80 4. resin probe: SPMI write(0x1311): 0xC0, 0xC0, 0xC0 The final register states after both devices have requested and enabled their respective IRQs is thus: 0x1311: 0xC0 0x1312: 0xC0 0x1313: 0xC0 0x1314: 0x00 0x1315: 0xC0 For a bad case, the IRQ configuration calls end up occurring simultaneously and the race condition is encountered. The register read/write sequence then looks like this: 1. pwrkey probe: SPMI read(0x1311): 0x00, 0x00, 0x00 2. resin probe: SPMI read(0x1311): 0x00, 0x00, 0x00 3. pwrkey probe: SPMI write(0x1311): 0x80, 0x80, 0x80 4. resin probe: SPMI write(0x1311): 0x40, 0x40, 0x40 In this case, the final register states after both devices have requested and enabled their respective IRQs is thus: 0x1311: 0x40 0x1312: 0x40 0x1313: 0x40 0x1314: 0x00 0x1315: 0xC0 This corresponds to the resin IRQ being configured for both rising and falling edges, as expected. However, the pwrkey IRQ is misconfigured as level type with both polarity high and low set to disabled. The PMIC IRQ triggering hardware treats this particular register configuration as if level low triggering is enabled. The raw pwrkey IRQ signal is low when the power key is not being pressed. Thus, the pwrkey IRQ begins firing continuously in an IRQ storm. Fix the race condition by holding the spmi-pmic-arb spinlock for the duration of the read, modify, write sequence performed in the qpnpint_irq_set_type() function. Split the pmic_arb_read_cmd() and pmic_arb_write_cmd() functions each into three parts so that hardware register IO is decoupled from spinlock locking. This allows a new function pmic_arb_masked_write() to be added which locks the spinlock and then calls register IO functions to perform SPMI read and write commands in a single atomic operation. Link: https://lore.kernel.org/r/20211118034719.28971-1-quic_collinsd@quicinc.com Signed-off-by: David Collins Signed-off-by: Stephen Boyd Link: https://lore.kernel.org/r/20211216190812.1574801-7-sboyd@kernel.org Signed-off-by: Greg Kroah-Hartman commit 504eb71e4717ddfedd877d33fce684f3ab6d657c Author: James Lo Date: Thu Dec 16 11:08:11 2021 -0800 spmi: mediatek: Add support for MT8195 Add spmi support for MT8195. Refine indent in spmi-mtk-pmif.c. Link: https://lore.kernel.org/r/20211119034613.32489-5-james.lo@mediatek.com Acked-by: AngeloGioacchino Del Regno Signed-off-by: James Lo Signed-off-by: Henry Chen Signed-off-by: Hsin-Hsiung Wang Signed-off-by: Stephen Boyd Link: https://lore.kernel.org/r/20211216190812.1574801-6-sboyd@kernel.org Signed-off-by: Greg Kroah-Hartman commit b45b3ccef8c063d21eb746d85337eaf71f6b5f07 Author: James Lo Date: Thu Dec 16 11:08:10 2021 -0800 spmi: mediatek: Add support for MT6873/8192 Add spmi support for MT6873/8192. Refine indent in spmi-mtk-pmif.c. Link: https://lore.kernel.org/r/20211119034613.32489-4-james.lo@mediatek.com Acked-by: AngeloGioacchino Del Regno Signed-off-by: James Lo Signed-off-by: Hsin-Hsiung Wang Signed-off-by: Stephen Boyd Link: https://lore.kernel.org/r/20211216190812.1574801-5-sboyd@kernel.org Signed-off-by: Greg Kroah-Hartman commit 312644352f53a22f6f11f16481a4f23694650aba Author: James Lo Date: Thu Dec 16 11:08:09 2021 -0800 dt-bindings: spmi: document binding for the Mediatek SPMI controller This adds documentation for the SPMI controller found on Mediatek SoCs. Link: https://lore.kernel.org/r/20211119034613.32489-3-james.lo@mediatek.com Reviewed-by: Rob Herring Signed-off-by: James Lo Signed-off-by: Hsin-Hsiung Wang Signed-off-by: Stephen Boyd Link: https://lore.kernel.org/r/20211216190812.1574801-4-sboyd@kernel.org Signed-off-by: Greg Kroah-Hartman commit ef8261dce39503cddf1fe1f44578815df8ee4b2e Author: James Lo Date: Thu Dec 16 11:08:08 2021 -0800 dt-bindings: spmi: remove the constraint of reg property 'reg' is controller specific so we shouldn't even be specifying it here. Just remove it. Link: https://lore.kernel.org/r/20211119034613.32489-2-james.lo@mediatek.com Reviewed-by: Rob Herring Signed-off-by: James Lo Signed-off-by: Hsin-Hsiung Wang Signed-off-by: Stephen Boyd Link: https://lore.kernel.org/r/20211216190812.1574801-3-sboyd@kernel.org Signed-off-by: Greg Kroah-Hartman commit b56ca501a4112b568102e6f910ed3d5e32dde52c Author: Stephen Boyd Date: Thu Dec 16 11:08:07 2021 -0800 spmi: pmic-arb: Add sid and address to error messages It's useful to know what particular device/component is having trouble accessing the bus. Add the sid and address to error messages here so that debugging is a little simpler. Link: https://lore.kernel.org/r/20210920234849.3614036-1-swboyd@chromium.org Cc: Subbaraman Narayanamurthy Cc: satya priya Reviewed-by: Subbaraman Narayanamurthy Reviewed-by: Satya Priya Signed-off-by: Stephen Boyd Signed-off-by: Stephen Boyd Link: https://lore.kernel.org/r/20211216190812.1574801-2-sboyd@kernel.org Signed-off-by: Greg Kroah-Hartman commit 1dba0075fc3d2c2ae8503c3e213dc72a93e17761 Author: Thomas Perrot Date: Thu Dec 16 13:42:27 2021 +0530 bus: mhi: pci_generic: Introduce Sierra EM919X support Add support for EM919X modems, this modem series is based on SDX55 qcom chip. It is mandatory to use the same ring for control+data and diag events. Link: https://lore.kernel.org/r/20211123081541.648426-1-thomas.perrot@bootlin.com Tested-by: Aleksander Morgado Reviewed-by: Manivannan Sadhasivam Signed-off-by: Thomas Perrot Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20211216081227.237749-11-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit 5a717e93239fc373a314e03e45c43b62ebea1b26 Author: Kees Cook Date: Thu Dec 16 13:42:26 2021 +0530 bus: mhi: core: Use correctly sized arguments for bit field The find.h APIs are designed to be used only on unsigned long arguments. This can technically result in a over-read, but it is harmless in this case. Regardless, fix it to avoid the warning seen under -Warray-bounds, which we'd like to enable globally: In file included from ./include/linux/bitmap.h:9, 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 ./include/linux/debugfs.h:15, from drivers/bus/mhi/core/init.c:7: drivers/bus/mhi/core/init.c: In function 'to_mhi_pm_state_str': ./include/linux/find.h:187:37: warning: array subscript 'long unsigned int[0]' is partly outside array bounds of 'enum mhi_pm_state[1]' [-Warray-bounds] 187 | unsigned long val = *addr & GENMASK(size - 1, 0); | ^~~~~ drivers/bus/mhi/core/init.c:80:51: note: while referencing 'state' 80 | const char *to_mhi_pm_state_str(enum mhi_pm_state state) | ~~~~~~~~~~~~~~~~~~^~~~~ Link: https://lore.kernel.org/r/20211215232446.2069794-1-keescook@chromium.org [mani: changed the variable name "bits" to "pm_state"] Reviewed-by: Manivannan Sadhasivam Signed-off-by: Kees Cook Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20211216081227.237749-10-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit 227fee5fc99eeb74d43bf68832f6d59d30ac07d8 Author: Manivannan Sadhasivam Date: Thu Dec 16 13:42:25 2021 +0530 bus: mhi: core: Add an API for auto queueing buffers for DL channel Add a new API "mhi_prepare_for_transfer_autoqueue" for using with client drivers like QRTR to request MHI core to autoqueue buffers for the DL channel along with starting both UL and DL channels. So far, the "auto_queue" flag specified by the controller drivers in channel definition served this purpose but this will be removed at some point in future. Cc: netdev@vger.kernel.org Cc: Jakub Kicinski Cc: David S. Miller Cc: Greg Kroah-Hartman Co-developed-by: Loic Poulain Acked-by: Jakub Kicinski Signed-off-by: Loic Poulain Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20211216081227.237749-9-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit d651ce8e917fa1bf6cfab8dca74c512edffc35d3 Author: Manivannan Sadhasivam Date: Thu Dec 16 13:42:24 2021 +0530 bus: mhi: core: Fix race while handling SYS_ERR at power up During SYS_ERR condition, as a response to the MHI_RESET from host, some devices tend to issue BHI interrupt without clearing the SYS_ERR state in the device. This creates a race condition and causes a failure in booting up the device. The issue is seen on the Sierra Wireless EM9191 modem during SYS_ERR handling in mhi_async_power_up(). Once the host detects that the device is in SYS_ERR state, it issues MHI_RESET and waits for the device to process the reset request. During this time, the device triggers the BHI interrupt to the host without clearing SYS_ERR condition. So the host starts handling the SYS_ERR condition again. To fix this issue, let's register the IRQ handler only after handling the SYS_ERR check to avoid getting spurious IRQs from the device. Fixes: e18d4e9fa79b ("bus: mhi: core: Handle syserr during power_up") Cc: stable@vger.kernel.org Reported-by: Aleksander Morgado Tested-by: Aleksander Morgado Tested-by: Thomas Perrot Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20211216081227.237749-8-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit 42c4668f7efe1485dfc382517b412c0c6ab102b8 Author: Bhaumik Bhatt Date: Thu Dec 16 13:42:23 2021 +0530 bus: mhi: core: Fix reading wake_capable channel configuration The 'wake-capable' entry in channel configuration is not set when parsing the configuration specified by the controller driver. Add the missing entry to ensure channel is correctly specified as a 'wake-capable' channel. Link: https://lore.kernel.org/r/1638320491-13382-1-git-send-email-quic_bbhatt@quicinc.com Fixes: 0cbf260820fa ("bus: mhi: core: Add support for registering MHI controllers") Cc: stable@vger.kernel.org Reviewed-by: Manivannan Sadhasivam Signed-off-by: Bhaumik Bhatt Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20211216081227.237749-7-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit f3d13397365d834b3f882627a7962c76593eeef2 Author: Christophe JAILLET Date: Thu Dec 16 13:42:22 2021 +0530 bus: mhi: pci_generic: 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. Link: https://lore.kernel.org/r/bb3dc436fe142309a2334549db782c5ebb80a2be.1625718497.git.christophe.jaillet@wanadoo.fr Reviewed-by: Hemant Kumar Reviewed-by: Manivannan Sadhasivam Signed-off-by: Christophe JAILLET Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20211216081227.237749-6-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit 85ec6094624c413c2f87f49e8fffca60100915ff Author: Manivannan Sadhasivam Date: Thu Dec 16 13:42:21 2021 +0530 bus: mhi: core: Minor style and comment fixes This patch fixes the below checkpatch warnings in MHI bus: WARNING: Possible repeated word: 'events' + /* Process ctrl events events */ WARNING: Missing a blank line after declarations + struct mhi_buf_info info = { }; + buf = kmalloc(len, GFP_KERNEL); WARNING: Move const after static - use 'static const struct mhi_pm_transitions' +static struct mhi_pm_transitions const dev_state_transitions[] = { Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20211216081227.237749-5-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit 3e60c9f06803b52629d5c551ddbb5fddd60b8b65 Author: Bhaumik Bhatt Date: Thu Dec 16 13:42:20 2021 +0530 bus: mhi: core: Use macros for execution environment features The implementation for execution environment specific functionality is spread out. Use macros that help determine the paths to be taken. Link: https://lore.kernel.org/r/1636409978-31847-1-git-send-email-quic_bbhatt@quicinc.com Reviewed-by: Manivannan Sadhasivam Signed-off-by: Bhaumik Bhatt Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20211216081227.237749-4-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit f77097ec8c0141a4b5cf3722a246be0cb5677e29 Author: Loic Poulain Date: Thu Dec 16 13:42:19 2021 +0530 bus: mhi: pci_generic: Graceful shutdown on freeze There is no reason for shutting down MHI ungracefully on freeze, this causes the MHI host stack & device stack to not be aligned anymore since the proper MHI reset sequence is not performed for ungraceful shutdown. Link: https://lore.kernel.org/r/1635268180-13699-1-git-send-email-loic.poulain@linaro.org Fixes: 5f0c2ee1fe8d ("bus: mhi: pci-generic: Fix hibernation") Cc: stable@vger.kernel.org Suggested-by: Bhaumik Bhatt Reviewed-by: Bhaumik Bhatt Reviewed-by: Hemant Kumar Reviewed-by: Manivannan Sadhasivam Signed-off-by: Loic Poulain Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20211216081227.237749-3-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit c9825e66000508baf07260fb53540da8cffb3471 Author: Slark Xiao Date: Thu Dec 16 13:42:18 2021 +0530 bus: mhi: pci_generic: Add new device ID support for T99W175 Add new device ID 0xe0bf for T99W175. This device ID is created because it is using Qualcomm SDX55 new base line. Test evidence as below: root@jbd-ThinkPad-P1-Gen-4:/dev# lspci -nn | grep Foxconn 0000:08:00.0 Wireless controller [0d40]: Foxconn International, Inc. Device [105b:e0bf] root@jbd-ThinkPad-P1-Gen-4:/dev# cat wwan0at0 & echo -ne "ati\r" > wwan0at0 [2] 2977 root@jbd-ThinkPad-P1-Gen-4:/dev# ati Manufacturer: Qualcomm Model: T99W175 Revision: T99W175.F0.6.0.0.6.CC.005 1 [Oct 21 2021 10:00:00] IMEI: +GCAP: +CGSM OK Link: https://lore.kernel.org/r/20211029104918.3976-1-slark_xiao@163.com Reviewed-by: Manivannan Sadhasivam Signed-off-by: Slark Xiao Signed-off-by: Manivannan Sadhasivam Link: https://lore.kernel.org/r/20211216081227.237749-2-manivannan.sadhasivam@linaro.org Signed-off-by: Greg Kroah-Hartman commit 2577394f4b01906d345d8b223d1a17cc34e46b46 Merge: d5aeba456e666 3c21964407579 Author: Vinod Koul Date: Fri Dec 17 21:42:17 2021 +0530 Merge tag 'dmaengine_topic_slave_id_removal_5.17' into next Merge the tag dmaengine_topic_slave_id_removal_5.17 into next. This brings in the slave_id removal topic changes commit d5aeba456e666c6f2c01e8b4e5bba2affabcdd09 Author: Christophe JAILLET Date: Tue Nov 23 22:26:18 2021 +0100 dmaengine: sh: Use bitmap_zalloc() when applicable 'shdma_slave_used' is a bitmap. So use 'bitmap_zalloc()' to simplify code, improve the semantic and avoid some open-coded arithmetic in allocator arguments. Also change the corresponding 'kfree()' into 'bitmap_free()' to keep consistency. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/3efaf2784424ae3d7411dc47f8b6b03e7bb8c059.1637702701.git.christophe.jaillet@wanadoo.fr Signed-off-by: Vinod Koul commit de8f2c05754a7df12634c73640a162a610795a80 Author: Geert Uytterhoeven Date: Mon Nov 22 16:54:04 2021 +0100 dmaengine: stm32-mdma: Use bitfield helpers Use the FIELD_{GET,PREP}() helpers, instead of defining custom macros implementing the same operations. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/36ceab242a594233dc7dc6f1dddb4ac32d1e846f.1637593297.git.geert+renesas@glider.be Signed-off-by: Vinod Koul commit d697e83125950f64210b267d5c9c13fa7e4a43b9 Author: Colin Ian King Date: Sat Dec 4 14:00:32 2021 +0000 dmaengine: stm32-mdma: Remove redundant initialization of pointer hwdesc The pointer hwdesc is being initialized with a value that is never read, it is being updated later in a for-loop. The assignment is redundant and can be removed. Signed-off-by: Colin Ian King Reviewed-by: Amelie Delaunay Link: https://lore.kernel.org/r/20211204140032.548066-1-colin.i.king@gmail.com Signed-off-by: Vinod Koul commit 7930d85535751bc8b05c6731c6b79d874671f13c Author: Dave Jiang Date: Mon Nov 29 10:19:38 2021 -0700 dmaengine: idxd: add knob for enqcmds retries Add a sysfs knob to allow tuning of retries for the kernel ENQCMDS descriptor submission. While on host, it is not as likely that ENQCMDS return busy during normal operations due to the driver controlling the number of descriptors allocated for submission. However, when the driver is operating as a guest driver, the chance of retry goes up significantly due to sharing a wq with multiple VMs. A default value is provided with the system admin being able to tune the value on a per WQ basis. Suggested-by: Sanjay Kumar Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/163820629464.2702134.7577370098568297574.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 92452a72ebdf1225aa37690d3648f2af6d0b4fca Author: Dave Jiang Date: Tue Oct 26 14:45:34 2021 -0700 dmaengine: idxd: set defaults for wq configs Add default values for wq size, max_xfer_size and max_batch_size. These values should provide a general guidance for the wq configuration when the user does not specify any specific values. Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/163528473483.3926048.7950067926287180976.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 0f93f2047d56d6ab93ba1ffeb30d318d0c5f52d7 Author: Geert Uytterhoeven Date: Thu Nov 25 16:20:08 2021 +0100 dt-bindings: dma: snps,dw-axi-dmac: Document optional reset "make dtbs_check": Documentation/devicetree/bindings/dma/snps,dw-axi-dmac.yaml arch/riscv/boot/dts/canaan/sipeed_maix_bit.dt.yaml: dma-controller@50000000: 'resets' does not match any of the regexes: 'pinctrl-[0-9]+' From schema: Documentation/devicetree/bindings/dma/snps,dw-axi-dmac.yaml The Synopsys DesignWare AXI DMA Controller on the Canaan K210 SoC exposes its reset signal. Signed-off-by: Geert Uytterhoeven Acked-by: Rob Herring Reviewed-by: Damien Le Moal Link: https://lore.kernel.org/r/20211125152008.162571-1-geert@linux-m68k.org Signed-off-by: Vinod Koul commit 76a096637d6381165584c6e9a21e531d1911c549 Author: Paul Cercueil Date: Mon Dec 6 17:42:59 2021 +0000 dmaengine: jz4780: Support bidirectional I/O on one channel For some devices with only half-duplex capabilities, it doesn't make much sense to use one DMA channel per direction, as both channels will never be active at the same time. Add support for bidirectional I/O on DMA channels. The client drivers can then request a "tx-rx" DMA channel which will be used for both directions. Signed-off-by: Paul Cercueil Link: https://lore.kernel.org/r/20211206174259.68133-7-paul@crapouillou.net Signed-off-by: Vinod Koul commit c8c0cda827b90aad250360c657b30b2bcdf82503 Author: Paul Cercueil Date: Mon Dec 6 17:42:58 2021 +0000 dmaengine: jz4780: Replace uint32_t with u32 Replace the uint32_t type used all over dma-jz4780.c with the equivalent Linux type: u32. Signed-off-by: Paul Cercueil Link: https://lore.kernel.org/r/20211206174259.68133-6-paul@crapouillou.net Signed-off-by: Vinod Koul commit 3d70fccf74feba4125542663ff49b4d42d3dcbe7 Author: Paul Cercueil Date: Mon Dec 6 17:42:57 2021 +0000 dmaengine: jz4780: Add support for the MDMA and BDMA in the JZ4760(B) The JZ4760 and JZ4760B SoCs have two regular DMA controllers with 6 channels each. They also have an extra DMA controller named MDMA with only 2 channels, that only supports memcpy operations, and one named BDMA with only 3 channels, that is mostly used for transfers between memories and the BCH controller. Signed-off-by: Paul Cercueil Link: https://lore.kernel.org/r/20211206174259.68133-5-paul@crapouillou.net Signed-off-by: Vinod Koul commit b72cbb1ab2aff3ceef8a2703052d06dc216b01f0 Author: Paul Cercueil Date: Mon Dec 6 17:42:56 2021 +0000 dmaengine: jz4780: Work around hardware bug on JZ4760 SoCs The JZ4760 SoC has a hardware problem with chan0 not enabling properly if it's enabled before chan1, after a reset (works fine afterwards). This is worked around in the probe function by just enabling then disabling chan1. Signed-off-by: Paul Cercueil Link: https://lore.kernel.org/r/20211206174259.68133-4-paul@crapouillou.net Signed-off-by: Vinod Koul commit dafa79a10ed70683811295cb68deca2d30c22ef4 Author: Paul Cercueil Date: Mon Dec 6 17:42:55 2021 +0000 dt-bindings: dma: ingenic: Support #dma-cells = <3> Extend the binding to support specifying a different request type for each direction. Signed-off-by: Paul Cercueil Link: https://lore.kernel.org/r/20211206174259.68133-3-paul@crapouillou.net Signed-off-by: Vinod Koul commit e0699a75955dabac1e2edcf67d74b9998fe9d42c Author: Paul Cercueil Date: Mon Dec 6 17:42:54 2021 +0000 dt-bindings: dma: ingenic: Add compatible strings for MDMA and BDMA The JZ4760 and JZ4760B SoCs have two additional DMA controllers: the MDMA, which only supports memcpy operations, and the BDMA which is mostly used for transfer between memories and the BCH controller. The JZ4770 also features the same BDMA as in the JZ4760B, but does not seem to have a MDMA. Signed-off-by: Paul Cercueil Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211206174259.68133-2-paul@crapouillou.net Signed-off-by: Vinod Koul commit 5f1e024c9d07d09988757761107ba4bb1ae7d408 Author: Rob Herring Date: Mon Dec 6 11:42:26 2021 -0600 dt-bindings: dma: ti: Add missing ti,k3-sci-common.yaml reference The TI k3-bcdma and k3-pktdma both use 'ti,sci' and 'ti,sci-dev-id' properties defined in ti,k3-sci-common.yaml. When 'unevaluatedProperties' support is enabled, the follow warning is generated: Documentation/devicetree/bindings/dma/ti/k3-bcdma.example.dt.yaml: dma-controller@485c0100: Unevaluated properties are not allowed ('ti,sci', 'ti,sci-dev-id' were unexpected) Documentation/devicetree/bindings/dma/ti/k3-pktdma.example.dt.yaml: dma-controller@485c0000: Unevaluated properties are not allowed ('ti,sci', 'ti,sci-dev-id' were unexpected) Add a reference to ti,k3-sci-common.yaml to fix this. Cc: Peter Ujfalusi Cc: Vinod Koul Cc: dmaengine@vger.kernel.org Signed-off-by: Rob Herring Reviewed-by: Thierry Reding Link: https://lore.kernel.org/r/20211206174226.2298135-1-robh@kernel.org Signed-off-by: Vinod Koul commit a173a2428752b43f50dc2cd500437baff6a62376 Author: Rob Herring Date: Mon Dec 6 11:42:31 2021 -0600 dt-bindings: dma: pl08x: Fix unevaluatedProperties warnings With 'unevaluatedProperties' support implemented, the example has warnings on primecell properties and 'resets': Documentation/devicetree/bindings/dma/arm-pl08x.example.dt.yaml: dma-controller@67000000: Unevaluated properties are not allowed ('arm,primecell-periphid', 'resets' were unexpected) Add the missing reference to primecell.yaml and definition for 'resets'. Cc: Vinod Koul Cc: dmaengine@vger.kernel.org Signed-off-by: Rob Herring Reviewed-by: Thierry Reding Link: https://lore.kernel.org/r/20211206174231.2298349-1-robh@kernel.org Signed-off-by: Vinod Koul commit 78b2f63cd0cc115ea10711b59734c7430deb3fe3 Author: Aswath Govindraju Date: Fri Nov 19 18:53:14 2021 +0530 drivers: dma: ti: k3-psil: Add support for J721S2 Add support for J721S2 SOC. Signed-off-by: Aswath Govindraju Acked-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20211119132315.15901-3-a-govindraju@ti.com Signed-off-by: Vinod Koul commit 839c2e2371dba08fc3a8aea5d5e6525dd19cab66 Author: Aswath Govindraju Date: Fri Nov 19 18:53:13 2021 +0530 dmaengine: ti: k3-udma: Add SoC dependent data for J721S2 SoC Add SYSFW defined rchan_oes_offset number for J721S2 SoC in soc data. Signed-off-by: Aswath Govindraju Acked-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20211119132315.15901-2-a-govindraju@ti.com Signed-off-by: Vinod Koul commit aa8ff35e10030c12df9f1b4a364f540f973c620f Author: Gustavo A. R. Silva Date: Tue Dec 7 18:10:13 2021 -0600 dmaengine: at_xdmac: Use struct_size() in devm_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. Link: https://github.com/KSPP/linux/issues/160 Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20211208001013.GA62330@embeddedor Signed-off-by: Vinod Koul commit f17e53388e82ebefc78ff53e33a6d8eebc1ad337 Author: Lars-Peter Clausen Date: Wed Dec 8 12:42:12 2021 +0100 dmaengine: xilinx: Handle IRQ mapping errors Handle errors when trying to map the IRQ for the DMA channels. The main motivation here is to be able to handle probe deferral. E.g. when using DT overlays it is possible that the DMA controller is probed before interrupt controller, depending on the order in the DT. In order to support this switch from irq_of_parse_and_map() to of_irq_get(), which internally does the same, but it will return EPROBE_DEFER when the interrupt controller is not yet available. As a result other errors, such as an invalid IRQ specification, or missing IRQ are also properly handled. Signed-off-by: Lars-Peter Clausen Reviewed-by: Radhey Shyam Pandey Link: https://lore.kernel.org/r/20211208114212.234130-1-lars@metafoo.de Signed-off-by: Vinod Koul commit f2b42379c57682d4b127283da109fa1a3317966a Author: Razvan Heghedus Date: Mon Dec 13 20:36:15 2021 +0200 usb: misc: ehset: Rework test mode entry The USB2.0 spec chapter 11.24.2.13 says that the USB port which is going under test needs to be put in suspend state before sending the test command. Many hubs, don't enforce this precondition and they work fine without this step. We should follow the specification and put the USB port in suspend before sending the test command. Also there are some "special" hubs, which requires to disable the USB port power instead of putting it in suspend. I found out only three hubs which requires this step, but if more are found, they can be added to the list. Since this changes the default implementation, it raises the posibility of finding other broken hubs which are not compliant with the spec and the test command might not work is the port is suspended. If such hubs are found, a similar workaround like the disable part can be implemented to skip putting the port in suspend. Signed-off-by: Razvan Heghedus Link: https://lore.kernel.org/r/20211213183617.14156-2-heghedus.razvan@gmail.com Signed-off-by: Greg Kroah-Hartman commit b1e9e7ebe6c0b1b200d51ef21ad09652bb65c4b4 Author: Razvan Heghedus Date: Mon Dec 13 20:36:14 2021 +0200 usb: core: Export usb_device_match_id Export usb_device_match_id so that it can be used for easily matching an usb_device with a table of IDs. Signed-off-by: Razvan Heghedus Link: https://lore.kernel.org/r/20211213183617.14156-1-heghedus.razvan@gmail.com Signed-off-by: Greg Kroah-Hartman commit cf081d009c447647c6b36aced535ca427dbebe72 Author: Rob Herring Date: Wed Dec 15 17:07:57 2021 -0600 usb: musb: Set the DT node on the child device The musb glue drivers just copy the glue resources to the musb child device. Instead, set the musb child device's DT node pointer to the parent device's node so that platform_get_irq_byname() can find the resources in the DT. This removes the need for statically populating the IRQ resources from the DT which has been deprecated for some time. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211215230756.2009115-3-robh@kernel.org Signed-off-by: Greg Kroah-Hartman commit 9879c81b680795b45a11894e48dfa9e4be2f4426 Author: Rob Herring Date: Wed Dec 15 17:07:56 2021 -0600 usb: musb: Drop unneeded resource copying The platform device resources are copied by the driver core, so there is no need for the caller to do it when creating a platform device. Just pass the parent resources to the child device directly. Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211215230756.2009115-2-robh@kernel.org Signed-off-by: Greg Kroah-Hartman commit 4de5bd9a389d886d2f58ad15512f476ffc7d639d Author: Sergey Shtylyov Date: Tue Dec 14 23:42:47 2021 +0300 usb: host: ohci-omap: propagate errors from platform_get_irq() The driver overrides the error codes returned by platform_get_irq() to -ENXIO for some strange reason. Switch to propagating the error codes upstream. Acked-by: Alan Stern Signed-off-by: Sergey Shtylyov Link: https://lore.kernel.org/r/20211214204247.7172-5-s.shtylyov@omp.ru Signed-off-by: Greg Kroah-Hartman commit 1aebf115afd730d1e0f773b8273b04b8681e1128 Author: Sergey Shtylyov Date: Tue Dec 14 23:42:46 2021 +0300 usb: host: ehci-sh: propagate errors from platform_get_irq() The driver overrides the error codes and IRQ0 returned by platform_get_irq() to -ENODEV. Switch to propagating the error codes upstream. IRQ0 is no longer returned by platform_get_irq(), so we now can safely ignore it... Acked-by: Alan Stern Signed-off-by: Sergey Shtylyov Link: https://lore.kernel.org/r/20211214204247.7172-4-s.shtylyov@omp.ru Signed-off-by: Greg Kroah-Hartman commit 12ba912c30477481cb50158bc5ca0318f41a1762 Author: Sergey Shtylyov Date: Tue Dec 14 23:42:45 2021 +0300 usb: gadget: udc: pxa25x: propagate errors from platform_get_irq() The driver overrides the error codes returned by platform_get_irq() to -ENODEV for some strange reason. Switch to propagating the error codes upstream. Acked-by: Daniel Mack Signed-off-by: Sergey Shtylyov Link: https://lore.kernel.org/r/20211214204247.7172-3-s.shtylyov@omp.ru Signed-off-by: Greg Kroah-Hartman commit 4c71960105b4ad74bf0c30d0c9a40cf263e814ea Author: Sergey Shtylyov Date: Tue Dec 14 23:42:44 2021 +0300 usb: gadget: udc: bcm63xx: propagate errors from platform_get_irq() The driver overrides the error codes returned by platform_get_irq() to -ENXIO for some strange reason. Switch to propagating the error codes upstream. Acked-by: Florian Fainelli Signed-off-by: Sergey Shtylyov Link: https://lore.kernel.org/r/20211214204247.7172-2-s.shtylyov@omp.ru Signed-off-by: Greg Kroah-Hartman commit 1646566b5e0c556f779180a8514e521ac735de1e Author: Wei Yongjun Date: Fri Dec 17 16:34:28 2021 +0800 usb: ftdi-elan: fix memory leak on device disconnect 'ftdi' is alloced when probe device, but not free on device disconnect, this cause a memory leak as follows: unreferenced object 0xffff88800d584000 (size 8400): comm "kworker/0:2", pid 3809, jiffies 4295453055 (age 13.784s) hex dump (first 32 bytes): 00 40 58 0d 80 88 ff ff 00 40 58 0d 80 88 ff ff .@X......@X..... 00 00 00 00 00 00 00 00 00 00 00 00 ad 4e ad de .............N.. backtrace: [<000000000d47f947>] kmalloc_order_trace+0x19/0x110 mm/slab_common.c:960 [<000000008548ac68>] ftdi_elan_probe+0x8c/0x880 drivers/usb/misc/ftdi-elan.c:2647 [<000000007f73e422>] usb_probe_interface+0x31b/0x800 drivers/usb/core/driver.c:396 [<00000000fe8d07fc>] really_probe+0x299/0xc30 drivers/base/dd.c:517 [<0000000005da7d32>] __driver_probe_device+0x357/0x500 drivers/base/dd.c:751 [<000000003c2c9579>] driver_probe_device+0x4e/0x140 drivers/base/dd.c:781 Fix it by freeing 'ftdi' after nobody use it. Fixes: a5c66e4b2418 ("USB: ftdi-elan: client driver for ELAN Uxxx adapters") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun Link: https://lore.kernel.org/r/20211217083428.2441-1-weiyongjun1@huawei.com Signed-off-by: Greg Kroah-Hartman commit 00558586382891540c59c9febc671062425a6e47 Author: Kai-Heng Feng Date: Wed Dec 15 20:01:06 2021 +0800 usb: hub: Add delay for SuperSpeed hub resume to let links transit to U0 When a new USB device gets plugged to nested hubs, the affected hub, which connects to usb 2-1.4-port2, doesn't report there's any change, hence the nested hubs go back to runtime suspend like nothing happened: [ 281.032951] usb usb2: usb wakeup-resume [ 281.032959] usb usb2: usb auto-resume [ 281.032974] hub 2-0:1.0: hub_resume [ 281.033011] usb usb2-port1: status 0263 change 0000 [ 281.033077] hub 2-0:1.0: state 7 ports 4 chg 0000 evt 0000 [ 281.049797] usb 2-1: usb wakeup-resume [ 281.069800] usb 2-1: Waited 0ms for CONNECT [ 281.069810] usb 2-1: finish resume [ 281.070026] hub 2-1:1.0: hub_resume [ 281.070250] usb 2-1-port4: status 0203 change 0000 [ 281.070272] usb usb2-port1: resume, status 0 [ 281.070282] hub 2-1:1.0: state 7 ports 4 chg 0010 evt 0000 [ 281.089813] usb 2-1.4: usb wakeup-resume [ 281.109792] usb 2-1.4: Waited 0ms for CONNECT [ 281.109801] usb 2-1.4: finish resume [ 281.109991] hub 2-1.4:1.0: hub_resume [ 281.110147] usb 2-1.4-port2: status 0263 change 0000 [ 281.110234] usb 2-1-port4: resume, status 0 [ 281.110239] usb 2-1-port4: status 0203, change 0000, 10.0 Gb/s [ 281.110266] hub 2-1.4:1.0: state 7 ports 4 chg 0000 evt 0000 [ 281.110426] hub 2-1.4:1.0: hub_suspend [ 281.110565] usb 2-1.4: usb auto-suspend, wakeup 1 [ 281.130998] hub 2-1:1.0: hub_suspend [ 281.137788] usb 2-1: usb auto-suspend, wakeup 1 [ 281.142935] hub 2-0:1.0: state 7 ports 4 chg 0000 evt 0000 [ 281.177828] usb 2-1: usb wakeup-resume [ 281.197839] usb 2-1: Waited 0ms for CONNECT [ 281.197850] usb 2-1: finish resume [ 281.197984] hub 2-1:1.0: hub_resume [ 281.198203] usb 2-1-port4: status 0203 change 0000 [ 281.198228] usb usb2-port1: resume, status 0 [ 281.198237] hub 2-1:1.0: state 7 ports 4 chg 0010 evt 0000 [ 281.217835] usb 2-1.4: usb wakeup-resume [ 281.237834] usb 2-1.4: Waited 0ms for CONNECT [ 281.237845] usb 2-1.4: finish resume [ 281.237990] hub 2-1.4:1.0: hub_resume [ 281.238067] usb 2-1.4-port2: status 0263 change 0000 [ 281.238148] usb 2-1-port4: resume, status 0 [ 281.238152] usb 2-1-port4: status 0203, change 0000, 10.0 Gb/s [ 281.238166] hub 2-1.4:1.0: state 7 ports 4 chg 0000 evt 0000 [ 281.238385] hub 2-1.4:1.0: hub_suspend [ 281.238523] usb 2-1.4: usb auto-suspend, wakeup 1 [ 281.258076] hub 2-1:1.0: hub_suspend [ 281.265744] usb 2-1: usb auto-suspend, wakeup 1 [ 281.285976] hub 2-0:1.0: hub_suspend [ 281.285988] usb usb2: bus auto-suspend, wakeup 1 USB 3.2 spec, 9.2.5.4 "Changing Function Suspend State" says that "If the link is in a non-U0 state, then the device must transition the link to U0 prior to sending the remote wake message", but the hub only transits the link to U0 after signaling remote wakeup. So be more forgiving and use a 20ms delay to let the link transit to U0 for remote wakeup. Suggested-by: Alan Stern Acked-by: Alan Stern Signed-off-by: Kai-Heng Feng Link: https://lore.kernel.org/r/20211215120108.336597-1-kai.heng.feng@canonical.com Signed-off-by: Greg Kroah-Hartman commit 29b4dd308af693857eff0c2d9d5b3ce25c1f9a63 Author: Luca Weiss Date: Mon Dec 13 09:26:07 2021 +0100 dt-bindings: usb: qcom,dwc3: Add SM6350 compatible Add devicetree compatible for dwc3 on SM6350 SoC. Signed-off-by: Luca Weiss Acked-by: Konrad Dybcio Acked-by: Rob Herring Link: https://lore.kernel.org/r/20211213082614.22651-7-luca.weiss@fairphone.com Signed-off-by: Greg Kroah-Hartman commit 3ad02e0e524117d019417b88715c69802ec9c5e0 Author: Fabrice Gasnier Date: Mon Dec 6 16:56:43 2021 +0100 usb: dwc2: drd: restore role and overrides upon resume Override enable bits may not be restored when going to low power mode (e.g. when in DWC2_POWER_DOWN_PARAM_NONE). These bits are set when probing/initializing drd (role switch). Restore them upon resume from low power mode (in case these have been lost). To achieve this, the last known role is restored upon resume. And the override enable bits are always set when configuring aval, bval and vbval. When resuming, forcing the role should be done only once, or this can cause port changes in HOST mode for instance. So, only restore FORCEDEVMODE/FORCEHOSTMODE when role_sw is unused Acked-by: Minas Harutyunyan Signed-off-by: Fabrice Gasnier Link: https://lore.kernel.org/r/1638806203-6624-4-git-send-email-fabrice.gasnier@foss.st.com Signed-off-by: Greg Kroah-Hartman commit e14acb8769850fedfbfc62a64998e34348442784 Author: Fabrice Gasnier Date: Mon Dec 6 16:56:42 2021 +0100 usb: dwc2: drd: add role-switch-default-node support When using usb-role-switch, while the usb role is not yet define (USB_ROLE_NONE), the user may want to configure the default mode to host or device. Use role-switch-default-mode for that purpose. Acked-by: Minas Harutyunyan Signed-off-by: Amelie Delaunay Signed-off-by: Fabrice Gasnier Link: https://lore.kernel.org/r/1638806203-6624-3-git-send-email-fabrice.gasnier@foss.st.com Signed-off-by: Greg Kroah-Hartman commit 942cdbc168d44730c5b3349198b16b4d6da3bb81 Author: Fabrice Gasnier Date: Mon Dec 6 16:56:41 2021 +0100 dt-bindings: usb: document role-switch-default-mode property in dwc2 role-switch-default-mode property may be used with usb-role-switch property to define the default operation mode (by forcing the a-valid or b-valid) at init. Reviewed-by: Rob Herring Signed-off-by: Amelie Delaunay Signed-off-by: Fabrice Gasnier Link: https://lore.kernel.org/r/1638806203-6624-2-git-send-email-fabrice.gasnier@foss.st.com Signed-off-by: Greg Kroah-Hartman commit d538ea945532d0d3bd04192543b285e6979d9e8f Author: Lukas Bulwahn Date: Thu Dec 16 07:55:47 2021 +0100 MAINTAINERS: remove typo from XEN PVUSB DRIVER section Commit a92548f90fa6 ("xen: add Xen pvUSB maintainer") adds the new XEN PVUSB DRIVER section, but one file entry contains an obvious typo. Fortunately, ./scripts/get_maintainer.pl --self-test=patterns warns: warning: no file matches F: divers/usb/host/xen* Remove this obvious typo. Reviewed-by: Juergen Gross Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20211216065547.18619-1-lukas.bulwahn@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0f153a1b8193ce768be4df0400aeb2c8f2a3b3da Author: Rob Herring Date: Wed Dec 15 16:56:46 2021 -0600 usb: chipidea: Set the DT node on the child device The ChipIdea glue drivers just copy the glue resources to the "ci_hdrc" child device. Instead, set the child device's DT node pointer to the parent device's node so that platform_get_irq() can find the IRQ resources in the DT. This removes the need for statically populating the IRQ resources from the DT which has been deprecated for some time. Acked-by: Peter Chen Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211215225646.1997946-1-robh@kernel.org Signed-off-by: Greg Kroah-Hartman commit e1ffd5f0709de8a423925a60d1e4b3593e0c96b4 Author: Rob Herring Date: Wed Dec 15 16:52:03 2021 -0600 usb: uhci: Use platform_get_irq() to get the interrupt Accessing platform device resources directly has long been deprecated for DT as IRQ resources may not be available at device creation time. Drivers continuing to use static IRQ resources is blocking removing the static setup from the DT core code. Acked-by: Alan Stern Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211215225203.1991003-1-robh@kernel.org Signed-off-by: Greg Kroah-Hartman commit b6886c7826a17eaa908d7bae1537812bb78eb9fe Author: Rob Herring Date: Wed Dec 15 16:53:57 2021 -0600 usb: ohci-s3c2410: Use platform_get_irq() to get the interrupt Accessing platform device resources directly has long been deprecated for DT as IRQ resources may not be available at device creation time. Drivers relying on the static IRQ resources is blocking removing the static setup from the DT core code. Reviewed-by: Krzysztof Kozlowski Acked-by: Alan Stern Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211215225358.1993774-1-robh@kernel.org Signed-off-by: Greg Kroah-Hartman commit 2dec70f18b914a3108ab656417c4a0b77fdea2cf Author: Rob Herring Date: Wed Dec 15 16:55:09 2021 -0600 usb: ohci-spear: Remove direct access to platform_device resource list The memory resource is already retrieved with platform_get_resource(), so let's use it instead of assuming it is the first resource in the array. Acked-by: Alan Stern Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211215225509.1995417-1-robh@kernel.org Signed-off-by: Greg Kroah-Hartman commit d6bfc848af12b32591e59aff58d5bfbd00d80b0c Author: Vinod Koul Date: Thu Dec 16 17:08:49 2021 +0530 dt-bindings: usb: qcom,dwc3: add binding for SM8450 Add the compatible string for USB controller for Qualcomm SM8450 SoC. Acked-by: Rob Herring Signed-off-by: Vinod Koul Link: https://lore.kernel.org/r/20211216113849.659856-1-vkoul@kernel.org Signed-off-by: Greg Kroah-Hartman commit 521223d8b3ec078f670c7c35a1a04b1b2af07966 Author: Rafael J. Wysocki Date: Thu Dec 16 20:32:15 2021 +0100 cpufreq: Fix initialization of min and max frequency QoS requests The min and max frequency QoS requests in the cpufreq core are initialized to whatever the current min and max frequency values are at the init time, but if any of these values change later (for example, cpuinfo.max_freq is updated by the driver), these initial request values will be limiting the CPU frequency unnecessarily unless they are changed by user space via sysfs. To address this, initialize min_freq_req and max_freq_req to FREQ_QOS_MIN_DEFAULT_VALUE and FREQ_QOS_MAX_DEFAULT_VALUE, respectively, so they don't really limit anything until user space updates them. Reported-by: Srinivas Pandruvada Tested-by: Srinivas Pandruvada Signed-off-by: Rafael J. Wysocki commit b6e6f8beec98ba7541213c506fe908517fdc52b8 Author: Srinivas Pandruvada Date: Thu Dec 16 10:33:05 2021 -0800 cpufreq: intel_pstate: Update EPP for AlderLake mobile There is an expectation from users that they can get frequency specified by cpufreq/cpuinfo_max_freq when conditions permit. But with AlderLake mobile it may not be possible. This is possible that frequency is clipped based on the system power-up EPP value. In this case users can update cpufreq/energy_performance_preference to some performance oriented EPP to limit clipping of frequencies. To get out of box behavior as the prior generations of CPUs, update EPP for AlderLake mobile CPUs on boot. On prior generations of CPUs EPP = 128 was enough to get maximum frequency, but with AlderLake mobile the equivalent EPP is 102. Since EPP is model specific, this is possible that they have different meaning on each generation of CPU. The current EPP string "balance_performance" corresponds to EPP = 128. Change the EPP corresponding to "balance_performance" to 102 for only AlderLake mobile CPUs and update this on each CPU during boot. To implement reuse epp_values[] array and update the modified EPP at the index for BALANCE_PERFORMANCE. Add a dummy EPP_INDEX_DEFAULT to epp_values[] to match indexes in the energy_perf_strings[]. After HWP PM is enabled also update EPP when "balance_performance" is redefined for the very first time after the boot on each CPU. On subsequent suspend/resume or offline/online the old EPP is restored, so no specific action is needed. Signed-off-by: Srinivas Pandruvada Signed-off-by: Rafael J. Wysocki commit 58fa0d90eddeda37b32597eda139e888ebe5af04 Author: Zack Rusin Date: Wed Dec 15 15:02:24 2021 -0500 drm/vmwgfx: Fix possible usage of an uninitialized variable vmw_user_bo_lookup can fail to lookup user buffers, especially because the buffer handles come from the userspace. The return value has to be checked before the buffers are put back. This was spotted by Dan's Smatch statick checker: drivers/gpu/drm/vmwgfx/vmwgfx_bo.c:574 vmw_user_bo_synccpu_release() error: uninitialized symbol 'vmw_bo'. Signed-off-by: Zack Rusin Reported-by: Dan Carpenter Fixes: 8afa13a0583f ("drm/vmwgfx: Implement DRIVER_GEM") Reviewed-by: Martin Krastev Link: https://patchwork.freedesktop.org/patch/msgid/20211215200224.3693345-1-zack@kde.org (cherry picked from commit 60c9ecd705be3a28f79d70ea21c3939db668bf46) Signed-off-by: Thomas Zimmermann commit 50ca8cc7c0fdd9ab16b8b66ffb301fface101fac Author: Zack Rusin Date: Wed Dec 15 13:41:47 2021 -0500 drm/vmwgfx: Remove unused compile options Before the driver had screen targets support we had to disable explicit bringup of its infrastructure because it was breaking screen objects support. Since the implementation of screen targets landed there hasn't been a reason to explicitly disable it and the options were never used. Remove of all that unused code. Signed-off-by: Zack Rusin Fixes: d80efd5cb3de ("drm/vmwgfx: Initial DX support") Reviewed-by: Martin Krastev Link: https://patchwork.freedesktop.org/patch/msgid/20211215184147.3688785-3-zack@kde.org (cherry picked from commit 11343099d5ae6c7411da1425b6b162c89fb5bf10) Signed-off-by: Thomas Zimmermann commit bc701a28c74e78d7b5aa2b8628cb3608d4785d14 Author: Zack Rusin Date: Wed Dec 15 13:41:46 2021 -0500 drm/vmwgfx: Remove explicit transparent hugepages support Old versions of the svga device used to export virtual vram, handling of which was optimized on top of transparent hugepages support. Only very old devices (OpenGL 2.1 support and earlier) used this code and at this point performance differences are negligible. Because the code requires very old hardware versions to run it has been largely untested and unused for a long time. Furthermore removal of the ttm hugepages support in: commit 0d979509539e ("drm/ttm: remove ttm_bo_vm_insert_huge()") broke the coherency mode in vmwgfx when running with hugepages. Fixes: 0d979509539e ("drm/ttm: remove ttm_bo_vm_insert_huge()") Signed-off-by: Zack Rusin Cc: Jason Gunthorpe Cc: Thomas Hellström Cc: Christian König Cc: Daniel Vetter Reviewed-by: Martin Krastev Reviewed-by: Maaz Mombasawala Link: https://patchwork.freedesktop.org/patch/msgid/20211215184147.3688785-2-zack@kde.org (cherry picked from commit 49d535d64d52945e2c874f380705675e20a02b6a) Signed-off-by: Thomas Zimmermann commit 4e07d71c0d667ebf1e36be90b962081d2b778909 Author: Zack Rusin Date: Wed Dec 15 13:41:45 2021 -0500 drm/vmwgfx: Fix a size_t/long int format specifier mismatch On i386 size_t is of course 32bits and using long int throws warnings, trivially fix it by using the dedicated size_t format. This is enough to fix the following warning found by the kernel test robot: drivers/gpu/drm/vmwgfx/vmwgfx_gem.c: In function 'vmw_bo_print_info': >> drivers/gpu/drm/vmwgfx/vmwgfx_gem.c:230:33: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Wformat=] 230 | seq_printf(m, "\t\t0x%08x: %12ld bytes %s, type = %s", | ~~~~^ | | | long int | %12d 231 | id, bo->base.base.size, placement, type); | ~~~~~~~~~~~~~~~~~~ | | Reported-by: kernel test robot Signed-off-by: Zack Rusin Fixes: 8afa13a0583f ("drm/vmwgfx: Implement DRIVER_GEM") Reviewed-by: Martin Krastev Reviewed-by: Maaz Mombasawala Link: https://patchwork.freedesktop.org/patch/msgid/20211215184147.3688785-1-zack@kde.org (cherry picked from commit 72345114c96b8211ec693b1ce59f95a83a613f1d) Signed-off-by: Thomas Zimmermann commit 86ffed3de3acbc6e292870ea04dfa1102521a051 Author: Jason Wang Date: Sun Dec 12 11:06:40 2021 +0800 powercap: fix typo in a comment in idle_inject.c Drop superfluous "the" from the comment in line 15. Signed-off-by: Jason Wang [ rjw: Subject edit, new changelog ] Signed-off-by: Rafael J. Wysocki commit f75c1d55ecbadce027fd650d3ca79e357afae0d9 Merge: 86df8be67f6ca fd5e3c4ab92e3 Author: Jakub Kicinski Date: Fri Dec 17 07:30:06 2021 -0800 Merge tag 'wireless-drivers-next-2021-12-17' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next Kalle Valo says: ==================== wireless-drivers-next patches for v5.17 Second set of patches for v5.17, planning to do at least one more. Smaller new features, nothing special this time. Major changes: rtw88 * debugfs file to fix tx rate iwlwifi * support SAR GEO Offset Mapping (SGOM) via BIOS * support firmware API version 68 * add some new device IDs ath11k * support PCI devices with 1 MSI vector * WCN6855 hw2.1 support * 11d scan offload support * full monitor mode, only supported on QCN9074 * scan MAC address randomization support * reserved host DDR addresses from DT for PCI devices support ath9k * switch to rate table based lookup ath * extend South Korea regulatory domain support wcn36xx * beacon filter support * tag 'wireless-drivers-next-2021-12-17' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next: (129 commits) wcn36xx: Implement beacon filtering wcn36xx: Fix physical location of beacon filter comment wcn36xx: Fix beacon filter structure definitions ath11k: Use reserved host DDR addresses from DT for PCI devices dt: bindings: add new DT entry for ath11k PCI device support wilc1000: Improve WILC TX performance when power_save is off wl1251: specify max. IE length rsi: fix array out of bound wilc1000: Rename workqueue from "WILC_wq" to "NETDEV-wq" wilc1000: Rename tx task from "K_TXQ_TASK" to NETDEV-tx wilc1000: Rename irq handler from "WILC_IRQ" to netdev name wilc1000: Rename SPI driver from "WILC_SPI" to "wilc1000_spi" wilc1000: Fix spurious "FW not responding" error wilc1000: Remove misleading USE_SPI_DMA macro wilc1000: Fix missing newline in error message wilc1000: Fix copy-and-paste typo in wilc_set_mac_address rtw89: coex: Update COEX to 5.5.8 rtw89: coex: Cancel PS leaving while C2H comes rtw89: coex: Update BT counters while receiving report rtw89: coex: Define LPS state for BTC using ... ==================== Link: https://lore.kernel.org/r/20211217130952.34887C36AE9@smtp.kernel.org Signed-off-by: Jakub Kicinski commit 458b03f81afbb27143c45d47c2d8f418b2ba2407 Author: Rafael J. Wysocki Date: Fri Dec 10 17:12:18 2021 +0100 cpufreq: intel_pstate: Drop redundant intel_pstate_get_hwp_cap() call It is not necessary to call intel_pstate_get_hwp_cap() from intel_pstate_update_perf_limits(), because it gets called from intel_pstate_verify_cpu_policy() which is either invoked directly right before intel_pstate_update_perf_limits(), in intel_cpufreq_verify_policy() in the passive mode, or called from driver callbacks in a sequence that causes it to be followed by an immediate intel_pstate_update_perf_limits(). Namely, in the active mode intel_cpufreq_verify_policy() is called by intel_pstate_verify_policy() which is the ->verify() callback routine of intel_pstate and gets called by the cpufreq core right before intel_pstate_set_policy(), which is the driver's ->setoplicy() callback routine, where intel_pstate_update_perf_limits() is called. Signed-off-by: Rafael J. Wysocki commit d1579e61192e0e686faa4208500ef4c3b529b16c Author: Rafael J. Wysocki Date: Fri Dec 10 17:10:13 2021 +0100 PM: runtime: Add safety net to supplier device release Because refcount_dec_not_one() returns true if the target refcount becomes saturated, it is generally unsafe to use its return value as a loop termination condition, but that is what happens when a device link's supplier device is released during runtime PM suspend operations and on device link removal. To address this, introduce pm_runtime_release_supplier() to be used in the above cases which will check the supplier device's runtime PM usage counter in addition to the refcount_dec_not_one() return value, so the loop can be terminated in case the rpm_active refcount value becomes invalid, and update the code in question to use it as appropriate. This change is not expected to have any visible functional impact. Reported-by: Peter Zijlstra Signed-off-by: Rafael J. Wysocki Acked-by: Greg Kroah-Hartman Acked-by: Peter Zijlstra (Intel) commit d00ebcc6542da052b0afe28b1d448cc0f95827ad Author: Yang Li Date: Fri Dec 10 12:28:48 2021 +0800 cpuidle: Fix cpuidle_remove_state_sysfs() kerneldoc comment Fix function name in sysfs.c kernel-doc comment to remove a warning found by running scripts/kernel-doc, which is caused by using 'make W=1'. drivers/cpuidle/sysfs.c:512: warning: expecting prototype for cpuidle_remove_driver_sysfs(). Prototype was for cpuidle_remove_state_sysfs() instead Reported-by: Abaci Robot Signed-off-by: Yang Li [ rjw: Subject edits ] Signed-off-by: Rafael J. Wysocki commit c24efa6732788f0be22cdf5d2aedd5e3117e983f Author: Rafael J. Wysocki Date: Tue Dec 7 19:54:32 2021 +0100 PM: runtime: Capture device status before disabling runtime PM In some cases (for example, during system-wide suspend and resume of devices) it is useful to know whether or not runtime PM has ever been enabled for a given device and, if so, what the runtime PM status of it had been right before runtime PM was disabled for it last time. For this reason, introduce a new struct dev_pm_info field called last_status that will be used for capturing the runtime PM status of the device when its power.disable_depth counter changes from 0 to 1. The new field will be set to RPM_INVALID to start with and whenever power.disable_depth changes from 1 to 0, so it will be valid only when runtime PM of the device is currently disabled, but it has been enabled at least once. Immediately use power.last_status in rpm_resume() to make it handle the case when PM runtime is disabled for the device, but its runtime PM status is RPM_ACTIVE more consistently. Namely, make it return 1 if power.last_status is also equal to RPM_ACTIVE in that case (the idea being that if the status was RPM_ACTIVE last time when power.disable_depth was changing from 0 to 1 and it is still RPM_ACTIVE, it can be assumed to reflect what happened to the device last time when it was using runtime PM) and -EACCES otherwise. Update the documentation to provide a description of last_status and change the description of pm_runtime_resume() in it to reflect the new behavior of rpm_active(). While at it, rearrange the code in pm_runtime_enable() to be more straightforward and replace the WARN() macro in it with a pr_warn() invocation which is less disruptive. Link: https://lore.kernel.org/linux-pm/20211026222626.39222-1-ulf.hansson@linaro.org/t/#u Reviewed-by: Ulf Hansson Signed-off-by: Rafael J. Wysocki commit 931da6a0de5d620425af4425344259e6ff46b654 Author: Zhang Rui Date: Tue Dec 7 21:17:34 2021 +0800 powercap: intel_rapl: support new layout of Psys PowerLimit Register on SPR On Sapphire Rapids, the layout of the Psys domain Power Limit Register is different from from what it was before. Enhance the code to support the new Psys PL register layout. Signed-off-by: Zhang Rui Reported-and-tested-by: Alkattan Dana [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki commit a60c67fe3acf9a79016aaa1b614ffa3bbd3cacb6 Merge: 8c4e1b1617bba 44e009607444f Author: Arnd Bergmann Date: Fri Dec 17 16:07:02 2021 +0100 Merge tag 'renesas-arm-defconfig-for-v5.17-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/defconfig Renesas ARM defconfig updates for v5.17 - Enable support for the new R-Car S4-8 SoC in the arm64 defconfig. * tag 'renesas-arm-defconfig-for-v5.17-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: arm64: defconfig: Enable R-Car S4-8 Link: https://lore.kernel.org/r/cover.1639736717.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit a5af82a8ff98c7a1b88c854776b16da5604d1277 Author: Florian Fainelli Date: Thu Dec 16 20:20:01 2021 -0800 dt-bindings: usb: Convert BDC to YAML Convert the Broadcom BDC device controller Device Tree binding to YAML to help with validation. Signed-off-by: Florian Fainelli Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211217042001.479577-7-f.fainelli@gmail.com commit 1a3c7bb088266fa2db017be299f91f1c1894c857 Author: Paul Cercueil Date: Tue Dec 7 00:21:00 2021 +0000 PM: core: Add new *_PM_OPS macros, deprecate old ones This commit introduces the following macros: SYSTEM_SLEEP_PM_OPS() LATE_SYSTEM_SLEEP_PM_OPS() NOIRQ_SYSTEM_SLEEP_PM_OPS() RUNTIME_PM_OPS() These new macros are very similar to their SET_*_PM_OPS() equivalent. They however differ in the fact that the callbacks they set will always be seen as referenced by the compiler. This means that the callback functions don't need to be wrapped with a #ifdef CONFIG_PM guard, or tagged with __maybe_unused, to prevent the compiler from complaining about unused static symbols. The compiler will then simply evaluate at compile time whether or not these symbols are dead code. The callbacks that are only useful with CONFIG_PM_SLEEP is enabled, are now also wrapped with a new pm_sleep_ptr() macro, which is inspired from pm_ptr(). This is needed for drivers that use different callbacks for sleep and runtime PM, to handle the case where CONFIG_PM is set and CONFIG_PM_SLEEP is not. This commit also deprecates the following macros: SIMPLE_DEV_PM_OPS() UNIVERSAL_DEV_PM_OPS() And introduces the following macros: DEFINE_SIMPLE_DEV_PM_OPS() DEFINE_UNIVERSAL_DEV_PM_OPS() These macros are similar to the functions they were created to replace, with the following differences: - They use the new macros introduced above, and as such always reference the provided callback functions. - They are not tagged with __maybe_unused. They are meant to be used with pm_ptr() or pm_sleep_ptr() for DEFINE_UNIVERSAL_DEV_PM_OPS() and DEFINE_SIMPLE_DEV_PM_OPS() respectively. - They declare the symbol static, since every driver seems to do that anyway; and if a non-static use-case is needed an indirection pointer could be used. The point of this change, is to progressively switch from a code model where PM callbacks are all protected behind CONFIG_PM guards, to a code model where the PM callbacks are always seen by the compiler, but discarded if not used. Signed-off-by: Paul Cercueil Reviewed-by: Jonathan Cameron Signed-off-by: Rafael J. Wysocki commit c06ef740d401d0f4ab188882bf6f8d9cf0f75eaf Author: Paul Cercueil Date: Tue Dec 7 00:20:59 2021 +0000 PM: core: Redefine pm_ptr() macro The pm_ptr() macro was previously conditionally defined, according to the value of the CONFIG_PM option. This meant that the pointed structure was either referenced (if CONFIG_PM was set), or never referenced (if CONFIG_PM was not set), causing it to be detected as unused by the compiler. This worked fine, but required the __maybe_unused compiler attribute to be used to every symbol pointed to by a pointer wrapped with pm_ptr(). We can do better. With this change, the pm_ptr() is now defined the same, independently of the value of CONFIG_PM. It now uses the (?:) ternary operator to conditionally resolve to its argument. Since the condition is known at compile time, the compiler will then choose to discard the unused symbols, which won't need to be tagged with __maybe_unused anymore. This pm_ptr() macro is usually used with pointers to dev_pm_ops structures created with SIMPLE_DEV_PM_OPS() or similar macros. These do use a __maybe_unused flag, which is now useless with this change, so it later can be removed. However in the meantime it causes no harm, and all the drivers still compile fine with the new pm_ptr() macro. Signed-off-by: Paul Cercueil Reviewed-by: Jonathan Cameron Reviewed-by: Arnd Bergmann Signed-off-by: Rafael J. Wysocki commit 5ef11c56b2332613cacd5e7ac17cfb1a073b66ab Author: Paul Cercueil Date: Tue Dec 7 00:20:58 2021 +0000 r8169: Avoid misuse of pm_ptr() macro The pm_ptr() macro should be used when the suspend and resume functions can be compiled independently of the CONFIG_PM Kconfig option. In the case of this driver, the suspend and resume functions are inside a section protected by a #ifdef CONFIG_PM guard. Therefore pm_ptr() should not be used. Signed-off-by: Paul Cercueil Reviewed-by: Arnd Bergmann Signed-off-by: Rafael J. Wysocki commit 58e529eab80d29a89fc2ab0affc07730c60ef692 Author: Florian Fainelli Date: Thu Dec 16 20:20:00 2021 -0800 dt-bindings: bus: Convert GISB arbiter to YAML Convert the Broadcom STB GISB bus arbiter to YAML to help with validation. Signed-off-by: Florian Fainelli Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211217042001.479577-6-f.fainelli@gmail.com commit fb6739251cdf10c4b2c3ccecaf73e07a97466997 Author: Florian Fainelli Date: Thu Dec 16 20:19:59 2021 -0800 dt-bindings: ata: Convert Broadcom SATA to YAML Convert the Broadcom SATA3 AHCI controller Device Tree binding to YAML to help with validation. Acked-by: Damien Le Moal Signed-off-by: Florian Fainelli Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211217042001.479577-5-f.fainelli@gmail.com commit 5a17799462f80948edb6a8d941333d4f58549f46 Merge: d9bd3e9aca678 363b41dd25397 Author: Arnd Bergmann Date: Fri Dec 17 15:58:16 2021 +0100 Merge tag 'renesas-drivers-for-v5.17-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/drivers Renesas driver updates for v5.17 (take two) - Core support for the R-Car S4-8 (R8A779F0) SoC, including System Controller (SYSC) and Reset (RST) support. * tag 'renesas-drivers-for-v5.17-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: soc: renesas: rcar-rst: Add support for R-Car S4-8 soc: renesas: Identify R-Car S4-8 soc: renesas: r8a779f0-sysc: Add r8a779f0 support soc: renesas: rcar-gen4-sysc: Introduce R-Car Gen4 SYSC driver dt-bindings: clock: Add r8a779f0 CPG Core Clock Definitions dt-bindings: power: Add r8a779f0 SYSC power domain definitions Link: https://lore.kernel.org/r/cover.1639736722.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit 79309f5bf43d31b13c657002b6eb728a0ec9cf79 Merge: 527c71547dbfe d01986bec3887 Author: Arnd Bergmann Date: Fri Dec 17 15:54:22 2021 +0100 Merge tag 'renesas-dt-bindings-for-v5.17-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/dt Renesas DT binding updates for v5.17 (take two) - Document support for the R-Car S4-8 Spider CPU and BreakOut boards. * tag 'renesas-dt-bindings-for-v5.17-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: dt-bindings: arm: renesas: Document Renesas Spider boards Link: https://lore.kernel.org/r/cover.1639736725.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit 527c71547dbfe84c9902b46b0284ee31ffbc0dd9 Merge: c9074c91516d4 c9b7011768b5d Author: Arnd Bergmann Date: Fri Dec 17 15:53:29 2021 +0100 Merge tag 'renesas-arm-dt-for-v5.17-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/dt Renesas ARM DT updates for v5.17 (take two) - Initial support for the R-Car S4-8 SoC on the Spider CPU and BreakOut boards, - MIPI DSI display support for the R-Car V3u SoC and the Falcon board stack, - Thermal and GPU support for the RZ/G2L SoC and the RZ/G2L SMARC EVK development board, - Miscellaneous fixes and improvements. * tag 'renesas-arm-dt-for-v5.17-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: arm64: dts: renesas: Fix pin controller node names arm64: dts: renesas: rzg2l-smarc-som: Add vdd core regulator arm64: dts: renesas: r9a07g044: Add Mali-G31 GPU node arm64: dts: renesas: r9a07g044: Create thermal zone to support IPA arm64: dts: renesas: r9a07g044: Add TSU node arm64: dts: renesas: falcon-cpu: Add DSI display output arm64: dts: renesas: r8a779a0: Add DSI encoders arm64: dts: renesas: Add Renesas Spider boards support arm64: dts: renesas: Add Renesas R8A779F0 SoC support dt-bindings: clock: Add r8a779f0 CPG Core Clock Definitions dt-bindings: power: Add r8a779f0 SYSC power domain definitions arm64: dts: renesas: Fix thermal bindings Link: https://lore.kernel.org/r/cover.1639736718.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit c9074c91516d4d597a9975f74f6a3bd44eb457bd Merge: 365ee8033142b 0baddea60e8d5 Author: Arnd Bergmann Date: Fri Dec 17 15:52:07 2021 +0100 Merge tag 'sunxi-dt-for-5.17-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.17 merge window, with: - Introduction of the chassis-type property - I2C, SPDIF support for the Tanix TX6 - Memory frequency scaling for the A64 and H5 - Hantro G2 support for the H6 - New Board: Tanix TX6 Mini * tag 'sunxi-dt-for-5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: arm64: dts: allwinner: h6: Add Hantro G2 node arm64: dts: allwinner: h6: tanix-tx6: Enable bluetooth arm64: dts: allwinner: h6: tanix: Add MMC1 node arm64: dts: allwinner: h6: Add Tanix TX6 mini dts dt-bindings: arm: sunxi: Add Tanix TX6 mini arm64: dts: allwinner: h6: tanix-tx6: Split to DT and DTSI ARM: dts: sun8i: Adjust power key nodes arm64: dts: allwinner: a64: Update MBUS node ARM: dts: sunxi: h3/h5: Update MBUS node dt-bindings: arm: sunxi: Add H5 MBUS compatible dt-bindings: arm: sunxi: Expand MBUS binding dt-bindings: clock: sunxi: Export CLK_DRAM for devfreq dt-bindings: crypto: Add optional dma properties ARM: dts: sun8i: h3: beelink-x2: Add GPIO CEC node ARM: dts: sunxi: Add CEC clock to DW-HDMI arm64: dts: allwinner: a64: Add CEC clock to HDMI ARM: dts: sun8i: h3: beelink-x2: Sort nodes arm64: dts: allwinner: h6: tanix-tx6: Add I2C node arm64: dts: allwinner: h6: tanix-tx6: Add SPDIF arm64: dts: allwinner: add 'chassis-type' property Link: https://lore.kernel.org/r/ef385139-6fd4-42d2-9bfe-a4dda7ac76c9.lettre@localhost Signed-off-by: Arnd Bergmann commit 914ed1f56581f99094035f1cc989ab4498104e94 Author: Thierry Reding Date: Fri Dec 17 14:53:08 2021 +0100 arm64: tegra: Add host1x hotflush reset on Tegra210 Add the host1x memory client hotflush reset on Tegra210. Signed-off-by: Thierry Reding commit c9059a6bb993db31cd85f3a4081766af9e61be40 Author: Dmitry Osipenko Date: Wed Dec 1 02:23:33 2021 +0300 media: dt: bindings: tegra-vde: Document OPP and power domain Document new OPP table and power domain properties of the video decoder hardware. Reviewed-by: Rob Herring Acked-by: Hans Verkuil Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit ccc3016261edc37d66123946ede157f8c22205da Author: Dmitry Osipenko Date: Wed Dec 1 02:23:32 2021 +0300 media: dt: bindings: tegra-vde: Convert to schema Convert NVIDIA Tegra video decoder binding to schema. Reviewed-by: Rob Herring Acked-by: Hans Verkuil Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 0c41e287f7541aee58c5a0c4437524fbdbf63bd9 Author: Dmitry Osipenko Date: Wed Dec 1 02:23:14 2021 +0300 dt-bindings: host1x: Document Memory Client resets of Host1x, GR2D and GR3D Memory Client should be blocked before hardware reset is asserted in order to prevent memory corruption and hanging of memory controller. Document Memory Client resets of Host1x, GR2D and GR3D hardware units. Reviewed-by: Rob Herring Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 425a68a963698867a9b6a8d82fcd41354a01f0ab Author: Dmitry Osipenko Date: Wed Dec 1 02:23:13 2021 +0300 dt-bindings: host1x: Document OPP and power domain properties Document new DVFS OPP table and power domain properties of the Host1x bus and devices sitting on the bus. Reviewed-by: Rob Herring Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit d0e70d13048419913c4723793c9f600acd861b36 Author: Dmitry Osipenko Date: Wed Dec 1 02:23:11 2021 +0300 dt-bindings: clock: tegra-car: Document new clock sub-nodes Document sub-nodes which describe Tegra SoC clocks that require a higher voltage of the core power domain in order to operate properly on a higher clock rates. Each node contains a phandle to OPP table and power domain. The root PLLs and system clocks don't have any specific device dedicated to them, clock controller is in charge of managing power for them. Reviewed-by: Rob Herring Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit f64de71a9383457345ca6cd653c02f5b80a695e3 Author: David Heidelberg Date: Sun Dec 12 00:13:46 2021 +0300 dt-bindings: ARM: tegra: Document Pegatron Chagall Document Pegatron Chagall, which is Tegra30-based tablet device. Acked-by: Rob Herring Signed-off-by: David Heidelberg Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit b58db7135a1279ca77db9444701dbee02fa29fb7 Author: Svyatoslav Ryhel Date: Sun Dec 12 00:13:45 2021 +0300 dt-bindings: ARM: tegra: Document ASUS Transformers Document Tegra20/30/114-based ASUS Transformer Series tablet devices. This group includes EeePad TF101, Prime TF201, Pad TF300T, TF300TG Infinity TF700T, TF701T. Signed-off-by: David Heidelberg Signed-off-by: Anton Bambura Signed-off-by: Svyatoslav Ryhel Acked-by: Rob Herring Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit a90901a5a373b364d1495dbd853d31f391c021a8 Author: Thierry Reding Date: Mon Dec 6 16:55:59 2021 +0100 dt-bindings: usb: tegra-xudc: Document interconnects and iommus properties Add the interconnects, interconnect-names and iommus properties to the device tree bindings for the Tegra XUDC controller. These are used to describe the device's paths to and from memory. Acked-by: Rob Herring Signed-off-by: Thierry Reding commit cd1fe47862c71994390e810182785a4f4d371875 Author: Thierry Reding Date: Fri Nov 19 15:38:39 2021 +0100 dt-bindings: serial: Document Tegra234 TCU Add the compatible string for the TCU found on the Tegra234 SoC. Acked-by: Rob Herring Signed-off-by: Thierry Reding commit 8461fe3e443b28dc44773c98c642d094caa1976d Author: Thierry Reding Date: Fri Nov 19 15:38:38 2021 +0100 dt-bindings: serial: tegra-tcu: Convert to json-schema Convert the Tegra TCU device tree bindings to json-schema. Reviewed-by: Rob Herring Signed-off-by: Thierry Reding commit a12e1b7812ff81236732abf0f361d59c32890f9a Author: Thierry Reding Date: Fri Nov 19 15:38:37 2021 +0100 dt-bindings: thermal: tegra186-bpmp: Convert to json-schema Convert the Tegra186 (and later) BPMP thermal device tree bindings from the free-form text format to json-schema. Reviewed-by: Rob Herring Signed-off-by: Thierry Reding commit d289f9de8b952bac7805c82d3f9dfd6440f62c8c Author: Thierry Reding Date: Fri Nov 19 15:38:35 2021 +0100 dt-bindings: firmware: tegra: Convert to json-schema Convert the NVIDIA Tegra186 (and later) BPMP bindings from the free-form text format to json-schema. Reviewed-by: Rob Herring Signed-off-by: Thierry Reding commit 5cda3b25cb04222988786ebebe346a7655bde05a Author: Thierry Reding Date: Fri Nov 19 15:38:34 2021 +0100 dt-bindings: tegra: pmc: Convert to json-schema Convert the NVIDIA Tegra186 (and later) PMC bindings from the free-form text format to json-schema. Reviewed-by: Rob Herring Signed-off-by: Thierry Reding commit 96b594d2a0932d1c9ae1c48144a63aabc972222d Author: Thierry Reding Date: Fri Nov 19 15:38:33 2021 +0100 dt-bindings: serial: 8250: Document Tegra234 UART Add the compatible string for the UART found on the Tegra234 SoC. Acked-by: Rob Herring Signed-off-by: Thierry Reding commit d5de8b7608e9e710b18a080b322b11cb40a11efc Author: Thierry Reding Date: Fri Nov 19 15:38:32 2021 +0100 dt-bindings: mmc: tegra: Document Tegra234 SDHCI Add the compatible string for the SDHCI block found on the Tegra234 SoC. Acked-by: Rob Herring Signed-off-by: Thierry Reding commit f8dd779bcb4b5a0f891f82a3f23f337ce82da783 Author: Thierry Reding Date: Fri Nov 19 15:38:31 2021 +0100 dt-bindings: fuse: tegra: Document Tegra234 FUSE Add the compatible string for the FUSE block found on the Tegra234 SoC. Acked-by: Rob Herring Signed-off-by: Thierry Reding commit 25388844f92f0560961cb7dd374bcdf343d5b1f9 Author: Thierry Reding Date: Fri Nov 19 15:38:30 2021 +0100 dt-bindings: fuse: tegra: Convert to json-schema Convert the NVIDIA Tegra FUSE bindings from the free-form text format to json-schema. Reviewed-by: Rob Herring Signed-off-by: Thierry Reding commit aa8f488fd616e23ce03311f2365ab07eab9bd350 Author: Thierry Reding Date: Fri Nov 19 15:38:29 2021 +0100 dt-bindings: rtc: tegra: Document Tegra234 RTC Add the compatible string for the RTC block found on the Tegra234 SoC. Acked-by: Rob Herring Signed-off-by: Thierry Reding commit 2f9df754d0c20da8a2f64c461c4567a38b289ef9 Author: Thierry Reding Date: Fri Nov 19 15:38:28 2021 +0100 dt-bindings: rtc: tegra: Convert to json-schema Convert the NVIDIA Tegra RTC bindings from the free-form text format to json-schema. Reviewed-by: Rob Herring Signed-off-by: Thierry Reding commit 0637af949a8c75d171a635eb0e41a9104f23bb6b Author: Thierry Reding Date: Fri Nov 19 15:38:27 2021 +0100 dt-bindings: mailbox: tegra: Document Tegra234 HSP Add the compatible string for the HSP block found on the Tegra234 SoC. Acked-by: Rob Herring Signed-off-by: Thierry Reding commit 068cf93f900267fb4aaf2b14ff369f80aa4b5406 Author: Thierry Reding Date: Fri Nov 19 15:38:26 2021 +0100 dt-bindings: mailbox: tegra: Convert to json-schema Convert the NVIDIA Tegra HSP bindings from the free-form text format to json-schema. Reviewed-by: Rob Herring Signed-off-by: Thierry Reding commit e109c0acb835f81ef228c78d7ae76bbcf9470e20 Author: Thierry Reding Date: Fri Nov 19 15:38:25 2021 +0100 dt-bindings: mmc: tegra: Convert to json-schema Convert the NVIDIA Tegra SDHCI bindings from the free-form text format to json-schema. Reviewed-by: Rob Herring Signed-off-by: Thierry Reding commit bd048487af68a9782ebccc3af6606e9e0d7d9f8b Author: Thierry Reding Date: Fri Dec 17 14:52:37 2021 +0100 ARM: tegra: Add host1x hotflush reset on Tegra124 Add the host1x memory client hotflush reset on Tegra124. Signed-off-by: Thierry Reding commit b59e11495b1a0e94d6357ce5df54e24ecbeb8319 Author: Thierry Reding Date: Fri Dec 17 14:51:51 2021 +0100 ARM: tegra: Add memory client hotflush resets on Tegra114 Add the host1x, gr2d and gr3d memory client hotflush resets on Tegra114. Signed-off-by: Thierry Reding commit 812de04661c4daa7ac385c0dfd62594540538034 Author: Eric Farman Date: Mon Dec 13 22:05:50 2021 +0100 KVM: s390: Clarify SIGP orders versus STOP/RESTART With KVM_CAP_S390_USER_SIGP, there are only five Signal Processor orders (CONDITIONAL EMERGENCY SIGNAL, EMERGENCY SIGNAL, EXTERNAL CALL, SENSE, and SENSE RUNNING STATUS) which are intended for frequent use and thus are processed in-kernel. The remainder are sent to userspace with the KVM_CAP_S390_USER_SIGP capability. Of those, three orders (RESTART, STOP, and STOP AND STORE STATUS) have the potential to inject work back into the kernel, and thus are asynchronous. Let's look for those pending IRQs when processing one of the in-kernel SIGP orders, and return BUSY (CC2) if one is in process. This is in agreement with the Principles of Operation, which states that only one order can be "active" on a CPU at a time. Cc: stable@vger.kernel.org Suggested-by: David Hildenbrand Signed-off-by: Eric Farman Reviewed-by: Christian Borntraeger Acked-by: David Hildenbrand Link: https://lore.kernel.org/r/20211213210550.856213-2-farman@linux.ibm.com [borntraeger@linux.ibm.com: add stable tag] Signed-off-by: Christian Borntraeger commit 3c724f1a1caaee40c99422e22e22133e1496ffc3 Author: Janosch Frank Date: Mon Jun 7 08:07:13 2021 +0000 s390: uv: Add offset comments to UV query struct and fix naming Changes to the struct are easier to manage with offset comments so let's add some. And now that we know that the last struct member has the wrong name let's also fix this. Signed-off-by: Janosch Frank Reviewed-by: Claudio Imbrenda commit bad13799e0305deb258372b7298a86be4c78aaba Author: Janis Schoetterl-Glausch Date: Fri Nov 26 17:45:49 2021 +0100 KVM: s390: gaccess: Cleanup access to guest pages Introduce a helper function for guest frame access. Signed-off-by: Janis Schoetterl-Glausch Reviewed-by: Janosch Frank Reviewed-by: David Hildenbrand Reviewed-by: Claudio Imbrenda Message-Id: <20211126164549.7046-4-scgl@linux.ibm.com> Signed-off-by: Janosch Frank commit 7faa543df19bf62d4583a64d3902705747f2ad29 Author: Janis Schoetterl-Glausch Date: Fri Nov 26 17:45:48 2021 +0100 KVM: s390: gaccess: Refactor access address range check Do not round down the first address to the page boundary, just translate it normally, which gives the value we care about in the first place. Given this, translating a single address is just the special case of translating a range spanning a single page. Make the output optional, so the function can be used to just check a range. Signed-off-by: Janis Schoetterl-Glausch Reviewed-by: Janosch Frank Reviewed-by: Claudio Imbrenda Message-Id: <20211126164549.7046-3-scgl@linux.ibm.com> Signed-off-by: Janosch Frank commit 416e7f0c9d613bf84e182eba9547ae8f9f5bfa4c Author: Janis Schoetterl-Glausch Date: Fri Nov 26 17:45:47 2021 +0100 KVM: s390: gaccess: Refactor gpa and length calculation Improve readability by renaming the length variable and not calculating the offset manually. Signed-off-by: Janis Schoetterl-Glausch Reviewed-by: Janosch Frank Reviewed-by: David Hildenbrand Reviewed-by: Claudio Imbrenda Message-Id: <20211126164549.7046-2-scgl@linux.ibm.com> Signed-off-by: Janosch Frank commit 733e417518a69b71061c3bafc2bf106109565eee Author: Wasin Thonkaew Date: Wed Nov 3 19:42:08 2021 +0000 asm-generic/error-injection.h: fix a spelling mistake, and a coding style issue Fix a spelling mistake "ganerating" -> "generating". Remove trailing semicolon for a macro ALLOW_ERROR_INJECTION to fix a coding style issue. Signed-off-by: Wasin Thonkaew Acked-by: Masami Hiramatsu Signed-off-by: Arnd Bergmann commit e0cb56546d39956cd6c42e690548cafc97e50896 Author: Alexandre Ghiti Date: Thu Dec 16 10:44:26 2021 +0100 arch: Remove leftovers from prism54 wireless driver This driver was removed so remove all references to it. Fixes: d249ff28b1d8 ("intersil: remove obsolete prism54 wireless driver") Signed-off-by: Alexandre Ghiti Acked-by: Thomas Bogendoerfer Signed-off-by: Arnd Bergmann commit 5a608e40f9f812fd4bf70b2c044da0ddf4a2552f Author: Alexandre Ghiti Date: Thu Dec 16 10:44:24 2021 +0100 arch: Remove leftovers from mandatory file locking This config was removed so remove all references to it. Fixes: f7e33bdbd6d1 ("fs: remove mandatory file locking support") Signed-off-by: Alexandre Ghiti Reviewed-by: Jeff Layton Acked-by: Thomas Bogendoerfer Signed-off-by: Arnd Bergmann commit 2ac7069ad7647cd1d9ca5b08765a1e116e13cdc4 Author: Alexandre Ghiti Date: Thu Dec 16 10:44:23 2021 +0100 Documentation, arch: Remove leftovers from CIFS_WEAK_PW_HASH This config was removed so remove all references to it. Fixes: 76a3c92ec9e0 ("cifs: remove support for NTLM and weaker authentication algorithms") Signed-off-by: Alexandre Ghiti Reviewed-by: Steve French Acked-by: Arnd Bergmann [arch/arm/configs] Acked-by: Thomas Bogendoerfer Signed-off-by: Arnd Bergmann commit 473dcf0ffc31ce1135cd10578e7e06698cf51f4a Author: Alexandre Ghiti Date: Thu Dec 16 10:44:22 2021 +0100 Documentation, arch: Remove leftovers from raw device Raw device interface was removed so remove all references to configs related to it. Fixes: 603e4922f1c8 ("remove the raw driver") Signed-off-by: Alexandre Ghiti Acked-by: Arnd Bergmann [arch/arm/configs] Signed-off-by: Arnd Bergmann commit 23885389dbbbbc698986e77a45c1fc44a6e3632e Author: Tony Lindgren Date: Thu Nov 25 16:48:34 2021 +0200 ARM: dts: Fix timer regression for beagleboard revision c Commit e428e250fde6 ("ARM: dts: Configure system timers for omap3") caused a timer regression for beagleboard revision c where the system clockevent stops working if omap3isp module is unloaded. Turns out we still have beagleboard revisions a-b4 capacitor c70 quirks applied that limit the usable timers for no good reason. This also affects the power management as we use the system clock instead of the 32k clock source. Let's fix the issue by adding a new omap3-beagle-ab4.dts for the old timer quirks. This allows us to remove the timer quirks for later beagleboard revisions. We also need to update the related timer quirk check for the correct compatible property. Fixes: e428e250fde6 ("ARM: dts: Configure system timers for omap3") Cc: linux-kernel@vger.kernel.org Cc: Daniel Lezcano Cc: Thomas Gleixner Cc: Rob Herring Reported-by: Jarkko Nikula Tested-by: Jarkko Nikula Signed-off-by: Tony Lindgren commit 29a5e8496b3ac0d400dfe32288c26c774beb8cc8 Author: Jayesh Choudhary Date: Thu Nov 25 16:23:26 2021 +0530 ARM: dts: am335x-wega: Fix typo in mcasp property rx-num-evt Fix the property name 'rx-num-evt'. Signed-off-by: Jayesh Choudhary Signed-off-by: Tony Lindgren commit 34596ba380b03d181e24efd50e2f21045bde3696 Author: Ye Guojin Date: Tue Nov 16 06:27:26 2021 +0000 ARM: OMAP2+: adjust the location of put_device() call in omapdss_init_of This was found by coccicheck: ./arch/arm/mach-omap2/display.c, 272, 1-7, ERROR missing put_device; call of_find_device_by_node on line 258, but without a corresponding object release within this function. Move the put_device() call before the if judgment. Reported-by: Zeal Robot Signed-off-by: Ye Guojin Signed-off-by: Tony Lindgren commit 80c469a0a03763f814715f3d12b6f3964c7423e8 Author: Wan Jiabing Date: Thu Oct 14 04:57:19 2021 -0400 ARM: OMAP2+: hwmod: Add of_node_put() before break Fix following coccicheck warning: ./arch/arm/mach-omap2/omap_hwmod.c:753:1-23: WARNING: Function for_each_matching_node should have of_node_put() before break Early exits from for_each_matching_node should decrement the node reference counter. Signed-off-by: Wan Jiabing Signed-off-by: Tony Lindgren commit b0343ab330ae4d6c8d4210de5c16da704c2d4743 Author: Russell King Date: Thu May 13 10:59:23 2021 +0100 ARM: reduce the information printed in call traces A while back, Linus complained about the numeric values printed by the ARM backtracing code. Printing these values does not make sense if one does not have access to the kernel ELF image (as is normally the case when helping a third party on a mailing list), but if one does, they can be very useful to find the code, rather than searching for the function name, and then doing hex math to work out where the backtrace entry is referring to. Provide an option to control whether this information is included, which will only be visible if EXPERT is enabled. Signed-off-by: Russell King commit 3d14751f341e4778f967f2799eceef23a2dba8a0 Author: Tigran Tadevosyan Date: Fri Dec 10 14:50:31 2021 +0100 ARM: 9168/1: Add support for Cortex-M55 processor Add processor info object for ARM Cortex-M55 CPU which inherits the setup procedure, the processor and cache operation function from Cortex-M7 processor info object. Signed-off-by: Tigran Tadevosyan Signed-off-by: Vladimir Murzin Signed-off-by: Russell King (Oracle) commit 2965d4290f6052a9e7b47bad6ff648b867293488 Author: Vladimir Murzin Date: Fri Dec 10 14:49:43 2021 +0100 ARM: 9167/1: Add support for Cortex-M33 processor Cortex-M33 is the first feature rich implementation of the Armv8-M architecture (still compatible with v7M) Signed-off-by: Vladimir Murzin Signed-off-by: Russell King (Oracle) commit 75969686ec0df23157afe24dc818d7bddb087d78 Author: Wang Kefeng Date: Fri Dec 3 10:26:33 2021 +0100 ARM: 9166/1: Support KFENCE for ARM Add architecture specific implementation details for KFENCE and enable KFENCE on ARM. In particular, this implements the required interface in . KFENCE requires that attributes for pages from its memory pool can individually be set. Therefore, force the kfence pool to be mapped at page granularity. Testing this patch using the testcases in kfence_test.c and all passed with or without ARM_LPAE. Acked-by: Marco Elver Signed-off-by: Kefeng Wang Signed-off-by: Russell King (Oracle) commit 3c341b217414d1d63718438f2b2fa588cf2b73fc Author: Wang Kefeng Date: Fri Dec 3 10:26:32 2021 +0100 ARM: 9165/1: mm: Provide is_write_fault() The function will check whether the fault is caused by a write access, it will be called in die_kernel_fault() too in next patch, so put it before the function of die_kernel_fault(). Acked-by: Marco Elver Signed-off-by: Kefeng Wang Signed-off-by: Russell King (Oracle) commit 0ba8695e3dfbbc78ed716805678119121d33a730 Author: Wang Kefeng Date: Fri Dec 3 10:26:31 2021 +0100 ARM: 9164/1: mm: Provide set_memory_valid() This function validates and invalidates PTE entries, it will be used in the later patch. Acked-by: Marco Elver Signed-off-by: Kefeng Wang Signed-off-by: Russell King (Oracle) commit dcc0a8f6b69a42cdf557e1e554478204c139082d Author: Wang Kefeng Date: Fri Dec 3 10:25:21 2021 +0100 ARM: 9163/1: amba: Move of_amba_device_decode_irq() into amba_probe() Similar to other resources the AMBA bus "gets" for the device, move irq obtain from amba_device_add() to amba_probe(). Signed-off-by: Kefeng Wang Signed-off-by: Russell King (Oracle) commit 33c6a549641db662621b4bf6993df1589669aaac Author: Wang Kefeng Date: Fri Dec 3 10:25:20 2021 +0100 ARM: 9162/1: amba: Kill sysfs attribute file of irq As Rob said[1], there doesn't seem to be any users about the sysfs attribute file of irq[0] and irq[1]. And we don't need to include as NO_IRQ has gone. Let's kill both of them. [1] https://lkml.org/lkml/2021/8/25/461 Acked-by: Rob Herring Signed-off-by: Kefeng Wang Signed-off-by: Russell King (Oracle) commit d0eae8287cf3dff6670e7e9910159942bda45a20 Author: Wang Kefeng Date: Fri Dec 3 10:21:42 2021 +0100 ARM: 9161/1: mm: mark private VM_FAULT_X defines as vm_fault_t This fixes several sparse warnings for fault.c: arch/arm/mm/fault.c:210:24: sparse: expected restricted vm_fault_t arch/arm/mm/fault.c:210:24: sparse: got int ... arch/arm/mm/fault.c:345:24: sparse: sparse: restricted vm_fault_t degrades to integer Reported-by: kernel test robot Fixes: caed89dab0ca ("ARM: 9128/1: mm: Refactor the __do_page_fault()") Signed-off-by: Kefeng Wang Signed-off-by: Russell King (Oracle) commit a92882a4d270fbcc021ee6848de5e48b7f0d27f3 Author: Andre Przywara Date: Mon Nov 22 16:28:43 2021 +0100 ARM: 9159/1: decompressor: Avoid UNPREDICTABLE NOP encoding In the decompressor's head.S we need to start with an instruction that is some kind of NOP, but also mimics as the PE/COFF header, when the kernel is linked as an UEFI application. The clever solution here is "tstne r0, #0x4d000", which in the worst case just clobbers the condition flags, and bears the magic "MZ" signature in the lowest 16 bits. However the encoding used (0x13105a4d) is actually not valid, since bits [15:12] are supposed to be 0 (written as "(0)" in the ARM ARM). Violating this is UNPREDICTABLE, and *can* trigger an UNDEFINED exception. Common Cortex cores seem to ignore those bits, but QEMU chooses to trap, so the code goes fishing because of a missing exception handler at this point. We are just saved by the fact that commonly (with -kernel or when running from U-Boot) the "Z" bit is set, so the instruction is never executed. See [0] for more details. To make things more robust and avoid UNPREDICTABLE behaviour in the kernel code, lets replace this with a "two-instruction NOP": The first instruction is an exclusive OR, the effect of which the second instruction reverts. This does not leave any trace, neither in a register nor in the condition flags. Also it's a perfectly valid encoding. Kudos to Peter Maydell for coming up with this gem. [0] https://lore.kernel.org/qemu-devel/YTPIdbUCmwagL5%2FD@os.inf.tu-dresden.de/T/ Link: https://lore.kernel.org/linux-arm-kernel/20210908162617.104962-1-andre.przywara@arm.com/T/ Fixes: 81a0bc39ea19 ("ARM: add UEFI stub support") Signed-off-by: Andre Przywara Reported-by: Adam Lackorzynski Suggested-by: Peter Maydell Reviewed-by: Ard Biesheuvel Reviewed-by: Linus Walleij Signed-off-by: Russell King (Oracle) commit 4a2f57ac7dada84224d71fe895580990b9062d68 Author: Ard Biesheuvel Date: Mon Nov 15 08:57:12 2021 +0100 ARM: 9158/1: leave it to core code to manage thread_info::cpu Since commit bcf9033e5449 ("sched: move CPU field back into thread_info if THREAD_INFO_IN_TASK=y"), the CPU field in thread_info went back to being managed by the core code, so we no longer have to keep it in sync in arch code. While at it, mark THREAD_INFO_IN_TASK as done for ARM in the documentation. Reviewed-by: Linus Walleij Signed-off-by: Ard Biesheuvel Signed-off-by: Russell King (Oracle) commit 251cc826be7dec61e574b291b371362c10dd84ea Author: Masahiro Yamada Date: Sat Oct 30 18:52:58 2021 +0100 ARM: 9154/1: decompressor: do not copy source files while building As commit 7ae4a78daacf ("ARM: 8969/1: decompressor: simplify libfdt builds") stated, copying source files during the build time may not end up with as clean code as expected. Do similar for the other library files for further cleanups of the Makefile and .gitignore. Signed-off-by: Masahiro Yamada Signed-off-by: Russell King (Oracle) commit ca7e7822d106a821331afd7388a754f572e7c096 Merge: c73960bb0a432 9d5f0f6644b14 Author: Bartosz Golaszewski Date: Thu Dec 16 10:03:45 2021 +0100 Merge tag 'intel-gpio-v5.17-1' of gitolite.kernel.org:pub/scm/linux/kernel/git/andy/linux-gpio-intel into gpio/for-next intel-gpio for v5.17-1 - Don't set type for IRQ already in use in case of ACPI - Drop unused call from GPIO ACPI library - Clean up ML IOH and PCH GPIO drivers to make it closer to each other - Clarify use of register file version in DesignWare driver - other minor tweaks commit c73960bb0a4320b9ed0d5f202fa0a2bc7373c214 Author: Peter Rosin Date: Tue Dec 14 22:59:56 2021 +0100 gpiolib: allow line names from device props to override driver names Some GPIO providers set names for GPIO lines that match the names of the pins on the SoC, or variations on that theme. These names are generic more often that not, such as pioC12 in the at91 case. These generic names block the possibility to set more useful GPIO line names with device properties (i.e. gpio-line-names). Allow overriding a generic name given by the GPIO driver if there is a name given to the GPIO line using device properties, but leave the generic name alone if no better name is available. However, there is a risk. If user space is depending on the above mentioned fixed GPIO names, AND there are device properties that previously did not reach the surface, the name change might cause regressions. But hopefully this stays below the radar... Reviewed-by: Andy Shevchenko Tested-by: Alexander Dahl Signed-off-by: Peter Rosin Signed-off-by: Bartosz Golaszewski commit 36ccddf80e56b8c51604bafd449522a5271bfd35 Author: Bartosz Golaszewski Date: Tue Dec 14 09:06:51 2021 +0100 selftests: gpio: gpio-sim: avoid forking test twice Use '-o' within [] in order to avoid spawning two processes for test. Suggested-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko commit f7eda6fe03226b8a608a5d52a1e8273a14fba07c Author: Bartosz Golaszewski Date: Mon Dec 13 17:23:55 2021 +0100 selftests: gpio: gpio-sim: remove bashisms '==' is a bashisms and not understood by POSIX shell. Drop it from gpio-sim selftests. Signed-off-by: Bartosz Golaszewski commit 2ac5eb840f1da2243551c280f1e55f7a069db3da Author: Hsu Yuchang Date: Fri Dec 10 17:03:15 2021 +0800 gpio: amdpt: add new device ID and 24-pin support Add an ACPI HID(AMDIF031) and pin number in the pt_gpio_acpi_match. Signed-off-by: Yuchang Hsu Reviewed-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski commit 1db9b241bb56c6498766015049097df965ff8df2 Author: Prathamesh Shete Date: Fri Dec 10 17:02:04 2021 +0100 gpio: tegra186: Add support for Tegra234 Extend the existing Tegra186 GPIO controller driver with support for the GPIO controller found on Tegra234. While the programming model remains the same, the number of pins has slightly changed. Signed-off-by: Prathamesh Shete Reviewed-by: Linus Walleij Signed-off-by: Thierry Reding Signed-off-by: Bartosz Golaszewski commit a8b10f3d12cfc168a389f3d97e1f762732d4d849 Author: Prathamesh Shete Date: Fri Dec 10 17:02:03 2021 +0100 dt-bindings: gpio: Add Tegra234 support Extend the existing Tegra186 GPIO controller device tree bindings with support for the GPIO controller found on Tegra234. The number of pins is slightly different, but the programming model remains the same. Signed-off-by: Prathamesh Shete Reviewed-by: Linus Walleij Reviewed-by: Rob Herring [treding@nvidia.com: update device tree bindings] Signed-off-by: Thierry Reding Signed-off-by: Bartosz Golaszewski commit 7501815ffda8f7d46dc077e3c4eb2a814ef6bc18 Author: Thierry Reding Date: Fri Dec 10 17:02:02 2021 +0100 dt-bindings: gpio: tegra186: Convert to json-schema Convert the Tegra186 GPIO controller device tree bindings from free-form text format to json-schema. Reviewed-by: Linus Walleij Reviewed-by: Rob Herring Signed-off-by: Thierry Reding Signed-off-by: Bartosz Golaszewski commit 40dc227031a65ea2005377ca3baa90d9c677c35c Author: Thierry Reding Date: Fri Dec 10 17:02:01 2021 +0100 dt-bindings: gpio: tegra: Convert to json-schema Convert the NVIDIA Tegra GPIO controller device tree bindings from free-form text format to json-schema. Reviewed-by: Linus Walleij Reviewed-by: Rob Herring Signed-off-by: Thierry Reding Signed-off-by: Bartosz Golaszewski commit 34d9841b4b7bbfa60149417605f6368b4cfb4523 Author: Jason Wang Date: Sun Dec 12 11:13:35 2021 +0800 gpio: sta2x11: fix typo in a comment The double `all' in the comment in line 327 is repeated. Remove one of them from the comment. Signed-off-by: Jason Wang Signed-off-by: Bartosz Golaszewski commit 1d96b8f635d98748e251e8e9625cf42d81514425 Author: Bartosz Golaszewski Date: Mon Dec 13 13:43:14 2021 +0100 selftests: gpio: add test cases for gpio-sim Add a set of tests for the new gpio-sim module. This is a pure shell test-suite and uses the helper programs available in the gpio selftests directory. These test-cases only test the functionalities exposed by the gpio-sim driver, not those handled by core gpiolib code. Signed-off-by: Bartosz Golaszewski commit b2bb90c80a3e9ba6d479aaf130277d6f96a87161 Author: Bartosz Golaszewski Date: Mon Dec 13 13:42:20 2021 +0100 selftests: gpio: add a helper for reading GPIO line names Add a simple program that allows to read GPIO line names from the character device. This will be used in gpio-sim selftests. Signed-off-by: Bartosz Golaszewski commit 16c138f338b62dd0a339b9d0ca819426231be7f6 Author: Bartosz Golaszewski Date: Mon Dec 13 11:21:56 2021 +0100 selftests: gpio: provide a helper for reading chip info Add a simple program that allows to retrieve chip properties from the GPIO character device. This will be used in gpio-sim selftests. Signed-off-by: Bartosz Golaszewski commit cb8c474e79be458f58e9df073f51ca159f3a2aa0 Author: Bartosz Golaszewski Date: Tue Dec 7 10:34:09 2021 +0100 gpio: sim: new testing module Implement a new, modern GPIO testing module controlled by configfs attributes instead of module parameters. The goal of this driver is to provide a replacement for gpio-mockup that will be easily extensible with new features and doesn't require reloading the module to change the setup. Signed-off-by: Bartosz Golaszewski Acked-by: Linus Walleij commit ac627260cf525300d5d13e67279a89911f1ad928 Author: Bartosz Golaszewski Date: Tue Dec 7 10:34:08 2021 +0100 gpiolib: of: make fwnode take precedence in struct gpio_chip If the driver sets the fwnode in struct gpio_chip, let it take precedence over the of_node. This only affects OF-based systems, ACPI needs to be converted separately. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko Acked-by: Linus Walleij commit 990f6756bb64756d2d1033118cded6333b43397d Author: Bartosz Golaszewski Date: Mon Dec 13 11:16:41 2021 +0100 gpiolib: allow to specify the firmware node in struct gpio_chip Software nodes allow us to represent hierarchies for device components that don't have their struct device representation yet - for instance: banks of GPIOs under a common GPIO expander. The core gpiolib core however doesn't offer any way of passing this information from the drivers. This extends struct gpio_chip with a pointer to fwnode that can be set by the driver and used to pass device properties for child nodes. This is similar to how we handle device-tree sub-nodes with CONFIG_OF_GPIO enabled. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko Acked-by: Linus Walleij commit dd61b29207ca4f346fbd9c06bc49f093e3369185 Author: Bartosz Golaszewski Date: Tue Dec 7 10:34:06 2021 +0100 gpiolib: provide gpiod_remove_hogs() Currently all users of gpiod_add_hogs() call it only once at system init so there never was any need for a mechanism allowing to remove them. Now the upcoming gpio-sim will need to tear down chips with hogged lines so provide a function that allows to remove hogs. Signed-off-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko Acked-by: Linus Walleij commit bfa4671db1effe315cade5bddd6cf025e1c403d0 Author: Dmitry Osipenko Date: Sat Dec 4 17:37:16 2021 +0300 ASoC: tegra20: i2s: Filter out unsupported rates Support new nvidia,fixed-parent-rate device-tree property which instructs I2S that board wants parent clock rate to stay at a fixed rate. This allows to play audio over S/PDIF and I2S simultaneously. The root of the problem is that audio components on Tegra share the same audio PLL, and thus, only a subset of rates can be supported if we want to play audio simultaneously. Filter out audio rates that don't match parent clock rate if device-tree has the nvidia,fixed-parent-rate property. Signed-off-by: Dmitry Osipenko Acked-by: Thierry Reding Link: https://lore.kernel.org/r/20211204143725.31646-14-digetx@gmail.com Signed-off-by: Mark Brown commit 9d8f51cd1fa993939db02a014d4f4b6e252c2a18 Author: Dmitry Osipenko Date: Sat Dec 4 17:37:15 2021 +0300 ASoC: tegra20: spdif: Filter out unsupported rates SPDIF and other SoC components share audio PLL on Tegra, thus only one component may set the desired base clock rate. This creates problem for HDMI audio because it uses SPDIF and audio may not work if SPDIF's clock doesn't exactly match standard audio rate since some receivers may reject audio in that case. Filter out audio rates which SPDIF output can't support, assuming that other components won't change rate at runtime. Signed-off-by: Dmitry Osipenko Acked-by: Thierry Reding Link: https://lore.kernel.org/r/20211204143725.31646-13-digetx@gmail.com Signed-off-by: Mark Brown commit d51693092ecc732fca3f49549cde1c5206331b09 Author: Dmitry Osipenko Date: Sat Dec 4 17:37:14 2021 +0300 ASoC: tegra20: spdif: Support system suspend Support system suspend by enforcing runtime PM suspend/resume. Now there is no doubt that h/w is indeed stopped during suspend and that h/w state will be properly restored after resume. Signed-off-by: Dmitry Osipenko Acked-by: Thierry Reding Link: https://lore.kernel.org/r/20211204143725.31646-12-digetx@gmail.com Signed-off-by: Mark Brown commit ec1b4545d75575118e01a5e95699cff5010b4e19 Author: Dmitry Osipenko Date: Sat Dec 4 17:37:13 2021 +0300 ASoC: tegra20: spdif: Reset hardware Reset S/PDIF controller on runtime PM suspend/resume to ensure that we always have a consistent hardware state. Signed-off-by: Dmitry Osipenko Acked-by: Thierry Reding Link: https://lore.kernel.org/r/20211204143725.31646-11-digetx@gmail.com Signed-off-by: Mark Brown commit 150f4d573fe19a77864f6dec31aa444332f9fc9e Author: Dmitry Osipenko Date: Sat Dec 4 17:37:12 2021 +0300 ASoC: tegra20: spdif: Use more resource-managed helpers Use resource-managed helpers to make code cleaner. Driver's remove callback isn't needed anymore since driver is completely resource-managed now. Signed-off-by: Dmitry Osipenko Acked-by: Thierry Reding Link: https://lore.kernel.org/r/20211204143725.31646-10-digetx@gmail.com Signed-off-by: Mark Brown commit 117aeed43974e500dcbd106e51218a83ae2c9977 Author: Dmitry Osipenko Date: Sat Dec 4 17:37:11 2021 +0300 ASoC: tegra20: spdif: Improve driver's code - Clean up whitespaces, defines and variables. - Remove obsolete code. - Adhere to upstream coding style. - Don't override returned error code. - Replace pr_err with dev_err. No functional changes are made by this patch. This is a minor code's refactoring that will ease further maintenance of the driver. Signed-off-by: Dmitry Osipenko Acked-by: Thierry Reding Link: https://lore.kernel.org/r/20211204143725.31646-9-digetx@gmail.com Signed-off-by: Mark Brown commit c0000fc618cdbe190274cf37040033dfa23c159d Author: Dmitry Osipenko Date: Sat Dec 4 17:37:10 2021 +0300 ASoC: tegra20: spdif: Support device-tree Tegra20 S/PDIF driver was added in a pre-DT era and was never used since that time. Revive driver by adding device-tree support. Signed-off-by: Dmitry Osipenko Acked-by: Thierry Reding Link: https://lore.kernel.org/r/20211204143725.31646-8-digetx@gmail.com Signed-off-by: Mark Brown commit 16736a0221db6d6f3fe130750c6dc5bbf5417da4 Author: Dmitry Osipenko Date: Sat Dec 4 17:37:08 2021 +0300 ASoC: tegra20: spdif: Set FIFO trigger level FIFO trigger level must be not less than the size of DMA burst, otherwise audio will be played x4 faster that it should be because part of the DMA data will be dropped on FIFO input buffer overflow. Signed-off-by: Dmitry Osipenko Acked-by: Thierry Reding Link: https://lore.kernel.org/r/20211204143725.31646-6-digetx@gmail.com Signed-off-by: Mark Brown commit 549818e5c85a6d806cdef146d0203df2689d4e2f Author: Dmitry Osipenko Date: Sat Dec 4 17:37:06 2021 +0300 ASoC: dt-bindings: tegra20-i2s: Document new nvidia,fixed-parent-rate property Document new nvidia,fixed-parent-rate property which instructs that this board wants parent clock to stay at a fixed rate. It allows to prevent conflicts between audio components that share same parent PLL. For instance, this property allows to have HDMI audio, speaker and headphones in the system playing audio simultaneously, which is a common pattern for consumer devices. Reviewed-by: Rob Herring Signed-off-by: Dmitry Osipenko Link: https://lore.kernel.org/r/20211204143725.31646-4-digetx@gmail.com Signed-off-by: Mark Brown commit 80c3d0a97abfd2a678b6077236a77ccb8c4747fa Author: Dmitry Osipenko Date: Sat Dec 4 17:37:05 2021 +0300 ASoC: dt-bindings: tegra20-i2s: Convert to schema Convert NVIDIA Tegra20 I2S binding to schema. Reviewed-by: Rob Herring Signed-off-by: Dmitry Osipenko Acked-by: Thierry Reding Link: https://lore.kernel.org/r/20211204143725.31646-3-digetx@gmail.com Signed-off-by: Mark Brown commit 46f016119e2ac38d9efd32e4957bc888dc71fffe Author: Dmitry Osipenko Date: Sat Dec 4 17:37:04 2021 +0300 ASoC: dt-bindings: Add binding for Tegra20 S/PDIF Add device-tree binding for Tegra20 S/PDIF controller. Reviewed-by: Rob Herring Signed-off-by: Dmitry Osipenko Acked-by: Thierry Reding Link: https://lore.kernel.org/r/20211204143725.31646-2-digetx@gmail.com Signed-off-by: Mark Brown commit 5a49d926da462caf2aef6681a6c987240fad7c16 Merge: 0f2ee77d2655b 3c21964407579 Author: Mark Brown Date: Fri Dec 17 11:13:39 2021 +0000 Merge tag 'dmaengine_topic_slave_id_removal_5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine into v4_20211204_digetx_support_hdmi_audio_on_nvidia_tegra20 dmaengine_topic_slave_id_removal_5.17 Tag for dmaengine slave_id removal topic branch which should be merged into v5.17 commit 4941cd7cc845ae0a5317b1462e1b11bab4c023c0 Author: Peter Ujfalusi Date: Thu Dec 16 17:03:50 2021 -0600 ASoC: SOF: Kconfig: Make the SOF_DEVELOPER_SUPPORT depend on SND_SOC_SOF SND_SOC_SOF_DEVELOPER_SUPPORT contains options affecting how the built SOF driver stack will behave, enables debug options and other features. These options have no meaning if the SND_SOC_SOF is not even enabled. If we have SOF client options under developer_support and debug they can be selected to be built even without the core, but they do need symbols from the core (the sof-client API) which can result build failure. In Kconfig we can have SND_SOC_SOF_TOPLEVEL=y SND_SOC_SOF_DEBUG_IPC_FLOOD_TEST=y for example, which will make the flood client to be built, but the SOF core is not as SND_SOC_SOF is not selected. Reviewed-by: Paul Olaru Reviewed-by: Daniel Baluta Reviewed-by: Ranjani Sridharan Signed-off-by: Peter Ujfalusi Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20211216230350.343857-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 9b3c847b5fa0364a00227f13ab8ac0cbaf69be83 Author: Kuninori Morimoto Date: Thu Dec 16 09:00:18 2021 +0900 ASoC: dt-bindings: audio-graph-port: enable both flag/phandle for bitclock/frame-master snd_soc_daifmt_parse_clock_provider_raw() is handling both bitclock/frame-master, and is supporting both flag/phandle. Current DT is assuming it is flag style. This patch allows both case. Signed-off-by: Kuninori Morimoto Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211216000018.2641925-1-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 60ded273e4c047aec364f70195aced71a4082f90 Author: Karol Trzcinski Date: Thu Dec 16 17:24:22 2021 -0600 ipc: debug: Add shared memory heap to memory scan Newly added shared heap zones should be taken into account during memory usage scanning. Reviewed-by: Kai Vehmanen Reviewed-by: Liam Girdwood Signed-off-by: Karol Trzcinski Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20211216232422.345164-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 182b682b9ab1348e07ea1bf9d8f2505cc67f9237 Author: Ajit Kumar Pandey Date: Thu Dec 16 17:24:21 2021 -0600 ASoC: SOF: ipc: Add null pointer check for substream->runtime When pcm stream is stopped "substream->runtime" pointer will be set to NULL by ALSA core. In case host received an ipc msg from firmware of type IPC_STREAM_POSITION after pcm stream is stopped, there will be kernel NULL pointer exception in ipc_period_elapsed(). This patch fixes it by adding NULL pointer check for "substream->runtime". Reviewed-by: Ranjani Sridharan Signed-off-by: Ajit Kumar Pandey Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20211216232422.345164-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit cb515f105cab124c5740e70dd0e8c78186ae81b7 Author: Guennadi Liakhovetski Date: Thu Dec 16 17:24:20 2021 -0600 ASoC: SOF: avoid casting "const" attribute away Casting "const" attribute away is dangerous, obtain a writable pointer instead to avoid that. Signed-off-by: Guennadi Liakhovetski Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20211216232422.345164-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 35218cf61869ca4b11c8c0b49a95f75f379e403a Author: Ranjani Sridharan Date: Thu Dec 16 17:16:28 2021 -0600 ASoC: SOF: Intel: hda: remove support for RESUME in platform trigger The SOF driver removed the support for INFO_RESUME in the commit "ASoC: SOF: pcm: do not add SNDRV_PCM_INFO_RESUME to runtime hw info". And resuming is handled by the ALSA core with the .prepare and .trigger_start stages. So, remove handling of RESUME trigger in the component driver trigger op. So, remove handling the RESUME trigger in the platform trigger op for HDA platforms. Reviewed-by: Kai Vehmanen Reviewed-by: Rander Wang Reviewed-by: Bard Liao Signed-off-by: Ranjani Sridharan Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20211216231628.344687-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 9b465060d144dd8196729cc8d77e328f1328dcbf Author: Ranjani Sridharan Date: Thu Dec 16 17:16:27 2021 -0600 ASoC: SOF: Intel: hda: remove support for RESUME trigger The SOF driver removed the support for INFO_RESUME in the commit "ASoC: SOF: pcm: do not add SNDRV_PCM_INFO_RESUME to runtime hw info". And resuming is handled by the ALSA core with the .prepare and .trigger_start stages. So, remove handling of RESUME trigger in the HDA DAI BE trigger op. Reviewed-by: Kai Vehmanen Reviewed-by: Rander Wang Reviewed-by: Bard Liao Signed-off-by: Ranjani Sridharan Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20211216231628.344687-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit eed5391f6747ffa7e3972b53aa721bded8feeff7 Author: Ranjani Sridharan Date: Thu Dec 16 17:16:26 2021 -0600 ASoC: SOF: pcm: remove support for RESUME trigger The SOF driver removed the support for INFO_RESUME in the commit "ASoC: SOF: pcm: do not add SNDRV_PCM_INFO_RESUME to runtime hw info". And resuming is handled by the ALSA core with the .prepare and .trigger_start stages. So, remove handling of RESUME trigger in the component driver trigger op. Reviewed-by: Kai Vehmanen Reviewed-by: Rander Wang Reviewed-by: Bard Liao Signed-off-by: Ranjani Sridharan Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20211216231628.344687-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 1758047057dbe329be712a31b79db7151b5871f8 Merge: bcae3af286f49 1c405ca11bf56 Author: Thomas Zimmermann Date: Fri Dec 17 11:33:33 2021 +0100 Merge drm/drm-next into drm-misc-next-fixes Backmerging to bring drm-misc-next-fixes up to the latest state for the current release cycle. Signed-off-by: Thomas Zimmermann commit 35a441eea7032d08844b6466ac490a92446045fd Author: Minghao Chi Date: Mon Dec 13 11:26:27 2021 +0000 mtd: rawnand: gpmi: remove unneeded variable Return status directly from function called. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20211213112627.436745-1-chi.minghao@zte.com.cn commit 44d73223fefd8f93be7d94a6eaf897a3c88e3ffb Author: Roger Quadros Date: Thu Dec 9 11:04:58 2021 +0200 mtd: rawnand: omap2: drop unused variable devsize is not used anywhere in code. Drop it. Signed-off-by: Roger Quadros Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20211209090458.24830-7-rogerq@kernel.org commit 4695a3cf004a44a8d196d7c2f23d46efca0f92e3 Author: Roger Quadros Date: Thu Dec 9 11:04:57 2021 +0200 mtd: rawnand: omap2: fix force_8bit flag behaviour for DMA mode In DMA mode we were not considering the force_8bit flag. Fix it by using regular non-DMA 8-bit I/O if force_8bit flag is set. Signed-off-by: Roger Quadros Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20211209090458.24830-6-rogerq@kernel.org commit 0137c74ad87316305599df8ada54de5273d868ec Author: Roger Quadros Date: Thu Dec 9 11:04:56 2021 +0200 mtd: rawnand: omap2: Add compatible for AM64 SoC AM64 SoC contains the GPMC NAND controller. Add compatible for it. Signed-off-by: Roger Quadros Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20211209090458.24830-5-rogerq@kernel.org commit a9e849efca4f9c7732ea4a81f13ec96208994b22 Author: Roger Quadros Date: Thu Dec 9 11:04:55 2021 +0200 mtd: rawnand: omap2: move to exec_op interface Stop using legacy interface and move to the exec_op interface. Signed-off-by: Roger Quadros Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20211209090458.24830-4-rogerq@kernel.org commit 35da0c45455346f9f34870276e875a49a0491c43 Author: Roger Quadros Date: Thu Dec 9 11:04:54 2021 +0200 mtd: rawnand: omap2: Allow build on K3 platforms K3 platforms come with GPMC. Enable GPMC build for K3 platforms. Signed-off-by: Roger Quadros Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20211209090458.24830-3-rogerq@kernel.org commit 14a3ca56c09d6b5ffb5f3f0eb83decca9b68d7fa Author: Roger Quadros Date: Thu Dec 9 11:04:53 2021 +0200 dt-bindings: mtd: ti, gpmc-nand: Add compatible for AM64 NAND AM64 SoC contains the GPMC NAND controller. Add compatible for it. Cc: Rob Herring Signed-off-by: Roger Quadros Acked-by: Rob Herring Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20211209090458.24830-2-rogerq@kernel.org commit 86df8be67f6ca85d14fd469f1d1bcc3eee8f713e Author: Changcheng Deng Date: Thu Dec 16 09:13:39 2021 +0000 net: dsa: microchip: remove unneeded variable Remove unneeded variable used to store return value. Reported-by: Zeal Robot Signed-off-by: Changcheng Deng Signed-off-by: David S. Miller commit b8f1ba99cea540903154d34888d7d310cc54ea4f Author: Dan Carpenter Date: Fri Dec 10 17:20:28 2021 +0300 usb: hub: make wait_for_connected() take an int instead of a pointer to int The wait_for_connected() function doesn't modify "*port1" and there is no need to pass a pointer. Just pass the int itself. Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20211210142028.GB18906@kili Signed-off-by: Greg Kroah-Hartman commit c9b7011768b5dbb68792b4bacad5ae913059ed74 Author: Geert Uytterhoeven Date: Thu Dec 16 16:04:49 2021 +0100 arm64: dts: renesas: Fix pin controller node names Align all pin controller node names with the expectations of the DT bindings in Documentation/devicetree/bindings/pinctrl/pinctrl.yaml. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/09a09c8ac9cb1a11b859c1ab9d9eae84cfefb1bb.1639666967.git.geert+renesas@glider.be commit 3953831982eb9c90506c4a2e8d7e6c3d840abf8a Merge: af40d16042d67 90091c367e74d Author: Greg Kroah-Hartman Date: Fri Dec 17 10:06:21 2021 +0100 Merge tag 'lkdtm-v5.17-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux into char-misc-next Kees writes: lkdtm updates for v5.17-rc1 - Fix printk() usage during recursion (Ard Biesheuvel) - Fix rodata section to actually have contents (Christophe Leroy) - Add notes about lkdtm_kernel_info usage (Kees Cook) - Avoid stack-entropy selftest when LKDTM is disabled (Misono Tomohiro) * tag 'lkdtm-v5.17-rc1' of https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: selftest/lkdtm: Skip stack-entropy test if lkdtm is not available lkdtm: Fix content of section containing lkdtm_rodata_do_nothing() lkdtm: avoid printk() in recursive_loop() lkdtm: Note that lkdtm_kernel_info should be removed in the future commit c95a9c278df8733a4370182a20f1355d6a81c235 Author: Maíra Canal Date: Fri Dec 17 16:38:16 2021 +0800 iommu/vt-d: Remove unused dma_to_mm_pfn function Remove dma_to_buf_pfn function, which is not used in the codebase. This was pointed by clang with the following warning: 'dma_to_mm_pfn' [-Wunused-function] static inline unsigned long dma_to_mm_pfn(unsigned long dma_pfn) ^ https://lore.kernel.org/r/YYhY7GqlrcTZlzuA@fedora drivers/iommu/intel/iommu.c:136:29: warning: unused function Signed-off-by: Maíra Canal Reviewed-by: Nick Desaulniers Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20211217083817.1745419-4-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit f5209f91272295c6c3ee0cd5f9589baf93cd00e8 Author: Kefeng Wang Date: Fri Dec 17 16:38:15 2021 +0800 iommu/vt-d: Drop duplicate check in dma_pte_free_pagetable() The BUG_ON check exists in dma_pte_clear_range(), kill the duplicate check. Signed-off-by: Kefeng Wang Link: https://lore.kernel.org/r/20211025032307.182974-1-wangkefeng.wang@huawei.com Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20211217083817.1745419-3-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit bb7125739611acbbce8182ed98ad700f03ebac18 Author: Christophe JAILLET Date: Fri Dec 17 16:38:14 2021 +0800 iommu/vt-d: Use bitmap_zalloc() when applicable 'iommu->domain_ids' is a bitmap. So use 'bitmap_zalloc()' to simplify code and improve the semantic. Also change the corresponding 'kfree()' into 'bitmap_free()' to keep consistency. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/cb7a3e0a8d522447a06298a4f244c3df072f948b.1635018498.git.christophe.jaillet@wanadoo.fr Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20211217083817.1745419-2-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 575f5cfb13c84f324f9898383fa4a5694e53c9ef Author: Maxim Levitsky Date: Tue Nov 23 18:10:38 2021 +0200 iommu/amd: Remove useless irq affinity notifier iommu->intcapxt_notify field is no longer used after a switch to a separate domain was done Fixes: d1adcfbb520c ("iommu/amd: Fix IOMMU interrupt generation in X2APIC mode") Signed-off-by: Maxim Levitsky Link: https://lore.kernel.org/r/20211123161038.48009-6-mlevitsk@redhat.com Signed-off-by: Joerg Roedel commit 1980105e3cfc2215c75b4f6b172661d675c467d1 Author: Maxim Levitsky Date: Tue Nov 23 18:10:37 2021 +0200 iommu/amd: X2apic mode: mask/unmask interrupts on suspend/resume Use IRQCHIP_MASK_ON_SUSPEND to make the core irq code to mask the iommu interrupt on suspend and unmask it on the resume. Since now the unmask function updates the INTX settings, that will restore them on resume from s3/s4. Since IRQCHIP_MASK_ON_SUSPEND is only effective for interrupts which are not wakeup sources, remove IRQCHIP_SKIP_SET_WAKE flag and instead implement a dummy .irq_set_wake which doesn't allow the interrupt to become a wakeup source. Fixes: 66929812955bb ("iommu/amd: Add support for X2APIC IOMMU interrupts") Signed-off-by: Maxim Levitsky Link: https://lore.kernel.org/r/20211123161038.48009-5-mlevitsk@redhat.com Signed-off-by: Joerg Roedel commit 4691f79d62a637958f7b5f55c232a65399500b7a Author: Maxim Levitsky Date: Tue Nov 23 18:10:36 2021 +0200 iommu/amd: X2apic mode: setup the INTX registers on mask/unmask This is more logically correct and will also allow us to to use mask/unmask logic to restore INTX setttings after the resume from s3/s4. Fixes: 66929812955bb ("iommu/amd: Add support for X2APIC IOMMU interrupts") Signed-off-by: Maxim Levitsky Link: https://lore.kernel.org/r/20211123161038.48009-4-mlevitsk@redhat.com Signed-off-by: Joerg Roedel commit 01b297a48a26bcb96769505ac948db4603b72bd1 Author: Maxim Levitsky Date: Tue Nov 23 18:10:35 2021 +0200 iommu/amd: X2apic mode: re-enable after resume Otherwise it is guaranteed to not work after the resume... Fixes: 66929812955bb ("iommu/amd: Add support for X2APIC IOMMU interrupts") Signed-off-by: Maxim Levitsky Link: https://lore.kernel.org/r/20211123161038.48009-3-mlevitsk@redhat.com Signed-off-by: Joerg Roedel commit a8d4a37d1bb93608501d0d0545f902061152669a Author: Maxim Levitsky Date: Tue Nov 23 18:10:34 2021 +0200 iommu/amd: Restore GA log/tail pointer on host resume This will give IOMMU GA log a chance to work after resume from s3/s4. Fixes: 8bda0cfbdc1a6 ("iommu/amd: Detect and initialize guest vAPIC log") Signed-off-by: Maxim Levitsky Link: https://lore.kernel.org/r/20211123161038.48009-2-mlevitsk@redhat.com Signed-off-by: Joerg Roedel commit 972bf252f86062e50f9c9ea81f84f5df0e9f1302 Author: John Garry via iommu Date: Tue Dec 7 19:17:26 2021 +0800 iommu/iova: Move fast alloc size roundup into alloc_iova_fast() It really is a property of the IOVA rcache code that we need to alloc a power-of-2 size, so relocate the functionality to resize into alloc_iova_fast(), rather than the callsites. Signed-off-by: John Garry Acked-by: Will Deacon Reviewed-by: Xie Yongji Acked-by: Jason Wang Acked-by: Michael S. Tsirkin Acked-by: Robin Murphy Link: https://lore.kernel.org/r/1638875846-23993-1-git-send-email-john.garry@huawei.com Signed-off-by: Joerg Roedel commit 4cb3600e5eaf629452c362ec3535b4f30716d4e7 Author: Xiang wangx Date: Thu Dec 16 16:33:02 2021 +0800 iommu/virtio: Fix typo in a comment The double `as' in a comment is repeated, thus it should be removed. Signed-off-by: Xiang wangx Link: https://lore.kernel.org/r/20211216083302.18049-1-wangxiang@cdjrlc.com Signed-off-by: Joerg Roedel commit 9dfa5b6f5efb85efe69fd3b7b0b912004d9547f1 Author: Lu Baolu Date: Thu Dec 16 09:17:03 2021 +0800 iommu/vt-d: Remove unused macros These macros has no reference in the tree anymore. Cleanup them. Signed-off-by: Lu Baolu Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211216011703.763331-1-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 4599d78a820eb0a8ce2b3a1bd619620837cf906e Author: Kees Cook Date: Wed Dec 15 15:24:32 2021 -0800 iommu/vt-d: Use correctly sized arguments for bit field The find.h APIs are designed to be used only on unsigned long arguments. This can technically result in a over-read, but it is harmless in this case. Regardless, fix it to avoid the warning seen under -Warray-bounds, which we'd like to enable globally: In file included from ./include/linux/bitmap.h:9, from drivers/iommu/intel/iommu.c:17: drivers/iommu/intel/iommu.c: In function 'domain_context_mapping_one': ./include/linux/find.h:119:37: warning: array subscript 'long unsigned int[0]' is partly outside array bounds of 'int[1]' [-Warray-bounds] 119 | unsigned long val = *addr & GENMASK(size - 1, 0); | ^~~~~ drivers/iommu/intel/iommu.c:2115:18: note: while referencing 'max_pde' 2115 | int pds, max_pde; | ^~~~~~~ Signed-off-by: Kees Cook Acked-by: Yury Norov Link: https://lore.kernel.org/r/20211215232432.2069605-1-keescook@chromium.org Signed-off-by: Joerg Roedel commit 91d6988558d7ea6a7851621b4ad0f657c338456e Merge: 0fcfb00b28c0b 477436699e780 Author: Joerg Roedel Date: Fri Dec 17 09:01:54 2021 +0100 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.17 - Revert evtq and priq back to their former sizes - Return early on short-descriptor page-table allocation failure - Fix page fault reporting for Adreno GPU on SMMUv2 - Make SMMUv3 MMU notifier ops 'const' - Numerous new compatible strings for Qualcomm SMMUv2 implementations commit 68ac0f3810e76a853b5f7b90601a05c3048b8b54 Author: Antony Antony Date: Sun Dec 12 11:35:00 2021 +0100 xfrm: state and policy should fail if XFRMA_IF_ID 0 xfrm ineterface does not allow xfrm if_id = 0 fail to create or update xfrm state and policy. With this commit: ip xfrm policy add src 192.0.2.1 dst 192.0.2.2 dir out if_id 0 RTNETLINK answers: Invalid argument ip xfrm state add src 192.0.2.1 dst 192.0.2.2 proto esp spi 1 \ reqid 1 mode tunnel aead 'rfc4106(gcm(aes))' \ 0x1111111111111111111111111111111111111111 96 if_id 0 RTNETLINK answers: Invalid argument v1->v2 change: - add Fixes: tag Fixes: 9f8550e4bd9d ("xfrm: fix disable_xfrm sysctl when used on xfrm interfaces") Signed-off-by: Antony Antony Signed-off-by: Steffen Klassert commit 8dce43919566f06e865f7e8949f5c10d8c2493f5 Author: Antony Antony Date: Sun Dec 12 11:34:30 2021 +0100 xfrm: interface with if_id 0 should return error xfrm interface if_id = 0 would cause xfrm policy lookup errors since Commit 9f8550e4bd9d. Now explicitly fail to create an xfrm interface when if_id = 0 With this commit: ip link add ipsec0 type xfrm dev lo if_id 0 Error: if_id must be non zero. v1->v2 change: - add Fixes: tag Fixes: 9f8550e4bd9d ("xfrm: fix disable_xfrm sysctl when used on xfrm interfaces") Signed-off-by: Antony Antony Reviewed-by: Eyal Birger Signed-off-by: Steffen Klassert commit 1c405ca11bf563de1725e5ecfb4a74ee289d2ee9 Merge: 8b70b5fee0121 d95b00f1a8c57 Author: Dave Airlie Date: Fri Dec 17 16:16:09 2021 +1000 Merge tag 'mediatek-drm-next-5.17' of https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux into drm-next Mediatek DRM Next for Linux 5.16 1. Add support for MT8192 2. CMDQ refinement. 3. Miscellaneous clean up and reorder. 4. Set the default value of rotation to DRM_MODE_ROTATE_0 Signed-off-by: Dave Airlie From: Chun-Kuang Hu Link: https://patchwork.freedesktop.org/patch/msgid/1639700370-3541-1-git-send-email-chunkuang.hu@kernel.org commit 8b70b5fee012172659717024adb6f17726d76290 Merge: eacef9fd61dcf 9758ff2fa2401 Author: Dave Airlie Date: Fri Dec 17 16:06:14 2021 +1000 Merge tag 'drm-misc-next-2021-12-16' of git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next for 5.17: UAPI Changes: * vmwgfx: Version bump to 2.20 Cross-subsystem Changes: * of: Create simple-framebuffer devices in of_platform_default_init() Core Changes: * Replace include with more fine-grained includes * Document DRM_IOCTL_MODE_GETFB2 * format-helper: Support XRGB2101010 source buffers Driver Changes: * amdgpu: Fix runtime PM on some configs * ast: Fix I2C initialization * bridge: ti-sn65dsi86: Set regmap max_register * panel: Add Team Source Display TST043015CMHX plus DT bindings * simpledrm: Add support for Apple M1 * sprd: Add various drivers plus DT bindings * vc4: Support 10-bit YUV 4:2:0 output; Fix clock-rate updates * vmwgfx: Implement GEM support; Implement GL 4.3 support Signed-off-by: Dave Airlie From: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/YbtOaZLvar+9hBOi@linux-uq9g.fritz.box commit 696645d25bafd6ba3562611c29bc8ecd47066dfe Author: Weili Qian Date: Sat Dec 11 19:25:19 2021 +0800 crypto: hisilicon/qm - disable queue when 'CQ' error If the hardware reports the 'CQ' overflow or 'CQE' error by the abnormal interrupt, disable the queue and stop tasks send to hardware. Signed-off-by: Weili Qian Signed-off-by: Herbert Xu commit 95f0b6d536374ea1796bd0d9024faaca9c4f3380 Author: Weili Qian Date: Sat Dec 11 19:25:18 2021 +0800 crypto: hisilicon/qm - reset function if event queue overflows If the hardware reports the event queue overflow by the abnormal interrupt, the driver needs to reset the function and re-enable the event queue interrupt and abnormal interrupt. Signed-off-by: Weili Qian Signed-off-by: Herbert Xu commit a0a9486bebc43679ec9ded50ac6b93330c4b930f Author: Weili Qian Date: Sat Dec 11 19:25:17 2021 +0800 crypto: hisilicon/qm - use request_threaded_irq instead The abnormal interrupt method needs to be changed, and the changed method needs to be locked in order to maintain atomicity. Therefore, replace request_irq() with request_threaded_irq(). Signed-off-by: Weili Qian Signed-off-by: Herbert Xu commit 145dcedd0e17f40bd8066a0234a19e40463367db Author: Weili Qian Date: Sat Dec 11 19:25:16 2021 +0800 crypto: hisilicon/qm - modify the handling method after abnormal interruption After processing an interrupt event and the interrupt function is enabled by writing the QM_DOORBELL_CMD_AEQ register, the hardware may generate new interrupt events due to processing other user's task when the subsequent interrupt events have not been processed. The new interrupt event will disrupt the current normal processing flow and cause other problems. Therefore, the operation of writing the QM_DOORBELL_CMD_AEQ doorbell register needs to be placed after all interrupt events processing are completed. Signed-off-by: Weili Qian Signed-off-by: Herbert Xu commit 9ee401eaceddb3e96fb72ef097175fcaaa1fb37a Author: Weili Qian Date: Sat Dec 11 19:25:15 2021 +0800 crypto: hisilicon/qm - code movement This patch does not change any code, just code movement. Preparing for next patch. Signed-off-by: Weili Qian Signed-off-by: Herbert Xu commit f123e66df6ca0fce73309dda667d7d1d5b0aa715 Author: Weili Qian Date: Sat Dec 11 19:25:14 2021 +0800 crypto: hisilicon/qm - remove unnecessary device memory reset The internal memory of the device needs to be reset only when the device is globally initialized. Other scenarios, such as function reset, do not need to perform reset. Signed-off-by: Weili Qian Signed-off-by: Herbert Xu commit fc6c01f0cd10b89c4b01dd2940e0b0cda1bd82fb Author: Yang Shen Date: Sat Dec 11 16:56:55 2021 +0800 crypto: hisilicon/qm - fix deadlock for remove driver When remove the driver and executing the task occur at the same time, the following deadlock will be triggered: Chain exists of: sva_lock --> uacce_mutex --> &qm->qps_lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&qm->qps_lock); lock(uacce_mutex); lock(&qm->qps_lock); lock(sva_lock); And the lock 'qps_lock' is used to protect qp. Therefore, it's reasonable cycle is to continue until the qp memory is released. So move the release lock infront of 'uacce_remove'. Signed-off-by: Yang Shen Signed-off-by: Herbert Xu commit 808957baf3aa42b71453c8accc71cf5e52665982 Author: Yang Shen Date: Sat Dec 11 16:52:05 2021 +0800 crypto: hisilicon/zip - enable ssid for sva sgl For Kunpeng 920, the bit 0 of register 'HZIP_SGL_RUSER_32_63' stand for whether the ssid is valid. So this bit should be set as valid for sva mode. Signed-off-by: Yang Shen Signed-off-by: Herbert Xu commit 51fa916b81e5f406a74f14a31a3a228c3cc060ad Author: Weili Qian Date: Sat Dec 11 16:17:19 2021 +0800 crypto: hisilicon/hpre - fix memory leak in hpre_curve25519_src_init() hpre_curve25519_src_init() allocates memory for 'ptr' before calling memcmp(). If memcmp() returns 0, the function will return '-EINVAL' without freeing memory. Signed-off-by: Weili Qian Signed-off-by: Herbert Xu commit 244d22ffd656bc8e5c49a2cd2fdfeb0e52a9730f Author: Andy Shevchenko Date: Fri Dec 10 16:30:09 2021 +0200 crypto: api - Replace kernel.h with the necessary inclusions When kernel.h is used in the headers it adds a lot into dependency hell, especially when there are circular dependencies are involved. Replace kernel.h inclusion with the list of what is really being used. Signed-off-by: Andy Shevchenko Signed-off-by: Herbert Xu commit 0b62b664d52c670eb5e0fa7dfd6a85dbc518619c Author: Gustavo A. R. Silva Date: Tue Dec 7 22:17:21 2021 -0600 crypto: marvell/octeontx - Use kcalloc() instead of kzalloc() Use 2-factor multiplication argument form kcalloc() instead of kzalloc(). Link: https://github.com/KSPP/linux/issues/162 Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Signed-off-by: Herbert Xu commit 61a13714a9853fb7b342ecae7ecafad1a950309b Author: Gustavo A. R. Silva Date: Tue Dec 7 19:24:59 2021 -0600 crypto: cavium - Use kcalloc() instead of kzalloc() Use 2-factor multiplication argument form kcalloc() instead of kzalloc(). Link: https://github.com/KSPP/linux/issues/162 Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Signed-off-by: Herbert Xu commit 3d725965f836a7acbd1674e33644bec18373de53 Author: David Rientjes Date: Tue Dec 7 15:33:06 2021 -0800 crypto: ccp - Add SEV_INIT_EX support Add new module parameter to allow users to use SEV_INIT_EX instead of SEV_INIT. This helps users who lock their SPI bus to use the PSP for SEV functionality. The 'init_ex_path' parameter defaults to NULL which means the kernel will use SEV_INIT, if a path is specified SEV_INIT_EX will be used with the data found at the path. On certain PSP commands this file is written to as the PSP updates the NV memory region. Depending on file system initialization this file open may fail during module init but the CCP driver for SEV already has sufficient retries for platform initialization. During normal operation of PSP system and SEV commands if the PSP has not been initialized it is at run time. If the file at 'init_ex_path' does not exist the PSP will not be initialized. The user must create the file prior to use with 32Kb of 0xFFs per spec. Signed-off-by: David Rientjes Co-developed-by: Peter Gonda Signed-off-by: Peter Gonda Reviewed-by: Marc Orr Reported-by: kernel test robot Acked-by: Brijesh Singh Cc: Tom Lendacky Cc: Brijesh Singh Cc: Marc Orr Cc: Joerg Roedel Cc: Herbert Xu Cc: David Rientjes Cc: John Allen Cc: "David S. Miller" Cc: Paolo Bonzini Cc: linux-crypto@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Herbert Xu commit b64fa5fc9f4495e3ff189d9fb31cd53e6ced1cc3 Author: Peter Gonda Date: Tue Dec 7 15:33:05 2021 -0800 crypto: ccp - Add psp_init_on_probe module parameter Add psp_init_on_probe module parameter that allows for skipping the PSP's SEV platform initialization during module init. User may decouple module init from PSP init due to use of the INIT_EX support in upcoming patch which allows for users to save PSP's internal state to file. The file may be unavailable at module init. Also moves the PSP ABI version log message to after successful PSP init instead of module init in case this new parameter is used. Signed-off-by: Peter Gonda Acked-by: Brijesh Singh Cc: Tom Lendacky Cc: Brijesh Singh Cc: Marc Orr Cc: Joerg Roedel Cc: Herbert Xu Cc: David Rientjes Cc: John Allen Cc: "David S. Miller" Cc: Paolo Bonzini Cc: linux-crypto@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Herbert Xu commit cc17982d58d1e67eab831e7023ede999dda56173 Author: Peter Gonda Date: Tue Dec 7 15:33:04 2021 -0800 crypto: ccp - Refactor out sev_fw_alloc() Create a helper function sev_fw_alloc() which can be used to allocate aligned memory regions for use by the PSP firmware. Currently only used for the SEV-ES TMR region but will be used for the SEV_INIT_EX NV memory region. Signed-off-by: Peter Gonda Reviewed-by: Marc Orr Acked-by: David Rientjes Acked-by: Brijesh Singh Cc: Tom Lendacky Cc: Brijesh Singh Cc: Marc Orr Cc: Joerg Roedel Cc: Herbert Xu Cc: David Rientjes Cc: John Allen Cc: "David S. Miller" Cc: Paolo Bonzini Cc: linux-crypto@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Herbert Xu commit e423b9d75e779d921e6adf5ac3d0b59400d6ba7e Author: Peter Gonda Date: Tue Dec 7 15:33:03 2021 -0800 crypto: ccp - Move SEV_INIT retry for corrupted data Move the data corrupted retry of SEV_INIT into the __sev_platform_init_locked() function. This is for upcoming INIT_EX support as well as helping direct callers of __sev_platform_init_locked() which currently do not support the retry. Signed-off-by: Peter Gonda Reviewed-by: Marc Orr Acked-by: David Rientjes Acked-by: Tom Lendacky Acked-by: Brijesh Singh Cc: Tom Lendacky Cc: Brijesh Singh Cc: Marc Orr Cc: Joerg Roedel Cc: Herbert Xu Cc: David Rientjes Cc: John Allen Cc: "David S. Miller" Cc: Paolo Bonzini Cc: linux-crypto@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Herbert Xu commit c8341ac62bed9258746a5c7fb8a76d88809ecd1f Author: Peter Gonda Date: Tue Dec 7 15:33:02 2021 -0800 crypto: ccp - Add SEV_INIT rc error logging on init Currently only the firmware error code is printed. This is incomplete and also incorrect as error cases exists where the firmware is never called and therefore does not set an error code. Signed-off-by: Peter Gonda Reviewed-by: Marc Orr Acked-by: David Rientjes Acked-by: Tom Lendacky Acked-by: Brijesh Singh Cc: Tom Lendacky Cc: Brijesh Singh Cc: Marc Orr Cc: Joerg Roedel Cc: Herbert Xu Cc: David Rientjes Cc: John Allen Cc: "David S. Miller" Cc: Paolo Bonzini Cc: linux-crypto@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Herbert Xu commit 015e42c85f1ec33894579626128b385d4780e883 Author: Colin Ian King Date: Tue Dec 7 18:58:09 2021 +0000 crypto: x86/des3 - remove redundant assignment of variable nbytes The variable nbytes is being assigned a value that is never read, it is being re-assigned in the following statement. The assignment is redundant and can be removed. Signed-off-by: Colin Ian King Signed-off-by: Herbert Xu commit 3c219644075795a99271d345efdfa8b256e55161 Author: Arnd Bergmann Date: Mon Nov 22 23:22:03 2021 +0100 dmaengine: remove slave_id config field All references to the slave_id field have been removed, so remove the field as well to prevent new references from creeping in again. Originally this allowed slave DMA drivers to configure which device is accessed with the dmaengine_slave_config() call, but this was inconsistent, as the same information is also passed while requesting a channel, and never changes in practice. In modern kernels, the device is always selected when requesting the channel, so the .slave_id field is no longer useful. Reviewed-by: Laurent Pinchart Signed-off-by: Arnd Bergmann Acked-by: Mark Brown Link: https://lore.kernel.org/r/20211122222203.4103644-12-arnd@kernel.org Signed-off-by: Vinod Koul commit 93cdb5b0dc56cc7a8b87a61146495f3bdc93d7ba Author: Arnd Bergmann Date: Mon Nov 22 23:22:01 2021 +0100 dmaengine: xilinx_dpdma: stop using slave_id field The display driver wants to pass a custom flag to the DMA engine driver, which it started doing by using the slave_id field that was traditionally used for a different purpose. As there is no longer a correct use for the slave_id field, it should really be removed, and the remaining users changed over to something different. The new mechanism for passing nonstandard settings is using the .peripheral_config field, so use that to pass a newly defined structure here, making it clear that this will not work in portable drivers. Reviewed-by: Laurent Pinchart Signed-off-by: Arnd Bergmann Acked-by: Mark Brown Link: https://lore.kernel.org/r/20211122222203.4103644-10-arnd@kernel.org Signed-off-by: Vinod Koul commit 03de6b273805b3c552ff158f8688555937375926 Author: Arnd Bergmann Date: Mon Nov 22 23:22:00 2021 +0100 dmaengine: qcom-adm: stop abusing slave_id config The slave_id was previously used to pick one DMA slave instead of another, but this is now done through the DMA descriptors in device tree. For the qcom_adm driver, the configuration is documented in the DT binding to contain a tuple of device identifier and a "crci" field, but the implementation ends up using only a single cell for identifying the slave, with the crci getting passed in nonstandard properties of the device, and passed through the dma driver using the old slave_id field. Part of the problem apparently is that the nand driver ends up using only a single DMA request ID, but requires distinct values for "crci" depending on the type of transfer. Change both the dmaengine driver and the two slave drivers to allow the documented binding to work in addition to the ad-hoc passing of crci values. In order to no longer abuse the slave_id field, pass the data using the "peripheral_config" mechanism instead. Signed-off-by: Arnd Bergmann Acked-by: Mark Brown Link: https://lore.kernel.org/r/20211122222203.4103644-9-arnd@kernel.org Signed-off-by: Vinod Koul commit 722d6d2bdcc2dcff5527c704fb8f2bbcb018a232 Author: Arnd Bergmann Date: Mon Nov 22 23:21:59 2021 +0100 dmaengine: sprd: stop referencing config->slave_id It appears that the code that reads the slave_id from the channel config was copied incorrectly from other drivers. Nothing ever sets this field on platforms that use this driver, so remove the reference. Reviewed-by: Baolin Wang Signed-off-by: Arnd Bergmann Acked-by: Mark Brown Link: https://lore.kernel.org/r/20211122222203.4103644-8-arnd@kernel.org Signed-off-by: Vinod Koul commit 134c37fa250a87a7e77c80a7c59ae16c462e46e0 Author: Arnd Bergmann Date: Mon Nov 22 23:21:58 2021 +0100 dmaengine: pxa/mmp: stop referencing config->slave_id The last driver referencing the slave_id on Marvell PXA and MMP platforms was the SPI driver, but this stopped doing so a long time ago, so the TODO from the earlier patch can no be removed. Fixes: b729bf34535e ("spi/pxa2xx: Don't use slave_id of dma_slave_config") Fixes: 13b3006b8ebd ("dma: mmp_pdma: add filter function") Signed-off-by: Arnd Bergmann Acked-by: Mark Brown Link: https://lore.kernel.org/r/20211122222203.4103644-7-arnd@kernel.org Signed-off-by: Vinod Koul commit 37228af82e5f4d7be64f71c63463112b9dd4fc55 Author: Arnd Bergmann Date: Mon Nov 22 23:21:57 2021 +0100 dmaengine: shdma: remove legacy slave_id parsing The slave device is picked through either devicetree or a filter function, and any remaining out-of-tree drivers would have warned about this usage since 2015. Stop interpreting the field finally so it can be removed from the interface. Reviewed-by: Laurent Pinchart Signed-off-by: Arnd Bergmann Acked-by: Mark Brown Link: https://lore.kernel.org/r/20211122222203.4103644-6-arnd@kernel.org Signed-off-by: Vinod Koul commit f59f6aaead975f0ec4d8ff2d59c4ffb8cf0127b2 Author: Arnd Bergmann Date: Mon Nov 22 23:21:56 2021 +0100 mmc: bcm2835: stop setting chan_config->slave_id The field is not interpreted by the DMA engine driver, as all the data is passed from devicetree instead. Remove the assignment so the field can eventually be deleted. Reviewed-by: Nicolas Saenz Julienne Signed-off-by: Arnd Bergmann Acked-by: Ulf Hansson Acked-by: Mark Brown Link: https://lore.kernel.org/r/20211122222203.4103644-5-arnd@kernel.org Signed-off-by: Vinod Koul commit feaa4a09acc9a33211dbe3930357922f7ad9750c Author: Arnd Bergmann Date: Mon Nov 22 23:21:55 2021 +0100 spi: pic32: stop setting dma_config->slave_id Setting slave_id makes no sense with DT based probing, and should eventually get removed entirely. Address this driver by no longer setting the field here. I could not find which DMA driver is used on PIC32, if it's in the tree at all, but none of the obvious ones even care about slave_id any more. Acked-by: Mark Brown Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20211122222203.4103644-4-arnd@kernel.org Signed-off-by: Vinod Koul commit bdecfceffeeb9000e78b0f613069f5c06974b347 Author: Arnd Bergmann Date: Mon Nov 22 23:21:54 2021 +0100 ASoC: dai_dma: remove slave_id field This field is no longer set from any driver now, so remove the last references as well. Signed-off-by: Arnd Bergmann Acked-by: Mark Brown Link: https://lore.kernel.org/r/20211122222203.4103644-3-arnd@kernel.org Signed-off-by: Vinod Koul commit d53939dcc4cfbe6de2c42daec90c199825f6a96f Author: Arnd Bergmann Date: Mon Nov 22 23:22:02 2021 +0100 dmaengine: tegra20-apb: stop checking config->slave_id Nothing sets the slave_id field any more, so stop accessing it to allow the removal of this field. Signed-off-by: Arnd Bergmann Acked-by: Mark Brown Link: https://lore.kernel.org/r/20211122222203.4103644-11-arnd@kernel.org Signed-off-by: Vinod Koul commit 0725ac9ac4492568514a94971f46dd0546684ff8 Author: Arnd Bergmann Date: Mon Nov 22 23:21:53 2021 +0100 ASoC: tegra20-spdif: stop setting slave_id The DMA resource is never set up anywhere, and passing this as slave_id has not been the proper procedure in a long time. As a preparation for removing all slave_id references from the ALSA code, remove this one. According to Dmitry Osipenko, this driver has never been used and the mechanism for configuring DMA would not work as it is implemented, so this part will get rewritten when the driver gets put into use again in the future. Signed-off-by: Arnd Bergmann Reviewed-by: Dmitry Osipenko Acked-by: Mark Brown Link: https://lore.kernel.org/r/20211122222203.4103644-2-arnd@kernel.org Signed-off-by: Vinod Koul commit eacef9fd61dcf5eac8b775bb1814042e78a5c42d Merge: 244a36e50da05 96db14432d979 Author: Dave Airlie Date: Fri Dec 17 15:23:45 2021 +1000 Merge tag 'drm-intel-next-2021-12-14' of ssh://git.freedesktop.org/git/drm/drm-intel into drm-next drm/i915 feature pull #2 for v5.17: Features and functionality: - Add eDP privacy screen support (Hans) - Add Raptor Lake S (RPL-S) support (Anusha) - Add CD clock squashing support (Mika) - Properly support ADL-P without force probe (Clint) - Enable pipe color support (10 bit gamma) for display 13 platforms (Uma) - Update ADL-P DMC firmware to v2.14 (Madhumitha) Refactoring and cleanups: - More FBC refactoring preparing for multiple FBC instances (Ville) - Plane register cleanups (Ville) - Header refactoring and include cleanups (Jani) - Crtc helper and vblank wait function cleanups (Jani, Ville) - Move pipe/transcoder/abox masks under intel_device_info.display (Ville) Fixes: - Add a delay to let eDP source OUI write take effect (Lyude) - Use div32 version of MPLLB word clock for UHBR on SNPS PHY (Jani) - Fix DMC firmware loader overflow check (Harshit Mogalapalli) - Fully disable FBC on FIFO underruns (Ville) - Disable FBC with double wide pipe as mutually exclusive (Ville) - DG2 workarounds (Matt) - Non-x86 build fixes (Siva) - Fix HDR plane max width for NV12 (Vidya) - Disable IRQ for selftest timestamp calculation (Anshuman) - ADL-P VBT DDC pin mapping fix (Tejas) Merges: - Backmerge drm-next for privacy screen plumbing (Jani) Signed-off-by: Dave Airlie From: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/87ee6f5h9u.fsf@intel.com commit 6cc74443a7732d7e93bee3d0c3704a22cc7274d9 Author: Dexuan Cui Date: Wed Dec 15 16:17:48 2021 -0800 net: mana: Add RX fencing RX fencing allows the driver to know that any prior change to the RQs has finished, e.g. when the RQs are disabled/enabled or the hashkey/indirection table are changed, RX fencing is required. Remove the previous workaround "ssleep(1)" and add the real support for RX fencing as the PF driver supports the MANA_FENCE_RQ request now (any old PF driver not supporting the request won't be used in production). Signed-off-by: Dexuan Cui Reviewed-by: Haiyang Zhang Link: https://lore.kernel.org/r/20211216001748.8751-1-decui@microsoft.com Signed-off-by: Jakub Kicinski commit 431b9b4d9789df5486be6d8c4d14d50c27033a97 Author: Yang Li Date: Thu Dec 16 09:54:33 2021 +0800 net: vertexcom: remove unneeded semicolon Eliminate the following coccicheck warning: ./drivers/net/ethernet/vertexcom/mse102x.c:414:2-3: Unneeded semicolon Reported-by: Abaci Robot Signed-off-by: Yang Li Link: https://lore.kernel.org/r/20211216015433.83383-1-yang.lee@linux.alibaba.com Signed-off-by: Jakub Kicinski commit 7ffd9041de76756665df060c266891325426836f Author: Yinjun Zhang Date: Wed Dec 15 20:37:01 2021 -0500 nfp: flower: refine the use of circular buffer The current use of circular buffer to manage stats_context_id is very obscure, and it will cause problem if its element size is not power of two. So change the use more straightforward and scalable, and also change that for mask_id to keep consistency. Signed-off-by: Yinjun Zhang Signed-off-by: Simon Horman Link: https://lore.kernel.org/r/1639618621-5857-1-git-send-email-yinjun.zhang@corigine.com Signed-off-by: Jakub Kicinski commit 4be6181fea1dbfd21a8d73f69d87a6cae2d3023d Author: John Garry Date: Wed Dec 15 22:37:41 2021 +0800 scsi: libsas: Decode SAM status and host byte codes Value 0 is used for SAM status and libsas exec_status bytes codes in sas_end_task() - use defined macros instead. In addition, change to proper enum types. Also replace SAM_STAT_CHECK_CONDITION with SAS_SAM_STAT_CHECK_CONDITION, the former being a proper member of enum exec_status. Link: https://lore.kernel.org/r/1639579061-179473-9-git-send-email-john.garry@huawei.com Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit 37310bad7fa645b21653fd7f13cb6b376d80c919 Author: Qi Liu Date: Wed Dec 15 22:37:40 2021 +0800 scsi: hisi_sas: Fix phyup timeout on FPGA The OOB interrupt and phyup interrupt handlers may run out-of-order in high CPU usage scenarios. Since the hisi_sas_phy.timer is added in hisi_sas_phy_oob_ready() and disarmed in phy_up_v3_hw(), this out-of-order execution will cause hisi_sas_phy.timer timeout to trigger. To solve, protect hisi_sas_phy.timer and .attached with a lock, and ensure that the timer won't be added after phyup handler completes. Link: https://lore.kernel.org/r/1639579061-179473-8-git-send-email-john.garry@huawei.com Signed-off-by: Qi Liu Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit 16775db613c2bdea09705dcb876942c0641a1098 Author: Qi Liu Date: Wed Dec 15 22:37:39 2021 +0800 scsi: hisi_sas: Prevent parallel FLR and controller reset If we issue a controller reset command during executing a FLR a hung task may be found: Call trace: __switch_to+0x158/0x1cc __schedule+0x2e8/0x85c schedule+0x7c/0x110 schedule_timeout+0x190/0x1cc __down+0x7c/0xd4 down+0x5c/0x7c hisi_sas_task_exec+0x510/0x680 [hisi_sas_main] hisi_sas_queue_command+0x24/0x30 [hisi_sas_main] smp_execute_task_sg+0xf4/0x23c [libsas] sas_smp_phy_control+0x110/0x1e0 [libsas] transport_sas_phy_reset+0xc8/0x190 [libsas] phy_reset_work+0x2c/0x40 [libsas] process_one_work+0x1dc/0x48c worker_thread+0x15c/0x464 kthread+0x160/0x170 ret_from_fork+0x10/0x18 This is a race condition which occurs when the FLR completes first. Here the host HISI_SAS_RESETTING_BIT flag out gets of sync as HISI_SAS_RESETTING_BIT is not always cleared with the hisi_hba.sem held, so now only set/unset HISI_SAS_RESETTING_BIT under hisi_hba.sem . Link: https://lore.kernel.org/r/1639579061-179473-7-git-send-email-john.garry@huawei.com Signed-off-by: Qi Liu Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit 20c634932ae8978435645b466c99b3fc1a80545a Author: Qi Liu Date: Wed Dec 15 22:37:38 2021 +0800 scsi: hisi_sas: Prevent parallel controller reset and control phy command A user may issue a control phy command from sysfs at any time, even if the controller is resetting. If a phy is disabled by hardreset/linkreset command before calling get_phys_state() in the reset path, the saved phy state may be incorrect. To avoid incorrectly recording the phy state, use hisi_hba.sem to ensure that the controller reset may not run at the same time as when the phy control function is running. Link: https://lore.kernel.org/r/1639579061-179473-6-git-send-email-john.garry@huawei.com Signed-off-by: Qi Liu Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit dc313f6b125b095d3d2683d94d5f69c8dc9bdc36 Author: John Garry Date: Wed Dec 15 22:37:37 2021 +0800 scsi: hisi_sas: Factor out task prep and delivery code The task prep code is the same between the normal path (in hisi_sas_task_prep()) and the internal abort path, so factor is out into a common function. Link: https://lore.kernel.org/r/1639579061-179473-5-git-send-email-john.garry@huawei.com Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit 08c61b5d902b70180b517e9f2616ad70b7a98dcf Author: John Garry Date: Wed Dec 15 22:37:36 2021 +0800 scsi: hisi_sas: Pass abort structure for internal abort To help factor out code in future, it's useful to know if we're executing an internal abort, so pass a pointer to the structure. The idea is that a NULL pointer means not an internal abort. Link: https://lore.kernel.org/r/1639579061-179473-4-git-send-email-john.garry@huawei.com Reviewed-by: Xiang Chen Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit 934385a4fd5926650b20131bf3a435199a3d0af2 Author: John Garry Date: Wed Dec 15 22:37:35 2021 +0800 scsi: hisi_sas: Make internal abort have no task proto For an internal abort, the task does not have a protocol, so set to none. This will make it easier to differentiate internal abort tasks in future. Link: https://lore.kernel.org/r/1639579061-179473-3-git-send-email-john.garry@huawei.com Reviewed-by: Xiang Chen Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit 0e4620856b89335426a17904933a92346ee4599d Author: John Garry Date: Wed Dec 15 22:37:34 2021 +0800 scsi: hisi_sas: Start delivery hisi_sas_task_exec() directly Currently we start delivery of commands to the DQ after returning from hisi_sas_task_exec() with success. Let's just start delivery directly in that function without having to check if some local variable is set. Link: https://lore.kernel.org/r/1639579061-179473-2-git-send-email-john.garry@huawei.com Reviewed-by: Xiang Chen Signed-off-by: John Garry Signed-off-by: Martin K. Petersen commit efac162a4e4dc4cebcc658e02676821ca834b56c Author: Christoph Hellwig Date: Tue Dec 14 17:36:05 2021 +0100 scsi: efct: Don't pass GFP_DMA to dma_alloc_coherent() dma_alloc_coherent() ignores the zone specifiers so this is pointless and confusing. Link: https://lore.kernel.org/r/20211214163605.416288-1-hch@lst.de Reviewed-by: James Smart Signed-off-by: Christoph Hellwig Signed-off-by: Martin K. Petersen commit 99c66a8868e33522ebc6fd8a99e32f0d544a014f Author: Bean Huo Date: Tue Dec 14 13:05:37 2021 +0100 scsi: ufs: core: Fix deadlock issue in ufshcd_wait_for_doorbell_clr() Call shost_for_each_device() with holding host->host_lock will cause a deadlock situation, which will cause the system to stall (the log as follow). Fix this issue by using __shost_for_each_device() in ufshcd_pending_cmds(). stalls on CPUs/tasks: all trace: __switch_to+0x120/0x170 0xffff800011643998 ask dump for CPU 5: ask:kworker/u16:2 state:R running task stack: 0 pid: 80 ppid: 2 flags:0x0000000a orkqueue: events_unbound async_run_entry_fn all trace: __switch_to+0x120/0x170 0x0 ask dump for CPU 6: ask:kworker/u16:6 state:R running task stack: 0 pid: 164 ppid: 2 flags:0x0000000a orkqueue: events_unbound async_run_entry_fn all trace: __switch_to+0x120/0x170 0xffff54e7c4429f80 ask dump for CPU 7: ask:kworker/u16:4 state:R running task stack: 0 pid: 153 ppid: 2 flags:0x0000000a orkqueue: events_unbound async_run_entry_fn all trace: __switch_to+0x120/0x170 blk_mq_run_hw_queue+0x34/0x110 blk_mq_sched_insert_request+0xb0/0x120 blk_execute_rq_nowait+0x68/0x88 blk_execute_rq+0x4c/0xd8 __scsi_execute+0xec/0x1d0 scsi_vpd_inquiry+0x84/0xf0 scsi_get_vpd_buf+0x34/0xb8 scsi_attach_vpd+0x34/0x140 scsi_probe_and_add_lun+0xa6c/0xab8 __scsi_scan_target+0x438/0x4f8 scsi_scan_channel+0x6c/0xa8 scsi_scan_host_selected+0xf0/0x150 do_scsi_scan_host+0x88/0x90 scsi_scan_host+0x1b4/0x1d0 ufshcd_async_scan+0x248/0x310 async_run_entry_fn+0x30/0x178 process_one_work+0x1e8/0x368 worker_thread+0x40/0x478 kthread+0x174/0x180 ret_from_fork+0x10/0x20 Link: https://lore.kernel.org/r/20211214120537.531628-1-huobean@gmail.com Fixes: 8d077ede48c1 ("scsi: ufs: Optimize the command queueing code") Reported-by: YongQin Liu Reported-by: Amit Pundir Tested-by: John Stultz Tested-by: Bjorn Andersson Reviewed-by: Bjorn Andersson Co-developed-by: Bart Van Assche Signed-off-by: Bart Van Assche Signed-off-by: Bean Huo Signed-off-by: Martin K. Petersen commit baea0e833f7612483dcb2351240da19f0d0bc011 Author: Hannes Reinecke Date: Tue Dec 14 12:11:39 2021 +0100 scsi: qla2xxx: Synchronize rport dev_loss_tmo setting Currently, the dev_loss_tmo setting is only ever used for SCSI devices. This patch reshuffles initialisation such that the SCSI remote ports are registered before the NVMe ones, allowing the dev_loss_tmo setting to be synchronized between SCSI and NVMe. Link: https://lore.kernel.org/r/20211214111139.52503-1-dwagner@suse.de Reviewed-by: Himanshu Madhani Signed-off-by: Hannes Reinecke Signed-off-by: Daniel Wagner Signed-off-by: Martin K. Petersen commit 496f3324048b6ce024af19ac84a03f6bdef93b7d Author: Christy Lee Date: Thu Dec 16 13:33:58 2021 -0800 Only output backtracking information in log level 2 Backtracking information is very verbose, don't print it in log level 1 to improve readability. Signed-off-by: Christy Lee Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211216213358.3374427-4-christylee@fb.com commit 2e5766483c8c5cf886b4dc647a1741738dde7d79 Author: Christy Lee Date: Thu Dec 16 19:42:45 2021 -0800 bpf: Right align verifier states in verifier logs. Make the verifier logs more readable, print the verifier states on the corresponding instruction line. If the previous line was not a bpf instruction, then print the verifier states on its own line. Before: Validating test_pkt_access_subprog3() func#3... 86: R1=invP(id=0) R2=ctx(id=0,off=0,imm=0) R10=fp0 ; int test_pkt_access_subprog3(int val, struct __sk_buff *skb) 86: (bf) r6 = r2 87: R2=ctx(id=0,off=0,imm=0) R6_w=ctx(id=0,off=0,imm=0) 87: (bc) w7 = w1 88: R1=invP(id=0) R7_w=invP(id=0,umax_value=4294967295,var_off=(0x0; 0xffffffff)) ; return get_skb_len(skb) * get_skb_ifindex(val, skb, get_constant(123)); 88: (bf) r1 = r6 89: R1_w=ctx(id=0,off=0,imm=0) R6_w=ctx(id=0,off=0,imm=0) 89: (85) call pc+9 Func#4 is global and valid. Skipping. 90: R0_w=invP(id=0) 90: (bc) w8 = w0 91: R0_w=invP(id=0) R8_w=invP(id=0,umax_value=4294967295,var_off=(0x0; 0xffffffff)) ; return get_skb_len(skb) * get_skb_ifindex(val, skb, get_constant(123)); 91: (b7) r1 = 123 92: R1_w=invP123 92: (85) call pc+65 Func#5 is global and valid. Skipping. 93: R0=invP(id=0) After: 86: R1=invP(id=0) R2=ctx(id=0,off=0,imm=0) R10=fp0 ; int test_pkt_access_subprog3(int val, struct __sk_buff *skb) 86: (bf) r6 = r2 ; R2=ctx(id=0,off=0,imm=0) R6_w=ctx(id=0,off=0,imm=0) 87: (bc) w7 = w1 ; R1=invP(id=0) R7_w=invP(id=0,umax_value=4294967295,var_off=(0x0; 0xffffffff)) ; return get_skb_len(skb) * get_skb_ifindex(val, skb, get_constant(123)); 88: (bf) r1 = r6 ; R1_w=ctx(id=0,off=0,imm=0) R6_w=ctx(id=0,off=0,imm=0) 89: (85) call pc+9 Func#4 is global and valid. Skipping. 90: R0_w=invP(id=0) 90: (bc) w8 = w0 ; R0_w=invP(id=0) R8_w=invP(id=0,umax_value=4294967295,var_off=(0x0; 0xffffffff)) ; return get_skb_len(skb) * get_skb_ifindex(val, skb, get_constant(123)); 91: (b7) r1 = 123 ; R1_w=invP123 92: (85) call pc+65 Func#5 is global and valid. Skipping. 93: R0=invP(id=0) Signed-off-by: Christy Lee Acked-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov commit 87f77d37d398d92a9963890b14f336dc394f6fa0 Merge: 8c2d04551545d 69002c8ce914e Author: Martin K. Petersen Date: Thu Dec 16 22:38:19 2021 -0500 Merge branch '5.16/scsi-fixes' into 5.17/scsi-staging Pull in the 5.16 fixes branch to resolve a conflict in the UFS driver core. Conflicts: drivers/scsi/ufs/ufshcd.c Signed-off-by: Martin K. Petersen commit e1e06edd94d5b3171401a1435a17251102cc8494 Author: Adam Ford Date: Tue Dec 14 18:46:21 2021 -0600 dt-bindings: soc: add binding for i.MX8MN DISP blk-ctrl Add the DT binding for the i.MX8MN DISP blk-ctrl. Signed-off-by: Adam Ford Reviewed-by: Rob Herring Reviewed-by: Lucas Stach Signed-off-by: Shawn Guo commit 7f511d514e8c34b6dd0c17b5496e48b2a6a2626c Author: Adam Ford Date: Tue Dec 14 18:46:22 2021 -0600 soc: imx: imx8m-blk-ctrl: add i.MX8MN DISP blk-ctrl This adds the description for the i.MX8MN disp blk-ctrl. Signed-off-by: Adam Ford Reviewed-by: Lucas Stach Signed-off-by: Shawn Guo commit b77beaaee1be62a4623dd7142868c2e1180d8288 Author: Adam Ford Date: Tue Dec 14 18:46:20 2021 -0600 dt-bindings: power: imx8mn: add defines for DISP blk-ctrl domains This adds the defines for the power domains provided by the DISP blk-ctrl. Signed-off-by: Adam Ford Acked-by: Rob Herring Reviewed-by: Lucas Stach Signed-off-by: Shawn Guo commit a0ec8a3a4c8122c1abae04e90c66e79e77eed357 Author: Adam Ford Date: Tue Dec 14 18:46:19 2021 -0600 soc: imx: gpcv2: Add dispmix and mipi domains to imx8mn The dispmix will be needed for the blkctl driver, so add it to the gpcv2. Signed-off-by: Adam Ford Reviewed-by: Lucas Stach Signed-off-by: Shawn Guo commit e2a6d22f3b48dffcab1dbcb162572ef5a923f24d Author: Adam Ford Date: Tue Dec 14 18:46:18 2021 -0600 soc: imx: gpcv2: keep i.MX8MN gpumix bus clock enabled Like the i.MX8MM, keep the gpumix clocks running when the domain is active. Signed-off-by: Adam Ford Reviewed-by: Lucas Stach Signed-off-by: Shawn Guo commit 3951cc6bae4cd252a2efec5bad5d30265d525e0f Author: Yunus Bas Date: Thu Dec 16 09:41:07 2021 +0100 ARM: dts: imx6: phytec: Add PEB-WLBT-05 support The PEB-WLBT-05 is equipped with a Sterling-LWB radio module, which is capable of Wi-Fi 802.11 b/g/n and Bluetooth 4.2. Signed-off-by: Yunus Bas Signed-off-by: Shawn Guo commit 0f55f9ed21f96630c6ec96805d42f92c0b458b37 Author: Christy Lee Date: Thu Dec 16 13:33:56 2021 -0800 bpf: Only print scratched registers and stack slots to verifier logs. When printing verifier state for any log level, print full verifier state only on function calls or on errors. Otherwise, only print the registers and stack slots that were accessed. Log size differences: verif_scale_loop6 before: 234566564 verif_scale_loop6 after: 72143943 69% size reduction kfree_skb before: 166406 kfree_skb after: 55386 69% size reduction Before: 156: (61) r0 = *(u32 *)(r1 +0) 157: R0_w=invP(id=0,umax_value=4294967295,var_off=(0x0; 0xffffffff)) R1=ctx(id=0,off=0,imm=0) R2_w=invP0 R10=fp0 fp-8_w=00000000 fp-16_w=00\ 000000 fp-24_w=00000000 fp-32_w=00000000 fp-40_w=00000000 fp-48_w=00000000 fp-56_w=00000000 fp-64_w=00000000 fp-72_w=00000000 fp-80_w=00000\ 000 fp-88_w=00000000 fp-96_w=00000000 fp-104_w=00000000 fp-112_w=00000000 fp-120_w=00000000 fp-128_w=00000000 fp-136_w=00000000 fp-144_w=00\ 000000 fp-152_w=00000000 fp-160_w=00000000 fp-168_w=00000000 fp-176_w=00000000 fp-184_w=00000000 fp-192_w=00000000 fp-200_w=00000000 fp-208\ _w=00000000 fp-216_w=00000000 fp-224_w=00000000 fp-232_w=00000000 fp-240_w=00000000 fp-248_w=00000000 fp-256_w=00000000 fp-264_w=00000000 f\ p-272_w=00000000 fp-280_w=00000000 fp-288_w=00000000 fp-296_w=00000000 fp-304_w=00000000 fp-312_w=00000000 fp-320_w=00000000 fp-328_w=00000\ 000 fp-336_w=00000000 fp-344_w=00000000 fp-352_w=00000000 fp-360_w=00000000 fp-368_w=00000000 fp-376_w=00000000 fp-384_w=00000000 fp-392_w=\ 00000000 fp-400_w=00000000 fp-408_w=00000000 fp-416_w=00000000 fp-424_w=00000000 fp-432_w=00000000 fp-440_w=00000000 fp-448_w=00000000 ; return skb->len; 157: (95) exit Func#4 is safe for any args that match its prototype Validating get_constant() func#5... 158: R1=invP(id=0) R10=fp0 ; int get_constant(long val) 158: (bf) r0 = r1 159: R0_w=invP(id=1) R1=invP(id=1) R10=fp0 ; return val - 122; 159: (04) w0 += -122 160: R0_w=invP(id=0,umax_value=4294967295,var_off=(0x0; 0xffffffff)) R1=invP(id=1) R10=fp0 ; return val - 122; 160: (95) exit Func#5 is safe for any args that match its prototype Validating get_skb_ifindex() func#6... 161: R1=invP(id=0) R2=ctx(id=0,off=0,imm=0) R3=invP(id=0) R10=fp0 ; int get_skb_ifindex(int val, struct __sk_buff *skb, int var) 161: (bc) w0 = w3 162: R0_w=invP(id=0,umax_value=4294967295,var_off=(0x0; 0xffffffff)) R1=invP(id=0) R2=ctx(id=0,off=0,imm=0) R3=invP(id=0) R10=fp0 After: 156: (61) r0 = *(u32 *)(r1 +0) 157: R0_w=invP(id=0,umax_value=4294967295,var_off=(0x0; 0xffffffff)) R1=ctx(id=0,off=0,imm=0) ; return skb->len; 157: (95) exit Func#4 is safe for any args that match its prototype Validating get_constant() func#5... 158: R1=invP(id=0) R10=fp0 ; int get_constant(long val) 158: (bf) r0 = r1 159: R0_w=invP(id=1) R1=invP(id=1) ; return val - 122; 159: (04) w0 += -122 160: R0_w=invP(id=0,umax_value=4294967295,var_off=(0x0; 0xffffffff)) ; return val - 122; 160: (95) exit Func#5 is safe for any args that match its prototype Validating get_skb_ifindex() func#6... 161: R1=invP(id=0) R2=ctx(id=0,off=0,imm=0) R3=invP(id=0) R10=fp0 ; int get_skb_ifindex(int val, struct __sk_buff *skb, int var) 161: (bc) w0 = w3 162: R0_w=invP(id=0,umax_value=4294967295,var_off=(0x0; 0xffffffff)) R3=invP(id=0) Signed-off-by: Christy Lee Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211216213358.3374427-2-christylee@fb.com commit 7cd2802d7496c1fc76f42dc045b48cc16d11df39 Merge: 0f473bb6ed2d0 6441998e2e371 Author: Jakub Kicinski Date: Thu Dec 16 16:13:19 2021 -0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net No conflicts. Signed-off-by: Jakub Kicinski commit 90091c367e74d5b58d9ebe979cc363f7468f58d3 Author: Misono Tomohiro Date: Thu Aug 5 19:12:36 2021 +0900 selftest/lkdtm: Skip stack-entropy test if lkdtm is not available Exit with return code 4 if lkdtm is not available like other tests in order to properly skip the test. Signed-off-by: Misono Tomohiro Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20210805101236.1140381-1-misono.tomohiro@jp.fujitsu.com commit bc93a22a19eb2b68a16ecf04cdf4b2ed65aaf398 Author: Christophe Leroy Date: Fri Oct 8 18:58:40 2021 +0200 lkdtm: Fix content of section containing lkdtm_rodata_do_nothing() On a kernel without CONFIG_STRICT_KERNEL_RWX, running EXEC_RODATA test leads to "Illegal instruction" failure. Looking at the content of rodata_objcopy.o, we see that the function content zeroes only: Disassembly of section .rodata: 0000000000000000 <.lkdtm_rodata_do_nothing>: 0: 00 00 00 00 .long 0x0 Add the contents flag in order to keep the content of the section while renaming it. Disassembly of section .rodata: 0000000000000000 <.lkdtm_rodata_do_nothing>: 0: 4e 80 00 20 blr Fixes: e9e08a07385e ("lkdtm: support llvm-objcopy") Cc: stable@vger.kernel.org Cc: Kees Cook Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Cc: Nick Desaulniers Cc: Nathan Chancellor Signed-off-by: Christophe Leroy Reviewed-by: Nick Desaulniers Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/8900731fbc05fb8b0de18af7133a8fc07c3c53a1.1633712176.git.christophe.leroy@csgroup.eu commit 026c6fa1a525ca3f8a615052e45d766208989597 Author: Ard Biesheuvel Date: Thu Oct 7 10:12:35 2021 +0200 lkdtm: avoid printk() in recursive_loop() The recursive_loop() function is intended as a diagnostic to ensure that exhausting the stack is caught and mitigated. Currently, it uses pr_info() to ensure that the function has side effects that the compiler cannot simply optimize away, so that the stack footprint does not get reduced inadvertently. The typical mitigation for stack overflow is to kill the task, and this overflow may occur inside the call to pr_info(), which means it could be holding the console lock when this happens. This means that the console lock is never going to be released again, preventing the diagnostic prints related to the stack overflow handling from being visible on the console. So let's replace the call to pr_info() with a call to memzero_explicit(), which is not a 'magic' function name like memset() or memcpy(), which the compiler may replace with plain loads and stores. To ensure that the stack frames are nested rather than tail-called, put the call to memzero_explicit() after the recursive call. Signed-off-by: Ard Biesheuvel Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20211007081235.382697-1-ardb@kernel.org commit 861dc0d7fd972f2064ff48b211955717163a11e0 Author: Kees Cook Date: Sun Sep 12 15:27:52 2021 -0700 lkdtm: Note that lkdtm_kernel_info should be removed in the future As per Linus's request, remove lkdtm_kernel_info once sufficient reporting exists in CI systems: https://lore.kernel.org/lkml/CAHk-=wiFvfkoFixTapvvyPMN9pq5G-+Dys2eSyBa1vzDGAO5+A@mail.gmail.com Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Signed-off-by: Kees Cook commit ddffdcce9caa63ad7f048072594f79f3d66e26ee Author: Tang Yizhou Date: Wed Dec 15 11:37:26 2021 +0800 docs/zh_CN: Add sched-design-CFS Chinese translation Translate scheduler/sched-design-CFS.rst into Chinese. Signed-off-by: Tang Yizhou Reviewed-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/20211215033726.4538-1-tangyizhou@huawei.com Signed-off-by: Jonathan Corbet commit 171e9af138193661d52ea8642b3ecd0b504560ae Author: Tang Yizhou Date: Mon Dec 13 17:59:45 2021 +0800 docs/zh_CN: Add sched-capacity Chinese translation Translate scheduler/sched-capacity.rst into Chinese. Signed-off-by: Tang Yizhou Reviewed-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/20211213095945.17011-2-tangyizhou@huawei.com Signed-off-by: Jonathan Corbet commit 4658e15d39e6806e612a4cae9b6510ec2e18bb9e Merge: 1a6369ba62492 fd1740b6abac3 Author: Alexei Starovoitov Date: Thu Dec 16 14:57:10 2021 -0800 Merge branch 'bpf: remove the cgroup -> bpf header dependecy' Jakub Kicinski says: ==================== Changes to bpf.h tend to clog up our build systems. The netdev/bpf build bot does incremental builds to save time (reusing the build directory to only rebuild changed objects). This is the rough breakdown of how many objects needs to be rebuilt based on file touched: kernel.h 40633 bpf.h 17881 bpf-cgroup.h 17875 skbuff.h 10696 bpf-netns.h 7604 netdevice.h 7452 filter.h 5003 sock.h 4959 tcp.h 4048 As the stats show touching bpf.h is _very_ expensive. Bulk of the objects get rebuilt because MM includes cgroup headers. Luckily bpf-cgroup.h does not fundamentally depend on bpf.h so we can break that dependency and reduce the number of objects. With the patches applied touching bpf.h causes 5019 objects to be rebuilt (17881 / 5019 = 3.56x). That's pretty much down to filter.h plus noise. v2: Try to make the new headers wider in scope. Collapse bpf-link and bpf-cgroup-types into one header, which may serve as "BPF kernel API" header in the future if needed. Rename bpf-cgroup-storage.h to bpf-inlines.h. Add a fix for the s390 build issue. v3: https://lore.kernel.org/all/20211215061916.715513-1-kuba@kernel.org/ Merge bpf-includes.h into bpf.h. v4: https://lore.kernel.org/all/20211215181231.1053479-1-kuba@kernel.org/ Change course - break off cgroup instead of breaking off bpf. v5: Add forward declaration of struct bpf_prog to perf_event.h when !CONFIG_BPF_SYSCALL (kbuild bot). ==================== Signed-off-by: Alexei Starovoitov commit fd1740b6abac39f68ce12e201697f106e0f1d519 Author: Jakub Kicinski Date: Wed Dec 15 18:55:38 2021 -0800 bpf: Remove the cgroup -> bpf header dependecy Remove the dependency from cgroup-defs.h to bpf-cgroup.h and bpf.h. This reduces the incremental build size of x86 allmodconfig after bpf.h was touched from ~17k objects rebuilt to ~5k objects. bpf.h is 2.2kLoC and is modified relatively often. We need a new header with just the definition of struct cgroup_bpf and enum cgroup_bpf_attach_type, this is akin to cgroup-defs.h. Signed-off-by: Jakub Kicinski Signed-off-by: Alexei Starovoitov Acked-by: Tejun Heo Link: https://lore.kernel.org/bpf/20211216025538.1649516-4-kuba@kernel.org commit aef2feda97b840ec38e9fa53d0065188453304e8 Author: Jakub Kicinski Date: Wed Dec 15 18:55:37 2021 -0800 add missing bpf-cgroup.h includes We're about to break the cgroup-defs.h -> bpf-cgroup.h dependency, make sure those who actually need more than the definition of struct cgroup_bpf include bpf-cgroup.h explicitly. Signed-off-by: Jakub Kicinski Signed-off-by: Alexei Starovoitov Acked-by: Tejun Heo Link: https://lore.kernel.org/bpf/20211216025538.1649516-3-kuba@kernel.org commit f7ea534a0920dbaf71a8003936e178e14ec9271d Author: Jakub Kicinski Date: Wed Dec 15 18:55:36 2021 -0800 add includes masked by cgroup -> bpf dependency cgroup pulls in BPF which pulls in a lot of includes. We're about to break that chain so fix those who were depending on it. Signed-off-by: Jakub Kicinski Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211216025538.1649516-2-kuba@kernel.org commit 6b3672adbac651e5a203abaf58b142c4f53cb270 Author: Yanteng Si Date: Sat Dec 11 20:11:45 2021 +0800 docs/zh_CN: add sysfs-pci trnaslation Translate .../PCI/sysfs-pci.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/0c18e5eadaf47ec2befcf38e515c244cd700e13f.1639224005.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit bbc477ee6e30dc76cb467f4fc71d473edf1694fd Author: Yanteng Si Date: Sat Dec 11 20:11:44 2021 +0800 docs/zh_CN: add msi-howto translation Translate .../PCI/msi-howto.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/d62846e2e820f600c27dc5e49887b3a2892eec17.1639224005.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit 0e805b11866260d99c931be8a4cd54cda32eab3e Author: Mauro Carvalho Chehab Date: Sat Dec 11 09:57:00 2021 +0100 docs: address some text issues with css/theme support Fix: - overriden ->overridden - some whitespace issues introduced at the css/theme Makefile help. Reported-by: Randy Dunlap Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Randy Dunlap Link: https://lore.kernel.org/r/b0b166025019f7cc4f122bd789c79ba28cc2d29d.1639212812.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit 98d614bdaa58360bd3dec90710e7069cafad4c76 Author: Mauro Carvalho Chehab Date: Sat Dec 11 09:56:59 2021 +0100 docs: Makefile: use the right path for DOCS_CSS When make is used with O=, the location of the css file won't be get right: $ make DOCS_THEME=nature DOCS_CSS=my_css.css O=DOCS SPHINXDIRS=x86 -j9 htmldocs make[1]: Entering directory '/work/lnx/next/next-2021-1210/DOCS' ... cp: cannot stat 'my_css.css': No such file or directory Fix it in a way that both relative and absolute paths will be handled. Reported-by: Randy Dunlap Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Randy Dunlap Tested-by: Randy Dunlap Link: https://lore.kernel.org/r/cea4ff1237ae9a99bc6509ab1bf9c70acd97e265.1639212812.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit dc10ec987903c2f6ee74a04da278a1f830fd9f3e Author: Anssi Hannula Date: Sat Dec 11 21:41:59 2021 +0200 docs/vm: clarify overcommit amount sysctl behavior Documentation/vm/overcommit-accounting.rst says that the overcommit amount can be set via vm.overcommit_ratio and vm.overcommit_kbytes. Add a clarification that those only take effect in overcommit handling mode 2 ("Don't overcommit"), i.e. they do not act as an "additional" limit that is always enforced. Signed-off-by: Anssi Hannula Reviewed-by: David Hildenbrand Link: https://lore.kernel.org/r/20211211194159.3137362-1-anssi.hannula@iki.fi Signed-off-by: Jonathan Corbet commit 06500926052b94ccdd75bb185c35391a72cadb57 Author: Tang Yizhou Date: Thu Dec 16 10:34:07 2021 +0800 docs/zh_CN: Add cputopology Chinese translation Translate admin-guide/cputopology.rst into Chinese. Signed-off-by: Tang Yizhou Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/20211216023407.10976-1-tangyizhou@huawei.com Signed-off-by: Jonathan Corbet commit 6c5ccd24ff17d45594199d03f47d3b82c205fdc8 Author: Miguel Ojeda Date: Tue Dec 14 20:14:15 2021 +0100 Remove mentions of the Trivial Patch Monkey Apparently, it was decided that trivial@kernel.org is no longer used. Link: https://lore.kernel.org/lkml/fe86efbd-4e03-76c8-55cf-dabd33e85823@infradead.org/ Co-developed-by: Joe Perches Signed-off-by: Joe Perches Signed-off-by: Miguel Ojeda Acked-by: Randy Dunlap Link: https://lore.kernel.org/r/20211214191415.GA19070@kernel.org Signed-off-by: Jonathan Corbet commit 1f012283e9360fb4007308f04cfaeb205e34b684 Author: Rob Herring Date: Wed Dec 15 09:01:02 2021 -0600 of/fdt: Rework early_init_dt_scan_memory() to call directly Use of the of_scan_flat_dt() function predates libfdt and is discouraged as libfdt provides a nicer set of APIs. Rework early_init_dt_scan_memory() to be called directly and use libfdt. Cc: John Crispin Cc: Thomas Bogendoerfer Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Frank Rowand Cc: linux-mips@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Reviewed-by: Frank Rowand Signed-off-by: Rob Herring Tested-by: Michael Ellerman Link: https://lore.kernel.org/r/20211215150102.1303588-1-robh@kernel.org commit d665881d2171b62ca1ea23be89be6f2a8a330bb2 Author: Rob Herring Date: Thu Nov 18 12:12:11 2021 -0600 of/fdt: Rework early_init_dt_scan_root() to call directly Use of the of_scan_flat_dt() function predates libfdt and is discouraged as libfdt provides a nicer set of APIs. Rework early_init_dt_scan_root() to be called directly and use libfdt. Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Frank Rowand Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Rob Herring Reviewed-by: Frank Rowand Link: https://lore.kernel.org/r/20211118181213.1433346-3-robh@kernel.org commit 60f20d84dc813f1342771a3e4f06d89da26dc412 Author: Rob Herring Date: Thu Nov 18 12:12:10 2021 -0600 of/fdt: Rework early_init_dt_scan_chosen() to call directly Use of the of_scan_flat_dt() function predates libfdt and is discouraged as libfdt provides a nicer set of APIs. Rework early_init_dt_scan_chosen() to be called directly and use libfdt. Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Frank Rowand Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Rob Herring Reviewed-by: Frank Rowand Link: https://lore.kernel.org/r/20211118181213.1433346-2-robh@kernel.org commit 653becec6d568a28666f726ed4c84b10f3c09f5e Author: Thierry Reding Date: Tue Dec 7 15:17:22 2021 +0100 i2c: aspeed: Remove unused includes No symbols from the linux/irqchip/chained_irq.h and linux/irqdomain.h headers are used in the driver, so they can be removed. Signed-off-by: Thierry Reding Reviewed-by: Joel Stanley Signed-off-by: Wolfram Sang commit b18794ebc79a003f5027e93a677643185948d0ec Author: Rob Herring Date: Mon Dec 6 11:42:37 2021 -0600 dt-bindings: i2c: aspeed: Drop stray '#interrupt-cells' '#interrupt-cells' is not documented which causes a warning when 'unevaluatedProperties' is implemented. Unless the I2C controller is also an interrupt controller, '#interrupt-cells' is not valid. This doesn't appear to be the case from the driver, so just remove it from the example. Signed-off-by: Rob Herring Reviewed-by: Thierry Reding Signed-off-by: Wolfram Sang commit 44df8a79283d94f4aed2e3a14ed67e49a3c210ca Author: Wolfram Sang Date: Wed Dec 8 09:45:43 2021 +0100 i2c: sh_mobile: update to new DMAENGINE API when terminating dmaengine_terminate_all() is deprecated. When converting the existing calls, it turned out that the termination in the DMA setup and callback were superfluous and only a side effect of simply calling rcar_i2c_cleanup_dma(). As either no DMA transfers have been submitted yet or the last one has successfully completed, there is nothing to terminate and we can leave it out. So, merge the DMA unmap and cleanup function to save some code. Then, add a flag if the new cleanup function needs to terminate DMA. This is only the case for the erorr handling in the main thread, so we can finally switch from dmaengine_terminate_all() to dmaengine_terminate_sync() here. Signed-off-by: Wolfram Sang Signed-off-by: Wolfram Sang commit a5f7cf953f2b47e5025a7acd1698eea997b2fd94 Author: Wolfram Sang Date: Wed Dec 8 09:45:42 2021 +0100 i2c: rcar: update to new DMAENGINE API when terminating dmaengine_terminate_all() is deprecated. When converting the existing calls, it turned out that the termination in the interrupt handlers was superfluous and only a side effect of simply calling rcar_i2c_cleanup_dma(). As either no DMA transfers have been submitted yet or the last one has successfully completed, there is nothing to terminate and we can leave it out. So, merge the DMA unmap and cleanup function to save some code. Then, add a flag if the new cleanup function needs to terminate DMA. This is only the case for the erorr handling in the main thread, so we can finally switch from dmaengine_terminate_all() to dmaengine_terminate_sync() here. Signed-off-by: Wolfram Sang Signed-off-by: Wolfram Sang commit cd6cf06590b9792340dceaa285138777f3cc4d90 Author: Thomas Gleixner Date: Mon Dec 6 23:51:52 2021 +0100 genirq/msi: Convert storage to xarray The current linked list storage for MSI descriptors is suboptimal in several ways: 1) Looking up a MSI desciptor requires a O(n) list walk in the worst case 2) The upcoming support of runtime expansion of MSI-X vectors would need to do a full list walk to figure out whether a particular index is already associated. 3) Runtime expansion of sparse allocations is even more complex as the current implementation assumes an ordered list (increasing MSI index). Use an xarray which solves all of the above problems nicely. Signed-off-by: Thomas Gleixner Tested-by: Michael Kelley Tested-by: Nishanth Menon Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211206210749.280627070@linutronix.de commit bf5e758f02fc739589dcc6a3395c3a3eb77b5c90 Author: Thomas Gleixner Date: Mon Dec 6 23:51:50 2021 +0100 genirq/msi: Simplify sysfs handling The sysfs handling for MSI is a convoluted maze and it is in the way of supporting dynamic expansion of the MSI-X vectors because it only supports a one off bulk population/free of the sysfs entries. Change it to do: 1) Creating an empty sysfs attribute group when msi_device_data is allocated 2) Populate the entries when the MSI descriptor is initialized 3) Free the entries when a MSI descriptor is detached from a Linux interrupt. 4) Provide functions for the legacy non-irqdomain fallback code to do a bulk population/free. This code won't support dynamic expansion. This makes the code simpler and reduces the number of allocations as the empty attribute group can be shared. Signed-off-by: Thomas Gleixner Tested-by: Michael Kelley Tested-by: Nishanth Menon Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211206210749.224917330@linutronix.de commit ef3350c53d2aac65cf1c4ecc968bbb1de5f421ea Author: Thomas Gleixner Date: Mon Dec 6 23:51:49 2021 +0100 genirq/msi: Add abuse prevention comment to msi header Hope dies last. Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211206210749.170847844@linutronix.de commit cc9a246dbf6bdef56d9eee296a1db52dd0607976 Author: Thomas Gleixner Date: Mon Dec 6 23:51:47 2021 +0100 genirq/msi: Mop up old interfaces Get rid of the old iterators, alloc/free functions and adjust the core code accordingly. Signed-off-by: Thomas Gleixner Tested-by: Michael Kelley Tested-by: Nishanth Menon Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211206210749.117395027@linutronix.de commit 495c66aca3da704e063fa373fdbe371e71d3f4ee Author: Thomas Gleixner Date: Mon Dec 6 23:51:45 2021 +0100 genirq/msi: Convert to new functions Use the new iterator functions and add locking where required. Signed-off-by: Thomas Gleixner Tested-by: Michael Kelley Tested-by: Nishanth Menon Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211206210749.063705667@linutronix.de commit ef8dd01538ea2553ab101ddce6a85a321406d9c0 Author: Thomas Gleixner Date: Mon Dec 6 23:51:44 2021 +0100 genirq/msi: Make interrupt allocation less convoluted There is no real reason to do several loops over the MSI descriptors instead of just doing one loop. In case of an error everything is undone anyway so it does not matter whether it's a partial or a full rollback. Signed-off-by: Thomas Gleixner Tested-by: Michael Kelley Tested-by: Nishanth Menon Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211206210749.010234767@linutronix.de commit a80713fea3d12344e1da18f9113c74cdb3c463f1 Author: Thomas Gleixner Date: Mon Dec 6 23:51:42 2021 +0100 platform-msi: Simplify platform device MSI code The allocation code is overly complex. It tries to have the MSI index space packed, which is not working when an interrupt is freed. There is no requirement for this. The only requirement is that the MSI index is unique. Move the MSI descriptor allocation into msi_domain_populate_irqs() and use the Linux interrupt number as MSI index which fulfils the unique requirement. This requires to lock the MSI descriptors which makes the lock order reverse to the regular MSI alloc/free functions vs. the domain mutex. Assign a seperate lockdep class for these MSI device domains. Signed-off-by: Thomas Gleixner Tested-by: Nishanth Menon Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211206210748.956731741@linutronix.de commit 653b50c5f96918238e0b51e783b291f6e9e692f9 Author: Thomas Gleixner Date: Mon Dec 6 23:51:41 2021 +0100 platform-msi: Let core code handle MSI descriptors Use the core functionality for platform MSI interrupt domains. The platform device MSI interrupt domains will be converted in a later step. Signed-off-by: Thomas Gleixner Tested-by: Nishanth Menon Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211206210748.903173257@linutronix.de commit e8604b1447b4a0c178019bdf809a4d52e1c235b6 Author: Thomas Gleixner Date: Mon Dec 6 23:51:39 2021 +0100 bus: fsl-mc-msi: Simplify MSI descriptor handling Let the MSI irq domain code handle descriptor allocation and free. Signed-off-by: Thomas Gleixner Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211206210748.847219474@linutronix.de commit 7ad321a5eadb52b4af1c577dda51783e08235ea7 Author: Thomas Gleixner Date: Mon Dec 6 23:51:37 2021 +0100 soc: ti: ti_sci_inta_msi: Remove ti_sci_inta_msi_domain_free_irqs() The function has no users and is pointless now that the core frees the MSI descriptors, which means potential users can just use msi_domain_free_irqs(). Signed-off-by: Thomas Gleixner Tested-by: Nishanth Menon Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211206210748.793119155@linutronix.de commit 49fbfdc222504b7f0d83a58c13869d599cf8e184 Author: Thomas Gleixner Date: Mon Dec 6 23:51:36 2021 +0100 soc: ti: ti_sci_inta_msi: Rework MSI descriptor allocation Protect the allocation properly and use the core allocation and free mechanism. No functional change intended. Signed-off-by: Thomas Gleixner Tested-by: Nishanth Menon Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211206210748.737904583@linutronix.de commit 68e3183580bea59e764d33283875e5f0adc753f3 Author: Thomas Gleixner Date: Mon Dec 6 23:51:34 2021 +0100 NTB/msi: Convert to msi_on_each_desc() Replace the about to vanish iterators, make use of the filtering and take the descriptor lock around the iteration. Signed-off-by: Thomas Gleixner Reviewed-by: Logan Gunthorpe Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211206210748.683004012@linutronix.de commit dc2b453290c471266a2d56d7ead981e3c5cea05e Author: Thomas Gleixner Date: Mon Dec 6 23:51:33 2021 +0100 PCI: hv: Rework MSI handling Replace the about to vanish iterators and make use of the filtering. Take the descriptor lock around the iterators. Signed-off-by: Thomas Gleixner Tested-by: Michael Kelley Reviewed-by: Jason Gunthorpe Acked-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20211206210748.629363944@linutronix.de commit 706b585a1b9554cb1ede5108c733593b94a7e1c4 Author: Thomas Gleixner Date: Mon Dec 6 23:51:31 2021 +0100 powerpc/mpic_u3msi: Use msi_for_each-desc() Replace the about to vanish iterators and make use of the filtering. Signed-off-by: Thomas Gleixner Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211206210748.576162169@linutronix.de commit ab430e7437789d3996115a925d260b2c34ddc8c9 Author: Thomas Gleixner Date: Mon Dec 6 23:51:29 2021 +0100 powerpc/fsl_msi: Use msi_for_each_desc() Replace the about to vanish iterators and make use of the filtering. Signed-off-by: Thomas Gleixner Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211206210748.522641685@linutronix.de commit e22b0d1bbf5bd71ed2b2fb54a257b5cc38c351c3 Author: Thomas Gleixner Date: Mon Dec 6 23:51:28 2021 +0100 powerpc/pasemi/msi: Convert to msi_on_each_dec() Replace the about to vanish iterators and make use of the filtering. Signed-off-by: Thomas Gleixner Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211206210748.468512783@linutronix.de commit 3c46658bd70389bf6a7410960905415df50350d2 Author: Thomas Gleixner Date: Mon Dec 6 23:51:26 2021 +0100 powerpc/cell/axon_msi: Convert to msi_on_each_desc() Replace the about to vanish iterators and make use of the filtering. Signed-off-by: Thomas Gleixner Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211206210748.414712173@linutronix.de commit 85dabc2f72b65d1aa52ac8214b1112f141d17b91 Author: Thomas Gleixner Date: Mon Dec 6 23:51:25 2021 +0100 powerpc/4xx/hsta: Rework MSI handling Replace the about to vanish iterators and make use of the filtering. Signed-off-by: Thomas Gleixner Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211206210748.359766435@linutronix.de commit 2ca5e908d0f4cde61d9d3595e8314adca5d914a1 Author: Thomas Gleixner Date: Mon Dec 6 23:51:23 2021 +0100 s390/pci: Rework MSI descriptor walk Replace the about to vanish iterators and make use of the filtering. Signed-off-by: Thomas Gleixner Tested-by: Niklas Schnelle Reviewed-by: Jason Gunthorpe Acked-by: Niklas Schnelle Link: https://lore.kernel.org/r/20211206210748.305656158@linutronix.de commit 3d31bbd39aa5c7467a34e8202a983e81b696a883 Author: Thomas Gleixner Date: Mon Dec 6 23:51:21 2021 +0100 xen/pcifront: Rework MSI handling Replace the about to vanish iterators. Signed-off-by: Thomas Gleixner Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211206210748.251752714@linutronix.de commit f2948df5f87a722591499da60ab91c611422f755 Author: Thomas Gleixner Date: Mon Dec 6 23:51:20 2021 +0100 x86/pci/xen: Use msi_for_each_desc() Replace the about to vanish iterators. Signed-off-by: Thomas Gleixner Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211206210748.198359105@linutronix.de commit ae24e28fef14687a26f98050e64153b8e4fee7c7 Author: Thomas Gleixner Date: Mon Dec 6 23:51:18 2021 +0100 PCI/MSI: Use msi_on_each_desc() Use the new iterator functions which pave the way for dynamically extending MSI-X vectors. Signed-off-by: Thomas Gleixner Tested-by: Michael Kelley Tested-by: Nishanth Menon Reviewed-by: Jason Gunthorpe Acked-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20211206210748.142603657@linutronix.de commit 9fb9eb4b59acc607e978288c96ac7efa917153d4 Author: Thomas Gleixner Date: Mon Dec 6 23:51:16 2021 +0100 PCI/MSI: Let core code free MSI descriptors Set the domain info flag which tells the core code to free the MSI descriptors from msi_domain_free_irqs() and add an explicit call to the core function into the legacy code. Signed-off-by: Thomas Gleixner Tested-by: Michael Kelley Tested-by: Nishanth Menon Reviewed-by: Jason Gunthorpe Acked-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20211206210748.089085131@linutronix.de commit 71020a3c0dff4a00d96922a4a95a067f524a7dcb Author: Thomas Gleixner Date: Mon Dec 6 23:51:15 2021 +0100 PCI/MSI: Use msi_add_msi_desc() Simplify the allocation of MSI descriptors by using msi_add_msi_desc() which moves the storage handling to core code and prepares for dynamic extension of the MSI-X vector space. Signed-off-by: Thomas Gleixner Tested-by: Michael Kelley Tested-by: Nishanth Menon Reviewed-by: Jason Gunthorpe Acked-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20211206210748.035348646@linutronix.de commit 5512c5eaf533a98d33a8dc0dcf415e72773184c8 Author: Thomas Gleixner Date: Mon Dec 6 23:51:13 2021 +0100 PCI/MSI: Protect MSI operations To prepare for dynamic extension of MSI-X vectors, protect the MSI operations for MSI and MSI-X. This requires to move the invocation of irq_create_affinity_masks() out of the descriptor lock section to avoid reverse lock ordering vs. CPU hotplug lock as some callers of the PCI/MSI allocation interfaces already hold it. Signed-off-by: Thomas Gleixner Tested-by: Michael Kelley Tested-by: Nishanth Menon Reviewed-by: Jason Gunthorpe Acked-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20211206210747.982292705@linutronix.de commit 645474e2cee450131e8b8d8a69a5d9bbabd43f3f Author: Thomas Gleixner Date: Mon Dec 6 23:51:12 2021 +0100 genirq/msi: Provide domain flags to allocate/free MSI descriptors automatically Provide domain info flags which tell the core to allocate simple descriptors or to free descriptors when the interrupts are freed and implement the required functionality. Signed-off-by: Thomas Gleixner Tested-by: Michael Kelley Tested-by: Nishanth Menon Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211206210747.928198636@linutronix.de commit 602905253607ba892336f7bba8bb45b5be819d87 Author: Thomas Gleixner Date: Mon Dec 6 23:51:10 2021 +0100 genirq/msi: Provide msi_alloc_msi_desc() and a simple allocator Provide msi_alloc_msi_desc() which takes a template MSI descriptor for initializing a newly allocated descriptor. This allows to simplify various usage sites of alloc_msi_entry() and moves the storage handling into the core code. For simple cases where only a linear vector space is required provide msi_add_simple_msi_descs() which just allocates a linear range of MSI descriptors and fills msi_desc::msi_index accordingly. Signed-off-by: Thomas Gleixner Tested-by: Michael Kelley Tested-by: Nishanth Menon Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211206210747.873833567@linutronix.de commit 1046f71d7268b1680d7b044dea83c664403f6302 Author: Thomas Gleixner Date: Mon Dec 6 23:51:08 2021 +0100 genirq/msi: Provide a set of advanced MSI accessors and iterators In preparation for dynamic handling of MSI-X interrupts provide a new set of MSI descriptor accessor functions and iterators. They are benefitial per se as they allow to cleanup quite some code in various MSI domain implementations. Signed-off-by: Thomas Gleixner Tested-by: Michael Kelley Tested-by: Nishanth Menon Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211206210747.818635078@linutronix.de commit 0f62d941acf9ac3b6025692ce649b1f282b89e7f Author: Thomas Gleixner Date: Mon Dec 6 23:51:07 2021 +0100 genirq/msi: Provide msi_domain_alloc/free_irqs_descs_locked() Usage sites which do allocations of the MSI descriptors before invoking msi_domain_alloc_irqs() require to lock the MSI decriptors accross the operation. Provide entry points which can be called with the MSI mutex held and lock the mutex in the existing entry points. Signed-off-by: Thomas Gleixner Tested-by: Michael Kelley Tested-by: Nishanth Menon Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211206210747.765371053@linutronix.de commit b5f687f97d1e112493fe0447a1fb09fbd93c334b Author: Thomas Gleixner Date: Mon Dec 6 23:51:05 2021 +0100 genirq/msi: Add mutex for MSI list protection For upcoming runtime extensions of MSI-X interrupts it's required to protect the MSI descriptor list. Add a mutex to struct msi_device_data and provide lock/unlock functions. Signed-off-by: Thomas Gleixner Tested-by: Michael Kelley Tested-by: Nishanth Menon Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211206210747.708877269@linutronix.de commit 125282cd4f33ecd53a24ae4807409da0e5e90fd4 Author: Thomas Gleixner Date: Mon Dec 6 23:51:04 2021 +0100 genirq/msi: Move descriptor list to struct msi_device_data It's only required when MSI is in use. Signed-off-by: Thomas Gleixner Tested-by: Michael Kelley Tested-by: Nishanth Menon Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211206210747.650487479@linutronix.de commit ac18935d2e5130744b9675f6fb72acb783f86d77 Author: Sam Protsenko Date: Sun Dec 12 20:10:57 2021 +0200 i2c: exynos5: Fix getting the optional clock "hsi2c_pclk" clock is optional and may not be present for some SoCs supported by this driver. Nevertheless, in case the clock is provided but some error happens during its getting, that error should be handled properly. Use devm_clk_get_optional() API for that. Also report possible errors using dev_err_probe() to handle properly -EPROBE_DEFER error (if clock provider is not ready by the time I2C probe function is executed). Fixes: 697ad2490c96 ("i2c: exynos5: Add bus clock support") Signed-off-by: Sam Protsenko Reviewed-by: Krzysztof Kozlowski Reviewed-by: Chanho Park [wsa: fixed SHA1 of Fixes tag] Signed-off-by: Wolfram Sang commit 2759181d9a131a2334211637eb56db3de2e7d84c Author: Andy Shevchenko Date: Wed Dec 15 17:12:05 2021 +0200 i2c: designware-pci: Convert to use dev_err_probe() It's fine to call dev_err_probe() in ->probe() when error code is known. Convert the driver to use dev_err_probe(). Signed-off-by: Andy Shevchenko Signed-off-by: Jarkko Nikula Signed-off-by: Wolfram Sang commit 0897f1735910a547d5e3aa2a5cf177ff96efb0ea Author: Andy Shevchenko Date: Wed Dec 15 17:12:04 2021 +0200 i2c: designware-pci: use __maybe_unused for PM functions Use __maybe_unused for PM functions instead of ifdeffery. Signed-off-by: Andy Shevchenko Signed-off-by: Jarkko Nikula Signed-off-by: Wolfram Sang commit c3c9bab1e398073df117fc0b5bb1b81beada9fd6 Author: Andy Shevchenko Date: Wed Dec 15 17:12:03 2021 +0200 i2c: designware-pci: Group MODULE_*() macros For better maintenance group MODULE_*() macros together. Signed-off-by: Andy Shevchenko Signed-off-by: Jarkko Nikula Signed-off-by: Wolfram Sang commit 1900c962e2dcfacec894558eb34971bdc9c67443 Author: Thomas Gleixner Date: Fri Dec 10 23:19:37 2021 +0100 dmaengine: qcom_hidma: Cleanup MSI handling There is no reason to walk the MSI descriptors to retrieve the interrupt number for a device. Use msi_get_virq() instead. Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Acked-by: Sinan Kaya Acked-by: Vinod Koul Link: https://lore.kernel.org/r/20211210221815.329792721@linutronix.de commit 89e0032ec201f76c86d6e3e6f94574dfb8e39b71 Author: Thomas Gleixner Date: Fri Dec 10 23:19:35 2021 +0100 soc: ti: ti_sci_inta_msi: Get rid of ti_sci_inta_msi_get_virq() Just use the core function msi_get_virq(). Signed-off-by: Thomas Gleixner Tested-by: Nishanth Menon Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Acked-by: Arnd Bergmann Acked-by: Vinod Koul Acked-by: Nishanth Menon Link: https://lore.kernel.org/r/20211210221815.269468319@linutronix.de commit d86a6d47bcc6b41fe2a4e13313d66a772d00382f Author: Thomas Gleixner Date: Fri Dec 10 23:19:34 2021 +0100 bus: fsl-mc: fsl-mc-allocator: Rework MSI handling Storing a pointer to the MSI descriptor just to track the Linux interrupt number is daft. Just store the interrupt number and be done with it. Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211210221815.207838579@linutronix.de commit d722e9a51178d42b07555a9420d286dad3341d61 Author: Thomas Gleixner Date: Fri Dec 10 23:19:32 2021 +0100 mailbox: bcm-flexrm-mailbox: Rework MSI interrupt handling No point in retrieving the MSI descriptors. Just query the Linux interrupt number. Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211210221815.148331680@linutronix.de commit 065afdc9c521f05c53f226dabe5dda2d30294d65 Author: Thomas Gleixner Date: Fri Dec 10 23:19:31 2021 +0100 iommu/arm-smmu-v3: Use msi_get_virq() Let the core code fiddle with the MSI descriptor retrieval. Signed-off-by: Thomas Gleixner Tested-by: Robin Murphy Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211210221815.089008198@linutronix.de commit 848456705565da8de0fac4f6487f2a04813f60cc Author: Thomas Gleixner Date: Fri Dec 10 23:19:29 2021 +0100 perf/smmuv3: Use msi_get_virq() Let the core code fiddle with the MSI descriptor retrieval. Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211210221815.029143589@linutronix.de commit f6632bb2c1454b857adcd131320379ec16fd8666 Author: Thomas Gleixner Date: Fri Dec 10 23:19:28 2021 +0100 dmaengine: mv_xor_v2: Get rid of msi_desc abuse Storing a pointer to the MSI descriptor just to keep track of the Linux interrupt number is daft. Use msi_get_virq() instead. Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Acked-by: Vinod Koul Link: https://lore.kernel.org/r/20211210221814.970099984@linutronix.de commit f48235900182d64537c6e8f8dc0932b57a1a0638 Author: Thomas Gleixner Date: Fri Dec 10 23:19:26 2021 +0100 PCI/MSI: Simplify pci_irq_get_affinity() Replace open coded MSI descriptor chasing and use the proper accessor functions instead. Signed-off-by: Thomas Gleixner Tested-by: Michael Kelley Tested-by: Nishanth Menon Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211210221814.900929381@linutronix.de commit 82ff8e6b78fc4587a4255301f0a283506daf11b6 Author: Thomas Gleixner Date: Fri Dec 10 23:19:25 2021 +0100 PCI/MSI: Use msi_get_virq() in pci_get_vector() Use msi_get_vector() and handle the return value to be compatible. No functional change intended. Signed-off-by: Thomas Gleixner Tested-by: Michael Kelley Tested-by: Nishanth Menon Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211210221814.841243231@linutronix.de commit cf15f43acaad31dabb2646cef170a506a1d663eb Author: Thomas Gleixner Date: Fri Dec 10 23:19:23 2021 +0100 genirq/msi: Provide interface to retrieve Linux interrupt number This allows drivers to retrieve the Linux interrupt number instead of fiddling with MSI descriptors. msi_get_virq() returns the Linux interrupt number or 0 in case that there is no entry for the given MSI index. Signed-off-by: Thomas Gleixner Tested-by: Michael Kelley Tested-by: Nishanth Menon Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211210221814.780824745@linutronix.de commit 651b39c48813acac2b77850014390f4062a4835d Author: Thomas Gleixner Date: Fri Dec 10 23:19:22 2021 +0100 powerpc/pseries/msi: Let core code check for contiguous entries Set the domain info flag and remove the check. Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211210221814.720998720@linutronix.de commit 7a823443e9b4ed1ff4a3026d184f09d23fd6d9c9 Author: Thomas Gleixner Date: Fri Dec 10 23:19:20 2021 +0100 PCI/MSI: Provide MSI_FLAG_MSIX_CONTIGUOUS Provide a domain info flag which makes the core code check for a contiguous MSI-X index on allocation. That's simpler than checking it at some other domain callback in architecture code. Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Acked-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20211210221814.662401116@linutronix.de commit 173ffad79d177d9a91fbf3be6bf67ca81e0f765a Author: Thomas Gleixner Date: Fri Dec 10 23:19:18 2021 +0100 PCI/MSI: Use msi_desc::msi_index The usage of msi_desc::pci::entry_nr is confusing at best. It's the index into the MSI[X] descriptor table. Use msi_desc::msi_index which is shared between all MSI incarnations instead of having a PCI specific storage for no value. Signed-off-by: Thomas Gleixner Tested-by: Michael Kelley Tested-by: Nishanth Menon Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Acked-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20211210221814.602911509@linutronix.de commit 0f18095871fc59c89a281caf6f18538cf9e50fbf Author: Thomas Gleixner Date: Fri Dec 10 23:19:17 2021 +0100 soc: ti: ti_sci_inta_msi: Use msi_desc::msi_index Use the common msi_index member and get rid of the pointless wrapper struct. Signed-off-by: Thomas Gleixner Tested-by: Nishanth Menon Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Acked-by: Nishanth Menon Link: https://lore.kernel.org/r/20211210221814.540704224@linutronix.de commit 78ee9fb4b8b126ed84a819a6e1732fd3039b525a Author: Thomas Gleixner Date: Fri Dec 10 23:19:15 2021 +0100 bus: fsl-mc-msi: Use msi_desc::msi_index Use the common msi_index member and get rid of the pointless wrapper struct. Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211210221814.477386185@linutronix.de commit dba27c7fa36f468e7eb29b216879f8c33bf0955d Author: Thomas Gleixner Date: Fri Dec 10 23:19:14 2021 +0100 platform-msi: Use msi_desc::msi_index Use the common msi_index member and get rid of the pointless wrapper struct. Signed-off-by: Thomas Gleixner Tested-by: Nishanth Menon Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211210221814.413638645@linutronix.de commit 20c6d424cfe641659c9a025db8a8608701b27246 Author: Thomas Gleixner Date: Fri Dec 10 23:19:12 2021 +0100 genirq/msi: Consolidate MSI descriptor data All non PCI/MSI usage variants have data structures in struct msi_desc with only one member: xxx_index. PCI/MSI has a entry_nr member. Add a common msi_index member to struct msi_desc so all implementations can share it which allows further consolidation. Signed-off-by: Thomas Gleixner Tested-by: Michael Kelley Tested-by: Nishanth Menon Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211210221814.350967317@linutronix.de commit fc22e7dbcdb3e06a3d3ce05fc91c6a2345411f9b Author: Thomas Gleixner Date: Fri Dec 10 23:19:11 2021 +0100 platform-msi: Store platform private data pointer in msi_device_data Storing the platform private data in a MSI descriptor is sloppy at best. The data belongs to the device and not to the descriptor. Add a pointer to struct msi_device_data and store the pointer there. Signed-off-by: Thomas Gleixner Tested-by: Nishanth Menon Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211210221814.287680528@linutronix.de commit 9835cec6d557b0bff3d48bd91cd0484aba59386c Author: Thomas Gleixner Date: Fri Dec 10 23:19:09 2021 +0100 platform-msi: Rename functions and clarify comments It's hard to distinguish what platform_msi_domain_alloc() and platform_msi_domain_alloc_irqs() are about. Make the distinction more explicit and add comments which explain the use cases properly. Signed-off-by: Thomas Gleixner Tested-by: Nishanth Menon Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211210221814.228706214@linutronix.de commit 24cff375fdb663c2238f06693a067b9219596fdc Author: Thomas Gleixner Date: Fri Dec 10 23:19:08 2021 +0100 genirq/msi: Remove the original sysfs interfaces No more users. Refactor the core code accordingly and move the global interface under CONFIG_PCI_MSI_ARCH_FALLBACKS. Signed-off-by: Thomas Gleixner Tested-by: Michael Kelley Tested-by: Nishanth Menon Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211210221814.168362229@linutronix.de commit 25ce693ef7ea766c10d2f3e5da373ca25af09196 Author: Thomas Gleixner Date: Fri Dec 10 23:19:06 2021 +0100 platform-msi: Let the core code handle sysfs groups Set the domain info flag and remove the local sysfs code. Signed-off-by: Thomas Gleixner Tested-by: Nishanth Menon Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211210221814.109408832@linutronix.de commit ffd84485e6beb9cad3e5a133d88201b995298c33 Author: Thomas Gleixner Date: Fri Dec 10 23:19:05 2021 +0100 PCI/MSI: Let the irq code handle sysfs groups Set the domain info flag which makes the core code handle sysfs groups and put an explicit invocation into the legacy code. Signed-off-by: Thomas Gleixner Tested-by: Michael Kelley Tested-by: Nishanth Menon Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Acked-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20211210221814.048612053@linutronix.de commit bf6e054e0e3fbc9614355b760e18c8a14f952a4e Author: Thomas Gleixner Date: Fri Dec 10 23:19:03 2021 +0100 genirq/msi: Provide msi_device_populate/destroy_sysfs() Add new allocation functions which can be activated by domain info flags. They store the groups pointer in struct msi_device_data. Signed-off-by: Thomas Gleixner Tested-by: Michael Kelley Tested-by: Nishanth Menon Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211210221813.988659194@linutronix.de commit 686073e9f8466de259971f1acd81b19a39e2162b Author: Thomas Gleixner Date: Fri Dec 10 23:19:01 2021 +0100 soc: ti: ti_sci_inta_msi: Allocate MSI device data on first use Allocate the MSI device data on first invocation of the allocation function. Signed-off-by: Thomas Gleixner Tested-by: Nishanth Menon Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Acked-by: Arnd Bergmann Acked-by: Nishanth Menon Link: https://lore.kernel.org/r/20211210221813.928842960@linutronix.de commit 86ca622628d3941835138f2f89e69ed63f7f50fe Author: Thomas Gleixner Date: Fri Dec 10 23:19:00 2021 +0100 bus: fsl-mc-msi: Allocate MSI device data on first use Allocate the MSI device data on first invocation of the allocation function. Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211210221813.867985931@linutronix.de commit 077aeadb6cacdee79acff3deb1b31581584fdb9c Author: Thomas Gleixner Date: Fri Dec 10 23:18:58 2021 +0100 platform-msi: Allocate MSI device data on first use Allocate the MSI device data on first invocation of the allocation function for platform MSI private data. Signed-off-by: Thomas Gleixner Tested-by: Nishanth Menon Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211210221813.805529729@linutronix.de commit 93296cd1325d1d9afede60202d8833011c9001f2 Author: Thomas Gleixner Date: Wed Dec 15 18:19:49 2021 +0100 PCI/MSI: Allocate MSI device data on first use Allocate MSI device data on first use, i.e. when a PCI driver invokes one of the PCI/MSI enablement functions. Add a wrapper function to ensure that the ordering vs. pcim_msi_release() is correct. Signed-off-by: Thomas Gleixner Tested-by: Michael Kelley Tested-by: Nishanth Menon Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/87r1adrdje.ffs@tglx commit 3f35d2cf9fbc656db82579d849cc69c373b1ad0d Author: Thomas Gleixner Date: Wed Dec 15 18:16:44 2021 +0100 PCI/MSI: Decouple MSI[-X] disable from pcim_release() The MSI core will introduce runtime allocation of MSI related data. This data will be devres managed and has to be set up before enabling PCI/MSI[-X]. This would introduce an ordering issue vs. pcim_release(). The setup order is: pcim_enable_device() devres_alloc(pcim_release...); ... pci_irq_alloc() msi_setup_device_data() devres_alloc(msi_device_data_release, ...) and once the device is released these release functions are invoked in the opposite order: msi_device_data_release() ... pcim_release() pci_disable_msi[x]() which is obviously wrong, because pci_disable_msi[x]() requires the MSI data to be available to tear down the MSI[-X] interrupts. Remove the MSI[-X] teardown from pcim_release() and add an explicit action to be installed on the attempt of enabling PCI/MSI[-X]. This allows the MSI core data allocation to be ordered correctly in a subsequent step. Reported-by: Nishanth Menon Signed-off-by: Thomas Gleixner Tested-by: Michael Kelley Tested-by: Nishanth Menon Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/87tuf9rdoj.ffs@tglx commit 013bd8e543c2c777b586cf033c588ea82bd502db Author: Thomas Gleixner Date: Fri Dec 10 23:18:55 2021 +0100 device: Add device:: Msi_data pointer and struct msi_device_data Create struct msi_device_data and add a pointer of that type to struct dev_msi_info, which is part of struct device. Provide an allocator function which can be invoked from the MSI interrupt allocation code pathes. Add a properties field to the data structure as a first member so the allocation size is not zero bytes. The field will be uses later on. Signed-off-by: Thomas Gleixner Tested-by: Michael Kelley Tested-by: Nishanth Menon Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211210221813.676660809@linutronix.de commit 34fff62827b254f8a43633cc878deb04bf11297c Author: Thomas Gleixner Date: Fri Dec 10 23:18:54 2021 +0100 device: Move MSI related data into a struct The only unconditional part of MSI data in struct device is the irqdomain pointer. Everything else can be allocated on demand. Create a data structure and move the irqdomain pointer into it. The other MSI specific parts are going to be removed from struct device in later steps. Signed-off-by: Thomas Gleixner Tested-by: Michael Kelley Tested-by: Nishanth Menon Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/20211210221813.617178827@linutronix.de commit ed1533b5810141aceed2c2a3f13a17736f40e7fa Author: Thomas Gleixner Date: Fri Dec 10 23:18:52 2021 +0100 powerpc/pseries/msi: Use PCI device properties instead of fiddling with MSI descriptors. Signed-off-by: Thomas Gleixner Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211210221813.556202506@linutronix.de commit d8a530578b166f3ec55d453b8b4b49599bd39884 Author: Thomas Gleixner Date: Fri Dec 10 23:18:51 2021 +0100 powerpc/cell/axon_msi: Use PCI device property instead of fiddling with MSI descriptors. Signed-off-by: Thomas Gleixner Reviewed-by: Jason Gunthorpe Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/20211210221813.493922179@linutronix.de commit 6ef7f771de0182141ef1a0863f27b12963e1d184 Author: Thomas Gleixner Date: Fri Dec 10 23:18:49 2021 +0100 genirq/msi: Use PCI device property to determine whether this is MSI or MSIX instead of consulting MSI descriptors. Signed-off-by: Thomas Gleixner Tested-by: Michael Kelley Tested-by: Nishanth Menon Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211210221813.434156196@linutronix.de commit b3f82364117a0b7f666ce023195b636c4803c46c Author: Thomas Gleixner Date: Fri Dec 10 23:18:47 2021 +0100 x86/apic/msi: Use PCI device MSI property instead of fiddling with MSI descriptors. Signed-off-by: Thomas Gleixner Tested-by: Michael Kelley Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211210221813.372357371@linutronix.de commit 0bcfade920804d597888e4181bc315a3c500280d Author: Thomas Gleixner Date: Fri Dec 10 23:18:46 2021 +0100 x86/pci/XEN: Use PCI device property instead of fiddling with MSI descriptors. Signed-off-by: Thomas Gleixner Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211210221813.311410967@linutronix.de commit c7ecb95ca6a80b29af0f41cc28c58e542637fbc6 Author: Thomas Gleixner Date: Fri Dec 10 23:18:44 2021 +0100 PCI/MSI: Set pci_dev::msi[x]_enabled early There are quite some places which retrieve the first MSI descriptor to evaluate whether the setup is for MSI or MSI-X. That's required because pci_dev::msi[x]_enabled is only set when the setup completed successfully. There is no real reason why msi[x]_enabled can't be set at the beginning of the setup sequence and cleared in case of a failure. Implement that so the MSI descriptor evaluations can be converted to simple property queries. Signed-off-by: Thomas Gleixner Tested-by: Michael Kelley Tested-by: Nishanth Menon Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211210221813.250049810@linutronix.de commit c2d7fa2207d0df23bde6ef3fb4d56135f3d2977b Author: Andy Shevchenko Date: Wed Dec 15 17:12:02 2021 +0200 i2c: designware-pci: Add a note about struct dw_scl_sda_cfg usage Add a note about struct dw_scl_sda_cfg usage to discourage people of using this structure on new platforms. Instead they should try hard to put the needed information into firmware descriptions. Signed-off-by: Andy Shevchenko Signed-off-by: Jarkko Nikula Signed-off-by: Wolfram Sang commit d52097010078c1844348dc0e467305e5f90fd317 Author: Lakshmi Sowjanya D Date: Wed Dec 15 17:12:01 2021 +0200 i2c: designware-pci: Fix to change data types of hcnt and lcnt parameters The data type of hcnt and lcnt in the struct dw_i2c_dev is of type u16. It's better to have same data type in struct dw_scl_sda_cfg as well. Reported-by: Wolfram Sang Signed-off-by: Lakshmi Sowjanya D Signed-off-by: Andy Shevchenko Signed-off-by: Jarkko Nikula Signed-off-by: Wolfram Sang commit f4e0ba52a89fc2f1b009b3f6af8e617ad1a3c315 Author: Tamal Saha Date: Wed Dec 15 17:12:00 2021 +0200 i2c: designware: Do not complete i2c read without RX_FULL interrupt Intel Keem Bay platform supports multi-master operations over same i2c bus using Synopsys i2c DesignWare IP. When multi-masters initiate i2c operation simultaneously in a loop, SCL line is stucked low forever after few i2c operations. Following interrupt sequences are observed in: working case: TX_EMPTY, RX_FULL and STOP_DET non working case: TX_EMPTY, STOP_DET, RX_FULL. DW_apb_i2c stretches the SCL line when the TX FIFO is empty or when RX FIFO is full. The DW_apb_i2c master will continue to hold the SCL line LOW until RX FIFO is read. Linux kernel i2c DesignWare driver does not handle above non working sequence. TX_EMPTY, RX_FULL and STOP_DET routine execution are required in sequence although RX_FULL interrupt is raised after STOP_DET by hardware. Clear STOP_DET for the following conditions: (STOP_DET ,RX_FULL, rx_outstanding) Write Operation: (1, 0, 0) Read Operation: RX_FULL followed by STOP_DET: (0, 1, 1) -> (1, 0, 0) STOP_DET followed by RX_FULL: (1, 0, 1) -> (1, 1, 0) RX_FULL and STOP_DET together: (1, 1, 1) Signed-off-by: Tamal Saha Signed-off-by: Jarkko Nikula Signed-off-by: Wolfram Sang commit cd17420ebea580c22dd3a93f7237de3d2cfafc37 Author: Mateusz Jończyk Date: Fri Dec 10 21:01:31 2021 +0100 rtc: cmos: avoid UIP when writing alarm time Some Intel chipsets disconnect the time and date RTC registers when the clock update is in progress: during this time reads may return bogus values and writes fail silently. This includes the RTC alarm registers. [1] cmos_set_alarm() did not take account for that, fix it. [1] 7th Generation Intel ® Processor Family I/O for U/Y Platforms [...] Datasheet, Volume 1 of 2 (Intel's Document Number: 334658-006) Page 208 https://www.intel.com/content/dam/www/public/us/en/documents/datasheets/7th-and-8th-gen-core-family-mobile-u-y-processor-lines-i-o-datasheet-vol-1.pdf "If a RAM read from the ten time and date bytes is attempted during an update cycle, the value read do not necessarily represent the true contents of those locations. Any RAM writes under the same conditions are ignored." Signed-off-by: Mateusz Jończyk Cc: Alessandro Zummo Cc: Alexandre Belloni Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20211210200131.153887-10-mat.jonczyk@o2.pl commit cdedc45c579faf8cc6608d3ef81576ee0d512aa4 Author: Mateusz Jończyk Date: Fri Dec 10 21:01:30 2021 +0100 rtc: cmos: avoid UIP when reading alarm time Some Intel chipsets disconnect the time and date RTC registers when the clock update is in progress: during this time reads may return bogus values and writes fail silently. This includes the RTC alarm registers. [1] cmos_read_alarm() did not take account for that, which caused alarm time reads to sometimes return bogus values. This can be shown with a test patch that I am attaching to this patch series. Fix this, by using mc146818_avoid_UIP(). [1] 7th Generation Intel ® Processor Family I/O for U/Y Platforms [...] Datasheet, Volume 1 of 2 (Intel's Document Number: 334658-006) Page 208 https://www.intel.com/content/dam/www/public/us/en/documents/datasheets/7th-and-8th-gen-core-family-mobile-u-y-processor-lines-i-o-datasheet-vol-1.pdf "If a RAM read from the ten time and date bytes is attempted during an update cycle, the value read do not necessarily represent the true contents of those locations. Any RAM writes under the same conditions are ignored." Signed-off-by: Mateusz Jończyk Cc: Alessandro Zummo Cc: Alexandre Belloni Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20211210200131.153887-9-mat.jonczyk@o2.pl commit 2c7d47a45b06be3d0a7aa21c3dea2215685a928f Author: Mateusz Jończyk Date: Fri Dec 10 21:01:29 2021 +0100 rtc: mc146818-lib: refactor mc146818_does_rtc_work Refactor mc146818_does_rtc_work() so that it uses mc146818_avoid_UIP(). It is enough to call mc146818_avoid_UIP() with no callback. Signed-off-by: Mateusz Jończyk Cc: Alessandro Zummo Cc: Alexandre Belloni Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20211210200131.153887-8-mat.jonczyk@o2.pl commit 2a61b0ac5493363149f68a2fb80287f314626987 Author: Mateusz Jończyk Date: Fri Dec 10 21:01:28 2021 +0100 rtc: mc146818-lib: refactor mc146818_get_time Refactor mc146818_get_time() so that it uses mc146818_avoid_UIP(). Signed-off-by: Mateusz Jończyk Cc: Alessandro Zummo Cc: Alexandre Belloni Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20211210200131.153887-7-mat.jonczyk@o2.pl commit ec5895c0f2d87b9bf4185db1915e40fa6fcfc0ac Author: Mateusz Jończyk Date: Fri Dec 10 21:01:27 2021 +0100 rtc: mc146818-lib: extract mc146818_avoid_UIP Function mc146818_get_time() contains an elaborate mechanism of reading the RTC time while no RTC update is in progress. It turns out that reading the RTC alarm clock also requires avoiding the RTC update. Therefore, the mechanism in mc146818_get_time() should be reused - so extract it into a separate function. The logic in mc146818_avoid_UIP() is same as in mc146818_get_time() except that after every if (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP) { there is now "mdelay(1)". To avoid producing a very unreadable patch, mc146818_get_time() will be refactored to use mc146818_avoid_UIP() in the next patch. Signed-off-by: Mateusz Jończyk Cc: Alessandro Zummo Cc: Alexandre Belloni Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20211210200131.153887-6-mat.jonczyk@o2.pl commit ea6fa4961aab8f90a8aa03575a98b4bda368d4b6 Author: Mateusz Jończyk Date: Fri Dec 10 21:01:26 2021 +0100 rtc: mc146818-lib: fix RTC presence check To prevent an infinite loop in mc146818_get_time(), commit 211e5db19d15 ("rtc: mc146818: Detect and handle broken RTCs") added a check for RTC availability. Together with a later fix, it checked if bit 6 in register 0x0d is cleared. This, however, caused a false negative on a motherboard with an AMD SB710 southbridge; according to the specification [1], bit 6 of register 0x0d of this chipset is a scratchbit. This caused a regression in Linux 5.11 - the RTC was determined broken by the kernel and not used by rtc-cmos.c [3]. This problem was also reported in Fedora [4]. As a better alternative, check whether the UIP ("Update-in-progress") bit is set for longer then 10ms. If that is the case, then apparently the RTC is either absent (and all register reads return 0xff) or broken. Also limit the number of loop iterations in mc146818_get_time() to 10 to prevent an infinite loop there. The functions mc146818_get_time() and mc146818_does_rtc_work() will be refactored later in this patch series, in order to fix a separate problem with reading / setting the RTC alarm time. This is done so to avoid a confusion about what is being fixed when. In a previous approach to this problem, I implemented a check whether the RTC_HOURS register contains a value <= 24. This, however, sometimes did not work correctly on my Intel Kaby Lake laptop. According to Intel's documentation [2], "the time and date RAM locations (0-9) are disconnected from the external bus" during the update cycle so reading this register without checking the UIP bit is incorrect. [1] AMD SB700/710/750 Register Reference Guide, page 308, https://developer.amd.com/wordpress/media/2012/10/43009_sb7xx_rrg_pub_1.00.pdf [2] 7th Generation Intel ® Processor Family I/O for U/Y Platforms [...] Datasheet Volume 1 of 2, page 209 Intel's Document Number: 334658-006, https://www.intel.com/content/dam/www/public/us/en/documents/datasheets/7th-and-8th-gen-core-family-mobile-u-y-processor-lines-i-o-datasheet-vol-1.pdf [3] Functions in arch/x86/kernel/rtc.c apparently were using it. [4] https://bugzilla.redhat.com/show_bug.cgi?id=1936688 Fixes: 211e5db19d15 ("rtc: mc146818: Detect and handle broken RTCs") Fixes: ebb22a059436 ("rtc: mc146818: Dont test for bit 0-5 in Register D") Signed-off-by: Mateusz Jończyk Cc: Thomas Gleixner Cc: Alessandro Zummo Cc: Alexandre Belloni Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20211210200131.153887-5-mat.jonczyk@o2.pl commit 0dd8d6cb9eddfe637bcd821bbfd40ebd5a0737b9 Author: Mateusz Jończyk Date: Fri Dec 10 21:01:25 2021 +0100 rtc: Check return value from mc146818_get_time() There are 4 users of mc146818_get_time() and none of them was checking the return value from this function. Change this. Print the appropriate warnings in callers of mc146818_get_time() instead of in the function mc146818_get_time() itself, in order not to add strings to rtc-mc146818-lib.c, which is kind of a library. The callers of alpha_rtc_read_time() and cmos_read_time() may use the contents of (struct rtc_time *) even when the functions return a failure code. Therefore, set the contents of (struct rtc_time *) to 0x00, which looks more sensible then 0xff and aligns with the (possibly stale?) comment in cmos_read_time: /* * If pm_trace abused the RTC for storage, set the timespec to 0, * which tells the caller that this RTC value is unusable. */ For consistency, do this in mc146818_get_time(). Note: hpet_rtc_interrupt() may call mc146818_get_time() many times a second. It is very unlikely, though, that the RTC suddenly stops working and mc146818_get_time() would consistently fail. Only compile-tested on alpha. Signed-off-by: Mateusz Jończyk Cc: Richard Henderson Cc: Ivan Kokshaysky Cc: Matt Turner Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: Alessandro Zummo Cc: Alexandre Belloni Cc: linux-alpha@vger.kernel.org Cc: x86@kernel.org Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20211210200131.153887-4-mat.jonczyk@o2.pl commit d35786b3a28dee20b12962ae2dd365892a99ed1a Author: Mateusz Jończyk Date: Fri Dec 10 21:01:24 2021 +0100 rtc: mc146818-lib: change return values of mc146818_get_time() No function is checking mc146818_get_time() return values yet, so correct them to make them more customary. Signed-off-by: Mateusz Jończyk Cc: Alessandro Zummo Cc: Alexandre Belloni Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20211210200131.153887-3-mat.jonczyk@o2.pl commit 454f47ff464325223129b9b5b8d0b61946ec704d Author: Mateusz Jończyk Date: Fri Dec 10 21:01:23 2021 +0100 rtc: cmos: take rtc_lock while reading from CMOS Reading from the CMOS involves writing to the index register and then reading from the data register. Therefore access to the CMOS has to be serialized with rtc_lock. This invocation of CMOS_READ was not serialized, which could cause trouble when other code is accessing CMOS at the same time. Use spin_lock_irq() like the rest of the function. Nothing in kernel modifies the RTC_DM_BINARY bit, so there could be a separate pair of spin_lock_irq() / spin_unlock_irq() before doing the math. Signed-off-by: Mateusz Jończyk Reviewed-by: Nobuhiro Iwamatsu Cc: Alessandro Zummo Cc: Alexandre Belloni Cc: stable@vger.kernel.org Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20211210200131.153887-2-mat.jonczyk@o2.pl commit ea0f843aa7942f169ff45d8c68aa81c1645772a6 Author: Matthew Wilcox (Oracle) Date: Wed Apr 28 22:32:02 2021 -0400 iomap: Convert iomap_page_mkwrite to use a folio If we write to any page in a folio, we have to mark the entire folio as dirty, and potentially COW the entire folio, because it'll all get written back as one unit. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit 3aa9c659bf821f112ed765d822f67340a92b8b82 Author: Matthew Wilcox (Oracle) Date: Wed Apr 28 09:39:51 2021 -0400 iomap: Convert readahead and readpage to use a folio Handle folios of arbitrary size instead of working in PAGE_SIZE units. readahead_folio() decreases the page refcount for you, so this is not quite a mechanical change. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit 874628a2c5900358ca89d733cc3865c15bdcd5d8 Author: Matthew Wilcox (Oracle) Date: Fri Jul 23 23:24:50 2021 -0400 iomap: Convert iomap_read_inline_data to take a folio We still only support up to a single page of inline data (at least, per call to iomap_read_inline_data()), but it can now be written into the middle of a folio in case we decide to allocate a 16KiB page for a file that's 8.1KiB in size. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit 431c0566bb60780238534dc1fdd709acca1d0795 Author: Matthew Wilcox (Oracle) Date: Wed Apr 28 08:20:48 2021 -0400 iomap: Use folio offsets instead of page offsets Pass a folio around instead of the page, and make sure the offset is relative to the start of the folio instead of the start of a page. Also use size_t for offset & length to make it clear that these are byte counts, and to support >2GB folios in the future. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit 8ffd74e9a8161df544ce63b49a5a092bcb18f8e6 Author: Matthew Wilcox (Oracle) Date: Fri Jan 1 16:53:26 2021 -0500 iomap: Convert bio completions to use folios Use bio_for_each_folio() to iterate over each folio in the bio instead of iterating over each page. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit cd1e5afe5503edea2538ba426905914d9ab36958 Author: Matthew Wilcox (Oracle) Date: Wed Apr 28 08:16:50 2021 -0400 iomap: Pass the iomap_page into iomap_set_range_uptodate All but one caller already has the iomap_page, so we can avoid getting it again. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit 8306a5f56305521d8b307b4ee1f69949fbb49279 Author: Matthew Wilcox (Oracle) Date: Wed Apr 28 07:51:36 2021 -0400 iomap: Add iomap_invalidate_folio Keep iomap_invalidatepage around as a wrapper for use in address_space operations. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong commit 39f16c83453d6cdb601dc9cd51c8f321c14da644 Author: Matthew Wilcox (Oracle) Date: Wed Apr 28 07:51:36 2021 -0400 iomap: Convert iomap_releasepage to use a folio This is an address_space operation, so its argument must remain as a struct page, but we can use a folio internally. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong commit c46e8324cab0254060c27ab7ef879673468998c5 Author: Matthew Wilcox (Oracle) Date: Tue Apr 27 23:22:22 2021 -0400 iomap: Convert iomap_page_release to take a folio iomap_page_release() was also assuming that it was being passed a head page. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit c636783d594f6cfc95db51c796761719317ce5eb Author: Emmanuel Gil Peyrot Date: Wed Dec 15 18:55:01 2021 +0100 powerpc: wii_defconfig: Enable the RTC driver This selects the rtc-gamecube driver, which provides a real-time clock on this platform. Signed-off-by: Emmanuel Gil Peyrot Acked-by: Michael Ellerman (powerpc) Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20211215175501.6761-6-linkmauve@linkmauve.fr commit 435d44b3fd0ab5750b1001ac7105830e63ad0b5b Author: Matthew Wilcox (Oracle) Date: Tue Apr 27 23:12:52 2021 -0400 iomap: Convert iomap_page_create to take a folio This function already assumed it was being passed a head page, so just formalise that. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit 95c4cd053a1d7c4f1e171ec31d2fb8a8f5c87efe Author: Matthew Wilcox (Oracle) Date: Tue Apr 27 22:56:17 2021 -0400 iomap: Convert to_iomap_page to take a folio The big comment about only using a head page can go away now that it takes a folio argument. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig commit d1bd0b4ebfe0521964e6937195bd2f76866660c7 Author: Matthew Wilcox (Oracle) Date: Wed Nov 3 14:05:47 2021 -0400 fs/buffer: Convert __block_write_begin_int() to take a folio There are no plans to convert buffer_head infrastructure to use large folios, but __block_write_begin_int() is called from iomap, and it's more convenient and less error-prone if we pass in a folio from iomap. It also has a nice saving of almost 200 bytes of code from removing repeated calls to compound_head(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong commit 640d1930bef4f87ec8d8d2b05f0f6edc1dfcf662 Author: Matthew Wilcox (Oracle) Date: Mon Jan 4 10:58:17 2021 -0500 block: Add bio_for_each_folio_all() Allow callers to iterate over each folio instead of each page. The bio need not have been constructed using folios originally. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Jens Axboe Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong commit 85f5a74c2b9ba213d4102dc12ccbfdbe26472abb Author: Matthew Wilcox (Oracle) Date: Thu Apr 8 01:33:45 2021 -0400 block: Add bio_add_folio() This is a thin wrapper around bio_add_page(). The main advantage here is the documentation that folios larger than 2GiB are not supported. It's not currently possible to allocate folios that large, but if it ever becomes possible, this function will fail gracefully instead of doing I/O to the wrong bytes. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Jens Axboe Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong commit 1a6369ba624929c8bfa412045af79dbf7703b8c8 Merge: f97982398cc1c ea79020a2d9ee Author: Andrii Nakryiko Date: Thu Dec 16 12:15:05 2021 -0800 Merge branch 'tools/bpf: Enable cross-building with clang' Jean-Philippe Brucker says: ==================== Since v1 [1], I added Quentin's acks and applied Andrii's suggestions: * Pass CFLAGS to libbpf link in patch 3 * Substitute CLANG_CROSS_FLAGS whole in HOST_CFLAGS to avoid accidents, patch 4 Add support for cross-building BPF tools and selftests with clang, by passing LLVM=1 or CC=clang to make, as well as CROSS_COMPILE. A single clang toolchain can generate binaries for multiple architectures, so instead of having prefixes such as aarch64-linux-gnu-gcc, clang uses the -target parameter: `clang -target aarch64-linux-gnu'. Patch 1 adds the parameter in Makefile.include so tools can easily support this. Patch 2 prepares for the libbpf change from patch 3 (keep building resolve_btfids's libbpf in the host arch, when cross-building the kernel with clang). Patches 3-6 enable cross-building BPF tools with clang. [1] https://lore.kernel.org/bpf/20211122192019.1277299-1-jean-philippe@linaro.org/ ==================== Signed-off-by: Andrii Nakryiko commit ea79020a2d9eea62b12d90f0c11b7d70fcadc172 Author: Jean-Philippe Brucker Date: Thu Dec 16 16:38:43 2021 +0000 selftests/bpf: Enable cross-building with clang Cross building using clang requires passing the "-target" flag rather than using the CROSS_COMPILE prefix. Makefile.include transforms CROSS_COMPILE into CLANG_CROSS_FLAGS. Clear CROSS_COMPILE for bpftool and the host libbpf, and use the clang flags for urandom_read and bench. Signed-off-by: Jean-Philippe Brucker Signed-off-by: Andrii Nakryiko Acked-by: Quentin Monnet Link: https://lore.kernel.org/bpf/20211216163842.829836-7-jean-philippe@linaro.org commit bb7b75e860eec31aa67b83935849fdc46418c13e Author: Jean-Philippe Brucker Date: Thu Dec 16 16:38:42 2021 +0000 tools/runqslower: Enable cross-building with clang Cross-building using clang requires passing the "-target" flag rather than using the CROSS_COMPILE prefix. Makefile.include transforms CROSS_COMPILE into CLANG_CROSS_FLAGS. Add them to CFLAGS, and erase CROSS_COMPILE for the bpftool build, since it needs to be executed on the host. Signed-off-by: Jean-Philippe Brucker Signed-off-by: Andrii Nakryiko Acked-by: Quentin Monnet Link: https://lore.kernel.org/bpf/20211216163842.829836-6-jean-philippe@linaro.org commit bdadbb44c90aedaa74d46f1b113bd845774efa39 Author: Jean-Philippe Brucker Date: Thu Dec 16 16:38:41 2021 +0000 bpftool: Enable cross-building with clang Cross-building using clang requires passing the "-target" flag rather than using the CROSS_COMPILE prefix. Makefile.include transforms CROSS_COMPILE into CLANG_CROSS_FLAGS, and adds that to CFLAGS. Remove the cross flags for the bootstrap bpftool, and erase the CROSS_COMPILE flag for the bootstrap libbpf. Signed-off-by: Jean-Philippe Brucker Signed-off-by: Andrii Nakryiko Acked-by: Quentin Monnet Link: https://lore.kernel.org/bpf/20211216163842.829836-5-jean-philippe@linaro.org commit 4980beb4cda2bc413a3a044e1851b0daaf137bf6 Author: Jean-Philippe Brucker Date: Thu Dec 16 16:38:40 2021 +0000 tools/libbpf: Enable cross-building with clang Cross-building using clang requires passing the "-target" flag rather than using the CROSS_COMPILE prefix. Makefile.include transforms CROSS_COMPILE into CLANG_CROSS_FLAGS. Add them to the CFLAGS. Signed-off-by: Jean-Philippe Brucker Signed-off-by: Andrii Nakryiko Acked-by: Quentin Monnet Link: https://lore.kernel.org/bpf/20211216163842.829836-4-jean-philippe@linaro.org commit bf1be903461a404a9d1c720b0872501ca35abc89 Author: Jean-Philippe Brucker Date: Thu Dec 16 16:38:39 2021 +0000 tools/resolve_btfids: Support cross-building the kernel with clang The CROSS_COMPILE variable may be present during resolve_btfids build if the kernel is being cross-built. Since resolve_btfids is always executed on the host, we set CC to HOSTCC in order to use the host toolchain when cross-building with GCC. But instead of a toolchain prefix, cross-build with clang uses a "-target" parameter, which Makefile.include deduces from the CROSS_COMPILE variable. In order to avoid cross-building libbpf, clear CROSS_COMPILE before building resolve_btfids. Signed-off-by: Jean-Philippe Brucker Signed-off-by: Andrii Nakryiko Acked-by: Quentin Monnet Link: https://lore.kernel.org/bpf/20211216163842.829836-3-jean-philippe@linaro.org commit cebdb7374577ac6e14afb11311af8c2c44a259fa Author: Jean-Philippe Brucker Date: Thu Dec 16 16:38:38 2021 +0000 tools: Help cross-building with clang Cross-compilation with clang uses the -target parameter rather than a toolchain prefix. Just like the kernel Makefile, add that parameter to CFLAGS when CROSS_COMPILE is set. Unlike the kernel Makefile, we use the --sysroot and --gcc-toolchain options because unlike the kernel, tools require standard libraries. Commit c91d4e47e10e ("Makefile: Remove '--gcc-toolchain' flag") provides some background about --gcc-toolchain. Normally clang finds on its own the additional utilities and libraries that it needs (for example GNU ld or glibc). On some systems however, this autodetection doesn't work. There, our only recourse is asking GCC directly, and pass the result to --sysroot and --gcc-toolchain. Of course that only works when a cross GCC is available. Autodetection worked fine on Debian, but to use the aarch64-linux-gnu toolchain from Archlinux I needed both --sysroot (for crt1.o) and --gcc-toolchain (for crtbegin.o, -lgcc). The --prefix parameter wasn't needed there, but it might be useful on other distributions. Use the CLANG_CROSS_FLAGS variable instead of CLANG_FLAGS because it allows tools such as bpftool, that need to build both host and target binaries, to easily filter out the cross-build flags from CFLAGS. Signed-off-by: Jean-Philippe Brucker Signed-off-by: Andrii Nakryiko Acked-by: Quentin Monnet Acked-by: Nick Desaulniers Link: https://lore.kernel.org/bpf/20211216163842.829836-2-jean-philippe@linaro.org commit 68b9bcc8a534cd11fe55f8bc82f948aae7d81b3c Author: Hans de Goede Date: Fri Dec 3 11:28:57 2021 +0100 media: ipu3-cio2: Add support for instantiating i2c-clients for VCMs Some sensors come with a variable-focus lens where the lens focus is controller by a VCM (Voice Coil Motor). If there is a VCM for the lens-focus, and if so which one, is described on the vcm_type field of the ACPI SSDB table. These VCMs are a second I2C device listed as an extra I2cSerialBusV2 resource in the same ACPI device as the sensor. The i2c-core-acpi.c code only instantiates an i2c-client for the first I2cSerialBusV2 resource. Add support for instantiating an i2c-client for the VCM with the type of the i2c-client set based on the SSDB vcm_type field. Signed-off-by: Hans de Goede Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit fc2c204538a9fbfe2cd0c55a6e102275014cb9a1 Author: Hans de Goede Date: Fri Dec 3 11:28:56 2021 +0100 media: ipu3-cio2: Call cio2_bridge_init() before anything else Since cio2_bridge_init() may now return -EPROBE_DEFER it is best to call it before anything else. Signed-off-by: Hans de Goede Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit ae971ccae9de3c6ec6507a9ddc7fb10c03234b8b Author: Hans de Goede Date: Fri Dec 3 11:28:55 2021 +0100 media: ipu3-cio2: Defer probing until the PMIC is fully setup On devices where things are not fully describe in devicetree (1) and where the code thus falls back to calling cio2_bridge_init(), the i2c-clients for any VCMs also need to be instantiated manually. The VCM can be probed by its driver as soon as the code instantiates the i2c-client and this probing must not happen before the PMIC is fully setup. Make cio2_bridge_init() return -EPROBE_DEFER when the PMIC is not fully-setup, deferring the probe of the ipu3-cio2 driver. This is a preparation patch for adding VCM enumeration support to the ipu3-cio2-bridge code. 1) Through embedding of devicetree info in the ACPI tables Signed-off-by: Hans de Goede Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 86790a4fdf4b3d1ad96cd0f8c4e10bad878243d8 Author: Jernej Skrabec Date: Mon Nov 29 19:26:32 2021 +0100 media: hantro: Add support for Allwinner H6 Allwinner H6 has a Hantro G2 core used for VP9 decoding. It's not clear at this time if HEVC is also supported or not. Signed-off-by: Jernej Skrabec Acked-by: Andrzej Pietrasiewicz Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit fd6be12716c4f8a90173f52b3ea248b04956c5a9 Author: Jernej Skrabec Date: Mon Nov 29 19:26:31 2021 +0100 media: dt-bindings: allwinner: document H6 Hantro G2 binding Allwinner H6 contains older Hantro G2 core, primarly used for VP9 video decoding. It's unclear for now if HEVC is also supported. Describe its binding. Signed-off-by: Jernej Skrabec Reviewed-by: Rob Herring Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 3385c514ecc5a021782ce4347f8be8d3b1fcd595 Author: Jernej Skrabec Date: Mon Nov 29 19:26:30 2021 +0100 media: hantro: Convert imx8m_vpu_g2_irq to helper It turns out that imx8m_vpu_g2_irq() doesn't depend on any platform specifics and can be used with other G2 platform drivers too. Move it to common code. Signed-off-by: Jernej Skrabec Reviewed-by: Andrzej Pietrasiewicz Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 3c5b218c3606840048a9cacae4a29692ab1afc7c Author: Jernej Skrabec Date: Mon Nov 29 19:26:29 2021 +0100 media: hantro: move postproc enablement for old cores Older G2 cores, like that in Allwinner H6, seem to have issue with latching postproc register values if this is first thing done in job. Moving that to the end solves the issue. Signed-off-by: Jernej Skrabec Reviewed-by: Andrzej Pietrasiewicz Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 6a7c3219576055d0f11e563ef5ddb3d058172e72 Author: Jernej Skrabec Date: Mon Nov 29 19:26:28 2021 +0100 media: hantro: vp9: add support for legacy register set Some older G2 cores uses slightly different register set for HEVC and VP9. Since vast majority of registers and logic is the same, it doesn't make sense to introduce another drivers. Add legacy_regs quirk and implement only VP9 changes for now. HEVC changes will be introduced later, if needed. Reviewed-by: Andrzej Pietrasiewicz Signed-off-by: Jernej Skrabec Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e67a09d199cb9348bec1398bcc9c363fc04e226a Author: Jernej Skrabec Date: Mon Nov 29 19:26:27 2021 +0100 media: hantro: vp9: use double buffering if needed Some G2 variants need double buffering to be enabled in order to work correctly, like that found in Allwinner H6 SoC. Add platform quirk for that. Reviewed-by: Andrzej Pietrasiewicz Signed-off-by: Jernej Skrabec Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit ea71631b7129828c0da4f9d40ec172b7b2c24105 Author: Jernej Skrabec Date: Mon Nov 29 19:26:26 2021 +0100 media: hantro: add support for reset lines Some SoCs like Allwinner H6 use reset lines for resetting Hantro G2. Add support for them. Signed-off-by: Jernej Skrabec Reviewed-by: Andrzej Pietrasiewicz Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 37af43b250fda6162005d47bf7c959c70d52b107 Author: Jernej Skrabec Date: Mon Nov 29 19:26:25 2021 +0100 media: hantro: Fix probe func error path If clocks for some reason couldn't be enabled, probe function returns immediately, without disabling PM. This obviously leaves PM ref counters unbalanced. Fix that by jumping to appropriate error path, so effects of PM functions are reversed. Fixes: 775fec69008d ("media: add Rockchip VPU JPEG encoder driver") Signed-off-by: Jernej Skrabec Acked-by: Andrzej Pietrasiewicz Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 69a187456d106a351e0b13f98efc0f2e8b42b2a2 Author: Martin Kepplinger Date: Tue Nov 9 14:10:13 2021 +0100 media: i2c: hi846: use pm_runtime_force_suspend/resume for system suspend In cases like this when controlling regulators and clocks the suspend() and resume() functions are meant to be called balanced toggling the behaviour. It's wrong to use the same suspend function for runtime and system suspend in this case and leads to errors like [ 77.718890] Failed to disable vddd: -EIO Use pm_runtime_force_* helpers in order to support system suspend properly when runtime pm is already implemented and fix this. Signed-off-by: Martin Kepplinger Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit e1cc0a05539a115690e5d327dd1b40c15a59e19f Author: Martin Kepplinger Date: Tue Nov 9 14:10:12 2021 +0100 media: i2c: hi846: check return value of regulator_bulk_disable() regulator_bulk_disable can fail and thus suspend() can. Handle that error gracefully. Signed-off-by: Martin Kepplinger Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit d1d2ed5925c370ac09fa6efd39f5f569f562e5b7 Author: Bingbu Cao Date: Wed Dec 15 12:09:03 2021 +0100 media: hi556: Support device probe in non-zero ACPI D state Tell ACPI device PM code that the driver supports the device being in non-zero ACPI D state when the driver's probe function is entered. Also do identification on the first access of the device, whether in probe or when starting streaming. Signed-off-by: Bingbu Cao Signed-off-by: Kao, Arec Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 5525fd86ef7888f1eb279f27806ac9d4bb4303c2 Author: Bingbu Cao Date: Wed Dec 15 12:09:02 2021 +0100 media: ov5675: Support device probe in non-zero ACPI D state Tell ACPI device PM code that the driver supports the device being in non-zero ACPI D state when the driver's probe function is entered. Also do identification on the first access of the device, whether in probe or when starting streaming. Signed-off-by: Bingbu Cao Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 56ca3be85f3d33d050e65027c63ccad4425581c9 Author: Bingbu Cao Date: Wed Dec 15 12:09:01 2021 +0100 media: imx208: Support device probe in non-zero ACPI D state Tell ACPI device PM code that the driver supports the device being in non-zero ACPI D state when the driver's probe function is entered. Also do identification on the first access of the device, whether in probe or when starting streaming. Signed-off-by: Bingbu Cao Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit ada2c4f54d0ae933c4f257abf604849ef0f6de4a Author: Bingbu Cao Date: Wed Dec 15 12:09:00 2021 +0100 media: ov2740: support device probe in non-zero ACPI D state Tell ACPI device PM code that the driver supports the device being in non-zero ACPI D state when the driver's probe function is entered. Also do identification on the first access of the device, whether in probe or when starting streaming. Signed-off-by: Bingbu Cao Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 1e583b56e5e7469efd4c8ac184daa56944840e72 Author: Sakari Ailus Date: Wed Dec 15 12:08:59 2021 +0100 media: ov5670: Support device probe in non-zero ACPI D state Tell ACPI device PM code that the driver supports the device being in non-zero ACPI D state when the driver's probe function is entered. Also do identification on the first access of the device, whether in probe or when starting streaming. Signed-off-by: Bingbu Cao Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 0e014f1a8d546fb591c46c461fdb35244294daa1 Author: Bingbu Cao Date: Wed Dec 15 12:08:58 2021 +0100 media: ov8856: support device probe in non-zero ACPI D state Tell ACPI device PM code that the driver supports the device being in non-zero ACPI D state when the driver's probe function is entered. Also do identification on the first access of the device, whether in probe or when starting streaming. Signed-off-by: Bingbu Cao Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit cbe0b3af73bf72fad197756f026084404e2bcdc7 Author: Sakari Ailus Date: Wed Dec 15 09:38:48 2021 +0100 media: ov8865: Disable only enabled regulators on error path If powering on the sensor failed, the entire power-off sequence was run independently of how far the power-on sequence proceeded before the error. This lead to disabling regulators and/or clock that was not enabled. Fix this by disabling only clocks and regulators that were enabled previously. Fixes: 11c0d8fdccc5 ("media: i2c: Add support for the OV8865 image sensor") Cc: stable@vger.kernel.org Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 6ab7030039241c2667f5a7ad94935878279c9370 Author: Jean-Michel Hautbois Date: Tue Oct 5 22:20:19 2021 +0200 media: staging: ipu3-imgu: add the AWB memory layout While parsing the RAW AWB metadata, the AWB layout was missing to fully understand which byte corresponds to which feature. Make the field names and usage explicit, as it is used by the userspace applications. [Sakari Ailus: Changed wording of sat_ratio field as per review comments, fixed a whitespace issue.] Signed-off-by: Jean-Michel Hautbois Reviewed-by: Laurent Pinchart Reviewed-by: Bingbu Cao Reviewed-by: Tomasz Figa Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 5fcec420cc86c340a8226ffbaafed8dde6d7df08 Author: Sakari Ailus Date: Tue Dec 14 17:13:31 2021 +0100 media: Update Intel-submitted camera sensor driver contacts Hyungwoo's e-mail no longer works so I presume he's left the company. Drop Hyungwoo as maintainer on ov5670 driver and remove his e-mail from other sensor drivers. Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 3a956f0b123c1c2b165314a3173755aa3404036c Merge: b9aafbd46eb92 97c2259ec7757 Author: Mauro Carvalho Chehab Date: Thu Dec 16 20:54:02 2021 +0100 Merge tag 'platform-drivers-x86-int3472-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 into media_tree Signed tag for the immutable platform-drivers-x86-int3472 branch This branch contains 5.16-rc1 + the pending ACPI/i2c, tps68570 platform_data and INT3472 driver patches. * tag 'platform-drivers-x86-int3472-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: platform/x86: int3472: Deal with probe ordering issues platform/x86: int3472: Pass tps68470_regulator_platform_data to the tps68470-regulator MFD-cell platform/x86: int3472: Pass tps68470_clk_platform_data to the tps68470-regulator MFD-cell platform/x86: int3472: Add get_sensor_adev_and_name() helper platform/x86: int3472: Split into 2 drivers platform_data: Add linux/platform_data/tps68470.h file i2c: acpi: Add i2c_acpi_new_device_by_fwnode() function i2c: acpi: Use acpi_dev_ready_for_enumeration() helper ACPI: delay enumeration of devices with a _DEP pointing to an INT3472 device commit a840974e96fd51b47c79301522bccf23cc8bb388 Author: Thomas Richter Date: Thu Dec 16 16:14:54 2021 +0100 perf test: Test 73 Sig_trap fails on s390 In Linux next commit 5504f67944484495 ("perf test sigtrap: Add basic stress test for sigtrap handling") introduced the new test which uses breakpoint events. These events are not supported on s390 and PowerPC and always fail: # perf test -F 73 73: Sigtrap : FAILED! # Fix it the same way as in the breakpoint tests in file tests/bp_account.c where these type of tests are skipped on s390 and PowerPC platforms. With this patch skip this test on both platforms. Output after: # perf test -F 73 73: Sigtrap # Fixes: 5504f67944484495 ("perf test sigtrap: Add basic stress test for sigtrap handling") Signed-off-by: Thomas Richter Acked-by: Marco Elver Cc: Heiko Carstens Cc: Sumanth Korikkar Cc: Sven Schnelle Cc: Vasily Gorbik Link: https://lore.kernel.org/r/20211216151454.752066-1-tmricht@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo commit 8f62718bd0f7278f08ca00ea4664f54a6258044f Author: AngeloGioacchino Del Regno Date: Wed Dec 8 10:10:36 2021 +0100 clk: qcom: Add MSM8976/56 Global Clock Controller (GCC) driver Add support for the global clock controller found on MSM8956 and MSM8976 SoCs. Since the multimedia clocks are actually in the GCC on these SoCs, this will allow drivers to probe and control basically all the required clocks. Signed-off-by: AngeloGioacchino Del Regno Co-developed-by: Marijn Suijten Signed-off-by: Marijn Suijten Co-developed-by: Konrad Dybcio Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211208091036.132334-3-marijn.suijten@somainline.org commit 6d24d9546d6e6c524505e51bb5f76d9a83fac478 Author: Marijn Suijten Date: Wed Dec 8 10:10:35 2021 +0100 dt-bindings: clk: qcom: Document MSM8976 Global Clock Controller Document the required properties and firmware clocks for gcc-msm8976 to operate nominally, and add header definitions for referencing the clocks from firmware. Signed-off-by: Marijn Suijten Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Rob Herring Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211208091036.132334-2-marijn.suijten@somainline.org commit db0c944ee92b7df1270ea8fa3ededb8199ce7ba6 Author: Vinod Koul Date: Tue Dec 7 17:10:03 2021 +0530 clk: qcom: Add clock driver for SM8450 This adds Global Clock controller (GCC) driver for SM8450 SoC including the gcc resets and gdsc. This patch is based on initial code downstream by Vivek Aknurwar Signed-off-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211207114003.100693-3-vkoul@kernel.org commit fe5cf1c34f382cf19ad6ebb9486f8c264703085d Merge: d79afa2013287 72a0ca203ca7f Author: Bjorn Andersson Date: Tue Dec 14 21:19:55 2021 -0600 Merge tag '20211207114003.100693-2-vkoul@kernel.org' into clk-for-5.17 v5.16-rc1 + 20211207114003.100693-2-vkoul@kernel.org The immutable branch contains the DT binding and clock defines as need for the Qualcomm SM8450 global clock controller driver. commit d79afa2013287afb7cd152aa21a51eab5aa6305f Author: Vamsi Krishna Lanka Date: Mon Dec 6 23:32:51 2021 -0800 clk: qcom: Add SDX65 GCC support Add Global Clock Controller (GCC) support for SDX65 SoCs from Qualcomm. Signed-off-by: Vamsi Krishna Lanka Reviewed-by: Bjorn Andersson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/b5ea8a00d4e8418b57f4444d0b5243c1acc41808.1638861860.git.quic_vamslank@quicinc.com commit d1b121d62b7e37c52ce4eb83adddb14e139665dd Author: Vamsi Krishna Lanka Date: Mon Dec 6 23:32:50 2021 -0800 clk: qcom: Add LUCID_EVO PLL type for SDX65 Add a LUCID_EVO PLL type for SDX65 SoC from Qualcomm. Signed-off-by: Vamsi Krishna Lanka Reviewed-by: Bjorn Andersson Reviewed-by: Vinod Koul [bjorn: Fixed indentation issues reported by checkpatch] Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/d582c3e291ae82aa488785eff36157653741f841.1638861860.git.quic_vamslank@quicinc.com commit 4ad3ce007098b6c3e2869126534fc90f4f6f9253 Merge: ab5d31790f4d5 8f8ef3860d440 Author: Bjorn Andersson Date: Tue Dec 14 21:00:36 2021 -0600 Merge tag 'e15509b2b7c9b600ab38c5269d4fac609c077b5b.1638861860.git.quic_vamslank@quicinc.com' into clk-for-5.17 v5.16-rc1 + e15509b2b7c9b600ab38c5269d4fac609c077b5b.1638861860.git.quic_vamslank@quicinc.com Merge the immutable branch containing the DT binding and clock definitions needed for the SDX65 global clock controller driver. commit 0cd7f378b0927e10774981eb09e388258ca925e0 Author: Alex Deucher Date: Wed Dec 15 22:13:56 2021 -0500 drm/amdgpu: add support for IP discovery gc_info table v2 Used on gfx9 based systems. Fixes incorrect CU counts reported in the kernel log. Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1833 Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 799dce6fbd5fda21d461b56b8c6ca85214e20076 Author: Jiapeng Chong Date: Thu Dec 16 15:50:17 2021 +0800 drm/amd/display: Fix warning comparing pointer to 0 Fix the following coccicheck warning: ./drivers/gpu/drm/amd/display/dc/clk_mgr/dcn301/vg_clk_mgr.c:744:35-36: WARNING comparing pointer to 0. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Alex Deucher commit 109a357f287c3b14a43216104299aafc1fa23cbc Author: Alex Deucher Date: Mon Dec 13 14:42:43 2021 -0500 drm/amdgpu: clean up some leftovers from bring up Some old registers leftover from pre-silicon. No longer relevant on real hardware. Remove. Reviewed-by: James Zhu Signed-off-by: Alex Deucher commit 892deb48269c65376f3eeb5b4c032ff2c2979bd7 Author: Victor Skvortsov Date: Thu Dec 16 17:01:45 2021 +0000 drm/amdgpu: Separate vf2pf work item init from virt data exchange We want to be able to call virt data exchange conditionally after gmc sw init to reserve bad pages as early as possible. Since this is a conditional call, we will need to call it again unconditionally later in the init sequence. Refactor the data exchange function so it can be called multiple times without re-initializing the work item. v2: Cleaned up the code. Kept the original call to init_exchange_data() inside early init to initialize the work item, afterwards call exchange_data() when needed. Signed-off-by: Victor Skvortsov Reviewed By: Shaoyun.liu Signed-off-by: Alex Deucher commit d999bc81ac3872a8543c4afbce30e0d46b4bb9e1 Author: Changcheng Deng Date: Wed Dec 15 08:52:26 2021 +0000 drm/amdkfd: use max() and min() to make code cleaner Use max() and min() in order to make code cleaner. Reported-by: Zeal Robot Signed-off-by: Changcheng Deng Reviewed-by: Philip Yang Signed-off-by: Alex Deucher commit d4c2933fb8eece9b2703e9ddd4aa8f1a77f22450 Author: chen gong Date: Thu Dec 9 19:47:10 2021 +0800 drm/amdgpu: When the VCN(1.0) block is suspended, powergating is explicitly enabled Play a video on the raven (or PCO, raven2) platform, and then do the S3 test. When resume, the following error will be reported: amdgpu 0000:02:00.0: [drm:amdgpu_ring_test_helper [amdgpu]] *ERROR* ring vcn_dec test failed (-110) [drm:amdgpu_device_ip_resume_phase2 [amdgpu]] *ERROR* resume of IP block failed -110 amdgpu 0000:02:00.0: amdgpu: amdgpu_device_ip_resume failed (-110). PM: dpm_run_callback(): pci_pm_resume+0x0/0x90 returns -110 [why] When playing the video: The power state flag of the vcn block is set to POWER_STATE_ON. When doing suspend: There is no change to the power state flag of the vcn block, it is still POWER_STATE_ON. When doing resume: Need to open the power gate of the vcn block and set the power state flag of the VCN block to POWER_STATE_ON. But at this time, the power state flag of the vcn block is already POWER_STATE_ON. The power status flag check in the "8f2cdef drm/amd/pm: avoid duplicate powergate/ungate setting" patch will return the amdgpu_dpm_set_powergating_by_smu function directly. As a result, the gate of the power was not opened, causing the subsequent ring test to fail. [how] In the suspend function of the vcn block, explicitly change the power state flag of the vcn block to POWER_STATE_OFF. BugLink: https://gitlab.freedesktop.org/drm/amd/-/issues/1828 Signed-off-by: chen gong Reviewed-by: Evan Quan Signed-off-by: Alex Deucher commit 4c88bb96e40b757f4796f70a4a7507df554467c4 Author: Alexander Gordeev Date: Thu Nov 4 07:14:46 2021 +0100 s390/mm: check 2KB-fragment page on release When CONFIG_DEBUG_VM is defined check that pending remove and tracking nibbles (bits 31-24 of the page refcount) are cleared. Should the earlier stages of the page lifespan have a race or logical error, such check could help in exposing the issue. Signed-off-by: Alexander Gordeev Reviewed-by: Gerald Schaefer Signed-off-by: Heiko Carstens commit 1194372db6f3c917c9c6f6907e8378cf1076c557 Author: Alexander Gordeev Date: Thu Nov 4 07:14:45 2021 +0100 s390/mm: better annotate 2KB pagetable fragments handling Explicitly encode immediate value of pending remove nibble (bits 31-28) and tracking nibble (bits 27-24) of the page refcount whenever these nibbles are tested or changed, for better readability. Also, add some comments describing how the fragments are handled. Reviewed-by: Gerald Schaefer Signed-off-by: Alexander Gordeev Signed-off-by: Heiko Carstens commit c2c224932fd0ee6854d6ebfc8d059c2bcad86606 Author: Alexander Gordeev Date: Thu Nov 4 07:14:44 2021 +0100 s390/mm: fix 2KB pgtable release race There is a race on concurrent 2KB-pgtables release paths when both upper and lower halves of the containing parent page are freed, one via page_table_free_rcu() + __tlb_remove_table(), and the other via page_table_free(). The race might lead to a corruption as result of remove of list item in page_table_free() concurrently with __free_page() in __tlb_remove_table(). Let's assume first the lower and next the upper 2KB-pgtables are freed from a page. Since both halves of the page are allocated the tracking byte (bits 24-31 of the page _refcount) has value of 0x03 initially: CPU0 CPU1 ---- ---- page_table_free_rcu() // lower half { // _refcount[31..24] == 0x03 ... atomic_xor_bits(&page->_refcount, 0x11U << (0 + 24)); // _refcount[31..24] <= 0x12 ... table = table | (1U << 0); tlb_remove_table(tlb, table); } ... __tlb_remove_table() { // _refcount[31..24] == 0x12 mask = _table & 3; // mask <= 0x01 ... page_table_free() // upper half { // _refcount[31..24] == 0x12 ... atomic_xor_bits( &page->_refcount, 1U << (1 + 24)); // _refcount[31..24] <= 0x10 // mask <= 0x10 ... atomic_xor_bits(&page->_refcount, mask << (4 + 24)); // _refcount[31..24] <= 0x00 // mask <= 0x00 ... if (mask != 0) // == false break; fallthrough; ... if (mask & 3) // == false ... else __free_page(page); list_del(&page->lru); ^^^^^^^^^^^^^^^^^^ RACE! ^^^^^^^^^^^^^^^^^^^^^ } ... } The problem is page_table_free() releases the page as result of lower nibble unset and __tlb_remove_table() observing zero too early. With this update page_table_free() will use the similar logic as page_table_free_rcu() + __tlb_remove_table(), and mark the fragment as pending for removal in the upper nibble until after the list_del(). In other words, the parent page is considered as unreferenced and safe to release only when the lower nibble is cleared already and unsetting a bit in upper nibble results in that nibble turned zero. Cc: stable@vger.kernel.org Suggested-by: Vlastimil Babka Reviewed-by: Gerald Schaefer Signed-off-by: Alexander Gordeev Signed-off-by: Heiko Carstens commit cb22cd2d8ff3201f04f167efa86cc561dccffffe Author: Alexander Egorenkov Date: Thu Nov 11 12:33:59 2021 +0100 s390/sclp: release SCLP early buffer after kernel initialization The SCLP early buffer is used only during kernel initialization and can be freed afterwards. The only way to ensure that it is not released while being in use, is to release it in free_initmem(). Acked-by: Heiko Carstens Reviewed-by: Alexander Gordeev Signed-off-by: Alexander Egorenkov [agordeev@linux.ibm.com: added debug output] Signed-off-by: Alexander Gordeev Signed-off-by: Heiko Carstens commit c7ed509b21b6566990ff39a6744cd5e214b5dca9 Author: Alexander Gordeev Date: Fri Dec 10 16:32:11 2021 +0100 s390/nmi: disable interrupts on extended save area update Updating of the pointer to machine check extended save area on the IPL CPU needs the lowcore protection to be disabled. Disable interrupts while the protection is off to avoid unnoticed writes to the lowcore. Suggested-by: Heiko Carstens Signed-off-by: Alexander Gordeev Signed-off-by: Heiko Carstens commit cff2d3abc8da078a0447d785736204d8a0ad49b0 Author: Juergen Christ Date: Mon Nov 22 14:01:34 2021 +0100 s390/zcrypt: CCA control CPRB sending When sending a CCA CPRB to a control domain, the CPRB has to be sent via a usage domain. Previous code used the default domain to route this message. If the default domain is not online and ready to send the CPRB, the ioctl will fail even if other usage domains could be used to send the CPRB. To improve this, instead of using the default domain, switch to auto-select of the domain. Signed-off-by: Juergen Christ Reviewed-by: Harald Freudenberger Signed-off-by: Heiko Carstens commit 248420797d28c922507f9bfbcc64dbaa0c0a7f53 Author: Heiko Carstens Date: Tue Dec 14 20:41:13 2021 +0100 s390/disassembler: update opcode table Sync with binutils: update opcode table to reflect the instruction format update of the lpswey instruction, and add the qpaci instruction. Signed-off-by: Heiko Carstens commit 15b5c1833afc80b952383502eb06529db2b26219 Author: Heiko Carstens Date: Mon Dec 13 19:16:38 2021 +0100 s390/uv: fix memblock virtual vs physical address confusion memblock_alloc_try_nid() returns a virtual address, however in error case the allocated memory is incorrectly freed with memblock_phys_free(). Properly use memblock_free() instead, and pass a physical address to uv_init() to fix this. Note: this doesn't fix a bug currently, since virtual and physical addresses are identical. Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens commit fcfcba6dfc9a57da9c816667c20614ddfd4def10 Author: Heiko Carstens Date: Mon Dec 13 19:00:57 2021 +0100 s390/smp: fix memblock_phys_free() vs memblock_free() confusion memblock_phys_free() is used on a virtual address. Fix this by using memblock_free(). Note: this doesn't fix a bug currently, since virtual and physical addresses are identical. Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens commit b6b486ecef02916af8a430397ccd5a68c5b967b1 Author: Heiko Carstens Date: Mon Dec 13 18:59:02 2021 +0100 s390/sclp: fix memblock_phys_free() vs memblock_free() confusion memblock_phys_free() is used on a virtual address. Fix this by using memblock_free(). Note: this doesn't fix a bug currently, since virtual and physical addresses are identical. Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens commit 893d4d9c62ecb32bad7843fc31ec9eb740600758 Author: Eric W. Biederman Date: Wed Dec 8 14:25:23 2021 -0600 s390/exit: remove dead reference to do_exit from copy_thread My s390 assembly is not particularly good so I have read the history of the reference to do_exit copy_thread and have been able to verify that do_exit is not used. The general argument is that s390 has been changed to use the generic kernel_thread and kernel_execve and the generic versions do not call do_exit. So it is strange to see a do_exit reference sitting there. The history of the do_exit reference in s390's version of copy_thread seems conclusive that the do_exit reference is something that lingers and should have been removed several years ago. Up through 8d19f15a60be ("[PATCH] s390 update (1/27): arch.") the s390 code made a call to the exit(2) system call when a kernel thread finished. Then kernel_thread_starter was added which branched directly to the value in register 11 when the kernel thread finshed. The value in register 11 was set in kernel_thread to "regs.gprs[11] = (unsigned long) do_exit" In commit 37fe5d41f640 ("s390: fold kernel_thread_helper() into ret_from_fork()") kernel_thread_starter was moved into entry.S and entry64.S unchanged (except for the syntax differences between inline assemly and in the assembly file). In commit f9a7e025dfc2 ("s390: switch to generic kernel_thread()") the assignment to "gprs[11]" was moved into copy_thread from the old kernel_thread. The helper kernel_thread_starter was still being used and was still branching to "%r11" at the end. In commit 30dcb0996e40 ("s390: switch to saner kernel_execve() semantics") kernel_thread_starter was changed to unconditionally branch to sysc_tracenogo instead to %r11 which held the value of do_exit. Unfortunately copy_thread was not updated to stop passing do_exit in "gprs[11]". In commit 56e62a737028 ("s390: convert to generic entry") kernel_thread_starter was replaced by __ret_from_fork. And the code still continued to pass do_exit in "gprs[11]" despite __ret_from_fork not caring in the slightest. Remove this dead reference to do_exit to make it clear that s390 is not doing anything with do_exit in copy_thread. History Tree: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git Cc: Vasily Gorbik Cc: Christian Borntraeger Cc: Alexander Gordeev Cc: Al Viro Fixes: 30dcb0996e40 ("s390: switch to saner kernel_execve() semantics") Signed-off-by: "Eric W. Biederman" Link: https://lore.kernel.org/r/20211208202532.16409-1-ebiederm@xmission.com Signed-off-by: Heiko Carstens commit 3c27abee3fc3d59fb978e3291b60eaaddbcbf2e6 Author: Lijo Lazar Date: Wed Dec 15 23:37:03 2021 +0800 drm/amd/pm: Fix xgmi link control on aldebaran Fix the message argument. 0: Allow power down 1: Disallow power down Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 0ff76b5334fa6f44d1a1a6b3bd39f5667b092654 Author: Mario Limonciello Date: Tue Dec 14 15:28:30 2021 -0600 drm/amd/pm: restore SMU version print statement for dGPUs This is still needed for thoes in case the firmware fails to load then the message is the only way to tell what firmware was on them Suggested-by: Lijo Lazar Signed-off-by: Mario Limonciello Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 69879b3083cc5022585d1826c663c330efae4e63 Author: Philip Yang Date: Wed Nov 24 08:49:15 2021 -0500 drm/amdkfd: fix svm_bo release invalid wait context warning Add svm_range_bo_unref_async to schedule work to wait for svm_bo eviction work done and then free svm_bo. __do_munmap put_page is atomic context, call svm_range_bo_unref_async to avoid warning invalid wait context. Other non atomic context call svm_range_bo_unref. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 5c1e6fa49e8d8dbdd8bb457492b2bc52718df244 Author: Huang Rui Date: Thu Dec 16 13:35:27 2021 -0500 drm/amdgpu: introduce new amdgpu_fence object to indicate the job embedded fence The job embedded fence donesn't initialize the flags at dma_fence_init(). Then we will go a wrong way in amdgpu_fence_get_timeline_name callback and trigger a null pointer panic once we enabled the trace event here. So introduce new amdgpu_fence object to indicate the job embedded fence. [ 156.131790] BUG: kernel NULL pointer dereference, address: 00000000000002a0 [ 156.131804] #PF: supervisor read access in kernel mode [ 156.131811] #PF: error_code(0x0000) - not-present page [ 156.131817] PGD 0 P4D 0 [ 156.131824] Oops: 0000 [#1] PREEMPT SMP PTI [ 156.131832] CPU: 6 PID: 1404 Comm: sdma0 Tainted: G OE 5.16.0-rc1-custom #1 [ 156.131842] Hardware name: Gigabyte Technology Co., Ltd. Z170XP-SLI/Z170XP-SLI-CF, BIOS F20 11/04/2016 [ 156.131848] RIP: 0010:strlen+0x0/0x20 [ 156.131859] Code: 89 c0 c3 0f 1f 80 00 00 00 00 48 01 fe eb 0f 0f b6 07 38 d0 74 10 48 83 c7 01 84 c0 74 05 48 39 f7 75 ec 31 c0 c3 48 89 f8 c3 <80> 3f 00 74 10 48 89 f8 48 83 c0 01 80 38 00 75 f7 48 29 f8 c3 31 [ 156.131872] RSP: 0018:ffff9bd0018dbcf8 EFLAGS: 00010206 [ 156.131880] RAX: 00000000000002a0 RBX: ffff8d0305ef01b0 RCX: 000000000000000b [ 156.131888] RDX: ffff8d03772ab924 RSI: ffff8d0305ef01b0 RDI: 00000000000002a0 [ 156.131895] RBP: ffff9bd0018dbd60 R08: ffff8d03002094d0 R09: 0000000000000000 [ 156.131901] R10: 000000000000005e R11: 0000000000000065 R12: ffff8d03002094d0 [ 156.131907] R13: 000000000000001f R14: 0000000000070018 R15: 0000000000000007 [ 156.131914] FS: 0000000000000000(0000) GS:ffff8d062ed80000(0000) knlGS:0000000000000000 [ 156.131923] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 156.131929] CR2: 00000000000002a0 CR3: 000000001120a005 CR4: 00000000003706e0 [ 156.131937] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 156.131942] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 156.131949] Call Trace: [ 156.131953] [ 156.131957] ? trace_event_raw_event_dma_fence+0xcc/0x200 [ 156.131973] ? ring_buffer_unlock_commit+0x23/0x130 [ 156.131982] dma_fence_init+0x92/0xb0 [ 156.131993] amdgpu_fence_emit+0x10d/0x2b0 [amdgpu] [ 156.132302] amdgpu_ib_schedule+0x2f9/0x580 [amdgpu] [ 156.132586] amdgpu_job_run+0xed/0x220 [amdgpu] v2: fix mismatch warning between the prototype and function name (Ray, kernel test robot) Signed-off-by: Huang Rui Reviewed-by: Christian König Signed-off-by: Alex Deucher commit f296a0bcc9611ba96ca3abb3332e21ee600d153f Author: Prike Liang Date: Mon Dec 13 16:17:02 2021 +0800 drm/amd/pm: skip setting gfx cgpg in the s0ix suspend-resume In the s0ix entry need retain gfx in the gfxoff state,so here need't set gfx cgpg in the S0ix suspend-resume process. Moreover move the S0ix check into SMU12 can simplify the code condition check. Signed-off-by: Prike Liang Reviewed-by: Evan Quan Signed-off-by: Alex Deucher commit 9f952378fcb90d202cbdf359aaeaad9429edbd0a Author: Mario Limonciello Date: Mon Dec 13 21:56:56 2021 -0600 drivers/amd/pm: smu13: use local variable adev Since this variable was made available by the previous commit, use it to make function access cleaner. Suggested-by: Guchun Chen Signed-off-by: Mario Limonciello Reviewed-by: Guchun Chen Signed-off-by: Alex Deucher commit fd5e3c4ab92e39b3411147b3fd845e70e81ac7a7 Merge: b530d5f39c2fb bebd87eea29ad Author: Kalle Valo Date: Thu Dec 16 20:12:58 2021 +0200 Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath.git patches for v5.17. Major changes: ath11k * support PCI devices with 1 MSI vector * WCN6855 hw2.1 support * 11d scan offload support * full monitor mode, only supported on QCN9074 * scan MAC address randomization support * reserved host DDR addresses from DT for PCI devices support ath9k * switch to rate table based lookup ath * extend South Korea regulatory domain support wcn36xx * beacon filter support commit 1155ed05756a4e0f8fbc1760d6ca79354fe034c1 Author: Jonathan Cameron Date: Sun Nov 28 17:24:34 2021 +0000 iio:accel:bma180: Suppress clang W=1 warning about pointer to enum conversion. Cast to a uintptr_t rather than directly to the enum. As per the discussion in below linked media patch. Link: https://lore.kernel.org/linux-media/CAK8P3a2ez6nEw4d+Mqa3XXAz0RFTZHunqqRj6sCt7Y_Eqqs0rw@mail.gmail.com/ Signed-off-by: Jonathan Cameron Cc: Arnd Bergmann Cc: Mauro Carvalho Chehab Cc: Stephan Gerhold Reviewed-by: Nathan Chancellor Link: https://lore.kernel.org/r/20211128172445.2616166-2-jic23@kernel.org commit 8f2b54824b28ba8317c60947b5941d686e3df70d Author: Mihail Chindris Date: Mon Dec 13 11:08:25 2021 +0000 drivers:iio:dac: Add AD3552R driver support The AD3552R-16 is a low drift ultrafast, 16-bit accuracy, current output digital-to-analog converter (DAC) designed to generate multiple output voltage span ranges. The AD3552R-16 operates with a fixed 2.5V reference. Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/ad3552r.pdf Signed-off-by: Mihail Chindris Link: https://lore.kernel.org/r/20211213110825.244347-3-mihail.chindris@analog.com Signed-off-by: Jonathan Cameron commit 5ef1630586317e92c9ebd7b4ce48f393b7ff790f Author: Christoph Hellwig Date: Thu Dec 9 07:31:31 2021 +0100 block: only build the icq tracking code when needed Only bfq needs to code to track icq, so make it conditional. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20211209063131.18537-12-hch@lst.de Signed-off-by: Jens Axboe commit 90b627f5426ce144cdd4ea585d1f7812359a1a6a Author: Christoph Hellwig Date: Thu Dec 9 07:31:30 2021 +0100 block: fold create_task_io_context into ioc_find_get_icq Fold create_task_io_context into the only remaining caller. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20211209063131.18537-11-hch@lst.de Signed-off-by: Jens Axboe commit 5fc11eebb4a98df5324a4de369bb5ab7f0007ff7 Author: Christoph Hellwig Date: Thu Dec 9 07:31:29 2021 +0100 block: open code create_task_io_context in set_task_ioprio The flow in set_task_ioprio can be simplified by simply open coding create_task_io_context, which removes a refcount roundtrip on the I/O context. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20211209063131.18537-10-hch@lst.de Signed-off-by: Jens Axboe commit 8472161b77c41d260c5ba0af6bf940269b297bb6 Author: Christoph Hellwig Date: Thu Dec 9 07:31:28 2021 +0100 block: fold get_task_io_context into set_task_ioprio Fold get_task_io_context into its only caller, and simplify the code as no reference to the I/O context is required to just set the ioprio field. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20211209063131.18537-9-hch@lst.de Signed-off-by: Jens Axboe commit a411cd3cfdc5bbd1329d5b33dbf39e2b5213969d Author: Christoph Hellwig Date: Thu Dec 9 07:31:27 2021 +0100 block: move set_task_ioprio to blk-ioc.c Keep set_task_ioprio with the other low-level code that accesses the io_context structure. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20211209063131.18537-8-hch@lst.de Signed-off-by: Jens Axboe commit 091abcb3efd71cb18e80c8f040d9e4a634d8906d Author: Christoph Hellwig Date: Thu Dec 9 07:31:26 2021 +0100 block: cleanup ioc_clear_queue Fold __ioc_clear_queue into ioc_clear_queue and switch to always use plain _irq locking instead of the more expensive _irqsave that is not needed here. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20211209063131.18537-7-hch@lst.de Signed-off-by: Jens Axboe commit edf70ff5a1ed9769da35178454d743828061a6a3 Author: Christoph Hellwig Date: Thu Dec 9 07:31:25 2021 +0100 block: refactor put_io_context Move the code to delay freeing the icqs into a separate helper. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20211209063131.18537-6-hch@lst.de Signed-off-by: Jens Axboe commit 8a20c0c7e0cea7eb0c32fd6b63ff514c9ac32b8f Author: Christoph Hellwig Date: Thu Dec 9 07:31:24 2021 +0100 block: remove the NULL ioc check in put_io_context No caller passes in a NULL pointer, so remove the check. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20211209063131.18537-5-hch@lst.de Signed-off-by: Jens Axboe commit 4be8a2eaff2e4473b6e8ad9a3857bc9b1e79c8ba Author: Christoph Hellwig Date: Thu Dec 9 07:31:23 2021 +0100 block: refactor put_iocontext_active Factor out a ioc_exit_icqs helper to tear down the icqs and the fold the rest of put_iocontext_active into exit_io_context. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20211209063131.18537-4-hch@lst.de Signed-off-by: Jens Axboe commit 0aed2f162bbc7853fe91c0d70492ea73c4e9cb07 Author: Christoph Hellwig Date: Thu Dec 9 07:31:22 2021 +0100 block: simplify struct io_context refcounting Don't hold a reference to ->refcount for each active reference, but just one for all active references. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20211209063131.18537-3-hch@lst.de Signed-off-by: Jens Axboe commit 8a2ba1785c5803d59a63b6320ff54fd4a37a41ce Author: Christoph Hellwig Date: Thu Dec 9 07:31:21 2021 +0100 block: remove the nr_task field from struct io_context Nothing ever looks at ->nr_tasks, so remove it. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara Link: https://lore.kernel.org/r/20211209063131.18537-2-hch@lst.de Signed-off-by: Jens Axboe commit 3427f2b2c533d97bcc57b4237c2af21a8bd2cdbc Author: Christoph Hellwig Date: Thu Dec 16 09:42:44 2021 +0100 block: remove the rsxx driver This driver was for rare and shortlived high end enterprise hardware and hasn't been maintained since 2014, which also means it never got converted to use blk-mq. Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe commit b0a96c5f599ecf263119d092e22a984d3248fd85 Author: Mihail Chindris Date: Mon Dec 13 11:08:24 2021 +0000 dt-bindings: iio: dac: Add adi,ad3552r.yaml Add documentation for ad3552r and ad3542r Signed-off-by: Mihail Chindris Reviewed-by: Rob Herring Signed-off-by: Jonathan Cameron commit d62cbcf62f2f4bf933d18113bcda45e18cc890f6 Author: Jens Axboe Date: Thu Nov 18 08:37:30 2021 -0700 nvme: add support for mq_ops->queue_rqs() This enables the block layer to send us a full plug list of requests that need submitting. The block layer guarantees that they all belong to the same queue, but we do have to check the hardware queue mapping for each request. If errors are encountered, leave them in the passed in list. Then the block layer will handle them individually. This is good for about a 4% improvement in peak performance, taking us from 9.6M to 10M IOPS/core. Reviewed-by: Hannes Reinecke Reviewed-by: Keith Busch Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 62451a2b2e7ea17c4a547ada6a5deebf8787a27a Author: Jens Axboe Date: Fri Oct 29 14:34:11 2021 -0600 nvme: separate command prep and issue Add a nvme_prep_rq() helper to setup a command, and nvme_queue_rq() is adapted to use this helper. Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 3233b94cf842984ea7e208d5be1ad2f2af02d495 Author: Jens Axboe Date: Fri Oct 29 14:32:44 2021 -0600 nvme: split command copy into a helper We'll need it for batched submit as well. Since we now have a copy helper, get rid of the nvme_submit_cmd() wrapper. Reviewed-by: Chaitanya Kulkarni Reviewed-by: Hannes Reinecke Reviewed-by: Max Gurtovoy Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 3a905438887bf060b475d1774d80a24d72858d12 Author: Abhinav Kumar Date: Wed Dec 15 18:27:38 2021 -0800 drm/msm/dpu: add layer mixer register dump to dpu snapshot Add the missing layer mixer register dump information to dpu snapshot to assist debugging. Reviewed-by: Dmitry Baryshkov Signed-off-by: Abhinav Kumar Link: https://lore.kernel.org/r/1639621658-1500-1-git-send-email-quic_abhinavk@quicinc.com Signed-off-by: Rob Clark commit 2672e4e71a9183b81c20d19ab460f6159dd5119a Author: Dmitry Baryshkov Date: Thu Dec 2 01:26:33 2021 +0300 drm/msm/dpu: move SSPP debugfs support from plane to SSPP code We are preparing to change DPU plane implementation. Move SSPP debugfs code from dpu_plane.c to dpu_hw_sspp.c, where it belongs. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20211201222633.2476780-9-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 7620bdfb250247388a501e5e9ff8185c2191e453 Author: Changcheng Deng Date: Wed Dec 15 08:55:54 2021 +0000 drm/msm/dp: remove unneeded variable Remove unneeded variable used to store return value. Reported-by: Zeal Robot Signed-off-by: Changcheng Deng Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/20211215085554.444351-1-deng.changcheng@zte.com.cn Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit f3d5d7cc23098ec1bdf76ca9188aa00021269d62 Author: Rob Clark Date: Wed Dec 15 09:59:02 2021 -0800 drm/msm: Don't use autosuspend for display No functional change, as we only actually enable autosuspend for the GPU device. But lets not encourage thinking that autosuspend is a good idea for anything display related. Signed-off-by: Rob Clark Reviewed-by: Stephen Boyd Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20211215175910.1744151-1-robdclark@gmail.com Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit c1760555884b7fae1c0b1aecef6cc00efda73e3c Author: Rob Clark Date: Wed Dec 15 09:45:08 2021 -0800 drm/msm/debugfs: Add display/kms state snapshot Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20211215174524.1742389-4-robdclark@gmail.com Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 59871211c6542707368fe7246c895178d9ad5060 Author: Rob Clark Date: Wed Dec 15 09:45:07 2021 -0800 drm/msm/disp: Export helper for capturing snapshot We'll re-use this for debugfs. Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20211215174524.1742389-3-robdclark@gmail.com Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit bf92d87d7c678b29b18e65ae4a97ced4bbe18c06 Author: Antoniu Miclaus Date: Tue Dec 7 17:54:45 2021 +0200 iio:filter:admv8818: Add sysfs ABI documentation Add initial ABI documentation for admv8818 filter sysfs interfaces. Signed-off-by: Antoniu Miclaus Signed-off-by: Jonathan Cameron commit bf75e044ca6b03256faa99590c264251f052eefb Author: Antoniu Miclaus Date: Tue Dec 7 17:54:44 2021 +0200 dt-bindings:iio:filter: add admv8818 doc Add device tree bindings for the ADMV8818 Filter. Signed-off-by: Antoniu Miclaus Reviewed-by: Rob Herring Signed-off-by: Jonathan Cameron commit f34fe888ad0546dacf678aa604435d442934984f Author: Antoniu Miclaus Date: Tue Dec 7 17:54:43 2021 +0200 iio:filter:admv8818: add support for ADMV8818 The ADMV8818-EP is a fully monolithic microwave integrated circuit (MMIC) that features a digitally selectable frequency of operation. The device features four independently controlled high- pass filters (HPFs) and four independently controlled low-pass filters (LPFs) that span the 2 GHz to 18 GHz frequency range. Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/admv8818-ep.pdf Signed-off-by: Antoniu Miclaus Signed-off-by: Jonathan Cameron commit 35c35b0c4161273e22d1bfb17e935d5dd7cefa8e Author: Antoniu Miclaus Date: Tue Dec 7 17:54:42 2021 +0200 iio: add filter subfolder Add filter subfolder for IIO devices that handle filter functionality. Signed-off-by: Antoniu Miclaus Signed-off-by: Jonathan Cameron commit 9d8604b28575ccab3afd8d6f56cab9a6c0d281ef Author: Marc Zyngier Date: Mon Nov 29 20:00:45 2021 +0000 KVM: arm64: Rework kvm_pgtable initialisation Ganapatrao reported that the kvm_pgtable->mmu pointer is more or less hardcoded to the main S2 mmu structure, while the nested code needs it to point to other instances (as we have one instance per nested context). Rework the initialisation of the kvm_pgtable structure so that this assumtion doesn't hold true anymore. This requires some minor changes to the order in which things are initialised (the mmu->arch pointer being the critical one). Reported-by: Ganapatrao Kulkarni Reviewed-by: Ganapatrao Kulkarni Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211129200150.351436-5-maz@kernel.org commit 4c0777712385761c6df119b5fa530035a485725c Merge: 136057256686d a43676272a6e0 Author: Arnd Bergmann Date: Thu Dec 16 17:51:38 2021 +0100 Merge tag 'jh7100-for-5.17' of https://github.com/esmil/linux into arm/newsoc Basic StarFive JH7100 RISC-V SoC support This adds support for the StarFive JH7100 RISC-V SoC. The SoC has many devices that need non-coherent DMA operations to work which isn't upstream yet[1], so this just adds basic support to boot up, get a serial console, blink an LED and reboot itself. Unlike the Allwinner D1 this chip doesn't use any extra pagetable bits, but instead the DDR RAM appears twice in the memory map, with and without the cache. The JH7100 is a test chip for the upcoming JH7110 and about 300 BeagleV Starlight Beta boards were sent out with them as part of a now cancelled BeagleBoard.org project. However StarFive has produced more of the JH7100s and will be selling VisionFive boards with them soon[2]. [1]: https://lore.kernel.org/linux-riscv/20210723214031.3251801-2-atish.patra@wdc.com/ [2]: https://www.cnx-software.com/2021/12/09/starfive-visionfive-single-board-computer-for-sale-accelerating-risc-v-ecosystem-development/ * tag 'jh7100-for-5.17' of https://github.com/esmil/linux: RISC-V: Add BeagleV Starlight Beta device tree RISC-V: Add initial StarFive JH7100 device tree serial: 8250_dw: Add StarFive JH7100 quirk dt-bindings: serial: snps-dw-apb-uart: Add JH7100 uarts pinctrl: starfive: Add pinctrl driver for StarFive SoCs dt-bindings: pinctrl: Add StarFive JH7100 bindings dt-bindings: pinctrl: Add StarFive pinctrl definitions reset: starfive-jh7100: Add StarFive JH7100 reset driver dt-bindings: reset: Add Starfive JH7100 reset bindings dt-bindings: reset: Add StarFive JH7100 reset definitions clk: starfive: Add JH7100 clock generator driver dt-bindings: clock: starfive: Add JH7100 bindings dt-bindings: clock: starfive: Add JH7100 clock definitions dt-bindings: interrupt-controller: Add StarFive JH7100 plic dt-bindings: timer: Add StarFive JH7100 clint RISC-V: Add StarFive SoC Kconfig option Link: https://lore.kernel.org/r/20211216164205.286138-1-kernel@esmil.dk Signed-off-by: Arnd Bergmann commit 79ca243d83415c8f43e1c071b744fd8db8c1ccc1 Author: Lars-Peter Clausen Date: Thu Dec 9 17:17:30 2021 +0100 iio: vz89x: Remove unnecessary cast The case to u8 * is unnecessary here since the expression is already of type u8 *. Signed-off-by: Lars-Peter Clausen Signed-off-by: Jonathan Cameron commit 52c65f5b095782abb1accbacfe6f6962a583fe05 Author: Lars-Peter Clausen Date: Thu Dec 9 17:17:29 2021 +0100 iio: in2xx-adc: Remove unnecessary cast `buf` is cast to a const char *, but `buf` is already a const char *, so the case is unnecessary. Signed-off-by: Lars-Peter Clausen Signed-off-by: Jonathan Cameron commit 91b49aadbabf6860a8dae45df7aa982ca058b203 Author: Lars-Peter Clausen Date: Thu Dec 9 17:17:28 2021 +0100 iio: as3935: Remove unnecessary cast `buf` is cast to a const char *, but `buf` is already a const char *, so the case is unnecessary. Signed-off-by: Lars-Peter Clausen Signed-off-by: Jonathan Cameron commit a43676272a6e0b398781bc5337ca4cc187ba923d Author: Emil Renner Berthing Date: Sun Oct 10 19:48:36 2021 +0200 RISC-V: Add BeagleV Starlight Beta device tree Add initial device tree for the BeagleV Starlight Beta board. About 300 of these boards were sent out as part of a now cancelled BeagleBoard.org project. I2C timing data is based on the device tree in the vendor u-boot port. Heartbeat LED added by Geert. Acked-by: Palmer Dabbelt Co-developed-by: Geert Uytterhoeven Signed-off-by: Geert Uytterhoeven Signed-off-by: Emil Renner Berthing commit ec85362fb121d0297b9f3bb56816ea6282c34fda Author: Emil Renner Berthing Date: Sun Oct 10 16:48:27 2021 +0200 RISC-V: Add initial StarFive JH7100 device tree Add initial device tree for the JH7100 RISC-V SoC by StarFive Ltd. This is a test chip for their upcoming JH7110 SoC. The CPU and cache data is based on the device tree in the vendor u-boot port. Acked-by: Palmer Dabbelt Signed-off-by: Emil Renner Berthing commit b0ad20a3b64bf653a717860819691b262c0b2a2b Author: Emil Renner Berthing Date: Mon Oct 4 19:40:29 2021 +0200 serial: 8250_dw: Add StarFive JH7100 quirk On the StarFive JH7100 RISC-V SoC the UART core clocks can't be set to exactly 16 * 115200Hz and many other common bitrates. Trying this will only result in a higher input clock, but low enough that the UART's internal divisor can't come close enough to the baud rate target. So rather than try to set the input clock it's better to skip the clk_set_rate call and rely solely on the UART's internal divisor. Reviewed-by: Andy Shevchenko Reviewed-by: Geert Uytterhoeven Signed-off-by: Emil Renner Berthing commit d0b65b1500973fef840dbc4bb9f9c237db2b761f Author: Emil Renner Berthing Date: Thu Oct 7 14:24:29 2021 +0200 dt-bindings: serial: snps-dw-apb-uart: Add JH7100 uarts Add compatibles for the StarFive JH7100 uarts. Reviewed-by: Geert Uytterhoeven Acked-by: Rob Herring Signed-off-by: Emil Renner Berthing commit ec648f6b7686b716424e8e73eebb4c11ae199187 Author: Emil Renner Berthing Date: Tue Jul 6 20:19:06 2021 +0200 pinctrl: starfive: Add pinctrl driver for StarFive SoCs Add a combined pinctrl and GPIO driver for the JH7100 RISC-V SoC by StarFive Ltd. This is a test chip for their upcoming JH7110 SoC, which is said to feature only minor changes to these pinctrl/GPIO parts. For each "GPIO" there are two registers for configuring the output and output enable signals which may come from other peripherals. Among these are two special signals that are constant 0 and constant 1 respectively. Controlling the GPIOs from software is done by choosing one of these signals. In other words the same registers are used for both pin muxing and controlling the GPIOs, which makes it easier to combine the pinctrl and GPIO driver in one. I wrote the pinconf and pinmux parts, but the GPIO part of the code is based on the GPIO driver in the vendor tree written by Huan Feng with cleanups and fixes by Drew and me. Datasheet: https://github.com/starfive-tech/JH7100_Docs/blob/main/JH7100%20Data%20Sheet%20V01.01.04-EN%20(4-21-2021).pdf Reviewed-by: Andy Shevchenko Reviewed-by: Linus Walleij Co-developed-by: Huan Feng Signed-off-by: Huan Feng Co-developed-by: Drew Fustini Signed-off-by: Drew Fustini Signed-off-by: Emil Renner Berthing commit 7431b391df95f5b8d08fd0f9fa1a75cc038ee290 Author: Emil Renner Berthing Date: Tue Jul 27 14:34:33 2021 +0200 dt-bindings: pinctrl: Add StarFive JH7100 bindings Add bindings for the GPIO/pin controller on the JH7100 RISC-V SoC by StarFive Ltd. This is a test chip for their upcoming JH7110 SoC. Reviewed-by: Linus Walleij Reviewed-by: Rob Herring Signed-off-by: Emil Renner Berthing commit 3021114b3d172cf80c074c81425741f9e26c6679 Author: Emil Renner Berthing Date: Tue Jul 6 20:19:06 2021 +0200 dt-bindings: pinctrl: Add StarFive pinctrl definitions Add definitons for pins and GPIO input, output and output enable signals on the StarFive JH7100 SoC. Acked-by: Rob Herring Signed-off-by: Emil Renner Berthing commit 0be3a1595bf8c7f39153be02c9aae61dd2108576 Author: Emil Renner Berthing Date: Sun Sep 19 14:21:05 2021 +0200 reset: starfive-jh7100: Add StarFive JH7100 reset driver Add a driver for the StarFive JH7100 reset controller. Reviewed-by: Andy Shevchenko Signed-off-by: Emil Renner Berthing commit d7d456a5201d2e707318bbdc4fb69a3407eed29e Author: Emil Renner Berthing Date: Sun Sep 19 14:34:34 2021 +0200 dt-bindings: reset: Add Starfive JH7100 reset bindings Add bindings for the reset controller on the JH7100 RISC-V SoC by StarFive Ltd. This is a test chip for their upcoming JH7110 SoC. Reviewed-by: Geert Uytterhoeven Reviewed-by: Rob Herring Signed-off-by: Emil Renner Berthing commit 810e287e83b69ff8563bde15cae9120c802ac5d7 Author: Geert Uytterhoeven Date: Fri Jun 25 11:30:00 2021 +0200 dt-bindings: reset: Add StarFive JH7100 reset definitions Add all resets for the StarFive JH7100 reset controller. Based on work by Ahmad Fatoum for Barebox, with "JH7100_" prefixes added to all definitions. Acked-by: Rob Herring Signed-off-by: Geert Uytterhoeven Signed-off-by: Emil Renner Berthing commit 4210be668a09ee20e4e1c7adf61b47d33d05c480 Author: Geert Uytterhoeven Date: Tue Jun 1 15:57:52 2021 +0200 clk: starfive: Add JH7100 clock generator driver Add a driver for the StarFive JH7100 clock generator. Reviewed-by: Andy Shevchenko Acked-by: Stephen Boyd Signed-off-by: Geert Uytterhoeven Co-developed-by: Emil Renner Berthing Signed-off-by: Emil Renner Berthing commit af35098f4fcd1f9bfc58dc37479e0786a4d85e96 Author: Geert Uytterhoeven Date: Tue Jun 1 16:02:23 2021 +0200 dt-bindings: clock: starfive: Add JH7100 bindings Add bindings for the clock generator on the JH7100 RISC-V SoC by StarFive Ltd. This is a test chip for their upcoming JH7110 SoC. Reviewed-by: Rob Herring Acked-by: Stephen Boyd Signed-off-by: Geert Uytterhoeven Signed-off-by: Emil Renner Berthing commit 38bb8a7264daf0ff5bb3024ae94bc465de78203d Author: Geert Uytterhoeven Date: Fri Jun 25 11:29:51 2021 +0200 dt-bindings: clock: starfive: Add JH7100 clock definitions Add all clock outputs for the StarFive JH7100 clock generator. Based on work by Ahmad Fatoum for Barebox, with "JH7100_" prefixes added to all definitions. Acked-by: Rob Herring Acked-by: Stephen Boyd Signed-off-by: Geert Uytterhoeven Signed-off-by: Emil Renner Berthing commit 9ca9a608a787f0f67adea8757fad86d6632c6232 Author: Stefan Agner Date: Thu Jul 26 17:40:25 2018 +0200 ARM: tegra: Add back gpio-ranges properties The properties have been commented out to prevent a regression a while ago. The first regression should be resolved by commit 44af7927316e ("spi: Map SPI OF client IRQ at probe time"). The second regression is probably addressed by commit 494fd7b7ad10 ("PM / core: fix deferred probe breaking suspend resume order") and/or maybe others. Readd the gpio-ranges properties to see whether regressions still get reported. This reverts commit 4f1d841475e1 ("ARM: tegra: Comment out gpio-ranges properties"). Signed-off-by: Stefan Agner Reviewed-by: Dmitry Osipenko Tested-by: Dmitry Osipenko [treding@nvidia.com: drop redundant gpio-ranges from Ouya DTS file] Signed-off-by: Thierry Reding commit 919be27fd0046ed2554f1ff9cbd49d3798446cb5 Author: Dmitry Osipenko Date: Sat Dec 4 17:37:25 2021 +0300 ARM: tegra: paz00: Enable S/PDIF and HDMI audio Enable S/PDIF controller to enable HDMI audio support on Toshiba AC100. Use nvidia,fixed-parent-rate property that prevents audio rate conflict between S/PDIF and I2S. Tested-by: Agneli Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 7a53acabf80fc7b3462c52da4eb04daa213c7619 Author: Dmitry Osipenko Date: Sat Dec 4 17:37:24 2021 +0300 ARM: tegra: acer-a500: Enable S/PDIF and HDMI audio Enable S/PDIF controller to enable HDMI audio support on Acer A500. Use nvidia,fixed-parent-rate property that prevents audio rate conflict between S/PDIF and I2S. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit dd2cac867a786cb13821f98afd6730761ebc0773 Author: Dmitry Osipenko Date: Sat Dec 4 17:37:23 2021 +0300 ARM: tegra: Add HDMI audio graph to Tegra20 device-tree Add HDMI audio graph to Tegra20 device-tree to enable HDMI audio on Tegra20 devices. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit dcbc40848de4f07a0c92a348a57d078e881292c9 Author: Dmitry Osipenko Date: Sat Dec 4 17:37:22 2021 +0300 ARM: tegra: Add S/PDIF node to Tegra20 device-tree Add S/PDIF node to Tegra20 device-tree. It's needed for enabling HDMI audio support. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 279e7aa30424ea900d34ef3a540e2f26a930353d Author: Dmitry Osipenko Date: Wed Dec 1 02:23:47 2021 +0300 ARM: tegra20/30: Disable unused host1x hardware MPE, VI, EPP and ISP were never used and we don't have drivers for them. Since these modules are enabled by default in a device-tree, a device is created for them, blocking voltage scaling because there is no driver to bind, and thus, state of PMC driver is never synced. Disable them. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 2c16be669291b7be4df37066acc331615f747182 Author: Dmitry Osipenko Date: Wed Dec 1 02:23:46 2021 +0300 ARM: tegra: Add Memory Client resets to Tegra30 GR2D, GR3D and Host1x Memory access must be blocked before hardware reset is asserted and before power is gated, otherwise a serious hardware fault is inevitable. Add reset for memory clients to the GR2D, GR3D and Host1x nodes. Tested-by: Peter Geis # Ouya T30 Tested-by: Matt Merhar # Ouya T30 Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 1caf3ef4c0febbfe3180da3a57e53ebfa4a0fa3b Author: Dmitry Osipenko Date: Wed Dec 1 02:23:45 2021 +0300 ARM: tegra: Add Memory Client resets to Tegra20 GR2D, GR3D and Host1x Memory access must be blocked before hardware reset is asserted and before power is gated, otherwise a serious hardware fault is inevitable. Add reset for memory clients to the GR2D, GR3D and Host1x nodes. Tested-by: Paul Fertser # PAZ00 T20 Tested-by: Nicolas Chauvet # PAZ00 T20 Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 73e2b72a3518fb60b6a1c11286715f933bafdec2 Author: Dmitry Osipenko Date: Wed Dec 1 02:23:44 2021 +0300 ARM: tegra: Add OPP tables and power domains to Tegra30 device-trees Add OPP tables and power domains to all peripheral devices which support power management on Tegra30 SoC. Tested-by: Peter Geis # Ouya T30 Tested-by: Matt Merhar # Ouya T30 Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 6de481e5ab0d69cddbc7c20e8471a950313d4e07 Author: Thierry Reding Date: Mon Dec 13 17:21:51 2021 +0100 arm64: tegra: Hook up MMC and BPMP to memory controller Use the interconnects property to hook up the MMC and BPMP to the memory controller. This is needed to set the correct bus-level DMA mask, which is a prerequisite for adding IOMMU support. Signed-off-by: Thierry Reding commit eed280dfe91d84d6b9ad62e47d1b69aa8d9b4db2 Author: Thierry Reding Date: Mon Dec 13 17:21:50 2021 +0100 arm64: tegra: Add memory controller on Tegra234 This adds the memory controller and the embedded external memory controller found on the Tegra234 SoC. Signed-off-by: Thierry Reding commit cc9396676c1bc4414fa62514daadfece55ef3cfb Author: Thierry Reding Date: Mon Dec 13 17:21:49 2021 +0100 arm64: tegra: Add EMC general interrupt on Tegra194 Add the missing EMC general interrupt for the external memory controller on Tegra194. Signed-off-by: Thierry Reding commit c2fee44399af4fda2dd8070cfb96cd6de2385442 Author: Prathamesh Shete Date: Thu Dec 16 15:16:10 2021 +0530 arm64: tegra: Update SDMMC4 speeds for Tegra194 Add required device-tree properties to populate all speed modes supported by SDMMC4 instance of Tegra194 SDHCI controller. Signed-off-by: Prathamesh Shete Signed-off-by: Thierry Reding commit a52280c844c0549b16418dc7e70bdf46a66072eb Author: Jon Hunter Date: Mon Oct 25 12:08:42 2021 +0100 arm64: tegra: Add dma-coherent for Tegra194 VIC DMA operations for the Tegra194 Video Image Compositor (VIC) are coherent and so populate the 'dma-coherent' property. Signed-off-by: Jon Hunter Signed-off-by: Thierry Reding commit 553f07360e23b2e17b26be2fcd9ebfc0c14d0e24 Author: Thierry Reding Date: Wed Dec 8 16:29:11 2021 +0100 arm64: tegra: Rename Ethernet PHY nodes Name the Ethernet PHY device tree nodes as expected by the DT schema. Signed-off-by: Thierry Reding commit 02752947367289e8bfd0f09f9c4a5acfb0ac3602 Author: Thierry Reding Date: Tue Dec 7 15:06:19 2021 +0100 arm64: tegra: Remove unused only-1-8-v properties The only-1-8-v property is not support by an DT schema, so drop it. Signed-off-by: Thierry Reding commit f2ef6a9180f38f7b6f633a90126d27e8a669a688 Author: Thierry Reding Date: Tue Dec 7 15:05:32 2021 +0100 arm64: tegra: Sort Tegra210 XUSB clocks correctly Make the order of the clocks and clock-names properties match the order in the device tree bindings. This isn't strictly necessary from a point of view of the operating system because matching will be done based on the clock-names, but it makes it easier to validate the device trees against the DT schema. Signed-off-by: Thierry Reding commit 28a44b900e572ecb163cc4e042365b7df6e0fad3 Author: Thierry Reding Date: Tue Dec 7 15:01:37 2021 +0100 arm64: tegra: Add missing TSEC properties on Tegra210 Add missing interrupts, clocks, clock-names, reset and reset-names properties for the TSEC blocks found on Tegra210. Signed-off-by: Thierry Reding commit 9c1b3ef8e204ca952d0304d4b92fa54de8b9815a Author: Thierry Reding Date: Fri Mar 22 14:56:11 2019 +0100 arm64: tegra: jetson-nano: Remove extra PLL power supplies for PCIe and XUSB The XUSB pad controller handles the various PLL power supplies, so remove any references to them from the PCIe and XUSB controller device tree nodes. Signed-off-by: Thierry Reding commit 54215999f30bf7672c302b34c91db76eed525b5e Author: Thierry Reding Date: Fri Mar 22 14:43:03 2019 +0100 arm64: tegra: smaug: Remove extra PLL power supplies for XUSB The XUSB pad controller handles the various PLL power supplies, so remove any references to them from the XUSB controller device tree node. Signed-off-by: Thierry Reding commit 31bc882c03d447b7ae5c28ed5480467ee714fd91 Author: Thierry Reding Date: Fri Mar 22 14:41:53 2019 +0100 arm64: tegra: jetson-tx1: Remove extra PLL power supplies for PCIe and XUSB The XUSB pad controller handles the various PLL power supplies, so remove any references to them from the PCIe and XUSB controller device tree nodes. Signed-off-by: Thierry Reding commit 635fb5d4cb2590f3f655f05f880cefabf1cb43dd Author: Thierry Reding Date: Tue Dec 7 14:54:48 2021 +0100 arm64: tegra: Rename GPIO hog nodes to match schema GPIO hog nodes must have a "hog-" prefix or "-hog" suffix according to the DT schema. Rename all such nodes to allow validation to pass. Signed-off-by: Thierry Reding commit 1dcf00ae8205ee2fdbc0c55c41c486f287d20739 Author: Thierry Reding Date: Tue Dec 7 14:53:28 2021 +0100 arm64: tegra: Remove unsupported regulator properties Remove the unsupported "regulator-disable-ramp-delay" properties which ended up in various DTS files for some reason. Signed-off-by: Thierry Reding commit 99d9bde5b4ab05c98f6c2c5e8fb276d3b7072be3 Author: Thierry Reding Date: Tue Dec 7 14:51:54 2021 +0100 arm64: tegra: Rename TCU node to "serial" The TCU is basically a serial port (albeit a fancy one), so it should be named "serial". Signed-off-by: Thierry Reding commit c453cc9e9e1afbb3c3c2bc2579e4cc2c8ee7641c Author: Thierry Reding Date: Tue Dec 7 14:50:44 2021 +0100 arm64: tegra: Remove undocumented Tegra194 PCIe "core_m" clock The "core_m" clock is not documented in the Tegra194 PCIe device tree bindings, so remove it. Signed-off-by: Thierry Reding commit 1ff75059077c0d37edb936d9232f76a74704be41 Author: Thierry Reding Date: Tue Dec 7 14:47:47 2021 +0100 arm64: tegra: Drop unused properties for Tegra194 PCIe The num-viewport property is never used and can be dropped, whereas the "iommus" property is not needed since we use "iommu-map-mask" and "iommu-map" already. Signed-off-by: Thierry Reding commit cd6157c1978c84d4fd9b9cedc736fc7b5fce4d09 Author: Thierry Reding Date: Tue Dec 7 14:43:20 2021 +0100 arm64: tegra: Fix Tegra194 HSP compatible string The HSP instances on Tegra194 are not fully compatible with the version found on Tegra186, so drop the fallback compatible string from the list. Signed-off-by: Thierry Reding commit 2fcb87970e4282a227e09108d479e860b5b9faf0 Author: Thierry Reding Date: Tue Dec 7 14:40:59 2021 +0100 arm64: tegra: Drop unsupported nvidia,lpdr property The Tegra194 pinmux DT bindings do not define the nvidia,lpdr property, so drop them from the device trees that have listed them. Signed-off-by: Thierry Reding commit 56797e625910497ef2a2dd40b76be2633a86f726 Author: Thierry Reding Date: Tue Dec 7 14:39:20 2021 +0100 arm64: tegra: Use JEDEC vendor prefix for SPI NOR flash chips The standard "jedec," vendor prefix should be used for SPI NOR flash chips. This allows the right DT schema to be picked for validation. Signed-off-by: Thierry Reding commit e7445ab7dc5160540930912fae02660601b6de80 Author: Thierry Reding Date: Tue Dec 7 14:36:35 2021 +0100 arm64: tegra: Drop unit-address for audio card graph endpoints Audio graph endpoints don't have a "reg" property, so they shouldn't have a unit-address either. Signed-off-by: Thierry Reding commit 2b14cbd643feea5fc17c6e8bead4e71088c69acd Author: Thierry Reding Date: Tue Dec 7 14:28:29 2021 +0100 arm64: tegra: Adjust length of CCPLEX cluster MMIO region The Tegra186 CCPLEX cluster register region is 4 MiB is length, not 4 MiB - 1. This was likely presumed to be the "limit" rather than length. Fix it up. Signed-off-by: Thierry Reding commit 548c9c5aaf85bb157b1a87fdc558e3767f5f0bde Author: Thierry Reding Date: Tue Dec 7 14:27:11 2021 +0100 arm64: tegra: Fix Tegra186 compatible string list The I2C controller found on Tegra186 is not fully compatible with the Tegra210 version, so drop the fallback compatible string from the list. Signed-off-by: Thierry Reding commit 4b5ae31fb75655d6270a160a3ebafc48474f597d Author: Thierry Reding Date: Tue Dec 7 14:25:50 2021 +0100 arm64: tegra: Rename power-monitor input nodes Child nodes of the TI INA3221 power monitor device tree node should be called input@* according to the DT schema. Signed-off-by: Thierry Reding commit fe57ff5365c9aef12e80ee51e38d0ea6bb17b255 Author: Thierry Reding Date: Tue Dec 7 14:24:20 2021 +0100 arm64: tegra: Rename thermal zones nodes The DT schema requires that nodes representing thermal zones include a "-thermal" suffix in their name. Signed-off-by: Thierry Reding commit fce5d0731616549b9fc2c992b5896f7717fffdd4 Author: Thierry Reding Date: Tue Dec 7 14:21:18 2021 +0100 arm64: tegra: Sort Tegra132 XUSB clocks correctly Make the order of the clocks and clock-names properties match the order in the device tree bindings. This isn't strictly necessary from a point of view of the operating system because matching will be done based on the clock-names, but it makes it easier to validate the device trees against the DT schema. Signed-off-by: Thierry Reding commit 9f27a6c421163541bc3354b573283e50f24a7c95 Author: Thierry Reding Date: Tue Dec 7 14:20:25 2021 +0100 arm64: tegra: Drop unused AHCI clocks on Tegra132 The CML1 and PLL_E clocks are never explicitly used by the AHCI controller found on Tegra132, so drop them from the corresponding device tree node. Signed-off-by: Thierry Reding commit 92564257d7af8959eb1d5ba7ead6881c931e8bc3 Author: Thierry Reding Date: Tue Dec 7 14:19:26 2021 +0100 arm64: tegra: Fix Tegra132 I2C compatible string list The I2C controller found on Tegra124 is not fully compatible with the Tegra114 version, so drop the fallback compatible string from the list. Signed-off-by: Thierry Reding commit ed9e9a6eb118daa25c0dc04fd5fae55bf8a5356a Author: Thierry Reding Date: Tue Dec 7 14:17:07 2021 +0100 arm64: tegra: Add OPP tables on Tegra132 Add peripheral OPP tables on Tegra132 and wire them up to ACTMON and the EMC. While at it, add the missing "#interconnect-cells" properties to the memory controller and external memory controller nodes. Also set the "#reset-cells" property for the memory controller because it exports the hotflush reset controls. Signed-off-by: Thierry Reding commit bb43b219c88c4d1fe7154af787024b885edd45f8 Author: Thierry Reding Date: Tue Dec 7 14:13:37 2021 +0100 arm64: tegra: Fix compatible string for Tegra132 timer The TKE (time-keeping engine) found on Tegra132 is not backwards compatible with the version found on Tegra20, so update the compatible string list accordingly. Signed-off-by: Thierry Reding commit 64b407827670f9bd5fe08a4ed10732349339c572 Author: Thierry Reding Date: Tue Dec 7 14:11:53 2021 +0100 arm64: tegra: Remove unsupported properties on Norrin The Tegra PMC device tree bindings don't support the "#wake-cells" and "nvidia,reset-gpio" properties, so remove them. Signed-off-by: Thierry Reding commit 2c6fd24dcbf0a8cfb066ca886579a4a8b2275054 Author: Thierry Reding Date: Tue Dec 7 14:10:00 2021 +0100 arm64: tegra: Fix unit-addresses on Norrin The AS3722 pinmux device tree node doesn't have a "reg" property and therefore must not have a unit-address, so drop it. While at it, add missing unit-addresses for the charger and smart battery IC's on the ChromeOS embedded controller's I2C tunnel bus. Signed-off-by: Thierry Reding commit bd1fefcbdd8f1791c9a0e8dd169006c2a466cf17 Author: Thierry Reding Date: Thu Mar 19 16:45:38 2020 +0100 arm64: tegra: Add native timer support on Tegra186 The native timers IP block found on NVIDIA Tegra SoCs implements a watchdog timer that can be used to recover from system hangs. Add the device tree node on Tegra186. Signed-off-by: Thierry Reding commit 097e01c61015e41975873a1e51e3106456aa581a Author: Thierry Reding Date: Mon Dec 6 18:02:18 2021 +0100 arm64: tegra: Rename top-level regulators Regulators defined at the top level in device tree are no longer part of a simple bus and therefore don't have a reg property. Nodes without a reg property shouldn't have a unit-address either, so drop the unit address from the node names. To ensure nodes aren't duplicated (in which case they would end up merged in the final DTB), append the name of the regulator to the node name. Signed-off-by: Thierry Reding commit 4cc3e3e164c02c6f2fce38f2098a1fe1256ea58d Author: Thierry Reding Date: Mon Dec 6 17:58:55 2021 +0100 arm64: tegra: Rename top-level clocks Clocks defined at the top level in device tree are no longer part of a simple bus and therefore don't have a reg property. Nodes without a reg property shouldn't have a unit-address either, so drop the unit address from the node names. To ensure nodes aren't duplicated (in which case they would end up merged in the final DTB), append the name of the clock to the node name. Signed-off-by: Thierry Reding commit e762232f946679b6be60244d78079aa12cc5ed68 Author: Jon Hunter Date: Wed Dec 1 15:57:16 2021 +0000 arm64: tegra: Add ISO SMMU controller for Tegra194 The display controllers are attached to a separate ARM SMMU instance that is dedicated to servicing isochronous memory clients. Add this ISO instance of the ARM SMMU to device tree. Please note that the display controllers are not hooked up to this SMMU yet, because we are still missing a means to transition framebuffers used by the bootloader to the kernel. This based upon an initial patch by Thierry Reding . Signed-off-by: Jon Hunter Signed-off-by: Thierry Reding commit f7eb2785728442cc349a68965bc3c9a869274336 Author: Jon Hunter Date: Wed Nov 17 09:56:08 2021 +0000 arm64: tegra: Add NVENC and NVJPG nodes for Tegra186 and Tegra194 Populate the device-tree nodes for NVENC and NVJPG Host1x engines on Tegra186 and Tegra194. Signed-off-by: Jon Hunter Signed-off-by: Thierry Reding commit ff21087e6131e7d81c17d5b34bd786866ca90553 Author: Prathamesh Shete Date: Tue Nov 16 17:32:36 2021 +0530 arm64: tegra: Add support to enumerate SD in UHS mode Add support to enumerate SD in UHS mode on Tegra194. Add required device-tree properties in SDMMC1 and SDMMC3 instances to enable dynamic pad voltage switching and enumerate SD card in UHS-I modes. Signed-off-by: Prathamesh Shete Signed-off-by: Thierry Reding commit 533337d5c843650043771503221774f3dffbead0 Author: Mikko Perttunen Date: Fri Nov 12 13:35:42 2021 +0100 arm64: tegra: Add NVIDIA Jetson AGX Orin Developer Kit support The Jetson AGX Orin Developer Kit is a continuation of the Jetson Developer Kit line using the new NVIDIA Tegra234 (Orin) SoC. Signed-off-by: Mikko Perttunen Signed-off-by: Thierry Reding commit a12cf5c339b082a93767b3fa5c85059b8269ab45 Author: Thierry Reding Date: Fri Nov 12 14:19:04 2021 +0100 arm64: tegra: Describe Tegra234 CPU hierarchy The NVIDIA Tegra234 SoC has 3 clusters of 4 Cortex-A78AE CPU cores each, for a total of 12 CPUs. Each CPU has 64 KiB instruction and data caches with each cluster having an additional 256 KiB unified L2 cache and a 2 MiB L3 cache. Signed-off-by: Thierry Reding commit f0e1266818f58ab5e687b3aec53d0689c7dc7db0 Author: Thierry Reding Date: Fri Dec 10 17:02:05 2021 +0100 arm64: tegra: Add main and AON GPIO controllers on Tegra234 These two controllers expose general purpose I/O pins that can be used to control or monitor a variety of signals. Signed-off-by: Thierry Reding commit 06ad2ec4e5f84030ce6554d3859d6c21849bd5a3 Author: Mikko Perttunen Date: Fri Nov 12 13:35:41 2021 +0100 arm64: tegra: Add Tegra234 TCU device Add a device for TCU (Tegra Combined UART) used for serial console. Signed-off-by: Mikko Perttunen Signed-off-by: Thierry Reding commit e086d82d4f3e867a02a4ef4c245fc4f506173bbb Author: Mikko Perttunen Date: Fri Nov 12 13:35:40 2021 +0100 arm64: tegra: Fill in properties for Tegra234 eMMC Add missing properties to the eMMC controller, as required to use it on actual hardware. Signed-off-by: Mikko Perttunen Signed-off-by: Thierry Reding commit 98094be152d34f8014ca67fbdc210e5261c4b09d Author: Mikko Perttunen Date: Fri Nov 12 13:35:39 2021 +0100 arm64: tegra: Update Tegra234 BPMP channel addresses On final Tegra234 systems, shared memory for communication with BPMP is located at offset 0x70000 in SYSRAM. Signed-off-by: Mikko Perttunen Signed-off-by: Thierry Reding commit e537adde131bd4cf426e6d77f99060ca302e2f08 Author: Mikko Perttunen Date: Fri Nov 12 13:35:38 2021 +0100 arm64: tegra: Add clock for Tegra234 RTC The RTC device requires a clock. Add it. Signed-off-by: Mikko Perttunen Signed-off-by: Thierry Reding commit 7fa307524a4d721d4a04523018509882c5414e72 Author: Thierry Reding Date: Fri Nov 12 13:35:37 2021 +0100 arm64: tegra: Fixup SYSRAM references The json-schema bindings for SRAM expect the nodes to be called "sram" rather than "sysram" or "shmem". Furthermore, place the brackets around the SYSRAM references such that a two-element array is created rather than a two-element array nested in a single-element array. This is not relevant for device tree itself, but allows the nodes to be properly validated against json-schema bindings. Signed-off-by: Thierry Reding commit d9652f589edc6744e6f7aafb4447f3a6cd8ebb69 Merge: fa55b7dcdc43c c3859c1436e31 Author: Thierry Reding Date: Thu Dec 16 16:50:49 2021 +0100 Merge tag 'tegra-for-5.17-dt-bindings-memory' into for-5.17/arm64/dt dt-bindings: memory: Add Tegra234 support This stable tag contains the addition of the EMC clock ID and an initial list of memory client IDs for Tegra234 and will be shared between the memory and ARM SoC trees. commit 3c67d44de787dff288d7f2a51c372b22f7356db6 Author: Jens Axboe Date: Fri Dec 3 06:48:53 2021 -0700 block: add mq_ops->queue_rqs hook If we have a list of requests in our plug list, send it to the driver in one go, if possible. The driver must set mq_ops->queue_rqs() to support this, if not the usual one-by-one path is used. Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 51a0f370886a76b4b7bd39ca9bf917a571068aac Author: Thierry Reding Date: Fri Nov 19 15:38:24 2021 +0100 dt-bindings: misc: Convert Tegra MISC to json-schema Convert the device tree bindings for the MISC register block found on NVIDIA Tegra SoCs from plain text to json-schema format. Reviewed-by: Rob Herring Signed-off-by: Thierry Reding commit c3859c1436e31461f27365ec6fc751c9bbeff3e2 Author: Thierry Reding Date: Mon Dec 13 17:21:47 2021 +0100 dt-bindings: memory: tegra: Add Tegra234 support Document the variant of the memory controller and external memory controllers found on Tegra234 and add some memory client and SMMU stream ID definitions for use in device tree files. Reviewed-by: Rob Herring Signed-off-by: Thierry Reding Reviewed-by: Krzysztof Kozlowski Signed-off-by: Thierry Reding commit 57978838889d74ad3139cdf76ca2622e625f41e6 Author: Jon Hunter Date: Wed Nov 17 09:56:07 2021 +0000 dt-bindings: Add YAML bindings for NVENC and NVJPG Add YAML device tree bindings for the Tegra NVENC and NVJPG Host1x engines. Signed-off-by: Jon Hunter Reviewed-by: Rob Herring Signed-off-by: Thierry Reding commit 8c970e7ee7ae9c41aa2432f234c7b382391200f2 Author: Thierry Reding Date: Mon Dec 13 17:21:46 2021 +0100 dt-bindings: memory: tegra: Update for Tegra194 The #interconnect-cells properties are required to hook up memory clients to the MC/EMC in interconnects properties. Add a description for these properties. For the nested EMC controller, the list of required properties was missing. Add it so that the validation can be more strict. Also, allow multiple reg entries required by Tegra194 and later. While at it, also remove the dummy BPMP node from the example because it is incomplete and fails validation. It's also not necessary for this file and the BPMP DT schema already has a full example. Signed-off-by: Thierry Reding Reviewed-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Signed-off-by: Thierry Reding commit d9203d081a618fc8b3469b24f959495eaa138890 Author: Thierry Reding Date: Fri Nov 12 13:35:35 2021 +0100 dt-bindings: sram: Document NVIDIA Tegra SYSRAM Tegra SoCs have extra on-chip RAM that can be used for inter-processor communication. Tegra186 and later make use of it to establish a two-way channel between the CCPLEX and BPMP. Add missing compatible strings for Tegra186 and Tegra194 as well as a new compatible string for Tegra234. Reviewed-by: Rob Herring Signed-off-by: Thierry Reding commit fc5e0e37621973758e7e49dd85f28673e72e4b85 Author: Mikko Perttunen Date: Fri Nov 12 13:35:34 2021 +0100 dt-bindings: Update headers for Tegra234 Add a few more clocks that will be used in follow-up patches to enable more functionality on Tegra234. Signed-off-by: Mikko Perttunen Reviewed-by: Rob Herring Signed-off-by: Thierry Reding commit b39cc79565771f7e9ffd262d3b735cbe1c718f66 Author: Thierry Reding Date: Fri Nov 12 13:35:33 2021 +0100 dt-bindings: tegra: Document Jetson AGX Orin (and devkit) Add the compatible strings for the Jetson AGX Orin and the corresponding developer kit. Reviewed-by: Rob Herring Signed-off-by: Thierry Reding commit d875175d87268cbd6fa8a6ccfaeba6d9991527f0 Author: Thierry Reding Date: Fri Nov 12 13:35:32 2021 +0100 dt-bindings: tegra: Describe recent developer kits consistently Add descriptions to entries that were missing one and don't try to combine multiple entries into one to avoid confusion. Reviewed-by: Rob Herring Signed-off-by: Thierry Reding commit fcade2ce06ffebee5c2f6629ddbf2086c0f5ba5a Author: Jens Axboe Date: Wed Dec 1 16:19:18 2021 -0700 block: use singly linked list for bio cache Pointless to maintain a head/tail for the list, as we never need to access the tail. Entries are always LIFO for cache hotness reasons. Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 5581a5ddfe8d0ede1749bae1f7662fa739f83813 Author: Jens Axboe Date: Wed Dec 1 15:01:51 2021 -0700 block: add completion handler for fast path The batched completions only deal with non-partial requests anyway, and it doesn't deal with any requests that have errors. Add a completion handler that assumes it's a full request and that it's all being ended successfully. Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe commit bebd87eea29ad0052ffee4611bc8e3da5aaa9d42 Author: Bryan O'Donoghue Date: Tue Dec 14 13:46:30 2021 +0000 wcn36xx: Implement beacon filtering The prima driver facilitates the direct programming of beacon filter tables via SMD commands. The purpose of beacon filters is quote: /* When beacon filtering is enabled, firmware will * analyze the selected beacons received during BMPS, * and monitor any changes in the IEs as listed below. * The format of the table is: * - EID * - Check for IE presence * - Byte offset * - Byte value * - Bit Mask * - Byte reference */ The default filter table looks something like this: tBeaconFilterIe gaBcnFilterTable[12] = { { WLAN_EID_DS_PARAMS, 0u, { 0u, 0u, 0u, 0u } }, { WLAN_EID_ERP_INFO, 0u, { 0u, 0u, 248u, 0u } }, { WLAN_EID_EDCA_PARAM_SET, 0u, { 0u, 0u, 240u, 0u } }, { WLAN_EID_QOS_CAPA, 0u, { 0u, 0u, 240u, 0u } }, { WLAN_EID_CHANNEL_SWITCH, 1u, { 0u, 0u, 0u, 0u } }, { WLAN_EID_QUIET, 1u, { 0u, 0u, 0u, 0u } }, { WLAN_EID_HT_OPERATION, 0u, { 0u, 0u, 0u, 0u } }, { WLAN_EID_HT_OPERATION, 0u, { 1u, 0u, 248u, 0u } }, { WLAN_EID_HT_OPERATION, 0u, { 2u, 0u, 235u, 0u } }, { WLAN_EID_HT_OPERATION, 0u, { 5u, 0u, 253u, 0u } }, { WLAN_EID_PWR_CONSTRAINT, 0u, { 0u, 0u, 0u, 0u } }, { WLAN_EID_OPMODE_NOTIF, 0u, { 0u, 0u, 0u, 0u } } }; Add in an equivalent filter set as present in the prima Linux driver. For now omit the beacon filter "rem" command as the driver does not have an explicit call to that SMD command. The filter mask should only count when we are inside BMPS anyway. Replicating the ability to program the filter table gives us scope to add and remove elements in future. For now though this patch makes the rote-copy of the downstream Linux beacon filter table, which we can tweak as desired from now on. Signed-off-by: Bryan O'Donoghue Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211214134630.2214840-4-bryan.odonoghue@linaro.org commit bc4e7f2432bbfe354da219e632e76c4f96023db5 Author: Bryan O'Donoghue Date: Tue Dec 14 13:46:29 2021 +0000 wcn36xx: Fix physical location of beacon filter comment The comment in the header with respect to beacon filtering makes a reference to "the structure above" and "the structure below" which would be informative if the comment appeared in the right place but, it does not. Fix the comment location so that it a least makes sense w/r/t the physical location statements. Signed-off-by: Bryan O'Donoghue Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211214134630.2214840-3-bryan.odonoghue@linaro.org commit 7effbf7af91e6708624d20bc4f969ef98d4f26f7 Author: Bryan O'Donoghue Date: Tue Dec 14 13:46:28 2021 +0000 wcn36xx: Fix beacon filter structure definitions The beacon filter structures need to be packed. Right now its fine because we don't yet use these structures so just pack them without marking it for backporting. Signed-off-by: Bryan O'Donoghue Reviewed-by: Loic Poulain Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211214134630.2214840-2-bryan.odonoghue@linaro.org commit 6ac04bdc5edb418787ab2040b1f922c23464c750 Author: Anilkumar Kolli Date: Tue Dec 14 17:39:43 2021 +0200 ath11k: Use reserved host DDR addresses from DT for PCI devices Host DDR memory (contiguous 45 MB in mode-0 or 15 MB in mode-2) is reserved through DT entries for firmware usage. Send the base address from DT entries. If DT entry is available, PCI device will work with fixed_mem_region else host allocates multiple segments. IPQ8074 on HK10 board supports multiple PCI devices. IPQ8074 + QCN9074 is tested with this patch. Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.4.0.1-01838-QCAHKSWPL_SILICONZ-1 Signed-off-by: Anilkumar Kolli Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1638789319-2950-2-git-send-email-akolli@codeaurora.org commit 77a0a30bb5070a12d48247681e5cc49bee04dfcc Author: Anilkumar Kolli Date: Tue Dec 14 17:39:43 2021 +0200 dt: bindings: add new DT entry for ath11k PCI device support Ath11k driver supports PCI devices such as QCN9074/QCA6390. Ath11k firmware uses host DDR memory, DT entry is used to reserve host DDR memory regions, send these memory base addresses using DT entries. Signed-off-by: Anilkumar Kolli Reviewed-by: Rob Herring Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1638789319-2950-1-git-send-email-akolli@codeaurora.org commit 79a7f77b9b154d572bd9d2f1eecf58c4d018d8e2 Author: Marc Zyngier Date: Thu Dec 16 14:32:27 2021 +0000 irqchip/gic-v4: Disable redistributors' view of the VPE table at boot time Jay Chen reported that using a kdump kernel on a GICv4.1 system results in a RAS error being delivered when the secondary kernel configures the ITS's view of the new VPE table. As it turns out, that's because each RD still has a pointer to the previous instance of the VPE table, and that particular implementation is very upset by seeing two bits of the HW that should point to the same table with different values. To solve this, let's invalidate any reference that any RD has to the VPE table when discovering the RDs. The ITS can then be programmed as expected. Reported-by: Jay Chen Signed-off-by: Marc Zyngier Cc: Lorenzo Pieralisi Link: https://lore.kernel.org/r/20211214064716.21407-1-jkchen@linux.alibaba.com Link: https://lore.kernel.org/r/20211216144804.1578566-1-maz@kernel.org commit 0859bbb07d06d1357734496ff198319f9bfcf1bf Author: Kees Cook Date: Wed Dec 15 15:24:57 2021 -0800 irqchip/ingenic-tcu: Use correctly sized arguments for bit field The find.h APIs are designed to be used only on unsigned long arguments. This can technically result in a over-read, but it is harmless in this case. Regardless, fix it to avoid the warning seen under -Warray-bounds, which we'd like to enable globally: In file included from ./include/linux/bitmap.h:9, from ./include/linux/cpumask.h:12, from ./include/linux/smp.h:13, from ./include/linux/lockdep.h:14, from ./include/linux/mutex.h:17, from ./include/linux/notifier.h:14, from ./include/linux/clk.h:14, from drivers/irqchip/irq-ingenic-tcu.c:7: drivers/irqchip/irq-ingenic-tcu.c: In function 'ingenic_tcu_intc_cascade': ./include/linux/find.h:40:23: warning: array subscript 'long unsigned int[0]' is partly outside array bounds of 'uint32_t[1]' {aka 'unsigned int[1]'} [-Warray-bounds] 40 | val = *addr & GENMASK(size - 1, offset); | ^~~~~ drivers/irqchip/irq-ingenic-tcu.c:30:18: note: while referencing 'irq_reg' 30 | uint32_t irq_reg, irq_mask; | ^~~~~~~ Signed-off-by: Kees Cook Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211215232457.2069969-1-keescook@chromium.org commit c10f2f8b5d8027c1ea77f777f2d16cb9043a6c09 Author: Xiang wangx Date: Thu Dec 9 21:24:53 2021 +0800 irqchip/gic-v2m: Add const to of_device_id struct of_device_id should normally be const. Signed-off-by: Xiang wangx Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211209132453.25623-1-wangxiang@cdjrlc.com commit 29e525cc825e33ea0da2ac0fbf951e418fc28c69 Author: Peng Fan Date: Tue Dec 14 16:47:11 2021 +0800 irqchip/imx-gpcv2: Mark imx_gpcv2_instance with __ro_after_init imx_gpcv2_instance will not be updated after init, so mark it with __ro_after_init. Signed-off-by: Peng Fan Reviewed-by: Lucas Stach Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211214084711.1357325-1-peng.fan@oss.nxp.com commit 0f473bb6ed2d0b8533a079ee133f625f83de5315 Merge: 604ba230902d2 66495f301c692 Author: Jakub Kicinski Date: Thu Dec 16 07:18:39 2021 -0800 Merge branch 'fib-merge-nl-policies' Florian Westphal says: ==================== fib: merge nl policies v4: resend with fixed subject line. I preserved review tags from David Ahern. v3: drop first two patches, otherwise unchanged. This series merges the different (largely identical) nla policies. v2 also squashed the ->suppress() implementation, I've dropped this. Problem is that it needs ugly ifdef'ry to avoid build breakage with CONFIG_INET=n || IPV6=n. Given that even microbenchmark doesn't show any noticeable improvement when ->suppress is inlined (it uses INDIRECT_CALLABLE) i decided to toss the patch instead of adding more ifdefs. ==================== Link: https://lore.kernel.org/r/20211216120507.3299-1-fw@strlen.de Signed-off-by: Jakub Kicinski commit 66495f301c69288a32b9d4bdb60c20ef42d90e6e Author: Florian Westphal Date: Thu Dec 16 13:05:07 2021 +0100 fib: expand fib_rule_policy Now that there is only one fib nla_policy there is no need to keep the macro around. Place it where its used. Signed-off-by: Florian Westphal Reviewed-by: David Ahern Signed-off-by: Jakub Kicinski commit 92e1bcee067f1722703bf61047ef674be1b6d1c0 Author: Florian Westphal Date: Thu Dec 16 13:05:06 2021 +0100 fib: rules: remove duplicated nla policies The attributes are identical in all implementations so move the ipv4 one into the core and remove the per-family nla policies. Signed-off-by: Florian Westphal Reviewed-by: David Ahern Signed-off-by: Jakub Kicinski commit 9c5c605219578b8167b649245e00d6407f2c18da Author: Namhyung Kim Date: Wed Dec 15 10:51:54 2021 -0800 perf ftrace: Implement cpu and task filters in BPF Honor cpu and task options to set up filters (by pid or tid) in the BPF program. For example, the following command will show latency of the mutex_lock for process 2570. # perf ftrace latency -b -T mutex_lock -p 2570 sleep 3 # DURATION | COUNT | GRAPH | 0 - 1 us | 675 | ############################## | 1 - 2 us | 9 | | 2 - 4 us | 0 | | 4 - 8 us | 0 | | 8 - 16 us | 0 | | 16 - 32 us | 0 | | 32 - 64 us | 0 | | 64 - 128 us | 0 | | 128 - 256 us | 0 | | 256 - 512 us | 0 | | 512 - 1024 us | 0 | | 1 - 2 ms | 0 | | 2 - 4 ms | 0 | | 4 - 8 ms | 0 | | 8 - 16 ms | 0 | | 16 - 32 ms | 0 | | 32 - 64 ms | 0 | | 64 - 128 ms | 0 | | 128 - 256 ms | 0 | | 256 - 512 ms | 0 | | 512 - 1024 ms | 0 | | 1 - ... s | 0 | | Committer testing: Looking at faults on a firefox process: # strace -e bpf perf ftrace latency -b -p 1674378 -T __handle_mm_fault bpf(BPF_PROG_LOAD, {prog_type=BPF_PROG_TYPE_SOCKET_FILTER, insn_cnt=2, insns=0x7ffee1fee740, license="GPL", log_level=0, log_size=0, log_buf=NULL, kern_version=KERNEL_VERSION(0, 0, 0), prog_flags=0, prog_name="", prog_ifindex=0, expected_attach_type=BPF_CGROUP_INET_INGRESS, prog_btf_fd=0, func_info_rec_size=0, func_info=NULL, func_info_cnt=0, line_info_rec_size=0, line_info=NULL, line_info_cnt=0, attach_btf_id=0, attach_prog_fd=0}, 128) = 3 bpf(BPF_BTF_LOAD, {btf="\237\353\1\0\30\0\0\0\0\0\0\0\20\0\0\0\20\0\0\0\5\0\0\0\1\0\0\0\0\0\0\1"..., btf_log_buf=NULL, btf_size=45, btf_log_size=0, btf_log_level=0}, 128) = 3 bpf(BPF_BTF_LOAD, {btf="\237\353\1\0\30\0\0\0\0\0\0\0000\0\0\0000\0\0\0\t\0\0\0\1\0\0\0\0\0\0\1"..., btf_log_buf=NULL, btf_size=81, btf_log_size=0, btf_log_level=0}, 128) = 3 bpf(BPF_BTF_LOAD, {btf="\237\353\1\0\30\0\0\0\0\0\0\08\0\0\08\0\0\0\t\0\0\0\0\0\0\0\0\0\0\1"..., btf_log_buf=NULL, btf_size=89, btf_log_size=0, btf_log_level=0}, 128) = 3 bpf(BPF_BTF_LOAD, {btf="\237\353\1\0\30\0\0\0\0\0\0\0\f\0\0\0\f\0\0\0\7\0\0\0\1\0\0\0\0\0\0\20"..., btf_log_buf=NULL, btf_size=43, btf_log_size=0, btf_log_level=0}, 128) = 3 bpf(BPF_BTF_LOAD, {btf="\237\353\1\0\30\0\0\0\0\0\0\0000\0\0\0000\0\0\0\t\0\0\0\1\0\0\0\0\0\0\1"..., btf_log_buf=NULL, btf_size=81, btf_log_size=0, btf_log_level=0}, 128) = 3 bpf(BPF_BTF_LOAD, {btf="\237\353\1\0\30\0\0\0\0\0\0\0000\0\0\0000\0\0\0\5\0\0\0\0\0\0\0\0\0\0\1"..., btf_log_buf=NULL, btf_size=77, btf_log_size=0, btf_log_level=0}, 128) = -1 EINVAL (Invalid argument) bpf(BPF_BTF_LOAD, {btf="\237\353\1\0\30\0\0\0\0\0\0\0 \3\0\0 \3\0\0\306\3\0\0\0\0\0\0\0\0\0\2"..., btf_log_buf=NULL, btf_size=1790, btf_log_size=0, btf_log_level=0}, 128) = 3 bpf(BPF_MAP_CREATE, {map_type=BPF_MAP_TYPE_ARRAY, key_size=4, value_size=32, max_entries=1, map_flags=0, inner_map_fd=0, map_name="", map_ifindex=0, btf_fd=0, btf_key_type_id=0, btf_value_type_id=0, btf_vmlinux_value_type_id=0}, 128) = 4 bpf(BPF_PROG_LOAD, {prog_type=BPF_PROG_TYPE_SOCKET_FILTER, insn_cnt=5, insns=0x7ffee1fee570, license="GPL", log_level=0, log_size=0, log_buf=NULL, kern_version=KERNEL_VERSION(0, 0, 0), prog_flags=0, prog_name="", prog_ifindex=0, expected_attach_type=BPF_CGROUP_INET_INGRESS, prog_btf_fd=0, func_info_rec_size=0, func_info=NULL, func_info_cnt=0, line_info_rec_size=0, line_info=NULL, line_info_cnt=0, attach_btf_id=0, attach_prog_fd=0}, 128) = 5 bpf(BPF_MAP_CREATE, {map_type=BPF_MAP_TYPE_ARRAY, key_size=4, value_size=4, max_entries=1, map_flags=BPF_F_MMAPABLE, inner_map_fd=0, map_name="", map_ifindex=0, btf_fd=0, btf_key_type_id=0, btf_value_type_id=0, btf_vmlinux_value_type_id=0}, 128) = 4 bpf(BPF_PROG_LOAD, {prog_type=BPF_PROG_TYPE_SOCKET_FILTER, insn_cnt=2, insns=0x7ffee1fee3c0, license="GPL", log_level=0, log_size=0, log_buf=NULL, kern_version=KERNEL_VERSION(0, 0, 0), prog_flags=0, prog_name="test", prog_ifindex=0, expected_attach_type=BPF_CGROUP_INET_INGRESS, prog_btf_fd=0, func_info_rec_size=0, func_info=NULL, func_info_cnt=0, line_info_rec_size=0, line_info=NULL, line_info_cnt=0, attach_btf_id=0, attach_prog_fd=0}, 128) = 4 bpf(BPF_MAP_CREATE, {map_type=BPF_MAP_TYPE_HASH, key_size=8, value_size=8, max_entries=10000, map_flags=0, inner_map_fd=0, map_name="functime", map_ifindex=0, btf_fd=3, btf_key_type_id=0, btf_value_type_id=0, btf_vmlinux_value_type_id=0}, 128) = 4 bpf(BPF_MAP_CREATE, {map_type=BPF_MAP_TYPE_HASH, key_size=4, value_size=1, max_entries=1, map_flags=0, inner_map_fd=0, map_name="cpu_filter", map_ifindex=0, btf_fd=3, btf_key_type_id=0, btf_value_type_id=0, btf_vmlinux_value_type_id=0}, 128) = 5 bpf(BPF_MAP_CREATE, {map_type=BPF_MAP_TYPE_HASH, key_size=4, value_size=1, max_entries=36, map_flags=0, inner_map_fd=0, map_name="task_filter", map_ifindex=0, btf_fd=3, btf_key_type_id=0, btf_value_type_id=0, btf_vmlinux_value_type_id=0}, 128) = 6 bpf(BPF_MAP_CREATE, {map_type=BPF_MAP_TYPE_PERCPU_ARRAY, key_size=4, value_size=8, max_entries=22, map_flags=0, inner_map_fd=0, map_name="latency", map_ifindex=0, btf_fd=3, btf_key_type_id=0, btf_value_type_id=0, btf_vmlinux_value_type_id=0}, 128) = 7 bpf(BPF_MAP_CREATE, {map_type=BPF_MAP_TYPE_ARRAY, key_size=4, value_size=12, max_entries=1, map_flags=BPF_F_MMAPABLE, inner_map_fd=0, map_name="func_lat.bss", map_ifindex=0, btf_fd=3, btf_key_type_id=0, btf_value_type_id=32, btf_vmlinux_value_type_id=0}, 128) = 8 bpf(BPF_MAP_UPDATE_ELEM, {map_fd=8, key=0x7ffee1fee580, value=0x7f01d940a000, flags=BPF_ANY}, 128) = 0 bpf(BPF_PROG_LOAD, {prog_type=BPF_PROG_TYPE_KPROBE, insn_cnt=42, insns=0x1871f30, license="", log_level=0, log_size=0, log_buf=NULL, kern_version=KERNEL_VERSION(5, 14, 16), prog_flags=0, prog_name="func_begin", prog_ifindex=0, expected_attach_type=BPF_CGROUP_INET_INGRESS, prog_btf_fd=3, func_info_rec_size=8, func_info=0x18746a0, func_info_cnt=1, line_info_rec_size=16, line_info=0x1874550, line_info_cnt=20, attach_btf_id=0, attach_prog_fd=0}, 128) = 9 bpf(BPF_PROG_LOAD, {prog_type=BPF_PROG_TYPE_KPROBE, insn_cnt=99, insns=0x18769b0, license="", log_level=0, log_size=0, log_buf=NULL, kern_version=KERNEL_VERSION(5, 14, 16), prog_flags=0, prog_name="func_end", prog_ifindex=0, expected_attach_type=BPF_CGROUP_INET_INGRESS, prog_btf_fd=3, func_info_rec_size=8, func_info=0x188a640, func_info_cnt=1, line_info_rec_size=16, line_info=0x188a660, line_info_cnt=20, attach_btf_id=0, attach_prog_fd=0}, 128) = 10 bpf(BPF_MAP_UPDATE_ELEM, {map_fd=6, key=0x7ffee1fee8e0, value=0x7ffee1fee8df, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_UPDATE_ELEM, {map_fd=6, key=0x7ffee1fee8e0, value=0x7ffee1fee8df, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_UPDATE_ELEM, {map_fd=6, key=0x7ffee1fee8e0, value=0x7ffee1fee8df, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_UPDATE_ELEM, {map_fd=6, key=0x7ffee1fee8e0, value=0x7ffee1fee8df, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_UPDATE_ELEM, {map_fd=6, key=0x7ffee1fee8e0, value=0x7ffee1fee8df, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_UPDATE_ELEM, {map_fd=6, key=0x7ffee1fee8e0, value=0x7ffee1fee8df, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_UPDATE_ELEM, {map_fd=6, key=0x7ffee1fee8e0, value=0x7ffee1fee8df, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_UPDATE_ELEM, {map_fd=6, key=0x7ffee1fee8e0, value=0x7ffee1fee8df, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_UPDATE_ELEM, {map_fd=6, key=0x7ffee1fee8e0, value=0x7ffee1fee8df, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_UPDATE_ELEM, {map_fd=6, key=0x7ffee1fee8e0, value=0x7ffee1fee8df, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_UPDATE_ELEM, {map_fd=6, key=0x7ffee1fee8e0, value=0x7ffee1fee8df, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_UPDATE_ELEM, {map_fd=6, key=0x7ffee1fee8e0, value=0x7ffee1fee8df, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_UPDATE_ELEM, {map_fd=6, key=0x7ffee1fee8e0, value=0x7ffee1fee8df, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_UPDATE_ELEM, {map_fd=6, key=0x7ffee1fee8e0, value=0x7ffee1fee8df, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_UPDATE_ELEM, {map_fd=6, key=0x7ffee1fee8e0, value=0x7ffee1fee8df, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_UPDATE_ELEM, {map_fd=6, key=0x7ffee1fee8e0, value=0x7ffee1fee8df, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_UPDATE_ELEM, {map_fd=6, key=0x7ffee1fee8e0, value=0x7ffee1fee8df, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_UPDATE_ELEM, {map_fd=6, key=0x7ffee1fee8e0, value=0x7ffee1fee8df, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_UPDATE_ELEM, {map_fd=6, key=0x7ffee1fee8e0, value=0x7ffee1fee8df, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_UPDATE_ELEM, {map_fd=6, key=0x7ffee1fee8e0, value=0x7ffee1fee8df, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_UPDATE_ELEM, {map_fd=6, key=0x7ffee1fee8e0, value=0x7ffee1fee8df, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_UPDATE_ELEM, {map_fd=6, key=0x7ffee1fee8e0, value=0x7ffee1fee8df, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_UPDATE_ELEM, {map_fd=6, key=0x7ffee1fee8e0, value=0x7ffee1fee8df, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_UPDATE_ELEM, {map_fd=6, key=0x7ffee1fee8e0, value=0x7ffee1fee8df, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_UPDATE_ELEM, {map_fd=6, key=0x7ffee1fee8e0, value=0x7ffee1fee8df, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_UPDATE_ELEM, {map_fd=6, key=0x7ffee1fee8e0, value=0x7ffee1fee8df, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_UPDATE_ELEM, {map_fd=6, key=0x7ffee1fee8e0, value=0x7ffee1fee8df, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_UPDATE_ELEM, {map_fd=6, key=0x7ffee1fee8e0, value=0x7ffee1fee8df, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_UPDATE_ELEM, {map_fd=6, key=0x7ffee1fee8e0, value=0x7ffee1fee8df, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_UPDATE_ELEM, {map_fd=6, key=0x7ffee1fee8e0, value=0x7ffee1fee8df, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_UPDATE_ELEM, {map_fd=6, key=0x7ffee1fee8e0, value=0x7ffee1fee8df, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_UPDATE_ELEM, {map_fd=6, key=0x7ffee1fee8e0, value=0x7ffee1fee8df, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_UPDATE_ELEM, {map_fd=6, key=0x7ffee1fee8e0, value=0x7ffee1fee8df, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_UPDATE_ELEM, {map_fd=6, key=0x7ffee1fee8e0, value=0x7ffee1fee8df, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_UPDATE_ELEM, {map_fd=6, key=0x7ffee1fee8e0, value=0x7ffee1fee8df, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_UPDATE_ELEM, {map_fd=6, key=0x7ffee1fee8e0, value=0x7ffee1fee8df, flags=BPF_ANY}, 128) = 0 bpf(BPF_PROG_LOAD, {prog_type=BPF_PROG_TYPE_TRACEPOINT, insn_cnt=2, insns=0x7ffee1fee3c0, license="GPL", log_level=0, log_size=0, log_buf=NULL, kern_version=KERNEL_VERSION(0, 0, 0), prog_flags=0, prog_name="", prog_ifindex=0, expected_attach_type=BPF_CGROUP_INET_INGRESS, prog_btf_fd=0, func_info_rec_size=0, func_info=NULL, func_info_cnt=0, line_info_rec_size=0, line_info=NULL, line_info_cnt=0, attach_btf_id=0, attach_prog_fd=0}, 128) = 12 bpf(BPF_LINK_CREATE, {link_create={prog_fd=12, target_fd=-1, attach_type=0x29 /* BPF_??? */, flags=0}}, 128) = -1 EINVAL (Invalid argument) ^Cstrace: Process 1702285 detached # DURATION | COUNT | GRAPH | 0 - 1 us | 109 | ################# | 1 - 2 us | 127 | ################### | 2 - 4 us | 36 | ##### | 4 - 8 us | 20 | ### | 8 - 16 us | 2 | | 16 - 32 us | 0 | | 32 - 64 us | 0 | | 64 - 128 us | 0 | | 128 - 256 us | 0 | | 256 - 512 us | 0 | | 512 - 1024 us | 0 | | 1 - 2 ms | 0 | | 2 - 4 ms | 0 | | 4 - 8 ms | 0 | | 8 - 16 ms | 0 | | 16 - 32 ms | 0 | | 32 - 64 ms | 0 | | 64 - 128 ms | 0 | | 128 - 256 ms | 0 | | 256 - 512 ms | 0 | | 512 - 1024 ms | 0 | | 1 - ... s | 0 | | # Signed-off-by: Namhyung Kim Tested-by: Arnaldo Carvalho de Melo Cc: Andi Kleen Cc: Athira Jajeev Cc: Changbin Du Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Cc: Song Liu Cc: Stephane Eranian Link: https://lore.kernel.org/r/20211215185154.360314-6-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 177f4eac7fb7fe5c70fef30dd6c4ef8f81cf7776 Author: Namhyung Kim Date: Wed Dec 15 10:51:53 2021 -0800 perf ftrace: Add -b/--use-bpf option for latency subcommand The -b/--use-bpf option is to use BPF to get latency info of kernel functions. It'd have better performance impact and I observed that latency of same function is smaller than before when using BPF. Committer testing: # strace -e bpf perf ftrace latency -b -T __handle_mm_fault -a sleep 1 bpf(BPF_PROG_LOAD, {prog_type=BPF_PROG_TYPE_SOCKET_FILTER, insn_cnt=2, insns=0x7fff51914e00, license="GPL", log_level=0, log_size=0, log_buf=NULL, kern_version=KERNEL_VERSION(0, 0, 0), prog_flags=0, prog_name="", prog_ifindex=0, expected_attach_type=BPF_CGROUP_INET_INGRESS, prog_btf_fd=0, func_info_rec_size=0, func_info=NULL, func_info_cnt=0, line_info_rec_size=0, line_info=NULL, line_info_cnt=0, attach_btf_id=0, attach_prog_fd=0}, 128) = 3 bpf(BPF_BTF_LOAD, {btf="\237\353\1\0\30\0\0\0\0\0\0\0\20\0\0\0\20\0\0\0\5\0\0\0\1\0\0\0\0\0\0\1"..., btf_log_buf=NULL, btf_size=45, btf_log_size=0, btf_log_level=0}, 128) = 3 bpf(BPF_BTF_LOAD, {btf="\237\353\1\0\30\0\0\0\0\0\0\0000\0\0\0000\0\0\0\t\0\0\0\1\0\0\0\0\0\0\1"..., btf_log_buf=NULL, btf_size=81, btf_log_size=0, btf_log_level=0}, 128) = 3 bpf(BPF_BTF_LOAD, {btf="\237\353\1\0\30\0\0\0\0\0\0\08\0\0\08\0\0\0\t\0\0\0\0\0\0\0\0\0\0\1"..., btf_log_buf=NULL, btf_size=89, btf_log_size=0, btf_log_level=0}, 128) = 3 bpf(BPF_BTF_LOAD, {btf="\237\353\1\0\30\0\0\0\0\0\0\0\f\0\0\0\f\0\0\0\7\0\0\0\1\0\0\0\0\0\0\20"..., btf_log_buf=NULL, btf_size=43, btf_log_size=0, btf_log_level=0}, 128) = 3 bpf(BPF_BTF_LOAD, {btf="\237\353\1\0\30\0\0\0\0\0\0\0000\0\0\0000\0\0\0\t\0\0\0\1\0\0\0\0\0\0\1"..., btf_log_buf=NULL, btf_size=81, btf_log_size=0, btf_log_level=0}, 128) = 3 bpf(BPF_BTF_LOAD, {btf="\237\353\1\0\30\0\0\0\0\0\0\0000\0\0\0000\0\0\0\5\0\0\0\0\0\0\0\0\0\0\1"..., btf_log_buf=NULL, btf_size=77, btf_log_size=0, btf_log_level=0}, 128) = -1 EINVAL (Invalid argument) bpf(BPF_BTF_LOAD, {btf="\237\353\1\0\30\0\0\0\0\0\0\0\350\2\0\0\350\2\0\0\353\2\0\0\0\0\0\0\0\0\0\2"..., btf_log_buf=NULL, btf_size=1515, btf_log_size=0, btf_log_level=0}, 128) = 3 bpf(BPF_MAP_CREATE, {map_type=BPF_MAP_TYPE_ARRAY, key_size=4, value_size=32, max_entries=1, map_flags=0, inner_map_fd=0, map_name="", map_ifindex=0, btf_fd=0, btf_key_type_id=0, btf_value_type_id=0, btf_vmlinux_value_type_id=0}, 128) = 4 bpf(BPF_PROG_LOAD, {prog_type=BPF_PROG_TYPE_SOCKET_FILTER, insn_cnt=5, insns=0x7fff51914c30, license="GPL", log_level=0, log_size=0, log_buf=NULL, kern_version=KERNEL_VERSION(0, 0, 0), prog_flags=0, prog_name="", prog_ifindex=0, expected_attach_type=BPF_CGROUP_INET_INGRESS, prog_btf_fd=0, func_info_rec_size=0, func_info=NULL, func_info_cnt=0, line_info_rec_size=0, line_info=NULL, line_info_cnt=0, attach_btf_id=0, attach_prog_fd=0}, 128) = 5 bpf(BPF_MAP_CREATE, {map_type=BPF_MAP_TYPE_ARRAY, key_size=4, value_size=4, max_entries=1, map_flags=BPF_F_MMAPABLE, inner_map_fd=0, map_name="", map_ifindex=0, btf_fd=0, btf_key_type_id=0, btf_value_type_id=0, btf_vmlinux_value_type_id=0}, 128) = 4 bpf(BPF_PROG_LOAD, {prog_type=BPF_PROG_TYPE_SOCKET_FILTER, insn_cnt=2, insns=0x7fff51914a80, license="GPL", log_level=0, log_size=0, log_buf=NULL, kern_version=KERNEL_VERSION(0, 0, 0), prog_flags=0, prog_name="test", prog_ifindex=0, expected_attach_type=BPF_CGROUP_INET_INGRESS, prog_btf_fd=0, func_info_rec_size=0, func_info=NULL, func_info_cnt=0, line_info_rec_size=0, line_info=NULL, line_info_cnt=0, attach_btf_id=0, attach_prog_fd=0}, 128) = 4 bpf(BPF_MAP_CREATE, {map_type=BPF_MAP_TYPE_HASH, key_size=8, value_size=8, max_entries=10000, map_flags=0, inner_map_fd=0, map_name="functime", map_ifindex=0, btf_fd=3, btf_key_type_id=0, btf_value_type_id=0, btf_vmlinux_value_type_id=0}, 128) = 4 bpf(BPF_MAP_CREATE, {map_type=BPF_MAP_TYPE_HASH, key_size=4, value_size=1, max_entries=1, map_flags=0, inner_map_fd=0, map_name="cpu_filter", map_ifindex=0, btf_fd=3, btf_key_type_id=0, btf_value_type_id=0, btf_vmlinux_value_type_id=0}, 128) = 5 bpf(BPF_MAP_CREATE, {map_type=BPF_MAP_TYPE_HASH, key_size=4, value_size=1, max_entries=1, map_flags=0, inner_map_fd=0, map_name="task_filter", map_ifindex=0, btf_fd=3, btf_key_type_id=0, btf_value_type_id=0, btf_vmlinux_value_type_id=0}, 128) = 7 bpf(BPF_MAP_CREATE, {map_type=BPF_MAP_TYPE_PERCPU_ARRAY, key_size=4, value_size=8, max_entries=22, map_flags=0, inner_map_fd=0, map_name="latency", map_ifindex=0, btf_fd=3, btf_key_type_id=0, btf_value_type_id=0, btf_vmlinux_value_type_id=0}, 128) = 8 bpf(BPF_MAP_CREATE, {map_type=BPF_MAP_TYPE_ARRAY, key_size=4, value_size=4, max_entries=1, map_flags=BPF_F_MMAPABLE, inner_map_fd=0, map_name="func_lat.bss", map_ifindex=0, btf_fd=3, btf_key_type_id=0, btf_value_type_id=30, btf_vmlinux_value_type_id=0}, 128) = 9 bpf(BPF_MAP_UPDATE_ELEM, {map_fd=9, key=0x7fff51914c40, value=0x7f6e99be2000, flags=BPF_ANY}, 128) = 0 bpf(BPF_PROG_LOAD, {prog_type=BPF_PROG_TYPE_KPROBE, insn_cnt=18, insns=0x11e4160, license="", log_level=0, log_size=0, log_buf=NULL, kern_version=KERNEL_VERSION(5, 14, 16), prog_flags=0, prog_name="func_begin", prog_ifindex=0, expected_attach_type=BPF_CGROUP_INET_INGRESS, prog_btf_fd=3, func_info_rec_size=8, func_info=0x11dfc50, func_info_cnt=1, line_info_rec_size=16, line_info=0x11e04c0, line_info_cnt=9, attach_btf_id=0, attach_prog_fd=0}, 128) = 10 bpf(BPF_PROG_LOAD, {prog_type=BPF_PROG_TYPE_KPROBE, insn_cnt=99, insns=0x11ded70, license="", log_level=0, log_size=0, log_buf=NULL, kern_version=KERNEL_VERSION(5, 14, 16), prog_flags=0, prog_name="func_end", prog_ifindex=0, expected_attach_type=BPF_CGROUP_INET_INGRESS, prog_btf_fd=3, func_info_rec_size=8, func_info=0x11dfc70, func_info_cnt=1, line_info_rec_size=16, line_info=0x11f6e10, line_info_cnt=20, attach_btf_id=0, attach_prog_fd=0}, 128) = 11 bpf(BPF_PROG_LOAD, {prog_type=BPF_PROG_TYPE_TRACEPOINT, insn_cnt=2, insns=0x7fff51914a80, license="GPL", log_level=0, log_size=0, log_buf=NULL, kern_version=KERNEL_VERSION(0, 0, 0), prog_flags=0, prog_name="", prog_ifindex=0, expected_attach_type=BPF_CGROUP_INET_INGRESS, prog_btf_fd=0, func_info_rec_size=0, func_info=NULL, func_info_cnt=0, line_info_rec_size=0, line_info=NULL, line_info_cnt=0, attach_btf_id=0, attach_prog_fd=0}, 128) = 13 bpf(BPF_LINK_CREATE, {link_create={prog_fd=13, target_fd=-1, attach_type=0x29 /* BPF_??? */, flags=0}}, 128) = -1 EINVAL (Invalid argument) --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=1699992, si_uid=0, si_status=0, si_utime=0, si_stime=0} --- bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7fff51914f84, value=0x11f6fa0, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7fff51914f84, value=0x11f6fa0, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7fff51914f84, value=0x11f6fa0, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7fff51914f84, value=0x11f6fa0, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7fff51914f84, value=0x11f6fa0, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7fff51914f84, value=0x11f6fa0, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7fff51914f84, value=0x11f6fa0, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7fff51914f84, value=0x11f6fa0, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7fff51914f84, value=0x11f6fa0, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7fff51914f84, value=0x11f6fa0, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7fff51914f84, value=0x11f6fa0, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7fff51914f84, value=0x11f6fa0, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7fff51914f84, value=0x11f6fa0, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7fff51914f84, value=0x11f6fa0, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7fff51914f84, value=0x11f6fa0, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7fff51914f84, value=0x11f6fa0, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7fff51914f84, value=0x11f6fa0, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7fff51914f84, value=0x11f6fa0, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7fff51914f84, value=0x11f6fa0, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7fff51914f84, value=0x11f6fa0, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7fff51914f84, value=0x11f6fa0, flags=BPF_ANY}, 128) = 0 bpf(BPF_MAP_LOOKUP_ELEM, {map_fd=8, key=0x7fff51914f84, value=0x11f6fa0, flags=BPF_ANY}, 128) = 0 # DURATION | COUNT | GRAPH | 0 - 1 us | 52 | ################### | 1 - 2 us | 36 | ############# | 2 - 4 us | 24 | ######### | 4 - 8 us | 7 | ## | 8 - 16 us | 1 | | 16 - 32 us | 0 | | 32 - 64 us | 0 | | 64 - 128 us | 0 | | 128 - 256 us | 0 | | 256 - 512 us | 0 | | 512 - 1024 us | 0 | | 1 - 2 ms | 0 | | 2 - 4 ms | 0 | | 4 - 8 ms | 0 | | 8 - 16 ms | 0 | | 16 - 32 ms | 0 | | 32 - 64 ms | 0 | | 64 - 128 ms | 0 | | 128 - 256 ms | 0 | | 256 - 512 ms | 0 | | 512 - 1024 ms | 0 | | 1 - ... s | 0 | | +++ exited with 0 +++ # Signed-off-by: Namhyung Kim Tested-by: Arnaldo Carvalho de Melo Cc: Andi Kleen Cc: Athira Jajeev Cc: Changbin Du Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Cc: Song Liu Cc: Stephane Eranian Link: https://lore.kernel.org/r/20211215185154.360314-5-namhyung@kernel.org [ Add missing util/cpumap.h include and removed unused 'fd' variable ] Signed-off-by: Arnaldo Carvalho de Melo commit 53be50282269b46c678ae5a9f54acf7416a10dbb Author: Namhyung Kim Date: Wed Dec 15 10:51:52 2021 -0800 perf ftrace: Add 'latency' subcommand The perf ftrace latency is to get a histogram of function execution time. Users should give a function name using -T option. This is implemented using function_graph tracer with the given function only. And it parses the output to extract the time. $ sudo perf ftrace latency -a -T mutex_lock sleep 1 # DURATION | COUNT | GRAPH | 0 - 1 us | 4596 | ######################## | 1 - 2 us | 1680 | ######### | 2 - 4 us | 1106 | ##### | 4 - 8 us | 546 | ## | 8 - 16 us | 562 | ### | 16 - 32 us | 1 | | 32 - 64 us | 0 | | 64 - 128 us | 0 | | 128 - 256 us | 0 | | 256 - 512 us | 0 | | 512 - 1024 us | 0 | | 1 - 2 ms | 0 | | 2 - 4 ms | 0 | | 4 - 8 ms | 0 | | 8 - 16 ms | 0 | | 16 - 32 ms | 0 | | 32 - 64 ms | 0 | | 64 - 128 ms | 0 | | 128 - 256 ms | 0 | | 256 - 512 ms | 0 | | 512 - 1024 ms | 0 | | 1 - ... s | 0 | | Committer testing: Latency for the __handle_mm_fault kernel function, system wide for 1 second, see how one can go from the usual 'perf ftrace' output, now the same as for the 'perf ftrace trace' subcommand, to the new 'perf ftrace latency' subcommand: # perf ftrace -T __handle_mm_fault -a sleep 1 | wc -l 709 # perf ftrace -T __handle_mm_fault -a sleep 1 | wc -l 510 # perf ftrace -T __handle_mm_fault -a sleep 1 | head -20 # tracer: function # # entries-in-buffer/entries-written: 0/0 #P:32 # # TASK-PID CPU# TIMESTAMP FUNCTION # | | | | | perf-exec-1685104 [007] 90638.894613: __handle_mm_fault <-handle_mm_fault perf-exec-1685104 [007] 90638.894620: __handle_mm_fault <-handle_mm_fault perf-exec-1685104 [007] 90638.894622: __handle_mm_fault <-handle_mm_fault perf-exec-1685104 [007] 90638.894635: __handle_mm_fault <-handle_mm_fault perf-exec-1685104 [007] 90638.894688: __handle_mm_fault <-handle_mm_fault perf-exec-1685104 [007] 90638.894702: __handle_mm_fault <-handle_mm_fault perf-exec-1685104 [007] 90638.894714: __handle_mm_fault <-handle_mm_fault perf-exec-1685104 [007] 90638.894728: __handle_mm_fault <-handle_mm_fault perf-exec-1685104 [007] 90638.894740: __handle_mm_fault <-handle_mm_fault perf-exec-1685104 [007] 90638.894751: __handle_mm_fault <-handle_mm_fault sleep-1685104 [007] 90638.894962: __handle_mm_fault <-handle_mm_fault sleep-1685104 [007] 90638.894977: __handle_mm_fault <-handle_mm_fault sleep-1685104 [007] 90638.894983: __handle_mm_fault <-handle_mm_fault sleep-1685104 [007] 90638.894995: __handle_mm_fault <-handle_mm_fault # perf ftrace latency -T __handle_mm_fault -a sleep 1 # DURATION | COUNT | GRAPH | 0 - 1 us | 125 | ###### | 1 - 2 us | 249 | ############# | 2 - 4 us | 455 | ######################## | 4 - 8 us | 37 | # | 8 - 16 us | 0 | | 16 - 32 us | 0 | | 32 - 64 us | 0 | | 64 - 128 us | 0 | | 128 - 256 us | 0 | | 256 - 512 us | 0 | | 512 - 1024 us | 0 | | 1 - 2 ms | 0 | | 2 - 4 ms | 0 | | 4 - 8 ms | 0 | | 8 - 16 ms | 0 | | 16 - 32 ms | 0 | | 32 - 64 ms | 0 | | 64 - 128 ms | 0 | | 128 - 256 ms | 0 | | 256 - 512 ms | 0 | | 512 - 1024 ms | 0 | | 1 - ... s | 0 | | # Signed-off-by: Namhyung Kim Tested-by: Arnaldo Carvalho de Melo Cc: Andi Kleen Cc: Athira Jajeev Cc: Changbin Du Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Cc: Song Liu Cc: Stephane Eranian Link: https://lore.kernel.org/r/20211215185154.360314-4-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit a9b8ae8ae347941fefd6596f62586b13ae032e4b Author: Namhyung Kim Date: Wed Dec 15 10:51:51 2021 -0800 perf ftrace: Move out common code from __cmd_ftrace The signal setup code and evlist__prepare_workload() can be used for other subcommands. Let's move them out of the __cmd_ftrace(). Then it doesn't need to pass argc and argv. On the other hand, select_tracer() is specific to the 'trace' subcommand so it'd better moving it into the __cmd_ftrace(). Signed-off-by: Namhyung Kim Tested-by: Arnaldo Carvalho de Melo Cc: Andi Kleen Cc: Athira Jajeev Cc: Changbin Du Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Cc: Song Liu Cc: Stephane Eranian Link: https://lore.kernel.org/r/20211215185154.360314-3-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 416e15ad17f84358ba3eca6b82378be97c793c62 Author: Namhyung Kim Date: Wed Dec 15 10:51:50 2021 -0800 perf ftrace: Add 'trace' subcommand This is a preparation to add more sub-commands for ftrace. The 'trace' subcommand does the same thing when no subcommand is given. Committer testing: The previous mode, i.e. no subcommand and the new 'perf ftrace trace' are equivalent: # perf ftrace -G check_preempt_curr sleep 0.00001 # tracer: function_graph # # CPU DURATION FUNCTION CALLS # | | | | | | | 25) | check_preempt_curr() { 25) | resched_curr() { 25) | native_smp_send_reschedule() { 25) | default_send_IPI_single_phys() { 25) 0.110 us | __default_send_IPI_dest_field(); 25) 0.490 us | } 25) 0.640 us | } 25) 0.850 us | } 25) 2.060 us | } # perf ftrace trace -G check_preempt_curr sleep 0.00001 # tracer: function_graph # # CPU DURATION FUNCTION CALLS # | | | | | | | 10) | check_preempt_curr() { 10) | resched_curr() { 10) | native_smp_send_reschedule() { 10) | default_send_IPI_single_phys() { 10) 0.080 us | __default_send_IPI_dest_field(); 10) 0.460 us | } 10) 0.610 us | } 10) 0.830 us | } 10) 2.020 us | } # Signed-off-by: Namhyung Kim Tested-by: Arnaldo Carvalho de Melo Cc: Andi Kleen Cc: Athira Jajeev Cc: Changbin Du Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Cc: Song Liu Cc: Stephane Eranian Link: https://lore.kernel.org/r/20211215185154.360314-2-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 83869019c74cc2d01c96a3be2463a4eebe362224 Author: German Gomez Date: Tue Dec 7 18:06:52 2021 +0000 perf arch: Support register names from all archs When reading a perf.data file with register values, there is a mismatch between the names and the values of the registers because the tool is built using only the register names from the local architecture. Reading a perf.data file that was recorded on ARM64, gives the following erroneous output on an X86 machine: # perf report -i perf_arm64.data -D [...] 24661932634451 0x698 [0x21d0]: PERF_RECORD_SAMPLE(IP, 0x1): 43239/43239: 0xffffc5be8f100f98 period: 1 addr: 0 ... user regs: mask 0x1ffffffff ABI 64-bit .... AX 0x0000ffffd1515817 .... BX 0x0000ffffd1515480 .... CX 0x0000aaaadabf6c80 .... DX 0x000000000000002e .... SI 0x0000000040100401 .... DI 0x0040600200000080 .... BP 0x0000ffffd1510e10 .... SP 0x0000000000000000 .... IP 0x00000000000000dd .... FLAGS 0x0000ffffd1510cd0 .... CS 0x0000000000000000 .... SS 0x0000000000000030 .... DS 0x0000ffffa569a208 .... ES 0x0000000000000000 .... FS 0x0000000000000000 .... GS 0x0000000000000000 .... R8 0x0000aaaad3de9650 .... R9 0x0000ffffa57397f0 .... R10 0x0000000000000001 .... R11 0x0000ffffa57fd000 .... R12 0x0000ffffd1515817 .... R13 0x0000ffffd1515480 .... R14 0x0000aaaadabf6c80 .... R15 0x0000000000000000 .... unknown 0x0000000000000001 .... unknown 0x0000000000000000 .... unknown 0x0000000000000000 .... unknown 0x0000000000000000 .... unknown 0x0000000000000000 .... unknown 0x0000ffffd1510d90 .... unknown 0x0000ffffa5739b90 .... unknown 0x0000ffffd1510d80 .... XMM0 0x0000ffffa57392c8 ... thread: perf-exec:43239 ...... dso: [kernel.kallsyms] As can be seen, the register names correspond to X86 registers, even though the perf.data file was recorded on an ARM64 system. After this patch, the output of the command displays the correct register names: # perf report -i perf_arm64.data -D [...] 24661932634451 0x698 [0x21d0]: PERF_RECORD_SAMPLE(IP, 0x1): 43239/43239: 0xffffc5be8f100f98 period: 1 addr: 0 ... user regs: mask 0x1ffffffff ABI 64-bit .... x0 0x0000ffffd1515817 .... x1 0x0000ffffd1515480 .... x2 0x0000aaaadabf6c80 .... x3 0x000000000000002e .... x4 0x0000000040100401 .... x5 0x0040600200000080 .... x6 0x0000ffffd1510e10 .... x7 0x0000000000000000 .... x8 0x00000000000000dd .... x9 0x0000ffffd1510cd0 .... x10 0x0000000000000000 .... x11 0x0000000000000030 .... x12 0x0000ffffa569a208 .... x13 0x0000000000000000 .... x14 0x0000000000000000 .... x15 0x0000000000000000 .... x16 0x0000aaaad3de9650 .... x17 0x0000ffffa57397f0 .... x18 0x0000000000000001 .... x19 0x0000ffffa57fd000 .... x20 0x0000ffffd1515817 .... x21 0x0000ffffd1515480 .... x22 0x0000aaaadabf6c80 .... x23 0x0000000000000000 .... x24 0x0000000000000001 .... x25 0x0000000000000000 .... x26 0x0000000000000000 .... x27 0x0000000000000000 .... x28 0x0000000000000000 .... x29 0x0000ffffd1510d90 .... lr 0x0000ffffa5739b90 .... sp 0x0000ffffd1510d80 .... pc 0x0000ffffa57392c8 ... thread: perf-exec:43239 ...... dso: [kernel.kallsyms] Tester comments: Athira reports: "Looks good to me. Tested this patchset in powerpc by capturing regs in powerpc and doing perf report to read the data from x86." Reported-by: Alexandre Truong Reviewed-by: Athira Jajeev Signed-off-by: German Gomez Tested-by: Athira Jajeev Cc: Alexander Shishkin Cc: Jiri Olsa Cc: John Garry Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Namhyung Kim Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Cc: linux-csky@vger.kernel.org Cc: linux-riscv@lists.infradead.org Link: https://lore.kernel.org/r/20211207180653.1147374-4-german.gomez@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit d3b58af9a8276c24a2aa80a059d87d99f5216d3b Author: German Gomez Date: Tue Dec 7 18:06:51 2021 +0000 perf arm64: Rename perf_event_arm_regs for ARM64 registers The registers for ARM and ARM64 are enumerated using two enums that have the same name. In order to be able to import both headers, the name of one can be replaced using the C preprocessor like so: #define perf_event_arm_regs perf_event_arm64_regs #include #undef perf_event_arm_regs This patch updates all imports of ARM64's perf_regs.h in order to prevent the naming collision. Reviewed-by: Athira Jajeev Signed-off-by: German Gomez Tested-by: Athira Jajeev Cc: Alexander Shishkin Cc: Jiri Olsa Cc: John Garry Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Namhyung Kim Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Cc: linux-csky@vger.kernel.org Cc: linux-riscv@lists.infradead.org Link: https://lore.kernel.org/r/20211207180653.1147374-3-german.gomez@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 5d28a17c1c0e9dbd299015f91800aff3466ebedf Author: Leo Yan Date: Sun Dec 12 21:47:20 2021 +0800 perf namespaces: Add helper nsinfo__is_in_root_namespace() Refactors code for gathering PID infos, it creates the function nsinfo__get_nspid() to parse process 'status' node in folder '/proc'. Base on the refactoring, this patch introduces a new helper nsinfo__is_in_root_namespace(), it returns true when the caller runs in the root PID namespace. Signed-off-by: Leo Yan Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Daniel Borkmann Cc: Jin Yao Cc: Jiri Olsa Cc: John Fastabend Cc: John Garry Cc: KP Singh Cc: Mark Rutland Cc: Martin KaFai Lau Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Song Liu Cc: Yonatan Goldschmidt Cc: Yonghong Song Cc: bpf@vger.kernel.org Cc: netdev@vger.kernel.org Link: http://lore.kernel.org/lkml/20211212134721.1721245-2-leo.yan@linaro.org Signed-off-by: Arnaldo Carvalho de Melo commit 017f7d1fac1c40eba6d97490a75bc1999914ef75 Author: Colin Ian King Date: Sun Dec 12 22:21:22 2021 +0000 libperf tests: Fix a spelling mistake "Runnnig" -> "Running" There is a spelling mistake in a __T_VERBOSE message. Fix it. Signed-off-by: Colin Ian 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/20211212222122.478537-1-colin.i.king@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit 8acf3793eae4d809658b1ebeed68d818d6d38142 Author: Miaoqian Lin Date: Sun Dec 12 13:56:09 2021 +0000 perf bpf-loader: Use IS_ERR_OR_NULL() to clean code and fix check Use IS_ERR_OR_NULL() to make the code cleaner. Also if the priv is NULL, it's improper to call PTR_ERR(priv). Signed-off-by: Miaoqian Lin Cc: Alexander Shishkin Cc: Alexei Starovoitov Cc: Andrii Nakryiko Cc: Daniel Borkmann Cc: Jiri Olsa Cc: John Fastabend Cc: KP Singh Cc: Mark Rutland Cc: Martin KaFai Lau Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Song Liu Cc: Yonghong Song Cc: bpf@vger.kernel.org Cc: netdev@vger.kernel.org Cc: unlisted-recipients Link: http://lore.kernel.org/lkml/20211212135613.20000-1-linmq006@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit 7cc9680c4be7c1da7a3570711f01273b781b936b Author: James Clark Date: Wed Dec 8 11:54:35 2021 +0000 perf cs-etm: Remove duplicate and incorrect aux size checks There are two checks, one is for size when running without admin, but this one is covered by the driver and reported on in more detail here (builtin-record.c): pr_err("Permission error mapping pages.\n" "Consider increasing " "/proc/sys/kernel/perf_event_mlock_kb,\n" "or try again with a smaller value of -m/--mmap_pages.\n" "(current value: %u,%u)\n", This had the effect of artificially limiting the aux buffer size to a value smaller than what was allowed because perf_event_mlock_kb wasn't taken into account. The second is to check for a power of two, but this is covered here (evlist.c): pr_info("rounding mmap pages size to %s (%lu pages)\n", buf, pages); 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/20211208115435.610101-1-james.clark@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 6732f10b11c63112ce34a064b247c00e090b9514 Author: Andrew Kilroy Date: Fri Dec 10 12:37:05 2021 +0000 perf vendor events: Rename arm64 arch std event files A previous commit adds pmu events into the files armv8-common-and-microarch.json armv8-recommended.json that are actually specified in an armv9 reference supplement, not armv8. As such, naming the files with the armv8 prefix seems artificial. This patch renames the files to reflect that these two files are for arch std events regardless of whether they are defined in armv8 or armv9. Reviewed-by: John Garry Signed-off-by: Andrew Kilroy Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Namhyung Kim Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20211210123706.7490-3-andrew.kilroy@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 3987d65f45ed51a4650e911baa68f9b6ed4623cb Author: Andrew Kilroy Date: Fri Dec 10 12:37:04 2021 +0000 perf vendor events: For the Arm Neoverse N2 Updates the common and microarch json file to add counters available in the Arm Neoverse N2 chip, but should also apply to other ArmV8 and ArmV9 cpus. Specified in ArmV8 architecture reference manual https://developer.arm.com/documentation/ddi0487/gb/?lang=en Some of the counters added to armv8-common-and-microarch.json are specified in the ArmV9 architecture reference manual supplement (issue A.a): https://developer.arm.com/documentation/ddi0608/aa The additional ArmV9 counters are TRB_WRAP TRCEXTOUT0 TRCEXTOUT1 TRCEXTOUT2 TRCEXTOUT3 CTI_TRIGOUT4 CTI_TRIGOUT5 CTI_TRIGOUT6 CTI_TRIGOUT7 This patch also adds files in pmu-events/arch/arm64/arm/neoverse-n2 for perf list to output the counter names in categories. Counters on the Neoverse N2 are stated in its reference manual: https://developer.arm.com/documentation/102099/0000 Reviewed-by: John Garry Signed-off-by: Andrew Kilroy Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Namhyung Kim Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Link: https://lore.kernel.org/r/20211210123706.7490-2-andrew.kilroy@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit 888569dbcd80a0bb87371e9fb0fa3802c7aa9b14 Author: Salvatore Bonaccorso Date: Tue Nov 23 22:18:21 2021 +0100 perf dlfilter: Drop unused variable Compiling tools/perf/dlfilters/dlfilter-test-api-v0.c result in: checking for stdlib.h... dlfilters/dlfilter-test-api-v0.c: In function ‘filter_event’: dlfilters/dlfilter-test-api-v0.c:311:29: warning: unused variable ‘d’ [-Wunused-variable] 311 | struct filter_data *d = data; | So remove the variable now. Reviewed-by: German Gomez Signed-off-by: Salvatore Bonaccorso Acked-by: Adrian Hunter Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20211123211821.132924-1-carnil@debian.org Signed-off-by: Arnaldo Carvalho de Melo commit b0fde9c6e291e528878ea3713997777713fe44c6 Author: Namhyung Kim Date: Wed Dec 1 14:08:55 2021 -0800 perf arm-spe: Add SPE total latency as PERF_SAMPLE_WEIGHT Use total latency info in the SPE counter packet as sample weight so that we can see it in local_weight and (global) weight sort keys. Maybe we can use PERF_SAMPLE_WEIGHT_STRUCT to support ins_lat as well but I'm not sure which latency it matches. So just adding total latency first. Reviewed-by: Leo Yan Signed-off-by: Namhyung Kim Cc: Andi Kleen Cc: German Gomez Cc: Ian Rogers Cc: James Clark Cc: Jiri Olsa Cc: Mark Rutland Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20211201220855.1260688-1-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit f0a29c9647ff8bbb424641f79bc1894e83dec218 Author: Sohaib Mohamed Date: Fri Nov 19 08:14:08 2021 +0200 perf bench: Use unbuffered output when pipe/tee'ing to a file The output of 'perf bench' gets buffered when I pipe it to a file or to tee, in such a way that I can see it only at the end. E.g. $ perf bench internals synthesize -t < output comes out fine after each test run > $ perf bench internals synthesize -t | tee file.txt < output comes out only at the end of all tests > This patch resolves this issue for 'bench' and 'test' subcommands. See, also: $ perf bench mem all | tee file.txt $ perf bench sched all | tee file.txt $ perf bench internals all -t | tee file.txt $ perf bench internals all | tee file.txt Committer testing: It really gets staggered, i.e. outputs in bursts, when the buffer fills up and has to be drained to make up space for more output. Suggested-by: Riccardo Mancini Signed-off-by: Sohaib Mohamed Tested-by: Arnaldo Carvalho de Melo Acked-by: Jiri Olsa Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Fabian Hemmer Cc: Ian Rogers Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20211119061409.78004-1-sohaib.amhmd@gmail.com Signed-off-by: Arnaldo Carvalho de Melo commit 39f054a98ab191fed8d921763f131841d876fc0b Merge: 8ff4f20f3eb55 2b14864acbaaf Author: Arnaldo Carvalho de Melo Date: Thu Dec 16 12:12:36 2021 -0300 Merge remote-tracking branch 'torvalds/master' into perf/core To pick up fixes. Signed-off-by: Arnaldo Carvalho de Melo commit 858779df1c0787d3fec827fb705708df9ebdb15b Author: Ye Guojin Date: Tue Nov 16 08:10:51 2021 +0000 MIPS: OCTEON: add put_device() after of_find_device_by_node() This was found by coccicheck: ./arch/mips/cavium-octeon/octeon-platform.c, 332, 1-7, ERROR missing put_device; call of_find_device_by_node on line 324, but without a corresponding object release within this function. ./arch/mips/cavium-octeon/octeon-platform.c, 395, 1-7, ERROR missing put_device; call of_find_device_by_node on line 387, but without a corresponding object release within this function. ./arch/mips/cavium-octeon/octeon-usb.c, 512, 3-9, ERROR missing put_device; call of_find_device_by_node on line 515, but without a corresponding object release within this function. ./arch/mips/cavium-octeon/octeon-usb.c, 543, 1-7, ERROR missing put_device; call of_find_device_by_node on line 515, but without a corresponding object release within this function. Reported-by: Zeal Robot Signed-off-by: Ye Guojin Signed-off-by: Thomas Bogendoerfer commit 906c6bc6e8e5c00cf76488e3023759fdfd6a18af Author: Jason Wang Date: Mon Sep 6 21:49:23 2021 +0800 MIPS: BCM47XX: 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: Thomas Bogendoerfer commit a670c82d9ca4f1e7385d9d6f26ff41a50fbdd944 Author: Lukas Bulwahn Date: Mon Dec 13 12:16:42 2021 +0100 mips: fix Kconfig reference to PHYS_ADDR_T_64BIT Commit d4a451d5fc84 ("arch: remove the ARCH_PHYS_ADDR_T_64BIT config symbol") removes config ARCH_PHYS_ADDR_T_64BIT with all instances of that config refactored appropriately. Since then, it is recommended to use the config PHYS_ADDR_T_64BIT instead. Commit 171543e75272 ("MIPS: Disallow CPU_SUPPORTS_HUGEPAGES for XPA,EVA") introduces the expression "!(32BIT && (ARCH_PHYS_ADDR_T_64BIT || EVA))" for config CPU_SUPPORTS_HUGEPAGES, which unintentionally refers to the non-existing symbol ARCH_PHYS_ADDR_T_64BIT instead of the intended PHYS_ADDR_T_64BIT. Fix this Kconfig reference to the intended PHYS_ADDR_T_64BIT. This issue was identified with the script ./scripts/checkkconfigsymbols.py. I then reported it on the mailing list and Paul confirmed the mistake in the linked email thread. Link: https://lore.kernel.org/lkml/H8IU3R.H5QVNRA077PT@crapouillou.net/ Suggested-by: Paul Cercueil Fixes: 171543e75272 ("MIPS: Disallow CPU_SUPPORTS_HUGEPAGES for XPA,EVA") Signed-off-by: Lukas Bulwahn Signed-off-by: Thomas Bogendoerfer commit ddc18bd714188bc9b9a09f42317b8050c6ea5160 Author: Lukas Bulwahn Date: Mon Dec 13 12:16:41 2021 +0100 mips: txx9: remove left-over for removed TXX9_ACLC configs The patch series "Remove support for TX49xx" (see Link) was only partially applied: The ASoC driver was removed with commit a8644292ea46 ("ASoC: txx9: Remove driver"), which was patch 10/10 from that series. The mips architecture code to be removed with patch 1/10 from that series was not applied. This partial patch series application leaves the build config setup and code in the mips architecture in a slightly unclean, intermediate state. The configs HAS_TXX9_ACLC and SND_SOC_TXX9ACLC were removed, but are still referenced in the txx9-architecture Kconfig and generic setup. The script ./scripts/checkkconfigsymbols.py warns about this: HAS_TXX9_ACLC Referencing files: arch/mips/txx9/Kconfig SND_SOC_TXX9ACLC Referencing files: arch/mips/txx9/generic/setup.c Clean up the code for those removed references. Link: https://lore.kernel.org/all/20210105140305.141401-1-tsbogend@alpha.franken.de/ Signed-off-by: Lukas Bulwahn Signed-off-by: Thomas Bogendoerfer commit deaee2704a157dfcca77301ddaa10c62a9840952 Author: John Ogness Date: Wed Dec 15 16:16:22 2021 +0106 scripts/gdb: lx-dmesg: read records individually For the gdb command lx-dmesg, the entire descriptor, info, and text data regions are read into memory before printing any records. For large kernel log buffers, this not only causes a huge delay before seeing any records, but it may also lead to python errors of too much memory allocation. Rather than reading in all these regions in advance, read them as needed and only read the regions for the particular record that is being printed. The gdb macro "dmesg" in Documentation/admin-guide/kdump/gdbmacros.txt already prints out the kernel log buffer like this. Signed-off-by: John Ogness Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/874k79c3a9.fsf@jogness.linutronix.de commit a51f0824d8bb08884ee2106dbbe68f4b8d860bc4 Author: Lukas Bulwahn Date: Mon Dec 13 12:16:40 2021 +0100 mips: alchemy: remove historic comment on gpio build constraints In ./arch/mips/alchemy/common/gpiolib.c, the comment points out certain build constraints on CONFIG_GPIOLIB and CONFIG_ALCHEMY_GPIO_INDIRECT. The commit 832f5dacfa0b ("MIPS: Remove all the uses of custom gpio.h") makes all mips machines use the common gpio.h and removes the config ALCHEMY_GPIO_INDIRECT. So, this makes the comment in alchemy's gpiolib.c historic and obsolete, and can be removed after the commit above. The issue on the reference to a non-existing Kconfig symbol was identified with ./scripts/checkkconfigsymbols.py. This script has been quite useful to identify a number of bugs with Kconfig symbols and deserves to be executed and checked regularly. So, remove the historic comment to reduce the reports made the script and simplify to use this script, as new issues are easier to spot when the list of reports is shorter. Signed-off-by: Lukas Bulwahn Signed-off-by: Thomas Bogendoerfer commit bb900d43e2491848c6e5640c4da7722a494f292d Author: Lukas Bulwahn Date: Mon Dec 13 12:16:39 2021 +0100 mips: remove obsolete selection of CPU_HAS_LOAD_STORE_LR Commit 18d84e2e55b6 ("MIPS: make CPU_HAS_LOAD_STORE_LR opt-out") replaced the config CPU_HAS_LOAD_STORE_LR by the config with an inverted semantics, making the "LOAD_STORE_LR" cpu configuration the default. The ./arch/mips/Kconfig was adjusted accordingly. Later, commit 65ce6197ed40 ("Revert "MIPS: Remove unused R4300 CPU support"") reintroduces a select CPU_HAS_LOAD_STORE_LR through its revert commit, restoring the config CPU_R4300 in ./arch/mips/Kconfig before the refactoring above. This select however now refers to a non-existing config and is further unneeded, as LOAD_STORE_LR is the default now. Remove the obsolete select for the reintroduced mips R4300 architecture. This issue is identified with ./scripts/checkkconfigsymbols.py. Signed-off-by: Lukas Bulwahn Signed-off-by: Thomas Bogendoerfer commit 301e499938a6f0cea3c3e8cebdf8c244d886977f Author: Lukas Bulwahn Date: Mon Dec 13 12:16:38 2021 +0100 mips: kgdb: adjust the comment to the actual ifdef condition The comment refers to CONFIG_CPU_32BIT, but the ifdef uses CONFIG_32BIT. As this ifdef and comment was introduced with initial mips-kgdb commit 8854700115ec ("[MIPS] kgdb: add arch support for the kernel's kgdb core"), it is probably just a minor issue that was overlooked during the patch creation and refactoring before submission. This inconsistency was identified with ./scripts/checkkconfigsymbols.py. This script has been quite useful to identify a number of bugs with Kconfig symbols and deserves to be executed and checked regularly. So, adjust the comment to the actual ifdef condition to reduce the reports made the script and simplify to use this script, as new issues are easier to spot when the list of reports is shorter. Signed-off-by: Lukas Bulwahn Signed-off-by: Thomas Bogendoerfer commit 9a53a8d73c793aef9a4a3d1ff0aaf09b3d449970 Author: Lukas Bulwahn Date: Mon Dec 13 12:16:37 2021 +0100 mips: dec: provide the correctly capitalized config CPU_R4X00 in init error message The config for MIPS R4000-series processors is named CPU_R4X00 with upper-case X, not CPU_R4x00 as the error message suggests. Hence, ./scripts/checkkconfigsymbols.py reports this invalid reference: CPU_R4x00 Referencing files: arch/mips/dec/prom/init.c When human users encounter this error message, they probably just deal with this minor discrepancy; so, the spelling never was a big deal here. Still, the script ./scripts/checkkconfigsymbols.py has been quite useful to identify a number of bugs with Kconfig symbols and deserves to be executed and checked regularly. So, repair the error message to reduce the reports made the script and simplify to use this script, as new issues are easier to spot when the list of reports is shorter. Signed-off-by: Lukas Bulwahn Signed-off-by: Thomas Bogendoerfer commit 74320247811b4c721480fd99cc47a98284e1c9ee Author: Lukas Bulwahn Date: Mon Dec 13 12:16:36 2021 +0100 mips: drop selecting non-existing config NR_CPUS_DEFAULT_2 Commit c5eaff3e857e ("MIPS: Kconfig: Drop obsolete NR_CPUS_DEFAULT_{1,2} options") removed the config NR_CPUS_DEFAULT_2, as with this commit, the NR_CPUS default value is 2. Commit 7505576d1c1a ("MIPS: add support for SGI Octane (IP30)") introduces the config SGI_IP30, which selects the removed config NR_CPUS_DEFAULT_2, but this has actually no effect. Fortunately, NR_CPUS defaults to 2 when there is no specific NR_CPUS_DEFAULT_* config selected. So, the effect of the intended 'select NR_CPUS_DEFAULT_2' is achieved without further ado. Drop selecting the non-existing config NR_CPUS_DEFAULT_2. The issue was identified with ./scripts/checkkconfigsymbols.py. Fixes: 7505576d1c1a ("MIPS: add support for SGI Octane (IP30)") Signed-off-by: Lukas Bulwahn Signed-off-by: Thomas Bogendoerfer commit fd4eb90b164442cb1e9909f7845e12a0835ac699 Author: Lukas Bulwahn Date: Mon Dec 13 12:16:35 2021 +0100 mips: add SYS_HAS_CPU_MIPS64_R5 config for MIPS Release 5 support Commit ab7c01fdc3cf ("mips: Add MIPS Release 5 support") adds the two configs CPU_MIPS32_R5 and CPU_MIPS64_R5, which depend on the corresponding SYS_HAS_CPU_MIPS32_R5 and SYS_HAS_CPU_MIPS64_R5, respectively. The config SYS_HAS_CPU_MIPS32_R5 was already introduced with commit c5b367835cfc ("MIPS: Add support for XPA."); the config SYS_HAS_CPU_MIPS64_R5, however, was never introduced. Hence, ./scripts/checkkconfigsymbols.py warns: SYS_HAS_CPU_MIPS64_R5 Referencing files: arch/mips/Kconfig, arch/mips/include/asm/cpu-type.h Add the definition for config SYS_HAS_CPU_MIPS64_R5 under the assumption that SYS_HAS_CPU_MIPS64_R5 follows the same pattern as the existing SYS_HAS_CPU_MIPS32_R5 and SYS_HAS_CPU_MIPS64_R6. Fixes: ab7c01fdc3cf ("mips: Add MIPS Release 5 support") Signed-off-by: Lukas Bulwahn Signed-off-by: Thomas Bogendoerfer commit 6fb8a1b3203390d88ca2dfb3d0971a6c1217739e Author: Sander Vanheule Date: Wed Dec 15 21:06:02 2021 +0100 MIPS: drop selected EARLY_PRINTK configs for MACH_REALTEK_RTL MACH_REALTEK_RTL declares that the system supports early printk , but this is not actually implemented as intended. The system is left with a non-functional early0 console because the setup_8250_early_printk_port() call provided for MIPS_GENERIC is never used to set this up. Generic ns16550a earlycon works, so devices should use that for early output. This means that SYS_HAS_EARLY_PRINTK and USE_GENERIC_EARLY_PRINTK_8250 do not need to be selected. Additionally, as reported by Lukas Bulwahn, the selected symbol SYS_HAS_EARLY_PRINTK_8250 does not actually exist, so should also be dropped. Cc: Lukas Bulwahn Cc: Bert Vermeulen Signed-off-by: Sander Vanheule Signed-off-by: Thomas Bogendoerfer commit d563f4bac9914fca6f34711ad22647125e773dd0 Author: Biju Das Date: Wed Dec 8 10:40:26 2021 +0000 arm64: dts: renesas: rzg2l-smarc-som: Add vdd core regulator Add vdd core regulator (1.1 V). This patch add regulator support for gpu. The H/W manual mentions nothing about a gpu regulator. So using vdd core regulator for gpu. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211208104026.421-4-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit b6db8f72dddc79752585b115e478b47197ef5761 Author: Biju Das Date: Wed Dec 8 10:40:25 2021 +0000 arm64: dts: renesas: r9a07g044: Add Mali-G31 GPU node Add Mali-G31 GPU node to SoC DTSI. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211208104026.421-3-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 8ed567fbea94ad05298d060974d5fa59946cf689 Author: Dmitry Osipenko Date: Sat Dec 4 17:37:21 2021 +0300 ARM: config: multi v7: Enable NVIDIA Tegra20 APB DMA driver All Tegra20/30/114 serial and audio drivers depend on the Tegra20 APB DMA driver, enable this DMA driver. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 02e7cb574c21580eab3cffbcc863d3ac81787475 Author: Dmitry Osipenko Date: Sat Dec 4 17:37:20 2021 +0300 ARM: config: multi v7: Enable NVIDIA Tegra20 S/PDIF driver Enable Tegra20 S/PDIF driver that is a part of HDMI audio subsystem. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit d71329b69bb6dd853ee2ab0b39c9c013e706b49a Author: Dmitry Osipenko Date: Sat Dec 4 17:37:19 2021 +0300 ARM: tegra_defconfig: Enable S/PDIF driver Enable Tegra20 S/PDIF driver. It's a part of HDMI audio subsystem on Tegra. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 365ee8033142bea9ea326e5e08a6b80c6018beab Merge: 4a097f29fb529 fa0fdb78cb5d4 Author: Arnd Bergmann Date: Thu Dec 16 15:00:32 2021 +0100 Merge tag 'omap-for-v5.17/dt-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into arm/dt Devicetree changes for omaps for v5.17 merge window These changes are mostly minor non-urgent fixes for typos and binding checks. The system-power-controller gets configured for more am3 devices as it's not am335x-boneblack speicif. For for am437x we add magnetic card reader support. Note that the asahi-kasei,ak8975 binding changes may produce a new binding check warning as the binding related change is merged separately. * tag 'omap-for-v5.17/dt-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: dts: am335x: Use correct vendor prefix for Asahi Kasei Corp. ARM: dts: motorola-mapphone: Drop second ti,wlcore compatible value ARM: dts: am437x-gp-evm: enable ADC1 ARM: dts: am43xx: Describe the magnetic reader/ADC1 hardware module ARM: dts: am437x-cm-t43: Use a correctly spelled DT property ARM: dts: am335x-icev2: Add system-power-controller to RTC node ARM: dts: am335x-boneblack-common: move system-power-controller ARM: dts: elpida_ecb240abacn: Change Elpida compatible Link: https://lore.kernel.org/r/pull-1639659798-679261@atomide.com Signed-off-by: Arnd Bergmann commit 4a097f29fb5292e5dea7f2f089b71398e8fb2252 Merge: 5f424ff299ac7 8dce88fe80a85 Author: Arnd Bergmann Date: Thu Dec 16 14:51:42 2021 +0100 Merge tag 'socfpga_dts_update_for_v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux into arm/dt SoCFPGA dts updates for v5.17 - Update N5X to include qspi, usb and ethernet - Adjust NAND partition size for Agilex and Stratix10 * tag 'socfpga_dts_update_for_v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/dinguyen/linux: arm64: dts: Update NAND MTD partition for Agilex and Stratix 10 arm64: dts: n5x: add qspi, usb, and ethernet support Link: https://lore.kernel.org/r/20211215164545.300273-1-dinguyen@kernel.org Signed-off-by: Arnd Bergmann commit 9758ff2fa240173e9a45613b07774b7a78b7653e Merge: 0b665d4af3583 244a36e50da05 Author: Thomas Zimmermann Date: Thu Dec 16 14:47:38 2021 +0100 Merge drm/drm-next into drm-misc-next Backmerging for v5.16-rc5. Resolves a conflict between drm-misc-next and drm-misc-fixes in the vc4 driver. Signed-off-by: Thomas Zimmermann commit bc128349588d571b55bfec471a773e29cfcd2d73 Author: Mauro Carvalho Chehab Date: Thu Dec 16 13:17:35 2021 +0100 LICENSES/LGPL-2.1: Add LGPL-2.1-or-later as valid identifiers Some files have been flagged with the new LGPL-2.1-or-later identifier which replace the original LGPL-2.1+ in the SPDX license identifier specification, but the identifiers are not mentioned as valid in the LGPL-2.1 license file. Add it, together with the LGPL-2.1-only at the the license file. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/12f38ebde4dcd8b1ecbd37df1b6ce2018426f6dd.1639657049.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman commit d210919dbdc8a82c676cc3e3c370b1802be63124 Author: Dmitry Osipenko Date: Sat Dec 4 17:58:49 2021 +0300 drm/tegra: Add back arm_iommu_detach_device() DMA buffers of 2D/3D engines aren't mapped properly when CONFIG_ARM_DMA_USE_IOMMU=y. The memory management code of Tegra DRM driver has a longstanding overhaul overdue and it's not obvious where the problem is in this case. Hence let's add back the old workaround which we already had sometime before. It explicitly detaches DRM devices from the offending implicit IOMMU domain. This fixes a completely broken 2d/3d drivers in case of ARM32 multiplatform kernel config. Cc: stable@vger.kernel.org Fixes: fa6661b7aa0b ("drm/tegra: Optionally attach clients to the IOMMU") Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit f63c862587c9ba1c62de8c549e8f2fbe0fc88b6b Author: Herve Codina Date: Thu Dec 2 10:52:54 2021 +0100 irqchip/spear-shirq: Add support for IRQ 0..6 IRQ 0..7 are not supported by the driver for SPEAr320 SOC family. IRQ 0 is not reserved in SPEAr320 SOC (assigned to GPIOINT). Furthermore, in SPEAr320s SOC variant, IRQ 0..6 are assigned as follow: IRQ 6 - NGPIO_INTR: Combined status of edge programmable interrupts from GPIO ports IRQ 5 - TX_OR_INTR: I2S interrupt on Transmit FIFO overrun IRQ 4 - TX_EMP_INTR: I2S interrupt on Transmit FIFO empty IRQ 3 - RX_OR_INTR: I2S interrupt on Receive FIFO overrun IRQ 2 - RX_DA_INTR: I2S interrupt on data available in Receive FIFO IRQ 1 - Reserved IRQ 0 - GPIO_INTR: Legacy interrupt from GPIO ports Add support for these IRQs in SPEAr320 SOC family. Signed-off-by: Herve Codina Acked-by: Linus Walleij Acked-by: Arnd Bergmann Acked-by: Viresh Kumar Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211202095255.165797-6-herve.codina@bootlin.com commit d5185965c3b59073c4520bad7dd2adf725b9abba Author: Dmitry Osipenko Date: Sat Dec 4 17:58:48 2021 +0300 gpu: host1x: Add back arm_iommu_detach_device() Host1x DMA buffer isn't mapped properly when CONFIG_ARM_DMA_USE_IOMMU=y. The memory management code of Host1x driver has a longstanding overhaul overdue and it's not obvious where the problem is in this case. Hence let's add back the old workaround which we already had sometime before. It explicitly detaches Host1x device from the offending implicit IOMMU domain. This fixes a completely broken Host1x DMA in case of ARM32 multiplatform kernel config. Cc: stable@vger.kernel.org Fixes: af1cbfb9bf0f ("gpu: host1x: Support DMA mapping of buffers") Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 16e3613a39fd14d0a8888160acee612a31dd1a2a Merge: 0fcfb00b28c0b 835f442fdbce3 Author: Marc Zyngier Date: Thu Dec 16 13:24:24 2021 +0000 Merge branch irq/its-kexec-rt into irq/irqchip-next * irq/its-kexec-rt: : . : Series from Valentin Schneider, aiming at fixing the issues : the ITS driver has with PREEMPT_RT whilst trying to reserve : memory at early boot to support kexec. : . irqchip/gic-v3-its: Limit memreserve cpuhp state lifetime irqchip/gic-v3-its: Postpone LPI pending table freeing and memreserve irqchip/gic-v3-its: Give the percpu rdist struct its own flags field Signed-off-by: Marc Zyngier commit 83b7f0b8aeab4fc8271392fd32164efb7b3f55e9 Author: Dmitry Osipenko Date: Wed Dec 1 02:23:43 2021 +0300 ARM: tegra: Add OPP tables and power domains to Tegra20 device-trees Add OPP tables and power domains to all peripheral devices which support power management on Tegra20 SoC. Tested-by: Paul Fertser # PAZ00 T20 Tested-by: Nicolas Chauvet # PAZ00 T20 Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 835f442fdbce33a47a6bde356643fd7e3ef7ec1b Author: Valentin Schneider Date: Wed Oct 27 16:15:06 2021 +0100 irqchip/gic-v3-its: Limit memreserve cpuhp state lifetime The new memreserve cpuhp callback only needs to survive up until a point where every CPU in the system has booted once. Beyond that, it becomes a no-op and can be put in the bin. Signed-off-by: Valentin Schneider Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211027151506.2085066-4-valentin.schneider@arm.com commit d23bc2bc1d634658d7fa96395419c1c553a784f0 Author: Valentin Schneider Date: Wed Oct 27 16:15:05 2021 +0100 irqchip/gic-v3-its: Postpone LPI pending table freeing and memreserve Memory used by the LPI tables have to be made persistent for kexec to have a chance to work, as explained in [1]. If they have been made persistent and we are booting into a kexec'd kernel, we also need to free the pages that were preemptively allocated by the new kernel for those tables. Both of those operations currently happen during its_cpu_init(), which happens in a _STARTING (IOW atomic) cpuhp callback for secondary CPUs. efi_mem_reserve_iomem() issues a GFP_ATOMIC allocation, which unfortunately doesn't work under PREEMPT_RT (this ends up grabbing a non-raw spinlock, which can sleep under PREEMPT_RT). Similarly, freeing the pages ends up grabbing a sleepable spinlock. Since the memreserve is only required by kexec, it doesn't have to be done so early in the secondary boot process. Issue the reservation in a new CPUHP_AP_ONLINE_DYN cpuhp callback, and piggy-back the page freeing on top of it. A CPU gets to run the body of this new callback exactly once. As kexec issues a machine_shutdown() prior to machine_kexec(), it will be serialized vs a CPU being plugged to life by the hotplug machinery - either the CPU will have been brought up and have had its redistributor's pending table memreserved, or it never went online and will have its table allocated by the new kernel. [1]: https://lore.kernel.org/lkml/20180921195954.21574-1-marc.zyngier@arm.com/ Signed-off-by: Valentin Schneider Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211027151506.2085066-3-valentin.schneider@arm.com commit c0cdc89072a3e1ae3981437f385de14b7bba8fd8 Author: Valentin Schneider Date: Wed Oct 27 16:15:04 2021 +0100 irqchip/gic-v3-its: Give the percpu rdist struct its own flags field Later patches will require tracking some per-rdist status. Reuse the bytes "lost" to padding within the __percpu rdist struct as a flags field, and re-encode ->lpi_enabled within said flags. No change in functionality intended. Signed-off-by: Valentin Schneider Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211027151506.2085066-2-valentin.schneider@arm.com commit 3478494dcae155f0580e8f841458905f4fc739c2 Author: Dmitry Osipenko Date: Wed Dec 1 02:23:42 2021 +0300 ARM: tegra: Add 500 MHz entry to Tegra30 memory OPP table Extend memory OPPs with 500 MHz entry. This clock rate is used by ASUS Transformer tablets. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 58ed47adcabb4ce13a60f56230074805957822fa Author: Dmitry Osipenko Date: Wed Dec 1 02:23:25 2021 +0300 drm/tegra: Consolidate runtime PM management of older UAPI codepath Move runtime PM management of older UAPI code paths into the common place. This removes boilerplate code from client drivers. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 555ae37a5dd2a2703a83965dc26bc99a5db2ecbe Author: Dmitry Osipenko Date: Wed Dec 1 02:23:24 2021 +0300 drm/tegra: submit: Remove pm_runtime_enabled() checks Runtime PM is now universally available, make it mandatory by removing the pm_runtime_enabled() checks. Reviewed-by: Ulf Hansson Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 28b16229dbf15b3dbbbc5247ac1c514b373964d3 Author: Dmitry Osipenko Date: Wed Dec 1 02:23:23 2021 +0300 drm/tegra: nvdec: Stop channel on suspend CDMA must be stopped before hardware is suspended. Add channel stopping to RPM suspend callback. Add system level suspend-resume callbacks. Runtime PM initialization is moved to host1x client init phase because RPM callback now uses host1x channel that is available only when host1x client is registered. Reviewed-by: Ulf Hansson Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 1e15f5b911d6a1b4a5677e88527610946bd314dd Author: Dmitry Osipenko Date: Wed Dec 1 02:23:22 2021 +0300 drm/tegra: vic: Stop channel on suspend CDMA must be stopped before hardware is suspended. Add channel stopping to RPM suspend callback. Add system level suspend-resume callbacks. Runtime PM initialization is moved to host1x client init phase because RPM callback now uses host1x channel that is available only when host1x client is registered. Reviewed-by: Ulf Hansson Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 2421b20d659069ed6435b27a919e627b74c27e7e Author: Dmitry Osipenko Date: Wed Dec 1 02:23:21 2021 +0300 drm/tegra: gr3d: Support generic power domain and runtime PM Add runtime power management and support generic power domains. Reviewed-by: Ulf Hansson Tested-by: Peter Geis # Ouya T30 Tested-by: Paul Fertser # PAZ00 T20 Tested-by: Nicolas Chauvet # PAZ00 T20 and TK1 T124 Tested-by: Matt Merhar # Ouya T30 Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit e4e4a7104bd4cc753413bf56571cc99284d90bb4 Author: Dmitry Osipenko Date: Wed Dec 1 02:23:20 2021 +0300 drm/tegra: gr2d: Support generic power domain and runtime PM Add runtime power management and support generic power domains. Reviewed-by: Ulf Hansson Tested-by: Peter Geis # Ouya T30 Tested-by: Paul Fertser # PAZ00 T20 Tested-by: Nicolas Chauvet # PAZ00 T20 and TK1 T124 Tested-by: Matt Merhar # Ouya T30 Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 6efdde0cd08b8fe79f20e2c150260f19e762e4d0 Author: Dmitry Osipenko Date: Wed Dec 1 02:23:19 2021 +0300 drm/tegra: hdmi: Add OPP support The HDMI on Tegra belongs to the core power domain and we're going to enable GENPD support for the core domain. Now HDMI driver must use OPP API for driving the controller's clock rate because OPP API takes care of reconfiguring the domain's performance state based on HDMI clock rate. Add OPP support to the HDMI driver. Reviewed-by: Ulf Hansson Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 4ce3048c0a622978436e04b47eade8c45e1e8a75 Author: Dmitry Osipenko Date: Wed Dec 1 02:23:18 2021 +0300 drm/tegra: dc: Support OPP and SoC core voltage scaling Add OPP and SoC core voltage scaling support to the display controller driver. This is required for enabling system-wide DVFS on pre-Tegra186 SoCs. Reviewed-by: Ulf Hansson Tested-by: Peter Geis # Ouya T30 Tested-by: Paul Fertser # PAZ00 T20 Tested-by: Nicolas Chauvet # PAZ00 T20 and TK1 T124 Tested-by: Matt Merhar # Ouya T30 Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit a21115dd38c6cf396ba39aefd561e7903ca6149d Author: Dmitry Osipenko Date: Wed Dec 1 02:23:17 2021 +0300 drm/tegra: submit: Add missing pm_runtime_mark_last_busy() Runtime PM auto-suspension doesn't work without pm_runtime_mark_last_busy(), add it. Cc: Reviewed-by: Ulf Hansson Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 9ca790f44606109071ab1a3a37ed99e91794c37c Author: Dmitry Osipenko Date: Wed Dec 1 02:23:16 2021 +0300 gpu: host1x: Add host1x_channel_stop() Add host1x_channel_stop() which waits till channel becomes idle and then stops the channel hardware. This is needed for supporting suspend/resume by host1x drivers since the hardware state is lost after power-gating, thus the channel needs to be stopped before client enters into suspend. Tested-by: Peter Geis # Ouya T30 Tested-by: Paul Fertser # PAZ00 T20 Tested-by: Nicolas Chauvet # PAZ00 T20 and TK1 T124 Tested-by: Matt Merhar # Ouya T30 Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 6b6776e2ab8ac7086cf31ad339411df7681715b7 Author: Dmitry Osipenko Date: Wed Dec 1 02:23:15 2021 +0300 gpu: host1x: Add initial runtime PM and OPP support Add runtime PM and OPP support to the Host1x driver. For the starter we will keep host1x always-on because dynamic power management require a major refactoring of the driver code since lot's of code paths are missing the RPM handling and we're going to remove some of these paths in the future. Reviewed-by: Ulf Hansson Tested-by: Peter Geis # Ouya T30 Tested-by: Paul Fertser # PAZ00 T20 Tested-by: Nicolas Chauvet # PAZ00 T20 and TK1 T124 Tested-by: Matt Merhar # Ouya T30 Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit d53830eec05561a0e9918fff8df3861bde74d159 Author: Thierry Reding Date: Thu Dec 16 09:56:11 2021 +0100 drm/tegra: vic: Handle tegra_drm_alloc() failure This function can return one of several errors in an ERR_PTR()-encoded pointer, so make sure to propogate those on failure. Suggested-by: Robin Murphy Signed-off-by: Thierry Reding commit 4abfc0e3a5460499ce1062cf94089490aade7ca4 Author: Robin Murphy Date: Fri Dec 10 17:54:43 2021 +0000 gpu: host1x: Add missing DMA API include Host1x seems to be relying on picking up dma-mapping.h transitively from iova.h, which has no reason to include it in the first place. Fix the former issue before we totally break things by fixing the latter one. CC: Thierry Reding CC: Mikko Perttunen CC: dri-devel@lists.freedesktop.org Signed-off-by: Robin Murphy Signed-off-by: Thierry Reding commit 5566174cb10a5167d59b0793871cab7990b149b8 Author: Robin Murphy Date: Fri Dec 10 17:54:44 2021 +0000 drm/tegra: vic: Fix DMA API misuse Upon failure, dma_alloc_coherent() returns NULL. If that does happen, passing some uninitialised stack contents to dma_mapping_error() - which belongs to a different API in the first place - has precious little chance of detecting it. Also include the correct header, because the fragile transitive inclusion currently providing it is going to break soon. Fixes: 20e7dce255e9 ("drm/tegra: Remove memory allocation from Falcon library") CC: Thierry Reding CC: Mikko Perttunen CC: dri-devel@lists.freedesktop.org Signed-off-by: Robin Murphy Reviewed-by: Christoph Hellwig Signed-off-by: Thierry Reding commit 20c5a613185c98068e9ee5b011fb556dabd86e6e Author: Dmitry Osipenko Date: Sat Dec 4 17:37:18 2021 +0300 drm/tegra: hdmi: Register audio CODEC on Tegra20 Tegra20 SoC supports only S/PDIF source for HDMI audio. Register ASoC HDMI S/PDIF CODEC for Tegra20, it will be linked with the S/PDIF CPU DAI. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 7e67e986194a3648bf471e16f89cb5f61377bb4f Author: Dmitry Osipenko Date: Sat Dec 4 17:37:17 2021 +0300 drm/tegra: hdmi: Unwind tegra_hdmi_init() errors Add missing error unwinding to tegra_hdmi_init(), for consistency. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit e1189fafa5a1c49407a1bc01d850cc6dd52c058d Author: Arnd Bergmann Date: Wed Oct 13 16:41:36 2021 +0200 drm/tegra: Mark nvdec PM functions as __maybe_unused The resume helper is called conditionally and causes a harmless warning when stubbed out: drivers/gpu/drm/tegra/nvdec.c:240:12: error: 'nvdec_runtime_resume' defined but not used [-Werror=unused-function] 240 | static int nvdec_runtime_resume(struct device *dev) Mark both suspend and resume as __maybe_unused for consistency to avoid this warning. Fixes: e76599df354d ("drm/tegra: Add NVDEC driver") Signed-off-by: Arnd Bergmann Signed-off-by: Thierry Reding commit 2245c2a2722be04ed15012d169a7ceb7df7550a7 Author: Arnd Bergmann Date: Wed Oct 13 16:40:58 2021 +0200 drm/tegra: Mark nvdec_writel() as inline Without CONFIG_IOMMU_API, the nvdec_writel() function is unused, causing a warning: drivers/gpu/drm/tegra/nvdec.c:48:13: error: 'nvdec_writel' defined but not used [-Werror=unused-function] 48 | static void nvdec_writel(struct nvdec *nvdec, u32 value, unsigned int offset) | ^~~~~~~~~~~~ As this is a trivial wrapper around an inline function, mark it as inline itself, which avoids the warning as well. Fixes: e76599df354d ("drm/tegra: Add NVDEC driver") Signed-off-by: Arnd Bergmann Signed-off-by: Thierry Reding commit 0c921b6d4ba06bc899fd84d3ce1c1afd3d00bc1c Author: Dmitry Osipenko Date: Thu Sep 30 01:28:05 2021 +0300 drm/tegra: dc: rgb: Allow changing PLLD rate on Tegra30+ Asus Transformer TF700T is a Tegra30 tablet device which uses RGB->DSI bridge that requires a precise clock rate in order to operate properly. Tegra30 has a dedicated PLL for each display controller, hence the PLL rate can be changed freely. Allow PLL rate changes on Tegra30+ for RGB output. Configure the clock rate before display controller is enabled since DC itself may be running off this PLL and it's not okay to change the rate of the active PLL that doesn't support dynamic frequency switching since hardware will hang. Tested-by: Maxim Schwalm #TF700T Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 0f52fc3fc97d7e083f498f4be95b049dd94a6ef6 Author: Wan Jiabing Date: Mon Apr 19 19:18:26 2021 +0800 drm/tegra: Remove duplicate struct declaration struct tegra_dc is declared at 13rd line. The declaration here is unnecessary. Remove it. Signed-off-by: Wan Jiabing Signed-off-by: Thierry Reding commit b03d6403072edae18a7eb5359eaf8e7efd3d2bb9 Author: Mikko Perttunen Date: Wed Aug 11 13:59:54 2021 +0300 drm/tegra: vic: Use autosuspend When going idle, it's not unlikely that more work will follow. As such, use autosuspend with a 500ms suspend delay. Signed-off-by: Mikko Perttunen Signed-off-by: Thierry Reding commit 271fca025a6d43f1c18a48543c5aaf31a31e4694 Author: Thierry Reding Date: Thu Jul 8 16:37:36 2021 +0200 drm/tegra: gr2d: Explicitly control module reset As of commit 4782c0a5dd88 ("clk: tegra: Don't deassert reset on enabling clocks"), module resets are no longer automatically deasserted when the module clock is enabled. To make sure that the gr2d module continues to work, we need to explicitly control the module reset. Fixes: 4782c0a5dd88 ("clk: tegra: Don't deassert reset on enabling clocks") Signed-off-by: Thierry Reding commit 6c7a388b62366f0de9936db3c1921d7f4e0011bc Author: Arnd Bergmann Date: Mon Sep 27 11:36:59 2021 +0200 gpu: host1x: select CONFIG_DMA_SHARED_BUFFER Linking fails when dma-buf is disabled: ld.lld: error: undefined symbol: dma_fence_release >>> referenced by fence.c >>> gpu/host1x/fence.o:(host1x_syncpt_fence_enable_signaling) in archive drivers/built-in.a >>> referenced by fence.c >>> gpu/host1x/fence.o:(host1x_fence_signal) in archive drivers/built-in.a >>> referenced by fence.c >>> gpu/host1x/fence.o:(do_fence_timeout) in archive drivers/built-in.a Fixes: 687db2207b1b ("gpu: host1x: Add DMA fence implementation") Signed-off-by: Arnd Bergmann Reviewed-by: Mikko Perttunen Signed-off-by: Thierry Reding commit ab3c971d2fd33f49a5c99c30cde8f50bb2b541d3 Author: Randy Dunlap Date: Mon Oct 4 22:37:26 2021 -0700 gpu: host1x: Drop excess kernel-doc entry @key Fix kernel-doc warning in host1x: ../drivers/gpu/host1x/bus.c:774: warning: Excess function parameter 'key' description in '__host1x_client_register' Fixes: 0cfe5a6e758f ("gpu: host1x: Split up client initalization and registration") Signed-off-by: Randy Dunlap Cc: Thierry Reding Cc: dri-devel@lists.freedesktop.org Cc: linux-tegra@vger.kernel.org Cc: David Airlie Cc: Daniel Vetter Signed-off-by: Thierry Reding commit f7d6c6aee5b4f11de9f9fda8896b52a8107ec835 Author: Dmitry Osipenko Date: Thu Sep 30 01:28:04 2021 +0300 drm/tegra: dc: rgb: Move PCLK shifter programming to CRTC Asus TF700T tablet uses TC358768 DPI->DSI bridge that sits between Tegra's DPI output and display panel input. Bridge requires to have stable PCLK output before RGB encoder is enabled because it uses PCLK by itself to clock internal logic and bridge is programmed before Tegra's encoder is enabled. Hence the PCLK clock shifter must be programmed when CRTC is enabled, otherwise clock is unstable and bridge hangs because of it. Move the shifter programming from RGB encoder into CRTC. Tested-by: Maxim Schwalm #TF700T Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit e97a951f194c218aaec34631dca40fcb0c85f309 Author: Mikko Perttunen Date: Thu Sep 16 18:09:20 2021 +0300 drm/tegra: Bump VIC/NVDEC clock rates to Fmax To get full performance out of these engines, bump their clock rates to maximum. In the future we may want something smarter but this should be fine for now. Signed-off-by: Mikko Perttunen Signed-off-by: Thierry Reding commit 46f226c93d35b936aeec6eb31da932dc2e86f413 Author: Mikko Perttunen Date: Thu Sep 16 17:55:17 2021 +0300 drm/tegra: Add NVDEC driver Add support for booting and using NVDEC on Tegra210, Tegra186 and Tegra194 to the Host1x and TegraDRM drivers. Booting in secure mode is not currently supported. Signed-off-by: Mikko Perttunen Signed-off-by: Thierry Reding commit cae7472e4fb965aaa86bc9b7b6f4b739f09c178d Author: Thierry Reding Date: Thu Sep 9 14:07:57 2021 +0200 drm/tegra: Support asynchronous commits for cursor This adds support for asynchronously updating the cursor plane, which enables support for the legacy cursor IOCTLs. Signed-off-by: Thierry Reding commit ee423808990d6fa6b367561a2390ad99b1551d6b Author: Thierry Reding Date: Thu Sep 9 14:10:23 2021 +0200 drm/tegra: Propagate errors from drm_gem_plane_helper_prepare_fb() Currently this function doesn't return an error, but that may change in the future, so make sure to propagate any error codes that it might return. Signed-off-by: Thierry Reding commit 40dc962dfb9ebb389c9853b0198d52bcf629986b Author: Thierry Reding Date: Thu Sep 9 14:08:24 2021 +0200 drm/tegra: Do not reference tegra_plane_funcs directly Instead of referencing the tegra_plane_funcs struct directly, use each plane's vtable instead. This makes it more future-proof in case any of the planes ever use a different set of functions. Signed-off-by: Thierry Reding commit 1f39b1dfa53c84b56d7ad37fed44afda7004959d Author: Thierry Reding Date: Fri Feb 7 16:50:52 2020 +0100 drm/tegra: Implement buffer object cache This cache is used to avoid mapping and unmapping buffer objects unnecessarily. Mappings are cached per client and stay hot until the buffer object is destroyed. Signed-off-by: Thierry Reding commit c6aeaf56f468a565f6d2f27325fc07d35cdcd3cb Author: Thierry Reding Date: Thu Sep 9 15:51:24 2021 +0200 drm/tegra: Implement correct DMA-BUF semantics DMA-BUF requires that each device that accesses a DMA-BUF attaches to it separately. To do so the host1x_bo_pin() and host1x_bo_unpin() functions need to be reimplemented so that they can return a mapping, which either represents an attachment or a map of the driver's own GEM object. Signed-off-by: Thierry Reding commit 7a56783850772feb2cbf1dabdce617f5941a57c0 Merge: 136057256686d 9131c63317265 Author: Thierry Reding Date: Thu Dec 16 14:06:54 2021 +0100 Merge branch 'tegra-for-5.17-soc-opp' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into drm/tegra/for-next commit 43d8ac22125e365c2df85ffff503129567350c21 Merge: ce5b5b05c1680 52b28657ebd7c Author: Marc Zyngier Date: Thu Dec 16 13:06:09 2021 +0000 Merge branch kvm-arm64/pkvm-hyp-sharing into kvmarm-master/next * kvm-arm64/pkvm-hyp-sharing: : . : Series from Quentin Perret, implementing HYP page share/unshare: : : This series implements an unshare hypercall at EL2 in nVHE : protected mode, and makes use of it to unmmap guest-specific : data-structures from EL2 stage-1 during guest tear-down. : Crucially, the implementation of the share and unshare : routines use page refcounts in the host kernel to avoid : accidentally unmapping data-structures that overlap a common : page. : [...] : . KVM: arm64: pkvm: Unshare guest structs during teardown KVM: arm64: Expose unshare hypercall to the host KVM: arm64: Implement do_unshare() helper for unsharing memory KVM: arm64: Implement __pkvm_host_share_hyp() using do_share() KVM: arm64: Implement do_share() helper for sharing memory KVM: arm64: Introduce wrappers for host and hyp spin lock accessors KVM: arm64: Extend pkvm_page_state enumeration to handle absent pages KVM: arm64: pkvm: Refcount the pages shared with EL2 KVM: arm64: Introduce kvm_share_hyp() KVM: arm64: Implement kvm_pgtable_hyp_unmap() at EL2 KVM: arm64: Hook up ->page_count() for hypervisor stage-1 page-table KVM: arm64: Fixup hyp stage-1 refcount KVM: arm64: Refcount hyp stage-1 pgtable pages KVM: arm64: Provide {get,put}_page() stubs for early hyp allocator Signed-off-by: Marc Zyngier commit e0abae19535504cc012a32c98619c07ace8a91aa Author: Dmitry Osipenko Date: Wed Dec 1 02:23:34 2021 +0300 media: staging: tegra-vde: Support generic power domain Currently driver supports legacy power domain API, this patch adds generic power domain support. This allows us to utilize a modern GENPD API for newer device-trees. Reviewed-by: Ulf Hansson Tested-by: Peter Geis # Ouya T30 Tested-by: Paul Fertser # PAZ00 T20 Tested-by: Nicolas Chauvet # PAZ00 T20 and TK1 T124 Tested-by: Matt Merhar # Ouya T30 Acked-by: Hans Verkuil Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 07f837554bb59c17729951c12d3564d05d0ff4bb Author: Dmitry Osipenko Date: Wed Dec 1 02:23:31 2021 +0300 spi: tegra20-slink: Add OPP support The SPI on Tegra belongs to the core power domain and we're going to enable GENPD support for the core domain. Now SPI driver must use OPP API for driving the controller's clock rate because OPP API takes care of reconfiguring the domain's performance state in accordance to the rate. Add OPP support to the driver. Acked-by: Mark Brown Reviewed-by: Ulf Hansson Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 6902dc2fd57c9d72418f82e00a2af6d2ee7c7e0d Author: Dmitry Osipenko Date: Wed Dec 1 02:23:30 2021 +0300 mtd: rawnand: tegra: Add runtime PM and OPP support The NAND on Tegra belongs to the core power domain and we're going to enable GENPD support for the core domain. Now NAND must be resumed using runtime PM API in order to initialize the NAND power state. Add runtime PM and OPP support to the NAND driver. Reviewed-by: Ulf Hansson Acked-by: Miquel Raynal Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit d618978dd4d33ec3920aeca8efbfb5f59fbe7df0 Author: Dmitry Osipenko Date: Wed Dec 1 02:23:29 2021 +0300 mmc: sdhci-tegra: Add runtime PM and OPP support The SDHCI on Tegra belongs to the core power domain and we're going to enable GENPD support for the core domain. Now SDHCI must be resumed using runtime PM API in order to initialize the SDHCI power state. The SDHCI clock rate must be changed using OPP API that will reconfigure the power domain performance state in accordance to the rate. Add runtime PM and OPP support to the SDHCI driver. Reviewed-by: Ulf Hansson Signed-off-by: Dmitry Osipenko Acked-by: Adrian Hunter Signed-off-by: Thierry Reding commit 3da9b0feaa1617061eddfd0eedcc24164c71528a Author: Dmitry Osipenko Date: Wed Dec 1 02:23:28 2021 +0300 pwm: tegra: Add runtime PM and OPP support The PWM on Tegra belongs to the core power domain and we're going to enable GENPD support for the core domain. Now PWM must be resumed using runtime PM API in order to initialize the PWM power state. The PWM clock rate must be changed using OPP API that will reconfigure the power domain performance state in accordance to the rate. Add runtime PM and OPP support to the PWM driver. Reviewed-by: Ulf Hansson Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 59caf73284d11188d5e6a4ad25ab4678c05ef639 Author: Dmitry Osipenko Date: Wed Dec 1 02:23:27 2021 +0300 bus: tegra-gmi: Add runtime PM and OPP support The GMI bus on Tegra belongs to the core power domain and we're going to enable GENPD support for the core domain. Now GMI must be resumed using runtime PM API in order to initialize the GMI power state. Add runtime PM and OPP support to the GMI driver. Reviewed-by: Ulf Hansson Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 8b85e11c1a7a75007e027efd1dbc5add689aa5a0 Author: Dmitry Osipenko Date: Wed Dec 1 02:23:26 2021 +0300 usb: chipidea: tegra: Add runtime PM and OPP support The Tegra USB controller belongs to the core power domain and we're going to enable GENPD support for the core domain. Now USB controller must be resumed using runtime PM API in order to initialize the USB power state. We already support runtime PM for the CI device, but CI's PM is separated from the RPM managed by tegra-usb driver. Add runtime PM and OPP support to the driver. Acked-by: Peter Chen Reviewed-by: Ulf Hansson Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit c132bc881f2f032fe5f082cec71d848f7e812366 Merge: fa55b7dcdc43c 9131c63317265 Author: Thierry Reding Date: Thu Dec 16 14:05:06 2021 +0100 Merge branch 'tegra-for-5.17-soc-opp' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into for-5.17/drivers commit 81c4c86c66650f61c6d7a712737d43a3e4d072bf Author: Dmitry Osipenko Date: Wed Dec 1 02:23:39 2021 +0300 soc/tegra: pmc: Rename core power domain CORE power domain uses name of device-tree node, which is inconsistent with the names of PMC domains. Set the name to "core" to make it consistent. Reviewed-by: Ulf Hansson Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 9131c6331726514f0d0364c41f8733cc5eec11ab Author: Dmitry Osipenko Date: Wed Dec 1 02:23:09 2021 +0300 soc/tegra: Add devm_tegra_core_dev_init_opp_table_common() Only couple drivers need to get the -ENODEV error code and majority of drivers need to explicitly initialize the performance state. Add new common helper which sets up OPP table for these drivers. Reviewed-by: Ulf Hansson Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 8d1a3411da0c90f506c5e2f69529f4ba2954d3a3 Author: Dmitry Osipenko Date: Wed Dec 1 02:23:38 2021 +0300 soc/tegra: pmc: Rename 3d power domains Device-tree schema doesn't allow domain name to start with a number. We don't use 3d domain yet in device-trees, so rename it to the name used by Tegra TRMs: TD, TD2. Reported-by: David Heidelberg Reviewed-by: Ulf Hansson Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 006da96c840ff60a1764fc38ee7adc3dc4191d79 Author: Dmitry Osipenko Date: Wed Dec 1 02:23:08 2021 +0300 soc/tegra: Enable runtime PM during OPP state-syncing GENPD core now can set up domain's performance state properly while device is RPM-suspended. Runtime PM of a device must be enabled during setup because GENPD checks whether device is suspended and check doesn't work while RPM is disabled. Instead of replicating the boilerplate RPM-enable code around OPP helper for each driver, let's make OPP helper to take care of enabling it. Reviewed-by: Ulf Hansson Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 80ef351c98714bb95bafd30b3faa6f11d8d58eb7 Author: Dmitry Osipenko Date: Wed Dec 1 02:23:37 2021 +0300 soc/tegra: regulators: Prepare for suspend Depending on hardware version, Tegra SoC may require a higher voltages during resume from system suspend, otherwise hardware will crash. Set SoC voltages to a nominal levels during suspend. Link: https://lore.kernel.org/all/a8280b5b-7347-8995-c97b-10b798cdf057@gmail.com/ Reviewed-by: Ulf Hansson Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 88724b78a84c85350c21ac8d4432f2cf5a77a10a Author: Dmitry Osipenko Date: Wed Dec 1 02:23:36 2021 +0300 soc/tegra: fuse: Use resource-managed helpers Use resource-managed helpers to make code cleaner and more correct, properly releasing all resources in case of driver probe error. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit aeecc50ace0480e6df565093e578b129902918db Author: Dmitry Osipenko Date: Wed Dec 1 02:23:35 2021 +0300 soc/tegra: fuse: Reset hardware The FUSE controller is enabled at a boot time. Reset it in order to put hardware and clock into clean and disabled state. Reviewed-by: Ulf Hansson Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 765d95f8ac54af611c804bb956b79391cfc1d27b Author: Jon Hunter Date: Tue Nov 30 11:44:06 2021 +0000 soc/tegra: pmc: Add reboot notifier The Tegra PMC driver implements a restart handler that supports Tegra specific reboot commands such as placing the device into 'recovery' mode in order to reprogram the platform. This is accomplished by setting the appropriate bit in the PMC scratch0 register prior to rebooting the platform. For Tegra platforms that support PSCI or EFI, the default Tegra restart handler is not called and the PSCI or EFI restart handler is called instead. Hence, for Tegra platforms that support PSCI or EFI, the Tegra specific reboot commands do not currently work. Fix this by moving the code that programs the PMC scratch0 register into a separate reboot notifier that will always be called on reboot. Signed-off-by: Jon Hunter Reviewed-by: Dmitry Osipenko Tested-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 66209e6fbd564f1bb3c69248423e4b761904a943 Author: Dmitry Osipenko Date: Wed Dec 1 02:23:10 2021 +0300 soc/tegra: Don't print error message when OPPs not available Previously we assumed that devm_tegra_core_dev_init_opp_table() will be used only by drivers that will always have device with OPP table, but this is not true anymore. For example now Tegra30 will have OPP table for PWM, but Tegra20 not and both use the same driver. Hence let's not print the error message about missing OPP table in the common helper, we can print it elsewhere. Reviewed-by: Ulf Hansson Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 52b28657ebd7cd20e931ce71190f235d0fa018a6 Author: Quentin Perret Date: Wed Dec 15 16:12:31 2021 +0000 KVM: arm64: pkvm: Unshare guest structs during teardown Make use of the newly introduced unshare hypercall during guest teardown to unmap guest-related data structures from the hyp stage-1. Signed-off-by: Quentin Perret Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211215161232.1480836-15-qperret@google.com commit b8cc6eb5bded7078f796b2ebf548f79850281eb6 Author: Will Deacon Date: Wed Dec 15 16:12:30 2021 +0000 KVM: arm64: Expose unshare hypercall to the host Introduce an unshare hypercall which can be used to unmap memory from the hypervisor stage-1 in nVHE protected mode. This will be useful to update the EL2 ownership state of pages during guest teardown, and avoids keeping dangling mappings to unreferenced portions of memory. Signed-off-by: Will Deacon Signed-off-by: Quentin Perret Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211215161232.1480836-14-qperret@google.com commit 376a240f037959c2b9a2486e53bcd8d388cbec17 Author: Will Deacon Date: Wed Dec 15 16:12:29 2021 +0000 KVM: arm64: Implement do_unshare() helper for unsharing memory Tearing down a previously shared memory region results in the borrower losing access to the underlying pages and returning them to the "owned" state in the owner. Implement a do_unshare() helper, along the same lines as do_share(), to provide this functionality for the host-to-hyp case. Reviewed-by: Andrew Walbran Signed-off-by: Will Deacon Signed-off-by: Quentin Perret Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211215161232.1480836-13-qperret@google.com commit 1ee32109fd78720259f7431740897d37ebcd84f6 Author: Will Deacon Date: Wed Dec 15 16:12:28 2021 +0000 KVM: arm64: Implement __pkvm_host_share_hyp() using do_share() __pkvm_host_share_hyp() shares memory between the host and the hypervisor so implement it as an invocation of the new do_share() mechanism. Note that double-sharing is no longer permitted (as this allows us to reduce the number of page-table walks significantly), but is thankfully no longer relied upon by the host. Signed-off-by: Will Deacon Signed-off-by: Quentin Perret Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211215161232.1480836-12-qperret@google.com commit e82edcc75c4e2389a3d7223c4ef1737bd9a07e5d Author: Will Deacon Date: Wed Dec 15 16:12:27 2021 +0000 KVM: arm64: Implement do_share() helper for sharing memory By default, protected KVM isolates memory pages so that they are accessible only to their owner: be it the host kernel, the hypervisor at EL2 or (in future) the guest. Establishing shared-memory regions between these components therefore involves a transition for each page so that the owner can share memory with a borrower under a certain set of permissions. Introduce a do_share() helper for safely sharing a memory region between two components. Currently, only host-to-hyp sharing is implemented, but the code is easily extended to handle other combinations and the permission checks for each component are reusable. Reviewed-by: Andrew Walbran Signed-off-by: Will Deacon Signed-off-by: Quentin Perret Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211215161232.1480836-11-qperret@google.com commit 61d99e33e757a21b47b8b130e49dcbdfaa5d2b1c Author: Will Deacon Date: Wed Dec 15 16:12:26 2021 +0000 KVM: arm64: Introduce wrappers for host and hyp spin lock accessors In preparation for adding additional locked sections for manipulating page-tables at EL2, introduce some simple wrappers around the host and hypervisor locks so that it's a bit easier to read and bit more difficult to take the wrong lock (or even take them in the wrong order). Signed-off-by: Will Deacon Signed-off-by: Quentin Perret Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211215161232.1480836-10-qperret@google.com commit 3d467f7b8c0a179a10aa4e9f17cd2d3c3b7e5403 Author: Will Deacon Date: Wed Dec 15 16:12:25 2021 +0000 KVM: arm64: Extend pkvm_page_state enumeration to handle absent pages Explicitly name the combination of SW0 | SW1 as reserved in the pte and introduce a new PKVM_NOPAGE meta-state which, although not directly stored in the software bits of the pte, can be used to represent an entry for which there is no underlying page. This is distinct from an invalid pte, as stage-2 identity mappings for the host are created lazily and so an invalid pte there is the same as a valid mapping for the purposes of ownership information. This state will be used for permission checking during page transitions in later patches. Reviewed-by: Andrew Walbran Signed-off-by: Will Deacon Signed-off-by: Quentin Perret Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211215161232.1480836-9-qperret@google.com commit a83e2191b7f1894dd0b4b3816ceb9caf4e0cd7e5 Author: Quentin Perret Date: Wed Dec 15 16:12:24 2021 +0000 KVM: arm64: pkvm: Refcount the pages shared with EL2 In order to simplify the page tracking infrastructure at EL2 in nVHE protected mode, move the responsibility of refcounting pages that are shared multiple times on the host. In order to do so, let's create a red-black tree tracking all the PFNs that have been shared, along with a refcount. Acked-by: Will Deacon Signed-off-by: Quentin Perret Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211215161232.1480836-8-qperret@google.com commit 3f868e142c0bb052a1c15fd3ceca1391604e2e69 Author: Quentin Perret Date: Wed Dec 15 16:12:23 2021 +0000 KVM: arm64: Introduce kvm_share_hyp() The create_hyp_mappings() function can currently be called at any point in time. However, its behaviour in protected mode changes widely depending on when it is being called. Prior to KVM init, it is used to create the temporary page-table used to bring-up the hypervisor, and later on it is transparently turned into a 'share' hypercall when the kernel has lost control over the hypervisor stage-1. In order to prepare the ground for also unsharing pages with the hypervisor during guest teardown, introduce a kvm_share_hyp() function to make it clear in which places a share hypercall should be expected, as we will soon need a matching unshare hypercall in all those places. Signed-off-by: Quentin Perret Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211215161232.1480836-7-qperret@google.com commit 82bb02445de57bb3072052705f6f5dea9465592e Author: Will Deacon Date: Wed Dec 15 16:12:22 2021 +0000 KVM: arm64: Implement kvm_pgtable_hyp_unmap() at EL2 Implement kvm_pgtable_hyp_unmap() which can be used to remove hypervisor stage-1 mappings at EL2. Signed-off-by: Will Deacon Signed-off-by: Quentin Perret Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211215161232.1480836-6-qperret@google.com commit 34ec7cbf1ee0c45e66a0c24311bcd5b83b7109f5 Author: Will Deacon Date: Wed Dec 15 16:12:21 2021 +0000 KVM: arm64: Hook up ->page_count() for hypervisor stage-1 page-table kvm_pgtable_hyp_unmap() relies on the ->page_count() function callback being provided by the memory-management operations for the page-table. Wire up this callback for the hypervisor stage-1 page-table. Signed-off-by: Will Deacon Signed-off-by: Quentin Perret Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211215161232.1480836-5-qperret@google.com commit d6b4bd3f4897f3b60ac9e8c9e2f0300e739b3392 Author: Quentin Perret Date: Wed Dec 15 16:12:20 2021 +0000 KVM: arm64: Fixup hyp stage-1 refcount In nVHE-protected mode, the hyp stage-1 page-table refcount is broken due to the lack of refcount support in the early allocator. Fix-up the refcount in the finalize walker, once the 'hyp_vmemmap' is up and running. Acked-by: Will Deacon Signed-off-by: Quentin Perret Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211215161232.1480836-4-qperret@google.com commit 2ea2ff91e82293909d4879b0b4c6c94b02d52b7e Author: Quentin Perret Date: Wed Dec 15 16:12:19 2021 +0000 KVM: arm64: Refcount hyp stage-1 pgtable pages To prepare the ground for allowing hyp stage-1 mappings to be removed at run-time, update the KVM page-table code to maintain a correct refcount using the ->{get,put}_page() function callbacks. Signed-off-by: Quentin Perret Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211215161232.1480836-3-qperret@google.com commit 1fac3cfb9cc60d71b66ee5127b2bc5b5f9f79df8 Author: Quentin Perret Date: Wed Dec 15 16:12:18 2021 +0000 KVM: arm64: Provide {get,put}_page() stubs for early hyp allocator In nVHE protected mode, the EL2 code uses a temporary allocator during boot while re-creating its stage-1 page-table. Unfortunately, the hyp_vmmemap is not ready to use at this stage, so refcounting pages is not possible. That is not currently a problem because hyp stage-1 mappings are never removed, which implies refcounting of page-table pages is unnecessary. In preparation for allowing hypervisor stage-1 mappings to be removed, provide stub implementations for {get,put}_page() in the early allocator. Acked-by: Will Deacon Signed-off-by: Quentin Perret Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211215161232.1480836-2-qperret@google.com commit ce5b5b05c16802a27cbf12fbce1446eb4998f975 Merge: 7b6871f670028 440523b92be6a Author: Marc Zyngier Date: Thu Dec 16 12:54:12 2021 +0000 Merge branch kvm-arm64/vgic-fixes-5.17 into kvmarm-master/next * kvm-arm64/vgic-fixes-5.17: : . : A few vgic fixes: : - Harden vgic-v3 error handling paths against signed vs unsigned : comparison that will happen once the xarray-based vcpus are in : - Demote userspace-triggered console output to kvm_debug() : . KVM: arm64: vgic: Demote userspace-triggered console prints to kvm_debug() KVM: arm64: vgic-v3: Fix vcpu index comparison Signed-off-by: Marc Zyngier commit 3511989cd22b06599b98e2566ecb571b846ffb86 Author: Kees Cook Date: Wed Dec 15 15:25:13 2021 -0800 iio: stmpe-adc: Use correctly sized arguments for bit field The find.h APIs are designed to be used only on unsigned long arguments. This can technically result in a over-read, but it is harmless in this case. Regardless, fix it to avoid the warning seen under -Warray-bounds, which we'd like to enable globally: In file included from ./include/linux/bitmap.h:9, 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/swait.h:7, from ./include/linux/completion.h:12, from drivers/iio/adc/stmpe-adc.c:10: drivers/iio/adc/stmpe-adc.c: In function 'stmpe_adc_probe': ./include/linux/find.h:98:23: warning: array subscript 'long unsigned int[0]' is partly outside array bounds of 'u32[1]' {aka 'unsigned int[1]'} [-Warray-bounds] 98 | val = *addr | ~GENMASK(size - 1, offset); | ^~~~~ drivers/iio/adc/stmpe-adc.c:258:13: note: while referencing 'norequest_mask' 258 | u32 norequest_mask = 0; | ^~~~~~~~~~~~~~ Signed-off-by: Kees Cook Signed-off-by: Jonathan Cameron commit 1bb0b8b195d821d009bae61248da14f2b17bd44a Author: Miaoqian Lin Date: Tue Dec 14 01:55:44 2021 +0000 soc: ti: knav_dma: Fix NULL vs IS_ERR() checking in dma_init Since devm_ioremap_resource() function return error pointers. The pktdma_get_regs() function does not return NULL, It return error pointers too. Using IS_ERR() to check the return value to fix this. Signed-off-by: Miaoqian Lin Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20211214015544.7270-1-linmq006@gmail.com commit 8a457852bc12c16968c025cce6a7005b41fafa87 Author: Minghao Chi Date: Wed Dec 15 06:07:10 2021 +0000 iio:adc:ti-ads8688:: remove redundant ret variable Return value from ads8688_prog_write() directly instead of taking this in another redundant variable. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: Jonathan Cameron commit 5d97d9e9a703be2a602ac24c1ba3dae22155a2c8 Author: Dan Carpenter Date: Wed Dec 15 14:50:53 2021 +0300 iio: addac: ad74413r: fix off by one in ad74413r_parse_channel_config() The > needs to be >= to prevent accessing one element beyond the end of the st->channel_configs[] array. Fixes: fea251b6a5db ("iio: addac: add AD74413R driver") Signed-off-by: Dan Carpenter Reviewed-by: Cosmin Tanislav Signed-off-by: Jonathan Cameron commit 0a52c3f347fd0173a6aa718bffedca90816ddac6 Author: Xiang wangx Date: Sun Dec 12 22:41:18 2021 +0800 iio: adc: ad7606: Fix syntax errors in comments Delete the redundant word 'the'. Signed-off-by: Xiang wangx Signed-off-by: Jonathan Cameron commit c054fe9936065759b21b493ac1e7d9a2be014083 Author: Zach DeCook Date: Wed Dec 8 16:48:08 2021 -0500 iio: event_monitor: Flush output on event By flushing the output, iio_event_monitor can be more useful to programs chained along with it. iio_event_monitor stk3310 | awk '/rising/{system("my_unlockscreen.sh")} /falling/{system("my_lockscreen.sh")}' Without this flush, the above example would buffer a number of events, then after a while run the lock/unlock scripts several times. Signed-off-by: Zach DeCook Signed-off-by: Jonathan Cameron commit 0b665d4af35837f0a0ae63135b84a3c187c1db3b Author: Stephen Boyd Date: Tue Dec 14 16:25:29 2021 -0800 drm/bridge: ti-sn65dsi86: Set max register for regmap Set the maximum register to 0xff so we can dump the registers for this device in debugfs. Fixes: a095f15c00e2 ("drm/bridge: add support for sn65dsi86 bridge driver") Cc: Rob Clark Cc: Douglas Anderson Cc: Laurent Pinchart Signed-off-by: Stephen Boyd Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20211215002529.382383-1-swboyd@chromium.org commit fc0d026a2fadd3a637677efa2e8bd3b70403f4aa Author: Eric Dumazet Date: Mon Dec 13 08:40:00 2021 -0800 netfilter: nf_nat_masquerade: add netns refcount tracker to masq_dev_work If compiled with CONFIG_NET_NS_REFCNT_TRACKER=y, using put_net_track() in iterate_cleanup_work() and netns_tracker_alloc() in nf_nat_masq_schedule() might help us finding netns refcount imbalances. Signed-off-by: Eric Dumazet Signed-off-by: Pablo Neira Ayuso commit a9382d9389a045ddc1e6f8e0595eb793f6933d68 Author: Eric Dumazet Date: Mon Dec 13 08:39:59 2021 -0800 netfilter: nfnetlink: add netns refcount tracker to struct nfulnl_instance If compiled with CONFIG_NET_NS_REFCNT_TRACKER=y, using put_net_track() in nfulnl_instance_free_rcu() and get_net_track() in instance_create() might help us finding netns refcount imbalances. Signed-off-by: Eric Dumazet Signed-off-by: Pablo Neira Ayuso commit 8b7651f2596238ca54225ebbcfbd3f14a4c41887 Author: Lars-Peter Clausen Date: Sun Dec 5 13:50:52 2021 +0100 iio: iio_device_alloc(): Remove unnecessary self drvdata Drvdata is typically used by drivers to attach driver specific data to a device. It is used to retrieve driver specific information when only the device to which the data is attached is available. In the IIO core in the `iio_device_alloc()` function we call `iio_device_set_drvdata(indio_dev, indio_dev)`. This sets the drvdata of the IIO device to itself. This is rather unnecessary since if we have a pointer to the IIO device to call `iio_device_get_drvdata()` on it we don't need to call the function since we already have the pointer. If we only have a pointer to the `struct device` we can use `dev_to_iio_dev()` to get the IIO device from it. Furthermore the drvdata is supposed to be reserved for drivers, so it should not be used by the IIO core in the first place. The `set_drvdata()` has been around from the very beginning of the IIO framework and back then it was used in the IIO device sysfs attribute handling code. But that was subsequently replaced with a `dev_to_iio_dev()` in commit e53f5ac52ec1 ("iio: Use dev_to_iio_dev()") and other cleanups. The self `set_drvdata()` is now no longer needed and can be removed. Verified that there no longer any users by checking for potential users using the following two coccinelle scripts and reviewing that none of the matches are problematic code. @@ struct iio_dev *iio_dev; expression dev; identifier fn !~ "(remove|resume|suspend)"; @@ fn(...) { ... *iio_dev = dev_get_drvdata(dev) ... } @r1@ position p; struct iio_dev *indio_dev; identifier dev_fn =~ "^dev_"; identifier devm_fn =~ "^devm_"; @@ ( dev_fn | devm_fn ) (&indio_dev@p->dev, ...) @@ struct iio_dev *indio_dev; position p != r1.p; @@ *&indio_dev@p->dev Signed-off-by: Lars-Peter Clausen Signed-off-by: Jonathan Cameron commit d0a0b6cd8cf9f39d99d7d5c4c080499d17f43c33 Author: Thomas Zimmermann Date: Mon Dec 6 10:11:25 2021 +0100 drm/ast: Move I2C code into separate source file Move I2C code into its own source file. Makes the mode-setting code a little less convoluted. v3: * fix SPDX tag to say 'SPDX-License-Identifier' Signed-off-by: Thomas Zimmermann Acked-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20211206091125.29501-4-tzimmermann@suse.de commit a2cce09c349e2d9847ee7145986ca27d99bf0f61 Author: Thomas Zimmermann Date: Mon Dec 6 10:11:24 2021 +0100 drm/ast: Convert I2C code to managed cleanup Release the I2C adapter as part of the DRM device cleanup. Remove ast's dedicated helper for struct drm_connector_funcs.destroy. Signed-off-by: Thomas Zimmermann Reviewed-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20211206091125.29501-3-tzimmermann@suse.de commit 55dc449a7c60d3df5a8f0b71bbae9d5173c864f5 Author: Thomas Zimmermann Date: Mon Dec 6 10:11:23 2021 +0100 drm/ast: Handle failed I2C initialization gracefully I2C initialization is allowed to fail. In this case, create a connector without DDC adapter. The current code would dereference a NULL pointer. Reading the modes from the connector is supposed to work without I2C adapter. Add the respective test. v2: * init edid to NULL to avoid uninitialized read (Dan) Signed-off-by: Thomas Zimmermann Reviewed-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20211206091125.29501-2-tzimmermann@suse.de commit 604ba230902d23c6e85c7dba9cfcb6a37661cb12 Author: Volodymyr Mytnyk Date: Wed Dec 15 12:07:30 2021 +0200 net: prestera: flower template support Add user template explicit support. At this moment, max TCAM rule size is utilized for all rules, doesn't matter which and how much flower matches are provided by user. It means that some of TCAM space is wasted, which impacts the number of filters that can be offloaded. Introducing the template, allows to have more HW offloaded filters by specifying the template explicitly. Example: tc qd add dev PORT clsact tc chain add dev PORT ingress protocol ip \ flower dst_ip 0.0.0.0/16 tc filter add dev PORT ingress protocol ip \ flower skip_sw dst_ip 1.2.3.4/16 action drop NOTE: chain 0 is the default chain id for "tc chain" & "tc filter" command, so it is omitted in the example above. This patch adds only template support for default chain 0 suppoerted by prestera driver at this moment. Chains are not supported yet, and will be added later. Signed-off-by: Volodymyr Mytnyk Signed-off-by: David S. Miller commit a5dba0f207e59dfe7a985e52ca4ce2ca9a33750a Author: Luiz Angelo Daros de Luca Date: Wed Dec 15 00:41:28 2021 -0300 net: dsa: rtl8365mb: add GMII as user port mode Recent net-next fails to initialize ports with: realtek-smi switch: phy mode gmii is unsupported on port 0 realtek-smi switch lan5 (uninitialized): validation of gmii with support 0000000,00000000,000062ef and advertisement 0000000,00000000,000062ef failed: -22 realtek-smi switch lan5 (uninitialized): failed to connect to PHY: -EINVAL realtek-smi switch lan5 (uninitialized): error -22 setting up PHY for tree 1, switch 0, port 0 Current net branch(3dd7d40b43663f58d11ee7a3d3798813b26a48f1) is not affected. I also noticed the same issue before with older versions but using a MDIO interface driver, not realtek-smi. Tested-by: Arınç ÜNAL Signed-off-by: Luiz Angelo Daros de Luca Signed-off-by: David S. Miller commit 440523b92be6a25e53f9ba1f3b418345fe465b51 Author: Marc Zyngier Date: Thu Dec 16 10:45:07 2021 +0000 KVM: arm64: vgic: Demote userspace-triggered console prints to kvm_debug() Running the KVM selftests results in these messages being dumped in the kernel console: [ 188.051073] kvm [469]: VGIC redist and dist frames overlap [ 188.056820] kvm [469]: VGIC redist and dist frames overlap [ 188.076199] kvm [469]: VGIC redist and dist frames overlap Being amle to trigger this from userspace is definitely not on, so demote these warnings to kvm_debug(). Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211216104507.1482017-1-maz@kernel.org commit c95b1d7ca794ac3ea49a8f85c729f9841444d5e5 Author: Marc Zyngier Date: Thu Dec 16 10:45:26 2021 +0000 KVM: arm64: vgic-v3: Fix vcpu index comparison When handling an error at the point where we try and register all the redistributors, we unregister all the previously registered frames by counting down from the failing index. However, the way the code is written relies on that index being a signed value. Which won't be true once we switch to an xarray-based vcpu set. Since this code is pretty awkward the first place, and that the failure mode is hard to spot, rewrite this loop to iterate over the vcpus upwards rather than downwards. Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211216104526.1482124-1-maz@kernel.org commit e85fbf535531432f09e0043586c926207533f308 Merge: 75df1a2484c49 6081ac2013ab9 Author: David S. Miller Date: Thu Dec 16 10:41:54 2021 +0000 Merge branch 'gve-improvements' Jeroen de Borst says: ==================== gve improvements This patchset consists of unrelated changes: A bug fix for an issue that disabled jumbo-frame support, a few code improvements and minor funcitonal changes and 3 new features: Supporting tx|rx-coalesce-usec for DQO Suspend/resume/shutdown Optional metadata descriptors ==================== Signed-off-by: David S. Miller commit 6081ac2013ab9f1a8743f90ef13d973888359cda Author: Tao Liu Date: Wed Dec 15 16:46:52 2021 -0800 gve: Add tx|rx-coalesce-usec for DQO Adding ethtool support for changing rx-coalesce-usec and tx-coalesce-usec when using the DQO queue format. Signed-off-by: Tao Liu Signed-off-by: Jeroen de Borst Signed-off-by: David S. Miller commit 2c9198356d56a8e035702cfd1a0fde27edbcc338 Author: Jordan Kim Date: Wed Dec 15 16:46:51 2021 -0800 gve: Add consumed counts to ethtool stats Being able to see how many descriptors are in-use is helpful when diagnosing certain issues. Signed-off-by: Jeroen de Borst Signed-off-by: Jordan Kim Signed-off-by: David S. Miller commit 974365e518617c9ce917f61aacbba07e4bedcca0 Author: Catherine Sullivan Date: Wed Dec 15 16:46:50 2021 -0800 gve: Implement suspend/resume/shutdown Add support for suspend, resume and shutdown. Signed-off-by: Catherine Sullivan Signed-off-by: David Awogbemila Signed-off-by: David S. Miller commit 497dbb2b97a0642ecd478d441643bf26804d5f96 Author: Willem de Bruijn Date: Wed Dec 15 16:46:49 2021 -0800 gve: Add optional metadata descriptor type GVE_TXD_MTD Allow drivers to pass metadata along with packet data to the device. Introduce a new metadata descriptor type * GVE_TXD_MTD This descriptor is optional. If present it immediate follows the packet descriptor and precedes the segment descriptor. This descriptor may be repeated. Multiple metadata descriptors may follow. There are no immediate uses for this, this is for future proofing. At present devices allow only 1 MTD descriptor. The lower four bits of the type_flags field encode GVE_TXD_MTD. The upper four bits of the type_flags field encodes a *sub*type. Introduce one such metadata descriptor subtype * GVE_MTD_SUBTYPE_PATH This shares path information with the device for network failure discovery and robust response: Linux derives ipv6 flowlabel and ECMP multipath from sk->sk_txhash, and updates this field on error with sk_rethink_txhash. Allow the host stack to do the same. Pass the tx_hash value if set. Also communicate whether the path hash is set, or more exactly, what its type is. Define two common types GVE_MTD_PATH_HASH_NONE GVE_MTD_PATH_HASH_L4 Concrete examples of error conditions that are resolved are mentioned in the commits that add sk_rethink_txhash calls. Such as commit 7788174e8726 ("tcp: change IPv6 flow-label upon receiving spurious retransmission"). Experimental results mirror what the theory suggests: where IPv6 FlowLabel is included in path selection (e.g., LAG/ECMP), flowlabel rotation on TCP timeout avoids the vast majority of TCP disconnects that would otherwise have occurred during link failures in long-haul backbones, when an alternative path is available. Rotation can be applied to various bad connection signals, such as timeouts and spurious retransmissions. In aggregate, such flow level signals can help locate network issues. Define initial common states: GVE_MTD_PATH_STATE_DEFAULT GVE_MTD_PATH_STATE_TIMEOUT GVE_MTD_PATH_STATE_CONGESTION GVE_MTD_PATH_STATE_RETRANSMIT Signed-off-by: Willem de Bruijn Signed-off-by: David Awogbemila Signed-off-by: David S. Miller commit 5fd07df47a7fe7962d628bb117abbadbbb15de94 Author: Catherine Sullivan Date: Wed Dec 15 16:46:48 2021 -0800 gve: remove memory barrier around seqno No longer needed after we introduced the barrier in gve_napi_poll. Signed-off-by: Catherine Sullivan Signed-off-by: David S. Miller commit 13e7939c954a280847107c9f081835471f4ea1fe Author: Catherine Sullivan Date: Wed Dec 15 16:46:47 2021 -0800 gve: Update gve_free_queue_page_list signature The id field should be a u32 not a signed int. Signed-off-by: Catherine Sullivan Signed-off-by: David S. Miller commit d30baacc04948bbfded609cf7fb298e5ae754fcd Author: Catherine Sullivan Date: Wed Dec 15 16:46:46 2021 -0800 gve: Move the irq db indexes out of the ntfy block struct Giving the device access to other kernel structs is not ideal. Move the indexes into their own array and just keep pointers to them in the ntfy block struct. Signed-off-by: Catherine Sullivan Signed-off-by: David Awogbemila Signed-off-by: David S. Miller commit a10834a36c8ab59b1a76df48d526fd9ddc090fca Author: Jeroen de Borst Date: Wed Dec 15 16:46:45 2021 -0800 gve: Correct order of processing device options The legacy raw addressing device option was processed before the new RDA queue format option. This caused the supported features mask, which is provided only on the RDA queue format option, not to be set. This disabled jumbo-frame support when using raw adressing. Fixes: 255489f5b33c ("gve: Add a jumbo-frame device option") Signed-off-by: Jeroen de Borst Signed-off-by: David S. Miller commit 75df1a2484c49df232793e295fad34d2b78ff999 Merge: 4134c846b644e d8c366939707d Author: David S. Miller Date: Thu Dec 16 10:37:14 2021 +0000 Merge branch 'phylink-pcs-validation' Russell King says: ==================== net: phylink: add PCS validation This series allows phylink to include the PCS in its validation step. There are two reasons to make this change: 1. Some of the network drivers that are making use of the split PCS support are already manually calling into their PCS drivers to perform validation. E.g. stmmac with xpcs. 2. Logically, some network drivers such as mvneta and mvpp2, the restriction we impose in the validate() callback is a property of the "PCS" block that we provide rather than the MAC. This series: 1. Gives phylink a mechanism to query the MAC driver which PCS is wishes to use for the PHY interface mode. This is necessary to allow the PCS to be involved in the validation step without making changes to the configuration. 2. Provide a pcs_validate() method that PCS can implement. This follows a similar model to the MAC's validate() callback, but with some minor differences due to observations from the various implementations. E.g. returning an error code for not-supported and the way the advertising bitmap is masked. 3. Convert mvpp2 and mvneta to this as examples of its use. Further Conversions are in the pipeline, including for stmmac+xpcs, as well as some DSA drivers. Note that DSA conversion to this is conditional upon all DSA drivers populating their supported_interfaces bitmap, since this is required before mac_select_pcs() can be used. Existing drivers that set a PCS in mac_prepare() or mac_config(), or shortly after phylink_create() will continue to work. However, it should be noted that mac_select_pcs() will be called during phylink_create(), and thus any PCS returned by mac_select_pcs() must be available by this time - or we drop the check in phylink_create(). v2: fix kerneldoc typo in patch 1. ==================== Signed-off-by: David S. Miller commit d8c366939707d03e531959a6b8a5e15c5e29df3f Author: Russell King (Oracle) Date: Wed Dec 15 15:34:45 2021 +0000 net: mvneta: convert to pcs_validate() and phylink_generic_validate() Convert mvneta to validate the autoneg state for 1000base-X in the pcs_validate() operation, rather than the MAC validate() operation. This allows us to switch the MAC validate() to use phylink_generic_validate(). Signed-off-by: Russell King (Oracle) Signed-off-by: David S. Miller commit c2e7d2df4a1075ca97dadd280e214bb1afbec6be Author: Russell King Date: Wed Dec 15 15:34:40 2021 +0000 net: mvneta: convert to phylink pcs operations An initial stab at converting mvneta to PCS operations. There's a few FIXMEs to be solved. Signed-off-by: Russell King Signed-off-by: David S. Miller commit 5a7d895369695a95bda11dbebf98fe3f50b5dc92 Author: Russell King Date: Wed Dec 15 15:34:35 2021 +0000 net: mvneta: convert to use mac_prepare()/mac_finish() Convert mvneta to use the mac_prepare() and mac_finish() methods in preparation to converting mvneta to split-PCS support. Signed-off-by: Russell King Signed-off-by: David S. Miller commit 85e3e0ebdbec4ab998b904bd5d95b89ed11ecdfb Author: Russell King (Oracle) Date: Wed Dec 15 15:34:30 2021 +0000 net: mvpp2: convert to pcs_validate() and phylink_generic_validate() Convert mvpp2 to validate the autoneg state for 1000base-X in the pcs_validate() operation, rather than the MAC validate() operation. This allows us to switch the MAC validate() to use phylink_generic_validate(). Signed-off-by: Russell King (Oracle) Signed-off-by: David S. Miller commit cff0563223723a61a02b2d3f216d31c5bd859b54 Author: Russell King (Oracle) Date: Wed Dec 15 15:34:25 2021 +0000 net: mvpp2: use .mac_select_pcs() interface Use the mac_select_pcs() method to choose between the GMAC and XLG PCS implementations. Signed-off-by: Russell King (Oracle) Signed-off-by: David S. Miller commit 0d22d4b626a4eaa3196019092eb6c1919e9f8caa Author: Russell King (Oracle) Date: Wed Dec 15 15:34:20 2021 +0000 net: phylink: add pcs_validate() method Add a hook for PCS to validate the link parameters. This avoids MAC drivers having to have knowledge of their PCS in their validate() method, thereby allowing several MAC drivers to be simplfied. Signed-off-by: Russell King (Oracle) Signed-off-by: David S. Miller commit d1e86325af377129adb7fc6f34eb044ca6068b47 Author: Russell King (Oracle) Date: Wed Dec 15 15:34:15 2021 +0000 net: phylink: add mac_select_pcs() method to phylink_mac_ops mac_select_pcs() allows us to have an explicit point to query which PCS the MAC wishes to use for a particular PHY interface mode, thereby allowing us to add support to validate the link settings with the PCS. Phylink will also use this to select the PCS to be used during a major configuration event without the MAC driver needing to call phylink_set_pcs(). Note that if mac_select_pcs() is present, the supported_interfaces bitmap must be filled in; this avoids mac_select_pcs() being called with PHY_INTERFACE_MODE_NA when we want to get support for all interface types. Phylink will return an error in phylink_create() unless this condition is satisfied. Signed-off-by: Russell King (Oracle) Signed-off-by: David S. Miller commit 3e15f623bbdf09c88763dfc3bb47fc5d7d13a62c Author: Richard Zhu Date: Thu Dec 2 16:02:33 2021 +0800 dt-bindings: imx6q-pcie: Add PHY phandles and name properties i.MX8MM PCIe has the PHY. Add a PHY phandle and name properties in the binding document. Link: https://lore.kernel.org/r/1638432158-4119-4-git-send-email-hongxing.zhu@nxp.com Tested-by: Marcel Ziswiler Tested-by: Tim Harvey Signed-off-by: Richard Zhu Signed-off-by: Lorenzo Pieralisi Reviewed-by: Tim Harvey Reviewed-by: Rob Herring commit 18678591846d668649fbd4f87b4a4c470818d386 Author: Sachin Sant Date: Mon Dec 13 22:12:23 2021 +0530 selftests/powerpc: skip tests for unavailable mitigations. Mitigation patching test iterates over a set of mitigations irrespective of whether a certain mitigation is supported/available in the kernel. This causes following messages on a kernel where some mitigations are unavailable: Spawned threads enabling/disabling mitigations ... cat: entry_flush: No such file or directory cat: uaccess_flush: No such file or directory Waiting for timeout ... OK This patch adds a check for available mitigations in the kernel. Reported-by: Nageswara R Sastry Signed-off-by: Sachin Sant Tested-by: Nageswara R Sastry Reviewed-by: Russell Currey Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/163941374362.36967.18016981579099073379.sendpatchset@1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa commit 3b54c71537d7beaaca8be9c57a81045e2b641655 Author: Nicholas Piggin Date: Fri Nov 5 23:29:23 2021 +1000 powerpc/pseries: use slab context cpumask allocation in CPU hotplug init Slab is up at this point, using the bootmem allocator triggers a warning. Switch to using the regular cpumask allocator. Signed-off-by: Nicholas Piggin Tested-by: Sachin Sant Reviewed-by: Nathan Lynch Reviewed-by: Laurent Dufour Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211105132923.1582514-1-npiggin@gmail.com commit af47d79b041deccc31e0dddc6310a654c13d04b6 Author: Nicholas Piggin Date: Thu Sep 23 00:54:52 2021 +1000 powerpc/64s/interrupt: avoid saving CFAR in some asynchronous interrupts Reading the CFAR register is quite costly (~20 cycles on POWER9). It is a good idea to have for most synchronous interrupts, but for async ones it is much less important. Doorbell, external, and decrementer interrupts are the important asynchronous ones. HV interrupts can't skip CFAR if KVM HV is possible, because it might be a guest exit that requires CFAR preserved. But the important pseries interrupts can avoid loading CFAR. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210922145452.352571-7-npiggin@gmail.com commit ecb1057c0f9a0f3f052294de6cc2eb43ecf7547b Author: Nicholas Piggin Date: Thu Sep 23 00:54:51 2021 +1000 powerpc/64/interrupt: reduce expensive debug tests Move the assertions requiring restart table searches under CONFIG_PPC_IRQ_SOFT_MASK_DEBUG. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210922145452.352571-6-npiggin@gmail.com commit 0faf20a1ad1647c0fc0f5a367c71e5e84deaf899 Author: Nicholas Piggin Date: Thu Sep 23 00:54:50 2021 +1000 powerpc/64s/interrupt: Don't enable MSR[EE] in irq handlers unless perf is in use Enabling MSR[EE] in interrupt handlers while interrupts are still soft masked allows PMIs to profile interrupt handlers to some degree, beyond what SIAR latching allows. When perf is not being used, this is almost useless work. It requires an extra mtmsrd in the irq handler, and it also opens the door to masked interrupts hitting and requiring replay, which is more expensive than just taking them directly. This effect can be noticable in high IRQ workloads. Avoid enabling MSR[EE] unless perf is currently in use. This saves about 60 cycles (or 8%) on a simple decrementer interrupt microbenchmark. Replayed interrupts drop from 1.4% of all interrupts taken, to 0.003%. This does prevent the soft-nmi interrupt being taken in these handlers, but that's not too reliable anyway. The SMP watchdog will continue to be the reliable way to catch lockups. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210922145452.352571-5-npiggin@gmail.com commit 5a7745b96f43c69f9b4875bcf516a0341acbc3fb Author: Nicholas Piggin Date: Thu Sep 23 00:54:49 2021 +1000 powerpc/64s/perf: add power_pmu_wants_prompt_pmi to say whether perf wants PMIs to be soft-NMI Interrupt code enables MSR[EE] in some irq handlers while keeping local irqs disabled via soft-mask, allowing PMI interrupts to be taken as soft-NMI to improve profiling of irq handlers. When perf is not enabled, there is no point to doing this, it's additional overhead. So provide a function that can say if PMIs should be taken promptly if possible. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210922145452.352571-4-npiggin@gmail.com commit ff0b0d6e1a7bc202241a9b1e28d1da4b744e0312 Author: Nicholas Piggin Date: Thu Sep 23 00:54:48 2021 +1000 powerpc/64s/interrupt: handle MSR EE and RI in interrupt entry wrapper The mtmsrd to enable MSR[RI] can be combined with the mtmsrd to enable MSR[EE] in interrupt entry code, for those interrupts which enable EE. This helps performance of important synchronous interrupts (e.g., page faults). This is similar to what commit dd152f70bdc1 ("powerpc/64s: system call avoid setting MSR[RI] until we set MSR[EE]") does for system calls. Do this by enabling EE and RI together at the beginning of the entry wrapper if PACA_IRQ_HARD_DIS is clear, and only enabling RI if it is set. Asynchronous interrupts set PACA_IRQ_HARD_DIS, but synchronous ones leave it unchanged, so by default they always get EE=1 unless they have interrupted a caller that is hard disabled. When the sync interrupt later calls interrupt_cond_local_irq_enable(), it will not require another mtmsrd because MSR[EE] was already enabled here. This avoids one mtmsrd L=1 for synchronous interrupts on 64s, which saves about 20 cycles on POWER9. And for kernel-mode interrupts, both synchronous and asynchronous, this saves an additional 40 cycles due to the mtmsrd being moved ahead of mfspr SPRN_AMR, which prevents a SPR scoreboard stall. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210922145452.352571-3-npiggin@gmail.com commit 4423eb5ae32ec613af3fceee2fe84234e417ee55 Author: Nicholas Piggin Date: Thu Sep 23 00:54:47 2021 +1000 powerpc/64/interrupt: make normal synchronous interrupts enable MSR[EE] if possible Make synchronous interrupt handler entry wrappers enable MSR[EE] if MSR[EE] was enabled in the interrupted context. IRQs are soft-disabled at this point so there is no change to high level code, but it's a masked interrupt could fire. This is a performance disadvantage for interrupts which do not later call interrupt_cond_local_irq_enable(), because an an additional mtmsrd or wrtee instruction is executed. However the important synchronous interrupts (e.g., page fault) do enable interrupts, so the performance disadvantage is mostly avoided. In the next patch, MSR[RI] enabling can be combined with MSR[EE] enabling, which mitigates the performance drop for the former and gives a performance advanage for the latter interrupts, on 64s machines. 64e is coming along for the ride for now to avoid divergences with 64s in this tricky code. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210922145452.352571-2-npiggin@gmail.com commit 0a006ace634dcaf1bbf9125fb8089a4a50bf33d6 Author: Nicholas Piggin Date: Fri Nov 26 15:21:33 2021 +1000 powerpc/pseries/vas: Don't print an error when VAS is unavailable KVM does not support VAS so guests always print a useless error on boot vas: HCALL(398) error -2, query_type 0, result buffer 0x57f2000 Change this to only print the message if the error is not H_FUNCTION. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211126052133.1664375-1-npiggin@gmail.com commit 6ed05a8efda56e5be11081954929421de19cce88 Author: Kajol Jain Date: Mon Dec 6 14:47:49 2021 +0530 powerpc/perf: Add data source encodings for power10 platform The code represent memory/cache level data based on PERF_MEM_LVL_* namespace, which is in the process of deprication in the favour of newer composite PERF_MEM_{LVLNUM_,REMOTE_,SNOOPX_,HOPS_} fields. Add data source encodings to represent cache/memory data based on newer composite PERF_MEM_{LVLNUM_,REMOTE_,SNOOPX_,HOPS_} fields. Add data source encodings to represent data coming from local memory/Remote memory/distant memory and remote/distant cache hits. In order to represent data coming from OpenCAPI cache/memory, we use LVLNUM "PMEM" field which is used to present persistent memory accesses. Result in power10 system with patch changes: localhost:# ./perf mem report --sort="mem,sym,dso" --stdio # Overhead Samples Memory access Symbol Shared Object # ........ ............ ........................ .......................... ................ # 29.46% 2331 L1 or L1 hit [.] __random libc-2.28.so 23.11% 2121 L1 or L1 hit [.] producer_populate_cache producer_consumer 18.56% 1758 L1 or L1 hit [.] __random_r libc-2.28.so 15.64% 1559 L2 or L2 hit [.] __random libc-2.28.so ..... 0.09% 5 Remote socket, same board Any cache hit [.] __random libc-2.28.so 0.07% 4 Remote socket, same board Any cache hit [.] __random libc-2.28.so ..... Signed-off-by: Kajol Jain Reviewed-by: Madhavan Srinivasan Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211206091749.87585-5-kjain@linux.ibm.com commit 4a20ee106154ac1765dea97932faad29f0ba57fc Author: Kajol Jain Date: Mon Dec 6 14:47:48 2021 +0530 powerpc/perf: Add encodings to represent data based on newer composite PERF_MEM_LVLNUM* fields The code represent data coming from L1/L2/L3 cache hits based on PERF_MEM_LVL_* namespace, which is in the process of deprecation in the favour of newer composite PERF_MEM_{LVLNUM_,REMOTE_,SNOOPX_,HOPS_} fields. Add data source encodings to represent L1/L2/L3 cache hits based on newer composite PERF_MEM_{LVLNUM_,REMOTE_,SNOOPX_,HOPS_} fields for power10 and older platforms Result in power9 system without patch changes: localhost:# ./perf mem report --sort="mem,sym,dso" --stdio # Overhead Samples Memory access Symbol Shared Object # ........ ............ ........................ ................................. ................ # 29.51% 1 L2 hit [k] perf_event_exec [kernel.vmlinux] 27.05% 1 L1 hit [k] perf_ctx_unlock [kernel.vmlinux] 13.93% 1 L1 hit [k] vtime_delta [kernel.vmlinux] 13.11% 1 L1 hit [k] prepend_path.isra.11 [kernel.vmlinux] 8.20% 1 L1 hit [.] 00000038.plt_call.__GI_strlen libc-2.28.so 8.20% 1 L1 hit [k] perf_event_interrupt [kernel.vmlinux] Result in power9 system with patch changes: localhost:# ./perf mem report --sort="mem,sym,dso" --stdio # Overhead Samples Memory access Symbol Shared Object # ........ ............ ........................ .......................... ................ # 36.63% 1 L2 or L2 hit [k] perf_event_exec [kernel.vmlinux] 25.50% 1 L1 or L1 hit [k] vtime_delta [kernel.vmlinux] 13.12% 1 L1 or L1 hit [k] unmap_region [kernel.vmlinux] 12.62% 1 L1 or L1 hit [k] perf_sample_event_took [kernel.vmlinux] 6.93% 1 L1 or L1 hit [k] perf_ctx_unlock [kernel.vmlinux] 5.20% 1 L1 or L1 hit [.] __memcpy_power7 libc-2.28.so Signed-off-by: Kajol Jain Reviewed-by: Madhavan Srinivasan Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211206091749.87585-4-kjain@linux.ibm.com commit cb1c4aba055f928ffae0c868e8dfe08eeab302e7 Author: Kajol Jain Date: Mon Dec 6 14:47:46 2021 +0530 perf: Add new macros for mem_hops field Add new macros for mem_hops field which can be used to represent remote-node, socket and board level details. Currently the code had macro for HOPS_0, which corresponds to data coming from another core but same node. Add new macros for HOPS_1 to HOPS_3 to represent remote-node, socket and board level data. For ex: Encodings for mem_hops fields with L2 cache: L2 - local L2 L2 | REMOTE | HOPS_0 - remote core, same node L2 L2 | REMOTE | HOPS_1 - remote node, same socket L2 L2 | REMOTE | HOPS_2 - remote socket, same board L2 L2 | REMOTE | HOPS_3 - remote board L2 Signed-off-by: Kajol Jain Acked-by: Peter Zijlstra (Intel) Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211206091749.87585-2-kjain@linux.ibm.com commit 4134c846b644e3c5d3a000d0cf1e07b4a013fd45 Merge: 823f7a5497968 9c99d099f7e78 Author: David S. Miller Date: Thu Dec 16 10:23:34 2021 +0000 Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/nex t-queue Tony Nguyen says: ==================== 100GbE Intel Wired LAN Driver Updates 2021-12-15 This series contains updates to ice driver only. Jake makes changes to flash update. This includes the following: * a new shadow-ram region similar to NVM region but for the device shadow RAM contents. This is distinct from NVM region because shadow RAM is built up during device init and may be different from the raw NVM flash data. * refactoring of the ice_flash_pldm_image to become the main flash update entry point. This is simpler than having both an ice_devlink_flash_update and an ice_flash_pldm_image. It will make additions like dry-run easier in the future. * reducing time to read Option ROM version information. * adding support for firmware activation via devlink reload, when possible. The major new work is the reload support, which allows activating firmware immediately without a reboot when possible. Reload support only supports firmware activation. Jesse improves transmit code: utilizing newer netif_tx* API, adding some prefetch calls, correcting expected conditions when calling ice_vsi_down(), and utilizing __netdev_tx_sent_queue() call. ==================== Signed-off-by: David S. Miller commit d619f38c015fd7cf79af5cd34265d5b9247a00f0 Author: Dave Stevenson Date: Wed Dec 15 10:17:39 2021 +0100 drm/vc4: plane: Add support for YUV color encodings and ranges The BT601/BT709 color encoding and limited vs full range properties were not being exposed, defaulting always to BT601 limited range. Expose the parameters and set the registers appropriately. Signed-off-by: Dave Stevenson Signed-off-by: Maxime Ripard Acked-by: Thomas Zimmermann Link: https://lore.kernel.org/r/20211215091739.135042-4-maxime@cerno.tech commit 145b42fbae7f9e842469541c15b01ffc7c9be963 Author: Dave Stevenson Date: Wed Dec 15 10:17:38 2021 +0100 drm/vc4: plane: Add support for DRM_FORMAT_P030 The P030 format, used with the DRM_FORMAT_MOD_BROADCOM_SAND128 modifier, is a format output by the video decoder on the BCM2711. Add native support to the KMS planes for that format. Signed-off-by: Dave Stevenson Signed-off-by: Maxime Ripard Acked-by: Thomas Zimmermann Link: https://lore.kernel.org/r/20211215091739.135042-3-maxime@cerno.tech commit 006ea1b5822f9019bd722ffc6242bc0880879e3d Author: Dave Stevenson Date: Wed Dec 15 10:17:37 2021 +0100 drm/fourcc: Add packed 10bit YUV 4:2:0 format Adds a format that is 3 10bit YUV 4:2:0 samples packed into a 32bit word (with 2 spare bits). Supported on Broadcom BCM2711 chips. Signed-off-by: Dave Stevenson Signed-off-by: Maxime Ripard Acked-by: Thomas Zimmermann Link: https://lore.kernel.org/r/20211215091739.135042-2-maxime@cerno.tech commit 823f7a5497968473b18627ea660a80ac8b021759 Merge: bd1d97d861e4f 685b1afd79116 Author: David S. Miller Date: Thu Dec 16 10:22:20 2021 +0000 Merge branch 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux Saeed Mahameed says: ==================== mlx5-next branch 2021-12-15 Hi Dave, Jakub, Jason This pulls mlx5-next branch into net-next and rdma branches. All patches already reviewed on both rdma and netdev mailing lists. Please pull and let me know if there's any problem. 1) Add multiple FDB steering priorities [1] 2) Introduce HW bits needed to configure MAC list size of VF/SF. Required for ("net/mlx5: Memory optimizations") upcoming series [2]. [1] https://lore.kernel.org/netdev/20211201193621.9129-1-saeed@kernel.org/ [2] https://lore.kernel.org/lkml/20211208141722.13646-1-shayd@nvidia.com/ ==================== Signed-off-by: David S. Miller commit 0bc3e333a0c82ee8691bcfdf441644ce02bd8be0 Author: Xiaoliang Yang Date: Thu Dec 16 17:24:48 2021 +0800 arm64: dts: imx8mp-evk: configure multiple queues on eqos Eqos ethernet support five queues on hardware, enable these queues and configure the priority of each queue. Uses Strict Priority as scheduling algorithms to ensure that the TSN function works. The priority of each queue is a bitmask value that maps VLAN tag priority to the queue. Since the hardware only supports five queues, this patch maps priority 0-4 to queues one by one, and priority 5-7 to queue 4. The total fifo size of 5 queues is 8192 bytes, if enable 5 queues with store-and-forward mode, it's not enough for large packets, which would trigger fifo overflow frequently. This patch set DMA to thresh mode to enable all 5 queues. Signed-off-by: Xiaoliang Yang Reviewed-by: Joakim Zhang Signed-off-by: Shawn Guo commit d3af422c0587f55f9d9d3375bf6bb61bea53f014 Author: Yunus Bas Date: Thu Dec 16 09:41:06 2021 +0100 ARM: dts: imx6qdl: phytec: Add support for optional PEB-AV-02 LCD adapter The PEB-AV-02 expansion adapter extends the phyBOARD-Mira boards to connect parallel LCD displays, either with capacitive or resistive touch. Signed-off-by: Yunus Bas Signed-off-by: Shawn Guo commit 841b71c57bcf63137983bad340ffc7b6bfbc6b0a Author: Yunus Bas Date: Thu Dec 16 09:41:05 2021 +0100 ARM: dts: imx6qdl: phytec: Add support for optional PEB-EVAL-01 board The PHYTEC PEV-EVAL-01 expansion board adds support for additional gpio-triggered user-leds and gpio-key support. Signed-off-by: Yunus Bas Signed-off-by: Shawn Guo commit 6ea966fca0841174b6bafca58e56f9c11d3af157 Author: Hector Martin Date: Sun Dec 12 15:24:07 2021 +0900 drm/simpledrm: Add [AX]RGB2101010 formats This is the format used by the bootloader framebuffer on Apple ARM64 platforms. Reviewed-by: Thomas Zimmermann Signed-off-by: Hector Martin Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20211212062407.138309-4-marcan@marcan.st commit 877691b987a089938d67de13d886932ef2f21b22 Author: Hector Martin Date: Sun Dec 12 15:24:06 2021 +0900 drm/format-helper: Add drm_fb_xrgb8888_to_xrgb2101010_toio() Add XRGB8888 emulation support for devices that can only do XRGB2101010. This is chiefly useful for simpledrm on Apple devices where the bootloader-provided framebuffer is 10-bit. Signed-off-by: Hector Martin Reviewed-by: Thomas Zimmermann Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20211212062407.138309-3-marcan@marcan.st commit e426d63e752bdbe7d5ba2d872319dde9ab844a07 Author: Alex Marginean Date: Tue Dec 14 03:32:40 2021 -0600 arm64: dts: ls1028a-qds: add overlays for various serdes protocols Add overlays for various serdes protocols on LS1028A QDS board using different PHY cards. These should be applied at boot, based on serdes configuration. If no overlay is applied, only the RGMII interface on the QDS is available in Linux. Building device tree fragments requires passing the "-@" argument to dtc, which increases the base dtb size and might cause some platforms to fail to store the new binary. To avoid that, it would be nice to only pass "-@" for the platforms where fragments will be used, aka LS1028A-QDS. One approach suggested by Rob Herring is used here: https://lore.kernel.org/patchwork/patch/821645/ Also moved the enet* override nodes in dts file to be in alphabetic order. Signed-off-by: Alex Marginean Signed-off-by: Ioana Ciornei Signed-off-by: Dong Aisheng Signed-off-by: Jason Liu Signed-off-by: Vladimir Oltean Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit 52b98481171eee3fa5abbedd57f9e64cbfb727e1 Author: Vabhav Sharma Date: Tue Dec 14 03:32:39 2021 -0600 arm64: dts: ls1028a-qds: enable lpuart1 LPUART nodes by default are disabled in LS1028A device tree, Enabling LPUART1 node. Signed-off-by: Vabhav Sharma Acked-by: Fugang Duan Signed-off-by: Vladimir Oltean Signed-off-by: Shawn Guo commit cbe9d948eadfe352ad45495a7cc5bf20a1b29d90 Author: Biwen Li Date: Tue Dec 14 03:32:38 2021 -0600 arm64: dts: ls1028a-qds: move rtc node to the correct i2c bus The i2c rtc is on i2c2 bus not i2c1 bus, so fix it in dts. Signed-off-by: Biwen Li Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit b2e2d3e02fb60f4d45843ceebef0465c59c8d392 Author: Biwen Li Date: Tue Dec 14 03:32:37 2021 -0600 arm64: dts: ls1028a-rdb: enable pwm0 Enable pwm0 on ls1028a-rdb board which uses flextimer1. Signed-off-by: Biwen Li Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit 71799672ea24d2935322d655d2407c1ccd7db9ff Author: Biwen Li Date: Tue Dec 14 03:32:35 2021 -0600 arm64: dts: ls1028a: add flextimer based pwm nodes Add pwm nodes using flextimer controller. Signed-off-by: Biwen Li Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit dd3d936a1b17d2d63deb3347d8e8d1dad2a410a9 Author: Biwen Li Date: Tue Dec 14 03:32:34 2021 -0600 arm64: dts: ls1028a: add ftm_alarm1 node to be used as wakeup source Add flextimer2 based ftm_alarm1 node and enable it to be the default rtc wakeup source for rdb and qds boards instead of the original flextimer1 which is used by PWM. The ftm_alarm0 node hence is disabled by default. Signed-off-by: Biwen Li Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit e84e22c0c3b34898269eb054c6366a75b331d395 Author: Xiaowei Bao Date: Tue Dec 14 03:32:33 2021 -0600 arm64: dts: ls1028a: Add PCIe EP nodes Add PCIe EP nodes for ls1028a to support EP mode. Signed-off-by: Xiaowei Bao Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit 2f92ea21622c49480402a58d268f4c9bed9e8c68 Author: Hector Martin Date: Sun Dec 12 15:24:05 2021 +0900 of: Move simple-framebuffer device handling from simplefb to of This code is required for both simplefb and simpledrm, so let's move it into the OF core instead of having it as an ad-hoc initcall in the drivers. Signed-off-by: Hector Martin Reviewed-by: Rob Herring Acked-by: Thomas Zimmermann Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20211212062407.138309-2-marcan@marcan.st commit 57bd7d356506b713d0df8d8e42da7810a18864df Author: Emmanuel Gil Peyrot Date: Wed Dec 15 18:55:00 2021 +0100 powerpc: gamecube_defconfig: Enable the RTC driver This selects the rtc-gamecube driver, which provides a real-time clock on this platform. Signed-off-by: Emmanuel Gil Peyrot Acked-by: Michael Ellerman (powerpc) Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20211215175501.6761-5-linkmauve@linkmauve.fr commit 5479618e1e2641dd57352a73b7b7b2f6908fbeee Author: Emmanuel Gil Peyrot Date: Wed Dec 15 18:54:59 2021 +0100 powerpc: wii.dts: Expose HW_SRNPROT on this platform This Hollywood register isn’t properly understood, but can allow or reject access to the SRAM, which we need to set for RTC usage if it isn’t previously set correctly beforehand. See https://wiibrew.org/wiki/Hardware/Hollywood_Registers#HW_SRNPROT Signed-off-by: Emmanuel Gil Peyrot Acked-by: Michael Ellerman (powerpc) Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20211215175501.6761-4-linkmauve@linkmauve.fr commit 322539a014bcd24cbb9281832c09b24e07912237 Author: Emmanuel Gil Peyrot Date: Wed Dec 15 18:54:58 2021 +0100 rtc: gamecube: Report low battery as invalid data I haven’t been able to test this patch as all of my consoles have a working RTC battery, but according to the documentation it should work like that. Signed-off-by: Emmanuel Gil Peyrot Acked-by: Michael Ellerman (powerpc) Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20211215175501.6761-3-linkmauve@linkmauve.fr commit 86559400b3ef9de93ba50523cffe767c35cd531a Author: Emmanuel Gil Peyrot Date: Wed Dec 15 18:54:57 2021 +0100 rtc: gamecube: Add a RTC driver for the GameCube, Wii and Wii U These three consoles share a device, the MX23L4005, which contains a clock and 64 bytes of SRAM storage, and is exposed on the EXI bus (similar to SPI) on channel 0, device 1. This driver allows it to be used as a Linux RTC device, where time can be read and set. The hardware also exposes two timers, one which shuts down the console and one which powers it on, but these aren’t supported currently. On the Wii U, the counter bias is stored in a XML file, /config/rtc.xml, encrypted in the SLC (eMMC storage), using a proprietary filesystem. In order to avoid having to implement all that, this driver assumes a bootloader will parse this XML file and write the bias into the SRAM, at the same location the other two consoles have it. Signed-off-by: Emmanuel Gil Peyrot Acked-by: Michael Ellerman (powerpc) Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20211215175501.6761-2-linkmauve@linkmauve.fr commit 20c7b41d03d3c1d75cd652a45554b3594e513e3d Author: Christoph Niedermaier Date: Tue Dec 14 10:03:53 2021 +0100 ARM: dts: imx6qdl-dhcom: Add USB overcurrent pin on SoM layer Add USB overcurrent pin muxing on SoM layer. On DRC02 and PDK2 the USB overcurrent pin isn't connected, but a USB hub on the board takes care of the USB overcurrent instead. Therefore disable it there with the property disable-over-current. 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 Reviewed-by: Marek Vasut Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit cc03211c745a729d072a33133379c32411b5ce52 Author: Biwen Li Date: Tue Dec 14 01:23:42 2021 -0600 arm64: dts: lx2162a-qds: add interrupt line for RTC node Add interrupt line for RTC node on lx2162a-qds Signed-off-by: Biwen Li Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit 23817c8396730371662f47f33c30c29e45649a01 Author: Yangbo Lu Date: Tue Dec 14 01:23:41 2021 -0600 arm64: dts: lx2162a-qds: support SD UHS-I and eMMC HS400 modes The default NXP SDHC adapter cards for LX2162AQDS are SD 2.0/3.0 adapter card for eSDHC1, and eMMC 5.1 adapter card for eSDHC2. Add speed modes properties supported by the two adapters in device tree node. Signed-off-by: Yangbo Lu Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit a5b13770faf324e4cf25a9c0de323fca8dd789fa Author: Ran Wang Date: Tue Dec 14 01:23:40 2021 -0600 arm64: dts: lx2160a: enable usb3-lpm-capable for usb3 nodes Enable USB3 HW LPM feature for lx2160a. Signed-off-by: Ran Wang Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit eb70c4a3b1aa2a9d6195ce8bb6ff09b40bc6451e Author: Pankaj Bansal Date: Tue Dec 14 01:23:36 2021 -0600 arm64: dts: lx2160a-qds: Add mdio mux nodes The two external MDIO buses used to communicate with phy devices that are external to SOC are muxed in LX2160AQDS board. These buses can be routed to any one of the eight IO slots on LX2160AQDS board depending on value in fpga register 0x54. Additionally the external MDIO1 is used to communicate to the onboard RGMII phy devices. The mdio1 is controlled by bits 4-7 of fpga register and mdio2 is controlled by bits 4-7 of fpga register. Signed-off-by: Pankaj Bansal Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit 519bace37b2d160a7a1cb4199f9828d12c28ba12 Author: Pankaj Gupta Date: Tue Dec 14 01:23:35 2021 -0600 arm64: dts: lx2160a: add optee-tz node Disabled by default in SoC dtsi and enables in board dts files. Signed-off-by: Pankaj Gupta Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit 674d63dfadb5da1e28678574e5bce4793b9f65f3 Author: Ioana Radulescu Date: Tue Dec 14 01:23:34 2021 -0600 arm64: dts: lx2160a-rdb: Add Inphi PHY node DPMAC5 and DPMAC6 are connected to 25G Inphi PHY Signed-off-by: Vicentiu Galanopulo Signed-off-by: Florin Chiculita Signed-off-by: Ioana Radulescu Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit 938db276594697efab602c66cd92c48cbc60a314 Author: Marek Vasut Date: Sat Nov 27 04:19:09 2021 +0100 drm/panel: simple: Add Team Source Display TST043015CMHX panel Add Team Source Display TST043015CMHX 4.3" 480x272 DPI panel support. Signed-off-by: Marek Vasut Cc: Sam Ravnborg To: dri-devel@lists.freedesktop.org Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20211127031909.283383-3-marex@denx.de commit 5e52485a3be7393f65dcb98ecbc17b6c5b772b31 Author: Marek Vasut Date: Sat Nov 27 04:19:08 2021 +0100 dt-bindings: display: simple: Add Team Source Display TST043015CMHX panel Add Team Source Display TST043015CMHX 4.3" 480x272 DPI panel compatible string. Signed-off-by: Marek Vasut Cc: Rob Herring Cc: Sam Ravnborg Cc: devicetree@vger.kernel.org To: dri-devel@lists.freedesktop.org Acked-by: Rob Herring Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20211127031909.283383-2-marex@denx.de commit 71a58332930f2c3cc7dd35951e1c11ee11c9acf0 Author: Marek Vasut Date: Sat Nov 27 04:19:07 2021 +0100 dt-bindings: Add Team Source Display Technology vendor prefix Add vendor prefix for Team Source Display Technology Co., Ltd. Signed-off-by: Marek Vasut Cc: Rob Herring Cc: Sam Ravnborg Cc: devicetree@vger.kernel.org To: dri-devel@lists.freedesktop.org Acked-by: Rob Herring Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20211127031909.283383-1-marex@denx.de commit 88438668c9e0e32220b4605610bd888b4e50fe80 Author: Marek Vasut Date: Sun Oct 17 02:12:04 2021 +0200 drm/bridge: lvds-codec: Add support for pixel data sampling edge select The OnSemi FIN3385 Parallel-to-LVDS encoder has a dedicated input line to select input pixel data sampling edge. Add DT property "pclk-sample", not the same as the one used by display timings but rather the same as used by media, and configure bus flags based on this DT property. Signed-off-by: Marek Vasut Cc: Laurent Pinchart Cc: Rob Herring Cc: Sam Ravnborg Cc: devicetree@vger.kernel.org To: dri-devel@lists.freedesktop.org Reviewed-by: Sam Ravnborg Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20211017001204.299940-2-marex@denx.de commit d7df3948eb49302ef282a72563b57c084ce2e244 Author: Marek Vasut Date: Sun Oct 17 02:12:03 2021 +0200 dt-bindings: display: bridge: lvds-codec: Document pixel data sampling edge select The OnSemi FIN3385 Parallel-to-LVDS encoder has a dedicated input line to select input pixel data sampling edge. Add DT property "pclk-sample", not the same as the one used by display timings but rather the same as used by media, to define the pixel data sampling edge. Signed-off-by: Marek Vasut Cc: Laurent Pinchart Cc: Rob Herring Cc: Sam Ravnborg Cc: devicetree@vger.kernel.org To: dri-devel@lists.freedesktop.org Reviewed-by: Rob Herring Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20211017001204.299940-1-marex@denx.de commit b530d5f39c2fb64a70bb4672dd378e33b5a6b8f9 Author: David Mosberger-Tang Date: Fri Dec 10 20:30:22 2021 +0000 wilc1000: Improve WILC TX performance when power_save is off The wakeup and sleep commands need to be sent to the WILC chip only when it is in power save mode (PSM, as controlled by "iw dev wlan0 set power_save on/off"). The commands are relatively costly, so it pays to skip them when possible. iperf3 without this patch (no significant different with PSM on/off): TX 0.00-120.01 sec 140 MBytes 9.82 Mbits/sec RX 0.00-120.69 sec 283 MBytes 19.6 Mbits/sec with this patch applied: PSM off (TX is 46% improved, RX slightly improved; may not be significant): TX 0.00-120.00 sec 206 MBytes 14.4 Mbits/sec RX 0.00-120.48 sec 322 MBytes 22.4 Mbits/sec PSM on (no significant change): TX 0.00-120.00 sec 140 MBytes 9.78 Mbits/sec RX 0.00-120.08 sec 257 MBytes 18.0 Mbits/sec Signed-off-by: David Mosberger-Tang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211210203016.3680425-2-davidm@egauge.net commit 97affcfa15bbcd943393a02f085f10193c8e75ac Author: Merlijn Wajer Date: Sun Dec 12 23:13:08 2021 +0100 wl1251: specify max. IE length This fix is similar to commit 77c91295ea53 ("wil6210: specify max. IE length"). Without the max IE length set, wpa_supplicant cannot operate using the nl80211 interface. This patch is a workaround - the number 512 is taken from the wlcore driver, but note that per Paul Fertser: there's no correct number because the driver will ignore the data passed in extra IEs. Suggested-by: Paul Fertser Signed-off-by: Merlijn Wajer Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211212221310.5453-1-merlijn@wizzup.org commit f06bd8a1471d490a800a9a29614485f9e68b4562 Merge: 4d375c2e51d5b 977df8bd5844c Author: Kalle Valo Date: Thu Dec 16 10:25:12 2021 +0200 Merge tag 'iwlwifi-next-for-kalle-2021-12-08' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next first set of iwlwifi patches for v5.17 * A few mei fixes; * Some improvements in D3; * Support for new FW API commands; * Fixes and cleanups in device configurations; * Support some new FW API command versions; * Fix WGDS revision 3 reading bug; * Some firmware debugging improvements; * Fixes for in device configuration structures; * Improvements in the session protection code; * Support SAR GEO Offset Mapping (SGOM) via BIOS; * Continued work on the new Bz device family; * Some more firmware debugging improvements; * Support new FW API version 68; * Add some new device IDs; * Some other small fixes, clean-ups and improvements. commit 842912c42e88748648901e22c238834f7a6ccb26 Author: Lucas Stach Date: Mon Dec 13 21:40:47 2021 +0100 arm64: dts: imx8mm: don't assign PLL2 in SoC dtsi The base i.MX8MM dtsi changes the audio PLL2 rate, which gets in the way if it should be used for anything else than audio. As this PLL doesn't seem to be used by any upstream supported board, just remove the rate configuration to allow boards to set it up as they wish. Signed-off-by: Lucas Stach Signed-off-by: Shawn Guo commit 0baddea60e8d536fd240008882128fc32eda74d6 Author: Jernej Skrabec Date: Mon Nov 29 19:26:33 2021 +0100 arm64: dts: allwinner: h6: Add Hantro G2 node H6 SoC has a second VPU, dedicated to VP9 decoding. It's a slightly older design, though. Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20211129182633.480021-10-jernej.skrabec@gmail.com commit c720e38f4c2dd1e0b5cf4f7dcf8bb6951cd3856d Author: Johann Neuhauser Date: Mon Dec 13 12:18:08 2021 +0100 ARM: imx_v6_v7_defconfig: Enable for DHCOM devices required RTC_DRV_RV3029C2 All imx6 DHCOM devices uses a on module gold cap/battery powered i2c rtc "microcrystal,rv3029", which isn't enabled in the imx_v6_v7_defconfig. The rtc for all imx6 DHCOM devices is defined in: imx6qdl-dhcom-som.dtsi To have a working clock on all imx6qdl DHCOM based devices, enable the driver. Signed-off-by: Johann Neuhauser Signed-off-by: Shawn Guo commit d66e4c985dd48c69dc70b8be1dabeaa3d77789fb Author: Colin Ian King Date: Fri Nov 26 22:12:39 2021 +0000 clk: stm32mp1: remove redundant assignment to pointer data The pointer data is being initialized with a value and a few lines later on being re-assigned the same value, so this re-assignment is redundant. Clean up the code and remove it. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20211126221239.1100960-1-colin.i.king@gmail.com Signed-off-by: Stephen Boyd commit 6fc058a72f3b7b07fc4de6d66ad1f68951b00f6e Author: Dillon Min Date: Tue Oct 26 15:11:21 2021 +0800 clk: stm32: Fix ltdc's clock turn off by clk_disable_unused() after system enter shell stm32's clk driver register two ltdc gate clk to clk core by clk_hw_register_gate() and clk_hw_register_composite() first: 'stm32f429_gates[]', clk name is 'ltdc', which no user to use. second: 'stm32f429_aux_clk[]', clk name is 'lcd-tft', used by ltdc driver both of them point to the same offset of stm32's RCC register. after kernel enter console, clk core turn off ltdc's clk as 'stm32f429_gates[]' is no one to use. but, actually 'stm32f429_aux_clk[]' is in use. stm32f469/746/769 have the same issue, fix it. Fixes: daf2d117cbca ("clk: stm32f4: Add lcd-tft clock") Link: https://lore.kernel.org/linux-arm-kernel/1590564453-24499-7-git-send-email-dillon.minfei@gmail.com/ Link: https://lore.kernel.org/lkml/CAPTRvHkf0cK_4ZidM17rPo99gWDmxgqFt4CDUjqFFwkOeQeFDg@mail.gmail.com/ Signed-off-by: Dillon Min Reviewed-by: Patrice Chotard Acked-by: Gabriel Fernandez Acked-by: Stephen Boyd Link: https://lore.kernel.org/r/1635232282-3992-10-git-send-email-dillon.minfei@gmail.com Signed-off-by: Stephen Boyd commit 6ad102e05d211aba0ee9c811936eda4341ee5a75 Author: Vinod Koul Date: Mon Dec 13 18:44:50 2021 +0530 phy: qcom-qmp: Add SM8450 USB QMP PHYs Add support for the USB DP & UNI PHYs found on SM8450. This is same as the phy version used on SM8350 and sequences turned out to be same, so use the same table from SM8350 for this as well. Signed-off-by: Vinod Koul Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211213131450.535775-3-vkoul@kernel.org Signed-off-by: Vinod Koul commit 03eacc3c6523749294d2d0922591c0ad78a0b633 Author: Vinod Koul Date: Mon Dec 13 18:44:49 2021 +0530 dt-bindings: phy: qcom,qmp: Add SM8450 USB3 PHY Add compatible string for USB QMP phy in Qualcomm SM8450 SoC Signed-off-by: Vinod Koul Acked-by: Rob Herring Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211213131450.535775-2-vkoul@kernel.org Signed-off-by: Vinod Koul commit d8f0136919128135b0a7a7e3a05dca5b569eef45 Author: Vinod Koul Date: Mon Dec 13 18:44:48 2021 +0530 dt-bindings: phy: qcom,usb-snps-femto-v2: Add bindings for SM8450 Document the compatible string for USB phy found in Qualcomm SM8450 SoC Signed-off-by: Vinod Koul Acked-by: Rob Herring Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211213131450.535775-1-vkoul@kernel.org Signed-off-by: Vinod Koul commit 92d2c17edb2a796ed548b3b50da46c8a29e28e0f Author: Lucas Stach Date: Sun Dec 12 14:49:12 2021 +0100 arm64: dts: nitrogen8-som: correct i2c1 pad-ctrl The slew rate and drive-strength of the i2c1 pads were much too high. Bring them down to avoid signal quality issues. Signed-off-by: Lucas Stach Signed-off-by: Shawn Guo commit ee47d510b4d2a771ff42b2dca637195ec5e24d0b Author: Lucas Stach Date: Sat Dec 11 23:17:43 2021 +0100 arm64: dts: nitrogen8-som: correct network PHY reset Add the missing reset-gpios property to allow Linux to fully reset the network PHY and fix the pinmux to add the neccessary pull-ups for the PHY strap configuration. Signed-off-by: Lucas Stach Signed-off-by: Shawn Guo commit ff5f87cb6a75dbf6d30668d2464e46249dd5c47f Author: Hans de Goede Date: Fri Dec 3 11:28:49 2021 +0100 clk: Introduce clk-tps68470 driver The TPS68470 PMIC provides Clocks, GPIOs and Regulators. At present in the kernel the Regulators and Clocks are controlled by an OpRegion driver designed to work with power control methods defined in ACPI, but some platforms lack those methods, meaning drivers need to be able to consume the resources of these chips through the usual frameworks. This commit adds a driver for the clocks provided by the tps68470, and is designed to bind to the platform_device registered by the intel_skl_int3472 module. This is based on this out of tree driver written by Intel: https://github.com/intel/linux-intel-lts/blob/4.14/base/drivers/clk/clk-tps68470.c with various cleanups added. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211203102857.44539-7-hdegoede@redhat.com Signed-off-by: Stephen Boyd commit 55c174e5c05f93b676c595b927bf74c32274356c Merge: fa55b7dcdc43c 97c2259ec7757 Author: Stephen Boyd Date: Wed Dec 15 20:11:38 2021 -0800 Merge tag 'platform-drivers-x86-int3472-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 into clk-x86 Signed tag for the immutable platform-drivers-x86-int3472 branch This branch contains 5.16-rc1 + the pending ACPI/i2c, tps68570 platform_data and INT3472 driver patches. * tag 'platform-drivers-x86-int3472-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86: platform/x86: int3472: Deal with probe ordering issues platform/x86: int3472: Pass tps68470_regulator_platform_data to the tps68470-regulator MFD-cell platform/x86: int3472: Pass tps68470_clk_platform_data to the tps68470-regulator MFD-cell platform/x86: int3472: Add get_sensor_adev_and_name() helper platform/x86: int3472: Split into 2 drivers platform_data: Add linux/platform_data/tps68470.h file i2c: acpi: Add i2c_acpi_new_device_by_fwnode() function i2c: acpi: Use acpi_dev_ready_for_enumeration() helper ACPI: delay enumeration of devices with a _DEP pointing to an INT3472 device commit e8f24c58d1b69ecf410a673c22f546dc732bb879 Author: Phil Elwell Date: Mon Dec 6 09:22:37 2021 +0000 ARM: dts: gpio-ranges property is now required Since [1], added in 5.7, the absence of a gpio-ranges property has prevented GPIOs from being restored to inputs when released. Add those properties for BCM283x and BCM2711 devices. [1] commit 2ab73c6d8323 ("gpio: Support GPIO controllers without pin-ranges") Fixes: 2ab73c6d8323 ("gpio: Support GPIO controllers without pin-ranges") Signed-off-by: Phil Elwell Acked-by: Florian Fainelli Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20211206092237.4105895-3-phil@raspberrypi.com Signed-off-by: Linus Walleij commit 54dd5a419f26e994d64754d5f009e36825dec0db Author: Julian Braha Date: Wed Dec 15 16:40:22 2021 -0500 pinctrl: aspeed: fix unmet dependencies on MFD_SYSCON for PINCTRL_ASPEED When PINCTRL_ASPEED_G* is selected, and MFD_SYSCON is not selected, Kbuild gives the following warnings: WARNING: unmet direct dependencies detected for PINCTRL_ASPEED Depends on [n]: PINCTRL [=y] && (ARCH_ASPEED [=n] || COMPILE_TEST [=y]) && OF [=y] && MFD_SYSCON [=n] Selected by [y]: - PINCTRL_ASPEED_G4 [=y] && PINCTRL [=y] && (MACH_ASPEED_G4 [=n] || COMPILE_TEST [=y]) && OF [=y] WARNING: unmet direct dependencies detected for PINCTRL_ASPEED Depends on [n]: PINCTRL [=y] && (ARCH_ASPEED [=n] || COMPILE_TEST [=y]) && OF [=y] && MFD_S> Selected by [y]: - PINCTRL_ASPEED_G5 [=y] && PINCTRL [=y] && (MACH_ASPEED_G5 [=n] || COMPILE_TEST [=y]) && O> WARNING: unmet direct dependencies detected for PINCTRL_ASPEED Depends on [n]: PINCTRL [=y] && (ARCH_ASPEED [=n] || COMPILE_TEST [=y]) && OF [=y] && MFD_S> Selected by [y]: - PINCTRL_ASPEED_G6 [=y] && PINCTRL [=y] && (MACH_ASPEED_G6 [=n] || COMPILE_TEST [=y]) && O> This is because MACH_ASPEED_G* depend on (ARCH_ASPEED || COMPILE_TEST). ARCH_ASPEED enables the MFD_SYSCON dependency, but COMPILE_TEST doesn't. These unmet dependency bugs were detected by Kismet, a static analysis tool for Kconfig. Please advise if this is not the appropriate solution. Signed-off-by: Julian Braha Reviewed-by: Andrew Jeffery Link: https://lore.kernel.org/r/20211215214022.146391-1-julianbraha@gmail.com Signed-off-by: Linus Walleij commit f9b94d24269f9267ccdd41610d718643f5e4366b Merge: 8a8d6bbe1d3bc db1b2a8caf5b4 Author: Linus Walleij Date: Thu Dec 16 04:20:06 2021 +0100 Merge tag 'intel-pinctrl-v5.17-3' of gitolite.kernel.org:pub/scm/linux/kernel/git/pinctrl/intel into devel intel-pinctrl for v5.17-3 * Intel Baytrail and Cherryview IRQ related fixes The following is an automated git shortlog grouped by driver: baytrail: - Set IRQCHIP_SET_TYPE_MASKED flag on the irqchip cherryview: - Use temporary variable for struct device - Do not allow the same interrupt line to be used by 2 pins - Don't use selection 0 to mark an interrupt line as unused commit 8a8d6bbe1d3bc7137c777ba06246d7e9c08dde4d Author: Andy Shevchenko Date: Tue Dec 14 14:58:54 2021 +0200 pinctrl: Get rid of duplicate of_node assignment in the drivers GPIO library does copy the of_node from the parent device of the GPIO chip, there is no need to repeat this in the individual drivers. Remove these assignment all at once. For the details one may look into the of_gpio_dev_init() implementation. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211214125855.33207-1-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit 0013f5f5c05da6321539df6fad75de150f430909 Author: Matthew Brost Date: Tue Dec 14 09:05:00 2021 -0800 drm/i915/guc: Selftest for stealing of guc ids Testing the stealing of guc ids is hard from user space as we have 64k guc_ids. Add a selftest, which artificially reduces the number of guc ids, and forces a steal. The test creates a spinner which is used to block all subsequent submissions until it completes. Next, a loop creates a context and a NOP request each iteration until the guc_ids are exhausted (request creation returns -EAGAIN). The spinner is ended, unblocking all requests created in the loop. At this point all guc_ids are exhausted but are available to steal. Try to create another request which should successfully steal a guc_id. Wait on last request to complete, idle GPU, verify a guc_id was stolen via a counter, and exit the test. Test also artificially reduces the number of guc_ids so the test runs in a timely manner. v2: (John Harrison) - s/stole/stolen - Fix some wording in test description - Rework indexing into context array - Add test description to commit message - Fix typo in commit message (Checkpatch) - s/guc/(guc) in NUMBER_MULTI_LRC_GUC_ID v3: (John Harrison) - Set array value to NULL after extracting error - Fix a few typos in comments / error messages - Delete redundant comment in commit message Signed-off-by: Matthew Brost Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20211214170500.28569-8-matthew.brost@intel.com commit 2aa9f833dd08594584ce2add23a3cd11f0d623bf Author: Matthew Brost Date: Tue Dec 14 09:04:59 2021 -0800 drm/i915/guc: Kick G2H tasklet if no credits Let's be paranoid and kick the G2H tasklet, which dequeues messages, if G2H credits are exhausted. Signed-off-by: Matthew Brost Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20211214170500.28569-7-matthew.brost@intel.com commit 6e94d53962f7bc972582dbfb46b31f3a6e328a47 Author: Matthew Brost Date: Tue Dec 14 09:04:58 2021 -0800 drm/i915/guc: Add extra debug on CT deadlock Print CT state (H2G + G2H head / tail pointers, credits) on CT deadlock. v2: (John Harrison) - Add units to debug messages Reviewed-by: John Harrison Signed-off-by: Matthew Brost Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20211214170500.28569-6-matthew.brost@intel.com commit 2406846ec497af081d7e7a7da0e9938b8136fe16 Author: John Harrison Date: Tue Dec 14 09:04:57 2021 -0800 drm/i915/guc: Don't hog IRQs when destroying contexts While attempting to debug a CT deadlock issue in various CI failures (most easily reproduced with gem_ctx_create/basic-files), I was seeing CPU deadlock errors being reported. This were because the context destroy loop was blocking waiting on H2G space from inside an IRQ spinlock. There no was deadlock as such, it's just that the H2G queue was full of context destroy commands and GuC was taking a long time to process them. However, the kernel was seeing the large amount of time spent inside the IRQ lock as a dead CPU. Various Bad Things(tm) would then happen (heartbeat failures, CT deadlock errors, outstanding H2G WARNs, etc.). Re-working the loop to only acquire the spinlock around the list management (which is all it is meant to protect) rather than the entire destroy operation seems to fix all the above issues. v2: (John Harrison) - Fix typo in comment message Signed-off-by: John Harrison Signed-off-by: Matthew Brost Reviewed-by: Matthew Brost Link: https://patchwork.freedesktop.org/patch/msgid/20211214170500.28569-5-matthew.brost@intel.com commit 7aa6d5fe6cdb4347c427caaba38f11cc88a8ed4d Author: Matthew Brost Date: Tue Dec 14 09:04:56 2021 -0800 drm/i915/guc: Remove racey GEM_BUG_ON A full GT reset can race with the last context put resulting in the context ref count being zero but the destroyed bit not yet being set. Remove GEM_BUG_ON in scrub_guc_desc_for_outstanding_g2h that asserts the destroyed bit must be set in ref count is zero. Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: Matthew Brost Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20211214170500.28569-4-matthew.brost@intel.com commit 939d8e9c87e704fd5437e2c8b80929591fe540eb Author: Matthew Brost Date: Tue Dec 14 09:04:55 2021 -0800 drm/i915/guc: Only assign guc_id.id when stealing guc_id Previously assigned whole guc_id structure (list, spin lock) which is incorrect, only assign the guc_id.id. Fixes: 0f7976506de61 ("drm/i915/guc: Rework and simplify locking") Signed-off-by: Matthew Brost Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20211214170500.28569-3-matthew.brost@intel.com commit b25db8c782ad7ae80d4cea2a09c222f4f8980bb9 Author: Matthew Brost Date: Tue Dec 14 09:04:54 2021 -0800 drm/i915/guc: Use correct context lock when callig clr_context_registered s/ce/cn/ when grabbing guc_state.lock before calling clr_context_registered. Fixes: 0f7976506de61 ("drm/i915/guc: Rework and simplify locking") Signed-off-by: Matthew Brost Reviewed-by: Daniele Ceraolo Spurio Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20211214170500.28569-2-matthew.brost@intel.com commit 538e5f7106f61e6b8404b0509f71f518123968cd Author: Alistair Francis Date: Wed Dec 8 22:40:45 2021 +1000 ARM: dts: imx7d-remarkable2: add wacom digitizer device Add Wacom I2C support for the reMarkable 2 eInk tablet using the generic I2C HID framework. Signed-off-by: Alistair Francis Signed-off-by: Shawn Guo commit eb197dfe389a35566c8e27c537355aaed04fed67 Author: Michael Trimarchi Date: Fri Dec 10 10:23:19 2021 -0300 ARM: dts: imx6ulz-bsh-smm-m2: Add BSH SMM-M2 IMX6ULZ SystemMaster Add DTS of BSH SMM-M2 SystemMaster. This version comes with: - 128 MiB DDR3 RAM - 256 MiB Nand - wifi - bluetooth Signed-off-by: Ariel D'Alessandro Signed-off-by: Michael Trimarchi Signed-off-by: Shawn Guo commit 8df89a7cbc63c7598c00611ad17b67e8d5b4fad3 Author: Hans Verkuil Date: Mon Dec 6 14:16:48 2021 +0100 pinctrl-sunxi: don't call pinctrl_gpio_direction() Set the direction directly without calling pinctrl_gpio_direction(). This avoids the mutex_lock() calls in that function, which would invalid the can_sleep = false. Signed-off-by: Hans Verkuil Link: https://lore.kernel.org/r/20211206131648.1521868-4-hverkuil-cisco@xs4all.nl Signed-off-by: Linus Walleij commit 1a4541b68e250bc4b21bd4c6178877523c5d896b Author: Hans Verkuil Date: Mon Dec 6 14:16:47 2021 +0100 pinctrl-bcm2835: don't call pinctrl_gpio_direction() Set the direction directly without calling pinctrl_gpio_direction(). This avoids the mutex_lock() calls in that function, which would invalid the can_sleep = false. Signed-off-by: Hans Verkuil Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20211206131648.1521868-3-hverkuil-cisco@xs4all.nl Signed-off-by: Linus Walleij commit 4667431419e93b63b4edfe7abdfc96cefcbcc051 Author: Tzung-Bi Shih Date: Tue Dec 14 14:31:00 2021 +0800 PM / devfreq: Reduce log severity for informative message Suppose devfreq_update_status() failure in devfreq_set_target() is not a critical error, reduces the log severity. Signed-off-by: Tzung-Bi Shih Signed-off-by: Chanwoo Choi commit a4b3c62fd0e8673cb6708ad65551020c8e25d3f2 Author: Arnd Bergmann Date: Wed Dec 15 15:03:09 2021 +0100 PM / devfreq: sun8i: addd COMMON_CLK dependency Compile-testing the driver without CONFIG_COMMON_CLK causes a link failure: arm-linux-gnueabi-ld: drivers/devfreq/sun8i-a33-mbus.o: in function `sun8i_a33_mbus_remove': sun8i-a33-mbus.c:(.text+0x450): undefined reference to `clk_rate_exclusive_put' arm-linux-gnueabi-ld: sun8i-a33-mbus.c:(.text+0x460): undefined reference to `clk_rate_exclusive_put' arm-linux-gnueabi-ld: drivers/devfreq/sun8i-a33-mbus.o: in function `sun8i_a33_mbus_probe': sun8i-a33-mbus.c:(.text+0x85c): undefined reference to `clk_rate_exclusive_get' arm-linux-gnueabi-ld: sun8i-a33-mbus.c:(.text+0x878): undefined reference to `clk_rate_exclusive_get' Fixes: 8bfd4858b4bb ("PM / devfreq: Add a driver for the sun8i/sun50i MBUS") Signed-off-by: Arnd Bergmann Signed-off-by: Chanwoo Choi commit 0f2ee77d2655bd4bb205fff16822e551159f41c9 Merge: fb6c83cab376c fc5adc2bb13a6 Author: Mark Brown Date: Thu Dec 16 02:19:14 2021 +0000 ASoC: Changes to SOF kcontrol data set/get ops Merge series from Ranjani Sridharan : This set of patches deals with modifications to the signature of kcontrol get/set data functions to make them more intuitive. The last patch deals with initializing the binary control data size after boot up. commit bd1d97d861e4f222c98a2418243e987fefe4de4e Merge: 3bc14ea0d12a5 284ca7647c676 Author: Jakub Kicinski Date: Wed Dec 15 17:29:27 2021 -0800 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, mostly rather small housekeeping patches: 1) Remove unused variable in IPVS, from GuoYong Zheng. 2) Use memset_after in conntrack, from Kees Cook. 3) Remove leftover function in nfnetlink_queue, from Florian Westphal. 4) Remove redundant test on bool in conntrack, from Bernard Zhao. 5) egress support for nft_fwd, from Lukas Wunner. 6) Make pppoe work for br_netfilter, from Florian Westphal. 7) Remove unused variable in conntrack resize routine, from luo penghao. * git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next: netfilter: conntrack: Remove useless assignment statements netfilter: bridge: add support for pppoe filtering netfilter: nft_fwd_netdev: Support egress hook netfilter: ctnetlink: remove useless type conversion to bool netfilter: nf_queue: remove leftover synchronize_rcu netfilter: conntrack: Use memset_startat() to zero struct nf_conn ipvs: remove unused variable for ip_vs_new_dest ==================== Link: https://lore.kernel.org/r/20211215234911.170741-1-pablo@netfilter.org Signed-off-by: Jakub Kicinski commit ad659ccb5412874c6a89d3588cb18857c00e9d0f Author: David Gow Date: Wed Dec 15 12:50:14 2021 -0800 kunit: tool: Default --jobs to number of CPUs The --jobs parameter for kunit_tool currently defaults to 8 CPUs, regardless of the number available. For systems with significantly more (or less), this is not as efficient. Instead, default --jobs to the number of CPUs available to the process: while there are as many superstitions as to exactly what the ideal jobs:CPU ratio is, this seems sufficiently sensible to me. A new helper function to get the default number of jobs is added: get_default_jobs() -- this is used in kunit_tool_test instead of a hardcoded value, or an explicit call to len(os.sched_getaffinity()), so should be more flexible if this needs to change in the future. Signed-off-by: David Gow Signed-off-by: Daniel Latypov Reviewed-by: Daniel Latypov Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 85310a62ca4e415980e30d9d07f904444197cfc4 Author: Daniel Latypov Date: Wed Dec 15 12:39:23 2021 -0800 kunit: tool: fix newly introduced typechecker errors After upgrading mypy and pytype from pip, we see 2 new errors when running ./tools/testing/kunit/run_checks.py. Error #1: mypy and pytype They now deduce that importlib.util.spec_from_file_location() can return None and note that we're not checking for this. We validate that the arch is valid (i.e. the file exists) beforehand. Add in an `asssert spec is not None` to appease the checkers. Error #2: pytype bug https://github.com/google/pytype/issues/1057 It doesn't like `from datetime import datetime`, specifically that a type shares a name with a module. We can workaround this by either * renaming the import or just using `import datetime` * passing the new `--fix-module-collisions` flag to pytype. We pick the first option for now because * the flag is quite new, only in the 2021.11.29 release. * I'd prefer if people can just run `pytype ` Signed-off-by: Daniel Latypov Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 857548cbcf82fbb1fa3824978a98002b4d49b9a7 Author: Rob Clark Date: Wed Dec 15 09:45:06 2021 -0800 drm/msm/disp: Tweak display snapshot to match gpu snapshot Add UTS_RELEASE and show timestamp the same way for consistency. Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20211215174524.1742389-2-robdclark@gmail.com Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 8ecfef96cdcd857d4866fc91e5ed05d97946285f Author: Dmitry Baryshkov Date: Wed Dec 15 19:09:12 2021 +0300 drm/msm/dpu: add dpu_plane_atomic_print_state Implement plane's atomic_print_state() callback, printing DPU-specific plane state: blending stage, SSPP and multirect mode and index. Signed-off-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/20211215160912.2715956-2-dmitry.baryshkov@linaro.org [DB: marked pdpu and pstate as const] Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 53b53337e112a749d7e60ff9140b61d021d38cc9 Author: Dmitry Baryshkov Date: Wed Dec 15 19:09:11 2021 +0300 drm/msm/dpu: add dpu_crtc_atomic_print_state Implement CRTC's atomic_print_state() callback, printing DPU-specific CRTC state (LM, CTL and DSPP ids). Signed-off-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/20211215160912.2715956-1-dmitry.baryshkov@linaro.org [DB: marked cstate as const] Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 48d0cf4a7cf2d5447f997e232c6378bb02434655 Author: Dan Carpenter Date: Wed Dec 15 14:49:01 2021 +0300 drm/msm/dp: Fix double free on error in msm_dp_bridge_init() The "dp_bridge" pointer is allocated with devm_kzalloc() so it will be freed automatically. Kfreeing it here will only lead to a double free. Fixes: 8a3b4c17f863 ("drm/msm/dp: employ bridge mechanism for display enable and disable") Signed-off-by: Dan Carpenter Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20211215114900.GD14552@kili Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 37897856ab1e3772994c71df3b6fc71fe508518d Author: Dmitry Baryshkov Date: Thu Dec 2 01:26:32 2021 +0300 drm/msm/dpu: simplify DPU's regset32 code Squash dpu_debugfs_setup_regset32() into dpu_debugfs_create_regset32(). it makes little sense to have separate function to just setup the structure. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20211201222633.2476780-8-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 927e8bcaa783286172c478d182f550f30bfe36bb Author: Dmitry Baryshkov Date: Thu Dec 2 01:26:31 2021 +0300 drm/msm/dpu: stop manually removing debugfs files for the DPU CRTC DRM code handles removing all debugfs recursively. Drop CRTC-specific code to perform that. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20211201222633.2476780-7-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 4d45cace1da64625e5224d7c4a5b189ae7439020 Author: Dmitry Baryshkov Date: Thu Dec 2 01:26:30 2021 +0300 drm/msm/dpu: stop manually removing debugfs files for the DPU plane DRM code handles removing all debugfs recursively. Drop plane-specific code to perform that. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20211201222633.2476780-6-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 6e85af1e43069129d32a287eeeaf6f7dea6c1123 Author: Dmitry Baryshkov Date: Thu Dec 2 01:26:29 2021 +0300 drm/msm/dpu: drop plane's default_scaling debugfs file Proper support for the 'default_scaling' debugfs file was removed during DPU driver pre-merge cleanup. Remove leftover file. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20211201222633.2476780-5-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 1a24e099c382adc062966e5e45e977e0283303db Author: Dmitry Baryshkov Date: Thu Dec 2 01:26:28 2021 +0300 drm/msm/dpu: make danger_status/safe_status readable Change \t to \n in the print format to stop putting all SSPP status in a single line. Splitting it to one SSPP per line is much more readable. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20211201222633.2476780-4-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit f31b0e24d31e18b4503eeaf0032baeacc0beaff6 Author: Dmitry Baryshkov Date: Thu Dec 2 01:26:27 2021 +0300 drm/msm/dpu: fix safe status debugfs file Make safe_status debugfs fs file actually return safe status rather than danger status data. Fixes: 25fdd5933e4c ("drm/msm: Add SDM845 DPU support") Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20211201222633.2476780-3-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 96536242f1ee17fcd64e415234ee185d2bfe9b8c Author: Dmitry Baryshkov Date: Thu Dec 2 01:26:26 2021 +0300 drm/msm/dpu: move disable_danger out of plane subdir The disable_danger debugfs file is not related to a single plane. Instead it is used by all registered planes. Move it from plane subtree to the global subtree next to danger_status and safe_status files, so that the new file supplements them. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20211201222633.2476780-2-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 284ca7647c67683b32f4f8c0dec6cc38cb2cb9f8 Author: luo penghao Date: Wed Dec 8 07:57:06 2021 +0000 netfilter: conntrack: Remove useless assignment statements The old_size assignment here will not be used anymore The clang_analyzer complains as follows: Value stored to 'old_size' is never read Reported-by: Zeal Robot Signed-off-by: luo penghao Signed-off-by: Pablo Neira Ayuso commit f59f93cd1d720809466c7fd5aa16a236156c672b Author: Mathias Nyman Date: Fri Dec 10 13:16:53 2021 +0200 usb: hub: avoid warm port reset during USB3 disconnect During disconnect USB-3 ports often go via SS.Inactive link error state before the missing terminations are noticed, and link finally goes to RxDetect state Avoid immediately warm-resetting ports in SS.Inactive state. Let ports settle for a while and re-read the link status a few times 20ms apart to see if the ports transitions out of SS.Inactive. According to USB 3.x spec 7.5.2, a port in SS.Inactive should automatically check for missing far-end receiver termination every 12 ms (SSInactiveQuietTimeout) The futile multiple warm reset retries of a disconnected device takes a lot of time, also the resetting of a removed devices has caused cases where the reset bit got stuck for a long time on xHCI roothub. This lead to issues in detecting new devices connected to the same port shortly after. Tested-by: Mark Pearson Signed-off-by: Mathias Nyman Link: https://lore.kernel.org/r/20211210111653.1378381-1-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit a1f79504ceb3ffcd2b777e5ac84c97a0948c2dbd Author: Yang Yingliang Date: Wed Dec 15 11:58:05 2021 +0800 usb: host: xen-hcd: add missing unlock in error path Add the missing unlock before return from function xenhcd_urb_request_done() and xenhcd_conn_notify() in the error handling case. Fixes: 494ed3997d75 ("usb: Introduce Xen pvUSB frontend (xen hcd)") Reported-by: Hulk Robot Reviewed-by: Juergen Gross Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20211215035805.375244-1-yangyingliang@huawei.com Signed-off-by: Greg Kroah-Hartman commit a5b5b45fce2bed5560159095b4777afb18590740 Author: Manish Narani Date: Mon Dec 6 21:57:01 2021 +0530 dt-bindings: usb: dwc3-xilinx: Convert USB DWC3 bindings Convert USB DWC3 bindings to DT schema format using json-schema. Reviewed-by: Rob Herring Signed-off-by: Manish Narani Link: https://lore.kernel.org/r/1638808021-26921-1-git-send-email-manish.narani@xilinx.com Signed-off-by: Greg Kroah-Hartman commit 856d3624489a4906b8a95de7bb8311ca6e25b3b9 Author: Amelie Delaunay Date: Tue Dec 7 13:08:29 2021 +0100 usb: dwc2: platform: adopt dev_err_probe() to silent probe defer In case of probe defer, a message is logged for resets and clocks. Use dev_err_probe to log the message only when error code is not -517. Simplify phy, regulators and drd probe defer handling with dev_err_probe(). Then, take benefit of devices_deferred debugfs in case of probe deferral. Acked-by: Minas Harutyunyan Signed-off-by: Amelie Delaunay Link: https://lore.kernel.org/r/20211207120829.266837-1-amelie.delaunay@foss.st.com Signed-off-by: Greg Kroah-Hartman commit ef5ad2608511596b8bd28f1e2b4fa8fadfd2f536 Author: Dang Huynh Date: Tue Nov 23 23:19:22 2021 +0700 ARM: dts: qcom: Drop input-name property This property doesn't seem to exist in the documentation nor in source code, but for some reason it is defined in a bunch of device trees. Signed-off-by: Dang Huynh Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211123161919.1506755-1-danct12@riseup.net commit 9fd4cf5d3571b27d746b8ead494a3f051485b679 Author: Frank Rowand Date: Sun Dec 12 16:18:52 2021 -0600 of: unittest: 64 bit dma address test requires arch support If an architecture does not support 64 bit dma addresses then testing for an expected dma address >= 0x100000000 will fail. Fixes: e0d072782c73 ("dma-mapping: introduce DMA range map, supplanting dma_pfn_offset") Signed-off-by: Frank Rowand Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211212221852.233295-1-frowand.list@gmail.com commit a8d61a9112ad0c9216ab45d050991e07bc4f3408 Author: Jim Quinlan Date: Fri Dec 10 13:46:35 2021 -0500 of: unittest: fix warning on PowerPC frame size warning The struct device variable "dev_bogus" was triggering this warning on a PowerPC build: drivers/of/unittest.c: In function 'of_unittest_dma_ranges_one.constprop': [...] >> The frame size of 1424 bytes is larger than 1024 bytes [-Wframe-larger-than=] This variable is now dynamically allocated. Fixes: e0d072782c734 ("dma-mapping: introduce DMA range map, supplanting dma_pfn_offset") Reported-by: kernel test robot Signed-off-by: Jim Quinlan Reviewed-by: Christoph Hellwig Reviewed-by: Frank Rowand Reviewed-by: Florian Fainelli Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211210184636.7273-2-jim2101024@gmail.com commit 1957339b6e71c523189e195059882909ddf69f27 Author: David Heidelberg Date: Wed Dec 8 19:34:34 2021 +0100 dt-bindings: input: pwm-vibrator: Convert txt bindings to yaml Converts txt binding to new YAML format and simplify example. Reviewed-by: Sebastian Reichel Signed-off-by: David Heidelberg Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211208183434.98087-1-david@ixit.cz commit bf0a257a9418ebcbe6ab2a73728f76969942e52a Author: Dmitry Baryshkov Date: Wed Dec 15 10:04:40 2021 +0530 arm64: dts: qcom: sm8450: add i2c13 and i2c14 device nodes Add device tree nodes for two i2c blocks: i2c13 and i2c14. Signed-off-by: Dmitry Baryshkov Signed-off-by: Vinod Koul Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211215043440.605624-12-vkoul@kernel.org commit 015a89f0d317dce4d2174059155c2fc39db7cbc8 Author: Vladimir Zapolskiy Date: Wed Dec 15 10:04:39 2021 +0530 arm64: dts: qcom: sm8450: add cpufreq support The change adds a description of a SM8450 cpufreq-epss controller and references to it from CPU nodes. Signed-off-by: Vladimir Zapolskiy Signed-off-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211215043440.605624-11-vkoul@kernel.org commit 61eba74e473ed4cd64ec17440092f4a98913cda3 Author: Dmitry Baryshkov Date: Wed Dec 15 10:04:38 2021 +0530 arm64: dts: qcom: sm8450: Add rpmhpd node This adds RPMH power domain found in SM8450 SoC Signed-off-by: Dmitry Baryshkov Signed-off-by: Vinod Koul Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211215043440.605624-10-vkoul@kernel.org commit 8f8f98c881686d21fc937f469d3a198f2f9bb9ba Author: Vinod Koul Date: Wed Dec 15 10:04:37 2021 +0530 arm64: dts: qcom: sm8450-qrd: enable ufs nodes Enable the UFS and phy node and add the regulators used by them. Signed-off-by: Vinod Koul Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211215043440.605624-9-vkoul@kernel.org commit 07fa917a335e139a108e94085c6beac3098e3874 Author: Vinod Koul Date: Wed Dec 15 10:04:36 2021 +0530 arm64: dts: qcom: sm8450: add ufs nodes Add the UFS and QMP PHY node for SM8450 SoC Signed-off-by: Vinod Koul Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211215043440.605624-8-vkoul@kernel.org commit 128914ad230354ab4af9c3b86fdce2147f467553 Author: Vinod Koul Date: Wed Dec 15 10:04:35 2021 +0530 arm64: dts: qcom: sm8450-qrd: Add rpmh regulator nodes Add the RPMH regulators found in QRD-SM8450 platform Signed-off-by: Vinod Koul Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211215043440.605624-7-vkoul@kernel.org commit 24de05c38e6bfe80fccc3b632c142accfaa7232d Author: Vinod Koul Date: Wed Dec 15 10:04:34 2021 +0530 arm64: dts: qcom: Add base SM8450 QRD DTS Add DTS for Qualcomm QRD platform which uses SM8450 SoC and mark the reserved nodes. Signed-off-by: Vinod Koul Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211215043440.605624-6-vkoul@kernel.org commit 892d5395396d5515c42e502810884225776b3b10 Author: Vinod Koul Date: Wed Dec 15 10:04:33 2021 +0530 arm64: dts: qcom: sm8450: add smmu nodes Add the apps smmu node as found in the SM8450 SoC Signed-off-by: Vinod Koul Acked-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211215043440.605624-5-vkoul@kernel.org commit 285f97bc4b017b013d273a69ba3ee12252990812 Author: Vinod Koul Date: Wed Dec 15 10:04:32 2021 +0530 arm64: dts: qcom: sm8450: Add reserved memory nodes Add the reserved memory nodes for SM8450. This is based on the downstream documentation. Signed-off-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211215043440.605624-4-vkoul@kernel.org commit ec950d55728459248e78f5c70ab3e3c2f7c22e38 Author: Vinod Koul Date: Wed Dec 15 10:04:31 2021 +0530 arm64: dts: qcom: sm8450: Add tlmm nodes Add tlmm node found in SM8450 SoC and uart pin configuration Signed-off-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211215043440.605624-3-vkoul@kernel.org commit 5188049c9b36d718124e2cce91803a26a34a0ad6 Author: Vinod Koul Date: Wed Dec 15 10:04:30 2021 +0530 arm64: dts: qcom: Add base SM8450 DTSI This add based DTSI for SM8450 SoC and includes base description of CPUs, GCC, RPMHCC, UART, interuupt-controller which helps to boot to shell with console on boards with this SoC Signed-off-by: Vinod Koul Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211215043440.605624-2-vkoul@kernel.org commit 72cb4c48a46a7cfa58eb5842c0d3672ddd5bd9ad Author: Baruch Siach Date: Tue Dec 7 09:27:10 2021 +0200 arm64: dts: qcom: ipq6018: Fix gpio-ranges property There must be three parameters in gpio-ranges property. Fixes this not very helpful error message: OF: /soc/pinctrl@1000000: (null) = 3 found 3 Fixes: 1e8277854b49 ("arm64: dts: Add ipq6018 SoC and CP01 board support") Cc: Sricharan R Signed-off-by: Baruch Siach Tested-by: Bryan O'Donoghue Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/8a744cfd96aff5754bfdcf7298d208ddca5b319a.1638862030.git.baruch@tkos.co.il commit c8b9d64bb262033775ff64dde6ca7cf18899651b Author: David Heidelberg Date: Mon Dec 13 20:02:28 2021 +0100 arm64: dts: qcom: sdm845: add QFPROM chipset specific compatible Use correct compatible according to dt-binding. Fixes + few other lines of `make qcom/sdm845-oneplus-fajita.dtb`: arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dt.yaml: qfprom@784000: compatible: ['qcom,qfprom'] is too short From schema: Documentation/devicetree/bindings/nvmem/qcom,qfprom.yaml Signed-off-by: David Heidelberg Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211213190228.106924-1-david@ixit.cz commit d5e12f3823aed1e35ee2411bdf0ab61dc1011387 Author: Bjorn Andersson Date: Mon Oct 4 20:25:31 2021 -0700 arm64: dts: qcom: sdm845: mtp: Add vadc channels and thermal zones Downstream defines four ADC channels related to thermal sensors external to the PM8998 and two channels for internal voltage measurements. Add these to the upstream SDM845 MTP, describe the thermal monitor channels and add thermal_zones for these. Signed-off-by: Bjorn Andersson Reviewed-by: Vinod Koul Link: https://lore.kernel.org/r/20211005032531.2251928-5-bjorn.andersson@linaro.org commit 4cc7c85cccc87e436a86b4281ddcd886eb0bf58f Author: Bjorn Andersson Date: Mon Oct 4 20:25:30 2021 -0700 arm64: dts: qcom: pm8998: Add ADC Thermal Monitor node Add a node for the ADC Thermal Monitor found in the PM8998 PMIC. This is used to connect thermal zones with ADC channels. Signed-off-by: Bjorn Andersson Reviewed-by: Vinod Koul Link: https://lore.kernel.org/r/20211005032531.2251928-4-bjorn.andersson@linaro.org commit 409fd3f10c0b71dabff735d5f290096d6bb6b4df Author: David Heidelberg Date: Wed Dec 8 19:47:06 2021 +0100 arm64: qcom: dts: drop legacy property #stream-id-cells Property #stream-id-cells is legacy leftover and isn't currently documented nor used. Signed-off-by: David Heidelberg Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211208184707.100716-1-david@ixit.cz commit 2bf0038f20b8c9ca340acbeb5ebedf7bfa554fee Merge: 202f69cd4e1da 72a0ca203ca7f Author: Bjorn Andersson Date: Tue Dec 14 21:25:52 2021 -0600 Merge tag '20211207114003.100693-2-vkoul@kernel.org' into arm64-for-5.17 v5.16-rc1 + 20211207114003.100693-2-vkoul@kernel.org The immutable branch contains DT binding and in defines for the global clock controller registers used the the Qualcomm SM8450 dtsi. commit 202f69cd4e1dad6c86a35d8b29fc693877c6c91d Author: Konrad Dybcio Date: Thu Dec 2 01:43:28 2021 +0100 Revert "arm64: dts: qcom: sm8350: Specify clock-frequency for arch timer" This reverts commit ed9500c1df59437856d43e657f185fb1eb5d817d. The clock-frequency property was meant to aid platforms with broken firmwares that don't set up the timer properly on their own. Don't include it where it is not the case. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211202004328.459899-1-konrad.dybcio@somainline.org commit ef10e1b89508d3315e47e23098fec60b33b1f6b3 Author: Srinivas Kandagatla Date: Thu Dec 9 17:53:42 2021 +0000 arm64: dts: qcom: c630: add headset jack and button detection support Add MBHC support available in WCD934X codec. Signed-off-by: Srinivas Kandagatla Tested-by: Steev Klimaszewski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211209175342.20386-3-srinivas.kandagatla@linaro.org commit c02b360ca67ebeb9de07b47b2fe53f964c2561d1 Author: Srinivas Kandagatla Date: Thu Dec 9 17:53:41 2021 +0000 arm64: dts: qcom: c630: Fix soundcard setup Currently Soundcard has 1 rx device for headset and SoundWire Speaker Playback. This setup has issues, ex if we try to play on headset the audio stream is also sent to SoundWire Speakers and we will hear sound in both headsets and speakers. Make a separate device for Speakers and Headset so that the streams are different and handled properly. Fixes: 45021d35fcb2 ("arm64: dts: qcom: c630: Enable audio support") Signed-off-by: Srinivas Kandagatla Tested-by: Steev Klimaszewski Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211209175342.20386-2-srinivas.kandagatla@linaro.org commit 77850bda360dd9b389d5064c64b79467d613c3d6 Author: Tudor Ambarus Date: Thu Dec 9 14:29:39 2021 +0200 spi: atmel,quadspi: Define sama7g5 QSPI sama7g5 embedds 2 instances of the QSPI controller: 1/ One Octal Serial Peripheral Interface (QSPI0) Supporting up to 200 MHz DDR. Octal, TwinQuad, HyperFlash and OctaFlash Protocols Supported 2/ One Quad Serial Peripheral Interface (QSPI1) Supporting Up to 90 MHz DDR/133 MHz SDR Signed-off-by: Tudor Ambarus Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211209122939.339810-3-tudor.ambarus@microchip.com Signed-off-by: Mark Brown commit 001a41d2a7061694fa31accdbc2013bb5c5d83b5 Author: Tudor Ambarus Date: Thu Dec 9 14:29:38 2021 +0200 spi: atmel,quadspi: Convert to json-schema Convert the Atmel QuadSPI controller Device Tree binding documentation to json-schema. Signed-off-by: Tudor Ambarus Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211209122939.339810-2-tudor.ambarus@microchip.com Signed-off-by: Mark Brown commit 0fc31d8f1a8ad17224f6423e3ed6234507375d48 Author: Hans de Goede Date: Fri Dec 3 11:28:48 2021 +0100 regulator: Introduce tps68470-regulator driver The TPS68470 PMIC provides Clocks, GPIOs and Regulators. At present in the kernel the Regulators and Clocks are controlled by an OpRegion driver designed to work with power control methods defined in ACPI, but some platforms lack those methods, meaning drivers need to be able to consume the resources of these chips through the usual frameworks. This commit adds a driver for the regulators provided by the tps68470, and is designed to bind to the platform_device registered by the intel_skl_int3472 module. This is based on this out of tree driver written by Intel: https://github.com/intel/linux-intel-lts/blob/4.14/base/drivers/regulator/tps68470-regulator.c with various cleanups added. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211203102857.44539-6-hdegoede@redhat.com Signed-off-by: Mark Brown commit fb6c83cab376c0963341a9521e85c1795acaec9b Author: Pierre-Louis Bossart Date: Wed Dec 15 10:35:11 2021 -0600 ASoC: AMD: fix depend/select mistake on SND_AMD_ACP_CONFIG on i386 or x86_64: when # CONFIG_ACPI is not set, so SND_SOC_ACPI is not set: WARNING: unmet direct dependencies detected for SND_AMD_ACP_CONFIG Depends on [n]: SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && SND_SOC_ACPI [=n] Selected by [y]: - SND_SOC_AMD_ACP_COMMON [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && X86 [=y] && PCI [=y] This problem is due to the unconditional selection of SND_AMD_ACP_CONFIG in other options. Using 'depends on' solved an initial problem but exposed another, let's use select instead. Reported-by: Randy Dunlap Fixes: d9b994cd7641 ('ASoC: AMD: acp-config: fix missing dependency on SND_SOC_ACPI') Signed-off-by: Pierre-Louis Bossart Acked-by: Randy Dunlap # build-tested Reviewed-by: Daniel Baluta Reviewed-by: Ranjani Sridharan Reviewed-by: Ajit Kumar Pandey Link: https://lore.kernel.org/r/20211215163511.151286-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 88dffe43cbc625eb52a57daa0d1c0fb7037b63d2 Author: David Heidelberg Date: Sat Dec 11 23:49:44 2021 +0100 ASoC: nvidia,tegra-audio: Convert multiple txt bindings to yaml Convert Tegra audio complex with the * ALC5632 * MAX98090 * RT5640 * RT5677 * SGTL5000 * TrimSlice * WM8753 * WM8903 * WM9712 codec to the YAML format. Additional changes: - added missing HPOUTL to the WM9712 codec. - extended rt5677 codec with multiple pins Reviewed-by: Dmitry Osipenko Signed-off-by: David Heidelberg Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211211224946.79875-1-david@ixit.cz Signed-off-by: Mark Brown commit fc5adc2bb13a6988df7ce377320f381add236002 Author: Ranjani Sridharan Date: Wed Dec 15 10:04:04 2021 -0800 ASoC: SOF: topology: read back control data from DSP Read back the control data from the DSP to initialize the control data size to match that of the data in the DSP. This is particularly useful for volatile read-only kcontrols in static pipelines. Signed-off-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20211215180404.53254-9-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 47d7328f8cda15e60422c8ca36d067c4deb19b7e Author: Peter Ujfalusi Date: Wed Dec 15 10:04:03 2021 -0800 ASoC: SOF: Drop ctrl_type parameter for snd_sof_ipc_set_get_comp_data() The SOF_CTRL_TYPE_VALUE_COMP_* type is not used by the firmware nor in the kernel side. It is also not clear what action should be taken for such type. With this in mind: The correct ipc_cmd can be selected based on the `ctrl_cmd` and the `set` parameters: if the ctrl_cmd is SOF_CTRL_CMD_BINARY then SOF_CTRL_TYPE_DATA_* otherwise SOF_CTRL_TYPE_VALUE_CHAN_*. The SET or GET direction can be selected with the use of `set` parameter. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20211215180404.53254-8-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 68be4f0ed40cce833cb313871c52878025e40596 Author: Peter Ujfalusi Date: Wed Dec 15 10:04:02 2021 -0800 ASoC: SOF: control: Do not handle control notification with component type The component type is not used in firmware nor in the kernel currently and it is not even clear how it should be handled. Do not even try to handle it to avoid errors. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20211215180404.53254-7-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit dd2fef982ff75fbae618cc274fda09bd40582acd Author: Peter Ujfalusi Date: Wed Dec 15 10:04:01 2021 -0800 ASoC: SOF: sof-audio: Drop the `cmd` member from struct snd_sof_control There is no need to use two variables to store and check the same information, the scontrol->cmd is the same as scontrol->control_data->cmd. Drop the former one and when it is needed, access the cmd from the control_data. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20211215180404.53254-6-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 9182f3c40b52ebd91d4796d96186ba10b720b4ba Author: Peter Ujfalusi Date: Wed Dec 15 10:04:00 2021 -0800 ASoC: SOF: Drop ctrl_cmd parameter for snd_sof_ipc_set_get_comp_data() The scontrol->control_data->cmd has been configured during initialization to the correct sof_ipc_ctrl_cmd. No need to pass duplicated information, let's use the already available one via scontrol. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20211215180404.53254-5-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 8af783723f41d3b3d4f7f8452f190405e7059472 Author: Peter Ujfalusi Date: Wed Dec 15 10:03:59 2021 -0800 ASoC: SOF: topology: Set control_data->cmd alongside scontrol->cmd Set the scontrol->control_data->cmd early to the same as scontrol->cmd. This is a preparatory patch to remove the ctrl_cmd parameter for the snd_sof_ipc_set_get_comp_data() function. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20211215180404.53254-4-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit d4a06c4334aed1fe76ae2b7aaae6ee8b72f30a8e Author: Peter Ujfalusi Date: Wed Dec 15 10:03:58 2021 -0800 ASoC: SOF: Drop ipc_cmd parameter for snd_sof_ipc_set_get_comp_data() The correct ipc_cmd can be selected based on the `ctrl_cmd` and the `set` parameters: if the ctrl_cmd is SOF_CTRL_CMD_BINARY then SOF_IPC_COMP_*_DATA otherwise SOF_IPC_COMP_*_VALUE. The SET or GET direction can be selected with the use of `set` parameter. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20211215180404.53254-3-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 9d562fdcd52b1bb1a13cd5078ffc06dd3eff3aef Author: Peter Ujfalusi Date: Wed Dec 15 10:03:57 2021 -0800 ASoC: SOF: ipc: Rename send parameter in snd_sof_ipc_set_get_comp_data() Rename the send parameter to set in snd_sof_ipc_set_get_comp_data() and sof_set_get_large_ctrl_data() to be more aligned with the function name. No functional change. Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20211215180404.53254-2-ranjani.sridharan@linux.intel.com Signed-off-by: Mark Brown commit 69f457b18fa2b9a793ce61e8d1cf295983aca3a9 Author: Christophe JAILLET Date: Wed Nov 3 22:16:53 2021 +0100 PCI/P2PDMA: Use percpu_ref_tryget_live_rcu() inside RCU critical section Since pci_alloc_p2pmem() has already called rcu_read_lock(), we're in an RCU read-side critical section and don't need to take the lock again. Use percpu_ref_tryget_live_rcu() instead of percpu_ref_tryget_live() to save a few cycles. [bhelgaas: commit log] Link: https://lore.kernel.org/r/ab80164f4d5b32f9e6240aa4863c3a147ff9c89f.1635974126.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET Signed-off-by: Bjorn Helgaas Reviewed-by: Krzysztof Wilczyński Reviewed-by: Logan Gunthorpe commit 133bc542db36e304f44fb520db9a3b8358b987f5 Author: Bjorn Helgaas Date: Wed Dec 15 15:43:04 2021 -0600 MAINTAINERS: Add Logan Gunthorpe as P2PDMA maintainer Add a P2PDMA entry to make sure Logan is aware of changes to that area. Signed-off-by: Bjorn Helgaas Acked-by: Logan Gunthorpe commit ee0d44f20dbdda535a63228165259ed9d40e7880 Merge: 692562abcc6ec 97c2259ec7757 Author: Hans de Goede Date: Wed Dec 15 23:00:15 2021 +0100 Merge tag 'platform-drivers-x86-int3472-1' into review-hans Signed tag for the immutable platform-drivers-x86-int3472 branch This branch contains 5.16-rc1 + the pending ACPI/i2c, tps68570 platform_data and INT3472 driver patches. commit 13aad3431ed52f84478a63a784cce04ad20be5c1 Merge: c57dbcab04449 97c2259ec7757 Author: Mark Brown Date: Wed Dec 15 21:59:33 2021 +0000 Merge tag 'platform-drivers-x86-int3472-1' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86 into regulator-5.17 Signed tag for the immutable platform-drivers-x86-int3472 branch This branch contains 5.16-rc1 + the pending ACPI/i2c, tps68570 platform_data and INT3472 driver patches required so that the tps68570 regulator driver can be applied. commit fb82437fdd8cd8ac41b1265e40a96668e33c3a8d Author: Baruch Siach Date: Thu Nov 18 16:13:00 2021 +0200 PCI: Change capability register offsets to hex Convert offsets of capability registers from decimal to hex. This matches the spec documents and is less error prone. [bhelgaas: also convert other capabilities with offsets > 8] Suggested-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20210825160516.GA3576414@bjorn-Precision-5520/ Link: https://lore.kernel.org/r/aa067278adacbb59a675366052714081f4980f26.1637244780.git.baruch@tkos.co.il Signed-off-by: Baruch Siach Signed-off-by: Bjorn Helgaas commit e445375882883f69018aa669b67cbb37ec873406 Author: Yifeng Li Date: Thu Dec 2 06:35:21 2021 +0000 PCI: Add function 1 DMA alias quirk for Marvell 88SE9125 SATA controller Like other SATA controller chips in the Marvell 88SE91xx series, the Marvell 88SE9125 has the same DMA requester ID hardware bug that prevents it from working under IOMMU. Add it to the list of devices that need the quirk. Without this patch, device initialization fails with DMA errors: ata8: softreset failed (1st FIS failed) DMAR: DRHD: handling fault status reg 2 DMAR: [DMA Write NO_PASID] Request device [03:00.1] fault addr 0xfffc0000 [fault reason 0x02] Present bit in context entry is clear DMAR: DRHD: handling fault status reg 2 DMAR: [DMA Read NO_PASID] Request device [03:00.1] fault addr 0xfffc0000 [fault reason 0x02] Present bit in context entry is clear After applying the patch, the controller can be successfully initialized: ata8: SATA link up 1.5 Gbps (SStatus 113 SControl 330) ata8.00: ATAPI: PIONEER BD-RW BDR-207M, 1.21, max UDMA/100 ata8.00: configured for UDMA/100 scsi 7:0:0:0: CD-ROM PIONEER BD-RW BDR-207M 1.21 PQ: 0 ANSI: 5 Link: https://lore.kernel.org/r/YahpKVR+McJVDdkD@work Reported-by: Sam Bingner Tested-by: Sam Bingner Tested-by: Yifeng Li Signed-off-by: Yifeng Li Signed-off-by: Bjorn Helgaas Reviewed-by: Krzysztof Wilczyński Cc: stable@vger.kernel.org commit f40c0f800f15e9e3566cb39a9eee2855c634eb5f Author: Sam Shih Date: Mon Nov 22 20:35:52 2021 +0800 arm64: dts: mediatek: add pinctrl support for mt7986b Add mt7986b pinctrl node Signed-off-by: Sam Shih Link: https://lore.kernel.org/r/20211122123552.8218-3-sam.shih@mediatek.com Signed-off-by: Matthias Brugger commit c3a064a32ed98437dd62ff30e07a4ea3c659852f Author: Sam Shih Date: Mon Nov 22 20:35:51 2021 +0800 arm64: dts: mediatek: add pinctrl support for mt7986a Add mt7986a pinctrl node, and update pinmux setting for mt7986a Signed-off-by: Sam Shih Link: https://lore.kernel.org/r/20211122123552.8218-2-sam.shih@mediatek.com Signed-off-by: Matthias Brugger commit fd31f778da81fec188f3ac8e03da4338642a8f08 Author: Prashant Malani Date: Thu Dec 9 11:51:12 2021 -0800 arm64: dts: mt8183: kukui: Add Type C node Add a node describing the USB Type C connector, in order to utilize the Chromium OS USB Type-C driver that enumerates Type-C ports and connected cables/peripherals and makes them visible to userspace. Cc: Alexandru M Stan Cc: Benson Leung Signed-off-by: Prashant Malani Reviewed-by: Alexandru M Stan Reviewed-by: Benson Leung Link: https://lore.kernel.org/r/20211209195112.366176-1-pmalani@chromium.org Signed-off-by: Matthias Brugger commit 50137c150f5f478e083b0b24b650de49f55ebfa2 Author: Sam Shih Date: Mon Nov 22 20:32:22 2021 +0800 arm64: dts: mediatek: add basic mt7986 support Add basic chip support for Mediatek mt7986, include basic uart nodes, rng node and watchdog node. Add cpu node, timer node, gic node, psci and reserved-memory node for ARM Trusted Firmware. Signed-off-by: Sam Shih Link: https://lore.kernel.org/r/20211122123222.8016-3-sam.shih@mediatek.com Signed-off-by: Matthias Brugger commit 19ebf10e8d837c0a296274b571a681b0c2885e4e Author: Sam Shih Date: Mon Nov 22 20:32:21 2021 +0800 dt-bindings: arm64: dts: mediatek: Add mt7986 series MT7986 series is Mediatek's new 4-core SoC, which is mainly for wifi-router application. The difference between mt7986a and mt7986b is that some pins do not exist on mt7986b. Signed-off-by: Sam Shih Acked-by: Rob Herring Link: https://lore.kernel.org/r/20211122123222.8016-2-sam.shih@mediatek.com Signed-off-by: Matthias Brugger commit 1ee2ba89bea86d6389509e426583b49ac19b86f2 Author: Daniel Latypov Date: Tue Dec 14 11:30:10 2021 -0800 kunit: tool: make `build` subcommand also reconfigure if needed If I created a kunitconfig file that was incomplete, then $ ./tools/testing/kunit/kunit.py build --kunitconfig=my_kunitconfig would silently drop all the options with unmet dependencies! This is because it doesn't do the config check that `kunit.py config` does. So if I want to safely build a kernel for testing, I have to do $ ./tools/testing/kunit/kunit.py config $ ./tools/testing/kunit/kunit.py build It seems unlikely that any user of kunit.py would want the current `build` semantics. So make it effectively do `kunit.py config` + `kunit.py build`. Signed-off-by: Daniel Latypov Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit e0cc8c052a3992b01f51df1d51eaae49e5b2710f Author: Daniel Latypov Date: Tue Dec 14 11:26:12 2021 -0800 kunit: tool: delete kunit_parser.TestResult type The `log` field is unused, and the `status` field is accessible via `test.status`. So it's simpler to just return the main `Test` object directly. And since we're no longer returning a namedtuple, which has no type annotations, this hopefully means typecheckers are better equipped to find any errors. Signed-off-by: Daniel Latypov Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit db1679813f9f86b05bbbc6f05f4cdbe481d59352 Author: Daniel Latypov Date: Tue Dec 14 11:26:11 2021 -0800 kunit: tool: use dataclass instead of collections.namedtuple namedtuple is a terse way of defining a collection of fields. However, it does not allow us to annotate the type of these fields. It also doesn't let us have any sort of inheritance between types. Since commit df4b0807ca1a ("kunit: tool: Assert the version requirement"), kunit.py has asserted that it's running on python >=3.7. So in that case use a 3.7 feature, dataclasses, to replace these. Changes in detail: * Make KunitExecRequest contain all the fields needed for exec_tests * Use inheritance to dedupe fields * also allows us to e.g. pass a KUnitRequest in as a KUnitParseRequest * this has changed around the order of some fields * Use named arguments when constructing all request objects in kunit.py * This is to prevent accidentally mixing up fields, etc. Signed-off-by: Daniel Latypov Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 685b1afd7911676691c4167f420e16a957f5a38e Author: Shay Drory Date: Thu Dec 9 12:09:23 2021 +0200 net/mlx5: Introduce log_max_current_uc_list_wr_supported bit Downstream patch will use this bit in order to know whether the device supports changing of max_uc_list. Signed-off-by: Shay Drory Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed commit 8f110f530635af44fff1f4ee100ecef0bac62510 Author: Paul Moore Date: Mon Dec 13 15:45:20 2021 -0500 audit: ensure userspace is penalized the same as the kernel when under pressure Due to the audit control mutex necessary for serializing audit userspace messages we haven't been able to block/penalize userspace processes that attempt to send audit records while the system is under audit pressure. The result is that privileged userspace applications have a priority boost with respect to audit as they are not bound by the same audit queue throttling as the other tasks on the system. This patch attempts to restore some balance to the system when under audit pressure by blocking these privileged userspace tasks after they have finished their audit processing, and dropped the audit control mutex, but before they return to userspace. Reported-by: Gaosheng Cui Tested-by: Gaosheng Cui Reviewed-by: Richard Guy Briggs Signed-off-by: Paul Moore commit b1bc04a2ac5b15e0b681228376664671fc2f2017 Author: Dmitry Osipenko Date: Wed Dec 1 02:23:12 2021 +0300 clk: tegra: Support runtime PM and power domain The Clock-and-Reset controller resides in a core power domain on NVIDIA Tegra SoCs. In order to support voltage scaling of the core power domain, we hook up DVFS-capable clocks to the core GENPD for managing of the GENPD's performance state based on the clock changes. Some clocks don't have any specific physical hardware unit that backs them, like root PLLs and system clock and they have theirs own voltage requirements. This patch adds new clk-device driver that backs the clocks and provides runtime PM functionality for them. A virtual clk-device is created for each such DVFS-capable clock at the clock's registration time by the new tegra_clk_register() helper. Driver changes clock's device GENPD performance state based on clk-rate notifications. In result we have this sequence of events: 1. Clock driver creates virtual device for selective clocks, enables runtime PM for the created device and registers the clock. 2. Clk-device driver starts to listen to clock rate changes. 3. Something changes clk rate or enables/disables clk. 4. CCF core propagates the change through the clk tree. 5. Clk-device driver gets clock rate-change notification or GENPD core handles prepare/unprepare of the clock. 6. Clk-device driver changes GENPD performance state on clock rate change. 7. GENPD driver changes voltage regulator state change. 8. The regulator state is committed to hardware via I2C. We rely on fact that DVFS is not needed for Tegra I2C and that Tegra I2C driver already keeps clock always-prepared. Hence I2C subsystem stays independent from the clk power management and there are no deadlock spots in the sequence. Currently all clocks are registered very early during kernel boot when the device driver core isn't available yet. The clk-device can't be created at that time. This patch splits the registration of the clocks in two phases: 1. Register all essential clocks which don't use RPM and are needed during early boot. 2. Register at a later boot time the rest of clocks. This patch adds power management support for Tegra20 and Tegra30 clocks. Reviewed-by: Ulf Hansson Tested-by: Peter Geis # Ouya T30 Tested-by: Paul Fertser # PAZ00 T20 Tested-by: Nicolas Chauvet # PAZ00 T20 and TK1 T124 Tested-by: Matt Merhar # Ouya T30 Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 1fb466dff904e4a72282af336f2c355f011eec61 Author: Eric W. Biederman Date: Wed Dec 15 11:24:50 2021 -0600 objtool: Add a missing comma to avoid string concatenation Recently the kbuild robot reported two new errors: >> lib/kunit/kunit-example-test.o: warning: objtool: .text.unlikely: unexpected end of section >> arch/x86/kernel/dumpstack.o: warning: objtool: oops_end() falls through to next function show_opcodes() I don't know why they did not occur in my test setup but after digging it I realized I had accidentally dropped a comma in tools/objtool/check.c when I renamed rewind_stack_do_exit to rewind_stack_and_make_dead. Add that comma back to fix objtool errors. Link: https://lkml.kernel.org/r/202112140949.Uq5sFKR1-lkp@intel.com Fixes: 0e25498f8cd4 ("exit: Add and use make_task_dead.") Reported-by: kernel test robot Signed-off-by: "Eric W. Biederman" commit 9c99d099f7e7860b39d9bf605ba1f3c6d7ae1319 Author: Jesse Brandeburg Date: Mon Oct 25 17:08:26 2021 -0700 ice: use modern kernel API for kick The kernel gained a new interface for drivers to use to combine tail bump (doorbell) and BQL updates, attempt to use those new interfaces. Signed-off-by: Jesse Brandeburg Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit 21c6e36b1e556af2a6eaf15faa14c51e3b4c854e Author: Jesse Brandeburg Date: Mon Oct 25 17:08:25 2021 -0700 ice: tighter control over VSI_DOWN state The driver had comments to the effect of: This flag should be set before calling this function. While reviewing code it was found that there were several violations of this policy, which could introduce hard to find bugs or races. Fix the violations of the "VSI DOWN state must be set before calling ice_down" and make checking the state into code with a WARN_ON. Signed-off-by: Jesse Brandeburg Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit cc14db11c8a40f930fc1e4b254a37e0fce745236 Author: Jesse Brandeburg Date: Wed Oct 27 12:38:36 2021 -0700 ice: use prefetch methods The kernel provides some prefetch mechanisms to speed up commonly cold cache line accesses during receive processing. Since these are software structures it helps to have these strategically placed prefetches. Be careful to call BQL prefetch complete only for non XDP queues. Co-developed-by: Piotr Raczynski Signed-off-by: Piotr Raczynski Signed-off-by: Jesse Brandeburg Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit 1c96c16858bacb8e77a506b9493a8e4e517b669b Author: Jesse Brandeburg Date: Mon Oct 25 17:08:23 2021 -0700 ice: update to newer kernel API Use the netif_tx_* API from netdevice.h which has simpler parameters. Signed-off-by: Jesse Brandeburg Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit 399e27dbbd9e945e136cd8f6415b03258a094f7a Author: Jacob Keller Date: Wed Oct 27 16:22:55 2021 -0700 ice: support immediate firmware activation via devlink reload The ice hardware contains an embedded chip with firmware which can be updated using devlink flash. The firmware which runs on this chip is referred to as the Embedded Management Processor firmware (EMP firmware). Activating the new firmware image currently requires that the system be rebooted. This is not ideal as rebooting the system can cause unwanted downtime. In practical terms, activating the firmware does not always require a full system reboot. In many cases it is possible to activate the EMP firmware immediately. There are a couple of different scenarios to cover. * The EMP firmware itself can be reloaded by issuing a special update to the device called an Embedded Management Processor reset (EMP reset). This reset causes the device to reset and reload the EMP firmware. * PCI configuration changes are only reloaded after a cold PCIe reset. Unfortunately there is no generic way to trigger this for a PCIe device without a system reboot. When performing a flash update, firmware is capable of responding with some information about the specific update requirements. The driver updates the flash by programming a secondary inactive bank with the contents of the new image, and then issuing a command to request to switch the active bank starting from the next load. The response to the final command for updating the inactive NVM flash bank includes an indication of the minimum reset required to fully update the device. This can be one of the following: * A full power on is required * A cold PCIe reset is required * An EMP reset is required The response to the command to switch flash banks includes an indication of whether or not the firmware will allow an EMP reset request. For most updates, an EMP reset is sufficient to load the new EMP firmware without issues. In some cases, this reset is not sufficient because the PCI configuration space has changed. When this could cause incompatibility with the new EMP image, the firmware is capable of rejecting the EMP reset request. Add logic to ice_fw_update.c to handle the response data flash update AdminQ commands. For the reset level, issue a devlink status notification informing the user of how to complete the update with a simple suggestion like "Activate new firmware by rebooting the system". Cache the status of whether or not firmware will restrict the EMP reset for use in implementing devlink reload. Implement support for devlink reload with the "fw_activate" flag. This allows user space to request the firmware be activated immediately. For the .reload_down handler, we will issue a request for the EMP reset using the appropriate firmware AdminQ command. If we know that the firmware will not allow an EMP reset, simply exit with a suitable netlink extended ACK message indicating that the EMP reset is not available. For the .reload_up handler, simply wait until the driver has finished resetting. Logic to handle processing of an EMP reset already exists in the driver as part of its reset and rebuild flows. Implement support for the devlink reload interface with the "fw_activate" action. This allows userspace to request activation of firmware without a reboot. Note that support for indicating the required reset and EMP reset restriction is not supported on old versions of firmware. The driver can determine if the two features are supported by checking the device capabilities report. I confirmed support has existed since at least version 5.5.2 as reported by the 'fw.mgmt' version. Support to issue the EMP reset request has existed in all version of the EMP firmware for the ice hardware. Check the device capabilities report to determine whether or not the indications are reported by the running firmware. If the reset requirement indication is not supported, always assume a full power on is necessary. If the reset restriction capability is not supported, always assume the EMP reset is available. Users can verify if the EMP reset has activated the firmware by using the devlink info report to check that the 'running' firmware version has updated. For example a user might do the following: # Check current version $ devlink dev info # Update the device $ devlink dev flash pci/0000:af:00.0 file firmware.bin # Confirm stored version updated $ devlink dev info # Reload to activate new firmware $ devlink dev reload pci/0000:af:00.0 action fw_activate # Confirm running version updated $ devlink dev info Finally, this change does *not* implement basic driver-only reload support. I did look into trying to do this. However, it requires significant refactor of how the ice driver probes and loads everything. The ice driver probe and allocation flows were not designed with such a reload in mind. Refactoring the flow to support this is beyond the scope of this change. Signed-off-by: Jacob Keller Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit af18d8866c8013fadca37a3db0162fbc5c4fc9c0 Author: Jacob Keller Date: Wed Oct 27 16:22:54 2021 -0700 ice: reduce time to read Option ROM CIVD data During probe and device reset, the ice driver reads some data from the NVM image as part of ice_init_nvm. Part of this data includes a section of the Option ROM which contains version information. The function ice_get_orom_civd_data is used to locate the '$CIV' data section of the Option ROM. Timing of ice_probe and ice_rebuild indicate that the ice_get_orom_civd_data function takes about 10 seconds to finish executing. The function locates the section by scanning the Option ROM every 512 bytes. This requires a significant number of NVM read accesses, since the Option ROM bank is 500KB. In the worst case it would take about 1000 reads. Worse, all PFs serialize this operation during reload because of acquiring the NVM semaphore. The CIVD section is located at the end of the Option ROM image data. Unfortunately, the driver has no easy method to determine the offset manually. Practical experiments have shown that the data could be at a variety of locations, so simply reversing the scanning order is not sufficient to reduce the overall read time. Instead, copy the entire contents of the Option ROM into memory. This allows reading the data using 4Kb pages instead of 512 bytes at a time. This reduces the total number of firmware commands by a factor of 8. In addition, reading the whole section together at once allows better indication to firmware of when we're "done". Re-write ice_get_orom_civd_data to allocate virtual memory to store the Option ROM data. Copy the entire OptionROM contents at once using ice_read_flash_module. Finally, use this memory copy to scan for the '$CIV' section. This change significantly reduces the time to read the Option ROM CIVD section from ~10 seconds down to ~1 second. This has a significant impact on the total time to complete a driver rebuild or probe. Signed-off-by: Jacob Keller Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit c9f7a483e47004e94fcb9187dda10fb2406e983d Author: Jacob Keller Date: Fri Oct 15 16:13:03 2021 -0700 ice: move ice_devlink_flash_update and merge with ice_flash_pldm_image The ice_devlink_flash_update function performs a few upfront checks and then calls ice_flash_pldm_image. Most if these checks make more sense in the context of code within ice_flash_pldm_image. Merge ice_devlink_flash_update and ice_flash_pldm_image into one function, placing it in ice_fw_update.c Since this is still the entry point for devlink, call the function ice_devlink_flash_update instead of ice_flash_pldm_image. This leaves a single function which handles the devlink parameters and then initiates a PLDM update. With this change, the ice_devlink_flash_update function in ice_fw_update.c becomes the main entry point for flash update. It elimintes some unnecessary boiler plate code between the two previous functions. The ultimate motivation for this is that it eases supporting a dry run with the PLDM library in a future change. Signed-off-by: Jacob Keller Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit c356eaa82401f159f48f29aea8440a058cc5da8d Author: Jacob Keller Date: Mon Oct 11 17:41:11 2021 -0700 ice: move and rename ice_check_for_pending_update The ice_devlink_flash_update function performs a few checks and then calls ice_flash_pldm_image. One of these checks is to call ice_check_for_pending_update. This function checks if the device has a pending update, and cancels it if so. This is necessary to allow a new flash update to proceed. We want to refactor the ice code to eliminate ice_devlink_flash_update, moving its checks into ice_flash_pldm_image. To do this, ice_check_for_pending_update will become static, and only called by ice_flash_pldm_image. To make this change easier to review, first just move the function up within the ice_fw_update.c file. While at it, note that the function has a misleading name. Its primary action is to cancel a pending update. Using the verb "check" does not imply this. Rename it to ice_cancel_pending_update. Signed-off-by: Jacob Keller Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit 78ad87da99788538f3f26235fe78bc52075a6f4f Author: Jacob Keller Date: Mon Oct 11 17:41:10 2021 -0700 ice: devlink: add shadow-ram region to snapshot Shadow RAM We have a region for reading the contents of the NVM flash as a snapshot. This region does not allow reading the Shadow RAM, as it always passes the FLASH_ONLY bit to the low level firmware interface. Add a separate shadow-ram region which will allow snapshot of the current contents of the Shadow RAM. This data is built from the NVM contents but is distinct as the device builds up the Shadow RAM during initialization, so being able to snapshot its contents can be useful when attempting to debug flash related issues. Fix the comment description of the nvm-flash region which incorrectly stated that it filled the shadow-ram region, and add a comment explaining that the nvm-flash region does not actually read the Shadow RAM. Signed-off-by: Jacob Keller Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit e6e395578a6e92307c54232bc695bb08b32b0f86 Author: Anton Bambura Date: Sun Dec 12 00:14:08 2021 +0300 ARM: tegra: Enable video decoder on Tegra114 Add Video Decoder Engine node to Tegra114 device-tree. Signed-off-by: Anton Bambura Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit a28c1b4f11fc201103faf51902bb207edba76c73 Author: Maxim Schwalm Date: Sun Dec 12 00:14:06 2021 +0300 ARM: tegra: nexus7: Use common LVDS display device-tree Make Nexus 7 device-tree to use common LVDS bridge description. This makes device-trees more consistent. [digetx@gmail.com: factored Nexus7 change into separate patch and wrote commit message] Signed-off-by: Maxim Schwalm Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 7525c2a354e083a33f8775f810edd544f11ec108 Author: Dmitry Osipenko Date: Sun Dec 12 00:14:02 2021 +0300 ARM: tegra: Add CPU thermal zones to Nyan device-tree CPU of Nyan Chromebooks is overheating badly because apparently hardware soctherm controller doesn't work well. Add CPU thermal zones to enable software thermal control over CPU and fix the overheat trouble. Tested-by: Thomas Graichen # T124 Nyan Big Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 894ea1121b29713c5da17e1032d1049f31e11d19 Author: Dmitry Osipenko Date: Sun Dec 12 00:14:01 2021 +0300 ARM: tegra: Enable CPU DFLL on Nyan Enable CPU DFLL node on Nyan Chromebooks. DFLL was previously disabled due to Linux kernel CPUFreq driver which didn't support suspend-resume. That problem was fixed years ago, but DFLL was never re-enabled. Tested-by: Thomas Graichen # T124 Nyan Big Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 770586291f9a99c0abb6edee7d709a189355ac7e Author: Dmitry Osipenko Date: Sun Dec 12 00:14:00 2021 +0300 ARM: tegra: Enable HDMI CEC on Nyan Enable HDMI CEC on Nyan Chromebooks. It allows to control TV over HDMI. Suggested-by: Thomas Graichen Tested-by: Thomas Graichen # T124 Nyan Big Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit e6fd5c1e9fc5b35ad855cf748cc18b86776b6389 Author: Stefan Eichenberger Date: Sun Dec 12 00:13:59 2021 +0300 ARM: tegra: Add usb-role-switch property to USB OTG ports If an USB port is an OTG port, then we should add the usb-role-switch property. Otherwise XUSB setup fails and therefore padctl is unable to set up the ports. This leads to broken USB and PCIe ports. Add the usb-role-switch properties to Tegra124 device-trees to fix the problem. The error message shown without this patch is e.g: usb2-0: usb-role-switch not found for otg mode [digetx@gmail.com: improved commit message] Tested-by: Thomas Graichen # T124 Nyan Big Signed-off-by: Stefan Eichenberger Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit ef6fb9875ce0f495115ebb22a635a1aaafc0f467 Author: Dmitry Osipenko Date: Sun Dec 12 00:13:58 2021 +0300 ARM: tegra: Add device-tree for 1080p version of Nyan Big Add dedicated device-tree for 1080p version of Nyan Big in order to describe display panel properly. FHD panel doesn't support modes other than 1080p, hence it's wrong to use incompatible lower resolution panel in device-tree. Tested-by: Thomas Graichen Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 87d9cf2e846968c7ca8e2a3299e4fb93899bd7fc Author: Svyatoslav Ryhel Date: Sun Dec 12 00:13:57 2021 +0300 ARM: tegra: Add device-tree for Pegatron Chagall Add device-tree for Pegatron Chagall, which is a NVIDIA Tegra30-based Android tablet. Link: https://wiki.postmarketos.org/wiki/Pegatron_Chagall_(pegatron-chagall) Co-developed-by: Raffaele Tranquillini Signed-off-by: Raffaele Tranquillini Co-developed-by: Ion Agorria Signed-off-by: Ion Agorria Co-developed-by: Maxim Schwalm Signed-off-by: Maxim Schwalm Signed-off-by: Svyatoslav Ryhel Signed-off-by: Dmitry Osipenko [treding@nvidia.com: cosmetic fixups] Signed-off-by: Thierry Reding commit 2b69c7b5fd350754b524c3410563a8d0fc452f99 Author: Anton Bambura Date: Sun Dec 12 00:13:56 2021 +0300 ARM: tegra: Add device-tree for ASUS Transformer Pad TF701T Add device-tree for Tegra114-based ASUS Transformer Pad TF701T (K00C) tablet. Link: https://wiki.postmarketos.org/wiki/ASUS_Transformer_Pad_(TF701T)_(asus-tf701t) Signed-off-by: Anton Bambura Signed-off-by: Dmitry Osipenko [treding@nvidia.com: cosmetic fixups] Signed-off-by: Thierry Reding commit e6d391a0b29bd083dabc620534892f0d05707501 Author: Svyatoslav Ryhel Date: Sun Dec 12 00:13:55 2021 +0300 ARM: tegra: Add device-tree for ASUS Transformer Infinity TF700T Add device-tree for ASUS Transformer Infinity TF700T, which is a NVIDIA Tegra30-based 2-in-1 detachable, originally running Android. Link: https://wiki.postmarketos.org/wiki/Asus_Transformer_Pad_Infinity_TF700T_(asus-tf700t) Tested-by: Andreas Westman Dorcsak Tested-by: Jasper Korten Co-developed-by: Ion Agorria Signed-off-by: Ion Agorria Co-developed-by: Maxim Schwalm Signed-off-by: Maxim Schwalm Signed-off-by: Svyatoslav Ryhel Co-developed-by: Dmitry Osipenko Signed-off-by: Dmitry Osipenko [treding@nvidia.com: cosmetic fixups] Signed-off-by: Thierry Reding commit 2602de4800e6058f811b467b40e1cd16a21d0a30 Author: Svyatoslav Ryhel Date: Sun Dec 12 00:13:54 2021 +0300 ARM: tegra: Add device-tree for ASUS Transformer Pad TF300TG Add device-tree for ASUS Transformer Pad TF300TG, which is a NVIDIA Tegra30-based 2-in-1 detachable, originally running Android. It's a variant of the TF300T that has a 3G modem. Link: https://wiki.postmarketos.org/wiki/ASUS_Transformer_Pad_(asus-tf300t) Co-developed-by: Ion Agorria Signed-off-by: Ion Agorria Co-developed-by: Maxim Schwalm Signed-off-by: Maxim Schwalm Signed-off-by: Svyatoslav Ryhel Signed-off-by: Dmitry Osipenko [treding@nvidia.com: cosmetic fixups] Signed-off-by: Thierry Reding commit 65fce832a97cb7ed3e4896475baabeb7f506de3b Author: Michał Mirosław Date: Sun Dec 12 00:13:53 2021 +0300 ARM: tegra: Add device-tree for ASUS Transformer Pad TF300T Add device-tree for ASUS Transformer Pad TF300T, which is a NVIDIA Tegra30-based 2-in-1 detachable, originally running Android. Link: https://wiki.postmarketos.org/wiki/ASUS_Transformer_Pad_(asus-tf300t) Tested-by: Ihor Didenko Tested-by: Andreas Westman Dorcsak Co-developed-by: Ion Agorria Signed-off-by: Ion Agorria Co-developed-by: Maxim Schwalm Signed-off-by: Maxim Schwalm Co-developed-by: Svyatoslav Ryhel Signed-off-by: Svyatoslav Ryhel Signed-off-by: Michał Mirosław Signed-off-by: Dmitry Osipenko [treding@nvidia.com: cosmetic fixups] Signed-off-by: Thierry Reding commit 9b66bd835dfd85efaf5f590f34230d1d75b446f9 Author: Svyatoslav Ryhel Date: Sun Dec 12 00:13:52 2021 +0300 ARM: tegra: Add device-tree for ASUS Transformer Prime TF201 Add device-tree for ASUS Transformer Prime TF201, which is a NVIDIA Tegra30-based 2-in-1 detachable, orignally running Android. Link: https://wiki.postmarketos.org/wiki/ASUS_Transformer_Prime_(asus-tf201) Co-developed-by: Ion Agorria Signed-off-by: Ion Agorria Co-developed-by: Maxim Schwalm Signed-off-by: Maxim Schwalm Signed-off-by: Svyatoslav Ryhel Signed-off-by: Dmitry Osipenko [treding@nvidia.com: cosmetic fixups] Signed-off-by: Thierry Reding commit a0d7dba8c3c125692405ac3e2db0e9414952c14f Author: Maxim Schwalm Date: Sun Dec 12 00:13:51 2021 +0300 ARM: tegra: Add common device-tree for LVDS display panels of Tegra30 ASUS tablets All Tegra30 ASUS tablets have a similar design pattern in terms of hardware integration of LVDS display panels, like exactly the same GPIOs are used for power and reset, etc. Add a common device-tree for LVDS display panels of Tegra30 ASUS tablets to avoid replicating the boilerplate panel description. [digetx@gmail.com: factored out common part into separate patch and wrote commit message] Co-developed-by: Svyatoslav Ryhel Signed-off-by: Svyatoslav Ryhel Signed-off-by: Maxim Schwalm Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 91ead34f47c907d931a1f6d396d7dfbbc068263a Author: Svyatoslav Ryhel Date: Sun Dec 12 00:13:50 2021 +0300 ARM: tegra: Add common device-tree base for Tegra30 ASUS Transformers Add common DTSI for Tegra30 ASUS Transformers. It will be used by multiple device-trees of ASUS devices. The common part initially was born out of the ASUS TF300T tablet's device-tree that was created by Michał Mirosław. It was heavily reworked and improved by Svyatoslav Ryhel, Maxim Schwalm, Ion Agorria et al. [digetx@gmail.com: factored out common part into separate patch and wrote commit message] Co-developed-by: Ion Agorria Signed-off-by: Ion Agorria Co-developed-by: Maxim Schwalm Signed-off-by: Maxim Schwalm Co-developed-by: Michał Mirosław Signed-off-by: Michał Mirosław Signed-off-by: Svyatoslav Ryhel Signed-off-by: Dmitry Osipenko [treding@nvidia.com: cosmetic fixups] Signed-off-by: Thierry Reding commit b405066bd3e04e9d0c34a25db85adf19c08274ef Author: Nikola Milosavljevic Date: Sun Dec 12 00:13:49 2021 +0300 ARM: tegra: Add device-tree for ASUS Transformer EeePad TF101 Add device-tree for Tegra20-based ASUS Transformer EeePad TF101. Link: https://wiki.postmarketos.org/wiki/ASUS_Eee_Pad_Transformer_(asus-tf101) Co-developed-by: David Heidelberg Signed-off-by: David Heidelberg Co-developed-by: Svyatoslav Ryhel Signed-off-by: Svyatoslav Ryhel Co-developed-by: Antoni Aloy Torrens Signed-off-by: Antoni Aloy Torrens Signed-off-by: Nikola Milosavljevic Co-developed-by: Dmitry Osipenko Signed-off-by: Dmitry Osipenko [treding@nvidia.com: cosmetic fixups] Signed-off-by: Thierry Reding commit c6e331a2bb0696075d28810e1afd5c35658c240e Author: Thierry Reding Date: Fri Dec 10 13:49:02 2021 +0100 ARM: tegra: Avoid phandle indirection on Ouya Move the default state pinmux definition into the pinmux node. There's no need for the indirection via the phandle. Note that the phandle indirection is kept for the EMC operating performance point tables because they reference nodes that are defined in an external file. Signed-off-by: Thierry Reding commit b716d046041e19af9ba188bd2865e141f749a76a Author: Thierry Reding Date: Tue Dec 7 14:08:32 2021 +0100 ARM: tegra: Fix I2C mux reset GPIO reference on Cardhu Use the correct "reset-gpios" property for the I2C mux reset GPIO reference instead of the deprecated "reset-gpio" property. Signed-off-by: Thierry Reding commit 695494bb969a6070663c20425608c7b72f22887f Author: Thierry Reding Date: Tue Dec 7 14:07:30 2021 +0100 ARM: tegra: Fix SLINK compatible string on Tegra30 The SLINK controller found on Tegra30 is not compatible with its predecessor found on Tegra20. Drop the fallback compatible string. Signed-off-by: Thierry Reding commit e3cc9c1c51f872629e860ef3b780ddf07f515123 Author: Thierry Reding Date: Tue Dec 7 14:06:16 2021 +0100 ARM: tegra: Remove stray #reset-cells property The Ouya board specifies the #reset-cells property for the GPIO controller. Since the GPIO controller doesn't provide reset controls this is not needed, so they can be dropped. Signed-off-by: Thierry Reding commit e6cc64655480de215993cabec45d1f32bb1f5857 Author: David Heidelberg Date: Wed Dec 8 20:36:05 2021 +0300 ARM: tegra: nexus7: Drop clock-frequency from NFC node The clock-frequency property was never used and is deprecated now. Remove it from Nexus 7 device-tree. Signed-off-by: David Heidelberg Signed-off-by: Thierry Reding commit fe3c94e8e7e458dca28024e39fdaad537b2ea28c Author: Thierry Reding Date: Tue Dec 7 14:03:00 2021 +0100 ARM: tegra: Remove unsupported properties on Apalis The +V1.2_VDD_CORE regulator on Apalis and Colibri boards uses the unsupported ti,vsel{0,1}-state-low properties. It turns out that these are in fact the default and can be overridden by ti,vsel{0,1}-state-high properties if needed. Drop them since they are not needed. Signed-off-by: Thierry Reding commit 9b34a2a1bc6e29562d0a2a2f77934d8829daedb4 Author: Thierry Reding Date: Tue Dec 7 14:01:53 2021 +0100 ARM: tegra: Use correct vendor prefix for Invensense The correct vendor prefix for Invensense is "invensense," rather than "invn,". Signed-off-by: Thierry Reding commit c98167bbe865591351df10fd88f759f41006d060 Author: Thierry Reding Date: Tue Dec 7 13:59:59 2021 +0100 ARM: tegra: Add dummy backlight power supplies The Medcom Wide and PAZ00 boards don't specify the power supply for the backlight, which means that the Linux driver will provide a dummy one. Wire up an explicit dummy to also make the DT schema validation succeed. Unfortunately I don't have access to the schematics for the Medcom Wide, so I don't know if a more accurate description is possible. The AC100 (PAZ00) schematics from here: https://www.s-manuals.com/pdf/motherboard/compal/compal_la-6352p_r1.0a_schematics.pdf aren't entirely clear which one of the supplies powers backlight, but the panel supply is probably close enough. Based on work by David Heidelberg . Signed-off-by: Thierry Reding commit e1808b09df868135240b6b489b692e105d0b17a7 Author: Thierry Reding Date: Tue Dec 7 13:57:40 2021 +0100 ARM: tegra: Remove PHY reset GPIO references from USB controller node The PHY reset GPIO references belong in the USB PHY nodes, where they already exist. There is no need to keep them in the USB controller's device tree node as well. Signed-off-by: Thierry Reding commit 86a3a7f8a42bcdda6281b949d7e78e6e20ddc8ff Author: Thierry Reding Date: Tue Dec 7 13:51:33 2021 +0100 ARM: tegra: Add compatible string for built-in ASIX on Colibri boards The device tree node for the built-in ASIX Ethernet device on Colibri boards needs a compatible string in order to pass DT schema validation. Add the USB VID,PID compatible string as required by the DT schema for USB devices. Reviewed-by: Marcel Ziswiler Tested-by: Marcel Ziswiler Signed-off-by: Thierry Reding commit c96ebc5fde274edcc02543dcfb6a1ee097f98070 Author: David Virag Date: Mon Dec 6 16:31:17 2021 +0100 dt-bindings: arm: samsung: document jackpotlte board binding Add binding for the jackpotlte board (Samsung Galaxy A8 (2018)). Signed-off-by: David Virag Reviewed-by: Rob Herring Reviewed-by: Sam Protsenko Link: https://lore.kernel.org/r/20211206153124.427102-4-virag.david003@gmail.com Signed-off-by: Krzysztof Kozlowski commit ca1f7d245f530fd8ad57e7f596826da4d56bec80 Author: Dmitry Osipenko Date: Sun Dec 12 00:14:12 2021 +0300 ARM: config: multi v7: Enable display drivers used by Tegra devices Enable display-related drivers used by various Tegra-based tablets. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit cbb469f7518f12b06b9f66eb39e84e097278b682 Author: Dmitry Osipenko Date: Sun Dec 12 00:14:11 2021 +0300 ARM: tegra_defconfig: Enable drivers wanted by Acer Chromebooks and ASUS tablets Enable charger, touchpad and EC drivers found on Acer Tegra124 (Nyan) Chromebooks, display bridge found on ASUS TF700T and audio codecs found on ASUS tablets. Suggested-by: Thomas Graichen # Nyan options Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit e360e116a0eec9cf719cda5860e95d36606687e7 Author: Dmitry Osipenko Date: Mon Nov 15 01:07:58 2021 +0300 clk: tegra: Make vde a child of pll_p on tegra114 The current default is to leave the VDE clock's parent at the default, which is clk_m. However, that is not a configuration that will allow the VDE to function. Reparent it to pll_p instead to make sure the hardware can actually decode video content. Tested-by: Anton Bambura # ASUS TF701T Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit c8d09c7ebcffcbc734eee45c92f11d6ec8884b92 Author: Vinod Koul Date: Wed Dec 15 11:38:34 2021 +0530 phy: freescale: pcie: explicitly add bitfield.h kernel test robot complains about missing FIELD_PREP, so include bitfield.h for that drivers/phy/freescale/phy-fsl-imx8m-pcie.c:41:37: error: implicit declaration of function 'FIELD_PREP' [-Werror=implicit-function-declaration] drivers/phy/freescale/phy-fsl-imx8m-pcie.c:41:41: error: implicit declaration of function 'FIELD_PREP' [-Werror=implicit-function-declaration] Reported-by: kernel test robot Fixes: 1aa97b002258 ("phy: freescale: pcie: Initialize the imx8 pcie standalone phy driver") Signed-off-by: Vinod Koul Reviewed-by: Richard Zhu Link: https://lore.kernel.org/r/20211215060834.921617-1-vkoul@kernel.org Signed-off-by: Vinod Koul commit 91f7d2dbf952f54442fa81bb62f78ee023179bf9 Author: Arnd Bergmann Date: Wed Dec 15 15:01:59 2021 +0100 x86/xen: Use correct #ifdef guard for xen_initdom_restore_msi() The #ifdef check around the definition doesn't match the one around the declaration, leading to a link failure when CONFIG_XEN_DOM0 is enabled but CONFIG_XEN_PV_DOM0 is not: x86_64-linux-ld: arch/x86/kernel/apic/msi.o: in function `arch_restore_msi_irqs': msi.c:(.text+0x29a): undefined reference to `xen_initdom_restore_msi' Change the declaration to use the same check that was already present around the function definition. Fixes: ae72f3156729 ("PCI/MSI: Make arch_restore_msi_irqs() less horrible.") Signed-off-by: Arnd Bergmann Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20211215140209.451379-1-arnd@kernel.org commit 3bc14ea0d12a57a968038f8e86e9bc2c1668ad9a Author: Jakub Kicinski Date: Tue Dec 14 07:47:25 2021 -0800 ethtool: always write dev in ethnl_parse_header_dev_get Commit 0976b888a150 ("ethtool: fix null-ptr-deref on ref tracker") made the write to req_info.dev conditional, but as Eric points out in a different follow up the structure is often allocated on the stack and not kzalloc()'d so seems safer to always write the dev, in case it's garbage on input. Signed-off-by: Jakub Kicinski Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit f1d9268e061863ead77b07f5a6807d063e28a1c2 Author: Eric Dumazet Date: Tue Dec 14 07:09:33 2021 -0800 net: add net device refcount tracker to struct packet_type Most notable changes are in af_packet, tipc ones are trivial. Signed-off-by: Eric Dumazet Cc: Jon Maloy Cc: Ying Xue Signed-off-by: David S. Miller commit ab8c83cf8734a4fcff3b359b23afd174cd43ec03 Merge: f71f1bcbd87ff fb488be8c28de Author: David S. Miller Date: Wed Dec 15 15:05:44 2021 +0000 Merge branch 'mlxsw-ipv6-underlay' Ido Schimmel says: ==================== mlxsw: Add support for VxLAN with IPv6 underlay So far, mlxsw only supported VxLAN with IPv4 underlay. This patchset extends mlxsw to also support VxLAN with IPv6 underlay. The main difference is related to the way IPv6 addresses are handled by the device. See patch #1 for a detailed explanation. Patch #1 creates a common hash table to store the mapping from IPv6 addresses to KVDL indexes. This table is useful for both IP-in-IP and VxLAN tunnels with an IPv6 underlay. Patch #2 converts the IP-in-IP code to use the new hash table. Patches #3-#6 are preparations. Patch #7 finally adds support for VxLAN with IPv6 underlay. Patch #8 removes a test case that checked that VxLAN configurations with IPv6 underlay are vetoed by the driver. A follow-up patchset will add forwarding selftests. ==================== Signed-off-by: David S. Miller commit fb488be8c28de63c6298b74d2cc422cf8ae39716 Author: Amit Cohen Date: Tue Dec 14 16:25:51 2021 +0200 selftests: mlxsw: vxlan: Remove IPv6 test case Currently, there is a test case to verify that VxLAN with IPv6 underlay is forbidden. Remove this test case as support for VxLAN with IPv6 underlay was added by the previous patch. Signed-off-by: Amit Cohen Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 06c08f869c0eda8a466288b8ec32bc217d22a8fb Author: Amit Cohen Date: Tue Dec 14 16:25:50 2021 +0200 mlxsw: Add support for VxLAN with IPv6 underlay Currently, mlxsw driver supports VxLAN with IPv4 underlay only. Add support for IPv6 underlay. The main differences are: * Learning is not supported for IPv6 FDB entries, use static entries and do not allow 'learning' flag for IPv6 VxLAN. * IPv6 addresses for FDB entries should be saved as part of KVDL. Use the new API to allocate and release entries for IPv6 addresses. * Spectrum ASICs do not fill UDP checksum, while in software IPv6 UDP packets with checksum zero are dropped. Force the relevant flags which allow the VxLAN device to generate UDP packets with zero checksum and also receive them. Signed-off-by: Amit Cohen Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 0860c764163448d4c64c1c6869d79f6e175df77a Author: Amit Cohen Date: Tue Dec 14 16:25:49 2021 +0200 mlxsw: spectrum_nve: Keep track of IPv6 addresses used by FDB entries FDB entries that perform VxLAN encapsulation with an IPv6 underlay hold a reference on a resource. Namely, the KVDL entry where the IPv6 underlay destination IP is stored. When such an FDB entry is deleted, it needs to drop the reference from the corresponding KVDL entry. To that end, maintain a hash table that maps an FDB entry (i.e., {MAC, FID}) to the IPv6 address used by it. Signed-off-by: Amit Cohen Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 4b08c3e676b1d8f3820287582ce66f96307c4863 Author: Amit Cohen Date: Tue Dec 14 16:25:48 2021 +0200 mlxsw: reg: Add a function to fill IPv6 unicast FDB entries Add a function to fill IPv6 unicast FDB entries. Use the common function for common fields. Unlike IPv4 entries, the underlay IP address is not filled in the register payload, but instead a pointer to KVDL is used. Signed-off-by: Amit Cohen Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 1fd85416e3b5c9e53bf729c9d2a3922cdf3e3267 Author: Amit Cohen Date: Tue Dec 14 16:25:47 2021 +0200 mlxsw: Split handling of FDB tunnel entries between address families Currently, the function which adds/removes unicast tunnel FDB entries is shared between IPv4 and IPv6, while for IPv6 it warns because there is no support for it. The code for IPv6 will be more complicated because it needs to allocate/release a KVDL pointer for the underlay IPv6 address. As a preparation for IPv6 underlay support, split the code according to address family. Signed-off-by: Amit Cohen Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 720d683cbe8b14bbdb00ea65354a77a8e80a2844 Author: Amit Cohen Date: Tue Dec 14 16:25:46 2021 +0200 mlxsw: spectrum_nve_vxlan: Make VxLAN flags check per address family As part of 'can_offload' checks, there is a check of VxLAN flags. The supported flags for IPv6 VxLAN will be different from the existing flags because of some limitations. As preparation for IPv6 underlay support, make this check per address family. Signed-off-by: Amit Cohen Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit cf42911523e02026cb56d329e584ae5923e94ba1 Author: Amit Cohen Date: Tue Dec 14 16:25:45 2021 +0200 mlxsw: spectrum_ipip: Use common hash table for IPv6 address mapping Use the common hash table introduced by the previous patch instead of the IP-in-IP specific implementation. Signed-off-by: Amit Cohen Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit e846efe2737b25a5c0a75b0995eb9ac084c87f5c Author: Amit Cohen Date: Tue Dec 14 16:25:44 2021 +0200 mlxsw: spectrum: Add hash table for IPv6 address mapping The device supports forwarding entries such as routes and FDBs that perform tunnel (e.g., VXLAN, IP-in-IP) encapsulation or decapsulation. When the underlay is IPv6, these entries do not encode the 128 bit IPv6 address used for encapsulation / decapsulation. Instead, these entries encode a 24 bit pointer to an array called KVDL where the IPv6 address is stored. Currently, only IP-in-IP with IPv6 underlay is supported, but subsequent patches will add support for VxLAN with IPv6 underlay. To avoid duplicating the logic required to store and retrieve these IPv6 addresses, introduce a hash table that will store the mapping between IPv6 addresses and their KVDL index. Signed-off-by: Amit Cohen Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 8cc3b1ccd930fe6971e1527f0c4f1bdc8cb56026 Author: Amir Goldstein Date: Mon Nov 29 22:15:37 2021 +0200 fanotify: wire up FAN_RENAME event FAN_RENAME is the successor of FAN_MOVED_FROM and FAN_MOVED_TO and can be used to get the old and new parent+name information in a single event. FAN_MOVED_FROM and FAN_MOVED_TO are still supported for backward compatibility, but it makes little sense to use them together with FAN_RENAME in the same group. FAN_RENAME uses special info type records to report the old and new parent+name, so reporting only old and new parent id is less useful and was not implemented. Therefore, FAN_REANAME requires a group with flag FAN_REPORT_NAME. Link: https://lore.kernel.org/r/20211129201537.1932819-12-amir73il@gmail.com Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara commit d9bd3e9aca6786d0be523bf6732e48ab764eb8ad Merge: e8f7875680aed 8e136c5ea43ae Author: Arnd Bergmann Date: Wed Dec 15 15:58:00 2021 +0100 Merge tag 'asahi-soc-pmgr-5.17-v2' of https://github.com/AsahiLinux/linux into arm/drivers Apple SoC PMGR driver updates for 5.17 * Adds an auto-PM feature that is necessary for a single device * Disables module builds, which were broken anyway * tag 'asahi-soc-pmgr-5.17-v2' of https://github.com/AsahiLinux/linux: soc: apple: apple-pmgr-pwrstate: Do not build as a module soc: apple: apple-pmgr-pwrstate: Add auto-PM min level support Link: https://lore.kernel.org/r/660f6f7f-0857-b54c-c415-79bcb93f0e02@marcan.st Signed-off-by: Arnd Bergmann commit 7326e382c21e9c23c89c88369afdc90b82a14da8 Author: Amir Goldstein Date: Mon Nov 29 22:15:36 2021 +0200 fanotify: report old and/or new parent+name in FAN_RENAME event In the special case of FAN_RENAME event, we report old or new or both old and new parent+name. A single info record will be reported if either the old or new dir is watched and two records will be reported if both old and new dir (or their filesystem) are watched. The old and new parent+name are reported using new info record types FAN_EVENT_INFO_TYPE_{OLD,NEW}_DFID_NAME, so if a single info record is reported, it is clear to the application, to which dir entry the fid+name info is referring to. Link: https://lore.kernel.org/r/20211129201537.1932819-11-amir73il@gmail.com Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara commit 5f424ff299ac7979f2eb7da44844305e8740415f Merge: 03e9474bfc4de 301f651614c33 Author: Arnd Bergmann Date: Wed Dec 15 15:56:39 2021 +0100 Merge tag 'asahi-soc-dt-5.17-v2' of https://github.com/AsahiLinux/linux into arm/dt Apple SoC DT updates for 5.17, round 2: - Various cleanups (removing useless props, sorting nodes, renaming things) - Add PMGR min-state binding & props (see PMGR pull for driver change) - Initial compatibles for t600x machines (M1 Pro/Max). This covers the bindings that just need compatible bumps & minor tweaks, no driver changes. - Add watchdog node (driver not merged yet, hopefully will be; binding went in the previous pull) - Add missing power-domains property to the mailbox binding * tag 'asahi-soc-dt-5.17-v2' of https://github.com/AsahiLinux/linux: dt-bindings: mailbox: apple,mailbox: Add power-domains property arm64: dts: apple: t8103: Sort nodes by address arm64: dts: apple: t8103: Rename clk24 to clkref arm64: dts: apple: t8103: Add watchdog node dt-bindings: pinctrl: apple,pinctrl: Add apple,t6000-pinctrl compatible dt-bindings: pci: apple,pcie: Add t6000 support dt-bindings: i2c: apple,i2c: Add apple,t6000-i2c compatible dt-bindings: arm: apple: Add t6000/t6001 MacBook Pro 14/16" compatibles arm64: dts: apple: t8103: Add apple,min-state to DCP PMGR nodes dt-bindings: power: apple,pmgr-pwrstate: Add apple,min-state prop arm64: dts: apple: t8103: Remove PCIe max-link-speed properties Link: https://lore.kernel.org/r/a24faafd-f2ae-c3a7-5327-b27da7d9e34b@marcan.st Signed-off-by: Arnd Bergmann commit 2bfbcccde6e7a787feabad4645f628f963fe0663 Author: Amir Goldstein Date: Mon Nov 29 22:15:35 2021 +0200 fanotify: record either old name new name or both for FAN_RENAME We do not want to report the dirfid+name of a directory whose inode/sb are not watched, because watcher may not have permissions to see the directory content. Use an internal iter_info to indicate to fanotify_alloc_event() which marks of this group are watching FAN_RENAME, so it can decide if we need to record only the old parent+name, new parent+name or both. Link: https://lore.kernel.org/r/20211129201537.1932819-10-amir73il@gmail.com Signed-off-by: Amir Goldstein [JK: Modified code to pass around only mask of mark types matching generated event] Signed-off-by: Jan Kara commit 03e9474bfc4de671e3570487810b2263f46e04aa Merge: 2aaeccfafbf9c 3ff0810ffc479 Author: Arnd Bergmann Date: Wed Dec 15 15:55:30 2021 +0100 Merge tag 'stm32-dt-for-v5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32 into arm/dt STM32 DT for v5.17, round 1 Highlights: ---------- -MCU: - fix ili9341 for dtbs_check warnings on stm32f429 disco. - MPU: - ST boards: - tune HS USB phys on stm32mp15 EV1 and DKx boards. - add pull-up on USART3/UART7 RX pins on STM32MP15 DKx boards. - use correct pinctrl setting for STUSB1600 on STM32MP15 DK boards. - ENGICAM: - enable LVDS pannel on i.Core STM32MP1 EDIMM2.2. - add "i.Core STM32MP1 C.TOUCH 2.0 10.1" OF" support: EDIMM compliant general purpose carrier board with ETH 10/100, WIFI/BT, CAN, ... * tag 'stm32-dt-for-v5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32: ARM: dts: stm32: Add Engicam i.Core STM32MP1 C.TOUCH 2.0 10.1" OF dt-bindings: arm: stm32: Add Engicam i.Core STM32MP1 C.TOUCH 2.0 10.1" OF ARM: dts: stm32: Enable LVDS panel on i.Core STM32MP1 EDIMM2.2 ARM: dts: stm32: fix stusb1600 pinctrl used on stm32mp157c-dk ARM: dts: stm32: tune the HS USB PHYs on stm32mp157c-ev1 ARM: dts: stm32: tune the HS USB PHYs on stm32mp15xx-dkx ARM: dts: stm32: clean uart4_idle_pins_a node for stm32mp15 ARM: dts: stm32: add pull-up to USART3 and UART7 RX pins on STM32MP15 DKx boards ARM: dts: stm32: fix dtbs_check warning on ili9341 dts binding on stm32f429 disco Link: https://lore.kernel.org/r/dfe942db-5af7-bb82-22b6-3bd866c9017d@foss.st.com Signed-off-by: Arnd Bergmann commit f71f1bcbd87ff7274ac6fb5ace454178dc5246f6 Merge: 5a21bf5bb4243 35bb5242148fa Author: David S. Miller Date: Wed Dec 15 14:46:33 2021 +0000 Merge tag 'mlx5-updates-2021-12-14' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saed Mahameed says: ==================== mlx5-updates-2021-12-14 Parsing Infrastructure for TC actions: The series introduce a TC action infrastructure to help parsing TC actions in a generic way for both FDB and NIC rules. To help maintain the parsing code of TC actions, we the parsing code to action parser per action TC type in separate files, instead of having one big switch case loop, duplicated between FDB and NIC parsers as before this patchset. Each TC flow_action->id is represented by a dedicated mlx5e_tc_act handler which has callbacks to check if the specific action is offload supported and to parse the specific action. We move each case (TC action) handling into the specific handler, which is responsible for parsing and determining if the action is supported. ==================== Signed-off-by: David S. Miller commit 4d375c2e51d5b3227683e3a9a198a2f003959c76 Author: zhangyue Date: Wed Dec 8 17:53:41 2021 +0800 rsi: fix array out of bound Limit the max of 'ii'. If 'ii' greater than or equal to 'RSI_MAX_VIFS', the array 'adapter->vifs' may be out of bound Signed-off-by: zhangyue Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211208095341.47777-1-zhangyue1@kylinos.cn commit 7b6871f670028532430648a175d9e8e72280172a Merge: 94b4a6d521735 64a1fbda59f4b Author: Marc Zyngier Date: Wed Dec 15 14:21:23 2021 +0000 Merge branch kvm-arm64/pkvm-cleanups-5.17 into kvmarm-master/next * kvm-arm64/pkvm-cleanups-5.17: : . : pKVM cleanups from Quentin Perret: : : This series is a collection of various fixes and cleanups for KVM/arm64 : when running in nVHE protected mode. The first two patches are real : fixes/improvements, the following two are minor cleanups, and the last : two help satisfy my paranoia so they're certainly optional. : . KVM: arm64: pkvm: Make kvm_host_owns_hyp_mappings() robust to VHE KVM: arm64: pkvm: Stub io map functions KVM: arm64: Make __io_map_base static KVM: arm64: Make the hyp memory pool static KVM: arm64: pkvm: Disable GICv2 support KVM: arm64: pkvm: Fix hyp_pool max order Signed-off-by: Marc Zyngier commit 64a1fbda59f4b14adde7f21cda687e2b9703b7bb Author: Quentin Perret Date: Wed Dec 8 15:22:59 2021 +0000 KVM: arm64: pkvm: Make kvm_host_owns_hyp_mappings() robust to VHE The kvm_host_owns_hyp_mappings() function should return true if and only if the host kernel is responsible for creating the hypervisor stage-1 mappings. That is only possible in standard non-VHE mode, or during boot in protected nVHE mode. But either way, none of this makes sense in VHE, so make sure to catch this case as well, hence making the function return sensible values in any context (VHE or not). Suggested-by: Marc Zyngier Signed-off-by: Quentin Perret Acked-by: Will Deacon Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211208152300.2478542-7-qperret@google.com commit bff01cb6b1bf68052739eb6155132f7d6d974208 Author: Quentin Perret Date: Wed Dec 8 15:22:58 2021 +0000 KVM: arm64: pkvm: Stub io map functions Now that GICv2 is disabled in nVHE protected mode there should be no other reason for the host to use create_hyp_io_mappings() or kvm_phys_addr_ioremap(). Add sanity checks to make sure that assumption remains true looking forward. Signed-off-by: Quentin Perret Acked-by: Will Deacon Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211208152300.2478542-6-qperret@google.com commit 473a3efbafaa9ffd06c8b8f653f24c97b5ac3ff0 Author: Quentin Perret Date: Wed Dec 8 15:22:57 2021 +0000 KVM: arm64: Make __io_map_base static The __io_map_base variable is used at EL2 to track the end of the hypervisor's "private" VA range in nVHE protected mode. However it doesn't need to be used outside of mm.c, so let's make it static to keep all the hyp VA allocation logic in one place. Signed-off-by: Quentin Perret Acked-by: Will Deacon Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211208152300.2478542-5-qperret@google.com commit 53a563b01fa2ae2376a0b7d547f26a0ae9c78b5c Author: Quentin Perret Date: Wed Dec 8 15:22:56 2021 +0000 KVM: arm64: Make the hyp memory pool static The hyp memory pool struct is sized to fit exactly the needs of the hypervisor stage-1 page-table allocator, so it is important it is not used for anything else. As it is currently used only from setup.c, reduce its visibility by marking it static. Signed-off-by: Quentin Perret Reviewed-by: Andrew Walbran Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211208152300.2478542-4-qperret@google.com commit a770ee80e66270a7df183dda5ad6df4e8c8ab615 Author: Quentin Perret Date: Wed Dec 8 15:22:55 2021 +0000 KVM: arm64: pkvm: Disable GICv2 support GICv2 requires having device mappings in guests and the hypervisor, which is incompatible with the current pKVM EL2 page ownership model which only covers memory. While it would be desirable to support pKVM with GICv2, this will require a lot more work, so let's make the current assumption clear until then. Co-developed-by: Marc Zyngier Signed-off-by: Marc Zyngier Signed-off-by: Quentin Perret Acked-by: Will Deacon Link: https://lore.kernel.org/r/20211208152300.2478542-3-qperret@google.com commit 34b43a8849229e8363c19236ecdf463b7a89d085 Author: Quentin Perret Date: Wed Dec 8 15:22:54 2021 +0000 KVM: arm64: pkvm: Fix hyp_pool max order The EL2 page allocator in protected mode maintains a per-pool max order value to optimize allocations when the memory region it covers is small. However, the max order value is currently under-estimated whenever the number of pages in the region is a power of two. Fix the estimation. Signed-off-by: Quentin Perret Acked-by: Will Deacon Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211208152300.2478542-2-qperret@google.com commit 2167c0b205960607fb136b4bb3c556a62be1569a Author: Jiasheng Jiang Date: Wed Dec 15 11:15:50 2021 +0800 ASoC: rt5663: Handle device_property_read_u32_array error codes The return value of device_property_read_u32_array() is not always 0. To catch the exception in case that devm_kzalloc failed and the rt5663->imp_table was NULL, which caused the failure of device_property_read_u32_array. Fixes: 450f0f6a8fb4 ("ASoC: rt5663: Add the manual offset field to compensate the DC offset") Signed-off-by: Jiasheng Jiang Link: https://lore.kernel.org/r/20211215031550.70702-1-jiasheng@iscas.ac.cn Signed-off-by: Mark Brown commit 28084f4a0e031a87b624ea121bd8fd782b90ff2a Author: Daniel Baluta Date: Wed Dec 15 10:57:03 2021 +0200 ASoC: SOF: OF: Avoid reverse module dependency Similar with commit 8a49cd11e68ed0 ("ASoC: SOF: ACPI: avoid reverse module dependency") we will be having hardware specific drivers that link against a common "helper" framework. sof-of-dev.c becomes a library with the interface defined in the newly created file sof-of-dev.h. This is the final step started with Kconfig simplification in commit 7548a391c53ca ("ASoC: SOF: i.MX: simplify Kconfig") Signed-off-by: Daniel Baluta Reviewed-by: Paul Olaru Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20211215085703.137414-1-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit 3982534ba5ce45e890b2f5ef5e7372c1accd14c7 Author: Amir Goldstein Date: Mon Nov 29 22:15:34 2021 +0200 fanotify: record old and new parent and name in FAN_RENAME event In the special case of FAN_RENAME event, we record both the old and new parent and name. Link: https://lore.kernel.org/r/20211129201537.1932819-9-amir73il@gmail.com Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara commit 3cf984e950c1c3f41d407ed31db33beb996be132 Author: Amir Goldstein Date: Mon Nov 29 22:15:33 2021 +0200 fanotify: support secondary dir fh and name in fanotify_info Allow storing a secondary dir fh and name tupple in fanotify_info. This will be used to store the new parent and name information in FAN_RENAME event. Link: https://lore.kernel.org/r/20211129201537.1932819-8-amir73il@gmail.com Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara commit 1a9515ac9e55e68d733bab81bd408463ab1e25b1 Author: Amir Goldstein Date: Mon Nov 29 22:15:32 2021 +0200 fanotify: use helpers to parcel fanotify_info buffer fanotify_info buffer is parceled into variable sized records, so the records must be written in order: dir_fh, file_fh, name. Use helpers to assert that order and make fanotify_alloc_name_event() a bit more generic to allow empty dir_fh record and to allow expanding to more records (i.e. name2) soon. Link: https://lore.kernel.org/r/20211129201537.1932819-7-amir73il@gmail.com Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara commit 2d9374f095136206a02eb0b6cd9ef94632c1e9f7 Author: Amir Goldstein Date: Mon Nov 29 22:15:31 2021 +0200 fanotify: use macros to get the offset to fanotify_info buffer The fanotify_info buffer contains up to two file handles and a name. Use macros to simplify the code that access the different items within the buffer. Add assertions to verify that stored fh len and name len do not overflow the u8 stored value in fanotify_info header. Remove the unused fanotify_info_len() helper. Link: https://lore.kernel.org/r/20211129201537.1932819-6-amir73il@gmail.com Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara commit e54183fa7047c15819bc155f4c58501d9a9a3489 Author: Amir Goldstein Date: Mon Nov 29 22:15:30 2021 +0200 fsnotify: generate FS_RENAME event with rich information The dnotify FS_DN_RENAME event is used to request notification about a move within the same parent directory and was always coupled with the FS_MOVED_FROM event. Rename the FS_DN_RENAME event flag to FS_RENAME, decouple it from FS_MOVED_FROM and report it with the moved dentry instead of the moved inode, so it has the information about both old and new parent and name. Generate the FS_RENAME event regardless of same parent dir and apply the "same parent" rule in the generic fsnotify_handle_event() helper that is used to call backends with ->handle_inode_event() method (i.e. dnotify). The ->handle_inode_event() method is not rich enough to report both old and new parent and name anyway. The enriched event is reported to fanotify over the ->handle_event() method with the old and new dir inode marks in marks array slots for ITER_TYPE_INODE and a new iter type slot ITER_TYPE_INODE2. The enriched event will be used for reporting old and new parent+name to fanotify groups with FAN_RENAME events. Link: https://lore.kernel.org/r/20211129201537.1932819-5-amir73il@gmail.com Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara commit d61fd650e9d206a71fda789f02a1ced4b19944c4 Author: Amir Goldstein Date: Mon Nov 29 22:15:29 2021 +0200 fanotify: introduce group flag FAN_REPORT_TARGET_FID FAN_REPORT_FID is ambiguous in that it reports the fid of the child for some events and the fid of the parent for create/delete/move events. The new FAN_REPORT_TARGET_FID flag is an implicit request to report the fid of the target object of the operation (a.k.a the child inode) also in create/delete/move events in addition to the fid of the parent and the name of the child. To reduce the test matrix for uninteresting use cases, the new FAN_REPORT_TARGET_FID flag requires both FAN_REPORT_NAME and FAN_REPORT_FID. The convenience macro FAN_REPORT_DFID_NAME_TARGET combines FAN_REPORT_TARGET_FID with all the required flags. Link: https://lore.kernel.org/r/20211129201537.1932819-4-amir73il@gmail.com Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara commit 1c9007d62bea6fd164285314f7553f73e5308863 Author: Amir Goldstein Date: Mon Nov 29 22:15:28 2021 +0200 fsnotify: separate mark iterator type from object type enum They are two different types that use the same enum, so this confusing. Use the object type to indicate the type of object mark is attached to and the iter type to indicate the type of watch. A group can have two different watches of the same object type (parent and child watches) that match the same event. Link: https://lore.kernel.org/r/20211129201537.1932819-3-amir73il@gmail.com Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara commit ad69cd9972e79aba103ba5365de0acd35770c265 Author: Amir Goldstein Date: Mon Nov 29 22:15:27 2021 +0200 fsnotify: clarify object type argument In preparation for separating object type from iterator type, rename some 'type' arguments in functions to 'obj_type' and remove the unused interface to clear marks by object type mask. Link: https://lore.kernel.org/r/20211129201537.1932819-2-amir73il@gmail.com Signed-off-by: Amir Goldstein Signed-off-by: Jan Kara commit c8f476da84add618b55352194fdd11caaf87c0a7 Merge: 59aa7fcfe2e44 a973f86b41fbe Author: Jason Gunthorpe Date: Wed Dec 15 08:15:53 2021 -0400 Merge branch 'mlx5-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mellanox/linux Saeed Mahameed says: ==================== Currently, the driver ignores the user's priority for flow steering rules in FDB namespace. Change it and create the rule in the right priority. It will allow to create FDB steering rules in up to 16 different priorities. ==================== Signed-off-by: Jason Gunthorpe * mellanox/mlx5-next: RDMA/mlx5: Add support to multiple priorities for FDB rules net/mlx5: Create more priorities for FDB bypass namespace net/mlx5: Refactor mlx5_get_flow_namespace net/mlx5: Separate FDB namespace commit f05f2429eec60851b98bdde213de31dab697c01b Author: Jan Kara Date: Tue Dec 14 11:04:29 2021 +0100 udf: Fix error handling in udf_new_inode() When memory allocation of iinfo or block allocation fails, already allocated struct udf_inode_info gets freed with iput() and udf_evict_inode() may look at inode fields which are not properly initialized. Fix it by marking inode bad before dropping reference to it in udf_new_inode(). Reported-by: syzbot+9ca499bb57a2b9e4c652@syzkaller.appspotmail.com Signed-off-by: Jan Kara commit 7e29a225c7508f858ac1c900675390ec4ef01aed Author: Shuuichirou Ishii Date: Mon Nov 29 15:10:44 2021 +0900 ACPI: tables: Add AEST to the list of known table signatures Add AEST to the list of known ACPI table signatures to allow the kernel to recognize it when upgrading tables via initrd. Signed-off-by: Shuuichirou Ishii Acked-by: Hanjun Guo [ rjw: New subject and changelog ] Signed-off-by: Rafael J. Wysocki commit 8e136c5ea43ae08c5d672deb1c3f494782a4392a Author: Hector Martin Date: Wed Dec 15 20:27:54 2021 +0900 soc: apple: apple-pmgr-pwrstate: Do not build as a module This doesn't make any sense as a module since it is a critical device, and it turns out of_phandle_iterator_args was not exported so the module version doesn't build anyway. Fixes: 6df9d38f9146 ("soc: apple: Add driver for Apple PMGR power state controls") Reported-by: kernel test robot Reviewed-by: Sven Peter Signed-off-by: Hector Martin commit 301f651614c3396d711a8cc3f92f6fb95b12f5c5 Author: Hector Martin Date: Thu Dec 9 13:50:42 2021 +0900 dt-bindings: mailbox: apple,mailbox: Add power-domains property This will bind to the PMGR pwrstate nodes that control power/clock gating to SoC blocks. The mailbox driver doesn't do runtime-pm yet, so initially this will just keep the domain on permanently. Reviewed-by: Sven Peter Acked-by: Rob Herring Signed-off-by: Hector Martin commit 8adf987ce08275433a7b2eb281a19785b5d30c30 Author: Hector Martin Date: Sun Dec 12 10:40:16 2021 +0900 arm64: dts: apple: t8103: Sort nodes by address We decided to keep SoC nodes sorted by address for sanity; fix a couple that slipped into the wrong place. Reviewed-by: Sven Peter Signed-off-by: Hector Martin commit 57337b252442128605f89a3e96df128c2e5404bf Author: Hector Martin Date: Tue Oct 5 23:24:21 2021 +0900 arm64: dts: apple: t8103: Rename clk24 to clkref We now know that this frequency comes from the external reference oscillator and is used for various SoC blocks, and isn't just a random 24MHz clock, so let's call it something more appropriate. Reviewed-by: Mark Kettenis Reviewed-by: Sven Peter Signed-off-by: Hector Martin commit c2c529b27ceb394ff4d3273ed1f552195fc4d555 Author: Mark Rutland Date: Mon Dec 6 12:47:12 2021 +0000 arm64: remove __dma_*_area() aliases The __dma_inv_area() and __dma_clean_area() aliases make cache.S harder to navigate, but don't gain us anything in practice. For clarity, let's remove them along with their redundant comments. The only users are __dma_map_area() and __dma_unmap_area(), which need to be position independent, and can call __pi_dcache_inval_poc() and __pi_dcache_clean_poc() directly. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Cc: Ard Biesheuvel Cc: Fuad Tabba Cc: Marc Zyngier Cc: Will Deacon Acked-by: Catalin Marinas Acked-by: Mark Brown Acked-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20211206124715.4101571-4-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 244a36e50da05c33b860d20638ee4628017a5334 Author: Maxime Ripard Date: Wed Nov 17 10:45:22 2021 +0100 drm/vc4: kms: Wait for the commit before increasing our clock rate Several DRM/KMS atomic commits can run in parallel if they affect different CRTC. These commits share the global HVS state, so we have some code to make sure we run commits in sequence. This synchronization code is one of the first thing that runs in vc4_atomic_commit_tail(). Another constraints we have is that we need to make sure the HVS clock gets a boost during the commit. That code relies on clk_set_min_rate and will remove the old minimum and set a new one. We also need another, temporary, minimum for the duration of the commit. The algorithm is thus to set a temporary minimum, drop the previous one, do the commit, and finally set the minimum for the current mode. However, the part that sets the temporary minimum and drops the older one runs before the commit synchronization code. Thus, under the proper conditions, we can end up mixing up the minimums and ending up with the wrong one for our current step. To avoid it, let's move the clock setup in the protected section. Fixes: d7d96c00e585 ("drm/vc4: hvs: Boost the core clock during modeset") Signed-off-by: Maxime Ripard Reviewed-by: Dave Stevenson Tested-by: Jian-Hong Pan [danvet: re-apply this from 0c980a006d3f ("drm/vc4: kms: Wait for the commit before increasing our clock rate") because I lost that part in my merge resolution in 99b03ca651f1 ("Merge v5.16-rc5 into drm-next")] Fixes: 99b03ca651f1 ("Merge v5.16-rc5 into drm-next") Acked-by: Maxime Ripard Signed-off-by: Daniel Vetter Link: https://lore.kernel.org/r/20211117094527.146275-2-maxime@cerno.tech commit 5a21bf5bb4243d0213758c0e5e6c5c5786842a94 Merge: 0b6f65c707e5e f8a3bcceb4224 Author: David S. Miller Date: Wed Dec 15 10:59:57 2021 +0000 Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== 100GbE Intel Wired LAN Driver Updates 2021-12-14 This series contains updates to ice driver only. Haiyue adds support to query hardware for supported PTYPEs. Jeff changes PTYPE validation to utilize the capabilities queried from the hardware instead of maintaining a per DDP support list. Brett refactors promiscuous functions to provide common and clear interfaces to call for configuration. Wojciech modifies DDP package load to simplify determining the final state of the load. Tony removes the use of ice_status from the driver. This involves removing string conversion functions, converting variables and values to standard errors, and clean up. He also removes an unused define. Dan Carpenter removes unneeded casts. ==================== Signed-off-by: David S. Miller commit 3cc1c6de458e0e58c413c3c35802ca96e55bbdbe Author: Xiaoke Wang Date: Mon Dec 13 16:27:15 2021 +0800 thunderbolt: Check return value of kmemdup() in icm_handle_event() kmemdup() may return NULL if there is not enough memory available. Check this and bail out early in this case. While there move INIT_WORK() to happen after we have allocated all the memory needed for the event handling to avoid doing unnecessary work. Signed-off-by: Xiaoke Wang Signed-off-by: Mika Westerberg commit 0b6f65c707e5ec5e33916820e2a4a628e2b4576c Author: Joakim Zhang Date: Tue Dec 14 18:50:46 2021 +0800 net: fec: fix system hang during suspend/resume 1. During normal suspend (WoL not enabled) process, system has posibility to hang. The root cause is TXF interrupt coming after clocks disabled, system hang when accessing registers from interrupt handler. To fix this issue, disable all interrupts when system suspend. 2. System also has posibility to hang with WoL enabled during suspend, after entering stop mode, then magic pattern coming after clocks disabled, system will be waked up, and interrupt handler will be called, system hang when access registers. To fix this issue, disable wakeup irq in .suspend(), and enable it in .resume(). Signed-off-by: Joakim Zhang Signed-off-by: David S. Miller commit 843869951258f38dc3d9702a19df7c4c79911aee Author: Clément Léger Date: Tue Dec 14 10:55:34 2021 +0100 net: ocelot: add support to get port mac from device-tree Add support to get mac from device-tree using of_get_ethdev_address. Reviewed-by: Vladimir Oltean Signed-off-by: Clément Léger Signed-off-by: David S. Miller commit 3899c928bccc5068405cd0e9a3a8fea67b097e9e Author: Conley Lee Date: Tue Dec 14 17:11:06 2021 +0800 sun4i-emac.c: remove unnecessary branch According to the current implementation of emac_rx, every arrived packet will be processed in the while loop. So, there is no remain packet last time. The skb_last field and this branch for dealing with it is unnecessary. Signed-off-by: Conley Lee Signed-off-by: David S. Miller commit 34ac17ecbf575eb079094d44f1bd30c66897aa21 Author: Eric Dumazet Date: Tue Dec 14 00:42:30 2021 -0800 ethtool: use ethnl_parse_header_dev_put() It seems I missed that most ethnl_parse_header_dev_get() callers declare an on-stack struct ethnl_req_info, and that they simply call dev_put(req_info.dev) when about to return. Add ethnl_parse_header_dev_put() helper to properly untrack reference taken by ethnl_parse_header_dev_get(). Fixes: e4b8954074f6 ("netlink: add net device refcount tracker to struct ethnl_req_info") Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 477436699e7801276fa7306e20318156cb535249 Author: Zhou Wang Date: Tue Dec 7 14:32:48 2021 +0800 Revert "iommu/arm-smmu-v3: Decrease the queue size of evtq and priq" The commit f115f3c0d5d8 ("iommu/arm-smmu-v3: Decrease the queue size of evtq and priq") decreases evtq and priq, which may lead evtq/priq to be full with fault events, e.g HiSilicon ZIP/SEC/HPRE have maximum 1024 queues in one device, every queue could be binded with one process and trigger a fault event. So let's revert f115f3c0d5d8. In fact, if an implementation of SMMU really does not need so long evtq and priq, value of IDR1_EVTQS and IDR1_PRIQS can be set to proper ones. Signed-off-by: Zhou Wang Acked-by: Zhen Lei Link: https://lore.kernel.org/r/1638858768-9971-1-git-send-email-wangzhou1@hisilicon.com Signed-off-by: Will Deacon commit 0257bc5cceaf29ac7f9b4deef7e10c6d5a2dfd49 Merge: 8858f8622e821 d56a8e9c7af83 Author: Krzysztof Kozlowski Date: Wed Dec 15 08:34:58 2021 +0100 Merge branch 'for-v5.17/dt-usi' into next/dt64 commit d56a8e9c7af835a4f3f88b2ae34f4ba6f7085b7c Author: Sam Protsenko Date: Tue Dec 14 19:09:24 2021 +0200 dt-bindings: soc: samsung: Fix I2C clocks order in USI binding example Now that HSI2C binding [1] is converted to dt-schema format, it reveals incorrect HSI2C clocks order in USI binding example: .../exynos-usi.example.dt.yaml: i2c@13820000: clock-names:0: 'hsi2c' was expected From schema: .../i2c-exynos5.yaml .../exynos-usi.example.dt.yaml: i2c@13820000: clock-names:1: 'hsi2c_pclk' was expected From schema: .../i2c-exynos5.yaml Change HSI2C clock order in USI binding example to satisfy HSI2C binding requirements and fix above warnings. [1] Documentation/devicetree/bindings/i2c/i2c-exynos5.yaml Signed-off-by: Sam Protsenko Link: https://lore.kernel.org/r/20211214170924.27998-1-semen.protsenko@linaro.org Signed-off-by: Krzysztof Kozlowski commit f97982398cc1c92f2e9bd0ef1ef870a5a729b0ac Author: Andrii Nakryiko Date: Tue Dec 14 15:20:54 2021 -0800 libbpf: Avoid reading past ELF data section end when copying license Fix possible read beyond ELF "license" data section if the license string is not properly zero-terminated. Use the fact that libbpf_strlcpy never accesses the (N-1)st byte of the source string because it's replaced with '\0' anyways. If this happens, it's a violation of contract between libbpf and a user, but not handling this more robustly upsets CIFuzz, so given the fix is trivial, let's fix the potential issue. Fixes: 9fc205b413b3 ("libbpf: Add sane strncpy alternative and use it internally") Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211214232054.3458774-1-andrii@kernel.org commit 35bb5242148fa16fd5b2f28b508e0c031e90c672 Author: Roi Dayan Date: Sun Aug 15 13:23:14 2021 +0300 net/mlx5e: Move goto action checks into tc_action goto post parse op Move goto action checks from parse nic/fdb funcs into the tc action infra goto post parse op. While moving this part also use NL_SET_ERR_MSG_MOD() instead of NL_SET_ERR_MSG(). Signed-off-by: Roi Dayan Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed commit c22080352ecfb1bbc024f36934457a4ac0c2f19c Author: Roi Dayan Date: Mon Aug 23 11:30:17 2021 +0300 net/mlx5e: Move vlan action chunk into tc action vlan post parse op Move vlan prio tag rewrite handling into tc action infra vlan post parse op. Signed-off-by: Roi Dayan Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed commit dd5ab6d115657a7f312893fdd40b3d187022b11d Author: Roi Dayan Date: Wed Aug 11 14:19:56 2021 +0300 net/mlx5e: Add post_parse() op to tc action infrastructure The post_parse() op should be called after the parse op was called for all actions. It could be an action state is dependent on other actions. In the new op an action can fail the parse if the state is not valid anymore. Signed-off-by: Roi Dayan Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed commit 6bcba1bdeda57cd36317f616253e387fb14e70ee Author: Roi Dayan Date: Thu Aug 12 16:02:58 2021 +0300 net/mlx5e: Move sample attr allocation to tc_action sample parse op There is no reason to wait with the kmalloc to after parsing all other actions. There could still be a failure later and before offloading the rule. So alloc the mem when parsing. The memory is being released on mlx5e_flow_put() which is called also on error flow. Signed-off-by: Roi Dayan Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed commit 8333d53e3f74b66bbba2a8d81b00c9cbdf845220 Author: Roi Dayan Date: Sun Jul 25 11:02:27 2021 +0300 net/mlx5e: TC action parsing loop Introduce a common function to implement the generic parsing loop. The same function can be used for parsing NIC and FDB (Switchdev mode) flows. Signed-off-by: Roi Dayan Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed commit 922d69ed9666226e62824df118fb9fbd31739683 Author: Roi Dayan Date: Tue Nov 16 13:17:56 2021 +0200 net/mlx5e: Add redirect ingress to tc action infra Add parsing support by implementing struct mlx5e_tc_act for this action. Signed-off-by: Roi Dayan Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed commit 3929ff583d8ebd9450c7f94fa5f81b9a1f102506 Author: Roi Dayan Date: Wed Oct 27 09:52:36 2021 +0300 net/mlx5e: Add sample and ptype to tc_action infra Add parsing support by implementing struct mlx5e_tc_act for this action. Signed-off-by: Roi Dayan Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed commit 758bc13422774c4abad60cf28012d53af5dd932c Author: Roi Dayan Date: Wed Jul 21 15:02:36 2021 +0300 net/mlx5e: Add ct to tc action infra Add parsing support by implementing struct mlx5e_tc_act for this action. Signed-off-by: Roi Dayan Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed commit ab3f3d5efffaa26ae67c8c92524424b50df5cd13 Author: Roi Dayan Date: Wed Jul 21 10:27:50 2021 +0300 net/mlx5e: Add mirred/redirect to tc action infra Add parsing support by implementing struct mlx5e_tc_act for this action. Signed-off-by: Roi Dayan Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed commit 163b766f566294bf7449bf4fb33ad4ae092dce03 Author: Roi Dayan Date: Wed Jul 21 11:25:35 2021 +0300 net/mlx5e: Add mpls push/pop to tc action infra Add parsing support by implementing struct mlx5e_tc_act for this action. Signed-off-by: Roi Dayan Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed commit 8ee72638347c81f8029d19ac93a797a6be6f3ae8 Author: Roi Dayan Date: Wed Jul 21 10:28:55 2021 +0300 net/mlx5e: Add vlan push/pop/mangle to tc action infra Add parsing support by implementing struct mlx5e_tc_act for this action. Signed-off-by: Roi Dayan Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed commit e36db1ee7a88f415f5fcd95158fbbbf0cae63532 Author: Roi Dayan Date: Thu Jul 22 15:26:25 2021 +0300 net/mlx5e: Add pedit to tc action infra Add parsing support by implementing struct mlx5e_tc_act for this action. Signed-off-by: Roi Dayan Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed commit 9ca1bb2cf69b63b12d4d84c2ed4f99e99b72bf1a Author: Roi Dayan Date: Wed Jul 21 10:30:40 2021 +0300 net/mlx5e: Add csum to tc action infra Add parsing support by implementing struct mlx5e_tc_act for this action. Signed-off-by: Roi Dayan Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed commit c65686d79c954d2a9f522a288c57d086e5406481 Author: Roi Dayan Date: Wed Jul 21 10:29:37 2021 +0300 net/mlx5e: Add tunnel encap/decap to tc action infra Add parsing support by implementing struct mlx5e_tc_act for this action. Signed-off-by: Roi Dayan Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed commit 67d62ee7f46bd5a4863e6adfd2b775fa6da02bf3 Author: Roi Dayan Date: Wed Jul 21 10:26:41 2021 +0300 net/mlx5e: Add goto to tc action infra Add parsing support by implementing struct mlx5e_tc_act for this action. Signed-off-by: Roi Dayan Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed commit fad54790698023190f01a1b4d6406395e84464db Author: Roi Dayan Date: Mon Jul 12 14:13:10 2021 +0300 net/mlx5e: Add tc action infrastructure Add an infrastructure to help parsing tc actions in a generic way. Supporting an action parser means implementing struct mlx5e_tc_act for that action. The infrastructure will give the possibility to be generic when parsing tc actions, i.e. parse_tc_nic_actions() and parse_tc_fdb_actions(). To parse tc actions a user needs to allocate a parse_state instance and pass it when iterating over the tc actions parsers. If a parser doesn't exists then a user can treat it as unsupported. To add an action parser a user needs to implement two callbacks. The can_offload() callback to quickly check if an action can be offloaded. The parse_action() callback to do actual parsing and prepare for offload. Add implementation for drop, trap, mark and accept action parsers with this commit to act as examples and implement usage of the new infrastructure for those actions. Signed-off-by: Roi Dayan Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed commit 01f8938ad036e97802551ea3746fbc5fdc091de6 Merge: 4a5cf65d003c0 1a14b1ac39357 Author: Georgi Djakov Date: Wed Dec 15 07:14:27 2021 +0200 Merge branch 'icc-qcm2290' into icc-next Add support for QCM2290 including a few prep changes. * icc-qcm2290 interconnect: icc-rpm: Define ICC device type interconnect: icc-rpm: Add QNOC type QoS support interconnect: icc-rpm: Support child NoC device probe dt-bindings: interconnect: Add Qualcomm QCM2290 NoC support interconnect: qcom: Add QCM2290 driver support Link: https://lore.kernel.org/r/20211215002324.1727-1-shawn.guo@linaro.org Signed-off-by: Georgi Djakov commit 1a14b1ac3935788de75ea3b0ef68b46375070f77 Author: Shawn Guo Date: Wed Dec 15 08:23:24 2021 +0800 interconnect: qcom: Add QCM2290 driver support It adds interconnect driver support for QCM2290 platform. The topology consists of 3 NoCs: BIMC, Config NoC (CNOC) and System NoC (SNOC). SNOC is a QCOM_ICC_QNOC type device, as well as its 3 virtual child devices, QUP, MMNRT and MMRT. QUP is owned by RPM and thus has no .regmap_cfg, while the other 2 share the same .regmap_cfg with SNOC (parent). Signed-off-by: Shawn Guo Link: https://lore.kernel.org/r/20211215002324.1727-6-shawn.guo@linaro.org Signed-off-by: Georgi Djakov commit 061dbde2bf3b12d80a4efd4b40db0b272e55b7f5 Author: Shawn Guo Date: Wed Dec 15 08:23:23 2021 +0800 dt-bindings: interconnect: Add Qualcomm QCM2290 NoC support Add bindings for Qualcomm QCM2290 Network-On-Chip interconnect devices. Signed-off-by: Shawn Guo Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211215002324.1727-5-shawn.guo@linaro.org Signed-off-by: Georgi Djakov commit e39bf2972c6e82eb7c51a78ca990d839aafeb124 Author: Shawn Guo Date: Wed Dec 15 08:23:22 2021 +0800 interconnect: icc-rpm: Support child NoC device probe As shown in downstream DT[1], the System NoC of QCM2290 is modelled using 4 fab/noc devices: sys_noc + qup_virt + mmnrt_virt + mmrt_virt. Among those 3 virtual devices, qup is owned by RPM and has no regmap resource, while mmnrt and mmrt are owned by AP and share the same regmap as sys_noc. So it's logical to represent these virtual devices as child nodes of sys_noc in DT, so that such configuration can be supported with a couple of changes on qnoc_probe(): - If there are child nodes, populate them. - If the device descriptor has .regmap_cfg but there is no IOMEM resource for the device, use parent's regmap. [1] https://android.googlesource.com/kernel/msm-extra/devicetree/+/refs/tags/android-11.0.0_r0.56/qcom/scuba-bus.dtsi Signed-off-by: Shawn Guo Link: https://lore.kernel.org/r/20211215002324.1727-4-shawn.guo@linaro.org Signed-off-by: Georgi Djakov commit 08c590409f303d61461b8fcaa9083438e4300448 Author: Shawn Guo Date: Wed Dec 15 08:23:21 2021 +0800 interconnect: icc-rpm: Add QNOC type QoS support It adds QoS support for QNOC type device which can be found on QCM2290 platform. The downstream driver[1] includes support for priority, limiter, regulator and forwarding setup. As QCM2290 support only requires priority and forwarding configuration, limiter and regulator support are omitted for this initial submission. [1] https://source.codeaurora.org/quic/la/kernel/msm-4.19/tree/drivers/soc/qcom/msm_bus/msm_bus_qnoc_adhoc.c?h=kernel.lnx.4.19.r22-rel Signed-off-by: Shawn Guo Link: https://lore.kernel.org/r/20211215002324.1727-3-shawn.guo@linaro.org Signed-off-by: Georgi Djakov commit e9d54c26344f8e5390c643613ec192858104eca2 Author: Shawn Guo Date: Wed Dec 15 08:23:20 2021 +0800 interconnect: icc-rpm: Define ICC device type The driver currently uses .is_bimc_node to distinguish device type BIMC from NOC. Define type for bus/noc devices like what downstream[1] does to make support for more types easier. [1] https://source.codeaurora.org/quic/la/kernel/msm-4.19/tree/drivers/soc/qcom/msm_bus/msm_bus_core.h?h=kernel.lnx.4.19.r22-rel#n46 Signed-off-by: Shawn Guo Link: https://lore.kernel.org/r/20211215002324.1727-2-shawn.guo@linaro.org Signed-off-by: Georgi Djakov commit c16160cfa5651039f886d5cc6a6d9129e1fe789d Author: Katherine Perez Date: Thu Dec 9 10:32:46 2021 -0800 arm64: dts: qcom: add minimal DTS for Microsoft Surface Duo 2 This is a minimal devicetree for Microsoft Surface Duo 2 with SM8350 Chipset Signed-off-by: Katherine Perez Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211209183246.842880-2-kaperez@linux.microsoft.com commit 8e6de09c716f37dbdc8181e803455603c89c4bd2 Author: Caleb Connolly Date: Thu Dec 9 22:59:38 2021 +0000 arm64: dts: qcom: sdm845-oneplus-*: add msm-id and board-id The msm-id and board-id can be used to select the correct dtb when multiple are provided to the bootloader. Multiple DTBs can be provided on sdm845 devices using boot image header v1 by appending them all to the kernel image before creating the boot image. The bootloader then selects them like this: Best match DTB tags 321/00000008/0x00000000/20001/20014/20115/20018/0/(offset)0x79998E27/(size)0x000173CD Using pmic info 0x20014/0x20115/0x20018/0x0 for device 0x20014/0x20115/0x20018/0x0 Signed-off-by: Caleb Connolly Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211209225938.2427342-1-caleb.connolly@linaro.org commit 72a0ca203ca7fae34fe61668906fe483b97d9039 Author: Vinod Koul Date: Tue Dec 7 17:10:02 2021 +0530 dt-bindings: clock: Add SM8450 GCC clock bindings Add device tree bindings for global clock controller on SM8450 SoCs. Signed-off-by: Vinod Koul Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211207114003.100693-2-vkoul@kernel.org commit ff8b573a6ccf4deba10285abef072c577099e038 Author: Vamsi krishna Lanka Date: Fri Oct 29 17:02:05 2021 -0700 ARM: dts: qcom: sdx65: Add pincontrol node This commit adds pincontrol node to SDX65 dts. Signed-off-by: Vamsi Krishna Lanka Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1635552125-16407-4-git-send-email-quic_vamslank@quicinc.com commit bae2f5979c6e537334c9099013b5407019e88c44 Author: Vamsi krishna Lanka Date: Fri Oct 29 17:02:04 2021 -0700 ARM: dts: qcom: Add SDX65 platform and MTP board support Add basic devicetree support for SDX65 platform and MTP board from Qualcomm. The SDX65 platform features an ARM Cortex A7 CPU which forms the Application Processor Sub System (APSS) along with standard Qualcomm peripherals like GCC, TLMM, BLSP, QPIC, and BAM etc... Also, there exists the networking parts such as IPA, MHI, PCIE-EP, EMAC, and Modem etc.. This commit adds basic devicetree support that includes GCC, RPMh clock, INTC and Debug UART. Signed-off-by: Vamsi Krishna Lanka Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1635552125-16407-3-git-send-email-quic_vamslank@quicinc.com commit 3b338c9a6a2afd6db46d5d8e39ae4f5eef420bf8 Author: Vamsi krishna Lanka Date: Fri Oct 29 17:02:03 2021 -0700 dt-bindings: arm: qcom: Document SDX65 platform and boards Document the SDX65 platform binding and also the boards using it. Signed-off-by: Vamsi Krishna Lanka Reviewed-by: Bjorn Andersson Acked-by: Rob Herring Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1635552125-16407-2-git-send-email-quic_vamslank@quicinc.com commit da1f7d0b621e48221ad688d95db5747252373b73 Merge: a6839c42fe7c2 8f8ef3860d440 Author: Bjorn Andersson Date: Tue Dec 14 21:01:09 2021 -0600 Merge tag 'e15509b2b7c9b600ab38c5269d4fac609c077b5b.1638861860.git.quic_vamslank@quicinc.com' into dts-for-5.17 v5.16-rc1 + e15509b2b7c9b600ab38c5269d4fac609c077b5b.1638861860.git.quic_vamslank@quicinc.com Merge the immutable branch containing the DT binding and clock definitions to be used in the SDX65 dts files. commit 8f8ef3860d4403d1bf0887380f9e3376be092c40 Author: Vamsi krishna Lanka Date: Mon Dec 6 23:32:49 2021 -0800 dt-bindings: clock: Add SDX65 GCC clock bindings Add device tree bindings for global clock controller on SDX65 SOCs. Signed-off-by: Vamsi Krishna Lanka Reviewed-by: Rob Herring Reviewed-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/e15509b2b7c9b600ab38c5269d4fac609c077b5b.1638861860.git.quic_vamslank@quicinc.com commit 6cf7a1ac0fedad8a70c050ade8a27a2071638500 Merge: 9280ac2e6f199 6cf01e451599d Author: Jakub Kicinski Date: Tue Dec 14 18:46:31 2021 -0800 Merge branch 'net-dsa-hellcreek-fix-handling-of-mgmt-protocols' Kurt Kanzenbach says: ==================== net: dsa: hellcreek: Fix handling of MGMT protocols this series fixes some minor issues with regards to management protocols such as PTP and STP in the hellcreek DSA driver. Configure static FDB for these protocols. The end result is: |root@tsn:~# mv88e6xxx_dump --atu |Using device |ATU: |FID MAC 0123 Age OBT Pass Static Reprio Prio | 0 01:1b:19:00:00:00 1100 1 X X 6 | 1 01:00:5e:00:01:81 1100 1 X X 6 | 2 33:33:00:00:01:81 1100 1 X X 6 | 3 01:80:c2:00:00:0e 1100 1 X X X 6 | 4 01:00:5e:00:00:6b 1100 1 X X X 6 | 5 33:33:00:00:00:6b 1100 1 X X X 6 | 6 01:80:c2:00:00:00 1100 1 X X X 6 Previous version: * https://lore.kernel.org/r/20211213101810.121553-1-kurt@linutronix.de/ Changes since v1: * Target net-next, as this never worked correctly and is not critical * Add STP and PTP over UDP rules * Use pass_blocked for PDelay messages only (Richard Cochran) ==================== Link: https://lore.kernel.org/r/20211214134508.57806-1-kurt@linutronix.de Signed-off-by: Jakub Kicinski commit 6cf01e451599da630ff1af529d61c5e4db4550ab Author: Kurt Kanzenbach Date: Tue Dec 14 14:45:08 2021 +0100 net: dsa: hellcreek: Add missing PTP via UDP rules The switch supports PTP for UDP transport too. Therefore, add the missing static FDB entries to ensure correct forwarding of these packets. Fixes: ddd56dfe52c9 ("net: dsa: hellcreek: Add PTP clock support") Signed-off-by: Kurt Kanzenbach Acked-by: Richard Cochran Signed-off-by: Jakub Kicinski commit cad1798d2d0811ded37d1e946c6796102e58013b Author: Kurt Kanzenbach Date: Tue Dec 14 14:45:07 2021 +0100 net: dsa: hellcreek: Allow PTP P2P measurements on blocked ports Allow PTP peer delay measurements on blocked ports by STP. In case of topology changes the PTP stack can directly start with the correct delays. Fixes: ddd56dfe52c9 ("net: dsa: hellcreek: Add PTP clock support") Signed-off-by: Kurt Kanzenbach Reviewed-by: Vladimir Oltean Acked-by: Richard Cochran Signed-off-by: Jakub Kicinski commit b7ade35eb53a2455f737a623c24e4b24455b2271 Author: Kurt Kanzenbach Date: Tue Dec 14 14:45:06 2021 +0100 net: dsa: hellcreek: Add STP forwarding rule Treat STP as management traffic. STP traffic is designated for the CPU port only. In addition, STP traffic has to pass blocked ports. Fixes: e4b27ebc780f ("net: dsa: Add DSA driver for Hirschmann Hellcreek switches") Signed-off-by: Kurt Kanzenbach Reviewed-by: Vladimir Oltean Acked-by: Richard Cochran Signed-off-by: Jakub Kicinski commit 4db4c3ea56978086ca367a355e440de17d534827 Author: Kurt Kanzenbach Date: Tue Dec 14 14:45:05 2021 +0100 net: dsa: hellcreek: Fix insertion of static FDB entries The insertion of static FDB entries ignores the pass_blocked bit. That bit is evaluated with regards to STP. Add the missing functionality. Fixes: e4b27ebc780f ("net: dsa: Add DSA driver for Hirschmann Hellcreek switches") Signed-off-by: Kurt Kanzenbach Reviewed-by: Vladimir Oltean Acked-by: Richard Cochran Signed-off-by: Jakub Kicinski commit 9280ac2e6f199cddcd746a9ba459136b8666287b Author: Eric Dumazet Date: Tue Dec 14 07:15:15 2021 -0800 net: dev_replace_track() cleanup Use existing helpers (netdev_tracker_free() and netdev_tracker_alloc()) to remove ifdefery. Signed-off-by: Eric Dumazet Link: https://lore.kernel.org/r/20211214151515.312535-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit 123e495ecc25d32cf3e7958f794013236abdf0d4 Author: Eric Dumazet Date: Mon Dec 13 21:19:55 2021 -0800 net: linkwatch: be more careful about dev->linkwatch_dev_tracker Apparently a concurrent linkwatch_add_event() could run while we are in __linkwatch_run_queue(). We need to free dev->linkwatch_dev_tracker tracker under lweventlist_lock protection to avoid this race. syzbot report: [ 77.935949][ T3661] reference already released. [ 77.941015][ T3661] allocated in: [ 77.944482][ T3661] linkwatch_fire_event+0x202/0x260 [ 77.950318][ T3661] netif_carrier_on+0x9c/0x100 [ 77.955120][ T3661] __ieee80211_sta_join_ibss+0xc52/0x1590 [ 77.960888][ T3661] ieee80211_sta_create_ibss.cold+0xd2/0x11f [ 77.966908][ T3661] ieee80211_ibss_work.cold+0x30e/0x60f [ 77.972483][ T3661] ieee80211_iface_work+0xb70/0xd00 [ 77.977715][ T3661] process_one_work+0x9ac/0x1680 [ 77.982671][ T3661] worker_thread+0x652/0x11c0 [ 77.987371][ T3661] kthread+0x405/0x4f0 [ 77.991465][ T3661] ret_from_fork+0x1f/0x30 [ 77.995895][ T3661] freed in: [ 77.999006][ T3661] linkwatch_do_dev+0x96/0x160 [ 78.004014][ T3661] __linkwatch_run_queue+0x233/0x6a0 [ 78.009496][ T3661] linkwatch_event+0x4a/0x60 [ 78.014099][ T3661] process_one_work+0x9ac/0x1680 [ 78.019034][ T3661] worker_thread+0x652/0x11c0 [ 78.023719][ T3661] kthread+0x405/0x4f0 [ 78.027810][ T3661] ret_from_fork+0x1f/0x30 [ 78.042541][ T3661] ------------[ cut here ]------------ [ 78.048253][ T3661] WARNING: CPU: 0 PID: 3661 at lib/ref_tracker.c:120 ref_tracker_free.cold+0x110/0x14e [ 78.062364][ T3661] Modules linked in: [ 78.066424][ T3661] CPU: 0 PID: 3661 Comm: kworker/0:5 Not tainted 5.16.0-rc4-next-20211210-syzkaller #0 [ 78.076075][ T3661] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 [ 78.090648][ T3661] Workqueue: events linkwatch_event [ 78.095890][ T3661] RIP: 0010:ref_tracker_free.cold+0x110/0x14e [ 78.102191][ T3661] Code: ea 03 48 c1 e0 2a 0f b6 04 02 84 c0 74 04 3c 03 7e 4c 8b 7b 18 e8 6b 54 e9 fa e8 26 4d 57 f8 4c 89 ee 48 89 ef e8 fb 33 36 00 <0f> 0b 41 bd ea ff ff ff e9 bd 60 e9 fa 4c 89 f7 e8 16 45 a2 f8 e9 [ 78.127211][ T3661] RSP: 0018:ffffc90002b5fb18 EFLAGS: 00010246 [ 78.133684][ T3661] RAX: 0000000000000000 RBX: ffff88807467f700 RCX: 0000000000000000 [ 78.141928][ T3661] RDX: 0000000000000001 RSI: 0000000000000001 RDI: 0000000000000001 [ 78.150087][ T3661] RBP: ffff888057e105b8 R08: 0000000000000001 R09: ffffffff8ffa1967 [ 78.158211][ T3661] R10: 0000000000000001 R11: 0000000000000000 R12: 1ffff9200056bf65 [ 78.166204][ T3661] R13: 0000000000000292 R14: ffff88807467f718 R15: 00000000c0e0008c [ 78.174321][ T3661] FS: 0000000000000000(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000 [ 78.183310][ T3661] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 78.190156][ T3661] CR2: 000000c000208800 CR3: 000000007f7b5000 CR4: 00000000003506f0 [ 78.198235][ T3661] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 78.206214][ T3661] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 78.214328][ T3661] Call Trace: [ 78.217679][ T3661] [ 78.220621][ T3661] ? __sanitizer_cov_trace_const_cmp4+0x1c/0x70 [ 78.226981][ T3661] ? nlmsg_notify+0xbe/0x280 [ 78.231607][ T3661] ? ref_tracker_dir_exit+0x330/0x330 [ 78.237654][ T3661] ? linkwatch_do_dev+0x96/0x160 [ 78.242628][ T3661] ? __linkwatch_run_queue+0x233/0x6a0 [ 78.248170][ T3661] ? linkwatch_event+0x4a/0x60 [ 78.252946][ T3661] ? process_one_work+0x9ac/0x1680 [ 78.258136][ T3661] ? worker_thread+0x853/0x11c0 [ 78.263020][ T3661] ? kthread+0x405/0x4f0 [ 78.267905][ T3661] ? ret_from_fork+0x1f/0x30 [ 78.272670][ T3661] ? netdev_state_change+0xa1/0x130 [ 78.278019][ T3661] ? netdev_exit+0xd0/0xd0 [ 78.282466][ T3661] ? dev_activate+0x420/0xa60 [ 78.287261][ T3661] linkwatch_do_dev+0x96/0x160 [ 78.292043][ T3661] __linkwatch_run_queue+0x233/0x6a0 [ 78.297505][ T3661] ? linkwatch_do_dev+0x160/0x160 [ 78.302561][ T3661] linkwatch_event+0x4a/0x60 [ 78.307225][ T3661] process_one_work+0x9ac/0x1680 [ 78.312292][ T3661] ? pwq_dec_nr_in_flight+0x2a0/0x2a0 [ 78.317757][ T3661] ? rwlock_bug.part.0+0x90/0x90 [ 78.322726][ T3661] ? _raw_spin_lock_irq+0x41/0x50 [ 78.327844][ T3661] worker_thread+0x853/0x11c0 [ 78.332543][ T3661] ? process_one_work+0x1680/0x1680 [ 78.338500][ T3661] kthread+0x405/0x4f0 [ 78.342610][ T3661] ? set_kthread_struct+0x130/0x130 Fixes: 63f13937cbe9 ("net: linkwatch: add net device refcount tracker") Signed-off-by: Eric Dumazet Reported-by: syzbot Link: https://lore.kernel.org/r/20211214051955.3569843-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit 1d2f3d3c62684b793339d0ae841ac67b555d8c8d Author: Eric Dumazet Date: Mon Dec 13 20:32:08 2021 -0800 mptcp: adjust to use netns refcount tracker MPTCP can change sk_net_refcnt after sock_create_kern() call. We need to change its corresponding get_net() to avoid a splat at release time, as in : refcount_t: decrement hit 0; leaking memory. WARNING: CPU: 0 PID: 3599 at lib/refcount.c:31 refcount_warn_saturate+0xbf/0x1e0 lib/refcount.c:31 Modules linked in: CPU: 1 PID: 3599 Comm: syz-fuzzer Not tainted 5.16.0-rc4-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:refcount_warn_saturate+0xbf/0x1e0 lib/refcount.c:31 Code: 1d b1 99 a1 09 31 ff 89 de e8 5d 3a 9c fd 84 db 75 e0 e8 74 36 9c fd 48 c7 c7 60 00 05 8a c6 05 91 99 a1 09 01 e8 cc 4b 27 05 <0f> 0b eb c4 e8 58 36 9c fd 0f b6 1d 80 99 a1 09 31 ff 89 de e8 28 RSP: 0018:ffffc90001f5fab0 EFLAGS: 00010286 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 RDX: ffff888021873a00 RSI: ffffffff815f1e28 RDI: fffff520003ebf48 RBP: 0000000000000004 R08: 0000000000000000 R09: 0000000000000000 R10: ffffffff815ebbce R11: 0000000000000000 R12: 1ffff920003ebf5b R13: 00000000ffffffef R14: ffffffff8d2fcd94 R15: ffffc90001f5fd10 FS: 000000c00008a090(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f0a5b59e300 CR3: 000000001cbe6000 CR4: 00000000003506e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __refcount_dec include/linux/refcount.h:344 [inline] refcount_dec include/linux/refcount.h:359 [inline] ref_tracker_free+0x4fe/0x610 lib/ref_tracker.c:101 netns_tracker_free include/net/net_namespace.h:327 [inline] put_net_track include/net/net_namespace.h:341 [inline] __sk_destruct+0x4a6/0x920 net/core/sock.c:2042 sk_destruct+0xbd/0xe0 net/core/sock.c:2058 __sk_free+0xef/0x3d0 net/core/sock.c:2069 sk_free+0x78/0xa0 net/core/sock.c:2080 sock_put include/net/sock.h:1911 [inline] __mptcp_close_ssk+0x435/0x590 net/mptcp/protocol.c:2276 __mptcp_destroy_sock+0x35f/0x830 net/mptcp/protocol.c:2702 mptcp_close+0x5f8/0x7f0 net/mptcp/protocol.c:2750 inet_release+0x12e/0x280 net/ipv4/af_inet.c:428 inet6_release+0x4c/0x70 net/ipv6/af_inet6.c:476 __sock_release+0xcd/0x280 net/socket.c:649 sock_close+0x18/0x20 net/socket.c:1314 __fput+0x286/0x9f0 fs/file_table.c:280 task_work_run+0xdd/0x1a0 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:175 [inline] exit_to_user_mode_prepare+0x27e/0x290 kernel/entry/common.c:207 __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:300 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae Fixes: ffa84b5ffb37 ("net: add netns refcount tracker to struct sock") Signed-off-by: Eric Dumazet Reported-by: syzbot Cc: Mat Martineau Cc: Florian Westphal Acked-by: Paolo Abeni Reviewed-by: Matthieu Baerts Link: https://lore.kernel.org/r/20211214043208.3543046-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit 8b40a9d53d4f1705899be0a1518368d770ea95cc Author: Eric Dumazet Date: Mon Dec 13 18:58:06 2021 -0800 ipv6: use GFP_ATOMIC in rt6_probe() syzbot reminded me that rt6_probe() can run from atomic contexts. stack backtrace: CPU: 1 PID: 7461 Comm: syz-executor.2 Not tainted 5.16.0-rc4-next-20211210-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_usage_bug kernel/locking/lockdep.c:203 [inline] valid_state kernel/locking/lockdep.c:3945 [inline] mark_lock_irq kernel/locking/lockdep.c:4148 [inline] mark_lock.cold+0x61/0x8e kernel/locking/lockdep.c:4605 mark_usage kernel/locking/lockdep.c:4500 [inline] __lock_acquire+0x11d5/0x54a0 kernel/locking/lockdep.c:4981 lock_acquire kernel/locking/lockdep.c:5639 [inline] lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5604 __fs_reclaim_acquire mm/page_alloc.c:4550 [inline] fs_reclaim_acquire+0x115/0x160 mm/page_alloc.c:4564 might_alloc include/linux/sched/mm.h:253 [inline] slab_pre_alloc_hook mm/slab.h:739 [inline] slab_alloc_node mm/slub.c:3145 [inline] slab_alloc mm/slub.c:3239 [inline] kmem_cache_alloc_trace+0x3b/0x2c0 mm/slub.c:3256 kmalloc include/linux/slab.h:581 [inline] kzalloc include/linux/slab.h:715 [inline] ref_tracker_alloc+0xe1/0x430 lib/ref_tracker.c:74 netdev_tracker_alloc include/linux/netdevice.h:3860 [inline] dev_hold_track include/linux/netdevice.h:3877 [inline] rt6_probe net/ipv6/route.c:661 [inline] find_match.part.0+0xac9/0xd00 net/ipv6/route.c:752 find_match net/ipv6/route.c:825 [inline] __find_rr_leaf+0x17f/0xd20 net/ipv6/route.c:826 find_rr_leaf net/ipv6/route.c:847 [inline] rt6_select net/ipv6/route.c:891 [inline] fib6_table_lookup+0x649/0xa20 net/ipv6/route.c:2185 ip6_pol_route+0x1c5/0x11e0 net/ipv6/route.c:2221 pol_lookup_func include/net/ip6_fib.h:580 [inline] fib6_rule_lookup+0x52a/0x6f0 net/ipv6/fib6_rules.c:120 ip6_route_output_flags_noref+0x2e2/0x380 net/ipv6/route.c:2629 ip6_route_output_flags+0x72/0x320 net/ipv6/route.c:2642 ip6_route_output include/net/ip6_route.h:98 [inline] ip6_dst_lookup_tail+0x5ab/0x1620 net/ipv6/ip6_output.c:1070 ip6_dst_lookup_flow+0x8c/0x1d0 net/ipv6/ip6_output.c:1200 geneve_get_v6_dst+0x46f/0x9a0 drivers/net/geneve.c:858 geneve6_xmit_skb drivers/net/geneve.c:991 [inline] geneve_xmit+0x520/0x3530 drivers/net/geneve.c:1074 __netdev_start_xmit include/linux/netdevice.h:4685 [inline] netdev_start_xmit include/linux/netdevice.h:4699 [inline] xmit_one net/core/dev.c:3473 [inline] dev_hard_start_xmit+0x1eb/0x920 net/core/dev.c:3489 __dev_queue_xmit+0x2983/0x3640 net/core/dev.c:4112 neigh_resolve_output net/core/neighbour.c:1522 [inline] neigh_resolve_output+0x50e/0x820 net/core/neighbour.c:1502 neigh_output include/net/neighbour.h:541 [inline] ip6_finish_output2+0x56e/0x14f0 net/ipv6/ip6_output.c:126 __ip6_finish_output net/ipv6/ip6_output.c:191 [inline] __ip6_finish_output+0x61e/0xe80 net/ipv6/ip6_output.c:170 ip6_finish_output+0x32/0x200 net/ipv6/ip6_output.c:201 NF_HOOK_COND include/linux/netfilter.h:296 [inline] ip6_output+0x1e4/0x530 net/ipv6/ip6_output.c:224 dst_output include/net/dst.h:451 [inline] NF_HOOK include/linux/netfilter.h:307 [inline] ndisc_send_skb+0xa99/0x17f0 net/ipv6/ndisc.c:508 ndisc_send_rs+0x12e/0x6f0 net/ipv6/ndisc.c:702 addrconf_rs_timer+0x3f2/0x820 net/ipv6/addrconf.c:3898 call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1421 expire_timers kernel/time/timer.c:1466 [inline] __run_timers.part.0+0x675/0xa20 kernel/time/timer.c:1734 __run_timers kernel/time/timer.c:1715 [inline] run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1747 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558 invoke_softirq kernel/softirq.c:432 [inline] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:637 irq_exit_rcu+0x5/0x20 kernel/softirq.c:649 sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1097 Fixes: fb67510ba9bd ("ipv6: add net device refcount tracker to rt6_probe_deferred()") Signed-off-by: Eric Dumazet Reported-by: syzbot Link: https://lore.kernel.org/r/20211214025806.3456382-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit 9e376b14ef3e0a78f3697d586cb6013c76e0f5f5 Merge: 59716aa3f9764 3aa1e96a2b95e Author: Mark Brown Date: Wed Dec 15 02:02:41 2021 +0000 ASoC : soc-pcm: fix trigger race conditions with shared BE Merge series from Pierre-Louis Bossart : We've been adding a 'deep buffer' PCM device to several SOF topologies in order to reduce power consumption. The typical use-case would be music playback over a headset: this additional PCM device provides more buffering and longer latencies, leaving the rest of the system sleep for longer periods. Notifications and 'regular' low-latency audio playback would still use the 'normal' PCM device and be mixed with the 'deep buffer' before rendering on the headphone endpoint. The tentative direction would be to expose this alternate device to PulseAudio/PipeWire/CRAS via the UCM SectionModifier definitions. That seemed a straightforward topology change until our automated validation stress tests started reporting issues on SoundWire platforms, when e.g. two START triggers might be send and conversely the STOP trigger is never sent. The SoundWire stream state management flagged inconsistent states when the two 'normal' and 'deep buffer' devices are used concurrently with rapid play/stop/pause monkey testing. Looking at the soc-pcm.c code, it seems that the BE state management needs a lot of love. a) there is no consistent protection for the BE state. In some parts of the code, the state updates are protected by a spinlock but in the trigger they are not. When we open/play/close the two PCM devices in stress tests, we end-up testing a state that is being modified. That can't be good. b) there is a conceptual deadlock: on stop we check the FE states to see if a shared BE can be stopped, but since we trigger the BE first the FE states have not been modified yet, so the TRIGGER_STOP is never sent. This patchset suggests the removal of the dedicated 'dpcm_lock' and follows the design suggested by Takashi Iwai. By default the protection relies on the 'pcm_mutex', except for the FE and BE triggers where the mutex cannot be used. In this case, the FE PCM lock is used instead. In the cases where a BE is added/removed, the pcm_mutex and FE PCM lock are both taken. In addition, the BE PCM lock is used to serialize access to a shared BE. With these patches I am able to run our entire validation suite without any issues with this new 'deep buffer' topology, and no regressions on existing solutions [1]. The tests were reproduced by Bard Liao for SoundWire devices. One might ask 'how come we didn't see this earlier'? The answer is probably that the .trigger callbacks in most implementations seems to perform DAPM operations, and sending the triggers multiple times is not an issue. In the case of SoundWire, we do use the .trigger callback to reconfigure the bus using the 'bank switch' mechanism. It could be acceptable to tolerate a trigger multiple times, but the deadlock on stop cannot be fixed at the SoundWire level alone. Opens: 1) The issues reported by Nvidia on the RFCv3 may or may not be present. We'd need test results to make sure the locking update does not introduce a regression on Tegra. 2) There are other reports of kernel oopses [2] that seem related to the lack of protection. I'd be good to confirm if this patchset solve these problems as well. [1] https://github.com/thesofproject/linux/pull/3146 [2] https://lore.kernel.org/alsa-devel/002f01d7b4f5$c030f4a0$4092dde0$@samsung.com/ changes since RFCv3: Used two patches from Takashi. We now use the pcm_mutex, the FE stream lock when adding and deleting a BE, and the BE stream lock to handle concurrency between streams using the same BE. Added a patch to use GFP_ATOMIC for the DPCM structure. Fixed PAUSE_RELEASE transition (GitHub comment from Kai Vehmanen) changes since RFCv2: Removal of dpcm_lock to use FE PCM locks (credits to Takashi Iwai for the suggestion). The FE PCM lock is now used before each use of for_each_dpcm_be() - with the exception of the trigger where the lock is already taken. This change is also applied in drivers which make use of this loop (compress, SH, FSL). Addition of BE PCM lock to deal with mutual exclusion between triggers for the same BE. Alignment of the BE atomicity on the FE on connections, this is required to avoid sleeping in atomic context. Additional cleanups (indentation, static functions) changes since RFC v1: Removed unused function Removed exported symbols only used in soc-pcm.c, used static instead Use a mutex instead of a spinlock Protect all for_each_dpcm_be() loops Fix bugs introduced in the refcount Pierre-Louis Bossart (4): ASoC: soc-pcm: use GFP_ATOMIC for dpcm structure ASoC: soc-pcm: align BE 'atomicity' with that of the FE ASoC: soc-pcm: test refcount before triggering ASoC: soc-pcm: fix BE handling of PAUSE_RELEASE Takashi Iwai (2): ASoC: soc-pcm: Fix and cleanup DPCM locking ASoC: soc-pcm: serialize BE triggers include/sound/soc-dpcm.h | 2 + include/sound/soc.h | 2 - sound/soc/soc-core.c | 1 - sound/soc/soc-pcm.c | 351 +++++++++++++++++++++++++++------------ 4 files changed, 246 insertions(+), 110 deletions(-) -- 2.25.1 commit 708da3ff1d67392500bdb8789d5635cd98f9ea92 Merge: b149d5d45ac91 63fa47ba886b8 Author: Michael Ellerman Date: Wed Dec 15 11:29:53 2021 +1100 Merge branch 'topic/ppc-kvm' into next Bring in some more KVM commits from our KVM topic branch. commit 68497092bde9f53e35cafeb52fa9a267ebe0d9b1 Author: Jens Axboe Date: Tue Dec 14 17:23:05 2021 -0700 block: make queue stat accounting a reference kyber turns on IO statistics when it is loaded on a queue, which means that even if kyber is then later unloaded, we're still stuck with stats enabled on the queue. Change the account enabled from a bool to an int, and pair the enable call with the equivalent disable call. This ensures that stats gets turned off again appropriately. Reviewed-by: Omar Sandoval Signed-off-by: Jens Axboe commit 59aa7fcfe2e44afbe9736e5cfa941699021d6957 Author: Kees Cook Date: Mon Dec 13 14:33:28 2021 -0800 IB/mthca: Use memset_startat() for clearing mpt_entry In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Use memset_startat() so memset() doesn't get confused about writing beyond the destination member that is intended to be the starting point of zeroing through the end of the struct. Link: https://lore.kernel.org/r/20211213223331.135412-15-keescook@chromium.org Signed-off-by: Kees Cook Signed-off-by: Jason Gunthorpe commit c2ed5611afd75a37fa9f77ea71c661c2e087525a Author: Kees Cook Date: Mon Dec 13 14:33:26 2021 -0800 iw_cxgb4: Use memset_startat() for cpl_t5_pass_accept_rpl In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Use memset_startat() so memset() doesn't get confused about writing beyond the destination member that is intended to be the starting point of zeroing through the end of the struct. Additionally, since everything appears to perform a roundup (including allocation), just change the size of the struct itself and add a build-time check to validate the expected size. Link: https://lore.kernel.org/r/20211213223331.135412-13-keescook@chromium.org Signed-off-by: Kees Cook Signed-off-by: Jason Gunthorpe commit e517f76a3cb24b2a4749e0348390aece24cf9925 Author: Kees Cook Date: Mon Dec 13 14:33:23 2021 -0800 RDMA/mlx5: Use memset_after() to zero struct mlx5_ib_mr In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Use memset_after() to zero the end of struct mlx5_ib_mr that should be initialized. Link: https://lore.kernel.org/r/20211213223331.135412-10-keescook@chromium.org Acked-by: Leon Romanovsky Signed-off-by: Kees Cook Signed-off-by: Jason Gunthorpe commit 4922f0920966c28d674b03479cdcb7f3939bfbbd Merge: 20679094a0161 2585cf9dfaadd Author: Jason Gunthorpe Date: Tue Dec 14 20:18:48 2021 -0400 Merge tag 'v5.16-rc5' into rdma.git for-next Required due to dependencies in following patches. Signed-off-by: Jason Gunthorpe commit 20679094a0161c94faf77e373fa3f7428a8e14bd Author: Avihai Horon Date: Thu Dec 9 15:16:07 2021 +0200 RDMA/cma: Let cma_resolve_ib_dev() continue search even after empty entry Currently, when cma_resolve_ib_dev() searches for a matching GID it will stop searching after encountering the first empty GID table entry. This behavior is wrong since neither IB nor RoCE spec enforce tightly packed GID tables. For example, when the matching valid GID entry exists at index N, and if a GID entry is empty at index N-1, cma_resolve_ib_dev() will fail to find the matching valid entry. Fix it by making cma_resolve_ib_dev() continue searching even after encountering missing entries. Fixes: f17df3b0dede ("RDMA/cma: Add support for AF_IB to rdma_resolve_addr()") Link: https://lore.kernel.org/r/b7346307e3bb396c43d67d924348c6c496493991.1639055490.git.leonro@nvidia.com Signed-off-by: Avihai Horon Reviewed-by: Mark Zhang Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 483d805191a23191f8294bbf9b4e94836f5d92e4 Author: Avihai Horon Date: Thu Dec 9 15:16:06 2021 +0200 RDMA/core: Let ib_find_gid() continue search even after empty entry Currently, ib_find_gid() will stop searching after encountering the first empty GID table entry. This behavior is wrong since neither IB nor RoCE spec enforce tightly packed GID tables. For example, when a valid GID entry exists at index N, and if a GID entry is empty at index N-1, ib_find_gid() will fail to find the valid entry. Fix it by making ib_find_gid() continue searching even after encountering missing entries. Fixes: 5eb620c81ce3 ("IB/core: Add helpers for uncached GID and P_Key searches") Link: https://lore.kernel.org/r/e55d331b96cecfc2cf19803d16e7109ea966882d.1639055490.git.leonro@nvidia.com Signed-off-by: Avihai Horon Reviewed-by: Mark Zhang Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 109f2d39a621dde1b052e9ab71e2ea2b131832f5 Author: Avihai Horon Date: Thu Dec 9 15:16:05 2021 +0200 RDMA/core: Modify rdma_query_gid() to return accurate error codes Modify rdma_query_gid() to return -ENOENT for empty entries. This will make error reporting more accurate and will be used in next patches. Link: https://lore.kernel.org/r/1f2b65dfb4d995e74b621e3e21e7c7445d187956.1639055490.git.leonro@nvidia.com Signed-off-by: Avihai Horon Reviewed-by: Mark Zhang Signed-off-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 0045e0d3f42ed7d05434bb5bc16acfc793ea4891 Author: Yixing Liu Date: Tue Dec 7 20:49:01 2021 +0800 RDMA/hns: Support direct wqe of userspace The current write wqe mechanism is to write to DDR first, and then notify the hardware through doorbell to read the data. Direct wqe is a mechanism to fill wqe directly into the hardware. In the case of light load, the wqe will be filled into pcie bar space of the hardware, this will reduce one memory access operation and therefore reduce the latency. SIMD instructions allows cpu to write the 512 bits at one time to device memory, thus it can be used for posting direct wqe. Add direct wqe enable switch and address mapping. Link: https://lore.kernel.org/r/20211207124901.42123-2-liangwenpeng@huawei.com Signed-off-by: Yixing Liu Signed-off-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe commit bdd8b6c98239cad3a976d6f197afc2c794d3cef8 Author: Lucas De Marchi Date: Wed Dec 1 16:30:48 2021 -0800 drm/i915: replace X86_FEATURE_PAT with pat_enabled() PAT can be disabled on boot with "nopat" in the command line. Replace one x86-ism with another, which is slightly more correct to prepare for supporting other architectures. Cc: Matt Roper Signed-off-by: Lucas De Marchi Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20211202003048.1015511-1-lucas.demarchi@intel.com commit bc6e60a4fc1daef2d95367fea8ee74fc5b62b7d6 Author: Xiu Jianfeng Date: Tue Dec 14 19:48:54 2021 +0800 audit: use struct_size() helper in kmalloc() Make use of struct_size() helper instead of an open-coded calucation. Link: https://github.com/KSPP/linux/issues/160 Signed-off-by: Xiu Jianfeng Reviewed-by: Kees Cook Signed-off-by: Paul Moore commit a34efe503bc55c5732e328e5191ad549eb899f31 Merge: c164b8b40422e 0da2596f343c0 Author: Andrii Nakryiko Date: Tue Dec 14 14:38:06 2021 -0800 Merge branch 'Stop using bpf_object__find_program_by_title API' Kui-Feng Lee says: ==================== bpf_object__find_program_by_title is going to be deprecated since v0.7. Replace all use cases with bpf_object__find_program_by_name if possible, or use bpf_object__for_each_program to iterate over programs, matching section names. V3 fixes a broken test case, fexit_bpf2bpf, in selftests/bpf, using bpf_obj__for_each_program API instead. [v2] https://lore.kernel.org/bpf/20211211003608.2764928-1-kuifeng@fb.com/ [v1] https://lore.kernel.org/bpf/20211210190855.1369060-1-kuifeng@fb.com/T/ ==================== Signed-off-by: Andrii Nakryiko commit 0da2596f343c0b234344ec47d51cbce3bde23dea Author: Kui-Feng Lee Date: Mon Dec 13 19:59:31 2021 -0800 libbpf: Mark bpf_object__find_program_by_title API deprecated. Deprecate this API since v0.7. All callers should move to bpf_object__find_program_by_name if possible, otherwise use bpf_object__for_each_program to find a program out from a given section. [0] Closes: https://github.com/libbpf/libbpf/issues/292 Signed-off-by: Kui-Feng Lee Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211214035931.1148209-5-kuifeng@fb.com commit b098f33692d75d184a3ab62095c376fd0e52d880 Author: Kui-Feng Lee Date: Mon Dec 13 19:59:30 2021 -0800 tools/perf: Stop using bpf_object__find_program_by_title API. bpf_obj__find_program_by_title() in libbpf is going to be deprecated. Call bpf_object_for_each_program to find a program in the section with a given name instead. Signed-off-by: Kui-Feng Lee Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211214035931.1148209-4-kuifeng@fb.com commit 7490d59268168adf16aa319b007986778080d367 Author: Kui-Feng Lee Date: Mon Dec 13 19:59:29 2021 -0800 samples/bpf: Stop using bpf_object__find_program_by_title API. bpf_object__find_program_by_title is going to be deprecated. Replace use cases of bpf_object__find_program_by_title in samples/bpf/ with bpf_object__for_each_program. Signed-off-by: Kui-Feng Lee Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211214035931.1148209-3-kuifeng@fb.com commit a393ea80a22a9beffdc9a527bd2f9f270e7a0c6e Author: Kui-Feng Lee Date: Mon Dec 13 19:59:28 2021 -0800 selftests/bpf: Stop using bpf_object__find_program_by_title API. bpf_object__find_program_by_title is going to be deprecated. Replace all use cases in tools/testing/selftests/bpf with bpf_object__find_program_by_name or bpf_object__for_each_program. Signed-off-by: Kui-Feng Lee Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211214035931.1148209-2-kuifeng@fb.com commit b92225b034c085418a21c0496cbf57728330552a Author: Rob Herring Date: Mon Dec 6 13:44:25 2021 -0600 dt-bindings: PCI: designware: Fix 'unevaluatedProperties' warnings With 'unevaluatedProperties' support implemented, there's a number of warnings from the Designware PCIe based bindings: Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.example.dt.yaml: pcie@1ffc000: Unevaluated properties are not allowed ('#address-cells', '#size-cells', 'device_type', 'bus-range', 'ranges', '#interrupt-cells', 'interrupt-map-mask', 'interrupt-map' were unexpected) Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.example.dt.yaml: pcie@1ffc000: Unevaluated properties are not allowed ('clock-names' was unexpected) Documentation/devicetree/bindings/pci/hisilicon,kirin-pcie.example.dt.yaml: pcie@f4000000: Unevaluated properties are not allowed ('bus-range', '#address-cells', '#size-cells', 'device_type', 'ranges', 'num-lanes', '#interrupt-cells', 'interrupts', 'interrupt-names', 'interrupt-map-mask', 'interrupt-map', 'clocks', 'clock-names' were unexpected) Documentation/devicetree/bindings/pci/hisilicon,kirin-pcie.example.dt.yaml: pcie@f4000000: Unevaluated properties are not allowed ('clock-names' was unexpected) Documentation/devicetree/bindings/pci/hisilicon,kirin-pcie.example.dt.yaml: pcie@f5000000: Unevaluated properties are not allowed ('bus-range', '#address-cells', '#size-cells', 'device_type', 'phys', 'ranges', 'num-lanes', '#interrupt-cells', 'interrupts', 'interrupt-names', 'interrupt-map-mask', 'interrupt-map', 'reset-gpios', 'pcie@0,0' were unexpected) Documentation/devicetree/bindings/pci/hisilicon,kirin-pcie.example.dt.yaml: pcie@f5000000: Unevaluated properties are not allowed ('phys', 'hisilicon,clken-gpios' were unexpected) Documentation/devicetree/bindings/pci/intel-gw-pcie.example.dt.yaml: pcie@d0e00000: Unevaluated properties are not allowed ('device_type', '#address-cells', '#size-cells', 'linux,pci-domain', 'bus-range', '#interrupt-cells', 'interrupt-map-mask', 'interrupt-map' were unexpected) Documentation/devicetree/bindings/pci/intel-gw-pcie.example.dt.yaml: pcie@d0e00000: Unevaluated properties are not allowed ('resets', 'phys', 'phy-names', 'reset-assert-ms' were unexpected) Documentation/devicetree/bindings/pci/rockchip-dw-pcie.example.dt.yaml: pcie@fe280000: Unevaluated properties are not allowed ('clock-names', 'msi-map', 'phys', 'phy-names', 'power-domains', 'resets', 'reset-names' were unexpected) Documentation/devicetree/bindings/pci/samsung,exynos-pcie.example.dt.yaml: pcie@15700000: Unevaluated properties are not allowed ('#address-cells', '#size-cells', '#interrupt-cells', 'device_type', 'bus-range', 'ranges', 'interrupt-map-mask', 'interrupt-map' were unexpected) Documentation/devicetree/bindings/pci/samsung,exynos-pcie.example.dt.yaml: pcie@15700000: Unevaluated properties are not allowed ('clock-names', 'phys', 'vdd10-supply', 'vdd18-supply' were unexpected) Documentation/devicetree/bindings/pci/sifive,fu740-pcie.example.dt.yaml: pcie@e00000000: Unevaluated properties are not allowed ('#address-cells', '#size-cells', '#interrupt-cells', 'device_type', 'dma-coherent', 'bus-range', 'ranges', 'interrupts', 'interrupt-parent', 'interrupt-map-mask', 'interrupt-map', 'clock-names', 'clocks' were unexpected) Documentation/devicetree/bindings/pci/sifive,fu740-pcie.example.dt.yaml: pcie@e00000000: Unevaluated properties are not allowed ('dma-coherent', 'clock-names', 'resets', 'pwren-gpios' were unexpected) Documentation/devicetree/bindings/pci/socionext,uniphier-pcie-ep.example.dt.yaml: pcie-ep@66000000: Unevaluated properties are not allowed ('clock-names', 'clocks', 'reset-names', 'resets', 'phy-names', 'phys' were unexpected) Documentation/devicetree/bindings/pci/toshiba,visconti-pcie.example.dt.yaml: pcie@28400000: Unevaluated properties are not allowed ('clock-names' was unexpected) Documentation/devicetree/bindings/pci/toshiba,visconti-pcie.example.dt.yaml: pcie@28400000: Unevaluated properties are not allowed ('device_type', 'bus-range', 'num-viewport', '#address-cells', '#size-cells', '#interrupt-cells', 'ranges', 'interrupt-names', 'interrupt-map-mask', 'interrupt-map', 'max-link-speed' were unexpected) The main problem is that snps,dw-pcie.yaml and snps,dw-pcie-ep.yaml shouldn't set 'unevaluatedProperties: false'. Otherwise, bindings that reference them cannot add additional properties. With that addressed, there's a handful of other undocumented properties to add. Cc: Xiaowei Song Cc: Binghui Wang Cc: Bjorn Helgaas Cc: Paul Walmsley Cc: Greentime Hu Cc: Palmer Dabbelt Cc: Jingoo Han Cc: Gustavo Pimentel Cc: linux-pci@vger.kernel.org Cc: linux-riscv@lists.infradead.org Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211206194426.2470080-1-robh@kernel.org commit 375c4b837e6023bc2b78f3207e90fa3d85d7446f Author: Rob Herring Date: Mon Dec 6 13:44:13 2021 -0600 dt-bindings: PCI: cdns-ep: Fix 'unevaluatedProperties' warnings With 'unevaluatedProperties' support implemented, the TI j721e endpoint binding example has a warning: Documentation/devicetree/bindings/pci/ti,j721e-pci-ep.example.dt.yaml: pcie-ep@d000000: Unevaluated properties are not allowed ('max-link-speed', 'num-lanes', 'max-functions' were unexpected) Adjust where pci-ep.yaml is referenced so that ti,j721e-pci-ep.yaml will include it. Cc: Tom Joseph Cc: Bjorn Helgaas Cc: linux-pci@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211206194413.2469643-1-robh@kernel.org commit dcd49679fb3aac0432785c409cc9adcdf94b9e1d Author: Rob Herring Date: Mon Dec 6 13:44:05 2021 -0600 dt-bindings: PCI: Fix 'unevaluatedProperties' warnings With 'unevaluatedProperties' support implemented, there's several warnings due to undocumented properties: Documentation/devicetree/bindings/pci/mediatek,mt7621-pcie.example.dt.yaml: pcie@1e140000: pcie@0,0: Unevaluated properties are not allowed ('phy-names' was unexpected) Documentation/devicetree/bindings/pci/mediatek,mt7621-pcie.example.dt.yaml: pcie@1e140000: pcie@1,0: Unevaluated properties are not allowed ('phy-names' was unexpected) Documentation/devicetree/bindings/pci/mediatek,mt7621-pcie.example.dt.yaml: pcie@1e140000: pcie@2,0: Unevaluated properties are not allowed ('phy-names' was unexpected) Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.example.dt.yaml: pcie@11230000: Unevaluated properties are not allowed ('phy-names' was unexpected) Documentation/devicetree/bindings/pci/microchip,pcie-host.example.dt.yaml: pcie@2030000000: Unevaluated properties are not allowed ('interrupt-controller' was unexpected) Documentation/devicetree/bindings/pci/ti,am65-pci-ep.example.dt.yaml: pcie-ep@5500000: Unevaluated properties are not allowed ('num-ib-windows', 'num-ob-windows' were unexpected) Documentation/devicetree/bindings/pci/ti,am65-pci-host.example.dt.yaml: pcie@5500000: Unevaluated properties are not allowed ('num-viewport', 'interrupts' were unexpected) Documentation/devicetree/bindings/pci/ti,j721e-pci-host.example.dt.yaml: pcie@2900000: Unevaluated properties are not allowed ('dma-coherent' was unexpected) Add the necessary property definitions or remove the properties from the examples to fix these warnings. Cc: Ryder Lee Cc: Jianjun Wang Cc: Sergio Paracuellos Cc: Bjorn Helgaas Cc: Matthias Brugger Cc: Daire McNamara Cc: Abraham I Cc: linux-pci@vger.kernel.org Cc: linux-mediatek@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Rob Herring Acked-by: Sergio Paracuellos Link: https://lore.kernel.org/r/20211206194406.2469361-1-robh@kernel.org commit 07bb5e0e7bd6d5bc4c76d1c84c82882ecf1df4de Author: Rob Herring Date: Mon Dec 6 11:42:15 2021 -0600 dt-bindings: memory-controllers: ti,gpmc: Drop incorrect unevaluatedProperties With 'unevaluatedProperties' support implemented, the TI GPMC example has a warning: Documentation/devicetree/bindings/mtd/ti,gpmc-onenand.example.dt.yaml: memory-controller@6e000000: onenand@0,0: Unevaluated properties are not allowed ('compatible', '#address-cells', '#size-cells', 'partition@0', 'partition@100000' were unexpected) The child node definition for GPMC is not a complete binding, so specifying 'unevaluatedProperties: false' for it is not correct and should be dropped. Fixup the unnecessary 'allOf' while we're here. Cc: Krzysztof Kozlowski Cc: Tony Lindgren Cc: Roger Quadros Signed-off-by: Rob Herring Reviewed-by: Roger Quadros Reviewed-by: Thierry Reding Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20211206174215.2297796-1-robh@kernel.org commit b13e2bd3d258719fe1bc91ad3c9ccce1df708510 Author: Rob Herring Date: Mon Dec 6 11:41:12 2021 -0600 dt-bindings: usb: Add missing properties used in examples With 'unevaluatedProperties' support implemented, the following warnings are generated in the usb examples: Documentation/devicetree/bindings/usb/intel,keembay-dwc3.example.dt.yaml: usb: usb@34000000: Unevaluated properties are not allowed ('reg' was unexpected) Documentation/devicetree/bindings/usb/snps,dwc3.example.dt.yaml: usb@4a030000: Unevaluated properties are not allowed ('reg' was unexpected) Add the missing property definitions. Cc: Greg Kroah-Hartman Cc: Ahmad Zainie Cc: Felipe Balbi Cc: linux-usb@vger.kernel.org Signed-off-by: Rob Herring Acked-by: Greg Kroah-Hartman Reviewed-by: Thierry Reding Link: https://lore.kernel.org/r/20211206174113.2295616-1-robh@kernel.org commit 9696fe26bc8c092174b0c076c1a34801d6adf431 Author: Rob Herring Date: Mon Dec 6 11:40:45 2021 -0600 dt-bindings: watchdog: atmel: Add missing 'interrupts' property With 'unevaluatedProperties' support implemented, the atmel,sama5d4-wdt example has the following warning: /home/rob/proj/git/linux-dt/.build-arm64/Documentation/devicetree/bindings/watchdog/atmel,sama5d4-wdt.example.dt.yaml: watchdog@fc068640: Unevaluated properties are not allowed ('interrupts' was unexpected) Document the missing 'interrupts' property. Cc: Wim Van Sebroeck Cc: Guenter Roeck Cc: Nicolas Ferre Cc: Alexandre Belloni Cc: Ludovic Desroches Cc: Eugen Hristev Cc: linux-watchdog@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Rob Herring Acked-by: Guenter Roeck Reviewed-by: Thierry Reding Acked-by: Nicolas Ferre Link: https://lore.kernel.org/r/20211206174045.2294873-1-robh@kernel.org commit 1b0b90bde66ba866d7758179bd636173d4c26f6e Author: Rob Herring Date: Mon Dec 6 11:40:28 2021 -0600 dt-bindings: watchdog: ti,rti-wdt: Fix assigned-clock-parents With 'unevaluatedProperties' support implemented, the ti,rti-wdt example has the following warning: /home/rob/proj/git/linux-dt/.build-arm64/Documentation/devicetree/bindings/watchdog/ti,rti-wdt.example.dt.yaml: watchdog@2200000: Unevaluated properties are not allowed ('assigned-clock-parents' was unexpected) The problem is the schema has a typo in 'assigned-clocks-parents'. As it is not required to list assigned clocks in bindings, just drop the property definitions to fix this. Cc: Wim Van Sebroeck Cc: Guenter Roeck Cc: Tero Kristo Cc: linux-watchdog@vger.kernel.org Signed-off-by: Rob Herring Reviewed-by: Thierry Reding Acked-by: Guenter Roeck Link: https://lore.kernel.org/r/20211206174028.2294330-1-robh@kernel.org commit c99a83a28d1676599956bec12a310066bf44c0ca Author: Rob Herring Date: Mon Dec 6 11:42:37 2021 -0600 dt-bindings: i2c: aspeed: Drop stray '#interrupt-cells' '#interrupt-cells' is not documented which causes a warning when 'unevaluatedProperties' is implemented. Unless the I2C controller is also an interrupt controller, '#interrupt-cells' is not valid. This doesn't appear to be the case from the driver, so just remove it from the example. Cc: Brendan Higgins Cc: Benjamin Herrenschmidt Cc: Joel Stanley Cc: Andrew Jeffery Cc: Rayn Chen Cc: linux-i2c@vger.kernel.org Cc: openbmc@lists.ozlabs.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-aspeed@lists.ozlabs.org Signed-off-by: Rob Herring Reviewed-by: Thierry Reding Link: https://lore.kernel.org/r/20211206174237.2298580-1-robh@kernel.org commit 4a5cf65d003c0a77228cc301caad12ef1c518a9b Merge: 50d1eefa2dd7b fafc114a468ee Author: Georgi Djakov Date: Tue Dec 14 23:44:01 2021 +0200 Merge branch 'icc-sm8450' into icc-next This add device tree binding and driver for interconnect providers found in SM8450 SoC. * icc-sm8450 dt-bindings: interconnect: Add Qualcomm SM8450 DT bindings interconnect: qcom: Add SM8450 interconnect provider driver Link: https://lore.kernel.org/r/20211209084842.189627-1-vkoul@kernel.org Signed-off-by: Georgi Djakov commit fafc114a468ee43b95388bec8a45d042bc3f9344 Author: Vinod Koul Date: Thu Dec 9 14:18:42 2021 +0530 interconnect: qcom: Add SM8450 interconnect provider driver Add driver for the Qualcomm interconnect buses found in SM8450 based platforms. The topology consists of several NoCs that are controlled by a remote processor that collects the aggregated bandwidth for each master-slave pairs. This is based on the downstream driver by Vivek Aknurwar Signed-off-by: Vinod Koul Link: https://lore.kernel.org/r/20211209084842.189627-3-vkoul@kernel.org Signed-off-by: Georgi Djakov commit 0ae8c6252888d487f69b406369c3176172bb2064 Author: Vinod Koul Date: Thu Dec 9 14:18:41 2021 +0530 dt-bindings: interconnect: Add Qualcomm SM8450 DT bindings The Qualcomm SM8450 SoC has several bus fabrics that could be controlled and tuned dynamically according to the bandwidth demand Signed-off-by: Vinod Koul Acked-by: Rob Herring Link: https://lore.kernel.org/r/20211209084842.189627-2-vkoul@kernel.org Signed-off-by: Georgi Djakov commit 4d4872fef9d1788da10efc07a4f4c91799f77a94 Merge: 6eecfd592d5e0 019cd8a9e3bcb Author: Arnd Bergmann Date: Tue Dec 14 22:41:32 2021 +0100 Merge tag 'ixp4xx-arm-soc-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik into arm/soc Some IXP4xx SoC and driver related changes for v5.17: - Drop unused Kconfig options - Drop unused platform data header file * tag 'ixp4xx-arm-soc-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik: ARM: ixp4xx: remove unused header file pata_ixp4xx_cf.h ARM: ixp4xx: remove dead configs CPU_IXP43X and CPU_IXP46X Link: https://lore.kernel.org/r/CACRpkdZXZBpexMUuwTV-RB7_QAjBQkSbRsaBtgFShcqxuNTUgw@mail.gmail.com Signed-off-by: Arnd Bergmann commit c164b8b40422ef5c643d08bbc63280e1e1610573 Author: Andrii Nakryiko Date: Tue Dec 14 11:59:04 2021 -0800 selftests/bpf: Remove explicit setrlimit(RLIMIT_MEMLOCK) in main selftests As libbpf now is able to automatically take care of RLIMIT_MEMLOCK increase (or skip it altogether on recent enough kernels), remove explicit setrlimit() invocations in bench, test_maps, test_verifier, and test_progs. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20211214195904.1785155-3-andrii@kernel.org commit e542f2c4cd16d49392abf3349341d58153d3c603 Author: Andrii Nakryiko Date: Tue Dec 14 11:59:03 2021 -0800 libbpf: Auto-bump RLIMIT_MEMLOCK if kernel needs it for BPF The need to increase RLIMIT_MEMLOCK to do anything useful with BPF is one of the first extremely frustrating gotchas that all new BPF users go through and in some cases have to learn it a very hard way. Luckily, starting with upstream Linux kernel version 5.11, BPF subsystem dropped the dependency on memlock and uses memcg-based memory accounting instead. Unfortunately, detecting memcg-based BPF memory accounting is far from trivial (as can be evidenced by this patch), so in practice most BPF applications still do unconditional RLIMIT_MEMLOCK increase. As we move towards libbpf 1.0, it would be good to allow users to forget about RLIMIT_MEMLOCK vs memcg and let libbpf do the sensible adjustment automatically. This patch paves the way forward in this matter. Libbpf will do feature detection of memcg-based accounting, and if detected, will do nothing. But if the kernel is too old, just like BCC, libbpf will automatically increase RLIMIT_MEMLOCK on behalf of user application ([0]). As this is technically a breaking change, during the transition period applications have to opt into libbpf 1.0 mode by setting LIBBPF_STRICT_AUTO_RLIMIT_MEMLOCK bit when calling libbpf_set_strict_mode(). Libbpf allows to control the exact amount of set RLIMIT_MEMLOCK limit with libbpf_set_memlock_rlim_max() API. Passing 0 will make libbpf do nothing with RLIMIT_MEMLOCK. libbpf_set_memlock_rlim_max() has to be called before the first bpf_prog_load(), bpf_btf_load(), or bpf_object__load() call, otherwise it has no effect and will return -EBUSY. [0] Closes: https://github.com/libbpf/libbpf/issues/369 Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20211214195904.1785155-2-andrii@kernel.org commit 8c4e1b1617bba39658c46449ad480b2bf4b9ff6f Author: Linus Walleij Date: Mon Dec 6 02:11:58 2021 +0100 ARM: configs: gemini: Activate crypto driver This enables the SL3516 crypto driver on the Gemini platforms where it is available, by default in the defconfig. Clean up some noise around the crypto options while we're at it. Signed-off-by: Linus Walleij Cc: Corentin Labbe Link: https://lore.kernel.org/r/20211206011158.4180141-1-linus.walleij@linaro.org' Signed-off-by: Arnd Bergmann commit a342655865b2f14d1fbf346356d3b3360e63e872 Author: Xiang wangx Date: Tue Dec 14 21:52:17 2021 +0800 drm/radeon: Fix syntax errors in comments Delete the redundant word 'we'. Reviewed-by: Christian König Signed-off-by: Xiang wangx Signed-off-by: Alex Deucher commit 326db0dc00e57432b689349b4da3e86c90d5d61a Author: Yann Dirson Date: Tue Dec 14 00:30:30 2021 +0100 amdgpu: fix some comment typos Signed-off-by: Yann Dirson Signed-off-by: Alex Deucher commit 03f2abb07e54b3e0da54c52a656d9765b7e141c5 Author: Yann Dirson Date: Tue Dec 14 00:30:29 2021 +0100 amdgpu: fix some kernel-doc markup Those are not today pulled by the sphinx doc, but better be ready. Signed-off-by: Yann Dirson Signed-off-by: Alex Deucher commit 19cd8c8b4ded35fbfde0aee3b7c0e75bc151161e Author: Yann Dirson Date: Tue Dec 14 00:30:28 2021 +0100 Documentation/gpu: include description of some of the GC microcontrollers This is Alex' description from the "Looking for clarifications around gfx/kcq/kiq" thread, edited to fit as ReST. Original text: https://www.spinics.net/lists/amd-gfx/msg71383.html Originally-by: Alex Deucher Signed-off-by: Yann Dirson Acked-by: Harry Wentland Reviewed-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit d59f1774bef998deaf3ff3fe1d2d3b069fea5aa2 Author: Yann Dirson Date: Tue Dec 14 00:30:27 2021 +0100 Documentation/gpu: include description of AMDGPU hardware structure This describes in broad lines the how an AMD GPU is organized, in terms of hardware blocks. This is Alex' description from the "gpu block diagram" thread, edited to fit as ReST. Original text: https://www.spinics.net/lists/amd-gfx/msg71543.html Originally-by: Alex Deucher Signed-off-by: Yann Dirson Acked-by: Harry Wentland Reviewed-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 583637d66a70fc7090e12fb0ebbacc33d39e2214 Author: Lang Yu Date: Tue Dec 14 15:25:54 2021 +0800 drm/amd/pm: fix a potential gpu_metrics_table memory leak Memory is allocated for gpu_metrics_table in renoir_init_smc_tables(), but not freed in int smu_v12_0_fini_smc_tables(). Free it! Fixes: 95868b85764a ("drm/amd/powerplay: add Renoir support for gpu metrics export") Signed-off-by: Lang Yu Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 948e7ce01413b71395723aaf846015062aea3a43 Author: Jingwen Chen Date: Tue Dec 14 11:50:39 2021 +0800 drm/amd/amdgpu: fix gmc bo pin count leak in SRIOV [Why] gmc bo will be pinned during loading amdgpu and reset in SRIOV while only unpinned in unload amdgpu [How] add amdgpu_in_reset and sriov judgement to skip pin bo v2: fix wrong judgement Signed-off-by: Jingwen Chen Reviewed-by: Horace Chen Signed-off-by: Alex Deucher commit 85dfc1d692c9434c37842e610be37cd4ae4e0081 Author: Jingwen Chen Date: Tue Dec 14 11:31:16 2021 +0800 drm/amd/amdgpu: fix psp tmr bo pin count leak in SRIOV [Why] psp tmr bo will be pinned during loading amdgpu and reset in SRIOV while only unpinned in unload amdgpu [How] add amdgpu_in_reset and sriov judgement to skip pin bo v2: fix wrong judgement Signed-off-by: Jingwen Chen Reviewed-by: Horace Chen Signed-off-by: Alex Deucher commit 91e16017b6d36c2b7358654ccce9f69b2448df20 Author: Lijo Lazar Date: Tue Dec 14 15:04:47 2021 +0800 drm/amd/pm: Skip power state allocation Power states are not valid for arcturus and aldebaran, no need to allocate memory. Signed-off-by: Lijo Lazar Reviewed-by: Yang Wang Reviewed-by: Evan Quan Signed-off-by: Alex Deucher commit 17252701ecb5ef3bdfb912aae5a011f93978781a Author: Evan Quan Date: Mon Dec 13 14:38:38 2021 +0800 drm/amdgpu: correct the wrong cached state for GMC on PICASSO Pair the operations did in GMC ->hw_init and ->hw_fini. That can help to maintain correct cached state for GMC and avoid unintention gate operation dropping due to wrong cached state. BugLink: https://gitlab.freedesktop.org/drm/amd/-/issues/1828 Signed-off-by: Evan Quan Acked-by: Guchun Chen Reviewed-by: Mario Limonciello Signed-off-by: Alex Deucher commit e0f943b4f9a366ac7f24fa3f0e52141178d4f1b5 Author: Guchun Chen Date: Mon Dec 13 12:06:30 2021 +0800 drm/amdgpu: use adev_to_drm to get drm_device pointer Updated for consistency when accessing drm_device from amdgpu driver. Signed-off-by: Guchun Chen Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 7e31a8585b79a4d67e7fefdb6428054d18ddd339 Author: Evan Quan Date: Mon Dec 13 11:37:56 2021 +0800 drm/amdgpu: move smu_debug_mask to a more proper place As the smu_context will be invisible from outside(of power). Also, the smu_debug_mask can be shared around all power code instead of some specific framework(swSMU) only. Signed-off-by: Evan Quan Reviewed-by: Lijo Lazar Reviewed-by: Guchun Chen Signed-off-by: Alex Deucher commit fa4a427d84f9b797970a3d5139d7645403e4e989 Author: Victor Skvortsov Date: Mon Dec 13 21:38:20 2021 +0000 drm/amdgpu: SRIOV flr_work should use down_write Host initiated VF FLR may fail if someone else is already holding a read_lock. Change from down_write_trylock to down_write to guarantee the reset goes through. Signed-off-by: Victor Skvortsov Reviewed by: Shaoyun.liu Signed-off-by: Alex Deucher commit b4acd97bf827122bd333a4d043c275a4eb9db905 Author: Aric Cyr Date: Fri Dec 10 15:04:08 2021 -0800 drm/amd/display: 3.2.166 Tested-by: Daniel Wheeler Acked-by: Pavle Kotarac Signed-off-by: Aric Cyr Signed-off-by: Alex Deucher commit 4866b0bfea40cddb7275c88aeb95b47dac3d2a35 Author: Martin Leung Date: Fri Dec 10 15:04:07 2021 -0800 drm/amd/display: implement dc_mode_memclk why: Need interface to lower clocks when in dc (power save) mode. Must be able to work with p_state unsupported cases Can cause flicker when OS notifies us of dc state change how: added dal3 interface for KMD added pathway to query smu for this softmax added blank before clock change to override underflow added logic to change clk based on pstatesupport and softmax added logic in prepare/optimize_bw to conform while changing clocks Reviewed-by: Aric Cyr Acked-by: Pavle Kotarac Tested-by: Daniel Wheeler Signed-off-by: Martin Leung Signed-off-by: Alex Deucher commit b477143566d5b16c8b92ffec2cb3a896fe818509 Author: Eric Bernstein Date: Fri Dec 10 15:04:06 2021 -0800 drm/amd/display: ODM + MPO window on only one half of ODM [Why] For ODM + MPO window on one half of ODM, only 3 pipes should be allocated and scaling parameters adjusted to handle this case [How] Fix pipe allocation when MPO viewport is only on one side of ODM split, and modify scaling paramters. Added diags test cases for ODM + windows MPO, where MPO window is on right half, left half, and both halves or ODM. Reviewed-by: Dmytro Laktyushkin Acked-by: Pavle Kotarac Tested-by: Daniel Wheeler Signed-off-by: Eric Bernstein Signed-off-by: Alex Deucher commit 47e62dbd8dd30af66e8fdf1930a326971609dd32 Author: Nicholas Kazlauskas Date: Fri Dec 10 15:04:05 2021 -0800 drm/amd/display: Reset DMCUB before HW init [Why] If the firmware wasn't reset by PSP or HW and is currently running then the firmware will hang or perform underfined behavior when we modify its firmware state underneath it. [How] Reset DMCUB before setting up cache windows and performing HW init. Reviewed-by: Aurabindo Jayamohanan Pillai Acked-by: Pavle Kotarac Tested-by: Daniel Wheeler Signed-off-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher commit 4308acff0f3f4fd523e69face1db33f8de10a5b1 Author: Anthony Koo Date: Fri Dec 10 15:04:04 2021 -0800 drm/amd/display: [FW Promotion] Release 0.0.97 Reviewed-by: Aric Cyr Acked-by: Pavle Kotarac Tested-by: Daniel Wheeler Signed-off-by: Anthony Koo Signed-off-by: Alex Deucher commit 4658b25d38831be8b0d1a9eebc05b067cecd559d Author: Michael Strauss Date: Fri Dec 10 15:04:03 2021 -0800 drm/amd/display: Force det buf size to 192KB with 3+ streams and upscaling [WHY] This workaround resolves underflow caused by incorrect DST_Y_PREFETCH. Overriding to 192KB DET buf size until the DST_Y_PREFETCH calc is fixed. Reviewed-by: Eric Yang Acked-by: Pavle Kotarac Tested-by: Daniel Wheeler Signed-off-by: Michael Strauss Signed-off-by: Alex Deucher commit cd9a0d026baa10c75688908556b3af218bc4ddad Author: Mikita Lipski Date: Fri Dec 10 15:04:02 2021 -0800 drm/amd/display: parse and check PSR SU caps [why] Adding a function to read PSR capabilities and ALPM capabilities. Also adding a helper function to validate if the sink and the driver support PSR SU. [how] - isolated all PSR and ALPM reading calls to a separate funciton - set all required PSR caps - added a helper function to check if PSR SU is supported by sink and the driver Reviewed-by: Roman Li Reviewed-by: Rodrigo Siqueira Acked-by: Pavle Kotarac Tested-by: Daniel Wheeler Signed-off-by: Mikita Lipski Signed-off-by: Alex Deucher commit 741fe8a4d23de0ee93a4a4e1f54e48161b98cdb4 Author: Solomon Chiu Date: Fri Dec 10 15:04:01 2021 -0800 drm/amd/display: Add src/ext ID info for dummy service [Why] Current error log of dummy irq service doesn't have src/ext ID info in the log. [How] Add src/ext ID in ack/set of dummy irq service. Reviewed-by: Wayne Lin Acked-by: Pavle Kotarac Tested-by: Daniel Wheeler Signed-off-by: Solomon Chiu Signed-off-by: Alex Deucher commit 70487a99eeff5d0aa8104bd4eb236f318395658f Author: Wayne Lin Date: Fri Dec 10 15:04:00 2021 -0800 drm/amd/display: Add debugfs entry for ILR [Why & How] In order to know the intermediate link rates supported by the eDP panel and test to select the optimized link rate to save power, create a new debugfs entry "ilr_setting" for setting ILR. Reviewed-by: Aurabindo Jayamohanan Pillai Acked-by: Pavle Kotarac Tested-by: Daniel Wheeler Signed-off-by: Wayne Lin Signed-off-by: Alex Deucher commit 0215466a8585b6d9c132f9d9e46da3966a84eabb Author: Nicholas Kazlauskas Date: Fri Dec 10 15:03:59 2021 -0800 drm/amd/display: Set exit_optimized_pwr_state for DCN31 [Why] SMU now respects the PHY refclk disable request from driver. This causes a hang during hotplug when PHY refclk was disabled because it's not being re-enabled and the transmitter control starts on dc_link_detect. [How] We normally would re-enable the clk with exit_optimized_pwr_state but this is only set on DCN21 and DCN301. Set it for dcn31 as well. This fixes DMCUB timeouts in the PHY. Fixes: 64b1d0e8d500 ("drm/amd/display: Add DCN3.1 HWSEQ") Reviewed-by: Eric Yang Acked-by: Pavle Kotarac Tested-by: Daniel Wheeler Signed-off-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher commit 1d7ecc8084ca8b1edde7a462ebd9bfecc84550ac Author: Robin Murphy Date: Tue Dec 14 14:16:17 2021 +0000 dt-bindings: perf: Add compatible for Arm DSU-110 DSU-110 is the newest and shiniest for Armv9. Its programmer's model is largely identical to the previous generation of DSUs, so we can treat it as compatible, but it does have a a handful of extra IMP-DEF PMU events to call its own. Thanks to the new notion of core complexes, the maximum number of supported CPUs goes up as well. Signed-off-by: Robin Murphy Acked-by: Suzuki K Poulose Link: https://lore.kernel.org/r/51a8060493e1220886dcd468fad9a2b603607297.1639490264.git.robin.murphy@arm.com Signed-off-by: Rob Herring commit 2d0b208b3b0a6a84774b860d51f2be9af8f2053f Author: Robin Murphy Date: Tue Dec 14 14:16:16 2021 +0000 dt-bindings: perf: Convert Arm DSU to schema Convert the DSU binding to schema, as one does. Signed-off-by: Robin Murphy Acked-by: Suzuki K Poulose Link: https://lore.kernel.org/r/9fde2e11b0d11285c26d0e9d261034a1628c7901.1639490264.git.robin.murphy@arm.com Signed-off-by: Rob Herring commit 5479a013c874dc52374a382d791b3e42d3105463 Merge: 50c4ef6b8ab7d 4fc7261dbab13 Author: Ulf Hansson Date: Tue Dec 14 21:36:21 2021 +0100 Merge branch 'fixes' into next commit 50c4ef6b8ab7d1c8ce8833e338d32789fe1a468a Author: Florian Fainelli Date: Tue Dec 7 16:37:12 2021 -0800 dt-bindings: mmc: Convert Broadcom STB SDHCI binding to YAML Convert the Broadcom STB SDHCI controller Device Tree binding to YAML. Signed-off-by: Florian Fainelli Link: https://lore.kernel.org/r/20211208003727.3596577-2-f.fainelli@gmail.com Signed-off-by: Ulf Hansson commit 79e3b4c7dd1c54be4fdc77de9ba168bfa4e75567 Author: lizhe Date: Tue Dec 7 01:50:29 2021 -0800 mmc: core: Remove redundant driver match function If there is no driver match function, the driver core assumes that each candidate pair (driver, device) matches, see driver_match_device(). Drop the mmc bus's match function that always returned 1 and so implements the same behaviour as when there is no match function. Signed-off-by: lizhe Acked-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20211207095029.96387-1-sensor1010@163.com Signed-off-by: Ulf Hansson commit 4df297aaeb9c50c6399ee70ba4347f750c87b387 Author: Rob Herring Date: Mon Dec 6 11:42:00 2021 -0600 dt-bindings: mmc: Add missing properties used in examples When 'unevaluatedProperties' support is enabled, the following warnings are generated in the mmc bindings: Documentation/devicetree/bindings/mmc/mtk-sd.example.dt.yaml: mmc@11230000: Unevaluated properties are not allowed ('reg', 'interrupts' were unexpected) Documentation/devicetree/bindings/mmc/sdhci-am654.example.dt.yaml: mmc@4f80000: Unevaluated properties are not allowed ('sdhci-caps-mask' was unexpected) Documentation/devicetree/bindings/mmc/socionext,uniphier-sd.example.dt.yaml: mmc@5a400000: Unevaluated properties are not allowed ('dma-names', 'dmas' were unexpected) Documentation/devicetree/bindings/mmc/arm,pl18x.example.dt.yaml: mmc@80126000: Unevaluated properties are not allowed ('dmas', 'dma-names' were unexpected) Documentation/devicetree/bindings/mmc/arasan,sdhci.example.dt.yaml: mmc@80420000: Unevaluated properties are not allowed ('resets' was unexpected) Documentation/devicetree/bindings/mmc/arm,pl18x.example.dt.yaml: mmc@52007000: Unevaluated properties are not allowed ('interrupt-names' was unexpected) Documentation/devicetree/bindings/clock/imx8qxp-lpcg.example.dt.yaml: mmc@5b010000: Unevaluated properties are not allowed ('power-domains' was unexpected) Add the missing properties as necessary. For pl18x, drop interrupt-names as there isn't any use of it when there are 2 interrupts. Cc: Ulf Hansson Cc: Shawn Guo Cc: Sascha Hauer Cc: Pengutronix Kernel Team Cc: Fabio Estevam Cc: NXP Linux Team Cc: Chaotian Jing Cc: Matthias Brugger Cc: Kunihiko Hayashi Cc: Masami Hiramatsu Cc: Adrian Hunter Cc: Linus Walleij Cc: Wenbin Mei Cc: Masahiro Yamada Cc: linux-mmc@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-mediatek@lists.infradead.org Signed-off-by: Rob Herring Reviewed-by: Linus Walleij Reviewed-by: Thierry Reding Link: https://lore.kernel.org/r/20211206174201.2297265-1-robh@kernel.org Signed-off-by: Ulf Hansson commit c5dbed926abe4d5a95fb9e4a6467ddd7af9258ca Author: Andy Shevchenko Date: Mon Dec 6 13:52:18 2021 +0200 mmc: mmc_spi: Use write_or_read temporary variable in mmc_spi_data_do() Use write_or_read temporary variable in mmc_spi_data_do() to deduplicate the conditional code. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211206115218.73874-2-andriy.shevchenko@linux.intel.com Signed-off-by: Ulf Hansson commit 1fdafaaed70f6f6cd48574ce987dcf57ede5980a Author: Andy Shevchenko Date: Mon Dec 6 13:52:17 2021 +0200 mmc: mmc_spi: Convert 'multiple' to be boolean in mmc_spi_data_do() Convert 'multiple' to be boolean in mmc_spi_data_do() since it's initially being used as boolean. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211206115218.73874-1-andriy.shevchenko@linux.intel.com Signed-off-by: Ulf Hansson commit 2f4788f338c281e5fb0a812d34444068616dfa6b Author: Jesse Taube Date: Thu Nov 25 16:14:41 2021 -0500 mmc: sdhci-esdhc-imx: Add sdhc support for i.MXRT series Add support for i.MXRT1050's sdhc. Cc: Giulio Benetti Signed-off-by: Jesse Taube Reviewed-by: Fabio Estevam Link: https://lore.kernel.org/r/20211125211443.1150135-12-Mr.Bossman075@gmail.com Signed-off-by: Ulf Hansson commit 1e375e52adeb4d79681c378c233e2f292d229d38 Author: Jesse Taube Date: Thu Nov 25 16:14:40 2021 -0500 dt-bindings: mmc: fsl-imx-esdhc: add i.MXRT compatible string Add i.MXRT documentation for compatible string. Cc: Giulio Benetti Signed-off-by: Jesse Taube Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211125211443.1150135-11-Mr.Bossman075@gmail.com Signed-off-by: Ulf Hansson commit a13e8ef6008d3851f70b6d5a78ff0c7452cd45e4 Author: John Keeping Date: Wed Nov 24 18:46:02 2021 +0000 mmc: dw_mmc: exynos: use common_caps Move the common MMC_CAP_CMD23 capability to common_caps so that only the special case of MMC_CAP_1_8V_DDR and MMC_CAP_8_BIT_DATA are set via caps/num_caps. Both of those can, and should, be set via device tree properties instead, so we can now say that exynos_dwmmc_caps is only used for backwards compatibility. Signed-off-by: John Keeping Reviewed-by: Jaehoon Chung Link: https://lore.kernel.org/r/20211124184603.3897245-5-john@metanate.com Signed-off-by: Ulf Hansson commit 4bac670aa5cb6268308a0880dfe195fc6291140e Author: John Keeping Date: Wed Nov 24 18:46:01 2021 +0000 mmc: dw_mmc: rockchip: use common_caps The capabilities for all instances are the same, so use common_caps instead of caps/num_caps to remove the dependency on the mshcN device tree alias. Signed-off-by: John Keeping Tested-by: Nicolas Frattaroli Reviewed-by: Jaehoon Chung Link: https://lore.kernel.org/r/20211124184603.3897245-4-john@metanate.com Signed-off-by: Ulf Hansson commit 401b20c712baa698eb67b43fa63101733272d8a4 Author: John Keeping Date: Wed Nov 24 18:46:00 2021 +0000 mmc: dw_mmc: hi3798cv200: use common_caps The capabilities for all instances are the same, so use common_caps instead of caps/num_caps to remove the dependency on the mshcN device tree alias. Signed-off-by: John Keeping Reviewed-by: Jaehoon Chung Link: https://lore.kernel.org/r/20211124184603.3897245-3-john@metanate.com Signed-off-by: Ulf Hansson commit 0dc7a3ec30769aedb32036b785e69ee73d6b653f Author: John Keeping Date: Wed Nov 24 18:45:59 2021 +0000 mmc: dw_mmc: add common capabilities to replace caps The caps field depends on the mshcN alias ID but for some devices this is unnecessary as the capabilities are the same for all instances sharing the same compatible. Add a common_caps field for this case which updates the host's capabilities without needing the mshcN alias ID. Signed-off-by: John Keeping Tested-by: Nicolas Frattaroli Reviewed-by: Jaehoon Chung Link: https://lore.kernel.org/r/20211124184603.3897245-2-john@metanate.com Signed-off-by: Ulf Hansson commit e53e97f805cb1abeea000a61549d42f92cb10804 Author: Adrian Hunter Date: Wed Nov 24 11:48:50 2021 +0200 mmc: sdhci-pci: Add PCI ID for Intel ADL Add PCI ID for Intel ADL eMMC host controller. Signed-off-by: Adrian Hunter Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20211124094850.1783220-1-adrian.hunter@intel.com Signed-off-by: Ulf Hansson commit 6a8c2018e872906dddf34da40ddcac54cd7b967f Author: Mårten Lindahl Date: Fri Nov 19 16:53:37 2021 +0100 mmc: dw_mmc: Allow lower TMOUT value than maximum The TMOUT register is always set with a full value for every transfer, which (with a 200MHz clock) will give a full DRTO of ~84 milliseconds. This is normally good enough to complete the request, but setting a full value makes it impossible to test shorter timeouts, when for example testing data read times on different SD cards. Add a function to set any value smaller than the maximum of 0xFFFFFF. Signed-off-by: Mårten Lindahl Reviewed-by: Douglas Anderson Reviewed-by: Jaehoon Chung Link: https://lore.kernel.org/r/20211119155337.14341-1-marten.lindahl@axis.com Signed-off-by: Ulf Hansson commit 76bfc7ccc2fa9d382576f6013b57a0ef93d5a722 Author: Huijin Park Date: Thu Nov 4 15:32:31 2021 +0900 mmc: core: adjust polling interval for CMD1 In mmc_send_op_cond(), loops are continuously performed at the same interval of 10 ms. However the behaviour is not good for some eMMC which can be out from a busy state earlier than 10 ms if normal. Rather than fixing about the interval time in mmc_send_op_cond(), let's instead convert into using the common __mmc_poll_for_busy(). The reason for adjusting the interval time is that it is important to reduce the eMMC initialization time, especially in devices that use eMMC as rootfs. Test log(eMMC:KLM8G1GETF-B041): before: 12 ms (0.311016 - 0.298729) [ 0.295823] mmc0: starting CMD0 arg 00000000 flags 000000c0 [ 0.298729] mmc0: starting CMD1 arg 40000080 flags 000000e1<-start [ 0.311016] mmc0: starting CMD1 arg 40000080 flags 000000e1<-finish [ 0.311336] mmc0: starting CMD2 arg 00000000 flags 00000007 after: 2 ms (0.301270 - 0.298762) [ 0.295862] mmc0: starting CMD0 arg 00000000 flags 000000c0 [ 0.298762] mmc0: starting CMD1 arg 40000080 flags 000000e1<-start [ 0.299067] mmc0: starting CMD1 arg 40000080 flags 000000e1 [ 0.299441] mmc0: starting CMD1 arg 40000080 flags 000000e1 [ 0.299879] mmc0: starting CMD1 arg 40000080 flags 000000e1 [ 0.300446] mmc0: starting CMD1 arg 40000080 flags 000000e1 [ 0.301270] mmc0: starting CMD1 arg 40000080 flags 000000e1<-finish [ 0.301572] mmc0: starting CMD2 arg 00000000 flags 00000007 Signed-off-by: Huijin Park Link: https://lore.kernel.org/r/20211104063231.2115-3-huijin.park@samsung.com Signed-off-by: Ulf Hansson commit 2ebbdace5cc05caea9d12f536a8d0b9a3d930a29 Author: Huijin Park Date: Thu Nov 4 15:32:30 2021 +0900 mmc: core: change __mmc_poll_for_busy() parameter type This patch changes the __mmc_poll_for_busy() first parameter type from 'struct mmc_card*' to 'struct mmc_host*'. Because the function refers only 'struct mmc_host' to get hostname. Signed-off-by: Huijin Park Link: https://lore.kernel.org/r/20211104063231.2115-2-huijin.park@samsung.com Signed-off-by: Ulf Hansson commit 431fae8aca8a761299eba282bd1165f0e1704253 Author: Jacky Bai Date: Fri Nov 12 16:29:23 2021 +0800 dt-bindings: mmc: imx-esdhc: Add imx8ulp compatible string The USDHC on i.MX8ULP is derived from i.MX8MM, it uses two compatible strings, so update the compatible string for i.MX8ULP. Reviewed-by: Dong Aisheng Acked-by: Rob Herring Signed-off-by: Jacky Bai Signed-off-by: Peng Fan Link: https://lore.kernel.org/r/20211112082930.3809351-3-peng.fan@oss.nxp.com Signed-off-by: Ulf Hansson commit 9f0d3cc23842cb827493d4a59e474d0808a3f9f6 Author: Mårten Lindahl Date: Wed Nov 3 19:27:16 2021 +0100 mmc: dw_mmc: Avoid hung state if GEN_CMD transfer fails If we get a data error during a block transfer command, a stop command (CMD12) is normally initiated. But this does not work for the general command (CMD56), but instead the action is ignored and an uninitialized command struct is used for the stop action, with unexpected result. Fix this by adding a check for GEN_CMD when preparing stop transmission. Signed-off-by: Mårten Lindahl Link: https://lore.kernel.org/r/20211103182716.28419-1-marten.lindahl@axis.com Signed-off-by: Ulf Hansson commit dfb654f1885f05baf506cdfdbc3f7efa1d847d54 Author: H. Nikolaus Schaller Date: Wed Nov 10 18:17:11 2021 +0100 mmc: omap_hsmmc: Revert special init for wl1251 Due to recent changes to the mmc core, card quirks can be applied based upon a compatible string in child OF node. The quirk needed for wl1251 (SDIO card) is managed in the core, therefore there is no longer any reason to deal with this in omap_hsmmc too, so let's remove it. Signed-off-by: H. Nikolaus Schaller Link: https://lore.kernel.org/r/77d313b97d1e18b0eb7ed2d88d718d960f329bb0.1636564631.git.hns@goldelico.com [Ulf: Re-wrote the commit message to make it more clear] Signed-off-by: Ulf Hansson commit 187b164945c41713165b47e074c4a200cbe24269 Author: H. Nikolaus Schaller Date: Wed Nov 10 18:17:10 2021 +0100 mmc: core: transplant ti,wl1251 quirks from to be retired omap_hsmmc The TiWi WL1251 WiFi chip needs special setup of the sdio interface before it can be probed. So far, this is done in omap_hsmmc_init_card() in omap_hsmmc.c which makes it useable only if connected to omap devices which use the omap_hsmmc. The OpenPandora is the most promient example. There are plans to switch to a newer sdhci-omap driver and retire omap_hsmmc. Hence this quirk must be reworked or moved somewhere else. Ideally to some location that is not dependent on the specific SoC mmc host driver. This is achieved by the new mmc_fixup_device() option introduced by ("mmc: allow to match the device tree to apply quirks") to match through device tree compatible string. This quirk will be called early right after where host->ops->init_card() and thus omap_hsmmc_init_card() was previously called. Note that we do not need to transplant card->ocr = 0x80; because we rely on ("mmc: core: Fixup storing of OCR for MMC_QUIRK_NONSTD_SDIO"). Signed-off-by: H. Nikolaus Schaller Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/774565df7f02124c003aaf8b879706352548f832.1636564631.git.hns@goldelico.com Signed-off-by: Ulf Hansson commit 8c3e5b74b9e2146f564905e50ca716591c76d4f1 Author: Ulf Hansson Date: Wed Nov 10 18:17:09 2021 +0100 mmc: core: Fixup storing of OCR for MMC_QUIRK_NONSTD_SDIO The mmc core takes a specific path to support initializing of a non-standard SDIO card. This is triggered by looking for the card-quirk, MMC_QUIRK_NONSTD_SDIO. In mmc_sdio_init_card() this gets rather messy, as it causes the code to bail out earlier, compared to the usual path. This leads to that the OCR doesn't get saved properly in card->ocr. Fortunately, only omap_hsmmc has been using the MMC_QUIRK_NONSTD_SDIO and is dealing with the issue, by assigning a hardcoded value (0x80) to card->ocr from an ->init_card() ops. To make the behaviour consistent, let's instead rely on the core to save the OCR in card->ocr during initialization. Reported-by: H. Nikolaus Schaller Signed-off-by: Ulf Hansson Signed-off-by: H. Nikolaus Schaller Link: https://lore.kernel.org/r/e7936cff7fc24d187ef2680d3b4edb0ade58f293.1636564631.git.hns@goldelico.com Signed-off-by: Ulf Hansson commit 818cd40529d9f19aa7ca3794f73477b5ac3ef350 Author: H. Nikolaus Schaller Date: Wed Nov 10 18:17:08 2021 +0100 mmc: core: provide macro and table to match the device tree to apply quirks This (initially empty) table allows to match quirks early based on .compatible of the child node of some mmc/sdio interface. This allows to add quirks based on device tree instead of having card specific code in the host ops. A new macro SDIO_FIXUP_COMPATIBLE makes the definition readable. And we call mmc_fixup_device(sdio_card_init_methods) just after where host->ops->init_card() can be optionally called. Signed-off-by: H. Nikolaus Schaller Link: https://lore.kernel.org/r/b13fd8b3eebc3c23b6816b254a518c224cbdcfd4.1636564631.git.hns@goldelico.com Signed-off-by: Ulf Hansson commit b360b11026705369f7ea51653f75dbe611322338 Author: Jérôme Pouiller Date: Wed Nov 10 18:17:07 2021 +0100 mmc: core: allow to match the device tree to apply quirks MMC subsystem provides a way to apply quirks when a device match some properties (VID, PID, etc...) Unfortunately, some SDIO devices do not comply with the SDIO specification and does not provide reliable VID/PID (eg. Silabs WF200). So, the drivers for these devices rely on device tree to identify the device. This patch allows the MMC to also rely on the device tree to apply a quirk. Signed-off-by: Jérôme Pouiller Signed-off-by: H. Nikolaus Schaller Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/9e68e3d23e62a78527aabc1281f89e15200c7d09.1636564631.git.hns@goldelico.com Signed-off-by: Ulf Hansson commit f3abe2e509387907dd36886c1008445559ff4d91 Author: Jérôme Pouiller Date: Wed Nov 10 18:17:06 2021 +0100 mmc: core: rewrite mmc_fixup_device() Currently, mmc_fixup_device() is a bit difficult to read because of particularly long condition. Signed-off-by: Jérôme Pouiller Signed-off-by: H. Nikolaus Schaller Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/6515c1e8b3aa69ad273726f6e877d85c20f286ad.1636564631.git.hns@goldelico.com Signed-off-by: Ulf Hansson commit e315b1f3a170f368da5618f8a598e68880302ed1 Author: Biju Das Date: Wed Nov 3 13:26:46 2021 +0100 mmc: tmio: reinit card irqs in reset routine Refactor the code so that card detect irqs are always reenabled after a reset. This avoids doing it manually all over the code or forgetting to do this in the future. Reported-by: Wolfram Sang Signed-off-by: Biju Das [wsa: added a comment when 'native_hotplug' has to be set] Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20211103122646.64422-1-wsa+renesas@sang-engineering.com Signed-off-by: Ulf Hansson commit 570df0a51955b4741ca3a87b065ce4d7927bf325 Author: Biju Das Date: Wed Dec 8 10:40:24 2021 +0000 dt-bindings: gpu: mali-bifrost: Document RZ/G2L support The Renesas RZ/G2{L, LC} SoC (a.k.a R9A07G044) has a Bifrost Mali-G31 GPU, add a compatible string for it. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Reviewed-by: Steven Price Link: https://lore.kernel.org/r/20211208104026.421-2-biju.das.jz@bp.renesas.com Signed-off-by: Rob Herring commit e4fa9dedc5566cb20381b563026fde0158cc63ec Author: Florian Fainelli Date: Tue Dec 7 16:37:22 2021 -0800 dt-bindings: thermal: Convert Broadcom TMON to YAML Convert the Broadcom AVS TMON Device Tree binding to YAML to help with validation. Signed-off-by: Florian Fainelli Link: https://lore.kernel.org/r/20211208003727.3596577-12-f.fainelli@gmail.com Signed-off-by: Rob Herring commit 0cf5e46e531dc744b2ab3875a9c41c6d74751eb4 Author: Florian Fainelli Date: Tue Dec 7 16:37:21 2021 -0800 dt-bindings: rng: Convert iProc RNG200 to YAML Convert the Broadcom iProc RNG200 HWRNG Device Tree binding to YAML to help with validation. Signed-off-by: Florian Fainelli Link: https://lore.kernel.org/r/20211208003727.3596577-11-f.fainelli@gmail.com Signed-off-by: Rob Herring commit 539d25b21fe8ac034f259e44a1f8dc65260f6547 Author: Florian Fainelli Date: Tue Dec 7 16:37:20 2021 -0800 dt-bindings: interrupt-controller: Convert Broadcom STB L2 to YAML Convert the Broadcom STB L2 generic Level 2 interrupt controller Device Tree binding to YAML to help with validation. Signed-off-by: Florian Fainelli Link: https://lore.kernel.org/r/20211208003727.3596577-10-f.fainelli@gmail.com Signed-off-by: Rob Herring commit 4102cf163c255e4f97027b6f19a46e91693834fd Author: Florian Fainelli Date: Tue Dec 7 16:37:17 2021 -0800 dt-binding: interrupt-controller: Convert BCM7038 L1 intc to YAML Convert the Broadcom STB BCM7038 Level 1 interrupt controller Device Tree binding to YAML to help with validation. Signed-off-by: Florian Fainelli Link: https://lore.kernel.org/r/20211208003727.3596577-7-f.fainelli@gmail.com Signed-off-by: Rob Herring commit a6564a553878ae05a33f9a79a6ef95bbfd8cd21c Author: Florian Fainelli Date: Tue Dec 7 16:37:16 2021 -0800 dt-bindings: gpio: Convert Broadcom STB GPIO to YAML Convert the Broadcom STB GPIO Device Tree binding to YAML to help with validation. Acked-by: Gregory Fong Signed-off-by: Florian Fainelli Acked-by: Bartosz Golaszewski Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20211208003727.3596577-6-f.fainelli@gmail.com Signed-off-by: Rob Herring commit 7c41161b51f63590831f9ac127b8c1e2106eee9f Author: Florian Fainelli Date: Tue Dec 7 16:37:15 2021 -0800 dt-bindings: rtc: Convert Broadcom STB waketimer to YAML Convert the Broadcom STB waketimer Device Tree binding to YAML to help with validation. Signed-off-by: Florian Fainelli Link: https://lore.kernel.org/r/20211208003727.3596577-5-f.fainelli@gmail.com Signed-off-by: Rob Herring commit de9afac8ff1967b1b88843ed311c811cbea33a26 Author: Florian Fainelli Date: Tue Dec 7 16:37:14 2021 -0800 dt-bindings: pwm: Convert BCM7038 PWM binding to YAML Convert the Broadcom STB BCM7038 PWM Device Tree binding to YAML to help with validation. Acked-by: Uwe Kleine-König Signed-off-by: Florian Fainelli Link: https://lore.kernel.org/r/20211208003727.3596577-4-f.fainelli@gmail.com Signed-off-by: Rob Herring commit fa4d279061371d7e10b008ebfce1ce7e44cfbafe Author: Florian Fainelli Date: Tue Dec 7 16:37:13 2021 -0800 dt-bindings: reset: Convert Broadcom STB reset to YAML Convert the Broadcom STB SW_INIT style reset controller binding to YAML. Signed-off-by: Florian Fainelli Acked-by: Philipp Zabel Link: https://lore.kernel.org/r/20211208003727.3596577-3-f.fainelli@gmail.com Signed-off-by: Rob Herring commit 905b986d099ccba4bda7e1814419dff0e2d01a00 Author: Florian Fainelli Date: Mon Dec 13 19:58:20 2021 -0800 dt-bindings: pci: Convert iProc PCIe to YAML Conver the iProc PCIe controller Device Tree binding to YAML now that all DTS in arch/arm and arch/arm64 have been fixed to be compliant. Signed-off-by: Florian Fainelli Link: https://lore.kernel.org/r/20211214035820.2984289-7-f.fainelli@gmail.com Signed-off-by: Rob Herring commit 8dbb528b888b73483abb2355907b128265fb1f71 Author: Florian Fainelli Date: Mon Dec 13 19:58:19 2021 -0800 dt-bindings: phy: Convert Cygnus PCIe PHY to YAML Convert the Broadcom Cygnus PCIe PHY Device Tree binding t YAML to help with validation. Signed-off-by: Florian Fainelli Link: https://lore.kernel.org/r/20211214035820.2984289-6-f.fainelli@gmail.com Signed-off-by: Rob Herring commit 1815775e74541d7b498c0baf15726ad3d1247abf Author: Wei Yang Date: Tue Dec 14 00:46:07 2021 +0000 cgroup: return early if it is already on preloaded list If a cset is already on preloaded list, this means we have already setup this cset properly for migration. This patch just relocates the root cgrp lookup which isn't used anyway when the cset is already on the preloaded list. [tj@kernel.org: rephrase the commit log] Signed-off-by: Wei Yang Signed-off-by: Tejun Heo commit 7377e853967ba45bf409e3b5536624d2cbc99f21 Author: Hyeong-Jun Kim Date: Fri Dec 10 13:30:12 2021 +0900 f2fs: compress: fix potential deadlock of compress file There is a potential deadlock between writeback process and a process performing write_begin() or write_cache_pages() while trying to write same compress file, but not compressable, as below: [Process A] - doing checkpoint [Process B] [Process C] f2fs_write_cache_pages() - lock_page() [all pages in cluster, 0-31] - f2fs_write_multi_pages() - f2fs_write_raw_pages() - f2fs_write_single_data_page() - f2fs_do_write_data_page() - return -EAGAIN [f2fs_trylock_op() failed] - unlock_page(page) [e.g., page 0] - generic_perform_write() - f2fs_write_begin() - f2fs_prepare_compress_overwrite() - prepare_compress_overwrite() - lock_page() [e.g., page 0] - lock_page() [e.g., page 1] - lock_page(page) [e.g., page 0] Since there is no compress process, it is no longer necessary to hold locks on every pages in cluster within f2fs_write_raw_pages(). This patch changes f2fs_write_raw_pages() to release all locks first and then perform write same as the non-compress file in f2fs_write_cache_pages(). Fixes: 4c8ff7095bef ("f2fs: support data compression") Signed-off-by: Hyeong-Jun Kim Signed-off-by: Sungjong Seo Signed-off-by: Youngjin Gil Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 19bdba5265624ba6b9d9dd936a0c6ccc167cfe80 Author: Jaegeuk Kim Date: Thu Dec 9 10:25:43 2021 -0800 f2fs: avoid EINVAL by SBI_NEED_FSCK when pinning a file Android OTA failed due to SBI_NEED_FSCK flag when pinning the file. Let's avoid it since we can do in-place-updates. Cc: stable@vger.kernel.org Signed-off-by: Jaegeuk Kim commit f2cefc0c2d2a0baf5be40388371c289c41db01b9 Author: Yanteng Si Date: Thu Dec 9 17:19:22 2021 +0800 docs/arm64: delete a space from tagged-address-abi Since e71e2ace5721("userfaultfd: do not untag user pointers") which introduced a warning: linux/Documentation/arm64/tagged-address-abi.rst:52: WARNING: Unexpected indentation. Let's fix it. Signed-off-by: Yanteng Si Link: https://lore.kernel.org/r/20211209091922.560979-1-siyanteng@loongson.cn Signed-off-by: Catalin Marinas commit dd03762ab608e058c8f390ad9cf667e490089796 Author: Kefeng Wang Date: Sat Dec 11 21:17:34 2021 +0800 arm64: Enable KCSAN This patch enables KCSAN for arm64, with updates to build rules to not use KCSAN for several incompatible compilation units. Recent GCC version(at least GCC10) made outline-atomics as the default option(unlike Clang), which will cause linker errors for kernel/kcsan/core.o. Disables the out-of-line atomics by no-outline-atomics to fix the linker errors. Meanwhile, as Mark said[1], some latent issues are needed to be fixed which isn't just a KCSAN problem, we make the KCSAN depends on EXPERT for now. Tested selftest and kcsan_test(built with GCC11 and Clang 13), and all passed. [1] https://lkml.kernel.org/r/YadiUPpJ0gADbiHQ@FVFF77S0Q05N Acked-by: Marco Elver # kernel/kcsan Tested-by: Joey Gouly Signed-off-by: Kefeng Wang Link: https://lore.kernel.org/r/20211211131734.126874-1-wangkefeng.wang@huawei.com [catalin.marinas@arm.com: added comment to justify EXPERT] Signed-off-by: Catalin Marinas commit 09ed8bfc5215ad5aac91c50008277b5586b9ef24 Author: David Mosberger-Tang Date: Thu Dec 9 04:44:30 2021 +0000 wilc1000: Rename workqueue from "WILC_wq" to "NETDEV-wq" This follows normal Linux convention and is more useful since the new name will make it apparent which network device the work-queue is for (e.g., the name will be "wlan0-wq" for network device "wlan0"). hif_workqueue allocation has to move from cfg80211.c:wilc_cfg80211_init() to netdev.c:wilc_netdev_ifc_init() because the network device name is not known until after the netdev is registered. The move also makes sense because netdev.c is already responsible for destroying the work queue when it is no longer needed. Signed-off-by: David Mosberger-Tang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211209044411.3482259-5-davidm@egauge.net commit 3cc23932ba2a9aaa8c62d1a9ecb1fe7c296f9f32 Author: David Mosberger-Tang Date: Thu Dec 9 04:44:28 2021 +0000 wilc1000: Rename tx task from "K_TXQ_TASK" to NETDEV-tx This follows normal Linux conventions and is also more useful because the netdevice name is part of the task name (e.g., "wlan0-tx" for network device "wlan0"). Signed-off-by: David Mosberger-Tang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211209044411.3482259-4-davidm@egauge.net commit 30e08bc0a94c19132368abc35f394d2aa69bf984 Author: David Mosberger-Tang Date: Thu Dec 9 04:44:28 2021 +0000 wilc1000: Rename irq handler from "WILC_IRQ" to netdev name This change follows normal Linux convention and the new name is more useful since it'll be clear which irq handler statistics correspond to which net device. Signed-off-by: David Mosberger-Tang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211209044411.3482259-3-davidm@egauge.net commit 4347d34e6a7699cb61a8bc19b86e460d6b67e5fb Author: David Mosberger-Tang Date: Thu Dec 9 04:44:27 2021 +0000 wilc1000: Rename SPI driver from "WILC_SPI" to "wilc1000_spi" The name "wilc1000_spi" follows normal Linux conventions and also is analogous to the SDIO driver, which uses "wilc1000_sdio". Signed-off-by: David Mosberger-Tang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211209044411.3482259-2-davidm@egauge.net commit 73bbef64bca781bbfa1abe07eb86b733c5b4f7da Author: David Mosberger-Tang Date: Wed Dec 8 06:27:55 2021 +0000 wilc1000: Fix spurious "FW not responding" error When deinitializing the driver, one or more "FW not responding" error appears on the console. This appears to be due to wilc_wlan_stop() disabling host/WILC1000 communication, but then right afterwards, it tries to release the bus with chip-sleep enabled. The problem is enabling the chip-sleep cannot success once host/WILC1000 communication is disabled. Fix by only releasing the bus. Signed-off-by: David Mosberger-Tang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211208062747.3405221-1-davidm@egauge.net commit dde02213fa64ac7f99eb65cd51f9e04812d8bc40 Author: David Mosberger-Tang Date: Tue Dec 7 00:26:01 2021 +0000 wilc1000: Remove misleading USE_SPI_DMA macro The USE_SPI_DMA macro name suggests that it could be set to 1 to control whether or not SPI DMA should be used. However, that's not what it does. If set to 1, it'll set the SPI messages' "is_dma_mapped" flag to true, even though the tx/rx buffers aren't actually DMA mapped by the driver. In other words, setting this flag to 1 will break the driver. Best to clean up this confusion by removing the macro altogether. There is no need to explicitly initialize "is_dma_mapped" because the message is cleared to zero anyhow, so "is_dma_mapped" is set to false by default. Signed-off-by: David Mosberger-Tang Acked-by: Ajay Singh Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211207002453.3193737-1-davidm@egauge.net commit 5ae660641db824ecc9c7a49546dff701c6dc7ca7 Author: David Mosberger-Tang Date: Mon Dec 6 23:27:36 2021 +0000 wilc1000: Fix missing newline in error message Add missing newline in pr_err() message. Signed-off-by: David Mosberger-Tang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211206232709.3192856-3-davidm@egauge.net commit f92b9f96746379eb9ea5fafab1806739a5ada7da Author: David Mosberger-Tang Date: Mon Dec 6 23:27:29 2021 +0000 wilc1000: Fix copy-and-paste typo in wilc_set_mac_address The messages appears to have been copied from wilc_get_mac_address and says "get" when it should say "set". Signed-off-by: David Mosberger-Tang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211206232709.3192856-2-davidm@egauge.net commit 2c94ebedc844d64459bfe73b25ae725c3f040526 Author: Mark Brown Date: Thu Dec 2 16:51:07 2021 +0000 kselftest/arm64: Add pidbench for floating point syscall cases Since it's likely to be useful for performance work with SVE let's have a pidbench that gives us some numbers for consideration. In order to ensure that we test exactly the scenario we want this is written in assembly - if system libraries use SVE this would stop us exercising the case where the process has never used SVE. We exercise three cases: - Never having used SVE. - Having used SVE once. - Using SVE after each syscall. by spinning running getpid() for a fixed number of iterations with the time measured using CNTVCT_EL0 reported on the console. This is obviously a totally unrealistic benchmark which will show the extremes of any performance variation but equally given the potential gotchas with use of FP instructions by system libraries it's good to have some concrete code shared to make it easier to compare notes on results. Testing over multiple SVE vector lengths will need to be done with vlset currently, the test could be extended to iterate over all of them if desired. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20211202165107.1075259-1-broonie@kernel.org Signed-off-by: Catalin Marinas commit 12b792e5e2344772434ea817572bedde8ad9c172 Author: Mark Brown Date: Tue Dec 7 16:32:50 2021 +0000 arm64/fp: Add comments documenting the usage of state restore functions Add comments to help people figure out when fpsimd_bind_state_to_cpu() and fpsimd_update_current_state() are used. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20211207163250.1373542-1-broonie@kernel.org Signed-off-by: Catalin Marinas commit 4c02043c5a5270c5b6e11ca1c695ac17043a3e88 Author: Ching-Te Ku Date: Thu Dec 9 16:32:29 2021 +0800 rtw89: coex: Update COEX to 5.5.8 Update COEX version. Signed-off-by: Ching-Te Ku Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211209083229.10815-8-pkshih@realtek.com commit bd309c8b4965b67917d8828c97d1b6741377cb8e Author: Ching-Te Ku Date: Thu Dec 9 16:32:28 2021 +0800 rtw89: coex: Cancel PS leaving while C2H comes It's unnecessary to leave WL PS while C2H comes. Signed-off-by: Ching-Te Ku Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211209083229.10815-7-pkshih@realtek.com commit eb87d79911c65ab8973ee8292802f0da6b7c67a4 Author: Ching-Te Ku Date: Thu Dec 9 16:32:27 2021 +0800 rtw89: coex: Update BT counters while receiving report Move _chk_btc_err and update_bt_cnt to _chk_btc_report(), so we can update counter/info to COEX at a proper moment, instead of relying on a user does cat the debug info periodically. Signed-off-by: Ching-Te Ku Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211209083229.10815-6-pkshih@realtek.com commit 2200ff3f0d1df9f41d0a5589e4a9572b4f627796 Author: Ching-Te Ku Date: Thu Dec 9 16:32:26 2021 +0800 rtw89: coex: Define LPS state for BTC using To distinguish three types of LPS state. Signed-off-by: Ching-Te Ku Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211209083229.10815-5-pkshih@realtek.com commit 8c7e9ceb5bacec842784e5568c36769e97d96acb Author: Ching-Te Ku Date: Thu Dec 9 16:32:25 2021 +0800 rtw89: coex: Add MAC API to get BT polluted counter Add function to get and parse BT polluted counter. When WLAN Tx was dropped by BT, the packet will be marked as BT polluted. Signed-off-by: Ching-Te Ku Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211209083229.10815-4-pkshih@realtek.com commit f8028a9a92f2b8653658f2ad9cc1fb849873ba5a Author: Ching-Te Ku Date: Thu Dec 9 16:32:24 2021 +0800 rtw89: coex: Not to send H2C when WL not ready and count H2C Prevent to send H2C request to FW when BTC is not initialized or WL is under power saving. Add counter to count the H2C success or fail. Signed-off-by: Ching-Te Ku Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211209083229.10815-3-pkshih@realtek.com commit b3131a41ac6fcda0a636b3c7d1e05914107d8840 Author: Ching-Te Ku Date: Thu Dec 9 16:32:23 2021 +0800 rtw89: coex: correct C2H header length To resolve C2H handle length mismatch, or it will parse the c2h content out of array. Signed-off-by: Ching-Te Ku Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211209083229.10815-2-pkshih@realtek.com commit b77e995e3b9638e759d482e93deba1fa0760cb26 Author: Mark Brown Date: Fri Dec 10 18:41:02 2021 +0000 kselftest/arm64: Add a test program to exercise the syscall ABI Currently we don't have any coverage of the syscall ABI so let's add a very dumb test program which sets up register patterns, does a sysscall and then checks that the register state after the syscall matches what we expect. The program is written in an extremely simplistic fashion with the goal of making it easy to verify that it's doing what it thinks it's doing, it is not a model of how one should write actual code. Currently we validate the general purpose, FPSIMD and SVE registers. There are other thing things that could be covered like FPCR and flags registers, these can be covered incrementally - my main focus at the minute is covering the ABI for the SVE registers. The program repeats the tests for all possible SVE vector lengths in case some vector length specific optimisation causes issues, as well as testing FPSIMD only. It tries two syscalls, getpid() and sched_yield(), in an effort to cover both immediate return to userspace and scheduling another task though there are no guarantees which cases will be hit. A new test directory "abi" is added to hold the test, it doesn't seem to fit well into any of the existing directories. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20211210184133.320748-7-broonie@kernel.org Signed-off-by: Catalin Marinas commit 9331a604858a0f399ef8f886a88dd94927f136aa Author: Mark Brown Date: Fri Dec 10 18:41:01 2021 +0000 kselftest/arm64: Allow signal tests to trigger from a function Currently we have the facility to specify custom code to trigger a signal but none of the tests use it and for some reason the framework requires us to also specify a signal to send as a trigger in order to make use of a custom trigger. This doesn't seem to make much sense, instead allow the use of a custom trigger function without specifying a signal to inject. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20211210184133.320748-6-broonie@kernel.org Signed-off-by: Catalin Marinas commit 18edbb6b3259332b577c2b92b6b4d8dfd86ff00e Author: Mark Brown Date: Fri Dec 10 18:41:00 2021 +0000 kselftest/arm64: Parameterise ptrace vector length information SME introduces a new mode called streaming mode in which the SVE registers have a different vector length. Since the ptrace interface for this is based on the existing SVE interface prepare for supporting this by moving the regset specific configuration into struct and passing that around, allowing these tests to be reused for streaming mode. As we will also have to verify the interoperation of the SVE and streaming SVE regsets don't just iterate over an array. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20211210184133.320748-5-broonie@kernel.org Signed-off-by: Catalin Marinas commit aed34d9e52b80b4e7485119272c77c5553a21499 Author: Mark Brown Date: Fri Dec 10 18:40:59 2021 +0000 arm64/sve: Minor clarification of ABI documentation As suggested by Luis for the SME version of this explicitly say that the vector length should be extracted from the return value of a set vector length prctl() with a bitwise and rather than just any old and. Suggested-by: Luis Machado Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20211210184133.320748-4-broonie@kernel.org Signed-off-by: Catalin Marinas commit 30c43e73b3fa2d75f5d4e72fea345380ba5eb21b Author: Mark Brown Date: Fri Dec 10 18:40:58 2021 +0000 arm64/sve: Generalise vector length configuration prctl() for SME In preparation for adding SME support update the bulk of the implementation for the vector length configuration prctl() calls to be independent of vector type. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20211210184133.320748-3-broonie@kernel.org Signed-off-by: Catalin Marinas commit 97bcbee404e386195614b58e98ab2e7eddd89a5c Author: Mark Brown Date: Fri Dec 10 18:40:57 2021 +0000 arm64/sve: Make sysctl interface for SVE reusable by SME The vector length configuration for SME is very similar to that for SVE so in order to allow reuse refactor the SVE configuration so that it takes the vector type from the struct ctl_table. Since there's no dedicated space for this we repurpose the extra1 field to store the vector type, this is otherwise unused for integer sysctls. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20211210184133.320748-2-broonie@kernel.org Signed-off-by: Catalin Marinas commit 9c33eef84e3110963d6f41d87d63bc40d716eb1f Merge: f872f73601b92 764cedc5638b0 Author: Rafael J. Wysocki Date: Tue Dec 14 19:31:13 2021 +0100 Merge back int340x driver material for 5.17. commit f8a3bcceb4224494ac4fa2b7e9428ac1bbdd6d52 Author: Tony Nguyen Date: Wed Nov 17 15:55:05 2021 -0800 ice: Remove unused ICE_FLOW_SEG_HDRS_L2_MASK Remove the unused define ICE_FLOW_SEG_HDRS_L2_MASK. Reported-by: Jesse Brandeburg Signed-off-by: Tony Nguyen Acked-by: Paul Menzel Tested-by: Gurucharan G commit e53a80835f1ba0ef8d8d7c7a0c77e0d51786dcd8 Author: Dan Carpenter Date: Wed Nov 10 10:50:23 2021 +0300 ice: Remove unnecessary casts The "bitmap" variable is already an unsigned long so there is no need for this cast. Signed-off-by: Dan Carpenter Tested-by: Gurucharan G Signed-off-by: Tony Nguyen commit c14846914ed6b575752417cf04bc145be15236c1 Author: Tony Nguyen Date: Thu Oct 7 16:01:58 2021 -0700 ice: Propagate error codes As all functions now return standard error codes, propagate the values being returned instead of converting them to generic values. Signed-off-by: Tony Nguyen Tested-by: Gurucharan G commit 2ccc1c1ccc671b8bb33ad7845dcf6c75d3c892ae Author: Tony Nguyen Date: Thu Oct 7 16:00:23 2021 -0700 ice: Remove excess error variables ice_status previously had a variable to contain these values where other error codes had a variable as well. With ice_status now being an int, there is no need for two variables to hold error values. In cases where this occurs, remove one of the excess variables and use a single one. Some initialization of variables are no longer needed and have been removed. Signed-off-by: Tony Nguyen Tested-by: Gurucharan G commit 5518ac2a64423f226e922b6719cf0eb62c31e141 Author: Tony Nguyen Date: Thu Oct 7 15:59:03 2021 -0700 ice: Cleanup after ice_status removal Clean up code after changing ice_status to int. Rearrange to fix reverse Christmas tree and pull lines up where applicable. Signed-off-by: Tony Nguyen Tested-by: Gurucharan G commit d54699e27d506fcf6a27b336c5d8510d9701c86b Author: Tony Nguyen Date: Thu Oct 7 15:58:01 2021 -0700 ice: Remove enum ice_status Replace uses of ice_status to, as equivalent as possible, error codes. Remove enum ice_status and its helper conversion function as they are no longer needed. Signed-off-by: Tony Nguyen Tested-by: Gurucharan G commit 5e24d5984c805c644de8bf5217a820e22e28318c Author: Tony Nguyen Date: Thu Oct 7 15:56:57 2021 -0700 ice: Use int for ice_status To prepare for removal of ice_status, change the variables from ice_status to int. This eases the transition when values are changed to return standard int error codes over enum ice_status. Signed-off-by: Tony Nguyen Tested-by: Gurucharan G commit 5f87ec4861aa1b8458da0dfd730abbd0bdb2f5f9 Author: Tony Nguyen Date: Thu Oct 7 15:56:02 2021 -0700 ice: Remove string printing for ice_status Remove the ice_stat_str() function which prints the string representation of the ice_status error code. With upcoming changes moving away from ice_status, there will be no need for this function. Signed-off-by: Tony Nguyen Tested-by: Gurucharan G commit 247dd97d713c73b16e87db238964625ffdbb8d02 Author: Wojciech Drewek Date: Thu Oct 7 15:54:37 2021 -0700 ice: Refactor status flow for DDP load Before this change, final state of the DDP pkg load process was dependent on many variables such as: ice_status, pkg version, ice_aq_err. The last one had be stored in hw->pkg_dwnld_status. It was impossible to conclude this state just from ice_status, that's why logging process of DDP pkg load in the caller was a little bit complicated. With this patch new status enum is introduced - ice_ddp_state. It covers all the possible final states of the loading process. What's tricky for ice_ddp_state is that not only ICE_DDP_PKG_SUCCESS(=0) means that load was successful. Actually three states mean that: - ICE_DDP_PKG_SUCCESS - ICE_DDP_PKG_SAME_VERSION_ALREADY_LOADED - ICE_DDP_PKG_COMPATIBLE_ALREADY_LOADED ice_is_init_pkg_successful can tell that information. One ddp_state should not be used outside of ice_init_pkg which is ICE_DDP_PKG_ALREADY_LOADED. It is more generic, it is used in ice_dwnld_cfg_bufs to see if pkg is already loaded. At this point we can't use one of the specific one (SAME_VERSION, COMPATIBLE, NOT_SUPPORTED) because we don't have information on the package currently loaded in HW (we are before calling ice_get_pkg_info). We can get rid of hw->pkg_dwnld_status because we are immediately mapping aq errors to ice_ddp_state in ice_dwnld_cfg_bufs. Other errors like ICE_ERR_NO_MEMORY, ICE_ERR_PARAM are mapped the generic ICE_DDP_PKG_ERR. Suggested-by: Jacob Keller Signed-off-by: Wojciech Drewek Tested-by: Tony Brelinski Signed-off-by: Tony Nguyen commit fabf480bf95d71c9cfe8a8d6307e0035df963a6a Author: Brett Creeley Date: Tue Mar 2 10:15:34 2021 -0800 ice: Refactor promiscuous functions Some of the promiscuous mode functions take a boolean to indicate set/clear, which affects readability. Refactor and provide an interface for the promiscuous mode code with explicit set and clear promiscuous mode operations. Signed-off-by: Brett Creeley Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit 1609c22a8a095d0affed072e345704df5a94f0b0 Merge: 8bd09b41b82f6 893c34b60a59c Author: Will Deacon Date: Tue Dec 14 18:13:25 2021 +0000 Merge branch 'for-next/perf-cpu' into for-next/perf * for-next/perf-cpu: arm64: perf: Support new DT compatibles arm64: perf: Simplify registration boilerplate arm64: perf: Support Denver and Carmel PMUs commit 742a15b1a23aa43bde2d9d681281ec1925be13fd Author: Mark Brown Date: Tue Dec 14 15:27:14 2021 +0000 arm64: Use BTI C directly and unconditionally Now we have a macro for BTI C that looks like a regular instruction change all the users of the current BTI_C macro to just emit a BTI C directly and remove the macro. This does mean that we now unconditionally BTI annotate all assembly functions, meaning that they are worse in this respect than code generated by the compiler. The overhead should be minimal for implementations with a reasonable HINT implementation. Signed-off-by: Mark Brown Reviewed-by: Ard Biesheuvel Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20211214152714.2380849-4-broonie@kernel.org Signed-off-by: Catalin Marinas commit 481ee45ce9e078715b4ca50fcaea518e3aee1aa7 Author: Mark Brown Date: Tue Dec 14 15:27:13 2021 +0000 arm64: Unconditionally override SYM_FUNC macros Currently we only override the SYM_FUNC macros when we need to insert BTI C into them, do this unconditionally to make it more likely that we'll notice bugs in our override. Suggested-by: Mark Rutland Acked-by: Ard Biesheuvel Signed-off-by: Mark Brown Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20211214152714.2380849-3-broonie@kernel.org Signed-off-by: Catalin Marinas commit 9be34be87cc8d1afe3c3bc2e645b4dee512d9eda Author: Mark Brown Date: Tue Dec 14 15:27:12 2021 +0000 arm64: Add macro version of the BTI instruction BTI is only available from v8.5 so we need to encode it using HINT in generic code and for older toolchains. Add an assembler macro based on one written by Mark Rutland which lets us use the mnemonic and update the existing users. Suggested-by: Mark Rutland Acked-by: Ard Biesheuvel Acked-by: Will Deacon Signed-off-by: Mark Brown Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20211214152714.2380849-2-broonie@kernel.org Signed-off-by: Catalin Marinas commit 580b536b504fb13bea6e19e399e207e7253ca30a Merge: d58071a8a76d7 35b6b28e69985 Author: Catalin Marinas Date: Tue Dec 14 18:11:52 2021 +0000 Merge 'arm64/for-next/fixes' into for-next/bti Needed for the arch/arm64/kernel/entry-ftrace.S fix. * commit 'arm64/for-next/fixes^^': arm64: ftrace: add missing BTIs arm64: kexec: use __pa_symbol(empty_zero_page) arm64: update PAC description for kernel commit 893c34b60a59cd0bdb496084f5c096be720bd244 Author: Robin Murphy Date: Tue Dec 14 14:16:15 2021 +0000 arm64: perf: Support new DT compatibles Wire up the new DT compatibles so we can present appropriate PMU names to userspace for the latest and greatest CPUs. Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/62d14ba12d847ec7f1fba7cb0b3b881b437e1cc5.1639490264.git.robin.murphy@arm.com Signed-off-by: Will Deacon commit 6ac9f30bd43baf9e05696e9a614fcd7e83c74afa Author: Robin Murphy Date: Tue Dec 14 14:16:14 2021 +0000 arm64: perf: Simplify registration boilerplate With the trend for per-core events moving to userspace JSON, registering names for PMUv3 implementations is increasingly a pure boilerplate exercise. Let's wrap things a step further so we can generate the basic PMUv3 init function with a macro invocation, and reduce further new addition to just 2 lines each. Suggested-by: Mark Rutland Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/b79477ea3b97f685d00511d4ecd2f686184dca34.1639490264.git.robin.murphy@arm.com Signed-off-by: Will Deacon commit d4c4844a9b47dc1c7e8ccce0cdd899602f5479fd Author: Thierry Reding Date: Tue Dec 14 14:16:13 2021 +0000 arm64: perf: Support Denver and Carmel PMUs Add support for the NVIDIA Denver and Carmel PMUs using the generic PMUv3 event map for now. Acked-by: Mark Rutland Signed-off-by: Thierry Reding [ rm: reorder entries alphabetically ] Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/5f0f69d47acca78a9e479501aa4d8b429e23cf11.1639490264.git.robin.murphy@arm.com Signed-off-by: Will Deacon commit 5eb6f22823e023ee13391978c329c4bd18f82552 Author: Eric W. Biederman Date: Tue Dec 14 11:25:01 2021 -0600 exit/kthread: Fix the kerneldoc comment for kthread_complete_and_exit I misspelled kthread_complete_and_exit in the kernel doc comment fix it. Link: https://lkml.kernel.org/r/202112141329.KBkyJ5ql-lkp@intel.com Link: https://lkml.kernel.org/r/202112141422.Cykr6YUS-lkp@intel.com Reported-by: kernel test robot Fixes: cead18552660 ("exit: Rename complete_and_exit to kthread_complete_and_exit") Signed-off-by: "Eric W. Biederman" commit 0aeddbd0cb078116c19b8ca511cc1882b581671b Author: Vaibhav Gupta Date: Tue Jan 12 13:39:24 2021 +0530 via-agp: convert to generic power management Convert via-agp from legacy PCI power management to the generic power management framework. Previously, via-agp used legacy PCI power management, and agp_via_suspend() and agp_via_resume() were responsible for both device-specific things and generic PCI things: agp_via_suspend pci_save_state(pdev) <-- generic PCI pci_set_power_state(pdev, pci_choose_state(pdev, state)) <-- generic PCI agp_via_resume pci_set_power_state(pdev, PCI_D0) <-- generic PCI pci_restore_state(pdev) <-- generic PCI via_configure_agp3() <-- device-specific via_configure() <-- device-specific With generic power management, the PCI bus PM methods do the generic PCI things, and the driver needs only the device-specific part, i.e., suspend_devices_and_enter dpm_suspend_start(PMSG_SUSPEND) pci_pm_suspend # PCI bus .suspend() method agp_via_suspend <-- not needed at all; removed suspend_enter dpm_suspend_noirq(PMSG_SUSPEND) pci_pm_suspend_noirq # PCI bus .suspend_noirq() method pci_save_state <-- generic PCI pci_prepare_to_sleep <-- generic PCI pci_set_power_state ... dpm_resume_end(PMSG_RESUME) pci_pm_resume # PCI bus .resume() method pci_restore_standard_config pci_set_power_state(PCI_D0) <-- generic PCI pci_restore_state <-- generic PCI agp_via_resume # dev->driver->pm->resume via_configure_agp3() <-- device-specific via_configure() <-- device-specific [bhelgaas: commit log] Link: https://lore.kernel.org/r/20211208193305.147072-4-helgaas@kernel.org Signed-off-by: Vaibhav Gupta Signed-off-by: Bjorn Helgaas Acked-by: Dave Airlie commit 6d1adc3d46a785cdb3cb0352ec9ad6fee5bb892b Author: Vaibhav Gupta Date: Tue Jan 12 13:39:23 2021 +0530 sis-agp: convert to generic power management Convert sis-agp from legacy PCI power management to the generic power management framework. Previously, sis-agp used legacy PCI power management, and agp_sis_suspend() and agp_sis_resume() were responsible for both device-specific things and generic PCI things: agp_sis_suspend pci_save_state(pdev) <-- generic PCI pci_set_power_state(pdev, pci_choose_state(pdev, state)) <-- generic PCI agp_sis_resume pci_set_power_state(pdev, PCI_D0) <-- generic PCI pci_restore_state(pdev) <-- generic PCI sis_driver.configure() <-- device-specific With generic power management, the PCI bus PM methods do the generic PCI things, and the driver needs only the device-specific part, i.e., suspend_devices_and_enter dpm_suspend_start(PMSG_SUSPEND) pci_pm_suspend # PCI bus .suspend() method agp_sis_suspend <-- not needed at all; removed suspend_enter dpm_suspend_noirq(PMSG_SUSPEND) pci_pm_suspend_noirq # PCI bus .suspend_noirq() method pci_save_state <-- generic PCI pci_prepare_to_sleep <-- generic PCI pci_set_power_state ... dpm_resume_end(PMSG_RESUME) pci_pm_resume # PCI bus .resume() method pci_restore_standard_config pci_set_power_state(PCI_D0) <-- generic PCI pci_restore_state <-- generic PCI agp_sis_resume # dev->driver->pm->resume sis_driver.configure() <-- device-specific [bhelgaas: commit log] Link: https://lore.kernel.org/r/20211208193305.147072-3-helgaas@kernel.org Signed-off-by: Vaibhav Gupta Signed-off-by: Bjorn Helgaas Acked-by: Dave Airlie commit ec4e4a6fdc51f11eaa7a919e3e2a5f5a65532a6c Author: Vaibhav Gupta Date: Tue Jan 12 13:39:22 2021 +0530 amd64-agp: convert to generic power management Convert amd64-agp from legacy PCI power management to the generic power management framework. Previously, amd64-agp used legacy PCI power management, and agp_amd64_suspend() and agp_amd64_resume() were responsible for both device-specific things and generic PCI things: agp_amd64_suspend pci_save_state(pdev) <-- generic PCI pci_set_power_state(pdev, pci_choose_state(pdev, state)) <-- generic PCI agp_amd64_resume pci_set_power_state(pdev, PCI_D0) <-- generic PCI pci_restore_state(pdev) <-- generic PCI nforce3_agp_init() <-- device-specific amd_8151_configure() <-- device-specific With generic power management, the PCI bus PM methods do the generic PCI things, and the driver needs only the device-specific part, i.e., suspend_devices_and_enter dpm_suspend_start(PMSG_SUSPEND) pci_pm_suspend # PCI bus .suspend() method agp_amd64_suspend <-- not needed at all; removed suspend_enter dpm_suspend_noirq(PMSG_SUSPEND) pci_pm_suspend_noirq # PCI bus .suspend_noirq() method pci_save_state <-- generic PCI pci_prepare_to_sleep <-- generic PCI pci_set_power_state ... dpm_resume_end(PMSG_RESUME) pci_pm_resume # PCI bus .resume() method pci_restore_standard_config pci_set_power_state(PCI_D0) <-- generic PCI pci_restore_state <-- generic PCI agp_amd64_resume # dev->driver->pm->resume nforce3_agp_init() <-- device-specific amd_8151_configure() <-- device-specific [bhelgaas: commit log] Link: https://lore.kernel.org/r/20211208193305.147072-2-helgaas@kernel.org Signed-off-by: Vaibhav Gupta Signed-off-by: Bjorn Helgaas Acked-by: Dave Airlie commit 59716aa3f9764144cdd558c64f04cb83001b71ac Author: Miaoqian Lin Date: Sat Dec 11 06:58:29 2021 +0000 ASoC: qdsp6: Fix an IS_ERR() vs NULL bug The function gpr_alloc_port return ERR_PTR on errors, it doesn't return null. Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20211211065840.1221-1-linmq006@gmail.com Signed-off-by: Mark Brown commit 833a94aac572d7f0fe3f51329e0eb9f2884cf665 Author: Judy Hsiao Date: Tue Dec 14 10:25:09 2021 +0800 ASoC: qcom: Distinguish headset codec by codec_dai->name Distinguish which headset codec is on the board by codec_dai->name instead of card->name. It fixes the crash of being unable to handle kernel paging requests at virtual address ADDR by initializing the correct audio codec on the board. Call stack of the crash: ``` Unable to handle kernel paging request at virtual address ... ... Call trace: rt5682_set_component_pll+0xcc/0xb78 [snd_soc_rt5682] snd_soc_component_set_pll+0x90/0x154 snd_soc_dai_set_pll+0xf4/0x1ac sc7180_snd_startup+0x268/0x3c0 [snd_soc_sc7180] snd_soc_link_startup+0xa4/0x180 soc_pcm_open+0x35c/0x15c8 snd_pcm_open_substream+0xa90/0x13b0 snd_pcm_open+0x1a4/0x55c snd_pcm_capture_open+0x7c/0xe8 snd_open+0x2b8/0x2e4 chrdev_open+0x364/0x3d4 do_dentry_open+0x66c/0xc58 vfs_open+0x7c/0x8c path_openat+0x108c/0x2bbc do_filp_open+0x15c/0x258 do_sys_open+0x278/0x62c __arm64_compat_sys_openat+0x9c/0xb0 ... ``` Fixes: 425c5fce8a03 ("ASoC: qcom: Add support for ALC5682I-VS codec") Signed-off-by: Judy Hsiao Link: https://lore.kernel.org/r/20211214022509.1288245-1-judyhsiao@chromium.org Signed-off-by: Mark Brown commit 3aa1e96a2b95e2ece198f8dd01e96818971b84df Author: Pierre-Louis Bossart Date: Tue Dec 7 11:37:45 2021 -0600 ASoC: soc-pcm: fix BE handling of PAUSE_RELEASE A BE connected to more than one FE, e.g. in a mixer case, can go through the following transitions. play FE1 -> BE state is START pause FE1 -> BE state is PAUSED play FE2 -> BE state is START stop FE2 -> BE state is STOP (see note [1] below) release FE1 -> BE state is START stop FE1 -> BE state is STOP play FE1 -> BE state is START pause FE1 -> BE state is PAUSED play FE2 -> BE state is START release FE1 -> BE state is START stop FE2 -> BE state is START stop FE1 -> BE state is STOP play FE1 -> BE state is START play FE2 -> BE state is START (no change) pause FE1 -> BE state is START (no change) pause FE2 -> BE state is PAUSED release FE1 -> BE state is START release FE2 -> BE state is START (no change) stop FE1 -> BE state is START (no change) stop FE2 -> BE state is STOP The existing code for PAUSE_RELEASE only allows for the case where the BE is paused, which clearly would not work in the sequences above. Extend the allowed states to restart the BE when PAUSE_RELEASE is received, and increase the refcount if the BE is already in START. [1] the existing logic does not move the BE state back to PAUSED when the FE2 is stopped. This patch does not change the logic; it would be painful to keep a history of changes on the FE side, the state machine is already rather complicated with transitions based on the last BE state and the trigger type. Reported-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20211207173745.15850-7-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 848aedfdc6ba25ad5652797db9266007773e44dd Author: Pierre-Louis Bossart Date: Tue Dec 7 11:37:44 2021 -0600 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 the BE PCM stream lock. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20211207173745.15850-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit b2ae80663008a7662febe7d13f14ea1b2eb0cd51 Author: Takashi Iwai Date: Tue Dec 7 11:37:43 2021 -0600 ASoC: soc-pcm: serialize BE triggers 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. This patch relies on the existing BE PCM lock, which takes atomicity into account. The locking model assumes that all interactions start with the FE, so that there is no deadlock between FE and BE locks. Signed-off-by: Takashi Iwai [test, checkpatch fix and clarification of commit message by plbossart] Signed-off-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20211207173745.15850-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit b7898396f4bbe160f546d0c5e9fa17cca9a7d153 Author: Takashi Iwai Date: Tue Dec 7 11:37:42 2021 -0600 ASoC: soc-pcm: Fix and cleanup DPCM locking The existing locking for DPCM has several issues a) a confusing mix of card->mutex and card->pcm_mutex. b) a dpcm_lock spinlock added inconsistently and on paths that could be recursively taken. The use of irqsave/irqrestore was also overkill. The suggested model is: 1) The pcm_mutex is the top-most protection of BE links in the FE. The pcm_mutex is applied always on either the top PCM callbacks or the external call from DAPM, not taken in the internal functions. 2) the FE stream lock is taken in higher levels before invoking dpcm_be_dai_trigger() 3) when adding and deleting a BE, both the pcm_mutex and FE stream lock are taken. Signed-off-by: Takashi Iwai [clarification of commit message by plbossart] Signed-off-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20211207173745.15850-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit bbf7d3b1c4f40eb02dd1dffb500ba00b0bff0303 Author: Pierre-Louis Bossart Date: Tue Dec 7 11:37:41 2021 -0600 ASoC: soc-pcm: align BE 'atomicity' with that of the FE Since the flow for DPCM is based on taking a lock for the FE first, we need to make sure during the connection between a BE and an FE that they both use the same 'atomicity', otherwise we may sleep in atomic context. If the FE is nonatomic, this patch forces the BE to be nonatomic as well. That should have no negative impact since the BE 'inherits' the FE properties. However, if the FE is atomic and the BE is not, then the configuration is flagged as invalid. Signed-off-by: Pierre-Louis Bossart [ removed FE stream lock by tiwai ] Signed-off-by: Takashi Iwai Reviewed-by: Kai Vehmanen Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20211207173745.15850-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit d8a9c6e1f6766a16cf02b4e99a629f3c5512c183 Author: Pierre-Louis Bossart Date: Tue Dec 7 11:37:40 2021 -0600 ASoC: soc-pcm: use GFP_ATOMIC for dpcm structure We allocate a structure in dpcm_be_connect(), which may be called in atomic context. Using GFP_KERNEL is not quite right, we have to use GFP_ATOMIC to prevent the allocator from sleeping. Suggested-by: Guennadi Liakhovetski Signed-off-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Reviewed-by: Bard Liao Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20211207173745.15850-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 1b9e8b1feb33d75bf942a174719a861815fa7279 Author: Matthew Auld Date: Mon Dec 13 12:55:30 2021 +0000 drm/i915/debugfs: add noreclaim annotations We have a debugfs hook to directly call into i915_gem_shrink() with the fs_reclaim acquire annotations to simulate hitting direct reclaim. However we should also annotate this with memalloc_noreclaim, which will set PF_MEMALLOC for us on the current context, to ensure we can't re-enter direct reclaim(just like "real" direct reclaim does). This is an issue now that ttm_bo_validate could potentially be called here, which might try to allocate a tiny amount of memory to hold the new ttm_resource struct, as per the below splat: [ 2507.913844] WARNING: possible recursive locking detected [ 2507.913848] 5.16.0-rc4+ #5 Tainted: G U [ 2507.913853] -------------------------------------------- [ 2507.913856] gem_exec_captur/1825 is trying to acquire lock: [ 2507.913861] ffffffffb9df2500 (fs_reclaim){..}-{0:0}, at: kmem_cache_alloc_trace+0x30/0x390 [ 2507.913875] but task is already holding lock: [ 2507.913879] ffffffffb9df2500 (fs_reclaim){..}-{0:0}, at: i915_drop_caches_set+0x1c9/0x2c0 [i915] [ 2507.913962] other info that might help us debug this: [ 2507.913966] Possible unsafe locking scenario: [ 2507.913970] CPU0 [ 2507.913973] ---- [ 2507.913975] lock(fs_reclaim); [ 2507.913979] lock(fs_reclaim); [ 2507.913983] DEADLOCK *** [ 2507.913988] May be due to missing lock nesting notation [ 2507.913992] 4 locks held by gem_exec_captur/1825: [ 2507.913997] #0: ffff888101f6e460 (sb_writers#17){..}-{0:0}, at: ksys_write+0xe9/0x1b0 [ 2507.914009] #1: ffff88812d99e2b8 (&attr->mutex){..}-{3:3}, at: simple_attr_write+0xbb/0x220 [ 2507.914019] #2: ffffffffb9df2500 (fs_reclaim){..}-{0:0}, at: i915_drop_caches_set+0x1c9/0x2c0 [i915] [ 2507.914085] #3: ffff8881b4a11b20 (reservation_ww_class_mutex){..}-{3:3}, at: ww_mutex_trylock+0x43f/0xcb0 [ 2507.914097] stack backtrace: [ 2507.914102] CPU: 0 PID: 1825 Comm: gem_exec_captur Tainted: G U 5.16.0-rc4+ #5 [ 2507.914109] Hardware name: ASUS System Product Name/PRIME B560M-A AC, BIOS 0403 01/26/2021 [ 2507.914115] Call Trace: [ 2507.914118] [ 2507.914121] dump_stack_lvl+0x59/0x73 [ 2507.914128] __lock_acquire.cold+0x227/0x3b0 [ 2507.914135] ? lockdep_hardirqs_on_prepare+0x410/0x410 [ 2507.914141] ? __lock_acquire+0x23ca/0x5000 [ 2507.914147] lock_acquire+0x19c/0x4b0 [ 2507.914152] ? kmem_cache_alloc_trace+0x30/0x390 [ 2507.914157] ? lock_release+0x690/0x690 [ 2507.914163] ? lock_is_held_type+0xe4/0x140 [ 2507.914170] ? ttm_sys_man_alloc+0x47/0xb0 [ttm] [ 2507.914178] fs_reclaim_acquire+0x11a/0x160 [ 2507.914183] ? kmem_cache_alloc_trace+0x30/0x390 [ 2507.914188] kmem_cache_alloc_trace+0x30/0x390 [ 2507.914192] ? lock_release+0x37f/0x690 [ 2507.914198] ttm_sys_man_alloc+0x47/0xb0 [ttm] [ 2507.914206] ttm_bo_pipeline_gutting+0x70/0x440 [ttm] [ 2507.914214] ? ttm_mem_io_free+0x150/0x150 [ttm] [ 2507.914221] ? lock_is_held_type+0xe4/0x140 [ 2507.914227] ttm_bo_validate+0x2fb/0x370 [ttm] [ 2507.914234] ? lock_acquire+0x19c/0x4b0 [ 2507.914239] ? ttm_bo_bounce_temp_buffer.constprop.0+0xf0/0xf0 [ttm] [ 2507.914246] ? lock_acquire+0x131/0x4b0 [ 2507.914251] ? lock_is_held_type+0xe4/0x140 [ 2507.914257] i915_ttm_shrinker_release_pages+0x2bc/0x490 [i915] [ 2507.914339] ? i915_ttm_swap_notify+0x130/0x130 [i915] [ 2507.914429] ? i915_gem_object_release_mmap_offset+0x32/0x250 [i915] [ 2507.914529] i915_gem_shrink+0xb14/0x1290 [i915] [ 2507.914616] ? ___i915_gem_object_make_shrinkable+0x3e0/0x3e0 [i915] [ 2507.914698] ? _raw_spin_unlock_irqrestore+0x2d/0x60 [ 2507.914705] ? track_intel_runtime_pm_wakeref+0x180/0x230 [i915] [ 2507.914777] i915_gem_shrink_all+0x4b/0x70 [i915] [ 2507.914857] i915_drop_caches_set+0x227/0x2c0 [i915] Reported-by: Thomas Hellström Signed-off-by: Matthew Auld Reviewed-by: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20211213125530.3960007-1-matthew.auld@intel.com commit 6eecfd592d5e0535dbb0bd936aa69688f1ebe97e Merge: 136057256686d 85744f2d938c5 Author: Arnd Bergmann Date: Tue Dec 14 17:18:42 2021 +0100 Merge tag 'renesas-arm-soc-for-v5.17-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/soc Renesas ARM SoC updates for v5.17 - Add a missing of_node_put(). * tag 'renesas-arm-soc-for-v5.17-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: ARM: shmobile: rcar-gen2: Add missing of_node_put() Link: https://lore.kernel.org/r/cover.1638530611.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit 60f44fe4cde9c239c40fb5267126229c48f50e22 Author: Jeff Guo Date: Fri Jul 16 15:16:43 2021 -0700 ice: refactor PTYPE validating Since the capability of a PTYPE within a specific package could be negotiated by checking the HW bit map, it means that there's no need to maintain a different PTYPE list for each type of the package when parsing PTYPE. So refactor the PTYPE validating mechanism. Signed-off-by: Jeff Guo Tested-by: Tony Brelinski Signed-off-by: Tony Nguyen commit 8818b95409d8e68da3c2ec3e407b617d9294cf37 Author: Haiyue Wang Date: Fri Jul 16 15:16:42 2021 -0700 ice: Add package PTYPE enable information Scan the 'Marker Ptype TCAM' section to retrieve the Rx parser PTYPE enable information from the current package. Signed-off-by: Haiyue Wang Tested-by: Tony Brelinski Signed-off-by: Tony Nguyen commit beefee71336bfb406c3e37a0de8a12881424e78c Author: Seevalamuthu Mariappan Date: Mon Dec 13 11:53:08 2021 +0200 ath11k: Change qcn9074 fw to operate in mode-2 In mode-2 QCN9074 firmware uses 15MB of host memory and firmware request 1MB size segements in QMI, whereas in mode-0 firmware uses 45MB of host memory and each segment is of 2MB size. In mode-2 firmware operates with reduced number of vdevs and peers. Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.4.0.1-01838-QCAHKSWPL_SILICONZ-1 Signed-off-by: Seevalamuthu Mariappan Signed-off-by: Anilkumar Kolli Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211209104351.9811-3-kvalo@kernel.org commit 523aafd0f071c5f9e951a861c30531c1eeb01ad4 Author: Kalle Valo Date: Mon Dec 13 11:53:08 2021 +0200 ath11k: add ab to TARGET_NUM_VDEVS & co The next patch changes TARGET_NUM_VDEVS to be dynamic and need access to ab. Add ab separately to keep the next patch simple. Compile tested only. Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211209104351.9811-2-kvalo@kernel.org commit eccd25136386a04ebf46a64f3a34e8e0fab6d9e1 Author: Zhou Qingyang Date: Mon Dec 13 11:53:07 2021 +0200 ath11k: Fix a NULL pointer dereference in ath11k_mac_op_hw_scan() In ath11k_mac_op_hw_scan(), the return value of kzalloc() is directly used in memcpy(), which may lead to a NULL pointer dereference on failure of kzalloc(). Fix this bug by adding a check of arg.extraie.ptr. This bug was found by a static analyzer. The analysis employs differential checking to identify inconsistent security operations (e.g., checks or kfrees) between two code paths and confirms that the inconsistent operations are not recovered in the current function or the callers, so they constitute bugs. Note that, as a bug found by static analysis, it can be a false positive or hard to trigger. Multiple researchers have cross-reviewed the bug. Builds with CONFIG_ATH11K=m show no new warnings, and our static analyzer no longer warns about this code. Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices") Signed-off-by: Zhou Qingyang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211202155348.71315-1-zhou1615@umn.edu commit b9aafbd46eb92b3174781661c33bdb2c17d484f1 Author: Mauro Carvalho Chehab Date: Fri Dec 10 13:52:42 2021 +0100 media: si2157: add ATV support for si2158 This device also supports ATV, as it has the same API for setting analog TV tuning parameters. Signed-off-by: Mauro Carvalho Chehab commit 98c65a3dac95b54bc105e29d492ce18c49353e67 Author: Mauro Carvalho Chehab Date: Fri Dec 10 13:37:54 2021 +0100 media: si2157: add support for 1.7MHz and 6.1 MHz Some tuners allow setting the bandwidth filter to 1.7MHz and 6.1 MHz. Add support for it upstream, as the narrower is the bandwidth filter, the better. Signed-off-by: Mauro Carvalho Chehab commit 6446a22a16699fdebb8a9fa4a8157bb54bf30514 Author: Mauro Carvalho Chehab Date: Fri Dec 10 13:16:32 2021 +0100 media: si2157: add support for ISDB-T and DTMB Those two delivery systems are supported by some of the si2146 tuners, but the current code is missing the setup for those. Signed-off-by: Mauro Carvalho Chehab commit 805d5a089673cdab794bad561f239384d3f3cc78 Author: Mauro Carvalho Chehab Date: Fri Dec 10 08:55:20 2021 +0100 media: si2157: get rid of chiptype data The driver should be capable of autodetecting its type, so no need to pass it via device driver's data. While here, improve documentation of some of the part_id specific code. Signed-off-by: Mauro Carvalho Chehab commit 1c35ba3bf97213538b82067acc0f23f18e652226 Author: Mauro Carvalho Chehab Date: Thu Dec 9 11:56:01 2021 +0100 media: si2157: use a different namespace for firmware Each chip at the si21xx TER family seems to have a different firmware, with seems to actually be a patch against the ROM code. Rework the code in order to use different firmware files depending on the chip ID and rom ID. Signed-off-by: Mauro Carvalho Chehab commit 7c2d8ee486b9ebd462dcd0aea1969758522f4c3a Author: Mauro Carvalho Chehab Date: Wed Dec 8 10:46:59 2021 +0100 media: si2157: rework the firmware load logic Loading a firmware file should not be mandatory, as devices could work with an eeprom firmware, if available. Yet, using the eeprom firmware could lead into unpredictable results, so the best is to warn about that. Signed-off-by: Mauro Carvalho Chehab commit 48dde945e7f856f622bd68c076f8a6b5d524d19e Author: Robert Schlabbach Date: Wed Dec 1 22:10:58 2021 +0100 media: si2157: Add optional firmware download The Si2157 (A30) is functional with the ROM firmware 3.0.5, but can also be patched at runtime, e.g. to firmware 3.1.3. However, although a firmware filename for its firmware patch exists, that has only been used for the Si2177 (A30) so far (which indeed takes the binary identical firmware patch). Add support for downloading firmware patches into the Si2157 (A30), but make it optional, so that initialization can succeed with and without a firmware patch being available. Keep the use of request_firmware() for this purpose rather than firmware_request_nowarn(), so that the warning in the log makes users aware that it is possible to provide a firmware for this tuner. The firmware patch is probably also optional for other (if not all) tuners supported by the driver, but since I do not have the others available to test, they are kept mandatory for now to avoid regressions. Signed-off-by: Robert Schlabbach Signed-off-by: Mauro Carvalho Chehab commit 2ae5d7e5416982c585a8b8d9d330501a4fbc6c10 Author: Mauro Carvalho Chehab Date: Wed Dec 8 10:23:45 2021 +0100 media: si2157: move firmware load to a separate function Split the firmware load code from si2157_init, in order to help to add further changes at the way firmware is handled on this device. No functional changes. Signed-off-by: Mauro Carvalho Chehab commit 3f81fc9b2ba495d913d16db95c4f04c6becf7701 Author: gushengxian Date: Wed May 26 09:55:27 2021 +0200 media: b2c2-flexcop-usb: fix some whitespace coding style On some places, there's a missing whitespace. Link: https://lore.kernel.org/linux-media/20210526075527.302903-1-13145886936@163.com Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, gushengxian Signed-off-by: gushengxian Signed-off-by: Mauro Carvalho Chehab commit 309247892818a5e3075e611570dcdc01183a74c5 Author: Jason Wang Date: Sun Dec 12 08:09:18 2021 +0100 media: ivtv: no need to initialise statics to 0 Static variables do not need to be initialised to 0, because compiler will initialise all uninitialised statics to 0. Thus, remove the unneeded initializations. Link: https://lore.kernel.org/linux-media/20211212070918.289617-1-wangborong@cdjrlc.com Signed-off-by: Jason Wang Signed-off-by: Mauro Carvalho Chehab commit 391137c04ec3ab3d27aa4e3081427f490655ec6f Author: Andy Shevchenko Date: Fri Dec 10 13:02:01 2021 +0100 media: dmxdev: drop unneeded inclusion from other headers There is no evidence we need kernel.h inclusion in certain headers. Drop unneeded inclusion from other headers. Link: https://lore.kernel.org/linux-media/20211210120201.35635-1-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 9dd2444f2395f0b9edb4901be3909891ea51a1d9 Author: Minghao Chi Date: Fri Dec 10 03:47:21 2021 +0100 media: vidtv: remove unneeded variable make code cleaner return value form directly instead of taking this in another redundant variable. Link: https://lore.kernel.org/linux-media/20211210024721.425145-1-chi.minghao@zte.com.cn Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: Mauro Carvalho Chehab commit 5d6db4aa3c85e5dd76a7c48073472c70e68b8d13 Author: chiminghao Date: Thu Dec 9 02:50:09 2021 +0100 media: drivers:usb:remove unneeded variable return value form directly instead of taking this in another redundant variable. Link: https://lore.kernel.org/linux-media/20211209015009.409428-1-chi.minghao@zte.com.cn Reported-by: Zeal Robot Signed-off-by: chiminghao Signed-off-by: Mauro Carvalho Chehab commit df78b858e773967112b4444400fb7bb5bd7a9d8a Author: Niklas Söderlund Date: Wed Dec 8 13:17:56 2021 +0100 media: i2c: max9286: Use dev_err_probe() helper Use the dev_err_probe() helper, instead of open-coding the same operation. While at it retrieve the error once and use it from 'ret' instead of retrieving it twice. Link: https://lore.kernel.org/linux-media/20211208121756.3051565-1-niklas.soderlund+renesas@ragnatech.se Suggested-by: Geert Uytterhoeven Signed-off-by: Niklas S\xF6derlund Reviewed-by: Geert Uytterhoeven Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 232c297a4e86fba1e2497012b1fcde6018d46f50 Author: Dan Carpenter Date: Wed Dec 8 08:35:44 2021 +0100 media: c8sectpfe: fix double free in configure_channels() The configure_channels() function has a double free because configure_memdma_and_inputblock() calls free_input_block() and then it's called again in the error handling code. Link: https://lore.kernel.org/linux-media/20211208073544.GA22020@kili Fixes: c5f5d0f99794 ("[media] c8sectpfe: STiH407/10 Linux DVB demux support") Signed-off-by: Dan Carpenter Reviewed-by: Patrice Chotard Signed-off-by: Mauro Carvalho Chehab commit 43f0633f89947df57fe0b5025bdd741768007708 Author: Jiasheng Jiang Date: Mon Dec 6 03:22:01 2021 +0100 media: coda/imx-vdoa: Handle dma_set_coherent_mask error codes The return value of dma_set_coherent_mask() is not always 0. To catch the exception in case that dma is not support the mask. Link: https://lore.kernel.org/linux-media/20211206022201.1639460-1-jiasheng@iscas.ac.cn Fixes: b0444f18e0b1 ("[media] coda: add i.MX6 VDOA driver") Signed-off-by: Jiasheng Jiang Signed-off-by: Mauro Carvalho Chehab commit e0471a623c86f698ac2e7c9a4af6c53d9040e514 Author: Colin Ian King Date: Sun Dec 5 01:22:42 2021 +0100 media: davinci: remove redundant assignment to pointer common Pointer common is being assigned a value in a for-loop and the pointer is never read afterwards. The assignment is redundant and can be removed. Link: https://lore.kernel.org/linux-media/20211205002242.202769-1-colin.i.king@gmail.com Signed-off-by: Colin Ian King Signed-off-by: Mauro Carvalho Chehab commit 213173d958a3b07169d697faac8bb4b7ae88db49 Author: Colin Ian King Date: Sun Dec 5 01:17:17 2021 +0100 media: saa7146: remove redundant assignments of i to zero The variable i is assigned the value 0 and each time the value is never read after it has been assigned. The assignments are redundant and can be removed. Link: https://lore.kernel.org/linux-media/20211205001717.178416-1-colin.i.king@gmail.com Signed-off-by: Colin Ian King Signed-off-by: Mauro Carvalho Chehab commit f66dcb32af19faf49cc4a9222c3152b10c6ec84a Author: Ricardo Ribalda Date: Tue Dec 7 01:38:37 2021 +0100 media: Revert "media: uvcvideo: Set unique vdev name based in type" A lot of userspace depends on a descriptive name for vdev. Without this patch, users have a hard time figuring out which camera shall they use for their video conferencing. This reverts commit e3f60e7e1a2b451f538f9926763432249bcf39c4. Link: https://lore.kernel.org/linux-media/20211207003840.1212374-2-ribalda@chromium.org Cc: Fixes: e3f60e7e1a2b ("media: uvcvideo: Set unique vdev name based in type") Reported-by: Nicolas Dufresne Signed-off-by: Ricardo Ribalda Reviewed-by: Laurent Pinchart Reviewed-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 959fddf537c8d3f305df135881976318d7e13b93 Author: Thierry Reding Date: Tue Dec 7 11:27:46 2021 +0100 ARM: tegra: Avoid pwm- prefix in pinmux nodes The "pwm-" prefix currently matches the DT schema for PWM controllers and throws an error in that case. This is something that should be fixed in the PWM DT schema, but in this case we can also preempt any such conflict by naming the nodes after the pins like we do for many others of these nodes. Signed-off-by: Thierry Reding commit 4b7f222d832364e17363e4232d5110c7e7660932 Author: Thierry Reding Date: Tue Dec 7 11:25:49 2021 +0100 ARM: tegra: Sort Tegra124 XUSB clocks correctly Make the order of the clocks and clock-names properties match the order in the device tree bindings. This isn't strictly necessary from a point of view of the operating system because matching will be done based on the clock-names, but it makes it easier to validate the device trees against the DT schema. Signed-off-by: Thierry Reding commit e51c87b7cb1a41d99e059ca3a9c8edf41656ce1f Author: Thierry Reding Date: Tue Dec 7 11:23:43 2021 +0100 ARM: tegra: Drop unused AHCI clocks on Tegra124 The CML1 and PLL_E clocks are never explicitly used by the AHCI controller found on Tegra124, so drop them from the corresponding device tree node. Signed-off-by: Thierry Reding commit 9b07cfe27647639e52a411d07413608cb5cda7dc Author: Thierry Reding Date: Tue Dec 7 11:22:26 2021 +0100 ARM: tegra: Fix Tegra124 I2C compatible string list The I2C controller found on Tegra124 is not fully compatible with the Tegra114 version, so drop the fallback compatible string from the list. Signed-off-by: Thierry Reding commit c6d4a8977598c022355521fcf29d706dd95c7a83 Author: Dmitry Osipenko Date: Wed Dec 1 02:23:41 2021 +0300 ARM: tegra: Rename CPU and EMC OPP table device-tree nodes OPP table name now should start with "opp-table" and OPP entries shouldn't contain commas and @ signs in accordance to the new schema requirement. Reorganize CPU and EMC OPP table device-tree nodes. Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 272c5c3a3792366dfd441182f1bd94aa4b6e346f Author: Thierry Reding Date: Tue Dec 7 11:14:33 2021 +0100 ARM: tegra: Rename thermal zone nodes The DT schema requires that nodes representing thermal zones include a "-thermal" suffix in their name. Signed-off-by: Thierry Reding commit 9ab9ecd83a3ecf269e8cda08233652203347f5f1 Author: Thierry Reding Date: Tue Dec 7 11:11:33 2021 +0100 ARM: tegra: Drop reg-shift for Tegra HS UART When the Tegra High-Speed UART is used instead of the regular UART, the reg-shift property is implied from the compatible string and should not be explicitly listed. Signed-off-by: Thierry Reding commit 1b5bad01abdcefd1bbf58590d5a78e15741f6a34 Author: Thierry Reding Date: Tue Dec 7 11:03:12 2021 +0100 ARM: tegra: Rename GPU node on Tegra124 In order to be able to pass DT schema validation, change the GPU nodes' unit-address to the standard notation. Previously this was using a "0," prefix that originated from a time when the top-level device tree node contained #address-cells = <2>. Note that this technically breaks backwards-compatibility with certain older versions of the U-Boot bootloader because early versions used a hard-coded DT path lookup to find the GPU node and perform some fixups on it. However, this was changed to a compatible string based lookup in April 2016, so it's reasonable to expect people to update U-Boot on the systems that they want to use this updated kernel DTB with. Signed-off-by: Thierry Reding commit 63658cbc66a27b5fcb683623d299e59cc2771964 Author: Thierry Reding Date: Tue Dec 7 10:59:24 2021 +0100 ARM: tegra: Rename GPIO hog nodes to match schema GPIO hog nodes must have a "hog-" prefix or "-hog" suffix according to the DT schema. Rename all such nodes to allow validation to pass. Signed-off-by: Thierry Reding commit 82d03bec4e97f01d982b1663d438c55b100de7e3 Author: Thierry Reding Date: Tue Dec 7 10:56:21 2021 +0100 ARM: tegra: Add #reset-cells for Tegra114 MC The Tegra memory controller provides reset controls for hotflush reset, so the #reset-cells property must be specified. Signed-off-by: Thierry Reding commit f8d5db7e27b389825b7c61255f14f81d6104061b Author: Thierry Reding Date: Tue Dec 7 10:55:06 2021 +0100 ARM: tegra: Fix compatible string for Tegra114+ timer The TKE (time-keeping engine) found on Tegra114 and later is no longer backwards compatible with the version found on Tegra20, so update the compatible string list accordingly. Note that while the hardware block is strictly backwards-compatible, an architectural timer exists on those newer SoCs that is more reliable, so that should always be preferred. Signed-off-by: Thierry Reding commit c629196d04c8cdb0624a0763cec78fa18ba8ab1f Author: Dmitry Osipenko Date: Sun Dec 12 00:14:04 2021 +0300 ARM: tegra: Rename top-level regulators Regulators defined at the top level in device tree are no longer part of a simple bus and therefore don't have a reg property. Nodes without a reg property shouldn't have a unit-address either, so drop the unit address from the node names. To ensure nodes aren't duplicated (in which case they would end up merged in the final DTB), append the name of the regulator to the node name. [treding@nvidia.com: factored out patch and wrote commit message] Signed-off-by: David Heidelberg Co-developed-by: Thierry Reding Signed-off-by: Thierry Reding Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 4f74ed817ef8d8aa2ef5049537f329fde2f9fca7 Author: David Heidelberg Date: Sun Dec 12 00:14:03 2021 +0300 ARM: tegra: Rename top-level clocks Clocks defined at the top level in device tree are no longer part of a simple bus and therefore don't have a reg property. Nodes without a reg property shouldn't have a unit-address either, so drop the unit address from the node names. To ensure nodes aren't duplicated (in which case they would end up merged in the final DTB), append the name of the clock to the node name. [treding@nvidia.com: factored out patch and wrote commit message] Signed-off-by: David Heidelberg Co-developed-by: Thierry Reding Signed-off-by: Thierry Reding Signed-off-by: Dmitry Osipenko Signed-off-by: Thierry Reding commit 0b9f3940d6305dd0fc059f7ffaa8334d2e2dd8b6 Author: Thierry Reding Date: Mon Dec 6 17:19:28 2021 +0100 ARM: tegra: Rename SPI flash chip nodes SPI flash chip nodes should be named "flash" instead of "spi-flash". Signed-off-by: Thierry Reding commit 0a6a64f904c6fda33f4b7d50abcae3b8302e89f1 Author: Thierry Reding Date: Mon Dec 6 17:08:42 2021 +0100 ARM: tegra: Specify correct PMIC compatible on Tegra114 boards The PMIC found on Dalmore, TN7 and Roth is a TPS65913, so add the specific compatible string in addition to the generic Palmas series compatible string. Signed-off-by: Thierry Reding commit 0714ccb54c38826f942848813cb06bc50d148e37 Author: Thierry Reding Date: Wed Dec 18 13:49:14 2019 +0100 ARM: tegra: Clean up external memory controller nodes The external memory controller should be sorted after the memory controller to keep the ordering by unit-address intact. Signed-off-by: Thierry Reding commit e8f7875680aeddb717248e0467bd533243d326ef Merge: c6e5bdae04a30 3542de6a5b159 Author: Arnd Bergmann Date: Tue Dec 14 15:54:19 2021 +0100 Merge tag 'memory-controller-drv-renesas-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl into arm/drivers Memory controller drivers for v5.17 - Renesas Changes to the Renesas RPC-IF driver: 1. Add support for R9A07G044 / RZ/G2L. 2. Several minor fixes and improvements to the driver. * tag 'memory-controller-drv-renesas-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl: memory: renesas-rpc-if: refactor MOIIO and IOFV macros memory: renesas-rpc-if: avoid use of undocumented bits memory: renesas-rpc-if: simplify register update memory: renesas-rpc-if: Silence clang warning memory: renesas-rpc-if: Add support for RZ/G2L memory: renesas-rpc-if: Drop usage of RPCIF_DIRMAP_SIZE macro memory: renesas-rpc-if: Return error in case devm_ioremap_resource() fails dt-bindings: memory: renesas,rpc-if: Add optional interrupts property dt-bindings: memory: renesas,rpc-if: Add support for the R9A07G044 Link: https://lore.kernel.org/r/20211213105618.5686-1-krzysztof.kozlowski@canonical.com Signed-off-by: Arnd Bergmann commit 9fc205b413b3f3e9502fa92151fba63b91230454 Author: Andrii Nakryiko Date: Fri Dec 10 16:40:43 2021 -0800 libbpf: Add sane strncpy alternative and use it internally strncpy() has a notoriously error-prone semantics which makes GCC complain about it a lot (and quite often completely completely falsely at that). Instead of pleasing GCC all the time (-Wno-stringop-truncation is unfortunately only supported by GCC, so it's a bit too messy to just enable it in Makefile), add libbpf-internal libbpf_strlcpy() helper which follows what FreeBSD's strlcpy() does and what most people would expect from strncpy(): copies up to N-1 first bytes from source string into destination string and ensures zero-termination afterwards. Replace all the relevant uses of strncpy/strncat/memcpy in libbpf with libbpf_strlcpy(). This also fixes the issue reported by Emmanuel Deloget in xsk.c where memcpy() could access source string beyond its end. Fixes: 2f6324a3937f8 (libbpf: Support shared umems between queues and devices) Reported-by: Emmanuel Deloget Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20211211004043.2374068-1-andrii@kernel.org commit a556cfe4cabc6d79cbb7733f118bbb420b376fe6 Author: Yunfei Wang Date: Tue Dec 7 19:33:15 2021 +0800 iommu/io-pgtable-arm-v7s: Add error handle for page table allocation failure In __arm_v7s_alloc_table function: iommu call kmem_cache_alloc to allocate page table, this function allocate memory may fail, when kmem_cache_alloc fails to allocate table, call virt_to_phys will be abnomal and return unexpected phys and goto out_free, then call kmem_cache_free to release table will trigger KE, __get_free_pages and free_pages have similar problem, so add error handle for page table allocation failure. Fixes: 29859aeb8a6e ("iommu/io-pgtable-arm-v7s: Abort allocation when table address overflows the PTE") Signed-off-by: Yunfei Wang Cc: # 5.10.* Acked-by: Robin Murphy Link: https://lore.kernel.org/r/20211207113315.29109-1-yf.wang@mediatek.com Signed-off-by: Will Deacon commit 17d9a4b43b284c333bf2c0c347da28bf22fe7a97 Author: Rikard Falkeborn Date: Sat Dec 4 23:33:01 2021 +0100 iommu/arm-smmu-v3: Constify arm_smmu_mmu_notifier_ops The only usage of arm_smmu_mmu_notifier_ops is to assign its address to the ops field in the mmu_notifier struct, which is a pointer to const struct mmu_notifier_ops. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn Reviewed-by: Jean-Philippe Brucker Link: https://lore.kernel.org/r/20211204223301.100649-1-rikard.falkeborn@gmail.com Signed-off-by: Will Deacon commit cd76990c94bb2239e1bcf38087ce4be0512c1232 Author: Vinod Koul Date: Wed Dec 1 13:09:43 2021 +0530 iommu: arm-smmu-impl: Add SM8450 qcom iommu implementation Add SM8450 qcom iommu implementation to the table of qcom_smmu_impl_of_match table which brings in iommu support for SM8450 SoC Signed-off-by: Vinod Koul Tested-by: Dmitry Baryshkov Acked-by: Konrad Dybcio Link: https://lore.kernel.org/r/20211201073943.3969549-3-vkoul@kernel.org Signed-off-by: Will Deacon commit 810d8cabaab5ab83605a4dd5c6b3f38915f998e8 Author: Vinod Koul Date: Wed Dec 1 13:09:42 2021 +0530 dt-bindings: arm-smmu: Add compatible for SM8450 SoC Add the SoC specific compatible for SM8450 implementing arm,mmu-500. Signed-off-by: Vinod Koul Acked-by: Rob Herring Link: https://lore.kernel.org/r/20211201073943.3969549-2-vkoul@kernel.org Signed-off-by: Will Deacon commit c31112fbd4077a51a14ff338038c82e9571dc821 Author: Rob Clark Date: Mon Nov 8 09:17:23 2021 -0800 iommu/arm-smmu-qcom: Fix TTBR0 read It is a 64b register, lets not lose the upper bits. Fixes: ab5df7b953d8 ("iommu/arm-smmu-qcom: Add an adreno-smmu-priv callback to get pagefault info") Signed-off-by: Rob Clark Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211108171724.470973-1-robdclark@gmail.com Signed-off-by: Will Deacon commit ae377d342006fc774d81941b2d1054e71c00b937 Author: David Heidelberg Date: Thu Oct 21 01:17:00 2021 +0200 dt-bindings: arm-smmu: Add compatible for the SDX55 SoC Add missing compatible for the SDX55 SoC. Signed-off-by: David Heidelberg Link: https://lore.kernel.org/r/20211020231701.278846-1-david@ixit.cz Signed-off-by: Will Deacon commit 5719d4fee1caed83979b21ad4cf34d46abf97514 Author: Robert Beckett Date: Fri Dec 10 19:50:05 2021 +0000 drm/i915/ttm: fix large buffer population trucation ttm->num_pages is uint32_t which was causing very large buffers to only populate a truncated size. This fixes gem_create@create-clear igt test on large memory systems. Fixes: 7ae034590cea ("drm/i915/ttm: add tt shmem backend") Signed-off-by: Robert Beckett Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20211210195005.2582884-1-bob.beckett@collabora.com commit 4581e676d3be9d8c921a48bf18e92c5a8f31bf13 Author: Andrii Nakryiko Date: Mon Dec 13 17:00:32 2021 -0800 libbpf: Fix potential uninit memory read In case of BPF_CORE_TYPE_ID_LOCAL we fill out target result explicitly. But targ_res itself isn't initialized in such a case, and subsequent call to bpf_core_patch_insn() might read uninitialized field (like fail_memsz_adjust in this case). So ensure that targ_res is zero-initialized for BPF_CORE_TYPE_ID_LOCAL case. This was reported by Coverity static analyzer. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20211214010032.3843804-1-andrii@kernel.org commit 1aa97b002258a190d7790a1a5c0c27829f82e569 Author: Richard Zhu Date: Thu Dec 2 16:02:35 2021 +0800 phy: freescale: pcie: Initialize the imx8 pcie standalone phy driver Add the standalone i.MX8 PCIe PHY driver. Signed-off-by: Richard Zhu Tested-by: Marcel Ziswiler Reviewed-by: Tim Harvey Tested-by: Tim Harvey Link: https://lore.kernel.org/r/1638432158-4119-6-git-send-email-hongxing.zhu@nxp.com Signed-off-by: Vinod Koul commit b3b5516a6fee5a4d39cd04fd84ed0a64b74e7238 Author: Richard Zhu Date: Thu Dec 2 16:02:32 2021 +0800 dt-bindings: phy: Add imx8 pcie phy driver support Add dt-binding for the standalone i.MX8 PCIe PHY driver. Signed-off-by: Richard Zhu Tested-by: Marcel Ziswiler Reviewed-by: Tim Harvey Tested-by: Tim Harvey Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/1638432158-4119-3-git-send-email-hongxing.zhu@nxp.com Signed-off-by: Vinod Koul commit f6f787874aa52bbfbfd0210f519439d38fd5377f Author: Richard Zhu Date: Thu Dec 2 16:02:31 2021 +0800 dt-bindings: phy: phy-imx8-pcie: Add binding for the pad modes of imx8 pcie phy Add binding for reference clock PAD modes of the i.MX8 PCIe PHY. Signed-off-by: Richard Zhu Tested-by: Marcel Ziswiler Reviewed-by: Tim Harvey Tested-by: Tim Harvey Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/1638432158-4119-2-git-send-email-hongxing.zhu@nxp.com Signed-off-by: Vinod Koul commit f4217069cd11635bf397ca1b6488ceb8c7bc66ab Author: Mauro Carvalho Chehab Date: Tue Dec 14 14:52:28 2021 +0100 media: saa7146: fix error logic at saa7146_vv_init() As the first thing this function does is to call v4l2_device_register(), it should call v4l2_device_unregister() if an error occurs, the same way as done at saa7146_vv_release(). Signed-off-by: Mauro Carvalho Chehab commit 3af86b046933ba513d08399dba0d4d8b50d607d0 Author: Zhou Qingyang Date: Fri Dec 3 16:40:30 2021 +0100 media: saa7146: hexium_gemini: Fix a NULL pointer dereference in hexium_attach() In hexium_attach(dev, info), saa7146_vv_init() is called to allocate a new memory for dev->vv_data. saa7146_vv_release() will be called on failure of saa7146_register_device(). There is a dereference of dev->vv_data in saa7146_vv_release(), which could lead to a NULL pointer dereference on failure of saa7146_vv_init(). Fix this bug by adding a check of saa7146_vv_init(). This bug was found by a static analyzer. The analysis employs differential checking to identify inconsistent security operations (e.g., checks or kfrees) between two code paths and confirms that the inconsistent operations are not recovered in the current function or the callers, so they constitute bugs. Note that, as a bug found by static analysis, it can be a false positive or hard to trigger. Multiple researchers have cross-reviewed the bug. Builds with CONFIG_VIDEO_HEXIUM_GEMINI=m show no new warnings, and our static analyzer no longer warns about this code. Link: https://lore.kernel.org/linux-media/20211203154030.111210-1-zhou1615@umn.edu Signed-off-by: Zhou Qingyang Signed-off-by: Mauro Carvalho Chehab commit ce560ee5c51d32b450ac453fceeee58a2683019b Author: Christophe JAILLET Date: Wed Dec 1 23:19:40 2021 +0100 media: mc: mc-entity.c: Use bitmap_zalloc() when applicable 'ent_enum->bmap' is a bitmap. So use 'bitmap_zalloc()' to simplify code, improve the semantic and avoid some open-coded arithmetic in allocator arguments. Also change the corresponding 'kfree()' into 'bitmap_free()' to keep consistency. While at it, remove a useless 'bitmap_zero()'. Link: https://lore.kernel.org/linux-media/b11f646dda189f490c06bf671f64a2cc0af4d45c.1638397089.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 34b1df99a5d4a6f3c354fd5ff0ddfbf4f67db2bc Author: Rikard Falkeborn Date: Sat Nov 27 10:49:44 2021 +0100 media: staging: max96712: Constify static v4l2_subdev_ops The only usage of max96712_subdev_ops is to pass its address to v4l2_i2c_subdev_init() which takes a pointer to const struct v4l2_subdev_ops as argument. Make it const to allow the compiler to put it in read-only memory. Link: https://lore.kernel.org/linux-media/20211127094945.27985-1-rikard.falkeborn@gmail.com Signed-off-by: Rikard Falkeborn Reviewed-by: Niklas S\xF6derlund Reviewed-by: Kieran Bingham Signed-off-by: Mauro Carvalho Chehab commit 3d5831a40d3464eea158180eb12cbd81c5edfb6a Author: Wang Hai Date: Tue Oct 26 13:23:48 2021 +0200 media: msi001: fix possible null-ptr-deref in msi001_probe() I got a null-ptr-deref report: BUG: kernel NULL pointer dereference, address: 0000000000000060 ... RIP: 0010:v4l2_ctrl_auto_cluster+0x57/0x270 ... Call Trace: msi001_probe+0x13b/0x24b [msi001] spi_probe+0xeb/0x130 ... do_syscall_64+0x35/0xb0 In msi001_probe(), if the creation of control for bandwidth_auto fails, there will be a null-ptr-deref issue when it is used in v4l2_ctrl_auto_cluster(). Check dev->hdl.error before v4l2_ctrl_auto_cluster() to fix this bug. Link: https://lore.kernel.org/linux-media/20211026112348.2878040-1-wanghai38@huawei.com Fixes: 93203dd6c7c4 ("[media] msi001: Mirics MSi001 silicon tuner driver") Reported-by: Hulk Robot Signed-off-by: Wang Hai Signed-off-by: Mauro Carvalho Chehab commit c2611e479f5d9b05108270e1ab423955486b4457 Author: Mikhail Rudenko Date: Sun Oct 10 19:54:57 2021 +0200 media: rockchip: rkisp1: use device name for debugfs subdir name While testing Rockchip RK3399 with both ISPs enabled, a dmesg error was observed: ``` [ 15.559141] debugfs: Directory 'rkisp1' with parent '/' already present! ``` Fix it by using the device name for the debugfs subdirectory name instead of the driver name, thus preventing name collision. Link: https://lore.kernel.org/linux-media/20211010175457.438627-1-mike.rudenko@gmail.com Signed-off-by: Mikhail Rudenko Reviewed-by: Ezequiel Garcia Reviewed-by: Kieran Bingham Signed-off-by: Mauro Carvalho Chehab commit a9c976b18a4b66d7109826c60e951959d2b529fe Author: Evgeny Novikov Date: Sat Aug 14 17:57:42 2021 +0200 media: pt3: Switch to using functions pcim_* and devm_* pt3_probe() did not free one of IO mappings in case when one of them was successful while another one failed. The patch fixed that by using functions pcim_*. Also, it simplifies error handling through switching to devm_* functions. Found by Linux Driver Verification project (linuxtesting.org). Link: https://lore.kernel.org/linux-media/20210814155742.11392-1-novikov@ispras.ru Signed-off-by: Evgeny Novikov Co-developed-by: Kirill Shilimanov Signed-off-by: Kirill Shilimanov Reviewed-by: Andy Shevchenko Tested-by: Akihiro Tsukada Signed-off-by: Mauro Carvalho Chehab commit 589a9f0eb799f77de2c09583bf5bad221fa5d685 Author: Anton Vasilyev Date: Thu Aug 22 12:41:47 2019 +0200 media: dw2102: Fix use after free dvb_usb_device_init stores parts of properties at d->props and d->desc and uses it on dvb_usb_device_exit. Free of properties on module probe leads to use after free. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=204597 The patch makes properties static instead of allocated on heap to prevent memleak and use after free. Also fixes s421_properties.devices initialization to have 2 element instead of 6 copied from p7500_properties. [mchehab: fix function call alignments] Link: https://lore.kernel.org/linux-media/20190822104147.4420-1-vasilyev@ispras.ru Signed-off-by: Anton Vasilyev Fixes: 299c7007e936 ("media: dw2102: Fix memleak on sequence of probes") Signed-off-by: Mauro Carvalho Chehab commit c00d65e6df8dfe98a595c79eb6ed0ea1067ba565 Author: Michael Tretter Date: Mon Nov 29 12:27:06 2021 +0100 media: imx6-mipi-csi2: use pre_streamon callback to set sensor into LP11 Step 5 expects that the sensor is in LP11 mode. Use the new pre_streamon callback to signal the sensor that it should switch into LP11. Signed-off-by: Michael Tretter Reviewed-by: Philipp Zabel Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 9de63c91962b65f8fe2eab1748d9d85621fee08d Author: Andy Shevchenko Date: Thu Dec 2 22:03:35 2021 +0100 media: i2c: max9286: Get rid of duplicate of_node assignment GPIO library does copy the of_node from the parent device of the GPIO chip, there is no need to repeat this in the individual drivers. Remove assignment here. For the details one may look into the of_gpio_dev_init() implementation. Signed-off-by: Andy Shevchenko Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 8cc464fdcaaef1a38423c79c29df96db397d8b69 Author: Sakari Ailus Date: Fri Nov 26 09:04:42 2021 +0100 media: max96712: Depend on VIDEO_V4L2 Depend on VIDEO_V4L2 for the driver actually depends on it, failing to compile otherwise. Signed-off-by: Sakari Ailus Reviewed-by: Kieran Bingham Reviewed-by: Niklas Söderlund Signed-off-by: Mauro Carvalho Chehab commit 4c1aaf097b83cf48381fcb5f0a5fdf0de318e3a5 Author: Benjamin Gaignard Date: Wed Dec 8 17:44:18 2021 +0100 media: hantro: Fix G2/HEVC negotiated pixelformat G2/HEVC is broken because driver capture queue pixelformat ioctl G_FMT returns VT12 while G2/HEVC always generate NV12 frames: video1: VIDIOC_S_FMT: type=vid-out-mplane, width=2560, height=1600, format=S265 little-endian (0x35363253), field=none, colorspace=0, num_planes=1, flags=0x0, ycbcr_enc=0, quantization=0, xfer_func=0 plane 0: bytesperline=0 sizeimage=6144000 video1: VIDIOC_S_EXT_CTRLS: which=0x0, count=1, error_idx=0, request_fd=0, name=HEVC Sequence Parameter Set, id/size=0x990cf0/32 video1: VIDIOC_G_FMT: type=vid-cap-mplane, width=2560, height=1600, format=VT12 little-endian (0x32315456), field=none, colorspace=0, num_planes=1, flags=0x0, ycbcr_enc=0, quantization=0, xfer_func=0 plane 0: bytesperline=2560 sizeimage=6144000 video1: VIDIOC_ENUM_FMT: index=0, type=vid-cap-mplane, flags=0x0, pixelformat=NV12 little-endian (0x3231564e), mbus_code=0x0000, description='Y/CbCr 4:2:0' video1: VIDIOC_ENUM_FMT: error -22: index=1, type=vid-cap-mplane, flags=0x0, pixelformat=.... little-endian (0x00000000), mbus_code=0x0000, description='' video1: VIDIOC_G_FMT: type=vid-cap-mplane, width=2560, height=1600, format=VT12 little-endian (0x32315456), field=none, colorspace=0, num_planes=1, flags=0x0, ycbcr_enc=0, quantization=0, xfer_func=0 Use the postprocessor functions introduced by Hantro G2/VP9 codec series to fix the issue and remove duplicated buffer management. This allow Hantro G2/HEVC to produce NV12_4L4 and NV12. Fluster scores are 77/147 for HEVC and 129/303 for VP9 (no regression). Beauty, Jockey and ShakeNDry bitstreams from UVG (http://ultravideo.fi/) set have also been tested. Fixes: 53a3e71095c5 ("media: hantro: Simplify postprocessor") Signed-off-by: Benjamin Gaignard Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 8b3179b7212c4e3a087708aa1d9b21c4015eeec4 Author: Sean Young Date: Mon Dec 6 12:03:47 2021 +0100 media: streamzap: remove redundant gap calculations The lirc core already introduces gaps, so there is no need for this in the driver. Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 4df69e46c352df9bdbe859824da33428a3ce8a1d Author: Sean Young Date: Mon Dec 6 11:59:41 2021 +0100 media: streamzap: remove unused struct members These struct members do not serve any purpose. Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 35088717ad24140b6ab0ec00ef357709be607526 Author: Sean Young Date: Sun Dec 5 22:38:20 2021 +0100 media: streamzap: less chatter Remove superfluous messages which add no information. Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 7a25e6849ad73de5aa01d62da43071bc02b8530c Author: Sean Young Date: Sun Dec 5 18:10:36 2021 +0100 media: streamzap: no need for usb pid/vid in device name The usb pid/vid can be found elsewhere, the idVendor/idProduct usb sysfs files for example. Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 4bed9306050497f49cbe77b842f0d812f4f27593 Author: Sean Young Date: Sun Dec 5 18:06:30 2021 +0100 media: streamzap: remove unnecessary ir_raw_event_reset and handle There is no reason to have a reset after an IR timeout. Calling ir_raw_event_handle() twice for the same interrupt has no affect. Fixes: 56b0ec30c4bc ("[media] rc/streamzap: fix reporting response times") Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 8fede658e7ddb605bbd68ed38067ddb0af033db4 Author: Sean Young Date: Tue Nov 30 23:58:19 2021 +0100 media: igorplugusb: receiver overflow should be reported Without this, some IR will be missing mid-stream and we might decode something which never really occurred. Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 26748c0d86c2d06b6e3f595bfd843ff2f246ce97 Author: Sean Young Date: Sat Nov 27 18:55:51 2021 +0100 media: winbond-cir: no need for reset after resume An IR reset is only used when the IR hardware reports an error. Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit b820c2cf0e8d81e5d7c7a547239ca199d0acefcd Author: Sean Young Date: Sat Nov 27 14:53:49 2021 +0100 media: iguanair: no need for reset after IR receiver enable An IR reset is only used when the IR hardware reports an error. Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 74747dda582dc7ddd8aac6841954e84b0d28e56c Author: Sean Young Date: Sat Nov 27 12:46:58 2021 +0100 media: lirc: always send timeout reports Without timeout reports, it is impossible to decode many protocols since it is not known when the transmission ends. timeout reports are sent by default, but can be turned off. There is no reason to turn them off, and I cannot find any software which does this, so we can safely remove it. This makes the ioctl LIRC_SET_REC_TIMEOUT_REPORTS a no-op. Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit ac6f6548fcb3c6da8ff1653a16c66fc1719a2a3e Author: Bjorn Helgaas Date: Wed Dec 8 13:24:49 2021 -0600 rsxx: Drop PCI legacy power management The rsxx driver doesn't support device suspend, so remove rsxx_pci_suspend(), the legacy PCI .suspend() method, completely. Signed-off-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20211208192449.146076-5-helgaas@kernel.org Signed-off-by: Jens Axboe commit cd97b7e0d78009b45e08b92441d9562f9f37968c Author: Vaibhav Gupta Date: Wed Dec 8 13:24:48 2021 -0600 mtip32xx: convert to generic power management Convert mtip32xx from legacy PCI power management to the generic power management framework. Previously, mtip32xx used legacy PCI power management, where mtip_pci_suspend() and mtip_pci_resume() were responsible for both device-specific things and generic PCI things: mtip_pci_suspend mtip_block_suspend(dd) <-- device-specific pci_save_state(pdev) <-- generic PCI pci_set_power_state(pdev, pci_choose_state(pdev, state)) mtip_pci_resume pci_set_power_state(PCI_D0) <-- generic PCI pci_restore_state(pdev) <-- generic PCI pcim_enable_device(pdev) <-- generic PCI pci_set_master(pdev) <-- generic PCI mtip_block_resume(dd) <-- device-specific With generic power management, the PCI bus PM methods do the generic PCI things, and the driver needs only the device-specific part, i.e., suspend_devices_and_enter dpm_suspend_start(PMSG_SUSPEND) pci_pm_suspend # PCI bus .suspend() method mtip_pci_suspend # dev->driver->pm->suspend mtip_block_suspend <-- device-specific suspend_enter dpm_suspend_noirq(PMSG_SUSPEND) pci_pm_suspend_noirq # PCI bus .suspend_noirq() method pci_save_state <-- generic PCI pci_prepare_to_sleep <-- generic PCI pci_set_power_state ... dpm_resume_end(PMSG_RESUME) pci_pm_resume # PCI bus .resume() method pci_restore_standard_config pci_set_power_state(PCI_D0) <-- generic PCI pci_restore_state <-- generic PCI mtip_pci_resume # dev->driver->pm->resume mtip_block_resume <-- device-specific [bhelgaas: commit log] Link: https://lore.kernel.org/r/20210114115423.52414-2-vaibhavgupta40@gmail.com Signed-off-by: Vaibhav Gupta Signed-off-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20211208192449.146076-4-helgaas@kernel.org Signed-off-by: Jens Axboe commit 9e541f142dab67264075baaf8fd2eb4423742c16 Author: Bjorn Helgaas Date: Wed Dec 8 13:24:47 2021 -0600 mtip32xx: remove pointless drvdata lookups Previously we passed a struct pci_dev * to mtip_check_surprise_removal(), which immediately looked up the driver_data. But all callers already have the driver_data pointer, so just pass it directly and skip the extra lookup. No functional change intended. Signed-off-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20211208192449.146076-3-helgaas@kernel.org Signed-off-by: Jens Axboe commit 2920417c98dbe4b58200c12fc9dc152834b76e42 Author: Bjorn Helgaas Date: Wed Dec 8 13:24:46 2021 -0600 mtip32xx: remove pointless drvdata checking The .suspend() and .resume() methods are only called after the .probe() method (mtip_pci_probe()) has set the drvdata and returned success. Therefore, if we get to mtip_pci_suspend() or mtip_pci_resume(), the drvdata must be valid. Drop the unnecessary checking. Signed-off-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20211208192449.146076-2-helgaas@kernel.org Signed-off-by: Jens Axboe commit 33ce2aff7d340bf48875ccd80628c884cf8017ae Author: Hao Xu Date: Tue Dec 14 13:59:04 2021 +0800 io_uring: code clean for some ctx usage There are some functions doing ctx = req->ctx while still using req->ctx, update those places. Signed-off-by: Hao Xu Link: https://lore.kernel.org/r/20211214055904.61772-1-haoxu@linux.alibaba.com Signed-off-by: Jens Axboe commit 8bd09b41b82f60a9a4439c2a641ffb542a10c237 Merge: 1879a61f4ad80 aa1005d15d2ae Author: Will Deacon Date: Tue Dec 14 13:42:22 2021 +0000 Merge branch 'for-next/perf-user-counter-access' into for-next/perf * for-next/perf-user-counter-access: Documentation: arm64: Document PMU counters access from userspace arm64: perf: Enable PMU counter userspace access for perf event arm64: perf: Add userspace counter access disable switch perf: Add a counter for number of user access events in context x86: perf: Move RDPMC event flag to a common definition commit 1879a61f4ad80c7b8cb27d52154ac253e74ebe82 Merge: 8330904fedb13 df457ca973fee Author: Will Deacon Date: Tue Dec 14 13:42:17 2021 +0000 Merge branch 'for-next/perf-smmu' into for-next/perf * for-next/perf-smmu: perf/smmuv3: Synthesize IIDR from CoreSight ID registers perf/smmuv3: Add devicetree support dt-bindings: Add Arm SMMUv3 PMCG binding commit 8330904fedb13a1728e64995dd1251c85d5b7ca4 Merge: e73bc4fd78c4b 8404b0fbc7fbd Author: Will Deacon Date: Tue Dec 14 13:42:05 2021 +0000 Merge branch 'for-next/perf-hisi' into for-next/perf * for-next/perf-hisi: drivers/perf: hisi: Add driver for HiSilicon PCIe PMU docs: perf: Add description for HiSilicon PCIe PMU driver commit e73bc4fd78c4bf889f33bf8c07a7f4365c742fca Merge: fc369f925f5c1 4cbf47728f8d9 Author: Will Deacon Date: Tue Dec 14 13:41:58 2021 +0000 Merge branch 'for-next/perf-cn10k' into for-next/perf * for-next/perf-cn10k: dt-bindings: perf: Add YAML schemas for Marvell CN10K LLC-TAD pmu bindings drivers: perf: Add LLC-TAD perf counter support commit fc369f925f5c15a531313617fb22641aa6af874c Merge: d58071a8a76d7 a88fa6c28b867 Author: Will Deacon Date: Tue Dec 14 13:41:42 2021 +0000 Merge branch 'for-next/perf-cmn' into for-next/perf * for-next/perf-cmn: perf/arm-cmn: Add debugfs topology info perf/arm-cmn: Add CI-700 Support dt-bindings: perf: arm-cmn: Add CI-700 perf/arm-cmn: Support new IP features perf/arm-cmn: Demarcate CMN-600 specifics perf/arm-cmn: Move group validation data off-stack perf/arm-cmn: Optimise DTC counter accesses perf/arm-cmn: Optimise DTM counter reads perf/arm-cmn: Refactor DTM handling perf/arm-cmn: Streamline node iteration perf/arm-cmn: Refactor node ID handling perf/arm-cmn: Drop compile-test restriction perf/arm-cmn: Account for NUMA affinity perf/arm-cmn: Fix CPU hotplug unregistration commit 190357e1e09f271566e91fcd108c161f7e25a253 Merge: 03c2192ab6369 a78a42fb48b8f Author: Mark Brown Date: Tue Dec 14 13:22:33 2021 +0000 ASoC: qcom: apq8016_sbc: Allow routing audio through QDSP6 Merge series from Stephan Gerhold : This series makes it possible to route audio through the combined audio/modem DSP on MSM8916/APQ8016 devices instead of bypassing it using the LPASS drivers. This is necessary to support certain functionality such as voice call audio. See PATCH 4/5 for details. Also, qcom,apq8016-sbc.txt is converted to DT schema by adding it to the existing qcom,sm8250.yaml. The bindings are similar enough that it is easier to share a single schema instead of duplicating everything into multiple ones. commit 03c2192ab636987db72e99f319a942cc4f3cb352 Author: Jiaxin Yu Date: Thu Dec 9 15:32:24 2021 +0800 ASoC: mediatek: assign correct type to argument Fix the following sparse warning: (new ones prefixed by >>) >> sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c:370:33: sparse: sparse: incorrect type in argument 3 (different base types) sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c:370:33: sparse: expected unsigned int to sound/soc/mediatek/mt8192/mt8192-mt6359-rt1015-rt5682.c:370:33: sparse: got restricted snd_pcm_format_t [usertype] Correct discription of format, use S32_LE and S24_LE to distinguish the different 32bit. Signed-off-by: Jiaxin Yu Reported-by: kernel test robot Reviewed-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20211209073224.21793-1-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown commit ec247fea7380244626d7095dfc1a0bb6c1f84f29 Author: Rikard Falkeborn Date: Sat Dec 4 21:32:20 2021 +0100 ASoC: SOF: sof-probes: Constify sof_probe_compr_ops The only usage of sof_probe_compr_ops is to assign its address to the cops field in the snd_soc_dai_driver struct (in sound/soc/sof/intel/hda-dai.c). Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn Link: https://lore.kernel.org/r/20211204203220.54712-1-rikard.falkeborn@gmail.com Signed-off-by: Mark Brown commit 475b17b4a875ef31246c6a038ee60d5ca4982ea5 Author: Allen-KH Cheng Date: Thu Dec 9 22:08:30 2021 +0200 ASoC: SOF: Remove pm_runtime_put_autosuspend() for SOF OF device In SOF OF device, pm_runtime_put_autosuspend() is not matching any pm_runtime_get_sync(). This is imbalanced for PM runtime. Also, for consistency we call pm_runtime_mark_last_busy() before enabling PM runtime. 1. Remove pm_runtime_put_autosuspend() in probe_complete 2. Reorder PM runtime calls int probe_complete Signed-off-by: Allen-KH Cheng Reviewed-by: Daniel Baluta Reviewed-by: Paul Olaru Reviewed-by: Pierre-Louis Bossart Signed-off-by: Daniel Baluta Link: https://lore.kernel.org/r/20211209200830.145005-1-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit 053f58bab331e6c31c486661fdb5f6bad5f413de Author: Mark Rutland Date: Fri Dec 10 15:14:10 2021 +0000 arm64: atomics: lse: define RETURN ops in terms of FETCH ops The FEAT_LSE atomic instructions include LD* instructions which return the original value of a memory location can be used to directly implement FETCH opertations. Each RETURN op is implemented as a copy of the corresponding FETCH op with a trailing instruction to generate the new value of the memory location. We only directly implement *_fetch_add*(), for which we have a trailing `add` instruction. As the compiler has no visibility of the `add`, this leads to less than optimal code generation when consuming the result. For example, the compiler cannot constant-fold the addition into later operations, and currently GCC 11.1.0 will compile: return __lse_atomic_sub_return(1, v) == 0; As: mov w1, #0xffffffff ldaddal w1, w2, [x0] add w1, w1, w2 cmp w1, #0x0 cset w0, eq // eq = none ret This patch improves this by replacing the `add` with C addition after the inline assembly block, e.g. ret += i; This allows the compiler to manipulate `i`. This permits the compiler to merge the `add` and `cmp` for the above, e.g. mov w1, #0xffffffff ldaddal w1, w1, [x0] cmp w1, #0x1 cset w0, eq // eq = none ret With this change the assembly for each RETURN op is identical to the corresponding FETCH op (including barriers and clobbers) so I've removed the inline assembly and rewritten each RETURN op in terms of the corresponding FETCH op, e.g. | static inline void __lse_atomic_add_return(int i, atomic_t *v) | { | return __lse_atomic_fetch_add(i, v) + i | } The new construction does not adversely affect the common case, and before and after this patch GCC 11.1.0 can compile: __lse_atomic_add_return(i, v) As: ldaddal w0, w2, [x1] add w0, w0, w2 ... while having the freedom to do better elsewhere. This is intended as an optimization and cleanup. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Cc: Boqun Feng Cc: Peter Zijlstra Cc: Will Deacon Acked-by: Will Deacon Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20211210151410.2782645-6-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 8a578a759ad61b13240190a12cdfa8845c5fa949 Author: Mark Rutland Date: Fri Dec 10 15:14:09 2021 +0000 arm64: atomics: lse: improve constraints for simple ops We have overly conservative assembly constraints for the basic FEAT_LSE atomic instructions, and using more accurate and permissive constraints will allow for better code generation. The FEAT_LSE basic atomic instructions have come in two forms: LD{op}{order}{size} , , [] ST{op}{order}{size} , [] The ST* forms are aliases of the LD* forms where: ST{op}{order}{size} , [] Is: LD{op}{order}{size} , XZR, [] For either form, both and are read but not written back to, and is written with the original value of the memory location. Where ( == ) or ( == ), is written *after* the other register value(s) are consumed. There are no UNPREDICTABLE or CONSTRAINED UNPREDICTABLE behaviours when any pair of , , or are the same register. Our current inline assembly always uses == , treating this register as both an input and an output (using a '+r' constraint). This forces the compiler to do some unnecessary register shuffling and/or redundant value generation. For example, the compiler cannot reuse the value, and currently GCC 11.1.0 will compile: __lse_atomic_add(1, a); __lse_atomic_add(1, b); __lse_atomic_add(1, c); As: mov w3, #0x1 mov w4, w3 stadd w4, [x0] mov w0, w3 stadd w0, [x1] stadd w3, [x2] We can improve this with more accurate constraints, separating and , where is an input-only register ('r'), and is an output-only value ('=r'). As is written back after is consumed, it does not need to be earlyclobber ('=&r'), leaving the compiler free to use the same register for both and where this is desirable. At the same time, the redundant 'r' constraint for `v` is removed, as the `+Q` constraint is sufficient. With this change, the above example becomes: mov w3, #0x1 stadd w3, [x0] stadd w3, [x1] stadd w3, [x2] I've made this change for the non-value-returning and FETCH ops. The RETURN ops have a multi-instruction sequence for which we cannot use the same constraints, and a subsequent patch will rewrite hte RETURN ops in terms of the FETCH ops, relying on the ability for the compiler to reuse the value. This is intended as an optimization. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Cc: Boqun Feng Cc: Peter Zijlstra Cc: Will Deacon Acked-by: Will Deacon Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20211210151410.2782645-5-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 5e9e43c987b2614078b795d68eae6598eea3067a Author: Mark Rutland Date: Fri Dec 10 15:14:08 2021 +0000 arm64: atomics: lse: define ANDs in terms of ANDNOTs The FEAT_LSE atomic instructions include atomic bit-clear instructions (`ldclr*` and `stclr*`) which can be used to directly implement ANDNOT operations. Each AND op is implemented as a copy of the corresponding ANDNOT op with a leading `mvn` instruction to apply a bitwise NOT to the `i` argument. As the compiler has no visibility of the `mvn`, this leads to less than optimal code generation when generating `i` into a register. For example, __lse_atomic_fetch_and(0xf, v) can be compiled to: mov w1, #0xf mvn w1, w1 ldclral w1, w1, [x2] This patch improves this by replacing the `mvn` with NOT in C before the inline assembly block, e.g. i = ~i; This allows the compiler to generate `i` into a register more optimally, e.g. mov w1, #0xfffffff0 ldclral w1, w1, [x2] With this change the assembly for each AND op is identical to the corresponding ANDNOT op (including barriers and clobbers), so I've removed the inline assembly and rewritten each AND op in terms of the corresponding ANDNOT op, e.g. | static inline void __lse_atomic_and(int i, atomic_t *v) | { | return __lse_atomic_andnot(~i, v); | } This is intended as an optimization and cleanup. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Cc: Boqun Feng Cc: Peter Zijlstra Cc: Will Deacon Acked-by: Will Deacon Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20211210151410.2782645-4-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit ef53245060989d1cbe4b72ba56e94f217f4fd1ee Author: Mark Rutland Date: Fri Dec 10 15:14:07 2021 +0000 arm64: atomics lse: define SUBs in terms of ADDs The FEAT_LSE atomic instructions include atomic ADD instructions (`stadd*` and `ldadd*`), but do not include atomic SUB instructions, so we must build all of the SUB operations using the ADD instructions. We open-code these today, with each SUB op implemented as a copy of the corresponding ADD op with a leading `neg` instruction in the inline assembly to negate the `i` argument. As the compiler has no visibility of the `neg`, this leads to less than optimal code generation when generating `i` into a register. For example, __les_atomic_fetch_sub(1, v) can be compiled to: mov w1, #0x1 neg w1, w1 ldaddal w1, w1, [x2] This patch improves this by replacing the `neg` with negation in C before the inline assembly block, e.g. i = -i; This allows the compiler to generate `i` into a register more optimally, e.g. mov w1, #0xffffffff ldaddal w1, w1, [x2] With this change the assembly for each SUB op is identical to the corresponding ADD op (including barriers and clobbers), so I've removed the inline assembly and rewritten each SUB op in terms of the corresponding ADD op, e.g. | static inline void __lse_atomic_sub(int i, atomic_t *v) | { | __lse_atomic_add(-i, v); | } For clarity I've moved the definition of each SUB op immediately after the corresponding ADD op, and used a single macro to create the RETURN forms of both ops. This is intended as an optimization and cleanup. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Cc: Boqun Feng Cc: Peter Zijlstra Cc: Will Deacon Acked-by: Will Deacon Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20211210151410.2782645-3-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 8e6082e94aac6d0338883b5953631b662a5a9188 Author: Mark Rutland Date: Fri Dec 10 15:14:06 2021 +0000 arm64: atomics: format whitespace consistently The code for the atomic ops is formatted inconsistently, and while this is not a functional problem it is rather distracting when working on them. Some have ops have consistent indentation, e.g. | #define ATOMIC_OP_ADD_RETURN(name, mb, cl...) \ | static inline int __lse_atomic_add_return##name(int i, atomic_t *v) \ | { \ | u32 tmp; \ | \ | asm volatile( \ | __LSE_PREAMBLE \ | " ldadd" #mb " %w[i], %w[tmp], %[v]\n" \ | " add %w[i], %w[i], %w[tmp]" \ | : [i] "+r" (i), [v] "+Q" (v->counter), [tmp] "=&r" (tmp) \ | : "r" (v) \ | : cl); \ | \ | return i; \ | } While others have negative indentation for some lines, and/or have misaligned trailing backslashes, e.g. | static inline void __lse_atomic_##op(int i, atomic_t *v) \ | { \ | asm volatile( \ | __LSE_PREAMBLE \ | " " #asm_op " %w[i], %[v]\n" \ | : [i] "+r" (i), [v] "+Q" (v->counter) \ | : "r" (v)); \ | } This patch makes the indentation consistent and also aligns the trailing backslashes. This makes the code easier to read for those (like myself) who are easily distracted by these inconsistencies. This is intended as a cleanup. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Cc: Boqun Feng Cc: Peter Zijlstra Cc: Will Deacon Acked-by: Will Deacon Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20211210151410.2782645-2-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit fe4c82a7e0f06abdf5a6978aa00457b63bd46680 Author: Dany Madden Date: Tue Dec 14 00:17:48 2021 -0500 ibmvnic: remove unused defines IBMVNIC_STATS_TIMEOUT and IBMVNIC_INIT_FAILED are not used in the driver. Remove them. Suggested-by: Sukadev Bhattiprolu Signed-off-by: Dany Madden Signed-off-by: David S. Miller commit b6ee566cf3940883d67c0d142fae8d410e975f47 Author: Dany Madden Date: Tue Dec 14 00:17:47 2021 -0500 ibmvnic: Update driver return codes Update return codes to be more informative. Signed-off-by: Jacob Root Signed-off-by: Dany Madden Signed-off-by: David S. Miller commit dc91e3be837ced738d04a4dc8aefc338e8f79235 Author: David S. Miller Date: Tue Dec 14 12:53:41 2021 +0000 Revert "pktgen: use min() to make code cleaner" This reverts commit 13510fef48a3803d9ee8f044b015dacfb06fe0f5. Causes build warnings. Signed-off-by: David S. Miller commit 13510fef48a3803d9ee8f044b015dacfb06fe0f5 Author: Changcheng Deng Date: Tue Dec 14 11:44:47 2021 +0000 pktgen: use min() to make code cleaner Use min() in order to make code cleaner. Issue found by coccinelle. Reported-by: Zeal Robot Signed-off-by: Changcheng Deng Reviewed-by: Muchun Song Signed-off-by: David S. Miller commit 256f8d72a51e77d1eaab6094a3d6ae4978d1dbd0 Merge: b4bffa4ceab1b 7f2973149c22e Author: David S. Miller Date: Tue Dec 14 12:45:16 2021 +0000 Merge branch 'dsa-fixups' Vladimir Oltean says: ==================== DSA tagger-owned storage fixups It seems that the DSA tagger-owned storage changes were insufficiently tested and do not work in all cases. Specifically, the NXP Bluebox 3 (arch/arm64/boot/dts/freescale/fsl-lx2160a-bluebox3.dts) got broken by these changes, because (a) I forgot that DSA_TAG_PROTO_SJA1110 exists and differs from DSA_TAG_PROTO_SJA1105 (b) the Bluebox 3 uses a DSA switch tree with 2 switches, and the tagger-owned storage patches don't cover that use case well, it seems Therefore, I'm sorry to say that there needs to be an API fixup: tagging protocol drivers will from now on connect to individual switches from a tree, rather than to the tree as a whole. This is more robust against various ordering constraints in the DSA probe and teardown paths, and is also symmetrical with the connection API exposed to the switch drivers themselves, which is also per switch. With these changes, the Bluebox 3 also works fine. ==================== Signed-off-by: David S. Miller commit 7f2973149c22e7a6fee4c0c9fa6b8e4108e9c208 Author: Vladimir Oltean Date: Tue Dec 14 03:45:36 2021 +0200 net: dsa: make tagging protocols connect to individual switches from a tree On the NXP Bluebox 3 board which uses a multi-switch setup with sja1105, the mechanism through which the tagger connects to the switch tree is broken, due to improper DSA code design. At the time when tag_ops->connect() is called in dsa_port_parse_cpu(), DSA hasn't finished "touching" all the ports, so it doesn't know how large the tree is and how many ports it has. It has just seen the first CPU port by this time. As a result, this function will call the tagger's ->connect method too early, and the tagger will connect only to the first switch from the tree. This could be perhaps addressed a bit more simply by just moving the tag_ops->connect(dst) call a bit later (for example in dsa_tree_setup), but there is already a design inconsistency at present: on the switch side, the notification is on a per-switch basis, but on the tagger side, it is on a per-tree basis. Furthermore, the persistent storage itself is per switch (ds->tagger_data). And the tagger connect and disconnect procedures (at least the ones that exist currently) could see a fair bit of simplification if they didn't have to iterate through the switches of a tree. To fix the issue, this change transforms tag_ops->connect(dst) into tag_ops->connect(ds) and moves it somewhere where we already iterate over all switches of a tree. That is in dsa_switch_setup_tag_protocol(), which is a good placement because we already have there the connection call to the switch side of things. As for the dsa_tree_bind_tag_proto() method (called from the code path that changes the tag protocol), things are a bit more complicated because we receive the tree as argument, yet when we unwind on errors, it would be nice to not call tag_ops->disconnect(ds) where we didn't previously call tag_ops->connect(ds). We didn't have this problem before because the tag_ops connection operations passed the entire dst before, and this is more fine grained now. To solve the error rewind case using the new API, we have to create yet one more cross-chip notifier for disconnection, and stay connected with the old tag protocol to all the switches in the tree until we've succeeded to connect with the new one as well. So if something fails half way, the whole tree is still connected to the old tagger. But there may still be leaks if the tagger fails to connect to the 2nd out of 3 switches in a tree: somebody needs to tell the tagger to disconnect from the first switch. Nothing comes for free, and this was previously handled privately by the tagging protocol driver before, but now we need to emit a disconnect cross-chip notifier for that, because DSA has to take care of the unwind path. We assume that the tagging protocol has connected to a switch if it has set ds->tagger_data to something, otherwise we avoid calling its disconnection method in the error rewind path. The rest of the changes are in the tagging protocol drivers, and have to do with the replacement of dst with ds. The iteration is removed and the error unwind path is simplified, as mentioned above. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit c8a2a011cd04054a6577d8cf774adf9e09302876 Author: Vladimir Oltean Date: Tue Dec 14 03:45:35 2021 +0200 net: dsa: sja1105: fix broken connection with the sja1110 tagger The driver was incorrectly converted assuming that "sja1105" is the only tagger supported by this driver. This results in SJA1110 switches failing to probe: sja1105 spi1.0: Unable to connect to tag protocol "sja1110": -EPROTONOSUPPORT sja1105: probe of spi1.2 failed with error -93 Add DSA_TAG_PROTO_SJA1110 to the list of supported taggers by the sja1105 driver. The sja1105_tagger_data structure format is common for the two tagging protocols. Fixes: c79e84866d2a ("net: dsa: tag_sja1105: convert to tagger-owned data") Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit e2f01bfe1406f82a45ab0ce8ed90dbef1c464502 Author: Vladimir Oltean Date: Tue Dec 14 03:45:34 2021 +0200 net: dsa: tag_sja1105: fix zeroization of ds->priv on tag proto disconnect The method was meant to zeroize ds->tagger_data but got the wrong pointer. Fix this. Fixes: c79e84866d2a ("net: dsa: tag_sja1105: convert to tagger-owned data") Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller commit b4bffa4ceab1be0e4cc39aa56c0746a63e5d3c6f Author: Guillaume Nault Date: Mon Dec 13 19:17:17 2021 +0100 bareudp: Add extack support to bareudp_configure() Add missing extacks for common configuration errors. Signed-off-by: Guillaume Nault Signed-off-by: David S. Miller commit 0976b888a150476ba955ce4765858824c633cfd2 Author: Jakub Kicinski Date: Mon Dec 13 17:39:02 2021 -0800 ethtool: fix null-ptr-deref on ref tracker dev can be a NULL here, not all requests set require_dev. Fixes: e4b8954074f6 ("netlink: add net device refcount tracker to struct ethnl_req_info") Signed-off-by: Jakub Kicinski Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit a9aa5e3320ae9d322091993e4ed1b7e7651f00a1 Author: Sebastian Andrzej Siewior Date: Mon Dec 13 17:29:31 2021 +0100 net: dev: Change the order of the arguments for the contended condition. Change the order of arguments and make qdisc_is_running() appear first. This is more readable for the general case. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: David S. Miller commit 09eb3ad55fef8d62edb74d5fe3a6720b6b467463 Merge: 60bf9b33c82c0 94185adbfad56 Author: Thomas Gleixner Date: Tue Dec 14 13:30:34 2021 +0100 Merge branch 'irq/urgent' into irq/msi to pick up the PCI/MSI-x fixes. Signed-off-by: Thomas Gleixner commit 8404b0fbc7fbd42e5c5d28cdedd450e70829c77a Author: Qi Liu Date: Thu Dec 2 16:06:33 2021 +0800 drivers/perf: hisi: Add driver for HiSilicon PCIe PMU PCIe PMU Root Complex Integrated End Point(RCiEP) device is supported to sample bandwidth, latency, buffer occupation etc. Each PMU RCiEP device monitors multiple Root Ports, and each RCiEP is registered as a PMU in /sys/bus/event_source/devices, so users can select target PMU, and use filter to do further sets. Filtering options contains: event - select the event. port - select target Root Ports. Information of Root Ports are shown under sysfs. bdf - select requester_id of target EP device. trig_len - set trigger condition for starting event statistics. trig_mode - set trigger mode. 0 means starting to statistic when bigger than trigger condition, and 1 means smaller. thr_len - set threshold for statistics. thr_mode - set threshold mode. 0 means count when bigger than threshold, and 1 means smaller. Acked-by: Krzysztof Wilczyński Reviewed-by: John Garry Signed-off-by: Qi Liu Reviewed-by: Shaokun Zhang Link: https://lore.kernel.org/r/20211202080633.2919-3-liuqi115@huawei.com Signed-off-by: Will Deacon commit c8602008e247f5603317c16f076565a96715e1ba Author: Qi Liu Date: Thu Dec 2 16:06:32 2021 +0800 docs: perf: Add description for HiSilicon PCIe PMU driver PCIe PMU Root Complex Integrated End Point(RCiEP) device is supported on HiSilicon HIP09 platform. Document it to provide guidance on how to use it. Reviewed-by: John Garry Signed-off-by: Qi Liu Reviewed-by: Shaokun Zhang Link: https://lore.kernel.org/r/20211202080633.2919-2-liuqi115@huawei.com Signed-off-by: Will Deacon commit d0c3e46484fb9bafcfb0648da919f91eea7e14cd Merge: a3c62a042237d 085d610008451 Author: David S. Miller Date: Tue Dec 14 12:28:25 2021 +0000 Merge branch 'hwtstamp_bonding' Hangbin Liu says: ==================== net: add new hwtstamp flag HWTSTAMP_FLAG_BONDED_PHC_INDEX This patchset add a new hwtstamp_config flag HWTSTAMP_FLAG_BONDED_PHC_INDEX. When user want to get bond active interface's PHC, they need to add this flag and aware the PHC index may changed. v3: Use bitwise test to check the flags validation v2: rename the flag to HWTSTAMP_FLAG_BONDED_PHC_INDEX ==================== Signed-off-by: David S. Miller commit 085d61000845188a9aa9a9524f13a0622a1380d7 Author: Hangbin Liu Date: Fri Dec 10 16:59:59 2021 +0800 Bonding: force user to add HWTSTAMP_FLAG_BONDED_PHC_INDEX when get/set HWTSTAMP When there is a failover, the PHC index of bond active interface will be changed. This may break the user space program if the author didn't aware. By setting this flag, the user should aware that the PHC index get/set by syscall is not stable. And the user space is able to deal with it. Without this flag, the kernel will reject the request forwarding to bonding. Reported-by: Jakub Kicinski Fixes: 94dd016ae538 ("bond: pass get_ts_info and SIOC[SG]HWTSTAMP ioctl to active device") Signed-off-by: Hangbin Liu Signed-off-by: David S. Miller commit 9c9211a3fc7aa41b2952765b62000443b3bb6f23 Author: Hangbin Liu Date: Fri Dec 10 16:59:58 2021 +0800 net_tstamp: add new flag HWTSTAMP_FLAG_BONDED_PHC_INDEX Since commit 94dd016ae538 ("bond: pass get_ts_info and SIOC[SG]HWTSTAMP ioctl to active device") the user could get bond active interface's PHC index directly. But when there is a failover, the bond active interface will change, thus the PHC index is also changed. This may break the user's program if they did not update the PHC timely. This patch adds a new hwtstamp_config flag HWTSTAMP_FLAG_BONDED_PHC_INDEX. When the user wants to get the bond active interface's PHC, they need to add this flag and be aware the PHC index may be changed. With the new flag. All flag checks in current drivers are removed. Only the checking in net_hwtstamp_validate() is kept. Suggested-by: Jakub Kicinski Signed-off-by: Hangbin Liu Signed-off-by: David S. Miller commit 4cbf47728f8d9d18e7e43863c0b623351267f203 Author: Bhaskara Budiredla Date: Mon Nov 15 10:05:06 2021 +0530 dt-bindings: perf: Add YAML schemas for Marvell CN10K LLC-TAD pmu bindings Add device tree bindings for Last-level-cache Tag-and-data (LLC-TAD) unit PMU for Marvell CN10K SoCs. Signed-off-by: Bhaskara Budiredla Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211115043506.6679-3-bbudiredla@marvell.com Signed-off-by: Will Deacon commit 036a7584bede317d0df6b854e4f531b7a2dd8b33 Author: Bhaskara Budiredla Date: Mon Nov 15 10:05:05 2021 +0530 drivers: perf: Add LLC-TAD perf counter support This driver adds support for Last-level cache tag-and-data unit (LLC-TAD) PMU that is featured in some of the Marvell's CN10K infrastructure silicons. The LLC is divided into 2N slices distributed across N Mesh tiles in a single-socket configuration. The driver always configures the same counter for all of the TADs. The user would end up effectively reserving one of eight counters in every TAD to look across all TADs. The occurrences of events are aggregated and presented to the user at the end of an application run. The driver does not provide a way for the user to partition TADs so that different TADs are used for different applications. The event counters are zeroed to start event counting to avoid any rollover issues. TAD perf counters are 64-bit, so it's not currently possible to overflow event counters at current mesh and core frequencies. To measure tad pmu events use perf tool stat command. For instance: perf stat -e tad_dat_msh_in_dss,tad_req_msh_out_any perf stat -e tad_alloc_any,tad_hit_any,tad_tag_rd Signed-off-by: Bhaskara Budiredla Link: https://lore.kernel.org/r/20211115043506.6679-2-bbudiredla@marvell.com Signed-off-by: Will Deacon commit 2c54b423cf85baed5ad9f9546f6c8ea741774a06 Author: Ard Biesheuvel Date: Mon Dec 13 15:02:52 2021 +0100 arm64/xor: use EOR3 instructions when available Use the EOR3 instruction to implement xor_blocks() if the instruction is available, which is the case if the CPU implements the SHA-3 extension. This is about 20% faster on Apple M1 when using the 5-way version. Signed-off-by: Ard Biesheuvel Link: https://lore.kernel.org/r/20211213140252.2856053-1-ardb@kernel.org Signed-off-by: Catalin Marinas commit df457ca973fee9e66d0d688afa6605d053034cd2 Author: Robin Murphy Date: Wed Nov 17 14:48:45 2021 +0000 perf/smmuv3: Synthesize IIDR from CoreSight ID registers The SMMU_PMCG_IIDR register was not present in older revisions of the Arm SMMUv3 spec. On Arm Ltd. implementations, the IIDR value consists of fields from several PIDR registers, allowing us to present a standardized identifier to userspace. Signed-off-by: Robin Murphy Signed-off-by: Jean-Philippe Brucker Link: https://lore.kernel.org/r/20211117144844.241072-4-jean-philippe@linaro.org Signed-off-by: Will Deacon commit 3f7be43561766b7ad91661580376913c997613d6 Author: Jean-Philippe Brucker Date: Wed Nov 17 14:48:44 2021 +0000 perf/smmuv3: Add devicetree support Add device-tree support to the SMMUv3 PMCG driver. Signed-off-by: Jay Chen Signed-off-by: Jean-Philippe Brucker Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/20211117144844.241072-3-jean-philippe@linaro.org Signed-off-by: Will Deacon commit 2704e7594383c0275dcb65e05408260ad34f3e15 Author: Jean-Philippe Brucker Date: Wed Nov 17 14:48:43 2021 +0000 dt-bindings: Add Arm SMMUv3 PMCG binding Add binding for the Arm SMMUv3 PMU. Each node represents a PMCG, and is placed as a sibling node of the SMMU. Although the PMCGs registers may be within the SMMU MMIO region, they are separate devices, and there can be multiple PMCG devices for each SMMU (for example one for the TCU and one for each TBU). Signed-off-by: Jean-Philippe Brucker Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/20211117144844.241072-2-jean-philippe@linaro.org Signed-off-by: Will Deacon commit a88fa6c28b867a387e3af202d6dbbb754d3aa2f1 Author: Robin Murphy Date: Fri Dec 3 11:45:03 2021 +0000 perf/arm-cmn: Add debugfs topology info In general, detailed performance analysis will require knoweldge of the the SoC beyond the CMN itself - e.g. which actual CPUs/peripherals/etc. are connected to each node. However for certain development and bringup tasks it can be useful to have a quick overview of the CMN internal topology to hand too. Add a debugfs file to map this out. Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/159fd4d7e19fb3c8801a8cb64ee73ec50f55903c.1638530442.git.robin.murphy@arm.com Signed-off-by: Will Deacon commit b2fea780c9282dbaf77ef081e6d97a3f2c0dfc6a Author: Robin Murphy Date: Fri Dec 3 11:45:02 2021 +0000 perf/arm-cmn: Add CI-700 Support Add the identifiers and events for the CI-700 coherent interconnect. Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/28f566ab23a83733c6c9ef9414c010b760b4549c.1638530442.git.robin.murphy@arm.com Signed-off-by: Will Deacon commit e310644724e195b79cf8114ca5297e4cdb36c955 Author: Robin Murphy Date: Fri Dec 3 11:45:01 2021 +0000 dt-bindings: perf: arm-cmn: Add CI-700 CI-700 is a new client-level coherent interconnect derived from the enterprise-level CMN family, and shares the same PMU design. CC: devicetree@vger.kernel.org Signed-off-by: Robin Murphy Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/5f0b372f808f1468e6d9500cedafbecd10254674.1638530442.git.robin.murphy@arm.com Signed-off-by: Will Deacon commit 60d1504070c22c059a1e11bc3fd444953da988c1 Author: Robin Murphy Date: Fri Dec 3 11:45:00 2021 +0000 perf/arm-cmn: Support new IP features The second generation of CMN IPs add new node types and significantly expand the configuration space with options for extra device ports on edge XPs, either plumbed into the regular DTM or with extra dedicated DTMs to monitor them, plus larger (and smaller) mesh sizes. Add basic support for pulling this new information out of the hardware, piping it around as necessary, and handling (most of) the new choices. Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/e58b495bcc7deec3882be4bac910ed0bf6979674.1638530442.git.robin.murphy@arm.com Signed-off-by: Will Deacon commit 61ec1d875812046ff9d473183d53e19dcd6b2ada Author: Robin Murphy Date: Fri Dec 3 11:44:59 2021 +0000 perf/arm-cmn: Demarcate CMN-600 specifics In preparation for supporting newer CMN products, let's introduce a means to differentiate the features and events which are specific to a particular IP from those which remain common to the whole family. The newer designs have also smoothed off some of the rough edges in terms of discoverability, so separate out the parts of the flow which have effectively now become CMN-600 quirks. Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/9f6368cdca4c821d801138939508a5bba54ccabb.1638530442.git.robin.murphy@arm.com Signed-off-by: Will Deacon commit 558a07807038017255005a4820f600da643d8a5f Author: Robin Murphy Date: Fri Dec 3 11:44:58 2021 +0000 perf/arm-cmn: Move group validation data off-stack With the value of CMN_MAX_DTMS increasing significantly, our validation data structure is set to get quite big. Technically we could pack it at least twice as densely, since we only need around 19 bits of information per DTM, but that makes the code even more mind-bogglingly impenetrable, and even half of "quite big" may still be uncomfortably large for a stack frame (~1KB). Just move it to an off-stack allocation instead. Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/0cabff2e5839ddc0979e757c55515966f65359e4.1638530442.git.robin.murphy@arm.com Signed-off-by: Will Deacon commit 4f2c3872dde55090bf39e1f12a8517a32b6cd048 Author: Robin Murphy Date: Fri Dec 3 11:44:57 2021 +0000 perf/arm-cmn: Optimise DTC counter accesses In cases where we do know which DTC domain a node belongs to, we can skip initialising or reading the global count in DTCs where we know it won't change. The machinery to achieve that is mostly in place already, so finish hooking it up by converting the vestigial domain tracking to propagate suitable bitmaps all the way through to events. Note that this does not allow allocating such an unused counter to a different event on that DTC, because that is a flippin' nightmare. Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/51d930fd945ef51c81f5889ccca055c302b0a1d0.1638530442.git.robin.murphy@arm.com Signed-off-by: Will Deacon commit 847eef94e6327dd7690bfac0bd3a81a7ba6aa1ee Author: Robin Murphy Date: Fri Dec 3 11:44:56 2021 +0000 perf/arm-cmn: Optimise DTM counter reads When multiple nodes of the same type are connected to the same XP (particularly in CAL configurations), it seems that they are likely to be consecutive in logical ID. Therefore, we're likely to gain a small benefit from an easy tweak to optimise out consecutive reads of the same set of DTM counters for an aggregated event. Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/7777d77c2df17693cd3dabb6e268906e15238d82.1638530442.git.robin.murphy@arm.com Signed-off-by: Will Deacon commit 0947c80aba23972987a88e620812d17a7af27297 Author: Robin Murphy Date: Fri Dec 3 11:44:55 2021 +0000 perf/arm-cmn: Refactor DTM handling Untangle DTMs from XPs into a dedicated abstraction. This helps make things a little more obvious and robust, but primarily paves the way for further development where new IPs can grow extra DTMs per XP. Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/9cca18b1b98f482df7f1aaf3d3213e7f39500423.1638530442.git.robin.murphy@arm.com Signed-off-by: Will Deacon commit da5f7d2c8019c9dd053e2d94fdc1b3e7c03c35a5 Author: Robin Murphy Date: Fri Dec 3 11:44:54 2021 +0000 perf/arm-cmn: Streamline node iteration Refactor the places where we scan through the set of nodes to switch from explicit array indexing to pointer-based iteration. This leads to slightly simpler object code, but also makes the source less dense and more pleasant for further development. It also unearths an almost-bug in arm_cmn_event_init() where we've been depending on the "array index" of NULL relative to cmn->dns being a sufficiently large number, yuck. Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/ee0c9eda9a643f46001ac43aadf3f0b1fd5660dd.1638530442.git.robin.murphy@arm.com Signed-off-by: Will Deacon commit 5f167eab83f153c2c6f80cfe419e269d5f481b09 Author: Robin Murphy Date: Fri Dec 3 11:44:53 2021 +0000 perf/arm-cmn: Refactor node ID handling Add a bit more abstraction for the places where we decompose node IDs. This will help keep things nice and manageable when we come to add yet more variables which affect the node ID format. Also use the opportunity to move the rest of the low-level node management helpers back up to the logical place they were meant to be - how they ended up buried right in the middle of the event-related definitions is somewhat of a mystery... Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/a2242a8c3c96056c13a04ae87bf2047e5e64d2d9.1638530442.git.robin.murphy@arm.com Signed-off-by: Will Deacon commit 82d8ea4b450074e81748830929bbd94eebbaffea Author: Robin Murphy Date: Fri Dec 3 11:44:52 2021 +0000 perf/arm-cmn: Drop compile-test restriction Although CMN is currently (and overwhelmingly likely to remain) deployed in arm64-only (modulo userspace) systems, the 64-bit "dependency" for compile-testing was just laziness due to heavy reliance on readq/writeq accessors. Since we only need one extra include for robustness in that regard, let's pull that in, widen the compile-test coverage, and fix up the smattering of type laziness that that brings to light. Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/baee9ee0d0bdad8aaeb70f5a4b98d8fd4b1f5786.1638530442.git.robin.murphy@arm.com Signed-off-by: Will Deacon commit 6190741c294d1cad15198d5d2f912868434fa492 Author: Robin Murphy Date: Fri Dec 3 11:44:51 2021 +0000 perf/arm-cmn: Account for NUMA affinity On a system with multiple CMN meshes, ideally we'd want to access each PMU from within its own mesh, rather than with a long CML round-trip, wherever feasible. Since such a system is likely to be presented as multiple NUMA nodes, let's also hope a proximity domain is specified for each CMN programming interface, and use that to guide our choice of IRQ affinity to favour a node-local CPU where possible. Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/32438b0d016e0649d882d47d30ac2000484287b9.1638530442.git.robin.murphy@arm.com Signed-off-by: Will Deacon commit 56c7c6eaf3eb8ac1ec40d56096c0f2b27250da5f Author: Robin Murphy Date: Fri Dec 3 11:44:50 2021 +0000 perf/arm-cmn: Fix CPU hotplug unregistration Attempting to migrate the PMU context after we've unregistered the PMU device, or especially if we never successfully registered it in the first place, is a woefully bad idea. It's also fundamentally pointless anyway. Make sure to unregister an instance from the hotplug handler *without* invoking the teardown callback. Fixes: 0ba64770a2f2 ("perf: Add Arm CMN-600 PMU driver") Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/2c221d745544774e4b07583b65b5d4d94f7e0fe4.1638530442.git.robin.murphy@arm.com Signed-off-by: Will Deacon commit 63fa47ba886b86cbd58f03b3b01b04bd57a1f233 Author: Sean Christopherson Date: Mon Dec 13 17:45:56 2021 +0000 KVM: PPC: Book3S HV P9: Use kvm_arch_vcpu_get_wait() to get rcuwait object Use kvm_arch_vcpu_get_wait() to get a vCPU's rcuwait object instead of using vcpu->wait directly in kvmhv_run_single_vcpu(). Functionally, this is a nop as vcpu->arch.waitp is guaranteed to point at vcpu->wait. But that is not obvious at first glance, and a future change coming in via the KVM tree, commit 510958e99721 ("KVM: Force PPC to define its own rcuwait object"), will hide vcpu->wait from architectures that define __KVM_HAVE_ARCH_WQP to prevent generic KVM from attepting to wake a vCPU with the wrong rcuwait object. Reported-by: Sachin Sant Signed-off-by: Sean Christopherson Tested-by: Sachin Sant Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211213174556.3871157-1-seanjc@google.com commit aa1005d15d2aee10e5b93a25db076c47e05c4efa Author: Raphael Gault Date: Wed Dec 8 14:11:24 2021 -0600 Documentation: arm64: Document PMU counters access from userspace Add documentation to describe the access to the pmu hardware counters from userspace. Signed-off-by: Raphael Gault Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211208201124.310740-6-robh@kernel.org Signed-off-by: Will Deacon commit 83a7a4d643d33a8b74a42229346b7ed7139fcef9 Author: Rob Herring Date: Wed Dec 8 14:11:23 2021 -0600 arm64: perf: Enable PMU counter userspace access for perf event Arm PMUs can support direct userspace access of counters which allows for low overhead (i.e. no syscall) self-monitoring of tasks. The same feature exists on x86 called 'rdpmc'. Unlike x86, userspace access will only be enabled for thread bound events. This could be extended if needed, but simplifies the implementation and reduces the chances for any information leaks (which the x86 implementation suffers from). PMU EL0 access will be enabled when an event with userspace access is part of the thread's context. This includes when the event is not scheduled on the PMU. There's some additional overhead clearing dirty counters when access is enabled in order to prevent leaking disabled counter data from other tasks. Unlike x86, enabling of userspace access must be requested with a new attr bit: config1:1. If the user requests userspace access with 64-bit counters, then the event open will fail if the h/w doesn't support 64-bit counters. Chaining is not supported with userspace access. The modes for config1 are as follows: config1 = 0 : user access disabled and always 32-bit config1 = 1 : user access disabled and always 64-bit (using chaining if needed) config1 = 2 : user access enabled and always 32-bit config1 = 3 : user access enabled and always 64-bit Based on work by Raphael Gault , but has been completely re-written. Cc: Will Deacon Cc: Mark Rutland Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Namhyung Kim Cc: Catalin Marinas Cc: linux-arm-kernel@lists.infradead.org Cc: linux-perf-users@vger.kernel.org Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211208201124.310740-5-robh@kernel.org [will: Made armv8pmu_proc_user_access_handler() static] Signed-off-by: Will Deacon commit e2012600810c9ded81f6f63a8d04781be3c300ad Author: Rob Herring Date: Wed Dec 8 14:11:22 2021 -0600 arm64: perf: Add userspace counter access disable switch Like x86, some users may want to disable userspace PMU counter altogether. Add a sysctl 'perf_user_access' file to control userspace counter access. The default is '0' which is disabled. Writing '1' enables access. Note that x86 supports globally enabling user access by writing '2' to /sys/bus/event_source/devices/cpu/rdpmc. As there's not existing userspace support to worry about, this shouldn't be necessary for Arm. It could be added later if the need arises. Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Namhyung Kim Cc: Catalin Marinas Cc: linux-perf-users@vger.kernel.org Acked-by: Will Deacon Reviewed-by: Mark Rutland Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211208201124.310740-4-robh@kernel.org Signed-off-by: Will Deacon commit 82ff0c022d19c2ad69a472692bb7ee01ac07a40b Author: Rob Herring Date: Wed Dec 8 14:11:21 2021 -0600 perf: Add a counter for number of user access events in context On arm64, user space counter access will be controlled differently compared to x86. On x86, access in the strictest mode is enabled for all tasks in an MM when any event is mmap'ed. For arm64, access is explicitly requested for an event and only enabled when the event's context is active. This avoids hooks into the arch context switch code and gives better control of when access is enabled. In order to configure user space access when the PMU is enabled, it is necessary to know if any event (currently active or not) in the current context has user space accessed enabled. Add a counter similar to other counters in the context to avoid walking the event list every time. Reviewed-by: Mark Rutland Reviewed-by: Thomas Gleixner Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211208201124.310740-3-robh@kernel.org Signed-off-by: Will Deacon commit 369461ce8fb6c8156206c7110d7da48e9fbc41bb Author: Rob Herring Date: Wed Dec 8 14:11:20 2021 -0600 x86: perf: Move RDPMC event flag to a common definition In preparation to enable user counter access on arm64 and to move some of the user access handling to perf core, create a common event flag for user counter access and convert x86 to use it. Since the architecture specific flags start at the LSB, starting at the MSB for common flags. Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Namhyung Kim Cc: Kan Liang Cc: Thomas Gleixner Cc: Borislav Petkov Cc: x86@kernel.org Cc: "H. Peter Anvin" Cc: linux-perf-users@vger.kernel.org Reviewed-by: Mark Rutland Reviewed-by: Thomas Gleixner Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211208201124.310740-2-robh@kernel.org Signed-off-by: Will Deacon commit 88404c56fde05eb741552a33fdfe6d7d20c1c986 Author: Biju Das Date: Wed Dec 8 14:27:29 2021 +0000 arm64: dts: renesas: r9a07g044: Create thermal zone to support IPA Setup a thermal zone driven by SoC temperature sensor. Create passive trip points and bind them to CPUFreq cooling device that supports power extension. Based on the work done by Dien Pham and others for r8a77990 SoC. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211208142729.2456-3-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 844dd4378453ad8234498ebc330887209e8ad346 Author: Biju Das Date: Wed Dec 8 14:27:28 2021 +0000 arm64: dts: renesas: r9a07g044: Add TSU node Add TSU node to RZ/G2L SoC DTSI. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211208142729.2456-2-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 5a6bca1ff7a50d2613c3074f00d2768af1aff120 Author: Kieran Bingham Date: Tue Nov 30 16:43:11 2021 +0000 arm64: dts: renesas: falcon-cpu: Add DSI display output Provide the display output using the sn65dsi86 MIPI DSI bridge. Reviewed-by: Laurent Pinchart Signed-off-by: Kieran Bingham Link: https://lore.kernel.org/r/20211130164311.2909616-3-kieran.bingham+renesas@ideasonboard.com Signed-off-by: Geert Uytterhoeven commit b2db714bc9a6dcf3636d2c5b1053cf43c0a700d9 Author: Kieran Bingham Date: Tue Nov 30 16:43:10 2021 +0000 arm64: dts: renesas: r8a779a0: Add DSI encoders Provide the two MIPI DSI encoders on the V3U and connect them to the DU accordingly. Reviewed-by: Laurent Pinchart Signed-off-by: Kieran Bingham Link: https://lore.kernel.org/r/20211130164311.2909616-2-kieran.bingham+renesas@ideasonboard.com Signed-off-by: Geert Uytterhoeven commit 43d5ac7d07023cd133b978de473b3400edad941f Author: Simon Ser Date: Tue Nov 23 11:24:04 2021 +0000 drm: document DRM_IOCTL_MODE_GETFB2 There are a few details specific to the GETFB2 IOCTL. It's not immediately clear how user-space should check for the number of planes. Suggest using the handles field or the pitches field. The modifier array is filled with zeroes, ie. DRM_FORMAT_MOD_LINEAR. So explicitly tell user-space to not look at it unless the flag is set. Changes in v2 (Daniel): - Mention that handles should be used to compute the number of planes, and only refer to pitches as a fallback. - Reword bit about undefined modifier. Signed-off-by: Simon Ser Acked-by: Daniel Vetter Acked-by: Pekka Paalanen Acked-by: Daniel Stone Link: https://patchwork.freedesktop.org/patch/msgid/20211123112400.22245-1-contact@emersion.fr commit b60d3c803d7603432a08aeaf988aff53b3a5ec64 Author: Alistair Francis Date: Wed Dec 8 22:40:44 2021 +1000 HID: i2c-hid-of: Expose the touchscreen-inverted properties Allow the touchscreen-inverted-x/y device tree properties to control the HID_QUIRK_X_INVERT/HID_QUIRK_Y_INVERT quirks for the hid-input device. Signed-off-by: Alistair Francis Acked-by: Rob Herring [bentiss: silence checkpatch warnings] Signed-off-by: Benjamin Tissoires Link: https://lore.kernel.org/r/20211208124045.61815-3-alistair@alistair23.me commit fd8d135b2c5e88662f2729e034913f183455a667 Author: Alistair Francis Date: Wed Dec 8 22:40:43 2021 +1000 HID: quirks: Allow inverting the absolute X/Y values Add a HID_QUIRK_X_INVERT/HID_QUIRK_Y_INVERT quirk that can be used to invert the X/Y values. Signed-off-by: Alistair Francis [bentiss: silence checkpatch warning] Signed-off-by: Benjamin Tissoires Link: https://lore.kernel.org/r/20211208124045.61815-2-alistair@alistair23.me commit c6e5bdae04a308942e755d53c5cc73d9f2fbf167 Merge: 5213313b9ad81 b98aee466d194 Author: Arnd Bergmann Date: Tue Dec 14 11:27:38 2021 +0100 Merge tag 'optee-async-notif-for-v5.17' of https://git.linaro.org/people/jens.wiklander/linux-tee into arm/drivers OP-TEE Asynchronous notifications from secure world Adds support in the SMC based OP-TEE driver to receive asynchronous notifications from secure world using an edge-triggered interrupt as delivery mechanism. * tag 'optee-async-notif-for-v5.17' of https://git.linaro.org/people/jens.wiklander/linux-tee: optee: Fix NULL but dereferenced coccicheck error optee: add asynchronous notifications optee: separate notification functions tee: export teedev_open() and teedev_close_context() tee: fix put order in teedev_close_context() dt-bindings: arm: optee: add interrupt property docs: staging/tee.rst: add a section on OP-TEE notifications Link: https://lore.kernel.org/r/20211213102359.GA1638682@jade Signed-off-by: Arnd Bergmann commit 073c3ab6ae0123601b5378e8f49c7b8ec4625f32 Author: Jeffle Xu Date: Thu Nov 25 15:05:30 2021 +0800 Documentation/filesystem/dax: DAX on virtiofs Record DAX on virtiofs and the semantic difference with that on ext4 and xfs. Signed-off-by: Jeffle Xu Reviewed-by: Vivek Goyal Signed-off-by: Miklos Szeredi commit c3cb6f935e322fa183988032e318b293d9e4fe53 Author: Jeffle Xu Date: Thu Nov 25 15:05:29 2021 +0800 fuse: mark inode DONT_CACHE when per inode DAX hint changes When the per inode DAX hint changes while the file is still *opened*, it is quite complicated and maybe fragile to dynamically change the DAX state. Hence mark the inode and corresponding dentries as DONE_CACHE once the per inode DAX hint changes, so that the inode instance will be evicted and freed as soon as possible once the file is closed and the last reference to the inode is put. And then when the file gets reopened next time, the new instantiated inode will reflect the new DAX state. In summary, when the per inode DAX hint changes for an *opened* file, the DAX state of the file won't be updated until this file is closed and reopened later. Signed-off-by: Jeffle Xu Reviewed-by: Vivek Goyal Signed-off-by: Miklos Szeredi commit 2ee019fadcca343c3deea6a1767965bdf23fc3d0 Author: Jeffle Xu Date: Thu Nov 25 15:05:28 2021 +0800 fuse: negotiate per inode DAX in FUSE_INIT Among the FUSE_INIT phase, client shall advertise per inode DAX if it's mounted with "dax=inode". Then server is aware that client is in per inode DAX mode, and will construct per-inode DAX attribute accordingly. Server shall also advertise support for per inode DAX. If server doesn't support it while client is mounted with "dax=inode", client will silently fallback to "dax=never" since "dax=inode" is advisory only. Signed-off-by: Jeffle Xu Reviewed-by: Vivek Goyal Signed-off-by: Miklos Szeredi commit 93a497b9ad695bb2f38a302c5b29dbc9b555ff3f Author: Jeffle Xu Date: Thu Nov 25 15:05:27 2021 +0800 fuse: enable per inode DAX DAX may be limited in some specific situation. When the number of usable DAX windows is under watermark, the recalim routine will be triggered to reclaim some DAX windows. It may have a negative impact on the performance, since some processes may need to wait for DAX windows to be recalimed and reused then. To mitigate the performance degradation, the overall DAX window need to be expanded larger. However, simply expanding the DAX window may not be a good deal in some scenario. To maintain one DAX window chunk (i.e., 2MB in size), 32KB (512 * 64 bytes) memory footprint will be consumed for page descriptors inside guest, which is greater than the memory footprint if it uses guest page cache when DAX disabled. Thus it'd better disable DAX for those files smaller than 32KB, to reduce the demand for DAX window and thus avoid the unworthy memory overhead. Per inode DAX feature is introduced to address this issue, by offering a finer grained control for dax to users, trying to achieve a balance between performance and memory overhead. The FUSE_ATTR_DAX flag in FUSE_LOOKUP reply is used to indicate whether DAX should be enabled or not for corresponding file. Currently the state whether DAX is enabled or not for the file is initialized only when inode is instantiated. Signed-off-by: Jeffle Xu Reviewed-by: Vivek Goyal Signed-off-by: Miklos Szeredi commit 98046f7486db723ec8bb99a950a4fa5f5be55cd1 Author: Jeffle Xu Date: Thu Nov 25 15:05:26 2021 +0800 fuse: support per inode DAX in fuse protocol Expand the fuse protocol to support per inode DAX. FUSE_HAS_INODE_DAX flag is added indicating if fuse server/client supporting per inode DAX. It can be conveyed in both FUSE_INIT request and reply. FUSE_ATTR_DAX flag is added indicating if DAX shall be enabled for corresponding file. It is conveyed in FUSE_LOOKUP reply. Signed-off-by: Jeffle Xu Reviewed-by: Vivek Goyal Signed-off-by: Miklos Szeredi commit 780b1b959f9bd959e1aca450e9fee0e2c00b31ad Author: Jeffle Xu Date: Thu Nov 25 15:05:25 2021 +0800 fuse: make DAX mount option a tri-state We add 'always', 'never', and 'inode' (default). '-o dax' continues to operate the same which is equivalent to 'always'. The following behavior is consistent with that on ext4/xfs: - The default behavior (when neither '-o dax' nor '-o dax=always|never|inode' option is specified) is equal to 'inode' mode, while 'dax=inode' won't be printed among the mount option list. - The 'inode' mode is only advisory. It will silently fallback to 'never' mode if fuse server doesn't support that. Also noted that by the time of this commit, 'inode' mode is actually equal to 'always' mode, before the per inode DAX flag is introduced in the following patch. Signed-off-by: Jeffle Xu Reviewed-by: Vivek Goyal Signed-off-by: Miklos Szeredi commit cecd491641c23f3c63958a62efb74cdaf3c93d7b Author: Jeffle Xu Date: Thu Nov 25 15:05:24 2021 +0800 fuse: add fuse_should_enable_dax() helper This is in prep for following per inode DAX checking. Signed-off-by: Jeffle Xu Reviewed-by: Vivek Goyal Signed-off-by: Miklos Szeredi commit 8590222e4b021054a7167a4dd35b152a8ed7018e Author: André Almeida Date: Tue Nov 30 10:29:57 2021 -0300 HID: hidraw: Replace hidraw device table mutex with a rwsem Currently, the table that stores information about the connected hidraw devices has a mutex to prevent concurrent hidraw users to manipulate the hidraw table (e.g. delete an entry) while someone is trying to use the table (e.g. issuing an ioctl to the device), preventing the kernel to referencing a NULL pointer. However, since that every user that wants to access the table for both manipulating it and reading it content, this prevents concurrent access to the table for read-only operations for different or the same device (e.g. two hidraw ioctls can't happen at the same time, even if they are completely unrelated). This proves to be a bottleneck and gives performance issues when using multiple HID devices at same time, like VR kits where one can have two controllers, the headset and some tracking sensors. To improve the performance, replace the table mutex with a read-write semaphore, enabling multiple threads to issue parallel syscalls to multiple devices at the same time while protecting the table for concurrent modifications. Signed-off-by: André Almeida Signed-off-by: Benjamin Tissoires Link: https://lore.kernel.org/r/20211130132957.8480-2-andrealmeid@collabora.com commit 5213313b9ad81d7f3d467236e714c8f174c2de95 Merge: 5b532920d74e2 168e05c131cd1 Author: Arnd Bergmann Date: Tue Dec 14 10:50:37 2021 +0100 Merge tag 'zynqmp-soc-for-v5.17' of https://github.com/Xilinx/linux-xlnx into arm/drivers arm64: dts: ZynqMP SoC changes for v5.17 - cleanup and fix PM_INIT_FINALIZE - check return value of zynqmp_pm_get_api_version() * tag 'zynqmp-soc-for-v5.17' of https://github.com/Xilinx/linux-xlnx: firmware: xilinx: check return value of zynqmp_pm_get_api_version() soc: xilinx: add a to_zynqmp_pm_domain macro soc: xilinx: use a properly named field instead of flags soc: xilinx: cleanup debug and error messages soc: xilinx: move PM_INIT_FINALIZE to zynqmp_pm_domains driver Link: https://lore.kernel.org/r/48dec441-2c1f-73a0-3e6c-aa0d7be5ba26@monstr.eu Signed-off-by: Arnd Bergmann commit 415e701cee5228f168049881624e343d9a3d97bb Author: chiminghao Date: Tue Nov 9 08:26:10 2021 +0000 HID: thrustmaster use swap() to make code cleaner Fix the following coccicheck REVIEW: Use swap() instead of reimplementing it. Reported-by: Zeal Robot Signed-off-by: chiminghao [bentiss: rewrote commit title] Signed-off-by: Benjamin Tissoires Link: https://lore.kernel.org/r/20211109082610.131341-1-chi.minghao@zte.com.cn commit bd56c63ca1d953f035c1a06a0431c106ffada849 Author: Chris Wilson Date: Wed Dec 8 21:04:04 2021 +0530 drm/i915: Test all device memory on probing This extends the previous sanitychecking of device memory to read/write all the memory on the device during the device probe, ala memtest86, as an optional module parameter: i915.memtest=1. This is not expected to be fast, but a reasonably thorough verfification that the device memory is accessible and doesn't return bit errors. v2: Rebased. Suggested-by: Matthew Auld Signed-off-by: Chris Wilson Cc: Matthew Auld Signed-off-by: Ramalingam C Reviewed-by: Matthew Auld Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20211208153404.27546-4-ramalingam.c@intel.com commit 2e21de9028270a72d2b7dfbd0fe46a6beace1f01 Author: Chris Wilson Date: Thu Dec 9 21:56:20 2021 +0530 drm/i915: Sanitycheck device iomem on probe As we setup the memory regions for the device, give each a quick test to verify that we can read and write to the full iomem range. This ensures that our physical addressing for the device's memory is correct, and some reassurance that the memory is functional. v2: wrapper for memtest [Chris] v3: Removed the unused ptr i915 [Chris] v4: used the %pa for the resource_size_t. Signed-off-by: Chris Wilson Cc: Matthew Auld Signed-off-by: Ramalingam C Reviewed-by: Matthew Auld Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20211209162620.5218-1-ramalingam.c@intel.com commit 0ef42fb749b17f7e49adef047ece5bebac5d6795 Author: Chris Wilson Date: Wed Dec 8 21:04:02 2021 +0530 drm/i915: Exclude reserved stolen from driver use Remove the portion of stolen memory reserved for private use from driver access. Signed-off-by: Chris Wilson cc: Matthew Auld Signed-off-by: Ramalingam C Reviewed-by: Matthew Auld Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20211208153404.27546-2-ramalingam.c@intel.com commit 99b03ca651f1c409d296d6c6e9440d9b005c722f Merge: 211b4dbc07009 2585cf9dfaadd Author: Daniel Vetter Date: Tue Dec 14 09:43:25 2021 +0100 Merge v5.16-rc5 into drm-next Thomas Zimmermann requested a fixes backmerge, specifically also for 96c5f82ef0a1 ("drm/vc4: fix error code in vc4_create_object()") Just a bunch of adjacent changes conflicts, even the big pile of them in vc4. Signed-off-by: Daniel Vetter commit 0642fb4ba68f7158f7a6d92190b3090cf0c7fac6 Author: Drew Fustini Date: Tue Nov 23 11:25:24 2021 -0800 clocksource/drivers/pistachio: Fix -Wunused-but-set-variable warning Variable 'overflow' set but not used, but this is the intended behavior. The hardware only updates the counter register after the overflow register read. However, the value of overflow is not actually needed. Link: https://lore.kernel.org/lkml/202111200402.afQsussU-lkp@intel.com/ Reported-by: kernel test robot Suggested-by: Daniel Lezcano Signed-off-by: Drew Fustini Link: https://lore.kernel.org/r/20211123192524.1038304-1-dfustini@baylibre.com Signed-off-by: Daniel Lezcano commit 5b532920d74e2647d30a2a63647a99f19b6141bb Merge: 0491871b63da8 6df9d38f9146e Author: Arnd Bergmann Date: Tue Dec 14 10:17:27 2021 +0100 Merge tag 'asahi-soc-pmgr-5.17' of https://github.com/AsahiLinux/linux into arm/drivers Apple SoC PMGR driver for 5.17 Adds the new PMGR driver. This includes the driver only; DT and MAINTAINERS changes are part of the DT pull. Minor change from v3: added `depends on PM` to the Kconfig to fix COMPILE_TEST randconfig failures. * tag 'asahi-soc-pmgr-5.17' of https://github.com/AsahiLinux/linux: soc: apple: Add driver for Apple PMGR power state controls Link: https://lore.kernel.org/r/049f4de9-51be-7be4-1f9a-a59756af88d7@marcan.st Signed-off-by: Arnd Bergmann commit 0ed9e4ebcebcb36bd1186e68cf2f72b3e0bfbac6 Author: Peng Fan Date: Wed Dec 1 20:50:30 2021 +0800 clocksource/drivers/timer-imx-sysctr: Set cpumask to cpu_possible_mask The syctr interrupt could set the affinity to any cores in the SoC. However, the default affinity is set to cpu 0. This timer will be used as broadcast timer on all the i.MX SoCs. Because DYNIRQ flag is set, the core time framework will runtime set the interrupt affinity to the cores that needs to wake up and the cpumask will runtime set to the core that will be wake up. So even the sysctr initialization use cpumask 0, there is no issue, the current patch is just use cpu_possible_mask to show the fact that the timer supports routed to all the cpu cores and nothing else. Signed-off-by: Peng Fan Link: https://lore.kernel.org/r/20211201125030.2307746-2-peng.fan@oss.nxp.com Signed-off-by: Daniel Lezcano commit b156117aed1b9d192efcb27f5b37f78cd21fa545 Author: Colin Ian King Date: Sat Dec 11 18:00:54 2021 +0000 phy: rockchip-inno-usb2: remove redundant assignment to variable delay Variable delay is being assigned to zero and the code falls through to the next case in a switch statement that returns out of the function. The variable is never read in this scenario and so the assignment is redundant and can be removed. Cleans up scan-build static analysis warning: drivers/phy/rockchip/phy-rockchip-inno-usb2.c:753:3: warning: Value stored to 'delay' is never read [deadcode.DeadStores] Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20211211180054.525368-1-colin.i.king@gmail.com Signed-off-by: Vinod Koul commit 9ea1b35f63dde3c8ff7f1fd8fee3a46c3d5583a9 Author: Mika Westerberg Date: Fri Dec 10 13:11:38 2021 +0200 HID: debug: Add USI usages Add USI defined usages to the HID debug code. Signed-off-by: Mika Westerberg Signed-off-by: Tero Kristo Signed-off-by: Benjamin Tissoires Link: https://lore.kernel.org/r/20211210111138.1248187-6-tero.kristo@linux.intel.com commit 5904a3f9d756f108279f8c5b8f17ca6ddfb28d24 Author: Mika Westerberg Date: Fri Dec 10 13:11:37 2021 +0200 HID: input: Make hidinput_find_field() static This function is not called outside of hid-input.c so we can make it static. Signed-off-by: Mika Westerberg Reviewed-by: Benjamin Tissoires Signed-off-by: Tero Kristo Signed-off-by: Benjamin Tissoires Link: https://lore.kernel.org/r/20211210111138.1248187-5-tero.kristo@linux.intel.com commit ae7fafa6896ae762ff489a5e71c8e5fabfeb61ee Author: Tero Kristo Date: Fri Dec 10 13:11:36 2021 +0200 HID: Add hid usages for USI style pens Add usage codes for USI style pens, based on the USB-HID usage table: https://usb.org/document-library/hid-usage-tables-122 See chapter 16, Digitizers Page (0x0D) Signed-off-by: Tero Kristo Signed-off-by: Benjamin Tissoires Link: https://lore.kernel.org/r/20211210111138.1248187-4-tero.kristo@linux.intel.com commit c0ee1d571626d659535becdc3d9f2583be3b9208 Author: Mika Westerberg Date: Fri Dec 10 13:11:35 2021 +0200 HID: hid-input: Add suffix also for HID_DG_PEN This and HID_DG_STYLUS are pretty much the same thing so add suffix for HID_DG_PEN too. This makes the input device name look better. While doing this, remove the suffix override from hid-multitouch, as it is now handled by hid-input. Also, the suffix override done by hid-multitouch was wrong, as it mapped HID_DG_PEN => "Stylus" and HID_DG_STYLUS => "Pen". Signed-off-by: Mika Westerberg Signed-off-by: Tero Kristo [bentiss: amended to keep the same name for hid-multitouch devices] Signed-off-by: Benjamin Tissoires Link: https://lore.kernel.org/r/20211210111138.1248187-3-tero.kristo@linux.intel.com commit 8aa45b544db9788b0fcc7a300eba8a3ade5d3d50 Author: Mika Westerberg Date: Fri Dec 10 13:11:34 2021 +0200 HID: Add map_msc() to avoid boilerplate code Since we are going to have more MSC events too, add map_msc() that can be used to fill in necessary fields and avoid boilerplate code. Signed-off-by: Mika Westerberg Reviewed-by: Benjamin Tissoires Signed-off-by: Tero Kristo Signed-off-by: Benjamin Tissoires Link: https://lore.kernel.org/r/20211210111138.1248187-2-tero.kristo@linux.intel.com commit 405db98b89256d9a2d12ec1b2cbd471a480417e1 Author: Wang Qing Date: Thu Dec 9 04:20:49 2021 -0800 mips: ralink: add missing of_node_put() call in ill_acc_of_setup() of_find_compatible_node() takes a reference to the device_node which needs to be dropped when done. Signed-off-by: Wang Qing Signed-off-by: Thomas Bogendoerfer commit 4317892db474ddcf0f9d4a9bca8e0d2ddb1d0ab9 Author: Jason Wang Date: Sat Dec 11 16:57:15 2021 +0800 MIPS: fix typo in a comment The double `Address' in the comment in line 487 is repeated. Remove one of them from the comment. Signed-off-by: Jason Wang Signed-off-by: Thomas Bogendoerfer commit 8de927a4d6f8f5c02e337a6121da75e7e1328a28 Author: Jason Wang Date: Sat Dec 11 16:54:18 2021 +0800 MIPS: lantiq: Fix typo in a comment The double `if' in the comment in line 144 is repeated. Remove one of them from the comment. Signed-off-by: Jason Wang Signed-off-by: Thomas Bogendoerfer commit dae39cff8d989a7afbceb1fdc31e61f38e7ed5e3 Author: Jason Wang Date: Sat Dec 11 16:51:32 2021 +0800 MIPS: Fix typo in a comment The double `the' in the comment in line 344 is repeated. Remove one of them from the comment. Signed-off-by: Jason Wang Signed-off-by: Thomas Bogendoerfer commit c0484efaf569d62736d93dcb3c8bceb7f226bbbc Author: Tiezhu Yang Date: Tue Dec 14 11:09:02 2021 +0800 MIPS: Makefile: Remove "ifdef need-compiler" for Kbuild.platforms After commit 13ceb48bc19c ("MIPS: Loongson2ef: Remove unnecessary {as,cc}-option calls"), no need to use "ifdef need-compiler" for Kbuild.platforms, because the cause of the build issue mentioned in commit 0706f74f719e ("MIPS: fix *-pkg builds for loongson2ef platform") has been disappeared, so just remove it. Signed-off-by: Tiezhu Yang Reviewed-by: Nathan Chancellor Reviewed-by: Masahiro Yamada Signed-off-by: Thomas Bogendoerfer commit 048cc2378c2494519d940597629465b3ea44a96f Author: Tiezhu Yang Date: Tue Dec 14 11:09:01 2021 +0800 MIPS: SGI-IP22: Remove unnecessary check of GCC option According to Documentation/process/changes.rst, the minimal version of GCC is 5.1, and -mr10k-cache-barrier=store is supported with GCC 5.1 [1], just remove the unnecessary check to fix the build error [2]: arch/mips/sgi-ip22/Platform:28: *** gcc doesn't support needed option -mr10k-cache-barrier=store. Stop. [1] https://gcc.gnu.org/onlinedocs/gcc-5.1.0/gcc/MIPS-Options.html [2] https://github.com/ClangBuiltLinux/linux/issues/1543 Reported-by: Ryutaroh Matsumoto Suggested-by: Nathan Chancellor Signed-off-by: Tiezhu Yang Reviewed-by: Nathan Chancellor Reviewed-by: Masahiro Yamada Signed-off-by: Thomas Bogendoerfer commit 9d031a51b399b368b180886632402273bf53d6a2 Author: Horatiu Vultur Date: Sat Dec 11 22:47:17 2021 +0100 phy: lan966x: Remove set_speed function Remove the set_speed function and allow the driver to figure out the speed at which needs to configure the serdes based on the interface type. Fixes: 305524902a0045 ("phy: Add lan966x ethernet serdes PHY driver") Signed-off-by: Horatiu Vultur Link: https://lore.kernel.org/r/20211211214717.1284306-1-horatiu.vultur@microchip.com Signed-off-by: Vinod Koul commit bd4372f056a2cf1a8b47afafc565b1fa7eb54323 Author: Ariel D'Alessandro Date: Fri Dec 10 10:23:17 2021 -0300 arm64: dts: imx8mn-bsh-smm-s2/pro: Add iMX8MN BSH SMM S2 boards Introduce BSH SystemMaster (SMM) S2 board family, which consists of: iMX8MN SMM S2 and iMX8MN SMM S2 PRO boards. Add support for iMX8MN BSH SMM S2 board: - 256 MiB DDR3 RAM - 512 MiB NAND - Megabit Ethernet PHY - Wi-Fi 802.11 a/b/g/n/ac with Bluetooth 5.0 - USB-OTG (peripheral mode) Add support for iMX8MN BSH SMM S2 PRO board: - 512 MiB DDR3 RAM - 8 GiB eMMC - Megabit Ethernet PHY - Wi-Fi 802.11 a/b/g/n/ac with Bluetooth 5.0 - USB-OTG (peripheral mode) Signed-off-by: Ariel D'Alessandro Signed-off-by: Michael Trimarchi Signed-off-by: Shawn Guo commit 8802266a103343da81fc99f7977273713e0e1980 Author: Ariel D'Alessandro Date: Fri Dec 10 10:23:18 2021 -0300 dt-bindings: arm: fsl: Add BSH SMM-M2 IMX6ULZ SystemMaster board Add bindings for BSH SystemMaster (SMM) M2 IMX6ULZ board. Signed-off-by: Ariel D'Alessandro Acked-by: Rob Herring Signed-off-by: Shawn Guo commit 50cee5eb406b9557f30a2824691b26d2a74f1a8a Author: Ariel D'Alessandro Date: Fri Dec 10 10:23:16 2021 -0300 dt-bindings: arm: fsl: Add iMX8MN BSH SMM S2 boards Add bindings for BSH SystemMaster (SMM) S2 board family, which consists of: iMX8MN SMM S2 and iMX8MN SMM S2 PRO boards. Signed-off-by: Ariel D'Alessandro Acked-by: Rob Herring Signed-off-by: Shawn Guo commit 63aca69c224fd2a38e02598a8ce48b984c7e9c76 Author: Ariel D'Alessandro Date: Fri Dec 10 10:23:15 2021 -0300 dt-bindings: Add vendor prefix for BSH Hausgeraete GmbH Document vendor prefix for BSH Hausgeraete GmbH ('BSH Home Appliances', B/S/H/) manufacturer. Signed-off-by: Ariel D'Alessandro Acked-by: Rob Herring Signed-off-by: Shawn Guo commit 96db14432d979532be4cb6d5d52a127317e68b3f Author: Mark Brown Date: Mon Dec 13 17:07:53 2021 +0000 drm/i915: Fix implicit use of struct pci_dev intel_device_info.h references struct pci_dev but does not ensure that the struct has been declared, causing build failures if something in other headers changes so that the implicit dependency it is relying on is no longer satisfied: In file included from drivers/gpu/drm/i915/intel_device_info.h:32, from drivers/gpu/drm/i915/gt/uc/intel_uc_fw.h:11, from drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:11: drivers/gpu/drm/i915/display/intel_display.h:643:39: error: 'struct pci_dev' declared inside parameter list will not be visible outside of this definition or declaration [-Werror] 643 | bool intel_modeset_probe_defer(struct pci_dev *pdev); | ^~~~~~~ cc1: all warnings being treated as errors Add a declaration of the struct to fix this. Signed-off-by: Mark Brown Fixes: 94b541f53db1 ("drm/i915: Add intel_modeset_probe_defer() helper") Reviewed-by: Jani Nikula Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20211213170753.3680209-1-broonie@kernel.org commit aafac22d6b232a2a4f496f7ac3f98a32ff1fb29f Author: Fabio Estevam Date: Wed Dec 8 16:52:45 2021 -0300 arm64: dts: imx8mm/n: Remove the 'pm-ignore-notify' property The 'pm-ignore-notify' property is not a valid property and there is no documentation for it. Drop such invalid property. Signed-off-by: Fabio Estevam Signed-off-by: Shawn Guo commit 03eb813dac25d478151892e959055a80b9eb7dbe Author: Peng Fan Date: Wed Dec 8 21:17:55 2021 +0800 arm64: dts: imx8ulp: add power domain entry for usdhc Add power domain for USDHC node. Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit a38771d7a49baf682fffd5cb8e1c6aea45ae5d26 Author: Peng Fan Date: Wed Dec 8 21:17:54 2021 +0800 arm64: dts: imx8ulp: add scmi firmware node i.MX8ULP use scmi firmware based power domain and sensor support. So add the firmware node and the sram it uses. Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit 057ccd9db760fc2c336b1138dab345bc2d3cdd35 Author: Peng Fan Date: Wed Dec 8 21:17:53 2021 +0800 dt-bindings: power: imx8ulp: add power domain header file Add i.MX8ULP power domain header file Acked-by: Rob Herring Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit 1a42daaa3c7e0749f212c6bf9a8176d59833da71 Author: Adam Ford Date: Sun Dec 5 15:01:43 2021 -0600 arm64: dts: imx8mq-evk: link regulator to VPU domain The SW1C regulator powers the VPU and the state isn't guaranteed to always be on. Link the VPU power-domain to the regulator to ensure it is turned on before using the power domain. Signed-off-by: Adam Ford Signed-off-by: Shawn Guo commit a3d5b4e2af448afd0c8c843178380a8efbbaf8df Author: Li Yang Date: Fri Dec 3 19:15:37 2021 -0600 arm64: dts: ls1088a: add snps incr burst type adjustment for usb1 This property could fix the defect that external usb device always prints this error log --- 'reset SuperSpeed USB device number n using xhci_hcd' when system power on. Signed-off-by: Pengbo Mu Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit 22e9e261bfe85539d2a3ce8e2f8f5b8187082028 Author: Li Yang Date: Fri Dec 3 19:15:36 2021 -0600 arm64: dts: ls1088a: Add reboot nodes ls1088a has a separate reset register block. Define it in dts and use it for reboot. Signed-off-by: Ashish Kumar Signed-off-by: Li Yang Signed-off-by: Shawn Guo commit bd8a9cd624c6189c6ad6e0d08513e089775303a4 Author: Vladimir Oltean Date: Thu Dec 2 16:15:28 2021 +0200 arm64: dts: ls1028a-rdb: update copyright Company policy requires that copyright is updated when a file is touched. Keeping the copyright change separate to reduce the noise in other patches. Signed-off-by: Vladimir Oltean Signed-off-by: Shawn Guo commit 96ad273759e0176b5e00c7c7266421c26a7f4811 Author: Vladimir Oltean Date: Thu Dec 2 16:15:27 2021 +0200 arm64: dts: ls1028a-rdb: add aliases for the Ethernet ports These are used by U-Boot, and are required for keeping the device trees in sync. Signed-off-by: Vladimir Oltean Signed-off-by: Shawn Guo commit d18c7980d4d7125b0c9fc002de301054c3667a82 Author: Vladimir Oltean Date: Thu Dec 2 16:15:26 2021 +0200 arm64: dts: ls1028a-rdb: add an alias for the FlexSPI controller This is used by U-Boot and is required for keeping the device trees in sync. Signed-off-by: Vladimir Oltean Signed-off-by: Shawn Guo commit 6c5d66cb28b0611350007204da1cd079b7b4bf41 Author: Vladimir Oltean Date: Thu Dec 2 16:15:25 2021 +0200 arm64: dts: ls1028a-rdb: sort nodes alphabetically by label In preparation for this board's device tree synchronization with U-Boot, we must find a common node ordering pattern. Alphabetical sounds about right. Signed-off-by: Vladimir Oltean Signed-off-by: Shawn Guo commit cbcf2b40a7cf40da02e08e4485118a3b4fce54ce Author: Christoph Niedermaier Date: Wed Dec 8 16:07:26 2021 +0100 ARM: dts: imx6qdl-dhcom: Identify the PHY by ethernet-phy-id0007.c0f0 Identify the PHY by its compatible ID value. In some cases during boot, the PHY needs to be reset to be accessible, but this is only possible if the PHY is recognized. In that case, the automatic detection of the PHY does not work and a static compatible ID value is need. 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 Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit e7ed6ba0239df1e2aca3f9b2d77da4de180cdbe0 Author: Christoph Niedermaier Date: Wed Dec 8 16:05:43 2021 +0100 ARM: dts: imx6qdl-dhcom: Align PHY reset timing with other DHCOM SoMs According to datasheet Microchip LAN8710A/LAN8710Ai DS00002164B [1] the reset should stay asserted for at least 100uS and software should wait at least 200nS. On other DHCOM SoMs with the SMSC LAN8710Ai PHY both reset delays are 500us. This should be plenty and for consistency, the i.MX6 SoM should also use these delays. [1] https://ww1.microchip.com/downloads/en/DeviceDoc/00002164B.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 Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 0491871b63da81a42841218d951f98ad5c2a35e2 Merge: 136057256686d 05b22caa7490e Author: Arnd Bergmann Date: Tue Dec 14 09:28:44 2021 +0100 Merge tag 'renesas-drivers-for-v5.17-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/drivers Renesas driver updates for v5.17 - Add a remoteproc API for controlling the Cortex-R7 boot address on R-Car Gen3 SoCs, - Consolidate product register handling. * tag 'renesas-drivers-for-v5.17-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: soc: renesas: Consolidate product register handling soc: renesas: rcar-rst: Add support to set rproc boot address Link: https://lore.kernel.org/r/cover.1638530612.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit 97416aab15174741f7feda551ec6bfd7e7ee9323 Author: Peng Fan Date: Tue Dec 7 16:34:57 2021 +0800 arm64: defconfig: enable drivers for booting i.MX8ULP Select i.MX8ULP CLK and PINCTRL driver to make it boot. Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit 2aaeccfafbf9c57c1d86354d12613548042474f4 Merge: 7b7320905a595 7b9eb6cfdb784 Author: Arnd Bergmann Date: Tue Dec 14 08:50:16 2021 +0100 Merge tag 'ixp4xx-dtx-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik into arm/dt IXP4xx DTS changes for v5.17: - Add the LEDs to the Freecom FSG-3 that were missing. - Add a devicetree for the Gorami MultiLink Router - Add a devicetree for the Gateway GW7001 Router This completes the migration of all IXP4xx devices to device tree files. Next merge window we will delete the remaining board files, it cannot be done now because of cross-tree dependencies. * tag 'ixp4xx-dtx-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik: ARM: dts: ixp4xx: Add devicetree for Gateway 7001 ARM: dts: Add Goramo MultiLink device tree ARM: dts: Add FSG3 system controller and LEDs Link: https://lore.kernel.org/r/CACRpkdYiWK7TEbZrh4_0WT5obMk=ZSc7AQVUSPXL+-uZ_hsUEA@mail.gmail.com Signed-off-by: Arnd Bergmann commit 16c57fff8390bf494b10c8321293295493e91a0b Author: Miaoqian Lin Date: Sun Dec 12 14:22:21 2021 +0000 phy: ti: Use IS_ERR_OR_NULL() to clean code Use IS_ERR_OR_NULL() to make the code cleaner. Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20211212142226.23674-1-linmq006@gmail.com Signed-off-by: Vinod Koul commit 918aaae300a634c4e0e98ad6820c9dc31eba09af Author: Luca Weiss Date: Mon Dec 13 09:26:05 2021 +0100 dt-bindings: phy: qcom,qusb2: Add SM6350 compatible Add devicetree compatible for the usb phy on SM6350 SoC. Signed-off-by: Luca Weiss Acked-by: Konrad Dybcio Link: https://lore.kernel.org/r/20211213082614.22651-5-luca.weiss@fairphone.com Signed-off-by: Vinod Koul commit 045a31b95509c8f25f5f04ec5e0dec5cd09f2c5f Author: Miaoqian Lin Date: Mon Dec 13 02:05:07 2021 +0000 phy: tegra: xusb: Fix return value of tegra_xusb_find_port_node function callers of tegra_xusb_find_port_node() function only do NULL checking for the return value. return NULL instead of ERR_PTR(-ENOMEM) to keep consistent. Signed-off-by: Miaoqian Lin Acked-by: Thierry Reding Link: https://lore.kernel.org/r/20211213020507.1458-1-linmq006@gmail.com Signed-off-by: Vinod Koul commit 8c2d04551545d3722c1e6891ecce46f44c5406ec Author: Christophe JAILLET Date: Thu Dec 9 22:11:56 2021 +0100 scsi: hpsa: Remove an unused variable in hpsa_update_scsi_devices() 'lunzerobits' is unused. Remove it. This a left over of commit 2d62a33e05d4 ("hpsa: eliminate fake lun0 enclosures") Link: https://lore.kernel.org/r/9f80ea569867b5f7ae1e0f99d656e5a8bacad34e.1639084205.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET Signed-off-by: Martin K. Petersen commit c167dd0b2a7afcf2c25e44b9b6168cba3a51d27d Author: Kees Cook Date: Fri Dec 3 14:33:51 2021 -0800 scsi: lpfc: Use struct_group to isolate cast to larger object When building under -Warray-bounds, a warning is generated when casting a u32 into MAILBOX_t (which is larger). This warning is conservative, but it's not an unreasonable change to make to improve future robustness. Use a tagged struct_group that can refer to either the specific fields or the first u32 separately, silencing this warning: drivers/scsi/lpfc/lpfc_sli.c: In function 'lpfc_reset_barrier': drivers/scsi/lpfc/lpfc_sli.c:4787:29: error: array subscript 'MAILBOX_t[0]' is partly outside array bounds of 'volatile uint32_t[1]' {aka 'volatile unsigned int[1]'} [-Werror=array-bounds] 4787 | ((MAILBOX_t *)&mbox)->mbxCommand = MBX_KILL_BOARD; | ^~ drivers/scsi/lpfc/lpfc_sli.c:4752:27: note: while referencing 'mbox' 4752 | volatile uint32_t mbox; | ^~~~ There is no change to the resulting executable instruction code. Link: https://lore.kernel.org/r/20211203223351.107323-1-keescook@chromium.org Reviewed-by: James Smart Signed-off-by: Kees Cook Signed-off-by: Martin K. Petersen commit 532adda9f405d69ef1837f59e60512313fdf0f63 Author: Kees Cook Date: Wed Dec 8 11:59:57 2021 -0800 scsi: lpfc: Use struct_group() to initialize struct lpfc_cgn_info In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Add struct_group() to mark "stat" region of struct lpfc_cgn_info that should be initialized to zero, and refactor the "data" region memset() to wipe everything up to the cgn_stats region. Link: https://lore.kernel.org/r/20211208195957.1603092-1-keescook@chromium.org Reviewed-by: James Smart Signed-off-by: Kees Cook Signed-off-by: Martin K. Petersen commit bca46d8e5fede9cf4491be27dba9d09721b80f71 Author: Giulio Benetti Date: Fri Dec 3 01:40:39 2021 +0100 ARM: dts: imx6qdl: drop "fsl,imx-ckih1" "fsl,imx-ckih1" is useless since no driver deals with it, so let's drop it. Signed-off-by: Giulio Benetti Signed-off-by: Shawn Guo commit 5368f930cc655d0906574e9841960ee380bf4351 Author: Giulio Benetti Date: Fri Dec 3 01:40:38 2021 +0100 ARM: dts: imx6qdl: drop "fsl,imx-ckil" "fsl,imx-ckil" is useless since no driver deals with it, so let's drop it. Signed-off-by: Giulio Benetti Signed-off-by: Shawn Guo commit 36b85fdaa36ac19ec6bd77ad5d44050747265c28 Author: Giulio Benetti Date: Fri Dec 3 01:40:37 2021 +0100 ARM: dts: imx6qdl: drop "fsl,imx-osc" "fsl,imx-osc" is useless since no driver deals with it, so let's drop it. Signed-off-by: Giulio Benetti Signed-off-by: Shawn Guo commit 4ce956128d43527c5c917309257f2c4e927425d6 Author: Giulio Benetti Date: Fri Dec 3 01:40:36 2021 +0100 ARM: dts: imx53: drop "fsl,imx-ckih2" "fsl,imx-ckih2" is useless since no driver deals with it, so let's drop it. Signed-off-by: Giulio Benetti Signed-off-by: Shawn Guo commit 917fee9c6f7b7d4110730c2ab5f5fe8cdd7df534 Author: Giulio Benetti Date: Fri Dec 3 01:40:35 2021 +0100 ARM: dts: imx53: drop "fsl,imx-ckih1" "fsl,imx-ckih1" is useless since no driver deals with it, so let's drop it. Signed-off-by: Giulio Benetti Signed-off-by: Shawn Guo commit ac0894359ecfd80f260aa42b283c88bf02387e4e Author: Giulio Benetti Date: Fri Dec 3 01:40:34 2021 +0100 ARM: dts: imx53: drop "fsl,imx-ckil" "fsl,imx-ckil" is useless since no driver deals with it, so let's drop it. Signed-off-by: Giulio Benetti Signed-off-by: Shawn Guo commit 39cd25fe2e1d10a5b319a73a6e2bf97ecba86a9c Author: Giulio Benetti Date: Fri Dec 3 01:40:33 2021 +0100 ARM: dts: imx53: drop "fsl,imx-osc" "fsl,imx-osc" is useless since no driver deals with it, so let's drop it. Signed-off-by: Giulio Benetti Signed-off-by: Shawn Guo commit 0dee2e69efc250410f1c0d756117d6b4506f54ef Author: Giulio Benetti Date: Fri Dec 3 01:40:32 2021 +0100 ARM: dts: imx51: drop "fsl,imx-ckih2" "fsl,imx-ckih2" is useless since no driver deals with it, so let's drop it. Signed-off-by: Giulio Benetti Signed-off-by: Shawn Guo commit 58cd720f3f5a19c8cacff81b652018358c0105ea Author: Giulio Benetti Date: Fri Dec 3 01:40:31 2021 +0100 ARM: dts: imx51: drop "fsl,imx-ckih1" "fsl,imx-ckih1" is useless since no driver deals with it, so let's drop it. Signed-off-by: Giulio Benetti Signed-off-by: Shawn Guo commit 929bdb7b0afb19c6f640b96859554d0d0010c3b3 Author: Giulio Benetti Date: Fri Dec 3 01:40:30 2021 +0100 ARM: dts: imx51: drop "fsl,imx-ckil" "fsl,imx-ckil" is useless since no driver deals with it, so let's drop it. Signed-off-by: Giulio Benetti Signed-off-by: Shawn Guo commit 73cda7c63a59609fa53ab91c1167f55692140a1f Author: Giulio Benetti Date: Fri Dec 3 01:40:29 2021 +0100 ARM: dts: imx51: drop "fsl,imx-osc" "fsl,imx-osc" is useless since no driver deals with it, so let's drop it. Signed-off-by: Giulio Benetti Signed-off-by: Shawn Guo commit f6bc4a7c037f07bb338dde5171c64d191e65dfff Author: Giulio Benetti Date: Fri Dec 3 01:40:28 2021 +0100 ARM: dts: imx50: drop "fsl,imx-ckih2" "fsl,imx-ckih2" is useless since no driver deals with it, so let's drop it. Signed-off-by: Giulio Benetti Signed-off-by: Shawn Guo commit c522683be5b56a2366bbe896bae2180a6d22e95e Author: Giulio Benetti Date: Fri Dec 3 01:40:27 2021 +0100 ARM: dts: imx50: drop "fsl,imx-ckih1" "fsl,imx-ckih1" is useless since no driver deals with it, so let's drop it. Signed-off-by: Giulio Benetti Signed-off-by: Shawn Guo commit c5e526a9c3d5d8be8829ab2c4530a063a9aef983 Author: Giulio Benetti Date: Fri Dec 3 01:40:26 2021 +0100 ARM: dts: imx50: drop "fsl,imx-ckil" "fsl,imx-ckil" is useless since no driver deals with it, so let's drop it. Signed-off-by: Giulio Benetti Signed-off-by: Shawn Guo commit 20adb4921cd6d8db90efd466a1547af047160a0a Author: Giulio Benetti Date: Fri Dec 3 01:40:25 2021 +0100 ARM: dts: imx50: drop "fsl,imx-osc" "fsl,imx-osc" is useless since no driver deals with it, so let's drop it. Signed-off-by: Giulio Benetti Signed-off-by: Shawn Guo commit 9a68c8ec9ac9f097c75d6a02f12ddcd29379622d Author: Giulio Benetti Date: Fri Dec 3 01:40:24 2021 +0100 ARM: dts: imx25: drop "fsl,imx-osc" "fsl,imx-osc" is useless since no driver deals with it, so let's drop it. Signed-off-by: Giulio Benetti Signed-off-by: Shawn Guo commit 05be8e7472cdce0b006aa5fc995ec199f91979f5 Author: Giulio Benetti Date: Fri Dec 3 01:40:23 2021 +0100 ARM: dts: imx1: drop "fsl,imx-clk32" "fsl,imx-clk32" is useless since no driver deals with it, so let's drop it. Signed-off-by: Giulio Benetti Signed-off-by: Shawn Guo commit 3f8b6cf82088e0423b755f9a9dc79b8650bd1e25 Author: Laurent Pinchart Date: Fri Dec 3 00:19:03 2021 +0200 ARM: dts: imx7: Group mipi_csi 'port' children in a 'ports' node The nxp,imx7-mipi-csi2.yaml binding requires ports to be grouped in a ports node, as multiple ports are present. Fix imx7s.dtsi and the only board file that references the mipi_csi ports. Signed-off-by: Laurent Pinchart Signed-off-by: Shawn Guo commit 473d06b9093ddc6b9fd2927893819f43e830bde5 Author: Laurent Pinchart Date: Fri Dec 3 00:19:02 2021 +0200 ARM: dts: imx7: Drop reset-names property for mipi_csi node The reset-names property isn't defined by the nxp,imx7-mipi-csi2.yaml binding, and isn't used by the corresponding driver as it acquires the reset with a NULL ID. Drop it. Signed-off-by: Laurent Pinchart Signed-off-by: Shawn Guo commit 74092acd6eab63b1f1e0c293400ef3b1bb7af6f8 Author: Laurent Pinchart Date: Fri Dec 3 00:19:01 2021 +0200 ARM: dts: imx7s-warp: Drop undefined property in mipi_csi node The fsl,csis-hs-settle property isn't defined by the nxp,imx7-mipi-csi2.yaml binding, and isn't parsed by the corresponding driver. Drop it. Signed-off-by: Laurent Pinchart Signed-off-by: Shawn Guo commit b357ffd8604ae45ec4bb1ebec072cd4ca4ce839c Author: Adam Ford Date: Thu Dec 2 08:38:27 2021 -0600 ARM: dts: imx: Change spba to spba-bus With the updated dt-bindings for the spba-bus, rename spba@xxxx to spba-bus@xxxx. There are no functional changes. Signed-off-by: Adam Ford Signed-off-by: Shawn Guo commit c4cacb5b80f4f1d83b8bcd6e16672d6732982414 Author: Adam Ford Date: Thu Dec 2 08:38:26 2021 -0600 dt-bindings: soc: imx: Add binding doc for spba bus Add binding doc for fsl,spba-bus. Signed-off-by: Adam Ford Reviewed-by: Rob Herring Signed-off-by: Shawn Guo commit 7b983da38417fa8c36514d6a98997b3cad11b6a9 Author: Ivan Bornyakov Date: Thu Dec 2 08:57:23 2021 +0300 bus: imx-weim: optionally enable continuous burst clock To enable continuous burst clock, add "fsl,continuous-burst-clk" along with "fsl,burst-clk-enable" property to the weim bus's devicetree node. Example: weim: weim@21b8000 { compatible = "fsl,imx6ul-weim", "fsl,imx6q-weim"; reg = <0x021b8000 0x4000>; clocks = <&clks 143>; #address-cells = <2>; #size-cells = <1>; ranges = <0 0 0x50000000 0x08000000>; fsl,weim-cs-gpr = <&gpr>; fsl,burst-clk-enable; fsl,continuous-burst-clk; client-device@0 { ... }; }; Signed-off-by: Ivan Bornyakov Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit ced795c2648aae44314aa8027e8e1d691ea6153f Author: Ivan Bornyakov Date: Thu Dec 2 08:57:24 2021 +0300 dt-bindings: bus: imx-weim: add words about continuous bclk Document continuous Burst Clock option. With this option Burst Clock, if enabled, will output continuous clock, otherwise Burst Clock will output clock only when necessary. Signed-off-by: Ivan Bornyakov Reviewed-by: Rob Herring Signed-off-by: Shawn Guo commit a973f86b41fbecf73aea141bed3d534c4e6caae4 Author: Maor Gottlieb Date: Wed Dec 1 11:36:21 2021 -0800 RDMA/mlx5: Add support to multiple priorities for FDB rules Currently, the driver ignores the user's priority for flow steering rules in FDB namespace. Change it and create the rule in the right priority. It will allow to create FDB steering rules in up to 16 different priorities. Signed-off-by: Maor Gottlieb Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed Acked-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit c7d5fa105b5d2630ab9428914d36730eda13876c Author: Maor Gottlieb Date: Wed Dec 1 11:36:20 2021 -0800 net/mlx5: Create more priorities for FDB bypass namespace Create 16 flow steering priorities for FDB bypass users. Signed-off-by: Maor Gottlieb Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed Reviewed-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit 4588fed7beae6d54ef4c67c77fc39364f8fc42af Author: Maor Gottlieb Date: Wed Dec 1 11:36:19 2021 -0800 net/mlx5: Refactor mlx5_get_flow_namespace Have all the namespace type check in the same switch case. Signed-off-by: Maor Gottlieb Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed Reviewed-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit 22c3f2f56bd9c901e1da69040680c311f310635d Author: Maor Gottlieb Date: Wed Dec 1 11:36:18 2021 -0800 net/mlx5: Separate FDB namespace This patch doesn't add an additional namespaces, but just separates the naming to be used by each FDB user, bypass and kernel. Downstream patches will actually split this up and allow to have more than single priority for the bypass users. Signed-off-by: Maor Gottlieb Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed Acked-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit 52a0cab35c568f896067641d8e07f798341954f5 Author: Kees Cook Date: Thu Nov 18 12:37:12 2021 -0800 drbd: Use struct_group() to zero algs In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Add a struct_group() for the algs so that memset() can correctly reason about the size. Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20211118203712.1288866-1-keescook@chromium.org Signed-off-by: Jens Axboe commit d27a662290963a1cde26cdfdbac71a546c06e94a Author: Maciej Fijalkowski Date: Fri Dec 10 18:15:11 2021 +0100 xsk: Wipe out dead zero_copy_allocator declarations zero_copy_allocator has been removed back when Bjorn Topel introduced xsk_buff_pool. Remove references to it that were dangling in the tree. Signed-off-by: Maciej Fijalkowski Signed-off-by: Daniel Borkmann Acked-by: Magnus Karlsson Link: https://lore.kernel.org/bpf/20211210171511.11574-1-maciej.fijalkowski@intel.com commit d95b00f1a8c57f10a7c83bec5a245391c7666f36 Author: Mark Yacoub Date: Mon Dec 13 11:07:22 2021 -0500 drm/mediatek: Set the default value of rotation to DRM_MODE_ROTATE_0 At the reset hook, call __drm_atomic_helper_plane_reset which is called at the initialization of the plane and sets the default value of rotation on all planes to DRM_MODE_ROTATE_0 which is equal to 1. Tested on Jacuzzi (MTK). Resolves IGT@kms_properties@plane-properties-{legacy,atomic} Signed-off-by: Mark Yacoub Signed-off-by: Chun-Kuang Hu commit 7b7320905a5958ab5fe7542124a68e6beed0a28e Merge: 1c8e994f16b79 078c2a0e8e60b Author: Arnd Bergmann Date: Tue Dec 14 00:16:48 2021 +0100 Merge tag 'at91-dt-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into arm/dt AT91 DT #1 for 5.17: - 2 low priority fixes about pin function for sama7g5 and better tailored mmc interface on sama5d2 xplained - Addition of the Microchip EVB-KSZ9477: a Gigabit Ethernet managed Switch Evaluation Board - QSPI: addition of sama5d2 clock name and nodes for new sama7g7 and its associated Evaluation Kit * tag 'at91-dt-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: ARM: dts: at91: sama7g5ek: Add QSPI0 node ARM: dts: at91: sama7g5: Add QSPI nodes ARM: dts: at91: sama5d2: Name the qspi clock ARM: dts: at91: add Microchip EVB-KSZ9477 board ARM: dts: at91: sama5d2_xplained: remove PA11__SDMMC0_VDDSEL from pinctrl ARM: dts: at91: update alternate function of signal PD20 Link: https://lore.kernel.org/r/20211213161451.90786-1-nicolas.ferre@microchip.com Signed-off-by: Arnd Bergmann commit 1c8e994f16b79f08c565b11e617afc07225eecf0 Merge: f3141df0418c1 0a62b3cc0af93 Author: Arnd Bergmann Date: Tue Dec 14 00:14:56 2021 +0100 Merge tag 'amlogic-arm64-dt-for-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux into arm/dt Amlogic ARM64 DT changes for v5.17: - Add missing cec nodes for Odroid-C4 & HC4 - Fix thermal-zones indent for G12/SM1 SoCs dtsi - Fix GPU OPP table node name for G12/SM1 SoCs dtsi - Fix SPI NOR Flash node name for Odroid-N2/N2+ - Fixes for GXBB Wetek boards: - Fix HDMI supply - Add missing gpio bindings include - Switch to new LED bindings - P241 additions: - Add VCC 5v regulator - Add sound nodes * tag 'amlogic-arm64-dt-for-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux: arm64: dts: meson: p241: add sound support arm64: dts: meson: p241: add vcc_5v regulator arm64: dts: meson-gxbb-wetek: use updated LED bindings arm64: dts: meson-gxbb-wetek: fix missing GPIO binding arm64: dts: meson-gxbb-wetek: fix HDMI in early boot arm64: dts: amlogic: Fix SPI NOR flash node name for ODROID N2/N2+ arm64: dts: amlogic: meson-g12: Fix GPU operating point table node name arm64: dts: amlogic: meson-g12: Fix thermal-zones indent arm64: dts: meson-sm1-odroid: add cec nodes Link: https://lore.kernel.org/r/f47b9b95-6cde-d2f8-eb36-78777d449920@baylibre.com Signed-off-by: Arnd Bergmann commit bc279dc04e9ee23f6a22f6c7a6924edbd5fe0f6d Author: Luca Weiss Date: Mon Dec 13 09:22:08 2021 +0100 arm64: dts: qcom: sm7225-fairphone-fp4: Enable ADSP, CDSP & MPSS Enable the remoteprocs found on the SoC and add a qcom,rmtfs-mem node. Signed-off-by: Luca Weiss Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211213082208.21492-9-luca.weiss@fairphone.com commit f3141df0418c12c1d0058f0f2a6cf2735f4cb2ff Merge: 7f0ef89c0fa97 f471b1b2db081 Author: Arnd Bergmann Date: Tue Dec 14 00:04:48 2021 +0100 Merge tag 'v5.17-rockchip-dts64-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into arm/dt Improvements on a number of boards: - helios64: hdd-power, pcie, 2.5GbE nic - spi for rk356x and on the Quartz-A board - headphone, bluetooth support on Rock Pi4 And some misc soc improvements: - missing dsi compatible on px30 - pwm pinctrl name on rk356x * tag 'v5.17-rockchip-dts64-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: arm64: dts: rockchip: Fix Bluetooth on ROCK Pi 4 boards arm64: dts: rockchip: Add missing secondary compatible for PX30 DSI arm64: dts: rockchip: Add spi1 pins on Quartz64 A arm64: dts: rockchip: Add spi nodes on rk356x arm64: dts: rockchip: Change pwm pinctrl-name to "default" on rk356x arm64: dts: rockchip: Enable HDD power on helios64 arm64: dts: rockchip: add variables for pcie completion to helios64 arm64: dts: rockchip: define usb hub and 2.5GbE nic on helios64 arm64: dts: rockchip: add interrupt and headphone-detection for Rock Pi4's audio codec Link: https://lore.kernel.org/r/3637342.7akbv5NDAT@phil Signed-off-by: Arnd Bergmann commit 8eb5287e8a425aa7b27cfbb92096550046a231f8 Author: Luca Weiss Date: Mon Dec 13 09:22:07 2021 +0100 arm64: dts: qcom: sm6350: Add CDSP nodes Add the required nodes for booting the CDSP on sm6350. Signed-off-by: Luca Weiss Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211213082208.21492-8-luca.weiss@fairphone.com commit efc33c969f23cd6fe983e7e7bdcd8bbb1521f1de Author: Luca Weiss Date: Mon Dec 13 09:22:05 2021 +0100 arm64: dts: qcom: sm6350: Add ADSP nodes Add the required nodes for booting the ADSP on sm6350. Signed-off-by: Luca Weiss Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211213082208.21492-6-luca.weiss@fairphone.com commit 489be59b635ba76ea16d6f820ddf037644b3415a Author: Luca Weiss Date: Mon Dec 13 09:22:03 2021 +0100 arm64: dts: qcom: sm6350: Add MPSS nodes Add the required nodes for booting the MPSS on sm6350. Signed-off-by: Luca Weiss Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211213082208.21492-4-luca.weiss@fairphone.com commit 3bc0d1f9ef54cc3500898796b150078e6918ee21 Author: Luca Weiss Date: Mon Dec 13 09:22:06 2021 +0100 remoteproc: qcom: pas: Add SM6350 CDSP support Add a config for the CDSP present on SM6350. Signed-off-by: Luca Weiss Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211213082208.21492-7-luca.weiss@fairphone.com commit bfd75aefe32c63608c210227c662ba65541b8376 Author: Luca Weiss Date: Mon Dec 13 09:22:04 2021 +0100 remoteproc: qcom: pas: Add SM6350 ADSP support Add a config for the ADSP present on SM6350. Signed-off-by: Luca Weiss Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211213082208.21492-5-luca.weiss@fairphone.com commit 42a3f554d81ede895e12fd9d22a112beaf3cbb2e Author: Luca Weiss Date: Mon Dec 13 09:22:02 2021 +0100 remoteproc: qcom: pas: Add SM6350 MPSS support Add a config for the MPSS present on SM6350. Signed-off-by: Luca Weiss Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211213082208.21492-3-luca.weiss@fairphone.com commit a15d36f04b9e118ef5c37782a91bd1f52877f65c Author: Luca Weiss Date: Mon Dec 13 09:22:01 2021 +0100 dt-bindings: remoteproc: qcom: pas: Add SM6350 adsp, cdsp & mpss Add compatibles for the remoteprocs found in SM6350. Signed-off-by: Luca Weiss Acked-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211213082208.21492-2-luca.weiss@fairphone.com commit dd585d9bfbf06fd08a6326c82978be1f06e7d1bd Author: Sibi Sankar Date: Fri Jun 25 00:03:25 2021 +0530 remoteproc: qcom: pas: Add missing power-domain "mxc" for CDSP Add missing power-domain "mxc" required by CDSP PAS remoteproc on SM8350 SoC. Fixes: e8b4e9a21af7 ("remoteproc: qcom: pas: Add SM8350 PAS remoteprocs") Signed-off-by: Sibi Sankar Cc: stable@vger.kernel.org Tested-by: Bjorn Andersson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1624559605-29847-1-git-send-email-sibis@codeaurora.org commit da87976921bba27199ee4df94081ac10fa0cf76f Author: Peng Fan Date: Wed Jun 2 14:42:06 2021 +0800 remoteproc: imx_rproc: correct firmware reload ENABLE_M4 should be set to 1 when loading code to TCM, otherwise you will not able to replace the firmware after you stop m4. Besides ENABLE_M4, we still need set SW_M4C_RST, because this bit will be automatically set with SW_M4C_NON_SCLR_RST set. Reviewed-by: Mathieu Poirier Signed-off-by: Peng Fan Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20210602064206.27004-1-peng.fan@oss.nxp.com commit fdc12231d885119cc2e2b4f3e0fbba3155f37a56 Author: Stephen Boyd Date: Tue Nov 16 22:54:54 2021 -0800 remoteproc: qcom: pil_info: Don't memcpy_toio more than is provided If the string passed into qcom_pil_info_store() isn't as long as PIL_RELOC_NAME_LEN we'll try to copy the string assuming the length is PIL_RELOC_NAME_LEN to the io space and go beyond the bounds of the string. Let's only copy as many byes as the string is long, ignoring the NUL terminator. This fixes the following KASAN error: BUG: KASAN: global-out-of-bounds in __memcpy_toio+0x124/0x140 Read of size 1 at addr ffffffd35086e386 by task rmtfs/2392 CPU: 2 PID: 2392 Comm: rmtfs Tainted: G W 5.16.0-rc1-lockdep+ #10 Hardware name: Google Lazor (rev3+) with KB Backlight (DT) Call trace: dump_backtrace+0x0/0x410 show_stack+0x24/0x30 dump_stack_lvl+0x7c/0xa0 print_address_description+0x78/0x2bc kasan_report+0x160/0x1a0 __asan_report_load1_noabort+0x44/0x50 __memcpy_toio+0x124/0x140 qcom_pil_info_store+0x298/0x358 [qcom_pil_info] q6v5_start+0xdf0/0x12e0 [qcom_q6v5_mss] rproc_start+0x178/0x3a0 rproc_boot+0x5f0/0xb90 state_store+0x78/0x1bc dev_attr_store+0x70/0x90 sysfs_kf_write+0xf4/0x118 kernfs_fop_write_iter+0x208/0x300 vfs_write+0x55c/0x804 ksys_pwrite64+0xc8/0x134 __arm64_compat_sys_aarch32_pwrite64+0xc4/0xdc invoke_syscall+0x78/0x20c el0_svc_common+0x11c/0x1f0 do_el0_svc_compat+0x50/0x60 el0_svc_compat+0x5c/0xec el0t_32_sync_handler+0xc0/0xf0 el0t_32_sync+0x1a4/0x1a8 The buggy address belongs to the variable: .str.59+0x6/0xffffffffffffec80 [qcom_q6v5_mss] Memory state around the buggy address: ffffffd35086e280: 00 00 00 00 02 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 ffffffd35086e300: 00 02 f9 f9 f9 f9 f9 f9 00 00 00 06 f9 f9 f9 f9 >ffffffd35086e380: 06 f9 f9 f9 05 f9 f9 f9 00 00 00 00 00 06 f9 f9 ^ ffffffd35086e400: f9 f9 f9 f9 01 f9 f9 f9 04 f9 f9 f9 00 00 01 f9 ffffffd35086e480: f9 f9 f9 f9 00 00 00 00 00 00 00 01 f9 f9 f9 f9 Fixes: 549b67da660d ("remoteproc: qcom: Introduce helper to store pil info in IMEM") Signed-off-by: Stephen Boyd Reviewed-by: Bjorn Andersson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211117065454.4142936-1-swboyd@chromium.org commit f56498fc6a9364a35dd74af791bd1251467e9cc1 Author: Luca Weiss Date: Mon Dec 13 09:26:11 2021 +0100 arm64: dts: qcom: sm6350: Fix validation errors Sort clocks and interrupts as specified in the docs and remove the stray property #power-domain-cells from aoss_qmp to solve dtbs_check validation errors. Signed-off-by: Luca Weiss Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211213082614.22651-11-luca.weiss@fairphone.com commit a6839c42fe7c21173eb6f5db67d944e0f076be2a Author: Stephan Gerhold Date: Mon Dec 13 12:32:49 2021 +0100 ARM: dts: qcom: Build apq8016-sbc/DragonBoard 410c DTB on ARM32 The DragonBoard 410c is a convenient device for testing and debugging. Since there is support for using ARM32 kernels on MSM8916 now, also build the DB410c DTB on ARM32 so it can be used for testing. ARM64 is still the main supported architecture for DB410c but it actually works great on ARM32 as well. The "apq8016-sbc.dts" is simply included as-is from ARM64 similar to the approach used for Raspberry Pi (e.g. bcm2711-rpi-4-b.dts). Signed-off-by: Stephan Gerhold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211213113250.4249-1-stephan@gerhold.net commit 7f0ef89c0fa97e4bfdac3905eaca6aea35c8a9a7 Merge: 4754eab7e5a78 bf2c05b619ffc Author: Arnd Bergmann Date: Mon Dec 13 23:48:57 2021 +0100 Merge tag 'asahi-soc-dt-5.17' of https://github.com/AsahiLinux/linux into arm/dt Apple SoC DT updates for 5.17: - Separate DTs for all t8103 platforms - Add i2c and cd321x nodes - Bindings for apple,wdt - PMGR bindings and DT updates to instantiate it - WiFi MAC address DT handling This also includes the MAINTAINERS change for the PMGR driver itself, to avoid merge issues; the driver will be sent in a different pull. Manual fixups: Added i2c power domain references to the PMGR DT commit, since a prior commit added the i2c nodes. * tag 'asahi-soc-dt-5.17' of https://github.com/AsahiLinux/linux: arm64: dts: apple: t8103: Expose PCI node for the WiFi MAC address arm64: dts: apple: t8103: Add UART2 arm64: dts: apple: t8103: Add PMGR nodes dt-bindings: arm: apple: Add apple,pmgr binding dt-bindings: power: Add apple,pmgr-pwrstate binding MAINTAINERS: Add PMGR power state files to ARM/APPLE MACHINE dt-bindings: watchdog: Add Apple Watchdog dt-bindings: interrupt-controller: apple,aic: Add power-domains property dt-bindings: pinctrl: apple,pinctrl: Add power-domains property dt-bindings: iommu: apple,dart: Add power-domains property dt-bindings: i2c: apple,i2c: Add power-domains property arm64: dts: apple: t8103: Add cd321x nodes arm64: dts: apple: t8103: Add i2c nodes arm64: dts: apple: Add missing M1 (t8103) devices dt-bindings: arm: apple: Add iMac (24-inch 2021) to Apple bindings arm64: dts: apple: add #interrupt-cells property to pinctrl nodes dt-bindings: i2c: apple,i2c: allow multiple compatibles arm64: dts: apple: change ethernet0 device type to ethernet Link: https://lore.kernel.org/r/e18b476c-7b1f-de73-53a2-0e21fb5cd283@marcan.st Signed-off-by: Arnd Bergmann commit 4754eab7e5a78bdefe7a960c5c260c95ebbb5fa6 Author: Christian Lamparter Date: Mon Dec 6 01:43:34 2021 +0100 ARM: dts: gemini: NAS4220-B: fis-index-block with 128 KiB sectors Steven Maddox reported in the OpenWrt bugzilla, that his RaidSonic IB-NAS4220-B was no longer booting with the new OpenWrt 21.02 (uses linux 5.10's device-tree). However, it was working with the previous OpenWrt 19.07 series (uses 4.14). |[ 5.548038] No RedBoot partition table detected in 30000000.flash |[ 5.618553] Searching for RedBoot partition table in 30000000.flash at offset 0x0 |[ 5.739093] No RedBoot partition table detected in 30000000.flash |... |[ 7.039504] Waiting for root device /dev/mtdblock3... The provided bootlog shows that the RedBoot partition parser was looking for the partition table "at offset 0x0". Which is strange since the comment in the device-tree says it should be at 0xfe0000. Further digging on the internet led to a review site that took some useful PCB pictures of their review unit back in February 2009. Their picture shows a Spansion S29GL128N11TFI01 flash chip. >From Spansion's Datasheet: "S29GL128N: One hundred twenty-eight 64 Kword (128 Kbyte) sectors" Steven also provided a "cat /sys/class/mtd/mtd0/erasesize" from his unit: "131072". With the 128 KiB Sector/Erasesize in mind. This patch changes the fis-index-block property to (0xfe0000 / 0x20000) = 0x7f. Fixes: b5a923f8c739 ("ARM: dts: gemini: Switch to redboot partition parsing") Reported-by: Steven Maddox Signed-off-by: Christian Lamparter Signed-off-by: Linus Walleij Tested-by: Steven Maddox Link: https://lore.kernel.org/r/20211206004334.4169408-1-linus.walleij@linaro.org' Bugzilla: https://bugs.openwrt.org/index.php?do=details&task_id=4137 Signed-off-by: Arnd Bergmann commit a78a42fb48b8f261ab122c929f78c272ffc26d1b Author: Stephan Gerhold Date: Thu Dec 2 15:55:05 2021 +0100 ASoC: qcom: apq8016_sbc: Allow routing audio through QDSP6 The apq8016-sbc-sndcard is designed to be used with the LPASS drivers (bypassing the combined audio/modem DSP in MSM8916/APQ8016). Make it possible to use QDSP6 audio instead for the msm8916-qdsp6-sndcard. This only requires adding some additional hooks that set up the DPCM backends correctly. Similar code is already used in drivers for newer SoCs such as apq8096.c, sdm845.c and sm8250.c. A slightly different initialization sequence is used for the apq8016-sbc and msm8916-qdsp6 sound card by defining the apq8016_sbc_add_ops() function as device match data. Cc: Srinivas Kandagatla Signed-off-by: Stephan Gerhold Reviewed-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20211202145505.58852-6-stephan@gerhold.net Signed-off-by: Mark Brown commit 38192dc36f1fe1615b7a12cc78b9354d6b4ba8b7 Author: Stephan Gerhold Date: Thu Dec 2 15:55:04 2021 +0100 ASoC: dt-bindings: qcom: Document qcom,msm8916-qdsp6-sndcard compatible There are two possible audio setups on MSM8916/APQ8016: Normally the audio is routed through the audio/modem DSP (covered by the qdsp6 driver). During upstreaming for the DragonBoard 410c it was decided to bypass it and instead talk directly to the audio controller using the "lpass" driver. Bypassing the DSP gives more control about the audio configuration but limits the functionality: For example, routing audio through the audio/modem DSP is strictly required for voice call audio. Also, without the special changes in the DB410c firmware other MSM8916 devices can only use the bypass as long as the modem DSP is not started. Otherwise, the firmware will assume control of the LPASS hardware block and audio is no longer functional. Add support for using the DSP audio setup instead using a new "qcom,msm8916-qdsp6-sndcard" compatible. It is basically a mixture of the apq8016-sbc-sndcard and the newer sm8250-sndcard, which uses indirect QDSP6 DAI links instead of the direct LPASS DAI links. Cc: Srinivas Kandagatla Signed-off-by: Stephan Gerhold Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211202145505.58852-5-stephan@gerhold.net Signed-off-by: Mark Brown commit b7875d88bf70100d2fe0dc08072018f994ccd6c4 Author: Stephan Gerhold Date: Thu Dec 2 15:55:03 2021 +0100 ASoC: dt-bindings: qcom: apq8016-sbc: Move to qcom,sm8250 DT schema All the Qualcomm sound card drivers use the same common device tree parsing code, so the allowed device tree nodes are almost the same for all of them. Convert the qcom,apq8016-sbc-sndcard documentation to a DT schema by adding it to the existing qcom,sm8250 schema. The only speciality of qcom,apq8016-sbc-sndcard is that it has memory resources for setting up an I/O mux. This can be handled using a conditional if statement that only requires it for the apq8016-sbc compatible. Cc: Srinivas Kandagatla Signed-off-by: Stephan Gerhold Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211202145505.58852-4-stephan@gerhold.net Signed-off-by: Mark Brown commit 1875ae76f82c5c9acd7b7f44bd9226fbcbe858b7 Author: Stephan Gerhold Date: Thu Dec 2 15:55:02 2021 +0100 ASoC: dt-bindings: qcom: sm8250: Document "aux-devs" The sm8250 audio driver uses the common Qualcomm device tree parser and therefore already supports the "aux-devs" property that allows adding additional auxiliary devices to the sound card (e.g. analog speaker amplifiers that can be connected using "audio-routing"). Document the property in the DT schema for sm8250 as well. The description is taken from simple-card.yaml which has a very similar property. Cc: Srinivas Kandagatla Signed-off-by: Stephan Gerhold Acked-by: Rob Herring Link: https://lore.kernel.org/r/20211202145505.58852-3-stephan@gerhold.net Signed-off-by: Mark Brown commit c55676ec292e0ff83261eb61efaf99a91079a3b8 Author: Stephan Gerhold Date: Thu Dec 2 15:55:01 2021 +0100 ASoC: dt-bindings: qcom: sm8250: Drop redundant MultiMedia routes The MultiMedia audio routes can be deduced from other parts of the device tree (e.g. the definitions of the MultiMedia DAIs) and therefore specifying them again in "audio-routing" is redundant and prone to mistakes. This is no longer necessary since commit 6fd8d2d275f7 ("ASoC: qcom: qdsp6: Move frontend AIFs to q6asm-dai"). Let's drop them from the example in the DT schema as well to avoid confusion. Cc: Srinivas Kandagatla Signed-off-by: Stephan Gerhold Acked-by: Rob Herring Link: https://lore.kernel.org/r/20211202145505.58852-2-stephan@gerhold.net Signed-off-by: Mark Brown commit f742fc68ac0da76d96e5713210b0aef771c1dd0f Author: Grant Seltzer Date: Thu Dec 9 18:22:22 2021 -0500 libbpf: Add doc comments for bpf_program__(un)pin() This adds doc comments for the two bpf_program pinning functions, bpf_program__pin() and bpf_program__unpin() Signed-off-by: Grant Seltzer Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211209232222.541733-1-grantseltzer@gmail.com commit 08c4aa3ee26445ae0d027c1e1944e1202687b024 Author: Rob Clark Date: Thu Dec 9 11:31:13 2021 -0800 drm/msm/a6xx: Skip crashdumper state if GPU needs_hw_init I am seeing some crash logs which imply that we are trying to use crashdumper hw to read back GPU state when the GPU isn't initialized. This doesn't go well (for example, GPU could be in 32b address mode and ignoring the upper bits of buffer that it is trying to dump state to). I'm not *quite* sure how we get into this state in the first place, but lets not make a bad situation worse by triggering iova fault crashes. While we're at it, also add the information about whether the GPU is initialized to the devcore dump to make this easier to see in the logs (which makes the WARN_ON() redundant and even harmful because it fills up the small bit of dmesg we get with the crash report). Signed-off-by: Rob Clark Link: https://lore.kernel.org/r/20211209193118.1163248-1-robdclark@gmail.com Signed-off-by: Rob Clark commit acd143eefb8270b8f50e2ce44e2fcdbbcf496a86 Author: Jean-Philippe Brucker Date: Mon Dec 13 18:30:59 2021 +0000 selftests/bpf: Fix segfault in bpf_tcp_ca Since commit ad9a7f96445b ("libbpf: Improve logging around BPF program loading"), libbpf_debug_print() gets an additional prog_name parameter but doesn't pass it to printf(). Since the format string now expects two arguments, printf() may read uninitialized data and segfault. Pass prog_name through. Fixes: ad9a7f96445b ("libbpf: Improve logging around BPF program loading") Signed-off-by: Jean-Philippe Brucker Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211213183058.346066-1-jean-philippe@linaro.org commit 47d9c6faa79e85a6e196e02cc74c4775d39546a0 Author: chiminghao Date: Thu Dec 9 01:58:23 2021 +0000 drm:amdgpu:remove unneeded variable return value form directly instead of taking this in another redundant variable. Reported-by: Zeal Robot Signed-off-by: chiminghao Signed-off-by: Alex Deucher commit c08d2f8bc16b56699673314eb0142ee863f137fe Author: Yann Dirson Date: Fri Dec 10 19:20:28 2021 +0100 Documentation/gpu: split amdgpu/index for readability This starts to make the formated index much more manageable to the reader. Reviewed-by: Rodrigo Siqueira Signed-off-by: Yann Dirson Signed-off-by: Alex Deucher commit ff7ac85282a12c4f4968fa810186fda32b10dea7 Author: Mario Limonciello Date: Mon Dec 13 09:05:09 2021 -0600 drivers/amd/pm: drop statement to print FW version for smu_v13 Update smu_v13 to match smu_v12 and smu_v11 behavior where this is fetched from debugfs rather than in kernel logs on every boot. Signed-off-by: Mario Limonciello Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 6f072a84550d93342d7f7282e661e3834a801159 Author: Mario Limonciello Date: Thu Dec 9 12:13:53 2021 -0600 drm/amd/pm: fix reading SMU FW version from amdgpu_firmware_info on YC This value does not get cached into adev->pm.fw_version during startup for smu13 like it does for other SMU like smu12. Signed-off-by: Mario Limonciello Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 240e6d25a0a8ab98c042e37b2fd3c1f2cbf3e561 Author: Isabella Basso Date: Wed Dec 8 14:46:51 2021 -0300 drm/amd/display: fix function scopes This turns previously global functions into static, thus removing compile-time warnings such as: warning: no previous prototype for 'get_highest_allowed_voltage_level' [-Wmissing-prototypes] 742 | unsigned int get_highest_allowed_voltage_level(uint32_t chip_family, uint32_t hw_internal_rev, uint32_t pci_revision_id) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ warning: no previous prototype for 'rv1_vbios_smu_send_msg_with_param' [-Wmissing-prototypes] 102 | int rv1_vbios_smu_send_msg_with_param(struct clk_mgr_internal *clk_mgr, unsigned int msg_id, unsigned int param) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Changes since v1: - As suggested by Rodrigo Siqueira: 1. Rewrite function signatures to make them more readable. 2. Get rid of unused functions in order to remove 'defined but not used' warnings. Reviewed-by: Rodrigo Siqueira Signed-off-by: Isabella Basso Signed-off-by: Alex Deucher commit 33c3365ec690c3857ecd579eef75e36a746a8122 Author: Michel Dänzer Date: Thu Dec 9 17:46:44 2021 +0100 drm/amd/display: Reduce stack size for dml31 UseMinimumDCFCLK Use the struct display_mode_lib pointer instead of passing lots of large arrays as parameters by value. Addresses this warning (resulting in failure to build a RHEL debug kernel with Werror enabled): ../drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn31/display_mode_vba_31.c: In function ‘UseMinimumDCFCLK’: ../drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn31/display_mode_vba_31.c:7478:1: warning: the frame size of 2128 bytes is larger than 2048 bytes [-Wframe-larger-than=] NOTE: AFAICT this function previously had no observable effect, since it only modified parameters passed by value and doesn't return anything. Now it may modify some values in struct display_mode_lib passed in by reference. Reviewed-by: Rodrigo Siqueira Signed-off-by: Michel Dänzer Signed-off-by: Alex Deucher commit c1e003d3ff6973aa896eef4e6a6d432e6afbff60 Author: Michel Dänzer Date: Thu Dec 9 17:46:43 2021 +0100 drm/amd/display: Reduce stack size for dml31_ModeSupportAndSystemConfigurationFull Move code using the Pipe struct to a new helper function. Works around[0] this warning (resulting in failure to build a RHEL debug kernel with Werror enabled): ../drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn31/display_mode_vba_31.c: In function ‘dml31_ModeSupportAndSystemConfigurationFull’: ../drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn31/display_mode_vba_31.c:5740:1: warning: the frame size of 2144 bytes is larger than 2048 bytes [-Wframe-larger-than=] The culprit seems to be the Pipe struct, so pull the relevant block out into its own sub-function. (This is porting commit a62427ef9b55 ("drm/amd/display: Reduce stack size for dml21_ModeSupportAndSystemConfigurationFull") from dml31 to dml21) [0] AFAICT this doesn't actually reduce the total amount of stack which can be used, just moves some of it from dml31_ModeSupportAndSystemConfigurationFull to the new helper function, so the former happens to no longer exceed the limit for a single function. Reviewed-by: Rodrigo Siqueira Signed-off-by: Michel Dänzer Signed-off-by: Alex Deucher commit ba6f8c135af02f8a38fb9856cfce6351a90f1ea4 Author: Isabella Basso Date: Thu Dec 9 12:47:22 2021 -0300 drm/amdgpu: re-format file header comments Fix the warning below: warning: Cannot understand * \file amdgpu_ioc32.c on line 2 - I thought it was a doc line Changes since v1: - As suggested by Alexander Deucher: 1. Reduce diff to minimum as this DOC section doesn't provide much value. Signed-off-by: Isabella Basso Signed-off-by: Alex Deucher commit 9be9bf4e3a5efc2991375e22ec9956dc654652ff Author: Isabella Basso Date: Thu Dec 9 12:47:21 2021 -0300 drm/amdgpu: remove unnecessary variables This fixes the warnings below, and also drops the display_count variable, as it's unused. In function 'svm_range_map_to_gpu': warning: variable 'bo_va' set but not used [-Wunused-but-set-variable] 1172 | struct amdgpu_bo_va bo_va; | ^~~~~ ... In function 'dcn201_update_clocks': warning: variable 'enter_display_off' set but not used [-Wunused-but-set-variable] 132 | bool enter_display_off = false; | ^~~~~~~~~~~~~~~~~ Changes since v1: - As suggested by Rodrigo Siqueira: 1. Drop display_count variable. - As suggested by Felix Kuehling: 1. Remove block surrounding amdgpu_xgmi_same_hive. Reviewed-by: Felix Kuehling Signed-off-by: Isabella Basso Signed-off-by: Alex Deucher commit 929bb8e200412da36aca4b61209ec26283f9c184 Author: Isabella Basso Date: Thu Dec 9 12:47:19 2021 -0300 drm/amdgpu: fix amdgpu_ras_mca_query_error_status scope This commit fixes the compile-time warning below: warning: no previous prototype for ‘amdgpu_ras_mca_query_error_status’ [-Wmissing-prototypes] Changes since v1: - As suggested by Alexander Deucher: 1. Make function static instead of adding prototype. Signed-off-by: Isabella Basso Signed-off-by: Alex Deucher commit 2b36afc694bb3eba5a065c34fa0d735d623ae66f Author: Mario Limonciello Date: Fri Dec 10 09:49:52 2021 -0600 drm/amd: move variable to local scope `edp_stream` is only used when backend is enabled on eDP, don't declare the variable outside that scope. Signed-off-by: Mario Limonciello Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 4fe3819443a13f8ecf11f53559ada5711dd8d4b1 Author: Mario Limonciello Date: Fri Dec 10 09:45:23 2021 -0600 drm/amd: add some extra checks that is_dig_enabled is defined There are a few places that this isn't checked that could potentially be a NULL pointer access. Signed-off-by: Mario Limonciello Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 28fe416466f2f09b47a9c5e81fa1ac140512f3d5 Author: Philip Yang Date: Mon Dec 6 21:17:14 2021 -0500 drm/amdgpu: Reduce SG bo memory usage for mGPUs For userptr bo, if adev is not in IOMMU isolation mode, RAM direct map to GPU, multiple GPUs use same system memory dma mapping address, they can share the original mem->bo in attachment to reduce dma address array memory usage. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 4a74c38cd67b3e74a1dacc76c7ac5c276bfdeab5 Author: Philip Yang Date: Mon Dec 6 21:10:52 2021 -0500 drm/amdgpu: Detect if amdgpu in IOMMU direct map mode If host and amdgpu IOMMU is not enabled or IOMMU is pass through mode, set adev->ram_is_direct_mapped flag which will be used to optimize memory usage for multi GPU mappings. Signed-off-by: Philip Yang Reviewed-by: Alex Deucher Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit a723c6d0785acf9e4bf5b77167d6a0c32ecf8503 Author: Rodrigo Siqueira Date: Thu Nov 25 10:38:30 2021 -0500 Documentation/gpu: Add amdgpu and dc glossary In the DC driver, we have multiple acronyms that are not obvious most of the time; the same idea is valid for amdgpu. This commit introduces a DC and amdgpu glossary in order to make it easier to navigate through our driver. Changes since V3: - Yann: Add new acronyms to amdgpu glossary - Daniel: Add link between dc and amdgpu glossary Changes since V2: - Add MMHUB Changes since V1: - Yann: Divide glossary based on driver context. - Alex: Make terms more consistent and update CPLIB - Add new acronyms to the glossary Reviewed-by: Yann Dirson Reviewed-by: Harry Wentland Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 522968aeed29ff4e3ead39d654456ca354387586 Author: Rodrigo Siqueira Date: Thu Nov 25 10:38:29 2021 -0500 Documentation/gpu: Add basic overview of DC pipeline This commit describes how DCN works by providing high-level diagrams with an explanation of each component. In particular, it details the Global Sync signals. Change since V2: - Add a comment about MMHUBBUB. Reviewed-by: Yann Dirson Reviewed-by: Harry Wentland Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 76659755b4bf3e73a91c08248dff5a1e6e01db46 Author: Rodrigo Siqueira Date: Thu Nov 25 10:38:28 2021 -0500 Documentation/gpu: How to collect DTN log Introduce how to collect DTN log from debugfs. Reviewed-by: Yann Dirson Reviewed-by: Harry Wentland Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit b2568d6834ea5b05f14bf48ec22a474c291b30f2 Author: Rodrigo Siqueira Date: Thu Nov 25 10:38:27 2021 -0500 Documentation/gpu: Document pipe split visual confirmation Display core provides a feature that makes it easy for users to debug Pipe Split. This commit introduces how to use such a debug option. Reviewed-by: Yann Dirson Reviewed-by: Harry Wentland Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 7971fb3502bbd6b1b88f185879f98f9cc82958df Author: Rodrigo Siqueira Date: Thu Nov 25 10:38:26 2021 -0500 Documentation/gpu: Document amdgpu_dm_visual_confirm debugfs entry Display core provides a feature that makes it easy for users to debug Multiple planes by enabling a visual notification at the bottom of each plane. This commit introduces how to use such a feature. Reviewed-by: Yann Dirson Reviewed-by: Harry Wentland Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit e91f840142eed8705e6682f838da99a97bd7ea25 Author: Rodrigo Siqueira Date: Thu Nov 25 10:38:25 2021 -0500 Documentation/gpu: Reorganize DC documentation Display core documentation is not well organized, and it is hard to find information due to the lack of sections. This commit reorganizes the documentation layout, and it is preparation work for future changes. Changes since V1: - Christian: Group amdgpu documentation together. - Daniel: Drop redundant amdgpu prefix. - Jani: Create index pages. - Yann: Mirror display folder in the documentation. Reviewed-by: Yann Dirson Reviewed-by: Harry Wentland Signed-off-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 6ff7fddbd12064dc9de03e0c1ad03e13f6ba7af8 Author: Lang Yu Date: Tue Nov 30 11:06:40 2021 +0800 drm/amdgpu: add support for SMU debug option SMU firmware expects the driver maintains error context and doesn't interact with SMU any more when SMU errors occurred. That will aid in debugging SMU firmware issues. Add SMU debug option support for this request, it can be enabled or disabled via amdgpu_smu_debug debugfs file. Use a 32-bit mask to indicate corresponding debug modes. Currently, only one mode(HALT_ON_ERROR) is supported. When enabled, it brings hardware to a kind of halt state so that no one can touch it any more in the envent of SMU errors. The dirver interacts with SMU via sending messages. And threre are three ways to sending messages to SMU in current implementation. Handle them respectively as following: 1, smu_cmn_send_smc_msg_with_param() for normal timeout cases Halt on any error. 2, smu_cmn_send_msg_without_waiting()/smu_cmn_wait_for_response() for longer timeout cases Halt on errors apart from ETIME. Otherwise this way won't work. Let the user handle ETIME error in such a case. 3, smu_cmn_send_msg_without_waiting() for no waiting cases Halt on errors apart from ETIME. Otherwise second way won't work. == Command Guide == 1, enable HALT_ON_ERROR mode # echo 0x1 > /sys/kernel/debug/dri/0/amdgpu_smu_debug 2, disable HALT_ON_ERROR mode # echo 0x0 > /sys/kernel/debug/dri/0/amdgpu_smu_debug v5: - Use bit mask to allow more debug features.(Evan) - Use WRAN() instead of BUG().(Evan) v4: - Set to halt state instead of a simple hang.(Christian) v3: - Use debugfs_create_bool().(Christian) - Put variable into smu_context struct. - Don't resend command when timeout. v2: - Resend command when timeout.(Lijo) - Use debugfs file instead of module parameter. Signed-off-by: Lang Yu Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 34f3a4a98bd388ad6298c42dc9b00c72d3398330 Author: Lang Yu Date: Thu Dec 9 15:10:32 2021 +0800 drm/amdgpu: introduce a kind of halt state for amdgpu device It is useful to maintain error context when debugging SW/FW issues. Introduce amdgpu_device_halt() for this purpose. It will bring hardware to a kind of halt state, so that no one can touch it any more. Compare to a simple hang, the system will keep stable at least for SSH access. Then it should be trivial to inspect the hardware state and see what's going on. v2: - Set adev->no_hw_access earlier to avoid potential crashes.(Christian) Suggested-by: Christian Koenig Suggested-by: Andrey Grodzovsky Signed-off-by: Lang Yu Reviewed-by: Christian Koenig Signed-off-by: Alex Deucher commit cace4bff750ff4f55b16c3aa90aa9376d7488929 Author: Hawking Zhang Date: Thu Nov 25 15:41:37 2021 +0800 drm/amdgpu: check df_funcs and its callback pointers in case they are not avaiable in early phase Signed-off-by: Hawking Zhang Reviewed-by: Le Ma Signed-off-by: Alex Deucher commit 4ac955baa9330742b1a49990d830963f91bfa020 Author: Hawking Zhang Date: Sat Dec 4 19:22:12 2021 +0800 drm/amdgpu: don't override default ECO_BITs setting Leave this bit as hardware default setting Signed-off-by: Hawking Zhang Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 2c113b999c20a6083a9d65f0e2d2537ed818b395 Author: Le Ma Date: Sat Dec 4 18:59:08 2021 +0800 drm/amdgpu: correct register access for RLC_JUMP_TABLE_RESTORE should count on GC IP base address Signed-off-by: Le Ma Signed-off-by: Hawking Zhang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 2cb6577a303425090f3b5f4c40096d45a9048875 Author: Hawking Zhang Date: Mon Nov 22 21:32:48 2021 +0800 drm/amdgpu: read and authenticate ip discovery binary read and authenticate ip discovery binary getting from vram first, if it is not valid, read and authenticate the one getting from file Signed-off-by: Hawking Zhang Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 32f0e1a3307f1372824dcf28b90fdab5aa11b54f Author: Hawking Zhang Date: Mon Nov 22 21:19:06 2021 +0800 drm/amdgpu: add helper to verify ip discovery binary signature To be used to check ip discovery binary signature Signed-off-by: Hawking Zhang Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit f6dcaf0c07480f8b7e7568e3bf3c4b776026edfc Author: Hawking Zhang Date: Mon Nov 22 20:12:59 2021 +0800 drm/amdgpu: rename discovery_read_binary helper add _from_vram in the funciton name to diffrentiate the one used to read from file Signed-off-by: Hawking Zhang Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 43a80bd511aa6077a79768335211f71760ee063f Author: Hawking Zhang Date: Tue Nov 23 15:25:03 2021 +0800 drm/amdgpu: add helper to load ip_discovery binary from file To be used when ip_discovery binary is not carried by vbios Signed-off-by: Hawking Zhang Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit c40bdfb2ffa4cf16b818fd6c77856e6d976f52ff Author: Leslie Shi Date: Wed Dec 8 15:47:41 2021 +0800 drm/amdgpu: fix incorrect VCN revision in SRIOV Guest OS will setup VCN instance 1 which is disabled as an enabled instance and execute initialization work on it, but this causes VCN ib ring test failure on the disabled VCN instance during modprobe: amdgpu 0000:00:08.0: amdgpu: ring vcn_enc_1.0 uses VM inv eng 5 on hub 1 amdgpu 0000:00:08.0: [drm:amdgpu_ib_ring_tests [amdgpu]] *ERROR* IB test failed on vcn_dec_0 (-110). amdgpu 0000:00:08.0: [drm:amdgpu_ib_ring_tests [amdgpu]] *ERROR* IB test failed on vcn_enc_0.0 (-110). [drm:amdgpu_device_delayed_init_work_handler [amdgpu]] *ERROR* ib ring test failed (-110). v2: drop amdgpu_discovery_get_vcn_version and rename sriov_config to vcn_config v3: modify VCN's revision in SR-IOV and bare-metal Fixes: baf3f8f3740625 ("drm/amdgpu: handle SRIOV VCN revision parsing") Signed-off-by: Leslie Shi Reviewed-by: Lijo Lazar Reviewed-by: Guchun Chen Signed-off-by: Alex Deucher commit 4046afcebfc3c8c0dd5666c2671b2c192b344f78 Author: Leslie Shi Date: Mon Dec 6 16:44:54 2021 +0800 drm/amdgpu: add modifiers in amdgpu_vkms_plane_init() Fix following warning in SRIOV during modprobe: amdgpu 0000:00:08.0: GFX9+ requires FB check based on format modifier WARNING: CPU: 0 PID: 1023 at drivers/gpu/drm/amd/amdgpu/amdgpu_display.c:1150 amdgpu_display_framebuffer_init+0x8e7/0xb40 [amdgpu] Signed-off-by: Leslie Shi Reviewed-by: Guchun Chen Signed-off-by: Alex Deucher commit addaac0cf75dbccf5c33a5c03d6b22a6bbdf9952 Author: Jonathan Kim Date: Thu Dec 9 22:01:22 2021 -0500 drm/amdgpu: disable default navi2x co-op kernel support This patch reverts the following: commit 48733b224fa7ba ("drm/amdkfd: add Navi2x to GWS init conditions") Disable GWS usage in default settings for now due to FW bugs. Signed-off-by: Jonathan Kim Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 48733b224fa7ba32de9e9a1a8ddc8eedcd603919 Author: Graham Sider Date: Thu Dec 9 13:26:05 2021 -0500 drm/amdkfd: add Navi2x to GWS init conditions Initalize GWS on Navi2x with mec2_fw_version >= 0x42. Signed-off-by: Graham Sider Reviewed-and-tested-by: Jonathan Kim Signed-off-by: Alex Deucher commit 613aa3ea74ae012d4ff7a6e6ed6d288b6212e4f1 Author: Lang Yu Date: Fri Dec 3 14:30:16 2021 +0800 drm/amdgpu: only hw fini SMU fisrt for ASICs need that We found some headaches on ASICs don't need that, so remove that for them. Suggested-by: Lijo Lazar Signed-off-by: Lang Yu Reviewed-by: Kevin Wang Signed-off-by: Alex Deucher commit a60831ea3ab2498d16f625c74b9e782383614cdc Author: Lang Yu Date: Fri Dec 3 14:20:48 2021 +0800 drm/amdgpu: remove power on/off SDMA in SMU hw_init/fini() Currently, we don't find some neccesities to power on/off SDMA in SMU hw_init/fini(). It makes more sense in SDMA hw_init/fini(). Signed-off-by: Lang Yu Reviewed-by: Kevin Wang Signed-off-by: Alex Deucher commit 0f7ef0b99da15b28fad78da788e55adc642283c8 Author: Felix Kuehling Date: Tue Dec 7 22:20:35 2021 -0500 drm/amdkfd: Make KFD support on Hawaii experimental Hawaii support is mostly untested these days. ROCm user mode also depends on custom firmware for AQL packet processing, that was never pushed upstream due to quality regressions in graphics driver testing. Signed-off-by: Felix Kuehling Reviewed-by: Kent Russell Signed-off-by: Alex Deucher commit 4853cbcd94bdd654e94aa40ae718efcf5b6ae57a Author: Felix Kuehling Date: Tue Dec 7 21:04:06 2021 -0500 drm/amdkfd: Don't split unchanged SVM ranges If an existing SVM range overlaps an svm_range_set_attr call, we would normally split it in order to update only the overlapping part. However, if the attributes of the existing range would not be changed splitting it is unnecessary. Signed-off-by: Felix Kuehling Reviewed-by: Philip Yang Signed-off-by: Alex Deucher commit f864df76ff1021b21776a7df029c0da884794c28 Author: Felix Kuehling Date: Tue Dec 7 21:02:42 2021 -0500 drm/amdkfd: Fix svm_range_is_same_attrs The existing function doesn't compare the access bitmaps and flags. This can result in failure to update those attributes in existing ranges when all other attributes remained unchanged. Because the access and flags attributes modify only some bits in the respective bitmaps, we cannot compare them directly. Instead we need to check whether applying the attributes to a particular range would change the bitmaps. A PREFETCH_LOC attribute must always trigger a migration, even if the attribute value remains unchanged. E.g. if some pages were migrated due to a CPU page fault, a prefetch must still be executed to migrate pages back to VRAM. Signed-off-by: Felix Kuehling Reviewed-by: Philip Yang Signed-off-by: Alex Deucher commit 726be40607264b180a2b336c81e1dcff941de618 Author: Felix Kuehling Date: Tue Dec 7 20:23:14 2021 -0500 drm/amdkfd: Fix error handling in svm_range_add Add null-pointer check after the last svm_range_new call. This was originally reported by Zhou Qingyang based on a static analyzer. To avoid duplicating the unwinding code from svm_range_handle_overlap, I merged the two functions into one. Signed-off-by: Felix Kuehling Cc: Zhou Qingyang Reviewed-by: Philip Yang Signed-off-by: Alex Deucher commit 0771c805918c56b335c8f726e147b19c4f78565b Author: Philip Yang Date: Wed Dec 8 14:55:15 2021 -0500 drm/amdgpu: Handle fault with same timestamp Remove not unique timestamp WARNING as same timestamp interrupt happens on some chips, Drain fault need to wait for the processed_timestamp to be truly greater than the checkpoint or the ring to be empty to be sure no stale faults are handled. Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1818 Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Reviewed-by: Christian König Signed-off-by: Alex Deucher commit e105b64a364adb0fd0b780050441eb05468fee33 Author: Isabella Basso Date: Tue Dec 7 22:25:27 2021 -0300 drm/amdgpu: fix location of prototype for amdgpu_kms_compat_ioctl This fixes the warning below by changing the prototype to a location that's actually included by the .c files that call amdgpu_kms_compat_ioctl: warning: no previous prototype for ‘amdgpu_kms_compat_ioctl’ [-Wmissing-prototypes] 37 | long amdgpu_kms_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | ^~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Isabella Basso Signed-off-by: Alex Deucher commit 64cf26f04ad05ac7b4fc7d3339d893f21a06cab1 Author: Isabella Basso Date: Tue Dec 7 22:25:26 2021 -0300 drm/amd: append missing includes This fixes warnings caused by global functions lacking prototypes:, such as: warning: no previous prototype for 'dcn303_hw_sequencer_construct' [-Wmissing-prototypes] 12 | void dcn303_hw_sequencer_construct(struct dc *dc) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ... warning: no previous prototype for ‘amdgpu_has_atpx’ [-Wmissing-prototypes] 76 | bool amdgpu_has_atpx(void) { | ^~~~~~~~~~~~~~~ Reviewed-by: Rodrigo Siqueira Signed-off-by: Isabella Basso Signed-off-by: Alex Deucher commit ded331a0710db8e92f3efd1c8040c0c52997c9b5 Author: Isabella Basso Date: Tue Dec 7 22:25:24 2021 -0300 drm/amdkfd: fix function scopes This turns previously global functions into static, thus removing compile-time warnings such as: warning: no previous prototype for 'pm_set_resources_vi' [-Wmissing-prototypes] 113 | int pm_set_resources_vi(struct packet_manager *pm, uint32_t *buffer, | ^~~~~~~~~~~~~~~~~~~ Signed-off-by: Isabella Basso Signed-off-by: Alex Deucher commit 2351b7d4e3fd636f8ce0bb9554645dff2dbe86ce Author: Isabella Basso Date: Tue Dec 7 22:25:23 2021 -0300 drm/amdgpu: fix function scopes This turns previously global functions into static, thus removing compile-time warnings such as: warning: no previous prototype for 'amdgpu_vkms_output_init' [-Wmissing-prototypes] 399 | int amdgpu_vkms_output_init(struct drm_device *dev, | ^~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Isabella Basso Signed-off-by: Alex Deucher commit bbe04dec5c52a075175a627d510140d386a71f98 Author: Isabella Basso Date: Tue Dec 7 22:25:21 2021 -0300 drm/amd: fix improper docstring syntax This fixes various warnings relating to erroneous docstring syntax, of which some are listed below: warning: Function parameter or member 'adev' not described in 'amdgpu_atomfirmware_ras_rom_addr' ... warning: expecting prototype for amdgpu_atpx_validate_functions(). Prototype was for amdgpu_atpx_validate() instead ... warning: Excess function parameter 'mem' description in 'amdgpu_preempt_mgr_new' ... warning: Cannot understand * @kfd_get_cu_occupancy - Collect number of waves in-flight on this device ... warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst Signed-off-by: Isabella Basso Signed-off-by: Alex Deucher commit 0e2a82a316825ba1d0bf35703ceddd4840e59bca Author: Isabella Basso Date: Tue Dec 7 22:25:20 2021 -0300 drm/amd: Mark IP_BASE definition as __maybe_unused Silences 166 compile-time warnings like: warning: 'UVD0_BASE' defined but not used [-Wunused-const-variable=] 129 | static const struct IP_BASE UVD0_BASE ={ { { { 0x00007800, 0x00007E00, 0, 0, 0 } }, | ^~~~~~~~~ warning: 'UMC0_BASE' defined but not used [-Wunused-const-variable=] 123 | static const struct IP_BASE UMC0_BASE ={ { { { 0x00014000, 0, 0, 0, 0 } }, | ^~~~~~~~~ Signed-off-by: Isabella Basso Signed-off-by: Alex Deucher commit 85a774d9ada4eb9e83044cefecf2712a2d7171bf Author: Zhigang Luo Date: Mon Dec 6 16:40:24 2021 -0500 drm/amdgpu: extended waiting SRIOV VF reset completion timeout to 10s For the ASIC has big FB, it need more time to clear FB during reset. This change extended SRIOV VF waiting reset completion timeout from 5s to 10s. Signed-off-by: Zhigang Luo Acked-by: Shaoyun Liu Signed-off-by: Alex Deucher commit a5f67c939eb2d3841c110c5355bf2226e1850828 Author: Zhigang Luo Date: Mon Dec 6 16:21:03 2021 -0500 drm/amdgpu: recover XGMI topology for SRIOV VF after reset For SRIOV VF, the XGMI topology was not recovered after reset. This change added code to SRIOV VF reset function to update XGMI topology for SRIOV VF after reset. Signed-off-by: Zhigang Luo Reviewed-by: Shaoyun Liu Signed-off-by: Alex Deucher commit dd26e018aaa408faaf16168cbc7e83c2b159ae63 Author: Zhigang Luo Date: Mon Dec 6 14:52:00 2021 -0500 drm/amdgpu: added PSP XGMI initialization for SRIOV VF during recover For SRIOV VF, XGMI was not initialized in PSP during recover. This change added PSP XGMI initialization for SRIOV VF during recover. Signed-off-by: Zhigang Luo Reviewed-by: Shaoyun Liu Signed-off-by: Alex Deucher commit 175ac6ec6bd8db6b7e08fed8fd189bd492015b28 Author: Zhigang Luo Date: Fri Nov 26 12:16:45 2021 -0500 drm/amdgpu: skip reset other device in the same hive if it's SRIOV VF On SRIOV, host driver can support FLR(function level reset) on individual VF within the hive which might bring the individual device back to normal without the necessary to execute the hive reset. If the FLR failed , host driver will trigger the hive reset, each guest VF will get reset notification before the real hive reset been executed. The VF device can handle the reset request individually in it's reset work handler. This change updated gpu recover sequence to skip reset other device in the same hive for SRIOV VF. Signed-off-by: Zhigang Luo Reviewed-by: Shaoyun Liu Signed-off-by: Alex Deucher commit 123202744955e62470174fc3ba666a4d98062ea6 Author: Aurabindo Pillai Date: Tue Dec 7 12:14:40 2021 -0500 drm/amd/display: Add feature flags to disable LTTPR [Why] Allow for disabling non transparent mode of LTTPR for running tests. [How] Add a feature flag and set them during init sequence. The flags are already being used in DC. Signed-off-by: Aurabindo Pillai Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 655ff3538eee3a3dca7103f97de883e033bd1011 Author: Tao Zhou Date: Wed Dec 8 14:01:09 2021 +0800 drm/amdgpu: enable RAS poison flag when GPU is connected to CPU The RAS poison mode is enabled by default on the platform. Signed-off-by: Tao Zhou Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 7e4aeed859d47474e40f43ef6ef3004ab52486be Author: Fangzhi Zuo Date: Tue Dec 7 13:47:51 2021 -0500 drm/amd/display: Add Debugfs Entry to Force in SST Sequence It is to force SST sequence on MST capable receivers. v2: squash in compilation fix when CONFIG_DRM_AMD_DC_DCN is not set Signed-off-by: Fangzhi Zuo Reviewed-by: Aurabindo Pillai Signed-off-by: Alex Deucher commit c8064e5b4adac5e1255cf4f3b374e75b5376e7ca Author: Paolo Abeni Date: Tue Nov 30 11:08:07 2021 +0100 bpf: Let bpf_warn_invalid_xdp_action() report more info In non trivial scenarios, the action id alone is not sufficient to identify the program causing the warning. Before the previous patch, the generated stack-trace pointed out at least the involved device driver. Let's additionally include the program name and id, and the relevant device name. If the user needs additional infos, he can fetch them via a kernel probe, leveraging the arguments added here. Signed-off-by: Paolo Abeni Signed-off-by: Daniel Borkmann Acked-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/bpf/ddb96bb975cbfddb1546cf5da60e77d5100b533c.1638189075.git.pabeni@redhat.com commit 2cbad989033bff0256675c38f96f5faab852af4b Author: Paolo Abeni Date: Tue Nov 30 11:08:06 2021 +0100 bpf: Do not WARN in bpf_warn_invalid_xdp_action() The WARN_ONCE() in bpf_warn_invalid_xdp_action() can be triggered by any bugged program, and even attaching a correct program to a NIC not supporting the given action. The resulting splat, beyond polluting the logs, fouls automated tools: e.g. a syzkaller reproducers using an XDP program returning an unsupported action will never pass validation. Replace the WARN_ONCE with a less intrusive pr_warn_once(). Signed-off-by: Paolo Abeni Signed-off-by: Daniel Borkmann Acked-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/bpf/016ceec56e4817ebb2a9e35ce794d5c917df572c.1638189075.git.pabeni@redhat.com commit 7fa7ffcf9babaea2f0a81681b4ef460ee4b93278 Author: Daniel Latypov Date: Fri Nov 19 19:24:01 2021 -0800 kunit: tool: suggest using decode_stacktrace.sh on kernel crash kunit.py isn't very clear that 1) it stashes a copy of the unparsed output in $BUILD_DIR/test.log 2) it sets $BUILD_DIR=.kunit by default So it's trickier than it should be for a user to come up with the right command to do so. Make kunit.py print out a command for this if a) we saw a test case crash b) we only ran one kernel (test.log only contains output from the last) Example suggested command: $ scripts/decode_stacktrace.sh .kunit/vmlinux .kunit < .kunit/test.log | tee .kunit/decoded.log | ./tools/testing/kunit/kunit.py parse Without debug info a user might see something like [14:11:25] Call Trace: [14:11:25] ? kunit_binary_assert_format (:?) [14:11:25] kunit_try_run_case (test.c:?) [14:11:25] ? __kthread_parkme (kthread.c:?) [14:11:25] kunit_generic_run_threadfn_adapter (try-catch.c:?) [14:11:25] ? kunit_generic_run_threadfn_adapter (try-catch.c:?) [14:11:25] kthread (kthread.c:?) [14:11:25] new_thread_handler (:?) [14:11:25] [CRASHED] `tee` is in GNU coreutils, so it seems fine to add that into the pipeline by default, that way users can inspect the otuput in more detail. Note: to turn on debug info, users would need to do something like $ echo -e 'CONFIG_DEBUG_KERNEL=y\nCONFIG_DEBUG_INFO=y' >> .kunit/.kunitconfig $ ./tools/testing/kunit/kunit.py config $ ./tools/testing/kunit/kunit.py build $ This feels too clunky to include in the instructions. With --kconfig_add [1], it would become a bit less painful. [1] https://lore.kernel.org/linux-kselftest/20211106013058.2621799-2-dlatypov@google.com/ Signed-off-by: Daniel Latypov Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 4c2911f1e140b393d2c9920875911c992f8dda2c Author: Daniel Latypov Date: Fri Nov 19 15:23:16 2021 -0800 kunit: tool: reconfigure when the used kunitconfig changes Problem: currently, if you remove something from your kunitconfig, kunit.py will not regenerate the .config file. The same thing happens if you did --kunitconfig_add=CONFIG_KASAN=y [1] and then ran again without it. Your new run will still have KASAN. The reason is that kunit.py won't regenerate the .config file if it's a superset of the kunitconfig. This speeds it up a bit for iterating. This patch adds an additional check that forces kunit.py to regenerate the .config file if the current kunitconfig doesn't match the previous one. What this means: * deleting entries from .kunitconfig works as one would expect * dropping a --kunitconfig_add also triggers a rebuild * you can still edit .config directly to turn on new options We implement this by creating a `last_used_kunitconfig` file in the build directory (so .kunit, by default) after we generate the .config. When comparing the kconfigs, we compare python sets, so duplicates and permutations don't trip us up. The majority of this patch is adding unit tests for the existing logic and for the new case where `last_used_kunitconfig` differs. [1] https://lore.kernel.org/linux-kselftest/20211106013058.2621799-2-dlatypov@google.com/ Signed-off-by: Daniel Latypov Reviewed-by: David Gow Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit c44895b6cd8517c022dcc3d6fd4cd9bea1184a06 Author: Daniel Latypov Date: Thu Nov 11 10:33:56 2021 -0800 kunit: tool: revamp message for invalid kunitconfig The current error message is precise, but not very clear if you don't already know what it's talking about, e.g. > $ make ARCH=um olddefconfig O=.kunit > ERROR:root:Provided Kconfig is not contained in validated .config. Following fields found in kunitconfig, but not in .config: CONFIG_DRM=y Try to reword the error message so that it's * your missing options usually have unsatisified dependencies * if you're on UML, that might be the cause (it is, in this example) Signed-off-by: Daniel Latypov Reviewed-by: David Gow Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 9f57cc76eccc1e0a369bb051c4b0d596e7d15e30 Author: Daniel Latypov Date: Fri Nov 5 18:30:58 2021 -0700 kunit: tool: add --kconfig_add to allow easily tweaking kunitconfigs E.g. run tests but with KASAN $ ./tools/testing/kunit/kunit.py run --arch=x86_64 --kconfig_add=CONFIG_KASAN=y This also works with --kunitconfig $ ./tools/testing/kunit/kunit.py run --arch=x86_64 --kunitconfig=fs/ext4 --kconfig_add=CONFIG_KASAN=y This flag is inspired by TuxMake's --kconfig-add, see https://gitlab.com/Linaro/tuxmake#examples. Our version just uses "_" as the delimiter for consistency with pre-existing flags like --build_dir, --make_options, --kernel_args, etc. Note: this does make it easier to run into a pre-existing edge case: $ ./tools/testing/kunit/kunit.py run --arch=x86_64 --kconfig_add=CONFIG_KASAN=y $ ./tools/testing/kunit/kunit.py run --arch=x86_64 This second invocation ^ still has KASAN enabled! kunit.py won't call olddefconfig if our current .config is already a superset of the provided kunitconfig. Signed-off-by: Daniel Latypov Reviewed-by: David Gow Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 98978490ccf7071442a5cbfaaa1a957a89b0c98b Author: Daniel Latypov Date: Fri Nov 5 18:30:57 2021 -0700 kunit: tool: move Kconfig read_from_file/parse_from_string to package-level read_from_file() clears its `self` Kconfig object and parses a config file. It is a way to construct Kconfig objects more so than an operation on Kconfig objects. This is reflected in the fact its only ever used as: kconfig = kunit_config.Kconfig() kconfig.read_from_file(path) So clean this up and simplify callers by replacing it with kconfig = kunit_config.parse_file(path) Do the same thing for the related parse_from_string() function as well. Signed-off-by: Daniel Latypov Reviewed-by: David Gow Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 1f1562fcd04a485734e94390660e741c3be47867 Author: Waiman Long Date: Sun Dec 5 13:32:14 2021 -0500 cgroup/cpuset: Don't let child cpusets restrict parent in default hierarchy In validate_change(), there is a check since v2.6.12 to make sure that each of the child cpusets must be a subset of a parent cpuset. IOW, it allows child cpusets to restrict what changes can be made to a parent's "cpuset.cpus". This actually violates one of the core principles of the default hierarchy where a cgroup higher up in the hierarchy should be able to change configuration however it sees fit as deligation breaks down otherwise. To address this issue, the check is now removed for the default hierarchy to free parent cpusets from being restricted by child cpusets. The check will still apply for legacy hierarchy. Suggested-by: Tejun Heo Signed-off-by: Waiman Long Signed-off-by: Tejun Heo commit 142189f09cdf89e353e4a2dc558a7ad27b25f36d Author: Daniel Latypov Date: Thu Oct 7 14:14:17 2021 -0700 kunit: tool: print parsed test results fully incrementally With the parser rework [1] and run_kernel() rework [2], this allows the parser to print out test results incrementally. Currently, that's held up by the fact that the LineStream eagerly pre-fetches the next line when you call pop(). This blocks parse_test_result() from returning until the line *after* the "ok 1 - test name" line is also printed. One can see this with the following example: $ (echo -e 'TAP version 14\n1..3\nok 1 - fake test'; sleep 2; echo -e 'ok 2 - fake test 2'; sleep 3; echo -e 'ok 3 - fake test 3') | ./tools/testing/kunit/kunit.py parse Before this patch [1]: there's a pause before 'fake test' is printed. After this patch: 'fake test' is printed out immediately. This patch also adds * a unit test to verify LineStream's behavior directly * a test case to ensure that it's lazily calling the generator * an explicit exception for when users go beyond EOF [1] https://lore.kernel.org/linux-kselftest/20211006170049.106852-1-dlatypov@google.com/ [2] https://lore.kernel.org/linux-kselftest/20211005011340.2826268-1-dlatypov@google.com/ Signed-off-by: Daniel Latypov Reviewed-by: David Gow Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 44b7da5fcd4c99de1ec5cc783cdd605398246280 Author: David Gow Date: Tue Nov 2 00:30:14 2021 -0700 kunit: Report test parameter results as (K)TAP subtests Currently, the results for individial parameters in a parameterised test are simply output as (K)TAP diagnostic lines. As kunit_tool now supports nested subtests, report each parameter as its own subtest. For example, here's what the output now looks like: # Subtest: inode_test_xtimestamp_decoding ok 1 - 1901-12-13 Lower bound of 32bit < 0 timestamp, no extra bits ok 2 - 1969-12-31 Upper bound of 32bit < 0 timestamp, no extra bits ok 3 - 1970-01-01 Lower bound of 32bit >=0 timestamp, no extra bits ok 4 - 2038-01-19 Upper bound of 32bit >=0 timestamp, no extra bits ok 5 - 2038-01-19 Lower bound of 32bit <0 timestamp, lo extra sec bit on ok 6 - 2106-02-07 Upper bound of 32bit <0 timestamp, lo extra sec bit on ok 7 - 2106-02-07 Lower bound of 32bit >=0 timestamp, lo extra sec bit on ok 8 - 2174-02-25 Upper bound of 32bit >=0 timestamp, lo extra sec bit on ok 9 - 2174-02-25 Lower bound of 32bit <0 timestamp, hi extra sec bit on ok 10 - 2242-03-16 Upper bound of 32bit <0 timestamp, hi extra sec bit on ok 11 - 2242-03-16 Lower bound of 32bit >=0 timestamp, hi extra sec bit on ok 12 - 2310-04-04 Upper bound of 32bit >=0 timestamp, hi extra sec bit on ok 13 - 2310-04-04 Upper bound of 32bit>=0 timestamp, hi extra sec bit 1. 1 ns ok 14 - 2378-04-22 Lower bound of 32bit>= timestamp. Extra sec bits 1. Max ns ok 15 - 2378-04-22 Lower bound of 32bit >=0 timestamp. All extra sec bits on ok 16 - 2446-05-10 Upper bound of 32bit >=0 timestamp. All extra sec bits on # inode_test_xtimestamp_decoding: pass:16 fail:0 skip:0 total:16 ok 1 - inode_test_xtimestamp_decoding Signed-off-by: David Gow Reviewed-by: Daniel Latypov Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 37dbb4c7c7442dbfc9b651e4ddd4afe30b26afc9 Author: David Gow Date: Tue Nov 2 00:30:13 2021 -0700 kunit: Don't crash if no parameters are generated It's possible that a parameterised test could end up with zero parameters. At the moment, the test function will nevertheless be called with NULL as the parameter. Instead, don't try to run the test code, and just mark the test as SKIPped. Reported-by: Daniel Latypov Signed-off-by: David Gow Reviewed-by: Daniel Latypov Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit e56e482855b782b0e38b91cc383324bb80461073 Author: David Gow Date: Tue Nov 2 00:30:12 2021 -0700 kunit: tool: Report an error if any test has no subtests It's possible for a test to have a subtest header, but zero valid subtests. We used to error on this if the test plan had no subtests listed, but it's possible to have subtests without a test plan (indeed, this is how parameterised tests work). Tests with 0 subtests now have the result NO_TESTS, and will report an error (which does not halt test execution, but is printed in a scary red colour and is noted in the results summary). Signed-off-by: David Gow Reviewed-by: Daniel Latypov Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit c68077b14692f4a5d42334625d6d4924b234791e Author: David Gow Date: Tue Nov 2 00:30:11 2021 -0700 kunit: tool: Do not error on tests without test plans The (K)TAP spec encourages test output to begin with a 'test plan': a count of the number of tests being run of the form: 1..n However, some test suites might not know the number of subtests in advance (for example, KUnit's parameterised tests use a generator function). In this case, it's not possible to print the test plan in advance. kunit_tool already parses test output which doesn't contain a plan, but reports an error. Since we want to use nested subtests with KUnit paramterised tests, remove this error. Signed-off-by: David Gow Reviewed-by: Daniel Latypov Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit ee92ed38364e7073bb741577d7b243b232442014 Author: Daniel Latypov Date: Tue Nov 2 21:22:28 2021 -0700 kunit: add run_checks.py script to validate kunit changes This formalizes the checks KUnit maintainers have been running (or in other cases: forgetting to run). This script also runs them all in parallel to minimize friction (pytype can be fairly slow, but not slower than running kunit.py). Example output: $ ./tools/testing/kunit/run_checks.py Waiting on 4 checks (kunit_tool_test.py, kunit smoke test, pytype, mypy)... kunit_tool_test.py: PASSED mypy: PASSED pytype: PASSED kunit smoke test: PASSED On failure or timeout (5 minutes), it'll dump out the stdout/stderr. E.g. adding in a type-checking error: mypy: FAILED > kunit.py:54: error: Name 'nonexistent_function' is not defined > Found 1 error in 1 file (checked 8 source files) mypy and pytype are two Python type-checkers and must be installed. This file treats them as optional and will mark them as SKIPPED if not installed. This tool also runs `kunit.py run --kunitconfig=lib/kunit` to run KUnit's own KUnit tests and to verify KUnit kernel code and kunit.py play nicely together. It uses --build_dir=kunit_run_checks so as not to clobber the default build_dir, which helps make it faster by reducing the need to rebuild, esp. if you're been passing in --arch instead of using UML. Signed-off-by: Daniel Latypov Reviewed-by: David Gow Reviewed-by: David Gow Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 58b391d74630df14ea47f3e29c8e55a7364741ae Author: Daniel Latypov Date: Tue Oct 26 08:36:38 2021 -0700 Documentation: kunit: remove claims that kunit is a mocking framework KUnit does not have any first party support for "mocking". The original RFC had some, but the code got dropped. However, the documentation patches never got updated. This fixes that. https://kunit.dev/mocking.html has a current writeup on the status quo and will hopefully be eventually folded into the in-kernel Documentation. Signed-off-by: Daniel Latypov Reviewed-by: David Gow Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 9a6bb30a8830bb868b09629f0b9ad5d2b5fbb2f9 Author: Daniel Latypov Date: Fri Oct 8 16:24:21 2021 -0700 kunit: tool: fix --json output for skipped tests Currently, KUnit will report SKIPPED tests as having failed if one uses --json. Add the missing if statement to set the appropriate status ("SKIP"). See https://api.kernelci.org/schema-test-case.html: "status": { "type": "string", "description": "The status of the execution of this test case", "enum": ["PASS", "FAIL", "SKIP", "ERROR"], "default": "PASS" }, with this, we now can properly produce all four of the statuses. Fixes: 5acaf6031f53 ("kunit: tool: Support skipped tests in kunit_tool") Signed-off-by: Daniel Latypov Reviewed-by: David Gow Reviewed-by: Brendan Higgins Signed-off-by: Shuah Khan commit 40aa583ea345624967c5b6232082d7b839de537c Author: Thomas Hellström Date: Thu Dec 9 15:13:04 2021 +0100 drm/i915: Don't leak the capture list items When we recently converted the capture code to use vma snapshots, we forgot to free the struct i915_capture_list list items after use. Fix that by bringing back a kfree. Fixes: ff20afc4cee7 ("drm/i915: Update error capture code to avoid using the current vma state") Cc: Ramalingam C Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20211209141304.393479-1-thomas.hellstrom@linux.intel.com commit 3aee738a3d7a22f8f87be907b004af475b430fc3 Merge: 1a46061a2a413 5e8c1bf1a0a5c Author: Florian Fainelli Date: Mon Dec 13 12:21:33 2021 -0800 Merge tag 'tags/bcm2835-dt-next-2021-12-13' into devicetree/next Uwe Kleine-König adds offsets to GPIO line names array for better readability. Signed-off-by: Florian Fainelli commit b9ca111fae488cbcfcd63dd28e91db7dbca6ae69 Merge: 541b107cccf46 11611eecb8aa1 Author: Arnd Bergmann Date: Mon Dec 13 21:00:04 2021 +0100 Merge tag 'ux500-dts-v5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik into arm/dt Ux500 DTS updates for the v5.17 kernel series: - Add reset lines to applicable IP blocks - Fix the magnetometer in the Gavini device tree * tag 'ux500-dts-v5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik: ARM: dts: ux500: Fixup Gavini magnetometer ARM: dts: ux500: Add reset lines to IP blocks Link: https://lore.kernel.org/r/CACRpkdZuDPLj5Tcxbyd+JGfvBGQ8RuMP9PAsGsZT7pY8KoyOKg@mail.gmail.com Signed-off-by: Arnd Bergmann commit 541b107cccf46e1281fe9d34f9ac6794c87ce87d Merge: ee58c0a4d7265 217c7d1840b53 Author: Arnd Bergmann Date: Mon Dec 13 20:58:14 2021 +0100 Merge tag 'renesas-dt-bindings-for-v5.17-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/dt Renesas DT binding updates for v5.17 - Document SDHI SDnH clocks on R-Car Gen2 and later, - Document core support for the R-Car S4-8 (R8A779F0) SoC. * tag 'renesas-dt-bindings-for-v5.17-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: dt-bindings: mmc: renesas,sdhi: Rename RZ/G2L clocks dt-bindings: power: renesas,rcar-sysc: Document r8a779f0 SYSC bindings dt-bindings: reset: renesas,rst: Document r8a779f0 reset module dt-bindings: arm: renesas: Document R-Car S4-8 SoC DT bindings dt-bindings: mmc: renesas,sdhi: Add optional SDnH clock Link: https://lore.kernel.org/r/cover.1638530614.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit ee58c0a4d72655b8271dde79a99466da2fab8c34 Merge: 7cf4cc3e85249 cdda01947bbae Author: Arnd Bergmann Date: Mon Dec 13 20:55:56 2021 +0100 Merge tag 'renesas-arm-dt-for-v5.17-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into arm/dt Renesas ARM DT updates for v5.17 - Serial, SPI, timer, watchdog, operating points, and QSPI FLASH support for the RZ/G2L SoC and the RZ/G2L SMARC EVK development board, - SDHI SDnH clocks for the R-Car Gen3 and RZ/G2 SoCs, - Display Unit support for the R-Car V3U SoC, - Miscellaneous fixes and improvements. * tag 'renesas-arm-dt-for-v5.17-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel: (21 commits) arm64: dts: renesas: r8a779a0: Add DU support arm64: dts: renesas: salvator-common: Merge hdmi0_con arm64: dts: renesas: ulcb: Merge hdmi0_con arm64: dts: renesas: r9a07g044: Add OPP table arm64: dts: renesas: Fix operating point table node names arm64: dts: renesas: rzg2l-smarc-som: Enable watchdog arm64: dts: renesas: r9a07g044: Add WDT nodes arm64: dts: renesas: r9a07g044: Rename SDHI clocks arm64: dts: renesas: rzg2l-smarc-som: Enable serial NOR flash arm64: dts: renesas: rzg2l-smarc-som: Enable OSTM arm64: dts: renesas: r9a07g044: Add OSTM nodes arm64: dts: renesas: r9a07g044: Sort psci node arm64: dts: renesas: rzg2l-smarc: Enable RSPI1 on carrier board arm64: dts: renesas: r9a07g044: Add RSPI{0,1,2} nodes arm64: dts: renesas: cat875: Add rx/tx delays arm64: dts: reneas: rcar-gen3: Add SDnH clocks arm64: dts: reneas: rzg2: Add SDnH clocks arm64: dts: renesas: r9a07g044: Add SCI[0-1] nodes arm64: dts: renesas: rzg2l-smarc: Enable SCIF2 on carrier board arm64: dts: renesas: r9a07g044: Add SCIF[1-4] nodes ... Link: https://lore.kernel.org/r/cover.1638530606.git.geert+renesas@glider.be Signed-off-by: Arnd Bergmann commit b2657ed0a56f63b1789c596b36ddc6b618726661 Author: Daniele Ceraolo Spurio Date: Fri Dec 10 16:07:56 2021 -0800 drm/i915/guc: support bigger RSA keys Some of the newer HW will use bigger RSA keys to authenticate the GuC binary. On those platforms the HW will read the key from memory instead of the RSA registers, so we need to copy it in a dedicated vma, like we do for the HuC. The address of the key is provided to the HW via the first RSA register. v2: clarify that the RSA behavior is hardcoded in the bootrom (Matt) Signed-off-by: Daniele Ceraolo Spurio Cc: Michal Wajdeczko Cc: John Harrison Cc: Matthew Brost Reviewed-by: Matthew Brost Link: https://patchwork.freedesktop.org/patch/msgid/20211211000756.1698923-4-daniele.ceraolospurio@intel.com commit 013005d961f7d5d1b422ce7f281fba9ffaa2b52a Author: Michal Wajdeczko Date: Fri Dec 10 16:07:55 2021 -0800 drm/i915/uc: Prepare for different firmware key sizes Future GuC/HuC firmwares might be signed with different key sizes. Don't assume that it must be always 2048 bits long. Signed-off-by: Michal Wajdeczko Signed-off-by: Daniele Ceraolo Spurio Reviewed-by: Matthew Brost Link: https://patchwork.freedesktop.org/patch/msgid/20211211000756.1698923-3-daniele.ceraolospurio@intel.com commit 35d4efec103e1afde968cfc9305f00f9aceb19cc Author: Daniele Ceraolo Spurio Date: Fri Dec 10 16:07:54 2021 -0800 drm/i915/uc: correctly track uc_fw init failure The FAILURE state of uc_fw currently implies that the fw is loadable (i.e init completed), so we can't use it for init failures and instead need a dedicated error code. Note that this currently does not cause any issues because if we fail to init any of the firmwares we abort the load, but better be accurate anyway in case things change in the future. Signed-off-by: Daniele Ceraolo Spurio Reviewed-by: Matthew Brost Link: https://patchwork.freedesktop.org/patch/msgid/20211211000756.1698923-2-daniele.ceraolospurio@intel.com commit 95c07247399536f83b89dc60cfe7b279d17e69f6 Author: Hector Martin Date: Sat Dec 11 02:05:34 2021 +0900 spi: Fix incorrect cs_setup delay handling Move the cs_setup delay to the end of spi_set_cs. From include/linux/spi/spi.h: * @cs_setup: delay to be introduced by the controller after CS is asserted The cs_setup delay needs to happen *after* CS is asserted, that is, at the end of spi_set_cs, not at the beginning. Otherwise we're just delaying before the SPI transaction starts at all, which isn't very useful. No drivers use this right now, but that is likely to change soon with an upcoming Apple SPI HID transport driver. Fixes: 25093bdeb6bc ("spi: implement SW control for CS times") Signed-off-by: Hector Martin Link: https://lore.kernel.org/r/20211210170534.177139-1-marcan@marcan.st Signed-off-by: Mark Brown commit c57dbcab04449ec869561a9056d0de1a07cbb863 Author: Minghao Chi Date: Mon Dec 13 02:16:55 2021 +0000 drivers/regulator: remove redundant ret variable Return value from twlreg_write() directly instead of taking this in another redundant variable. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Link: https://lore.kernel.org/r/20211213021655.435423-1-chi.minghao@zte.com.cn Signed-off-by: Mark Brown commit 290a7c5509b6f14c28e959392f3cbc4d5b2c9318 Author: Pierre-Louis Bossart Date: Tue Dec 7 13:39:47 2021 -0600 ASoC: SOF: Intel: add comment on JasperLake support Explain why JasperLake is exposed in cnl.c instead of icl.c No functionality change. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Reviewed-by: Bard Liao Link: https://lore.kernel.org/r/20211207193947.71080-8-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 924631df4134d62b51a9442d97355eeba7ff613c Author: Pierre-Louis Bossart Date: Tue Dec 7 13:39:46 2021 -0600 ASoC: SOF: Intel: hda-dai: remove unused fields The existing code does not use the 'host_dma_id', 'link_dma_id', 'host_bps' fields remove them. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Reviewed-by: Péter Ujfalusi Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20211207193947.71080-7-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 288fad2f71fa0b989c075d4984879c26d47cfb06 Author: Pierre-Louis Bossart Date: Tue Dec 7 13:39:45 2021 -0600 ASoC: SOF: Intel: hda: add quirks for HDAudio DMA position information The code inherited from the Skylake driver does not seem to follow any known hardware recommendations. The only two recommended options are a) use DPIB registers if VC1 traffic is not allowed b) use DPIB DDR update if VC1 traffic is used In all of SOF-based updated, VC1 is not supported so we can 'safely' move to using DPIB registers only. This patch keeps the legacy code, in case there was an undocumented issue lost to history, and adds the DPIB DDR update for additional debug. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20211207193947.71080-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit ae81d8fd57ff7d2b421c80f0f9426d9e775023b5 Author: Pierre-Louis Bossart Date: Tue Dec 7 13:39:44 2021 -0600 ASoC: SOF: hda-stream: only enable DPIB if needed The existing code is inconsistent, we should only enable DPIB if the 'use_posbuf' field is true. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20211207193947.71080-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 12ce213821b77242b2217d08850ff972e1fb50bb Author: Pierre-Louis Bossart Date: Tue Dec 7 13:39:43 2021 -0600 ASoC: SOF: Intel: hda-ctrl: apply symmetry for DPIB we use 'bus->use_posbuf && bus->posbuf.addr' in hda_dsp_ctrl_init_chip(), use the same for hda_dsp_ctrl_stop_chip() Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20211207193947.71080-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit a792bfc1c2bc4b5e2311edc62e0efe5adec5d079 Author: Pierre-Louis Bossart Date: Tue Dec 7 13:39:42 2021 -0600 ASoC: SOF: Intel: hda-stream: limit PROCEN workaround The work-around enabled in hda-stream.c is only required on earlier versions of SOCs/PCH (Skylake, KabyLake, ApolloLake, GeminiLake). Before setting the format on the host DMA, it is required to couple the host and link DMA - which as a consequence shall use the same format. This patch introduces a quirk field in the platform descriptor and makes the work-around conditional. Newer platforms have no limitations on the use of host and link DMA, which can use different formats. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Rander Wang Link: https://lore.kernel.org/r/20211207193947.71080-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit c697ef868f596aba7a5e90be8eb10bf4d4a98990 Author: Ranjani Sridharan Date: Tue Dec 7 13:39:41 2021 -0600 ASoC: SOF: Intel: ICL: move ICL-specific ops to icl.c Move the ICL specific ops to icl.c. Also introduce a macro ICL_DSP_HPRO_CORE_ID to define the core that should be powered up when HPRO is enabled. Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Signed-off-by: Ranjani Sridharan Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20211207193947.71080-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 3db30b79028983179d3b720e367c898ce896516e Author: Loic Poulain Date: Wed Dec 8 09:55:08 2021 +0100 brcmfmac: Fix incorrect type assignments for keep-alive cpu_to_le16 has been used for all keep-alive fields, but 'perdio_msec' is a 32-bit field and 'keep_alive_id' a 8-bit one. Fix that. Fixes: 7a6cfe28ae3e ("brcmfmac: Configure keep-alive packet on suspend") Reported-by: kernel test robot Signed-off-by: Loic Poulain Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1638953708-29192-1-git-send-email-loic.poulain@linaro.org commit efa56eddf5d5c03a90abe708431f16c12c291837 Author: Jason Wang Date: Sat Dec 11 17:02:21 2021 +0800 coresight: core: Fix typo in a comment The double `the' in the comment in line 732 is repeated. Remove one of them from the comment. Signed-off-by: Jason Wang Link: https://lore.kernel.org/r/20211211090221.241529-1-wangborong@cdjrlc.com [Fixed capital letter in title] Signed-off-by: Mathieu Poirier commit 1175011a7d0030d49dc9c10bde36f08f26d0a8ee Author: Joey Gouly Date: Fri Dec 10 16:54:32 2021 +0000 arm64: cpufeature: add HWCAP for FEAT_RPRES Add a new HWCAP to detect the Increased precision of Reciprocal Estimate and Reciprocal Square Root Estimate feature (FEAT_RPRES), introduced in Armv8.7. Also expose this to userspace in the ID_AA64ISAR2_EL1 feature register. Signed-off-by: Joey Gouly Cc: Will Deacon Cc: Jonathan Corbet Acked-by: Marc Zyngier Link: https://lore.kernel.org/r/20211210165432.8106-4-joey.gouly@arm.com Signed-off-by: Catalin Marinas commit 9e45365f1469ef2b934f9d035975dbc9ad352116 Author: Joey Gouly Date: Fri Dec 10 16:54:31 2021 +0000 arm64: add ID_AA64ISAR2_EL1 sys register This is a new ID register, introduced in 8.7. Signed-off-by: Joey Gouly Cc: Will Deacon Cc: Marc Zyngier Cc: James Morse Cc: Alexandru Elisei Cc: Suzuki K Poulose Cc: Reiji Watanabe Acked-by: Marc Zyngier Link: https://lore.kernel.org/r/20211210165432.8106-3-joey.gouly@arm.com Signed-off-by: Catalin Marinas commit 5c13f042e73200b50573ace63e1a6b94e2917616 Author: Joey Gouly Date: Fri Dec 10 16:54:30 2021 +0000 arm64: cpufeature: add HWCAP for FEAT_AFP Add a new HWCAP to detect the Alternate Floating-point Behaviour feature (FEAT_AFP), introduced in Armv8.7. Also expose this to userspace in the ID_AA64MMFR1_EL1 feature register. Signed-off-by: Joey Gouly Cc: Will Deacon Acked-by: Marc Zyngier Link: https://lore.kernel.org/r/20211210165432.8106-2-joey.gouly@arm.com Signed-off-by: Catalin Marinas commit 07b742a4d91260bdb61cd4cbe5ec3bba2ae7f6f9 Author: Mark Rutland Date: Tue Dec 7 18:32:26 2021 +0000 arm64: mm: log potential KASAN shadow alias When the kernel is built with KASAN_GENERIC or KASAN_SW_TAGS, shadow memory is allocated and mapped for all legitimate kernel addresses, and prior to a regular memory access instrumentation will read from the corresponding shadow address. Due to the way memory addresses are converted to shadow addresses, bogus pointers (e.g. NULL) can generate shadow addresses out of the bounds of allocated shadow memory. For example, with KASAN_GENERIC and 48-bit VAs, NULL would have a shadow address of dfff800000000000, which falls between the TTBR ranges. To make such cases easier to debug, this patch makes die_kernel_fault() dump the real memory address range for any potential KASAN shadow access using kasan_non_canonical_hook(), which results in fault information as below when KASAN is enabled: | Unable to handle kernel paging request at virtual address dfff800000000017 | KASAN: null-ptr-deref in range [0x00000000000000b8-0x00000000000000bf] | Mem abort info: | ESR = 0x96000004 | EC = 0x25: DABT (current EL), IL = 32 bits | SET = 0, FnV = 0 | EA = 0, S1PTW = 0 | FSC = 0x04: level 0 translation fault | Data abort info: | ISV = 0, ISS = 0x00000004 | CM = 0, WnR = 0 | [dfff800000000017] address between user and kernel address ranges Signed-off-by: Mark Rutland Cc: Alexander Potapenko Cc: Andrey Konovalov Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Will Deacon Tested-by: Andrey Konovalov Acked-by: Will Deacon Link: https://lore.kernel.org/r/20211207183226.834557-3-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 6f6cfa5867995c03959ce8c715e54b51cd5a1528 Author: Mark Rutland Date: Tue Dec 7 18:32:25 2021 +0000 arm64: mm: use die_kernel_fault() in do_mem_abort() If we take an unhandled fault from EL1, either: a) The xFSC handler calls die_kernel_fault() directly. In this case, die_kernel_fault() calls: pr_alert(..., msg, addr); mem_abort_decode(esr); show_pte(addr); die(); bust_spinlocks(0); do_exit(SIGKILL); b) The xFSC handler returns to do_mem_abort(), indicating failure. In this case, do_mem_abort() calls: pr_alert(..., addr); mem_abort_decode(esr); show_pte(addr); arm64_notify_die() { die(); } This inconstency is unfortunatem, and in theory in case (b) registered notifiers can prevent us from terminating the faulting thread by returning NOTIFY_STOP, whereupon we'll end up returning from the fault, replaying, and almost certainly get stuck in a livelock spewing errors into dmesg. We don't expect notifers to fix things up, since we dump state to dmesg before invoking them, so it would be more sensible to consistently terminate the thread in this case. This patch has do_mem_abort() call die_kernel_fault() for unhandled faults taken from EL1. Where we would previously have logged a messafe of the form: | Unhandled fault at ${ADDR} ... we will now log a message of the form: | Unable to handle kernel ${FAULT_NAME} at virtual address ${ADDR} ... and we will consistently terminate the thread from which the fault was taken. Signed-off-by: Mark Rutland Cc: Will Deacon Tested-by: Andrey Konovalov Acked-by: Will Deacon Link: https://lore.kernel.org/r/20211207183226.834557-2-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 5089f3d97552b0b07101e02a3fca0146b9b9d3b5 Author: Chuck Lever Date: Tue Oct 19 15:17:21 2021 -0400 SUNRPC: Remove low signal-to-noise tracepoints I'm about to add more information to the server-side SUNRPC tracepoints, so I'm going to offset the increased trace log consumption by getting rid of some tracepoints that fire frequently but don't offer much value. trace_svc_xprt_received() was useful for debugging, perhaps, but is not generally informative. trace_svc_handle_xprt() reports largely the same information as trace_svc_xdr_recvfrom(). As a clean-up, rename trace_svc_xprt_do_enqueue() to match svc_xprt_dequeue(). Signed-off-by: Chuck Lever commit 1463b38e7cf34d4cc60f41daff459ad807b2e408 Author: NeilBrown Date: Wed Dec 1 10:58:14 2021 +1100 NFSD: simplify per-net file cache management We currently have a 'laundrette' for closing cached files - a different work-item for each network-namespace. These 'laundrettes' (aka struct nfsd_fcache_disposal) are currently on a list, and are freed using rcu. The list is not necessary as we have a per-namespace structure (struct nfsd_net) which can hold a link to the nfsd_fcache_disposal. The use of kfree_rcu is also unnecessary as the cache is cleaned of all files associated with a given namespace, and no new files can be added, before the nfsd_fcache_disposal is freed. So add a '->fcache_disposal' link to nfsd_net, and discard the list management and rcu usage. Signed-off-by: NeilBrown Signed-off-by: Chuck Lever commit 1e37d0e5bda45881eea1bec4b812def72c7d4aea Author: Jiapeng Chong Date: Thu Dec 2 16:35:42 2021 +0800 NFSD: Fix inconsistent indenting Eliminate the follow smatch warning: fs/nfsd/nfs4xdr.c:4766 nfsd4_encode_read_plus_hole() warn: inconsistent indenting. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Chuck Lever commit 7578b2f628db27281d3165af0aa862311883a858 Author: Chuck Lever Date: Thu Sep 30 19:10:03 2021 -0400 NFSD: Remove be32_to_cpu() from DRC hash function Commit 7142b98d9fd7 ("nfsd: Clean up drc cache in preparation for global spinlock elimination"), billed as a clean-up, added be32_to_cpu() to the DRC hash function without explanation. That commit removed two comments that state that byte-swapping in the hash function is unnecessary without explaining whether there was a need for that change. On some Intel CPUs, the swab32 instruction is known to cause a CPU pipeline stall. be32_to_cpu() does not add extra randomness, since the hash multiplication is done /before/ shifting to the high-order bits of the result. As a micro-optimization, remove the unnecessary transform from the DRC hash function. Signed-off-by: Chuck Lever commit 23a1a573c61ccb5e7829c1f5472d3e025293a031 Author: NeilBrown Date: Mon Nov 29 15:51:25 2021 +1100 NFS: switch the callback service back to non-pooled. Now that thread management is consistent there is no need for nfs-callback to use svc_create_pooled() as introduced in Commit df807fffaabd ("NFSv4.x/callback: Create the callback service through svc_create_pooled"). So switch back to svc_create(). If service pools were configured, but the number of threads were left at '1', nfs callback may not work reliably when svc_create_pooled() is used. Signed-off-by: NeilBrown Signed-off-by: Chuck Lever commit 6b044fbaab02292fedb17565dbb3f2528083b169 Author: NeilBrown Date: Mon Nov 29 15:51:25 2021 +1100 lockd: use svc_set_num_threads() for thread start and stop svc_set_num_threads() does everything that lockd_start_svc() does, except set sv_maxconn. It also (when passed 0) finds the threads and stops them with kthread_stop(). So move the setting for sv_maxconn, and use svc_set_num_thread() We now don't need nlmsvc_task. Now that we use svc_set_num_threads() it makes sense to set svo_module. This request that the thread exists with module_put_and_exit(). Also fix the documentation for svo_module to make this explicit. svc_prepare_thread is now only used where it is defined, so it can be made static. Signed-off-by: NeilBrown Signed-off-by: Chuck Lever commit 93aa619eb0b42eec2f3a9b4d9db41f5095390aec Author: NeilBrown Date: Mon Nov 29 15:51:25 2021 +1100 SUNRPC: always treat sv_nrpools==1 as "not pooled" Currently 'pooled' services hold a reference on the pool_map, and 'unpooled' services do not. svc_destroy() uses the presence of ->svo_function (via svc_serv_is_pooled()) to determine if the reference should be dropped. There is no direct correlation between being pooled and the use of svo_function, though in practice, lockd is the only non-pooled service, and the only one not to use svo_function. This is untidy and would cause problems if we changed lockd to use svc_set_num_threads(), which requires the use of ->svo_function. So change the test for "is the service pooled" to "is sv_nrpools > 1". This means that when svc_pool_map_get() returns 1, it must NOT take a reference to the pool. We discard svc_serv_is_pooled(), and test sv_nrpools directly. Signed-off-by: NeilBrown Signed-off-by: Chuck Lever commit cf0e124e0a489944d08fcc3c694d2b234d2cc658 Author: NeilBrown Date: Mon Nov 29 15:51:25 2021 +1100 SUNRPC: move the pool_map definitions (back) into svc.c These definitions are not used outside of svc.c, and there is no evidence that they ever have been. So move them into svc.c and make the declarations 'static'. Signed-off-by: NeilBrown Signed-off-by: Chuck Lever commit ecd3ad68d2c6d3ae178a63a2d9a02c392904fd36 Author: NeilBrown Date: Mon Nov 29 15:51:25 2021 +1100 lockd: rename lockd_create_svc() to lockd_get() lockd_create_svc() already does an svc_get() if the service already exists, so it is more like a "get" than a "create". So: - Move the increment of nlmsvc_users into the function as well - rename to lockd_get(). It is now the inverse of lockd_put(). Signed-off-by: NeilBrown Signed-off-by: Chuck Lever commit 865b674069e05e5779fcf8cf7a166d2acb7e930b Author: NeilBrown Date: Mon Nov 29 15:51:25 2021 +1100 lockd: introduce lockd_put() There is some cleanup that is duplicated in lockd_down() and the failure path of lockd_up(). Factor these out into a new lockd_put() and call it from both places. lockd_put() does *not* take the mutex - that must be held by the caller. It decrements nlmsvc_users and if that reaches zero, it cleans up. Signed-off-by: NeilBrown Signed-off-by: Chuck Lever commit 6a4e2527a63620a820c4ebf3596b57176da26fb3 Author: NeilBrown Date: Mon Nov 29 15:51:25 2021 +1100 lockd: move svc_exit_thread() into the thread The normal place to call svc_exit_thread() is from the thread itself just before it exists. Do this for lockd. This means that nlmsvc_rqst is not used out side of lockd_start_svc(), so it can be made local to that function, and renamed to 'rqst'. Signed-off-by: NeilBrown Signed-off-by: Chuck Lever commit b73a2972041bee70eb0cbbb25fa77828c63c916b Author: NeilBrown Date: Mon Nov 29 15:51:25 2021 +1100 lockd: move lockd_start_svc() call into lockd_create_svc() lockd_start_svc() only needs to be called once, just after the svc is created. If the start fails, the svc is discarded too. It thus makes sense to call lockd_start_svc() from lockd_create_svc(). This allows us to remove the test against nlmsvc_rqst at the start of lockd_start_svc() - it must always be NULL. lockd_up() only held an extra reference on the svc until a thread was created - then it dropped it. The thread - and thus the extra reference - will remain until kthread_stop() is called. Now that the thread is created in lockd_create_svc(), the extra reference can be dropped there. So the 'serv' variable is no longer needed in lockd_up(). Signed-off-by: NeilBrown Signed-off-by: Chuck Lever commit 5a8a7ff57421b7de3ae72019938ffb5daaee36e7 Author: NeilBrown Date: Mon Nov 29 15:51:25 2021 +1100 lockd: simplify management of network status notifiers Now that the network status notifiers use nlmsvc_serv rather then nlmsvc_rqst the management can be simplified. Notifier unregistration synchronises with any pending notifications so providing we unregister before nlm_serv is freed no further interlock is required. So we move the unregister call to just before the thread is killed (which destroys the service) and just before the service is destroyed in the failure-path of lockd_up(). Then nlm_ntf_refcnt and nlm_ntf_wq can be removed. Signed-off-by: NeilBrown Signed-off-by: Chuck Lever commit 2840fe864c91a0fe822169b1fbfddbcac9aeac43 Author: NeilBrown Date: Mon Nov 29 15:51:25 2021 +1100 lockd: introduce nlmsvc_serv lockd has two globals - nlmsvc_task and nlmsvc_rqst - but mostly it wants the 'struct svc_serv', and when it doesn't want it exactly it can get to what it wants from the serv. This patch is a first step to removing nlmsvc_task and nlmsvc_rqst. It introduces nlmsvc_serv to store the 'struct svc_serv*'. This is set as soon as the serv is created, and cleared only when it is destroyed. Signed-off-by: NeilBrown Signed-off-by: Chuck Lever commit d057cfec4940ce6eeffa22b4a71dec203b06cd55 Author: NeilBrown Date: Mon Nov 29 15:51:25 2021 +1100 NFSD: simplify locking for network notifier. nfsd currently maintains an open-coded read/write semaphore (refcount and wait queue) for each network namespace to ensure the nfs service isn't shut down while the notifier is running. This is excessive. As there is unlikely to be contention between notifiers and they run without sleeping, a single spinlock is sufficient to avoid problems. Signed-off-by: NeilBrown [ cel: ensure nfsd_notifier_lock is static ] Signed-off-by: Chuck Lever commit 3ebdbe5203a874614819700d3f470724cb803709 Author: NeilBrown Date: Mon Nov 29 15:51:25 2021 +1100 SUNRPC: discard svo_setup and rename svc_set_num_threads_sync() The ->svo_setup callback serves no purpose. It is always called from within the same module that chooses which callback is needed. So discard it and call the relevant function directly. Now that svc_set_num_threads() is no longer used remove it and rename svc_set_num_threads_sync() to remove the "_sync" suffix. Signed-off-by: NeilBrown Signed-off-by: Chuck Lever commit 3409e4f1e8f239f0ed81be0b068ecf4e73e2e826 Author: NeilBrown Date: Mon Nov 29 15:51:25 2021 +1100 NFSD: Make it possible to use svc_set_num_threads_sync nfsd cannot currently use svc_set_num_threads_sync. It instead uses svc_set_num_threads which does *not* wait for threads to all exit, and has a separate mechanism (nfsd_shutdown_complete) to wait for completion. The reason that nfsd is unlike other services is that nfsd threads can exit separately from svc_set_num_threads being called - they die on receipt of SIGKILL. Also, when the last thread exits, the service must be shut down (sockets closed). For this, the nfsd_mutex needs to be taken, and as that mutex needs to be held while svc_set_num_threads is called, the one cannot wait for the other. This patch changes the nfsd thread so that it can drop the ref on the service without blocking on nfsd_mutex, so that svc_set_num_threads_sync can be used: - if it can drop a non-last reference, it does that. This does not trigger shutdown and does not require a mutex. This will likely happen for all but the last thread signalled, and for all threads being shut down by nfsd_shutdown_threads() - if it can get the mutex without blocking (trylock), it does that and then drops the reference. This will likely happen for the last thread killed by SIGKILL - Otherwise there might be an unrelated task holding the mutex, possibly in another network namespace, or nfsd_shutdown_threads() might be just about to get a reference on the service, after which we can drop ours safely. We cannot conveniently get wakeup notifications on these events, and we are unlikely to need to, so we sleep briefly and check again. With this we can discard nfsd_shutdown_complete and nfsd_complete_shutdown(), and switch to svc_set_num_threads_sync. Signed-off-by: NeilBrown Signed-off-by: Chuck Lever commit 9d3792aefdcda71d20c2b1ecc589c17ae71eb523 Author: NeilBrown Date: Mon Nov 29 15:51:25 2021 +1100 NFSD: narrow nfsd_mutex protection in nfsd thread There is nothing happening in the start of nfsd() that requires protection by the mutex, so don't take it until shutting down the thread - which does still require protection - but only for nfsd_put(). Signed-off-by: NeilBrown Signed-off-by: Chuck Lever commit 2a36395fac3b72771f87c3ee4387e3a96d85a7cc Author: NeilBrown Date: Mon Nov 29 15:51:25 2021 +1100 SUNRPC: use sv_lock to protect updates to sv_nrthreads. Using sv_lock means we don't need to hold the service mutex over these updates. In particular, svc_exit_thread() no longer requires synchronisation, so threads can exit asynchronously. Note that we could use an atomic_t, but as there are many more read sites than writes, that would add unnecessary noise to the code. Some reads are already racy, and there is no need for them to not be. Signed-off-by: NeilBrown Signed-off-by: Chuck Lever commit 9b6c8c9bebccd5fb785c306b948c08874a88874d Author: NeilBrown Date: Mon Nov 29 15:51:25 2021 +1100 nfsd: make nfsd_stats.th_cnt atomic_t This allows us to move the updates for th_cnt out of the mutex. This is a step towards reducing mutex coverage in nfsd(). Signed-off-by: NeilBrown Signed-off-by: Chuck Lever commit ec52361df99b490f6af412b046df9799b92c1050 Author: NeilBrown Date: Mon Nov 29 15:51:25 2021 +1100 SUNRPC: stop using ->sv_nrthreads as a refcount The use of sv_nrthreads as a general refcount results in clumsy code, as is seen by various comments needed to explain the situation. This patch introduces a 'struct kref' and uses that for reference counting, leaving sv_nrthreads to be a pure count of threads. The kref is managed particularly in svc_get() and svc_put(), and also nfsd_put(); svc_destroy() now takes a pointer to the embedded kref, rather than to the serv. nfsd allows the svc_serv to exist with ->sv_nrhtreads being zero. This happens when a transport is created before the first thread is started. To support this, a 'keep_active' flag is introduced which holds a ref on the svc_serv. This is set when any listening socket is successfully added (unless there are running threads), and cleared when the number of threads is set. So when the last thread exits, the nfs_serv will be destroyed. The use of 'keep_active' replaces previous code which checked if there were any permanent sockets. We no longer clear ->rq_server when nfsd() exits. This was done to prevent svc_exit_thread() from calling svc_destroy(). Instead we take an extra reference to the svc_serv to prevent svc_destroy() from being called. Signed-off-by: NeilBrown Signed-off-by: Chuck Lever commit 8c62d12740a1450d2e8456d5747f440e10db281a Author: NeilBrown Date: Mon Nov 29 15:51:25 2021 +1100 SUNRPC/NFSD: clean up get/put functions. svc_destroy() is poorly named - it doesn't necessarily destroy the svc, it might just reduce the ref count. nfsd_destroy() is poorly named for the same reason. This patch: - removes the refcount functionality from svc_destroy(), moving it to a new svc_put(). Almost all previous callers of svc_destroy() now call svc_put(). - renames nfsd_destroy() to nfsd_put() and improves the code, using the new svc_destroy() rather than svc_put() - removes a few comments that explain the important for balanced get/put calls. This should be obvious. The only non-trivial part of this is that svc_destroy() would call svc_sock_update() on a non-final decrement. It can no longer do that, and svc_put() isn't really a good place of it. This call is now made from svc_exit_thread() which seems like a good place. This makes the call *before* sv_nrthreads is decremented rather than after. This is not particularly important as the call just sets a flag which causes sv_nrthreads set be checked later. A subsequent patch will improve the ordering. Signed-off-by: NeilBrown Signed-off-by: Chuck Lever commit df5e49c880ea0776806b8a9f8ab95e035272cf6f Author: NeilBrown Date: Mon Nov 29 15:51:25 2021 +1100 SUNRPC: change svc_get() to return the svc. It is common for 'get' functions to return the object that was 'got', and there are a couple of places where users of svc_get() would be a little simpler if svc_get() did that. Make it so. Signed-off-by: NeilBrown Signed-off-by: Chuck Lever commit 89b24336f03a8ba560e96b0c47a8434a7fa48e3c Author: NeilBrown Date: Mon Nov 29 15:51:25 2021 +1100 NFSD: handle errors better in write_ports_addfd() If write_ports_add() fails, we shouldn't destroy the serv, unless we had only just created it. So if there are any permanent sockets already attached, leave the serv in place. Signed-off-by: NeilBrown Signed-off-by: Chuck Lever commit c2f1c4bd20621175c581f298b4943df0cffbd841 Author: Chuck Lever Date: Wed Oct 13 16:44:20 2021 -0400 NFSD: Fix sparse warning /home/cel/src/linux/linux/fs/nfsd/nfs4proc.c:1539:24: warning: incorrect type in assignment (different base types) /home/cel/src/linux/linux/fs/nfsd/nfs4proc.c:1539:24: expected restricted __be32 [usertype] status /home/cel/src/linux/linux/fs/nfsd/nfs4proc.c:1539:24: got int Signed-off-by: Chuck Lever commit 322c4293ecc58110227b49d7e47ae37b9b03566f Author: Tetsuo Handa Date: Mon Dec 13 21:55:27 2021 +0900 loop: make autoclear operation asynchronous syzbot is reporting circular locking problem at __loop_clr_fd() [1], for commit 87579e9b7d8dc36e ("loop: use worker per cgroup instead of kworker") is calling destroy_workqueue() with disk->open_mutex held. This circular dependency cannot be broken unless we call __loop_clr_fd() without holding disk->open_mutex. Therefore, defer __loop_clr_fd() from lo_release() to a WQ context. Link: https://syzkaller.appspot.com/bug?extid=643e4ce4b6ad1347d372 [1] Reported-by: syzbot Suggested-by: Christoph Hellwig Cc: Jan Kara Tested-by: syzbot+643e4ce4b6ad1347d372@syzkaller.appspotmail.com Signed-off-by: Tetsuo Handa Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/1ed7df28-ebd6-71fb-70e5-1c2972e05ddb@i-love.sakura.ne.jp Signed-off-by: Jens Axboe commit 285892a74f1370a12249f765c6a4e3b16194852e Author: Julien Massot Date: Tue Dec 7 17:58:29 2021 +0100 remoteproc: Add Renesas rcar driver Renesas Gen3 platform includes a Cortex-r7 processor. Both: the application cores (A5x) and the realtime core (CR7) share access to the RAM and devices with the same address map, so device addresses are equal to the Linux physical addresses. In order to initialize this remote processor we need to: - power on the realtime core - put the firmware in a RAM area - set the boot address for this firmware (reset vector) - Deassert the reset This initial driver allows to start and stop the Cortex R7 processor. Signed-off-by: Julien Massot Link: https://lore.kernel.org/r/20211207165829.195537-3-julien.massot@iot.bzh Signed-off-by: Mathieu Poirier commit d3c76a42ecc7c41ddcba1455f4f6631648812df0 Author: Julien Massot Date: Tue Dec 7 17:58:28 2021 +0100 dt-bindings: remoteproc: Add Renesas R-Car Renesas R-Car SoCs may contain a Realtime processor. This patch adds bindings for this remote processor. Signed-off-by: Julien Massot Reviewed-by: Rob Herring Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20211207165829.195537-2-julien.massot@iot.bzh Signed-off-by: Mathieu Poirier commit e9c78319215c2d42ec3632fc673f6bdc003bdf5b Merge: 8f86e69536f32 4c7924fb905b0 Author: Mathieu Poirier Date: Mon Dec 13 10:40:52 2021 -0700 Merge tag 'rcar_rst_rproc-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into rproc-next Renesas R-Car Reset Controller remoteproc API Definition of rcar_rst_set_rproc_boot_addr(), to be consumed by the Renesas R-Car Gen3 remote processor driver. Signed-off-by: Mathieu Poirier commit 0ba4566cd8a4e645b542e6ddbe3dd26c85ad2408 Author: Matthew Wilcox (Oracle) Date: Mon Dec 13 17:11:13 2021 +0000 bdev: Improve lookup_bdev documentation Add a Context section and rewrite the rest to be clearer. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Nikolay Borisov Link: https://lore.kernel.org/r/20211213171113.3097631-1-willy@infradead.org Signed-off-by: Jens Axboe commit 6b1248798eb6f6d5285db214299996ecc5dc1e6b Author: Eric W. Biederman Date: Fri Dec 3 11:42:49 2021 -0600 exit/kthread: Move the exit code for kernel threads into struct kthread The exit code of kernel threads has different semantics than the exit_code of userspace tasks. To avoid confusion and allow the userspace implementation to change as needed move the kernel thread exit code into struct kthread. Signed-off-by: "Eric W. Biederman" commit 40966e316f86b8cfd83abd31ccb4df729309d3e7 Author: Eric W. Biederman Date: Thu Dec 2 09:56:14 2021 -0600 kthread: Ensure struct kthread is present for all kthreads Today the rules are a bit iffy and arbitrary about which kernel threads have struct kthread present. Both idle threads and thread started with create_kthread want struct kthread present so that is effectively all kernel threads. Make the rule that if PF_KTHREAD and the task is running then struct kthread is present. This will allow the kernel thread code to using tsk->exit_code with different semantics from ordinary processes. To make ensure that struct kthread is present for all kernel threads move it's allocation into copy_process. Add a deallocation of struct kthread in exec for processes that were kernel threads. Move the allocation of struct kthread for the initial thread earlier so that it is not repeated for each additional idle thread. Move the initialization of struct kthread into set_kthread_struct so that the structure is always and reliably initailized. Clear set_child_tid in free_kthread_struct to ensure the kthread struct is reliably freed during exec. The function free_kthread_struct does not need to clear vfork_done during exec as exec_mm_release called from exec_mmap has already cleared vfork_done. Signed-off-by: "Eric W. Biederman" commit cead18552660702a4a46f58e65188fe5f36e9dfe Author: Eric W. Biederman Date: Mon Nov 22 11:15:19 2021 -0600 exit: Rename complete_and_exit to kthread_complete_and_exit Update complete_and_exit to call kthread_exit instead of do_exit. Change the name to reflect this change in functionality. All of the users of complete_and_exit are causing the current kthread to exit so this change makes it clear what is happening. Move the implementation of kthread_complete_and_exit from kernel/exit.c to to kernel/kthread.c. As this function is kthread specific it makes most sense to live with the kthread functions. There are no functional change. Signed-off-by: "Eric W. Biederman" commit ca3574bd653aba234a4b31955f2778947403be16 Author: Eric W. Biederman Date: Fri Dec 3 11:00:19 2021 -0600 exit: Rename module_put_and_exit to module_put_and_kthread_exit Update module_put_and_exit to call kthread_exit instead of do_exit. Change the name to reflect this change in functionality. All of the users of module_put_and_exit are causing the current kthread to exit so this change makes it clear what is happening. There is no functional change. Signed-off-by: "Eric W. Biederman" commit bbda86e988d4c124e4cfa816291cbd583ae8bfb1 Author: Eric W. Biederman Date: Mon Nov 22 10:27:36 2021 -0600 exit: Implement kthread_exit The way the per task_struct exit_code is used by kernel threads is not quite compatible how it is used by userspace applications. The low byte of the userspace exit_code value encodes the exit signal. While kthreads just use the value as an int holding ordinary kernel function exit status like -EPERM. Add kthread_exit to clearly separate the two kinds of uses. Signed-off-by: "Eric W. Biederman" commit eb55e716ac1aa0de13ef5abbf1479d995582d967 Author: Eric W. Biederman Date: Mon Nov 22 10:01:59 2021 -0600 exit: Stop exporting do_exit Now that there are no more modular uses of do_exit remove the EXPORT_SYMBOL. Suggested-by: Christoph Hellwig Signed-off-by: "Eric W. Biederman" commit 7f80a2fd7db9a55894fd841915236aca611291b5 Author: Eric W. Biederman Date: Mon Nov 22 09:51:03 2021 -0600 exit: Stop poorly open coding do_task_dead in make_task_dead When the kernel detects it is oops or otherwise force killing a task while it exits the code poorly attempts to permanently stop the task from scheduling. I say poorly because it is possible for a task in TASK_UINTERRUPTIBLE to be woken up. As it makes no sense for the task to continue call do_task_dead instead which actually does the work and permanently removes the task from the scheduler. Guaranteeing the task will never be woken up again. Signed-off-by: "Eric W. Biederman" commit 05ea0424f0e21c0ef9b47c89826e7c22ae137975 Author: Eric W. Biederman Date: Mon Nov 22 09:33:00 2021 -0600 exit: Move oops specific logic from do_exit into make_task_dead The beginning of do_exit has become cluttered and difficult to read as it is filled with checks to handle things that can only happen when the kernel is operating improperly. Now that we have a dedicated function for cleaning up a task when the kernel is operating improperly move the checks there. Signed-off-by: "Eric W. Biederman" commit 0e25498f8cd43c1b5aa327f373dd094e9a006da7 Author: Eric W. Biederman Date: Mon Jun 28 14:52:01 2021 -0500 exit: Add and use make_task_dead. There are two big uses of do_exit. The first is it's design use to be the guts of the exit(2) system call. The second use is to terminate a task after something catastrophic has happened like a NULL pointer in kernel code. Add a function make_task_dead that is initialy exactly the same as do_exit to cover the cases where do_exit is called to handle catastrophic failure. In time this can probably be reduced to just a light wrapper around do_task_dead. For now keep it exactly the same so that there will be no behavioral differences introducing this new concept. Replace all of the uses of do_exit that use it for catastraphic task cleanup with make_task_dead to make it clear what the code is doing. As part of this rename rewind_stack_do_exit rewind_stack_and_make_dead. Signed-off-by: "Eric W. Biederman" commit 5e354747b2c91f64544b97760d38e2d3280307b2 Author: Eric W. Biederman Date: Tue Dec 7 16:42:35 2021 -0600 exit/s390: Remove dead reference to do_exit from copy_thread My s390 assembly is not particularly good so I have read the history of the reference to do_exit copy_thread and have been able to verify that do_exit is not used. The general argument is that s390 has been changed to use the generic kernel_thread and kernel_execve and the generic versions do not call do_exit. So it is strange to see a do_exit reference sitting there. The history of the do_exit reference in s390's version of copy_thread seems conclusive that the do_exit reference is something that lingers and should have been removed several years ago. Up through 8d19f15a60be ("[PATCH] s390 update (1/27): arch.") the s390 code made a call to the exit(2) system call when a kernel thread finished. Then kernel_thread_starter was added which branched directly to the value in register 11 when the kernel thread finshed. The value in register 11 was set in kernel_thread to "regs.gprs[11] = (unsigned long) do_exit" In commit 37fe5d41f640 ("s390: fold kernel_thread_helper() into ret_from_fork()") kernel_thread_starter was moved into entry.S and entry64.S unchanged (except for the syntax differences between inline assemly and in the assembly file). In commit f9a7e025dfc2 ("s390: switch to generic kernel_thread()") the assignment to "gprs[11]" was moved into copy_thread from the old kernel_thread. The helper kernel_thread_starter was still being used and was still branching to "%r11" at the end. In commit 30dcb0996e40 ("s390: switch to saner kernel_execve() semantics") kernel_thread_starter was changed to unconditionally branch to sysc_tracenogo instead to %r11 which held the value of do_exit. Unfortunately copy_thread was not updated to stop passing do_exit in "gprs[11]". In commit 56e62a737028 ("s390: convert to generic entry") kernel_thread_starter was replaced by __ret_from_fork. And the code still continued to pass do_exit in "gprs[11]" despite __ret_from_fork not caring in the slightest. Remove this dead reference to do_exit to make it clear that s390 is not doing anything with do_exit in copy_thread. Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Christian Borntraeger Cc: Alexander Gordeev Cc: Martin Schwidefsky Cc: Al Viro Fixes: 30dcb0996e40 ("s390: switch to saner kernel_execve() semantics") History Tree: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git Acked-by: Heiko Carstens Signed-off-by: "Eric W. Biederman" commit effb32e931dd4feb8aa3cee7b5b4ddda43c8b701 Author: Aswath Govindraju Date: Tue Dec 7 13:39:04 2021 +0530 arch: arm64: ti: Add support J721S2 Common Processor Board The EVM architecture for J721S2 is similar to that of J721E and J7200. It is as follows, +------------------------------------------------------+ | +-------------------------------------------+ | | | | | | | Add-on Card 1 Options | | | | | | | +-------------------------------------------+ | | | | | | +-------------------+ | | | | | | | SOM | | | +--------------+ | | | | | | | | | | | Add-on | +-------------------+ | | | Card 2 | | Power Supply | | Options | | | | | | | | | +--------------+ | <--- +------------------------------------------------------+ Common Processor Board Common Processor board is the baseboard that contains most of the actual connectors, power supply etc. The System on Module (SoM) is plugged on to the common processor baord. Therefore, add support for peripherals brought out in the common processor board. Common Processor Board: https://www.ti.com/tool/J721EXCPXEVM Signed-off-by: Aswath Govindraju Signed-off-by: Vignesh Raghavendra Reviewed-by: Kishon Vijay Abraham I Link: https://lore.kernel.org/r/20211207080904.14324-6-a-govindraju@ti.com commit d502f852d22af1ca33e7a2fedd7426831f6dbaef Author: Aswath Govindraju Date: Tue Dec 7 13:39:03 2021 +0530 arm64: dts: ti: Add initial support for J721S2 System on Module A System on Module (SoM) contains the SoC, PMIC, DDR and basic high speed components necessary for functionality. Therefore, add support for the components present on the SoM. SoM: https://www.ti.com/lit/zip/sprr439 Signed-off-by: Aswath Govindraju Signed-off-by: Vignesh Raghavendra Reviewed-by: Kishon Vijay Abraham I Link: https://lore.kernel.org/r/20211207080904.14324-5-a-govindraju@ti.com commit b8545f9d3a5426a5f76814c8aaebc5cb46a3213a Author: Aswath Govindraju Date: Tue Dec 7 13:39:02 2021 +0530 arm64: dts: ti: Add initial support for J721S2 SoC The J721S2 SoC belongs to the K3 Multicore SoC architecture platform, providing advanced system integration in automotive ADAS applications and industrial applications requiring AI at the network edge. This SoC extends the Jacinto 7 family of SoCs with focus on lowering system costs and power while providing interfaces, memory architecture and compute performance for single and multi-sensor applications. Some highlights of this SoC are: * Dual Cortex-A72s in a single cluster, three clusters of lockstep capable dual Cortex-R5F MCUs, Deep-learning Matrix Multiply Accelerator(MMA), C7x floating point Vector DSP. * 3D GPU: Automotive grade IMG BXS-4-64 * Vision Processing Accelerator (VPAC) with image signal processor and Depth and Motion Processing Accelerator (DMPAC) * Two CSI2.0 4L RX plus one eDP/DP, two DSI Tx, and one DPI interface. * Two Ethernet ports with RGMII support. * Single 4 lane PCIe-GEN3 controllers, USB3.0 Dual-role device subsystems, * Up to 20 MCANs, 5 McASP, eMMC and SD, OSPI/HyperBus memory controller, QSPI, I3C and I2C, eCAP/eQEP, eHRPWM, MLB among other peripherals. * Hardware accelerator blocks containing AES/DES/SHA/MD5 called SA2UL management. * Chips and Media Wave521CL H.264/H.265 encode/decode engine See J721S2 Technical Reference Manual (SPRUJ28 – NOVEMBER 2021) for further details: http://www.ti.com/lit/pdf/spruj28 Introduce basic support for the J721S2 SoC. Signed-off-by: Aswath Govindraju Signed-off-by: Vignesh Raghavendra Signed-off-by: Nishanth Menon Reviewed-by: Kishon Vijay Abraham I Link: https://lore.kernel.org/r/20211207080904.14324-4-a-govindraju@ti.com commit beba81faad86fc2bad567b1c029d6a000a43ca78 Author: Aswath Govindraju Date: Tue Dec 7 13:39:01 2021 +0530 dt-bindings: pinctrl: k3: Introduce pinmux definitions for J721S2 Add pinctrl macros for J721S2 SoC. These macro definitions are similar to that of J721E, but adding new definitions to avoid any naming confusions in the soc dts files. checkpatch insists the following error exists: ERROR: Macros with complex values should be enclosed in parentheses However, we do not need parentheses enclosing the values for this macro as we do intend it to generate two separate values as has been done for other similar platforms. Signed-off-by: Aswath Govindraju Signed-off-by: Vignesh Raghavendra Reviewed-by: Kishon Vijay Abraham I Acked-by: Rob Herring Link: https://lore.kernel.org/r/20211207080904.14324-3-a-govindraju@ti.com commit 6b1caf4dea3e0a961b7a11cff6757ff74c1c34ea Author: Aswath Govindraju Date: Tue Dec 7 13:39:00 2021 +0530 dt-bindings: arm: ti: Add bindings for J721s2 SoC Add binding for J721S2 SoC Signed-off-by: Aswath Govindraju Signed-off-by: Vignesh Raghavendra Reviewed-by: Kishon Vijay Abraham I Acked-by: Rob Herring Link: https://lore.kernel.org/r/20211207080904.14324-2-a-govindraju@ti.com commit e94fac3829ddd3d9f21efa27d1512215b630782c Merge: 4b443bc1785f2 006004b715569 Author: Alexei Starovoitov Date: Mon Dec 13 09:26:50 2021 -0800 Merge branch 'bpf: Add helpers to access traced function arguments' Jiri Olsa says: ==================== Add new helpers to access traced function arguments that came out of the trampoline batch changes [1]. Get n-th argument of the traced function: long bpf_get_func_arg(void *ctx, u32 n, u64 *value) Get return value of the traced function: long bpf_get_func_ret(void *ctx, u64 *value) Get arguments count of the traced funtion: long bpf_get_func_arg_cnt(void *ctx) v2 changes: - added acks - updated stack diagram - return -EOPNOTSUPP instead of -EINVAL in bpf_get_func_ret - removed gpl_only for all helpers - added verifier fix to allow proper arguments checks, Andrii asked for checking also 'int *b' argument in bpf_modify_return_test programs and it turned out that it's currently not supported by verifier - we can't read argument that is int pointer, so I had to add verifier change to allow that + adding verifier selftest - checking all arguments in bpf_modify_return_test test programs - moved helpers proto gets in tracing_prog_func_proto with attach type check thanks, jirka [1] https://lore.kernel.org/bpf/20211118112455.475349-1-jolsa@kernel.org/ ==================== Signed-off-by: Alexei Starovoitov commit 006004b715569f742535f70f3f06b41d8135486c Author: Jiri Olsa Date: Wed Dec 8 20:32:45 2021 +0100 selftests/bpf: Add tests for get_func_[arg|ret|arg_cnt] helpers Adding tests for get_func_[arg|ret|arg_cnt] helpers. Using these helpers in fentry/fexit/fmod_ret programs. Signed-off-by: Jiri Olsa Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211208193245.172141-6-jolsa@kernel.org commit f92c1e183604c20ce00eb889315fdaa8f2d9e509 Author: Jiri Olsa Date: Wed Dec 8 20:32:44 2021 +0100 bpf: Add get_func_[arg|ret|arg_cnt] helpers Adding following helpers for tracing programs: Get n-th argument of the traced function: long bpf_get_func_arg(void *ctx, u32 n, u64 *value) Get return value of the traced function: long bpf_get_func_ret(void *ctx, u64 *value) Get arguments count of the traced function: long bpf_get_func_arg_cnt(void *ctx) The trampoline now stores number of arguments on ctx-8 address, so it's easy to verify argument index and find return value argument's position. Moving function ip address on the trampoline stack behind the number of functions arguments, so it's now stored on ctx-16 address if it's needed. All helpers above are inlined by verifier. Also bit unrelated small change - using newly added function bpf_prog_has_trampoline in check_get_func_ip. Signed-off-by: Jiri Olsa Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211208193245.172141-5-jolsa@kernel.org commit 5edf6a1983b90371da888ca86493937ec1c8a2b5 Author: Jiri Olsa Date: Wed Dec 8 20:32:43 2021 +0100 bpf, x64: Replace some stack_size usage with offset variables As suggested by Andrii, adding variables for registers and ip address offsets, which makes the code more clear, rather than abusing single stack_size variable for everything. Also describing the stack layout in the comment. There is no function change. Suggested-by: Andrii Nakryiko Signed-off-by: Jiri Olsa Signed-off-by: Alexei Starovoitov Acked-by: John Fastabend Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211208193245.172141-4-jolsa@kernel.org commit 2b070c2bc885977ca8fe76ba8f6b9d73d8d20e39 Author: Jiri Olsa Date: Wed Dec 8 20:32:42 2021 +0100 selftests/bpf: Add test to access int ptr argument in tracing program Adding verifier test for accessing int pointer argument in tracing programs. The test program loads 2nd argument of bpf_modify_return_test function which is int pointer and checks that verifier allows that. Signed-off-by: Jiri Olsa Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211208193245.172141-3-jolsa@kernel.org commit bb6728d756112596881a5fdf2040544031905840 Author: Jiri Olsa Date: Wed Dec 8 20:32:41 2021 +0100 bpf: Allow access to int pointer arguments in tracing programs Adding support to access arguments with int pointer arguments in tracing programs. Currently we allow tracing programs to access only pointers to string (char pointer), void pointers and pointers to structs. If we try to access argument which is pointer to int, verifier will fail to load the program with; R1 type=ctx expected=fp ; int BPF_PROG(fmod_ret_test, int _a, __u64 _b, int _ret) 0: (bf) r6 = r1 ; int BPF_PROG(fmod_ret_test, int _a, __u64 _b, int _ret) 1: (79) r9 = *(u64 *)(r6 +8) func 'bpf_modify_return_test' arg1 type INT is not a struct There is no harm for the program to access int pointer argument. We are already doing that for string pointer, which is pointer to int with 1 byte size. Changing the is_string_ptr to generic integer check and renaming it to btf_type_is_int. Signed-off-by: Jiri Olsa Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211208193245.172141-2-jolsa@kernel.org commit bd943653b10dc9df63ad6cb69f520c10f3f21372 Author: Julian Ribbeck Date: Tue Nov 16 21:07:34 2021 +0100 arm64: dts: qcom: Add device tree for Samsung J5 2015 (samsung-j5) Samsung J5 2015 is a MSM8916 based Smartphone. It is similar to some of the other MSM8916 devices, especially the Samsung ones. With this patch initial support for the following is added: - eMMC/SD card - Buttons - USB (although no suiting MUIC driver currently) - UART (untested for lack of equipment) - WiFi/Bluetooth (WCNSS) It is worth noting that Samsung J5 with MSM8916 exists in different generations (e.g Samsung J5 2015 and Samsung J5 2016) which each have different models (e.g. samsung-j5nlte, samsung-j5xnlte, etc). This patch is only regarding the 2015 generation, but should work with all of it's models, as far as we could test. Co-developed-by: Stephan Gerhold Signed-off-by: Stephan Gerhold Signed-off-by: Julian Ribbeck Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211116200734.73920-1-julian.ribbeck@gmx.de commit 7cf4cc3e8524989f9f1619ba49726576a46ee32d Author: Herve Codina Date: Thu Dec 2 10:52:55 2021 +0100 ARM: dts: spear3xx: Add spear320s dtsi The SPEAr320s SOC is a SPEAr320 SOC variant. Mostly identical to the SPEAr320 SOC variant, it has a new interrupt routing for PL_PGIOs. Add spear320s.dtsi to handle SPEAr320s SOC Signed-off-by: Herve Codina Link: https://lore.kernel.org/r/20211202095255.165797-7-herve.codina@bootlin.com' Signed-off-by: Arnd Bergmann commit 5d7248e956e68f257b46cdfcee465792086e2c01 Author: Herve Codina Date: Thu Dec 2 10:52:53 2021 +0100 ARM: dts: spear3xx: Use plgpio regmap in SPEAr310 and SPEAr320 Resources used by plgpio and pinmux are conflicting on SPEAr310 and SPEAr320. Use the newly introduced regmap property in plgpio node to use pinmux resources from plgpio and so avoid the conflict. Signed-off-by: Herve Codina Link: https://lore.kernel.org/r/20211202095255.165797-5-herve.codina@bootlin.com' Signed-off-by: Arnd Bergmann commit a34ff76a161583d24d29816a6cce85232ea7d9d0 Author: Aswath Govindraju Date: Fri Dec 3 17:39:13 2021 +0530 soc: ti: k3-socinfo: Add entry for J721S2 SoC family J721S2 SoC's JTAG PARTNO is 0xBB75. Signed-off-by: Aswath Govindraju Signed-off-by: Nishanth Menon Reviewed-by: Kishon Vijay Abraham I Link: https://lore.kernel.org/r/20211203120913.14737-1-a-govindraju@ti.com commit dec242b6a8380c08e41e02fb54f1282894fb45cc Author: Takashi Iwai Date: Mon Dec 13 15:15:12 2021 +0100 ALSA: gus: Fix memory leaks at memory allocator error paths When snd_gf1_mem_xalloc() returns NULL, the current code still leaves the formerly allocated block.name string but returns an error immediately. This patch does code-refactoring to move the kstrdup() call itself into snd_gf1_mem_xalloc() and deals with the resource free in the helper code by itself for fixing those memory leaks. Suggested-by: Jaroslav Kysela Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20211213132444.22385-2-tiwai@suse.de Link: https://lore.kernel.org/r/20211213141512.27359-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit a3c62a042237d1adeb0290dcb768e17edd6dcd25 Author: Lorenzo Bianconi Date: Mon Dec 13 12:23:22 2021 +0100 net: mtk_eth: add COMPILE_TEST support Improve the build testing of mtk_eth drivers by enabling them when COMPILE_TEST is selected. Moreover COMPILE_TEST will be useful for the driver development. Signed-off-by: Lorenzo Bianconi Signed-off-by: David S. Miller commit 64445dda9d8384975eca54e3f01886fca61e1db6 Author: Sebastian Andrzej Siewior Date: Mon Dec 13 11:53:29 2021 +0100 net: dev: Always serialize on Qdisc::busylock in __dev_xmit_skb() on PREEMPT_RT. The root-lock is dropped before dev_hard_start_xmit() is invoked and after setting the __QDISC___STATE_RUNNING bit. If the Qdisc owner is preempted by another sender/task with a higher priority then this new sender won't be able to submit packets to the NIC directly instead they will be enqueued into the Qdisc. The NIC will remain idle until the Qdisc owner is scheduled again and finishes the job. By serializing every task on the ->busylock then the task will be preempted by a sender only after the Qdisc has no owner. Always serialize on the busylock on PREEMPT_RT. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: David S. Miller commit 93d576f54e0f697c7b54f4ddd718e68ccc52c4f2 Author: Yang Li Date: Mon Dec 13 17:54:13 2021 +0800 mt76: remove variable set but not used The code that uses variable queued has been removed, and "mt76_is_usb(dev) ? q->ndesc - q->queued : q->queued" didn't do anything, so all they should be removed as well. Eliminate the following clang warnings: drivers/net/wireless/mediatek/mt76/debugfs.c:77:9: warning: variable ‘queued’ set but not used. Reported-by: Abaci Robot Fixes: 2d8be76c1674 ("mt76: debugfs: improve queue node readability") Signed-off-by: Yang Li Signed-off-by: David S. Miller commit fee32de284ac277ba434a2d59f8ce46528ff3946 Author: Suresh Kumar Date: Mon Dec 13 11:17:09 2021 +0530 net: bonding: debug: avoid printing debug logs when bond is not notifying peers Currently "bond_should_notify_peers: slave ..." messages are printed whenever "bond_should_notify_peers" function is called. +++ Dec 12 12:33:26 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25 Dec 12 12:33:26 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25 Dec 12 12:33:26 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25 Dec 12 12:33:26 node1 kernel: bond0: (slave enp0s25): Received LACPDU on port 1 Dec 12 12:33:26 node1 kernel: bond0: (slave enp0s25): Rx Machine: Port=1, Last State=6, Curr State=6 Dec 12 12:33:26 node1 kernel: bond0: (slave enp0s25): partner sync=1 Dec 12 12:33:26 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25 Dec 12 12:33:26 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25 Dec 12 12:33:26 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25 ... Dec 12 12:33:30 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25 Dec 12 12:33:30 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25 Dec 12 12:33:30 node1 kernel: bond0: (slave enp4s3): Received LACPDU on port 2 Dec 12 12:33:30 node1 kernel: bond0: (slave enp4s3): Rx Machine: Port=2, Last State=6, Curr State=6 Dec 12 12:33:30 node1 kernel: bond0: (slave enp4s3): partner sync=1 Dec 12 12:33:30 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25 Dec 12 12:33:30 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25 Dec 12 12:33:30 node1 kernel: bond0: bond_should_notify_peers: slave enp0s25 +++ This is confusing and can also clutter up debug logs. Print logs only when the peer notification happens. Signed-off-by: Suresh Kumar Signed-off-by: David S. Miller commit 277ee96f89d806f110e3011ea324155dd69e798f Author: Jayesh Choudhary Date: Wed Nov 17 11:08:06 2021 +0530 arm64: dts: ti: iot2050: Disable mcasp nodes at dtsi level Disable mcasp nodes 0-2 because several required properties are not present in the dtsi file as they are board specific. These nodes can be enabled via an overlay whenever required. Signed-off-by: Jayesh Choudhary Signed-off-by: Vignesh Raghavendra Acked-by: Jan Kiszka Link: https://lore.kernel.org/r/20211117053806.10095-1-j-choudhary@ti.com commit 3cfcda2aee9446b30d1e0fefc11eeffe95fa6430 Author: Clément Léger Date: Mon Dec 13 09:26:51 2021 +0100 net: ocelot: use dma_unmap_addr to get tx buffer dma_addr dma_addr was declared using DEFINE_DMA_UNMAP_ADDR() which requires to use dma_unmap_addr() to access it. Reported-by: kernel test robot Fixes: 753a026cfec1 ("net: ocelot: add FDMA support") Signed-off-by: Clément Léger Signed-off-by: David S. Miller commit b26980ab2a9776e5427d784fbafb1a01269f4001 Author: Horatiu Vultur Date: Sat Dec 11 22:44:20 2021 +0100 net: lan966x: Fix the configuration of the pcs When inserting a SFP that runs at 2.5G, then the Serdes was still configured to run at 1G. Because the config->speed was 0, and then the speed of the serdes was not configured at all, it was using the default value which is 1G. This patch stop calling the serdes function set_speed and allow the serdes to figure out the speed based on the interface type. Fixes: d28d6d2e37d10d ("net: lan966x: add port module support") Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 87f7282e76bef97d775a7cd61dc1988fc5ed8639 Author: Willem de Bruijn Date: Sat Dec 11 15:04:57 2021 -0500 selftests/net: expand gro with two machine test The test is currently run on a single host with private addresses, either over veth or by setting a nic in loopback mode with macvlan. Support running between two real devices. Allow overriding addresses. Also cut timeout to fail faster on error and explicitly log success. Signed-off-by: Willem de Bruijn Signed-off-by: David S. Miller commit ed6fc70e42cb9c4445369a9de46c9dff7265bc26 Merge: 2106be4fdf322 2f207cbf0dd44 Author: David S. Miller Date: Mon Dec 13 14:15:41 2021 +0000 Merge branch 'mse102x-support' Stefan Wahren says: ==================== add Vertexcom MSE102x support This patch series adds support for the Vertexcom MSE102x Homeplug GreenPHY chips [1]. They can be connected either via RGMII, RMII or SPI to a host CPU. These patches handles only the last one, with an Ethernet over SPI protocol driver. The code has been tested only on Raspberry Pi boards, but should work on other platforms. Changes in V3: - drop IF_PORT_HOMEPLUG again, since it's actually not used Changes in V2: - improve lock handling for RX & TX path - add new patch to introduce IF_PORT_HOMEPLUG as suggested by Andrew Lunn - address all the comments by Jakub Kicinski, Andrew Lunn, Kernel test robot [1] - http://www.vertexcom.com/p_homeplug_plc_en.html ==================== Signed-off-by: David S. Miller commit 2f207cbf0dd44278af2aa3ff0fc95b0f97cc4e4c Author: Stefan Wahren Date: Sun Dec 12 15:50:27 2021 +0100 net: vertexcom: Add MSE102x SPI support This implements an SPI protocol driver for Vertexcom MSE102x Homeplug GreenPHY chip. Signed-off-by: Stefan Wahren Signed-off-by: David S. Miller commit 2717566f6661d78d16353e165c10aa2b0e9ae201 Author: Stefan Wahren Date: Sun Dec 12 15:50:26 2021 +0100 dt-bindings: net: add Vertexcom MSE102x support Add devicetree binding for the Vertexcom MSE102x Homeplug GreenPHY chip as SPI device. Signed-off-by: Stefan Wahren Reviewed-by: Rob Herring Signed-off-by: David S. Miller commit e4d60d9f362530d5c8df5f3d8c354c48db476b2c Author: Stefan Wahren Date: Sun Dec 12 15:50:25 2021 +0100 dt-bindings: add vendor Vertexcom Add vendor prefix for Vertexcom Technologies, Inc [1]. [1] - http://www.vertexcom.com/ Signed-off-by: Stefan Wahren Acked-by: Rob Herring Signed-off-by: David S. Miller commit c2f51415401cb8e9b7991e828ae12ab2972f2ca7 Author: Takashi Iwai Date: Mon Dec 13 14:24:43 2021 +0100 ALSA: gus: Fix erroneous memory allocation snd_gf1_mem_xalloc() returns NULL incorrectly when the memory chunk is allocated in the middle of the chain. This patch corrects the return value to treat it properly. Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20211213132444.22385-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 2106be4fdf3223d9c5bd485e6ef094139e3197ba Author: Russell King (Oracle) Date: Sun Dec 12 13:01:21 2021 +0000 net: mvneta: mark as a legacy_pre_march2020 driver mvneta provides mac_an_restart and mac_pcs_get_state methods, so needs to be marked as a legacy driver. Marek spotted that mvneta had stopped working in 2500base-X mode - thanks for reporting. Reported-by: Marek Behún Signed-off-by: Russell King (Oracle) Signed-off-by: David S. Miller commit 62cc9a7387f11193ab70a5f99aa8b2206817ce00 Author: Russell King (Oracle) Date: Sun Dec 12 13:01:15 2021 +0000 net: axienet: mark as a legacy_pre_march2020 driver axienet has a PCS, but does not make use of the phylink PCS support. Mark it was a pre-March 2020 driver. Signed-off-by: Russell King (Oracle) Signed-off-by: David S. Miller commit 2cd24a2e8d8c47e5f6544bb3da3199c6b683e01f Author: Jason Wang Date: Sun Dec 12 15:12:04 2021 +0800 isdn: cpai: no need to initialise statics to 0 Static variables do not need to be initialised to 0, because compiler will initialise all uninitialised statics to 0. Thus, remove the unneeded initializations. Signed-off-by: Jason Wang Signed-off-by: David S. Miller commit cdf8e2de16c01b2b44fc544a3b5de74d8092b517 Author: Thierry Reding Date: Mon Dec 6 16:55:59 2021 +0100 dt-bindings: usb: tegra-xudc: Document interconnects and iommus properties Add the interconnects, interconnect-names and iommus properties to the device tree bindings for the Tegra XUDC controller. These are used to describe the device's paths to and from memory. Acked-by: Rob Herring Signed-off-by: Thierry Reding Link: https://lore.kernel.org/r/20211206155559.232550-1-thierry.reding@gmail.com Signed-off-by: Greg Kroah-Hartman commit a927ae1fba4b0aa51e1fa9b43c4018bbf10d27f6 Author: Guo Zhengkui Date: Thu Dec 9 14:23:05 2021 +0800 usb: core: hcd: change sizeof(vaddr) to sizeof(unsigned long) `vaddr` is a pointer to unsigned char. sizeof(vaddr) here intends to get the size of a pointer. But readers may get confused. Change sizeof(vaddr) to sizeof(unsigned long) makes more sense. Suggested-by: Alan Stern Signed-off-by: Guo Zhengkui Link: https://lore.kernel.org/r/20211209062441.9856-1-guozhengkui@vivo.com Signed-off-by: Greg Kroah-Hartman commit aa9c2219f989881dffe2dd6ef9b6540858873a5f Author: Neal Liu Date: Wed Dec 8 18:05:45 2021 +0800 usb: aspeed-vhub: support test mode feature Support aspeed usb vhub set feature to test mode. Signed-off-by: Neal Liu Acked-by: Benjamin Herrenschmidt Link: https://lore.kernel.org/r/20211208100545.1441397-5-neal_liu@aspeedtech.com Signed-off-by: Greg Kroah-Hartman commit d693bbd4cbc44dac34dbf6c49c844d30f18ad0c1 Author: Neal Liu Date: Wed Dec 8 18:05:44 2021 +0800 usb: aspeed-vhub: fix ep0 OUT ack received wrong length issue If multiple devices in vhub are enumerated simultaneously, ep0 OUT ack might received wrong data length. Using expected data length instead. Acked-by: Benjamin Herrenschmidt Signed-off-by: Neal Liu Link: https://lore.kernel.org/r/20211208100545.1441397-4-neal_liu@aspeedtech.com Signed-off-by: Greg Kroah-Hartman commit 347f3f54bd457ff76230e1d516cdd5f8235e2f5b Author: Neal Liu Date: Wed Dec 8 18:05:42 2021 +0800 usb: aspeed-vhub: add qualifier descriptor USB3 Command Verifier (USB3CV) is the official tool for USB3 Hub and Device Framework testing. A high-speed capable device that has different device information for full-speed and high-speed must have a Device Qualifier Descriptor. This patch is to support device qualifier to pass USB3CV - Chapter 9 Test [USB 2 devices] - Device Qualifier Tests. Signed-off-by: Neal Liu Link: https://lore.kernel.org/r/20211208100545.1441397-2-neal_liu@aspeedtech.com Acked-by: Benjamin Herrenschmidt Signed-off-by: Greg Kroah-Hartman commit a92548f90fa6280ca57a8aea1f50d18f2f48cbb3 Author: Juergen Gross Date: Tue Nov 23 14:20:48 2021 +0100 xen: add Xen pvUSB maintainer Add myself as maintainer for the Xen pvUSB stuff. Acked-by: Konrad Rzeszutek Wilk Signed-off-by: Juergen Gross Link: https://lore.kernel.org/r/20211123132048.5335-4-jgross@suse.com Signed-off-by: Greg Kroah-Hartman commit 494ed3997d752810b67cb75d4721b59996cfec38 Author: Juergen Gross Date: Tue Nov 23 14:20:47 2021 +0100 usb: Introduce Xen pvUSB frontend (xen hcd) Introduces the Xen pvUSB frontend. With pvUSB it is possible for a Xen domU to communicate with a USB device assigned to that domU. The communication is all done via the pvUSB backend in a driver domain (usually Dom0) which is owner of the physical device. The pvUSB frontend is a USB hcd for a virtual USB host connector. The code is taken from the pvUSB implementation in Xen done by Fujitsu based on Linux kernel 2.6.18. Changes from the original version are: - port to upstream kernel - put all code in just one source file - move module to appropriate location in kernel tree - adapt to Linux style guide - minor code modifications to increase readability Signed-off-by: Juergen Gross Link: https://lore.kernel.org/r/20211123132048.5335-3-jgross@suse.com Signed-off-by: Greg Kroah-Hartman commit bae9401dff62d1ac46504a343db8a69e5ac390f6 Author: Juergen Gross Date: Tue Nov 23 14:20:46 2021 +0100 usb: Add Xen pvUSB protocol description Add the definition of pvUSB protocol used between the pvUSB frontend in a Xen domU and the pvUSB backend in a Xen driver domain (usually Dom0). This header was originally provided by Fujitsu for Xen based on Linux 2.6.18. Changes are: - adapt to Linux kernel style guide - use Xen namespace - add lots of comments - don't use kernel internal defines Reviewed-by: Boris Ostrovsky Signed-off-by: Juergen Gross Link: https://lore.kernel.org/r/20211123132048.5335-2-jgross@suse.com Signed-off-by: Greg Kroah-Hartman commit 666f3de741f7ce66119b375145d471e89fac21ff Author: Thinh Nguyen Date: Mon Nov 29 19:21:28 2021 -0800 usb: dwc3: gadget: Support Multi-Stream Transfer Synopsys introduced a new enhancement to DWC_usb32 called Multi-Stream Transfer (MST) to improve bulk streams performance for SuperSpeed and SuperSpeed Plus. This enhancement allows the controller to look ahead and process multiple bulk streams. Previously, to initiate a bulk stream transfer, the driver has to issue Start Transfer command and wait for the stream to complete before initiating a new stream. As a result, the controller does not process TRBs beyond a single stream. With the enhancement, as long as there are new requests, the dwc3 driver can keep preparing new TRBs and the controller can keep caching and processing them without waiting for the transfer completion. The programming flow is similar to regular bulk endpoint with a few additional rules: 1) Chained TRBs of the same stream must have a matching stream ID 2) The last TRB of a stream must have CHN=0 3) All the TRBs with LST=0 must have CSP=1 Depends on the application and usage, internal tests show significant performance improvement in UASP transfers with this enhancement. Signed-off-by: Thinh Nguyen Link: https://lore.kernel.org/r/cd9c7a8bf11f790983ac546222dd114893f16b3a.1638242424.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman commit 1a0ae068bf6b6f4233b1f31bf48bcbc47b111ef2 Author: Geert Uytterhoeven Date: Mon Nov 15 11:49:56 2021 +0100 m68k: defconfig: Update defconfigs for v5.16-rc1 - Drop CONFIG_MCTP=m (can no longer be modular since commit 78476d315e190533 ("mctp: Add flow extension to skb")), - Drop CONFIG_BLK_DEV_CRYPTOLOOP=m (removed in commit 47e9624616c80c98 ("block: remove support for cryptoloop and the xor transfer")). Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20211115104956.2084032-1-geert@linux-m68k.org commit 078c2a0e8e60bb3fe78cf50b5da1620a4e13e0cd Author: Tudor Ambarus Date: Thu Dec 9 14:36:43 2021 +0200 ARM: dts: at91: sama7g5ek: Add QSPI0 node QSPI0 comunicates with a MX66LM1G45G SPI NOR flash. Enable the controller and describe the flash. Signed-off-by: Tudor Ambarus Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20211209123643.341892-2-tudor.ambarus@microchip.com commit 0081a525ceef14e950172def4af14c3f652fb4a2 Author: Tudor Ambarus Date: Thu Dec 9 14:36:42 2021 +0200 ARM: dts: at91: sama7g5: Add QSPI nodes sama7g5 embedds 2 instances of QSPI controller: 1/ OSPI0 Supporting Up to 200 MHz DDR. Octal, TwinQuad, Hyperflash and OctaFlash Protocols Supported. 2/ QSPI1 Supporting Up to 90 MHz DDR/133 MHz SDR. Signed-off-by: Tudor Ambarus Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20211209123643.341892-1-tudor.ambarus@microchip.com commit cf4060f1bb643495742f3630ab98a7b44fc5c0fd Author: Tudor Ambarus Date: Thu Dec 9 12:25:42 2021 +0200 ARM: dts: at91: sama5d2: Name the qspi clock Naming clocks is a good practice. The atmel-quadspi driver supports an unnamed clock for the peripheral clock in order to be backward compatible with old DTs, but it is recommended to name the clocks on new DTs. The driver's bindings file requires the clock-names property, so name the clock. Signed-off-by: Tudor Ambarus Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20211209102542.254153-1-tudor.ambarus@microchip.com commit d08aea21c89dc2d302cadb5c2cc5410b6c3395c8 Author: Maxim Kochetkov Date: Fri Dec 10 21:26:03 2021 +0300 eeprom: at24: Add support for 24c1025 EEPROM Microchip EEPROM 24xx1025 is like a 24c1024. The only difference between them is that the I2C address bit used to select between the two banks is bit 2 for the 1025 and not bit 0 as in the 1024. Signed-off-by: Maxim Kochetkov Signed-off-by: Bartosz Golaszewski commit 151a1523160e254fe0c175f540c92cbf7f3cd489 Author: Maxim Kochetkov Date: Fri Dec 10 21:26:04 2021 +0300 dt-bindings: at24: add at24c1025 Add bindings for Microchip EEPROM 24xx1025. Signed-off-by: Maxim Kochetkov Signed-off-by: Bartosz Golaszewski commit e3d72e8eee53c55835ab4664920d83400ff5d6c2 Author: Borislav Petkov Date: Wed Nov 3 10:30:29 2021 +0100 x86/mce: Mark mce_start() noinstr Fixes vmlinux.o: warning: objtool: do_machine_check()+0x4ae: call to __const_udelay() leaves .noinstr.text section Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20211208111343.8130-13-bp@alien8.de commit edb3d07e2403abd13fc664e8b6f23ea7efb52747 Author: Borislav Petkov Date: Tue Nov 2 22:25:12 2021 +0100 x86/mce: Mark mce_timed_out() noinstr Fixes vmlinux.o: warning: objtool: do_machine_check()+0x482: call to mce_timed_out() leaves .noinstr.text section Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20211208111343.8130-12-bp@alien8.de commit 75581a203e63210aabb1336c8c9cb65a7858b596 Author: Borislav Petkov Date: Tue Nov 2 08:14:44 2021 +0100 x86/mce: Move the tainting outside of the noinstr region add_taint() is yet another external facility which the #MC handler calls. Move that tainting call into the instrumentation-allowed part of the handler. Fixes vmlinux.o: warning: objtool: do_machine_check()+0x617: call to add_taint() leaves .noinstr.text section While at it, allow instrumentation around the mce_log() call. Fixes vmlinux.o: warning: objtool: do_machine_check()+0x690: call to mce_log() leaves .noinstr.text section Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20211208111343.8130-11-bp@alien8.de commit db6c996d6ce45dfb44891f0824a65ecec216f47a Author: Borislav Petkov Date: Tue Nov 2 11:14:48 2021 +0100 x86/mce: Mark mce_read_aux() noinstr Fixes vmlinux.o: warning: objtool: do_machine_check()+0x681: call to mce_read_aux() leaves .noinstr.text section Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20211208111343.8130-10-bp@alien8.de commit b4813539d37fa31fed62cdfab7bd2dd8929c5b2e Author: Borislav Petkov Date: Mon Nov 1 16:43:33 2021 +0100 x86/mce: Mark mce_end() noinstr It is called by the #MC handler which is noinstr. Fixes vmlinux.o: warning: objtool: do_machine_check()+0xbd6: call to memset() leaves .noinstr.text section Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20211208111343.8130-9-bp@alien8.de commit 3c7ce80a818fa7950be123cac80cd078e5ac1013 Author: Borislav Petkov Date: Mon Nov 1 13:39:35 2021 +0100 x86/mce: Mark mce_panic() noinstr And allow instrumentation inside it because it does calls to other facilities which will not be tagged noinstr. Fixes vmlinux.o: warning: objtool: do_machine_check()+0xc73: call to mce_panic() leaves .noinstr.text section Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20211208111343.8130-8-bp@alien8.de commit 0a5b288e85bbef5227bb6397e31fcf1d7ba9142a Author: Borislav Petkov Date: Wed Oct 13 09:47:50 2021 +0200 x86/mce: Prevent severity computation from being instrumented Mark all the MCE severity computation logic noinstr and allow instrumentation when it "calls out". Fixes vmlinux.o: warning: objtool: do_machine_check()+0xc5d: call to mce_severity() leaves .noinstr.text section Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20211208111343.8130-7-bp@alien8.de commit 4fbce464db81a42f9a57ee242d6150ec7f996415 Author: Borislav Petkov Date: Wed Oct 13 09:07:19 2021 +0200 x86/mce: Allow instrumentation during task work queueing Fixes vmlinux.o: warning: objtool: do_machine_check()+0xdb1: call to queue_task_work() leaves .noinstr.text section Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20211208111343.8130-6-bp@alien8.de commit 487d654db3edacc31dee86b10258cc740640fad8 Author: Borislav Petkov Date: Tue Oct 5 19:54:47 2021 +0200 x86/mce: Remove noinstr annotation from mce_setup() Instead, sandwitch around the call which is done in noinstr context and mark the caller - mce_gather_info() - as noinstr. Also, document what the whole instrumentation strategy with #MC is going to be in the future and where it all is supposed to be going to. Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20211208111343.8130-5-bp@alien8.de commit 88f66a42353717e7fac31caf04f0acd2d7fbbf54 Author: Borislav Petkov Date: Wed Oct 6 00:55:38 2021 +0200 x86/mce: Use mce_rdmsrl() in severity checking code MCA has its own special MSR accessors. Use them. No functional changes. Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20211208111343.8130-4-bp@alien8.de commit ad669ec16afeb0edb7d5bc4f92fdd059565281d2 Author: Borislav Petkov Date: Tue Oct 5 20:06:57 2021 +0200 x86/mce: Remove function-local cpus variables Use num_online_cpus() directly. No functional changes. Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20211208111343.8130-3-bp@alien8.de commit cd5e0d1fc93a2218fbfb2b614f06e04e218ca948 Author: Borislav Petkov Date: Mon Nov 1 15:34:48 2021 +0100 x86/mce: Do not use memset to clear the banks bitmaps The bitmap is a single unsigned long so no need for the function call. No functional changes. Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20211208111343.8130-2-bp@alien8.de commit 6678916dfa01251b888465e2193e28affb23fca9 Author: Ville Syrjälä Date: Fri Dec 10 14:27:26 2021 +0200 drm/i915: Move pipe/transcoder/abox masks under intel_device_info.display Collect the dipslay related mask under the display sub-structure in intel_device_info. Note that there is a slight change in behaviour in that we zero out .display entirely when !HAS_DISPLAY (aka. pipe_mask==0), so now we also zero out the other masks (although cpu_transocder_mask should already be zero of pipe_mask is zero). abox_mask is only used by the display core init when HAS_DISPLAY is true, so the actual behaviour of the system shouldn't change despite the zeroing of these masks. There is a lot more display stuff directly in device info that could be moved over. Maybe someone else will be inspired to do it... Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211210122726.12577-1-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 78977fd5b11cc90668c0dec6109d2f6572c9601c Author: Xiaoke Wang Date: Mon Dec 13 18:52:32 2021 +0800 ALSA: sound/isa/gus: check the return value of kstrdup() kstrdup() returns NULL when some internal memory errors happen, it is better to check the return value of it. Otherwise, we may not to be able to catch some memory errors in time. Signed-off-by: Xiaoke Wang Link: https://lore.kernel.org/r/tencent_1E3950293AC22395ACFE99404C985D738309@qq.com Signed-off-by: Takashi Iwai commit 97884b07122aabb2d6891ce17f54e0e8e94d0bc5 Author: Alex Elder Date: Fri Dec 10 16:31:23 2021 -0600 net: ipa: fix IPA v4.5 interconnect data Update the definition of the IPA interconnects for IPA v4.5 so the path between IPA and system memory is represented by a single "memory" interconnect. Tested-by: Manivannan Sadhasivam Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit c0d6316c238b1bd743108bd4b08eda364f47c7c9 Author: Alex Elder Date: Fri Dec 10 16:31:22 2021 -0600 ARM: dts: qcom: sdx55: fix IPA interconnect definitions The first two interconnects defined for IPA on the SDX55 SoC are really two parts of what should be represented as a single path between IPA and system memory. Fix this by combining the "memory-a" and "memory-b" interconnects into a single "memory" interconnect. Reported-by: David Heidelberg Tested-by: Manivannan Sadhasivam Signed-off-by: Alex Elder Signed-off-by: David S. Miller commit cec16052d5a774035fc6da19cb9d09106356bbef Author: Joanne Koong Date: Fri Dec 10 12:40:23 2021 -0800 net: Enable max_dgram_qlen unix sysctl to be configurable by non-init user namespaces This patch enables the "/proc/sys/net/unix/max_dgram_qlen" sysctl to be exposed to non-init user namespaces. max_dgram_qlen is used as the default "sk_max_ack_backlog" value for when a unix socket is created. Currently, when a networking namespace is initialized, its unix sysctls are exposed only if the user namespace that "owns" it is the init user namespace. If there is an non-init user namespace that "owns" a networking namespace (for example, in the case after we call clone() with both CLONE_NEWUSER and CLONE_NEWNET set), the sysctls are hidden from view and not configurable. Exposing the unix sysctl is safe because any changes made to it will be limited in scope to the networking namespace the non-init user namespace "owns" and has privileges over (changes won't affect any other net namespace). There is also no possibility of a non-privileged user namespace messing up the net namespace sysctls it shares with its parent user namespace. When a new user namespace is created without unsharing the network namespace (eg calling clone() with CLONE_NEWUSER), the new user namespace shares its parent's network namespace. Write access is protected by the mode set in the sysctl's ctl_table (and enforced by procfs). Here in the case of "max_dgram_qlen", 0644 is set; only the user owner has write access. v1 -> v2: * Add more detail to commit message, specify the "/proc/sys/net/unix/max_dgram_qlen" sysctl in commit message. Signed-off-by: Joanne Koong Signed-off-by: David S. Miller commit 3c118547f87e930d45a5787e386734015dd93b32 Author: Sebastian Andrzej Siewior Date: Fri Dec 10 21:29:59 2021 +0100 u64_stats: Disable preemption on 32bit UP+SMP PREEMPT_RT during updates. On PREEMPT_RT the seqcount_t for synchronisation is required on 32bit architectures even on UP because the softirq (and the threaded IRQ handler) can be preempted. With the seqcount_t for synchronisation, a reader with higher priority can preempt the writer and then spin endlessly in read_seqcount_begin() while the writer can't make progress. To avoid such a lock up on PREEMPT_RT the writer must disable preemption during the update. There is no need to disable interrupts because no writer is using this API in hard-IRQ context on PREEMPT_RT. Disable preemption on 32bit-RT within the u64_stats write section. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: David S. Miller commit d147dd70902ea5cbfd4dfbd65e60733b3805f4c2 Merge: 6180c780e64ce dcdd77ee55a70 Author: David S. Miller Date: Mon Dec 13 12:34:10 2021 +0000 Merge branch 'bareudp-remove-unused' Guillaume Nault says: ==================== bareudp: Remove unused code from header file Stop exporting unused functions and structures in bareudp.h. The only piece of bareudp.h that is actually used is netif_is_bareudp(). The rest can be moved to bareudp.c or even dropped entirely. ==================== Signed-off-by: David S. Miller commit dcdd77ee55a70b6ddfcfbe8e6bbf6d002994644c Author: Guillaume Nault Date: Fri Dec 10 20:56:39 2021 +0100 bareudp: Move definition of struct bareudp_conf to bareudp.c This structure is used only in bareudp.c. While there, adjust include files: we need netdevice.h, not skbuff.h. Signed-off-by: Guillaume Nault Signed-off-by: David S. Miller commit 614b7a1f28f401332736235a7d2d17ceda16945c Author: Guillaume Nault Date: Fri Dec 10 20:56:36 2021 +0100 bareudp: Remove bareudp_dev_create() There's no user for this function. Signed-off-by: Guillaume Nault Signed-off-by: David S. Miller commit 6180c780e64ceb8dd23345b586dfa70c0a1536ee Author: Xin Long Date: Fri Dec 10 13:50:40 2021 -0500 tipc: discard MSG_CRYPTO msgs when key_exchange_enabled is not set When key_exchange is disabled, there is no reason to accept MSG_CRYPTO msgs if it doesn't send MSG_CRYPTO msgs. Signed-off-by: Xin Long Acked-by: Jon Maloy Signed-off-by: David S. Miller commit 3a6c12a0c6c3f857f47efe0e40011360063a35bc Author: Xiaoliang Yang Date: Wed Dec 8 18:06:51 2021 +0800 net: stmmac: bump tc when get underflow error from DMA descriptor In DMA threshold mode, frame underflow errors may sometimes occur when the TC(threshold control) value is not enough. The TC value need to be bumped up in this case. There is no underflow interrupt bit on DMA_CH(#i)_Status of dwmac4, so the DMA threshold cannot be bumped up in stmmac_dma_interrupt(). The i.mx8mp board observed an underflow error while running NFS boot, the NFS rootfs could not be mounted. The underflow error can be got from the DMA descriptor TDES3 on dwmac4. This patch bump up tc value once underflow error is got from TDES3. Signed-off-by: Xiaoliang Yang Signed-off-by: David S. Miller commit 5e8c1bf1a0a5c728cee2b6c2162348a9dfddf1bf Author: Uwe Kleine-König Date: Tue Nov 30 17:11:47 2021 +0100 ARM: dts: bcm2711-rpi-4-b: Add gpio offsets to line name array this helps human readers considerably to determine the line name for a given offset or vice versa. Signed-off-by: Uwe Kleine-König [ nsaenz: corrected patch title ] Signed-off-by: Nicolas Saenz Julienne Link: https://lore.kernel.org/r/20211130161147.317653-1-u.kleine-koenig@pengutronix.de commit 9d5f0f6644b1404f40266a2682add712dc9931f5 Author: Jason Wang Date: Sun Dec 12 11:11:08 2021 +0800 gpio: sch: fix typo in a comment The double `the' in the comment in line 142 is repeated. Remove one of them from the comment. Signed-off-by: Jason Wang Signed-off-by: Andy Shevchenko commit 63cb9da6fcea9029da8c9d1cfc93f1558b229c1f Author: Thomas Hellström Date: Wed Dec 8 09:22:45 2021 +0100 drm/i915: Fix coredump of perma-pinned vmas When updating the error capture code and introducing vma snapshots, we introduced code to hold the vma in memory while capturing it, calling i915_active_acquire_if_busy(). Now that function isn't relevant for perma-pinned vmas and caused important vmas to be dropped from the coredump. Like for example the GuC log. Fix this by instead requiring those vmas to be pinned while capturing. Tested by running the initial subtests of the gem_exec_capture igt test with GuC submission enabled and verifying that a GuC log blob appears in the output. Fixes: ff20afc4cee7 ("drm/i915: Update error capture code to avoid using the current vma state") Cc: Ramalingam C Cc: Matthew Auld Cc: Maarten Lankhorst Cc: John Harrison Cc: Matthew Brost Reported-by: John Harrison Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20211208082245.86933-1-thomas.hellstrom@linux.intel.com commit edb5dd48b32065458fe9cadc9ce26ff80fda4bf2 Merge: f5dc0140d483f e522ae91b8ff7 Author: Krzysztof Kozlowski Date: Mon Dec 13 12:09:35 2021 +0100 Merge tag 'samsung-dt64-exynos-usi-5.17' into next/drivers Samsung DTS ARM64 driver bindings for v5.17 Header with Samsung Exynos USI driver constants used by both DTS and driver. commit 7836149e155bd3c554571f135619f95932c841fc Author: Chanho Park Date: Wed Dec 8 18:18:53 2021 +0900 arm64: dts: exynos: convert serial_0 to USI on ExynosAutov9 According to USI v2 driver change[1], serial_0 node should be converted to use the USI node hierarchy. syscon_peric0 will be used as a syscon node to control the USI00_USI_SW_CONF register. This also changes the serial node name from uart@ to serial@. [1]: https://lore.kernel.org/linux-samsung-soc/20211204195757.8600-2-semen.protsenko@linaro.org/ Cc: Sam Protsenko Signed-off-by: Chanho Park Reviewed-by: Sam Protsenko Link: https://lore.kernel.org/r/20211208091853.8557-1-chanho61.park@samsung.com Signed-off-by: Krzysztof Kozlowski commit e522ae91b8ff7bf89d22d9322308aba1a6326996 Author: Sam Protsenko Date: Sat Dec 4 21:57:53 2021 +0200 dt-bindings: soc: samsung: Add Exynos USI bindings Add constants for choosing USIv2 configuration mode in device tree. Those are further used in USI driver to figure out which value to write into SW_CONF register. Also document USIv2 IP-core bindings. Signed-off-by: Sam Protsenko Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211204195757.8600-2-semen.protsenko@linaro.org Signed-off-by: Krzysztof Kozlowski commit 97c2259ec7757ec24a90f0ef8fc5ea7fa1c6acca Author: Hans de Goede Date: Fri Dec 3 11:28:54 2021 +0100 platform/x86: int3472: Deal with probe ordering issues The clk and regulator frameworks expect clk/regulator consumer-devices to have info about the consumed clks/regulators described in the device's fw_node. To work around this info missing from the ACPI tables on devices where the int3472 driver is used, the int3472 MFD-cell drivers attach info about consumers to the clks/regulators when registering these. This causes problems with the probe ordering wrt drivers for consumers of these clks/regulators. Since the lookups are only registered when the provider-driver binds, trying to get these clks/regulators before then results in a -ENOENT error for clks and a dummy regulator for regulators. All the sensor ACPI fw-nodes have a _DEP dependency on the INT3472 ACPI fw-node, so to work around these probe ordering issues the ACPI core / i2c-code does not instantiate the I2C-clients for any ACPI devices which have a _DEP dependency on an INT3472 ACPI device until all _DEP-s are met. This relies on acpi_dev_clear_dependencies() getting called by the driver for the _DEP-s when they are ready, add a acpi_dev_clear_dependencies() call to the discrete.c probe code. In the tps68470 case calling acpi_dev_clear_dependencies() is already done by the acpi_gpiochip_add() call done by the driver for the GPIO MFD cell (The GPIO cell is deliberately the last cell created to make sure the clk + regulator cells are already instantiated when this happens). However for proper probe ordering, the clk/regulator cells must not just be instantiated the must be fully ready (the clks + regulators must be registered with their subsystems). Add MODULE_SOFTDEP dependencies for the clk and regulator drivers for the instantiated MFD-cells so that these are loaded before us and so that they bind immediately when the platform-devs are instantiated. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211203102857.44539-12-hdegoede@redhat.com commit 19d8d6e36b4b7aa2a9a9cb64687572a1d9f234bf Author: Hans de Goede Date: Fri Dec 3 11:28:53 2021 +0100 platform/x86: int3472: Pass tps68470_regulator_platform_data to the tps68470-regulator MFD-cell Pass tps68470_regulator_platform_data to the tps68470-regulator MFD-cell, specifying the voltages of the various regulators and tying the regulators to the sensor supplies so that sensors which use the TPS68470 can find their regulators. Since the voltages and supply connections are board-specific, this introduces a DMI matches int3472_tps68470_board_data struct which contains the necessary per-board info. This per-board info also includes GPIO lookup information for the sensor IO lines which may be connected to the tps68470 GPIOs. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211203102857.44539-11-hdegoede@redhat.com commit d3d76ae139a7ba2162ab86f54f722d4da8c3bc95 Author: Hans de Goede Date: Fri Dec 3 11:28:52 2021 +0100 platform/x86: int3472: Pass tps68470_clk_platform_data to the tps68470-regulator MFD-cell Pass tps68470_clk_platform_data to the tps68470-clk MFD-cell, so that sensors which use the TPS68470 can find their clock. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211203102857.44539-10-hdegoede@redhat.com commit 71102bc7964342f0aaf1faf7aa384678b1207848 Author: Hans de Goede Date: Fri Dec 3 11:28:51 2021 +0100 platform/x86: int3472: Add get_sensor_adev_and_name() helper The discrete.c code is not the only code which needs to lookup the acpi_device and device-name for the sensor for which the INT3472 ACPI-device is a GPIO/clk/regulator provider. The tps68470.c code also needs this functionality, so factor this out into a new get_sensor_adev_and_name() helper. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211203102857.44539-9-hdegoede@redhat.com commit a2f9fbc247eea0ad1b0b59bc29bec144c5ead03c Author: Hans de Goede Date: Fri Dec 3 11:28:50 2021 +0100 platform/x86: int3472: Split into 2 drivers The intel_skl_int3472.ko module contains 2 separate drivers, the int3472_discrete platform driver and the int3472_tps68470 I2C-driver. These 2 drivers contain very little shared code, only skl_int3472_get_acpi_buffer() and skl_int3472_fill_cldb() are shared. Split the module into 2 drivers, linking the little shared code directly into both. This will allow us to add soft-module dependencies for the tps68470 clk, gpio and regulator drivers to the new intel_skl_int3472_tps68470.ko to help with probe ordering issues without causing these modules to get loaded on boards which only use the int3472_discrete platform driver. While at it also rename the .c and .h files to remove the cumbersome intel_skl_int3472_ prefix. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211203102857.44539-8-hdegoede@redhat.com commit 9dfa374cc6d04d2515adc21c39e356b64ee45a29 Author: Hans de Goede Date: Fri Dec 3 11:28:47 2021 +0100 platform_data: Add linux/platform_data/tps68470.h file The clk and regulator frameworks expect clk/regulator consumer-devices to have info about the consumed clks/regulators described in the device's fw_node. To work around cases where this info is not present in the firmware tables, which is often the case on x86/ACPI devices, both frameworks allow the provider-driver to attach info about consumers to the provider-device during probe/registration of the provider device. The TI TPS68470 PMIC is used x86/ACPI devices with the consumer-info missing from the ACPI tables. Thus the tps68470-clk and tps68470-regulator drivers must provide the consumer-info at probe time. Define tps68470_clk_platform_data and tps68470_regulator_platform_data structs to allow the x86 platform code to pass the necessary consumer info to these drivers. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211203102857.44539-5-hdegoede@redhat.com commit c537be0bfad6337f2afd618fe252c03217191405 Author: Hans de Goede Date: Fri Dec 3 11:28:46 2021 +0100 i2c: acpi: Add i2c_acpi_new_device_by_fwnode() function Change i2c_acpi_new_device() into i2c_acpi_new_device_by_fwnode() and add a static inline wrapper providing the old i2c_acpi_new_device() behavior. This is necessary because in some cases we may only have access to the fwnode / acpi_device and not to the matching physical-node struct device *. Suggested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Acked-by: Mika Westerberg Acked-by: Wolfram Sang Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211203102857.44539-4-hdegoede@redhat.com commit fb90e58f7c4e406d510f301e156e2056a4357130 Author: Hans de Goede Date: Fri Dec 3 11:28:45 2021 +0100 i2c: acpi: Use acpi_dev_ready_for_enumeration() helper The clk and regulator frameworks expect clk/regulator consumer-devices to have info about the consumed clks/regulators described in the device's fw_node. To work around cases where this info is not present in the firmware tables, which is often the case on x86/ACPI devices, both frameworks allow the provider-driver to attach info about consumers to the clks/regulators when registering these. This causes problems with the probe ordering wrt drivers for consumers of these clks/regulators. Since the lookups are only registered when the provider-driver binds, trying to get these clks/regulators before then results in a -ENOENT error for clks and a dummy regulator for regulators. To ensure the correct probe-ordering the ACPI core has code to defer the enumeration of consumers affected by this until the providers are ready. Call the new acpi_dev_ready_for_enumeration() helper to avoid enumerating / instantiating i2c-clients too early. Acked-by: Wolfram Sang Acked-by: Rafael J. Wysocki Reviewed-by: Andy Shevchenko Acked-by: Mika Westerberg Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211203102857.44539-3-hdegoede@redhat.com commit 9d9bcae47fd5a0b827521f65ab7d10a218eacc37 Author: Hans de Goede Date: Fri Dec 3 11:28:44 2021 +0100 ACPI: delay enumeration of devices with a _DEP pointing to an INT3472 device The clk and regulator frameworks expect clk/regulator consumer-devices to have info about the consumed clks/regulators described in the device's fw_node. To work around cases where this info is not present in the firmware tables, which is often the case on x86/ACPI devices, both frameworks allow the provider-driver to attach info about consumers to the clks/regulators when registering these. This causes problems with the probe ordering wrt drivers for consumers of these clks/regulators. Since the lookups are only registered when the provider-driver binds, trying to get these clks/regulators before then results in a -ENOENT error for clks and a dummy regulator for regulators. One case where we hit this issue is camera sensors such as e.g. the OV8865 sensor found on the Microsoft Surface Go. The sensor uses clks, regulators and GPIOs provided by a TPS68470 PMIC which is described in an INT3472 ACPI device. There is special platform code handling this and setting platform_data with the necessary consumer info on the MFD cells instantiated for the PMIC under: drivers/platform/x86/intel/int3472. For this to work properly the ov8865 driver must not bind to the I2C-client for the OV8865 sensor until after the TPS68470 PMIC gpio, regulator and clk MFD cells have all been fully setup. The OV8865 on the Microsoft Surface Go is just one example, all X86 devices using the Intel IPU3 camera block found on recent Intel SoCs have similar issues where there is an INT3472 HID ACPI-device, which describes the clks and regulators, and the driver for this INT3472 device must be fully initialized before the sensor driver (any sensor driver) binds for things to work properly. On these devices the ACPI nodes describing the sensors all have a _DEP dependency on the matching INT3472 ACPI device (there is one per sensor). This allows solving the probe-ordering problem by delaying the enumeration (instantiation of the I2C-client in the ov8865 example) of ACPI-devices which have a _DEP dependency on an INT3472 device. The new acpi_dev_ready_for_enumeration() helper used for this is also exported because for devices, which have the enumeration_by_parent flag set, the parent-driver will do its own scan of child ACPI devices and it will try to enumerate those during its probe(). Code doing this such as e.g. the i2c-core-acpi.c code must call this new helper to ensure that it too delays the enumeration until all the _DEP dependencies are met on devices which have the new honor_deps flag set. Acked-by: Rafael J. Wysocki Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211203102857.44539-2-hdegoede@redhat.com commit 2bebea57c2efeb7c4e981f5ff76bdca7e58ab815 Author: Jani Nikula Date: Thu Dec 9 18:51:24 2021 +0200 drm/i915/cdclk: hide struct intel_cdclk_vals The definition is not needed outside of intel_cdclk.c. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/f7e7e7fb91eae2b49a0ab5d982a235cec34e3320.1639068649.git.jani.nikula@intel.com commit 754d6275e9ce6310813087628ef2e44b6c65e23a Author: Jani Nikula Date: Thu Dec 9 18:51:22 2021 +0200 drm/i915/cdclk: move intel_atomic_check_cdclk() to intel_cdclk.c Rename to intel_cdclk_atomic_check() and make intel_cdclk_bw_calc_min_cdclk() static. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/43ad4d437121f43d76c790ac5d4d131743d58988.1639068649.git.jani.nikula@intel.com commit a09147188f7fc0d1ce9b5fb6b7fa6a81c6806073 Author: Jani Nikula Date: Fri Dec 10 15:17:01 2021 +0200 drm/i915/pxp: remove useless includes Not needed. Reviewed-by: Ville Syrjälä Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/01c4ea0cea17eead027c83dc9eaca3c181ce3a24.1639142167.git.jani.nikula@intel.com commit ee0ff28a497eed4e23e0d617e6f5feacca69e0f1 Author: Jani Nikula Date: Fri Dec 10 15:17:00 2021 +0200 drm/i915/pxp: un-inline intel_pxp_is_enabled() In the interest of reducing include dependencies, un-inline intel_pxp_is_enabled(). v2: Fix build for CONFIG_DRM_I915_PXP=n Reviewed-by: Ville Syrjälä Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/36bbb3708f3b1f84f0718afff94212dde93cb479.1639142167.git.jani.nikula@intel.com commit 0cdbab89c02d47a277577a90d02e3f214d2af9ac Author: Jani Nikula Date: Fri Dec 10 15:16:59 2021 +0200 drm/i915/fb: reduce include dependencies We actually need i915_active_types.h, not i915_active.h. Reviewed-by: Ville Syrjälä Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/aed5f1afda4448ec46c7ff1f95291edebf355790.1639142167.git.jani.nikula@intel.com commit 14567eed87a39d0b40d3e1444f0ddaec013c1a52 Author: Jani Nikula Date: Fri Dec 10 15:16:58 2021 +0200 drm/i915/fbc: avoid intel_frontbuffer.h include with declaration Reduce include dependencies using forward declarations. Reviewed-by: Ville Syrjälä Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/fb54050e03f830a1b29eb14cb37466f39c499cc2.1639142167.git.jani.nikula@intel.com commit 1aad06f89291c2191f7c352bcd63cdf393f0f87b Author: Jani Nikula Date: Fri Dec 10 15:16:57 2021 +0200 drm/i915/psr: avoid intel_frontbuffer.h include with declaration Reduce include dependencies using forward declarations. Reviewed-by: Ville Syrjälä Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/ee35f2f01f731c21f24a238f2d1690b09ac2da1f.1639142167.git.jani.nikula@intel.com commit c7c2918849138057cb2206b4fe10b65f02ab07e1 Author: Jani Nikula Date: Fri Dec 10 15:16:56 2021 +0200 drm/i915/active: remove useless i915_utils.h include Not needed. Reviewed-by: Ville Syrjälä Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/52b1cf56c16bf669a1357ce81d9232c5480914a4.1639142167.git.jani.nikula@intel.com commit 35291c9c02540692039cf7231f7de42fc89be096 Author: Jani Nikula Date: Fri Dec 10 15:16:55 2021 +0200 drm/i915/reset: include intel_display.h instead of intel_display_types.h Use the more specific include that's needed. v2: Include intel_display.h (Ville) Reviewed-by: Ville Syrjälä Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/e1e195b8ca1252d1e149c8185d107a5517496973.1639142167.git.jani.nikula@intel.com commit 5fb6e8cf53b005d287d4c2d137a415ff7d025a81 Author: Mark Rutland Date: Fri Nov 26 11:59:23 2021 +0000 locking/atomic: atomic64: Remove unusable atomic ops The generic atomic64 implementation provides: * atomic64_and_return() * atomic64_or_return() * atomic64_xor_return() ... but none of these exist in the standard atomic64 API as described by scripts/atomic/atomics.tbl, and none of these have prototypes exposed by . The lkp kernel test robot noted this results in warnings when building with W=1: lib/atomic64.c:82:5: warning: no previous prototype for 'generic_atomic64_and_return' [-Wmissing-prototypes] lib/atomic64.c:82:5: warning: no previous prototype for 'generic_atomic64_or_return' [-Wmissing-prototypes] lib/atomic64.c:82:5: warning: no previous prototype for 'generic_atomic64_xor_return' [-Wmissing-prototypes] This appears to have been a thinko in commit: 28aa2bda2211f432 ("locking/atomic: Implement atomic{,64,_long}_fetch_{add,sub,and,andnot,or,xor}{,_relaxed,_acquire,_release}()") ... where we grouped add/sub separately from and/ox/xor, so that we could avoid implementing _return forms for the latter group, but forgot to remove ATOMIC64_OP_RETURN() for that group. This doesn't cause any functional problem, but it's pointless to build code which cannot be used. Remove the unusable code. This does not affect add/sub, for which _return forms will still be built. Reported-by: kernel test robot Signed-off-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Acked-by: Boqun Feng Link: https://lore.kernel.org/r/20211126115923.41489-1-mark.rutland@arm.com commit ba53ee7f7f38cf0592b8be1dcdabaf8f7535f8c1 Author: Rameshkumar Sundaram Date: Thu Dec 9 23:07:01 2021 +0530 ath11k: Fix deleting uninitialized kernel timer during fragment cache flush frag_timer will be created & initialized for stations when they associate and will be deleted during every key installation while flushing old fragments. For AP interface self peer will be created and Group keys will be installed for this peer, but there will be no real Station entry & hence frag_timer won't be created and initialized, deleting such uninitialized kernel timers causes below warnings and backtraces printed with CONFIG_DEBUG_OBJECTS_TIMERS enabled. [ 177.828008] ODEBUG: assert_init not available (active state 0) object type: timer_list hint: 0x0 [ 177.836833] WARNING: CPU: 3 PID: 188 at lib/debugobjects.c:508 debug_print_object+0xb0/0xf0 [ 177.845185] Modules linked in: ath11k_pci ath11k qmi_helpers qrtr_mhi qrtr ns mhi [ 177.852679] CPU: 3 PID: 188 Comm: hostapd Not tainted 5.14.0-rc3-32919-g4034139e1838-dirty #14 [ 177.865805] pstate: 60000005 (nZCv daif -PAN -UAO -TCO BTYPE=--) [ 177.871804] pc : debug_print_object+0xb0/0xf0 [ 177.876155] lr : debug_print_object+0xb0/0xf0 [ 177.880505] sp : ffffffc01169b5a0 [ 177.883810] x29: ffffffc01169b5a0 x28: ffffff80081c2320 x27: ffffff80081c4078 [ 177.890942] x26: ffffff8003fe8f28 x25: ffffff8003de9890 x24: ffffffc01134d738 [ 177.898075] x23: ffffffc010948f20 x22: ffffffc010b2d2e0 x21: ffffffc01169b628 [ 177.905206] x20: ffffffc01134d700 x19: ffffffc010c80d98 x18: 00000000000003f6 [ 177.912339] x17: 203a657079742074 x16: 63656a626f202930 x15: 0000000000000152 [ 177.919471] x14: 0000000000000152 x13: 00000000ffffffea x12: ffffffc010d732e0 [ 177.926603] x11: 0000000000000003 x10: ffffffc010d432a0 x9 : ffffffc010d432f8 [ 177.933735] x8 : 000000000002ffe8 x7 : c0000000ffffdfff x6 : 0000000000000001 [ 177.940866] x5 : 0000000000000000 x4 : 0000000000000000 x3 : 00000000ffffffff [ 177.947997] x2 : ffffffc010c93240 x1 : ffffff80023624c0 x0 : 0000000000000054 [ 177.955130] Call trace: [ 177.957567] debug_print_object+0xb0/0xf0 [ 177.961570] debug_object_assert_init+0x124/0x178 [ 177.966269] try_to_del_timer_sync+0x1c/0x70 [ 177.970536] del_timer_sync+0x30/0x50 [ 177.974192] ath11k_peer_frags_flush+0x34/0x68 [ath11k] [ 177.979439] ath11k_mac_op_set_key+0x1e4/0x338 [ath11k] [ 177.984673] ieee80211_key_enable_hw_accel+0xc8/0x3d0 [ 177.989722] ieee80211_key_replace+0x360/0x740 [ 177.994160] ieee80211_key_link+0x16c/0x210 [ 177.998337] ieee80211_add_key+0x138/0x338 [ 178.002426] nl80211_new_key+0xfc/0x258 [ 178.006257] genl_family_rcv_msg_doit.isra.17+0xd8/0x120 [ 178.011565] genl_rcv_msg+0xd8/0x1c8 [ 178.015134] netlink_rcv_skb+0x38/0xf8 [ 178.018877] genl_rcv+0x34/0x48 [ 178.022012] netlink_unicast+0x174/0x230 [ 178.025928] netlink_sendmsg+0x188/0x388 [ 178.029845] ____sys_sendmsg+0x218/0x250 [ 178.033763] ___sys_sendmsg+0x68/0x90 [ 178.037418] __sys_sendmsg+0x44/0x88 [ 178.040988] __arm64_sys_sendmsg+0x20/0x28 [ 178.045077] invoke_syscall.constprop.5+0x54/0xe0 [ 178.049776] do_el0_svc+0x74/0xc0 [ 178.053084] el0_svc+0x10/0x18 [ 178.056133] el0t_64_sync_handler+0x88/0xb0 [ 178.060310] el0t_64_sync+0x148/0x14c [ 178.063966] ---[ end trace 8a5cf0bf9d34a058 ]--- Add changes to not to delete frag timer for peers during group key installation. Tested on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-01092-QCAHKSWPL_SILICONZ-1 Fixes: c3944a562102 ("ath11k: Clear the fragment cache during key install") Signed-off-by: Rameshkumar Sundaram Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1639071421-25078-1-git-send-email-quic_ramess@quicinc.com commit 767c94caf0efad136157110787fe221b74cb5c8a Author: Baochen Qiang Date: Thu Dec 9 09:19:49 2021 +0800 ath11k: Avoid false DEADLOCK warning reported by lockdep With CONFIG_LOCKDEP=y and CONFIG_DEBUG_SPINLOCK=y, lockdep reports below warning: [ 166.059415] ============================================ [ 166.059416] WARNING: possible recursive locking detected [ 166.059418] 5.15.0-wt-ath+ #10 Tainted: G W O [ 166.059420] -------------------------------------------- [ 166.059421] kworker/0:2/116 is trying to acquire lock: [ 166.059423] ffff9905f2083160 (&srng->lock){+.-.}-{2:2}, at: ath11k_hal_reo_cmd_send+0x20/0x490 [ath11k] [ 166.059440] but task is already holding lock: [ 166.059442] ffff9905f2083230 (&srng->lock){+.-.}-{2:2}, at: ath11k_dp_process_reo_status+0x95/0x2d0 [ath11k] [ 166.059491] other info that might help us debug this: [ 166.059492] Possible unsafe locking scenario: [ 166.059493] CPU0 [ 166.059494] ---- [ 166.059495] lock(&srng->lock); [ 166.059498] lock(&srng->lock); [ 166.059500] *** DEADLOCK *** [ 166.059501] May be due to missing lock nesting notation [ 166.059502] 3 locks held by kworker/0:2/116: [ 166.059504] #0: ffff9905c0081548 ((wq_completion)events){+.+.}-{0:0}, at: process_one_work+0x1f6/0x660 [ 166.059511] #1: ffff9d2400a5fe68 ((debug_obj_work).work){+.+.}-{0:0}, at: process_one_work+0x1f6/0x660 [ 166.059517] #2: ffff9905f2083230 (&srng->lock){+.-.}-{2:2}, at: ath11k_dp_process_reo_status+0x95/0x2d0 [ath11k] [ 166.059532] stack backtrace: [ 166.059534] CPU: 0 PID: 116 Comm: kworker/0:2 Kdump: loaded Tainted: G W O 5.15.0-wt-ath+ #10 [ 166.059537] Hardware name: Intel(R) Client Systems NUC8i7HVK/NUC8i7HVB, BIOS HNKBLi70.86A.0059.2019.1112.1124 11/12/2019 [ 166.059539] Workqueue: events free_obj_work [ 166.059543] Call Trace: [ 166.059545] [ 166.059547] dump_stack_lvl+0x56/0x7b [ 166.059552] __lock_acquire+0xb9a/0x1a50 [ 166.059556] lock_acquire+0x1e2/0x330 [ 166.059560] ? ath11k_hal_reo_cmd_send+0x20/0x490 [ath11k] [ 166.059571] _raw_spin_lock_bh+0x33/0x70 [ 166.059574] ? ath11k_hal_reo_cmd_send+0x20/0x490 [ath11k] [ 166.059584] ath11k_hal_reo_cmd_send+0x20/0x490 [ath11k] [ 166.059594] ath11k_dp_tx_send_reo_cmd+0x3f/0x130 [ath11k] [ 166.059605] ath11k_dp_rx_tid_del_func+0x221/0x370 [ath11k] [ 166.059618] ath11k_dp_process_reo_status+0x22f/0x2d0 [ath11k] [ 166.059632] ? ath11k_dp_service_srng+0x2ea/0x2f0 [ath11k] [ 166.059643] ath11k_dp_service_srng+0x2ea/0x2f0 [ath11k] [ 166.059655] ath11k_pci_ext_grp_napi_poll+0x1c/0x70 [ath11k_pci] [ 166.059659] __napi_poll+0x28/0x230 [ 166.059664] net_rx_action+0x285/0x310 [ 166.059668] __do_softirq+0xe6/0x4d2 [ 166.059672] irq_exit_rcu+0xd2/0xf0 [ 166.059675] common_interrupt+0xa5/0xc0 [ 166.059678] [ 166.059679] [ 166.059680] asm_common_interrupt+0x1e/0x40 [ 166.059683] RIP: 0010:_raw_spin_unlock_irqrestore+0x38/0x70 [ 166.059686] Code: 83 c7 18 e8 2a 95 43 ff 48 89 ef e8 22 d2 43 ff 81 e3 00 02 00 00 75 25 9c 58 f6 c4 02 75 2d 48 85 db 74 01 fb bf 01 00 00 00 63 2e 40 ff 65 8b 05 8c 59 97 5c 85 c0 74 0a 5b 5d c3 e8 00 6a [ 166.059689] RSP: 0018:ffff9d2400a5fca0 EFLAGS: 00000206 [ 166.059692] RAX: 0000000000000002 RBX: 0000000000000200 RCX: 0000000000000006 [ 166.059694] RDX: 0000000000000000 RSI: ffffffffa404879b RDI: 0000000000000001 [ 166.059696] RBP: ffff9905c0053000 R08: 0000000000000001 R09: 0000000000000001 [ 166.059698] R10: ffff9d2400a5fc50 R11: 0000000000000001 R12: ffffe186c41e2840 [ 166.059700] R13: 0000000000000001 R14: ffff9905c78a1c68 R15: 0000000000000001 [ 166.059704] free_debug_processing+0x257/0x3d0 [ 166.059708] ? free_obj_work+0x1f5/0x250 [ 166.059712] __slab_free+0x374/0x5a0 [ 166.059718] ? kmem_cache_free+0x2e1/0x370 [ 166.059721] ? free_obj_work+0x1f5/0x250 [ 166.059724] kmem_cache_free+0x2e1/0x370 [ 166.059727] free_obj_work+0x1f5/0x250 [ 166.059731] process_one_work+0x28b/0x660 [ 166.059735] ? process_one_work+0x660/0x660 [ 166.059738] worker_thread+0x37/0x390 [ 166.059741] ? process_one_work+0x660/0x660 [ 166.059743] kthread+0x176/0x1a0 [ 166.059746] ? set_kthread_struct+0x40/0x40 [ 166.059749] ret_from_fork+0x22/0x30 [ 166.059754] Since these two lockes are both initialized in ath11k_hal_srng_setup, they are assigned with the same key. As a result lockdep suspects that the task is trying to acquire the same lock (due to same key) while already holding it, and thus reports the DEADLOCK warning. However as they are different spinlock instances, the warning is false positive. On the other hand, even no dead lock indeed, this is a major issue for upstream regression testing as it disables lockdep functionality. Fix it by assigning separate lock class key for each srng->lock. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Signed-off-by: Baochen Qiang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211209011949.151472-1-quic_bqiang@quicinc.com commit 6773cc31a9bb5122fd5c288f73ca006ad20a6c17 Merge: 0f09c27469859 2585cf9dfaadd Author: Ingo Molnar Date: Mon Dec 13 10:48:46 2021 +0100 Merge tag 'v5.16-rc5' into locking/core, to pick up fixes Signed-off-by: Ingo Molnar commit 55e18e5a76ab5de2286d4bac703a78066278f475 Author: Carl Huang Date: Thu Dec 9 10:17:49 2021 +0200 ath11k: set DTIM policy to stick mode for station interface Set DTIM policy to DTIM stick mode, so station follows AP DTIM interval rather than listen interval which is set in peer assoc cmd. DTIM stick mode is more preferred per firmware team request. Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Signed-off-by: Carl Huang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1638948694-15582-1-git-send-email-quic_cjhuang@quicinc.com commit 9cbd7fc9be82a99af690adcebd6f2cdae4c7c193 Author: Carl Huang Date: Thu Dec 9 10:17:49 2021 +0200 ath11k: support MAC address randomization in scan The driver reports NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR capability to upper layer based on the service bit firmware reported. Driver sets the spoofed flag in scan_ctrl_flag to firmware if upper layer has enabled this feature in scan request. Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Signed-off-by: Carl Huang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1638948007-9609-1-git-send-email-quic_cjhuang@quicinc.com commit 5341d57bc398df62fa1e54ec7cf8e3bf9da1c597 Author: Kalle Valo Date: Thu Dec 9 11:15:45 2021 +0200 ath10k: wmi: remove array of flexible structures I updated to sparse v0.6.4 and it warns: drivers/net/wireless/ath/ath10k/wmi.c: note: in included file (through drivers/net/wireless/ath/ath10k/core.h): drivers/net/wireless/ath/ath10k/wmi.h:3481:34: warning: array of flexible structures Fix it by changing the type to u8 array, in struct wmi_phyerr_hdr_arg it's stored as a void pointer anyway. Compile tested only. Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211209091545.6098-2-kvalo@kernel.org commit 56789eef894cf286596b3f15270e64f3649377ba Author: Kalle Valo Date: Thu Dec 9 11:15:44 2021 +0200 ath10k: htt: remove array of flexible structures I updated to sparse v0.6.4 and it warns: drivers/net/wireless/ath/ath10k/hw.c: note: in included file (through drivers/net/wireless/ath/ath10k/core.h): drivers/net/wireless/ath/ath10k/htt.h:1503:41: warning: array of flexible structures drivers/net/wireless/ath/ath10k/htt_rx.c: note: in included file (through drivers/net/wireless/ath/ath10k/core.h): drivers/net/wireless/ath/ath10k/htt.h:1503:41: warning: array of flexible structures The structure is unused in ath10k so let's just remove it. Compile tested only. Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211209091545.6098-1-kvalo@kernel.org commit bce45c2620e2142eb18bfb4b0aaee8cb83429a35 Author: Sebastian Andrzej Siewior Date: Fri Dec 10 21:44:17 2021 +0100 drm/i915: Don't disable interrupts and pretend a lock as been acquired in __timeline_mark_lock(). This is a revert of commits d67739268cf0e ("drm/i915/gt: Mark up the nested engine-pm timeline lock as irqsafe") 6c69a45445af9 ("drm/i915/gt: Mark context->active_count as protected by timeline->mutex") 6dcb85a0ad990 ("drm/i915: Hold irq-off for the entire fake lock period") The existing code leads to a different behaviour depending on whether lockdep is enabled or not. Any following lock that is acquired without disabling interrupts (but needs to) will not be noticed by lockdep. This it not just a lockdep annotation but is used but an actual mutex_t that is properly used as a lock but in case of __timeline_mark_lock() lockdep is only told that it is acquired but no lock has been acquired. It appears that its purpose is just satisfy the lockdep_assert_held() check in intel_context_mark_active(). The other problem with disabling interrupts is that on PREEMPT_RT interrupts are also disabled which leads to problems for instance later during memory allocation. Add a CONTEXT_IS_PARKING bit to intel_engine_cs and set_bit/clear_bit it instead of mutex_acquire/mutex_release. Use test_bit in the two identified spots which relied on the lockdep annotation. Cc: Peter Zijlstra Signed-off-by: Sebastian Andrzej Siewior Acked-by: Daniel Vetter Reviewed-by: Tvrtko Ursulin Signed-off-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/YbO8Ie1Nj7XcQPNQ@linutronix.de commit af40d16042d674442db8cf5fd654fabcd45fea44 Merge: 9a0a930fe2535 2585cf9dfaadd Author: Greg Kroah-Hartman Date: Mon Dec 13 10:17:10 2021 +0100 Merge v5.15-rc5 into char-misc-next We need the fixes in here as well, and also resolve some merge conflicts in: drivers/misc/eeprom/at25.c Signed-off-by: Greg Kroah-Hartman commit c45479ecd0c21705ab078ceaba097bbb730a0541 Merge: d598c3c46ea69 2585cf9dfaadd Author: Greg Kroah-Hartman Date: Mon Dec 13 10:11:05 2021 +0100 Merge 5.16-rc5 into usb-next We need the USB fixes in here as well. Signed-off-by: Greg Kroah-Hartman commit 55b71f6c29f2a78af42dd453dfed895eba516cb4 Author: Takashi Sakamoto Date: Mon Dec 13 17:12:57 2021 +0900 ALSA: uapi: use C90 comment style instead of C99 style UAPI headers are built with compiler option for C90, thus double-slashes comment introduced in C99 is not preferable. Fixes: fb6723daf890 ("ALSA: pcm: comment about relation between msbits hw parameter and [S|U]32 formats") Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20211213081257.36097-1-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit fb6723daf89083a0d2290f3a0abc777e40766c84 Author: Takashi Sakamoto Date: Sat May 29 12:33:53 2021 +0900 ALSA: pcm: comment about relation between msbits hw parameter and [S|U]32 formats Regarding to handling [U|S][32|24] PCM formats, many userspace application developers and driver developers have confusion, since they require them to understand justification or padding. It easily loses consistency and soundness to operate with many type of devices. In this commit, I attempt to solve the situation by adding comment about relation between [S|U]32 formats and 'msbits' hardware parameter. The formats are used for 'left-justified' sample format, and the available bit count in most significant bit is delivered to userspace in msbits hardware parameter (struct snd_pcm_hw_params.msbits), which is decided by msbits constraint added by pcm drivers (snd_pcm_hw_constraint_msbits()). In driver side, the msbits constraint includes two elements; the physical width of format and the available width of the format in most significant bit. The former is used to match SAMPLE_BITS of format. (For my convenience, I ignore wildcard in the usage of the constraint.) As a result of interaction between ALSA pcm core and ALSA pcm application, when the format in which SAMPLE_BITS equals to physical width of the msbits constaint, the msbits parameter is set by referring to the available width of the constraint. When the msbits parameter is not changed in the above process, ALSA pcm core set it alternatively with SAMPLE_BIT of chosen format. In userspace application side, the msbits is only available after calling ioctl(2) with SNDRV_PCM_IOCTL_HW_PARAMS request. Even if the hardware parameter structure includes somewhat value of SAMPLE_BITS interval parameter as width of format, all of the width is not always available since msbits can be less than the width. I note that [S|U]24 formats are used for 'right-justified' 24 bit sample formats within 32 bit frame. The first byte in most significant bit should be invalidated. Although the msbits exposed to userspace should be zero as invalid value, actually it is 32 from physical width of format. [ corrected typos -- tiwai ] Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/20210529033353.21641-1-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai commit 046612a3f592044762789ec086feb2cdaaf393f6 Author: Hans de Goede Date: Sun Dec 12 21:06:25 2021 -0800 Input: silead - add pen support Some Silead touchscreens have support for an active (battery powered) pen, add support for this. So far pen-support has only been seen on X86/ACPI (non devicetree) devs, IOW it is not used in actual devicetree files. The devicetree-bindings maintainers have requested properties like these to not be added to the devicetree-bindings, so the new properties are deliberately not added to the existing silead devicetree-bindings documentation. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211122220637.11386-3-hdegoede@redhat.com Signed-off-by: Dmitry Torokhov commit 66d27d848fa6bf613bd716cb2c71769a211a6ffe Author: Hans de Goede Date: Sun Dec 12 21:05:29 2021 -0800 Input: silead - add support for EFI-embedded fw using different min/max coordinates Unfortunately, at the time of writing this commit message, we have been unable to get permission from Silead, or from device OEMs, to distribute the necessary Silead firmware files in linux-firmware. On a whole bunch of devices the UEFI BIOS code contains a touchscreen driver, which contains an embedded copy of the firmware. The fw-loader code has a "platform" fallback mechanism, which together with info on the firmware from drivers/platform/x86/touchscreen_dmi.c will use the firmware from the UEFI driver when the firmware is missing from /lib/firmware. This makes the touchscreen work OOTB without users needing to manually download the firmware. The firmware bundled with the original Windows/Android is usually newer then the firmware in the UEFI driver and it is better calibrated. This better calibration can lead to significant differences in the reported min/max coordinates. Add support for a new (optional) "silead,efi-fw-min-max" property which provides a set of alternative min/max values to use for the x/y axis when the EFI embedded firmware is used. The new property is only used on (x86) devices which do not use devicetree, IOW it is not used in actual devicetree files. The devicetree-bindings maintainers have requested properties like these to not be added to the devicetree-bindings, so the new property is deliberately not added to the existing silead devicetree-bindings documentation. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211122220637.11386-2-hdegoede@redhat.com Signed-off-by: Dmitry Torokhov commit 71f4ecd5ee8463bd47783bb0a37516aee3e0fd38 Author: Hans de Goede Date: Sun Dec 12 20:54:29 2021 -0800 Input: goodix - 2 small fixes for pen support 2 small fixes for pen support 1. Set the id.vendor field for the pen input_dev 2. Fix a typo in a comment Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211212124242.81019-5-hdegoede@redhat.com Signed-off-by: Dmitry Torokhov commit 84345c618e1e461519ac8235dca37bab1360a021 Author: Hans de Goede Date: Sun Dec 12 20:54:15 2021 -0800 Input: goodix - improve gpiod_get() error logging goodix_get_gpio_config() errors are fatal (abort probe()) so log them at KERN_ERR level rather then as debug messages. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211212124242.81019-4-hdegoede@redhat.com Signed-off-by: Dmitry Torokhov commit 87bb2a410dcfb617b88e4695edf4beb6336dc314 Author: Harshit Mogalapalli Date: Thu Dec 9 20:41:24 2021 -0800 drm/i915/display: Fix an unsigned subtraction which can never be negative. smatch warning: drivers/gpu/drm/i915/display/intel_dmc.c:601 parse_dmc_fw() warn: unsigned 'fw->size - offset' is never less than zero Firmware size is size_t and offset is u32. So the subtraction is unsigned which can never be less than zero. Fixes: 3d5928a168a9 ("drm/i915/xelpd: Pipe A DMC plugging") Signed-off-by: Harshit Mogalapalli Reviewed-by: Lucas De Marchi Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20211210044129.12422-1-harshit.m.mogalapalli@oracle.com commit 4b443bc1785f28df56fdbd6a107dc68ef7d5aa8e Author: Andrii Nakryiko Date: Sun Dec 12 17:07:06 2021 -0800 libbpf: Don't validate TYPE_ID relo's original imm value During linking, type IDs in the resulting linked BPF object file can change, and so ldimm64 instructions corresponding to BPF_CORE_TYPE_ID_TARGET and BPF_CORE_TYPE_ID_LOCAL CO-RE relos can get their imm value out of sync with actual CO-RE relocation information that's updated by BPF linker properly during linking process. We could teach BPF linker to adjust such instructions, but it feels a bit too much for linker to re-implement good chunk of bpf_core_patch_insns logic just for this. This is a redundant safety check for TYPE_ID relocations, as the real validation is in matching CO-RE specs, so if that works fine, it's very unlikely that there is something wrong with the instruction itself. So, instead, teach libbpf (and kernel) to ignore insn->imm for BPF_CORE_TYPE_ID_TARGET and BPF_CORE_TYPE_ID_LOCAL relos. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211213010706.100231-1-andrii@kernel.org commit f12468828c28ff90d20c99b234a94223401f7924 Author: Andrii Nakryiko Date: Sun Dec 12 11:13:41 2021 -0800 selftests/bpf: Remove last bpf_create_map_xattr from test_verifier bpf_create_map_xattr() call was reintroduced after merging bpf tree into bpf-next tree. Convert the last instance into bpf_map_create() call. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211212191341.2529573-1-andrii@kernel.org commit 7b9eb6cfdb784ad713024a3f8f202620ad40ba70 Author: Zoltan HERPAI Date: Sun Dec 12 18:49:40 2021 +0100 ARM: dts: ixp4xx: Add devicetree for Gateway 7001 This adds a device tree for the Gateway 7001 AP, based on Intel IXP422. Cc: Imre Kaloz Signed-off-by: Zoltan HERPAI Signed-off-by: Linus Walleij commit 17f81f9d4b41d57e474975c3a5ca2a2c4c01e2ec Author: Christoph Hellwig Date: Mon Dec 6 08:04:09 2021 +0100 mtd_blkdevs: don't scan partitions for plain mtdblock mtdblock / mtdblock_ro set part_bits to 0 and thus nevever scanned partitions. Restore that behavior by setting the GENHD_FL_NO_PART flag. Fixes: 1ebe2e5f9d68e94c ("block: remove GENHD_FL_EXT_DEVT") Reported-by: Geert Uytterhoeven Signed-off-by: Christoph Hellwig Tested-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20211206070409.2836165-1-hch@lst.de Signed-off-by: Jens Axboe commit 1665a92f780ac47c56c47916a9f8c4efbdd794b9 Author: Jonathan Cameron Date: Sat Dec 4 16:58:17 2021 +0000 dt-bindings: iio: dac: adi,ad5755: drop unrelated included. Probably a cut and paste error, but the binding header used in the example is for the wrong device and nothing from it is used. Signed-off-by: Jonathan Cameron Cc: Sean Nyekjaer Reviewed-by: Rob Herring commit a81c33f56abea1a63495e9a72073dda8c28083b8 Author: Jonathan Cameron Date: Sun Dec 5 17:01:40 2021 +0000 iio:adc/dac:Kconfig: Update to drop OF dependencies. We could probably drop a lot more of these, but for now this removes unnecessary restrictions on stand alone ADC devices. For these 3 drivers the false dependency seems to date all the way back to their initial introduction. Signed-off-by: Jonathan Cameron Reviewed-by: Andy Shevchenko commit ade2be6d9b07529f35cb98c49b00a1b3bf26973c Author: Jonathan Cameron Date: Sun Dec 5 17:01:39 2021 +0000 iio:adc:ti-ads124s08: Drop dependency on OF. Nothing in this driver depends on OF firmware so drop the dependency and update the headers to remove the false impression such a dependency exists. Signed-off-by: Jonathan Cameron Reviewed-by: Andy Shevchenko commit f346c96505412d83f7c8aa09629e48c2d3315fd4 Author: Jonathan Cameron Date: Sun Dec 5 17:01:38 2021 +0000 iio:adc:envelope-detector: Switch from of headers to mod_devicetable.h There is nothing directly using of specific interfaces in this driver, so lets not include the headers. Signed-off-by: Jonathan Cameron Acked-by: Peter Rosin Reviewed-by: Andy Shevchenko commit 3c3969a0c99b0da5223d869b3b21ce3d38931810 Author: Jonathan Cameron Date: Sun Dec 5 17:01:37 2021 +0000 iio:adc:ti-adc12138: Switch to generic firmware properties and drop of_match_ptr This enables using the driver with other firmware types such as ACPI via PRP0001. Also part of a general attempt to move IIO drivers over to generic properties to avoid opportunities for cut and paste. Signed-off-by: Jonathan Cameron Reviewed-by: Andy Shevchenko commit 4efc1c614d334883cce09c38aa3fe74d3fb0bbf0 Author: Jonathan Cameron Date: Sun Dec 5 17:01:36 2021 +0000 iio:adc:mcp3911: Switch to generic firmware properties. This allows use of the driver with other types of firmware such as ACPI PRP0001 based probing. Also part of a general attempt to remove direct use of of_ specific accessors from IIO. Added an include for mod_devicetable.h whilst here to cover the struct of_device_id definition. Signed-off-by: Jonathan Cameron Reviewed-by: Andy Shevchenko Cc: Kent Gustavsson Reviewed-by: Marcus Folkesson commit c88eba5a186e6de87d7dcdf160d7d9fb989a191c Author: Jonathan Cameron Date: Sun Dec 5 17:01:35 2021 +0000 iio:adc:max9611: Switch to generic firmware properties. Note the handling of the device tree node in this driver was somewhat unusual. I have cleaned that up whilst also moving over to generic properties. Part of a general attempt to move all IIO drivers over to generic firmware properties both as a general improvement and to avoid sources of cut and paste into future drivers. Signed-off-by: Jonathan Cameron Reviewed-by: Andy Shevchenko commit fdb726c4f9ef8a9301137530344aa4303fa0e571 Author: Jonathan Cameron Date: Sun Dec 5 17:01:34 2021 +0000 iio:light:cm3605: Switch to generic firmware properties. This enables use of other firmware types with minimal driver changes. Part of an ongoing effort to move all IIO drivers over to generic accessors in order to reduce the chance of of_* versions being copied into new drivers. Also updated the headers to reflect this change including using mod_devicetable.h for struct of_device_id definition rather than going via of.h Signed-off-by: Jonathan Cameron Reviewed-by: Linus Walleij Reviewed-by: Andy Shevchenko commit 92311717b3a37f2c888b30b940510ed6c058bfb0 Author: Jonathan Cameron Date: Sun Dec 5 17:01:33 2021 +0000 iio:pot:mcp41010: Switch to generic firmware properties. In this case it was only of_device_get_match_data() + header update. This enables use of other firmware types with no other changes, such as ACPI via the PRP0001 route. Signed-off-by: Jonathan Cameron Reviewed-by: Andy Shevchenko Cc: Chris Coffey commit 09a74ea737352a80ed6e3fd427350d7d9c5a5502 Author: Jonathan Cameron Date: Sun Dec 5 17:01:32 2021 +0000 iio:dac:lpc18xx_dac: Swap from of* to mod_devicetable.h This driver never used anything from the of specific headers. mod_devicetable.h provides the struct of_device_id definition. Signed-off-by: Jonathan Cameron Reviewed-by: Andy Shevchenko commit 5669c086e699ff269a977b225a8c9643cf39e53f Author: Jonathan Cameron Date: Sun Dec 5 17:01:31 2021 +0000 iio:dac:dpot-dac: Swap of.h for mod_devicetable.h This driver never used anything in the of specific header. It just wants the struct of_device_id from mod_devicetable.h. Signed-off-by: Jonathan Cameron Reviewed-by: Andy Shevchenko Acked-by: Peter Rosin commit f191fe4f0d3e8ed033d888b4da9039f8ffe4039f Author: Jonathan Cameron Date: Sun Dec 5 17:01:30 2021 +0000 iio:dac:ad5758: Drop unused of specific headers. These have never been used in this driver. What is used is in mod_devicetable.h so add that include (struct of_device_id) Signed-off-by: Jonathan Cameron Reviewed-by: Andy Shevchenko Cc: Daniel Gomez commit 3ac27afefd5dd6a53e830542b899f092a58b6b51 Author: Jonathan Cameron Date: Sun Dec 5 17:01:29 2021 +0000 iio:dac:ad5755: Switch to generic firmware properties and drop pdata Lars pointed out that platform data can also be supported via the generic properties interface, so there is no point in continuing to support it separately. Hence squish the linux/platform_data/ad5755.h header into the c file and drop accessing the platform data directly. Done by inspection only. Mostly completely mechanical with the exception of a few places where default value handling is cleaner done by first setting the value, then calling the firmware reading function but and not checking the return value, as opposed to reading firmware then setting the default if an error occurs. Part of general attempt to move all of IIO over to generic device properties, both to enable other firmware types and to remove drivers that can be the source of of_ specific behaviour in new drivers. Suggested-by: Lars-Peter Clausen Signed-off-by: Jonathan Cameron Reviewed-by: Andy Shevchenko commit 9020ef659885f2622cfb386cc229b6d618362895 Author: Jonathan Cameron Date: Sun Oct 17 18:22:09 2021 +0100 iio: trigger: Fix a scheduling whilst atomic issue seen on tsc2046 IIO triggers are software IRQ chips that split an incoming IRQ into separate IRQs routed to all devices using the trigger. When all consumers are done then a trigger callback reenable() is called. There are a few circumstances under which this can happen in atomic context. 1) A single user of the trigger that calls the iio_trigger_done() function from interrupt context. 2) A race between disconnecting the last device from a trigger and the trigger itself sucessfully being disabled. To avoid a resulting scheduling whilst atomic, close this second corner by using schedule_work() to ensure the reenable is not done in atomic context. Note that drivers must be careful to manage the interaction of set_state() and reenable() callbacks to ensure appropriate reference counting if they are relying on the same hardware controls. Deliberately taking this the slow path rather than via a fixes tree because the error has hard to hit and I would like it to soak for a while before hitting a release kernel. Signed-off-by: Jonathan Cameron Cc: Pengutronix Kernel Team Cc: Dmitry Torokhov Tested-by: Oleksij Rempel Cc: Link: https://lore.kernel.org/r/20211017172209.112387-1-jic23@kernel.org commit fea251b6a5dbdf8ba8af64abcd013d66ab6b05ee Author: Cosmin Tanislav Date: Sun Dec 5 13:40:45 2021 +0200 iio: addac: add AD74413R driver The AD74412R and AD74413R are quad-channel, software configurable, input/output solutions for building and process control applications. They contain functionality for analog output, analog input, digital input, resistance temperature detector, and thermocouple measurements integrated into a single chip solution with an SPI interface. The devices feature a 16-bit ADC and four configurable 13-bit DACs to provide four configurable input/output channels and a suite of diagnostic functions. The AD74413R differentiates itself from the AD74412R by being HART-compatible. When configured with channel 0 as voltage output, channel 1 as current output, channel 2 as voltage input and channel 3 as current input, the following structure is created under the corresponding IIO device. . ├── in_current0_offset ├── in_current0_raw ├── in_current0_sampling_frequency ├── in_current0_sampling_frequency_available ├── in_current0_scale ├── in_voltage1_offset ├── in_voltage1_raw ├── in_voltage1_sampling_frequency ├── in_voltage1_sampling_frequency_available ├── in_voltage1_scale ├── in_voltage2_offset ├── in_voltage2_raw ├── in_voltage2_sampling_frequency ├── in_voltage2_sampling_frequency_available ├── in_voltage2_scale ├── in_current3_offset ├── in_current3_raw ├── in_current3_sampling_frequency ├── in_current3_sampling_frequency_available ├── in_current3_scale ├── out_voltage0_raw ├── out_voltage0_scale ├── out_current1_raw ├── out_current1_scale ├── name ├── buffer │   ├── data_available │   ├── enable │   ├── length │   └── watermark └── scan_elements    ├── in_current0_en    ├── in_current0_index    ├── in_current0_type    ├── in_voltage1_en    ├── in_voltage1_index    ├── in_voltage1_type    ├── in_voltage2_en    ├── in_voltage2_index    ├── in_voltage2_type    ├── in_current3_en    ├── in_current3_index    └── in_current3_type Signed-off-by: Cosmin Tanislav Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20211205114045.173612-4-cosmin.tanislav@analog.com Signed-off-by: Jonathan Cameron commit 3cf3cdea6fe3fdb7a1e4ac1372b80408e4f56b73 Author: Cosmin Tanislav Date: Sun Dec 5 13:40:44 2021 +0200 dt-bindings: iio: add AD74413R The AD74412R and AD74413R are quad-channel, software configurable, input/output solutions for building and process control applications. They contain functionality for analog output, analog input, digital input, resistance temperature detector, and thermocouple measurements integrated into a single chip solution with an SPI interface. The devices feature a 16-bit ADC and four configurable 13-bit DACs to provide four configurable input/output channels and a suite of diagnostic functions. The AD74413R differentiates itself from the AD74412R by being HART-compatible. Signed-off-by: Cosmin Tanislav Reviewed-by: Rob Herring Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20211205114045.173612-3-cosmin.tanislav@analog.com Signed-off-by: Jonathan Cameron commit b62e2e1763cda3a6c494ed754317f19be1249297 Author: Cosmin Tanislav Date: Sun Dec 5 13:40:43 2021 +0200 iio: add addac subdirectory For IIO devices that expose both ADC and DAC functionality. Signed-off-by: Cosmin Tanislav Link: https://lore.kernel.org/r/20211205114045.173612-2-cosmin.tanislav@analog.com Signed-off-by: Jonathan Cameron commit d4b572f835a58bb394024fe3250441fabab9eee6 Author: Cai Huoqing Date: Wed Dec 1 16:31:00 2021 +0800 MAINTAINERS: Update i.MX 8QXP ADC info Update my email address to use developer mail address, because the old address will be dropped soon. And change the status from 'Supported' to 'Maintained' for me to look after this code without any payment now. Signed-off-by: Cai Huoqing Link: https://lore.kernel.org/r/20211201083100.1587-1-caihuoqing@baidu.com Signed-off-by: Jonathan Cameron commit 2ff1f4d8df665316921bb752d28a5ea68c1a9811 Author: Antoniu Miclaus Date: Thu Dec 2 17:08:19 2021 +0200 dt-bindings:iio:dac: add ad7293 doc Add device tree bindings for the AD7293 Power Amplifier. Signed-off-by: Antoniu Miclaus Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211202150819.24832-2-antoniu.miclaus@analog.com Signed-off-by: Jonathan Cameron commit 9b5bcb193a3bba4b96ead86df52602e3951655ba Merge: e0068620e5e17 4f3cb34364e25 Author: David S. Miller Date: Sun Dec 12 12:51:34 2021 +0000 Merge branch 'dsa-tagger-storage' Vladimir Oltean says: ==================== Replace DSA dp->priv with tagger-owned storage Ansuel's recent work on qca8k register access over Ethernet: https://patchwork.kernel.org/project/netdevbpf/cover/20211207145942.7444-1-ansuelsmth@gmail.com/ has triggered me to do something which I should've done for a longer time: https://patchwork.kernel.org/project/netdevbpf/patch/20211109095013.27829-7-martin.kaistra@linutronix.de/#24585521 which is to replace dp->priv with something that has less caveats. The dp->priv was introduced when sja1105 needed to hold stateful information in the tagging protocol driver. In that design, dp->priv held memory allocated by the switch driver, because the tagging protocol driver design was 100% stateless. Some years have passed and others have started to feel the need for stateful information kept by the tagger, as well as passing data back and forth between the tagging protocol driver and the switch driver. This isn't possible cleanly in DSA due to a circular dependency which leads to broken module autoloading: https://lore.kernel.org/netdev/20210908220834.d7gmtnwrorhharna@skbuf/ This patchset introduces a framework that resembles something normal, which allows data to be passed from the tagging protocol driver (things like switch management packets, which aren't intended for the network stack) to the switch driver, while the tagging protocol still remains more or less stateless. The overall design of the framework was discussed with Ansuel too and it appears to be flexible enough to cover the "register access over Ethernet" use case. Additionally, the existing uses of dp->priv, which have mainly to do with PTP timestamping, have also been migrated. Changes in v2: Fix transient build breakage in patch 5/11 due to a missing parenthesis, https://patchwork.hopto.org/static/nipa/592567/12665213/build_clang/ and another transient build warning in patch 4/11 that for some reason doesn't appear in my W=1 C=1 build. https://patchwork.hopto.org/static/nipa/592567/12665209/build_clang/stderr ==================== Signed-off-by: David S. Miller commit 4f3cb34364e2552ce5f3a8ca33a184c13c6152a5 Author: Vladimir Oltean Date: Fri Dec 10 01:34:47 2021 +0200 net: dsa: remove dp->priv All current in-tree uses of dp->priv have been replaced with ds->tagger_data, which provides for a safer API especially when the connection isn't the regular 1:1 link between one switch driver and one tagging protocol driver, but could be either one switch to many taggers, or many switches to one tagger. Therefore, we can remove this unused pointer. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 950a419d9de13668f86828394cb242a1f9dece74 Author: Vladimir Oltean Date: Fri Dec 10 01:34:46 2021 +0200 net: dsa: tag_sja1105: split sja1105_tagger_data into private and public sections The sja1105 driver messes with the tagging protocol's state when PTP RX timestamping is enabled/disabled. This is fundamentally necessary because the tagger needs to know what to do when it receives a PTP packet. If RX timestamping is enabled, then a metadata follow-up frame is expected, and this holds the (partial) timestamp. So the tagger plays hide-and-seek with the network stack until it also gets the metadata frame, and then presents a single packet, the timestamped PTP packet. But when RX timestamping isn't enabled, there is no metadata frame expected, so the hide-and-seek game must be turned off and the packet must be delivered right away to the network stack. Considering this, we create a pseudo isolation by devising two tagger methods callable by the switch: one to get the RX timestamping state, and one to set it. Since we can't export symbols between the tagger and the switch driver, these methods are exposed through function pointers. After this change, the public portion of the sja1105_tagger_data contains only function pointers. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit fcbf979a5b4b5784bfb5647ae6190cd5c2ae595d Author: Vladimir Oltean Date: Fri Dec 10 01:34:45 2021 +0200 Revert "net: dsa: move sja1110_process_meta_tstamp inside the tagging protocol driver" This reverts commit 6d709cadfde68dbd12bef12fcced6222226dcb06. The above change was done to avoid calling symbols exported by the switch driver from the tagging protocol driver. With the tagger-owned storage model, we have a new option on our hands, and that is for the switch driver to provide a data consumer handler in the form of a function pointer inside the ->connect_tag_protocol() method. Having a function pointer avoids the problems of the exported symbols approach. By creating a handler for metadata frames holding TX timestamps on SJA1110, we are able to eliminate an skb queue from the tagger data, and replace it with a simple, and stateless, function pointer. This skb queue is now handled exclusively by sja1105_ptp.c, which makes the code easier to follow, as it used to be before the reverted patch. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit c79e84866d2ac637fce921a28288f214e91d662b Author: Vladimir Oltean Date: Fri Dec 10 01:34:44 2021 +0200 net: dsa: tag_sja1105: convert to tagger-owned data Currently, struct sja1105_tagger_data is a part of struct sja1105_private, and is used by the sja1105 driver to populate dp->priv. With the movement towards tagger-owned storage, the sja1105 driver should not be the owner of this memory. This change implements the connection between the sja1105 switch driver and its tagging protocol, which means that sja1105_tagger_data no longer stays in dp->priv but in ds->tagger_data, and that the sja1105 driver now only populates the sja1105_port_deferred_xmit callback pointer. The kthread worker is now the responsibility of the tagger. The sja1105 driver also alters the tagger's state some more, especially with regard to the PTP RX timestamping state. This will be fixed up a bit in further changes. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 22ee9f8e4011fb8a6d75dc2f9a43360d4f400235 Author: Vladimir Oltean Date: Fri Dec 10 01:34:43 2021 +0200 net: dsa: sja1105: move ts_id from sja1105_tagger_data The TX timestamp ID is incremented by the SJA1110 PTP timestamping callback (->port_tx_timestamp) for every packet, when cloning it. It isn't used by the tagger at all, even though it sits inside the struct sja1105_tagger_data. Also, serialization to this structure is currently done through tagger_data->meta_lock, which is a cheap hack because the meta_lock isn't used for anything else on SJA1110 (sja1105_rcv_meta_state_machine isn't called). This change moves ts_id from sja1105_tagger_data to sja1105_private and introduces a dedicated spinlock for it, also in sja1105_private. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit bfcf1425222008e7390c0784b0f3bb7b497fccaa Author: Vladimir Oltean Date: Fri Dec 10 01:34:42 2021 +0200 net: dsa: sja1105: make dp->priv point directly to sja1105_tagger_data The design of the sja1105 tagger dp->priv is that each port has a separate struct sja1105_port, and the sp->data pointer points to a common struct sja1105_tagger_data. We have removed all per-port members accessible by the tagger, and now only struct sja1105_tagger_data remains. Make dp->priv point directly to this. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 6f6770ab1ce2b56619264ec6be0b62f05564dcf6 Author: Vladimir Oltean Date: Fri Dec 10 01:34:41 2021 +0200 net: dsa: sja1105: remove hwts_tx_en from tagger data This tagger property is in fact not used at all by the tagger, only by the switch driver. Therefore it makes sense to be moved to sja1105_private. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit d38049bbe7601f38d598f5da5ff09980483b290a Author: Vladimir Oltean Date: Fri Dec 10 01:34:40 2021 +0200 net: dsa: sja1105: bring deferred xmit implementation in line with ocelot-8021q When the ocelot-8021q driver was converted to deferred xmit as part of commit 8d5f7954b7c8 ("net: dsa: felix: break at first CPU port during init and teardown"), the deferred implementation was deliberately made subtly different from what sja1105 has. The implementation differences lied on the following observations: - There might be a race between these two lines in tag_sja1105.c: skb_queue_tail(&sp->xmit_queue, skb_get(skb)); kthread_queue_work(sp->xmit_worker, &sp->xmit_work); and the skb dequeue logic in sja1105_port_deferred_xmit(). For example, the xmit_work might be already queued, however the work item has just finished walking through the skb queue. Because we don't check the return code from kthread_queue_work, we don't do anything if the work item is already queued. However, nobody will take that skb and send it, at least until the next timestampable skb is sent. This creates additional (and avoidable) TX timestamping latency. To close that race, what the ocelot-8021q driver does is it doesn't keep a single work item per port, and a skb timestamping queue, but rather dynamically allocates a work item per packet. - It is also unnecessary to have more than one kthread that does the work. So delete the per-port kthread allocations and replace them with a single kthread which is global to the switch. This change brings the two implementations in line by applying those observations to the sja1105 driver as well. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit a3d74295d7906ed793e1fd77603b38bb626a6bdb Author: Vladimir Oltean Date: Fri Dec 10 01:34:39 2021 +0200 net: dsa: sja1105: let deferred packets time out when sent to ports going down This code is not necessary and complicates the conversion of this driver to tagger-owned memory. If there is a PTP packet that is sent concurrently with the port getting disabled, the deferred xmit mechanism is robust enough to time out when it sees that it hasn't been delivered, and recovers. Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit 35d976802124303a5b3eb7ec3ed188d568204373 Author: Vladimir Oltean Date: Fri Dec 10 01:34:38 2021 +0200 net: dsa: tag_ocelot: convert to tagger-owned data The felix driver makes very light use of dp->priv, and the tagger is effectively stateless. dp->priv is practically only needed to set up a callback to perform deferred xmit of PTP and STP packets using the ocelot-8021q tagging protocol (the main ocelot tagging protocol makes no use of dp->priv, although this driver sets up dp->priv irrespective of actual tagging protocol in use). struct felix_port (what used to be pointed to by dp->priv) is removed and replaced with a two-sided structure. The public side of this structure, visible to the switch driver, is ocelot_8021q_tagger_data. The private side is ocelot_8021q_tagger_private, and the latter structure physically encapsulates the former. The public half of the tagger data structure can be accessed through a helper of the same name (ocelot_8021q_tagger_data) which also sanity-checks the protocol currently in use by the switch. The public/private split was requested by Andrew Lunn. Suggested-by: Andrew Lunn Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit dc452a471dbae8aca8257c565174212620880093 Author: Vladimir Oltean Date: Fri Dec 10 01:34:37 2021 +0200 net: dsa: introduce tagger-owned storage for private and shared data Ansuel is working on register access over Ethernet for the qca8k switch family. This requires the qca8k tagging protocol driver to receive frames which aren't intended for the network stack, but instead for the qca8k switch driver itself. The dp->priv is currently the prevailing method for passing data back and forth between the tagging protocol driver and the switch driver. However, this method is riddled with caveats. The DSA design allows in principle for any switch driver to return any protocol it desires in ->get_tag_protocol(). The dsa_loop driver can be modified to do just that. But in the current design, the memory behind dp->priv has to be allocated by the switch driver, so if the tagging protocol is paired to an unexpected switch driver, we may end up in NULL pointer dereferences inside the kernel, or worse (a switch driver may allocate dp->priv according to the expectations of a different tagger). The latter possibility is even more plausible considering that DSA switches can dynamically change tagging protocols in certain cases (dsa <-> edsa, ocelot <-> ocelot-8021q), and the current design lends itself to mistakes that are all too easy to make. This patch proposes that the tagging protocol driver should manage its own memory, instead of relying on the switch driver to do so. After analyzing the different in-tree needs, it can be observed that the required tagger storage is per switch, therefore a ds->tagger_data pointer is introduced. In principle, per-port storage could also be introduced, although there is no need for it at the moment. Future changes will replace the current usage of dp->priv with ds->tagger_data. We define a "binding" event between the DSA switch tree and the tagging protocol. During this binding event, the tagging protocol's ->connect() method is called first, and this may allocate some memory for each switch of the tree. Then a cross-chip notifier is emitted for the switches within that tree, and they are given the opportunity to fix up the tagger's memory (for example, they might set up some function pointers that represent virtual methods for consuming packets). Because the memory is owned by the tagger, there exists a ->disconnect() method for the tagger (which is the place to free the resources), but there doesn't exist a ->disconnect() method for the switch driver. This is part of the design. The switch driver should make minimal use of the public part of the tagger data, and only after type-checking it using the supplied "proto" argument. In the code there are in fact two binding events, one is the initial event in dsa_switch_setup_tag_protocol(). At this stage, the cross chip notifier chains aren't initialized, so we call each switch's connect() method by hand. Then there is dsa_tree_bind_tag_proto() during dsa_tree_change_tag_proto(), and here we have an old protocol and a new one. We first connect to the new one before disconnecting from the old one, to simplify error handling a bit and to ensure we remain in a valid state at all times. Co-developed-by: Ansuel Smith Signed-off-by: Ansuel Smith Signed-off-by: Vladimir Oltean Signed-off-by: David S. Miller commit f471b1b2db0819917c54099ab68349ad6a7e9e19 Author: Jagan Teki Date: Fri Nov 12 19:53:59 2021 +0530 arm64: dts: rockchip: Fix Bluetooth on ROCK Pi 4 boards This patch fixes the Bluetooth on ROCK Pi 4 boards. ROCK Pi 4 boards has BCM4345C5 and now it is supported on Mainline Linux, brcm,bcm43438-bt still working but observed the BT Audio issues with latest test. So, use the BCM4345C5 compatible and its associated properties like clock-names as lpo and max-speed. Attach vbat and vddio supply rails as well. Signed-off-by: Jagan Teki Link: https://lore.kernel.org/r/20211112142359.320798-1-jagan@amarulasolutions.com Signed-off-by: Heiko Stuebner commit e0068620e5e1779b3d5bb5649cd196e1cbf277a9 Author: Tobias Waldekranz Date: Thu Dec 9 23:24:24 2021 +0100 net: dsa: mv88e6xxx: Add tx fwd offload PVT on intermediate devices In a typical mv88e6xxx switch tree like this: CPU | .----. .--0--. | .--0--. | sw0 | | | sw1 | '-1-2-' | '-1-2-' '---' If sw1p{1,2} are added to a bridge that sw0p1 is not a part of, sw0 still needs to add a crosschip PVT entry for the virtual DSA device assigned to represent the bridge. Fixes: ce5df6894a57 ("net: dsa: mv88e6xxx: map virtual bridges with forwarding offload in the PVT") Signed-off-by: Tobias Waldekranz Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit 8c8b7aa7fb0cf9e1cc9204e6bc6e1353b8393502 Author: xu xin Date: Wed Dec 8 08:58:44 2021 +0000 net: Enable neighbor sysctls that is save for userns root Inside netns owned by non-init userns, sysctls about ARP/neighbor is currently not visible and configurable. For the attributes these sysctls correspond to, any modifications make effects on the performance of networking(ARP, especilly) only in the scope of netns, which does not affect other netns. Actually, some tools via netlink can modify these attribute. iproute2 is an example. see as follows: $ unshare -ur -n $ cat /proc/sys/net/ipv4/neigh/lo/retrans_time cat: can't open '/proc/sys/net/ipv4/neigh/lo/retrans_time': No such file or directory $ ip ntable show dev lo inet arp_cache dev lo refcnt 1 reachable 19494 base_reachable 30000 retrans 1000 gc_stale 60000 delay_probe 5000 queue 101 app_probes 0 ucast_probes 3 mcast_probes 3 anycast_delay 1000 proxy_delay 800 proxy_queue 64 locktime 1000 inet6 ndisc_cache dev lo refcnt 1 reachable 42394 base_reachable 30000 retrans 1000 gc_stale 60000 delay_probe 5000 queue 101 app_probes 0 ucast_probes 3 mcast_probes 3 anycast_delay 1000 proxy_delay 800 proxy_queue 64 locktime 0 $ ip ntable change name arp_cache dev retrans 2000 inet arp_cache dev lo refcnt 1 reachable 22917 base_reachable 30000 retrans 2000 gc_stale 60000 delay_probe 5000 queue 101 app_probes 0 ucast_probes 3 mcast_probes 3 anycast_delay 1000 proxy_delay 800 proxy_queue 64 locktime 1000 inet6 ndisc_cache dev lo refcnt 1 reachable 35524 base_reachable 30000 retrans 1000 gc_stale 60000 delay_probe 5000 queue 101 app_probes 0 ucast_probes 3 mcast_probes 3 anycast_delay 1000 proxy_delay 800 proxy_queue 64 locktime 0 Reported-by: Zeal Robot Signed-off-by: xu xin Acked-by: Joanne Koong Signed-off-by: David S. Miller commit a39891a6e420daeb55abc99cde4278511ac861d7 Author: David Heidelberg Date: Sun Dec 12 00:38:17 2021 +0100 arm64: dts: rockchip: Add missing secondary compatible for PX30 DSI Add second DSI compatible to comply with DT schema validation comming in the second patch. Signed-off-by: David Heidelberg Link: https://lore.kernel.org/r/20211211233818.88482-1-david@ixit.cz Signed-off-by: Heiko Stuebner commit b73dad806533cad55df41a9c0349969b56d4ff7f Author: Jaroslav Kysela Date: Fri Dec 10 18:54:10 2021 +0000 kselftest: alsa: Use private alsa-lib configuration in mixer test As mentined by Takashi Sakamoto, the system-wide alsa-lib configuration may override the standard device declarations. This patch use the private alsa-lib configuration to set the predictable environment. Signed-off-by: Jaroslav Kysela Link: https://lore.kernel.org/r/20211208095209.1772296-1-perex@perex.cz [Restructure version test to keep the preprocessor happy -- broonie] Reviewed-by: Shuah Khan Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20211210185410.740009-4-broonie@kernel.org Signed-off-by: Takashi Iwai commit 7cc994f27e84cc94ce612d201c78763f93eab2c4 Author: Takashi Sakamoto Date: Fri Dec 10 18:54:09 2021 +0000 kselftest: alsa: optimization for SNDRV_CTL_ELEM_ACCESS_VOLATILE The volatile attribute of control element means that the hardware can voluntarily change the state of control element independent of any operation by software. ALSA control core necessarily sends notification to userspace subscribers for any change from userspace application, while it doesn't for the hardware's voluntary change. This commit adds optimization for the attribute. Even if read value is different from written value, the test reports success as long as the target control element has the attribute. On the other hand, the difference is itself reported for developers' convenience. Signed-off-by: Takashi Sakamoto Link: https://lore.kernel.org/r/Ya7TAHdMe9i41bsC@workstation [Fix comment style as suggested by Shuah -- broonie] Reviewed-by: Shuah Khan Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20211210185410.740009-3-broonie@kernel.org Signed-off-by: Takashi Iwai commit 5aaf9efffc57ea31a13af6f0bf41e96f073ed6d5 Author: Mark Brown Date: Fri Dec 10 18:54:08 2021 +0000 kselftest: alsa: Add simplistic test for ALSA mixer controls kselftest Add a basic test for the mixer control interface. For every control on every sound card in the system it checks that it can read and write the default value where the control supports that and for writeable controls attempts to write all valid values, restoring the default values after each test to minimise disruption for users. There are quite a few areas for improvement - currently no coverage of the generation of notifications, several of the control types don't have any coverage for the values and we don't have any testing of error handling when we attempt to write out of range values - but this provides some basic coverage. This is added as a kselftest since unlike other ALSA test programs it does not require either physical setup of the device or interactive monitoring by users and kselftest is one of the test suites that is frequently run by people doing general automated testing so should increase coverage. It is written in terms of alsa-lib since tinyalsa is not generally packaged for distributions which makes things harder for general users interested in kselftest as a whole but it will be a barrier to people with Android. Signed-off-by: Mark Brown Reviewed-by: Shuah Khan Link: https://lore.kernel.org/r/20211210185410.740009-2-broonie@kernel.org Signed-off-by: Takashi Iwai commit 808709d7675dc0707a9fd6a08077c2b29dca0d60 Author: Jason Wang Date: Sun Dec 12 15:04:22 2021 +0800 ALSA: sparc: no need to initialise statics to 0 Static variables do not need to be initialised to 0, because compiler will initialise all uninitialised statics to 0. Thus, remove the unneeded initializations. Signed-off-by: Jason Wang Link: https://lore.kernel.org/r/20211212070422.281924-1-wangborong@cdjrlc.com Signed-off-by: Takashi Iwai commit f18a499799dd0f0fdd98cf72d98d3866ce9ac60e Author: Alexei Starovoitov Date: Sat Dec 11 18:08:19 2021 -0800 bpf: Silence coverity false positive warning. Coverity issued the following warning: 6685 cands = bpf_core_add_cands(cands, main_btf, 1); 6686 if (IS_ERR(cands)) >>> CID 1510300: (RETURN_LOCAL) >>> Returning pointer "cands" which points to local variable "local_cand". 6687 return cands; It's a false positive. Add ERR_CAST() to silence it. Signed-off-by: Alexei Starovoitov commit 4674f21071b935c237217ac02cb310522d6ad95d Author: Jiapeng Chong Date: Thu Dec 9 14:21:22 2021 +0800 bpf: Use kmemdup() to replace kmalloc + memcpy Eliminate the follow coccicheck warning: ./kernel/bpf/btf.c:6537:13-20: WARNING opportunity for kmemdup. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/1639030882-92383-1-git-send-email-jiapeng.chong@linux.alibaba.com commit 84ef3f0bb72dfcdeb7ff3e5335882f6084381437 Merge: 259172bb65147 bdbee82beca45 Author: Alexei Starovoitov Date: Sat Dec 11 17:40:23 2021 -0800 Merge branch 'introduce bpf_strncmp() helper' Hou Tao says: ==================== Hi, The motivation for introducing bpf_strncmp() helper comes from two aspects: (1) clang doesn't always replace strncmp() automatically In tracing program, sometimes we need to using a home-made strncmp() to check whether or not the file name is expected. (2) the performance of home-made strncmp is not so good As shown in the benchmark in patch #4, the performance of bpf_strncmp() helper is 18% or 33% better than home-made strncmp() under x86-64 or arm64 when the compared string length is 64. When the string length grows to 4095, the performance win will be 179% or 600% under x86-64 or arm64. Any comments are welcome. Regards, Tao Change Log: v2: * rebased on bpf-next * drop patch "selftests/bpf: factor out common helpers for benchmarks" (suggested by Andrii) * remove unnecessary inline functions and add comments for programs which will be rejected by verifier in patch 4 (suggested by Andrii) * rename variables used in will-fail programs to clarify the purposes. v1: https://lore.kernel.org/bpf/20211130142215.1237217-1-houtao1@huawei.com * change API to bpf_strncmp(const char *s1, u32 s1_sz, const char *s2) * add benchmark refactor and benchmark between bpf_strncmp() and strncmp() RFC: https://lore.kernel.org/bpf/20211106132822.1396621-1-houtao1@huawei.com/ ==================== Signed-off-by: Alexei Starovoitov commit bdbee82beca4514496c52a2dc035f2a26f0c1b88 Author: Hou Tao Date: Fri Dec 10 22:16:52 2021 +0800 selftests/bpf: Add test cases for bpf_strncmp() Four test cases are added: (1) ensure the return value is expected (2) ensure no const string size is rejected (3) ensure writable target is rejected (4) ensure no null-terminated target is rejected Signed-off-by: Hou Tao Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211210141652.877186-5-houtao1@huawei.com commit 9c42652f8be3202ad11cf4fbc358688003cff21c Author: Hou Tao Date: Fri Dec 10 22:16:51 2021 +0800 selftests/bpf: Add benchmark for bpf_strncmp() helper Add benchmark to compare the performance between home-made strncmp() in bpf program and bpf_strncmp() helper. In summary, the performance win of bpf_strncmp() under x86-64 is greater than 18% when the compared string length is greater than 64, and is 179% when the length is 4095. Under arm64 the performance win is even bigger: 33% when the length is greater than 64 and 600% when the length is 4095. The following is the details: no-helper-X: use home-made strncmp() to compare X-sized string helper-Y: use bpf_strncmp() to compare Y-sized string Under x86-64: no-helper-1 3.504 ± 0.000M/s (drops 0.000 ± 0.000M/s) helper-1 3.347 ± 0.001M/s (drops 0.000 ± 0.000M/s) no-helper-8 3.357 ± 0.001M/s (drops 0.000 ± 0.000M/s) helper-8 3.307 ± 0.001M/s (drops 0.000 ± 0.000M/s) no-helper-32 3.064 ± 0.000M/s (drops 0.000 ± 0.000M/s) helper-32 3.253 ± 0.001M/s (drops 0.000 ± 0.000M/s) no-helper-64 2.563 ± 0.001M/s (drops 0.000 ± 0.000M/s) helper-64 3.040 ± 0.001M/s (drops 0.000 ± 0.000M/s) no-helper-128 1.975 ± 0.000M/s (drops 0.000 ± 0.000M/s) helper-128 2.641 ± 0.000M/s (drops 0.000 ± 0.000M/s) no-helper-512 0.759 ± 0.000M/s (drops 0.000 ± 0.000M/s) helper-512 1.574 ± 0.000M/s (drops 0.000 ± 0.000M/s) no-helper-2048 0.329 ± 0.000M/s (drops 0.000 ± 0.000M/s) helper-2048 0.602 ± 0.000M/s (drops 0.000 ± 0.000M/s) no-helper-4095 0.117 ± 0.000M/s (drops 0.000 ± 0.000M/s) helper-4095 0.327 ± 0.000M/s (drops 0.000 ± 0.000M/s) Under arm64: no-helper-1 2.806 ± 0.004M/s (drops 0.000 ± 0.000M/s) helper-1 2.819 ± 0.002M/s (drops 0.000 ± 0.000M/s) no-helper-8 2.797 ± 0.109M/s (drops 0.000 ± 0.000M/s) helper-8 2.786 ± 0.025M/s (drops 0.000 ± 0.000M/s) no-helper-32 2.399 ± 0.011M/s (drops 0.000 ± 0.000M/s) helper-32 2.703 ± 0.002M/s (drops 0.000 ± 0.000M/s) no-helper-64 2.020 ± 0.015M/s (drops 0.000 ± 0.000M/s) helper-64 2.702 ± 0.073M/s (drops 0.000 ± 0.000M/s) no-helper-128 1.604 ± 0.001M/s (drops 0.000 ± 0.000M/s) helper-128 2.516 ± 0.002M/s (drops 0.000 ± 0.000M/s) no-helper-512 0.699 ± 0.000M/s (drops 0.000 ± 0.000M/s) helper-512 2.106 ± 0.003M/s (drops 0.000 ± 0.000M/s) no-helper-2048 0.215 ± 0.000M/s (drops 0.000 ± 0.000M/s) helper-2048 1.223 ± 0.003M/s (drops 0.000 ± 0.000M/s) no-helper-4095 0.112 ± 0.000M/s (drops 0.000 ± 0.000M/s) helper-4095 0.796 ± 0.000M/s (drops 0.000 ± 0.000M/s) Signed-off-by: Hou Tao Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211210141652.877186-4-houtao1@huawei.com commit 9a93bf3fda3d03762868b1424e898395ffc71575 Author: Hou Tao Date: Fri Dec 10 22:16:50 2021 +0800 selftests/bpf: Fix checkpatch error on empty function parameter Fix checkpatch error: "ERROR: Bad function definition - void foo() should probably be void foo(void)". Most replacements are done by the following command: sed -i 's#\([a-z]\)()$#\1(void)#g' testing/selftests/bpf/benchs/*.c Signed-off-by: Hou Tao Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211210141652.877186-3-houtao1@huawei.com commit c5fb19937455095573a19ddcbff32e993ed10e35 Author: Hou Tao Date: Fri Dec 10 22:16:49 2021 +0800 bpf: Add bpf_strncmp helper The helper compares two strings: one string is a null-terminated read-only string, and another string has const max storage size but doesn't need to be null-terminated. It can be used to compare file name in tracing or LSM program. Signed-off-by: Hou Tao Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211210141652.877186-2-houtao1@huawei.com commit b4d11106d751a455154edf997891de0428f48a87 Author: Sven Peter Date: Sat Dec 11 13:40:44 2021 +0100 arm64: dts: apple: t8103: Add watchdog node Add the watchdog node which also enables reboot support on the t8103. Signed-off-by: Sven Peter Signed-off-by: Hector Martin commit cba9c615bec18792c32cc95f478884e24de9d1a5 Author: Hector Martin Date: Thu Dec 9 14:10:01 2021 +0900 dt-bindings: pinctrl: apple,pinctrl: Add apple,t6000-pinctrl compatible This new SoC uses the same pinctrl hardware, so just add a new per-SoC compatible. Reviewed-by: Mark Kettenis Acked-by: Rob Herring Signed-off-by: Hector Martin commit 42c2366a9cbedc32921f0e53e14b7bef1d536514 Author: Hector Martin Date: Thu Dec 9 14:10:00 2021 +0900 dt-bindings: pci: apple,pcie: Add t6000 support This new SoC is compatible with the existing driver, but the block supports 4 downstream ports, so we need to adjust the binding to allow that. Reviewed-by: Mark Kettenis Acked-by: Rob Herring Signed-off-by: Hector Martin commit b66652c7517c80873258a00cccf56a2d133a5efe Author: Hector Martin Date: Thu Dec 9 14:09:59 2021 +0900 dt-bindings: i2c: apple,i2c: Add apple,t6000-i2c compatible This block is compatible with t8103, so just add the new per-SoC compatible under apple,i2c. Reviewed-by: Mark Kettenis Reviewed-by: Sven Peter Acked-by: Rob Herring Signed-off-by: Hector Martin commit e15b8c8563983c134869890d7a88aada33c52885 Author: Hector Martin Date: Thu Dec 9 14:09:58 2021 +0900 dt-bindings: arm: apple: Add t6000/t6001 MacBook Pro 14/16" compatibles This adds the initial apple,t6000 platforms: - apple,j314s - MacBook Pro (14-inch, M1 Pro, 2021) - apple,j316s - MacBook Pro (16-inch, M1 Pro, 2021) And the initial apple,t6001 platforms: - apple,j314c - MacBook Pro (14-inch, M1 Max, 2021) - apple,j316c - MacBook Pro (16-inch, M1 Max, 2021) Reviewed-by: Mark Kettenis Acked-by: Rob Herring Signed-off-by: Hector Martin commit cc1fe1e54ba565aaec0006796db65b7c3b1ccd69 Author: Hector Martin Date: Thu Dec 9 13:45:00 2021 +0900 soc: apple: apple-pmgr-pwrstate: Add auto-PM min level support This is seemingly required for DCP/DCPEXT, without which they refuse to boot properly. They need to be set to minimum state 4 (clock gated). Reviewed-by: Sven Peter Signed-off-by: Hector Martin commit 34e5719e1c6bcdc585731cbe6af11497aafaa1a6 Author: Hector Martin Date: Thu Dec 9 13:45:01 2021 +0900 arm64: dts: apple: t8103: Add apple,min-state to DCP PMGR nodes This is required for DCP to boot successfully; it seems if power gating is allowed, they do not wake up properly. Reviewed-by: Sven Peter Signed-off-by: Hector Martin commit d824dade33bfe464a5304f1772de8735a46eec7c Author: Hector Martin Date: Thu Dec 9 13:44:59 2021 +0900 dt-bindings: power: apple,pmgr-pwrstate: Add apple,min-state prop A few devices (DCP/DCPEXT) need to have the minimum power state for auto-PM configured. Add a property that allows the DT to specify this value. Reviewed-by: Rob Herring Signed-off-by: Hector Martin commit 259172bb6514758ce3be1610c500b51a9f44212a Author: Alexei Starovoitov Date: Sat Dec 11 17:16:19 2021 -0800 libbpf: Fix gen_loader assumption on number of programs. libbpf's obj->nr_programs includes static and global functions. That number could be higher than the actual number of bpf programs going be loaded by gen_loader. Passing larger nr_programs to bpf_gen__init() doesn't hurt. Those exra stack slots will stay as zero. bpf_gen__finish() needs to check that actual number of progs that gen_loader saw is less than or equal to obj->nr_programs. Fixes: ba05fd36b851 ("libbpf: Perform map fd cleanup for gen_loader in case of error") Signed-off-by: Alexei Starovoitov commit 0f09c274698590d508c43f924d9dffc7130b782d Author: Arnd Bergmann Date: Fri Dec 3 09:07:56 2021 +0100 futex: Fix additional regressions Naresh reported another architecture that was broken by the same typo that was already fixed for three architectures: mips also refers to the futex_atomic_op_inuser_local() function by the wrong name and runs into a missing closing '}' as well. Going through the source tree the same typo was found in the documentation as well as in the xtensa code, both of which ended up escaping the regression testing so far. In the case of xtensa, it appears that the broken code path is only used when building for platforms that are not supported by the default gcc configuration, so they are impossible to test for with default setups. After going through these more carefully and fixing up the typos, all architectures have been build-tested again to ensure that this is now complete. Fixes: 4e0d84634445 ("futex: Fix sparc32/m68k/nds32 build regression") Fixes: 3f2bedabb62c ("futex: Ensure futex_atomic_cmpxchg_inatomic() is present") Reported-by: Linux Kernel Functional Testing Reported-by: Naresh Kamboju Signed-off-by: Arnd Bergmann Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20211203080823.2938839-1-arnd@kernel.org commit 4121485d271bd730537f613ce041e7ea659606a7 Author: Andy Shevchenko Date: Thu Dec 9 21:52:31 2021 +0200 PCI: Sort Intel Device IDs by value Sort Intel Device IDs by value. [bhelgaas: lower-case Intel section since we're touching it anyway] Link: https://lore.kernel.org/r/20211209195231.2785-1-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Signed-off-by: Bjorn Helgaas Reviewed-by: Krzysztof Wilczyński commit 2768c1e7f9d7b82f9e129efe3677c783bc77b8f9 Author: Steven Rostedt (VMware) Date: Fri Dec 10 20:26:16 2021 -0500 tracing: Use trace_iterator_reset() in tracing_read_pipe() Currently tracing_read_pipe() open codes trace_iterator_reset(). Just have it use trace_iterator_reset() instead. Link: https://lkml.kernel.org/r/20211210202616.64d432d2@gandalf.local.home Signed-off-by: Steven Rostedt (VMware) commit dba879672258699223b0ce61f9e5c079b0476d92 Author: Xiu Jianfeng Date: Fri Dec 10 09:22:45 2021 +0800 tracing: Use memset_startat helper in trace_iterator_reset() Make use of memset_startat helper to simplify the code, there should be no functional change as a result of this patch. Link: https://lkml.kernel.org/r/20211210012245.207489-1-xiujianfeng@huawei.com Signed-off-by: Xiu Jianfeng Signed-off-by: Steven Rostedt (VMware) commit 4f67cca70c0f615e9cfe6ac42244f3416ec60877 Author: Beau Belgrave Date: Thu Sep 30 15:38:21 2021 -0700 tracing: Do not let synth_events block other dyn_event systems during create synth_events is returning -EINVAL if the dyn_event create command does not contain ' \t'. This prevents other systems from getting called back. synth_events needs to return -ECANCELED in these cases when the command is not targeting the synth_event system. Link: https://lore.kernel.org/linux-trace-devel/20210930223821.11025-1-beaub@linux.microsoft.com Fixes: c9e759b1e8456 ("tracing: Rework synthetic event command parsing") Reviewed-by: Masami Hiramatsu Signed-off-by: Beau Belgrave Signed-off-by: Steven Rostedt (VMware) commit e161c6bf3955d737f755f8eaa3b92de4bc6bd0e7 Author: Jiri Olsa Date: Thu Nov 25 21:28:52 2021 +0100 tracing: Iterate trace_[ku]probe objects directly As suggested by Linus [1] using list_for_each_entry to iterate directly trace_[ku]probe objects so we can skip another call to container_of in these loops. [1] https://lore.kernel.org/r/CAHk-=wjakjw6-rDzDDBsuMoDCqd+9ogifR_EE1F0K-jYek1CdA@mail.gmail.com Link: https://lkml.kernel.org/r/20211125202852.406405-1-jolsa@kernel.org Suggested-by: Linus Torvalds Signed-off-by: Jiri Olsa Acked-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit ee34c52c7115b60a7c96b2034dd1737765dd5493 Author: Steven Rostedt (VMware) Date: Wed Dec 8 10:27:31 2021 -0500 tracefs: Use d_inode() helper function to get the dentry inode Instead of referencing the inode from a dentry via dentry->d_inode, use the helper function d_inode(dentry) instead. This is the considered the correct way to access it. Reported-by: Christian Brauner Reported: https://lore.kernel.org/all/20211208104454.nhxyvmmn6d2qhpwl@wittgenstein/ Signed-off-by: Steven Rostedt (VMware) commit c8a7ff13f5fc6e6b313de2a8e02304c2a90a3906 Author: Yinan Liu Date: Tue Dec 7 23:13:47 2021 +0800 script/sorttable: Code style improvements Modified the code style issue of if() {}, keep the code style consistent. Link: https://lkml.kernel.org/r/20211207151348.54921-3-yinan@linux.alibaba.com Signed-off-by: Yinan Liu Signed-off-by: Steven Rostedt (VMware) commit e06a61a89ccd3edda046c78f9d08aa045b8c4d32 Author: Masahiro Yamada Date: Fri Nov 5 12:59:58 2021 +0900 certs: use if_changed to re-generate the key when the key type is changed If the key type of the existing signing key does not match to CONFIG_MODULE_SIG_KEY_TYPE_*, the Makefile removes it so that it is re-generated. Use if_changed so that the key is re-generated when the key type is changed (that is, the openssl command line is changed). Signed-off-by: Masahiro Yamada commit 54c8b517d2955ada78ba553f4b6682483895f32a Author: Masahiro Yamada Date: Fri Nov 5 12:59:57 2021 +0900 certs: use 'cmd' to hide openssl output in silent builds more simply Commit 5d06ee20b662 ("modsign: hide openssl output in silent builds") silenced the key generation log from openssl in silent builds. Since commit 174a1dcc9642 ("kbuild: sink stdout from cmd for silent build"), the 'cmd' macro can handle it in a cleaner way. Signed-off-by: Masahiro Yamada commit f8487d28df281102a1b47d614ddebbaaeecefdeb Author: Masahiro Yamada Date: Fri Nov 5 12:59:56 2021 +0900 certs: remove noisy messages while generating the signing key When you run Kbuild with the parallel option -j, the messages from this rule and others are interleaved, like follows: ### CC arch/x86/mm/pat/set_memory.o ### Now generating an X.509 key pair to be used for signing modules. ### ### If this takes a long time, you might wish to run rngd in the ### background to keep the supply of entropy topped up. It CC arch/x86/events/intel/bts.o HDRTEST usr/include/linux/qnx4_fs.h CC arch/x86/events/zhaoxin/core.o ### needs to be run as root, and uses a hardware random ### number generator if one is available. AR init/built-in.a ### On modern machines, it does not take a long time to generate the key. Remove the ugly log messages. Signed-off-by: Masahiro Yamada commit f3a2ba44e93e2c192a872f2705fe66dbf39708d6 Author: Masahiro Yamada Date: Fri Nov 5 12:59:55 2021 +0900 certs: check-in the default x509 config file When x509.genkey is created, it prints a log: Generating X.509 key generation config ..., which is not the ordinary Kbuild log style. Check-in the default config as certs/default_x509.genkey to make it readable, and copy it to certs/x509.genkey if it is not present. The log is shown in the Kbuild style. COPY certs/x509.genkey Signed-off-by: Masahiro Yamada commit 54e2c77dd4cbf9bab5aa4ac8cf821005aaeb50fe Author: Masahiro Yamada Date: Fri Nov 5 12:59:54 2021 +0900 certs: remove meaningless $(error ...) in certs/Makefile CONFIG_MODULE_SIG_HASH is defined by init/Kconfig. This $(error ...) is never reachable. (If it is, you need to fix the bug.) Signed-off-by: Masahiro Yamada commit b06d9d3b6a0358d1b8cec5243c14fcc6a997529f Author: Masahiro Yamada Date: Wed Oct 13 02:10:11 2021 +0000 nds32: remove unused BUILTIN_DTB from arch/nds32/Makefile This is not used or exported. BUILTIN_DTB is locally defined and used in arch/nds32/boot/dts/Makefile. Signed-off-by: Masahiro Yamada commit be0d5fa7f0373197a44ebeb3f9e833ee50376225 Author: Masahiro Yamada Date: Fri Oct 1 13:01:26 2021 +0900 certs: move the 'depends on' to the choice of module signing keys When the condition "MODULE_SIG || (IMA_APPRAISE_MODSIG && MODULES)" is unmet, you cannot choose anything in the choice, but the choice menu is still displayed in the menuconfig etc. Move the 'depends on' to the choice to hide the meaningless menu. Also delete the redundant 'default'. In a choice, the first entry is the default. Signed-off-by: Masahiro Yamada commit ea1847c09c34234c2980b99b6bb732a55447c33f Author: Nicolas Frattaroli Date: Sat Nov 27 15:19:09 2021 +0100 arm64: dts: rockchip: Add spi1 pins on Quartz64 A The Quartz64 Model A has the SPI pins broken out on its pin header. The actual pins being used though are not the m0 variant, but the m1 variant, which also lacks the cs1 pin. This commit overrides pinctrl-0 accordingly for this board. spi1 is intentionally left disabled, as anyone wishing to add SPI devices needs to edit the dts anyway, and the pins are more useful as GPIOs for the rest of the users. Signed-off-by: Nicolas Frattaroli Link: https://lore.kernel.org/r/20211127141910.12649-4-frattaroli.nicolas@gmail.com Signed-off-by: Heiko Stuebner commit aaa552d84580e9213d0e2bf0f9243477d1227bdd Author: Nicolas Frattaroli Date: Sat Nov 27 15:19:08 2021 +0100 arm64: dts: rockchip: Add spi nodes on rk356x This adds the four spi nodes (spi0, spi1, spi2, spi3) to the rk356x dtsi. These are from the downstream device tree, though I have double-checked that their interrupts and DMA numbers are correct. I have also tested spi1 with an SPI device. Signed-off-by: Nicolas Frattaroli Link: https://lore.kernel.org/r/20211127141910.12649-3-frattaroli.nicolas@gmail.com Signed-off-by: Heiko Stuebner commit b011a57e41ccbd402ecdcb53514ba76b898ec22e Author: Jason Wang Date: Sat Dec 11 17:19:14 2021 +0800 RAS/CEC: Remove a repeated 'an' in a comment The double `an' in the comment in line 41 is repeated. Remove one of them. Signed-off-by: Jason Wang Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20211211091914.268823-1-wangborong@cdjrlc.com commit 2e4dbcf7177e5dd1f7cb53c59cb2f394e35fd7ba Author: Sascha Hauer Date: Wed Dec 8 13:03:12 2021 +0100 arm64: dts: rockchip: Change pwm pinctrl-name to "default" on rk356x The pinctrl state "active" is neither documented nor used by the PWM driver. Rename it to "default" Signed-off-by: Sascha Hauer Link: https://lore.kernel.org/r/20211208120312.3300390-1-s.hauer@pengutronix.de Signed-off-by: Heiko Stuebner commit 82762d2af31a60081162890983a83499c9c7dd74 Author: Dietmar Eggemann Date: Thu Nov 18 17:42:40 2021 +0100 sched/fair: Replace CFS internal cpu_util() with cpu_util_cfs() cpu_util_cfs() was created by commit d4edd662ac16 ("sched/cpufreq: Use the DEADLINE utilization signal") to enable the access to CPU utilization from the Schedutil CPUfreq governor. Commit a07630b8b2c1 ("sched/cpufreq/schedutil: Use util_est for OPP selection") added util_est support later. The only thing cpu_util() is doing on top of what cpu_util_cfs() already does is to clamp the return value to the [0..capacity_orig] capacity range of the CPU. Integrating this into cpu_util_cfs() is not harming the existing users (Schedutil and CPUfreq cooling (latter via sched_cpu_util() wrapper)). For straightforwardness, prefer to keep using `int cpu` as the function parameter over using `struct rq *rq` which might avoid some calls to cpu_rq(cpu) -> per_cpu(runqueues, cpu) -> RELOC_HIDE(). Update cfs_util()'s documentation and reuse it for cpu_util_cfs(). Remove cpu_util(). Signed-off-by: Dietmar Eggemann Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Vincent Guittot Link: https://lore.kernel.org/r/20211118164240.623551-1-dietmar.eggemann@arm.com commit 82a8954acd93ae95d6252fb93a3d210c8f71b093 Author: Peter Zijlstra Date: Wed Nov 10 11:01:25 2021 +0100 objtool: Remove .fixup handling The .fixup has gone the way of the Dodo, that test will always be false. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20211110101326.261496792@infradead.org commit e5eefda5aa51f3178821b58806e1dddd798c0934 Author: Peter Zijlstra Date: Wed Nov 10 11:01:24 2021 +0100 x86: Remove .fixup section No moar users, kill it dead. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20211110101326.201590122@infradead.org commit b7760780257354bb14de62abed868405b844fa13 Author: Peter Zijlstra Date: Wed Nov 10 11:01:23 2021 +0100 x86/word-at-a-time: Remove .fixup usage Rewrite load_unaligned_zeropad() to not require .fixup text. This is easiest done using asm-goto-output, where we can stick a C label in the exception table entry. The fallback version isn't nearly so nice but should work. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20211110101326.141775772@infradead.org commit d5d797dcbd781cb7c526ad32f31c7fd96babfdb2 Author: Peter Zijlstra Date: Wed Nov 10 11:01:22 2021 +0100 x86/usercopy: Remove .fixup usage Typically usercopy does whole word copies followed by a number of byte copies to finish the tail. This means that on exception it needs to compute the remaining length as: words*sizeof(long) + bytes. Create a new extable handler to do just this. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20211110101326.081701085@infradead.org commit 13e4bf1bddcb65dd028aaa492789e8d61efaafa1 Author: Peter Zijlstra Date: Wed Nov 10 11:01:21 2021 +0100 x86/usercopy_32: Simplify __copy_user_intel_nocache() Have an exception jump to a .fixup to only immediately jump out is daft, jump to the right place in one go. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20211110101326.021517780@infradead.org commit 5ce8e39f55521c762f0e6d1bba9597284b1f2e69 Author: Peter Zijlstra Date: Wed Nov 10 11:01:20 2021 +0100 x86/sgx: Remove .fixup usage Create EX_TYPE_FAULT_SGX which does as EX_TYPE_FAULT does, except adds this extra bit that SGX really fancies having. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20211110101325.961246679@infradead.org commit fedb24cda1ca5407e1965b261e349ea85d6c03dc Author: Peter Zijlstra Date: Wed Nov 10 11:01:19 2021 +0100 x86/checksum_32: Remove .fixup usage Simply add EX_FLAG_CLEAR_AX to do as the .fixup used to do. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20211110101325.899657959@infradead.org commit 3e8ea7803a1dedf19120a2fef12c590e90e4b469 Author: Peter Zijlstra Date: Wed Nov 10 11:01:17 2021 +0100 x86/vmx: Remove .fixup usage In the vmread exceptin path, use the, thus far, unused output register to push the @fault argument onto the stack. This, in turn, enables the exception handler to not do pushes and only modify that register when an exception does occur. As noted by Sean the input constraint needs to be changed to "=&r" to avoid the value and field occupying the same register. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Paolo Bonzini Reviewed-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20211110101325.781308550@infradead.org commit c9a34c3f4ece192f6d804039fe6aac9618f0d236 Author: Peter Zijlstra Date: Wed Nov 10 11:01:16 2021 +0100 x86/kvm: Remove .fixup usage KVM instruction emulation has a gnarly hack where the .fixup does a return, however there's already a ret right after the 10b label, so mark that as 11 and have the exception clear %esi to remove the .fixup. Suggested-by: Paolo Bonzini Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20211110101325.722157053@infradead.org commit 5fc77b916cb82fe476ae2344e0ec37445227a4f8 Author: Peter Zijlstra Date: Wed Nov 10 11:01:15 2021 +0100 x86/segment: Remove .fixup usage Create and use EX_TYPE_ZERO_REG to clear the register and retry the segment load on exception. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20211110101325.663529463@infradead.org commit 1c3b9091d084d92c70a4260553853509637276b9 Author: Peter Zijlstra Date: Wed Nov 10 11:01:14 2021 +0100 x86/fpu: Remove .fixup usage Employ EX_TYPE_EFAULT_REG to store '-EFAULT' into the %[err] register on exception. All the callers only ever test for 0, so the change from -1 to -EFAULT is immaterial. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20211110101325.604494664@infradead.org commit e2b48e43284c0916ebf8e4240199b9d9747e337a Author: Peter Zijlstra Date: Wed Nov 10 11:01:13 2021 +0100 x86/xen: Remove .fixup usage Employ the fancy new EX_TYPE_IMM_REG to store -EFAULT in the return register and use this to remove some Xen .fixup usage. All callers of these functions only test for 0 return, so the actual return value change from -1 to -EFAULT is immaterial. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Juergen Gross Reviewed-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20211110101325.545019822@infradead.org commit 99641e094d6ccf547b3eba833aea9a34fdf5681e Author: Peter Zijlstra Date: Wed Nov 10 11:01:12 2021 +0100 x86/uaccess: Remove .fixup usage For the !CC_AS_ASM_GOTO_OUTPUT (aka. the legacy codepath), remove the .fixup usage by employing both EX_TYPE_EFAULT_REG and EX_FLAG_CLEAR. Like was already done for X86_32's version of __get_user_asm_u64() use the "a" register for output, specifically so we can use CLEAR_AX. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20211110101325.485154848@infradead.org commit 4c132d1d844a53fc4e4b5c34e36ef10d6124b783 Author: Peter Zijlstra Date: Wed Nov 10 11:01:11 2021 +0100 x86/futex: Remove .fixup usage Use the new EX_TYPE_IMM_REG to store -EFAULT into the designated 'ret' register, this removes the need for anonymous .fixup code. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20211110101325.426016322@infradead.org commit d52a7344bdfa9c3442d3f86fb3501d9343726c76 Author: Peter Zijlstra Date: Wed Nov 10 11:01:10 2021 +0100 x86/msr: Remove .fixup usage Rework the MSR accessors to remove .fixup usage. Add two new extable types (to the 4 already existing msr ones) using the new register infrastructure to record which register should get the error value. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20211110101325.364084212@infradead.org commit 4b5305decc8436bfe363d1c1773e8fa1c828b14d Author: Peter Zijlstra Date: Wed Nov 10 11:01:09 2021 +0100 x86/extable: Extend extable functionality In order to remove further .fixup usage, extend the extable infrastructure to take additional information from the extable entry sites. Specifically add _ASM_EXTABLE_TYPE_REG() and EX_TYPE_IMM_REG that extend the existing _ASM_EXTABLE_TYPE() by taking an additional register argument and encoding that and an s16 immediate into the existing s32 type field. This limits the actual types to the first byte, 255 seem plenty. Also add a few flags into the type word, specifically CLEAR_AX and CLEAR_DX which clear the return and extended return register. Notes: - due to the % in our register names it's hard to make it more generally usable as arm64 did. - the s16 is far larger than used in these patches, future extentions can easily shrink this to get more bits. - without the bitfield fix this will not compile, because: 0xFF > -1 and we can't even extract the TYPE field. [nathanchance: Build fix for clang-lto builds: https://lkml.kernel.org/r/20211210234953.3420108-1-nathan@kernel.org ] Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Josh Poimboeuf Reviewed-by: Nick Desaulniers Tested-by: Nick Desaulniers Link: https://lore.kernel.org/r/20211110101325.303890153@infradead.org commit aa93e2ad7464ffb90155a5ffdde963816f86d5dc Author: Peter Zijlstra Date: Wed Nov 10 11:01:08 2021 +0100 x86/entry_32: Remove .fixup usage Where possible, push the .fixup into code, at the tail of functions. This is hard for macros since they're used in multiple functions, therefore introduce a new extable handler to pop zeros. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20211110101325.245184699@infradead.org commit 16e617d05ef0c521d000c989796412ce713f28c9 Author: Peter Zijlstra Date: Wed Nov 10 11:01:07 2021 +0100 x86/entry_64: Remove .fixup usage Place the anonymous .fixup code at the tail of the regular functions. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Josh Poimboeuf Reviewed-by: Borislav Petkov Reviewed-by: Lai Jiangshan Link: https://lore.kernel.org/r/20211110101325.186049322@infradead.org commit ab0fedcc714aafaac6ac996b51791aee0d1cd8fd Author: Peter Zijlstra Date: Wed Nov 10 11:01:06 2021 +0100 x86/copy_mc_64: Remove .fixup usage Place the anonymous .fixup code at the tail of the regular functions. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Josh Poimboeuf Reviewed-by: Borislav Petkov Link: https://lore.kernel.org/r/20211110101325.127055887@infradead.org commit acba44d2436d463f60a54bf934d378dcf384a965 Author: Peter Zijlstra Date: Wed Nov 10 11:01:05 2021 +0100 x86/copy_user_64: Remove .fixup usage Place the anonymous .fixup code at the tail of the regular functions. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Josh Poimboeuf Reviewed-by: Borislav Petkov Link: https://lore.kernel.org/r/20211110101325.068505810@infradead.org commit c6dbd3e5e69cf3ca47a3864115d4cbdd44619243 Author: Peter Zijlstra Date: Mon Nov 15 17:46:39 2021 +0100 x86/mmx_32: Remove X86_USE_3DNOW This code puts an exception table entry on the PREFETCH instruction to overwrite it with a JMP.d8 when it triggers an exception. Except of course, our code is no longer writable, also SMP. Instead of fixing this broken mess, simply take it out. Signed-off-by: Peter Zijlstra (Intel) Acked-by: Borislav Petkov Link: https://lkml.kernel.org/r/YZKQzUmeNuwyvZpk@hirez.programming.kicks-ass.net commit bff8c3848e071d387d8b0784dc91fa49cd563774 Author: Peter Zijlstra Date: Wed Nov 10 11:01:03 2021 +0100 bitfield.h: Fix "type of reg too small for mask" test The test: 'mask > (typeof(_reg))~0ull' only works correctly when both sides are unsigned, consider: - 0xff000000 vs (int)~0ull - 0x000000ff vs (int)~0ull Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Josh Poimboeuf Link: https://lore.kernel.org/r/20211110101324.950210584@infradead.org commit 3f9dd4c802b96626e869b2d29c8e401dabadd23e Author: Weili Qian Date: Sat Dec 4 18:43:01 2021 +0800 crypto: hisilicon/qm - fix incorrect return value of hisi_qm_resume() When hisi_qm_resume() returns 0, it indicates that the device has started successfully. If the device fails to start, hisi_qm_resume() needs to return the actual error code to the caller instead of 0. Fixes: d7ea53395b72 ("crypto: hisilicon - add runtime PM ops") Signed-off-by: Weili Qian Signed-off-by: Herbert Xu commit fed8f4d5f9469a4b59e501bf9b6dcab484c40047 Author: Srujana Challa Date: Wed Dec 1 14:32:01 2021 +0530 crypto: octeontx2 - parameters for custom engine groups Added devlink parameters to create and delete custom CPT engine groups. Example: devlink dev param set pci/0002:20:00.0 name egrp_create value \ "se:32;se.out" cmode runtime devlink dev param set pci/0002:20:00.0 name egrp_delete value \ "egrp:1" cmode runtime Signed-off-by: Srujana Challa Signed-off-by: Shijith Thotton Signed-off-by: Herbert Xu commit d9d7749773e8895aaedc11f1d2885a9eee5c73ac Author: Srujana Challa Date: Wed Dec 1 14:32:00 2021 +0530 crypto: octeontx2 - add apis for custom engine groups Octeon TX2 CPT has three type of engines to handle symmetric, asymmetric and ipsec specific workload. For better utilization, these engines can be grouped to custom groups at runtime. This patch adds APIs to create and delete custom CPT engine groups. Signed-off-by: Srujana Challa Signed-off-by: Shijith Thotton Signed-off-by: Herbert Xu commit 3d6b661330a7954d8136df98160d525eb04dcd6a Author: Herbert Xu Date: Wed Dec 1 17:30:41 2021 +1100 crypto: stm32 - Revert broken pm_runtime_resume_and_get changes We should not call pm_runtime_resume_and_get where the reference count is expected to be incremented unconditionally. This patch reverts these calls to the original unconditional get_sync call. Reported-by: Heiner Kallweit Fixes: 747bf30fd944 ("crypto: stm32/cryp - Fix PM reference leak...") Fixes: 1cb3ad701970 ("crypto: stm32/hash - Fix PM reference leak...") Signed-off-by: Herbert Xu Acked-by: Rafael J. Wysocki Signed-off-by: Herbert Xu commit 710ce4b88f9a93a6b2c2267e8f27ba65af3cb6ac Author: Nicolai Stange Date: Tue Nov 30 15:10:09 2021 +0100 crypto: jitter - quit sample collection loop upon RCT failure The jitterentropy collection loop in jent_gen_entropy() can in principle run indefinitely without making any progress if it only receives stuck measurements as determined by jent_stuck(). After 31 consecutive stuck samples, the Repetition Count Test (RCT) would fail anyway and the jitterentropy RNG instances moved into ->health_failure == 1 state. jent_gen_entropy()'s caller, jent_read_entropy() would then check for this ->health_failure condition and return an error if found set. It follows that there's absolutely no point in continuing the collection loop in jent_gen_entropy() once the RCT has failed. Make the jitterentropy collection loop more robust by terminating it upon jent_health_failure() so that it won't continue to run indefinitely without making any progress. Signed-off-by: Nicolai Stange Reviewed-by: Stephan Mueller Signed-off-by: Herbert Xu commit b454fb702515276041b701a4eda468b6cd6b384d Author: Nicolai Stange Date: Tue Nov 30 15:10:08 2021 +0100 crypto: jitter - don't limit ->health_failure check to FIPS mode The jitterentropy's Repetition Count Test (RCT) as well as the Adaptive Proportion Test (APT) are run unconditionally on any collected samples. However, their result, i.e. ->health_failure, will only get checked if fips_enabled is set, c.f. the jent_health_failure() wrapper. I would argue that a RCT or APT failure indicates that something's seriously off and that this should always be reported as an error, independently of whether FIPS mode is enabled or not: it should be up to callers whether or not and how to handle jitterentropy failures. Make jent_health_failure() to unconditionally return ->health_failure, independent of whether fips_enabled is set. Note that fips_enabled isn't accessed from the jitterentropy code anymore now. Remove the linux/fips.h include as well as the jent_fips_enabled() wrapper. Signed-off-by: Nicolai Stange Reviewed-by: Stephan Mueller Signed-off-by: Herbert Xu commit 8f7977284331d0b0f210efa98a5d3fdcb2a65dd3 Author: Nicolai Stange Date: Tue Nov 30 15:10:07 2021 +0100 crypto: drbg - ignore jitterentropy errors if not in FIPS mode A subsequent patch will make the jitterentropy RNG to unconditionally report health test errors back to callers, independent of whether fips_enabled is set or not. The DRBG needs access to a functional jitterentropy instance only in FIPS mode (because it's the only SP800-90B compliant entropy source as it currently stands). Thus, it is perfectly fine for the DRBGs to obtain entropy from the jitterentropy source only on a best effort basis if fips_enabled is off. Make the DRBGs to ignore jitterentropy failures if fips_enabled is not set. Signed-off-by: Nicolai Stange Reviewed-by: Stephan Mueller Signed-off-by: Herbert Xu commit 95fe2253cc1ad65d7f140d1944fa1b5d3c67abc0 Author: Nicolas Toromanoff Date: Tue Nov 30 08:55:01 2021 +0100 crypto: stm32/cryp - reorder hw initialization The CRYP IP checks the written key depending of the configuration, it's safer to write the whole configuration to hardware then the key to avoid unexpected key rejection. Signed-off-by: Nicolas Toromanoff Signed-off-by: Herbert Xu commit 4b898d5cfa4d9a0ad5bc82cb5eafdc092394c6a9 Author: Nicolas Toromanoff Date: Tue Nov 30 08:55:00 2021 +0100 crypto: stm32/cryp - fix bugs and crash in tests Extra crypto manager auto test were crashing or failling due to 2 reasons: - block in a dead loop (dues to issues in cipher end process management) - crash due to read/write unmapped memory (this crash was also reported when using openssl afalg engine) Rework interrupt management, interrupts are masked as soon as they are no more used: if input buffer is fully consumed, "Input FIFO not full" interrupt is masked and if output buffer is full, "Output FIFO not empty" interrupt is masked. And crypto request finish when input *and* outpout buffer are fully read/write. About the crash due to unmapped memory, using scatterwalk_copychunks() that will map and copy each block fix the issue. Using this api and copying full block will also fix unaligned data access, avoid early copy of in/out buffer, and make useless the extra alignment constraint. Fixes: 9e054ec21ef8 ("crypto: stm32 - Support for STM32 CRYP crypto module") Reported-by: Marek Vasut Signed-off-by: Nicolas Toromanoff Signed-off-by: Herbert Xu commit fa97dc2d48b476ea98199d808d3248d285987e99 Author: Nicolas Toromanoff Date: Tue Nov 30 08:54:59 2021 +0100 crypto: stm32/cryp - fix lrw chaining mode This fixes the lrw autotest if lrw uses the CRYP as the AES block cipher provider (as ecb(aes)). At end of request, CRYP should not update the IV in case of ECB chaining mode. Indeed the ECB chaining mode never uses the IV, but the software LRW chaining mode uses the IV field as a counter and due to the (unexpected) update done by CRYP while the AES block process, the counter get a wrong value when the IV overflow. Fixes: 5f49f18d27cd ("crypto: stm32/cryp - update to return iv_out") Signed-off-by: Nicolas Toromanoff Signed-off-by: Herbert Xu commit 6c12e742785bf9333faf60bfb96575bdd763448e Author: Nicolas Toromanoff Date: Tue Nov 30 08:54:58 2021 +0100 crypto: stm32/cryp - fix double pm exit Delete extraneous lines in probe error handling code: pm was disabled twice. Fixes: 65f9aa36ee47 ("crypto: stm32/cryp - Add power management support") Reported-by: Marek Vasut Signed-off-by: Nicolas Toromanoff Signed-off-by: Herbert Xu commit 39e6e699c7fb92bdb2617b596ca4a4ea35c5d2a7 Author: Nicolas Toromanoff Date: Tue Nov 30 08:54:57 2021 +0100 crypto: stm32/cryp - check early input data Some auto tests failed because driver wasn't returning the expected error with some input size/iv value/tag size. Now: Return 0 early for empty buffer. (We don't need to start the engine for an empty input buffer). Accept any valid authsize for gcm(aes). Return -EINVAL if iv for ccm(aes) is invalid. Return -EINVAL if buffer size is a not a multiple of algorithm block size. Fixes: 9e054ec21ef8 ("crypto: stm32 - Support for STM32 CRYP crypto module") Signed-off-by: Nicolas Toromanoff Signed-off-by: Herbert Xu commit d703c7a994ee34b7fa89baf21631fca0aa9f17fc Author: Nicolas Toromanoff Date: Tue Nov 30 08:54:56 2021 +0100 crypto: stm32/cryp - fix xts and race condition in crypto_engine requests Don't erase key: If key is erased before the crypto_finalize_.*_request() call, some pending process will run with a key={ 0 }. Moreover if the key is reset at end of request, it breaks xts chaining mode, as for last xts block (in case input len is not a multiple of block) a new AES request is started without calling again set_key(). Fixes: 9e054ec21ef8 ("crypto: stm32 - Support for STM32 CRYP crypto module") Signed-off-by: Nicolas Toromanoff Signed-off-by: Herbert Xu commit 41c76690b0990efacd15d35cfb4e77318cd80ebb Author: Nicolas Toromanoff Date: Tue Nov 30 08:54:55 2021 +0100 crypto: stm32/cryp - fix CTR counter carry STM32 CRYP hardware doesn't manage CTR counter bigger than max U32, as a workaround, at each block the current IV is saved, if the saved IV lower u32 is 0xFFFFFFFF, the full IV is manually incremented, and set in hardware. Fixes: bbb2832620ac ("crypto: stm32 - Fix sparse warnings") Signed-off-by: Nicolas Toromanoff Signed-off-by: Herbert Xu commit 029812aee3a120c9ca3cd891e5ef159ec3c6c547 Author: Etienne Carriere Date: Tue Nov 30 08:54:54 2021 +0100 crypto: stm32/cryp - don't print error on probe deferral Change driver to not print an error message when the device probe is deferred for a clock resource. Signed-off-by: Etienne Carriere Signed-off-by: Nicolas Toromanoff Signed-off-by: Herbert Xu commit 0a2f9f57c6ba4730f02df532e03316535a96fef8 Author: Etienne Carriere Date: Tue Nov 30 08:54:53 2021 +0100 crypto: stm32/cryp - defer probe for reset controller Change stm32 CRYP driver to defer its probe operation when reset controller device is registered but has not been probed yet. Signed-off-by: Etienne Carriere Signed-off-by: Nicolas Toromanoff Signed-off-by: Herbert Xu commit 3219c2b1bd4c4ed19f35bd83e3059c94077616e4 Author: Guo Zhengkui Date: Mon Nov 29 16:34:56 2021 +0800 crypto: dh - remove duplicate includes Remove a duplicate #include . Signed-off-by: Guo Zhengkui Signed-off-by: Herbert Xu commit 77ab714f00703c91d5a6e15d7445775c80358774 Merge: 1868d997cf9cf 753a026cfec14 Author: Jakub Kicinski Date: Fri Dec 10 20:56:59 2021 -0800 Merge branch 'add-fdma-support-on-ocelot-switch-driver' Clément Léger says: ==================== Add FDMA support on ocelot switch driver This series adds support for the Frame DMA present on the VSC7514 switch. The FDMA is able to extract and inject packets on the various ethernet interfaces present on the switch. ==================== Link: https://lore.kernel.org/r/20211209154911.3152830-1-clement.leger@bootlin.com Signed-off-by: Jakub Kicinski commit 753a026cfec1429c9e32e004ae4d4c2727cc0111 Author: Clément Léger Date: Thu Dec 9 16:49:11 2021 +0100 net: ocelot: add FDMA support 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 is shared between all the ethernet ports of the switch and uses a linked list of descriptors (DCB) to inject and extract packets. Before adding descriptors, the FDMA channels must be stopped. It would be inefficient to do that each time a descriptor would be added so the channels are restarted only once they stopped. Both channels uses ring-like structure to feed the DCBs to the FDMA. head and tail are never touched by hardware and are completely handled by the driver. On top of that, page recycling has been added and is mostly taken from gianfar driver. Reviewed-by: Vladimir Oltean Co-developed-by: Alexandre Belloni Signed-off-by: Alexandre Belloni Signed-off-by: Clément Léger Signed-off-by: Jakub Kicinski commit de5841e1c93f2275bb73c471255b718b5ec2f0ec Author: Clément Léger Date: Thu Dec 9 16:49:10 2021 +0100 net: ocelot: add support for ndo_change_mtu This commit adds support for changing MTU for the ocelot register based interface. For ocelot, JUMBO frame size can be set up to 25000 bytes but has been set to 9000 which is a saner value and allows for maximum gain of performance with FDMA. Reviewed-by: Vladimir Oltean Signed-off-by: Clément Léger Signed-off-by: Jakub Kicinski commit b471a71e525c73608a6ae5a3fdd2a5d1224da6a9 Author: Clément Léger Date: Thu Dec 9 16:49:09 2021 +0100 net: ocelot: add and export ocelot_ptp_rx_timestamp() In order to support PTP in FDMA, PTP handling code is needed. Since this is the same as for register-based extraction, export it with a new ocelot_ptp_rx_timestamp() function. Reviewed-by: Vladimir Oltean Signed-off-by: Clément Léger Signed-off-by: Jakub Kicinski commit e5150f00721f6f8e7b4e7f31bff86b4b6a8de0d4 Author: Clément Léger Date: Thu Dec 9 16:49:08 2021 +0100 net: ocelot: export ocelot_ifh_port_set() to setup IFH FDMA will need this code to prepare the injection frame header when sending SKBs. Move this code into ocelot_ifh_port_set() and add conditional IFH setting for vlan and rew op if they are not set. Reviewed-by: Vladimir Oltean Signed-off-by: Clément Léger Signed-off-by: Jakub Kicinski commit 1868d997cf9cfddb52729a241f8653d5cec4e42c Merge: 840ece19e9f24 dd464f145c8ce Author: Jakub Kicinski Date: Fri Dec 10 20:53:58 2021 -0800 Merge branch 'net-wwan-iosm-improvements' M Chetan Kumar says: ==================== net: wwan: iosm: improvements This patch series brings in IOSM driver improvments. PATCH1: Set tx queue len. PATCH2: Release data channel if there is no active IP session. PATCH3: Removes dead code. PATCH4: Correct open parenthesis alignment. ==================== Link: https://lore.kernel.org/r/20211209143230.3054755-1-m.chetan.kumar@linux.intel.com Signed-off-by: Jakub Kicinski commit dd464f145c8ceb29e19b63b31eb8004a05a1cd53 Author: M Chetan Kumar Date: Thu Dec 9 20:02:30 2021 +0530 net: wwan: iosm: correct open parenthesis alignment Fix checkpatch warning in iosm_ipc_mmio.c - Alignment should match open parenthesis Signed-off-by: M Chetan Kumar Reviewed-by: Sergey Ryazanov Signed-off-by: Jakub Kicinski commit 8a7ed600505a4841aaf8bccf8c82936e46847b13 Author: M Chetan Kumar Date: Thu Dec 9 20:02:29 2021 +0530 net: wwan: iosm: removed unused function decl ipc_wwan_tx_flowctrl() is declared in iosm_ipc_wwan.h but is not defined. Removed the dead code. Signed-off-by: M Chetan Kumar Reviewed-by: Sergey Ryazanov Signed-off-by: Jakub Kicinski commit da633aa3163fe1019c9e85333a17b74a5b99f5ac Author: M Chetan Kumar Date: Thu Dec 9 20:02:28 2021 +0530 net: wwan: iosm: release data channel in case no active IP session If there is no active IP session (interface up & running) then release the data channel. Use nr_sessions variable to track current active IP sessions. If the count drops to 0, then send pipe close ctrl message to release the data channel. Signed-off-by: M Chetan Kumar Reviewed-by: Sergey Ryazanov Signed-off-by: Jakub Kicinski commit 5d710dc3318c981475780158c17a8725bdcc6a5d Author: M Chetan Kumar Date: Thu Dec 9 20:02:27 2021 +0530 net: wwan: iosm: set tx queue len Set wwan net dev tx queue len to DEFAULT_TX_QUEUE_LEN. Signed-off-by: M Chetan Kumar Reviewed-by: Sergey Ryazanov Signed-off-by: Jakub Kicinski commit 840ece19e9f246a1b15308ae76b68aaf7a3a9433 Author: Colin Foster Date: Wed Dec 8 23:40:10 2021 -0800 net: ocelot: fix missed include in the vsc7514_regs.h file commit 32ecd22ba60b ("net: mscc: ocelot: split register definitions to a separate file") left out an include for . It was missed because the only consumer was ocelot_vsc7514.h, which already included ocelot_vcap. Fixes: 32ecd22ba60b ("net: mscc: ocelot: split register definitions to a separate file") Signed-off-by: Colin Foster Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20211209074010.1813010-1-colin.foster@in-advantage.com Signed-off-by: Jakub Kicinski commit 7adf905333f4dd7965fe8a7c96a54cff70f7c354 Author: Erik Ekman Date: Thu Dec 9 00:00:22 2021 +0100 net: bna: Update supported link modes The BR-series installation guide from https://driverdownloads.qlogic.com/ mentions the cards support 10Gbase-SR/LR as well as direct attach cables. The cards only have SFP+ ports, so 10000baseT is not the right mode. Switch to using more specific link modes added in commit 5711a98221443 ("net: ethtool: add support for 1000BaseX and missing 10G link modes"). Only compile tested. Signed-off-by: Erik Ekman Link: https://lore.kernel.org/r/20211208230022.153496-1-erik@kryo.se Signed-off-by: Jakub Kicinski commit 33d60fbd21fa6f71a88571209e301ec6de59f81b Author: Kuniyuki Iwashima Date: Wed Dec 8 15:21:58 2021 +0900 sock: Use sock_owned_by_user_nocheck() instead of sk_lock.owned. This patch moves sock_release_ownership() down in include/net/sock.h and replaces some sk_lock.owned tests with sock_owned_by_user_nocheck(). Signed-off-by: Kuniyuki Iwashima Link: https://lore.kernel.org/r/20211208062158.54132-1-kuniyu@amazon.co.jp Signed-off-by: Jakub Kicinski commit 76aee8658b8f5836ace0a423157f29fcaec65e30 Author: John Harrison Date: Thu Dec 9 20:40:22 2021 -0800 drm/i915/guc: Don't go bang in GuC log if no GuC If the GuC has failed to load for any reason and then the user pokes the debugfs GuC log interface, a BUG and/or null pointer deref can occur. Don't let that happen. Signed-off-by: John Harrison Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20211210044022.1842938-5-John.C.Harrison@Intel.com commit 3d832f370d16a8757024b2523c4c6b64dd7eac6a Author: John Harrison Date: Thu Dec 9 20:40:19 2021 -0800 drm/i915/uc: Allow platforms to have GuC but not HuC It is possible for platforms to require GuC but not HuC firmware. Also, the firmware versions for GuC and HuC advance independently. So split the macros up to allow the lists to be maintained separately. Signed-off-by: John Harrison Reviewed-by: Lucas De Marchi Reviewed-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20211210044022.1842938-2-John.C.Harrison@Intel.com commit e89908201e2509354c40158b517945bf3d645812 Author: Shuah Khan Date: Thu Dec 9 16:35:02 2021 -0700 selftests/vm: remove ARRAY_SIZE define from individual tests ARRAY_SIZE is defined in several selftests. Remove definitions from individual test files and include header file for the define instead. ARRAY_SIZE define is added in a separate patch to prepare for this change. Remove ARRAY_SIZE from vm tests and pickup the one defined in kselftest.h. Signed-off-by: Shuah Khan commit 7527c03870fd7bfb21b13656c8b5dda30b6685a7 Author: Shuah Khan Date: Thu Dec 9 16:27:45 2021 -0700 selftests/timens: remove ARRAY_SIZE define from individual tests ARRAY_SIZE is defined in several selftests. Remove definitions from individual test files and include header file for the define instead. ARRAY_SIZE define is added in a separate patch to prepare for this change. Remove ARRAY_SIZE from timens tests and pickup the one defined in kselftest.h. Signed-off-by: Shuah Khan commit 08ca3510f74839a695257392a58a6d7ec142eaed Author: Shuah Khan Date: Thu Dec 9 16:22:39 2021 -0700 selftests/sparc64: remove ARRAY_SIZE define from adi-test ARRAY_SIZE is defined in several selftests. Remove definition from individual test files and include header file for the define instead. ARRAY_SIZE define is added in a separate patch to prepare for this change. Remove ARRAY_SIZE from adi-test and pickup the one defined in kselftest.h. Signed-off-by: Shuah Khan commit 6e5eba2e336694b88e3ef6584a25e0723c173ae2 Author: Shuah Khan Date: Thu Dec 9 16:20:53 2021 -0700 selftests/seccomp: remove ARRAY_SIZE define from seccomp_benchmark ARRAY_SIZE is defined in several selftests. Remove definitions from individual test files and include header file for the define instead. ARRAY_SIZE define is added in a separate patch to prepare for this change. Remove ARRAY_SIZE from seccomp_benchmark and pickup the one defined in kselftest.h. Signed-off-by: Shuah Khan commit 07ad4f7629d4802ff0d962b0ac23ea6445964e2a Author: Shuah Khan Date: Thu Dec 9 16:19:09 2021 -0700 selftests/rseq: remove ARRAY_SIZE define from individual tests ARRAY_SIZE is defined in several selftests. Remove definitions from individual test files and include header file for the define instead. ARRAY_SIZE define is added in a separate patch to prepare for this change. Remove ARRAY_SIZE from rseq tests and pickup the one defined in kselftest.h. Signed-off-by: Shuah Khan commit 1329e40ebd18f1171f89f9e61b7a4aed9a1de406 Author: Shuah Khan Date: Thu Dec 9 14:10:23 2021 -0700 selftests/net: remove ARRAY_SIZE define from individual tests ARRAY_SIZE is defined in several selftests. Remove definitions from individual test files and include header file for the define instead. ARRAY_SIZE define is added in a separate patch to prepare for this change. Remove ARRAY_SIZE from net tests and pickup the one defined in kselftest.h. Signed-off-by: Shuah Khan commit 5a69d33b3ed62f6c1eb7ad3b9c350d29f49513e8 Author: Shuah Khan Date: Thu Dec 9 14:06:08 2021 -0700 selftests/landlock: remove ARRAY_SIZE define from common.h ARRAY_SIZE is defined in several selftests. Remove definitions from individual test files and include header file for the define instead. ARRAY_SIZE define is added in a separate patch to prepare for this change. Remove ARRAY_SIZE from common.h and pickup the one defined in kselftest.h. Signed-off-by: Shuah Khan commit 8eda7963235d0c2d6f926dea951f071bf9aa730f Author: Shuah Khan Date: Thu Dec 9 13:58:49 2021 -0700 selftests/ir: remove ARRAY_SIZE define from ir_loopback.c ARRAY_SIZE is defined in several selftests. Remove definitions from individual test files and include header file for the define instead. ARRAY_SIZE define is added in a separate patch to prepare for this change. Remove ARRAY_SIZE from ir_loopback.c and pickup the one defined in kselftest.h. Signed-off-by: Shuah Khan commit fc1d330358423f5f812b3c647bf23e25cae5ab15 Author: Shuah Khan Date: Thu Dec 9 12:57:14 2021 -0700 selftests/core: remove ARRAY_SIZE define from close_range_test.c ARRAY_SIZE is defined in several selftests. Remove definitions from individual test files and include header file for the define instead. ARRAY_SIZE define is added in a separate patch to prepare for this change. Remove ARRAY_SIZE from close_range_test.c and pickup the one defined in kselftest.h. Signed-off-by: Shuah Khan commit 72a571d1e25f732ae7d50b9566ad68ce87c733d9 Author: Shuah Khan Date: Thu Dec 9 12:49:13 2021 -0700 selftests/cgroup: remove ARRAY_SIZE define from cgroup_util.h ARRAY_SIZE is defined in several selftests. Remove definitions from individual test files and include header file for the define instead. ARRAY_SIZE define is added in a separate patch to prepare for this change. Remove ARRAY_SIZE from cgroup_util.h and pickup the one defined in kselftest.h. Signed-off-by: Shuah Khan commit 2684618b61189544aa4a539fb5df9eb074de8ce6 Author: Shuah Khan Date: Thu Dec 9 12:36:24 2021 -0700 selftests/arm64: remove ARRAY_SIZE define from vec-syscfg.c ARRAY_SIZE is defined in several selftests. Remove definitions from individual test files and include header file for the define instead. ARRAY_SIZE define is added in a separate patch to prepare for this change. Remove ARRAY_SIZE from vec-syscfg.c and pickup the one defined in kselftest.h. Signed-off-by: Shuah Khan commit 066b34aa5461f6072dbbecb690f4fe446b736ebf Author: Shuah Khan Date: Wed Dec 8 10:47:42 2021 -0700 tools: fix ARRAY_SIZE defines in tools and selftests hdrs tools/include/linux/kernel.h and kselftest_harness.h are missing ifndef guard around ARRAY_SIZE define. Fix them to avoid duplicate define errors during compile when another file defines it. This problem was found when compiling selftests that include a header with ARRAY_SIZE define. ARRAY_SIZE is defined in several selftests. There are about 25+ duplicate defines in various selftests source and header files. Add ARRAY_SIZE to kselftest.h in preparation for removing duplicate ARRAY_SIZE defines from individual test files. Signed-off-by: Shuah Khan commit be3158290db8376f49a92d30791dd8899f748aed Merge: db10415448158 229fae38d0fc0 Author: Jakub Kicinski Date: Fri Dec 10 15:56:10 2021 -0800 Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next Andrii Nakryiko says: ==================== bpf-next 2021-12-10 v2 We've added 115 non-merge commits during the last 26 day(s) which contain a total of 182 files changed, 5747 insertions(+), 2564 deletions(-). The main changes are: 1) Various samples fixes, from Alexander Lobakin. 2) BPF CO-RE support in kernel and light skeleton, from Alexei Starovoitov. 3) A batch of new unified APIs for libbpf, logging improvements, version querying, etc. Also a batch of old deprecations for old APIs and various bug fixes, in preparation for libbpf 1.0, from Andrii Nakryiko. 4) BPF documentation reorganization and improvements, from Christoph Hellwig and Dave Tucker. 5) Support for declarative initialization of BPF_MAP_TYPE_PROG_ARRAY in libbpf, from Hengqi Chen. 6) Verifier log fixes, from Hou Tao. 7) Runtime-bounded loops support with bpf_loop() helper, from Joanne Koong. 8) Extend branch record capturing to all platforms that support it, from Kajol Jain. 9) Light skeleton codegen improvements, from Kumar Kartikeya Dwivedi. 10) bpftool doc-generating script improvements, from Quentin Monnet. 11) Two libbpf v0.6 bug fixes, from Shuyi Cheng and Vincent Minet. 12) Deprecation warning fix for perf/bpf_counter, from Song Liu. 13) MAX_TAIL_CALL_CNT unification and MIPS build fix for libbpf, from Tiezhu Yang. 14) BTF_KING_TYPE_TAG follow-up fixes, from Yonghong Song. 15) Selftests fixes and improvements, from Ilya Leoshkevich, Jean-Philippe Brucker, Jiri Olsa, Maxim Mikityanskiy, Tirthendu Sarkar, Yucong Sun, and others. * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next: (115 commits) libbpf: Add "bool skipped" to struct bpf_map libbpf: Fix typo in btf__dedup@LIBBPF_0.0.2 definition bpftool: Switch bpf_object__load_xattr() to bpf_object__load() selftests/bpf: Remove the only use of deprecated bpf_object__load_xattr() selftests/bpf: Add test for libbpf's custom log_buf behavior selftests/bpf: Replace all uses of bpf_load_btf() with bpf_btf_load() libbpf: Deprecate bpf_object__load_xattr() libbpf: Add per-program log buffer setter and getter libbpf: Preserve kernel error code and remove kprobe prog type guessing libbpf: Improve logging around BPF program loading libbpf: Allow passing user log setting through bpf_object_open_opts libbpf: Allow passing preallocated log_buf when loading BTF into kernel libbpf: Add OPTS-based bpf_btf_load() API libbpf: Fix bpf_prog_load() log_buf logic for log_level 0 samples/bpf: Remove unneeded variable bpf: Remove redundant assignment to pointer t selftests/bpf: Fix a compilation warning perf/bpf_counter: Use bpf_map_create instead of bpf_create_map samples: bpf: Fix 'unknown warning group' build warning on Clang samples: bpf: Fix xdp_sample_user.o linking with Clang ... ==================== Link: https://lore.kernel.org/r/20211210234746.2100561-1-andrii@kernel.org Signed-off-by: Jakub Kicinski commit 325163e9892b627fc9fb1af51e51f0f95dded517 Author: Daeho Jeong Date: Wed Dec 8 16:41:51 2021 -0800 f2fs: add gc_urgent_high_remaining sysfs node Added a new sysfs node called gc_urgent_high_remaining. The user can set the trial count limit for GC urgent high mode with this value. If GC thread gets to the limit, the mode will turn back to GC normal mode. By default, the value is zero, which means there is no limit like before. Signed-off-by: Daeho Jeong Signed-off-by: Jaegeuk Kim commit 77900c45ee5cd5da63bd4d818a41dbdf367e81cd Author: Chao Yu Date: Mon Dec 6 22:44:21 2021 +0800 f2fs: fix to do sanity check in is_alive() In fuzzed image, SSA table may indicate that a data block belongs to invalid node, which node ID is out-of-range (0, 1, 2 or max_nid), in order to avoid migrating inconsistent data in such corrupted image, let's do sanity check anyway before data block migration. Cc: stable@vger.kernel.org Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit f6db43076d190d9bf75559dec28e18b9d12e4ce5 Author: Chao Yu Date: Mon Dec 6 22:44:20 2021 +0800 f2fs: fix to avoid panic in is_alive() if metadata is inconsistent As report by Wenqing Liu in bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=215231 If we enable CONFIG_F2FS_CHECK_FS config, and with fuzzed image attached in above link, we will encounter panic when executing below script: 1. mkdir mnt 2. mount -t f2fs tmp1.img mnt 3. touch tmp F2FS-fs (loop11): mismatched blkaddr 5765 (source_blkaddr 1) in seg 3 kernel BUG at fs/f2fs/gc.c:1042! do_garbage_collect+0x90f/0xa80 [f2fs] f2fs_gc+0x294/0x12a0 [f2fs] f2fs_balance_fs+0x2c5/0x7d0 [f2fs] f2fs_create+0x239/0xd90 [f2fs] lookup_open+0x45e/0xa90 open_last_lookups+0x203/0x670 path_openat+0xae/0x490 do_filp_open+0xbc/0x160 do_sys_openat2+0x2f1/0x500 do_sys_open+0x5e/0xa0 __x64_sys_openat+0x28/0x40 Previously, f2fs tries to catch data inconcistency exception in between SSA and SIT table during GC, however once the exception is caught, it will call f2fs_bug_on to hang kernel, it's not needed, instead, let's set SBI_NEED_FSCK flag and skip migrating current block. Fixes: bbf9f7d90f21 ("f2fs: Fix indefinite loop in f2fs_gc()") Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 9056d6489f5a41cfbb67f719d2c0ce61ead72d9f Author: Chao Yu Date: Mon Dec 6 22:44:19 2021 +0800 f2fs: fix to do sanity check on inode type during garbage collection As report by Wenqing Liu in bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=215231 - Overview kernel NULL pointer dereference triggered in folio_mark_dirty() when mount and operate on a crafted f2fs image - Reproduce tested on kernel 5.16-rc3, 5.15.X under root 1. mkdir mnt 2. mount -t f2fs tmp1.img mnt 3. touch tmp 4. cp tmp mnt F2FS-fs (loop0): sanity_check_inode: inode (ino=49) extent info [5942, 4294180864, 4] is incorrect, run fsck to fix F2FS-fs (loop0): f2fs_check_nid_range: out-of-range nid=31340049, run fsck to fix. BUG: kernel NULL pointer dereference, address: 0000000000000000 folio_mark_dirty+0x33/0x50 move_data_page+0x2dd/0x460 [f2fs] do_garbage_collect+0xc18/0x16a0 [f2fs] f2fs_gc+0x1d3/0xd90 [f2fs] f2fs_balance_fs+0x13a/0x570 [f2fs] f2fs_create+0x285/0x840 [f2fs] path_openat+0xe6d/0x1040 do_filp_open+0xc5/0x140 do_sys_openat2+0x23a/0x310 do_sys_open+0x57/0x80 The root cause is for special file: e.g. character, block, fifo or socket file, f2fs doesn't assign address space operations pointer array for mapping->a_ops field, so, in a fuzzed image, SSA table indicates a data block belong to special file, when f2fs tries to migrate that block, it causes NULL pointer access once move_data_page() calls a_ops->set_dirty_page(). Cc: stable@vger.kernel.org Reported-by: Wenqing Liu Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 766c663933bec1068a6041f05bf31d39606bc2e8 Author: Jaegeuk Kim Date: Sat Dec 4 09:55:35 2021 -0800 f2fs: avoid duplicate call of mark_inode_dirty Let's check the condition first before set|clear bit. Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit ae2e2804caa120af188b0d7b08936c7ac5c7d8fe Author: Jaegeuk Kim Date: Mon Nov 29 10:36:12 2021 -0800 f2fs: show number of pending discard commands This information can be used to check how much time we need to give to issue all the discard commands. Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit e64347ae13dadba7b847776521a51c94c56605e9 Author: Fengnan Chang Date: Mon Nov 29 10:13:41 2021 +0800 f2fs: support POSIX_FADV_DONTNEED drop compressed page cache Previously, compressed page cache drop when clean page cache, but POSIX_FADV_DONTNEED can't clean compressed page cache because raw page don't have private data, and won't call f2fs_invalidate_compress_pages. This commit call f2fs_invalidate_compress_pages() directly in f2fs_file_fadvise() for POSIX_FADV_DONTNEED case. Signed-off-by: Fengnan Chang Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit d1917865a7906baf6b687e15e8e6195a295a3992 Author: Fengnan Chang Date: Fri Nov 26 18:19:19 2021 +0800 f2fs: fix remove page failed in invalidate compress pages Since compress inode not a regular file, generic_error_remove_page in f2fs_invalidate_compress_pages will always be failed, set compress inode as a regular file to fix it. Fixes: 6ce19aff0b8c ("f2fs: compress: add compress_inode to cache compressed blocks") Signed-off-by: Fengnan Chang Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit bd984c03097b8e9b7500cba7378040ac1c697dbb Author: Jaegeuk Kim Date: Fri Nov 19 11:20:33 2021 -0800 f2fs: show more DIO information in tracepoint This prints more information of DIO in tracepoint. Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit a1e09b03e6f5c1d713c88259909137c0fd264ede Author: Eric Biggers Date: Fri Jul 23 00:59:21 2021 -0700 f2fs: use iomap for direct I/O Make f2fs_file_read_iter() and f2fs_file_write_iter() use the iomap direct I/O implementation instead of the fs/direct-io.c one. The iomap implementation is more efficient, and it also avoids the need to add new features and optimizations to the old implementation. This new implementation also eliminates the need for f2fs to hook bio submission and completion and to allocate memory per-bio. This is because it's possible to correctly update f2fs's in-flight DIO counters using __iomap_dio_rw() in combination with an implementation of iomap_dio_ops::end_io() (as suggested by Christoph Hellwig). When possible, this new implementation preserves existing f2fs behavior such as the conditions for falling back to buffered I/O. This patch has been tested with xfstests by running 'gce-xfstests -c f2fs -g auto -X generic/017' with and without this patch; no regressions were seen. (Some tests fail both before and after. generic/017 hangs both before and after, so it had to be excluded.) Signed-off-by: Eric Biggers [Jaegeuk Kim: use spin_lock_bh for f2fs_update_iostat in softirq] Signed-off-by: Jaegeuk Kim commit a738a4ce8421b2187fa5b74bb475eeeb6ec9ac14 Author: Anders Roxell Date: Fri Nov 5 17:25:29 2021 +0100 selftests: cgroup: build error multiple outpt files When building selftests/cgroup: with clang the following error are seen: clang -Wall -pthread test_memcontrol.c cgroup_util.c ../clone3/clone3_selftests.h -o .../builds/current/kselftest/cgroup/test_memcontrol clang: error: cannot specify -o when generating multiple output files make[3]: *** [../lib.mk:146: .../builds/current/kselftest/cgroup/test_memcontrol] Error 1 Rework to add the header files to LOCAL_HDRS before including ../lib.mk, since the dependency is evaluated in '$(OUTPUT)/%:%.c $(LOCAL_HDRS)' in file lib.mk. Suggested-by: Arnd Bergmann Signed-off-by: Anders Roxell Acked-by: Christian Brauner Signed-off-by: Shuah Khan commit 009482c0932ae2420277dc0adaefa5bd51cb433e Author: Yang Guang Date: Mon Dec 6 08:07:23 2021 +0800 selftests/move_mount_set_group remove unneeded conversion to bool The coccinelle report ./tools/testing/selftests/move_mount_set_group/move_mount_set_group_test.c:225:18-23: WARNING: conversion to bool not needed here Relational and logical operators evaluate to bool, explicit conversion is overly verbose and unneeded. Reported-by: Zeal Robot Signed-off-by: Yang Guang Signed-off-by: Shuah Khan commit 6d425d7c1bec67eceee42fefe5ce00be0645482e Author: Yang Guang Date: Thu Nov 25 08:56:03 2021 +0800 selftests/mount: remove unneeded conversion to bool The coccinelle report ./tools/testing/selftests/mount/unprivileged-remount-test.c:285:54-59: WARNING: conversion to bool not needed here ./tools/testing/selftests/mount/unprivileged-remount-test.c:207:54-59: WARNING: conversion to bool not needed here Relational and logical operators evaluate to bool, explicit conversion is overly verbose and unneeded. Reported-by: Zeal Robot Signed-off-by: Yang Guang Signed-off-by: Shuah Khan commit 3abedf4646fdc0036fcb8ebbc3b600667167fafe Author: Jakub Kicinski Date: Wed Nov 24 14:39:16 2021 -0800 selftests: harness: avoid false negatives if test has no ASSERTs Test can fail either immediately when ASSERT() failed or at the end if one or more EXPECT() was not met. The exact return code is decided based on the number of successful ASSERT()s. If test has no ASSERT()s, however, the return code will be 0, as if the test did not fail. Start counting ASSERT()s from 1. Fixes: 369130b63178 ("selftests: Enhance kselftest_harness.h to print which assert failed") Signed-off-by: Jakub Kicinski Signed-off-by: Shuah Khan commit e5992f373c6eed6d09e5858e9623df1259b3ce30 Author: Heiko Carstens Date: Tue Nov 30 13:25:46 2021 +0100 selftests/ftrace: make kprobe profile testcase description unique Commit 32f6e5da83c7 ("selftests/ftrace: Add kprobe profile testcase") added a new kprobes testcase, but has a description which does not describe what the test case is doing and is duplicating the description of another test case. Therefore change the test case description, so it is unique and then allows easily to tell which test case actually passed or failed. Reported-by: Alexander Egorenkov Signed-off-by: Heiko Carstens Acked-by: Masami Hiramatsu Signed-off-by: Shuah Khan commit a531b0c23c0fc68ad758cc31a74cf612a4dafeb0 Author: Anders Roxell Date: Wed Nov 3 21:13:50 2021 +0100 selftests: clone3: clone3: add case CLONE3_ARGS_NO_TEST Building selftests/clone3 with clang warns about enumeration not handled in switch case: clone3.c:54:10: warning: enumeration value 'CLONE3_ARGS_NO_TEST' not handled in switch [-Wswitch] switch (test_mode) { ^ Add the missing switch case with a comment. Fixes: 17a810699c18 ("selftests: add tests for clone3()") Signed-off-by: Anders Roxell Acked-by: Christian Brauner Signed-off-by: Shuah Khan commit 7ace3e9ae0492a6b33f5af8b8e1a6f1e0390cc15 Author: Zhang Mingyu Date: Fri Nov 5 01:42:08 2021 +0000 selftests: timers: Remove unneeded semicolon Eliminate the following coccinelle check warning: tools/testing/selftests/timers/inconsistency-check.c:75:2-3 Reported-by: Zeal Robot Signed-off-by: Zhang Mingyu Signed-off-by: Shuah Khan commit 7b0653eca4cf7d57de84379bd81441d574901ddb Author: Zhang Mingyu Date: Fri Nov 5 01:35:47 2021 +0000 kselftests: timers:Remove unneeded semicolon Eliminate the following coccinelle check warning: tools/testing/selftests/timers/alarmtimer-suspend.c:82:2-3 Reported-by: Zeal Robot Signed-off-by: Zhang Mingyu Signed-off-by: Shuah Khan commit 229fae38d0fc0d6ff58d57cbeb1432da55e58d4f Author: Shuyi Cheng Date: Fri Dec 10 17:39:57 2021 +0800 libbpf: Add "bool skipped" to struct bpf_map Fix error: "failed to pin map: Bad file descriptor, path: /sys/fs/bpf/_rodata_str1_1." In the old kernel, the global data map will not be created, see [0]. So we should skip the pinning of the global data map to avoid bpf_object__pin_maps returning error. Therefore, when the map is not created, we mark “map->skipped" as true and then check during relocation and during pinning. Fixes: 16e0c35c6f7a ("libbpf: Load global data maps lazily on legacy kernels") Signed-off-by: Shuyi Cheng Signed-off-by: Andrii Nakryiko commit b69c5c07a66ee569b8ccdc0cb567fe0622c89ea5 Author: Vincent Minet Date: Fri Dec 10 07:31:12 2021 +0100 libbpf: Fix typo in btf__dedup@LIBBPF_0.0.2 definition The btf__dedup_deprecated name was misspelled in the definition of the compat symbol for btf__dedup. This leads it to be missing from the shared library. This fixes it. Fixes: 957d350a8b94 ("libbpf: Turn btf_dedup_opts into OPTS-based struct") Signed-off-by: Vincent Minet Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211210063112.80047-1-vincent@vincent-minet.net commit bd6b3b355af59af1f8c417c269a46be26a1dc87b Merge: ac55b3f00c323 b59e4ce8bcaab Author: Alexei Starovoitov Date: Thu Dec 9 15:40:34 2021 -0800 Merge branch 'Enhance and rework logging controls in libbpf' Andrii Nakryiko says: ==================== Add new open options and per-program setters to control BTF and program loading log verboseness and allow providing custom log buffers to capture logs of interest. Note how custom log_buf and log_level are orthogonal, which matches previous (alas less customizable) behavior of libbpf, even though it sort of worked by accident: if someone specified log_level = 1 in bpf_object__load_xattr(), first attempt to load any BPF program resulted in wasted bpf() syscall with -EINVAL due to !!log_buf != !!log_level. Then on retry libbpf would allocated log_buffer and try again, after which prog loading would succeed and libbpf would print verbose program loading log through its print callback. This behavior is now documented and made more efficient, not wasting unnecessary syscall. But additionally, log_level can be controlled globally on a per-bpf_object level through bpf_object_open_opts, as well as on a per-program basis with bpf_program__set_log_buf() and bpf_program__set_log_level() APIs. Now that we have a more future-proof way to set log_level, deprecate bpf_object__load_xattr(). v2->v3: - added log_buf selftests for bpf_prog_load() and bpf_btf_load(); - fix !log_buf in bpf_prog_load (John); - fix log_level==0 in bpf_btf_load (thanks selftest!); v1->v2: - fix log_level == 0 handling of bpf_prog_load, add as patch #1 (Alexei); - add comments explaining log_buf_size overflow prevention (Alexei). ==================== Signed-off-by: Alexei Starovoitov Signed-off-by: Andrii Nakryiko commit c5eafd790e1317f5bfc69845207f69f6447b4b2b Author: Jens Axboe Date: Fri Dec 10 16:32:44 2021 -0700 null_blk: cast command status to integer kernel test robot reports that sparse now triggers a warning on null_blk: >> drivers/block/null_blk/main.c:1577:55: sparse: sparse: incorrect type in argument 3 (different base types) @@ expected int ioerror @@ got restricted blk_status_t [usertype] error @@ drivers/block/null_blk/main.c:1577:55: sparse: expected int ioerror drivers/block/null_blk/main.c:1577:55: sparse: got restricted blk_status_t [usertype] error because blk_mq_add_to_batch() takes an integer instead of a blk_status_t. Just cast this to an integer to silence it, null_blk is the odd one out here since the command status is the "right" type. If we change the function type, then we'll have do that for other callers too (existing and future ones). Fixes: 2385ebf38f94 ("block: null_blk: batched complete poll requests") Reported-by: kernel test robot Signed-off-by: Jens Axboe commit b59e4ce8bcaab6445f4a0d37a96ca8953caaf5cf Author: Andrii Nakryiko Date: Thu Dec 9 11:38:40 2021 -0800 bpftool: Switch bpf_object__load_xattr() to bpf_object__load() Switch all the uses of to-be-deprecated bpf_object__load_xattr() into a simple bpf_object__load() calls with optional log_level passed through open_opts.kernel_log_level, if -d option is specified. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211209193840.1248570-13-andrii@kernel.org commit 3fc5fdcca144badbaf29b62aacbf7877f2f39a74 Author: Andrii Nakryiko Date: Thu Dec 9 11:38:39 2021 -0800 selftests/bpf: Remove the only use of deprecated bpf_object__load_xattr() Switch from bpf_object__load_xattr() to bpf_object__load() and kernel_log_level in bpf_object_open_opts. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211209193840.1248570-12-andrii@kernel.org commit 57e889269af3dd0609933e2550c4baee7a7eb84c Author: Andrii Nakryiko Date: Thu Dec 9 11:38:38 2021 -0800 selftests/bpf: Add test for libbpf's custom log_buf behavior Add a selftest that validates that per-program and per-object log_buf overrides work as expected. Also test same logic for low-level bpf_prog_load() and bpf_btf_load() APIs. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211209193840.1248570-11-andrii@kernel.org commit dc94121b5ca17adaaabb7959c10d9c6ea504f7b1 Author: Andrii Nakryiko Date: Thu Dec 9 11:38:37 2021 -0800 selftests/bpf: Replace all uses of bpf_load_btf() with bpf_btf_load() Switch all selftests uses of to-be-deprecated bpf_load_btf() with equivalent bpf_btf_load() calls. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211209193840.1248570-10-andrii@kernel.org commit e7b924ca715f0d1c0be62b205c36c4076b335421 Author: Andrii Nakryiko Date: Thu Dec 9 11:38:36 2021 -0800 libbpf: Deprecate bpf_object__load_xattr() Deprecate non-extensible bpf_object__load_xattr() in v0.8 ([0]). With log_level control through bpf_object_open_opts or bpf_program__set_log_level(), we are finally at the point where bpf_object__load_xattr() doesn't provide any functionality that can't be accessed through other (better) ways. The other feature, target_btf_path, is also controllable through bpf_object_open_opts. [0] Closes: https://github.com/libbpf/libbpf/issues/289 Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211209193840.1248570-9-andrii@kernel.org commit b3ce907950350a58880b94fed2b6022f160b8b9a Author: Andrii Nakryiko Date: Thu Dec 9 11:38:35 2021 -0800 libbpf: Add per-program log buffer setter and getter Allow to set user-provided log buffer on a per-program basis ([0]). This gives great deal of flexibility in terms of which programs are loaded with logging enabled and where corresponding logs go. Log buffer set with bpf_program__set_log_buf() overrides kernel_log_buf and kernel_log_size settings set at bpf_object open time through bpf_object_open_opts, if any. Adjust bpf_object_load_prog_instance() logic to not perform own log buf allocation and load retry if custom log buffer is provided by the user. [0] Closes: https://github.com/libbpf/libbpf/issues/418 Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211209193840.1248570-8-andrii@kernel.org commit 2eda2145ebfc76569fd088f46356203fc0c785a1 Author: Andrii Nakryiko Date: Thu Dec 9 11:38:34 2021 -0800 libbpf: Preserve kernel error code and remove kprobe prog type guessing Instead of rewriting error code returned by the kernel of prog load with libbpf-sepcific variants pass through the original error. There is now also no need to have a backup generic -LIBBPF_ERRNO__LOAD fallback error as bpf_prog_load() guarantees that errno will be properly set no matter what. Also drop a completely outdated and pretty useless BPF_PROG_TYPE_KPROBE guess logic. It's not necessary and neither it's helpful in modern BPF applications. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211209193840.1248570-7-andrii@kernel.org commit ad9a7f96445b70c415d8e193f854321b110c890a Author: Andrii Nakryiko Date: Thu Dec 9 11:38:33 2021 -0800 libbpf: Improve logging around BPF program loading Add missing "prog '%s': " prefixes in few places and use consistently markers for beginning and end of program load logs. Here's an example of log output: libbpf: prog 'handler': BPF program load failed: Permission denied libbpf: -- BEGIN PROG LOAD LOG --- arg#0 reference type('UNKNOWN ') size cannot be determined: -22 ; out1 = in1; 0: (18) r1 = 0xffffc9000cdcc000 2: (61) r1 = *(u32 *)(r1 +0) ... 81: (63) *(u32 *)(r4 +0) = r5 R1_w=map_value(id=0,off=16,ks=4,vs=20,imm=0) R4=map_value(id=0,off=400,ks=4,vs=16,imm=0) invalid access to map value, value_size=16 off=400 size=4 R4 min value is outside of the allowed memory range processed 63 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0 -- END PROG LOAD LOG -- libbpf: failed to load program 'handler' libbpf: failed to load object 'test_skeleton' The entire verifier log, including BEGIN and END markers are now always youtput during a single print callback call. This should make it much easier to post-process or parse it, if necessary. It's not an explicit API guarantee, but it can be reasonably expected to stay like that. Also __bpf_object__open is renamed to bpf_object_open() as it's always an adventure to find the exact function that implements bpf_object's open phase, so drop the double underscored and use internal libbpf naming convention. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211209193840.1248570-6-andrii@kernel.org commit e0e3ea888c69b4ea17133b8ac8dfd5066a759b5a Author: Andrii Nakryiko Date: Thu Dec 9 11:38:32 2021 -0800 libbpf: Allow passing user log setting through bpf_object_open_opts Allow users to provide their own custom log_buf, log_size, and log_level at bpf_object level through bpf_object_open_opts. This log_buf will be used during BTF loading. Subsequent patch will use same log_buf during BPF program loading, unless overriden at per-bpf_program level. When such custom log_buf is provided, libbpf won't be attempting retrying loading of BTF to try to provide its own log buffer to capture kernel's error log output. User is responsible to provide big enough buffer, otherwise they run a risk of getting -ENOSPC error from the bpf() syscall. See also comments in bpf_object_open_opts regarding log_level and log_buf interactions. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211209193840.1248570-5-andrii@kernel.org commit 1a190d1e8eb9ff84354e38f7482dc77b626f3cc9 Author: Andrii Nakryiko Date: Thu Dec 9 11:38:31 2021 -0800 libbpf: Allow passing preallocated log_buf when loading BTF into kernel Add libbpf-internal btf_load_into_kernel() that allows to pass preallocated log_buf and custom log_level to be passed into kernel during BPF_BTF_LOAD call. When custom log_buf is provided, btf_load_into_kernel() won't attempt an retry with automatically allocated internal temporary buffer to capture BTF validation log. It's important to note the relation between log_buf and log_level, which slightly deviates from stricter kernel logic. From kernel's POV, if log_buf is specified, log_level has to be > 0, and vice versa. While kernel has good reasons to request such "sanity, this, in practice, is a bit unconvenient and restrictive for libbpf's high-level bpf_object APIs. So libbpf will allow to set non-NULL log_buf and log_level == 0. This is fine and means to attempt to load BTF without logging requested, but if it failes, retry the load with custom log_buf and log_level 1. Similar logic will be implemented for program loading. In practice this means that users can provide custom log buffer just in case error happens, but not really request slower verbose logging all the time. This is also consistent with libbpf behavior when custom log_buf is not set: libbpf first tries to load everything with log_level=0, and only if error happens allocates internal log buffer and retries with log_level=1. Also, while at it, make BTF validation log more obvious and follow the log pattern libbpf is using for dumping BPF verifier log during BPF_PROG_LOAD. BTF loading resulting in an error will look like this: libbpf: BTF loading error: -22 libbpf: -- BEGIN BTF LOAD LOG --- magic: 0xeb9f version: 1 flags: 0x0 hdr_len: 24 type_off: 0 type_len: 1040 str_off: 1040 str_len: 2063598257 btf_total_size: 1753 Total section length too long -- END BTF LOAD LOG -- libbpf: Error loading .BTF into kernel: -22. BTF is optional, ignoring. This makes it much easier to find relevant parts in libbpf log output. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211209193840.1248570-4-andrii@kernel.org commit 0ed08d6725b5116aaad7a0082d721286e0a43dca Author: Andrii Nakryiko Date: Thu Dec 9 11:38:30 2021 -0800 libbpf: Add OPTS-based bpf_btf_load() API Similar to previous bpf_prog_load() and bpf_map_create() APIs, add bpf_btf_load() API which is taking optional OPTS struct. Schedule bpf_load_btf() for deprecation in v0.8 ([0]). This makes naming consistent with BPF_BTF_LOAD command, sets up an API for extensibility in the future, moves options parameters (log-related fields) into optional options, and also allows to pass log_level directly. It also removes log buffer auto-allocation logic from low-level API (consistent with bpf_prog_load() behavior), but preserves a special treatment of log_level == 0 with non-NULL log_buf, which matches low-level bpf_prog_load() and high-level libbpf APIs for BTF and program loading behaviors. [0] Closes: https://github.com/libbpf/libbpf/issues/419 Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211209193840.1248570-3-andrii@kernel.org commit 4cf23a3c6359556a1cca489cf2b901e2b904c4b0 Author: Andrii Nakryiko Date: Thu Dec 9 11:38:29 2021 -0800 libbpf: Fix bpf_prog_load() log_buf logic for log_level 0 To unify libbpf APIs behavior w.r.t. log_buf and log_level, fix bpf_prog_load() to follow the same logic as bpf_btf_load() and high-level bpf_object__load() API will follow in the subsequent patches: - if log_level is 0 and non-NULL log_buf is provided by a user, attempt load operation initially with no log_buf and log_level set; - if successful, we are done, return new FD; - on error, retry the load operation with log_level bumped to 1 and log_buf set; this way verbose logging will be requested only when we are sure that there is a failure, but will be fast in the common/expected success case. Of course, user can still specify log_level > 0 from the very beginning to force log collection. Suggested-by: Alexei Starovoitov Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211209193840.1248570-2-andrii@kernel.org commit 489a71964f9d74e697a12cd0ace20ed829eb1f93 Author: Stephen Boyd Date: Thu Dec 9 17:34:05 2021 -0800 clk: Emit a stern warning with writable debugfs enabled We don't want vendors to be enabling this part of the clk code and shipping it to customers. Exposing the ability to change clk frequencies and parents via debugfs is potentially damaging to the system if folks don't know what they're doing. Emit a strong warning so that the message is clear: don't enable this outside of development systems. Fixes: 37215da5553e ("clk: Add support for setting clk_rate via debugfs") Cc: Geert Uytterhoeven Link: https://lore.kernel.org/r/20211210014237.2130300-1-sboyd@kernel.org Signed-off-by: Stephen Boyd commit a32fa6b2e8b4e0b8c03f5218afa0649e188239c5 Author: Rae Moar Date: Tue Dec 7 11:02:51 2021 -0800 Documentation: dev-tools: Add KTAP specification It does not make any significant additions or changes other than those already in use in the kernel: additional features can be added as they become necessary and used. [1]: https://testanything.org/tap-version-13-specification.html Signed-off-by: Rae Moar Co-developed-by: David Gow Signed-off-by: David Gow Reviewed-by: Shuah Khan Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20211207190251.18426-1-davidgow@google.com Signed-off-by: Jonathan Corbet commit 1b695cc6c8f8e61cc8ba7d3e5a0f8898ea593aab Author: Tang Yizhou Date: Thu Dec 2 21:02:40 2021 +0800 doc/zh-CN: Update cpu-freq/core.rst to make it more readable These Chinese translations are easier to understand. Also update the first memeber of struct cpufreq_freqs. Signed-off-by: Tang Yizhou Acked-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/20211202130240.27942-1-tangyizhou@huawei.com Signed-off-by: Jonathan Corbet commit 7ef5d754f73bf875d2eb09f698c69f2a09d701e5 Author: Alexey Brodkin Date: Fri Dec 3 00:57:47 2021 +0300 docs: ARC: Improve readability There were some things which made rendered document look not very elegant. That was because: 1. Numbered lists were formatted in more of Markdown way rather than true reStructuredText and so were displayed as a plain text with leading numbers. Well, moreover numbered lists were not needed as in all cases we were just listing a couple of options w/o any intention to follow any particular order, so a simpler unordered list fits better and looks cleaner. 2. URL's of external resources were added as they are (which is OK in a plain text, but make not much sense in a HTML where we may use more human-friendly link names with URL's hidden. 3. Some URL's had trailing slashes which were not really needed Fix all items from above! Signed-off-by: Alexey Brodkin Cc: Randy Dunlap Cc: Jonathan Corbet Cc: Vineet Gupta Link: https://lore.kernel.org/r/20211202215747.19923-1-abrodkin@synopsys.com Signed-off-by: Jonathan Corbet commit 50665d58db052b04f640fd54de1632aeecd4fc77 Author: Akhil R Date: Fri Dec 10 17:45:57 2021 +0530 i2c: tegra: use i2c_timings for bus clock freq Use i2c_timings struct and corresponding methods to get bus clock frequency Signed-off-by: Akhil R Suggested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Reviewed-by: Dmitry Osipenko Tested-by: Dmitry Osipenko Signed-off-by: Wolfram Sang commit a6fb8b5acf47c5e621ae919b94c3f54e277f5039 Author: Mauro Carvalho Chehab Date: Tue Dec 7 10:53:02 2021 +0100 docs: add support for RTD dark mode This is actually an overlay on the top of the RTD theme, which requires to include first the RTD theme. It should be noticed that, when the dark theme is used, the DOCS_CSS files won't be the last CSS themes. So, it won't override the dark.css style by default. So, it is needed to force the them override with "!important". This small script, for instance, produces a nice output with the RTD dark theme: DOCS_THEME=sphinx_rtd_dark_mode cat << EOF > dark_override.css html body { font-family: arial,helvetica,sans-serif; } html[data-theme='dark'] body { color: white !important; } html[data-theme='dark'] .sig-name { color: green !important; } html[data-theme='dark'] .wy-menu-vertical a { color: #ffcc00 !important; } html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3 { color: #ffcc00 !important; } html[data-theme="dark"] h4, html[data-theme="dark"] h5, html[data-theme="dark"] h6 { color: #ffcc00 !important; } html[data-theme="dark"] h7, html[data-theme="dark"] h8, html[data-theme="dark"] h9 { color: #ffcc00 !important; } html[data-theme="dark"] .wy-nav-content a, html[data-theme="dark"] .wy-nav-content a:visited { color: #ffcc00 !important; } EOF make DOCS_CSS=dark_override.css DOCS_THEME=sphinx_rtd_dark_mode htmldocs Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/90d316e055ef7f4c9021b9eada8f8d3b2e750a66.1638870323.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit ffc901b4d19fc50a6de7ef395436319ae2b3d708 Author: Mauro Carvalho Chehab Date: Tue Dec 7 10:53:01 2021 +0100 docs: set format for the classic mode When RTD is not installed or when THEME=classic is used, the produced docs contain some weird selections. As this theme has several variables to customize it, set them, in order to produce a nicer output. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/8889380606681a2b7033f73bed9717250302be2a.1638870323.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit 135707d3765ec3734437864ec91667dc29f0cdec Author: Mauro Carvalho Chehab Date: Tue Dec 7 10:53:00 2021 +0100 docs: allow to pass extra DOCS_CSS themes via make Specially when the RTD theme is not used, it makes sense to allow specifying extra CSS files via a make variable. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/03d09bf41ad39aa0abfe2ea3c879b09aa3a0948d.1638870323.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit fca7216bf53e7f1f4a8dba6af386d6faa7699fd6 Author: Mauro Carvalho Chehab Date: Tue Dec 7 10:52:59 2021 +0100 docs: allow selecting a Sphinx theme Instead of having RTD as an almost mandatory theme, allow the user to select other themes via DOCS_THEME environment var. There's a catch, though: as the current theme override logic is dependent of the RTD theme, we need to move the code which adds the CSS overrides to be inside the RTD theme logic. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/bd20adabfd428fd3cd0e69c2cf146aa354932936.1638870323.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet commit b080e52110ea30b1ec6dcc2e9dbac786ac104ddd Author: Shuah Khan Date: Wed Dec 8 09:40:51 2021 -0700 docs: update self-protection __ro_after_init status __ro_after_init is no longer new and under development. Update the document to reflect the correct status. Signed-off-by: Shuah Khan Link: https://lore.kernel.org/r/20211208164051.8783-1-skhan@linuxfoundation.org Signed-off-by: Jonathan Corbet commit 4fd34f8e1ff70cd7f86e18deb20be35f4605f5f6 Author: Alex Shi Date: Thu Dec 9 17:56:04 2021 +0800 doc/zh_CN: add Chinese document coding style reminder The coding style requirement for Chinese document is easy to be overlooked. Add the request as a remdiner. Signed-off-by: Alex Shi Cc: Yanteng Si Cc: Tang Yizhou Cc: Jonathan Corbet Cc: linux-doc@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Yanteng Si Link: https://lore.kernel.org/r/20211209095604.68954-1-alexs@kernel.org Signed-off-by: Jonathan Corbet commit 0dc915922235cd90421d291478b040f127b99105 Author: Yanteng Si Date: Fri Dec 10 12:15:36 2021 +0800 docs/trace: fix a label of boottime-trace Commit 559789539255 ("Documentation: tracing: Add histogram syntax to boot-time tracing") introduced a warning: linux/Documentation/trace/boottime-trace.rst:136: WARNING: undefined label: histogram (if the link has no caption the label must precede a section header) Replace with: (path) Signed-off-by: Yanteng Si Acked-by: Steven Rostedt (VMware) Acked-by: Masami Hiramatsu Fixes: 559789539255 ("Documentation: tracing: Add histogram syntax to boot-time tracing") Link: https://lore.kernel.org/r/20211210041536.1446734-1-siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit a7fb920b158da0a154da609a4c27ff693404ec90 Merge: ce881fc06dc87 0fcfb00b28c0b Author: Jonathan Corbet Date: Fri Dec 10 13:57:09 2021 -0700 Merge tag 'v5.16-rc4' into docs-next I have a couple of fixes for warnings introduced after -rc1; catch up to -rc4 so that the fixes have something to fix. commit 4b3ddc6462e83452182177b48c4bc53607acd68e Author: Nitesh Narayan Lal Date: Fri Sep 3 11:24:30 2021 -0400 net/mlx4: Use irq_update_affinity_hint() The driver uses irq_set_affinity_hint() to update the affinity_hint mask that is consumed by the userspace to distribute the interrupts. However, under the hood irq_set_affinity_hint() also applies the provided cpumask (if not NULL) as the affinity for the given interrupt which is an undocumented side effect. To remove this side effect irq_set_affinity_hint() has been marked as deprecated and new interfaces have been introduced. Hence, replace the irq_set_affinity_hint() with the new interface irq_update_affinity_hint() that only updates the affinity_hint pointer. Signed-off-by: Nitesh Narayan Lal Signed-off-by: Thomas Gleixner Reviewed-by: Leon Romanovsky Reviewed-by: Tariq Toukan Link: https://lore.kernel.org/r/20210903152430.244937-15-nitesh@redhat.com commit 7451e9ea8e2055af39afe7ff39a5f68d8ec6b98d Author: Nitesh Narayan Lal Date: Fri Sep 3 11:24:29 2021 -0400 net/mlx5: Use irq_set_affinity_and_hint() The driver uses irq_set_affinity_hint() to update the affinity_hint mask that is consumed by the userspace to distribute the interrupts and to apply the provided mask as the affinity for the mlx5 interrupts. However, irq_set_affinity_hint() applying the provided cpumask as an affinity for the interrupt is an undocumented side effect. To remove this side effect irq_set_affinity_hint() has been marked as deprecated and new interfaces have been introduced. Hence, replace the irq_set_affinity_hint() with the new interface irq_set_affinity_and_hint() where the provided mask needs to be applied as the affinity and affinity_hint pointer needs to be set and replace with irq_update_affinity_hint() where only affinity_hint needs to be updated. Signed-off-by: Nitesh Narayan Lal Signed-off-by: Thomas Gleixner Reviewed-by: Leon Romanovsky Link: https://lore.kernel.org/r/20210903152430.244937-14-nitesh@redhat.com commit 2d1e72f235d665aa699fb821f6da6e8bde84cbde Author: Nitesh Narayan Lal Date: Fri Sep 3 11:24:28 2021 -0400 hinic: Use irq_set_affinity_and_hint() The driver uses irq_set_affinity_hint() to: - Set the affinity_hint which is consumed by the userspace for distributing the interrupts - Enforce affinity As per commit 352f58b0d9f2 ("net-next/hinic: Set Rxq irq to specific cpu for NUMA"), the hinic driver enforces its own affinity to bind IRQs to the local NUMA node. However, irq_set_affinity_hint() applying the provided cpumask as an affinity for the interrupt is an undocumented side effect. To remove this side effect irq_set_affinity_hint() has been marked as deprecated and new interfaces have been introduced. Hence, replace the irq_set_affinity_hint() with the new interface irq_set_affinity_and_hint() where the provided mask needs to be applied as the affinity and affinity_hint pointer needs to be set and replace with irq_update_affinity_hint() where only affinity_hint needs to be updated. Signed-off-by: Nitesh Narayan Lal Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210903152430.244937-13-nitesh@redhat.com commit ce5a58a96ccc241c6e5cbb3360494ddfaf118afe Author: Nitesh Narayan Lal Date: Fri Sep 3 11:24:27 2021 -0400 scsi: lpfc: Use irq_set_affinity() The driver uses irq_set_affinity_hint to set the affinity for the lpfc interrupts to a mask corresponding to the local NUMA node to avoid performance overhead on AMD architectures. However, irq_set_affinity_hint() setting the affinity is an undocumented side effect that this function also sets the affinity under the hood. To remove this side effect irq_set_affinity_hint() has been marked as deprecated and new interfaces have been introduced. Also, as per the commit dcaa21367938 ("scsi: lpfc: Change default IRQ model on AMD architectures"): "On AMD architecture, revert the irq allocation to the normal style (non-managed) and then use irq_set_affinity_hint() to set the cpu affinity and disable user-space rebalancing." we don't really need to set the affinity_hint as user-space rebalancing for the lpfc interrupts is not desired. Hence, replace the irq_set_affinity_hint() with irq_set_affinity() which only applies the affinity for the interrupts. Signed-off-by: Nitesh Narayan Lal Signed-off-by: Thomas Gleixner Reviewed-by: James Smart Link: https://lore.kernel.org/r/20210903152430.244937-12-nitesh@redhat.com commit bf886e1ef11a0155714ca93c975bb3f770e79d72 Author: Nitesh Narayan Lal Date: Fri Sep 3 11:24:26 2021 -0400 mailbox: Use irq_update_affinity_hint() The driver uses irq_set_affinity_hint() to: - Set the affinity_hint which is consumed by the userspace for distributing the interrupts - Enforce affinity As per commit 6ac17fe8c14a ("mailbox: bcm-flexrm-mailbox: Set IRQ affinity hint for FlexRM ring IRQs") the latter is done to ensure that the FlexRM ring interrupts are evenly spread across all available CPUs. However, since commit a0c9259dc4e1 ("irq/matrix: Spread interrupts on allocation") the spreading of interrupts is dynamically performed at the time of allocation. Hence, there is no need for the drivers to enforce their own affinity for the spreading of interrupts. Also, irq_set_affinity_hint() applying the provided cpumask as an affinity for the interrupt is an undocumented side effect. To remove this side effect irq_set_affinity_hint() has been marked as deprecated and new interfaces have been introduced. Hence, replace the irq_set_affinity_hint() with the new interface irq_update_affinity_hint() that only sets the affinity_hint pointer. Signed-off-by: Nitesh Narayan Lal Signed-off-by: Thomas Gleixner Acked-by: Jassi Brar Link: https://lore.kernel.org/r/20210903152430.244937-11-nitesh@redhat.com commit cc493264c01d055742a34cfbaecaffb258dcc58c Author: Nitesh Narayan Lal Date: Fri Sep 3 11:24:25 2021 -0400 ixgbe: Use irq_update_affinity_hint() The driver uses irq_set_affinity_hint() to update the affinity_hint mask that is consumed by the userspace to distribute the interrupts. However, under the hood irq_set_affinity_hint() also applies the provided cpumask (if not NULL) as the affinity for the given interrupt which is an undocumented side effect. To remove this side effect irq_set_affinity_hint() has been marked as deprecated and new interfaces have been introduced. Hence, replace the irq_set_affinity_hint() with the new interface irq_update_affinity_hint() that only updates the affinity_hint pointer. Signed-off-by: Nitesh Narayan Lal Signed-off-by: Thomas Gleixner Acked-by: Jesse Brandeburg Link: https://lore.kernel.org/r/20210903152430.244937-10-nitesh@redhat.com commit b8b9dd525203304d36bd123fca3ce0c3b318339b Author: Nitesh Narayan Lal Date: Fri Sep 3 11:24:24 2021 -0400 be2net: Use irq_update_affinity_hint() The driver uses irq_set_affinity_hint() to update the affinity_hint mask that is consumed by the userspace to distribute the interrupts. However, under the hood irq_set_affinity_hint() also applies the provided cpumask (if not NULL) as the affinity for the given interrupt which is an undocumented side effect. To remove this side effect irq_set_affinity_hint() has been marked as deprecated and new interfaces have been introduced. Hence, replace the irq_set_affinity_hint() with the new interface irq_update_affinity_hint() that only updates the affinity_hint pointer. Signed-off-by: Nitesh Narayan Lal Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20210903152430.244937-9-nitesh@redhat.com commit cb39ca92eb74d00b5b2e1debdba1f33e6e4c8ebd Author: Nitesh Narayan Lal Date: Fri Sep 3 11:24:23 2021 -0400 enic: Use irq_update_affinity_hint() The driver uses irq_set_affinity_hint() to update the affinity_hint mask that is consumed by the userspace to distribute the interrupts. However, under the hood irq_set_affinity_hint() also applies the provided cpumask (if not NULL) as the affinity for the given interrupt which is an undocumented side effect. To remove this side effect irq_set_affinity_hint() has been marked as deprecated and new interfaces have been introduced. Hence, replace the irq_set_affinity_hint() with the new interface irq_update_affinity_hint() that only updates the affinity_hint pointer. Signed-off-by: Nitesh Narayan Lal Signed-off-by: Thomas Gleixner Reviewed-by: Christian Benvenuti Link: https://lore.kernel.org/r/20210903152430.244937-8-nitesh@redhat.com commit fb5bd854710e410e5544f8ba348a5be6541e4939 Author: Nitesh Narayan Lal Date: Fri Sep 3 11:24:22 2021 -0400 RDMA/irdma: Use irq_update_affinity_hint() The driver uses irq_set_affinity_hint() to update the affinity_hint mask that is consumed by the userspace to distribute the interrupts. However, under the hood irq_set_affinity_hint() also applies the provided cpumask (if not NULL) as the affinity for the given interrupt which is an undocumented side effect. To remove this side effect irq_set_affinity_hint() has been marked as deprecated and new interfaces have been introduced. Hence, replace the irq_set_affinity_hint() with the new interface irq_update_affinity_hint() that only updates the affinity_hint pointer. Signed-off-by: Nitesh Narayan Lal Signed-off-by: Thomas Gleixner Acked-by: Tatyana Nikolova Link: https://lore.kernel.org/r/20210903152430.244937-7-nitesh@redhat.com commit fdb8ed13a77270c8e6e05b3ff9f4cb2f57e16d6a Author: Nitesh Narayan Lal Date: Fri Sep 3 11:24:21 2021 -0400 scsi: mpt3sas: Use irq_set_affinity_and_hint() The driver uses irq_set_affinity_hint() specifically for the high IOPS queue interrupts for two purposes: - To set the affinity_hint which is consumed by the userspace for distributing the interrupts - To apply an affinity that it provides The driver enforces its own affinity to bind the high IOPS queue interrupts to the local NUMA node. However, irq_set_affinity_hint() applying the provided cpumask as an affinity (if not NULL) for the interrupt is an undocumented side effect. To remove this side effect irq_set_affinity_hint() has been marked as deprecated and new interfaces have been introduced. Hence, replace the irq_set_affinity_hint() with the new interface irq_set_affinity_and_hint() where the provided mask needs to be applied as the affinity and affinity_hint pointer needs to be set and replace with irq_update_affinity_hint() where only affinity_hint needs to be updated. Signed-off-by: Nitesh Narayan Lal Signed-off-by: Thomas Gleixner Reviewed-by: Sreekanth Reddy Link: https://lore.kernel.org/r/20210903152430.244937-6-nitesh@redhat.com commit 8049da6f3943d0ac51931b8064b2e4769a69a967 Author: Nitesh Narayan Lal Date: Fri Sep 3 11:24:20 2021 -0400 scsi: megaraid_sas: Use irq_set_affinity_and_hint() The driver uses irq_set_affinity_hint() specifically for the high IOPS queue interrupts for two purposes: - To set the affinity_hint which is consumed by the userspace for distributing the interrupts - To apply an affinity that it provides The driver enforces its own affinity to bind the high IOPS queue interrupts to the local NUMA node. However, irq_set_affinity_hint() applying the provided cpumask as an affinity for the interrupt is an undocumented side effect. To remove this side effect irq_set_affinity_hint() has been marked as deprecated and new interfaces have been introduced. Hence, replace the irq_set_affinity_hint() with the new interface irq_set_affinity_and_hint() where the provided mask needs to be applied as the affinity and affinity_hint pointer needs to be set and replace with irq_update_affinity_hint() where only affinity_hint needs to be updated. Change the megasas_set_high_iops_queue_affinity_hint function name to megasas_set_high_iops_queue_affinity_and_hint to clearly indicate that the function is setting both affinity and affinity_hint. Signed-off-by: Nitesh Narayan Lal Signed-off-by: Thomas Gleixner Acked-by: Sumit Saxena Link: https://lore.kernel.org/r/20210903152430.244937-5-nitesh@redhat.com commit d34c54d1739c2cdf2e4437b74e6da269147f4987 Author: Nitesh Narayan Lal Date: Fri Sep 3 11:24:19 2021 -0400 i40e: Use irq_update_affinity_hint() The driver uses irq_set_affinity_hint() for two purposes: - To set the affinity_hint which is consumed by the userspace for distributing the interrupts - To apply an affinity that it provides for the i40e interrupts The latter is done to ensure that all the interrupts are evenly spread across all available CPUs. However, since commit a0c9259dc4e1 ("irq/matrix: Spread interrupts on allocation") the spreading of interrupts is dynamically performed at the time of allocation. Hence, there is no need for the drivers to enforce their own affinity for the spreading of interrupts. Also, irq_set_affinity_hint() applying the provided cpumask as an affinity for the interrupt is an undocumented side effect. To remove this side effect irq_set_affinity_hint() has been marked as deprecated and new interfaces have been introduced. Hence, replace the irq_set_affinity_hint() with the new interface irq_update_affinity_hint() that only sets the pointer for the affinity_hint. Signed-off-by: Nitesh Narayan Lal Signed-off-by: Thomas Gleixner Acked-by: Jesse Brandeburg Link: https://lore.kernel.org/r/20210903152430.244937-4-nitesh@redhat.com commit 0f9744f4ed539f2e847d7ed41993b243e3ba5cff Author: Nitesh Narayan Lal Date: Fri Sep 3 11:24:18 2021 -0400 iavf: Use irq_update_affinity_hint() The driver uses irq_set_affinity_hint() for two purposes: - To set the affinity_hint which is consumed by the userspace for distributing the interrupts - To apply an affinity that it provides for the iavf interrupts The latter is done to ensure that all the interrupts are evenly spread across all available CPUs. However, since commit a0c9259dc4e1 ("irq/matrix: Spread interrupts on allocation") the spreading of interrupts is dynamically performed at the time of allocation. Hence, there is no need for the drivers to enforce their own affinity for the spreading of interrupts. Also, irq_set_affinity_hint() applying the provided cpumask as an affinity for the interrupt is an undocumented side effect. To remove this side effect irq_set_affinity_hint() has been marked as deprecated and new interfaces have been introduced. Hence, replace the irq_set_affinity_hint() with the new interface irq_update_affinity_hint() that only sets the pointer for the affinity_hint. Signed-off-by: Nitesh Narayan Lal Signed-off-by: Thomas Gleixner Acked-by: Jesse Brandeburg Link: https://lore.kernel.org/r/20210903152430.244937-3-nitesh@redhat.com commit 65c7cdedeb3026fabcc967a7aae2f755ad4d0783 Author: Thomas Gleixner Date: Fri Sep 3 11:24:17 2021 -0400 genirq: Provide new interfaces for affinity hints The discussion about removing the side effect of irq_set_affinity_hint() of actually applying the cpumask (if not NULL) as affinity to the interrupt, unearthed a few unpleasantries: 1) The modular perf drivers rely on the current behaviour for the very wrong reasons. 2) While none of the other drivers prevents user space from changing the affinity, a cursorily inspection shows that there are at least expectations in some drivers. #1 needs to be cleaned up anyway, so that's not a problem #2 might result in subtle regressions especially when irqbalanced (which nowadays ignores the affinity hint) is disabled. Provide new interfaces: irq_update_affinity_hint() - Only sets the affinity hint pointer irq_set_affinity_and_hint() - Set the pointer and apply the affinity to the interrupt Make irq_set_affinity_hint() a wrapper around irq_apply_affinity_hint() and document it to be phased out. Signed-off-by: Thomas Gleixner Signed-off-by: Nitesh Narayan Lal Signed-off-by: Thomas Gleixner Reviewed-by: Ming Lei Link: https://lore.kernel.org/r/20210501021832.743094-1-jesse.brandeburg@intel.com Link: https://lore.kernel.org/r/20210903152430.244937-2-nitesh@redhat.com commit db10415448158779127ad529335e2c447c5767c1 Author: Ye Guojin Date: Fri Dec 10 07:14:24 2021 +0000 selftests: mptcp: remove duplicate include in mptcp_inq.c 'sys/ioctl.h' included in 'mptcp_inq.c' is duplicated. Reported-by: ZealRobot Signed-off-by: Ye Guojin Reviewed-by: Matthieu Baerts Link: https://lore.kernel.org/r/20211210071424.425773-1-ye.guojin@zte.com.cn Signed-off-by: Jakub Kicinski commit bc7aaf52f963674690510e6c1f3710cd0394b25e Author: Kees Cook Date: Fri Nov 19 09:53:25 2021 -0800 x86/boot/string: Add missing function prototypes Silence "warning: no previous prototype for ... [-Wmissing-prototypes]" warnings from string.h when building under W=1. [ bp: Clarify commit message. ] Signed-off-by: Kees Cook Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20211119175325.3668419-1-keescook@chromium.org commit 386a74677be13175b5626f094ef37808c45f48b8 Author: Yunfeng Ye Date: Thu Dec 9 09:46:03 2021 +0800 arm64: mm: Use asid feature macro for cheanup The commit 95b54c3e4c92 ("KVM: arm64: Add feature register flag definitions") introduce the ID_AA64MMFR0_ASID_8 and ID_AA64MMFR0_ASID_16 macros. We can use these macros for cheanup in get_cpu_asid_bits(). No functional change. Signed-off-by: Yunfeng Ye Reviewed-by: Kefeng Wang Link: https://lore.kernel.org/r/f71c75d3-735e-b32a-8414-b3e513c77240@huawei.com Signed-off-by: Catalin Marinas commit a3a5b763410c7bceacf41a52071134d9dc26202a Author: Yunfeng Ye Date: Thu Dec 9 09:42:25 2021 +0800 arm64: mm: Rename asid2idx() to ctxid2asid() The commit 0c8ea531b774 ("arm64: mm: Allocate ASIDs in pairs") introduce the asid2idx and idx2asid macro, but these macros are not really useful after the commit f88f42f853a8 ("arm64: context: Free up kernel ASIDs if KPTI is not in use"). The code "(asid & ~ASID_MASK)" can be instead by a macro, which is the same code with asid2idx(). So rename it to ctxid2asid() for a better understanding. Also we add asid2ctxid() macro, the contextid can be generated based on the asid and generation through this macro. Signed-off-by: Yunfeng Ye Reviewed-by: Kefeng Wang Link: https://lore.kernel.org/r/c31516eb-6d15-94e0-421c-305fc010ea79@huawei.com Signed-off-by: Catalin Marinas commit 20735d24adfe73c62f9482ae5b4f29cc5e00bbe8 Author: Shaokun Zhang Date: Thu Dec 9 09:55:50 2021 +0800 x86/fpu: Remove duplicate copy_fpstate_to_sigframe() prototype The function prototype of copy_fpstate_to_sigframe() is declared twice in 0ae67cc34f76 ("x86/fpu: Remove internal.h dependency from fpu/signal.h"). Remove one of them. [ bp: Massage ] Signed-off-by: Shaokun Zhang Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20211209015550.51916-1-zhangshaokun@hisilicon.com commit 61646ca83d3889696f2772edaff122dd96a2935e Author: Kees Cook Date: Wed Dec 8 20:34:56 2021 -0800 x86/uaccess: Move variable into switch case statement When building with automatic stack variable initialization, GCC 12 complains about variables defined outside of switch case statements. Move the variable into the case that uses it, which silences the warning: ./arch/x86/include/asm/uaccess.h:317:23: warning: statement will never be executed [-Wswitch-unreachable] 317 | unsigned char x_u8__; \ | ^~~~~~ Fixes: 865c50e1d279 ("x86/uaccess: utilize CONFIG_CC_HAS_ASM_GOTO_OUTPUT") Signed-off-by: Kees Cook Signed-off-by: Dave Hansen Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20211209043456.1377875-1-keescook@chromium.org commit e1b539bd73a76dc8a7bf82befe6eac4ae79c76b3 Author: Eric Dumazet Date: Thu Dec 9 07:44:51 2021 -0800 xfrm: add net device refcount tracker to struct xfrm_state_offload Signed-off-by: Eric Dumazet Acked-by: Steffen Klassert Link: https://lore.kernel.org/r/20211209154451.4184050-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit e1a6333e7f89ad6acef9e818c2500c2e5393536e Author: Vihas Mak Date: Fri Dec 10 03:06:18 2021 +0530 PCI: ibmphp: Remove commented-out functions The functions get_max_adapter_speed() and get_bus_name() in ibmphp_core.c are commented-out and the fields .get_max_adapter_speed and .get_bus_name_status are removed from struct hotplug_slot_ops in pci_hotplug.h. Remove the commented-out functions. Link: https://lore.kernel.org/r/20211209213618.20522-1-makvihas@gmail.com Signed-off-by: Vihas Mak Signed-off-by: Bjorn Helgaas commit 6f89f413340f548179eb33ce3b0758ceee01371f Author: Geert Uytterhoeven Date: Wed Dec 8 11:30:03 2021 +0100 dt-bindings: at24: Rework special case compatible handling Sort the compatible values for the special cases by EEPROM size, like is done for the normal cases. Combine entries with a common fallback using enums, to compact the table. Signed-off-by: Geert Uytterhoeven Signed-off-by: Bartosz Golaszewski commit ab39d6988dd53f354130438d8afa5596a2440fed Author: Iwona Winiarska Date: Sat Dec 4 18:10:27 2021 +0100 gpio: aspeed-sgpio: Convert aspeed_sgpio.lock to raw_spinlock The gpio-aspeed-sgpio driver implements an irq_chip which need to be invoked from hardirq context. Since spin_lock() can sleep with PREEMPT_RT, it is no longer legal to invoke it while interrupts are disabled. This also causes lockdep to complain about: [ 25.919465] [ BUG: Invalid wait context ] because aspeed_sgpio.lock (spin_lock_t) is taken under irq_desc.lock (raw_spinlock_t). Let's use of raw_spinlock_t instead of spinlock_t. Signed-off-by: Iwona Winiarska Signed-off-by: Bartosz Golaszewski commit 61a7904b6ace99b1bde0d0e867fa3097f5c8cee2 Author: Iwona Winiarska Date: Sat Dec 4 18:10:26 2021 +0100 gpio: aspeed: Convert aspeed_gpio.lock to raw_spinlock The gpio-aspeed driver implements an irq_chip which need to be invoked from hardirq context. Since spin_lock() can sleep with PREEMPT_RT, it is no longer legal to invoke it while interrupts are disabled. This also causes lockdep to complain about: [ 0.649797] [ BUG: Invalid wait context ] because aspeed_gpio.lock (spin_lock_t) is taken under irq_desc.lock (raw_spinlock_t). Let's use of raw_spinlock_t instead of spinlock_t. Signed-off-by: Iwona Winiarska Signed-off-by: Bartosz Golaszewski commit 7a334a28a14bf8b8812bb2e626a6280ad0d21f4e Author: Heiko Carstens Date: Thu Dec 2 20:58:07 2021 +0100 s390/ap: add missing virt_to_phys address conversion The address of the notification-indicator byte is an absolute address. Therefore convert its virtual to a physical address before being used with PQAP(AQIC). Note: this currently doesn't fix a real bug, since virtual addresses are indentical to physical ones. Reviewed-by: Alexander Gordeev Reviewed-by: Harald Freudenberger Signed-off-by: Heiko Carstens commit da001fce26bec9b5933162b32b3cc65923ad6c17 Author: Heiko Carstens Date: Thu Dec 9 12:01:25 2021 +0100 s390/pgalloc: use pointers instead of unsigned long values After adding the missing __va()/__pa() calls to the base asce functions there are even more casts in the code than before. Make the code more readable by passing and using pointers to page tables, instead of using unsigned values for the same purpose. This allows to get rid of nearly all casts within the code. Suggested-by: Alexander Gordeev Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens commit 2f882800f6ab57b50b7c23a376a452a808025f37 Author: Heiko Carstens Date: Tue Dec 7 20:06:21 2021 +0100 s390/pgalloc: add virt/phys address handling to base asce functions The base asce functions create/free page tables open-coded to make sure that the returned asce and page tables do not make use of any enhanced DAT features like e.g. large pages. This is required for some I/O functions that use an asce, like e.g. some service call requests. Handling of virtual vs physical addresses is missing; therefore add that now. Note: this currently doesn't fix a real bug, since virtual addresses are indentical to physical ones. Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens commit 69700fb4389839dae84024b39a02cab844651122 Author: Heiko Carstens Date: Tue Dec 7 19:24:00 2021 +0100 s390/cmm: add missing virt_to_phys() conversion diag10_range() expects a pfn, however the current cmm code is shifting a virtual address, instead of a physical address by PAGE_SHIFT bits, which would give a wrong result in case if V!=R. Use virt_to_pfn() to fix this. Note: this currently doesn't fix a real bug, since virtual addresses are indentical to physical ones. Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens commit 9d6305c2a116f4ea3160730df8cf83d13d629b87 Author: Heiko Carstens Date: Tue Dec 7 19:19:48 2021 +0100 s390/diag: use pfn_to_phys() instead of open coding Use pfn_to_phys() instead of open coding to make it clear what the code is doing. Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens commit d2f2949ab6b60fc53134908d0ffc140ef50e5a1b Author: Heiko Carstens Date: Mon Dec 6 18:55:21 2021 +0100 s390/mm: add missing phys_to_virt translation to page table dumper The page table dumper walks page table tables without using standard page table primitives in order to also dump broken entries. However it currently does not translate physical to virtual addresses before dereferencing them. Therefore add this missing translation. Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens commit 3f43926f271287fb1744c9ac9ae1122497f2b0c2 Author: Christophe JAILLET Date: Wed Nov 17 23:05:23 2021 +0100 i3c/master/mipi-i3c-hci: Fix a potentially infinite loop in 'hci_dat_v1_get_index()' The code in 'hci_dat_v1_get_index()' really looks like a hand coded version of 'for_each_set_bit()', except that a +1 is missing when searching for the next set bit. This really looks odd and it seems that it will loop until 'dat_w0_read()' returns the expected result. So use 'for_each_set_bit()' instead. It is less verbose and should be more correct. Fixes: 9ad9a52cce28 ("i3c/master: introduce the mipi-i3c-hci driver") Signed-off-by: Christophe JAILLET Acked-by: Nicolas Pitre Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/0cdf3cb10293ead1acd271fdb8a70369c298c082.1637186628.git.christophe.jaillet@wanadoo.fr commit f18f98110f2b179792cb70d85cba697320a3790f Author: Jamie Iles Date: Wed Sep 22 17:56:00 2021 +0100 i3c: fix incorrect address slot lookup on 64-bit The address slot bitmap is an array of unsigned long's which are the same size as an int on 32-bit platforms but not 64-bit. Loading the bitmap into an int could result in the incorrect status being returned for a slot and slots being reported as the wrong status. Fixes: 3a379bbcea0a ("i3c: Add core I3C infrastructure") Cc: Boris Brezillon Cc: Alexandre Belloni Signed-off-by: Jamie Iles Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20210922165600.179394-1-quic_jiles@quicinc.com commit 313ece22600bcda85aa654af42628385abff215f Author: Len Baker Date: Sun Sep 12 17:51:35 2021 +0200 i3c/master/mipi-i3c-hci: Prefer kcalloc over open coded arithmetic As noted in the "Deprecated Interfaces, Language Features, Attributes, and Conventions" documentation [1], size calculations (especially multiplication) should not be performed in memory allocator (or similar) function arguments due to the risk of them overflowing. This could lead to values wrapping around and a smaller allocation being made than the caller was expecting. Using those allocations could lead to linear overflows of heap memory and other misbehaviors. So, use the purpose specific kcalloc() function instead of the argument size * count in the kzalloc() function. [1] https://www.kernel.org/doc/html/v5.14/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments Signed-off-by: Len Baker Acked-by: Nicolas Pitre Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20210912155135.7541-1-len.baker@gmx.com commit f96b2e77f6d1b0c5181e0eae3dc60a00a5cd692a Author: Len Baker Date: Sun Sep 5 16:40:54 2021 +0200 i3c/master/mipi-i3c-hci: 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 Acked-by: Nicolas Pitre Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20210905144054.5124-1-len.baker@gmx.com commit 3d20408dff9c0885591c8e1d31a67e9183f0cc8a Merge: e5d75fc20b927 11b311a867b6b Author: Jakub Kicinski Date: Fri Dec 10 06:38:30 2021 -0800 Merge branch 'net-netns-refcount-tracking-base-series' Eric Dumazet says: ==================== net: netns refcount tracking, base series We have 100+ syzbot reports about netns being dismantled too soon, still unresolved as of today. We think a missing get_net() or an extra put_net() is the root cause. In order to find the bug(s), and be able to spot future ones, this patch adds CONFIG_NET_NS_REFCNT_TRACKER and new helpers to precisely pair all put_net() with corresponding get_net(). To use these helpers, each data structure owning a refcount should also use a "netns_tracker" to pair the get() and put(). Small sections of codes where the get()/put() are in sight do not need to have a tracker, because they are short lived, but in theory it is also possible to declare an on-stack tracker. v2: Include core networking patches only. ==================== Link: https://lore.kernel.org/r/20211210074426.279563-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit 11b311a867b6b3208fdc3cee8a780f14659bf5f9 Author: Eric Dumazet Date: Thu Dec 9 23:44:26 2021 -0800 ppp: add netns refcount tracker Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 285ec2fef4b87ba26400658b003ca9c76278d960 Author: Eric Dumazet Date: Thu Dec 9 23:44:25 2021 -0800 l2tp: add netns refcount tracker to l2tp_dfs_seq_data Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit dbdcda634ce384938805549bd1b3f3eaed50af5e Author: Eric Dumazet Date: Thu Dec 9 23:44:24 2021 -0800 net: sched: add netns refcount tracker to struct tcf_exts Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 04a931e58d1944ab3d1e11fdfde1947fbe5b6a37 Author: Eric Dumazet Date: Thu Dec 9 23:44:23 2021 -0800 net: add netns refcount tracker to struct seq_net_private Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit ffa84b5ffb37a957d6062385112ab1069f760de6 Author: Eric Dumazet Date: Thu Dec 9 23:44:22 2021 -0800 net: add netns refcount tracker to struct sock Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 9ba74e6c9e9d0c5c1e5792a7111fc7d1a0589cb8 Author: Eric Dumazet Date: Thu Dec 9 23:44:21 2021 -0800 net: add networking namespace refcount tracker We have 100+ syzbot reports about netns being dismantled too soon, still unresolved as of today. We think a missing get_net() or an extra put_net() is the root cause. In order to find the bug(s), and be able to spot future ones, this patch adds CONFIG_NET_NS_REFCNT_TRACKER and new helpers to precisely pair all put_net() with corresponding get_net(). To use these helpers, each data structure owning a refcount should also use a "netns_tracker" to pair the get and put. Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit d2d1d2645cfd7230fd958fddbc5e7525c34f1374 Author: Mark Rutland Date: Mon Nov 29 14:28:49 2021 +0000 arm64: Make some stacktrace functions private Now that open-coded stack unwinds have been converted to arch_stack_walk(), we no longer need to expose any of unwind_frame(), walk_stackframe(), or start_backtrace() outside of stacktrace.c. Make those functions private to stacktrace.c, removing their prototypes from and marking them static. Signed-off-by: Mark Rutland Reviewed-by: Mark Brown Cc: Madhavan T. Venkataraman Link: https://lore.kernel.org/r/20211129142849.3056714-10-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 2dad6dc17bd0cefd03b42147c6fc9bbd81f7928a Author: Madhavan T. Venkataraman Date: Mon Nov 29 14:28:48 2021 +0000 arm64: Make dump_backtrace() use arch_stack_walk() To enable RELIABLE_STACKTRACE and LIVEPATCH on arm64, we need to substantially rework arm64's unwinding code. As part of this, we want to minimize the set of unwind interfaces we expose, and avoid open-coding of unwind logic. Currently, dump_backtrace() walks the stack of the current task or a blocked task by calling stact_backtrace() and iterating unwind steps using unwind_frame(). This can be written more simply in terms of arch_stack_walk(), considering three distinct cases: 1) When unwinding a blocked task, start_backtrace() is called with the blocked task's saved PC and FP, and the unwind proceeds immediately from this point without skipping any entries. This is functionally equivalent to calling arch_stack_walk() with the blocked task, which will start with the task's saved PC and FP. There is no functional change to this case. 2) When unwinding the current task without regs, start_backtrace() is called with dump_backtrace() as the PC and __builtin_frame_address(0) as the next frame, and the unwind proceeds immediately without skipping. This is *almost* functionally equivalent to calling arch_stack_walk() for the current task, which will start with its caller (i.e. an offset into dump_backtrace()) as the PC, and the callers frame record as the next frame. The only difference being that dump_backtrace() will be reported with an offset (which is strictly more correct than currently). Otherwise there is no functional cahnge to this case. 3) When unwinding the current task with regs, start_backtrace() is called with dump_backtrace() as the PC and __builtin_frame_address(0) as the next frame, and the unwind is performed silently until the next frame is the frame pointed to by regs->fp. Reporting starts from regs->pc and continues from the frame in regs->fp. Historically, this pre-unwind was necessary to correctly record return addresses rewritten by the ftrace graph calller, but this is no longer necessary as these are now recovered using the FP since commit: c6d3cd32fd0064af ("arm64: ftrace: use HAVE_FUNCTION_GRAPH_RET_ADDR_PTR") This pre-unwind is not necessary to recover return addresses rewritten by kretprobes, which historically were not recovered, and are now recovered using the FP since commit: cd9bc2c9258816dc ("arm64: Recover kretprobe modified return address in stacktrace") Thus, this is functionally equivalent to calling arch_stack_walk() with the current task and regs, which will start with regs->pc as the PC and regs->fp as the next frame, without a pre-unwind. This patch makes dump_backtrace() use arch_stack_walk(). This simplifies dump_backtrace() and will permit subsequent changes to the unwind code. Aside from the improved reporting when unwinding current without regs, there should be no functional change as a result of this patch. Signed-off-by: Madhavan T. Venkataraman [Mark: elaborate commit message] Signed-off-by: Mark Rutland Reviewed-by: Mark Brown Link: https://lore.kernel.org/r/20211129142849.3056714-9-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 22ecd975b61d3645ce8f19a95369357f04a25f0b Author: Madhavan T. Venkataraman Date: Mon Nov 29 14:28:47 2021 +0000 arm64: Make profile_pc() use arch_stack_walk() To enable RELIABLE_STACKTRACE and LIVEPATCH on arm64, we need to substantially rework arm64's unwinding code. As part of this, we want to minimize the set of unwind interfaces we expose, and avoid open-coding of unwind logic outside of stacktrace.c. Currently profile_pc() walks the stack of an interrupted context by calling start_backtrace() with the context's PC and FP, and iterating unwind steps using walk_stackframe(). This is functionally equivalent to calling arch_stack_walk() with the interrupted context's pt_regs, which will start with the PC and FP from the regs. Make profile_pc() use arch_stack_walk(). This simplifies profile_pc(), and in future will alow us to make walk_stackframe() private to stacktrace.c. At the same time, we remove the early return for when regs->pc is not in lock functions, as this will be handled by the first call to the profile_pc_cb() callback. There should be no functional change as a result of this patch. Signed-off-by: Madhavan T. Venkataraman Reviewed-by: Mark Rutland [Mark: remove early return, elaborate commit message, fix includes] Signed-off-by: Mark Rutland Reviewed-by: Mark Brown Link: https://lore.kernel.org/r/20211129142849.3056714-8-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 39ef362d2d45171e941457f8cd00518bfcedfe2b Author: Madhavan T. Venkataraman Date: Mon Nov 29 14:28:46 2021 +0000 arm64: Make return_address() use arch_stack_walk() To enable RELIABLE_STACKTRACE and LIVEPATCH on arm64, we need to substantially rework arm64's unwinding code. As part of this, we want to minimize the set of unwind interfaces we expose, and avoid open-coding of unwind logic outside of stacktrace.c. Currently return_address() walks the stack of the current task by calling start_backtrace() with return_address as the PC and the frame pointer of return_address() as the next frame, iterating unwind steps using walk_stackframe(). This is functionally equivalent to calling arch_stack_walk() for the current stack, which will start from its caller (i.e. return_address()) as the PC and it's caller's frame record as the next frame. Make return_address() use arch_stackwalk(). This simplifies return_address(), and in future will alow us to make walk_stackframe() private to stacktrace.c. There should be no functional change as a result of this patch. Signed-off-by: Madhavan T. Venkataraman Tested-by: Mark Rutland Reviewed-by: Mark Brown Reviewed-by: Mark Rutland [Mark: elaborate commit message, fix includes] Signed-off-by: Mark Rutland Link: https://lore.kernel.org/r/20211129142849.3056714-7-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 4f62bb7cb165f3e7b0a91279fe9dd5c56daf3457 Author: Madhavan T. Venkataraman Date: Mon Nov 29 14:28:45 2021 +0000 arm64: Make __get_wchan() use arch_stack_walk() To enable RELIABLE_STACKTRACE and LIVEPATCH on arm64, we need to substantially rework arm64's unwinding code. As part of this, we want to minimize the set of unwind interfaces we expose, and avoid open-coding of unwind logic outside of stacktrace.c. Currently, __get_wchan() walks the stack of a blocked task by calling start_backtrace() with the task's saved PC and FP values, and iterating unwind steps using unwind_frame(). The initialization is functionally equivalent to calling arch_stack_walk() with the blocked task, which will start with the task's saved PC and FP values. Currently __get_wchan() always performs an initial unwind step, which will stkip __switch_to(), but as this is now marked as a __sched function, this no longer needs special handling and will be skipped in the same way as other sched functions. Make __get_wchan() use arch_stack_walk(). This simplifies __get_wchan(), and in future will alow us to make unwind_frame() private to stacktrace.c. At the same time, we can simplify the try_get_task_stack() check and avoid the unnecessary `stack_page` variable. The change to the skipping logic means we may terminate one frame earlier than previously where there are an excessive number of sched functions in the trace, but this isn't seen in practice, and wchan is best-effort anyway, so this should not be a problem. Other than the above, there should be no functional change as a result of this patch. Signed-off-by: Madhavan T. Venkataraman [Mark: rebase atop wchan changes, elaborate commit message, fix includes] Signed-off-by: Mark Rutland Reviewed-by: Mark Brown Link: https://lore.kernel.org/r/20211129142849.3056714-6-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit ed876d35a1dc7f9efcfc51dd06843b5b8af08ad1 Author: Madhavan T. Venkataraman Date: Mon Nov 29 14:28:44 2021 +0000 arm64: Make perf_callchain_kernel() use arch_stack_walk() To enable RELIABLE_STACKTRACE and LIVEPATCH on arm64, we need to substantially rework arm64's unwinding code. As part of this, we want to minimize the set of unwind interfaces we expose, and avoid open-coding of unwind logic outside of stacktrace.c. Currently perf_callchain_kernel() walks the stack of an interrupted context by calling start_backtrace() with the context's PC and FP, and iterating unwind steps using walk_stackframe(). This is functionally equivalent to calling arch_stack_walk() with the interrupted context's pt_regs, which will start with the PC and FP from the regs. Make perf_callchain_kernel() use arch_stack_walk(). This simplifies perf_callchain_kernel(), and in future will alow us to make walk_stackframe() private to stacktrace.c. At the same time, we update the callchain_trace() callback to check the return value of perf_callchain_store(), which indicates whether there is space for any further entries. When a non-zero value is returned, further calls will be ignored, and are redundant, so we can stop the unwind at this point. We also remove the stale and confusing comment for callchain_trace. There should be no functional change as a result of this patch. Signed-off-by: Madhavan T. Venkataraman Tested-by: Mark Rutland Reviewed-by: Mark Brown Reviewed-by: Mark Rutland [Mark: elaborate commit message, remove comment, fix includes] Signed-off-by: Mark Rutland Link: https://lore.kernel.org/r/20211129142849.3056714-5-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 86bcbafcb726b7b11898d2d6269bd665cb27c1b9 Author: Mark Rutland Date: Mon Nov 29 14:28:43 2021 +0000 arm64: Mark __switch_to() as __sched Unlike most architectures (and only in keeping with powerpc), arm64 has a non __sched() function on the path to our cpu_switch_to() assembly function. It is expected that for a blocked task, in_sched_functions() can be used to skip all functions between the raw context switch assembly and the scheduler functions that call into __switch_to(). This is the behaviour expected by stack_trace_consume_entry_nosched(), and the behaviour we'd like to have such that we an simplify arm64's __get_wchan() implementation to use arch_stack_walk(). This patch mark's arm64's __switch_to as __sched. This *will not* change the behaviour of arm64's current __get_wchan() implementation, which always performs an initial unwind step which skips __switch_to(). This *will* change the behaviour of stack_trace_consume_entry_nosched() and stack_trace_save_tsk() to match their expected behaviour on blocked tasks, skipping all scheduler-internal functions including __switch_to(). Other than the above, there should be no functional change as a result of this patch. Signed-off-by: Mark Rutland Cc: Madhavan T. Venkataraman Cc: Peter Zijlstra Cc: Will Deacon Reviewed-by: Mark Brown Link: https://lore.kernel.org/r/20211129142849.3056714-4-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 1e5428b2b7e8aef6a1d10a33fa15df427f087450 Author: Mark Rutland Date: Mon Nov 29 14:28:42 2021 +0000 arm64: Add comment for stack_info::kr_cur We added stack_info::kr_cur in commit: cd9bc2c9258816dc ("arm64: Recover kretprobe modified return address in stacktrace") ... but didn't add anything in the corresponding comment block. For consistency, add a corresponding comment. Signed-off-by: Mark Rutland Reviwed-by: Mark Brown Reviewed-by: Masami Hiramatsu Cc: Steven Rostedt (VMware) Cc: Will Deacon Link: https://lore.kernel.org/r/20211129142849.3056714-3-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 1614b2b11fab29dd4ff31ebba9d266961f5af69e Author: Peter Zijlstra Date: Mon Nov 29 14:28:41 2021 +0000 arch: Make ARCH_STACKWALK independent of STACKTRACE Make arch_stack_walk() available for ARCH_STACKWALK architectures without it being entangled in STACKTRACE. Link: https://lore.kernel.org/lkml/20211022152104.356586621@infradead.org/ Signed-off-by: Peter Zijlstra (Intel) [Mark: rebase, drop unnecessary arm change] Signed-off-by: Mark Rutland Cc: Albert Ou Cc: Borislav Petkov Cc: Christian Borntraeger Cc: Dave Hansen Cc: Heiko Carstens Cc: Ingo Molnar Cc: Michael Ellerman Cc: Palmer Dabbelt Cc: Paul Walmsley Cc: Thomas Gleixner Cc: Vasily Gorbik Link: https://lore.kernel.org/r/20211129142849.3056714-2-mark.rutland@arm.com Signed-off-by: Catalin Marinas commit 7afccde389dcfaca793a0d909f8cb7412e1d1dbe Author: Rongwei Wang Date: Fri Nov 26 01:06:00 2021 +0800 arm64: kexec: reduce calls to page_address() In kexec_page_alloc(), page_address() is called twice. This patch add a new variable to help to reduce calls to page_address(). Signed-off-by: Rongwei Wang Link: https://lore.kernel.org/r/20211125170600.1608-3-rongwei.wang@linux.alibaba.com Signed-off-by: Catalin Marinas commit e2be5955a88664421b25e463c28a910b8dbd534c Author: Yazen Ghannam Date: Wed Dec 8 17:43:54 2021 +0000 EDAC/amd64: Add support for AMD Family 19h Models 10h-1Fh and A0h-AFh Add a new family type for AMD Family 19h Models 10h to 1Fh. Use this new family type for Models A0h to AFh also. Increase the maximum number of controllers from 8 to 12. Signed-off-by: Yazen Ghannam Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20211208174356.1997855-3-yazen.ghannam@amd.com commit f95711242390d759f69fd67ad46b31491fe904d6 Author: Yazen Ghannam Date: Wed Dec 8 17:43:53 2021 +0000 EDAC: Add RDDR5 and LRDDR5 memory types Include Registered-DDR5 and Load-Reduced DDR5 in the list of memory types. Signed-off-by: Yazen Ghannam Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20211208174356.1997855-2-yazen.ghannam@amd.com commit 1c66496b1391699040d0ddda21fe1979865f6eba Author: Kevin Tang Date: Tue Dec 7 22:27:17 2021 +0800 drm/sprd: add Unisoc's drm mipi dsi&dphy driver Adds dsi host controller support for the Unisoc's display subsystem. Adds dsi phy support for the Unisoc's display subsystem. Only MIPI DSI Displays supported, DP/TV/HMDI will be support in the feature. v1: - Remove dphy and dsi graph binding, merge the dphy driver into the dsi. v2: - Use drm_xxx to replace all DRM_XXX. - Use kzalloc to replace devm_kzalloc for sprd_dsi structure init. v4: - Use drmm_helpers to allocate encoder. - Move allocate encoder and connector to bind function. v5: - Drop the dsi ip file prefix. - Fix the checkpatch warnings. - Add Signed-off-by for dsi&dphy patch. - Use the mode_flags of mipi_dsi_device to setup crtc DPI and EDPI mode. v6: - Redesign the way to access the dsi register. - Reduce the dsi_context member variables. v7: - Fix codeing style issue by checkpatch. - Drop the pll registers structure define. - Use bridge API instead of drm panel API. - Register mipi_dsi_host on probe phase; - Remove some unused function. v8: - Fix missing signed-off-by. - Move component_add to dsi_host.attach callback. Cc: Orson Zhai Cc: Chunyan Zhang Signed-off-by: Kevin Tang Signed-off-by: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/20211207142717.30296-7-kevin3.tang@gmail.com commit 2295bbd35edb19248162ebc6c1acce1255ae7db6 Author: Kevin Tang Date: Tue Dec 7 22:27:16 2021 +0800 dt-bindings: display: add Unisoc's mipi dsi controller bindings Adds MIPI DSI Controller support for Unisoc's display subsystem. v5: - Remove panel_in port for dsi node. Cc: Orson Zhai Cc: Chunyan Zhang Signed-off-by: Kevin Tang Reviewed-by: Rob Herring Signed-off-by: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/20211207142717.30296-6-kevin3.tang@gmail.com commit b07bcf34b6c98a7dd540c94e804c39a4273da37c Author: Kevin Tang Date: Tue Dec 7 22:27:15 2021 +0800 drm/sprd: add Unisoc's drm display controller driver Adds DPU(Display Processor Unit) support for the Unisoc's display subsystem. It's support multi planes, scaler, rotation, PQ(Picture Quality) and more. v2: - Use drm_xxx to replace all DRM_XXX. - Use kzalloc to replace devm_kzalloc for sprd_dpu structure init. v3: - Remove dpu_layer stuff layer and commit layers by aotmic_update v4: - Use drmm_helpers to allocate crtc and planes. - Move rotation enum definitions to crtc layer reg bitfields. - Move allocate crtc and planes to bind function. v5: - Fix the checkpatch warnings. - Use mode_set_nofb instead of mode_valid callback. - Follow the OF-Graph bindings, use of_graph_get_port_by_id instead of of_parse_phandle. - Use zpos to represent the layer position. - Rebase to last drm misc branch. v6: - Disable and clear interrupts before register dpu IRQ - Init dpi config used by crtc_state->adjusted_mode on mode_set_nofb - Remove enable_irq and disable_irq function call. - Remove drm_format_info function call. v7: - Remove iommu error interrupt handling function. Cc: Orson Zhai Cc: Chunyan Zhang Signed-off-by: Kevin Tang Reviewed-by: Maxime Ripard Signed-off-by: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/20211207142717.30296-5-kevin3.tang@gmail.com commit 8cae15c60cf00961536765040c4e2d7046f4882e Author: Kevin Tang Date: Tue Dec 7 22:27:14 2021 +0800 dt-bindings: display: add Unisoc's dpu bindings DPU (Display Processor Unit) is the Display Controller for the Unisoc SoCs which transfers the image data from a video memory buffer to an internal LCD interface. Cc: Orson Zhai Cc: Chunyan Zhang Signed-off-by: Kevin Tang Reviewed-by: Rob Herring Signed-off-by: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/20211207142717.30296-4-kevin3.tang@gmail.com commit 43531edd53f07cbe977a0b33dea6dd6c29b21fea Author: Kevin Tang Date: Tue Dec 7 22:27:13 2021 +0800 drm/sprd: add Unisoc's drm kms master Adds drm support for the Unisoc's display subsystem. This is drm kms driver, this driver provides support for the application framework in Android, Yocto and more. Application framework can access Unisoc's display internal peripherals through libdrm or libkms, it's test ok by modetest (DRM/KMS test tool) and Android HWComposer. v4: - Move the devm_drm_dev_alloc to master_ops->bind function. - The managed drmm_mode_config_init() it is no longer necessary for drivers to explicitly call drm_mode_config_cleanup, so delete it. v5: - Remove subdir-ccflgas-y for Makefile. - Keep the selects sorted by alphabet for Kconfig. Cc: Orson Zhai Cc: Chunyan Zhang Signed-off-by: Kevin Tang Signed-off-by: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/20211207142717.30296-3-kevin3.tang@gmail.com commit 35400e5ad48d8d5f6862a375aafb6bf56ad95533 Author: Kevin Tang Date: Tue Dec 7 22:27:12 2021 +0800 dt-bindings: display: add Unisoc's drm master bindings The Unisoc DRM master device is a virtual device needed to list all DPU devices or other display interface nodes that comprise the graphics subsystem Unisoc's display pipeline have several components as below description, multi display controllers and corresponding physical interfaces. For different display scenarios, dpu0 and dpu1 maybe binding to different encoder. E.g: dpu0 and dpu1 both binding to DSI for dual mipi-dsi display; dpu0 binding to DSI for primary display, and dpu1 binding to DP for external display; Cc: Orson Zhai Cc: Chunyan Zhang Signed-off-by: Kevin Tang Reviewed-by: Rob Herring Signed-off-by: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/20211207142717.30296-2-kevin3.tang@gmail.com commit cde3fac565a7df8805a4e0e28d84a0f90177099a Author: Minghao Chi Date: Fri Dec 10 02:19:17 2021 +0000 batman-adv: remove unneeded variable in batadv_nc_init Return status directly from function called. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich commit 8bfd4858b4bba8fec14e4296cbac71aa55260d60 Author: Samuel Holland Date: Wed Nov 17 21:18:41 2021 -0600 PM / devfreq: Add a driver for the sun8i/sun50i MBUS This driver works by adjusting the divider on the DRAM controller's module clock. Thus there is no fixed set of OPPs, only "full speed" down to "quarter speed" (or whatever the maximum divider is on that variant). It makes use of the MDFS hardware in the MBUS, in "DFS" mode, which takes care of updating registers during the critical section while DRAM is inaccessible. This driver should support several sunxi SoCs, starting with the A33, which have a DesignWare DDR3 controller with merged PHY register space and the matching MBUS register layout (so not A63 or later). However, the driver has only been tested on the A64/H5, so those are the only compatibles enabled for now. Acked-by: Chanwoo Choi Signed-off-by: Samuel Holland Signed-off-by: Chanwoo Choi commit 211b4dbc070090b4183d6f9db7dd3bd4e6170447 Merge: 15bb79910fe73 20cddfcc82e64 Author: Dave Airlie Date: Fri Dec 10 15:35:20 2021 +1000 Merge tag 'drm-intel-gt-next-2021-12-09' of git://anongit.freedesktop.org/drm/drm-intel into drm-next Core Changes: - Fix PENDING_ERROR leak in dma_fence_array_signaled() (Thomas Hellström) Driver Changes: - Fix runtime PM handling during PXP suspend (Tejas Upadhyay) - Improve eviction performance on discrete by implementing async TTM moves (Thomas Hellström, Maarten Lankhorst) - Improve robustness of error capture under memory pressure (Thomas Hellström) - Fix GuC PMU versus GPU reset handling (Umesh Nerlige Ramappa) - Use per device iommu check (Tvrtko Ursulin) - Make error capture work with async migration (Thomas Hellström) - Revert incorrect implementation of Wa_1508744258 causing hangs (José Roberto de Souza) - Disable coarse power gating on some DG2 steppings workaround (Matt Roper) - Add IC cache invalidation workaround on DG2 (Ramalingam C) - Move two Icelake workarounds to the right place (Raviteja Goud Talla) - Fix error pointer dereference in i915_gem_do_execbuffer() (Dan Carpenter) - Fixup a couple of generic and DG2 specific issues in migration code (Matthew Auld) - Fix kernel-doc warnings in i915_drm_object.c (Randy Dunlap) - Drop stealing of bits from i915_sw_fence function pointer (Matthew Brost) - Introduce new macros for i915 PTE (Michael Cheng) - Prep work for engine reset by reset domain lookup (Tejas Upadhyay) - Fixup drm-intel-gt-next build failure (Matthew Auld) - Fix live_engine_busy_stats selftests in GuC mode (Umesh Nerlige Ramappa) - Remove dma_resv_prune (Maarten Lankhorst) - Preserve huge pages enablement after driver reload (Matthew Auld) - Fix a NULL pointer dereference in igt_request_rewind() (selftests) (Zhou Qingyang) - Add workaround numbers to GEN7_COMMON_SLICE_CHICKEN1 whitelisting (José Roberto de Souza) - Increase timeouts in i915_gem_contexts selftests to handle GuC being slower (Bruce Chang) Signed-off-by: Dave Airlie # Conflicts: # drivers/gpu/drm/i915/display/intel_fbc.c From: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/YbIBOeqhn+nPzaYD@tursulin-mobl2 commit 15bb79910fe734ad21c765d1cae762e855969caa Merge: 15f09a99e5538 03848335b5b1f Author: Dave Airlie Date: Fri Dec 10 15:08:11 2021 +1000 Merge tag 'drm-misc-next-2021-12-09' of git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next for 5.17: UAPI Changes: Cross-subsystem Changes: * dma-buf: Make fences mandatory in dma_resv_add_excl_fence Core Changes: * Move hashtable to legacy code * Return error pointers from struct drm_driver.gem_create_object * cma-helper: Improve public interfaces; Remove CONFIG_DRM_KMS_CMA_HELPER option * mipi-dbi: Don't depend on CMA helpers * ttm: Don't include DRM hashtable; Stop prunning fences after wait; Documentation Driver Changes: * aspeed: Select CONFIG_DRM_GEM_CMA_HELPER * bridge/lontium-lt9611: Fix HDMI sensing * bridge/parade-ps8640: Fixes * bridge/sn65dsi86: Defer probe is no dsi host found * fsl-dcu: Select CONFIG_DRM_GEM_CMA_HELPER * i915: Remove dma_resv_prune * omapdrm: Fix scatterlist export; Support virtual planes; Fixes * panel: Boe-tv110c9m,Inx-hj110iz: Update init code * qxl: Use dma-resv iterator * rockchip: Use generic fbdev emulation * tidss: Fixes * vmwgfx: Fix leak on probe errors; Fail probing on broken hosts; New placement for MOB page tables; Hide internal BOs from userspace; Cleanups Signed-off-by: Dave Airlie From: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/YbHskHZc9HoAYuPZ@linux-uq9g.fritz.box commit 15f09a99e5538ac9d6e380e377de80fa4731a8bd Merge: f8eb96b4dfbbb 155358310f013 Author: Dave Airlie Date: Fri Dec 10 14:56:40 2021 +1000 Merge tag 'du-next-20211206' of git://linuxtv.org/pinchartl/media into drm-next R-Car DU updates: - DSI output support - Misc fixes Signed-off-by: Dave Airlie From: Laurent Pinchart Link: https://patchwork.freedesktop.org/patch/msgid/Ya4/MCeuNf601tL4@pendragon.ideasonboard.com commit db67097aa6f2587b44055f2e16db72a11e17faef Author: NeilBrown Date: Thu Dec 9 21:31:56 2021 -0700 pktdvd: stop using bdi congestion framework. The bdi congestion framework isn't widely used and should be deprecated. pktdvd makes use of it to track congestion, but this can be done entirely internally to pktdvd, so it doesn't need to use the framework. So introduce a "congested" flag. When waiting for bio_queue_size to drop, set this flag and a var_waitqueue() to wait for it. When bio_queue_size does drop and this flag is set, clear the flag and call wake_up_var(). We don't use a wait_var_event macro for the waiting as we need to set the flag and drop the spinlock before calling schedule() and while that is possible with __wait_var_event(), result is not easy to read. Reviewed-by: Christoph Hellwig Signed-off-by: NeilBrown Link: https://lore.kernel.org/r/163910843527.9928.857338663717630212@noble.neil.brown.name Signed-off-by: Jens Axboe commit 98ceca2f29325d6114ea77be719a68c467c103d6 Author: Yang Li Date: Fri Dec 3 14:19:13 2021 +0800 fpga: region: fix kernel-doc Fix function name in of-fpga-region.c kernel-doc comment to remove a warning found by running scripts/kernel-doc, which is caused by using 'make W=1'. drivers/fpga/of-fpga-region.c:451: warning: expecting prototype for fpga_region_init(). Prototype was for of_fpga_region_init() instead. Reported-by: Abaci Robot Signed-off-by: Yang Li Acked-by: Randy Dunlap Signed-off-by: Moritz Fischer commit f8eb96b4dfbbbadfb73ee9a1cd0294f9e2762a14 Merge: c8a04cbeedbc9 7089784873047 Author: Dave Airlie Date: Fri Dec 10 13:52:51 2021 +1000 Merge tag 'amd-drm-next-5.17-2021-12-02' of https://gitlab.freedesktop.org/agd5f/linux into drm-next amd-drm-next-5.17-2021-12-02: amdgpu: - Use generic drm fb helpers - PSR fixes - Rework DCN3.1 clkmgr - DPCD 1.3 fixes - Misc display fixes can cleanups - Clock query fixes for APUs - LTTPR fixes - DSC fixes - Misc PM fixes - RAS fixes - OLED backlight fix - SRIOV fixes - Add STB (Smart Trace Buffer) for supported dGPUs - IH rework - Enable seamless boot for DCN3.01 amdkfd: - Rework more stuff around IP discovery enumeration - Further clean up of interfaces with amdgpu - SVM fixes radeon: - Indentation fixes UAPI: - Add a new KFD header that defines some of the sysfs bitfields and enums that userspace has been using for a while The corresponding bit-fields and enums in user mode are defined in https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface/blob/master/include/hsakmttypes.h Signed-off-by: Dave Airlie # Conflicts: # drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c From: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20211202191643.5970-1-alexander.deucher@amd.com commit e5d75fc20b9278d07731f69e327adf16227813a6 Author: Geert Uytterhoeven Date: Wed Dec 8 11:32:07 2021 +0100 sh_eth: Use dev_err_probe() helper Use the dev_err_probe() helper, instead of open-coding the same operation. Signed-off-by: Geert Uytterhoeven Reviewed-by: Niklas Söderlund Reviewed-by: Sergey Shtylyov Reviewed-by: Kieran Bingham Link: https://lore.kernel.org/r/2576cc15bdbb5be636640f491bcc087a334e2c02.1638959463.git.geert+renesas@glider.be Signed-off-by: Jakub Kicinski commit 9745177c948984d61f7853f922d501cc440aae47 Author: Jean Sacren Date: Wed Dec 8 00:20:25 2021 -0700 net: x25: drop harmless check of !more 'more' is checked first. When !more is checked immediately after that, it is always true. We should drop this check. Signed-off-by: Jean Sacren Acked-by: Martin Schiller Link: https://lore.kernel.org/r/20211208024732.142541-5-sakiwit@gmail.com Signed-off-by: Jakub Kicinski commit a331659e32718b31f3a304d7797a77d31610468c Author: Sam Protsenko Date: Wed Oct 13 20:20:42 2021 +0300 clk: Add write operation for clk_parent debugfs node Useful for testing mux clocks. One can write the index of the parent to be set into clk_parent node, starting from 0. Example # cd /sys/kernel/debug/clk/mout_peri_bus # cat clk_possible_parents dout_shared0_div4 dout_shared1_div4 # cat clk_parent dout_shared0_div4 # echo 1 > clk_parent # cat clk_parent dout_shared1_div4 CLOCK_ALLOW_WRITE_DEBUGFS has to be defined in drivers/clk/clk.c in order to use this feature. Signed-off-by: Sam Protsenko Reviewed-by: Andy Shevchenko Reviewed-by: Geert Uytterhoeven Reviewed-by: Fabio Estevam Acked-by: Michael Turquette Link: https://lore.kernel.org/r/20211013172042.10884-1-semen.protsenko@linaro.org [sboyd@kernel.org: Collapse ifdefs] Signed-off-by: Stephen Boyd commit 978fbc7a05993df9a2fd115e8fd78600c72e0dfe Author: Stephen Boyd Date: Tue Dec 7 20:15:34 2021 -0800 clk: __clk_core_init() never takes NULL The only caller of __clk_core_init() allocates the pointer and checks the allocation for NULL so this check is impossible. Remove it. Signed-off-by: Stephen Boyd Link: https://lore.kernel.org/r/20211208041534.3928718-2-sboyd@kernel.org commit 5c1c42c49b8a74ecd6de289ff13c033979501cce Author: Stephen Boyd Date: Tue Dec 7 20:15:33 2021 -0800 clk: clk_core_get() can also return NULL Nothing stops a clk controller from registering an OF clk provider before registering those clks with the clk framework. This is not great but we deal with it in the clk framework by refusing to hand out struct clk pointers when 'hw->core' is NULL, the indication that clk_register() has been called. Within clk_core_fill_parent_index() we considered this case when a clk_hw pointer is referenced directly by filling in the parent cache with an -EPROBE_DEFER pointer when the core pointer is NULL. When we lookup a parent with clk_core_get() we don't care about the return value being NULL though, because that was considered largely impossible, but it's been proven now that it can be NULL if two clk providers are probing in parallel and the parent provider has been registered before the clk has. Let's check for NULL here as well and treat it the same as direct clk_hw references. Signed-off-by: Stephen Boyd Link: https://lore.kernel.org/r/20211208041534.3928718-1-sboyd@kernel.org commit 9259228037cb614ac31a18557fee62976f873a49 Author: Colin Ian King Date: Sat Nov 27 17:30:36 2021 +0000 clk/ti/adpll: Make const pointer error a static const array Make const pointer error a static const array, removes a dereference and shrinks object code a little. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20211127173036.150535-1-colin.i.king@gmail.com Acked-by: Tony Lindgren Signed-off-by: Stephen Boyd commit b473a3891c46393e9c4ccb4e3197d7fb259c7100 Author: Marco Elver Date: Mon Dec 6 07:41:51 2021 +0100 kcsan: Only test clear_bit_unlock_is_negative_byte if arch defines it Some architectures do not define clear_bit_unlock_is_negative_byte(). Only test it when it is actually defined (similar to other usage, such as in lib/test_kasan.c). Link: https://lkml.kernel.org/r/202112050757.x67rHnFU-lkp@intel.com Reported-by: kernel test robot Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit e3d2b72bbf3c580b0c5c96385777c2f483a45ab5 Author: Marco Elver Date: Mon Dec 6 07:41:50 2021 +0100 kcsan: Avoid nested contexts reading inconsistent reorder_access Nested contexts, such as nested interrupts or scheduler code, share the same kcsan_ctx. When such a nested context reads an inconsistent reorder_access due to an interrupt during set_reorder_access(), we can observe the following warning: | ------------[ cut here ]------------ | Cannot find frame for torture_random kernel/torture.c:456 in stack trace | WARNING: CPU: 13 PID: 147 at kernel/kcsan/report.c:343 replace_stack_entry kernel/kcsan/report.c:343 | ... | Call Trace: | | sanitize_stack_entries kernel/kcsan/report.c:351 [inline] | print_report kernel/kcsan/report.c:409 | kcsan_report_known_origin kernel/kcsan/report.c:693 | kcsan_setup_watchpoint kernel/kcsan/core.c:658 | rcutorture_one_extend kernel/rcu/rcutorture.c:1475 | rcutorture_loop_extend kernel/rcu/rcutorture.c:1558 [inline] | ... | | ---[ end trace ee5299cb933115f5 ]--- | ================================================================== | BUG: KCSAN: data-race in _raw_spin_lock_irqsave / rcutorture_one_extend | | write (reordered) to 0xffffffff8c93b300 of 8 bytes by task 154 on cpu 12: | queued_spin_lock include/asm-generic/qspinlock.h:80 [inline] | do_raw_spin_lock include/linux/spinlock.h:185 [inline] | __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:111 [inline] | _raw_spin_lock_irqsave kernel/locking/spinlock.c:162 | try_to_wake_up kernel/sched/core.c:4003 | sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1097 | asm_sysvec_apic_timer_interrupt arch/x86/include/asm/idtentry.h:638 | set_reorder_access kernel/kcsan/core.c:416 [inline] <-- inconsistent reorder_access | kcsan_setup_watchpoint kernel/kcsan/core.c:693 | rcutorture_one_extend kernel/rcu/rcutorture.c:1475 | rcutorture_loop_extend kernel/rcu/rcutorture.c:1558 [inline] | rcu_torture_one_read kernel/rcu/rcutorture.c:1600 | rcu_torture_reader kernel/rcu/rcutorture.c:1692 | kthread kernel/kthread.c:327 | ret_from_fork arch/x86/entry/entry_64.S:295 | | read to 0xffffffff8c93b300 of 8 bytes by task 147 on cpu 13: | rcutorture_one_extend kernel/rcu/rcutorture.c:1475 | rcutorture_loop_extend kernel/rcu/rcutorture.c:1558 [inline] | ... The warning is telling us that there was a data race which KCSAN wants to report, but the function where the original access (that is now reordered) happened cannot be found in the stack trace, which prevents KCSAN from generating the right stack trace. The stack trace of "write (reordered)" now only shows where the access was reordered to, but should instead show the stack trace of the original write, with a final line saying "reordered to". At the point where set_reorder_access() is interrupted, it just set reorder_access->ptr and size, at which point size is non-zero. This is sufficient (if ctx->disable_scoped is zero) for further accesses from nested contexts to perform checking of this reorder_access. That then happened in _raw_spin_lock_irqsave(), which is called by scheduler code. However, since reorder_access->ip is still stale (ptr and size belong to a different ip not yet set) this finally leads to replace_stack_entry() not finding the frame in reorder_access->ip and generating the above warning. Fix it by ensuring that a nested context cannot access reorder_access while we update it in set_reorder_access(): set ctx->disable_scoped for the duration that reorder_access is updated, which effectively locks reorder_access and prevents concurrent use by nested contexts. Note, set_reorder_access() can do the update only if disabled_scoped is zero on entry, and must therefore set disable_scoped back to non-zero after the initial check in set_reorder_access(). Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit 80d7476fa20a3cc83f76b3b02a7575891d1e7511 Author: Marco Elver Date: Sat Dec 4 13:57:03 2021 +0100 kcsan: Turn barrier instrumentation into macros Some architectures use barriers in 'extern inline' functions, from which we should not refer to static inline functions. For example, building Alpha with gcc and W=1 shows: ./include/asm-generic/barrier.h:70:30: warning: 'kcsan_rmb' is static but used in inline function 'pmd_offset' which is not static 70 | #define smp_rmb() do { kcsan_rmb(); __smp_rmb(); } while (0) | ^~~~~~~~~ ./arch/alpha/include/asm/pgtable.h:293:9: note: in expansion of macro 'smp_rmb' 293 | smp_rmb(); /* see above */ | ^~~~~~~ Which seems to warn about 6.7.4#3 of the C standard: "An inline definition of a function with external linkage shall not contain a definition of a modifiable object with static or thread storage duration, and shall not contain a reference to an identifier with internal linkage." Fix it by turning barrier instrumentation into macros, which matches definitions in . Perhaps we can revert this change in future, when there are no more 'extern inline' users left. Link: https://lkml.kernel.org/r/202112041334.X44uWZXf-lkp@intel.com Reported-by: kernel test robot Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit a70d36e6a0bd867ef42dce8ef46eb9b5a1515fb0 Author: Marco Elver Date: Sat Dec 4 00:38:17 2021 +0100 kcsan: Make barrier tests compatible with lockdep The barrier tests in selftest and the kcsan_test module only need the spinlock and mutex to test correct barrier instrumentation. Therefore, these were initially placed on the stack. However, lockdep asserts that locks are in static storage, and will generate this warning: | 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. | CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.16.0-rc1+ #3208 | Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-1ubuntu1.1 04/01/2014 | Call Trace: | | dump_stack_lvl+0x88/0xd8 | dump_stack+0x15/0x1b | register_lock_class+0x6b3/0x840 | ... | test_barrier+0x490/0x14c7 | kcsan_selftest+0x47/0xa0 | ... To fix, move the test locks into static storage. Fixing the above also revealed that lock operations are strengthened on first use with lockdep enabled, due to lockdep calling out into non-instrumented files (recall that kernel/locking/lockdep.c is not instrumented with KCSAN). Only kcsan_test checks for over-instrumentation of *_lock() operations, where we can simply "warm up" the test locks to avoid the test case failing with lockdep. Reported-by: Paul E. McKenney Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit bd3d5bd1a0ad386475ea7a3de8a91e7d8a600536 Author: Marco Elver Date: Tue Nov 30 12:44:33 2021 +0100 kcsan: Support WEAK_MEMORY with Clang where no objtool support exists Clang and GCC behave a little differently when it comes to the __no_sanitize_thread attribute, which has valid reasons, and depending on context either one could be right. Traditionally, user space ThreadSanitizer [1] still expects instrumented builtin atomics (to avoid false positives) and __tsan_func_{entry,exit} (to generate meaningful stack traces), even if the function has the attribute no_sanitize("thread"). [1] https://clang.llvm.org/docs/ThreadSanitizer.html#attribute-no-sanitize-thread GCC doesn't follow the same policy (for better or worse), and removes all kinds of instrumentation if no_sanitize is added. Arguably, since this may be a problem for user space ThreadSanitizer, we expect this may change in future. Since KCSAN != ThreadSanitizer, the likelihood of false positives even without barrier instrumentation everywhere, is much lower by design. At least for Clang, however, to fully remove all sanitizer instrumentation, we must add the disable_sanitizer_instrumentation attribute, which is available since Clang 14.0. Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit a015b7085979b12e55f67f3b86be0321fff6be3f Author: Alexander Potapenko Date: Tue Nov 30 12:44:32 2021 +0100 compiler_attributes.h: Add __disable_sanitizer_instrumentation The new attribute maps to __attribute__((disable_sanitizer_instrumentation)), which will be supported by Clang >= 14.0. Future support in GCC is also possible. This attribute disables compiler instrumentation for kernel sanitizer tools, making it easier to implement noinstr. It is different from the existing __no_sanitize* attributes, which may still allow certain types of instrumentation to prevent false positives. Signed-off-by: Alexander Potapenko Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit 0509811952e41ad1e04c50d2378078250b6b7be3 Author: Marco Elver Date: Tue Nov 30 12:44:31 2021 +0100 objtool, kcsan: Remove memory barrier instrumentation from noinstr Teach objtool to turn instrumentation required for memory barrier modeling into nops in noinstr text. The __tsan_func_entry/exit calls are still emitted by compilers even with the __no_sanitize_thread attribute. The memory barrier instrumentation will be inserted explicitly (without compiler help), and thus needs to also explicitly be removed. Signed-off-by: Marco Elver Acked-by: Josh Poimboeuf Signed-off-by: Paul E. McKenney commit 0525bd82f6a9b5860ed3ea53520ac11ebfa09d5b Author: Marco Elver Date: Tue Nov 30 12:44:30 2021 +0100 objtool, kcsan: Add memory barrier instrumentation to whitelist Adds KCSAN's memory barrier instrumentation to objtool's uaccess whitelist. Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit 6f3f0c98b5665f437a631882653b5baf7dd98448 Author: Marco Elver Date: Tue Nov 30 12:44:29 2021 +0100 sched, kcsan: Enable memory barrier instrumentation There's no fundamental reason to disable KCSAN for scheduler code, except for excessive noise and performance concerns (instrumenting scheduler code is usually a good way to stress test KCSAN itself). However, several core sched functions imply memory barriers that are invisible to KCSAN without instrumentation, but are required to avoid false positives. Therefore, unconditionally enable instrumentation of memory barriers in scheduler code. Also update the comment to reflect this and be a bit more brief. Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit d37d1fa0154ef3920ad1975aadc083cecdf81b3b Author: Marco Elver Date: Tue Nov 30 12:44:28 2021 +0100 mm, kcsan: Enable barrier instrumentation Some memory management calls imply memory barriers that are required to avoid false positives. For example, without the correct instrumentation, we could observe data races of the following variant: T0 | T1 ------------------------+------------------------ | *a = 42; ---+ | kfree(a); | | | | b = kmalloc(..); // b == a <-+ | *b = 42; // not a data race! | Therefore, instrument memory barriers in all allocator code currently not being instrumented in a default build. Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit d93414e37586691dd2684a7f8ed05fb9cd640f83 Author: Marco Elver Date: Tue Nov 30 12:44:27 2021 +0100 x86/qspinlock, kcsan: Instrument barrier of pv_queued_spin_unlock() If CONFIG_PARAVIRT_SPINLOCKS=y, queued_spin_unlock() is implemented using pv_queued_spin_unlock() which is entirely inline asm based. As such, we do not receive any KCSAN barrier instrumentation via regular atomic operations. Add the missing KCSAN barrier instrumentation for the CONFIG_PARAVIRT_SPINLOCKS case. Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit cd8730c3ab4d1d651acd00b028bd949bda3f62d8 Author: Marco Elver Date: Tue Nov 30 12:44:26 2021 +0100 x86/barriers, kcsan: Use generic instrumentation for non-smp barriers Prefix all barriers with __, now that asm-generic/barriers.h supports defining the final instrumented version of these barriers. The change is limited to barriers used by x86-64. Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit 04def1b9b4a3d27ef80e7fbf1b17f1897beb1ce4 Author: Marco Elver Date: Tue Nov 30 12:44:25 2021 +0100 asm-generic/bitops, kcsan: Add instrumentation for barriers Adds the required KCSAN instrumentation for barriers of atomic bitops. Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit e87c4f6642f49627c3430cb3ee78c73fb51b48e4 Author: Marco Elver Date: Tue Nov 30 12:44:24 2021 +0100 locking/atomics, kcsan: Add instrumentation for barriers Adds the required KCSAN instrumentation for barriers of atomics. Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit 2505a51ac6f249956735e0a369e2404f96eebef0 Author: Marco Elver Date: Tue Nov 30 12:44:23 2021 +0100 locking/barriers, kcsan: Support generic instrumentation Thus far only smp_*() barriers had been defined by asm-generic/barrier.h based on __smp_*() barriers, because the !SMP case is usually generic. With the introduction of instrumentation, it also makes sense to have asm-generic/barrier.h assist in the definition of instrumented versions of mb(), rmb(), wmb(), dma_rmb(), and dma_wmb(). Because there is no requirement to distinguish the !SMP case, the definition can be simpler: we can avoid also providing fallbacks for the __ prefixed cases, and only check if `defined(__)`, to finally define the KCSAN-instrumented versions. This also allows for the compiler to complain if an architecture accidentally defines both the normal and __ prefixed variant. Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit f948666de517cf8ebef7cb2c9b2d669dec4bfe2e Author: Marco Elver Date: Tue Nov 30 12:44:22 2021 +0100 locking/barriers, kcsan: Add instrumentation for barriers Adds the required KCSAN instrumentation for barriers if CONFIG_SMP. KCSAN supports modeling the effects of: smp_mb() smp_rmb() smp_wmb() smp_store_release() Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit 71b0e3aeb28256712945d99ca67b3f5e3ed7e0b1 Author: Marco Elver Date: Tue Nov 30 12:44:21 2021 +0100 kcsan: selftest: Add test case to check memory barrier instrumentation Memory barrier instrumentation is crucial to avoid false positives. To avoid surprises, run a simple test case in the boot-time selftest to ensure memory barriers are still instrumented correctly. Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit 116af35e38cf97ed72111ac6bea19f8acea2d0ba Author: Marco Elver Date: Tue Nov 30 12:44:20 2021 +0100 kcsan: Ignore GCC 11+ warnings about TSan runtime support GCC 11 has introduced a new warning option, -Wtsan [1], to warn about unsupported operations in the TSan runtime. But KCSAN != TSan runtime, so none of the warnings apply. [1] https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Warning-Options.html Ignore the warnings. Currently the warning only fires in the test for __atomic_thread_fence(): kernel/kcsan/kcsan_test.c: In function ‘test_atomic_builtins’: kernel/kcsan/kcsan_test.c:1234:17: warning: ‘atomic_thread_fence’ is not supported with ‘-fsanitize=thread’ [-Wtsan] 1234 | __atomic_thread_fence(__ATOMIC_SEQ_CST); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ which exists to ensure the KCSAN runtime keeps supporting the builtin instrumentation. Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit 8bc32b34817862c80a8b9a82ceb643294acd3da3 Author: Marco Elver Date: Tue Nov 30 12:44:19 2021 +0100 kcsan: test: Add test cases for memory barrier instrumentation Adds test cases to check that memory barriers are instrumented correctly, and detection of missing memory barriers is working as intended if CONFIG_KCSAN_STRICT=y. Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit 7310bd1f3eb9445d96b030457d59d9f84375bdd5 Author: Marco Elver Date: Tue Nov 30 12:44:18 2021 +0100 kcsan: test: Match reordered or normal accesses Due to reordering accesses with weak memory modeling, any access can now appear as "(reordered)". Match any permutation of accesses if CONFIG_KCSAN_WEAK_MEMORY=y, so that we effectively match an access if it is denoted "(reordered)" or not. Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit 82eb6911d909cc8bd2838048f0dac7263ab63373 Author: Marco Elver Date: Tue Nov 30 12:44:17 2021 +0100 kcsan: Document modeling of weak memory Document how KCSAN models a subset of weak memory and the subset of missing memory barriers it can detect as a result. Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit be3f6967ec5947dd7b2f23bf9d42bb2729889618 Author: Marco Elver Date: Tue Nov 30 12:44:16 2021 +0100 kcsan: Show location access was reordered to Also show the location the access was reordered to. An example report: | ================================================================== | BUG: KCSAN: data-race in test_kernel_wrong_memorder / test_kernel_wrong_memorder | | read-write to 0xffffffffc01e61a8 of 8 bytes by task 2311 on cpu 5: | test_kernel_wrong_memorder+0x57/0x90 | access_thread+0x99/0xe0 | kthread+0x2ba/0x2f0 | ret_from_fork+0x22/0x30 | | read-write (reordered) to 0xffffffffc01e61a8 of 8 bytes by task 2310 on cpu 7: | test_kernel_wrong_memorder+0x57/0x90 | access_thread+0x99/0xe0 | kthread+0x2ba/0x2f0 | ret_from_fork+0x22/0x30 | | | +-> reordered to: test_kernel_wrong_memorder+0x80/0x90 | | Reported by Kernel Concurrency Sanitizer on: | CPU: 7 PID: 2310 Comm: access_thread Not tainted 5.14.0-rc1+ #18 | Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.14.0-2 04/01/2014 | ================================================================== Reviewed-by: Boqun Feng Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit 3cc21a531252e6693ee989231d5abee6812cfd71 Author: Marco Elver Date: Tue Nov 30 12:44:15 2021 +0100 kcsan: Call scoped accesses reordered in reports The scoping of an access simply denotes the scope in which it may be reordered. However, in reports, it'll be less confusing to say the access is "reordered". This is more accurate when the race occurred. Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit 48c9e28e1e249c97bcbf68451947649c55b8c09e Author: Marco Elver Date: Tue Nov 30 12:44:14 2021 +0100 kcsan, kbuild: Add option for barrier instrumentation only Source files that disable KCSAN via KCSAN_SANITIZE := n, remove all instrumentation, including explicit barrier instrumentation. With instrumentation for memory barriers, in few places it is required to enable just the explicit instrumentation for memory barriers to avoid false positives. Providing the Makefile variable KCSAN_INSTRUMENT_BARRIERS_obj.o or KCSAN_INSTRUMENT_BARRIERS (for all files) set to 'y' only enables the explicit barrier instrumentation. Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit 0b8b0830ac1419d7250fde31ea78793a03f3db44 Author: Marco Elver Date: Tue Nov 30 12:44:13 2021 +0100 kcsan: Add core memory barrier instrumentation functions Add the core memory barrier instrumentation functions. These invalidate the current in-flight reordered access based on the rules for the respective barrier types and in-flight access type. To obtain barrier instrumentation that can be disabled via __no_kcsan with appropriate compiler-support (and not just with objtool help), barrier instrumentation repurposes __atomic_signal_fence(), instead of inserting explicit calls. Crucially, __atomic_signal_fence() normally does not map to any real instructions, but is still intercepted by fsanitize=thread. As a result, like any other instrumentation done by the compiler, barrier instrumentation can be disabled with __no_kcsan. Unfortunately Clang and GCC currently differ in their __no_kcsan aka __no_sanitize_thread behaviour with respect to builtin atomics (and __tsan_func_{entry,exit}) instrumentation. This is already reflected in Kconfig.kcsan's dependencies for KCSAN_WEAK_MEMORY. A later change will introduce support for newer versions of Clang that can implement __no_kcsan to also remove the additional instrumentation introduced by KCSAN_WEAK_MEMORY. Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit 69562e4983d93e2791c0bf128b07462afbd7f4dc Author: Marco Elver Date: Thu Aug 5 14:57:45 2021 +0200 kcsan: Add core support for a subset of weak memory modeling Add support for modeling a subset of weak memory, which will enable detection of a subset of data races due to missing memory barriers. KCSAN's approach to detecting missing memory barriers is based on modeling access reordering, and enabled if `CONFIG_KCSAN_WEAK_MEMORY=y`, which depends on `CONFIG_KCSAN_STRICT=y`. The feature can be enabled or disabled at boot and runtime via the `kcsan.weak_memory` boot parameter. Each memory access for which a watchpoint is set up, is also selected for simulated reordering within the scope of its function (at most 1 in-flight access). We are limited to modeling the effects of "buffering" (delaying the access), since the runtime cannot "prefetch" accesses (therefore no acquire modeling). Once an access has been selected for reordering, it is checked along every other access until the end of the function scope. If an appropriate memory barrier is encountered, the access will no longer be considered for reordering. When the result of a memory operation should be ordered by a barrier, KCSAN can then detect data races where the conflict only occurs as a result of a missing barrier due to reordering accesses. Suggested-by: Dmitry Vyukov Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit 9756f64c8f2d19c0029a5827bda8ac275302ec22 Author: Marco Elver Date: Tue Nov 30 12:44:11 2021 +0100 kcsan: Avoid checking scoped accesses from nested contexts Avoid checking scoped accesses from nested contexts (such as nested interrupts or in scheduler code) which share the same kcsan_ctx. This is to avoid detecting false positive races of accesses in the same thread with currently scoped accesses: consider setting up a watchpoint for a non-scoped (normal) access that also "conflicts" with a current scoped access. In a nested interrupt (or in the scheduler), which shares the same kcsan_ctx, we cannot check scoped accesses set up in the parent context -- simply ignore them in this case. With the introduction of kcsan_ctx::disable_scoped, we can also clean up kcsan_check_scoped_accesses()'s recursion guard, and do not need to modify the list's prev pointer. Signed-off-by: Marco Elver Signed-off-by: Paul E. McKenney commit 71f8de7092cb2cf95e3f7055df139118d1445597 Author: Marco Elver Date: Tue Nov 30 12:44:10 2021 +0100 kcsan: Remove redundant zero-initialization of globals They are implicitly zero-initialized, remove explicit initialization. It keeps the upcoming additions to kcsan_ctx consistent with the rest. No functional change intended. Signed-off-by: Marco Elver Acked-by: Mark Rutland Signed-off-by: Paul E. McKenney commit 12305abe982740878ecdf9e22852652d8d164855 Author: Marco Elver Date: Tue Nov 30 12:44:09 2021 +0100 kcsan: Refactor reading of instrumented memory Factor out the switch statement reading instrumented memory into a helper read_instrumented_memory(). No functional change. Signed-off-by: Marco Elver Acked-by: Mark Rutland Signed-off-by: Paul E. McKenney commit dc1b242478f47d04a41f319a14f163711c52646a Author: Linus Walleij Date: Thu Dec 9 14:45:13 2021 +0100 pinctrl: bcm2835: Silence uninit warning The uninitialized variable would be caught by the BUG_ON() logic below, but the kernel test robot cannot see that. Silence the warning by initializing the variable. Reported-by: kernel test robot Link: https://lore.kernel.org/r/20211209134513.306212-1-linus.walleij@linaro.org Signed-off-by: Linus Walleij commit 84f91c62d675480ffd3d870ee44c07965cbd8b21 Author: Lai Jiangshan Date: Tue Dec 7 15:35:42 2021 +0800 workqueue: Remove the cacheline_aligned for nr_running nr_running is never modified remotely after the schedule callback in wakeup path is removed. Rather nr_running is often accessed with other fields in the pool together, so the cacheline_aligned for nr_running isn't needed. Signed-off-by: Lai Jiangshan Signed-off-by: Tejun Heo commit 989442d73757868118a73b92732b549a73c9ce35 Author: Lai Jiangshan Date: Tue Dec 7 15:35:41 2021 +0800 workqueue: Move the code of waking a worker up in unbind_workers() In unbind_workers(), there are two pool->lock held sections separated by the code of zapping nr_running. wake_up_worker() needs to be in pool->lock held section and after zapping nr_running. And zapping nr_running had to be after schedule() when the local wake up functionality was in use. Now, the call to schedule() has been removed along with the local wake up functionality, so the code can be merged into the same pool->lock held section. The diffstat shows that it is other code moved down because the diff tools can not know the meaning of merging lock sections by swapping two code blocks. Signed-off-by: Lai Jiangshan Signed-off-by: Tejun Heo commit b4ac9384ac057c5bf035fbe82fc162fa2f7b15a9 Author: Lai Jiangshan Date: Tue Dec 7 15:35:40 2021 +0800 workqueue: Remove schedule() in unbind_workers() The commit 6d25be5782e4 ("sched/core, workqueues: Distangle worker accounting from rq lock") changed the schedule callbacks for workqueue and moved the schedule callback from the wakeup code to at end of schedule() in the worker's process context. It means that the callback wq_worker_running() is guaranteed that it sees the %WORKER_UNBOUND flag after scheduled since unbind_workers() is running on the same CPU that all the pool's workers bound to. Signed-off-by: Lai Jiangshan Signed-off-by: Tejun Heo commit 11b45b0bf402b53c94c86737a440363fc36f03cd Author: Lai Jiangshan Date: Tue Dec 7 15:35:39 2021 +0800 workqueue: Remove outdated comment about exceptional workers in unbind_workers() Long time before, workers are not ALL bound after CPU_ONLINE, they can still be running in other CPUs before self rebinding. But the commit a9ab775bcadf ("workqueue: directly restore CPU affinity of workers from CPU_ONLINE") makes rebind_workers() bind them all. So all workers are on the CPU before the CPU is down. And the comment in unbind_workers() refers to the workers "which are still executing works from before the last CPU down" is outdated. Just removed it. Signed-off-by: Lai Jiangshan Signed-off-by: Tejun Heo commit 3e5f39ea33b1189ccaa4ae2a9de2bce07753d2e0 Author: Lai Jiangshan Date: Tue Dec 7 15:35:38 2021 +0800 workqueue: Remove the advanced kicking of the idle workers in rebind_workers() The commit 6d25be5782e4 ("sched/core, workqueues: Distangle worker accounting from rq lock") changed the schedule callbacks for workqueue and removed the local-wake-up functionality. Now the wakingup of workers is done by normal fashion and workers not yet migrated to the specific CPU in concurrency managed pool can also be woken up by workers that already bound to the specific cpu now. So this advanced kicking of the idle workers to migrate them to the associated CPU is unneeded now. Signed-off-by: Lai Jiangshan Signed-off-by: Tejun Heo commit ccf45156fd167a234baf038c11c1f367c7ccabd4 Author: Lai Jiangshan Date: Tue Dec 7 15:35:37 2021 +0800 workqueue: Remove the outdated comment before wq_worker_sleeping() It isn't called with preempt disabled now. Signed-off-by: Lai Jiangshan Signed-off-by: Tejun Heo commit 3150a73366b64e3109f0facbc98bcacbc14e81ba Merge: 1a2fb220edca9 ded746bfc9439 Author: Jakub Kicinski Date: Thu Dec 9 12:04:19 2021 -0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net No conflicts. Signed-off-by: Jakub Kicinski commit 1a2fb220edca98d18f90e3ef5bd6853a6b22b1b8 Author: Kees Cook Date: Mon Dec 6 22:27:58 2021 -0800 skbuff: Extract list pointers to silence compiler warnings Under both -Warray-bounds and the object_size sanitizer, the compiler is upset about accessing prev/next of sk_buff when the object it thinks it is coming from is sk_buff_head. The warning is a false positive due to the compiler taking a conservative approach, opting to warn at casting time rather than access time. However, in support of enabling -Warray-bounds globally (which has found many real bugs), arrange things for sk_buff so that the compiler can unambiguously see that there is no intention to access anything except prev/next. Introduce and cast to a separate struct sk_buff_list, which contains _only_ the first two fields, silencing the warnings: In file included from ./include/net/net_namespace.h:39, from ./include/linux/netdevice.h:37, from net/core/netpoll.c:17: net/core/netpoll.c: In function 'refill_skbs': ./include/linux/skbuff.h:2086:9: warning: array subscript 'struct sk_buff[0]' is partly outside array bounds of 'struct sk_buff_head[1]' [-Warray-bounds] 2086 | __skb_insert(newsk, next->prev, next, list); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ net/core/netpoll.c:49:28: note: while referencing 'skb_pool' 49 | static struct sk_buff_head skb_pool; | ^~~~~~~~ This change results in no executable instruction differences. Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20211207062758.2324338-1-keescook@chromium.org Signed-off-by: Jakub Kicinski commit f20f94f7f52c4685c81754f489ffcc72186e8bdb Author: Russell King (Oracle) Date: Wed Dec 8 11:36:30 2021 +0000 net: phy: prefer 1000baseT over 1000baseKX The PHY settings table is supposed to be sorted by descending match priority - in other words, earlier entries are preferred over later entries. The order of 1000baseKX/Full and 1000baseT/Full is such that we prefer 1000baseKX/Full over 1000baseT/Full, but 1000baseKX/Full is a lot rarer than 1000baseT/Full, and thus is much less likely to be preferred. This causes phylink problems - it means a fixed link specifying a speed of 1G and full duplex gets an ethtool linkmode of 1000baseKX/Full rather than 1000baseT/Full as would be expected - and since we offer userspace a software emulation of a conventional copper PHY, we want to offer copper modes in preference to anything else. However, we do still want to allow the rarer modes as well. Hence, let's reorder these two modes to prefer copper. Tested-by: Tom Lendacky Signed-off-by: Russell King (Oracle) Reviewed-by: Andrew Lunn Reported-by: Florian Fainelli Link: https://lore.kernel.org/r/E1muvFO-00F6jY-1K@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski commit 4177e4960594f7e6ae2ae787667b1788178cf32c Author: Eric Dumazet Date: Tue Dec 7 11:32:03 2021 -0800 xfrm: use net device refcount tracker helpers xfrm4_fill_dst() and xfrm6_fill_dst() build dst, getting a device reference that will likely be released by standard dst_release() code. We have to track these references or risk a warning if CONFIG_NET_DEV_REFCNT_TRACKER=y Note to XFRM maintainers : Error path in xfrm6_fill_dst() releases the reference, but does not clear xdst->u.dst.dev, so I wonder if this could lead to double dev_put() in some cases, where a dst_release() _is_ called by the callers in their error path. This extra dev_put() was added in commit 84c4a9dfbf430 ("xfrm6: release dev before returning error") Fixes: 9038c320001d ("net: dst: add net device refcount tracking to dst_entry") Signed-off-by: Eric Dumazet Cc: Cong Wang Acked-by: Steffen Klassert Link: https://lore.kernel.org/r/20211207193203.2706158-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit 1ff9fc708185a94c79d4def79c0a500829297575 Author: Umesh Nerlige Ramappa Date: Mon Dec 6 18:02:39 2021 -0800 drm/i915/pmu: Fix wakeref leak in PMU busyness during reset GuC PMU busyness gets gt wakeref if awake, but fails to release the wakeref if a reset is in progress. Release the wakeref if it was acquried successfully. v2: Simplify the fix (Ashutosh) Fixes: 2a67b18e67f3 ("drm/i915/pmu: Fix synchronization of PMU callback with reset") Signed-off-by: Umesh Nerlige Ramappa Reviewed-by: Ashutosh Dixit Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20211207020239.43402-1-umesh.nerlige.ramappa@intel.com commit f80fe66c38d561a006fb4f514b0ee5d11cbe2673 Merge: 5861dad198fee 81f6d49cce2d2 bc849e9192c75 1f8da406a964d 10d4703154a72 b0fe9dec66370 fd796e4139b48 53b541fbdb9c4 90b21bcfb2846 Author: Paul E. McKenney Date: Thu Dec 9 11:38:09 2021 -0800 Merge branches 'doc.2021.11.30c', 'exp.2021.12.07a', 'fastnohz.2021.11.30c', 'fixes.2021.11.30c', 'nocb.2021.12.09a', 'nolibc.2021.11.30c', 'tasks.2021.12.09a', 'torture.2021.12.07a' and 'torturescript.2021.11.30c' into HEAD doc.2021.11.30c: Documentation updates. exp.2021.12.07a: Expedited-grace-period fixes. fastnohz.2021.11.30c: Remove CONFIG_RCU_FAST_NO_HZ. fixes.2021.11.30c: Miscellaneous fixes. nocb.2021.12.09a: No-CB CPU updates. nolibc.2021.11.30c: Tiny in-kernel library updates. tasks.2021.12.09a: RCU-tasks updates, including update-side scalability. torture.2021.12.07a: Torture-test in-kernel module updates. torturescript.2021.11.30c: Torture-test scripting updates. commit 10d4703154a72fb4f30fc90a4a7212bf138c17a2 Author: Frederic Weisbecker Date: Tue Nov 23 01:37:08 2021 +0100 rcu/nocb: Merge rcu_spawn_cpu_nocb_kthread() and rcu_spawn_one_nocb_kthread() The rcu_spawn_one_nocb_kthread() function is called only from rcu_spawn_cpu_nocb_kthread(). Therefore, inline the former into the latter, saving a few lines of code. Reviewed-by: Neeraj Upadhyay Signed-off-by: Frederic Weisbecker Cc: Boqun Feng Cc: Uladzislau Rezki Cc: Josh Triplett Cc: Joel Fernandes Tested-by: Juri Lelli Signed-off-by: Paul E. McKenney commit d2cf0854d728c42524efc169edb3505de8c1a9dc Author: Frederic Weisbecker Date: Tue Nov 23 01:37:07 2021 +0100 rcu/nocb: Allow empty "rcu_nocbs" kernel parameter Allow the rcu_nocbs kernel parameter to be specified just by itself, without specifying any CPUs. This allows systems administrators to use "rcu_nocbs" to specify that none of the CPUs are to be offloaded at boot time, but than any of them may be offloaded at runtime via cpusets. In contrast, if the "rcu_nocbs" or "nohz_full" kernel parameters are not specified at all, then not only are none of the CPUs offloaded at boot, none of them can be offloaded at runtime, either. While in the area, modernize the description of the "rcuo" kthreads' naming scheme. Reviewed-by: Neeraj Upadhyay Signed-off-by: Frederic Weisbecker Cc: Boqun Feng Cc: Uladzislau Rezki Cc: Josh Triplett Cc: Joel Fernandes Tested-by: Juri Lelli Signed-off-by: Paul E. McKenney commit 2cf4528d6dd6f5a7f34ae07e26176a7932310eeb Author: Frederic Weisbecker Date: Tue Nov 23 01:37:06 2021 +0100 rcu/nocb: Create kthreads on all CPUs if "rcu_nocbs=" or "nohz_full=" are passed In order to be able to (de-)offload any CPU using cpusets in the future, create the NOCB data structures for all possible CPUs. For now this is done only as long as the "rcu_nocbs=" or "nohz_full=" kernel parameters are passed to avoid the unnecessary overhead for most users. Note that the rcuog and rcuoc kthreads are not created until at least one of the corresponding CPUs comes online. This approach avoids the creation of excess kthreads when firmware lies about the number of CPUs present on the system. Reviewed-by: Neeraj Upadhyay Signed-off-by: Frederic Weisbecker Cc: Boqun Feng Cc: Uladzislau Rezki Cc: Josh Triplett Cc: Joel Fernandes Tested-by: Juri Lelli Signed-off-by: Paul E. McKenney commit a81aeaf7a1de51400374a8e3982a3cc3ff130dd1 Author: Frederic Weisbecker Date: Tue Nov 23 01:37:05 2021 +0100 rcu/nocb: Optimize kthreads and rdp initialization Currently cpumask_available() is used to prevent from unwanted NOCB initialization. However if neither "rcu_nocbs=" nor "nohz_full=" parameters are passed to a kernel built with CONFIG_CPUMASK_OFFSTACK=n, the initialization path is still taken, running through all sorts of needless operations and iterations on an empty cpumask. Fix this by relying on a real initialization state instead. This also optimizes kthread creation, preventing needless iteration over all online CPUs when the kernel is booted without any offloaded CPUs. Reviewed-by: Neeraj Upadhyay Signed-off-by: Frederic Weisbecker Cc: Boqun Feng Cc: Uladzislau Rezki Cc: Josh Triplett Cc: Joel Fernandes Tested-by: Juri Lelli Signed-off-by: Paul E. McKenney commit 8d9703964697340e073305574de4f5df31a28ba9 Author: Frederic Weisbecker Date: Tue Nov 23 01:37:04 2021 +0100 rcu/nocb: Prepare nocb_cb_wait() to start with a non-offloaded rdp In order to be able to toggle the offloaded state from cpusets, a nocb kthread will need to be created for all possible CPUs whenever either of the "rcu_nocbs=" or "nohz_full=" parameters are specified. Therefore, the nocb_cb_wait() kthread must be prepared to start running on a de-offloaded rdp. To accomplish this, simply move the sleeping condition to the beginning of the nocb_cb_wait() function, which prevents this kthread from attempting to invoke callbacks before the corresponding CPU is offloaded. Reviewed-by: Neeraj Upadhyay Signed-off-by: Frederic Weisbecker Cc: Boqun Feng Cc: Uladzislau Rezki Cc: Josh Triplett Cc: Joel Fernandes Tested-by: Juri Lelli Signed-off-by: Paul E. McKenney commit 2ebc45c44c4f3cc4c757430b2409ece4f976892e Author: Frederic Weisbecker Date: Tue Nov 23 01:37:03 2021 +0100 rcu/nocb: Remove rcu_node structure from nocb list when de-offloaded The nocb_gp_wait() function iterates over all CPUs in its group, including even those CPUs that have been de-offloaded. This is of course suboptimal, especially if none of the CPUs within the group are currently offloaded. This will become even more of a problem once a nocb kthread is created for all possible CPUs. Therefore use a standard double linked list to link all the offloaded rcu_data structures and safely add or delete these structure as we offload or de-offload them, respectively. Reviewed-by: Neeraj Upadhyay Signed-off-by: Frederic Weisbecker Cc: Boqun Feng Cc: Uladzislau Rezki Cc: Josh Triplett Cc: Joel Fernandes Tested-by: Juri Lelli Signed-off-by: Paul E. McKenney commit 5092fb44ba11899a957d82284acad3ccaf8c7306 Merge: 9d922f5df5384 11053047a4afe Author: Jakub Kicinski Date: Thu Dec 9 11:21:06 2021 -0800 Merge branch 'net-phylink-introduce-legacy-mode-flag' Russell King says: ==================== net: phylink: introduce legacy mode flag In March 2020, phylink gained support to split the PCS support out of the MAC callbacks. By doing so, a slight behavioural difference was introduced when a PCS is present, specifically: 1) the call to mac_config() when the link comes up or advertisement changes were eliminated 2) mac_an_restart() will never be called 3) mac_pcs_get_state() will never be called The intention was to eventually remove this support once all phylink users were converted. Unfortunately, this still hasn't happened - and in some cases, it looks like it may never happen. Through discussion with Sean Anderson, we now need to allow the PCS to be optional for modern drivers, so we need a different way to identify these legacy drivers - in that we wish to allow the "modern" behaviour where mac_config() is not called on link-up events, even if there is no PCS attached. In order to do that, this series of patches introduce a "legacy_pre_march2020" which is used to permit the old behaviour - in other words, we get the old behaviour only when there is no PCS and this flag is true. Otherwise, we get the new behaviour. I decided to use the date of the change in the flag as just using "legacy" or "legacy_driver" is too non-descript. An alternative could be to use the git sha1 hash of the set of changes. I believe I have added the legacy flag to all the drivers which use legacy mode - that being the mtk_eth_soc ethernet driver, and many DSA drivers - the ones which need the old behaviour are identified by having non-NULL phylink_mac_link_state or phylink_mac_an_restart methods in their dsa_switch_ops structure. ag71xx and xilinx do not need the legacy flag. ag71xx is explained in its own commit, and xilinx only updates the inband advertisement in the mac_config() call, which is sufficient qualification to avoid it being marked legacy. ==================== Link: https://lore.kernel.org/r/Ya+DGaGmGgWrlVkW@shell.armlinux.org.uk Signed-off-by: Jakub Kicinski commit 11053047a4afe9c3403711a4a01ad67ad5073ef4 Author: Russell King (Oracle) Date: Thu Dec 9 13:11:53 2021 +0000 net: ag71xx: remove unnecessary legacy methods ag71xx may have a PCS, but it does not appear to support configuration of the PCS in the current code. The functions to get its state merely report that the link is down, and the AN restart function is empty. Since neither of these functions will be called unless phylink's legacy flag is set, we can safely remove these functions and indicate this is a modern driver. Should PCS support be added later, it will need to be modelled using the phylink_pcs support rather than operating as a legacy driver. Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit 001f4261fe4d5ae710cf1f445b6cae6d9d3ae26e Author: Russell King (Oracle) Date: Thu Dec 9 13:11:48 2021 +0000 net: phylink: use legacy_pre_march2020 Use the legacy flag to indicate whether we should operate in legacy mode. This allows us to stop using the presence of a PCS as an indicator to the age of the phylink user, and make PCS presence optional. Legacy mode involves: 1) calling mac_config() whenever the link comes up 2) calling mac_config() whenever the inband advertisement changes, possibly followed by a call to mac_an_restart() 3) making use of mac_an_restart() 4) making use of mac_pcs_get_state() All the above functionality was moved to a seperate "PCS" block of operations in March 2020. Update the documents to indicate that the differences that this flag makes. Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit b06515367facfadcf5e70cf6f39db749cf4eb5e3 Author: Russell King (Oracle) Date: Thu Dec 9 13:11:43 2021 +0000 net: mtk_eth_soc: mark as a legacy_pre_march2020 driver mtk_eth_soc has not been updated for commit 7cceb599d15d ("net: phylink: avoid mac_config calls"), and makes use of state->speed and state->duplex in contravention of the phylink documentation. This makes reliant on the legacy behaviours, so mark it as a legacy driver. Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit 0a9f0794d9bd67e590a9488afe87fbb0419d9539 Author: Russell King (Oracle) Date: Thu Dec 9 13:11:38 2021 +0000 net: dsa: mark DSA phylink as legacy_pre_march2020 The majority of DSA drivers do not make use of the PCS support, and thus operate in legacy mode. In order to preserve this behaviour in future, we need to set the legacy_pre_march2020 flag so phylink knows this may require the legacy calls. There are some DSA drivers that do make use of PCS support, and these will continue operating as before - legacy_pre_march2020 will not prevent split-PCS support enabling the newer phylink behaviour. Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit 3e5b1feccea7db576353ffc302f78d522e4116e6 Author: Russell King (Oracle) Date: Thu Dec 9 13:11:32 2021 +0000 net: phylink: add legacy_pre_march2020 indicator Add a boolean to phylink_config to indicate whether a driver has not been updated for the changes in commit 7cceb599d15d ("net: phylink: avoid mac_config calls"), and thus are reliant on the old behaviour. We were currently keying the phylink behaviour on the presence of a PCS, but this is sub-optimal for modern drivers that may not have a PCS. This commit merely introduces the new flag, but does not add any use, since we need all legacy drivers to set this flag before it can be used. Once these legacy drivers have been updated, we can remove this flag. Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit ba2e524d918ab72c0e5edc02354bd6cb43d005f8 Author: Lukas Czerner Date: Wed Oct 27 16:18:57 2021 +0200 ext4: Remove unused match_table_t tokens Remove unused match_table_t, slim down mount_opts structure by removing unnecessary definitions, remove redundant MOPT_ flags and clean up ext4_parse_param() by converting the most of the if/else branching to switch except for the MOPT_SET/MOPT_CEAR handling. Signed-off-by: Lukas Czerner Reviewed-by: Carlos Maiolino Link: https://lore.kernel.org/r/20211027141857.33657-14-lczerner@redhat.com Signed-off-by: Theodore Ts'o commit cebe85d570cf84804e848332d6721bc9e5300e07 Author: Lukas Czerner Date: Wed Oct 27 16:18:56 2021 +0200 ext4: switch to the new mount api Add the necessary functions for the fs_context_operations. Convert and rename ext4_remount() and ext4_fill_super() to ext4_get_tree() and ext4_reconfigure() respectively and switch the ext4 to use the new api. One user facing change is the fact that we no longer have access to the entire string of mount options provided by mount(2) since the mount api does not store it anywhere. As a result we can't print the options to the log as we did in the past after the successful mount. Signed-off-by: Lukas Czerner Reviewed-by: Carlos Maiolino Link: https://lore.kernel.org/r/20211027141857.33657-13-lczerner@redhat.com Signed-off-by: Theodore Ts'o commit 97d8a670b4531437d5b842cf68dafa6d1a932ddf Author: Lukas Czerner Date: Wed Oct 27 16:18:55 2021 +0200 ext4: change token2str() to use ext4_param_specs Change token2str() to use ext4_param_specs instead of tokens so that we can get rid of tokens entirely. Signed-off-by: Lukas Czerner Reviewed-by: Carlos Maiolino Link: https://lore.kernel.org/r/20211027141857.33657-12-lczerner@redhat.com Signed-off-by: Theodore Ts'o commit 02f960f8db1cd0aa9c182f8804b2b41ffd2c37b2 Author: Lukas Czerner Date: Wed Oct 27 16:18:54 2021 +0200 ext4: clean up return values in handle_mount_opt() Clean up return values in handle_mount_opt() and rename the function to ext4_parse_param() Now we can use it in fs_context_operations as .parse_param. Signed-off-by: Lukas Czerner Reviewed-by: Carlos Maiolino Link: https://lore.kernel.org/r/20211027141857.33657-11-lczerner@redhat.com Signed-off-by: Theodore Ts'o commit 7edfd85b1ffd36593011dec96ab395912a340418 Author: Lukas Czerner Date: Wed Oct 27 16:18:53 2021 +0200 ext4: Completely separate options parsing and sb setup The new mount api separates option parsing and super block setup into two distinct steps and so we need to separate the options parsing out of the ext4_fill_super() and ext4_remount(). In order to achieve this we have to create new ext4_fill_super() and ext4_remount() functions which will serve its purpose only until we actually do convert to the new api (as such they are only temporary for this patch series) and move the option parsing out of the old function which will now be renamed to __ext4_fill_super() and __ext4_remount(). There is a small complication in the fact that while the mount option parsing is going to happen before we get to __ext4_fill_super(), the mount options stored in the super block itself needs to be applied first, before the user specified mount options. So with this patch we're going through the following sequence: - parse user provided options (including sb block) - initialize sbi and store s_sb_block if provided - in __ext4_fill_super() - read the super block - parse and apply options specified in s_mount_opts - check and apply user provided options stored in ctx - continue with the regular ext4_fill_super operation It's not exactly the most elegant solution, but if we still want to support s_mount_opts we have to do it in this order. Signed-off-by: Lukas Czerner Reviewed-by: Carlos Maiolino Link: https://lore.kernel.org/r/20211027141857.33657-10-lczerner@redhat.com Signed-off-by: Theodore Ts'o commit 6e47a3cc68fc525428297a00524833361ebbb0e9 Author: Lukas Czerner Date: Wed Oct 27 16:18:52 2021 +0200 ext4: get rid of super block and sbi from handle_mount_ops() At the parsing phase of mount in the new mount api sb will not be available. We've already removed some uses of sb and sbi, but now we need to get rid of the rest of it. Use ext4_fs_context to store all of the configuration specification so that it can be later applied to the super block and sbi. Signed-off-by: Lukas Czerner Reviewed-by: Carlos Maiolino Link: https://lore.kernel.org/r/20211027141857.33657-9-lczerner@redhat.com Signed-off-by: Theodore Ts'o commit b6bd243500b6024d92eaaacf592ed8588c2c75ea Author: Lukas Czerner Date: Wed Oct 27 16:18:51 2021 +0200 ext4: check ext2/3 compatibility outside handle_mount_opt() At the parsing phase of mount in the new mount api sb will not be available so move ext2/3 compatibility check outside handle_mount_opt(). Unfortunately we will lose the ability to show exactly which option is not compatible. Signed-off-by: Lukas Czerner Reviewed-by: Carlos Maiolino Link: https://lore.kernel.org/r/20211027141857.33657-8-lczerner@redhat.com Signed-off-by: Theodore Ts'o commit e6e268cb682290da29e3c8408493a4474307b8cc Author: Lukas Czerner Date: Wed Oct 27 16:18:50 2021 +0200 ext4: move quota configuration out of handle_mount_opt() At the parsing phase of mount in the new mount api sb will not be available so move quota confiquration out of handle_mount_opt() by noting the quota file names in the ext4_fs_context structure to be able to apply it later. Signed-off-by: Lukas Czerner Reviewed-by: Carlos Maiolino Link: https://lore.kernel.org/r/20211027141857.33657-7-lczerner@redhat.com Signed-off-by: Theodore Ts'o commit da812f611934bef16fe02d667a76df77ae9cf99a Author: Lukas Czerner Date: Wed Oct 27 16:18:49 2021 +0200 ext4: Allow sb to be NULL in ext4_msg() At the parsing phase of mount in the new mount api sb will not be available so allow sb to be NULL in ext4_msg and use that in handle_mount_opt(). Also change return value to appropriate -EINVAL where needed. Signed-off-by: Lukas Czerner Reviewed-by: Carlos Maiolino Link: https://lore.kernel.org/r/20211027141857.33657-6-lczerner@redhat.com Signed-off-by: Theodore Ts'o commit 461c3af045d3ab949360fedbfb3ea1dcd9d8b22b Author: Lukas Czerner Date: Wed Oct 27 16:18:48 2021 +0200 ext4: Change handle_mount_opt() to use fs_parameter Use the new mount option specifications to parse the options in handle_mount_opt(). However we're still using the old API to get the options string. Signed-off-by: Lukas Czerner Reviewed-by: Carlos Maiolino Link: https://lore.kernel.org/r/20211027141857.33657-5-lczerner@redhat.com Signed-off-by: Theodore Ts'o commit 4c94bff967d90e91ace38a9886c1c7777a9c6f91 Author: Lukas Czerner Date: Wed Oct 27 16:18:47 2021 +0200 ext4: move option validation to a separate function Move option validation out of parse_options() into a separate function ext4_validate_options(). Signed-off-by: Lukas Czerner Reviewed-by: Carlos Maiolino Link: https://lore.kernel.org/r/20211027141857.33657-4-lczerner@redhat.com Signed-off-by: Theodore Ts'o commit e5a185c26c11cbd1d386be8ee4c5e57b4f62273a Author: Lukas Czerner Date: Wed Oct 27 16:18:46 2021 +0200 ext4: Add fs parameter specifications for mount options Create an array of fs_parameter_spec called ext4_param_specs to hold the mount option specifications we're going to be using with the new mount api. Signed-off-by: Lukas Czerner Reviewed-by: Carlos Maiolino Link: https://lore.kernel.org/r/20211027141857.33657-3-lczerner@redhat.com Signed-off-by: Theodore Ts'o commit 6abfaaf124a81b7d2ab132cc2c9885baa14171e5 Author: Lukas Czerner Date: Wed Oct 27 16:18:45 2021 +0200 fs_parse: allow parameter value to be empty Allow parameter value to be empty by specifying fs_param_can_be_empty flag. Signed-off-by: Lukas Czerner Cc: Al Viro Reviewed-by: Carlos Maiolino Link: https://lore.kernel.org/r/20211027141857.33657-2-lczerner@redhat.com Signed-off-by: Theodore Ts'o commit 35fa745286ac44ee26ed100c2bd2553368ad193b Author: Sebastian Andrzej Siewior Date: Tue Nov 2 17:52:24 2021 +0100 x86/mm: Include spinlock_t definition in pgtable. This header file provides forward declartion for pgd_lock but does not include the header defining its type. This works since the definition of spinlock_t is usually included somehow via printk. By trying to avoid recursive includes on PREEMPT_RT I avoided the loop in printk and as a consequnce kernel/intel.c failed to compile due to missing type definition. Include the needed definition for spinlock_t. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Dave Hansen Link: https://lkml.kernel.org/r/20211102165224.wpz4zyhsvwccx5p3@linutronix.de commit fd796e4139b481733a701c4d406056538f4c73cc Author: Paul E. McKenney Date: Mon Nov 29 16:52:31 2021 -0800 rcu-tasks: Use fewer callbacks queues if callback flood ends By default, when lock contention is encountered, the RCU Tasks flavors of RCU switch to using per-CPU queueing. However, if the callback flood ends, per-CPU queueing continues to be used, which introduces significant additional overhead, especially for callback invocation, which fans out a series of workqueue handlers. This commit therefore switches back to single-queue operation if at the beginning of a grace period there are very few callbacks. The definition of "very few" is set by the rcupdate.rcu_task_collapse_lim module parameter, which defaults to 10. This switch happens in two phases, with the first phase causing future callbacks to be enqueued on CPU 0's queue, but with all queues continuing to be checked for grace periods and callback invocation. The second phase checks to see if an RCU grace period has elapsed and if all remaining RCU-Tasks callbacks are queued on CPU 0. If so, only CPU 0 is checked for future grace periods and callback operation. Of course, the return of contention anywhere during this process will result in returning to per-CPU callback queueing. Reported-by: Martin Lau Cc: Neeraj Upadhyay Signed-off-by: Paul E. McKenney commit 2cee0789b458afa384c422b5969c1a338891fd33 Author: Paul E. McKenney Date: Mon Nov 29 11:46:33 2021 -0800 rcu-tasks: Use separate ->percpu_dequeue_lim for callback dequeueing Decreasing the number of callback queues is a bit tricky because it is necessary to handle callbacks that were queued before the number of queues decreased, but which were not ready to invoke until afterwards. This commit takes a first step in this direction by maintaining a separate ->percpu_dequeue_lim to control callback dequeueing, in addition to the existing ->percpu_enqueue_lim which now controls only enqueueing. Reported-by: Martin Lau Cc: Neeraj Upadhyay Signed-off-by: Paul E. McKenney commit ab97152f88a4d580b89f0b7cc3028ffac438216f Author: Paul E. McKenney Date: Wed Nov 24 15:12:15 2021 -0800 rcu-tasks: Use more callback queues if contention encountered The rcupdate.rcu_task_enqueue_lim module parameter allows system administrators to tune the number of callback queues used by the RCU Tasks flavors. However if callback storms are infrequent, it would be better to operate with a single queue on a given system unless and until that system actually needed more queues. Systems not needing more queues can then avoid the overhead of checking the extra queues and especially avoid the overhead of fanning workqueue handlers out to all CPUs to invoke callbacks. This commit therefore switches to using all the CPUs' callback queues if call_rcu_tasks_generic() encounters too much lock contention. The amount of lock contention to tolerate defaults to 100 contended lock acquisitions per jiffy, and can be adjusted using the new rcupdate.rcu_task_contend_lim module parameter. Such switching is undertaken only if the rcupdate.rcu_task_enqueue_lim module parameter is negative, which is its default value (-1). This allows savvy systems administrators to set the number of queues to some known good value and to not have to worry about the kernel doing any second guessing. [ paulmck: Apply feedback from Guillaume Tucker and kernelci. ] Reported-by: Martin Lau Cc: Neeraj Upadhyay Signed-off-by: Paul E. McKenney commit 3063b33a347c088e87516764d487e46fea3dfc94 Author: Paul E. McKenney Date: Tue Nov 23 16:16:50 2021 -0800 rcu-tasks: Avoid raw-spinlocked wakeups from call_rcu_tasks_generic() If the caller of of call_rcu_tasks(), call_rcu_tasks_rude(), or call_rcu_tasks_trace() holds a raw spinlock, and then if call_rcu_tasks_generic() determines that the grace-period kthread must be awakened, then the wakeup might acquire a normal spinlock while a raw spinlock is held. This results in lockdep splats when the kernel is built with CONFIG_PROVE_RAW_LOCK_NESTING=y. This commit therefore defers the wakeup using irq_work_queue(). It would be nice to directly invoke wakeup when a raw spinlock is not held, but there is currently no way to check for this in all kernels. Reported-by: Martin Lau Cc: Neeraj Upadhyay Signed-off-by: Paul E. McKenney commit 7d13d30bb6c54b57d196eab89dea2729a565dbd7 Author: Paul E. McKenney Date: Mon Nov 22 13:38:42 2021 -0800 rcu-tasks: Count trylocks to estimate call_rcu_tasks() contention This commit converts the unconditional raw_spin_lock_rcu_node() lock acquisition in call_rcu_tasks_generic() to a trylock followed by an unconditional acquisition if the trylock fails. If the trylock fails, the failure is counted, but the count is reset to zero on each new jiffy. This statistic will be used to determine when to move from a single callback queue to per-CPU callback queues. Reported-by: Martin Lau Cc: Neeraj Upadhyay Signed-off-by: Paul E. McKenney commit 8610b65680390a103b58f46282a1b05f7eebbba4 Author: Paul E. McKenney Date: Fri Nov 12 07:33:40 2021 -0800 rcu-tasks: Add rcupdate.rcu_task_enqueue_lim to set initial queueing This commit adds a rcupdate.rcu_task_enqueue_lim module parameter that sets the initial number of callback queues to use for the RCU Tasks family of RCU implementations. This parameter allows testing of various fanout values. Reported-by: Martin Lau Cc: Neeraj Upadhyay Signed-off-by: Paul E. McKenney commit ce9b1c667f03e0aa30d3eb69d0932e010d131c49 Author: Paul E. McKenney Date: Thu Nov 11 14:53:43 2021 -0800 rcu-tasks: Make rcu_barrier_tasks*() handle multiple callback queues Currently, rcu_barrier_tasks(), rcu_barrier_tasks_rude(), and rcu_barrier_tasks_trace() simply invoke the corresponding synchronize_rcu_tasks*() function. This works because there is only one callback queue. However, there will soon be multiple callback queues. This commit therefore scans the queues currently in use, entraining a callback on each non-empty queue. Sequence numbers and reference counts are used to synchronize this process in a manner similar to the approach taken by rcu_barrier(). Reported-by: Martin Lau Cc: Neeraj Upadhyay Signed-off-by: Paul E. McKenney commit d363f833c6d88331ff013ff0970a96caa8b84653 Author: Paul E. McKenney Date: Wed Nov 10 15:56:40 2021 -0800 rcu-tasks: Use workqueues for multiple rcu_tasks_invoke_cbs() invocations If there is a flood of callbacks, it is necessary to put multiple CPUs to work invoking those callbacks. This commit therefore uses a workqueue-flooding approach to parallelize RCU Tasks callback execution. Reported-by: Martin Lau Cc: Neeraj Upadhyay Signed-off-by: Paul E. McKenney commit 57881863ad15fbccbfa637b5e4b67cd3a4520643 Author: Paul E. McKenney Date: Tue Nov 9 15:34:56 2021 -0800 rcu-tasks: Abstract invocations of callbacks This commit adds a rcu_tasks_invoke_cbs() function that invokes all ready callbacks on all of the per-CPU lists that are currently in use. Reported-by: Martin Lau Cc: Neeraj Upadhyay Signed-off-by: Paul E. McKenney commit 4d1114c05467b5f421d99121bff22a9633390722 Author: Paul E. McKenney Date: Tue Nov 9 13:37:34 2021 -0800 rcu-tasks: Abstract checking of callback lists This commit adds a rcu_tasks_need_gpcb() function that returns an indication of whether another grace period is required, and if no grace period is required, whether there are callbacks that need to be invoked. The function scans all per-CPU lists currently in use. Reported-by: Martin Lau Cc: Neeraj Upadhyay Signed-off-by: Paul E. McKenney commit 94eb7de6f4bec1c8bb99371c21df42cac0de6ee9 Author: Zack Rusin Date: Wed Dec 8 21:49:24 2021 -0500 drm/vmwgfx: Bump the minor version v2: Old userspace doesn't like 3.x.x and we'd like to keep it working, so lets just bump the minor version until we have no choice. With GEM, GL4.3, stats and removal of a lot of old code it's time to bump the minor version of the driver. Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev Link: https://patchwork.freedesktop.org/patch/msgid/20211209024924.3298137-1-zack@kde.org commit 9ca476acd5e8725706c6ef3b0d94d3005836ffdc Author: Zack Rusin Date: Mon Dec 6 12:26:19 2021 -0500 drm/vmwgfx: Remove usage of MOBFMT_RANGE Using MOBFMT_RANGE in the early days of guest backed objects was a major performance win but that has changed a lot since. There's no more a performance reason to use MOBFMT_RANGE. The device can/will still profit from the pages being contiguous but marking them as MOBFMT_RANGE no longer matters. Benchmarks (e.g. heaven, valley) show that creating page tables for mob memory is actually faster than using mobfmt ranges. Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev Link: https://patchwork.freedesktop.org/patch/msgid/20211206172620.3139754-12-zack@kde.org commit bf625870b8309b4af75f9c19d287d0c9230634d3 Author: Roland Scheidegger Date: Mon Dec 6 12:26:18 2021 -0500 drm/vmwgfx: add support for updating only offsets of constant buffers This adds support for the SVGA_3D_CMD_DX_SET_VS/PS/GS/HS/DS/CS_CONSTANT_BUFFER_OFFSET commands (which only update the offset, but don't rebind the buffer), which saves some overhead. Signed-off-by: Roland Scheidegger Reviewed-by: Charmaine Lee Reviewed-by: Martin Krastev Signed-off-by: Zack Rusin Link: https://patchwork.freedesktop.org/patch/msgid/20211206172620.3139754-11-zack@kde.org commit abaad3d95b5117a17886d37cf0228712801cd259 Author: Zack Rusin Date: Mon Dec 6 12:26:17 2021 -0500 drm/vmwgfx: Allow checking for gl43 contexts To make sure we're running on top of hardware that can support GL4.3 we need to add a way of querying for those capabilities. DRM_VMW_PARAM_GL43 allows userspace to check for presence of GL4.3 capable contexts. Signed-off-by: Zack Rusin Reviewed-by: Charmaine Lee Link: https://patchwork.freedesktop.org/patch/msgid/20211206172620.3139754-10-zack@kde.org commit 4fb9326b96cbf9f751086969161a6c1d75bcd8f9 Author: Zack Rusin Date: Mon Dec 6 12:26:16 2021 -0500 drm/vmwgfx: support 64 UAVs If the host supports SVGA3D_DEVCAP_GL43, we can handle 64 instead of just 8 UAVs. Based on a patch from Roland Scheidegger . Signed-off-by: Roland Scheidegger Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev Link: https://patchwork.freedesktop.org/patch/msgid/20211206172620.3139754-9-zack@kde.org commit 853369df34fb61f47ab883586e14d0fcd8c47437 Author: Roland Scheidegger Date: Mon Dec 6 12:26:15 2021 -0500 drm/vmwgfx: support SVGA_3D_CMD_DX_DEFINE_RASTERIZER_STATE_V2 command This is going to be required for setting the sample count when rendering with no attachments. Also cleans up view handling (should fix depthstencil_v2). Reviewed-by: Charmaine Lee Signed-off-by: Roland Scheidegger Signed-off-by: Zack Rusin Link: https://patchwork.freedesktop.org/patch/msgid/20211206172620.3139754-8-zack@kde.org commit b05fa56425f5028520b5c1457b96bb68dc74bf7c Author: Zack Rusin Date: Mon Dec 6 12:26:14 2021 -0500 drm/vmwgfx: Update device headers for GL43 Update the headers for GL43 userspace works that landed in Mesa3D. Also update the license headers to conform to the kernel guidelines. For GL43 the virtual device got D3D11.1 support with some GL extensions. Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev Link: https://patchwork.freedesktop.org/patch/msgid/20211206172620.3139754-7-zack@kde.org commit 24df43d93d72c5bb86165e5e59c64f909ab0149a Author: Zack Rusin Date: Mon Dec 6 12:26:13 2021 -0500 drm/vmwgfx: Implement create_handle on drm_framebuffer_funcs The fb handle code assumes it deals with GEM objects. Because vmwgfx buffer objects were not actually GEM objects we were not able to implement that interface. Now that vmwgfx supports GEM buffer objects we can trivially implement create_handle for buffer object backed framebuffers. Among others this gets IGT's kms_getfb test passing. Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev Link: https://patchwork.freedesktop.org/patch/msgid/20211206172620.3139754-6-zack@kde.org commit 8afa13a0583f94c14607e3041c02f068ac8fb628 Author: Zack Rusin Date: Mon Dec 6 12:26:12 2021 -0500 drm/vmwgfx: Implement DRIVER_GEM This is initial change adding support for DRIVER_GEM to vmwgfx. vmwgfx was written before GEM and has always used TTM. Over the years the TTM buffers started inherting from GEM objects but vmwgfx never implemented GEM making it quite awkward. We were directly setting variables in GEM objects to not make DRM crash. This change brings vmwgfx inline with other DRM drivers and allows us to use a lot of DRM helpers which have depended on drivers with GEM support. Due to historical reasons vmwgfx splits the idea of a buffer and surface which makes it a littly tricky since either one can be used in most of our ioctl's which take user space handles. For now our BO's are GEM objects and our surfaces are opaque objects which are backed by GEM objects. In the future I'd like to combine those into a single BO but we don't want to break any of our existing ioctl's so it will take time to do it in a non-destructive way. Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev Link: https://patchwork.freedesktop.org/patch/msgid/20211206172620.3139754-5-zack@kde.org commit 8ad0c3fd132bef4b849b3770038a6b533fa49579 Author: Zack Rusin Date: Mon Dec 6 12:26:11 2021 -0500 drm/vmwgfx: Stop hardcoding the PCI ID Instead of hardcoding the VMware's PCI ID the code should be using the public define for it. There's no functional change, it just makes it obvious what we're dealing with. Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev Link: https://patchwork.freedesktop.org/patch/msgid/20211206172620.3139754-4-zack@kde.org commit f4708c16a6d7da93baee9ebf9cd46359b4a34bd7 Author: Zack Rusin Date: Mon Dec 6 12:26:10 2021 -0500 drm/vmwgfx: Add a debug callback to mobid resource manager Mob/GMR id resource manager was lacking the debug print callback which meant that during memory errors we weren't getting the details which are needed to fix those errors. Kernel logs need to contain the information about used/max pages by the Mob/GMR id resource manager as well as the maximum number of id's they're allowed to allocate. Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev Link: https://patchwork.freedesktop.org/patch/msgid/20211206172620.3139754-3-zack@kde.org commit 8aadeb8ad874b3b13431fd08c1ddb6d5e0212c7f Author: Zack Rusin Date: Mon Dec 6 12:26:09 2021 -0500 drm/vmwgfx: Remove the dedicated memory accounting vmwgfx shared very elaborate memory accounting with ttm. It was moved from ttm to vmwgfx in change f07069da6b4c ("drm/ttm: move memory accounting into vmwgfx v4") but because of complexity it was hard to maintain. Some parts of the code weren't freeing memory correctly and some were missing accounting all together. While those would be fairly easy to fix the fundamental reason for memory accounting in the driver was the ability to invoke shrinker which is part of TTM code as well (with support for unified memory hopefully coming soon). That meant that vmwgfx had a lot of code that was either unused or duplicating code from TTM. Removing this code also prevents excessive calls to global swapout which were common during memory pressure because both vmwgfx and TTM would invoke the shrinker when memory usage reached half of RAM. Fixes: f07069da6b4c ("drm/ttm: move memory accounting into vmwgfx v4") Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev Link: https://patchwork.freedesktop.org/patch/msgid/20211206172620.3139754-2-zack@kde.org commit 8dd593fddd630e7dcbe79e98ff5e0d0561e9ff27 Author: Paul E. McKenney Date: Tue Nov 9 11:11:32 2021 -0800 rcu-tasks: Add a ->percpu_enqueue_lim to the rcu_tasks structure This commit adds a ->percpu_enqueue_lim field to the rcu_tasks structure. This field contains two to the power of the ->percpu_enqueue_shift field, easing construction of iterators over the per-CPU queues that might contain RCU Tasks callbacks. Such iterators will be introduced in later commits. Reported-by: Martin Lau Cc: Neeraj Upadhyay Signed-off-by: Paul E. McKenney commit 65b629e70489b810a108fe1155da4e41a5010534 Author: Neeraj Upadhyay Date: Tue Nov 9 16:52:14 2021 +0530 rcu-tasks: Inspect stalled task's trc state in locked state On RCU tasks trace stall, inspect the RCU-tasks-trace specific states of stalled task in locked down state, using try_invoke_ on_locked_down_task(), to get reliable trc state of a non-running stalled task. This was tested using the following command: tools/testing/selftests/rcutorture/bin/kvm.sh --cpus 8 --configs TRACE01 \ --bootargs "rcutorture.torture_type=tasks-tracing rcutorture.stall_cpu=10 \ rcutorture.stall_cpu_block=1 rcupdate.rcu_task_stall_timeout=100" --trust-make As expected, this produced the following console output for running and sleeping tasks. [ 21.520291] INFO: rcu_tasks_trace detected stalls on tasks: [ 21.521292] P85: ... nesting: 1N cpu: 2 [ 21.521966] task:rcu_torture_sta state:D stack:15080 pid: 85 ppid: 2 flags:0x00004000 [ 21.523384] Call Trace: [ 21.523808] __schedule+0x273/0x6e0 [ 21.524428] schedule+0x35/0xa0 [ 21.524971] schedule_timeout+0x1ed/0x270 [ 21.525690] ? del_timer_sync+0x30/0x30 [ 21.526371] ? rcu_torture_writer+0x720/0x720 [ 21.527106] rcu_torture_stall+0x24a/0x270 [ 21.527816] kthread+0x115/0x140 [ 21.528401] ? set_kthread_struct+0x40/0x40 [ 21.529136] ret_from_fork+0x22/0x30 [ 21.529766] 1 holdouts [ 21.632300] INFO: rcu_tasks_trace detected stalls on tasks: [ 21.632345] rcu_torture_stall end. [ 21.633293] P85: . [ 21.633294] task:rcu_torture_sta state:R running task stack:15080 pid: 85 ppid: 2 flags:0x00004000 [ 21.633299] Call Trace: [ 21.633301] ? vprintk_emit+0xab/0x180 [ 21.633306] ? vprintk_emit+0x11a/0x180 [ 21.633308] ? _printk+0x4d/0x69 [ 21.633311] ? __default_send_IPI_shortcut+0x1f/0x40 [ paulmck: Update to new v5.16 task_call_func() name. ] Signed-off-by: Neeraj Upadhyay Signed-off-by: Paul E. McKenney commit 381a4f3b38603aab47e5500609d5ec733b5d0ecb Author: Paul E. McKenney Date: Mon Nov 8 16:52:02 2021 -0800 rcu-tasks: Use spin_lock_rcu_node() and friends This commit renames the rcu_tasks_percpu structure's ->cbs_pcpu_lock to ->lock and then uses spin_lock_rcu_node() and friends to acquire and release this lock, preparing for upcoming commits that will spread the grace-period process across multiple CPUs and kthreads. [ paulmck: Apply feedback from kernel test robot. ] Reported-by: Martin Lau Cc: Neeraj Upadhyay Signed-off-by: Paul E. McKenney commit d8f6ef45a623d650f9b97e11553adb4978f6aa70 Author: David Woodhouse Date: Sun Nov 21 12:54:46 2021 +0000 KVM: arm64: Use Makefile.kvm for common files Signed-off-by: David Woodhouse Acked-by: Marc Zyngier Message-Id: <20211121125451.9489-8-dwmw2@infradead.org> Signed-off-by: Paolo Bonzini commit 5f33868af8f4cd688cadff44a67d934684548011 Author: David Woodhouse Date: Sun Nov 21 12:54:45 2021 +0000 KVM: powerpc: Use Makefile.kvm for common files It's all fairly baroque but in the end, I don't think there's any reason for $(KVM)/irqchip.o to have been handled differently, as they all end up in $(kvm-y) in the end anyway, regardless of whether they get there via $(common-objs-y) and the CPU-specific object lists. Signed-off-by: David Woodhouse Acked-by: Michael Ellerman (powerpc) Message-Id: <20211121125451.9489-7-dwmw2@infradead.org> Signed-off-by: Paolo Bonzini commit 3e3aa26fd4c44c4aec44b494b69b74dacbeb4685 Author: David Woodhouse Date: Sun Nov 21 12:54:44 2021 +0000 KVM: RISC-V: Use Makefile.kvm for common files Signed-off-by: David Woodhouse Message-Id: <20211121125451.9489-6-dwmw2@infradead.org> Signed-off-by: Paolo Bonzini commit ae1b606e6207476d97d642010b2775a9465a46d6 Author: David Woodhouse Date: Sun Nov 21 12:54:43 2021 +0000 KVM: mips: Use Makefile.kvm for common files Signed-off-by: David Woodhouse Message-Id: <20211121125451.9489-5-dwmw2@infradead.org> Signed-off-by: Paolo Bonzini commit f786ab1bf17af973d80ab648ee22d037d1ffebec Author: David Woodhouse Date: Sun Nov 21 12:54:42 2021 +0000 KVM: s390: Use Makefile.kvm for common files Signed-off-by: David Woodhouse Reviewed-by: Christian Borntraeger Message-Id: <20211121125451.9489-4-dwmw2@infradead.org> Signed-off-by: Paolo Bonzini commit df0114f1f8711dbf481324c44cf5a8349130b913 Author: Colin Ian King Date: Tue Dec 7 22:37:35 2021 +0000 x86/resctrl: Remove redundant assignment to variable chunks The variable chunks is being shifted right and re-assinged the shifted value which is then returned. Since chunks is not being read afterwards the assignment is redundant and the >>= operator can be replaced with a shift >> operator instead. Signed-off-by: Colin Ian King Signed-off-by: Dave Hansen Reviewed-by: Fenghua Yu Link: https://lkml.kernel.org/r/20211207223735.35173-1-colin.i.king@gmail.com commit 0b64e2e43ddeb010d3f2a45f978e6cb919cd0895 Author: Umesh Nerlige Ramappa Date: Wed Dec 8 10:33:13 2021 -0800 drm/i915/pmu: Wait longer for busyness data to be available from GuC live_engine_busy_stats waits for busyness to start ticking before sampling busyness for the test sample duration. The wait accesses an MMIO register and the uncore call to read it takes up to 3 ms in the worst case. This can result in the wait timing out since the MMIO read itself consumes up the timeout of 500us. Increase the timeout to a larger value of 10ms to account for the MMIO read time. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/4536 Fixes: 77cdd054dd2c ("drm/i915/pmu: Connect engine busyness stats from GuC to pmu") Signed-off-by: Umesh Nerlige Ramappa Reviewed-by: Matthew Brost Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20211208183313.13126-1-umesh.nerlige.ramappa@intel.com commit 6f2cdbdba43e4afad8df1ab06797c83e3af4a3dc Author: David Woodhouse Date: Sun Nov 21 12:54:41 2021 +0000 KVM: Add Makefile.kvm for common files, use it for x86 Splitting kvm_main.c out into smaller and better-organized files is slightly non-trivial when it involves editing a bunch of per-arch KVM makefiles. Provide virt/kvm/Makefile.kvm for them to include. Signed-off-by: David Woodhouse Acked-by: Marc Zyngier Message-Id: <20211121125451.9489-3-dwmw2@infradead.org> Signed-off-by: Paolo Bonzini commit dc70ec217cec504e6f8fee8fd91bf5c118af05f2 Author: David Woodhouse Date: Sun Nov 21 12:54:40 2021 +0000 KVM: Introduce CONFIG_HAVE_KVM_DIRTY_RING I'd like to make the build include dirty_ring.c based on whether the arch wants it or not. That's a whole lot simpler if there's a config symbol instead of doing it implicitly on KVM_DIRTY_LOG_PAGE_OFFSET being set to something non-zero. Signed-off-by: David Woodhouse Message-Id: <20211121125451.9489-2-dwmw2@infradead.org> Signed-off-by: Paolo Bonzini commit ac55b3f00c323cf09d59a191e14bcf39b691078c Author: Minghao Chi Date: Thu Dec 9 08:00:51 2021 +0000 samples/bpf: Remove unneeded variable Return value directly instead of taking this in another redundant variable. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211209080051.421844-1-chi.minghao@zte.com.cn commit 3f0565451cc0c5158513af0bc4e91aa8fb0b5e75 Author: Thierry Reding Date: Tue Dec 7 13:48:55 2021 +0100 dt-bindings: pwm: Avoid selecting schema on node name match Currently any node whose name starts with the "pwm-" prefix will match this schema and in turn required the "#pwm-cells" property. Avoid this by marking the schema with select: false, therefore only activating the schema when directly included from a PWM controller schema file. Signed-off-by: Thierry Reding Acked-by: Rob Herring Signed-off-by: Thierry Reding commit 2bcb9c25081d116afa3796133033ea3f2f02ee8b Author: H. Nikolaus Schaller Date: Thu Dec 2 19:39:53 2021 +0100 MIPS: DTS: Ingenic: adjust register size to available registers After getting the regmap size from the device tree we should reduce the ranges to the really available registers. This allows to read only existing registers from the debug fs and makes the regmap check out-of-bounds access. For the jz4780 we have done this already. Suggested-for: Paul Cercueil Signed-off-by: H. Nikolaus Schaller Signed-off-by: Thomas Bogendoerfer commit 27d56190de33151862df8add5f8984a3ca441062 Author: H. Nikolaus Schaller Date: Thu Dec 2 19:39:52 2021 +0100 MIPS: defconfig: CI20: configure for DRM_DW_HDMI_JZ4780 Enable CONFIG options as modules. Signed-off-by: Ezequiel Garcia Signed-off-by: H. Nikolaus Schaller Signed-off-by: Thomas Bogendoerfer commit ae1b8d2c2de99f50647dbab9c0d74481c670a5a4 Author: Paul Boddie Date: Thu Dec 2 19:39:51 2021 +0100 MIPS: DTS: CI20: Add DT nodes for HDMI setup We need to hook up * HDMI connector * HDMI power regulator * JZ4780_CLK_HDMI @ 27 MHz * DDC pinmux * HDMI and LCDC endpoint connections Signed-off-by: Paul Boddie Signed-off-by: H. Nikolaus Schaller Signed-off-by: Thomas Bogendoerfer commit 9375100da3161b04db84a1f1b9a5f35a34ae0240 Author: Paul Boddie Date: Thu Dec 2 19:39:50 2021 +0100 MIPS: DTS: jz4780: Account for Synopsys HDMI driver and LCD controllers A specialisation of the generic Synopsys HDMI driver is employed for JZ4780 HDMI support. This requires a new driver, plus device tree and configuration modifications. Here we add jz4780 device tree setup. Signed-off-by: Paul Boddie Signed-off-by: H. Nikolaus Schaller Signed-off-by: Thomas Bogendoerfer commit 6420ac0af95dbcb2fd8452e2d551ab50e1bbad83 Author: Michał Kępień Date: Tue Nov 30 12:31:49 2021 +0100 mtdchar: prevent unbounded allocation in MEMWRITE ioctl In the mtdchar_write_ioctl() function, memdup_user() is called with its 'len' parameter set to verbatim values provided by user space via a struct mtd_write_req. Both the 'len' and 'ooblen' fields of that structure are 64-bit unsigned integers, which means the MEMWRITE ioctl can trigger unbounded kernel memory allocation requests. Fix by iterating over the buffers provided by user space in a loop, processing at most mtd->erasesize bytes in each iteration. Adopt some checks from mtd_check_oob_ops() to retain backward user space compatibility. Suggested-by: Boris Brezillon Signed-off-by: Michał Kępień Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20211130113149.21848-1-kernel@kempniu.pl commit dd8a2e884a462c09a562f04927cb227e3cdaa498 Author: Christophe JAILLET Date: Sun Nov 21 16:59:12 2021 +0100 mtd: gen_probe: Use bitmap_zalloc() when applicable 'chip_map' is a bitmap. So use 'bitmap_zalloc()' to simplify code, improve the semantic and avoid some open-coded arithmetic in allocator arguments. Also change the corresponding 'kfree()' into 'bitmap_free()' to keep consistency. Signed-off-by: Christophe JAILLET Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/a6fe58dffe553a3e79303777d3ba9c60d7613c5b.1637510255.git.christophe.jaillet@wanadoo.fr commit 67b967ddd93d0ed57d392a00f6f90060f0910c0e Author: Miquel Raynal Date: Thu Nov 18 12:46:59 2021 +0100 mtd: Introduce an expert mode for forensics and debugging purposes When developping NAND controller drivers or when debugging filesystem corruptions, it is quite common to need hacking locally into the MTD/NAND core in order to get access to the content of the bad blocks. Instead of having multiple implementations out there let's provide a simple yet effective specific MTD-wide debugfs entry to fully disable these checks on purpose. A warning is added to inform the user when this mode gets enabled. Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20211118114659.1282855-1-miquel.raynal@bootlin.com commit c14e281a8e763442f73dfcb9830e6b58fbfb731e Author: Rob Herring Date: Mon Dec 6 11:42:09 2021 -0600 dt-bindings: mtd: ti,gpmc-nand: Add missing 'rb-gpios' With 'unevaluatedProperties' support implemented, the TI GPMC example has a warning: Documentation/devicetree/bindings/memory-controllers/ti,gpmc.example.dt.yaml: nand@0,0: Unevaluated properties are not allowed ('rb-gpios' was unexpected) Add the missing definition for 'rb-gpios'. Cc: Miquel Raynal Cc: Richard Weinberger Cc: Vignesh Raghavendra Cc: Tony Lindgren Cc: Roger Quadros Cc: linux-mtd@lists.infradead.org Signed-off-by: Rob Herring Reviewed-by: Thierry Reding Reviewed-by: Roger Quadros Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20211206174209.2297565-1-robh@kernel.org commit f122a46a637f9231433d30aa1f9a199f8688cb97 Author: Matthew Auld Date: Wed Dec 8 19:46:13 2021 +0530 drm/i915: enforce min page size for scratch If the device needs 64K minimum GTT pages for device local-memory, like on XEHPSDV, then we need to fail the allocation if we can't meet it, instead of falling back to 4K pages, otherwise we can't safely support the insertion of device local-memory pages for this vm, since the HW expects the correct physical alignment and size for every PTE, if we mark the page-table as 64K GTT mode. v2: s/userpsace/userspace [Thomas] Signed-off-by: Matthew Auld Signed-off-by: Ramalingam C Reviewed-by: Thomas Hellström Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20211208141613.7251-5-ramalingam.c@intel.com commit fef53be028740aed15c288534e8f15719fb49947 Author: Matthew Auld Date: Wed Dec 8 19:46:12 2021 +0530 drm/i915/gtt/xehpsdv: move scratch page to system memory On some platforms the hw has dropped support for 4K GTT pages when dealing with LMEM, and due to the design of 64K GTT pages in the hw, we can only mark the *entire* page-table as operating in 64K GTT mode, since the enable bit is still on the pde, and not the pte. And since we we still need to allow 4K GTT pages for SMEM objects, we can't have a "normal" 4K page-table with scratch pointing to LMEM, since that's undefined from the hw pov. The simplest solution is to just move the 64K scratch page to SMEM on such platforms and call it a day, since that should work for all configurations. Signed-off-by: Matthew Auld Signed-off-by: Ramalingam C Reviewed-by: Thomas Hellstrom Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20211208141613.7251-4-ramalingam.c@intel.com commit ca9216246094904119b94478176eae83090f0fdf Author: Matthew Auld Date: Wed Dec 8 21:18:54 2021 +0530 drm/i915/xehpsdv: set min page-size to 64K Conditionally allocate LMEM with 64K granularity, since 4K page support for LMEM will be dropped on some platforms when using the PPGTT. v2: updated commit msg [Thomas] Signed-off-by: Matthew Auld Signed-off-by: Stuart Summers Signed-off-by: Ramalingam C Cc: Joonas Lahtinen Cc: Rodrigo Vivi Reviewed-by: Lucas De Marchi Reviewed-by: Thomas Hellstrom Link: https://patchwork.freedesktop.org/patch/msgid/20211208154854.28037-1-ramalingam.c@intel.com commit c83125bb2199bc304badc98fcc7c79704053aeb4 Author: Stuart Summers Date: Wed Dec 8 19:46:10 2021 +0530 drm/i915: Add has_64k_pages flag Add a new platform flag, has_64k_pages, to mark the requirement of 64K GTT page sizes or larger for device local memory access. Also implies that we require or at least support the compact PT layout for the ppGTT when using 64K GTT pages. v2: More explanation for the flag [Thomas] Signed-off-by: Stuart Summers Signed-off-by: Ramalingam C Reviewed-by: Lucas De Marchi Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20211208141613.7251-2-ramalingam.c@intel.com commit df87a1efb8372bc119abb5757a458d688ae2d580 Author: Colin Ian King Date: Sun Dec 5 23:07:29 2021 +0000 mtd: onenand: remove redundant variable ooblen Variable ooblen is being initialized with a value that is never read. The variable is never used after this, so it is redundant and can be removed. Signed-off-by: Colin Ian King Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20211205230729.79337-1-colin.i.king@gmail.com commit 21a6732f464894fa43fa1d43fdc7570b454b970c Author: Christian König Date: Mon Dec 6 09:42:02 2021 +0100 drm/amdgpu: don't skip runtime pm get on A+A config The runtime PM get was incorrectly added after the check. Signed-off-by: Christian König Acked-by: Evan Quan Acked-by: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20211206084551.92502-1-christian.koenig@amd.com commit 6306d8dbfae6abbc049cb92fc7cf2acbcd983f8d Author: Hans de Goede Date: Tue Oct 5 22:23:22 2021 +0200 drm/i915: Add privacy-screen support (v3) Add support for eDP panels with a built-in privacy screen using the new drm_privacy_screen class. Changes in v3: - Move drm_privacy_screen_get() call to intel_ddi_init_dp_connector() Changes in v2: - Call drm_connector_update_privacy_screen() from intel_enable_ddi_dp() / intel_ddi_update_pipe_dp() instead of adding a for_each_new_connector_in_state() loop to intel_atomic_commit_tail() - Move the probe-deferral check to the intel_modeset_probe_defer() helper Signed-off-by: Hans de Goede Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211005202322.700909-11-hdegoede@redhat.com commit 94b541f53db1ec6b99fc2186b084177cf6e18824 Author: Hans de Goede Date: Tue Oct 5 22:23:21 2021 +0200 drm/i915: Add intel_modeset_probe_defer() helper The upcoming privacy-screen support adds another check for deferring probe till some other drivers have bound first. Factor out the current vga_switcheroo_client_probe_defer() check into an intel_modeset_probe_defer() helper, so that further probe-deferral checks can be added there. Reviewed-by: Ville Syrjälä Signed-off-by: Hans de Goede Link: https://patchwork.freedesktop.org/patch/msgid/20211005202322.700909-10-hdegoede@redhat.com commit 50468e4313355b161cac8a5155a45832995b7f25 Author: Jarkko Sakkinen Date: Tue Nov 16 18:21:16 2021 +0200 x86/sgx: Add an attribute for the amount of SGX memory in a NUMA node == Problem == The amount of SGX memory on a system is determined by the BIOS and it varies wildly between systems. It can be as small as dozens of MB's and as large as many GB's on servers. Just like how applications need to know how much regular RAM is available, enclave builders need to know how much SGX memory an enclave can consume. == Solution == Introduce a new sysfs file: /sys/devices/system/node/nodeX/x86/sgx_total_bytes to enumerate the amount of SGX memory available in each NUMA node. This serves the same function for SGX as /proc/meminfo or /sys/devices/system/node/nodeX/meminfo does for normal RAM. 'sgx_total_bytes' is needed today to help drive the SGX selftests. SGX-specific swap code is exercised by creating overcommitted enclaves which are larger than the physical SGX memory on the system. They currently use a CPUID-based approach which can diverge from the actual amount of SGX memory available. 'sgx_total_bytes' ensures that the selftests can work efficiently and do not attempt stupid things like creating a 100,000 MB enclave on a system with 128 MB of SGX memory. == Implementation Details == Introduce CONFIG_HAVE_ARCH_NODE_DEV_GROUP opt-in flag to expose an arch specific attribute group, and add an attribute for the amount of SGX memory in bytes to each NUMA node: == ABI Design Discussion == As opposed to the per-node ABI, a single, global ABI was considered. However, this would prevent enclaves from being able to size themselves so that they fit on a single NUMA node. Essentially, a single value would rule out NUMA optimizations for enclaves. Create a new "x86/" directory inside each "nodeX/" sysfs directory. 'sgx_total_bytes' is expected to be the first of at least a few sgx-specific files to be placed in the new directory. Just scanning /proc/meminfo, these are the no-brainers that we have for RAM, but we need for SGX: MemTotal: xxxx kB // sgx_total_bytes (implemented here) MemFree: yyyy kB // sgx_free_bytes SwapTotal: zzzz kB // sgx_swapped_bytes So, at *least* three. I think we will eventually end up needing something more along the lines of a dozen. A new directory (as opposed to being in the nodeX/ "root") directory avoids cluttering the root with several "sgx_*" files. Place the new file in a new "nodeX/x86/" directory because SGX is highly x86-specific. It is very unlikely that any other architecture (or even non-Intel x86 vendor) will ever implement SGX. Using "sgx/" as opposed to "x86/" was also considered. But, there is a real chance this can get used for other arch-specific purposes. [ dhansen: rewrite changelog ] Signed-off-by: Jarkko Sakkinen Signed-off-by: Dave Hansen Acked-by: Greg Kroah-Hartman Acked-by: Borislav Petkov Link: https://lkml.kernel.org/r/20211116162116.93081-2-jarkko@kernel.org commit 8ee1c0f6526ce942b7595951c7bb0165010051c2 Author: Biju Das Date: Wed Dec 8 16:40:09 2021 +0000 thermal/drivers/rz2gl: Add error check for reset_control_deassert() If reset_control_deassert() fails, then we won't be able to access the device registers. Therefore check the return code of reset_control_deassert() and bail out in case of error. While at it replace the parameter "&pdev->dev" -> "dev" in devm_reset_control_get_exclusive(). Suggested-by: Philipp Zabel Signed-off-by: Biju Das Reviewed-by: Philipp Zabel Link: https://lore.kernel.org/r/20211208164010.4130-1-biju.das.jz@bp.renesas.com Signed-off-by: Daniel Lezcano commit 4f7275fc7e570dfc46f733ff8ae131cb128a4758 Author: Heiner Kallweit Date: Sat Dec 4 21:04:40 2021 +0100 i2c: i801: Don't clear status flags twice in interrupt mode In interrupt mode we clear the status flags twice, in the interrupt handler and in i801_check_post(). Remove clearing the status flags from i801_check_post() and handle polling mode by using the SMBus unlocking write to also clear the status flags if still set. To be precise: One could still argue that the status flags are cleared twice in interrupt mode, but it comes for free. Signed-off-by: Heiner Kallweit Reviewed-by: Jean Delvare Tested-by: Jean Delvare Signed-off-by: Wolfram Sang commit 8c7a89678f3befa42a05da67724bf501e3187023 Author: Heiner Kallweit Date: Thu Dec 2 10:53:05 2021 +0100 i2c: i801: Don't read back cleared status in i801_check_pre() I see no need to read back the registers to verify that the bits have actually been cleared. I can't imagine any scenario where the bits would remain set after a write to them. Whilst at it, change involved syslog messages to use pci_dbg() et al. to simplify them. Signed-off-by: Heiner Kallweit Reviewed-by: Jean Delvare Tested-by: Jean Delvare Signed-off-by: Wolfram Sang commit c4bcef90cc490685df116aede776e54ca567cef0 Author: Sam Protsenko Date: Sat Dec 4 23:58:18 2021 +0200 i2c: exynos5: Mention Exynos850 and ExynosAutoV9 in Kconfig I2C controller chosen by I2C_EXYNOS5 config option is also suitable for Exynos850 and ExynosAutoV9 SoCs. State that specifically in I2C_EXYNOS5 symbol help section. Signed-off-by: Sam Protsenko Reviewed-by: Krzysztof Kozlowski Reviewed-by: Chanho Park Signed-off-by: Wolfram Sang commit 697ad2490c96981ec12b0a6d3c7c26fbad80e1e8 Author: Sam Protsenko Date: Thu Dec 9 16:03:13 2021 +0200 i2c: exynos5: Add bus clock support In new Exynos SoCs (like Exynos850) where HSI2C is implemented as a part of USIv2 block, there are two clocks provided to HSI2C controller: - PCLK: bus clock (APB), provides access to register interface - IPCLK: operating IP-core clock; SCL is derived from this one Both clocks have to be asserted for HSI2C to be functional in that case. Add code to obtain and enable/disable PCLK in addition to already handled operating clock. Make it optional though, as older Exynos SoC variants only have one HSI2C clock. Signed-off-by: Sam Protsenko Reviewed-by: Krzysztof Kozlowski Reviewed-by: Chanho Park Signed-off-by: Wolfram Sang commit 45af1bb99b72e36c16714390a8a3c9445e432938 Author: Sean Christopherson Date: Wed Dec 8 01:52:13 2021 +0000 KVM: VMX: Clean up PI pre/post-block WARNs Move the WARN sanity checks out of the PI descriptor update loop so as not to spam the kernel log if the condition is violated and the update takes multiple attempts due to another writer. This also eliminates a few extra uops from the retry path. Technically not checking every attempt could mean KVM will now fail to WARN in a scenario that would have failed before, but any such failure would be inherently racy as some other agent (CPU or device) would have to concurrent modify the PI descriptor. Add a helper to handle the actual write and more importantly to document why the write may need to be retried. Signed-off-by: Sean Christopherson Message-Id: <20211208015236.1616697-4-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 83c98007d9fb5c827cd954fc48e9cba034ef6fdc Author: Sean Christopherson Date: Wed Dec 8 01:52:12 2021 +0000 KVM: nVMX: Ensure vCPU honors event request if posting nested IRQ fails Add a memory barrier between writing vcpu->requests and reading vcpu->guest_mode to ensure the read is ordered after the write when (potentially) delivering an IRQ to L2 via nested posted interrupt. If the request were to be completed after reading vcpu->mode, it would be possible for the target vCPU to enter the guest without posting the interrupt and without handling the event request. Note, the barrier is only for documentation since atomic operations are serializing on x86. Suggested-by: Paolo Bonzini Fixes: 6b6977117f50 ("KVM: nVMX: Fix races when sending nested PI while dest enters/leaves L2") Fixes: 705699a13994 ("KVM: nVMX: Enable nested posted interrupt processing") Signed-off-by: Sean Christopherson Message-Id: <20211208015236.1616697-3-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 7d41745acfa722309dc7dbdcf8801452c53e936b Author: Ville Syrjälä Date: Fri Dec 3 13:20:29 2021 +0200 drm/i915: s/intel_get_first_crtc/intel_first_crtc/ Since we got rid of the "_get_" from intel_get_crtc_for_pipe() let's do the same for intel_get_first_crtc() for consistency. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211203112029.1057-3-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 927167f37fe03f017fb0a89ba2c4d35bc51f233e Author: Ville Syrjälä Date: Fri Dec 3 13:20:28 2021 +0200 drm/i915: Relocate intel_crtc_for_plane() Move intel_crtc_for_plane() next to its only user. No one else should ever use this. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211203112029.1057-2-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit cbb8a7957108e96560c43953f70c377d8d9b6643 Author: Ville Syrjälä Date: Fri Dec 3 13:20:27 2021 +0200 drm/i915: Nuke {pipe,plane}_to_crtc_mapping[] These plane/pipe->crtc mapping arrays are rather pointless. Get rid of them and just iterate the lists instead. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211203112029.1057-1-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 8e819d75cbcf541a833219521379114a76a645a6 Author: Maxim Levitsky Date: Thu Dec 9 13:54:36 2021 +0200 KVM: x86: add a tracepoint for APICv/AVIC interrupt delivery This allows to see how many interrupts were delivered via the APICv/AVIC from the host. Signed-off-by: Maxim Levitsky Message-Id: <20211209115440.394441-3-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini commit 01dd1fa26b85167cd19b04b10e015aba3e243d08 Merge: fd2b94a5cb0ff c8a04cbeedbc9 Author: Jani Nikula Date: Thu Dec 9 15:58:34 2021 +0200 Merge drm/drm-next into drm-intel-next Get the dependencies for merging drm-privacy-screen support. Signed-off-by: Jani Nikula commit b124c8bd50c7550ed966c09f69ffdbaaedc0aa15 Author: Andy Shevchenko Date: Thu Dec 9 13:34:56 2021 +0200 pinctrl: Sort Kconfig and Makefile entries alphabetically Sort Kconfig and Makefile entries alphabetically for better maintenance in the future. While at it fix some style issues, such as: - "Say Y"/"Say yes"/"Say Yes" --> "Say Y" - "pullup/pulldown" --> "pull-up and pull-down" - wrong indentation Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211209113456.33977-1-andriy.shevchenko@linux.intel.com Signed-off-by: Linus Walleij commit f5bd5fc9d478cdb94f89ccc74870dd81d1919b42 Author: Peng Fan Date: Wed Dec 1 20:50:29 2021 +0800 clocksource/drivers/imx-sysctr: Mark two variable with __ro_after_init The variables 'sys_ctr_base' and 'cmpcr' are not be updated after init, so mark them as __ro_after_init. Cc: Kees Cook Signed-off-by: Peng Fan Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20211201125030.2307746-1-peng.fan@oss.nxp.com Signed-off-by: Daniel Lezcano commit a2807f657976b943bf0eb81d026398d28aa89863 Author: Biju Das Date: Fri Nov 12 18:44:13 2021 +0000 clocksource/drivers/renesas,ostm: Make RENESAS_OSTM symbol visible As RZ/G2L uses the ARM Architected Timer as system timer, enabling the OSTM is not mandatory. Make RENESAS_OSTM symbol visible, so that user can enable it when needed. Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20211112184413.4391-5-biju.das.jz@bp.renesas.com Signed-off-by: Daniel Lezcano commit 3a3e9f23c2cae907677a236fa547610ca747e6fb Author: Biju Das Date: Fri Nov 12 18:44:12 2021 +0000 clocksource/drivers/renesas-ostm: Add RZ/G2L OSTM support RZ/G2L SoC has Generic Timer Module(a.k.a OSTM) which needs to deassert the reset line before accessing any registers. This patch adds an entry point for RZ/G2L so that we can deassert the reset line in probe callback. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20211112184413.4391-4-biju.das.jz@bp.renesas.com Signed-off-by: Daniel Lezcano commit 92d06a3f67ad809649d26aa7698e4d42362585a8 Author: Biju Das Date: Fri Nov 12 18:44:11 2021 +0000 dt-bindings: timer: renesas: ostm: Document Renesas RZ/G2L OSTM Document the General Timer Module(a.k.a OSTM) found on the RZ/G2L SoC. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Reviewed-by: Geert Uytterhoeven Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211112184413.4391-3-biju.das.jz@bp.renesas.com Signed-off-by: Daniel Lezcano commit 8632987380765dee716d460640aa58d58d52998e Merge: 410fbda49cc9b c4f5b30dda01f Author: Daniel Lezcano Date: Thu Dec 9 13:57:57 2021 +0100 Merge branch 'reset/of-get-optional-exclusive' of git://git.pengutronix.de/pza/linux into timers/drivers/next "Add optional variant of of_reset_control_get_exclusive(). If the requested reset is not specified in the device tree, this function returns NULL instead of an error." This dependency is needed for the Generic Timer Module (a.k.a OSTM) support for RZ/G2L. Signed-off-by: Daniel Lezcano commit ae710a458f0af6ba2b991ebdddffc66e8dbd765a Author: Andy Shevchenko Date: Wed Nov 10 12:24:23 2021 +0200 drm: Replace kernel.h with the necessary inclusions When kernel.h is used in the headers it adds a lot into dependency hell, especially when there are circular dependencies are involved. Replace kernel.h inclusion with the list of what is really being used. Signed-off-by: Andy Shevchenko Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20211110102423.54282-1-andriy.shevchenko@linux.intel.com commit e463a09af2f0677b9485a7e8e4e70b396b2ffb6f Author: Peter Zijlstra Date: Sat Dec 4 14:43:44 2021 +0100 x86: Add straight-line-speculation mitigation Make use of an upcoming GCC feature to mitigate straight-line-speculation for x86: https://gcc.gnu.org/g:53a643f8568067d7700a9f2facc8ba39974973d3 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102952 https://bugs.llvm.org/show_bug.cgi?id=52323 It's built tested on x86_64-allyesconfig using GCC-12 and GCC-11. Maintenance overhead of this should be fairly low due to objtool validation. Size overhead of all these additional int3 instructions comes to: text data bss dec hex filename 22267751 6933356 2011368 31212475 1dc43bb defconfig-build/vmlinux 22804126 6933356 1470696 31208178 1dc32f2 defconfig-build/vmlinux.sls Or roughly 2.4% additional text. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20211204134908.140103474@infradead.org commit befe304536eeef71f8529ff877444ae2b72a37db Author: Ameer Hamza Date: Tue Dec 7 19:23:09 2021 +0500 ASoC: test-component: fix null pointer dereference. Dereferncing of_id pointer will result in exception in current implementation since of_match_device() will assign it to NULL. Adding NULL check for protection. Signed-off-by: Ameer Hamza Link: https://lore.kernel.org/r/20211207142309.222820-1-amhamza.mgc@gmail.com Signed-off-by: Mark Brown commit 5f9155a7d2dc067d72a95b42168f944c7710c0d5 Author: Thierry Reding Date: Mon Dec 6 16:46:24 2021 +0100 ASoC: dt-bindings: tegra: Document interconnects property Add the interconnects and interconnect-names properties to the bindings for the sound card on various NVIDIA Tegra based boards. These are used to describe the device's memory paths to and from memory. Signed-off-by: Thierry Reding Acked-by: Rob Herring Link: https://lore.kernel.org/r/20211206154624.229018-1-thierry.reding@gmail.com Signed-off-by: Mark Brown commit e87f13c33e126ab2c72f9acb5ae98fbb93ddfd32 Author: Guo Zhengkui Date: Thu Dec 9 11:21:14 2021 +0800 phy: qcom: use struct_size instead of sizeof Use struct_size() to get the accurate size of `clk_hw_onecell_data` with a variable size array, instead of sizeof(data) to get the size of a pointer. Suggested-by: Bjorn Andersson Signed-off-by: Guo Zhengkui Fixes: f199223cb490 ("phy: qcom: Introduce new eDP PHY driver") Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211209032114.9416-1-guozhengkui@vivo.com Signed-off-by: Vinod Koul commit b149d5d45ac9171ed699a256f026c8ebef901112 Author: Christophe Leroy Date: Wed Dec 8 17:36:52 2021 +0000 powerpc/powermac: Add additional missing lockdep_register_key() Commit df1f679d19ed ("powerpc/powermac: Add missing lockdep_register_key()") fixed a problem that was causing a WARNING. There are two other places in the same file with the same problem originating from commit 9e607f72748d ("i2c_powermac: shut up lockdep warning"). Add missing lockdep_register_key() Fixes: 9e607f72748d ("i2c_powermac: shut up lockdep warning") Reported-by: Erhard Furtner Signed-off-by: Christophe Leroy Depends-on: df1f679d19ed ("powerpc/powermac: Add missing lockdep_register_key()") Signed-off-by: Michael Ellerman Link: https://bugzilla.kernel.org/show_bug.cgi?id=200055 Link: https://lore.kernel.org/r/2c7e421874e21b2fb87813d768cf662f630c2ad4.1638984999.git.christophe.leroy@csgroup.eu commit 06e629c25daa519be620a8c17359ae8fc7a2e903 Author: Hari Bathini Date: Tue Dec 7 16:07:19 2021 +0530 powerpc/fadump: Fix inaccurate CPU state info in vmcore generated with panic In panic path, fadump is triggered via a panic notifier function. Before calling panic notifier functions, smp_send_stop() gets called, which stops all CPUs except the panic'ing CPU. Commit 8389b37dffdc ("powerpc: stop_this_cpu: remove the cpu from the online map.") and again commit bab26238bbd4 ("powerpc: Offline CPU in stop_this_cpu()") started marking CPUs as offline while stopping them. So, if a kernel has either of the above commits, vmcore captured with fadump via panic path would not process register data for all CPUs except the panic'ing CPU. Sample output of crash-utility with such vmcore: # crash vmlinux vmcore ... KERNEL: vmlinux DUMPFILE: vmcore [PARTIAL DUMP] CPUS: 1 DATE: Wed Nov 10 09:56:34 EST 2021 UPTIME: 00:00:42 LOAD AVERAGE: 2.27, 0.69, 0.24 TASKS: 183 NODENAME: XXXXXXXXX RELEASE: 5.15.0+ VERSION: #974 SMP Wed Nov 10 04:18:19 CST 2021 MACHINE: ppc64le (2500 Mhz) MEMORY: 8 GB PANIC: "Kernel panic - not syncing: sysrq triggered crash" PID: 3394 COMMAND: "bash" TASK: c0000000150a5f80 [THREAD_INFO: c0000000150a5f80] CPU: 1 STATE: TASK_RUNNING (PANIC) crash> p -x __cpu_online_mask __cpu_online_mask = $1 = { bits = {0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0} } crash> crash> crash> p -x __cpu_active_mask __cpu_active_mask = $2 = { bits = {0xff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0} } crash> While this has been the case since fadump was introduced, the issue was not identified for two probable reasons: - In general, the bulk of the vmcores analyzed were from crash due to exception. - The above did change since commit 8341f2f222d7 ("sysrq: Use panic() to force a crash") started using panic() instead of deferencing NULL pointer to force a kernel crash. But then commit de6e5d38417e ("powerpc: smp_send_stop do not offline stopped CPUs") stopped marking CPUs as offline till kernel commit bab26238bbd4 ("powerpc: Offline CPU in stop_this_cpu()") reverted that change. To ensure post processing register data of all other CPUs happens as intended, let panic() function take the crash friendly path (read crash_smp_send_stop()) with the help of crash_kexec_post_notifiers option. Also, as register data for all CPUs is captured by f/w, skip IPI callbacks here for fadump, to avoid any complications in finding the right backtraces. Signed-off-by: Hari Bathini Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211207103719.91117-2-hbathini@linux.ibm.com commit 219572d2fc4135b5ce65c735d881787d48b10e71 Author: Hari Bathini Date: Tue Dec 7 16:07:18 2021 +0530 powerpc: handle kdump appropriately with crash_kexec_post_notifiers option Kdump can be triggered after panic_notifers since commit f06e5153f4ae2 ("kernel/panic.c: add "crash_kexec_post_notifiers" option for kdump after panic_notifers") introduced crash_kexec_post_notifiers option. But using this option would mean smp_send_stop(), that marks all other CPUs as offline, gets called before kdump is triggered. As a result, kdump routines fail to save other CPUs' registers. To fix this, kdump friendly crash_smp_send_stop() function was introduced with kernel commit 0ee59413c967 ("x86/panic: replace smp_send_stop() with kdump friendly version in panic path"). Override this kdump friendly weak function to handle crash_kexec_post_notifiers option appropriately on powerpc. Reported-by: kernel test robot Signed-off-by: Hari Bathini [Fixed signature of crash_stop_this_cpu() - reported by lkp@intel.com] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211207103719.91117-1-hbathini@linux.ibm.com commit 3c42e9542050d49610077e083c7c3f5fd5e26820 Author: Thadeu Lima de Souza Cascardo Date: Tue Dec 7 10:05:57 2021 -0300 selftests/powerpc/spectre_v2: Return skip code when miss_percent is high A mis-match between reported and actual mitigation is not restricted to the Vulnerable case. The guest might also report the mitigation as "Software count cache flush" and the host will still mitigate with branch cache disabled. So, instead of skipping depending on the detected mitigation, simply skip whenever the detected miss_percent is the expected one for a fully mitigated system, that is, above 95%. Signed-off-by: Thadeu Lima de Souza Cascardo Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211207130557.40566-1-cascardo@canonical.com commit e89257e28e844f5d1d39081bb901d9f1183a7705 Author: Anders Roxell Date: Tue Dec 7 12:02:28 2021 +0100 powerpc/cell: Fix clang -Wimplicit-fallthrough warning Clang warns: arch/powerpc/platforms/cell/pervasive.c:81:2: error: unannotated fall-through between switch labels case SRR1_WAKEEE: ^ arch/powerpc/platforms/cell/pervasive.c:81:2: note: insert 'break;' to avoid fall-through case SRR1_WAKEEE: ^ break; 1 error generated. Clang is more pedantic than GCC, which does not warn when failing through to a case that is just break or return. Clang's version is more in line with the kernel's own stance in deprecated.rst. Add athe missing break to silence the warning. Fixes: 6e83985b0f6e ("powerpc/cbe: Do not process external or decremeter interrupts from sreset") Reported-by: Naresh Kamboju Signed-off-by: Anders Roxell Reviewed-by: Nathan Chancellor Reviewed-by: Arnd Bergmann Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211207110228.698956-1-anders.roxell@linaro.org commit 8cffe0b0b6b3342d75e5469f07496173feace6bc Author: Xiang wangx Date: Sun Dec 5 21:09:25 2021 +0800 macintosh: Add const to of_device_id struct of_device_id should normally be const. Signed-off-by: Xiang wangx Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211205130925.28389-1-wangxiang@cdjrlc.com commit 0d76914a4c99ab5658f3fb07cdf3799d28e2eab3 Author: Christophe Leroy Date: Mon Nov 29 18:49:41 2021 +0100 powerpc/inst: Optimise copy_inst_from_kernel_nofault() copy_inst_from_kernel_nofault() uses copy_from_kernel_nofault() to copy one or two 32bits words. This means calling an out-of-line function which itself calls back copy_from_kernel_nofault_allowed() then performs a generic copy with loops. Rewrite copy_inst_from_kernel_nofault() to do everything at a single place and use __get_kernel_nofault() directly to perform single accesses without loops. Allthough the generic function uses pagefault_disable(), it is not required on powerpc because do_page_fault() bails earlier when a kernel mode fault happens on a kernel address. As the function has now become very small, inline it. With this change, on an 8xx the time spent in the loop in ftrace_replace_code() is reduced by 23% at function tracer activation and 27% at nop tracer activation. The overall time to activate function tracer (measured with shell command 'time') is 570ms before the patch and 470ms after the patch. Even vmlinux size is reduced (by 152 instruction). Before the patch: 00000018 : 18: 94 21 ff e0 stwu r1,-32(r1) 1c: 7c 08 02 a6 mflr r0 20: 38 a0 00 04 li r5,4 24: 93 e1 00 1c stw r31,28(r1) 28: 7c 7f 1b 78 mr r31,r3 2c: 38 61 00 08 addi r3,r1,8 30: 90 01 00 24 stw r0,36(r1) 34: 48 00 00 01 bl 34 34: R_PPC_REL24 copy_from_kernel_nofault 38: 2c 03 00 00 cmpwi r3,0 3c: 40 82 00 0c bne 48 40: 81 21 00 08 lwz r9,8(r1) 44: 91 3f 00 00 stw r9,0(r31) 48: 80 01 00 24 lwz r0,36(r1) 4c: 83 e1 00 1c lwz r31,28(r1) 50: 38 21 00 20 addi r1,r1,32 54: 7c 08 03 a6 mtlr r0 58: 4e 80 00 20 blr After the patch (before inlining): 00000018 : 18: 3d 20 b0 00 lis r9,-20480 1c: 7c 04 48 40 cmplw r4,r9 20: 7c 69 1b 78 mr r9,r3 24: 41 80 00 14 blt 38 28: 81 44 00 00 lwz r10,0(r4) 2c: 38 60 00 00 li r3,0 30: 91 49 00 00 stw r10,0(r9) 34: 4e 80 00 20 blr 38: 38 60 ff de li r3,-34 3c: 4e 80 00 20 blr 40: 38 60 ff f2 li r3,-14 44: 4e 80 00 20 blr Signed-off-by: Christophe Leroy [mpe: Add clang workaround, with version check as suggested by Nathan] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/0d5b12183d5176dd702d29ad94c39c384e51c78f.1638208156.git.christophe.leroy@csgroup.eu commit 9b307576f37136d37d5e42b1d8713ec34a601a62 Author: Christophe Leroy Date: Mon Nov 29 18:49:40 2021 +0100 powerpc/inst: Move ppc_inst_t definition in asm/reg.h Because of circular inclusion of asm/hw_breakpoint.h, we need to move definition of asm/reg.h outside of inst.h so that asm/hw_breakpoint.h gets it without including asm/inst.h Also remove asm/inst.h from asm/uprobes.h as it's not needed anymore. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/4b79f1491118af96b1ac0735e74aeca02ea4c04e.1638208156.git.christophe.leroy@csgroup.eu commit 07b863aef5b682a482474b524f3df4957d2862ac Author: Christophe Leroy Date: Mon Nov 29 18:49:39 2021 +0100 powerpc/inst: Define ppc_inst_t as u32 on PPC32 Unlike PPC64 ABI, PPC32 uses the stack to pass a parameter defined as a struct, even when the struct has a single simple element. To avoid that, define ppc_inst_t as u32 on PPC32. Keep it as 'struct ppc_inst' when __CHECKER__ is defined so that sparse can perform type checking. Also revert commit 511eea5e2ccd ("powerpc/kprobes: Fix Oops by passing ppc_inst as a pointer to emulate_step() on ppc32") as now the instruction to be emulated is passed as a register to emulate_step(). Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/c6d0c46f598f76ad0b0a88bc0d84773bd921b17c.1638208156.git.christophe.leroy@csgroup.eu commit c545b9f040f341038d5228932140fb17e0c156e2 Author: Christophe Leroy Date: Mon Nov 29 18:49:38 2021 +0100 powerpc/inst: Define ppc_inst_t In order to stop using 'struct ppc_inst' on PPC32, define a ppc_inst_t typedef. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/fe5baa2c66fea9db05a8b300b3e8d2880a42596c.1638208156.git.christophe.leroy@csgroup.eu commit 3261d99adba269a024d0e55737beeedec5eba00e Author: Christophe Leroy Date: Mon Nov 29 18:49:37 2021 +0100 powerpc/inst: Refactor ___get_user_instr() PPC64 version of ___get_user_instr() can be used for PPC32 as well, by simply disabling the suffix part with IS_ENABLED(CONFIG_PPC64). Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1f0ede830ccb33a659119a55cb590820c27004db.1638208156.git.christophe.leroy@csgroup.eu commit 37eb7ca91b692e8e49e7dd50158349a6c8fb5b09 Author: Christophe Leroy Date: Fri Nov 26 13:40:35 2021 +0100 powerpc/32s: Allocate one 256k IBAT instead of two consecutives 128k IBATs Today we have the following IBATs allocated: ---[ Instruction Block Address Translation ]--- 0: 0xc0000000-0xc03fffff 0x00000000 4M Kernel x m 1: 0xc0400000-0xc05fffff 0x00400000 2M Kernel x m 2: 0xc0600000-0xc06fffff 0x00600000 1M Kernel x m 3: 0xc0700000-0xc077ffff 0x00700000 512K Kernel x m 4: 0xc0780000-0xc079ffff 0x00780000 128K Kernel x m 5: 0xc07a0000-0xc07bffff 0x007a0000 128K Kernel x m 6: - 7: - The two 128K should be a single 256K instead. When _etext is not aligned to 128Kbytes, the system will allocate all necessary BATs to the lower 128Kbytes boundary, then allocate an additional 128Kbytes BAT for the remaining block. Instead, align the top to 128Kbytes so that the function directly allocates a 256Kbytes last block: ---[ Instruction Block Address Translation ]--- 0: 0xc0000000-0xc03fffff 0x00000000 4M Kernel x m 1: 0xc0400000-0xc05fffff 0x00400000 2M Kernel x m 2: 0xc0600000-0xc06fffff 0x00600000 1M Kernel x m 3: 0xc0700000-0xc077ffff 0x00700000 512K Kernel x m 4: 0xc0780000-0xc07bffff 0x00780000 256K Kernel x m 5: - 6: - 7: - Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/ab58b296832b0ec650e2203200e060adbcb2677d.1637930421.git.christophe.leroy@csgroup.eu commit dede19be5163cdc5b5d65a2ce7e7f6eedcb666ff Author: Christophe Leroy Date: Tue Oct 19 09:29:33 2021 +0200 powerpc: Remove CONFIG_PPC_HAVE_KUAP and CONFIG_PPC_HAVE_KUEP All platforms now have KUAP and KUEP so remove CONFIG_PPC_HAVE_KUAP and CONFIG_PPC_HAVE_KUEP. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/a3c007ad0951965199e6ab2ef1035966bc66e771.1634627931.git.christophe.leroy@csgroup.eu commit 57bc963837f5f1753a1d51fada54a32b8a84fdc3 Author: Christophe Leroy Date: Tue Oct 19 09:29:32 2021 +0200 powerpc/kuap: Wire-up KUAP on book3e/64 This adds KUAP support to book3e/64. This is done by reading the content of SPRN_MAS1 and checking the TID at the time user pgtable is loaded. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/e2c2c9375afd4bbc06aa904d0103a5f5102a2b1a.1634627931.git.christophe.leroy@csgroup.eu commit 4f6a025201a290316b28a2a0ef9950398bd75088 Author: Christophe Leroy Date: Tue Oct 19 09:29:31 2021 +0200 powerpc/kuap: Wire-up KUAP on 85xx in 32 bits mode. This adds KUAP support to 85xx in 32 bits mode. This is done by reading the content of SPRN_MAS1 and checking the TID at the time user pgtable is loaded. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/f8696f8980ca1532ada3a2f0e0a03e756269c7fe.1634627931.git.christophe.leroy@csgroup.eu commit fcf9bb6d32f8a268bc3daf3281e3beefabec4e7c Author: Christophe Leroy Date: Tue Oct 19 09:29:30 2021 +0200 powerpc/kuap: Wire-up KUAP on 40x This adds KUAP support to 40x. This is done by checking the content of SPRN_PID at the time user pgtable is loaded. 40x doesn't have KUEP, but KUAP implies KUEP because when the PID doesn't match the page's PID, the page cannot be read nor executed. So KUEP is now automatically selected when KUAP is selected and disabled when KUAP is disabled. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/aaefa91897ddc42ac11019dc0e1d1a525bd08e90.1634627931.git.christophe.leroy@csgroup.eu commit f6fad4fb55936f0d613cea08341d187d691d6440 Author: Christophe Leroy Date: Tue Oct 19 09:29:29 2021 +0200 powerpc/kuap: Wire-up KUAP on 44x This adds KUAP support to 44x. This is done by checking the content of SPRN_PID at the time it is read and written into SPRN_MMUCR. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/7d6c3f1978a26feada74b084f651e8cf1e3b3a47.1634627931.git.christophe.leroy@csgroup.eu commit 43afcf8f0101279cf4243bb4f9f9b249ddd8613c Author: Christophe Leroy Date: Tue Oct 19 09:29:28 2021 +0200 powerpc: Add KUAP support for BOOKE and 40x On booke/40x we don't have segments like book3s/32. On booke/40x we don't have access protection groups like 8xx. Use the PID register to provide user access protection. Kernel address space can be accessed with any PID. User address space has to be accessed with the PID of the user. User PID is always not null. Everytime the kernel is entered, set PID register to 0 and restore PID register when returning to user. Everytime kernel needs to access user data, PID is restored for the access. In TLB miss handlers, check the PID and bail out to data storage exception when PID is 0 and accessed address is in user space. Note that also forbids execution of user text by kernel except when user access is unlocked. But this shouldn't be a problem as the kernel is not supposed to ever run user text. This patch prepares the infrastructure but the real activation of KUAP is done by following patches for each processor type one by one. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/5d65576a8e31e9480415785a180c92dd4e72306d.1634627931.git.christophe.leroy@csgroup.eu commit e3c02f25b4296c48376b8edb6aadcec460e803bc Author: Christophe Leroy Date: Tue Oct 19 09:29:27 2021 +0200 powerpc/kuap: Make PPC_KUAP_DEBUG depend on PPC_KUAP only PPC_KUAP_DEBUG is supported by all platforms doing PPC_KUAP, it doesn't depend on Radix on book3s/64. This will avoid adding one more dependency when implementing KUAP on book3e/64. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/a5ff6228a36e51783b83d8c10d058db76e450f63.1634627931.git.christophe.leroy@csgroup.eu commit 42e03bc5240b75007682d9941ef672d12828fc70 Author: Christophe Leroy Date: Tue Oct 19 09:29:26 2021 +0200 powerpc/kuap: Prepare for supporting KUAP on BOOK3E/64 Also call kuap_lock() and kuap_save_and_lock() from interrupt functions with CONFIG_PPC64. For book3s/64 we keep them empty as it is done in assembly. Also do the locked assert when switching task unless it is book3s/64. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1cbf94e26e6d6e2e028fd687588a7e6622d454a6.1634627931.git.christophe.leroy@csgroup.eu commit 047a6fd40199eb55ffd18091f7ceae9743d972bf Author: Christophe Leroy Date: Tue Oct 19 09:29:25 2021 +0200 powerpc/config: Add CONFIG_BOOKE_OR_40x We have many functionnalities common to 40x and BOOKE, it leads to many places with #if defined(CONFIG_BOOKE) || defined(CONFIG_40x). We are going to add a few more with KUAP for booke/40x, so create a new symbol which is defined when either BOOKE or 40x is defined. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/9a3dbd60924cb25c9f944d3d8205ac5a0d15e229.1634627931.git.christophe.leroy@csgroup.eu commit 25ae981fafaa140a12e4c830992b4fe997071124 Author: Christophe Leroy Date: Tue Oct 19 09:29:24 2021 +0200 powerpc/nohash: Move setup_kuap out of 8xx.c In order to reuse it on booke/4xx, move KUAP setup routine out of 8xx.c Make them usable on SMP by removing the __init tag as it is called for each CPU. And use __prevent_user_access() instead of hard coding initial lock. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/ae35eec3426509efc2b8ae69586c822e2fe2642a.1634627931.git.christophe.leroy@csgroup.eu commit 937fb7003ee1f37faed1f1a4ece46e8a14863d92 Author: Christophe Leroy Date: Tue Oct 19 09:29:23 2021 +0200 powerpc/kuap: Add kuap_lock() Add kuap_lock() and call it when entering interrupts from user. It is called kuap_lock() as it is similar to kuap_save_and_lock() without the save. However book3s/32 already have a kuap_lock(). Rename it kuap_lock_addr(). Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/4437e2deb9f6f549f7089d45e9c6f96a7e77905a.1634627931.git.christophe.leroy@csgroup.eu commit 2341964e27b02b2ca1deef8a18df59d1db7b9085 Author: Christophe Leroy Date: Tue Oct 19 09:29:22 2021 +0200 powerpc/kuap: Remove __kuap_assert_locked() __kuap_assert_locked() is redundant with __kuap_get_and_assert_locked(). Move the verification of CONFIG_PPC_KUAP_DEBUG in kuap_assert_locked() and make it call __kuap_get_and_assert_locked() directly. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1a60198a25d2ba38a37f1b92bc7d096435df4224.1634627931.git.christophe.leroy@csgroup.eu commit c252f3846d3114542c606618995e3cbc11775357 Author: Christophe Leroy Date: Tue Oct 19 09:29:21 2021 +0200 powerpc/kuap: Check KUAP activation in generic functions Today, every platform checks that KUAP is not de-activated before doing the real job. Move the verification out of platform specific functions. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/894f110397fcd248e125fb855d1e863e4e633a0d.1634627931.git.christophe.leroy@csgroup.eu commit ba454f9c8e4efcc47c772b7642a5c8c6d1343cbf Author: Christophe Leroy Date: Tue Oct 19 09:29:20 2021 +0200 powerpc/kuap: Add a generic intermediate layer Make the following functions generic to all platforms. - bad_kuap_fault() - kuap_assert_locked() - kuap_save_and_lock() (PPC32 only) - kuap_kernel_restore() - kuap_get_and_assert_locked() And for all platforms except book3s/64 - allow_user_access() - prevent_user_access() - prevent_user_access_return() - restore_user_access() Prepend __ in front of the name of platform specific ones. For now the generic just calls the platform specific, but next patch will move redundant parts of specific functions into the generic one. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/eaef143a8dae7288cd34565ffa7b49c16aee1ec3.1634627931.git.christophe.leroy@csgroup.eu commit 6754862249d324b11f1361a5353e234325d805ec Author: Christophe Leroy Date: Tue Oct 19 09:29:19 2021 +0200 powerpc/kuep: Remove 'nosmep' boot time parameter except for book3s/64 Deactivating KUEP at boot time is unrelevant for PPC32 and BOOK3E/64. Remove it. It allows to refactor setup_kuep() via a __weak function that only PPC64s will overide for now. Signed-off-by: Christophe Leroy [mpe: Fix CONFIG_PPC_BOOKS_64 -> CONFIG_PPC_BOOK3S_64 typo] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/4c36df18b41c988c4512f45d96220486adbe4c99.1634627931.git.christophe.leroy@csgroup.eu commit 70428da94c7ad692d306747a04117543827292a7 Author: Christophe Leroy Date: Tue Oct 19 09:29:18 2021 +0200 powerpc/32s: Save content of sr0 to avoid 'mfsr' Calling 'mfsr' to get the content of segment registers is heavy, in addition it requires clearing of the 'reserved' bits. In order to avoid this operation, save it in mm context and in thread struct. The saved sr0 is the one used by kernel, this means that on locking entry it can be used as is. For unlocking, the only thing to do is to clear SR_NX. This improves null_syscall selftest by 12 cycles, ie 4%. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/b02baf2ed8f09bad910dfaeeb7353b2ae6830525.1634627931.git.christophe.leroy@csgroup.eu commit 526d4a4c77aedf1b7df1133e5cced29c70232e6e Author: Christophe Leroy Date: Tue Oct 19 09:29:17 2021 +0200 powerpc/32s: Do kuep_lock() and kuep_unlock() in assembly When interrupt and syscall entries where converted to C, KUEP locking and unlocking was also converted. It improved performance by unrolling the loop, and allowed easily implementing boot time deactivation of KUEP. However, null_syscall selftest shows that KUEP is still heavy (361 cycles with KUEP, 212 cycles without). A way to improve more is to group 'mtsr's together, instead of repeating 'addi' + 'mtsr' several times. In order to do that, more registers need to be available. In C, GCC will always be able to provide the requested number of registers, but at the cost of saving some data on the stack, which is counter performant here. So let's do it in assembly, when we have full control of which register can be used. It also has the advantage of locking earlier and unlocking later and it helps GCC generating less tricky code. The only drawback is to make boot time deactivation less straight forward and require 'hand' instruction patching. Group 'mtsr's by 4. With this change, null_syscall selftest reports 336 cycles. Without the change it was 361 cycles, that's a 7% reduction. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/115cb279e9b9948dfd93a065e047081c59e3a2a6.1634627931.git.christophe.leroy@csgroup.eu commit df415cd758261bceff27f34a145dd8328bbfb018 Author: Christophe Leroy Date: Tue Oct 19 09:29:16 2021 +0200 powerpc/32s: Remove capability to disable KUEP at boottime Disabling KUEP at boottime makes things unnecessarily complex. Still allow disabling KUEP at build time, but when it's built-in it is always there. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/96f583f82423a29a4205c60b9721079111b35567.1634627931.git.christophe.leroy@csgroup.eu commit dc3a0e5b83a8806d7da1f343a7d2e0be386d16d2 Author: Christophe Leroy Date: Tue Oct 19 09:29:15 2021 +0200 powerpc/book3e: Activate KUEP at all time On book3e, - When using 64 bits PTE: User pages don't have the SX bit defined so KUEP is always active. - When using 32 bits PTE: Implement KUEP by clearing SX bit during TLB miss for user pages. The impact is minimal and worth neither boot time nor build time selection. Activate it at all time. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/e376b114283fb94504e2aa2de846780063252cde.1634627931.git.christophe.leroy@csgroup.eu commit ee2631603fdbab6f76e86ea87f7a03ebc3a1ef85 Author: Christophe Leroy Date: Tue Oct 19 09:29:14 2021 +0200 powerpc/44x: Activate KUEP at all time On 44x, KUEP is implemented by clearing SX bit during TLB miss for user pages. The impact is minimal and not worth neither boot time nor build time selection. Activate it at all time. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/2414d662558e7fb27d1ed41c8e47c591d576acac.1634627931.git.christophe.leroy@csgroup.eu commit 13dac4e31e75ce10b2fcaad4432a24dae6c955f6 Author: Christophe Leroy Date: Tue Oct 19 09:29:13 2021 +0200 powerpc/8xx: Activate KUEP at all time On the 8xx, there is absolutely no runtime impact with KUEP. Protection against execution of user code in kernel mode is set up at boot time by configuring the groups with contain all user pages as having swapped protection rights, in extenso EX for user and NA for supervisor. Configure KUEP at startup and force selection of CONFIG_PPC_KUEP. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/2129e86944323ffe9ed07fffbeafdfd2e363690a.1634627931.git.christophe.leroy@csgroup.eu commit 6c1fa60d368e6b752e1612eae9bb0970e85392b2 Author: Christophe Leroy Date: Tue Oct 19 09:29:12 2021 +0200 Revert "powerpc: Inline setup_kup()" This reverts commit 1791ebd131c46539b024c0f2ebf12b6c88a265b9. setup_kup() was inlined to manage conflict between PPC32 marking setup_{kuap/kuep}() __init and PPC64 not marking them __init. But in fact PPC32 has removed the __init mark for all but 8xx in order to properly handle SMP. In order to make setup_kup() grow a bit, revert the commit mentioned above but remove __init for 8xx as well so that we don't have to mark setup_kup() as __ref. Also switch the order so that KUAP is initialised before KUEP because on the 40x, KUEP will depend on the activation of KUAP. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/7691088fd0994ee3c8db6298dc8c00259e3f6a7f.1634627931.git.christophe.leroy@csgroup.eu commit 06e7cbc29e97b4713b4ea6def04ae8501a7d1a59 Author: Christophe Leroy Date: Mon Sep 27 17:12:39 2021 +0200 powerpc/40x: Map 32Mbytes of memory at startup As reported by Carlo, 16Mbytes is not enough with modern kernels that tend to be a bit big, so map another 16M page at boot. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/89b5f974a7fa5011206682cd092e2c905530ff46.1632755552.git.christophe.leroy@csgroup.eu commit 31284f703db2f1605b2dbc6bb0632b04d7be13e7 Author: Nicholas Piggin Date: Thu Dec 2 00:41:53 2021 +1000 powerpc/microwatt: add POWER9_CPU, clear PPC_64S_HASH_MMU Microwatt implements a subset of ISA v3.0 (which is equivalent to the POWER9_CPU option). It is radix-only, so does not require hash MMU support. This saves 20kB compressed dtbImage and 56kB vmlinux size. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211201144153.2456614-19-npiggin@gmail.com commit 387e220a2e5e630794e1f5219ed6f11e56271c21 Author: Nicholas Piggin Date: Thu Dec 2 00:41:52 2021 +1000 powerpc/64s: Move hash MMU support code under CONFIG_PPC_64S_HASH_MMU Compiling out hash support code when CONFIG_PPC_64S_HASH_MMU=n saves 128kB kernel image size (90kB text) on powernv_defconfig minus KVM, 350kB on pseries_defconfig minus KVM, 40kB on a tiny config. Signed-off-by: Nicholas Piggin [mpe: Fixup defined(ARCH_HAS_MEMREMAP_COMPAT_ALIGN), which needs CONFIG. Fix radix_enabled() use in setup_initial_memory_limit(). Add some stubs to reduce number of ifdefs.] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211201144153.2456614-18-npiggin@gmail.com commit c28573744b74eb6de19add503d6a986795c4c137 Author: Nicholas Piggin Date: Thu Dec 2 00:41:51 2021 +1000 powerpc/64s: Make hash MMU support configurable This adds Kconfig selection which allows 64s hash MMU support to be disabled. It can be disabled if radix support is enabled, the minimum supported CPU type is POWER9 (or higher), and KVM is not selected. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211201144153.2456614-17-npiggin@gmail.com commit debeda017189e40bff23d1c3d2e4567ca8541aed Author: Nicholas Piggin Date: Thu Dec 2 00:41:50 2021 +1000 powerpc/64s: Always define arch unmapped area calls To avoid any functional changes to radix paths when building with hash MMU support disabled (and CONFIG_PPC_MM_SLICES=n), always define the arch get_unmapped_area calls on 64s platforms. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211201144153.2456614-16-npiggin@gmail.com commit af3a0ea41cbf38e967611e262126357d2fd23955 Author: Nicholas Piggin Date: Thu Dec 2 00:41:49 2021 +1000 powerpc/64s: Fix radix MMU when MMU_FTR_HPTE_TABLE is clear There are a few places that require MMU_FTR_HPTE_TABLE to be set even when running in radix mode. Fix those up. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211201144153.2456614-15-npiggin@gmail.com commit 8dbfc0092b5c8c50f011509893bf0396253cd2ab Author: Nicholas Piggin Date: Thu Dec 2 00:41:48 2021 +1000 powerpc/64e: remove mmu_linear_psize mmu_linear_psize is only set at boot once on 64e, is not necessarily the correct size of the linear map pages, and is never used anywhere. Remove it. Signed-off-by: Nicholas Piggin [mpe: Retain the extern, so we can use IS_ENABLED() for related code] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211201144153.2456614-14-npiggin@gmail.com commit 410fbda49cc9b2165e80b87880f164d9644b460d Author: Will Deacon Date: Wed Nov 3 16:48:04 2021 +0000 clocksource/drivers/exynos_mct: Fix silly typo resulting in checkpatch warning Commit ae460fd9164b ("clocksource/drivers/exynos_mct: Prioritise Arm arch timer on arm64") changed the rating of the MCT clockevents device to be lower than the Arm architected timer and, in the process, replaced a semicolon with a comma thanks to a silly copy-paste error. Put the semicolon back so that the code looks more idiomatic and resolve the SUSPECT_COMMA_SEMICOLON warning from checkpatch at the same time. Cc: Krzysztof Kozlowski Cc: Daniel Lezcano Signed-off-by: Will Deacon Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20211103164804.30182-1-will@kernel.org Signed-off-by: Daniel Lezcano commit 60bf9b33c82c0e040a98272d7ff4f5a52e7469d6 Author: Thomas Gleixner Date: Mon Dec 6 23:28:00 2021 +0100 PCI/MSI: Move descriptor counting on allocation fail to the legacy code The irqdomain code already returns the information. Move the loop to the legacy code. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Reviewed-by: Jason Gunthorpe Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20211206210225.101336873@linutronix.de commit 890337624e1fa2da079fc1c036a62d178c985280 Author: Thomas Gleixner Date: Mon Dec 6 23:27:59 2021 +0100 genirq/msi: Handle PCI/MSI allocation fail in core code Get rid of yet another irqdomain callback and let the core code return the already available information of how many descriptors could be allocated. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Reviewed-by: Jason Gunthorpe Reviewed-by: Greg Kroah-Hartman Acked-by: Bjorn Helgaas # PCI Link: https://lore.kernel.org/r/20211206210225.046615302@linutronix.de commit 57ce3a3c99b21e9c4f951ef01e0a3603c987c259 Author: Thomas Gleixner Date: Mon Dec 6 23:27:57 2021 +0100 PCI/MSI: Make pci_msi_domain_check_cap() static No users outside of that file. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Reviewed-by: Jason Gunthorpe Reviewed-by: Greg Kroah-Hartman Acked-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20211206210224.980989243@linutronix.de commit cd119b09a87d8beb50356d8c5c6aa42d89c44eb7 Author: Thomas Gleixner Date: Mon Dec 6 23:27:56 2021 +0100 PCI/MSI: Move msi_lock to struct pci_dev It's only required for PCI/MSI. So no point in having it in every struct device. Signed-off-by: Thomas Gleixner Reviewed-by: Greg Kroah-Hartman Reviewed-by: Jason Gunthorpe Acked-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20211206210224.925241961@linutronix.de commit 85aa607e79f8343f1ea028b29bdf8b6bc99c729a Author: Thomas Gleixner Date: Mon Dec 6 23:27:54 2021 +0100 PCI/MSI: Sanitize MSI-X table map handling Unmapping the MSI-X base mapping in the loops which allocate/free MSI descriptors is daft and in the way of allowing runtime expansion of MSI-X descriptors. Store the mapping in struct pci_dev and free it after freeing the MSI-X descriptors. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Reviewed-by: Jason Gunthorpe Acked-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20211206210224.871651518@linutronix.de commit aa423ac4221abdfb8588751e7838ca5f42f56db3 Author: Thomas Gleixner Date: Mon Dec 6 23:27:52 2021 +0100 PCI/MSI: Split out irqdomain code Move the irqdomain specific code into its own file. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Reviewed-by: Jason Gunthorpe Reviewed-by: Greg Kroah-Hartman Acked-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20211206210224.817754783@linutronix.de commit a01e09ef123789aa2e23e6b0238ed420791dd4ea Author: Thomas Gleixner Date: Mon Dec 6 23:27:51 2021 +0100 PCI/MSI: Split out !IRQDOMAIN code Split out the non irqdomain code into its own file. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Reviewed-by: Jason Gunthorpe Reviewed-by: Greg Kroah-Hartman Acked-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20211206210224.763574089@linutronix.de commit 54324c2f3d728f451d9053fcc7859b26fc9cecb4 Author: Thomas Gleixner Date: Mon Dec 6 23:27:49 2021 +0100 PCI/MSI: Split out CONFIG_PCI_MSI independent part These functions are required even when CONFIG_PCI_MSI is not set. Move them to their own file. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Reviewed-by: Jason Gunthorpe Reviewed-by: Greg Kroah-Hartman Acked-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20211206210224.710137730@linutronix.de commit 288c81ce4be7c15544605594966faaeb8803b5da Author: Thomas Gleixner Date: Mon Dec 6 23:27:47 2021 +0100 PCI/MSI: Move code into a separate directory msi.c is getting larger and really could do with a splitup. Move it into its own directory to prepare for that. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Reviewed-by: Jason Gunthorpe Acked-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20211206210224.655043033@linutronix.de commit 7112158d97a1539b217c360d379724ac3ee99fa3 Author: Thomas Gleixner Date: Mon Dec 6 23:27:46 2021 +0100 PCI/MSI: Make msix_update_entries() smarter No need to walk the descriptors and check for each one whether the entries pointer function argument is NULL. Do it once. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Reviewed-by: Jason Gunthorpe Reviewed-by: Greg Kroah-Hartman Acked-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20211206210224.600351129@linutronix.de commit 29a03ada4a007067d5427a6a1b7ba1dc7566ea2e Author: Thomas Gleixner Date: Mon Dec 6 23:27:44 2021 +0100 PCI/MSI: Cleanup include zoo Get rid of the pile of unneeded includes which accumulated over time. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Reviewed-by: Jason Gunthorpe Acked-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20211206210224.539281124@linutronix.de commit ae72f3156729541581f526b85883ca53a20df2fa Author: Thomas Gleixner Date: Mon Dec 6 23:27:42 2021 +0100 PCI/MSI: Make arch_restore_msi_irqs() less horrible. Make arch_restore_msi_irqs() return a boolean which indicates whether the core code should restore the MSI message or not. Get rid of the indirection in x86. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Reviewed-by: Jason Gunthorpe Acked-by: Bjorn Helgaas # PCI Link: https://lore.kernel.org/r/20211206210224.485668098@linutronix.de commit 1982afd6c0582c523970f5426cc1f11ef8ead7bd Author: Thomas Gleixner Date: Mon Dec 6 23:27:41 2021 +0100 x86/hyperv: Refactor hv_msi_domain_free_irqs() No point in looking up things over and over. Just look up the associated irq data and work from there. No functional change. Signed-off-by: Thomas Gleixner Reviewed-by: Jason Gunthorpe Acked-by: Wei Liu Link: https://lore.kernel.org/r/20211206210224.429625690@linutronix.de commit e58f2259b91c02974c20db7b28d39d810a21249b Author: Thomas Gleixner Date: Mon Dec 6 23:27:39 2021 +0100 genirq/msi, treewide: Use a named struct for PCI/MSI attributes The unnamed struct sucks and is in the way of further cleanups. Stick the PCI related MSI data into a real data structure and cleanup all users. No functional change. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Reviewed-by: Jason Gunthorpe Reviewed-by: Greg Kroah-Hartman Acked-by: Kalle Valo Link: https://lore.kernel.org/r/20211206210224.374863119@linutronix.de commit bec61847cdc7ff22d6d85e6e6436d4b7416c1f9b Author: Thomas Gleixner Date: Mon Dec 6 23:27:38 2021 +0100 MIPS: Octeon: Use arch_setup_msi_irq() The core code provides the same loop code except for the MSI-X reject. Move that to arch_setup_msi_irq() and remove the duplicated code. No functional change. Signed-off-by: Thomas Gleixner Reviewed-by: Jason Gunthorpe Acked-by: Thomas Bogendoerfer Link: https://lore.kernel.org/r/20211206210224.319201379@linutronix.de commit 793c5006769d77b8148236bc124b75e391110531 Author: Thomas Gleixner Date: Mon Dec 6 23:27:36 2021 +0100 PCI/sysfs: Use pci_irq_vector() instead of fiddling with MSI descriptors. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Reviewed-by: Jason Gunthorpe Reviewed-by: Greg Kroah-Hartman Acked-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20211206210224.265589103@linutronix.de commit ade044a3d0f0389e4f916337c505550acc3fd011 Author: Thomas Gleixner Date: Mon Dec 6 23:27:34 2021 +0100 PCI/MSI: Remove msi_desc_to_pci_sysdata() Last user is gone long ago. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Reviewed-by: Jason Gunthorpe Acked-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20211206210224.210768199@linutronix.de commit 9e8688c5f2990dadcf83728cd00a7e8497fc6aa9 Author: Thomas Gleixner Date: Mon Dec 6 23:27:33 2021 +0100 PCI/MSI: Make pci_msi_domain_write_msg() static There is no point to have this function public as it is set by the PCI core anyway when a PCI/MSI irqdomain is created. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Reviewed-by: Jason Gunthorpe Acked-by: Bjorn Helgaas # PCI Link: https://lore.kernel.org/r/20211206210224.157070464@linutronix.de commit 3ba1f050c91d5ce3672dbf3a55dc2451c0b342e2 Author: Thomas Gleixner Date: Mon Dec 6 23:27:31 2021 +0100 genirq/msi: Fixup includes Remove the kobject.h include from msi.h as it's not required and add a sysfs.h include to the core code instead. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Reviewed-by: Jason Gunthorpe Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20211206210224.103502021@linutronix.de commit 1dd2c6a0817fd08f80dee75d7d3bd99a0c4b828d Author: Thomas Gleixner Date: Mon Dec 6 23:27:29 2021 +0100 genirq/msi: Remove unused domain callbacks No users and there is no need to grow them. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211126223824.322987915@linutronix.de Link: https://lore.kernel.org/r/20211206210224.041777889@linutronix.de commit 1197528aaea79ed4909aba695d18fdecc5387a36 Author: Thomas Gleixner Date: Mon Dec 6 23:27:28 2021 +0100 genirq/msi: Guard sysfs code No point in building unused code when CONFIG_SYSFS=n. Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Reviewed-by: Jason Gunthorpe Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20211206210223.985907940@linutronix.de commit 29bbc35e29d9b6347780dcacde2deb4b39344167 Author: Thomas Gleixner Date: Mon Dec 6 23:27:26 2021 +0100 PCI/MSI: Fix pci_irq_vector()/pci_irq_get_affinity() pci_irq_vector() and pci_irq_get_affinity() use the list position to find the MSI-X descriptor at a given index. That's correct for the normal case where the entry number is the same as the list position. But it's wrong for cases where MSI-X was allocated with an entries array describing sparse entry numbers into the hardware message descriptor table. That's inconsistent at best. Make it always check the entry number because that's what the zero base index really means. This change won't break existing users which use a sparse entries array for allocation because these users retrieve the Linux interrupt number from the entries array after allocation and none of them uses pci_irq_vector() or pci_irq_get_affinity(). Fixes: aff171641d18 ("PCI: Provide sensible IRQ vector alloc/free routines") Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Reviewed-by: Jason Gunthorpe Acked-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20211206210223.929792157@linutronix.de commit eca213152a36b381724251afaa5ce04ac551e3f7 Author: Cédric Le Goater Date: Tue Dec 7 16:32:50 2021 +0100 powerpc/4xx: Complete removal of MSI support Finish the work by removing all references to the PPC4xx_MSI config and the associated device nodes in the DTs. Signed-off-by: Cédric Le Goater Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/e92f2bb3-b5e1-c870-8151-3917a789a640@kaod.org commit 4f1d038b5ea1b45d8265a5407712f975b600bb94 Author: Thomas Gleixner Date: Mon Dec 6 23:27:25 2021 +0100 powerpc/4xx: Remove MSI support which never worked This code is broken since day one. ppc4xx_setup_msi_irqs() has the following gems: 1) The handling of the result of msi_bitmap_alloc_hwirqs() is completely broken: When the result is greater than or equal 0 (bitmap allocation successful) then the loop terminates and the function returns 0 (success) despite not having installed an interrupt. When the result is less than 0 (bitmap allocation fails), it prints an error message and continues to "work" with that error code which would eventually end up in the MSI message data. 2) On every invocation the file global pp4xx_msi::msi_virqs bitmap is allocated thereby leaking the previous one. IOW, this has never worked and for more than 10 years nobody cared. Remove the gunk. Fixes: 3fb7933850fa ("powerpc/4xx: Adding PCIe MSI support") Fixes: 247540b03bfc ("powerpc/44x: Fix PCI MSI support for Maui APM821xx SoC and Bluestone board") Signed-off-by: Thomas Gleixner Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20211206210223.872249537@linutronix.de commit 26c44b776dba4ac692a0bf5a3836feb8a63fea6b Author: Peter Zijlstra Date: Sat Dec 4 14:43:43 2021 +0100 x86/alternative: Relax text_poke_bp() constraint Currently, text_poke_bp() is very strict to only allow patching a single instruction; however with straight-line-speculation it will be required to patch: ret; int3, which is two instructions. As such, relax the constraints a little to allow int3 padding for all instructions that do not imply the execution of the next instruction, ie: RET, JMP.d8 and JMP.d32. While there, rename the text_poke_loc::rel32 field to ::disp. Note: this fills up the text_poke_loc structure which is now a round 16 bytes big. [ bp: Put comments ontop instead of on the side. ] Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20211204134908.082342723@infradead.org commit 21d638ef9483d8cf19197e1a6f12ebc8f7d7c0b9 Author: Thomas Bogendoerfer Date: Tue Nov 30 17:45:54 2021 +0100 MIPS: TXX9: Remove rbtx4938 board support No active MIPS user own this board, so let's remove it. Signed-off-by: Thomas Bogendoerfer Reviewed-by: Geert Uytterhoeven Tested-by: Geert Uytterhoeven commit f2c6c22fa83ab2577619009057b3ebcb5305bb03 Author: Nathan Chancellor Date: Wed Dec 8 09:56:17 2021 -0700 MIPS: Loongson64: Use three arguments for slti LLVM's integrated assembler does not support 'slti , ': :16:12: error: invalid operand for instruction slti $12, (0x6300 | 0x0008) ^ arch/mips/kernel/head.S:86:2: note: while in macro instantiation kernel_entry_setup # cpu specific setup ^ :16:12: error: invalid operand for instruction slti $12, (0x6300 | 0x0008) ^ arch/mips/kernel/head.S:150:2: note: while in macro instantiation smp_slave_setup ^ To increase compatibility with LLVM's integrated assembler, use the full form of 'slti , , ', which matches the rest of arch/mips/. This does not result in any change for GNU as. Link: https://github.com/ClangBuiltLinux/linux/issues/1526 Reported-by: Ryutaroh Matsumoto Signed-off-by: Nathan Chancellor Signed-off-by: Thomas Bogendoerfer commit 13ceb48bc19c563e05f407e663aaa4105fdfd408 Author: Nathan Chancellor Date: Tue Dec 7 10:59:51 2021 -0700 MIPS: Loongson2ef: Remove unnecessary {as,cc}-option calls When building with LLVM's integrated assembler, the build errors because it does not implement -mfix-loongson2f-{jump,nop}: arch/mips/loongson2ef/Platform:36: *** only binutils >= 2.20.2 have needed option -mfix-loongson2f-nop. Stop. The error is a little misleading because binutils are not being used in this case. To clear this up, remove the as-option calls because binutils 2.23 is the minimum supported version for building the kernel. At the same time, remove the cc-option calls for the '-march=' flags, as GCC 5.1.0 is the minimum supported version. This change will not fix the LLVM build for CONFIG_CPU_LOONGSON2{E,F}, as it does not implement the loongson2{e,f} march arguments (nor r4600, so it will error prior to this change) nor the assembler flags mentioned above but it will make the errors more obvious. Link: https://github.com/ClangBuiltLinux/linux/issues/1529 Reported-by: Ryutaroh Matsumoto Signed-off-by: Nathan Chancellor Signed-off-by: Thomas Bogendoerfer commit 7770a39d7c63faec6c4f33666d49a8cb664d0482 Author: Eric Dumazet Date: Wed Dec 8 12:20:19 2021 -0800 xfrm: fix a small bug in xfrm_sa_len() copy_user_offload() will actually push a struct struct xfrm_user_offload, which is different than (struct xfrm_state *)->xso (struct xfrm_state_offload) Fixes: d77e38e612a01 ("xfrm: Add an IPsec hardware offloading API") Signed-off-by: Eric Dumazet Cc: Steffen Klassert Signed-off-by: Steffen Klassert commit fd2b94a5cb0ff4bb163cdc4afaede6527eec5f7e Author: Jani Nikula Date: Wed Dec 8 13:05:17 2021 +0200 drm/i915/trace: split out display trace to a separate file Add display/intel_display_trace.[ch] for defining display tracepoints. The main goal is to reduce cross-includes between gem and display. It would be possible split up tracing even further, but that would lead to more boilerplate. We end up having to include intel_crtc.h in a few places because it was pulled in implicitly via intel_de.h -> i915_trace.h -> intel_crtc.h, and that's no longer the case. There should be no changes to tracepoints. v3: - Rebase v2: - Define TRACE_INCLUDE_PATH relative to define_trace.h (Chris) - Remove useless comments (Ville) Cc: Ville Syrjälä Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/7862ad764fbd0748d903c76bc632d3d277874e5b.1638961423.git.jani.nikula@intel.com commit 4bb713375e9f4d8b6d540ff47e61a4e357c4229f Author: Jani Nikula Date: Wed Dec 8 13:05:16 2021 +0200 drm/i915/trace: clean up boilerplate organization Follow the style that seems to be prevalent in kernel for undef and define of TRACE_SYSTEM, TRACE_INCLUDE_PATH, and TRACE_INCLUDE_FILE. There should be no changes to tracepoints. v2: Keep TRACE_INCLUDE_PATH relative to define_trace.h (Chris) Cc: Ville Syrjälä Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/0d37790ee70fb60be6f6a73d8bde2013510a7ad8.1638961423.git.jani.nikula@intel.com commit 3f68910259524ce84eaee05075141cdaa45e9195 Author: Jaewon Kim Date: Sat Dec 4 23:58:16 2021 +0200 i2c: exynos5: Add support for ExynosAutoV9 SoC ExynosAutoV9 functioning logic mostly follows I2C_TYPE_EXYNOS7, but timing calculation and configuration procedure is changed: e.g. only timing_s3 has to be set now. Another change of HSI2C controller in ExynosAutoV9 SoC is that it's now a part of USIv2 IP-core. No changes is needed for I2C driver though, as all USI related configuration is done in USI driver. Signed-off-by: Jaewon Kim Signed-off-by: Sam Protsenko Reviewed-by: Krzysztof Kozlowski Signed-off-by: Wolfram Sang commit ea8491a28b849cd3539c7dfa20bb801cf0389915 Author: Sam Protsenko Date: Sat Dec 4 23:58:15 2021 +0200 dt-bindings: i2c: exynos5: Add bus clock In new Exynos SoCs (like Exynos850) where HSI2C is implemented as a part of USIv2 block, there are two clocks provided to HSI2C controller: - PCLK: bus clock (APB), provides access to register interface - IPCLK: operating IP-core clock; SCL is derived from this one Both clocks have to be asserted for HSI2C to be functional in that case. Modify bindings doc to allow specifying bus clock in addition to already described operating clock. Signed-off-by: Sam Protsenko Reviewed-by: Krzysztof Kozlowski Signed-off-by: Wolfram Sang commit bd5f985dc51875b1ca8b28a02952f3fa8864a506 Author: Jaewon Kim Date: Sat Dec 4 23:58:14 2021 +0200 dt-bindings: i2c: exynos5: Add exynosautov9-hsi2c compatible This patch adds new "samsung,exynosautov9-hsi2c" compatible. It is for i2c compatible with HSI2C available on Exynos SoC with USI. Signed-off-by: Jaewon Kim Signed-off-by: Sam Protsenko Reviewed-by: Krzysztof Kozlowski Acked-by: Rob Herring Signed-off-by: Wolfram Sang commit 5ae451148eba181b71575a88fa344fe09a840cf3 Author: Sam Protsenko Date: Sat Dec 4 23:58:13 2021 +0200 dt-bindings: i2c: exynos5: Convert to dtschema Convert Samsung Exynos High Speed I2C bindings doc to DT schema format. Changes during bindings conversion: 1. Added missing required clock properties (driver fails when it's unable to get the clock) 2. Removed properties and descriptions that can be found in schemas/i2c/i2c-controller.yaml [1] 3. Fixed the example so it can be validated by dtschema [1] https://github.com/robherring/dt-schema/blob/master/schemas/i2c/i2c-controller.yaml Signed-off-by: Sam Protsenko Reviewed-by: Krzysztof Kozlowski Signed-off-by: Wolfram Sang commit 92ae3162840072b24ad1c4e3abf3c3d6bd012dee Author: David Heidelberg Date: Mon Dec 6 19:46:12 2021 +0100 dt-bindings: i2c: brcm,bcm2835-i2c: convert to YAML schema Switch the DT binding to a YAML schema to enable the DT validation. Signed-off-by: David Heidelberg Acked-by: Florian Fainelli Tested-by: Florian Fainelli Signed-off-by: Wolfram Sang commit c8a04cbeedbc9f71c475141baa656f14f4879792 Merge: c305ae99dfd4d 69d846126e165 Author: Daniel Vetter Date: Thu Dec 9 09:31:44 2021 +0100 Merge tag 'drm-misc-next-2021-11-29' of git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next for 5.17: UAPI Changes: Cross-subsystem Changes: * Move 'nomodeset' kernel boot option into DRM subsystem Core Changes: * Replace several DRM_*() logging macros with drm_*() equivalents * panel: Add quirk for Lenovo Yoga Book X91F/L * ttm: Documentation fixes Driver Changes: * Cleanup nomodeset handling in drivers * Fixes * bridge/anx7625: Fix reading EDID; Fix error code * bridge/megachips: Probe both bridges before registering * vboxvideo: Fix ERR_PTR usage Signed-off-by: Daniel Vetter From: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/YaSVz15Q7dAlEevU@linux-uq9g.fritz.box commit 8f6b28c5b17826ac5beb5926803a859eae9b413b Merge: fa55b7dcdc43c 5ad5915dea004 Author: Stephen Boyd Date: Thu Dec 9 00:28:39 2021 -0800 Merge tag 'clk-at91-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux into clk-at91 Pull AT91 clk driver updates from Nicolas Ferre: - Lan966x Generic Clock Controller driver and associated DT bindings - Lan966x clock driver extended to support clock gating * tag 'clk-at91-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/at91/linux: clk: lan966x: Extend lan966x clock driver for clock gating support dt-bindings: clock: lan966x: Extend includes with clock gates dt-bindings: clock: lan966x: Extend for clock gate support clk: gate: Add devm_clk_hw_register_gate() clk: lan966x: Add lan966x SoC clock driver dt-bindings: clock: lan966x: Add LAN966X Clock Controller dt-bindings: clock: lan966x: Add binding includes for lan966x SoC clock IDs commit 3bf2537ec2e33310b431b53fd84be8833736c256 Author: Wen Gong Date: Wed Dec 8 01:17:52 2021 -0500 ath10k: drop beacon and probe response which leak from other channel When scan request on channel 1, it also receive beacon from other channels, and the beacon also indicate to mac80211 and wpa_supplicant, and then the bss info appears in radio measurement report of radio measurement sent from wpa_supplicant, thus lead RRM case fail. This is to drop the beacon and probe response which is not the same channel of scanning. Tested-on: QCA6174 hw3.2 SDIO WLAN.RMH.4.4.1-00049 Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211208061752.16564-1-quic_wgong@quicinc.com commit d3d358efc553de4f9d803c889a2e91523ea90f19 Author: Venkateswara Naralasetty Date: Wed Dec 8 10:44:00 2021 +0200 ath11k: add spectral/CFR buffer validation support Currently there is no validation on the spectral/CFR report over the db ring buffers from the hardware. Improper/incomplete DMA by the target can result in invalid data received by host. Due to this we may populate incorrect data to user space. This buffer validation support fix this issues by filling some magic value in the buffer during buffer replenish and check for the magic value in the buffer received by the target. If host detect magic value in the received buffer it will drop the buffer. Tested-on: IPQ8074 WLAN.HK.2.4.0.1-01467-QCAHKSWPL_SILICONZ-1 Signed-off-by: Venkateswara Naralasetty Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1637312901-10279-2-git-send-email-quic_vnaralas@quicinc.com commit 5ede7f0cfb93f0f8edf2245671e18e982a247f55 Author: Hans de Goede Date: Wed Dec 8 09:33:35 2021 -0800 Input: goodix - add pen support Some Goodix touchscreens have support for a (Goodix) active pen, add support for this. The info on how to detect when a pen is down and to detect when the stylus buttons are pressed was lifted from the out of tree Goodix driver with pen support written by Adya: https://gitlab.com/AdyaAdya/goodix-touchscreen-linux-driver/ Since there is no way to tell if pen support is present, the registering of the pen input_dev is delayed till the first pen event is detected. This has been tested on a Trekstor Surftab duo W1, a Chuwi Hi13 and a Cyberbook T116 tablet. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=202161 BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=204513 Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211207100754.31155-3-hdegoede@redhat.com Signed-off-by: Dmitry Torokhov commit 7e2ea2e947046834a450295dfd328adb70a9f864 Author: Anilkumar Kolli Date: Wed Dec 8 10:44:00 2021 +0200 ath11k: Process full monitor mode rx support In full monitor mode, monitor destination ring is read before monitor status ring. mon_dst_ring has ppdu id, reap till the end of PPDU. Add all the MPDUs to list. Start processing the status ring, if PPDU id in status ring is lagging behind, reap the status ring, once the PPDU ID matches, deliver the MSDU to upper layer. If status PPDU id leading, reap the mon_dst_ring. The advantage with full monitor mode is hardware has status buffers available for all the MPDUs in mon_dst_ring, which makes it possible to deliver more frames to be seen on sniffer. Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.4.0.1-01734-QCAHKSWPL_SILICONZ-1 Signed-off-by: Anilkumar Kolli Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1638881695-22155-4-git-send-email-akolli@codeaurora.org commit 88ee00d130f744854cdd91ad76a888d9e66996d1 Author: Anilkumar Kolli Date: Wed Dec 8 10:44:00 2021 +0200 ath11k: add software monitor ring descriptor for full monitor In full monitor mode, monitor destination ring is read in software monitor ring descriptor format instead of reo_entrance_ring format. Add new sw_mon_ring descriptor. Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.4.0.1-01734-QCAHKSWPL_SILICONZ-1 Signed-off-by: Anilkumar Kolli Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1638881695-22155-3-git-send-email-akolli@codeaurora.org commit 5c1f74d24d92ce62264508df4c8acabb3127cd83 Author: Anilkumar Kolli Date: Wed Dec 8 10:44:00 2021 +0200 ath11k: Add htt cmd to enable full monitor mode A new hw_param full_monitor_mode is added to enable full monitor support for QCN9074. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE cmd is sent to FW to enable the full monitor mode. Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.4.0.1-01734-QCAHKSWPL_SILICONZ-1 Signed-off-by: Anilkumar Kolli Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1638881695-22155-2-git-send-email-akolli@codeaurora.org commit fa0fdb78cb5d4cde00430ec481f09fbe7c029376 Author: Thierry Reding Date: Mon Dec 6 15:48:02 2021 +0100 ARM: dts: am335x: Use correct vendor prefix for Asahi Kasei Corp. The old "ak" vendor prefix that was never officially accepted was still being used in some device trees. Convert to the correct vendor prefix (i.e. "asahi-kasei"). Signed-off-by: Thierry Reding Signed-off-by: Tony Lindgren commit 7ebe6e99f7702dad342486e5b30d989a0a6499af Author: Geert Uytterhoeven Date: Fri Dec 3 15:10:43 2021 +0100 ARM: dts: motorola-mapphone: Drop second ti,wlcore compatible value The TI wlcore DT bindings specify using a single compatible value for each variant, and the Linux kernel driver matches against the first compatible value since commit 078b30da3f074f2e ("wlcore: add wl1285 compatible") in v4.13. Signed-off-by: Geert Uytterhoeven Reviewed-by: Sebastian Reichel Signed-off-by: Tony Lindgren commit 6fde719b19af7e82671c352c69981c75ca9909c2 Author: Miquel Raynal Date: Fri Nov 26 15:24:13 2021 +0100 ARM: dts: am437x-gp-evm: enable ADC1 ADC0 and ADC1 pins are available on external connector J22. Enable ADC1 which was missing. Signed-off-by: Miquel Raynal Signed-off-by: Tony Lindgren commit 6c06a9f55b5fc9f48950bedfe8d5b74748a21e76 Author: Miquel Raynal Date: Fri Nov 26 15:24:12 2021 +0100 ARM: dts: am43xx: Describe the magnetic reader/ADC1 hardware module This hardware module is close to the am33xx ADC module but instead of featuring a touchscreen it has a magnetic reader capability. Signed-off-by: Miquel Raynal Acked-by: Tony Lindgren Signed-off-by: Tony Lindgren commit d2e8a6c43bbf61200e5fcb3199efc2680af32bc1 Author: Miquel Raynal Date: Fri Nov 26 15:24:11 2021 +0100 ARM: dts: am437x-cm-t43: Use a correctly spelled DT property Back in 2014 a property got misspelled "ti,coordiante-readouts" instead of "ti,coordinate-readouts". The year after it got fixed but both are still supported, although this is not a reason to continue using this old deprecated property. Signed-off-by: Miquel Raynal Acked-by: Tony Lindgren Signed-off-by: Tony Lindgren commit 1e72c64eb75e99cfcd62c2678f4c465d1213170c Author: Drew Fustini Date: Mon Oct 18 15:00:20 2021 -0700 ARM: dts: am335x-icev2: Add system-power-controller to RTC node On the am335x-icev2 board [1], AM3359 PMIC_PWR_EN (ZCZ ball C6) is connected to PWRHOLD (pin 1) on the TPS65910A3 PMIC. The addition of system-power-controller to the rtc node will enable the capability of the RTC driver to poweroff the board. Based on commit 15c7be47fb7c ("ARM: dts: am335x: Add rtc node as system-power-controller") by Keerthy in ti-linux-5.4.y branch [2]. [1] https://www.ti.com/tool/TMDSICE3359 [2] git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git Cc: Dave Gerlach Cc: Keerthy Link: https://lore.kernel.org/linux-omap/20211012191311.879838-1-dfustini@baylibre.com/ Suggested-by: Johan Hovold Signed-off-by: Drew Fustini Reviewed-by: Johan Hovold Signed-off-by: Tony Lindgren commit f3499b1329c9af605874df0664ee0e245687b72b Author: Drew Fustini Date: Mon Oct 18 15:00:19 2021 -0700 ARM: dts: am335x-boneblack-common: move system-power-controller Move the rtc node system-power-controller property from am335x-boneblack-common.dtsi to am335x-bone-common.dtsi. am335x-boneblack-common.dtsi is included by am335x-boneblack.dts, am335x-boneblack-wireless.dts, am335x-sancloud-bbe.dts and am335x-sancloud-bbe-lite.dts. All of these dts files also include am335x-bone-common.dtsi and thus will retain the rtc node system-power-controller property. am335x-bone-common.dtsi is also included by am335x-bone.dts [1], am335x-bonegreen.dts [2] and am335x-bonegreen-wireless.dts [3]. These boards will now have the rtc node system-power-controller property too. This is valid as they also have PMIC_POWR_EN (ZCZ C6) connected to PWR_EN on the TPS65217B PMIC. Based on commit 15c7be47fb7c ("ARM: dts: am335x: Add rtc node as system-power-controller") by Keerthy in ti-linux-5.4.y branch [4]. [1] https://beagleboard.org/static/beaglebone/BEAGLEBONE_SCHEM_A3.pdf [2] https://github.com/SeeedDocument/BeagleBone_Green/blob/master/resources/BEAGLEBONE_GREEN_V1.pdf [3] https://github.com/SeeedDocument/BeagleBone_Green_Wireless/blob/master/resources/BeagleBone_Green%20Wireless_V1.0_SCH_20160314.pdf [4] git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git Cc: Jason Kridner Cc: Dave Gerlach Cc: Keerthy Link: https://lore.kernel.org/linux-omap/20211012191311.879838-1-dfustini@baylibre.com/ Suggested-by: Johan Hovold Reviewed-by: Johan Hovold Signed-off-by: Drew Fustini Signed-off-by: Tony Lindgren commit e3128a9d482cff9cc2a826adec5e1f7acb922b8f Author: Kees Cook Date: Wed Dec 8 10:44:00 2021 +0200 ath6kl: Use struct_group() to avoid size-mismatched casting In builds with -Warray-bounds, casts from smaller objects to larger objects will produce warnings. These can be overly conservative, but since -Warray-bounds has been finding legitimate bugs, it is desirable to turn it on globally. Instead of casting a u32 to a larger object, redefine the u32 portion of the header to a separate struct that can be used for both u32 operations and the distinct header fields. Silences this warning: drivers/net/wireless/ath/ath6kl/htc_mbox.c: In function 'htc_wait_for_ctrl_msg': drivers/net/wireless/ath/ath6kl/htc_mbox.c:2275:20: error: array subscript 'struct htc_frame_hdr[0]' is partly outside array bounds of 'u32[1]' {aka 'unsigned int[1]'} [-Werror=array-bounds] 2275 | if (htc_hdr->eid != ENDPOINT_0) | ^~ drivers/net/wireless/ath/ath6kl/htc_mbox.c:2264:13: note: while referencing 'look_ahead' 2264 | u32 look_ahead; | ^~~~~~~~~~ This change results in no executable instruction differences. Signed-off-by: Kees Cook Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211207063538.2767954-1-keescook@chromium.org commit 9f6da09a5f6ab94bca58395af56b883b3a79663a Author: Wen Gong Date: Wed Dec 8 10:43:59 2021 +0200 ath11k: enable IEEE80211_HW_SINGLE_SCAN_ON_ALL_BANDS for WCN6855 Currently mac80211 will send 3 scan request for each scan of WCN6855, they are 2.4 GHz/5 GHz/6 GHz band scan. Firmware of WCN6855 will cache the RNR IE(Reduced Neighbor Report element) which exist in the beacon of 2.4 GHz/5 GHz of the AP which is co-located with 6 GHz, and then use the cache to scan in 6 GHz band scan if the 6 GHz scan is in the same scan with the 2.4 GHz/5 GHz band, this will helpful to search more AP of 6 GHz. Also it will decrease the time cost of scan because firmware will use dual-band scan for the 2.4 GHz/5 GHz, it means the 2.4 GHz and 5 GHz scans are doing simultaneously. Set the flag IEEE80211_HW_SINGLE_SCAN_ON_ALL_BANDS for WCN6855 since it supports 2.4 GHz/5 GHz/6 GHz and it is single pdev which means all the 2.4 GHz/5 GHz/6 GHz exist in the same wiphy/ieee80211_hw. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Tested-by: Sven Eckelmann Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211129101309.2931-1-quic_wgong@quicinc.com commit a658c929ded7ea3aee324c8c2a9635a5e5a38e7f Author: Sven Eckelmann Date: Wed Dec 8 10:43:59 2021 +0200 ath11k: Fix buffer overflow when scanning with extraie If cfg80211 is providing extraie's for a scanning process then ath11k will copy that over to the firmware. The extraie.len is a 32 bit value in struct element_info and describes the amount of bytes for the vendor information elements. The WMI_TLV packet is having a special WMI_TAG_ARRAY_BYTE section. This section can have a (payload) length up to 65535 bytes because the WMI_TLV_LEN can store up to 16 bits. The code was missing such a check and could have created a scan request which cannot be parsed correctly by the firmware. But the bigger problem was the allocation of the buffer. It has to align the TLV sections by 4 bytes. But the code was using an u8 to store the newly calculated length of this section (with alignment). And the new calculated length was then used to allocate the skbuff. But the actual code to copy in the data is using the extraie.len and not the calculated "aligned" length. The length of extraie with IEEE80211_HW_SINGLE_SCAN_ON_ALL_BANDS enabled was 264 bytes during tests with a QCA Milan card. But it only allocated 8 bytes (264 bytes % 256) for it. As consequence, the code to memcpy the extraie into the skb was then just overwriting data after skb->end. Things like shinfo were therefore corrupted. This could usually be seen by a crash in skb_zcopy_clear which tried to call a ubuf_info callback (using a bogus address). Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-02892.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Cc: stable@vger.kernel.org Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices") Signed-off-by: Sven Eckelmann Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211207142913.1734635-1-sven@narfation.org commit d0df53d36cd51154463796bc6abdd11abdbc67c1 Author: Ngo Tak Fong Date: Wed Dec 8 05:22:23 2021 +0800 staging: rtl8712: Fix alignment checks with flipped condition Fixed two CHECKs of Alignment should match open parenthesis and flipped a condition to pull the code in one tab. Reviewed-by: Dan Carpenter Signed-off-by: Ngo Tak Fong Link: https://lore.kernel.org/r/20211207212223.GA70594@simon-desktop Signed-off-by: Greg Kroah-Hartman commit 673cd3f471dd3b6e9f6ca2806338711c92bb012d Author: Martin Kaiser Date: Tue Dec 7 22:05:37 2021 +0100 staging: r8188eu: remove LedPin from struct struct LED_871x We only support a single LED. LedPin in struct struct LED_871x is always LED_PIN_LED0. There's no need to store this info or to pass it to functions as a parameter. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211207210537.23382-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 86b7e5fbd62373b16f8a026c46d47c1f668cac46 Author: Martin Kaiser Date: Tue Dec 7 22:05:36 2021 +0100 staging: r8188eu: remove code to set led1 registers This driver uses only led0. Remove the register settings to switch led1 on and off. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211207210537.23382-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 22e6a4846738aebff06ebec0b94d0e19f2a0ab71 Author: Martin Kaiser Date: Tue Dec 7 22:05:35 2021 +0100 staging: r8188eu: remove SwLed1 The r8188eu driver does not use SwLed1. Calls from other layers to modify the led state end up in SwLedControlMode1, where SwLed0 is hard-coded. This patch removes the code to initialise and deinitialise SwLed1 and the SwLed1 struct itself. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211207210537.23382-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit d904512db6f372759ecd1c8f92e689e63af2f03a Author: Michael Straube Date: Tue Dec 7 15:04:05 2021 +0100 staging: r8188eu: convert type of HalData in struct adapter adapter->HalData is used in the GET_HAL_DATA macro all across the driver code but nobody checks if its allocation in rtl188eu_alloc_haldata() was successful or not. To avoid errors when the allocation fails convert the type of field HalData from void pointer to struct hal_data_8188eu. Remove GET_HAL_DATA, rtl8188eu_alloc_haldata(), rtl8188e_free_hal_data(). Reported-by: kernel test robot Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211207140405.8673-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 5d8dfaa71d87f742c53309b95cb6a8b274119027 Merge: 8c374ef454162 8bb7eca972ad5 Author: Dmitry Torokhov Date: Wed Dec 8 23:43:50 2021 -0800 Merge tag 'v5.15' into next Sync up with the mainline to get the latest APIs and DT bindings. commit 73b6eae583f44e278e19489a411f9c1e22d530fc Author: Colin Ian King Date: Tue Dec 7 22:47:18 2021 +0000 bpf: Remove redundant assignment to pointer t The pointer t is being initialized with a value that is never read. The pointer is re-assigned a value a littler later on, hence the initialization is redundant and can be removed. Signed-off-by: Colin Ian King Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211207224718.59593-1-colin.i.king@gmail.com commit 36b88b209593f6e103fdc4df369fcdedc7f2f1c9 Author: Dmitry Osipenko Date: Wed Oct 20 02:40:59 2021 +0300 ARM: dts: elpida_ecb240abacn: Change Elpida compatible Vendor prefix shouldn't start with capital letter. The Elpida Memory compatible was never used in practice, hence just correct the compatible. Signed-off-by: Dmitry Osipenko Signed-off-by: Tony Lindgren commit b540358e6c4d86eb450f3539aea198653e656641 Author: Yonghong Song Date: Wed Dec 8 21:04:03 2021 -0800 selftests/bpf: Fix a compilation warning The following warning is triggered when I used clang compiler to build the selftest. /.../prog_tests/btf_dedup_split.c:368:6: warning: variable 'btf2' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] if (!ASSERT_OK(err, "btf_dedup")) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /.../prog_tests/btf_dedup_split.c:424:12: note: uninitialized use occurs here btf__free(btf2); ^~~~ /.../prog_tests/btf_dedup_split.c:368:2: note: remove the 'if' if its condition is always false if (!ASSERT_OK(err, "btf_dedup")) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /.../prog_tests/btf_dedup_split.c:343:25: note: initialize the variable 'btf2' to silence this warning struct btf *btf1, *btf2; ^ = NULL Initialize local variable btf2 = NULL and the warning is gone. Fixes: 9a49afe6f5a5 ("selftests/bpf: Add btf_dedup case with duplicated structs within CU") Signed-off-by: Yonghong Song Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211209050403.1770836-1-yhs@fb.com commit 9d922f5df53844228b9f7c62f2593f4f06c0b69b Author: Gustavo A. R. Silva Date: Tue Dec 7 22:03:11 2021 -0600 net: huawei: hinic: Use devm_kcalloc() instead of devm_kzalloc() Use 2-factor multiplication argument form devm_kcalloc() instead of devm_kzalloc(). Link: https://github.com/KSPP/linux/issues/162 Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20211208040311.GA169838@embeddedor Signed-off-by: Jakub Kicinski commit d7ca9a34dd333a73a01a61563b1a8f4886b0d340 Author: Gustavo A. R. Silva Date: Tue Dec 7 18:35:27 2021 -0600 net: hinic: Use devm_kcalloc() instead of devm_kzalloc() Use 2-factor multiplication argument form devm_kcalloc() instead of devm_kzalloc(). Link: https://github.com/KSPP/linux/issues/162 Signed-off-by: Gustavo A. R. Silva Reviewed-by: Kees Cook Link: https://lore.kernel.org/r/20211208003527.GA75483@embeddedor Signed-off-by: Jakub Kicinski commit 28a0a044fbe9e1efb8fde6b74ebc1dcd79b4fdfa Merge: 16daf3d9ec44e 5f1c802ca69b3 Author: Jakub Kicinski Date: Wed Dec 8 18:36:51 2021 -0800 Merge branch 'net-track-the-queue-count-at-unregistration' Antoine Tenart says: ==================== net: track the queue count at unregistration Those two patches allow to track the Rx and Tx queue count at unregistration and help in detecting illegal addition of Tx queues after unregister (a warning is added). This follows discussions on the following thread, https://lore.kernel.org/all/20211122162007.303623-1-atenart@kernel.org/T/ A patch fixing one issue linked to this was merged ealier, https://lore.kernel.org/all/20211203101318.435618-1-atenart@kernel.org/T/ ==================== Link: https://lore.kernel.org/r/20211207145725.352657-1-atenart@kernel.org Signed-off-by: Jakub Kicinski commit 5f1c802ca69b3c076eea5fabc8839ffa5ddd8c8f Author: Antoine Tenart Date: Tue Dec 7 15:57:25 2021 +0100 net-sysfs: warn if new queue objects are being created during device unregistration Calling netdev_queue_update_kobjects is allowed during device unregistration since commit 5c56580b74e5 ("net: Adjust TX queue kobjects if number of queues changes during unregister"). But this is solely to allow queue unregistrations. Any path attempting to add new queues after a device started its unregistration should be fixed. This patch adds a warning to detect such illegal use. Signed-off-by: Antoine Tenart Signed-off-by: Jakub Kicinski commit d7dac083414eb5bb99a6d2ed53dc2c1b405224e5 Author: Antoine Tenart Date: Tue Dec 7 15:57:24 2021 +0100 net-sysfs: update the queue counts in the unregistration path When updating Rx and Tx queue kobjects, the queue count should always be updated to match the queue kobjects count. This was not done in the net device unregistration path, fix it. Tracking all queue count updates will allow in a following up patch to detect illegal updates. Signed-off-by: Antoine Tenart Signed-off-by: Jakub Kicinski commit 12422af8194df85243d68b11f8783de9d01e58dc Author: Lakshmi Sowjanya D Date: Wed Dec 1 12:56:26 2021 +0530 pinctrl: Add Intel Thunder Bay pinctrl driver About Intel Thunder Bay: ----------------------- Intel Thunder Bay is a computer vision AI accelerator SoC based on ARM CPU. Pinctrl IP: ---------- The SoC has a customised pinmux controller IP which controls pin multiplexing and configuration. Thunder 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 Thunder Bay SoC. Co-developed-by: Kiran Kumar S Signed-off-by: Kiran Kumar S Signed-off-by: Lakshmi Sowjanya D Link: https://lore.kernel.org/r/20211201072626.19599-3-lakshmi.sowjanya.d@intel.com Signed-off-by: Linus Walleij commit bd92baaa262dc1342f1514a3937f151d37ee740d Author: Lakshmi Sowjanya D Date: Wed Dec 1 12:56:25 2021 +0530 dt-bindings: pinctrl: Add bindings for Intel Thunderbay pinctrl driver Add Device Tree bindings documentation and an entry in MAINTAINERS file for Intel Thunder Bay SoC's pin controller. Signed-off-by: Lakshmi Sowjanya D Link: https://lore.kernel.org/r/20211201072626.19599-2-lakshmi.sowjanya.d@intel.com Signed-off-by: Linus Walleij commit 469407a3b5ed9390cfacb0363d1cc926a51f6a14 Author: Gao Xiang Date: Thu Dec 9 09:29:18 2021 +0800 erofs: clean up erofs_map_blocks tracepoints Since the new type of chunk-based files is introduced, there is no need to leave flatmode tracepoints. Rename to erofs_map_blocks instead. Link: https://lore.kernel.org/r/20211209012918.30337-1-hsiangkao@linux.alibaba.com Reviewed-by: Yue Hu Signed-off-by: Gao Xiang commit 4beb02f19c37e6fbe941d786119ed82ec0aca19a Author: Vinod Koul Date: Wed Dec 1 12:54:34 2021 +0530 pinctrl: qcom: Add SM8450 pinctrl driver This adds pincontrol driver for tlmm block found in SM8450 SoC This patch is based on initial code downstream by Elliot Berman Signed-off-by: Vinod Koul Tested-by: Dmitry Baryshkov Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211201072434.3968768-3-vkoul@kernel.org Signed-off-by: Linus Walleij commit 82dc44e7c650618c4fe26dbfe290372f4904bbe2 Author: Vinod Koul Date: Wed Dec 1 12:54:33 2021 +0530 dt-bindings: pinctrl: qcom: Add SM8450 pinctrl bindings Add device tree binding Documentation details for Qualcomm SM8450 TLMM device Signed-off-by: Vinod Koul Reviewed-by: Bjorn Andersson Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211201072434.3968768-2-vkoul@kernel.org Signed-off-by: Linus Walleij commit 16daf3d9ec44ef9a85833f8638ff432ac09a8d18 Merge: a43a07202160c 283e6f5a8166f Author: Jakub Kicinski Date: Wed Dec 8 17:59:03 2021 -0800 Merge branch 'wwan-debugfs-tweaks' Sergey Ryazanov says: ==================== WWAN debugfs tweaks This is a follow-up series to just applied IOSM (and WWAN) debugfs interface support [1]. The series has two main goals: 1. move the driver-specific debugfs knobs to a subdirectory; 2. make the debugfs interface optional for both IOSM and for the WWAN core. As for the first part, I must say that it was my mistake. I suggested to place debugfs entries under a common per WWAN device directory. But I missed the driver subdirectory in the example, so it become: /sys/kernel/debugfs/wwan/wwan0/trace Since the traces collection is a driver-specific feature, it is better to keep it under the driver-specific subdirectory: /sys/kernel/debugfs/wwan/wwan0/iosm/trace It is desirable to be able to entirely disable the debugfs interface. It can be disabled for several reasons, including security and consumed storage space. See detailed rationale with usage example in the 4th patch. The changes themselves are relatively simple, but require a code rearrangement. So to make changes clear, I chose to split them into preparatory and main changes and properly describe each of them. IOSM part is compile-tested only since I do not have IOSM supported device, so it needs Ack from the driver developers. I would like to thank Johannes Berg and Leon Romanovsky. Their suggestions and comments helped a lot to rework the initial over-engineered solution to something less confusing and much more simple. Thanks! 1. https://lore.kernel.org/netdev/20211120162155.1216081-1-m.chetan.kumar@linux.intel.com 2. https://patchwork.kernel.org/project/netdevbpf/patch/20211204174033.950528-1-arnd@kernel.org/ ==================== Link: https://lore.kernel.org/r/20211207092140.19142-1-ryazanov.s.a@gmail.com Signed-off-by: Jakub Kicinski commit 283e6f5a8166f075eba78da6b867d76cc5d47e77 Author: Sergey Ryazanov Date: Tue Dec 7 12:21:40 2021 +0300 net: wwan: make debugfs optional Debugfs interface is optional for the regular modem use. Some distros and users will want to disable this feature for security or kernel size reasons. So add a configuration option that allows to completely disable the debugfs interface of the WWAN devices. A primary considered use case for this option was embedded firmwares. For example, in OpenWrt, you can not completely disable debugfs, as a lot of wireless stuff can only be configured and monitored with the debugfs knobs. At the same time, reducing the size of a kernel and modules is an essential task in the world of embedded software. Disabling the WWAN and IOSM debugfs interfaces allows us to save 50K (x86-64 build) of space for module storage. Not much, but already considerable when you only have 16MB of storage. So it is hard to just disable whole debugfs. Users need some fine grained set of options to control which debugfs interface is important and should be available and which is not. The new configuration symbol is enabled by default and is hidden under the EXPERT option. So a regular user would not be bothered by another one configuration question. While an embedded distro maintainer will be able to a little more reduce the final image size. Signed-off-by: Sergey Ryazanov Reviewed-by: Leon Romanovsky Reviewed-by: Loic Poulain Acked-by: M Chetan Kumar Signed-off-by: Jakub Kicinski commit cf90098dbb1f784661354ff8f7ca293e1ff8153b Author: Sergey Ryazanov Date: Tue Dec 7 12:21:39 2021 +0300 net: wwan: iosm: move debugfs knobs into a subdir The modem traces collection is a device (and so driver) specific option. Therefore, move the related debugfs files into a driver-specific subdirectory under the common per WWAN device directory. Signed-off-by: Sergey Ryazanov Reviewed-by: Loic Poulain Acked-by: M Chetan Kumar Signed-off-by: Jakub Kicinski commit 13b94fbaa28c64cebee5fcd43a9b5971e8591497 Author: Sergey Ryazanov Date: Tue Dec 7 12:21:38 2021 +0300 net: wwan: iosm: allow trace port be uninitialized Collecting modem firmware traces is optional for the regular modem use. There are not many reasons for aborting device initialization due to an inability to initialize the trace port and (or) its debugfs interface. So, demote the initialization failure erro message into a warning and do not break the initialization sequence in this case. Rework packet processing and deinitialization so that they do not crash in case of uninitialized trace port. This change is mainly a preparation for an upcoming configuration option introduction that will help disable driver debugfs functionality. Signed-off-by: Sergey Ryazanov Reviewed-by: Loic Poulain Acked-by: M Chetan Kumar Signed-off-by: Jakub Kicinski commit e9877d4ef856c7e8c66e942baa94dd0dde09b787 Author: Sergey Ryazanov Date: Tue Dec 7 12:21:37 2021 +0300 net: wwan: iosm: consolidate trace port init code Move the channel related structures initialization from ipc_imem_channel_init() to ipc_trace_init() and call it directly. On the one hand, this makes the trace port initialization symmetric to the deitialization, that is, it removes the additional wrapper. On the other hand, this change consolidates the trace port related code into a single source file, what facilitates an upcoming disabling of this functionality by a user choise. Signed-off-by: Sergey Ryazanov Reviewed-by: Loic Poulain Acked-by: M Chetan Kumar Signed-off-by: Jakub Kicinski commit a43a07202160c430c8ac405756b98eb55fc07774 Merge: 3a262c71d3e87 6a93ea3821770 Author: Jakub Kicinski Date: Wed Dec 8 17:06:57 2021 -0800 Merge tag 'linux-can-next-for-5.17-20211208' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next Marc Kleine-Budde says: ==================== can-next 2021-12-08 The first patch is by Vincent Mailhol and replaces the custom CAN units with generic one form linux/units.h. The next 3 patches are by Evgeny Boger and add Allwinner R40 support to the sun4i CAN driver. Andy Shevchenko contributes 4 patches to the hi311x CAN driver, consisting of cleanups and converting the driver to the device property API. * tag 'linux-can-next-for-5.17-20211208' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next: can: hi311x: hi3110_can_probe(): convert to use dev_err_probe() can: hi311x: hi3110_can_probe(): make use of device property API can: hi311x: hi3110_can_probe(): try to get crystal clock rate from property can: hi311x: hi3110_can_probe(): use devm_clk_get_optional() to get the input clock ARM: dts: sun8i: r40: add node for CAN controller can: sun4i_can: add support for R40 CAN controller dt-bindings: net: can: add support for Allwinner R40 CAN controller can: bittiming: replace CAN units with the generic ones from linux/units.h ==================== Link: https://lore.kernel.org/r/20211208125055.223141-1-mkl@pengutronix.de Signed-off-by: Jakub Kicinski commit e08a7d5611b876bf9da3ef7c185d26dcadf24dc9 Author: Madhumitha Tolakanahalli Pradeep Date: Wed Dec 8 13:31:16 2021 -0800 drm/i915/dmc: Update DMC to v2.14 on ADL-P Changes since v2.12: - Release notes for v2.13: 1. Fix for simple flip queue with DC6v - Release notes for v2.14: 1. Fix for flip queue roll over cases with DC6v 2. Enhancement for residency 3. Workaround for 3Dlut restore issue v2: Commit message update (Imre) Signed-off-by: Madhumitha Tolakanahalli Pradeep Reviewed-by: Lucas De Marchi Acked-by: Rodrigo Vivi Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20211208213115.1919503-1-lucas.demarchi@intel.com commit 20cddfcc82e642e4682c48af91f0702fbbd623a0 Author: Tejas Upadhyay Date: Mon Dec 6 13:40:26 2021 +0530 drm/i915/gt: Use hw_engine_masks as reset_domains We need a way to reset engines by their reset domains. This change sets up way to fetch reset domains of each engine globally. Changes since V1: - Use static reset domain array - Ville and Tvrtko - Use BUG_ON at appropriate place - Tvrtko Signed-off-by: Tejas Upadhyay Reviewed-by: Rodrigo Vivi Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20211206081026.4024401-1-tejaskumarx.surendrakumar.upadhyay@intel.com commit 3a262c71d3e8734fc426c42d5315e259e8f47bdd Merge: 1fe5b01262844 857fdd74fb38d Author: Jakub Kicinski Date: Wed Dec 8 14:31:18 2021 -0800 Merge branch 'rework-dsa-bridge-tx-forwarding-offload-api' Vladimir Oltean says: ==================== Rework DSA bridge TX forwarding offload API This change set is preparation work for DSA support of bridge FDB isolation. It replaces struct net_device *dp->bridge_dev with a struct dsa_bridge *dp->bridge that contains some extra information about that bridge, like a unique number kept by DSA. Up until now we computed that number only with the bridge TX forwarding offload feature, but it will be needed for other features too, like for isolation of FDB entries belonging to different bridges. Hardware implementations vary, but one common pattern seems to be the presence of a FID field which can be associated with that bridge number kept by DSA. The idea was outlined here: https://patchwork.kernel.org/project/netdevbpf/patch/20210818120150.892647-16-vladimir.oltean@nxp.com/ (the difference being that with this new proposal, drivers would not need to call dsa_bridge_num_find, instead the bridge_num would be part of the struct dsa_bridge :: num passed as argument). No functional change is intended for drivers that don't already make use of the bridge TX forwarding offload. I've tested the changes on the felix, sja1105 and mv88e6xxx drivers, but nonetheless I'm copying all DSA driver maintainers due to API changes that are taking place. Compared to v1 and v2, the amount of patches is larger, but the contents is mostly the same, just split up hopefully a bit better for review. ==================== Link: https://lore.kernel.org/r/20211206165758.1553882-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 857fdd74fb38dad4d0333401fb1826cd8cf0df2c Author: Vladimir Oltean Date: Mon Dec 6 18:57:58 2021 +0200 net: dsa: eliminate dsa_switch_ops :: port_bridge_tx_fwd_{,un}offload We don't really need new switch API for these, and with new switches which intend to add support for this feature, it will become cumbersome to maintain. The change consists in restructuring the two drivers that implement this offload (sja1105 and mv88e6xxx) such that the offload is enabled and disabled from the ->port_bridge_{join,leave} methods instead of the old ->port_bridge_tx_fwd_{,un}offload. The only non-trivial change is that mv88e6xxx_map_virtual_bridge_to_pvt() has been moved to avoid a forward declaration, and the mv88e6xxx_reg_lock() calls from inside it have been removed, since locking is now done from mv88e6xxx_port_bridge_{join,leave}. Signed-off-by: Vladimir Oltean Reviewed-by: Alvin Šipraga Signed-off-by: Jakub Kicinski commit b079922ba2acf072b23d82fa246a0d8de198f0a2 Author: Vladimir Oltean Date: Mon Dec 6 18:57:57 2021 +0200 net: dsa: add a "tx_fwd_offload" argument to ->port_bridge_join This is a preparation patch for the removal of the DSA switch methods ->port_bridge_tx_fwd_offload() and ->port_bridge_tx_fwd_unoffload(). The plan is for the switch to report whether it offloads TX forwarding directly as a response to the ->port_bridge_join() method. This change deals with the noisy portion of converting all existing function prototypes to take this new boolean pointer argument. The bool is placed in the cross-chip notifier structure for bridge join, and a reference to it is provided to drivers. In the next change, DSA will then actually look at this value instead of calling ->port_bridge_tx_fwd_offload(). Signed-off-by: Vladimir Oltean Reviewed-by: Alvin Šipraga Signed-off-by: Jakub Kicinski commit d3eed0e57d5d1bcbf1bd60f83a4adfe7d7b8dd9c Author: Vladimir Oltean Date: Mon Dec 6 18:57:56 2021 +0200 net: dsa: keep the bridge_dev and bridge_num as part of the same structure The main desire behind this is to provide coherent bridge information to the fast path without locking. For example, right now we set dp->bridge_dev and dp->bridge_num from separate code paths, it is theoretically possible for a packet transmission to read these two port properties consecutively and find a bridge number which does not correspond with the bridge device. Another desire is to start passing more complex bridge information to dsa_switch_ops functions. For example, with FDB isolation, it is expected that drivers will need to be passed the bridge which requested an FDB/MDB entry to be offloaded, and along with that bridge_dev, the associated bridge_num should be passed too, in case the driver might want to implement an isolation scheme based on that number. We already pass the {bridge_dev, bridge_num} pair to the TX forwarding offload switch API, however we'd like to remove that and squash it into the basic bridge join/leave API. So that means we need to pass this pair to the bridge join/leave API. During dsa_port_bridge_leave, first we unset dp->bridge_dev, then we call the driver's .port_bridge_leave with what used to be our dp->bridge_dev, but provided as an argument. When bridge_dev and bridge_num get folded into a single structure, we need to preserve this behavior in dsa_port_bridge_leave: we need a copy of what used to be in dp->bridge. Switch drivers check bridge membership by comparing dp->bridge_dev with the provided bridge_dev, but now, if we provide the struct dsa_bridge as a pointer, they cannot keep comparing dp->bridge to the provided pointer, since this only points to an on-stack copy. To make this obvious and prevent driver writers from forgetting and doing stupid things, in this new API, the struct dsa_bridge is provided as a full structure (not very large, contains an int and a pointer) instead of a pointer. An explicit comparison function needs to be used to determine bridge membership: dsa_port_offloads_bridge(). Signed-off-by: Vladimir Oltean Reviewed-by: Alvin Šipraga Signed-off-by: Jakub Kicinski commit 6a43cba3034015d1c029c8a81b62eb9c2660fd6e Author: Vladimir Oltean Date: Mon Dec 6 18:57:55 2021 +0200 net: dsa: export bridging offload helpers to drivers Move the static inline helpers from net/dsa/dsa_priv.h to include/net/dsa.h, so that drivers can call functions such as dsa_port_offloads_bridge_dev(), which will be necessary after the transition to a more complex bridge structure. More functions than are needed right now are being moved, but this is done for uniformity. Signed-off-by: Vladimir Oltean Reviewed-by: Alvin Šipraga Signed-off-by: Jakub Kicinski commit 936db8a2dba26c7f1c90a71be65c126cf1c9f52a Author: Vladimir Oltean Date: Mon Dec 6 18:57:54 2021 +0200 net: dsa: rename dsa_port_offloads_bridge to dsa_port_offloads_bridge_dev Currently the majority of dsa_port_bridge_dev_get() calls in drivers is just to check whether a port is under the bridge device provided as argument by the DSA API. We'd like to change that DSA API so that a more complex structure is provided as argument. To keep things more generic, and considering that the new complex structure will be provided by value and not by reference, direct comparisons between dp->bridge and the provided bridge will be broken. The generic way to do the checking would simply be to do something like dsa_port_offloads_bridge(dp, &bridge). But there's a problem, we already have a function named that way, which actually takes a bridge_dev net_device as argument. Rename it so that we can use dsa_port_offloads_bridge for something else. Signed-off-by: Vladimir Oltean Reviewed-by: Alvin Šipraga Signed-off-by: Jakub Kicinski commit 41fb0cf1bced59c1fe178cf6cc9f716b5da9e40e Author: Vladimir Oltean Date: Mon Dec 6 18:57:53 2021 +0200 net: dsa: hide dp->bridge_dev and dp->bridge_num in drivers behind helpers The location of the bridge device pointer and number is going to change. It is not going to be kept individually per port, but in a common structure allocated dynamically and which will have lockdep validation. Use the helpers to access these elements so that we have a migration path to the new organization. Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 36cbf39b56908bb2e7e8e392e5f08895c3ca4326 Author: Vladimir Oltean Date: Mon Dec 6 18:57:52 2021 +0200 net: dsa: hide dp->bridge_dev and dp->bridge_num in the core behind helpers The location of the bridge device pointer and number is going to change. It is not going to be kept individually per port, but in a common structure allocated dynamically and which will have lockdep validation. Create helpers to access these elements so that we have a migration path to the new organization. Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 65144067d3602640e65a524c7a4694df017da810 Author: Vladimir Oltean Date: Mon Dec 6 18:57:51 2021 +0200 net: dsa: mv88e6xxx: compute port vlan membership based on dp->bridge_dev comparison The goal of this change is to reduce mv88e6xxx_port_vlan() to a form where dsa_port_bridge_same() can be used, since the dp->bridge_dev pointer will be hidden in a future change. To do that, we observe that the "br" pointer is deduced from a dp->bridge_dev in both cases (of a physical switch port as well as a virtual bridge). So instead of keeping the "br" pointer, we can just keep the "dp" pointer from which "br" gets derived. In the last iteration over switch ports, we must use another iterator variable, "other_dp"since now we use the "dp" variable to keep an indirect reference to the bridge. While at it, the old code used to filter only the ports which were part of the same switch as "ds". There exists a dedicated DSA port iterator for that: dsa_switch_for_each_port (which skips the ports in the tree that belong to non-local switches), so we can just use that. Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 0493fa7927af8d5ad79b00019736b9f415d03245 Author: Vladimir Oltean Date: Mon Dec 6 18:57:50 2021 +0200 net: dsa: mv88e6xxx: iterate using dsa_switch_for_each_user_port in mv88e6xxx_port_check_hw_vlan Avoid a plethora of dsa_to_port() calls (some hidden behind dsa_is_*_port and some in plain sight) by keeping two struct dsa_port references: one to the port passed as argument, and another to the other ports of the switch that we're iterating over. This isn't called from the DSA initialization path, so there is no risk that we have user ports without a dp->slave populated. So the combined checks that a port isn't a DSA port, a CPU port, or doesn't have a slave net device (therefore is unused), are strictly equivalent to the simple check that the port is a user port. This is already handled by the DSA iterator. i gets replaced by other_dp->index, dsa_is_*_port calls get replaced by dsa_port_is_*, and dsa_to_port gets replaced by the respective pointer directly. Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 872bb81dfbc3811bc77aafd63deca73a08a9c20f Author: Vladimir Oltean Date: Mon Dec 6 18:57:49 2021 +0200 net: dsa: mt7530: iterate using dsa_switch_for_each_user_port in bridging ops Avoid repeated calls to dsa_to_port() (some hidden behind dsa_is_user_port and some in plain sight) by keeping two struct dsa_port references: one to the port passed as argument, and another to the other ports of the switch that we're iterating over. dsa_to_port(ds, i) gets replaced by other_dp, i gets replaced by other_port which is derived from other_dp->index, dsa_is_user_port is handled by the DSA iterator. Signed-off-by: Vladimir Oltean Signed-off-by: Jakub Kicinski commit 947c8746e2c31bb469ba9ee02dc739be6a98ee38 Author: Vladimir Oltean Date: Mon Dec 6 18:57:48 2021 +0200 net: dsa: assign a bridge number even without TX forwarding offload The service where DSA assigns a unique bridge number for each forwarding domain is useful even for drivers which do not implement the TX forwarding offload feature. For example, drivers might use the dp->bridge_num for FDB isolation. So rename ds->num_fwd_offloading_bridges to ds->max_num_bridges, and calculate a unique bridge_num for all drivers that set this value. Signed-off-by: Vladimir Oltean Reviewed-by: Alvin Šipraga Signed-off-by: Jakub Kicinski commit 3f9bb0301d50ce27421eff4b710c2bbe58111a83 Author: Vladimir Oltean Date: Mon Dec 6 18:57:47 2021 +0200 net: dsa: make dp->bridge_num one-based I have seen too many bugs already due to the fact that we must encode an invalid dp->bridge_num as a negative value, because the natural tendency is to check that invalid value using (!dp->bridge_num). Latest example can be seen in commit 1bec0f05062c ("net: dsa: fix bridge_num not getting cleared after ports leaving the bridge"). Convert the existing users to assume that dp->bridge_num == 0 is the encoding for invalid, and valid bridge numbers start from 1. Signed-off-by: Vladimir Oltean Reviewed-by: Alvin Šipraga Signed-off-by: Jakub Kicinski commit 84184107c39ae65d08f6d449a57ec58734ff535a Author: Thierry Reding Date: Wed Dec 8 15:33:06 2021 +0100 dt-bindings: i2c: tegra-bpmp: Convert to json-schema Convert the NVIDIA Tegra186 (and later) BPMP I2C bindings from the free-form text format to json-schema. Signed-off-by: Thierry Reding Link: https://lore.kernel.org/r/20211208143306.534700-1-thierry.reding@gmail.com Signed-off-by: Rob Herring commit de3f6daa66cb9152cadfbaf9b7cd2f78f9e041e5 Author: Thierry Reding Date: Tue Dec 7 16:07:44 2021 +0100 dt-bindings: arm: pmu: Document Denver and Carmel PMUs Add compatible strings for the NVIDIA Denver and Carmel PMUs. Signed-off-by: Thierry Reding Link: https://lore.kernel.org/r/20211207150746.444478-1-thierry.reding@gmail.com Signed-off-by: Rob Herring commit 50eb892364c784b5ffeccb0c73f00edaf058f07c Author: Robin Murphy Date: Tue Dec 7 18:20:39 2021 +0000 dt-bindings: arm: Catch up with Cortex/Neoverse CPUs again Add bindings for the 2020 and 2021 cohorts of Cortex-A and Neoverse CPUs, now featuring their Cortex-X cousins as well. Signed-off-by: Robin Murphy Link: https://lore.kernel.org/r/a36014d06d308c73d3fa1ed55e8967fb8adadf0d.1638900542.git.robin.murphy@arm.com Signed-off-by: Rob Herring commit dc98a7b68f83037c093e7cec450bb985f79f2abc Author: Florian Fainelli Date: Wed Dec 8 12:28:01 2021 -0800 dt-bindings: net: Convert SYSTEMPORT to YAML Convert the Broadcom SYSTEMPORT Ethernet controller Device Tree binding to YAML. Signed-off-by: Florian Fainelli Link: https://lore.kernel.org/r/20211208202801.3706929-3-f.fainelli@gmail.com Signed-off-by: Rob Herring commit 2371a03fcef0ed71f91ab6fb15db7a5f0b986247 Author: Florian Fainelli Date: Wed Dec 8 12:28:00 2021 -0800 dt-bindings: net: Convert AMAC to YAML Convert the Broadcom AMAC Device Tree binding to YAML to help with schema and dtbs checking. Signed-off-by: Florian Fainelli Link: https://lore.kernel.org/r/20211208202801.3706929-2-f.fainelli@gmail.com Signed-off-by: Rob Herring commit 67c430bbaae153433f76807d07b8298ac4714822 Author: Siva Mullati Date: Wed Dec 8 09:42:15 2021 +0530 drm/i915: Skip remap_io_mapping() for non-x86 platforms Only hw that supports mappable aperture would hit this path vm_fault_gtt/vm_fault_tmm, So we never hit this function remap_io_mapping() in discrete, So skip this code for non-x86 architectures. v2: use IS_ENABLED () instead of #if defined v3: move function prototypes from i915_drv.h to i915_mm.h v4: added kernel error message in stub function v5: fixed compilation warnings v6: checkpatch style Signed-off-by: Siva Mullati Reviewed-by: Lucas De Marchi Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20211208041215.763098-1-siva.mullati@intel.com commit ef8df9798d469b7c45c66664550e93469749f1e8 Author: Vincent Donnefort Date: Tue Dec 7 09:57:55 2021 +0000 sched/fair: Cleanup task_util and capacity type task_util and capacity are comparable unsigned long values. There is no need for an intermidiate implicit signed cast. Signed-off-by: Vincent Donnefort Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20211207095755.859972-1-vincent.donnefort@arm.com commit c9ee950a2ca55ea0f63d0893f796b2eb089e7900 Author: Anusha Srivatsa Date: Thu Dec 2 22:35:45 2021 -0800 drm/i915/rpl-s: Enable guc submission by default Though, RPL-S is defined as subplatform of ADL-S, unlike ADL-S, it has GuC submission by default. v2: Remove extra parenthesis (Jani) v3: s/IS_RAPTORLAKE/IS_ADLS_RPLS (Jani) Cc: dri-devel@lists.freedesktop.org Cc: Joonas Lahtinen Cc: Tvrtko Ursulin Cc: Jani Nikula Signed-off-by: Anusha Srivatsa Reviewed-by: José Roberto de Souza Acked-by: Tvrtko Ursulin Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20211203063545.2254380-4-anusha.srivatsa@intel.com commit 4a75f32fc783128d0c42ef73fa62a20379a66828 Author: Anusha Srivatsa Date: Thu Dec 2 22:35:44 2021 -0800 drm/i915/rpl-s: Add PCH Support for Raptor Lake S Add the PCH ID for RPL-S. v2: Self contained commit message (Jani) Cc: dri-devel@lists.freedesktop.org Cc: Joonas Lahtinen Cc: Tvrtko Ursulin Cc: Jani Nikula Signed-off-by: Anusha Srivatsa Reviewed-by: José Roberto de Souza Acked-by: Tvrtko Ursulin Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20211203063545.2254380-3-anusha.srivatsa@intel.com commit 52407c220c44c8dcc6aa8aa35ffc8a2db3c849a9 Author: Anusha Srivatsa Date: Thu Dec 2 22:35:43 2021 -0800 drm/i915/rpl-s: Add PCI IDS for Raptor Lake S Raptor Lake S(RPL-S) is a version 12 Display, Media and Render. For all i915 purposes it is the same as Alder Lake S (ADL-S). Introduce RPL-S as a subplatform of ADL-S. This patch adds PCI ids for RPL-S. BSpec: 53655 Cc: x86@kernel.org Cc: dri-devel@lists.freedesktop.org Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: Joonas Lahtinen Cc: Tvrtko Ursulin Cc: Matt Roper Cc: Jani Nikula Signed-off-by: Anusha Srivatsa Reviewed-by: José Roberto de Souza Acked-by: Dave Hansen # arch/x86 Acked-by: Tvrtko Ursulin Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20211203063545.2254380-2-anusha.srivatsa@intel.com commit 8d0f9e73efe7f0ff4b1d0d013044e8ef91782689 Author: Song Liu Date: Tue Dec 7 15:23:40 2021 -0800 perf/bpf_counter: Use bpf_map_create instead of bpf_create_map bpf_create_map is deprecated. Replace it with bpf_map_create. Also add a __weak bpf_map_create() so that when older version of libbpf is linked as a shared library, it falls back to bpf_create_map(). Fixes: 992c4225419a ("libbpf: Unify low-level map creation APIs w/ new bpf_map_create()") Signed-off-by: Song Liu Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211207232340.2561471-1-song@kernel.org commit 7675a1dc6c6cc8ace8cf8d48bf9dee37a404d524 Author: Florian Fainelli Date: Mon Dec 6 10:00:49 2021 -0800 dt-bindings: net: Convert iProc MDIO mux to YAML Conver the Broadcom iProc MDIO mux Device Tree binding to YAML. Signed-off-by: Florian Fainelli Link: https://lore.kernel.org/r/20211206180049.2086907-9-f.fainelli@gmail.com Signed-off-by: Rob Herring commit 1fefc8e762d91a9782588d96ee1172163535e724 Author: Florian Fainelli Date: Mon Dec 6 10:00:48 2021 -0800 dt-bindings: phy: Convert Northstar 2 PCIe PHY to YAML Convert the Broadcom Northstar 2 PCIe PHY Device Tree binding to YAML and rename it accordingly in the process since it had nothing to do with a MDIO mux on the PCI(e) bus. This is a pre-requisite to updating another binding file to YAML. Signed-off-by: Florian Fainelli Link: https://lore.kernel.org/r/20211206180049.2086907-8-f.fainelli@gmail.com Signed-off-by: Rob Herring commit 3a47044797ca2d316c3a9ea828dd13e55ea0a896 Author: Florian Fainelli Date: Mon Dec 6 10:00:45 2021 -0800 dt-bindings: net: Convert GENET binding to YAML Convert the GENET binding to YAML, leveraging brcm,unimac-mdio.yaml and the standard ethernet-controller.yaml files. Signed-off-by: Florian Fainelli Link: https://lore.kernel.org/r/20211206180049.2086907-5-f.fainelli@gmail.com Signed-off-by: Rob Herring commit 68dfc226bcc83adec9ef626da0dc5abc4dbe1f87 Author: Florian Fainelli Date: Mon Dec 6 10:00:44 2021 -0800 dt-bindings: net: Document moca PHY interface MoCA (Multimedia over Coaxial) is used by the internal GENET/MOCA cores and will be needed in order to convert GENET to YAML in subsequent changes. Signed-off-by: Florian Fainelli Link: https://lore.kernel.org/r/20211206180049.2086907-4-f.fainelli@gmail.com Signed-off-by: Rob Herring commit f9caf418fced4b6a32ea564cb209a2da5add0766 Author: Florian Fainelli Date: Mon Dec 6 10:00:43 2021 -0800 dt-bindings: net: brcm,unimac-mdio: Update maintainers for binding Add Doug and myself as maintainers since this binding is used by the GENET Ethernet controller for its internal MDIO controller. Signed-off-by: Florian Fainelli Link: https://lore.kernel.org/r/20211206180049.2086907-3-f.fainelli@gmail.com Signed-off-by: Rob Herring commit 75c4b9a67969f015a6dd602fb40ff14b5147dea9 Author: Florian Fainelli Date: Mon Dec 6 10:00:42 2021 -0800 dt-bindings: net: brcm,unimac-mdio: reg-names is optional The UniMAC MDIO controller integrated into GENET does not provide a reg-names property since it is optional, reflect that in the binding. Signed-off-by: Florian Fainelli Link: https://lore.kernel.org/r/20211206180049.2086907-2-f.fainelli@gmail.com Signed-off-by: Rob Herring commit 5e8a7d26d93503012d1ee3dc9786c75d01e84fb8 Author: Florian Fainelli Date: Thu Dec 2 14:36:09 2021 -0800 dt-bindings: PCI: brcmstb: compatible is required The compatible property is required, make sure the binding documents it as such. Signed-off-by: Florian Fainelli Link: https://lore.kernel.org/r/20211202223609.1171452-1-f.fainelli@gmail.com Signed-off-by: Rob Herring commit 05db148ee9a7c7d2a690ff2862fac77be06ce667 Author: Kees Cook Date: Wed Dec 1 09:32:34 2021 -0800 libertas_tf: Add missing __packed annotations The earlier __packed annotations added in commit d71038c05970 ("libertas: Fix alignment issues in libertas core") were not duplicated when libertas_af was added in commit 7670e62c7ed6 ("libertas_tf: header file"), even though they share several structure definitions. Add the missing annotations which commit 642a57475b30 ("libertas_tf: Use struct_group() for memcpy() region") exposed. Quoting the prior libertas fix: "Data structures that come over the wire from the WLAN firmware must be packed." Reported-by: kernel test robot Link: https://lore.kernel.org/linux-mm/202111302102.apaePz2J-lkp@intel.com Fixes: 642a57475b30 ("libertas_tf: Use struct_group() for memcpy() region") Fixes: 7670e62c7ed6 ("libertas_tf: header file") Signed-off-by: Kees Cook Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211201173234.578124-3-keescook@chromium.org commit 978090ae8856edbf4d01d0c1f2103831da25f04c Author: Kees Cook Date: Wed Dec 1 09:32:33 2021 -0800 libertas: Add missing __packed annotation with struct_group() Build testing of the newly added struct_group() usage missed smaller architecture width tests for changes to pahole output. Add the missed __packed annotation with struct_group() usage in a __packed struct. Reported-by: kernel test robot Link: https://lore.kernel.org/linux-mm/202111302102.apaePz2J-lkp@intel.com Fixes: 5fd32ae0433a ("libertas: Use struct_group() for memcpy() region") Signed-off-by: Kees Cook Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211201173234.578124-2-keescook@chromium.org commit 1b8bb8919ef81bfc8873d223b9361f1685f2106d Author: Brian Norris Date: Mon Nov 29 16:47:34 2021 -0800 mwifiex: Fix possible ABBA deadlock Quoting Jia-Ju Bai : mwifiex_dequeue_tx_packet() spin_lock_bh(&priv->wmm.ra_list_spinlock); --> Line 1432 (Lock A) mwifiex_send_addba() spin_lock_bh(&priv->sta_list_spinlock); --> Line 608 (Lock B) mwifiex_process_sta_tx_pause() spin_lock_bh(&priv->sta_list_spinlock); --> Line 398 (Lock B) mwifiex_update_ralist_tx_pause() spin_lock_bh(&priv->wmm.ra_list_spinlock); --> Line 941 (Lock A) Similar report for mwifiex_process_uap_tx_pause(). While the locking expectations in this driver are a bit unclear, the Fixed commit only intended to protect the sta_ptr, so we can drop the lock as soon as we're done with it. IIUC, this deadlock cannot actually happen, because command event processing (which calls mwifiex_process_sta_tx_pause()) is sequentialized with TX packet processing (e.g., mwifiex_dequeue_tx_packet()) via the main loop (mwifiex_main_process()). But it's good not to leave this potential issue lurking. Fixes: f0f7c2275fb9 ("mwifiex: minor cleanups w/ sta_list_spinlock in cfg80211.c") Cc: Douglas Anderson Reported-by: TOTE Robot Link: https://lore.kernel.org/linux-wireless/0e495b14-efbb-e0da-37bd-af6bd677ee2c@gmail.com/ Signed-off-by: Brian Norris Reviewed-by: Douglas Anderson Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/YaV0pllJ5p/EuUat@google.com commit f61550b3864b9578527c28cf9c465316ac1566e1 Author: Kuogee Hsieh Date: Wed Dec 8 09:41:02 2021 -0800 drm/msm/dp: dp_link_parse_sink_count() return immediately if aux read failed Add checking aux read/write status at both dp_link_parse_sink_count() and dp_link_parse_sink_status_filed() to avoid long timeout delay if dp aux read/write failed at timeout due to cable unplugged. Changes in V4: -- split this patch as stand alone patch Changes in v5: -- rebase on msm-next branch Signed-off-by: Kuogee Hsieh Reviewed-by: Stephen Boyd Tested-by: Stephen Boyd Link: https://lore.kernel.org/r/1638985262-2072-1-git-send-email-quic_khsieh@quicinc.com Signed-off-by: Rob Clark commit f28c240e7152462f0750a8939db28d985ecf7c67 Author: Hao Xu Date: Wed Dec 8 13:21:25 2021 +0800 io_uring: batch completion in prior_task_list In previous patches, we have already gathered some tw with io_req_task_complete() as callback in prior_task_list, let's complete them in batch while we cannot grab uring lock. In this way, we batch the req_complete_post path. Signed-off-by: Hao Xu Link: https://lore.kernel.org/r/20211208052125.351587-1-haoxu@linux.alibaba.com Reviewed-by: Pavel Begunkov Signed-off-by: Jens Axboe commit f2f16ae9cc9cba4e3c70941cf6a6443c9ea920f4 Author: David Mosberger-Tang Date: Thu Dec 2 04:50:09 2021 +0000 wilc1000: Add id_table to spi_driver This eliminates warning message: SPI driver WILC_SPI has no spi_device_id for microchip,wilc1000 and makes device-tree autoloading work. Signed-off-by: David Mosberger-Tang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211202045001.2901903-1-davidm@egauge.net commit a58fdb7c843a37d6598204c6513961feefdadc6a Author: Ping-Ke Shih Date: Wed Dec 1 17:38:16 2021 +0800 rtw89: don't kick off TX DMA if failed to write skb This is found by Smatch static checker warning: drivers/net/wireless/realtek/rtw89/mac80211.c:31 rtw89_ops_tx() error: uninitialized symbol 'qsel'. The warning is because 'qsel' isn't filled by rtw89_core_tx_write() due to failed to write. The way to fix it is to avoid kicking off TX DMA, so add 'return' to the failure case. Reported-by: Dan Carpenter Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211201093816.13806-1-pkshih@realtek.com commit c2258b29985eac9216a9e55f9d5bead9767f96da Author: Zong-Zhe Yang Date: Wed Dec 1 16:09:01 2021 +0800 rtw89: remove cch_by_bw which is not used Originally, cch_by_bw recorded center channels of each available bandwidths under current bandwidth. And the plan was to iterate cch_by_bw as parameters to query other configurations. However, we have not used it for the time being. Keeping it will disturb the follow-up things, such as bandwidth 160 MHz, so we remove it for now. If it's really needed at some point, we will redesign it. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211201080901.12125-1-pkshih@realtek.com commit 40822e079011ef8704d429c9d8271000159abffe Author: Ping-Ke Shih Date: Wed Dec 1 16:06:06 2021 +0800 rtw89: fix sending wrong rtwsta->mac_id to firmware to fill address CAM With wrong rtwsta->mac_id, it can't send out ack properly when we receive assoc response occasionally. Then, it failed to connect an AP. The cause is that we store 'sta' and use it somewhere. To correct this, remove the variable and use mac_id in drv_priv of 'sta' or 'vif' passed by mac80211. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211201080607.11211-1-pkshih@realtek.com commit 157289376e29fd7dc684c778205a8de04aa0aed4 Author: Zong-Zhe Yang Date: Mon Nov 29 10:06:26 2021 +0800 rtw88: refine tx_pwr_tbl debugfs to show channel and bandwidth Show channel and bandwidth in debugfs tx_pwr_tbl to make it easier to understand which tx power table is shown currently, and to reduce additional checks through other ways. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211129020626.6384-1-pkshih@realtek.com commit 1379e62026ab5a89b4d0fd1aed68248ceafca5bf Author: Yan-Hsuan Chuang Date: Mon Nov 29 10:05:06 2021 +0800 rtw88: add debugfs to fix tx rate It is useful to fix the bit rate of TX packets. For example, if someone is measuring the TX power, or debugging with the issues of the TX throughput on the field. To set the value of fixed rate, one should input corresponding desc rate index (ex, 0x0b for DESC_RATE54M to fix at 54 Mbps). Set a value larger than DESC_RATE_MAX will disable fix rate, so the rate adaptive mechanism can resume to work. Example, To fix rate at MCS 1: echo 0x0d > /sys/kernel/debug/ieee80211/phy0/rtw88/fix_rate To not to fix rate: echo 0xff > /sys/kernel/debug/ieee80211/phy0/rtw88/fix_rate To know which rate was fixed at: cat /sys/kernel/debug/ieee80211/phy0/rtw88/fix_rate Signed-off-by: Yan-Hsuan Chuang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211129020506.6273-1-pkshih@realtek.com commit eb4e52b3f38dfd08a89e1084f5980a2bb93456fb Author: Po Hao Huang Date: Thu Nov 11 10:37:06 2021 +0800 rtw89: fix incorrect channel info during scan We used to fill in rx skbs' frequency field by mac80211's current channel value. In some cases, mac80211 switches channel before all rx packets have been processed. This results in incorrect bss info. We fix this by filling in frequency field with channel index obtained from hardware, then fix potential cck missing issue by skb's original hw rate. After all fix is done, convert hw rate back to the supported band rate index. Signed-off-by: Po Hao Huang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211111023706.14154-3-pkshih@realtek.com commit e45a9e6265d2591efb745c9ffa46f4e9cceb5c65 Author: Ping-Ke Shih Date: Thu Nov 11 10:37:05 2021 +0800 rtw89: update scan_mac_addr during scanning period Update scan_mac_addr to address CAM as A1, so hardware can ACK probe response properly. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211111023706.14154-2-pkshih@realtek.com commit 1cc1e4c8aab4213bd4e6353dec2620476a233d6d Author: Peter Zijlstra Date: Sat Dec 4 14:43:42 2021 +0100 objtool: Add straight-line-speculation validation Teach objtool to validate the straight-line-speculation constraints: - speculation trap after indirect calls - speculation trap after RET Notable: when an instruction is annotated RETPOLINE_SAFE, indicating speculation isn't a problem, also don't care about sls for that instruction. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20211204134908.023037659@infradead.org commit 00224aa70891ec4cdca54100674e0ca201535f84 Author: Ping-Ke Shih Date: Fri Nov 19 13:45:12 2021 +0800 rtw89: use inline function instead macro to set H2C and CAM In order to use compiler to check if we do improper cast of const* on arguments of inline function. Signed-off-by: Ping-Ke Shih Tested-by: Takashi Iwai Tested-by: Larry Finger Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211119054512.10620-4-pkshih@realtek.com commit 321e763ccc5260364600b4facd9e9acf645949b2 Author: Ping-Ke Shih Date: Fri Nov 19 13:45:11 2021 +0800 rtw89: add const in the cast of le32_get_bits() Add 'const' to be clear that this is a read-only access, and this patch doesn't change logic at all. Signed-off-by: Ping-Ke Shih Tested-by: Takashi Iwai Tested-by: Larry Finger Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211119054512.10620-3-pkshih@realtek.com commit b17c2baa305cccbd16bafa289fd743cc2db77966 Author: Peter Zijlstra Date: Sat Dec 4 14:43:41 2021 +0100 x86: Prepare inline-asm for straight-line-speculation Replace all ret/retq instructions with ASM_RET in preparation of making it more than a single instruction. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20211204134907.964635458@infradead.org commit 44bf8704b71f86c4e56c4dbefc2bd40cbb5b269b Author: Kalyan Thota Date: Fri Oct 29 05:30:19 2021 -0700 drm/msm/disp/dpu1: set default group ID for CTL. New required programming in CTL for SC7280. Group ID informs HW of which VM owns that CTL. Force this group ID to default/disabled until virtualization support is enabled in SW. Changes in v1: - Fix documentation and add descritpion for the change (Stephen) Signed-off-by: Kalyan Thota Reviewed-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/1635510619-6715-1-git-send-email-quic_kalyant@quicinc.com Signed-off-by: Rob Clark commit 8066c615cb69b7da8a94f59379847b037b3a5e46 Author: Arnaud Pouliquen Date: Mon Dec 6 20:07:58 2021 +0100 rpmsg: core: Clean up resources on announce_create failure. During the rpmsg_dev_probe, if rpdev->ops->announce_create returns an error, the rpmsg device and default endpoint should be freed before exiting the function. Fixes: 5e619b48677c ("rpmsg: Split rpmsg core and virtio backend") Suggested-by: Bjorn Andersson Signed-off-by: Arnaud Pouliquen Reviewed-by: Bjorn Andersson Cc: stable Link: https://lore.kernel.org/r/20211206190758.10004-1-arnaud.pouliquen@foss.st.com Signed-off-by: Mathieu Poirier commit 92cb1bedde9dba78d802fe2510949743a2581aed Author: Dmitry Baryshkov Date: Thu Nov 25 21:01:14 2021 +0300 drm/msm/dsi: fix initialization in the bonded DSI case Commit 739b4e7756d3 ("drm/msm/dsi: Fix an error code in msm_dsi_modeset_init()") changed msm_dsi_modeset_init() to return an error code in case msm_dsi_manager_validate_current_config() returns false. However this is not an error case, but a slave DSI of the bonded DSI link. In this case msm_dsi_modeset_init() should return 0, but just skip connector and bridge initialization. To reduce possible confusion, drop the msm_dsi_manager_validate_current_config() function, and specif 'bonded && !master' condition directly in the msm_dsi_modeset_init(). Fixes: 739b4e7756d3 ("drm/msm/dsi: Fix an error code in msm_dsi_modeset_init()") Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20211125180114.561278-1-dmitry.baryshkov@linaro.org Signed-off-by: Rob Clark commit 8f86e69536f32a645e45a00d3b2ea73af5e41180 Author: Arnaud Pouliquen Date: Mon Dec 6 20:18:58 2021 +0100 remoteproc: Fix remaining wrong return formatting in documentation kernel documentation specification: "The return value, if any, should be described in a dedicated section named Return." Signed-off-by: Arnaud Pouliquen Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211206191858.10741-1-arnaud.pouliquen@foss.st.com Signed-off-by: Mathieu Poirier commit 62c46d55688894c517d26b88ddb37a8dfa8a155a Author: Mathieu Poirier Date: Thu Dec 2 10:11:25 2021 -0700 MAINTAINERS: Removing Ohad from remoteproc/rpmsg maintenance Ohad has not reviewed patches in the remoteproc and rpmsg subsystems for several years now: $ git log --no-merges --format=email drivers/remoteproc/ drivers/rpmsg/ | \ grep -Pi "^Subject:|^Date:|^[\w\-]+-by:.*ohad*" | grep -B2 ohad Date: Wed, 16 Sep 2015 07:32:54 -0500 Subject: [PATCH] remoteproc/wkup_m3: Use MODULE_DEVICE_TABLE to export alias Signed-off-by: Ohad Ben-Cohen Date: Fri, 28 Aug 2015 18:08:19 -0700 Subject: [PATCH] remoteproc: report error if resource table doesn't exist Signed-off-by: Ohad Ben-Cohen -- Date: Wed, 16 Sep 2015 19:29:18 -0500 Subject: [PATCH] remoteproc: fix memory leak of remoteproc ida cache layers Signed-off-by: Ohad Ben-Cohen Date: Fri, 20 Nov 2015 18:26:07 +0100 Subject: [PATCH] remoteproc: avoid stack overflow in debugfs file Signed-off-by: Ohad Ben-Cohen Date: Thu, 18 Jun 2015 11:44:41 +0300 Subject: [PATCH] remoteproc: fix !CONFIG_OF build breakage Signed-off-by: Ohad Ben-Cohen Date: Fri, 22 May 2015 15:45:30 -0500 Subject: [PATCH] remoteproc/wkup_m3: add a remoteproc driver for TI Wakeup M3 Signed-off-by: Ohad Ben-Cohen As such move his names to the CREDITS file. Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20211202171125.903608-1-mathieu.poirier@linaro.org Acked-by: Ohad Ben Cohen commit 62df22396bea321435153cdba37585ad8ff9c567 Author: Mark Brown Date: Wed Sep 15 19:09:57 2021 +0100 ASoC: amd: Convert to new style DAI format definitions Convert the AMD machine drivers to use the new style defines for clocking in DAI formats. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20210915180957.39996-1-broonie@kernel.org Signed-off-by: Mark Brown commit 03848335b5b1faa4a4641fcf30b7c233579a45aa Author: Rob Clark Date: Tue Dec 7 13:57:52 2021 -0800 drm/bridge: sn65dsi86: defer if there is no dsi host Otherwise we don't get another shot at it if the bridge probes before the dsi host is registered. It seems like this is what *most* (but not all) of the other bridges do. It looks like this was missed in the conversion to attach dsi host at probe time. Fixes: c3b75d4734cb ("drm/bridge: sn65dsi86: Register and attach our DSI device at probe") Signed-off-by: Rob Clark Reviewed-by: Doug Anderson Tested-by: Doug Anderson Reviewed-by: Stephen Boyd [dianders: squashed in Stephen's simplification] Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20211207215753.635841-1-robdclark@gmail.com commit 9a0a930fe2535a76ad70d3f43caeccf0d86a3009 Author: Arnd Bergmann Date: Tue Dec 7 13:24:42 2021 +0100 binder: fix pointer cast warning binder_uintptr_t is not the same as uintptr_t, so converting it into a pointer requires a second cast: drivers/android/binder.c: In function 'binder_translate_fd_array': drivers/android/binder.c:2511:28: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 2511 | sender_ufda_base = (void __user *)sender_uparent->buffer + fda->parent_offset; | ^ Fixes: 656e01f3ab54 ("binder: read pre-translated fds from sender buffer") Acked-by: Todd Kjos Acked-by: Randy Dunlap # build-tested Acked-by: Christian Brauner Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20211207122448.1185769-1-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman commit 20f07a044a76aebaaa0603038857229b5c460d69 Author: Kirill A. Shutemov Date: Mon Dec 6 16:55:05 2021 +0300 x86/sev: Move common memory encryption code to mem_encrypt.c SEV and TDX both protect guest memory from host accesses. They both use guest physical address bits to communicate to the hardware which pages receive protection or not. SEV and TDX both assume that all I/O (real devices and virtio) must be performed to pages *without* protection. To add this support, AMD SEV code forces force_dma_unencrypted() to decrypt DMA pages when DMA pages were allocated for I/O. It also uses swiotlb_update_mem_attributes() to update decryption bits in SWIOTLB DMA buffers. Since TDX also uses a similar memory sharing design, all the above mentioned changes can be reused. So move force_dma_unencrypted(), SWIOTLB update code and virtio changes out of mem_encrypt_amd.c to mem_encrypt.c. Introduce a new config option X86_MEM_ENCRYPT that can be selected by platforms which use x86 memory encryption features (needed in both AMD SEV and Intel TDX guest platforms). Since the code is moved from mem_encrypt_amd.c, inherit the same make flags. This is preparation for enabling TDX memory encryption support and it has no functional changes. Co-developed-by: Kuppuswamy Sathyanarayanan Signed-off-by: Kuppuswamy Sathyanarayanan Signed-off-by: Kirill A. Shutemov Signed-off-by: Borislav Petkov Reviewed-by: Andi Kleen Reviewed-by: Tony Luck Reviewed-by: Tom Lendacky Tested-by: Tom Lendacky Link: https://lore.kernel.org/r/20211206135505.75045-4-kirill.shutemov@linux.intel.com commit dbca5e1a04f8b30aea4e2c91e5045ee6e7c3ef43 Author: Kuppuswamy Sathyanarayanan Date: Mon Dec 6 16:55:04 2021 +0300 x86/sev: Rename mem_encrypt.c to mem_encrypt_amd.c Both Intel TDX and AMD SEV implement memory encryption features. But the bulk of the code in mem_encrypt.c is AMD-specific. Rename the file to mem_encrypt_amd.c. A subsequent patch will extract the parts that can be shared by both TDX and AMD SEV/SME into a generic file. No functional changes. Signed-off-by: Kuppuswamy Sathyanarayanan Signed-off-by: Kirill A. Shutemov Signed-off-by: Borislav Petkov Reviewed-by: Tony Luck Reviewed-by: Tom Lendacky Tested-by: Tom Lendacky Link: https://lore.kernel.org/r/20211206135505.75045-3-kirill.shutemov@linux.intel.com commit 8260b9820f7050461b8969305bbd8cb5654f0c74 Author: Kuppuswamy Sathyanarayanan Date: Mon Dec 6 16:55:03 2021 +0300 x86/sev: Use CC_ATTR attribute to generalize string I/O unroll INS/OUTS are not supported in TDX guests and cause #UD. Kernel has to avoid them when running in TDX guest. To support existing usage, string I/O operations are unrolled using IN/OUT instructions. AMD SEV platform implements this support by adding unroll logic in ins#bwl()/outs#bwl() macros with SEV-specific checks. Since TDX VM guests will also need similar support, use CC_ATTR_GUEST_UNROLL_STRING_IO and generic cc_platform_has() API to implement it. String I/O helpers were the last users of sev_key_active() interface and sev_enable_key static key. Remove them. [ bp: Move comment too and do not delete it. ] Suggested-by: Tom Lendacky Signed-off-by: Kuppuswamy Sathyanarayanan Signed-off-by: Kirill A. Shutemov Signed-off-by: Borislav Petkov Reviewed-by: Tony Luck Reviewed-by: Tom Lendacky Tested-by: Tom Lendacky Link: https://lkml.kernel.org/r/20211206135505.75045-2-kirill.shutemov@linux.intel.com commit 28e4576d556bca543b0996e9edd4b767397e24c6 Author: Christoph Hellwig Date: Tue Nov 9 15:50:28 2021 +0100 dma-direct: add a dma_direct_use_pool helper Add a helper to check if a potentially blocking operation should dip into the atomic pools. Signed-off-by: Christoph Hellwig Reviewed-by: Robin Murphy commit 9abc21c966619d6ead27fd48481966014fdc680f Author: Dan Carpenter Date: Wed Dec 8 18:11:45 2021 +0300 ASoC: mediatek: mt8195: silence uninitialized variable warning Smatch complains that we might hit the continue path on every iteration through the loop. sound/soc/mediatek/mt8195/mt8195-mt6359-rt1019-rt5682.c:831 mt8195_mt6359_rt1019_rt5682_card_late_probe() error: uninitialized symbol 'sof_comp'. Initialize "sof_comp" to NULL to silence this warning. Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20211208151145.GA29257@kili Signed-off-by: Mark Brown commit 53d01e2016d77ff647fb2056c39c67df18ee86bf Author: Kirill A. Shutemov Date: Mon Dec 6 15:29:52 2021 +0300 ACPI: PM: Avoid CPU cache flush when entering S4 According to ACPI 6.4, Section 16.2, the CPU cache flushing is required on entering to S1, S2, and S3. No need to flush the caches during hibernation (S4). Signed-off-by: Kirill A. Shutemov [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki commit 74d9555580c48a04b2c3b742dfb0c80777aa0b26 Author: David Woodhouse Date: Mon Nov 8 16:09:41 2021 +0000 PM: hibernate: Allow ACPI hardware signature to be honoured Theoretically, when the hardware signature in FACS changes, the OS is supposed to gracefully decline to attempt to resume from S4: "If the signature has changed, OSPM will not restore the system context and can boot from scratch" In practice, Windows doesn't do this and many laptop vendors do allow the signature to change especially when docking/undocking, so it would be a bad idea to simply comply with the specification by default in the general case. However, there are use cases where we do want the compliant behaviour and we know it's safe. Specifically, when resuming virtual machines where we know the hypervisor has changed sufficiently that resume will fail. We really want to be able to *tell* the guest kernel not to try, so it boots cleanly and doesn't just crash. This patch provides a way to opt in to the spec-compliant behaviour on the command line. A follow-up patch may do this automatically for certain "known good" machines based on a DMI match, or perhaps just for all hypervisor guests since there's no good reason a hypervisor would change the hardware_signature that it exposes to guests *unless* it wants them to obey the ACPI specification. Signed-off-by: David Woodhouse Signed-off-by: Rafael J. Wysocki commit de291b5902860d18d6e02000808aeb833ec1feb6 Author: Christoph Hellwig Date: Wed Dec 8 10:12:03 2021 +0100 iomap: turn the byte variable in iomap_zero_iter into a ssize_t @bytes also holds the return value from iomap_write_end, which can contain a negative error value. As @bytes is always less than the page size even the signed type can hold the entire possible range. Fixes: c6f40468657d ("fsdax: decouple zeroing from the iomap buffered I/O code") Reported-by: Dan Carpenter Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211208091203.2927754-1-hch@lst.de Signed-off-by: Dan Williams commit 142ff9bddbde757674c7081ffc238cfcffa1859b Author: Marc Zyngier Date: Wed Dec 8 14:46:41 2021 +0000 KVM: arm64: Drop unused workaround_flags vcpu field workaround_flags is a leftover from our earlier Spectre-v4 workaround implementation, and now serves no purpose. Get rid of the field and the corresponding asm-offset definition. Fixes: 29e8910a566a ("KVM: arm64: Simplify handling of ARCH_WORKAROUND_2") Signed-off-by: Marc Zyngier commit 5f96ba56552121f4297874d0accf29b9b4a1ae93 Author: Hans de Goede Date: Fri Nov 26 16:21:09 2021 +0100 ACPI: PMIC: xpower: Fix _TMP ACPI errors On some devices with a X-Powers AXP288 PMIC the LPAT tables in the ACPI node for the AXP288 PMIC for some reason only describe a small temperature range, e.g. 27° - 37° Celcius (assuming the entries are in millidegrees). When the tablet is idle in a room at 21° degrees this is causing values outside the LPAT table to be read, causing e.g. the following 2 errors to get spammed to the logs every 4 seconds! : [ 7512.791316] ACPI Error: AE_ERROR, Returned by Handler for [UserDefinedRegion] (20210930/evregion-281) [ 7512.791611] ACPI Error: Aborting method \_SB.SXP1._TMP due to previous error (AE_ERROR) (20210930/psparse-529) Fix this by clamping the raw value to the LPAT table range before passing it to acpi_lpat_raw_to_temp(). Note clamping has been chosen rather then extrapolating because it is unknown how other parts of the ACPI tables will respond to temperature values outside of the LPAT range. Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit c5200609c9176482ea96ac73e52bd466b622f385 Author: Hans de Goede Date: Fri Nov 26 16:21:08 2021 +0100 ACPI: PMIC: allow drivers to provide a custom lpat_raw_to_temp() function The LPAT tables used in the DSDT for some PMICs require special handling, allow the PMIC OpRegion drivers to provide an alternative implementation by adding a lpat_raw_to_temp function pointer to struct pmic_table; and initialize this to the default acpi_lpat_raw_to_temp function for all PMICs. Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit e172e650eda3274964df3a74cf12d210eae9a044 Author: Hans de Goede Date: Fri Nov 26 16:21:07 2021 +0100 ACPI: PMIC: constify all struct intel_pmic_opregion_data declarations The struct intel_pmic_opregion_data declarations never change, constify them all. Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit 2925fc1c102943a2496e13ef78d68acd5fd0dc99 Author: Mikko Perttunen Date: Wed Dec 8 15:05:41 2021 +0100 misc: sram: Add compatible string for Tegra234 SYSRAM We want to use the same behavior as on Tegra186 and Tegra194, so add this the compatible string for Tegra234 SYSRAM to the list. Signed-off-by: Mikko Perttunen Signed-off-by: Thierry Reding Link: https://lore.kernel.org/r/20211208140541.520238-1-thierry.reding@gmail.com Signed-off-by: Greg Kroah-Hartman commit 502d2bf5f2fd7c05adc2d4f057910bd5d4c4c63e Author: Vitaly Kuznetsov Date: Mon Nov 29 10:47:04 2021 +0100 KVM: nVMX: Implement Enlightened MSR Bitmap feature Updating MSR bitmap for L2 is not cheap and rearly needed. TLFS for Hyper-V offers 'Enlightened MSR Bitmap' feature which allows L1 hypervisor to inform L0 when it changes MSR bitmap, this eliminates the need to examine L1's MSR bitmap for L2 every time when 'real' MSR bitmap for L2 gets constructed. Use 'vmx->nested.msr_bitmap_changed' flag to implement the feature. Note, KVM already uses 'Enlightened MSR bitmap' feature when it runs as a nested hypervisor on top of Hyper-V. The newly introduced feature is going to be used by Hyper-V guests on KVM. When the feature is enabled for Win10+WSL2, it shaves off around 700 CPU cycles from a nested vmexit cost (tight cpuid loop test). Signed-off-by: Vitaly Kuznetsov Message-Id: <20211129094704.326635-5-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini commit ed2a4800ae9d491e4bf1b8b60b15001ce3b88fcd Author: Vitaly Kuznetsov Date: Mon Nov 29 10:47:03 2021 +0100 KVM: nVMX: Track whether changes in L0 require MSR bitmap for L2 to be rebuilt Introduce a flag to keep track of whether MSR bitmap for L2 needs to be rebuilt due to changes in MSR bitmap for L1 or switching to a different L2. This information will be used for Enlightened MSR Bitmap feature for Hyper-V guests. Note, setting msr_bitmap_changed to 'true' from set_current_vmptr() is not really needed for Enlightened MSR Bitmap as the feature can only be used in conjunction with Enlightened VMCS but let's keep tracking information complete, it's cheap and in the future similar PV feature can easily be implemented for KVM on KVM too. No functional change intended. Signed-off-by: Vitaly Kuznetsov Message-Id: <20211129094704.326635-4-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini commit b84155c38076b36d625043a06a2f1c90bde62903 Author: Vitaly Kuznetsov Date: Mon Nov 29 10:47:02 2021 +0100 KVM: VMX: Introduce vmx_msr_bitmap_l01_changed() helper In preparation to enabling 'Enlightened MSR Bitmap' feature for Hyper-V guests move MSR bitmap update tracking to a dedicated helper. Note: vmx_msr_bitmap_l01_changed() is called when MSR bitmap might be updated. KVM doesn't check if the bit we're trying to set is already set (or the bit it's trying to clear is already cleared). Such situations should not be common and a few false positives should not be a problem. No functional change intended. Signed-off-by: Vitaly Kuznetsov Reviewed-by: Maxim Levitsky Reviewed-by: Sean Christopherson Message-Id: <20211129094704.326635-3-vkuznets@redhat.com> Signed-off-by: Paolo Bonzini commit d9b994cd7641ad8eda97aa8633f4e2f35d7d0a79 Author: Pierre-Louis Bossart Date: Tue Dec 7 13:23:09 2021 -0600 ASoC: AMD: acp-config: fix missing dependency on SND_SOC_ACPI With a custom .config, the following error is thrown: ERROR: modpost: "snd_soc_acpi_codec_list" [sound/soc/amd/snd-acp-config.ko] undefined! Fix by adding a clear dependency on SND_SOC_ACPI Reported-by: kernel test robot Signed-off-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20211207192309.43883-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 6c7ac18cd82108a0cd58e21b9814503e631dbb5d Author: Shuming Fan Date: Wed Dec 8 18:16:54 2021 +0800 ASoC: dt-bindings: rt5682s: add AMIC delay time property Add the AMIC delay time to control how much delay time (ms) to unmute the stereo1 ADC. Signed-off-by: Shuming Fan Link: https://lore.kernel.org/r/20211208101654.28925-1-shumingf@realtek.com Signed-off-by: Mark Brown commit 77659872be233e56019041d05b44d134022296b7 Author: Yong Zhi Date: Tue Dec 7 13:24:58 2021 -0600 ASoC: Intel: sof_rt5682: Move rt1015 speaker amp to common file Move rt1015 driver code to common file to be consistent with rt1011 and rt1015p. No functional change. Reviewed-by: Bard Liao Signed-off-by: Yong Zhi Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20211207192458.44007-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 7cfa3d00730a4c0694b55fb1974823baeab8815b Author: Shuming Fan Date: Wed Dec 8 18:17:18 2021 +0800 ASoC: rt5682s: add delay time to fix pop sound issue There is a pop noise at the beginning of the capture data. This patch adds the delay time before stereo1 ADC unmute to fix the pop sound issue. Signed-off-by: Shuming Fan Link: https://lore.kernel.org/r/20211208101718.28945-1-shumingf@realtek.com Signed-off-by: Mark Brown commit 639cd58be7a4bfdf3514877b064b3308bb7800ba Author: Pierre-Louis Bossart Date: Tue Dec 7 15:17:00 2021 -0600 ASoC: Intel: boards: add 'static' qualifiers for max98390 routes Sparse warnings: sound/soc/intel/boards/sof_maxim_common.c:140:33: error: symbol 'max_98390_dapm_routes' was not declared. Should it be static? sound/soc/intel/boards/sof_maxim_common.c:156:33: error: symbol 'max_98390_tt_dapm_routes' was not declared. Should it be static? Fixes: f316c9d9ba8ea ('ASoC: Intel: boards: add max98390 2/4 speakers support') Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20211207211700.115319-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit b3111fe15df5e420f5251bad612fcf6915392c92 Author: Oleksij Rempel Date: Thu Nov 11 09:10:45 2021 +0100 ARM: dts: at91: add Microchip EVB-KSZ9477 board Add KSZ9477 managed switch evaluation kit with SAMA5D36 MPU: https://www.microchip.com/en-us/development-tool/evb-ksz9477 Signed-off-by: Oleksij Rempel Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20211111081045.711323-1-o.rempel@pengutronix.de commit 6d4518a086b2cce1f7935eb5a88a7f03e241f640 Author: Mihai Sain Date: Tue Oct 26 16:20:34 2021 +0300 ARM: dts: at91: sama5d2_xplained: remove PA11__SDMMC0_VDDSEL from pinctrl I/O voltage for eMMC is always 3.3V because PA11__SDMMC0_VDDSEL is tied with 10K resistor to GND. U13 switch S1 is always selected as voltage rail of 3.3V for VCCQ power pin from MPU controller and eMMC flash. Removing PA11 from pinctrl because it remains unused. Signed-off-by: Mihai Sain Reviewed-by: Eugen Hristev Signed-off-by: Eugen Hristev Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20211026132034.678655-1-eugen.hristev@microchip.com commit bb29e4091079dd7ef5bd488bd7625965cdfd2c12 Author: Wan Jiabing Date: Thu Oct 14 04:45:55 2021 -0400 ARM: at91: pm: Add of_node_put() before goto Fix following coccicheck warning: ./arch/arm/mach-at91/pm.c:643:1-33: WARNING: Function for_each_matching_node_and_match should have of_node_put() before goto Early exits from for_each_matching_node_and_match should decrement the node reference counter. Signed-off-by: Wan Jiabing Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20211014084555.21422-1-wanjiabing@vivo.com commit 0de4ab81ab26f09d4dbf8142a881b4607070d01f Author: Michal Vokáč Date: Mon Nov 22 17:25:20 2021 +0100 ARM: dts: imx6dl-yapp4: Add Y Soft IOTA Crux/Crux+ board Add devicetrees for the new boards in the Y Soft IOTA family. These boards are based on Orion but use Quad/QuadPlus SoC instead of DualLite. Signed-off-by: Michal Vokáč Signed-off-by: Shawn Guo commit 44d0dfee53ffff733de6baabea986e72af08f7bb Author: Joakim Zhang Date: Tue Nov 23 16:05:06 2021 +0800 arm64: dts: imx8mp: add mac address for EQOS Add mac address in efuse, so that EQOS driver can parse it from nvmem cell. Signed-off-by: Joakim Zhang Signed-off-by: Shawn Guo commit baf55c1509fec59a734a987b44e318c99610ce4f Author: Joakim Zhang Date: Tue Nov 23 16:05:05 2021 +0800 arm64: dts: imx8m: remove unused "nvmem_macaddr_swap" property for FEC Remove unused "nvmem_macaddr_swap" property for FEC, there is no info in both dt-binding and driver, so it's safe to remove it. Reviewed-by: Ahmad Fatoum Signed-off-by: Joakim Zhang Signed-off-by: Shawn Guo commit 311ad460c4fa3911cca36118b18feff233ae9e76 Author: Joakim Zhang Date: Tue Nov 23 16:05:04 2021 +0800 arm64: dts: imx8mp-evk: disable CLKOUT clock for ENET PHY According to commit 0a4355c2b7f8 ("net: phy: realtek: add dt property to disable CLKOUT clock"), diable CLKOUT clock for FEC PHY to save power on i.MX8MP EVK board. Signed-off-by: Joakim Zhang Signed-off-by: Shawn Guo commit 09e5ccdd866c35ac55e11a5fa3f818d6a471fe0f Author: Joakim Zhang Date: Tue Nov 23 16:05:03 2021 +0800 arm64: dts: imx8m: configure FEC PHY VDDIO voltage As commit 2f664823a470 ("net: phy: at803x: add device tree binding") described, configure FEC PHY VDDIO voltage according to board design. Signed-off-by: Joakim Zhang Signed-off-by: Shawn Guo commit 20b6559ecf5d49ee75ae519bf9da5ef3d2f02148 Author: Joakim Zhang Date: Tue Nov 23 16:05:02 2021 +0800 arm64: dts: imx8m: disable smart eee for FEC PHY As commit 390b4cad8148 ("net: phy: at803x: add support for configuring SmartEEE") described, disable PHY smart eee by default. Signed-off-by: Joakim Zhang Signed-off-by: Shawn Guo commit e0aa402b40a276ac2a02c005f62a12dcd9786aca Author: Joakim Zhang Date: Tue Nov 23 16:05:01 2021 +0800 arm64: dts: imx8mp-evk: add hardware reset for EQOS PHY As commit 798a1807ab13 ("arm64: dts: imx8mp-evk: Improve the Ethernet PHY description") described, add hardware reset for EQOS PHY. Signed-off-by: Joakim Zhang Signed-off-by: Shawn Guo commit 6133d84228895c28d2a706176f1fa45bcf39792d Author: Joakim Zhang Date: Tue Nov 23 16:05:00 2021 +0800 arm64: dts: imx8mn-evk: add hardware reset for FEC PHY Add hardware reset for FEC PHY. Signed-off-by: Joakim Zhang Reviewed-by: Ahmad Fatoum Signed-off-by: Shawn Guo commit 168e05c131cd15932f95364b103b8cb7dbf19546 Author: Rajan Vaja Date: Wed Oct 6 01:43:55 2021 -0700 firmware: xilinx: check return value of zynqmp_pm_get_api_version() Currently return value of zynqmp_pm_get_api_version() is ignored. Because of that, API version is checked in case of error also. So add check for return value of zynqmp_pm_get_api_version(). Signed-off-by: Rajan Vaja Reviewed-by: Michal Simek Link: https://lore.kernel.org/r/1633509835-31949-1-git-send-email-rajan.vaja@xilinx.com Signed-off-by: Michal Simek commit 628e8ba1d331397d580e65a61c0fb4b5ae8e5ccb Author: Michael Tretter Date: Wed Aug 25 17:03:13 2021 +0200 soc: xilinx: add a to_zynqmp_pm_domain macro Replace container_of for converting a generic_pm_domain to a zynqmp_pm_domain with a macro definition to simplify the code. Signed-off-by: Michael Tretter Acked-by: Michal Simek Acked-by: Rajan Vaja Link: https://lore.kernel.org/r/20210825150313.4033156-5-m.tretter@pengutronix.de Signed-off-by: Michal Simek commit e7a9106c32c0527735a01ae00d5d9edbdb573b40 Author: Michael Tretter Date: Wed Aug 25 17:03:12 2021 +0200 soc: xilinx: use a properly named field instead of flags Instead of defining a flags field and a single bit in this field to signal that a PM node has been requested, use a boolean field with a descriptive name. No functional change, but using a proper name instead of flags makes the code easier to read. Signed-off-by: Michael Tretter Acked-by: Michal Simek Acked-by: Rajan Vaja Link: https://lore.kernel.org/r/20210825150313.4033156-4-m.tretter@pengutronix.de Signed-off-by: Michal Simek commit c4245100f7461e0dd1f16ef0e0fcc19bcd826de3 Author: Michael Tretter Date: Wed Aug 25 17:03:11 2021 +0200 soc: xilinx: cleanup debug and error messages Use dev_err/dev_dbg instead of pr_err/pr_debug. Add the PM node ids to supplement the (arbitrary) power domain names to include information which PM nodes are requested by the driver. Drop function names from the messages, because they can easily be added with dynamic debug. Remove comments explaining that error messages are printed on errors. Signed-off-by: Michael Tretter Acked-by: Michal Simek Acked-by: Rajan Vaja Link: https://lore.kernel.org/r/20210825150313.4033156-3-m.tretter@pengutronix.de Signed-off-by: Michal Simek commit 7fd890b89dea55eb5866640eb8befad26d558161 Author: Michael Tretter Date: Wed Aug 25 17:03:10 2021 +0200 soc: xilinx: move PM_INIT_FINALIZE to zynqmp_pm_domains driver PM_INIT_FINALIZE tells the PMU FW that Linux is able to handle the power management nodes that are provided by the PMU FW. Nodes that are not requested are shut down after this call. Calling PM_INIT_FINALIZE from the zynqmp_power driver is wrong. The PM node request mechanism is implemented in the zynqmp_pm_domains driver, which must also call PM_INIT_FINALIZE. Due to the behavior of the PMU FW, all devices must be powered up before PM_INIT_FINALIZE is called, because otherwise the devices might misbehave. Calling PM_INIT_FINALIZE from the sync_state device callback ensures that all users probed successfully before the PMU FW is allowed to power off unused domains. Signed-off-by: Michael Tretter Acked-by: Michal Simek Acked-by: Rajan Vaja Link: https://lore.kernel.org/r/20210825150313.4033156-2-m.tretter@pengutronix.de Signed-off-by: Michal Simek commit f94909ceb1ed4bfdb2ada72f93236305e6d6951f Author: Peter Zijlstra Date: Sat Dec 4 14:43:40 2021 +0100 x86: Prepare asm files for straight-line-speculation Replace all ret/retq instructions with RET in preparation of making RET a macro. Since AS is case insensitive it's a big no-op without RET defined. find arch/x86/ -name \*.S | while read file do sed -i 's/\/RET/' $file done Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20211204134907.905503893@infradead.org commit 12f332d2dd3187472f595b678246adb10d886bd0 Author: Hari Prasath Date: Wed Dec 8 12:05:53 2021 +0530 ARM: dts: at91: update alternate function of signal PD20 The alternate function of PD20 is 4 as per the datasheet of sama7g5 and not 5 as defined earlier. Signed-off-by: Hari Prasath Fixes: 7540629e2fc7 ("ARM: dts: at91: add sama7g5 SoC DT and sama7g5-ek") Cc: # v5.15+ Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20211208063553.19807-1-Hari.PrasathGE@microchip.com commit 1e56279a49168f24b2b58e843ae92976f90a98a6 Author: Smita Koralahalli Date: Thu Nov 4 16:58:42 2021 -0500 x86/mce/inject: Set the valid bit in MCA_STATUS before error injection MCA handlers check the valid bit in each status register (MCA_STATUS[Val]) and continue processing the error only if the valid bit is set. Set the valid bit unconditionally in the corresponding MCA_STATUS register and correct any Val=0 injections made by the user as such errors will get ignored and such injections will be largely pointless. Signed-off-by: Smita Koralahalli Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20211104215846.254012-3-Smita.KoralahalliChannabasappa@amd.com commit e48d008bd13eaa9068ff59c65275d17516179f7b Author: Smita Koralahalli Date: Thu Nov 4 16:58:41 2021 -0500 x86/mce/inject: Check if a bank is populated before injecting The MCA_IPID register uniquely identifies a bank's type on Scalable MCA (SMCA) systems. When an MCA bank is not populated, the MCA_IPID register will read as zero and writes to it will be ignored. On a hw-type error injection (injection which writes the actual MCA registers in an attempt to cause a real MCE) check the value of this register before trying to inject the error. Do not impose any limitations on a sw injection and allow the user to test out all the decoding paths without relying on the available hardware, as its purpose is to just test the code. [ bp: Heavily massage. ] Link: https://lkml.kernel.org/r/20211019233641.140275-2-Smita.KoralahalliChannabasappa@amd.com Signed-off-by: Smita Koralahalli Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20211104215846.254012-2-Smita.KoralahalliChannabasappa@amd.com commit 22da5a07c75e1104caf6a42f189c97b83d070073 Author: Peter Zijlstra Date: Sat Dec 4 14:43:39 2021 +0100 x86/lib/atomic64_386_32: Rename things Principally, in order to get rid of #define RET in this code to make place for a new RET, but also to clarify the code, rename a bunch of things: s/UNLOCK/IRQ_RESTORE/ s/LOCK/IRQ_SAVE/ s/BEGIN/BEGIN_IRQ_SAVE/ s/\/RET_IRQ_RESTORE/ s/RET_ENDP/\tRET_IRQ_RESTORE\rENDP/ which then leaves RET unused so it can be removed. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20211204134907.841623970@infradead.org commit 68cf4f2a72ef8786e6b7af6fd9a89f27ac0f520d Author: Peter Zijlstra Date: Fri Nov 19 17:50:25 2021 +0100 x86: Use -mindirect-branch-cs-prefix for RETPOLINE builds In order to further enable commit: bbe2df3f6b6d ("x86/alternative: Try inline spectre_v2=retpoline,amd") add the new GCC flag -mindirect-branch-cs-prefix: https://gcc.gnu.org/g:2196a681d7810ad8b227bf983f38ba716620545e https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102952 https://bugs.llvm.org/show_bug.cgi?id=52323 to RETPOLINE=y builds. This should allow fully inlining retpoline,amd for GCC builds. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Kees Cook Acked-by: Nick Desaulniers Link: https://lkml.kernel.org/r/20211119165630.276205624@infradead.org commit b2f825bfeda884f9d40386cc7d089d023017d2dd Author: Peter Zijlstra Date: Fri Nov 19 17:50:24 2021 +0100 x86: Move RETPOLINE*_CFLAGS to arch Makefile Currently, RETPOLINE*_CFLAGS are defined in the top-level Makefile but only x86 makes use of them. Move them there. If ever another architecture finds the need, it can be reconsidered. [ bp: Massage a bit. ] Suggested-by: Nick Desaulniers Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Kees Cook Reviewed-by: Nick Desaulniers Link: https://lkml.kernel.org/r/20211119165630.219152765@infradead.org commit 93b350f884c451d3cb75e6e3814266cf2d2afab1 Merge: adbfb12d4c451 250552b925ce4 Author: Paolo Bonzini Date: Wed Dec 8 05:29:16 2021 -0500 Merge branch 'kvm-on-hv-msrbm-fix' into HEAD Merge bugfix for enlightened MSR Bitmap, before adding support to KVM for exposing the feature to nested guests. commit 3411506550b1f714a52b5db087666c08658d2698 Author: Eric Dumazet Date: Fri Nov 12 08:19:50 2021 -0800 x86/csum: Rewrite/optimize csum_partial() With more NICs supporting CHECKSUM_COMPLETE, and IPv6 being widely used csum_partial() is heavily used with small amount of bytes, and is consuming many cycles. IPv6 header size, for instance, is 40 bytes. Another thing to consider is that NET_IP_ALIGN is 0 on x86, meaning that network headers are not word-aligned, unless the driver forces this. This means that csum_partial() fetches one u16 to 'align the buffer', then performs three u64 additions with carry in a loop, then a remaining u32, then a remaining u16. With this new version, it performs a loop only for the 64 bytes blocks, then the remaining is bisected. Testing on various CPUs, all of them show a big reduction in csum_partial() cost (by 50 to 80 %) Before: 4.16% [kernel] [k] csum_partial After: 0.83% [kernel] [k] csum_partial If run in a loop 1,000,000 times: Before: 26,922,913 cycles # 3846130.429 GHz 80,302,961 instructions # 2.98 insn per cycle 21,059,816 branches # 3008545142.857 M/sec 2,896 branch-misses # 0.01% of all branches After: 17,960,709 cycles # 3592141.800 GHz 41,292,805 instructions # 2.30 insn per cycle 11,058,119 branches # 2211623800.000 M/sec 2,997 branch-misses # 0.03% of all branches [ bp: Massage, merge in subsequent fixes into a single patch: - um compilation error due to missing load_unaligned_zeropad(): - Reported-by: kernel test robot - Link: https://lkml.kernel.org/r/20211118175239.1525650-1-eric.dumazet@gmail.com - Fix initial seed for odd buffers - Reported-by: Noah Goldstein - Link: https://lkml.kernel.org/r/20211125141817.3541501-1-eric.dumazet@gmail.com ] Signed-off-by: Eric Dumazet Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Alexander Duyck Link: https://lore.kernel.org/r/20211112161950.528886-1-eric.dumazet@gmail.com commit 97c8ef443ae1f6493c02d6f433eb5a2b72d8b438 Author: Matthew Auld Date: Mon Dec 6 11:25:39 2021 +0000 drm/i915/selftests: handle object rounding Ensure we account for any object rounding due to min_page_size restrictions. Signed-off-by: Matthew Auld Cc: Thomas Hellström Cc: Ramalingam C Reviewed-by: Ramalingam C Link: https://patchwork.freedesktop.org/patch/msgid/20211206112539.3149779-4-matthew.auld@intel.com commit 31d70749bfe110593fbe8bf45e7c7788c7d85035 Author: Matthew Auld Date: Mon Dec 6 11:25:38 2021 +0000 drm/i915/migrate: fix length calculation No need to insert PTEs for the PTE window itself, also foreach expects a length not an end offset, which could be gigantic here with a second engine. Signed-off-by: Matthew Auld Cc: Thomas Hellström Cc: Ramalingam C Reviewed-by: Ramalingam C Link: https://patchwork.freedesktop.org/patch/msgid/20211206112539.3149779-3-matthew.auld@intel.com commit 08c7c122ad90799cc3ae674e7f29f236f91063ce Author: Matthew Auld Date: Mon Dec 6 11:25:37 2021 +0000 drm/i915/migrate: fix offset calculation Ensure we add the engine base only after we calculate the qword offset into the PTE window. Signed-off-by: Matthew Auld Cc: Thomas Hellström Cc: Ramalingam C Reviewed-by: Ramalingam C Link: https://patchwork.freedesktop.org/patch/msgid/20211206112539.3149779-2-matthew.auld@intel.com commit 8eb7fcce34d16f77ac8efa80e8dfecec2503e8c5 Author: Matthew Auld Date: Mon Dec 6 11:25:36 2021 +0000 drm/i915/migrate: don't check the scratch page The scratch page might not be allocated in LMEM(like on DG2), so instead of using that as the deciding factor for where the paging structures live, let's just query the pt before mapping it. Signed-off-by: Matthew Auld Cc: Thomas Hellström Cc: Ramalingam C Reviewed-by: Ramalingam C Link: https://patchwork.freedesktop.org/patch/msgid/20211206112539.3149779-1-matthew.auld@intel.com commit adbfb12d4c4517a8adde23a7fc46538953d56eea Author: Hou Wenlong Date: Tue Nov 2 17:15:32 2021 +0800 KVM: x86: Exit to userspace if emulation prepared a completion callback em_rdmsr() and em_wrmsr() return X86EMUL_IO_NEEDED if MSR accesses required an exit to userspace. However, x86_emulate_insn() doesn't return X86EMUL_*, so x86_emulate_instruction() doesn't directly act on X86EMUL_IO_NEEDED; instead, it looks for other signals to differentiate between PIO, MMIO, etc. causing RDMSR/WRMSR emulation not to exit to userspace now. Nevertheless, if the userspace_msr_exit_test testcase in selftests is changed to test RDMSR/WRMSR with a forced emulation prefix, the test passes. What happens is that first userspace exit information is filled but the userspace exit does not happen. Because x86_emulate_instruction() returns 1, the guest retries the instruction---but this time RIP has already been adjusted past the forced emulation prefix, so the guest executes RDMSR/WRMSR and the userspace exit finally happens. Since the X86EMUL_IO_NEEDED path has provided a complete_userspace_io callback, x86_emulate_instruction() can just return 0 if the callback is not NULL. Then RDMSR/WRMSR instruction emulation will exit to userspace directly, without the RDMSR/WRMSR vmexit. Fixes: 1ae099540e8c7 ("KVM: x86: Allow deflecting unknown MSR accesses to user space") Signed-off-by: Hou Wenlong Signed-off-by: Paolo Bonzini Message-Id: <56f9df2ee5c05a81155e2be366c9dc1f7adc8817.1635842679.git.houwenlong93@linux.alibaba.com> commit fea783e6e82c9f3713aea425eddcac9611c069ee Author: Andy Shevchenko Date: Tue Dec 7 17:41:43 2021 +0200 thunderbolt: Do not dereference fwnode in struct device In order to make the underneath API easier to change in the future, prevent users from dereferencing fwnode from struct device. Instead, use the specific dev_fwnode() API for that. Signed-off-by: Andy Shevchenko Signed-off-by: Mika Westerberg commit 5ad5915dea0047a6376d8f809ea3470ef68b1f92 Author: Horatiu Vultur Date: Wed Nov 3 09:51:02 2021 +0100 clk: lan966x: Extend lan966x clock driver for clock gating support Extend the clock driver to add support also for clock gating. The following peripherals can be gated: UHPHS, UDPHS, MCRAMC, HMATRIX. Signed-off-by: Horatiu Vultur Acked-by: Nicolas Ferre Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20211103085102.1656081-5-horatiu.vultur@microchip.com commit 51d0a37dde9b63111d14a59bb77c5cf0273e4c9e Author: Horatiu Vultur Date: Wed Nov 3 09:51:01 2021 +0100 dt-bindings: clock: lan966x: Extend includes with clock gates On lan966x it is allow to control the clock to some peripherals like USB. So extend the include file with these clocks. Acked-by: Rob Herring Signed-off-by: Horatiu Vultur Acked-by: Nicolas Ferre Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20211103085102.1656081-4-horatiu.vultur@microchip.com commit 6b9f984cc86e6835880f1466faf6d60e5c51920e Author: Horatiu Vultur Date: Wed Nov 3 09:51:00 2021 +0100 dt-bindings: clock: lan966x: Extend for clock gate support Allow to add an optional resource to be able to access the clock gate registers. Signed-off-by: Horatiu Vultur Acked-by: Rob Herring Acked-by: Nicolas Ferre Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20211103085102.1656081-3-horatiu.vultur@microchip.com commit 815f0e738a8d5663a02350e2580706829144a722 Author: Horatiu Vultur Date: Wed Nov 3 09:50:59 2021 +0100 clk: gate: Add devm_clk_hw_register_gate() Add devm_clk_hw_register_gate() - devres-managed version of clk_hw_register_gate() Suggested-by: Stephen Boyd Signed-off-by: Horatiu Vultur Acked-by: Nicolas Ferre Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20211103085102.1656081-2-horatiu.vultur@microchip.com commit 54104ee023333e3bd8062ff1cbc312ea4c5bf733 Author: Kavyasree Kotagiri Date: Wed Nov 3 11:49:35 2021 +0530 clk: lan966x: Add lan966x SoC clock driver This adds Generic Clock Controller driver for lan966x SoC. Lan966x clock controller contains 3 PLLs - cpu_clk, ddr_clk and sys_clk. It generates and supplies clock to various peripherals within SoC. Register settings required to provide GCK clocking to a peripheral is as below: GCK_SRC_SEL = Select clock source. GCK_PRESCALER = Set divider value. GCK_ENA = 1 - Enable GCK clock. Signed-off-by: Kavyasree Kotagiri Co-developed-by: Horatiu Vultur Signed-off-by: Horatiu Vultur Acked-by: Nicolas Ferre Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20211103061935.25677-4-kavyasree.kotagiri@microchip.com commit 07300ef47a3f6a1c67753c91466dfc30c0cead7c Author: Kavyasree Kotagiri Date: Wed Nov 3 11:49:34 2021 +0530 dt-bindings: clock: lan966x: Add LAN966X Clock Controller This adds the DT bindings documentation for lan966x SoC generic clock controller. Signed-off-by: Kavyasree Kotagiri Reviewed-by: Rob Herring Acked-by: Nicolas Ferre Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20211103061935.25677-3-kavyasree.kotagiri@microchip.com commit 265d27caf95f8959ddd4a33e52c4b4dc4e31c308 Author: Kavyasree Kotagiri Date: Wed Nov 3 11:49:33 2021 +0530 dt-bindings: clock: lan966x: Add binding includes for lan966x SoC clock IDs LAN966X supports 14 clock outputs for its peripherals. This include file is introduced to use identifiers for clocks. Signed-off-by: Kavyasree Kotagiri Acked-by: Rob Herring Acked-by: Nicolas Ferre Signed-off-by: Nicolas Ferre Link: https://lore.kernel.org/r/20211103061935.25677-2-kavyasree.kotagiri@microchip.com commit d2f7d49826ae62b8b5c9829292e84861d2bda2b6 Author: Hou Wenlong Date: Tue Nov 2 17:15:31 2021 +0800 KVM: x86: Use different callback if msr access comes from the emulator If msr access triggers an exit to userspace, the complete_userspace_io callback would skip instruction by vendor callback for kvm_skip_emulated_instruction(). However, when msr access comes from the emulator, e.g. if kvm.force_emulation_prefix is enabled and the guest uses rdmsr/wrmsr with kvm prefix, VM_EXIT_INSTRUCTION_LEN in vmcs is invalid and kvm_emulate_instruction() should be used to skip instruction instead. As Sean noted, unlike the previous case, there's no #UD if unrestricted guest is disabled and the guest accesses an MSR in Big RM. So the correct way to fix this is to attach a different callback when the msr access comes from the emulator. Suggested-by: Sean Christopherson Signed-off-by: Hou Wenlong Signed-off-by: Paolo Bonzini Message-Id: <34208da8f51580a06e45afefac95afea0e3f96e3.1635842679.git.houwenlong93@linux.alibaba.com> commit 906fa90416fdb703467926ca4f6f55438cd7ea82 Author: Hou Wenlong Date: Tue Nov 2 17:15:30 2021 +0800 KVM: x86: Add an emulation type to handle completion of user exits The next patch would use kvm_emulate_instruction() with EMULTYPE_SKIP in complete_userspace_io callback to fix a problem in msr access emulation. However, EMULTYPE_SKIP only updates RIP, more things like updating interruptibility state and injecting single-step #DBs would be done in the callback. Since the emulator also does those things after x86_emulate_insn(), add a new emulation type to pair with EMULTYPE_SKIP to do those things for completion of user exits within the emulator. Suggested-by: Sean Christopherson Signed-off-by: Hou Wenlong Signed-off-by: Paolo Bonzini Message-Id: <8f8c8e268b65f31d55c2881a4b30670946ecfa0d.1635842679.git.houwenlong93@linux.alibaba.com> commit 5e854864ee4384736f27a986633bae21731a4e4e Author: Sean Christopherson Date: Tue Nov 2 17:15:29 2021 +0800 KVM: x86: Handle 32-bit wrap of EIP for EMULTYPE_SKIP with flat code seg Truncate the new EIP to a 32-bit value when handling EMULTYPE_SKIP as the decode phase does not truncate _eip. Wrapping the 32-bit boundary is legal if and only if CS is a flat code segment, but that check is implicitly handled in the form of limit checks in the decode phase. Opportunstically prepare for a future fix by storing the result of any truncation in "eip" instead of "_eip". Fixes: 1957aa63be53 ("KVM: VMX: Handle single-step #DB for EMULTYPE_SKIP on EPT misconfig") Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini Message-Id: <093eabb1eab2965201c9b018373baf26ff256d85.1635842679.git.houwenlong93@linux.alibaba.com> commit 51b1209c6125273c345aee6767ffaccb765e5e36 Author: Li RongQing Date: Thu Nov 4 19:56:14 2021 +0800 KVM: Clear pv eoi pending bit only when it is set merge pv_eoi_get_pending and pv_eoi_clr_pending into a single function pv_eoi_test_and_clear_pending, which returns and clear the value of the pending bit. This makes it possible to clear the pending bit only if the guest had set it, and otherwise skip the call to pv_eoi_put_user(). This can save up to 300 nsec on AMD EPYC processors. Suggested-by: Vitaly Kuznetsov Suggested-by: Paolo Bonzini Signed-off-by: Li RongQing Message-Id: <1636026974-50555-2-git-send-email-lirongqing@baidu.com> Reviewed-by: Vitaly Kuznetsov Signed-off-by: Paolo Bonzini commit ce5977b181c1613072eafbc7546bcb6c463ea68c Author: Li RongQing Date: Thu Nov 4 19:56:13 2021 +0800 KVM: x86: don't print when fail to read/write pv eoi memory If guest gives MSR_KVM_PV_EOI_EN a wrong value, this printk() will be trigged, and kernel log is spammed with the useless message Fixes: 0d88800d5472 ("kvm: x86: ioapic and apic debug macros cleanup") Reported-by: Vitaly Kuznetsov Reviewed-by: Vitaly Kuznetsov Signed-off-by: Li RongQing Cc: stable@kernel.org Message-Id: <1636026974-50555-1-git-send-email-lirongqing@baidu.com> Signed-off-by: Paolo Bonzini commit 2df4a5eb6c5a7aab471dc0b279efe0e49194ce77 Author: Lai Jiangshan Date: Wed Nov 24 20:20:52 2021 +0800 KVM: X86: Remove mmu parameter from load_pdptrs() It uses vcpu->arch.walk_mmu always; nested EPT does not have PDPTRs, and nested NPT treats them like all other non-leaf page table levels instead of caching them. Signed-off-by: Lai Jiangshan Message-Id: <20211124122055.64424-11-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini commit bb3b394d35e80d7a58ce015191e4960a13f54ba5 Author: Lai Jiangshan Date: Wed Nov 24 20:20:51 2021 +0800 KVM: X86: Rename gpte_is_8_bytes to has_4_byte_gpte and invert the direction This bit is very close to mean "role.quadrant is not in use", except that it is false also when the MMU is mapping guest physical addresses directly. In that case, role.quadrant is indeed not in use, but there are no guest PTEs at all. Changing the name and direction of the bit removes the special case, since a guest with paging disabled, or not considering guest paging structures as is the case for two-dimensional paging, does not have to deal with 4-byte guest PTEs. Suggested-by: Paolo Bonzini Signed-off-by: Lai Jiangshan Message-Id: <20211124122055.64424-10-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini commit f8cd457f061d3ca79518f9061c4205590348a0a1 Author: Lai Jiangshan Date: Wed Nov 24 20:20:50 2021 +0800 KVM: VMX: Use ept_caps_to_lpage_level() in hardware_setup() Using ept_caps_to_lpage_level is simpler. Signed-off-by: Lai Jiangshan Message-Id: <20211124122055.64424-9-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini commit cc022ae144c1ce318643f821461295337280a1c0 Author: Lai Jiangshan Date: Wed Nov 24 20:20:49 2021 +0800 KVM: X86: Add parameter huge_page_level to kvm_init_shadow_ept_mmu() The level of supported large page on nEPT affects the rsvds_bits_mask. Signed-off-by: Lai Jiangshan Message-Id: <20211124122055.64424-8-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini commit 84ea5c09a66d19eff2eaebffafa667e6bf9a7905 Author: Lai Jiangshan Date: Wed Nov 24 20:20:48 2021 +0800 KVM: X86: Add huge_page_level to __reset_rsvds_bits_mask_ept() Bit 7 on pte depends on the level of supported large page. Signed-off-by: Lai Jiangshan Message-Id: <20211124122055.64424-7-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini commit c59a0f57fa32cfa77643daa17a8e55377cc9fe0b Author: Lai Jiangshan Date: Wed Nov 24 20:20:45 2021 +0800 KVM: X86: Remove mmu->translate_gpa Reduce an indirect function call (retpoline) and some intialization code. Signed-off-by: Lai Jiangshan Message-Id: <20211124122055.64424-4-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini commit 1f5a21ee8400ccc82c67dc8c153301f694a04099 Author: Lai Jiangshan Date: Wed Nov 24 20:20:44 2021 +0800 KVM: X86: Add parameter struct kvm_mmu *mmu into mmu->gva_to_gpa() The mmu->gva_to_gpa() has no "struct kvm_mmu *mmu", so an extra FNAME(gva_to_gpa_nested) is needed. Add the parameter can simplify the code. And it makes it explicit that the walk is upon vcpu->arch.walk_mmu for gva and vcpu->arch.mmu for L2 gpa in translate_nested_gpa() via the new parameter. Signed-off-by: Lai Jiangshan Message-Id: <20211124122055.64424-3-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini commit b46a13cb7ea1137b2e01dfaafcacd5cd79db8390 Author: Lai Jiangshan Date: Thu Nov 18 19:08:13 2021 +0800 KVM: X86: Calculate quadrant when !role.gpte_is_8_bytes role.quadrant is only valid when gpte size is 4 bytes and only be calculated when gpte size is 4 bytes. Although "vcpu->arch.mmu->root_level <= PT32_ROOT_LEVEL" also means gpte size is 4 bytes, but using "!role.gpte_is_8_bytes" is clearer Signed-off-by: Lai Jiangshan Message-Id: <20211118110814.2568-15-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini commit 41e35604eaff2266ba8523787ebe99c5ca4c4045 Author: Lai Jiangshan Date: Thu Nov 18 19:08:12 2021 +0800 KVM: X86: Remove useless code to set role.gpte_is_8_bytes when role.direct role.gpte_is_8_bytes is unused when role.direct; there is no point in changing a bit in the role, the value that was set when the MMU is initialized is just fine. Signed-off-by: Lai Jiangshan Message-Id: <20211118110814.2568-14-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini commit 42f34c20a11333d031560bbb17d5e13e3bfcd44b Author: Lai Jiangshan Date: Thu Nov 18 19:08:11 2021 +0800 KVM: X86: Remove unused declaration of __kvm_mmu_free_some_pages() The body of __kvm_mmu_free_some_pages() has been removed. Signed-off-by: Lai Jiangshan Message-Id: <20211118110814.2568-13-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini commit 84432316cd9aec6923bb3368e86d8f6166b60067 Author: Lai Jiangshan Date: Thu Nov 18 19:08:10 2021 +0800 KVM: X86: Fix comment in __kvm_mmu_create() The allocation of special roots is moved to mmu_alloc_special_roots(). Signed-off-by: Lai Jiangshan Message-Id: <20211118110814.2568-12-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini commit 27f4fca29f9cfd740dcb7b2bc577bcfd02ae367d Author: Lai Jiangshan Date: Thu Nov 18 19:08:09 2021 +0800 KVM: X86: Skip allocating pae_root for vcpu->arch.guest_mmu when !tdp_enabled It is never used. Signed-off-by: Lai Jiangshan Message-Id: <20211118110814.2568-11-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini commit 58356767107a6b02c9277810809aca8a36c473d7 Author: Lai Jiangshan Date: Thu Nov 18 19:08:08 2021 +0800 KVM: SVM: Allocate sd->save_area with __GFP_ZERO And remove clear_page() on it. Signed-off-by: Lai Jiangshan Message-Id: <20211118110814.2568-10-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini commit 1af4a1199a41f80b4a792ae76d4c79a01d0b5d41 Author: Lai Jiangshan Date: Thu Nov 18 19:08:07 2021 +0800 KVM: SVM: Rename get_max_npt_level() to get_npt_level() It returns the only proper NPT level, so the "max" in the name is not appropriate. Signed-off-by: Lai Jiangshan Message-Id: <20211118110814.2568-9-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini commit fe26f91d30fb129a56f68a880a03ad49d127c07a Author: Lai Jiangshan Date: Thu Nov 18 19:08:06 2021 +0800 KVM: VMX: Change comments about vmx_get_msr() The variable name is changed in the code. Signed-off-by: Lai Jiangshan Message-Id: <20211118110814.2568-8-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini commit ed07ef5a66e486215bf3f51037c44d10fc9a5a1c Author: Lai Jiangshan Date: Thu Nov 18 19:08:05 2021 +0800 KVM: VMX: Use kvm_set_msr_common() for MSR_IA32_TSC_ADJUST in the default way MSR_IA32_TSC_ADJUST can be left to the default way which also uese kvm_set_msr_common(). Signed-off-by: Lai Jiangshan Message-Id: <20211118110814.2568-7-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini commit 15ad9762d69fd8e40a4a51828c1d6b0c1b8fbea0 Author: Lai Jiangshan Date: Thu Nov 18 19:08:03 2021 +0800 KVM: VMX: Save HOST_CR3 in vmx_prepare_switch_to_guest() The host CR3 in the vcpu thread can only be changed when scheduling. Moving the code in vmx_prepare_switch_to_guest() makes the code simpler. Signed-off-by: Lai Jiangshan Message-Id: <20211118110814.2568-5-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini commit 3ab4ac877cfabd209d12cbd6af0aa02077bb778d Author: Lai Jiangshan Date: Thu Nov 18 19:08:02 2021 +0800 KVM: VMX: Update msr value after kvm_set_user_return_msr() succeeds Aoid earlier modification. Signed-off-by: Lai Jiangshan Message-Id: <20211118110814.2568-4-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini commit 6ab8a4053f7114d130fe1f3485d71efec20f5806 Author: Lai Jiangshan Date: Thu Nov 18 19:08:01 2021 +0800 KVM: VMX: Avoid to rdmsrl(MSR_IA32_SYSENTER_ESP) The value of host MSR_IA32_SYSENTER_ESP is known to be constant for each CPU: (cpu_entry_stack(cpu) + 1) when 32 bit syscall is enabled or NULL is 32 bit syscall is not enabled. So rdmsrl() can be avoided for the first case and both rdmsrl() and vmcs_writel() can be avoided for the second case. Signed-off-by: Lai Jiangshan Message-Id: <20211118110814.2568-3-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini commit 24cd19a28cb7174df502162641d6e1e12e7ffbd9 Author: Lai Jiangshan Date: Thu Nov 11 22:45:26 2021 +0800 KVM: X86: Update mmu->pdptrs only when it is changed It is unchanged in most cases. Signed-off-by: Lai Jiangshan Message-Id: <20211111144527.88852-1-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini commit 2e9ebd55096f70b76c2a5edf93903c8c2f778a9f Author: Lai Jiangshan Date: Mon Nov 8 20:44:06 2021 +0800 KVM: X86: Remove kvm_register_clear_available() It has no user. Signed-off-by: Lai Jiangshan Message-Id: <20211108124407.12187-15-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini commit 41e68b6964ebf20082af55ad1394523cf86c4c6a Author: Paolo Bonzini Date: Fri Nov 26 07:00:15 2021 -0500 KVM: vmx, svm: clean up mass updates to regs_avail/regs_dirty bits Document the meaning of the three combinations of regs_avail and regs_dirty. Update regs_dirty just after writeback instead of doing it later after vmexit. After vmexit, instead, we clear the regs_avail bits corresponding to lazily-loaded registers. Signed-off-by: Paolo Bonzini commit c62c7bd4f95b8f2a28098c4139a369670998aef2 Author: Lai Jiangshan Date: Mon Nov 8 20:44:03 2021 +0800 KVM: VMX: Update vmcs.GUEST_CR3 only when the guest CR3 is dirty When vcpu->arch.cr3 is changed, it is marked dirty, so vmcs.GUEST_CR3 can be updated only when kvm_register_is_dirty(vcpu, VCPU_EXREG_CR3). Signed-off-by: Lai Jiangshan Message-Id: <20211108124407.12187-12-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini commit 3883bc9d28ed348d419d2e405d11f0924783f721 Author: Lai Jiangshan Date: Mon Nov 8 20:44:02 2021 +0800 KVM: X86: Mark CR3 dirty when vcpu->arch.cr3 is changed When vcpu->arch.cr3 is changed, it should be marked dirty unless it is being updated to the value of the architecture guest CR3 (i.e. VMX.GUEST_CR3 or vmcb->save.cr3 when tdp is enabled). This patch has no functionality changed because kvm_register_mark_dirty(vcpu, VCPU_EXREG_CR3) is superset of kvm_register_mark_available(vcpu, VCPU_EXREG_CR3) with additional change to vcpu->arch.regs_dirty, but no code uses regs_dirty for VCPU_EXREG_CR3. (vmx_load_mmu_pgd() uses vcpu->arch.regs_avail instead to test if VCPU_EXREG_CR3 dirty which means current code (ab)uses regs_avail for VCPU_EXREG_CR3 dirty information.) Signed-off-by: Lai Jiangshan Message-Id: <20211108124407.12187-11-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini commit aec9c2402f74b898ad637a97360bfc001fb711e6 Author: Lai Jiangshan Date: Mon Nov 8 20:44:00 2021 +0800 KVM: SVM: Remove references to VCPU_EXREG_CR3 VCPU_EXREG_CR3 is never cleared from vcpu->arch.regs_avail or vcpu->arch.regs_dirty in SVM; therefore, marking CR3 as available is merely a NOP, and testing it will likewise always succeed. Signed-off-by: Lai Jiangshan Message-Id: <20211108124407.12187-9-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini commit 8f29bf12a37807aa0a544485ab3a853481786203 Author: Lai Jiangshan Date: Mon Nov 8 20:43:59 2021 +0800 KVM: SVM: Remove outdated comment in svm_load_mmu_pgd() The comment had been added in the commit 689f3bf21628 ("KVM: x86: unify callbacks to load paging root") and its related code was removed later, and it has nothing to do with the next line of code. So the comment should be removed too. Signed-off-by: Lai Jiangshan Message-Id: <20211108124407.12187-8-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini commit e63f315d74eeeb6ddf9096223d898730494da6f4 Author: Lai Jiangshan Date: Mon Nov 8 20:43:58 2021 +0800 KVM: X86: Move CR0 pdptr_bits into header file as X86_CR0_PDPTR_BITS Not functionality changed. Signed-off-by: Lai Jiangshan Message-Id: <20211108124407.12187-7-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini commit a37ebdce168f57732ff2917a685980fc21133417 Author: Lai Jiangshan Date: Mon Nov 8 20:43:57 2021 +0800 KVM: VMX: Add and use X86_CR4_PDPTR_BITS when !enable_ept In set_cr4_guest_host_mask(), all cr4 pdptr bits are already set to be intercepted in an unclear way. Add X86_CR4_PDPTR_BITS to make it clear and self-documented. No functionality changed. Signed-off-by: Lai Jiangshan Message-Id: <20211108124407.12187-6-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini commit 5ec60aad547f716530ad308266eeab378a4e287c Author: Lai Jiangshan Date: Mon Nov 8 20:43:56 2021 +0800 KVM: VMX: Add and use X86_CR4_TLBFLUSH_BITS when !enable_ept In set_cr4_guest_host_mask(), X86_CR4_PGE is set to be intercepted when !enable_ept just because X86_CR4_PGE is the only bit that is responsible for flushing TLB but listed in KVM_POSSIBLE_CR4_GUEST_BITS. It is clearer and self-documented to use X86_CR4_TLBFLUSH_BITS instead. No functionality changed. Signed-off-by: Lai Jiangshan Message-Id: <20211108124407.12187-5-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini commit 40e49c4f5fb0699b4b5b5b1ee0a1bc88b4fec00d Author: Lai Jiangshan Date: Mon Nov 8 20:43:55 2021 +0800 KVM: SVM: Track dirtiness of PDPTRs even if NPT is disabled Use the same logic to handle the availability of VCPU_EXREG_PDPTR as VMX, also removing a branch in svm_vcpu_run(). Signed-off-by: Lai Jiangshan Message-Id: <20211108124407.12187-4-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini commit c0d6956e43054e397f4f661d0a62d490278ddef9 Author: Lai Jiangshan Date: Mon Nov 8 20:43:54 2021 +0800 KVM: VMX: Mark VCPU_EXREG_PDPTR available in ept_save_pdptrs() mmu->pdptrs[] and vmcs.GUEST_PDPTR[0-3] are synced, so mmu->pdptrs is available and GUEST_PDPTR[0-3] is not dirty. Signed-off-by: Lai Jiangshan Message-Id: <20211108124407.12187-3-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini commit 2c5653caecc4807b8abfe9c41880ac38417be7bf Author: Lai Jiangshan Date: Mon Nov 8 20:43:53 2021 +0800 KVM: X86: Ensure that dirty PDPTRs are loaded For VMX with EPT, dirty PDPTRs need to be loaded before the next vmentry via vmx_load_mmu_pgd() But not all paths that call load_pdptrs() will cause vmx_load_mmu_pgd() to be invoked. Normally, kvm_mmu_reset_context() is used to cause KVM_REQ_LOAD_MMU_PGD, but sometimes it is skipped: * commit d81135a57aa6("KVM: x86: do not reset mmu if CR0.CD and CR0.NW are changed") skips kvm_mmu_reset_context() after load_pdptrs() when changing CR0.CD and CR0.NW. * commit 21823fbda552("KVM: x86: Invalidate all PGDs for the current PCID on MOV CR3 w/ flush") skips KVM_REQ_LOAD_MMU_PGD after load_pdptrs() when rewriting the CR3 with the same value. * commit a91a7c709600("KVM: X86: Don't reset mmu context when toggling X86_CR4_PGE") skips kvm_mmu_reset_context() after load_pdptrs() when changing CR4.PGE. Fixes: d81135a57aa6 ("KVM: x86: do not reset mmu if CR0.CD and CR0.NW are changed") Fixes: 21823fbda552 ("KVM: x86: Invalidate all PGDs for the current PCID on MOV CR3 w/ flush") Fixes: a91a7c709600 ("KVM: X86: Don't reset mmu context when toggling X86_CR4_PGE") Signed-off-by: Lai Jiangshan Message-Id: <20211108124407.12187-2-jiangshanlai@gmail.com> Signed-off-by: Paolo Bonzini commit b1d66dad65dcc8a6e5942db27027a086aa4f5c16 Author: Like Xu Date: Wed Nov 17 16:03:04 2021 +0800 KVM: x86/svm: Add module param to control PMU virtualization For Intel, the guest PMU can be disabled via clearing the PMU CPUID. For AMD, all hw implementations support the base set of four performance counters, with current mainstream hardware indicating the presence of two additional counters via X86_FEATURE_PERFCTR_CORE. In the virtualized world, the AMD guest driver may detect the presence of at least one counter MSR. Most hypervisor vendors would introduce a module param (like lbrv for svm) to disable PMU for all guests. Another control proposal per-VM is to pass PMU disable information via MSR_IA32_PERF_CAPABILITIES or one bit in CPUID Fn4000_00[FF:00]. Both of methods require some guest-side changes, so a module parameter may not be sufficiently granular, but practical enough. Signed-off-by: Like Xu Message-Id: <20211117080304.38989-1-likexu@tencent.com> Signed-off-by: Paolo Bonzini commit baed82c8e4893a3258267dad198e04691d2f7c09 Author: Sean Christopherson Date: Fri Oct 8 19:12:21 2021 -0700 KVM: VMX: Remove vCPU from PI wakeup list before updating PID.NV Remove the vCPU from the wakeup list before updating the notification vector in the posted interrupt post-block helper. There is no need to wake the current vCPU as it is by definition not blocking. Practically speaking this is a nop as it only shaves a few meager cycles in the unlikely case that the vCPU was migrated and the previous pCPU gets a wakeup IRQ right before PID.NV is updated. The real motivation is to allow for more readable code in the future, when post-block is merged with vmx_vcpu_pi_load(), at which point removal from the list will be conditional on the old notification vector. Opportunistically add comments to document why KVM has a per-CPU spinlock that, at first glance, appears to be taken only on the owning CPU. Explicitly call out that the spinlock must be taken with IRQs disabled, a detail that was "lost" when KVM switched from spin_lock_irqsave() to spin_lock(), with IRQs disabled for the entirety of the relevant path. Signed-off-by: Sean Christopherson Message-Id: <20211009021236.4122790-29-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 724b3962ef808388005b860450bfbef6bade26b3 Author: Sean Christopherson Date: Fri Oct 8 19:12:20 2021 -0700 KVM: VMX: Move Posted Interrupt ndst computation out of write loop Hoist the CPU => APIC ID conversion for the Posted Interrupt descriptor out of the loop to write the descriptor, preemption is disabled so the CPU won't change, and if the APIC ID changes KVM has bigger problems. No functional change intended. Signed-off-by: Sean Christopherson Message-Id: <20211009021236.4122790-28-seanjc@google.com> Signed-off-by: Paolo Bonzini commit cfb0e1306a3790eb055ebf7cdb7b0ee8a23e9b6e Author: Sean Christopherson Date: Fri Oct 8 19:12:19 2021 -0700 KVM: VMX: Read Posted Interrupt "control" exactly once per loop iteration Use READ_ONCE() when loading the posted interrupt descriptor control field to ensure "old" and "new" have the same base value. If the compiler emits separate loads, and loads into "new" before "old", KVM could theoretically drop the ON bit if it were set between the loads. Fixes: 28b835d60fcc ("KVM: Update Posted-Interrupts Descriptor when vCPU is preempted") Signed-off-by: Sean Christopherson Message-Id: <20211009021236.4122790-27-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 89ef0f21cf96200dfa46cec92228ef435681589f Author: Sean Christopherson Date: Fri Oct 8 19:12:18 2021 -0700 KVM: VMX: Save/restore IRQs (instead of CLI/STI) during PI pre/post block Save/restore IRQs when disabling IRQs in posted interrupt pre/post block in preparation for moving the code into vcpu_put/load(), where it would be called with IRQs already disabled. No functional changed intended. Signed-off-by: Sean Christopherson Message-Id: <20211009021236.4122790-26-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 29802380b6793eabcac648e1c097c7bd6333f3d4 Author: Sean Christopherson Date: Fri Oct 8 19:12:17 2021 -0700 KVM: VMX: Drop pointless PI.NDST update when blocking Don't update Posted Interrupt's NDST, a.k.a. the target pCPU, in the pre-block path, as NDST is guaranteed to be up-to-date. The comment about the vCPU being preempted during the update is simply wrong, as the update path runs with IRQs disabled (from before snapshotting vcpu->cpu, until after the update completes). Since commit 8b306e2f3c41 ("KVM: VMX: avoid double list add with VT-d posted interrupts", 2017-09-27) The vCPU can get preempted _before_ the update starts, but not during. And if the vCPU is preempted before, vmx_vcpu_pi_load() is responsible for updating NDST when the vCPU is scheduled back in. In that case, the check against the wakeup vector in vmx_vcpu_pi_load() cannot be true as that would require the notification vector to have been set to the wakeup vector _before_ blocking. Opportunistically switch to using vcpu->cpu for the list/lock lookups, which do not need pre_pcpu since the same commit. Signed-off-by: Sean Christopherson Message-Id: <20211009021236.4122790-25-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 74ba5bc872d3fb173b94fe9a1b8f6eaa807fc4ad Author: Sean Christopherson Date: Fri Oct 8 19:12:16 2021 -0700 KVM: VMX: Use boolean returns for Posted Interrupt "test" helpers Return bools instead of ints for the posted interrupt "test" helpers. The bit position of the flag being test does not matter to the callers, and is in fact lost by virtue of test_bit() itself returning a bool. Returning ints is potentially dangerous, e.g. "pi_test_on(pi_desc) == 1" is safe-ish because ON is bit 0 and thus any sane implementation of pi_test_on() will work, but for SN (bit 1), checking "== 1" would rely on pi_test_on() to return 0 or 1, a.k.a. bools, as opposed to 0 or 2 (the positive bit position). Signed-off-by: Sean Christopherson Message-Id: <20211009021236.4122790-24-seanjc@google.com> Signed-off-by: Paolo Bonzini commit c95717218add161f3e93bd454743506ed5bdd8e1 Author: Sean Christopherson Date: Fri Oct 8 19:12:15 2021 -0700 KVM: VMX: Drop unnecessary PI logic to handle impossible conditions Drop sanity checks on the validity of the previous pCPU when handling vCPU block/unlock for posted interrupts. The intention behind the sanity checks is to avoid memory corruption in case of a race or incorrect locking, but the code has been stable for a few years now and the checks get in the way of eliminating kvm_vcpu.pre_cpu. Signed-off-by: Sean Christopherson Message-Id: <20211009021236.4122790-23-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 057aa61bc992f2d27218b6558b0115d5623f1a7b Author: Sean Christopherson Date: Fri Oct 8 19:12:13 2021 -0700 KVM: VMX: Skip Posted Interrupt updates if APICv is hard disabled Explicitly skip posted interrupt updates if APICv is disabled in all of KVM, or if the guest doesn't have an in-kernel APIC. The PI descriptor is kept up-to-date if APICv is inhibited, e.g. so that re-enabling APICv doesn't require a bunch of updates, but neither the module param nor the APIC type can be changed on-the-fly. Signed-off-by: Sean Christopherson Message-Id: <20211009021236.4122790-21-seanjc@google.com> Signed-off-by: Paolo Bonzini commit d92a5d1c6c757f659ffb9c2c2e65fcf3d571c14e Author: Sean Christopherson Date: Fri Oct 8 19:12:12 2021 -0700 KVM: Add helpers to wake/query blocking vCPU Add helpers to wake and query a blocking vCPU. In addition to providing nice names, the helpers reduce the probability of KVM neglecting to use kvm_arch_vcpu_get_wait(). No functional change intended. Signed-off-by: Sean Christopherson Message-Id: <20211009021236.4122790-20-seanjc@google.com> Signed-off-by: Paolo Bonzini commit cdafece4b964a27b2d3d76bf5725b49415bbaaea Author: Sean Christopherson Date: Fri Oct 8 19:12:11 2021 -0700 KVM: x86: Invoke kvm_vcpu_block() directly for non-HALTED wait states Call kvm_vcpu_block() directly for all wait states except HALTED so that kvm_vcpu_halt() is no longer a misnomer on x86. Functionally, this means KVM will never attempt halt-polling or adjust vcpu->halt_poll_ns for INIT_RECEIVED (a.k.a. Wait-For-SIPI (WFS)) or AP_RESET_HOLD; UNINITIALIZED is handled in kvm_arch_vcpu_ioctl_run(), and x86 doesn't use any other "wait" states. As mentioned above, the motivation of this is purely so that "halt" isn't overloaded on x86, e.g. in KVM's stats. Skipping halt-polling for WFS (and RESET_HOLD) has no meaningful effect on guest performance as there are typically single-digit numbers of INIT-SIPI sequences per AP vCPU, per boot, versus thousands of HLTs just to boot to console. Reviewed-by: David Matlack Signed-off-by: Sean Christopherson Message-Id: <20211009021236.4122790-19-seanjc@google.com> Signed-off-by: Paolo Bonzini commit c91d44971459073537874fcdd2f445e94cfb4f07 Author: Sean Christopherson Date: Fri Oct 8 19:12:10 2021 -0700 KVM: x86: Directly block (instead of "halting") UNINITIALIZED vCPUs Go directly to kvm_vcpu_block() when handling the case where userspace attempts to run an UNINITIALIZED vCPU. The vCPU is not halted, nor is it likely that halt-polling will be successful in this case. Reviewed-by: David Matlack Signed-off-by: Sean Christopherson Message-Id: <20211009021236.4122790-18-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 109a98260b533722d1190dcfa18447dd39fee5ff Author: Sean Christopherson Date: Fri Oct 8 19:12:09 2021 -0700 KVM: Don't redo ktime_get() when calculating halt-polling stop/deadline Calculate the halt-polling "stop" time using "start" instead of redoing ktime_get(). In practice, the numbers involved are in the noise (e.g., in the happy case where hardware correctly predicts do_halt_poll and there are no interrupts, "start" is probably only a few cycles old) and either approach is perfectly ok. But it's more precise to count any extra latency toward the halt-polling time. Reviewed-by: David Matlack Signed-off-by: Sean Christopherson Message-Id: <20211009021236.4122790-17-seanjc@google.com> Signed-off-by: Paolo Bonzini commit c3858335c711569b82a234a560dc19247e8f3fcc Author: Jing Zhang Date: Fri Oct 8 19:12:08 2021 -0700 KVM: stats: Add stat to detect if vcpu is currently blocking Add a "blocking" stat that userspace can use to detect the case where a vCPU is not being run because of an vCPU/guest action, e.g. HLT or WFS on x86, WFI on arm64, etc... Current guest/host/halt stats don't show this well, e.g. if a guest halts for a long period of time then the vCPU could could appear pathologically blocked due to a host condition, when in reality the vCPU has been put into a not-runnable state by the guest. Originally-by: Cannon Matthews Suggested-by: Sean Christopherson Reviewed-by: David Matlack Signed-off-by: Jing Zhang [sean: renamed stat to "blocking", massaged changelog] Signed-off-by: Sean Christopherson Message-Id: <20211009021236.4122790-16-seanjc@google.com> Signed-off-by: Paolo Bonzini commit fac4268894394213127e43856f41d10f29131e69 Author: Sean Christopherson Date: Fri Oct 8 19:12:07 2021 -0700 KVM: Split out a kvm_vcpu_block() helper from kvm_vcpu_halt() Factor out the "block" part of kvm_vcpu_halt() so that x86 can emulate non-halt wait/sleep/block conditions that should not be subjected to halt-polling. No functional change intended. Reviewed-by: Christian Borntraeger Reviewed-by: David Matlack Signed-off-by: Sean Christopherson Message-Id: <20211009021236.4122790-15-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 91b99ea7065786d0bff1c9281b002455dbaeb08b Author: Sean Christopherson Date: Fri Oct 8 19:12:06 2021 -0700 KVM: Rename kvm_vcpu_block() => kvm_vcpu_halt() Rename kvm_vcpu_block() to kvm_vcpu_halt() in preparation for splitting the actual "block" sequences into a separate helper (to be named kvm_vcpu_block()). x86 will use the standalone block-only path to handle non-halt cases where the vCPU is not runnable. Rename block_ns to halt_ns to match the new function name. No functional change intended. Reviewed-by: David Matlack Reviewed-by: Christian Borntraeger Signed-off-by: Sean Christopherson Message-Id: <20211009021236.4122790-14-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 005467e06b16261ffdd7130ff0b4f0ebd627599a Author: Sean Christopherson Date: Fri Oct 8 19:12:02 2021 -0700 KVM: Drop obsolete kvm_arch_vcpu_block_finish() Drop kvm_arch_vcpu_block_finish() now that all arch implementations are nops. No functional change intended. Acked-by: Christian Borntraeger Reviewed-by: David Matlack Signed-off-by: Sean Christopherson Message-Id: <20211009021236.4122790-10-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 1460179dcd76a4ae4121e2da29b586f41715dd1d Author: Sean Christopherson Date: Fri Oct 8 19:12:05 2021 -0700 KVM: x86: Tweak halt emulation helper names to free up kvm_vcpu_halt() Rename a variety of HLT-related helpers to free up the function name "kvm_vcpu_halt" for future use in generic KVM code, e.g. to differentiate between "block" and "halt". No functional change intended. Reviewed-by: David Matlack Signed-off-by: Sean Christopherson Message-Id: <20211009021236.4122790-13-seanjc@google.com> Signed-off-by: Paolo Bonzini commit f6c60d081e2ccb4655fa90625b630c860a99d036 Author: Sean Christopherson Date: Fri Oct 8 19:12:04 2021 -0700 KVM: Don't block+unblock when halt-polling is successful Invoke the arch hooks for block+unblock if and only if KVM actually attempts to block the vCPU. The only non-nop implementation is on x86, specifically SVM's AVIC, and there is no need to put the AVIC prior to halt-polling; KVM x86's kvm_vcpu_has_events() will scour the full vIRR to find pending IRQs regardless of whether the AVIC is loaded/"running". The primary motivation is to allow future cleanup to split out "block" from "halt", but this is also likely a small performance boost on x86 SVM when halt-polling is successful. Adjust the post-block path to update "cur" after unblocking, i.e. include AVIC load time in halt_wait_ns and halt_wait_hist, so that the behavior is consistent. Moving just the pre-block arch hook would result in only the AVIC put latency being included in the halt_wait stats. There is no obvious evidence that one way or the other is correct, so just ensure KVM is consistent. Note, x86 has two separate paths for handling APICv with respect to vCPU blocking. VMX uses hooks in x86's vcpu_block(), while SVM uses the arch hooks in kvm_vcpu_block(). Prior to this path, the two paths were more or less functionally identical. That is very much not the case after this patch, as the hooks used by VMX _must_ fire before halt-polling. x86's entire mess will be cleaned up in future patches. Signed-off-by: Sean Christopherson Message-Id: <20211009021236.4122790-12-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 6109c5a6ab7f38ed8e1beb06a90aa83884c18700 Author: Sean Christopherson Date: Fri Oct 8 19:12:03 2021 -0700 KVM: arm64: Move vGIC v4 handling for WFI out arch callback hook Move the put and reload of the vGIC out of the block/unblock callbacks and into a dedicated WFI helper. Functionally, this is nearly a nop as the block hook is called at the very beginning of kvm_vcpu_block(), and the only code in kvm_vcpu_block() after the unblock hook is to update the halt-polling controls, i.e. can only affect the next WFI. Back when the arch (un)blocking hooks were added by commits 3217f7c25bca ("KVM: Add kvm_arch_vcpu_{un}blocking callbacks) and d35268da6687 ("arm/arm64: KVM: arch_timer: Only schedule soft timer on vcpu_block"), the hooks were invoked only when KVM was about to "block", i.e. schedule out the vCPU. The use case at the time was to schedule a timer in the host based on the earliest timer in the guest in order to wake the blocking vCPU when the emulated guest timer fired. Commit accb99bcd0ca ("KVM: arm/arm64: Simplify bg_timer programming") reworked the timer logic to be even more precise, by waiting until the vCPU was actually scheduled out, and so move the timer logic from the (un)blocking hooks to vcpu_load/put. In the meantime, the hooks gained usage for enabling vGIC v4 doorbells in commit df9ba95993b9 ("KVM: arm/arm64: GICv4: Use the doorbell interrupt as an unblocking source"), and added related logic for the VMCR in commit 5eeaf10eec39 ("KVM: arm/arm64: Sync ICH_VMCR_EL2 back when about to block"). Finally, commit 07ab0f8d9a12 ("KVM: Call kvm_arch_vcpu_blocking early into the blocking sequence") hoisted the (un)blocking hooks so that they wrapped KVM's halt-polling logic in addition to the core "block" logic. In other words, the original need for arch hooks to take action _only_ in the block path is long since gone. Cc: Oliver Upton Cc: Marc Zyngier Signed-off-by: Sean Christopherson Message-Id: <20211009021236.4122790-11-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 75c89e5272fba7f8c8c4e4d7dc23be1b82e4b2d8 Author: Sean Christopherson Date: Fri Oct 8 19:12:01 2021 -0700 KVM: s390: Clear valid_wakeup in kvm_s390_handle_wait(), not in arch hook Move the clearing of valid_wakeup from kvm_arch_vcpu_block_finish() so that a future patch can drop said arch hook. Unlike the other blocking- related arch hooks, vcpu_blocking/unblocking(), vcpu_block_finish() needs to be called even if the KVM doesn't actually block the vCPU. This will allow future patches to differentiate between truly blocking the vCPU and emulating a halt condition without introducing a contradiction. Alternatively, the hook could be renamed to kvm_arch_vcpu_halt_finish(), but there's literally one call site in s390, and future cleanup can also be done to handle valid_wakeup fully within kvm_s390_handle_wait() and allow generic KVM to drop vcpu_valid_wakeup(). No functional change intended. Reviewed-by: Christian Borntraeger Signed-off-by: Sean Christopherson Message-Id: <20211009021236.4122790-9-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 30c9434717fd27e634a157dcdee286703b1f4891 Author: Sean Christopherson Date: Fri Oct 8 19:12:00 2021 -0700 KVM: Reconcile discrepancies in halt-polling stats Move the halt-polling "success" and histogram stats update into the dedicated helper to fix a discrepancy where the success/fail "time" stats consider polling successful so long as the wait is avoided, but the main "success" and histogram stats consider polling successful if and only if a wake event was detected by the halt-polling loop. Move halt_attempted_poll to the helper as well so that all the stats are updated in a single location. While it's a bit odd to update the stat well after the fact, practically speaking there's no meaningful advantage to updating before polling. Note, there is a functional change in addition to the success vs. fail change. The histogram updates previously called ktime_get() instead of using "cur". But that change is desirable as it means all the stats are now updated with the same polling time, and avoids the extra ktime_get(), which isn't expensive but isn't free either. Reviewed-by: David Matlack Signed-off-by: Sean Christopherson Message-Id: <20211009021236.4122790-8-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 29e72893cec3b0268e19e7857d10bf79843f94dc Author: Sean Christopherson Date: Fri Oct 8 19:11:59 2021 -0700 KVM: Refactor and document halt-polling stats update helper Add a comment to document that halt-polling is considered successful even if the polling loop itself didn't detect a wake event, i.e. if a wake event was detect in the final kvm_vcpu_check_block(). Invert the param to update helper so that the helper is a dumb function that is "told" whether or not polling was successful, as opposed to determining success based on blocking behavior. Opportunistically tweak the params to the update helper to reduce the line length for the call site so that it fits on a single line, and so that the prototype conforms to the more traditional kernel style. No functional change intended. Reviewed-by: David Matlack Signed-off-by: Sean Christopherson Message-Id: <20211009021236.4122790-7-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 8df6a61c04038fa481a717fc86af38304aa600a3 Author: Sean Christopherson Date: Fri Oct 8 19:11:58 2021 -0700 KVM: Update halt-polling stats if and only if halt-polling was attempted Don't update halt-polling stats if halt-polling wasn't attempted. This is a nop as @poll_ns is guaranteed to be '0' (poll_end == start); in a future patch (to move the histogram stats into the helper), it will avoid to avoid a discrepancy in what is considered a "successful" halt-poll. No functional change intended. Reviewed-by: David Matlack Signed-off-by: Sean Christopherson Message-Id: <20211009021236.4122790-6-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 510958e997217e39a16b47afb5a44dfa39013964 Author: Sean Christopherson Date: Fri Oct 8 19:11:57 2021 -0700 KVM: Force PPC to define its own rcuwait object Do not define/reference kvm_vcpu.wait if __KVM_HAVE_ARCH_WQP is true, and instead force the architecture (PPC) to define its own rcuwait object. Allowing common KVM to directly access vcpu->wait without a guard makes it all too easy to introduce potential bugs, e.g. kvm_vcpu_block(), kvm_vcpu_on_spin(), and async_pf_execute() all operate on vcpu->wait, not the result of kvm_arch_vcpu_get_wait(), and so may do the wrong thing for PPC. Due to PPC's shenanigans with respect to callbacks and waits (it switches to the virtual core's wait object at KVM_RUN!?!?), it's not clear whether or not this fixes any bugs. Signed-off-by: Sean Christopherson Message-Id: <20211009021236.4122790-5-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 6f390916c4fb359507d9ac4bf1b28a4f8abee5c0 Author: Sean Christopherson Date: Fri Oct 8 19:11:56 2021 -0700 KVM: s390: Ensure kvm_arch_no_poll() is read once when blocking vCPU Wrap s390's halt_poll_max_steal with READ_ONCE and snapshot the result of kvm_arch_no_poll() in kvm_vcpu_block() to avoid a mostly-theoretical, largely benign bug on s390 where the result of kvm_arch_no_poll() could change due to userspace modifying halt_poll_max_steal while the vCPU is blocking. The bug is largely benign as it will either cause KVM to skip updating halt-polling times (no_poll toggles false=>true) or to update halt-polling times with a slightly flawed block_ns. Note, READ_ONCE is unnecessary in the current code, add it in case the arch hook is ever inlined, and to provide a hint that userspace can change the param at will. Fixes: 8b905d28ee17 ("KVM: s390: provide kvm_arch_no_poll function") Reviewed-by: Christian Borntraeger Signed-off-by: Sean Christopherson Message-Id: <20211009021236.4122790-4-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 91b01895071770ed0c256869d0f94d69a2fb8ecf Author: Sean Christopherson Date: Fri Oct 8 19:11:55 2021 -0700 KVM: SVM: Ensure target pCPU is read once when signalling AVIC doorbell Ensure vcpu->cpu is read once when signalling the AVIC doorbell. If the compiler rereads the field and the vCPU is migrated between the check and writing the doorbell, KVM would signal the wrong physical CPU. Functionally, signalling the wrong CPU in this case is not an issue as task migration means the vCPU has exited and will pick up any pending interrupts on the next VMRUN. Add the READ_ONCE() purely to clean up the code. Opportunistically add a comment explaining the task migration behavior, and rename cpuid=>cpu to avoid conflating the CPU number with KVM's more common usage of CPUID. Signed-off-by: Sean Christopherson Message-Id: <20211009021236.4122790-3-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 1831fa44df743a7cdffdf1c12c799bf6f3c12b8c Author: Paolo Bonzini Date: Tue Nov 16 09:32:47 2021 -0500 KVM: VMX: Don't unblock vCPU w/ Posted IRQ if IRQs are disabled in guest Don't configure the wakeup handler when a vCPU is blocking with IRQs disabled, in which case any IRQ, posted or otherwise, should not be recognized and thus should not wake the vCPU. Fixes: bf9f6ac8d749 ("KVM: Update Posted-Interrupts Descriptor when vCPU is blocked") Signed-off-by: Sean Christopherson Message-Id: <20211009021236.4122790-2-seanjc@google.com> Signed-off-by: Paolo Bonzini commit 98a26b69d8c3b7b2bd51350b1a1218c518d32123 Author: Vihas Mak Date: Sun Nov 14 22:13:12 2021 +0530 KVM: x86: change TLB flush indicator to bool change 0 to false and 1 to true to fix following cocci warnings: arch/x86/kvm/mmu/mmu.c:1485:9-10: WARNING: return of 0/1 in function 'kvm_set_pte_rmapp' with return type bool arch/x86/kvm/mmu/mmu.c:1636:10-11: WARNING: return of 0/1 in function 'kvm_test_age_rmapp' with return type bool Signed-off-by: Vihas Mak Cc: Sean Christopherson Cc: Vitaly Kuznetsov Cc: Wanpeng Li Cc: Jim Mattson Cc: Joerg Roedel Message-Id: <20211114164312.GA28736@makvihas> Signed-off-by: Paolo Bonzini commit aefdc2ed445eb470bdba108bd6a19fb232d3bada Author: Paolo Bonzini Date: Wed Oct 20 06:38:05 2021 -0400 KVM: Avoid atomic operations when kicking the running vCPU If we do have the vcpu mutex, as is the case if kvm_running_vcpu is set to the target vcpu of the kick, changes to vcpu->mode do not need atomic operations; cmpxchg is only needed _outside_ the mutex to ensure that the IN_GUEST_MODE->EXITING_GUEST_MODE change does not race with the vcpu thread going OUTSIDE_GUEST_MODE. Use this to optimize the case of a vCPU sending an interrupt to itself. Signed-off-by: Paolo Bonzini commit fb43496c8362b8b379b4348b581f8f88f47cd1f8 Author: Ben Gardon Date: Mon Nov 15 15:45:59 2021 -0800 KVM: x86/MMU: Simplify flow of vmx_get_mt_mask Remove the gotos from vmx_get_mt_mask. It's easier to build the whole memory type at once, than it is to combine separate cacheability and ipat fields. No functional change intended. Signed-off-by: Ben Gardon Message-Id: <20211115234603.2908381-12-bgardon@google.com> Signed-off-by: Paolo Bonzini commit 8283e36abfff507c64fe8289ac30ea7ab59648aa Author: Ben Gardon Date: Mon Nov 15 15:45:58 2021 -0800 KVM: x86/mmu: Propagate memslot const qualifier In preparation for implementing in-place hugepage promotion, various functions will need to be called from zap_collapsible_spte_range, which has the const qualifier on its memslot argument. Propagate the const qualifier to the various functions which will be needed. This just serves to simplify the following patch. No functional change intended. Signed-off-by: Ben Gardon Message-Id: <20211115234603.2908381-11-bgardon@google.com> Signed-off-by: Paolo Bonzini commit 4d78d0b39ad03e7357452a669938653a379cfebd Author: Ben Gardon Date: Mon Nov 15 15:45:54 2021 -0800 KVM: x86/mmu: Remove need for a vcpu from mmu_try_to_unsync_pages The vCPU argument to mmu_try_to_unsync_pages is now only used to get a pointer to the associated struct kvm, so pass in the kvm pointer from the beginning to remove the need for a vCPU when calling the function. Signed-off-by: Ben Gardon Message-Id: <20211115234603.2908381-7-bgardon@google.com> Signed-off-by: Paolo Bonzini commit 9d395a0a7aca75caa72a8ab11a6efc9909c5a918 Author: Ben Gardon Date: Mon Nov 15 15:45:53 2021 -0800 KVM: x86/mmu: Remove need for a vcpu from kvm_slot_page_track_is_active kvm_slot_page_track_is_active only uses its vCPU argument to get a pointer to the assoicated struct kvm, so just pass in the struct KVM to remove the need for a vCPU pointer. No functional change intended. Signed-off-by: Ben Gardon Message-Id: <20211115234603.2908381-6-bgardon@google.com> Signed-off-by: Paolo Bonzini commit ce92ef7604ffe74da84f559f6eba8c6053250451 Author: Sean Christopherson Date: Wed Nov 17 18:08:42 2021 -0800 KVM: x86/mmu: Use shadow page role to detect PML-unfriendly pages for L2 Rework make_spte() to query the shadow page's role, specifically whether or not it's a guest_mode page, a.k.a. a page for L2, when determining if the SPTE is compatible with PML. This eliminates a dependency on @vcpu, with a future goal of being able to create SPTEs without a specific vCPU. Signed-off-by: Sean Christopherson Signed-off-by: Paolo Bonzini commit 8fc78909c05d1691c0d087cb1b9a4858762c747d Author: Emanuele Giuseppe Esposito Date: Wed Nov 3 10:05:26 2021 -0400 KVM: nSVM: introduce struct vmcb_ctrl_area_cached This structure will replace vmcb_control_area in svm_nested_state, providing only the fields that are actually used by the nested state. This avoids having and copying around uninitialized fields. The cost of this, however, is that all functions (in this case vmcb_is_intercept) expect the old structure, so they need to be duplicated. In addition, in svm_get_nested_state() user space expects a vmcb_control_area struct, so we need to copy back all fields in a temporary structure before copying it to userspace. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Maxim Levitsky Message-Id: <20211103140527.752797-7-eesposit@redhat.com> Signed-off-by: Paolo Bonzini commit bd95926c2b2b9b66013a36b6558aa426147ed11f Author: Paolo Bonzini Date: Thu Nov 11 09:14:08 2021 -0500 KVM: nSVM: split out __nested_vmcb_check_controls Remove the struct vmcb_control_area parameter from nested_vmcb_check_controls, for consistency with the functions that operate on the save area. This way, VMRUN uses the version without underscores for both areas, while KVM_SET_NESTED_STATE uses the version with underscores. Signed-off-by: Paolo Bonzini commit 355d0473b1a11d7cf526fbd43c3908224e08a909 Author: Emanuele Giuseppe Esposito Date: Wed Nov 3 10:05:25 2021 -0400 KVM: nSVM: use svm->nested.save to load vmcb12 registers and avoid TOC/TOU races Use the already checked svm->nested.save cached fields (EFER, CR0, CR4, ...) instead of vmcb12's in nested_vmcb02_prepare_save(). This prevents from creating TOC/TOU races, since the guest could modify the vmcb12 fields. This also avoids the need of force-setting EFER_SVME in nested_vmcb02_prepare_save. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Maxim Levitsky Message-Id: <20211103140527.752797-6-eesposit@redhat.com> Signed-off-by: Paolo Bonzini commit b7a3d8b6f433d293e9033b9d63651b6d17bf5654 Author: Emanuele Giuseppe Esposito Date: Wed Nov 3 10:05:24 2021 -0400 KVM: nSVM: use vmcb_save_area_cached in nested_vmcb_valid_sregs() Now that struct vmcb_save_area_cached contains the required vmcb fields values (done in nested_load_save_from_vmcb12()), check them to see if they are correct in nested_vmcb_valid_sregs(). While at it, rename nested_vmcb_valid_sregs in nested_vmcb_check_save. __nested_vmcb_check_save takes the additional @save parameter, so it is helpful when we want to check a non-svm save state, like in svm_set_nested_state. The reason for that is that save is the L1 state, not L2, so we check it without moving it to svm->nested.save. Signed-off-by: Emanuele Giuseppe Esposito Message-Id: <20211103140527.752797-5-eesposit@redhat.com> Signed-off-by: Paolo Bonzini commit 7907160dbf1a1063b19201c79566069ec0da054c Author: Emanuele Giuseppe Esposito Date: Wed Nov 3 10:05:23 2021 -0400 KVM: nSVM: rename nested_load_control_from_vmcb12 in nested_copy_vmcb_control_to_cache Following the same naming convention of the previous patch, rename nested_load_control_from_vmcb12. In addition, inline copy_vmcb_control_area as it is only called by this function. __nested_copy_vmcb_control_to_cache() works with vmcb_control_area parameters and it will be useful in next patches, when we use local variables instead of svm cached state. Signed-off-by: Emanuele Giuseppe Esposito Message-Id: <20211103140527.752797-4-eesposit@redhat.com> Signed-off-by: Paolo Bonzini commit f2740a8d851a57068c9f3624c6dc8edcf91754b2 Author: Emanuele Giuseppe Esposito Date: Wed Nov 3 10:05:22 2021 -0400 KVM: nSVM: introduce svm->nested.save to cache save area before checks This is useful in the next patch, to keep a saved copy of vmcb12 registers and pass it around more easily. Instead of blindly copying everything, we just copy EFER, CR0, CR3, CR4, DR6 and DR7 which are needed by the VMRUN checks. If more fields will need to be checked, it will be quite obvious to see that they must be added in struct vmcb_save_area_cached and in nested_copy_vmcb_save_to_cache(). __nested_copy_vmcb_save_to_cache() takes a vmcb_save_area_cached parameter, which is useful in order to save the state to a local variable. Signed-off-by: Emanuele Giuseppe Esposito Message-Id: <20211103140527.752797-3-eesposit@redhat.com> Signed-off-by: Paolo Bonzini commit 907afa48e9d0f24713a34135428d981e4239a3be Author: Emanuele Giuseppe Esposito Date: Wed Nov 3 10:05:21 2021 -0400 KVM: nSVM: move nested_vmcb_check_cr3_cr4 logic in nested_vmcb_valid_sregs Inline nested_vmcb_check_cr3_cr4 as it is not called by anyone else. Doing so simplifies next patches. Signed-off-by: Emanuele Giuseppe Esposito Reviewed-by: Maxim Levitsky Message-Id: <20211103140527.752797-2-eesposit@redhat.com> Signed-off-by: Paolo Bonzini commit 244893fa2859d656e2caf88683211604eb9afd37 Author: Sean Christopherson Date: Mon Dec 6 20:54:35 2021 +0100 KVM: Dynamically allocate "new" memslots from the get-go Allocate the "new" memslot for !DELETE memslot updates straight away instead of filling an intermediate on-stack object and forcing kvm_set_memslot() to juggle the allocation and do weird things like reuse the old memslot object in MOVE. In the MOVE case, this results in an "extra" memslot allocation due to allocating both the "new" slot and the "invalid" slot, but that's a temporary and not-huge allocation, and MOVE is a relatively rare memslot operation. Regarding MOVE, drop the open-coded management of the gfn tree with a call to kvm_replace_memslot(), which already handles the case where new->base_gfn != old->base_gfn. This is made possible by virtue of not having to copy the "new" memslot data after erasing the old memslot from the gfn tree. Using kvm_replace_memslot(), and more specifically not reusing the old memslot, means the MOVE case now does hva tree and hash list updates, but that's a small price to pay for simplifying the code and making MOVE align with all the other flavors of updates. The "extra" updates are firmly in the noise from a performance perspective, e.g. the "move (in)active area" selfttests show a (very, very) slight improvement. Signed-off-by: Sean Christopherson Reviewed-by: Maciej S. Szmigiero Signed-off-by: Maciej S. Szmigiero Message-Id: commit 0f9bdef3d933ba10d577b446c703a901fa5fdc30 Author: Sean Christopherson Date: Mon Dec 6 20:54:34 2021 +0100 KVM: Wait 'til the bitter end to initialize the "new" memslot Initialize the "new" memslot in the !DELETE path only after the various sanity checks have passed. This will allow a future commit to allocate @new dynamically without having to copy a memslot, and without having to deal with freeing @new in error paths and in the "nothing to change" path that's hiding in the sanity checks. No functional change intended. Signed-off-by: Sean Christopherson Reviewed-by: Maciej S. Szmigiero Signed-off-by: Maciej S. Szmigiero Message-Id: commit 44401a204734ce837e0b36c8418af4fad6a21f95 Author: Maciej S. Szmigiero Date: Mon Dec 6 20:54:33 2021 +0100 KVM: Optimize overlapping memslots check Do a quick lookup for possibly overlapping gfns when creating or moving a memslot instead of performing a linear scan of the whole memslot set. Signed-off-by: Maciej S. Szmigiero [sean: tweaked params to avoid churn in future cleanup] Reviewed-by: Sean Christopherson Message-Id: commit f4209439b522432d140d33393d4a3f12e695527b Author: Maciej S. Szmigiero Date: Mon Dec 6 20:54:32 2021 +0100 KVM: Optimize gfn lookup in kvm_zap_gfn_range() Introduce a memslots gfn upper bound operation and use it to optimize kvm_zap_gfn_range(). This way this handler can do a quick lookup for intersecting gfns and won't have to do a linear scan of the whole memslot set. Signed-off-by: Maciej S. Szmigiero Message-Id: commit bcb63dcde829945487bad4917b614c28aaa59141 Author: Maciej S. Szmigiero Date: Mon Dec 6 20:54:31 2021 +0100 KVM: Call kvm_arch_flush_shadow_memslot() on the old slot in kvm_invalidate_memslot() kvm_invalidate_memslot() calls kvm_arch_flush_shadow_memslot() on the active, but KVM_MEMSLOT_INVALID slot. Do it on the inactive (but valid) old slot instead since arch code really should not get passed such invalid slot. Note that this means that the "arch" field of the slot provided to kvm_arch_flush_shadow_memslot() may have stale data since this function is called with slots_arch_lock released. Suggested-by: Sean Christopherson Signed-off-by: Maciej S. Szmigiero Reviewed-by: Sean Christopherson Message-Id: <813595ecc193d6ae39a87709899d4251523b05f8.1638817641.git.maciej.szmigiero@oracle.com> commit a54d806688fe1e482350ce759a8a0fc9ebf814b0 Author: Maciej S. Szmigiero Date: Mon Dec 6 20:54:30 2021 +0100 KVM: Keep memslots in tree-based structures instead of array-based ones The current memslot code uses a (reverse gfn-ordered) memslot array for keeping track of them. Because the memslot array that is currently in use cannot be modified every memslot management operation (create, delete, move, change flags) has to make a copy of the whole array so it has a scratch copy to work on. Strictly speaking, however, it is only necessary to make copy of the memslot that is being modified, copying all the memslots currently present is just a limitation of the array-based memslot implementation. Two memslot sets, however, are still needed so the VM continues to run on the currently active set while the requested operation is being performed on the second, currently inactive one. In order to have two memslot sets, but only one copy of actual memslots it is necessary to split out the memslot data from the memslot sets. The memslots themselves should be also kept independent of each other so they can be individually added or deleted. These two memslot sets should normally point to the same set of memslots. They can, however, be desynchronized when performing a memslot management operation by replacing the memslot to be modified by its copy. After the operation is complete, both memslot sets once again point to the same, common set of memslot data. This commit implements the aforementioned idea. For tracking of gfns an ordinary rbtree is used since memslots cannot overlap in the guest address space and so this data structure is sufficient for ensuring that lookups are done quickly. The "last used slot" mini-caches (both per-slot set one and per-vCPU one), that keep track of the last found-by-gfn memslot, are still present in the new code. Co-developed-by: Sean Christopherson Signed-off-by: Sean Christopherson Signed-off-by: Maciej S. Szmigiero Message-Id: <17c0cf3663b760a0d3753d4ac08c0753e941b811.1638817641.git.maciej.szmigiero@oracle.com> commit 6a656832aa75784d02dccd8d37fc5c0896064c2e Author: Maciej S. Szmigiero Date: Mon Dec 6 20:54:29 2021 +0100 KVM: s390: Introduce kvm_s390_get_gfn_end() And use it where s390 code would just access the memslot with the highest gfn directly. No functional change intended. Signed-off-by: Maciej S. Szmigiero Reviewed-by: Claudio Imbrenda Message-Id: <42496041d6af1c23b1cbba2636b344ca8d5fc3af.1638817641.git.maciej.szmigiero@oracle.com> commit ed922739c9199bf515a3e7fec3e319ce1edeef2a Author: Maciej S. Szmigiero Date: Mon Dec 6 20:54:28 2021 +0100 KVM: Use interval tree to do fast hva lookup in memslots The current memslots implementation only allows quick binary search by gfn, quick lookup by hva is not possible - the implementation has to do a linear scan of the whole memslots array, even though the operation being performed might apply just to a single memslot. This significantly hurts performance of per-hva operations with higher memslot counts. Since hva ranges can overlap between memslots an interval tree is needed for tracking them. [sean: handle interval tree updates in kvm_replace_memslot()] Signed-off-by: Maciej S. Szmigiero Message-Id: commit 26b8345abc75a7404716864710930407b7d873f9 Author: Maciej S. Szmigiero Date: Mon Dec 6 20:54:27 2021 +0100 KVM: Resolve memslot ID via a hash table instead of via a static array Memslot ID to the corresponding memslot mappings are currently kept as indices in static id_to_index array. The size of this array depends on the maximum allowed memslot count (regardless of the number of memslots actually in use). This has become especially problematic recently, when memslot count cap was removed, so the maximum count is now full 32k memslots - the maximum allowed by the current KVM API. Keeping these IDs in a hash table (instead of an array) avoids this problem. Resolving a memslot ID to the actual memslot (instead of its index) will also enable transitioning away from an array-based implementation of the whole memslots structure in a later commit. Co-developed-by: Sean Christopherson Signed-off-by: Sean Christopherson Signed-off-by: Maciej S. Szmigiero Message-Id: <117fb2c04320e6cd6cf34f205a72eadb0aa8d5f9.1638817640.git.maciej.szmigiero@oracle.com> commit 1e8617d37fc36407f9fce9c08ef8d254613c00de Author: Maciej S. Szmigiero Date: Mon Dec 6 20:54:26 2021 +0100 KVM: Move WARN on invalid memslot index to update_memslots() Since kvm_memslot_move_forward() can theoretically return a negative memslot index even when kvm_memslot_move_backward() returned a positive one (and so did not WARN) let's just move the warning to the common code. Signed-off-by: Maciej S. Szmigiero Reviewed-by: Claudio Imbrenda Reviewed-by: Sean Christopherson Message-Id: commit c928bfc2632fa3dd6a3bd4504ac6d8e42302287a Author: Maciej S. Szmigiero Date: Mon Dec 6 20:54:25 2021 +0100 KVM: Integrate gfn_to_memslot_approx() into search_memslots() s390 arch has gfn_to_memslot_approx() which is almost identical to search_memslots(), differing only in that in case the gfn falls in a hole one of the memslots bordering the hole is returned. Add this lookup mode as an option to search_memslots() so we don't have two almost identical functions for looking up a memslot by its gfn. Signed-off-by: Maciej S. Szmigiero [sean: tweaked helper names to keep gfn_to_memslot_approx() in s390] Reviewed-by: Sean Christopherson Message-Id: <171cd89b52c718dbe180ecd909b4437a64a7e2ec.1638817640.git.maciej.szmigiero@oracle.com> commit f5756029eef501bcd39ecd844968e4fb3055c1bd Author: Maciej S. Szmigiero Date: Mon Dec 6 20:54:24 2021 +0100 KVM: x86: Use nr_memslot_pages to avoid traversing the memslots array There is no point in recalculating from scratch the total number of pages in all memslots each time a memslot is created or deleted. Use KVM's cached nr_memslot_pages to compute the default max number of MMU pages. Note that even with nr_memslot_pages capped at ULONG_MAX we can't safely multiply it by KVM_PERMILLE_MMU_PAGES (20) since this operation can possibly overflow an unsigned long variable. Write this "* 20 / 1000" operation as "/ 50" instead to avoid such overflow. Signed-off-by: Maciej S. Szmigiero [sean: use common KVM field and rework changelog accordingly] Reviewed-by: Sean Christopherson Message-Id: commit e0c2b6338ac8ca30d438157dc45396c3c1148563 Author: Maciej S. Szmigiero Date: Mon Dec 6 20:54:23 2021 +0100 KVM: x86: Don't call kvm_mmu_change_mmu_pages() if the count hasn't changed There is no point in calling kvm_mmu_change_mmu_pages() for memslot operations that don't change the total page count, so do it just for KVM_MR_CREATE and KVM_MR_DELETE. Signed-off-by: Maciej S. Szmigiero Reviewed-by: Sean Christopherson Message-Id: <9e56b7616a11f5654e4ab486b3237366b7ba9f2a.1638817640.git.maciej.szmigiero@oracle.com> commit 7cd08553ab103a7ebca79035eb35b73418b2f475 Author: Sean Christopherson Date: Mon Dec 6 20:54:22 2021 +0100 KVM: Don't make a full copy of the old memslot in __kvm_set_memory_region() Stop making a full copy of the old memslot in __kvm_set_memory_region() now that metadata updates are handled by kvm_set_memslot(), i.e. now that the old memslot's dirty bitmap doesn't need to be referenced after the memslot and its pointer is modified/invalidated by kvm_set_memslot(). No functional change intended. Signed-off-by: Sean Christopherson Reviewed-by: Maciej S. Szmigiero Signed-off-by: Maciej S. Szmigiero Message-Id: <5dce0946b41bba8c83f6e3424c6955c56bcc9f86.1638817640.git.maciej.szmigiero@oracle.com> commit ec5c86976674d2f5c0f389903d956eda1dc54a78 Author: Sean Christopherson Date: Mon Dec 6 20:54:21 2021 +0100 KVM: s390: Skip gfn/size sanity checks on memslot DELETE or FLAGS_ONLY Sanity check the hva, gfn, and size of a userspace memory region only if any of those properties can change, i.e. skip the checks for DELETE and FLAGS_ONLY. KVM doesn't allow moving the hva or changing the size, a gfn change shows up as a MOVE even if flags are being modified, and the checks are pointless for the DELETE case as userspace_addr and gfn_base are zeroed by common KVM. No functional change intended. Signed-off-by: Sean Christopherson Signed-off-by: Maciej S. Szmigiero Message-Id: <05430738437ac2c9c7371ac4e11f4a533e1677da.1638817640.git.maciej.szmigiero@oracle.com> commit 77aedf26fe5d2795cd6aa1a75a8dd62dbac503e6 Author: Sean Christopherson Date: Mon Dec 6 20:54:20 2021 +0100 KVM: x86: Don't assume old/new memslots are non-NULL at memslot commit Play nice with a NULL @old or @new when handling memslot updates so that common KVM can pass NULL for one or the other in CREATE and DELETE cases instead of having to synthesize a dummy memslot. No functional change intended. Signed-off-by: Sean Christopherson Reviewed-by: Maciej S. Szmigiero Signed-off-by: Maciej S. Szmigiero Message-Id: <2eb7788adbdc2bc9a9c5f86844dd8ee5c8428732.1638817640.git.maciej.szmigiero@oracle.com> commit 07921665a651918350bc6653d4ca8a516a867b4b Author: Sean Christopherson Date: Mon Dec 6 20:54:19 2021 +0100 KVM: Use prepare/commit hooks to handle generic memslot metadata updates Handle the generic memslot metadata, a.k.a. dirty bitmap, updates at the same time that arch handles it's own metadata updates, i.e. at memslot prepare and commit. This will simplify converting @new to a dynamically allocated object, and more closely aligns common KVM with architecture code. No functional change intended. Signed-off-by: Sean Christopherson Reviewed-by: Maciej S. Szmigiero Signed-off-by: Maciej S. Szmigiero Message-Id: <2ddd5446e3706fe3c1e52e3df279f04c458be830.1638817640.git.maciej.szmigiero@oracle.com> commit 6a99c6e3f52a6f0d4c6ebcfa7359c718a19ffbe6 Author: Sean Christopherson Date: Mon Dec 6 20:54:18 2021 +0100 KVM: Stop passing kvm_userspace_memory_region to arch memslot hooks Drop the @mem param from kvm_arch_{prepare,commit}_memory_region() now that its use has been removed in all architectures. No functional change intended. Signed-off-by: Sean Christopherson Reviewed-by: Maciej S. Szmigiero Signed-off-by: Maciej S. Szmigiero Message-Id: commit d01495d4cffb327200d4522db6eb3fabfdc9e2f5 Author: Sean Christopherson Date: Mon Dec 6 20:54:17 2021 +0100 KVM: RISC-V: Use "new" memslot instead of userspace memory region Get the slot ID, hva, etc... from the "new" memslot instead of the userspace memory region when preparing/committing a memory region. This will allow a future commit to drop @mem from the prepare/commit hooks once all architectures convert to using "new". Opportunistically wait to get the various "new" values until after filtering out the DELETE case in anticipation of a future commit passing NULL for @new when deleting a memslot. Signed-off-by: Sean Christopherson Signed-off-by: Maciej S. Szmigiero Message-Id: <543608ab88a1190e73a958efffafc98d2652c067.1638817640.git.maciej.szmigiero@oracle.com> commit 9d7d18ee3f48903f7b9bbf6305d690078c67271b Author: Sean Christopherson Date: Mon Dec 6 20:54:16 2021 +0100 KVM: x86: Use "new" memslot instead of userspace memory region Get the number of pages directly from the new memslot instead of computing the same from the userspace memory region when allocating memslot metadata. This will allow a future patch to drop @mem. No functional change intended. Signed-off-by: Sean Christopherson Reviewed-by: Maciej S. Szmigiero Signed-off-by: Maciej S. Szmigiero Message-Id: commit cf5b486922dc8667234bcaaadda4586b3062a1c0 Author: Sean Christopherson Date: Mon Dec 6 20:54:15 2021 +0100 KVM: s390: Use "new" memslot instead of userspace memory region Get the gfn, size, and hva from the new memslot instead of the userspace memory region when preparing/committing memory region changes. This will allow a future commit to drop the @mem param. Note, this has a subtle functional change as KVM would previously reject DELETE if userspace provided a garbage userspace_addr or guest_phys_addr, whereas KVM zeros those fields in the "new" memslot when deleting an existing memslot. Arguably the old behavior is more correct, but there's zero benefit into requiring userspace to provide sane values for hva and gfn. Signed-off-by: Sean Christopherson Signed-off-by: Maciej S. Szmigiero Message-Id: <917ed131c06a4c7b35dd7fb7ed7955be899ad8cc.1638817639.git.maciej.szmigiero@oracle.com> commit eaaaed137eccb9e8f3a88f6297e214f53885196f Author: Sean Christopherson Date: Mon Dec 6 20:54:14 2021 +0100 KVM: PPC: Avoid referencing userspace memory region in memslot updates For PPC HV, get the number of pages directly from the new memslot instead of computing the same from the userspace memory region, and explicitly check for !DELETE instead of inferring the same when toggling mmio_update. The motivation for these changes is to avoid referencing the @mem param so that it can be dropped in a future commit. No functional change intended. Signed-off-by: Sean Christopherson Signed-off-by: Maciej S. Szmigiero Message-Id: <1e97fb5198be25f98ef82e63a8d770c682264cc9.1638817639.git.maciej.szmigiero@oracle.com> commit 3b1816177bfe2ce245a0f1194970644a79951570 Author: Sean Christopherson Date: Mon Dec 6 20:54:13 2021 +0100 KVM: MIPS: Drop pr_debug from memslot commit to avoid using "mem" Remove an old (circa 2012) kvm_debug from kvm_arch_commit_memory_region() to print basic information when committing a memslot change. The primary motivation for removing the kvm_debug is to avoid using @mem, the user memory region, so that said param can be removed. Alternatively, the debug message could be converted to use @new, but that would require synthesizing select state to play nice with the DELETED case, which will pass NULL for @new in the future. And there's no argument to be had for dumping generic information in an arch callback, i.e. if there's a good reason for the debug message, then it belongs in common KVM code where all architectures can benefit. Signed-off-by: Sean Christopherson Signed-off-by: Maciej S. Szmigiero Message-Id: <446929a668f6e1346751571b71db41e94e976cdf.1638817639.git.maciej.szmigiero@oracle.com> commit 509c594ca2dc8828b7b5d7b33192384741567cdf Author: Sean Christopherson Date: Mon Dec 6 20:54:12 2021 +0100 KVM: arm64: Use "new" memslot instead of userspace memory region Get the slot ID, hva, etc... from the "new" memslot instead of the userspace memory region when preparing/committing a memory region. This will allow a future commit to drop @mem from the prepare/commit hooks once all architectures convert to using "new". Opportunistically wait to get the hva begin+end until after filtering out the DELETE case in anticipation of a future commit passing NULL for @new when deleting a memslot. Signed-off-by: Sean Christopherson Signed-off-by: Maciej S. Szmigiero Message-Id: commit 537a17b3149300987456e8949ccb991e604047d6 Author: Sean Christopherson Date: Mon Dec 6 20:54:11 2021 +0100 KVM: Let/force architectures to deal with arch specific memslot data Pass the "old" slot to kvm_arch_prepare_memory_region() and force arch code to handle propagating arch specific data from "new" to "old" when necessary. This is a baby step towards dynamically allocating "new" from the get go, and is a (very) minor performance boost on x86 due to not unnecessarily copying arch data. For PPC HV, copy the rmap in the !CREATE and !DELETE paths, i.e. for MOVE and FLAGS_ONLY. This is functionally a nop as the previous behavior would overwrite the pointer for CREATE, and eventually discard/ignore it for DELETE. For x86, copy the arch data only for FLAGS_ONLY changes. Unlike PPC HV, x86 needs to reallocate arch data in the MOVE case as the size of x86's allocations depend on the alignment of the memslot's gfn. Opportunistically tweak kvm_arch_prepare_memory_region()'s param order to match the "commit" prototype. Signed-off-by: Sean Christopherson Reviewed-by: Maciej S. Szmigiero [mss: add missing RISCV kvm_arch_prepare_memory_region() change] Signed-off-by: Maciej S. Szmigiero Message-Id: <67dea5f11bbcfd71e3da5986f11e87f5dd4013f9.1638817639.git.maciej.szmigiero@oracle.com> commit ce5f0215620c11a5829da7f30bebf3adeeef3345 Author: Sean Christopherson Date: Mon Dec 6 20:54:10 2021 +0100 KVM: Use "new" memslot's address space ID instead of dedicated param Now that the address space ID is stored in every slot, including fake slots used for deletion, use the slot's as_id instead of passing in the redundant information as a param to kvm_set_memslot(). This will greatly simplify future memslot work by avoiding passing a large number of variables around purely to honor @as_id. Drop a comment in the DELETE path about new->as_id being provided purely for debug, as that's now a lie. No functional change intended. Signed-off-by: Sean Christopherson Reviewed-by: Maciej S. Szmigiero Signed-off-by: Maciej S. Szmigiero Message-Id: <03189577be214ab8530a4b3a3ee3ed1c2f9e5815.1638817639.git.maciej.szmigiero@oracle.com> commit 4e4d30cb9b8740e178731406aa28b96f12c6edbd Author: Maciej S. Szmigiero Date: Mon Dec 6 20:54:09 2021 +0100 KVM: Resync only arch fields when slots_arch_lock gets reacquired There is no need to copy the whole memslot data after releasing slots_arch_lock for a moment to install temporary memslots copy in kvm_set_memslot() since this lock only protects the arch field of each memslot. Just resync this particular field after reacquiring slots_arch_lock. Note, this also eliminates the need to manually clear the INVALID flag when restoring memslots; the "setting" of the INVALID flag was an unwanted side effect of copying the entire memslots. Since kvm_copy_memslots() has just one caller remaining now open-code it instead. Signed-off-by: Maciej S. Szmigiero [sean: tweak shortlog, note INVALID flag in changelog, revert comment] Reviewed-by: Sean Christopherson Message-Id: commit 47ea7d900b1cc66ec7a35a8b173ed16b01f9781b Author: Sean Christopherson Date: Mon Dec 6 20:54:08 2021 +0100 KVM: Open code kvm_delete_memslot() into its only caller Fold kvm_delete_memslot() into __kvm_set_memory_region() to free up the "kvm_delete_memslot()" name for use in a future helper. The delete logic isn't so complex/long that it truly needs a helper, and it will be simplified a wee bit further in upcoming commits. No functional change intended. Signed-off-by: Sean Christopherson Reviewed-by: Maciej S. Szmigiero Signed-off-by: Maciej S. Szmigiero Message-Id: <2887631c31a82947faa488ab72f55f8c68b7c194.1638817638.git.maciej.szmigiero@oracle.com> commit afa319a54a8c760ba59683cd3c4318635049a664 Author: Sean Christopherson Date: Mon Dec 6 20:54:07 2021 +0100 KVM: Require total number of memslot pages to fit in an unsigned long Explicitly disallow creating more memslot pages than can fit in an unsigned long, KVM doesn't correctly handle a total number of memslot pages that doesn't fit in an unsigned long and remedying that would be a waste of time. For a 64-bit kernel, this is a nop as memslots are not allowed to overlap in the gfn address space. With a 32-bit kernel, userspace can at most address 3gb of virtual memory, whereas wrapping the total number of pages would require 4tb+ of guest physical memory. Even with x86's second address space for SMM, userspace would need to alias all of guest memory more than one _thousand_ times. And on older x86 hardware with MAXPHYADDR < 43, the guest couldn't actually access any of those aliases even if userspace lied about guest.MAXPHYADDR. On 390 and arm64, this is a nop as they don't support 32-bit hosts. On x86, practically speaking this is simply acknowledging reality as the existing kvm_mmu_calculate_default_mmu_pages() assumes the total number of pages fits in an "unsigned long". On PPC, this is likely a nop as every flavor of PPC KVM assumes gfns (and gpas!) fit in unsigned long. arch/powerpc/kvm/book3s_32_mmu_host.c goes a step further and fails the build if CONFIG_PTE_64BIT=y, which presumably means that it does't support 64-bit physical addresses. On MIPS, this is also likely a nop as the core MMU helpers assume gpas fit in unsigned long, e.g. see kvm_mips_##name##_pte. And finally, RISC-V is a "don't care" as it doesn't exist in any release, i.e. there is no established ABI to break. Signed-off-by: Sean Christopherson Reviewed-by: Maciej S. Szmigiero Signed-off-by: Maciej S. Szmigiero Message-Id: <1c2c91baf8e78acccd4dad38da591002e61c013c.1638817638.git.maciej.szmigiero@oracle.com> commit 214bd3a6f46981b7867946e1b4f628a06bcf2091 Author: Marc Zyngier Date: Tue Nov 16 16:04:03 2021 +0000 KVM: Convert kvm_for_each_vcpu() to using xa_for_each_range() Now that the vcpu array is backed by an xarray, use the optimised iterator that matches the underlying data structure. Suggested-by: Sean Christopherson Signed-off-by: Marc Zyngier Message-Id: <20211116160403.4074052-8-maz@kernel.org> Signed-off-by: Paolo Bonzini commit 46808a4cb89708c2e5b264eb9d1035762581921b Author: Marc Zyngier Date: Tue Nov 16 16:04:02 2021 +0000 KVM: Use 'unsigned long' as kvm_for_each_vcpu()'s index Everywhere we use kvm_for_each_vpcu(), we use an int as the vcpu index. Unfortunately, we're about to move rework the iterator, which requires this to be upgrade to an unsigned long. Let's bite the bullet and repaint all of it in one go. Signed-off-by: Marc Zyngier Message-Id: <20211116160403.4074052-7-maz@kernel.org> Signed-off-by: Paolo Bonzini commit c5b077549136584618a66258f09d8d4b41e7409c Author: Marc Zyngier Date: Tue Nov 16 16:04:01 2021 +0000 KVM: Convert the kvm->vcpus array to a xarray At least on arm64 and x86, the vcpus array is pretty huge (up to 1024 entries on x86) and is mostly empty in the majority of the cases (running 1k vcpu VMs is not that common). This mean that we end-up with a 4kB block of unused memory in the middle of the kvm structure. Instead of wasting away this memory, let's use an xarray instead, which gives us almost the same flexibility as a normal array, but with a reduced memory usage with smaller VMs. Signed-off-by: Marc Zyngier Message-Id: <20211116160403.4074052-6-maz@kernel.org> Signed-off-by: Paolo Bonzini commit 113d10bca23cdd522da26969b96db8711b182642 Author: Marc Zyngier Date: Tue Nov 16 16:03:59 2021 +0000 KVM: s390: Use kvm_get_vcpu() instead of open-coded access As we are about to change the way vcpus are allocated, mandate the use of kvm_get_vcpu() instead of open-coding the access. Reviewed-by: Claudio Imbrenda Signed-off-by: Marc Zyngier Message-Id: <20211116160403.4074052-4-maz@kernel.org> Signed-off-by: Paolo Bonzini commit 75a9869f314d83ac70ebaa0b93773300681ab077 Author: Marc Zyngier Date: Tue Nov 16 16:03:58 2021 +0000 KVM: mips: Use kvm_get_vcpu() instead of open-coded access As we are about to change the way vcpus are allocated, mandate the use of kvm_get_vcpu() instead of open-coding the access. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Marc Zyngier Message-Id: <20211116160403.4074052-3-maz@kernel.org> Signed-off-by: Paolo Bonzini commit 27592ae8dbe41033261b6fdf27d78998aabd2665 Author: Marc Zyngier Date: Tue Nov 16 16:03:57 2021 +0000 KVM: Move wiping of the kvm->vcpus array to common code All architectures have similar loops iterating over the vcpus, freeing one vcpu at a time, and eventually wiping the reference off the vcpus array. They are also inconsistently taking the kvm->lock mutex when wiping the references from the array. Make this code common, which will simplify further changes. The locking is dropped altogether, as this should only be called when there is no further references on the kvm structure. Reviewed-by: Claudio Imbrenda Signed-off-by: Marc Zyngier Message-Id: <20211116160403.4074052-2-maz@kernel.org> Signed-off-by: Paolo Bonzini commit dc1ce45575b3401102568dd60ba8894849d1d64b Author: Paolo Bonzini Date: Tue Nov 16 05:11:10 2021 -0500 KVM: MMU: update comment on the number of page role combinations Fix the number of bits in the role, and simplify the explanation of why several bits or combinations of bits are redundant. Signed-off-by: Paolo Bonzini commit 6a93ea38217706ef8318efba672b960bcd5d0642 Author: Andy Shevchenko Date: Mon Dec 6 18:55:42 2021 +0200 can: hi311x: hi3110_can_probe(): convert to use dev_err_probe() When deferred the reason is saved for further debugging. Besides that, it's fine to call dev_err_probe() in ->probe() when error code is known. Convert the driver to use dev_err_probe(). Link: https://lore.kernel.org/all/20211206165542.69887-4-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Signed-off-by: Marc Kleine-Budde commit dc64d98aae758b41007f89179f3ec8686ef5136c Author: Andy Shevchenko Date: Mon Dec 6 18:55:41 2021 +0200 can: hi311x: hi3110_can_probe(): make use of device property API Make use of device property API in this driver so that both OF based system and ACPI based system can use this driver. Link: https://lore.kernel.org/all/20211206165542.69887-3-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Signed-off-by: Marc Kleine-Budde commit 3a1ae63a4d218d0d51646380fe406405660b9a5c Author: Andy Shevchenko Date: Mon Dec 6 18:55:40 2021 +0200 can: hi311x: hi3110_can_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/all/20211206165542.69887-2-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Signed-off-by: Marc Kleine-Budde commit 369cf4e6ac53f1595ef8602a8a984bce9b895ddb Author: Andy Shevchenko Date: Mon Dec 6 18:55:39 2021 +0200 can: hi311x: hi3110_can_probe(): use devm_clk_get_optional() to get the input clock It's not clear what was the intention of redundant usage of IS_ERR() around the clock pointer since with the error check of devm_clk_get() followed by bailout it can't be invalid, Simplify the code which fetches the input clock by using devm_clk_get_optional(). It will allow to switch to device properties approach in the future. Link: https://lore.kernel.org/all/20211206165542.69887-1-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Signed-off-by: Marc Kleine-Budde commit 671f852c1bee9bd7138a5c4ad2c88d379cd0a6cb Author: Evgeny Boger Date: Mon Nov 22 13:46:16 2021 +0300 ARM: dts: sun8i: r40: add node for CAN controller Allwinner R40 (also known as A40i, T3, V40) has a CAN controller. The controller is the same as in earlier A10 and A20 SoCs, but needs reset line to be deasserted before use. This patch adds a CAN node and the corresponding pinctrl descriptions. Link: https://lore.kernel.org/all/20211122104616.537156-4-boger@wirenboard.com Signed-off-by: Evgeny Boger Signed-off-by: Marc Kleine-Budde commit 2c2fd0e68d9e1832d7661f434ee7ddd77bf1b985 Author: Evgeny Boger Date: Mon Nov 22 13:46:15 2021 +0300 can: sun4i_can: add support for R40 CAN controller Allwinner R40 (also known as A40i, T3, V40) has a CAN controller. The controller is the same as in earlier A10 and A20 SoCs, but needs reset line to be deasserted before use. This patch adds a new compatible for R40 CAN controller. Depending on the compatible, reset line can be requested from DT. Link: https://lore.kernel.org/all/20211122104616.537156-3-boger@wirenboard.com Signed-off-by: Evgeny Boger Signed-off-by: Marc Kleine-Budde commit d0342ceb78ed86b8ed28afe14d070720667da70f Author: Evgeny Boger Date: Mon Nov 22 13:46:14 2021 +0300 dt-bindings: net: can: add support for Allwinner R40 CAN controller Allwinner R40 (also known as A40i, T3, V40) has a CAN controller. The controller is the same as in earlier A10 and A20 SoCs, but needs reset line to be deasserted before use. This patch Introduces new compatible for R40 CAN controller with required resets property. Link: https://lore.kernel.org/all/20211122104616.537156-2-boger@wirenboard.com Signed-off-by: Evgeny Boger Reviewed-by: Rob Herring Signed-off-by: Marc Kleine-Budde commit 330c6d3bfa268794bf692165d0f781f1c2d4d83e Author: Vincent Mailhol Date: Wed Nov 24 10:45:36 2021 +0900 can: bittiming: replace CAN units with the generic ones from linux/units.h In [1], we introduced a set of units in linux/can/bittiming.h. Since then, generic SI prefixes were added to linux/units.h in [2]. Those new prefixes can perfectly replace CAN specific ones. This patch replaces all occurrences of the CAN units with their corresponding prefix (from linux/units) and the unit (as a comment) according to below table. CAN units SI metric prefix (from linux/units) + unit (as a comment) ------------------------------------------------------------------------ CAN_KBPS KILO /* BPS */ CAN_MBPS MEGA /* BPS */ CAM_MHZ MEGA /* Hz */ The definition are then removed from linux/can/bittiming.h [1] commit 1d7750760b70 ("can: bittiming: add CAN_KBPS, CAN_MBPS and CAN_MHZ macros") [2] commit 26471d4a6cf8 ("units: Add SI metric prefix definitions") Link: https://lore.kernel.org/all/20211124014536.782550-1-mailhol.vincent@wanadoo.fr Suggested-by: Jimmy Assarsson Suggested-by: Oliver Hartkopp Signed-off-by: Vincent Mailhol Signed-off-by: Marc Kleine-Budde commit f0b62b0bbedcdfde18116080605cebd9beec4ee9 Author: Biju Das Date: Fri Dec 3 11:51:51 2021 +0000 clk: renesas: r9a07g044: Add GPU clock and reset entries Add GPU clock and reset entries to CPG driver. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211203115154.31864-4-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 7ef9c45a23a9071dee23ca1a769c53ec2cdc07c0 Author: Biju Das Date: Fri Dec 3 11:51:50 2021 +0000 clk: renesas: r9a07g044: Add mux and divider for G clock G clock is sourced from PLL3 and PLL6. The output of the mux is connected to divider. This patch adds a mux and divider for getting different rates from this clock sources. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211203115154.31864-3-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 98ee8b2f66ebff2fafe85668b9d00c3433b76566 Author: Biju Das Date: Fri Dec 3 11:51:49 2021 +0000 clk: renesas: r9a07g044: Rename CLK_PLL3_DIV4 macro Rename the macro CLK_PLL3_DIV4->CLK_PLL3_DIV2_2 to match the clock tree mentioned in the hardware manual(Rev.1.00 Sep, 2021). Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211203115154.31864-2-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 24aaff6a6ce4c4defd18147f5078223a96283fd7 Author: Yoshihiro Shimoda Date: Wed Dec 1 16:33:03 2021 +0900 clk: renesas: cpg-mssr: Add support for R-Car S4-8 Initial CPG support for R-Car S4-8 (r8a779f0). Inspired by patches in the BSP by LUU HOAI. Signed-off-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20211201073308.1003945-10-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Geert Uytterhoeven commit 39cf7dd21d53e15310018da5f31a0171566f0c58 Merge: 470e3f0d0b152 81c1655823237 Author: Geert Uytterhoeven Date: Wed Dec 8 10:05:50 2021 +0100 Merge tag 'renesas-r8a779f0-dt-binding-defs-tag' into HEAD Renesas R-Car S4-8 DT Binding Definitions Clock and Power Domain definitions for the Renesas R-Car S4-8 (R8A77FA0) SoC, shared by driver and DT source files. commit 470e3f0d0b1529abf9759c93e23ac8dd678e0e70 Author: Yoshihiro Shimoda Date: Wed Dec 1 16:33:02 2021 +0900 clk: renesas: rcar-gen4: Introduce R-Car Gen4 CPG driver According to the official website [1], the R-Car V3U SoC is based on the R-Car Gen4 architecture. So, introduce R-Car Gen4 CPG driver. [1] https://www.renesas.com/us/en/products/automotive-products/automotive-system-chips-socs/r-car-v3u-best-class-r-car-v3u-asil-d-system-chip-automated-driving Signed-off-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20211201073308.1003945-9-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Geert Uytterhoeven commit 5a10537cbfc5f1a9b7f0619b37c13de7be8c8f53 Author: Wen Gong Date: Mon Oct 25 22:59:02 2021 -0400 ath10k: fix scan abort when duration is set for hw scan When request scan with duration 120ms on channel 1, it failed with scan abort easily. Because scan_timeout is set to 130ms for the scan in ath10k_hw_scan(), and timed out before scan complete, so lead scan abort. failed log of ath10k: 2021-04-14T14:43:29.936058Z DEBUG kernel: [67384.594846] ath10k_sdio mmc1:0001:1: wmi tlv start scan 2021-04-14T14:43:29.937896Z DEBUG kernel: [67384.595820] ath10k_sdio mmc1:0001:1: scan event started type 1 reason 7 freq 2437 req_id 40961 scan_id 40960 vdev_id 0 state starting (1) 2021-04-14T14:43:29.938357Z DEBUG kernel: [67384.596761] ath10k_sdio mmc1:0001:1: scan event bss channel type 4 reason 7 freq 2437 req_id 40961 scan_id 40960 vdev_id 0 state running (2) 2021-04-14T14:43:29.992497Z DEBUG kernel: [67384.651013] ath10k_sdio mmc1:0001:1: scan event foreign channel type 8 reason 7 freq 2412 req_id 40961 scan_id 40960 vdev_id 0 state running (2) 2021-04-14T14:43:30.063530Z DEBUG kernel: [67384.722139] ath10k_sdio mmc1:0001:1: wmi tlv stop scan 2021-04-14T14:43:30.066592Z DEBUG kernel: [67384.724403] ath10k_sdio mmc1:0001:1: scan event completed [cancelled] type 2 reason 1 freq 2412 req_id 40961 scan_id 40960 vdev_id 0 state aborting (3) failed log of wpa_supplicant: 2021-04-14T14:43:29.981842Z DEBUG wpa_supplicant[887]: wlan0: nl80211: scan request 2021-04-14T14:43:29.981988Z DEBUG wpa_supplicant[887]: nl80211: Passive scan requested 2021-04-14T14:43:29.982202Z DEBUG wpa_supplicant[887]: nl80211: Add NL80211_SCAN_FLAG_FLUSH 2021-04-14T14:43:29.982339Z DEBUG wpa_supplicant[887]: Scan requested (ret=0) - scan timeout 30 seconds 2021-04-14T14:43:29.982491Z DEBUG wpa_supplicant[887]: nl80211: Drv Event 33 (NL80211_CMD_TRIGGER_SCAN) received for wlan0 2021-04-14T14:43:29.982629Z DEBUG wpa_supplicant[887]: wlan0: nl80211: Scan trigger 2021-04-14T14:43:29.982779Z DEBUG wpa_supplicant[887]: wlan0: Event SCAN_STARTED (47) received 2021-04-14T14:43:29.982920Z DEBUG wpa_supplicant[887]: wlan0: Own scan request started a scan in 0.000175 seconds 2021-04-14T14:43:30.082401Z DEBUG wpa_supplicant[887]: nl80211: Drv Event 35 (NL80211_CMD_SCAN_ABORTED) received for wlan0 2021-04-14T14:43:30.082704Z DEBUG wpa_supplicant[887]: wlan0: nl80211: Scan aborted 2021-04-14T14:43:30.082905Z DEBUG wpa_supplicant[887]: nl80211: Scan included frequencies: 2412 2021-04-14T14:43:30.083123Z DEBUG wpa_supplicant[887]: wlan0: Event SCAN_RESULTS (3) received 2021-04-14T14:43:30.083310Z DEBUG wpa_supplicant[887]: wlan0: Scan completed in 0.128655 seconds This is to increase the scan_timeout with 200ms for this situation, then scan will not timed out for this situation. Tested-on: QCA6174 hw3.2 SDIO WLAN.RMH.4.4.1-00049 Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211026025902.26621-1-quic_wgong@quicinc.com commit e8a91863eba3966a447d2daa1526082d52b5db2a Author: Sebastian Gottschall Date: Wed May 5 15:58:06 2021 +0700 ath10k: Fix tx hanging While running stress tests in roaming scenarios (switching ap's every 5 seconds, we discovered a issue which leads to tx hangings of exactly 5 seconds while or after scanning for new accesspoints. We found out that this hanging is triggered by ath10k_mac_wait_tx_complete since the empty_tx_wq was not wake when the num_tx_pending counter reaches zero. To fix this, we simply move the wake_up call to htt_tx_dec_pending, since this call was missed on several locations within the ath10k code. Signed-off-by: Sebastian Gottschall Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210505085806.11474-1-s.gottschall@dd-wrt.com commit dec05cdf78af93d5bf338171aa3bc3e1755f3f4c Author: Peter Oh Date: Wed Sep 15 11:56:11 2021 -0700 ath: regdom: extend South Korea regulatory domain support South Korea manufacturer, Samsung, has extended South Korea regulatory domain pair with 0x5F and has used it for their devices such as Samsung Galaxy book. Hence add support 0x5F as a regulatory domain pair along with extended country code, 413. Signed-off-by: Peter Oh Signed-off-by: Andreas Tepe Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210915185611.6195-1-ebmajor.dev@gmail.com commit dddaa64d0af37275314a656bd8f8e941799e2d61 Author: Wen Gong Date: Thu Dec 2 01:37:05 2021 -0500 ath11k: add wait operation for tx management packets for flush from mac80211 In ath11k, tx of management packet is doing in a work queue. Sometimes the workqueue does not finish tx immediately, then it lead after the next step of vdev delete finished, it start to send the management packet to firmware and lead firmware crash. ieee80211_set_disassoc() have logic of ieee80211_flush_queues() after it send_deauth_disassoc() to ath11k, its purpose is make sure the deauth was actually sent, so it need to change ath11k to match the purpose of mac80211. To address these issue wait for tx mgmt as well as tx data packets. dmesg log of connect/disconnect to AP: [ 307.522226] wls1: authenticate with 62:66:e4:e9:6a:a9 [ 307.586565] wls1: send auth to 62:66:e4:e9:6a:a9 (try 1/3) [ 307.586581] ath11k_pci 0000:05:00.0: mac tx mgmt frame, buf id 0 [ 307.586922] ath11k_pci 0000:05:00.0: mac tx mgmt frame, vdev_id 0 [ 307.590179] ath11k_pci 0000:05:00.0: wmi mgmt tx comp pending 0 desc id 0 [ 307.590181] ath11k_pci 0000:05:00.0: mgmt tx compl ev pdev_id 2, desc_id 0, status 0 [ 307.598699] wls1: authenticated [ 307.599483] wls1: associate with 62:66:e4:e9:6a:a9 (try 1/3) [ 307.599506] ath11k_pci 0000:05:00.0: mac tx mgmt frame, buf id 0 [ 307.599519] ath11k_pci 0000:05:00.0: mac tx mgmt frame, vdev_id 0 [ 307.603059] ath11k_pci 0000:05:00.0: wmi mgmt tx comp pending 0 desc id 0 [ 307.603063] ath11k_pci 0000:05:00.0: mgmt tx compl ev pdev_id 2, desc_id 0, status 0 [ 307.637105] wls1: associated [ 317.365239] wls1: deauthenticating from 62:66:e4:e9:6a:a9 by local choice (Reason: 3=DEAUTH_LEAVING) [ 317.368104] ath11k_pci 0000:05:00.0: mac tx mgmt frame, buf id 0 [ 317.372622] ath11k_pci 0000:05:00.0: mac tx mgmt frame, vdev_id 0 [ 317.378320] ath11k_pci 0000:05:00.0: wmi mgmt tx comp pending 0 desc id 0 [ 317.378330] ath11k_pci 0000:05:00.0: mgmt tx compl ev pdev_id 2, desc_id 0, status 0 [ 317.378359] ath11k_pci 0000:05:00.0: mac mgmt tx flush mgmt pending 0 [ 317.421066] ath11k_pci 0000:05:00.0: mac mgmt tx flush mgmt pending 0 [ 317.421427] ath11k_pci 0000:05:00.0: mac remove interface (vdev 0) Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01230-QCAHSTSWPLZ_V2_TO_X86-1 Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211202063705.14321-1-quic_wgong@quicinc.com commit 6273c97296a8e4936571bde5153bc0398fae087c Author: Christophe JAILLET Date: Wed Dec 1 23:05:15 2021 +0100 carl9170: Use the bitmap API when applicable Use 'bitmap_zalloc()' to simplify code, improve the semantic and avoid some open-coded arithmetic in allocator arguments. Note, that this 'bitmap_zalloc()' divides by BITS_PER_LONG the amount of memory allocated. The 'roundup()' used to computed the number of needed long should have been a DIV_ROUND_UP. Also change the corresponding 'kfree()' into 'bitmap_free()' to keep consistency. Use 'bitmap_zero()' to avoid hand writing it. Signed-off-by: Christophe JAILLET Acked-by: Christian Lamparter Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1fe18fb73f71d855043c40c83865ad539f326478.1638396221.git.christophe.jaillet@wanadoo.fr commit 09cab4308bf9b8076ee4a3c56015daf9ef9cb23e Author: Loic Poulain Date: Thu Dec 2 10:02:12 2021 +0100 wcn36xx: Fix max channels retrieval Kernel test robot reported:drivers/net/wireless/ath/wcn36xx/smd.c:943:33: sparse: sparse: cast truncates bits from constant value (780 becomes 80) The 'channels' field is not a simple u8 array but an array of channel_params. Using sizeof for retrieving the max number of channels is then wrong. In practice, it was not an issue, because the sizeof returned value is 780, which is truncated in min_t (u8) to 80, which is the value we expect... Fix that properly using ARRAY_SIZE instead of sizeof. Fixes: d707f812bb05 ("wcn36xx: Channel list update before hardware scan") Reported-by: kernel test robot Signed-off-by: Loic Poulain Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1638435732-14657-1-git-send-email-loic.poulain@linaro.org commit 9dcf6808b253a72b2c90eed179863bf5fab7d68c Author: Wen Gong Date: Tue Dec 7 17:23:36 2021 +0200 ath11k: add 11d scan offload support Add handler for WMI_11D_NEW_COUNTRY_EVENTID, WMI_11D_SCAN_START_CMDID, WMI_11D_SCAN_STOP_CMDID. After vdev create for STATION, send WMI_11D_SCAN_START_CMDID to firmware and wait firmware complete it, the scan from mac80211 also need to wait the 11d scan finished, and send WMI_11D_SCAN_STOP_CMDID to firmware before vdev delete for STATION. Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01230-QCAHSTSWPLZ_V2_TO_X86-1 Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211201071745.17746-4-quic_wgong@quicinc.com commit 0b05ddad8e4bd56bda42b9dc491c1b127720f063 Author: Wen Gong Date: Tue Dec 7 17:23:36 2021 +0200 ath11k: add configure country code for QCA6390 and WCN6855 Add handler to send WMI_SET_CURRENT_COUNTRY_CMDID to firmware which is used for QCA6390 and WCN6855. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211201071745.17746-3-quic_wgong@quicinc.com commit ed05c7cf1286d7e31e7623bce55ff135723591bf Author: Wen Gong Date: Tue Dec 7 17:23:36 2021 +0200 ath11k: avoid deadlock by change ieee80211_queue_work for regd_update_work When enable debug config, it print below warning while shut down wlan interface shuh as run "ifconfig wlan0 down". The reason is because ar->regd_update_work is ran once, and it is will call wiphy_lock(ar->hw->wiphy) in function ath11k_regd_update() which is running in workqueue of ieee80211_local queued by ieee80211_queue_work(). Another thread from "ifconfig wlan0 down" will also accuqire the lock by wiphy_lock(sdata->local->hw.wiphy) in function ieee80211_stop(), and then it call ieee80211_stop_device() to flush_workqueue(local->workqueue), this will wait the workqueue of ieee80211_local finished. Then deadlock will happen easily if the two thread run meanwhile. Below warning disappeared after this change. [ 914.088798] ath11k_pci 0000:05:00.0: mac remove interface (vdev 0) [ 914.088806] ath11k_pci 0000:05:00.0: mac stop 11d scan [ 914.088810] ath11k_pci 0000:05:00.0: mac stop 11d vdev id 0 [ 914.088827] ath11k_pci 0000:05:00.0: htc ep 2 consumed 1 credits (total 0) [ 914.088841] ath11k_pci 0000:05:00.0: send 11d scan stop vdev id 0 [ 914.088849] ath11k_pci 0000:05:00.0: htc insufficient credits ep 2 required 1 available 0 [ 914.088856] ath11k_pci 0000:05:00.0: htc insufficient credits ep 2 required 1 available 0 [ 914.096434] ath11k_pci 0000:05:00.0: rx ce pipe 2 len 16 [ 914.096442] ath11k_pci 0000:05:00.0: htc ep 2 got 1 credits (total 1) [ 914.096481] ath11k_pci 0000:05:00.0: htc ep 2 consumed 1 credits (total 0) [ 914.096491] ath11k_pci 0000:05:00.0: WMI vdev delete id 0 [ 914.111598] ath11k_pci 0000:05:00.0: rx ce pipe 2 len 16 [ 914.111628] ath11k_pci 0000:05:00.0: htc ep 2 got 1 credits (total 1) [ 914.114659] ath11k_pci 0000:05:00.0: rx ce pipe 2 len 20 [ 914.114742] ath11k_pci 0000:05:00.0: htc rx completion ep 2 skb pK-error [ 914.115977] ath11k_pci 0000:05:00.0: vdev delete resp for vdev id 0 [ 914.116685] ath11k_pci 0000:05:00.0: vdev 00:03:7f:29:61:11 deleted, vdev_id 0 [ 914.117583] ====================================================== [ 914.117592] WARNING: possible circular locking dependency detected [ 914.117600] 5.16.0-rc1-wt-ath+ #1 Tainted: G OE [ 914.117611] ------------------------------------------------------ [ 914.117618] ifconfig/2805 is trying to acquire lock: [ 914.117628] ffff9c00a62bb548 ((wq_completion)phy0){+.+.}-{0:0}, at: flush_workqueue+0x87/0x470 [ 914.117674] but task is already holding lock: [ 914.117682] ffff9c00baea07d0 (&rdev->wiphy.mtx){+.+.}-{4:4}, at: ieee80211_stop+0x38/0x180 [mac80211] [ 914.117872] which lock already depends on the new lock. [ 914.117880] the existing dependency chain (in reverse order) is: [ 914.117888] -> #3 (&rdev->wiphy.mtx){+.+.}-{4:4}: [ 914.117910] __mutex_lock+0xa0/0x9c0 [ 914.117930] mutex_lock_nested+0x1b/0x20 [ 914.117944] reg_process_self_managed_hints+0x3a/0xb0 [cfg80211] [ 914.118093] wiphy_regulatory_register+0x47/0x80 [cfg80211] [ 914.118229] wiphy_register+0x84f/0x9c0 [cfg80211] [ 914.118353] ieee80211_register_hw+0x6b1/0xd90 [mac80211] [ 914.118486] ath11k_mac_register+0x6af/0xb60 [ath11k] [ 914.118550] ath11k_core_qmi_firmware_ready+0x383/0x4a0 [ath11k] [ 914.118598] ath11k_qmi_driver_event_work+0x347/0x4a0 [ath11k] [ 914.118656] process_one_work+0x228/0x670 [ 914.118669] worker_thread+0x4d/0x440 [ 914.118680] kthread+0x16d/0x1b0 [ 914.118697] ret_from_fork+0x22/0x30 [ 914.118714] -> #2 (rtnl_mutex){+.+.}-{4:4}: [ 914.118736] __mutex_lock+0xa0/0x9c0 [ 914.118751] mutex_lock_nested+0x1b/0x20 [ 914.118767] rtnl_lock+0x17/0x20 [ 914.118783] ath11k_regd_update+0x15a/0x260 [ath11k] [ 914.118841] ath11k_regd_update_work+0x15/0x20 [ath11k] [ 914.118897] process_one_work+0x228/0x670 [ 914.118909] worker_thread+0x4d/0x440 [ 914.118920] kthread+0x16d/0x1b0 [ 914.118934] ret_from_fork+0x22/0x30 [ 914.118948] -> #1 ((work_completion)(&ar->regd_update_work)){+.+.}-{0:0}: [ 914.118972] process_one_work+0x1fa/0x670 [ 914.118984] worker_thread+0x4d/0x440 [ 914.118996] kthread+0x16d/0x1b0 [ 914.119010] ret_from_fork+0x22/0x30 [ 914.119023] -> #0 ((wq_completion)phy0){+.+.}-{0:0}: [ 914.119045] __lock_acquire+0x146d/0x1cf0 [ 914.119057] lock_acquire+0x19b/0x360 [ 914.119067] flush_workqueue+0xae/0x470 [ 914.119084] ieee80211_stop_device+0x3b/0x50 [mac80211] [ 914.119260] ieee80211_do_stop+0x5d7/0x830 [mac80211] [ 914.119409] ieee80211_stop+0x45/0x180 [mac80211] [ 914.119557] __dev_close_many+0xb3/0x120 [ 914.119573] __dev_change_flags+0xc3/0x1d0 [ 914.119590] dev_change_flags+0x29/0x70 [ 914.119605] devinet_ioctl+0x653/0x810 [ 914.119620] inet_ioctl+0x193/0x1e0 [ 914.119631] sock_do_ioctl+0x4d/0xf0 [ 914.119649] sock_ioctl+0x262/0x340 [ 914.119665] __x64_sys_ioctl+0x96/0xd0 [ 914.119678] do_syscall_64+0x3d/0xd0 [ 914.119694] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 914.119709] other info that might help us debug this: [ 914.119717] Chain exists of: (wq_completion)phy0 --> rtnl_mutex --> &rdev->wiphy.mtx [ 914.119745] Possible unsafe locking scenario: [ 914.119752] CPU0 CPU1 [ 914.119758] ---- ---- [ 914.119765] lock(&rdev->wiphy.mtx); [ 914.119778] lock(rtnl_mutex); [ 914.119792] lock(&rdev->wiphy.mtx); [ 914.119807] lock((wq_completion)phy0); [ 914.119819] *** DEADLOCK *** [ 914.119827] 2 locks held by ifconfig/2805: [ 914.119837] #0: ffffffffba3dc010 (rtnl_mutex){+.+.}-{4:4}, at: rtnl_lock+0x17/0x20 [ 914.119872] #1: ffff9c00baea07d0 (&rdev->wiphy.mtx){+.+.}-{4:4}, at: ieee80211_stop+0x38/0x180 [mac80211] [ 914.120039] stack backtrace: [ 914.120048] CPU: 0 PID: 2805 Comm: ifconfig Tainted: G OE 5.16.0-rc1-wt-ath+ #1 [ 914.120064] Hardware name: LENOVO 418065C/418065C, BIOS 83ET63WW (1.33 ) 07/29/2011 [ 914.120074] Call Trace: [ 914.120084] [ 914.120094] dump_stack_lvl+0x73/0xa4 [ 914.120119] dump_stack+0x10/0x12 [ 914.120135] print_circular_bug.isra.44+0x221/0x2e0 [ 914.120165] check_noncircular+0x106/0x150 [ 914.120203] __lock_acquire+0x146d/0x1cf0 [ 914.120215] ? __lock_acquire+0x146d/0x1cf0 [ 914.120245] lock_acquire+0x19b/0x360 [ 914.120259] ? flush_workqueue+0x87/0x470 [ 914.120286] ? lockdep_init_map_type+0x6b/0x250 [ 914.120310] flush_workqueue+0xae/0x470 [ 914.120327] ? flush_workqueue+0x87/0x470 [ 914.120344] ? lockdep_hardirqs_on+0xd7/0x150 [ 914.120391] ieee80211_stop_device+0x3b/0x50 [mac80211] [ 914.120565] ? ieee80211_stop_device+0x3b/0x50 [mac80211] [ 914.120736] ieee80211_do_stop+0x5d7/0x830 [mac80211] [ 914.120906] ieee80211_stop+0x45/0x180 [mac80211] [ 914.121060] __dev_close_many+0xb3/0x120 [ 914.121081] __dev_change_flags+0xc3/0x1d0 [ 914.121109] dev_change_flags+0x29/0x70 [ 914.121131] devinet_ioctl+0x653/0x810 [ 914.121149] ? __might_fault+0x77/0x80 [ 914.121179] inet_ioctl+0x193/0x1e0 [ 914.121194] ? inet_ioctl+0x193/0x1e0 [ 914.121218] ? __might_fault+0x77/0x80 [ 914.121238] ? _copy_to_user+0x68/0x80 [ 914.121266] sock_do_ioctl+0x4d/0xf0 [ 914.121283] ? inet_stream_connect+0x60/0x60 [ 914.121297] ? sock_do_ioctl+0x4d/0xf0 [ 914.121329] sock_ioctl+0x262/0x340 [ 914.121347] ? sock_ioctl+0x262/0x340 [ 914.121362] ? exit_to_user_mode_prepare+0x13b/0x280 [ 914.121388] ? syscall_enter_from_user_mode+0x20/0x50 [ 914.121416] __x64_sys_ioctl+0x96/0xd0 [ 914.121430] ? br_ioctl_call+0x90/0x90 [ 914.121445] ? __x64_sys_ioctl+0x96/0xd0 [ 914.121465] do_syscall_64+0x3d/0xd0 [ 914.121482] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 914.121497] RIP: 0033:0x7f0ed051737b [ 914.121513] Code: 0f 1e fa 48 8b 05 15 3b 0d 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 e5 3a 0d 00 f7 d8 64 89 01 48 [ 914.121527] RSP: 002b:00007fff7be38b98 EFLAGS: 00000202 ORIG_RAX: 0000000000000010 [ 914.121544] RAX: ffffffffffffffda RBX: 00007fff7be38ba0 RCX: 00007f0ed051737b [ 914.121555] RDX: 00007fff7be38ba0 RSI: 0000000000008914 RDI: 0000000000000004 [ 914.121566] RBP: 00007fff7be38c60 R08: 000000000000000a R09: 0000000000000001 [ 914.121576] R10: 0000000000000000 R11: 0000000000000202 R12: 00000000fffffffe [ 914.121586] R13: 0000000000000004 R14: 0000000000000000 R15: 0000000000000000 [ 914.121620] Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211201071745.17746-2-quic_wgong@quicinc.com commit d6c75c295f67b26fad8ba2e72db80e0f744e9da9 Author: Arnd Bergmann Date: Sun Dec 5 14:15:56 2021 +0100 omapdrm: dss: mark runtime PM functions __maybe_unused Using the SET_RUNTIME_PM_OPS() macro causes a warning about the referenced functions when they are marked static but not __maybe_unused: drivers/gpu/drm/omapdrm/dss/dss.c:1572:12: error: unused function 'dss_runtime_suspend' [-Werror,-Wunused-function] drivers/gpu/drm/omapdrm/dss/dss.c:1584:12: error: unused function 'dss_runtime_resume' [-Werror,-Wunused-function] drivers/gpu/drm/omapdrm/dss/dispc.c:4845:12: error: unused function 'dispc_runtime_suspend' [-Werror,-Wunused-function] drivers/gpu/drm/omapdrm/dss/dispc.c:4860:12: error: unused function 'dispc_runtime_resume' [-Werror,-Wunused-function] Fixes: b92f7ea556f8 ("drm/omap: dss: Make use of the helper macro SET_RUNTIME_PM_OPS()") Signed-off-by: Arnd Bergmann Reviewed-by: Laurent Pinchart Reviewed-by: Tomi Valkeinen Signed-off-by: Tomi Valkeinen Link: https://patchwork.freedesktop.org/patch/msgid/20211205131612.3192652-1-arnd@kernel.org commit e02b5cc9e898ad6f223a69df63397beae60390ff Author: Benoit Parrot Date: Wed Nov 17 15:19:28 2021 +0100 drm/omap: Add a 'right overlay' to plane state If the drm_plane has a source width that's greater than the max width supported by a single hw overlay, then we assign a 'r_overlay' to it in omap_plane_atomic_check(). Both overlays should have the capabilities required to handle the source framebuffer. The only parameters that vary between the left and right hwoverlays are the src_w, crtc_w, src_x and crtc_x as we just even chop the fb into left and right halves. We also take care of not creating odd width size when dealing with YUV formats. Since both halves need to be 'appear' side by side the zpos is recalculated when dealing with dual overlay cases so that the other planes zpos is consistent. Depending on user space usage it is possible that on occasion the number of requested planes exceeds the numbers of overlays required to display them. In that case a failure would be returned for the plane that cannot be handled at that time. It is up to user space to make sure the H/W resource are not over-subscribed. Signed-off-by: Benoit Parrot Signed-off-by: Neil Armstrong Reviewed-by: Tomi Valkeinen Signed-off-by: Tomi Valkeinen Link: https://patchwork.freedesktop.org/patch/msgid/20211117141928.771082-10-narmstrong@baylibre.com commit 19e2d2669dacfd3783b6f948bf06a109a7cd668d Author: Benoit Parrot Date: Wed Nov 17 15:19:27 2021 +0100 drm/omap: add plane_atomic_print_state support Now that we added specific item to our subclassed drm_plane_state we can add omap_plane_atomic_print_state() helper to dump out our own driver specific plane state. Signed-off-by: Benoit Parrot Signed-off-by: Neil Armstrong Reviewed-by: Tomi Valkeinen Signed-off-by: Tomi Valkeinen Link: https://patchwork.freedesktop.org/patch/msgid/20211117141928.771082-9-narmstrong@baylibre.com commit 2e54ff0e5430883f2040450e9297ebad9f56f846 Author: Benoit Parrot Date: Wed Nov 17 15:19:26 2021 +0100 drm/omap: dynamically assign hw overlays to planes (re)assign the hw overlays to planes based on required caps, and to handle situations where we could not modify an in-use plane. This means all planes advertise the superset of formats and properties. Userspace must (as always) use atomic TEST_ONLY step for atomic updates, as not all planes may be available for use on every frame. The mapping of hwoverlays to plane is stored in omap_global_state, so that state updates are atomically committed in the same way that plane/etc state updates are managed. This is needed because the omap_plane_state keeps a pointer to the hwoverlay, and we don't want global state to become out of sync with the plane state if an atomic update fails, we hit deadlock/ backoff scenario, etc. The use of global_state_lock keeps multiple parallel updates which both re-assign hwoverlays properly serialized. Signed-off-by: Benoit Parrot Signed-off-by: Neil Armstrong Reviewed-by: Tomi Valkeinen Signed-off-by: Tomi Valkeinen Link: https://patchwork.freedesktop.org/patch/msgid/20211117141928.771082-8-narmstrong@baylibre.com commit 6e42201b0ed5d3af66c107144fcd96c17afbc6f1 Author: Benoit Parrot Date: Wed Nov 17 15:19:25 2021 +0100 drm/omap: Add global state as a private atomic object Global shared resources (like hw overlays) for omapdrm are implemented as a part of atomic state using the drm_private_obj infrastructure available in the atomic core. omap_global_state is introduced as a drm atomic private object. The two funcs omap_get_global_state() and omap_get_existing_global_state() are the two variants that will be used to access omap_global_state. drm_mode_config_init() needs to be called earlier because it creates/initializes the private_obj link list maintained by the atomic framework. The private_obj link list has to exist prior to calling drm_atomic_private_obj_init(). Similarly the cleanup handler are reordered appropriately. Signed-off-by: Benoit Parrot Signed-off-by: Neil Armstrong Reviewed-by: Tomi Valkeinen Signed-off-by: Tomi Valkeinen Link: https://patchwork.freedesktop.org/patch/msgid/20211117141928.771082-7-narmstrong@baylibre.com commit 3c265d928b85a0ec8aa4aea9aab89efd201bd2ae Author: Benoit Parrot Date: Wed Nov 17 15:19:24 2021 +0100 drm/omap: omap_plane: subclass drm_plane_state In preparation to add omap plane state specific extensions we need to subclass drm_plane_state and add the relevant helpers. The addition of specific extension will be done separately. Signed-off-by: Benoit Parrot Signed-off-by: Neil Armstrong Reviewed-by: Tomi Valkeinen Signed-off-by: Tomi Valkeinen Link: https://patchwork.freedesktop.org/patch/msgid/20211117141928.771082-6-narmstrong@baylibre.com commit c8fa1e733c597a7b11a22a3e49de5ea1362e9a7a Author: Benoit Parrot Date: Wed Nov 17 15:19:23 2021 +0100 drm/omap: introduce omap_hw_overlay Split out the hardware overlay specifics from omap_plane. To start, the hw overlays are statically assigned to planes. The goal is to eventually assign hw overlays dynamically to planes during plane->atomic_check() based on requested caps (scaling, YUV, etc). And then perform hw overlay re-assignment if required. Signed-off-by: Benoit Parrot Signed-off-by: Neil Armstrong Reviewed-by: Tomi Valkeinen Signed-off-by: Tomi Valkeinen Link: https://patchwork.freedesktop.org/patch/msgid/20211117141928.771082-5-narmstrong@baylibre.com commit 0b0f7282f0c81fcbbf300079eaeabd4dcef63c11 Author: Benoit Parrot Date: Wed Nov 17 15:19:22 2021 +0100 drm/omap: Add ovl checking funcs to dispc_ops In order to be able to dynamically assign overlays to planes we need to be able to asses the overlay capabilities. Add a helper function to be able to retrieve the supported capabilities of an overlay. And export the function to check if a fourcc is supported on a given overlay. Signed-off-by: Benoit Parrot Signed-off-by: Neil Armstrong Reviewed-by: Tomi Valkeinen Signed-off-by: Tomi Valkeinen Link: https://patchwork.freedesktop.org/patch/msgid/20211117141928.771082-4-narmstrong@baylibre.com commit d484c20d7cb971b036b075112c9b7e7946e1aa96 Author: Benoit Parrot Date: Wed Nov 17 15:19:21 2021 +0100 drm/omap: Add ability to check if requested plane modes can be supported We currently assume that an overlay has the same maximum width and maximum height as the overlay manager. This assumption is incorrect. On some variants the overlay manager maximum width is twice the maximum width that the overlay can handle. We need to add the appropriate data per variant as well as export a helper function to retrieve the data so check can be made dynamically in omap_plane_atomic_check(). Signed-off-by: Benoit Parrot Signed-off-by: Neil Armstrong Reviewed-by: Tomi Valkeinen Signed-off-by: Tomi Valkeinen Link: https://patchwork.freedesktop.org/patch/msgid/20211117141928.771082-3-narmstrong@baylibre.com commit c21134b042ef9eb1662fd856941f031eb76d77b1 Author: Neil Armstrong Date: Wed Nov 17 15:19:20 2021 +0100 drm/omap: add sanity plane state check Call drm_atomic_helper_check_plane_state() from the plane atomic_check() callback in order to add plane state sanity checking. It will permit filtering out totally bad scaling factors, even if the real check are done later in the atomic commit. Calling drm_atomic_helper_check_plane_state() also sets plane_state->visible which will be useful when dynamically assigning hw overlays to planes. Signed-off-by: Benoit Parrot Signed-off-by: Neil Armstrong Reviewed-by: Tomi Valkeinen Signed-off-by: Tomi Valkeinen Link: https://patchwork.freedesktop.org/patch/msgid/20211117141928.771082-2-narmstrong@baylibre.com commit fe4d0b6317e35a9a371d1107c9b753becc81e968 Author: Ivaylo Dimitrov Date: Fri Nov 19 10:06:20 2021 +0200 drm: omapdrm: Export correct scatterlist for TILER backed BOs Memory of BOs backed by TILER is not contiguous, but omap_gem_map_dma_buf() exports it like it is. This leads to (possibly) invalid memory accesses if another device imports such a BO. Fix that by providing sg that correctly describes TILER memory layout. Align TILER allocations to page, so importer to be able to correctly set its MMU if have one. Set export size accounting for the alignment. Also, make sure to destroy sg on unpin, as it is no longer valid. Tested on Motorola Droid4 by using GPU (sgx540) to render. Suggested-by: Matthijs van Duin Signed-off-by: Ivaylo Dimitrov Reviewed-by: Tomi Valkeinen Signed-off-by: Tomi Valkeinen Link: https://patchwork.freedesktop.org/patch/msgid/1637309180-31032-1-git-send-email-ivo.g.dimitrov.75@gmail.com commit 1fe5b01262844be03de98afdd56d1d393df04d7e Merge: c0e084e342a80 6dc490e80ca33 Author: Jakub Kicinski Date: Tue Dec 7 22:01:07 2021 -0800 Merge branch 's390-net-updates-2021-12-06' Alexandra Winter says: ==================== s390/net: updates 2021-12-06 This brings some maintenance improvements and removes some unnecessary code checks. ==================== Link: https://lore.kernel.org/r/20211207090452.1155688-1-wintera@linux.ibm.com Signed-off-by: Jakub Kicinski commit 6dc490e80ca33e4e49ed5b81df0ec9bfad6bf1b6 Author: Julian Wiedmann Date: Tue Dec 7 10:04:52 2021 +0100 s390/qeth: remove check for packing mode in qeth_check_outbound_queue() If qeth_check_outbound_queue() finds a partially filled TX buffer on the queue and flushes it, then the queue _must_ have been in packing mode. Remove the redundant check when updating the relevant statistics. Signed-off-by: Julian Wiedmann Reviewed-by: Alexandra Winter Signed-off-by: Alexandra Winter Signed-off-by: Jakub Kicinski commit 1b9e410f45bf68c068fa3422ca7b65ce4d08e5ed Author: Julian Wiedmann Date: Tue Dec 7 10:04:51 2021 +0100 s390/qeth: fine-tune .ndo_select_queue() Avoid a conditional branch for L2 devices when selecting the TX queue, and have shared logic for OSA devices. Signed-off-by: Julian Wiedmann Signed-off-by: Alexandra Winter Signed-off-by: Jakub Kicinski commit cdf8df5b42e7d9e2f6e660e672d42edb0514b862 Author: Julian Wiedmann Date: Tue Dec 7 10:04:50 2021 +0100 s390/qeth: don't offer .ndo_bridge_* ops for OSA devices qeth_l2_detect_dev2br_support() will only set brport_hw_features for IQD devices. So qeth_l2_bridge_getlink() and qeth_l2_bridge_setlink() will always return -EOPNOTSUPP on OSA devices. Just don't offer these callbacks instead. Signed-off-by: Julian Wiedmann Signed-off-by: Alexandra Winter Signed-off-by: Jakub Kicinski commit 2dbc7a1dde9e853b2a346fd811fec8cc45bce911 Author: Julian Wiedmann Date: Tue Dec 7 10:04:49 2021 +0100 s390/qeth: split up L2 netdev_ops Splitting up the netdev_ops allows for fine-tuning some of the ndo's in subsequent patches. Signed-off-by: Julian Wiedmann Reviewed-by: Wenjia Zhang Signed-off-by: Alexandra Winter Signed-off-by: Jakub Kicinski commit 5e9756a66fb5741f46b9c1d9ad50e4e57c8d6816 Author: Julian Wiedmann Date: Tue Dec 7 10:04:48 2021 +0100 s390/qeth: simplify qeth_receive_skb() Now that the OSN code is gone, we don't need the second switch statement in the RX path. And getting rid of its (unreachable) default case is a nice simplification. Also don't pass in the full HW header, all we still need is a flag to indicate whether the skb can use CSO. This we can already obtain during the first peek at the HW header. Signed-off-by: Julian Wiedmann Reviewed-by: Alexandra Winter Reviewed-by: Wenjia Zhang Signed-off-by: Alexandra Winter Signed-off-by: Jakub Kicinski commit c0e084e342a8046d06c4172b6ccb4db5d7633156 Author: Kees Cook Date: Mon Dec 6 22:32:17 2021 -0800 hv_sock: Extract hvs_send_data() helper that takes only header When building under -Warray-bounds, the compiler is especially conservative when faced with casts from a smaller object to a larger object. While this has found many real bugs, there are some cases that are currently false positives (like here). With this as one of the last few instances of the warning in the kernel before -Warray-bounds can be enabled globally, rearrange the functions so that there is a header-only version of hvs_send_data(). Silences this warning: net/vmw_vsock/hyperv_transport.c: In function 'hvs_shutdown_lock_held.constprop': net/vmw_vsock/hyperv_transport.c:231:32: warning: array subscript 'struct hvs_send_buf[0]' is partly outside array bounds of 'struct vmpipe_proto_header[1]' [-Warray-bounds] 231 | send_buf->hdr.pkt_type = 1; | ~~~~~~~~~~~~~~~~~~~~~~~^~~ net/vmw_vsock/hyperv_transport.c:465:36: note: while referencing 'hdr' 465 | struct vmpipe_proto_header hdr; | ^~~ This change results in no executable instruction differences. Signed-off-by: Kees Cook Acked-by: Wei Liu Link: https://lore.kernel.org/r/20211207063217.2591451-1-keescook@chromium.org Signed-off-by: Jakub Kicinski commit e44aecc709ad3945e152c120693127d468e6487c Author: Yihao Han Date: Mon Dec 6 22:44:18 2021 -0800 net: dsa: felix: use kmemdup() to replace kmalloc + memcpy Fix following coccicheck warning: /drivers/net/dsa/ocelot/felix_vsc9959.c:1627:13-20: WARNING opportunity for kmemdup /drivers/net/dsa/ocelot/felix_vsc9959.c:1506:16-23: WARNING opportunity for kmemdup Signed-off-by: Yihao Han Reviewed-by: Vladimir Oltean Link: https://lore.kernel.org/r/20211207064419.38632-1-hanyihao@vivo.com Signed-off-by: Jakub Kicinski commit d418f67e987fe8c8b2d34caf98ac0fb9f08c5dd5 Merge: 3c5290a2dcdbf 32ecd22ba60bb Author: Jakub Kicinski Date: Tue Dec 7 21:44:54 2021 -0800 Merge branch 'prepare-ocelot-for-external-interface-control' Colin Foster says: ==================== prepare ocelot for external interface control This patch set is derived from an attempt to include external control for a VSC751[1234] chip via SPI. That patch set has grown large and is getting unwieldy for reviewers and the developers... me. I'm breaking out the changes from that patch set. Some are trivial net: dsa: ocelot: remove unnecessary pci_bar variables net: dsa: ocelot: felix: Remove requirement for PCS in felix devices some are required for SPI net: dsa: ocelot: felix: add interface for custom regmaps and some are just to expose code to be shared net: mscc: ocelot: split register definitions to a separate file The entirety of this patch set should have essentially no impact on the system performance. ==================== Link: https://lore.kernel.org/r/20211207170030.1406601-1-colin.foster@in-advantage.com Signed-off-by: Jakub Kicinski commit 32ecd22ba60bbb724c6631d763ce77e5139bd341 Author: Colin Foster Date: Tue Dec 7 09:00:30 2021 -0800 net: mscc: ocelot: split register definitions to a separate file Move these to a separate file will allow them to be shared to other drivers. Signed-off-by: Colin Foster Reviewed-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: Jakub Kicinski commit 242bd0c10bbdcea4c8bfd1f40973d145dd4ae120 Author: Colin Foster Date: Tue Dec 7 09:00:29 2021 -0800 net: dsa: ocelot: felix: add interface for custom regmaps Add an interface so that non-mmio regmaps can be used Signed-off-by: Colin Foster Reviewed-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: Jakub Kicinski commit 49af6a7620c53b779572abfbfd7778e113154330 Author: Colin Foster Date: Tue Dec 7 09:00:28 2021 -0800 net: dsa: ocelot: felix: Remove requirement for PCS in felix devices Existing felix devices all have an initialized pcs array. Future devices might not, so running a NULL check on the array before dereferencing it will allow those future drivers to not crash at this point Signed-off-by: Colin Foster Reviewed-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: Jakub Kicinski commit c99104840a95db04e5d71b0810d3666aaa5b2798 Author: Colin Foster Date: Tue Dec 7 09:00:27 2021 -0800 net: dsa: ocelot: remove unnecessary pci_bar variables The pci_bar variables for the switch and imdio don't make sense for the generic felix driver. Moving them to felix_vsc9959 to limit scope and simplify the felix_info struct. Signed-off-by: Colin Foster Reviewed-by: Vladimir Oltean Reviewed-by: Florian Fainelli Signed-off-by: Jakub Kicinski commit 3c5290a2dcdbf078c46681445fd5527c1377875f Author: Colin Ian King Date: Mon Dec 6 09:12:07 2021 +0000 net: hns3: Fix spelling mistake "faile" -> "failed" There is a spelling mistake in a dev_err message. Fix it. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20211206091207.113648-1-colin.i.king@gmail.com Signed-off-by: Jakub Kicinski commit 150791442e7cef44c4328e04364eb44810157234 Merge: adc76fc97bd8b fe6db7eda9306 Author: Jakub Kicinski Date: Tue Dec 7 21:01:16 2021 -0800 Merge tag 'wireless-drivers-next-2021-12-07' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next Kalle Valo says: ==================== wireless-drivers-next patches for v5.17 First set of patches for v5.17. The biggest change is the iwlmei driver for Intel's AMT devices. Also now WCN6855 support in ath11k should be usable. Major changes: ath10k * fetch (pre-)calibration data via nvmem subsystem ath11k * enable 802.11 power save mode in station mode for qca6390 and wcn6855 * trace log support * proper board file detection for WCN6855 based on PCI ids * BSS color change support rtw88 * add debugfs file to force lowest basic rate * add quirk to disable PCI ASPM on HP 250 G7 Notebook PC mwifiex * add quirk to disable deep sleep with certain hardware revision in Surface Book 2 devices iwlwifi * add iwlmei driver for co-operating with Intel's Active Management Technology (AMT) devices * tag 'wireless-drivers-next-2021-12-07' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next: (87 commits) iwlwifi: mei: fix linking when tracing is not enabled rtlwifi: rtl8192de: Style clean-ups mwl8k: Use named struct for memcpy() region intersil: Use struct_group() for memcpy() region libertas_tf: Use struct_group() for memcpy() region libertas: Use struct_group() for memcpy() region wlcore: no need to initialise statics to false rsi: Fix out-of-bounds read in rsi_read_pkt() rsi: Fix use-after-free in rsi_rx_done_handler() brcmfmac: Configure keep-alive packet on suspend wilc1000: remove '-Wunused-but-set-variable' warning in chip_wakeup() iwlwifi: mvm: read the rfkill state and feed it to iwlmei iwlwifi: mvm: add vendor commands needed for iwlmei iwlwifi: integrate with iwlmei iwlwifi: mei: add debugfs hooks iwlwifi: mei: add the driver to allow cooperation with CSME mei: bus: add client dma interface mwifiex: Ignore BTCOEX events from the 88W8897 firmware mwifiex: Ensure the version string from the firmware is 0-terminated mwifiex: Add quirk to disable deep sleep with certain hardware revision ... ==================== Link: https://lore.kernel.org/r/20211207144211.A9949C341C1@smtp.kernel.org Signed-off-by: Jakub Kicinski commit adc76fc97bd8bd7236c57569650bbe6f9c2be024 Merge: 59d58d93af94d ada066b2e02ca Author: Jakub Kicinski Date: Tue Dec 7 20:45:10 2021 -0800 Merge branch 'net-second-round-of-netdevice-refcount-tracking' Eric Dumazet says: ==================== net: second round of netdevice refcount tracking The most interesting part of this series is probably ("inet: add net device refcount tracker to struct fib_nh_common") but only future reports will confirm this guess. ==================== Link: https://lore.kernel.org/r/20211207013039.1868645-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit ada066b2e02cad7934e86e51985078d707c64250 Author: Eric Dumazet Date: Mon Dec 6 17:30:39 2021 -0800 net: sched: act_mirred: add net device refcount tracker Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit e7c8ab8419d7a06bad7cb0b0289b5426029ac221 Author: Eric Dumazet Date: Mon Dec 6 17:30:38 2021 -0800 openvswitch: add net device refcount tracker to struct vport Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit e4b8954074f6d0db01c8c97d338a67f9389c042f Author: Eric Dumazet Date: Mon Dec 6 17:30:37 2021 -0800 netlink: add net device refcount tracker to struct ethnl_req_info Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit b60645248af3b2485c7695f04e5ecfbc129eb1f7 Author: Eric Dumazet Date: Mon Dec 6 17:30:36 2021 -0800 net/smc: add net device tracker to struct smc_pnetentry Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 035f1f2b96ae81a1490674b8cc5ac2b59fb2c808 Author: Eric Dumazet Date: Mon Dec 6 17:30:35 2021 -0800 pktgen add net device refcount tracker Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 615d069dcf1207462ce30c05a2f47d461be8f6c8 Author: Eric Dumazet Date: Mon Dec 6 17:30:34 2021 -0800 llc: add net device refcount tracker Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 66ce07f7802b68616a008d390f2e6783d68fb79f Author: Eric Dumazet Date: Mon Dec 6 17:30:33 2021 -0800 ax25: add net device refcount tracker Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit e44b14ebae1025cff3bef2d78a2e2f6869cefca0 Author: Eric Dumazet Date: Mon Dec 6 17:30:32 2021 -0800 inet: add net device refcount tracker to struct fib_nh_common Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 4fc003fe0313276f0d4ea996ab9b4acd9a5a5e93 Author: Eric Dumazet Date: Mon Dec 6 17:30:31 2021 -0800 net: switchdev: add net device refcount tracker Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit f12bf6f3f942b37de65eeea8be25903587fec930 Author: Eric Dumazet Date: Mon Dec 6 17:30:30 2021 -0800 net: watchdog: add net device refcount tracker Add a netdevice_tracker inside struct net_device, to track the self reference when a device has an active watchdog timer. Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit b2dcdc7f731dfd8957ee2ca8be6c5d83bd0d95e3 Author: Eric Dumazet Date: Mon Dec 6 17:30:29 2021 -0800 net: bridge: add net device refcount tracker Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 19c9ebf6ed70856385296a65e78c1699081b152f Author: Eric Dumazet Date: Mon Dec 6 17:30:28 2021 -0800 vlan: add net device refcount tracker Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 08f0b22d731fa86957749c649d6ef6ebc07e8ad2 Author: Eric Dumazet Date: Mon Dec 6 17:30:27 2021 -0800 net: eql: add net device refcount tracker Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 1dfeb03e86adc0a6b648a2078d1874dfa691fe8b Merge: fa55b7dcdc43c 33b22d9c32720 Author: Stephen Boyd Date: Tue Dec 7 20:16:36 2021 -0800 Merge tag 'renesas-clk-for-v5.17-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 serial (SCI1), watchdog (WDT), timer (OSTM), SPI (RSPI), and thermal (TSU) clocks and resets on RZ/G2L - Rework SDHI clock handling in the R-Car Gen3 and RZ/G2 clock drivers, and in the Renesas SDHI driver - Make the Cortex-A55 (I) clock on RZ/G2L programmable, - Document support for the new R-Car S4-8 (R8A779F0) SoC - Miscellaneous fixes and improvements * tag 'renesas-clk-for-v5.17-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers: (24 commits) clk: renesas: r9a07g044: Add TSU clock and reset entry mmc: renesas_sdhi: Simplify an expression mmc: renesas_sdhi: Use devm_clk_get_optional() to obtain CD clock dt-bindings: clock: renesas,cpg-mssr: Document r8a779f0 clk: renesas: cpg-mssr: propagate return value of_genpd_add_provider_simple() clk: renesas: cpg-mssr: Check return value of pm_genpd_init() clk: renesas: rzg2l: propagate return value of_genpd_add_provider_simple() clk: renesas: rzg2l: Check return value of pm_genpd_init() clk: renesas: r9a07g044: Add RSPI clock and reset entries clk: renesas: r9a07g044: Change core clock "I" from DEF_FIXED->DEF_DIV clk: renesas: rzg2l: Add CPG_PL1_DDIV macro mmc: renesas_sdhi: Parse DT for SDnH mmc: renesas_sdhi: Use dev_err_probe when getting clock fails clk: renesas: rcar-gen3: Remove outdated SD_SKIP_FIRST clk: renesas: rcar-gen3: Switch to new SD clock handling mmc: renesas_sdhi: Flag non-standard SDnH handling for V3M clk: renesas: r8a779a0: Add SDnH clock to V3U clk: renesas: rcar-gen3: Add SDnH clock clk: renesas: rcar-gen3: Add dummy SDnH clock clk: renesas: r9a07g044: Add OSTM clock and reset entries ... commit 2972e3050e3517a85ca1813b227d4c302e804343 Author: John Keeping Date: Tue Dec 7 14:25:58 2021 +0000 tracing: Make trace_marker{,_raw} stream-like The tracing marker files are write-only streams with no meaningful concept of file position. Using stream_open() to mark them as stream-link indicates this and has the added advantage that a single file descriptor can now be used from multiple threads without contention thanks to clearing FMODE_ATOMIC_POS. Note that this has the potential to break existing userspace by since both lseek(2) and pwrite(2) will now return ESPIPE when previously lseek would have updated the stored offset and pwrite would have appended to the trace. A survey of libtracefs and several other projects found to use trace_marker(_raw) [1][2][3] suggests that everyone limits themselves to calling write(2) and close(2) on these file descriptors so there is a good chance this will go unnoticed and the benefits of reduced overhead and lock contention seem worth the risk. [1] https://github.com/google/perfetto [2] https://github.com/intel/media-driver/ [3] https://w1.fi/cgit/hostap/ Link: https://lkml.kernel.org/r/20211207142558.347029-1-john@metanate.com Signed-off-by: John Keeping Signed-off-by: Steven Rostedt (VMware) commit 7acc3d1afd02a956f2a6fbe0e8395698943c9686 Author: Gao Xiang Date: Mon Dec 6 20:17:02 2021 +0800 erofs: Replace zero-length array with flexible-array member There is a regular need in the kernel to provide a way to declare having a dynamically sized set of trailing elements in a structure. Kernel code should always use `flexible array members' [1] for these cases. The older style of one-element or zero-length arrays should no longer be used [2]. [1] https://en.wikipedia.org/wiki/Flexible_array_member [2] https://www.kernel.org/doc/html/v5.15/process/deprecated.html#zero-length-and-one-element-arrays Link: https://lore.kernel.org/r/20211206121702.221331-1-hsiangkao@linux.alibaba.com Reported-by: Abaci Robot Signed-off-by: Gao Xiang commit 40452ffca3c1a0f2994e826f9fa213b107f1a2d4 Author: Huang Jianan Date: Mon Dec 6 22:35:52 2021 +0800 erofs: add sysfs node to control sync decompression strategy Although readpage is a synchronous path, there will be no additional kworker scheduling overhead in non-atomic contexts together with dm-verity. Let's add a sysfs node to disable sync decompression as an option. Link: https://lore.kernel.org/r/20211206143552.8384-1-huangjianan@oppo.com Reviewed-by: Chao Yu Signed-off-by: Huang Jianan Signed-off-by: Gao Xiang commit 168e9a76200c54c584a23aa88c62c53c4b0edd66 Author: Huang Jianan Date: Wed Dec 1 22:54:36 2021 +0800 erofs: add sysfs interface Add sysfs interface to configure erofs related parameters later. Link: https://lore.kernel.org/r/20211201145436.4357-1-huangjianan@oppo.com Reviewed-by: Chao Yu Reviewed-by: Gao Xiang Signed-off-by: Huang Jianan Signed-off-by: Gao Xiang commit 8ff4f20f3eb55dea0dbbe5e32043ab6b7427882f Author: Andrew Kilroy Date: Fri Dec 3 12:35:22 2021 +0000 perf vendor events arm64: Fix JSON indentation to 4 spaces standard Correct indentation to 4 spaces, same as the other JSON files. Reviewed-by: John Garry Signed-off-by: Andrew Kilroy Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Leo Yan Cc: Mark Rutland Cc: Mathieu Poirier Cc: Namhyung Kim Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Link: http://lore.kernel.org/lkml/20211203123525.31127-2-andrew.kilroy@arm.com Signed-off-by: Arnaldo Carvalho de Melo commit e69dc84282fb474cb87097c6c945d8f90e05a4d9 Author: Jin Yao Date: Thu Sep 9 14:22:15 2021 +0800 perf stat: Support --cputype option for hybrid events In previous patch, we have supported the syntax which enables the event on a specified pmu, such as: cpu_core// cpu_atom// While this syntax is not very easy for applying on a set of events or applying on a group. In following example, we have to explicitly assign the pmu prefix. # ./perf stat -e '{cpu_core/cycles/,cpu_core/instructions/}' -- sleep 1 Performance counter stats for 'sleep 1': 1,158,545 cpu_core/cycles/ 1,003,113 cpu_core/instructions/ 1.002428712 seconds time elapsed A much easier way is: # ./perf stat --cputype core -e '{cycles,instructions}' -- sleep 1 Performance counter stats for 'sleep 1': 1,101,071 cpu_core/cycles/ 939,892 cpu_core/instructions/ 1.002363142 seconds time elapsed For this example, the '--cputype' enables the events from specified pmu (cpu_core). If '--cputype' conflicts with pmu prefix, '--cputype' is ignored. # ./perf stat --cputype core -e cycles,cpu_atom/instructions/ -a -- sleep 1 Performance counter stats for 'system wide': 21,003,407 cpu_core/cycles/ 367,886 cpu_atom/instructions/ 1.002203520 seconds time elapsed Signed-off-by: Jin Yao Cc: Alexander Shishkin Cc: Andi Kleen Cc: Jin Yao Cc: Jiri Olsa Cc: Kan Liang Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20210909062215.10278-1-yao.jin@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo commit ed17b1914978eddb2b01f2d34577f1c82518c650 Author: Uwe Kleine-König Date: Fri Dec 3 22:05:44 2021 +0100 perf tools: Drop requirement for libstdc++.so for libopencsd check It's possible to link against libopencsd_c_api without having libstdc++.so available, only libstdc++.so.6.0.28 (or whatever version is in use) needs to be available. The same holds true for libopencsd.so. When -lstdc++ (or -lopencsd) is explicitly passed to the linker however the .so file must be available. So wrap adding the dependencies into a check for static linking that actually requires adding them all. The same construct is already used for some other tests in the same file to reduce dependencies in the dynamic linking case. Fixes: 573cf5c9a152 ("perf build: Add missing -lstdc++ when linking with libopencsd") Reviewed-by: James Clark Signed-off-by: Uwe Kleine-König Cc: Adrian Bunk Cc: Alexander Shishkin Cc: Branislav Rankov Cc: Diederik de Haas Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/all/20211203210544.1137935-1-uwe@kleine-koenig.org Signed-off-by: Arnaldo Carvalho de Melo commit 94dbfd6781a0e87b6faa6012810eb22e7d5b8a70 Author: Ian Rogers Date: Tue Nov 30 09:49:45 2021 -0800 perf parse-events: Architecture specific leader override Currently topdown events must appear after a slots event: $ perf stat -e '{slots,topdown-fe-bound}' /bin/true Performance counter stats for '/bin/true': 3,183,090 slots 986,133 topdown-fe-bound Reversing the events yields: $ perf stat -e '{topdown-fe-bound,slots}' /bin/true Error: The sys_perf_event_open() syscall returned with 22 (Invalid argument) for event (topdown-fe-bound). For metrics the order of events is determined by iterating over a hashmap, and so slots isn't guaranteed to be first which can yield this error. Change the set_leader in parse-events, called when a group is closed, so that rather than always making the first event the leader, if the slots event exists then it is made the leader. It is then moved to the head of the evlist otherwise it won't be opened in the correct order. The result is: $ perf stat -e '{topdown-fe-bound,slots}' /bin/true Performance counter stats for '/bin/true': 3,274,795 slots 1,001,702 topdown-fe-bound A problem with this approach is the slots event is identified by name, names can be overwritten like 'cpu/slots,name=foo/' and this causes the leader change to fail. The change also modifies and fixes mixed groups like, with the change: $ perf stat -e '{instructions,slots,topdown-fe-bound}' -a -- sleep 2 Performance counter stats for 'system wide': 5574985410 slots 971981616 instructions 1348461887 topdown-fe-bound 2.001263120 seconds time elapsed Without the change: $ perf stat -e '{instructions,slots,topdown-fe-bound}' -a -- sleep 2 Performance counter stats for 'system wide': instructions slots topdown-fe-bound 2.006247990 seconds time elapsed Something that may be undesirable here is that the events are reordered in the output. Reviewed-by: Kajol Jain Signed-off-by: Ian Rogers Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Vineet Singh Link: http://lore.kernel.org/lkml/20211130174945.247604-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit ecdcf630d71f3b4c64097cad0add561cd5010c02 Author: Ian Rogers Date: Tue Nov 30 09:49:44 2021 -0800 perf evlist: Allow setting arbitrary leader The leader of a group is the first, but allow it to be an arbitrary list member so that for Intel topdown events slots may always be the group leader. Reviewed-by: Kajol Jain Signed-off-by: Ian Rogers Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Riccardo Mancini Cc: Stephane Eranian Cc: Vineet Singh Link: http://lore.kernel.org/lkml/20211130174945.247604-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 6b6b16b3bb612757f7bc697496b9f5d6765512a6 Author: Ian Rogers Date: Tue Nov 23 17:52:26 2021 -0800 perf metric: Reduce multiplexing with duration_time It is common to use the same counters with and without duration_time. The ID sharing code treats duration_time as if it were a hardware event placed in the same group. This causes unnecessary multiplexing such as in the following example where l3_cache_access isn't shared: $ perf stat -M l3 -a sleep 1 Performance counter stats for 'system wide': 3,117,007 l3_cache_miss # 199.5 MB/s l3_rd_bw # 43.6 % l3_hits # 56.4 % l3_miss (50.00%) 5,526,447 l3_cache_access (50.00%) 5,392,435 l3_cache_access # 5389191.2 access/s l3_access_rate (50.00%) 1,000,601,901 ns duration_time 1.000601901 seconds time elapsed Fix this by placing duration_time in all groups unless metric sharing has been disabled on the command line: $ perf stat -M l3 -a sleep 1 Performance counter stats for 'system wide': 3,597,972 l3_cache_miss # 230.3 MB/s l3_rd_bw # 48.0 % l3_hits # 52.0 % l3_miss 6,914,459 l3_cache_access # 6909935.9 access/s l3_access_rate 1,000,654,579 ns duration_time 1.000654579 seconds time elapsed $ perf stat --metric-no-merge -M l3 -a sleep 1 Performance counter stats for 'system wide': 3,501,834 l3_cache_miss # 53.5 % l3_miss (24.99%) 6,548,173 l3_cache_access (24.99%) 3,417,622 l3_cache_miss # 45.7 % l3_hits (25.04%) 6,294,062 l3_cache_access (25.04%) 5,923,238 l3_cache_access # 5919688.1 access/s l3_access_rate (24.99%) 1,000,599,683 ns duration_time 3,607,486 l3_cache_miss # 230.9 MB/s l3_rd_bw (49.97%) 1.000599683 seconds time elapsed v2. Doesn't count duration_time in the metric_list_cmp function that sorts larger metrics first. Without this a metric with duration_time and an event is sorted the same as a metric with two events, possibly not allowing the first metric to share with the second. Signed-off-by: Ian Rogers Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Andi Kleen Cc: John Garry Cc: Kajol Jain Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Paul Clarke Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lore.kernel.org/lkml/20211124015226.3317994-1-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo commit b4515ad6e1c8b195e3bd02a5a15b1c74119ea367 Author: Gang Li Date: Tue Nov 23 15:40:17 2021 +0800 perf trace: Enable ignore_missing_thread for trace perf already support ignore_missing_thread for -u/-p, but not yet applied to `perf trace`. This patch enables ignore_missing_thread for `perf trace`. Signed-off-by: Gang Li Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1481538943-21874-6-git-send-email-jolsa@kernel.org Link: http://lkml.kernel.org/r/1513148513-6974-1-git-send-email-zhangmengting@huawei.com Link: http://lore.kernel.org/lkml/20211123074018.11406-1-ligang.bdlg@bytedance.com Signed-off-by: Arnaldo Carvalho de Melo commit 7a2e14962cd43400c353cdc05550f580a284dcb9 Author: Sandipan Das Date: Tue Nov 23 14:16:13 2021 +0530 perf docs: Update link to AMD documentation This updates the link to documentation on AMD processors. The new link points to a page where users can find the Processor Programming Reference (PPR) documents for the family and model codes corresponding to processors they are using. Signed-off-by: Sandipan Das Acked-by: Jiri Olsa Cc: Ananth Narayan Cc: Kajol Jain Cc: Kim Phillips Cc: Ravi Bangoria Cc: Robert Richter Cc: Santosh Shukla Link: https://lore.kernel.org/r/20211123084613.243792-2-sandipan.das@amd.com Signed-off-by: Arnaldo Carvalho de Melo commit 4edb117e6472ca0c0730887dba8b30cba0a3705e Author: Sandipan Das Date: Tue Nov 23 14:16:12 2021 +0530 perf docs: Add info on AMD raw event encoding AMD processors have events with event select codes and unit masks larger than a byte. The core PMU, for example, uses 12-bit event select codes split between bits 0-7 and 32-35 of the PERF_CTL MSRs as can be seen from /sys/bus/event_sources/devices/cpu/format/*. The Processor Programming Reference (PPR) lists the event codes as unified 12-bit hexadecimal values instead and the split between the bits is not apparent to someone who is not aware of the layout of the PERF_CTL MSRs. 8-bit event select codes continue to work as the layout matches that of the PERF_CTL MSRs i.e. bits 0-7 for event select and 8-15 for unit mask. This adds more details in the perf man pages about using /sys/bus/event_sources/devices/*/format/* for determining the correct raw event encoding scheme. E.g. the "op_cache_hit_miss.op_cache_hit" event with code 0x28f and umask 0x03 can be programmed using its symbolic name as: $ sudo perf --debug perf-event-open stat -e op_cache_hit_miss.op_cache_hit sleep 1 ------------------------------------------------------------ perf_event_attr: type 4 size 128 config 0x20000038f sample_type IDENTIFIER read_format TOTAL_TIME_ENABLED|TOTAL_TIME_RUNNING disabled 1 inherit 1 enable_on_exec 1 exclude_guest 1 ------------------------------------------------------------ [...] One might use a simple eventsel+umask combination based on what the current man pages say and incorrectly program the event as: $ sudo perf --debug perf-event-open stat -e r0328f sleep 1 ------------------------------------------------------------ perf_event_attr: type 4 size 128 config 0x328f sample_type IDENTIFIER read_format TOTAL_TIME_ENABLED|TOTAL_TIME_RUNNING disabled 1 inherit 1 enable_on_exec 1 exclude_guest 1 ------------------------------------------------------------ [...] When it should have been based on the format from sysfs: $ cat /sys/bus/event_source/devices/cpu/format/event config:0-7,32-35 $ sudo perf --debug perf-event-open stat -e r20000038f sleep 1 ------------------------------------------------------------ perf_event_attr: type 4 size 128 config 0x20000038f sample_type IDENTIFIER read_format TOTAL_TIME_ENABLED|TOTAL_TIME_RUNNING disabled 1 inherit 1 enable_on_exec 1 exclude_guest 1 ------------------------------------------------------------ [...] Reviewed-by: Kajol Jain Signed-off-by: Sandipan Das Acked-by: Jiri Olsa Cc: Ananth Narayan Cc: Kim Phillips Cc: Ravi Bangoria Cc: Robert Richter Cc: Santosh Shukla Link: https://lore.kernel.org/r/20211123084613.243792-1-sandipan.das@amd.com Signed-off-by: Arnaldo Carvalho de Melo commit a7f3713f6bf207e6d8dd484704dba6089f7ad8db Author: Shunsuke Nakamura Date: Tue Nov 9 17:58:31 2021 +0900 libperf tests: Add test_stat_multiplexing test Adds a test for a counter obtained using read() system call during multiplexing. $ sudo make tests -C ./tools/lib/perf/ V=1 make: Entering directory '/home/nakamura/build_work/build_kernel/linux_kernel/linux/tools/lib/perf' make -f /home/nakamura/build_work/build_kernel/linux_kernel/linux/tools/build/Makefile.build dir=. obj=libperf make -C /home/nakamura/build_work/build_kernel/linux_kernel/linux/tools/lib/api/ O= libapi.a make -f /home/nakamura/build_work/build_kernel/linux_kernel/linux/tools/build/Makefile.build dir=./fd obj=libapi make -f /home/nakamura/build_work/build_kernel/linux_kernel/linux/tools/build/Makefile.build dir=./fs obj=libapi make -f /home/nakamura/build_work/build_kernel/linux_kernel/linux/tools/build/Makefile.build dir=. obj=tests make -f /home/nakamura/build_work/build_kernel/linux_kernel/linux/tools/build/Makefile.build dir=./tests obj=tests running static: - running tests/test-cpumap.c...OK - running tests/test-threadmap.c...OK - running tests/test-evlist.c... Event 0 -- Raw count = 298049842, run = 270269503, enable = 456262127 Scaled count = 503160191 (59.24%, 270269503/456262127) Event 1 -- Raw count = 299134173, run = 271075173, enable = 456257234 Scaled count = 503484435 (59.41%, 271075173/456257234) Event 2 -- Raw count = 300461996, run = 272069283, enable = 456253417 Scaled count = 503867290 (59.63%, 272069283/456253417) Event 3 -- Raw count = 301308704, run = 273063387, enable = 456249352 Scaled count = 503443183 (59.85%, 273063387/456249352) Event 4 -- Raw count = 302531164, run = 274102932, enable = 456244712 Scaled count = 503563543 (60.08%, 274102932/456244712) Event 5 -- Raw count = 303710254, run = 275406214, enable = 456228165 Scaled count = 503115633 (60.37%, 275406214/456228165) Event 6 -- Raw count = 304531302, run = 276396076, enable = 456221130 Scaled count = 502661313 (60.58%, 276396076/456221130) Event 7 -- Raw count = 304486460, run = 276601890, enable = 456213754 Scaled count = 502205212 (60.63%, 276601890/456213754) Event 8 -- Raw count = 304116681, run = 276631326, enable = 456205562 Scaled count = 501532936 (60.64%, 276631326/456205562) Event 9 -- Raw count = 303567766, run = 276188567, enable = 456196839 Scaled count = 501420666 (60.54%, 276188567/456196839) Event 10 -- Raw count = 302238014, run = 275144001, enable = 456185300 Scaled count = 501106833 (60.31%, 275144001/456185300) Event 11 -- Raw count = 300805716, run = 273824589, enable = 456175608 Scaled count = 501124573 (60.03%, 273824589/456175608) Event 12 -- Raw count = 299959051, run = 272834556, enable = 456166593 Scaled count = 501517477 (59.81%, 272834556/456166593) Event 13 -- Raw count = 299037090, run = 271820805, enable = 456157086 Scaled count = 501830195 (59.59%, 271820805/456157086) Event 14 -- Raw count = 298327042, run = 270784311, enable = 456147546 Scaled count = 502544433 (59.36%, 270784311/456147546) Expected: 501614268 High: 503867290 Low: 298049842 Average: 502438527 Average Error = 0.16% OK - running tests/test-evsel.c... loop = 65536, count = 328182 loop = 131072, count = 660214 loop = 262144, count = 1315534 loop = 524288, count = 2635364 loop = 1048576, count = 5271971 loop = 65536, count = 491952 loop = 131072, count = 850061 loop = 262144, count = 1648608 loop = 524288, count = 3162059 loop = 1048576, count = 6353393 OK running dynamic: - running tests/test-cpumap.c...OK - running tests/test-threadmap.c...OK - running tests/test-evlist.c... Event 0 -- Raw count = 300218292, run = 297528154, enable = 496789343 Scaled count = 501281125 (59.89%, 297528154/496789343) Event 1 -- Raw count = 301438606, run = 298515328, enable = 496784768 Scaled count = 501649643 (60.09%, 298515328/496784768) Event 2 -- Raw count = 302342618, run = 298798983, enable = 496782015 Scaled count = 502673648 (60.15%, 298798983/496782015) Event 3 -- Raw count = 303132319, run = 299230407, enable = 496778508 Scaled count = 503256412 (60.23%, 299230407/496778508) Event 4 -- Raw count = 302758195, run = 299218047, enable = 496774243 Scaled count = 502651743 (60.23%, 299218047/496774243) Event 5 -- Raw count = 303158458, run = 299204274, enable = 496769146 Scaled count = 503334281 (60.23%, 299204274/496769146) Event 6 -- Raw count = 303471397, run = 299197479, enable = 496763124 Scaled count = 503859189 (60.23%, 299197479/496763124) Event 7 -- Raw count = 303583387, run = 299196861, enable = 496756458 Scaled count = 504039405 (60.23%, 299196861/496756458) Event 8 -- Raw count = 303096897, run = 299186924, enable = 496748667 Scaled count = 503240507 (60.23%, 299186924/496748667) Event 9 -- Raw count = 301424173, run = 297845086, enable = 496739994 Scaled count = 502709122 (59.96%, 297845086/496739994) Event 10 -- Raw count = 300876415, run = 296851339, enable = 496729034 Scaled count = 503464297 (59.76%, 296851339/496729034) Event 11 -- Raw count = 300239338, run = 296547963, enable = 496719538 Scaled count = 502902612 (59.70%, 296547963/496719538) Event 12 -- Raw count = 299751948, run = 296547195, enable = 496710036 Scaled count = 502077926 (59.70%, 296547195/496710036) Event 13 -- Raw count = 299341883, run = 296549981, enable = 496700423 Scaled count = 501376663 (59.70%, 296549981/496700423) Event 14 -- Raw count = 299145476, run = 296561684, enable = 496690949 Scaled count = 501018366 (59.71%, 296561684/496690949) Expected: 501669431 High: 504039405 Low: 300218292 Average: 502635662 Average Error = 0.19% OK - running tests/test-evsel.c... loop = 65536, count = 329275 loop = 131072, count = 664638 loop = 262144, count = 1315367 loop = 524288, count = 2629617 loop = 1048576, count = 5273657 loop = 65536, count = 459641 loop = 131072, count = 978402 loop = 262144, count = 1581219 loop = 524288, count = 3774908 loop = 1048576, count = 7694417 OK make: Leaving directory '/home/nakamura/build_work/build_kernel/linux_kernel/linux/tools/lib/perf' Signed-off-by: Shunsuke Nakamura Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Rob Herring Link: https://lore.kernel.org/r/20211109085831.3770594-4-nakamura.shun@fujitsu.com Signed-off-by: Arnaldo Carvalho de Melo commit f2c4dcf191904d28d710290eea4a623710eee57c Author: Shunsuke Nakamura Date: Tue Nov 9 17:58:30 2021 +0900 libperf: Remove scaling process from perf_mmap__read_self() Remove the scaling process from perf_mmap__read_self(), and unify the counters that can be obtained from perf_evsel__read() to "no scaling". Signed-off-by: Shunsuke Nakamura Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Rob Herring Link: https://lore.kernel.org/r/20211109085831.3770594-3-nakamura.shun@fujitsu.com Signed-off-by: Arnaldo Carvalho de Melo commit 9a5b2d1afa9f888335ab63e922ba5eed31383020 Author: Shunsuke Nakamura Date: Tue Nov 9 17:58:29 2021 +0900 libperf: Adopt perf_counts_values__scale() from tools/perf/util Move perf_counts_values__scale() from tools/perf/util to tools/lib/perf so that it can be used with libperf. Committer notes: As noted by Jiri, use __s8 instead of s8 on the exported function. Signed-off-by: Shunsuke Nakamura Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Ingo Molnar Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Rob Herring Link: https://lore.kernel.org/r/20211109085831.3770594-2-nakamura.shun@fujitsu.com Signed-off-by: Arnaldo Carvalho de Melo commit c77a78c29177f9a614915e5158a7b6bb89e0e8db Author: John Garry Date: Sat Oct 30 00:30:41 2021 +0800 tools build: Enable warnings through HOSTCFLAGS The tools build system uses KBUILD_HOSTCFLAGS symbol for obvious purposes. However this is not set for anything under tools/ As such, host tools apps built have no compiler warnings enabled. Declare HOSTCFLAGS for perf tools build, and also use that symbol in declaration of host_c_flags. HOSTCFLAGS comes from EXTRA_WARNINGS, which is independent of target platform/arch warning flags. Suggested-by: Jiri Olsa Signed-off-by: John Garry Acked-by: Jiri Olsa Cc: Alexander Shishkin Cc: Ian Rogers Cc: Ingo Molnar Cc: Laura Abbott Cc: Masahiro Yamada Cc: Namhyung Kim Cc: Peter Zijlstra Link: https://lore.kernel.org/r/1635525041-151876-1-git-send-email-john.garry@huawei.com Signed-off-by: Arnaldo Carvalho de Melo commit e9c08f722924c58041d2e0d90ea27140a4625776 Author: Arnaldo Carvalho de Melo Date: Tue Nov 16 09:51:48 2021 -0300 perf test sigtrap: Print errno string when failing Helps a bit the user figuring out why it is failing: Before: $ perf test sigtrap 73: Sigtrap : FAILED! $ perf test -v sigtrap 73: Sigtrap : --- start --- test child forked, pid 3816772 FAILED sys_perf_event_open() test child finished with -1 ---- end ---- Sigtrap: FAILED! $ After: $ perf test sigtrap 73: Sigtrap : FAILED! $ perf test -v sigtrap 73: Sigtrap : --- start --- test child forked, pid 3816772 FAILED sys_perf_event_open(): Permission denied test child finished with -1 ---- end ---- Sigtrap: FAILED! $ Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Fabian Hemmer Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Marco Elver Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: kasan-dev@googlegroups.com Link: http://lore.kernel.org/lkml/YZOpSVOCXe0zWeRs@kernel.org Signed-off-by: Arnaldo Carvalho de Melo commit 5504f67944484495a5d8504d11fb998af05fe248 Author: Marco Elver Date: Mon Nov 15 12:28:23 2021 +0100 perf test sigtrap: Add basic stress test for sigtrap handling Add basic stress test for sigtrap handling as a perf tool built-in test. This allows sanity checking the basic sigtrap functionality from within the perf tool. Committer notes: Reported that !root was getting -EPERM, applied a fixup from Marco to set .exclude_{hv,kernel} that made it work. Signed-off-by: Marco Elver Tested-by: Arnaldo Carvalho de Melo Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Fabian Hemmer Cc: Ian Rogers Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: kasan-dev@googlegroups.com Link: http://lore.kernel.org/lkml/20211115112822.4077224-1-elver@google.com Signed-off-by: Arnaldo Carvalho de Melo commit 53b541fbdb9c498db112216a0cc9fe4804f54742 Author: Paul E. McKenney Date: Tue Nov 23 13:51:11 2021 -0800 rcutorture: Combine n_max_cbs from all kthreads in a callback flood With the addition of multiple callback-flood kthreads, the maximum number of callbacks from any one of those kthreads is reported in the rcutorture run summary. This commit changes this to report the sum of each kthread's maximum number of callbacks in a given callback-flooding episode. Cc: Neeraj Upadhyay Signed-off-by: Paul E. McKenney commit 613b00fbe64461f1c73e035e07c22cf3de65740b Author: Paul E. McKenney Date: Tue Nov 23 11:53:52 2021 -0800 rcutorture: Add ability to limit callback-flood intensity The RCU tasks flavors of RCU now need concurrent callback flooding to test their ability to switch between single-queue mode and per-CPU queue mode, but their lack of heavy-duty forward-progress features rules out the use of rcutorture's current callback-flooding code. This commit therefore provides the ability to limit the intensity of the callback floods using a new ->cbflood_max field in the rcu_operations structure. When this field is zero, there is no limit, otherwise, each callback-flood kthread allocates at most ->cbflood_max callbacks. Cc: Neeraj Upadhyay Signed-off-by: Paul E. McKenney commit 82e310033d7c21a7a88427f14e0dad78d731a5cd Author: Paul E. McKenney Date: Mon Nov 22 20:55:18 2021 -0800 rcutorture: Enable multiple concurrent callback-flood kthreads This commit converts the rcutorture.fwd_progress module parameter from bool to int, so that it specifies the number of callback-flood kthreads. Values less than zero specify one kthread per CPU, however, the number of kthreads executing concurrently is limited to the number of online CPUs. This commit also reverse the order of the need-resched and callback-flood operations to cause the callback flooding to happen more nearly at the same time. Cc: Neeraj Upadhyay Signed-off-by: Paul E. McKenney commit 12e885433dbc2e8098cfb62c68f731b18981f3f6 Author: Paul E. McKenney Date: Fri Nov 12 08:16:42 2021 -0800 rcutorture: Test RCU-tasks multiqueue callback queueing This commit modifies the TASKS01 scenario to use four callback queues and the TRACE01 scenario to use two queues, thus providing testing of multiple queues by default. Cc: Neeraj Upadhyay Signed-off-by: Paul E. McKenney commit 5ff7c9f9d7e3e0f6db5b81945fa11b69d62f433a Author: Wander Lairson Costa Date: Wed Nov 10 11:37:45 2021 -0300 rcutorture: Avoid soft lockup during cpu stall If we use the module stall_cpu option, we may get a soft lockup warning in case we also don't pass the stall_cpu_block option. Introduce the stall_no_softlockup option to avoid a soft lockup on cpu stall even if we don't use the stall_cpu_block option. Signed-off-by: Wander Lairson Costa Signed-off-by: Paul E. McKenney commit 81faa4f6fba429334ff72bb5ba7696818509b5b5 Author: Li Zhijian Date: Wed Nov 3 16:30:28 2021 +0800 locktorture,rcutorture,torture: Always log error message Unconditionally log messages corresponding to errors. Acked-by: Davidlohr Bueso Signed-off-by: Li Zhijian Signed-off-by: Paul E. McKenney commit 809da9bf805094e1cf032fd8000e8b77d5eec642 Author: Li Zhijian Date: Wed Nov 3 16:30:27 2021 +0800 scftorture: Always log error message Unconditionally log messages corresponding to errors. Acked-by: Davidlohr Bueso Signed-off-by: Li Zhijian Signed-off-by: Paul E. McKenney commit 86e7ed1bd57d020e35d430542bf5d689c3200568 Author: Li Zhijian Date: Fri Oct 29 17:40:28 2021 +0800 rcuscale: Always log error message Unconditionally log messages corresponding to errors. Acked-by: Davidlohr Bueso Signed-off-by: Li Zhijian Signed-off-by: Paul E. McKenney commit 04cf8518860167081ee49b5ff2e1616244ab760e Author: Li Zhijian Date: Fri Oct 29 17:40:26 2021 +0800 scftorture: Remove unused SCFTORTOUT There are no longer any users of SCFTORTOUT(), so this commit removes it. Acked-by: Davidlohr Bueso Signed-off-by: Li Zhijian Signed-off-by: Paul E. McKenney commit 71f6ea2a0be06f9d1833852ee4f501a76563acd3 Author: Li Zhijian Date: Fri Oct 29 17:40:25 2021 +0800 scftorture: Add missing '\n' to flush message Add '\n' to macros to flush message for each call. Acked-by: Davidlohr Bueso Signed-off-by: Li Zhijian Signed-off-by: Paul E. McKenney commit f71f22b67d37c91a5c4320f6e821f64eb189627d Author: Li Zhijian Date: Fri Oct 29 17:40:24 2021 +0800 refscale: Add missing '\n' to flush message Add '\n' to macros to flush message for each call. Acked-by: Davidlohr Bueso Signed-off-by: Li Zhijian Signed-off-by: Paul E. McKenney commit 4feeb9d5f82229bf39621be755bda81521539476 Author: Li Zhijian Date: Mon Oct 25 11:26:58 2021 +0800 refscale: Always log the error message An OOM is a serious error that should be logged even in non-verbose runs. This commit therefore adds an unconditional SCALEOUT_ERRSTRING() macro and uses it instead of VERBOSE_SCALEOUT_ERRSTRING() when reporting an OOM. [ paulmck: Drop do-while from SCALEOUT_ERRSTRING() due to only single statement. ] Signed-off-by: Li Zhijian Signed-off-by: Paul E. McKenney commit 9b073de1c7a354af7cb7100952599dde461aee45 Author: Paul E. McKenney Date: Mon Nov 8 16:18:57 2021 -0800 rcu_tasks: Convert bespoke callback list to rcu_segcblist structure This commit moves from a bespoke head and tail pointer in the rcu_tasks_percpu structure to an rcu_segcblist structure, thus allowing associating the grace-period sequence number with groups of callbacks. This in turn will allow callbacks to be invoked independently on different CPUs. Reported-by: Martin Lau Cc: Neeraj Upadhyay Signed-off-by: Paul E. McKenney commit b14fb4fbbcd8ff62f1a7aa2c6e2603424c117943 Author: Paul E. McKenney Date: Mon Nov 8 14:14:43 2021 -0800 rcu-tasks: Convert grace-period counter to grace-period sequence number This commit moves the rcu_tasks structure's ->n_gps grace-period-counter field to a ->task_gp_seq grce-period sequence number in order to enable use of the rcu_segcblist structure for the callback lists. This in turn permits CPUs to lag behind the RCU Tasks grace-period sequence number without suffering long-term slowdowns in callback invocation. Reported-by: Martin Lau Cc: Neeraj Upadhyay Signed-off-by: Paul E. McKenney commit 7a30871b6a27de1a1f418c7fd2c5dde9a46bfd16 Author: Paul E. McKenney Date: Mon Nov 8 10:51:13 2021 -0800 rcu-tasks: Introduce ->percpu_enqueue_shift for dynamic queue selection This commit introduces a ->percpu_enqueue_shift field to the rcu_tasks structure, and uses it to shift down the CPU number in order to select a rcu_tasks_percpu structure. This field is currently set to a sufficiently large shift count to always select the CPU-0 instance of the rcu_tasks_percpu structure, and later commits will adjust this. Reported-by: Martin Lau Cc: Neeraj Upadhyay Signed-off-by: Paul E. McKenney commit cafafd67765b21334086b3fb8963ad9c5866c03d Author: Paul E. McKenney Date: Fri Nov 5 21:52:00 2021 -0700 rcu-tasks: Create per-CPU callback lists Currently, RCU Tasks Trace (as well as the other two flavors of RCU Tasks) use a single global callback list. This works well and is simple, but expected changes in workload will cause this list to become a bottleneck. This commit therefore creates per-CPU callback lists for the various flavors of RCU Tasks, but continues queueing on a single list, namely that of CPU 0. Later commits will dynamically vary the number of lists in use to accommodate dynamic changes in workload. Reported-by: Martin Lau Cc: Neeraj Upadhyay Tested-by: kernel test robot Signed-off-by: Paul E. McKenney commit 0598a4d4429c0a952ac0e99e5280354cf4ccc01c Author: Frederic Weisbecker Date: Tue Oct 19 02:08:16 2021 +0200 rcu/nocb: Don't invoke local rcu core on callback overload from nocb kthread rcu_core() tries to ensure that its self-invocation in case of callbacks overload only happen in softirq/rcuc mode. Indeed it doesn't make sense to trigger local RCU core from nocb_cb kthread since it can execute on a CPU different from the target rdp. Also in case of overload, the nocb_cb kthread simply iterates a new loop of callbacks processing. However the "offloaded" check that aims at preventing misplaced rcu_core() invocations is wrong. First of all that state is volatile and second: softirq/rcuc can execute while the target rdp is offloaded. As a result rcu_core() can be invoked on the wrong CPU while in the process of (de-)offloading. Fix that with moving the rcu_core() self-invocation to rcu_core() itself, irrespective of the rdp offloaded state. Tested-by: Valentin Schneider Tested-by: Sebastian Andrzej Siewior Signed-off-by: Frederic Weisbecker Cc: Valentin Schneider Cc: Peter Zijlstra Cc: Sebastian Andrzej Siewior Cc: Josh Triplett Cc: Joel Fernandes Cc: Boqun Feng Cc: Neeraj Upadhyay Cc: Uladzislau Rezki Cc: Thomas Gleixner Signed-off-by: Paul E. McKenney commit a554ba288845fd3f6f12311fd76a51694233458a Author: Frederic Weisbecker Date: Tue Oct 19 02:08:15 2021 +0200 rcu: Apply callbacks processing time limit only on softirq Time limit only makes sense when callbacks are serviced in softirq mode because: _ In case we need to get back to the scheduler, cond_resched_tasks_rcu_qs() is called after each callback. _ In case some other softirq vector needs the CPU, the call to local_bh_enable() before cond_resched_tasks_rcu_qs() takes care about them via a call to do_softirq(). Therefore, make sure the time limit only applies to softirq mode. Reviewed-by: Valentin Schneider Tested-by: Valentin Schneider Tested-by: Sebastian Andrzej Siewior Signed-off-by: Frederic Weisbecker Cc: Valentin Schneider Cc: Peter Zijlstra Cc: Sebastian Andrzej Siewior Cc: Josh Triplett Cc: Joel Fernandes Cc: Boqun Feng Cc: Neeraj Upadhyay Cc: Uladzislau Rezki Cc: Thomas Gleixner Signed-off-by: Paul E. McKenney commit 3e61e95e2d095e308616cba4ffb640f95a480e01 Author: Frederic Weisbecker Date: Tue Oct 19 02:08:14 2021 +0200 rcu: Fix callbacks processing time limit retaining cond_resched() The callbacks processing time limit makes sure we are not exceeding a given amount of time executing the queue. However its "continue" clause bypasses the cond_resched() call on rcuc and NOCB kthreads, delaying it until we reach the limit, which can be very long... Make sure the scheduler has a higher priority than the time limit. Reviewed-by: Valentin Schneider Tested-by: Valentin Schneider Tested-by: Sebastian Andrzej Siewior Signed-off-by: Frederic Weisbecker Cc: Valentin Schneider Cc: Peter Zijlstra Cc: Sebastian Andrzej Siewior Cc: Josh Triplett Cc: Joel Fernandes Cc: Boqun Feng Cc: Neeraj Upadhyay Cc: Uladzislau Rezki Cc: Thomas Gleixner Signed-off-by: Paul E. McKenney commit 78ad37a2c50dfdb9a60e42bb9ee1da86d1fe770c Author: Frederic Weisbecker Date: Tue Oct 19 02:08:13 2021 +0200 rcu/nocb: Limit number of softirq callbacks only on softirq The current condition to limit the number of callbacks executed in a row checks the offloaded state of the rdp. Not only is it volatile but it is also misleading: the rcu_core() may well be executing callbacks concurrently with NOCB kthreads, and the offloaded state would then be verified on both cases. As a result the limit would spuriously not apply anymore on softirq while in the middle of (de-)offloading process. Fix and clarify the condition with those constraints in mind: _ If callbacks are processed either by rcuc or NOCB kthread, the call to cond_resched_tasks_rcu_qs() is enough to take care of the overload. _ If instead callbacks are processed by softirqs: * If need_resched(), exit the callbacks processing * Otherwise if CPU is idle we can continue * Otherwise exit because a softirq shouldn't interrupt a task for too long nor deprive other pending softirq vectors of the CPU. Tested-by: Valentin Schneider Tested-by: Sebastian Andrzej Siewior Signed-off-by: Frederic Weisbecker Cc: Valentin Schneider Cc: Peter Zijlstra Cc: Sebastian Andrzej Siewior Cc: Josh Triplett Cc: Joel Fernandes Cc: Boqun Feng Cc: Neeraj Upadhyay Cc: Uladzislau Rezki Cc: Thomas Gleixner Signed-off-by: Paul E. McKenney commit 7b65dfa32dca1be0400d43a3d5bb80ed6e04958e Author: Frederic Weisbecker Date: Tue Oct 19 02:08:12 2021 +0200 rcu/nocb: Use appropriate rcu_nocb_lock_irqsave() Instead of hardcoding IRQ save and nocb lock, use the consolidated API (and fix a comment as per Valentin Schneider's suggestion). Reviewed-by: Valentin Schneider Tested-by: Valentin Schneider Tested-by: Sebastian Andrzej Siewior Signed-off-by: Frederic Weisbecker Cc: Valentin Schneider Cc: Peter Zijlstra Cc: Sebastian Andrzej Siewior Cc: Josh Triplett Cc: Joel Fernandes Cc: Boqun Feng Cc: Neeraj Upadhyay Cc: Uladzislau Rezki Cc: Thomas Gleixner Signed-off-by: Paul E. McKenney commit 344e219d7d2b28117daaae5fe8da2e054b53d5a2 Author: Frederic Weisbecker Date: Tue Oct 19 02:08:11 2021 +0200 rcu/nocb: Check a stable offloaded state to manipulate qlen_last_fqs_check It's not entirely obvious why rdp->qlen_last_fqs_check is updated before processing the queue only on offloaded rdp. There can be different effect to that, either in favour of triggering the force quiescent state path or not. For example: 1) If the number of callbacks has decreased since the last rdp->qlen_last_fqs_check update (because we recently called rcu_do_batch() and we executed below qhimark callbacks) and the number of processed callbacks on a subsequent do_batch() arranges for exceeding qhimark on non-offloaded but not on offloaded setup, then we may spare a later run to the force quiescent state slow path on __call_rcu_nocb_wake(), as compared to the non-offloaded counterpart scenario. Here is such an offloaded scenario instance: qhimark = 1000 rdp->last_qlen_last_fqs_check = 3000 rcu_segcblist_n_cbs(rdp) = 2000 rcu_do_batch() { if (offloaded) rdp->last_qlen_fqs_check = rcu_segcblist_n_cbs(rdp) // 2000 // run 1000 callback rcu_segcblist_n_cbs(rdp) = 1000 // Not updating rdp->qlen_last_fqs_check if (count < rdp->qlen_last_fqs_check - qhimark) rdp->qlen_last_fqs_check = count; } call_rcu() * 1001 { __call_rcu_nocb_wake() { // not taking the fqs slowpath: // rcu_segcblist_n_cbs(rdp) == 2001 // rdp->qlen_last_fqs_check == 2000 // qhimark == 1000 if (len > rdp->qlen_last_fqs_check + qhimark) ... } In the case of a non-offloaded scenario, rdp->qlen_last_fqs_check would be 1000 and the fqs slowpath would have executed. 2) If the number of callbacks has increased since the last rdp->qlen_last_fqs_check update (because we recently queued below qhimark callbacks) and the number of callbacks executed in rcu_do_batch() doesn't exceed qhimark for either offloaded or non-offloaded setup, then it's possible that the offloaded scenario later run the force quiescent state slow path on __call_rcu_nocb_wake() while the non-offloaded doesn't. qhimark = 1000 rdp->last_qlen_last_fqs_check = 3000 rcu_segcblist_n_cbs(rdp) = 2000 rcu_do_batch() { if (offloaded) rdp->last_qlen_last_fqs_check = rcu_segcblist_n_cbs(rdp) // 2000 // run 100 callbacks // concurrent queued 100 rcu_segcblist_n_cbs(rdp) = 2000 // Not updating rdp->qlen_last_fqs_check if (count < rdp->qlen_last_fqs_check - qhimark) rdp->qlen_last_fqs_check = count; } call_rcu() * 1001 { __call_rcu_nocb_wake() { // Taking the fqs slowpath: // rcu_segcblist_n_cbs(rdp) == 3001 // rdp->qlen_last_fqs_check == 2000 // qhimark == 1000 if (len > rdp->qlen_last_fqs_check + qhimark) ... } In the case of a non-offloaded scenario, rdp->qlen_last_fqs_check would be 3000 and the fqs slowpath would have executed. The reason for updating rdp->qlen_last_fqs_check when invoking callbacks for offloaded CPUs is that there is usually no point in waking up either the rcuog or rcuoc kthreads while in this state. After all, both threads are prohibited from indefinite sleeps. The exception is when some huge number of callbacks are enqueued while rcu_do_batch() is in the midst of invoking, in which case interrupting the rcuog kthread's timed sleep might get more callbacks set up for the next grace period. Reported-and-tested-by: Valentin Schneider Tested-by: Sebastian Andrzej Siewior Original-patch-by: Thomas Gleixner Signed-off-by: Frederic Weisbecker Cc: Valentin Schneider Cc: Peter Zijlstra Cc: Sebastian Andrzej Siewior Cc: Josh Triplett Cc: Joel Fernandes Cc: Boqun Feng Cc: Neeraj Upadhyay Cc: Uladzislau Rezki Cc: Thomas Gleixner Signed-off-by: Paul E. McKenney commit b3bb02fe5a2b538ae53eda1fe591dd6c81a91ad4 Author: Frederic Weisbecker Date: Tue Oct 19 02:08:10 2021 +0200 rcu/nocb: Make rcu_core() callbacks acceleration (de-)offloading safe When callbacks are offloaded, the NOCB kthreads handle the callbacks progression on behalf of rcu_core(). However during the (de-)offloading process, the kthread may not be entirely up to the task. As a result some callbacks grace period sequence number may remain stale for a while because rcu_core() won't take care of them either. Fix this with forcing callbacks acceleration from rcu_core() as long as the offloading process isn't complete. Reported-and-tested-by: Valentin Schneider Tested-by: Sebastian Andrzej Siewior Signed-off-by: Frederic Weisbecker Cc: Valentin Schneider Cc: Peter Zijlstra Cc: Sebastian Andrzej Siewior Cc: Josh Triplett Cc: Joel Fernandes Cc: Boqun Feng Cc: Neeraj Upadhyay Cc: Uladzislau Rezki Cc: Thomas Gleixner Signed-off-by: Paul E. McKenney commit 24ee940d89277602147ce1b8b4fd87b01b9a6660 Author: Thomas Gleixner Date: Tue Oct 19 02:08:09 2021 +0200 rcu/nocb: Make rcu_core() callbacks acceleration preempt-safe While reporting a quiescent state for a given CPU, rcu_core() takes advantage of the freshly loaded grace period sequence number and the locked rnp to accelerate the callbacks whose sequence number have been assigned a stale value. This action is only necessary when the rdp isn't offloaded, otherwise the NOCB kthreads already take care of the callbacks progression. However the check for the offloaded state is volatile because it is performed outside the IRQs disabled section. It's possible for the offloading process to preempt rcu_core() at that point on PREEMPT_RT. This is dangerous because rcu_core() may end up accelerating callbacks concurrently with NOCB kthreads without appropriate locking. Fix this with moving the offloaded check inside the rnp locking section. Reported-and-tested-by: Valentin Schneider Reviewed-by: Valentin Schneider Tested-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Cc: Peter Zijlstra Cc: Sebastian Andrzej Siewior Cc: Josh Triplett Cc: Joel Fernandes Cc: Boqun Feng Cc: Neeraj Upadhyay Cc: Uladzislau Rezki Cc: Thomas Gleixner Signed-off-by: Frederic Weisbecker Signed-off-by: Paul E. McKenney commit fbb94cbd70d41c7511460896dfc7f9ea5da704b3 Author: Frederic Weisbecker Date: Tue Oct 19 02:08:08 2021 +0200 rcu/nocb: Invoke rcu_core() at the start of deoffloading On PREEMPT_RT, if rcu_core() is preempted by the de-offloading process, some work, such as callbacks acceleration and invocation, may be left unattended due to the volatile checks on the offloaded state. In the worst case this work is postponed until the next rcu_pending() check that can take a jiffy to reach, which can be a problem in case of callbacks flooding. Solve that with invoking rcu_core() early in the de-offloading process. This way any work dismissed by an ongoing rcu_core() call fooled by a preempting deoffloading process will be caught up by a nearby future recall to rcu_core(), this time fully aware of the de-offloading state. Tested-by: Valentin Schneider Tested-by: Sebastian Andrzej Siewior Signed-off-by: Frederic Weisbecker Cc: Valentin Schneider Cc: Peter Zijlstra Cc: Sebastian Andrzej Siewior Cc: Josh Triplett Cc: Joel Fernandes Cc: Boqun Feng Cc: Neeraj Upadhyay Cc: Uladzislau Rezki Cc: Thomas Gleixner Signed-off-by: Paul E. McKenney commit 213d56bf33bdda835bac04046f09256a75c5ca8e Author: Frederic Weisbecker Date: Tue Oct 19 02:08:07 2021 +0200 rcu/nocb: Prepare state machine for a new step Currently SEGCBLIST_SOFTIRQ_ONLY is a bit of an exception among the segcblist flags because it is an exclusive state that doesn't mix up with the other flags. Remove it in favour of: _ A flag specifying that rcu_core() needs to perform callbacks execution and acceleration and _ A flag specifying we want the nocb lock to be held in any needed circumstances This clarifies the code and is more flexible: It allows to have a state where rcu_core() runs with locking while offloading hasn't started yet. This is a necessary step to prepare for triggering rcu_core() at the very beginning of the de-offloading process so that rcu_core() won't dismiss work while being preempted by the de-offloading process, at least not without a pending subsequent rcu_core() that will quickly catch up. Reviewed-by: Valentin Schneider Tested-by: Valentin Schneider Tested-by: Sebastian Andrzej Siewior Signed-off-by: Frederic Weisbecker Cc: Peter Zijlstra Cc: Sebastian Andrzej Siewior Cc: Josh Triplett Cc: Joel Fernandes Cc: Boqun Feng Cc: Neeraj Upadhyay Cc: Uladzislau Rezki Cc: Thomas Gleixner Signed-off-by: Paul E. McKenney commit 118e0d4a1bc85d4ecea0427e440a72d21ffbfa6a Author: Frederic Weisbecker Date: Mon Oct 11 16:51:30 2021 +0200 rcu/nocb: Make local rcu_nocb_lock_irqsave() safe against concurrent deoffloading rcu_nocb_lock_irqsave() can be preempted between the call to rcu_segcblist_is_offloaded() and the actual locking. This matters now that rcu_core() is preemptible on PREEMPT_RT and the (de-)offloading process can interrupt the softirq or the rcuc kthread. As a result we may locklessly call into code that requires nocb locking. In practice this is a problem while we accelerate callbacks on rcu_core(). Simply disabling interrupts before (instead of after) checking the NOCB offload state fixes the issue. Reported-and-tested-by: Valentin Schneider Tested-by: Sebastian Andrzej Siewior Signed-off-by: Frederic Weisbecker Cc: Valentin Schneider Cc: Peter Zijlstra Cc: Sebastian Andrzej Siewior Cc: Josh Triplett Cc: Joel Fernandes Cc: Boqun Feng Cc: Neeraj Upadhyay Cc: Uladzislau Rezki Cc: Thomas Gleixner Signed-off-by: Paul E. McKenney commit 614ddad17f22a22e035e2ea37a04815f50362017 Author: Paul E. McKenney Date: Fri Sep 17 15:04:48 2021 -0700 rcu: Tighten rcu_advance_cbs_nowake() checks Currently, rcu_advance_cbs_nowake() checks that a grace period is in progress, however, that grace period could end just after the check. This commit rechecks that a grace period is still in progress while holding the rcu_node structure's lock. The grace period cannot end while the current CPU's rcu_node structure's ->lock is held, thus avoiding false positives from the WARN_ON_ONCE(). As Daniel Vacek noted, it is not necessary for the rcu_node structure to have a CPU that has not yet passed through its quiescent state. Tested-by: Guillaume Morin Signed-off-by: Paul E. McKenney commit 81f6d49cce2d2fe507e3fddcc4a6db021d9c2e7b Author: Frederic Weisbecker Date: Tue Nov 30 17:21:08 2021 +0100 rcu/exp: Mark current CPU as exp-QS in IPI loop second pass Expedited RCU grace periods invoke sync_rcu_exp_select_node_cpus(), which takes two passes over the leaf rcu_node structure's CPUs. The first pass gathers up the current CPU and CPUs that are in dynticks idle mode. The workqueue will report a quiescent state on their behalf later. The second pass sends IPIs to the rest of the CPUs, but excludes the current CPU, incorrectly assuming it has been included in the first pass's list of CPUs. Unfortunately the current CPU may have changed between the first and second pass, due to the fact that the various rcu_node structures' ->lock fields have been dropped, thus momentarily enabling preemption. This means that if the second pass's CPU was not on the first pass's list, it will be ignored completely. There will be no IPI sent to it, and there will be no reporting of quiescent states on its behalf. Unfortunately, the expedited grace period will nevertheless be waiting for that CPU to report a quiescent state, but with that CPU having no reason to believe that such a report is needed. The result will be an expedited grace period stall. Fix this by no longer excluding the current CPU from consideration during the second pass. Fixes: b9ad4d6ed18e ("rcu: Avoid self-IPI in sync_rcu_exp_select_node_cpus()") Reviewed-by: Neeraj Upadhyay Signed-off-by: Frederic Weisbecker Cc: Uladzislau Rezki Cc: Neeraj Upadhyay Cc: Boqun Feng Cc: Josh Triplett Cc: Joel Fernandes Signed-off-by: Paul E. McKenney commit 790da248978a0722d92d1471630c881704f7eb0d Author: Paul E. McKenney Date: Wed Sep 29 11:09:34 2021 -0700 rcu: Make idle entry report expedited quiescent states In non-preemptible kernels, an unfortunately timed expedited grace period can result in the rcu_exp_handler() IPI handler setting the rcu_data structure's cpu_no_qs.b.exp field just as the target CPU enters idle. There are situations in which this field will not be checked until after that CPU exits idle. The resulting grace-period latency does not qualify as "expedited". This commit therefore checks this field upon non-preemptible idle entry in the rcu_preempt_deferred_qs() function. It also qualifies the rcu_core() preempt_count() check with IS_ENABLED(CONFIG_PREEMPT_COUNT) to prevent false-positive quiescent states from count-free kernels. Reported-by: Neeraj Upadhyay Signed-off-by: Paul E. McKenney commit 147f04b14adde831eb4a0a1e378667429732f9e8 Author: Paul E. McKenney Date: Wed Sep 29 09:21:34 2021 -0700 rcu: Prevent expedited GP from enabling tick on offline CPU If an RCU expedited grace period starts just when a CPU is in the process of going offline, so that the outgoing CPU has completed its pass through stop-machine but has not yet completed its final dive into the idle loop, RCU will attempt to enable that CPU's scheduling-clock tick via a call to tick_dep_set_cpu(). For this to happen, that CPU has to have been online when the expedited grace period completed its CPU-selection phase. This is pointless: The outgoing CPU has interrupts disabled, so it cannot take a scheduling-clock tick anyway. In addition, the tick_dep_set_cpu() function's eventual call to irq_work_queue_on() will splat as follows: smpboot: CPU 1 is now offline WARNING: CPU: 6 PID: 124 at kernel/irq_work.c:95 +irq_work_queue_on+0x57/0x60 Modules linked in: CPU: 6 PID: 124 Comm: kworker/6:2 Not tainted 5.15.0-rc1+ #3 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS +rel-1.14.0-0-g155821a-rebuilt.opensuse.org 04/01/2014 Workqueue: rcu_gp wait_rcu_exp_gp RIP: 0010:irq_work_queue_on+0x57/0x60 Code: 8b 05 1d c7 ea 62 a9 00 00 f0 00 75 21 4c 89 ce 44 89 c7 e8 +9b 37 fa ff ba 01 00 00 00 89 d0 c3 4c 89 cf e8 3b ff ff ff eb ee <0f> 0b eb b7 +0f 0b eb db 90 48 c7 c0 98 2a 02 00 65 48 03 05 91 6f RSP: 0000:ffffb12cc038fe48 EFLAGS: 00010282 RAX: 0000000000000001 RBX: 0000000000005208 RCX: 0000000000000020 RDX: 0000000000000001 RSI: 0000000000000001 RDI: ffff9ad01f45a680 RBP: 000000000004c990 R08: 0000000000000001 R09: ffff9ad01f45a680 R10: ffffb12cc0317db0 R11: 0000000000000001 R12: 00000000fffecee8 R13: 0000000000000001 R14: 0000000000026980 R15: ffffffff9e53ae00 FS: 0000000000000000(0000) GS:ffff9ad01f580000(0000) +knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 000000000de0c000 CR4: 00000000000006e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: tick_nohz_dep_set_cpu+0x59/0x70 rcu_exp_wait_wake+0x54e/0x870 ? sync_rcu_exp_select_cpus+0x1fc/0x390 process_one_work+0x1ef/0x3c0 ? process_one_work+0x3c0/0x3c0 worker_thread+0x28/0x3c0 ? process_one_work+0x3c0/0x3c0 kthread+0x115/0x140 ? set_kthread_struct+0x40/0x40 ret_from_fork+0x22/0x30 ---[ end trace c5bf75eb6aa80bc6 ]--- This commit therefore avoids invoking tick_dep_set_cpu() on offlined CPUs to limit both futility and false-positive splats. Signed-off-by: Paul E. McKenney commit 5401cc5264fff75aea10cf44b380b265d18d17ba Author: Paul E. McKenney Date: Tue Sep 28 11:06:35 2021 -0700 rcu: Mark sync_sched_exp_online_cleanup() ->cpu_no_qs.b.exp load The sync_sched_exp_online_cleanup() is called from rcutree_online_cpu(), which can be invoked with interrupts enabled. This means that the ->cpu_no_qs.b.exp field is subject to data races from the rcu_exp_handler() IPI handler, so this commit marks the load from that field. Signed-off-by: Paul E. McKenney commit 6120b72e25e195b6fa15b0a674479a38166c392a Author: Frederic Weisbecker Date: Thu Sep 16 14:10:48 2021 +0200 rcu: Remove rcu_data.exp_deferred_qs and convert to rcu_data.cpu no_qs.b.exp Having two fields for the same purpose with subtle differences on different RCU flavours is confusing, especially when both fields always exist on both RCU flavours. Fortunately, it is now safe for preemptible RCU to rely on the rcu_data structure's ->cpu_no_qs.b.exp field, just like non-preemptible RCU. This commit therefore removes the ad-hoc ->exp_deferred_qs field. Signed-off-by: Frederic Weisbecker Signed-off-by: Paul E. McKenney commit 6e16b0f7bae3817ea67f4bef4f84298e880fbf66 Author: Frederic Weisbecker Date: Thu Sep 16 14:10:47 2021 +0200 rcu: Move rcu_data.cpu_no_qs.b.exp reset to rcu_export_exp_rdp() On non-preemptible RCU, move clearing of the rcu_data structure's ->cpu_no_qs.b.exp filed to the actual expedited quiescent state report function, matching hw preemptible RCU handles the ->exp_deferred_qs field. This prepares for removing ->exp_deferred_qs in favor of ->cpu_no_qs.b.exp for both preemptible and non-preemptible RCU. Signed-off-by: Frederic Weisbecker Signed-off-by: Paul E. McKenney commit a4382659487f84c00b5fbb61df25a9ad59396789 Author: Frederic Weisbecker Date: Thu Sep 16 14:10:45 2021 +0200 rcu: Ignore rdp.cpu_no_qs.b.exp on preemptible RCU's rcu_qs() Preemptible RCU does not use the rcu_data structure's ->cpu_no_qs.b.exp, instead using a separate ->exp_deferred_qs field to record the need for an expedited quiescent state. In fact ->cpu_no_qs.b.exp should never be set in preemptible RCU because preemptible RCU's expedited grace periods use other mechanisms to record quiescent states. This commit therefore removes the implicit rcu_qs() reference to ->cpu_no_qs.b.exp in favor of a direct reference to ->cpu_no_qs.b.norm. Signed-off-by: Frederic Weisbecker Signed-off-by: Paul E. McKenney commit f7254785d11c7306f4fdf133a68f79c25cca29c5 Author: Dmitry Baryshkov Date: Thu Dec 2 01:51:40 2021 +0300 drm/msm/dpu: fix CDP setup to account for multirect index Client driven prefetch (CDP) is properly setup only for SSPP REC0 currently. Enable client driven prefetch also for SSPP REC1. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20211201225140.2481577-5-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 1e35e3fc3f714045078a6b4fcb4f0fe61df9e328 Author: Dmitry Baryshkov Date: Thu Dec 2 01:51:39 2021 +0300 drm/msm/dpu: simplify DPU_SSPP features checks Add DPU_SSPP_CSC_ANY denoting any CSC block. As we are at it, rewrite DPU_SSPP_SCALER (any scaler) to use BIT(x) instead of hand-coded bitshifts. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20211201225140.2481577-4-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit a67f2cc6f912dd8f8128bf4193e25c10b7ae64b8 Author: Dmitry Baryshkov Date: Thu Dec 2 01:51:38 2021 +0300 drm/msm/dpu: drop pe argument from _dpu_hw_sspp_setup_scaler3 The _dpu_hw_sspp_setup_scaler3 (hw_sspp->setup_scaler) does not use pe argument. Let's remove it while we are cleaning scaled configuration. Reported-by: Dan Carpenter Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20211201225140.2481577-3-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 6f4c23e7cdf30d63c6e97c492b30c6d21d81658c Author: Dmitry Baryshkov Date: Thu Dec 2 01:51:37 2021 +0300 drm/msm/dpu: drop scaler config from plane state Scaler and pixel_ext configuration does not contain a long living state, it is used only during plane update, so remove these two fields from dpu_plane_state and allocate them on stack. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20211201225140.2481577-2-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov commit 8a3b4c17f863cde8e8743edd8faffe916c49b960 Author: Kuogee Hsieh Date: Tue Dec 7 15:15:33 2021 -0800 drm/msm/dp: employ bridge mechanism for display enable and disable Currently the msm_dp_*** functions implement the same sequence which would happen when drm_bridge is used. hence get rid of this intermediate layer and align with the drm_bridge usage to avoid customized implementation. Signed-off-by: Kuogee Hsieh Changes in v2: -- revise commit text -- rename dp_bridge to msm_dp_bridge -- delete empty functions Changes in v3: -- replace kzalloc() with devm_kzalloc() -- replace __dp_display_enable() with dp_display_enable() -- replace __dp_display_disable() with dp_display_disable() Changes in v4: -- msm_dp_bridge_init() called from msm_dp_modeset_init() same as dsi Changes in v5: -- delete attach, mode_fixup and pre_enable from dp_bridge_ops Changes in v6: -- rebase on msm-next-plus-fixes branch Signed-off-by: Kuogee Hsieh Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/1638918933-2544-1-git-send-email-quic_khsieh@quicinc.com Signed-off-by: Rob Clark commit caa24223463dfd75702a24daac13c93edb4aafac Author: Dmitry Baryshkov Date: Fri Oct 15 03:11:00 2021 +0300 drm/msm/hdmi: switch to drm_bridge_connector Merge old hdmi_bridge and hdmi_connector implementations. Use drm_bridge_connector instead. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20211015001100.4193241-2-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 542a5db2476e2b2490b3dd1f18c6c9fa43b5462f Author: Ameer Hamza Date: Sat Dec 4 00:32:53 2021 +0500 drm/msm/dpu: removed logically dead code Fixed coverity warning by removing the dead code Addresses-Coverity: 1494147 ("Logically dead code") Signed-off-by: Ameer Hamza Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20211203193253.108813-1-amhamza.mgc@gmail.com Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 53d22794711ad630f40d59dd726bd260d77d585f Author: Jackie Liu Date: Wed Nov 10 15:09:49 2021 +0800 drm/msm/dp: displayPort driver need algorithm rational Let's select RATIONAL with dp driver. avoid like: [...] x86_64-linux-gnu-ld: drivers/gpu/drm/msm/dp/dp_catalog.o: in function `dp_catalog_ctrl_config_msa': dp_catalog.c:(.text+0x57e): undefined reference to `rational_best_approximation' Fixes: c943b4948b58 ("drm/msm/dp: add displayPort driver support") Reported-by: kernelbot Signed-off-by: Jackie Liu Link: https://lore.kernel.org/r/20211110070950.3355597-2-liu.yun@linux.dev Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit b97d86bb2d30a12b805e39dc15fdcc283d28a44a Author: Yang Li Date: Fri Dec 3 11:36:52 2021 +0800 drm/msm/dpu: remove node from list before freeing the node fix the following smatch warning: drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c:1675 dpu_plane_init() warn: '&pdpu->mplane_list' not removed from list Reported-by: Abaci Robot Signed-off-by: Yang Li Reviewed-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/1638502612-113708-1-git-send-email-yang.lee@linux.alibaba.com Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 12e5eab94463a754f8ed195894eeab2a7fdce8d8 Author: Sean Paul Date: Thu Nov 4 23:04:28 2021 -0400 drm/msm/dp: Re-order dp_audio_put in deinit_sub_modules Audio is initialized last, it should be de-initialized first to match the order in dp_init_sub_modules(). Reviewed-by: Abhinav Kumar Reviewed-by: Stephen Boyd Reviewed-by: Dmitry Baryshkov Signed-off-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20210913175747.47456-12-sean@poorly.run #v1 Link: https://patchwork.freedesktop.org/patch/msgid/20210915203834.1439-12-sean@poorly.run #v2 Link: https://patchwork.freedesktop.org/patch/msgid/20211001151145.55916-12-sean@poorly.run #v3 Changes in v2: -None Changes in v3: -None Changes in v4: -None Link: https://lore.kernel.org/r/20211105030434.2828845-12-sean@poorly.run Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 88e2d5b160738157bf7c32cf9dfa23a11a945d21 Author: Sean Paul Date: Thu Nov 4 23:04:27 2021 -0400 drm/msm/dpu: Remove encoder->enable() hack encoder->commit() was being misused because there were some global resources which needed to be tweaked in encoder->enable() which were not accessible in dpu_encoder.c. That is no longer true and the redirect serves no purpose any longer. So remove the indirection. Tested-by: Stephen Boyd Reviewed-by: Stephen Boyd Reviewed-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Signed-off-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20210913175747.47456-11-sean@poorly.run #v1 Link: https://patchwork.freedesktop.org/patch/msgid/20210915203834.1439-11-sean@poorly.run #v2 Link: https://patchwork.freedesktop.org/patch/msgid/20211001151145.55916-11-sean@poorly.run #v3 Changes in v2: -None Changes in v3: -None Changes in v4: -None Link: https://lore.kernel.org/r/20211105030434.2828845-11-sean@poorly.run Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit fa063950c3c442c8ce66fd1c17cb431534768851 Author: Sean Paul Date: Thu Nov 4 23:04:26 2021 -0400 drm/msm/dpu: Remove useless checks in dpu_encoder A couple more useless checks to remove in dpu_encoder. Reviewed-by: Stephen Boyd Reviewed-by: Abhinav Kumar Reviewed-by: Dmitry Baryshkov Signed-off-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20210913175747.47456-10-sean@poorly.run #v1 Link: https://patchwork.freedesktop.org/patch/msgid/20210915203834.1439-10-sean@poorly.run #v2 Link: https://patchwork.freedesktop.org/patch/msgid/20211001151145.55916-10-sean@poorly.run #v3 Changes in v2: -None Changes in v3: -None Changes in v4: -None Link: https://lore.kernel.org/r/20211105030434.2828845-10-sean@poorly.run Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit b4e7ba4af311f6f620a084b93b7310c49a83cfce Author: Sean Paul Date: Thu Nov 4 23:04:25 2021 -0400 drm/msm/dpu_kms: Re-order dpu includes Make includes alphabetical in dpu_kms.c Reviewed-by: Abhinav Kumar Reviewed-by: Stephen Boyd Reviewed-by: Dmitry Baryshkov Signed-off-by: Sean Paul Link: https://patchwork.freedesktop.org/patch/msgid/20210913175747.47456-9-sean@poorly.run #v1 Link: https://patchwork.freedesktop.org/patch/msgid/20210915203834.1439-9-sean@poorly.run #v2 Link: https://patchwork.freedesktop.org/patch/msgid/20211001151145.55916-9-sean@poorly.run #v3 Changes in v2: -None Changes in v3: -None Changes in v4: -None Link: https://lore.kernel.org/r/20211105030434.2828845-9-sean@poorly.run Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit ca3ffcbeb0c866d9b0cb38eaa2bd4416597b5966 Author: Rob Clark Date: Mon Nov 29 10:23:44 2021 -0800 drm/msm/gpu: Don't allow zero fence_id Elsewhere we treat zero as "no fence" and __msm_gem_submit_destroy() skips removal from fence_idr. We could alternately change this to use negative values for "no fence" but I think it is more clear to not allow zero as a valid fence_id. Signed-off-by: Rob Clark Fixes: a61acbbe9cf8 ("drm/msm: Track "seqno" fences by idr") Link: https://lore.kernel.org/r/20211129182344.292609-1-robdclark@gmail.com Signed-off-by: Rob Clark commit b9c8accbdd511cf68aeffd0bdc955ddaaba49c52 Author: Kuogee Hsieh Date: Mon Dec 6 08:57:26 2021 -0800 drm/msm/dp: Add "qcom, sc7280-dp" to support display port. Changes in v2: -- move "qcom,sc7280-dp" before "qcom,sc7280-edp" Signed-off-by: Kuogee Hsieh Reviewed-by: Stephen Boyd Reviewed by: Dmitry Baryshkov Link: https://lore.kernel.org/r/1638809846-31950-1-git-send-email-quic_khsieh@quicinc.com Signed-off-by: Rob Clark commit a37fae8aaa62b05c11f059fee8fedf4313975abd Author: Hao Xu Date: Tue Dec 7 17:39:50 2021 +0800 io_uring: split io_req_complete_post() and add a helper Split io_req_complete_post(), this is a prep for the next patch. Signed-off-by: Hao Xu Link: https://lore.kernel.org/r/20211207093951.247840-5-haoxu@linux.alibaba.com Signed-off-by: Jens Axboe commit 9f8d032a364b2b579c6ce5a62b967056f8711e69 Author: Hao Xu Date: Tue Dec 7 17:39:49 2021 +0800 io_uring: add helper for task work execution code Add a helper for task work execution code. We will use it later. Reviewed-by: Pavel Begunkov Signed-off-by: Hao Xu Link: https://lore.kernel.org/r/20211207093951.247840-4-haoxu@linux.alibaba.com Signed-off-by: Jens Axboe commit 4813c3779261fab4067edea28155a98c65a41b5f Author: Hao Xu Date: Tue Dec 7 17:39:48 2021 +0800 io_uring: add a priority tw list for irq completion work Now we have a lot of task_work users, some are just to complete a req and generate a cqe. Let's put the work to a new tw list which has a higher priority, so that it can be handled quickly and thus to reduce avg req latency and users can issue next round of sqes earlier. An explanatory case: origin timeline: submit_sqe-->irq-->add completion task_work -->run heavy work0~n-->run completion task_work now timeline: submit_sqe-->irq-->add completion task_work -->run completion task_work-->run heavy work0~n Limitation: this optimization is only for those that submission and reaping process are in different threads. Otherwise anyhow we have to submit new sqes after returning to userspace, then the order of TWs doesn't matter. Tested this patch(and the following ones) by manually replace __io_queue_sqe() in io_queue_sqe() by io_req_task_queue() to construct 'heavy' task works. Then test with fio: ioengine=io_uring sqpoll=1 thread=1 bs=4k direct=1 rw=randread time_based=1 runtime=600 randrepeat=0 group_reporting=1 filename=/dev/nvme0n1 Tried various iodepth. The peak IOPS for this patch is 710K, while the old one is 665K. For avg latency, difference shows when iodepth grow: depth and avg latency(usec): depth new old 1 7.05 7.10 2 8.47 8.60 4 10.42 10.42 8 13.78 13.22 16 27.41 24.33 32 49.40 53.08 64 102.53 103.36 128 196.98 205.61 256 372.99 414.88 512 747.23 791.30 1024 1472.59 1538.72 2048 3153.49 3329.01 4096 6387.86 6682.54 8192 12150.25 12774.14 16384 23085.58 26044.71 Signed-off-by: Hao Xu Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/20211207093951.247840-3-haoxu@linux.alibaba.com Signed-off-by: Jens Axboe commit 24115c4e95e137b73954bbbd94354889552a4b08 Author: Hao Xu Date: Tue Dec 7 17:39:47 2021 +0800 io-wq: add helper to merge two wq_lists add a helper to merge two wq_lists, it will be useful in the next patches. Reviewed-by: Pavel Begunkov Signed-off-by: Hao Xu Link: https://lore.kernel.org/r/20211207093951.247840-2-haoxu@linux.alibaba.com Signed-off-by: Jens Axboe commit 59d58d93af94d7b546f12438b4a3d781b7190095 Merge: c0e5e11af12b7 4f6e14bd19d6d Author: Jakub Kicinski Date: Tue Dec 7 11:36:36 2021 -0800 Merge branch 'mptcp-new-features-for-mptcp-sockets-and-netlink-pm' Mat Martineau says: ==================== mptcp: New features for MPTCP sockets and netlink PM This collection of patches adds MPTCP socket support for a few socket options, ioctls, and one ancillary data type (specifics for each are listed below). There's also a patch modifying the netlink MPTCP path manager API to allow setting the backup flag on a configured interface using the endpoint ID instead of the full IP address. Patches 1 & 2: TCP_INQ cmsg and selftests. Patches 2 & 3: SIOCINQ, OUTQ, and OUTQNSD ioctls and selftests. Patch 5: Change backup flag using endpoint ID. Patches 6 & 7: IP_TOS socket option and selftests. Patches 8-10: TCP_CORK and TCP_NODELAY socket options. Includes a tcp change to expose __tcp_sock_set_cork() and __tcp_sock_set_nodelay() for use by MPTCP. ==================== Link: https://lore.kernel.org/r/20211203223541.69364-1-mathew.j.martineau@linux.intel.com Signed-off-by: Jakub Kicinski commit 4f6e14bd19d6de7831f31cfb3210f2ea93eeb038 Author: Maxim Galaganov Date: Fri Dec 3 14:35:41 2021 -0800 mptcp: support TCP_CORK and TCP_NODELAY First, add cork and nodelay fields to the mptcp_sock structure so they can be used in sync_socket_options(), and fill them on setsockopt while holding the msk socket lock. Then, on setsockopt set proper tcp_sk(ssk)->nonagle values for subflows by calling __tcp_sock_set_cork() or __tcp_sock_set_nodelay() on the ssk while holding the ssk socket lock. tcp_push_pending_frames() will be invoked on the ssk if a cork was cleared or nodelay was set. Also set MPTCP_PUSH_PENDING bit by calling mptcp_check_and_set_pending(). This will lead to __mptcp_push_pending() being called inside mptcp_release_cb() with new tcp_sk(ssk)->nonagle. Also add getsockopt support for TCP_CORK and TCP_NODELAY. Acked-by: Paolo Abeni Reviewed-by: Matthieu Baerts Signed-off-by: Maxim Galaganov Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 8b38217a2a98df6240c0cddb6f18d04923e24277 Author: Maxim Galaganov Date: Fri Dec 3 14:35:40 2021 -0800 mptcp: expose mptcp_check_and_set_pending Expose the mptcp_check_and_set_pending() function for use inside MPTCP sockopt code. The next patch will call it when TCP_CORK is cleared or TCP_NODELAY is set on the MPTCP socket in order to push pending data from mptcp_release_cb(). Acked-by: Paolo Abeni Reviewed-by: Matthieu Baerts Signed-off-by: Maxim Galaganov Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 6fadaa565882cd7afc501de5921db6f5e45c784b Author: Maxim Galaganov Date: Fri Dec 3 14:35:39 2021 -0800 tcp: expose __tcp_sock_set_cork and __tcp_sock_set_nodelay Expose __tcp_sock_set_cork() and __tcp_sock_set_nodelay() for use in MPTCP setsockopt code -- namely for syncing MPTCP socket options with subflows inside sync_socket_options() while already holding the subflow socket lock. Acked-by: Paolo Abeni Acked-by: Matthieu Baerts Signed-off-by: Maxim Galaganov Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit edb596e80cee8f9cab4c37907c8004456e5b3581 Author: Florian Westphal Date: Fri Dec 3 14:35:38 2021 -0800 selftests: mptcp: check IP_TOS in/out are the same Check that getsockopt(IP_TOS) returns what setsockopt(IP_TOS) did set right before. Also check that socklen_t == 0 and -1 input values match those of normal tcp sockets. Reviewed-by: Matthieu Baerts Signed-off-by: Florian Westphal Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 3b1e21eb60e8d4aa42474fed606a8ea8767b0120 Author: Florian Westphal Date: Fri Dec 3 14:35:37 2021 -0800 mptcp: getsockopt: add support for IP_TOS earlier patch added IP_TOS setsockopt support, this allows to get the value set by earlier setsockopt. Extends mptcp_put_int_option to handle u8 input/output by adding required cast. Reviewed-by: Matthieu Baerts Signed-off-by: Florian Westphal Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 602837e8479d20d49559b4b97b79d34c0efe7ecb Author: Davide Caratti Date: Fri Dec 3 14:35:36 2021 -0800 mptcp: allow changing the "backup" bit by endpoint id a non-zero 'id' is sufficient to identify MPTCP endpoints: allow changing the value of 'backup' bit by simply specifying the endpoint id. Link: https://github.com/multipath-tcp/mptcp_net-next/issues/158 Signed-off-by: Davide Caratti Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit b51880568f20250cc62057f4b747c8212ac3e06c Author: Florian Westphal Date: Fri Dec 3 14:35:35 2021 -0800 selftests: mptcp: add inq test case client & server use a unix socket connection to communicate outside of the mptcp connection. This allows the consumer to know in advance how many bytes have been (or will be) sent by the peer. This allows stricter checks on the bytecounts reported by TCP_INQ cmsg. Suggested-by: Mat Martineau Signed-off-by: Florian Westphal Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 644807e3e4629b3fbb99032401f57a0f7e06f506 Author: Florian Westphal Date: Fri Dec 3 14:35:34 2021 -0800 mptcp: add SIOCINQ, OUTQ and OUTQNSD ioctls Allows to query in-sequence data ready for read(), total bytes in write queue and total bytes in write queue that have not yet been sent. v2: remove unneeded READ_ONCE() (Paolo Abeni) v3: check for new data unconditionally in SIOCINQ ioctl (Mat Martineau) Signed-off-by: Florian Westphal Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 5cbd886ce2a9f4627ff9cdab1bc97a401a24b309 Author: Florian Westphal Date: Fri Dec 3 14:35:33 2021 -0800 selftests: mptcp: add TCP_INQ support Do checks on the returned inq counter. Fail on: 1. Huge value (> 1 kbyte, test case files are 1 kb) 2. last hint larger than returned bytes when read was short 3. erronenous indication of EOF. 3) happens when a hint of X bytes reads X-1 on next call but next recvmsg returns more data (instead of EOF). Signed-off-by: Florian Westphal Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit 2c9e77659a0c8d7ce96af3e420914ace1e3f7d21 Author: Florian Westphal Date: Fri Dec 3 14:35:32 2021 -0800 mptcp: add TCP_INQ cmsg support Support the TCP_INQ setsockopt. This is a boolean that tells recvmsg path to include the remaining in-sequence bytes in the cmsg data. v2: do not use CB(skb)->offset, increment map_seq instead (Paolo Abeni) v3: adjust CB(skb)->map_seq when taking skb from ofo queue (Paolo Abeni) Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/224 Signed-off-by: Florian Westphal Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski commit b1a4da64bfc189510e08df1ccb1c589e667dc7a3 Author: Kamal Heib Date: Mon Dec 6 22:13:14 2021 +0200 RDMA/qedr: Fix reporting max_{send/recv}_wr attrs Fix the wrongly reported max_send_wr and max_recv_wr attributes for user QP by making sure to save their valuse on QP creation, so when query QP is called the attributes will be reported correctly. Fixes: cecbcddf6461 ("qedr: Add support for QP verbs") Link: https://lore.kernel.org/r/20211206201314.124947-1-kamalheib1@gmail.com Signed-off-by: Kamal Heib Acked-by: Michal Kalderon  Signed-off-by: Jason Gunthorpe commit e4dc81ed5a8069b8ae56116058ebbad77ff559ec Author: Alexander Aring Date: Tue Nov 30 14:47:20 2021 -0500 fs: dlm: memory cache for lowcomms hotpath This patch introduces a kmem cache for dlm_msg handles which are used always if dlm sends a message out. Even if their are covered by midcomms layer or not. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 3af2326ca0a13cf84aeb75e001e757ff3cefeae9 Author: Alexander Aring Date: Tue Nov 30 14:47:19 2021 -0500 fs: dlm: memory cache for writequeue_entry This patch introduces a kmem cache for writequeue entry. A writequeue entry get quite a lot allocated if dlm transmit messages. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 6c547f264077ffeb56390f42ed2a07749dd619b2 Author: Alexander Aring Date: Tue Nov 30 14:47:18 2021 -0500 fs: dlm: memory cache for midcomms hotpath This patch will introduce a kmem cache for allocating message handles which are needed for midcomms layer to take track of lowcomms messages. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit be3b0400edbf68556cd390125e2c868988616391 Author: Alexander Aring Date: Tue Nov 30 14:47:17 2021 -0500 fs: dlm: remove wq_alloc mutex This patch cleanups the code for allocating a new buffer in the dlm writequeue mechanism. There was a possible tuneup to allow scheduling while a new writequeue entry needs to be allocated because either no sending page is available or are full. To avoid multiple concurrent users checking at the same time if an entry is available or full alloc_wq was introduce that those are waiting if there is currently a new writequeue entry in process to be queued so possible further users will check on the new allocated writequeue entry if it's full. To simplify the code we just remove this mutex and switch that the already introduced spin lock will be held during writequeue check, allocation and queueing. So other users can never check on available writequeues while there is a new one in process but not queued yet. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 21d9ac1a5376d949199398848006f6b14649f533 Author: Alexander Aring Date: Tue Nov 30 14:47:16 2021 -0500 fs: dlm: use event based wait for pending remove This patch will use an event based waitqueue to wait for a possible clash with the ls_remove_name field of dlm_ls instead of doing busy waiting. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit bcbfea41e1f9d516faed1faf0f2d390c000bf0d9 Author: Alexander Aring Date: Tue Nov 30 14:47:15 2021 -0500 fs: dlm: check for pending users filling buffers Currently we don't care if the DLM application stack is filling buffers (not committed yet) while we transmit some already committed buffers. By checking on active writequeue users before dequeue a writequeue entry we know there is coming more data and do nothing. We wait until the send worker will be triggered again if the writequeue entry users hit zero. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit f70813d6a5fce7bde411272cfe1ab565a4254266 Author: Alexander Aring Date: Tue Nov 30 14:47:14 2021 -0500 fs: dlm: use list_empty() to check last iteration This patch will use list_empty(&ls->ls_cb_delay) to check for last list iteration. In case of a multiply count of MAX_CB_QUEUE and the list is empty we do a extra goto more which we can avoid by checking on list_empty(). Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit c0e5e11af12b76d0dbed700c1088c6827cdcf56c Author: Eric Dumazet Date: Mon Dec 6 21:56:03 2021 -0800 vrf: use dev_replace_track() for better tracking vrf_rt6_release() and vrf_rtable_release() changes dst->dev Instead of dev_hold(ndev); dev_put(odev); We should use dev_replace_track(odev, ndev, &dst->dev_tracker, GFP_KERNEL); If we do not transfer dst->dev_tracker to the new device, we will get warnings from ref_tracker_dir_exit() when odev is finally dismantled. Fixes: 9038c320001d ("net: dst: add net device refcount tracking to dst_entry") Signed-off-by: Eric Dumazet Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20211207055603.1926372-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit 977df8bd5844c9370c26a9477418165b870da27c Author: Arnd Bergmann Date: Tue Dec 7 16:14:36 2021 +0100 iwlwifi: work around reverse dependency on MEI If the iwlmei code is a loadable module, the main iwlwifi driver cannot be built-in: x86_64-linux-ld: drivers/net/wireless/intel/iwlwifi/pcie/trans.o: in function `iwl_pcie_prepare_card_hw': trans.c:(.text+0x4158): undefined reference to `iwl_mei_is_connected' Unfortunately, Kconfig enforces the opposite, forcing the MEI driver to not be built-in if iwlwifi is a module. To work around this, decouple iwlmei from iwlwifi and add the dependency in the other direction. Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20211207151447.3338818-1-arnd@kernel.org Signed-off-by: Luca Coelho commit 3c021931023a30316db415044531b116b85e6ebd Author: Claudio Suarez Date: Sun Oct 17 13:35:00 2021 +0200 drm/amdgpu: replace drm_detect_hdmi_monitor() with drm_display_info.is_hdmi Once EDID is parsed, the monitor HDMI support information is available through drm_display_info.is_hdmi. The amdgpu driver still calls drm_detect_hdmi_monitor() to retrieve the same information, which is less efficient. Change to drm_display_info.is_hdmi This is a TODO task in Documentation/gpu/todo.rst Reviewed-by: Harry Wentland Signed-off-by: Claudio Suarez Signed-off-by: Alex Deucher commit 0b7778f4a63a1e0dc10af27201b99d88fc0ee7b0 Author: Claudio Suarez Date: Sun Oct 17 13:34:59 2021 +0200 drm/amdgpu: use drm_edid_get_monitor_name() instead of duplicating the code Use drm_edid_get_monitor_name() instead of duplicating the code that parses the EDID in dm_helpers_parse_edid_caps() Reviewed-by: Harry Wentland Signed-off-by: Claudio Suarez Signed-off-by: Alex Deucher commit 20543be93ca45968f344261c1a997177e51bd7e1 Author: Claudio Suarez Date: Sun Oct 17 13:34:58 2021 +0200 drm/amdgpu: update drm_display_info correctly when the edid is read drm_display_info is updated by drm_get_edid() or drm_connector_update_edid_property(). In the amdgpu driver it is almost always updated when the edid is read in amdgpu_connector_get_edid(), but not always. Change amdgpu_connector_get_edid() and amdgpu_connector_free_edid() to keep drm_display_info updated. Reviewed-by: Harry Wentland Signed-off-by: Claudio Suarez Signed-off-by: Alex Deucher commit d374d3b493215d637b9e7be12a93f22caf4c1f97 Author: Nicholas Kazlauskas Date: Tue Dec 7 09:46:39 2021 -0500 drm/amd/display: Fix out of bounds access on DNC31 stream encoder regs [Why] During dcn31_stream_encoder_create, if PHYC/D get remapped to F/G on B0 then we'll index 5 or 6 into a array of length 5 - leading to an access violation on some configs during device creation. [How] Software won't be touching PHYF/PHYG directly, so just extend the array to cover all possible engine IDs. Even if it does by try to access one of these registers by accident the offset will be 0 and we'll get a warning during the access. Fixes: 2fe9a0e1173f ("drm/amd/display: Fix DCN3 B0 DP Alt Mapping") Reviewed-by: Harry Wentland Signed-off-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher commit cf63b702720d734cb4144440d72d4b2ac6c494f8 Author: Stanley.Yang Date: Tue Dec 7 14:28:58 2021 +0800 drm/amdgpu: skip umc ras error count harvest remove in recovery stat check, skip umc ras err cnt harvest in amdgpu_ras_log_on_err_counter Signed-off-by: Stanley.Yang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 30c1e391978180dab913132201b944c08054c822 Author: Flora Cui Date: Thu Dec 2 15:47:56 2021 +0800 drm/amdgpu: free vkms_output after use Signed-off-by: Flora Cui Reviewed-by: Leslie Shi Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit f7ed3f90b2c69ddd2414d9839ae334c10a606c55 Author: Flora Cui Date: Wed Nov 24 15:53:17 2021 +0800 drm/amdgpu: drop the critial WARN_ON in amdgpu_vkms Signed-off-by: Flora Cui Reviewed-by: Leslie Shi Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 6fc429c81a64b0b77fea38809b01ae94a9348025 Author: Aric Cyr Date: Fri Nov 26 21:20:09 2021 -0500 drm/amd/display: Reduce stack usage Reduce stack usage by moving an unnecessary structure copy to a pointer. Reviewed-by: Joshua Aberback Acked-by: Pavle Kotarac Signed-off-by: Aric Cyr Signed-off-by: Alex Deucher commit 41f91315b5be5a5fd4011c193f6a14fee34fd027 Author: Nicholas Kazlauskas Date: Sun Nov 28 12:10:14 2021 -0500 drm/amd/display: Query DMCUB for dp alt status [Why] To avoid hanging RDPCSPIPE when INTERCEPTB isn't set. DMCUB owns control of that bit so DMCUB should manage returning the information driver needs for link encoder control. [How] Add a new DMCUB command to return dp alt disable and dp4 information. Reviewed-by: Hansen Dsouza Acked-by: Pavle Kotarac Signed-off-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher commit 32b119c896121e71ccf1202499e7f0292c73e1f5 Author: Anthony Koo Date: Sat Nov 27 21:12:20 2021 -0500 drm/amd/display: [FW Promotion] Release 0.0.96 Acked-by: Pavle Kotarac Signed-off-by: Anthony Koo Signed-off-by: Alex Deucher commit 800de20b1dbdfd85e303a42b0f27c0162ce18698 Author: Wenjing Liu Date: Fri Nov 26 14:18:59 2021 -0500 drm/amd/display: add a debug option to force dp2 lt fallback method [why] A debug option is needed to temporarily force dp2 new link training fallback method for debugging purpose. Reviewed-by: George Shen Acked-by: Pavle Kotarac Signed-off-by: Wenjing Liu Signed-off-by: Alex Deucher commit eb9e59ebfe7354c18d7d6f59211fc7a7b794d019 Author: Oliver Logush Date: Wed Nov 24 17:24:05 2021 -0500 drm/amd/display: Rename a struct field to describe a cea component better [why] Need to fix the code so it does not use reserved keywords [how] Change the total_length member of the cea struct Reviewed-by: Anthony Koo Acked-by: Pavle Kotarac Signed-off-by: Oliver Logush Signed-off-by: Alex Deucher commit 1e146bb88e26b6d5454326f7591662eb095afbd8 Author: Meenakshikumar Somasundaram Date: Thu Nov 25 18:31:26 2021 -0500 drm/amd/display: Adding dpia debug bits for hpd delay [Why] Need to have dpia debug bits for configuring hpd delay. [How] Added hpd_delay_in_ms variable in dpia_debug_options. Reviewed-by: Jimmy Kizito Acked-by: Pavle Kotarac Signed-off-by: meenakshikumar somasundaram Signed-off-by: Alex Deucher commit 7b201d53bc77e8517bd78348385b6362dfa33a4f Author: Jude Shih Date: Tue Nov 23 13:53:00 2021 +0800 drm/amd/display: Move link_enc init logic to DC [Why] We shouldn't be accessing res_pool funcs from DM level, therefore, we should create API and let the flow be done in DC level. [How] We create new interface dp_get_link_enc to access and get the correct link_enc Reviewed-by: Nicholas Kazlauskas Acked-by: Pavle Kotarac Signed-off-by: Jude Shih Signed-off-by: Alex Deucher commit 4bef85d4c9491415b7931407b07f24841c1e0390 Author: Wayne Lin Date: Fri Nov 26 15:19:57 2021 +0800 drm/amd/display: Fix bug in debugfs crc_win_update entry [Why] crc_rd_wrk shouldn't be null in crc_win_update_set(). Current programming logic is inconsistent in crc_win_update_set(). [How] Initially, return if crc_rd_wrk is NULL. Later on, we can use member of crc_rd_wrk safely. Reported-by: kernel test robot Reported-by: Dan Carpenter Fixes: 9a65df193108 ("drm/amd/display: Use PSP TA to read out crc") Reviewed-by: Rodrigo Siqueira Acked-by: Pavle Kotarac Signed-off-by: Wayne Lin Signed-off-by: Alex Deucher commit a1f5e392de78f122629412d6e4350d1c887f1711 Author: Mikita Lipski Date: Mon Nov 15 16:07:38 2021 -0500 drm/amd/display: prevent reading unitialized links [why/how] The function can be called on boot or after suspend when links are not initialized, to prevent it guard it with NULL pointer check Reviewed-by: Nicholas Kazlauskas Acked-by: Pavle Kotarac Signed-off-by: Mikita Lipski Signed-off-by: Alex Deucher commit e885d64785aa56e10e432c3319e3b5b0a2d30ac2 Author: Jarif Aftab Date: Wed Nov 24 13:44:52 2021 -0500 drm/amd/display: Added Check For dc->res_pool [WHY] -To ensure dc->res_pool has been initialized [HOW] -Check if dc->res_pool is true in the if statement Reviewed-by: Martin Leung Acked-by: Pavle Kotarac Signed-off-by: Jarif Aftab Signed-off-by: Alex Deucher commit d29b7980b55ebe96ba167aeb88e81775c141f659 Author: Wyatt Wood Date: Wed Nov 24 12:50:20 2021 -0500 drm/amd/display: Prevent PSR disable/reenable in HPD IRQ [Why] When HPD IRQ occurs, it triggers a PSR disable and reenable directly through dc layer. Since it does not pass through the power layer, the layer that tracks whether PSR is enabled or disabled and which masks are set, this layer is now out of sync with the real PSR state in FW. Theoretically PSR can be enabled during hw programming sequences or any other situation where we must disable PSR. [How] Check if PSR is enabled before doing PSR disable/reenable. Reviewed-by: Anthony Koo Acked-by: Pavle Kotarac Signed-off-by: Wyatt Wood Signed-off-by: Alex Deucher commit be1ac692c08971486d68a88f39fc4e2cecb80a8e Author: Nicholas Kazlauskas Date: Tue Nov 23 11:56:38 2021 -0500 drm/amd/display: Fix DPIA outbox timeout after S3/S4/reset [Why] The HW interrupt gets disabled after S3/S4/reset so we don't receive notifications for HPD or AUX from DMUB - leading to timeout and black screen with (or without) DPIA links connected. [How] Re-enable the interrupt after S3/S4/reset like we do for the other DC interrupts. Guard both instances of the outbox interrupt enable or we'll hang during restore on ASIC that don't support it. Fixes: 524a0ba6fab955 ("drm/amd/display: Fix DPIA outbox timeout after GPU reset") Reviewed-by: Jude Shih Acked-by: Pavle Kotarac Signed-off-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher commit 81bb9bc95355055e2fa297b9a81e9d786eca9903 Author: George Shen Date: Sat Nov 20 18:35:15 2021 -0500 drm/amd/display: Add W/A for PHY tests with certain LTTPR [Why] Certain LTTPR require output VS/PE to be explicitly set during PHY test automation. [How] Add vendor-specific sequence to set LTTPR output VS/PE. Reviewed-by: Jun Lei Acked-by: Pavle Kotarac Signed-off-by: George Shen Signed-off-by: Alex Deucher commit d682619557120a5f2d460b822f5ff922435a5261 Author: George Shen Date: Fri Nov 19 20:03:20 2021 -0500 drm/amd/display: Apply LTTPR workarounds to non-transparent mode [Why] Some of the vendor-specific workarounds added for transparent mode also need to be applied to non-transparent mode in order to succeed link training consistently. [How] Remove transparent mode check for the required workarounds. Reviewed-by: Jun Lei Acked-by: Pavle Kotarac Signed-off-by: George Shen Signed-off-by: Alex Deucher commit aed1faab9d9563ca5ac5139b0170486027ec74a7 Author: Stanley.Yang Date: Fri Dec 3 13:08:41 2021 +0800 drm/amdgpu: only skip get ecc info for aldebaran skip get ecc info for aldebarn through check ip version do not affect other asic type Signed-off-by: Stanley.Yang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 27cc310f13529bcf24518854b10f098de7fd7d6d Author: chen gong Date: Thu Dec 2 16:47:54 2021 +0800 drm/amdkfd: Correct the value of the no_atomic_fw_version variable 145: navi10 IP_VERSION(10, 1, 10) navi12 IP_VERSION(10, 1, 2) navi14 IP_VERSION(10, 1, 1) 92: sienna_cichlid IP_VERSION(10, 3, 0) navy_flounder IP_VERSION(10, 3, 2) vangogh IP_VERSION(10, 3, 1) dimgrey_cavefish IP_VERSION(10, 3, 4) beige_goby IP_VERSION(10, 3, 5) yellow_carp IP_VERSION(10, 3, 3) Signed-off-by: chen gong Acked-by: Alex Deucher Reviewed-by: Graham Sider Signed-off-by: Alex Deucher commit 4b992db6ebdaaee244a7931753f5b49d049a760a Author: Johannes Berg Date: Sat Dec 4 17:49:44 2021 +0200 iwlwifi: mvm: optionally suppress assert log Normally, when we hit an assert, we print out all the assert data. However, in certain tests, when we trigger it from debugfs intentionally, that can be useless and confusing. Allow writing the string "nolog\n" to the fw_nmi and fw_restart files suppressing the assert dump as well as - in the case of fw_restart - the iwlwifi 0000:00:00.0: FW error in SYNC CMD REPLY_ERROR message. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211204174546.75e29a2ab68d.Id3064feda2ce7a77c116c6d6e71ce5ff447c6e86@changeid Signed-off-by: Luca Coelho commit 953e66a7238b90ba1d0766ce3342bad799f83b52 Author: Yaara Baruch Date: Sat Dec 4 17:49:43 2021 +0200 iwlwifi: add new ax1650 killer device Add new Qu-Hr killer device id. Signed-off-by: Yaara Baruch Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211204174546.997c250b9edc.Id50730e3e342297432eed47cdf9678ee16cf6d17@changeid Signed-off-by: Luca Coelho commit 04f1ee24040308baf29a1ffc0831430445d56e7a Author: Johannes Berg Date: Sat Dec 4 17:49:42 2021 +0200 iwlwifi: fw: correctly detect HW-SMEM region subtype This is part of the "device memory" type, but with the subtypes we can now detect it properly, rather than having to make assumptions on the ID. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211204174546.91d33aa9dd3d.Ifb48e21fbb92ea25360856b5cc2afbb9b485d6b3@changeid Signed-off-by: Luca Coelho commit 23a392a44a3cabf43515f7601373a2094ac5f747 Author: Johannes Berg Date: Sat Dec 4 17:49:41 2021 +0200 iwlwifi: implement reset flow for Bz devices On Bz devices, UREG_DOORBELL_TO_ISR6_NMI_BIT no longer actually triggers an NMI. So instead of setting BIT(0) | BIT(1) for the reset flow, we need to just set BIT(1) and then force the NMI in the new way. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211204174546.6b56e7ee1773.I71cba66e17cc0daabc5ad7abd88763674b625c82@changeid Signed-off-by: Luca Coelho commit def423ea1d0de18b38ac7c43118a4c328ff70406 Author: Yaara Baruch Date: Sat Dec 4 17:49:40 2021 +0200 iwlwifi: add new Qu-Hr device Add new Qu-Hr device ID. Signed-off-by: Yaara Baruch Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211204174546.c68af5f8d7ce.I37894e98080161c3bca6f33b99a5b8812166ee41@changeid Signed-off-by: Luca Coelho commit 9c13f21f7c2c645da95c9543785ccd7e4022b6a1 Author: Matti Gottlieb Date: Sat Dec 4 17:49:39 2021 +0200 iwlwifi: Fix FW name for gl Fix FW name for gl use the crf fm and not fm7, since the later no longer exists. Signed-off-by: Matti Gottlieb Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211204174546.497b2f2c587d.If71fa8cbed043c15f927bb78cb8a695625a362dd@changeid Signed-off-by: Luca Coelho commit 1599a16492336ec47dfbf3780d3e90c2f0df965d Author: Mukesh Sisodiya Date: Sat Dec 4 17:49:38 2021 +0200 iwlwifi: dbg: disable ini debug in 8000 family and below Yoyo based debug is not applicable for 8000 and below old devices. The check added in code has 9000 and below familiy which is corrected. Signed-off-by: Mukesh Sisodiya Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211204174546.b6176a5bc198.Ib8e4b1e60e0b6c1538cc4f384dcf681b3db097ce@changeid Signed-off-by: Luca Coelho commit c593d2fae592aefaec86f012e1354400b8ac4715 Author: Ayala Barazani Date: Sat Dec 4 17:49:37 2021 +0200 iwlwifi: support SAR GEO Offset Mapping override via BIOS Support reading the SAR Geographic Offset Mapping (SGOM) table from UEFI to allow OEMs to override the values according to geographical regions. Signed-off-by: Ayala Barazani Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211204174546.e6dfd8b5dd40.Ibc9a8fe2bfde345f49df5d57ec56663da6a53dc4@changeid Signed-off-by: Luca Coelho commit 15bf5ac6cd93b655ef82c6bb837cb3c19bce7f36 Author: Johannes Berg Date: Sat Dec 4 17:49:36 2021 +0200 iwlwifi: pcie: retake ownership after reset In most cases, unless shutting down the NIC, we really need to retake ownership after doing a software reset of the NIC. Encode that into the API so we "automatically" do it, even in case of workarounds, and don't keep forgetting it like a few of the places we have did. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211204174545.458f9d98ac21.I40b9a22df1ab8178cc838fc83d5190e689dfac6a@changeid Signed-off-by: Luca Coelho commit b780c10f1f8c504264dfb7da3c735ce80c586a6b Author: Johannes Berg Date: Sat Dec 4 17:49:35 2021 +0200 iwlwifi: mvm: always use 4K RB size by default When we use 2K RBs, we cannot receive all valid 802.11 frames, including e.g. long beacons, since up to 2304 bytes are valid (plus metadata and also encryption overhead etc.). Increase the RB size to be always 4K to avoid that. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211204174545.675781ab0da5.I5c653f4c7dd726f8ad40077e4a109b85e7c0cdb1@changeid Signed-off-by: Luca Coelho commit e93d4aaf4b13963bdd50d11e154ecc251cba4ac7 Author: Johannes Berg Date: Sat Dec 4 17:49:34 2021 +0200 iwlwifi: mvm/api: define system control command The firmware is exposing a new system features control command, define the necessary data structures etc. Rename "soc.h" to "system.h" since the SoC command is also in the system group and adding another file for just one more struct seemed like a waste of files. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211204174545.94a120687887.I79acffcf0793ea9e4ddec24b06420961bfb4fe94@changeid Signed-off-by: Luca Coelho commit a2263adab8bf722b5a4c981d8fc1b7c821820240 Author: Luca Coelho Date: Sat Dec 4 17:49:33 2021 +0200 iwlwifi: bump FW API to 68 for AX devices Start supporting API version 68 for AX devices. Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211204174545.695e3db16cf5.Ie94a3ad1c7a300cff7ecde26a732779159ec919e@changeid Signed-off-by: Luca Coelho commit 1e8b7f43774aa15b95d93923a032b0fee1ed1964 Author: Johannes Berg Date: Sat Dec 4 13:10:53 2021 +0200 iwlwifi: mvm: add some missing command strings Some command strings in the system group weren't added for debug, add them now. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211204130722.5bbda292908e.I53cefd74547a745fd29261a795c94611e7ee8d1d@changeid Signed-off-by: Luca Coelho commit 62ed5d905b70c6508b33bc9470cb5db001460a03 Author: Mordechay Goodstein Date: Sat Dec 4 13:10:52 2021 +0200 iwlwifi: fw: add support for splitting region type bits In next region tlv (3) region type is going to be split into bit mask without affecting the ops for handling region type, so we just mask the type independent of the version due to all versions having the same bits usage. Signed-off-by: Mordechay Goodstein Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211204130722.083e4b47055e.If7483d854e3d07f81236d314b8155cd5996f306c@changeid Signed-off-by: Luca Coelho commit e5178014f9e20dea4361839f4d9342bb442dc410 Author: Yaara Baruch Date: Sat Dec 4 13:10:51 2021 +0200 iwlwifi: swap 1650i and 1650s killer struct names The names of the killer 1650i and 1650s devices weren't aligned. This patch swap the names in the structs. Signed-off-by: Yaara Baruch Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211204130722.4e992a115f14.Icacedcc06f33e5457f650290e7deea22bf1ca12d@changeid Signed-off-by: Luca Coelho commit dc276ffd0754e94080565c10b964f3c211879fdd Author: Miri Korenblit Date: Sat Dec 4 13:10:50 2021 +0200 iwlwifi: acpi: fix wgds rev 3 size The exact size of WGDS revision 3 was calculated using the wrong parameters. Fix it. Signed-off-by: Miri Korenblit Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211204130722.12c5b0cffe52.I7f342502f628f43a7e000189a699484bcef0f562@changeid Signed-off-by: Luca Coelho commit 020cde4750c5b20be309e028dec9950520384c1e Author: Mukesh Sisodiya Date: Sat Dec 4 13:10:49 2021 +0200 iwlwifi: yoyo: support for DBGC4 for dram Add DBGC4 memory for debug handling in driver which will be created, freed and collected from the FW in case of crash. Signed-off-by: Mukesh Sisodiya Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211204130722.488268ffb2a6.I4fd9ee9dc43d04953a640e19ecac7575ad34fe94@changeid Signed-off-by: Luca Coelho commit d9e95e35289ff2054c72ca691345bf2c404301be Author: Mordechay Goodstein Date: Sat Dec 4 13:10:48 2021 +0200 iwlwifi: mvm: update rate scale in moving back to assoc state In assoc state we only use narrow bandwidth, due to phy/radio not configured to max bandwidth. Signed-off-by: Mordechay Goodstein Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211204130722.139d74d2b063.I4cfbb594c110ea9b250e2306c30601f847db2c1a@changeid Signed-off-by: Luca Coelho commit 8e967c137df3b236d2075f9538cb888129425d1a Author: Shaul Triebitz Date: Sat Dec 4 13:10:47 2021 +0200 iwlwifi: mvm: avoid clearing a just saved session protection id When scheduling a session protection the id is saved but then it may be cleared when calling iwl_mvm_te_clear_data (if a previous session protection is currently active). Fix it by saving the id after calling iwl_mvm_te_clear_data. Signed-off-by: Shaul Triebitz Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211204130722.b0743a588d14.I098fef6677d0dab3ef1b6183ed206a10bab01eb2@changeid Signed-off-by: Luca Coelho commit 6324c173ff4af5a0974baca09b168d527205bd19 Author: Mordechay Goodstein Date: Sat Dec 4 13:10:46 2021 +0200 iwlwifi: mvm: add support for statistics update version 15 The main changes are remove the respond from STATISTICS_CMD and sending it with STATISTICS_NOTIFICATION, and updating for all mac id's and phy id's in one notification. Signed-off-by: Mordechay Goodstein Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211204130722.832c7b599202.If192dce8f51ec13005999c3ff96fe09a73cd8f91@changeid Signed-off-by: Luca Coelho commit ba16c04fab0fac9f31bd44b5c575ab771e38847f Author: Ilan Peer Date: Sat Dec 4 13:10:45 2021 +0200 iwlwifi: mvm: Add support for a new version of scan request command The scan request command is identical in binary format to the previous scan request command and the only change is now a previously reserved octet is used to indicate new flags introduced in the command. Align the code to support the new version and the previous one. Later patches would add the specific handling for the new flags. Signed-off-by: Ilan Peer Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211204130722.392a4af559bc.Ib8f1e3b527453531c10bfd7f4b116d3e257c7f1f@changeid Signed-off-by: Luca Coelho commit 7e32281d07c51fe6dd98ccaf36ccb4d4387972ff Author: Ilan Peer Date: Sat Dec 4 13:10:44 2021 +0200 iwlwifi: mvm: Fix wrong documentation for scan request command Signed-off-by: Ilan Peer Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211204130722.26c8bd826c83.Iefc78689607561573d8afbc7c5d3797abfbe875e@changeid Signed-off-by: Luca Coelho commit 4743a72fa5adc3cdcf4a596e99a982725db4e2e5 Author: Luca Coelho Date: Sat Dec 4 13:10:43 2021 +0200 iwlwifi: add missing entries for Gf4 with So and SoF We need to support platforms with So and SoF together with Gf4 radio modules. The difference is that these devices support CDB, so add the entries accordingly. Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211204130722.e7fa5b87fbdb.Ib47ff1dc082366b570649dfd8a2b24f0d6c52b5b@changeid Signed-off-by: Luca Coelho commit d5d8ee526d1401173ad1261c3b6388a4f947e0a3 Author: Emmanuel Grumbach Date: Sat Dec 4 13:10:42 2021 +0200 iwlwifi: mvm: remove session protection upon station removal When the station is removed we need to remove the session protection that may be still running. Note that we need also to remove the session protection upon unassoc in case the station is kept in the AUTH state. Signed-off-by: Emmanuel Grumbach Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211204130722.483977310ca2.If7eba02594f20dabd22d758e1c917fbca54b2ddd@changeid Signed-off-by: Luca Coelho commit 94cc0b9e12c02954a9f8a560ad703eba6073de38 Author: Luca Coelho Date: Sat Dec 4 08:35:55 2021 +0200 iwlwifi: remove unused iwlax210_2ax_cfg_so_hr_a0 structure We don't use this structure anymore, except for a check that will never match, so we can remove this structure entirely. Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211204083238.c41548abd174.I6bb4f6058fd85e1dd92cd056b6eaca1cb4aa74a3@changeid Signed-off-by: Luca Coelho commit 26e9ccb3c800d87828a2bf87a3b6de3a8c069b08 Author: Johannes Berg Date: Sat Dec 4 08:35:54 2021 +0200 iwlwifi: mvm: add support for PHY context command v4 A new version of this command deprecates the rxchain_info field but is otherwise the same, so treat it the same way. We already leave the rxchain_info zeroed since the RLC command is supported. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211204083238.aca5bd78518e.I2f1b4b38899717851ea9f5b6dd23cde27e10387a@changeid Signed-off-by: Luca Coelho commit f4340baff9c23be65e7becf91e2e9bb1b77f92ac Author: Johannes Berg Date: Sat Dec 4 08:35:53 2021 +0200 iwlwifi: fw: api: add link to PHY context command struct v1 There are two possible versions of this command in use today, add a link to v1 as well in the documentation. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211204083238.d7c4ed8e85e0.I524a84e03068ecf7c3125ad028f0ca465d41c0f3@changeid Signed-off-by: Luca Coelho commit c48e93a65487aedc9334bcaec4abce63e204241f Author: Johannes Berg Date: Sat Dec 4 08:35:52 2021 +0200 iwlwifi: mvm: support RLC configuration command There's an RLC configuration command in the firmware that's going to replace the chain information in the PHY context. Add support for this command, while leaving the PHY context fields unset when we know the RLC command will be used. Also add support to send only the RLC configuration command if only the # of chains used on the PHY context changes. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211204083238.55faa3782bb0.I3f9d0071e680cab513c59b093d0827af99d41c51@changeid Signed-off-by: Luca Coelho commit 2dc977423cbf762bbc6a7237b4294a9099ad10d3 Author: Johannes Berg Date: Sat Dec 4 08:35:51 2021 +0200 iwlwifi: mvm: d3: support v12 wowlan status Newer firmware versions are going to come with a new version of the wowlan status API, which gives us replay counters for both GTKs that might still be in use, as well as unifying the layout of the counters to just be 64-bit quantities. Extend our code to handle this case and be able to install replay counters for both keys, if they're sent up from the firmware. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211204083238.73637acafe0b.I33e27712a12fff2816edc0a8abda1759259e20d7@changeid Signed-off-by: Luca Coelho commit 708d8c5385a4cf63760d0932387f2cce9e8c9d8f Author: Johannes Berg Date: Sat Dec 4 08:35:50 2021 +0200 iwlwifi: mvm: parse firmware alive message version 6 There's a new version with some addition, we'll need to do something with the additional data later, but for now just parse it so we don't fail with the newer firmware. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211204083238.f856cb190a4e.I77e3ff5a92b1bcc3e81c1344b046dade0a8b6a24@changeid Signed-off-by: Luca Coelho commit af08571d39254a8ef71422e213f59baf38351d55 Author: Haim Dreyfuss Date: Sat Dec 4 08:35:49 2021 +0200 iwlwifi: pcie: support Bz suspend/resume trigger Instead of using two bits in the doorbell interrupt, the new Bz devices have a new CSR_IPC_SLEEP_CONTROL register to let drivers indicate the desired transition before triggering the doorbell interrupt. Signed-off-by: Haim Dreyfuss Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211204083238.63f3d150689a.Iaeb6f9b007e81b1a5a02144b0281935e4613cb78@changeid Signed-off-by: Luca Coelho commit 87209b7fc2c54a5d8b75fca4452012d2e93df3e0 Author: Johannes Berg Date: Sat Dec 4 08:35:48 2021 +0200 iwlwifi: mvm: d3: move GTK rekeys condition Move the GTK rekeying condition into iwl_mvm_set_key_rx_seq() so we can modify it in the next patch. In the next firmware API revision we'll properly get data for both active GTKs and will have to install it accordingly. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211204083238.f309942ddd15.Iaa95c602f3a681dd464e10ce2de047aa86fac19c@changeid Signed-off-by: Luca Coelho commit f738e705975f591c2acd5ed79d5c5e496c986773 Author: Mike Golant Date: Sat Dec 4 08:35:47 2021 +0200 iwlwifi: add support for Bz-Z HW Add support for Bz Z step HW with GF RF. Signed-off-by: Mike Golant Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211204083238.fc8626515758.Ibfeffc8bb071f9773ea189992ebef056f51be1be@changeid Signed-off-by: Luca Coelho commit 55c6d8f89dab6d9bed0165dd4c134856975bd000 Author: Mike Golant Date: Tue Dec 7 16:05:51 2021 +0200 iwlwifi: support 4-bits in MAC step value We have a MAC component (which is inside the SoC) and it has several different HW steps. 3 bits used to be enough but now we need 4-bits to represent all the different steps. Properly support 4-bits in the MAC step value by refactoring all the current handling of the MAC step/dash. Already from family 8000 and up the dash (bits 0-1) no longer exists and the step (until 8000 bits 2-3) consists of the dash bits as well. To do this remove the CSR_HW_REV_STEP and the CSR_HW_REV_DASH macros, replace them with CSR_HW_REV_STEP_DASH and add hw_rev_step into the trans struct. In addition remove the CSR_HW_IF_CONFIG_REG_MSK_MAC_STEP and CSR_HW_IF_CONFIG_REG_MSK_MAC_DASH macros and create a new macro combining the 2 (this way we don't need shifting or anything else.) Signed-off-by: Matti Gottlieb Signed-off-by: Mike Golant Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211207160459.2e81a14d1f80.Ia5287e37fb3439d805336837361f6491f958e465@changeid Signed-off-by: Luca Coelho commit db66abeea3aefed481391ecc564fb7b7fb31d742 Author: Johannes Berg Date: Sat Dec 4 08:35:45 2021 +0200 iwlwifi: mvm: synchronize with FW after multicast commands If userspace installs a lot of multicast groups very quickly, then we may run out of command queue space as we send the updates in an asynchronous fashion (due to locking concerns), and the CPU can create them faster than the firmware can process them. This is true even when mac80211 has a work struct that gets scheduled. Fix this by synchronizing with the firmware after sending all those commands - outside of the iteration we can send a synchronous echo command that just has the effect of the CPU waiting for the prior asynchronous commands to finish. This also will cause fewer of the commands to be sent to the firmware overall, because the work will only run once when rescheduled multiple times while it's running. Link: https://bugzilla.kernel.org/show_bug.cgi?id=213649 Suggested-by: Emmanuel Grumbach Reported-by: Maximilian Ernestus Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211204083238.51aea5b79ea4.I88a44798efda16e9fe480fb3e94224931d311b29@changeid Signed-off-by: Luca Coelho commit 2438d430868e1676f5b1e476c8982e88217fe66c Author: Johannes Berg Date: Sat Dec 4 08:35:44 2021 +0200 iwlwifi: mvm: fix delBA vs. NSSN queue sync race If we happen to decide an NSSN queue sync (IWL_MVM_RXQ_NSSN_SYNC) for some remaining packets that are still on the queue, but just after we've decided to do a delBA (which causes its own queues sync with IWL_MVM_RXQ_NOTIF_DEL_BA) we can end up with a sequence of events like this: CPU 1 CPU 2 remove BA session with baid N send IWL_MVM_RXQ_NOTIF_DEL_BA send IWL_MVM_RXQ_NSSN_SYNC get IWL_MVM_RXQ_NOTIF_DEL_BA get IWL_MVM_RXQ_NOTIF_DEL_BA get IWL_MVM_RXQ_NSSN_SYNC complete IWL_MVM_RXQ_NOTIF_DEL_BA remove N from baid_map[] get IWL_MVM_RXQ_NSSN_SYNC WARN_ON(!baid_map[N]) Thus, there's a race that leads in hitting the WARN_ON, but more importantly, it's a race that potentially even results in a new aggregation session getting assigned to baid N. To fix this, remove the WARN_ON() in the NSSN_SYNC case, we can't completely protect against hitting this case, so we shouldn't be warning. However, guard ourselves against BAID reuse by doing yet another round of queue synchronization after the entry is removed from the baid_map, so that it cannot be reused with any in-flight IWL_MVM_RXQ_NSSN_SYNC messages. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211204083237.44abbbc50f40.I5492600dfe513356555abe2d7df0e2835846e3d8@changeid Signed-off-by: Luca Coelho commit 3fe6d228a0b45a205849daa110b908e8a4dbed80 Author: Zhu Yanjun Date: Tue Dec 7 14:40:57 2021 -0500 RDMA/rxe: Remove the unnecessary variable The variable pkey is assigned from a macro. Then this variable is passed to a function bth_init directly, and pkey is not used again. So remove it and use the macro directly. Fixes: 76251e15ea73 ("RDMA/rxe: Remove pkey table") Link: https://lore.kernel.org/r/20211207194057.713289-1-yanjun.zhu@linux.dev Signed-off-by: Zhu Yanjun Signed-off-by: Jason Gunthorpe commit 600b790309864fcc311b5dc701f8dc5c3b81374c Author: Pali Rohár Date: Wed Nov 24 16:41:16 2021 +0100 arm: ioremap: Remove unused ARM-specific function pci_ioremap_io() This function is not used by any driver anymore. So completely remove it. Link: https://lore.kernel.org/r/20211124154116.916-6-pali@kernel.org Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi Reviewed-by: Russell King (Oracle) commit 6198461ef509356e7f0fe5b04e88009aa698a065 Author: Pali Rohár Date: Wed Nov 24 16:41:15 2021 +0100 arm: ioremap: Replace pci_ioremap_io() usage by pci_remap_iospace() Replace all usage of ARM specific pci_ioremap_io() function by standard PCI core API function pci_remap_iospace() in all drivers and ARM mach code. Link: https://lore.kernel.org/r/20211124154116.916-5-pali@kernel.org Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi Reviewed-by: Russell King (Oracle) Reviewed-by: Alexandre Belloni commit f8378c0403813fd7cdf0eb5cb878b1ff290046c4 Author: Douglas Anderson Date: Mon Dec 6 16:29:16 2021 -0800 drm/bridge: parade-ps8640: Add backpointer to drm_device in drm_dp_aux When we added the support for the AUX channel in commit 13afcdd7277e ("drm/bridge: parade-ps8640: Add support for AUX channel") we forgot to set "drm_dev" to avoid the warning splat at the beginning of drm_dp_aux_register(). Since everything was working I guess I never noticed the splat when testing against mainline. In any case, it's easy to fix. This is basically just like commit 6cba3fe43341 ("drm/dp: Add backpointer to drm_device in drm_dp_aux") but just for the parade-ps8640. Fixes: 13afcdd7277e ("drm/bridge: parade-ps8640: Add support for AUX channel") Signed-off-by: Douglas Anderson Reviewed-by: Philip Chen Link: https://patchwork.freedesktop.org/patch/msgid/20211206162907.1.I1f5d1eba741e4663050ec1b8e39a753f6e42e38b@changeid commit 6fadb494a638d8b8a55864ecc6ac58194f03f327 Author: Takashi Iwai Date: Tue Dec 7 17:51:46 2021 +0100 ALSA: seq: Set upper limit of processed events Currently ALSA sequencer core tries to process the queued events as much as possible when they become dispatchable. If applications try to queue too massive events to be processed at the very same timing, the sequencer core would still try to process such all events, either in the interrupt context or via some notifier; in either away, it might be a cause of RCU stall or such problems. As a potential workaround for those problems, this patch adds the upper limit of the amount of events to be processed. The remaining events are processed in the next batch, so they won't be lost. For the time being, it's limited up to 1000 events per queue, which should be high enough for any normal usages. Reported-by: Zqiang Reported-by: syzbot+bb950e68b400ab4f65f8@syzkaller.appspotmail.com Link: https://lore.kernel.org/r/20211102033222.3849-1-qiang.zhang1211@gmail.com Link: https://lore.kernel.org/r/20211207165146.2888-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 42c632b0555ed0500ff26b329e194fe77d2b6123 Author: yangcong Date: Wed Dec 1 10:32:30 2021 +0800 drm/panel: Update Boe-tv110c9m and Inx-hj110iz initial code At present, we have enough panel to confirm the effect, update the initial code to achieve the best effect. Such as gamma, Gop timing. They are all minor modifications and doesn't affect the lighting of the panel. a)Boe-tv110c9m panel Optimized touch horizontal grain. b)Inx-hj110iz panel Optimized GOP timing and gamma. Signed-off-by: yangcong Reviewed-by: Douglas Anderson Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20211201023230.344976-1-yangcong5@huaqin.corp-partner.google.com commit 8aca46f91c42020bc58cd56e464a1101e517aa10 Author: Luiz Augusto von Dentz Date: Fri Dec 3 16:15:40 2021 -0800 Bluetooth: mgmt: Introduce mgmt_alloc_skb and mgmt_send_event_skb This introduces mgmt_alloc_skb and mgmt_send_event_skb which are convenient when building MGMT events that have variable length as the likes of skb_put_data can be used to insert portion directly on the skb instead of having to first build an intermediate buffer just to be copied over the skb. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 995d948cf2e45834275f07afc1c9881a9902e73c Author: Mark Chen Date: Tue Dec 7 01:33:43 2021 +0800 Bluetooth: btusb: Return error code when getting patch status failed If there are failure cases in getting patch status, it should return the error code (-EIO). Fixes: fc342c4dc4087 ("Bluetooth: btusb: Add protocol support for MediaTek MT7921U USB devices") Co-developed-by: Sean Wang Signed-off-by: Sean Wang Signed-off-by: Mark Chen Signed-off-by: Marcel Holtmann commit 00c0ee9850b7b0cb7c40b8daba806ae2245e59d4 Author: Mark Chen Date: Tue Dec 7 01:33:42 2021 +0800 Bluetooth: btusb: Handle download_firmware failure cases For Mediatek chipset, it can not enabled if there are something wrong in btmtk_setup_firmware_79xx(). Thus, the process must be terminated and returned error code. Fixes: fc342c4dc4087 ("Bluetooth: btusb: Add protocol support for MediaTek MT7921U USB devices") Co-developed-by: Sean Wang Signed-off-by: Sean Wang Signed-off-by: Mark Chen Signed-off-by: Marcel Holtmann commit 9a667031b9228222e7c577b39189caca5ca5bd96 Author: Luiz Augusto von Dentz Date: Mon Dec 6 11:27:01 2021 -0800 Bluetooth: msft: Fix compilation when CONFIG_BT_MSFTEXT is not set This fixes compilation when CONFIG_BT_MSFTEXT is not set. Fixes: 6b3d4c8fcf3f2 ("Bluetooth: hci_event: Use of a function table to handle HCI events") Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 853b70b506a20cddf96419e8ac198df92e51bc4c Author: Luiz Augusto von Dentz Date: Fri Dec 3 14:07:23 2021 -0800 Bluetooth: hci_sync: Set Privacy Mode when updating the resolving list This adds support for Set Privacy Mode when updating the resolving list when HCI_CONN_FLAG_DEVICE_PRIVACY so the controller shall use Device Mode for devices programmed in the resolving list, Device Mode is actually required when the remote device are not able to use RPA as otherwise the default mode is Network Privacy Mode in which only allows RPAs thus the controller would filter out advertisement using identity addresses for which there is an IRK. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 6126ffabba6b415bd6bf3e1b091ef074e86765c6 Author: Luiz Augusto von Dentz Date: Fri Dec 3 14:07:22 2021 -0800 Bluetooth: Introduce HCI_CONN_FLAG_DEVICE_PRIVACY device flag This introduces HCI_CONN_FLAG_DEVICE_PRIVACY which can be used by userspace to indicate to the controller to use Device Privacy Mode to a specific device. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 800fe5ec302e1ebbf5e3f891f886deecd49c7132 Author: Luiz Augusto von Dentz Date: Fri Dec 3 14:38:13 2021 -0800 Bluetooth: btusb: Add support for queuing during polling interval This makes btusb to queue ACL and events during a polling interval by using of a delayed work, with the interval working as a time window where frames received from different endpoints are considered to be arrived at same time and then attempt to resolve potential conflics by processing the events ahead of ACL packets. It worth noting though that priorizing events over ACL data may result in inverting the order compared to how they appeared over the air, for instance there may be packets received before a disconnect event that will be discarded and unencrypted packets received before encryption change which would considered encrypted, because of these potential changes on the order the support for queuing during the polling interval is not enabled by default so it requires setting force_poll_sync debugfs while the adapter is down. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit fe92ee6425a2c79ee84f0b9b8a14117200d15f7d Author: Luiz Augusto von Dentz Date: Wed Dec 1 11:49:50 2021 -0800 Bluetooth: hci_core: Rework hci_conn_params flags This reworks hci_conn_params flags to use bitmap_* helpers and add support for setting the supported flags in hdev->conn_flags so it can easily be accessed. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 6f59f991b4e735323f099ac6490e725ae8c750a5 Author: Luiz Augusto von Dentz Date: Wed Dec 1 11:49:49 2021 -0800 Bluetooth: MGMT: Use hci_dev_test_and_{set,clear}_flag This make use of hci_dev_test_and_{set,clear}_flag instead of doing 2 operations in a row. Fixes: cbbdfa6f33198 ("Bluetooth: Enable controller RPA resolution using Experimental feature") Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 801b4c027b44a185292007d3cf7513999d644723 Author: Aditya Garg Date: Thu Dec 2 12:42:59 2021 +0000 Bluetooth: btbcm: disable read tx power for some Macs with the T2 Security chip Some Macs with the T2 security chip had Bluetooth not working. To fix it we add DMI based quirks to disable querying of LE Tx power. Signed-off-by: Aditya Garg Reported-by: Orlando Chamberlain Tested-by: Orlando Chamberlain Link: https://lore.kernel.org/r/4970a940-211b-25d6-edab-21a815313954@protonmail.com Fixes: 7c395ea521e6 ("Bluetooth: Query LE tx power on startup") Cc: stable@vger.kernel.org Signed-off-by: Marcel Holtmann commit d2f8114f9574509580a8506d2ef72e7e43d1a5bd Author: Aditya Garg Date: Thu Dec 2 12:41:59 2021 +0000 Bluetooth: add quirk disabling LE Read Transmit Power Some devices have a bug causing them to not work if they query LE tx power on startup. Thus we add a quirk in order to not query it and default min/max tx power values to HCI_TX_POWER_INVALID. Signed-off-by: Aditya Garg Reported-by: Orlando Chamberlain Tested-by: Orlando Chamberlain Link: https://lore.kernel.org/r/4970a940-211b-25d6-edab-21a815313954@protonmail.com Fixes: 7c395ea521e6 ("Bluetooth: Query LE tx power on startup") Cc: stable@vger.kernel.org Signed-off-by: Marcel Holtmann commit 16ada83b9a59a50a6e869d2986fb757007392939 Author: Sean Wang Date: Fri Dec 3 11:30:04 2021 +0800 Bluetooth: btmtksdio: enable AOSP extension for MT7921 Similar to MT7921 btusb, we enable AOSP extension for MT7921 btmtksdio as well. Signed-off-by: Sean Wang Signed-off-by: Marcel Holtmann commit 630491ffd53cd2237445bd058e8d95662666947b Author: Łukasz Bartosik Date: Wed Dec 1 21:13:51 2021 +0100 Bluetooth: btmtksdio: enable msft opcode Enable msft opcode for mt7921 chip. Signed-off-by: Łukasz Bartosik Signed-off-by: Marcel Holtmann commit e8c42585dc6032624a9728d8cf99d974e931d4bc Author: Zijun Hu Date: Fri Dec 3 18:01:37 2021 +0800 Bluetooth: btusb: Add one more Bluetooth part for WCN6855 Add a USB ID 0489:e0e3 of HP to usb_device_id table for WCN6855. -Device(0489:e0e3) from /sys/kernel/debug/usb/devices T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=12 MxCh= 0 D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=0489 ProdID=e0e3 Rev= 0.01 C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms I: If#= 1 Alt= 6 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 63 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 63 Ivl=1ms I: If#= 1 Alt= 7 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 65 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 65 Ivl=1ms Signed-off-by: Zijun Hu Signed-off-by: Marcel Holtmann commit 147306ccbbba23e89481980141d11637948e345d Author: Luiz Augusto von Dentz Date: Wed Dec 1 10:55:06 2021 -0800 Bluetooth: hci_event: Use of a function table to handle Command Status This change the use of switch statement to a function table which is easier to extend. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit c8992cffbe7411c6da4c4416d5eecfc6b78e0fec Author: Luiz Augusto von Dentz Date: Wed Dec 1 10:55:05 2021 -0800 Bluetooth: hci_event: Use of a function table to handle Command Complete This change the use of switch statement to a function table which is easier to extend and can include min/max length of each command. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 95118dd4edfec950898a00180c6f998df0a6406d Author: Luiz Augusto von Dentz Date: Wed Dec 1 10:55:04 2021 -0800 Bluetooth: hci_event: Use of a function table to handle LE subevents This change the use of switch statement to a function table which is easier to extend and can include min/max length of each subevent. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 3e54c5890c87a30b1019a3de9dab968ff2b21e06 Author: Luiz Augusto von Dentz Date: Wed Dec 1 10:55:03 2021 -0800 Bluetooth: hci_event: Use of a function table to handle HCI events This change the use of switch statement to a function table which is easier to extend and can include min/max length of each HCI event. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit a3679649a19179813c3853b8bb397a801d9dd253 Author: Luiz Augusto von Dentz Date: Wed Dec 1 10:55:02 2021 -0800 Bluetooth: HCI: Use skb_pull_data to parse LE Direct Advertising Report event This uses skb_pull_data to check the LE Direct Advertising Report events received have the minimum required length. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit b48b833f9e8aa0675820a3b5a0f30d7319590ea8 Author: Luiz Augusto von Dentz Date: Wed Dec 1 10:55:01 2021 -0800 Bluetooth: HCI: Use skb_pull_data to parse LE Ext Advertising Report event This uses skb_pull_data to check the LE Extended Advertising Report events received have the minimum required length. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 47afe93c913a4cd0143667b59ba622086a2acfce Author: Luiz Augusto von Dentz Date: Wed Dec 1 10:55:00 2021 -0800 Bluetooth: HCI: Use skb_pull_data to parse LE Advertising Report event This uses skb_pull_data to check the LE Advertising Report events received have the minimum required length. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 12cfe4176ad67e4b31be89dde63220c1569794c4 Author: Luiz Augusto von Dentz Date: Wed Dec 1 10:54:59 2021 -0800 Bluetooth: HCI: Use skb_pull_data to parse LE Metaevents This uses skb_pull_data to check the LE Metaevents received have the minimum required length. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 70a6b8de6af5c3e517bfd2ce8dccbd65c3f5bb4f Author: Luiz Augusto von Dentz Date: Wed Dec 1 10:54:58 2021 -0800 Bluetooth: HCI: Use skb_pull_data to parse Extended Inquiry Result event This uses skb_pull_data to check the Extended Inquiry Result events received have the minimum required length. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 8d08d324fdcb7729f22b236a3e20fa37a8a29e43 Author: Luiz Augusto von Dentz Date: Wed Dec 1 10:54:57 2021 -0800 Bluetooth: HCI: Use skb_pull_data to parse Inquiry Result with RSSI event This uses skb_pull_data to check the Inquiry Result with RSSI events received have the minimum required length. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 27d9eb4bcac16446ddbbea8860c11720b7afa891 Author: Luiz Augusto von Dentz Date: Wed Dec 1 10:54:56 2021 -0800 Bluetooth: HCI: Use skb_pull_data to parse Inquiry Result event This uses skb_pull_data to check the Inquiry Result events received have the minimum required length. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit aadc3d2f42a5bfcec597bfd0d997e3982f740846 Author: Luiz Augusto von Dentz Date: Wed Dec 1 10:54:55 2021 -0800 Bluetooth: HCI: Use skb_pull_data to parse Number of Complete Packets event This uses skb_pull_data to check the Number of Complete Packets events received have the minimum required length. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit e3f3a1aea8719ac76bb9443bc3abc975250e1f98 Author: Luiz Augusto von Dentz Date: Wed Dec 1 10:54:54 2021 -0800 Bluetooth: HCI: Use skb_pull_data to parse Command Complete event This uses skb_pull_data to check the Command Complete events received have the minimum required length. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit ae61a10d9d46c4a0844c46d0863bf991c4dda66c Author: Luiz Augusto von Dentz Date: Wed Dec 1 10:54:53 2021 -0800 Bluetooth: HCI: Use skb_pull_data to parse BR/EDR events This uses skb_pull_data to check the BR/EDR events received have the minimum required length. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 13244cccc2b61ec715f0ac583d3037497004d4a5 Author: Luiz Augusto von Dentz Date: Wed Dec 1 10:54:52 2021 -0800 skbuff: introduce skb_pull_data Like skb_pull but returns the original data pointer before pulling the data after performing a check against sbk->len. This allows to change code that does "struct foo *p = (void *)skb->data;" which is hard to audit and error prone, to: p = skb_pull_data(skb, sizeof(*p)); if (!p) return; Which is both safer and cleaner. Acked-by: Jakub Kicinski Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Dan Carpenter Signed-off-by: Marcel Holtmann commit ea7e26ebe6a90fe7962823a70ac91f010df71239 Author: Geert Uytterhoeven Date: Fri Dec 3 14:22:55 2021 +0100 pinctrl: renesas: r8a779a0: Align comments Align the CANFD4_TX and AVB2_MDC comments with all others. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/886ef84ea6b8314d348953792c9616b3e5dc28c0.1638537704.git.geert+renesas@glider.be commit 44e009607444f64d173f0c884e815edabc093024 Author: Yoshihiro Shimoda Date: Wed Dec 1 16:33:08 2021 +0900 arm64: defconfig: Enable R-Car S4-8 Enable the Renesas R-Car S4-8 (R8A779F0) SoC in the ARM64 defconfig. Signed-off-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20211201073308.1003945-15-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Geert Uytterhoeven commit 08b8699eb369d1b416c146922edfe827b41757a4 Author: Yoshihiro Shimoda Date: Wed Dec 1 16:33:07 2021 +0900 arm64: dts: renesas: Add Renesas Spider boards support Initial support for the Renesas Spider CPU and BreakOut boards. Signed-off-by: Yoshihiro Shimoda Tested-by: Takehito Nakamura Link: https://lore.kernel.org/r/20211201073308.1003945-14-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Geert Uytterhoeven commit c62331e8222f8f21faae600effd32b972bb43850 Author: Yoshihiro Shimoda Date: Wed Dec 1 16:33:06 2021 +0900 arm64: dts: renesas: Add Renesas R8A779F0 SoC support Add initial support for the Renesas R8A779F0 (R-Car S4-8) SoC. Signed-off-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20211201073308.1003945-13-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Geert Uytterhoeven commit 35ae0d00ab5a10bf88819d2def0f61fc5937ff69 Merge: 82ce79391d0ec 81c1655823237 Author: Geert Uytterhoeven Date: Tue Dec 7 16:52:36 2021 +0100 Merge tag 'renesas-r8a779f0-dt-binding-defs-tag' into renesas-arm-dt-for-v5.17 Renesas R-Car S4-8 DT Binding Definitions Clock and Power Domain definitions for the Renesas R-Car S4-8 (R8A77FA0) SoC, shared by driver and DT source files. commit 363b41dd25397f553bebf87594eca9b2d6445b55 Author: Yoshihiro Shimoda Date: Wed Dec 1 16:33:04 2021 +0900 soc: renesas: rcar-rst: Add support for R-Car S4-8 Add support for R-Car S4-8 (R8A779F0) to the R-Car RST driver. The register map of R-Car S4-8 is the same as R-Car V3U so that renames "V3U" and "r8a779a0" to "Gen4". Signed-off-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20211201073308.1003945-11-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Geert Uytterhoeven commit 9711633587f4fb4376265781c75e39c2a7b21d6f Author: Yoshihiro Shimoda Date: Wed Dec 1 16:33:01 2021 +0900 soc: renesas: Identify R-Car S4-8 Add support for identifying the R-Car S4-8 (R8A779F0) SoC. Signed-off-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20211201073308.1003945-8-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Geert Uytterhoeven commit 654d5fdb8923994f5e79a7f0faf722958d1d759f Author: Yoshihiro Shimoda Date: Wed Dec 1 16:33:00 2021 +0900 soc: renesas: r8a779f0-sysc: Add r8a779f0 support Add support for R-Car S4-8 (R8A779F0) SoC power areas and register access. Signed-off-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20211201073308.1003945-7-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Geert Uytterhoeven commit 5ca77c9d80d3e5e3dec27217e580195f09ca4673 Merge: e62906d6315f6 81c1655823237 Author: Geert Uytterhoeven Date: Tue Dec 7 16:47:34 2021 +0100 Merge tag 'renesas-r8a779f0-dt-binding-defs-tag' into renesas-drivers-for-v5.17 Renesas R-Car S4-8 DT Binding Definitions Clock and Power Domain definitions for the Renesas R-Car S4-8 (R8A77FA0) SoC, shared by driver and DT source files. commit e62906d6315f652b80640df0f980086462a4953b Author: Yoshihiro Shimoda Date: Wed Dec 1 16:32:59 2021 +0900 soc: renesas: rcar-gen4-sysc: Introduce R-Car Gen4 SYSC driver According to the official website [1], the R-Car V3U SoC is based on the R-Car Gen4 architecture. So, introduce R-Car Gen4 SYSC driver. [1] https://www.renesas.com/us/en/products/automotive-products/automotive-system-chips-socs/r-car-v3u-best-class-r-car-v3u-asil-d-system-chip-automated-driving Signed-off-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20211201073308.1003945-6-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Geert Uytterhoeven commit 403c521003a1364fd2d7c01a2a1f66ed025fb94a Author: Takashi Iwai Date: Tue Dec 7 16:33:23 2021 +0100 ALSA: mixart: Add sanity check for timer notify streams The miXart timer notification is a variable length, and if a hardware is screwed up, we may access over the actual data size. Let's add a sanity check and bail out if an invalid value is received. Link: https://lore.kernel.org/r/20211207153323.27098-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 81c1655823237eaec74b2c175ae8e13adfccdaf7 Author: Yoshihiro Shimoda Date: Wed Dec 1 16:32:57 2021 +0900 dt-bindings: clock: Add r8a779f0 CPG Core Clock Definitions Add all Clock Pulse Generator Core Clock Outputs for the Renesas R-Car S4-8 (R8A779F0) SoC. Signed-off-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20211201073308.1003945-4-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Geert Uytterhoeven commit 500daa0e6be292edcf635ba6b090b89da80e90a8 Author: Yoshihiro Shimoda Date: Wed Dec 1 16:32:56 2021 +0900 dt-bindings: power: Add r8a779f0 SYSC power domain definitions Add power domain indices for R-Car S4-8 (r8a779f0). Signed-off-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20211201073308.1003945-3-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Geert Uytterhoeven commit d01986bec3887a3dbf61cbd821979f91cf0bb2dc Author: Yoshihiro Shimoda Date: Wed Dec 1 16:32:55 2021 +0900 dt-bindings: arm: renesas: Document Renesas Spider boards Add device tree bindings documentation for Renesas R-Car S4-8 Spider CPU and BreakOut boards. Signed-off-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20211201073308.1003945-2-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Geert Uytterhoeven commit cea7f78d85f3f6ba05f43754600426b0e84abbbd Author: Wen Gong Date: Mon Nov 29 06:09:39 2021 -0500 ath11k: change to use dynamic memory for channel list of scan Currently there are about 60 channels for 6 GHz, then the size of chan_list in struct scan_req_params which is 40 is not enough to fill all the channel list of 6 GHz. Use dynamic memory to save the channel list of scan. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211129110939.15711-1-quic_wgong@quicinc.com commit 18ae1ab04525507ae5528245a6df004cacd0d39a Author: Seevalamuthu Mariappan Date: Mon Nov 29 16:15:54 2021 +0530 ath11k: Fix QMI file type enum value bdf_type for caldata in QMI_WLANFW_BDF_DOWNLOAD_REQ_V01 is wrongly sent as 1. But, expected bdf_type value for caldata and EEPROM is 2 and 3 respectively. It leads to firmware crash. Fix ath11k_qmi_file_type enum values. Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1 Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00192-QCAHKSWPL_SILICONZ-1 Fixes: 336e7b53c82f ("ath11k: clean up BDF download functions") Signed-off-by: Seevalamuthu Mariappan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1638182754-18408-1-git-send-email-quic_seevalam@quicinc.com commit d1147a316b53df9cb0152e415ec41dcb6ea62c1c Author: Baochen Qiang Date: Mon Nov 29 10:56:12 2021 +0800 ath11k: add support for WCN6855 hw2.1 Ath11k fails to probe WCN6855 hw2.1 chip: [ 6.983821] ath11k_pci 0000:06:00.0: enabling device (0000 -> 0002) [ 6.983841] ath11k_pci 0000:06:00.0: Unsupported WCN6855 SOC hardware version: 18 17 This is caused by the wrong bit mask setting of hardware major version: for QCA6390/QCN6855, it should be BIT8-11, not BIT8-16, so change the definition to GENMASK(11, 8). Also, add a separate entry for WCN6855 hw2.1 in ath11k_hw_params. Please note that currently WCN6855 hw2.1 shares the same firmwares as hw2.0, so users of this chip need to create a symlink as below: ln -s hw2.0 hw2.1 Tested-on: WCN6855 hw2.1 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Fixes: 18ac1665e785 ("ath11k: pci: check TCSR_SOC_HW_VERSION") Signed-off-by: Baochen Qiang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211129025613.21594-1-quic_bqiang@quicinc.com commit 7f3a6f5dd207ecd582e1f02ebdb498493770a490 Author: Jonas Jelonek Date: Sun Nov 28 10:07:53 2021 +0100 ath9k: switch to rate table based lookup This patch changes mac80211 rate control for the ath9k driver. The rate lookup per packet is changed from legacy usage of ieee80211_get_tx_rates() to the new rate table based lookup in struct ieee80211_sta->rates. The most recent rate control API, introduced with commit 0d528d85c519 ("mac80211: improve the rate control API"), allows drivers to directly get rates from ieee80211_sta->rates. This is not used by every driver yet, the translation/merge is currently performed in ieee80211_get_tx_rates. This patch changes the behaviour and avoids the call to ieee80211_get_tx_rates and subsequent calls. ath9k now directly reads rates from sta->rates into its rate table. Cause ath9k does not expect rate selection in SKB->CB, the table merge does not consider rate array in SKB->CB except for the first entry (used for probing). Tested with a 8devices Rambutan with QCA9558 SoC by performing two runs, one without the patch and one with. Generated traffic between AP and multiple STAs in each run, measured throughput and captured rc_stats. Comparison of both runs resulted in same rate selection and no performance loss or other negative effects. Co-developed-by: Thomas Huehn Signed-off-by: Thomas Huehn Signed-off-by: Jonas Jelonek Acked-by: Toke Høiland-Jørgensen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211128090753.958-1-jelonek.jonas@gmail.com commit 09b8cd69edcf2be04a781e1781e98e52a775c9ad Author: Fabio Estevam Date: Wed Nov 24 10:10:47 2021 -0300 ath10k: Fix the MTU size on QCA9377 SDIO On an imx6dl-pico-pi board with a QCA9377 SDIO chip, simply trying to connect via ssh to another machine causes: [ 55.824159] ath10k_sdio mmc1:0001:1: failed to transmit packet, dropping: -12 [ 55.832169] ath10k_sdio mmc1:0001:1: failed to submit frame: -12 [ 55.838529] ath10k_sdio mmc1:0001:1: failed to push frame: -12 [ 55.905863] ath10k_sdio mmc1:0001:1: failed to transmit packet, dropping: -12 [ 55.913650] ath10k_sdio mmc1:0001:1: failed to submit frame: -12 [ 55.919887] ath10k_sdio mmc1:0001:1: failed to push frame: -12 , leading to an ssh connection failure. One user inspected the size of frames on Wireshark and reported the followig: "I was able to narrow the issue down to the mtu. If I set the mtu for the wlan0 device to 1486 instead of 1500, the issue does not happen. The size of frames that I see on Wireshark is exactly 1500 after setting it to 1486." Clearing the HI_ACS_FLAGS_ALT_DATA_CREDIT_SIZE avoids the problem and the ssh command works successfully after that. Introduce a 'credit_size_workaround' field to ath10k_hw_params for the QCA9377 SDIO, so that the HI_ACS_FLAGS_ALT_DATA_CREDIT_SIZE is not set in this case. Tested with QCA9377 SDIO with firmware WLAN.TF.1.1.1-00061-QCATFSWPZ-1. Fixes: 2f918ea98606 ("ath10k: enable alt data of TX path for sdio") Signed-off-by: Fabio Estevam Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211124131047.713756-1-festevam@denx.de commit 22bfe94528d7ec83099922faefad0e2d1effedd0 Author: Tudor Ambarus Date: Tue Dec 7 16:02:54 2021 +0200 mtd: spi-nor: issi: is25lp256: Init flash based on SFDP Get rid of the static initialization of the flash parameters and init them when parsing SFDP. Generated a 256 Kbyte random data and did an erase, write, read back and compare test. The flash uses for reads SPINOR_OP_READ_1_4_4_4B 0xec, for erases SPINOR_OP_BE_4K_4B 0x21, and for writes SPINOR_OP_PP_4B 0x12. Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20211207140254.87681-15-tudor.ambarus@microchip.com commit 047275f7de18593de32ec7ff130318f9ef04d183 Author: Tudor Ambarus Date: Tue Dec 7 16:02:53 2021 +0200 mtd: spi-nor: gigadevice: gd25q256: Init flash based on SFDP Get rid of the static initialization of the flash parameters and init them when parsing SFDP. Generated a 256 Kbyte random data and did an erase, write, read back and compare test. The flash uses for reads SPINOR_OP_READ_1_4_4_4B 0xec, for erases SPINOR_OP_BE_4K_4B 0x21, and for writes SPINOR_OP_PP_1_1_4_4B 0x34. Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20211207140254.87681-14-tudor.ambarus@microchip.com commit 5eefc2dc03192c58b558f9b8f0fbf92998ee5771 Author: Tudor Ambarus Date: Tue Dec 7 16:02:52 2021 +0200 mtd: spi-nor: spansion: s25fl256s0: Skip SFDP parsing s25fl256s0 does not define the SFDP tables nor implements the RDSFDP 0x5a command. Skip the SFDP parsing in order to avoid issuing an unsupported command to the flash. Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20211207140254.87681-13-tudor.ambarus@microchip.com commit 1c513c986b0a4c7151cb4571e568136f16c9dc58 Author: Tudor Ambarus Date: Tue Dec 7 16:02:51 2021 +0200 mtd: spi-nor: winbond: w25q256jvm: Init flash based on SFDP Get rid of the static initialization of the flash parameters and init them when parsing SFDP. Generated a 256 Kbyte random data and did an erase, write, read back and compare test. The flash uses for reads SPINOR_OP_READ_1_4_4 0xeb, for erases SPINOR_OP_BE_4K 0x20, and for writes SPINOR_OP_PP 0x02. Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20211207140254.87681-12-tudor.ambarus@microchip.com commit b7ed1a3731a9575198e3d8b70af7637abcc8656d Author: Tudor Ambarus Date: Tue Dec 7 16:02:50 2021 +0200 mtd: spi-nor: core: Move spi_nor_set_addr_width() in spi_nor_setup() spi_nor_setup() configures the SPI NOR memory. Setting the addr width is too a configuration, hence we can move the spi_nor_set_addr_width() in spi_nor_setup(). Signed-off-by: Tudor Ambarus Reviewed-by: Pratyush Yadav Reviewed-by: Michael Walle Link: https://lore.kernel.org/r/20211207140254.87681-11-tudor.ambarus@microchip.com commit 5dabf5770f7db6786558cfe040b0474f46f211b2 Author: Tudor Ambarus Date: Tue Dec 7 16:02:49 2021 +0200 mtd: spi-nor: core: Init all flash parameters based on SFDP where possible New flash additions that support SFDP should be declared with PARSE_SFDP and with all the other flags that are not SFDP discoverable. Keep the old way of initializing the flash, until all the flashes are converted to use either PARSE_SFDP or SPI_NOR_SKIP_SFDP. Flashes that declare PARSE_SFDP do not have a roll-back mechanism because if spi_nor_parse_sfdp() returns an error it means that either BFPT is not supported, thus SFDP is not supported and the user didn't correctly declared the flash_info entry, or some memalloc failed. Either way we should return an error. The rest of the SFDP tables are optional, if one of the optional SFDP tables fails, we just continue. We would like to get rid of the default_init() hook, so the spi_nor_manufacturer_init_params() is not called in the new sequnce of flash initialization. Split spi_nor_info_init_params() in spi_nor_init_default_params() and spi_nor_no_sfdp_init_params(). spi_nor_init_default_params() is called for all the flashes regardless if they support SFDP or not. spi_nor_no_sfdp_init_params() is called just for the flashes that do not define SFDP and initializes parameters and setting solely based on flash_info data. Signed-off-by: Tudor Ambarus Reviewed-by: Pratyush Yadav Link: https://lore.kernel.org/r/20211207140254.87681-10-tudor.ambarus@microchip.com commit a1ede1cce4935f8aa2c44560d8404890350cd0ca Author: Tudor Ambarus Date: Tue Dec 7 16:02:48 2021 +0200 mtd: spi-nor: Introduce spi_nor_init_fixup_flags() Group NOR flags initialization. Introduce a dedicated function for setting the fixup_flags and emphasise when those flash_info flags should be set: when the SNOR_F_4B_OPCODES/SNOR_F_IO_MODE_EN_VOLATILE setttings can not be discovered by SFDP for this particular flash because the SFDP table that indicates this support is not defined in the flash. In case the table for his support is defined but has wrong values, one should instead use a post_sfdp() hook to set the SNOR_F equivalent flag. No functional change intended in this patch. Signed-off-by: Tudor Ambarus Reviewed-by: Pratyush Yadav Link: https://lore.kernel.org/r/20211207140254.87681-9-tudor.ambarus@microchip.com commit 5429300db98c7983f4d260fce40d663f5cf0732e Author: Tudor Ambarus Date: Tue Dec 7 16:02:47 2021 +0200 mtd: spi-nor: Introduce spi_nor_init_flags() Used to initialize the NOR flags for settings that are not defined in the JESD216 SFDP standard, thus can not be retrieved when parsing SFDP. This moves the setting of SNOR_F_READY_XSR_RDY and SNOR_F_HAS_LOCK late in the init call, without any functional change expected. The rest of the flags were already set after the spi_nor_init_params(). Signed-off-by: Tudor Ambarus Reviewed-by: Pratyush Yadav Link: https://lore.kernel.org/r/20211207140254.87681-8-tudor.ambarus@microchip.com commit ec1c0e996035c8f93eca7bb64ccf0411b57fddea Author: Tudor Ambarus Date: Tue Dec 7 16:02:46 2021 +0200 mtd: spi-nor: Rework the flash_info flags Clarify for what the flash_info flags are used for. Split them in four categories and a bool: 1/ FLAGS: flags that indicate support that is not defined by the JESD216 standard in its SFDP tables. 2/ NO_SFDP_FLAGS: these flags are used when the flash does not define the SFDP tables. These flags indicate support that can be discovered via SFDP. Used together with SPI_NOR_SKIP_SFDP flag. 3/ FIXUP_FLAGS: flags that indicate support that can be discovered via SFDP ideally, but can not be discovered for this particular flash because the SFDP table that indicates this support is not defined by the flash. In case the table for this support is defined but has wrong values, one should instead use a post_sfdp() hook to set the SNOR_F equivalent flag. 4/ MFR_FLAGS: manufacturer private flags. Used in the manufacturer fixup hooks to differentiate support between flashes of the same manufacturer. 5/ PARSE_SFDP: sets info->parse_sfdp to true. All flash_info entries that support SFDP should be converted to set info->parse_sfdp to true. SPI NOR flashes that statically declare one of the SPI_NOR_{DUAL, QUAD, OCTAL, OCTAL_DTR}_READ flags and do not support the RDSFDP command are gratuiously receiving the RDSFDP command in the attempt of parsing the SFDP tables. It is not desirable to issue commands that are not supported, so introduce PARSE_SFDP to help on this situation. New flash additions/updates should be declared/updated to use either PARSE_SFDP or SPI_NOR_SKIP_SFDP. Once all the flash_info entries are converted to use SPI_NOR_SKIP_SFDP or PARSE_SFDP, we can get rid of the SPI_NOR_SKIP_SFDP flag and use just the bool nor->info->parse_sfdp to determine whether to parse SFDP or not. SPI_NOR_SKIP_SFDP flag is kept just as a way to differentiate whether a flash is converted to the new flags logic or not. Support that can be discovered when parsing SFDP should not be duplicated by explicit flags at flash declaration. All the flash parameters will be discovered when parsing SFDP. Sometimes manufacturers wrongly define some fields in the SFDP tables. If that's the case, SFDP data can be amended with the fixups() hooks. It is not common, but if the SFDP tables are entirely wrong, and it does not worth the hassle to tweak the SFDP parameters by using the fixups hooks, or if the flash does not define the SFDP tables at all, then statically init the flash with the SPI_NOR_SKIP_SFDP flag and specify the rest of flash capabilities with the flash info flags. With time, we want to convert all flashes to use PARSE_SFDP and stop triggering the SFDP parsing with the SPI_NOR_{DUAL, QUAD, OCTAL*}_READ flags. Getting rid of the SPI_NOR_{OCTAL, OCTAL_DTR}_READ trigger is easily achievable, the rest are a long term goal. Manufacturer specific flags like USE_CLSR, USE_FSR, SPI_NOR_XSR_RDY, will be removed in a future series. No functional changes intended in this patch. Signed-off-by: Tudor Ambarus Reviewed-by: Pratyush Yadav Link: https://lore.kernel.org/r/20211207140254.87681-7-tudor.ambarus@microchip.com commit 7683b39d6030264176dcd5ec1980622a620ee010 Author: Tudor Ambarus Date: Tue Dec 7 16:02:45 2021 +0200 mtd: spi-nor: core: Introduce flash_info mfr_flags Used in the manufacturer fixup hooks to differentiate support between flashes of the same manufacturer. Not used in the SPI NOR core. Signed-off-by: Tudor Ambarus Reviewed-by: Michael Walle Reviewed-by: Pratyush Yadav Link: https://lore.kernel.org/r/20211207140254.87681-6-tudor.ambarus@microchip.com commit 5273cc6df984967068f3acfcbe0def1562db5409 Author: Tudor Ambarus Date: Tue Dec 7 16:02:44 2021 +0200 mtd: spi-nor: core: Call spi_nor_post_sfdp_fixups() only when SFDP is defined spi_nor_post_sfdp_fixups() was called even when there were no SFDP tables defined. late_init() should be instead used for flashes that do not define SFDP tables. Use spi_nor_post_sfdp_fixups() just to fix SFDP data. post_sfdp() hook is as of now used just by s28hs512t, mt35xu512aba, and both support SFDP, there's no functional change with this patch. Signed-off-by: Tudor Ambarus Reviewed-by: Pratyush Yadav Link: https://lore.kernel.org/r/20211207140254.87681-5-tudor.ambarus@microchip.com commit ff67592cbdfc74c4237b2d02c4cb50a5eef56ff1 Author: Tudor Ambarus Date: Tue Dec 7 16:02:43 2021 +0200 mtd: spi-nor: Introduce spi_nor_set_mtd_info() Used to init all the mtd_info fields. Move the mtd_info init the last thing in the spi_nor_scan(), so that we avoid superfluous initialization of the mtd_info fields in case of errors. While here use common naming scheme for functions that are setting mtd_info fields: s/spi_nor_register_locking_ops/spi_nor_set_mtd_locking_ops s/spi_nor_otp_init/spi_nor_set_mtd_otp_ops The functions names are self explanatory, get rid of the comment for the OTP function. Signed-off-by: Tudor Ambarus Reviewed-by: Michael Walle Reviewed-by: Pratyush Yadav Link: https://lore.kernel.org/r/20211207140254.87681-4-tudor.ambarus@microchip.com commit eb726c322020b95bfc1fbf0e83d0fd41c2500e96 Author: Tudor Ambarus Date: Tue Dec 7 16:02:42 2021 +0200 mtd: spi-nor: core: Don't use mtd_info in the NOR's probe sequence of calls Use NOR parameters in the probe's sequence of calls, thus nor->params->size instead of nor->mtd.size and let the mtd_info fields be used by the mtd calls (mtd->_erase, mtd->_read, mtd->_write). mtd_info fields should not be used during probe because we haven't registered mtd yet. It's safe to drop xilinx's setting of nor->mtd.size, now that we use nor->params->size in spi_nor_set_addr_width(). Signed-off-by: Tudor Ambarus Reviewed-by: Michael Walle Reviewed-by: Pratyush Yadav Link: https://lore.kernel.org/r/20211207140254.87681-3-tudor.ambarus@microchip.com commit f656b419d41aabafb6b526abc3988dfbf2e5c1ba Author: Tudor Ambarus Date: Tue Dec 7 16:02:41 2021 +0200 mtd: spi-nor: Fix mtd size for s3an flashes As it was before the blamed commit, s3an_nor_scan() was called after mtd size was set with params->size, and it overwrote the mtd size value with '8 * nor->page_size * nor->info->n_sectors' when XSR_PAGESIZE was set. With the introduction of s3an_post_sfdp_fixups(), we missed to update the mtd size for the s3an flashes. Fix the mtd size by updating both nor->params->size, (which will update the mtd_info size later on) and nor->mtd.size (which is used in spi_nor_set_addr_width()). Fixes: 641edddb4f43 ("mtd: spi-nor: Add s3an_post_sfdp_fixups()") Signed-off-by: Tudor Ambarus Reviewed-by: Pratyush Yadav Link: https://lore.kernel.org/r/20211207140254.87681-2-tudor.ambarus@microchip.com commit d4a23930490df39fd076a82649ddba6b3a6c8216 Author: Ville Syrjälä Date: Fri Nov 19 15:13:48 2021 +0200 drm/i915: Allow cdclk squasher to be reconfigured live Supposedly we should be able to change the cdclk squasher waveform even when many pipes are active. Make it so. Signed-off-by: Ville Syrjälä Reviewed-by: Mika Kahola Signed-off-by: Stanislav Lisovskiy Link: https://patchwork.freedesktop.org/patch/msgid/20211119131348.725220-6-mika.kahola@intel.com commit 77ab3a1ecb1986c17644c48b66d9de0a9a0307c9 Author: Mika Kahola Date: Fri Nov 19 15:13:47 2021 +0200 drm/i915/display/dg2: Read CD clock from squasher table To calculate CD clock with squasher unit, we set CD clock ratio to fixed value of 34. The CD clock value is read from CD clock squasher table. BSpec: 54034 v2: Read ratio from register (Ville) Drop unnecessary local variable (Ville) Get CD clock from the given table v3: Calculate CD clock frequency based on waveform bit pattern (Ville) [v4: vsyrjala: Actually do a proper blind readout from the hardware] [v5: vsyrjala: Use has_cdclk_squasher()] Signed-off-by: Mika Kahola Signed-off-by: Ville Syrjälä Reviewed-by: Stanislav Lisovskiy Signed-off-by: Stanislav Lisovskiy Link: https://patchwork.freedesktop.org/patch/msgid/20211119131348.725220-5-mika.kahola@intel.com commit 2060a6895b768d907fd3efa9f52981e615171ec2 Author: Mika Kahola Date: Fri Nov 19 15:13:46 2021 +0200 drm/i915/display/dg2: Set CD clock squashing registers Set CD clock squashing registers based on selected CD clock. v2: use slk_cdclk_decimal() to compute decimal values instead of a specific table (Ville) Set waveform based on CD clock table (Ville) Drop unnecessary local variable (Ville) v3: Correct function naming (Ville) Correct if-else structure (Ville) [v4: vsyrjala: Fix spaces vs. tabs] [v5: vsyrjala: Fix cd2x divider calculation (Uma), Add warn to waveform lookup (Uma), Handle bypass freq in waveform lookup, Generalize waveform handling in bxt_set_cdclk()] Signed-off-by: Mika Kahola Signed-off-by: Ville Syrjälä Reviewed-by: Stanislav Lisovskiy Signed-off-by: Stanislav Lisovskiy Link: https://patchwork.freedesktop.org/patch/msgid/20211119131348.725220-4-mika.kahola@intel.com commit ba884a411700dc56dceedfa53f9364cdcfb70427 Author: Mika Kahola Date: Fri Nov 19 15:13:45 2021 +0200 drm/i915/display/dg2: Sanitize CD clock In case of CD clock squashing the divider is always 1. We don't need to calculate the divider in use so let's skip that for DG2. v2: Drop unnecessary local variable (Ville) v3: Avoid if-else structure (Ville) [v4: vsyrjala: Fix cd2x divider calculation (Uma), Introduce has_cdclk_squasher()] Signed-off-by: Mika Kahola Signed-off-by: Ville Syrjälä Reviewed-by: Stanislav Lisovskiy Signed-off-by: Stanislav Lisovskiy Link: https://patchwork.freedesktop.org/patch/msgid/20211119131348.725220-3-mika.kahola@intel.com commit 2fb352fa627052c9e551339fe27158df305bc622 Author: Mika Kahola Date: Fri Nov 19 15:13:44 2021 +0200 drm/i915/display/dg2: Introduce CD clock squashing table For CD clock squashing method, we need to define corresponding CD clock table for reference clocks, dividers and ratios for all CD clock options. BSpec: 54034 v2: Add CD squashing waveforms as part of CD clock table (Ville) v3: Waveform is 16 bits wide (Ville) [v4: vsyrjala: Nuke the non-squasher based table, Set .divider=2 for consistency, Pack intel_cdclk_vals a bit nicer] v5: Fix error in waveform value (Swati) v6 (Lucas): Rebase on upstream v7 (MattR): Drop 40.8, 81.6, and 122.4 MHz frequencies to reflect new bspec update. Signed-off-by: Mika Kahola Signed-off-by: Ville Syrjälä Reviewed-by: Stanislav Lisovskiy Signed-off-by: Stanislav Lisovskiy Link: https://patchwork.freedesktop.org/patch/msgid/20211119131348.725220-2-mika.kahola@intel.com commit 82ce79391d0ec25ec8aaae3c0617b71048ff0836 Author: Kieran Bingham Date: Thu Nov 4 22:40:25 2021 +0000 arm64: dts: renesas: Fix thermal bindings The binding node names for the thermal zones are not successfully validated by the dt-schemas. Fix the validation by changing from sensor-thermalN or thermal-sensor-N to sensorN-thermal. Provide node labels of the form sensorN_thermal to ensure consistency with the other platform implementations. Signed-off-by: Kieran Bingham Reviewed-by: Niklas Söderlund Link: https://lore.kernel.org/r/20211104224033.3997504-1-kieran.bingham+renesas@ideasonboard.com Signed-off-by: Geert Uytterhoeven commit 491fe469ad0e14a06dce7ebc6a19c4fc3f9300e7 Author: Bruce Chang Date: Mon Dec 6 16:38:45 2021 -0800 drm/i915/selftests: Follow up on increase timeout in i915_gem_contexts selftests Follow up on below commit, to increase the timeout further on new platforms, to accomodate the additional time required for the completion of guc submissions for numerous requests created in loop. commit 5e076529e2652244ec20a86d8f99ba634a16c4f4 Author: Matthew Brost Date: Mon Jul 26 20:17:03 2021 -0700 drm/i915/selftests: Increase timeout in i915_gem_contexts selftests Signed-off-by: Bruce Chang Reviewed-by: Matthew Brost Cc: John Harrison Signed-off-by: Ramalingam C Link: https://patchwork.freedesktop.org/patch/msgid/20211207003845.12419-1-yu.bruce.chang@intel.com commit 111659c2a570ab1d62615040249dd37f39034d68 Author: Hector Martin Date: Tue Dec 7 14:34:58 2021 +0900 arm64: dts: apple: t8103: Remove PCIe max-link-speed properties The driver doesn't support these, they shouldn't be in the SoC include anyway, and we're now configuring this in the bootloader instead. This also solves the j274 1G/10G Ethernet variant discrepancy, since that will now be configured properly based on the dynamic ADT property. Acked-by: Marc Zyngier Signed-off-by: Hector Martin commit a98478f825862ddc1686a3335f9f1cc278fc5733 Author: Anders Roxell Date: Tue Dec 7 12:00:53 2021 +0100 ALSA: ppc: beep: fix clang -Wimplicit-fallthrough Clang warns: sound/ppc/beep.c:103:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] case SND_TONE: break; ^ sound/ppc/beep.c:103:2: note: insert 'break;' to avoid fall-through case SND_TONE: break; ^ break; 1 warning generated. Clang is more pedantic than GCC, which does not warn when failing through to a case that is just break or return. Clang's version is more in line with the kernel's own stance in deprecated.rst. Add athe missing break to silence the warning. Reported-by: Naresh Kamboju Signed-off-by: Anders Roxell Link: https://lore.kernel.org/r/20211207110053.695712-1-anders.roxell@linaro.org Signed-off-by: Takashi Iwai commit 8d9f738f16a3ee9f2341578873c542ddd9802fe4 Author: Yanteng Si Date: Tue Dec 7 20:32:30 2021 +0800 regulator: fix bullet lists of regulator_ops comment Since 89a6a5e56c82("regulator: add property parsing and callbacks to set protection limits") which introduced a warning: Documentation/driver-api/regulator:166: ./include/linux/regulator/driver.h:96: WARNING: Unexpected indentation. Documentation/driver-api/regulator:166: ./include/linux/regulator/driver.h:98: WARNING: Block quote ends without a blank line; unexpected unindent. Let's fix them. Signed-off-by: Yanteng Si Link: https://lore.kernel.org/r/20211207123230.2262047-1-siyanteng@loongson.cn Signed-off-by: Mark Brown commit 8d2de3a548ad05fe09bca58f09ff1ab2e69cf40a Author: Thierry Reding Date: Mon Dec 6 16:37:26 2021 +0100 regulator: Fix type of regulator-coupled-max-spread property According to the description and the various uses of this property it is meant to be an array of unsigned 32-bit values, so fixup the type to match that. Signed-off-by: Thierry Reding Acked-by: Rob Herring Link: https://lore.kernel.org/r/20211206153726.227464-1-thierry.reding@gmail.com Signed-off-by: Mark Brown commit 4aafc5c61b4c2be920b8a56b11279c5fadb8a6bf Author: Thierry Reding Date: Mon Dec 6 16:34:32 2021 +0100 regulator: maxim,max8973: Document interrupts property One of the examples in the bindings has an interrupts property and the Linux kernel driver has support for requesting an interrupt as well. It looks like the absence from the bindings was just an oversight. Add the property to make sure the examples can be validated. Signed-off-by: Thierry Reding Acked-by: Rob Herring Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20211206153432.226963-1-thierry.reding@gmail.com Signed-off-by: Mark Brown commit e388164ea385f04666c4633f5dc4f951fca71890 Author: Xie Yongji Date: Mon Nov 22 17:05:31 2021 +0800 fuse: Pass correct lend value to filemap_write_and_wait_range() The acceptable maximum value of lend parameter in filemap_write_and_wait_range() is LLONG_MAX rather than -1. And there is also some logic depending on LLONG_MAX check in write_cache_pages(). So let's pass LLONG_MAX to filemap_write_and_wait_range() in fuse_writeback_range() instead. Fixes: 59bda8ecee2f ("fuse: flush extending writes") Signed-off-by: Xie Yongji Cc: # v5.15 Signed-off-by: Miklos Szeredi commit 77993b595ada5731e513eb06a0f4bf4b9f1e9532 Author: Sebastian Andrzej Siewior Date: Mon Nov 29 18:46:54 2021 +0100 locking: Allow to include asm/spinlock_types.h from linux/spinlock_types_raw.h The printk header file includes ratelimit_types.h for its __ratelimit() based usage. It is required for the static initializer used in printk_ratelimited(). It uses a raw_spinlock_t and includes the spinlock_types.h. PREEMPT_RT substitutes spinlock_t with a rtmutex based implementation and so its spinlock_t implmentation (provided by spinlock_rt.h) includes rtmutex.h and atomic.h which leads to recursive includes where defines are missing. By including only the raw_spinlock_t defines it avoids the atomic.h related includes at this stage. An example on powerpc: | CALL scripts/atomic/check-atomics.sh |In file included from include/linux/bug.h:5, | from include/linux/page-flags.h:10, | from kernel/bounds.c:10: |arch/powerpc/include/asm/page_32.h: In function ‘clear_page’: |arch/powerpc/include/asm/bug.h:87:4: error: implicit declaration of function â=80=98__WARNâ=80=99 [-Werror=3Dimplicit-function-declaration] | 87 | __WARN(); \ | | ^~~~~~ |arch/powerpc/include/asm/page_32.h:48:2: note: in expansion of macro ‘WARN_ONâ€=99 | 48 | WARN_ON((unsigned long)addr & (L1_CACHE_BYTES - 1)); | | ^~~~~~~ |arch/powerpc/include/asm/bug.h:58:17: error: invalid application of ‘sizeofâ€=99 to incomplete type ‘struct bug_entryâ€=99 | 58 | "i" (sizeof(struct bug_entry)), \ | | ^~~~~~ |arch/powerpc/include/asm/bug.h:89:3: note: in expansion of macro ‘BUG_ENTRYâ€=99 | 89 | BUG_ENTRY(PPC_TLNEI " %4, 0", \ | | ^~~~~~~~~ |arch/powerpc/include/asm/page_32.h:48:2: note: in expansion of macro ‘WARN_ONâ€=99 | 48 | WARN_ON((unsigned long)addr & (L1_CACHE_BYTES - 1)); | | ^~~~~~~ |In file included from arch/powerpc/include/asm/ptrace.h:298, | from arch/powerpc/include/asm/hw_irq.h:12, | from arch/powerpc/include/asm/irqflags.h:12, | from include/linux/irqflags.h:16, | from include/asm-generic/cmpxchg-local.h:6, | from arch/powerpc/include/asm/cmpxchg.h:526, | from arch/powerpc/include/asm/atomic.h:11, | from include/linux/atomic.h:7, | from include/linux/rwbase_rt.h:6, | from include/linux/rwlock_types.h:55, | from include/linux/spinlock_types.h:74, | from include/linux/ratelimit_types.h:7, | from include/linux/printk.h:10, | from include/asm-generic/bug.h:22, | from arch/powerpc/include/asm/bug.h:109, | from include/linux/bug.h:5, | from include/linux/page-flags.h:10, | from kernel/bounds.c:10: |include/linux/thread_info.h: In function â=80=98copy_overflowâ=80=99: |include/linux/thread_info.h:210:2: error: implicit declaration of function â=80=98WARNâ=80=99 [-Werror=3Dimplicit-function-declaration] | 210 | WARN(1, "Buffer overflow detected (%d < %lu)!\n", size, count); | | ^~~~ The WARN / BUG include pulls in printk.h and then ptrace.h expects WARN (from bug.h) which is not yet complete. Even hw_irq.h has WARN_ON() statements. On POWERPC64 there are missing atomic64 defines while building 32bit VDSO: | VDSO32C arch/powerpc/kernel/vdso32/vgettimeofday.o |In file included from include/linux/atomic.h:80, | from include/linux/rwbase_rt.h:6, | from include/linux/rwlock_types.h:55, | from include/linux/spinlock_types.h:74, | from include/linux/ratelimit_types.h:7, | from include/linux/printk.h:10, | from include/linux/kernel.h:19, | from arch/powerpc/include/asm/page.h:11, | from arch/powerpc/include/asm/vdso/gettimeofday.h:5, | from include/vdso/datapage.h:137, | from lib/vdso/gettimeofday.c:5, | from : |include/linux/atomic-arch-fallback.h: In function ‘arch_atomic64_incâ€=99: |include/linux/atomic-arch-fallback.h:1447:2: error: implicit declaration of function ‘arch_atomic64_add’; did you mean ‘arch_atomic_add’? [-Werror=3Dimpl |icit-function-declaration] | 1447 | arch_atomic64_add(1, v); | | ^~~~~~~~~~~~~~~~~ | | arch_atomic_add The generic fallback is not included, atomics itself are not used. If kernel.h does not include printk.h then it comes later from the bug.h include. Allow asm/spinlock_types.h to be included from linux/spinlock_types_raw.h. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20211129174654.668506-12-bigeasy@linutronix.de commit 0cf292b569bc9bc87d29ac87ca5c47fdd5882e10 Author: Sebastian Andrzej Siewior Date: Mon Nov 29 18:46:53 2021 +0100 x86/mm: Include spinlock_t definition in pgtable. This header file provides forward declartion for pgd_lock but does not include the header defining its type. This works since the definition of spinlock_t is usually included somehow via printk. By trying to avoid recursive includes on PREEMPT_RT I avoided the loop in printk and as a consequnce kernel/intel.c failed to compile due to missing type definition. Include the needed definition for spinlock_t. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20211129174654.668506-11-bigeasy@linutronix.de commit 9b58e976b3b391c0cf02e038d53dd0478ed3013c Author: Li Hua Date: Fri Dec 3 03:36:18 2021 +0000 sched/rt: Try to restart rt period timer when rt runtime exceeded When rt_runtime is modified from -1 to a valid control value, it may cause the task to be throttled all the time. Operations like the following will trigger the bug. E.g: 1. echo -1 > /proc/sys/kernel/sched_rt_runtime_us 2. Run a FIFO task named A that executes while(1) 3. echo 950000 > /proc/sys/kernel/sched_rt_runtime_us When rt_runtime is -1, The rt period timer will not be activated when task A enqueued. And then the task will be throttled after setting rt_runtime to 950,000. The task will always be throttled because the rt period timer is not activated. Fixes: d0b27fa77854 ("sched: rt-group: synchonised bandwidth period") Reported-by: Hulk Robot Signed-off-by: Li Hua Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20211203033618.11895-1-hucool.lihua@huawei.com commit 2917406c352757642c3c1a13a4c99c96e6d22fde Author: Barry Song Date: Sat Oct 16 19:11:09 2021 +0800 sched/fair: Document the slow path and fast path in select_task_rq_fair All People I know including myself took a long time to figure out that typical wakeup will always go to fast path and never go to slow path except WF_FORK and WF_EXEC. Vincent reminded me once in a linaro meeting and made me understand slow path won't happen for WF_TTWU. But my other friends repeatedly wasted a lot of time on testing this path like me before I reminded them. So obviously the code needs some document. Signed-off-by: Barry Song Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20211016111109.5559-1-21cnbao@gmail.com commit 2f474da98caf9a75d7777c5465d281240c706bc6 Author: Aswath Govindraju Date: Mon Nov 22 19:11:58 2021 +0530 arm64: dts: ti: k3-am642-evm/sk: Add support for main domain mcan nodes in EVM and disable them on SK AM642 EVM has two CAN connecters brought out from the two MCAN instances in the main domain through transceivers. Add device tree nodes for transceivers and set the required properties in the mcan device tree nodes, in EVM device tree file. On AM642 SK there are no connectors brought out for CAN. Therefore, disable the mcan device tree nodes in the SK device tree file. Signed-off-by: Aswath Govindraju Signed-off-by: Vignesh Raghavendra Reviewed-by: Apurva Nandan Link: https://lore.kernel.org/r/20211122134159.29936-7-a-govindraju@ti.com commit 9c4441ad3da1fad75aabfd68e90558c20a2818d2 Author: Aswath Govindraju Date: Mon Nov 22 19:11:57 2021 +0530 arm64: dts: ti: k3-am64-main: Add support for MCAN Add Support for two MCAN controllers present on the am64x SOC. Both support classic CAN messages as well as CAN-FD. Signed-off-by: Aswath Govindraju Signed-off-by: Vignesh Raghavendra Reviewed-by: Apurva Nandan Link: https://lore.kernel.org/r/20211122134159.29936-6-a-govindraju@ti.com commit 87d60c4663b6eb964cca6a03adfcf8976f374559 Author: Faiz Abbas Date: Mon Nov 22 19:11:56 2021 +0530 arm64: dts: ti: k3-j721e-common-proc-board: Add support for mcu and main mcan nodes Add four MCAN nodes present on the common processor board and set a maximum data rate of 5 Mbps. Disable all other nodes as they are not brought out on the common processor board. Signed-off-by: Faiz Abbas Signed-off-by: Aswath Govindraju Signed-off-by: Vignesh Raghavendra Reviewed-by: Apurva Nandan Link: https://lore.kernel.org/r/20211122134159.29936-5-a-govindraju@ti.com commit 4688a4fcb7a20d347a52c1f2dc9bc6fad9df1174 Author: Faiz Abbas Date: Mon Nov 22 19:11:55 2021 +0530 arm64: dts: ti: k3-j721e: Add support for MCAN nodes Add support for 14 MCAN controllers in main domain and 2 MCAN controllers present in mcu domain. All the MCAN controllers support classic CAN messages as well as CAN_FD messages. Signed-off-by: Faiz Abbas Signed-off-by: Aswath Govindraju Signed-off-by: Vignesh Raghavendra Reviewed-by: Apurva Nandan Link: https://lore.kernel.org/r/20211122134159.29936-4-a-govindraju@ti.com commit f533bb82def8b923668df97c36c1f8fe6a3a8f1f Author: Aswath Govindraju Date: Mon Nov 22 19:11:54 2021 +0530 arm64: dts: ti: am654-base-board/am65-iot2050-common: Disable mcan nodes AM654 base board and iot platforms do not have mcan instances pinned out. Therefore, disable all the mcan instances. Signed-off-by: Aswath Govindraju Signed-off-by: Vignesh Raghavendra Reviewed-by: Apurva Nandan Link: https://lore.kernel.org/r/20211122134159.29936-3-a-govindraju@ti.com commit c3e4ea557ddb0a7fa431564bb1bb023ffbf823f4 Author: Faiz Abbas Date: Mon Nov 22 19:11:53 2021 +0530 arm64: dts: ti: k3-am65-mcu: Add Support for MCAN Add Support for two MCAN controllers present on the am65x SOC. Both support classic CAN messages as well as CAN-FD. Signed-off-by: Faiz Abbas Signed-off-by: Aswath Govindraju Signed-off-by: Vignesh Raghavendra Reviewed-by: Apurva Nandan Link: https://lore.kernel.org/r/20211122134159.29936-2-a-govindraju@ti.com commit f2ed93a4dc854981b399e884851e966194a18595 Author: John Keeping Date: Mon Nov 1 11:46:22 2021 +0000 drm/rockchip: pass 0 to drm_fbdev_generic_setup() Allow drm_fbdev_generic_setup() to pick the default bpp value for the framebuffer. This has no functional impact because the default is 32, given that mode_config.preferred_depth is not set for Rockchip. Suggested-by: Thomas Zimmermann Signed-off-by: John Keeping Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20211101114622.813536-1-john@metanate.com commit 24af7c34b290dc0da62349dfb050bb4a8e16c6c1 Author: John Keeping Date: Fri Oct 29 12:50:13 2021 +0100 drm/rockchip: use generic fbdev setup The Rockchip fbdev code does not add anything compared to drm_fbdev_generic_setup(); the one custom function for .fb_mmap does the same thing as gem_prime_mmap which is called by the helper. Signed-off-by: John Keeping Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20211029115014.264084-1-john@metanate.com commit ce05b997426df4c5321358e369f1f32f257c57a9 Author: Mika Westerberg Date: Thu Nov 18 09:12:15 2021 +0200 thunderbolt: Add debug logging of DisplayPort resource allocation Add more debugging around DP resource allocation/de-allocation. Signed-off-by: Mika Westerberg commit e5bb88e961e5e3e72e3cc3a866a232115bd15e1e Author: Mika Westerberg Date: Thu Nov 18 09:10:59 2021 +0200 thunderbolt: Do not program path HopIDs for USB4 routers These fields are marked read-only for USB4 routers so do not touch them in that case. Update the kernel-doc of tb_dp_port_set_hops() to reflect this too. Signed-off-by: Mika Westerberg commit 6cb27a04fb779717c4a3d20233b93596885838cf Author: Mika Westerberg Date: Thu Nov 18 09:06:45 2021 +0200 thunderbolt: Do not allow subtracting more NFC credits than configured This might happen if the boot firmware uses different amount of NFC credits than what the router suggests, or we are dealing with pre-USB4 device. Signed-off-by: Mika Westerberg commit 1e56c88adecc2dfe14973fa47898861a839e62d4 Author: Mika Westerberg Date: Mon Nov 15 19:10:51 2021 +0200 thunderbolt: Runtime resume USB4 port when retimers are scanned Sometimes when plugging in a USB4 device we might see following error: thunderbolt 1-0:3.1: runtime PM trying to activate child device 1-0:3.1 but parent (usb4_port3) is not active This happens because the parent USB4 port was still runtime suspended. Fix this by runtime resuming the USB4 port before scanning the retimers below it. Signed-off-by: Mika Westerberg commit 43bddb26e20af916249b5318200cfe1734c1700c Author: Mika Westerberg Date: Sun Nov 14 17:20:59 2021 +0200 thunderbolt: Tear down existing tunnels when resuming from hibernate If the boot firmware implements connection manager of its own it may not create the paths in the same way or order we do. For example it may create first PCIe tunnel and then USB3 tunnel. When we restore our tunnels (first de-activating them) we may be doing that over completely different tunnels and that leaves them possibly non-functional. For this reason we re-use the tunnel discovery functionality and find out all the existing tunnels, and tear them down. Once that is done we can restore our tunnels. Signed-off-by: Mika Westerberg commit f3380cac0c0b3a6f49ab161e2a057c363962f48d Author: Mika Westerberg Date: Sun Nov 14 16:07:11 2021 +0200 thunderbolt: Runtime PM activate both ends of the device link If protocol tunnels are already up when the driver is loaded, for instance if the boot firmware implements connection manager of its own, runtime PM reference count of the consumer devices behind the tunnel might have been increased already before the device link is created but the supplier device runtime PM reference count is not. This leads to a situation where the supplier (the Thunderbolt driver) can runtime suspend even if it should not because the corresponding protocol tunnel needs to be up causing the devices to be removed from the corresponding native bus. Prevent this from happening by making both sides of the link runtime PM active briefly. The pm_runtime_put() for the consumer (PCIe root/downstream port, xHCI) then allows it to runtime suspend again but keeps the supplier runtime resumed the whole time it is runtime active. Signed-off-by: Mika Westerberg Reviewed-by: Rafael J. Wysocki commit 19813551701d004b517534888aa4e2a62ca4488e Author: Kees Cook Date: Mon Dec 6 22:34:13 2021 -0800 thunderbolt: xdomain: Avoid potential stack OOB read tb_xdp_properties_changed_request() was calling tb_xdp_handle_error() with a struct tb_xdp_properties_changed_response on the stack, which does not have the "error" field present when cast to struct tb_xdp_error_response. This was detected when building with -Warray-bounds: drivers/thunderbolt/xdomain.c: In function 'tb_xdomain_properties_changed': drivers/thunderbolt/xdomain.c:226:22: error: array subscript 'const struct tb_xdp_error_response[0]' is partly outside array bounds of 'struct tb_xdp_properties_changed_response[1]' [-Werror=array-bounds] 226 | switch (error->error) { | ~~~~~^~~~~~~ drivers/thunderbolt/xdomain.c:448:51: note: while referencing 'res' 448 | struct tb_xdp_properties_changed_response res; | ^~~ Add union containing struct tb_xdp_error_response to structures passed to tb_xdp_handle_error(), so that the "error" field will be present. Signed-off-by: Kees Cook Signed-off-by: Mika Westerberg commit 15aa1f668c5464fe201cf15d0d76f9429fdf163f Author: Vinod Koul Date: Wed Dec 1 13:14:56 2021 +0530 phy: qcom-qmp: Add SM8450 UFS QMP Phy SM8450 UFS seems to use same sequence as SM8350, so reuse the sequence from SM8450. Add the new clock list for this phy and the new compatible Signed-off-by: Vinod Koul Co-developed-by: Dmitry Baryshkov Signed-off-by: Dmitry Baryshkov Reviewed-by: Bjorn Andersson Acked-by: Martin K. Petersen Link: https://lore.kernel.org/r/20211201074456.3969849-4-vkoul@kernel.org Signed-off-by: Vinod Koul commit e04121ba1b085af40b3c9ca2516b3577245d078d Author: Vinod Koul Date: Wed Dec 1 13:14:55 2021 +0530 dt-bindings: phy: qcom,qmp: Add SM8450 UFS phy compatible Document the UFS phy compatible for QMP UFS phy found in SM8450 SoC. Signed-off-by: Vinod Koul Reviewed-by: Bjorn Andersson Acked-by: Martin K. Petersen Link: https://lore.kernel.org/r/20211201074456.3969849-3-vkoul@kernel.org Signed-off-by: Vinod Koul commit 07cc0fa49bdbe051c69c1497b334b75a18d44a73 Author: Vinod Koul Date: Wed Dec 1 13:14:54 2021 +0530 scsi: ufs: dt-bindings: Add SM8450 compatible strings Document "qcom,sm8450-ufshc" compatible string. "qcom,sm8450-ufshc" is for UFS HC found in SM8450 SoC. Signed-off-by: Vinod Koul Reviewed-by: Bjorn Andersson Acked-by: Martin K. Petersen Link: https://lore.kernel.org/r/20211201074456.3969849-2-vkoul@kernel.org Signed-off-by: Vinod Koul commit 00d667fc457d39adc0798d57af0316e8a461ec37 Author: Yang Shen Date: Mon May 17 13:01:36 2021 +0800 iwlwifi: mvm: demote non-compliant kernel-doc header Fixes the following W=1 kernel build warning: drivers/net/wireless/intel/iwlwifi/mvm/rfi.c:11: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst Cc: Stanislav Yakovlev Signed-off-by: Yang Shen [removed the static const fix, since it's already done and updated the commit message accordingly.] Link: https://lore.kernel.org/r/20210517050141.61488-7-shenyang39@huawei.com Signed-off-by: Luca Coelho commit aea7e2a86a94b2583e1e812c596140034398a169 Author: Christoph Hellwig Date: Thu Oct 21 09:39:12 2021 +0200 dma-direct: factor the swiotlb code out of __dma_direct_alloc_pages Add a new helper to deal with the swiotlb case. This keeps the code nicely boundled and removes the not required call to dma_direct_optimal_gfp_mask for the swiotlb case. Signed-off-by: Christoph Hellwig Reviewed-by: Robin Murphy commit f5d3939a5916c0a8a0b47dcbc33963dbffe74f90 Author: Christoph Hellwig Date: Thu Oct 21 09:34:59 2021 +0200 dma-direct: drop two CONFIG_DMA_RESTRICTED_POOL conditionals swiotlb_alloc and swiotlb_free are properly stubbed out if CONFIG_DMA_RESTRICTED_POOL is not set, so skip the extra checks. Signed-off-by: Christoph Hellwig Reviewed-by: Robin Murphy commit 78bc72787ab9e638173aeb1f589578105d3a43c9 Author: Christoph Hellwig Date: Thu Oct 21 10:00:55 2021 +0200 dma-direct: warn if there is no pool for force unencrypted allocations Instead of blindly running into a blocking operation for a non-blocking gfp, return NULL and spew an error. Note that Kconfig prevents this for all currently relevant platforms, and this is just a debug check. Signed-off-by: Christoph Hellwig Reviewed-by: Robin Murphy commit 955f58f7406ad912825fc344c7825fd904b124a0 Author: Christoph Hellwig Date: Tue Nov 9 15:47:56 2021 +0100 dma-direct: fail allocations that can't be made coherent If the architecture can't remap or set an address uncached there is no way to fullfill a request for a coherent allocation. Return NULL in that case. Note that this case currently does not happen, so this is a theoretical fixup and/or a preparation for eventually supporting platforms that can't support coherent allocations with the generic code. Signed-off-by: Christoph Hellwig Reviewed-by: Robin Murphy commit a86d10942db2e0099a369b367fe62898f95987a8 Author: Christoph Hellwig Date: Thu Oct 21 09:47:31 2021 +0200 dma-direct: refactor the !coherent checks in dma_direct_alloc Add a big central !dev_is_dma_coherent(dev) block to deal with as much as of the uncached allocation schemes and document the schemes a bit better. Signed-off-by: Christoph Hellwig Reviewed-by: Robin Murphy commit d541ae55d538265861ef729a64d2d816d34ef1e2 Author: Christoph Hellwig Date: Mon Oct 18 13:08:07 2021 +0200 dma-direct: factor out a helper for DMA_ATTR_NO_KERNEL_MAPPING allocations Split the code for DMA_ATTR_NO_KERNEL_MAPPING allocations into a separate helper to make dma_direct_alloc a little more readable. Signed-off-by: Christoph Hellwig Reviewed-by: Robin Murphy Acked-by: David Rientjes commit f3c962226dbec7a611ddd4eb7af7f4e19f4790ea Author: Christoph Hellwig Date: Tue Nov 9 15:20:40 2021 +0100 dma-direct: clean up the remapping checks in dma_direct_alloc Add two local variables to track if we want to remap the returned address using vmap or call dma_set_uncached and use that to simplify the code flow. Signed-off-by: Christoph Hellwig Reviewed-by: Robin Murphy commit a90cf30437489343b8386ae87b4827b6d6c3ed50 Author: Christoph Hellwig Date: Tue Nov 9 15:41:01 2021 +0100 dma-direct: always leak memory that can't be re-encrypted We must never let unencrypted memory go back into the general page pool. So if we fail to set it back to encrypted when freeing DMA memory, leak the memory instead and warn the user. Signed-off-by: Christoph Hellwig Reviewed-by: Robin Murphy commit 5570449b6876f215d49ac4db9ccce6ff7aa1e20a Author: Christoph Hellwig Date: Thu Oct 21 09:20:39 2021 +0200 dma-direct: don't call dma_set_decrypted for remapped allocations Remapped allocations handle the encrypted bit through the pgprot passed to vmap, so there is no call dma_set_decrypted. Note that this case is currently entirely theoretical as no valid kernel configuration supports remapped allocations and memory encryption currently. Signed-off-by: Christoph Hellwig commit 4d0564785bb03841e4b5c5b31aa4ecd1eb0d01bb Author: Christoph Hellwig Date: Mon Oct 18 13:18:34 2021 +0200 dma-direct: factor out dma_set_{de,en}crypted helpers Factor out helpers the make dealing with memory encryption a little less cumbersome. Signed-off-by: Christoph Hellwig Reviewed-by: Robin Murphy commit 692562abcc6ecc8c8afe4c5a42ac711515481089 Author: Andy Shevchenko Date: Mon Dec 6 17:15:21 2021 +0200 platform/x86: hp_accel: Use SIMPLE_DEV_PM_OPS() for PM ops After the commit 34570a898eef ("platform/x86: hp_accel: Remove _INI method call") there is no need to have separate methods for resume and restore, hence we may fold them together and use SIMPLE_DEV_PM_OPS() for PM ops. While at it, switch to use __maybe_unused attribute. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211206151521.22578-1-andriy.shevchenko@linux.intel.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 272479928172edf0d2f2259ca0bdb414328e11a4 Author: Jarrett Schultz Date: Thu Dec 2 11:16:27 2021 -0800 platform: surface: Propagate ACPI Dependency Since the Surface XBL Driver does not depend on ACPI, the platform/surface directory as a whole no longer depends on ACPI. With respect to this, the ACPI dependency is moved into each config that depends on ACPI individually. Signed-off-by: Jarrett Schultz Link: https://lore.kernel.org/r/20211202191630.12450-3-jaschultz@microsoft.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 1c5ec99891bb6a2d5487b9ab7c259698a601b95c Author: Hans de Goede Date: Sun Nov 28 20:00:31 2021 +0100 platform/x86: lenovo-yogabook-wmi: Add support for hall sensor on the back On the back of the device there is a Hall sensor connected to the "INT33FF:02" GPIO controller pin 18, which gets triggered when the device is fully folded into tablet-mode (when the back of the display touches the back of the keyboard). Use this to disable both the touch-keyboard and the digitizer when the tablet is fully folded into tablet-mode. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211128190031.405620-5-hdegoede@redhat.com commit c0549b72d99df4616632b6b7dd0e82c6bf49b021 Author: Yauhen Kharuzhy Date: Sun Nov 28 20:00:30 2021 +0100 platform/x86: lenovo-yogabook-wmi: Add driver for Lenovo Yoga Book Add driver to handle WMI events, control the keyboard backlight and bind/unbind the keyboard-touch / digitizer driver so that only one is active at a time. It may seem a bit weird to handle the toggling of the modes in the kernel, but the hw actually expects only 1 device to be active at a time. Changes by Hans de Goede: - Whole bunch of cleanups - Make the kernel do the driver bind/unbind itself instead of sending events to userspace and requiring a special userspace daemon to deal with this Signed-off-by: Yauhen Kharuzhy Co-developed-by: Hans de Goede Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211128190031.405620-4-hdegoede@redhat.com commit f973795a8d19cbf3d03807704eb7c6ff65788d5a Author: Lv Yunlong Date: Fri Apr 2 22:47:55 2021 -0700 wireless: iwlwifi: Fix a double free in iwl_txq_dyn_alloc_dma In iwl_txq_dyn_alloc_dma, txq->tfds is freed at first time by: iwl_txq_alloc()->goto err_free_tfds->dma_free_coherent(). But it forgot to set txq->tfds to NULL. Then the txq->tfds is freed again in iwl_txq_dyn_alloc_dma by: goto error->iwl_txq_gen2_free_memory()->dma_free_coherent(). My patch sets txq->tfds to NULL after the first free to avoid the double free. Fixes: 0cd1ad2d7fd41 ("iwlwifi: move all bus-independent TX functions to common code") Signed-off-by: Lv Yunlong Link: https://lore.kernel.org/r/20210403054755.4781-1-lyl2019@mail.ustc.edu.cn Signed-off-by: Luca Coelho commit 46c7b05a4f91f425d429bbe152c0185e9f8a5d18 Author: Emmanuel Grumbach Date: Tue Nov 30 12:59:51 2021 +0200 iwlwifi: mvm: fix a possible NULL pointer deference Smatch spot a possible NULL pointer dereference. Fix it. __iwl_mvm_mac_set_key can be called with sta = NULL Also add a NULL pointer check after memory allocation. Reported-by: Dan Carpenter Signed-off-by: Emmanuel Grumbach Link: https://lore.kernel.org/r/20211130105951.85539-1-emmanuel.grumbach@intel.com Signed-off-by: Luca Coelho commit 1a4d5758692519d6de648803a6d1dbba000bfe74 Author: Colin Ian King Date: Mon Nov 29 12:49:21 2021 +0000 iwlwifi: mei: Fix spelling mistake "req_ownserhip" -> "req_ownership" There is a spelling mistake in a debugfs filename. Fix it. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20211129124921.11817-1-colin.i.king@gmail.com Signed-off-by: Luca Coelho commit 652291601459272d52b6ba12811f0b60b3e6444f Author: Emmanuel Grumbach Date: Sun Nov 28 14:15:09 2021 +0200 iwlwifi: mei: don't rely on the size from the shared area If CSME is compromised, it could report a bigger queue size in the share area and make the host perform an out of bound access. Instead of reading the size of the queue from the shared area, store it in the regular context which is not accessible by CSME. While at it, fix a small typo in an error print. Signed-off-by: Emmanuel Grumbach Link: https://lore.kernel.org/r/20211128121509.3952-1-emmanuel.grumbach@intel.com Signed-off-by: Luca Coelho commit 9b4d7b5c81a2578e080da33b5cddc3149fa611aa Author: Zhen Lei Date: Thu Jun 3 09:10:09 2021 +0200 media: bttv: 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. Link: https://lore.kernel.org/linux-media/20210603071009.11438-1-thunder.leizhen@huawei.com Signed-off-by: Zhen Lei Signed-off-by: Mauro Carvalho Chehab commit e67219b0496b795c9e4e9da53098a1ff302af313 Author: Cai Huoqing Date: Thu Sep 16 04:00:05 2021 +0200 media: b2c2: flexcop: Convert to SPDX identifier use SPDX-License-Identifier instead of a verbose license text Link: https://lore.kernel.org/linux-media/20210916020006.8497-1-caihuoqing@baidu.com CC: Mauro Carvalho Chehab , , Signed-off-by: Cai Huoqing Signed-off-by: Mauro Carvalho Chehab commit 051d3b5437af602a9541c6ef2f233a60990eab7b Author: Krzysztof Kozlowski Date: Fri Sep 17 11:21:32 2021 +0200 media: siano: remove duplicate USB device IDs The devices 0x187f,0x0202 and 0x187f,0x0301 are already on the list. Link: https://lore.kernel.org/linux-media/20210917092132.19576-1-krzysztof.kozlowski@canonical.com Signed-off-by: Krzysztof Kozlowski Signed-off-by: Mauro Carvalho Chehab commit a2ab06d7c4d6bfd0b545a768247a70463e977e27 Author: Mauro Carvalho Chehab Date: Mon Dec 6 15:34:19 2021 +0100 media: m920x: don't use stack on USB reads Using stack-allocated pointers for USB message data don't work. This driver is almost OK with that, except for the I2C read logic. Fix it by using a temporary read buffer, just like on all other calls to m920x_read(). Link: https://lore.kernel.org/all/ccc99e48-de4f-045e-0fe4-61e3118e3f74@mida.se/ Reported-by: rkardell@mida.se Signed-off-by: Mauro Carvalho Chehab commit 61b738e938ef091e0c4c4e8eadeaf27502732e97 Author: Uwe Kleine-König Date: Tue Oct 12 17:39:32 2021 +0200 media: cxd2880: Eliminate dead code An spi remove callback is never called with an spi_device pointer that is NULL. Also it is only called for devices that probed successfully. As cxd2880_spi_probe() always sets driver data, spi_get_drvdata() cannot be NULL. Also the return value of spi remove callbacks is ignored anyway and not freeing resources in .remove() is a bad idea. Link: https://lore.kernel.org/linux-media/20211012153945.2651412-8-u.kleine-koenig@pengutronix.de Cc: Mark Brown , kernel@pengutronix.de, linux-media@vger.kernel.org, linux-spi@vger.kernel.org Signed-off-by: Uwe Kleine-König Signed-off-by: Mauro Carvalho Chehab commit 48f45c2a969b5a012fda468350706c3a479f0707 Author: Uwe Kleine-König Date: Tue Oct 26 21:40:10 2021 +0200 media: tua9001: Improve messages in .remove's error path If disabling the hardware fails the driver propagates the error code to the i2c core. However this only results in a generic error message; the device still disappears. So instead emit a message that better describes the actual problem than the i2c core's "remove failed (ESOMETHING), will be ignored" and return 0 to suppress the generic message. Link: https://lore.kernel.org/linux-media/20211026194010.109029-1-u.kleine-koenig@pengutronix.de Cc: linux-media@vger.kernel.org, kernel@pengutronix.de Signed-off-by: Uwe Kleine-König Reviewed-by: Kieran Bingham Signed-off-by: Mauro Carvalho Chehab commit 3da3ee3f0d50d4019628081918515e05bde51792 Author: Daniel Kamil Kozar Date: Sat Nov 20 00:44:01 2021 +0100 media: Print chip type explicitly when loading the Rafael Micro r820t module The module currently prints only "Rafael Micro r820t successfully identified" when successfully loaded, which might be misleading as the module actually supports various chip types. Link: https://lore.kernel.org/linux-media/20211119234401.271193-1-dkk089@gmail.com Cc: linux-kernel@vger.kernel.org, Daniel Kamil Kozar Signed-off-by: Daniel Kamil Kozar Signed-off-by: Mauro Carvalho Chehab commit ebd80fbf6d8308340b5ce2dcb9cc403ba82b0693 Author: Colin Ian King Date: Tue Nov 23 10:06:45 2021 +0100 media: media si2168: Fix spelling mistake "previsously" -> "previously" There is a spelling mistake in a dev_dbg message. Fix it. Link: https://lore.kernel.org/linux-media/20211123090645.165299-1-colin.i.king@gmail.com Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Signed-off-by: Colin Ian King Signed-off-by: Mauro Carvalho Chehab commit a6441ea29cb2c9314654e093a1cd8020b9b851c8 Author: Robert Schlabbach Date: Wed Dec 1 22:08:43 2021 +0100 media: si2157: Fix "warm" tuner state detection Commit e955f959ac52 ("media: si2157: Better check for running tuner in init") completely broke the "warm" tuner detection of the si2157 driver due to a simple endian error: The Si2157 CRYSTAL_TRIM property code is 0x0402 and needs to be transmitted LSB first. However, it was inserted MSB first, causing the warm detection to always fail and spam the kernel log with tuner initialization messages each time the DVB frontend device was closed and reopened: [ 312.215682] si2157 16-0060: found a 'Silicon Labs Si2157-A30' [ 312.264334] si2157 16-0060: firmware version: 3.0.5 [ 342.248593] si2157 16-0060: found a 'Silicon Labs Si2157-A30' [ 342.295743] si2157 16-0060: firmware version: 3.0.5 [ 372.328574] si2157 16-0060: found a 'Silicon Labs Si2157-A30' [ 372.385035] si2157 16-0060: firmware version: 3.0.5 Also, the reinitializations were observed disturb _other_ tuners on multi-tuner cards such as the Hauppauge WinTV-QuadHD, leading to missed or errored packets when one of the other DVB frontend devices on that card was opened. Fix the order of the property code bytes to make the warm detection work again, also reducing the tuner initialization message in the kernel log to once per power-on, as well as fixing the interference with other tuners. Link: https://lore.kernel.org/linux-media/trinity-2a86eb9d-6264-4387-95e1-ba7b79a4050f-1638392923493@3c-app-gmx-bap03 Fixes: e955f959ac52 ("media: si2157: Better check for running tuner in init") Reported-by: Robert Schlabbach Signed-off-by: Robert Schlabbach Signed-off-by: Mauro Carvalho Chehab commit 00a7bba084bacaabcdb5cbd7bc9b3f1fd1b50d29 Author: Colin Ian King Date: Sun Dec 5 01:37:45 2021 +0100 media: c8sectpfe: remove redundant assignment to pointer tsin Pointer tsin is being assigned a value that is never read. The assignment is redundant and can be removed. Link: https://lore.kernel.org/linux-media/20211205003745.227491-1-colin.i.king@gmail.com Cc: kernel-janitors@vger.kernel.org Signed-off-by: Colin Ian King Reviewed-by: Patrice Chotard Signed-off-by: Mauro Carvalho Chehab commit ebedc6ce3c3cf17904af5529d5e3ee82e3e987a0 Author: Akira Yokosawa Date: Sat Dec 4 04:37:35 2021 +0100 media: docs: media: Fix imbalance of LaTeX group The beginning part of the "existing HSV/HSL formats" table (line 7742) reads: .. raw:: latex \begingroup \tiny \setlength{\tabcolsep}{2pt} However, the ending part (line 7834) reads: .. raw:: latex \normalsize Fix the imbalance by replacing the \normalsize with \endgroup. Note: Actually, the imbalance is harmless and just results in an informative message near the bottom of userspace-api.log: (\end occurred inside a group at level 1) ### semi simple group (level 1) entered at line 70696 (\begingroup) ### bottom level Link: https://lore.kernel.org/linux-media/b3eeec4d-1a34-0a1a-3097-1ddea3b5f1c8@gmail.com Signed-off-by: Akira Yokosawa Cc: Jonathan Corbet Signed-off-by: Mauro Carvalho Chehab commit ac56760a8bbb4e654b2fd54e5de79dd5d72f937d Author: Tsuchiya Yuto Date: Wed Dec 1 15:19:04 2021 +0100 media: atomisp: fix "variable dereferenced before check 'asd'" There are two occurrences where the variable 'asd' is dereferenced before check. Fix this issue by using the variable after the check. Link: https://lore.kernel.org/linux-media/20211122074122.GA6581@kili/ Link: https://lore.kernel.org/linux-media/20211201141904.47231-1-kitakar@gmail.com Reported-by: Dan Carpenter Signed-off-by: Tsuchiya Yuto Signed-off-by: Mauro Carvalho Chehab commit 1ace494fd0ebea8581012f1b621c2b66b4b2671b Author: Colin Ian King Date: Tue Nov 30 00:06:26 2021 +0100 media: atomisp: make array idx_map static const Don't populate the array idx_map on the stack but instead make it static const. Also makes the object code smaller by 16 bytes. Link: https://lore.kernel.org/linux-media/20211129230626.549090-1-colin.i.king@gmail.com Signed-off-by: Colin Ian King Signed-off-by: Mauro Carvalho Chehab commit ee1806beff85d4f1a3d7f22aa1bcdc8ffb59b36c Author: Dafna Hirschfeld Date: Wed Dec 1 23:56:51 2021 +0100 media: videobuf2: add WARN_ON_ONCE if bytesused is bigger than buffer length In function vb2_set_plane_payload, report if the given bytesused is bigger than the buffer size, and clamp it to the buffer size. Signed-off-by: Dafna Hirschfeld Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 05fd87b8d9a6070f4ac9858cfd644e15a3e9c569 Author: Dafna Hirschfeld Date: Wed Dec 1 23:56:50 2021 +0100 media: replace setting of bytesused with vb2_set_plane_payload In many places the bytesused field of struct vb2_buffer is set directly. Replace that with the function call vb2_set_plane_payload Signed-off-by: Dafna Hirschfeld Reviewed-by: Laurent Pinchart Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit a9e6107616bb8108aa4fc22584a05e69761a91f7 Author: Hans Verkuil Date: Wed Dec 1 13:41:26 2021 +0100 media: cec: fix a deadlock situation The cec_devnode struct has a lock meant to serialize access to the fields of this struct. This lock is taken during device node (un)registration and when opening or releasing a filehandle to the device node. When the last open filehandle is closed the cec adapter might be disabled by calling the adap_enable driver callback with the devnode.lock held. However, if during that callback a message or event arrives then the driver will call one of the cec_queue_event() variants in cec-adap.c, and those will take the same devnode.lock to walk the open filehandle list. This obviously causes a deadlock. This is quite easy to reproduce with the cec-gpio driver since that uses the cec-pin framework which generated lots of events and uses a kernel thread for the processing, so when adap_enable is called the thread is still running and can generate events. But I suspect that it might also happen with other drivers if an interrupt arrives signaling e.g. a received message before adap_enable had a chance to disable the interrupts. This patch adds a new mutex to serialize access to the fhs list. When adap_enable() is called the devnode.lock mutex is held, but not devnode.lock_fhs. The event functions in cec-adap.c will now use devnode.lock_fhs instead of devnode.lock, ensuring that it is safe to call those functions from the adap_enable callback. This specific issue only happens if the last open filehandle is closed and the physical address is invalid. This is not something that happens during normal operation, but it does happen when monitoring CEC traffic (e.g. cec-ctl --monitor) with an unconfigured CEC adapter. Signed-off-by: Hans Verkuil Cc: # for v5.13 and up Signed-off-by: Mauro Carvalho Chehab commit 713bdfa10b5957053811470d298def9537d9ff13 Author: Hans Verkuil Date: Wed Dec 1 13:41:25 2021 +0100 media: cec-pin: fix interrupt en/disable handling The en/disable_irq() functions keep track of the 'depth': i.e. if interrupts are disabled twice, then it needs to enable_irq() calls to enable them again. The cec-pin framework didn't take this into accound and could disable irqs multiple times, and it expected that a single enable_irq() would enable them again. Move all calls to en/disable_irq() to the kthread where it is easy to keep track of the current irq state and ensure that multiple en/disable_irq calls never happen. If interrupts where disabled twice, then they would never turn on again, leaving the CEC adapter in a dead state. Signed-off-by: Hans Verkuil Fixes: 865463fc03ed (media: cec-pin: add error injection support) Cc: Signed-off-by: Mauro Carvalho Chehab commit 3a2e4b193690ff2e44e95856d90bdeaf337211f6 Author: Hans Verkuil Date: Wed Dec 1 13:28:55 2021 +0100 media: cec-pin: drop unused 'enabled' field from struct cec_pin This field is only set, but never used. Drop it. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit cf56f4f2a4ec7370b28e05cb4d228ffa7b65abbd Author: Rikard Falkeborn Date: Tue Nov 30 22:27:00 2021 +0100 media: s5p-jpeg: Constify struct v4l2_m2m_ops The only usage of the v4l2_m2m_ops structs is to pass their address to v4l2_m2m_init() which takes a pointer to const struct v4l2_m2m_ops as argument. Make them const to allow the compiler to put them in read-only memory. Signed-off-by: Rikard Falkeborn Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 0407c49ebe330333478440157c640fffd986f41b Author: Zhou Qingyang Date: Tue Nov 30 17:34:44 2021 +0100 media: saa7146: mxb: Fix a NULL pointer dereference in mxb_attach() In mxb_attach(dev, info), saa7146_vv_init() is called to allocate a new memory for dev->vv_data. saa7146_vv_release() will be called on failure of mxb_probe(dev). There is a dereference of dev->vv_data in saa7146_vv_release(), which could lead to a NULL pointer dereference on failure of saa7146_vv_init(). Fix this bug by adding a check of saa7146_vv_init(). This bug was found by a static analyzer. The analysis employs differential checking to identify inconsistent security operations (e.g., checks or kfrees) between two code paths and confirms that the inconsistent operations are not recovered in the current function or the callers, so they constitute bugs. Note that, as a bug found by static analysis, it can be a false positive or hard to trigger. Multiple researchers have cross-reviewed the bug. Builds with CONFIG_VIDEO_MXB=m show no new warnings, and our static analyzer no longer warns about this code. Fixes: 03b1930efd3c ("V4L/DVB: saa7146: fix regression of the av7110/budget-av driver") Signed-off-by: Zhou Qingyang Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 348df8035301dd212e3cc2860efe4c86cb0d3303 Author: Zhou Qingyang Date: Tue Nov 30 17:25:49 2021 +0100 media: saa7146: hexium_orion: Fix a NULL pointer dereference in hexium_attach() In hexium_attach(dev, info), saa7146_vv_init() is called to allocate a new memory for dev->vv_data. In hexium_detach(), saa7146_vv_release() will be called and there is a dereference of dev->vv_data in saa7146_vv_release(), which could lead to a NULL pointer dereference on failure of saa7146_vv_init() according to the following logic. Both hexium_attach() and hexium_detach() are callback functions of the variable 'extension', so there exists a possible call chain directly from hexium_attach() to hexium_detach(): hexium_attach(dev, info) -- fail to alloc memory to dev->vv_data | in saa7146_vv_init(). | | hexium_detach() -- a dereference of dev->vv_data in saa7146_vv_release() Fix this bug by adding a check of saa7146_vv_init(). This bug was found by a static analyzer. The analysis employs differential checking to identify inconsistent security operations (e.g., checks or kfrees) between two code paths and confirms that the inconsistent operations are not recovered in the current function or the callers, so they constitute bugs. Note that, as a bug found by static analysis, it can be a false positive or hard to trigger. Multiple researchers have cross-reviewed the bug. Builds with CONFIG_VIDEO_HEXIUM_ORION=m show no new warnings, and our static analyzer no longer warns about this code. Signed-off-by: Zhou Qingyang Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 8dbdcc7269a83305ee9d677b75064d3530a48ee2 Author: Zhou Qingyang Date: Tue Nov 30 16:38:05 2021 +0100 media: dib8000: Fix a memleak in dib8000_init() In dib8000_init(), the variable fe is not freed or passed out on the failure of dib8000_identify(&state->i2c), which could lead to a memleak. Fix this bug by adding a kfree of fe in the error path. This bug was found by a static analyzer. The analysis employs differential checking to identify inconsistent security operations (e.g., checks or kfrees) between two code paths and confirms that the inconsistent operations are not recovered in the current function or the callers, so they constitute bugs. Note that, as a bug found by static analysis, it can be a false positive or hard to trigger. Multiple researchers have cross-reviewed the bug. Builds with CONFIG_DVB_DIB8000=m show no new warnings, and our static analyzer no longer warns about this code. Fixes: 77e2c0f5d471 ("V4L/DVB (12900): DiB8000: added support for DiBcom ISDB-T/ISDB-Tsb demodulator DiB8000") Signed-off-by: Zhou Qingyang Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 468613a67bcbc9ef63fe13ec7214c34e5c7b96ba Author: Niklas Söderlund Date: Sun Nov 28 14:24:59 2021 +0100 media: rcar-vin: Do not hold the group lock when unregistering notifier There is no need to hold the group lock when unregistering the notifier, but doing so triggers a warning about a possible cyclic lock dependency. The lock warning cover the case where a subdevice is about to be bound to the notifier at the same time as it's unregistered. The locking for this scenario is handled in the v4l2-async framework so it's safe to remove the lock in the driver. This match the locking logic in the driver for when the notifier in question is registered. Signed-off-by: Niklas Söderlund Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e37e82188bc9114a9e285d003569dcad5f6d5612 Author: Niklas Söderlund Date: Sun Nov 28 14:24:47 2021 +0100 media: rcar-vin: Disallow unbinding and binding of individual VINs The VIN driver have an internal concept of capture groups that covers multiple instances of the driver. This is handled using the shared media graph and a single notifier shared between all VIN instances. This design do not work well if an individual VIN where to be unbound on its own. The design could be improved up on to allow for this but would require large changes in the v4l2-async framework. To avoid the situation suppress the bind and unbind nodes in sysfs. Signed-off-by: Niklas Söderlund Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 0d7b74ef8df409f43f64e4193b36dc5b3f38029e Author: Niklas Söderlund Date: Sun Nov 28 14:24:26 2021 +0100 media: rcar-csi2: Suppress bind and unbind nodes in sysfs The v4l2-async framework's subdev notifiers do not behave correctly if a device in the middle of the pipeline is unbound and then rebound. The v4l2-subdevices upstream from the device being rebound gets confused as they receive no notification of the device unbound and can't cleanup their state and when they are rebound to the new v4l2-subdev notifier they try to reinitialize their internal state, this may include things as trying to create links that already exists and in some cases crash the system, for example the adv748x. This should be solved in the v4l2-async framework, but as a stop-gap measure suppress the bind and unbind sysfs nodes for the rcar-csi2 driver so it can't be used to crash the system. Signed-off-by: Niklas Söderlund Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit da6911f330d40cfe115a37249e47643eff555e82 Author: Niklas Söderlund Date: Fri Nov 26 00:02:57 2021 +0100 media: rcar-vin: Update format alignment constraints This change fixes two issues with the size constraints for buffers. - There is no width alignment constraint for RGB formats. Prior to this change they were treated as YUV and as a result were more restricted than needed. Add a new check to differentiate between the two. - The minimum width and height supported is 5x2, not 2x4, this is an artifact from the driver's soc-camera days. Fix this incorrect assumption. Signed-off-by: Niklas Söderlund Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d912740881d5f7c13247ec714e9bc59b7cc1aace Author: Hans Verkuil Date: Thu Nov 25 16:42:10 2021 +0100 media: hantro: drop unused vb2 headers hantro_v4l2.c includes media/videobuf2-dma-sg.h, which isn't used. And in fact, hantro doesn't use the vb2_dma_sg_memops at all, so this is confusing. Just drop both videobuf2 headers, they are not needed here. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 30334d3d99e992c0d85791eed92e7196002f4d57 Author: Niklas Söderlund Date: Tue Nov 23 16:54:43 2021 +0100 media: rcar-vin: Add check for completed capture before completing buffer Before reading which slot was captured to by examining the module status (VnMS) register, make sure something was captured at all by examining the interrupt status register (VnINTS). Failing this a buffer maybe completed before it was captured too. Signed-off-by: Niklas Söderlund Reviewed-by: Kieran Bingham Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 8f852ab8c39b1639d53b67548268785d47eca11f Author: Samuel Holland Date: Fri Nov 19 04:15:18 2021 +0100 media: cedrus: Add support for the D1 variant D1 has a unique variant of the video engine, which appears to drop the VP8 support found on most earlier variants. Signed-off-by: Samuel Holland Acked-by: Maxime Ripard Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit b925c1fdea01e1a96348d2aa75b5c74adc8d3187 Author: Samuel Holland Date: Fri Nov 19 04:15:17 2021 +0100 media: dt-bindings: media: Add compatible for D1 D1 contains a video engine similar to the one in other sunxi SoCs. Add a compatible for it. Signed-off-by: Samuel Holland Acked-by: Maxime Ripard Acked-by: Rob Herring Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 414d3b49d9fd4a0bb16a13d929027847fd094f3f Author: Ricardo Ribalda Date: Wed Dec 1 06:22:18 2021 +0100 media: uvcvideo: Avoid returning invalid controls If the memory where ctrl_found is placed has the value of uvc_ctrl and __uvc_find_control does not find the control we will return an invalid index. Fixes: 6350d6a4ed487 ("media: uvcvideo: Set error_idx during ctrl_commit errors") Signed-off-by: Ricardo Ribalda Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit f0577b1b6394f954903fcc67e12fe9e7001dafd6 Author: Ricardo Ribalda Date: Wed Dec 1 06:22:17 2021 +0100 media: uvcvideo: Avoid invalid memory access If mappings points to an invalid memory, we will be invalid accessing it. Solve it by initializing the value of the variable mapping and by changing the order in the conditional statement (to avoid accessing mapping->id if not needed). Fix: kasan: GPF could be caused by NULL-ptr deref or user memory access general protection fault: 0000 [#1] PREEMPT SMP KASAN NOPTI Fixes: 6350d6a4ed487 ("media: uvcvideo: Set error_idx during ctrl_commit errors") Signed-off-by: Ricardo Ribalda Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit c8ed7d2f614cd8b315981d116c7a2fb01829500d Author: James Hilliard Date: Sun Nov 14 09:52:36 2021 +0100 media: uvcvideo: Increase UVC_CTRL_CONTROL_TIMEOUT to 5 seconds. Some uvc devices appear to require the maximum allowed USB timeout for GET_CUR/SET_CUR requests. So lets just bump the UVC control timeout to 5 seconds which is the same as the usb ctrl get/set defaults: USB_CTRL_GET_TIMEOUT 5000 USB_CTRL_SET_TIMEOUT 5000 It fixes the following runtime warnings: Failed to query (GET_CUR) UVC control 11 on unit 2: -110 (exp. 1). Failed to query (SET_CUR) UVC control 3 on unit 2: -110 (exp. 2). Signed-off-by: James Hilliard Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit e82822fae93ffc2b48362bfbcdef2ad00eaf944b Author: Ricardo Ribalda Date: Fri Nov 12 20:57:10 2021 +0100 media: uvcvideo: Set the colorspace as sRGB if undefined Never return V4L2_COLORSPACE_DEFAULT. From the standard: """ In the absence of this descriptor, or in the case of “Unspecified” values within the descriptor, color matching defaults will be assumed. The color matching defaults are compliant with sRGB since the BT.709 transfer function and the sRGB transfer function are very similar. """ Signed-off-by: Ricardo Ribalda Tested-by: James Hilliard Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 8aa637bf6d70d2fb2ad4d708d8b9dd02b1c095df Author: Johan Hovold Date: Tue Oct 26 11:55:11 2021 +0200 media: uvcvideo: fix division by zero at stream start Add the missing bulk-endpoint max-packet sanity check to uvc_video_start_transfer() to avoid division by zero in uvc_alloc_urb_buffers() 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: c0efd232929c ("V4L/DVB (8145a): USB Video Class driver") Cc: stable@vger.kernel.org # 2.6.26 Signed-off-by: Johan Hovold Reviewed-by: Kieran Bingham Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 4b065060555b14c7a9b86c013a1c9bee8e8b6fbd Author: Colin Ian King Date: Fri Sep 17 13:49:30 2021 +0200 media: uvcvideo: Fix memory leak of object map on error exit path Currently when the allocation of map->name fails the error exit path does not kfree the previously allocated object map. Fix this by setting ret to -ENOMEM and taking the free_map exit error path to ensure map is kfree'd. Addresses-Coverity: ("Resource leak") Fixes: 70fa906d6fce ("media: uvcvideo: Use control names from framework") Signed-off-by: Colin Ian King Reviewed-by: Ricardo Ribalda Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 4383cfa18c5bbc5b9b6a9e77adc12aec1c20b72d Merge: 8cc7a1b2aca06 0fcfb00b28c0b Author: Mauro Carvalho Chehab Date: Tue Dec 7 11:29:41 2021 +0100 Merge tag 'v5.16-rc4' into media_tree Linux 5.16-rc4 * tag 'v5.16-rc4': (984 commits) Linux 5.16-rc4 KVM: SVM: Do not terminate SEV-ES guests on GHCB validation failure KVM: SEV: Fall back to vmalloc for SEV-ES scratch area if necessary KVM: SEV: Return appropriate error codes if SEV-ES scratch setup fails parisc: Mark cr16 CPU clocksource unstable on all SMP machines parisc: Fix "make install" on newer debian releases sched/uclamp: Fix rq->uclamp_max not set on first enqueue preempt/dynamic: Fix setup_preempt_mode() return value cifs: avoid use of dstaddr as key for fscache client cookie cifs: add server conn_id to fscache client cookie cifs: wait for tcon resource_id before getting fscache super cifs: fix missed refcounting of ipc tcon x86/xen: Add xenpv_restore_regs_and_return_to_usermode() x86/entry: Use the correct fence macro after swapgs in kernel CR3 fget: check that the fd still exists after getting a ref to it x86/entry: Add a fence for kernel entry SWAPGS in paranoid_entry() x86/sev: Fix SEV-ES INS/OUTS instructions for word, dword, and qword powercap: DTPM: Drop unused local variable from init_dtpm() io-wq: don't retry task_work creation failure on fatal conditions serial: 8250_bcm7271: UART errors after resuming from S2 ... commit aa483f3ce655ed9ee4f32d050d1822eec2d20ada Author: Heiko Carstens Date: Mon Dec 6 13:53:11 2021 +0100 topology/sysfs: get rid of htmldoc warning Stephen Rothwell reported the following warning caused by commit f1045056c726 ("topology/sysfs: rework book and drawer topology ifdefery"): Documentation/admin-guide/cputopology.rst:49: WARNING: Block quote ends without a blank line; unexpected unindent. To fix this remove the extra indentation again. Fixes: f1045056c726 ("topology/sysfs: rework book and drawer topology ifdefery") Reported-by: Stephen Rothwell Signed-off-by: Heiko Carstens Link: https://lore.kernel.org/r/Ya4Ht2K9x2+lUtuR@osiris Signed-off-by: Greg Kroah-Hartman commit b07f55053557946d77d33ff6bc854058bb10621c Author: Phillip Potter Date: Mon Dec 6 23:49:52 2021 +0000 staging: r8188eu: convert/remove DBG_88E calls in core/rtw_cmd.c Convert two DBG_88E calls within core/rtw_cmd.c to netdev_dbg calls, and remove three commented DBG_88E calls. Considering the original driver author commented them, it seems better to delete these three than convert. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20211206234952.1238-3-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit efc7bc10d23f624ef2f9458d9c3b52d8415af3a0 Author: Phillip Potter Date: Mon Dec 6 23:49:51 2021 +0000 staging: r8188eu: convert DBG_88E calls in core/rtw_security.c Convert all DBG_88E calls in core/rtw_security.c to netdev_dbg calls. These calls seem to contain useful information/assertions and so are probably worth keeping. In doing this conversion, also convert static aes_decipher to take a struct adapter * parameter, as per the convention elsewhere in the driver currently. This allows us to pass this through and access its pnetdev member for the netdev_dbg call in the function. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20211206234952.1238-2-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit bbe440bcc3f58087de19c7d9e03c9a9f1ab9b0a5 Author: Michael Straube Date: Sun Dec 5 18:13:42 2021 +0100 staging: r8188eu: remove unused macro IS_FW_81xxC The macro IS_FW_81xxC is not used. Remove it. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211205171342.20551-11-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit c84a7062d8863e15edd77ae1db5b04e0e245f289 Author: Michael Straube Date: Sun Dec 5 18:13:41 2021 +0100 staging: r8188eu: bWIFI_Display is set but never used bWIFI_Display in odm_dm_struct is set but never used. Remove it. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211205171342.20551-10-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit a773bcc4626a2166ed58972de84056c933f95827 Author: Michael Straube Date: Sun Dec 5 18:13:40 2021 +0100 staging: r8188eu: bWIFI_Direct is set but never used bWIFI_Direct in odm_dm_struct is set but never used. Remove it. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211205171342.20551-9-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 1602cce406f82e62342e73093856afa4720785c3 Author: Michael Straube Date: Sun Dec 5 18:13:39 2021 +0100 staging: r8188eu: remove duplicate defines The following constants are defined in three different header files. IQK_MAC_REG_NUM IQK_ADDA_REG_NUM IQK_BB_REG_NUM HP_THERMAL_NUM Keep them in odm.h and remove them from Hal8188EPhyCfg.h and rtl8188e_dm.h. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211205171342.20551-8-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit f6e018ae9a28bc472bd5add373b6efa3626c7661 Author: Michael Straube Date: Sun Dec 5 18:13:38 2021 +0100 staging: r8188eu: remove macro PHY_QueryBBReg The macro PHY_QueryBBReg just re-defines rtl8188e_PHY_QueryBBReg(). Call rtl8188e_PHY_QueryBBReg() directly and remove the macro. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211205171342.20551-7-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 5f82ac51783bd10da94dfdd80e3be2d8ee59ac79 Author: Michael Straube Date: Sun Dec 5 18:13:37 2021 +0100 staging: r8188eu: remove macro PHY_SetBBReg The macro PHY_SetBBReg just re-defines rtl8188e_PHY_SetBBReg(). Call rtl8188e_PHY_SetBBReg() directly and remove the macro. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211205171342.20551-6-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0783f44d9004bc9e7d7d7bf66ce3ae8c68744528 Author: Michael Straube Date: Sun Dec 5 18:13:36 2021 +0100 staging: r8188eu: remove macro PHY_QueryRFReg The macro PHY_QueryRFReg just re-defines rtl8188e_PHY_QueryRFReg(). Call rtl8188e_PHY_QueryRFReg() directly and remove the macro. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211205171342.20551-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 39b0e3d6e29c491ba94c12f3aa64555a9d78198e Author: Michael Straube Date: Sun Dec 5 18:13:35 2021 +0100 staging: r8188eu: remove macro PHY_SetRFReg The macro PHY_SetRFReg just re-defines rtl8188e_PHY_SetRFReg(). Call rtl8188e_PHY_SetRFReg() directly and remove the macro. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211205171342.20551-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2d91168a38a746d89d8394a763b11143faf9d29b Author: Michael Straube Date: Sun Dec 5 18:13:34 2021 +0100 staging: r8188eu: struct odm_mac_status_info is not used The structure odm_mac_status_info is not used. Remove it. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211205171342.20551-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit ec5967c04e6a871958512f47b875717d29e9f5d5 Author: Michael Straube Date: Sun Dec 5 18:13:33 2021 +0100 staging: r8188eu: remove RF_PATH_{C,D} pHalData->PHYRegDef[RF_PATH_C] and pHalData->PHYRegDef[RF_PATH_D] are initialized but not used. Remove them and remove RF_PATH_C and RF_PATH_D from the rf_radio_path enum. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211205171342.20551-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 1684457358818de7697b09b4688a41b512c60e5c Author: Martin Kaiser Date: Sun Dec 5 16:12:51 2021 +0100 staging: r8188eu: AntCombination is always 2 AntCombination is initialized with 2 and never changed. Remove resulting dead code. Acked-by: Michael Straube Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211205151251.6861-11-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit a917a9dd8ada60a7e4219c98300dbefda2b1c53d Author: Martin Kaiser Date: Sun Dec 5 16:12:50 2021 +0100 staging: r8188eu: remove unused define Remove the _IOCTL_LINUX_C_ define, which is not used. Acked-by: Michael Straube Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211205151251.6861-10-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 93bc0b3d5334c9a5257913f70bc9bdbd0f056dc3 Author: Martin Kaiser Date: Sun Dec 5 16:12:49 2021 +0100 staging: r8188eu: remove two write-only wifi direct variables Remove two variables related to wifidirect which are set but not used. Acked-by: Michael Straube Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211205151251.6861-9-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 390c811a7b3e99adbe81344625187a224fc2fbbe Author: Martin Kaiser Date: Sun Dec 5 16:12:48 2021 +0100 staging: r8188eu: remove empty HAL_INIT_PROFILE_TAG macro Remove the HAL_INIT_PROFILE_TAG macro, which is empty. Acked-by: Michael Straube Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211205151251.6861-8-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 02d85324158c40784bdaa24c77d35a6a32bb755a Author: Martin Kaiser Date: Sun Dec 5 16:12:47 2021 +0100 staging: r8188eu: hal data's interfaceIndex is never read interfaceIndex in struct hal_data_8188e is set but not used. It can be removed. Acked-by: Michael Straube Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211205151251.6861-7-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit cc23553e5bd450a50d82aae90f40a80e9f3628cd Author: Martin Kaiser Date: Sun Dec 5 16:12:46 2021 +0100 staging: r8188eu: remove unused macros from drv_types.h Remove some unused macros from drv_types.h. Acked-by: Michael Straube Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211205151251.6861-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit b20bdcdfd16dd33e4560d007a1aba9e159925585 Author: Martin Kaiser Date: Sun Dec 5 16:12:45 2021 +0100 staging: r8188eu: bHWPowerdown is set but not used bHWPowerdown in struct pwrctrl_priv is set but never read. Remove it. Acked-by: Michael Straube Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211205151251.6861-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit bcb898c690a8040963167c6c1d178e513474e43d Author: Martin Kaiser Date: Sun Dec 5 16:12:44 2021 +0100 staging: r8188eu: remove two unused macros Remove two unused macros that increment and decrement a "mutex counter". Acked-by: Michael Straube Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211205151251.6861-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit bce47253f5e01be643d291b9511c801bf35e3748 Author: Martin Kaiser Date: Sun Dec 5 16:12:43 2021 +0100 staging: r8188eu: remove a bunch of unused led defines Remove a couple of unused defines from rtw_led.h. Acked-by: Michael Straube Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211205151251.6861-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 5f31e13e2dcb5a8e46d1793b8b8285df59eee404 Author: Martin Kaiser Date: Sun Dec 5 16:12:42 2021 +0100 staging: r8188eu: bLedOpenDrain is always true for r8188eu Remove the bLedOpenDrain variable and code that would be executed only if bLedOpenDrain was false. Acked-by: Michael Straube Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211205151251.6861-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 49ae248b61aefa0eff84dca8e81bd9306cdaa6c9 Author: Janis Schoetterl-Glausch Date: Thu Nov 18 11:25:22 2021 +0100 KVM: s390: Fix names of skey constants in api documentation They are defined in include/uapi/linux/kvm.h as KVM_S390_GET_SKEYS_NONE and KVM_S390_SKEYS_MAX, but the api documetation talks of KVM_S390_GET_KEYS_NONE and KVM_S390_SKEYS_ALLOC_MAX respectively. Signed-off-by: Janis Schoetterl-Glausch Reviewed-by: Janosch Frank Message-Id: <20211118102522.569660-1-scgl@linux.ibm.com> Signed-off-by: Janosch Frank commit 94b4a6d52173521b63b11516fe963d651dc520a4 Merge: 370a17f531f17 f0e6e6fa41b3d Author: Marc Zyngier Date: Tue Dec 7 09:14:53 2021 +0000 Merge branch kvm-arm64/misc-5.17 into kvmarm-master/next * kvm-arm64/misc-5.17: : . : - Add minimal support for ARMv8.7's PMU extension : - Constify kvm_io_gic_ops : - Drop kvm_is_transparent_hugepage() prototype : . KVM: Drop stale kvm_is_transparent_hugepage() declaration KVM: arm64: Constify kvm_io_gic_ops KVM: arm64: Add minimal handling for the ARMv8.7 PMU Signed-off-by: Marc Zyngier commit 370a17f531f1736b7f17d9ac3fb8ef1013d956fd Merge: 2d761dbf7ff48 9429f4b0412d0 Author: Marc Zyngier Date: Tue Dec 7 09:14:49 2021 +0000 Merge branch kvm-arm64/hyp-header-split into kvmarm-master/next * kvm-arm64/hyp-header-split: : . : Tidy up the header file usage for the nvhe hyp object so : that header files under arch/arm64/kvm/hyp/include are not : included by host code running at EL1. : . KVM: arm64: Move host EL1 code out of hyp/ directory KVM: arm64: Generate hyp_constants.h for the host arm64: Add missing include of asm/cpufeature.h to asm/mmu.h Signed-off-by: Marc Zyngier commit f0e6e6fa41b3d2aa1dcb61dd4ed6d7be004bb5a8 Author: Vitaly Kuznetsov Date: Mon Oct 18 17:14:07 2021 +0200 KVM: Drop stale kvm_is_transparent_hugepage() declaration kvm_is_transparent_hugepage() was removed in commit 205d76ff0684 ("KVM: Remove kvm_is_transparent_hugepage() and PageTransCompoundMap()") but its declaration in include/linux/kvm_host.h persisted. Drop it. Fixes: 205d76ff0684 (""KVM: Remove kvm_is_transparent_hugepage() and PageTransCompoundMap()") Signed-off-by: Vitaly Kuznetsov Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211018151407.2107363-1-vkuznets@redhat.com commit fbf8b5dc6d9edd7f807f7a6f44ff4c18f96f9efc Author: Jani Nikula Date: Fri Dec 3 15:13:18 2021 +0200 drm/i915/ddi: add use_edp_hobl() and use_edp_low_vswing() helpers Localize HOBL and low vswing VBT lookups to a couple of small helpers, and get rid of a bunch of local variables. Signed-off-by: Jani Nikula Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20211203131318.2885969-1-jani.nikula@intel.com commit 61b98486e4314d39d43921680d68b46c3083b22e Author: Jani Nikula Date: Thu Dec 2 16:44:56 2021 +0200 drm/i915/snps: use div32 version of MPLLB word clock for UHBR The mode set sequence for 128b/132b requires setting the div32 version of MPLLB clock. Bspec: 53880, 54128 Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211202144456.2541305-1-jani.nikula@intel.com commit c7d58971dbea0888b6328ed0ea61089a6d62253a Author: Kees Cook Date: Mon Dec 6 22:29:41 2021 -0800 ALSA: mixart: Reduce size of mixart_timer_notify The mixart_timer_notify structure was larger than could be represented by the mixart_msg_data array storage. Adjust the size to as large as possible to fix the warning seen with -Warray-bounds builds: sound/pci/mixart/mixart_core.c: In function 'snd_mixart_threaded_irq': sound/pci/mixart/mixart_core.c:447:50: error: array subscript 'struct mixart_timer_notify[0]' is partly outside array bounds of 'u32[128]' {aka 'unsigned int[128]'} [-Werror=array-bounds] 447 | for(i=0; istream_count; i++) { | ^~ sound/pci/mixart/mixart_core.c:328:12: note: while referencing 'mixart_msg_data' 328 | static u32 mixart_msg_data[MSG_DEFAULT_SIZE / 4]; | ^~~~~~~~~~~~~~~ Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20211207062941.2413679-1-keescook@chromium.org Signed-off-by: Takashi Iwai commit 8c374ef45416281c7172dc29ed438dfb445795f1 Author: Charles Keepax Date: Mon Dec 6 23:23:00 2021 -0800 Input: ff-core - correct magnitude setting for rumble compatibility When converting a rumble into a periodic effect, for compatibility, the magnitude is effectively calculated using: magnitude = max(strong_rubble / 3 + weak_rubble / 6, 0x7fff); The rumble magnitudes are both u16 and the resulting magnitude is s16. The max is presumably an attempt to limit the result of the calculation to the maximum possible magnitude for the s16 result, and thus should be a min. However in the case of strong = weak = 0xffff, the result of the first part of the calculation is 0x7fff, meaning that the min would be redundant anyway, so simply remove the current max. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20211130135039.13726-1-ckeepax@opensource.cirrus.com Signed-off-by: Dmitry Torokhov commit b85a4d9628341c6a790354a28fd45c2cf7741273 Author: Colin Ian King Date: Mon Nov 29 17:27:18 2021 -0800 Input: palmas-pwrbutton - make a couple of arrays static const Don't populate a couple of arrays on the stack but instead make them static const. Also makes the object code smaller by a few hundred bytes. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20211129231749.619469-1-colin.i.king@gmail.com Signed-off-by: Dmitry Torokhov commit 1c7ab5affa5e73ed75732be2f2fabe1ae86c82e1 Author: Uma Shankar Date: Tue Dec 7 12:41:35 2021 +0530 drm/i915/xelpd: Add Pipe Color Lut caps to platform config XE_LPD has 128 Lut entries for Degamma, with additional 3 entries for extended range. It has 511 entries for gamma with additional 2 entries for extended range. v2: Updated lut size for 10bit gamma, added lut_tests (Ville) v3: Dropped the gamma lut tests fields (Ville) Signed-off-by: Uma Shankar Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211207071135.3660332-4-uma.shankar@intel.com commit 17815f624a90579aeac4b700f8434e9ff6a6d001 Author: Uma Shankar Date: Tue Dec 7 12:41:34 2021 +0530 drm/i915/xelpd: Enable Pipe Degamma Enable Pipe Degamma for XE_LPD. Extend the legacy implementation to incorparate the extended lut size for XE_LPD. v2: Added a helper for degamma lut size (Ville) Signed-off-by: Uma Shankar Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211207071135.3660332-3-uma.shankar@intel.com commit e83c18cffaedb1cd5da935b06d49308f92ea50cb Author: Uma Shankar Date: Tue Dec 7 12:41:33 2021 +0530 drm/i915/xelpd: Enable Pipe color support for D13 platform Enable pipe color support for Display 13 platforms. Currently limit to just 10bit gamma and later extend it for logarithmic gamma, once the new UAPI is agreed by community and implemented by a userspace consumer. v2: Updated dev_priv to i915 (Ville) Signed-off-by: Uma Shankar Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211207071135.3660332-2-uma.shankar@intel.com commit 5d50c8d7ed59f675d25cf061b5ca67ebfa7b450b Author: Madhumitha Tolakanahalli Pradeep Date: Mon Dec 6 18:37:18 2021 -0800 drm/i915/dmc: Change max DMC FW size on ADL-P Increase the max size of DMC on ADL-P to account for support of new features in the current/upcoming DMC versions. Signed-off-by: Madhumitha Tolakanahalli Pradeep Reviewed-by: Lucas De Marchi Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20211207023718.322349-1-madhumitha.tolakanahalli.pradeep@intel.com commit 5f97816762722cb08a4e0a124fec02abe0a2208e Author: Michael Cheng Date: Mon Dec 6 13:52:45 2021 -0800 drm/i915: Introduce new macros for i915 PTE Certain functions within i915 uses macros that are defined for specific architectures by the mmu, such as _PAGE_RW and _PAGE_PRESENT (Some architectures don't even have these macros defined, like ARM64). Instead of re-using bits defined for the CPU, we should use bits defined for i915. This patch introduces two new 64 bit macros, GEN8_PAGE_PRESENT and GEN8_PAGE_RW, to check for bits 0 and 1 and, to replace all occurrences of _PAGE_RW and _PAGE_PRESENT within i915. v2(Michael Cheng): Use GEN8_ instead of I915_ Signed-off-by: Michael Cheng Reviewed-by: Lucas De Marchi [ Move defines together with other GEN8 defines ] Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20211206215245.513677-2-michael.cheng@intel.com commit bf2c05b619ffc0bccf60d2108bfadc880ee7f5c7 Author: Mark Kettenis Date: Mon Dec 6 19:38:16 2021 +0100 arm64: dts: apple: t8103: Expose PCI node for the WiFi MAC address Expose the PCI node corresponding to the WiFi device and give it a 'local-mac-address' property. The bootloader will update it (m1n1 already has the required feature). Signed-off-by: Mark Kettenis Acked-by: Marc Zyngier Signed-off-by: Hector Martin commit 2ba22cfeda44566aeb333f519ade0633e405aade Author: Hector Martin Date: Mon Sep 20 02:28:20 2021 +0900 arm64: dts: apple: t8103: Add UART2 This UART is connected to the debug port of the WLAN module. It is mostly useless, but makes for a good test case for runtime-pm without having to unbind the console from the main system UART. Reviewed-by: Mark Kettenis Signed-off-by: Hector Martin commit 106ba3b48a35ddf819ec5786208cf109c81da161 Author: Hector Martin Date: Wed Nov 24 16:34:19 2021 +0900 arm64: dts: apple: t8103: Add PMGR nodes This adds the two PMGR nodes and all known power state subnodes. Since there are a large number of them, let's put them in a separate file to include. Reviewed-by: Sven Peter Signed-off-by: Hector Martin commit 6df9d38f9146e83b473f0c9e57fb5fdf3fcc93e2 Author: Hector Martin Date: Wed Nov 24 16:34:18 2021 +0900 soc: apple: Add driver for Apple PMGR power state controls Implements genpd and reset providers for downstream devices. Each instance of the driver binds to a single register and represents a single SoC power domain. The driver does not currently implement all features (clockgate-only state, misc flags), but we declare the respective registers for documentation purposes. These features will be added as they become useful for downstream devices. This also creates the apple/soc tree and Kconfig submenu. Acked-by: Linus Walleij Signed-off-by: Hector Martin commit c83eeec79ff64f777cbd59a8bd15d0a3fe1f92c0 Author: Hector Martin Date: Wed Nov 24 16:34:17 2021 +0900 dt-bindings: arm: apple: Add apple,pmgr binding The PMGR block in Apple Silicon SoCs is responsible for SoC power management. There are two PMGRs in T8103, with different register layouts but compatible registers. In order to support this as well as future SoC generations with backwards-compatible registers, we declare these blocks as syscons and bind to individual registers in child nodes. Each register controls one SoC device. The respective apple compatibles are defined in case device-specific quirks are necessary in the future, but currently these nodes are expected to be bound by the generic syscon driver. Reviewed-by: Mark Kettenis Reviewed-by: Rob Herring Signed-off-by: Hector Martin commit e8117f85b95b932069b9db73ccb3ee973ade2fc9 Author: Hector Martin Date: Wed Nov 24 16:34:16 2021 +0900 dt-bindings: power: Add apple,pmgr-pwrstate binding This syscon child node represents a single SoC device controlled by the PMGR block. This layout allows us to declare all device power state controls (power/clock gating and reset) in the device tree, including dependencies, instead of hardcoding it into the driver. The register layout is uniform. Each pmgr-pwrstate node provides genpd and reset features, to be consumed by downstream device nodes. Future SoCs are expected to use backwards compatible registers, and the "apple,pmgr-pwrstate" represents any such interfaces (possibly with additional features gated by the more specific compatible), allowing them to be bound without driver updates. If a backwards incompatible change is introduced in future SoCs, it will require a new compatible, such as "apple,pmgr-pwrstate-v2". Reviewed-by: Mark Kettenis Reviewed-by: Rob Herring Signed-off-by: Hector Martin commit bd4d13ed210a6d3aadaaa9c93ee7e0671579cd10 Author: Hector Martin Date: Mon Oct 25 23:31:16 2021 +0900 MAINTAINERS: Add PMGR power state files to ARM/APPLE MACHINE This covers the PMGR power state driver and its DT bindings, as well as any other future stuff in drivers/soc/apple. Signed-off-by: Hector Martin commit 9e9652862ac253e7b589e6c624ac6f40df5fa297 Author: Sven Peter Date: Tue Nov 30 17:18:08 2021 +0100 dt-bindings: watchdog: Add Apple Watchdog Apple SoCs come with a simple embedded watchdog. This watchdog is also required in order to reset the SoC. Reviewed-by: Mark Kettenis Reviewed-by: Rob Herring Signed-off-by: Sven Peter Reviewed-by: Guenter Roeck Signed-off-by: Hector Martin commit 4437503bfbec2f02b41b2492520fe627715889a7 Author: James Smart Date: Fri Dec 3 16:26:44 2021 -0800 scsi: lpfc: Update lpfc version to 14.0.0.4 Update lpfc version to 14.0.0.4. Link: https://lore.kernel.org/r/20211204002644.116455-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 6014a2468f0e49194f612b1f09f99eacee0a409a Author: James Smart Date: Fri Dec 3 16:26:43 2021 -0800 scsi: lpfc: Add additional debugfs support for CMF Dump raw CMF parameter information in debugfs cgn_buffer. Link: https://lore.kernel.org/r/20211204002644.116455-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 05116ef9c4b444f7fdbb56f9e13c2ec941726639 Author: James Smart Date: Fri Dec 3 16:26:42 2021 -0800 scsi: lpfc: Cap CMF read bytes to MBPI Ensure read bytes data does not go over MBPI for CMF timer intervals that are purposely shortened. Link: https://lore.kernel.org/r/20211204002644.116455-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 a6269f837045acb02904f31f05acde847ec8f8a7 Author: James Smart Date: Fri Dec 3 16:26:41 2021 -0800 scsi: lpfc: Adjust CMF total bytes and rxmonitor Calculate any extra bytes needed to account for timer accuracy. If we are less than LPFC_CMF_INTERVAL, then calculate the adjustment needed for total to reflect a full LPFC_CMF_INTERVAL. Add additional info to rxmonitor, and adjust some log formatting. Link: https://lore.kernel.org/r/20211204002644.116455-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 7dd2e2a923173d637c272e483966be8e96a72b64 Author: James Smart Date: Fri Dec 3 16:26:40 2021 -0800 scsi: lpfc: Trigger SLI4 firmware dump before doing driver cleanup Extraneous teardown routines are present in the firmware dump path causing altered states in firmware captures. When a firmware dump is requested via sysfs, trigger the dump immediately without tearing down structures and changing adapter state. The driver shall rely on pre-existing firmware error state clean up handlers to restore the adapter. Link: https://lore.kernel.org/r/20211204002644.116455-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 8ed190a91950564775cbaae9e8e8083a69a8da23 Author: James Smart Date: Fri Dec 3 16:26:39 2021 -0800 scsi: lpfc: Fix NPIV port deletion crash The driver is calling schedule_timeout after the DA_ID nameserver request and LOGO commands are issued to the fabric by the initiator virtual endport. These fixed delay functions are causing long delays in the driver's worker thread when processing discovery I/Os in a serialized fashion, which is then triggering mailbox timeout errors artificially. To fix this, don't wait on the DA_ID request to complete and call wait_event_timeout to allow the vport delete thread to make progress on an event driven basis rather than fixing the wait time. Link: https://lore.kernel.org/r/20211204002644.116455-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 7576d48c64f36f6fea9df2882f710a474fa35f40 Author: James Smart Date: Fri Dec 3 16:26:38 2021 -0800 scsi: lpfc: Fix lpfc_force_rscn ndlp kref imbalance Issuing lpfc_force_rscn twice results in an ndlp kref use-after-free call trace. A prior patch reworked the get/put handling by ensuring nlp_get was done before WQE submission and a put was done in the completion path. Unfortunately, the issue_els_rscn path had a piece of legacy code that did a nlp_put, causing an imbalance on the ref counts. Fixed by removing the unnecessary legacy code snippet. Link: https://lore.kernel.org/r/20211204002644.116455-4-jsmart2021@gmail.com Fixes: 4430f7fd09ec ("scsi: lpfc: Rework locations of ndlp reference taking") Cc: # v5.11+ Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart Signed-off-by: Martin K. Petersen commit 2e81b1a374da5d6024208c16c4a5224a70cafa64 Author: James Smart Date: Fri Dec 3 16:26:37 2021 -0800 scsi: lpfc: Change return code on I/Os received during link bounce During heavy I/O testing with issue_lip to bounce the link, occasionally I/O is terminated with status 3 result 9, which means the RPI is suspended. The I/O is completed and this type of error will result in immediate retry by the SCSI layer. The retry count expires and the I/O fails and returns error to the application. To avoid these quick retry/retries exhausted scenarios change the return code given to the midlayer to DID_REQUEUE rather than DID_ERROR. This gets them retried, and eventually succeed when the link recovers. Link: https://lore.kernel.org/r/20211204002644.116455-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 f0d3919697492950f57a26a1093aee53880d669d Author: James Smart Date: Fri Dec 3 16:26:36 2021 -0800 scsi: lpfc: Fix leaked lpfc_dmabuf mbox allocations with NPIV During rmmod testing, messages appeared indicating lpfc_mbuf_pool entries were still busy. This situation was only seen doing rmmod after at least 1 vport (NPIV) instance was created and destroyed. The number of messages scaled with the number of vports created. When a vport is created, it can receive a PLOGI from another initiator Nport. When this happens, the driver prepares to ack the PLOGI and prepares an RPI for registration (via mbx cmd) which includes an mbuf allocation. During the unsolicited PLOGI processing and after the RPI preparation, the driver recognizes it is one of the vport instances and decides to reject the PLOGI. During the LS_RJT preparation for the PLOGI, the mailbox struct allocated for RPI registration is freed, but the mbuf that was also allocated is not released. Fix by freeing the mbuf with the mailbox struct in the LS_RJT path. As part of the code review to figure the issue out a couple of other areas where found that also would not have released the mbuf. Those are cleaned up as well. Link: https://lore.kernel.org/r/20211204002644.116455-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 fda684fb5ec9ff5afb76441ad5371f89aa3775a4 Merge: 29f2e5bd94394 6f670d06e47c7 Author: Andrii Nakryiko Date: Mon Dec 6 19:33:45 2021 -0800 Merge branch 'samples: bpf: fix build issues with Clang/LLVM' Alexander Lobakin says: ==================== Samples, at least XDP ones, can be built only with the compiler used to build the kernel itself. However, XDP sample infra introduced in Aug'21 was probably tested with GCC/Binutils only as it's not really compilable for now with Clang/LLVM. These two are trivial fixes addressing this. ==================== Signed-off-by: Andrii Nakryiko commit 6f670d06e47c774bc065aaa84a527a4838f34bd8 Author: Alexander Lobakin Date: Fri Dec 3 20:50:04 2021 +0100 samples: bpf: Fix 'unknown warning group' build warning on Clang Clang doesn't have 'stringop-truncation' group like GCC does, and complains about it when building samples which use xdp_sample_user infra: samples/bpf/xdp_sample_user.h:48:32: warning: unknown warning group '-Wstringop-truncation', ignored [-Wunknown-warning-option] #pragma GCC diagnostic ignored "-Wstringop-truncation" ^ [ repeat ] Those are harmless, but avoidable when guarding it with ifdef. I could guard push/pop as well, but this would require one more ifdef cruft around a single line which I don't think is reasonable. Fixes: 156f886cf697 ("samples: bpf: Add basic infrastructure for XDP samples") Signed-off-by: Alexander Lobakin Signed-off-by: Andrii Nakryiko Acked-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/bpf/20211203195004.5803-3-alexandr.lobakin@intel.com commit e64fbcaa7a666f16329b1c67af15ea501bc84586 Author: Alexander Lobakin Date: Fri Dec 3 20:50:03 2021 +0100 samples: bpf: Fix xdp_sample_user.o linking with Clang Clang (13) doesn't get the jokes about specifying libraries to link in cclags of individual .o objects: clang-13: warning: -lm: 'linker' input unused [-Wunused-command-line-argument] [ ... ] LD samples/bpf/xdp_redirect_cpu LD samples/bpf/xdp_redirect_map_multi LD samples/bpf/xdp_redirect_map LD samples/bpf/xdp_redirect LD samples/bpf/xdp_monitor /usr/bin/ld: samples/bpf/xdp_sample_user.o: in function `sample_summary_print': xdp_sample_user.c:(.text+0x84c): undefined reference to `floor' /usr/bin/ld: xdp_sample_user.c:(.text+0x870): undefined reference to `ceil' /usr/bin/ld: xdp_sample_user.c:(.text+0x8cf): undefined reference to `floor' /usr/bin/ld: xdp_sample_user.c:(.text+0x8f3): undefined reference to `ceil' [ more ] Specify '-lm' as ldflags for all xdp_sample_user.o users in the main Makefile and remove it from ccflags of ^ in Makefile.target -- just like it's done for all other samples. This works with all compilers. Fixes: 6e1051a54e31 ("samples: bpf: Convert xdp_monitor to XDP samples helper") Fixes: b926c55d856c ("samples: bpf: Convert xdp_redirect to XDP samples helper") Fixes: e531a220cc59 ("samples: bpf: Convert xdp_redirect_cpu to XDP samples helper") Fixes: bbe65865aa05 ("samples: bpf: Convert xdp_redirect_map to XDP samples helper") Fixes: 594a116b2aa1 ("samples: bpf: Convert xdp_redirect_map_multi to XDP samples helper") Signed-off-by: Alexander Lobakin Signed-off-by: Andrii Nakryiko Acked-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/bpf/20211203195004.5803-2-alexandr.lobakin@intel.com commit eaab9b57305496067e225155ca86bf77c9a982f7 Author: Bart Van Assche Date: Fri Dec 3 15:19:50 2021 -0800 scsi: ufs: Implement polling support The time spent in io_schedule() and also the interrupt latency are significant when submitting direct I/O to a UFS device. Hence this patch that implements polling support. User space software can enable polling by passing the RWF_HIPRI flag to the preadv2() system call or the IORING_SETUP_IOPOLL flag to the io_uring interface. Although the block layer supports to partition the tag space for interrupt-based completions (HCTX_TYPE_DEFAULT) purposes and polling (HCTX_TYPE_POLL), the choice has been made to use the same hardware queue for both hctx types because partitioning the tag space would negatively affect performance. On my test setup this patch increases IOPS from 2736 to 22000 (8x) for the following test: for hipri in 0 1; do fio --ioengine=io_uring --iodepth=1 --rw=randread \ --runtime=60 --time_based=1 --direct=1 --name=qd1 \ --filename=/dev/block/sda --ioscheduler=none --gtod_reduce=1 \ --norandommap --hipri=$hipri done Link: https://lore.kernel.org/r/20211203231950.193369-18-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 8d077ede48c1532d791c027467d152ae137c54ab Author: Bart Van Assche Date: Fri Dec 3 15:19:49 2021 -0800 scsi: ufs: Optimize the command queueing code Remove the clock scaling lock from ufshcd_queuecommand() since it is a performance bottleneck. Instead check the SCSI device budget bitmaps in the code that waits for ongoing ufshcd_queuecommand() calls. A bit is set in sdev->budget_map just before scsi_queue_rq() is called and a bit is cleared from that bitmap if scsi_queue_rq() does not submit the request or after the request has finished. See also the blk_mq_{get,put}_dispatch_budget() calls in the block layer. There is no risk for a livelock since the block layer delays queue reruns if queueing a request fails because the SCSI host has been blocked. Link: https://lore.kernel.org/r/20211203231950.193369-17-bvanassche@acm.org Cc: Asutosh Das (asd) Reviewed-by: Asutosh Das Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 5675c381ea51360b4968b78f23aefda73e3de90d Author: Bart Van Assche Date: Fri Dec 3 15:19:48 2021 -0800 scsi: ufs: Stop using the clock scaling lock in the error handler Instead of locking and unlocking the clock scaling lock, surround the command queueing code with an RCU reader lock and call synchronize_rcu(). This patch prepares for removal of the clock scaling lock. Link: https://lore.kernel.org/r/20211203231950.193369-16-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Adrian Hunter Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 3489c34bd02b73a72646037d673a122a53cee174 Author: Bart Van Assche Date: Fri Dec 3 15:19:47 2021 -0800 scsi: ufs: Fix a kernel crash during shutdown Fix the following kernel crash: Unable to handle kernel paging request at virtual address ffffffc91e735000 Call trace: __queue_work+0x26c/0x624 queue_work_on+0x6c/0xf0 ufshcd_hold+0x12c/0x210 __ufshcd_wl_suspend+0xc0/0x400 ufshcd_wl_shutdown+0xb8/0xcc device_shutdown+0x184/0x224 kernel_restart+0x4c/0x124 __arm64_sys_reboot+0x194/0x264 el0_svc_common+0xc8/0x1d4 do_el0_svc+0x30/0x8c el0_svc+0x20/0x30 el0_sync_handler+0x84/0xe4 el0_sync+0x1bc/0x1c0 Fix this crash by ungating the clock before destroying the work queue on which clock gating work is queued. Link: https://lore.kernel.org/r/20211203231950.193369-15-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 1fbaa02dfd05229312404aaef8bc9317b4ff8750 Author: Bart Van Assche Date: Fri Dec 3 15:19:46 2021 -0800 scsi: ufs: Improve SCSI abort handling further Release resources when aborting a command. Make sure that aborted commands are completed once by clearing the corresponding tag bit from hba->outstanding_reqs. This patch is an improved version of commit 3ff1f6b6ba6f ("scsi: ufs: core: Improve SCSI abort handling"). Link: https://lore.kernel.org/r/20211203231950.193369-14-bvanassche@acm.org Fixes: 7a3e97b0dc4b ("[SCSI] ufshcd: UFS Host controller driver") Tested-by: Bean Huo Reviewed-by: Adrian Hunter Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 6f8dafdee6ae836763e753a9df288d10b35e9679 Author: Bart Van Assche Date: Fri Dec 3 15:19:45 2021 -0800 scsi: ufs: Introduce ufshcd_release_scsi_cmd() The only functional change in this patch is that scsi_done() is now called after ufshcd_release() and ufshcd_clk_scaling_update_busy() instead of before. The next patch in this series will introduce a call to ufshcd_release_scsi_cmd() in the abort handler. Link: https://lore.kernel.org/r/20211203231950.193369-13-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Adrian Hunter Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 3eb9dcc027e2b2bbd8f377d3ef9271b7abfe103d Author: Bart Van Assche Date: Fri Dec 3 15:19:44 2021 -0800 scsi: ufs: Remove the 'update_scaling' local variable This patch does not change any functionality but makes the next patch in this series easier to read. Link: https://lore.kernel.org/r/20211203231950.193369-12-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 511a083b8b6bf63f5609a4e4e3db748ab3719451 Author: Bart Van Assche Date: Fri Dec 3 15:19:43 2021 -0800 scsi: ufs: Remove hba->cmd_queue The previous patch removed all code that uses hba->cmd_queue. Hence also remove hba->cmd_queue itself. Link: https://lore.kernel.org/r/20211203231950.193369-11-bvanassche@acm.org Suggested-by: Adrian Hunter Tested-by: Bean Huo Reviewed-by: Adrian Hunter Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 945c3cca05d78351bba29fa65d93834cb7934c7b Author: Bart Van Assche Date: Fri Dec 3 15:19:42 2021 -0800 scsi: ufs: Fix a deadlock in the error handler The following deadlock has been observed on a test setup: - All tags allocated - The SCSI error handler calls ufshcd_eh_host_reset_handler() - ufshcd_eh_host_reset_handler() queues work that calls ufshcd_err_handler() - ufshcd_err_handler() locks up as follows: Workqueue: ufs_eh_wq_0 ufshcd_err_handler.cfi_jt Call trace: __switch_to+0x298/0x5d8 __schedule+0x6cc/0xa94 schedule+0x12c/0x298 blk_mq_get_tag+0x210/0x480 __blk_mq_alloc_request+0x1c8/0x284 blk_get_request+0x74/0x134 ufshcd_exec_dev_cmd+0x68/0x640 ufshcd_verify_dev_init+0x68/0x35c ufshcd_probe_hba+0x12c/0x1cb8 ufshcd_host_reset_and_restore+0x88/0x254 ufshcd_reset_and_restore+0xd0/0x354 ufshcd_err_handler+0x408/0xc58 process_one_work+0x24c/0x66c worker_thread+0x3e8/0xa4c kthread+0x150/0x1b4 ret_from_fork+0x10/0x30 Fix this lockup by making ufshcd_exec_dev_cmd() allocate a reserved request. Link: https://lore.kernel.org/r/20211203231950.193369-10-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Adrian Hunter Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit fc21da8a840a93fd3512e5d779cbb0996cc1b4f1 Author: Bart Van Assche Date: Fri Dec 3 15:19:41 2021 -0800 scsi: ufs: Rework ufshcd_change_queue_depth() Prepare for making sdev->host->can_queue less than hba->nutrs. This patch does not change any functionality. Link: https://lore.kernel.org/r/20211203231950.193369-9-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit bd0b35383193d0d31a0cce3d7c7f7e4be1cc7905 Author: Bart Van Assche Date: Fri Dec 3 15:19:40 2021 -0800 scsi: ufs: Remove ufshcd_any_tag_in_use() Use hba->outstanding_reqs instead of ufshcd_any_tag_in_use(). This patch prepares for removal of the blk_mq_start_request() call from ufshcd_wait_for_dev_cmd(). blk_mq_tagset_busy_iter() only iterates over started requests. Link: https://lore.kernel.org/r/20211203231950.193369-8-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 21ad0e49085deb22c094f91f9da57319a97188e4 Author: Bart Van Assche Date: Fri Dec 3 15:19:39 2021 -0800 scsi: ufs: Fix race conditions related to driver data The driver data pointer must be set before any callbacks are registered that use that pointer. Hence move the initialization of that pointer from after the ufshcd_init() call to inside ufshcd_init(). Link: https://lore.kernel.org/r/20211203231950.193369-7-bvanassche@acm.org Fixes: 3b1d05807a9a ("[SCSI] ufs: Segregate PCI Specific Code") Reported-by: Alexey Dobriyan Tested-by: Bean Huo Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit d77ea8226b3be23b0b45aa42851243b62a27bda1 Author: Bart Van Assche Date: Fri Dec 3 15:19:38 2021 -0800 scsi: ufs: Remove dead code Commit 7252a3603015 ("scsi: ufs: Avoid busy-waiting by eliminating tag conflicts") guarantees that 'tag' is not in use by any SCSI command. Remove the check that returns early if a conflict occurs. Link: https://lore.kernel.org/r/20211203231950.193369-6-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Bean Huo Acked-by: Avri Altman Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 59830c095cf01978d71a25ba1f8660f23f8312c7 Author: Bart Van Assche Date: Fri Dec 3 15:19:37 2021 -0800 scsi: ufs: Remove the sdev_rpmb member Since the sdev_rpmb member of struct ufs_hba is only used inside ufshcd_scsi_add_wlus(), convert it into a local variable. Link: https://lore.kernel.org/r/20211203231950.193369-5-bvanassche@acm.org Suggested-by: Jaegeuk Kim Tested-by: Bean Huo Reviewed-by: Asutosh Das Reviewed-by: Alim Akhtar Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit d656dc9b0b79e868e46ff78b6ca7a6a70df23566 Author: Bart Van Assche Date: Fri Dec 3 15:19:36 2021 -0800 scsi: ufs: Remove is_rpmb_wlun() Commit edc0596cc04b ("scsi: ufs: core: Stop clearing UNIT ATTENTIONS") removed all callers of is_rpmb_wlun(). Hence also remove the function itself. Link: https://lore.kernel.org/r/20211203231950.193369-4-bvanassche@acm.org Reported-by: kernel test robot Tested-by: Bean Huo Reviewed-by: Asutosh Das Reviewed-by: Alim Akhtar Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit b427609e11ee98b88e745f9fe17aae437b2e2d80 Author: Bart Van Assche Date: Fri Dec 3 15:19:35 2021 -0800 scsi: ufs: Rename a function argument The new name makes it clear what the meaning of the function argument is. Link: https://lore.kernel.org/r/20211203231950.193369-3-bvanassche@acm.org Tested-by: Bean Huo Reviewed-by: Chanho Park Reviewed-by: Keoseong Park Reviewed-by: Bean Huo Acked-by: Alim Akhtar Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 4bc3bffc1a885eb5cb259e4a25146a4c7b1034e3 Author: Bart Van Assche Date: Fri Dec 3 15:19:34 2021 -0800 scsi: core: Fix scsi_device_max_queue_depth() The comment above scsi_device_max_queue_depth() and also the description of commit ca4453213951 ("scsi: core: Make sure sdev->queue_depth is <= max(shost->can_queue, 1024)") contradict the implementation of the function scsi_device_max_queue_depth(). Additionally, the maximum queue depth of a SCSI LUN never exceeds host->can_queue. Fix scsi_device_max_queue_depth() by changing max_t() into min_t(). Link: https://lore.kernel.org/r/20211203231950.193369-2-bvanassche@acm.org Fixes: ca4453213951 ("scsi: core: Make sure sdev->queue_depth is <= max(shost->can_queue, 1024)") Cc: Hannes Reinecke Cc: Sumanesh Samanta Tested-by: Bean Huo Reviewed-by: Ming Lei Reviewed-by: Bean Huo Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit c27fd25db39b8f16aeda8563d4be6f33e59d07d1 Author: Colin Ian King Date: Sun Dec 5 22:59:01 2021 +0000 scsi: mptfusion: Remove redundant variable r Variable r is being assigned a value that is never read. The assignment is redundant and so is the variable, so remove these. Remove unnecessary the {} braces in the if statement too. Link: https://lore.kernel.org/r/20211205225901.54362-1-colin.i.king@gmail.com Signed-off-by: Colin Ian King Signed-off-by: Martin K. Petersen commit 4c3e3f8cfc05116d1adf83d95322090f335d2091 Author: Sebastian Andrzej Siewior Date: Thu Dec 2 21:11:41 2021 +0100 scsi: be2iscsi: Remove maintainers The email addresses of Subbu Seetharaman Jitendra Bhivare are no longer working. Remove Subbu and Jitendra as maintainers. Link: https://lore.kernel.org/r/20211202201141.cytqe73ish6oa356@linutronix.de Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Martin K. Petersen commit 74d80152538535e7acf3d56863876a18a218261a Author: Florian Fainelli Date: Tue Nov 30 12:38:13 2021 -0800 scsi: qla4xxx: Format SYSFS_FLAG_FW_SEL_BOOT as byte qedi formats SYSFS_FLAG_FW_SEL_BOOT as a byte and the qla4xxx driver does exactly the same thing. Align them for consistency. Link: https://lore.kernel.org/r/20211130203813.12138-3-f.fainelli@gmail.com Suggested-by: Martin K. Petersen Acked-by: Manish Rangankar Signed-off-by: Florian Fainelli Signed-off-by: Martin K. Petersen commit 9f9b7fa946beaa36681a7011a286da7cbb953816 Author: Florian Fainelli Date: Tue Nov 30 12:38:12 2021 -0800 scsi: qedi: Fix SYSFS_FLAG_FW_SEL_BOOT formatting The format used for formatting SYSFS_FLAG_FW_SEL_BOOT creates the following warning: drivers/scsi/qedi/qedi_main.c:2259:35: warning: format specifies type 'char' but the argument has type 'int' [-Wformat] rc = snprintf(buf, 3, "%hhd\n", SYSFS_FLAG_FW_SEL_BOOT); Fix this to cast the constant as a char since the intention is to print it via sysfs as a byte. Link: https://lore.kernel.org/r/20211130203813.12138-2-f.fainelli@gmail.com Reported-by: kernel test robot Acked-by: Manish Rangankar Signed-off-by: Florian Fainelli Signed-off-by: Martin K. Petersen commit 4d6942e2666efb3a415213ed12ba72b7700620f3 Author: Christophe JAILLET Date: Fri Nov 26 22:18:26 2021 +0100 scsi: hisi_sas: Use non-atomic bitmap functions when possible All uses of the 'hisi_hba->slot_index_tags' bitmap are protected with the 'hisi_hba->lock' spinlock. Prefer the non-atomic '__[set|clear]_bit()' functions to save a few cycles. Link: https://lore.kernel.org/r/8ee33e463523db080e6a2c06f332e47abb69359b.1637961191.git.christophe.jaillet@wanadoo.fr Acked-by: John Garry Signed-off-by: Christophe JAILLET Signed-off-by: Martin K. Petersen commit d43efddf6271a185d13895c5a38c889791e96bff Author: Christophe JAILLET Date: Fri Nov 26 22:18:25 2021 +0100 scsi: hisi_sas: Remove some useless code in hisi_sas_alloc() The 'hisi_hba->slot_index_tags' bitmap is allocated with bitmap_zalloc() so it is already cleared. There is no need to clear it another time, one bit at a time. Remove the corresponding useless code. Link: https://lore.kernel.org/r/41c86e7e3e05a13bd586d8ee1b81296140b7a6eb.1637961191.git.christophe.jaillet@wanadoo.fr Acked-by: John Garry Signed-off-by: Christophe JAILLET Signed-off-by: Martin K. Petersen commit 54585ec62fbdbb45d9005bba3f988a11621ef42c Author: Christophe JAILLET Date: Fri Nov 26 22:15:21 2021 +0100 scsi: hisi_sas: Use devm_bitmap_zalloc() when applicable 'hisi_hba->slot_index_tags' is a bitmap. Use 'devm_bitmap_zalloc()' to simplify code, improve the semantic, and avoid some open-coded arithmetic in allocator arguments. Link: https://lore.kernel.org/r/4afa3f71e66c941c660627c7f5b0223b51968ebb.1637961191.git.christophe.jaillet@wanadoo.fr Acked-by: John Garry Signed-off-by: Christophe JAILLET Signed-off-by: Martin K. Petersen commit 29f2e5bd9439445fe14ba8570b1c9a7ad682df84 Author: Alexei Starovoitov Date: Mon Dec 6 17:48:39 2021 -0800 bpf: Silence purge_cand_cache build warning. When CONFIG_DEBUG_INFO_BTF_MODULES is not set the following warning can be seen: kernel/bpf/btf.c:6588:13: warning: 'purge_cand_cache' defined but not used [-Wunused-function] Fix it. Fixes: 1e89106da253 ("bpf: Add bpf_core_add_cands() and wire it into bpf_core_apply_relo_insn().") Signed-off-by: Alexei Starovoitov Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211207014839.6976-1-alexei.starovoitov@gmail.com commit 1c5526968e270e4efccfa1da21d211a4915cdeda Author: Tony Lu Date: Fri Dec 3 12:33:31 2021 +0100 net/smc: Clear memory when release and reuse buffer Currently, buffers are cleared when smc connections are created and buffers are reused. This slows down the speed of establishing new connections. In most cases, the applications want to establish connections as quickly as possible. This patch moves memset() from connection creation path to release and buffer unuse path, this trades off between speed of establishing and release. Test environments: - CPU Intel Xeon Platinum 8 core, mem 32 GiB, nic Mellanox CX4 - socket sndbuf / rcvbuf: 16384 / 131072 bytes - w/o first round, 5 rounds, avg, 100 conns batch per round - smc_buf_create() use bpftrace kprobe, introduces extra latency Latency benchmarks for smc_buf_create(): w/o patch : 19040.0 ns w/ patch : 1932.6 ns ratio : 10.2% (-89.8%) Latency benchmarks for socket create and connect: w/o patch : 143.3 us w/ patch : 102.2 us ratio : 71.3% (-28.7%) The latency of establishing connections is reduced by 28.7%. Signed-off-by: Tony Lu Reviewed-by: Wen Gu Signed-off-by: Karsten Graul Link: https://lore.kernel.org/r/20211203113331.2818873-1-kgraul@linux.ibm.com Signed-off-by: Jakub Kicinski commit 364d470d547097075070c19189a31dda97b3a962 Author: Guangbin Huang Date: Sat Dec 4 09:24:48 2021 +0800 Revert "net: hns3: add void before function which don't receive ret" This reverts commit 5ac4f180bd07116c1e57858bc3f6741adbca3eb6. Sorry for taking no notice that the function devlink_register() has been already declared as void, so it is needs to revert this patch. Signed-off-by: Guangbin Huang Link: https://lore.kernel.org/r/20211204012448.51360-1-huangguangbin2@huawei.com Signed-off-by: Jakub Kicinski commit 01081be1ea8cc123c96256ff0c975643cd862609 Author: José Expósito Date: Sat Dec 4 18:13:49 2021 +0100 net: prestera: replace zero-length array with flexible-array member One-element and zero-length arrays are deprecated and should be replaced with flexible-array members: https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays Replace zero-length array with flexible-array member and make use of the struct_size() helper. Link: https://github.com/KSPP/linux/issues/78 Signed-off-by: José Expósito Reviewed-by: Volodymyr Mytnyk Tested-by: Volodymyr Mytnyk Reviewed-by: Gustavo A. R. Silva Link: https://lore.kernel.org/r/20211204171349.22776-1-jose.exposito89@gmail.com Signed-off-by: Jakub Kicinski commit 5382911f5d67a5a13815fb6958265b4a11ff7cfd Author: Arnd Bergmann Date: Sat Dec 4 18:40:25 2021 +0100 net: wwan: iosm: select CONFIG_RELAY The iosm driver started using relayfs, but is missing the Kconfig logic to ensure it's built into the kernel: x86_64-linux-ld: drivers/net/wwan/iosm/iosm_ipc_trace.o: in function `ipc_trace_create_buf_file_handler': iosm_ipc_trace.c:(.text+0x16): undefined reference to `relay_file_operations' x86_64-linux-ld: drivers/net/wwan/iosm/iosm_ipc_trace.o: in function `ipc_trace_subbuf_start_handler': iosm_ipc_trace.c:(.text+0x31): undefined reference to `relay_buf_full' x86_64-linux-ld: drivers/net/wwan/iosm/iosm_ipc_trace.o: in function `ipc_trace_ctrl_file_write': iosm_ipc_trace.c:(.text+0xd5): undefined reference to `relay_flush' x86_64-linux-ld: drivers/net/wwan/iosm/iosm_ipc_trace.o: in function `ipc_trace_port_rx': Fixes: 00ef32565b9b ("net: wwan: iosm: device trace collection using relayfs") Signed-off-by: Arnd Bergmann Acked-by: Sergey Ryazanov Reviewed-by: M Chetan Kumar Link: https://lore.kernel.org/r/20211204174033.950528-1-arnd@kernel.org Signed-off-by: Jakub Kicinski commit 45cac6754529ae17345d8f5b632d9e602a091a20 Author: Eric Dumazet Date: Fri Dec 3 20:53:56 2021 -0800 net: fix recent csum changes Vladimir reported csum issues after my recent change in skb_postpull_rcsum() Issue here is the following: initial skb->csum is the csum of [part to be pulled][rest of packet] Old code: skb->csum = csum_sub(skb->csum, csum_partial(pull, pull_length, 0)); New code: skb->csum = ~csum_partial(pull, pull_length, ~skb->csum); This is broken if the csum of [pulled part] happens to be equal to skb->csum, because end result of skb->csum is 0 in new code, instead of being 0xffffffff David Laight suggested to use skb->csum = -csum_partial(pull, pull_length, -skb->csum); I based my patches on existing code present in include/net/seg6.h, update_csum_diff4() and update_csum_diff16() which might need a similar fix. I guess that my tests, mostly pulling 40 bytes of IPv6 header were not providing enough entropy to hit this bug. v2: added wsum_negate() to make sparse happy. Fixes: 29c3002644bd ("net: optimize skb_postpull_rcsum()") Fixes: 0bd28476f636 ("gro: optimize skb_gro_postpull_rcsum()") Signed-off-by: Eric Dumazet Reported-by: Vladimir Oltean Suggested-by: David Laight Cc: David Lebrun Tested-by: Vladimir Oltean Link: https://lore.kernel.org/r/20211204045356.3659278-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit 4c375272fb0ba19288e323928d1f6937e368851f Merge: ce83278f313ce 5fa5ae605821e Author: Jakub Kicinski Date: Mon Dec 6 16:06:03 2021 -0800 Merge branch 'net-add-preliminary-netdev-refcount-tracking' Eric Dumazet says: ==================== net: add preliminary netdev refcount tracking Two first patches add a generic infrastructure, that will be used to get tracking of refcount increments/decrements. The general idea is to be able to precisely pair each decrement with a corresponding prior increment. Both share a cookie, basically a pointer to private data storing stack traces. The third patch adds dev_hold_track() and dev_put_track() helpers (CONFIG_NET_DEV_REFCNT_TRACKER) Then a series of 20 patches converts some dev_hold()/dev_put() pairs to new hepers : dev_hold_track() and dev_put_track(). Hopefully this will be used by developpers and syzbot to root cause bugs that cause netdevice dismantles freezes. With CONFIG_PCPU_DEV_REFCNT=n option, we were able to detect some class of bugs, but too late (when too many dev_put() were happening). Another series will be sent after this one is merged. v3: moved NET_DEV_REFCNT_TRACKER to net/Kconfig.debug added "depends on DEBUG_KERNEL && STACKTRACE_SUPPORT" to hopefully get rid of kbuild reports for ARCH=nios2 Reworded patch 3 changelog. Added missing htmldocs (Jakub) v2: added four additional patches, added netdev_tracker_alloc() and netdev_tracker_free() addressed build error (kernel bots), use GFP_ATOMIC in test_ref_tracker_timer_func() ==================== Link: https://lore.kernel.org/r/20211205042217.982127-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit 5fa5ae605821e0e10ee489d9a6e331fd287ccc57 Author: Eric Dumazet Date: Sat Dec 4 20:22:17 2021 -0800 netpoll: add net device refcount tracker to struct netpoll Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 42120a86438379eb77424831ae3d696c2d5cb622 Author: Eric Dumazet Date: Sat Dec 4 20:22:16 2021 -0800 ipmr, ip6mr: add net device refcount tracker to struct vif_device Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 095e200f175f9843642343a4a48087fcfa4d3751 Author: Eric Dumazet Date: Sat Dec 4 20:22:15 2021 -0800 net: failover: add net device refcount tracker Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 63f13937cbe9b00982dfc8e578b1aec8e5037333 Author: Eric Dumazet Date: Sat Dec 4 20:22:14 2021 -0800 net: linkwatch: add net device refcount tracker Add a netdevice_tracker inside struct net_device, to track the self reference when a device is in lweventlist. Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 606509f27f67748b92f783a75a6e39cfaa2fe92d Author: Eric Dumazet Date: Sat Dec 4 20:22:13 2021 -0800 net/sched: add net device refcount tracker to struct Qdisc Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit c04438f58d140723e58050fcb9d33d84cb39e9e9 Author: Eric Dumazet Date: Sat Dec 4 20:22:12 2021 -0800 ipv4: add net device refcount tracker to struct in_device Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 8c727003c4d0c776bd286d65c347591734d1d841 Author: Eric Dumazet Date: Sat Dec 4 20:22:11 2021 -0800 ipv6: add net device refcount tracker to struct inet6_dev Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit f77159a348f2d6078af7fe4933a60229d7c7aae2 Author: Eric Dumazet Date: Sat Dec 4 20:22:10 2021 -0800 net: add net device refcount tracker to struct netdev_adjacent Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 08d622568e5a58adebc8cb801599d3f181a6b687 Author: Eric Dumazet Date: Sat Dec 4 20:22:09 2021 -0800 net: add net device refcount tracker to struct neigh_parms Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 77a23b1f954381d7999ce069d3fc8658eb6a9bbc Author: Eric Dumazet Date: Sat Dec 4 20:22:08 2021 -0800 net: add net device refcount tracker to struct pneigh_entry Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 85662c9f8cbd4c96088ff99f56bc3d1097d0ac07 Author: Eric Dumazet Date: Sat Dec 4 20:22:07 2021 -0800 net: add net device refcount tracker to struct neighbour Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 56c1c77948ba3576df1c387cefcf3bab93600822 Author: Eric Dumazet Date: Sat Dec 4 20:22:06 2021 -0800 ipv6: add net device refcount tracker to struct ip6_tnl Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit c0fd407a0666a583a765cfb129c4dc492590ca89 Author: Eric Dumazet Date: Sat Dec 4 20:22:05 2021 -0800 sit: add net device refcount tracking to ip_tunnel Note that other ip_tunnel users do not seem to hold a reference on tunnel->dev. Probably needs some investigations. Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit fb67510ba9bd3ed1f8a2db4946e847ca0418f8dc Author: Eric Dumazet Date: Sat Dec 4 20:22:04 2021 -0800 ipv6: add net device refcount tracker to rt6_probe_deferred() Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 9038c320001dd07f60736018edf608ac5baca0ab Author: Eric Dumazet Date: Sat Dec 4 20:22:03 2021 -0800 net: dst: add net device refcount tracking to dst_entry We want to track all dev_hold()/dev_put() to ease leak hunting. Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 4dbd24f65c60259ce5d1563433ecaf5fab693c83 Author: Eric Dumazet Date: Sat Dec 4 20:22:02 2021 -0800 drop_monitor: add net device refcount tracker We want to track all dev_hold()/dev_put() to ease leak hunting. Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 14ed029b5eb5146794a46d89e114715c9d380ca1 Author: Eric Dumazet Date: Sat Dec 4 20:22:01 2021 -0800 net: add net device refcount tracker to dev_ifsioc() Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 5ae2195088d06adfd20eab98ecc9db80ef2eb6b2 Author: Eric Dumazet Date: Sat Dec 4 20:22:00 2021 -0800 net: add net device refcount tracker to ethtool_phys_id() This helper might hold a netdev reference for a long time, lets add reference tracking. Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 0b688f24b7d611db3a02f3d4ab562d049c78a17d Author: Eric Dumazet Date: Sat Dec 4 20:21:59 2021 -0800 net: add net device refcount tracker to struct netdev_queue This will help debugging pesky netdev reference leaks. Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 80e8921b2b72c300ca56a01729004d30bedb82cd Author: Eric Dumazet Date: Sat Dec 4 20:21:58 2021 -0800 net: add net device refcount tracker to struct netdev_rx_queue This helps debugging net device refcount leaks. Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 4d92b95ff2f95f13df9bad0b5a25a9f60e72758d Author: Eric Dumazet Date: Sat Dec 4 20:21:57 2021 -0800 net: add net device refcount tracker infrastructure net device are refcounted. Over the years we had numerous bugs caused by imbalanced dev_hold() and dev_put() calls. The general idea is to be able to precisely pair each decrement with a corresponding prior increment. Both share a cookie, basically a pointer to private data storing stack traces. This patch adds dev_hold_track() and dev_put_track(). To use these helpers, each data structure owning a refcount should also use a "netdevice_tracker" to pair the hold and put. netdevice_tracker dev_tracker; ... dev_hold_track(dev, &dev_tracker, GFP_ATOMIC); ... dev_put_track(dev, &dev_tracker); Whenever a leak happens, we will get precise stack traces of the point dev_hold_track() happened, at device dismantle phase. We will also get a stack trace if too many dev_put_track() for the same netdevice_tracker are attempted. This is guarded by CONFIG_NET_DEV_REFCNT_TRACKER option. Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 914a7b5000d08f1487e0efa52f27c4b7ea75b893 Author: Eric Dumazet Date: Sat Dec 4 20:21:56 2021 -0800 lib: add tests for reference tracker This module uses reference tracker, forcing two issues. 1) Double free of a tracker 2) leak of two trackers, one being allocated from softirq context. "modprobe test_ref_tracker" would emit the following traces. (Use scripts/decode_stacktrace.sh if necessary) [ 171.648681] reference already released. [ 171.653213] allocated in: [ 171.656523] alloctest_ref_tracker_alloc2+0x1c/0x20 [test_ref_tracker] [ 171.656526] init_module+0x86/0x1000 [test_ref_tracker] [ 171.656528] do_one_initcall+0x9c/0x220 [ 171.656532] do_init_module+0x60/0x240 [ 171.656536] load_module+0x32b5/0x3610 [ 171.656538] __do_sys_init_module+0x148/0x1a0 [ 171.656540] __x64_sys_init_module+0x1d/0x20 [ 171.656542] do_syscall_64+0x4a/0xb0 [ 171.656546] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 171.656549] freed in: [ 171.659520] alloctest_ref_tracker_free+0x13/0x20 [test_ref_tracker] [ 171.659522] init_module+0xec/0x1000 [test_ref_tracker] [ 171.659523] do_one_initcall+0x9c/0x220 [ 171.659525] do_init_module+0x60/0x240 [ 171.659527] load_module+0x32b5/0x3610 [ 171.659529] __do_sys_init_module+0x148/0x1a0 [ 171.659532] __x64_sys_init_module+0x1d/0x20 [ 171.659534] do_syscall_64+0x4a/0xb0 [ 171.659536] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 171.659575] ------------[ cut here ]------------ [ 171.659576] WARNING: CPU: 5 PID: 13016 at lib/ref_tracker.c:112 ref_tracker_free+0x224/0x270 [ 171.659581] Modules linked in: test_ref_tracker(+) [ 171.659591] CPU: 5 PID: 13016 Comm: modprobe Tainted: G S 5.16.0-smp-DEV #290 [ 171.659595] RIP: 0010:ref_tracker_free+0x224/0x270 [ 171.659599] Code: 5e 41 5f 5d c3 48 c7 c7 04 9c 74 a6 31 c0 e8 62 ee 67 00 83 7b 14 00 75 1a 83 7b 18 00 75 30 4c 89 ff 4c 89 f6 e8 9c 00 69 00 <0f> 0b bb ea ff ff ff eb ae 48 c7 c7 3a 0a 77 a6 31 c0 e8 34 ee 67 [ 171.659601] RSP: 0018:ffff89058ba0bbd0 EFLAGS: 00010286 [ 171.659603] RAX: 0000000000000029 RBX: ffff890586b19780 RCX: 08895bff57c7d100 [ 171.659604] RDX: c0000000ffff7fff RSI: 0000000000000282 RDI: ffffffffc0407000 [ 171.659606] RBP: ffff89058ba0bc88 R08: 0000000000000000 R09: ffffffffa6f342e0 [ 171.659607] R10: 00000000ffff7fff R11: 0000000000000000 R12: 000000008f000000 [ 171.659608] R13: 0000000000000014 R14: 0000000000000282 R15: ffffffffc0407000 [ 171.659609] FS: 00007f97ea29d740(0000) GS:ffff8923ff940000(0000) knlGS:0000000000000000 [ 171.659611] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 171.659613] CR2: 00007f97ea299000 CR3: 0000000186b4a004 CR4: 00000000001706e0 [ 171.659614] Call Trace: [ 171.659615] [ 171.659631] ? alloctest_ref_tracker_free+0x13/0x20 [test_ref_tracker] [ 171.659633] ? init_module+0x105/0x1000 [test_ref_tracker] [ 171.659636] ? do_one_initcall+0x9c/0x220 [ 171.659638] ? do_init_module+0x60/0x240 [ 171.659641] ? load_module+0x32b5/0x3610 [ 171.659644] ? __do_sys_init_module+0x148/0x1a0 [ 171.659646] ? __x64_sys_init_module+0x1d/0x20 [ 171.659649] ? do_syscall_64+0x4a/0xb0 [ 171.659652] ? entry_SYSCALL_64_after_hwframe+0x44/0xae [ 171.659656] ? 0xffffffffc040a000 [ 171.659658] alloctest_ref_tracker_free+0x13/0x20 [test_ref_tracker] [ 171.659660] init_module+0x105/0x1000 [test_ref_tracker] [ 171.659663] do_one_initcall+0x9c/0x220 [ 171.659666] do_init_module+0x60/0x240 [ 171.659669] load_module+0x32b5/0x3610 [ 171.659672] __do_sys_init_module+0x148/0x1a0 [ 171.659676] __x64_sys_init_module+0x1d/0x20 [ 171.659678] do_syscall_64+0x4a/0xb0 [ 171.659694] ? exc_page_fault+0x6e/0x140 [ 171.659696] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 171.659698] RIP: 0033:0x7f97ea3dbe7a [ 171.659700] Code: 48 8b 0d 61 8d 06 00 f7 d8 64 89 01 48 83 c8 ff c3 cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc 49 89 ca b8 af 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 2e 8d 06 00 f7 d8 64 89 01 48 [ 171.659701] RSP: 002b:00007ffea67ce608 EFLAGS: 00000246 ORIG_RAX: 00000000000000af [ 171.659703] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f97ea3dbe7a [ 171.659704] RDX: 00000000013a0ba0 RSI: 0000000000002808 RDI: 00007f97ea299000 [ 171.659705] RBP: 00007ffea67ce670 R08: 0000000000000003 R09: 0000000000000000 [ 171.659706] R10: 0000000000000000 R11: 0000000000000246 R12: 00000000013a1048 [ 171.659707] R13: 00000000013a0ba0 R14: 0000000001399930 R15: 00000000013a1030 [ 171.659709] [ 171.659710] ---[ end trace f5dbd6afa41e60a9 ]--- [ 171.659712] leaked reference. [ 171.663393] alloctest_ref_tracker_alloc0+0x1c/0x20 [test_ref_tracker] [ 171.663395] test_ref_tracker_timer_func+0x9/0x20 [test_ref_tracker] [ 171.663397] call_timer_fn+0x31/0x140 [ 171.663401] expire_timers+0x46/0x110 [ 171.663403] __run_timers+0x16f/0x1b0 [ 171.663404] run_timer_softirq+0x1d/0x40 [ 171.663406] __do_softirq+0x148/0x2d3 [ 171.663408] leaked reference. [ 171.667101] alloctest_ref_tracker_alloc1+0x1c/0x20 [test_ref_tracker] [ 171.667103] init_module+0x81/0x1000 [test_ref_tracker] [ 171.667104] do_one_initcall+0x9c/0x220 [ 171.667106] do_init_module+0x60/0x240 [ 171.667108] load_module+0x32b5/0x3610 [ 171.667111] __do_sys_init_module+0x148/0x1a0 [ 171.667113] __x64_sys_init_module+0x1d/0x20 [ 171.667115] do_syscall_64+0x4a/0xb0 [ 171.667117] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 171.667131] ------------[ cut here ]------------ [ 171.667132] WARNING: CPU: 5 PID: 13016 at lib/ref_tracker.c:30 ref_tracker_dir_exit+0x104/0x130 [ 171.667136] Modules linked in: test_ref_tracker(+) [ 171.667144] CPU: 5 PID: 13016 Comm: modprobe Tainted: G S W 5.16.0-smp-DEV #290 [ 171.667147] RIP: 0010:ref_tracker_dir_exit+0x104/0x130 [ 171.667150] Code: 01 00 00 00 00 ad de 48 89 03 4c 89 63 08 48 89 df e8 20 a0 d5 ff 4c 89 f3 4d 39 ee 75 a8 4c 89 ff 48 8b 75 d0 e8 7c 05 69 00 <0f> 0b eb 0c 4c 89 ff 48 8b 75 d0 e8 6c 05 69 00 41 8b 47 08 83 f8 [ 171.667151] RSP: 0018:ffff89058ba0bc68 EFLAGS: 00010286 [ 171.667154] RAX: 08895bff57c7d100 RBX: ffffffffc0407010 RCX: 000000000000003b [ 171.667156] RDX: 000000000000003c RSI: 0000000000000282 RDI: ffffffffc0407000 [ 171.667157] RBP: ffff89058ba0bc98 R08: 0000000000000000 R09: ffffffffa6f342e0 [ 171.667159] R10: 00000000ffff7fff R11: 0000000000000000 R12: dead000000000122 [ 171.667160] R13: ffffffffc0407010 R14: ffffffffc0407010 R15: ffffffffc0407000 [ 171.667162] FS: 00007f97ea29d740(0000) GS:ffff8923ff940000(0000) knlGS:0000000000000000 [ 171.667164] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 171.667166] CR2: 00007f97ea299000 CR3: 0000000186b4a004 CR4: 00000000001706e0 [ 171.667169] Call Trace: [ 171.667170] [ 171.667171] ? 0xffffffffc040a000 [ 171.667173] init_module+0x126/0x1000 [test_ref_tracker] [ 171.667175] do_one_initcall+0x9c/0x220 [ 171.667179] do_init_module+0x60/0x240 [ 171.667182] load_module+0x32b5/0x3610 [ 171.667186] __do_sys_init_module+0x148/0x1a0 [ 171.667189] __x64_sys_init_module+0x1d/0x20 [ 171.667192] do_syscall_64+0x4a/0xb0 [ 171.667194] ? exc_page_fault+0x6e/0x140 [ 171.667196] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 171.667199] RIP: 0033:0x7f97ea3dbe7a [ 171.667200] Code: 48 8b 0d 61 8d 06 00 f7 d8 64 89 01 48 83 c8 ff c3 cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc 49 89 ca b8 af 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 2e 8d 06 00 f7 d8 64 89 01 48 [ 171.667201] RSP: 002b:00007ffea67ce608 EFLAGS: 00000246 ORIG_RAX: 00000000000000af [ 171.667203] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f97ea3dbe7a [ 171.667204] RDX: 00000000013a0ba0 RSI: 0000000000002808 RDI: 00007f97ea299000 [ 171.667205] RBP: 00007ffea67ce670 R08: 0000000000000003 R09: 0000000000000000 [ 171.667206] R10: 0000000000000000 R11: 0000000000000246 R12: 00000000013a1048 [ 171.667207] R13: 00000000013a0ba0 R14: 0000000001399930 R15: 00000000013a1030 [ 171.667209] [ 171.667210] ---[ end trace f5dbd6afa41e60aa ]--- Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 4e66934eaadc83b27ada8d42b60894018f3bfabf Author: Eric Dumazet Date: Sat Dec 4 20:21:55 2021 -0800 lib: add reference counting tracking infrastructure It can be hard to track where references are taken and released. In networking, we have annoying issues at device or netns dismantles, and we had various proposals to ease root causing them. This patch adds new infrastructure pairing refcount increases and decreases. This will self document code, because programmers will have to associate increments/decrements. This is controled by CONFIG_REF_TRACKER which can be selected by users of this feature. This adds both cpu and memory costs, and thus should probably be used with care. Signed-off-by: Eric Dumazet Reviewed-by: Dmitry Vyukov Signed-off-by: Jakub Kicinski commit 0a0575a12e31657415d1d5f799d4b65f3c9e8ba4 Author: Kamal Heib Date: Sun Dec 5 22:45:37 2021 +0200 RDMA/bnxt_re: Fix endianness warning for req.pkey Fix the following sparse warning: drivers/infiniband/hw/bnxt_re/qplib_fp.c:1260:26: sparse: warning: incorrect type in assignment (different base types) Fixes: 0e938533d96d ("RDMA/bnxt_re: Remove dynamic pkey table") Link: https://lore.kernel.org/r/20211205204537.14184-1-kamalheib1@gmail.com Reported-by: kernel test robot Signed-off-by: Kamal Heib Reviewed-by: Leon Romanovsky Acked-by: Selvin Xavier Signed-off-by: Jason Gunthorpe commit b6fa6f229f7364782799e5105d8d353e389033e4 Author: Christophe JAILLET Date: Sat Dec 4 20:51:34 2021 +0100 RDMA/irdma: Fix the type used to declare a bitmap 'bitmapbuf' is really used as a bitmap, so it should be defined as a 'unsigned long *' to be more consistent with the bitmap API. Link: https://lore.kernel.org/r/574b773fe7ced0cc87f1e1832350b38374815bd4.1638647428.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET Signed-off-by: Jason Gunthorpe commit 1eb23d04320a0b538fb5613fad10334214a0aa2b Author: Colin Ian King Date: Sat Dec 4 23:49:04 2021 +0000 IB/core: Remove redundant pointer mm The pointer mm is assigned a value but it is never used. The pointer is redundant and can be removed. Link: https://lore.kernel.org/r/20211204234904.105026-1-colin.i.king@gmail.com Signed-off-by: Colin Ian King Signed-off-by: Jason Gunthorpe commit 9692407d4334738e1fe7c59800ca24e0ca93f002 Author: Zhu Yanjun Date: Tue Dec 7 01:46:07 2021 -0500 RDMA/uverbs: Remove the unnecessary assignment The struct member variable create_flags is assigned twice. Remove the unnecessary assignment. Fixes: ece9ca97ccdc ("RDMA/uverbs: Do not check the input length on create_cq/qp paths") Link: https://lore.kernel.org/r/20211207064607.541695-1-yanjun.zhu@linux.dev Signed-off-by: Zhu Yanjun Reviewed-by: Håkon Bugge Signed-off-by: Jason Gunthorpe commit 39d5534b1302189c809e90641ffae8cbdc42a8fc Author: Yixing Liu Date: Mon Dec 6 21:36:52 2021 +0800 RDMA/hns: Modify the mapping attribute of doorbell to device It is more general for ARM device drivers to use the device attribute to map PCI BAR spaces. Fixes: 9a4435375cd1 ("IB/hns: Add driver files for hns RoCE driver") Link: https://lore.kernel.org/r/20211206133652.27476-1-liangwenpeng@huawei.com Signed-off-by: Yixing Liu Signed-off-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe commit 76937fa552008405d7dd43143545794542623108 Author: Jiapeng Chong Date: Thu Dec 2 18:07:59 2021 +0800 RDMA/siw: Use max() instead of doing it manually Fix following coccicheck warning: ./drivers/infiniband/sw/siw/siw_verbs.c:665:28-29: WARNING opportunity for max(). Link: https://lore.kernel.org/r/1638439679-114250-1-git-send-email-jiapeng.chong@linux.alibaba.com Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Reviewed-by: Bernard Metzler Signed-off-by: Jason Gunthorpe commit a6ed2aee54644cfa2d04ca86308767f5c3a087e8 Author: Uladzislau Rezki (Sony) Date: Wed Nov 24 12:03:08 2021 +0100 tracing: Switch to kvfree_rcu() API Instead of invoking a synchronize_rcu() to free a pointer after a grace period we can directly make use of new API that does the same but in more efficient way. Link: https://lkml.kernel.org/r/20211124110308.2053-10-urezki@gmail.com Signed-off-by: Uladzislau Rezki (Sony) Signed-off-by: Steven Rostedt (VMware) commit 1d83c3a20b0c5708b51c16a021ab76305dbb9943 Author: Qiujun Huang Date: Sun May 16 02:24:10 2021 +0000 tracing: Fix synth_event_add_val() kernel-doc comment It's named field here. Link: https://lkml.kernel.org/r/20210516022410.64271-1-hqjagain@gmail.com Signed-off-by: Qiujun Huang Signed-off-by: Steven Rostedt (VMware) commit b7d5eb267f8c234d6eda40e21c0105a1f6231d14 Author: Steven Rostedt (VMware) Date: Mon Dec 6 16:24:40 2021 -0500 tracing/uprobes: Use trace_event_buffer_reserve() helper To be consistent with kprobes and eprobes, use trace_event_buffer_reserver() and trace_event_buffer_commit(). This will ensure that any updates to trace events will also be implemented on uprobe events. Link: https://lkml.kernel.org/r/20211206162440.69fbf96c@gandalf.local.home Acked-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 67ac01d03862b274d4ca3fa76092e96b00f478af Author: Andrei Kartashev Date: Fri Nov 19 15:00:57 2021 +0300 ARM: dts: aspeed: add device tree for YADRO VEGMAN BMC YADRO VEGMAN is x86 based servers family with ASPEED AST2500-based BMC. Currently there are three models: * VEGMAN N110 * VEGMAN S220/320 * VEGMAN R120/220 The dts files provides configuration for BMC system. Signed-off-by: Andrei Kartashev Link: https://lore.kernel.org/r/20211119120057.12118-3-a.kartashev@yadro.com Reviewed-by: Joel Stanley Signed-off-by: Joel Stanley commit 1bf6751c8d8e2989b7b8611080b3b3b1bc0b83f4 Author: Andrei Kartashev Date: Fri Nov 19 15:00:56 2021 +0300 dt-bindings: vendor-prefixes: add YADRO Add vendor prefix for YADRO (https://www.yadro.com/) Signed-off-by: Andrei Kartashev Acked-by: Rob Herring Link: https://lore.kernel.org/r/20211119120057.12118-2-a.kartashev@yadro.com Signed-off-by: Joel Stanley commit d5284dedccdb9053988278dd30c834d46b8c866d Author: Grant Seltzer Date: Mon Dec 6 15:37:09 2021 -0500 libbpf: Add doc comments in libbpf.h This adds comments above functions in libbpf.h which document their uses. These comments are of a format that doxygen and sphinx can pick up and render. These are rendered by libbpf.readthedocs.org These doc comments are for: - bpf_object__open_file() - bpf_object__open_mem() - bpf_program__attach_uprobe() - bpf_program__attach_uprobe_opts() Signed-off-by: Grant Seltzer Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211206203709.332530-1-grantseltzer@gmail.com commit 8c33915d77a565b8b5d44e6368e22b6ea300b7a8 Author: Hans de Goede Date: Sun Nov 28 20:00:29 2021 +0100 platform/x86: wmi: Add no_notify_data flag to struct wmi_driver Some WMI implementations do notifies on WMI objects without a _WED method allow WMI drivers to indicate that _WED should not be called for notifies on the WMI objects the driver is bound to. Instead the driver's notify callback will simply be called with a NULL data argument. Reported-by: Yauhen Kharuzhy Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211128190031.405620-3-hdegoede@redhat.com commit 9918878676a5f9e99b98679f04b9e6c0f5426b0a Author: Hans de Goede Date: Sun Nov 28 20:00:28 2021 +0100 platform/x86: wmi: Fix driver->notify() vs ->probe() race The driver core sets struct device->driver before calling out to the bus' probe() method, this leaves a window where an ACPI notify may happen on the WMI object before the driver's probe() method has completed running, causing e.g. the driver's notify() callback to get called with drvdata not yet being set leading to a NULL pointer deref. At a check for this to the WMI core, ensuring that the notify() callback is not called before the driver is ready. Fixes: 1686f5444546 ("platform/x86: wmi: Incorporate acpi_install_notify_handler") Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211128190031.405620-2-hdegoede@redhat.com commit a90b38c58667142ecff2521481ed44286d46b140 Author: Hans de Goede Date: Sun Nov 28 20:00:27 2021 +0100 platform/x86: wmi: Replace read_takes_no_args with a flags field Replace the wmi_block.read_takes_no_args bool field with an unsigned long flags field, used together with test_bit() and friends. This is a preparation patch for fixing a driver->notify() vs ->probe() race, which requires atomic flag handling. Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211128190031.405620-1-hdegoede@redhat.com commit 01e16cb67cce68afaeb9c7bed72299036dbb0bc1 Author: Alex Hung Date: Fri Dec 3 14:28:10 2021 -0700 platform/x86/intel: hid: add quirk to support Surface Go 3 Similar to other systems Surface Go 3 requires a DMI quirk to enable 5 button array for power and volume buttons. Buglink: https://github.com/linux-surface/linux-surface/issues/595 Cc: stable@vger.kernel.org Signed-off-by: Alex Hung Link: https://lore.kernel.org/r/20211203212810.2666508-1-alex.hung@canonical.com Signed-off-by: Hans de Goede commit 222c98c7979084fbefb4ce2ae377210c6e42011e Author: huangxuesen Date: Mon Dec 6 09:47:16 2021 +0800 libbpf: Fix trivial typo Fix typo in comment from 'bpf_skeleton_map' to 'bpf_map_skeleton' and from 'bpf_skeleton_prog' to 'bpf_prog_skeleton'. Signed-off-by: huangxuesen Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/1638755236-3851199-1-git-send-email-hxseverything@gmail.com commit 5e6cd84e2f8bd3619b5d8f3dd4b44c0086a6ce1d Author: Steven Rostedt (VMware) Date: Mon Nov 29 21:39:49 2021 -0500 tracing/kprobes: Do not open code event reserve logic As kprobe events use trace_event_buffer_commit() to commit the event to the ftrace ring buffer, for consistency, it should use trace_event_buffer_reserve() to allocate it, as the two functions are related. Link: https://lkml.kernel.org/r/20211130024319.257430762@goodmis.org Acked-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 3e8b1a29a0e8d300466cf2a23d2f6d41971c5a0c Author: Steven Rostedt (VMware) Date: Mon Nov 29 21:39:48 2021 -0500 tracing: Have eprobes use filtering logic of trace events The eprobes open code the reserving of the event on the ring buffer for ftrace instead of using the ftrace event wrappers, which means that it doesn't get affected by the filters, breaking the filtering logic on user space. Link: https://lkml.kernel.org/r/20211130024319.068451680@goodmis.org Signed-off-by: Steven Rostedt (VMware) commit 6c536d76cfe63b79e9e468ef0876315420a19074 Author: Steven Rostedt (VMware) Date: Mon Nov 29 21:39:47 2021 -0500 tracing: Disable preemption when using the filter buffer In case trace_event_buffer_lock_reserve() is called with preemption enabled, the algorithm that defines the usage of the per cpu filter buffer may fail if the task schedules to another CPU after determining which buffer it will use. Disable preemption when using the filter buffer. And because that same buffer must be used throughout the call, keep preemption disabled until the filter buffer is released. This will also keep the semantics between the use case of when the filter buffer is used, and when the ring buffer itself is used, as that case also disables preemption until the ring buffer is released. Link: https://lkml.kernel.org/r/20211130024318.880190623@goodmis.org [ Fixed warning of assignment in if statement Reported-by: kernel test robot ] Signed-off-by: Steven Rostedt (VMware) commit e07a1d576239cf836070e740d4bd7c5e8a64868f Author: Steven Rostedt (VMware) Date: Mon Nov 29 21:39:46 2021 -0500 tracing: Use __this_cpu_read() in trace_event_buffer_lock_reserver() The value read by this_cpu_read() is used later and its use is expected to stay on the same CPU as being read. But this_cpu_read() does not warn if it is called without preemption disabled, where as __this_cpu_read() will check if preemption is disabled on CONFIG_DEBUG_PREEMPT Currently all callers have preemption disabled, but there may be new callers in the future that may not. Link: https://lkml.kernel.org/r/20211130024318.698165354@goodmis.org Signed-off-by: Steven Rostedt (VMware) commit 7c689c839734a23eda855e69a56ed4795533bf71 Author: Masami Hiramatsu Date: Mon Nov 22 18:30:48 2021 +0900 tools/perf: Add '__rel_loc' event field parsing support Add new '__rel_loc' dynamic data location attribute support. This type attribute is similar to the '__data_loc' but records the offset from the field itself. The libtraceevent adds TEP_FIELD_IS_RELATIVE to the 'tep_format_field::flags' with TEP_FIELD_IS_DYNAMIC for'__rel_loc'. Link: https://lkml.kernel.org/r/163757344810.510314.12449413842136229871.stgit@devnote2 Cc: Beau Belgrave Cc: Namhyung Kim Cc: Tom Zanussi Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit cd7729043b31b32b34daaa6775e255b76de7f976 Author: Masami Hiramatsu Date: Mon Nov 22 18:30:40 2021 +0900 libtraceevent: Add __rel_loc relative location attribute support Add '__rel_loc' new dynamic data location attribute which encodes the data location from the next to the field itself. This is similar to the '__data_loc' but the location offset is not from the event entry but from the next of the field. This patch adds '__rel_loc' decoding support in the libtraceevent. Link: https://lkml.kernel.org/r/163757343994.510314.13241077597729303802.stgit@devnote2 Cc: Beau Belgrave Cc: Namhyung Kim Cc: Tom Zanussi Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit b466b13321648d3bd7bfceb9afcba5302b585cf8 Author: Masami Hiramatsu Date: Mon Nov 22 18:30:30 2021 +0900 samples/trace_event: Add '__rel_loc' using sample event Add '__rel_loc' using sample event for testing. User can use this for testing purpose. There is no reason to use this macro from the kernel. Link: https://lkml.kernel.org/r/163757343050.510314.2876529802471645178.stgit@devnote2 Cc: Beau Belgrave Cc: Namhyung Kim Cc: Tom Zanussi Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 55de2c0b5610cba5a5a93c0788031133c457e689 Author: Masami Hiramatsu Date: Mon Nov 22 18:30:21 2021 +0900 tracing: Add '__rel_loc' using trace event macros Add '__rel_loc' using trace event macros. These macros are usually not used in the kernel, except for testing purpose. This also add "rel_" variant of macros for dynamic_array string, and bitmask. Link: https://lkml.kernel.org/r/163757342119.510314.816029622439099016.stgit@devnote2 Cc: Beau Belgrave Cc: Namhyung Kim Cc: Tom Zanussi Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit 05770dd0ad110854c7157d95700d7c89979cdb3e Author: Masami Hiramatsu Date: Mon Nov 22 18:30:12 2021 +0900 tracing: Support __rel_loc relative dynamic data location attribute Add '__rel_loc' new dynamic data location attribute which encodes the data location from the next to the field itself. The '__data_loc' is used for encoding the dynamic data location on the trace event record. But '__data_loc' is not useful if the writer doesn't know the event header (e.g. user event), because it records the dynamic data offset from the entry of the record, not the field itself. This new '__rel_loc' attribute encodes the data location relatively from the next of the field. For example, when there is a record like below (the number in the parentheses is the size of fields) |header(N)|common(M)|fields(K)|__data_loc(4)|fields(L)|data(G)| In this case, '__data_loc' field will be __data_loc = (G << 16) | (N+M+K+4+L) If '__rel_loc' is used, this will be |header(N)|common(M)|fields(K)|__rel_loc(4)|fields(L)|data(G)| where __rel_loc = (G << 16) | (L) This case shows L bytes after the '__rel_loc' attribute field, if there is no fields after the __rel_loc field, L must be 0. This is relatively easy (and no need to consider the kernel header change) when the event data fields are composed by user who doesn't know header and common fields. Link: https://lkml.kernel.org/r/163757341258.510314.4214431827833229956.stgit@devnote2 Cc: Beau Belgrave Cc: Namhyung Kim Cc: Tom Zanussi Signed-off-by: Masami Hiramatsu Signed-off-by: Steven Rostedt (VMware) commit f2b20c66274dafd57f1a9221aae84640319685a4 Author: Colin Ian King Date: Mon Nov 8 20:15:13 2021 +0000 tracing: Fix spelling mistake "aritmethic" -> "arithmetic" There is a spelling mistake in the tracing mini-HOWTO text. Fix it. Link: https://lkml.kernel.org/r/20211108201513.42876-1-colin.i.king@gmail.com Signed-off-by: Colin Ian King Signed-off-by: Steven Rostedt (VMware) commit a3ebdcc8fb3d94de390e58ad3da6161826a58a87 Author: Thierry Reding Date: Mon Dec 6 15:48:01 2021 +0100 dt-bindings: Use correct vendor prefix for Asahi Kasei Corp. The old "ak" vendor prefix that was never officially accepted was still being used in some examples. Convert to the correct vendor prefix (i.e. "asahi-kasei"). Signed-off-by: Thierry Reding Link: https://lore.kernel.org/r/20211206144802.217073-1-thierry.reding@gmail.com Signed-off-by: Rob Herring commit 4b7c49f7d4986f700a58164ee086bb7b2d292eea Author: Sam Protsenko Date: Fri Dec 3 20:35:17 2021 +0200 dt-bindings: Only show unique unit address warning for enabled nodes There are valid cases when two nodes can have the same address. For example, in Exynos SoCs there is USI IP-core, which might be configured to provide UART, SPI or I2C block, all of which having the same base register address. But only one can be enabled at a time. That looks like this: usi@138200c0 { serial@13820000 { status = "okay"; }; i2c@13820000 { status = "disabled"; }; }; When running "make dt_binding_check", it reports next warning: Warning (unique_unit_address): /example-0/usi@138200c0/serial@13820000: duplicate unit-address (also used in node /example-0/usi@138200c0/i2c@13820000) Disable "unique_unit_address" in DTC_FLAGS to suppress warnings like that, but enable "unique_unit_address_if_enabled" warning, so that dtc still reports a warning when two enabled nodes are having the same address. Signed-off-by: Sam Protsenko Reported-by: Rob Herring Suggested-by: Rob Herring Link: https://lore.kernel.org/r/20211203183517.11390-1-semen.protsenko@linaro.org Signed-off-by: Rob Herring commit fea9f92f1748083cb82049ed503be30c3d3a9b69 Author: John Garry Date: Mon Dec 6 20:49:50 2021 +0800 blk-mq: Optimise blk_mq_queue_tag_busy_iter() for shared tags Kashyap reports high CPU usage in blk_mq_queue_tag_busy_iter() and callees using megaraid SAS RAID card since moving to shared tags [0]. Previously, when shared tags was shared sbitmap, this function was less than optimum since we would iter through all tags for all hctx's, yet only ever match upto tagset depth number of rqs. Since the change to shared tags, things are even less efficient if we have parallel callers of blk_mq_queue_tag_busy_iter(). This is because in bt_iter() -> blk_mq_find_and_get_req() there would be more contention on accessing each request ref and tags->lock since they are now shared among all HW queues. Optimise by having separate calls to bt_for_each() for when we're using shared tags. In this case no longer pass a hctx, as it is no longer relevant, and teach bt_iter() about this. Ming suggested something along the lines of this change, apart from a different implementation. [0] https://lore.kernel.org/linux-block/e4e92abbe9d52bcba6b8cc6c91c442cc@mail.gmail.com/ Signed-off-by: John Garry Reviewed-by: Hannes Reinecke Reviewed-by: Ming Lei Reported-and-tested-by: Kashyap Desai Fixes: e155b0c238b2 ("blk-mq: Use shared tags for shared sbitmap support") Link: https://lore.kernel.org/r/1638794990-137490-4-git-send-email-john.garry@huawei.com Signed-off-by: Jens Axboe commit fc39f8d2d1c10ac04976b0a247865bb0cec4dd88 Author: John Garry Date: Mon Dec 6 20:49:49 2021 +0800 blk-mq: Delete busy_iter_fn Typedefs busy_iter_fn and busy_tag_iter_fn are now identical, so delete busy_iter_fn to reduce duplication. It would be nicer to delete busy_tag_iter_fn, as the name busy_iter_fn is less specific. However busy_tag_iter_fn is used in many different parts of the tree, unlike busy_iter_fn which is just use in block/, so just take the straightforward path now, so that we could rename later treewide. Signed-off-by: John Garry Reviewed-by: Ming Lei Reviewed-by: Hannes Reinecke Tested-by: Kashyap Desai Link: https://lore.kernel.org/r/1638794990-137490-3-git-send-email-john.garry@huawei.com Signed-off-by: Jens Axboe commit 8ab30a331946c34e4ba022c44df8624acea1c74e Author: John Garry Date: Mon Dec 6 20:49:48 2021 +0800 blk-mq: Drop busy_iter_fn blk_mq_hw_ctx argument The only user of blk_mq_hw_ctx blk_mq_hw_ctx argument is blk_mq_rq_inflight(). Function blk_mq_rq_inflight() uses the hctx to find the associated request queue to match against the request. However this same check is already done in caller bt_iter(), so drop this check. With that change there are no more users of busy_iter_fn blk_mq_hw_ctx argument, so drop the argument. Reviewed-by Hannes Reinecke Signed-off-by: John Garry Reviewed-by: Ming Lei Tested-by: Kashyap Desai Link: https://lore.kernel.org/r/1638794990-137490-2-git-send-email-john.garry@huawei.com Signed-off-by: Jens Axboe commit ce881fc06dc87e73928ced4c37b6ac6b32ef5fb6 Author: Yanteng Si Date: Fri Dec 3 16:03:22 2021 +0800 docs/scheduler: fix typo and warning in sched-bwc a) since d73df887b6b8 ("sched/fair: Add document for burstable CFS bandwidth") [cpu.cfs_quota_us: the total available run-time within a period (in] shoud be removed, let's delete it. b) Add a period. c) fix a build warning: linux-next/Documentation/scheduler/sched-bwc.rst:243: WARNING: Inline emphasis start-string without end-string. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/163a4dde20b8c4b68d668977a668e281d18fcf92.1638517064.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit 4788a136b80a190f30c695a5ca896bd68f669825 Author: Yanteng Si Date: Fri Dec 3 16:03:21 2021 +0800 docs/zh_CN: add scheduler sched-bwc translation Translate .../scheduler/sched-bwc.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/e5f96f741012af6d4c4a27e7d1aab076ddffd322.1638517064.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit 6f87c5197e7d687c6dc1d53a6da9e11a23080640 Author: Yanteng Si Date: Fri Dec 3 16:03:20 2021 +0800 docs/zh_CN: add scheduler sched-arch translation Translate .../scheduler/sched-arch.rst into Chinese. Signed-off-by: Yanteng Si Link: https://lore.kernel.org/r/f9e66ba8920bc1bb3f1d67044f64712fa30db7c9.1638517064.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit f2c3bb11530ad802f862f8d41ad3c3d3136b22de Author: Yanteng Si Date: Mon Dec 6 16:10:50 2021 +0800 docs/zh_CN: add completion translation Translate .../scheduler/completion.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Acked-by: Tang Yizhou Link: https://lore.kernel.org/r/47b6fd1f277058dfb8d06dd3d33fedc2ef55fcbb.1638777809.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit 8f45663fe33a7a31af818ff4bb14bc4e3fbf19bd Author: Yanteng Si Date: Mon Dec 6 16:10:49 2021 +0800 docs/zh_CN: add scheduler index translation Translate .../scheduler/index.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/e015c61f64fc0d4d3a49f0e85e925f00df433721.1638777809.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit 52f982f00b220d097a71a23c149a1d18efc08e63 Author: Ondrej Mosnacek Date: Mon Dec 6 14:24:06 2021 +0100 security,selinux: remove security_add_mnt_opt() Its last user has been removed in commit f2aedb713c28 ("NFS: Add fs_context support."). Signed-off-by: Ondrej Mosnacek Reviewed-by: Casey Schaufler Signed-off-by: Paul Moore commit c5801123d493c1cb1253b5a2232f6b976e07fc8a Author: Tang Yizhou Date: Thu Dec 2 13:08:16 2021 +0800 doc/zh-CN: Update cpu-freq/cpu-drivers.rst to make it more readable There are some syntax errors in this document. Also make it more readable. Signed-off-by: Tang Yizhou Acked-by: Yanteng Si Link: https://lore.kernel.org/r/20211202050816.12240-1-tangyizhou@huawei.com Signed-off-by: Jonathan Corbet commit d733ac93113572b701ccf0236a46ce4511c1b051 Author: Tang Yizhou Date: Thu Dec 2 22:23:12 2021 +0800 doc/zh-CN: Update cpufreq-stats.rst to make it more readable These Chinese translations are easier to understand. Also add proofreader. Signed-off-by: Tang Yizhou Acked-by: Yanteng Si Link: https://lore.kernel.org/r/20211202142312.20052-1-tangyizhou@huawei.com Signed-off-by: Jonathan Corbet commit 50d1eefa2dd7bcf0d7d54a34ff80d217cdbf22b8 Merge: 1f41badaf6932 6a61d1d1491ee Author: Georgi Djakov Date: Mon Dec 6 19:54:01 2021 +0200 Merge branch 'icc-sc7280' into icc-next Add Epoch Subsystem (EPSS) L3 provider support on SM7280 SoCs. * icc-sc7280 dt-bindings: interconnect: Add EPSS L3 DT binding on SC7280 interconnect: qcom: Add EPSS L3 support on SC7280 Link: https://lore.kernel.org/r/1634812857-10676-1-git-send-email-okukatla@codeaurora.org Signed-off-by: Georgi Djakov commit 1f41badaf6932f13eebf711045a4ad387e60cb0b Merge: a7d9436a6c85f 7add937f5222f Author: Georgi Djakov Date: Mon Dec 6 19:53:06 2021 +0200 Merge branch 'icc-msm8996' into icc-next This series adds a driver for interconnects on MSM8996. This fixes some rare display underflows and provides a slight heat reduction. * icc-msm8996 dt-bindings: interconnect: Combine SDM660 bindings into RPM schema interconnect: icc-rpm: Add support for bus power domain dt-bindings: interconnect: Add Qualcomm MSM8996 DT bindings interconnect: qcom: Add MSM8996 interconnect provider driver Link: https://lore.kernel.org/r/20211021132329.234942-1-y.oudjana@protonmail.com Signed-off-by: Georgi Djakov commit a7d9436a6c85fcb8843c910fd323dcd7f839bf63 Author: Stephan Gerhold Date: Mon Dec 6 12:45:42 2021 +0100 interconnect: qcom: rpm: Prevent integer overflow in rate Using icc-rpm on ARM32 currently results in clk_set_rate() errors during boot, e.g. "bus clk_set_rate error: -22". This is very similar to commit 7381e27b1e56 ("interconnect: qcom: msm8974: Prevent integer overflow in rate") where the u64 is converted to a signed long during clock rate rounding, resulting in an overflow on 32-bit platforms. Let's fix it similarly by making sure that the rate does not exceed LONG_MAX. Such high clock rates will surely result in the maximum frequency of the bus anyway. Signed-off-by: Stephan Gerhold Link: https://lore.kernel.org/r/20211206114542.45325-1-stephan@gerhold.net Signed-off-by: Georgi Djakov commit 42cdeb69d95e8b320adcb0ceff57d1dd9b0ba19f Author: Shawn Guo Date: Mon Dec 6 15:58:03 2021 +0800 interconnect: icc-rpm: Use NOC_QOS_MODE_INVALID for qos_mode check Use NOC_QOS_MODE_INVALID for invalid qos_mode check to improve the readability. Signed-off-by: Shawn Guo Link: https://lore.kernel.org/r/20211206075808.18124-2-shawn.guo@linaro.org Signed-off-by: Georgi Djakov commit 3c732b64813738b0a04dcb12535518648c8ca03a Merge: 6e2127dcb7836 b6ce5d85b1425 Author: Mark Brown Date: Mon Dec 6 17:25:01 2021 +0000 ASoC: fsl-asoc-card: Add missing Kconfig option for tlv320aic31xx Merge series from Ariel D'Alessandro : This is a follow up of patchsets: [RFC patch 0/5] Support BCLK input clock in tlv320aic31xx [PATCH 0/4] fsl-asoc-card: Add optional dt property for setting mclk-id Patch "ASoC: fsl-asoc-card: Support fsl,imx-audio-tlv320aic31xx codec" in "[RFC patch 0/5] Support BCLK input clock in tlv320aic31xx" missed a Kconfig option. Sending incremental patch fix. Regards, Ariel Ariel D'Alessandro (1): ASoC: fsl-asoc-card: Add missing Kconfig option for tlv320aic31xx sound/soc/fsl/Kconfig | 1 + 1 file changed, 1 insertion(+) -- 2.30.2 commit 6e2127dcb78367443a27efb09a6dd7155eff56ef Merge: c736d64daa7f7 2da636247bb6f Author: Mark Brown Date: Mon Dec 6 17:25:00 2021 +0000 ASoC: mediatek: support memory-region assignment Merge series from Trevor Wu : This series of patches adds support for memory-region assignment, so the access region of DMA engine could be restricted. Patches are based on broonie tree "for-next" branch. Trevor Wu (2): ASoC: mediatek: mt8195: support reserved memory assignment dt-bindings: mediatek: mt8195: add memory-region property .../devicetree/bindings/sound/mt8195-afe-pcm.yaml | 8 ++++++++ sound/soc/mediatek/mt8195/mt8195-afe-pcm.c | 7 +++++++ 2 files changed, 15 insertions(+) -- 2.18.0 commit c736d64daa7f7aec9a9ddad9c4d56b891d3b2c2b Merge: 7bef00106bc68 6182ec4616d6f Author: Mark Brown Date: Mon Dec 6 17:24:58 2021 +0000 ASoC: mediatek: Update MT8195 machine driver Merge series from Trevor Wu : This series of patches adds support for RT5682s headset codec in mt8195 machine drivers, and SOF support on card mt8195-mt6359-rt1019-rt5682 is also included. Patches are based on broonie tree "for-next" branch. Changes since v1: - remove patch3 and patch4 in v1 - add SOF support on card mt8195-mt6359-rt1012-rt5682 - add new propertes to dt-bindings for mt8195-mt6359-rt1019-rt5682 Trevor Wu (4): ASoC: mediatek: mt8195: add headset codec rt5682s support dt-bindings: mediatek: mt8195: add model property ASoC: mediatek: mt8195: add sof support on mt8195-mt6359-rt1019-rt5682 dt-bindings: mediatek: mt8195: add adsp and dai-link property .../sound/mt8195-mt6359-rt1011-rt5682.yaml | 4 + .../sound/mt8195-mt6359-rt1019-rt5682.yaml | 14 + sound/soc/mediatek/Kconfig | 2 + .../mt8195/mt8195-mt6359-rt1011-rt5682.c | 29 +- .../mt8195/mt8195-mt6359-rt1019-rt5682.c | 347 +++++++++++++++++- 5 files changed, 370 insertions(+), 26 deletions(-) -- 2.18.0 commit 2027e5b3413d73533c6853154d31bf70c8eea7e1 Author: Dmitry Baryshkov Date: Wed Dec 1 23:20:23 2021 +0300 drm/msm: Initialize MDSS irq domain at probe time Since commit 8f59ee9a570c ("drm/msm/dsi: Adjust probe order"), the DSI host gets initialized earlier, but this caused unability to probe the entire stack of components because they all depend on interrupts coming from the main `mdss` node (mdp5, or dpu1). To fix this issue, move mdss device initialization (which include irq domain setup) to msm_mdev_probe() time, as to make sure that the interrupt controller is available before dsi and/or other components try to initialize, finally satisfying the dependency. Fixes: 8f59ee9a570c ("drm/msm/dsi: Adjust probe order") Co-Developed-By: AngeloGioacchino Del Regno Signed-off-by: Dmitry Baryshkov Tested-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20211201202023.2313971-1-dmitry.baryshkov@linaro.org Signed-off-by: Rob Clark commit ec919e6e7146e01a411506a0e45c9a62efef405b Author: AngeloGioacchino Del Regno Date: Wed Dec 1 11:52:09 2021 +0100 drm/msm: Allocate msm_drm_private early and pass it as driver data In preparation for registering the mdss interrupt controller earlier, move the allocation of msm_drm_private from component bind time to msm_drv probe; this also allows us to use the devm variant of kzalloc. Since it is not right to allocate the drm_device at probe time (as it should exist only when all components are bound, and taken down when components get cleaned up), the only way to make this happen is to pass a pointer to msm_drm_private as driver data (like done in many other DRM drivers), instead of one to drm_device like it's currently done in this driver. This is also simplifying some bind/unbind functions around drm/msm, as some of them are using drm_device just to grab a pointer to the msm_drm_private structure, which we now retrieve in one call. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20211201105210.24970-2-angelogioacchino.delregno@collabora.com Signed-off-by: Rob Clark commit c768968f134b9e7ab8a584ad19030a8d2c7eca2f Author: Lars-Peter Clausen Date: Sun Dec 5 12:13:49 2021 +0100 remoteproc: ingenic: Request IRQ disabled The ingenic remoteproc driver requests its IRQ and then immediately disables it. The disable is necessary since irq_request() normally enables the IRQ. But there is a new flag IRQF_NO_AUTOEN that when specified keeps the IRQ disabled. Use this new flag rather than calling disable_irq(). This slightly reduce the boilerplate code and also avoids a theoretical race condition where the IRQ could fire between irq_request() and disable_irq(). Signed-off-by: Lars-Peter Clausen Acked-by: Paul Cercueil Link: https://lore.kernel.org/r/20211205111349.51213-1-lars@metafoo.de Signed-off-by: Mathieu Poirier commit 83b965d118cbab1dbdfffdff8cabc8c1cfd183c6 Merge: fee3280763339 c305ae99dfd4d Author: Rob Clark Date: Mon Dec 6 09:13:49 2021 -0800 Merge remote-tracking branch 'drm/drm-next' into msm-next-staging Backmerge drm-next to pull in: 8f59ee9a570c ("drm/msm/dsi: Adjust probe order") Signed-off-by: Rob Clark commit 685e2564daa1493053fcd7f1dbed38b35ee2f3cb Author: Reiji Watanabe Date: Sun Dec 5 16:47:36 2021 -0800 arm64: mte: DC {GVA,GZVA} shouldn't be used when DCZID_EL0.DZP == 1 Currently, mte_set_mem_tag_range() and mte_zero_clear_page_tags() use DC {GVA,GZVA} unconditionally. But, they should make sure that DCZID_EL0.DZP, which indicates whether or not use of those instructions is prohibited, is zero when using those instructions. Use ST{G,ZG,Z2G} instead when DCZID_EL0.DZP == 1. Fixes: 013bb59dbb7c ("arm64: mte: handle tags zeroing at page allocation time") Fixes: 3d0cca0b02ac ("kasan: speed up mte_set_mem_tag_range") Signed-off-by: Reiji Watanabe Link: https://lore.kernel.org/r/20211206004736.1520989-3-reijiw@google.com Signed-off-by: Catalin Marinas commit f0616abd4e67143b45b04b565839148458857347 Author: Reiji Watanabe Date: Sun Dec 5 16:47:35 2021 -0800 arm64: clear_page() shouldn't use DC ZVA when DCZID_EL0.DZP == 1 Currently, clear_page() uses DC ZVA instruction unconditionally. But it should make sure that DCZID_EL0.DZP, which indicates whether or not use of DC ZVA instruction is prohibited, is zero when using the instruction. Use STNP instead when DCZID_EL0.DZP == 1. Fixes: f27bb139c387 ("arm64: Miscellaneous library functions") Signed-off-by: Reiji Watanabe Reviewed-by: Robin Murphy Link: https://lore.kernel.org/r/20211206004736.1520989-2-reijiw@google.com Signed-off-by: Catalin Marinas commit 73f3760eddc9bc32c207fff06537f98f94bef451 Author: Ming Lei Date: Mon Dec 6 11:33:50 2021 +0800 blk-mq: don't use plug->mq_list->q directly in blk_mq_run_dispatch_ops() blk_mq_run_dispatch_ops() is defined as one macro, and plug->mq_list will be changed when running 'dispatch_ops', so add one local variable for holding request queue. Reported-and-tested-by: Yi Zhang Fixes: 4cafe86c9267 ("blk-mq: run dispatch lock once in case of issuing from list") Signed-off-by: Ming Lei Signed-off-by: Jens Axboe commit 41adf531e390e7969f00a560b8971cbf42f5a6da Author: Ming Lei Date: Mon Dec 6 19:12:13 2021 +0800 blk-mq: don't run might_sleep() if the operation needn't blocking The operation protected via blk_mq_run_dispatch_ops() in blk_mq_run_hw_queue won't sleep, so don't run might_sleep() for it. Reported-and-tested-by: Marek Szyprowski Signed-off-by: Ming Lei Signed-off-by: Jens Axboe commit fde046e07d3343a0417eafc0533b0c9675b393e5 Author: Jisheng Zhang Date: Fri Nov 19 12:46:08 2021 +0800 arm64: extable: remove unused ex_handler_t definition The ex_handler_t type was introduced in commit d6e2cc564775 ("arm64: extable: add `type` and `data` fields"), but has never been used, and is unnecessary. Remove it. Signed-off-by: Jisheng Zhang Acked-by: Mark Rutland Link: https://lore.kernel.org/r/20211119124608.3f03380b@xhacker Signed-off-by: Catalin Marinas commit c9f5ea08a0f029fc5e0edb5f1380b9a828285439 Author: Florian Fainelli Date: Thu Nov 18 12:18:10 2021 -0800 arm64: entry: Use SDEI event constants Use SDEI_EV_FAILED instead of open coding the 1 to make it clearer how SDEI_EVENT_COMPLETE vs. SDEI_EVENT_COMPLETE_AND_RESUME is selected. Signed-off-by: Florian Fainelli Link: https://lore.kernel.org/r/20211118201811.2974922-1-f.fainelli@gmail.com Signed-off-by: Catalin Marinas commit 155358310f013c23c2e5533e007afc7310c9a964 Author: LUU HOAI Date: Tue Feb 25 18:32:53 2020 +0900 drm: rcar-du: Add R-Car DSI driver The driver supports the MIPI DSI/CSI-2 TX encoder found in the R-Car V3U SoC. It currently supports DSI mode only. Signed-off-by: LUU HOAI Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham Tested-by: Kieran Bingham Acked-by: Sam Ravnborg Reviewed-by: Jagan Teki commit 1a0548ce39e8600297d0de7d50187fe89b8cb611 Author: Laurent Pinchart Date: Tue Mar 23 01:00:53 2021 +0200 dt-bindings: display: bridge: Add binding for R-Car MIPI DSI/CSI-2 TX The R-Car MIPI DSI/CSI-2 TX is embedded in the Renesas R-Car V3U SoC. It can operate in either DSI or CSI-2 mode, with up to four data lanes. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham Acked-by: Sam Ravnborg Reviewed-by: Rob Herring Reviewed-by: Geert Uytterhoeven commit 57b290cb905bec520372ac635d9e9f0548d9d67e Author: Kieran Bingham Date: Fri Nov 26 09:35:14 2021 +0000 drm: rcar-du: crtc: Support external DSI dot clock On platforms with an external clock, both the group and crtc must be handled accordingly to correctly pass through the external clock and configure the DU to use the external rate. The CRTC support was missed while adding the DSI support on the r8a779a0 which led to the output clocks being incorrectly determined. Ensure that when a CRTC is routed through the DSI encoder, the external clock is used without any further divider being applied. Fixes: b291fdcf5114 ("drm: rcar-du: Add r8a779a0 device support") Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart commit e0e4c64a64780a8672480618142776de8bf98d07 Author: Kieran Bingham Date: Mon Nov 29 17:08:45 2021 +0000 drm: rcar-du: Add DSI support to rcar_du_output_name The DSI output names were not added when the DSI pipeline support was introduced. Add the correct labels for these outputs, and fix the sort order to match 'enum rcar_du_output' while we are here. Fixes: b291fdcf5114 ("drm: rcar-du: Add r8a779a0 device support") Suggested-by: Biju Das Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart commit f0ce591dc9a97067c6e783a2eaccd22c5476144d Author: Laurent Pinchart Date: Mon Nov 29 03:10:46 2021 +0200 drm: rcar-du: Fix CRTC timings when CMM is used When the CMM is enabled, an offset of 25 pixels must be subtracted from the HDS (horizontal display start) and HDE (horizontal display end) registers. Fix the timings calculation, and take this into account in the mode validation. This fixes a visible horizontal offset in the image with VGA monitors. HDMI monitors seem to be generally more tolerant to incorrect timings, but may be affected too. Signed-off-by: Laurent Pinchart commit 42d95d1b3a9c649bf5ee881fee5938e00126479a Author: Arnd Bergmann Date: Mon Sep 27 16:26:23 2021 +0200 drm/rcar: stop using 'imply' for dependencies The meaning of the 'imply' keyword has changed recently, and neither the old meaning (select the symbol if its dependencies are met) nor the new meaning (enable it by default, but let the user set any other setting) is what we want here. Work around this by adding two more Kconfig options that lead to the correct behavior: if DRM_RCAR_USE_CMM and DRM_RCAR_USE_LVDS are enabled, that portion of the driver becomes usable, and no configuration results in a link error. This avoids a link failure: arm-linux-gnueabi-ld: drivers/gpu/drm/rcar-du/rcar_du_crtc.o: in function `rcar_du_crtc_atomic_begin': rcar_du_crtc.c:(.text+0x1444): undefined reference to `rcar_cmm_setup' arm-linux-gnueabi-ld: drivers/gpu/drm/rcar-du/rcar_du_crtc.o: in function `rcar_du_crtc_atomic_enable': rcar_du_crtc.c:(.text+0x14d4): undefined reference to `rcar_cmm_enable' arm-linux-gnueabi-ld: rcar_du_crtc.c:(.text+0x1548): undefined reference to `rcar_cmm_setup' arm-linux-gnueabi-ld: drivers/gpu/drm/rcar-du/rcar_du_crtc.o: in function `rcar_du_crtc_atomic_disable': rcar_du_crtc.c:(.text+0x18b8): undefined reference to `rcar_cmm_disable' arm-linux-gnueabi-ld: drivers/gpu/drm/rcar-du/rcar_du_kms.o: in function `rcar_du_modeset_init': Link: https://lore.kernel.org/all/20200417155553.675905-5-arnd@arndb.de/ Signed-off-by: Arnd Bergmann Reviewed-by: Laurent Pinchart Reviewed-by: Randy Dunlap Signed-off-by: Laurent Pinchart commit ab5d31790f4d50d601f150223d6da3dfaab50349 Author: Vinod Koul Date: Wed Dec 1 12:53:10 2021 +0530 clk: qcom: rpmh: add support for SM8450 rpmh clocks This adds the RPMH clocks present in SM8450 SoC Signed-off-by: Vinod Koul Reviewed-by: Konrad Dybcio Tested-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211201072310.3968679-5-vkoul@kernel.org commit ea59846bd206614211ee43a31e001bed5062f21d Author: Vinod Koul Date: Wed Dec 1 12:53:08 2021 +0530 dt-bindings: clock: Add RPMHCC bindings for SM8450 Add bindings and update documentation for clock rpmh driver on SM8450. Signed-off-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211201072310.3968679-3-vkoul@kernel.org commit b6363fe7b5135bfb5aea03f414148b3c2417702e Author: Rob Herring Date: Fri Oct 29 09:40:55 2021 -0500 arm64: Simplify checking for populated DT Use of the of_scan_flat_dt() function predates libfdt and is discouraged as libfdt provides a nicer set of APIs. Rework dt_scan_depth1_nodes to use libfdt calls directly, and rename it to dt_is_stub() to reflect exactly what it checking. Cc: Will Deacon Signed-off-by: Rob Herring Reviewed-by: Mark Rutland Link: https://lore.kernel.org/r/20211029144055.2365814-1-robh@kernel.org Signed-off-by: Catalin Marinas commit d658220a1c45cb721a80a9af7d1d70b35c7b74ea Author: Mark Brown Date: Mon Oct 25 17:32:32 2021 +0100 arm64/kvm: Fix bitrotted comment for SVE handling in handle_exit.c The comment on the SVE trap handler in handle_exit.c says that it is a placeholder until we support SVE in guests which we now do for both VHE and nVHE cases so we really shouldn't get here in any sort of standard case. Update the comment to be less immediately incorrect, the handling of such a situation is correct. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20211025163232.3502052-1-broonie@kernel.org Signed-off-by: Catalin Marinas commit b26ab06d0969ed9e901f93390242437ac5802c4d Author: Shawn Guo Date: Sun Oct 31 10:07:15 2021 +0800 clk: qcom: smd-rpm: Drop binary value handling for buffered clock The buffered clock binary value handling added by commit 36354c32bd76 ("clk: qcom: smd-rpm: Add .recalc_rate hook for clk_smd_rpm_branch_ops") is redundant, because buffered clock is branch type, and the binary value handling for branch clock has been handled by clk_smd_rpm_prepare/unprepare functions. Signed-off-by: Shawn Guo Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211031020715.21636-4-shawn.guo@linaro.org commit b406f5e92b3ba6c8fe89f16cb61e60190e45171b Author: Shawn Guo Date: Sun Oct 31 10:07:14 2021 +0800 clk: qcom: smd-rpm: Drop the use of struct rpm_cc Considering that struct rpm_cc is now identical to rpm_smd_clk_desc, and function qcom_smdrpm_clk_hw_get() uses rpm_cc in a read-only manner, rpm_cc can be dropped by getting the function use rpm_smd_clk_desc directly. Signed-off-by: Shawn Guo Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211031020715.21636-3-shawn.guo@linaro.org commit 00a123e962f7f17163ee7f665f483d3ba25f54a6 Author: Shawn Guo Date: Sun Oct 31 10:07:13 2021 +0800 clk: qcom: smd-rpm: Drop MFD qcom-rpm reference The MFD qcom-rpm interface is not used by this driver. Drop the 'struct qcom_rpm' reference and include of . Signed-off-by: Shawn Guo Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211031020715.21636-2-shawn.guo@linaro.org commit 9dbd1ab20509e85cd3fac9479a00c59e83c08196 Author: Bartosz Golaszewski Date: Thu Dec 2 14:40:34 2021 +0100 gpiolib: check the 'ngpios' property in core gpiolib code Several drivers read the 'ngpios' device property on their own, but since it's defined as a standard GPIO property in the device tree bindings anyway, it's a good candidate for generalization. If the driver didn't set its gc->ngpio, try to read the 'ngpios' property from the GPIO device's firmware node before bailing out. Signed-off-by: Bartosz Golaszewski Suggested-by: Andy Shevchenko Reviewed-by: Linus Walleij Reviewed-by: Andy Shevchenko commit e5ab49cd3d6937b1818b80cb5eb09dc018ae0718 Author: Bartosz Golaszewski Date: Thu Dec 2 14:40:33 2021 +0100 gpiolib: improve coding style for local variables Drop unneeded whitespaces and put the variables of the same type together for consistency with the rest of the code. Signed-off-by: Bartosz Golaszewski Reviewed-by: Linus Walleij Reviewed-by: Andy Shevchenko commit db52f57211b4e45f0ebb274e2c877b211dc18591 Author: Kajol Jain Date: Mon Dec 6 13:03:15 2021 +0530 bpf: Remove config check to enable bpf support for branch records Branch data available to BPF programs can be very useful to get stack traces out of userspace application. Commit fff7b64355ea ("bpf: Add bpf_read_branch_records() helper") added BPF support to capture branch records in x86. Enable this feature also for other architectures as well by removing checks specific to x86. If an architecture doesn't support branch records, bpf_read_branch_records() still has appropriate checks and it will return an -EINVAL in that scenario. Based on UAPI helper doc in include/uapi/linux/bpf.h, unsupported architectures should return -ENOENT in such case. Hence, update the appropriate check to return -ENOENT instead. Selftest 'perf_branches' result on power9 machine which has the branch stacks support: - Before this patch: [command]# ./test_progs -t perf_branches #88/1 perf_branches/perf_branches_hw:FAIL #88/2 perf_branches/perf_branches_no_hw:OK #88 perf_branches:FAIL Summary: 0/1 PASSED, 0 SKIPPED, 1 FAILED - After this patch: [command]# ./test_progs -t perf_branches #88/1 perf_branches/perf_branches_hw:OK #88/2 perf_branches/perf_branches_no_hw:OK #88 perf_branches:OK Summary: 1/2 PASSED, 0 SKIPPED, 0 FAILED Selftest 'perf_branches' result on power9 machine which doesn't have branch stack report: - After this patch: [command]# ./test_progs -t perf_branches #88/1 perf_branches/perf_branches_hw:SKIP #88/2 perf_branches/perf_branches_no_hw:OK #88 perf_branches:OK Summary: 1/1 PASSED, 1 SKIPPED, 0 FAILED Fixes: fff7b64355eac ("bpf: Add bpf_read_branch_records() helper") Suggested-by: Peter Zijlstra Signed-off-by: Kajol Jain Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20211206073315.77432-1-kjain@linux.ibm.com commit 3be9d243b21724d49b65043d4520d688b6040b36 Author: Pali Rohár Date: Wed Nov 24 16:59:44 2021 +0100 PCI: pci-bridge-emul: Set PCI_STATUS_CAP_LIST for PCIe device Since all PCI Express device Functions are required to implement the PCI Express Capability structure, Capabilities List bit in PCI Status Register must be hardwired to 1b. Capabilities Pointer register (which is already set by pci-bride-emul.c driver) is valid only when Capabilities List is set to 1b. Link: https://lore.kernel.org/r/20211124155944.1290-7-pali@kernel.org Fixes: 23a5fba4d941 ("PCI: Introduce PCI bridge emulated config space common logic") Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi Cc: stable@vger.kernel.org commit 1f1050c5e1fefb34ac90a506b43e9da803b5f8f7 Author: Pali Rohár Date: Wed Nov 24 16:59:43 2021 +0100 PCI: pci-bridge-emul: Correctly set PCIe capabilities Older mvebu hardware provides PCIe Capability structure only in version 1. New mvebu and aardvark hardware provides it in version 2. So do not force version to 2 in pci_bridge_emul_init() and rather allow drivers to set correct version. Drivers need to set version in pcie_conf.cap field without overwriting PCI_CAP_LIST_ID register. Both drivers (mvebu and aardvark) do not provide slot support yet, so do not set PCI_EXP_FLAGS_SLOT flag. Link: https://lore.kernel.org/r/20211124155944.1290-6-pali@kernel.org Fixes: 23a5fba4d941 ("PCI: Introduce PCI bridge emulated config space common logic") Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi Cc: stable@vger.kernel.org commit 12998087d9f48b66965b97412069c7826502cd7e Author: Pali Rohár Date: Wed Nov 24 16:59:42 2021 +0100 PCI: pci-bridge-emul: Fix definitions of reserved bits Some bits in PCI_EXP registers are reserved for non-root ports. Driver pci-bridge-emul.c implements PCIe Root Port device therefore it should not allow setting reserved bits of registers. Properly define non-reserved bits for all PCI_EXP registers. Link: https://lore.kernel.org/r/20211124155944.1290-5-pali@kernel.org Fixes: 23a5fba4d941 ("PCI: Introduce PCI bridge emulated config space common logic") Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi Cc: stable@vger.kernel.org commit b03cbca48d6408cea866057654675dd63a1bdcd3 Author: Jean-Philippe Brucker Date: Wed Dec 1 17:33:25 2021 +0000 iommu/virtio: Support identity-mapped domains Support identity domains for devices that do not offer the VIRTIO_IOMMU_F_BYPASS_CONFIG feature, by creating 1:1 mappings between the virtual and physical address space. Identity domains created this way still perform noticeably better than DMA domains, because they don't have the overhead of setting up and tearing down mappings at runtime. The performance difference between this and bypass is minimal in comparison. It does not matter that the physical addresses in the identity mappings do not all correspond to memory. By enabling passthrough we are trusting the device driver and the device itself to only perform DMA to suitable locations. In some cases it may even be desirable to perform DMA to MMIO regions. Reviewed-by: Eric Auger Reviewed-by: Kevin Tian Signed-off-by: Jean-Philippe Brucker Link: https://lore.kernel.org/r/20211201173323.1045819-6-jean-philippe@linaro.org Signed-off-by: Joerg Roedel commit c0c763598960153e10622ff0a802012a073174a0 Author: Jean-Philippe Brucker Date: Wed Dec 1 17:33:24 2021 +0000 iommu/virtio: Pass end address to viommu_add_mapping() To support identity mappings, the virtio-iommu driver must be able to represent full 64-bit ranges internally. Pass (start, end) instead of (start, size) to viommu_add/del_mapping(). Clean comments. The one about the returned size was never true: when sweeping the whole address space the returned size will most certainly be smaller than 2^64. Reviewed-by: Eric Auger Reviewed-by: Kevin Tian Signed-off-by: Jean-Philippe Brucker Link: https://lore.kernel.org/r/20211201173323.1045819-5-jean-philippe@linaro.org Signed-off-by: Joerg Roedel commit 5610979415649f3743a7c3de03ab46c9a3bfff16 Author: Jean-Philippe Brucker Date: Wed Dec 1 17:33:23 2021 +0000 iommu/virtio: Sort reserved regions To ease identity mapping support, keep the list of reserved regions sorted. Reviewed-by: Eric Auger Reviewed-by: Kevin Tian Signed-off-by: Jean-Philippe Brucker Link: https://lore.kernel.org/r/20211201173323.1045819-4-jean-philippe@linaro.org Signed-off-by: Joerg Roedel commit f0f07a8462dc2a889745b9e436b4d86d66ccc787 Author: Jean-Philippe Brucker Date: Wed Dec 1 17:33:22 2021 +0000 iommu/virtio: Support bypass domains The VIRTIO_IOMMU_F_BYPASS_CONFIG feature adds a new flag to the ATTACH request, that creates a bypass domain. Use it to enable identity domains. When VIRTIO_IOMMU_F_BYPASS_CONFIG is not supported by the device, we currently fail attaching to an identity domain. Future patches will instead create identity mappings in this case. Reviewed-by: Kevin Tian Signed-off-by: Jean-Philippe Brucker Reviewed-by: Eric Auger Link: https://lore.kernel.org/r/20211201173323.1045819-3-jean-philippe@linaro.org Signed-off-by: Joerg Roedel commit 063ebb19d962b45a1b505748d464bd12b5074797 Author: Jean-Philippe Brucker Date: Wed Dec 1 17:33:21 2021 +0000 iommu/virtio: Add definitions for VIRTIO_IOMMU_F_BYPASS_CONFIG Add definitions for the VIRTIO_IOMMU_F_BYPASS_CONFIG, which supersedes VIRTIO_IOMMU_F_BYPASS. Reviewed-by: Kevin Tian Signed-off-by: Jean-Philippe Brucker Reviewed-by: Eric Auger Link: https://lore.kernel.org/r/20211201173323.1045819-2-jean-philippe@linaro.org Signed-off-by: Joerg Roedel commit 2da636247bb6f4fc3a9842ade04757790753fd2c Author: Trevor Wu Date: Tue Nov 30 13:39:05 2021 +0800 ASoC: mediatek: mt8195: add memory-region property Add a required property "memory-region", which is used to specify memory for DMA usage. Signed-off-by: Trevor Wu Link: https://lore.kernel.org/r/20211130053905.28470-3-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit 6182ec4616d6ffc046bea798c683a0dee11ded67 Author: Trevor Wu Date: Mon Nov 29 22:10:57 2021 +0800 ASoC: mediatek: mt8195: add adsp and dai-link property 1. adsp phandle can be assigned to the machine driver if adsp is enabled. 2. dai-link supported in the sound card can be specified from DTS. Signed-off-by: Trevor Wu Link: https://lore.kernel.org/r/20211129141057.12422-5-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit 3d00d2c07f04f47aa4228700b440ac47abf13853 Author: Trevor Wu Date: Mon Nov 29 22:10:56 2021 +0800 ASoC: mediatek: mt8195: add sof support on mt8195-mt6359-rt1019-rt5682 In the patch, widgets, routes and dai-link requrird by SOF are included, and late_probe is introduced for SOF route connection. Only when adsp phandle could be retrieved from DTS, the SOF related part of machine driver is executed. Additionally, supported dai-links could be specified from DTS, so that we can disable AP side hardware controls when DSP SOF controls the same audio FE. Signed-off-by: Trevor Wu Signed-off-by: YC Hung Link: https://lore.kernel.org/r/20211129141057.12422-4-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit 629e442761bae0c62b2fb14061d66bbd08b4155e Author: Trevor Wu Date: Mon Nov 29 22:10:55 2021 +0800 ASoC: mediatek: mt8195: add model property This patch adds the description of model property used to specify card name from dts. Signed-off-by: Trevor Wu Acked-by: Rob Herring Link: https://lore.kernel.org/r/20211129141057.12422-3-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit 7bef00106bc68beddcddcd06e3b02dde5525face Author: Rikard Falkeborn Date: Sat Dec 4 12:08:48 2021 +0100 ASoC: amd: acp6x-pdm-dma: Constify static snd_soc_dai_ops The only usage of acp6x_pdm_dai_ops is to assign its address to the ops field in the snd_soc_dai_driver struct, which is a pointer to const snd_soc_dai_ops. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn Link: https://lore.kernel.org/r/20211204110848.21322-1-rikard.falkeborn@gmail.com Signed-off-by: Mark Brown commit 9a83dfcc5ae8230fbf12b63e281d5bb8450ec0e7 Author: Kai Vehmanen Date: Fri Dec 3 17:47:21 2021 +0200 ASoC: SOF: Intel: fix build issue related to CODEC_PROBE_ENTRIES Fix following error: sound/soc/sof/intel/hda-codec.c:132:35: error: use of undeclared identifier 'CODEC_PROBE_RETRIES' Found with config: i386-randconfig-r033-20211202 (https://download.01.org/0day-ci/archive/20211203/202112031943.Twg19fWT-lkp@intel.com/config) Fixes: 046aede2f847 ("ASoC: SOF: Intel: Retry codec probing if it fails") Reported-by: kernel test robot Reviewed-by: Pierre-Louis Bossart Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20211203154721.923496-1-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit c1a77ba466c0dd0bdf1ec2bbebb8996d7cd7b8f7 Author: Andy Shevchenko Date: Thu Dec 2 22:56:12 2021 +0200 ASoC: ti: davinci-mcasp: Remove unnecessary conditional Instead of double validating of_node, return value of the boolean property directly. We can't remove ifdeffery, because in OF_GPIO=n cases it might bring unwanted surprises. Signed-off-by: Andy Shevchenko Acked-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20211202205612.76216-2-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit 4db32072b8ab18a8b90191c57c74f42d00bf9991 Author: Andy Shevchenko Date: Thu Dec 2 22:56:11 2021 +0200 ASoC: ti: davinci-mcasp: Get rid of duplicate of_node assignment GPIO library does copy the of_node from the parent device of the GPIO chip, there is no need to repeat this in the individual drivers. Remove assignment here. For the details one may look into the of_gpio_dev_init() implementation. Signed-off-by: Andy Shevchenko Acked-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20211202205612.76216-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit 766cc7f12078fe80dd88469e3dfe045e49bdf2bb Author: Andy Shevchenko Date: Thu Dec 2 22:48:38 2021 +0200 ASoC: zl38060: Setup parent device and get rid of unnecessary of_node assignment Some of the drivers do not set parent device. This may lead to obstacles during debugging or understanding the device relations from the Linux point of view. Assign parent device for GPIO chips created by these drivers. While at it, let GPIO library to assign of_node from the parent device. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211202204838.75287-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit c686316ec1210d43653c91e104c1e4cd0156dc89 Author: Ameer Hamza Date: Mon Dec 6 01:42:00 2021 +0500 ASoC: test-component: fix null pointer dereference. Dereferncing of_id pointer will result in exception in current implementation since of_match_device() will assign it to NULL. Adding NULL check for protection. Signed-off-by: Ameer Hamza Link: https://lore.kernel.org/r/20211205204200.7852-1-amhamza.mgc@gmail.com Signed-off-by: Mark Brown commit e733ab7e3e5dc1bf7d34e050e839fc902ce7ff98 Author: Bernard Zhao Date: Sun Dec 5 18:11:00 2021 -0800 sound/soc: remove useless bool conversion to bool variable This patch remove useless bool conversion to bool variable Signed-off-by: Bernard Zhao Link: https://lore.kernel.org/r/20211206021100.321170-1-bernard@vivo.com Signed-off-by: Mark Brown commit c9d57a25de53800e54969f4bf2b672b3a58cdaf5 Author: Trevor Wu Date: Mon Nov 29 22:10:54 2021 +0800 ASoC: mediatek: mt8195: add headset codec rt5682s support mt8195 machine driver adds rt5682s support in this patch. Card name can be specified from dts by model property, and driver makes use of the name to distinguish which headset codec is on the board. Signed-off-by: Trevor Wu Link: https://lore.kernel.org/r/20211129141057.12422-2-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit b6ce5d85b1425d3a1211f85835ab152c9bf3803a Author: Ariel D'Alessandro Date: Fri Dec 3 14:50:18 2021 -0300 ASoC: fsl-asoc-card: Add missing Kconfig option for tlv320aic31xx The following commit added support for tlv320aic31xx codec to fsl-asoc-card, but missed the related Kconfig option. Fix this. commit 8c9b9cfb7724685ce705f511b882f30597596536 Author: Ariel D'Alessandro Date: Fri Nov 19 12:32:48 2021 -0300 ASoC: fsl-asoc-card: Support fsl,imx-audio-tlv320aic31xx codec Signed-off-by: Ariel D'Alessandro Signed-off-by: Michael Trimarchi Link: https://lore.kernel.org/r/20211203175018.252641-2-ariel.dalessandro@collabora.com Signed-off-by: Mark Brown commit 4d408ea0282c374a304ce402866cb7b8a56c6b05 Author: Trevor Wu Date: Tue Nov 30 13:39:04 2021 +0800 ASoC: mediatek: mt8195: support reserved memory assignment For security purpose, restrict the memory assess region of AFE memif. The specified memory region should be assigned from DTS. Signed-off-by: Trevor Wu Link: https://lore.kernel.org/r/20211130053905.28470-2-trevor.wu@mediatek.com Signed-off-by: Mark Brown commit f139862b92cf85bd25cbe7c8683d63c037e6562c Author: Tony Krowiak Date: Wed Oct 27 11:20:14 2021 -0400 s390/vfio-ap: add status attribute to AP queue device's sysfs dir This patch adds a sysfs 'status' attribute to a queue device when it is bound to the vfio_ap device driver. The field displays a string indicating the status of the queue device: Status String: Indicates: ------------- --------- "assigned" the queue is assigned to an mdev, but is not in use by a KVM guest. "in use" the queue is assigned to an mdev and is in use by a KVM guest. "unassigned" the queue is not assigned to an mdev. The status string will be displayed by the 'lszcrypt' command if the queue device is bound to the vfio_ap device driver. Signed-off-by: Harald Freudenberger [akrowiak@linux.ibm.com: added check for queue in use by guest] Signed-off-by: Tony Krowiak Signed-off-by: Heiko Carstens commit 402ff5a3387dc8ec6987a80d3ce26b0c25773622 Author: Heiko Carstens Date: Thu Nov 25 19:59:16 2021 +0100 s390/nmi: add missing __pa/__va address conversion of extended save area Add missing __pa/__va address conversion of machine check extended save area designation, which is an absolute address. Note: this currently doesn't fix a real bug, since virtual addresses are indentical to physical ones. Reported-by: Vineeth Vijayan Tested-by: Vineeth Vijayan Signed-off-by: Heiko Carstens commit 32ddf3e124ee35b70c86e239b31d30827f993d3f Author: Julian Wiedmann Date: Thu Aug 20 15:19:42 2020 +0300 s390/qdio: clarify logical vs absolute in QIB's kerneldoc qib.isliba and qib.osliba are actually logical addresses, and this is also how the relevant code sets up these fields. Fix up the documentation. Signed-off-by: Julian Wiedmann Reviewed-by: Alexandra Winter Signed-off-by: Heiko Carstens commit e628f28793033ff760c82e04a73abe415b10a66c Author: Julian Wiedmann Date: Wed Nov 24 10:16:53 2021 +0100 s390/qdio: remove unneeded sanity check in qdio_do_sqbs() All callers of set_buf_states() are already making sure that 'count' is not 0. So don't check it an additional time. Note that our own code also doesn't _require_ the count to be sane (ie. we can't overrun an array or similar). So worst case HW would simply reject the SQBS operation and report an error. Signed-off-by: Julian Wiedmann Reviewed-by: Benjamin Block Signed-off-by: Heiko Carstens commit 568de506e31749ae9140c1a804f3b1d1ab47b4c2 Author: Niklas Schnelle Date: Thu Nov 25 16:46:00 2021 +0100 s390/pci: use physical addresses in DMA tables The entries in the DMA translation tables for our IOMMU must specify physical addresses of either the next level table or the final page to be mapped for DMA. Currently however the code simply passes the virtual addresses of both. On the other hand we still need to walk the tables via their virtual addresses so we need to do a phys_to_virt() when setting the entries and a virt_to_phys() when getting them. Similarly when passing the I/O translation anchor to the hardware we must also specify its physical address. As the DMA and IOMMU APIs we are implementing already use the correct phys_addr_t type for the address to be mapped let's also thread this through instead of treating it as just an unsigned long. Note: this currently doesn't fix a real bug, since virtual addresses are indentical to physical ones. Reviewed-by: Pierre Morel Signed-off-by: Niklas Schnelle Signed-off-by: Heiko Carstens commit 4e4dc65ab578c962ea898d475c0418ea29cc6b2f Author: Niklas Schnelle Date: Thu Nov 25 16:42:22 2021 +0100 s390/pci: use phys_to_virt() for AIBVs/DIBVs The adapter and directed interrupt bit vectors need to be referenced in the FIB with their physical not their virtual address. So use virt_to_phys() as approrpiate. Note: this currently doesn't fix a real bug, since virtual addresses are indentical to physical ones. Reviewed-by: Pierre Morel Signed-off-by: Niklas Schnelle Signed-off-by: Heiko Carstens commit 97aa7468f697383e0ed5babd1168aaed8a660dc0 Author: Heiko Carstens Date: Thu Nov 25 19:30:07 2021 +0100 s390/vmcp: use page_to_virt instead of page_to_phys Fix wrong usage of page_to_phys/phys_to_page. Note: this currently doesn't fix a real bug, since virtual addresses are indentical to physical ones. Acked-by: Thomas Richter Signed-off-by: Heiko Carstens commit a60bffe536f90834ddedc0ed4ddf81af943eb061 Author: Julian Wiedmann Date: Mon Aug 30 15:28:36 2021 +0300 s390/qdio: split do_QDIO() The callers know what type of queue they want to work with. Introduce type-specific variants to add buffers on an {Input,Output} queue, so that we can avoid some function parameters and the de-muxing into type-specific hot paths. Signed-off-by: Julian Wiedmann Reviewed-by: Benjamin Block Signed-off-by: Heiko Carstens commit b44995e515227e68af8a337c0538e17b05ae560f Author: Julian Wiedmann Date: Fri Jul 23 09:16:10 2021 +0200 s390/qdio: split qdio_inspect_queue() The callers know what type of queue they want to inspect. Introduce type-specific variants to inspect an {Input,Output} queue, so that we can avoid one function parameter and some conditional branches in the hot paths. Signed-off-by: Julian Wiedmann Reviewed-by: Benjamin Block Signed-off-by: Heiko Carstens commit 513251fe25d304d1ca628c581bd0cc0422de150a Author: Julian Wiedmann Date: Mon Nov 15 08:28:08 2021 +0100 s390/qdio: clarify handler logic for qdio_handle_activate_check() qdio_handle_activate_check() tries to re-use one of the queue-specific handlers to report that the ACTIVATE ccw has been terminated. But the logic to select that handler is overly complex - in practice both qdio drivers have at least one Input Queue, so we never take the other paths. Make things more obvious by removing this unused code, and clearly spelling out that we re-use the Input Handler for generic error reporting. This also paves the way for a world without queue-specific error handlers. Signed-off-by: Julian Wiedmann Reviewed-by: Benjamin Block Signed-off-by: Heiko Carstens commit 0a86cdcb4ce297f543d13d0bbd4f0c86f00626e5 Author: Julian Wiedmann Date: Mon Nov 15 08:21:38 2021 +0100 s390/qdio: clean up access to queue in qdio_handle_activate_check() qdio_handle_activate_check() re-uses a queue-specific handler to report that the ACTIVATE ccw has been terminated. It uses either the first input or output queue, so we can hard-code q->nr as 0. Also don't access the q->irq_ptr parent pointer, we already have a pointer to the qdio_irq. Signed-off-by: Julian Wiedmann Reviewed-by: Benjamin Block Signed-off-by: Heiko Carstens commit 718ce9e10171f70f2d00c3c89ceb7e406a892bb6 Author: Julian Wiedmann Date: Tue Aug 24 09:37:06 2021 +0300 s390/qdio: avoid allocating the qdio_irq with GFP_DMA The qdio_irq contains only two fields that are directly exposed to the HW (ccw and qib). And only the ccw needs to reside in 31-bit memory. So allocate it separately, and remove the GFP_DMA constraint from the qdio_irq allocation. Signed-off-by: Julian Wiedmann Reviewed-by: Benjamin Block Signed-off-by: Heiko Carstens commit bd3a025dd22c500d33960b0a1fcf92e27514332c Author: Julian Wiedmann Date: Thu Jul 8 08:49:28 2021 +0200 s390/qdio: improve handling of CIWs Fetch the individual CIWs when we actually need them, rather than fetching both of them in qdio_setup_irq() and then needing to cache them inside the qdio_irq. Also deal with the error when a CIW is not available, instead of silently dropping this error condition in qdio_setup_irq()'s caller. Signed-off-by: Julian Wiedmann Reviewed-by: Benjamin Block Signed-off-by: Heiko Carstens commit 764fc3187c3fae5e620a435b42c9cc0e813a903d Author: Julian Wiedmann Date: Fri Nov 12 09:15:15 2021 +0100 s390/qdio: remove QDIO_SBAL_SIZE macro It's unused, and duplicates sizeof(struct qdio_buffer). Signed-off-by: Julian Wiedmann Reviewed-by: Benjamin Block Signed-off-by: Heiko Carstens commit a84d1c5006b56166dac477e922643ede01cdbb92 Author: Vineeth Vijayan Date: Tue Jun 29 09:38:22 2021 +0200 s390/cio: remove uevent suppress from cio driver commit fa1a8c23eb7d ("s390: cio: Delay uevents for subchannels") introduced suppression of uevents for a subchannel until after it is clear that the subchannel would not be unregistered again immediately. This was done to avoid uevents being generated for I/O subchannels with no valid device, which can happen on LPAR. However, this also has some drawbacks: All subchannel drivers need to manually remove the uevent suppression and generate an ADD uevent as soon as they are sure that the subchannel will stay around. This misses out on all uevents that are not the initial ADD uevent that would be generated while uevents are suppressed; for example, all subchannels were missing the BIND uevent. As uevents being generated even for I/O subchannels without an operational device turned out to be not as bad as missing uevents and complicating the code flow, let's remove uevent suppression for subchannels. Signed-off-by: Vineeth Vijayan [cohuck@redhat.com: modified changelog] Reviewed-by: Cornelia Huck Reviewed-by: Peter Oberparleiter Link: https://lore.kernel.org/r/20211122103756.352463-2-vneethv@linux.ibm.com Signed-off-by: Heiko Carstens commit b087dfab4d3902681550fd1f5ff9c3e942059478 Author: Patrick Steuer Date: Thu Nov 4 15:58:51 2021 +0100 s390/crypto: add SIMD implementation for ChaCha20 Add an implementation of the ChaCha20 stream cipher (see e.g. RFC 7539) that makes use of z13's vector instruction set extension. The original implementation is by Andy Polyakov which is adapted for kernel use. Four to six blocks are processed in parallel resulting in a performance gain for inputs >= 256 bytes. chacha20-generic 1 operation in 622 cycles (256 bytes) 1 operation in 2346 cycles (1024 bytes) chacha20-s390 1 operation in 218 cycles (256 bytes) 1 operation in 647 cycles (1024 bytes) Cc: Andy Polyakov Reviewed-by: Harald Freudenberger Signed-off-by: Patrick Steuer Signed-off-by: Heiko Carstens commit 5e8ba485b2522808ab2d65208839e1c915e113dd Author: Petr Mladek Date: Mon Nov 22 14:26:49 2021 +0100 printk/console: Clean up boot console handling in register_console() The variable @bcon has two meanings. It is used several times for iterating the list of registered consoles. In the meantime, it holds the information whether a boot console is first in @console_drivers list. The information about the 1st console driver used to be important for the decision whether to install the new console by default or not. It allowed to re-evaluate the variable @need_default_console when a real console with tty binding has been unregistered in the meantime. The decision about the default console is not longer affected by @bcon variable. The current code checks whether the first driver is real and has tty binding directly. The information about the first console is still used for two more decisions: 1. It prevents duplicate output on non-boot consoles with CON_CONSDEV flag set. 2. Early/boot consoles are unregistered when a real console with CON_CONSDEV is registered and @keep_bootcon is not set. The behavior in the real life is far from obvious. @bcon is set according to the first console @console_drivers list. But the first position in the list is special: 1. Consoles with CON_CONSDEV flag are put at the beginning of the list. It is either the preferred console or any console with tty binding registered by default. 2. Another console might become the first in the list when the first console in the list is unregistered. It might happen either explicitly or automatically when boot consoles are unregistered. There is one more important rule: + Boot consoles can't be registered when any real console is already registered. It is a puzzle. The main complication is the dependency on the first position is the list and the complicated rules around it. Let's try to make it easier: 1. Add variable @bootcon_enabled and set it by iterating all registered consoles. The variable has obvious meaning and more predictable behavior. Any speed optimization and other tricks are not worth it. 2. Use a generic name for the variable that is used to iterate the list on registered console drivers. Behavior change: No, maybe surprisingly, there is _no_ behavior change! Let's provide the proof by contradiction. Both operations, duplicate output prevention and boot consoles removal, are done only when the newly added console has CON_CONSDEV flag set. The behavior would change when the new @bootcon_enabled has different value than the original @bcon. By other words, the behavior would change when the following conditions are true: + a console with CON_CONSDEV flag is added + a real (non-boot) console is the first in the list + a boot console is later in the list Now, a real console might be first in the list only when: + It was the first registered console. In this case, there can't be any boot console because any later ones were rejected. + It was put at the first position because it had CON_CONSDEV flag set. It was either the preferred console or it was a console with tty binding registered by default. We are interested only in a real consoles here. And real console with tty binding fulfills conditions of the default console. Now, there is always only one console that is either preferred or fulfills conditions of the default console. It can't be already in the list and being registered at the same time. As a result, the above three conditions could newer be "true" at the same time. Therefore the behavior can't change. Final dilemma: OK, the new code has the same behavior. But is the change in the right direction? What if the handling of @console_drivers is updated in the future? OK, let's look at it from another angle: 1. The ordering of @console_drivers list is important only in console_device() function. The first console driver with tty binding gets associated with /dev/console. 2. CON_CONSDEV flag is shown in /proc/consoles. And it should be set for the driver that is returned by console_device(). 3. A boot console is removed and the duplicated output is prevented when the real console with CON_CONSDEV flag is registered. Now, in the ideal world: + The driver associated with /dev/console should be either a console preferred via the command line, device tree, or SPCR. Or it should be the first real console with tty binding registered by default. + The code should match the related boot and real console drivers. It should unregister only the obsolete boot driver. And the duplicated output should be prevented only on the related real driver. It is clear that it is not guaranteed by the current code. Instead, the current code looks like a maze of heuristics that try to achieve the above. It is result of adding several features over last few decades. For example, a possibility to register more consoles, unregister consoles, boot consoles, consoles without tty binding, device tree, SPCR, braille consoles. Anyway, there is no reason why the decision, about removing boot consoles and preventing duplicated output, should depend on the first console in the list. The current code does the decisions primary by CON_CONSDEV flag that is used for the preferred console. It looks like a good compromise. And the change seems to be in the right direction. Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20211122132649.12737-6-pmladek@suse.com commit 4f546939259f8e1130b60553433892774a42ea68 Author: Petr Mladek Date: Mon Nov 22 14:26:48 2021 +0100 printk/console: Remove need_default_console variable The variable @need_default_console is used to decide whether a newly registered console should get enabled by default. The logic is complicated. It can be modified in a register_console() call. But it is always re-evaluated in the next call by the following condition: if (need_default_console || bcon || !console_drivers) need_default_console = preferred_console < 0; In short, the value is updated when either of the condition is valid: + the value is still, or again, "true" + boot/early console is still the first in @console_driver list + @console_driver list is empty The value is updated according to @preferred_console. In particular, it is set to "false" when a @preferred_console was set by __add_preferred_console(). This happens when a non-braille console was added via the command line, device tree, or SPCR. It far from clear what this all means together. Let's look at @need_default_console from another angle: 1. The value is "true" by default. It means that it is always set according to @preferred_console during the first register_console() call. By other words, the first register_console() call will register the console by default only when none non-braille console was defined via the command line, device tree, or SPCR. 2. The value will always stay "false" when @preferred_console is set. By other words, try_enable_default_console() will never get called when a non-braille console is explicitly required. 4. The value might be set to "false" in try_enable_default_console() when a console with tty binding (driver) gets enabled. In this case CON_CONSDEV is set as well. It causes that the console will be inserted as first into the list @console_driver. It might be either real or boot/early console. 5. The value will be set _back_ to "true" in the next register_console() call when: + The console added by the previous register_console() had been a boot/early one. + The last console has been unregistered in the meantime and a boot/early console became first in @console_drivers list again. Or the list became empty. By other words, the value will stay "false" only when the last registered console was real, had tty binding, and was not removed in the mean time. The main logic looks clear: + Consoles are enabled by default only when no one is preferred via the command line, device tree, or SPCR. + By default, any console is enabled until a real console with tty binding gets registered. The behavior when the real console with tty binding is later removed is a bit unclear: + By default, any new console is registered again only when there is no console or the first console in the list is a boot one. The question is why the code is suddenly happy when a real console without tty binding is the first in the list. It looks like an overlook and bug. Conclusion: The state of @preferred_console and the first console in @console_driver list should be enough to decide whether we need to enable the given console by default. The rules are simple. New consoles are _not_ enabled by default when either of the following conditions is true: + @preferred_console is set. It means that a non-braille console is explicitly configured via the command line, device tree, or SPCR. + A real console with tty binding is registered. Such a console will have CON_CONSDEV flag set and will always be the first in @console_drivers list. Note: The new code does not use @bcon variable. The meaning of the variable is far from clear. The direct check of the first console in the list makes it more clear that only real console fulfills requirements of the default console. Behavior change: As already discussed above. There was one situation where the original code worked a strange way. Let's have: + console A: real console without tty binding + console B: real console with tty binding and do: register_console(A); /* 1st step */ register_console(B); /* 2nd step */ unregister_console(B); /* 3rd step */ register_console(B); /* 4th step */ The original code will not register the console B in the 4th step. @need_default_console is set to "false" in 2nd step. The real console with tty binding (driver) is then removed in the 3rd step. But @need_default_console will stay "false" in the 4th step because there is no boot/early console and @registered_consoles list is not empty. The new code will register the console B in the 4th step because it checks whether the first console has tty binding (->driver) This behavior change should acceptable: 1. The scenario requires manual intervention (console removal). The system should boot with the same consoles as before. 2. Console B is registered again probably because the user wants to use it. The most likely scenario is that the related module is reloaded. 3. It makes the behavior more consistent and predictable. Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20211122132649.12737-5-pmladek@suse.com commit f873efe841f813303e8a4af0d4cc48ff1f43bbe2 Author: Petr Mladek Date: Mon Nov 22 14:26:47 2021 +0100 printk/console: Remove unnecessary need_default_console manipulation There is no need to clear @need_default_console when a console preferred by the command line, device tree, or SPCR, gets enabled. The code is called only when some non-braille console matched a console in @console_cmdline array. It means that a non-braille console was added in __add_preferred_console() and the variable preferred_console is set to a number >= 0. As a result, @need_default_console is always set to "false" in the magic condition: if (need_default_console || bcon || !console_drivers) need_default_console = preferred_console < 0; This is one small step in removing the above magic condition that is hard to follow. The patch removes one superfluous assignment and should not change the functionality. Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20211122132649.12737-4-pmladek@suse.com commit a6953370d2fcf8c3878f1588771d20d3d972fcf3 Author: Petr Mladek Date: Mon Nov 22 14:26:46 2021 +0100 printk/console: Rename has_preferred_console to need_default_console The logic around the variable @has_preferred_console made my head spin many times. Part of the problem is the ambiguous name. There is the variable @preferred_console. It points to the last non-braille console in @console_cmdline array. This array contains consoles preferred via the command line, device tree, or SPCR. Then there is the variable @has_preferred_console. It is set to "true" when @preferred_console is enabled or when a console with tty binding gets enabled by default. It might get reset back by the magic condition: if (!has_preferred_console || bcon || !console_drivers) has_preferred_console = preferred_console >= 0; It is a puzzle. Dumb explanation is that it gets re-evaluated when: + it was not set before (see above when it gets set) + there is still an early console enabled (bcon) + there is no console enabled (!console_drivers) This is still a puzzle. It gets more clear when we see where the value is checked. The only meaning of the variable is to decide whether we should try to enable the new console by default. Rename the variable according to the single situation where the value is checked. The rename requires an inverted logic. Otherwise, it is a simple search & replace. It does not change the functionality. Signed-off-by: Petr Mladek Reviewed-by: Sergey Senozhatsky Link: https://lore.kernel.org/r/20211122132649.12737-3-pmladek@suse.com commit ed758b30d541e9bf713cd58612a4414e57dc6d73 Author: Petr Mladek Date: Mon Nov 22 14:26:45 2021 +0100 printk/console: Split out code that enables default console Put the code enabling a console by default into a separate function called try_enable_default_console(). Rename try_enable_new_console() to try_enable_preferred_console() to make the purpose of the different variants more clear. It is a code refactoring without any functional change. Signed-off-by: Petr Mladek Reviewed-by: Sergey Senozhatsky Link: https://lore.kernel.org/r/20211122132649.12737-2-pmladek@suse.com commit 52e68cd60ddf11802f5135921aba77c0833909a8 Author: Christophe JAILLET Date: Sat Nov 27 15:27:35 2021 +0100 vsprintf: Use non-atomic bitmap API when applicable The 'set' bitmap is local to this function. No concurrent access to it is possible. So prefer the non-atomic '__[set|clear]_bit()' function to save a few cycles. Signed-off-by: Christophe JAILLET Reviewed-by: Petr Mladek Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/1abf81a5e509d372393bd22041eed4ebc07ef9f7.1638023178.git.christophe.jaillet@wanadoo.fr commit 7b067ac63a5730d2fae18399fed7e45f23d36912 Author: Pali Rohár Date: Wed Nov 24 16:59:40 2021 +0100 PCI: pci-bridge-emul: Properly mark reserved PCIe bits in PCI config space Some bits in PCI config space are reserved when device is PCIe. Properly define behavior of PCI registers for PCIe emulated bridge and ensure that it would not be possible change these reserved bits. Link: https://lore.kernel.org/r/20211124155944.1290-3-pali@kernel.org Fixes: 23a5fba4d941 ("PCI: Introduce PCI bridge emulated config space common logic") Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi Cc: stable@vger.kernel.org commit 1c1a3b4d3e86b997a313ffb297c1129540882859 Author: Pali Rohár Date: Wed Nov 24 16:59:39 2021 +0100 PCI: pci-bridge-emul: Make expansion ROM Base Address register read-only If expansion ROM is unsupported (which is the case of pci-bridge-emul.c driver) then ROM Base Address register must be implemented as read-only register that return 0 when read, same as for unused Base Address registers. Link: https://lore.kernel.org/r/20211124155944.1290-2-pali@kernel.org Fixes: 23a5fba4d941 ("PCI: Introduce PCI bridge emulated config space common logic") Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi Cc: stable@vger.kernel.org commit 9abe2ac834851a7d0b0756e295cf7a292c45ca53 Author: Hector Martin Date: Sat Nov 20 12:13:43 2021 +0900 iommu/io-pgtable-arm: Fix table descriptor paddr formatting Table descriptors were being installed without properly formatting the address using paddr_to_iopte, which does not match up with the iopte_deref in __arm_lpae_map. This is incorrect for the LPAE pte format, as it does not handle the high bits properly. This was found on Apple T6000 DARTs, which require a new pte format (different shift); adding support for that to paddr_to_iopte/iopte_to_paddr caused it to break badly, as even <48-bit addresses would end up incorrect in that case. Fixes: 6c89928ff7a0 ("iommu/io-pgtable-arm: Support 52-bit physical address") Acked-by: Robin Murphy Signed-off-by: Hector Martin Link: https://lore.kernel.org/r/20211120031343.88034-1-marcan@marcan.st Signed-off-by: Joerg Roedel commit 556f99ac886635e8da15528995f06d1d7028cfca Author: Lu Baolu Date: Mon Nov 8 14:13:49 2021 +0800 iommu: Extend mutex lock scope in iommu_probe_device() Extend the scope of holding group->mutex so that it can cover the default domain check/attachment and direct mappings of reserved regions. Cc: Ashish Mhetre Fixes: 211ff31b3d33b ("iommu: Fix race condition during default domain allocation") Signed-off-by: Lu Baolu Link: https://lore.kernel.org/r/20211108061349.1985579-1-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel commit 549bf94dd29f6373154ff731d4a48e396f543363 Author: Krzysztof Wilczyński Date: Wed Oct 27 11:29:31 2021 +0000 PCI: qcom-ep: Remove surplus dev_err() when using platform_get_irq_byname() There is no need to call the dev_err() function directly to print a custom message when handling an error from either the platform_get_irq() or platform_get_irq_byname() functions as both are going to display an appropriate error message in case of a failure. This change is as per suggestions from Coccinelle, e.g., drivers/pci/controller/dwc/pcie-qcom-ep.c:556:2-9: line 556 is redundant because platform_get_irq() already prints an error Related: https://lore.kernel.org/all/20210310131913.2802385-1-kw@linux.com/ https://lore.kernel.org/all/20200802142601.1635926-1-kw@linux.com/ Link: https://lore.kernel.org/r/20211027112931.37182-1-kw@linux.com Signed-off-by: Krzysztof Wilczyński Signed-off-by: Lorenzo Pieralisi commit 94aedac49d92b22995d7b9092c6551b8b9924320 Author: Dafna Hirschfeld Date: Thu Nov 4 09:16:20 2021 +0200 iommu: Log iova range in map/unmap trace events In case of an iommu page fault, the faulting iova is logged in trace_io_page_fault. It is therefore convenient to log the iova range in mapping/unmapping trace events so that it is easier to see if the faulting iova was recently in any of those ranges. Signed-off-by: Dafna Hirschfeld Link: https://lore.kernel.org/r/20211104071620.27290-1-dafna.hirschfeld@collabora.com Signed-off-by: Joerg Roedel commit 75d36df6807838f3c826c21c0fa51cdc079667d1 Author: Hector Martin Date: Wed Nov 17 23:00:44 2021 +0900 PCI: apple: Fix REFCLK1 enable/poll logic REFCLK1 has req/ack bits that need to be programmed, just like REFCLK0. Link: https://lore.kernel.org/r/20211117140044.193865-1-marcan@marcan.st Fixes: 1e33888fbe44 ("PCI: apple: Add initial hardware bring-up") Signed-off-by: Hector Martin Signed-off-by: Lorenzo Pieralisi Acked-by: Marc Zyngier commit 3f13d611aa6be3a500d696b0699938dcb39a9887 Author: Manivannan Sadhasivam Date: Tue Nov 30 13:39:24 2021 +0530 PCI: qcom: Use __be16 type to store return value from cpu_to_be16() cpu_to_be16() returns __be16 value but the driver uses u16 and that's incorrect. Fix it by using __be16 as the data type of bdf_be variable. The issue was spotted by the below sparse warning: sparse warnings: (new ones prefixed by >>) >> drivers/pci/controller/dwc/pcie-qcom.c:1305:30: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned short [usertype] bdf_be @@ got restricted __be16 [usertype] @@ drivers/pci/controller/dwc/pcie-qcom.c:1305:30: sparse: expected unsigned short [usertype] bdf_be drivers/pci/controller/dwc/pcie-qcom.c:1305:30: sparse: got restricted __be16 [usertype] Link: https://lore.kernel.org/r/20211130080924.266116-1-manivannan.sadhasivam@linaro.org Reported-by: kernel test robot Signed-off-by: Manivannan Sadhasivam Signed-off-by: Lorenzo Pieralisi Reviewed-by: Krzysztof Wilczyński commit 2070b2ddea89f5b604fac3d27ade5cb6d19a5706 Author: Pali Rohár Date: Thu Nov 25 17:01:47 2021 +0100 PCI: aardvark: Fix checking for MEM resource type IORESOURCE_MEM_64 is not a resource type but a type flag. Remove incorrect check for type IORESOURCE_MEM_64. Link: https://lore.kernel.org/r/20211125160148.26029-2-kabel@kernel.org Fixes: 64f160e19e92 ("PCI: aardvark: Configure PCIe resources from 'ranges' DT property") Signed-off-by: Pali Rohár Signed-off-by: Marek Behún Signed-off-by: Lorenzo Pieralisi commit 86a9bb5bf9f610ea6baa855b4f46ecea92876ea4 Author: Takashi Iwai Date: Thu Dec 2 09:40:53 2021 +0100 ALSA: usb-audio: Drop CONFIG_PM ifdefs Practically seen, CONFIG_PM is almost mandatory. Let's drop the ugly ifdef lines and simplify the code. Link: https://lore.kernel.org/r/20211202084053.18201-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 82cd3ba691a920007503d189989d2495a41a3a10 Author: Bernard Zhao Date: Sun Dec 5 17:40:46 2021 -0800 ALSA: oss: remove useless NULL check before kfree Tis patch try to remove useless NULL check before kfree Signed-off-by: Bernard Zhao Link: https://lore.kernel.org/r/20211206014135.320720-1-bernard@vivo.com Signed-off-by: Takashi Iwai commit d13a8f6d8e01a17a9fe36029e346a1f029362c9e Author: Christophe JAILLET Date: Sat Dec 4 08:28:40 2021 +0100 ALSA: Fix some typo Some comments and include guards are not consistent with the name of the file where they can be found. This is likely some typo or cut'n'paste issues. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/7b2bcbda298f02a34d46d8b6593daaaed9a09a45.1638602790.git.christophe.jaillet@wanadoo.fr Signed-off-by: Takashi Iwai commit 71d5049b053876afbde6c3273250b76935494ab2 Author: Joerg Roedel Date: Thu Dec 2 16:32:25 2021 +0100 x86/mm: Flush global TLB when switching to trampoline page-table Move the switching code into a function so that it can be re-used and add a global TLB flush. This makes sure that usage of memory which is not mapped in the trampoline page-table is reliably caught. Also move the clearing of CR4.PCIDE before the CR3 switch because the cr4_clear_bits() function will access data not mapped into the trampoline page-table. Signed-off-by: Joerg Roedel Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20211202153226.22946-4-joro@8bytes.org commit f154f290855b070cc94dd44ad253c0ef8a9337bb Author: Joerg Roedel Date: Thu Dec 2 16:32:24 2021 +0100 x86/mm/64: Flush global TLB on boot and AP bringup The AP bringup code uses the trampoline_pgd page-table which establishes global mappings in the user range of the address space. Flush the global TLB entries after the indentity mappings are removed so no stale entries remain in the TLB. Signed-off-by: Joerg Roedel Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20211202153226.22946-3-joro@8bytes.org commit 9429f4b0412d05243237c7695c59d0a7b1174492 Author: Will Deacon Date: Thu Dec 2 17:10:48 2021 +0000 KVM: arm64: Move host EL1 code out of hyp/ directory kvm/hyp/reserved_mem.c contains host code executing at EL1 and is not linked into the hypervisor object. Move the file into kvm/pkvm.c and rework the headers so that the definitions shared between the host and the hypervisor live in asm/kvm_pkvm.h. Signed-off-by: Will Deacon Tested-by: Fuad Tabba Reviewed-by: Fuad Tabba Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211202171048.26924-4-will@kernel.org commit ed4ed15d571065eb66ea718d7f6050553586417d Author: Will Deacon Date: Thu Dec 2 17:10:47 2021 +0000 KVM: arm64: Generate hyp_constants.h for the host In order to avoid exposing hypervisor (EL2) data structures directly to the host, generate hyp_constants.h to provide constants such as structure sizes to the host without dragging in the definitions themselves. Signed-off-by: Will Deacon Tested-by: Fuad Tabba Reviewed-by: Fuad Tabba Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211202171048.26924-3-will@kernel.org commit 7e04f05984dd03edad7daaa4fa97958b7133c62a Author: Will Deacon Date: Thu Dec 2 17:10:46 2021 +0000 arm64: Add missing include of asm/cpufeature.h to asm/mmu.h asm/mmu.h refers to cpus_have_const_cap() in the definition of arm64_kernel_unmapped_at_el0() so include asm/cpufeature.h directly rather than force all users of the header to do it themselves. Signed-off-by: Will Deacon Tested-by: Fuad Tabba Reviewed-by: Fuad Tabba Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211202171048.26924-2-will@kernel.org commit 636dcd0204599f94680f8f87b46cef7c66034ac0 Author: Rikard Falkeborn Date: Sat Dec 4 22:35:18 2021 +0100 KVM: arm64: Constify kvm_io_gic_ops The only usage of kvm_io_gic_ops is to make a comparison with its address and to pass its address to kvm_iodevice_init() which takes a pointer to const kvm_io_device_ops as input. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211204213518.83642-1-rikard.falkeborn@gmail.com commit f5bced9f34355d2b12779eebdf2634cb27c18cff Merge: 13a5fad39a7b7 0fcfb00b28c0b Author: Greg Kroah-Hartman Date: Mon Dec 6 09:32:47 2021 +0100 Merge 5.16-rc4 into tty-next We need the tty/serial driver fixes in here as well. Signed-off-by: Greg Kroah-Hartman commit d598c3c46ea69ea974f0613a651cd4ef3be0c870 Merge: 9899aa5ba525c 0fcfb00b28c0b Author: Greg Kroah-Hartman Date: Mon Dec 6 09:31:18 2021 +0100 Merge 5.16-rc4 into usb-next We need the USB fixes in here as well. Signed-off-by: Greg Kroah-Hartman commit 3ff0810ffc4793bfde454a452837484d0815aa14 Author: Jagan Teki Date: Fri Dec 3 22:24:35 2021 +0530 ARM: dts: stm32: Add Engicam i.Core STM32MP1 C.TOUCH 2.0 10.1" OF Engicam C.TOUCH 2.0 is an EDIMM compliant general purpose Carrier board. Genaral features: - Ethernet 10/100 - Wifi/BT - USB Type A/OTG - Audio Out - CAN - 10" LVDS Panel (SN65DSI84 DSI-LVDS bridge on SoM) i.Core STM32MP1 is an EDIMM SoM based on STM32MP157A from Engicam. 10.1" OF is a capacitive touch 10.1" Open Frame panel solutions. i.Core STM32MP1 needs to mount on top of C.TOUCH 2.0 carrier with pluged 10.1" OF for creating complete i.Core STM32MP1 C.TOUCH 2.0 10.1" Open Frame board. Add support for it. Signed-off-by: Jagan Teki Signed-off-by: Alexandre Torgue commit 854b020b165fbdf040ab6872a75a6094803a6932 Author: Jagan Teki Date: Fri Dec 3 22:24:34 2021 +0530 dt-bindings: arm: stm32: Add Engicam i.Core STM32MP1 C.TOUCH 2.0 10.1" OF i.Core STM32MP1 is an EDIMM SoM based on STM32MP157A from Engicam. C.TOUCH 2.0 is a general purpose carrier board with capacitive touch interface support. 10.1" OF is a capacitive touch 10.1" Open Frame panel solutions. i.Core STM32MP1 needs to mount on top of C.TOUCH 2.0 carrier with pluged 10.1" OF for creating complete i.Core STM32MP1 C.TOUCH 2.0 10.1" Open Frame board. Add bindings for it. Signed-off-by: Jagan Teki Acked-by: Rob Herring Signed-off-by: Alexandre Torgue commit 856732adc1acbfdf457ec7a875a252d6fb039294 Author: Jagan Teki Date: Fri Dec 3 22:24:33 2021 +0530 ARM: dts: stm32: Enable LVDS panel on i.Core STM32MP1 EDIMM2.2 Engicam i.Core STM32MP1 EDIMM2.2 Starter Kit has plugged with 7" LVDS panel. Engicam i.Core STM32MP1 SoM has SN65DSI84 DSI to LVDS bridge. This patch adds a display pipeline to connect DSI to SN65DSI84 to 7" LVDS panel. Signed-off-by: Jagan Teki Signed-off-by: Alexandre Torgue commit 8697c410457fbc50169d2c7db4a7eef9b58924a9 Author: Arnd Bergmann Date: Sat Dec 4 18:46:23 2021 +0100 drm: aspeed: select CONFIG_DRM_GEM_CMA_HELPER The aspeed driver uses the gem_cma_helper code, but does noto enforce enabling this through Kconfig: x86_64-linux-ld: drivers/gpu/drm/aspeed/aspeed_gfx_drv.o:(.rodata+0x2c8): undefined reference to `drm_gem_cma_prime_import_sg_table' x86_64-linux-ld: drivers/gpu/drm/aspeed/aspeed_gfx_drv.o:(.rodata+0x2d8): undefined reference to `drm_gem_cma_dumb_create' x86_64-linux-ld: drivers/gpu/drm/aspeed/aspeed_gfx_crtc.o: in function `aspeed_gfx_pipe_update': aspeed_gfx_crtc.c:(.text+0xe5): undefined reference to `drm_fb_cma_get_gem_obj' Add the same 'select' that is used in other such drivers. Fixes: 09717af7d13d ("drm: Remove CONFIG_DRM_KMS_CMA_HELPER option") Signed-off-by: Arnd Bergmann Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20211204174637.1160725-2-arnd@kernel.org commit 9c65ab78bfc9e49d10f931f9997e165a10c39734 Author: Arnd Bergmann Date: Sat Dec 4 18:46:22 2021 +0100 drm: fsl-dcu: select CONFIG_DRM_GEM_CMA_HELPER The fsl-dcu driver uses the gem_cma_helper code, but does noto enforce enabling this through Kconfig: arm-linux-gnueabi-ld: drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.o:(.rodata+0x32c): undefined reference to `drm_gem_cma_prime_import_sg_table' arm-linux-gnueabi-ld: drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.o:(.rodata+0x334): undefined reference to `drm_gem_cma_dumb_create' arm-linux-gnueabi-ld: drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.o: in function `fsl_dcu_drm_plane_atomic_update': fsl_dcu_drm_plane.c:(.text+0x144): undefined reference to `drm_fb_cma_get_gem_obj' Add the same 'select' that is used in other such drivers. Fixes: 09717af7d13d ("drm: Remove CONFIG_DRM_KMS_CMA_HELPER option") Signed-off-by: Arnd Bergmann Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20211204174637.1160725-1-arnd@kernel.org commit 8858f8622e82170ec184971b66c7a455816190f8 Author: Sam Protsenko Date: Sat Dec 4 23:58:20 2021 +0200 arm64: dts: exynos: Rename hsi2c nodes to i2c for Exynos5433 and Exynos7 In Device Tree specification it's recommended to use "i2c" name for I2C nodes. Now that i2c-exynos5 dt-schema binding was added, it shows some warnings like this when validating HS-I2C nodes: hsi2c@xxxxxxxxx: $nodename:0: 'hsi2c@xxxxxxxx' does not match '^i2c(@.*)?' From schema: Documentation/devicetree/bindings/i2c/i2c-exynos5.yaml Rename hsi2c@* to i2c@* to fix those warnings. Signed-off-by: Sam Protsenko Link: https://lore.kernel.org/r/20211204215820.17378-9-semen.protsenko@linaro.org Signed-off-by: Krzysztof Kozlowski commit 29bf0ff5ae18ad1a6dd183569cc097e578052c57 Author: Sam Protsenko Date: Sat Dec 4 23:58:19 2021 +0200 ARM: dts: exynos: Rename hsi2c nodes to i2c for Exynos5260 In Device Tree specification it's recommended to use "i2c" name for I2C nodes. Now that i2c-exynos5 dt-schema binding was added, it shows some warnings like this when validating HS-I2C nodes: hsi2c@xxxxxxxxx: $nodename:0: 'hsi2c@xxxxxxxx' does not match '^i2c(@.*)?' From schema: Documentation/devicetree/bindings/i2c/i2c-exynos5.yaml Rename hsi2c@* to i2c@* to fix those warnings. Signed-off-by: Sam Protsenko Link: https://lore.kernel.org/r/20211204215820.17378-8-semen.protsenko@linaro.org Signed-off-by: Krzysztof Kozlowski commit 2ecc02a6b3f0e2a4339952c4f8b86a4d87876930 Author: Alexander Stein Date: Wed Dec 1 08:29:44 2021 +0100 arm64: defconfig: enable drivers for TQ TQMa8MxML-MBa8Mx With the device tree in place, enable missing drivers as modules, if possible. PHY driver needs built-in for interrupt support. Signed-off-by: Alexander Stein Signed-off-by: Shawn Guo commit b186b8b6e770570706f533dcf4c70b39e9ee31d2 Author: Alexander Stein Date: Wed Dec 1 08:29:48 2021 +0100 arm64: dts: freescale: add initial device tree for TQMa8Mx with i.MX8M This adds support for TQMa8Mx module on MBa8Mx board. Signed-off-by: Alexander Stein Signed-off-by: Shawn Guo commit 3e56e354db6d34b211fc76b3ac228fc3613663d3 Author: Alexander Stein Date: Wed Dec 1 08:29:46 2021 +0100 arm64: dts: freescale: add initial device tree for TQMa8MQNL with i.MX8MN This adds support for TQMa8MQNL module on MBa8Mx board. Signed-off-by: Alexander Stein Signed-off-by: Shawn Guo commit dfcd1b6f7620eef1f0060b64408c05419297456a Author: Alexander Stein Date: Wed Dec 1 08:29:43 2021 +0100 arm64: dts: freescale: add initial device tree for TQMa8MQML with i.MX8MM This adds support for TQMa8MQML module on MBa8Mx board. Signed-off-by: Alexander Stein Signed-off-by: Shawn Guo commit 9aa637b5673ca100f219b13b16dbc19a0b77ef73 Author: Alexander Stein Date: Wed Dec 1 08:29:47 2021 +0100 dt-bindings: arm: fsl: add TQMa8Mx boards TQMa8Mx is a SOM family using NXP i.MX8M[Q,QL, D] CPU MBa8Mx is a evaluation mainbord for this SOM The SOM needs a mainboard, therefore we provide two compatibles here: "tq,imx8mq-" for the module and "tq,imx8mq--" for the module on that mainboard Signed-off-by: Alexander Stein Acked-by: Rob Herring Signed-off-by: Shawn Guo commit 50ef92d89c12809fe8f98d0e0cab7b6765e10898 Author: Alexander Stein Date: Wed Dec 1 08:29:45 2021 +0100 dt-bindings: arm: fsl: add TQMa8MxNL boards TQMa8MxNL is a SOM family using NXP i.MX8MN[Q,QL,DL,S,SL] CPU MBa8Mx is an evaluation mainbord for this SOM The SOM needs a mainboard, therefore we provide two compatibles here: "tq,imx8mn-" for the module and "tq,imx8mn--" for mainboards Signed-off-by: Alexander Stein Acked-by: Rob Herring Signed-off-by: Shawn Guo commit ee6302d90db96e1f0a49305ba9db4969b378d585 Author: Alexander Stein Date: Wed Dec 1 08:29:42 2021 +0100 dt-bindings: arm: fsl: add TQMa8MxML boards TQMa8MxML is a SOM family using NXP i.MX8MM[Q,QL,DL,S,SL] CPU MBa8Mx is an evaluation mainbord for this SOM The SOM needs a mainboard, therefore we provide two compatibles here: "tq,imx8mm-" for the module and "tq,imx8mm--" for the module on that mainboard Signed-off-by: Alexander Stein Acked-by: Rob Herring Signed-off-by: Shawn Guo commit a6e917b7366c5d91accafa2b7b45090e6b632987 Author: Jacky Bai Date: Fri Nov 26 15:40:02 2021 +0800 arm64: dts: imx8ulp: Add the basic dts for imx8ulp evk board Add the basic dts file for i.MX8ULP EVK board. Only the necessary devices for minimal system boot up are enabled: enet, emmc, usb, console uart. some of the devices' pin status may lost during low power mode, so additional sleep pinctrl properties are included by default. Reviewed-by: Dong Aisheng Signed-off-by: Jacky Bai Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit fe6291e963134d3609defff4547beeb2bb5bf158 Author: Jacky Bai Date: Fri Nov 26 15:40:01 2021 +0800 arm64: dts: imx8ulp: Add the basic dtsi file for imx8ulp Add the basic dtsi support for i.MX8ULP. i.MX 8ULP is part of the ULP family with emphasis on extreme low-power techniques using the 28 nm fully depleted silicon on insulator process. Like i.MX 7ULP, i.MX 8ULP continues to be based on asymmetric architecture, however will add a third DSP domain for advanced voice/audio capability and a Graphics domain where it is possible to access graphics resources from the application side or the realtime side. Reviewed-by: Dong Aisheng Signed-off-by: Jacky Bai Signed-off-by: Peng Fan Reviewed-by: Rob Herring Signed-off-by: Shawn Guo commit 8355d48fd1ec1c01b5ab1f8071562cf3e3884214 Author: Jacky Bai Date: Fri Nov 26 15:40:00 2021 +0800 dt-bindings: arm: fsl: Add binding for imx8ulp evk Add the dt binding for i.MX8ULP EVK board. i.MX 8ULP is part of the ULP family with emphasis on extreme low-power techniques using the 28 nm fully depleted silicon on insulator process. Like i.MX 7ULP, i.MX 8ULP continues to be based on asymmetric architecture, however will add a third DSP domain for advanced voice/audio capability and a Graphics domain where it is possible to access graphics resources from the application side or the realtime side. Reviewed-by: Dong Aisheng Acked-by: Rob Herring Signed-off-by: Jacky Bai Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit 5fe375728983b3fca6b958434a2e3f547bbbb2aa Author: Xiu Jianfeng Date: Thu Dec 2 15:35:33 2021 +0800 selinux: Use struct_size() helper in kmalloc() Make use of struct_size() helper instead of an open-coded calculation. Link: https://github.com/KSPP/linux/issues/160 Signed-off-by: Xiu Jianfeng Signed-off-by: Paul Moore commit 8791aa1891a9b35fabde693eed597f32dbbeb963 Author: Adam Ford Date: Sun Nov 28 06:50:11 2021 -0600 arm64: defconfig: Enable OV5640 The Beacon EmbeddedWorks imx8mm development kit has a TD Next 5640 Camera. Enable the OV5640 driver to use the camera. Signed-off-by: Adam Ford Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 7306251b1e99a5e765b84ca2bd3ce3a43a39a454 Author: Adam Ford Date: Sun Nov 28 06:50:09 2021 -0600 arm64: defconfig: Enable VIDEO_IMX_MEDIA To use a camera, the CSIS and CSI drivers need to be enabled with VIDEO_IMX_MEDIA. Signed-off-by: Adam Ford Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 9f046930657e9e231a2f9139cdcb611805b19d7c Author: Adam Ford Date: Sun Nov 28 06:50:10 2021 -0600 arm64: dts: imx8mm-beacon: Enable OV5640 Camera The baseboard has support for a TDNext 5640 Camera which uses an OV5640 connected to a 2-lane CSI2 interface. With the CSI and mipi_csi2 drivers pointing to an OV5640 camera, the media pipeline can be configured with the following: media-ctl --links "'ov5640 1-003c':0->'imx7-mipi-csis.0':0[1]" The camera and various nodes in the pipeline can be configured for UYVY: media-ctl -v -V "'ov5640 1-003c':0 [fmt:UYVY8_1X16/640x480 field:none]" media-ctl -v -V "'csi':0 [fmt:UYVY8_1X16/640x480 field:none]" Signed-off-by: Adam Ford Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit e523b7c54c05caec488cc062f0b6c497b1837ed6 Author: Adam Ford Date: Sun Nov 28 06:50:08 2021 -0600 arm64: dts: imx8mm: Add CSI nodes There is a csi bridge and csis interface that tie together to allow csi2 capture. Signed-off-by: Adam Ford Reviewed-by: Laurent Pinchart Reviewed-by: Tim Harvey Tested-by: Tim Harvey Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 474b61a7106b4b5b29eb2d98b0c2ba1e675019d5 Author: David Heidelberg Date: Sat Nov 27 14:01:18 2021 +0100 arm64: dts: imx8mq: fix the schema check errors for fsl,tmu-calibration fsl,tmu-calibration is in u32-matrix. Use matching property syntax. No functional changes. Fixes warnings as: $ make dtbs_check ... arch/arm64/boot/dts/freescale/imx8mq-librem5-r3.dt.yaml: tmu@30260000: \ fsl,tmu-calibration:0: Additional items are not allowed (1, 41, 2, 47, \ 3, 53, 4, 61, 5, 67, 6, 75, 7, 81, 8, 87, 9, 95, 10, 103, 11, 111, 65536, \ 27, 65537, 35, 65538, 43, 65539, 51, 65540, 59, 65541, 67, 65542, 75, \ 65543, 85, 65544, 93, 65545, 103, 65546, 112, 131072, 23, 131073, 35, \ 131074, 45, 131075, 55, 131076, 65, 131077, 75, 131078, 87, 131079, 99, \ 131080, 111, 196608, 21, 196609, 33, 196610, 45, 196611, 57, 196612, 69, \ 196613, 83, 196614, 95, 196615, 113 were unexpected) From schema: Documentation/devicetree/bindings/thermal/qoriq-thermal.yaml ... Signed-off-by: David Heidelberg Signed-off-by: Shawn Guo commit 4172986a64dae744abe625075533ce38f6670019 Author: Kuldeep Singh Date: Wed Nov 24 14:32:14 2021 +0530 arm64: dts: lx2162a: Add CAN nodes for LX2162A-QDS Enable CAN support for LX2162A-QDS in board dts. Signed-off-by: Kuldeep Singh Signed-off-by: Shawn Guo commit 019cd8a9e3bcbbf6bac8036a9ae545f7858e0c08 Author: Jonathan Corbet Date: Tue Nov 2 16:02:01 2021 -0600 ARM: ixp4xx: remove unused header file pata_ixp4xx_cf.h Commit b00ced38e317 ("ARM: ixp4xx: Delete Avila boardfiles") removed the last use of but left the header file in place. Nothing uses this file, delete it now. Cc: Linus Walleij Cc: Arnd Bergmann Signed-off-by: Jonathan Corbet Acked-by: Arnd Bergmann Signed-off-by: Linus Walleij commit 6786e78d6b7a7236df7ded9ae0e09fa1cba950fb Author: Lukas Bulwahn Date: Thu Oct 28 16:19:31 2021 +0200 ARM: ixp4xx: remove dead configs CPU_IXP43X and CPU_IXP46X Commit 73d04ca5f4ac ("ARM: ixp4xx: Delete Intel reference design boardfiles") removes the definition of the configs MACH_IXDP465 and MACH_KIXRP435, but misses to remove the configs CPU_IXP43X and CPU_IXP46X that depend on those removed configs, and hence are dead now. Fortunately, ./scripts/checkkconfigsymbols.py warns: MACH_IXDP465 Referencing files: arch/arm/mach-ixp4xx/Kconfig MACH_KIXRP435 Referencing files: arch/arm/mach-ixp4xx/Kconfig Remove the dead configs CPU_IXP43X and CPU_IXP46X. A further quick grep for the name of those two symbols did not show any use of the two config symbols; so, there are no further clean-up activities beyond this config removal needed. Signed-off-by: Lukas Bulwahn Reviewed-by: Arnd Bergmann Signed-off-by: Linus Walleij commit 65248dde81528d7f6cdd091e397d2d6e0b49dae1 Author: Linus Walleij Date: Thu Jul 29 01:34:39 2021 +0200 ARM: dts: Add Goramo MultiLink device tree This adds a device tree for the Goramo MultiLink IXP425-based WAN router. Cc: Krzysztof Hałasa Cc: openwrt-devel@lists.openwrt.org Signed-off-by: Linus Walleij commit c25b80c560b8a2bb9ca60155553abff6223c73a8 Author: Linus Walleij Date: Mon Nov 22 11:22:28 2021 +0100 ARM: dts: Add FSG3 system controller and LEDs This adds the system controller on CS2 and the LEDs on it. Signed-off-by: Linus Walleij commit 97164c0419fc3985921f9be4c235748a68f9095e Author: Michal Vokáč Date: Mon Nov 22 17:25:19 2021 +0100 dt-bindings: arm: fsl: Add Y Soft IOTA Crux/Crux+ boards Add devicetree binding for Crux/Crux+ boards from the IOTA family. These boards have the very same HW configuration as the Orion board except the usage of Quad/QuadPlus SoC. Signed-off-by: Michal Vokáč Acked-by: Rob Herring Signed-off-by: Shawn Guo commit 5a759dac6503e1432f5c30a01df483608b500a54 Author: Matthias Schiffer Date: Mon Nov 22 12:37:38 2021 +0100 dt-bindings: arm: fsl: add TQ-Systems boards based on i.MX6Q/QP/DL The TQ-Systems MBa6x mainboard can be used with TQMa6 variants with i.MX6Q/QP/DL SoCs (TQMa6Q/QP/DL). The TQMa6Q and DL exist in two variants: The newer variants "A" have a hardware workaround for Erratum ERR006687, while variants "B" are missing such a workaround, so it needs to be handled in software. The erratum was fixed in i.MX6QP, so no "A" variant of the TQMa6QP exists. Signed-off-by: Matthias Schiffer Reviewed-by: Rob Herring Signed-off-by: Shawn Guo commit ef3846247b41391434c23fcd9560daa57d14bb7a Author: Markus Niebel Date: Mon Nov 22 12:37:40 2021 +0100 ARM: dts: imx6qdl: add TQ-Systems MBa6x device trees Add device trees for the MBa6x mainboard with TQMa6Q/QP/DL SoMs. As discussed, all new files are added with GPL-2.0-only license, as they are too tightly intertwined with the SoC DTSIs imx6dl.dtsi and imx6q.dtsi, which are GPL-2.0. Signed-off-by: Markus Niebel Signed-off-by: Matthias Schiffer Signed-off-by: Shawn Guo commit 2439d70c52c51f991b00b0ae5644e96033bd8165 Author: Matthias Schiffer Date: Mon Nov 22 12:37:39 2021 +0100 ARM: dts: imx6qdl-tqma6: add ERR006687 hardware workaround for "a" variant The TQMa6x "a" has a workaround for ERR006687 implemented in hardware. Add the required pinmuxing and related setup to make use of this. As board DTS files based on the TQMa6x SoMs will define their own pinmuxing for the FEC ethernet controller as well, we can't apply this pin group unconditionally; instead, it is the responsibility of the board DTs derived from imx6qdl-tqma6a.dtsi to include this group. Signed-off-by: Matthias Schiffer Signed-off-by: Shawn Guo commit 2db0624b78c42abe1bcada7dd62068ef978e1e35 Author: Oleksij Rempel Date: Mon Nov 22 11:19:17 2021 +0100 ARM: dts: add JOZ Access Point JOZ Access Point is imx6ull based device designed for agricultural cleaning machines. Signed-off-by: Oleksij Rempel Signed-off-by: Shawn Guo commit 74fb79574d26fc79a04e5a75e137317870843e7d Author: Oleksij Rempel Date: Mon Nov 22 11:19:16 2021 +0100 dt-bindings: arm: fsl: add JOZ Access Point Add imx6ull based JOZ Access Point. Signed-off-by: Oleksij Rempel Acked-by: Rob Herring Signed-off-by: Shawn Guo commit 3e63d6a197d57f94abff0fbd71efd8f98e254e1c Author: Oleksij Rempel Date: Mon Nov 22 11:19:15 2021 +0100 dt-bindings: vendor-prefixes: Add an entry for JOZ BV Add "joz" entry for JOZ BV: https://joz.nl/en/about-joz/ Signed-off-by: Oleksij Rempel Acked-by: Rob Herring Signed-off-by: Shawn Guo commit 942df4dc5ea159100466f198d8687a49c2359ca3 Author: Alexei Starovoitov Date: Sat Dec 4 11:46:23 2021 -0800 bpftool: Add debug mode for gen_loader. Make -d flag functional for gen_loader style program loading. For example: $ bpftool prog load -L -d test_d_path.o ... // will print: libbpf: loading ./test_d_path.o libbpf: elf: section(3) fentry/security_inode_getattr, size 280, link 0, flags 6, type=1 ... libbpf: prog 'prog_close': found data map 0 (test_d_p.bss, sec 7, off 0) for insn 30 libbpf: gen: load_btf: size 5376 libbpf: gen: map_create: test_d_p.bss idx 0 type 2 value_type_id 118 libbpf: map 'test_d_p.bss': created successfully, fd=0 libbpf: gen: map_update_elem: idx 0 libbpf: sec 'fentry/filp_close': found 1 CO-RE relocations libbpf: record_relo_core: prog 1 insn[15] struct file 0:1 final insn_idx 15 libbpf: gen: prog_load: type 26 insns_cnt 35 progi_idx 0 libbpf: gen: find_attach_tgt security_inode_getattr 12 libbpf: gen: prog_load: type 26 insns_cnt 37 progi_idx 1 libbpf: gen: find_attach_tgt filp_close 12 libbpf: gen: finish 0 ... // at this point libbpf finished generating loader program 0: (bf) r6 = r1 1: (bf) r1 = r10 2: (07) r1 += -136 3: (b7) r2 = 136 4: (b7) r3 = 0 5: (85) call bpf_probe_read_kernel#113 6: (05) goto pc+104 ... // this is the assembly dump of the loader program 390: (63) *(u32 *)(r6 +44) = r0 391: (18) r1 = map[idx:0]+5584 393: (61) r0 = *(u32 *)(r1 +0) 394: (63) *(u32 *)(r6 +24) = r0 395: (b7) r0 = 0 396: (95) exit err 0 // the loader program was loaded and executed successfully (null) func#0 @0 ... // CO-RE in the kernel logs: CO-RE relocating STRUCT file: found target candidate [500] prog '': relo #0: kind (0), spec is [8] STRUCT file.f_path (0:1 @ offset 16) prog '': relo #0: matching candidate #0 [500] STRUCT file.f_path (0:1 @ offset 16) prog '': relo #0: patched insn #15 (ALU/ALU64) imm 16 -> 16 vmlinux_cand_cache:[11]file(500), module_cand_cache: ... // verifier logs when it was checking test_d_path.o program: R1 type=ctx expected=fp 0: R1=ctx(id=0,off=0,imm=0) R10=fp0 ; int BPF_PROG(prog_close, struct file *file, void *id) 0: (79) r6 = *(u64 *)(r1 +0) func 'filp_close' arg0 has btf_id 500 type STRUCT 'file' 1: R1=ctx(id=0,off=0,imm=0) R6_w=ptr_file(id=0,off=0,imm=0) R10=fp0 ; pid_t pid = bpf_get_current_pid_tgid() >> 32; 1: (85) call bpf_get_current_pid_tgid#14 ... // if there are multiple programs being loaded by the loader program ... // only the last program in the elf file will be printed, since ... // the same verifier log_buf is used for all PROG_LOAD commands. Signed-off-by: Alexei Starovoitov Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211204194623.27779-1-alexei.starovoitov@gmail.com commit ad2c302bc6049c56c85cc2b64a0b4bd8e7ffdc56 Author: Randy Dunlap Date: Tue Nov 30 19:09:13 2021 -0800 EDAC/sifive: Fix non-kernel-doc comment scripts/kernel-doc complains about a comment that begins with "/**" but is not in kernel-doc format, so correct it. Prevents this warning: drivers/edac/sifive_edac.c:23: warning: This comment starts with '/**', \ but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * EDAC error callback Fixes: 91abaeaaff35 ("EDAC/sifive: Add EDAC platform driver for SiFive SoCs") Reported-by: kernel test robot Signed-off-by: Randy Dunlap Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20211201030913.10283-1-rdunlap@infradead.org commit a90c8bf6590676035336ae98cc51bce1aeb96c33 Author: Pavel Begunkov Date: Sun Dec 5 14:38:00 2021 +0000 io_uring: reuse io_req_task_complete for timeouts With kbuf unification io_req_task_complete() is now a generic function, use it for timeout's tw completions. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/7142fa3cbaf3a4140d59bcba45cbe168cf40fac2.1638714983.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 83a13a4181b0e874d1f196e11b953c3c9f009f68 Author: Pavel Begunkov Date: Sun Dec 5 14:37:59 2021 +0000 io_uring: tweak iopoll CQE_SKIP event counting When iopolling the userspace specifies the minimum number of "events" it expects. Previously, we had one CQE per request, so the definition of an "event" was unequivocal, but that's not more the case anymore with REQ_F_CQE_SKIP. Currently it counts the number of completed requests, replace it with the number of posted CQEs. This allows users of the "one CQE per link" scheme to wait for all N links in a single syscall, which is not possible without the patch and requires extra context switches. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/d5a965c4d2249827392037bbd0186f87fea49c55.1638714983.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit d1fd1c201d750711e17377acb4914d3ea29a608c Author: Pavel Begunkov Date: Sun Dec 5 14:37:58 2021 +0000 io_uring: simplify selected buf handling As selected buffers are now stored in a separate field in a request, get rid of rw/recv specific helpers and simplify the code. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/bd4a866d8d91b044f748c40efff9e4eacd07536e.1638714983.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 3648e5265cfa51492a65ee5a01f151807ec46dee Author: Hao Xu Date: Sun Dec 5 14:37:57 2021 +0000 io_uring: move up io_put_kbuf() and io_put_rw_kbuf() Move them up to avoid explicit declaration. We will use them in later patches. Reviewed-by: Pavel Begunkov Signed-off-by: Hao Xu Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/3631243d6fc4a79bbba0cd62597fc8cd5be95924.1638714983.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit eec91694f927d1026974444eb6a3adccd4f1cbc2 Author: Jiasheng Jiang Date: Sat Dec 4 08:03:26 2021 +0800 uio: uio_dmem_genirq: Catch the Exception The return value of dma_set_coherent_mask() is not always 0. To catch the exception in case that dma is not support the mask. Fixes: 0a0c3b5a24bd ("Add new uio device for dynamic memory allocation") Signed-off-by: Jiasheng Jiang Link: https://lore.kernel.org/r/20211204000326.1592687-1-jiasheng@iscas.ac.cn Signed-off-by: Greg Kroah-Hartman commit 9899aa5ba525c293ea14f20891f3d98690661aea Author: Wei Ming Chen Date: Sun Dec 5 10:35:29 2021 +0800 usb: core: Fix file path that does not exist Both driver.c and generic.c are not under drivers/usb/, should be drivers/usb/core/ instead. Signed-off-by: Wei Ming Chen Link: https://lore.kernel.org/r/20211205023529.91165-1-jj251510319013@gmail.com Signed-off-by: Greg Kroah-Hartman commit fe6db7eda9306d665f7b8fc3decdb556ec10fb85 Author: Emmanuel Grumbach Date: Wed Dec 1 13:34:10 2021 +0200 iwlwifi: mei: fix linking when tracing is not enabled I forgot to add stubs in case tracing is disabled which caused linking errors: ERROR: modpost: "__SCT__tp_func_iwlmei_sap_data" [drivers/net/wireless/intel/iwlwifi/mei/iwlmei.ko] undefined! ERROR: modpost: "__SCT__tp_func_iwlmei_me_msg" [drivers/net/wireless/intel/iwlwifi/mei/iwlmei.ko] undefined! ERROR: modpost: "__tracepoint_iwlmei_sap_cmd" [drivers/net/wireless/intel/iwlwifi/mei/iwlmei.ko] undefined! ERROR: modpost: "__tracepoint_iwlmei_me_msg" [drivers/net/wireless/intel/iwlwifi/mei/iwlmei.ko] undefined! ERROR: modpost: "__SCK__tp_func_iwlmei_me_msg" [drivers/net/wireless/intel/iwlwifi/mei/iwlmei.ko] undefined! ERROR: modpost: "__SCK__tp_func_iwlmei_sap_data" [drivers/net/wireless/intel/iwlwifi/mei/iwlmei.ko] undefined! ERROR: modpost: "__tracepoint_iwlmei_sap_data" [drivers/net/wireless/intel/iwlwifi/mei/iwlmei.ko] undefined! ERROR: modpost: "__SCT__tp_func_iwlmei_sap_cmd" [drivers/net/wireless/intel/iwlwifi/mei/iwlmei.ko] undefined! ERROR: modpost: "__SCK__tp_func_iwlmei_sap_cmd" [drivers/net/wireless/intel/iwlwifi/mei/iwlmei.ko] undefined! Fixes: 2da4366f9e2c ("iwlwifi: mei: add the driver to allow cooperation with CSME") Reported-by: Jiri Slaby Signed-off-by: Emmanuel Grumbach Acked-by: Luca Coelho Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211201113411.130409-1-emmanuel.grumbach@intel.com commit bd303368b776eead1c29e6cdda82bde7128b82a7 Author: Christian Brauner Date: Fri Dec 3 12:17:07 2021 +0100 fs: support mapped mounts of mapped filesystems In previous patches we added new and modified existing helpers to handle idmapped mounts of filesystems mounted with an idmapping. In this final patch we convert all relevant places in the vfs to actually pass the filesystem's idmapping into these helpers. With this the vfs is in shape to handle idmapped mounts of filesystems mounted with an idmapping. Note that this is just the generic infrastructure. Actually adding support for idmapped mounts to a filesystem mountable with an idmapping is follow-up work. In this patch we extend the definition of an idmapped mount from a mount that that has the initial idmapping attached to it to a mount that has an idmapping attached to it which is not the same as the idmapping the filesystem was mounted with. As before we do not allow the initial idmapping to be attached to a mount. In addition this patch prevents that the idmapping the filesystem was mounted with can be attached to a mount created based on this filesystem. This has multiple reasons and advantages. First, attaching the initial idmapping or the filesystem's idmapping doesn't make much sense as in both cases the values of the i_{g,u}id and other places where k{g,u}ids are used do not change. Second, a user that really wants to do this for whatever reason can just create a separate dedicated identical idmapping to attach to the mount. Third, we can continue to use the initial idmapping as an indicator that a mount is not idmapped allowing us to continue to keep passing the initial idmapping into the mapping helpers to tell them that something isn't an idmapped mount even if the filesystem is mounted with an idmapping. Link: https://lore.kernel.org/r/20211123114227.3124056-11-brauner@kernel.org (v1) Link: https://lore.kernel.org/r/20211130121032.3753852-11-brauner@kernel.org (v2) Link: https://lore.kernel.org/r/20211203111707.3901969-11-brauner@kernel.org Cc: Seth Forshee Cc: Amir Goldstein Cc: Christoph Hellwig Cc: Al Viro CC: linux-fsdevel@vger.kernel.org Reviewed-by: Seth Forshee Signed-off-by: Christian Brauner commit a1ec9040a2a9122605ac26e5725c6de019184419 Author: Christian Brauner Date: Fri Dec 3 12:17:06 2021 +0100 fs: add i_user_ns() helper Since we'll be passing the filesystem's idmapping in even more places in the following patches and we do already dereference struct inode to get to the filesystem's idmapping multiple times add a tiny helper. Link: https://lore.kernel.org/r/20211123114227.3124056-10-brauner@kernel.org (v1) Link: https://lore.kernel.org/r/20211130121032.3753852-10-brauner@kernel.org (v2) Link: https://lore.kernel.org/r/20211203111707.3901969-10-brauner@kernel.org Cc: Seth Forshee Cc: Christoph Hellwig Cc: Al Viro CC: linux-fsdevel@vger.kernel.org Reviewed-by: Amir Goldstein Reviewed-by: Seth Forshee Signed-off-by: Christian Brauner commit 209188ce75d0d357c292f6bb81d712acdd4e7db7 Author: Christian Brauner Date: Fri Dec 3 12:17:05 2021 +0100 fs: port higher-level mapping helpers Enable the mapped_fs{g,u}id() helpers to support filesystems mounted with an idmapping. Apart from core mapping helpers that use mapped_fs{g,u}id() to initialize struct inode's i_{g,u}id fields xfs is the only place that uses these low-level helpers directly. The patch only extends the helpers to be able to take the filesystem idmapping into account. Since we don't actually yet pass the filesystem's idmapping in no functional changes happen. This will happen in a final patch. Link: https://lore.kernel.org/r/20211123114227.3124056-9-brauner@kernel.org (v1) Link: https://lore.kernel.org/r/20211130121032.3753852-9-brauner@kernel.org (v2) Link: https://lore.kernel.org/r/20211203111707.3901969-9-brauner@kernel.org Cc: Seth Forshee Cc: Christoph Hellwig Cc: Al Viro CC: linux-fsdevel@vger.kernel.org Reviewed-by: Amir Goldstein Reviewed-by: Seth Forshee Signed-off-by: Christian Brauner commit 02e4079913500f24ceb082d8d87d8665f044b298 Author: Christian Brauner Date: Fri Dec 3 12:17:04 2021 +0100 fs: remove unused low-level mapping helpers Now that we ported all places to use the new low-level mapping helpers that are able to support filesystems mounted with an idmapping we can remove the old low-level mapping helpers. With the removal of these old helpers we also conclude the renaming of the mapping helpers we started in commit a65e58e791a1 ("fs: document and rename fsid helpers"). Link: https://lore.kernel.org/r/20211123114227.3124056-8-brauner@kernel.org (v1) Link: https://lore.kernel.org/r/20211130121032.3753852-8-brauner@kernel.org (v2) Link: https://lore.kernel.org/r/20211203111707.3901969-8-brauner@kernel.org Cc: Seth Forshee Cc: Christoph Hellwig Cc: Al Viro CC: linux-fsdevel@vger.kernel.org Reviewed-by: Amir Goldstein Reviewed-by: Seth Forshee Signed-off-by: Christian Brauner commit bef873daf84f451472cd42c6b83e0acda8076be7 Merge: c09acbc499e88 7c50a407b8687 Author: Linus Walleij Date: Sun Dec 5 01:37:00 2021 +0100 Merge tag 'renesas-pinctrl-for-v5.17-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers into devel pinctrl: renesas: Updates for v5.17 - Add generic support for output impedance, - Add drive strength and output impedance support for the RZ/G2L SoC, - Miscellaneous fixes and improvements. commit c09acbc499e883a31e44d7ead3441c495b17df33 Author: Rafał Miłecki Date: Thu Dec 2 07:32:16 2021 +0100 dt-bindings: pinctrl: use pinctrl.yaml Also fix some examples to avoid warnings like: brcm,ns-pinmux.example.dt.yaml: pin-controller@1800c1c0: $nodename:0: 'pin-controller@1800c1c0' does not match '^pinctrl|pinmux@[0-9a-f]+$' Signed-off-by: Rafał Miłecki Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211202063216.24439-1-zajec5@gmail.com Signed-off-by: Linus Walleij commit 1288cadce4c7c2afafd13aeed64305b7fb4e280d Author: Herve Codina Date: Thu Dec 2 10:52:52 2021 +0100 pinctrl: spear: plgpio: Introduce regmap phandle Resources need to be shared between pinmux and plgpio. Introduce regmap phandle in order to retrieve the regmap from the phandle if the property is present. This allows to retrieve an external regmap (ie the one used by pinmux if the phandle references the pinmux node) from plgpio. Signed-off-by: Herve Codina Acked-by: Viresh Kumar Link: https://lore.kernel.org/r/20211202095255.165797-4-herve.codina@bootlin.com Signed-off-by: Linus Walleij commit 7151cef59e83695adc79bd7c539f371dc674824b Author: Herve Codina Date: Thu Dec 2 10:52:51 2021 +0100 pinctrl: spear: plgpio: Convert to regmap Resources need to be shared between pinmux and plgpio. Use regmap (syscon) to access resources to allow an easy way to share resources. Signed-off-by: Herve Codina Acked-by: Viresh Kumar Link: https://lore.kernel.org/r/20211202095255.165797-3-herve.codina@bootlin.com Signed-off-by: Linus Walleij commit d11db044a394e2f842bd6f31b904feb298a4699f Author: Herve Codina Date: Thu Dec 2 10:52:50 2021 +0100 pinctrl: spear: spear: Convert to regmap Resources need to be shared between pinmux and plgpio. Use regmap (syscon) to access resources to allow an easy way to share resources. Signed-off-by: Herve Codina Acked-by: Viresh Kumar Link: https://lore.kernel.org/r/20211202095255.165797-2-herve.codina@bootlin.com Signed-off-by: Linus Walleij commit b80892ca022e9eb484771a66eb68e12364695a2a Author: Christoph Hellwig Date: Thu Oct 28 17:10:17 2021 +0200 memremap: remove support for external pgmap refcounts No driver is left using the external pgmap refcount, so remove the code to support it. Signed-off-by: Christoph Hellwig Acked-by: Bjorn Helgaas Link: https://lore.kernel.org/r/20211028151017.50234-1-hch@lst.de Signed-off-by: Dan Williams commit 3c5c67ec29a918dfb2ffc94429437794ddd225e8 Author: Andreas Gruenbacher Date: Mon Nov 29 21:56:16 2021 +0100 gfs2: Fix gfs2_instantiate description The description of gfs2_instantiate accidentally lists a glock argument, but the function takes a glock holder. Signed-off-by: Andreas Gruenbacher commit 8d567162ef288ee0df6674f291e3d9c290306f1e Author: Andreas Gruenbacher Date: Tue Nov 30 10:06:11 2021 +0100 gfs2: Remove redundant check for GLF_INSTANTIATE_NEEDED If the GLF_INSTANTIATE_NEEDED flag isn't set, gfs2_instantiate() is a no-op. Signed-off-by: Andreas Gruenbacher commit 1d05ee7e0d10283107cd6c2ed37005b67cd2f5b7 Author: Bob Peterson Date: Fri Nov 12 13:52:06 2021 -0600 gfs2: remove redundant set of INSTANTIATE_NEEDED Function rgrp_go_inval calls gfs2_rgrp_brelse to invalidate the in-core rgrp structures. After the call it set GLF_INSTANTIATE_NEEDED, which is redundant, since gfs2_rgrp_brelse also sets it. This patch simply removes the redundant set_bit. Signed-off-by: Bob Peterson Signed-off-by: Andreas Gruenbacher commit ffd0cd3c2f10e2241771056566fa0fe36b3855ce Author: Andreas Gruenbacher Date: Thu Nov 18 20:33:00 2021 +0100 gfs2: Fix __gfs2_holder_init function name in kernel-doc comment The function name in the kernel-doc comment wasn't updated when the function was renamed. Fixes: b016d9a84abd ("gfs2: Save ip from gfs2_glock_nq_init") Signed-off-by: Andreas Gruenbacher commit 1517c1a7a4456f080fabc4ac9853930e4b880d14 Author: Eric Biggers Date: Fri Jul 23 00:59:20 2021 -0700 f2fs: implement iomap operations Implement 'struct iomap_ops' for f2fs, in preparation for making f2fs use iomap for direct I/O. Note that this may be used for other things besides direct I/O in the future; however, for now I've only tested it for direct I/O. Signed-off-by: Eric Biggers Signed-off-by: Jaegeuk Kim commit ccf7cf92373d1a53166582013430b3b9c05a6ba2 Author: Eric Biggers Date: Fri Jul 16 09:39:15 2021 -0500 f2fs: fix the f2fs_file_write_iter tracepoint Pass in the original position and count rather than the position and count that were updated by the write. Also use the correct types for all arguments, in particular the file offset which was being truncated to 32 bits on 32-bit platforms. Signed-off-by: Eric Biggers Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit d4dd19ec1ea0cf6532d65709325c42b1398614a8 Author: Jaegeuk Kim Date: Fri Nov 12 14:31:16 2021 -0800 f2fs: do not expose unwritten blocks to user by DIO DIO preallocates physical blocks before writing data, but if an error occurrs or power-cut happens, we can see block contents from the disk. This patch tries to fix it by 1) turning to buffered writes for DIO into holes, 2) truncating unwritten blocks from error or power-cut. Signed-off-by: Jaegeuk Kim commit b31bf0f96e71a2c81d2122c3fecdb91f8e215c20 Author: Eric Biggers Date: Fri Jul 16 09:39:14 2021 -0500 f2fs: reduce indentation in f2fs_file_write_iter() Replace 'if (ret > 0)' with 'if (ret <= 0) goto out_unlock;'. No change in behavior. Signed-off-by: Eric Biggers Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 866de407444398bc8140ea70de1dba5f91cc34ac Author: Hou Tao Date: Fri Dec 3 13:30:01 2021 +0800 bpf: Disallow BPF_LOG_KERNEL log level for bpf(BPF_BTF_LOAD) BPF_LOG_KERNEL is only used internally, so disallow bpf_btf_load() to set log level as BPF_LOG_KERNEL. The same checking has already been done in bpf_check(), so factor out a helper to check the validity of log attributes and use it in both places. Fixes: 8580ac9404f6 ("bpf: Process in-kernel BTF") Signed-off-by: Hou Tao Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20211203053001.740945-1-houtao1@huawei.com commit b842f1d14a190e217a8ee3f6dae9e1dff1817d87 Author: Christoph Hellwig Date: Mon Nov 29 11:22:03 2021 +0100 fsdax: don't require CONFIG_BLOCK The file system DAX code now does not require the block code. So allow building a kernel with fuse DAX but not block layer. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong Link: https://lore.kernel.org/r/20211129102203.2243509-30-hch@lst.de Signed-off-by: Dan Williams commit ca72d2210fc5b7a6bc7de1da0f9e1b84f8ee3602 Author: Christoph Hellwig Date: Mon Nov 29 11:22:02 2021 +0100 iomap: build the block based code conditionally Only build the block based iomap code if CONFIG_BLOCK is set. Currently that is always the case, but it will change soon. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong Link: https://lore.kernel.org/r/20211129102203.2243509-29-hch@lst.de Signed-off-by: Dan Williams commit 2ede892342b3c628991ff1b9060108a7edd92d94 Author: Christoph Hellwig Date: Mon Nov 29 11:22:01 2021 +0100 dax: fix up some of the block device related ifdefs The DAX device <-> block device association is only enabled if CONFIG_BLOCK is enabled. Update dax.h to account for that and use the right conditions for the fs_put_dax stub as well. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong Link: https://lore.kernel.org/r/20211129102203.2243509-28-hch@lst.de Signed-off-by: Dan Williams commit de2051147771017a61b62c02fd4e883c9b07712d Author: Christoph Hellwig Date: Mon Nov 29 11:22:00 2021 +0100 fsdax: shift partition offset handling into the file systems Remove the last user of ->bdev in dax.c by requiring the file system to pass in an address that already includes the DAX offset. As part of the only set ->bdev or ->daxdev when actually required in the ->iomap_begin methods. Signed-off-by: Christoph Hellwig Reviewed-by: Gao Xiang [erofs] Reviewed-by: Darrick J. Wong Link: https://lore.kernel.org/r/20211129102203.2243509-27-hch@lst.de Signed-off-by: Dan Williams commit cd913c76f489def1a388e3a5b10df94948ede3f5 Author: Christoph Hellwig Date: Mon Nov 29 11:21:59 2021 +0100 dax: return the partition offset from fs_dax_get_by_bdev Prepare for the removal of the block_device from the DAX I/O path by returning the partition offset from fs_dax_get_by_bdev so that the file systems have it at hand for use during I/O. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong Link: https://lore.kernel.org/r/20211129102203.2243509-26-hch@lst.de Signed-off-by: Dan Williams commit 952da06375c8f3aa58474fff718d9ae8442531b9 Author: Christoph Hellwig Date: Mon Nov 29 11:21:58 2021 +0100 iomap: add a IOMAP_DAX flag Add a flag so that the file system can easily detect DAX operations based just on the iomap operation requested instead of looking at inode state using IS_DAX. This will be needed to apply the to be added partition offset only for operations that actually use DAX, but not things like fiemap that are based on the block device. In the long run it should also allow turning the bdev, dax_dev and inline_data into a union. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong Link: https://lore.kernel.org/r/20211129102203.2243509-25-hch@lst.de Signed-off-by: Dan Williams commit 740fd671e04f8a977018eb9cfe440b4817850f0d Author: Christoph Hellwig Date: Mon Nov 29 11:21:57 2021 +0100 xfs: pass the mapping flags to xfs_bmbt_to_iomap To prepare for looking at the IOMAP_DAX flag in xfs_bmbt_to_iomap pass in the input mapping flags to xfs_bmbt_to_iomap. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Link: https://lore.kernel.org/r/20211129102203.2243509-24-hch@lst.de Signed-off-by: Dan Williams commit a50f6ab3fd31b084b851c5c196db6c900af2c7cc Author: Christoph Hellwig Date: Mon Nov 29 11:21:56 2021 +0100 xfs: use xfs_direct_write_iomap_ops for DAX zeroing While the buffered write iomap ops do work due to the fact that zeroing never allocates blocks, the DAX zeroing should use the direct ops just like actual DAX I/O. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong Link: https://lore.kernel.org/r/20211129102203.2243509-23-hch@lst.de Signed-off-by: Dan Williams commit 5b5abbefec1bea98abba8f1cffcf72c11c32a92d Author: Christoph Hellwig Date: Mon Nov 29 11:21:55 2021 +0100 xfs: move dax device handling into xfs_{alloc,free}_buftarg Hide the DAX device lookup from the xfs_super.c code. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Reviewed-by: Dan Williams Link: https://lore.kernel.org/r/20211129102203.2243509-22-hch@lst.de Signed-off-by: Dan Williams commit 89b93a7b15f75d04ed579baeb4d941e8ce7634c8 Author: Christoph Hellwig Date: Mon Nov 29 11:21:54 2021 +0100 ext4: cleanup the dax handling in ext4_fill_super Only call fs_dax_get_by_bdev once the sbi has been allocated and remove the need for the dax_dev local variable. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong Link: https://lore.kernel.org/r/20211129102203.2243509-21-hch@lst.de Signed-off-by: Dan Williams commit cea845cdef4f5094f0471a6dbdb609c004ad8b06 Author: Christoph Hellwig Date: Mon Nov 29 11:21:53 2021 +0100 ext2: cleanup the dax handling in ext2_fill_super Only call fs_dax_get_by_bdev once the sbi has been allocated and remove the need for the dax_dev local variable. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong Link: https://lore.kernel.org/r/20211129102203.2243509-20-hch@lst.de Signed-off-by: Dan Williams commit c6f40468657d16e4010ef84bf32a761feb3469ea Author: Christoph Hellwig Date: Mon Nov 29 11:21:52 2021 +0100 fsdax: decouple zeroing from the iomap buffered I/O code Unshare the DAX and iomap buffered I/O page zeroing code. This code previously did a IS_DAX check deep inside the iomap code, which in fact was the only DAX check in the code. Instead move these checks into the callers. Most callers already have DAX special casing anyway and XFS will need it for reflink support as well. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong Link: https://lore.kernel.org/r/20211129102203.2243509-19-hch@lst.de Signed-off-by: Dan Williams commit e5c71954ca11df04d258a663a8a15262be0e17f6 Author: Christoph Hellwig Date: Mon Nov 29 11:21:51 2021 +0100 fsdax: factor out a dax_memzero helper Factor out a helper for the "manual" zeroing of a DAX range to clean up dax_iomap_zero a lot. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong Link: https://lore.kernel.org/r/20211129102203.2243509-18-hch@lst.de Signed-off-by: Dan Williams commit 4a2d7d5950507a27e3074e4a29dc20720235f811 Author: Christoph Hellwig Date: Mon Nov 29 11:21:50 2021 +0100 fsdax: simplify the offset check in dax_iomap_zero The file relative offset must have the same alignment as the storage offset, so use that and get rid of the call to iomap_sector. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong Link: https://lore.kernel.org/r/20211129102203.2243509-17-hch@lst.de Signed-off-by: Dan Williams commit f1ba5fafba9bfde4b040cd0d14256aed25a35c5e Author: Shiyang Ruan Date: Mon Nov 29 11:21:49 2021 +0100 xfs: add xfs_zero_range and xfs_truncate_page helpers Add helpers to prepare for using different DAX operations. Signed-off-by: Shiyang Ruan [hch: split from a larger patch + slight cleanups] Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong Link: https://lore.kernel.org/r/20211129102203.2243509-16-hch@lst.de Signed-off-by: Dan Williams commit 60696eb26a37ab0199f7833ddbc1b75138c36d16 Author: Christoph Hellwig Date: Mon Nov 29 11:21:48 2021 +0100 fsdax: simplify the pgoff calculation Replace the two steps of dax_iomap_sector and bdev_dax_pgoff with a single dax_iomap_pgoff helper that avoids lots of cumbersome sector conversions. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong Link: https://lore.kernel.org/r/20211129102203.2243509-15-hch@lst.de Signed-off-by: Dan Williams commit 429f8de70d9872c5ca9b3914b3c4db5659779331 Author: Christoph Hellwig Date: Mon Nov 29 11:21:47 2021 +0100 fsdax: use a saner calling convention for copy_cow_page_dax Just pass the vm_fault and iomap_iter structures, and figure out the rest locally. Note that this requires moving dax_iomap_sector up in the file. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong Link: https://lore.kernel.org/r/20211129102203.2243509-14-hch@lst.de Signed-off-by: Dan Williams commit 9dc2f9cdc63e7db82b6b2ec17894ca1b254f5e5d Author: Christoph Hellwig Date: Mon Nov 29 11:21:46 2021 +0100 fsdax: remove a pointless __force cast in copy_cow_page_dax Despite its name copy_user_page expected kernel addresses, which is what we already have. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong Link: https://lore.kernel.org/r/20211129102203.2243509-13-hch@lst.de Signed-off-by: Dan Williams commit 2a68553e8aeb3e88cb0b1042233613a3d08a700a Author: Christoph Hellwig Date: Mon Nov 29 11:21:45 2021 +0100 dm-stripe: add a stripe_dax_pgoff helper Add a helper to perform the entire remapping for DAX accesses. This helper open codes bdev_dax_pgoff given that the alignment checks have already been done by the submitting file system and don't need to be repeated. Signed-off-by: Christoph Hellwig Acked-by: Mike Snitzer Reviewed-by: Dan Williams Link: https://lore.kernel.org/r/20211129102203.2243509-12-hch@lst.de Signed-off-by: Dan Williams commit d19bd6756e7c400e264dba853eb35c94462f4ec4 Author: Christoph Hellwig Date: Mon Nov 29 11:21:44 2021 +0100 dm-log-writes: add a log_writes_dax_pgoff helper Add a helper to perform the entire remapping for DAX accesses. This helper open codes bdev_dax_pgoff given that the alignment checks have already been done by the submitting file system and don't need to be repeated. Signed-off-by: Christoph Hellwig Acked-by: Mike Snitzer Reviewed-by: Dan Williams Link: https://lore.kernel.org/r/20211129102203.2243509-11-hch@lst.de Signed-off-by: Dan Williams commit f43e0065c264b2cb001952be17c9291c68d07182 Author: Christoph Hellwig Date: Mon Nov 29 11:21:43 2021 +0100 dm-linear: add a linear_dax_pgoff helper Add a helper to perform the entire remapping for DAX accesses. This helper open codes bdev_dax_pgoff given that the alignment checks have already been done by the submitting file system and don't need to be repeated. Signed-off-by: Christoph Hellwig Acked-by: Mike Snitzer Reviewed-by: Dan Williams Link: https://lore.kernel.org/r/20211129102203.2243509-10-hch@lst.de Signed-off-by: Dan Williams commit 7b0800d00dae8c897398abaf61e82db0d67d7afc Author: Christoph Hellwig Date: Mon Nov 29 11:21:42 2021 +0100 dax: remove dax_capable Just open code the block size and dax_dev == NULL checks in the callers. Signed-off-by: Christoph Hellwig Acked-by: Mike Snitzer Reviewed-by: Gao Xiang [erofs] Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong Link: https://lore.kernel.org/r/20211129102203.2243509-9-hch@lst.de Signed-off-by: Dan Williams commit 679a99495b8fda800037b25af8cd990eb7dd72c9 Author: Christoph Hellwig Date: Mon Nov 29 11:21:41 2021 +0100 xfs: factor out a xfs_setup_dax_always helper Factor out another DAX setup helper to simplify future changes. Also move the experimental warning after the checks to not clutter the log too much if the setup failed. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong Link: https://lore.kernel.org/r/20211129102203.2243509-8-hch@lst.de Signed-off-by: Dan Williams commit 0c445871388f4bac74ea74e8c7a12c6c05c6a427 Author: Christoph Hellwig Date: Mon Nov 29 11:21:40 2021 +0100 dax: move the partition alignment check into fs_dax_get_by_bdev fs_dax_get_by_bdev is the primary interface to find a dax device for a block device, so move the partition alignment check there instead of wiring it up through ->dax_supported. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong Link: https://lore.kernel.org/r/20211129102203.2243509-7-hch@lst.de Signed-off-by: Dan Williams commit 586f61682816f0cf7865b2dab7210b8f5339f834 Author: Christoph Hellwig Date: Mon Nov 29 11:21:39 2021 +0100 dax: remove the pgmap sanity checks in generic_fsdax_supported Drivers that register a dax_dev should make sure it works, no need to double check from the file system. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Reviewed-by: Darrick J. Wong Link: https://lore.kernel.org/r/20211129102203.2243509-6-hch@lst.de Signed-off-by: Dan Williams commit fb08a1908cb119a4585611d91461ab6d27756b14 Author: Christoph Hellwig Date: Mon Nov 29 11:21:38 2021 +0100 dax: simplify the dax_device <-> gendisk association Replace the dax_host_hash with an xarray indexed by the pointer value of the gendisk, and require explicitly calls from the block drivers that want to associate their gendisk with a dax_device. Signed-off-by: Christoph Hellwig Acked-by: Mike Snitzer Reviewed-by: Darrick J. Wong Link: https://lore.kernel.org/r/20211129102203.2243509-5-hch@lst.de Signed-off-by: Dan Williams commit afd586f0d06ce3d81b7c474499630fec88833828 Author: Christoph Hellwig Date: Mon Nov 29 11:21:37 2021 +0100 dax: remove CONFIG_DAX_DRIVER CONFIG_DAX_DRIVER only selects CONFIG_DAX now, so remove it. Signed-off-by: Christoph Hellwig Reviewed-by: Dan Williams Link: https://lore.kernel.org/r/20211129102203.2243509-4-hch@lst.de Signed-off-by: Dan Williams commit 5d2a228b9e1319ff188f9ea89006fbe575561921 Author: Christoph Hellwig Date: Mon Nov 29 11:21:36 2021 +0100 dm: make the DAX support depend on CONFIG_FS_DAX The device mapper DAX support is all hanging off a block device and thus can't be used with device dax. Make it depend on CONFIG_FS_DAX instead of CONFIG_DAX_DRIVER. This also means that bdev_dax_pgoff only needs to be built under CONFIG_FS_DAX now. Signed-off-by: Christoph Hellwig Acked-by: Mike Snitzer Link: https://lore.kernel.org/r/20211129102203.2243509-3-hch@lst.de Signed-off-by: Dan Williams commit d751939235b9b7bc4af15f90a3e99288a8b844a7 Author: Christoph Hellwig Date: Mon Nov 29 11:21:35 2021 +0100 dm: fix alloc_dax error handling in alloc_dev Make sure ->dax_dev is NULL on error so that the cleanup path doesn't trip over an ERR_PTR. Reported-by: Dan Williams Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211129102203.2243509-2-hch@lst.de Signed-off-by: Dan Williams commit 0bb12606c05fe9737e3056fe76d6e4b9c2a87b57 Author: Antoniu Miclaus Date: Thu Dec 2 17:08:18 2021 +0200 iio:dac:ad7293: add support for AD7293 The AD7293 is a Power Amplifier drain current controller containing functionality for general-purpose monitoring and control of current, voltage, and temperature, integrated into a single chip solution with an SPI-compatible interface. Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/AD7293.pdf Signed-off-by: Antoniu Miclaus Reviewed-by: Cai Huoqing Link: https://lore.kernel.org/r/20211202150819.24832-1-antoniu.miclaus@analog.com Signed-off-by: Jonathan Cameron commit 4114835810aecec94b4163b8b1086dd953476391 Author: Nikita Travkin Date: Thu Nov 25 17:56:46 2021 +0500 iio: ltr501: Export near level property for proximity sensor Userspace tools like iio-sensor-proxy need to know the proximity level that should be considered "near". This value is hardware-specific and can be defined via the devicetree. Allow the driver to export the near level. Signed-off-by: Nikita Travkin Link: https://lore.kernel.org/r/20211125125646.54831-2-nikita@trvn.ru Signed-off-by: Jonathan Cameron commit 2cc131ace0d2f47e5d8fcc8a2be12f5e3a20b1f0 Author: Nikita Travkin Date: Thu Nov 25 17:56:45 2021 +0500 dt-bindings: iio: light: ltr501: Add proximity-near-level This value inidcates the proximity level that should be considered "close". Signed-off-by: Nikita Travkin Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211125125646.54831-1-nikita@trvn.ru Signed-off-by: Jonathan Cameron commit fc27e69f4df643e7985752ebee72299d085b0efc Author: Evgeny Boger Date: Thu Nov 18 17:12:33 2021 +0300 dt-bindings: iio: adc: document TS voltage in AXP PMICs Most AXPxxx-based reference designs place a 10k NTC thermistor on a TS pin. axp20x IIO driver now report the voltage of this pin via additional IIO channel. Add new "ts_v" channel to the channel description. Signed-off-by: Evgeny Boger Acked-by: Rob Herring Reviewed-by: Quentin Schulz Link: https://lore.kernel.org/r/20211118141233.247907-3-boger@wirenboard.com Signed-off-by: Jonathan Cameron commit 4da5f2d6f2e3286262d32db901ec735a6a5a51b9 Author: Evgeny Boger Date: Thu Nov 18 17:12:32 2021 +0300 iio:adc:axp20x: add support for NTC thermistor Most AXPxxx-based reference designs place a 10k NTC thermistor on a TS pin. When appropriately configured, AXP PMICs will inject fixed current (80uA by default) into TS pin and measure the voltage across a thermistor. The PMIC itself will by default compare this voltage with predefined thresholds and disable battery charging whenever the battery is too hot or too cold. Alternatively, the TS pin can be configured as general-purpose ADC input. This mode is not supported by the driver. This patch allows reading the voltage on the TS pin. It can be then either processed by userspace or used by kernel consumer like hwmon ntc thermistor driver. Signed-off-by: Evgeny Boger Acked-by: Maxime Ripard Reviewed-by: Quentin Schulz Link: https://lore.kernel.org/r/20211118141233.247907-2-boger@wirenboard.com Signed-off-by: Jonathan Cameron commit a91f82d944e369c13e62f94f19994e8c915cb028 Author: Lorenzo Bianconi Date: Sat Nov 13 16:23:15 2021 +0100 Documentation: dt: iio: st_lsm6dsx: add disable-sensor-hub property Enable/disable internal i2c controller slave autoprobing at bootstrap. Disable sensor-hub is useful if i2c controller clock/data lines are connected through a pull-up with other chip lines (e.g. SDO/SA0). Signed-off-by: Lorenzo Bianconi Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/54287a93922ac839501b776d288cc368aa81f0ab.1636816719.git.lorenzo@kernel.org Signed-off-by: Jonathan Cameron commit 35619155d044830357f06f1d2c8188c4530b4d7a Author: Lorenzo Bianconi Date: Sat Nov 13 16:23:14 2021 +0100 iio: imu: st_lsm6dsx: add dts property to disable sensor-hub Introduce the capability to disable sensorhub through a device-tree property since there are some configurations where users want to explicitly disable sensor-hub auto-probing at bootstrap. A typical configuration is when the sensorhub clock/data lines are connected to a pull-up resistor since no slave sensors are connected to the i2c master. If SDO/SA0 line is connected to the same pull-up resistor, when the driver tries to probe slave devices connected on sensor-hub, it will force SDO/SA0 line to low, modifying the device i2c address. Tested-by: Mario Tesi Signed-off-by: Lorenzo Bianconi Link: https://lore.kernel.org/r/ad7894e7b1c6fb3427fab3f623bb942860ad45cf.1636816719.git.lorenzo@kernel.org Signed-off-by: Jonathan Cameron commit 9de4999050b5f2e847c84372c6a1aa1fe32bb269 Author: Joerg Roedel Date: Thu Dec 2 16:32:23 2021 +0100 x86/realmode: Add comment for Global bit usage in trampoline_pgd Document the fact that using the trampoline_pgd will result in the creation of global TLB entries in the user range of the address space. Signed-off-by: Joerg Roedel Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20211202153226.22946-2-joro@8bytes.org commit 4cf75fd4a2545ca4deea992f929602c9fdbe8058 Author: Marco Elver Date: Fri Dec 3 15:59:35 2021 +0800 locking: Mark racy reads of owner->on_cpu One of the more frequent data races reported by KCSAN is the racy read in mutex_spin_on_owner(), which is usually reported as "race of unknown origin" without showing the writer. This is due to the racing write occurring in kernel/sched. Locally enabling KCSAN in kernel/sched shows: | write (marked) to 0xffff97f205079934 of 4 bytes by task 316 on cpu 6: | finish_task kernel/sched/core.c:4632 [inline] | finish_task_switch kernel/sched/core.c:4848 | context_switch kernel/sched/core.c:4975 [inline] | __schedule kernel/sched/core.c:6253 | schedule kernel/sched/core.c:6326 | schedule_preempt_disabled kernel/sched/core.c:6385 | __mutex_lock_common kernel/locking/mutex.c:680 | __mutex_lock kernel/locking/mutex.c:740 [inline] | __mutex_lock_slowpath kernel/locking/mutex.c:1028 | mutex_lock kernel/locking/mutex.c:283 | tty_open_by_driver drivers/tty/tty_io.c:2062 [inline] | ... | | read to 0xffff97f205079934 of 4 bytes by task 322 on cpu 3: | mutex_spin_on_owner kernel/locking/mutex.c:370 | mutex_optimistic_spin kernel/locking/mutex.c:480 | __mutex_lock_common kernel/locking/mutex.c:610 | __mutex_lock kernel/locking/mutex.c:740 [inline] | __mutex_lock_slowpath kernel/locking/mutex.c:1028 | mutex_lock kernel/locking/mutex.c:283 | tty_open_by_driver drivers/tty/tty_io.c:2062 [inline] | ... | | value changed: 0x00000001 -> 0x00000000 This race is clearly intentional, and the potential for miscompilation is slim due to surrounding barrier() and cpu_relax(), and the value being used as a boolean. Nevertheless, marking this reader would more clearly denote intent and make it obvious that concurrency is expected. Use READ_ONCE() to avoid having to reason about compiler optimizations now and in future. With previous refactor, mark the read to owner->on_cpu in owner_on_cpu(), which immediately precedes the loop executing mutex_spin_on_owner(). Signed-off-by: Marco Elver Signed-off-by: Kefeng Wang Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20211203075935.136808-3-wangkefeng.wang@huawei.com commit c0bed69daf4b67809b58cc7cd81a8fa4f45bc161 Author: Kefeng Wang Date: Fri Dec 3 15:59:34 2021 +0800 locking: Make owner_on_cpu() into Move the owner_on_cpu() from kernel/locking/rwsem.c into include/linux/sched.h with under CONFIG_SMP, then use it in the mutex/rwsem/rtmutex to simplify the code. Signed-off-by: Kefeng Wang Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20211203075935.136808-2-wangkefeng.wang@huawei.com commit 9a75bd0c52df6cff44735f73dfb9d00e67969fc5 Author: Sebastian Andrzej Siewior Date: Mon Nov 29 18:46:52 2021 +0100 lockdep/selftests: Adapt ww-tests for PREEMPT_RT The ww-mutex selftest operates directly on ww_mutex::base and assumes its type is struct mutex. This isn't true on PREEMPT_RT which turns the mutex into a rtmutex. Add a ww_mutex_base_ abstraction which maps to the relevant mutex_ or rt_mutex_ function. Change the CONFIG_DEBUG_MUTEXES ifdef to DEBUG_WW_MUTEXES. The latter is true for the MUTEX and RTMUTEX implementation of WW-MUTEX. The assignment is required in order to pass the tests. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20211129174654.668506-10-bigeasy@linutronix.de commit a529f8db897625859b640b565325463e5d5ff01e Author: Sebastian Andrzej Siewior Date: Mon Nov 29 18:46:51 2021 +0100 lockdep/selftests: Skip the softirq related tests on PREEMPT_RT The softirq context on PREEMPT_RT is different compared to !PREEMPT_RT. As such lockdep_softirq_enter() is a nop and the all the "softirq safe" tests fail on PREEMPT_RT because there is no difference. Skip the softirq context tests on PREEMPT_RT. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20211129174654.668506-9-bigeasy@linutronix.de commit 512bf713cb4c8a42ae76e5ba1a78e70a768af301 Author: Sebastian Andrzej Siewior Date: Mon Nov 29 18:46:50 2021 +0100 lockdep/selftests: Unbalanced migrate_disable() & rcu_read_lock(). The tests with unbalanced lock() + unlock() operation leave a modified preemption counter behind which is then reset to its original value after the test. The spin_lock() function on PREEMPT_RT does not include a preempt_disable() statement but migrate_disable() and read_rcu_lock(). As a consequence both counter never get back to their original value and the system explodes later after the selftest. In the double-unlock case on PREEMPT_RT, the migrate_disable() and RCU code will trigger a warning which should be avoided. These counter should not be decremented below their initial value. Save both counters and bring them back to their original value after the test. In the double-unlock case, increment both counter in advance to they become balanced after the double unlock. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20211129174654.668506-8-bigeasy@linutronix.de commit fc78dd08e64011865799764d5b641bf823f84c66 Author: Sebastian Andrzej Siewior Date: Mon Nov 29 18:46:49 2021 +0100 lockdep/selftests: Avoid using local_lock_{acquire|release}(). The local_lock related functions local_lock_acquire() local_lock_release() are part of the internal implementation and should be avoided. Define the lock as DEFINE_PER_CPU so the normal local_lock() function can be used. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20211129174654.668506-7-bigeasy@linutronix.de commit 0c1d7a2c2d32fac7ff4a644724b2d52a64184645 Author: Thomas Gleixner Date: Mon Nov 29 18:46:48 2021 +0100 lockdep: Remove softirq accounting on PREEMPT_RT. There is not really a softirq context on PREEMPT_RT. Softirqs on PREEMPT_RT are always invoked within the context of a threaded interrupt handler or within ksoftirqd. The "in-softirq" context is preemptible and is protected by a per-CPU lock to ensure mutual exclusion. There is no difference on PREEMPT_RT between spin_lock_irq() and spin_lock() because the former does not disable interrupts. Therefore if a lock is used in_softirq() and locked once with spin_lock_irq() then lockdep will report this with "inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage". Teach lockdep that we don't really do softirqs on -RT. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20211129174654.668506-6-bigeasy@linutronix.de commit a3642021923b26d86bb27d88c826494827612c06 Author: Sebastian Andrzej Siewior Date: Mon Nov 29 18:46:47 2021 +0100 locking/rtmutex: Add rt_mutex_lock_nest_lock() and rt_mutex_lock_killable(). The locking selftest for ww-mutex expects to operate directly on the base-mutex which becomes a rtmutex on PREEMPT_RT. Add a rtmutex based implementation of mutex_lock_nest_lock() and mutex_lock_killable() named rt_mutex_lock_nest_lock() abd rt_mutex_lock_killable(). Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20211129174654.668506-5-bigeasy@linutronix.de commit 02ea9fc96fe976e7f7e067f38b12202f126e3f2f Author: Peter Zijlstra Date: Mon Nov 29 18:46:46 2021 +0100 locking/rtmutex: Squash self-deadlock check for ww_rt_mutex. Similar to the issues in commits: 6467822b8cc9 ("locking/rtmutex: Prevent spurious EDEADLK return caused by ww_mutexes") a055fcc132d4 ("locking/rtmutex: Return success on deadlock for ww_mutex waiters") ww_rt_mutex_lock() should not return EDEADLK without first going through the __ww_mutex logic to set the required state. In fact, the chain-walk can deal with the spurious cycles (per the above commits) this check warns about and is trying to avoid. Therefore ignore this test for ww_rt_mutex and simply let things fall in place. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20211129174654.668506-4-bigeasy@linutronix.de commit e08f343be00c3fe8f9f6ac58085c81bcdd231fab Author: Sebastian Andrzej Siewior Date: Mon Nov 29 18:46:45 2021 +0100 locking: Remove rt_rwlock_is_contended(). rt_rwlock_is_contended() has no users. It makes no sense to use it as rwlock_is_contended() because it is a sleeping lock on RT and preemption is possible. It reports always != 0 if used by a writer and even if there is a waiter then the lock might not be handed over if the current owner has the highest priority. Remove rt_rwlock_is_contended(). Reported-by: kernel test robot Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20211129174654.668506-3-bigeasy@linutronix.de commit 9d0df37797453f168afdb2e6fd0353c73718ae9a Author: Sebastian Andrzej Siewior Date: Mon Nov 29 18:46:44 2021 +0100 sched: Trigger warning if ->migration_disabled counter underflows. If migrate_enable() is used more often than its counter part then it remains undetected and rq::nr_pinned will underflow, too. Add a warning if migrate_enable() is attempted if without a matching a migrate_disable(). Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20211129174654.668506-2-bigeasy@linutronix.de commit 014ba44e8184e1acf93e0cbb7089ee847802f8f0 Author: Vincent Donnefort Date: Mon Nov 29 17:31:15 2021 +0000 sched/fair: Fix per-CPU kthread and wakee stacking for asym CPU capacity select_idle_sibling() has a special case for tasks woken up by a per-CPU kthread where the selected CPU is the previous one. For asymmetric CPU capacity systems, the assumption was that the wakee couldn't have a bigger utilization during task placement than it used to have during the last activation. That was not considering uclamp.min which can completely change between two task activations and as a consequence mandates the fitness criterion asym_fits_capacity(), even for the exit path described above. Fixes: b4c9c9f15649 ("sched/fair: Prefer prev cpu in asymmetric wakeup path") Signed-off-by: Vincent Donnefort Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Valentin Schneider Reviewed-by: Dietmar Eggemann Link: https://lkml.kernel.org/r/20211129173115.4006346-1-vincent.donnefort@arm.com commit 8b4e74ccb582797f6f0b0a50372ebd9fd2372a27 Author: Vincent Donnefort Date: Wed Dec 1 14:34:50 2021 +0000 sched/fair: Fix detection of per-CPU kthreads waking a task select_idle_sibling() has a special case for tasks woken up by a per-CPU kthread, where the selected CPU is the previous one. However, the current condition for this exit path is incomplete. A task can wake up from an interrupt context (e.g. hrtimer), while a per-CPU kthread is running. A such scenario would spuriously trigger the special case described above. Also, a recent change made the idle task like a regular per-CPU kthread, hence making that situation more likely to happen (is_per_cpu_kthread(swapper) being true now). Checking for task context makes sure select_idle_sibling() will not interpret a wake up from any other context as a wake up by a per-CPU kthread. Fixes: 52262ee567ad ("sched/fair: Allow a per-CPU kthread waking a task to stack on the same CPU, to fix XFS performance regression") Signed-off-by: Vincent Donnefort Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Vincent Guittot Reviewed-by: Valentin Schneider Link: https://lore.kernel.org/r/20211201143450.479472-1-vincent.donnefort@arm.com commit ce83278f313ce65a9bbd780a3e07fa3f62d82525 Merge: bb14bfc7eb927 823163ba6e52e Author: Jakub Kicinski Date: Fri Dec 3 18:24:23 2021 -0800 Merge branch 'qed-enhancements' Manish Chopra says: ==================== qed*: enhancements This series adds below enhancements for qed/qede drivers patch 1: Improves tx timeout debug data logs. patch 2: Add ESL(Enhanced system lockdown) priv flag cap/status support. v2: * Fixed cosmetic issues in both patches * Added ESL feature description in patch #2 Please consider applying it to "net-next" ==================== Link: https://lore.kernel.org/r/20211202210157.25530-1-manishc@marvell.com Signed-off-by: Jakub Kicinski commit 823163ba6e52e644be5df4539a19e3df8d0988dd Author: Manish Chopra Date: Thu Dec 2 13:01:57 2021 -0800 qed*: esl priv flag support through ethtool ESL(Enhanced System Lockdown) was designed to lock PCI adapter firmware images and prevent changes to critical non-volatile configuration data so that uncontrolled, malicious or unintentional modification to the adapters are avoided, ensuring it's operational state. Once this feature is enabled, the device is locked, rejecting any modification to non-volatile images. Once unlocked, the protection is off such that firmware and non-volatile configurations may be altered. Driver just reflects the capability and status of this through the ethtool private flag. Signed-off-by: Manish Chopra Signed-off-by: Prabhakar Kushwaha Signed-off-by: Alok Prasad Signed-off-by: Ariel Elior Signed-off-by: Jakub Kicinski commit 0cc3a8017900f856f9bf4fdc41c2b5cb1670aabe Author: Manish Chopra Date: Thu Dec 2 13:01:56 2021 -0800 qed*: enhance tx timeout debug info This patch add some new qed APIs to query status block info and report various data to MFW on tx timeout event Along with that it enhances qede to dump more debug logs (not just specific to the queue which was reported by stack) on tx timeout which includes various other basic metadata about all tx queues and other info (like status block etc.) Signed-off-by: Manish Chopra Signed-off-by: Prabhakar Kushwaha Signed-off-by: Alok Prasad Signed-off-by: Ariel Elior Signed-off-by: Jakub Kicinski commit 433fe39f674d58bc7a3e8254a5d2ffc290b7e04e Author: Stafford Horne Date: Sat Dec 4 07:10:18 2021 +0900 openrisc: Add clone3 ABI wrapper Like fork and clone the clone3 syscall needs a wrapper to save callee saved registers, which is required by the OpenRISC ABI. This came up after auditing code following a discussion with Rob Landley and Arnd Bergmann [0]. Tested with the clone3 kselftests and there were no issues. [0] https://lore.kernel.org/all/41206fc7-f8ce-98aa-3718-ba3e1431e320@landley.net/T/#m9c0cdb2703813b9df4da04cf6b30de1f1aa89944 Fixes: 07e83dfbe16c ("openrisc: Enable the clone3 syscall") Cc: Rob Landley Cc: Arnd Bergmann Signed-off-by: Stafford Horne commit 07baf50ac754384b9ea996f82b9a2a8aba946aa4 Author: Stafford Horne Date: Fri Dec 3 22:56:50 2021 +0900 openrisc: Use delay slot for clone and fork wrappers This saves one instruction. Signed-off-by: Stafford Horne commit 840b66c2550df04fbd66d8be782efa23649a0163 Author: Stafford Horne Date: Fri Dec 3 22:42:05 2021 +0900 openrisc: Cleanup switch code and comments The saving of the r12 register was there for a compiler bug referring to a port that was never upstreamed. It should be safe to use this as the new compiler is what we use and the old deprecated. Also, clean up some typos and references to old names in the switch comments. Signed-off-by: Stafford Horne commit dfb924e33927ffa51e197acd58ad1c5edf1b5ff5 Author: Clint Taylor Date: Fri Dec 3 17:01:40 2021 -0800 drm/i915/adlp: Remove require_force_probe protection Remove force probe protection from ADL_P platform. Did not obsevre 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: Rodrigo Vivi Acked-by: Jon Bloomfield Signed-off-by: Clint Taylor Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20211204010140.22839-1-clinton.a.taylor@intel.com commit da54ab14953c38d98cb3e34c564c06c3739394b2 Author: Maxim Mikityanskiy Date: Tue Nov 30 20:18:11 2021 +0200 bpf: Fix the test_task_vma selftest to support output shorter than 1 kB The test for bpf_iter_task_vma assumes that the output will be longer than 1 kB, as the comment above the loop says. Due to this assumption, the loop becomes infinite if the output turns to be shorter than 1 kB. The return value of read_fd_into_buffer is 0 when the end of file was reached, and len isn't being increased any more. This commit adds a break on EOF to handle short output correctly. For the reference, this is the contents that I get when running test_progs under vmtest.sh, and it's shorter than 1 kB: 00400000-00401000 r--p 00000000 fe:00 25867 /root/bpf/test_progs 00401000-00674000 r-xp 00001000 fe:00 25867 /root/bpf/test_progs 00674000-0095f000 r--p 00274000 fe:00 25867 /root/bpf/test_progs 0095f000-00983000 r--p 0055e000 fe:00 25867 /root/bpf/test_progs 00983000-00a8a000 rw-p 00582000 fe:00 25867 /root/bpf/test_progs 00a8a000-0484e000 rw-p 00000000 00:00 0 7f6c64000000-7f6c64021000 rw-p 00000000 00:00 0 7f6c64021000-7f6c68000000 ---p 00000000 00:00 0 7f6c6ac8f000-7f6c6ac90000 r--s 00000000 00:0d 8032 anon_inode:bpf-map 7f6c6ac90000-7f6c6ac91000 ---p 00000000 00:00 0 7f6c6ac91000-7f6c6b491000 rw-p 00000000 00:00 0 7f6c6b491000-7f6c6b492000 r--s 00000000 00:0d 8032 anon_inode:bpf-map 7f6c6b492000-7f6c6b493000 rw-s 00000000 00:0d 8032 anon_inode:bpf-map 7ffc1e23d000-7ffc1e25e000 rw-p 00000000 00:00 0 7ffc1e3b8000-7ffc1e3bc000 r--p 00000000 00:00 0 7ffc1e3bc000-7ffc1e3bd000 r-xp 00000000 00:00 0 7fffffffe000-7ffffffff000 --xp 00000000 00:00 0 Fixes: e8168840e16c ("selftests/bpf: Add test for bpf_iter_task_vma") Signed-off-by: Maxim Mikityanskiy Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20211130181811.594220-1-maximmi@nvidia.com commit 4cafe86c9267f9dd5819df946ba8c038ba958370 Author: Ming Lei Date: Fri Dec 3 21:15:34 2021 +0800 blk-mq: run dispatch lock once in case of issuing from list It isn't necessary to call blk_mq_run_dispatch_ops() once for issuing single request directly, and enough to do it one time when issuing from whole list. Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20211203131534.3668411-5-ming.lei@redhat.com Signed-off-by: Jens Axboe commit bcc330f42f442a98d61f153d16c0b6487461ee81 Author: Ming Lei Date: Fri Dec 3 21:15:33 2021 +0800 blk-mq: pass request queue to blk_mq_run_dispatch_ops We have switched to allocate srcu into request queue, so it is fine to pass request queue to blk_mq_run_dispatch_ops(). Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20211203131534.3668411-4-ming.lei@redhat.com Signed-off-by: Jens Axboe commit 704b914f15fb7daaf517e3acc4bed472b50ca19e Author: Ming Lei Date: Fri Dec 3 21:15:32 2021 +0800 blk-mq: move srcu from blk_mq_hw_ctx to request_queue In case of BLK_MQ_F_BLOCKING, per-hctx srcu is used to protect dispatch critical area. However, this srcu instance stays at the end of hctx, and it often takes standalone cacheline, often cold. Inside srcu_read_lock() and srcu_read_unlock(), WRITE is always done on the indirect percpu variable which is allocated from heap instead of being embedded, srcu->srcu_idx is read only in srcu_read_lock(). It doesn't matter if srcu structure stays in hctx or request queue. So switch to per-request-queue srcu for protecting dispatch, and this way simplifies quiesce a lot, not mention quiesce is always done on the request queue wide. Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20211203131534.3668411-3-ming.lei@redhat.com Signed-off-by: Jens Axboe commit 2a904d00855f94cb85751e45fa494f225d44ae0d Author: Ming Lei Date: Fri Dec 3 21:15:31 2021 +0800 blk-mq: remove hctx_lock and hctx_unlock Remove hctx_lock and hctx_unlock, and add one helper of blk_mq_run_dispatch_ops() to run code block defined in dispatch_ops with rcu/srcu read held. Compared with hctx_lock()/hctx_unlock(): 1) remove 2 branch to 1, so we just need to check (hctx->flags & BLK_MQ_F_BLOCKING) once when running one dispatch_ops 2) srcu_idx needn't to be touched in case of non-blocking 3) might_sleep_if() can be moved to the blocking branch Also put the added blk_mq_run_dispatch_ops() in private header, so that the following patch can use it out of blk-mq.c. Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20211203131534.3668411-2-ming.lei@redhat.com Signed-off-by: Jens Axboe commit 0a467d0fdd9594fbb449ebc93852533332c528fd Author: Jens Axboe Date: Thu Oct 14 14:39:59 2021 -0600 block: switch to atomic_t for request references refcount_t is not as expensive as it used to be, but it's still more expensive than the io_uring method of using atomic_t and just checking for potential over/underflow. This borrows that same implementation, which in turn is based on the mm implementation from Linus. Reviewed-by: Keith Busch Signed-off-by: Jens Axboe commit ceaa762527f41a431b552bc000de4b626d2d8cb7 Author: Jens Axboe Date: Thu Oct 28 08:57:09 2021 -0600 block: move direct_IO into our own read_iter handler Don't call into generic_file_read_iter() if we know it's O_DIRECT, just set it up ourselves and call our own handler. This avoids an indirect call for O_DIRECT. Fall back to filemap_read() if we fail. Signed-off-by: Jens Axboe commit 4bdcd1dd4d2f973b1a89fb20ba720d879e9e506b Author: Jens Axboe Date: Thu Oct 28 08:47:05 2021 -0600 mm: move filemap_range_needs_writeback() into header No functional changes in this patch, just in preparation for efficiently calling this light function from the block O_DIRECT handling. Reviewed-by: Matthew Wilcox (Oracle) Signed-off-by: Jens Axboe commit 9d3f401c52e3eeeb6cf2c642a8d17879b0e1a3d3 Merge: 5ae9497dda628 fcb116bc43c8c Author: Eric W. Biederman Date: Fri Dec 3 12:39:58 2021 -0600 Merge SA_IMMUTABLE-fixes-for-v5.16-rc2 I completed the first batch of signal changes for v5.17 against v5.16-rc1 before the SA_IMMUTABLE fixes where completed. Which leaves me with two lines of development that I want on my signal development branch both rooted at v5.16-rc1. Especially as I am hoping to reach the point of being able to remove SA_IMMUTABLE. Linus merged my SA_IMUTABLE fixes as: 7af959b5d5c8 ("Merge branch 'SA_IMMUTABLE-fixes-for-v5.16-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace") To avoid rebasing the development changes that are currently complete I am merging the work I sent upstream to Linus to make my life simpler. The SA_IMMUTABLE changes as they are described in Linus's merge commit. Pull exit-vs-signal handling fixes from Eric Biederman: "This is a small set of changes where debuggers were no longer able to intercept synchronous SIGTRAP and SIGSEGV, introduced by the exit cleanups. This is essentially the change you suggested with all of i's dotted and the t's crossed so that ptrace can intercept all of the cases it has been able to intercept the past, and all of the cases that made it to exit without giving ptrace a chance still don't give ptrace a chance" * 'SA_IMMUTABLE-fixes-for-v5.16-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: signal: Replace force_fatal_sig with force_exit_sig when in doubt signal: Don't always set SA_IMMUTABLE for forced signals Signed-off-by: "Eric W. Biederman" commit 78c1f8d0634cc35da613d844eda7c849fc50f643 Author: Alexei Starovoitov Date: Fri Dec 3 10:28:36 2021 -0800 libbpf: Reduce bpf_core_apply_relo_insn() stack usage. Reduce bpf_core_apply_relo_insn() stack usage and bump BPF_CORE_SPEC_MAX_LEN limit back to 64. Fixes: 29db4bea1d10 ("bpf: Prepare relo_core.c for kernel duty.") Signed-off-by: Alexei Starovoitov Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211203182836.16646-1-alexei.starovoitov@gmail.com commit 561ae1d46a8ddcbc13162d5771f5ed6c8249e730 Author: Sean Wang Date: Thu Dec 2 02:02:47 2021 +0800 Bluetooth: btmtksdio: fix resume failure btmtksdio have to rely on MMC_PM_KEEP_POWER in pm_flags to avoid that SDIO power is being shut off during the device is in suspend. That fixes the SDIO command fails to access the bus after the device is resumed. Fixes: 7f3c563c575e7 ("Bluetooth: btmtksdio: Add runtime PM support to SDIO based Bluetooth") Co-developed-by: Mark-yw Chen Signed-off-by: Mark-yw Chen Signed-off-by: Sean Wang Signed-off-by: Marcel Holtmann commit 4b4b2228f521c338030b1f310a5dee73fd7d8f26 Author: Sean Wang Date: Thu Dec 2 02:02:46 2021 +0800 Bluetooth: btmtksdio: handle runtime pm only when sdio_func is available Runtime pm ops is not aware the sdio_func status that is probably being disabled by btmtksdio_close. Thus, we are only able to access the sdio_func for the runtime pm operations only when the sdio_func is available. Fixes: 7f3c563c575e7 ("Bluetooth: btmtksdio: Add runtime PM support to SDIO based Bluetooth") Co-developed-by: Mark-yw Chen Signed-off-by: Mark-yw Chen Signed-off-by: Sean Wang Signed-off-by: Marcel Holtmann commit 0bf40542c05ef62997738cd45eea553415adb045 Author: Andrii Nakryiko Date: Thu Dec 2 16:46:40 2021 -0800 perf: Mute libbpf API deprecations temporarily Libbpf development version was bumped to 0.7 in c93faaaf2f67 ("libbpf: Deprecate bpf_prog_load_xattr() API"), activating a bunch of previously scheduled deprecations. Most APIs are pretty straightforward to replace with newer APIs, but perf has a complicated mixed setup with libbpf used both as static and shared configurations, which makes it non-trivial to migrate the APIs. Further, bpf_program__set_prep() needs more involved refactoring, which will require help from Arnaldo and/or Jiri. So for now, mute deprecation warnings and work on migrating perf off of deprecated APIs separately with the input from owners of the perf tool. Fixes: c93faaaf2f67 ("libbpf: Deprecate bpf_prog_load_xattr() API") Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211203004640.2455717-1-andrii@kernel.org commit 8722ded49ce8a0c706b373e8087eb810684962ff Author: Dan Carpenter Date: Wed Dec 1 20:48:31 2021 -0800 drm/i915: Fix error pointer dereference in i915_gem_do_execbuffer() Originally "out_fence" was set using out_fence = sync_file_create() but which returns NULL, but now it is set with out_fence = eb_requests_create() which returns error pointers. The error path needs to be modified to avoid an Oops in the "goto err_request;" path. Fixes: 544460c33821 ("drm/i915: Multi-BB execbuf") Signed-off-by: Dan Carpenter Signed-off-by: Matthew Brost Reviewed-by: Matthew Brost Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20211202044831.29583-1-matthew.brost@intel.com commit c97a747efc93f94a4ad6c707972dfbf8d774edf9 Author: Benjamin Berg Date: Fri Dec 3 15:59:02 2021 +0100 Bluetooth: btusb: Cancel sync commands for certain URB errors Cancel sync commands when transmission of URBs fail. This is done for both failures to send a command URB and also when the interrupt URB used to retrieve a response fails. This approach is sufficient to quickly deal with certain errors such as a device being disconnected while synchronous commands are done during initialization. Signed-off-by: Benjamin Berg Signed-off-by: Luiz Augusto von Dentz commit 2250abadd3508d6961f1aa56cf8cff59f0196cb8 Author: Benjamin Berg Date: Fri Dec 3 15:59:01 2021 +0100 Bluetooth: hci_core: Cancel sync command if sending a frame failed If sending a frame failed any sync command associated with it will never be completed. As such, cancel any such command immediately to avoid timing out. Signed-off-by: Benjamin Berg Signed-off-by: Luiz Augusto von Dentz commit 914b08b330d6722ed081e14580aae6fe66cd5946 Author: Benjamin Berg Date: Fri Dec 3 15:59:00 2021 +0100 Bluetooth: Add hci_cmd_sync_cancel to public API After transfer errors it makes sense to cancel an ongoing synchronous command that cannot complete anymore. To permit this, export the old hci_req_sync_cancel function as hci_cmd_sync_cancel in the API. Signed-off-by: Benjamin Berg Signed-off-by: Luiz Augusto von Dentz commit ae422391e17d30a2fb1d0968142dcd1e4cdc172a Author: Benjamin Berg Date: Fri Dec 3 15:58:59 2021 +0100 Bluetooth: Reset more state when cancelling a sync command Resetting the timers and cmd_cnt means that we assume the device will be in a good state after the sync command finishes. Without this a chain of synchronous commands might get stuck if one of them is cancelled. Signed-off-by: Benjamin Berg Signed-off-by: Luiz Augusto von Dentz commit af10ec31a81b2f8b9a3b2d1ef05f553cc9495701 Author: Tejas Upadhyay Date: Fri Dec 3 13:07:20 2021 +0530 drm/i915/adl_p: Add ddc pin mapping From VBT, ddc pin info suggests the following mapping: VBT DRIVER DDI TC1->ddc_pin=3 should translate to PORT_TC1->0x9 DDI TC2->ddc_pin=4 should translate to PORT_TC2->0xa DDI TC3->ddc_pin=5 should translate to PORT_TC3->0xb DDI TC4->ddc_pin=6 should translate to PORT_TC4->0xc Adding pin map to facilitate this translation as we cannot use existing icl ddc pin map due to conflict with DDI C and DDI TC1 info. Bspec:20124 v2: - Changed Author to Tejas Upadhyay Cc: Clinton Taylor Cc: Matt Atwood Cc: Matt Roper Acked-by: Imre Deak Signed-off-by: Lee Shawn C Signed-off-by: Tejas Upadhyay Signed-off-by: Raviteja Goud Talla Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20211203073720.3823371-1-ravitejax.goud.talla@intel.com commit 4472071331549e911a5abad41aea6e3be855a1a4 Author: Christian Brauner Date: Fri Dec 3 12:17:03 2021 +0100 fs: use low-level mapping helpers In a few places the vfs needs to interact with bare k{g,u}ids directly instead of struct inode. These are just a few. In previous patches we introduced low-level mapping helpers that are able to support filesystems mounted an idmapping. This patch simply converts the places to use these new helpers. Link: https://lore.kernel.org/r/20211123114227.3124056-7-brauner@kernel.org (v1) Link: https://lore.kernel.org/r/20211130121032.3753852-7-brauner@kernel.org (v2) Link: https://lore.kernel.org/r/20211203111707.3901969-7-brauner@kernel.org Cc: Seth Forshee Cc: Amir Goldstein Cc: Christoph Hellwig Cc: Al Viro CC: linux-fsdevel@vger.kernel.org Reviewed-by: Seth Forshee Signed-off-by: Christian Brauner commit 8cc5c54de44c5e8e104d364a627ac4296845fc7f Author: Christian Brauner Date: Fri Dec 3 12:17:02 2021 +0100 docs: update mapping documentation Now that we implement the full remapping algorithms described in our documentation remove the section about shortcircuting them. Link: https://lore.kernel.org/r/20211123114227.3124056-6-brauner@kernel.org (v1) Link: https://lore.kernel.org/r/20211130121032.3753852-6-brauner@kernel.org (v2) Link: https://lore.kernel.org/r/20211203111707.3901969-6-brauner@kernel.org Cc: Seth Forshee Cc: Amir Goldstein Cc: Christoph Hellwig Cc: Al Viro CC: linux-fsdevel@vger.kernel.org Reviewed-by: Seth Forshee Signed-off-by: Christian Brauner commit 1ac2a4104968e0a60b4b3572216a92aab5c1b025 Author: Christian Brauner Date: Fri Dec 3 12:17:01 2021 +0100 fs: account for filesystem mappings Currently we only support idmapped mounts for filesystems mounted without an idmapping. This was a conscious decision mentioned in multiple places (cf. e.g. [1]). As explained at length in [3] it is perfectly fine to extend support for idmapped mounts to filesystem's mounted with an idmapping should the need arise. The need has been there for some time now. Various container projects in userspace need this to run unprivileged and nested unprivileged containers (cf. [2]). Before we can port any filesystem that is mountable with an idmapping to support idmapped mounts we need to first extend the mapping helpers to account for the filesystem's idmapping. This again, is explained at length in our documentation at [3] but I'll give an overview here again. Currently, the low-level mapping helpers implement the remapping algorithms described in [3] in a simplified manner. Because we could rely on the fact that all filesystems supporting idmapped mounts are mounted without an idmapping the translation step from or into the filesystem idmapping could be skipped. In order to support idmapped mounts of filesystem's mountable with an idmapping the translation step we were able to skip before cannot be skipped anymore. A filesystem mounted with an idmapping is very likely to not use an identity mapping and will instead use a non-identity mapping. So the translation step from or into the filesystem's idmapping in the remapping algorithm cannot be skipped for such filesystems. More details with examples can be found in [3]. This patch adds a few new and prepares some already existing low-level mapping helpers to perform the full translation algorithm explained in [3]. The low-level helpers can be written in a way that they only perform the additional translation step when the filesystem is indeed mounted with an idmapping. If the low-level helpers detect that they are not dealing with an idmapped mount they can simply return the relevant k{g,u}id unchanged; no remapping needs to be performed at all. The no_idmapping() helper detects whether the shortcut can be used. If the low-level helpers detected that they are dealing with an idmapped mount but the underlying filesystem is mounted without an idmapping we can rely on the previous shorcut and can continue to skip the translation step from or into the filesystem's idmapping. These checks guarantee that only the minimal amount of work is performed. As before, if idmapped mounts aren't used the low-level helpers are idempotent and no work is performed at all. This patch adds the helpers mapped_k{g,u}id_fs() and mapped_k{g,u}id_user(). Following patches will port all places to replace the old k{g,u}id_into_mnt() and k{g,u}id_from_mnt() with these two new helpers. After the conversion is done k{g,u}id_into_mnt() and k{g,u}id_from_mnt() will be removed. This also concludes the renaming of the mapping helpers we started in [4]. Now, all mapping helpers will started with the "mapped_" prefix making everything nice and consistent. The mapped_k{g,u}id_fs() helpers replace the k{g,u}id_into_mnt() helpers. They are to be used when k{g,u}ids are to be mapped from the vfs, e.g. from from struct inode's i_{g,u}id. Conversely, the mapped_k{g,u}id_user() helpers replace the k{g,u}id_from_mnt() helpers. They are to be used when k{g,u}ids are to be written to disk, e.g. when entering from a system call to change ownership of a file. This patch only introduces the helpers. It doesn't yet convert the relevant places to account for filesystem mounted with an idmapping. [1]: commit 2ca4dcc4909d ("fs/mount_setattr: tighten permission checks") [2]: https://github.com/containers/podman/issues/10374 [3]: Documentations/filesystems/idmappings.rst [4]: commit a65e58e791a1 ("fs: document and rename fsid helpers") Link: https://lore.kernel.org/r/20211123114227.3124056-5-brauner@kernel.org (v1) Link: https://lore.kernel.org/r/20211130121032.3753852-5-brauner@kernel.org (v2) Link: https://lore.kernel.org/r/20211203111707.3901969-5-brauner@kernel.org Cc: Seth Forshee Cc: Amir Goldstein Cc: Christoph Hellwig Cc: Al Viro CC: linux-fsdevel@vger.kernel.org Reviewed-by: Seth Forshee Signed-off-by: Christian Brauner commit 67b858dd89932086ae0ee2d0ce4dd070a2c88bb3 Author: Raviteja Goud Talla Date: Fri Dec 3 20:26:03 2021 +0530 drm/i915/gen11: Moving WAs to icl_gt_workarounds_init() Bspec page says "Reset: BUS", Accordingly moving w/a's: Wa_1407352427,Wa_1406680159 to proper function icl_gt_workarounds_init() Which will resolve guc enabling error v2: - Previous patch rev2 was created by email client which caused the Build failure, This v2 is to resolve the previous broken series Reviewed-by: John Harrison Signed-off-by: Raviteja Goud Talla Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20211203145603.4006937-1-ravitejax.goud.talla@intel.com commit 476860b3eb4a50958243158861d5340066df5af2 Author: Christian Brauner Date: Fri Dec 3 12:17:00 2021 +0100 fs: tweak fsuidgid_has_mapping() If the caller's fs{g,u}id aren't mapped in the mount's idmapping we can return early and skip the check whether the mapped fs{g,u}id also have a mapping in the filesystem's idmapping. If the fs{g,u}id aren't mapped in the mount's idmapping they consequently can't be mapped in the filesystem's idmapping. So there's no point in checking that. Link: https://lore.kernel.org/r/20211123114227.3124056-4-brauner@kernel.org (v1) Link: https://lore.kernel.org/r/20211130121032.3753852-4-brauner@kernel.org (v2) Link: https://lore.kernel.org/r/20211203111707.3901969-4-brauner@kernel.org Cc: Seth Forshee Cc: Christoph Hellwig Cc: Al Viro CC: linux-fsdevel@vger.kernel.org Reviewed-by: Amir Goldstein Reviewed-by: Seth Forshee Signed-off-by: Christian Brauner commit a793d79ea3e041081cd7cbd8ee43d0b5e4914a2b Author: Christian Brauner Date: Fri Dec 3 12:16:59 2021 +0100 fs: move mapping helpers The low-level mapping helpers were so far crammed into fs.h. They are out of place there. The fs.h header should just contain the higher-level mapping helpers that interact directly with vfs objects such as struct super_block or struct inode and not the bare mapping helpers. Similarly, only vfs and specific fs code shall interact with low-level mapping helpers. And so they won't be made accessible automatically through regular {g,u}id helpers. Link: https://lore.kernel.org/r/20211123114227.3124056-3-brauner@kernel.org (v1) Link: https://lore.kernel.org/r/20211130121032.3753852-3-brauner@kernel.org (v2) Link: https://lore.kernel.org/r/20211203111707.3901969-3-brauner@kernel.org Cc: Seth Forshee Cc: Christoph Hellwig Cc: Al Viro CC: linux-fsdevel@vger.kernel.org Reviewed-by: Amir Goldstein Reviewed-by: Seth Forshee Signed-off-by: Christian Brauner commit bb49e9e730c2906a958eee273a7819f401543d6c Author: Christian Brauner Date: Fri Dec 3 12:16:58 2021 +0100 fs: add is_idmapped_mnt() helper Multiple places open-code the same check to determine whether a given mount is idmapped. Introduce a simple helper function that can be used instead. This allows us to get rid of the fragile open-coding. We will later change the check that is used to determine whether a given mount is idmapped. Introducing a helper allows us to do this in a single place instead of doing it for multiple places. Link: https://lore.kernel.org/r/20211123114227.3124056-2-brauner@kernel.org (v1) Link: https://lore.kernel.org/r/20211130121032.3753852-2-brauner@kernel.org (v2) Link: https://lore.kernel.org/r/20211203111707.3901969-2-brauner@kernel.org Cc: Seth Forshee Cc: Christoph Hellwig Cc: Al Viro CC: linux-fsdevel@vger.kernel.org Reviewed-by: Amir Goldstein Reviewed-by: Seth Forshee Signed-off-by: Christian Brauner commit e1cd82a339024beda8439fb2e20718363ee989a8 Author: Ingo Molnar Date: Tue Nov 16 06:13:05 2021 +0100 x86/mm: Add missing dependency to In the following commit: 025768a966a3 x86/cpu: Use alternative to generate the TASK_SIZE_MAX constant ... we added the new task_size_max() inline, which uses X86_FEATURE_LA57, but doesn't include which defines the constant. Due to the way alternatives macros work currently this doesn't get reported as an immediate build error, only as a link error, if a .c file happens to include first: > ld: kernel/fork.o:(.altinstructions+0x98): undefined reference to `X86_FEATURE_LA57' In the current upstream kernel no .c file includes before including some other header that includes , which is why this dependency bug went unnoticed. Cc: Linus Torvalds Cc: Borislav Petkov Cc: Thomas Gleixner Signed-off-by: Ingo Molnar commit 9e4d52a00a0217857fa40dc998971a375f861a61 Author: Geert Uytterhoeven Date: Fri Dec 3 14:55:23 2021 +0100 x86/ce4100: Replace "ti,pcf8575" by "nxp,pcf8575" The TI part is equivalent to the NXP part, and its compatible value is not documented in the DT bindings. Note that while the Linux driver DT match table does not contain the compatible value of the TI part, it could still match to this part, as i2c_device_id-based matching ignores the vendor part of the compatible value. Signed-off-by: Geert Uytterhoeven Signed-off-by: Borislav Petkov Reviewed-by: Andy Shevchenko Link: https://lkml.kernel.org/r/0c00cec971f5c405e47d04e493d854de0efc2e49.1638539629.git.geert+renesas@glider.be commit b1e4747259f4173354b914fb50e547ebb80fffbe Author: Ville Syrjälä Date: Wed Dec 1 17:25:41 2021 +0200 drm/i915: Get rid of the "sizes are 0 based" stuff Replace the "sizes are 0 based" stuff with just straight up -1 where needed. Less confusing all around. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211201152552.7821-4-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza commit 812e338619f166d3ab864123b2572523f6e4916a Author: Ville Syrjälä Date: Wed Nov 24 13:36:52 2021 +0200 drm/i915/fbc: Pimp the FBC debugfs output Now that each plane tracks its own no_fbc_reason we can print that out in debugfs, and we can also show which plane is currently selected for FBC duty. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211124113652.22090-21-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 40affbf8e615addd8cc877f0a4fff1faafc4bb34 Author: Vamsi krishna Lanka Date: Wed Dec 1 16:21:35 2021 -0800 clk: qcom: Add support for SDX65 RPMh clocks Add support for clocks maintained by RPMh in SDX65 SoCs. Signed-off-by: Vamsi Krishna Lanka Acked-by: Bjorn Andersson Reviewed-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/366448562ac52c600c45b5a15129d78b5e8dd5a7.1638402361.git.quic_vamslank@quicinc.com commit aa848c8ee8915b2a8c973d90f1c7f8e96d17fd25 Author: Vamsi krishna Lanka Date: Wed Dec 1 16:21:34 2021 -0800 dt-bindings: clock: Introduce RPMHCC bindings for SDX65 Add compatible for SDX65 RPMHCC. Signed-off-by: Vamsi Krishna Lanka Reviewed-by: Bjorn Andersson Acked-by: Rob Herring Reviewed-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/91c10dde568098027833dfcc310748a92a90387e.1638402361.git.quic_vamslank@quicinc.com commit c097af1d0a8483b44fa30e86b311991d76b6ae67 Author: Daniel Scally Date: Sun Nov 28 23:24:55 2021 +0000 device property: Check fwnode->secondary when finding properties fwnode_property_get_reference_args() searches for named properties against a fwnode_handle, but these could instead be against the fwnode's secondary. If the property isn't found against the primary, check the secondary to see if it's there instead. Reviewed-by: Andy Shevchenko Reviewed-by: Hans de Goede Signed-off-by: Daniel Scally Link: https://lore.kernel.org/r/20211128232455.39332-1-djrscally@gmail.com Signed-off-by: Greg Kroah-Hartman commit e1b5186810cc7d4ec60447032636b8e6772dbbc6 Author: Ira Weiny Date: Wed Dec 1 20:43:05 2021 -0800 Documentation/auxiliary_bus: Move the text into the code The code and documentation are more difficult to maintain when kept separately. This is further compounded when the standard structure documentation infrastructure is not used. Move the documentation into the code, use the standard documentation infrastructure, add current documented functions, and reference the text in the rst file. Suggested-by: Greg Kroah-Hartman Signed-off-by: Ira Weiny Link: https://lore.kernel.org/r/20211202044305.4006853-8-ira.weiny@intel.com Signed-off-by: Greg Kroah-Hartman commit 8a2d6ffe7740cb8c944968aa9b0705e20afeef87 Author: Ira Weiny Date: Wed Dec 1 20:43:04 2021 -0800 Documentation/auxiliary_bus: Clarify the release of devices from find device auxiliary_find_device() takes a proper get_device() reference on the device before returning the matched device. Users of this call should be informed that they need to properly release this reference with put_device(). Signed-off-by: Ira Weiny Link: https://lore.kernel.org/r/20211202044305.4006853-7-ira.weiny@intel.com Signed-off-by: Greg Kroah-Hartman commit 14866a7db8da1f61fb6135c461b733694eea9580 Author: Ira Weiny Date: Wed Dec 1 20:43:03 2021 -0800 Documentation/auxiliary_bus: Add example code for module_auxiliary_driver() Add an example code snipit to the module_auxiliary_driver() documentation which is consistent with the other example code in the elsewhere in the documentation. Signed-off-by: Ira Weiny Link: https://lore.kernel.org/r/20211202044305.4006853-6-ira.weiny@intel.com Signed-off-by: Greg Kroah-Hartman commit 05021dca787be566886875dc0c683552e1c67e5e Author: Ira Weiny Date: Wed Dec 1 20:43:02 2021 -0800 Documentation/auxiliary_bus: Clarify __auxiliary_driver_register __auxiliary_driver_register is not intended to be called directly unless a custom name is required. Add documentation for this fact. Signed-off-by: Ira Weiny Link: https://lore.kernel.org/r/20211202044305.4006853-5-ira.weiny@intel.com Signed-off-by: Greg Kroah-Hartman commit cb2ba75935558e65f2c4fe411a78c375b2c64cb4 Author: Ira Weiny Date: Wed Dec 1 20:43:01 2021 -0800 Documentation/auxiliary_bus: Update Auxiliary device lifespan It was unclear when the auxiliary device objects were to be free'ed by the parent (registering) driver. Also there are some patterns like using devm_add_action_or_reset() which are helpful to mention to those using the interface to ensure they don't double free or miss freeing the auxiliary devices. Signed-off-by: Ira Weiny Link: https://lore.kernel.org/r/20211202044305.4006853-4-ira.weiny@intel.com Signed-off-by: Greg Kroah-Hartman commit 0d058a206adadf0c38f891b19dbdcb2963a1cd20 Author: Ira Weiny Date: Wed Dec 1 20:43:00 2021 -0800 Documentation/auxiliary_bus: Clarify match_name Provide example code for how the match name is formed and where it is supposed to be set. Signed-off-by: Ira Weiny Link: https://lore.kernel.org/r/20211202044305.4006853-3-ira.weiny@intel.com Signed-off-by: Greg Kroah-Hartman commit b247703873c4d5088eee52d7902495b24967ce8e Author: Ira Weiny Date: Wed Dec 1 20:42:59 2021 -0800 Documentation/auxiliary_bus: Clarify auxiliary_device creation The documentation for creating an auxiliary device is a 3 step not a 2 step process. Specifically the requirements of setting the name, id, dev.release, and dev.parent fields was not clear as a precursor to the '2 step' process documented. Clarify by declaring this a 3 step process starting with setting the fields of struct auxiliary_device correctly. Also add some sample code and tie the change into the rest of the documentation. Signed-off-by: Ira Weiny Link: https://lore.kernel.org/r/20211202044305.4006853-2-ira.weiny@intel.com Signed-off-by: Greg Kroah-Hartman commit 70602b37c4afd91c4dfc237121b31310b6c02a7a Author: Abhyuday Godhasara Date: Sun Nov 28 23:02:16 2021 -0800 driver: soc: xilinx: register for power events in zynqmp power driver With Xilinx Event Management driver, all types of events like power and error gets handled from single place as part of event management driver. So power events(SUSPEND_POWER_REQUEST and SUSPEND_SYSTEM_SHUTDOWN) also gets handled by event management driver instead of zynqmp_power driver. zynqmp-power driver use event management driver and provide callback function for Suspend and shutdown handler, which will be called by event management driver when respective event is arrived. If event management driver is not available than use ipi-mailbox rx channel or IPI interrupt IRQ handler for power events (suspend/shutdown) same as current zynqmp-power driver. Acked-by: Michal Simek Signed-off-by: Rajan Vaja Signed-off-by: Abhyuday Godhasara Link: https://lore.kernel.org/r/20211129070216.30253-4-abhyuday.godhasara@xilinx.com Signed-off-by: Greg Kroah-Hartman commit a515814e742d8dbd04a0bc2d73b798d7855ec532 Author: Abhyuday Godhasara Date: Sun Nov 28 23:02:15 2021 -0800 firmware: xilinx: instantiate xilinx event manager driver Register simple platform device to instantiate Xilinx event manager driver. Acked-by: Michal Simek Signed-off-by: Rajan Vaja Signed-off-by: Abhyuday Godhasara Link: https://lore.kernel.org/r/20211129070216.30253-3-abhyuday.godhasara@xilinx.com Signed-off-by: Greg Kroah-Hartman commit c7fdb2404f66131bc9c22e06f712717288826487 Author: Abhyuday Godhasara Date: Sun Nov 28 23:02:14 2021 -0800 drivers: soc: xilinx: add xilinx event management driver Xilinx event management driver provides an interface to subscribe or unsubscribe for the event/callback supported by firmware. An agent can use this driver to register for Error Event, Device Event and Suspend callback. This driver only allows one agent per event to do registration. Driver will return an error in case of multiple registration for the same event. This driver gets notification from firmware through TF-A as SGI. During initialization, event manager driver register handler for SGI used for notification. It also provides SGI number info to TF-A by using IOCTL_REGISTER_SGI call to TF-A. After receiving notification from firmware, the driver makes an SMC call to TF-A to get IPI data. From the IPI data provided by TF-A, event manager identified the cause of event and forward that event/callback notification to the respective subscribed driver. After this, in case of Error Event, driver performs unregistration as firmware expecting from agent to do re-registration if the agent wants to get notified on the second occurrence of an error event. Add new IOCTL id IOCTL_REGISTER_SGI = 25 which is used to register SGI on TF-A. Older firmware doesn't have all required support for event handling which is required by the event manager driver. So add check for the register notifier version in the event manager driver. Xilinx event management driver provides support to subscribe for multiple error events with the use of Event Mask in a single call of xlnx_register_event(). Agent driver can provide 'Event' parameter value as ORed of multiple event masks to register single callback for multiple events. For example, to register callback for event=0x1 and event=0x2 for the given node, agent can provide event=0x3 (0x1 | 0x2). It is not possible to register multiple events for different nodes in a single registration call. Also provide support to receive multiple error events as in single notification from firmware and then forward it to subscribed drivers via registered callback one by one. Acked-by: Michal Simek Signed-off-by: Tejas Patel Signed-off-by: Rajan Vaja Signed-off-by: Abhyuday Godhasara Link: https://lore.kernel.org/r/20211129070216.30253-2-abhyuday.godhasara@xilinx.com Signed-off-by: Greg Kroah-Hartman commit 86192251033308bb42f1e9813c962989d8ed07ec Author: Srinivas Kandagatla Date: Tue Nov 30 13:39:09 2021 +0000 nvmem: core: set size for sysfs bin file For some reason we never set the size for nvmem sysfs binary file. Set this. Reported-by: Gilles BULOZ Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20211130133909.6154-1-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman commit 13a5fad39a7b781c21d9528bcf52a5f5babafe99 Author: Cai Huoqing Date: Thu Dec 2 22:07:37 2021 +0800 tty: mips_ejtag_fdc: Make use of the helper function kthread_run_on_cpu() Replace kthread_create/kthread_bind/wake_up_process() with kthread_run_on_cpu() to simplify the code. Signed-off-by: Cai Huoqing Link: https://lore.kernel.org/r/20211202140737.94832-1-cai.huoqing@linux.dev Signed-off-by: Greg Kroah-Hartman commit e320d9c2e900d988c82021c80a3cbff488977946 Author: Rob Herring Date: Wed Dec 1 15:43:05 2021 -0600 gpio: xlp: Fix build errors from Netlogic XLP removal Commit ea708ac5bf41 ("gpio: xlp: Remove Netlogic XLP variants") has build errors with CONFIG_ACPI: drivers/gpio/gpio-xlp.c:300:23: error: 'GPIO_VARIANT_VULCAN' undeclared here (not in a function) and !CONFIG_OF: drivers/gpio/gpio-xlp.c:267:11: error: 'struct gpio_chip' has no member named 'of_node' Fix these errors. Fixes: ea708ac5bf41 ("gpio: xlp: Remove Netlogic XLP variants") Reported-by: Stephen Rothwell Reported-by: kernel test robot Cc: Linus Walleij Cc: Bartosz Golaszewski Cc: linux-gpio@vger.kernel.org Signed-off-by: Rob Herring Signed-off-by: Bartosz Golaszewski commit adc8b4bf2a7f6f513c560bb8e225d4750ce5e872 Author: John Keeping Date: Thu Dec 2 15:50:21 2021 +0000 gpio: rockchip: lock GPIOs used as interrupts Use the standard gpiochip request/release resource functions so that any GPIOs used as interrupts are properly locked. This allows libgpiod to correctly show these GPIOs as in-use. Signed-off-by: John Keeping Tested-by: Nicolas Frattaroli Signed-off-by: Bartosz Golaszewski commit f1045056c726440469d89d23c13734bcd6c0d15b Author: Heiko Carstens Date: Mon Nov 29 14:03:09 2021 +0100 topology/sysfs: rework book and drawer topology ifdefery Provide default defines for the topology_book_[id|cpumask] and topology_drawer_[id|cpumask] macros just like for each other topology level. This way all topology levels are handled in a similar way. Still the the book and drawer levels are only used on s390, and also the sysfs attributes are only created on s390. However other architectures may opt in if wanted. Acked-by: Peter Zijlstra (Intel) Signed-off-by: Heiko Carstens Link: https://lore.kernel.org/r/20211129130309.3256168-4-hca@linux.ibm.com Signed-off-by: Greg Kroah-Hartman commit e795707703b32fecdd7467afcc33ff1e92416c05 Author: Heiko Carstens Date: Mon Nov 29 14:03:08 2021 +0100 topology/sysfs: export cluster attributes only if an architectures has support The cluster_id and cluster_cpus topology sysfs attributes have been added with commit c5e22feffdd7 ("topology: Represent clusters of CPUs within a die"). They are currently only used for x86, arm64, and riscv (via generic arch topology), however they are still present with bogus default values for all other architectures. Instead of enforcing such new sysfs attributes to all architectures, make them only optional visible if an architecture opts in by defining both the topology_cluster_id and topology_cluster_cpumask attributes. This is similar to what was done when the book and drawer topology levels were introduced: avoid useless and therefore confusing sysfs attributes for architectures which cannot make use of them. This should not break any existing applications, since this is a new interface introduced with the v5.16 merge window. Acked-by: Peter Zijlstra (Intel) Signed-off-by: Heiko Carstens Link: https://lore.kernel.org/r/20211129130309.3256168-3-hca@linux.ibm.com Signed-off-by: Greg Kroah-Hartman commit 2c4dcd7fd57b20a21b65da04d89c38a7217d79cf Author: Heiko Carstens Date: Mon Nov 29 14:03:07 2021 +0100 topology/sysfs: export die attributes only if an architectures has support The die_id and die_cpus topology sysfs attributes have been added with commit 0e344d8c709f ("cpu/topology: Export die_id") and commit 2e4c54dac7b3 ("topology: Create core_cpus and die_cpus sysfs attributes"). While they are currently only used and useful for x86 they are still present with bogus default values for all architectures. Instead of enforcing such new sysfs attributes to all architectures, make them only optional visible if an architecture opts in by defining both the topology_die_id and topology_die_cpumask attributes. This is similar to what was done when the book and drawer topology levels were introduced: avoid useless and therefore confusing sysfs attributes for architectures which cannot make use of them. This should not break any existing applications, since this is a rather new interface and applications should be able to handle also older kernel versions without such attributes - besides that they contain only useful information for x86. Acked-by: Peter Zijlstra (Intel) Signed-off-by: Heiko Carstens Link: https://lore.kernel.org/r/20211129130309.3256168-2-hca@linux.ibm.com Signed-off-by: Greg Kroah-Hartman commit a00128dfc8fc0cc8848d9168d6e7cfff99bd46f0 Author: Geert Uytterhoeven Date: Fri Dec 3 15:06:44 2021 +0100 gpio: aggregator: Add interrupt support Currently the GPIO Aggregator does not support interrupts. This means that kernel drivers going from a GPIO to an IRQ using gpiod_to_irq(), and userspace applications using line events do not work. Add interrupt support by providing a gpio_chip.to_irq() callback, which just calls into the parent GPIO controller. Note that this does not implement full interrupt controller (irq_chip) support, so using e.g. gpio-keys with "interrupts" instead of "gpios" still does not work. Signed-off-by: Geert Uytterhoeven Signed-off-by: Bartosz Golaszewski commit 49fdfe66400614ee1c484057c79dd6642c535fd4 Author: Geert Uytterhoeven Date: Fri Dec 3 14:48:17 2021 +0100 gpiolib: Let gpiod_add_lookup_table() call gpiod_add_lookup_tables() This saves 20 bytes on arm32, and 44 bytes on arm64. Signed-off-by: Geert Uytterhoeven Signed-off-by: Bartosz Golaszewski commit bb14bfc7eb927b47717d82ba7ecc8345d9099cf4 Author: Dan Carpenter Date: Fri Dec 3 12:55:31 2021 +0300 net: lan966x: fix a IS_ERR() vs NULL check in lan966x_create_targets() The devm_ioremap() function does not return error pointers. It returns NULL. Fixes: db8bcaad5393 ("net: lan966x: add the basic lan966x driver") Signed-off-by: Dan Carpenter Reviewed-by: Horatiu Vultur Signed-off-by: David S. Miller commit f6882b8fac60f928fda51efc64274463806f956c Author: Yang Yingliang Date: Fri Dec 3 15:04:18 2021 +0800 net: prestera: acl: fix return value check in prestera_acl_rule_entry_find() rhashtable_lookup_fast() returns NULL pointer not ERR_PTR(). Return rhashtable_lookup_fast() directly to fix this. Fixes: 47327e198d42 ("net: prestera: acl: migrate to new vTCAM api") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Signed-off-by: David S. Miller commit c601ab0eb478f66ca30efd2534a818f3d1b91a25 Author: Abdun Nihaal Date: Wed Dec 1 21:00:39 2021 +0530 staging: r8188eu: Fix coding style error Move opening brace to next line to conform to kernel coding style. Fixes the following checkpatch error: ERROR: open brace '{' following function definitions go on the next line Signed-off-by: Abdun Nihaal Link: https://lore.kernel.org/r/20211201153039.305245-1-abdun.nihaal@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7fb6aea9ca847fbd7e4d3273ed202df943edce29 Author: Michael Straube Date: Thu Dec 2 20:23:09 2021 +0100 staging: r8188eu: pNumRxBytesUnicast is set but never used pNumRxBytesUnicast in odm_dm_struct is set but never used. Remove it. Acked-by: Martin Kaiser Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211202192309.9362-6-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 85d8264d9d580befee057dbc2b74b8fe6155f7da Author: Michael Straube Date: Thu Dec 2 20:23:08 2021 +0100 staging: r8188eu: pNumTxBytesUnicast is set but never used pNumTxBytesUnicast in odm_dm_struct is set but never used. Remove it. Acked-by: Martin Kaiser Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211202192309.9362-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit bbd11e051e104b08a6991f7dbbe16e71dda1ad78 Author: Michael Straube Date: Thu Dec 2 20:23:07 2021 +0100 staging: r8188eu: pSecurity is set but never used pSecurity in odm_dm_struct is set but never used. Remove it. Acked-by: Martin Kaiser Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211202192309.9362-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 993c689df5c4c1a8fda7d6eda749d06a80698226 Author: Michael Straube Date: Thu Dec 2 20:23:06 2021 +0100 staging: r8188eu: pbNet_closed is set but never used pbNet_closed in odm_dm_struct is set but never used. Remove it. Acked-by: Martin Kaiser Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211202192309.9362-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 28478b06acdff3034c6b357fb5d198b7bf06dd38 Author: Michael Straube Date: Thu Dec 2 20:23:05 2021 +0100 staging: r8188eu: remove unused variables from odm_dm_struct There are many unused variables in the odm_dm_struct structure. Remove them. Acked-by: Martin Kaiser Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211202192309.9362-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 55c57806796d614a5e99481134602b7c4f36619b Author: Michael Straube Date: Tue Nov 30 00:01:25 2021 +0100 staging: r8188eu: RFType is set but never used RFType is set but never used. Remove it from struct HAL_VERSION and remove the now unused enum HAL_RF_TYPE. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211129230125.27247-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit d7f79cdfe09067bc464b5b0293bfcc23cb29a2e4 Author: Martin Kaiser Date: Fri Nov 26 12:41:35 2021 +0100 staging: r8188eu: use a delayed worker for led updates The led layer uses a combination of timer and worker for periodic led updates, e.g. for blinking. The reason seems to be that blocking operations like a usb read are not allowed in a timer handler. Replace the combination of timer and worker with a delayed worker. Convert the timeout defines from milliseconds to jiffies to make them usable as delays for the delayed worker. Shorten the names of the defines and rename the work item to make checkpatch happy. Other layers may call SwLedControlMode1 to update the led state. Such an update may result in cancelling the delayed worker. SwLedControlMode1 might be called in interrupt context, we must use cancel_delayed_work to cancel the worker. cancel_delayed_work_sync waits until the worker is finished, this is not allowed in interrupt context. DeInitLed871x is called when the driver is removed or when the system goes into standby. We may use cancel_delayed_work_sync here to cancel the delayed worker. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211126114135.18228-1-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 505cf656383439ac6031fda6ae1906d8a1b368ea Author: Phillip Potter Date: Mon Nov 29 00:20:41 2021 +0000 staging: r8188eu: remove DBG_88E_LEVEL macro from include/rtw_debug.h Remove the DBG_88E_LEVEL macro definition from include/rtw_debug.h, as it has no callers and is surplus to requirements. This is motivated by ongoing efforts to remove all non-standard debugging code from the driver. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20211129002041.865-8-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 9763a6501e5f48d846bb0bd79f24407d83cc9878 Author: Phillip Potter Date: Mon Nov 29 00:20:40 2021 +0000 staging: r8188eu: convert DBG_88E_LEVEL calls in os_dep/ioctl_linux.c Convert all DBG_88E_LEVEL macro calls in os_dep/ioctl_linux.c to plain netdev_dbg calls, as although the information is potentially useful, we should be exposing it using standard kernel debugging functionality. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20211129002041.865-7-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 5ec394d58bdba731c2a33645be7018e71f72f287 Author: Phillip Potter Date: Mon Nov 29 00:20:39 2021 +0000 staging: r8188eu: convert DBG_88E_LEVEL call in hal/rtl8188e_hal_init.c Convert DBG_88E_LEVEL macro call in hal/rtl8188e_hal_init.c to plain dev_dbg call, as although the information is potentially useful, we should be exposing it using standard kernel debugging functionality. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20211129002041.865-6-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 6ba36a15b51b39b8ceffad1c68c1b3c6d86a62e0 Author: Phillip Potter Date: Mon Nov 29 00:20:38 2021 +0000 staging: r8188eu: convert DBG_88E_LEVEL calls in core/rtw_ioctl_set.c Convert all DBG_88E_LEVEL macro calls in core/rtw_ioctl_set.c to plain netdev_dbg calls, as although the information is potentially useful, we should be exposing it using standard kernel debugging functionality. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20211129002041.865-5-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 3ebdaac3636da9e37d985669107e73be38496bb9 Author: Phillip Potter Date: Mon Nov 29 00:20:37 2021 +0000 staging: r8188eu: convert DBG_88E_LEVEL call in core/rtw_xmit.c Convert single DBG_88E_LEVEL macro call in core/rtw_xmit.c to plain netdev_dbg call, as although the information is potentially useful, we should be exposing it using standard kernel debugging functionality. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20211129002041.865-4-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 5d81da8ddd42d506fd8ba98a71a6f303d95166b8 Author: Phillip Potter Date: Mon Nov 29 00:20:36 2021 +0000 staging: r8188eu: convert DBG_88E_LEVEL calls in core/rtw_pwrctrl.c Convert all DBG_88E_LEVEL macro calls in core/rtw_pwrctrl.c to plain netdev_dbg calls, as although the information is potentially useful, we should be exposing it using standard kernel debugging functionality. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20211129002041.865-3-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 9875e5b1e9ed13d37925f0b03fbeb34937b4e032 Author: Phillip Potter Date: Mon Nov 29 00:20:35 2021 +0000 staging: r8188eu: convert DBG_88E_LEVEL calls in core/rtw_mlme_ext.c Convert all DBG_88E_LEVEL macro calls in core/rtw_mlme_ext.c to plain netdev_dbg calls, as although the information is potentially useful, we should be exposing it using standard kernel debugging functionality. Also fix some indentation issues in the block of one such call, and remove usage of FUNC_ADPT_FMT/FUNC_ADPT_ARG macros in another, as netdev_dbg provides equivalent functionality. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20211129002041.865-2-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 6732886cf02b8807ebaf0e4c69bfbb757dd63347 Author: Michael Straube Date: Sun Nov 28 18:09:24 2021 +0100 staging: r8188eu: remove module parameter rtw_rf_config The module parameter rtw_rf_config is not used in the driver. Remove it and remove the now unused enum rt_rf_type_def. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211128170924.5874-11-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 8bdb3f27d00b6c23d2f57343f25a4b8df007c219 Author: Michael Straube Date: Sun Nov 28 18:09:23 2021 +0100 staging: r8188eu: remove rf_type from struct hal_data_8188e The field rf_type of struct hal_data_8188e is set to RF_1T1R and never changed. Also it is used only in a call to netdev_dbg() which is not very useful since RTL8188EU chips are always 1T1R. Remove the netdev_dbg() and remove rf_type from the hal_data_8188e structure. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211128170924.5874-10-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 5f56585eea13be872030dc1a0ac29dbdb43f9a20 Author: Michael Straube Date: Sun Nov 28 18:09:22 2021 +0100 staging: r8188eu: remove unused HW_VAR_RF_TYPE After previous cleanups HW_VAR_RF_TYPE is unused now. Remove it. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211128170924.5874-9-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 23a23327329895c6b3759540fdeef781aae2e2c2 Author: Michael Straube Date: Sun Nov 28 18:09:21 2021 +0100 staging: r8188eu: remove rf_type from bb_reg_dump() rf_type is always RF_1T1R. Remove it from bb_reg_dump() and remove resulting dead code. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211128170924.5874-8-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 3a8482bc23addd7806d374d72c1bcf8927e1e0f1 Author: Michael Straube Date: Sun Nov 28 18:09:20 2021 +0100 staging: r8188eu: remove rf_type from writeOFDMPowerReg88E() pHalData->rf_type is always RF_1T1R. Remove unnecessary checks from writeOFDMPowerReg88E(). Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211128170924.5874-7-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2f43a4e87a7b82d62778236bd71c18347a2e91bb Author: Michael Straube Date: Sun Nov 28 18:09:19 2021 +0100 staging: r8188eu: remove TxCount from getTxPowerIndex88E() In getTxPowerIndex88E() the variable TxCount is set to RF_PATH_A and never changed. Remove the unnecessary extra variable and replace its usage with RF_PATH_A. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211128170924.5874-6-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 8f18397277308220e7079fadaf71d5d9c72c71c5 Author: Michael Straube Date: Sun Nov 28 18:09:18 2021 +0100 staging: r8188eu: remove rf_type from getTxPowerIndex88E() pHalData->rf_type is always RF_1T1R. As a result the variable path_nums is always set to 1 and the for loop is entered only once with TxCount = 0. Also RF_PATH_A = 0. Remove the unneeded check for pHalData->rf_type and resulting dead code from getTxPowerIndex88E(). Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211128170924.5874-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 0cafa5b5eb224be837dd3c948d34bc977ddedc88 Author: Michael Straube Date: Sun Nov 28 18:09:17 2021 +0100 staging: r8188eu: remove rf_type from storePwrIndexDiffRateOffset() pHalData->rf_type is always RF_1T1R. Remove unnecessary checks and related dead code from storePwrIndexDiffRateOffset(). Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211128170924.5874-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit f95de483b5b138e3c1bea55617f89f5e2f38d10c Author: Michael Straube Date: Sun Nov 28 18:09:16 2021 +0100 staging: r8188eu: remove rf_type from issue_assocreq() rf_type is always RF_1T1R. Remove it from issue_assocreq() and remove related dead code. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211128170924.5874-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit d6734d08e45cebb129596930c2edb72eec1c482e Author: Michael Straube Date: Sun Nov 28 18:09:15 2021 +0100 staging: r8188eu: remove rf_type from rtw_update_ht_cap() rf_type is always RF_1T1R. Remove it from rtw_update_ht_cap() and remove related dead code. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211128170924.5874-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit ab11393fd004ed048cff93076569e41bb31fe22b Author: Andy Shevchenko Date: Thu Dec 2 23:00:29 2021 +0200 net: dsa: vsc73xxx: Get rid of duplicate of_node assignment GPIO library does copy the of_node from the parent device of the GPIO chip, there is no need to repeat this in the individual drivers. Remove assignment here. For the details one may look into the of_gpio_dev_init() implementation. Signed-off-by: Andy Shevchenko Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit 783133cd07d51ff568898e0b6cea628cc8f3e816 Author: Martin Kaiser Date: Fri Nov 26 14:04:00 2021 +0100 staging: r8188eu: loadparam needs no net_device Remove the second parameter of the loadparam function. This parameter is not used. Reviewed-by: Michael Straube Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211126130400.26151-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 2c102853a8e33edcdf023c0f7ce3d4d6ea686536 Author: Martin Kaiser Date: Fri Nov 26 14:03:59 2021 +0100 staging: r8188eu: remove _ps_close_RF The _ps_close_RF is empty. Remove it. Reviewed-by: Michael Straube Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211126130400.26151-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit cc8e6570e88ba55e492879dfadccc34abf91ce17 Author: Martin Kaiser Date: Fri Nov 26 14:03:58 2021 +0100 staging: r8188eu: remove _ps_open_RF The _ps_open_RF function is empty. Remove it. Reviewed-by: Michael Straube Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211126130400.26151-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit bf77d584b563a09913d028b14459eda5ef16b33c Author: Martin Kaiser Date: Fri Nov 26 14:03:57 2021 +0100 staging: r8188eu: remove pm_netdev_open The only caller of pm_netdev_open sets bnormal to true. In this case, pm_netdev_open just calls netdev_open. Remove pm_netdev_open and call netdev_open directly. Reviewed-by: Michael Straube Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211126130400.26151-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 75c488c0a44dc10dc03d90b87c1eebbf0b79d55a Author: Martin Kaiser Date: Fri Nov 26 18:32:05 2021 +0100 staging: r8188eu: require a single bulk in endpoint The current r8188eu driver code has no support for interrupt in endpoints. Some parts of the code assume implicitly that we use one single bulk in endpoint for the incoming network data. Make this assumption clearer and reject devices that have more than one bulk in endpoint. Ignore any interrupt in endpoints. We can then change RtInPipe into a single value instead of an array. There's no need any more to pass around the number of in endpoints. We know that it's one or the device would have been rejected. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211126173205.21352-9-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 47ca8d19408e250ed626e0ff20afe1b7e80cc452 Author: Martin Kaiser Date: Fri Nov 26 18:32:04 2021 +0100 staging: r8188eu: don't store nr_endpoint in a global struct There's no need to store the number of endpoints in a global struct. We only need it at startup when we iterate over the endpoints. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211126173205.21352-8-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit d667d76b62cd41a5571203f9965cd67d1713086e Author: Martin Kaiser Date: Fri Nov 26 18:32:03 2021 +0100 staging: r8188eu: remove ep_num array The ep_num array in struct dvobj_priv is not used. Remove it. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211126173205.21352-7-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 9c4bb17a207a76da97abdce6660710095652676c Author: Martin Kaiser Date: Fri Nov 26 18:32:02 2021 +0100 staging: r8188eu: if2 is not used Remove if2 from struct dvobj_priv. It is not used. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211126173205.21352-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 5da7b6537feed299a739d017e74cfb2a5b97a0be Author: Martin Kaiser Date: Fri Nov 26 18:32:01 2021 +0100 staging: r8188eu: remove code to get int in pipe handle After the previous cleanup, ffaddr2pipehdl is called only by rtw_write_port. This function will never ask for the pipe handle of the interrupt in pipe. We can remove the related code. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211126173205.21352-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit ad697c64350f64faabf98c851abb625b1b880116 Author: Martin Kaiser Date: Fri Nov 26 18:32:00 2021 +0100 staging: r8188eu: get the rcv bulk pipe handle directly There's no point in calling ffaddr2pipehdl from rtw_read_port if the endpoint address is constant. We can call usb_rcvbulkpipe ourselves to get the pipe handle. We can now remove RECV_BULK_IN_ADDR. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211126173205.21352-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 25b9bd7589109abcdc02a9e953c35f484037620e Author: Martin Kaiser Date: Fri Nov 26 18:31:59 2021 +0100 staging: r8188eu: only the bulk in ep is used for network data All supported devices use a single bulk in endpoint for receiving network data. The rtw_read_port function needs no addr parameter. The ff_hwaddr in struct recv_priv is also a constant value. We can use RECV_BULK_IN_ADDR directly. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211126173205.21352-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 678fb0b65e6eac8c550260f37531b8ecd53cd8bd Author: Martin Kaiser Date: Fri Nov 26 18:31:58 2021 +0100 staging: r8188eu: rtw_read_port needs no cnt parameter The cnt parameter in the rtw_read_port function is not used. Remove it. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211126173205.21352-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 7de80b094e4f7f694e373c8537fce43a782bd99c Author: Yang Yingliang Date: Thu Dec 2 11:07:04 2021 +0800 staging: rtl8192e: rtllib_module: remove unnecessary assignment Remove the null pointer assignment after freeing 'ieee->pHTInfo'. Reviewed-by: Dan Carpenter Reviewed-by: Pavel Skripkin Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20211202030704.2425621-4-yangyingliang@huawei.com Signed-off-by: Greg Kroah-Hartman commit e730cd57ac2dfe94bca0f14a3be8e1b21de41a9c Author: Yang Yingliang Date: Thu Dec 2 11:07:03 2021 +0800 staging: rtl8192e: rtllib_module: fix error handle case in alloc_rtllib() Some variables are leaked in the error handling in alloc_rtllib(), free the variables in the error path. Fixes: 94a799425eee ("From: wlanfae ") Reviewed-by: Dan Carpenter Reviewed-by: Pavel Skripkin Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20211202030704.2425621-3-yangyingliang@huawei.com Signed-off-by: Greg Kroah-Hartman commit 68bf78ff59a0891eb1239948e94ce10f73a9dd30 Author: Yang Yingliang Date: Thu Dec 2 11:07:02 2021 +0800 staging: rtl8192e: return error code from rtllib_softmac_init() If it fails to allocate 'dot11d_info', rtllib_softmac_init() should return error code. And remove unneccessary error message. Fixes: 94a799425eee ("From: wlanfae ") Reviewed-by: Dan Carpenter Reviewed-by: Pavel Skripkin Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20211202030704.2425621-2-yangyingliang@huawei.com Signed-off-by: Greg Kroah-Hartman commit f47b40a4fa917e257b598cc2398e618c9f877b86 Author: Colin Ian King Date: Mon Nov 29 22:50:13 2021 +0000 staging: rtl8192u: make array queuetopipe static const Don't populate the array queuetopipe on the stack but instead make it static const. Also makes the object code smaller by ~50 bytes. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20211129225013.524016-1-colin.i.king@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7988cf07e7bf63a3dc7aee245e8a06a8e0bcb149 Author: Alberto Merciai Date: Sat Nov 27 11:08:02 2021 +0100 staging: vt6655: refactor camelcase uCurrRSSI to current_rssi Replace camelcase variable "uCurrRSSI" (current Received Signal Strength Indicator) into linux kernel coding style equivalent variable "current_rssi". Signed-off-by: Alberto Merciai Link: https://lore.kernel.org/r/20211127100807.3113388-1-alb3rt0.m3rciai@gmail.com Signed-off-by: Greg Kroah-Hartman commit d9367afb1bd92c45c8281371cb99e19f3c4fdb55 Author: Heiner Kallweit Date: Wed Dec 1 22:04:07 2021 +0100 staging: fbtft: sh1106: use new macro FBTFT_REGISTER_SPI_DRIVER Make fb_sh1106 the first user of new macro FBTFT_REGISTER_SPI_DRIVER. In addition the MODULE_ALIASes can be removed. Module auto-loading was successfully tested with a SH1106-based OLED module connected to an Odroid C2. Signed-off-by: Heiner Kallweit Link: https://lore.kernel.org/r/65516be1-9588-af00-cf4f-053e20af9b45@gmail.com Signed-off-by: Greg Kroah-Hartman commit 15e66fc72925a4c1d641ec4b5ea857f4fe0f939f Author: Heiner Kallweit Date: Wed Dec 1 22:02:47 2021 +0100 staging: fbtft: add macro FBTFT_REGISTER_SPI_DRIVER After 5fa6863ba692 ("spi: Check we have a spi_device_id for each DT compatible") we need to add spi id_tables. Changing existing macro FBTFT_REGISTER_DRIVER would have meant to change arguments and therefore adjust all fbtft drivers. This patch adds a new and simplified macro FBTFT_REGISTER_SPI_DRIVER that includes a spi id_table, and in addition to that: - does not define a platform driver - uses macro module_spi_driver() Signed-off-by: Heiner Kallweit Link: https://lore.kernel.org/r/a58b3bc9-27a2-3f16-dd92-e597666a0263@gmail.com Signed-off-by: Greg Kroah-Hartman commit 2385ebf38f94d4f7761b1e9a4973d04753da02c2 Author: Ming Lei Date: Fri Dec 3 16:17:03 2021 +0800 block: null_blk: batched complete poll requests Complete poll requests via blk_mq_add_to_batch() and blk_mq_end_request_batch(), so that we can cover batched complete code path by running null_blk test. Meantime this way shows ~14% IOPS boost on 't/io_uring /dev/nullb0' in my test. Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20211203081703.3506020-1-ming.lei@redhat.com Signed-off-by: Jens Axboe commit 555a0ce4558d87d5b97c4321f34b19e051c7b0c1 Author: Minchan Kim Date: Wed Dec 1 15:16:48 2021 -0800 kernfs: prevent early freeing of root node Marek reported the warning below. ========================= WARNING: held lock freed! 5.16.0-rc2+ #10984 Not tainted ------------------------- kworker/1:0/18 is freeing memory ffff00004034e200-ffff00004034e3ff, with a lock still held there! ffff00004034e348 (&root->kernfs_rwsem){++++}-{3:3}, at: __kernfs_remove+0x310/0x37c 3 locks held by kworker/1:0/18: #0: ffff000040107938 ((wq_completion)cgroup_destroy){+.+.}-{0:0}, at: process_one_work+0x1f0/0x6f0 #1: ffff80000b55bdc0 ((work_completion)(&(&css->destroy_rwork)->work)){+.+.}-{0:0}, at: process_one_work+0x1f0/0x6f0 #2: ffff00004034e348 (&root->kernfs_rwsem){++++}-{3:3}, at: __kernfs_remove+0x310/0x37c stack backtrace: CPU: 1 PID: 18 Comm: kworker/1:0 Not tainted 5.16.0-rc2+ #10984 Hardware name: Raspberry Pi 4 Model B (DT) Workqueue: cgroup_destroy css_free_rwork_fn Call trace: dump_backtrace+0x0/0x1ac show_stack+0x18/0x24 dump_stack_lvl+0x8c/0xb8 dump_stack+0x18/0x34 debug_check_no_locks_freed+0x124/0x140 kfree+0xf0/0x3a4 kernfs_put+0x1f8/0x224 __kernfs_remove+0x1b8/0x37c kernfs_destroy_root+0x38/0x50 css_free_rwork_fn+0x288/0x3d4 process_one_work+0x288/0x6f0 worker_thread+0x74/0x470 kthread+0x188/0x194 ret_from_fork+0x10/0x20 Since kernfs moves the kernfs_rwsem lock into root, it couldn't hold the lock when the root node is tearing down. Thus, get the refcount of root node. Fixes: 393c3714081a ("kernfs: switch global kernfs_rwsem lock to per-fs lock") Reported-by: Marek Szyprowski Tested-by: Marek Szyprowski Acked-by: Tejun Heo Signed-off-by: Minchan Kim Link: https://lore.kernel.org/r/20211201231648.1027165-1-minchan@kernel.org Signed-off-by: Greg Kroah-Hartman commit 02bf607413e6110321ae75698c8ecbfa82eaafa8 Author: Kohei Tarumizu Date: Wed Dec 1 20:59:57 2021 +0900 docs: document the sysfs ABI for "isolated" Add missing documentation of sysfs ABI for "isolated". It was added by commit 59f30abe94bf("show isolated cpus in sysfs"). However, there is no documentation for these interface. Signed-off-by: Kohei Tarumizu Link: https://lore.kernel.org/r/20211201115957.254224-3-tarumizu.kohei@fujitsu.com Signed-off-by: Greg Kroah-Hartman commit 3722e7c3c654ad8fedc0767f617519a12b4c7bfd Author: Kohei Tarumizu Date: Wed Dec 1 20:59:56 2021 +0900 docs: document the sysfs ABI for "nohz_full" Add missing documentation of sysfs ABI for "nohz_full". It was added by commit 6570a9a1ce3a("show nohz_full cpus in sysfs"). However, there is no documentation for these interface. Signed-off-by: Kohei Tarumizu Link: https://lore.kernel.org/r/20211201115957.254224-2-tarumizu.kohei@fujitsu.com Signed-off-by: Greg Kroah-Hartman commit 44226253e6514b8ef3ddc8710055548d22a230f0 Author: Christian Gmeiner Date: Thu Dec 2 18:30:18 2021 +0100 arm64: dts: ti: k3-am64-main: add timesync router node The Time Sync Event Router (TIMESYNC_INTRTR0) implements a set of multiplexers to provide selection of active CPTS time sync events for routing to CPTS capable modules. This patch adds DT node TIMESYNC_INTRTR0 using "pinctrl-single" bindings. Signed-off-by: Grygorii Strashko Signed-off-by: Vignesh Raghavendra Signed-off-by: Christian Gmeiner Reviewed-by: Kishon Vijay Abraham I Link: https://lore.kernel.org/r/20211202173114.9936-1-christian.gmeiner@gmail.com commit 33a0da68fb073360d36ce1a0e852f75fede7c21e Author: Geert Uytterhoeven Date: Mon Nov 22 14:21:38 2021 +0100 mtd: rawnand: mpc5121: Remove unused variable in ads5121_select_chip() drivers/mtd/nand/raw/mpc5121_nfc.c: In function ‘ads5121_select_chip’: drivers/mtd/nand/raw/mpc5121_nfc.c:294:19: warning: unused variable ‘mtd’ [-Wunused-variable] 294 | struct mtd_info *mtd = nand_to_mtd(nand); | ^~~ Fixes: 758b56f58b66bebc ("mtd: rawnand: Pass a nand_chip object to chip->select_chip()") Signed-off-by: Geert Uytterhoeven Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20211122132138.3899138-1-geert@linux-m68k.org commit 545a32498c536ee152331cd2e7d2416aa0f20e01 Author: Xiongwei Song Date: Tue Nov 16 21:10:33 2021 +0800 floppy: Add max size check for user space request We need to check the max request size that is from user space before allocating pages. If the request size exceeds the limit, return -EINVAL. This check can avoid the warning below from page allocator. WARNING: CPU: 3 PID: 16525 at mm/page_alloc.c:5344 current_gfp_context include/linux/sched/mm.h:195 [inline] WARNING: CPU: 3 PID: 16525 at mm/page_alloc.c:5344 __alloc_pages+0x45d/0x500 mm/page_alloc.c:5356 Modules linked in: CPU: 3 PID: 16525 Comm: syz-executor.3 Not tainted 5.15.0-syzkaller #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 RIP: 0010:__alloc_pages+0x45d/0x500 mm/page_alloc.c:5344 Code: be c9 00 00 00 48 c7 c7 20 4a 97 89 c6 05 62 32 a7 0b 01 e8 74 9a 42 07 e9 6a ff ff ff 0f 0b e9 a0 fd ff ff 40 80 e5 3f eb 88 <0f> 0b e9 18 ff ff ff 4c 89 ef 44 89 e6 45 31 ed e8 1e 76 ff ff e9 RSP: 0018:ffffc90023b87850 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 1ffff92004770f0b RCX: dffffc0000000000 RDX: 0000000000000000 RSI: 0000000000000033 RDI: 0000000000010cc1 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000001 R10: ffffffff81bb4686 R11: 0000000000000001 R12: ffffffff902c1960 R13: 0000000000000033 R14: 0000000000000000 R15: ffff88804cf64a30 FS: 0000000000000000(0000) GS:ffff88802cd00000(0063) knlGS:00000000f44b4b40 CS: 0010 DS: 002b ES: 002b CR0: 0000000080050033 CR2: 000000002c921000 CR3: 000000004f507000 CR4: 0000000000150ee0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: alloc_pages+0x1a7/0x300 mm/mempolicy.c:2191 __get_free_pages+0x8/0x40 mm/page_alloc.c:5418 raw_cmd_copyin drivers/block/floppy.c:3113 [inline] raw_cmd_ioctl drivers/block/floppy.c:3160 [inline] fd_locked_ioctl+0x12e5/0x2820 drivers/block/floppy.c:3528 fd_ioctl drivers/block/floppy.c:3555 [inline] fd_compat_ioctl+0x891/0x1b60 drivers/block/floppy.c:3869 compat_blkdev_ioctl+0x3b8/0x810 block/ioctl.c:662 __do_compat_sys_ioctl+0x1c7/0x290 fs/ioctl.c:972 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c Reported-by: syzbot+23a02c7df2cf2bc93fa2@syzkaller.appspotmail.com Link: https://lore.kernel.org/r/20211116131033.27685-1-sxwjean@me.com Signed-off-by: Xiongwei Song Signed-off-by: Denis Efremov Signed-off-by: Jens Axboe commit fb48febce7e30baed94dd791e19521abd2c3fd83 Author: Tasos Sahanidis Date: Fri Sep 3 09:47:58 2021 +0300 floppy: Fix hang in watchdog when disk is ejected When the watchdog detects a disk change, it calls cancel_activity(), which in turn tries to cancel the fd_timer delayed work. In the above scenario, fd_timer_fn is set to fd_watchdog(), meaning it is trying to cancel its own work. This results in a hang as cancel_delayed_work_sync() is waiting for the watchdog (itself) to return, which never happens. This can be reproduced relatively consistently by attempting to read a broken floppy, and ejecting it while IO is being attempted and retried. To resolve this, this patch calls cancel_delayed_work() instead, which cancels the work without waiting for the watchdog to return and finish. Before this regression was introduced, the code in this section used del_timer(), and not del_timer_sync() to delete the watchdog timer. Link: https://lore.kernel.org/r/399e486c-6540-db27-76aa-7a271b061f76@tasossah.com Fixes: 070ad7e793dc ("floppy: convert to delayed work and single-thread wq") Signed-off-by: Tasos Sahanidis Signed-off-by: Denis Efremov Signed-off-by: Jens Axboe commit 33dc3e3e99e626ce51f462d883b05856c6c30b1d Author: Christophe Leroy Date: Fri Nov 26 18:06:46 2021 +0100 w1: Misuse of get_user()/put_user() reported by sparse sparse warnings: (new ones prefixed by >>) >> drivers/w1/slaves/w1_ds28e04.c:342:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected char [noderef] __user *_pu_addr @@ got char *buf @@ drivers/w1/slaves/w1_ds28e04.c:342:13: sparse: expected char [noderef] __user *_pu_addr drivers/w1/slaves/w1_ds28e04.c:342:13: sparse: got char *buf >> drivers/w1/slaves/w1_ds28e04.c:356:13: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected char const [noderef] __user *_gu_addr @@ got char const *buf @@ drivers/w1/slaves/w1_ds28e04.c:356:13: sparse: expected char const [noderef] __user *_gu_addr drivers/w1/slaves/w1_ds28e04.c:356:13: sparse: got char const *buf The buffer buf is a failsafe buffer in kernel space, it's not user memory hence doesn't deserve the use of get_user() or put_user(). Access 'buf' content directly. Link: https://lore.kernel.org/lkml/202111190526.K5vb7NWC-lkp@intel.com/T/ Reported-by: kernel test robot Signed-off-by: Christophe Leroy Link: https://lore.kernel.org/r/d14ed8d71ad4372e6839ae427f91441d3ba0e94d.1637946316.git.christophe.leroy@csgroup.eu Signed-off-by: Greg Kroah-Hartman commit 09184ae9b5756cc469db6fd1d1cfdcffbf627c2d Author: Todd Kjos Date: Tue Nov 30 10:51:52 2021 -0800 binder: defer copies of pre-patched txn data BINDER_TYPE_PTR objects point to memory areas in the source process to be copied into the target buffer as part of a transaction. This implements a scatter- gather model where non-contiguous memory in a source process is "gathered" into a contiguous region in the target buffer. The data can include pointers that must be fixed up to correctly point to the copied data. To avoid making source process pointers visible to the target process, this patch defers the copy until the fixups are known and then copies and fixeups are done together. There is a special case of BINDER_TYPE_FDA which applies the fixup later in the target process context. In this case the user data is skipped (so no untranslated fds become visible to the target). Reviewed-by: Martijn Coenen Signed-off-by: Todd Kjos Link: https://lore.kernel.org/r/20211130185152.437403-5-tkjos@google.com Signed-off-by: Greg Kroah-Hartman commit 656e01f3ab54afe71bed066996fc2640881e1220 Author: Todd Kjos Date: Tue Nov 30 10:51:51 2021 -0800 binder: read pre-translated fds from sender buffer This patch is to prepare for an up coming patch where we read pre-translated fds from the sender buffer and translate them before copying them to the target. It does not change run time. The patch adds two new parameters to binder_translate_fd_array() to hold the sender buffer and sender buffer parent. These parameters let us call copy_from_user() directly from the sender instead of using binder_alloc_copy_from_buffer() to copy from the target. Also the patch adds some new alignment checks. Previously the alignment checks would have been done in a different place, but this lets us print more useful error messages. Reviewed-by: Martijn Coenen Acked-by: Christian Brauner Signed-off-by: Todd Kjos Link: https://lore.kernel.org/r/20211130185152.437403-4-tkjos@google.com Signed-off-by: Greg Kroah-Hartman commit 6d98eb95b450a75adb4516a1d33652dc78d2b20c Author: Todd Kjos Date: Tue Nov 30 10:51:50 2021 -0800 binder: avoid potential data leakage when copying txn Transactions are copied from the sender to the target first and objects like BINDER_TYPE_PTR and BINDER_TYPE_FDA are then fixed up. This means there is a short period where the sender's version of these objects are visible to the target prior to the fixups. Instead of copying all of the data first, copy data only after any needed fixups have been applied. Fixes: 457b9a6f09f0 ("Staging: android: add binder driver") Reviewed-by: Martijn Coenen Acked-by: Christian Brauner Signed-off-by: Todd Kjos Link: https://lore.kernel.org/r/20211130185152.437403-3-tkjos@google.com Signed-off-by: Greg Kroah-Hartman commit fe6b1869243f23a485a106c214bcfdc7aa0ed593 Author: Todd Kjos Date: Tue Nov 30 10:51:49 2021 -0800 binder: fix handling of error during copy If a memory copy function fails to copy the whole buffer, a positive integar with the remaining bytes is returned. In binder_translate_fd_array() this can result in an fd being skipped due to the failed copy, but the loop continues processing fds since the early return condition expects a negative integer on error. Fix by returning "ret > 0 ? -EINVAL : ret" to handle this case. Fixes: bb4a2e48d510 ("binder: return errors from buffer copy functions") Suggested-by: Dan Carpenter Acked-by: Christian Brauner Signed-off-by: Todd Kjos Link: https://lore.kernel.org/r/20211130185152.437403-2-tkjos@google.com Signed-off-by: Greg Kroah-Hartman commit 690cfa20d02da5aca6e4c141ff34ef9529843280 Author: Ajith P V Date: Thu Nov 25 17:52:18 2021 +0530 binder: remove repeat word from comment binder.c file comment produce warning with checkpatch as below: WARNING: Possible repeated word: 'for' Remove the repeated word from the comment avoid this warning. Signed-off-by: Ajith P V Link: https://lore.kernel.org/r/20211125122218.6767-1-ajithpv.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 00596576a05145a1b5672897a82ef87af00becf4 Author: Zev Weiss Date: Fri Oct 15 11:50:48 2021 -0700 mtd: core: clear out unregistered devices a bit more This allows an MTD device that has been unregistered to be easily re-registered later without triggering spurious "already registered" warnings in mtd_device_parse_register() and add_mtd_device(). Signed-off-by: Zev Weiss Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20211015185049.3318-1-zev@bewilderbeest.net commit b4a0de29f083cf8a705e1f381076ceeed7010d50 Author: Uwe Kleine-König Date: Mon Nov 8 10:31:52 2021 +0100 mtd: sst25l: Warn about failure to unregister mtd device mtd_device_unregister() shouldn't fail. Wail loudly if it does anyhow. This matches how other drivers (e.g. nand/raw/nandsim.c) use mtd_device_unregister(). By returning 0 in the spi remove callback a generic error message by the spi framework (and nothing else) is suppressed. Signed-off-by: Uwe Kleine-König Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20211108093153.63792-4-u.kleine-koenig@pengutronix.de commit 5765f4eb425cbe436f74a4ec700d0237caa36969 Author: Uwe Kleine-König Date: Mon Nov 8 10:31:51 2021 +0100 mtd: mchp48l640: Warn about failure to unregister mtd device mtd_device_unregister() shouldn't fail. Wail loudly if it does anyhow. This matches how other drivers (e.g. nand/raw/nandsim.c) use mtd_device_unregister(). By returning 0 in the spi remove callback a generic error message by the spi framework (and nothing else) is suppressed. Signed-off-by: Uwe Kleine-König Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20211108093153.63792-3-u.kleine-koenig@pengutronix.de commit 367cefbaed42eac9e1da5cc88f3b9220afc2db4d Author: Uwe Kleine-König Date: Mon Nov 8 10:31:50 2021 +0100 mtd: mchp23k256: Warn about failure to unregister mtd device mtd_device_unregister() shouldn't fail. Wail loudly if it does anyhow. This matches how other drivers (e.g. nand/raw/nandsim.c) use mtd_device_unregister(). By returning 0 in the spi remove callback a generic error message by the spi framework (and nothing else) is suppressed. Signed-off-by: Uwe Kleine-König Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20211108093153.63792-2-u.kleine-koenig@pengutronix.de commit 4fea96afff3037ae8b353f08457b3e006ad8f875 Author: Uwe Kleine-König Date: Mon Nov 8 10:31:49 2021 +0100 mtd: dataflash: Warn about failure to unregister mtd device mtd_device_unregister() shouldn't fail. Wail loudly if it does anyhow. This matches how other drivers (e.g. nand/raw/nandsim.c) use mtd_device_unregister(). By returning 0 in the spi remove callback a generic error message by the spi framework (and nothing else) is suppressed. Signed-off-by: Uwe Kleine-König Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20211108093153.63792-1-u.kleine-koenig@pengutronix.de commit c048b60d39e109c201d31ed5ad3a4f939064d6c4 Author: Michael Walle Date: Thu Nov 4 14:48:43 2021 +0100 mtd: core: provide unique name for nvmem device If there is more than one mtd device which supports OTP, there will be a kernel warning about duplicated sysfs entries and the probing will fail. This is because the nvmem device name is not unique. Make it unique by prepending the name of the mtd. E.g. before the name was "user-otp", now it will be "mtd0-user-otp". For reference the kernel splash is: [ 4.665531] sysfs: cannot create duplicate filename '/bus/nvmem/devices/user-otp' [ 4.673056] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.15.0-next-20211101+ #1296 [ 4.680565] Hardware name: Kontron SMARC-sAL28 (Single PHY) on SMARC Eval 2.0 carrier (DT) [ 4.688856] Call trace: [ 4.691303] dump_backtrace+0x0/0x1bc [ 4.694984] show_stack+0x24/0x30 [ 4.698306] dump_stack_lvl+0x68/0x84 [ 4.701980] dump_stack+0x18/0x34 [ 4.705302] sysfs_warn_dup+0x70/0x90 [ 4.708973] sysfs_do_create_link_sd+0x144/0x150 [ 4.713603] sysfs_create_link+0x2c/0x50 [ 4.717535] bus_add_device+0x74/0x120 [ 4.721293] device_add+0x330/0x890 [ 4.724791] device_register+0x2c/0x40 [ 4.728550] nvmem_register+0x240/0x9f0 [ 4.732398] mtd_otp_nvmem_register+0xb0/0x10c [ 4.736854] mtd_device_parse_register+0x28c/0x2b4 [ 4.741659] spi_nor_probe+0x20c/0x2e0 [ 4.745418] spi_mem_probe+0x78/0xbc [ 4.749001] spi_probe+0x90/0xf0 [ 4.752237] really_probe.part.0+0xa4/0x320 .. [ 4.873936] mtd mtd1: Failed to register OTP NVMEM device [ 4.894468] spi-nor: probe of spi0.0 failed with error -17 Fixes: 4b361cfa8624 ("mtd: core: add OTP nvmem provider support") Signed-off-by: Michael Walle Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20211104134843.2642800-1-michael@walle.cc commit e2748ad5257754a47376e28c0f9dda4f5c1e5ca3 Author: Jonathan Corbet Date: Tue Nov 2 16:02:00 2021 -0600 mtd: remove unused header file Commit d24dbd7541ff ("mtd: maps: Get rid of the latch-addr-flash driver") removed the last user of but left the header file behind. Nothing uses this file, delete it now. Cc: Boris Brezillon Cc: Miquel Raynal Cc: Richard Weinberger Cc: Vignesh Raghavendra Cc: linux-mtd@lists.infradead.org Signed-off-by: Jonathan Corbet Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20211102220203.940290-7-corbet@lwn.net commit 2966daf7d253d9904b337b040dd7a43472858b8a Author: Andreas Oetken Date: Tue Nov 2 18:26:04 2021 +0100 mtd: Fixed breaking list in __mtd_del_partition. Not the child partition should be removed from the partition list but the partition itself. Otherwise the partition list gets broken and any subsequent remove operations leads to a kernel panic. Fixes: 46b5889cc2c5 ("mtd: implement proper partition handling") Signed-off-by: Andreas Oetken Cc: stable@vger.kernel.org Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20211102172604.2921065-1-andreas.oetken@siemens-energy.com commit f5912cc19acd7c24b2dbf65a6340bf194244f085 Author: Kees Cook Date: Fri Dec 3 00:42:06 2021 -0800 char/mwave: Adjust io port register size Using MKWORD() on a byte-sized variable results in OOB read. Expand the size of the reserved area so both MKWORD and MKBYTE continue to work without overflow. Silences this warning on a -Warray-bounds build: drivers/char/mwave/3780i.h:346:22: error: array subscript 'short unsigned int[0]' is partly outside array bounds of 'DSP_ISA_SLAVE_CONTROL[1]' [-Werror=array-bounds] 346 | #define MKWORD(var) (*((unsigned short *)(&var))) | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/char/mwave/3780i.h:356:40: note: in definition of macro 'OutWordDsp' 356 | #define OutWordDsp(index,value) outw(value,usDspBaseIO+index) | ^~~~~ drivers/char/mwave/3780i.c:373:41: note: in expansion of macro 'MKWORD' 373 | OutWordDsp(DSP_IsaSlaveControl, MKWORD(rSlaveControl)); | ^~~~~~ drivers/char/mwave/3780i.c:358:31: note: while referencing 'rSlaveControl' 358 | DSP_ISA_SLAVE_CONTROL rSlaveControl; | ^~~~~~~~~~~~~ Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20211203084206.3104326-1-keescook@chromium.org Signed-off-by: Greg Kroah-Hartman commit d325537b88f504bcfdcc61055ad36ff0cb6d7d0b Author: Christophe JAILLET Date: Fri Nov 12 11:06:33 2021 +0100 mei: Remove some dead code 'generated' is known to be true here, so "true || whatever" will still be true. So, remove some dead code. Acked-by: Tomas Winkler Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/3f904c291f3eed06223dd8d494028e0d49df6f10.1636711522.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman commit 1ca54ce9a3ff157b93402a7fea52595d029daa8d Author: Andy Shevchenko Date: Thu Nov 25 23:32:03 2021 +0200 misc: at25: Align comment style Make multi-line comment style aligned. While at it, drop filename from the file. Acked-by: Arnd Bergmann Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211125213203.86693-11-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit d6471ab9ab5814489ed2ebd8c554232b59ac571b Author: Andy Shevchenko Date: Thu Nov 25 23:32:02 2021 +0200 misc: at25: Replace commas by spaces in the ID tables For better readability replace commas by spaces in the ID tables. Acked-by: Arnd Bergmann Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211125213203.86693-10-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit d5fb1304acfd9b8077485c9fb1bf94c8218fd899 Author: Andy Shevchenko Date: Thu Nov 25 23:32:01 2021 +0200 misc: at25: Reorganize headers for better maintenance Split headers to three groups and sort alphabetically in each of them. Acked-by: Arnd Bergmann Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211125213203.86693-9-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 31a45d27c9328b9c8193f01d7d534659a03cee2d Author: Andy Shevchenko Date: Thu Nov 25 23:32:00 2021 +0200 misc: at25: Factor out at_fram_to_chip() In the similar way as it's done for EEPROM, factor out a new helper function for FRAM. Acked-by: Arnd Bergmann Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211125213203.86693-8-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit d059ed1ba27bf0606471ac407008ddd1f65c4be4 Author: Andy Shevchenko Date: Thu Nov 25 23:31:59 2021 +0200 misc: at25: Switch to use BIT() instead of custom approaches It's obvious that custom approach of getting power of 2 number with int_pow() kinda interesting. Replace it and some others approaches by using a simple BIT() operation. Acked-by: Arnd Bergmann Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211125213203.86693-7-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 01d3c42a08021617ad8ee79b0a9fed91d68e32b6 Author: Andy Shevchenko Date: Thu Nov 25 23:31:58 2021 +0200 misc: at25: Get rid of intermediate storage for AT25 chip data There is no need to copy twice the same data. Drop needless local variable. Acked-by: Arnd Bergmann Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211125213203.86693-6-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 994233e195aaa53f30ca1722a280c5295f8782ce Author: Andy Shevchenko Date: Thu Nov 25 23:31:57 2021 +0200 misc: at25: Get platform data via dev_get_platdata() Access to platform data via dev_get_platdata() getter to make code cleaner. Acked-by: Arnd Bergmann Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211125213203.86693-5-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit fb422f44778df10d2f37c69fbfeeddd40aedae10 Author: Andy Shevchenko Date: Thu Nov 25 23:31:56 2021 +0200 misc: at25: Check new property ("address-width") first As it's done elsewhere in at25_fw_to_chip() check new property ("address-width") first. Acked-by: Arnd Bergmann Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211125213203.86693-4-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit c329fe53474ac424cd5eb77c2b6b1fb3fc136d7b Author: Andy Shevchenko Date: Thu Nov 25 23:31:55 2021 +0200 misc: at25: Unshadow error codes in at25_fw_to_chip() device_property_read_u32() may return different error codes. Unshadow them in the at25_fw_to_chip() to give better error report. Acked-by: Arnd Bergmann Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211125213203.86693-3-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 51902c1212feb9652826fd978e5c58b683f865db Author: Andy Shevchenko Date: Thu Nov 25 23:31:54 2021 +0200 misc: at25: Use at25->chip instead of local chip everywhere in ->probe() Currently some values are compared against the contents of the chip structure and most are from its updated copy in at25->chip. Use the latter one everywhere in ->probe(). Acked-by: Arnd Bergmann Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211125213203.86693-2-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 58589a75bba96f43b62d8069b35be081bc00d7c3 Author: Andy Shevchenko Date: Thu Nov 25 23:27:29 2021 +0200 misc: at25: Check proper value of chip length in FRAM case Obviously the byte_len value should be checked from the chip and not from at25->chip. Fixes: fd307a4ad332 ("nvmem: prepare basics for FRAM support") Acked-by: Arnd Bergmann Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211125212729.86585-4-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit a692fc39bf90913f3cea57ee240ea5d6338da235 Author: Andy Shevchenko Date: Thu Nov 25 23:27:28 2021 +0200 misc: at25: Don't copy garbage to the at25->chip in FRAM case Even if we know that we are going to fill everything later on it's bad style and fragile to copy garbage from the stack to the data structure that will be used in the driver. Fixes: fd307a4ad332 ("nvmem: prepare basics for FRAM support") Acked-by: Arnd Bergmann Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211125212729.86585-3-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit 5b557298d7d09cce04e0565a535fbca63661724a Author: Andy Shevchenko Date: Thu Nov 25 23:27:27 2021 +0200 misc: at25: Make driver OF independent again The commit f60e7074902a ("misc: at25: Make use of device property API") made a good job by enabling the driver for non-OF platforms, but the recent commit 604288bc6196 ("nvmem: eeprom: at25: fix type compiler warnings") brought that back. Restore greatness of the driver once again. Fixes: eab61fb1cc2e ("nvmem: eeprom: at25: fram discovery simplification") Fixes: fd307a4ad332 ("nvmem: prepare basics for FRAM support") Acked-by: Arnd Bergmann Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211125212729.86585-2-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit d1180405c7b5c7a1c6bde79d5fc24fe931430737 Author: Lino Sanfilippo Date: Mon Nov 29 18:42:38 2021 +0100 serial: amba-pl011: do not request memory region twice With commit 3873e2d7f63a ("drivers: PL011: refactor pl011_probe()") the function devm_ioremap() called from pl011_setup_port() was replaced with devm_ioremap_resource(). Since this function not only remaps but also requests the ports io memory region it now collides with the .config_port() callback which requests the same region at uart port registration. Since devm_ioremap_resource() already claims the memory successfully, the request in .config_port() fails. Later at uart port deregistration the attempt to release the unclaimed memory also fails. The failure results in a “Trying to free nonexistent resource" warning. Fix these issues by removing the callbacks that implement the redundant memory allocation/release. Also make sure that changing the drivers io memory base address via TIOCSSERIAL is not allowed any more. Fixes: 3873e2d7f63a ("drivers: PL011: refactor pl011_probe()") Signed-off-by: Lino Sanfilippo Link: https://lore.kernel.org/r/20211129174238.8333-1-LinoSanfilippo@gmx.de Signed-off-by: Greg Kroah-Hartman commit 3672fb65155530b5eea6225685c75329b6debec3 Author: Lizhi Hou Date: Mon Nov 29 12:23:02 2021 -0800 tty: serial: uartlite: allow 64 bit address The base address of uartlite registers could be 64 bit address which is from device resource. When ulite_probe() calls ulite_assign(), this 64 bit address is casted to 32-bit. The fix is to replace "u32" type with "phys_addr_t" type for the base address in ulite_assign() argument list. Fixes: 8fa7b6100693 ("[POWERPC] Uartlite: Separate the bus binding from the driver proper") Signed-off-by: Lizhi Hou Link: https://lore.kernel.org/r/20211129202302.1319033-1-lizhi.hou@xilinx.com Signed-off-by: Greg Kroah-Hartman commit ffccc78a5862100e1859f74fa8eea0b85b7591f1 Author: Sherry Sun Date: Fri Dec 3 11:04:41 2021 +0800 tty: serial: fsl_lpuart: add timeout for wait_event_interruptible in .shutdown() Use wait_event_interruptible in lpuart_dma_shutdown isn't a reasonable behavior, since it may cause the system hang here if the condition !sport->dma_tx_in_progress never to be true in some corner case, such as when enable the flow control, the dma tx request may never be completed due to the peer's CTS setting when run .shutdown(). So here change to use wait_event_interruptible_timeout instead of wait_event_interruptible, the tx dma will be forcibly terminated if the tx dma request cannot be completed within 300ms. Considering the worst tx dma case is to have a 4K bytes tx buffer, which would require about 300ms to complete when the baudrate is 115200. Signed-off-by: Sherry Sun Link: https://lore.kernel.org/r/20211203030441.22873-1-sherry.sun@nxp.com Signed-off-by: Greg Kroah-Hartman commit e1c72d907f4c3f4f859f0c5890d5326d804625dc Author: Dongliang Mu Date: Tue Nov 30 22:33:53 2021 +0800 usb: bdc: fix error handling code in bdc_resume If bdc_reinit in bdc_resume fails, it forgets to deallocate the bdc->clk. Fix this by adding clk_disable_unprepare(bdc->clk). Signed-off-by: Dongliang Mu Link: https://lore.kernel.org/r/20211130143354.1820111-1-mudongliangabcd@gmail.com Signed-off-by: Greg Kroah-Hartman commit 554abfe2eadec97d12c71d4a69da1518478f69eb Author: Neal Liu Date: Fri Nov 26 18:00:21 2021 +0800 usb: uhci: add aspeed ast2600 uhci support Enable ast2600 uhci quirks. Signed-off-by: Neal Liu Link: https://lore.kernel.org/r/20211126100021.2331024-1-neal_liu@aspeedtech.com Signed-off-by: Greg Kroah-Hartman commit a172c86931709d6663318609d71a811333bdf4b0 Author: Nishanth Menon Date: Fri Nov 12 22:26:40 2021 -0600 arm64: dts: ti: k3-j7200: Correct the d-cache-sets info A72 Cluster (chapter 1.3.1 [1]) has 48KB Icache, 32KB Dcache and 1MB L2 Cache - ICache is 3-way set-associative - Dcache is 2-way set-associative - Line size are 64bytes 32KB (Dcache)/64 (fixed line length of 64 bytes) = 512 ways 512 ways / 2 (Dcache is 2-way per set) = 256 sets. So, correct the d-cache-sets info. [1] https://www.ti.com/lit/pdf/spruiu1 Fixes: d361ed88455f ("arm64: dts: ti: Add support for J7200 SoC") Reported-by: Peng Fan Signed-off-by: Nishanth Menon Reviewed-by: Pratyush Yadav Reviewed-by: Kishon Vijay Abraham I Signed-off-by: Vignesh Raghavendra Link: https://lore.kernel.org/r/20211113042640.30955-1-nm@ti.com commit e9ba3a5bc6fdc2c796c69fdaf5ed6c9957cf9f9d Author: Nishanth Menon Date: Fri Nov 12 22:36:39 2021 -0600 arm64: dts: ti: k3-j721e: Fix the L2 cache sets A72's L2 cache[1] on J721e[2] is 1MB. A72's L2 is fixed line length of 64 bytes and 16-way set-associative cache structure. 1MB of L2 / 64 (line length) = 16384 ways 16384 ways / 16 = 1024 sets Fix the l2 cache-sets. [1] https://developer.arm.com/documentation/100095/0003/Level-2-Memory-System/About-the-L2-memory-system [2] http://www.ti.com/lit/pdf/spruil1 Fixes: 2d87061e70de ("arm64: dts: ti: Add Support for J721E SoC") Reported-by: Peng Fan Signed-off-by: Nishanth Menon Reviewed-by: Pratyush Yadav Signed-off-by: Vignesh Raghavendra Link: https://lore.kernel.org/r/20211113043639.4413-1-nm@ti.com commit d0c826106f3fc11ff97285102b576b65576654ae Author: Nishanth Menon Date: Fri Nov 12 22:36:38 2021 -0600 arm64: dts: ti: k3-j7200: Fix the L2 cache sets A72's L2 cache[1] on J7200[2] is 1MB. A72's L2 is fixed line length of 64 bytes and 16-way set-associative cache structure. 1MB of L2 / 64 (line length) = 16384 ways 16384 ways / 16 = 1024 sets Fix the l2 cache-sets. [1] https://developer.arm.com/documentation/100095/0003/Level-2-Memory-System/About-the-L2-memory-system [2] https://www.ti.com/lit/pdf/spruiu1 Fixes: d361ed88455f ("arm64: dts: ti: Add support for J7200 SoC") Reported-by: Peng Fan Signed-off-by: Nishanth Menon Reviewed-by: Pratyush Yadav Signed-off-by: Vignesh Raghavendra Link: https://lore.kernel.org/r/20211113043638.4358-1-nm@ti.com commit a27a93bf70045be54b594fa8482959ffb84166d7 Author: Nishanth Menon Date: Fri Nov 12 22:36:35 2021 -0600 arm64: dts: ti: k3-am642: Fix the L2 cache sets A53's L2 cache[1] on AM642[2] is 256KB. A53's L2 is fixed line length of 64 bytes and 16-way set-associative cache structure. 256KB of L2 / 64 (line length) = 4096 ways 4096 ways / 16 = 256 sets Fix the l2 cache-sets. [1] https://developer.arm.com/documentation/ddi0500/j/Level-2-Memory-System/About-the-L2-memory-system?lang=en [2] https://www.ti.com/lit/pdf/spruim2 Fixes: 8abae9389bdb ("arm64: dts: ti: Add support for AM642 SoC") Reported-by: Peng Fan Signed-off-by: Nishanth Menon Reviewed-by: Pratyush Yadav Signed-off-by: Vignesh Raghavendra Link: https://lore.kernel.org/r/20211113043635.4296-1-nm@ti.com commit 3f92a5be6084b77f764a8bbb881ac0d12cb9e863 Author: Kishon Vijay Abraham I Date: Fri Nov 26 14:15:55 2021 +0530 arm64: dts: ti: j721e-main: Fix 'dtbs_check' in serdes_ln_ctrl node Fix 'dtbs_check' in serdes_ln_ctrl (mux@4080) node by changing the node name to mux-controller@4080. Signed-off-by: Kishon Vijay Abraham I Reviewed-by: Aswath Govindraju Signed-off-by: Vignesh Raghavendra Link: https://lore.kernel.org/r/20211126084555.17797-3-kishon@ti.com commit 4d3984906397581dc0ccb6a02bf16b6ff82c9192 Author: Kishon Vijay Abraham I Date: Fri Nov 26 14:15:54 2021 +0530 arm64: dts: ti: j7200-main: Fix 'dtbs_check' serdes_ln_ctrl node Fix 'dtbs_check' in serdes_ln_ctrl (serdes-ln-ctrl@4080) node by changing the node name to mux-controller@4080. Signed-off-by: Kishon Vijay Abraham I Reviewed-by: Aswath Govindraju Signed-off-by: Vignesh Raghavendra Link: https://lore.kernel.org/r/20211126084555.17797-2-kishon@ti.com commit d5ba72f3c18e4556d99bb0360279d0b1e9544359 Author: Ville Syrjälä Date: Wed Nov 24 13:36:51 2021 +0200 drm/i915/fbc: No FBC+double wide pipe FBC and double wide pipe are mutually exclusive. Disable FBC when we have to resort to double wide. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211124113652.22090-20-ville.syrjala@linux.intel.com Reviewed-by: Mika Kahola commit d3e27f7c511044c65b27d087e55b092a3d97e8d7 Author: Ville Syrjälä Date: Wed Nov 24 13:36:50 2021 +0200 drm/i915/fbc: s/parms/fbc_state/ Rename the 'params' to just fbc state. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211124113652.22090-19-ville.syrjala@linux.intel.com Reviewed-by: Mika Kahola commit 0cb9f228bc2b3871fd1fcef87897f0a5af959343 Author: Ville Syrjälä Date: Wed Nov 24 13:36:49 2021 +0200 drm/i915/fbc: Move plane pointer into intel_fbc_state Currently we track the FBC plane as a pointer under intel_fbc and also as a i9xx_plane_id under intel_fbc_state. Just store the pointer once in the fbc state. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211124113652.22090-18-ville.syrjala@linux.intel.com Reviewed-by: Mika Kahola commit f4cfdbb02ca8227cf4de454071f20cdd09c37cf2 Author: Ville Syrjälä Date: Wed Nov 24 13:36:48 2021 +0200 drm/i915/fbc: Nuke state_cache fbc->state_cache has now become useless. We can simply update the reg params directly from the plane/crtc states during __intel_fbc_enable(). Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211124113652.22090-17-ville.syrjala@linux.intel.com Reviewed-by: Mika Kahola commit b156def9912fe6d9fd7679c9843f80cfcd9d1429 Author: Ville Syrjälä Date: Wed Nov 24 13:36:47 2021 +0200 drm/i915/fbc: Disable FBC fully on FIFO underrun Currently a FIFO underrun just causes FBC to be deactivated, and later checks then prevent it from being reactivated. We can simpify our lives a bit by logically disabling FBC on FIFO underruns. This avoids the funny intermediate state where FBC is logically enabled but can't actually be activated. v2: intel_wait_for_vblank() is no more Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211124113652.22090-16-ville.syrjala@linux.intel.com Reviewed-by: Mika Kahola commit 98009fd73bde2d66fb449cd277f69932fd12051d Author: Ville Syrjälä Date: Wed Nov 24 13:36:46 2021 +0200 drm/i915/fbc: Move stuff from intel_fbc_can_enable() into intel_fbc_check_plane() Don't really see a good reason why we can't just do the vgpu and modparam checks already in intel_fbc_check_plane(). Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211124113652.22090-15-ville.syrjala@linux.intel.com Reviewed-by: Mika Kahola commit 606754fdcb20f781774a279d62bb0852fcb2b79d Author: Ville Syrjälä Date: Wed Nov 24 13:36:45 2021 +0200 drm/i915/fbc: Allocate intel_fbc dynamically In the future we may have more than one FBC instance on some platforms. So let's just allocate it dynamically. This also lets us fully hide the implementation from prying eyes. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211124113652.22090-14-ville.syrjala@linux.intel.com Reviewed-by: Mika Kahola commit 825bd8335e4e9fccf33b93813693409b4484ea68 Author: Ville Syrjälä Date: Wed Nov 24 13:36:44 2021 +0200 drm/i915/fbc: Introduce intel_fbc_add_plane() In order to better encapsulate the FBC implementation introduce a small helper to do the plane<->FBC instance association. We'll also try to structure the plane init code such that introducing multiple FBC instances will be easier down the line. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211124113652.22090-13-ville.syrjala@linux.intel.com Reviewed-by: Mika Kahola commit d2de8ccfb29909272fce4eb5cb2bca4fd878df39 Author: Ville Syrjälä Date: Wed Nov 24 13:36:43 2021 +0200 drm/i915/fbc: Move FBC debugfs stuff into intel_fbc.c In order to encapsulate FBC harder let's just move the debugfs stuff into intel_fbc.c. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211124113652.22090-12-ville.syrjala@linux.intel.com Acked-by: Jani Nikula commit 32024bb85ec2a8475b89282726121b922caebad9 Author: Ville Syrjälä Date: Wed Nov 24 13:36:42 2021 +0200 drm/i915/fbc: Pass i915 instead of FBC instance to FBC underrun stuff The underrun code doesn't need to know any details about FBC, so just pass in the whole device rather than a specific FBC instance. We could make this a bit more fine grained by also passing in the pipe to intel_fbc_handle_fifo_underrun_irq() and letting the FBC code figure which FBC instance (if any) is active on said pipe. But that seems a bit overkill for this so don't bother. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211124113652.22090-11-ville.syrjala@linux.intel.com Reviewed-by: Mika Kahola commit 62d4874bee61d971b74dfd5fcd8032ff33746885 Author: Ville Syrjälä Date: Wed Nov 24 13:36:41 2021 +0200 drm/i915/fbc: Flatten __intel_fbc_pre_update() Use an early return to flatten most of __intel_fbc_pre_update(). Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211124113652.22090-10-ville.syrjala@linux.intel.com Reviewed-by: Mika Kahola commit 004f80f91a7831cd32970e1078bb00594d042089 Author: Ville Syrjälä Date: Wed Nov 24 13:36:40 2021 +0200 drm/i915/fbc: Track FBC usage per-plane In the future we may have multiple planes on the same pipe capable of using FBC. Prepare for that by tracking FBC usage per-plane rather than per-crtc. v2: s/intel_get_crtc_for_pipe/intel_crtc_for_pipe/ Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211124113652.22090-9-ville.syrjala@linux.intel.com Reviewed-by: Mika Kahola commit 76c4c95dac0da03f64d8b59a8834faf8020af8dc Author: Thinh Nguyen Date: Mon Nov 29 18:53:22 2021 -0800 usb: dwc3: gadget: Skip reading GEVNTSIZn The driver knows what it needs to set for GEVNTSIZn, and the controller doesn't modify this register unless there's a hard reset. To save a few microseconds of register read in read-modify-write operation, simply do register write with the expected values. This can improve performance when there are many interrupts generated, which the driver needs to check and handle. Signed-off-by: Thinh Nguyen Link: https://lore.kernel.org/r/efddf4ee5821c4bc5ae7ad90d629ec7a0ebcbf9a.1638240306.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman commit a02a26eb0aeaa2859a8b2f182bd5b5f7228ee1fe Author: Thinh Nguyen Date: Mon Nov 29 18:53:16 2021 -0800 usb: dwc3: gadget: Ignore Update Transfer cmd params The controller doesn't check for Update Transfer command parameters DEPCMDPAR{0,1,2}. Writing to these registers is unnecessary. Ignoring this improves performance slightly by removing the register write delay. Signed-off-by: Thinh Nguyen Link: https://lore.kernel.org/r/997d9ebf38c6bba920d4ee77bd8c77bf81978a55.1638240306.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman commit bc27117c7cdd4b57d0f079620b483f3b229074bd Author: Thinh Nguyen Date: Mon Nov 29 18:53:09 2021 -0800 usb: dwc3: gadget: Skip checking Update Transfer status If we're not setting CMDACT (from "No Response" Update Transfer command), then there's no point in checking for the command status. So skip it. This can reduce a register read delay and improve performance. Signed-off-by: Thinh Nguyen Link: https://lore.kernel.org/r/3dc31cf11581ae3ee82d9202dda3fc17d897d786.1638240306.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman commit 43332cf97425a3e5508c827c82201ecc5ddd54e0 Author: Chris Mi Date: Wed Dec 1 15:31:53 2021 +0200 net/sched: act_ct: Offload only ASSURED connections Short-lived connections increase the insertion rate requirements, fill the offload table and provide very limited offload value since they process a very small amount of packets. The ct ASSURED flag is designed to filter short-lived connections for early expiration. Offload connections when they are ESTABLISHED and ASSURED. Signed-off-by: Chris Mi Reviewed-by: Oz Shlomo Reviewed-by: Roi Dayan Signed-off-by: David S. Miller commit 119c1a336d8e92df059a86302e7f11f9262bbc00 Merge: 0109841fc4565 184da9dc780e3 Author: David S. Miller Date: Fri Dec 3 11:01:00 2021 +0000 Merge branch 'hns3-cleanups' Guangbin Huang says: ==================== net: hns3: some cleanups for -next To improve code readability and simplicity, this series add some cleanup patches for the HNS3 ethernet driver. ==================== Signed-off-by: David S. Miller commit 184da9dc780e32ea80090bb02c59e4ac4e52ef96 Author: Jie Wang Date: Fri Dec 3 17:20:59 2021 +0800 net: hns3: fix hns3 driver header file not self-contained issue The hns3 driver header file uses the structure of other files, but does not include corresponding file, which causes a check warning that the header file is not self-contained. Therefore, the required header file is included in the header file, and the structure declaration is added to the header file to avoid cyclic dependency of the header file. Signed-off-by: Jie Wang Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 7acf76b1cd0141e7de070594ddb0bb26fdb8ab4e Author: Hao Chen Date: Fri Dec 3 17:20:58 2021 +0800 net: hns3: replace one tab with space in for statement Replace one tab with space between symbol ')' and '{' in for statement of function hclge_map_tqp(). Signed-off-by: Hao Chen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 40975e749daa5b00aa9e560bdcf817702946b696 Author: Hao Chen Date: Fri Dec 3 17:20:57 2021 +0800 net: hns3: remove rebundant line for hclge_dbg_dump_tm_pg() Return value judgment should follow the function call, so remove line between them. Signed-off-by: Hao Chen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 4e599dddeea443fc27716a794c2684b2980735c8 Author: Hao Chen Date: Fri Dec 3 17:20:56 2021 +0800 net: hns3: add comments for hclge_dbg_fill_content() When we use hclge_dbg_fill_content() to fill contents with specific format according to struct hclge_dbg_item *items, it may cause content cover due to unreasonable items. So add comments to explain how to avoid it. Signed-off-by: Hao Chen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 5ac4f180bd07116c1e57858bc3f6741adbca3eb6 Author: Hao Chen Date: Fri Dec 3 17:20:55 2021 +0800 net: hns3: add void before function which don't receive ret Add void before function which don't receive ret to improve code readability. Signed-off-by: Hao Chen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 9fcadbaae8ea85512ec84cf3f1158fd333185a7b Author: Hao Chen Date: Fri Dec 3 17:20:54 2021 +0800 net: hns3: align return value type of atomic_read() with its output Change output value type of atomic_read() from %u to %d. Signed-off-by: Hao Chen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 72dcdec10fad43a6bf9586ed8a81aef45b43da62 Author: Guangbin Huang Date: Fri Dec 3 17:20:53 2021 +0800 net: hns3: modify one argument type of function hclge_ncl_config_data_print The argument len will not be changed in hclge_ncl_config_data_print(), it is no need to declare as a pointer, so modify it into int type. Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 0cc25c6a14efd709f2cfcde345e3d5c6aa20f80e Author: Hao Chen Date: Fri Dec 3 17:20:52 2021 +0800 net: hns3: Align type of some variables with their print type The c language has a set of implicit type conversions, when two variables perform bitwise or arithmetic operations. For example, variable A (type u16/u8) -1, its output is int type variable. u16/u8 will convert to int type implicitly before it does arithmetic operations. So, change 1 to unsigned type. Signed-off-by: Hao Chen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 114967adbc3dce9c537e85eba2d605233d64f54f Author: Guangbin Huang Date: Fri Dec 3 17:20:51 2021 +0800 net: hns3: add print vport id for failed message of vlan This patch adds print vport id when failed to get or set vlan filter parameters. Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit e7a51bf590e3ea87b0bab8c09c1a6fb6be7b3c11 Author: Guangbin Huang Date: Fri Dec 3 17:20:50 2021 +0800 net: hns3: refactor function hclge_set_vlan_filter_hw Function hclge_set_vlan_filter_hw() is a bit too long, so add a new function hclge_need_update_port_vlan() to simplify code and improve code readability. Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 23e0316049af3343f3eb51b422cb25191fc87174 Author: Yufeng Mo Date: Fri Dec 3 17:20:49 2021 +0800 net: hns3: optimize function hclge_cfg_common_loopback() hclge_cfg_common_loopback() is a bit too long, so encapsulate hclge_cfg_common_loopback_cmd_send() and hclge_cfg_common_loopback_wait() two functions to improve readability. Signed-off-by: Yufeng Mo Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 6e4d2e45ef3eff90e2ee2dcbc29e356158c75f0a Author: Ville Syrjälä Date: Wed Nov 24 13:36:39 2021 +0200 drm/i915/fbc: Pass around FBC instance instead of crtc Pass the FBC instance instead of the crtc to a bunch of places. We also adjust intel_fbc_post_update() to do the intel_fbc_get_reg_params() things instead of doing it from the lower level function (which also gets called for front buffer tracking). Nothing in there will change during front buffer updates. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211124113652.22090-8-ville.syrjala@linux.intel.com Reviewed-by: Mika Kahola commit e1521cbd27aa100a86b54094cfa4387a9bcc2f63 Author: Ville Syrjälä Date: Wed Nov 24 13:36:38 2021 +0200 drm/i915/fbc: Reuse the same struct for the cache and params The FBC state cache and params are now nearly identical. Just use the same structure for both. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211124113652.22090-7-ville.syrjala@linux.intel.com Reviewed-by: Mika Kahola commit 873c995a40a5c2324a5d1e890604066b74914b3c Author: Ville Syrjälä Date: Wed Nov 24 13:36:37 2021 +0200 drm/i915/fbc: Nuke more FBC state There isn't a good reason why we'd have to cache all this plane state stuff in the FBC state. Instead we can just pre-calculate what FBC will really need. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211124113652.22090-6-ville.syrjala@linux.intel.com Reviewed-by: Mika Kahola commit 266790871e8d20d6074c1cf3ede7ae92efc61bea Author: Ville Syrjälä Date: Wed Nov 24 13:36:36 2021 +0200 drm/i915/fbc: Relocate intel_fbc_override_cfb_stride() Move intel_fbc_override_cfb_stride() next to its cousins. Helps with later patches. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211124113652.22090-5-ville.syrjala@linux.intel.com Reviewed-by: Mika Kahola commit 2e6c99f88679121eacc75196bdf6da8b0e513066 Author: Ville Syrjälä Date: Wed Nov 24 13:36:35 2021 +0200 drm/i915/fbc: Nuke lots of crap from intel_fbc_state_cache There's no need to store all this stuff in intel_fbc_state_cache. Just check it all against the plane/crtc states and store only what we need. Probably more should get nuked still, but this is a start. So what we'll do is: - each plane will check its own state and update its local no_fbc_reason - the per-plane no_fbc_reason (if any) then gets propagated to the cache->no_fbc_reason while doing the actual update - fbc->no_fbc_reason gets updated in the end with either the value from the cache or directly from frontbuffer tracking It's still a bit messy, but should hopefuly get cleaned up more in the future. At least now we can observe each plane's reasons for rejecting FBC now more consistently, and we don't have so mcuh redundant state store all over the place. v2: store no_fbc_reason per-plane instead of per-pipe Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211124113652.22090-4-ville.syrjala@linux.intel.com Reviewed-by: Mika Kahola commit b6e201f5f13bd61ab8e5187daa0e149826cda154 Author: Ville Syrjälä Date: Wed Nov 24 13:36:34 2021 +0200 drm/i915/fbc: Pass whole plane state to intel_fbc_min_limit() No reason to burden the caller with the details on how the minimum compression limit is calculated, so just pass in the whole plane state instead of just the cpp value. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211124113652.22090-3-ville.syrjala@linux.intel.com Reviewed-by: Mika Kahola commit 248e251567a013c960d08124a4abcfc3e2ce6371 Author: Ville Syrjälä Date: Wed Nov 24 13:36:33 2021 +0200 drm/i915/fbc: Eliminate racy intel_fbc_is_active() usage The ilk fbc watermark computation uses intel_fbc_is_active() which is racy since we don't know whether FBC will be enabled or not at some point. So let's just assume it will be if both HAS_FBC() and the modparam agree. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211124113652.22090-2-ville.syrjala@linux.intel.com Reviewed-by: Mika Kahola commit d96c5ed0e37fcba4071d29fed92410b3a4d9cdf1 Author: Ville Syrjälä Date: Wed Dec 1 17:25:43 2021 +0200 drm/i915: Rename PLANE_CUS_CTL Y plane bits Rename the PLANE_CUS_CTL Y plane selection bits to actually say "Y plane". Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211201152552.7821-6-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza commit 62f887ae46861484c5ff2b8880c69403611c88b7 Author: Ville Syrjälä Date: Wed Dec 1 17:25:40 2021 +0200 drm/i915: Rename plane YUV order bits Rename the YUV byte order bits to be a bit more consistent. v2: Deal with gvt Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211201152552.7821-3-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza commit f84b336a2ff7473a7c6c15eff6c4ec50aee476a3 Author: Ville Syrjälä Date: Wed Dec 1 17:25:39 2021 +0200 drm/i915: Get rid of the 64bit PLANE_CC_VAL mmio Let's just stick to 32bit mmio accesses so we can get rid of the bare "uncore" reg access in display code. The register are defined as 32bit in the spec anyway. We could define a 64bit "de" variant I suppose, but doesn't really make much sense just for this one case, and when we start to use the DSB for this stuff we'd also need another 64bit variant for that. Just easier to do 32bit always. While at it we can reorder stuff a bit so that we write the registers in order of increasing offset (more or less). Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211201152552.7821-2-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza commit a8a051984a75f8123c1805fdadb5a4ec6f1a50b0 Author: Jernej Skrabec Date: Wed Dec 1 19:21:18 2021 +0100 arm64: dts: allwinner: h6: tanix-tx6: Enable bluetooth Tanix TX6 comes either with RTL8822BS or RTL8822CS wifi+bt combo module. Wifi part is already enabled in tanix DTSI. Let's enable also bluetooth. Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard commit 0835819309540e83325ad10fb920b59c7495b419 Author: Jernej Skrabec Date: Wed Dec 1 19:21:17 2021 +0100 arm64: dts: allwinner: h6: tanix: Add MMC1 node Both, Tanix TX6 and Tanix TX6 mini, have SDIO wifi module, albeit different. However, driver can be autoprobed via SDIO ID. Add MMC1 node, so kernel can discover wifi module and load driver for it. Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard commit fa33ec5157b08ea8bd57dd6a0bbf920dc304aca1 Author: Jernej Skrabec Date: Wed Dec 1 19:21:16 2021 +0100 arm64: dts: allwinner: h6: Add Tanix TX6 mini dts Tanix TX6 mini is less capable version of Tanix TX6 although it comes with some features not present on Tanix TX6. Basic specs: - H6 SoC - 2 GiB DDR3 RAM - HDMI - SPDIF - 2x USB - analogue audio - CVBS - SD card - IR remote - LED display - fast ethernet - XR819 wifi - 16 GiB eMMC Currently supported features doesn't differ that much from Tanix TX6, but that will change soon. Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard commit fcad81d944e7cb8f2d0aeaec0e4109638e873036 Author: Jernej Skrabec Date: Wed Dec 1 19:21:15 2021 +0100 dt-bindings: arm: sunxi: Add Tanix TX6 mini Tanix TX6 mini is, as its name suggest, very similar to Tanix TX6, but with less features. It misses bluetooth support, it has less RAM, wifi supports only 2.4G, it comes with different IR remote, etc. Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard commit 8ff8d6936ec9134754e9a3eef1f641358dac7457 Author: Jernej Skrabec Date: Wed Dec 1 19:21:14 2021 +0100 arm64: dts: allwinner: h6: tanix-tx6: Split to DT and DTSI There is another very similar device to Tanix TX6, namely Tanix TX6 mini. Because most of the board design is shared, it makes sense to have common nodes in DTSI file. Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard commit 15162c5a36abbf051f957ee8114185b899c6975a Author: Jani Nikula Date: Wed Dec 1 15:57:12 2021 +0200 drm/i915/display: stop including i915_drv.h from intel_display_types.h Break the dependency on i915_drv.h. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/ee740f494e416d875e057c2eda585f4e66d65500.1638366969.git.jani.nikula@intel.com commit 726a2d779f0ede31c4739456df1a7a69d10c2a0e Author: Jani Nikula Date: Wed Dec 1 15:57:11 2021 +0200 drm/i915/display: convert dp_to_i915() to a macro Avoid looking into the guts of struct drm_i915_private in headers. Again, converting an inline function to a macro is less than ideal, but avoids having to pull in i915_drv.h just for the to_i915() part. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/ed6c43455d13c90ebfed442b196625af5e6ede88.1638366969.git.jani.nikula@intel.com commit 5734c1774d8f32ea814c2904feae29b4582dd219 Author: Jani Nikula Date: Wed Dec 1 15:57:10 2021 +0200 drm/i915: move enum hpd_pin to intel_display.h It's not the ideal location, but a better alternative than i915_drv.h. The goal is to break the intel_display_types.h to i915_drv.h dependency. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/9f882eff78cdc6b28c18e73f5e53f57e413240dc.1638366969.git.jani.nikula@intel.com commit f83974a408592dee672f9a4904cdc2149c6e161b Author: Jani Nikula Date: Wed Dec 1 15:57:09 2021 +0200 drm/i915: split out intel_pm_types.h This is far from ideal, but it reduces the i915_drv.h dependency from intel_display_types.h. Maybe in the future we'll need a better split. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/c6c60d9a8f6dcd1fa2f4b187000c5bb6843a1371.1638366969.git.jani.nikula@intel.com commit 1538f65f18ee600dd405350d826ec6af05da79f9 Author: Jani Nikula Date: Wed Dec 1 15:57:08 2021 +0200 drm/i915/fb: move intel_fb_uses_dpt to intel_fb.c and un-inline Move fb functions where they belong, and un-inline to avoid looking into struct drm_i915_private guts in header files. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/4aa89f113ce6d840d62f50c989e2a1415483557c.1638366969.git.jani.nikula@intel.com commit 92e9624ad9468bdfcf652ba2cbea9d8995397fa6 Author: Jani Nikula Date: Wed Dec 1 15:57:07 2021 +0200 drm/i915/crtc: un-inline some crtc functions and move to intel_crtc.[ch] Move a number of crtc/pipe related functions to intel_crtc.[ch], and un-inline to avoid looking into struct drm_i915_private guts in header files. Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/c0be2adc4a7f7e72a47e12a57f742aaa42b813e6.1638366969.git.jani.nikula@intel.com commit 2ebc9e4af0291d2e8d14ecc0bad8f36de8cc6e62 Author: Anshuman Gupta Date: Tue Nov 30 18:50:05 2021 +0530 drm/i915/selftest: Disable IRQ for timestamp calculation gt_pm selftest calculates engine ticks cycles and wall time cycles by delta of respective engine elapsed TIMESTAMP and ktime for period of 1000us. It compares the engine ticks cycles with wall time cycles. Disable local cpu interrupt so that interrupt handler does not switch out the thread during measure_clocks() and prevent miscalculation of engine tick cycles. v2: - nuke preempt_{disable,enable}, as disable_local_irq() disable the preemption. (Chris) Cc: Chris P Wilson Cc: Badal Nilawar Cc: Ashutosh Dixit Signed-off-by: Anshuman Gupta Reviewed-by: Ashutosh Dixit Link: https://patchwork.freedesktop.org/patch/msgid/20211130132005.6305-1-anshuman.gupta@intel.com commit 487970e8bb776c989013bb59d6cbb22e45b9afc6 Author: Matt Atwood Date: Tue Nov 16 09:48:18 2021 -0800 drm/i915/dg2: extend Wa_1409120013 to DG2 Extend existing workaround 1409120013 to DG2. Cc: José Roberto de Souza Signed-off-by: Matt Atwood Signed-off-by: Matt Roper Reviewed-by: Clint Taylor Link: https://patchwork.freedesktop.org/patch/msgid/20211116174818.2128062-6-matthew.d.roper@intel.com commit 7cbea1b61788c05a5bcb84c73ed5ed90bb2e0a93 Author: Matt Roper Date: Tue Nov 16 09:48:15 2021 -0800 drm/i915/dg2: Add Wa_14010547955 This workaround is documented a bit strangely in the bspec; it's listed as an A0 workaround, but the description clarifies that the workaround is implicitly handled by the hardware and what the driver really needs to do is program a chicken bit to reenable some internal behavior. Signed-off-by: Matt Roper Reviewed-by: Clint Taylor Link: https://patchwork.freedesktop.org/patch/msgid/20211116174818.2128062-3-matthew.d.roper@intel.com commit c02343249c26032afd4774052dad434b4b4dfdc2 Author: Matt Roper Date: Tue Nov 16 09:48:14 2021 -0800 drm/i915/dg2: s/DISP_STEPPING/DISPLAY_STEPPING/ Commit cd0fcf5af791 ("drm/i915: rename DISP_STEPPING->DISPLAY_STEP and GT_STEPPING->GT_STEP") renamed all platforms' display stepping tests, but the DG2 patches were still in-flight at that time and did not incorporate the new naming scheme. Rename DG2's macro now for consistency with other platforms. Cc: Jani Nikula Signed-off-by: Matt Roper Reviewed-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20211116174818.2128062-2-matthew.d.roper@intel.com commit 4b19f6b728c7ae0cc285d2012d5aa1ab99be9b39 Author: Ramalingam C Date: Tue Nov 16 09:48:17 2021 -0800 drm/i915/dg2: Add Wa_16013000631 Invalidate IC cache through pipe control command as part of the ctx restore flow through indirect ctx pointer. v2: - Move pipe control from xcs indirect context to the rcs indirect context. We'll eventually need this on the CCS engines too, but support for those hasn't landed yet. Cc: Chris Wilson Signed-off-by: Ramalingam C Signed-off-by: Matt Roper Reviewed-by: Clint Taylor Link: https://patchwork.freedesktop.org/patch/msgid/20211116174818.2128062-5-matthew.d.roper@intel.com commit 34734ab72763d51c6b809ee80ceb04a161a37dd1 Author: Matt Roper Date: Tue Nov 16 09:48:16 2021 -0800 drm/i915/dg2: Add Wa_16011777198 Coarse power gating for render should not be enabled on some DG2 steppings. Bspec: 52698 Signed-off-by: Matt Roper Reviewed-by: Clint Taylor Link: https://patchwork.freedesktop.org/patch/msgid/20211116174818.2128062-4-matthew.d.roper@intel.com commit 0ea275df84c389e910a3575a9233075118c173ee Author: Dan Carpenter Date: Sat Nov 27 17:10:27 2021 +0300 crypto: octeontx2 - uninitialized variable in kvf_limits_store() If kstrtoint() fails then "lfs_num" is uninitialized and the warning doesn't make any sense. Just delete it. Fixes: 8ec8015a3168 ("crypto: octeontx2 - add support to process the crypto request") Signed-off-by: Dan Carpenter Signed-off-by: Herbert Xu commit 5876b0cb883da7a16129dadc06250a36a79a8ee1 Author: Geert Uytterhoeven Date: Mon Nov 22 16:54:02 2021 +0100 crypto: sa2ul - Use bitfield helpers Use the FIELD_PREP() helper, instead of open-coding the same operation. Signed-off-by: Geert Uytterhoeven Signed-off-by: Herbert Xu commit 087e1d715bccf25dc0e83294576e416b0386ba20 Author: Gaurav Jain Date: Mon Nov 22 17:02:34 2021 +0530 crypto: caam - save caam memory to support crypto engine retry mechanism. When caam queue is full (-ENOSPC), caam frees descriptor memory. crypto-engine checks if retry support is true and h/w queue is full(-ENOSPC), then requeue the crypto request. During processing the requested descriptor again, caam gives below error. (caam_jr 30902000.jr: 40000006: DECO: desc idx 0: Invalid KEY Command). This patch adds a check to return when caam input ring is full and retry support is true. so descriptor memory is not freed and requeued request can be processed again. Fixes: 2d653936eb2cf ("crypto: caam - enable crypto-engine retry mechanism") Signed-off-by: Gaurav Jain Reviewed-by: Horia Geantă Signed-off-by: Herbert Xu commit 8f5783ad9eb83747471f61f94dbe209fb9fb8a7d Author: Stephen Boyd Date: Tue Nov 16 18:03:46 2021 -0800 cpufreq: qcom-hw: Use optional irq API Use platform_get_irq_optional() to avoid a noisy error message when the irq isn't specified. The irq is definitely optional given that we only care about errors that are -EPROBE_DEFER here. Cc: Thara Gopinath Signed-off-by: Stephen Boyd Signed-off-by: Viresh Kumar commit ea59fc1beff1358966b213b4df89aca3f7dec157 Author: Nathan Chancellor Date: Tue Nov 30 15:11:24 2021 -0700 fpga: stratix10-soc: Do not use ret uninitialized in s10_probe() Clang warns: drivers/fpga/stratix10-soc.c:431:9: warning: variable 'ret' is uninitialized when used here [-Wuninitialized] return ret; ^~~ ret is only assigned in an error path now so just return 0 directly. Fixes: 4ba0b2c294fe ("fpga: mgr: Use standard dev_release for class driver") Link: https://github.com/ClangBuiltLinux/linux/issues/1517 Reviewed-by: Russ Weight Reviewed-by: Tom Rix Acked-by: Xu Yilun Signed-off-by: Nathan Chancellor Signed-off-by: Moritz Fischer commit 0109841fc4565bb3cefcdfb2991da0c47cd94b23 Merge: fc993be36f9ea b247f32aecad0 Author: Jakub Kicinski Date: Thu Dec 2 19:00:17 2021 -0800 Merge tag 'mlx5-updates-2021-12-02' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5-updates-2021-12-02 Misc updates to mlx5 driver 1) Various code cleanups 2) Error path handling fixes of latest features 3) Print more information on pci error handling 4) Dynamically resize flow counters query buffer ==================== Link: https://lore.kernel.org/r/20211203005622.183325-1-saeed@kernel.org Signed-off-by: Jakub Kicinski commit 2bfdbe8b7ebd17b5331071071a910fbabc64b436 Author: Ming Lei Date: Fri Dec 3 10:39:35 2021 +0800 null_blk: allow zero poll queues There isn't any reason to not allow zero poll queues from user viewpoint. Also sometimes we need to compare io poll between poll mode and irq mode, so not allowing poll queues is bad. Fixes: 15dfc662ef31 ("null_blk: Fix handling of submit_queues and poll_queues attributes") Cc: Shin'ichiro Kawasaki Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20211203023935.3424042-1-ming.lei@redhat.com Signed-off-by: Jens Axboe commit bf3f120fd61c42c2f4aed8995e5417776d788c37 Author: Niklas Cassel Date: Wed Dec 1 14:28:31 2021 +0000 scsi: sd_zbc: Clean up sd_zbc_parse_report() setting of wp Make sd_zbc_parse_report() use if/else when setting the write pointer, instead of setting it unconditionally and then conditionally updating it. Link: https://lore.kernel.org/r/20211201142821.64650-2-Niklas.Cassel@wdc.com Reviewed-by: Johannes Thumshirn Signed-off-by: Niklas Cassel Signed-off-by: Martin K. Petersen commit 13202ebf5f331ca83f5ab47eb90ca4ef5489ac80 Author: Niklas Cassel Date: Wed Dec 1 14:28:30 2021 +0000 scsi: sd_zbc: Simplify zone full condition check According to the ZBC (and ZAC) specification, a zone that has Zone Type set to Conventional, must also have its Zone Condition set to "Not Write Pointer". Therefore, a conventional zone will never have Zone Condition set to "Full", which means that we can omit the non-conventional prerequisite from the zone full condition check. Link: https://lore.kernel.org/r/20211201142821.64650-1-Niklas.Cassel@wdc.com Suggested-by: Damien Le Moal Reviewed-by: Damien Le Moal Reviewed-by: Johannes Thumshirn Signed-off-by: Niklas Cassel Signed-off-by: Martin K. Petersen commit a08ed9aae8a3d2321ef378d6581cc87a3fb75b44 Author: Jens Axboe Date: Thu Dec 2 12:43:46 2021 -0700 block: fix double bio queue when merging in cached request path When we attempt to merge off the cached request path, we return NULL if successful. This makes the caller believe that it's should allocate a new request, and hence we end up with the bio both merged and associated with a new request. This, predictably, leads to all sorts of crashes. Pass in a pointer to the bio pointer, and clear it for the merge case. Then the caller knows that the bio is already queued, and no new requests need to get allocated. Fixes: 5b13bc8a3fd5 ("blk-mq: cleanup request allocation") Reviewed-by: Ming Lei Signed-off-by: Jens Axboe commit e3fd5f632cdd00e3652e4a5fe743c8c052af11a8 Author: Bjorn Andersson Date: Thu Dec 2 17:39:01 2021 -0800 MAINTAINERS: Add entry for Qualcomm clock drivers Most SoC specific clock drivers are picked by respective SoC maintainer and then sent to the clock maintainers on their way upstream. This has however not been the case for the Qualcomm clock drivers - which doesn't actually have a maintainer per MAINTAINERS and where the framework maintainers have just carried the Qualcomm effort as well, presumably as a result of Stephen's history. Move the maintainership of the Qualcomm clock drivers to use the same model as other SoC vendors and document the ownership by actually introducing an entry in MAINTAINERS. Cc: Stephen Boyd Signed-off-by: Bjorn Andersson Acked-by: Stephen Boyd Link: https://lore.kernel.org/r/20211203013901.3460496-1-bjorn.andersson@linaro.org commit ecb64bbff7dddf510c7b011a7c0bd6a87e5c88e8 Author: Randy Dunlap Date: Fri Nov 19 22:27:19 2021 -0800 clk: Gemini: fix struct name in kernel-doc Fix a typo in the struct name in the kernel-doc notation so that kernel-doc won't complain about it. Fixes this warning: drivers/clk/clk-gemini.c:64: warning: expecting prototype for struct gemini_data_data. Prototype was for struct gemini_gate_data instead Fixes: 846423f96721 ("clk: Add Gemini SoC clock controller") Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: linux-clk@vger.kernel.org Link: https://lore.kernel.org/r/20211120062719.21395-1-rdunlap@infradead.org Reviewed-by: Linus Walleij Signed-off-by: Stephen Boyd commit 8a3492cd8de45013bb1a152efeb8757cfeb43cdd Author: Shubhrajyoti Datta Date: Wed Nov 17 14:38:54 2021 +0530 clk: zynq: pll: Fix kernel-doc warnings Fix the following kernel-doc warning drivers/clk/zynq/pll.c:15: warning: missing initial short description on line: * struct zynq_pll drivers/clk/zynq/pll.c:96: warning: No description found for return value of 'zynq_pll_is_enabled' drivers/clk/zynq/pll.c:116: warning: No description found for return value of 'zynq_pll_enable' drivers/clk/zynq/pll.c:187: warning: No description found for return value of 'clk_register_zynq_pll' Signed-off-by: Shubhrajyoti Datta Link: https://lore.kernel.org/r/9929a56462bfdd491c43c233abc4341fc14dac1d.1637139796.git.shubhrajyoti.datta@xilinx.com Signed-off-by: Stephen Boyd commit 71e762316140445c3146bac98ffb29ad6ea0d36c Author: Randy Dunlap Date: Sun Nov 14 19:26:07 2021 -0800 clk: imx: pllv1: fix kernel-doc notation for struct clk_pllv1 Convert struct clk_pllv1 comments to kernel-doc notation and move them below the MFN_* macros. Fixes this kernel-doc warning: drivers/clk/imx/clk-pllv1.c:12: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * pll v1 Fixes: 2af9e6db14db ("ARM i.MX: Add common clock support for pllv1") Fixes: a594790368a8 ("ARM: imx: pllv1: Fix PLL calculation for i.MX27") Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Abel Vesa Cc: linux-clk@vger.kernel.org Cc: linux-imx@nxp.com Cc: Alexander Shiyan Cc: Shawn Guo Cc: Sascha Hauer Link: https://lore.kernel.org/r/20211115032607.28970-1-rdunlap@infradead.org Signed-off-by: Stephen Boyd commit b247f32aecad09e6cf7edff7739e6f2c9dc5fca9 Author: Avihai Horon Date: Thu Oct 28 16:03:06 2021 +0300 net/mlx5: Dynamically resize flow counters query buffer The flow counters bulk query buffer is allocated once during mlx5_fc_init_stats(). For PFs and VFs this buffer usually takes a little more than 512KB of memory, which is aligned to the next power of 2, to 1MB. For SFs, this buffer is reduced and takes around 128 Bytes. The buffer size determines the maximum number of flow counters that can be queried at a time. Thus, having a bigger buffer can improve performance for users that need to query many flow counters. There are cases that don't use many flow counters and don't need a big buffer (e.g. SFs, VFs). Since this size is critical with large scale, in these cases the buffer size should be reduced. In order to reduce memory consumption while maintaining query performance, change the query buffer's allocation scheme to the following: - First allocate the buffer with small initial size. - If the number of counters surpasses the initial size, resize the buffer to the maximum size. The buffer only grows and isn't shrank, because users with many flow counters don't care about the buffer size and we don't want to add resize overhead if the current number of counters drops. This solution is preferable to the current one, which is less accurate and only addresses SFs. Signed-off-by: Avihai Horon Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit d4bb053139e74f92905dffafddde73ed0ba9df81 Author: Roi Dayan Date: Tue Nov 9 14:07:49 2021 +0200 net/mlx5e: TC, Set flow attr ip_version earlier Setting flow attr ip_version is not related to parsing tc flow actions. It needs to be set after parsing flower matches which changes the spec. So move it outside parse_tc_fdb_actions() and set it in __mlx5e_add_fdb_flow(). Signed-off-by: Roi Dayan Reviewed-by: Oz Shlomo Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed commit df990477242f96b48ae1eee5ea8a5f1d2879f67a Author: Roi Dayan Date: Thu Oct 28 15:50:49 2021 +0300 net/mlx5e: TC, Move common flow_action checks into function Remove duplicate checks on flow_action by using common function. Signed-off-by: Roi Dayan Reviewed-by: Oz Shlomo Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed commit 70a140ea6f79b04810b66e80170b02879f03ef65 Author: Roi Dayan Date: Tue Aug 3 15:14:55 2021 +0300 net/mlx5e: Remove redundant actions arg from vlan push/pop funcs Passing actions is redundant and can be retrieved from flow attr. Signed-off-by: Roi Dayan Reviewed-by: Oz Shlomo Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed commit 3cc78411f3f4158fee710a7c606bf65a3f8ebb67 Author: Roi Dayan Date: Tue Aug 3 14:50:42 2021 +0300 net/mlx5e: Remove redundant actions arg from validate_goto_chain() Passing actions is redundant and can be retrieved from flow. Signed-off-by: Roi Dayan Reviewed-by: Oz Shlomo Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed commit 9745dbe03669cc05139c242faf9afa13fcf289f6 Author: Roi Dayan Date: Tue Oct 26 11:19:39 2021 +0300 net/mlx5e: TC, Remove redundant action stack var Remove the action stack var from parse tc fdb actions and prase tc nic actions, use the flow attr action var directly. Signed-off-by: Roi Dayan Reviewed-by: Oz Shlomo Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed commit e9542221c4f51c346e239a394ef30942f68a29b7 Author: Tariq Toukan Date: Sun Sep 12 16:12:05 2021 +0300 net/mlx5e: Hide function mlx5e_num_channels_changed No calls for mlx5e_num_channels_changed() out of en_main.c, turn it static and remove from header. Keep the wrapper function mlx5e_num_channels_changed_ctx exposed. Signed-off-by: Tariq Toukan Reviewed-by: Aya Levin Signed-off-by: Saeed Mahameed commit 3ef1f8e795ba0e41fca3229258cdacf5f5bd390e Author: Ben Ben-Ishay Date: Wed Nov 10 18:10:44 2021 +0200 net/mlx5e: SHAMPO, clean MLX5E_MAX_KLM_PER_WQE macro This commit reduces unused variable from MLX5E_MAX_KLM_PER_WQE macro that introduced by commit d7b896acbdcb ("net/mlx5e: Add support to klm_umr_wqe"). Signed-off-by: Ben Ben-Ishay Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed commit fad1783a6d669ac82b6ea4f2f32b4ba2b5484920 Author: Saeed Mahameed Date: Mon Oct 4 18:39:51 2021 -0700 net/mlx5: Print more info on pci error handlers In case mlx5_pci_err_detected was called with state equals to pci_channel_io_perm_failure, the driver will never come back up. It is nice to know why the driver went to zombie land, so print some useful information on pci err handlers. Signed-off-by: Saeed Mahameed Reviewed-by: Moshe Shemesh commit c64d01b3ceba873aa8e8605598cec4a6bc6d1601 Author: Dan Carpenter Date: Sat Nov 27 17:19:53 2021 +0300 net/mlx5: SF, silence an uninitialized variable warning This code sometimes calls mlx5_sf_hw_table_hwc_init() when "ext_base_id" is uninitialized. It's not used on that path, but it generates a static checker warning to pass uninitialized variables to another function. It may also generate runtime UBSan warnings depending on if the mlx5_sf_hw_table_hwc_init() function is inlined or not. Signed-off-by: Dan Carpenter Reviewed-by: Leon Romanovsky Signed-off-by: Saeed Mahameed commit 31108d142f3632970f6f3e0224bd1c6781c9f87d Author: Christophe JAILLET Date: Sat Nov 6 18:08:11 2021 +0100 net/mlx5: Fix some error handling paths in 'mlx5e_tc_add_fdb_flow()' All the error handling paths of 'mlx5e_tc_add_fdb_flow()' end to 'err_out' where 'flow_flag_set(flow, FAILED);' is called. All but the new error handling paths added by the commits given in the Fixes tag below. Fix these error handling paths and branch to 'err_out'. Fixes: 166f431ec6be ("net/mlx5e: Add indirect tc offload of ovs internal port") Fixes: b16eb3c81fe2 ("net/mlx5: Support internal port as decap route device") Signed-off-by: Christophe JAILLET Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit baf5c001300e653ab89310b755e5aac551ce822d Author: Wei Yongjun Date: Tue Nov 23 08:36:16 2021 +0000 net/mlx5: Fix error return code in esw_qos_create() Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: 85c5f7c9200e ("net/mlx5: E-switch, Create QoS on demand") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun Signed-off-by: Saeed Mahameed commit d2b8c7ba3c795a4ef8de48009fd13735b1a428e5 Author: Arnd Bergmann Date: Mon Nov 8 12:10:33 2021 +0100 mlx5: fix mlx5i_grp_sw_update_stats() stack usage The mlx5e_sw_stats structure has grown to the point of triggering a warning when put on the stack of a function: mlx5/core/ipoib/ipoib.c: In function 'mlx5i_grp_sw_update_stats': mlx5/core/ipoib/ipoib.c:136:1: error: the frame size of 1028 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] In this case, only five of the structure members are actually set, so it's sufficient to have those as separate local variables. As en_rep.c uses 'struct rtnl_link_stats64' for this, just use the same one here for consistency. Signed-off-by: Arnd Bergmann Signed-off-by: Saeed Mahameed commit 7a7dd5114f53885419ef67c530e961d7ceaec15a Author: Arnd Bergmann Date: Mon Nov 8 12:10:32 2021 +0100 mlx5: fix psample_sample_packet link error When PSAMPLE is a loadable module, built-in drivers cannot use it: aarch64-linux-ld: drivers/net/ethernet/mellanox/mlx5/core/en/tc/sample.o: in function `mlx5e_tc_sample_skb': sample.c:(.text+0xd68): undefined reference to `psample_sample_packet' Add the same dependency here that is used for MLXSW Signed-off-by: Arnd Bergmann Signed-off-by: Saeed Mahameed commit 73d3724745db79e73ec40c74716ea6222a383ab4 Author: jason-jh.lin Date: Tue Nov 30 02:44:36 2021 +0800 drm/mediatek: Adjust to the alphabetic order for mediatek-drm Adjust to the alphabetic order for the define, function, struct and array in mediatek-drm driver Signed-off-by: jason-jh.lin Signed-off-by: Chun-Kuang Hu commit aa0c31554ec3e32ec131dc8e7936f858f692bf31 Author: jason-jh.lin Date: Tue Nov 30 02:44:35 2021 +0800 drm/mediatek: Rename the define of register offset Add DISP_REG prefix for the define of register offset to make the difference from the define of register value. Signed-off-by: jason-jh.lin Signed-off-by: Chun-Kuang Hu commit 080a70b21f476b39ad66524c0ce0729972c61a10 Merge: 8b4ff5f8bb126 c93faaaf2f67b Author: Alexei Starovoitov Date: Thu Dec 2 15:08:37 2021 -0800 Merge branch 'Deprecate bpf_prog_load_xattr() API' Andrii Nakryiko says: ==================== Few lines in the last patch to mark bpf_prog_load_xattr() deprecated required a decent amount of clean ups in all the other patches. samples/bpf is big part of the clean up. This patch set also bumps libbpf version to 0.7, as libbpf v0.6 release will be cut shortly. ==================== Signed-off-by: Alexei Starovoitov commit c93faaaf2f67ba5396840316651cdc7640d9fa9e Author: Andrii Nakryiko Date: Wed Dec 1 15:28:24 2021 -0800 libbpf: Deprecate bpf_prog_load_xattr() API bpf_prog_load_xattr() is high-level API that's named as a low-level BPF_PROG_LOAD wrapper APIs, but it actually operates on struct bpf_object. It's badly and confusingly misnamed as it will load all the progs insige bpf_object, returning prog_fd of the very first BPF program. It also has a bunch of ad-hoc things like log_level override, map_ifindex auto-setting, etc. All this can be expressed more explicitly and cleanly through existing libbpf APIs. This patch marks bpf_prog_load_xattr() for deprecation in libbpf v0.8 ([0]). [0] Closes: https://github.com/libbpf/libbpf/issues/308 Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211201232824.3166325-10-andrii@kernel.org commit c58f9815ba9735752d3735efb915e8878604684b Author: Andrii Nakryiko Date: Wed Dec 1 15:28:23 2021 -0800 samples/bpf: Get rid of deprecated libbpf API uses Replace deprecated APIs with new ones. Also mute source code using deprecated AF_XDP (xsk.h). Figuring out what to do with all the AF_XDP stuff is a separate problem that should be solved with its own set of changes. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211201232824.3166325-9-andrii@kernel.org commit 527024f7aeb683ce7ef49b07ef7ce9ecf015288d Author: Andrii Nakryiko Date: Wed Dec 1 15:28:22 2021 -0800 samples/bpf: Clean up samples/bpf build failes Remove xdp_samples_user.o rule redefinition which generates Makefile warning and instead override TPROGS_CFLAGS. This seems to work fine when building inside selftests/bpf. That was one big head-scratcher before I found that generic Makefile.target hid this surprising specialization for for xdp_samples_user.o. Main change is to use actual locally installed libbpf headers. Also drop printk macro re-definition (not even used!). Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211201232824.3166325-8-andrii@kernel.org commit 186d1a86003ddcf0ec9e85e17ece868663106639 Author: Andrii Nakryiko Date: Wed Dec 1 15:28:21 2021 -0800 selftests/bpf: Remove all the uses of deprecated bpf_prog_load_xattr() Migrate all the selftests that were still using bpf_prog_load_xattr(). Few are converted to skeleton, others will use bpf_object__open_file() API. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211201232824.3166325-7-andrii@kernel.org commit 00872de6e1b004377f6036f95db43e2145606eb2 Author: Andrii Nakryiko Date: Wed Dec 1 15:28:20 2021 -0800 selftests/bpf: Mute xdpxceiver.c's deprecation warnings xdpxceiver.c is using AF_XDP APIs that are deprecated starting from libbpf 0.7. Until we migrate the test to libxdp or solve this issue in some other way, mute deprecation warnings within xdpxceiver.c. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211201232824.3166325-6-andrii@kernel.org commit 045b233a29a2ea3a168296f000cd5b1c08c4a2f7 Author: Andrii Nakryiko Date: Wed Dec 1 15:28:19 2021 -0800 selftests/bpf: Remove recently reintroduced legacy btf__dedup() use We've added one extra patch that added back the use of legacy btf__dedup() variant. Clean that up. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211201232824.3166325-5-andrii@kernel.org commit a15d408b839af421fba0a2ff6df193c13ef753d4 Author: Andrii Nakryiko Date: Wed Dec 1 15:28:18 2021 -0800 bpftool: Migrate off of deprecated bpf_create_map_xattr() API Switch to bpf_map_create() API instead. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211201232824.3166325-4-andrii@kernel.org commit dbdd2c7f8cec2d09ae0e1bd707ae6050fa1c105f Author: Andrii Nakryiko Date: Wed Dec 1 15:28:17 2021 -0800 libbpf: Add API to get/set log_level at per-program level Add bpf_program__set_log_level() and bpf_program__log_level() to fetch and adjust log_level sent during BPF_PROG_LOAD command. This allows to selectively request more or less verbose output in BPF verifier log. Also bump libbpf version to 0.7 and make these APIs the first in v0.7. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211201232824.3166325-3-andrii@kernel.org commit 74d9807023573ba2d82ec3f505f6aa0c7076918c Author: Andrii Nakryiko Date: Wed Dec 1 15:28:16 2021 -0800 libbpf: Use __u32 fields in bpf_map_create_opts Corresponding Linux UAPI struct uses __u32, not int, so keep it consistent. Fixes: 992c4225419a ("libbpf: Unify low-level map creation APIs w/ new bpf_map_create()") Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211201232824.3166325-2-andrii@kernel.org commit 45c753f5f24d2d4717acb38ce35e604ff9abcb50 Author: Frederic Weisbecker Date: Wed Dec 1 16:19:45 2021 +0100 workqueue: Fix unbind_workers() VS wq_worker_sleeping() race At CPU-hotplug time, unbind_workers() may preempt a worker while it is going to sleep. In that case the following scenario can happen: unbind_workers() wq_worker_sleeping() -------------- ------------------- if (worker->flags & WORKER_NOT_RUNNING) return; //PREEMPTED by unbind_workers worker->flags |= WORKER_UNBOUND; [...] atomic_set(&pool->nr_running, 0); //resume to worker atomic_dec_and_test(&pool->nr_running); After unbind_worker() resets pool->nr_running, the value is expected to remain 0 until the pool ever gets rebound in case cpu_up() is called on the target CPU in the future. But here the race leaves pool->nr_running with a value of -1, triggering the following warning when the worker goes idle: WARNING: CPU: 3 PID: 34 at kernel/workqueue.c:1823 worker_enter_idle+0x95/0xc0 Modules linked in: CPU: 3 PID: 34 Comm: kworker/3:0 Not tainted 5.16.0-rc1+ #34 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.12.0-59-gc9ba527-rebuilt.opensuse.org 04/01/2014 Workqueue: 0x0 (rcu_par_gp) RIP: 0010:worker_enter_idle+0x95/0xc0 Code: 04 85 f8 ff ff ff 39 c1 7f 09 48 8b 43 50 48 85 c0 74 1b 83 e2 04 75 99 8b 43 34 39 43 30 75 91 8b 83 00 03 00 00 85 c0 74 87 <0f> 0b 5b c3 48 8b 35 70 f1 37 01 48 8d 7b 48 48 81 c6 e0 93 0 RSP: 0000:ffff9b7680277ed0 EFLAGS: 00010086 RAX: 00000000ffffffff RBX: ffff93465eae9c00 RCX: 0000000000000000 RDX: 0000000000000000 RSI: ffff9346418a0000 RDI: ffff934641057140 RBP: ffff934641057170 R08: 0000000000000001 R09: ffff9346418a0080 R10: ffff9b768027fdf0 R11: 0000000000002400 R12: ffff93465eae9c20 R13: ffff93465eae9c20 R14: ffff93465eae9c70 R15: ffff934641057140 FS: 0000000000000000(0000) GS:ffff93465eac0000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 000000001cc0c000 CR4: 00000000000006e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: worker_thread+0x89/0x3d0 ? process_one_work+0x400/0x400 kthread+0x162/0x190 ? set_kthread_struct+0x40/0x40 ret_from_fork+0x22/0x30 Also due to this incorrect "nr_running == -1", all sorts of hazards can happen, starting with queued works being ignored because no workers are awaken at insert_work() time. Fix this with checking again the worker flags while pool->lock is locked. Fixes: b945efcdd07d ("sched: Remove pointless preemption disable in sched_submit_work()") Reviewed-by: Lai Jiangshan Tested-by: Paul E. McKenney Acked-by: Peter Zijlstra (Intel) Signed-off-by: Frederic Weisbecker Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Paul E. McKenney Cc: Sebastian Andrzej Siewior Cc: Daniel Bristot de Oliveira Signed-off-by: Tejun Heo commit 07edfece8bcb0580a1828d939e6f8d91a8603eb2 Author: Frederic Weisbecker Date: Wed Dec 1 16:19:44 2021 +0100 workqueue: Fix unbind_workers() VS wq_worker_running() race At CPU-hotplug time, unbind_worker() may preempt a worker while it is waking up. In that case the following scenario can happen: unbind_workers() wq_worker_running() -------------- ------------------- if (!(worker->flags & WORKER_NOT_RUNNING)) //PREEMPTED by unbind_workers worker->flags |= WORKER_UNBOUND; [...] atomic_set(&pool->nr_running, 0); //resume to worker atomic_inc(&worker->pool->nr_running); After unbind_worker() resets pool->nr_running, the value is expected to remain 0 until the pool ever gets rebound in case cpu_up() is called on the target CPU in the future. But here the race leaves pool->nr_running with a value of 1, triggering the following warning when the worker goes idle: WARNING: CPU: 3 PID: 34 at kernel/workqueue.c:1823 worker_enter_idle+0x95/0xc0 Modules linked in: CPU: 3 PID: 34 Comm: kworker/3:0 Not tainted 5.16.0-rc1+ #34 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.12.0-59-gc9ba527-rebuilt.opensuse.org 04/01/2014 Workqueue: 0x0 (rcu_par_gp) RIP: 0010:worker_enter_idle+0x95/0xc0 Code: 04 85 f8 ff ff ff 39 c1 7f 09 48 8b 43 50 48 85 c0 74 1b 83 e2 04 75 99 8b 43 34 39 43 30 75 91 8b 83 00 03 00 00 85 c0 74 87 <0f> 0b 5b c3 48 8b 35 70 f1 37 01 48 8d 7b 48 48 81 c6 e0 93 0 RSP: 0000:ffff9b7680277ed0 EFLAGS: 00010086 RAX: 00000000ffffffff RBX: ffff93465eae9c00 RCX: 0000000000000000 RDX: 0000000000000000 RSI: ffff9346418a0000 RDI: ffff934641057140 RBP: ffff934641057170 R08: 0000000000000001 R09: ffff9346418a0080 R10: ffff9b768027fdf0 R11: 0000000000002400 R12: ffff93465eae9c20 R13: ffff93465eae9c20 R14: ffff93465eae9c70 R15: ffff934641057140 FS: 0000000000000000(0000) GS:ffff93465eac0000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 000000001cc0c000 CR4: 00000000000006e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: worker_thread+0x89/0x3d0 ? process_one_work+0x400/0x400 kthread+0x162/0x190 ? set_kthread_struct+0x40/0x40 ret_from_fork+0x22/0x30 Also due to this incorrect "nr_running == 1", further queued work may end up not being served, because no worker is awaken at work insert time. This raises rcutorture writer stalls for example. Fix this with disabling preemption in the right place in wq_worker_running(). It's worth noting that if the worker migrates and runs concurrently with unbind_workers(), it is guaranteed to see the WORKER_UNBOUND flag update due to set_cpus_allowed_ptr() acquiring/releasing rq->lock. Fixes: 6d25be5782e4 ("sched/core, workqueues: Distangle worker accounting from rq lock") Reviewed-by: Lai Jiangshan Tested-by: Paul E. McKenney Acked-by: Peter Zijlstra (Intel) Signed-off-by: Frederic Weisbecker Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Sebastian Andrzej Siewior Cc: Daniel Bristot de Oliveira Signed-off-by: Tejun Heo commit 5c0189a8b52f76d8a061d2ec80adb11559742d78 Author: Fabio Estevam Date: Tue Nov 30 09:58:30 2021 -0300 rtc: rv8803: Add support for the Epson RX8804 RTC The Epson RX8804 RTC has the same programming model as RV8803. Add support for it in the driver. Signed-off-by: Fabio Estevam Reviewed-by: Otavio Salvador Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20211130125830.1166194-2-festevam@gmail.com commit 10d96b44a94e5cfd23739d2dcb950a7bdc109736 Author: Fabio Estevam Date: Tue Nov 30 09:58:29 2021 -0300 dt/bindings: rtc: rx8900: Add an entry for RX8804 The Epson RX8804 RTC has the same programming model as RV8803 and RX8900. Add an entry for it in the binding document. Signed-off-by: Fabio Estevam Reviewed-by: Otavio Salvador Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20211130125830.1166194-1-festevam@gmail.com commit 029d3a6f2f3c73ac29a7460d8007798e940488fd Author: Nikita Shubin Date: Mon Nov 29 10:26:49 2021 +0300 rtc: da9063: add as wakeup source As da9063 RTC is not a real I2C client, but relies on da9063 MFD driver, we need to explicitly mark da9063 RTC as a wakeup source to be able to access class/rtc/rtcN/wakealarm sysfs entry to set alarms, so we can wakeup from SHUTDOWN/RTC/DELIVERY mode. As da9063 driver refuses to load without irq, we simply add it as a wakeup source before registering rtc device. Signed-off-by: Nikita Shubin Reviewed-by: Adam Thomson Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20211129072650.22686-1-nikita.shubin@maquefel.me commit 8b4ff5f8bb126fa8ee6918f4854748277609cf68 Author: Paul E. McKenney Date: Tue Nov 30 16:50:30 2021 -0800 selftests/bpf: Update test names for xchg and cmpxchg The test_cmpxchg() and test_xchg() functions say "test_run add". Therefore, make them say "test_run cmpxchg" and "test_run xchg", respectively. Signed-off-by: Paul E. McKenney Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211201005030.GA3071525@paulmck-ThinkPad-P17-Gen-1 commit eee9a6df0eed6481d5448a55b218a45868b41b5b Author: Jean-Philippe Brucker Date: Wed Dec 1 14:51:02 2021 +0000 selftests/bpf: Build testing_helpers.o out of tree Add $(OUTPUT) prefix to testing_helpers.o, so it can be built out of tree when necessary. At the moment, in addition to being built in-tree even when out-of-tree is required, testing_helpers.o is not built with the right recipe when cross-building. For consistency the other helpers, cgroup_helpers and trace_helpers, can also be passed as objects instead of source. Use *_HELPERS variable to keep the Makefile readable. Fixes: f87c1930ac29 ("selftests/bpf: Merge test_stub.c into testing_helpers.c") Signed-off-by: Jean-Philippe Brucker Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211201145101.823159-1-jean-philippe@linaro.org commit fc993be36f9ea7fc286d84d8471a1a20e871aad4 Merge: 36d7d36fcf69e a51e3ac43ddba Author: Jakub Kicinski Date: Thu Dec 2 11:44:56 2021 -0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Signed-off-by: Jakub Kicinski commit 373b5416b4b03ebda5d8f0605b81eff0dc76ebcf Author: Jens Axboe Date: Thu Dec 2 12:42:58 2021 -0700 block: get rid of useless goto and label in blk_mq_get_new_requests() Expected case is returning a request, just check for success and return the request rather than having an error label. Signed-off-by: Jens Axboe commit 7fb4d48dc255cf186ecd11cadf34f56cd10bf3b7 Merge: 64b5b97b8cfff 098dc5335a208 Author: Andrii Nakryiko Date: Thu Dec 2 11:18:36 2021 -0800 Merge branch 'bpf: CO-RE support in the kernel' Alexei Starovoitov says: ==================== From: Alexei Starovoitov v4->v5: . Reduce number of memory allocations in candidate cache logic . Fix couple UAF issues . Add Andrii's patch to cleanup struct bpf_core_cand . More thorough tests . Planned followups: - support -v in lskel - move struct bpf_core_spec out of bpf_core_apply_relo_insn to reduce stack usage - implement bpf_core_types_are_compat v3->v4: . complete refactor of find candidates logic. Now it has small permanent cache. . Fix a bug in gen_loader related to attach_kind. . Fix BTF log size limit. . More tests. v2->v3: . addressed Andrii's feedback in every patch. New field in union bpf_attr changed from "core_relo" to "core_relos". . added one more test and checkpatch.pl-ed the set. v1->v2: . Refactor uapi to pass 'struct bpf_core_relo' from LLVM into libbpf and further into the kernel instead of bpf_core_apply_relo() bpf helper. Because of this change the CO-RE algorithm has an ability to log error and debug events through the standard bpf verifer log mechanism which was not possible with helper approach. . #define RELO_CORE macro was removed and replaced with btf_member_bit_offset() patch. This set introduces CO-RE support in the kernel. There are several reasons to add such support: 1. It's a step toward signed BPF programs. 2. It allows golang like languages that struggle to adopt libbpf to take advantage of CO-RE powers. 3. Currently the field accessed by 'ldx [R1 + 10]' insn is recognized by the verifier purely based on +10 offset. If R1 points to a union the verifier picks one of the fields at this offset. With CO-RE the kernel can disambiguate the field access. Alexei Starovoitov (16): libbpf: Replace btf__type_by_id() with btf_type_by_id(). bpf: Rename btf_member accessors. bpf: Prepare relo_core.c for kernel duty. bpf: Define enum bpf_core_relo_kind as uapi. bpf: Pass a set of bpf_core_relo-s to prog_load command. bpf: Adjust BTF log size limit. bpf: Add bpf_core_add_cands() and wire it into bpf_core_apply_relo_insn(). libbpf: Use CO-RE in the kernel in light skeleton. libbpf: Support init of inner maps in light skeleton. libbpf: Clean gen_loader's attach kind. selftests/bpf: Add lskel version of kfunc test. selftests/bpf: Improve inner_map test coverage. selftests/bpf: Convert map_ptr_kern test to use light skeleton. selftests/bpf: Additional test for CO-RE in the kernel. selftests/bpf: Revert CO-RE removal in test_ksyms_weak. selftests/bpf: Add CO-RE relocations to verifier scale test. ==================== Signed-off-by: Andrii Nakryiko commit 098dc5335a2083223c80d058ab4d23f6ce120b97 Author: Alexei Starovoitov Date: Wed Dec 1 10:10:40 2021 -0800 selftests/bpf: Add CO-RE relocations to verifier scale test. Add 182 CO-RE relocations to verifier scale test. Signed-off-by: Alexei Starovoitov Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211201181040.23337-18-alexei.starovoitov@gmail.com commit 3268f0316af629474ec4fa8d9b4e6f618cb96794 Author: Alexei Starovoitov Date: Wed Dec 1 10:10:39 2021 -0800 selftests/bpf: Revert CO-RE removal in test_ksyms_weak. The commit 087cba799ced ("selftests/bpf: Add weak/typeless ksym test for light skeleton") added test_ksyms_weak to light skeleton testing, but remove CO-RE access. Revert that part of commit, since light skeleton can use CO-RE in the kernel. Signed-off-by: Alexei Starovoitov Signed-off-by: Andrii Nakryiko Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211201181040.23337-17-alexei.starovoitov@gmail.com commit 26b367e3663931f2fee5f0786a1eff712e67b0bf Author: Alexei Starovoitov Date: Wed Dec 1 10:10:38 2021 -0800 selftests/bpf: Additional test for CO-RE in the kernel. Add a test where randmap() function is appended to three different bpf programs. That action checks struct bpf_core_relo replication logic and offset adjustment in gen loader part of libbpf. Fourth bpf program has 360 CO-RE relocations from vmlinux, bpf_testmod, and non-existing type. It tests candidate cache logic. Signed-off-by: Alexei Starovoitov Signed-off-by: Andrii Nakryiko Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211201181040.23337-16-alexei.starovoitov@gmail.com commit 650c9dbd101ba7d7180f4e77deb1c273f4ea5ca3 Author: Alexei Starovoitov Date: Wed Dec 1 10:10:37 2021 -0800 selftests/bpf: Convert map_ptr_kern test to use light skeleton. To exercise CO-RE in the kernel further convert map_ptr_kern test to light skeleton. Signed-off-by: Alexei Starovoitov Signed-off-by: Andrii Nakryiko Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211201181040.23337-15-alexei.starovoitov@gmail.com commit d82fa9b708d7d8a9c275d86c4388d24ecc63206c Author: Alexei Starovoitov Date: Wed Dec 1 10:10:36 2021 -0800 selftests/bpf: Improve inner_map test coverage. Check that hash and array inner maps are properly initialized. Signed-off-by: Alexei Starovoitov Signed-off-by: Andrii Nakryiko Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211201181040.23337-14-alexei.starovoitov@gmail.com commit bc5f75da977b2a4d9aa6827081e6c2ddd3347328 Author: Alexei Starovoitov Date: Wed Dec 1 10:10:35 2021 -0800 selftests/bpf: Add lskel version of kfunc test. Add light skeleton version of kfunc_call_test_subprog test. Signed-off-by: Alexei Starovoitov Signed-off-by: Andrii Nakryiko Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211201181040.23337-13-alexei.starovoitov@gmail.com commit 19250f5fc0c283892a61f3abf9d65e6325f63897 Author: Alexei Starovoitov Date: Wed Dec 1 10:10:34 2021 -0800 libbpf: Clean gen_loader's attach kind. The gen_loader has to clear attach_kind otherwise the programs without attach_btf_id will fail load if they follow programs with attach_btf_id. Fixes: 67234743736a ("libbpf: Generate loader program out of BPF ELF file.") Signed-off-by: Alexei Starovoitov Signed-off-by: Andrii Nakryiko Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211201181040.23337-12-alexei.starovoitov@gmail.com commit be05c94476f3cf4fdc29feab4ed1053187323296 Author: Alexei Starovoitov Date: Wed Dec 1 10:10:33 2021 -0800 libbpf: Support init of inner maps in light skeleton. Add ability to initialize inner maps in light skeleton. Signed-off-by: Alexei Starovoitov Signed-off-by: Andrii Nakryiko Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211201181040.23337-11-alexei.starovoitov@gmail.com commit d0e928876e30b18411b80fd2445424bc00e95745 Author: Alexei Starovoitov Date: Wed Dec 1 10:10:32 2021 -0800 libbpf: Use CO-RE in the kernel in light skeleton. Without lskel the CO-RE relocations are processed by libbpf before any other work is done. Instead, when lskel is needed, remember relocation as RELO_CORE kind. Then when loader prog is generated for a given bpf program pass CO-RE relos of that program to gen loader via bpf_gen__record_relo_core(). The gen loader will remember them as-is and pass it later as-is into the kernel. The normal libbpf flow is to process CO-RE early before call relos happen. In case of gen_loader the core relos have to be added to other relos to be copied together when bpf static function is appended in different places to other main bpf progs. During the copy the append_subprog_relos() will adjust insn_idx for normal relos and for RELO_CORE kind too. When that is done each struct reloc_desc has good relos for specific main prog. Signed-off-by: Alexei Starovoitov Signed-off-by: Andrii Nakryiko Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211201181040.23337-10-alexei.starovoitov@gmail.com commit 1e89106da25390826608ad6ac0edfb7c9952eff3 Author: Alexei Starovoitov Date: Wed Dec 1 10:10:31 2021 -0800 bpf: Add bpf_core_add_cands() and wire it into bpf_core_apply_relo_insn(). Given BPF program's BTF root type name perform the following steps: . search in vmlinux candidate cache. . if (present in cache and candidate list >= 1) return candidate list. . do a linear search through kernel BTFs for possible candidates. . regardless of number of candidates found populate vmlinux cache. . if (candidate list >= 1) return candidate list. . search in module candidate cache. . if (present in cache) return candidate list (even if list is empty). . do a linear search through BTFs of all kernel modules collecting candidates from all of them. . regardless of number of candidates found populate module cache. . return candidate list. Then wire the result into bpf_core_apply_relo_insn(). When BPF program is trying to CO-RE relocate a type that doesn't exist in either vmlinux BTF or in modules BTFs these steps will perform 2 cache lookups when cache is hit. Note the cache doesn't prevent the abuse by the program that might have lots of relocations that cannot be resolved. Hence cond_resched(). CO-RE in the kernel requires CAP_BPF, since BTF loading requires it. Signed-off-by: Alexei Starovoitov Signed-off-by: Andrii Nakryiko Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211201181040.23337-9-alexei.starovoitov@gmail.com commit 03d5b99138dd8c7bfb838396acb180bd515ebf06 Author: Andrii Nakryiko Date: Wed Dec 1 10:10:30 2021 -0800 libbpf: Cleanup struct bpf_core_cand. Remove two redundant fields from struct bpf_core_cand. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211201181040.23337-8-alexei.starovoitov@gmail.com commit c5a2d43e998a821701029f23e25b62f9188e93ff Author: Alexei Starovoitov Date: Wed Dec 1 10:10:29 2021 -0800 bpf: Adjust BTF log size limit. Make BTF log size limit to be the same as the verifier log size limit. Otherwise tools that progressively increase log size and use the same log for BTF loading and program loading will be hitting hard to debug EINVAL. Signed-off-by: Alexei Starovoitov Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211201181040.23337-7-alexei.starovoitov@gmail.com commit fbd94c7afcf99c9f3b1ba1168657ecc428eb2c8d Author: Alexei Starovoitov Date: Wed Dec 1 10:10:28 2021 -0800 bpf: Pass a set of bpf_core_relo-s to prog_load command. struct bpf_core_relo is generated by llvm and processed by libbpf. It's a de-facto uapi. With CO-RE in the kernel the struct bpf_core_relo becomes uapi de-jure. Add an ability to pass a set of 'struct bpf_core_relo' to prog_load command and let the kernel perform CO-RE relocations. Note the struct bpf_line_info and struct bpf_func_info have the same layout when passed from LLVM to libbpf and from libbpf to the kernel except "insn_off" fields means "byte offset" when LLVM generates it. Then libbpf converts it to "insn index" to pass to the kernel. The struct bpf_core_relo's "insn_off" field is always "byte offset". Signed-off-by: Alexei Starovoitov Signed-off-by: Andrii Nakryiko Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211201181040.23337-6-alexei.starovoitov@gmail.com commit 46334a0cd21bed70d6f1ddef1464f75a0ebe1774 Author: Alexei Starovoitov Date: Wed Dec 1 10:10:27 2021 -0800 bpf: Define enum bpf_core_relo_kind as uapi. enum bpf_core_relo_kind is generated by llvm and processed by libbpf. It's a de-facto uapi. With CO-RE in the kernel the bpf_core_relo_kind values become uapi de-jure. Also rename them with BPF_CORE_ prefix to distinguish from conflicting names in bpf_core_read.h. The enums bpf_field_info_kind, bpf_type_id_kind, bpf_type_info_kind, bpf_enum_value_kind are passing different values from bpf program into llvm. Signed-off-by: Alexei Starovoitov Signed-off-by: Andrii Nakryiko Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211201181040.23337-5-alexei.starovoitov@gmail.com commit 29db4bea1d10b73749d7992c1fc9ac13499e8871 Author: Alexei Starovoitov Date: Wed Dec 1 10:10:26 2021 -0800 bpf: Prepare relo_core.c for kernel duty. Make relo_core.c to be compiled for the kernel and for user space libbpf. Note the patch is reducing BPF_CORE_SPEC_MAX_LEN from 64 to 32. This is the maximum number of nested structs and arrays. For example: struct sample { int a; struct { int b[10]; }; }; struct sample *s = ...; int *y = &s->b[5]; This field access is encoded as "0:1:0:5" and spec len is 4. The follow up patch might bump it back to 64. Signed-off-by: Alexei Starovoitov Signed-off-by: Andrii Nakryiko Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211201181040.23337-4-alexei.starovoitov@gmail.com commit 8293eb995f349aed28006792cad4cb48091919dd Author: Alexei Starovoitov Date: Wed Dec 1 10:10:25 2021 -0800 bpf: Rename btf_member accessors. Rename btf_member_bit_offset() and btf_member_bitfield_size() to avoid conflicts with similarly named helpers in libbpf's btf.h. Rename the kernel helpers, since libbpf helpers are part of uapi. Suggested-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Signed-off-by: Andrii Nakryiko Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211201181040.23337-3-alexei.starovoitov@gmail.com commit 74753e1462e77349525daf9eb60ea21ed92d3a97 Author: Alexei Starovoitov Date: Wed Dec 1 10:10:24 2021 -0800 libbpf: Replace btf__type_by_id() with btf_type_by_id(). To prepare relo_core.c to be compiled in the kernel and the user space replace btf__type_by_id with btf_type_by_id. In libbpf btf__type_by_id and btf_type_by_id have different behavior. bpf_core_apply_relo_insn() needs behavior of uapi btf__type_by_id vs internal btf_type_by_id, but type_id range check is already done in bpf_core_apply_relo(), so it's safe to replace it everywhere. The kernel btf_type_by_id() does the check anyway. It doesn't hurt. Suggested-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Signed-off-by: Andrii Nakryiko Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211201181040.23337-2-alexei.starovoitov@gmail.com commit ab50cb9df8896b39aae65c537a30de2c79c19735 Author: Zhou Qingyang Date: Wed Dec 1 23:13:10 2021 +0800 drm/radeon/radeon_kms: Fix a NULL pointer dereference in radeon_driver_open_kms() In radeon_driver_open_kms(), radeon_vm_bo_add() is assigned to vm->ib_bo_va and passes and used in radeon_vm_bo_set_addr(). In radeon_vm_bo_set_addr(), there is a dereference of vm->ib_bo_va, which could lead to a NULL pointer dereference on failure of radeon_vm_bo_add(). Fix this bug by adding a check of vm->ib_bo_va. This bug was found by a static analyzer. The analysis employs differential checking to identify inconsistent security operations (e.g., checks or kfrees) between two code paths and confirms that the inconsistent operations are not recovered in the current function or the callers, so they constitute bugs. Note that, as a bug found by static analysis, it can be a false positive or hard to trigger. Multiple researchers have cross-reviewed the bug. Builds with CONFIG_DRM_RADEON=m show no new warnings, and our static analyzer no longer warns about this code. Fixes: cc9e67e3d700 ("drm/radeon: fix VM IB handling") Reviewed-by: Christian König Signed-off-by: Zhou Qingyang Signed-off-by: Alex Deucher commit 69cb56290d9d10cdcc461aa2685e67e540507a96 Author: Vlad Zahorodnii Date: Thu Dec 2 14:52:15 2021 +0200 drm/amd/display: Use oriented source size when checking cursor scaling dm_check_crtc_cursor() doesn't take into account plane transforms when calculating plane scaling, this can result in false positives. For example, if there's an output with resolution 3840x2160 and the output is rotated 90 degrees, CRTC_W and CRTC_H will be 3840 and 2160, respectively, but SRC_W and SRC_H will be 2160 and 3840, respectively. Since the cursor plane usually has a square buffer attached to it, the dm_check_crtc_cursor() will think that there's a scale factor mismatch even though there isn't really. This fixes an issue where kwin fails to use hardware plane transforms. Changes since version 1: - s/orientated/oriented/g Reviewed-by: Nicholas Kazlauskas Signed-off-by: Vlad Zahorodnii Signed-off-by: Alex Deucher commit b220110e4cd442156f36e1d9b4914bb9e87b0d00 Author: Zhou Qingyang Date: Fri Dec 3 00:17:36 2021 +0800 drm/amdgpu: Fix a NULL pointer dereference in amdgpu_connector_lcd_native_mode() In amdgpu_connector_lcd_native_mode(), the return value of drm_mode_duplicate() is assigned to mode, and there is a dereference of it in amdgpu_connector_lcd_native_mode(), which will lead to a NULL pointer dereference on failure of drm_mode_duplicate(). Fix this bug add a check of mode. This bug was found by a static analyzer. The analysis employs differential checking to identify inconsistent security operations (e.g., checks or kfrees) between two code paths and confirms that the inconsistent operations are not recovered in the current function or the callers, so they constitute bugs. Note that, as a bug found by static analysis, it can be a false positive or hard to trigger. Multiple researchers have cross-reviewed the bug. Builds with CONFIG_DRM_AMDGPU=m show no new warnings, and our static analyzer no longer warns about this code. Fixes: d38ceaf99ed0 ("drm/amdgpu: add core driver (v4)") Signed-off-by: Zhou Qingyang Signed-off-by: Alex Deucher commit baf3f8f374062573c469631af03bf7fb1725896b Author: Alex Deucher Date: Tue Nov 30 17:04:57 2021 -0500 drm/amdgpu: handle SRIOV VCN revision parsing For SR-IOV, the IP discovery revision number encodes additional information. Handle that case here. v2: drop additional IP versions Reviewed-by: Guchun Chen Acked-by: Christian König Signed-off-by: Alex Deucher commit bab73f092da654d149bb4771c418bf585c06044a Author: Stanley.Yang Date: Thu Dec 2 13:06:05 2021 +0800 drm/amdgpu: skip query ecc info in gpu recovery this is a workaround due to get ecc info failed during gpu recovery [ 700.236122] amdgpu 0000:09:00.0: amdgpu: Failed to export SMU ecc table! [ 700.236128] amdgpu 0000:09:00.0: amdgpu: GPU reset begin! [ 704.331171] amdgpu: qcm fence wait loop timeout expired [ 704.331194] amdgpu: The cp might be in an unrecoverable state due to an unsuccessful queues preemption [ 704.332445] amdgpu 0000:09:00.0: amdgpu: GPU reset begin! [ 704.332448] amdgpu 0000:09:00.0: amdgpu: Bailing on TDR for s_job:ffffffffffffffff, as another already in progress [ 704.332456] amdgpu: Pasid 0x8000 destroy queue 0 failed, ret -62 [ 710.360924] amdgpu 0000:09:00.0: amdgpu: SMU: I'm not done with your previous command: SMN_C2PMSG_66:0x00000013 SMN_C2PMSG_82:0x00000007 [ 710.360964] amdgpu 0000:09:00.0: amdgpu: Failed to disable smu features. [ 710.361002] amdgpu 0000:09:00.0: amdgpu: Fail to disable dpm features! [ 710.361014] [drm:amdgpu_device_ip_suspend_phase2 [amdgpu]] *ERROR* suspend of IP block failed -62 Signed-off-by: Stanley.Yang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 9652c02428f3992129b73321fee32fe60b77c90f Author: Angus Ainslie Date: Thu Nov 18 08:18:45 2021 -0800 power: bq25890: add POWER_SUPPLY_PROP_TEMP Add the POWER_SUPPLY_PROP_TEMP and a NTC 10K percent VREGN to degrees LUT. Make sure that a conversion is forced when the power supply is offline so the temperature is valid. Signed-off-by: Angus Ainslie Signed-off-by: Sebastian Reichel commit 18d78171c061889a9a43152f60d6a27a10fc7656 Author: Ming Lei Date: Thu Dec 2 17:07:16 2021 +0800 blk-mq: check q->poll_stat in queue_poll_stat_show Without checking q->poll_stat in queue_poll_stat_show(), kernel panic may be caused if q->poll_stat isn't allocated. Fixes: 48b5c1fbcd8c ("block: only allocate poll_stats if there's a user of them") Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20211202090716.3292244-1-ming.lei@redhat.com Signed-off-by: Jens Axboe commit f65a0b1f3e79444bba9ac56435eeb32db85ab2c9 Author: Benjamin Tissoires Date: Thu Dec 2 10:53:34 2021 +0100 HID: do not inline some hid_hw_ functions We don't gain much by having them as inline, and it actually prevents us to attach a probe to those helpers. Signed-off-by: Benjamin Tissoires Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20211202095334.14399-5-benjamin.tissoires@redhat.com commit 9e3562080950b6e3fe38a5e34ddd5b1c618f2019 Author: Benjamin Tissoires Date: Thu Dec 2 10:53:33 2021 +0100 HID: add suspend/resume helpers There is a lot of duplication of code in the HID low level drivers. Better have everything in one place so we can eventually extend it in a generic way. Signed-off-by: Benjamin Tissoires Reviewed-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20211202095334.14399-4-benjamin.tissoires@redhat.com commit 36d7d36fcf69e7f95068307f8bc519af31085431 Author: Li Zhijian Date: Thu Dec 2 10:29:53 2021 +0800 selftests: net: remove meaningless help option $ ./fcnal-test.sh -t help Test names: help Looks it intent to list the available tests but it didn't do the right thing. I will add another option the do that in the later patch. Signed-off-by: Li Zhijian Signed-off-by: David S. Miller commit d9e56d1839fa40dbaab640ec205390826bddf8ae Author: Xu Wang Date: Thu Dec 2 07:55:35 2021 +0000 mctp: Remove redundant if statements The 'if (dev)' statement already move into dev_{put , hold}, so remove redundant if statements. Signed-off-by: Xu Wang Signed-off-by: David S. Miller commit 98fa41d627604e58c3e486d910ada04d90e67d33 Author: Xu Wang Date: Thu Dec 2 07:51:48 2021 +0000 net: openvswitch: Remove redundant if statements The 'if (dev)' statement already move into dev_{put , hold}, so remove redundant if statements. Signed-off-by: Xu Wang Signed-off-by: David S. Miller commit 0c4789460e8cc6a84f10a06ba9410a31432550e1 Author: Xu Wang Date: Thu Dec 2 07:53:59 2021 +0000 ipvlan: Remove redundant if statements The 'if (dev)' statement already move into dev_{put , hold}, so remove redundant if statements. Signed-off-by: Xu Wang Signed-off-by: David S. Miller commit 0695ad92fe1a0bb7697eb92c6a145a73c5ab0e24 Author: Lucas Tanure Date: Wed Dec 1 18:00:04 2021 +0000 ASoC: cs35l41: Fix undefined reference to core functions Auto select core driver if i2c or spi bus drivers are selected Fixes: a5e0091d62ab ("ASoC: cs35l41: Fix link problem") Signed-off-by: Lucas Tanure Reported-by: kernel test robot Link: https://lore.kernel.org/r/20211201180004.1402156-2-tanureal@opensource.cirrus.com Signed-off-by: Mark Brown commit 19a628d8f1a6c16263d8037a918427207c8a95a0 Author: Lucas Tanure Date: Wed Dec 1 18:00:03 2021 +0000 ASoC: amd: Fix dependency for SPI master Set SPI_MASTER as dependency as is using CS35L41 SPI driver Fixes: 96792fdd77cd1 ("ASoC: amd: enable vangogh platform machine driver build") Signed-off-by: Lucas Tanure Reported-by: kernel test robot Link: https://lore.kernel.org/r/20211201180004.1402156-1-tanureal@opensource.cirrus.com Signed-off-by: Mark Brown commit e3dd4424c2f40aae9080667c4da42b0d7f9be711 Author: Oder Chiou Date: Wed Dec 1 17:56:29 2021 +0800 ASoC: rt5640: Fix the wrong state of the JD in the HDA header The patch fixes the wrong state of the JD with 1M pull up resistor in the HDA header. Signed-off-by: Oder Chiou Link: https://lore.kernel.org/r/20211201095629.21818-1-oder_chiou@realtek.com Signed-off-by: Mark Brown commit 0e959b4e993b095641f405972bc56d8aa72eadb6 Author: Vidya Srinivas Date: Thu Dec 2 16:38:36 2021 +0530 drm/i915: Add PLANE_CUS_CTL restriction in max_width PLANE_CUS_CTL has a restriction of 4096 width even though PLANE_SIZE and scaler size registers supports max 5120. Take care of this restriction in max_width. Without this patch, when 5k content is sent on HDR plane with NV12 content, FIFO underrun is seen and screen blanks out. v2: Addressed review comments from Ville. Added separate functions for max_width - for HDR and SDR v3: Addressed review comments from Ville. Changed names of HDR and SDR max_width functions to icl_hdr_plane_max_width and icl_sdr_plane_max_width v4: Fixed paranthesis alignment. No code change Reviewed-by: Ville Syrjälä Signed-off-by: Vidya Srinivas [vsyrjala: Fix alignment] Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211202110836.17536-1-vidya.srinivas@intel.com commit 72baffdd26fb4e5b3c7215728e98e2681a9ebc4f Author: Hector Martin Date: Wed Nov 24 15:15:41 2021 +0900 dt-bindings: interrupt-controller: apple,aic: Add power-domains property This will bind to the PMGR pwrstate nodes that control power/clock gating to SoC blocks. The AIC driver doesn't do runtime-pm and likely never will (since it is system-critical), but it makes sense to describe the power domain relationship the devicetree properly. Acked-by: Rob Herring Signed-off-by: Hector Martin commit 1ed162b56baae221da049ba8641ddd4fca33c0b9 Author: Hector Martin Date: Wed Nov 24 15:14:12 2021 +0900 dt-bindings: pinctrl: apple,pinctrl: Add power-domains property This will bind to the PMGR pwrstate nodes that control power/clock gating to SoC blocks. The pinctrl driver doesn't do runtime-pm yet, so initially this will just keep the domain on permanently. Acked-by: Rob Herring Signed-off-by: Hector Martin commit 364609125e2ca745c698ec157615ff179b239344 Author: Hector Martin Date: Wed Nov 24 15:13:15 2021 +0900 dt-bindings: iommu: apple,dart: Add power-domains property This will bind to the PMGR pwrstate nodes that control power/clock gating to SoC blocks. The DART driver doesn't do runtime-pm yet, so initially this will just keep the domain on permanently. Acked-by: Rob Herring Signed-off-by: Hector Martin commit 6f8260557d490364c2b49872127c379de9b141ac Author: Hector Martin Date: Wed Nov 24 15:12:03 2021 +0900 dt-bindings: i2c: apple,i2c: Add power-domains property This will bind to the PMGR pwrstate nodes that control power/clock gating to SoC blocks. The i2c driver doesn't do runtime-pm yet, so initially this will just keep the domain on permanently. Acked-by: Rob Herring Signed-off-by: Hector Martin commit cc9cf69eea4847c8d6db6114b0e094fb51736c33 Author: Horatiu Vultur Date: Thu Dec 2 09:15:11 2021 +0100 net: lan966x: Fix builds for lan966x driver The lan966x is using the function 'packing' to create/extract the information for the IFH, that is used to be added in front of the frames when they are injected/extracted. Therefore update the Kconfig to select config option 'PACKING' whenever lan966x driver is enabled. Fixes: db8bcaad539314 ("net: lan966x: add the basic lan966x driver") Reported-by: kernel test robot Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit a72d45e646547d4ec59ee16f122c2764eb36bf05 Author: Horatiu Vultur Date: Thu Dec 2 12:05:04 2021 +0100 dt-bindings: net: lan966x: Add additional properties for lan966x This patch updates the dt-bindings for lan966x switch. It adds the properties 'additionalProperties' and 'unevaluatedProperties' for ethernet-ports and ports nodes. In this way it is not possible to add more properties to these nodes. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 7e9979e360075ef5db77e77d1e8ab3efbcba6eef Author: Prabhakar Kushwaha Date: Thu Dec 2 10:41:56 2021 +0000 qed: Enhance rammod debug prints to provide pretty details Instead of printing numbers of protocol IDs and rammod commands, enhance debug prints to provide names. s_protocol_types[] and s_ramrod_cmd_ids arrays[] are added to support along with APIs. Signed-off-by: Ariel Elior Signed-off-by: Alok Prasad Signed-off-by: Prabhakar Kushwaha Signed-off-by: David S. Miller commit a290cf692779ccce6dbb05398fad32d035bfd313 Author: Horatiu Vultur Date: Wed Dec 1 15:53:51 2021 +0100 net: lan966x: Fix duplicate check in frame extraction The blamed commit generates the following smatch static checker warning: drivers/net/ethernet/microchip/lan966x/lan966x_main.c:515 lan966x_xtr_irq_handler() warn: duplicate check 'sz < 0' (previous on line 502) This patch fixes this issue removing the duplicate check 'sz < 0' Fixes: d28d6d2e37d10d ("net: lan966x: add port module support") Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit dfb40cba6d4500f8196b2df66c29c54f5c17af2b Author: Ansuel Smith Date: Tue Nov 30 22:16:25 2021 +0100 dt-bindings: net: dsa: qca8k: improve port definition documentation Clean and improve port definition for qca8k documentation by referencing the dsa generic port definition and adding the additional specific port definition. Signed-off-by: Ansuel Smith Reviewed-by: Rob Herring Signed-off-by: David S. Miller commit 75c9901544792b88d09094f4c6cbdc61ef16e955 Author: Ansuel Smith Date: Tue Nov 30 22:16:24 2021 +0100 dt-bindings: net: dsa: split generic port definition from dsa.yaml Some switch may require to add additional binding to the node port. Move DSA generic port definition to a dedicated yaml to permit this. Signed-off-by: Ansuel Smith Reviewed-by: Rob Herring Signed-off-by: David S. Miller commit a602f5111fdd3d8a8ea2ac9e61f1c047d9794062 Author: Fabrizio Bertocci Date: Mon Nov 29 23:15:40 2021 -0500 platform/x86: amd-pmc: Fix s2idle failures on certain AMD laptops On some AMD hardware laptops, the system fails communicating with the PMC when entering s2idle and the machine is battery powered. Hardware description: HP Pavilion Aero Laptop 13-be0097nr CPU: AMD Ryzen 7 5800U with Radeon Graphics GPU: 03:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Device [1002:1638] (rev c1) Detailed description of the problem (and investigation) here: https://gitlab.freedesktop.org/drm/amd/-/issues/1799 Patch is a single line: reduce the polling delay in half, from 100uSec to 50uSec when waiting for a change in state from the PMC after a write command operation. After changing the delay, I did not see a single failure on this machine (I have this fix for now more than one week and s2idle worked every single time on battery power). Cc: stable@vger.kernel.org Acked-by: Shyam Sundar S K Signed-off-by: Fabrizio Bertocci Link: https://lore.kernel.org/r/CADtzkx7TdfbwtaVEXUdD6YXPey52E-nZVQNs+Z41DTx7gqMqtw@mail.gmail.com Signed-off-by: Hans de Goede commit a274cd66bc6461b45a450cd3f5653473a9aaea75 Author: Hans de Goede Date: Wed Nov 24 18:51:25 2021 +0100 platform/x86: touchscreen_dmi: Add TrekStor SurfTab duo W1 touchscreen info The TrekStor SurfTab duo W1 (ST10432-10b) has a Goodix touchscreen which has its x-axis mirrored. Add a quirk to fix this. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211124175125.250329-1-hdegoede@redhat.com commit 60a076ea8a6d4e5216d5232d8bc98164c7bc1ffd Author: Matan Ziv-Av Date: Tue Nov 23 22:14:55 2021 +0200 platform/x86: lg-laptop: Recognize more models LG uses 5 instead of 0 in the third digit (second digit after 2019) of the year string to indicate newer models in the same year. Handle this case as well. Signed-off-by: Matan Ziv-Av Link: https://lore.kernel.org/r/c752b3b2-9718-bd9a-732d-e165aa8a1fca@svgalib.org Signed-off-by: Hans de Goede commit 37f34df84ac76703536e5bec0b209f1e82a8a0cd Author: Yang Li Date: Wed Nov 24 10:02:12 2021 +0800 platform/x86: asus-wmi: remove unneeded semicolon Eliminate the following coccicheck warning: ./drivers/platform/x86/asus-wmi.c:2386:2-3: Unneeded semicolon Reported-by: Abaci Robot Signed-off-by: Yang Li Link: https://lore.kernel.org/r/1637719332-45224-1-git-send-email-yang.lee@linux.alibaba.com Signed-off-by: Hans de Goede commit e1dbdd2f4a5247f579c930fe514de3cf0cc58e81 Author: Hans de Goede Date: Tue Nov 23 22:05:24 2021 +0100 platform/x86: thinkpad_acpi: Add lid_logo_dot to the list of safe LEDs There have been various bugs / forum threads about allowing control of the LED in the ThinkPad logo on the lid of various models. This seems to be something which users want to control and there really is no reason to require setting CONFIG_THINKPAD_ACPI_UNSAFE_LEDS for this. The lid-logo-dot is LED number 10, so change the name of the 10th led from unknown_led2 to lid_logo_dot and add it to the TPACPI_SAFE_LEDS mask. Link: https://www.reddit.com/r/thinkpad/comments/7n8eyu/thinkpad_led_control_under_gnulinux/ BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1943318 Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211123210524.266705-2-hdegoede@redhat.com commit e518704d634fe3205903da6cbe97debf34885812 Author: Hans de Goede Date: Tue Nov 23 22:05:23 2021 +0100 platform/x86: thinkpad_acpi: Add LED_RETAIN_AT_SHUTDOWN to led_class_devs Add the LED_RETAIN_AT_SHUTDOWN flag to the registered led_class_devs so that the LEDs do not get turned-off when reloading the driver and thus so that they also stay under default EC control when reloading the driver, unless explicitly overridden by the user. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211123210524.266705-1-hdegoede@redhat.com commit 20626177c9de726c48802c15e8635cc154645588 Author: Nicholas Piggin Date: Thu Dec 2 00:41:47 2021 +1000 powerpc: make memremap_compat_align 64s-only memremap_compat_align is only relevant when ZONE_DEVICE is selected. ZONE_DEVICE depends on ARCH_HAS_PTE_DEVMAP, which is only selected by PPC_BOOK3S_64. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211201144153.2456614-13-npiggin@gmail.com commit ffbe5d21d10f9c7890c07fca17db772f941385bf Author: Nicholas Piggin Date: Thu Dec 2 00:41:46 2021 +1000 powerpc/64: pcpu setup avoid reading mmu_linear_psize on 64e or radix Radix never sets mmu_linear_psize so it's always 4K, which causes pcpu atom_size to always be PAGE_SIZE. 64e sets it to 1GB always. Make paths for these platforms to be explicit about what value they set atom_size to. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211201144153.2456614-12-npiggin@gmail.com commit f43d2ffb47c9e86f5ec24e1de6ce6da6808634a2 Author: Nicholas Piggin Date: Thu Dec 2 00:41:45 2021 +1000 powerpc/64s: Rename hash_hugetlbpage.c to hugetlbpage.c This file contains functions and data common to radix, so rename it to remove the hash_ prefix. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211201144153.2456614-11-npiggin@gmail.com commit bdad5d57dfcc6d2b2f8d0bc9d7e85ee794d1d50e Author: Nicholas Piggin Date: Thu Dec 2 00:41:44 2021 +1000 powerpc/64s: move page size definitions from hash specific file The radix code uses some of the psize variables. Move the common ones from hash_utils.c to pgtable.c. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211201144153.2456614-10-npiggin@gmail.com commit 310dce6201fd27fda484e34bf543fb55c33d80b1 Author: Nicholas Piggin Date: Thu Dec 2 00:41:43 2021 +1000 powerpc/64s: Make flush_and_reload_slb a no-op when radix is enabled The radix test can exclude slb_flush_all_realmode() from being called because flush_and_reload_slb() is only expected to flush ERAT when called by flush_erat(), which is only on pre-ISA v3.0 CPUs that do not support radix. This helps the later change to make hash support configurable to not introduce runtime changes to radix mode behaviour. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211201144153.2456614-9-npiggin@gmail.com commit 162b0889bba6e721c33d12e15971618785ca778e Author: Nicholas Piggin Date: Thu Dec 2 00:41:42 2021 +1000 powerpc/64s: move THP trace point creation out of hash specific file In preparation for making hash MMU support configurable, move THP trace point function definitions out of an otherwise hash-specific file. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211201144153.2456614-8-npiggin@gmail.com commit 3d3282fd34d82caac5005d9c4d4525054eb3cac1 Author: Nicholas Piggin Date: Thu Dec 2 00:41:41 2021 +1000 powerpc/pseries: lparcfg don't include slb_size line in radix mode This avoids a change in behaviour in the later patch making hash support configurable. This is possibly a user interface change, so the alternative would be a hard-coded slb_size=0 here. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211201144153.2456614-7-npiggin@gmail.com commit 0c7cc15e92157c8886c8df3151eac2c43c3dfa2b Author: Nicholas Piggin Date: Thu Dec 2 00:41:40 2021 +1000 powerpc/pseries: move process table registration away from hash-specific code This reduces ifdefs in a later change which makes hash support configurable. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211201144153.2456614-6-npiggin@gmail.com commit 935b534c24f014325b72a3619bbbdc18191f9c3d Author: Nicholas Piggin Date: Thu Dec 2 00:41:39 2021 +1000 powerpc/64s: Move and rename do_bad_slb_fault as it is not hash specific slb.c is hash-specific SLB management, but do_bad_slb_fault deals with segment interrupts that occur with radix MMU as well. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211201144153.2456614-5-npiggin@gmail.com commit a4135cbebde8375e2a9d91261b4546ce3f3b9b0f Author: Nicholas Piggin Date: Thu Dec 2 00:41:38 2021 +1000 powerpc/pseries: Stop selecting PPC_HASH_MMU_NATIVE The pseries platform does not use the native hash code but the PAPR virtualised hash interfaces, so remove PPC_HASH_MMU_NATIVE. This requires moving tlbiel code from hash_native.c to hash_utils.c. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211201144153.2456614-4-npiggin@gmail.com commit 7ebc49031d0418dc9ca8475b8133a3a161221ef5 Author: Nicholas Piggin Date: Thu Dec 2 00:41:37 2021 +1000 powerpc: Rename PPC_NATIVE to PPC_HASH_MMU_NATIVE PPC_NATIVE now only controls the native HPT code, so rename it to be more descriptive. Restrict it to Book3S only. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211201144153.2456614-3-npiggin@gmail.com commit 79b74a68486765a4fe685ac4069bc71366c538f5 Author: Nicholas Piggin Date: Thu Dec 2 00:41:36 2021 +1000 powerpc: Remove unused FW_FEATURE_NATIVE references FW_FEATURE_NATIVE_ALWAYS and FW_FEATURE_NATIVE_POSSIBLE are always zero and never do anything. Remove them. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211201144153.2456614-2-npiggin@gmail.com commit 792020907b11c6f9246c21977cab3bad985ae4b6 Author: Alexey Kardashevskiy Date: Wed Sep 1 18:45:50 2021 +1000 KVM: PPC: Book3S: Suppress failed alloc warning in H_COPY_TOFROM_GUEST H_COPY_TOFROM_GUEST is an hcall for an upper level VM to access its nested VMs memory. The userspace can trigger WARN_ON_ONCE(!(gfp & __GFP_NOWARN)) in __alloc_pages() by constructing a tiny VM which only does H_COPY_TOFROM_GUEST with a too big GPR9 (number of bytes to copy). This silences the warning by adding __GFP_NOWARN. Spotted by syzkaller. Signed-off-by: Alexey Kardashevskiy Reviewed-by: Fabiano Rosas Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210901084550.1658699-1-aik@ozlabs.ru commit 511d25d6b789fffcb20a3eb71899cf974a31bd9d Author: Alexey Kardashevskiy Date: Wed Sep 1 18:45:12 2021 +1000 KVM: PPC: Book3S: Suppress warnings when allocating too big memory slots The userspace can trigger "vmalloc size %lu allocation failure: exceeds total pages" via the KVM_SET_USER_MEMORY_REGION ioctl. This silences the warning by checking the limit before calling vzalloc() and returns ENOMEM if failed. This does not call underlying valloc helpers as __vmalloc_node() is only exported when CONFIG_TEST_VMALLOC_MODULE and __vmalloc_node_range() is not exported at all. Spotted by syzkaller. Signed-off-by: Alexey Kardashevskiy [mpe: Use 'size' for the variable rather than 'cb'] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210901084512.1658628-1-aik@ozlabs.ru commit b061d14fc1ec0997d8c875f30e56555cf084d7ba Merge: ce8299b6f76f2 1b33341e3dc09 Author: David S. Miller Date: Thu Dec 2 11:53:43 2021 +0000 Merge branch 'hns3-cleanups' Guangbin Huang says: ==================== net: hns3: some cleanups for -next To improve code readability and simplicity, this series add 9 cleanup patches for the HNS3 ethernet driver. ==================== Signed-off-by: David S. Miller commit 1b33341e3dc09dd356897b351e9b3c008cb1a69e Author: Jie Wang Date: Thu Dec 2 16:36:03 2021 +0800 net: hns3: refactor function hns3_get_vector_ring_chain() Currently hns3_get_vector_ring_chain() is a bit long. Refactor it by extracting sub process to improve the readability. Signed-off-by: Jie Wang Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 358e3edb31d5f49a39be25e8059c96b99cf101a6 Author: Jie Wang Date: Thu Dec 2 16:36:02 2021 +0800 net: hns3: refactor function hclge_set_channels() Currently hclge_set_channels() is a bit long. Refactor it by extracting sub process to improve the readability. Signed-off-by: Jie Wang Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 673b35b6a5bfd8e1adf122e3fdbb343c31c609d2 Author: Jie Wang Date: Thu Dec 2 16:36:01 2021 +0800 net: hns3: refactor function hclge_configure() Currently hclge_configure() is a bit long. Refactor it by extracting sub process to improve the readability. Signed-off-by: Jie Wang Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit d25f5eddbe1ace18fa95318fd229b07a64ec4353 Author: Jian Shen Date: Thu Dec 2 16:36:00 2021 +0800 net: hns3: split function hclge_update_port_base_vlan_cfg() Currently the function hclge_update_port_base_vlan_cfg() is a bit long. Split it to several small functions, to improve the readability. Signed-off-by: Jian Shen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 8d4b409bac5710cbf51c97c5d74e956476cd4de0 Author: Yufeng Mo Date: Thu Dec 2 16:35:59 2021 +0800 net: hns3: split function hns3_nic_net_xmit() Function hns3_nic_net_xmit() is a bit too long. So add a new function hns3_handle_skb_desc() to simplify code and improve code readability. Signed-off-by: Yufeng Mo Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit a41fb3961d8df745adac5374d87a6c2398057364 Author: Jian Shen Date: Thu Dec 2 16:35:58 2021 +0800 net: hns3: split function hclge_get_fd_rule_info() Currently the function hclge_get_fd_rule_info() is a bit long. Split it to several small functions, to improve readability. Signed-off-by: Jian Shen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit b60f9d2ec479966383c7f2cdf3b1a3a66c25f212 Author: Jian Shen Date: Thu Dec 2 16:35:57 2021 +0800 net: hns3: split function hclge_init_vlan_config() Currently the function hclge_init_vlan_config() is a bit long. Split it to several small functions, to simplify code and improve code readability. Signed-off-by: Jian Shen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit a1cfb24d011a39ab65bb154dd85d9f879c6e5e4d Author: Peng Li Date: Thu Dec 2 16:35:56 2021 +0800 net: hns3: refactor function hns3_fill_skb_desc to simplify code The function hns3_fill_skb_desc is hard to read, this patch extract 2 functions and add new a struct data to simplify the code and Improve readability. Signed-off-by: Peng Li Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit e6d72f6ac2ad4965491354d74b48e35a60abf298 Author: Peng Li Date: Thu Dec 2 16:35:55 2021 +0800 net: hns3: extract macro to simplify ring stats update code As the code to update ring stats is alike for different ring stats type, this patch extract macro to simplify ring stats update code. Signed-off-by: Peng Li Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit f35ed346ef5bb8e5e89802c4dbc8b311693e39f7 Author: Jani Nikula Date: Wed Dec 1 15:57:06 2021 +0200 drm/i915/display: remove intel_wait_for_vblank() There are only three call sites remaining for intel_wait_for_vblank(). Remove the function, and open code it to avoid new users from showing up. v2: - Use intel_crtc_wait_for_next_vblank() (Ville) Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/aabcda1208072a732d7796e6dacce37dca9bb843.1638366969.git.jani.nikula@intel.com commit f2bc4517310c37cfeca606079fbfdd025d35c4fa Author: Jani Nikula Date: Wed Dec 1 15:57:05 2021 +0200 drm/i915/crtc: rename intel_get_crtc_for_plane() to intel_crtc_for_plane() The "get" in the name implies reference counting, remove it. This also makes the function conform to naming style. Suggested-by: Ville Syrjälä Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/50359b38c0eabe262ff31c9ec35c97aa5dfb7fef.1638366969.git.jani.nikula@intel.com commit 7794b6deb12176112cf6050dd8507cf216e801b9 Author: Jani Nikula Date: Wed Dec 1 15:57:04 2021 +0200 drm/i915/crtc: rename intel_get_crtc_for_pipe() to intel_crtc_for_pipe() The "get" in the name implies reference counting, remove it. This also makes the function conform to naming style. Suggested-by: Ville Syrjälä Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/6105d0ff44efac3c999af6382e4b0729e251f1e1.1638366969.git.jani.nikula@intel.com commit 4ff22f487f8c26b99cbe1678344595734c001a39 Author: Thomas Zimmermann Date: Tue Nov 30 10:52:55 2021 +0100 drm: Return error codes from struct drm_driver.gem_create_object GEM helper libraries use struct drm_driver.gem_create_object to let drivers override GEM object allocation. On failure, the call returns NULL. Change the semantics to make the calls return a pointer-encoded error. This aligns the callback with its callers. Fixes the ingenic driver, which already returns an error pointer. Also update the callers to handle the involved types more strictly. Signed-off-by: Thomas Zimmermann Reviewed-by: Steven Price Acked-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20211130095255.26710-1-tzimmermann@suse.de commit 3de89d8842a2b5d3dd22ebf97dd561ae0a330948 Author: Paul Gerber Date: Mon Nov 22 12:42:25 2021 +0100 thermal/drivers/imx8mm: Enable ADC when enabling monitor The i.MX 8MP has a ADC_PD bit in the TMU_TER register that controls the operating mode of the ADC: * 0 means normal operating mode * 1 means power down mode When enabling/disabling the TMU, the ADC operating mode must be set accordingly. i.MX 8M Mini & Nano are lacking this bit. Signed-off-by: Paul Gerber Signed-off-by: Alexander Stein Fixes: 2b8f1f0337c5 ("thermal: imx8mm: Add i.MX8MP support") Link: https://lore.kernel.org/r/20211122114225.196280-1-alexander.stein@ew.tq-group.com Signed-off-by: Daniel Lezcano commit fdbbe242c15a8f2cd0e3ad8a56cd0a447b771d0d Author: Pali Rohár Date: Tue Nov 30 18:29:13 2021 +0100 PCI: aardvark: Disable common PHY when unbinding driver Disable the PCIe PHY when unbinding driver. This should save some power. Link: https://lore.kernel.org/r/20211130172913.9727-12-kabel@kernel.org Signed-off-by: Pali Rohár Signed-off-by: Marek Behún Signed-off-by: Lorenzo Pieralisi commit 759dec2e3dfdbd261c41d2279f04f2351c971a49 Author: Pali Rohár Date: Tue Nov 30 18:29:12 2021 +0100 PCI: aardvark: Disable link training when unbinding driver Disable link training circuit in driver unbind sequence. We want to leave link training in the same state as it was before the driver was probed. Link: https://lore.kernel.org/r/20211130172913.9727-11-kabel@kernel.org Signed-off-by: Pali Rohár Signed-off-by: Marek Behún Signed-off-by: Lorenzo Pieralisi commit 1f54391be8ce0c981d312cb93acdc5608def576a Author: Pali Rohár Date: Tue Nov 30 18:29:11 2021 +0100 PCI: aardvark: Assert PERST# when unbinding driver Put the PCIe card into reset by asserting PERST# signal when unbinding driver. It doesn't make sense to leave the card working if it can't communicate with the host. This should also save some power. Link: https://lore.kernel.org/r/20211130172913.9727-10-kabel@kernel.org Signed-off-by: Pali Rohár Signed-off-by: Marek Behún Signed-off-by: Lorenzo Pieralisi commit 2f040a17f5061457ae95035326d3159eddc1e5cc Author: Pali Rohár Date: Tue Nov 30 18:29:10 2021 +0100 PCI: aardvark: Fix memory leak in driver unbind Free config space for emulated root bridge when unbinding driver to fix memory leak. Do it after disabling and masking all interrupts, since aardvark interrupt handler accesses config space of emulated root bridge. Link: https://lore.kernel.org/r/20211130172913.9727-9-kabel@kernel.org Signed-off-by: Pali Rohár Signed-off-by: Marek Behún Signed-off-by: Lorenzo Pieralisi commit 13bcdf07cb2ecff5d45d2c141df2539b15211448 Author: Pali Rohár Date: Tue Nov 30 18:29:09 2021 +0100 PCI: aardvark: Mask all interrupts when unbinding driver Ensure that no interrupt can be triggered after driver unbind. Link: https://lore.kernel.org/r/20211130172913.9727-8-kabel@kernel.org Signed-off-by: Pali Rohár Signed-off-by: Marek Behún Signed-off-by: Lorenzo Pieralisi commit a46f2f6dd4093438d9615dfbf5c0fea2a9835dba Author: Pali Rohár Date: Tue Nov 30 18:29:08 2021 +0100 PCI: aardvark: Disable bus mastering when unbinding driver Ensure that after driver unbind PCIe cards are not able to forward memory and I/O requests in the upstream direction. Link: https://lore.kernel.org/r/20211130172913.9727-7-kabel@kernel.org Signed-off-by: Pali Rohár Signed-off-by: Marek Behún Signed-off-by: Lorenzo Pieralisi commit a4ca7948e1d47275f8f3e5023243440c40561916 Author: Pali Rohár Date: Tue Nov 30 18:29:07 2021 +0100 PCI: aardvark: Comment actions in driver remove method Add two more comments into the advk_pcie_remove() method. Link: https://lore.kernel.org/r/20211130172913.9727-6-kabel@kernel.org Signed-off-by: Pali Rohár Signed-off-by: Marek Behún Signed-off-by: Lorenzo Pieralisi commit 7d8dc1f7cd007a7ce94c5b4c20d63a8b8d6d7751 Author: Pali Rohár Date: Tue Nov 30 18:29:06 2021 +0100 PCI: aardvark: Clear all MSIs at setup We already clear all the other interrupts (ISR0, ISR1, HOST_CTRL_INT). Define a new macro PCIE_MSI_ALL_MASK and do the same clearing for MSIs, to ensure that we don't start receiving spurious interrupts. Use this new mask in advk_pcie_handle_msi(); Link: https://lore.kernel.org/r/20211130172913.9727-5-kabel@kernel.org Signed-off-by: Pali Rohár Signed-off-by: Marek Behún Signed-off-by: Lorenzo Pieralisi commit 1d3e170344dff2cef8827db6c09909b78cbc11d7 Author: Pali Rohár Date: Tue Nov 30 18:29:05 2021 +0100 PCI: aardvark: Add support for DEVCAP2, DEVCTL2, LNKCAP2 and LNKCTL2 registers on emulated bridge PCI aardvark hardware supports access to DEVCAP2, DEVCTL2, LNKCAP2 and LNKCTL2 configuration registers of PCIe core via PCIE_CORE_PCIEXP_CAP. Export them via emulated software root bridge. Link: https://lore.kernel.org/r/20211130172913.9727-4-kabel@kernel.org Signed-off-by: Pali Rohár Signed-off-by: Marek Behún Signed-off-by: Lorenzo Pieralisi commit 8ea673a8b30b4a32516b8adabb15e2a68ff02ec8 Author: Pali Rohár Date: Tue Nov 30 18:29:04 2021 +0100 PCI: pci-bridge-emul: Add definitions for missing capabilities registers pci-bridge-emul driver already allocates buffer for capabilities up to the PCI_EXP_SLTSTA2 register, but does not define bit access behavior for these registers. Add these missing definitions. Link: https://lore.kernel.org/r/20211130172913.9727-3-kabel@kernel.org Signed-off-by: Pali Rohár Signed-off-by: Marek Behún Signed-off-by: Lorenzo Pieralisi commit 9319230ac147067652b58fe849ffe0ceec098665 Author: Pali Rohár Date: Tue Nov 30 18:29:03 2021 +0100 PCI: pci-bridge-emul: Add description for class_revision field The current assignment to the class_revision member class_revision |= cpu_to_le32(PCI_CLASS_BRIDGE_PCI << 16); can make the reader think that class is at high 16 bits of the member and revision at low 16 bits. In reality, class is at high 24 bits, but the class for PCI Bridge Normal Decode is PCI_CLASS_BRIDGE_PCI << 8. Change the assignment and add a comment to make this clearer. Link: https://lore.kernel.org/r/20211130172913.9727-2-kabel@kernel.org Signed-off-by: Pali Rohár Signed-off-by: Marek Behún Signed-off-by: Lorenzo Pieralisi commit 6e5ebc96ec651b67131f816d7e3bf286c635e749 Author: Tim Harvey Date: Mon Nov 1 11:02:43 2021 -0700 PCI: dwc: Do not remap invalid res On imx6 and perhaps others when pcie probes you get a: imx6q-pcie 33800000.pcie: invalid resource This occurs because the atu is not specified in the DT and as such it should not be remapped. Link: https://lore.kernel.org/r/20211101180243.23761-1-tharvey@gateworks.com Fixes: 281f1f99cf3a ("PCI: dwc: Detect number of iATU windows") Signed-off-by: Tim Harvey Signed-off-by: Lorenzo Pieralisi Reviewed-by: Rob Herring Acked-by: Richard Zhu Cc: Richard Zhu commit 7b06894b9b902f540b23e5c235570b224d63ec5e Author: Jani Nikula Date: Wed Dec 1 15:57:03 2021 +0200 drm/i915/display: add intel_crtc_wait_for_next_vblank() and use it intel_wait_for_vblank() goes through a pipe to crtc lookup, while in most cases we already have the crtc available. Avoid the extra lookups by adding an intel_crtc based helper. v2: - Add intel_crtc_wait_for_next_vblank() helper (Ville) Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/90cfbd8c3e79a742b0ee9e3ae75493acb0785dbb.1638366969.git.jani.nikula@intel.com commit 1e583aef12aa74afd37c1418255cc4b74e023236 Author: Takashi Iwai Date: Thu Dec 2 09:38:33 2021 +0100 ALSA: usb-audio: Drop superfluous '0' in Presonus Studio 1810c's ID The vendor ID of Presonus Studio 1810c had a superfluous '0' in its USB ID. Drop it. Fixes: 8dc5efe3d17c ("ALSA: usb-audio: Add support for Presonus Studio 1810c") Link: https://lore.kernel.org/r/20211202083833.17784-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 4dc0759c563a9aa3aa09c316a066d265f3930887 Author: Nathan Chancellor Date: Mon Nov 29 09:58:03 2021 -0700 init/Kconfig: Drop linker version check for LD_ORPHAN_WARN The minimum supported version of LLVM has been raised to 11.0.0, meaning this check is always true, so it can be dropped. Signed-off-by: Nathan Chancellor Reviewed-by: Miguel Ojeda Reviewed-by: Mark Brown Reviewed-by: Nick Desaulniers Reviewed-by: Kees Cook Signed-off-by: Masahiro Yamada commit 0766bffcae0706baddea6aa3f85b43031ede0e0d Author: Nathan Chancellor Date: Mon Nov 29 09:58:02 2021 -0700 gcov: Remove compiler version check The minimum supported version of LLVM has been raised to 11.0.0, meaning this check is always true, so it can be dropped. Signed-off-by: Nathan Chancellor Reviewed-by: Miguel Ojeda Reviewed-by: Mark Brown Reviewed-by: Nick Desaulniers Reviewed-by: Kees Cook Signed-off-by: Masahiro Yamada commit e1ab4182ca113f9a14e3aefc15cf7652b8446991 Author: Nathan Chancellor Date: Mon Nov 29 09:58:01 2021 -0700 Revert "ARM: 9070/1: Make UNWINDER_ARM depend on ld.bfd or ld.lld 11.0.0+" This reverts commit 7411cfc3c91a08a884463bbc7623087ecc2efdd8. The minimum supported version of LLVM has been raised to 11.0.0, meaning this check is always true, so it can be dropped. Signed-off-by: Nathan Chancellor Reviewed-by: Miguel Ojeda Reviewed-by: Mark Brown Reviewed-by: Nick Desaulniers Reviewed-by: Kees Cook Signed-off-by: Masahiro Yamada commit 1e68a8af9a395dba40d65a67364f287b637691ee Author: Nathan Chancellor Date: Mon Nov 29 09:58:00 2021 -0700 arch/Kconfig: Remove CLANG_VERSION check in HAS_LTO_CLANG The minimum supported version of LLVM has been raised to 11.0.0, meaning this check is always true, so it can be dropped. Signed-off-by: Nathan Chancellor Reviewed-by: Miguel Ojeda Reviewed-by: Mark Brown Reviewed-by: Nick Desaulniers Reviewed-by: Kees Cook Signed-off-by: Masahiro Yamada commit 57b2b72ac1fc5d55cf3b13207942c109f1a65cb5 Author: Nathan Chancellor Date: Mon Nov 29 09:57:59 2021 -0700 mm, slab: Remove compiler check in __kmalloc_index The minimum supported version of LLVM has been raised to 11.0.0, meaning this check is always true, so it can be dropped. Signed-off-by: Nathan Chancellor Reviewed-by: Miguel Ojeda Reviewed-by: Mark Brown Reviewed-by: Nick Desaulniers Reviewed-by: Kees Cook Signed-off-by: Masahiro Yamada commit df05c0e9496ce1e28b51f79f9fae94479a37fa60 Author: Nathan Chancellor Date: Mon Nov 29 09:57:58 2021 -0700 Documentation: Raise the minimum supported version of LLVM to 11.0.0 LLVM versions prior to 11.0.0 have a harder time with dead code elimination, which can cause issues with commonly used expressions such as BUILD_BUG_ON and the bitmask functions/macros in bitfield.h (see the first two issues links below). Whenever there is an issue within LLVM that has been resolved in a later release, the only course of action is to gate the problematic configuration or source code on the toolchain verson or raise the minimum supported version of LLVM for building the kernel, as LLVM has a limited support lifetime compared to GCC. GCC major releases will typically see a few point releases across a two year period on average whereas LLVM major releases are only supported until the next major release and will only see one or two point releases within that timeframe. For example, GCC 8.1 was released in May 2018 and GCC 8.5 was released in May 2021, whereas LLVM 12.0.0 was released in April 2021 and its only point release, 12.0.1, was released in July 2021, giving a minimal window for fixes to be backported. To resolve these build errors around improper dead code elimination, raise the minimum supported version of LLVM for building the kernel to 11.0.0. Doing so is a more proper solution than mucking around with core kernel macros that have always worked with GCC or disabling drivers for using these macros in a proper manner. This type of issue may continue to crop up and require patching, which creates more debt for bumping the minimum supported version in the future. This should have a minimal impact to distributions. Using a script to pull several different Docker images and check the output of 'clang --version': archlinux:latest: clang version 13.0.0 debian:oldoldstable-slim: clang version 3.8.1-24 (tags/RELEASE_381/final) debian:oldstable-slim: clang version 7.0.1-8+deb10u2 (tags/RELEASE_701/final) debian:stable-slim: Debian clang version 11.0.1-2 debian:testing-slim: Debian clang version 11.1.0-4 debian:unstable-slim: Debian clang version 11.1.0-4 fedora:34: clang version 12.0.1 (Fedora 12.0.1-1.fc34) fedora:latest: clang version 13.0.0 (Fedora 13.0.0-3.fc35) fedora:rawhide: clang version 13.0.0 (Fedora 13.0.0-5.fc36) opensuse/leap:15.2: clang version 9.0.1 opensuse/leap:latest: clang version 11.0.1 opensuse/tumbleweed:latest: clang version 13.0.0 ubuntu:bionic: clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final) ubuntu:latest: clang version 10.0.0-4ubuntu1 ubuntu:hirsute: Ubuntu clang version 12.0.0-3ubuntu1~21.04.2 ubuntu:rolling: Ubuntu clang version 13.0.0-2 ubuntu:devel: Ubuntu clang version 13.0.0-9 In every case, the distribution's version of clang is either older than the current minimum supported version of LLVM 10.0.1 or equal to or greater than the proposed 11.0.0 so nothing should change. Another benefit of this change is LLVM=1 works better with arm64 and x86_64 since commit f12b034afeb3 ("scripts/Makefile.clang: default to LLVM_IAS=1") enabled the integrated assembler by default, which only works well with clang 11+ (clang-10 required it to be disabled to successfully build a kernel). Link: https://github.com/ClangBuiltLinux/linux/issues/1293 Link: https://github.com/ClangBuiltLinux/linux/issues/1506 Link: https://github.com/ClangBuiltLinux/linux/issues/1511 Link: https://github.com/llvm/llvm-project/commit/fa496ce3c6774097080c8a9cb808da56f383b938 Link: https://groups.google.com/g/clang-built-linux/c/mPQb9_ZWW0s/m/W7o6S-QTBAAJ Link: https://github.com/ClangBuiltLinux/misc-scripts Signed-off-by: Nathan Chancellor Reviewed-by: Miguel Ojeda Reviewed-by: Mark Brown Reviewed-by: Nick Desaulniers Reviewed-by: Kees Cook Signed-off-by: Masahiro Yamada commit ce9778b7a0272f7c7e5bc33f537380a5d2aed6c7 Author: Kai-Heng Feng Date: Thu Dec 2 15:33:35 2021 +0800 ALSA: hda/hdmi: Consider ELD is invalid when no SAD is present There's a system that reports a bogus HDMI audio interface: $ cat eld#2.0 monitor_present 1 eld_valid 1 monitor_name connection_type DisplayPort eld_version [0x2] CEA-861D or below edid_version [0x3] CEA-861-B, C or D manufacture_id 0xe430 product_id 0x690 port_id 0x0 support_hdcp 0 support_ai 0 audio_sync_delay 0 speakers [0xffff] FL/FR LFE FC RL/RR RC FLC/FRC RLC/RRC FLW/FRW FLH/FRH TC FCH sad_count 0 Since playing audio is not possible without SAD, also consider ELD is invalid for this case. Signed-off-by: Kai-Heng Feng Link: https://lore.kernel.org/r/20211202073338.1384768-1-kai.heng.feng@canonical.com Signed-off-by: Takashi Iwai commit 0431acd87a6c1785e47eb9762904d964f7a031e9 Author: Łukasz Stelmach Date: Thu Nov 25 17:20:54 2021 +0100 streamline_config.pl: show the full Kconfig name Show the very same file name that was passed to open() in case the operation failed. Signed-off-by: Łukasz Stelmach commit c39afe624853e39af243dd9832640bf9c80b6554 Author: Josh Triplett Date: Sun Oct 17 19:43:13 2021 +0200 kconfig: Add `make mod2noconfig` to disable module options When converting a modular kernel to a monolithic kernel, once the kernel works without loading any modules, this helps to quickly disable all the modules before turning off module support entirely. Refactor conf_rewrite_mod_or_yes to a more general conf_rewrite_tristates that accepts an old and new state. Signed-off-by: Josh Triplett Tested-by: Björn Töpel Signed-off-by: Masahiro Yamada commit 17dcc120fb8d0da4e954ce4386f1376f9cef43d0 Author: Horatiu Vultur Date: Tue Nov 30 11:10:15 2021 +0100 phy: lan966x: Extend lan966x to support multiple phy interfaces. Currently the driver is supporting only the interfaces QSGMII, SGMII, RGMII and GMII. This patch extend the supported interfaces with 1000BASE-X and 2500BASE-X. Signed-off-by: Horatiu Vultur Acked-by: Russell King (Oracle) Link: https://lore.kernel.org/r/20211130101015.164916-1-horatiu.vultur@microchip.com Signed-off-by: Vinod Koul commit b2b56de9faaf19c829ede5cf56918b3793219971 Author: Zou Wei Date: Thu Nov 25 14:38:09 2021 +0800 phy: intel: Remove redundant dev_err call in thunderbay_emmc_phy_probe() There is a error message within devm_ioremap_resource already, so remove the dev_err call to avoid redundant error message. Reported-by: Hulk Robot Signed-off-by: Zou Wei Link: https://lore.kernel.org/r/1637822289-24534-1-git-send-email-zou_wei@huawei.com Signed-off-by: Vinod Koul commit ce8299b6f76f28326fedce2b4da90888bd97eab2 Author: Eric Dumazet Date: Tue Nov 30 19:32:46 2021 -0800 Revert "net: snmp: add statistics for tcp small queue check" This reverts commit aeeecb889165617a841e939117f9a8095d0e7d80. The new SNMP variable (TCPSmallQueueFailure) can be incremented for good reasons, even on a 100Gbit single TCP_STREAM flow. If we really wanted to ease driver debugging [1], this would require something more sophisticated. [1] Usually, if a driver is delaying TX completions too much, this can lead to stalls in TCP output. Various work arounds have been used in the past, like skb_orphan() in ndo_start_xmit(). Signed-off-by: Eric Dumazet Cc: Menglong Dong Link: https://lore.kernel.org/r/20211201033246.2826224-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit 0dc1df05988820a5f51621ca373988082e155e53 Author: Russell King Date: Tue Nov 30 14:54:05 2021 +0000 net: mvneta: program 1ms autonegotiation clock divisor Program the 1ms autonegotiation clock divisor according to the clocking rate of neta - without this, the 1ms clock ticks at about 660us on Armada 38x configured for 250MHz. Bring this into correct specification. Signed-off-by: Russell King Reviewed-by: Marek Behún Link: https://lore.kernel.org/r/E1ms4WD-00EKLK-Ld@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski commit aa729c439441aa5993cb592337f7ddf2454266b6 Author: Russell King Date: Tue Nov 30 14:49:41 2021 +0000 net: phylink: tidy up disable bit clearing Tidy up the disable bit clearing where we clear a bit and then run the link resolver. Signed-off-by: Russell King Reviewed-by: Marek Behún Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/E1ms4Rx-00EKEc-En@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski commit 4a8e4640ddd1e18cade9f15e40f2d8cd65f173cf Merge: 8057cbb8335cf a2279b08c7f4c Author: Jakub Kicinski Date: Wed Dec 1 18:58:03 2021 -0800 Merge branch 'net-dsa-convert-two-drivers-to-phylink_generic_validate' Russell King says: ==================== net: dsa: convert two drivers to phylink_generic_validate() Patches 1 to 3 update core DSA code to allow drivers to be converted, and patches 4 and 5 convert hellcreek and lantiq to use this (both of which received reviewed-by from their maintainers.) As the rest have yet to be reviewed by their maintainers, they are not included here. Patch 1 had a request to change the formatting of it; I have not done so as I believe a patch should do one change and one change only - reformatting it is a separate change that should be in its own patch. However, as patch 2 gets rid of the reason for reformatting it, it would be pointless, and pure noise to include such an intermediary patch. Instead, I have swapped the order of patches 2 and 3 from the RFC series. ==================== Link: https://lore.kernel.org/r/YaYiiU9nvmVugqnJ@shell.armlinux.org.uk Signed-off-by: Jakub Kicinski commit a2279b08c7f4c97ad93916dae5c02eeac34b7f2c Author: Russell King (Oracle) Date: Tue Nov 30 13:10:16 2021 +0000 net: dsa: lantiq: convert to phylink_generic_validate() Populate the supported interfaces and MAC capabilities for the Lantiq DSA switches and remove the old validate implementation to allow DSA to use phylink_generic_validate() for this switch driver. The exclusion of Gigabit linkmodes for MII, Reverse MII and Reduced MII links is handled within phylink_generic_validate() in phylink, so there is no need to make them conditional on the interface mode in the driver. Reviewed-by: Hauke Mehrtens Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit 1c9e7fd2a579c7c3288264f6e90b9c0a3388dbf9 Author: Russell King (Oracle) Date: Tue Nov 30 13:10:11 2021 +0000 net: dsa: hellcreek: convert to phylink_generic_validate() Populate the supported interfaces and MAC capabilities for the hellcreek DSA switch and remove the old validate implementation to allow DSA to use phylink_generic_validate() for this switch driver. The switch actually only supports MII and RGMII, but as phylib defaults to GMII, we need to include this interface mode to keep existing DT working. Reviewed-by: Kurt Kanzenbach Tested-by: Kurt Kanzenbach Signed-off-by: Russell King (Oracle) Signed-off-by: Jakub Kicinski commit 5938bce4b6e2146d5194badd7ecf0acc6bf877fc Author: Russell King (Oracle) Date: Tue Nov 30 13:10:06 2021 +0000 net: dsa: support use of phylink_generic_validate() Support the use of phylink_generic_validate() when there is no phylink_validate method given in the DSA switch operations and mac_capabilities have been set in the phylink_config structure by the DSA switch driver. This gives DSA switch drivers the option to use this if they provide the supported_interfaces and mac_capabilities, while still giving them an option to override the default implementation if necessary. Reviewed-by: Vladimir Oltean Signed-off-by: Russell King (Oracle) Reviewed-by: Marek Behún Reviewed-by: Andrew Lunn Signed-off-by: Jakub Kicinski commit 072eea6c22b2af680c3949e64f9adde278c71e68 Author: Russell King (Oracle) Date: Tue Nov 30 13:10:01 2021 +0000 net: dsa: replace phylink_get_interfaces() with phylink_get_caps() Phylink needs slightly more information than phylink_get_interfaces() allows us to get from the DSA drivers - we need the MAC capabilities. Replace the phylink_get_interfaces() method with phylink_get_caps() to allow DSA drivers to fill in the phylink_config MAC capabilities field as well. Signed-off-by: Russell King (Oracle) Reviewed-by: Marek Behún Reviewed-by: Andrew Lunn Signed-off-by: Jakub Kicinski commit 21bd64bd717dedac96f53b668144cbe37d3c12d4 Author: Russell King (Oracle) Date: Tue Nov 30 13:09:55 2021 +0000 net: dsa: consolidate phylink creation The code in port.c and slave.c creating the phylink instance is very similar - let's consolidate this into a single function. Signed-off-by: Russell King (Oracle) Reviewed-by: Marek Behún Reviewed-by: Andrew Lunn Signed-off-by: Jakub Kicinski commit 8057cbb8335cf6d419866737504473833e1d128a Author: Tianchen Ding Date: Tue Nov 30 19:02:09 2021 +0800 net: mdio: mscc-miim: Add depend of REGMAP_MMIO on MDIO_MSCC_MIIM There's build error while CONFIG_REGMAP_MMIO is not set and CONFIG_MDIO_MSCC_MIIM=m. ERROR: modpost: "__devm_regmap_init_mmio_clk" [drivers/net/mdio/mdio-mscc-miim.ko] undefined! Add the depend of REGMAP_MMIO to fix it. Fixes: a27a76282837 ("net: mdio: mscc-miim: convert to a regmap implementation") Signed-off-by: Tianchen Ding Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20211130110209.804536-1-dtcccc@linux.alibaba.com Signed-off-by: Jakub Kicinski commit 699e53e4fab3a37d3538c4177389a54b1e6a24e2 Author: Christophe JAILLET Date: Sat Nov 27 16:18:59 2021 +0100 net: spider_net: Use non-atomic bitmap API when applicable No concurrent access is possible when a bitmap is local to a function. So prefer the non-atomic functions to save a few cycles. - replace a 'for' loop by an equivalent non-atomic 'bitmap_fill()' call - use '__set_bit()' While at it, clear the 'bitmask' bitmap only when needed. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/3de0792f5088f00d135c835df6c19e63ae95f5d2.1638026251.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jakub Kicinski commit 896568e5b9c8a170912ff83760dca51703e276f1 Author: Rafał Miłecki Date: Wed Nov 10 17:57:19 2021 +0100 dt-bindings: pinctrl: convert controller description to the json-schema This helps validating DTS and writing YAML files. Signed-off-by: Rafał Miłecki Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211110165720.30242-1-zajec5@gmail.com Signed-off-by: Linus Walleij commit f3e3e63796cc599024b03fe67d788630a5923ae5 Author: kernel test robot Date: Sat Nov 27 19:01:04 2021 +0100 pinctrl: apple-gpio: fix flexible_array.cocci warnings Zero-length and one-element arrays are deprecated, see Documentation/process/deprecated.rst Flexible-array members should be used instead. Generated by: scripts/coccinelle/misc/flexible_array.cocci CC: Joey Gouly 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.2111271859250.2864@hadrien Signed-off-by: Linus Walleij commit 9f9d17c228c89e38ed612500126daf626270be9a Author: Dan Carpenter Date: Sat Nov 27 17:08:36 2021 +0300 pinctrl: mediatek: add a check for error in mtk_pinconf_bias_get_rsel() All the other mtk_hw_get_value() calls have a check for "if (err)" so we can add one here as well. This silences a Smatch warning: drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c:819 mtk_pinconf_bias_get_rsel() error: uninitialized symbol 'pd'. Fixes: fb34a9ae383a ("pinctrl: mediatek: support rsel feature") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20211127140836.GB24002@kili Signed-off-by: Linus Walleij commit 67bbbcb49b968a93251de7b23616d5aff5d3a726 Author: Dan Carpenter Date: Sat Nov 27 17:07:50 2021 +0300 pinctrl: mediatek: uninitialized variable in mtk_pctrl_show_one_pin() The "try_all_type" variable is not set if (hw->soc->pull_type) is false leading to the following Smatch warning: drivers/pinctrl/mediatek/pinctrl-paris.c:599 mtk_pctrl_show_one_pin() error: uninitialized symbol 'try_all_type'. Fixes: fb34a9ae383a ("pinctrl: mediatek: support rsel feature") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20211127140750.GA24002@kili Signed-off-by: Linus Walleij commit debc8b0b469d1b0a0745df2c0992eb268f7994fa Author: Giulio Benetti Date: Thu Nov 25 16:14:34 2021 -0500 pinctrl: freescale: Add i.MXRT1050 pinctrl driver support Add the pinctrl driver support for i.MXRT1050. Signed-off-by: Giulio Benetti Signed-off-by: Jesse Taube Reviewed-by: Fabio Estevam Link: https://lore.kernel.org/r/20211125211443.1150135-5-Mr.Bossman075@gmail.com Signed-off-by: Linus Walleij commit 96028326dfb9a660f65526c514b7bffc34c1adb3 Author: Jesse Taube Date: Thu Nov 25 16:14:32 2021 -0500 dt-bindings: pinctrl: add i.MXRT1050 pinctrl binding doc Add i.MXRT1050 pinctrl binding doc Cc: Giulio Benetti Signed-off-by: Jesse Taube Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211125211443.1150135-3-Mr.Bossman075@gmail.com Signed-off-by: Linus Walleij commit bceb6732f3fd2a55d8f2e518cced1c7555e216b6 Author: John Keeping Date: Fri Nov 26 15:13:52 2021 +0000 pinctrl/rockchip: fix gpio device creation GPIO nodes are not themselves busses, so passing rockchip_bank_match here is wrong. Passing NULL instead uses the standard bus match table which is more appropriate. devm_of_platform_populate() shows that this is the normal way to call of_platform_populate() from a device driver, so in order to match that more closely also add the pinctrl device as the parent for the newly created GPIO controllers. Specifically, using the wrong match here can break dynamic GPIO hogs as marking the GPIO bank as a bus means that of_platform_notify() will set OF_POPULATED on new child nodes and if this happens before of_gpio_notify() is called then the new hog will be skipped as OF_POPULATED is already set. Fixes: 9ce9a02039de ("pinctrl/rockchip: drop the gpio related codes") Signed-off-by: John Keeping Link: https://lore.kernel.org/r/20211126151352.1509583-1-john@metanate.com Signed-off-by: Linus Walleij commit 4e5b6de1f46d0ea0b2e1f76bfc4eb6df03846a03 Author: Geert Uytterhoeven Date: Fri Nov 26 12:57:00 2021 +0100 dt-bindings: net: cdns,macb: Convert to json-schema Convert the Cadence MACB/GEM Ethernet controller Device Tree binding documentation to json-schema. Re-add "cdns,gem" (removed in commit a217d8711da5c87f ("dt-bindings: Remove PicoXcell bindings")) as there are active users on non-PicoXcell platforms. Add missing "ether_clk" clock. Add missing properties. Signed-off-by: Geert Uytterhoeven Acked-by: Nicolas Ferre Link: https://lore.kernel.org/r/104dcbfd22f95fc77de9fe15e8abd83869603ea5.1637927673.git.geert@linux-m68k.org Signed-off-by: Rob Herring commit ca1e147c2de54e3f27c8cfbcabb6e8a522bbd75a Author: Geert Uytterhoeven Date: Thu Nov 25 16:02:33 2021 +0100 dt-bindings: dma: sifive,fu540-c000-pdma: Group interrupt tuples To improve human readability and enable automatic validation, the tuples in "interrupts" properties should be grouped using angle brackets. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20211125150233.161576-1-geert@linux-m68k.org Signed-off-by: Rob Herring commit 6e10f6f602f8ca0d6c307c4629ff501869590517 Author: David Heidelberg Date: Wed Nov 24 21:20:46 2021 +0100 dt-bindings: net: ethernet-controller: add 2.5G and 10G speeds Both are already used by HW and drivers inside Linux. Fix warnings as: arch/arm64/boot/dts/freescale/fsl-ls1028a-kontron-sl28-var2.dt.yaml: ethernet@0,2: fixed-link:speed:0:0: 2500 is not one of [10, 100, 1000] From schema: Documentation/devicetree/bindings/net/ethernet-controller.yaml Signed-off-by: David Heidelberg Link: https://lore.kernel.org/r/20211124202046.81136-1-david@ixit.cz Signed-off-by: Rob Herring commit 4fdd0736a3b1634613d1d2eeb3328d27522052fb Author: Matthias Schiffer Date: Mon Nov 22 12:45:36 2021 +0100 of: base: Skip CPU nodes with "fail"/"fail-..." status Allow fully disabling CPU nodes using status = "fail". This allows a bootloader to change the number of available CPUs (for example when a common DTS is used for SoC variants with different numbers of cores) without deleting the nodes altogether, which could require additional fixups to avoid dangling phandle references. Unknown status values (everything that is not "okay"/"ok", "disabled" or "fail"/"fail-...") will continue to be interpreted like "disabled", meaning that the CPU can be enabled during boot. References: - https://www.spinics.net/lists/devicetree-spec/msg01007.html - https://github.com/devicetree-org/dt-schema/pull/61 Link: https://lore.kernel.org/all/CAL_Jsq+1LsTBdVaODVfmB0eme2jMpNL4VgKk-OM7rQWyyF0Jbw@mail.gmail.com/ Signed-off-by: Matthias Schiffer Tested-by: Sai Prakash Ranjan Reviewed-by: Frank Rowand Link: https://lore.kernel.org/r/20211122114536.2981-1-matthias.schiffer@ew.tq-group.com Signed-off-by: Rob Herring commit 78fe448252ab25a86552a66f46375033deb5b817 Author: David Mosberger-Tang Date: Sun Nov 21 16:13:40 2021 +0000 Update trivial-devices.yaml with Sensirion,sht4x Add Sensirion SHT4x, a precision temperature and humidity sensor, to trivial-devices.yaml. Signed-off-by: David Mosberger-Tang Link: https://lore.kernel.org/r/20211121161320.2312393-1-davidm@egauge.net Signed-off-by: Rob Herring commit 180d597a9869aa50d9efc334c567ff4a26b3bf2b Author: Linus Walleij Date: Sat Nov 20 02:14:18 2021 +0100 dt-bindings: Add resets to the PL011 bindings Some PL011 implementations provide a reset line to the silicon IP block, add a device tree property for this. Cc: devicetree@vger.kernel.org Signed-off-by: Linus Walleij Acked-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20211120011418.2630449-1-linus.walleij@linaro.org Signed-off-by: Rob Herring commit 761de79adc2ca529c9e4cc75cfc2f0ec542c5463 Author: Krzysztof Kozlowski Date: Tue Nov 16 12:02:07 2021 +0100 dt-bindings: hwmon: add TI DC-DC converters Few Texas Instruments DC-DC converters on PMBus like TPS544B20 do not have bindings and are used only as hardware monitoring sensor. These devices are actually not trivial and can receive basic configuration (e.g. power up mode, CNTL pin polarity, expected input voltage), however devicetree support for configuration was never added. Therefore in current state the devices are used only in read-only mode and have trivial bindings, so document them to have basic dtschema tests. Cc: Vincent Pelletier Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20211116110207.68494-1-krzysztof.kozlowski@canonical.com Signed-off-by: Rob Herring commit af3f33751db1610691b9486afafe7bdb6d1107cb Author: Rafał Miłecki Date: Sun Nov 14 23:54:16 2021 +0100 dt-bindings: leds: convert BCM6328 controller to the json-schema This helps validating DTS files. Signed-off-by: Rafał Miłecki Link: https://lore.kernel.org/r/20211114225416.3174-1-zajec5@gmail.com Signed-off-by: Rob Herring commit c305ae99dfd4d0fe70c7fdf13ef5f7650a804ea7 Merge: c18c8891111bb 74ba89c08e309 Author: Dave Airlie Date: Thu Dec 2 10:28:17 2021 +1000 Merge tag 'drm-intel-next-2021-11-30' of git://anongit.freedesktop.org/drm/drm-intel into drm-next drm/i915 feature pull for v5.17: Features and functionality: - Implement per-lane DP drive settings for ICL+ (Ville) - Enable runtime pm autosuspend by default (Tilak Tangudu) - ADL-P DSI support (Vandita) - Add support for pipe C and D DMC firmware (Anusha) - Implement (near)atomic gamma LUT updates via vblank workers (Ville) - Split plane updates to noarm+arm phases (Ville) - Remove the CCS FB stride restrictions on ADL-P (Imre) - Add PSR selective fetch support for biplanar formats (Jouni) - Add support for display audio codec keepalive (Kai) - VRR platform support for display 11 (Manasi) Refactoring and cleanups: - FBC refactoring and cleanups preparing for multiple FBC instances (Ville) - PCH modeset refactoring, move to its own file (Ville) - Refactor and simplify handling of modifiers (Imre) - PXP cleanups (Ville) - Display header and include refactoring (Jani) - Some register macro cleanups (Ville) - Refactor DP HDMI DFP limit code (Ville) Fixes: - Disable DSB usage for now due to incorrect gamma LUT updates (Ville) - Check async flip state of every crtc and plane only once (José) - Fix DPT FB suspend/resume (Imre) - Fix black screen on reboot due to disabled DP++ TMDS output buffers (Ville) - Don't request GMBUS to generate irqs when called while irqs are off (Ville) - Fix type1 DVI DP dual mode adapter heuristics for modern platforms (Ville) - Fix fix integer overflow in 128b/132b data rate calculation (Jani) - Fix bigjoiner state readout (Ville) - Build fix for non-x86 (Siva) - PSR fixes (José, Jouni, Ville) - Disable ADL-P underrun recovery (José) - Fix DP link parameter usage before valid DPCD (Imre) - VRR vblank and frame counter fixes (Ville) - Fix fastsets on TypeC ports following a non-blocking modeset (Imre) - Compiler warning fixes (Nathan Chancellor) - Fix DSI HS mode commands (William Tseng) - Error return fixes (Dan Carpenter) - Update memory bandwidth calculations (Radhakrishna) - Implement WM0 cursor WA for DG2 (Stan) - Fix DSI Double pixelclock on read-back for dual-link panels (Hans de Goede) - HDMI 2.1 PCON FRL configuration fixes (Ankit) Merges: - DP link training delay helpers, via topic branch (Jani) - Backmerge drm-next (Jani) Signed-off-by: Dave Airlie From: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/87v909it0t.fsf@intel.com commit f6a1987773a5908bae7bcadbeec0bcab25df7b20 Author: Nicholas Piggin Date: Wed Dec 1 15:21:12 2021 +1000 KVM: PPC: Book3S HV P9: Remove unused ri_set local variable ri_set is set and never used. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211201052112.2137167-1-npiggin@gmail.com commit 2a2ac8a7018b953cd23d770ebd28f8e1ea365df4 Author: Cédric Le Goater Date: Wed Dec 1 17:54:18 2021 +0100 powerpc/xive: Fix compile when !CONFIG_PPC_POWERNV. The automatic "save & restore" of interrupt context is a POWER10/XIVE2 feature exploited by KVM under the PowerNV platform. It is not available under pSeries and the associated toggle should not be exposed under the XIVE debugfs directory. Introduce a platform handler for debugfs initialization and move the 'save-restore' entry under the native (PowerNV) backend to fix compile when !CONFIG_PPC_POWERNV. Fixes: 1e7684dc4fc7 ("powerpc/xive: Add a debugfs toggle for save-restore") Reported-by: kernel test robot Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211201165418.1041842-1-clg@kaod.org commit 62ea67e31981bca95ec16c37e2a1fba68f3dd8c5 Author: Kees Cook Date: Thu Nov 18 12:36:04 2021 -0800 powerpc/signal32: Use struct_group() to zero spe regs In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Add a struct_group() for the spe registers so that memset() can correctly reason about the size: In function 'fortify_memset_chk', inlined from 'restore_user_regs.part.0' at arch/powerpc/kernel/signal_32.c:539:3: >> include/linux/fortify-string.h:195:4: error: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning] 195 | __write_overflow_field(); | ^~~~~~~~~~~~~~~~~~~~~~~~ Reported-by: kernel test robot Signed-off-by: Kees Cook Reviewed-by: Christophe Leroy Acked-by: Michael Ellerman Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211118203604.1288379-1-keescook@chromium.org commit 007f26ee4f6406fd52f96efa2289666781310ea9 Author: jason-jh.lin Date: Tue Nov 30 02:44:34 2021 +0800 drm/mediatek: Remove unused define in mtk_drm_ddp_comp.c Remove the unsed define in mtk_drm_ddp_comp.c Signed-off-by: jason-jh.lin Signed-off-by: Chun-Kuang Hu commit 64b5b97b8cfff64409fcc234ae3151bc8de0c4d6 Author: Alexander Lobakin Date: Wed Dec 1 17:49:31 2021 +0100 samples: bpf: Fix conflicting types in fds_example Fix the following samples/bpf build error appeared after the introduction of bpf_map_create() in libbpf: CC samples/bpf/fds_example.o samples/bpf/fds_example.c:49:12: error: static declaration of 'bpf_map_create' follows non-static declaration static int bpf_map_create(void) ^ samples/bpf/libbpf/include/bpf/bpf.h:55:16: note: previous declaration is here LIBBPF_API int bpf_map_create(enum bpf_map_type map_type, ^ samples/bpf/fds_example.c:82:23: error: too few arguments to function call, expected 6, have 0 fd = bpf_map_create(); ~~~~~~~~~~~~~~ ^ samples/bpf/libbpf/include/bpf/bpf.h:55:16: note: 'bpf_map_create' declared here LIBBPF_API int bpf_map_create(enum bpf_map_type map_type, ^ 2 errors generated. fds_example by accident has a static function with the same name. It's not worth it to separate a single call into its own function, so just embed it. Fixes: 992c4225419a ("libbpf: Unify low-level map creation APIs w/ new bpf_map_create()") Signed-off-by: Alexander Lobakin Signed-off-by: Andrii Nakryiko Reviewed-by: Maciej Fijalkowski Acked-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/bpf/20211201164931.47357-1-alexandr.lobakin@intel.com commit bfc3a3f93ef7d48879c4b070bdbb6b6a80c06365 Author: Rafał Miłecki Date: Wed Dec 1 22:19:39 2021 +0100 MAINTAINERS: Add Florian as BCM5301X and BCM53573 maintainer BCM5301X and BCM53573 commits go through Florian's stblinux.git so add him as maintainer to make sure people e-mail him when sending patches. Signed-off-by: Rafał Miłecki Signed-off-by: Florian Fainelli commit 15f0ae7a91a9ca8fb34ecc6e0c7d8bd3a3ce180c Author: Wolfram Sang Date: Wed Dec 1 12:47:51 2021 +0100 i2c: stm32f7: remove noisy and imprecise log messages The log messages talk about 'bus recovery' while it is not a bus recovery with 9 pulses but merely a controller reset. Controller resets are not worth log messages. The 'bus busy' message should be emitted by upper layers, a busy bus may be expected in some cases. Signed-off-by: Wolfram Sang Reviewed-by: Alain Volmat commit ddb267b66af9d49d54e3d3ce8a6b4e4e7ad9af0a Author: Yann Dirson Date: Mon Nov 29 21:08:57 2021 +0100 drm/amdgpu: update fw_load_type module parameter doc to match code amdgpu_ucode_get_load_type() does not interpret this parameter as documented. It is ignored for many ASIC types (which presumably only support one load_type), and when not ignored it is only used to force direct loading instead of PSP loading. SMU loading is only available for ASICs for which the parameter is ignored. Signed-off-by: Yann Dirson Signed-off-by: Alex Deucher commit a899fe8b433be3d2c6bb9218f2b885d91f3079c4 Author: Philip Yang Date: Mon Nov 29 15:21:50 2021 -0500 drm/amdkfd: err_pin_bo path leaks kfd_bo_list Refactor userptr and pin_bo path to make it less confusing, move err_pin_bo label up to remove mem from process_info kfd_bo_list. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit ea6c66449692399005f975b69c72a9e1797871f2 Author: Philip Yang Date: Mon Nov 29 12:33:05 2021 -0500 drm/amdkfd: process_info lock not needed for svm process_info->lock is used to protect kfd_bo_list, vm_list_head, n_vms and userptr valid/inval list, svm_range_restore_work and svm_range_set_attr don't access those, so do not need to take process_info lock. This will avoid potential circular locking issue. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 2c1f19b3272c0c09184b1cce592a91dc34a83506 Author: Graham Sider Date: Thu Nov 18 16:09:58 2021 -0500 drm/amdkfd: remove hardcoded device_info structs With device_info initialization being handled in kfd_device_info_init, these structs may be removed. Also add comments to help matching IP versions to asic names. Signed-off-by: Graham Sider Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit f0dc99a6f742bce9f5e45a6ca48bc4f1f8c6bac8 Author: Graham Sider Date: Wed Nov 17 17:32:37 2021 -0500 drm/amdkfd: add kfd_device_info_init function Initializes kfd->device_info given either asic_type (enum) if GFX version is less than GFX9, or GC IP version if greater. Also takes in vf and the target compiler gfx version. Uses SDMA version to determine num_sdma_queues_per_engine. Convert device_info to a non-pointer member of kfd, change references accordingly. Change unsupported asic condition to only probe f2g, move device_info initialization post-switch. Signed-off-by: Graham Sider Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit b7675b7bbc3c4c64731d6df66a1df7abd0fe2f9e Author: Graham Sider Date: Thu Nov 11 11:28:45 2021 -0500 drm/amdkfd: replace asic_name with amdgpu_asic_name device_info->asic_name and amdgpu_asic_name[adev->asic_type] both provide asic name strings, with the only difference being casing. Remove asic_name from device_info and replace sysfs entry with lowercase amdgpu_asic_name[]. Ensures string is null-terminated so that this doesn't break if dev->node_props.name ever gets set anywhere else. Signed-off-by: Graham Sider Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 05907656b94f6c1b96cbcc3063a683f4c580b63a Author: Alain Volmat Date: Wed Dec 1 12:47:50 2021 +0100 i2c: stm32: get rid of stm32f7_i2c_release_bus return value Function stm32f7_i2c_release_bus is always returning 0, hence it should be a void function. Update the function and remove the return value error checking code in caller functions. Signed-off-by: Alain Volmat Signed-off-by: Wolfram Sang commit 992110d747177e5815cf89003732ae69cd70913f Author: shaoyunl Date: Mon Nov 29 21:29:05 2021 -0500 drm/amdgpu: adjust the kfd reset sequence in reset sriov function This change revert previous commits: 9f4f2c1a3524 ("drm/amd/amdgpu: fix the kfd pre_reset sequence in sriov") 271fd38ce56d ("drm/amdgpu: move kfd post_reset out of reset_sriov function") This change moves the amdgpu_amdkfd_pre_reset to an earlier place in amdgpu_device_reset_sriov, presumably to address the sequence issue that the first patch was originally meant to fix. Some register access(GRBM_GFX_CNTL) only be allowed on full access mode. Move kfd_pre_reset and kfd_post_reset back inside reset_sriov function. Fixes: 9f4f2c1a3524 ("drm/amd/amdgpu: fix the kfd pre_reset sequence in sriov") Fixes: 271fd38ce56d ("drm/amdgpu: move kfd post_reset out of reset_sriov function") Signed-off-by: shaoyunl Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 405af9793f734159ae20e71bf5fff0d3bec959cd Author: Perry Yuan Date: Fri Nov 19 04:27:55 2021 -0500 drm/amd/display: add connector type check for CRC source set [Why] IGT bypass test will set crc source as DPRX,and display DM didn`t check connection type, it run the test on the HDMI connector ,then the kernel will be crashed because aux->transfer is set null for HDMI connection. This patch will skip the invalid connection test and fix kernel crash issue. [How] Check the connector type while setting the pipe crc source as DPRX or auto,if the type is not DP or eDP, the crtc crc source will not be set and report error code to IGT test,IGT will show the this subtest as no valid crtc/connector combinations found. 116.779714] [IGT] amd_bypass: starting subtest 8bpc-bypass-mode [ 117.730996] BUG: kernel NULL pointer dereference, address: 0000000000000000 [ 117.731001] #PF: supervisor instruction fetch in kernel mode [ 117.731003] #PF: error_code(0x0010) - not-present page [ 117.731004] PGD 0 P4D 0 [ 117.731006] Oops: 0010 [#1] SMP NOPTI [ 117.731009] CPU: 11 PID: 2428 Comm: amd_bypass Tainted: G OE 5.11.0-34-generic #36~20.04.1-Ubuntu [ 117.731011] Hardware name: AMD CZN/, BIOS AB.FD 09/07/2021 [ 117.731012] RIP: 0010:0x0 [ 117.731015] Code: Unable to access opcode bytes at RIP 0xffffffffffffffd6. [ 117.731016] RSP: 0018:ffffa8d64225bab8 EFLAGS: 00010246 [ 117.731017] RAX: 0000000000000000 RBX: 0000000000000020 RCX: ffffa8d64225bb5e [ 117.731018] RDX: ffff93151d921880 RSI: ffffa8d64225bac8 RDI: ffff931511a1a9d8 [ 117.731022] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 117.731023] CR2: ffffffffffffffd6 CR3: 000000010d5a4000 CR4: 0000000000750ee0 [ 117.731023] PKRU: 55555554 [ 117.731024] Call Trace: [ 117.731027] drm_dp_dpcd_access+0x72/0x110 [drm_kms_helper] [ 117.731036] drm_dp_dpcd_read+0xb7/0xf0 [drm_kms_helper] [ 117.731040] drm_dp_start_crc+0x38/0xb0 [drm_kms_helper] [ 117.731047] amdgpu_dm_crtc_set_crc_source+0x1ae/0x3e0 [amdgpu] [ 117.731149] crtc_crc_open+0x174/0x220 [drm] [ 117.731162] full_proxy_open+0x168/0x1f0 [ 117.731165] ? open_proxy_open+0x100/0x100 BugLink: https://gitlab.freedesktop.org/drm/amd/-/issues/1546 Reviewed-by: Harry Wentland Reviewed-by: Rodrigo Siqueira Signed-off-by: Perry Yuan Signed-off-by: Alex Deucher commit a872c152fd91e815ce1a2f251ff06d693119fbbd Author: Philip Yang Date: Fri Nov 26 18:43:09 2021 -0500 drm/amdkfd: fix double free mem structure drm_gem_object_put calls release_notify callback to free the mem structure and unreserve_mem_limit, move it down after the last access of mem and make it conditional call. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 71f8f119237ff2dd4fed49aa79eecdc50ed41ddb Author: Philip Yang Date: Fri Nov 26 12:42:50 2021 -0500 drm/amdkfd: set "r = 0" explicitly before goto To silence the following Smatch static checker warning: drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_svm.c:2615 svm_range_restore_pages() warn: missing error code here? 'get_task_mm()' failed. 'r' = '0' Signed-off-by: Philip Yang Suggested-by: Dan Carpenter Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 007f8539d03d557157fce2e5cc6016275f835906 Author: Aric Cyr Date: Sun Nov 21 15:53:32 2021 -0500 drm/amd/display: 3.2.164 This version brings along the following: - FW promotion to 0.0.95 - DSC fixes for supported Docks - Fixes eDP display issue - Vendor LTTR workarounds - Fixes Tiled display audio issue Signed-off-by: Aric Cyr Acked-by: Bhawanpreet.Lakha Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 4752c85b23ec67586e04133899c9d763cb4d629c Author: Anthony Koo Date: Sat Nov 20 19:37:31 2021 -0500 drm/amd/display: [FW Promotion] Release 0.0.95 Signed-off-by: Anthony Koo Acked-by: Bhawanpreet Lakha Reviewed-by: Aric Cyr Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit ee347d5b40a14dd9a80dfb2bf4d2c5b3b4367135 Author: George Shen Date: Fri Nov 19 11:09:37 2021 -0500 drm/amd/display: Add 16ms AUX RD interval W/A for specific LTTPR [Why] Certain display configurations require an extra delay before reading lane status with certain LTTPR. [How] Add temporary workaround to force AUX RD interval to 16ms for CR and EQ. Needs to be refactored later. Reviewed-by: Jun Lei Acked-by: Bhawanpreet Lakha Signed-off-by: George Shen Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit f3edefce70887d78ff88d9f179bdec5ea62a50a2 Author: Michael Strauss Date: Thu Nov 18 16:57:25 2021 -0500 drm/amd/display: Add force detile buffer size debug flag [WHY] Allow changing DET size with debug flag for testing purposes Reviewed-by: Nicholas Kazlauskas Acked-by: Bhawanpreet Lakha Signed-off-by: Michael Strauss Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 2f2a4b1879bf6448865af9bdab61d1b7986f6dd0 Author: George Shen Date: Thu Nov 18 19:25:26 2021 -0500 drm/amd/display: Skip vendor specific LTTPR w/a outside link training [Why] Vendor specific link rate toggle workaround should not be applied outside of link training scenario, such as when outputting PHY test pattern. [How] Add flag to indicate when link training is occuring. Make workaround a no-op when flag is not set. Reviewed-by: Jun Lei Acked-by: Bhawanpreet Lakha Signed-off-by: George Shen Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit c11099b0d1aa3e48e9578b440886d8b29779e8ba Author: George Shen Date: Wed Nov 17 20:49:50 2021 -0500 drm/amd/display: Add vendor specific LTTPR workarounds for DCN31 [Why] Certain LTTPR require special workarounds in order to comply with DP specifications. [How] Implement vendor specific sequences via DPCD writes to vendor-specific LTTPR registers. Reviewed-by: Jun Lei Reviewed-by: Wenjing Liu Acked-by: Bhawanpreet Lakha Signed-off-by: George Shen Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 7238b42e1f4009cde5c67c2c5f9d35d472240ffa Author: Mikita Lipski Date: Thu Nov 18 08:34:41 2021 -0500 drm/amd/display: PSR panel capability debugfs [why] Adding a debugfs to show PSR capability of the panel and the driver. To use: cat /sys/kernel/debug/dri/0/eDP-X/psr_capability Expected output: Sink support: no/yes Driver support: no/yes [how] Adding psr_capability to eDP connectors. Reviewed-by: Nicholas Kazlauskas Acked-by: Bhawanpreet Lakha Signed-off-by: Mikita Lipski Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit b995747511f6d9f6d6f55bd094e3a5adeb36b55b Author: Brandon Syu Date: Thu Nov 18 19:01:40 2021 +0800 drm/amd/display: Fix dual eDP abnormal display issue [WHY] Driver use primary eDP link stream as the condition to enable fastboot or not. In dual eDP case, set second screen only, this would cause slave eDP timing to be used on primary one. [HOW] Add a check for unmatched eDP link stream. Reviewed-by: Nicholas Kazlauskas Acked-by: Bhawanpreet Lakha Signed-off-by: Brandon Syu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit ab644ea6921a2cee9282bc96c35b29b17a8026f0 Author: Jimmy Kizito Date: Sun Nov 14 21:48:02 2021 -0500 drm/amd/display: Add work around for tunneled MST. [Why] Certain USB4 docks do not seem to be able to handle disabling DSC once it has been enabled on an MST stream. This can result in blank displays. [How] As a work around, always enable DSC on docks exhibiting this issue. The flag to indicate the use of DSC for MST streams on a USB4 dock is set during detection of the dock and only cleared when the USB4 dock is disconnected. Reviewed-by: Jun Lei Reviewed-by: Aric Cyr Acked-by: Bhawanpreet Lakha Signed-off-by: Jimmy Kizito Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 0a043904187b31fc34369d31569186a5ded23e20 Author: Evgenii Krasnikov Date: Mon Nov 15 17:21:51 2021 -0500 drm/amd/display: add function for eDP and backlight power on [HOW&WHY] Add function to be used for early eDP power on Reviewed-by: Anthony Koo Acked-by: Bhawanpreet Lakha Signed-off-by: Evgenii Krasnikov Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 9602044d1cc12280e20c88885f2cd640ae80f69e Author: Mustapha Ghaddar Date: Mon Nov 15 17:56:42 2021 -0500 drm/amd/display: Fix for the no Audio bug with Tiled Displays [WHY] It seems like after a series of plug/unplugs we end up in a situation where tiled display doesnt support Audio. [HOW] The issue seems to be related to when we check streams changed after an HPD, we should be checking the audio_struct as well to see if any of its values changed. Reviewed-by: Jun Lei Acked-by: Bhawanpreet Lakha Signed-off-by: Mustapha Ghaddar Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit a896f870f8a5f23ec961d16baffd3fda1f8be57c Author: Meenakshikumar Somasundaram Date: Mon Nov 15 01:51:37 2021 -0500 drm/amd/display: Fix for otg synchronization logic [Why] During otg sync trigger, plane states are used to decide whether the otg is already synchronized or not. There are scenarions when otgs are disabled without plane state getting disabled and in such case the otg is excluded from synchronization. [How] Introduced pipe_idx_syncd in pipe_ctx that tracks each otgs master pipe. When a otg is disabled/enabled, pipe_idx_syncd is reset to itself. On sync trigger, pipe_idx_syncd is checked to decide whether a otg is already synchronized and the otg is further included or excluded from synchronization. Reviewed-by: Jun Lei Reviewed-by: Mustapha Ghaddar Acked-by: Bhawanpreet Lakha Signed-off-by: meenakshikumar somasundaram Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit aba3c3fede54e55573954fa7a7e28ec304557e50 Author: Shen, George Date: Mon Nov 15 22:38:18 2021 -0500 drm/amd/display: Clear DPCD lane settings after repeater training [Why] VS and PE requested by repeater should not persist for the sink. [How] Clear DPCD lane settings after repeater link training finishes. Reviewed-by: Wesley Chalmers Acked-by: Bhawanpreet Lakha Signed-off-by: George Shen Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 9311ed1e12417c81e1764d7656d97d9d459f9c5a Author: Dale Zhao Date: Mon Nov 15 14:28:18 2021 +0800 drm/amd/display: add hdmi disable debug check [Why] Using the hdmi_disable option doesnt disable 6GB bandwidth [How] Add debug.hdmi20_disable flage when checking 6GB enable or not. Reviewed-by: Chris Park Reviewed-by: Aric Cyr Acked-by: Bhawanpreet Lakha Signed-off-by: Dale Zhao Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 6421f7c750e92c35ceb239ccbd03ceeae2c65ff8 Author: Nicholas Kazlauskas Date: Fri Nov 12 15:27:32 2021 -0500 drm/amd/display: Allow DSC on supported MST branch devices [Why] When trying to lightup two 4k60 non-DSC displays behind a branch device that supports DSC we can't lightup both at once due to bandwidth limitations - each requires 48 VCPI slots but we only have 63. [How] The workaround already exists in the code but is guarded by a CONFIG that cannot be set by the user and shouldn't need to be. Check for specific branch device IDs to device whether to enable the workaround for multiple display scenarios. Reviewed-by: Hersen Wu Acked-by: Bhawanpreet Lakha Signed-off-by: Nicholas Kazlauskas Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit ebe5ffd8e271e328f33c4bc5cb8cea2b4cf8e058 Author: Stylon Wang Date: Fri Nov 12 20:05:19 2021 +0800 drm/amd/display: Enable P010 for DCN3x ASICs [Why + How] Enable P010 for SDR video applications. Reviewed-by: Nicholas Kazlauskas Reviewed-by: Bhawanpreet Lakha Acked-by: Bhawanpreet Lakha Signed-off-by: Stylon Wang Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit c022375ae0955b6d97ec438d658ab43a857a010f Author: Fangzhi Zuo Date: Thu Nov 25 16:06:10 2021 -0500 drm/amd/display: Add DP-HDMI FRL PCON Support in DC Change since v1: add brief description 1. Add hdmi frl pcon support to existing asic family. 2. Determine pcon frl capability based on pcon dpcd. 3. pcon frl is taken into consideration into mode validation. v2: squash in warning fix (Alex) Signed-off-by: Fangzhi Zuo Reviewed-by: Nicholas Kazlauskas Acked-by: Harry Wentland Signed-off-by: Alex Deucher commit 50b1f44ec54746e5332f4bc87c70c223192e821f Author: Fangzhi Zuo Date: Wed Nov 24 11:43:06 2021 -0500 drm/amd/display: Add DP-HDMI FRL PCON SST Support in DM 1. Parse DSC caps from PCON DPCD 2. Policy determins if DSC is decoded at PCON 3. Enable/disable DSC at PCON Signed-off-by: Fangzhi Zuo Reviewed-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher commit 81d104f4afbfc6abb3b602356cf7263f69f7a156 Author: Lijo Lazar Date: Mon Nov 29 15:57:44 2021 +0800 drm/amdgpu: Don't halt RLC on GFX suspend On aldebaran, RLC also controls GFXCLK. Skip halting RLC during GFX IP suspend and keep it running till PMFW disables all DPMs. [ 578.019986] amdgpu 0000:23:00.0: amdgpu: GPU reset begin! [ 583.245566] amdgpu 0000:23:00.0: amdgpu: Failed to disable smu features. [ 583.245621] amdgpu 0000:23:00.0: amdgpu: Fail to disable dpm features! [ 583.245639] [drm:amdgpu_device_ip_suspend_phase2 [amdgpu]] *ERROR* suspend of IP block failed -62 [ 583.248504] [drm] free PSP TMR buffer Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit fe9c5c9affc9103686aed15966b4b54acd1f30f8 Author: Lijo Lazar Date: Fri Nov 26 14:32:37 2021 +0800 drm/amdgpu: Use MAX_HWIP instead of HW_ID_MAX HW_ID_MAX considers HWID of all IPs, far more than what amdgpu uses. amdgpu tracks only the IPs defined by amd_hw_ip_block_type whose max is MAX_HWIP. Signed-off-by: Lijo Lazar Reviewed-by: Guchun Chen Signed-off-by: Alex Deucher commit 3700169886659e678fe37629ffcaacd6e559655a Author: Guchun Chen Date: Fri Nov 26 13:06:15 2021 +0800 drm/amdgpu: fix the missed handling for SDMA2 and SDMA3 There is no base reg offset or ip_version set for SDMA2 and SDMA3 on SIENNA_CICHLID, so add them. Signed-off-by: Guchun Chen Reviewed-by: Kevin Wang Signed-off-by: Alex Deucher commit 6c18ecefaba7ccb8150bbcf997f7a796a43f786b Author: Guchun Chen Date: Fri Nov 26 13:14:41 2021 +0800 drm/amdgpu: declare static function to fix compiler warning >> drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c:503:6: warning: no previous prototype for function 'release_psp_cmd_buf' [-Wmissing-prototypes] void release_psp_cmd_buf(struct psp_context *psp) ^ drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c:503:1: note: declare 'static' if the function is not intended to be used outside of this translation unit void release_psp_cmd_buf(struct psp_context *psp) ^ static 1 warning generated. Reported-by: kernel test robot Signed-off-by: Guchun Chen Reviewed-by: Kevin Wang Signed-off-by: Alex Deucher commit 94a80b5bc7a23fd5ccaa3ba43ce25cbdb9eefd62 Author: Darren Powell Date: Tue Nov 23 19:51:34 2021 -0500 amdgpu/pm: Modify implmentations of get_power_profile_mode to use amdgpu_pp_profile_name After modifying navi10 in previous commit, extend the changes so all implementations of pp_hwmgr_func->get_power_profile_mode and pptable_funcs->get_power_profile_mode use amdgpu_pp_profile_name == Test == LOGFILE=pp_profile_strings.test.log 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} lspci -nn | grep "VGA\|Display" > $LOGFILE FILES="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: Lijo Lazar Signed-off-by: Alex Deucher commit 3867e3704f136beadf5e004b61696ef7f990bee4 Author: Darren Powell Date: Tue Nov 23 00:26:03 2021 -0500 amdgpu/pm: Create shared array of power profile name strings == Description == All the power profile modes use the same strings (or a subset of) Creating a public array of the strings will allow sharing rather than duplicating for each chip First patch only implements change for navi10, followup with other chips == Changes == Create a declaration of the public array in kgd_pp_interface.h Define the public array in amdgpu_pm.c Modify the implementaiton of navi10_get_power_profile_mode to use new array == Test == LOGFILE=pp_profile_strings.test.log 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} lspci -nn | grep "VGA\|Display" > $LOGFILE FILES="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: Lijo Lazar Signed-off-by: Alex Deucher commit 3c2d6ea27955cfac8590884d207353eece8c2cee Author: Philip Yang Date: Thu Nov 18 15:24:55 2021 -0500 drm/amdgpu: handle IH ring1 overflow IH ring1 is used to process GPU retry fault, overflow is enabled to drain retry fault because we want receive other interrupts while handling retry fault to recover range. There is no overflow flag set when wptr pass rptr. Use timestamp of rptr and wptr to handle overflow and drain retry fault. If fault timestamp goes backward, the fault is filtered and should not be processed. Drain fault is finished if processed_timestamp is equal to or larger than checkpoint timestamp. Add amdgpu_ih_functions interface decode_iv_ts for different chips to get timestamp from IV entry with different iv size and timestamp offset. amdgpu_ih_decode_iv_ts_helper is used for vega10, vega20, navi10. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Acked-by: Christian König Signed-off-by: Alex Deucher commit 232d1d43b522b64266a16606e918ce92a8a0b244 Author: Stanley.Yang Date: Fri Nov 26 17:24:39 2021 +0800 drm/amdgpu: fix disable ras feature failed when unload drvier v2 v2: still need call ras_disable_all_featrures to handle ras initilization failure case. Function amdgpu_device_fini_hw is called before amdgpu_device_fini_sw, so ras ta will unload before send ras disable command, ras dsiable operation must before hw fini. Signed-off-by: Stanley.Yang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 85c1b9bd13b0b298bbbf128e26a470ec54c4d0e3 Author: Lijo Lazar Date: Thu Nov 25 19:45:42 2021 +0800 drm/amd/pm: Add warning for unexpected PG requests v1: Ideally power gate/ungate requests shouldn't come when smu block is uninitialized. Add a WARN message to check the origins if such a thing ever happens. v2: Use dev_WARN to log device info (Felix/Guchun). Signed-off-by: Lijo Lazar Reviewed-by: Guchun Chen Reviewed-by: Kevin Yang Signed-off-by: Alex Deucher commit 700de2c8aadcae459a4db19b943962e709df45f2 Author: Flora Cui Date: Thu Nov 18 16:25:19 2021 +0800 drm/amdgpu: check atomic flag to differeniate with legacy path since vkms support atomic KMS interface Signed-off-by: Flora Cui Reviewed-by: Guchun Chen Acked-by: Alex Deucher Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit deefd07eedb7baa25956c8365373e6a58c81565a Author: Flora Cui Date: Wed Nov 24 10:34:57 2021 +0800 drm/amdgpu: fix vkms crtc settings otherwise adev->mode_info.crtcs[] is NULL Signed-off-by: Flora Cui Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 4f7ee199d905c7a073b676ac4146b964dd651395 Author: Flora Cui Date: Wed Nov 24 10:33:38 2021 +0800 drm/amdgpu: cancel the correct hrtimer on exit Signed-off-by: Flora Cui Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit f37668301e362a0ed4b0b2ec6866f0a02fefa4db Author: Christophe JAILLET Date: Tue Nov 23 21:46:58 2021 +0100 drm/amdkfd: Slighly optimize 'init_doorbell_bitmap()' The 'doorbell_bitmap' bitmap has just been allocated. So we can use the non-atomic '__set_bit()' function to save a few cycles as no concurrent access can happen. Reviewed-by: Felix Kuehling Signed-off-by: Christophe JAILLET Signed-off-by: Felix Kuehling Signed-off-by: Alex Deucher commit b9dd6fbd1587ca1204e6b5ea536115ab3fed1798 Author: Christophe JAILLET Date: Tue Nov 23 21:46:44 2021 +0100 drm/amdkfd: Use bitmap_zalloc() when applicable 'doorbell_bitmap' and 'queue_slot_bitmap' are bitmaps. So use 'bitmap_zalloc()' to simplify code, improve the semantic and avoid some open-coded arithmetic in allocator arguments. Also change the corresponding 'kfree()' into 'bitmap_free()' to keep consistency. Reviewed-by: Felix Kuehling Signed-off-by: Christophe JAILLET Signed-off-by: Felix Kuehling Signed-off-by: Alex Deucher commit b7e7e6ca1f7b5abc9a4d13c9e929e431240d9f48 Author: Lv Ruyi Date: Wed Nov 24 03:04:26 2021 +0000 drm/amd/display: fix application of sizeof to pointer Both of split and merge are pointers, not arrays. Reviewed-by: Rodrigo Siqueira Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Signed-off-by: Alex Deucher commit 981b3045460d1c6f201ca83c1f479cf38d28a393 Author: Jane Jian Date: Tue Nov 23 19:19:40 2021 +0800 drm/amdgpu/sriov/vcn: add new vcn ip revision check case for SIENNA_CICHLID [WHY] for sriov odd# vf will modify vcn0 engine ip revision(due to multimedia bandwidth feature), which will be mismatched with original vcn0 revision [HOW] add new version check for vcn0 disabled revision(3, 0, 192), typically modified under sriov mode Signed-off-by: Jane Jian Reviewed-by: Guchun Chen Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 627d137aa09fe58308eac06191afcaf865bd11cd Author: Jiapeng Chong Date: Wed Nov 24 18:20:36 2021 +0800 drm/amd/display: Fix warning comparing pointer to 0 Fix the following coccicheck warning: ./drivers/gpu/drm/amd/display/dc/dml/dsc/rc_calc_fpu.c:96:14-15: WARNING comparing pointer to 0. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Reviewed-by: Rodrigo Siqueira Signed-off-by: Alex Deucher commit 70897848730470cc477d5d89e6222c0f6a9ac173 Author: Nicholas Kazlauskas Date: Tue Nov 30 09:32:33 2021 -0500 drm/amdgpu/display: Only set vblank_disable_immediate when PSR is not enabled [Why] PSR currently relies on the kernel's delayed vblank on/off mechanism as an implicit bufferring mechanism to prevent excessive entry/exit. Without this delay the user experience is impacted since it can take a few frames to enter/exit. [How] Only allow vblank disable immediate for DC when psr is not supported. Leave a TODO indicating that this support should be extended in the future to delay independent of the vblank interrupt. Fixes: 92020e81ddbeac ("drm/amdgpu/display: set vblank_disable_immediate for DC") Acked-by: Alex Deucher Reviewed-by: Harry Wentland Signed-off-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher commit b66f86849414807745b5c2129e2de5f27a788c9f Author: Hans de Goede Date: Thu Nov 25 11:36:16 2021 +0100 ACPI: EC: Mark the ec_sys write_support param as module_param_hw() Using write_support=1 with the ec_sys module changes the mode of the "io" debugfs file to 0600. This will cause any attempts to access it under a kernel in lockdown mode to return -EPERM, which makes the entire ec_sys module unusable. Use the special module_param_hw() macro for module parameters which may not be used while in lockdown mode, to avoid this. Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit befd9b5b0c621af33a363596c65a8fc0176e2795 Author: Rafael J. Wysocki Date: Tue Nov 23 19:46:09 2021 +0100 ACPI: EC: Relocate acpi_ec_create_query() and drop acpi_ec_delete_query() Move acpi_ec_create_query() after acpi_ec_event_processor(), drop the no longer needed forward declaration of the latter, and eliminate acpi_ec_delete_query() which isn't really necessary. No intentional functional impact. Signed-off-by: Rafael J. Wysocki commit c33676aa48249b007d55198dc8348cd117e3d8cc Author: Rafael J. Wysocki Date: Tue Nov 23 19:44:46 2021 +0100 ACPI: EC: Make the event work state machine visible The EC driver uses a relatively simple state machine for the event work handling, but it is not really straightforward to figure out. The states are as follows: "Ready": The event handling work can be submitted. In this state, the EC_FLAGS_QUERY_PENDING flag is clear. "In progress": The event handling work is pending or is being processed. It cannot be submitted again. In ths state, the EC_FLAGS_QUERY_PENDING flag is set and both the events_to_process count is nonzero and the EC_FLAGS_QUERY_GUARDING flag is clear. "Complete": The event handling work has been completed, but it still cannot be submitted again. In ths state, the EC_FLAGS_QUERY_PENDING flag is set and the events_to_process count is zero or the EC_FLAGS_QUERY_GUARDING flag is set. The state changes from "Ready" to "In progress" when new event is detected by advance_transaction() and acpi_ec_submit_event() is called by it. Next, the state can change from "In progress" directly to "Ready" in the following situations: * ec_event_clearing is ACPI_EC_EVT_TIMING_STATUS and the state of an ACPI_EC_COMMAND_QUERY transaction becomes ACPI_EC_COMMAND_POLL. * ec_event_clearing is ACPI_EC_EVT_TIMING_QUERY and the state of an ACPI_EC_COMMAND_QUERY transaction becomes ACPI_EC_COMMAND_COMPLETE. * ec_event_clearing is either ACPI_EC_EVT_TIMING_STATUS or ACPI_EC_EVT_TIMING_QUERY and there are no more events to process (ie. ec->events_to_process becomes 0). If ec_event_clearing is ACPI_EC_EVT_TIMING_EVENT, however, the state must change from "In progress" to "Complete" before it can change to "Ready". The changes from "In progress" to "Complete" in that case occur in the following situations: * The state of an ACPI_EC_COMMAND_QUERY transaction becomes ACPI_EC_COMMAND_COMPLETE. * There are no more events to process (ie. ec->events_to_process becomes 0). Finally, the state changes from "Complete" to "Ready" when advance_transaction() is invoked when the state is "Complete" and the state of the current transaction is not ACPI_EC_COMMAND_POLL. To make this state machine visible in the code, add a new event_state field to struct acpi_ec and modify the code to use it istead the EC_FLAGS_QUERY_PENDING and EC_FLAGS_QUERY_GUARDING flags. Signed-off-by: Rafael J. Wysocki commit c793570d8725e44b64dbe466eb8ecda34c5eb8ac Author: Rafael J. Wysocki Date: Tue Nov 23 19:43:05 2021 +0100 ACPI: EC: Avoid queuing unnecessary work in acpi_ec_submit_event() Notice that it is not necessary to queue up the event work again if the while () loop in acpi_ec_event_handler() is still running which is the case if nr_pending_queries is greater than 0 at the beginning of acpi_ec_submit_event() and modify the code to avoid doing that. While at it, rename nr_pending_queries in struct acpi_ec to events_to_process which actually matches the role of that field and change its data type to unsigned int which is sufficient. No expected functional impact. Signed-off-by: Rafael J. Wysocki commit eafe7509ab8c8a200a169bc378fc9a56164acc66 Author: Rafael J. Wysocki Date: Tue Nov 23 19:42:02 2021 +0100 ACPI: EC: Rename three functions Rename acpi_ec_submit_query() to acpi_ec_submit_event(), acpi_ec_query() to acpi_ec_submit_query(), and acpi_ec_complete_query() to acpi_ec_close_event() to make the names reflect what the functions do. No expected functional impact. Signed-off-by: Rafael J. Wysocki commit a105acd7e38436ed6bc0714f3120aaaad56cbe3d Author: Rafael J. Wysocki Date: Tue Nov 23 19:40:50 2021 +0100 ACPI: EC: Simplify locking in acpi_ec_event_handler() Because acpi_ec_event_handler() is a work function, it always runs in process context with interrupts enabled, so it can use spin_lock_irq() and spin_unlock_irq() for the locking. Make it do so and adjust white space around those calls. No expected functional impact. Signed-off-by: Rafael J. Wysocki commit 388fb77dcf9793b9882e0f0651019f416ef50900 Author: Rafael J. Wysocki Date: Tue Nov 23 19:40:04 2021 +0100 ACPI: EC: Rearrange the loop in acpi_ec_event_handler() It is not necessary to check ec->nr_pending_queries against 0 in the while () loop in acpi_ec_event_handler(), because that loop terminates when ec->nr_pending_queries is 0 and the code depending on that can be run after the loop has ended. Modify the code accordingly and while at it rewrite the comment regarding that code to make it clearer. No intentional functional impact. Signed-off-by: Rafael J. Wysocki commit 98d364509d77e2d441ef6d8bdf13e1a4258eac6c Author: Rafael J. Wysocki Date: Tue Nov 23 19:39:05 2021 +0100 ACPI: EC: Fold acpi_ec_check_event() into acpi_ec_event_handler() Because acpi_ec_event_handler() is the only caller of acpi_ec_check_event() and the separation of these two functions makes it harder to follow the code flow, fold the latter into the former (and simplify that code while at it). No expected functional impact. Signed-off-by: Rafael J. Wysocki commit 1f2350443dd21028d3de6907f98ff1be75a2c9bc Author: Rafael J. Wysocki Date: Tue Nov 23 19:38:21 2021 +0100 ACPI: EC: Pass one argument to acpi_ec_query() Notice that the second argument to acpi_ec_query() is redundant, because in the only case when it is not NULL, the value passed through it is only checked against 0 and it can only be 0 when acpi_ec_query() returns an error code, but its return value is checked along with the value passed through its second argument. Accordingly, modify acpi_ec_query() to take only one argument and while at it, change its handling of the case when acpi_ec_transaction() returns an error so as to return that error value to the caller right away. No expected functional impact. Signed-off-by: Rafael J. Wysocki commit ca8283dcd933a2ca776fade77fb4527321521463 Author: Rafael J. Wysocki Date: Tue Nov 23 19:37:39 2021 +0100 ACPI: EC: Call advance_transaction() from acpi_ec_dispatch_gpe() Calling acpi_dispatch_gpe() from acpi_ec_dispatch_gpe() is generally problematic, because it may cause the spurious interrupt handling in advance_transaction() to trigger in theory. However, instead of calling acpi_dispatch_gpe() to dispatch the EC GPE, acpi_ec_dispatch_gpe() can call advance_transaction() directly on first_ec and it can pass 'false' as its second argument to indicate calling it from process context. Moreover, if advance_transaction() is modified to return a bool value indicating whether or not the EC work needs to be flushed, it can be used to avoid unnecessary EC work flushing in acpi_ec_dispatch_gpe(), so change the code accordingly. Signed-off-by: Rafael J. Wysocki commit 4a9af6cac050dce2e895ec3205c4615383ad9112 Author: Rafael J. Wysocki Date: Tue Nov 23 19:36:51 2021 +0100 ACPI: EC: Rework flushing of EC work while suspended to idle The flushing of pending work in the EC driver uses drain_workqueue() to flush the event handling work that can requeue itself via advance_transaction(), but this is problematic, because that work may also be requeued from the query workqueue. Namely, if an EC transaction is carried out during the execution of a query handler, it involves calling advance_transaction() which may queue up the event handling work again. This causes the kernel to complain about attempts to add a work item to the EC event workqueue while it is being drained and worst-case it may cause a valid event to be skipped. To avoid this problem, introduce two new counters, events_in_progress and queries_in_progress, incremented when a work item is queued on the event workqueue or the query workqueue, respectively, and decremented at the end of the corresponding work function, and make acpi_ec_dispatch_gpe() the workqueues in a loop until the both of these counters are zero (or system wakeup is pending) instead of calling acpi_ec_flush_work(). At the same time, change __acpi_ec_flush_work() to call flush_workqueue() instead of drain_workqueue() to flush the event workqueue. While at it, use the observation that the work item queued in acpi_ec_query() cannot be pending at that time, because it is used only once, to simplify the code in there. Additionally, clean up a comment in acpi_ec_query() and adjust white space in acpi_ec_event_processor(). Fixes: f0ac20c3f613 ("ACPI: EC: Fix flushing of pending work") Signed-off-by: Rafael J. Wysocki commit 9f6875660c412cd8338ea7a66081cf35f812697a Author: Hans de Goede Date: Mon Nov 22 18:05:36 2021 +0100 mmc: sdhci-acpi: Use the new soc_intel_is_byt() helper Use the new soc_intel_is_byt() helper function from include/linux/platform_data/x86/soc.h . Signed-off-by: Hans de Goede Acked-by: Adrian Hunter Signed-off-by: Rafael J. Wysocki commit 8339abffd30cbddafce4a896c8620d0abe482c58 Author: Hans de Goede Date: Mon Nov 22 18:05:35 2021 +0100 mmc: sdhci-acpi: Remove special handling for GPD win/pocket devices Remove the special sdhci_acpi_no_fixup_child_power() helper which was added to avoid triggering an ACPI tables bug on the GPD win/pocket devices. The ACPI child-device triggering this bug has now been added to the acpi_device_override_status() quirk table, so that its status field is set to all 0 (instead of the wrong return value from the _STA ACPI method). This removes the need for the special handling in the sdhci-acpi code. Signed-off-by: Hans de Goede Acked-by: Adrian Hunter Signed-off-by: Rafael J. Wysocki commit b72cd8e0fa34d5491232c64b88e3eda35436eb57 Author: Hans de Goede Date: Mon Nov 22 18:05:34 2021 +0100 ACPI / x86: Add PWM2 on the Xiaomi Mi Pad 2 to the always_present list The Xiaomi Mi Pad 2 has backlit LEDs behind the capacitive menu, home and back buttons below the screen which are controlled by the PWM2 controller of the CHT SoC. This PWM2 controller gets hidden by the firmware, add it to the always_present_ids table so that we can use the PWM controller to control the backlighting of the buttons. Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit 57d2dbf710d832841872fb15ebb79429cab90fae Author: Hans de Goede Date: Mon Nov 22 18:05:33 2021 +0100 ACPI / x86: Add not-present quirk for the PCI0.SDHB.BRC1 device on the GPD win The GPD win and its sibling the GPD pocket (99% the same electronics in a different case) use a PCI wifi card. But the ACPI tables on both variants contain a bug where the SDIO MMC controller for SDIO wifi cards is enabled despite this. This SDIO MMC controller has a PCI0.SDHB.BRC1 child-device which _PS3 method sets a GPIO causing the PCI wifi card to turn off. At the moment there is a pretty ugly kludge in the sdhci-acpi.c code, just to work around the bug in the DSDT of this single design. This can be solved cleaner/simply with a quirk overriding the _STA return of the broken PCI0.SDHB.BRC1 PCI0.SDHB.BRC1 child with a status value of 0, so that its power_manageable flag gets cleared, avoiding this problem. Note that even though it is not used, the _STA method for the MMC controller is deliberately not overridden. If the status of the MMC controller were forced to 0 it would never get suspended, which would cause these mini-laptops to not reach S0i3 level when suspended. Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit ba46e42e925b5d09b4e441f8de3db119cc7df58f Author: Hans de Goede Date: Mon Nov 22 18:05:32 2021 +0100 ACPI / x86: Allow specifying acpi_device_override_status() quirks by path Not all ACPI-devices have a HID + UID, allow specifying quirks for acpi_device_override_status() by path too. Note this moves the path/HID+UID check to after the CPU + DMI checks since the path lookup is somewhat costly. This way this lookup is only done on devices where the other checks match. Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit 1a68b346a2c9969c05e80a3b99a9ab160b5655c0 Author: Hans de Goede Date: Mon Nov 22 18:05:31 2021 +0100 ACPI: Change acpi_device_always_present() into acpi_device_override_status() Currently, acpi_bus_get_status() calls acpi_device_always_present() to allow platform quirks to override the _STA return to report that a device is present (status = ACPI_STA_DEFAULT) independent of the _STA return. In some cases it might also be useful to have the opposite functionality and have a platform quirk which marks a device as not present (status = 0) to work around ACPI table bugs. Change acpi_device_always_present() into a more generic acpi_device_override_status() function to allow this. Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit d431dfb764b145369be820fcdfd50f2159b9bbc2 Author: Hans de Goede Date: Mon Nov 22 18:05:30 2021 +0100 ACPI / x86: Drop PWM2 device on Lenovo Yoga Book from always present table It turns out that there is a WMI object which controls the PWM2 device used for the keyboard backlight and that WMI object also provides some other useful functionality. The upcoming lenovo-yogabook-wmi driver will offer both backlight control and the other functionality, so there no longer is a need to have the lpss-pwm driver binding to PWM2 for backlight control; and this is now actually undesirable because this will cause both the WMI code and the lpss-pwm driver to poke at the same PWM controller. Drop the always-present quirk for the PWM2 ACPI-device, so that the lpss-pwm controller will no longer bind to it. Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki commit 96b1c450b386b34479c0d6c5e24ebee84261433a Author: José Roberto de Souza Date: Fri Nov 19 06:09:31 2021 -0800 drm/i915: Add workaround numbers to GEN7_COMMON_SLICE_CHICKEN1 whitelisting Those two workarounds needs to be implemented in UMD, KMD only needs to whitelist the registers, so here only adding the workaround number to facilitate future workaroud table checks. Signed-off-by: José Roberto de Souza Reviewed-by: Matt Atwood Link: https://patchwork.freedesktop.org/patch/msgid/20211119140931.32791-2-jose.souza@intel.com commit f3799ff16fcfacd44aee55db162830df461b631f Author: José Roberto de Souza Date: Fri Nov 19 06:09:30 2021 -0800 Revert "drm/i915: Implement Wa_1508744258" This workarounds are causing hangs, because I missed the fact that it needs to be enabled for all cases and disabled when doing a resolve pass. So KMD only needs to whitelist it and UMD will be the one setting it on per case. This reverts commit 28ec02c9cbebf3feeaf21a59df9dfbc02bda3362. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/4145 Signed-off-by: José Roberto de Souza Fixes: 28ec02c9cbeb ("drm/i915: Implement Wa_1508744258") Reviewed-by: Matt Atwood Link: https://patchwork.freedesktop.org/patch/msgid/20211119140931.32791-1-jose.souza@intel.com commit 436d404cc8ff573a417cb3b6a5c76655121aceac Author: Hou Tao Date: Wed Dec 1 15:34:57 2021 +0800 bpf: Clean-up bpf_verifier_vlog() for BPF_LOG_KERNEL log level An extra newline will output for bpf_log() with BPF_LOG_KERNEL level as shown below: [ 52.095704] BPF:The function test_3 has 12 arguments. Too many. [ 52.095704] [ 52.096896] Error in parsing func ptr test_3 in struct bpf_dummy_ops Now all bpf_log() are ended by newline, but not all btf_verifier_log() are ended by newline, so checking whether or not the log message has the trailing newline and adding a newline if not. Also there is no need to calculate the left userspace buffer size for kernel log output and to truncate the output by '\0' which has already been done by vscnprintf(), so only do these for userspace log output. Signed-off-by: Hou Tao Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Acked-by: Martin KaFai Lau Link: https://lore.kernel.org/bpf/20211201073458.2731595-2-houtao1@huawei.com commit 873883f2e92e21668e6a0ab051749429a602b121 Author: Pali Rohár Date: Wed Nov 24 16:41:14 2021 +0100 PCI: mvebu: Remove custom mvebu_pci_host_probe() function Now after pci_ioremap_io() usage was replaced by devm_pci_remap_iospace() function, there is no need to use custom mvebu_pci_host_probe() function. Current implementation of mvebu_pci_host_probe() is same as standard PCI core function pci_host_probe(). So replace mvebu_pci_host_probe() call by pci_host_probe() and remove custom mvebu_pci_host_probe() function. Link: https://lore.kernel.org/r/20211124154116.916-4-pali@kernel.org Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi commit e14da77113bb890d7bf9e5d17031bdd476a7ce5e Author: William Kucharski Date: Wed Dec 1 09:56:58 2021 -0700 cgroup: Trace event cgroup id fields should be u64 Various trace event fields that store cgroup IDs were declared as ints, but cgroup_id(() returns a u64 and the structures and associated TP_printk() calls were not updated to reflect this. Fixes: 743210386c03 ("cgroup: use cgrp->kn->id as the cgroup ID") Signed-off-by: William Kucharski Reviewed-by: Steven Rostedt (VMware) Signed-off-by: Tejun Heo commit 2696f9010d21aee60be06b2135806e11c79ded8b Author: Zack Rusin Date: Wed Nov 10 09:50:34 2021 -0500 drm/ttm: Clarify that the TTM_PL_SYSTEM is under TTMs control TTM takes full control over TTM_PL_SYSTEM placed buffers. This makes driver internal usage of TTM_PL_SYSTEM prone to errors because it requires the drivers to manually handle all interactions between TTM which can swap out those buffers whenever it thinks it's the right thing to do and driver. CPU buffers which need to be fenced and shared with accelerators should be placed in driver specific placements that can explicitly handle CPU/accelerator buffer fencing. Currently, apart, from things silently failing nothing is enforcing that requirement which means that it's easy for drivers and new developers to get this wrong. To avoid the confusion we can document this requirement and clarify the solution. This came up during a discussion on dri-devel: https://lore.kernel.org/dri-devel/232f45e9-8748-1243-09bf-56763e6668b3@amd.com Signed-off-by: Zack Rusin Cc: Christian König Cc: Thomas Hellström Reviewed-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20211110145034.487512-1-zackr@vmware.com commit a85b1cb23091d3112492f30fd92308cf4dcc4fc6 Author: Zack Rusin Date: Fri Nov 5 15:38:46 2021 -0400 drm/vmwgfx: Switch the internal BO's to ttm_bo_type_kernel There's never a need to access our internal kernel bo's from user-space. Those objects are used exclusively for internal support to guest backed surfaces (in otable setup and mob page tables) and there's no need to have them be of device type, i.e. mmappable from user-space. Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev Link: https://patchwork.freedesktop.org/patch/msgid/20211105193845.258816-6-zackr@vmware.com commit f6be23264bbac88d1e2bb39658e1b8a397e3f46d Author: Zack Rusin Date: Fri Nov 5 15:38:45 2021 -0400 drm/vmwgfx: Introduce a new placement for MOB page tables For larger (bigger than a page) and noncontiguous mobs we have to create page tables that allow the host to find the memory. Those page tables just used regular system memory. Unfortunately in TTM those BO's are not allowed to be busy thus can't be fenced and we have to fence those bo's because we don't want to destroy the page tables while the host is still executing the command buffers which might be accessing them. To solve it we introduce a new placement VMW_PL_SYSTEM which is very similar to TTM_PL_SYSTEM except that it allows fencing. This fixes kernel oops'es during unloading of the driver (and pci hot remove/add) which were caused by busy BO's in TTM_PL_SYSTEM being present in the delayed deletion list in TTM (TTM_PL_SYSTEM manager is destroyed before the delayed deletions are executed) Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev Cc: Christian König Cc: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20211105193845.258816-5-zackr@vmware.com commit c451af78f301ff5156998d571c37cab329c10051 Author: Zack Rusin Date: Fri Nov 5 15:38:44 2021 -0400 drm/vmwgfx: Fail to initialize on broken configs Some of our hosts have a bug where rescaning a pci bus results in stale fifo memory being mapped on the host. This makes any fifo communication impossible resulting in various kernel crashes. Instead of unexpectedly crashing, predictably fail to load the driver which will preserve the system. Fixes: fb1d9738ca05 ("drm/vmwgfx: Add DRM driver for VMware Virtual GPU") Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev Link: https://patchwork.freedesktop.org/patch/msgid/20211105193845.258816-4-zackr@vmware.com commit 28b5f3b6121b7db2a44be499cfca0b6b801588b6 Author: Zack Rusin Date: Fri Nov 5 15:38:43 2021 -0400 drm/vmwgfx: Release ttm memory if probe fails The ttm mem global state was leaking if the vmwgfx driver load failed. In case of a driver load failure we have to make sure we also release the ttm mem global state. Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev Link: https://patchwork.freedesktop.org/patch/msgid/20211105193845.258816-3-zackr@vmware.com commit 826c387d015247df396a91eadbaca94f0394853c Author: Zack Rusin Date: Fri Nov 5 15:38:42 2021 -0400 drm/vmwgfx: Remove the deprecated lower mem limit TTM during the transition to the new page allocator lost the ability to constrain the allocations via the lower_mem_limit. The code has been unused since the change: 256dd44bd897 ("drm/ttm: nuke old page allocator") and there's no reason to keep it. Fixes: 256dd44bd897 ("drm/ttm: nuke old page allocator") Signed-off-by: Zack Rusin Reviewed-by: Martin Krastev Link: https://patchwork.freedesktop.org/patch/msgid/20211105193845.258816-2-zackr@vmware.com commit b20dc021ba5a813fec6dd66bb78a658e58cfce8d Author: Hari Nagalla Date: Mon Nov 22 06:27:26 2021 -0600 remoteproc: k3-r5: Extend support for R5F clusters on J721S2 SoCs The K3 J721S2 SoCs have three dual-core R5F subsystems, one in MCU voltage domain and the other two in MAIN voltage domain. These R5F clusters are similar to the R5F clusters in J7200 SoCs. Compatible Info is updated to support J721S2 SoCs. Signed-off-by: Hari Nagalla Link: https://lore.kernel.org/r/20211122122726.8532-5-hnagalla@ti.com Signed-off-by: Mathieu Poirier commit 3b918d8e9bd514d798a82568ef99b8d8ca90c8b8 Author: Hari Nagalla Date: Mon Nov 22 06:27:25 2021 -0600 remoteproc: k3-dsp: Extend support for C71x DSPs on J721S2 SoCs The K3 J721S2 SoCs have two C71x DSP subsystems in MAIN voltage domain, and there are no C66x DSP subsystems on these SoCs. The C71x DSP subsystem is a slighly updated version of the C71x DSP subsystem on J721e. The C71x DSPs are 64 bit machine with fixed and floating point DSP operations. Extend support to the C71x DSPs with J721S2 compatible strings. Signed-off-by: Hari Nagalla Link: https://lore.kernel.org/r/20211122122726.8532-4-hnagalla@ti.com Signed-off-by: Mathieu Poirier commit 83b57e60b86372d3274ac9baf04219bb497da2d2 Author: Hari Nagalla Date: Mon Nov 22 06:27:24 2021 -0600 dt-bindings: remoteproc: k3-dsp: Update bindings for J721S2 SoCs The TI K3 J721S2 SoCs have two TMS320C71x DSP subsystems, and does not have any TMS320C66x DSP subsystems. The C71x DSP subsystem in J721S2 SoCs is a similar to the C71x DSP on J721e with some minor core IP updates. Compatible info is updated for intuitvely matching to the new J721S2 SoCs. Signed-off-by: Hari Nagalla Acked-by: Rob Herring Link: https://lore.kernel.org/r/20211122122726.8532-3-hnagalla@ti.com Signed-off-by: Mathieu Poirier commit af3bf054661fb11497a7f712ece8b838521227a4 Author: Wei Yang Date: Wed Dec 1 01:17:36 2021 +0000 cgroup: fix a typo in comment In commit 8699b7762a62 ("cgroup: s/child_subsys_mask/subtree_ss_mask/"), we rename child_subsys_mask to subtree_ss_mask. While it missed to rename this in comment. Signed-off-by: Wei Yang Signed-off-by: Tejun Heo commit a9328d6de14e5b7c9256729d4d9f0924345d4eb9 Author: Hari Nagalla Date: Mon Nov 22 06:27:23 2021 -0600 dt-bindings: remoteproc: k3-r5f: Update bindings for J721S2 SoCs The TI K3 J721S2 SoCs have three dual-core Arm R5F clusters/subsystems, with 2 R5F cores each, one in MCU voltage domain and the other two in MAIN voltage domain. These clusters are similar to J7200 R5F clusters. Compatible info is updated for intuitively matching to the new J721S2 SoCs. Signed-off-by: Hari Nagalla Acked-by: Rob Herring Link: https://lore.kernel.org/r/20211122122726.8532-2-hnagalla@ti.com Signed-off-by: Mathieu Poirier commit 443378f0664a78756c3e3aeaab92750fe1e05735 Author: Paul E. McKenney Date: Tue Nov 30 17:00:30 2021 -0800 workqueue: Upgrade queue_work_on() comment The current queue_work_on() docbook comment says that the caller must ensure that the specified CPU can't go away, but does not spell out the consequences, which turn out to be quite mild. Therefore expand this comment to explicitly say that the penalty for failing to nail down the specified CPU is that the workqueue handler might find itself executing on some other CPU. Cc: Tejun Heo Cc: Lai Jiangshan Signed-off-by: Paul E. McKenney Signed-off-by: Tejun Heo commit d2a14b54989e9ccea8401895fdfbc213bd1f56af Author: Marek Vasut Date: Mon Nov 15 21:46:41 2021 +0100 PCI: rcar: Check if device is runtime suspended instead of __clk_is_enabled() Replace __clk_is_enabled() with pm_runtime_suspended(), as __clk_is_enabled() was checking the wrong bus clock and caused the following build error too: arm-linux-gnueabi-ld: drivers/pci/controller/pcie-rcar-host.o: in function `rcar_pcie_aarch32_abort_handler': pcie-rcar-host.c:(.text+0xdd0): undefined reference to `__clk_is_enabled' Link: https://lore.kernel.org/r/20211115204641.12941-1-marek.vasut@gmail.com Fixes: a115b1bd3af0 ("PCI: rcar: Add L1 link state fix into data abort hook") Signed-off-by: Marek Vasut Signed-off-by: Lorenzo Pieralisi Reviewed-by: Geert Uytterhoeven Acked-by: Randy Dunlap Cc: Arnd Bergmann Cc: Bjorn Helgaas Cc: Geert Uytterhoeven Cc: Lorenzo Pieralisi Cc: Stephen Boyd Cc: Wolfram Sang Cc: Yoshihiro Shimoda Cc: linux-renesas-soc@vger.kernel.org commit ff20afc4cee7b65f752b1da6d5da4c0bea1431b9 Author: Thomas Hellström Date: Mon Nov 29 21:22:45 2021 +0100 drm/i915: Update error capture code to avoid using the current vma state With asynchronous migrations, the vma state may be several migrations ahead of the state that matches the request we're capturing. Address that by introducing an i915_vma_snapshot structure that can be used to snapshot relevant state at request submission. In order to make sure we access the correct memory, the snapshots take references on relevant sg-tables and memory regions. Also move the capture list allocation out of the fence signaling critical path and use the CONFIG_DRM_I915_CAPTURE_ERROR define to avoid compiling in members and functions used for error capture when they're not used. Finally, Introduce lockdep annotation. v4: - Break out the capture allocation mode change to a separate patch. v5: - Fix compilation error in the !CONFIG_DRM_I915_CAPTURE_ERROR case (kernel test robot) v6: - Use #if IS_ENABLED() instead of #ifdef to match driver style. - Move yet another change of allocation mode to the separate patch. - Commit message rework due to patch reordering. v7: - Adjust for removal of region refcounting. Signed-off-by: Thomas Hellström Reviewed-by: Ramalingam C Link: https://patchwork.freedesktop.org/patch/msgid/20211129202245.472043-1-thomas.hellstrom@linux.intel.com commit 10184da91666e3f37fb2ddb722239097b55cc0a2 Merge: 8c659fdab06a4 51ef6b00798cc Author: David S. Miller Date: Wed Dec 1 14:52:34 2021 +0000 Merge branch 'mlxsw-Spectrum-4-prep' From: Ido Schimmel ==================== mlxsw: Spectrum-4 preparations The Spectrum-4 ASIC will support more than 256 ports, unlike existing ASICs. As such, various device registers were extended with two additional bits to encode a 10 bit local port. In some cases, new (Version 2) registers were introduced. This patchset prepares mlxsw for Spectrum-4 support by encoding local port in a 'u16' instead of a 'u8' and by extending the definitions of the various registers to support the extended local port form. ==================== Signed-off-by: David S. Miller commit 51ef6b00798ccf022efc83b91fc9038afe4c953f Author: Amit Cohen Date: Wed Dec 1 10:12:40 2021 +0200 mlxsw: Use Switch Multicast ID Register Version 2 The SMID-V2 register maps Multicast ID (MID) into a list of local ports. It is a new version of SMID in order to support 1024 bits of local_port. Add SMID-V2 register and use it instead of SMID. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit e86ad8ce5beda5dbd351957b22948fdb077f9f53 Author: Amit Cohen Date: Wed Dec 1 10:12:39 2021 +0200 mlxsw: Use Switch Flooding Table Register Version 2 The SFTR-V2 register is used for flooding packet replication. It is a new version of SFTR in order to support 1024 bits of local_port. Add SFTR-V2 register and use it instead of SFTR. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit f8538aec88b46642553a9ba9efa0952f5958dbed Author: Amit Cohen Date: Wed Dec 1 10:12:38 2021 +0200 mlxsw: Add support for more than 256 ports in SBSR register Add 'port_page' field in SBSR to be able to query occupancy of more than 256 ports. The field determines the range of the ports specified in the 'ingress_port_mask' and 'egress_port_mask' bit masks: >From '256 * port_page' to '256 * port_page + 255'. For each local port, the appropriate port page is used. A query is never performed for a port range that spans multiple port pages. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit c934757d90000a9d3779d2b436a70e3d060ef693 Author: Amit Cohen Date: Wed Dec 1 10:12:37 2021 +0200 mlxsw: Use u16 for local_port field instead of u8 Currently, local_port field is saved as u8, which means that maximum 256 ports can be used. As preparation for Spectrum-4, which will support more than 256 ports, local_port field should be extended. Save local_port as u16 to allow use of additional ports. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 242e696e035fca96e972773023f20adfba124d10 Author: Amit Cohen Date: Wed Dec 1 10:12:36 2021 +0200 mlxsw: reg: Adjust PPCNT register to support local port 255 Local port 255 has a special meaning in PPCNT register, it is used to refer to all local ports. This wild card ability is not currently used by the driver. Special casing local port 255 in Spectrum-4 systems where it is a valid port is going to be a problem. Work around this issue by adding and always setting the 'lp_gl' bit which instructs the device's firmware to treat this local port like an ordinary port. Signed-off-by: Amit Cohen Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit da56f1a0d2a5ebe19b475342485e6d22aea6fc67 Author: Amit Cohen Date: Wed Dec 1 10:12:35 2021 +0200 mlxsw: reg: Increase 'port_num' field in PMTDB register 'port_num' field is used to indicate the local port value which can be assigned to a module. Increase the field from 8 bits to 10 bits in order to support more than 255 ports. Signed-off-by: Amit Cohen Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit fd24b29a1b7412e7707aec093e3805946ec17fa3 Author: Amit Cohen Date: Wed Dec 1 10:12:34 2021 +0200 mlxsw: reg: Align existing registers to use extended local_port field Add support for 10-bit local ports in device registers by making use of the MLXSW_ITEM32_LP() macro that was added in the previous patch. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit fda39347d90f42dafaec5e8ed7490e8054e8dcad Author: Amit Cohen Date: Wed Dec 1 10:12:33 2021 +0200 mlxsw: item: Add support for local_port field in a split form Currently, local_port field uses 8 bits, which means that maximum 256 ports can be used. As preparation for the next ASIC, which will support more than 256 ports, local_port field should be extended to 10 bits. It is not possible to use 10 consecutive bits in all registers, and therefore, the field is split into 2 fields: 1. local_port - the existing 8 bits, represent LSB of the extended field. 2. lp_msb - extra 2 bits, represent MSB of the extended field. To avoid complex programming when reading/writing local_port, add a dedicated macro which creates get and set functions which handle both parts of local_port. Signed-off-by: Amit Cohen Reviewed-by: Jiri Pirko Reviewed-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit b25dea489b55a54d6ede2d9836c84ef2f50210fc Author: Amit Cohen Date: Wed Dec 1 10:12:32 2021 +0200 mlxsw: reg: Remove unused functions The functions mlxsw_reg_sfd_uc_unpack() and mlxsw_reg_sfd_uc_lag_unpack() are not used. Remove them. Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 2cb310dc4402d259fa58ce8644c0827c4fedc47f Author: Amit Cohen Date: Wed Dec 1 10:12:31 2021 +0200 mlxsw: spectrum: Bump minimum FW version to xx.2010.1006 Add latest verified version of Nvidia Spectrum-family switch firmware, for Spectrum (13.2010.1006), Spectrum-2 (29.2010.1006) and Spectrum-3 (30.2010.1006). Signed-off-by: Amit Cohen Reviewed-by: Petr Machata Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit 8c659fdab06a4967f8c5cc754b407b0165a53865 Merge: 749c69400a458 64430f70ba6fc Author: David S. Miller Date: Wed Dec 1 14:46:03 2021 +0000 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-11-30 This series contains updates to iavf driver only. Patryk adds a debug message when MTU is changed. Grzegorz adds messaging when transitioning in and out of multicast promiscuous mode. Jake returns correct error codes for iavf_parse_cls_flower(). Jedrzej adds messaging for when the driver is removed and refactors struct usage to take less memory. He also adjusts ethtool statistics to only display information on active queues. Tony allows for user to specify the RSS hash. Karen resolves some static analysis warnings, corrects format specifiers, and rewords a message to come across as informational. v2: - Dropped patch 1 (for net) and 5 - Change MTU message from info to debug ==================== Signed-off-by: David S. Miller commit 749c69400a4584484a3e09e6c27e3de331e94693 Merge: b8a841a9da742 244714da8d5d0 Author: David S. Miller Date: Wed Dec 1 14:42:23 2021 +0000 Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== 100GbE Intel Wired LAN Driver Updates 2021-11-30 This series contains updates to ice driver only. Shiraz corrects assignment of boolean variable and removes an unused enum. ==================== Signed-off-by: David S. Miller commit b8a841a9da74283537dad6ab8d938da26aeb0656 Merge: 23ea630f86c70 f51b5e2b5943d Author: David S. Miller Date: Wed Dec 1 14:41:02 2021 +0000 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-11-30 Jesper Dangaard Brouer says: Changes to fix and enable XDP metadata to a specific Intel driver igc. Tested with hardware i225 that uses driver igc, while testing AF_XDP access to metadata area. ==================== Signed-off-by: David S. Miller commit c03edf1c0fc8648ab2f3f81ce1c00fff5fe7f69b Author: Janne Grunau Date: Tue Nov 23 23:49:25 2021 +0100 arm64: dts: apple: t8103: Add cd321x nodes All M1 Mac devices have 2 SoC connected USB-C ports and use cd321x USB type C port switch and power deliver controllers. I2c bus and addresses configuration are for all devices equal. The iMac (24-inch, 2021) has a configuration with 2 additional USB-C ports (j456) using two additional cd321x controllers. Signed-off-by: Janne Grunau Reviewed-by: Sven Peter Tested-by: Hector Martin Signed-off-by: Hector Martin commit 90458f6eec42aafb7688eca0ec1d3c00adc31fb7 Author: Janne Grunau Date: Tue Nov 23 23:49:24 2021 +0100 arm64: dts: apple: t8103: Add i2c nodes Apple M1 has at least 5 i2c controllers. i2c0, i2c1 and i2c3 are used on all M1 Mac devices. The 2020 Mac Mini uses i2c2 and the 13-inch MacBook Pro uses i2c2 and i2c4. Signed-off-by: Janne Grunau Reviewed-by: Sven Peter Tested-by: Hector Martin Signed-off-by: Hector Martin commit 7c77ab91b33d2ef06c4f3eab633ceed8e7bfedcc Author: Janne Grunau Date: Tue Nov 23 23:49:23 2021 +0100 arm64: dts: apple: Add missing M1 (t8103) devices This adds support for following Apple M1 devices: - MacBook Pro (13-inch, M1, 2020) - MacBook Air (M1, 2020) - iMac (24-inch 2021) Reviewed-by: Mark Kettenis Signed-off-by: Janne Grunau Tested-by: Hector Martin Signed-off-by: Hector Martin commit ad1569476e7644ac5754ac9a710ce771a7b4976f Author: Janne Grunau Date: Tue Nov 23 23:49:22 2021 +0100 dt-bindings: arm: apple: Add iMac (24-inch 2021) to Apple bindings This introduces compatible strings for both 2021 Apple iMac M1 devices: * apple,j456 - iMac (24-inch, 4x USB-C, M1, 2021) * apple,j457 - iMac (24-inch, 2x USB-C, M1, 2021) Reviewed-by: Mark Kettenis Signed-off-by: Janne Grunau Tested-by: Hector Martin Acked-by: Rob Herring Signed-off-by: Hector Martin commit e9d7c323cfbbd07c365a419b4ce3dc2f161442c7 Author: Pratyush Yadav Date: Tue Nov 9 23:49:11 2021 +0530 dt-bindings: mtd: spi-nor: Add a reference to spi-peripheral-props.yaml The spi-peripheral-props.yaml schema contains peripheral-specific properties for SPI controllers that should be present in the peripheral node. Add a reference to that so its constraints are followed. additionalProperties: false cannot be used since it marks the controller properties as unknown. Use unevaluatedProperties: false instead. This has the side effect of allowing extra properties that are not specified in the schema. The alternative is to list all the controller properties in this schema but that would mean every peripheral binding would have to repeat the same set of properties for each controller. Signed-off-by: Pratyush Yadav Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211109181911.2251-4-p.yadav@ti.com Signed-off-by: Mark Brown commit b6bdc6e043906c70e949b2747772e6aa1d36f2a3 Author: Pratyush Yadav Date: Tue Nov 9 23:49:10 2021 +0530 spi: dt-bindings: cdns,qspi-nor: Move peripheral-specific properties out The spi-peripheral-props.yaml schema contains peripheral-specific properties for SPI controllers that should be present in the peripheral node. Move peripheral-specific properties to a separate file and refer to it in spi-peripheral-props.yaml. Signed-off-by: Pratyush Yadav Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211109181911.2251-3-p.yadav@ti.com Signed-off-by: Mark Brown commit 8762b07c95c18fbbe1c6b3eb1e8e686091c346b5 Author: Pratyush Yadav Date: Tue Nov 9 23:49:09 2021 +0530 spi: dt-bindings: add schema listing peripheral-specific properties Many SPI controllers need to add properties to peripheral devices. This could be the delay in clock or data lines, etc. These properties are controller specific but need to be defined in the peripheral node because they are per-peripheral and there can be multiple peripherals attached to a controller. If these properties are not added to the peripheral binding, then the dtbs check emits a warning. But these properties do not make much sense in the peripheral binding because they are controller-specific and they will just pollute every peripheral binding. So this binding is added to collect all such properties from all such controllers. Peripheral bindings should simply refer to this binding and they should be rid of the warnings. There are some limitations with this approach. Firstly, there is no way to specify required properties. The schema contains properties for all controllers and there is no way to know which controller is being used. Secondly, there is no way to restrict additional properties. Since this schema will be used with an allOf operator, additionalProperties needs to be true. In addition, the peripheral schema will have to set unevaluatedProperties: false. Despite these limitations, this appears to be the best solution to this problem that doesn't involve modifying existing tools or schema specs. Signed-off-by: Pratyush Yadav Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211109181911.2251-2-p.yadav@ti.com Signed-off-by: Mark Brown commit d69e19723f88a3ba6d4e0e52f51dd4c59cc2ae93 Author: Vinod Koul Date: Wed Dec 1 12:55:15 2021 +0530 regulator: qcom-rpmh: Add support for PM8450 regulators Add the rpmh regulators found in PM8450 PMIC Signed-off-by: Vinod Koul Tested-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20211201072515.3968843-3-vkoul@kernel.org Signed-off-by: Mark Brown commit fa3b06f59a03a3a4639755478e0cf5b508a1b454 Author: Vinod Koul Date: Wed Dec 1 12:55:14 2021 +0530 regulator: qcom,rpmh: Add compatible for PM8450 Add compatible string for PM8450 used in SM8450 boards. Signed-off-by: Vinod Koul Link: https://lore.kernel.org/r/20211201072515.3968843-2-vkoul@kernel.org Signed-off-by: Mark Brown commit b80155fe61a76784273c2e7b8b15ae8249eb7440 Author: Srinivas Kandagatla Date: Tue Nov 30 16:05:05 2021 +0000 ASoC: codecs: wcd934x: remove redundant ret variable return value form snd_soc_dapm_put_enum_double() directly instead of taking this in another redundant variable. Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20211130160507.22180-3-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit 0d242698fa693ab8cb98c11ba7cf7fc8f7242c0b Author: Sameer Pujar Date: Tue Nov 30 18:53:25 2021 +0530 ASoC: tegra: Add master volume/mute control support The MVC module has a per channel control bit, based on which it decides to apply channel specific volume/mute settings. When per channel control bit is enabled (which is the default HW configuration), all MVC channel volume/mute can be independently controlled. If the control is disabled, channel-0 volume/mute setting is applied by HW to all remaining channels. Thus add support to leverage this HW feature by exposing master controls for volume/mute. With this, now there are per channel and master volume/mute controls. Users need to just use controls which are suitable for their applications. The per channel control enable/disable is mananged in driver and hidden from users, so that they need to just worry about respective volume/mute controls. Signed-off-by: Sameer Pujar Link: https://lore.kernel.org/r/1638278605-28225-1-git-send-email-spujar@nvidia.com Signed-off-by: Mark Brown commit 67140b64b68395b79177efcd16a7530ed5311e49 Merge: f316c9d9ba8ea 046aede2f8476 Author: Mark Brown Date: Wed Dec 1 14:15:12 2021 +0000 Merge branch 'for-5.16' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.17 so we can apply new Tegra work commit 8dce88fe80a858f34bb5b46470218fe478d251ee Author: Sin Hui Kho Date: Wed Dec 1 18:13:53 2021 +0800 arm64: dts: Update NAND MTD partition for Agilex and Stratix 10 Change NAND flash MTD partition in device tree after implementation of UBI and UBIFS. "u-boot" partition remain for raw u-boot image, but "root" partition is use for UBI image containing all other components. Signed-off-by: Sin Hui Kho Signed-off-by: Dinh Nguyen commit 7e508f2ca8bbda8cabbd4753bc727a7f66837a12 Author: Huang Jianan Date: Sat Nov 13 00:09:33 2021 +0800 erofs: rename lz4_0pading to zero_padding Renaming lz4_0padding to zero_padding globally since LZMA and later algorithms also need that. Link: https://lore.kernel.org/r/20211112160935.19394-1-jnhuang95@gmail.com Reviewed-by: Chao Yu Signed-off-by: Huang Jianan Signed-off-by: Gao Xiang commit e1610431b95ccbada74e1393b0944ef4c2750624 Author: Andy Shevchenko Date: Tue Nov 30 18:49:56 2021 +0200 gpio: dwapb: clarify usage of the register file version First of all, it's obvious that different versions can't be provided simultaneously. Hence, versions can't be bit masks. Second, due to above we have to mask out the version field in the flags and only that can be evaluated against the certain version. Clarify all above by: - introducing GPIO_REG_OFFSET_V1 and GPIO_REG_OFFSET_MASK - replacing conditional to mask out bits and compare to a version Luckily there is no functional change, so no need to backport this. Signed-off-by: Andy Shevchenko Acked-by: Serge Semin Reviewed-by: Bartosz Golaszewski commit 00e228b31596c6bf5f08b5ef76f80cb26e620f02 Author: Marc Zyngier Date: Fri Nov 26 11:36:43 2021 +0000 KVM: arm64: Add minimal handling for the ARMv8.7 PMU When running a KVM guest hosted on an ARMv8.7 machine, the host kernel complains that it doesn't know about the architected number of events. Fix it by adding the PMUver code corresponding to PMUv3 for ARMv8.7. Reviewed-by: Alexandru Elisei Tested-by: Alexandru Elisei Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20211126115533.217903-1-maz@kernel.org commit 7bc14ff2952da56d445efab50256569fc96aa95b Author: Bjorn Helgaas Date: Tue Nov 30 16:08:41 2021 -0600 gpio: ml-ioh: Change whitespace to match gpio-pch.c The ML IOH driver is very similar to the PCH driver. To make it more similar, tweak the whitespace in ioh_gpio_direction_output() and ioh_gpio_direction_input(). No functional change intended. Signed-off-by: Bjorn Helgaas Signed-off-by: Andy Shevchenko commit 46155a0c55eb9c64da619e4f3a03537f47fbe583 Author: Bjorn Helgaas Date: Tue Nov 30 16:08:40 2021 -0600 gpio: ml-ioh: Use BIT() to match gpio-pch.c The ML IOH driver is very similar to the PCH driver. To make it more similar, replace "1 << nr" with "BIT(nr)". No functional change intended. Signed-off-by: Bjorn Helgaas Signed-off-by: Andy Shevchenko commit 06939f22ae5f7abf80d9a6ff5e43b4a916256f44 Author: Bjorn Helgaas Date: Tue Nov 30 16:08:39 2021 -0600 gpio: ml-ioh: Cache &pdev->dev to reduce repetition ioh_gpio_probe() repeats the "&pdev->dev" expression several times. Cache the result as "struct device *dev" to reduce the repetition. No functional change intended. Signed-off-by: Bjorn Helgaas Signed-off-by: Andy Shevchenko commit 2822b02765ed0609825d3532ea15de3914b59f09 Author: Bjorn Helgaas Date: Tue Nov 30 16:08:38 2021 -0600 gpio: pch: Cache &pdev->dev to reduce repetition pch_gpio_probe() repeats the "&pdev->dev" expression several times. Cache the result as "struct device *dev" to reduce the repetition. No functional change intended. Signed-off-by: Bjorn Helgaas Signed-off-by: Andy Shevchenko commit 82b2cd4c8caebf0b61b39daf5e0ed6be170a4ae1 Author: Bjorn Helgaas Date: Tue Nov 30 16:08:37 2021 -0600 gpio: pch: Use .driver_data instead of checking Device IDs again Previously, pch_gpio_probe() tested the Device ID to determine the type of IOH. But the driver core has already matched the Device ID with one of the IDs in the pch_gpio_pcidev_id[] table, and we can supply the IOH type there as .driver_data. Use the pci_device_id.driver_data to learn the IOH type instead of testing the Device ID again. No functional change intended. Signed-off-by: Bjorn Helgaas Signed-off-by: Andy Shevchenko commit 96894b79596756d71a3e6af5ae6fc5238e058e77 Author: Rikard Falkeborn Date: Sun Nov 28 21:19:16 2021 +0100 drm/etnaviv: constify static struct cooling_ops The only usage of cooling_ops is to pass its address to thermal_of_cooling_device_register(), which takes a pointer to const struct thermal_cooling_device_ops as input. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn Reviewed-by: Christian Gmeiner Signed-off-by: Lucas Stach commit f5be833dc86f49637b65b7989a9ee49ac08f7da6 Author: Michael Walle Date: Tue Sep 7 18:49:45 2021 +0200 drm/etnaviv: use a 32 bit mask as coherent DMA mask The STLB and the first command buffer (which is used to set up the TLBs) has a 32 bit size restriction in hardware. There seems to be no way to specify addresses larger than 32 bit. Keep it simple and restict the addresses to the lower 4 GiB range for all coherent DMA memory allocations. Please note, that platform_device_alloc() will initialize dev->dma_mask to point to pdev->platform_dma_mask, thus dma_set_mask() will work as expected. While at it, move the dma_mask setup code to the of_dma_configure() to keep all the DMA setup code next to each other. Suggested-by: Lucas Stach Signed-off-by: Michael Walle Signed-off-by: Lucas Stach commit 0ea057a9cb2be406b104b92ab4d8e246276e3fb8 Author: Michael Walle Date: Tue Sep 7 18:49:44 2021 +0200 drm/etnaviv: fix dma configuration of the virtual device The DMA configuration of the virtual device is inherited from the first actual etnaviv device. Unfortunately, this doesn't work with an IOMMU: [ 5.191008] Failed to set up IOMMU for device (null); retaining platform DMA ops This is because there is no associated iommu_group with the device. The group is set in iommu_group_add_device() which is eventually called by device_add() via the platform bus: device_add() blocking_notifier_call_chain() iommu_bus_notifier() iommu_probe_device() __iommu_probe_device() iommu_group_get_for_dev() iommu_group_add_device() Move of_dma_configure() into the probe function, which is called after device_add(). Normally, the platform code will already call it itself if .of_node is set. Unfortunately, this isn't the case here. Signed-off-by: Michael Walle Signed-off-by: Lucas Stach commit 3c7e0ccc946c01e33ee5fb5a7991f0f396348e5a Author: Michael Walle Date: Tue Sep 7 18:49:43 2021 +0200 drm/etnaviv: use PLATFORM_DEVID_NONE There is already a macro for the magic value. Use it. Signed-off-by: Michael Walle Reviewed-by: Christian Gmeiner Signed-off-by: Lucas Stach commit 2d761dbf7ff48b7eca4486658c5995b9669bcbbc Merge: e525523c19892 31aa126de88e1 Author: Marc Zyngier Date: Wed Dec 1 12:13:44 2021 +0000 Merge branch kvm-arm64/fpsimd-tracking into kvmarm-master/next * kvm-arm64/fpsimd-tracking: : . : Simplify the handling of both the FP/SIMD and SVE state by : removing the need for mapping the thread at EL2, and by : dropping the tracking of the host's SVE state which is : always invalid by construction. : . arm64/fpsimd: Document the use of TIF_FOREIGN_FPSTATE by KVM KVM: arm64: Stop mapping current thread_info at EL2 KVM: arm64: Introduce flag shadowing TIF_FOREIGN_FPSTATE KVM: arm64: Remove unused __sve_save_state KVM: arm64: Get rid of host SVE tracking/saving KVM: arm64: Reorder vcpu flag definitions Signed-off-by: Marc Zyngier commit 6aab5622296b990024ee67dd7efa7d143e7558d0 Author: Nirmal Patel Date: Tue Nov 16 15:11:36 2021 -0700 PCI: vmd: Clean up domain before enumeration During VT-d pass-through, the VMD driver occasionally fails to enumerate underlying NVMe devices when repetitive reboots are performed in the guest OS. The issue can be resolved by resetting VMD root ports for proper enumeration and triggering secondary bus reset which will also propagate reset through downstream bridges. Link: https://lore.kernel.org/r/20211116221136.85134-1-nirmal.patel@linux.intel.com Signed-off-by: Nirmal Patel Signed-off-by: Lorenzo Pieralisi Reviewed-by: Jon Derrick commit 92e1764787e57417b8890db0f154c0f405548cdd Author: Heiner Kallweit Date: Sun Nov 28 19:14:50 2021 +0100 eeprom: at24: remove struct at24_client We use member client only to get a reference to the associated struct device, via &client->dev. However we can get the same reference from the associated regmap, via regmap_get_device(regmap). Therefore struct at24_client can be removed and replaced with a regmap pointer. Signed-off-by: Heiner Kallweit Signed-off-by: Bartosz Golaszewski commit e525523c198921161d3ba17dfab1bd3aef2ed3bc Merge: d58071a8a76d7 cc5705fb1bf11 Author: Marc Zyngier Date: Wed Dec 1 11:52:20 2021 +0000 Merge branch kvm-arm64/vcpu-first-run into kvmarm-master/next * kvm-arm64/vcpu-first-run: : Rework the "vcpu first run" sequence to be driven by KVM's : "PID change" callback, removing the need for extra state. KVM: arm64: Drop vcpu->arch.has_run_once for vcpu->pid KVM: arm64: Merge kvm_arch_vcpu_run_pid_change() and kvm_vcpu_first_run_init() KVM: arm64: Restructure the point where has_run_once is advertised KVM: arm64: Move kvm_arch_vcpu_run_pid_change() out of line KVM: arm64: Move SVE state mapping at HYP to finalize-time Signed-off-by: Marc Zyngier commit cc5705fb1bf119ebb693d594f0157e0dd418590e Author: Marc Zyngier Date: Thu Oct 14 12:13:06 2021 +0100 KVM: arm64: Drop vcpu->arch.has_run_once for vcpu->pid With the transition to kvm_arch_vcpu_run_pid_change() to handle the "run once" activities, it becomes obvious that has_run_once is now an exact shadow of vcpu->pid. Replace vcpu->arch.has_run_once with a new vcpu_has_run_once() helper that directly checks for vcpu->pid, and get rid of the now unused field. Reviewed-by: Andrew Jones Signed-off-by: Marc Zyngier commit b5aa368abfbf4c0e041c792e3340955554eff97e Author: Marc Zyngier Date: Thu Oct 14 11:42:38 2021 +0100 KVM: arm64: Merge kvm_arch_vcpu_run_pid_change() and kvm_vcpu_first_run_init() The kvm_arch_vcpu_run_pid_change() helper gets called on each PID change. The kvm_vcpu_first_run_init() helper gets run on the... first run(!) of a vcpu. As it turns out, the first run of a vcpu also triggers a PID change event (vcpu->pid is initially NULL). Use this property to merge these two helpers and get rid of another arm64-specific oddity. Reviewed-by: Andrew Jones Signed-off-by: Marc Zyngier commit 1408e73d21feffe77680acd4da611295db0dfcd8 Author: Marc Zyngier Date: Thu Oct 14 12:18:48 2021 +0100 KVM: arm64: Restructure the point where has_run_once is advertised Restructure kvm_vcpu_first_run_init() to set the has_run_once flag after having completed all the "run once" activities. This includes moving the flip of the userspace irqchip static key to a point where nothing can fail. Reviewed-by: Andrew Jones Signed-off-by: Marc Zyngier commit 052f064d42b7bac87cbcd140710f262c5f1c3c8b Author: Marc Zyngier Date: Thu Oct 14 11:30:42 2021 +0100 KVM: arm64: Move kvm_arch_vcpu_run_pid_change() out of line Having kvm_arch_vcpu_run_pid_change() inline doesn't bring anything to the table. Move it next to kvm_vcpu_first_run_init(), which will be convenient for what is next to come. Reviewed-by: Andrew Jones Signed-off-by: Marc Zyngier commit bff01a61af3c8b9756940c2fb0be2af570cdb5bf Author: Marc Zyngier Date: Thu Oct 14 10:24:48 2021 +0100 KVM: arm64: Move SVE state mapping at HYP to finalize-time We currently map the SVE state to HYP on detection of a PID change. Although this matches what we do for FPSIMD, this is pretty pointless for SVE, as the buffer is per-vcpu and has nothing to do with the thread that is being run. Move the mapping of the SVE state to finalize-time, which is where we allocate the state memory, and thus the most logical place to do this. Reviewed-by: Andrew Jones Signed-off-by: Marc Zyngier commit 8e7daf318d97f25e18b2fc7eb5909e34cd903575 Author: Bixuan Cui Date: Wed Dec 1 16:58:54 2021 +0800 ALSA: oss: fix compile error when OSS_DEBUG is enabled Fix compile error when OSS_DEBUG is enabled: sound/core/oss/pcm_oss.c: In function 'snd_pcm_oss_set_trigger': sound/core/oss/pcm_oss.c:2055:10: error: 'substream' undeclared (first use in this function); did you mean 'csubstream'? pcm_dbg(substream->pcm, "pcm_oss: trigger = 0x%x\n", trigger); ^ Fixes: 61efcee8608c ("ALSA: oss: Use standard printk helpers") Signed-off-by: Bixuan Cui Link: https://lore.kernel.org/r/1638349134-110369-1-git-send-email-cuibixuan@linux.alibaba.com Signed-off-by: Takashi Iwai commit 0a62b3cc0af9322e650fe89bea0bacdedf01960a Author: Jerome Brunet Date: Tue Nov 30 11:01:59 2021 +0100 arm64: dts: meson: p241: add sound support Add the p241 sound card support. This board can play audio through HDMI and the internal DAC. Signed-off-by: Jerome Brunet Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20211130100159.214489-3-jbrunet@baylibre.com commit 75fb3b1be53c85901d45ddb7cc2db6967876b99e Author: Jerome Brunet Date: Tue Nov 30 11:01:58 2021 +0100 arm64: dts: meson: p241: add vcc_5v regulator Add the VCC_5V regulator, which feeds the HDMI, USB and audio amplifier. Signed-off-by: Jerome Brunet Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20211130100159.214489-2-jbrunet@baylibre.com commit 61f0aa4da397bdb00907c95ae21ef27090137409 Author: Christophe JAILLET Date: Sun Nov 7 11:04:43 2021 +0100 PCI: xilinx-nwl: Simplify code and fix a memory leak Allocate space for bitmap in struct nwl_msi at probe time instead of dynamically allocating the memory at runtime. This simplifies code (especially error handling paths) and avoid some open-coded arithmetic in allocator arguments. This also fixes a potential memory leak. The bitmap was never freed. It is now part of a managed resource. Link: https://lore.kernel.org/r/5483f10a44b06aad55728576d489adfa16c3be91.1636279388.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET Signed-off-by: Lorenzo Pieralisi Reviewed-by: Krzysztof Wilczyński commit 49a8bf50caa2fb0fb2eb1c89923ea61192227c32 Author: Zhou Qingyang Date: Tue Nov 30 22:15:44 2021 +0800 drm/i915/gem: Fix a NULL pointer dereference in igt_request_rewind() In igt_request_rewind(), mock_context(i915, "A") is assigned to ctx[0] and used in i915_gem_context_get_engine(). There is a dereference of ctx[0] in i915_gem_context_get_engine(), which could lead to a NULL pointer dereference on failure of mock_context(i915, "A") . So as mock_context(i915, "B"). Although this bug is not serious for it belongs to testing code, it is better to be fixed to avoid unexpected failure in testing. Fix this bugs by adding checks about ctx[0] and ctx[1]. This bug was found by a static analyzer. The analysis employs differential checking to identify inconsistent security operations (e.g., checks or kfrees) between two code paths and confirms that the inconsistent operations are not recovered in the current function or the callers, so they constitute bugs. Note that, as a bug found by static analysis, it can be a false positive or hard to trigger. Multiple researchers have cross-reviewed the bug. Builds with CONFIG_DRM_I915_SELFTEST=y show no new warnings, and our static analyzer no longer warns about this code. References: 591c0fb85d1c ("drm/i915: Exercise request cancellation using a mock selftest") [tursulin: Replaced fixes with references to avoid.] Signed-off-by: Zhou Qingyang Reviewed-by: Tvrtko Ursulin Signed-off-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20211130141545.153899-1-zhou1615@umn.edu commit cca084692394ad2733995241866fbb4b1b8668bc Author: Tvrtko Ursulin Date: Fri Nov 26 14:14:24 2021 +0000 drm/i915: Use per device iommu check With both integrated and discrete Intel GPUs in a system, the current global check of intel_iommu_gfx_mapped, as done from intel_vtd_active() may not be completely accurate. In this patch we add i915 parameter to intel_vtd_active() in order to prepare it for multiple GPUs and we also change the check away from Intel specific intel_iommu_gfx_mapped (global exported by the Intel IOMMU driver) to probing the presence of IOMMU on a specific device using device_iommu_mapped(). This will return true both for IOMMU pass-through and address translation modes which matches the current behaviour. If in the future we wanted to distinguish between these two modes we could either use iommu_get_domain_for_dev() and check for __IOMMU_DOMAIN_PAGING bit indicating address translation, or ask for a new API to be exported from the IOMMU core code. v2: * Check for dmar translation specifically, not just iommu domain. (Baolu) v3: * Go back to plain "any domain" check for now, rewrite commit message. v4: * Use device_iommu_mapped. (Robin, Baolu) Signed-off-by: Tvrtko Ursulin Cc: Lu Baolu Cc: Lucas De Marchi Cc: Robin Murphy Acked-by: Robin Murphy Reviewed-by: Lu Baolu Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20211126141424.493753-1-tvrtko.ursulin@linux.intel.com commit c7c90b0b8418a97d3aa8b39aae1992908948efad Author: Lyude Paul Date: Tue Nov 30 16:29:09 2021 -0500 drm/i915/dp: Perform 30ms delay after source OUI write While working on supporting the Intel HDR backlight interface, I noticed that there's a couple of laptops that will very rarely manage to boot up without detecting Intel HDR backlight support - even though it's supported on the system. One example of such a laptop is the Lenovo P17 1st generation. Following some investigation Ville Syrjälä did through the docs they have available to them, they discovered that there's actually supposed to be a 30ms wait after writing the source OUI before we begin setting up the rest of the backlight interface. This seems to be correct, as adding this 30ms delay seems to have completely fixed the probing issues I was previously seeing. So - let's start performing a 30ms wait after writing the OUI, which we do in a manner similar to how we keep track of PPS delays (e.g. record the timestamp of the OUI write, and then wait for however many ms are left since that timestamp right before we interact with the backlight) in order to avoid waiting any longer then we need to. As well, this also avoids us performing this delay on systems where we don't end up using the HDR backlight interface. V3: * Move last_oui_write into intel_dp V2: * Move panel delays into intel_pps Signed-off-by: Lyude Paul Reviewed-by: Jani Nikula Fixes: 4a8d79901d5b ("drm/i915/dp: Enable Intel's HDR backlight interface (only SDR for now)") Cc: Ville Syrjälä Cc: # v5.12+ Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20211130212912.212044-1-lyude@redhat.com commit 4f45348934074553681a8964bae740a22599cf2e Author: Geert Uytterhoeven Date: Thu Nov 25 16:20:43 2021 +0100 dt-bindings: gpio: sifive,gpio: Group interrupt tuples To improve human readability and enable automatic validation, the tuples in "interrupts" properties should be grouped using angle brackets. Signed-off-by: Geert Uytterhoeven Acked-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit ac1077e92825bb0ffeee8550a41771df772214ce Author: Jean Sacren Date: Tue Nov 30 00:03:12 2021 -0700 net: xfrm: drop check of pols[0] for the second time !pols[0] is checked earlier. If we don't return, pols[0] is always true. We should drop the check of pols[0] for the second time and the binary is also smaller. Before: text data bss dec hex filename 48395 957 240 49592 c1b8 net/xfrm/xfrm_policy.o After: text data bss dec hex filename 48379 957 240 49576 c1a8 net/xfrm/xfrm_policy.o Signed-off-by: Jean Sacren Signed-off-by: Steffen Klassert commit 145988cff2a10ec8c720eccdcfc94748f497cd8d Author: Jernej Skrabec Date: Mon Nov 29 17:55:10 2021 +0100 ARM: dts: sun8i: Adjust power key nodes Several H3 and one H2+ board have power key nodes, which are slightly off. Some are missing wakeup-source property and some have BTN_0 code assigned instead of KEY_POWER. Adjust them, so they can function as intended by designer. Co-developed-by: Michael Klein Signed-off-by: Michael Klein Signed-off-by: Jernej Skrabec Acked-by: Chen-Yu Tsai Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20211129165510.370717-1-jernej.skrabec@gmail.com commit b0293c19d42f6d6951c2fab9a47fed50baf2c14d Author: Dmitry Baryshkov Date: Wed Dec 1 05:05:59 2021 +0300 arm64: dts: qcom: msm8916: fix MMC controller aliases Change sdhcN aliases to mmcN to make them actually work. Currently the board uses non-standard aliases sdhcN, which do not work, resulting in mmc0 and mmc1 hosts randomly changing indices between boots. Fixes: c4da5a561627 ("arm64: dts: qcom: Add msm8916 sdhci configuration nodes") Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211201020559.1611890-1-dmitry.baryshkov@linaro.org commit 556a9f3ae17ef19deecac130fea38f258d5abeb2 Author: Martin Botka Date: Tue Nov 30 22:23:32 2021 +0100 arm64: dts: qcom: sm6125: Add power domains to sdhc Add RPM Power Domains to internal eMMC and SDCard. Signed-off-by: Martin Botka Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211130212332.25401-4-martin.botka@somainline.org commit d0bfc92303dde7f13fac1873c25a3bee913bfef3 Author: Martin Botka Date: Tue Nov 30 22:23:31 2021 +0100 arm64: dts: qcom: sm6125: Add RPMPD node Add RPM Power Distribution node for sm6125 SoC. Signed-off-by: Martin Botka Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211130212332.25401-3-martin.botka@somainline.org commit 3ebf11fa4a355116eb2a69a46114ec92f245dbcc Author: Kshitiz Godara Date: Mon Nov 29 17:01:37 2021 +0530 arm64: dts: qcom: sc7280-crd: Add Touchscreen and touchpad support Add Touchscreen and touchpad hid-over-i2c node for the sc7280 CRD board Signed-off-by: Kshitiz Godara Signed-off-by: Rajendra Nayak Reviewed-by: Matthias Kaehlcke Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1638185497-26477-5-git-send-email-quic_rjendra@quicinc.com commit 248da168fbae5ab7294a37428256acc570ed552a Author: Kshitiz Godara Date: Mon Nov 29 17:01:36 2021 +0530 arm64: dts: qcom: sc7280: Define EC and H1 nodes for IDP/CRD The IDP2 and CRD boards share the EC and H1 parts, so define all related device nodes into a common file and include them in the idp2 and crd dts files to avoid duplication. Signed-off-by: Kshitiz Godara Signed-off-by: Rajendra Nayak Reviewed-by: Matthias Kaehlcke Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1638185497-26477-4-git-send-email-quic_rjendra@quicinc.com commit 427b249504ea48e9af2014df4b22fe8b31ddb563 Author: Rajendra Nayak Date: Mon Nov 29 17:01:35 2021 +0530 arm64: dts: qcom: sc7280-crd: Add device tree files for CRD CRD (Compute Reference Design) is a sc7280 based board, largely derived from the existing IDP board design with some key deltas 1. has EC and H1 over SPI similar to IDP2 2. touchscreen and trackpad support 3. eDP display We just add the barebones dts file here, subsequent patches will add support for EC/H1 and other components. Signed-off-by: Rajendra Nayak Reviewed-by: Matthias Kaehlcke Tested-by: Matthias Kaehlcke Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1638185497-26477-3-git-send-email-quic_rjendra@quicinc.com commit 7a21328bb3ade238e35c4de81da3ad8d76437b72 Author: Rajendra Nayak Date: Mon Nov 29 17:01:34 2021 +0530 dt-bindings: arm: qcom: Document qcom,sc7280-crd board Document the qcom,sc7280-crd board based off sc7280 SoC, The board is also known as hoglin in the Chrome OS builds, so document the google,hoglin compatible as well. Signed-off-by: Rajendra Nayak Reviewed-by: Matthias Kaehlcke Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1638185497-26477-2-git-send-email-quic_rjendra@quicinc.com commit 95dcb997772e966919987b6dd96eb9a6212402eb Author: Dang Huynh Date: Tue Nov 23 23:24:37 2021 +0700 arm64: dts: qcom: Drop input-name property This property doesn't seem to exist in the documentation nor in source code, but for some reason it is defined in a bunch of device trees. Signed-off-by: Dang Huynh Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211123162436.1507341-1-danct12@riseup.net commit 1f7fe79d03b2ac0991c8a229ca50a9f45b71df80 Author: Manivannan Sadhasivam Date: Fri Nov 26 12:35:20 2021 +0530 ARM: dts: qcom: sdx55-t55: Enable IPA Enable IP Accelerator (IPA) on Thundercomm T55 board for getting data connectivity from modem. Signed-off-by: Manivannan Sadhasivam Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211126070520.28979-7-manivannan.sadhasivam@linaro.org commit e1fb17ee85bc85808eeb103afa63581d065c7328 Author: Manivannan Sadhasivam Date: Fri Nov 26 12:35:19 2021 +0530 ARM: dts: qcom: sdx55-fn980: Enable IPA Enable IP Accelerator (IPA) on Telit FN980 TLB for getting data connectivity from modem. Signed-off-by: Manivannan Sadhasivam Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211126070520.28979-6-manivannan.sadhasivam@linaro.org commit 7cecfb53cad8e9f564fdf11e56502c7d8607b3a3 Author: Manivannan Sadhasivam Date: Fri Nov 26 12:35:18 2021 +0530 ARM: dts: qcom: sdx55-fn980: Enable PCIe EP Enable PCIe Endpoint controller on the Telit FN980 TLB board based on Qualcomm SDX55 platform. Signed-off-by: Manivannan Sadhasivam Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211126070520.28979-5-manivannan.sadhasivam@linaro.org commit e6b69813283f9babc6892c1324d2c3bd2a577d9c Author: Manivannan Sadhasivam Date: Fri Nov 26 12:35:17 2021 +0530 ARM: dts: qcom: sdx55: Add support for PCIe EP Add support for PCIe Endpoint controller on the Qualcomm SDX55 platform. Signed-off-by: Manivannan Sadhasivam Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211126070520.28979-4-manivannan.sadhasivam@linaro.org commit a5a2661287b450f2b1f751ae7b4da4f39976571b Author: Manivannan Sadhasivam Date: Fri Nov 26 12:35:16 2021 +0530 ARM: dts: qcom: sdx55-fn980: Enable PCIE0 PHY Enable PCIE0 PHY on Telit FN980 TLB for PCIE EP. Signed-off-by: Manivannan Sadhasivam Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211126070520.28979-3-manivannan.sadhasivam@linaro.org commit 254a27585eb135f35887579ebc7d0e02b9788b92 Author: Manivannan Sadhasivam Date: Fri Nov 26 12:35:15 2021 +0530 ARM: dts: qcom: sdx55: Add support for PCIe PHY Add devicetree support for PCIe PHY used in SDX55 platform. This PHY is used by the PCIe EP controller. Signed-off-by: Manivannan Sadhasivam Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211126070520.28979-2-manivannan.sadhasivam@linaro.org commit 6867430332655cfb0880e0e7576ea4eb786d50fc Author: Dang Huynh Date: Mon Nov 22 00:04:49 2021 +0700 arm64: dts: qcom: sdm660-xiaomi-lavender: Add volume up button This enables the volume up key. Signed-off-by: Dang Huynh Tested-by: Alexey Minnekhanov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211121170449.1124048-1-danct12@riseup.net commit 1c0ac047bbfb3efd6549d18c3ca47aa0afedcfbe Author: Stephan Gerhold Date: Fri Nov 19 22:39:53 2021 +0100 arm64: dts: qcom: msm8916: Add RPM sleep stats MSM8916 is similar to the other SoCs that had the RPM stats node added in commit 290bc6846547 ("arm64: dts: qcom: Enable RPM Sleep stats"). However, the dynamic offset readable at 0x14 seems only available on some of the newer firmware versions. To be absolutely sure, make use of the new qcom,msm8916-rpm-stats compatible that reads the sleep stats from a fixed offset of 0xdba0. Statistics are available for a "vmin" and "xosd" low power mode: $ cat /sys/kernel/debug/qcom_stats/vmin Count: 0 Last Entered At: 0 Last Exited At: 0 Accumulated Duration: 0 Client Votes: 0x0 $ cat /sys/kernel/debug/qcom_stats/xosd Count: 0 Last Entered At: 0 Last Exited At: 0 Accumulated Duration: 0 Client Votes: 0x0 Cc: Maulik Shah Signed-off-by: Stephan Gerhold Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211119213953.31970-4-stephan@gerhold.net commit 8e0e8016cb797c38eea8641e8b77a5780c4614ac Author: Thara Gopinath Date: Wed Nov 10 16:53:30 2021 -0500 arm64: dts: qcom: sm8250: Add CPU opp tables Add OPP tables to scale DDR and L3 with CPUs for SM8250 SoCs. Signed-off-by: Thara Gopinath Reviewed-by: Dmitry Baryshkov Tested-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211110215330.74257-1-thara.gopinath@linaro.org commit 23ea630f86c70cbe6691f9f839e7b6742f0e9ad3 Author: Max Filippov Date: Tue Nov 30 06:36:00 2021 -0800 net: natsemi: fix hw address initialization for jazz and xtensa Use eth_hw_addr_set function instead of writing the address directly to net_device::dev_addr. Fixes: adeef3e32146 ("net: constify netdev->dev_addr") Signed-off-by: Max Filippov Acked-by: Randy Dunlap # build-tested Link: https://lore.kernel.org/r/20211130143600.31970-1-jcmvbkbc@gmail.com Signed-off-by: Jakub Kicinski commit 5cfe53cfeb1c05b73e5f2e09d7fe3140b17c1204 Author: Yang Yingliang Date: Tue Nov 30 11:12:43 2021 +0800 mctp: remove unnecessary check before calling kfree_skb() The skb will be checked inside kfree_skb(), so remove the outside check. Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20211130031243.768823-1-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski commit 44505168d7432f983bc31c5b2dce72bb4de98832 Author: Matthew Brost Date: Tue Nov 16 11:49:29 2021 -0800 drm/i915: Drop stealing of bits from i915_sw_fence function pointer Rather than stealing bits from i915_sw_fence function pointer use separate fields for function pointer and flags. If using two different fields, the 4 byte alignment for the i915_sw_fence function pointer can also be dropped. v2: (CI) - Set new function field rather than flags in __i915_sw_fence_init v3: (Tvrtko) - Remove BUG_ON(!fence->flags) in reinit as that will now blow up - Only define fence->flags if CONFIG_DRM_I915_SW_FENCE_CHECK_DAG is defined v4: - Rebase, resend for CI Signed-off-by: Matthew Brost Acked-by: Jani Nikula Reviewed-by: Alan Previn Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20211116194929.10211-1-matthew.brost@intel.com commit c438b7d860b4c1acb4ebff6d8d946d593ca5fe1e Author: Boqun Feng Date: Mon Oct 25 22:54:16 2021 +0800 tools/memory-model: litmus: Add two tests for unlock(A)+lock(B) ordering The memory model has been updated to provide a stronger ordering guarantee for unlock(A)+lock(B) on the same CPU/thread. Therefore add two litmus tests describing this new guarantee, these tests are simple yet can clearly show the usage of the new guarantee, also they can serve as the self tests for the modification in the model. Co-developed-by: Alan Stern Signed-off-by: Alan Stern Signed-off-by: Boqun Feng Acked-by: Peter Zijlstra (Intel) Signed-off-by: Paul E. McKenney commit b47c05ecf60bd8743ad8c0ee510d3e1c060529d7 Author: Boqun Feng Date: Mon Oct 25 22:54:15 2021 +0800 tools/memory-model: doc: Describe the requirement of the litmus-tests directory It's better that we have some "standard" about which test should be put in the litmus-tests directory because it helps future contributors understand whether they should work on litmus-tests in kernel or Paul's GitHub repo. Therefore explain a little bit on what a "representative" litmus test is. Signed-off-by: Boqun Feng Acked-by: Peter Zijlstra (Intel) Signed-off-by: Paul E. McKenney commit ddfe12944e84830fe7dc490992e55b4fa773555e Author: Boqun Feng Date: Mon Oct 25 22:54:14 2021 +0800 tools/memory-model: Provide extra ordering for unlock+lock pair on the same CPU A recent discussion[1] shows that we are in favor of strengthening the ordering of unlock + lock on the same CPU: a unlock and a po-after lock should provide the so-called RCtso ordering, that is a memory access S po-before the unlock should be ordered against a memory access R po-after the lock, unless S is a store and R is a load. The strengthening meets programmers' expection that "sequence of two locked regions to be ordered wrt each other" (from Linus), and can reduce the mental burden when using locks. Therefore add it in LKMM. [1]: https://lore.kernel.org/lkml/20210909185937.GA12379@rowland.harvard.edu/ Co-developed-by: Alan Stern Signed-off-by: Alan Stern Signed-off-by: Boqun Feng Reviewed-by: Michael Ellerman (powerpc) Acked-by: Palmer Dabbelt (RISC-V) Acked-by: Peter Zijlstra (Intel) Signed-off-by: Paul E. McKenney commit 90b21bcfb2846625c4f2e4a0bf5969543cef8ba7 Author: Paul E. McKenney Date: Tue Nov 30 11:47:37 2021 -0800 torture: Properly redirect kvm-remote.sh "echo" commands The echo commands following initialization of the "oldrun" variable need to be "tee"d to $oldrun/remote-log. This commit fixes several stragglers. Signed-off-by: Paul E. McKenney commit b6c9dbf04f24e6bba91246abf55d1e0a13f5062a Author: Paul E. McKenney Date: Tue Nov 30 11:33:01 2021 -0800 torture: Fix incorrectly redirected "exit" in kvm-remote.sh The "exit 4" in kvm-remote.sh is pointlessly redirected, so this commit removes the redirection. Fixes: 0092eae4cb4e ("torture: Add kvm-remote.sh script for distributed rcutorture test runs") Signed-off-by: Paul E. McKenney commit a959ed627a426b5bf01cf29c9b011f63459e2345 Author: Paul E. McKenney Date: Wed Nov 24 16:04:51 2021 -0800 rcutorture: Test RCU Tasks lock-contention detection This commit adjusts the TRACE02 scenario to use a pair of callback-flood kthreads. This in turn forces lock contention on the single RCU Tasks Trace callback queue, which forces use of all CPUs' queues, thus testing this transition. (No, there is not yet any way to transition back. Cc: Neeraj Upadhyay Signed-off-by: Paul E. McKenney commit 4ead4e33194a4bb080f726fafef787b33ca98965 Author: Paul E. McKenney Date: Mon Nov 22 21:02:43 2021 -0800 rcutorture: Cause TREE02 and TREE10 scenarios to do more callback flooding This commit enables two callback-flood kthreads for the TREE02 scenario and 28 for the TREE10 scenario. Cc: Neeraj Upadhyay Signed-off-by: Paul E. McKenney commit f61537009e3a7c5be8d30ebf61cc9f8596800d4c Author: Paul E. McKenney Date: Mon Nov 22 12:47:50 2021 -0800 torture: Retry download once before giving up Currently, a transient network error can kill a run if it happens while downloading the tarball to one of the target systems. This commit therefore does a 60-second wait and then a retry. If further experience indicates, a more elaborate mechanism might be used later. Signed-off-by: Paul E. McKenney commit c06354a121777d3c6c5e60bed9d4f1aae04afd72 Author: Paul E. McKenney Date: Wed Nov 10 07:47:41 2021 -0800 torture: Make kvm-find-errors.sh report link-time undefined symbols This commit makes kvm-find-errors.sh check for and report undefined symbols that are detected at link time. Signed-off-by: Paul E. McKenney commit b6a4fd35d2d345fbfbd4421b0f626c3d8f1f6cf7 Author: Paul E. McKenney Date: Tue Sep 21 12:50:05 2021 -0700 torture: Catch kvm.sh help text up with actual options This commit brings the kvm.sh script's help text up to date with recently (and some not-so-recently) added parameters. Signed-off-by: Paul E. McKenney commit 9880eb878c315b241002d43d7ff89df23713a51b Author: Li Zhijian Date: Mon Oct 25 11:26:57 2021 +0800 refscale: Prevent buffer to pr_alert() being too long 0Day/LKP observed that the refscale results fail to complete when larger values of nrun (such as 300) are specified. The problem is that printk() can accept at most a 1024-byte buffer. This commit therefore prints the buffer whenever its length exceeds 800 bytes. CC: Philip Li Reported-by: kernel test robot Signed-off-by: Li Zhijian Signed-off-by: Paul E. McKenney commit c30c876312f66b0422a1d632b8c45b6416deeec0 Author: Li Zhijian Date: Mon Oct 25 11:26:56 2021 +0800 refscale: Simplify the errexit checkpoint There is only the one OOM error case in main_func(), so this commit eliminates the errexit local variable in favor of a branch to cleanup code. Signed-off-by: Li Zhijian Signed-off-by: Paul E. McKenney commit 340170fef01b18631128006de03522b671e6e2b5 Author: Paul E. McKenney Date: Fri Sep 24 21:30:26 2021 -0700 rcutorture: Suppress pi-lock-across read-unlock testing for Tiny SRCU Because Tiny srcu_read_unlock() directly calls swake_up_one(), lockdep complains when a pi lock is held across that srcu_read_unlock(). Although this is a lockdep false positive (there is no other CPU to complete the deadlock cycle), lockdep is what it is at the moment. This commit therefore prevents rcutorture from holding pi lock across a Tiny srcu_read_unlock(). Signed-off-by: Paul E. McKenney commit 1c3d53986f744c469f0e0b136b8922c83363bfde Author: Paul E. McKenney Date: Wed Sep 22 20:49:12 2021 -0700 rcutorture: More thoroughly test nested readers Currently, nested readers occur only when a timer handler interrupts a reader. This is rare, and is thus insufficient testing of the transition between nesting levels. This commit therefore causes rcutorture nested readers to be the rule rather than the exception. Signed-off-by: Paul E. McKenney commit 902d82e6299631ec6b6c759ac4b45e44b45cc832 Author: Paul E. McKenney Date: Wed Sep 22 20:31:44 2021 -0700 rcutorture: Sanitize RCUTORTURE_RDR_MASK RCUTORTURE_RDR_MASK is currently not the bit indicated by RCUTORTURE_RDR_SHIFT, but is instead all the bits less significant than that one. This is an accident waiting to happen, so this commit makes RCUTORTURE_RDR_MASK be that one bit and adjusts uses accordingly. Signed-off-by: Paul E. McKenney commit f5dbc594b5bac1fa694174032b8d3d0249945fd3 Author: Paul E. McKenney Date: Sat Sep 18 20:40:48 2021 -0700 rcu-tasks: Don't remove tasks with pending IPIs from holdout list Currently, the check_all_holdout_tasks_trace() function removes all tasks marked with ->trc_reader_checked from the holdout list, including those with IPIs pending. This means that the IPI handler might arrive at a task that has already been removed from the list, which is at best an accident waiting to happen. This commit therefore avoids removing tasks with IPIs pending from the holdout list. This in turn means that the "if" condition in the for_each_online_cpu() loop in rcu_tasks_trace_postgp() should always evaluate to false, so a WARN_ON_ONCE() is added to check that. Signed-off-by: Paul E. McKenney commit 1f8da406a964dcc01121385a54fafd28e1c6a796 Author: Paul E. McKenney Date: Thu Sep 23 10:07:14 2021 -0700 srcu: Prevent redundant __srcu_read_unlock() wakeup Tiny SRCU readers can appear at task level, but also in interrupt and softirq handlers. Because Tiny SRCU is selected only in kernels built with CONFIG_SMP=n and CONFIG_PREEMPTION=n, it is not possible for a grace period to start while there is a non-task-level SRCU reader executing. This means that it does not make sense for __srcu_read_unlock() to awaken the Tiny SRCU grace period, because that can only happen when the grace period is waiting for one value of ->srcu_idx and __srcu_read_unlock() is ending the last reader for some other value of ->srcu_idx. After all, any such wakeup will be redundant. Worse yet, in some cases, such wakeups generate lockdep splats: ====================================================== WARNING: possible circular locking dependency detected 5.15.0-rc1+ #3758 Not tainted ------------------------------------------------------ rcu_torture_rea/53 is trying to acquire lock: ffffffff9514e6a8 (srcu_ctl.srcu_wq.lock){..-.}-{2:2}, at: xa/0x30 but task is already holding lock: ffff95c642479d80 (&p->pi_lock){-.-.}-{2:2}, at: _extend+0x370/0x400 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&p->pi_lock){-.-.}-{2:2}: _raw_spin_lock_irqsave+0x2f/0x50 try_to_wake_up+0x50/0x580 swake_up_locked.part.7+0xe/0x30 swake_up_one+0x22/0x30 rcutorture_one_extend+0x1b6/0x400 rcu_torture_one_read+0x290/0x5d0 rcu_torture_timer+0x1a/0x70 call_timer_fn+0xa6/0x230 run_timer_softirq+0x493/0x4c0 __do_softirq+0xc0/0x371 irq_exit+0x73/0x90 sysvec_apic_timer_interrupt+0x63/0x80 asm_sysvec_apic_timer_interrupt+0x12/0x20 default_idle+0xb/0x10 default_idle_call+0x5e/0x170 do_idle+0x18a/0x1f0 cpu_startup_entry+0xa/0x10 start_kernel+0x678/0x69f secondary_startup_64_no_verify+0xc2/0xcb -> #0 (srcu_ctl.srcu_wq.lock){..-.}-{2:2}: __lock_acquire+0x130c/0x2440 lock_acquire+0xc2/0x270 _raw_spin_lock_irqsave+0x2f/0x50 swake_up_one+0xa/0x30 rcutorture_one_extend+0x387/0x400 rcu_torture_one_read+0x290/0x5d0 rcu_torture_reader+0xac/0x200 kthread+0x12d/0x150 ret_from_fork+0x22/0x30 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&p->pi_lock); lock(srcu_ctl.srcu_wq.lock); lock(&p->pi_lock); lock(srcu_ctl.srcu_wq.lock); *** DEADLOCK *** 1 lock held by rcu_torture_rea/53: #0: ffff95c642479d80 (&p->pi_lock){-.-.}-{2:2}, at: _extend+0x370/0x400 stack backtrace: CPU: 0 PID: 53 Comm: rcu_torture_rea Not tainted 5.15.0-rc1+ Hardware name: Red Hat KVM/RHEL-AV, BIOS e_el8.5.0+746+bbd5d70c 04/01/2014 Call Trace: check_noncircular+0xfe/0x110 ? find_held_lock+0x2d/0x90 __lock_acquire+0x130c/0x2440 lock_acquire+0xc2/0x270 ? swake_up_one+0xa/0x30 ? find_held_lock+0x72/0x90 _raw_spin_lock_irqsave+0x2f/0x50 ? swake_up_one+0xa/0x30 swake_up_one+0xa/0x30 rcutorture_one_extend+0x387/0x400 rcu_torture_one_read+0x290/0x5d0 rcu_torture_reader+0xac/0x200 ? rcutorture_oom_notify+0xf0/0xf0 ? __kthread_parkme+0x61/0x90 ? rcu_torture_one_read+0x5d0/0x5d0 kthread+0x12d/0x150 ? set_kthread_struct+0x40/0x40 ret_from_fork+0x22/0x30 This is a false positive because there is only one CPU, and both locks are raw (non-preemptible) spinlocks. However, it is worthwhile getting rid of the redundant wakeup, which has the side effect of breaking the theoretical deadlock cycle. This commit therefore eliminates the redundant wakeups. Signed-off-by: Paul E. McKenney commit b0fe9dec66370cef23e9c281d229f4c44f84cfa2 Author: Mark Brown Date: Sun Oct 24 19:43:23 2021 +0200 tools/nolibc: Implement gettid() Allow test programs to determine their thread ID. Signed-off-by: Mark Brown Cc: Willy Tarreau Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 7bdc0e7a390511cd3df8194003b908f15a6170a5 Author: Ammar Faizi Date: Sun Oct 24 19:43:22 2021 +0200 tools/nolibc: x86-64: Use `mov $60,%eax` instead of `mov $60,%rax` Note that mov to 32-bit register will zero extend to 64-bit register. Thus `mov $60,%eax` has the same effect with `mov $60,%rax`. Use the shorter opcode to achieve the same thing. ``` b8 3c 00 00 00 mov $60,%eax (5 bytes) [1] 48 c7 c0 3c 00 00 00 mov $60,%rax (7 bytes) [2] ``` Currently, we use [2]. Change it to [1] for shorter code. Signed-off-by: Ammar Faizi Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit bf91666959eeac44fb686e9359e37830944beef2 Author: Ammar Faizi Date: Sun Oct 24 19:43:21 2021 +0200 tools/nolibc: x86: Remove `r8`, `r9` and `r10` from the clobber list Linux x86-64 syscall only clobbers rax, rcx and r11 (and "memory"). - rax for the return value. - rcx to save the return address. - r11 to save the rflags. Other registers are preserved. Having r8, r9 and r10 in the syscall clobber list is harmless, but this results in a missed-optimization. As the syscall doesn't clobber r8-r10, GCC should be allowed to reuse their value after the syscall returns to userspace. But since they are in the clobber list, GCC will always miss this opportunity. Remove them from the x86-64 syscall clobber list to help GCC generate better code and fix the comment. See also the x86-64 ABI, section A.2 AMD64 Linux Kernel Conventions, A.2.1 Calling Conventions [1]. Extra note: Some people may think it does not really give a benefit to remove r8, r9 and r10 from the syscall clobber list because the impression of syscall is a C function call, and function call always clobbers those 3. However, that is not the case for nolibc.h, because we have a potential to inline the "syscall" instruction (which its opcode is "0f 05") to the user functions. All syscalls in the nolibc.h are written as a static function with inline ASM and are likely always inline if we use optimization flag, so this is a profit not to have r8, r9 and r10 in the clobber list. Here is the example where this matters. Consider the following C code: ``` #include "tools/include/nolibc/nolibc.h" #define read_abc(a, b, c) __asm__ volatile("nop"::"r"(a),"r"(b),"r"(c)) int main(void) { int a = 0xaa; int b = 0xbb; int c = 0xcc; read_abc(a, b, c); write(1, "test\n", 5); read_abc(a, b, c); return 0; } ``` Compile with: gcc -Os test.c -o test -nostdlib With r8, r9, r10 in the clobber list, GCC generates this: 0000000000001000
: 1000: f3 0f 1e fa endbr64 1004: 41 54 push %r12 1006: 41 bc cc 00 00 00 mov $0xcc,%r12d 100c: 55 push %rbp 100d: bd bb 00 00 00 mov $0xbb,%ebp 1012: 53 push %rbx 1013: bb aa 00 00 00 mov $0xaa,%ebx 1018: 90 nop 1019: b8 01 00 00 00 mov $0x1,%eax 101e: bf 01 00 00 00 mov $0x1,%edi 1023: ba 05 00 00 00 mov $0x5,%edx 1028: 48 8d 35 d1 0f 00 00 lea 0xfd1(%rip),%rsi 102f: 0f 05 syscall 1031: 90 nop 1032: 31 c0 xor %eax,%eax 1034: 5b pop %rbx 1035: 5d pop %rbp 1036: 41 5c pop %r12 1038: c3 ret GCC thinks that syscall will clobber r8, r9, r10. So it spills 0xaa, 0xbb and 0xcc to callee saved registers (r12, rbp and rbx). This is clearly extra memory access and extra stack size for preserving them. But syscall does not actually clobber them, so this is a missed optimization. Now without r8, r9, r10 in the clobber list, GCC generates better code: 0000000000001000
: 1000: f3 0f 1e fa endbr64 1004: 41 b8 aa 00 00 00 mov $0xaa,%r8d 100a: 41 b9 bb 00 00 00 mov $0xbb,%r9d 1010: 41 ba cc 00 00 00 mov $0xcc,%r10d 1016: 90 nop 1017: b8 01 00 00 00 mov $0x1,%eax 101c: bf 01 00 00 00 mov $0x1,%edi 1021: ba 05 00 00 00 mov $0x5,%edx 1026: 48 8d 35 d3 0f 00 00 lea 0xfd3(%rip),%rsi 102d: 0f 05 syscall 102f: 90 nop 1030: 31 c0 xor %eax,%eax 1032: c3 ret Cc: Andy Lutomirski Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: x86@kernel.org Cc: "H. Peter Anvin" Cc: David Laight Acked-by: Andy Lutomirski Signed-off-by: Ammar Faizi Link: https://gitlab.com/x86-psABIs/x86-64-ABI/-/wikis/x86-64-psABI [1] Link: https://lore.kernel.org/lkml/20211011040344.437264-1-ammar.faizi@students.amikom.ac.id/ Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit de0244ae40ae91145faaf164a4252347607c3711 Author: Willy Tarreau Date: Sun Oct 24 19:28:16 2021 +0200 tools/nolibc: fix incorrect truncation of exit code Ammar Faizi reported that our exit code handling is wrong. We truncate it to the lowest 8 bits but the syscall itself is expected to take a regular 32-bit signed integer, not an unsigned char. It's the kernel that later truncates it to the lowest 8 bits. The difference is visible in strace, where the program below used to show exit(255) instead of exit(-1): int main(void) { return -1; } This patch applies the fix to all archs. x86_64, i386, arm64, armv7 and mips were all tested and confirmed to work fine now. Risc-v was not tested but the change is trivial and exactly the same as for other archs. Reported-by: Ammar Faizi Cc: stable@vger.kernel.org Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit ebbe0d8a449d183fa43b42d84fcb248e25303985 Author: Willy Tarreau Date: Sun Oct 24 19:28:15 2021 +0200 tools/nolibc: i386: fix initial stack alignment After re-checking in the spec and comparing stack offsets with glibc, The last pushed argument must be 16-byte aligned (i.e. aligned before the call) so that in the callee esp+4 is multiple of 16, so the principle is the 32-bit equivalent to what Ammar fixed for x86_64. It's possible that 32-bit code using SSE2 or MMX could have been affected. In addition the frame pointer ought to be zero at the deepest level. Link: https://gitlab.com/x86-psABIs/i386-ABI/-/wikis/Intel386-psABI Cc: Ammar Faizi Cc: stable@vger.kernel.org Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 937ed91c712273131de6d2a02caafd3ee84e0c72 Author: Ammar Faizi Date: Sun Oct 24 19:28:14 2021 +0200 tools/nolibc: x86-64: Fix startup code bug Before this patch, the `_start` function looks like this: ``` 0000000000001170 <_start>: 1170: pop %rdi 1171: mov %rsp,%rsi 1174: lea 0x8(%rsi,%rdi,8),%rdx 1179: and $0xfffffffffffffff0,%rsp 117d: sub $0x8,%rsp 1181: call 1000
1186: movzbq %al,%rdi 118a: mov $0x3c,%rax 1191: syscall 1193: hlt 1194: data16 cs nopw 0x0(%rax,%rax,1) 119f: nop ``` Note the "and" to %rsp with $-16, it makes the %rsp be 16-byte aligned, but then there is a "sub" with $0x8 which makes the %rsp no longer 16-byte aligned, then it calls main. That's the bug! What actually the x86-64 System V ABI mandates is that right before the "call", the %rsp must be 16-byte aligned, not after the "call". So the "sub" with $0x8 here breaks the alignment. Remove it. An example where this rule matters is when the callee needs to align its stack at 16-byte for aligned move instruction, like `movdqa` and `movaps`. If the callee can't align its stack properly, it will result in segmentation fault. x86-64 System V ABI also mandates the deepest stack frame should be zero. Just to be safe, let's zero the %rbp on startup as the content of %rbp may be unspecified when the program starts. Now it looks like this: ``` 0000000000001170 <_start>: 1170: pop %rdi 1171: mov %rsp,%rsi 1174: lea 0x8(%rsi,%rdi,8),%rdx 1179: xor %ebp,%ebp # zero the %rbp 117b: and $0xfffffffffffffff0,%rsp # align the %rsp 117f: call 1000
1184: movzbq %al,%rdi 1188: mov $0x3c,%rax 118f: syscall 1191: hlt 1192: data16 cs nopw 0x0(%rax,%rax,1) 119d: nopl (%rax) ``` Cc: Bedirhan KURT Cc: Louvian Lyndal Reported-by: Peter Cordes Signed-off-by: Ammar Faizi [wt: I did this on purpose due to a misunderstanding of the spec, other archs will thus have to be rechecked, particularly i386] Cc: stable@vger.kernel.org Signed-off-by: Willy Tarreau Signed-off-by: Paul E. McKenney commit 300c0c5e721834f484b03fa3062602dd8ff48413 Author: Jun Miao Date: Tue Nov 16 07:23:02 2021 +0800 rcu: Avoid alloc_pages() when recording stack The default kasan_record_aux_stack() calls stack_depot_save() with GFP_NOWAIT, which in turn can then call alloc_pages(GFP_NOWAIT, ...). In general, however, it is not even possible to use either GFP_ATOMIC nor GFP_NOWAIT in certain non-preemptive contexts/RT kernel including raw_spin_locks (see gfp.h and ab00db216c9c7). Fix it by instructing stackdepot to not expand stack storage via alloc_pages() in case it runs out by using kasan_record_aux_stack_noalloc(). Jianwei Hu reported: BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:969 in_atomic(): 0, irqs_disabled(): 1, non_block: 0, pid: 15319, name: python3 INFO: lockdep is turned off. irq event stamp: 0 hardirqs last enabled at (0): [<0000000000000000>] 0x0 hardirqs last disabled at (0): [] copy_process+0xaf3/0x2590 softirqs last enabled at (0): [] copy_process+0xaf3/0x2590 softirqs last disabled at (0): [<0000000000000000>] 0x0 CPU: 6 PID: 15319 Comm: python3 Tainted: G W O 5.15-rc7-preempt-rt #1 Hardware name: Supermicro SYS-E300-9A-8C/A2SDi-8C-HLN4F, BIOS 1.1b 12/17/2018 Call Trace: show_stack+0x52/0x58 dump_stack+0xa1/0xd6 ___might_sleep.cold+0x11c/0x12d rt_spin_lock+0x3f/0xc0 rmqueue+0x100/0x1460 rmqueue+0x100/0x1460 mark_usage+0x1a0/0x1a0 ftrace_graph_ret_addr+0x2a/0xb0 rmqueue_pcplist.constprop.0+0x6a0/0x6a0 __kasan_check_read+0x11/0x20 __zone_watermark_ok+0x114/0x270 get_page_from_freelist+0x148/0x630 is_module_text_address+0x32/0xa0 __alloc_pages_nodemask+0x2f6/0x790 __alloc_pages_slowpath.constprop.0+0x12d0/0x12d0 create_prof_cpu_mask+0x30/0x30 alloc_pages_current+0xb1/0x150 stack_depot_save+0x39f/0x490 kasan_save_stack+0x42/0x50 kasan_save_stack+0x23/0x50 kasan_record_aux_stack+0xa9/0xc0 __call_rcu+0xff/0x9c0 call_rcu+0xe/0x10 put_object+0x53/0x70 __delete_object+0x7b/0x90 kmemleak_free+0x46/0x70 slab_free_freelist_hook+0xb4/0x160 kfree+0xe5/0x420 kfree_const+0x17/0x30 kobject_cleanup+0xaa/0x230 kobject_put+0x76/0x90 netdev_queue_update_kobjects+0x17d/0x1f0 ... ... ksys_write+0xd9/0x180 __x64_sys_write+0x42/0x50 do_syscall_64+0x38/0x50 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Links: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/include/linux/kasan.h?id=7cb3007ce2da27ec02a1a3211941e7fe6875b642 Fixes: 84109ab58590 ("rcu: Record kvfree_call_rcu() call stack for KASAN") Fixes: 26e760c9a7c8 ("rcu: kasan: record and print call_rcu() call stack") Reported-by: Jianwei Hu Reviewed-by: Uladzislau Rezki (Sony) Acked-by: Marco Elver Tested-by: Juri Lelli Signed-off-by: Jun Miao Signed-off-by: Paul E. McKenney commit c2cf0767e98eb4487444e5c7ebba491a866811ce Author: Zqiang Date: Mon Nov 15 13:15:46 2021 +0800 rcu: Avoid running boost kthreads on isolated CPUs When the boost kthreads are created on systems with nohz_full CPUs, the cpus_allowed_ptr is set to housekeeping_cpumask(HK_FLAG_KTHREAD). However, when the rcu_boost_kthread_setaffinity() is called, the original affinity will be changed and these kthreads can subsequently run on nohz_full CPUs. This commit makes rcu_boost_kthread_setaffinity() restrict these boost kthreads to housekeeping CPUs. Signed-off-by: Zqiang Signed-off-by: Paul E. McKenney commit 17ea3718824912e773b0fd78579694b2e75ee597 Author: Zhouyi Zhou Date: Sun Oct 24 08:36:34 2021 +0800 rcu: Improve tree_plugin.h comments and add code cleanups This commit cleans up some comments and code in kernel/rcu/tree_plugin.h. Signed-off-by: Zhouyi Zhou Signed-off-by: Paul E. McKenney commit 2407a64f8045552203ee5cb9904ce75ce2fceef4 Author: Changbin Du Date: Tue Sep 28 08:21:28 2021 +0800 rcu: in_irq() cleanup This commit replaces the obsolete and ambiguous macro in_irq() with its shiny new in_hardirq() equivalent. Signed-off-by: Changbin Du Signed-off-by: Paul E. McKenney commit 24ba53017e188e031f9cb8b290286fad52d2af00 Author: Chun-Hung Tseng Date: Wed Sep 15 17:02:18 2021 +0800 rcu: Replace ________p1 and _________p1 with __UNIQUE_ID(rcu) This commit replaces both ________p1 and _________p1 with __UNIQUE_ID(rcu), and also adjusts the callers of the affected macros. __UNIQUE_ID(rcu) will generate unique variable names during compilation, which eliminates the need of ________p1 and _________p1 (both having 4 occurrences prior to the code change). This also avoids the variable name shadowing issue, or at least makes those wishing to cause shadowing problems work much harder to do so. The same idea is used for the min/max macros (commit 589a978 and commit e9092d0). Signed-off-by: Jim Huang Signed-off-by: Chun-Hung Tseng Signed-off-by: Paul E. McKenney commit bc849e9192c75833a85f2e9376a265ab31f8eec7 Author: Paul E. McKenney Date: Mon Sep 27 14:30:20 2021 -0700 rcu: Move rcu_needs_cpu() to tree.c Now that RCU_FAST_NO_HZ is no more, there is but one implementation of the rcu_needs_cpu() function. This commit therefore moves this function from kernel/rcu/tree_plugin.c to kernel/rcu/tree.c. Signed-off-by: Paul E. McKenney commit e2c73a6860bdf54f2c6bf8cddc34ddc91a1343e1 Author: Paul E. McKenney Date: Mon Sep 27 14:18:51 2021 -0700 rcu: Remove the RCU_FAST_NO_HZ Kconfig option All of the uses of CONFIG_RCU_FAST_NO_HZ=y that I have seen involve systems with RCU callbacks offloaded. In this situation, all that this Kconfig option does is slow down idle entry/exit with an additional allways-taken early exit. If this is the only use case, then this Kconfig option nothing but an attractive nuisance that needs to go away. This commit therefore removes the RCU_FAST_NO_HZ Kconfig option. Signed-off-by: Paul E. McKenney commit 24eab6e1ff58d33048c36b5452f5d284c3710d02 Author: Paul E. McKenney Date: Mon Sep 27 14:17:35 2021 -0700 torture: Remove RCU_FAST_NO_HZ from rcu scenarios All of the rcu scenarios that mentioning CONFIG_RCU_FAST_NO_HZ disable it. But this Kconfig option is disabled by default, so this commit removes the pointless "CONFIG_RCU_FAST_NO_HZ=n" lines from these scenarios. Signed-off-by: Paul E. McKenney commit f04cbe651b4e71c4477e81482491aadfd062d878 Author: Paul E. McKenney Date: Mon Sep 27 14:13:24 2021 -0700 torture: Remove RCU_FAST_NO_HZ from rcuscale and refscale scenarios All of the rcuscale and refscale scenarios that mention the Kconfig option CONFIG_RCU_FAST_NO_HZ disable it. But this Kconfig option is disabled by default, so this commit removes the pointless "CONFIG_RCU_FAST_NO_HZ=n" lines from these scenarios. Signed-off-by: Paul E. McKenney commit 5861dad198fee7d99d7940464d72f17c061a427c Author: Akira Yokosawa Date: Wed Nov 3 08:48:15 2021 +0900 doc: RCU: Avoid 'Symbol' font-family in SVG figures On Ubuntu Focal, strings in some of SVG files under Documentation/RCU/Design can not be rendered properly when converted to PDF. Ubuntu releases since Focal and Debian bullseye have trouble with "Symbol" font-family in SVG files. As those strings are mostly API names such as "READ_ONCE()", "WRITE_ONCE(), "rcu_read_lock()", and so on, using a generic monospace font-family should be a good alternative. Substitute the font-family name by a simple sed pattern: 's/Symbol/monospace/g' Signed-off-by: Akira Yokosawa Signed-off-by: Paul E. McKenney commit 7c0be9f8901fed7bfe44cb3f8f7412b010209526 Author: NeilBrown Date: Tue Oct 26 15:53:38 2021 +1100 doc: Add refcount analogy to What is RCU The reader-writer-lock analogy is a useful way to think about RCU, but it is not always applicable. It is useful to have other analogies to work with, and particularly to emphasise that no single analogy is perfect. This patch add a "RCU as reference count" to the "what is RCU" document. See https://lwn.net/Articles/872559/ [ paulmck: Apply Akira Yokosawa feedback. ] Reviewed-by: Akira Yokosawa Signed-off-by: NeilBrown Signed-off-by: Paul E. McKenney commit db4cb76861282604cf14fb362f507bb587d676ba Author: Paul E. McKenney Date: Mon Sep 27 10:54:22 2021 -0700 doc: Remove obsolete kernel-per-CPU-kthreads RCU_FAST_NO_HZ advice This document advises building with both CONFIG_NO_HZ=y and CONFIG_RCU_FAST_NO_HZ=y. However, CONFIG_NO_HZ=y offloads callbacks from all nohz_full CPUs, and CPUs with offloaded callbacks do not benefit from CONFIG_RCU_FAST_NO_HZ=y. Quite the opposite: CONFIG_RCU_FAST_NO_HZ=y simply adds a bit of idle entry/exit overhead. This commit therefore changes that advice to only CONFIG_NO_HZ=y. Signed-off-by: Paul E. McKenney commit 1a5620671a1b6fd9cc08761677d050f1702f910c Author: Waiman Long Date: Thu Nov 18 14:14:37 2021 -0500 clocksource: Reduce the default clocksource_watchdog() retries to 2 With the previous patch, there is an extra watchdog read in each retry. Now the total number of clocksource reads is increased to 4 per iteration. In order to avoid increasing the clock skew check overhead, the default maximum number of retries is reduced from 3 to 2 to maintain the same 12 clocksource reads in the worst case. Suggested-by: Paul E. McKenney Signed-off-by: Waiman Long Signed-off-by: Paul E. McKenney commit c86ff8c55b8ae68837b2fa59dc0c203907e9a15f Author: Waiman Long Date: Thu Nov 18 14:14:36 2021 -0500 clocksource: Avoid accidental unstable marking of clocksources Since commit db3a34e17433 ("clocksource: Retry clock read if long delays detected") and commit 2e27e793e280 ("clocksource: Reduce clocksource-skew threshold"), it is found that tsc clocksource fallback to hpet can sometimes happen on both Intel and AMD systems especially when they are running stressful benchmarking workloads. Of the 23 systems tested with a v5.14 kernel, 10 of them have switched to hpet clock source during the test run. The result of falling back to hpet is a drastic reduction of performance when running benchmarks. For example, the fio performance tests can drop up to 70% whereas the iperf3 performance can drop up to 80%. 4 hpet fallbacks happened during bootup. They were: [ 8.749399] clocksource: timekeeping watchdog on CPU13: hpet read-back delay of 263750ns, attempt 4, marking unstable [ 12.044610] clocksource: timekeeping watchdog on CPU19: hpet read-back delay of 186166ns, attempt 4, marking unstable [ 17.336941] clocksource: timekeeping watchdog on CPU28: hpet read-back delay of 182291ns, attempt 4, marking unstable [ 17.518565] clocksource: timekeeping watchdog on CPU34: hpet read-back delay of 252196ns, attempt 4, marking unstable Other fallbacks happen when the systems were running stressful benchmarks. For example: [ 2685.867873] clocksource: timekeeping watchdog on CPU117: hpet read-back delay of 57269ns, attempt 4, marking unstable [46215.471228] clocksource: timekeeping watchdog on CPU8: hpet read-back delay of 61460ns, attempt 4, marking unstable Commit 2e27e793e280 ("clocksource: Reduce clocksource-skew threshold"), changed the skew margin from 100us to 50us. I think this is too small and can easily be exceeded when running some stressful workloads on a thermally stressed system. So it is switched back to 100us. Even a maximum skew margin of 100us may be too small in for some systems when booting up especially if those systems are under thermal stress. To eliminate the case that the large skew is due to the system being too busy slowing down the reading of both the watchdog and the clocksource, an extra consecutive read of watchdog clock is being done to check this. The consecutive watchdog read delay is compared against WATCHDOG_MAX_SKEW/2. If the delay exceeds the limit, we assume that the system is just too busy. A warning will be printed to the console and the clock skew check is skipped for this round. Fixes: db3a34e17433 ("clocksource: Retry clock read if long delays detected") Fixes: 2e27e793e280 ("clocksource: Reduce clocksource-skew threshold") Signed-off-by: Waiman Long Signed-off-by: Paul E. McKenney commit 8c0abfd6d2f6b0221194241ac2908751a2a0385f Author: Paul E. McKenney Date: Wed Nov 17 18:57:01 2021 -0800 rcutorture: Add CONFIG_PREEMPT_DYNAMIC=n to tiny scenarios With CONFIG_PREEMPT_DYNAMIC=y, the kernel builds with CONFIG_PREEMPTION=y because preemption can be enabled at runtime. This prevents any tests of Tiny RCU or Tiny SRCU from running correctly. This commit therefore explicitly sets CONFIG_PREEMPT_DYNAMIC=n for those scenarios. Signed-off-by: Paul E. McKenney commit 2a67b18e67f30b526ce69b7796a16d847e94e2df Author: Umesh Nerlige Ramappa Date: Mon Nov 8 13:10:57 2021 -0800 drm/i915/pmu: Fix synchronization of PMU callback with reset Since the PMU callback runs in irq context, it synchronizes with gt reset using the reset count. We could run into a case where the PMU callback could read the reset count before it is updated. This has a potential of corrupting the busyness stats. In addition to the reset count, check if the reset bit is set before capturing busyness. In addition save the previous stats only if you intend to update them. v2: - The 2 reset counts captured in the PMU callback can end up being the same if they were captured right after the count is incremented in the reset flow. This can lead to a bad busyness state. Ensure that reset is not in progress when the initial reset count is captured. Signed-off-by: Umesh Nerlige Ramappa Reviewed-by: Matthew Brost Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20211108211057.68783-1-umesh.nerlige.ramappa@intel.com commit e30c8fd310c77313633a47eb5c1f2ce23d353c18 Merge: b98057ef730ad d995816b77eb8 Author: Andrii Nakryiko Date: Tue Nov 30 15:48:15 2021 -0800 Merge branch 'Apply suggestions for typeless/weak ksym series' Kumar Kartikeya says: ==================== Three commits addressing comments for the typeless/weak ksym set. No functional change intended. Hopefully this is simpler to read for kfunc as well. ==================== Signed-off-by: Andrii Nakryiko commit d995816b77eb826e0f6d7adf4471ec191b362be0 Author: Kumar Kartikeya Dwivedi Date: Tue Nov 23 05:27:33 2021 +0530 libbpf: Avoid reload of imm for weak, unresolved, repeating ksym Alexei pointed out that we can use BPF_REG_0 which already contains imm from move_blob2blob computation. Note that we now compare the second insn's imm, but this should not matter, since both will be zeroed out for the error case for the insn populated earlier. Suggested-by: Alexei Starovoitov Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Andrii Nakryiko Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20211122235733.634914-4-memxor@gmail.com commit 0270090d396a8e7e7f42adae13fdfa48ffb85144 Author: Kumar Kartikeya Dwivedi Date: Tue Nov 23 05:27:32 2021 +0530 libbpf: Avoid double stores for success/failure case of ksym relocations Instead, jump directly to success case stores in case ret >= 0, else do the default 0 value store and jump over the success case. This is better in terms of readability. Readjust the code for kfunc relocation as well to follow a similar pattern, also leads to easier to follow code now. Suggested-by: Alexei Starovoitov Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Andrii Nakryiko Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20211122235733.634914-3-memxor@gmail.com commit d4efb170861827290f7f571020001a60d001faaf Author: Kumar Kartikeya Dwivedi Date: Tue Nov 23 05:27:31 2021 +0530 bpf: Change bpf_kallsyms_lookup_name size type to ARG_CONST_SIZE_OR_ZERO Andrii mentioned in [0] that switching to ARG_CONST_SIZE_OR_ZERO lets user avoid having to prove that string size at runtime is not zero and helps with not having to supress clang optimizations. [0]: https://lore.kernel.org/bpf/CAEf4BzZa_vhXB3c8atNcTS6=krQvC25H7K7c3WWZhM=27ro=Wg@mail.gmail.com Suggested-by: Andrii Nakryiko Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Andrii Nakryiko Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20211122235733.634914-2-memxor@gmail.com commit a478c433d72bf006f36bef68c239c8a68b062e5b Author: Alexandre Belloni Date: Wed Nov 10 00:47:50 2021 +0100 rtc: da9063: switch to RTC_FEATURE_UPDATE_INTERRUPT Stop using uie_unsupported and clear RTC_FEATURE_UPDATE_INTERRUPT instead. Also, let the core know that the alarm will truncate seconds as it only has a minute resolution. Signed-off-by: Alexandre Belloni Reviewed-by: Adam Thomson Link: https://lore.kernel.org/r/20211109234750.107115-1-alexandre.belloni@bootlin.com commit 4946f15e8c334840bf277a0bf924371eae120fcd Author: Rikard Falkeborn Date: Tue Nov 30 22:40:43 2021 +0100 genirq/generic_chip: Constify irq_generic_chip_ops The only usage of irq_generic_chip_ops is to pass its address to irq_domain_add_linear() which takes a pointer to const struct irq_domain_ops. Make it const to allow the compiler to put it in read-only memory. [ tglx: Fixed subject prefix ] Signed-off-by: Rikard Falkeborn Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20211130214043.1257585-1-rikard.falkeborn@gmail.com commit 1c1b3098ae1e0d9725d0d4d49986e0edebba443a Author: Marc Ferland Date: Tue Nov 16 11:47:33 2021 -0500 rtc: pcf85063: add i2c_device_id name matching support The pcf85063 driver regsitration currently supports the "compatible" property type of matching (for DT). This patch adds "matching by name" support to the driver by defining an i2c_device_id table and setting the id_table parameter in the i2c_driver struct. This will, for example, make the driver easier to instantiate on systems where CONFIG_OF is not enabled (x86 in my case). Signed-off-by: Marc Ferland Reported-by: kernel test robot Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20211116164733.17149-1-ferlandm@amotus.ca commit 985faa78687de6e583cfd8b8094d87dcb80c33a6 Author: Mark Rutland Date: Mon Nov 29 13:06:52 2021 +0000 powerpc: Snapshot thread flags Some thread flags can be set remotely, and so even when IRQs are disabled, the flags can change under our feet. Generally this is unlikely to cause a problem in practice, but it is somewhat unsound, and KCSAN will legitimately warn that there is a data race. To avoid such issues, a snapshot of the flags has to be taken prior to using them. Some places already use READ_ONCE() for that, others do not. Convert them all to the new flag accessor helpers. Signed-off-by: Mark Rutland Signed-off-by: Thomas Gleixner Acked-by: Paul E. McKenney Cc: Benjamin Herrenschmidt Cc: Michael Ellerman Cc: Paul Mackerras Link: https://lore.kernel.org/r/20211129130653.2037928-11-mark.rutland@arm.com commit 08b0af5b2affbe7419853e8dd1330e4b3fe27125 Author: Mark Rutland Date: Mon Nov 29 13:06:51 2021 +0000 powerpc: Avoid discarding flags in system_call_exception() Some thread flags can be set remotely, and so even when IRQs are disabled, the flags can change under our feet. Thus, when setting flags we must use an atomic operation rather than a plain read-modify-write sequence, as a plain read-modify-write may discard flags which are concurrently set by a remote thread, e.g. // task A // task B tmp = A->thread_info.flags; set_tsk_thread_flag(A, NEWFLAG_B); tmp |= NEWFLAG_A; A->thread_info.flags = tmp; arch/powerpc/kernel/interrupt.c's system_call_exception() sets _TIF_RESTOREALL in the thread info flags with a read-modify-write, which may result in other flags being discarded. Elsewhere in the file it uses clear_bits() to atomically remove flag bits, so use set_bits() here for consistency with those. There may be reasons (e.g. instrumentation) that prevent the use of set_thread_flag() and clear_thread_flag() here, which would otherwise be preferable. Fixes: ae7aaecc3f2f78b7 ("powerpc/64s: system call rfscv workaround for TM bugs") Signed-off-by: Mark Rutland Signed-off-by: Thomas Gleixner Cc: Eirik Fuller Cc: Michael Ellerman Cc: Nicholas Piggin Link: https://lore.kernel.org/r/20211129130653.2037928-10-mark.rutland@arm.com commit 4ea7ce0a79b9450b71b9a88f9f5adbfe2bc3f2e5 Author: Mark Rutland Date: Mon Nov 29 13:06:50 2021 +0000 openrisc: Snapshot thread flags Some thread flags can be set remotely, and so even when IRQs are disabled, the flags can change under our feet. Generally this is unlikely to cause a problem in practice, but it is somewhat unsound, and KCSAN will legitimately warn that there is a data race. To avoid such issues, a snapshot of the flags has to be taken prior to using them. Some places already use READ_ONCE() for that, others do not. Convert them all to the new flag accessor helpers. Signed-off-by: Mark Rutland Signed-off-by: Thomas Gleixner Acked-by: Stafford Horne Acked-by: Paul E. McKenney Cc: Jonas Bonn Cc: Stefan Kristiansson Link: https://lore.kernel.org/r/20211129130653.2037928-9-mark.rutland@arm.com commit e538c5849143a7f0aa97006cd45ce4c0c26d0744 Author: Mark Rutland Date: Mon Nov 29 13:06:49 2021 +0000 microblaze: Snapshot thread flags Some thread flags can be set remotely, and so even when IRQs are disabled, the flags can change under our feet. Generally this is unlikely to cause a problem in practice, but it is somewhat unsound, and KCSAN will legitimately warn that there is a data race. To avoid such issues, a snapshot of the flags has to be taken prior to using them. Some places already use READ_ONCE() for that, others do not. Convert them all to the new flag accessor helpers. Signed-off-by: Mark Rutland Signed-off-by: Thomas Gleixner Tested-by: Michal Simek Acked-by: Paul E. McKenney Link: https://lore.kernel.org/r/20211129130653.2037928-8-mark.rutland@arm.com commit 342b3808786518ced347f40b59bae68664e20007 Author: Mark Rutland Date: Mon Nov 29 13:06:48 2021 +0000 arm64: Snapshot thread flags Some thread flags can be set remotely, and so even when IRQs are disabled, the flags can change under our feet. Generally this is unlikely to cause a problem in practice, but it is somewhat unsound, and KCSAN will legitimately warn that there is a data race. To avoid such issues, a snapshot of the flags has to be taken prior to using them. Some places already use READ_ONCE() for that, others do not. Convert them all to the new flag accessor helpers. Signed-off-by: Mark Rutland Signed-off-by: Thomas Gleixner Acked-by: Will Deacon Acked-by: Paul E. McKenney Cc: Catalin Marinas Link: https://lore.kernel.org/r/20211129130653.2037928-7-mark.rutland@arm.com commit 050e22bfc4f450d342dbb7eaea470858ad567bce Author: Mark Rutland Date: Mon Nov 29 13:06:47 2021 +0000 ARM: Snapshot thread flags Some thread flags can be set remotely, and so even when IRQs are disabled, the flags can change under our feet. Generally this is unlikely to cause a problem in practice, but it is somewhat unsound, and KCSAN will legitimately warn that there is a data race. To avoid such issues, a snapshot of the flags has to be taken prior to using them. Some places already use READ_ONCE() for that, others do not. Convert them all to the new flag accessor helpers. Signed-off-by: Mark Rutland Signed-off-by: Thomas Gleixner Acked-by: Paul E. McKenney Cc: Russell King Link: https://lore.kernel.org/r/20211129130653.2037928-6-mark.rutland@arm.com commit 7fb2b24bb5c5876a3205cb5b9a580f81e8c9f744 Author: Mark Rutland Date: Mon Nov 29 13:06:46 2021 +0000 alpha: Snapshot thread flags Some thread flags can be set remotely, and so even when IRQs are disabled, the flags can change under our feet. Generally this is unlikely to cause a problem in practice, but it is somewhat unsound, and KCSAN will legitimately warn that there is a data race. To avoid such issues, a snapshot of the flags has to be taken prior to using them. Some places already use READ_ONCE() for that, others do not. Convert them all to the new flag accessor helpers. Signed-off-by: Mark Rutland Signed-off-by: Thomas Gleixner Acked-by: Paul E. McKenney Cc: Ivan Kokshaysky Cc: Matt Turner Cc: Richard Henderson Link: https://lore.kernel.org/r/20211129130653.2037928-5-mark.rutland@arm.com commit 0569b245132c40015281610353935a50e282eb94 Author: Mark Rutland Date: Mon Nov 29 13:06:45 2021 +0000 sched: Snapshot thread flags Some thread flags can be set remotely, and so even when IRQs are disabled, the flags can change under our feet. Generally this is unlikely to cause a problem in practice, but it is somewhat unsound, and KCSAN will legitimately warn that there is a data race. To avoid such issues, a snapshot of the flags has to be taken prior to using them. Some places already use READ_ONCE() for that, others do not. Convert them all to the new flag accessor helpers. The READ_ONCE(ti->flags) .. cmpxchg(ti->flags) loop in set_nr_if_polling() is left as-is for clarity. Signed-off-by: Mark Rutland Signed-off-by: Thomas Gleixner Acked-by: Paul E. McKenney Cc: Juri Lelli Cc: Vincent Guittot Link: https://lore.kernel.org/r/20211129130653.2037928-4-mark.rutland@arm.com commit 6ce895128b3bff738fe8d9dd74747a03e319e466 Author: Mark Rutland Date: Mon Nov 29 13:06:44 2021 +0000 entry: Snapshot thread flags Some thread flags can be set remotely, and so even when IRQs are disabled, the flags can change under our feet. Generally this is unlikely to cause a problem in practice, but it is somewhat unsound, and KCSAN will legitimately warn that there is a data race. To avoid such issues, a snapshot of the flags has to be taken prior to using them. Some places already use READ_ONCE() for that, others do not. Convert them all to the new flag accessor helpers. Signed-off-by: Mark Rutland Signed-off-by: Thomas Gleixner Acked-by: Paul E. McKenney Link: https://lore.kernel.org/r/20211129130653.2037928-3-mark.rutland@arm.com commit dca99fb643a2e9bc2e67a0f626b09d4f177f0f09 Author: Mark Rutland Date: Mon Nov 29 13:06:53 2021 +0000 x86: Snapshot thread flags Some thread flags can be set remotely, and so even when IRQs are disabled, the flags can change under our feet. Generally this is unlikely to cause a problem in practice, but it is somewhat unsound, and KCSAN will legitimately warn that there is a data race. To avoid such issues, a snapshot of the flags has to be taken prior to using them. Some places already use READ_ONCE() for that, others do not. Convert them all to the new flag accessor helpers. Signed-off-by: Mark Rutland Signed-off-by: Thomas Gleixner Reviewed-by: Thomas Gleixner Acked-by: Paul E. McKenney Link: https://lore.kernel.org/r/20211129130653.2037928-12-mark.rutland@arm.com commit 7ad639840acf2800b5f387c495795f995a67a329 Author: Mark Rutland Date: Mon Nov 29 13:06:43 2021 +0000 thread_info: Add helpers to snapshot thread flags In there are helpers to manipulate individual thread flags, but where code wants to check several flags at once, it must open code reading current_thread_info()->flags and operating on a snapshot. As some flags can be set remotely it's necessary to use READ_ONCE() to get a consistent snapshot even when IRQs are disabled, but some code forgets to do this. Generally this is unlike to cause a problem in practice, but it is somewhat unsound, and KCSAN will legitimately warn that there is a data race. To make it easier to do the right thing, and to highlight that concurrent modification is possible, add new helpers to snapshot the flags, which should be used in preference to plain reads. Subsequent patches will move existing code to use the new helpers. Signed-off-by: Mark Rutland Signed-off-by: Thomas Gleixner Reviewed-by: Thomas Gleixner Acked-by: Marco Elver Acked-by: Paul E. McKenney Cc: Boqun Feng Cc: Dmitry Vyukov Cc: Peter Zijlstra Cc: Will Deacon Link: https://lore.kernel.org/r/20211129130653.2037928-2-mark.rutland@arm.com commit f601aa7930669439623dd266fc9e90b0218b42c1 Author: Camel Guo Date: Thu Nov 11 09:36:25 2021 +0100 rtc: rs5c372: Add RTC_VL_READ, RTC_VL_CLR ioctls In order to make it possible to get battery voltage status, this commit adds RTC_VL_READ, RTC_VL_CLR ioctl commands to rtc-rs5c372. Signed-off-by: Camel Guo Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20211111083625.10216-1-camel.guo@axis.com commit c494eb366dbfc5095c0f159bbb5c6d4ec3ed37ec Author: Kirill A. Shutemov Date: Tue Nov 30 21:49:33 2021 +0300 x86/sev-es: Use insn_decode_mmio() for MMIO implementation Switch SEV implementation to insn_decode_mmio(). The helper is going to be used by TDX too. No functional changes. Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Andi Kleen Reviewed-by: Tony Luck Tested-by: Joerg Roedel Acked-by: Tom Lendacky Link: https://lkml.kernel.org/r/20211130184933.31005-5-kirill.shutemov@linux.intel.com commit 70a81f99e45b15b3e77f70720742545e1c7541da Author: Kirill A. Shutemov Date: Tue Nov 30 21:49:32 2021 +0300 x86/insn-eval: Introduce insn_decode_mmio() In preparation for sharing MMIO instruction decode between SEV-ES and TDX, factor out the common decode into a new insn_decode_mmio() helper. For regular virtual machine, MMIO is handled by the VMM and KVM emulates instructions that caused MMIO. But, this model doesn't work for a secure VMs (like SEV or TDX) as VMM doesn't have access to the guest memory and register state. So, for TDX or SEV VMM needs assistance in handling MMIO. It induces exception in the guest. Guest has to decode the instruction and handle it on its own. The code is based on the current SEV MMIO implementation. Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Andi Kleen Reviewed-by: Tony Luck Tested-by: Joerg Roedel Acked-by: Tom Lendacky Link: https://lkml.kernel.org/r/20211130184933.31005-4-kirill.shutemov@linux.intel.com commit d5ec1877df6da6a14bbc353aff50689528930dd2 Author: Kirill A. Shutemov Date: Tue Nov 30 21:49:31 2021 +0300 x86/insn-eval: Introduce insn_get_modrm_reg_ptr() The helper returns a pointer to the register indicated by ModRM byte. It's going to replace vc_insn_get_reg() in the SEV MMIO implementation. TDX MMIO implementation will also use it. Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Andi Kleen Reviewed-by: Tony Luck Tested-by: Joerg Roedel Acked-by: Tom Lendacky Link: https://lkml.kernel.org/r/20211130184933.31005-3-kirill.shutemov@linux.intel.com commit 23ef731e4365196bfc186358eb4f6265d60ab352 Author: Kirill A. Shutemov Date: Tue Nov 30 21:49:30 2021 +0300 x86/insn-eval: Handle insn_get_opcode() failure is_string_insn() calls insn_get_opcode() that can fail, but does not handle the failure. is_string_insn() interface does not allow to communicate an error to the caller. Push insn_get_opcode() to the only non-static user of is_string_insn() and fail it early if insn_get_opcode() fails. [ dhansen: fix tabs-versus-spaces breakage ] Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Tested-by: Joerg Roedel Acked-by: Tom Lendacky Link: https://lkml.kernel.org/r/20211130184933.31005-2-kirill.shutemov@linux.intel.com commit 28b78ecffea8078d81466b2e01bb5a154509f1ba Author: Florian Westphal Date: Tue Nov 23 12:50:31 2021 +0100 netfilter: bridge: add support for pppoe filtering This makes 'bridge-nf-filter-pppoe-tagged' sysctl work for bridged traffic. Looking at the original commit it doesn't appear this ever worked: static unsigned int br_nf_post_routing(unsigned int hook, struct sk_buff **pskb, [..] if (skb->protocol == htons(ETH_P_8021Q)) { skb_pull(skb, VLAN_HLEN); skb->network_header += VLAN_HLEN; + } else if (skb->protocol == htons(ETH_P_PPP_SES)) { + skb_pull(skb, PPPOE_SES_HLEN); + skb->network_header += PPPOE_SES_HLEN; } [..] NF_HOOK(... POST_ROUTING, ...) ... but the adjusted offsets are never restored. The alternative would be to rip this code out for good, but otoh we'd have to keep this anyway for the vlan handling (which works because vlan tag info is in the skb, not the packet payload). Reported-and-tested-by: Amish Chana Fixes: 516299d2f5b6f97 ("[NETFILTER]: bridge-nf: filter bridged IPv4/IPv6 encapsulated in pppoe traffic") Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit f87b9464d152f7705f1e37288dc48f5af6a2fc0c Author: Pablo Neira Ayuso Date: Tue Nov 9 13:42:01 2021 +0100 netfilter: nft_fwd_netdev: Support egress hook Allow packet redirection to another interface upon egress. [lukas: set skb_iif, add commit message, original patch from Pablo. ] Signed-off-by: Lukas Wunner Signed-off-by: Pablo Neira Ayuso commit 632cb151ca5367f0e1774e71837ab5c55cf0fccf Author: Bernard Zhao Date: Tue Nov 23 18:18:00 2021 -0800 netfilter: ctnetlink: remove useless type conversion to bool dying is bool, the type conversion to true/false value is not needed. Signed-off-by: Bernard Zhao Signed-off-by: Pablo Neira Ayuso commit c5fc837bf93455376b6377fa6a56166297409ff5 Author: Florian Westphal Date: Fri Nov 19 13:33:09 2021 +0100 netfilter: nf_queue: remove leftover synchronize_rcu Its no longer needed after commit 870299707436 ("netfilter: nf_queue: move hookfn registration out of struct net"). Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso commit 6da5175dbe1c2f02f1301b6d987e3ce24742bfd4 Author: Kirill A. Shutemov Date: Tue Nov 30 21:55:32 2021 +0300 x86/paravirt: Fix build PARAVIRT_XXL=y without XEN_PV Kernel fails to compile with PARAVIRT_XXL=y if XEN_PV is not enabled: ld.lld: error: undefined symbol: xen_iret It happens because INTERRUPT_RETURN defined to use xen_iret if CONFIG_PARAVIRT_XXL enabled regardless of CONFIG_XEN_PV. The issue is not visible in the current kernel because CONFIG_XEN_PV is the only user of CONFIG_PARAVIRT_XXL and there's no way to enable them separately. Rework code to define INTERRUPT_RETURN based on CONFIG_XEN_PV, not CONFIG_PARAVIRT_XXL. Signed-off-by: Kirill A. Shutemov Signed-off-by: Dave Hansen Reviewed-by: Juergen Gross Link: https://lkml.kernel.org/r/20211130185533.32658-1-kirill.shutemov@linux.intel.com commit 4be1dbb75c3de6af1888fa79778388fd4e529543 Author: Kees Cook Date: Thu Nov 18 12:31:13 2021 -0800 netfilter: conntrack: Use memset_startat() to zero struct nf_conn In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Use memset_startat() to avoid confusing memset() about writing beyond the target struct member. Signed-off-by: Kees Cook Signed-off-by: Pablo Neira Ayuso commit fc5e0352ccb58508274de289c66832c7a0b68161 Author: GuoYong Zheng Date: Fri Nov 5 19:39:40 2021 +0800 ipvs: remove unused variable for ip_vs_new_dest The dest variable is not used after ip_vs_new_dest anymore in ip_vs_add_dest, do not need pass it to ip_vs_new_dest, remove it. Signed-off-by: GuoYong Zheng Acked-by: Julian Anastasov Acked-by: Simon Horman Signed-off-by: Pablo Neira Ayuso commit 1071d1ad31503cd45fabcdb5bfa778508f68f3a0 Author: Wolfram Sang Date: Tue Nov 30 22:32:47 2021 +0100 Revert "i2c: designware-pci: Add support for Fast Mode Plus and High Speed Mode" This reverts commit e8578547ce59ddba3651ac0e68dbcb6daa8ce790. Drivers should read these values from ACPI tables. Reported-by: Andy Shevchenko Signed-off-by: Wolfram Sang commit 606974c7aceb24d25870b0d58bad1adbba2f3158 Author: Wolfram Sang Date: Tue Nov 30 22:32:01 2021 +0100 Revert "i2c: designware-pci: Set ideal timing parameters for Elkhart Lake PSE" This reverts commit 36af188f795bd1b0d794dd735623979dc6b698d3. Drivers should read these values from ACPI tables. Reported-by: Andy Shevchenko Signed-off-by: Wolfram Sang commit f4c35356e0fce4bbe2994185cc014f13630a1a1d Author: Dinh Nguyen Date: Tue Nov 30 14:10:44 2021 -0600 arm64: dts: n5x: add qspi, usb, and ethernet support Populate the N5X board dts file with support for QSPI, USB, and ethernet. Signed-off-by: Dinh Nguyen commit b98057ef730ad91b35d96658d9d8a306b618b8e5 Merge: 88691e9e1ef59 ec151037af4f5 Author: Alexei Starovoitov Date: Tue Nov 30 10:56:28 2021 -0800 Merge branch 'Add bpf_loop helper' Joanne Koong says: ==================== This patchset add a new helper, bpf_loop. One of the complexities of using for loops in bpf programs is that the verifier needs to ensure that in every possibility of the loop logic, the loop will always terminate. As such, there is a limit on how many iterations the loop can do. The bpf_loop helper moves the loop logic into the kernel and can thereby guarantee that the loop will always terminate. The bpf_loop helper simplifies a lot of the complexity the verifier needs to check, as well as removes the constraint on the number of loops able to be run. From the test results, we see that using bpf_loop in place of the traditional for loop led to a decrease in verification time and number of bpf instructions by ~99%. The benchmark results show that as the number of iterations increases, the overhead per iteration decreases. The high-level overview of the patches - Patch 1 - kernel-side + API changes for adding bpf_loop Patch 2 - tests Patch 3 - use bpf_loop in strobemeta + pyperf600 and measure verifier performance Patch 4 - benchmark for throughput + latency of bpf_loop call v3 -> v4: ~ Address nits: use usleep for triggering bpf programs, fix copyright style v2 -> v3: ~ Rerun benchmarks on physical machine, update results ~ Propagate original error codes in the verifier v1 -> v2: ~ Change helper name to bpf_loop (instead of bpf_for_each) ~ Set max nr_loops (~8 million loops) for bpf_loop call ~ Split tests + strobemeta/pyperf600 changes into two patches ~ Add new ops_report_final helper for outputting throughput and latency ==================== Signed-off-by: Alexei Starovoitov commit ec151037af4f56065d5b258af82f13dbbf279ebd Author: Joanne Koong Date: Mon Nov 29 19:06:22 2021 -0800 selftest/bpf/benchs: Add bpf_loop benchmark Add benchmark to measure the throughput and latency of the bpf_loop call. Testing this on my dev machine on 1 thread, the data is as follows: nr_loops: 10 bpf_loop - throughput: 198.519 ± 0.155 M ops/s, latency: 5.037 ns/op nr_loops: 100 bpf_loop - throughput: 247.448 ± 0.305 M ops/s, latency: 4.041 ns/op nr_loops: 500 bpf_loop - throughput: 260.839 ± 0.380 M ops/s, latency: 3.834 ns/op nr_loops: 1000 bpf_loop - throughput: 262.806 ± 0.629 M ops/s, latency: 3.805 ns/op nr_loops: 5000 bpf_loop - throughput: 264.211 ± 1.508 M ops/s, latency: 3.785 ns/op nr_loops: 10000 bpf_loop - throughput: 265.366 ± 3.054 M ops/s, latency: 3.768 ns/op nr_loops: 50000 bpf_loop - throughput: 235.986 ± 20.205 M ops/s, latency: 4.238 ns/op nr_loops: 100000 bpf_loop - throughput: 264.482 ± 0.279 M ops/s, latency: 3.781 ns/op nr_loops: 500000 bpf_loop - throughput: 309.773 ± 87.713 M ops/s, latency: 3.228 ns/op nr_loops: 1000000 bpf_loop - throughput: 262.818 ± 4.143 M ops/s, latency: 3.805 ns/op >From this data, we can see that the latency per loop decreases as the number of loops increases. On this particular machine, each loop had an overhead of about ~4 ns, and we were able to run ~250 million loops per second. Signed-off-by: Joanne Koong Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211130030622.4131246-5-joannekoong@fb.com commit f6e659b7f97c76d0471d12bf274ea2a097cf3c5c Author: Joanne Koong Date: Mon Nov 29 19:06:21 2021 -0800 selftests/bpf: Measure bpf_loop verifier performance This patch tests bpf_loop in pyperf and strobemeta, and measures the verifier performance of replacing the traditional for loop with bpf_loop. The results are as follows: ~strobemeta~ Baseline verification time 6808200 usec stack depth 496 processed 554252 insns (limit 1000000) max_states_per_insn 16 total_states 15878 peak_states 13489 mark_read 3110 #192 verif_scale_strobemeta:OK (unrolled loop) Using bpf_loop verification time 31589 usec stack depth 96+400 processed 1513 insns (limit 1000000) max_states_per_insn 2 total_states 106 peak_states 106 mark_read 60 #193 verif_scale_strobemeta_bpf_loop:OK ~pyperf600~ Baseline verification time 29702486 usec stack depth 368 processed 626838 insns (limit 1000000) max_states_per_insn 7 total_states 30368 peak_states 30279 mark_read 748 #182 verif_scale_pyperf600:OK (unrolled loop) Using bpf_loop verification time 148488 usec stack depth 320+40 processed 10518 insns (limit 1000000) max_states_per_insn 10 total_states 705 peak_states 517 mark_read 38 #183 verif_scale_pyperf600_bpf_loop:OK Using the bpf_loop helper led to approximately a 99% decrease in the verification time and in the number of instructions. Signed-off-by: Joanne Koong Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211130030622.4131246-4-joannekoong@fb.com commit 4e5070b64b375a9c1f570893cfceeba108382bef Author: Joanne Koong Date: Mon Nov 29 19:06:20 2021 -0800 selftests/bpf: Add bpf_loop test Add test for bpf_loop testing a variety of cases: various nr_loops, null callback ctx, invalid flags, nested callbacks. Signed-off-by: Joanne Koong Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211130030622.4131246-3-joannekoong@fb.com commit e6f2dd0f80674e9d5960337b3e9c2a242441b326 Author: Joanne Koong Date: Mon Nov 29 19:06:19 2021 -0800 bpf: Add bpf_loop helper This patch adds the kernel-side and API changes for a new helper function, bpf_loop: long bpf_loop(u32 nr_loops, void *callback_fn, void *callback_ctx, u64 flags); where long (*callback_fn)(u32 index, void *ctx); bpf_loop invokes the "callback_fn" **nr_loops** times or until the callback_fn returns 1. The callback_fn can only return 0 or 1, and this is enforced by the verifier. The callback_fn index is zero-indexed. A few things to please note: ~ The "u64 flags" parameter is currently unused but is included in case a future use case for it arises. ~ In the kernel-side implementation of bpf_loop (kernel/bpf/bpf_iter.c), bpf_callback_t is used as the callback function cast. ~ A program can have nested bpf_loop calls but the program must still adhere to the verifier constraint of its stack depth (the stack depth cannot exceed MAX_BPF_STACK)) ~ Recursive callback_fns do not pass the verifier, due to the call stack for these being too deep. ~ The next patch will include the tests and benchmark Signed-off-by: Joanne Koong Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211130030622.4131246-2-joannekoong@fb.com commit 88691e9e1ef59fa917b2bc2df47d550e7635e73c Author: Christoph Hellwig Date: Fri Nov 19 17:32:15 2021 +0100 bpf, docs: Split general purpose eBPF documentation out of filter.rst filter.rst starts out documenting the classic BPF and then spills into introducing and documentating eBPF. Move the eBPF documentation into rwo new files under Documentation/bpf/ for the instruction set and the verifier and link to the BPF documentation from filter.rst. Signed-off-by: Christoph Hellwig Signed-off-by: Alexei Starovoitov Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20211119163215.971383-6-hch@lst.de commit bc84e959e5aed4a79597d03e810fd1d7067b4ff7 Author: Christoph Hellwig Date: Fri Nov 19 17:32:14 2021 +0100 bpf, docs: Move handling of maps to Documentation/bpf/maps.rst Move the general maps documentation into the maps.rst file from the overall networking filter documentation and add a link instead. Signed-off-by: Christoph Hellwig Signed-off-by: Alexei Starovoitov Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20211119163215.971383-5-hch@lst.de commit 06edc59c1fd7aababc8361655b20f4cc9870aef2 Author: Christoph Hellwig Date: Fri Nov 19 17:32:13 2021 +0100 bpf, docs: Prune all references to "internal BPF" The eBPF name has completely taken over from eBPF in general usage for the actual eBPF representation, or BPF for any general in-kernel use. Prune all remaining references to "internal BPF". Signed-off-by: Christoph Hellwig Signed-off-by: Alexei Starovoitov Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20211119163215.971383-4-hch@lst.de commit ccb00292eb2dbb58a55850639356d07630cd3c46 Author: Christoph Hellwig Date: Fri Nov 19 17:32:12 2021 +0100 bpf: Remove a redundant comment on bpf_prog_free The comment telling that the prog_free helper is freeing the program is not exactly useful, so just remove it. Signed-off-by: Christoph Hellwig Signed-off-by: Alexei Starovoitov Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20211119163215.971383-3-hch@lst.de commit 58ffa1b413690dbfdea86c068510339fe1573c33 Author: Christoph Hellwig Date: Fri Nov 19 17:32:11 2021 +0100 x86, bpf: Cleanup the top of file header in bpf_jit_comp.c Don't bother mentioning the file name as it is implied, and remove the reference to internal BPF. Signed-off-by: Christoph Hellwig Signed-off-by: Alexei Starovoitov Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20211119163215.971383-2-hch@lst.de commit 64430f70ba6fcd5872ac190f4ae3ddee3f48f00d Author: Jedrzej Jagielski Date: Fri Sep 17 08:52:52 2021 +0000 iavf: Fix displaying queue statistics shown by ethtool Driver provided too many lines as an output to ethtool -S command. Return actual length of string set of ethtool stats. Instead of predefined maximal value use the actual value on netdev, iterate over active queues. Without this patch, ethtool -S report would produce additional erroneous lines of queues that are not configured. Signed-off-by: Witold Fijalkowski Signed-off-by: Przemyslaw Patynowski Signed-off-by: Mateusz Palczewski Signed-off-by: Jedrzej Jagielski Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit c2fbcc94d511e963d7fefa91d5f5748e8906f1cf Author: Karen Sornek Date: Tue Aug 31 13:39:01 2021 +0200 iavf: Refactor string format to avoid static analysis warnings Change format to match variable type that is used in string. Use %u format for unsigned variable and %d format for signed variable to remove static analysis warnings. Signed-off-by: Michal Swiatkowski Signed-off-by: Karen Sornek Tested-by: George Kuruvinakunnel Signed-off-by: Tony Nguyen commit fbe66f57d371d787835f1f2a0612720f655bda2f Author: Karen Sornek Date: Tue Aug 31 12:12:02 2021 +0200 iavf: Refactor text of informational message This message is intended to be informational to indicate a reset is about to happen, but the use of "warning" in the message text can cause concern with users. Reword the message to make it less alarming. Signed-off-by: Bruce Allan Signed-off-by: Karen Sornek Tested-by: George Kuruvinakunnel Signed-off-by: Tony Nguyen commit 349181b7b86367bfe66341c6fc2708f01c568f0d Author: Karen Sornek Date: Mon Aug 30 10:38:01 2021 +0200 iavf: Fix static code analysis warning Change min() to min_t() to fix static code analysis warning of possible overflow. Signed-off-by: Paul Greenwalt Signed-off-by: Karen Sornek Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit 4d0dbd9678ad604963e9eab212fefb78a9fdb4aa Author: Jedrzej Jagielski Date: Mon Aug 30 08:25:36 2021 +0000 iavf: Refactor iavf_mac_filter struct memory usage iavf_mac_filter struct contained couple boolean flags using up more memory than is necessary. Change the flags to be bitfields in an anonymous struct so all the flags now fit in one byte. Signed-off-by: Sylwester Dziedziuch Signed-off-by: Jedrzej Jagielski Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit b231b59a2f96bbc3f4759d2e8ecaa1c71a9e7616 Author: Tony Nguyen Date: Fri Jul 16 15:16:37 2021 -0700 iavf: Enable setting RSS hash key Driver support for changing the RSS hash key exists, however, checks have caused it to be reported as unsupported. Remove the check and allow the hash key to be specified. Signed-off-by: Tony Nguyen Tested-by: Tony Brelinski commit bdb9e5c7aec73a7b8b5acab37587b6de1203e68d Author: Jedrzej Jagielski Date: Tue Jun 22 15:43:48 2021 +0200 iavf: Add trace while removing device Add kernel trace that device was removed. Currently there is no such information. I.e. Host admin removes a PCI device from a VM, than on VM shall be info about the event. This patch adds info log to iavf_remove function. Signed-off-by: Arkadiusz Kubalewski Signed-off-by: Jedrzej Jagielski Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit 9f4651ea3e07339b460d403ff01b7cc2178fef7b Author: Jacob Keller Date: Fri Jun 4 09:53:34 2021 -0700 iavf: return errno code instead of status code The iavf_parse_cls_flower function returns an integer error code, and not an iavf_status enumeration. Fix the function to use the standard errno value EINVAL as its return instead of using IAVF_ERR_CONFIG. Signed-off-by: Jacob Keller Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen commit f1db020ba4eff3b2a1e3de476fe39a0d836a5303 Author: Grzegorz Szczurek Date: Fri Jun 4 09:53:32 2021 -0700 iavf: Log info when VF is entering and leaving Allmulti mode Add log when VF is entering and leaving Allmulti mode. The change of VF state is visible in dmesg now. Without this commit, entering and leaving Allmulti mode is not logged in dmesg. Signed-off-by: Grzegorz Szczurek Tested-by: George Kuruvinakunnel Signed-off-by: Tony Nguyen commit aeb5d11fd1efc96fefed850782a1ab62c4624c82 Author: Patryk Małek Date: Fri Jun 4 09:53:30 2021 -0700 iavf: Add change MTU message Add a netdev_dbg log entry in case of a change of MTU so that user is notified about this change in the same manner as in case of pf driver. Signed-off-by: Patryk Małek Tested-by: George Kuruvinakunnel Signed-off-by: Tony Nguyen commit 754bb7ad29566b2789cafb6b378b788266d1f131 Author: Hector Martin Date: Wed Nov 17 23:19:16 2021 +0900 PCI: apple: Enable clock gating These pokes are not required to make the PCIe port work, but it sounds like this should save some power at least. Link: https://lore.kernel.org/r/20211117141916.197192-1-marcan@marcan.st Tested-by: Marc Zyngier Signed-off-by: Hector Martin Signed-off-by: Lorenzo Pieralisi Acked-by: Marc Zyngier commit f51b5e2b5943d26387d2abb463bce2b4bd0a4a8d Author: Jesper Dangaard Brouer Date: Mon Nov 15 21:36:30 2021 +0100 igc: enable XDP metadata in driver Enabling the XDP bpf_prog access to data_meta area is a very small change. Hint passing 'true' to xdp_prepare_buff(). The SKB layers can also access data_meta area, which required more driver changes to support. Reviewers, notice the igc driver have two different functions that can create SKBs, depending on driver config. Hint for testers, ethtool priv-flags legacy-rx enables the function igc_construct_skb() ethtool --set-priv-flags DEV legacy-rx on Signed-off-by: Jesper Dangaard Brouer Tested-by: Nechama Kraus Reviewed-by: Alexander Lobakin Signed-off-by: Tony Nguyen commit 673c68bd48390dad01f7d17670de3e33b60860ac Author: Biju Das Date: Tue Nov 30 15:57:57 2021 +0000 thermal/drivers: Add TSU driver for RZ/G2L The RZ/G2L SoC incorporates a thermal sensor unit (TSU) that measures the temperature inside the LSI. The thermal sensor in this unit measures temperatures in the range from −40 degree Celsius to 125 degree Celsius with an accuracy of ±3°C. The TSU repeats measurement at 20 microseconds intervals and automatically updates the results of measurement. The TSU has no interrupts as well as no external pins. This patch adds Thermal Sensor Unit(TSU) driver for RZ/G2L SoC. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211130155757.17837-3-biju.das.jz@bp.renesas.com Signed-off-by: Daniel Lezcano commit 9460347192add5644236d492f79ecab6d83504d4 Author: Biju Das Date: Tue Nov 30 15:57:56 2021 +0000 dt-bindings: thermal: Document Renesas RZ/G2L TSU Document the Thermal Sensor Unit(TSU) in the RZ/G2L SoC. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211130155757.17837-2-biju.das.jz@bp.renesas.com Signed-off-by: Daniel Lezcano commit 4fa8fcd3440101dbacf4fae91de69877ef751977 Author: Jesper Dangaard Brouer Date: Mon Nov 15 21:36:25 2021 +0100 igc: AF_XDP zero-copy metadata adjust breaks SKBs on XDP_PASS Driver already implicitly supports XDP metadata access in AF_XDP zero-copy mode, as xsk_buff_pool's xp_alloc() naturally set xdp_buff data_meta equal data. This works fine for XDP and AF_XDP, but if a BPF-prog adjust via bpf_xdp_adjust_meta() and choose to call XDP_PASS, then igc function igc_construct_skb_zc() will construct an invalid SKB packet. The function correctly include the xdp->data_meta area in the memcpy, but forgot to pull header to take metasize into account. Fixes: fc9df2a0b520 ("igc: Enable RX via AF_XDP zero-copy") Signed-off-by: Jesper Dangaard Brouer Tested-by: Nechama Kraus Acked-by: Maciej Fijalkowski Signed-off-by: Tony Nguyen commit 244714da8d5d088faa2e0e32ba84ca1913a093ef Author: Shiraz Saleem Date: Wed Nov 24 06:41:36 2021 -0600 net/ice: Remove unused enum Remove ice_devlink_param_id enum as its not used. Suggested-by: Parav Pandit Signed-off-by: Shiraz Saleem Signed-off-by: Tony Nguyen commit 7b62483f64dd61e6483c75b514c821fe0e339af3 Author: Shiraz Saleem Date: Wed Nov 24 06:41:35 2021 -0600 net/ice: Fix boolean assignment vbool in ice_devlink_enable_roce_get can be assigned to a non-0/1 constant. Fix this assignment of vbool to be 0/1. Fixes: e523af4ee560 ("net/ice: Add support for enable_iwarp and enable_roce devlink param") Suggested-by: Parav Pandit Signed-off-by: Shiraz Saleem Signed-off-by: Tony Nguyen commit 322fa4315400807c697b034b4694f0a074cc1258 Author: Amadeusz Sławiński Date: Fri Nov 26 15:03:55 2021 +0100 ASoC: Intel: Skylake: Use NHLT API to search for blob With NHLT enriched with new search functions, remove local code in favour of them. This also fixes broken behaviour: search should be based on significant bits count rather than container size. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Acked-by: Mark Brown Link: https://lore.kernel.org/r/20211126140355.1042684-4-cezary.rojewski@intel.com Signed-off-by: Takashi Iwai commit 8235a08bbc6be993c5de1de1f5d7a07110831248 Author: Amadeusz Sławiński Date: Fri Nov 26 15:03:54 2021 +0100 ALSA: hda: Simplify DMIC-in-NHLT check Only DMIC endpoint presence is relevant, not its configuration. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20211126140355.1042684-3-cezary.rojewski@intel.com Signed-off-by: Takashi Iwai commit 15fa179f3f45415696d376abc84e0098a9586b33 Author: Amadeusz Sławiński Date: Fri Nov 26 15:03:53 2021 +0100 ALSA: hda: Fill gaps in NHLT endpoint-interface Two key operations missings are: endpoint presence-check and retrieval of matching endpoint hardware configuration (blob). Add operations for both use cases. Signed-off-by: Amadeusz Sławiński Signed-off-by: Cezary Rojewski Link: https://lore.kernel.org/r/20211126140355.1042684-2-cezary.rojewski@intel.com Signed-off-by: Takashi Iwai commit c99907c723c6f3f6cae63201ddfac610be13f997 Author: Christian König Date: Thu Nov 11 10:46:46 2021 +0100 dma-buf: make fence mandatory for dma_resv_add_excl_fence v2 Calling dma_resv_add_excl_fence() with the fence as NULL and expecting that that this frees up the fences is simply abuse of the internals of the dma_resv object. v2: drop the fence pruning completely. Signed-off-by: Christian König Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20211129120659.1815-4-christian.koenig@amd.com commit f8be2c5971f48dacbd0e6daa44184dbb6f283dc4 Author: Christian König Date: Fri Nov 26 17:11:21 2021 +0100 drm/ttm: stop pruning fences after wait This is just abusing internals of the dma_resv object. Signed-off-by: Christian König Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20211129120659.1815-3-christian.koenig@amd.com commit f7fd7814f34c97a6c3388b25db18643309cff43c Author: Maarten Lankhorst Date: Thu Oct 21 12:35:40 2021 +0200 drm/i915: Remove dma_resv_prune The signaled bit is already used for quick testing if a fence is signaled. Signed-off-by: Maarten Lankhorst Acked-by: Christian König Link: https://patchwork.freedesktop.org/patch/460722/ Signed-off-by: Christian König commit 8152d2a9e73deb2b483bef9035d53ded27f50317 Author: Rikard Falkeborn Date: Sun Nov 28 22:46:41 2021 +0100 thermal/drivers/intel_powerclamp: Constify static thermal_cooling_device_ops The only usage of powerclamp_cooling_ops is to pass its address to thermal_cooling_device_register(), which takes a pointer to const struct thermal_cooling_device_ops. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn Link: https://lore.kernel.org/r/20211128214641.30953-1-rikard.falkeborn@gmail.com Signed-off-by: Daniel Lezcano commit 4cf2ddf16e175ee18c5c29865c32da7d6269cf44 Author: Oleksij Rempel Date: Wed Nov 17 11:34:26 2021 +0100 thermal/drivers/imx: Implement runtime PM support Starting with commit d92ed2c9d3ff ("thermal: imx: Use driver's local data to decide whether to run a measurement") this driver stared using irq_enabled flag to make decision to power on/off the thermal core. This triggered a regression, where after reaching critical temperature, alarm IRQ handler set irq_enabled to false, disabled thermal core and was not able read temperature and disable cooling sequence. In case the cooling device is "CPU/GPU freq", the system will run with reduce performance until next reboot. To solve this issue, we need to move all parts implementing hand made runtime power management and let it handle actual runtime PM framework. Fixes: d92ed2c9d3ff ("thermal: imx: Use driver's local data to decide whether to run a measurement") Signed-off-by: Oleksij Rempel Tested-by: Petr Beneš Link: https://lore.kernel.org/r/20211117103426.81813-1-o.rempel@pengutronix.de Signed-off-by: Daniel Lezcano commit c291d0a4d169811898d723cfa5f1aa1fc60e607c Author: Mehrdad Arshad Rad Date: Sun Nov 28 11:33:37 2021 -0800 libbpf: Remove duplicate assignments There is a same action when load_attr.attach_btf_id is initialized. Signed-off-by: Mehrdad Arshad Rad Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20211128193337.10628-1-arshad.rad@gmail.com commit c7a75d07827a1f33d566e18e6098379cc2a0c2b2 Author: Rob Herring Date: Mon Nov 29 11:36:37 2021 -0600 PCI: xgene: Fix IB window setup Commit 6dce5aa59e0b ("PCI: xgene: Use inbound resources for setup") broke PCI support on XGene. The cause is the IB resources are now sorted in address order instead of being in DT dma-ranges order. The result is which inbound registers are used for each region are swapped. I don't know the details about this h/w, but it appears that IB region 0 registers can't handle a size greater than 4GB. In any case, limiting the size for region 0 is enough to get back to the original assignment of dma-ranges to regions. Link: https://lore.kernel.org/all/CA+enf=v9rY_xnZML01oEgKLmvY1NGBUUhnSJaETmXtDtXfaczA@mail.gmail.com/ Link: https://lore.kernel.org/r/20211129173637.303201-1-robh@kernel.org Fixes: 6dce5aa59e0b ("PCI: xgene: Use inbound resources for setup") Reported-by: Stéphane Graber Tested-by: Stéphane Graber Signed-off-by: Rob Herring Signed-off-by: Lorenzo Pieralisi Reviewed-by: Krzysztof Wilczyński Cc: stable@vger.kernel.org # v5.5+ commit 86baad1941702aa9b6fb44d6f150a34e9e4e1fae Author: Christian König Date: Fri Sep 24 10:04:00 2021 +0200 drm/qxl: use iterator instead of dma_resv_shared_list I'm not sure why it is useful to know the number of fences in the reservation object, but we try to avoid exposing the dma_resv_shared_list() function. So use the iterator instead. If more information is desired we could use dma_resv_describe() as well. Signed-off-by: Christian König Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20211129120659.1815-5-christian.koenig@amd.com commit d07fef2fcd4d79198a700f4b4d2ca4670649c9ff Author: Adam Ward Date: Mon Nov 29 22:10:11 2021 +0000 regulator: da9121: Add DA914x binding info Add the configuration for the DA9141 and DA9142 regulators. Also tidy the table, cleaning away superfluous information. Signed-off-by: Adam Ward Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/9293e3ae4ff8776704257085df65516b81209b87.1638223185.git.Adam.Ward.opensource@diasemi.com Signed-off-by: Mark Brown commit b9c044b7d63b2ffae9664349721c80c4ab3e56c9 Author: Adam Ward Date: Mon Nov 29 22:10:10 2021 +0000 regulator: da9121: Remove erroneous compatible from binding Clean away information from a test that was included accidentally Signed-off-by: Adam Ward Acked-by: Rob Herring Link: https://lore.kernel.org/r/530a626cee6bc12ff5b4ab16319ac7a1fac6e306.1638223185.git.Adam.Ward.opensource@diasemi.com Signed-off-by: Mark Brown commit c5187a245e9bb0af2da8d37ede191569c824c66b Author: Adam Ward Date: Mon Nov 29 22:10:13 2021 +0000 regulator: da9121: Add DA914x support Add the DA9141 and DA9142 regulators device recognition data and operational parameters. Signed-off-by: Adam Ward Link: https://lore.kernel.org/r/5f5b9b02f07578cd36c6bc266349a56efc9b08d1.1638223185.git.Adam.Ward.opensource@diasemi.com Signed-off-by: Mark Brown commit 24f0853228f3b98f1ef08d5824376c69bb8124d2 Author: Adam Ward Date: Mon Nov 29 22:10:12 2021 +0000 regulator: da9121: Prevent current limit change when enabled Prevent changing current limit when enabled as a precaution against possibile instability due to tight integration with switching cycle Signed-off-by: Adam Ward Link: https://lore.kernel.org/r/52ee682476004a1736c1e0293358987319c1c415.1638223185.git.Adam.Ward.opensource@diasemi.com Signed-off-by: Mark Brown commit f316c9d9ba8ea08d6994bc5ba8fa276eab186208 Author: Mac Chiang Date: Wed Nov 24 22:04:53 2021 -0500 ASoC: Intel: boards: add max98390 2/4 speakers support support 2 hw boards. 1. SSP2 connects max98390, 2 speakers. 2. SSP1 connects max98390, 2/4 speakers. 2 or 4 speakers playback add echo reference capture add bt offload support add DMI_OEM_STRING for board variants add ALC5682I-VS support Signed-off-by: Mark Hsieh Signed-off-by: Mac Chiang Signed-off-by: Kieth Tzeng Signed-off-by: Brent Lu Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20211125030453.4382-1-mac.chiang@intel.com Signed-off-by: Mark Brown commit 91745b034dca6044407b559fe28dd1cf7efccc29 Author: Colin Ian King Date: Mon Nov 29 22:42:36 2021 +0000 ASoC: mediatek: mt8195: make several arrays static const Don't populate various arrays on the stack but instead make them static const. Also makes the object code smaller by a few hundred bytes. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20211129224236.506883-1-colin.i.king@gmail.com Signed-off-by: Mark Brown commit 043c0a6278ca443b1835726239dc2814c1313a9e Author: Charles Keepax Date: Tue Nov 30 10:28:42 2021 +0000 firmware: cs_dsp: Move lockdep asserts to avoid potential null pointer Move the lockdep asserts until after the ctl pointer has been checked for NULL, to avoid potentially NULL pointer dereferences. Fixes: fb2f364fb5b9 ("firmware: cs_dsp: Add lockdep asserts to interface functions") Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20211130102842.26410-1-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 10b155fd413d31c89057986d0fc3d4ceef8e0e9f Author: Rikard Falkeborn Date: Sat Nov 27 10:19:54 2021 +0100 ASoC: intel: boards: bytcht*: Constify static snd_soc_ops These are only assigned to the ops fields 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 Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20211127091954.12075-1-rikard.falkeborn@gmail.com Signed-off-by: Mark Brown commit 11918cdcffb127b6b35fe5c438e2ca8aa78249d0 Author: Chris Down Date: Sun Nov 28 14:31:46 2021 +0000 ASoC: Intel: hda_dsp_common: don't multiline PCM topology warning On my T14s Gen2 I saw the following: [ 16.057258] skl_hda_dsp_generic skl_hda_dsp_generic: hda_dsp_hdmi_build_controls: no PCM in topology for HDMI converter 3 [ 16.057261] skl_hda_dsp_generic skl_hda_dsp_generic: hda_dsp_hdmi_build_controls: no PCM in topology for HDMI converter 4 [ 16.057263] skl_hda_dsp_generic skl_hda_dsp_generic: hda_dsp_hdmi_build_controls: no PCM in topology for HDMI converter 5 [...and so on.] It looks like the double newline is a mistake, so remove one. Signed-off-by: Chris Down Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/YaOS0sBueAfApwOx@chrisdown.name Signed-off-by: Mark Brown commit 8752d9a82fd065ef60c9a0e0e8ec820327509382 Author: Rikard Falkeborn Date: Sat Nov 27 10:31:47 2021 +0100 ASoC: mediatek: mt8195: Constify static snd_soc_ops These are only assigned to the ops field in the snd_soc_dai_link 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 Link: https://lore.kernel.org/r/20211127093147.17368-1-rikard.falkeborn@gmail.com Signed-off-by: Mark Brown commit 196073f9c44be0b4758ead11e51bc2875f98df29 Author: Wei Yongjun Date: Tue Nov 30 10:48:40 2021 +0000 net: ixp4xx_hss: drop kfree for memory allocated with devm_kzalloc It's not necessary to free memory allocated with devm_kzalloc and using kfree leads to a double free. Fixes: 35aefaad326b ("net: ixp4xx_hss: Convert to use DT probing") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun Signed-off-by: David S. Miller commit 9c32950f24f9e7df158887bdc80e5b79fbf5ed8d Author: Lv Ruyi Date: Tue Nov 30 11:24:43 2021 +0000 net: mscc: ocelot: fix mutex_lock not released If err is true, the function will be returned, but mutex_lock isn't released. Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Signed-off-by: David S. Miller commit c0190879323f88be22a0debda814680dc6e66751 Author: Wei Yongjun Date: Tue Nov 30 11:34:37 2021 +0000 net: hns3: make symbol 'hclge_mac_speed_map_to_fw' static The sparse tool complains as follows: drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c:2656:28: warning: symbol 'hclge_mac_speed_map_to_fw' was not declared. Should it be static? This symbol is not used outside of hclge_main.c, so marks it static. Fixes: e46da6a3d4d3 ("net: hns3: refine function hclge_cfg_mac_speed_dup_hw()") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun Signed-off-by: David S. Miller commit 9ace2300fc42b1df8c64bcbbcc58fe9bad78cd6b Merge: 4c897cfc46a55 adefefe5289ce Author: David S. Miller Date: Tue Nov 30 12:26:01 2021 +0000 Merge branch 'prestera-next' Volodymyr Mytnyk says: ==================== net: prestera: acl: migrate to new vTcam/counter api This patch series aims to use new vTcam and Counter API provided by latest fw version. The advantage of using this API is the following: - provides a way to have a rule with desired Tcam size (improves Tcam memory utilization). - batch support for acl counters gathering (improves performance) - gives more control over HW ACL engine (actions/matches/bindings) to be able to support more features in the future driver versions Note: the feature set left the same as was before this patch. ==================== Signed-off-by: David S. Miller commit adefefe5289ceb27bb14cf1cb1cc4e16834c7185 Author: Volodymyr Mytnyk Date: Tue Nov 30 12:33:00 2021 +0200 net: prestera: acl: add rule stats support Make flower to use counter API to get rule HW statistics. Co-developed-by: Serhiy Boiko Signed-off-by: Serhiy Boiko Signed-off-by: Volodymyr Mytnyk Signed-off-by: David S. Miller commit 6e36c7bcb4611414b339173cdc33fdcb55c08f9e Author: Volodymyr Mytnyk Date: Tue Nov 30 12:32:59 2021 +0200 net: prestera: add counter HW API Add counter API for getting HW statistics. - HW statistics gathered by this API are deleyed. - Batch of conters is supported. - acl stat is supported. Co-developed-by: Serhiy Boiko Signed-off-by: Serhiy Boiko Signed-off-by: Volodymyr Mytnyk Signed-off-by: David S. Miller commit 47327e198d42c77322dbe175817499d2d7ddc26a Author: Volodymyr Mytnyk Date: Tue Nov 30 12:32:58 2021 +0200 net: prestera: acl: migrate to new vTCAM api - Add new vTCAM HW API to configure HW ACLs. - Migrate acl to use new vTCAM HW API. - No counter support in this patch-set. Co-developed-by: Yevhen Orlov Signed-off-by: Yevhen Orlov Signed-off-by: Volodymyr Mytnyk Signed-off-by: David S. Miller commit 4c897cfc46a554a523343fc3296333c473a2fc52 Author: Leon Romanovsky Date: Tue Nov 30 12:16:20 2021 +0200 devlink: Simplify devlink resources unregister call The devlink_resources_unregister() used second parameter as an entry point for the recursive removal of devlink resources. None of the callers outside of devlink core needed to use this field, so let's remove it. As part of this removal, the "struct devlink_resource" was moved from .h to .c file as it is not possible to use in any place in the code except devlink.c. Signed-off-by: Leon Romanovsky Signed-off-by: David S. Miller commit c448c898ae890d966a48c8031b199fda9c6a1d93 Author: Horatiu Vultur Date: Tue Nov 30 10:57:45 2021 +0100 net: mdio: mscc-miim: Set back the optional resource. In the blamed commit, the second memory resource was not considered anymore as optional. On some platforms like sparx5 the second resource is optional. So add it back as optional and restore the comment that says so. Fixes: a27a762828375a ("net: mdio: mscc-miim: convert to a regmap implementation") Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 94dd016ae538b12ea665015e5fd0c9844b184005 Author: Hangbin Liu Date: Tue Nov 30 15:09:32 2021 +0800 bond: pass get_ts_info and SIOC[SG]HWTSTAMP ioctl to active device We have VLAN PTP support(via get_ts_info) on kernel, and bond support(by getting active interface via netlink message) on userspace tool linuxptp. But there are always some users who want to use PTP with VLAN over bond, which is not able to do with the current implementation. This patch passed get_ts_info and SIOC[SG]HWTSTAMP ioctl to active device with bond mode active-backup/tlb/alb. With this users could get kernel native bond or VLAN over bond PTP support. Test with ptp4l and it works with VLAN over bond after this patch: ]# ptp4l -m -i bond0.23 ptp4l[53377.141]: selected /dev/ptp4 as PTP clock ptp4l[53377.142]: port 1: INITIALIZING to LISTENING on INIT_COMPLETE ptp4l[53377.143]: port 0: INITIALIZING to LISTENING on INIT_COMPLETE ptp4l[53377.143]: port 0: INITIALIZING to LISTENING on INIT_COMPLETE ptp4l[53384.127]: port 1: LISTENING to MASTER on ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES ptp4l[53384.127]: selected local clock e41d2d.fffe.123db0 as best master ptp4l[53384.127]: port 1: assuming the grand master role Signed-off-by: Hangbin Liu Signed-off-by: David S. Miller commit 6167597d442f6676c6b79a05d5cba18967dca366 Author: Jean Sacren Date: Tue Nov 30 00:03:11 2021 -0700 net: cxgb: fix a typo in kernel doc Fix a trivial typo of 'pakcet' in cxgb kernel doc. Signed-off-by: Jean Sacren Signed-off-by: David S. Miller commit 067bb3c307ccb8432cf5e3f66805c3a2f2b0d601 Author: Jean Sacren Date: Tue Nov 30 00:03:10 2021 -0700 net: cxgb3: fix typos in kernel doc Fix two trivial typos of 'pakcet' in cxgb3 kernel doc. Signed-off-by: Jean Sacren Signed-off-by: David S. Miller commit 5944b5abd8646e8c6ac6af2b55f87dede1dae898 Author: Hangbin Liu Date: Tue Nov 30 12:29:47 2021 +0800 Bonding: add arp_missed_max option Currently, we use hard code number to verify if we are in the arp_interval timeslice. But some user may want to reduce/extend the verify timeslice. With the similar team option 'missed_max' the uers could change that number based on their own environment. Acked-by: Jay Vosburgh Signed-off-by: Hangbin Liu Signed-off-by: David S. Miller commit b95b668eaaa2574e8ee72f143c52075e9955177e Author: Mike Tipton Date: Thu Nov 25 19:47:51 2021 +0200 interconnect: qcom: icc-rpmh: Add BCMs to commit list in pre_aggregate We're only adding BCMs to the commit list in aggregate(), but there are cases where pre_aggregate() is called without subsequently calling aggregate(). In particular, in icc_sync_state() when a node with initial BW has zero requests. Since BCMs aren't added to the commit list in these cases, we don't actually send the zero BW request to HW. So the resources remain on unnecessarily. Add BCMs to the commit list in pre_aggregate() instead, which is always called even when there are no requests. Signed-off-by: Mike Tipton [georgi: remove icc_sync_state for platforms with incomplete support] Link: https://lore.kernel.org/r/20211125174751.25317-1-djakov@kernel.org Signed-off-by: Georgi Djakov commit 2680ce7fc9939221da16e86a2e73cc1df563c82c Author: Yang Yingliang Date: Tue Nov 30 11:38:37 2021 +0800 net: lantiq: fix missing free_netdev() on error in ltq_etop_probe() Add the missing free_netdev() before return from ltq_etop_probe() in the error handling case. Fixes: 14d4e308e0aa ("net: lantiq: configure the burst length in ethernet drivers") Signed-off-by: Yang Yingliang Signed-off-by: David S. Miller commit 19cf41b64e3b150cf64fa01dec13f20dc86d95b2 Author: Peter Collingbourne Date: Tue Nov 16 18:07:24 2021 -0800 lontium-lt9611: check a different register bit for HDMI sensing It has been observed that with certain monitors such as the HP Z27n, the register 0x825e reads a value of 0x79 when the HDMI cable is connected and 0x78 when it is disconnected, i.e. bit 0 appears to correspond to the HDMI connection status and bit 2 is never set. Therefore, change the driver to check bit 0 instead of bit 2. Signed-off-by: Peter Collingbourne Link: https://linux-review.googlesource.com/id/I7e76411127e1ce4988a3f6d0c8ba5f1c3d880c23 Reviewed-by: Vinod Koul Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20211117020724.2647769-1-pcc@google.com commit 6130805066659cda3d685fc4c8d912c72a005ef5 Author: Nikolay Aleksandrov Date: Mon Nov 29 17:44:11 2021 +0200 net: ipv6: use the new fib6_nh_release_dsts helper in fib6_nh_release We can remove a bit of code duplication by reusing the new fib6_nh_release_dsts helper in fib6_nh_release. Their only difference is that fib6_nh_release's version doesn't use atomic operation to swap the pointers because it assumes the fib6_nh is no longer visible, while fib6_nh_release_dsts can be used anywhere. Suggested-by: David Ahern Signed-off-by: Nikolay Aleksandrov Reviewed-by: David Ahern Signed-off-by: David S. Miller commit 7709efa62c4fd2a79d154579ea19be34f9fa9a31 Author: Nikolay Aleksandrov Date: Mon Nov 29 14:09:24 2021 +0200 net: nexthop: reduce rcu synchronizations when replacing resilient groups We can optimize resilient nexthop group replaces by reducing the number of synchronize_net calls. After commit 1005f19b9357 ("net: nexthop: release IPv6 per-cpu dsts when replacing a nexthop group") we always do a synchronize_net because we must ensure no new dsts can be created for the replaced group's removed nexthops, but we already did that when replacing resilient groups, so if we always call synchronize_net after any group type replacement we'll take care of both cases and reduce synchronize_net calls for resilient groups. Suggested-by: Ido Schimmel Signed-off-by: Nikolay Aleksandrov Reviewed-by: Ido Schimmel Tested-by: Ido Schimmel Reviewed-by: David Ahern Signed-off-by: David S. Miller commit dc2724a64e72429856fc22d8eb015225af63129e Author: Tianjia Zhang Date: Mon Nov 29 19:10:14 2021 +0800 net/tls: simplify the tls_set_sw_offload function Assigning crypto_info variables in advance can simplify the logic of accessing value and move related local variables to a smaller scope. Signed-off-by: Tianjia Zhang Reviewed-by: Jakub Kicinski Signed-off-by: David S. Miller commit 4047b9db1aa7512a10ba3560a3f63821c8c40235 Author: Bhupesh Sharma Date: Mon Nov 29 01:28:54 2021 +0530 net: stmmac: Add platform level debug register dump feature dwmac-qcom-ethqos currently exposes a mechanism to dump rgmii registers after the 'stmmac_dvr_probe()' returns. However with commit 5ec55823438e ("net: stmmac: add clocks management for gmac driver"), we now let 'pm_runtime_put()' disable the clocks before returning from 'stmmac_dvr_probe()'. This causes a crash when 'rgmii_dump()' register dumps are enabled, as the clocks are already off. Since other dwmac drivers (possible future users as well) might require a similar register dump feature, introduce a platform level callback to allow the same. This fixes the crash noticed while enabling rgmii_dump() dumps in dwmac-qcom-ethqos driver as well. It also allows future changes to keep a invoking the register dump callback from the correct place inside 'stmmac_dvr_probe()'. Fixes: 5ec55823438e ("net: stmmac: add clocks management for gmac driver") Cc: Joakim Zhang Cc: David S. Miller Signed-off-by: Bhupesh Sharma Signed-off-by: David S. Miller commit af11dee4361b3519981fa04d014873f9d9edd6ac Author: Christophe Leroy Date: Tue Nov 30 09:42:37 2021 +0100 powerpc/32s: Fix shift-out-of-bounds in KASAN init ================================================================================ UBSAN: shift-out-of-bounds in arch/powerpc/mm/kasan/book3s_32.c:22:23 shift exponent -1 is negative CPU: 0 PID: 0 Comm: swapper Not tainted 5.15.5-gentoo-PowerMacG4 #9 Call Trace: [c214be60] [c0ba0048] dump_stack_lvl+0x80/0xb0 (unreliable) [c214be80] [c0b99288] ubsan_epilogue+0x10/0x5c [c214be90] [c0b98fe0] __ubsan_handle_shift_out_of_bounds+0x94/0x138 [c214bf00] [c1c0f010] kasan_init_region+0xd8/0x26c [c214bf30] [c1c0ed84] kasan_init+0xc0/0x198 [c214bf70] [c1c08024] setup_arch+0x18/0x54c [c214bfc0] [c1c037f0] start_kernel+0x90/0x33c [c214bff0] [00003610] 0x3610 ================================================================================ This happens when the directly mapped memory is a power of 2. Fix it by checking the shift and set the result to 0 when shift is -1 Fixes: 7974c4732642 ("powerpc/32s: Implement dedicated kasan_init_region()") Reported-by: Erhard Furtner Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://bugzilla.kernel.org/show_bug.cgi?id=215169 Link: https://lore.kernel.org/r/15cbc3439d4ad988b225e2119ec99502a5cc6ad3.1638261744.git.christophe.leroy@csgroup.eu commit df1f679d19edb9eeb67cc2f96b29375f21991945 Author: Christophe Leroy Date: Tue Nov 30 10:32:42 2021 +0100 powerpc/powermac: Add missing lockdep_register_key() KeyWest i2c @0xf8001003 irq 42 /uni-n@f8000000/i2c@f8001000 BUG: key c2d00cbc has not been registered! ------------[ cut here ]------------ DEBUG_LOCKS_WARN_ON(1) WARNING: CPU: 0 PID: 1 at kernel/locking/lockdep.c:4801 lockdep_init_map_type+0x4c0/0xb4c Modules linked in: CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.15.5-gentoo-PowerMacG4 #9 NIP: c01a9428 LR: c01a9428 CTR: 00000000 REGS: e1033cf0 TRAP: 0700 Not tainted (5.15.5-gentoo-PowerMacG4) MSR: 00029032 CR: 24002002 XER: 00000000 GPR00: c01a9428 e1033db0 c2d1cf20 00000016 00000004 00000001 c01c0630 e1033a73 GPR08: 00000000 00000000 00000000 e1033db0 24002004 00000000 f8729377 00000003 GPR16: c1829a9c 00000000 18305357 c1416fc0 c1416f80 c006ac60 c2d00ca8 c1416f00 GPR24: 00000000 c21586f0 c2160000 00000000 c2d00cbc c2170000 c216e1a0 c2160000 NIP [c01a9428] lockdep_init_map_type+0x4c0/0xb4c LR [c01a9428] lockdep_init_map_type+0x4c0/0xb4c Call Trace: [e1033db0] [c01a9428] lockdep_init_map_type+0x4c0/0xb4c (unreliable) [e1033df0] [c1c177b8] kw_i2c_add+0x334/0x424 [e1033e20] [c1c18294] pmac_i2c_init+0x9ec/0xa9c [e1033e80] [c1c1a790] smp_core99_probe+0xbc/0x35c [e1033eb0] [c1c03cb0] kernel_init_freeable+0x190/0x5a4 [e1033f10] [c000946c] kernel_init+0x28/0x154 [e1033f30] [c0035148] ret_from_kernel_thread+0x14/0x1c Add missing lockdep_register_key() Reported-by: Erhard Furtner Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/69e4f55565bb45ebb0843977801b245af0c666fe.1638264741.git.christophe.leroy@csgroup.eu commit f1797e4de1146009c888bcf8b6bb6648d55394f1 Author: Christophe Leroy Date: Tue Nov 30 11:10:43 2021 +0100 powerpc/modules: Don't WARN on first module allocation attempt module_alloc() first tries to allocate module text within 24 bits direct jump from kernel text, and tries a wider allocation if first one fails. When first allocation fails the following is observed in kernel logs: vmap allocation for size 2400256 failed: use vmalloc= to increase size systemd-udevd: vmalloc error: size 2395133, vm_struct allocation failed, mode:0xcc0(GFP_KERNEL), nodemask=(null) CPU: 0 PID: 127 Comm: systemd-udevd Tainted: G W 5.15.5-gentoo-PowerMacG4 #9 Call Trace: [e2a53a50] [c0ba0048] dump_stack_lvl+0x80/0xb0 (unreliable) [e2a53a70] [c0540128] warn_alloc+0x11c/0x2b4 [e2a53b50] [c0531be8] __vmalloc_node_range+0xd8/0x64c [e2a53c10] [c00338c0] module_alloc+0xa0/0xac [e2a53c40] [c027a368] load_module+0x2ae0/0x8148 [e2a53e30] [c027fc78] sys_finit_module+0xfc/0x130 [e2a53f30] [c0035098] ret_from_syscall+0x0/0x28 ... Add __GFP_NOWARN flag to first allocation so that no warning appears when it fails. Reported-by: Erhard Furtner Fixes: 2ec13df16704 ("powerpc/modules: Load modules closer to kernel text") Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/93c9b84d6ec76aaf7b4f03468e22433a6d308674.1638267035.git.christophe.leroy@csgroup.eu commit 8cc7a1b2aca067397a016cdb971a5e6ad9b640c7 Author: Christophe JAILLET Date: Thu Aug 19 22:05:28 2021 +0200 media: venus: core: Fix a resource leak in the error handling path of 'venus_probe()' A successful 'of_platform_populate()' call should be balanced by a corresponding 'of_platform_depopulate()' call in the error handling path of the probe, as already done in the remove function. A successful 'venus_firmware_init()' call should be balanced by a corresponding 'venus_firmware_deinit()' call in the error handling path of the probe, as already done in the remove function. Update the error handling path accordingly. Fixes: f9799fcce4bb ("media: venus: firmware: register separate platform_device for firmware loader") Signed-off-by: Christophe JAILLET Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit e4debea9be7d5db52bc6a565a4c02c3c6560d093 Author: Christophe JAILLET Date: Thu Aug 12 07:14:22 2021 +0200 media: venus: core: Fix a potential NULL pointer dereference in an error handling path The normal path of the function makes the assumption that 'pm_ops->core_power' may be NULL. We should make the same assumption in the error handling path or a NULL pointer dereference may occur. Add the missing test before calling 'pm_ops->core_power' Fixes: 9e8efdb57879 ("media: venus: core: vote for video-mem path") Signed-off-by: Christophe JAILLET Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit 91f2b7d269e5c885c38c7ffa261f5276bd42f907 Author: Mansur Alisha Shaik Date: Mon Nov 8 06:48:51 2021 +0100 media: venus: avoid calling core_clk_setrate() concurrently during concurrent video sessions In existing implementation, core_clk_setrate() is getting called concurrently in concurrent video sessions. Before the previous call to core_clk_setrate returns, new call to core_clk_setrate is invoked from another video session running concurrently. This results in latest calculated frequency being set (higher/lower) instead of actual frequency required for that video session. It also results in stability crashes mention below. These resources are specific to video core, hence keeping under core lock would ensure that they are estimated for all running video sessions and called once for the video core. Crash logs: [ 1.900089] WARNING: CPU: 4 PID: 1 at drivers/opp/debugfs.c:33 opp_debug_remove_one+0x2c/0x48 [ 1.908493] Modules linked in: [ 1.911524] CPU: 4 PID: 1 Comm: swapper/0 Not tainted 5.10.67 #35 f8edb8c30cf2dd6838495dd9ef9be47af7f5f60c [ 1.921036] Hardware name: Qualcomm Technologies, Inc. sc7280 IDP SKU2 platform (DT) [ 1.928673] pstate: 60800009 (nZCv daif -PAN +UAO -TCO BTYPE=--) [ 1.934608] pc : opp_debug_remove_one+0x2c/0x48 [ 1.939080] lr : opp_debug_remove_one+0x2c/0x48 [ 1.943560] sp : ffffffc011d7b7f0 [ 1.946836] pmr_save: 000000e0 [ 1.949854] x29: ffffffc011d7b7f0 x28: ffffffc010733bbc [ 1.955104] x27: ffffffc010733ba8 x26: ffffff8083cedd00 [ 1.960355] x25: 0000000000000001 x24: 0000000000000000 [ 1.965603] x23: ffffff8083cc2878 x22: ffffff8083ceb900 [ 1.970852] x21: ffffff8083ceb910 x20: ffffff8083cc2800 [ 1.976101] x19: ffffff8083ceb900 x18: 00000000ffff0a10 [ 1.981352] x17: ffffff80837a5620 x16: 00000000000000ec [ 1.986601] x15: ffffffc010519ad4 x14: 0000000000000003 [ 1.991849] x13: 0000000000000004 x12: 0000000000000001 [ 1.997100] x11: c0000000ffffdfff x10: 00000000ffffffff [ 2.002348] x9 : d2627c580300dc00 x8 : d2627c580300dc00 [ 2.007596] x7 : 0720072007200720 x6 : ffffff80802ecf00 [ 2.012845] x5 : 0000000000190004 x4 : 0000000000000000 [ 2.018094] x3 : ffffffc011d7b478 x2 : ffffffc011d7b480 [ 2.023343] x1 : 00000000ffffdfff x0 : 0000000000000017 [ 2.028594] Call trace: [ 2.031022] opp_debug_remove_one+0x2c/0x48 [ 2.035160] dev_pm_opp_put+0x94/0xb0 [ 2.038780] _opp_remove_all+0x7c/0xc8 [ 2.042486] _opp_remove_all_static+0x54/0x7c [ 2.046796] dev_pm_opp_remove_table+0x74/0x98 [ 2.051183] devm_pm_opp_of_table_release+0x18/0x24 [ 2.056001] devm_action_release+0x1c/0x28 [ 2.060053] release_nodes+0x23c/0x2b8 [ 2.063760] devres_release_group+0xcc/0xd0 [ 2.067900] component_bind+0xac/0x168 [ 2.071608] component_bind_all+0x98/0x124 [ 2.075664] msm_drm_bind+0x1e8/0x678 [ 2.079287] try_to_bring_up_master+0x60/0x134 [ 2.083674] component_master_add_with_match+0xd8/0x120 [ 2.088834] msm_pdev_probe+0x20c/0x2a0 [ 2.092629] platform_drv_probe+0x9c/0xbc [ 2.096598] really_probe+0x11c/0x46c [ 2.100217] driver_probe_device+0x8c/0xf0 [ 2.104270] device_driver_attach+0x54/0x78 [ 2.108407] __driver_attach+0x48/0x148 [ 2.112201] bus_for_each_dev+0x88/0xd4 [ 2.115998] driver_attach+0x2c/0x38 [ 2.119534] bus_add_driver+0x10c/0x200 [ 2.123330] driver_register+0x6c/0x104 [ 2.127122] __platform_driver_register+0x4c/0x58 [ 2.131767] msm_drm_register+0x6c/0x70 [ 2.135560] do_one_initcall+0x64/0x23c [ 2.139357] do_initcall_level+0xac/0x15c [ 2.143321] do_initcalls+0x5c/0x9c [ 2.146778] do_basic_setup+0x2c/0x38 [ 2.150401] kernel_init_freeable+0xf8/0x15c [ 2.154622] kernel_init+0x1c/0x11c [ 2.158079] ret_from_fork+0x10/0x30 [ 2.161615] ---[ end trace a2cc45a0f784b212 ]--- [ 2.166272] Removing OPP: 300000000 Signed-off-by: Mansur Alisha Shaik Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit b1f9bb8020783a48151e3a2864fbdc70548566dd Author: Mansur Alisha Shaik Date: Wed Oct 27 08:21:12 2021 +0200 media: venus: correct low power frequency calculation for encoder In exististing implimentation, in min_loaded_core() for low_power vpp frequency value is considering as vpp_freq instead of low_power_freq. Fixed this by correcting vpp frequency calculation for encoder. Fixes: 3cfe5815ce0e (media: venus: Enable low power setting for encoder) Signed-off-by: Mansur Alisha Shaik Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab commit 5402e239d09feea482d25d60df9b908cfaf9ec3c Author: Nicholas Piggin Date: Mon Nov 29 13:09:15 2021 +1000 powerpc/64s: Get LPID bit width from device tree Allow the LPID bit width and partition table size to be set at runtime from the device tree. Move the PID bit width detection into the same place. KVM does not support using the extra bits yet, this is mainly required to get the PTCR register values correct (so KVM will run but it will not allocate > 4096 LPIDs). OPAL firmware provides this property for POWER10 CPUs since skiboot commit 9b85f7d961f2 ("hdata: add mmu-pid-bits and mmu-lpid-bits for POWER10 CPUs"). Signed-off-by: Nicholas Piggin Reviewed-by: Fabiano Rosas Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211129030915.1888332-1-npiggin@gmail.com commit be25b0435b430ac4545b340488c3b5d4b24975f5 Author: Hans Verkuil Date: Thu Nov 25 11:15:12 2021 +0100 media: libv4l-introduction.rst: fix undefined label V4L2_PIX_FMT_HM12 was redefined to V4L2_PIX_FMT_NV12_16L16, so use the new name in libv4l-introduction.rst. This fixes this warning: libv4l-introduction.rst:27: WARNING: undefined label: v4l2-pix-fmt-hm12 Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d2ad087a0920ba5955634bf78cc8511bf120b758 Author: Hans Verkuil Date: Tue Mar 23 09:12:47 2021 +0100 media: omap3isp.h: fix kernel-doc warnings Add missing documentation for two field. This fixes these kernel-doc warnings: drivers/media/platform/omap3isp/omap3isp.h:107: warning: Function parameter or member 'vp_clk_pol' not described in 'isp_ccp2_cfg' drivers/media/platform/omap3isp/omap3isp.h:107: warning: Function parameter or member 'lanecfg' not described in 'isp_ccp2_cfg' Signed-off-by: Hans Verkuil Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 339df438759a1e92de91896173c426a59692d5d0 Author: Hans Verkuil Date: Wed Nov 24 11:34:24 2021 +0100 media: pvrusb2: fix inconsistent indenting Fix these smatch warnings: drivers/media/usb/pvrusb2/pvrusb2-encoder.c:288 pvr2_encoder_cmd() warn: inconsistent indenting drivers/media/usb/pvrusb2/pvrusb2-hdw.c:1730 pvr2_hdw_set_streaming() warn: inconsistent indenting drivers/media/usb/pvrusb2/pvrusb2-hdw.c:3461 pvr2_hdw_cpufw_set_enabled() warn: inconsistent indenting drivers/media/usb/pvrusb2/pvrusb2-hdw.c:3501 pvr2_hdw_cpufw_get() warn: inconsistent indenting Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 2ddd03309433d39852945c2f85d36e796c558793 Author: Hans Verkuil Date: Wed Nov 24 11:38:57 2021 +0100 media: cec: safely unhook lists in cec_data smatch warns about data->list not being removed from list: drivers/media/cec/core/cec-adap.c:926 cec_transmit_msg_fh() warn: '&data->list' not removed from list It is a false warning, but it doesn't hurt to make the code more robust and safely unhook data->list and data->xfer_list together with a WARN_ON if this is actually ever needed (this really shouldn't happen). Note that fixing the data->list warning just replaced it with a new similar warning for data->xfer_list, so both needed to be addressed. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 1a59cd88f55068710f6549bee548846661673780 Author: Philipp Zabel Date: Fri Nov 19 11:41:20 2021 +0100 media: coda: fix CODA960 JPEG encoder buffer overflow Stop the CODA960 JPEG encoder from overflowing capture buffers. The bitstream buffer overflow interrupt doesn't seem to be connected, so this has to be handled via timeout instead. Reported-by: Martin Weber Fixes: 96f6f62c4656 ("media: coda: jpeg: add CODA960 JPEG encoder support") Tested-by: Martin Weber Signed-off-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 230d683ae04894933720425c8dead9508a09ebc3 Author: Chen-Yu Tsai Date: Fri Nov 19 08:46:54 2021 +0100 media: hantro: Hook up RK3399 JPEG encoder output The JPEG encoder found in the Hantro H1 encoder block only produces a raw entropy-encoded scan. The driver is responsible for building a JPEG compliant bitstream and placing the entropy-encoded scan in it. Right now the driver uses a bounce buffer for the hardware to output the raw scan to. In commit e765dba11ec2 ("hantro: Move hantro_enc_buf_finish to JPEG codec_ops.done"), the code that copies the raw scan from the bounce buffer to the capture buffer was moved, but was only hooked up for the Hantro H1 (then RK3288) variant. The RK3399 variant was broken, producing a JPEG bitstream without the scan, and the capture buffer's .bytesused field unset. Fix this by duplicating the code that is executed when the JPEG encoder finishes encoding a frame. As the encoded length is read back from hardware, and the variants having different register layouts, the code is duplicated rather than shared. Fixes: e765dba11ec2 ("hantro: Move hantro_enc_buf_finish to JPEG codec_ops.done") Signed-off-by: Chen-Yu Tsai Tested-by: Nicolas Dufresne Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit b80811546495ee7fd56d16b0fe978f3921f12175 Author: Dafna Hirschfeld Date: Wed Nov 17 14:06:34 2021 +0100 media: mtk-vcodec: don't check return val of mtk_venc_get_q_data The function mtk_venc_get_q_data always returns a reference so there is no need to check if the return value is null. In addition move the q_data initialization to the declaration Signed-off-by: Dafna Hirschfeld Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit ba0b00e7930b477eba4cf1de1b62ae68949911b7 Author: Dafna Hirschfeld Date: Wed Nov 17 14:06:33 2021 +0100 media: mtk-vcodec: replace func vidioc_try_fmt with two funcs for out/cap The function vidioc_try_fmt has a big 'if-else' for the capture and output cases. There is hardly any code outside of that condition. It is therefore better to split that functions into two different functions, one for each case. Signed-off-by: Dafna Hirschfeld Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 71c789760ff9ba4b687c2f8aa828045ca525c517 Author: Dafna Hirschfeld Date: Wed Nov 17 14:06:32 2021 +0100 media: mtk-vcodec: fix debugging defines The mtk-vcodec uses some internal defined debug formats for printing. This patch fixes some things in those defines: 1. use the 'pr_fmt' define to print function name and line. 2. remove 'if(DEBUG)' condition for the defines. This condition prevents the debugs from being shown in case of dynamic debugs. Instead replace 'pr_info' with 'pr_debug' 3. remove module parameters that enable/disable debug. There is no reason for the driver to have those params. Having those params require the user to explicitly set them when user wants to see debug prints instead of using the global debugs setting as expected by drivers to conform. In addition to that, fix some warnings about debug formatting [hverkuil: used %zu instead of %lu for sizeof() arguments] Signed-off-by: Dafna Hirschfeld Reported-by: kernel test robot Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 9f89c881bffbdffe4060ffaef3489a2830a6dd9c Author: Dafna Hirschfeld Date: Wed Nov 17 14:06:30 2021 +0100 media: mtk-vcodec: call v4l2_m2m_ctx_release first when file is released The func v4l2_m2m_ctx_release waits for currently running jobs to finish and then stop streaming both queues and frees the buffers. All this should be done before the call to mtk_vcodec_enc_release which frees the encoder handler. This fixes null-pointer dereference bug: [ 638.028076] Mem abort info: [ 638.030932] ESR = 0x96000004 [ 638.033978] EC = 0x25: DABT (current EL), IL = 32 bits [ 638.039293] SET = 0, FnV = 0 [ 638.042338] EA = 0, S1PTW = 0 [ 638.045474] FSC = 0x04: level 0 translation fault [ 638.050349] Data abort info: [ 638.053224] ISV = 0, ISS = 0x00000004 [ 638.057055] CM = 0, WnR = 0 [ 638.060018] user pgtable: 4k pages, 48-bit VAs, pgdp=000000012b6db000 [ 638.066485] [00000000000001a0] pgd=0000000000000000, p4d=0000000000000000 [ 638.073277] Internal error: Oops: 96000004 [#1] SMP [ 638.078145] Modules linked in: rfkill mtk_vcodec_dec mtk_vcodec_enc uvcvideo mtk_mdp mtk_vcodec_common videobuf2_dma_contig v4l2_h264 cdc_ether v4l2_mem2mem videobuf2_vmalloc usbnet videobuf2_memops videobuf2_v4l2 r8152 videobuf2_common videodev cros_ec_sensors cros_ec_sensors_core industrialio_triggered_buffer kfifo_buf elan_i2c elants_i2c sbs_battery mc cros_usbpd_charger cros_ec_chardev cros_usbpd_logger crct10dif_ce mtk_vpu fuse ip_tables x_tables ipv6 [ 638.118583] CPU: 0 PID: 212 Comm: kworker/u8:5 Not tainted 5.15.0-06427-g58a1d4dcfc74-dirty #109 [ 638.127357] Hardware name: Google Elm (DT) [ 638.131444] Workqueue: mtk-vcodec-enc mtk_venc_worker [mtk_vcodec_enc] [ 638.137974] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 638.144925] pc : vp8_enc_encode+0x34/0x2b0 [mtk_vcodec_enc] [ 638.150493] lr : venc_if_encode+0xac/0x1b0 [mtk_vcodec_enc] [ 638.156060] sp : ffff8000124d3c40 [ 638.159364] x29: ffff8000124d3c40 x28: 0000000000000000 x27: 0000000000000000 [ 638.166493] x26: 0000000000000000 x25: ffff0000e7f252d0 x24: ffff8000124d3d58 [ 638.173621] x23: ffff8000124d3d58 x22: ffff8000124d3d60 x21: 0000000000000001 [ 638.180750] x20: ffff80001137e000 x19: 0000000000000000 x18: 0000000000000001 [ 638.187878] x17: 000000040044ffff x16: 00400032b5503510 x15: 0000000000000000 [ 638.195006] x14: ffff8000118536c0 x13: ffff8000ee1da000 x12: 0000000030d4d91d [ 638.202134] x11: 0000000000000000 x10: 0000000000000980 x9 : ffff8000124d3b20 [ 638.209262] x8 : ffff0000c18d4ea0 x7 : ffff0000c18d44c0 x6 : ffff0000c18d44c0 [ 638.216391] x5 : ffff80000904a3b0 x4 : ffff8000124d3d58 x3 : ffff8000124d3d60 [ 638.223519] x2 : ffff8000124d3d78 x1 : 0000000000000001 x0 : ffff80001137efb8 [ 638.230648] Call trace: [ 638.233084] vp8_enc_encode+0x34/0x2b0 [mtk_vcodec_enc] [ 638.238304] venc_if_encode+0xac/0x1b0 [mtk_vcodec_enc] [ 638.243525] mtk_venc_worker+0x110/0x250 [mtk_vcodec_enc] [ 638.248918] process_one_work+0x1f8/0x498 [ 638.252923] worker_thread+0x140/0x538 [ 638.256664] kthread+0x148/0x158 [ 638.259884] ret_from_fork+0x10/0x20 [ 638.263455] Code: f90023f9 2a0103f5 aa0303f6 aa0403f8 (f940d277) [ 638.269538] ---[ end trace e374fc10f8e181f5 ]--- [gst-master] root@debian:~/gst-build# [ 638.019193] Unable to handle kernel NULL pointer dereference at virtual address 00000000000001a0 Fixes: 4e855a6efa547 ("[media] vcodec: mediatek: Add Mediatek V4L2 Video Encoder Driver") Signed-off-by: Dafna Hirschfeld Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 92f1b2496313915c45a98b302274fb20e90d33be Author: Xu Wang Date: Tue Nov 16 02:47:26 2021 +0100 media: mtk-jpeg: Remove unnecessary print function dev_err() The print function dev_err() is redundant because platform_get_irq() already prints an error. Signed-off-by: Xu Wang Reviewed-by: Kieran Bingham Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 3fa23824fe82a41301f53e025a693104c12f5364 Author: Guo Zhengkui Date: Mon Nov 15 07:54:58 2021 +0100 media: imx: fix boolreturn.cocci warning: Fix following boolreturn.cocci warning: ./drivers/staging/media/imx/imx-media-csi.c:153:9-10: WARNING: return of 0/1 in function 'requires_passthrough' with return type bool. Signed-off-by: Guo Zhengkui Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 0de2412b7d404806ce609e00b758336283b54631 Author: Dmitry Osipenko Date: Sun Nov 14 23:47:32 2021 +0100 media: staging: tegra-vde: Reorder misc device registration Register misc device in the end of driver's probing since device should become visible to userspace once driver is fully prepared. Do the opposite in case of driver removal. This is a minor improvement that doesn't solve any problem, but makes code more consistent. Signed-off-by: Dmitry Osipenko Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 439c827e06f169b50fce271fe5ddb46bf9f88c5e Author: Thierry Reding Date: Sun Nov 14 23:47:31 2021 +0100 media: staging: tegra-vde: Properly mark invalid entries Entries in the reference picture list are marked as invalid by setting the frame ID to 0x3f. Signed-off-by: Thierry Reding Signed-off-by: Dmitry Osipenko Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit c1aa4b55aae4c283e57c07e71968504bfa7d4a13 Author: Pali Rohár Date: Wed Nov 24 16:41:13 2021 +0100 PCI: mvebu: Replace pci_ioremap_io() usage by devm_pci_remap_iospace() Now when ARM architecture code also provides standard PCI core function pci_remap_iospace(), use its devm_pci_remap_iospace() variant in pci-mvebu.c driver instead of old ARM-specific pci_ioremap_io() function. Call devm_pci_remap_iospace() before adding IO resource to host bridge structure, at the place where it should be. Link: https://lore.kernel.org/r/20211124154116.916-3-pali@kernel.org Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi commit bc02973a06a6c74374edeb6d73ed4bde99b37456 Author: Pali Rohár Date: Wed Nov 24 16:41:12 2021 +0100 arm: ioremap: Implement standard PCI function pci_remap_iospace() pci_remap_iospace() is standard PCI core function. Architecture code can reimplement default core implementation if needs custom arch specific functionality. ARM needs custom implementation due to pci_ioremap_set_mem_type() hook which allows ARM platforms to change mem type for iospace. Implement this pci_remap_iospace() function for ARM architecture to correctly handle pci_ioremap_set_mem_type() hook, which allows usage of this standard PCI core function also for platforms which needs different mem type (e.g. Marvell Armada 375, 38x and 39x). Link: https://lore.kernel.org/r/20211124154116.916-2-pali@kernel.org Signed-off-by: Pali Rohár Signed-off-by: Lorenzo Pieralisi Reviewed-by: Russell King (Oracle) commit aee3c1436383da18f5b0306abc7d2d70bbf0612c Author: Thierry Reding Date: Sun Nov 14 23:47:30 2021 +0100 media: staging: tegra-vde: Support reference picture marking Tegra114 and Tegra124 support reference picture marking, which will cause BSEV to write picture marking data to SDRAM. Make sure there is a valid destination address for that data to avoid error messages from the memory controller. [digetx@gmail.com: added BO support and moved secure BO allocation to kernel] Tested-by: Anton Bambura # T114 ASUS TF701T Signed-off-by: Thierry Reding Co-developed-by: Dmitry Osipenko Signed-off-by: Dmitry Osipenko Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 41479adb5e52998ecf690b46164fffea3f5d65fd Author: James Cowgill Date: Thu Nov 11 23:01:08 2021 +0100 media: hantro: Avoid global variable for jpeg quantization tables On a system with multiple encoders present, it's possible for two encoders to write to the global luma and chroma quantization tables at the same time if they both submit a JPEG frame to be encoded. Avoid this race by moving the tables into the `jpeg_ctx` structure which is stored on the stack. Signed-off-by: James Cowgill Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 615c6f28b9ad7efc9bfbef2cafc6a0c5bc0c21e0 Author: Christophe JAILLET Date: Thu Nov 11 14:17:51 2021 +0100 media: mtk-vcodec: Fix an error handling path in 'mtk_vcodec_probe()' In case of error the 'media_device_init()' call is not balanced by a corresponding 'media_device_cleanup()' call. Add it, when needed, as already done in the remove function. Fixes: 118add98f80e ("media: mtk-vcodec: vdec: add media device if using stateless api") Signed-off-by: Christophe JAILLET Acked-by: Tzung-Bi Shih Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 89ab2d39643e5ce2b122baa1e76176d1bd984cec Author: Hans Verkuil Date: Thu Nov 11 11:56:29 2021 +0100 media: vb2: frame_vector.c: don't overwrite error code get_vaddr_frames() first calls pin_user_pages_fast() and if that fails tries follow_pfn(). But if that also fails, then the error code from pin_user_pages_fast() is overwritten with the error code from follow_pfn(). Specifically if pin_user_pages_fast() returns -ENOMEM, then follow_pfn() will overwrite that with -EINVAL, which is very confusing. So store the error code from pin_user_pages_fast() and return that if follow_pfn() returns -EINVAL. -EINVAL indicates that the page is unsuitable for follow_pfn, so pin_user_pages_fast() was the correct call to make, and that error code should be returned instead. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit fadecf79cf8ef9bd3b8dcd0a82455b2c94c4d5c7 Author: Uwe Kleine-König Date: Thu Oct 21 08:25:47 2021 +0200 media: s5c73m3: Drop empty spi_driver remove callback A driver with a remove callback that just returns 0 behaves identically to a driver with no remove callback at all. So simplify accordingly. Signed-off-by: Uwe Kleine-König Reviewed-by: Kieran Bingham Reviewed-by: Andrzej Hajda Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit af88c2adbb72a09ab1bb5c37ba388c98fecca69b Author: Tang Bin Date: Thu Oct 21 05:09:38 2021 +0200 media: rcar_fdp1: Fix the correct variable assignments In the function fdp1_probe(), when get irq failed, the function platform_get_irq() log an error message, so remove redundant message here. And the variable type of "ret" is int, the "fdp1->irq" is unsigned int, when irq failed, this place maybe wrong, thus fix it. Signed-off-by: Tang Bin Reviewed-by: Geert Uytterhoeven Reviewed-by: Kieran Bingham Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d5e9bddb28057615fed653dcfa25f96896b1ff04 Author: Dongliang Mu Date: Tue Oct 19 05:39:52 2021 +0200 media: driver: s3c_camif: move s3c_camif_unregister_subdev out of camif_unregister_media_entities In the error handling of s3c_camif_probe, s3c_camif_unregister_subdev may be executed twice, one is from camif_unregister_media_entities. Although there is sanity check about the registration status, it is not good to call s3c_camif_unregister_subdev twice in the error handling code. Fix this by moving s3c_camif_unregister_subdev out of camif_unregister_media_entities, and add a s3c_camif_unregister_subdev in the s3c_camif_remove. Signed-off-by: Dongliang Mu Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 0529c0f55da87a338a07f3394f55c4873a937be6 Author: Dongliang Mu Date: Tue Oct 19 05:08:08 2021 +0200 media: driver: bdisp: add pm_runtime_disable in the error handling code In the error handling code of bdisp_probe, it fails to invoke pm_runtime_disable in many error sites. Fix this by adding pm_runtime_disable at the label err_remove. Signed-off-by: Dongliang Mu Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit fb394f3fc8c32564d15e48f29e89b736b68441cd Author: Dongliang Mu Date: Tue Oct 19 05:00:29 2021 +0200 media: driver: hva: add pm_runtime_disable in the error handling code of hva_hw_probe In the error handling code of hva_hw_probe, it fails to invoke pm_runtime_disable in many error sites. Fix this by adding a label err_disable with pm_runtime_disable and adjust one goto from label err_clk to err_disable. Signed-off-by: Dongliang Mu Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 9175fb663af3df20a1bab5b5ac4b87b4460dddae Author: Andrzej Hajda Date: Mon Oct 18 23:13:53 2021 +0200 media: MAINTAINERS: Update email of Andrzej Hajda Beside updating email, the patch updates maintainers of Samsung drivers. Signed-off-by: Andrzej Hajda Acked-by: Marek Szyprowski Acked-by: Łukasz Stelmach Acked-by: Neil Armstrong Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 4cfe98e647b1be8ac9ff06562959cf833b43e608 Author: Alexandre Courbot Date: Mon Oct 18 11:14:27 2021 +0200 media: docs: dev-decoder: add restrictions about CAPTURE buffers CAPTURE buffers might be read by the hardware after they are dequeued, which goes against the general idea that userspace has full control over dequeued buffers. Explain why and document the restrictions that this implies for userspace. Signed-off-by: Alexandre Courbot Acked-by: Tomasz Figa Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit ef054e345ed8c79ce1121a3599b5a2dfd78e57a0 Author: Yang Yingliang Date: Fri Oct 15 11:58:55 2021 +0200 media: si470x-i2c: fix possible memory leak in si470x_i2c_probe() n the 'radio->hdl.error' error handling, ctrl handler allocated by v4l2_ctrl_new_std() does not released, and caused memory leak as follows: unreferenced object 0xffff888033d54200 (size 256): comm "i2c-si470x-19", pid 909, jiffies 4294914203 (age 8.072s) hex dump (first 32 bytes): e8 69 11 03 80 88 ff ff 00 46 d5 33 80 88 ff ff .i.......F.3.... 10 42 d5 33 80 88 ff ff 10 42 d5 33 80 88 ff ff .B.3.....B.3.... backtrace: [<00000000086bd4ed>] __kmalloc_node+0x1eb/0x360 [<00000000bdb68871>] kvmalloc_node+0x66/0x120 [<00000000fac74e4c>] v4l2_ctrl_new+0x7b9/0x1c60 [videodev] [<00000000693bf940>] v4l2_ctrl_new_std+0x19b/0x270 [videodev] [<00000000c0cb91bc>] si470x_i2c_probe+0x2d3/0x9a0 [radio_si470x_i2c] [<0000000056a6f01f>] i2c_device_probe+0x4d8/0xbe0 Fix the error handling path to avoid memory leak. Reported-by: Hulk Robot Fixes: 8c081b6f9a9b ("media: radio: Critical v4l2 registration...") Signed-off-by: Yang Yingliang Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 30162960165fe608f505d2564a9abc8514ffb7df Author: Rikard Falkeborn Date: Wed Oct 13 00:11:44 2021 +0200 media: staging: media: rkvdec: Constify static struct v4l2_m2m_ops The only usage of rkvdec_m2m_ops is to pass its address to v4l2_m2m_init(), which takes a pointer to const v4l2_m2m_ops as argument. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn Reviewed-by: Ezequiel Garcia Reviewed-by: Kieran Bingham Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 61b20ddec90075b0fd33394e0425fd01e627a0a9 Author: Rikard Falkeborn Date: Tue Oct 12 23:47:03 2021 +0200 media: imx: Constify static struct v4l2_m2m_ops The only usage of m2m_ops is to pass its address to v4l2_m2m_init(), which takes a pointer to const v4l2_m2m_ops as argument. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn Reviewed-by: Philipp Zabel Reviewed-by: Kieran Bingham Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 8197b071915a5229c9359b1a232936109d27dc1f Author: Fabio Estevam Date: Fri Oct 8 15:10:15 2021 +0200 media: imx-pxp: Add rotation support PXP allows clockwise rotation of 0°, 90°, 180° and 270°. Add support for it. Tested on a imx6ull-evk. For example, to rotate 90° the following Gstreamer pipeline can be used: gst-launch-1.0 videotestsrc ! video/x-raw,width=640,height=480 ! \ v4l2convert extra-controls=cid,rotate=90 ! \ video/x-raw,width=120,height=160 ! fbdevsink Signed-off-by: Fabio Estevam Reviewed-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit ed2f97ad4b21072f849cf4ae6645d1f2b1d3f550 Author: Fabio Estevam Date: Fri Oct 8 15:10:14 2021 +0200 media: imx-pxp: Initialize the spinlock prior to using it After devm_request_threaded_irq() is called there is a chance that an interrupt may occur before the spinlock is initialized, which will trigger a kernel oops. To prevent that, move the initialization of the spinlock prior to requesting the interrupts. Fixes: 51abcf7fdb70 ("media: imx-pxp: add i.MX Pixel Pipeline driver") Signed-off-by: Fabio Estevam Reviewed-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 549cc89cd09a85aaa16dc07ef3db811d5cf9bcb1 Author: Suresh Udipi Date: Fri Aug 13 17:07:56 2021 +0200 media: rcar-csi2: Optimize the selection PHTW register PHTW register is selected based on default bit rate from Table[1]. for the bit rates less than or equal to 250. Currently first value of default bit rate which is greater than or equal to the caculated mbps is selected. This selection can be further improved by selecting the default bit rate which is nearest to the calculated value. [1] specs r19uh0105ej0200-r-car-3rd-generation.pdf [Table 25.12] Fixes: 769afd212b16 ("media: rcar-csi2: add Renesas R-Car MIPI CSI-2 receiver driver") Signed-off-by: Suresh Udipi Signed-off-by: Michael Rodin Reviewed-by: Niklas Söderlund Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit ebeefe26859ec58c2a8bbb83896f26ebc389a29f Author: Suresh Udipi Date: Fri Aug 13 17:07:55 2021 +0200 media: rcar-csi2: Add warning for PHY speed less than minimum Add a warning message when the selected PHY speed is less than supported minimum PHY speed given in the hsfreq table[1]. For raspberry pi camera capture on Kingfisher board with resolution 640x480, the calculated PHY speed is 48 mbps which is less than the minimum PHY speed 80 Mbps from the table[1]. But in this cases capture is successful. [1] specs r19uh0105ej0200-r-car-3rd-generation.pdf [Table 25.9] Signed-off-by: Suresh Udipi Signed-off-by: Michael Rodin Reviewed-by: Niklas Söderlund Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit cee44d4fbacbbdfe62697ec94e76c6e4f726c5df Author: Suresh Udipi Date: Fri Aug 13 17:07:54 2021 +0200 media: rcar-csi2: Correct the selection of hsfreqrange hsfreqrange should be chosen based on the calculated mbps which is closer to the default bit rate and within the range as per table[1]. But current calculation always selects first value which is greater than or equal to the calculated mbps which may lead to chosing a wrong range in some cases. For example for 360 mbps for H3/M3N Existing logic selects Calculated value 360Mbps : Default 400Mbps Range [368.125 -433.125 mbps] This hsfreqrange is out of range. The logic is changed to get the default value which is closest to the calculated value [1] Calculated value 360Mbps : Default 350Mbps Range [320.625 -380.625 mpbs] [1] specs r19uh0105ej0200-r-car-3rd-generation.pdf [Table 25.9] Please note that According to Renesas in Table 25.9 the range for 220 default value is corrected as below |Range (Mbps) | Default Bit rate (Mbps) | ----------------------------------------------- | 197.125-244.125 | 220 | ----------------------------------------------- Fixes: 769afd212b16 ("media: rcar-csi2: add Renesas R-Car MIPI CSI-2 receiver driver") Signed-off-by: Suresh Udipi Signed-off-by: Kazuyoshi Akiyama Signed-off-by: Michael Rodin Reviewed-by: Niklas Söderlund Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 0838a3bfcd1b0c8d2ce38afcc94b81920486dabd Author: Luca Weiss Date: Thu Nov 18 22:02:05 2021 +0100 power: supply: qcom_smbb: support pm8226 PM8226 (used in MSM8226) has v1 smbb hardware and works fine with the current driver. Signed-off-by: Luca Weiss Signed-off-by: Sebastian Reichel commit 502ce10704d7fb53e8d41bbadbbdd4814d7c9b52 Author: Luca Weiss Date: Thu Nov 18 22:02:04 2021 +0100 dt-bindings: power: supply: pm8941-charger: add pm8226 The charger in PM8226 (used in MSM8226) is similar to the charger in PM8941. Signed-off-by: Luca Weiss Acked-by: Rob Herring Signed-off-by: Sebastian Reichel commit 09717af7d13d63df141ae6e71686289989d17efd Author: Thomas Zimmermann Date: Sat Nov 6 20:35:09 2021 +0100 drm: Remove CONFIG_DRM_KMS_CMA_HELPER option Link drm_fb_cma_helper.o into drm_cma_helper.ko if CONFIG_DRM_KMS_HELPER has been set. Remove CONFIG_DRM_KMS_CMA_HELPER config option. Selecting KMS helpers and CMA will now automatically enable CMA KMS helpers. Some drivers' Kconfig files did not correctly select KMS or CMA helpers. Fix this as part of the change. Signed-off-by: Thomas Zimmermann Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20211106193509.17472-3-tzimmermann@suse.de commit c47160d8edcdb4d9fb2b333569a3fc13fca5db43 Author: Thomas Zimmermann Date: Sat Nov 6 20:35:08 2021 +0100 drm/mipi-dbi: Remove dependency on GEM CMA helper library The MIPI DBI helpers access struct drm_gem_cma_object.vaddr in a few places. Replace all instances with the correct generic GEM functions. Use drm_gem_fb_vmap() for mapping a framebuffer's GEM objects and drm_gem_fb_vunmap() for unmapping them. This removes the dependency on CMA helpers within MIPI DBI. Signed-off-by: Thomas Zimmermann Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20211106193509.17472-2-tzimmermann@suse.de commit 4ce875a80319653e5dc52960b29d49369180206d Author: Geert Uytterhoeven Date: Wed Jul 14 13:17:12 2021 +0200 media: dt-bindings: media: renesas,jpu: Convert to json-schema Convert the Renesas JPEG Processing Unit Device Tree binding documentation to json-schema. Document missing properties. Update the example to match reality. Signed-off-by: Geert Uytterhoeven Reviewed-by: Laurent Pinchart Reviewed-by: Mikhail Ulyanov Reviewed-by: Rob Herring Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 0abb8f9052ef1b143e78cfe6349a18ffec35e499 Author: Eugen Hristev Date: Tue Nov 23 13:04:21 2021 +0100 media: i2c: imx274: implement fwnode parsing Implement fwnode parsing at probe time. Check if the bus and number of lanes are supported. Signed-off-by: Eugen Hristev Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 57de5bb2bd2104d518227b9203e6fccbb1e63ad4 Author: Eugen Hristev Date: Tue Nov 23 12:15:20 2021 +0100 media: i2c: imx274: simplify probe function by adding local variable dev Simplify probe function by adding a local variable dev instead of using &client->dev all the time. Signed-off-by: Eugen Hristev Reviewed-by: Luca Ceresoli Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 46b33f6a0e82d0ea3f5dfac19a2ebefba80741fb Author: Daniel Scally Date: Tue Nov 23 01:00:17 2021 +0100 media: ipu3-cio2: Add INT347A to cio2-bridge ACPI _HID INT347A represents the OV8865 sensor, the driver for which can support the platforms that the cio2-bridge serves. Add it to the array of supported sensors so the bridge will connect the sensor to the CIO2 device. Reviewed-by: Andy Shevchenko Signed-off-by: Daniel Scally Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 3fdd94e2bfa3a05a9a1ef7c49c7dccb10ebafdfb Author: Daniel Scally Date: Tue Nov 23 01:00:16 2021 +0100 media: i2c: Fix max gain in ov8865 The maximum gain figure in the v4l2 ctrl is wrong. The field is 12 bits wide, which is where the 8191 figure comes from, but the datasheet is specific that maximum gain is 16x (the low seven bits are fractional, so 16x gain is 2048) Signed-off-by: Daniel Scally Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 91f08141d3aba858278d0c8e61bc8aa84af51cac Author: Daniel Scally Date: Tue Nov 23 01:00:15 2021 +0100 media: i2c: Use dev_err_probe() in ov8865 There is a chance that regulator_get() returns -EPROBE_DEFER, in which case printing an error message is undesirable. To avoid spurious messages in dmesg in the event that -EPROBE_DEFER is returned, use dev_err_probe() on error paths for regulator_get(). Signed-off-by: Daniel Scally Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit e15ddc9644a11ab51da709f866a2b939ac383a7a Author: Daniel Scally Date: Tue Nov 23 01:00:14 2021 +0100 media: i2c: Switch exposure control unit to lines The ov8865 driver currently has the unit of the V4L2_CID_EXPOSURE control as 1/16th of a line. This is what the sensor expects, but isn't very intuitive. Switch the control to be in units of a line and simply do the 16x multiplication before passing the value to the sensor. The datasheet for this sensor gives minimum exposure as 2 lines, so take the opportunity to correct the lower bounds of the control. Signed-off-by: Daniel Scally Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 6eecfb34d3c4811686689f3dde657ad62d0b583b Author: Daniel Scally Date: Tue Nov 23 01:00:13 2021 +0100 media: i2c: Add controls from fwnode to ov8865 Add V4L2_CID_CAMERA_ORIENTATION and V4L2_CID_CAMERA_SENSOR_ROTATION controls to the ov8865 driver by attempting to parse them from firmware. Signed-off-by: Daniel Scally Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit ca28690ebe19f55fedb8ecb374f10a0d88a7366c Author: Daniel Scally Date: Tue Nov 23 01:00:12 2021 +0100 media: i2c: cap exposure at height + vblank in ov8865 Exposure limits depend on the total height; when vblank is altered (and thus the total height is altered), change the exposure limits to reflect the new cap. Signed-off-by: Daniel Scally Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 295786e53516ba1792b5ff1deb9dfffff4040255 Author: Daniel Scally Date: Tue Nov 23 01:00:11 2021 +0100 media: i2c: Update HTS values in ov8865 The HTS values for some of the modes in the ov8865 driver are a bit unusual, coming in lower than the output_size_x is set to. It seems like they might be calculated to fit the desired framerate into a configuration with just two data lanes. To bring this more in line with expected behaviour, raise the HTS values above the output_size_x. The corollary of that change is that the hardcoded frame intervals against the modes no longer make sense, so remove those entirely. Update the .g/s_frame_interval() callbacks to calculate the frame interval based on the current mode and the vblank and hblank settings. The implementation of the .enum_frame_interval() callback is no longer suitable since the possible frame rate is now a continuous range depending on the vblank control setting, so remove that callback entirely. Signed-off-by: Daniel Scally Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit d84d4ceea91e07dfed58fd8e7bb6b29264c195c9 Author: Daniel Scally Date: Tue Nov 23 01:00:10 2021 +0100 media: i2c: Add hblank control to ov8865 Add a V4L2_CID_HBLANK control to the ov8865 driver. This is read only with timing control intended to be done via vblanking alone. Signed-off-by: Daniel Scally Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 9293aafe3745f2a2bb678a14eb589af4e6ee5ffe Author: Daniel Scally Date: Tue Nov 23 01:00:09 2021 +0100 media: i2c: Add vblank control to ov8865 Add a V4L2_CID_VBLANK control to the ov8865 driver. Signed-off-by: Daniel Scally Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit d938b2f29be6ad5eb1b04c5bf0e3afa4348e9195 Author: Daniel Scally Date: Tue Nov 23 01:00:08 2021 +0100 media: i2c: Switch control to V4L2_CID_ANALOGUE_GAIN The V4L2_CID_GAIN control for this driver configures registers that the datasheet specifies as analogue gain. Switch the control's ID to V4L2_CID_ANALOGUE_GAIN. Reviewed-by: Paul Kocialkowski Signed-off-by: Daniel Scally Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit acd25e220921de232b027c677668c93aa6ba5d15 Author: Daniel Scally Date: Tue Nov 23 01:00:07 2021 +0100 media: i2c: Add .get_selection() support to ov8865 The ov8865 driver's v4l2_subdev_pad_ops currently does not include .get_selection() - add support for that callback. Signed-off-by: Daniel Scally Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 73dcffeb2ff98e8181b43e9d9faad042ddcb7f60 Author: Daniel Scally Date: Tue Nov 23 01:00:06 2021 +0100 media: i2c: Support 19.2MHz input clock in ov8865 The ov8865 driver as written expects a 24MHz input clock, but the sensor is sometimes found on x86 platforms with a 19.2MHz input clock supplied. Add a set of PLL configurations to the driver to support that rate too. As ACPI doesn't auto-configure the clock rate, check for a clock-frequency during probe and set that rate if one is found. Signed-off-by: Daniel Scally Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit ba0c8045ea62e4870883570c65d86f1bc06eaa4c Author: Daniel Scally Date: Tue Nov 23 01:00:05 2021 +0100 media: i2c: Defer probe if not endpoint found The ov8865 driver is one of those that can be connected to a CIO2 device by the cio2-bridge code. This means that the absence of an endpoint for this device is not necessarily fatal, as one might be built by the cio2-bridge when it probes. Return -EPROBE_DEFER if no endpoint is found rather than a fatal error. Signed-off-by: Daniel Scally Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 651d1f2040ac46d87c67cfe512bbd7668c34fec6 Author: Daniel Scally Date: Tue Nov 23 01:00:04 2021 +0100 media: i2c: Fix incorrect value in comment The PLL configuration defined here sets 72MHz (which is correct), not 80MHz. Correct the comment. Reviewed-by: Paul Kocialkowski Signed-off-by: Daniel Scally Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit dc69bc7a2e09791d8466202a5b10b14400191116 Author: Daniel Scally Date: Tue Nov 23 01:00:03 2021 +0100 media: i2c: Add ACPI support to ov8865 The ov8865 sensor is sometimes found on x86 platforms enumerated via ACPI. Add an ACPI match table to the driver so that it's probed on those platforms. Signed-off-by: Daniel Scally Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 6e1c9bc9ae96e57bcd8807174f2c0f44f9ef7938 Author: Hans de Goede Date: Tue Nov 23 01:00:02 2021 +0100 media: i2c: ov8865: Fix lockdep error ov8865_state_init() calls ov8865_state_mipi_configure() which uses __v4l2_ctrl_s_ctrl[_int64](). This means that sensor->mutex (which is also sensor->ctrls.handler.lock) must be locked before calling ov8865_state_init(). Note ov8865_state_mipi_configure() is also used in other places where the lock is already held so it cannot be changed itself. This fixes the following lockdep kernel WARN: [ 13.233421] WARNING: CPU: 0 PID: 8 at drivers/media/v4l2-core/v4l2-ctrls-api.c:833 __v4l2_ctrl_s_ctrl+0x4d/0x60 [videodev] ... [ 13.234063] Call Trace: [ 13.234074] ov8865_state_configure+0x98b/0xc00 [ov8865] [ 13.234095] ov8865_probe+0x4b1/0x54c [ov8865] [ 13.234117] i2c_device_probe+0x13c/0x2d0 Fixes: 11c0d8fdccc5 ("media: i2c: Add support for the OV8865 image sensor") Signed-off-by: Hans de Goede Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit d2484fbf780762f6f9cc3abb7a07ee42dca2eaa3 Author: Daniel Scally Date: Tue Nov 23 01:00:01 2021 +0100 media: i2c: Re-order runtime pm initialisation The kerneldoc for pm_runtime_set_suspended() says: "It is not valid to call this function for devices with runtime PM enabled" To satisfy that requirement, re-order the calls so that pm_runtime_enable() is the last one. Fixes: 11c0d8fdccc5 ("media: i2c: Add support for the OV8865 image sensor") Signed-off-by: Daniel Scally Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 887bda234082423b84a63ef09dbda7fd106074e5 Author: Daniel Scally Date: Tue Nov 23 00:56:13 2021 +0100 media: ipu3-cio2: Add link freq for INT33BE entry Add a link frequency to the cio2-bridge table of supported sensors. This means that the driver can parse supported link frequencies from firmware in the usual way and validate that it can accommodate them. Signed-off-by: Daniel Scally Tested-by: Jean-Michel Hautbois Reviewed-by: Jean-Michel Hautbois Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 89aef879cb537061f7a0948210fc00c5f1b5dfb4 Author: Daniel Scally Date: Tue Nov 23 00:56:12 2021 +0100 media: i2c: Add support for ov5693 sensor The OV5693 is a 5 Mpx CMOS image sensor, connected via MIPI CSI-2. The chip is capable of a single lane configuration, but currently only two lanes are supported. Most of the sensor's features are supported, with the main exception being the lens correction algorithm. The driver provides all mandatory, optional and recommended V4L2 controls for maximum compatibility with libcamera. [mchehab: fixed a coding style warning] Signed-off-by: Daniel Scally Tested-by: Jean-Michel Hautbois Reviewed-by: Jean-Michel Hautbois Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit a5f0900246818c1eb7c98e324a898afa9af69e90 Author: Daniel Scally Date: Tue Nov 23 00:56:11 2021 +0100 media: ipu3-cio2: Toggle sensor streaming in pm runtime ops The .suspend() and .resume() runtime_pm operations for the ipu3-cio2 driver currently do not handle the sensor's stream. Setting .s_stream() on or off for the sensor subdev means that sensors will pause and resume the stream at the appropriate time even if their drivers don't implement those operations. Reviewed-by: Kieran Bingham Signed-off-by: Daniel Scally Tested-by: Jean-Michel Hautbois Reviewed-by: Jean-Michel Hautbois Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 7218905afd1a830ba86a30389cd080d9e00b7000 Author: Eugen Hristev Date: Thu Nov 18 16:40:09 2021 +0100 media: i2c: imx274: implement enum_mbus_code Current driver supports only SRGGB 10 bit RAW bayer format. Add the enum_mbus_code implementation to report this format supported. # v4l2-ctl -d /dev/v4l-subdev3 --list-subdev-mbus-codes ioctl: VIDIOC_SUBDEV_ENUM_MBUS_CODE (pad=0) 0x300f: MEDIA_BUS_FMT_SRGGB10_1X10 # Signed-off-by: Eugen Hristev Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 358ed66bfcdaec6de70e27c747887604b9ea2e6e Author: Eugen Hristev Date: Thu Nov 18 13:51:51 2021 +0100 media: i2c: imx274: fix trivial typo obainted/obtained Fix typo obainted/obtained. Fixes: 0985dd306f72 ("media: imx274: V4l2 driver for Sony imx274 CMOS sensor") Signed-off-by: Eugen Hristev Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 4e05d5f24b2c0cdb8adb3c3b93dc05fe7facae66 Author: Eugen Hristev Date: Thu Nov 18 08:17:15 2021 +0100 media: i2c: imx274: fix trivial typo expsoure/exposure Fix typo expsoure/exposure Fixes: 0985dd306f72 ("media: imx274: V4l2 driver for Sony imx274 CMOS sensor") Signed-off-by: Eugen Hristev Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit da653498c20ba5b185214d8ae43b4e8e9594f520 Author: Eugen Hristev Date: Wed Nov 17 16:40:09 2021 +0100 media: i2c: imx274: fix s_frame_interval runtime resume not requested pm_runtime_resume_and_get should be called when the s_frame_interval is called. The driver will try to access device registers to configure VMAX, coarse time and exposure. Currently if the runtime is not resumed, this fails: # media-ctl -d /dev/media0 --set-v4l2 '"IMX274 1-001a":0[fmt:SRGGB10_1X10/3840x2 160@1/10]' IMX274 1-001a: imx274_binning_goodness: ask 3840x2160, size 3840x2160, goodness 0 IMX274 1-001a: imx274_binning_goodness: ask 3840x2160, size 1920x1080, goodness -3000 IMX274 1-001a: imx274_binning_goodness: ask 3840x2160, size 1280x720, goodness -4000 IMX274 1-001a: imx274_binning_goodness: ask 3840x2160, size 1280x540, goodness -4180 IMX274 1-001a: __imx274_change_compose: selected 1x1 binning IMX274 1-001a: imx274_set_frame_interval: input frame interval = 1 / 10 IMX274 1-001a: imx274_read_mbreg : addr 0x300e, val=0x1 (2 bytes) IMX274 1-001a: imx274_set_frame_interval : register SVR = 1 IMX274 1-001a: imx274_read_mbreg : addr 0x30f6, val=0x6a8 (2 bytes) IMX274 1-001a: imx274_set_frame_interval : register HMAX = 1704 IMX274 1-001a: imx274_set_frame_length : input length = 2112 IMX274 1-001a: imx274_write_mbreg : i2c bulk write failed, 30f8 = 884 (3 bytes) IMX274 1-001a: imx274_set_frame_length error = -121 IMX274 1-001a: imx274_set_frame_interval error = -121 Unable to setup formats: Remote I/O error (121) The device is not resumed thus the remote I/O error. Setting the frame interval works at streaming time, because pm_runtime_resume_and_get is called at s_stream time before sensor setup. The failure happens when only the s_frame_interval is called separately independently on streaming time. Fixes: ad97bc37426c ("media: i2c: imx274: Add IMX274 power on and off sequence") Signed-off-by: Eugen Hristev Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 60f9462cfa608dbd6b7e68da8c30940163a87a65 Author: Kieran Bingham Date: Tue Nov 2 12:02:43 2021 +0100 media: i2c: max9286: Depend on VIDEO_V4L2 The MAX9286 has not explicitly declared a dependency upon VIDEO_V4L2. While this dependency has likely always been met by configurations including it, the device does use V4L2 core, and should depend upon it. Add VIDEO_V4L2 as a dependency to match other drivers and prevent failures when compile testing. Signed-off-by: Kieran Bingham Reviewed-by: Niklas Söderlund Reviewed-by: Jacopo Mondi Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 97ad1d89624df8f3f8f035ff3cdf24bbd9c6d7b1 Author: Geert Uytterhoeven Date: Mon Nov 29 19:57:14 2021 +0100 MIPS: TXx9: Let MACH_TX49XX select BOOT_ELF32 Some bootloaders (e.g. VxWorks 5.5 System Boot) on TX49 systems do not support loading 64-bit kernel images. Work around this by selecting BOOT_ELF32, to support running both 32-bit ("vmlinux" with CONFIG_32BIT=y) and 64-bit ("vmlinux.32" with CONFIG_64BIT=y) Linux kernels on TX49 devices with such a boot loader. Suggested-by: Thomas Bogendoerfer Signed-off-by: Geert Uytterhoeven Signed-off-by: Thomas Bogendoerfer commit ff54938dd190d85f740b9bf9dde59b550936b621 Author: Martin Blumenstingl Date: Sun Oct 31 14:50:06 2021 +0100 clk: meson: gxbb: Fix the SDM_EN bit for MPLL0 on GXBB There are reports that 48kHz audio does not work on the WeTek Play 2 (which uses a GXBB SoC), while 44.1kHz audio works fine on the same board. There are also reports of 48kHz audio working fine on GXL and GXM SoCs, which are using an (almost) identical AIU (audio controller). Experimenting has shown that MPLL0 is causing this problem. In the .dts we have by default: assigned-clocks = <&clkc CLKID_MPLL0>, <&clkc CLKID_MPLL1>, <&clkc CLKID_MPLL2>; assigned-clock-rates = <294912000>, <270950400>, <393216000>; The MPLL0 rate is divisible by 48kHz without remainder and the MPLL1 rate is divisible by 44.1kHz without remainder. Swapping these two clock rates "fixes" 48kHz audio but breaks 44.1kHz audio. Everything looks normal when looking at the info provided by the common clock framework while playing 48kHz audio (via I2S with mclk-fs = 256): mpll_prediv 1 1 0 2000000000 mpll0_div 1 1 0 294909641 mpll0 1 1 0 294909641 cts_amclk_sel 1 1 0 294909641 cts_amclk_div 1 1 0 12287902 cts_amclk 1 1 0 12287902 meson-clk-msr however shows that the actual MPLL0 clock is off by more than 38MHz: mp0_out 333322917 +/-10416Hz The rate seen by meson-clk-msr is very close to what we would get when SDM (the fractional part) was ignored: (2000000000Hz * 16384) / ((16384 * 6) = 333.33MHz If SDM was considered the we should get close to: (2000000000Hz * 16384) / ((16384 * 6) + 12808) = 294.9MHz Further experimenting shows that HHI_MPLL_CNTL7[15] does not have any effect on the rate of MPLL0 as seen my meson-clk-msr (regardless of whether that bit is zero or one the rate is always the same according to meson-clk-msr). Using HHI_MPLL_CNTL[25] on the other hand as SDM_EN results in SDM being considered for the rate output by the hardware. The rate - as seen by meson-clk-msr - matches with what we expect when SDM_EN is enabled (fractional part is being considered, resulting in a 294.9MHz output) or disable (fractional part being ignored, resulting in a 333.33MHz output). Reported-by: Christian Hewitt Tested-by: Christian Hewitt Signed-off-by: Martin Blumenstingl Signed-off-by: Jerome Brunet Link: https://lore.kernel.org/r/20211031135006.1508796-1-martin.blumenstingl@googlemail.com commit e580ea25c08d9e89593bcf80640e29108f0542cb Author: Thomas Zimmermann Date: Mon Nov 15 13:01:48 2021 +0100 drm/cma-helper: Pass GEM CMA object in public interfaces Change all GEM CMA object functions that receive a GEM object of type struct drm_gem_object to expect an object of type struct drm_gem_cma_object instead. This change reduces the number of upcasts from struct drm_gem_object by moving them into callers. The C compiler can now verify that the GEM CMA functions are called with the correct type. For consistency, the patch also renames drm_gem_cma_free_object to drm_gem_cma_free. It further updates documentation for a number of functions. Signed-off-by: Thomas Zimmermann Reviewed-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20211115120148.21766-4-tzimmermann@suse.de commit 05b1de51df077a2089e3d8ceec68aa687cff15db Author: Thomas Zimmermann Date: Mon Nov 15 13:01:47 2021 +0100 drm/cma-helper: Export dedicated wrappers for GEM object functions Wrap GEM CMA functions for struct drm_gem_object_funcs and update all callers. This will allow for an update of the public interfaces of the GEM CMA helper library. Signed-off-by: Thomas Zimmermann Reviewed-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20211115120148.21766-3-tzimmermann@suse.de commit d0c4e34db0b0a012352dad499a13738b4102f277 Author: Thomas Zimmermann Date: Mon Nov 15 13:01:46 2021 +0100 drm/cma-helper: Move driver and file ops to the end of header Restructure the header file for CMA helpers by moving declarations for driver and file operations to the end of the file. No functional changes. Signed-off-by: Thomas Zimmermann Reviewed-by: Maxime Ripard Reviewed-by: Laurent Pinchart Link: https://patchwork.freedesktop.org/patch/msgid/20211115120148.21766-2-tzimmermann@suse.de commit 05b22caa7490e4f4c94bbde33c61cf72d187b8f7 Author: Geert Uytterhoeven Date: Wed Nov 10 20:00:52 2021 +0100 soc: renesas: Consolidate product register handling Currently renesas_soc_init() scans the whole device tree up to three times, to find a device node describing a product register. Furthermore, the product register handling for the different variants is very similar, with the major difference being the location of the product bitfield inside the product register. Reduce scanning to a single pass using of_find_matching_node_and_match() instead. Switch to a common handling of product registers, by storing the intrinsics of each product register type in the data field of the corresponding match entry. Signed-off-by: Geert Uytterhoeven Tested-by: Lad Prabhakar Link: https://lore.kernel.org/r/057721f46c7499de4133135488f0f3da7fb39265.1636570669.git.geert+renesas@glider.be commit a21800bced7cbaf7bb8f5281db17a5d7ef6e197a Author: Thomas Zimmermann Date: Mon Nov 29 10:48:41 2021 +0100 drm: Declare hashtable as legacy The DRM hashtable code is only used by internal functions for legacy UMS drivers. Move the implementation behind CONFIG_DRM_LEGACY and the declarations into legacy header files. Unexport the symbols. Signed-off-by: Thomas Zimmermann Acked-by: Daniel Vetter Acked-by: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20211129094841.22499-4-tzimmermann@suse.de commit 2985c96485b7ef4e015d13dc3081fb0479260951 Author: Thomas Zimmermann Date: Mon Nov 29 10:48:40 2021 +0100 drm/vmwgfx: Copy DRM hash-table code into driver Besides some legacy code, vmwgfx is the only user of DRM's hash- table implementation. Copy the code into the driver, so that the core code can be retired. No functional changes. However, the real solution for vmwgfx is to use Linux' generic hash-table functions. v2: * add TODO item for updating vmwgfx (Sam) Signed-off-by: Thomas Zimmermann Acked-by: Daniel Vetter Acked-by: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20211129094841.22499-3-tzimmermann@suse.de commit b93199b2867646be5b1c84cc0a844df023877806 Author: Thomas Zimmermann Date: Mon Nov 29 10:48:39 2021 +0100 drm/ttm: Don't include drm_hashtab.h Remove the include statement for drm_hashtab.h. It's not required by TTM. Signed-off-by: Thomas Zimmermann Reviewed-by: Christian König Acked-by: Daniel Vetter Acked-by: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20211129094841.22499-2-tzimmermann@suse.de commit 95d35838880fb040ccb9fe4a48816bd0c8b62df5 Author: Thomas Hellström Date: Mon Nov 29 16:27:27 2021 +0100 dma_fence_array: Fix PENDING_ERROR leak in dma_fence_array_signaled() If a dma_fence_array is reported signaled by a call to dma_fence_is_signaled(), it may leak the PENDING_ERROR status. Fix this by clearing the PENDING_ERROR status if we return true in dma_fence_array_signaled(). v2: - Update Cc list, and add R-b. Fixes: 1f70b8b812f3 ("dma-fence: Propagate errors to dma-fence-array container") Cc: Chris Wilson Cc: Sumit Semwal Cc: Gustavo Padovan Cc: Christian König Cc: "Christian König" Cc: linux-media@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Cc: linaro-mm-sig@lists.linaro.org Cc: # v5.4+ Signed-off-by: Thomas Hellström Reviewed-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20211129152727.448908-1-thomas.hellstrom@linux.intel.com commit 2c9ac51b850d84ee496b0a5d832ce66d411ae552 Author: Athira Rajeev Date: Wed Jul 21 01:48:29 2021 -0400 powerpc/perf: Fix PMU callbacks to clear pending PMI before resetting an overflown PMC Running perf fuzzer showed below in dmesg logs: "Can't find PMC that caused IRQ" This means a PMU exception happened, but none of the PMC's (Performance Monitor Counter) were found to be overflown. There are some corner cases that clears the PMCs after PMI gets masked. In such cases, the perf interrupt handler will not find the active PMC values that had caused the overflow and thus leads to this message while replaying. Case 1: PMU Interrupt happens during replay of other interrupts and counter values gets cleared by PMU callbacks before replay: During replay of interrupts like timer, __do_irq() and doorbell exception, we conditionally enable interrupts via may_hard_irq_enable(). This could potentially create a window to generate a PMI. Since irq soft mask is set to ALL_DISABLED, the PMI will get masked here. We could get IPIs run before perf interrupt is replayed and the PMU events could be deleted or stopped. This will change the PMU SPR values and resets the counters. Snippet of ftrace log showing PMU callbacks invoked in __do_irq(): -0 [051] dns. 132025441306354: __do_irq <-call_do_irq -0 [051] dns. 132025441306430: irq_enter <-__do_irq -0 [051] dns. 132025441306503: irq_enter_rcu <-__do_irq -0 [051] dnH. 132025441306599: xive_get_irq <-__do_irq <<>> -0 [051] dnH. 132025441307770: generic_smp_call_function_single_interrupt <-smp_ipi_demux_relaxed -0 [051] dnH. 132025441307839: flush_smp_call_function_queue <-smp_ipi_demux_relaxed -0 [051] dnH. 132025441308057: _raw_spin_lock <-event_function -0 [051] dnH. 132025441308206: power_pmu_disable <-perf_pmu_disable -0 [051] dnH. 132025441308337: power_pmu_del <-event_sched_out -0 [051] dnH. 132025441308407: power_pmu_read <-power_pmu_del -0 [051] dnH. 132025441308477: read_pmc <-power_pmu_read -0 [051] dnH. 132025441308590: isa207_disable_pmc <-power_pmu_del -0 [051] dnH. 132025441308663: write_pmc <-power_pmu_del -0 [051] dnH. 132025441308787: power_pmu_event_idx <-perf_event_update_userpage -0 [051] dnH. 132025441308859: rcu_read_unlock_strict <-perf_event_update_userpage -0 [051] dnH. 132025441308975: power_pmu_enable <-perf_pmu_enable <<>> -0 [051] dnH. 132025441311108: irq_exit <-__do_irq -0 [051] dns. 132025441311319: performance_monitor_exception <-replay_soft_interrupts Case 2: PMI's masked during local_* operations, example local_add(). If the local_add() operation happens within a local_irq_save(), replay of PMI will be during local_irq_restore(). Similar to case 1, this could also create a window before replay where PMU events gets deleted or stopped. Fix it by updating the PMU callback function power_pmu_disable() to check for pending perf interrupt. If there is an overflown PMC and pending perf interrupt indicated in paca, clear the PMI bit in paca to drop that sample. Clearing of PMI bit is done in power_pmu_disable() since disable is invoked before any event gets deleted/stopped. With this fix, if there are more than one event running in the PMU, there is a chance that we clear the PMI bit for the event which is not getting deleted/stopped. The other events may still remain active. Hence to make sure we don't drop valid sample in such cases, another check is added in power_pmu_enable. This checks if there is an overflown PMC found among the active events and if so enable back the PMI bit. Two new helper functions are introduced to clear/set the PMI, ie clear_pmi_irq_pending() and set_pmi_irq_pending(). Helper function pmi_irq_pending() is introduced to give a warning if there is pending PMI bit in paca, but no PMC is overflown. Also there are corner cases which result in performance monitor interrupts being triggered during power_pmu_disable(). This happens since PMXE bit is not cleared along with disabling of other MMCR0 bits in the pmu_disable. Such PMI's could leave the PMU running and could trigger PMI again which will set MMCR0 PMAO bit. This could lead to spurious interrupts in some corner cases. Example, a timer after power_pmu_del() which will re-enable interrupts and triggers a PMI again since PMAO bit is still set. But fails to find valid overflow since PMC was cleared in power_pmu_del(). Fix that by disabling PMXE along with disabling of other MMCR0 bits in power_pmu_disable(). We can't just replay PMI any time. Hence this approach is preferred rather than replaying PMI before resetting overflown PMC. Patch also documents core-book3s on a race condition which can trigger these PMC messages during idle path in PowerNV. Fixes: f442d004806e ("powerpc/64s: Add support to mask perf interrupts and replay them") Reported-by: Nageswara R Sastry Suggested-by: Nicholas Piggin Suggested-by: Madhavan Srinivasan Signed-off-by: Athira Rajeev Tested-by: Nageswara R Sastry Reviewed-by: Nicholas Piggin [mpe: Make pmi_irq_pending() return bool, reflow/reword some comments] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1626846509-1350-2-git-send-email-atrajeev@linux.vnet.ibm.com commit 72a2ff567fc38a3648507c5386a383007400bb3a Author: Christophe JAILLET Date: Sun Nov 28 12:03:30 2021 +0100 ethtool: netlink: Slightly simplify 'ethnl_features_to_bitmap()' The 'dest' bitmap is fully initialized by the 'for' loop, so there is no need to explicitly reset it. This also makes this function in line with 'ethnl_features_to_bitmap32()' which does not clear the destination before writing it. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/17fca158231c6f03689bd891254f0dd1f4e84cb8.1638091829.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jakub Kicinski commit a21ee5b2fcb8d6d3973446c5039e966c4cfe40d1 Author: Tonghao Zhang Date: Sun Nov 28 09:46:31 2021 +0800 net: ifb: support ethtools stats With this feature, we can use the ethtools to get tx/rx queues stats. This patch, introduce the ifb_update_q_stats helper to update the queues stats, and ifb_q_stats to simplify the codes. Signed-off-by: Tonghao Zhang Link: https://lore.kernel.org/r/20211128014631.43627-1-xiangxia.m.yue@gmail.com Signed-off-by: Jakub Kicinski commit db33028647a3eca9e3e6fccf170d75f3b56a466c Author: Bart Van Assche Date: Mon Nov 29 11:46:09 2021 -0800 scsi: Remove superfluous #include directives Remove this include directive from code that does not use any functionality from kernel/async.c. Link: https://lore.kernel.org/r/20211129194609.3466071-13-bvanassche@acm.org Reviewed-by: Daejun Park Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit b558fa11e4b53027776c451553437aeda4463e4d Author: Bart Van Assche Date: Mon Nov 29 11:46:08 2021 -0800 scsi: pmcraid: Fix a kernel-doc warning Fix the following kernel-doc warning: drivers/scsi/pmcraid.c:3317: warning: Excess function parameter 'done' description in 'pmcraid_queuecommand_lck' Link: https://lore.kernel.org/r/20211129194609.3466071-12-bvanassche@acm.org Fixes: af049dfd0b10 ("scsi: core: Remove the 'done' argument from SCSI queuecommand_lck functions") Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit d6e71a43b11c67cae3f3c595beef020899ec68e9 Author: Bart Van Assche Date: Mon Nov 29 11:46:07 2021 -0800 scsi: pm8001: Fix kernel-doc warnings Fix the following kernel-doc warnings: drivers/scsi/pm8001/pm8001_ctl.c:900: warning: cannot understand function prototype: 'const char *const mpiStateText[] = ' drivers/scsi/pm8001/pm8001_ctl.c:930: warning: Function parameter or member 'attr' not described in 'ctl_hmi_error_show' drivers/scsi/pm8001/pm8001_ctl.c:951: warning: Function parameter or member 'attr' not described in 'ctl_raae_count_show' drivers/scsi/pm8001/pm8001_ctl.c:972: warning: Function parameter or member 'attr' not described in 'ctl_iop0_count_show' drivers/scsi/pm8001/pm8001_ctl.c:993: warning: Function parameter or member 'attr' not described in 'ctl_iop1_count_show' Link: https://lore.kernel.org/r/20211129194609.3466071-11-bvanassche@acm.org Fixes: 4ddbea1b6f51 ("scsi: pm80xx: Add sysfs attribute to check MPI state") Acked-by: Jack Wang Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit acad9c4324992b6fcfe4f714a3b6f3a8cf8af929 Author: Bart Van Assche Date: Mon Nov 29 11:46:06 2021 -0800 scsi: megaraid: Fix a kernel-doc warning Fix the following kernel-doc warning: drivers/scsi/megaraid/megaraid_mbox.c:1439: warning: Excess function parameter 'done' description in 'megaraid_queue_command_lck' Link: https://lore.kernel.org/r/20211129194609.3466071-10-bvanassche@acm.org Fixes: af049dfd0b10 ("scsi: core: Remove the 'done' argument from SCSI queuecommand_lck functions") Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 0addfa5877971a123b489caa3b73c860111e96a8 Author: Bart Van Assche Date: Mon Nov 29 11:46:05 2021 -0800 scsi: initio: Fix a kernel-doc warning Fix the following kernel-doc warning: drivers/scsi/initio.c:2613: warning: Excess function parameter 'done' description in 'i91u_queuecommand_lck' Link: https://lore.kernel.org/r/20211129194609.3466071-9-bvanassche@acm.org Fixes: af049dfd0b10 ("scsi: core: Remove the 'done' argument from SCSI queuecommand_lck functions") Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 013d14eafd5c3d07f54ff8ff075df3cb0254e1a9 Author: Bart Van Assche Date: Mon Nov 29 11:46:04 2021 -0800 scsi: dc395x: Fix a kernel-doc warning Fix the following kernel-doc warning: drivers/scsi/dc395x.c:964: warning: Excess function parameter 'done' description in 'dc395x_queue_command_lck' Link: https://lore.kernel.org/r/20211129194609.3466071-8-bvanassche@acm.org Fixes: af049dfd0b10 ("scsi: core: Remove the 'done' argument from SCSI queuecommand_lck functions") Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 69e623791eb3ff3457c71ef734fdc82f6f3cc3c1 Author: Bart Van Assche Date: Mon Nov 29 11:46:03 2021 -0800 scsi: bfa: Declare 'bfad_im_vport_attrs' static Fix the following kernel-doc warning: 'bfad_im_vport_attrs' is only used in one source file. Hence declare this array static. Link: https://lore.kernel.org/r/20211129194609.3466071-7-bvanassche@acm.org Fixes: e73af234a1a2 ("scsi: bfa: Switch to attribute groups") Reported-by: kernel test robot Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 471d6840559ae8bd1ed7e222d68f15373f6890f9 Author: Bart Van Assche Date: Mon Nov 29 11:46:02 2021 -0800 scsi: atp870u: Fix a kernel-doc warning Fix the following kernel-doc warning: drivers/scsi/atp870u.c:622: warning: Excess function parameter 'done' description in 'atp870u_queuecommand_lck' Link: https://lore.kernel.org/r/20211129194609.3466071-6-bvanassche@acm.org Fixes: af049dfd0b10 ("scsi: core: Remove the 'done' argument from SCSI queuecommand_lck functions") Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 332053e87cda4db58fbeb83fcb7144f88936f3ed Author: Bart Van Assche Date: Mon Nov 29 11:46:01 2021 -0800 scsi: a100u2w: Fix a kernel-doc warning Fix the following kernel-doc warning: drivers/scsi/a100u2w.c:915: warning: Excess function parameter 'done' description in 'inia100_queue_lck' Link: https://lore.kernel.org/r/20211129194609.3466071-5-bvanassche@acm.org Fixes: af049dfd0b10 ("scsi: core: Remove the 'done' argument from SCSI queuecommand_lck functions") Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 3369046e54ca8f82e0cb17740643da2d80d3cfa8 Author: Bart Van Assche Date: Mon Nov 29 11:46:00 2021 -0800 scsi: core: Show SCMD_LAST in text form The SCSI debugfs code supports showing information about pending commands, including translating SCSI command flags from numeric into text format. Also convert the SCMD_LAST flag from numeric into text form. Link: https://lore.kernel.org/r/20211129194609.3466071-4-bvanassche@acm.org Fixes: 8930a6c20791 ("scsi: core: add support for request batching") Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 7cc5aad6c98e0b7e9ab744d1ac7e385e886bb869 Author: Bart Van Assche Date: Mon Nov 29 11:45:59 2021 -0800 scsi: core: Declare 'scsi_scan_type' static 'scsi_scan_type' is only used in one source file. Hence declare it static. Link: https://lore.kernel.org/r/20211129194609.3466071-3-bvanassche@acm.org Fixes: a19a93e4c6a9 ("scsi: core: pm: Rely on the device driver core for async power management") Reported-by: kernel test robot Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 776141dda77f153379a2eea0887f76cb3e6c8062 Author: Bart Van Assche Date: Mon Nov 29 11:45:58 2021 -0800 scsi: core: Suppress a kernel-doc warning Suppress the following kernel-doc warning: drivers/scsi/scsi_scan.c:129: warning: Function parameter or member 'dev' not described in 'scsi_enable_async_suspend' Link: https://lore.kernel.org/r/20211129194609.3466071-2-bvanassche@acm.org Fixes: a19a93e4c6a9 ("scsi: core: pm: Rely on the device driver core for async power management") Reported-by: Stephen Rothwell Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 6d8619f034f01c841fb3836d4a1bc682571db995 Author: Florian Fainelli Date: Fri Nov 26 12:17:07 2021 -0800 scsi: qedi: Remove set but unused 'page' variable The variable 'page' is set but never used throughout qedi_alloc_bdq(). Therefore remove it. Link: https://lore.kernel.org/r/20211126201708.27140-2-f.fainelli@gmail.com Reported-by: kernel test robot Acked-by: Manish Rangankar Signed-off-by: Florian Fainelli Signed-off-by: Martin K. Petersen commit ddba1cf7a506b09b3583bcac2d64ec88bd4e3a96 Author: Adrian Hunter Date: Wed Oct 27 16:06:14 2021 +0300 scsi: ufs: Let devices remain runtime suspended during system suspend If the UFS Device WLUN is runtime suspended and is in the same power mode, link state, and b_rpm_dev_flush_capable (BKOP or WB buffer flush etc) state, then it can remain runtime suspended instead of being runtime resumed and then system suspended. The following patch has cleared the way for that to happen: scsi: core: pm: Only runtime resume if necessary So amend the logic accordingly. Note, the ufs-hisi driver uses different RPM and SPM, but it is made explicit by a new parameter to suspend prepare. Link: https://lore.kernel.org/r/20211027130614.406985-2-adrian.hunter@intel.com Reviewed-by: Asutosh Das Reviewed-by: Bean Huo Signed-off-by: Adrian Hunter Signed-off-by: Martin K. Petersen commit f05cab0034babaa9b3dfaf6003ee6493496a8180 Author: Christophe Leroy Date: Tue Sep 21 17:09:49 2021 +0200 powerpc/atomics: Remove atomic_inc()/atomic_dec() and friends Now that atomic_add() and atomic_sub() handle immediate operands, atomic_inc() and atomic_dec() have no added value compared to the generic fallback which calls atomic_add(1) and atomic_sub(1). Also remove atomic_inc_not_zero() which fallsback to atomic_add_unless() which itself fallsback to atomic_fetch_add_unless() which now handles immediate operands. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/0bc64a2f18726055093dbb2e479cefc60a409cfd.1632236981.git.christophe.leroy@csgroup.eu commit 41d65207de9fbff58acd8937a7c3f8940c186a87 Author: Christophe Leroy Date: Tue Sep 21 17:09:48 2021 +0200 powerpc/atomics: Use immediate operand when possible Today we get the following code generation for atomic operations: c001bb2c: 39 20 00 01 li r9,1 c001bb30: 7d 40 18 28 lwarx r10,0,r3 c001bb34: 7d 09 50 50 subf r8,r9,r10 c001bb38: 7d 00 19 2d stwcx. r8,0,r3 c001c7a8: 39 40 00 01 li r10,1 c001c7ac: 7d 00 18 28 lwarx r8,0,r3 c001c7b0: 7c ea 42 14 add r7,r10,r8 c001c7b4: 7c e0 19 2d stwcx. r7,0,r3 By allowing GCC to choose between immediate or regular operation, we get: c001bb2c: 7d 20 18 28 lwarx r9,0,r3 c001bb30: 39 49 ff ff addi r10,r9,-1 c001bb34: 7d 40 19 2d stwcx. r10,0,r3 -- c001c7a4: 7d 40 18 28 lwarx r10,0,r3 c001c7a8: 39 0a 00 01 addi r8,r10,1 c001c7ac: 7d 00 19 2d stwcx. r8,0,r3 For "and", the dot form has to be used because "andi" doesn't exist. For logical operations we use unsigned 16 bits immediate. For arithmetic operations we use signed 16 bits immediate. On pmac32_defconfig, it reduces the text by approx another 8 kbytes. Signed-off-by: Christophe Leroy Acked-by: Segher Boessenkool Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/2ec558d44db8045752fe9dbd29c9ba84bab6030b.1632236981.git.christophe.leroy@csgroup.eu commit fb350784d8d17952afa93383bb47aaa6b715c459 Author: Christophe Leroy Date: Tue Sep 21 17:09:47 2021 +0200 powerpc/bitops: Use immediate operand when possible Today we get the following code generation for bitops like set or clear bit: c0009fe0: 39 40 08 00 li r10,2048 c0009fe4: 7c e0 40 28 lwarx r7,0,r8 c0009fe8: 7c e7 53 78 or r7,r7,r10 c0009fec: 7c e0 41 2d stwcx. r7,0,r8 c000d568: 39 00 18 00 li r8,6144 c000d56c: 7c c0 38 28 lwarx r6,0,r7 c000d570: 7c c6 40 78 andc r6,r6,r8 c000d574: 7c c0 39 2d stwcx. r6,0,r7 Most set bits are constant on lower 16 bits, so it can easily be replaced by the "immediate" version of the operation. Allow GCC to choose between the normal or immediate form. For clear bits, on 32 bits 'rlwinm' can be used instead of 'andc' for when all bits to be cleared are consecutive. On 64 bits we don't have any equivalent single operation for clearing, single bits or a few bits, we'd need two 'rldicl' so it is not worth it, the li/andc sequence is doing the same. With this patch we get: c0009fe0: 7d 00 50 28 lwarx r8,0,r10 c0009fe4: 61 08 08 00 ori r8,r8,2048 c0009fe8: 7d 00 51 2d stwcx. r8,0,r10 c000d558: 7c e0 40 28 lwarx r7,0,r8 c000d55c: 54 e7 05 64 rlwinm r7,r7,0,21,18 c000d560: 7c e0 41 2d stwcx. r7,0,r8 On pmac32_defconfig, it reduces the text by approx 10 kbytes. Signed-off-by: Christophe Leroy Reviewed-by: Segher Boessenkool Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/e6f815d9181bab09df3b350af51149437863e9f9.1632236981.git.christophe.leroy@csgroup.eu commit fee32807633395e666f0951d6b7b6546e9b76c3d Author: Abhinav Kumar Date: Fri Nov 19 15:15:25 2021 -0800 mailmap: add and update email addresses Add and also update the email addresses to prepare for the transition to the new ones. Signed-off-by: Abhinav Kumar Acked-by: Akhil P Oommen Link: https://lore.kernel.org/r/1637363725-17732-1-git-send-email-quic_abhinavk@quicinc.com Signed-off-by: Rob Clark commit 2492a3b65ef60eba946866b8722c9b3f5d088e6a Author: Abhinav Kumar Date: Fri Nov 19 23:46:11 2021 -0800 MAINTAINERS: update designated reviewer entry for MSM DRM driver Adding myself as a designated reviewer to assist with the code reviews for the changes coming into MSM DRM. Acked-by: Rob Clark Signed-off-by: Abhinav Kumar Link: https://lore.kernel.org/r/1637394371-16783-1-git-send-email-quic_abhinavk@quicinc.com Signed-off-by: Rob Clark commit db492480b2b2228e9cb9ce85bef50d003c8f8c37 Author: Krishna Manikandan Date: Wed Nov 10 16:21:47 2021 +0530 drm/msm: use compatible lists to find mdp node In the current implementation, substring comparison using device node name is used to find mdp node during driver probe. Use compatible string list instead of node name to get mdp node from the parent mdss node. Signed-off-by: Krishna Manikandan Reviewed-by: Stephen Boyd Changes in v2: - Use compatible lists instead of duplicate string check (Stephen Boyd) Changes in v3: - Use match tables to find the mdp node (Stephen Boyd) Changes in v4: - Drop EXPORT_SYMBOL (Dmitry Baryshkov) Link: https://lore.kernel.org/r/1636541507-5144-1-git-send-email-quic_mkrishn@quicinc.com Signed-off-by: Rob Clark commit 89688e2119b2c9e7ba0c1833a663b7e3a011861d Author: Bjorn Andersson Date: Tue Nov 23 07:40:49 2021 -0800 drm/msm/dpu: Add more of the INTF interrupt regions In addition to the other 7xxx INTF interrupt regions, SM8350 has additional INTF regions at 0x0ae37000, 0x0ae38000 and 0x0ae39000, define these. The 7xxx naming scheme of the bits are kept for consistency. Signed-off-by: Bjorn Andersson Reviewed-by: Robert Foss Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20211123154050.40984-1-bjorn.andersson@linaro.org Signed-off-by: Rob Clark commit fabae667b1263216be53e0230cd3966a9a1963a4 Author: Bjorn Andersson Date: Sat Nov 6 10:22:46 2021 -0700 drm/msm/dp: Drop now unused hpd_high member Since '8ede2ecc3e5e ("drm/msm/dp: Add DP compliance tests on Snapdragon Chipsets")' the hpd_high member of struct dp_usbpd has been write-only. Let's clean up the code a little bit by removing the writes as well. Signed-off-by: Bjorn Andersson Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/20211106172246.2597431-1-bjorn.andersson@linaro.org Signed-off-by: Rob Clark commit a630ac686425b52209d6bedc3b6e96038c341678 Author: Rob Clark Date: Wed Nov 24 13:41:29 2021 -0800 drm/msm/gpu: Name GMU bos Signed-off-by: Rob Clark Link: https://lore.kernel.org/r/20211124214151.1427022-5-robdclark@gmail.com Signed-off-by: Rob Clark commit f4f6dfdec23091ec1d64495e2306ee5bdc855f3a Author: Rob Clark Date: Wed Nov 24 13:41:35 2021 -0800 drm/msm/gpu: Add a comment in a6xx_gmu_init() If you don't realize is_a650_family() also encompasses a660 family, you'd think that the debug buffer is double allocated. Add a comment to make this more clear. Signed-off-by: Rob Clark Link: https://lore.kernel.org/r/20211124214151.1427022-11-robdclark@gmail.com Signed-off-by: Rob Clark commit b859f9b009bbfbc236d9b076c64c59ccb41b8737 Author: Rob Clark Date: Wed Nov 24 13:41:34 2021 -0800 drm/msm/gpu: Snapshot GMU debug buffer It appears to be a GMU fw build option whether it does anything with debug and log buffers, but if they are all zeros it won't add anything to the devcore size. Signed-off-by: Rob Clark Link: https://lore.kernel.org/r/20211124214151.1427022-10-robdclark@gmail.com Signed-off-by: Rob Clark commit 1691e005962e15fc7ef232fda60de8a76860f422 Author: Rob Clark Date: Wed Nov 24 13:41:33 2021 -0800 drm/msm/gpu: Also snapshot GMU HFI buffer This also includes a history of start index of the last 8 messages on each queue, since parsing backwards to decode recently sent HFI messages is hard(ish). Signed-off-by: Rob Clark Link: https://lore.kernel.org/r/20211124214151.1427022-9-robdclark@gmail.com Signed-off-by: Rob Clark commit 203dcd5e9d8728a75a33ad72325aaeb1d58b0082 Author: Rob Clark Date: Wed Nov 24 13:41:32 2021 -0800 drm/msm/gpu: Make a6xx_get_gmu_log() more generic Turn it into a thing we can use to snapshot other GMU buffers. Signed-off-by: Rob Clark Link: https://lore.kernel.org/r/20211124214151.1427022-8-robdclark@gmail.com Signed-off-by: Rob Clark commit eaa55ead5a41ab5fb3ef0561935ffe04453b56a7 Author: Rob Clark Date: Wed Nov 24 13:41:30 2021 -0800 drm/msm/gpu: Add some WARN_ON()s We don't expect either of these conditions to ever be true, so let's get shouty if they are. Signed-off-by: Rob Clark Link: https://lore.kernel.org/r/20211124214151.1427022-6-robdclark@gmail.com Signed-off-by: Rob Clark commit 065db2d90c6b8384c9072fe55f01c3eeda16c3c0 Author: Yang Yang Date: Mon Nov 29 06:51:14 2021 +0000 docs/zh_CN: Add zh_CN/accounting/taskstats.rst Add translation zh_CN/accounting/taskstats.rst and links it to zh_CN/accounting/index.rst while clean its todo entry. Signed-off-by: Yang Yang Reviewed-by: Alex Shi Reviewed-by: Yanteng Si Link: https://lore.kernel.org/r/20211129065113.306748-1-yang.yang29@zte.com.cn [jc: removed excess RST label] Signed-off-by: Jonathan Corbet commit 2352b05fdf1a225d103044cceb9a7456624ea0ae Author: Heiner Kallweit Date: Mon Nov 29 20:53:14 2021 +0100 i2c: i801: Improve handling platform data for tco device The platform data structures are used in the respective i801_add_tco functions only. Therefore we can make the definitions local to these functions. Reviewed-by: Jean Delvare Signed-off-by: Heiner Kallweit Signed-off-by: Wolfram Sang commit c4c5509006f91763fb0600a518a25346de2b011d Author: Ahmed Zaki Date: Sun Nov 28 10:17:19 2021 -0700 Doc: networking: Fix the title's Sphinx overline in rds.rst A missing "=" caused the title and sections to not show up properly in the htmldocs. Signed-off-by: Ahmed Zaki Link: https://lore.kernel.org/r/20211128171719.3286255-1-anzaki@gmail.com Signed-off-by: Jonathan Corbet commit f5a46e9de65f31877ab9250f65e3de0caf3b4a37 Author: Yanteng Si Date: Mon Nov 22 15:40:29 2021 +0800 docs/zh_CN: update sparse translation Sparse documents are too outdated,let's update sparse.rst to the latest version. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/497c334954afc0190d5531716d273925baedfff2.1637565886.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit 274f4df3bf09a28a64970834650a1b1f8ad640a4 Author: Yanteng Si Date: Mon Nov 22 15:40:28 2021 +0800 docs/zh_CN: move sparse into dev-tools ../zh_CN/saprse.txt is alone at here, let's move it to ../zh_CN/dev-tools/sparse.rst. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/0f1182add7afe4e3b42398353a823d1b4dcf5147.1637565886.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit d5b78edb5898613470a4f2928d4e474cd91e8832 Author: Yanteng Si Date: Fri Nov 12 10:21:00 2021 +0800 docs/zh_CN: add pci-iov-howto translation Translate .../PCI/pci-iov-howto.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/4c67e3a0ab6c8fe12b97adb924f079d7425d40c5.1636683482.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit a09b34ebb0c923ae6726a8d34298907c534c7c49 Author: Yanteng Si Date: Fri Nov 12 10:20:59 2021 +0800 docs/zh_CN: add pciebus-howto translation Translate .../PCI/pciebus-howto.rst into Chinese. Signed-off-by: Yanteng Si Reviewed-by: Alex Shi Link: https://lore.kernel.org/r/bd22bd2c4c1a9d869dbd69148a7b94b2e33f8e5c.1636683482.git.siyanteng@loongson.cn Signed-off-by: Jonathan Corbet commit 6e6609f21bbc46cbf61dacb467aeabcc128b5e1c Author: Alexey Brodkin Date: Fri Nov 12 09:50:59 2021 +0300 docs: Add documentation for ARC processors ARC processors are supported in upstream kernel since v3.9 and so far there was no documentation about them except some Device Tree bindings. Fixing it with the simples set of docs now: 1. Overview with pointers to other informational resources 2. Autogenerated feature table Note though it's just the very beginning, there will be more for sure given time as there're many things worth documenting and in fact even contents itself is avaialble but just spread in some other places. Now we'll try to keep all here and then maintain it looking forward to match the state of development. Signed-off-by: Alexey Brodkin Cc: Randy Dunlap Cc: Vineet Gupta Reviewed-by: Randy Dunlap Link: https://lore.kernel.org/r/20211112065059.7273-1-abrodkin@synopsys.com Signed-off-by: Jonathan Corbet commit 5b4afd00fc4847577bcc12f3c3e6d4e907962bdc Author: Thierry Reding Date: Fri Nov 12 14:19:03 2021 +0100 dt-bindings: arm: cpus: Add ARM Cortex-A78 The ARM Cortex-A78 CPU can be found in a number of recent SoCs such as the NVIDIA Tegra234 (Orin). Signed-off-by: Thierry Reding Acked-by: Robin Murphy Link: https://lore.kernel.org/r/20211112131904.3683428-1-thierry.reding@gmail.com Signed-off-by: Rob Herring commit b98aee466d194788bd651cb375b0e0f7e0e69865 Author: Yang Li Date: Mon Nov 22 10:20:50 2021 +0800 optee: Fix NULL but dereferenced coccicheck error Eliminate the following coccicheck warning: ./drivers/tee/optee/smc_abi.c:1508:12-15: ERROR: optee is NULL but dereferenced. Reported-by: Abaci Robot Fixes: 6749e69c4dad ("optee: add asynchronous notifications") Signed-off-by: Yang Li Signed-off-by: Jens Wiklander commit 49bcb1506f2e095262c01bda7fd1c0db524c91e2 Author: Niklas Söderlund Date: Tue Nov 9 11:30:45 2021 +0100 dt-bindings: thermal: Fix definition of cooling-maps contribution property When converting the thermal-zones bindings to yaml the definition of the contribution property changed. The intention is the same, an integer value expressing a ratio of a sum on how much cooling is provided by the device to the zone. But after the conversion the integer value is limited to the range 0 to 100 and expressed as a percentage. This is problematic for two reasons. - This do not match how the binding is used. Out of the 18 files that make use of the property only two (ste-dbx5x0.dtsi and ste-hrefv60plus.dtsi) sets it at a value that satisfy the binding, 100. The remaining 16 files set the value higher and fail to validate. - Expressing the value as a percentage instead of a ratio of the sum is confusing as there is nothing to enforce the sum in the zone is not greater then 100. This patch restore the pre yaml conversion description and removes the value limitation allowing the usage of the bindings to validate. Fixes: 1202a442a31fd2e5 ("dt-bindings: thermal: Add yaml bindings for thermal zones") Reported-by: Kieran Bingham Signed-off-by: Niklas Söderlund Link: https://lore.kernel.org/r/20211109103045.1403686-1-niklas.soderlund+renesas@ragnatech.se Signed-off-by: Rob Herring commit 74ba89c08e309bfeb2b2f401bf588ab54a1542fe Author: Imre Deak Date: Thu Nov 25 19:16:03 2021 +0200 drm/i915: Fix DPT suspend/resume on !HAS_DISPLAY platforms The drm.mode_config state is not initialized in case of !HAS_DISPLAY so taking the fb_lock and iterating the fb list won't work on those platforms. Skip the suspend/resume with an explicit check for this. Fixes: 9755f055f512 ("drm/i915: Restore memory mapping for DPT FBs across system suspend/resume") Cc: Chris Wilson Cc: Ville Syrjala Cc: Jani Nikula Signed-off-by: Imre Deak Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211125171603.1775179-1-imre.deak@intel.com commit 46e988434d65f0522efb19e74aa936954b594b78 Author: David Heidelberg Date: Mon Nov 8 19:33:22 2021 +0100 dt-bindings: display: sync formats with simplefb.h Sync all formats from simplefb.h into documentation. Signed-off-by: David Heidelberg Link: https://lore.kernel.org/r/20211108183322.68192-1-david@ixit.cz Signed-off-by: Rob Herring commit 81ff48ddda0b7e1d4d1251d2a9c8e4059cd9456f Author: Christophe JAILLET Date: Thu Nov 25 21:42:28 2021 +0100 RDMA/bnxt_re: Use bitmap_zalloc() when applicable Use 'bitmap_zalloc()' to simplify code, improve the semantic and avoid some open-coded arithmetic in allocator arguments. Also change the corresponding 'kfree()' into 'bitmap_free()' to keep consistency. Link: https://lore.kernel.org/r/5c029daf43b92fdc27926fe8a98084843437c498.1637872888.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET Signed-off-by: Jason Gunthorpe commit ecd68ef8d936ef1c589ba4831e9f0fec63565444 Author: Christophe JAILLET Date: Thu Nov 25 21:05:49 2021 +0100 RDMA/pvrdma: Use non-atomic bitmap functions when possible In 'pvrdma_uar_table_init()', the 'tbl->table' bitmap has just been allocated, so no concurrent accesses can occur. The other accesses to the 'tbl->table' bitmap are protected by the 'tbl->lock' spinlock, so no concurrent accesses can happen. So prefer the non-atomic '__[set|clear]_bit()' functions to save a few cycles. Link: https://lore.kernel.org/r/271b0e2c316e2b4cf34ac6fbca0701edd2d882ec.1637870667.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET Signed-off-by: Jason Gunthorpe commit 67ec0fdfc5de1d14b438402c6e9759da73c5c9eb Author: Christophe JAILLET Date: Thu Nov 25 21:05:40 2021 +0100 RDMA/pvrdma: Use bitmap_zalloc() when applicable Use 'bitmap_zalloc()' to simplify code, improve the semantic and avoid some open-coded arithmetic in allocator arguments. Also change the corresponding 'kfree()' into 'bitmap_free()' to keep consistency. Link: https://lore.kernel.org/r/33e8b993bfa6b7164e9bee95e3c27fb2c53949ce.1637870667.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET Signed-off-by: Jason Gunthorpe commit f86dbc9fc5d83384eae7eda0de17f823e8c81ca0 Author: Christophe JAILLET Date: Thu Nov 25 20:53:22 2021 +0100 IB/hfi1: Use bitmap_zalloc() when applicable Use 'bitmap_zalloc()' to simplify code, improve the semantic and avoid some open-coded arithmetic in allocator arguments. Also change the corresponding 'kfree()' into 'bitmap_free()' to keep consistency. Link: https://lore.kernel.org/r/d46c6bc1869b8869244fa71943d2cad4104b3668.1637869925.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET Signed-off-by: Jason Gunthorpe commit 0c83da72d0c98cbde21fee4d0e8a7f3b5cac273a Author: Christophe JAILLET Date: Thu Nov 25 20:42:51 2021 +0100 RDMA/mlx4: Use bitmap_alloc() when applicable Use 'bitmap_alloc()' to simplify code, improve the semantic and avoid some open-coded arithmetic in allocator arguments. Also change the corresponding 'kfree()' into 'bitmap_free()' to keep consistency. Link: https://lore.kernel.org/r/4c93b4e02f5d784ddfd3efd4af9e673b9117d641.1637869328.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET Signed-off-by: Jason Gunthorpe commit e02d9cc2f8581ff39d13e0c01c98131bbac70206 Author: Christophe JAILLET Date: Thu Nov 25 20:34:11 2021 +0100 RDMA/ocrdma: Simplify code in 'ocrdma_search_mmap()' 'pd_bitmap' does not need to be const. Without it, it is possible to use this variable when calling '__set_bit()'. This is less verbose and more logical. Link: https://lore.kernel.org/r/ec5cab9611ba062adea4cf8c98a63406ed510a71.1637868728.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET Signed-off-by: Jason Gunthorpe commit 27c2f5029ae33a6f5b7da935f42fda907df0d00c Author: Christophe JAILLET Date: Thu Nov 25 20:34:10 2021 +0100 RDMA/ocrdma: Use bitmap_zalloc() when applicable Use 'bitmap_zalloc()' to simplify code, improve the semantic and avoid some open-coded arithmetic in allocator arguments. Also change the corresponding 'kfree()' into 'bitmap_free()' to keep consistency. Link: https://lore.kernel.org/r/b157f9e1586fb4d1083cb4058d7ac81b10bb86d7.1637868728.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET Signed-off-by: Jason Gunthorpe commit 8291471ea5f1b2e6782cbb9c6ed785f12435245f Author: Wei Yang Date: Sat Nov 27 14:59:19 2021 +0000 cgroup: get the wrong css for css_alloc() during cgroup_init_subsys() css_alloc() needs the parent css, while cgroup_css() gets current cgropu's css. So we are getting the wrong css during cgroup_init_subsys(). Fortunately, cgrp_dfl_root.cgrp's css is not set yet, so the value we pass to css_alloc() is NULL anyway. Let's pass NULL directly during init, since we know there is no parent yet. Signed-off-by: Wei Yang Signed-off-by: Tejun Heo commit 43174f0d4597325cb91f1f1f55263eb6e6101036 Author: Alan Maguire Date: Mon Nov 29 10:00:40 2021 +0000 libbpf: Silence uninitialized warning/error in btf_dump_dump_type_data When compiling libbpf with gcc 4.8.5, we see: CC staticobjs/btf_dump.o btf_dump.c: In function ‘btf_dump_dump_type_data.isra.24’: btf_dump.c:2296:5: error: ‘err’ may be used uninitialized in this function [-Werror=maybe-uninitialized] if (err < 0) ^ cc1: all warnings being treated as errors make: *** [staticobjs/btf_dump.o] Error 1 While gcc 4.8.5 is too old to build the upstream kernel, it's possible it could be used to build standalone libbpf which suffers from the same problem. Silence the error by initializing 'err' to 0. The warning/error seems to be a false positive since err is set early in the function. Regardless we shouldn't prevent libbpf from building for this. Fixes: 920d16af9b42 ("libbpf: BTF dumper support for typed data") Signed-off-by: Alan Maguire Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/1638180040-8037-1-git-send-email-alan.maguire@oracle.com commit 1ed9b961be1492e2acc0ce5113936ab08e379de7 Author: Christophe JAILLET Date: Sat Oct 23 22:02:05 2021 +0200 PCI: xgene-msi: Use bitmap_zalloc() when applicable 'xgene_msi->bitmap' is a bitmap. So use 'bitmap_zalloc()' to simplify code, improve the semantic and avoid some open-coded arithmetic in allocator arguments. Also change the corresponding 'kfree()' into 'bitmap_free()' to keep consistency. Link: https://lore.kernel.org/r/32f3bc1fbfbd6ee0815e565012904758ca9eff7e.1635019243.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET Signed-off-by: Lorenzo Pieralisi Reviewed-by: Krzysztof Wilczyński commit 36af188f795bd1b0d794dd735623979dc6b698d3 Author: Lakshmi Sowjanya D Date: Tue Nov 9 16:05:52 2021 +0530 i2c: designware-pci: Set ideal timing parameters for Elkhart Lake PSE Set optimal HCNT, LCNT and hold time values for all the speeds supported in Intel Programmable Service Engine I2C controller in Intel Elkhart Lake. Signed-off-by: Lakshmi Sowjanya D Acked-by: Jarkko Nikula Signed-off-by: Wolfram Sang commit e8578547ce59ddba3651ac0e68dbcb6daa8ce790 Author: Lakshmi Sowjanya D Date: Tue Nov 9 16:05:51 2021 +0530 i2c: designware-pci: Add support for Fast Mode Plus and High Speed Mode Add support to configure HCNT, LCNT values for Fast Mode Plus and High Speed Mode. Signed-off-by: Lakshmi Sowjanya D Acked-by: Jarkko Nikula Signed-off-by: Wolfram Sang commit 172d931910e1db800f4e71e8ed92281b6f8c6ee2 Author: Derek Basehore Date: Mon Oct 25 14:35:31 2021 -0700 i2c: enable async suspend/resume on i2c client devices This enables the async suspend for i2c client devices. This reduces the suspend/resume time considerably on platforms where i2c devices can take a lot of time (hundreds of ms) to resume. Signed-off-by: Derek Basehore Signed-off-by: Rajat Jain Tested-by: Jarkko Nikula Signed-off-by: Wolfram Sang commit d320ec7acc83a66cb1367f6cdee53177f07a9f5d Author: Rajat Jain Date: Mon Oct 25 14:35:30 2021 -0700 i2c: enable async suspend/resume for i2c adapters Enable async suspend/resume of i2c adapters. It enormously helps with reducing the resume time of systems (as much as 20%-40%) where I2C devices can take significant time (100s of ms) to resume. Signed-off-by: Rajat Jain Tested-by: Jarkko Nikula Signed-off-by: Wolfram Sang commit 7c5b3c158b38dcf0c3c62657d9aa39decaf59cdc Author: Rajat Jain Date: Mon Oct 25 14:35:29 2021 -0700 i2c: designware: Enable async suspend / resume of designware devices Mark the designware devices for asynchronous suspend. With this, the resume for designware devices does not get stuck behind other unrelated devices (e.g. intel_backlight that takes hundreds of ms to resume, waiting for its parent devices). Signed-off-by: Rajat Jain Acked-by: Jarkko Nikula Tested-by: Jarkko Nikula Signed-off-by: Wolfram Sang commit ebe82cf92cd4825c3029434cabfcd2f1780e64be Author: Joakim Tjernlund Date: Thu May 11 14:20:33 2017 +0200 i2c: mpc: Correct I2C reset procedure Current I2C reset procedure is broken in two ways: 1) It only generate 1 START instead of 9 STARTs and STOP. 2) It leaves the bus Busy so every I2C xfer after the first fixup calls the reset routine again, for every xfer there after. This fixes both errors. Signed-off-by: Joakim Tjernlund Acked-by: Scott Wood Signed-off-by: Wolfram Sang commit 7be10cef0fbe91f83c55faea7e8b70c0529dde5f Merge: 679de7b64f962 dd894f4caf7df Author: Mark Brown Date: Mon Nov 29 16:43:16 2021 +0000 ASoC: soc-pcm: tidyup soc_pcm_pointer()'s delay update method Merge series from Kuninori Morimoto : Current soc_pcm_pointer() is checking runtime->delay, but it might be updated silently by component's .point callback. It is strange and difficult to find/know the issue. This patch adds .delay callback for component, and solve the issue. commit 6dd21ad81bf96478db3403b1bbe251c0612d0431 Author: Thomas Gleixner Date: Wed Nov 24 23:40:01 2021 +0100 ALSA: hda: Make proper use of timecounter HDA uses a timecounter to read a hardware clock running at 24 MHz. The conversion factor is set with a mult value of 125 and a shift value of 0, which is not converting the hardware clock to nanoseconds, it is converting to 1/3 nanoseconds because the conversion factor from 24Mhz to nanoseconds is 125/3. The usage sites divide the "nanoseconds" value returned by timecounter_read() by 3 to get a real nanoseconds value. There is a lengthy comment in azx_timecounter_init() explaining this choice. That comment makes blatantly wrong assumptions about how timecounters work and what can overflow. The comment says: * Applying the 1/3 factor as part of the multiplication * requires at least 20 bits for a decent precision, however * overflows occur after about 4 hours or less, not a option. timecounters operate on time deltas between two readouts of a clock and use the mult/shift pair to calculate a precise nanoseconds value: delta_nsec = (delta_clock * mult) >> shift; The fractional part is also taken into account and preserved to prevent accumulated rounding errors. For details see cyclecounter_cyc2ns(). The mult/shift pair has to be chosen so that the multiplication of the maximum expected delta value does not result in a 64bit overflow. As the counter wraps around on 32bit, the maximum observable delta between two reads is (1 << 32) - 1 which is about 178.9 seconds. That in turn means the maximum multiplication factor which fits into an u32 will not cause a 64bit overflow ever because it's guaranteed that: ((1 << 32) - 1) ^ 2 < (1 << 64) The resulting correct multiplication factor is 2796202667 and the shift value is 26, i.e. 26 bit precision. The overflow of the multiplication would happen exactly at a clock readout delta of 6597069765 which is way after the wrap around of the hardware clock at around 274.8 seconds which is off from the claimed 4 hours by more than an order of magnitude. If the counter ever wraps around the last read value then the calculation is off by the number of wrap arounds times 178.9 seconds because the overflow cannot be observed. Use clocks_calc_mult_shift(), which calculates the most accurate mult/shift pair based on the given clock frequency, and remove the bogus comment along with the divisions at the readout sites. Fixes: 5d890f591d15 ("ALSA: hda: support for wallclock timestamps") Signed-off-by: Thomas Gleixner Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/871r35kwji.ffs@tglx Signed-off-by: Takashi Iwai commit a93789ae541c7d5c1c2a4942013adb6bcc5e2848 Author: Sriram R Date: Thu Nov 25 15:00:14 2021 +0530 ath11k: Avoid NULL ptr access during mgmt tx cleanup Currently 'ar' reference is not added in skb_cb during WMI mgmt tx. Though this is generally not used during tx completion callbacks, on interface removal the remaining idr cleanup callback uses the ar ptr from skb_cb from mgmt txmgmt_idr. Hence fill them during tx call for proper usage. Also free the skb which is missing currently in these callbacks. Crash_info: [19282.489476] Unable to handle kernel NULL pointer dereference at virtual address 00000000 [19282.489515] pgd = 91eb8000 [19282.496702] [00000000] *pgd=00000000 [19282.502524] Internal error: Oops: 5 [#1] PREEMPT SMP ARM [19282.783728] PC is at ath11k_mac_vif_txmgmt_idr_remove+0x28/0xd8 [ath11k] [19282.789170] LR is at idr_for_each+0xa0/0xc8 Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-00729-QCAHKSWPL_SILICONZ-3 v2 Signed-off-by: Sriram R Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1637832614-13831-1-git-send-email-quic_srirrama@quicinc.com commit 54d4c88b37595173d7039ea9a57913edfee48f47 Author: Mauro Carvalho Chehab Date: Mon Nov 29 14:23:56 2021 +0100 mfd: Kconfig: Change INTEL_SOC_PMIC_CHTDC_TI to bool The INTEL_SOC_PMIC_CHTDC_TI should be initialized early, before loading the fbcon driver, as otherwise the i915 driver will fail to configure pwm: [ 13.674287] fb0: switching to inteldrmfb from EFI VGA [ 13.682380] Console: switching to colour dummy device 80x25 [ 13.682468] i915 0000:00:02.0: vgaarb: deactivate vga console [ 13.682686] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013). [ 13.685773] i915 0000:00:02.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=io+mem:owns=io+mem [ 13.686219] i915 0000:00:02.0: [drm] *ERROR* Failed to configure the pwm chip [ 13.699572] [drm] Initialized i915 1.6.0 20200313 for 0000:00:02.0 on minor 0 [ 13.739044] fbcon: i915drmfb (fb0) is primary device [ 14.037792] intel_soc_pmic_exec_mipi_pmic_seq_element: No PMIC registered ... [ 24.621403] intel_pmic_install_opregion_handler: Ask to register OpRegion for bus ID=PMI2, HID=INT33F5 [ 24.630540] intel_pmic_install_opregion_handler: OpRegion registered (some extra debug printk's were added to the above) As suggested by Hans, this patch also addresses an issue with the dependencies, as, for this driver to be a bool, it also need the I2C core and the I2C_DESIGNWARE driver to be builtin. Suggested-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Hans de Goede Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/86f546b3233fd799b0c39b83afc521440ebfe004.1638192232.git.mchehab+huawei@kernel.org commit 09ae03e2fc9d04240c21759ce9f1ef63d7651850 Author: Heiner Kallweit Date: Sun Nov 28 19:45:56 2021 +0100 stmmac: remove ethtool driver version info I think there's no benefit in reporting a date from almost 6 yrs ago. Let ethtool report the default (kernel version) instead. Signed-off-by: Heiner Kallweit Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit dcad856fe55a6e921e36fb4c57fb6df4bc5a3ce7 Author: kernel test robot Date: Sat Nov 27 19:03:20 2021 +0100 net: dsa: felix: fix flexible_array.cocci warnings Zero-length and one-element arrays are deprecated, see Documentation/process/deprecated.rst Flexible-array members should be used instead. Generated by: scripts/coccinelle/misc/flexible_array.cocci Fixes: 23ae3a787771 ("net: dsa: felix: add stream gate settings for psfp") CC: Xiaoliang Yang Reported-by: kernel test robot Signed-off-by: kernel test robot Signed-off-by: Julia Lawall Signed-off-by: David S. Miller commit ff45b48d35078a0da13c130be81cbb9710f06ae7 Merge: aeeecb8891656 1d851c0905f86 Author: David S. Miller Date: Mon Nov 29 14:26:18 2021 +0000 Merge branch 'hns3-cleanups' Guangbin Huang says: ==================== hns3: some cleanups for -next To improve code readability and simplicity, this series refactor some functions in the HNS3 ethernet driver. ==================== Signed-off-by: David S. Miller commit 1d851c0905f86a3a369c9619b9ed3236758f9999 Author: Yufeng Mo Date: Mon Nov 29 22:00:27 2021 +0800 net: hns3: split function hns3_set_l2l3l4() Function hns3_set_l2l3l4() is a bit too long. So add two new functions hns3_set_l3_type() and hns3_set_l4_csum_length() to simplify code and improve code readability. Signed-off-by: Yufeng Mo Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 2fbf6a07f537e89b0a79d74feffd6bce3f164261 Author: Yufeng Mo Date: Mon Nov 29 22:00:26 2021 +0800 net: hns3: split function hns3_handle_bdinfo() Function hns3_handle_bdinfo() is a bit too long. So add two new functions hns3_handle_rx_ts_info() and hns3_handle_rx_vlan_tag( to simplify code and improve code readability. Signed-off-by: Yufeng Mo Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 8469b645c9a188c6a748bc2c45ddd0c67302a2ab Author: Yufeng Mo Date: Mon Nov 29 22:00:25 2021 +0800 net: hns3: split function hns3_nic_get_stats64() Function hns3_nic_get_stats64() is a bit too long. So add a new function hns3_fetch_stats() to simplify code and improve code readability. Signed-off-by: Yufeng Mo Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit e06dac5290b7f5b98d9f3e4f909548f704f1b335 Author: Guangbin Huang Date: Mon Nov 29 22:00:24 2021 +0800 net: hns3: refine function hclge_tm_pri_q_qs_cfg() This patch encapsulates the process code for queue to qset config of two mode(tc based and vnet based) into two function, for making code more concise. Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 7ca561be11d0336c4329604a82e4d7bfb149d27d Author: Guangbin Huang Date: Mon Nov 29 22:00:23 2021 +0800 net: hns3: add new function hclge_tm_schd_mode_tc_base_cfg() This patch encapsulates the process code of tc based schedule mode of function hclge_tm_lvl34_schd_mode_cfg() into a new function hclge_tm_schd_mode_tc_base_cfg(). It make code more concise and the new process code can be reused. Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit e46da6a3d4d390adaad4eb1471307156933954cc Author: Guangbin Huang Date: Mon Nov 29 22:00:22 2021 +0800 net: hns3: refine function hclge_cfg_mac_speed_dup_hw() To reuse the code of converting speed of driver to speed of firmware in function hclge_cfg_mac_speed_dup_hw(), encapsulate them into a new function hclge_convert_to_fw_speed(). Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit a4ae2bc0abd44032fee3d826bc145661983bdf4e Author: Yufeng Mo Date: Mon Nov 29 22:00:21 2021 +0800 net: hns3: split function hns3_get_tx_timeo_queue_info() Function hns3_get_tx_timeo_queue_info() is a bit too long. So add two new functions hns3_dump_queue_stats() and hns3_dump_queue_reg() to simplify code and improve code readability. Signed-off-by: Yufeng Mo Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit e6fe5e167185b610a948337ab565ed7a7e313f80 Author: Jie Wang Date: Mon Nov 29 22:00:20 2021 +0800 net: hns3: refactor two hns3 debugfs functions Use for statement to optimize some print work of function hclge_dbg_dump_rst_info() and hclge_dbg_dump_mac_enable_status() to improve code simplicity. Signed-off-by: Jie Wang Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit e74a726da2c4dcedb8b0631f423d0044c7901a20 Author: Hao Chen Date: Mon Nov 29 22:00:19 2021 +0800 net: hns3: refactor hns3_nic_reuse_page() Split rx copybreak handle into a separate function from function hns3_nic_reuse_page() to improve code simplicity. Signed-off-by: Hao Chen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit ed0e658c51aadb64b871cfa3de7d26599f171cdb Author: Jiaran Zhang Date: Mon Nov 29 22:00:18 2021 +0800 net: hns3: refactor reset_prepare_general retry statement Currently, the hclge_reset_prepare_general function uses the goto statement to jump upwards, which increases code complexity and makes the program structure difficult to understand. In addition, if reset_pending is set, retry_cnt cannot be increased. This may result in a failure to exit the retry or increase the number of retries. Use the while statement instead to make the program easier to understand and solve the problem that the goto statement cannot be exited. Signed-off-by: Jiaran Zhang Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 2087009c74d41ab8579f08157bca55b7d0857ee5 Author: Ye Bin Date: Mon Nov 29 12:15:37 2021 +0800 io_uring: validate timespec for timeout removals Like commit f6223ff79966, timeout removal should also validate the timespec that is being passed in. Signed-off-by: Ye Bin Link: https://lore.kernel.org/r/20211129041537.1936270-1-yebin10@huawei.com Signed-off-by: Jens Axboe commit 8a7518931baa8ea023700987f3db31cb0a80610b Author: Ye Bin Date: Mon Nov 29 09:26:59 2021 +0800 block: Fix fsync always failed if once failed We do test with inject error fault base on v4.19, after test some time we found sync /dev/sda always failed. [root@localhost] sync /dev/sda sync: error syncing '/dev/sda': Input/output error scsi log as follows: [19069.812296] sd 0:0:0:0: [sda] tag#64 Send: scmd 0x00000000d03a0b6b [19069.812302] sd 0:0:0:0: [sda] tag#64 CDB: Synchronize Cache(10) 35 00 00 00 00 00 00 00 00 00 [19069.812533] sd 0:0:0:0: [sda] tag#64 Done: SUCCESS Result: hostbyte=DID_OK driverbyte=DRIVER_OK [19069.812536] sd 0:0:0:0: [sda] tag#64 CDB: Synchronize Cache(10) 35 00 00 00 00 00 00 00 00 00 [19069.812539] sd 0:0:0:0: [sda] tag#64 scsi host busy 1 failed 0 [19069.812542] sd 0:0:0:0: Notifying upper driver of completion (result 0) [19069.812546] sd 0:0:0:0: [sda] tag#64 sd_done: completed 0 of 0 bytes [19069.812549] sd 0:0:0:0: [sda] tag#64 0 sectors total, 0 bytes done. [19069.812564] print_req_error: I/O error, dev sda, sector 0 ftrace log as follows: rep-306069 [007] .... 19654.923315: block_bio_queue: 8,0 FWS 0 + 0 [rep] rep-306069 [007] .... 19654.923333: block_getrq: 8,0 FWS 0 + 0 [rep] kworker/7:1H-250 [007] .... 19654.923352: block_rq_issue: 8,0 FF 0 () 0 + 0 [kworker/7:1H] -0 [007] ..s. 19654.923562: block_rq_complete: 8,0 FF () 18446744073709551615 + 0 [0] -0 [007] d.s. 19654.923576: block_rq_complete: 8,0 WS () 0 + 0 [-5] As 8d6996630c03 introduce 'fq->rq_status', this data only update when 'flush_rq' reference count isn't zero. If flush request once failed and record error code in 'fq->rq_status'. If there is no chance to update 'fq->rq_status',then do fsync will always failed. To address this issue reset 'fq->rq_status' after return error code to upper layer. Fixes: 8d6996630c03("block: fix null pointer dereference in blk_mq_rq_timed_out()") Signed-off-by: Ye Bin Reviewed-by: Ming Lei Link: https://lore.kernel.org/r/20211129012659.1553733-1-yebin10@huawei.com Signed-off-by: Jens Axboe commit 6050fa4c84cc93ae509f5105f585a429dffc5633 Author: Tetsuo Handa Date: Wed Nov 24 19:47:40 2021 +0900 loop: don't hold lo_mutex during __loop_clr_fd() syzbot is reporting circular locking problem at __loop_clr_fd() [1], for commit 87579e9b7d8dc36e ("loop: use worker per cgroup instead of kworker") is calling destroy_workqueue() with lo->lo_mutex held. Since all functions where lo->lo_state matters are already checking lo->lo_state with lo->lo_mutex held (in order to avoid racing with e.g. ioctl(LOOP_CTL_REMOVE)), and __loop_clr_fd() can be called from either ioctl(LOOP_CLR_FD) xor close(), lo->lo_state == Lo_rundown is considered as an exclusive lock for __loop_clr_fd(). Therefore, hold lo->lo_mutex inside __loop_clr_fd() only when asserting/updating lo->lo_state. Since ioctl(LOOP_CLR_FD) depends on lo->lo_state == Lo_bound, a valid lo->lo_backing_file must have been assigned by ioctl(LOOP_SET_FD) or ioctl(LOOP_CONFIGURE). Thus, we can remove lo->lo_backing_file test, and convert __loop_clr_fd() into a void function. Link: https://syzkaller.appspot.com/bug?extid=63614029dfb79abd4383 [1] Reported-by: syzbot Signed-off-by: Tetsuo Handa Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/8ebe3b2e-8975-7f26-0620-7144a3b8b8cd@i-love.sakura.ne.jp Signed-off-by: Jens Axboe commit a30e3441325ba4011ddf125932cda21ca820c0bb Author: Christoph Hellwig Date: Fri Nov 26 13:18:02 2021 +0100 scsi: remove the gendisk argument to scsi_ioctl Now that blk_execute_rq does not take a gendisk argument there is no need to pass it through the scsi_ioctl callchain either. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20211126121802.2090656-6-hch@lst.de Signed-off-by: Jens Axboe commit b84ba30b6c7a75babdf73b83bc3c7b59b944501a Author: Christoph Hellwig Date: Fri Nov 26 13:18:01 2021 +0100 block: remove the gendisk argument to blk_execute_rq Remove the gendisk aregument to blk_execute_rq and blk_execute_rq_nowait given that it is unused now. Also convert the boolean at_head parameter to actually use the bool type while touching the prototype. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20211126121802.2090656-5-hch@lst.de Signed-off-by: Jens Axboe commit f3fa33acca9f0058157214800f68b10d8e71ab7a Author: Christoph Hellwig Date: Fri Nov 26 13:18:00 2021 +0100 block: remove the ->rq_disk field in struct request Just use the disk attached to the request_queue instead. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20211126121802.2090656-4-hch@lst.de Signed-off-by: Jens Axboe commit 79bb1dbd12005f2143670a9a4f13d91e64725717 Author: Christoph Hellwig Date: Fri Nov 26 13:17:59 2021 +0100 block: don't check ->rq_disk in merges There is a 1:1 relationship between request_queues and gendisks now, so no need for these extra checks. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20211126121802.2090656-3-hch@lst.de Signed-off-by: Jens Axboe commit 82baa324dc41005ab8afc5afee5bfe9cc54f12c4 Author: Christoph Hellwig Date: Fri Nov 26 13:17:58 2021 +0100 mtd_blkdevs: remove the sector out of range check in do_blktrans_request The block layer already performs this check, no need to duplicate it in the driver. Signed-off-by: Christoph Hellwig Reviewed-by: Miquel Raynal Reviewed-by: Martin K. Petersen Link: https://lore.kernel.org/r/20211126121802.2090656-2-hch@lst.de Signed-off-by: Jens Axboe commit af22fef3e7a51cbd339814a0e196086e2bb2aa26 Author: Colin Ian King Date: Fri Nov 26 23:06:52 2021 +0000 block: 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. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20211126230652.1175636-1-colin.i.king@gmail.com Signed-off-by: Jens Axboe commit eca5892a5d616d39185d652820931f21cab2f190 Author: Christoph Hellwig Date: Fri Nov 26 12:58:17 2021 +0100 block: simplify ioc_lookup_icq Remove the ioc argument as it always points to current->io_context. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211126115817.2087431-15-hch@lst.de Signed-off-by: Jens Axboe commit 18b74c4dcad8150e855755697d4d594506e3de78 Author: Christoph Hellwig Date: Fri Nov 26 12:58:16 2021 +0100 block: simplify ioc_create_icq Remove the ioc and gfp_mask argument, which are hard coded by the caller. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211126115817.2087431-14-hch@lst.de Signed-off-by: Jens Axboe commit d538ea4cb8e7241af8091eee30483fabf64444a5 Author: Christoph Hellwig Date: Fri Nov 26 12:58:15 2021 +0100 block: return the io_context from create_task_io_context Grab a reference to the newly allocated or existing io_context in create_task_io_context and return it. This simplifies the callers and removes the need for double lookups. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211126115817.2087431-13-hch@lst.de Signed-off-by: Jens Axboe commit 8ffc13680eac16a1eec86275b65fc6f0e27a30d8 Author: Christoph Hellwig Date: Fri Nov 26 12:58:14 2021 +0100 block: use alloc_io_context in __copy_io In __copy_io we know that the newly allocate task_struct does not have an I/O context yet and is not exiting. So just allocate the I/O context struct and install it directly. There is no need to lock the task either as it is just being created. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211126115817.2087431-12-hch@lst.de Signed-off-by: Jens Axboe commit a0f14d8baaca3e2f3e57bdb062eb476175c90e83 Author: Christoph Hellwig Date: Fri Nov 26 12:58:13 2021 +0100 block: factor out a alloc_io_context helper Factor out a helper that just allocate an I/O context. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211126115817.2087431-11-hch@lst.de Signed-off-by: Jens Axboe commit 50569c24be61eafb3efa06e2a3ccd447f75ae1b0 Author: Christoph Hellwig Date: Fri Nov 26 12:58:12 2021 +0100 block: remove get_io_context_active Fold it into it's only caller, and remove a lof of the debug checks that are not needed. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211126115817.2087431-10-hch@lst.de Signed-off-by: Jens Axboe commit 222ee581b84582dc472d5395b77d7e0cb5268d1c Author: Christoph Hellwig Date: Fri Nov 26 12:58:11 2021 +0100 block: move the remaining elv.icq handling to the I/O scheduler After the prepare side has been moved to the only I/O scheduler that cares, do the same for the cleanup and the NULL initialization. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211126115817.2087431-9-hch@lst.de Signed-off-by: Jens Axboe commit 87dd1d63dcbd0f508a8b23785752e78d082fd176 Author: Christoph Hellwig Date: Fri Nov 26 12:58:10 2021 +0100 block: move blk_mq_sched_assign_ioc to blk-ioc.c Move blk_mq_sched_assign_ioc so that many interfaces from the file can be marked static. Rename the function to ioc_find_get_icq as well and return the icq to simplify the interface. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211126115817.2087431-8-hch@lst.de Signed-off-by: Jens Axboe commit 3304742562d27fb87a6d8291cc48824dd20f6964 Author: Christoph Hellwig Date: Fri Nov 26 12:58:09 2021 +0100 block: mark put_io_context_active static Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211126115817.2087431-7-hch@lst.de Signed-off-by: Jens Axboe commit c2a32464f449370bff27a21b64b1b7d2e1d037f6 Author: Christoph Hellwig Date: Fri Nov 26 12:58:08 2021 +0100 Revert "block: Provide blk_mq_sched_get_icq()" This reverts commit 4896c4e64ba5d5d5acdbcf68c5910dd4f6d8fa62. The helper is not needed any more. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211126115817.2087431-6-hch@lst.de Signed-off-by: Jens Axboe commit a0725c22cd8487f107a80ef87abf03c6379ec927 Author: Christoph Hellwig Date: Fri Nov 26 12:58:07 2021 +0100 bfq: use bfq_bic_lookup in bfq_limit_depth No need to create a new I/O context if there is none present yet in ->limit_depth. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211126115817.2087431-5-hch@lst.de Signed-off-by: Jens Axboe commit 836b394b633e3d618fa44292290bf3d9a1761e0c Author: Christoph Hellwig Date: Fri Nov 26 12:58:06 2021 +0100 bfq: simplify bfq_bic_lookup Remove the unused bfqd argument, and hardcode ioc to current->io_context. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211126115817.2087431-4-hch@lst.de Signed-off-by: Jens Axboe commit 88c9a2ce520ba381bb70658c80ec704f4d60f728 Author: Christoph Hellwig Date: Fri Nov 26 12:58:05 2021 +0100 fork: move copy_io to block/blk-ioc.c Move the copying of the I/O context to the block layer as that is where we can use the proper low-level interfaces. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211126115817.2087431-3-hch@lst.de Signed-off-by: Jens Axboe commit e92a559e6c9db93662a6071f1ecbfa2c1c3be5d3 Author: Christoph Hellwig Date: Fri Nov 26 12:58:04 2021 +0100 RDMA/qib: rename copy_io to qib_copy_io Add the proper module prefix to avoid conflicts with a function in the scheduler. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211126115817.2087431-2-hch@lst.de Signed-off-by: Jens Axboe commit 5f480b1a6325748f26999e2151c9912e00cc4087 Author: Ming Lei Date: Sat Nov 27 00:19:43 2021 +0800 blk-mq: use bio->bi_opf after bio is checked bio->bi_opf isn't finalized before checking the bio, so use it after submit_bio_checks() returns. Fixes: 5b13bc8a3fd5 ("blk-mq: cleanup request allocation") Cc: Christoph Hellwig Signed-off-by: Ming Lei Signed-off-by: Jens Axboe commit c65e6fd460b4df796ecd6ea22e132076ed1f2820 Author: Jan Kara Date: Thu Nov 25 14:36:41 2021 +0100 bfq: Do not let waker requests skip proper accounting Commit 7cc4ffc55564 ("block, bfq: put reqs of waker and woken in dispatch list") added a condition to bfq_insert_request() which added waker's requests directly to dispatch list. The rationale was that completing waker's IO is needed to get more IO for the current queue. Although this rationale is valid, there is a hole in it. The waker does not necessarily serve the IO only for the current queue and maybe it's current IO is not needed for current queue to make progress. Furthermore injecting IO like this completely bypasses any service accounting within bfq and thus we do not properly track how much service is waker's queue getting or that the waker is actually doing any IO. Depending on the conditions this can result in the waker getting too much or too few service. Consider for example the following job file: [global] directory=/mnt/repro/ rw=write size=8g time_based runtime=30 ramp_time=10 blocksize=1m direct=0 ioengine=sync [slowwriter] numjobs=1 prioclass=2 prio=7 fsync=200 [fastwriter] numjobs=1 prioclass=2 prio=0 fsync=200 Despite processes have very different IO priorities, they get the same about of service. The reason is that bfq identifies these processes as having waker-wakee relationship and once that happens, IO from fastwriter gets injected during slowwriter's time slice. As a result bfq is not aware that fastwriter has any IO to do and constantly schedules only slowwriter's queue. Thus fastwriter is forced to compete with slowwriter's IO all the time instead of getting its share of time based on IO priority. Drop the special injection condition from bfq_insert_request(). As a result, requests will be tracked and queued in a normal way and on next dispatch bfq_select_queue() can decide whether the waker's inserted requests should be injected during the current queue's timeslice or not. Fixes: 7cc4ffc55564 ("block, bfq: put reqs of waker and woken in dispatch list") Acked-by: Paolo Valente Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20211125133645.27483-8-jack@suse.cz Signed-off-by: Jens Axboe commit 1eb17f5e15b73669df635fb07df2853cb1244a69 Author: Jan Kara Date: Thu Nov 25 14:36:40 2021 +0100 bfq: Log waker detections Waker - wakee relationships are important in deciding whether one queue can preempt the other one. Print information about detected waker-wakee relationships so that scheduling decisions can be better understood from block traces. Acked-by: Paolo Valente Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20211125133645.27483-7-jack@suse.cz Signed-off-by: Jens Axboe commit 582f04e19ad7b41df993c669805e48a01bcd9c5b Author: Jan Kara Date: Thu Nov 25 14:36:39 2021 +0100 bfq: Provide helper to generate bfqq name Instead of having helper formating bfqq pid, provide a helper to generate full bfqq name as used in the traces. It saves some code duplication and will save more in the coming tracepoints. Acked-by: Paolo Valente Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20211125133645.27483-6-jack@suse.cz Signed-off-by: Jens Axboe commit 1f18b7005b49b96782cd984babd59c286973b526 Author: Jan Kara Date: Thu Nov 25 14:36:38 2021 +0100 bfq: Limit waker detection in time Currently, when process A starts issuing requests shortly after process B has completed some IO three times in a row, we decide that B is a "waker" of A meaning that completing IO of B is needed for A to make progress and generally stop separating A's and B's IO much. This logic is useful to avoid unnecessary idling and thus throughput loss for cases where workload needs to switch e.g. between the process and the journaling thread doing IO. However the detection heuristic tends to frequently give false positives when A and B are fighting IO bandwidth and other processes aren't doing much IO as we are basically deemed to eventually accumulate three occurences of a situation where one process starts issuing requests after the other has completed some IO. To reduce these false positives, cancel the waker detection also if we didn't accumulate three detected wakeups within given timeout. The rationale is that if wakeups are really rare, the pointless idling doesn't hurt throughput that much anyway. This significantly reduces false waker detection for workload like: [global] directory=/mnt/repro/ rw=write size=8g time_based runtime=30 ramp_time=10 blocksize=1m direct=0 ioengine=sync [slowwriter] numjobs=1 fsync=200 [fastwriter] numjobs=1 fsync=200 Acked-by: Paolo Valente Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20211125133645.27483-5-jack@suse.cz Signed-off-by: Jens Axboe commit 76f1df88bbc2f984eb0418cc90de0a8384e63604 Author: Jan Kara Date: Thu Nov 25 14:36:37 2021 +0100 bfq: Limit number of requests consumed by each cgroup When cgroup IO scheduling is used with BFQ it does not really provide service differentiation if the cgroup drives a big IO depth. That for example happens with writeback which asynchronously submits lots of IO but it can happen with AIO as well. The problem is that if we have two cgroups that submit IO with different weights, the cgroup with higher weight properly gets more IO time and is able to dispatch more IO. However this causes lower weight cgroup to accumulate more requests inside BFQ and eventually lower weight cgroup consumes most of IO scheduler tags. At that point higher weight cgroup stops getting better service as it is mostly blocked waiting for a scheduler tag while its queues inside BFQ are empty and thus lower weight cgroup gets served. Check how many requests submitting cgroup has allocated in bfq_limit_depth() and if it consumes more requests than what would correspond to its weight limit available depth to 1 so that the cgroup cannot consume many more requests. With this limitation the higher weight cgroup gets proper service even with writeback. Reviewed-by: Michal Koutný Acked-by: Paolo Valente Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20211125133645.27483-4-jack@suse.cz Signed-off-by: Jens Axboe commit 44dfa279f117646163db0c8760addb45dd6a0e8c Author: Jan Kara Date: Thu Nov 25 14:36:36 2021 +0100 bfq: Store full bitmap depth in bfq_data Store bitmap depth shift inside bfq_data so that we can use it in bfq_limit_depth() for proportioning when limiting number of available request tags for a cgroup. Acked-by: Paolo Valente Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20211125133645.27483-3-jack@suse.cz Signed-off-by: Jens Axboe commit 98f044999ba141a6b6b79cb3a996a73f05a46820 Author: Jan Kara Date: Thu Nov 25 14:36:35 2021 +0100 bfq: Track number of allocated requests in bfq_entity When we want to limit number of requests used by each bfqq and also cgroup, we need to track also number of requests used by each cgroup. So track number of allocated requests for each bfq_entity. Acked-by: Paolo Valente Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20211125133645.27483-2-jack@suse.cz Signed-off-by: Jens Axboe commit 790cf9c84837b232eb413b8b6b5d57817176cb23 Author: Jan Kara Date: Thu Nov 25 14:36:34 2021 +0100 block: Provide blk_mq_sched_get_icq() Currently we lookup ICQ only after the request is allocated. However BFQ will want to decide how many scheduler tags it allows a given bfq queue (effectively a process) to consume based on cgroup weight. So provide a function blk_mq_sched_get_icq() so that BFQ can lookup ICQ earlier. Acked-by: Paolo Valente Signed-off-by: Jan Kara Link: https://lore.kernel.org/r/20211125133645.27483-1-jack@suse.cz Signed-off-by: Jens Axboe commit 639d353143fa3bfa81bbe7af263260d93d23d822 Author: Sebastian Andrzej Siewior Date: Mon Oct 25 09:06:58 2021 +0200 mmc: core: Use blk_mq_complete_request_direct(). The completion callback for the sdhci-pci device is invoked from a kworker. I couldn't identify in which context is mmc_blk_mq_req_done() invoke but the remaining caller are from invoked from preemptible context. Here it would make sense to complete the request directly instead scheduling ksoftirqd for its completion. Signed-off-by: Sebastian Andrzej Siewior Reviewed-by: Ulf Hansson Acked-by: Adrian Hunter Link: https://lore.kernel.org/r/20211025070658.1565848-3-bigeasy@linutronix.de Signed-off-by: Jens Axboe commit e8dc17e2893b4107366004810ca2a4acf1fc8563 Author: Sebastian Andrzej Siewior Date: Mon Oct 25 09:06:57 2021 +0200 blk-mq: Add blk_mq_complete_request_direct() Add blk_mq_complete_request_direct() which completes the block request directly instead deferring it to softirq for single queue devices. This is useful for devices which complete the requests in preemptible context and raising softirq from means scheduling ksoftirqd. Signed-off-by: Sebastian Andrzej Siewior Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211025070658.1565848-2-bigeasy@linutronix.de Signed-off-by: Jens Axboe commit 72cd9df2ef788d88c138d51223a01ca6281f232d Author: Eric Biggers Date: Tue Nov 23 17:37:33 2021 -0800 blk-crypto: remove blk_crypto_unregister() This function is trivial and is only used in one place. Having this function is misleading because it implies that blk_crypto_register() needs to be paired with blk_crypto_unregister(), which is not the case. Just set disk->queue->crypto_profile to NULL directly. Signed-off-by: Eric Biggers Reviewed-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211124013733.347612-1-ebiggers@kernel.org Signed-off-by: Jens Axboe commit 5b13bc8a3fd519d86e5b1a0b1d1b996cace62f3f Author: Christoph Hellwig Date: Wed Nov 24 07:28:56 2021 +0100 blk-mq: cleanup request allocation Refactor the request alloction so that blk_mq_get_cached_request tries to find a cached request first, and the entirely separate and now self contained blk_mq_get_new_requests allocates one or more requests if that is not possible. There is a small change in behavior as submit_bio_checks is called twice now if a cached request is present but can't be used, but that is a small price to pay for unwinding this code. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211124062856.1444266-1-hch@lst.de Signed-off-by: Jens Axboe commit 82d981d4230bc0a19540fc540d4bdf49a3769f05 Author: Christoph Hellwig Date: Tue Nov 23 19:53:12 2021 +0100 block: don't include in blk.h Not needed, shift it into the source files that need it instead. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211123185312.1432157-9-hch@lst.de Signed-off-by: Jens Axboe commit ca5b304cabef55c670a22bbe53a883fe5c3b2620 Author: Christoph Hellwig Date: Tue Nov 23 19:53:11 2021 +0100 block: don't include in blk.h Not needed. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211123185312.1432157-8-hch@lst.de Signed-off-by: Jens Axboe commit a2ff7781cfe6a2104c64deb8311532ccd4d4c57d Author: Christoph Hellwig Date: Tue Nov 23 19:53:10 2021 +0100 block: don't include in blk.h Not needed. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211123185312.1432157-7-hch@lst.de Signed-off-by: Jens Axboe commit e4a19f7289f3fa9b2a4e65d0f4b3a7816e8e445b Author: Christoph Hellwig Date: Tue Nov 23 19:53:09 2021 +0100 block: don't include blk-mq.h in blk.h No needed, shift a blk-stat.h include into the source file that needs it instead. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211123185312.1432157-6-hch@lst.de Signed-off-by: Jens Axboe commit 2aa7745bf6db55b7800c4433e102b07c649fd001 Author: Christoph Hellwig Date: Tue Nov 23 19:53:08 2021 +0100 block: don't include blk-mq-sched.h in blk.h No needed, shift it into the source files that need it instead. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211123185312.1432157-5-hch@lst.de Signed-off-by: Jens Axboe commit 0c6cb3a293fa9adc7be24d67ff7d201aefa50362 Author: Christoph Hellwig Date: Tue Nov 23 19:53:07 2021 +0100 block: remove the e argument to elevator_exit All callers pass q->elevator. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211123185312.1432157-4-hch@lst.de Signed-off-by: Jens Axboe commit f46b81c54b241bf1ec01c8936a37201c99f94fc7 Author: Christoph Hellwig Date: Tue Nov 23 19:53:06 2021 +0100 block: remove elevator_exit Open code elevator_exit in it's only caller, and rename __elevator_exit to elevator_exit. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211123185312.1432157-3-hch@lst.de Signed-off-by: Jens Axboe commit 0281ed3cf44d2a7061ec3c1680e1f86e55ad57b9 Author: Christoph Hellwig Date: Tue Nov 23 19:53:05 2021 +0100 block: move blk_get_flush_queue to blk-flush.c blk_get_flush_queue is only used in blk-flush.c, so move it there. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211123185312.1432157-2-hch@lst.de Signed-off-by: Jens Axboe commit 35c90e6ec9608d8225b82ce609489b531cfd0a40 Author: Guo Zhengkui Date: Tue Nov 23 14:33:40 2021 +0800 blk_mq: remove repeated includes Remove a repeated "#include". Signed-off-by: Guo Zhengkui Reviewed-by: Chaitanya Kulkarni Link: https://lore.kernel.org/r/20211123063340.25882-1-guozhengkui@vivo.com Signed-off-by: Jens Axboe commit 5a9d041ba2f6da468c891ca0fe263758e2c12091 Author: Jens Axboe Date: Sat Nov 13 11:18:32 2021 -0700 block: move io_context creation into where it's needed The only user of the io_context for IO is BFQ, yet we put the checking and logic of it into the normal IO path. Put the creation into blk_mq_sched_assign_ioc(), and have BFQ use that helper. Reviewed-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 48b5c1fbcd8c5bc6b91a56399a5257b801391dd8 Author: Jens Axboe Date: Sat Nov 13 14:03:26 2021 -0700 block: only allocate poll_stats if there's a user of them This is essentially never used, yet it's about 1/3rd of the total queue size. Allocate it when needed, and don't embed it in the queue. Kill the queue flag for this while at it, since we can just check the assigned pointer now. Reviewed-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 25c4b5e058578066db56d757ad3a7adeaff35856 Author: Jens Axboe Date: Sat Nov 13 13:37:38 2021 -0700 blk-ioprio: don't set bio priority if not needed We don't need to write to the bio if: 1) No ioprio value has ever been assigned to the blkcg 2) We wouldn't anyway, depending on bio and blkcg IO priority Reviewed-by: Christoph Hellwig Signed-off-by: Jens Axboe commit 1e9c23034d7b216b02f1491505779dfe9a1a6e23 Author: Christoph Hellwig Date: Tue Nov 23 17:04:42 2021 +0100 blk-mq: move more plug handling from blk_mq_submit_bio into blk_add_rq_to_plug Keep all the functionality for adding a request to a plug in a single place. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211123160443.1315598-3-hch@lst.de Signed-off-by: Jens Axboe commit 0c5bcc92d94a8f578ab2b06c1274e076cc8aecd3 Author: Christoph Hellwig Date: Tue Nov 23 17:04:41 2021 +0100 blk-mq: simplify the plug handling in blk_mq_submit_bio blk_mq_submit_bio has two different plug cases, one that uses full plugging and a limited plugging one. The limited plugging case is only used for a corner case that does not matter in real life: - no ->commit_rqs (so not NVMe) - no shared tags (so not SCSI) - not rotational (so no old disk or floppy driver) - must have multiple queues (so no eMMC) Remove the limited merging case and all the related junk to simplify blk_mq_submit_bio and the functions called from it. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211123160443.1315598-2-hch@lst.de Signed-off-by: Jens Axboe commit a4561f9fccc57a5fd56c53e21514f63825d8ace7 Author: Christoph Hellwig Date: Mon Nov 22 14:06:25 2021 +0100 sr: set GENHD_FL_REMOVABLE earlier Set up GENHD_FL_REMOVABLE together with the rest of the gendisk fields. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211122130625.1136848-15-hch@lst.de Signed-off-by: Jens Axboe commit 430cc5d3ab4d0ba0bd011cfbb0035e46ba92920c Author: Christoph Hellwig Date: Mon Nov 22 14:06:24 2021 +0100 block: cleanup the GENHD_FL_* definitions Switch to an enum and tidy up the documentation. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211122130625.1136848-14-hch@lst.de Signed-off-by: Jens Axboe commit 9f18db572c97bc327b63528d195fdb252f47e9de Author: Christoph Hellwig Date: Mon Nov 22 14:06:23 2021 +0100 block: don't set GENHD_FL_NO_PART for hidden gendisks Hidden gendisks can't be opened using blkdev_get_*, so we can't really reach any of the partition scanning paths or partitioning ioctls except for the initial partition scan from add_disk. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211122130625.1136848-13-hch@lst.de Signed-off-by: Jens Axboe commit 1ebe2e5f9d68e94c524aba876f27b945669a7879 Author: Christoph Hellwig Date: Mon Nov 22 14:06:22 2021 +0100 block: remove GENHD_FL_EXT_DEVT All modern drivers can support extra partitions using the extended dev_t. In fact except for the ioctl method drivers never even see partitions in normal operation. So remove the GENHD_FL_EXT_DEVT and allow extra partitions for all block devices that do support partitions, and require those that do not support partitions to explicit disallow them using GENHD_FL_NO_PART. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211122130625.1136848-12-hch@lst.de Signed-off-by: Jens Axboe commit 3b5149ac50970669ee0ddb9629ec77ffd5c0622d Author: Christoph Hellwig Date: Mon Nov 22 14:06:21 2021 +0100 block: remove GENHD_FL_SUPPRESS_PARTITION_INFO This flag is not set directly anywhere and only inherited from GENHD_FL_HIDDEN. Just check for GENHD_FL_HIDDEN instead. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211122130625.1136848-11-hch@lst.de Signed-off-by: Jens Axboe commit 79b0f79a835c6f1103c06e449cd88fb13e67f405 Author: Christoph Hellwig Date: Mon Nov 22 14:06:20 2021 +0100 mmc: don't set GENHD_FL_SUPPRESS_PARTITION_INFO This manually reverts 07b652cdbec3 ("mmc: card: Don't show eMMC RPMB and BOOT areas in /proc/partitions"). Based on the commit description that change was purely cosmetic. mmc is the last driver that sets this flag and thus prevents it from being removed. Signed-off-by: Christoph Hellwig Acked-by: Ulf Hansson Link: https://lore.kernel.org/r/20211122130625.1136848-10-hch@lst.de Signed-off-by: Jens Axboe commit 94b49c3ddb2127f84a133d70cef49054e1ebaaa4 Author: Christoph Hellwig Date: Mon Nov 22 14:06:19 2021 +0100 null_blk: don't suppress partitioning information This manually reverts commit 27290b469051 ("null_blk: suppress invalid partition info"). The message in that commit log can't appearch as the flag is never checked during probing, and there is no good reason to treat null_blk special in /proc/partitions. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211122130625.1136848-9-hch@lst.de Signed-off-by: Jens Axboe commit 140862805affca32b3c92a9a7643a7ee6d6ab278 Author: Christoph Hellwig Date: Mon Nov 29 06:38:04 2021 -0700 block: remove the GENHD_FL_HIDDEN check in blkdev_get_no_open Hidden gendisks never hash the block device inode, so this can't happen. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211122130625.1136848-8-hch@lst.de Signed-off-by: Jens Axboe commit 46e7eac647b34ed4106a8262f8bedbb90801fadd Author: Christoph Hellwig Date: Mon Nov 22 14:06:17 2021 +0100 block: rename GENHD_FL_NO_PART_SCAN to GENHD_FL_NO_PART The GENHD_FL_NO_PART_SCAN controls more than just partitions canning, so rename it to GENHD_FL_NO_PART. Signed-off-by: Christoph Hellwig Acked-by: Ulf Hansson Link: https://lore.kernel.org/r/20211122130625.1136848-7-hch@lst.de Signed-off-by: Jens Axboe commit e16e506ccd673a3a888a34f8f694698305840044 Author: Christoph Hellwig Date: Mon Nov 22 14:06:16 2021 +0100 block: merge disk_scan_partitions and blkdev_reread_part Unify the functionality that implements a partition rescan for a gendisk. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211122130625.1136848-6-hch@lst.de Signed-off-by: Jens Axboe commit e3b3bad3f29878d13fdbc96f9e59674bd9b06bae Author: Christoph Hellwig Date: Mon Nov 22 14:06:15 2021 +0100 block: remove a dead check in show_partition disk_max_parts never returns 0 given that ->minors for devices not using the extended dev_t must be non-zero, and disk_max_parts always returns DISK_MAX_PARTS for the latter. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211122130625.1136848-5-hch@lst.de Signed-off-by: Jens Axboe commit 1a827ce1b9f2c740d2c6a228afd972970c18bc21 Author: Christoph Hellwig Date: Mon Nov 22 14:06:14 2021 +0100 block: remove GENHD_FL_CD GENHD_FL_CD marks a gendisk as a vaguely CD-ROM like device. Besides being used internally inside of sunvdc.c an xen-blkfront it is used by xen-blkback as a hint to claim a device exported to a guest is a CD-ROM like device. Just check for disk->cdi instead which is the right indicator for "real" CD-ROM or DVD drivers. This will miss the paravirtualized guest drivers, but those make little sense to report anyway. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211122130625.1136848-4-hch@lst.de Signed-off-by: Jens Axboe commit 1545e0b419ba1d9b9bee4061d4826340afe6b0aa Author: Christoph Hellwig Date: Mon Nov 22 14:06:13 2021 +0100 block: move GENHD_FL_BLOCK_EVENTS_ON_EXCL_WRITE to disk->event_flags GENHD_FL_BLOCK_EVENTS_ON_EXCL_WRITE is all about the event reporting mechanism, so move it to the event_flags field. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211122130625.1136848-3-hch@lst.de Signed-off-by: Jens Axboe commit 86416916466514e4ae0b7296d20133b6427c4c1f Author: Christoph Hellwig Date: Mon Nov 22 14:06:12 2021 +0100 block: move GENHD_FL_NATIVE_CAPACITY to disk->state The flag to indicate an unlocked native capacity is dynamic state, not a driver capability flag, so move it to disk->state. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211122130625.1136848-2-hch@lst.de Signed-off-by: Jens Axboe commit d9337a420aed38cb4ffa465e5a546360410bc0cb Author: Christoph Hellwig Date: Wed Nov 17 07:14:04 2021 +0100 block: don't include blk-mq headers in blk-core.c All request based code is in the blk-mq files now. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Link: https://lore.kernel.org/r/20211117061404.331732-12-hch@lst.de Signed-off-by: Jens Axboe commit 0d7a29a2b5eae30eff1e216badca76978a3de39f Author: Christoph Hellwig Date: Wed Nov 17 07:14:03 2021 +0100 block: move blk_print_req_error to blk-mq.c This function is only used by the request completion path. Factor out a blk_status_to_str to keep blk_errors private in blk-core.c. Signed-off-by: Christoph Hellwig Reviewed-by: Chaitanya Kulkarni Reviewed-by: Johannes Thumshirn Link: https://lore.kernel.org/r/20211117061404.331732-11-hch@lst.de Signed-off-by: Jens Axboe commit 22350ad7f15931b65d288e3e1462a51bfbfa5c4b Author: Christoph Hellwig Date: Wed Nov 17 07:14:02 2021 +0100 block: move blk_dump_rq_flags to blk-mq.c blk_dump_rq_flags deals with a request, so move it to blk-mq.c. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Link: https://lore.kernel.org/r/20211117061404.331732-10-hch@lst.de Signed-off-by: Jens Axboe commit 450b7879e34517c3ebc3a35a53806fe40e60fac2 Author: Christoph Hellwig Date: Wed Nov 17 07:14:01 2021 +0100 block: move blk_account_io_{start,done} to blk-mq.c These are only used for request based I/O, so move them where they are used. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Link: https://lore.kernel.org/r/20211117061404.331732-9-hch@lst.de Signed-off-by: Jens Axboe commit f2b8f3ce989d8066f2dedaad223b3e73c4485223 Author: Christoph Hellwig Date: Wed Nov 17 07:14:00 2021 +0100 block: move blk_steal_bios to blk-mq.c Keep all the request based code together. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Link: https://lore.kernel.org/r/20211117061404.331732-8-hch@lst.de Signed-off-by: Jens Axboe commit 52fdbbcc83f35da90f857668acc387470ed84606 Author: Christoph Hellwig Date: Wed Nov 17 07:13:59 2021 +0100 block: move blk_rq_init to blk-mq.c blk_rq_init deals with a request structure, so move it to blk-mq.c Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Link: https://lore.kernel.org/r/20211117061404.331732-7-hch@lst.de Signed-off-by: Jens Axboe commit 06c8c691e2820077936e59ad334eb806e90b69eb Author: Christoph Hellwig Date: Wed Nov 17 07:13:58 2021 +0100 block: move request based cloning helpers to blk-mq.c Keep all the request based code together. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Link: https://lore.kernel.org/r/20211117061404.331732-6-hch@lst.de Signed-off-by: Jens Axboe commit b84c5b50d329bf7cfdba6bd5c8a99f1b8604e301 Author: Christoph Hellwig Date: Wed Nov 17 07:13:57 2021 +0100 blk-mq: move blk_mq_flush_plug_list Move blk_mq_flush_plug_list and blk_mq_plug_issue_direct down in blk-mq.c to prepare for marking blk_mq_request_issue_directly static without the need of a forward declaration. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Link: https://lore.kernel.org/r/20211117061404.331732-5-hch@lst.de Signed-off-by: Jens Axboe commit 4054cff92c357813b6861b622122b344990f7e31 Author: Christoph Hellwig Date: Wed Nov 17 07:13:56 2021 +0100 block: remove blk-exec.c All this code is tightly coupled to the blk-mq core, so move it there. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Link: https://lore.kernel.org/r/20211117061404.331732-4-hch@lst.de [axboe: remove doc generation for blk-exec.c] Signed-off-by: Jens Axboe commit 786d4e01c550e8bb7c9f9f23bca0596a2a33483c Author: Christoph Hellwig Date: Wed Nov 17 07:13:55 2021 +0100 block: remove rq_flush_dcache_pages This function is trivial, and flush_dcache_page is always defined, so just open code it in the 2.5 callers. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Link: https://lore.kernel.org/r/20211117061404.331732-3-hch@lst.de Signed-off-by: Jens Axboe commit 79478bf9ea9fa48d30836afa796ac13d8a0f320b Author: Christoph Hellwig Date: Wed Nov 17 07:13:54 2021 +0100 block: move blk_rq_err_bytes to scsi blk_rq_err_bytes is only used by the scsi midlayer, so move it there. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Link: https://lore.kernel.org/r/20211117061404.331732-2-hch@lst.de Signed-off-by: Jens Axboe commit 4e0e90539bb0e6c0ca3768c642df9eed2118a8bb Author: Christophe JAILLET Date: Sat Nov 6 18:44:52 2021 +0100 PCI: qcom: Fix an error handling path in 'qcom_pcie_probe()' If 'of_device_get_match_data()' fails, previous 'pm_runtime_get_sync()/ pm_runtime_enable()' should be undone. To fix it, the easiest is to move this block of code before the memory allocations and the pm_runtime_xxx calls. Link: https://lore.kernel.org/r/4d03c636193f64907c8dacb17fa71ed05fd5f60c.1636220582.git.christophe.jaillet@wanadoo.fr Fixes: b89ff410253d ("PCI: qcom: Replace ops with struct pcie_cfg in pcie match data") Signed-off-by: Christophe JAILLET Signed-off-by: Lorenzo Pieralisi Reviewed-by: Stephen Boyd commit fe07b0f1e86047162c6e85535a82278045d8492c Author: Sam Protsenko Date: Sat Nov 27 01:06:20 2021 +0200 dt-bindings: mfd: syscon: Add samsung,exynos850-sysreg Document Samsung Exynos850 compatible for system registers. Signed-off-by: Sam Protsenko Reviewed-by: Krzysztof Kozlowski Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20211126230620.478-1-semen.protsenko@linaro.org commit 5c6f0f456351f5ca7d3b1a82060821eac4a7dc5c Author: Andrej Picej Date: Wed Nov 24 07:51:19 2021 +0100 mfd: da9062: Support SMBus and I2C mode Enable the I2C bus mode if I2C_FUNC_I2C is set. Based on da6093 commit: "586478bfc9f7 mfd: da9063: Support SMBus and I2C mode" Signed-off-by: Andrej Picej Reviewed-by: Adam Thomson Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20211124065119.2514872-1-andrej.picej@norik.com commit 9651cf2cb14726c785240e9dc01b274a68e9959e Author: Orlando Chamberlain Date: Wed Nov 24 09:19:44 2021 +0000 mfd: intel-lpss-pci: Fix clock speed for 38a8 UART This device is found in the MacBookPro16,2, and as the MacBookPro16,1 is from the same generation of MacBooks and has a UART with bxt_uart_info, it was incorrectly assumed that the MacBookPro16,2's UART would have the same info. This led to the wrong clock speed being used, and the Bluetooth controller exposed by the UART receiving and sending random data, which was incorrectly assumed to be an issue with the Bluetooth stuff, not an error with the UART side of things. Changing the info to spt_uart_info changes the clock speed and makes it send and receive data correctly. Fixes: ddb1ada416fd ("mfd: intel-lpss: Add support for MacBookPro16,2 ICL-N UART") Signed-off-by: Orlando Chamberlain Reviewed-by: Andy Shevchenko Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20211124091846.11114-1-redecorating@protonmail.com commit c9e143084d1a602f829115612e1ec79df3727c8b Author: Andy Shevchenko Date: Mon Nov 1 21:00:08 2021 +0200 mfd: intel-lpss: Fix too early PM enablement in the ACPI ->probe() The runtime PM callback may be called as soon as the runtime PM facility is enabled and activated. It means that ->suspend() may be called before we finish probing the device in the ACPI case. Hence, NULL pointer dereference: intel-lpss INT34BA:00: IRQ index 0 not found BUG: kernel NULL pointer dereference, address: 0000000000000030 ... Workqueue: pm pm_runtime_work RIP: 0010:intel_lpss_suspend+0xb/0x40 [intel_lpss] To fix this, first try to register the device and only after that enable runtime PM facility. Fixes: 4b45efe85263 ("mfd: Add support for Intel Sunrisepoint LPSS devices") Reported-by: Orlando Chamberlain Reported-by: Aditya Garg Signed-off-by: Andy Shevchenko Tested-by: Aditya Garg Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20211101190008.86473-1-andriy.shevchenko@linux.intel.com commit 17247821ae9b40ea6df8d771cfca97d91675be93 Author: Dario Binacchi Date: Thu Nov 25 23:46:42 2021 +0100 mfd: ti_am335x_tscadc: Drop the CNTRLREG_TSC_8WIRE macro In TI's reference manual description for the `AFE_Pen_Ctrl' bit-field of the TSC's CTRL register, there is no mention of 8-wire touchscreens. Even commit f0933a60d190 ("mfd: ti_am335x_tscadc: Update logic in CTRL register for 5-wire TS") says that the value of this bit-field must be the same for 4-wire and 8-wire touchscreens. So let's remove the CNTRLREG_TSC_8WIRE macro to avoid misunderstandings. Signed-off-by: Dario Binacchi Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20211125224642.21011-5-dariobin@libero.it commit 786c6f140bb67ba315962b4742326e93e8b3207c Author: Oleksandr Suvorov Date: Wed Oct 27 10:21:55 2021 +0200 mfd: stmpe: Support disabling sub-functions Add support of sub-functions disabling. It allows one to define an stmpe sub-function device in devicetree, but keep it disabled. Signed-off-by: Oleksandr Suvorov Signed-off-by: Francesco Dolcini Reviewed-by: Linus Walleij Reviewed-by: Marcel Ziswiler Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20211027082155.206449-1-francesco.dolcini@toradex.com commit 5d051cf94fd5834a1513aa77e542c49fd973988a Author: Claudiu Beznea Date: Thu Oct 28 16:51:38 2021 +0300 mfd: atmel-flexcom: Use .resume_noirq Flexcom IP embeds 3 other IPs: usart, i2c, spi and selects the operation mode (usart, i2c, spi) via mode register (FLEX_MR). On i2c bus there might be connected critical devices (like PMIC) which on suspend/resume should be suspended/resumed at the end/beginning. i2c uses .suspend_noirq/.resume_noirq for this kind of purposes. Align flexcom to use .resume_noirq as it should be resumed before the embedded IPs. Otherwise the embedded devices might behave badly. Fixes: 7fdec11015c3 ("atmel_flexcom: Support resuming after a chip reset") Signed-off-by: Claudiu Beznea Tested-by: Codrin Ciubotariu Acked-by: Nicolas Ferre Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20211028135138.3481166-3-claudiu.beznea@microchip.com commit 8c0fad75dcaa650e3f3145a2c35847bc6a65cb7f Author: Claudiu Beznea Date: Thu Oct 28 16:51:37 2021 +0300 mfd: atmel-flexcom: Remove #ifdef CONFIG_PM_SLEEP Remove compilation flag and use __maybe_unused and pm_ptr instead. Signed-off-by: Claudiu Beznea Acked-by: Nicolas Ferre Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20211028135138.3481166-2-claudiu.beznea@microchip.com commit 983b62975e903a9a92ea3a3daef43e2a32cc8479 Author: Geert Uytterhoeven Date: Wed Oct 27 14:34:32 2021 +0200 dt-bindings: mfd: bd9571mwv: Convert to json-schema Convert the ROHM BD9571MWV/BD9574MWF Power Management Integrated Circuit (PMIC) Device Tree binding documentation to json-schema. Make the "regulators" subnode optional, as not all users describe the regulators. Signed-off-by: Geert Uytterhoeven Reviewed-by: Rob Herring Acked-by: Matti Vaittinen Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/76fdd209e6a2dada7ff50b8ad03eb14e7f3547a6.1635338031.git.geert+renesas@glider.be commit 8b2051a1defe26bd3c83595521e000405fda0835 Author: Ed Schaller Date: Tue Nov 23 12:01:14 2021 -0600 mfd: intel-lpss: Add Intel Lakefield PCH PCI IDs Add new IDs of the Intel Lakefield chip to the list of supported devices. Signed-off-by: Ed Schaller Reviewed-by: Andy Shevchenko Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20211123180114.GA4747@darkmist.net commit 013db96da8b21c28b042f6fae904bbc0378a4349 Author: Krzysztof Kozlowski Date: Thu Nov 25 08:48:26 2021 +0100 dt-bindings: mfd: maxim,max77686: Convert to dtschema Convert the MFD part of Maxim MAX77686 PMIC to DT schema format. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20211125074826.7947-3-krzysztof.kozlowski@canonical.com commit f8689195d7dd0821457dcf158c063e3160a55ee1 Author: Krzysztof Kozlowski Date: Thu Nov 25 08:48:25 2021 +0100 regulator: dt-bindings: maxim,max77686: Convert to dtschema Convert the regulators of Maxim MAX77686 PMIC to DT schema format. Signed-off-by: Krzysztof Kozlowski Acked-by: Mark Brown Reviewed-by: Rob Herring Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20211125074826.7947-2-krzysztof.kozlowski@canonical.com commit 1149ccc5e89145a344cfdd8832d83bcc919dc1ed Author: Fabrice Gasnier Date: Fri Nov 26 12:33:40 2021 +0100 ARM: dts: stm32: fix stusb1600 pinctrl used on stm32mp157c-dk A pinctrl handle is used to setup a pull-up on the stusb1600 IRQ pin (that is open drain). When in ANALOG state, no pull-up can be applied in the GPIO HW controller, still the setting is done into the register. The pull-up is effective currently, only when the GPIO IRQ is requested. The correct setting is to use directly the GPIO, instead of ANALOG state. Signed-off-by: Fabrice Gasnier Signed-off-by: Alexandre Torgue commit aeeecb889165617a841e939117f9a8095d0e7d80 Author: Menglong Dong Date: Sun Nov 28 14:01:02 2021 +0800 net: snmp: add statistics for tcp small queue check Once tcp small queue check failed in tcp_small_queue_check(), the throughput of tcp will be limited, and it's hard to distinguish whether it is out of tcp congestion control. Add statistics of LINUX_MIB_TCPSMALLQUEUEFAILURE for this scene. Signed-off-by: Menglong Dong Signed-off-by: David S. Miller commit e9538f8270db24d272659e15841854c7ea11119e Author: Leon Romanovsky Date: Sun Nov 28 14:14:46 2021 +0200 devlink: Remove misleading internal_flags from health reporter dump DEVLINK_CMD_HEALTH_REPORTER_DUMP_GET command doesn't have .doit callback and has no use in internal_flags at all. Remove this misleading assignment. Fixes: e44ef4e4516c ("devlink: Hang reporter's dump method on a dumpit cb") Signed-off-by: Leon Romanovsky Signed-off-by: David S. Miller commit a4920d5d98f57b15e08eb2cc28bf225e6151fcb4 Merge: 77a3124683601 b99658452355d Author: David S. Miller Date: Mon Nov 29 13:02:01 2021 +0000 Merge branch 'seville-shared-mdio' Colin Foster says: ==================== update seville to use shared MDIO driver This patch set exposes and utilizes the shared MDIO bus in drivers/net/mdio/msio-mscc-miim.c v3: * Fix errors using uninitilized "dev" inside the probe function. * Remove phy_regmap from the setup function, since it currently isn't used * Remove GCB_PHY_PHY_CFG definition from ocelot.h - it isn't used yet... v2: * Error handling (thanks Andrew Lunn) * Fix logic errors calling mscc_miim_setup during patch 1/3 (thanks Jakub Kicinski) * Remove unnecessary felix_mdio file (thanks Vladimir Oltean) * Pass NULL to mscc_miim_setup instead of GCB_PHY_PHY_CFG, since the phy reset isn't handled at that point of the Seville driver (patch 3/3) ==================== Signed-off-by: David S. Miller commit b99658452355d316debee11079e8f1c6c1029355 Author: Colin Foster Date: Sun Nov 28 17:57:37 2021 -0800 net: dsa: ocelot: felix: utilize shared mscc-miim driver for indirect MDIO access Switch to a shared MDIO access implementation by way of the mdio-mscc-miim driver. Signed-off-by: Colin Foster Tested-by: Vladimir Oltean Signed-off-by: David S. Miller commit 5186c4a05b9713138b762a49467a8ab9753cdb36 Author: Colin Foster Date: Sun Nov 28 17:57:36 2021 -0800 net: dsa: ocelot: seville: utilize of_mdiobus_register Switch seville to use of_mdiobus_register(bus, NULL) instead of just mdiobus_register. This code is about to be pulled into a separate module that can optionally define ports by the device_node. Signed-off-by: Colin Foster Reviewed-by: Florian Fainelli Reviewed-by: Vladimir Oltean Tested-by: Vladimir Oltean Signed-off-by: David S. Miller commit a27a762828375a2b076de7ded5ce5830dec9f4c9 Author: Colin Foster Date: Sun Nov 28 17:57:35 2021 -0800 net: mdio: mscc-miim: convert to a regmap implementation Utilize regmap instead of __iomem to perform indirect mdio access. This will allow for custom regmaps to be used by way of the mscc_miim_setup function. Signed-off-by: Colin Foster Tested-by: Vladimir Oltean Signed-off-by: David S. Miller commit 77a31246836019c8de7d1a82636ca0020c4e96c6 Merge: 35aefaad326bb 813f38bf3b892 Author: David S. Miller Date: Mon Nov 29 12:58:39 2021 +0000 Merge branch 'lan966x-driver' Horatiu Vultur says: ==================== net: lan966x: Add lan966x switch driver This patch series add support for Microchip lan966x driver The lan966x switch is a multi-port Gigabit AVB/TSN Ethernet Switch with two integrated 10/100/1000Base-T PHYs. In addition to the integrated PHYs, it supports up to 2RGMII/RMII, up to 3BASE-X/SERDES/2.5GBASE-X and up to 2 Quad-SGMII/Quad-USGMII interfaces. Initially it adds support only for the ports to behave as simple NIC cards. In the future patches it would be extended with other functionality like Switchdev, PTP, Frame DMA, VCAP, etc. v4->v5: - more fixes to the reset of the switch, require all resources before activating the hardware - fix to lan966x-switch binding - implement get/set_pauseparam in ethtool_ops - stop calling lan966x_port_link_down when calling lan966x_port_pcs_set and call it in lan966x_phylink_mac_link_down v3->v4: - add timeouts when injecting/extracting frames, in case the HW breaks - simplify the creation of the IFH - fix the order of operations in lan966x_cleanup_ports - fixes to phylink based on Russel review v2->v3: - fix compiling issues for x86 - fix resource management in first patch v1->v2: - add new patch for MAINTAINERS - add functions lan966x_mac_cpu_learn/forget - fix build issues with second patch - fix the reset of the switch, return error if there is no reset controller - start to use phylink_mii_c22_pcs_decode_state and phylink_mii_c22_pcs_encode_advertisement to remove duplicate code ==================== Signed-off-by: David S. Miller commit 813f38bf3b892bf4b7ea52450cd7cc088686910b Author: Horatiu Vultur Date: Mon Nov 29 13:43:59 2021 +0100 net: lan966x: Update MAINTAINERS to include lan966x driver Update MAINTAINERS to include lan966x driver Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 12c2d0a5b8e2a1afc8c7738e19a0d1dd7f3d4007 Author: Horatiu Vultur Date: Mon Nov 29 13:43:58 2021 +0100 net: lan966x: add ethtool configuration and statistics This patch adds support for statistics counters for the network interfaces. Also adds support for configuring the network interface via ethtool like: speed, duplex etc. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit e18aba8941b40baa7d0b3120e438df2e3187dfd6 Author: Horatiu Vultur Date: Mon Nov 29 13:43:57 2021 +0100 net: lan966x: add mactable support This patch adds support for MAC table operations like add and forget. Also add the functionality to read the MAC address from DT, if there is no MAC set in DT it would use a random one. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit d28d6d2e37d10d607f931d25c835a0bd94d370e3 Author: Horatiu Vultur Date: Mon Nov 29 13:43:56 2021 +0100 net: lan966x: add port module support This patch adds support for netdev and phylink in the switch. The injection + extraction is register based. This will be replaced with DMA accees. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit db8bcaad539314df5d58f2c57465e965440d1aa6 Author: Horatiu Vultur Date: Mon Nov 29 13:43:55 2021 +0100 net: lan966x: add the basic lan966x driver This patch adds basic SwitchDev driver framework for lan966x. It includes only the IO range mapping and probing of the switch. Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 642fcf53a9ac145c451483036ab73b6dfce7f8d7 Author: Horatiu Vultur Date: Mon Nov 29 13:43:54 2021 +0100 dt-bindings: net: lan966x: Add lan966x-switch bindings Document the lan966x switch device driver bindings Signed-off-by: Horatiu Vultur Signed-off-by: David S. Miller commit 35aefaad326bb267ef254e64ef65a374bd99c98f Author: Linus Walleij Date: Mon Nov 22 23:35:30 2021 +0100 net: ixp4xx_hss: Convert to use DT probing IXP4xx is being migrated to device tree only. Convert this driver to use device tree probing. Pull in all the boardfile code from the one boardfile and make it local, pull all the boardfile parameters from the device tree instead of the board file. Signed-off-by: Linus Walleij Signed-off-by: David S. Miller commit 9c37b09d3a9a00569358b8932133d3f4e64f5bc0 Author: Linus Walleij Date: Mon Nov 22 23:35:29 2021 +0100 dt-bindings: net: Add bindings for IXP4xx V.35 WAN HSS This adds device tree bindings for the IXP4xx V.35 WAN high speed serial (HSS) link. An example is added to the NPE example where the HSS appears as a child. Cc: devicetree@vger.kernel.org Signed-off-by: Linus Walleij Reviewed-by: Rob Herring Signed-off-by: David S. Miller commit ef136837aaf6f37f2dec78551671a6883f868d69 Author: Alvin Šipraga Date: Mon Nov 29 11:30:19 2021 +0100 net: dsa: rtl8365mb: set RGMII RX delay in steps of 0.3 ns A contact at Realtek has clarified what exactly the units of RGMII RX delay are. The answer is that the unit of RX delay is "about 0.3 ns". Take this into account when parsing rx-internal-delay-ps by approximating the closest step value. Delays of more than 2.1 ns are rejected. This obviously contradicts the previous assumption in the driver that a step value of 4 was "about 2 ns", but Realtek also points out that it is easy to find more than one RX delay step value which makes RGMII work. Fixes: 4af2950c50c8 ("net: dsa: realtek-smi: add rtl8365mb subdriver for RTL8365MB-VC") Cc: Arınç ÜNAL Signed-off-by: Alvin Šipraga Acked-by: Arınç ÜNAL Signed-off-by: David S. Miller commit 1ecab9370eef94a334c790fd7ae584b88de56545 Author: Alvin Šipraga Date: Mon Nov 29 11:30:18 2021 +0100 net: dsa: rtl8365mb: fix garbled comment Fixes: 4af2950c50c8 ("net: dsa: realtek-smi: add rtl8365mb subdriver for RTL8365MB-VC") Signed-off-by: Alvin Šipraga Signed-off-by: David S. Miller commit b014861d96a69f7fd101406f3ebd61e2a76f5dbe Author: Alvin Šipraga Date: Mon Nov 29 11:30:17 2021 +0100 net: dsa: realtek-smi: don't log an error on EPROBE_DEFER Probe deferral is not an error, so don't log this as an error: [0.590156] realtek-smi ethernet-switch: unable to register switch ret = -517 Signed-off-by: Alvin Šipraga Signed-off-by: David S. Miller commit 754d71be52926563ddd5cef2a3837a5742a08c37 Author: Ivan Vecera Date: Mon Nov 29 10:58:50 2021 +0100 selftests: net: bridge: fix typo in vlan_filtering dependency test Prior patch: ]# TESTS=vlmc_filtering_test ./bridge_vlan_mcast.sh TEST: Vlan multicast snooping enable [ OK ] Device "bridge" does not exist. TEST: Disable multicast vlan snooping when vlan filtering is disabled [FAIL] Vlan filtering is disabled but multicast vlan snooping is still enabled After patch: # TESTS=vlmc_filtering_test ./bridge_vlan_mcast.sh TEST: Vlan multicast snooping enable [ OK ] TEST: Disable multicast vlan snooping when vlan filtering is disabled [ OK ] Fixes: f5a9dd58f48b7c ("selftests: net: bridge: add test for vlan_filtering dependency") Cc: Nikolay Aleksandrov Signed-off-by: Ivan Vecera Acked-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit fe42e885c7a9e594cd9e5290407e752aa0afbd7e Merge: 688e075748645 f05b0b97335be Author: David S. Miller Date: Mon Nov 29 12:46:52 2021 +0000 Merge branch 'mpls-cleanups' Benjamin Poirier says: ==================== net: mpls: Cleanup nexthop iterator macros The mpls macros for_nexthops and change_nexthops were probably copied from decnet or ipv4 but they grew a superfluous variable and lost a beneficial "const". ==================== Signed-off-by: David S. Miller commit f05b0b97335be1b4f9f1f1044eb617f4e12c681e Author: Benjamin Poirier Date: Mon Nov 29 15:23:16 2021 +0900 net: mpls: Make for_nexthops iterator const There are separate for_nexthops and change_nexthops iterators. The for_nexthops variant should use const. Signed-off-by: Benjamin Poirier Signed-off-by: David S. Miller commit 69d9c0d07726b6d49cf8b2609226b7b88a0f3d51 Author: Benjamin Poirier Date: Mon Nov 29 15:23:15 2021 +0900 net: mpls: Remove duplicate variable from iterator macro __nh is just a copy of nh with a different type. Signed-off-by: Benjamin Poirier Signed-off-by: David S. Miller commit 688e075748645b43cf4d55e8fd279f5249699b7a Merge: fc1e5a3613a8e 21a0ffd9b38c6 Author: David S. Miller Date: Mon Nov 29 12:27:34 2021 +0000 Merge branch 'qualcomm-bam-dmux' Stephan Gerhold says: ==================== net: wwan: Add Qualcomm BAM-DMUX WWAN network driver The BAM Data Multiplexer provides access to the network data channels of modems integrated into many older Qualcomm SoCs, e.g. Qualcomm MSM8916 or MSM8974. This series adds a driver that allows using it. All the changes in this patch series are based on a quite complicated driver from Qualcomm [1]. The driver has been used in postmarketOS [2] on various smartphones/tablets based on Qualcomm MSM8916 and MSM8974 for more than a year now with no reported problems. It works out of the box with open-source WWAN userspace such as ModemManager. [1]: https://source.codeaurora.org/quic/la/kernel/msm-3.10/tree/drivers/soc/qcom/bam_dmux.c?h=LA.BR.1.2.9.1-02310-8x16.0 [2]: https://postmarketos.org/ Changes in v3: - Clarify DT schema based on discussion - Drop bam_dma/dmaengine patches since they already landed in 5.16 - Rebase on net-next - Simplify cover letter and commit messages Changes in v2: - Rename "qcom,remote-power-collapse" -> "qcom,powered-remotely" - Rebase on net-next and fix conflicts - Rename network interfaces from "rmnet%d" -> "wwan%d" - Fix wrong file name in MAINTAINERS entry ==================== Signed-off-by: David S. Miller commit 21a0ffd9b38c61d79b5ade54893b0f59f2e8c2c3 Author: Stephan Gerhold Date: Sat Nov 27 18:31:08 2021 +0100 net: wwan: Add Qualcomm BAM-DMUX WWAN network driver The BAM Data Multiplexer provides access to the network data channels of modems integrated into many older Qualcomm SoCs, e.g. Qualcomm MSM8916 or MSM8974. It is built using a simple protocol layer on top of a DMA engine (Qualcomm BAM) and bidirectional interrupts to coordinate power control. The modem announces a fixed set of channels by sending an OPEN command. The driver exports each channel as separate network interface so that a connection can be established via QMI from userspace. The network interface can work either in Ethernet or Raw-IP mode (configurable via QMI). However, Ethernet mode seems to be broken with most firmwares (network packets are actually received as Raw-IP), therefore the driver only supports Raw-IP mode. Note that the control channel (QMI/AT) is entirely separate from BAM-DMUX and is already supported by the RPMSG_WWAN_CTRL driver. The driver uses runtime PM to coordinate power control with the modem. TX/RX buffers are put in a kind of "ring queue" and submitted via the bam_dma driver of the DMAEngine subsystem. The basic architecture looks roughly like this: +------------+ +-------+ [IPv4/6] | BAM-DMUX | | | [Data...] | | | | ---------->|wwan0 | [DMUX chan: x] | | [IPv4/6] | (chan: 0) | [IPv4/6] | | [Data...] | | [Data...] | | ---------->|wwan1 |--------------->| Modem | | (chan: 1) | BAM | | [IPv4/6] | ... | (DMA Engine) | | [Data...] | | | | ---------->|wwan7 | | | | (chan: 7) | | | +------------+ +-------+ Note that some newer firmware versions support QMAP ("rmnet" driver) as additional multiplexing layer on top of BAM-DMUX, but this is not currently supported by this driver. Signed-off-by: Stephan Gerhold Signed-off-by: David S. Miller commit f3aee7c900ed15615e9fc7abf3ff92266820b599 Author: Stephan Gerhold Date: Sat Nov 27 18:31:07 2021 +0100 dt-bindings: net: Add schema for Qualcomm BAM-DMUX The BAM Data Multiplexer provides access to the network data channels of modems integrated into many older Qualcomm SoCs, e.g. Qualcomm MSM8916 or MSM8974. It is built using a simple protocol layer on top of a DMA engine (Qualcomm BAM) and bidirectional interrupts to coordinate power control. The device tree node combines the incoming interrupt with the outgoing interrupts (smem-states) as well as the two DMA channels, which allows the BAM-DMUX driver to request all necessary resources. Signed-off-by: Stephan Gerhold Signed-off-by: David S. Miller commit bd0d78ada27770bbddfd24e74f4136507f64736c Author: Mauro Carvalho Chehab Date: Wed Nov 24 20:06:42 2021 +0100 media: mxl5005s: drop some dead code As reported by clang (with W=1), the ctrlVal var is never used. Yet, there are even some loops to estimate it. As this is dead code, remove it. If ever needed, someone could revert this patch. Reviewed-by: Nathan Chancellor Signed-off-by: Mauro Carvalho Chehab commit 675599009abc973b21a5a459799f34123562f517 Author: Mauro Carvalho Chehab Date: Wed Nov 24 12:07:01 2021 +0000 media: cobalt: drop an unused variable The clock_control value is read but never actually used. Based on a comment at the code, it has to be reset at the function. So, drop the variable that stores its value. Reviewed-by: Nathan Chancellor Signed-off-by: Mauro Carvalho Chehab commit 440aae04f38bf5f5fe620783fd9effa57a0a9ae4 Author: Mauro Carvalho Chehab Date: Wed Nov 24 11:56:50 2021 +0000 media: mtk-mdp: address a clang warning The typecasts at the dvb-core generate clang warnings when W=1 is enabled. Such warning is harmless, but it causes the build to break with CONFIG_WERROR and W=1 with clang, so do the cast on a way that it won't produce warnings anymore. Reviewed-by: Arnd Bergmann Signed-off-by: Mauro Carvalho Chehab commit 7225436dd8cb481b560e2a52088d0f829887a8cf Author: Robert Foss Date: Mon Oct 11 14:13:01 2021 +0200 media: camss: Remove unused static function vfe_reg_clr() is not used in camss-vfe-170.c, and can be removed. Signed-off-by: Robert Foss Signed-off-by: Mauro Carvalho Chehab commit 820ef3aa40482703030761bf58266d3d8b1544cc Author: Mauro Carvalho Chehab Date: Wed Nov 24 11:54:15 2021 +0000 media: davinci: vpbe_osd: mark read reg function as __always_unused Such function is currently unused, but could be needed in the future. So, keep it, marking it as __always_unused, in order to avoid a clang W=1 error. Reviewed-by: Lad Prabhakar Signed-off-by: Mauro Carvalho Chehab commit 1804eba4eb613c6125260c320d98d21035fcae70 Author: Mauro Carvalho Chehab Date: Wed Nov 24 11:48:45 2021 +0000 media: imx290: mark read reg function as __always_unused Such function is currently unused, but could be needed in the future. So, keep it, marking it as __always_unused, in order to avoid a clang W=1 error. Signed-off-by: Mauro Carvalho Chehab commit 6c0adaf907775578868812197a06785de8b262e3 Author: Mauro Carvalho Chehab Date: Wed Nov 24 11:45:26 2021 +0000 media: adv7511: drop unused functions Those are aliases for another function and not used at the current implementation. So, just drop it. Reviewed-by: Nathan Chancellor Signed-off-by: Mauro Carvalho Chehab commit 12f3d83673c4800aebdd96efb366a04d2d636596 Author: Mauro Carvalho Chehab Date: Wed Nov 24 11:42:49 2021 +0000 media: adv7604: mark unused functions as such There are several unused helper macros there, meant to parse some fields. As those actually help to document the hardware, the better is to keep them. However, it generates clang warnings with W=1, causing build to break with CONFIG_WERROR. So, add __always_unused to fix such warnings. Signed-off-by: Mauro Carvalho Chehab commit 091b15db22e40e7865ba32b1392e3a7a1ee9e852 Author: Mauro Carvalho Chehab Date: Wed Nov 24 11:37:36 2021 +0000 media: au0828-i2c: drop a duplicated function This function is not used, so, just drop it. Reviewed-by: Nathan Chancellor Signed-off-by: Mauro Carvalho Chehab commit 77e956027c1912082d3749350d0066be99921d12 Author: Mauro Carvalho Chehab Date: Mon Nov 22 12:01:48 2021 +0000 media: lmedm04: don't ignore errors when setting a filter Solves a clang warning. Reviewed-by: Nathan Chancellor Signed-off-by: Mauro Carvalho Chehab commit 3fb246476f8c0556747301ba7497f135068225a8 Author: Mauro Carvalho Chehab Date: Wed Nov 24 11:27:22 2021 +0000 media: radio-si476x: drop a container_of() abstraction macro This isn't used anywhere. So, drop it. Reviewed-by: Nathan Chancellor Signed-off-by: Mauro Carvalho Chehab commit d5aa19c9fd775a11a56db2380e3b451d42c50e8e Author: Mauro Carvalho Chehab Date: Mon Nov 29 12:38:06 2021 +0100 media: si470x: consolidate multiple printk's When the version warning is given, multiple dev_warn() are called. Consolidate the ones that could be merged altogether. Suggested-by: Joe Perches Signed-off-by: Mauro Carvalho Chehab commit 12c762e087a064ff40854ff7da86dd9f49084cc1 Author: Mauro Carvalho Chehab Date: Wed Nov 24 11:24:38 2021 +0000 media: si470x: fix printk warnings with clang Clang doesn't like "%hu" on macros: drivers/media/radio/si470x/radio-si470x-i2c.c:414:4: error: format specifies type 'unsigned short' but the argument has type 'int' [-Werror,-Wformat] drivers/media/radio/si470x/radio-si470x-i2c.c:417:4: error: format specifies type 'unsigned short' but the argument has type 'int' [-Werror,-Wformat] Besides that, changeset cbacb5ab0aa0 ("docs: printk-formats: Stop encouraging use of unnecessary %h[xudi] and %hh[xudi]") dropped recomendation of using %h. So, just replace them with "%u". Reviewed-by: Nathan Chancellor Signed-off-by: Mauro Carvalho Chehab commit 02d6276f10082a6b1277fbd8a9909929cabf759e Author: Mauro Carvalho Chehab Date: Wed Nov 24 11:21:47 2021 +0000 media: solo6x10: mark unused functions as such There are several unused helper macros there, meant to parse some fields. As those actually help to document the hardware, the better is to keep them. However, it generates clang warnings with W=1, causing build to break with CONFIG_WERROR. So, add __always_unused to fix such warnings. Acked-by: Ismael Luceno Signed-off-by: Mauro Carvalho Chehab commit 68cfde02cc21045708ad1ebe604527ec18d5e01c Author: Mauro Carvalho Chehab Date: Mon Nov 22 12:30:55 2021 +0000 media: si21xx: report eventual errors at set_frontend If an error occurs while setting the registers at set_frontend, it is silently ignored. Yet, the variable status is updated. Change the logic to return an error if it fails to write values to the registers. Signed-off-by: Mauro Carvalho Chehab commit c41898e84dade305c13d2073c785009d6414631d Author: Mauro Carvalho Chehab Date: Mon Nov 22 12:29:13 2021 +0000 media: m88ds3103: drop reg11 calculus from m88ds3103b_select_mclk() This value is never used at the code. So, drop it. Solves a W=1 clang warning. Reviewed-by: Nathan Chancellor Signed-off-by: Mauro Carvalho Chehab commit 1cef39421974c5b76dc72a12b2bc94ec1cd811a3 Author: Mauro Carvalho Chehab Date: Mon Nov 22 12:27:48 2021 +0000 media: drxk: drop operation_mode from set_dvbt() This var is set, but never used. So, drop it. Signed-off-by: Mauro Carvalho Chehab commit 5fadfc31a7cc55f8e0e1e4d4b67c365f11623dca Author: Mauro Carvalho Chehab Date: Mon Nov 22 12:26:19 2021 +0000 media: drxd: drop offset var from DownloadMicrocode() The offset is not needed, and it is never used, as the pointer itself is already incremented. So, drop it, in order to solve a W=1 clang warning. Reviewed-by: Nathan Chancellor Signed-off-by: Mauro Carvalho Chehab commit 53dd3f0a7fed09d716cdf856dca049a22c891a2a Author: Mauro Carvalho Chehab Date: Mon Nov 22 12:14:23 2021 +0000 media: davinci: get rid of an unused function vpif_get_default_field() seems to be some left-over from a past code that sets the field order. Reviewed-by: Nathan Chancellor Reviewed-by: Lad Prabhakar Signed-off-by: Mauro Carvalho Chehab commit 8393961c53b31078cfc877bc00eb0f67e1474edd Author: Andy Shevchenko Date: Tue Nov 23 21:27:23 2021 +0200 spi: pxa2xx: Get rid of unused enable_loopback member There is no user of the enable_loopback member in the struct pxa2xx_spi_chip. Remote this legacy member completely. The mentioned in the documentation the testing phase can be performed with spidev_test tool. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211123192723.44537-3-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit a9c8f68ce2c37ced2f7a8667eda71b7753ede398 Author: Andy Shevchenko Date: Tue Nov 23 21:27:22 2021 +0200 spi: pxa2xx: Get rid of unused ->cs_control() Since the last user of the custom ->cs_control() gone, we may get rid of this legacy API completely. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211123192723.44537-2-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit 342e3ce0f6f4691b31b1c7c9c3ae37160c4a82d2 Author: Andy Shevchenko Date: Tue Nov 23 21:27:21 2021 +0200 ARM: pxa/lubbock: Replace custom ->cs_control() by GPIO lookup table SPI PXA2xx driver supports GPIO chipselect by querying for known GPIO connection ID. Replace custom ->cs_control() by GPIO table, so the driver will use generic approach on this platform. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211123192723.44537-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit 59eadd2af3f717f2ff70dbb6c153757dc1650651 Author: Satya Priya Date: Tue Nov 23 17:19:26 2021 +0530 regulator: qcom-rpmh: Add PMG1110 regulators Add support for PMG1110 regulators. Signed-off-by: Satya Priya Link: https://lore.kernel.org/r/1637668167-31325-3-git-send-email-quic_c_skakit@quicinc.com Signed-off-by: Mark Brown commit ac88e9526d68f2532be3b4b439d45c0c8de7e170 Author: Satya Priya Date: Tue Nov 23 17:19:25 2021 +0530 dt-bindings: regulator: Add compatible for pmg1110 Add compatible string for pmg1110 pmic. Signed-off-by: Satya Priya Link: https://lore.kernel.org/r/1637668167-31325-2-git-send-email-quic_c_skakit@quicinc.com Signed-off-by: Mark Brown commit fc1e5a3613a8e5e08522b6c84894c6fabf1b5499 Merge: fd888e85fe6b6 e54b708c5441e Author: David S. Miller Date: Mon Nov 29 12:19:53 2021 +0000 Merge branch 'vxlan-port' Guangbin Huang says: ==================== net: vxlan: add macro definition for number of IANA VXLAN-GPE port This series add macro definition for number of IANA VXLAN-GPE port for cleanup. ==================== Signed-off-by: David S. Miller commit e54b708c5441e3aee20b9352334ff610649ac227 Author: Hao Chen Date: Sat Nov 27 17:34:05 2021 +0800 net: hns3: use macro IANA_VXLAN_GPE_UDP_PORT to replace number 4790 This patch uses macro IANA_VXLAN_GPE_UDP_PORT to replace number 4790 for cleanup. Signed-off-by: Hao Chen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit ed618bd80947fa8d9644baf8ac18cb2a02223a5e Author: Hao Chen Date: Sat Nov 27 17:34:04 2021 +0800 net: vxlan: add macro definition for number of IANA VXLAN-GPE port Add macro definition for number of IANA VXLAN-GPE port for generic use. Signed-off-by: Hao Chen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 679de7b64f9622eff8f74357fc3ee071629d25b3 Author: Jernej Skrabec Date: Wed Nov 17 20:44:58 2021 +0100 ASoC: sunxi: sun4i-spdif: Implement IEC958 control SPDIF core is capable of sending custom status. Implement IEC958 control handling. Signed-off-by: Jernej Skrabec Link: https://lore.kernel.org/r/20211117194458.2249643-1-jernej.skrabec@gmail.com Signed-off-by: Mark Brown commit 425c5fce8a03c9da70a4c763cd7db22fbb422dcf Author: lvzhaoxiong Date: Tue Nov 23 10:43:29 2021 +0800 ASoC: qcom: Add support for ALC5682I-VS codec Qcom machine driver adds rt5682s support in this patch. Card name can be specified from dts by model property, and driver makes use of the name to distinguish which headset codec is on the board. Signed-off-by: lvzhaoxiong Link: https://lore.kernel.org/r/20211123024329.21998-1-lvzhaoxiong@huaqin.corp-partner.google.com Signed-off-by: Mark Brown commit fd03cf7f5b4726028cfc2ef76e42d0d5c66377aa Author: Samuel Holland Date: Wed Nov 17 21:36:45 2021 -0600 ASoC: sun8i-codec: Add AIF, ADC, and DAC volume controls This allows changing the volume of each digital input/output independently, and provides the only "master volume" for the DAC. (The ADC also has a gain control on the analog side.) While the hardware supports digital gain up to +72dB, the controls here are limited to +24dB maximum, as any gain above that level makes volume sliders difficult to use, and is extremely likely to cause clipping. Signed-off-by: Samuel Holland Link: https://lore.kernel.org/r/20211118033645.43524-1-samuel@sholland.org Signed-off-by: Mark Brown commit dd894f4caf7df77cf72dc6ae7547900b55d0de42 Author: Kuninori Morimoto Date: Tue Nov 16 16:45:34 2021 +0900 ASoC: soc-pcm: tidyup soc_pcm_pointer()'s delay update method No driver directly updates runtime->delay in .pointer. This patch cleanups its method. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87zgq4wnkx.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 796b64a72db0b416f0aa1815e87aa28388b4715d Author: Kuninori Morimoto Date: Tue Nov 16 16:45:29 2021 +0900 ASoC: intel: sst-mfld-platform-pcm: add .delay support Now ALSA SoC supports .delay for component. This patch uses it, and not update runtime->delay on .pointer directly / secretly. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/871r3gy25j.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit feea640aaf1a5ae9dff6e33931e680542432e8dd Author: Kuninori Morimoto Date: Tue Nov 16 16:45:23 2021 +0900 ASoC: amd: acp-pcm-dma: add .delay support Now ALSA SoC supports .delay for component. This patch uses it, and not update runtime->delay on .pointer directly / secretly. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/8735nwy25o.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 403f830e7a0be5a9e33c7a9d208574f79887ec57 Author: Kuninori Morimoto Date: Tue Nov 16 16:45:18 2021 +0900 ASoC: soc-component: add snd_soc_pcm_component_delay() Current soc-pcm.c :: soc_pcm_pointer() is assuming that component driver might update runtime->delay silently in snd_soc_pcm_component_pointer() (= A). static snd_pcm_uframes_t soc_pcm_pointer(...) { ... /* clearing the previous total delay */ => runtime->delay = 0; (A) offset = snd_soc_pcm_component_pointer(substream); /* base delay if assigned in pointer callback */ => delay = runtime->delay; ... } 1) The behavior that ".pointer callback secretly updates runtime->delay" is strange and confusable. 2) Current snd_soc_pcm_component_pointer() uses 1st found component's .pointer callback only, thus it is no problem for now. But runtime->delay might be overwrote if it adjusted to multiple components in the future. 3) Component delay is updated at .pointer callback timing (secretly). But some components which doesn't have .pointer callback might want to increase runtime->delay for some reasons. We already have .delay function for DAI, but not have for Component. This patch adds new snd_soc_pcm_component_delay() for it. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/874k8cy25t.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit 8544f08c816292c2219f28c6eaa69236b978bfb9 Author: Kuninori Morimoto Date: Tue Nov 16 16:45:12 2021 +0900 ASoC: soc-dai: update snd_soc_dai_delay() to snd_soc_pcm_dai_delay() Current soc_pcm_pointer() is manually calculating both CPU-DAI's max delay (= A) and Codec-DAI's max delay (= B). static snd_pcm_uframes_t soc_pcm_pointer(...) { ... ^ for_each_rtd_cpu_dais(rtd, i, cpu_dai) (A) cpu_delay = max(cpu_delay, ...); v delay += cpu_delay; ^ for_each_rtd_codec_dais(rtd, i, codec_dai) (B) codec_delay = max(codec_delay, ...); v delay += codec_delay; runtime->delay = delay; ... } Current soc_pcm_pointer() and the total delay calculating is not readable / difficult to understand. This patch update snd_soc_dai_delay() to snd_soc_pcm_dai_delay(), and calcule both CPU/Codec delay in one function. Link: https://lore.kernel.org/r/87fszl4yrq.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/875yssy25z.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown commit aebd1fb45c622e9a2b06fb70665d084d3a8d6c78 Author: Nicholas Piggin Date: Fri Oct 22 16:13:22 2021 +1000 powerpc: flexible GPR range save/restore macros Introduce macros that operate on a (start, end) range of GPRs, which reduces lines of code and need to do mental arithmetic while reading the code. Signed-off-by: Nicholas Piggin Reviewed-by: Segher Boessenkool Reviewed-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211022061322.2671178-1-npiggin@gmail.com commit fd888e85fe6b661e78044dddfec0be5271afa626 Author: Sebastian Andrzej Siewior Date: Fri Nov 26 17:15:29 2021 +0100 net: Write lock dev_base_lock without disabling bottom halves. The writer acquires dev_base_lock with disabled bottom halves. The reader can acquire dev_base_lock without disabling bottom halves because there is no writer in softirq context. On PREEMPT_RT the softirqs are preemptible and local_bh_disable() acts as a lock to ensure that resources, that are protected by disabling bottom halves, remain protected. This leads to a circular locking dependency if the lock acquired with disabled bottom halves (as in write_lock_bh()) and somewhere else with enabled bottom halves (as by read_lock() in netstat_show()) followed by disabling bottom halves (cxgb_get_stats() -> t4_wr_mbox_meat_timeout() -> spin_lock_bh()). This is the reverse locking order. All read_lock() invocation are from sysfs callback which are not invoked from softirq context. Therefore there is no need to disable bottom halves while acquiring a write lock. Acquire the write lock of dev_base_lock without disabling bottom halves. Reported-by: Pei Zhang Reported-by: Luis Claudio R. Goncalves Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: David S. Miller commit 07b8ca3792dec6bc3288b08ff85d80b5330de1d6 Author: Tom Parkin Date: Fri Nov 26 16:09:03 2021 +0000 net/l2tp: convert tunnel rwlock_t to rcu Previously commit e02d494d2c60 ("l2tp: Convert rwlock to RCU") converted most, but not all, rwlock instances in the l2tp subsystem to RCU. The remaining rwlock protects the per-tunnel hashlist of sessions which is used for session lookups in the UDP-encap data path. Convert the remaining rwlock to rcu to improve performance of UDP-encap tunnels. Note that the tunnel and session, which both live on RCU-protected lists, use slightly different approaches to incrementing their refcounts in the various getter functions. The tunnel has to use refcount_inc_not_zero because the tunnel shutdown process involves dropping the refcount to zero prior to synchronizing RCU readers (via. kfree_rcu). By contrast, the session shutdown removes the session from the list(s) it is on, synchronizes with readers, and then decrements the session refcount. Since the getter functions increment the session refcount with the RCU read lock held we prevent getters seeing a zero session refcount, and therefore don't need to use refcount_inc_not_zero. Signed-off-by: Tom Parkin Signed-off-by: David S. Miller commit e012c499985c608c936410d8bab29d9596d62859 Author: Nicholas Piggin Date: Fri Nov 19 21:31:46 2021 +1000 powerpc/watchdog: help remote CPUs to flush NMI printk output The printk layer at the moment does not seem to have a good way to force flush printk messages that are created in NMI context, except in the panic path. NMI-context printk messages normally get to the console with irq_work, but that won't help if the CPU is stuck with irqs disabled, as can be the case for hard lockup watchdog messages. The watchdog currently flushes the printk buffers after detecting a lockup on remote CPUs, but they may not have processed their NMI IPI yet by that stage, or they may have self-detected a lockup in which case they won't go via this NMI IPI path. Improve the situation by having NMI-context mark a flag if it called printk, and have watchdog timer interrupts check if that flag was set and try to flush if it was. Latency is not a big problem because we were already stuck for a while, just need to try to make sure the messages eventually make it out. Depends-on: 5d5e4522a7f4 ("printk: restore flushing of NMI buffers on remote CPUs after NMI backtraces") Signed-off-by: Nicholas Piggin Reviewed-by: Laurent Dufour Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211119113146.752759-6-npiggin@gmail.com commit ab344fd43f2958726d17d651c0cb692c67dca382 Author: Jianjun Wang Date: Fri Oct 15 14:36:02 2021 +0800 PCI: mediatek-gen3: Disable DVFSRC voltage request When the DVFSRC (dynamic voltage and frequency scaling resource collector) feature is not implemented, the PCIe hardware will assert a voltage request signal when exit from the L1 PM Substates to request a specific Vcore voltage, but cannot receive the voltage ready signal, which will cause the link to fail to exit the L1 PM Substates. Disable DVFSRC voltage request by default, we need to find a common way to enable it in the future. Link: https://lore.kernel.org/r/20211015063602.29058-1-jianjun.wang@mediatek.com Fixes: d3bf75b579b9 ("PCI: mediatek-gen3: Add MediaTek Gen3 driver for MT8192") Tested-by: Qizhong Cheng Signed-off-by: Jianjun Wang Signed-off-by: Lorenzo Pieralisi Reviewed-by: Tzung-Bi Shih Reviewed-by: Matthias Brugger commit 275f37ea50acdda09cc0863b8a0edcaaf1ae7f23 Merge: 2f7ed29f2c54a 2551dc9e398c3 Author: David S. Miller Date: Mon Nov 29 12:05:52 2021 +0000 Merge branch 'mvneta-next' Maxime Chevallier says: ==================== net: mvneta: mqprio cleanups and shaping support This is the second version of the series that adds some improvements to the existing mqprio implementation in mvneta, and adds support for egress shaping offload. The first 3 patches are some minor cleanups, such as using the tc_mqprio_qopt_offload structure to get access to more offloading options, cleaning the logic to detect whether or not we should offload mqprio setting, and allowing to have a 1 to N mapping between TCs and queues. The last patch adds traffic shaping offload, using mvneta's per-queue token buckets, allowing to limit rates from 10Kbps up to 5Gbps with 10Kbps increments. This was tested only on an Armada 3720, with traffic up to 2.5Gbps. Changes since V1 fixes the build for 32bits kernels, using the right div helpers as suggested by Jakub. ==================== Signed-off-by: David S. Miller commit 2551dc9e398c37a15e52122d385c29a8b06be45f Author: Maxime Chevallier Date: Fri Nov 26 12:20:56 2021 +0100 net: mvneta: Add TC traffic shaping offload The mvneta controller is able to do some tocken-bucket per-queue traffic shaping. This commit adds support for setting these using the TC mqprio interface. The token-bucket parameters are customisable, but the current implementation configures them to have a 10kbps resolution for the rate limitation, since it allows to cover the whole range of max_rate values from 10kbps to 5Gbps with 10kbps increments. Signed-off-by: Maxime Chevallier Signed-off-by: David S. Miller commit e9f7099d0730341b24c057acbf545dd019581db6 Author: Maxime Chevallier Date: Fri Nov 26 12:20:55 2021 +0100 net: mvneta: Allow having more than one queue per TC The current mqprio implementation assumed that we are only using one queue per TC. Use the offset and count parameters to allow using multiple queues per TC. In that case, the controller will use a standard round-robin algorithm to pick queues assigned to the same TC, with the same priority. This only applies to VLAN priorities in ingress traffic, each TC corresponding to a vlan priority. Signed-off-by: Maxime Chevallier Signed-off-by: David S. Miller commit e7ca75fe6662f78bfeb0112671c812e4c7b8e214 Author: Maxime Chevallier Date: Fri Nov 26 12:20:54 2021 +0100 net: mvneta: Don't force-set the offloading flag The qopt->hw flag is set by the TC code according to the offloading mode asked by user. Don't force-set it in the driver, but instead read it to make sure we do what's asked. Signed-off-by: Maxime Chevallier Signed-off-by: David S. Miller commit 75fa71e3acadbb4ab5eda18505277eb9a1f69b23 Author: Maxime Chevallier Date: Fri Nov 26 12:20:53 2021 +0100 net: mvneta: Use struct tc_mqprio_qopt_offload for MQPrio configuration The struct tc_mqprio_qopt_offload is a container for struct tc_mqprio_qopt, that allows passing extra parameters, such as traffic shaping. This commit converts the current mqprio code to that new struct. Signed-off-by: Maxime Chevallier Signed-off-by: David S. Miller commit 2f746ea6e6a9036b2f33d80d776ac2464f4cea18 Author: Matti Vaittinen Date: Tue Nov 16 14:55:05 2021 +0200 MAINTAINERS: bd70528: Drop ROHM BD70528 drivers 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. Ease the maintenance burden and drop the driver. Signed-off-by: Matti Vaittinen Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/90b0565c0eb9429b0962f08d45292a5a9ebe5cea.1637066805.git.matti.vaittinen@fi.rohmeurope.com commit 306456c21c792ac633e660bc45f0854b612a0e98 Author: Matti Vaittinen Date: Tue Nov 16 14:54:35 2021 +0200 mfd: 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 Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/cf7dfd98b3403ad363b2b48b57bdbfd57a6416cb.1637066805.git.matti.vaittinen@fi.rohmeurope.com commit da53cc634cea6eb5d21809512ef348f6d4130850 Author: Matti Vaittinen Date: Tue Nov 16 14:54:06 2021 +0200 gpio: 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 Acked-by: Bartosz Golaszewski Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/4eff6bd5eff8afc137dd8c1697cb5c6b2e3aacd2.1637066805.git.matti.vaittinen@fi.rohmeurope.com commit 81a7297c5b50f8e72540bdf04149efffaf01748c Author: Matti Vaittinen Date: Tue Nov 16 14:53:03 2021 +0200 dt-bindings: mfd: regulator: 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 Acked-by: Rob Herring Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/64c88990270d9a22508446ef2fe3b6a2622a0b01.1637066805.git.matti.vaittinen@fi.rohmeurope.com commit 2f7ed29f2c54ace09eb09e3f97fd573a31b79309 Author: Yang Yingliang Date: Fri Nov 26 17:13:40 2021 +0800 net: mdio: ipq8064: replace ioremap() with devm_ioremap() Use devm_ioremap() instead of ioremap() to avoid iounmap() missing. Signed-off-by: Yang Yingliang Signed-off-by: David S. Miller commit 57dd3a7bdf311e4a499fe0decabcdf2484e2538a Author: Christophe Leroy Date: Thu Nov 25 12:43:33 2021 +0100 powerpc: Don't bother about .data..Lubsan sections Since commit 9a427556fb8e ("vmlinux.lds.h: catch compound literals into data and BSS") .data..Lubsan sections are taken into account in DATA_MAIN which is included in DATA_DATA macro. No need to take care of them anymore in powerpc vmlinux.lds.S Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/3eb14570612eef17e01bb67f14a4450136001794.1637840601.git.christophe.leroy@csgroup.eu commit cdc81aece8041fd5437bdabde6c543cdeb2891a8 Author: Christophe Leroy Date: Fri Nov 26 11:30:03 2021 +0100 powerpc/ptdump: Fix display a BAT's size unit We have wrong units on BAT's sizes (G instead of M, M instead of ...) ---[ Instruction Block Address Translation ]--- 0: 0xc0000000-0xc03fffff 0x00000000 4G Kernel x m 1: 0xc0400000-0xc05fffff 0x00400000 2G Kernel x m 2: 0xc0600000-0xc06fffff 0x00600000 1G Kernel x m 3: 0xc0700000-0xc077ffff 0x00700000 512M Kernel x m 4: 0xc0780000-0xc079ffff 0x00780000 128M Kernel x m 5: 0xc07a0000-0xc07bffff 0x007a0000 128M Kernel x m 6: - 7: - This is because pt_dump_size() expects a size in Kbytes but bat_show_603() gives the size in bytes. To avoid risk of confusion, change pt_dump_size() to take bytes. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/f16c30f5c9185a63335322cf1a8b22f189d335ef.1637922595.git.christophe.leroy@csgroup.eu commit 7dfbfb87c243cf08bc2b9cc23699ac207b726458 Author: Christophe Leroy Date: Thu Oct 28 14:24:04 2021 +0200 powerpc/ftrace: Activate HAVE_DYNAMIC_FTRACE_WITH_REGS on PPC32 Unlike PPC64, PPC32 doesn't require any special compiler option to get _mcount() call not clobbering registers. Provide ftrace_regs_caller() and ftrace_regs_call() and activate HAVE_DYNAMIC_FTRACE_WITH_REGS. That's heavily copied from ftrace_64_mprofile.S For the time being leave livepatching aside, it will come with following patch. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1862dc7719855cc2a4eec80920d94c955877557e.1635423081.git.christophe.leroy@csgroup.eu commit c93d4f6ecf4b0699d0f2088f7bd9cd09af45d65a Author: Christophe Leroy Date: Thu Oct 28 14:24:03 2021 +0200 powerpc/ftrace: Add module_trampoline_target() for PPC32 module_trampoline_target() is used by __ftrace_modify_call(). Implement it for PPC32 so that CONFIG_DYNAMIC_FTRACE_WITH_REGS can be activated on PPC32 as well. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/42345f464fb465f0fc76f3090e250be8fc1729f0.1635423081.git.christophe.leroy@csgroup.eu commit 88670fdb26800228606c078ba4a018e9522a75a8 Author: Christophe Leroy Date: Thu Oct 28 14:24:02 2021 +0200 powerpc/ftrace: No need to read LR from stack in _mcount() All functions calling _mcount do it exactly the same way, with the following sequence of instructions: c07de788: 7c 08 02 a6 mflr r0 c07de78c: 90 01 00 04 stw r0,4(r1) c07de790: 4b 84 13 65 bl c001faf4 <_mcount> Allthough LR is pushed on stack, it is still in r0 while entering _mcount(). Function arguments are in r3-r10, so r11 and r12 are still available at that point. Do like PPC64 and use r12 to move LR into CTR, so that r0 is preserved and doesn't need to be restored from the stack. While at it, bring back the EXPORT_SYMBOL at the end of _mcount. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/24a3ba7db388537c44a038026f926d885372e6d3.1635423081.git.christophe.leroy@csgroup.eu commit ab85a273957eadfcf7906bcd8a0adf5909d802ee Author: Michael Ellerman Date: Wed Nov 24 20:32:54 2021 +1100 powerpc: Mark probe_machine() __init and static Prior to commit b1923caa6e64 ("powerpc: Merge 32-bit and 64-bit setup_arch()") probe_machine() was called from setup_32/64.c and lived in setup-common.c. But now it's only called from setup-common.c so it can be static and __init, and we don't need the declaration in machdep.h either. Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211124093254.1054750-6-mpe@ellerman.id.au commit a4ac0d249a5db80e79d573db9e4ad29354b643a8 Author: Michael Ellerman Date: Wed Nov 24 20:32:53 2021 +1100 powerpc/smp: Move setup_profiling_timer() under CONFIG_PROFILING setup_profiling_timer() is only needed when CONFIG_PROFILING is enabled. Fixes the following W=1 warning when CONFIG_PROFILING=n: linux/arch/powerpc/kernel/smp.c:1638:5: error: no previous prototype for ‘setup_profiling_timer’ Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211124093254.1054750-5-mpe@ellerman.id.au commit ff47a95d1a67477e9bc2049a840d93b68508e079 Author: Michael Ellerman Date: Wed Nov 24 20:32:52 2021 +1100 powerpc/mm: Move tlbcam_sz() and make it static Building with W=1 we see a warning: linux/arch/powerpc/mm/nohash/fsl_book3e.c:63:15: error: no previous prototype for ‘tlbcam_sz’ tlbcam_sz() is not used outside this file, so we can make it static. However it's only used inside #ifdef CONFIG_PPC32, so move it within that ifdef, otherwise we would get a defined but not used error. Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211124093254.1054750-4-mpe@ellerman.id.au commit d9150d5bb5586dc20b6c424e59d5ea29fe1b3030 Author: Michael Ellerman Date: Wed Nov 24 20:32:51 2021 +1100 powerpc/85xx: Make c293_pcie_pic_init() static To fix the W=1 warning: linux/arch/powerpc/platforms/85xx/c293pcie.c:22:13: error: no previous prototype for ‘c293_pcie_pic_init’ Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211124093254.1054750-3-mpe@ellerman.id.au commit 84a61fb43fdfc528a3a7ff00e0b14ba91f5eb745 Author: Michael Ellerman Date: Wed Nov 24 20:32:50 2021 +1100 powerpc/85xx: Make mpc85xx_smp_kexec_cpu_down() static To fix the W=1 warning: arch/powerpc/platforms/85xx/smp.c:369:6: error: no previous prototype for ‘mpc85xx_smp_kexec_cpu_down’ Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211124093254.1054750-2-mpe@ellerman.id.au commit 4ea9e321c27fd531a8dfe0fa1d1b2ee15fc3444e Author: Michael Ellerman Date: Wed Nov 24 20:32:49 2021 +1100 powerpc/85xx: Fix no previous prototype warning for mpc85xx_setup_pmc() Fixes the following W=1 warning: arch/powerpc/platforms/85xx/mpc85xx_pm_ops.c:89:12: warning: no previous prototype for 'mpc85xx_setup_pmc' Reported-by: kernel test robot Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211124093254.1054750-1-mpe@ellerman.id.au commit 2eafc4748bc08c5b9b6ee0b5b65ad20b30f7d704 Author: Nicholas Piggin Date: Fri Nov 5 13:50:42 2021 +1000 powerpc: select CPUMASK_OFFSTACK if NR_CPUS >= 8192 Some core kernel code starts to go beyond the 2048 byte stack size warning at NR_CPUS=8192, so select CPUMASK_OFFSTACK in that case. x86 does similarly for very large NR_CPUS. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211105035042.1398309-2-npiggin@gmail.com commit b350111bf7b3f4a780d28c44f18f7c9fcbe6d11b Author: Nicholas Piggin Date: Fri Nov 5 13:50:41 2021 +1000 powerpc: remove cpu_online_cores_map function This function builds the cores online map with on-stack cpumasks which can cause high stack usage with large NR_CPUS. It is not used in any performance sensitive paths, so instead just check for first thread sibling. Signed-off-by: Nicholas Piggin Tested-by: Sachin Sant Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211105035042.1398309-1-npiggin@gmail.com commit 4e1fc0a48037ae0cb197922c0acf28424abbb41d Author: Geert Uytterhoeven Date: Mon Nov 22 16:53:58 2021 +0100 MIPS: CPS: Use bitfield helpers Use the FIELD_GET() helper, instead of open-coding the same operation. Signed-off-by: Geert Uytterhoeven Signed-off-by: Thomas Bogendoerfer commit 9d348f6b92801eca5671e75e1d10b7d34738681a Author: Geert Uytterhoeven Date: Mon Nov 22 16:53:46 2021 +0100 MIPS: CPC: Use bitfield helpers Use the FIELD_PREP() helper, instead of open-coding the same operation. Signed-off-by: Geert Uytterhoeven Signed-off-by: Thomas Bogendoerfer commit 13166af248988f9752de5783ec7185c3212f416b Author: Jason Wang Date: Sat Nov 13 11:25:52 2021 +0800 MIPS: Remove a repeated word in a comment The repeated word `the' in a comment is redundant, thus one of them was removed from the comment. Signed-off-by: Jason Wang Acked-by: Randy Dunlap Signed-off-by: Thomas Bogendoerfer commit 3d0ccae6f22fc05cbb2aa9f49363d35dd7338f29 Author: Cai Huoqing Date: Mon Nov 29 14:33:46 2021 +0800 drm/tidss: Fix warning: unused variable 'tidss_pm_ops' Mark 'tidss_pm_ops' as __maybe_unused to avoid the warning: unused variable 'tidss_pm_ops' Fixes: 6e120594631f ("drm/tidss: Make use of the helper macro SET_RUNTIME_PM_OPS()") Signed-off-by: Cai Huoqing Reviewed-by: Tomi Valkeinen Signed-off-by: Tomi Valkeinen Link: https://patchwork.freedesktop.org/patch/msgid/20211129063347.404-1-caihuoqing@baidu.com commit 69831173fcbbfebb7aa2d76523deaf0b87b8eddd Author: Kees Cook Date: Fri Nov 19 11:22:33 2021 -0800 rtlwifi: rtl8192de: Style clean-ups Clean up some style issues: - Use ARRAY_SIZE() even though it's a u8 array. - Remove redundant CHANNEL_MAX_NUMBER_2G define. Additionally fix some dead code WARNs. Acked-by: Ping-Ke Shih Link: https://lore.kernel.org/lkml/57d0d1b6064342309f680f692192556c@realtek.com/ Signed-off-by: Kees Cook Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211119192233.1021063-1-keescook@chromium.org commit f01b3774309fc60f8bf27354014459b63e667b32 Author: Kees Cook Date: Thu Nov 18 16:49:05 2021 -0800 mwl8k: Use named struct for memcpy() region 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. Use named struct in struct mwl8k_cmd_set_key around members key_material, tkip_tx_mic_key, and tkip_rx_mic_key so they can be referenced together. This will allow memcpy() and sizeof() to more easily reason about sizes, improve readability, and avoid future warnings about writing beyond the end of key_material. "pahole" shows no size nor member offset changes to struct mwl8k_cmd_set_key. "objdump -d" shows no object code changes. Signed-off-by: Kees Cook Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211119004905.2348143-1-keescook@chromium.org commit 601d2293e27f6fb37b30b836d724333a4ed79fe9 Author: Kees Cook Date: Thu Nov 18 16:46:46 2021 -0800 intersil: Use struct_group() for memcpy() region 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. Use struct_group() in struct hfa384x_tx_frame around members frame_control, duration_id, addr1, addr2, addr3, and seq_ctrl, so they can be referenced together. This will allow memcpy() and sizeof() to more easily reason about sizes, improve readability, and avoid future warnings about writing beyond the end of frame_control. "pahole" shows no size nor member offset changes to struct hfa384x_tx_frame. "objdump -d" shows no object code changes. Signed-off-by: Kees Cook Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211119004646.2347920-1-keescook@chromium.org commit 642a57475b30213ebac1f7061eaf4d0415d9c5a1 Author: Kees Cook Date: Thu Nov 18 10:41:21 2021 -0800 libertas_tf: Use struct_group() for memcpy() region In preparation for FORTIFY_SOURCE performing compile-time and run-time field array bounds checking for memcpy(), memmove(), and memset(), avoid intentionally writing across neighboring fields. Use struct_group() in struct txpd around members tx_dest_addr_high and tx_dest_addr_low so they can be referenced together. This will allow memcpy() and sizeof() to more easily reason about sizes, improve readability, and avoid future warnings about writing beyond the end of tx_dest_addr_high. "pahole" shows no size nor member offset changes to struct txpd. "objdump -d" shows no object code changes. Signed-off-by: Kees Cook Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211118184121.1283821-1-keescook@chromium.org commit 5fd32ae0433a7af37eac27ace3aabae8cb7c2fc4 Author: Kees Cook Date: Thu Nov 18 10:41:04 2021 -0800 libertas: Use struct_group() for memcpy() region 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. Use struct_group() in struct txpd around members tx_dest_addr_high and tx_dest_addr_low so they can be referenced together. This will allow memcpy() and sizeof() to more easily reason about sizes, improve readability, and avoid future warnings about writing beyond the end of queue_id. "pahole" shows no size nor member offset changes to struct txpd. "objdump -d" shows no object code changes. Signed-off-by: Kees Cook Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211118184104.1283637-1-keescook@chromium.org commit fa4408b0799a7d52ec0b28f97ab0a93401e8e83f Author: Jason Wang Date: Sat Nov 13 14:35:51 2021 +0800 wlcore: no need to initialise statics to false Static variables do not need to be initialized to false. The compiler will do that. Signed-off-by: Jason Wang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211113063551.257804-1-wangborong@cdjrlc.com commit f1cb3476e48b60c450ec3a1d7da0805bffc6e43a Author: Zekun Shen Date: Fri Oct 29 16:19:23 2021 -0400 rsi: Fix out-of-bounds read in rsi_read_pkt() rsi_get_* functions rely on an offset variable from usb input. The size of usb input is RSI_MAX_RX_USB_PKT_SIZE(3000), while 2-byte offset can be up to 0xFFFF. Thus a large offset can cause out-of-bounds read. The patch adds a bound checking condition when rcv_pkt_len is 0, indicating it's USB. It's unclear whether this is triggerable from other type of bus. The following check might help in that case. offset > rcv_pkt_len - FRAME_DESC_SZ The bug is trigerrable with conpromised/malfunctioning USB devices. I tested the patch with the crashing input and got no more bug report. Attached is the KASAN report from fuzzing. BUG: KASAN: slab-out-of-bounds in rsi_read_pkt+0x42e/0x500 [rsi_91x] Read of size 2 at addr ffff888019439fdb by task RX-Thread/227 CPU: 0 PID: 227 Comm: RX-Thread Not tainted 5.6.0 #66 Call Trace: dump_stack+0x76/0xa0 print_address_description.constprop.0+0x16/0x200 ? rsi_read_pkt+0x42e/0x500 [rsi_91x] ? rsi_read_pkt+0x42e/0x500 [rsi_91x] __kasan_report.cold+0x37/0x7c ? rsi_read_pkt+0x42e/0x500 [rsi_91x] kasan_report+0xe/0x20 rsi_read_pkt+0x42e/0x500 [rsi_91x] rsi_usb_rx_thread+0x1b1/0x2fc [rsi_usb] ? rsi_probe+0x16a0/0x16a0 [rsi_usb] ? _raw_spin_lock_irqsave+0x7b/0xd0 ? _raw_spin_trylock_bh+0x120/0x120 ? __wake_up_common+0x10b/0x520 ? rsi_probe+0x16a0/0x16a0 [rsi_usb] kthread+0x2b5/0x3b0 ? kthread_create_on_node+0xd0/0xd0 ret_from_fork+0x22/0x40 Reported-by: Brendan Dolan-Gavitt Signed-off-by: Zekun Shen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/YXxXS4wgu2OsmlVv@10-18-43-117.dynapool.wireless.nyu.edu commit b07e3c6ebc0c20c772c0f54042e430acec2945c3 Author: Zekun Shen Date: Fri Oct 29 15:49:03 2021 -0400 rsi: Fix use-after-free in rsi_rx_done_handler() When freeing rx_cb->rx_skb, the pointer is not set to NULL, a later rsi_rx_done_handler call will try to read the freed address. This bug will very likley lead to double free, although detected early as use-after-free bug. The bug is triggerable with a compromised/malfunctional usb device. After applying the patch, the same input no longer triggers the use-after-free. Attached is the kasan report from fuzzing. BUG: KASAN: use-after-free in rsi_rx_done_handler+0x354/0x430 [rsi_usb] Read of size 4 at addr ffff8880188e5930 by task modprobe/231 Call Trace: dump_stack+0x76/0xa0 print_address_description.constprop.0+0x16/0x200 ? rsi_rx_done_handler+0x354/0x430 [rsi_usb] ? rsi_rx_done_handler+0x354/0x430 [rsi_usb] __kasan_report.cold+0x37/0x7c ? dma_direct_unmap_page+0x90/0x110 ? rsi_rx_done_handler+0x354/0x430 [rsi_usb] kasan_report+0xe/0x20 rsi_rx_done_handler+0x354/0x430 [rsi_usb] __usb_hcd_giveback_urb+0x1e4/0x380 usb_giveback_urb_bh+0x241/0x4f0 ? __usb_hcd_giveback_urb+0x380/0x380 ? apic_timer_interrupt+0xa/0x20 tasklet_action_common.isra.0+0x135/0x330 __do_softirq+0x18c/0x634 ? handle_irq_event+0xcd/0x157 ? handle_edge_irq+0x1eb/0x7b0 irq_exit+0x114/0x140 do_IRQ+0x91/0x1e0 common_interrupt+0xf/0xf Reported-by: Brendan Dolan-Gavitt Signed-off-by: Zekun Shen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/YXxQL/vIiYcZUu/j@10-18-43-117.dynapool.wireless.nyu.edu commit 7a6cfe28ae3ef6a78774fd1e21e3b76c90937112 Author: Loic Poulain Date: Mon Nov 22 16:47:26 2021 +0100 brcmfmac: Configure keep-alive packet on suspend When entering suspend as a client station with wowlan enabled, the Wi-Fi link is supposed to be maintained. In that state, no more data is generated from client side, and the link stays idle as long the station is suspended and as long the AP as no data to transmit. However, most of the APs kick-off such 'inactive' stations after few minutes, causing unexpected disconnect (reconnect, etc...). The usual way to prevent this is to submit a Null function frame periodically as a keep-alive. This is something that can be host /software generated (e.g. wpa_supplicant), but that needs to be offloaded to the Wi-Fi controller in case of suspended host. This change enables firmware generated keep-alive frames when entering wowlan suspend, using the 'mkeep_alive' IOVAR. Signed-off-by: Loic Poulain Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1637596046-21651-1-git-send-email-loic.poulain@linaro.org commit 376e3fdecb0dcae216c0ac559cff066f460bf47b Author: Finn Thain Date: Fri Nov 19 09:29:38 2021 +1100 m68k: Enable memtest functionality Enable the memtest functionality and rearrange some code to prevent it from clobbering the initrd. The code to implement CONFIG_BLK_DEV_INITRD was conditional on !defined(CONFIG_SUN3). For simplicity, remove that test on the basis that m68k_ramdisk.size == 0 on Sun 3. The SLIME source code at http://sammy.net/sun3/ftp/pub/m68k/sun3/slime/slime-2.0.tar.gz indicates that no BI_RAMDISK entry is ever passed to the kernel due to #ifdef 0 around the relevant code. Cc: Mike Rapoport Cc: Sam Creasey Cc: Jonathan Corbet Signed-off-by: Finn Thain Acked-by: Mike Rapoport Link: https://lore.kernel.org/r/8170fe1d1c62426d82275d36ba409ecc18754292.1637274578.git.fthain@linux-m68k.org Signed-off-by: Geert Uytterhoeven commit 453e2cadc97ca52e423852435522eb7d4f4b5b6b Author: Jacky Bai Date: Fri Nov 26 15:39:58 2021 +0800 dt-bindings: timer: tpm-timer: Add imx8ulp compatible string The tpm timer on i.MX8ULP is derived from i.MX7ULP, it use two compatible strings, so update the compatible string for it. Reviewed-by: Dong Aisheng Acked-by: Rob Herring Signed-off-by: Jacky Bai Signed-off-by: Peng Fan Link: https://lore.kernel.org/r/20211126074002.1535696-4-peng.fan@oss.nxp.com Signed-off-by: Daniel Lezcano commit 1ead7e992abee922b7e6ff1238dc47c06605c5bd Author: Andy Shevchenko Date: Fri Nov 12 14:34:59 2021 +0200 i2c: designware: Fix the kernel doc description for struct dw_i2c_dev $ scripts/kernel-doc -none drivers/i2c/busses/i2c-designware-core.h warning: Function parameter or member 'rst' not described in 'dw_i2c_dev' warning: Function parameter or member 'get_clk_rate_khz' not described in 'dw_i2c_dev' warning: Function parameter or member 'flags' not described in 'dw_i2c_dev' warning: Function parameter or member 'functionality' not described in 'dw_i2c_dev' warning: Function parameter or member 'master_cfg' not described in 'dw_i2c_dev' warning: Function parameter or member 'set_sda_hold_time' not described in 'dw_i2c_dev' warning: Function parameter or member 'rinfo' not described in 'dw_i2c_dev' Signed-off-by: Andy Shevchenko Acked-by: Jarkko Nikula Acked-by: Randy Dunlap Signed-off-by: Wolfram Sang commit b57e90189f208e8e873f532b797f8b649973f7a2 Author: John Keeping Date: Mon Oct 4 14:15:39 2021 +0100 i2c: rk3x: enable clock before getting rate clk_get_rate() is documented as requiring the clock to be enabled. Ensure that the bus clock is enabled before calling clk_get_rate() in rk3x_i2c_probe() to satisfy this requirement. Signed-off-by: John Keeping Reviewed-by: Heiko Stuebner Signed-off-by: Wolfram Sang commit 8efe1d7c0023ce124fa9984095f5bc7198c71c82 Author: Mauro Carvalho Chehab Date: Mon Nov 22 09:53:02 2021 +0000 media: saa7134-go7007: get rid of to_state() function This is just an alias for container_of() and it is used only on a commented code. The commented code actually is an issue that require fixes, so, move the container_of() call to the commented code, and drop the unused function. This way, a fix for the function could be added later without needing to re-add to_state() function. This fixes a clang W=1 warning. Reviewed-by: Nathan Chancellor Signed-off-by: Mauro Carvalho Chehab commit f16ce2e275bbe38582e6bb9416c9c7c92bb42f95 Author: Mauro Carvalho Chehab Date: Mon Nov 22 09:49:19 2021 +0000 media: adv7842: get rid of two unused functions Those functions just call a V4L2 core macro, and aren't used anywhere. Get rid of them, in order to avoid clang warnings with W=1. Reviewed-by: Nathan Chancellor Signed-off-by: Mauro Carvalho Chehab commit c9ae8eed446322fc2d1c9e6bf4ac78b4e5686cad Author: Mauro Carvalho Chehab Date: Mon Nov 22 09:20:50 2021 +0000 media: omap3isp: avoid warnings at IS_OUT_OF_BOUNDS() Clang with W=1 produces the following warnings: drivers/media/platform/omap3isp/isph3a_af.c:173:6: error: result of comparison of constant 256 with expression of type '__u8' (aka 'unsigned char') is always false [-Werror,-Wtautological-constant-out-of-range-compare] if (IS_OUT_OF_BOUNDS(paxel_cfg->height, OMAP3ISP_AF_PAXEL_HEIGHT_MIN, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/media/platform/omap3isp/isph3a_af.c:24:33: note: expanded from macro 'IS_OUT_OF_BOUNDS' (((value) < (min)) || ((value) > (max))) ~~~~~~~ ^ ~~~~~ drivers/media/platform/omap3isp/isph3a_af.c:179:6: error: result of comparison of constant 256 with expression of type '__u8' (aka 'unsigned char') is always false [-Werror,-Wtautological-constant-out-of-range-compare] if (IS_OUT_OF_BOUNDS(paxel_cfg->width, OMAP3ISP_AF_PAXEL_WIDTH_MIN, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/media/platform/omap3isp/isph3a_af.c:24:33: note: expanded from macro 'IS_OUT_OF_BOUNDS' (((value) < (min)) || ((value) > (max))) ~~~~~~~ ^ ~~~~~ 2 errors generated. Use a typecast to avoid such warnings. Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit b61010bc5db5beee0ce0f56c316aae3e5de0bfee Author: Mauro Carvalho Chehab Date: Mon Nov 22 09:08:47 2021 +0000 media: omap3isp: mark isp_isr_dbg as __maybe_unused This function is only used for debugging purposes. When DEBUG is disabled, it becomes unused, causing a clang warning with W=1. Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab commit 5f73dcec407612eb308699a5d8182d70916210b0 Author: Mauro Carvalho Chehab Date: Mon Nov 22 09:07:24 2021 +0000 media: marvell-ccic: drop to_cam() unused function This function is an alias for container_of() that it is currently not used, causing clang warnings. So, drop it. Signed-off-by: Mauro Carvalho Chehab commit 0338d9c2ffc61b3a70d42e469dfba95f88b6a7f9 Author: Mauro Carvalho Chehab Date: Mon Nov 22 09:05:51 2021 +0000 media: cx25840: drop some unused inline functions Solve some clang warnings about unused functions by dropping some time-conversion inline funcs that aren't used anywhere. Signed-off-by: Mauro Carvalho Chehab commit ea28f3f1d2058b03a811c1ac0f8d1de49dee646d Author: Mauro Carvalho Chehab Date: Mon Nov 22 08:59:53 2021 +0000 media: dvb-core: dvb_frontend: address some clang warnings The typecasts at the dvb-core generate clang warnings when W=1 is enabled. The warns are harmless, but they cause the build to break with CONFIG_WERROR, so do the cast on a way that it won't produce warnings anymore. Signed-off-by: Mauro Carvalho Chehab commit a057d92a36faabb66a0305d3e4c17d7a98166932 Author: Mauro Carvalho Chehab Date: Mon Nov 22 08:42:08 2021 +0000 media: mc: drop an unused debug function The gobj_type() function translates the media object type into a name, being useful for debugging purposes. It is currently not used. So, drop it. Signed-off-by: Mauro Carvalho Chehab commit a62d2f710799263709db82f251e30c73886cc3af Author: Mauro Carvalho Chehab Date: Mon Nov 22 08:34:26 2021 +0000 media: stb6100: mark a currently unused function as such The stb6100_normalise_regs() function is not used with current boards, but the driver says that some devices could need it. Ok, we could simply drop it, but as there's a macro to mark unused functions, use it. This should shut up a clang warning. Signed-off-by: Mauro Carvalho Chehab commit 41acd4b03ca9ba9c9a3ab993817112d9b9f7cf44 Author: Heiner Kallweit Date: Fri Nov 19 21:45:54 2021 +0100 i2c: i801: Improve handling of chip-specific feature definitions Reduce source code and code size by defining the chip features statically. Signed-off-by: Heiner Kallweit Reviewed-by: Jean Delvare Tested-by: Jean Delvare Signed-off-by: Wolfram Sang commit 1e1d6582f483a4dba4ea03445e6f2f05d9de5bcf Author: Heiner Kallweit Date: Thu Nov 18 23:58:17 2021 +0100 i2c: i801: Remove i801_set_block_buffer_mode If FEATURE_BLOCK_BUFFER is set then bit SMBAUXCTL_E32B is supported and there's no benefit in reading it back. Origin of this check seems to be 14 yrs ago when people were not completely sure which chip versions support the block buffer mode. Signed-off-by: Heiner Kallweit Reviewed-by: Jean Delvare Tested-by: Jean Delvare Signed-off-by: Wolfram Sang commit effa453168a7eeb8a562ff4edc1dbf9067360a61 Author: Heiner Kallweit Date: Sun Nov 7 22:57:00 2021 +0100 i2c: i801: Don't silently correct invalid transfer size If an invalid block size is provided, reject it instead of silently changing it to a supported value. Especially critical I see the case of a write transfer with block length 0. In this case we have no guarantee that the byte we would write is valid. When silently reducing a read to 32 bytes then we don't return an error and the caller may falsely assume that we returned the full requested data. If this change should break any (broken) caller, then I think we should fix the caller. Signed-off-by: Heiner Kallweit Reviewed-by: Jean Delvare Signed-off-by: Wolfram Sang commit bd2fdedbf2bac27f4a2ac16b84ab9b9e5f67006c Author: Akhil R Date: Thu Nov 25 22:23:44 2021 +0530 i2c: tegra: Add the ACPI support Add support for the ACPI based device registration so that the driver can be also enabled through ACPI table. This does not include the ACPI support for Tegra VI and DVC I2C. Signed-off-by: Akhil R Reviewed-by: Dmitry Osipenko Signed-off-by: Wolfram Sang commit 993c2c89a84e7d9c3c7f6cffe399999d225a9f78 Author: Jacky Bai Date: Fri Nov 26 15:39:56 2021 +0800 dt-bindings: i2c: imx-lpi2c: Add imx8ulp compatible string Add the compatible for i.MX8ULP. Reviewed-by: Dong Aisheng Acked-by: Rob Herring Signed-off-by: Jacky Bai Signed-off-by: Peng Fan Signed-off-by: Wolfram Sang commit 6544bcdb88ceb2fbabb8b43be9bcf470de08dab2 Author: Abel Vesa Date: Wed Nov 10 19:46:54 2021 +0200 dt-bindings: i2c: imx-lpi2c: Add i.MX8DXL compatible match Add i.MX8DXL lpi2c compatible to the bindings documentation. Signed-off-by: Abel Vesa Acked-by: Rob Herring Signed-off-by: Wolfram Sang commit c55526a1c1e133f635b59a9af3a9d84bab939657 Merge: a2fd6f6bc07f5 d58071a8a76d7 Author: Wolfram Sang Date: Mon Nov 29 09:39:23 2021 +0100 Merge branch 'i2c/for-current' into i2c/for-mergewindow commit fafc66387dc069140e52739c0c86c8169d44c2dc Author: Alistair Francis Date: Thu Nov 18 11:27:12 2021 -0800 Input: wacom_i2c - clean up the query device fields Improve the query device fields to be more verbose. Signed-off-by: Alistair Francis Link: https://lore.kernel.org/r/20211118123545.102872-1-alistair@alistair23.me Signed-off-by: Dmitry Torokhov commit b7b2b49e59e301e55d195f0f7088e8dc7031280f Author: Geert Uytterhoeven Date: Sun Nov 28 23:55:29 2021 -0800 Input: palmas-pwrbutton - use bitfield helpers Use the FIELD_PREP() helper, instead of open-coding the same operation. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/f8831b88346b36fc6e01e0910d0db6c94287d2b4.1637593297.git.geert+renesas@glider.be Signed-off-by: Dmitry Torokhov commit 4d012040161cba054208555300d9fdf2b8925c34 Merge: c4bc515d73b52 d58071a8a76d7 Author: Greg Kroah-Hartman Date: Mon Nov 29 08:04:46 2021 +0100 Merge 5.16-rc3 into usb-next We need the USB driver fixes in here as well. Signed-off-by: Greg Kroah-Hartman commit 24cd719712aeb5b5e4562f37ef5f7ba33040b59f Merge: 84c365f8ff8fc d58071a8a76d7 Author: Greg Kroah-Hartman Date: Mon Nov 29 08:03:05 2021 +0100 Merge 5.16-rc3 into staging-next We need the staging driver fixes in here as well. Signed-off-by: Greg Kroah-Hartman commit 5d331b5922551637c586cdf5fdc1778910fc937f Merge: cd455ebb748c4 d58071a8a76d7 Author: Greg Kroah-Hartman Date: Mon Nov 29 08:00:54 2021 +0100 Merge 5.16-rc3 into char-misc-next We need the char/misc fixes in here as well. Signed-off-by: Greg Kroah-Hartman commit af3fdce4ab0781ea183107c90de9cbf21d701c54 Author: Michael Ellerman Date: Mon Nov 29 17:41:52 2021 +1100 Revert "powerpc/code-patching: Improve verification of patchability" This reverts commit 8b8a8f0ab3f5519e45c526f826a655817486c5bb. As reported[1] by Sachin this causes problems with ftrace, and it also causes the code patching selftests to fail as reported[2] by Stephen. So revert it for now. 1: https://lore.kernel.org/linuxppc-dev/3668743C-09DF-4673-B15C-2FFE2A57F7D7@linux.vnet.ibm.com/ 2: https://lore.kernel.org/linuxppc-dev/20211126161747.1f7795b0@canb.auug.org.au/ Signed-off-by: Michael Ellerman commit da61e9e3aeb5b2ba9569a51231b7648a865cdff3 Merge: e32cb12ff52a2 baeead213e67a Author: Andrii Nakryiko Date: Sun Nov 28 22:09:08 2021 -0800 Merge branch 'Support static initialization of BPF_MAP_TYPE_PROG_ARRAY' Hengqi Chen says: ==================== Make libbpf support static initialization of BPF_MAP_TYPE_PROG_ARRAY with a syntax similar to map-in-map initialization: SEC("socket") int tailcall_1(void *ctx) { return 0; } struct { __uint(type, BPF_MAP_TYPE_PROG_ARRAY); __uint(max_entries, 2); __uint(key_size, sizeof(__u32)); __array(values, int (void *)); } prog_array_init SEC(".maps") = { .values = { [1] = (void *)&tailcall_1, }, }; v1->v2: - Add stricter checks on relos collect, some renamings (Andrii) - Update selftest to check tailcall result (Andrii) ==================== Signed-off-by: Andrii Nakryiko commit baeead213e67a9554d589a2845c634b8e473d107 Author: Hengqi Chen Date: Sun Nov 28 22:16:33 2021 +0800 selftests/bpf: Test BPF_MAP_TYPE_PROG_ARRAY static initialization Add testcase for BPF_MAP_TYPE_PROG_ARRAY static initialization. Signed-off-by: Hengqi Chen Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211128141633.502339-3-hengqi.chen@gmail.com commit 341ac5ffc4bd859103899c876902caf07cc97ea4 Author: Hengqi Chen Date: Sun Nov 28 22:16:32 2021 +0800 libbpf: Support static initialization of BPF_MAP_TYPE_PROG_ARRAY Support static initialization of BPF_MAP_TYPE_PROG_ARRAY with a syntax similar to map-in-map initialization ([0]): SEC("socket") int tailcall_1(void *ctx) { return 0; } struct { __uint(type, BPF_MAP_TYPE_PROG_ARRAY); __uint(max_entries, 2); __uint(key_size, sizeof(__u32)); __array(values, int (void *)); } prog_array_init SEC(".maps") = { .values = { [1] = (void *)&tailcall_1, }, }; Here's the relevant part of libbpf debug log showing what's going on with prog-array initialization: libbpf: sec '.relsocket': collecting relocation for section(3) 'socket' libbpf: sec '.relsocket': relo #0: insn #2 against 'prog_array_init' libbpf: prog 'entry': found map 0 (prog_array_init, sec 4, off 0) for insn #0 libbpf: .maps relo #0: for 3 value 0 rel->r_offset 32 name 53 ('tailcall_1') libbpf: .maps relo #0: map 'prog_array_init' slot [1] points to prog 'tailcall_1' libbpf: map 'prog_array_init': created successfully, fd=5 libbpf: map 'prog_array_init': slot [1] set to prog 'tailcall_1' fd=6 [0] Closes: https://github.com/libbpf/libbpf/issues/354 Signed-off-by: Hengqi Chen Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211128141633.502339-2-hengqi.chen@gmail.com commit 8886a579744fbfa53e69aa453ed10ae3b1f9abac Author: Russ Weight Date: Thu Nov 18 17:55:53 2021 -0800 fpga: region: Use standard dev_release for class driver The FPGA region class driver data structure is being treated as a managed resource instead of using the standard dev_release call-back function to release the class data structure. This change removes the managed resource code and combines the create() and register() functions into a single register() or register_full() function. The register_full() function accepts an info data structure to provide flexibility in passing optional parameters. The register() function supports the current parameter list for users that don't require the use of optional parameters. Signed-off-by: Russ Weight Reviewed-by: Xu Yilun Acked-by: Xu Yilun Signed-off-by: Moritz Fischer commit 0d70af3c2530a70f1b2c197feaa63fbd3548ce34 Author: Russ Weight Date: Thu Nov 18 17:55:52 2021 -0800 fpga: bridge: Use standard dev_release for class driver The FPGA bridge class driver data structure is being treated as a managed resource instead of using the standard dev_release call-back function to release the class data structure. This change removes the managed resource code and combines the create() and register() functions into a single register() function. Signed-off-by: Russ Weight Reviewed-by: Xu Yilun Acked-by: Xu Yilun Signed-off-by: Moritz Fischer commit 4ba0b2c294fe691921271372f7b59e5cc2ce4b0f Author: Russ Weight Date: Thu Nov 18 17:55:51 2021 -0800 fpga: mgr: Use standard dev_release for class driver The FPGA manager class driver data structure is being treated as a managed resource instead of using the standard dev_release call-back function to release the class data structure. This change removes the managed resource code for the freeing of the class data structure and combines the create() and register() functions into a single register() or register_full() function. The register_full() function accepts an info data structure to provide flexibility in passing optional parameters. The register() function supports the current parameter list for users that don't require the use of optional parameters. The devm_fpga_mgr_register() function is retained, and the devm_fpga_mgr_register_full() function is added. Signed-off-by: Russ Weight Reviewed-by: Xu Yilun Acked-by: Xu Yilun Signed-off-by: Moritz Fischer commit 75c5bd68b699bbcb6d25879644d62de4da14ab92 Author: Miri Korenblit Date: Fri Nov 26 10:48:19 2021 +0100 ieee80211: change HE nominal packet padding value defines It's easier to use and understand, and to extend for EHT later, if we use the values here instead of the shifted values. Unfortunately, we need to add _POS so that we can use it in places like iwlwifi/mvm where constants are needed. While at it, fix the typo ("NOMIMAL") which also helps catch any conflicts. Signed-off-by: Miri Korenblit Link: https://lore.kernel.org/r/20211126104817.7c29a05b8eb5.I2ca9faf06e177e3035bec91e2ae53c2f91d41774@changeid Signed-off-by: Johannes Berg commit fb8b53acf60bdfcefc5a583ce2946258f8261108 Author: Johannes Berg Date: Thu Sep 30 13:11:32 2021 +0200 cfg80211: use ieee80211_bss_get_elem() instead of _get_ie() Use the structured helper for finding an element instead of the unstructured ieee80211_bss_get_ie(). Link: https://lore.kernel.org/r/20210930131130.e94709f341c3.I4ddb7fcb40efca27987deda7f9a144a5702ebfae@changeid Signed-off-by: Johannes Berg commit 9ac16169b4d4359d3832669bf06aab9e51184828 Author: Emil Renner Berthing Date: Sun Oct 10 16:48:27 2021 +0200 dt-bindings: interrupt-controller: Add StarFive JH7100 plic Add compatible string for StarFive JH7100 plic. Reviewed-by: Geert Uytterhoeven Acked-by: Rob Herring Signed-off-by: Emil Renner Berthing commit 3234d3a1374308615c0cde5e83e52f6b644eaf53 Author: Emil Renner Berthing Date: Sun Oct 10 16:48:27 2021 +0200 dt-bindings: timer: Add StarFive JH7100 clint Add compatible string for the StarFive JH7100 clint. Reviewed-by: Geert Uytterhoeven Acked-by: Rob Herring Signed-off-by: Emil Renner Berthing commit 3d24568b01c5a7a9e88f73f917477b60edb35bfe Author: Emil Renner Berthing Date: Sun Oct 10 16:10:32 2021 +0200 RISC-V: Add StarFive SoC Kconfig option Add StarFive Kconfig option to select SoC specific and common drivers required for these SoCs. Select subsystems required to boot so the required drivers gets enabled by default. Reviewed-by: Geert Uytterhoeven Acked-by: Palmer Dabbelt Signed-off-by: Emil Renner Berthing commit 518380cb54b95c4a17e4bccbcbdd6814d6882b7d Author: Akhil P Oommen Date: Wed Nov 24 13:41:26 2021 -0800 drm/msm/a6xx: Capture gmu log in devcoredump Capture gmu log in coredump to enhance debugging. Signed-off-by: Akhil P Oommen Signed-off-by: Rob Clark Link: https://lore.kernel.org/r/20211124214151.1427022-2-robdclark@gmail.com Signed-off-by: Rob Clark commit 7c0ffcd40b161f56a7cea585297d64aeaf4d44a9 Author: Rob Clark Date: Sat Nov 20 12:01:03 2021 -0800 drm/msm/gpu: Respect PM QoS constraints Re-work the boost and idle clamping to use PM QoS requests instead, so they get aggreggated with other requests (such as cooling device). This does have the minor side-effect that devfreq sysfs min_freq/ max_freq files now reflect the boost and idle clamping, as they show (despite what they are documented to show) the aggregated min/max freq. Fixing that in devfreq does not look straightforward after considering that OPPs can be dynamically added/removed. However writes to the sysfs files still behave as expected. v2: Use 64b math to avoid potential 32b overflow Signed-off-by: Rob Clark Link: https://lore.kernel.org/r/20211120200103.1051459-3-robdclark@gmail.com Signed-off-by: Rob Clark commit 2a1ac5ba9080d4e86e597fb287f6992a9511b90c Author: Akhil P Oommen Date: Thu Nov 18 15:50:29 2021 +0530 drm/msm: Increase gpu boost interval Currently, we boost gpu freq after 25ms of inactivity. This regresses some of the 30 fps usecases where the workload on gpu (at 33ms internval) is very small which it can finish at the lowest OPP before the deadline. Lets increase this inactivity threshold to 50ms (same as the current devfreq interval) to fix this. Signed-off-by: Akhil P Oommen Link: https://lore.kernel.org/r/20211118154903.1.I2ed37cd8ad45a5a94d9de53330f973a62bd1fb29@changeid Signed-off-by: Rob Clark commit 8b9af498a0f7609f683650e53d9a81b2cbdb0ee3 Author: Rob Clark Date: Mon Nov 15 11:15:10 2021 -0800 drm/msm/adreno: Name the shadow buffer This was the one GPU related kernel buffer which was not given a debug name. Let's fix that. Signed-off-by: Rob Clark Link: https://lore.kernel.org/r/20211115191514.310472-1-robdclark@gmail.com Signed-off-by: Rob Clark commit 5edf2750d998b7767daffe66c7f7476227df908a Author: Rob Clark Date: Tue Nov 9 10:11:05 2021 -0800 drm/msm: Add debugfs to disable hw err handling Add a debugfs interface to ignore hw error irqs, in order to force fallback to sw hangcheck mechanism. Because the hw error detection is pretty good on newer gens, we need this for igt tests to test the sw hang detection. Signed-off-by: Rob Clark Reviewed-by: Akhil P Oommen Link: https://lore.kernel.org/r/20211109181117.591148-6-robdclark@gmail.com Signed-off-by: Rob Clark commit 5f3aee4ceb5b8607e9a4b752c2547667200e19e2 Author: Rob Clark Date: Tue Nov 9 10:11:04 2021 -0800 drm/msm: Handle fence rollover Add some helpers for fence comparision, which handle rollover properly, and stop open coding fence seqno comparisions. Signed-off-by: Rob Clark Reviewed-by: Akhil P Oommen Link: https://lore.kernel.org/r/20211109181117.591148-5-robdclark@gmail.com Signed-off-by: Rob Clark commit c28e2f2b417ed747bfbc5f900c87f3ec9cc6b25e Author: Rob Clark Date: Tue Nov 9 10:11:03 2021 -0800 drm/msm: Remove struct_mutex usage The remaining struct_mutex usage is just to serialize various gpu related things (submit/retire/recover/fault/etc), so replace struct_mutex with gpu->lock. Signed-off-by: Rob Clark Link: https://lore.kernel.org/r/20211109181117.591148-4-robdclark@gmail.com Signed-off-by: Rob Clark commit 1d054c9b8457b56a651109fac21f56f46ccd46b2 Author: Rob Clark Date: Tue Nov 9 10:11:02 2021 -0800 drm/msm: Drop priv->lastctx cur_ctx_seqno already does the same thing, but handles the edge cases where a refcnt'd context can live after lastclose. So let's not have two ways to do the same thing. Signed-off-by: Rob Clark Reviewed-by: Akhil P Oommen Link: https://lore.kernel.org/r/20211109181117.591148-3-robdclark@gmail.com Signed-off-by: Rob Clark commit d8c00a81f11fefc25e27cd5b0bfc0092b02d722d Author: Rob Clark Date: Tue Nov 9 10:11:01 2021 -0800 drm/msm: Remove unnecessary struct_mutex The struct_mutex locking is a remnant from the days before per-obj locks, and no longer needed. Signed-off-by: Rob Clark Link: https://lore.kernel.org/r/20211109181117.591148-2-robdclark@gmail.com Signed-off-by: Rob Clark commit 4cef29b64eba5ac9909a072c797199714cdfb3eb Author: Dmitry Baryshkov Date: Thu Nov 4 03:34:28 2021 +0300 drm/msm/mdp5: drop vdd regulator The "vdd" regulator was used by the mdp5 driver only on downstream kernels, where the GDSC is represented as a regulator. On all current kernels the MDSS_GDSC is implemented as the power domain, removing the need for this regulator. Remove it from the mdp5 driver. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211104003428.2205497-1-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 016aa55082c2dd16e438e18e23f8bd8a67f30d84 Author: Sankeerth Billakanti Date: Tue Nov 2 13:18:45 2021 +0530 drm/msm/dp: Enable ASSR for supported DP sinks The eDP sink on sc7280 supports ASSR and dp driver will enable ASSR in the source hardware. The driver needs to enable the ASSR field in the DPCD configuration register to avoid screen corruption. This change will enable ASSR if supported in the sink device. Signed-off-by: Sankeerth Billakanti Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/1635839325-401-6-git-send-email-quic_sbillaka@quicinc.com Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 34f3b16575d1c371399ba8e2724d2bd67f75a0f5 Author: Sankeerth Billakanti Date: Tue Nov 2 13:18:44 2021 +0530 drm/msm/dp: Enable downspread for supported DP sinks The sc7280 eDP sink that supports downspread will fail link training if source does not enable SSC / downspread. This change will set the downspread bit in the DP sink if supported and indicate SSC support to the DP PHY driver. Signed-off-by: Sankeerth Billakanti Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/1635839325-401-5-git-send-email-quic_sbillaka@quicinc.com Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 447a39f4e89d992f82f03521d46746f6a4348578 Author: Sankeerth Billakanti Date: Tue Nov 2 13:18:43 2021 +0530 drm/dp: Add macro to check max_downspread capability Add a macro to check for the max_downspread capability in drm_dp_helper. Signed-off-by: Sankeerth Billakanti Reviewed-by: Stephen Boyd changes in v4: - Return 1 for DPCD version >= v1.1 (Stephen Boyd) Link: https://lore.kernel.org/r/1635839325-401-4-git-send-email-quic_sbillaka@quicinc.com Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit ef7837ff091c8805cfa18d2ad06c2e5f4d820a7e Author: Sankeerth Billakanti Date: Tue Nov 2 13:18:42 2021 +0530 drm/msm/dp: Add DP controllers for sc7280 The eDP controller on SC7280 is similar to the eDP/DP controllers supported by the current driver implementation. SC7280 supports one EDP and one DP controller which can operate concurrently. This change adds the support for eDP and DP controller on sc7280. Signed-off-by: Sankeerth Billakanti changes in v3: - Split into patches according to function (Dmitry Baryshkov) - Use DP_CONTROLLER_1 for eDP controller intf (Dmitry Baryshkov) - Use DP_CONTROLLER_0 for sc7280-dp (Dmitry Baryshkov) - Add macro in drm_helper.h for checking ssc capability (Stephen Boyd) - Use existing macro to check assr capability (Stephen Boyd) - Add comment for HPD_INIT_SETUP delay (Stephen Boyd) changes in v2: - Don't initialize variables to 0 (Stephen Boyd) - Use const for read-only dpcd (Stephen Boyd) - Remove zero pixel clock check (Stephen Boyd) - Sort compatible strings alphabetically (Stephen Boyd) - Use pwm_bl.c for backlight instead of gpio (Stephen Boyd) - Change return type for functions returning always 0 (Matthias Kaehlcke) Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/1635839325-401-3-git-send-email-quic_sbillaka@quicinc.com Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 0a697b9cc54cd1850349445896450d64bc2fe1e7 Author: Sankeerth Billakanti Date: Tue Nov 2 13:18:41 2021 +0530 dt-bindings: msm/dp: Add DP compatible strings for sc7280 The Qualcomm SC7280 platform supports one eDP controller and a DP controller. This change will add the compatible string for both eDP and DP to msm dp-controller binding. Signed-off-by: Sankeerth Billakanti changes in v3: - Modify the subject (Doug Anderson) - Add sc7280-dp also to the list (Stephen Boyd) changes in v2: - Sort alphabetically (Stephen Boyd) - Cleanup residual stale changes in the patch (Matthias Kaehlcke) - Modify the subject (Doug Anderson) Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/1635839325-401-2-git-send-email-quic_sbillaka@quicinc.com Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 9b077c1581cf57206f5f7788ea569e8fae0719a7 Author: Dmitry Baryshkov Date: Wed Oct 6 23:48:28 2021 +0300 drm/msm/dsi: stop setting clock parents manually There is no reason to set clock parents manually, use device tree to assign DSI/display clock parents to DSI PHY clocks. Dropping this manual setup allows us to drop repeating code and to move registration of hw clock providers to generic place. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20211006204828.1218225-2-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit a817a950de78fd7f11a322d102647fdc879d5bc3 Author: Dmitry Baryshkov Date: Wed Oct 6 23:48:27 2021 +0300 drm/msm/dsi: untangle cphy setting from the src pll setting Move DPHY/CPHY setting from msm_dsi_host_set_src_pll() to new function msm_dsi_host_set_phy_mode(). Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20211006204828.1218225-1-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 76c82ebc495944a32c8c2450f263ab063d4ab774 Author: Dmitry Baryshkov Date: Fri Oct 1 19:50:11 2021 +0300 dt-bindings: display/msm: remove edp.txt eDP driver is being removed, so drop bindings description. Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20211001165011.441945-4-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 0a26daaacf0db650ed96416dc0b2e09f8f69c854 Author: Dmitry Baryshkov Date: Fri Oct 1 19:50:10 2021 +0300 drm/msm/edp: drop old eDP support MSM DRM driver has support for eDP block present on MSM 8x74/8x84 SoC families. However since addition back in 2015 this driver received only generic fixes. No actual devices with these SoCs supported upstream (or by the community) seem to support eDP panels. Judging from downstream kernels the eDP was present only on MSM8974 LIQUID or on APQ8084 CDP. Remove this driver. Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20211001165011.441945-3-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov [rob: Rebased on "drm: msm: fix building without CONFIG_COMMON_CLK"] Signed-off-by: Rob Clark commit 9ab3d27113b1dc6300ec7beea2510c29b9bddc9e Author: Dmitry Baryshkov Date: Fri Oct 1 19:50:09 2021 +0300 drm/msm/mdp5: drop eDP support Prepare for removing old eDP support present in 8x74/8x84 SoC families. No devices present in mainline support eDP ports. Signed-off-by: Dmitry Baryshkov Link: https://lore.kernel.org/r/20211001165011.441945-2-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 6504f80fe665d64182fd85a1a36ead9828e3f591 Author: Dmitry Baryshkov Date: Thu Sep 30 17:00:01 2021 +0300 drm/msm/dpu: don't cache pipe->cap->sblk in dpu_plane Do not cache hw_pipe's sblk in dpu_plane. Use pdpu->pipe_hw->cap->sblk directly. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20210930140002.308628-11-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 701a21ec02e40e69357214a61fb9fb52dad58ad1 Author: Dmitry Baryshkov Date: Thu Sep 30 17:00:00 2021 +0300 drm/msm/dpu: don't cache pipe->cap->features in dpu_plane Do not cache hw_pipe's features in dpu_plane. Use pdpu->pipe_hw->cap->features directly. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20210930140002.308628-10-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 51cb5808b0d948606030c5f09d61808457c08932 Author: Dmitry Baryshkov Date: Thu Sep 30 16:59:59 2021 +0300 drm/msm/dpu: remove dpu_hw_pipe_cdp_cfg from dpu_plane Remove struct dpu_hw_pipe_cdp_cfg instance from dpu_plane, it is an interim configuration structure. Allocate it on stack instead. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20210930140002.308628-9-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit fda201a9738d37c4d1d578e1665ff34db2633b3f Author: Dmitry Baryshkov Date: Thu Sep 30 16:59:58 2021 +0300 drm/msm/dpu: drop dpu_csc_cfg from dpu_plane Simplify code surrounding CSC table setup by removing struct dpu_csc_cfg pointer from dpu_plane and getting it directly at the CSC setup time. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20210930140002.308628-8-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 0782bdc4b2d00b83c42de68b0b04e180c1feead7 Author: Dmitry Baryshkov Date: Thu Sep 30 16:59:56 2021 +0300 drm/msm/dpu: move dpu_hw_pipe_cfg out of struct dpu_plane struct dpu_hw_pipe_cfg represents an interim state during atomic update/color fill, so move it out of struct dpu_plane. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20210930140002.308628-6-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 53c064a1ab05780c4e00af51f392023fae4b10cc Author: Dmitry Baryshkov Date: Thu Sep 30 16:59:55 2021 +0300 drm/msm/dpu: remove stage_cfg from struct dpu_crtc The stage_cfg is not used outside of _dpu_crtc_blend_setup(), so remove the temporary config from global struct. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20210930140002.308628-5-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 92709c02c93bcc515740cc916b7bc4fe6f1218f6 Author: Dmitry Baryshkov Date: Thu Sep 30 16:59:54 2021 +0300 drm/msm/dpu: drop pipe_name from struct dpu_plane Use plane->name instead of artificial pipe_name. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20210930140002.308628-4-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit b243c8c0156dd28ca8972b88b67a2e3bca768493 Author: Dmitry Baryshkov Date: Thu Sep 30 16:59:53 2021 +0300 drm/msm/dpu: remove pipe_qos_cfg from struct dpu_plane The pipe_qos_cfg is used only in _dpu_plane_set_qos_ctrl(), so remove it from the dpu_plane struct and allocate it on stack when necessary. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20210930140002.308628-3-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 44aab22d4dd2610635f92bb699444d3ae82ab806 Author: Dmitry Baryshkov Date: Thu Sep 30 16:59:52 2021 +0300 drm/msm/dpu: move LUT levels out of QOS config LUT levels are setup outside of setup_qos_ctrl, so remove them from the struct dpu_hw_pipe_qos_cfg. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20210930140002.308628-2-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov Signed-off-by: Rob Clark commit 69d846126e1653ca9043c3766c66684132586941 Author: Javier Martinez Canillas Date: Sat Nov 27 20:19:10 2021 +0100 drm: Fix build error caused by missing drm_nomodeset.o The patch for commit 6a2d2ddf2c34 ("drm: Move nomodeset kernel parameter to the DRM subsystem") was generated with config 'diff.noprefix true'. But later was applied using 'cat nomodeset.mbox | dim apply-branch' on a machine with 'diff.noprefix false'. And command 'git am --scissors -3' as used by the dim tool doesn't handle that case well, since the 3-way merge wrongly resolves the path for new file drivers/gpu/drm/drm_nomodeset.c as gpu/drm/drm_nomodeset.c instead. It led to the following build error as reported by the kernel test robot: make[4]: *** No rule to make target 'drivers/gpu/drm/drm_nomodeset.o', needed by 'drivers/gpu/drm/built-in.a'. Fixes: 6a2d2ddf2c34 ("drm: Move nomodeset kernel parameter to the DRM subsystem") Reported-by: kernel test robot Signed-off-by: Javier Martinez Canillas Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20211127191910.709356-1-javierm@redhat.com commit 1d9b750c92d738cb84eb1531dd85147466202b86 Author: Andriy Tryshnivskyy Date: Fri Nov 5 12:05:01 2021 +0200 iio: test: Add test for IIO_VAL_INT_64. Add test for newly introduced type IIO_VAL_INT_64. Signed-off-by: Andriy Tryshnivskyy Reported-by: kernel test robot Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211105100501.1904-3-andriy.tryshnivskyy@opensynergy.com Signed-off-by: Jonathan Cameron commit ee8ec048e091bfe36cc463e7a30eefbe5fef3e75 Author: Andriy Tryshnivskyy Date: Fri Nov 5 12:05:00 2021 +0200 iio: test: Add check against NULL for buffer in tests. Add KUNIT_ASSERT_NOT_ERR_OR_NULL(test, buf) for every test. Also use ARRAY_SIZE(values) where it is possible. Signed-off-by: Andriy Tryshnivskyy Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211105100501.1904-2-andriy.tryshnivskyy@opensynergy.com Signed-off-by: Jonathan Cameron commit ffc7c5172a6d1f7ec468066a7172ce65baf1e3e1 Author: Antoniu Miclaus Date: Fri Nov 19 10:56:27 2021 +0200 iio: expose shared parameter in IIO_ENUM_AVAILABLE The shared parameter should be configurable based on its usage, and not constrained to IIO_SHARED_BY_TYPE. This patch aims to improve the flexibility in using the IIO_ENUM_AVAILABLE define and avoid redefining custom iio enums that expose the shared parameter. An example is the ad5766.c driver where IIO_ENUM_AVAILABLE_SHARED was defined in order to achieve `shared` parameter customization. The current state of the IIO_ENUM_AVAILABLE implementation will imply similar redefinitions each time a driver will require access to the `shared` parameter. An example would be admv1013 driver which will require custom device attribute for the frequency translation modes: Quadrature I/Q mode and Intermediate Frequency mode. Signed-off-by: Antoniu Miclaus Reviewed-by: Alexandru Ardelean Link: https://lore.kernel.org/r/20211119085627.6348-1-antoniu.miclaus@analog.com Signed-off-by: Jonathan Cameron commit ab1fb45579d876aee70eb736d3d9e6a9bacc798d Author: Paul Cercueil Date: Mon Nov 15 14:19:13 2021 +0000 iio: buffer-dma: Use round_down() instead of rounddown() We know that the buffer's alignment will always be a power of two; therefore, we can use the faster round_down() macro. Signed-off-by: Paul Cercueil Reviewed-by: Alexandru Ardelean Link: https://lore.kernel.org/r/20211115141925.60164-4-paul@crapouillou.net Signed-off-by: Jonathan Cameron commit ed14e769f64311769dcf20dde544b82c158d01b1 Author: Paul Cercueil Date: Mon Nov 15 14:19:12 2021 +0000 iio: buffer-dma: Remove unused iio_buffer_block struct This structure was never used anywhere, so it can safely be dropped. It will later be re-introduced as a different structure in a different header. Signed-off-by: Paul Cercueil Reviewed-by: Alexandru Ardelean Link: https://lore.kernel.org/r/20211115141925.60164-3-paul@crapouillou.net Signed-off-by: Jonathan Cameron commit db08490fc4b6695ada6c21e40343307f08d9620e Author: Javier Martinez Canillas Date: Fri Nov 12 14:32:30 2021 +0100 drm: Make the nomodeset message less sensational The message printed when nomodeset is present in the kernel command line makes it look as if the parameter must never be used and it's a bad idea. But there are valid reasons to use this parameter and the message should not imply otherwise. Change the text to be more accurate and restrained. Suggested-by: Thomas Zimmermann Signed-off-by: Javier Martinez Canillas Acked-by: Thomas Zimmermann Acked-by: Jani Nikula Acked-by: Pekka Paalanen Link: https://patchwork.freedesktop.org/patch/msgid/20211112133230.1595307-7-javierm@redhat.com commit b22a15a5aca34c8f59b770f858b1c21d347175e0 Author: Javier Martinez Canillas Date: Fri Nov 12 14:32:29 2021 +0100 Documentation/admin-guide: Document nomodeset kernel parameter The nomodeset kernel command line parameter is not documented. Its name is quite vague and is not intuitive what's the behaviour when it is set. Document in kernel-parameters.txt what actually happens when nomodeset is used. That way, users could know if they want to enable this option. Signed-off-by: Javier Martinez Canillas Acked-by: Thomas Zimmermann Acked-by: Jani Nikula Acked-by: Pekka Paalanen Link: https://patchwork.freedesktop.org/patch/msgid/20211112133230.1595307-6-javierm@redhat.com commit e9aeeba26a8de1f553305722d017022ae7e79280 Author: Javier Martinez Canillas Date: Fri Nov 12 14:32:28 2021 +0100 drm: Decouple nomodeset from CONFIG_VGA_CONSOLE This relationship was only for historical reasons and the nomodeset option should be available even on platforms that don't enable CONFIG_VGA_CONSOLE. Suggested-by: Thomas Zimmermann Signed-off-by: Javier Martinez Canillas Acked-by: Thomas Zimmermann Acked-by: Jani Nikula Acked-by: Pekka Paalanen Link: https://patchwork.freedesktop.org/patch/msgid/20211112133230.1595307-5-javierm@redhat.com commit 6a2d2ddf2c345e0149bfbffdddc4768a9ab0a741 Author: Javier Martinez Canillas Date: Fri Nov 12 14:32:27 2021 +0100 drm: Move nomodeset kernel parameter to the DRM subsystem The "nomodeset" kernel cmdline parameter is handled by the vgacon driver but the exported vgacon_text_force() symbol is only used by DRM drivers. It makes much more sense for the parameter logic to be in the subsystem of the drivers that are making use of it. Let's move the vgacon_text_force() function and related logic to the DRM subsystem. While doing that, rename it to drm_firmware_drivers_only() and make it return true if "nomodeset" was used and false otherwise. This is a better description of the condition that the drivers are testing for. Suggested-by: Daniel Vetter Signed-off-by: Javier Martinez Canillas Acked-by: Thomas Zimmermann Acked-by: Jani Nikula Acked-by: Pekka Paalanen Acked-by: Greg Kroah-Hartman Link: https://patchwork.freedesktop.org/patch/msgid/20211112133230.1595307-4-javierm@redhat.com commit d76f25d66ec83a8166f0c0be79bbb039d66062d0 Author: Javier Martinez Canillas Date: Fri Nov 12 14:32:26 2021 +0100 drm/vboxvideo: Drop CONFIG_VGA_CONSOLE guard to call vgacon_text_force() It is already handled by the console.h macro since a stub inline function is defined for vgacon_text_force() if CONFIG_VGA_CONSOLE is not set. There's no need to have ifdefery in the driver when calling the function. Signed-off-by: Javier Martinez Canillas Acked-by: Thomas Zimmermann Acked-by: Jani Nikula Acked-by: Pekka Paalanen Link: https://patchwork.freedesktop.org/patch/msgid/20211112133230.1595307-3-javierm@redhat.com commit 35f7775f81bf8147b5b8b11958e15c0cc364b7c0 Author: Javier Martinez Canillas Date: Fri Nov 12 14:32:25 2021 +0100 drm: Don't print messages if drivers are disabled due nomodeset The nomodeset kernel parameter handler already prints a message that the DRM drivers will be disabled, so there's no need for drivers to do that. Suggested-by: Thomas Zimmermann Signed-off-by: Javier Martinez Canillas Acked-by: Thomas Zimmermann Acked-by: Jani Nikula Acked-by: Pekka Paalanen Link: https://patchwork.freedesktop.org/patch/msgid/20211112133230.1595307-2-javierm@redhat.com commit 2043727c2882928a10161ddee52b196b7db402fd Author: Cai Huoqing Date: Fri Nov 5 15:15:09 2021 +0800 driver core: platform: Make use of the helper function dev_err_probe() When possible using dev_err_probe() helps to properly deal with the PROBE_DEFER error, the benefit is that DEFER issue will be logged in the devices_deferred debugfs file. Signed-off-by: Cai Huoqing Link: https://lore.kernel.org/r/20211105071509.969-1-caihuoqing@baidu.com Signed-off-by: Greg Kroah-Hartman commit a6914afcdf0e3fb853fce0e0c04710be7427b62f Author: Andy Shevchenko Date: Wed Nov 10 12:31:28 2021 +0200 kobject: Replace kernel.h with the necessary inclusions When kernel.h is used in the headers it adds a lot into dependency hell, especially when there are circular dependencies are involved. Replace kernel.h inclusion with the list of what is really being used. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211110103128.59888-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman commit d40ce48cb3a68b54be123a1f99157c5ac613e260 Merge: 442b03c32ca10 9acbc584c3a4e Author: Jakub Kicinski Date: Fri Nov 26 18:02:02 2021 -0800 Merge branch 'af_unix-replace-unix_table_lock-with-per-hash-locks' Kuniyuki Iwashima says: ==================== af_unix: Replace unix_table_lock with per-hash locks. The hash table of AF_UNIX sockets is protected by a single big lock, unix_table_lock. This series replaces it with small per-hash locks. 1st - 2nd : Misc refactoring 3rd - 8th : Separate BSD/abstract address logics 9th - 11th : Prep to save a hash in each socket 12th : Replace the big lock 13th : Speed up autobind() Note to maintainers: The 12th patch adds two kinds of Sparse warnings on patchwork: about unix_table_double_lock/unlock() We can avoid this by adding two apparent acquires/releases annotations, but there are the same kinds of warnings about unix_state_double_lock(). about unix_next_socket() and unix_seq_stop() (/proc/net/unix) This is because Sparse does not understand logic in unix_next_socket(), which leaves a spin lock held until it returns NULL. Also, tcp_seq_stop() causes a warning for the same reason. These warnings seem reasonable, but let me know if there is any better way. Please see [0] for details. [0]: https://lore.kernel.org/netdev/20211117001611.74123-1-kuniyu@amazon.co.jp/ ==================== Link: https://lore.kernel.org/r/20211124021431.48956-1-kuniyu@amazon.co.jp Signed-off-by: Jakub Kicinski commit 9acbc584c3a4e9706703039708ec947ffc152c66 Author: Kuniyuki Iwashima Date: Wed Nov 24 11:14:31 2021 +0900 af_unix: Relax race in unix_autobind(). When we bind an AF_UNIX socket without a name specified, the kernel selects an available one from 0x00000 to 0xFFFFF. unix_autobind() starts searching from a number in the 'static' variable and increments it after acquiring two locks. If multiple processes try autobind, they obtain the same lock and check if a socket in the hash list has the same name. If not, one process uses it, and all except one end up retrying the _next_ number (actually not, it may be incremented by the other processes). The more we autobind sockets in parallel, the longer the latency gets. We can avoid such a race by searching for a name from a random number. These show latency in unix_autobind() while 64 CPUs are simultaneously autobind-ing 1024 sockets for each. Without this patch: usec : count distribution 0 : 1176 |*** | 2 : 3655 |*********** | 4 : 4094 |************* | 6 : 3831 |************ | 8 : 3829 |************ | 10 : 3844 |************ | 12 : 3638 |*********** | 14 : 2992 |********* | 16 : 2485 |******* | 18 : 2230 |******* | 20 : 2095 |****** | 22 : 1853 |***** | 24 : 1827 |***** | 26 : 1677 |***** | 28 : 1473 |**** | 30 : 1573 |***** | 32 : 1417 |**** | 34 : 1385 |**** | 36 : 1345 |**** | 38 : 1344 |**** | 40 : 1200 |*** | With this patch: usec : count distribution 0 : 1855 |****** | 2 : 6464 |********************* | 4 : 9936 |******************************** | 6 : 12107 |****************************************| 8 : 10441 |********************************** | 10 : 7264 |*********************** | 12 : 4254 |************** | 14 : 2538 |******** | 16 : 1596 |***** | 18 : 1088 |*** | 20 : 800 |** | 22 : 670 |** | 24 : 601 |* | 26 : 562 |* | 28 : 525 |* | 30 : 446 |* | 32 : 378 |* | 34 : 337 |* | 36 : 317 |* | 38 : 314 |* | 40 : 298 | | Signed-off-by: Kuniyuki Iwashima Signed-off-by: Jakub Kicinski commit afd20b9290e184c203fe22f2d6b80dc7127ba724 Author: Kuniyuki Iwashima Date: Wed Nov 24 11:14:30 2021 +0900 af_unix: Replace the big lock with small locks. The hash table of AF_UNIX sockets is protected by the single lock. This patch replaces it with per-hash locks. The effect is noticeable when we handle multiple sockets simultaneously. Here is a test result on an EC2 c5.24xlarge instance. It shows latency (under 10us only) in unix_insert_unbound_socket() while 64 CPUs creating 1024 sockets for each in parallel. Without this patch: nsec : count distribution 0 : 179 | | 500 : 3021 |********* | 1000 : 6271 |******************* | 1500 : 6318 |******************* | 2000 : 5828 |***************** | 2500 : 5124 |*************** | 3000 : 4426 |************* | 3500 : 3672 |*********** | 4000 : 3138 |********* | 4500 : 2811 |******** | 5000 : 2384 |******* | 5500 : 2023 |****** | 6000 : 1954 |***** | 6500 : 1737 |***** | 7000 : 1749 |***** | 7500 : 1520 |**** | 8000 : 1469 |**** | 8500 : 1394 |**** | 9000 : 1232 |*** | 9500 : 1138 |*** | 10000 : 994 |*** | With this patch: nsec : count distribution 0 : 1634 |**** | 500 : 13170 |****************************************| 1000 : 13156 |*************************************** | 1500 : 9010 |*************************** | 2000 : 6363 |******************* | 2500 : 4443 |************* | 3000 : 3240 |********* | 3500 : 2549 |******* | 4000 : 1872 |***** | 4500 : 1504 |**** | 5000 : 1247 |*** | 5500 : 1035 |*** | 6000 : 889 |** | 6500 : 744 |** | 7000 : 634 |* | 7500 : 498 |* | 8000 : 433 |* | 8500 : 355 |* | 9000 : 336 |* | 9500 : 284 | | 10000 : 243 | | Signed-off-by: Kuniyuki Iwashima Signed-off-by: Jakub Kicinski commit e6b4b873896f0e9298f70d25726f4bb1e1b265ba Author: Kuniyuki Iwashima Date: Wed Nov 24 11:14:29 2021 +0900 af_unix: Save hash in sk_hash. To replace unix_table_lock with per-hash locks in the next patch, we need to save a hash in each socket because /proc/net/unix or BPF prog iterate sockets while holding a hash table lock and release it later in a different function. Currently, we store a real/pseudo hash in struct unix_address. However, we do not allocate it to unbound sockets, nor should we do just for that. For this purpose, we can use sk_hash. Then, we no longer use the hash field in struct unix_address and can remove it. Also, this patch does - rename unix_insert_socket() to unix_insert_unbound_socket() - remove the redundant list argument from __unix_insert_socket() and unix_insert_unbound_socket() - use 'unsigned int' instead of 'unsigned' in __unix_set_addr_hash() - remove 'inline' from unix_remove_socket() and unix_insert_unbound_socket(). Signed-off-by: Kuniyuki Iwashima Signed-off-by: Jakub Kicinski commit f452be496a5c8f58b1a67cde79e89b9f1cfde31c Author: Kuniyuki Iwashima Date: Wed Nov 24 11:14:28 2021 +0900 af_unix: Add helpers to calculate hashes. This patch adds three helper functions that calculate hashes for unbound sockets and bound sockets with BSD/abstract addresses. Signed-off-by: Kuniyuki Iwashima Signed-off-by: Jakub Kicinski commit 5ce7ab4961a9320ca0836e06849210d088723a56 Author: Kuniyuki Iwashima Date: Wed Nov 24 11:14:27 2021 +0900 af_unix: Remove UNIX_ABSTRACT() macro and test sun_path[0] instead. In BSD and abstract address cases, we store sockets in the hash table with keys between 0 and UNIX_HASH_SIZE - 1. However, the hash saved in a socket varies depending on its address type; sockets with BSD addresses always have UNIX_HASH_SIZE in their unix_sk(sk)->addr->hash. This is just for the UNIX_ABSTRACT() macro used to check the address type. The difference of the saved hashes comes from the first byte of the address in the first place. So, we can test it directly. Then we can keep a real hash in each socket and replace unix_table_lock with per-hash locks in the later patch. Signed-off-by: Kuniyuki Iwashima Signed-off-by: Jakub Kicinski commit 12f21c49ad83eba93d0485b8c9edcc28201bee93 Author: Kuniyuki Iwashima Date: Wed Nov 24 11:14:26 2021 +0900 af_unix: Allocate unix_address in unix_bind_(bsd|abstract)(). To terminate address with '\0' in unix_bind_bsd(), we add unix_create_addr() and call it in unix_bind_bsd() and unix_bind_abstract(). Also, unix_bind_abstract() does not return -EEXIST. Only kern_path_create() and vfs_mknod() in unix_bind_bsd() can return it, so we move the last error check in unix_bind() to unix_bind_bsd(). Signed-off-by: Kuniyuki Iwashima Signed-off-by: Jakub Kicinski commit 5c32a3ed64b4c87ed6d9978074db5f0a54c4cd20 Author: Kuniyuki Iwashima Date: Wed Nov 24 11:14:25 2021 +0900 af_unix: Remove unix_mkname(). This patch removes unix_mkname() and postpones calculating a hash to unix_bind_abstract(). Some BSD stuffs still remain in unix_bind() though, the next patch packs them into unix_bind_bsd(). Signed-off-by: Kuniyuki Iwashima Signed-off-by: Jakub Kicinski commit d2d8c9fddb1c11ccfa73bf0ad2b1e6b4ea7afdaf Author: Kuniyuki Iwashima Date: Wed Nov 24 11:14:24 2021 +0900 af_unix: Copy unix_mkname() into unix_find_(bsd|abstract)(). We should not call unix_mkname() before unix_find_other() and instead do the same thing where necessary based on the address type: - terminating the address with '\0' in unix_find_bsd() - calculating the hash in unix_find_abstract(). Signed-off-by: Kuniyuki Iwashima Signed-off-by: Jakub Kicinski commit b8a58aa6fccc5b2940f0da18c7f02e8a1deb693a Author: Kuniyuki Iwashima Date: Wed Nov 24 11:14:23 2021 +0900 af_unix: Cut unix_validate_addr() out of unix_mkname(). unix_mkname() tests socket address length and family and does some processing based on the address type. It is called in the early stage, and therefore some instructions are redundant and can end up in vain. The address length/family tests are done twice in unix_bind(). Also, the address type is rechecked later in unix_bind() and unix_find_other(), where we can do the same processing. Moreover, in the BSD address case, the hash is set to 0 but never used and confusing. This patch moves the address tests out of unix_mkname(), and the following patches move the other part into appropriate places and remove unix_mkname() finally. Signed-off-by: Kuniyuki Iwashima Signed-off-by: Jakub Kicinski commit aed26f557bbc94f0c778f63d7dfe86af99208f68 Author: Kuniyuki Iwashima Date: Wed Nov 24 11:14:22 2021 +0900 af_unix: Return an error as a pointer in unix_find_other(). We can return an error as a pointer and need not pass an additional argument to unix_find_other(). Signed-off-by: Kuniyuki Iwashima Signed-off-by: Jakub Kicinski commit fa39ef0e472961baef49ddb0e6f7b8ebb555bd8f Author: Kuniyuki Iwashima Date: Wed Nov 24 11:14:21 2021 +0900 af_unix: Factorise unix_find_other() based on address types. As done in the commit fa42d910a38e ("unix_bind(): take BSD and abstract address cases into new helpers"), this patch moves BSD and abstract address cases from unix_find_other() into unix_find_bsd() and unix_find_abstract(). Signed-off-by: Kuniyuki Iwashima Signed-off-by: Jakub Kicinski commit f7ed31f4615f4e1d97c0e4325c5b8a240e10073c Author: Kuniyuki Iwashima Date: Wed Nov 24 11:14:20 2021 +0900 af_unix: Pass struct sock to unix_autobind(). We do not use struct socket in unix_autobind() and pass struct sock to unix_bind_bsd() and unix_bind_abstract(). Let's pass it to unix_autobind() as well. Also, this patch fixes these errors by checkpatch.pl. ERROR: do not use assignment in if condition #1795: FILE: net/unix/af_unix.c:1795: + if (test_bit(SOCK_PASSCRED, &sock->flags) && !u->addr CHECK: Logical continuations should be on the previous line #1796: FILE: net/unix/af_unix.c:1796: + if (test_bit(SOCK_PASSCRED, &sock->flags) && !u->addr + && (err = unix_autobind(sock)) != 0) Signed-off-by: Kuniyuki Iwashima Signed-off-by: Jakub Kicinski commit 755662ce78d14c1a9118df921c528b1f992ded2e Author: Kuniyuki Iwashima Date: Wed Nov 24 11:14:19 2021 +0900 af_unix: Use offsetof() instead of sizeof(). The length of the AF_UNIX socket address contains an offset to the member sun_path of struct sockaddr_un. Currently, the preceding member is just sun_family, and its type is sa_family_t and resolved to short. Therefore, the offset is represented by sizeof(short). However, it is not clear and fragile to changes in struct sockaddr_storage or sockaddr_un. This commit makes it clear and robust by rewriting sizeof() with offsetof(). Signed-off-by: Kuniyuki Iwashima Signed-off-by: Jakub Kicinski commit 335302dbc2e4d041b579614beed83124f341ff43 Merge: 4dcddadf5530a 69acac5690314 Author: Mark Brown Date: Sat Nov 27 01:27:27 2021 +0000 ASoC: SOF: Fixes for Intel HD-Audio DMA stopping Merge series from Kai Vehmanen : Implement an updated programming sequence to handle DMA stop for Intel HD-Audio DMA. The new flow is only used if the firmware is sufficiently new to support the feature. SOF1.9.2 is the first release with the updated flow. The kernel changes are backwards compatible with old firmware releases. Likewise new firmware releases will work with old kernel. Series reviewed originally at: https://github.com/thesofproject/linux/pull/3167 commit 442b03c32ca1077c75682346a1434eedcdc3e4d4 Author: Xin Long Date: Wed Nov 24 14:39:33 2021 -0500 bridge: use __set_bit in __br_vlan_set_default_pvid The same optimization as the one in commit cc0be1ad686f ("net: bridge: Slightly optimize 'find_portno()'") is needed for the 'changed' bitmap in __br_vlan_set_default_pvid(). Signed-off-by: Xin Long Link: https://lore.kernel.org/r/4e35f415226765e79c2a11d2c96fbf3061c486e2.1637782773.git.lucien.xin@gmail.com Signed-off-by: Jakub Kicinski commit bde3b0fd8055bf2c00fd20a4e3d65e920c15b443 Author: Tonghao Zhang Date: Fri Nov 26 00:30:49 2021 +0800 net: ethtool: set a default driver name The netdev (e.g. ifb, bareudp), which not support ethtool ops (e.g. .get_drvinfo), we can use the rtnl kind as a default name. ifb netdev may be created by others prefix, not ifbX. Cc: Arnd Bergmann Cc: Hao Chen Cc: Heiner Kallweit Cc: "Gustavo A. R. Silva" Cc: Danielle Ratson Cc: Andrew Lunn Signed-off-by: Tonghao Zhang Reviewed-by: Leon Romanovsky Link: https://lore.kernel.org/r/20211125163049.84970-1-xiangxia.m.yue@gmail.com Signed-off-by: Jakub Kicinski commit c2e0cf085d462ccb2c6b3700dc4ed9aab0354808 Merge: 93d5404e89888 f5a9dd58f48b7 Author: Jakub Kicinski Date: Fri Nov 26 16:43:20 2021 -0800 Merge branch 'selftests-net-bridge-vlan-multicast-tests' Nikolay Aleksandrov says: ==================== selftests: net: bridge: vlan multicast tests This patch-set adds selftests for the new vlan multicast options that were recently added. Most of the tests check for default values, changing options and try to verify that the changes actually take effect. The last test checks if the dependency between vlan_filtering and mcast_vlan_snooping holds. The rest are pretty self-explanatory. TEST: Vlan multicast snooping enable [ OK ] TEST: Vlan global options existence [ OK ] TEST: Vlan mcast_snooping global option default value [ OK ] TEST: Vlan 10 multicast snooping control [ OK ] TEST: Vlan mcast_querier global option default value [ OK ] TEST: Vlan 10 multicast querier enable [ OK ] TEST: Vlan 10 tagged IGMPv2 general query sent [ OK ] TEST: Vlan 10 tagged MLD general query sent [ OK ] TEST: Vlan mcast_igmp_version global option default value [ OK ] TEST: Vlan mcast_mld_version global option default value [ OK ] TEST: Vlan 10 mcast_igmp_version option changed to 3 [ OK ] TEST: Vlan 10 tagged IGMPv3 general query sent [ OK ] TEST: Vlan 10 mcast_mld_version option changed to 2 [ OK ] TEST: Vlan 10 tagged MLDv2 general query sent [ OK ] TEST: Vlan mcast_last_member_count global option default value [ OK ] TEST: Vlan mcast_last_member_interval global option default value [ OK ] TEST: Vlan 10 mcast_last_member_count option changed to 3 [ OK ] TEST: Vlan 10 mcast_last_member_interval option changed to 200 [ OK ] TEST: Vlan mcast_startup_query_interval global option default value [ OK ] TEST: Vlan mcast_startup_query_count global option default value [ OK ] TEST: Vlan 10 mcast_startup_query_interval option changed to 100 [ OK ] TEST: Vlan 10 mcast_startup_query_count option changed to 3 [ OK ] TEST: Vlan mcast_membership_interval global option default value [ OK ] TEST: Vlan 10 mcast_membership_interval option changed to 200 [ OK ] TEST: Vlan 10 mcast_membership_interval mdb entry expire [ OK ] TEST: Vlan mcast_querier_interval global option default value [ OK ] TEST: Vlan 10 mcast_querier_interval option changed to 100 [ OK ] TEST: Vlan 10 mcast_querier_interval expire after outside query [ OK ] TEST: Vlan mcast_query_interval global option default value [ OK ] TEST: Vlan 10 mcast_query_interval option changed to 200 [ OK ] TEST: Vlan mcast_query_response_interval global option default value [ OK ] TEST: Vlan 10 mcast_query_response_interval option changed to 200 [ OK ] TEST: Port vlan 10 option mcast_router default value [ OK ] TEST: Port vlan 10 mcast_router option changed to 2 [ OK ] TEST: Flood unknown vlan multicast packets to router port only [ OK ] TEST: Disable multicast vlan snooping when vlan filtering is disabled [ OK ] ==================== Link: https://lore.kernel.org/r/20211125140858.3639139-1-razor@blackwall.org Signed-off-by: Jakub Kicinski commit f5a9dd58f48b7c26da42387d6d38889fce8a2778 Author: Nikolay Aleksandrov Date: Thu Nov 25 16:08:58 2021 +0200 selftests: net: bridge: add test for vlan_filtering dependency Add a test for dependency of mcast_vlan_snooping on vlan_filtering. If vlan_filtering gets disabled, then mcast_vlan_snooping must be automatically disabled as well. TEST: Disable multicast vlan snooping when vlan filtering is disabled [ OK ] Signed-off-by: Nikolay Aleksandrov Signed-off-by: Jakub Kicinski commit 2cd67a4e278e2bf95dac5a0889d55b17b37f3de7 Author: Nikolay Aleksandrov Date: Thu Nov 25 16:08:57 2021 +0200 selftests: net: bridge: add vlan mcast_router tests Add tests for the new per-port/vlan mcast_router option, verify that unknown multicast packets are flooded only to router ports. TEST: Port vlan 10 option mcast_router default value [ OK ] TEST: Port vlan 10 mcast_router option changed to 2 [ OK ] TEST: Flood unknown vlan multicast packets to router port only [ OK ] Signed-off-by: Nikolay Aleksandrov Signed-off-by: Jakub Kicinski commit b4ce7b9523c407cdd657c3bc20dcb6eb6701f59f Author: Nikolay Aleksandrov Date: Thu Nov 25 16:08:56 2021 +0200 selftests: net: bridge: add vlan mcast query and query response interval tests Add tests which change the new per-vlan mcast_query_interval and verify the new value is in effect, also add a test to change mcast_query_response_interval's value. TEST: Vlan mcast_query_interval global option default value [ OK ] TEST: Vlan 10 mcast_query_interval option changed to 200 [ OK ] TEST: Vlan mcast_query_response_interval global option default value [ OK ] TEST: Vlan 10 mcast_query_response_interval option changed to 200 [ OK ] Signed-off-by: Nikolay Aleksandrov Signed-off-by: Jakub Kicinski commit 4d8610ee8bd77727dec7833065d2b2ae63366e49 Author: Nikolay Aleksandrov Date: Thu Nov 25 16:08:55 2021 +0200 selftests: net: bridge: add vlan mcast_querier_interval tests Add tests which change the new per-vlan mcast_querier_interval and verify that it is taken into account when an outside querier is present. TEST: Vlan mcast_querier_interval global option default value [ OK ] TEST: Vlan 10 mcast_querier_interval option changed to 100 [ OK ] TEST: Vlan 10 mcast_querier_interval expire after outside query [ OK ] Signed-off-by: Nikolay Aleksandrov Signed-off-by: Jakub Kicinski commit a45fe974173668c1cbd1e23eb9fabdb5b17ae0be Author: Nikolay Aleksandrov Date: Thu Nov 25 16:08:54 2021 +0200 selftests: net: bridge: add vlan mcast_membership_interval test Add a test which changes the new per-vlan mcast_membership_interval and verifies that a newly learned mdb entry would expire in that interval. TEST: Vlan mcast_membership_interval global option default value [ OK ] TEST: Vlan 10 mcast_membership_interval option changed to 200 [ OK ] TEST: Vlan 10 mcast_membership_interval mdb entry expire [ OK ] Signed-off-by: Nikolay Aleksandrov Signed-off-by: Jakub Kicinski commit bdf1b2c05e09b239f553c0ee828e2f851f4a1b47 Author: Nikolay Aleksandrov Date: Thu Nov 25 16:08:53 2021 +0200 selftests: net: bridge: add vlan mcast_startup_query_count/interval tests Add tests which change the new per-vlan startup query count/interval options and verify the proper number of queries are sent in the expected interval. TEST: Vlan mcast_startup_query_interval global option default value [ OK ] TEST: Vlan mcast_startup_query_count global option default value [ OK ] TEST: Vlan 10 mcast_startup_query_interval option changed to 100 [ OK ] TEST: Vlan 10 mcast_startup_query_count option changed to 3 [ OK ] Signed-off-by: Nikolay Aleksandrov Signed-off-by: Jakub Kicinski commit 3825f1fb675bfc2d75a39202fe8a394607441016 Author: Nikolay Aleksandrov Date: Thu Nov 25 16:08:52 2021 +0200 selftests: net: bridge: add vlan mcast_last_member_count/interval tests Add tests which verify the default values of mcast_last_member_count mcast_last_member_count and also try to change them. TEST: Vlan mcast_last_member_count global option default value [ OK ] TEST: Vlan mcast_last_member_interval global option default value [ OK ] TEST: Vlan 10 mcast_last_member_count option changed to 3 [ OK ] TEST: Vlan 10 mcast_last_member_interval option changed to 200 [ OK ] Signed-off-by: Nikolay Aleksandrov Signed-off-by: Jakub Kicinski commit 2b75e9dd580c33a5618f880dfd81b7cec6576a4b Author: Nikolay Aleksandrov Date: Thu Nov 25 16:08:51 2021 +0200 selftests: net: bridge: add vlan mcast igmp/mld version tests Add tests which change the new per-vlan IGMP/MLD versions and verify that proper tagged general query packets are sent. TEST: Vlan mcast_igmp_version global option default value [ OK ] TEST: Vlan mcast_mld_version global option default value [ OK ] TEST: Vlan 10 mcast_igmp_version option changed to 3 [ OK ] TEST: Vlan 10 tagged IGMPv3 general query sent [ OK ] TEST: Vlan 10 mcast_mld_version option changed to 2 [ OK ] TEST: Vlan 10 tagged MLDv2 general query sent [ OK ] Signed-off-by: Nikolay Aleksandrov Signed-off-by: Jakub Kicinski commit dee2cdc0e3bb8dbdd21f8f441d5a7cac2ddcefe3 Author: Nikolay Aleksandrov Date: Thu Nov 25 16:08:50 2021 +0200 selftests: net: bridge: add vlan mcast querier test Add a test to try the new global vlan mcast_querier control and also verify that tagged general query packets are properly generated when querier is enabled for a single vlan. TEST: Vlan mcast_querier global option default value [ OK ] TEST: Vlan 10 multicast querier enable [ OK ] TEST: Vlan 10 tagged IGMPv2 general query sent [ OK ] TEST: Vlan 10 tagged MLD general query sent [ OK ] Signed-off-by: Nikolay Aleksandrov Signed-off-by: Jakub Kicinski commit 71ae450f97ad5e992e5e0431193c767fd624f6e7 Author: Nikolay Aleksandrov Date: Thu Nov 25 16:08:49 2021 +0200 selftests: net: bridge: add vlan mcast snooping control test Add the first test for bridge per-vlan multicast snooping which checks if control of the global and per-vlan options work as expected, joins and leaves are tested at each option value. TEST: Vlan multicast snooping enable [ OK ] TEST: Vlan global options existence [ OK ] TEST: Vlan mcast_snooping global option default value [ OK ] TEST: Vlan 10 multicast snooping control [ OK ] Signed-off-by: Nikolay Aleksandrov Signed-off-by: Jakub Kicinski commit 72f902d8b1870dd0c7824f0e7ce2915d564ca802 Author: Linus Walleij Date: Sat Nov 27 01:06:34 2021 +0100 Revert "dt-bindings: pinctrl: qcom: Add SDX65 pinctrl bindings" This reverts commit 3fe59cc4ff641b106cc24930204d4cd2c82f318f. The bindings were not properly reviewed and were also causing errors in the automatic checkers once applied. Signed-off-by: Linus Walleij commit 839930ca1bd0c79cdf370d11462ef4a81b664e44 Author: Joey Gouly Date: Sun Nov 21 16:56:42 2021 +0000 pinctrl: apple: return an error if pinmux is missing in the DT If of_property_count_u32_elems returned 0, return -EINVAL to indicate a failure. Previously this would return 0. Fixes: a0f160ffcb83 ("pinctrl: add pinctrl/GPIO driver for Apple SoCs") Signed-off-by: Joey Gouly Suggested-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211121165642.27883-12-joey.gouly@arm.com Signed-off-by: Linus Walleij commit 077db34c2b007a086baa3ee87bc72794a25d0329 Author: Joey Gouly Date: Sun Nov 21 16:56:41 2021 +0000 pinctrl: apple: use modulo rather than bitwise and This expresses the intention clearer. Signed-off-by: Joey Gouly Suggested-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211121165642.27883-11-joey.gouly@arm.com Signed-off-by: Linus Walleij commit 44bddfad97e7f6290c8d578e79aa608cfb97e65f Author: Joey Gouly Date: Sun Nov 21 16:56:40 2021 +0000 pinctrl: apple: don't set gpio_chip.of_node The gpio core code sets of_node, so no need to do it here. Signed-off-by: Joey Gouly Suggested-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211121165642.27883-10-joey.gouly@arm.com Signed-off-by: Linus Walleij commit 391aad396238037c13074b5e5cd02ae15a2fab91 Author: Joey Gouly Date: Sun Nov 21 16:56:39 2021 +0000 pinctrl: apple: remove gpio-controller check Having this missing, but everything else valid shouldn't result in a failure. Signed-off-by: Joey Gouly Suggested-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211121165642.27883-9-joey.gouly@arm.com Signed-off-by: Linus Walleij commit a8888e64eec8f8e50917f9e616f45ff2ad01be66 Author: Joey Gouly Date: Sun Nov 21 16:56:38 2021 +0000 pinctrl: apple: give error label a specific name Signed-off-by: Joey Gouly Suggested-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211121165642.27883-8-joey.gouly@arm.com Signed-off-by: Linus Walleij commit 7d2649172908c83c820a957e97d0baf9901b9c95 Author: Joey Gouly Date: Sun Nov 21 16:56:37 2021 +0000 pinctrl: apple: make apple_gpio_get_direction more readable Try to make this more readable by not using a long line with a ternary operator. Signed-off-by: Joey Gouly Suggested-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211121165642.27883-7-joey.gouly@arm.com Signed-off-by: Linus Walleij commit 3605f104111e4adeac71edc89d867ec56147786d Author: Joey Gouly Date: Sun Nov 21 16:56:36 2021 +0000 pinctrl: apple: handle regmap_read errors Explicitly return 0 if the regmap_read fails. Also change a uint32_t to a u32. Signed-off-by: Joey Gouly Suggested-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211121165642.27883-6-joey.gouly@arm.com Signed-off-by: Linus Walleij commit 7c06f080ddee516499adf75fe934ee06c0f6116c Author: Joey Gouly Date: Sun Nov 21 16:56:35 2021 +0000 pinctrl: apple: add missing bits.h header This is needed for the BIT(n) macro. Signed-off-by: Joey Gouly Suggested-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211121165642.27883-5-joey.gouly@arm.com Signed-off-by: Linus Walleij commit 67a6c2811ceff3d8c1225cf52a42f39f3addf477 Author: Joey Gouly Date: Sun Nov 21 16:56:34 2021 +0000 pinctrl: apple: use C style comment This is the preferred comment style. Signed-off-by: Joey Gouly Suggested-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211121165642.27883-4-joey.gouly@arm.com Signed-off-by: Linus Walleij commit 5ad6973d9ae8c020c2919b408f7a697983547f86 Author: Joey Gouly Date: Sun Nov 21 16:56:33 2021 +0000 pinctrl: apple: add missing comma Add a missing comma at the end of the regmap initialisation. Signed-off-by: Joey Gouly Suggested-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211121165642.27883-3-joey.gouly@arm.com Signed-off-by: Linus Walleij commit 361856dd735ed3092c00143f2e8a73c0e1f42118 Author: Joey Gouly Date: Sun Nov 21 16:56:32 2021 +0000 pinctrl: apple: fix some formatting issues Reflow some of the code now that the extra '_gpio' was removed. Signed-off-by: Joey Gouly Suggested-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211121165642.27883-2-joey.gouly@arm.com Signed-off-by: Linus Walleij commit 2448eab44034d9603c97ca17760a53d4d6e4b60c Merge: deee705a1c9cc 136057256686d Author: Linus Walleij Date: Sat Nov 27 00:54:16 2021 +0100 Merge tag 'v5.16-rc2' into devel Linux 5.16-rc2 is needed because nonurgent fixes headed for next are strongly textually dependent on a fix that was applied for rc2. Signed-off-by: Linus Walleij commit 93d5404e8988882bd33f6acc0d343c4db51eb8b4 Merge: af22d0550705d c5c17547b7789 Author: Jakub Kicinski Date: Fri Nov 26 13:26:29 2021 -0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net drivers/net/ipa/ipa_main.c 8afc7e471ad3 ("net: ipa: separate disabling setup from modem stop") 76b5fbcd6b47 ("net: ipa: kill ipa_modem_init()") Duplicated include, drop one. Signed-off-by: Jakub Kicinski commit e32cb12ff52a2840fc1248998717f7b95c42f064 Author: Tiezhu Yang Date: Thu Nov 25 09:36:07 2021 +0800 bpf, mips: Fix build errors about __NR_bpf undeclared Add the __NR_bpf definitions to fix the following build errors for mips: $ cd tools/bpf/bpftool $ make [...] bpf.c:54:4: error: #error __NR_bpf not defined. libbpf does not support your arch. # error __NR_bpf not defined. libbpf does not support your arch. ^~~~~ bpf.c: In function ‘sys_bpf’: bpf.c:66:17: error: ‘__NR_bpf’ undeclared (first use in this function); did you mean ‘__NR_brk’? return syscall(__NR_bpf, cmd, attr, size); ^~~~~~~~ __NR_brk [...] In file included from gen_loader.c:15:0: skel_internal.h: In function ‘skel_sys_bpf’: skel_internal.h:53:17: error: ‘__NR_bpf’ undeclared (first use in this function); did you mean ‘__NR_brk’? return syscall(__NR_bpf, cmd, attr, size); ^~~~~~~~ __NR_brk We can see the following generated definitions: $ grep -r "#define __NR_bpf" arch/mips arch/mips/include/generated/uapi/asm/unistd_o32.h:#define __NR_bpf (__NR_Linux + 355) arch/mips/include/generated/uapi/asm/unistd_n64.h:#define __NR_bpf (__NR_Linux + 315) arch/mips/include/generated/uapi/asm/unistd_n32.h:#define __NR_bpf (__NR_Linux + 319) The __NR_Linux is defined in arch/mips/include/uapi/asm/unistd.h: $ grep -r "#define __NR_Linux" arch/mips arch/mips/include/uapi/asm/unistd.h:#define __NR_Linux 4000 arch/mips/include/uapi/asm/unistd.h:#define __NR_Linux 5000 arch/mips/include/uapi/asm/unistd.h:#define __NR_Linux 6000 That is to say, __NR_bpf is: 4000 + 355 = 4355 for mips o32, 6000 + 319 = 6319 for mips n32, 5000 + 315 = 5315 for mips n64. So use the GCC pre-defined macro _ABIO32, _ABIN32 and _ABI64 [1] to define the corresponding __NR_bpf. This patch is similar with commit bad1926dd2f6 ("bpf, s390: fix build for libbpf and selftest suite"). [1] https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/config/mips/mips.h#l549 Signed-off-by: Tiezhu Yang Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/1637804167-8323-1-git-send-email-yangtiezhu@loongson.cn commit 4e0d84634445ed550498d613a49ea8f6cfa5e66c Author: Arnd Bergmann Date: Fri Nov 26 10:58:40 2021 +0100 futex: Fix sparc32/m68k/nds32 build regression The recent futex cleanup series, botched up a rename of some function names, breaking sparc32, m68k and nds32: include/asm-generic/futex.h:17:2: error: implicit declaration of function 'futex_atomic_cmpxchg_inatomic_local_generic'; did you mean 'futex_atomic_cmpxchg_inatomic_local'? [-Werror=implicit-function-declaration] Fix the macros to point to the correct functions. Fixes: 3f2bedabb62c ("futex: Ensure futex_atomic_cmpxchg_inatomic() is present") Reported-by: Stephen Rothwell Signed-off-by: Arnd Bergmann Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20211126095852.455492-1-arnd@kernel.org commit db1b2a8caf5b4954aa62ead5b0580948656eac43 Author: Andy Shevchenko Date: Fri Nov 26 22:35:42 2021 +0200 pinctrl: cherryview: Use temporary variable for struct device Use temporary variable for struct device to make code neater. Signed-off-by: Andy Shevchenko commit 07199dbf8cae36c973a89552fee83dd4e0a75972 Author: Hans de Goede Date: Thu Nov 18 11:56:49 2021 +0100 pinctrl: cherryview: Do not allow the same interrupt line to be used by 2 pins It is impossible to use the same interrupt line for 2 pins, this will result in the interrupts only being delivered to the IRQ handler for the pin for which chv_gpio_irq_type() was called last. The pinctrl-cherryview.c code relies on the BIOS to correctly setup the interrupt line, but there is a BIOS bug on at least the Medion Akoya E1239T and the GPD win models where both INT33FF:02 pin 8, used by the powerbutton and INT33FF:02 pin 21 used as IRQ input for the accelerometer are mapped to interrupt line 0. This causes 2 problems: 1. The accelerometer IRQ does not work, since the power button is probed later taking over the intr_lines[0] slot. 2. Since the accelerometer IRQ is not marked as wakeup, interrupt line 0 gets masked on suspend, causing the power button to not work to wake the system from suspend. Likewise on the Lenovo Yogabook, which has a touchscreen as keyboard and the keyboard half of the tablet also has a Wacom digitizer, the BIOS by default assigns the same interrupt line to the GPIOs used for their interrupts. Fix these problems by adding a check for this and assigning a new interrupt line to the 2nd pin for which chv_gpio_irq_type() gets called. With this fix in place the following 2 messages show up in dmesg on the Medion Akoya E1239T and the GPD win: cherryview-pinctrl INT33FF:02: interrupt line 0 is used by both pin 21 and pin 8 cherryview-pinctrl INT33FF:02: changing the interrupt line for pin 8 to 15 And the following gets logged on the Lenovo Yogabook: cherryview-pinctrl INT33FF:01: interrupt-line 0 is used by both pin 49 and pin 56 cherryview-pinctrl INT33FF:01: changing the interrupt line for pin 56 to 7 Note commit 9747070c11d6 ("Input: axp20x-pek - always register interrupt handlers") was added as a work around for the power button not being able to wakeup the system. This relies on using the PMIC's connection to the power button but that only works on systems with the AXP288 PMIC. Once this fix has been merged that workaround can be removed. Cc: Yauhen Kharuzhy Signed-off-by: Hans de Goede Acked-by: Mika Westerberg Signed-off-by: Andy Shevchenko commit bdfbef2d29dcdc79e2abf3085d4be6a844a06e34 Author: Hans de Goede Date: Thu Nov 18 11:56:48 2021 +0100 pinctrl: cherryview: Don't use selection 0 to mark an interrupt line as unused The selection 0 is a perfectly valid, so stop using it to have the special meaning of interrupt line not used in the intr_lines. Instead introduce a special CHV_INVALID_HWIRQ value, derived from INVALID_HWIRQ. which is never a valid selection and use that to indicate unused interrupt lines. Cc: Yauhen Kharuzhy Signed-off-by: Hans de Goede Acked-by: Mika Westerberg Signed-off-by: Andy Shevchenko commit af22d0550705dcb4142362b232f972bfab486b89 Author: wengjianfeng Date: Fri Nov 26 09:31:30 2021 +0800 nfc: fdp: Merge the same judgment Combine two judgments that return the same value Signed-off-by: wengjianfeng Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20211126013130.27112-1-samirweng1979@163.com Signed-off-by: Jakub Kicinski commit f9809d56513541ca10f67d9666de02384600f109 Author: Mike Leach Date: Wed Nov 24 20:00:38 2021 +0000 Documentation: coresight: Update coresight configuration docs Update the CoreSight System Configuration document to cover the use of loadable modules to add configurations and features to the system. Signed-off-by: Mike Leach Link: https://lore.kernel.org/r/20211124200038.28662-7-mike.leach@linaro.org Signed-off-by: Mathieu Poirier commit 7ebd0ec6cf947c3292f21a5edf2d37c9e7317554 Author: Mike Leach Date: Wed Nov 24 20:00:37 2021 +0000 coresight: configfs: Allow configfs to activate configuration Adds configfs attributes to allow a configuration to be enabled for use when sysfs is used to control CoreSight. perf retains independent enabling of configurations. Signed-off-by: Mike Leach Link: https://lore.kernel.org/r/20211124200038.28662-6-mike.leach@linaro.org Signed-off-by: Mathieu Poirier commit ede5bab874f535355ccee5514383941b9525c03b Author: Mike Leach Date: Wed Nov 24 20:00:36 2021 +0000 coresight: syscfg: Example CoreSight configuration loadable module An example of creating a loadable module to add CoreSight configurations into a system. In the Kernel samples/coresight directory. Signed-off-by: Mike Leach Link: https://lore.kernel.org/r/20211124200038.28662-5-mike.leach@linaro.org Signed-off-by: Mathieu Poirier commit eb2ec49606c2a02d6382d56a0e19f34e515fde3f Author: Mike Leach Date: Wed Nov 24 20:00:35 2021 +0000 coresight: syscfg: Update load API for config loadable modules CoreSight configurations and features can be added as kernel loadable modules. This patch updates the load owner API to ensure that the module cannot be unloaded either: 1) if the config it supplies is in use 2) if the module is not the last in the load order list. Signed-off-by: Mike Leach Link: https://lore.kernel.org/r/20211124200038.28662-4-mike.leach@linaro.org Signed-off-by: Mathieu Poirier commit 02bd588e12df405bdf55244708151b7f238b79ba Author: Mike Leach Date: Wed Nov 24 20:00:34 2021 +0000 coresight: configuration: Update API to permit dynamic load/unload Expand the configuration API to allow dynamic runtime load and unload of configurations and features. On load, configurations and features are tagged with a "load owner" that is used to determine sets that were loaded together in a given API call. To unload the API uses the load owner to unload all elements previously loaded by that owner. The API also records the order in which different owners loaded their elements into the system. Later loading configurations can use previously loaded features, creating load dependencies. Therefore unload is enforced strictly in the reverse order to load. A load owner will be an additional loadable module, or a configuration loaded via configfs. Signed-off-by: Mike Leach Link: https://lore.kernel.org/r/20211124200038.28662-3-mike.leach@linaro.org Signed-off-by: Mathieu Poirier commit da7000e8b83bb8dbdf8f01fd3fe4c4190974bfdc Author: Mike Leach Date: Wed Nov 24 20:00:33 2021 +0000 coresight: configuration: Update API to introduce load owner concept Update the existing load API to introduce a "load owner" concept. This allows the tracking of the loaded configurations and features against the loading owner type, to allow later unload according to owner. A list of loaded configurations by owner is created. The load owner infrastructure will be used in following patches to implement dynanic load and unload, alongside dependency tracking. Signed-off-by: Mike Leach Link: https://lore.kernel.org/r/20211124200038.28662-2-mike.leach@linaro.org Signed-off-by: Mathieu Poirier commit d1e69b5492d1826356e516685977b41d60dbee26 Author: Ajay Singh Date: Mon Nov 15 10:28:28 2021 +0000 wilc1000: remove '-Wunused-but-set-variable' warning in chip_wakeup() Remove unused variables to avoid the below warnings: drivers/net/wireless/microchip/wilc1000/wlan.c: In function 'chip_wakeup': >> drivers/net/wireless/microchip/wilc1000/wlan.c:620:34: warning: variable 'to_host_from_fw_bit' set but not used [-Wunused-but-set-variable] 620 | u32 to_host_from_fw_reg, to_host_from_fw_bit; | ^~~~~~~~~~~~~~~~~~~ >> drivers/net/wireless/microchip/wilc1000/wlan.c:620:13: warning: variable 'to_host_from_fw_reg' set but not used [-Wunused-but-set-variable] 620 | u32 to_host_from_fw_reg, to_host_from_fw_bit; | ^~~~~~~~~~~~~~~~~~~ Reported-by: kernel test robot Signed-off-by: Ajay Singh Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211115102809.1408267-1-ajay.kathat@microchip.com commit 7ce1f2157e14170413ba5ecb462153131704754c Author: Emmanuel Grumbach Date: Fri Nov 12 08:28:14 2021 +0200 iwlwifi: mvm: read the rfkill state and feed it to iwlmei Read the rfkill state upon boot, mac start and mac stop. Reviewed-by: Luciano Coelho Signed-off-by: Emmanuel Grumbach Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211112062814.7502-6-emmanuel.grumbach@intel.com commit bfcfdb59b6699053541d3fda60ef021f4708caa5 Author: Emmanuel Grumbach Date: Fri Nov 12 08:28:13 2021 +0200 iwlwifi: mvm: add vendor commands needed for iwlmei Add the vendor commands that must be used by the network manager to allow proper operation of iwlmei. * Send information on the AP CSME is connected to * Notify the userspace when roaming is forbidden * Allow the userspace to require ownership Co-Developed-by: Ayala Beker Signed-off-by: Ayala Beker Signed-off-by: Emmanuel Grumbach v6: remove the VENDOR_CMDS Kconfig option and make the whole infra depend on IWLMEI directly v7: remove // comments remove an unneeded function Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211112062814.7502-5-emmanuel.grumbach@intel.com commit 6d19a5eba5cda26310f83f5ea87eef54e68afc34 Author: Emmanuel Grumbach Date: Fri Nov 12 08:28:12 2021 +0200 iwlwifi: integrate with iwlmei iwlmei needs to know about the follwing events: * Association * De-association * Country Code change * SW Rfkill change * SAR table changes iwlmei can take the device away from us, so report the new rfkill type when this happens. Advertise the required data from the CSME firmware to the usersapce: mostly, the AP that the CSME firmware is currently associated to in case there is an active link protection session. Generate the HOST_ASSOC / HOST_DISSASSOC messages. Don't support WPA1 (non-RSNA) for now. Don't support shared wep either. We can then determine the AUTH parameter by checking the AKM. Feed the cipher from the key installation. SW Rfkill will be implemented later when cfg80211 will allow us to read the SW Rfkill state. Co-Developed-by: Ayala Beker Signed-off-by: Ayala Beker Signed-off-by: Emmanuel Grumbach v7: Ayala added her signed-off remove pointless function declaration fix a bug due to merge conflict in the HOST_ASSOC message v8: leave a print if we have a SAP connection on a device we do not support (yet) Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211112062814.7502-4-emmanuel.grumbach@intel.com commit 4ea7da5fad43f47eb2adab032f989a9fa6678a9c Author: Emmanuel Grumbach Date: Fri Nov 12 08:28:11 2021 +0200 iwlwifi: mei: add debugfs hooks Add three debugfs hooks: * status: Check if we have a connection with the CSME firwmare. This hook is a read only. * req_ownership: Send a SAP command to request ownership. This flow should be triggered by iwlwifi (from user space through vendor commands really), but being able to trigger an ownership request from debugfs allows us to request ownership without connecting afterwards. This is an "error" flow that the CSME firmware is designed to handle this way: + Grant ownership since the host asked for it + Wait 3 seconds to let the host connect + If the host didn't connect, take the device back (forcefully). + Don't grant any new ownership request in the following 30 seconds. This debugfs hook allows us to test this flow. * send_start_message: Restart the communication with the CSME firmware from the very beginning. At the very beginning (upon iwlwifi start), iwlmei send a special message: SAP_ME_MSG_START. This hook allows to send it again and this will retrigger the whole flow. It is important to test this restart in the middle of normal operation since it can happen (in case the CSME firmware decided to reset for example). Signed-off-by: Emmanuel Grumbach Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211112062814.7502-3-emmanuel.grumbach@intel.com commit 2da4366f9e2c44afedec4acad65a99a3c7da1a35 Author: Emmanuel Grumbach Date: Fri Nov 12 08:28:10 2021 +0200 iwlwifi: mei: add the driver to allow cooperation with CSME CSME in two words ----------------- CSME stands for Converged Security and Management Engine. It is a CPU on the chipset and runs a dedicated firmware. AMT (Active Management Technology) is one of the applications that run on that CPU. AMT allows to control the platform remotely. Here is a partial list of the use cases: * View the screen of the plaform, with keyboard and mouse (KVM) * Attach a remote IDE device * Have a serial console to the device * Query the state of the platform * Reset / shut down / boot the platform Networking in CSME ------------------ For those uses cases, CSME's firmware has an embedded network stack and is able to use the network devices of the system: LAN and WLAN. This is thanks to the CSME's firmware WLAN driver. One can add a profile (SSID / key / certificate) to the CSME's OS and CSME will connect to that profile. Then, one can use the WLAN link to access the applications that run on CSME (AMT is one of them). Note that CSME is active during power state and power state transitions. For example, it is possible to have a KVM session open to the system while the system is rebooting and actually configure the BIOS remotely over WLAN thanks to AMT. How all this is related to Linux -------------------------------- In Linux, there is a driver that allows the OS to talk to the CSME firmware, this driver is drivers/misc/mei. This driver advertises a bus that allows other kernel drivers or even user space) to talk to components inside the CSME firmware. In practice, the system advertises a PCI device that allows to send / receive data to / from the CSME firmware. The mei bus drivers in drivers/misc/mei is an abstration on top of this PCI device. The driver being added here is called iwlmei and talks to the WLAN driver inside the CSME firmware through the mei bus driver. Note that the mei bus driver only gives bus services, it doesn't define the content of the communication. Why do we need this driver? -------------------------- CSME uses the same WLAN device that the OS is expecting to see hence we need an arbitration mechanism. This is what iwlmei is in charge of. iwlmei maintains the communication with the CSME firmware's WLAN driver. The language / protocol that is used between the CSME's firmware WLAN driver and iwlmei is OS agnostic and is called SAP which stands for Software Abritration Protocol. With SAP, iwlmei will be able to tell the CSME firmware's WLAN driver: 1) Please give me the device. 2) Please note that the SW/HW rfkill state change. 3) Please note that I am now associated to X. 4) Please note that I received this packet. etc... There are messages that go the opposite direction as well: 1) Please note that AMT is en/disable. 2) Please note that I believe the OS is broken and hence I'll take the device *now*, whether you like it or not, to make sure that connectivity is preserved. 3) Please note that I am willing to give the device if the OS needs it. 4) Please give me any packet that is sent on UDP / TCP on IP address XX.XX.XX.XX and an port ZZ. 5) Please send this packet. etc... Please check drivers/net/wireless/intel/iwlwifi/mei/sap.h for the full protocol specification. Arbitration is not the only purpose of iwlmei and SAP. SAP also allows to maintain the AMT's functionality even when the OS owns the device. To connect to AMT, one needs to initiate an HTTP connection to port 16992. iwlmei will listen to the Rx path and forward (through SAP) to the CSME firmware the data it got. Then, the embedded HTTP server in the chipset will reply to the request and send a SAP notification to ask iwlmei to send the reply. This way, AMT running on the CSME can still work. In practice this means that all the use cases quoted above (KVM, remote IDE device, etc...) will work even when the OS uses the WLAN device. How to disable all this? --------------------------- iwlmei won't be able to do anything if the CSME's networking stack is not enabled. By default, CSME's networking stack is disabled (this is a BIOS setting). In case the CSME's networking stack is disabled, iwlwifi will just get access to the device because there is no contention with any other actor and, hence, no arbitration is needed. In this patch, I only add the iwlmei driver. Integration with iwlwifi will be implemented in the next one. Co-Developed-by: Ayala Beker Signed-off-by: Ayala Beker Signed-off-by: Emmanuel Grumbach v2: fix a few warnings raised by the different bots v3: rewrite the commit message v4: put the debugfs content in a different patch v5: fix a NULL pointer dereference upon DHCP TX if SAP is connected since we now have the required cfg80211 bits in wl-drv-next, add the RFKILL handling patch to this series. v6: change the SAP API to inherit the values from iwl-mei.h removing the need to ensure the values are equal with a BUILD_BUG_ON. This was suggested by Arend v7: * fix a locking issue in case of CSME firmware reset: When the CSME firmware resets, we need to unregister the netdev, first take the mutex, and only then, rely on it being taken. * Add a comment to explain why it is ok to have static variables (iwlmei can't have more than a single instance). * Add a define for 26 + 8 + 8 * Add a define SEND_SAP_MAX_WAIT_ITERATION * make struct const * Reword a bit the Kconfig help message * Ayala added her Signed-off * fixed an RCU annotation v8: do not require ownership upfront, use NIC_OWNER instead. This fixes a deadlock when CSME does not have the right WiFi FW. Add more documentation about the owernship transition Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211112062814.7502-2-emmanuel.grumbach@intel.com commit 2cca3465147d650be3de04927a99784b30251ade Author: Alexander Usyskin Date: Fri Nov 12 08:28:09 2021 +0200 mei: bus: add client dma interface Expose the client dma mapping via mei client bus interface. The client dma has to be mapped before the device is enabled, therefore we need to create device linking already during mapping and we need to unmap after the client is disable hence we need to postpone the unlink and flush till unmapping or when destroying the device. Signed-off-by: Alexander Usyskin Co-developed-by: Tomas Winkler Signed-off-by: Tomas Winkler Signed-off-by: Emmanuel Grumbach Acked-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20210420172755.12178-1-emmanuel.grumbach@intel.com Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211112062814.7502-1-emmanuel.grumbach@intel.com commit 84d94e16efa268e4f2887d858cd67ee37b870f25 Author: Jonas Dreßler Date: Wed Nov 3 21:58:27 2021 +0100 mwifiex: Ignore BTCOEX events from the 88W8897 firmware The firmware of the 88W8897 PCIe+USB card sends those events very unreliably, sometimes bluetooth together with 2.4ghz-wifi is used and no COEX event comes in, and sometimes bluetooth is disabled but the coexistance mode doesn't get disabled. This means we sometimes end up capping the rx/tx window size while bluetooth is not enabled anymore, artifically limiting wifi speeds even though bluetooth is not being used. Since we can't fix the firmware, let's just ignore those events on the 88W8897 device. From some Wireshark capture sessions it seems that the Windows driver also doesn't change the rx/tx window sizes when bluetooth gets enabled or disabled, so this is fairly consistent with the Windows driver. Signed-off-by: Jonas Dreßler Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211103205827.14559-1-verdre@v0yd.nl commit deb573f1d7ddd182ef1792c71d62883d0f833f17 Author: Jonas Dreßler Date: Wed Nov 3 21:18:00 2021 +0100 mwifiex: Ensure the version string from the firmware is 0-terminated We assume at a few places that priv->version_str is 0-terminated, but right now we trust the firmware that this is the case with the version string we get from it. Let's rather ensure this ourselves and replace the last character with '\0'. Signed-off-by: Jonas Dreßler Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211103201800.13531-4-verdre@v0yd.nl commit 939b571a3b62b64cf407fa5dbc3941bc87e0ba3b Author: Jonas Dreßler Date: Wed Nov 3 21:17:59 2021 +0100 mwifiex: Add quirk to disable deep sleep with certain hardware revision The 88W8897 PCIe+USB card in the hardware revision 20 apparently has a hardware issue where the card wakes up from deep sleep randomly and very often, somewhat depending on the card activity, maybe the hardware has a floating wakeup pin or something. This was found by comparing two MS Surface Book 2 devices, where one devices wifi card experienced spurious wakeups, while the other one didn't. Those continuous wakeups prevent the card from entering host sleep when the computer suspends. And because the host won't answer to events from the card anymore while it's suspended, the firmwares internal power saving state machine seems to get confused and the card can't sleep anymore at all after that. Since we can't work around that hardware bug in the firmware, let's get the hardware revision string from the firmware and match it with known bad revisions. Then disable auto deep sleep for those revisions, which makes sure we no longer get those spurious wakeups. Signed-off-by: Jonas Dreßler Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211103201800.13531-3-verdre@v0yd.nl commit 2d1d7091ddac4cbeeac9e62ffcf2d29897334e3e Author: Jonas Dreßler Date: Wed Nov 3 21:17:58 2021 +0100 mwifiex: Use a define for firmware version string length Since the version string we get from the firmware is always 128 characters long, use a define for this size instead of having the number 128 copied all over the place. Signed-off-by: Jonas Dreßler Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211103201800.13531-2-verdre@v0yd.nl commit 04d80663f67ccef893061b49ec8a42ff7045ae84 Author: Zekun Shen Date: Sat Oct 30 22:42:50 2021 -0400 mwifiex: Fix skb_over_panic in mwifiex_usb_recv() Currently, with an unknown recv_type, mwifiex_usb_recv just return -1 without restoring the skb. Next time mwifiex_usb_rx_complete is invoked with the same skb, calling skb_put causes skb_over_panic. The bug is triggerable with a compromised/malfunctioning usb device. After applying the patch, skb_over_panic no longer shows up with the same input. Attached is the panic report from fuzzing. skbuff: skb_over_panic: text:000000003bf1b5fa len:2048 put:4 head:00000000dd6a115b data:000000000a9445d8 tail:0x844 end:0x840 dev: kernel BUG at net/core/skbuff.c:109! invalid opcode: 0000 [#1] SMP KASAN NOPTI CPU: 0 PID: 198 Comm: in:imklog Not tainted 5.6.0 #60 RIP: 0010:skb_panic+0x15f/0x161 Call Trace: ? mwifiex_usb_rx_complete+0x26b/0xfcd [mwifiex_usb] skb_put.cold+0x24/0x24 mwifiex_usb_rx_complete+0x26b/0xfcd [mwifiex_usb] __usb_hcd_giveback_urb+0x1e4/0x380 usb_giveback_urb_bh+0x241/0x4f0 ? __hrtimer_run_queues+0x316/0x740 ? __usb_hcd_giveback_urb+0x380/0x380 tasklet_action_common.isra.0+0x135/0x330 __do_softirq+0x18c/0x634 irq_exit+0x114/0x140 smp_apic_timer_interrupt+0xde/0x380 apic_timer_interrupt+0xf/0x20 Reported-by: Brendan Dolan-Gavitt Signed-off-by: Zekun Shen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/YX4CqjfRcTa6bVL+@Zekuns-MBP-16.fios-router.home commit c81edb8dddaa36c4defa26240cc19127f147283f Author: Ping-Ke Shih Date: Fri Nov 19 13:24:37 2021 +0800 rtw88: add quirk to disable pci caps on HP 250 G7 Notebook PC 8821CE causes random freezes on HP 250 G7 Notebook PC. Add a quirk to disable pci ASPM capability. Reported-by: rtl8821cerfe2 Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211119052437.8671-1-pkshih@realtek.com commit 272cda71e857a23690a4571cb48f219f7d40af76 Author: Yu-Yen Ting Date: Tue Nov 2 10:24:54 2021 +0800 rtw88: add debugfs to force lowest basic rate The management frame with high rate e.g. 24M may not be transmitted smoothly in long range environment. Add a debugfs to force to use the lowest basic rate in order to debug the reachability of transmitting management frame. obtain current setting cat /sys/kernel/debug/ieee80211/phyX/rtw88/force_lowest_basic_rate force lowest rate: echo 1 > /sys/kernel/debug/ieee80211/phyX/rtw88/force_lowest_basic_rate Signed-off-by: Yu-Yen Ting Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211102022454.10944-2-pkshih@realtek.com commit 2f1367b564c16a1a4d37140db3bf1f4d9851cac7 Author: Yu-Yen Ting Date: Tue Nov 2 10:24:53 2021 +0800 rtw88: follow the AP basic rates for tx mgmt frame By default the driver uses the 1M and 6M rate for managemnt frames in 2G and 5G bands respectively. But when the basic rates is configured from the mac80211, we need to send the management frames according to the basic rates. This commit makes the driver use the lowest basic rates to send the management frames. Signed-off-by: Yu-Yen Ting Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211102022454.10944-1-pkshih@realtek.com commit 5da7075c1126f70578a111b8ea64d93f56bc84dd Author: Chia-Yuan Li Date: Mon Nov 22 10:11:29 2021 +0800 rtw89: add AXIDMA and TX FIFO dump in mac_mem_dump The AXIDMA is tx/rx packet transmission between PCIE host and device, and TX FIFO is MAC TX data. We dump them to verify that these memory buffers are correct. Signed-off-by: Chia-Yuan Li Signed-off-by: Ping-Ke Shih Reviewed-by: Larry Finger Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211122021129.4339-1-pkshih@realtek.com commit 30101812a09b37bc8aa409a83f603d4c072198f2 Author: Ping-Ke Shih Date: Fri Nov 19 13:57:29 2021 +0800 rtw89: fix potentially access out of range of RF register array The RF register array is used to help firmware to restore RF settings. The original code can potentially access out of range, if the size is between (RTW89_H2C_RF_PAGE_SIZE * RTW89_H2C_RF_PAGE_NUM + 1) to ((RTW89_H2C_RF_PAGE_SIZE + 1) * RTW89_H2C_RF_PAGE_NUM). Fortunately, current used size doesn't fall into the wrong case, and the size will not change if we don't update RF parameter. Reported-by: Dan Carpenter Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211119055729.12826-1-pkshih@realtek.com commit 43863efeada6eda380bd08537d1e4719341dc50d Author: Changcheng Deng Date: Wed Nov 10 12:11:35 2021 +0000 rtw89: remove unneeded variable Fix the following coccicheck review: ./drivers/net/wireless/realtek/rtw89/mac.c: 1096: 5-8: Unneeded variable Remove unneeded variable used to store return value. Reported-by: Zeal Robot Signed-off-by: Changcheng Deng Acked-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211110121135.151187-1-deng.changcheng@zte.com.cn commit 1646ce8f83b953a675cb99e7b6708d8121b5fecf Author: Ye Guojin Date: Thu Nov 4 06:11:19 2021 +0000 rtw89: remove unnecessary conditional operators The conditional operator is unnecessary while assigning values to the bool variables. Reported-by: Zeal Robot Signed-off-by: Ye Guojin Acked-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211104061119.1685-1-ye.guojin@zte.com.cn commit 08e16498e01b289dc9cfd41043c91a4b84fe6ce9 Author: Zong-Zhe Yang Date: Mon Nov 1 17:31:06 2021 +0800 rtw89: update rtw89_regulatory map to R58-R31 Start to configure entries with RTW89_QATAR, RTW89_UKRAINE, RTW89_CN. Adjust some entries with explicit rtw89_regulatory instead of RTW89_WW. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211101093106.28848-5-pkshih@realtek.com commit ebaae2c2c3bd5a6b15ed4a4f7a8a35b1989e24af Author: Zong-Zhe Yang Date: Mon Nov 1 17:31:05 2021 +0800 rtw89: update tx power limit/limit_ru tables to R54 Update tx power limit table and tx power limit_ru table to R54. Configure entries for MEXICO, CN, QATAR, and adjust some values of original entries. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211101093106.28848-4-pkshih@realtek.com commit 542577149794b9c8638f6f2cb90b35b137b44156 Author: Zong-Zhe Yang Date: Mon Nov 1 17:31:04 2021 +0800 rtw89: update rtw89 regulation definition to R58-R31 Support QATAR in rtw89_regulation_type and reorder the enum to align realtek R58-R31 regulation definition. Besides, if an unassigned entry of limit/limit_ru tables is read, return the corresponding WW value for the unconfigured case. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211101093106.28848-3-pkshih@realtek.com commit 02356226692646b52160fbb214fe18e0d2a1c3eb Author: Zong-Zhe Yang Date: Mon Nov 1 17:31:03 2021 +0800 rtw89: fill regd field of limit/limit_ru tables by enum This modification just replaces the number filled in the regd field with the corresponding enum. No assignment of a value in a table is changed. Doing this first is because the follow-up patches may adjust the order of enum declarations. Signed-off-by: Zong-Zhe Yang Signed-off-by: Ping-Ke Shih Reviewed-by: Brian Norris Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211101093106.28848-2-pkshih@realtek.com commit cd455ebb748c4e198c8158e5d61b3034bf10f22b Author: Jing Yao Date: Wed Nov 10 02:53:41 2021 +0000 most: usb: replace snprintf in show functions with sysfs_emit coccicheck complains about the use of snprintf() in sysfs show functions: WARNING use scnprintf or sprintf Use sysfs_emit instead of scnprintf, snprintf or sprintf makes more sense. Reported-by: Zeal Robot Signed-off-by: Jing Yao Link: https://lore.kernel.org/r/20211110025341.136194-1-yao.jing2@zte.com.cn Signed-off-by: Greg Kroah-Hartman commit 1f8ff525f3d316116892852d5d39eeefa9fcb217 Author: Colin Ian King Date: Wed Nov 10 23:33:42 2021 +0000 speakup: remove redundant assignment of variable i The variable i is being initialized a value that is never read, it is re-assigned later on in a for-loop. The assignment is redundant and can be removed. Reviewed-by: Samuel Thibault Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20211110233342.1372516-1-colin.i.king@gmail.com Signed-off-by: Greg Kroah-Hartman commit b6379e73add8dc56ff2b7e5d88a8dce89a8ace56 Author: Zhaoyu Liu Date: Wed Nov 3 23:22:42 2021 +0800 scripts/tags: add space regexs to all regex_c When "make tags", it prompts a warning: ctags: Warning: drivers/pci/controller/pcie-apple.c:150: null expansion of name pattern "\1" The reason is that there is an indentation beside arguments of DECLARE_BITMAP, but it can parsed normally by gtags. It's also allowed in C. Regex [:space:] can match any white space character, so it's a better approach to add it to each item in regex_c. Suggested-by: Marc Zyngier Signed-off-by: Zhaoyu Liu Link: https://lore.kernel.org/r/20211103152234.GA23295@pc Signed-off-by: Greg Kroah-Hartman commit fe7a4f5b9548456246ffda143bab59922acda9fd Author: Ian Abbott Date: Wed Nov 17 12:06:03 2021 +0000 comedi: Move "comedi_isadma.h" to Some of the header files in "drivers/comedi/drivers/" are common enough to be useful to out-of-tree comedi driver modules. Using them for out-of-tree module builds is hampered by the headers being outside the "include/" directory so it is desirable to move them. There are about a half a dozen or so Comedi device drivers that use the "comedi_isadma" module to add ISA DMA support. The macros and declarations to use that module are in the "comedi_isadma.h" header file in the comedi "drivers" directory. Move it into "include/linux/comedi/". Signed-off-by: Ian Abbott Link: https://lore.kernel.org/r/20211117120604.117740-6-abbotti@mev.co.uk Signed-off-by: Greg Kroah-Hartman commit 44fb7affcfa4e968e9c2ede023ef0e15f06d8209 Author: Ian Abbott Date: Wed Nov 17 12:06:02 2021 +0000 comedi: Move "comedi_8254.h" to Some of the header files in "drivers/comedi/drivers/" are common enough to be useful to out-of-tree comedi driver modules. Using them for out-of-tree module builds is hampered by the headers being outside the "include/" directory so it is desirable to move them. There are about a couple of dozen or so Comedi device drivers that use the "comedi_8254" module to add timers based on the venerable 8254 Programmable Interval Timer chip. The macros and declarations to use that module are in the "comedi_8254.h" header file in the comedi "drivers" directory. Move it into "include/linux/comedi/". Signed-off-by: Ian Abbott Link: https://lore.kernel.org/r/20211117120604.117740-5-abbotti@mev.co.uk Signed-off-by: Greg Kroah-Hartman commit 631e272b12075b60f7c7fc4f84f937d78a699844 Author: Ian Abbott Date: Wed Nov 17 12:06:01 2021 +0000 comedi: Move and rename "8255.h" to Some of the header files in "drivers/comedi/drivers/" are common enough to be useful to out-of-tree comedi driver modules. Using them for out-of-tree module builds is hampered by the headers being outside the "include/" directory so it is desirable to move them. There are about a couple of dozen Comedi device drivers that use the "comedi_8255" module to add digital I/O subdevices based on the venerable 8255 Programmable Peripheral Interface chip. The macros and declarations to use that module are in the "8255.h" header file in the comedi "drivers" directory. Move it into "include/linux/comedi/" and rename it to "comedi_8255.h" for naming consistency reasons. Signed-off-by: Ian Abbott Link: https://lore.kernel.org/r/20211117120604.117740-4-abbotti@mev.co.uk Signed-off-by: Greg Kroah-Hartman commit 55d0f80ecf0be13c2fdfa0c0917436f88f6502ff Author: Ian Abbott Date: Wed Nov 17 12:06:00 2021 +0000 comedi: ni_routing: tools: Update due to moved COMEDI headers Building of the tools for converting the NI routing information between CSV files (for maintenance) and C files (for building) was broken by the move of the main COMEDI header files to "include/uapi/linux/" and "include/linux/". (These tools are not built as part of the normal kernel build process.) Fix it in the Makefile. A slight niggle is that `#include ` needs to work when compiling the `convert_c_to_py` program, but it cannot use a `-I` option referring to the "uapi" include directory because that interferes with inclusion of other system headers. So it uses `-I.` and makes a local copy (actually a symbolic link) as "./linux/comedi.h". Also remove some unneeded cruft such as the `-D"BIT(x)=(1<<(x))"` preprocessor flag. Signed-off-by: Ian Abbott Link: https://lore.kernel.org/r/20211117120604.117740-3-abbotti@mev.co.uk Signed-off-by: Greg Kroah-Hartman commit df0e68c1e9945e2ee86d266ce45597bbd8299b06 Author: Ian Abbott Date: Wed Nov 17 12:05:59 2021 +0000 comedi: Move the main COMEDI headers Move the main COMEDI driver headers out of "drivers/comedi/" into new directory "include/linux/comedi/". These are "comedidev.h", "comedilib.h", "comedi_pci.h", "comedi_pcmcia.h", and "comedi_usb.h". Additionally, move the user-space API header "comedi.h" into "include/uapi/linux/" and add "WITH Linux-syscall-note" to its SPDX-License-Identifier. Update the "COMEDI DRIVERS" section of the MAINTAINERS file to account for these changes. Signed-off-by: Ian Abbott Link: https://lore.kernel.org/r/20211117120604.117740-2-abbotti@mev.co.uk Signed-off-by: Greg Kroah-Hartman commit 6e22dc35837790a84fc040f08e5094b2d5d91477 Author: Claudio Suarez Date: Fri Nov 26 11:49:49 2021 +0100 drm: get rid of DRM_DEBUG_* log calls in drm core, files drm_a*.c DRM_DEBUG_* and DRM_* log calls are deprecated. Change them to drm_dbg_* / drm_{err,info,...} calls in drm core files. To avoid making a very big patch, this change is split in smaller patches. This one includes drm_a*.c Signed-off-by: Claudio Suarez Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/YaC7zXW119tlzfVh@gineta.localdomain commit 3f19fed8d0daed6e0e04b130d203d4333b757901 Author: Jiri Slaby Date: Fri Nov 26 09:16:11 2021 +0100 Documentation: add TTY chapter We now have all the kernel-doc comments in the code ready. So add a couple of documents dragging those into generated docs from Documentation/. There is only some sugar text around included kernel-docs here. It's a complete chapter, to be extended later as desired. This is a solid cornerstone for the time being, I believe. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211126081611.11001-24-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 31bc35d3346f24315c48ef8c92282c6c4f1bdd12 Author: Jiri Slaby Date: Fri Nov 26 09:16:10 2021 +0100 tty: add kernel-doc for tty_standard_install It is the only missing exported function which is not documented. Fix it. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211126081611.11001-23-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit f3e7614732b064942f56cdcee3bb23a9243c2e00 Author: Jiri Slaby Date: Fri Nov 26 09:16:09 2021 +0100 tty: more kernel-doc for tty_ldisc Extend and highlight tty_ldisc documentation for kernel-doc even more. We don't need to describe tty_ldisc_ref* functions again. Instead, just include their kernel-doc from code. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211126081611.11001-22-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 6f0535866199f8d9426b92c0e5c75866a49661fe Author: Jiri Slaby Date: Fri Nov 26 09:16:08 2021 +0100 tty: make tty_ldisc docs up-to-date Some of the docs in this document were a bit obsolete. Clean it up a bit and make it correspond to the current state. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211126081611.11001-21-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 7e6c0b22f466f1128f5fc962c487a19cf2a9825b Author: Jiri Slaby Date: Fri Nov 26 09:16:07 2021 +0100 tty: move tty_ldisc docs to new Documentation/tty/ Create a new directory in Documentation/ called tty. We will create more documents in it in the next patches, so let's have this one in the very same place. Change title accordingly and all the headers. This is the way what other documents look like in this directory in the next patches. So make this unified. And add a TOC. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211126081611.11001-20-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 3be491d74a95b15cd1a725bcb10208dca346ec7a Author: Jiri Slaby Date: Fri Nov 26 09:16:06 2021 +0100 tty: add kernel-doc for more tty_port functions From the main tty_port functions, only tty_port_destroy() was documented. Document more of them, so that we can reference them in Documentation/ later in this series. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211126081611.11001-19-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 385812835431c9055362f453da6d59e7dfcde430 Author: Jiri Slaby Date: Fri Nov 26 09:16:05 2021 +0100 tty: add kernel-doc for more tty_driver functions The only documented function for tty_driver structure allocation/registration was __tty_alloc_driver(). Fix highlighting in that comment. And add kernel-doc headers to all tty_driver_kref_put(), tty_register_driver(), and tty_unregister_driver() -- i.e. the main ones. More to follow later. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211126081611.11001-18-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 98629663bff8c2831f9cfd2b4e67537b24a48daa Author: Jiri Slaby Date: Fri Nov 26 09:16:04 2021 +0100 tty: reformat kernel-doc in n_tty.c Kernel-doc is a bit strict about some formatting. So fix these: 1) When there is a tab in comments, it thinks the line is a continuation one. So the description of the functions end up as descriptions of the last parameter described. Remove the tabs. 2) Remove newlines before parameters description and after the comments. This was not wrong per se, only inconsistent with the rest of the file. 3) Add periods to the end of sentences where appropriate. 4) Add "()" to function names and "%" to constants, so that they are properly highlighted. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211126081611.11001-17-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit c66453ce8af8bac78a72ba4e21fd9a86720127d7 Author: Jiri Slaby Date: Fri Nov 26 09:16:03 2021 +0100 tty: fix kernel-doc in n_tty.c * process_echoes doc was a misnomer * isig and n_tty_receive_char docs were misplaced * n_tty_read parameters were incorrect (from pre-cookie times) So fix all the warnings at once: 624: warning: expecting prototype for process_echoes(). Prototype was for __process_echoes() instead 1110: warning: expecting prototype for isig(). Prototype was for __isig() instead 1264: warning: expecting prototype for n_tty_receive_char(). Prototype was for n_tty_receive_char_special() instead 2067: warning: Excess function parameter 'buf' description in 'n_tty_read' 624: warning: expecting prototype for process_echoes(). Prototype was for __process_echoes() instead 1110: warning: expecting prototype for isig(). Prototype was for __isig() instead 1264: warning: expecting prototype for n_tty_receive_char(). Prototype was for n_tty_receive_char_special() instead 2067: warning: Function parameter or member 'kbuf' not described in 'n_tty_read' 2067: warning: Function parameter or member 'cookie' not described in 'n_tty_read' 2067: warning: Function parameter or member 'offset' not described in 'n_tty_read' 2067: warning: Excess function parameter 'buf' description in 'n_tty_read' Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211126081611.11001-16-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit bc17b7236b47f89681f48503660858532b918640 Author: Jiri Slaby Date: Fri Nov 26 09:16:02 2021 +0100 tty: reformat kernel-doc in tty_buffer.c Kernel-doc is a bit strict about some formatting. So fix these: 1) When there is a tab in comments, it thinks the line is a continuation one. So the description of the functions end up as descriptions of the last parameter described. Remove the tabs. 2) Remove newlines before parameters description and after the comments. This was not wrong per se, only inconsistent with the rest of the file. 3) Add periods to the end of sentences where appropriate. 4) Add "()" to function names and "%" to constants, so that they are properly highlighted. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211126081611.11001-15-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit cbb68f91995001c79a9b89dcf6a25d22c7b92872 Author: Jiri Slaby Date: Fri Nov 26 09:16:01 2021 +0100 tty: reformat kernel-doc in tty_ldisc.c Kernel-doc is a bit strict about some formatting. So fix these: 1) When there is a tab in comments, it thinks the line is a continuation one. So the description of the functions end up as descriptions of the last parameter described. Remove the tabs. 2) Remove newlines before parameters description and after the comments. This was not wrong per se, only inconsistent with the rest of the file. 3) Add periods to the end of sentences where appropriate. 4) Add "()" to function names and "%" to constants, so that they are properly highlighted. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211126081611.11001-14-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 796a75a98762f14006d2f941163b589f7ebcdf87 Author: Jiri Slaby Date: Fri Nov 26 09:16:00 2021 +0100 tty: reformat kernel-doc in tty_io.c Kernel-doc is a bit strict about some formatting. So fix these: 1) When there is a tab in comments, it thinks the line is a continuation one. So the description of the functions end up as descriptions of the last parameter described. Remove the tabs. 2) Remove newlines before parameters description and after the comments. This was not wrong per se, only inconsistent with the rest of the file. 3) Add periods to the end of sentences where appropriate. 4) Add "()" to function names and "%" to constants, so that they are properly highlighted. By the above, this patch also unifies these docs with the other kernel-doc's in this file. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211126081611.11001-13-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit cb6f6f9877928f6c3373f0b2088f05cda56344c5 Author: Jiri Slaby Date: Fri Nov 26 09:15:59 2021 +0100 tty: reformat kernel-doc in tty_port.c Kernel-doc is a bit strict about some formatting. So fix these: 1) When there is a tab in comments, it thinks the line is a continuation one. So the description of the functions end up as descriptions of the last parameter described. Remove the tabs. 2) Remove newlines before parameters description. This was not wrong per se, only inconsistent with the rest of the file. 3) Add periods to the end of sentences where appropriate. 4) Use recognized "Note" instead of "NB" (nota bene). 5) Add "()" to function names and "%" to constants, so that they are properly highlighted. By the above, this patch also unifies these docs with the other kernel-doc's in this file. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211126081611.11001-12-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 34d809f8b4ff68f63e8d7f71d93d150382c6bb8b Author: Jiri Slaby Date: Fri Nov 26 09:15:58 2021 +0100 tty: reformat TTY_DRIVER_ flags into kernel-doc We want to reference TTY_DRIVER_* flags in Documentation/ later in this series. But the current documentation in the TTY_DRIVER_*'s header does not allow that. Reformat it to kernel-doc using "DOC" directive and line-feeds, so that we can include it as it is. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211126081611.11001-11-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 4072254f96f954ec0d34899f15d987803b6d76a2 Author: Jiri Slaby Date: Fri Nov 26 09:15:57 2021 +0100 tty: reformat tty_struct::flags into kernel-doc Move the partial tty_struct::flags documentation from tty_ldisc to the tty.h header and combine it with the one-liners present there. Convert all those to kernel-doc. This way, we can simply reference the documentation in Documentation while the text is still along the definitions. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211126081611.11001-10-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 40f4268cddb93d17a11579920d940c2dca8b9445 Author: Jiri Slaby Date: Fri Nov 26 09:15:56 2021 +0100 tty: combine tty_ldisc_ops docs into kernel-doc In Documentation/driver-api/serial/tty.rst, there are duplicated texts about some struct tty_ldisc_ops' hooks. Combine them into existing kernel-doc comments of struct tty_ldisc_ops and drop them from the Documentation/. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211126081611.11001-9-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 29d5ef685948369602ccd5c04d2a215449c4b943 Author: Jiri Slaby Date: Fri Nov 26 09:15:55 2021 +0100 tty: combine tty_operations triple docs into kernel-doc In Documentation/driver-api/serial/tty.rst, there are triplicated texts about some struct tty_operations' hooks. Combine them into existing kernel-doc comments of struct tty_operations and drop them from the Documentation/. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211126081611.11001-8-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 0c6119f9f7dc03a53bd35ca5a77926eef3c33d10 Author: Jiri Slaby Date: Fri Nov 26 09:15:54 2021 +0100 tty: add kernel-doc for tty_ldisc_ops tty_ldisc_ops structure was already partially documented in a standalone comment in the header beginning. Move it right before the structure and reformat it so it complies to kernel-doc. That way, we can include it in Documentation/ later in this series. And add the documentation for the members where missing too. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211126081611.11001-7-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 630bf86d15778fd3e5df17cb6e00839d0f44a707 Author: Jiri Slaby Date: Fri Nov 26 09:15:53 2021 +0100 tty: add kernel-doc for tty_port_operations tty_port_operations used to have only comments along its members. Convert them into proper kernel-doc comments in front of the structure. And add some more explanation to them where needed. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211126081611.11001-6-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 1fe183091753b1d7f11e70593700c0c0ef268db7 Author: Jiri Slaby Date: Fri Nov 26 09:15:52 2021 +0100 tty: add kernel-doc for tty_operations tty_operations structure was already documented in a standalone comment in the header beginning. Move it right before the structure and reformat it so it complies to kernel-doc. That way, we can include it in Documentation/ later in this series. Note that we named proc_show's parameters, so that we can reference them in the text. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211126081611.11001-5-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit a6563830215226aae0e7e6802955c77a6a7b7547 Author: Jiri Slaby Date: Fri Nov 26 09:15:51 2021 +0100 tty: add kernel-doc for tty_driver tty_driver used to have only short comments along its members. Convert them into proper kernel-doc comments in front of the structure. And add some more explanation to them where needed. The whole structure handling is documented at the end too. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211126081611.11001-4-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 61c83addb77c65f498a8db0e7113dc3acf753c45 Author: Jiri Slaby Date: Fri Nov 26 09:15:50 2021 +0100 tty: add kernel-doc for tty_port tty_port used to have only short comments along its members. Convert them into proper kernel-doc comments in front of the structure. And add some more explanation to them where needed. The whole structure purpose and handling is documented at the end too -- some pieces of preexisting text moved to this place. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211126081611.11001-3-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 18e6c0751cf9ae0631a2623e31af2bf504f72c30 Author: Jiri Slaby Date: Fri Nov 26 09:15:49 2021 +0100 tty: finish kernel-doc of tty_struct members There are already pieces of kernel-doc documentation for struct tty_struct in tty.h. Finish the documentation for the members which were undocumented yet. It also includes tuning the already existing pieces like flow and ctrl, especially adding highlights to them. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211126081611.11001-2-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 4f4b9b5895614eb2e2b5f4cab7858f44bd113e1b Author: Tudor Ambarus Date: Thu Nov 25 11:00:18 2021 +0200 tty: serial: atmel: Call dma_async_issue_pending() The driver wrongly assummed that tx_submit() will start the transfer, which is not the case, now that the at_xdmac driver is fixed. tx_submit is supposed to push the current transaction descriptor to a pending queue, waiting for issue_pending to be called. issue_pending must start the transfer, not tx_submit. Fixes: 34df42f59a60 ("serial: at91: add rx dma support") Fixes: 08f738be88bb ("serial: at91: add tx dma support") Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20211125090028.786832-4-tudor.ambarus@microchip.com Signed-off-by: Greg Kroah-Hartman commit 1e67bd2b8cb90b66e89562598e9c2046246832d3 Author: Tudor Ambarus Date: Thu Nov 25 11:00:17 2021 +0200 tty: serial: atmel: Check return code of dmaengine_submit() The tx_submit() method of struct dma_async_tx_descriptor is entitled to do sanity checks and return errors if encountered. It's not the case for the DMA controller drivers that this client is using (at_h/xdmac), because they currently don't do sanity checks and always return a positive cookie at tx_submit() method. In case the controller drivers will implement sanity checks and return errors, print a message so that the client will be informed that something went wrong at tx_submit() level. Fixes: 08f738be88bb ("serial: at91: add tx dma support") Signed-off-by: Tudor Ambarus Acked-by: Richard Genoud Link: https://lore.kernel.org/r/20211125090028.786832-3-tudor.ambarus@microchip.com Signed-off-by: Greg Kroah-Hartman commit b4c80629c5c9d48880c5ad99943374f9ab72432e Author: Heinrich Schuchardt Date: Sun May 23 22:49:57 2021 +0200 include/linux/byteorder/generic.h: fix index variables In cpu_to_be32_array() and be32_to_cpu_array() the length of the array is given by variable len of type size_t. An index variable of type int is used to iterate over the array. This is bound to fail for len > INT_MAX and lets GCC add instructions for sign extension. Correct the type of the index variable. Signed-off-by: Heinrich Schuchardt Link: https://lore.kernel.org/r/20210523204958.64575-1-xypron.glpk@gmx.de Signed-off-by: Greg Kroah-Hartman commit 3ccadbce8543dc4b2933509042b3d7e71ef05976 Author: Matthew Auld Date: Fri Nov 26 11:08:43 2021 +0000 drm/i915/gemfs: don't mark huge_opt as static vfs_kernel_mount() modifies the passed in mount options, leaving us with "huge", instead of "huge=within_size". Normally this shouldn't matter with the usual module load/unload flow, however with the core_hotunplug IGT we are hitting the following, when re-probing the memory regions: i915 0000:00:02.0: [drm] Transparent Hugepage mode 'huge' tmpfs: Bad value for 'huge' [drm] Unable to create a private tmpfs mount, hugepage support will be disabled(-22). References: https://gitlab.freedesktop.org/drm/intel/-/issues/4651 Signed-off-by: Matthew Auld Cc: Tvrtko Ursulin Reviewed-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20211126110843.2028582-1-matthew.auld@intel.com commit f89d2cc3967af9948ffc58e4cc9a1331f1c4971a Author: Krishna Yarlagadda Date: Thu Nov 25 15:25:51 2021 +0530 spi: tegra210-quad: use devm call for cdata memory Use devm alloc call to allocate memory for spi controller data and remove free calls from cleanup. Signed-off-by: Krishna Yarlagadda Link: https://lore.kernel.org/r/1637834152-32093-1-git-send-email-kyarlagadda@nvidia.com Signed-off-by: Mark Brown commit f44a29ceb99fc99832ee1d55d7fe9c4dbf594660 Author: Tudor Ambarus Date: Thu Nov 25 14:41:10 2021 +0200 spi: atmel: Remove setting of deprecated member of struct dma_slave_config The 'direction' member of 'struct dma_slave_config' is deprecated. Instead, drivers should use the direction argument to the device_prep_slave_sg and device_prep_dma_cyclic functions or the dir field in the dma_interleaved_template structure. spi-atmel uses the direction argument to dmaengine_prep_slave_sg. slave_config.direction is not used in neither of the DMA controller drivers (at_h/xdmac) that spi-atmel is using, we can just remove the setting of slave_config.direction and live with whatever stack value is there. Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20211125124110.838037-3-tudor.ambarus@microchip.com Signed-off-by: Mark Brown commit c1b00674aab0c6950970e52c0f059756064a9e8c Author: Tudor Ambarus Date: Thu Nov 25 14:41:09 2021 +0200 spi: atmel: Drop slave_config argument in atmel_spi_dma_slave_config() The callers passed a pointer to slave_config as an argument of atmel_spi_dma_slave_config(), but they did not use it afterwards. Use instead a local variable in atmel_spi_dma_slave_config(), and stop passing arguments that are not needed in the callers. Signed-off-by: Tudor Ambarus Link: https://lore.kernel.org/r/20211125124110.838037-2-tudor.ambarus@microchip.com Signed-off-by: Mark Brown commit f8843e5e2dc85dc6a546ec130d76be66e62abed6 Author: Dominik Kobinski Date: Tue Nov 23 19:11:19 2021 +0100 regulator: qcom_spmi: Add pm8226 regulators The PM8226 PMIC is very often seen on MSM8x26 boards. Suggested-by: Ivaylo Ivanov Signed-off-by: Dominik Kobinski Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211123181119.2897-1-dominikkobinski314@gmail.com Signed-off-by: Mark Brown commit 76e95f331be09bac8764e971613439d294422d6e Author: Dominik Kobinski Date: Tue Nov 23 19:08:16 2021 +0100 dt-bindings: regulator: qcom: spmi-regulator: Document pm8226 compatible Suggested-by: Ivaylo Ivanov Signed-off-by: Dominik Kobinski Link: https://lore.kernel.org/r/20211123180816.2835-1-dominikkobinski314@gmail.com Signed-off-by: Mark Brown commit 4dcddadf5530a0da00e6b2eb8194297b49d33506 Author: Geert Uytterhoeven Date: Tue Nov 23 11:30:13 2021 +0100 ASoC: SOF: mediatek: Use %pR/%pa to print resources/physical addresses On 32-bit with CONFIG_ARCH_DMA_ADDR_T_64BIT=n: sound/soc/sof/mediatek/mt8195/mt8195.c: In function ‘platform_parse_resource’: sound/soc/sof/mediatek/mt8195/mt8195.c:51:15: error: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘unsigned int’ [-Werror=format=] 51 | dev_dbg(dev, "DMA pbase=0x%llx, size=0x%llx\n", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sound/soc/sof/mediatek/mt8195/mt8195.c: In function ‘adsp_memory_remap_init’: sound/soc/sof/mediatek/mt8195/mt8195.c:167:15: error: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘phys_addr_t’ {aka ‘unsigned int’} [-Werror=format=] 167 | dev_dbg(dev, "adsp->pa_dram %llx, offset %#x\n", adsp->pa_dram, offset); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sound/soc/sof/mediatek/mt8195/mt8195.c: In function ‘adsp_shared_base_ioremap’: sound/soc/sof/mediatek/mt8195/mt8195.c:196:15: error: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 5 has type ‘phys_addr_t’ {aka ‘unsigned int’} [-Werror=format=] 196 | dev_dbg(dev, "shared-dram vbase=%p, phy addr :%llx, size=%#x\n", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fix the first cases by printing the full resource using %pR. Fix the other cases by printing the physical addresses using %pa. Reported-by: noreply@ellerman.id.au Fixes: 32d7e03d26fd9318 ("ASoC: SOF: mediatek: Add mt8195 hardware support") Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20211123103013.73645-1-geert@linux-m68k.org Signed-off-by: Mark Brown commit a5e0091d62abb9599d9dea505ec0e8c820001831 Author: Lucas Tanure Date: Thu Nov 25 14:35:01 2021 +0000 ASoC: cs35l41: Fix link problem Can't link I2C and SPI to the same binary, better to move CS35L41 to 3 modules approach. And instead of exposing cs35l41_reg, volatile_reg, readable_reg and precious_reg arrays, move cs35l41_regmap_i2c/spi to new module and expose it. Signed-off-by: Lucas Tanure Link: https://lore.kernel.org/r/20211125143501.7720-1-tanureal@opensource.cirrus.com Signed-off-by: Mark Brown commit 0b189395945dc59d327c1e0588d144ce439dfa55 Author: Paul Cercueil Date: Thu Nov 25 23:25:43 2021 +0000 ASoC: codecs/jz4770: Add missing gain control after DAC/ADC mixer The capture and playback paths both have a configurable gain after their respective mixer, which can be set from -31 dB to 0 dB in 32 steps. Signed-off-by: Paul Cercueil Link: https://lore.kernel.org/r/20211125232543.117074-1-paul@crapouillou.net Signed-off-by: Mark Brown commit f670b274f7f6f4b2722d7f08d0fddf606a727e92 Author: Ye Guojin Date: Wed Nov 10 00:29:10 2021 +0000 ASoC: imx-hdmi: add put_device() after of_find_device_by_node() This was found by coccicheck: ./sound/soc/fsl/imx-hdmi.c,209,1-7,ERROR missing put_device; call of_find_device_by_node on line 119, but without a corresponding object release within this function. Reported-by: Zeal Robot Signed-off-by: Ye Guojin Link: https://lore.kernel.org/r/20211110002910.134915-1-ye.guojin@zte.com.cn Signed-off-by: Mark Brown commit 69acac569031426e2ab9b5244593b60d0c9abd04 Author: Ranjani Sridharan Date: Thu Nov 25 12:15:20 2021 +0200 ASoC: SOF: Intel: hda: send DAI_CONFIG IPC during pause For HDA DAI's the DMA must be paused after the RUN bit is cleared by the host. So, send the DAI_CONFIG IPC with just the SOF_DAI_CONFIG_FLAGS_PAUSE flag set to indicate this to the firmware. Signed-off-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20211125101520.291581-11-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit a0f84dfb3f6d9f78f862cbe885036d3e4449fc6f Author: Ranjani Sridharan Date: Thu Nov 25 12:15:19 2021 +0200 ASoC: SOF: IPC: dai: Expand DAI_CONFIG IPC flags Some DAI components, such as HDaudio, need to be stopped in two steps a) stop the DAI component b) stop the DAI DMA This patch enables this two-step stop by expanding the DAI_CONFIG IPC flags and split them into 2 parts. The 4 LSB bits indicate when the DAI_CONFIG IPC is sent, ex: hw_params, hw_free or pause. The 4 MSB bits are used as the quirk flags to be used along with the command flags. The quirk flag called SOF_DAI_CONFIG_FLAGS_2_STEP_STOP shall be set along with the HW_PARAMS command flag, i.e. before the pipeline is started so that the stop/pause trigger op in the FW can take the appropriate action to either perform/skip the DMA stop. If set, the DMA stop will be executed when the DAI_CONFIG IPC is sent during hw_free. In the case of pause, DMA pause will be handled when the DAI_CONFIG IPC is sent with the PAUSE command flag. Along with this, modify the signature for the hda_ctrl_dai_widget_setup/ hda_ctrl_dai_widget_free() functions to take additional flags as an argument and modify all users to pass the appropriate quirk flags. Only the HDA DAI's need to pass the SOF_DAI_CONFIG_FLAGS_2_STEP_STOP quirk flag during hw_params to indicate that it supports two-step stop and pause. Signed-off-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20211125101520.291581-10-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit 0b639dcd457b1d3fc660e5a77b02cf65acde3b5a Author: Ranjani Sridharan Date: Thu Nov 25 12:15:18 2021 +0200 ASoC: SOF: align the hw_free sequence with stop Even though the order of stopping the DMA and freeing the widget list is not important, align the sequence to match with the stop trigger to avoid confusion. Signed-off-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20211125101520.291581-9-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit 85d7acd0ef18725b1d3a7980eee8b84d46296b91 Author: Ranjani Sridharan Date: Thu Nov 25 12:15:17 2021 +0200 ASoC: SOF: pcm: move the check for prepared flag Move the check for the prepared flag inside snd_pcm_dsp_pcm_free() to avoid having to check it before every invocation of the function. Signed-off-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20211125101520.291581-8-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit d9a7246534753efa383ad8d05ab3691df846c4b4 Author: Ranjani Sridharan Date: Thu Nov 25 12:15:16 2021 +0200 ASoC: SOF: Add a helper for freeing PCM stream Add a helper function to free PCM in the FW, stop the DMA and free the widget list. These actions are performed both during PCM trigger STOP and when a paused stream is freed during system suspend. Signed-off-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20211125101520.291581-7-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit 47934e0fcbbe2bf488bcae2d68431b9ea5972488 Author: Ranjani Sridharan Date: Thu Nov 25 12:15:15 2021 +0200 ASoC: SOF: call platform hw_free for paused streams during suspend Paused streams must be stopped and platform hw_free should be invoked during system suspend so they can be restarted properly after system resume. Signed-off-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20211125101520.291581-6-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit 0dd71a3340b92b503278af4565156f086ccbca3f Author: Ranjani Sridharan Date: Thu Nov 25 12:15:14 2021 +0200 ASoC: SOF: pcm: invoke platform hw_free for STOP/SUSPEND triggers snd_sof_pcm_platform_hw_params() will be called when the stream is restarted with a prepare ioctl. This happens in two cases i.e. when a suspended stream is resumed or when a stream is restarted without intermediate call to sof_pcm_hw_free(). Make sure to call snd_sof_pcm_platform_hw_free() in both these cases to keep it balanced. Signed-off-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20211125101520.291581-5-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit 4794601a52d40a425542be1b88f8f5614fcf45b4 Author: Ranjani Sridharan Date: Thu Nov 25 12:15:13 2021 +0200 ASoC: SOF: Intel: hda: reset stream before coupling host and link DMA's The recommended programming sequence for HD-Audio DMA is to reset the stream before coupling the link and host DMA's. Signed-off-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20211125101520.291581-4-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit 2b1acedccf36434924ae530410e008e7eb427cd3 Author: Ranjani Sridharan Date: Thu Nov 25 12:15:12 2021 +0200 ASoC: SOF: Intel: hda: Add a helper function for stream reset Add a helper function to perform stream reset. Signed-off-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20211125101520.291581-3-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit e14cddc5888418cc9f2ba66c01a04cdbab3b5b25 Author: Ranjani Sridharan Date: Thu Nov 25 12:15:11 2021 +0200 ASoC: SOF: Intel: hda: clear stream before freeing the DAI widget The DAI_CONFIG IPC that is sent during the STOP trigger is used for stopping the DMA in the FW. This must be done after the DMA RUN bit is cleared by the host. So move the call to snd_hdac_ext_link_stream_clear() before hda_link_dai_widget_update() to follow the correct programming sequence for DMA stop for HDA DAIs. Signed-off-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20211125101520.291581-2-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit cdda01947bbae8f1b1d19f8aac1f81ae5ce6f37e Author: Kieran Bingham Date: Fri Nov 26 09:54:42 2021 +0000 arm64: dts: renesas: r8a779a0: Add DU support Provide the device nodes for the DU on the V3U platforms. Reviewed-by: Laurent Pinchart Signed-off-by: Kieran Bingham Link: https://lore.kernel.org/r/20211126095445.932930-2-kieran.bingham+renesas@ideasonboard.com Signed-off-by: Geert Uytterhoeven commit bd4fa23731a5786a8aa711945a5b76aa62b86117 Author: Kieran Bingham Date: Wed Nov 24 15:28:15 2021 +0000 arm64: dts: renesas: salvator-common: Merge hdmi0_con The remote endpoint for the hdmi connector is specfied through a reference to the hdmi0_con endpoint, which is in the same file. Simplify by specifying the remote-endpoint directly in the hdmi0_con endpoint. Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart Link: https://lore.kernel.org/r/20211124152815.3926961-3-kieran.bingham+renesas@ideasonboard.com Signed-off-by: Geert Uytterhoeven commit 9fd8bbefc31286e702e8cc9fe8766301f02fd4be Author: Kieran Bingham Date: Wed Nov 24 15:28:14 2021 +0000 arm64: dts: renesas: ulcb: Merge hdmi0_con The remote endpoint for the hdmi connector is specfied through a reference to the hdmi0_con endpoint, which is in the same file. Simplify by specifying the remote-endpoint directly in the hdmi0_con endpoint. Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart Link: https://lore.kernel.org/r/20211124152815.3926961-2-kieran.bingham+renesas@ideasonboard.com Signed-off-by: Geert Uytterhoeven commit 36959e2108b6e3d66a3a6a1526e8e45f8abad14c Author: Biju Das Date: Wed Nov 24 15:43:16 2021 +0000 arm64: dts: renesas: r9a07g044: Add OPP table Add OPP table for RZ/G2L SoC. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211124154316.28365-1-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 7744b393c95ac470a3ac279fa277e50d947f1bea Author: Geert Uytterhoeven Date: Wed Nov 24 15:39:40 2021 +0100 arm64: dts: renesas: Fix operating point table node names Align the node names of device nodes representing operating point v2 tables with the expectations of the DT bindings in Documentation/devicetree/bindings/opp/opp-v2.yaml. Signed-off-by: Geert Uytterhoeven Reviewed-by: Niklas Söderlund Link: https://lore.kernel.org/r/ac885456ffb00fa4cc4069b9967761df2c98c3d8.1637764588.git.geert+renesas@glider.be commit 44c2d2c2d25e87741b84aaa9e0dad396abdd148d Author: Biju Das Date: Tue Nov 23 14:14:20 2021 +0000 arm64: dts: renesas: rzg2l-smarc-som: Enable watchdog Enable watchdog{0, 1, 2} interfaces on RZ/G2L SMARC EVK. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211123141420.23529-3-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit eb7621ce3362639025e7db125559e235a76d814f Author: Biju Das Date: Tue Nov 23 14:14:19 2021 +0000 arm64: dts: renesas: r9a07g044: Add WDT nodes Add WDT{0, 1, 2} nodes to RZ/G2L SoC DTSI. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211123141420.23529-2-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit fee3eae1334a454a8c2e16313a374cc53ff722d8 Author: Biju Das Date: Mon Nov 22 10:39:05 2021 +0000 arm64: dts: renesas: r9a07g044: Rename SDHI clocks Rename the below SDHI clocks to match with the clocks used in driver. imclk->core clk_hs->clkh imclk2->cd Also re-arrange the clocks to match with the sorting order used in the binding document. Signed-off-by: Biju Das Acked-by: Ulf Hansson Link: https://lore.kernel.org/r/20211122103905.14439-3-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit c81bd70f47cef36f88074d119e6e49cf92707fdb Author: Lad Prabhakar Date: Sun Nov 21 23:49:06 2021 +0000 arm64: dts: renesas: rzg2l-smarc-som: Enable serial NOR flash Enable mt25qu512a flash connected to QSPI0. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20211121234906.9602-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 00d071e23c61b1be528227427da3f805feddef19 Author: Biju Das Date: Thu Nov 18 19:18:25 2021 +0000 arm64: dts: renesas: rzg2l-smarc-som: Enable OSTM Enable OSTM{1, 2} interfaces on RZ/G2L SMARC EVK. OSTM0 is reserved for TF-A. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211118191826.2026-3-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 59a7d68b69846ac012c33c1ac425b9388661d1f2 Author: Biju Das Date: Thu Nov 18 19:18:24 2021 +0000 arm64: dts: renesas: r9a07g044: Add OSTM nodes Add OSTM{0,1,2} nodes to RZ/G2L SoC DTSI. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211118191826.2026-2-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 5fcf8b0656cf842ae642298c2874ea6148d0129d Author: Biju Das Date: Fri Nov 12 08:10:02 2021 +0000 arm64: dts: renesas: r9a07g044: Sort psci node Sort psci node alphabetically. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211112081003.15453-4-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 33b22d9c3272003a525ba2d6b7b851f3d4f30574 Author: Biju Das Date: Sat Nov 20 18:04:38 2021 +0000 clk: renesas: r9a07g044: Add TSU clock and reset entry Add TSU clock and reset entry to CPG driver. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211120180438.8351-1-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 45177fc641f9de58180af158d1fac8defa99afca Author: Wolfram Sang Date: Wed Nov 17 11:38:50 2021 +0100 mmc: renesas_sdhi: Simplify an expression We already have 'quirks', no need to go via 'priv'. Signed-off-by: Wolfram Sang Acked-by: Ulf Hansson Reviewed-by: Niklas Söderlund Link: https://lore.kernel.org/r/20211117103850.28397-1-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven commit 366df82fc68a9db22ab9de890a372d79662e397c Author: Geert Uytterhoeven Date: Tue Nov 16 14:36:07 2021 +0100 mmc: renesas_sdhi: Use devm_clk_get_optional() to obtain CD clock Use the existing devm_clk_get_optional() helper to obtain the optional Card Detect clock, instead of open-coding the same operation. a side effect, real errors will now be handled correctly instead of being ignored. Signed-off-by: Geert Uytterhoeven Acked-by: Ulf Hansson Reviewed-by: Wolfram Sang Link: https://lore.kernel.org/r/540d803d31bf9aa1d0f78f431cae0ccd05387edc.1637069733.git.geert+renesas@glider.be commit 217c7d1840b5377543eff84fe28409d0bd4d3433 Author: Biju Das Date: Mon Nov 22 10:39:04 2021 +0000 dt-bindings: mmc: renesas,sdhi: Rename RZ/G2L clocks Rename the below RZ/G2L clocks to match with the clock names used in R-Car Gen2 and later generations. imclk->core clk_hs->clkh imclk2->cd This changes will avoid using fallback for RZ/G2L high speed clock, if "clkh" is not used in device tree and also the code changes in driver related to this clocks. Signed-off-by: Biju Das Reviewed-by: Wolfram Sang Acked-by: Ulf Hansson Link: https://lore.kernel.org/r/20211122103905.14439-2-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 7a0df1f969c14939f60a7f9a6af72adcc314675f Author: Peng Fan Date: Fri Nov 12 14:31:55 2021 +0800 arm64: dts: ti: k3-j721e: correct cache-sets info A72 Cluster has 48KB Icache, 32KB Dcache and 1MB L2 Cache - ICache is 3-way set-associative - Dcache is 2-way set-associative - Line size are 64bytes So correct the cache-sets info. Fixes: 2d87061e70dea ("arm64: dts: ti: Add Support for J721E SoC") Signed-off-by: Peng Fan Reviewed-by: Nishanth Menon Signed-off-by: Vignesh Raghavendra Link: https://lore.kernel.org/r/20211112063155.3485777-1-peng.fan@oss.nxp.com commit fb5f6a0e8063b7a84d6d44ef353846ccd7708d2e Author: Kees Cook Date: Thu Nov 18 12:38:39 2021 -0800 mac80211: Use memset_after() to clear tx status In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Use memset_after() so memset() doesn't get confused about writing beyond the destination member that is intended to be the starting point of zeroing through the end of the struct. Additionally fix the common helper, ieee80211_tx_info_clear_status(), which was not clearing ack_signal, but the open-coded versions did. Johannes Berg points out this bug was introduced by commit e3e1a0bcb3f1 ("mac80211: reduce IEEE80211_TX_MAX_RATES") but was harmless. Also drops the associated unneeded BUILD_BUG_ON()s, and adds a note to carl9170 about usage. Signed-off-by: Kees Cook Tested-by: Christian Lamparter [both CARL9170+P54USB on real HW] Link: https://lore.kernel.org/r/20211118203839.1289276-1-keescook@chromium.org Signed-off-by: Johannes Berg commit eb87d3e08992b2939d91b649630dfa11f4d2cd75 Author: John Crispin Date: Wed Nov 17 16:27:27 2021 +0530 mac80211: notify non-transmitting BSS of color changes When color change is triggered in multiple bssid case, allow only for transmitting BSS, and when it changes its bss color, notify the non transmitting BSSs also of the new bss color. Signed-off-by: John Crispin Co-developed-by: Lavanya Suresh Signed-off-by: Lavanya Suresh Co-developed-by: Rameshkumar Sundaram Signed-off-by: Rameshkumar Sundaram Link: https://lore.kernel.org/r/1637146647-16282-1-git-send-email-quic_ramess@quicinc.com Signed-off-by: Johannes Berg commit dc53078320108936106906c5441122ae34ab1d65 Author: Peter Seiderer Date: Tue Nov 16 23:12:44 2021 +0100 mac80211: minstrel_ht: remove unused SAMPLE_SWITCH_THR define Remove unused SAMPLE_SWITCH_THR define. Signed-off-by: Peter Seiderer Link: https://lore.kernel.org/r/20211116221244.30844-1-ps.report@gmx.net Signed-off-by: Johannes Berg commit 8415816493b7589e74ff4e1e7eaf3aadc7b73621 Author: Lorenzo Bianconi Date: Tue Nov 16 15:03:36 2021 +0100 cfg80211: allow continuous radar monitoring on offchannel chain Allow continuous radar detection on the offchannel chain in order to switch to the monitored channel whenever the underlying driver reports a radar pattern on the main channel. Tested-by: Owen Peng Signed-off-by: Lorenzo Bianconi Link: https://lore.kernel.org/r/d46217310a49b14ff0e9c002f0a6e0547d70fd2c.1637071350.git.lorenzo@kernel.org Signed-off-by: Johannes Berg commit c47240cb46a10c40686ce4e25c64aaed676f71c9 Author: Lorenzo Bianconi Date: Tue Nov 16 12:41:52 2021 +0100 cfg80211: schedule offchan_cac_abort_wk in cfg80211_radar_event If necessary schedule offchan_cac_abort_wk work in cfg80211_radar_event routine adding offchan parameter to cfg80211_radar_event signature. Rename cfg80211_radar_event in __cfg80211_radar_event and introduce the two following inline helpers: - cfg80211_radar_event - cfg80211_offchan_radar_event Doing so the drv will not need to run cfg80211_offchan_cac_abort() after radar detection on the offchannel chain. Tested-by: Owen Peng Signed-off-by: Lorenzo Bianconi Link: https://lore.kernel.org/r/3ff583e021e3343a3ced54a7b09b5e184d1880dc.1637062727.git.lorenzo@kernel.org Signed-off-by: Johannes Berg commit 3536672bbdc2e7093333be85c945a63aef4c6bb8 Author: liuguoqiang Date: Mon Nov 15 17:21:39 2021 +0800 cfg80211: delete redundant free code When kzalloc failed and rdev->sacn_req or rdev->scan_msg is null, pass a null pointer to kfree is redundant, delete it and return directly. Signed-off-by: liuguoqiang Link: https://lore.kernel.org/r/20211115092139.24407-1-liuguoqiang@uniontech.com [remove now unused creq = NULL assigment] Signed-off-by: Johannes Berg commit d787a3e38f01bfc4566df4e85d432a29d192e637 Author: Felix Fietkau Date: Fri Nov 12 12:22:23 2021 +0100 mac80211: add support for .ndo_fill_forward_path This allows drivers to provide a destination device + info for flow offload Only supported in combination with 802.3 encap offload Signed-off-by: Felix Fietkau Tested-by: Lorenzo Bianconi Link: https://lore.kernel.org/r/20211112112223.1209-1-nbd@nbd.name Signed-off-by: Johannes Berg commit 71abf71e9e634a55b1156f4aaae6122207f4b8ef Author: luo penghao Date: Thu Nov 4 06:14:11 2021 +0000 mac80211: Remove unused assignment statements The assignment of these three local variables in the file will not be used in the corresponding functions, so they should be deleted. The clang_analyzer complains as follows: net/mac80211/wpa.c:689:2 warning: net/mac80211/wpa.c:883:2 warning: net/mac80211/wpa.c:452:2 warning: Value stored to 'hdr' is never read Reported-by: Zeal Robot Signed-off-by: luo penghao Link: https://lore.kernel.org/r/20211104061411.1744-1-luo.penghao@zte.com.cn Signed-off-by: Johannes Berg commit 91e89c77322d2a65ede9f418642942f3c096a63b Author: Lorenzo Bianconi Date: Wed Nov 3 18:02:35 2021 +0100 cfg80211: fix possible NULL pointer dereference in cfg80211_stop_offchan_radar_detection Fix the following NULL pointer dereference in cfg80211_stop_offchan_radar_detection routine that occurs when hostapd is stopped during the CAC on offchannel chain: Sat Jan 1 0[ 779.567851] ESR = 0x96000005 0:12:50 2000 dae[ 779.572346] EC = 0x25: DABT (current EL), IL = 32 bits mon.debug hostap[ 779.578984] SET = 0, FnV = 0 d: hostapd_inter[ 779.583445] EA = 0, S1PTW = 0 face_deinit_free[ 779.587936] Data abort info: : num_bss=1 conf[ 779.592224] ISV = 0, ISS = 0x00000005 ->num_bss=1 Sat[ 779.597403] CM = 0, WnR = 0 Jan 1 00:12:50[ 779.601749] user pgtable: 4k pages, 39-bit VAs, pgdp=00000000418b2000 2000 daemon.deb[ 779.609601] [0000000000000000] pgd=0000000000000000, p4d=0000000000000000, pud=0000000000000000 ug hostapd: host[ 779.619657] Internal error: Oops: 96000005 [#1] SMP [ 779.770810] CPU: 0 PID: 2202 Comm: hostapd Not tainted 5.10.75 #0 [ 779.776892] Hardware name: MediaTek MT7622 RFB1 board (DT) [ 779.782370] pstate: 80000005 (Nzcv daif -PAN -UAO -TCO BTYPE=--) [ 779.788384] pc : cfg80211_chandef_valid+0x10/0x490 [cfg80211] [ 779.794128] lr : cfg80211_check_station_change+0x3190/0x3950 [cfg80211] [ 779.800731] sp : ffffffc01204b7e0 [ 779.804036] x29: ffffffc01204b7e0 x28: ffffff80039bdc00 [ 779.809340] x27: 0000000000000000 x26: ffffffc008cb3050 [ 779.814644] x25: 0000000000000000 x24: 0000000000000002 [ 779.819948] x23: ffffff8002630000 x22: ffffff8003e748d0 [ 779.825252] x21: 0000000000000cc0 x20: ffffff8003da4a00 [ 779.830556] x19: 0000000000000000 x18: ffffff8001bf7ce0 [ 779.835860] x17: 00000000ffffffff x16: 0000000000000000 [ 779.841164] x15: 0000000040d59200 x14: 00000000000019c0 [ 779.846467] x13: 00000000000001c8 x12: 000636b9e9dab1c6 [ 779.851771] x11: 0000000000000141 x10: 0000000000000820 [ 779.857076] x9 : 0000000000000000 x8 : ffffff8003d7d038 [ 779.862380] x7 : 0000000000000000 x6 : ffffff8003d7d038 [ 779.867683] x5 : 0000000000000e90 x4 : 0000000000000038 [ 779.872987] x3 : 0000000000000002 x2 : 0000000000000004 [ 779.878291] x1 : 0000000000000000 x0 : 0000000000000000 [ 779.883594] Call trace: [ 779.886039] cfg80211_chandef_valid+0x10/0x490 [cfg80211] [ 779.891434] cfg80211_check_station_change+0x3190/0x3950 [cfg80211] [ 779.897697] nl80211_radar_notify+0x138/0x19c [cfg80211] [ 779.903005] cfg80211_stop_offchan_radar_detection+0x7c/0x8c [cfg80211] [ 779.909616] __cfg80211_leave+0x2c/0x190 [cfg80211] [ 779.914490] cfg80211_register_netdevice+0x1c0/0x6d0 [cfg80211] [ 779.920404] raw_notifier_call_chain+0x50/0x70 [ 779.924841] call_netdevice_notifiers_info+0x54/0xa0 [ 779.929796] __dev_close_many+0x40/0x100 [ 779.933712] __dev_change_flags+0x98/0x190 [ 779.937800] dev_change_flags+0x20/0x60 [ 779.941628] devinet_ioctl+0x534/0x6d0 [ 779.945370] inet_ioctl+0x1bc/0x230 [ 779.948849] sock_do_ioctl+0x44/0x200 [ 779.952502] sock_ioctl+0x268/0x4c0 [ 779.955985] __arm64_sys_ioctl+0xac/0xd0 [ 779.959900] el0_svc_common.constprop.0+0x60/0x110 [ 779.964682] do_el0_svc+0x1c/0x24 [ 779.967990] el0_svc+0x10/0x1c [ 779.971036] el0_sync_handler+0x9c/0x120 [ 779.974950] el0_sync+0x148/0x180 [ 779.978259] Code: a9bc7bfd 910003fd a90153f3 aa0003f3 (f9400000) [ 779.984344] ---[ end trace 0e67b4f5d6cdeec7 ]--- [ 779.996400] Kernel panic - not syncing: Oops: Fatal exception [ 780.002139] SMP: stopping secondary CPUs [ 780.006057] Kernel Offset: disabled [ 780.009537] CPU features: 0x0000002,04002004 [ 780.013796] Memory Limit: none Fixes: b8f5facf286b ("cfg80211: implement APIs for dedicated radar detection HW") Reported-by: Evelyn Tsai Tested-by: Evelyn Tsai Signed-off-by: Lorenzo Bianconi Link: https://lore.kernel.org/r/c2e34c065bf8839c5ffa45498ae154021a72a520.1635958796.git.lorenzo@kernel.org Signed-off-by: Johannes Berg commit 23cddeb5a7705daf305f02bd01ff73598ebd6461 Author: Loic Poulain Date: Mon Nov 22 19:04:11 2021 +0100 wcn36xx: Use correct SSN for ADD BA request Since firmware uses its own sequence number counters, we need to use firmware number as well when mac80211 generates the ADD_BA request packet. Indeed the firmware sequence counters tend to slightly drift from the mac80211 ones because of firmware offload features like ARP responses. This causes the starting sequence number field of the ADD_BA request to be unaligned, and can possibly cause issues with strict/picky APs. To fix this, we retrieve the current firmware sequence number for a given TID through the smd_trigger_ba API, and use that number as replacement of the mac80211 starting sequence number. This change also ensures that any issue in the smd *ba procedures will cause the ba action to properly fail, and remove useless call to smd_trigger_ba() from IEEE80211_AMPDU_RX_START. Signed-off-by: Loic Poulain Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1637604251-11763-1-git-send-email-loic.poulain@linaro.org commit b689f091aafd1a874b2f88137934276ab0fca480 Author: Anilkumar Kolli Date: Wed Nov 24 19:11:31 2021 +0200 ath11k: Use host CE parameters for CE interrupts configuration CE interrupt configuration uses host ce parameters to assign/free interrupts. Use host ce parameters to enable/disable interrupts. This patch fixes below BUG, BUG: KASAN: global-out-of-bounds in 0xffffffbffdfb035c at addr ffffffbffde6eeac Read of size 4 by task kworker/u8:2/132 Address belongs to variable ath11k_core_qmi_firmware_ready+0x1b0/0x5bc [ath11k] OOB is due to ath11k_ahb_ce_irqs_enable() iterates ce_count(which is 12) times and accessing 12th element in target_ce_config (which has only 11 elements) from ath11k_ahb_ce_irq_enable(). With this change host ce configs are used to enable/disable interrupts. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-00471-QCAHKSWPL_SILICONZ-1 Fixes: 967c1d1131fa ("ath11k: move target ce configs to hw_params") Signed-off-by: Anilkumar Kolli Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1637249558-12793-1-git-send-email-akolli@codeaurora.org commit 8b91cdd4f8649560a8ac37b134008fe67d94ad4d Author: Thomas Hellström Date: Mon Nov 8 18:45:45 2021 +0100 drm/i915: Use __GFP_KSWAPD_RECLAIM in the capture code The capture code is typically run entirely in the fence signalling critical path. We're about to add lockdep annotation in an upcoming patch which reveals a lockdep splat similar to the below one. Fix the associated potential deadlocks using __GFP_KSWAPD_RECLAIM (which is the same as GFP_WAIT, but open-coded for clarity) rather than GFP_KERNEL for memory allocation in the capture path. This has the potential drawback that capture might fail in situations with memory pressure. [ 234.842048] WARNING: possible circular locking dependency detected [ 234.842050] 5.15.0-rc7+ #20 Tainted: G U W [ 234.842052] ------------------------------------------------------ [ 234.842054] gem_exec_captur/1180 is trying to acquire lock: [ 234.842056] ffffffffa3e51c00 (fs_reclaim){+.+.}-{0:0}, at: __kmalloc+0x4d/0x330 [ 234.842063] but task is already holding lock: [ 234.842064] ffffffffa3f57620 (dma_fence_map){++++}-{0:0}, at: i915_vma_snapshot_resource_pin+0x27/0x30 [i915] [ 234.842138] which lock already depends on the new lock. [ 234.842140] the existing dependency chain (in reverse order) is: [ 234.842142] -> #2 (dma_fence_map){++++}-{0:0}: [ 234.842145] __dma_fence_might_wait+0x41/0xa0 [ 234.842149] dma_resv_lockdep+0x1dc/0x28f [ 234.842151] do_one_initcall+0x58/0x2d0 [ 234.842154] kernel_init_freeable+0x273/0x2bf [ 234.842157] kernel_init+0x16/0x120 [ 234.842160] ret_from_fork+0x1f/0x30 [ 234.842163] -> #1 (mmu_notifier_invalidate_range_start){+.+.}-{0:0}: [ 234.842166] fs_reclaim_acquire+0x6d/0xd0 [ 234.842168] __kmalloc_node+0x51/0x3a0 [ 234.842171] alloc_cpumask_var_node+0x1b/0x30 [ 234.842174] native_smp_prepare_cpus+0xc7/0x292 [ 234.842177] kernel_init_freeable+0x160/0x2bf [ 234.842179] kernel_init+0x16/0x120 [ 234.842181] ret_from_fork+0x1f/0x30 [ 234.842184] -> #0 (fs_reclaim){+.+.}-{0:0}: [ 234.842186] __lock_acquire+0x1161/0x1dc0 [ 234.842189] lock_acquire+0xb5/0x2b0 [ 234.842192] fs_reclaim_acquire+0xa1/0xd0 [ 234.842193] __kmalloc+0x4d/0x330 [ 234.842196] i915_vma_coredump_create+0x78/0x5b0 [i915] [ 234.842253] intel_engine_coredump_add_vma+0x36/0xe0 [i915] [ 234.842307] __i915_gpu_coredump+0x290/0x5e0 [i915] [ 234.842365] i915_capture_error_state+0x57/0xa0 [i915] [ 234.842415] intel_gt_handle_error+0x348/0x3e0 [i915] [ 234.842462] intel_gt_debugfs_reset_store+0x3c/0x90 [i915] [ 234.842504] simple_attr_write+0xc1/0xe0 [ 234.842507] full_proxy_write+0x53/0x80 [ 234.842509] vfs_write+0xbc/0x350 [ 234.842513] ksys_write+0x58/0xd0 [ 234.842514] do_syscall_64+0x38/0x90 [ 234.842516] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 234.842519] other info that might help us debug this: [ 234.842521] Chain exists of: fs_reclaim --> mmu_notifier_invalidate_range_start --> dma_fence_map [ 234.842526] Possible unsafe locking scenario: [ 234.842528] CPU0 CPU1 [ 234.842529] ---- ---- [ 234.842531] lock(dma_fence_map); [ 234.842532] lock(mmu_notifier_invalidate_range_start); [ 234.842535] lock(dma_fence_map); [ 234.842537] lock(fs_reclaim); [ 234.842539] *** DEADLOCK *** [ 234.842540] 4 locks held by gem_exec_captur/1180: [ 234.842543] #0: ffff9007812d9460 (sb_writers#17){.+.+}-{0:0}, at: ksys_write+0x58/0xd0 [ 234.842547] #1: ffff900781d9ecb8 (&attr->mutex){+.+.}-{3:3}, at: simple_attr_write+0x3a/0xe0 [ 234.842552] #2: ffffffffc11913a8 (capture_mutex){+.+.}-{3:3}, at: i915_capture_error_state+0x1a/0xa0 [i915] [ 234.842602] #3: ffffffffa3f57620 (dma_fence_map){++++}-{0:0}, at: i915_vma_snapshot_resource_pin+0x27/0x30 [i915] [ 234.842656] stack backtrace: [ 234.842658] CPU: 0 PID: 1180 Comm: gem_exec_captur Tainted: G U W 5.15.0-rc7+ #20 [ 234.842661] Hardware name: ASUS System Product Name/PRIME B560M-A AC, BIOS 0403 01/26/2021 [ 234.842664] Call Trace: [ 234.842666] dump_stack_lvl+0x57/0x72 [ 234.842669] check_noncircular+0xde/0x100 [ 234.842672] ? __lock_acquire+0x3bf/0x1dc0 [ 234.842675] __lock_acquire+0x1161/0x1dc0 [ 234.842678] lock_acquire+0xb5/0x2b0 [ 234.842680] ? __kmalloc+0x4d/0x330 [ 234.842683] ? finish_task_switch.isra.0+0xf2/0x360 [ 234.842686] ? i915_vma_coredump_create+0x78/0x5b0 [i915] [ 234.842734] fs_reclaim_acquire+0xa1/0xd0 [ 234.842737] ? __kmalloc+0x4d/0x330 [ 234.842739] __kmalloc+0x4d/0x330 [ 234.842742] i915_vma_coredump_create+0x78/0x5b0 [i915] [ 234.842793] ? capture_vma+0xbe/0x110 [i915] [ 234.842844] intel_engine_coredump_add_vma+0x36/0xe0 [i915] [ 234.842892] __i915_gpu_coredump+0x290/0x5e0 [i915] [ 234.842939] i915_capture_error_state+0x57/0xa0 [i915] [ 234.842985] intel_gt_handle_error+0x348/0x3e0 [i915] [ 234.843032] ? __mutex_lock+0x81/0x830 [ 234.843035] ? simple_attr_write+0x3a/0xe0 [ 234.843038] ? __lock_acquire+0x3bf/0x1dc0 [ 234.843041] intel_gt_debugfs_reset_store+0x3c/0x90 [i915] [ 234.843083] ? _copy_from_user+0x45/0x80 [ 234.843086] simple_attr_write+0xc1/0xe0 [ 234.843089] full_proxy_write+0x53/0x80 [ 234.843091] vfs_write+0xbc/0x350 [ 234.843094] ksys_write+0x58/0xd0 [ 234.843096] do_syscall_64+0x38/0x90 [ 234.843098] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 234.843101] RIP: 0033:0x7fa467480877 [ 234.843103] Code: 75 05 48 83 c4 58 c3 e8 37 4e ff ff 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 [ 234.843108] RSP: 002b:00007ffd14d79b08 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 [ 234.843112] RAX: ffffffffffffffda RBX: 00007ffd14d79b60 RCX: 00007fa467480877 [ 234.843114] RDX: 0000000000000014 RSI: 00007ffd14d79b60 RDI: 0000000000000007 [ 234.843116] RBP: 0000000000000007 R08: 0000000000000000 R09: 00007ffd14d79ab0 [ 234.843119] R10: ffffffffffffffff R11: 0000000000000246 R12: 0000000000000014 [ 234.843121] R13: 0000000000000000 R14: 00007ffd14d79b60 R15: 0000000000000005 v5: - Use __GFP_KSWAPD_RECLAIM rather than __GFP_NOWAIT for clarity. (Daniel Vetter) v6: - Include an instance in execlists_capture_work(). - Rework the commit message due to patch reordering. Signed-off-by: Thomas Hellström Reviewed-by: Ramalingam C Link: https://patchwork.freedesktop.org/patch/msgid/20211108174547.979714-3-thomas.hellstrom@linux.intel.com commit e45b98ba627691c6b577244abfdb18ef2621fea3 Author: Thomas Hellström Date: Mon Nov 8 18:45:44 2021 +0100 drm/i915: Avoid allocating a page array for the gpu coredump The gpu coredump typically takes place in a dma_fence signalling critical path, and hence can't use GFP_KERNEL allocations, as that means we might hit deadlocks under memory pressure. However changing to __GFP_KSWAPD_RECLAIM which will be done in an upcoming patch will instead mean a lower chance of the allocation succeeding. In particular large contigous allocations like the coredump page vector. Remove the page vector in favor of a linked list of single pages. Use the page lru list head as the list link, as the page owner is allowed to do that. Signed-off-by: Thomas Hellström Reviewed-by: Ramalingam C Link: https://patchwork.freedesktop.org/patch/msgid/20211108174547.979714-2-thomas.hellstrom@linux.intel.com commit 77ba6e7ffbd8b0afe3e475629d5fcb52e7447405 Author: Fabrice Gasnier Date: Mon Oct 25 16:31:05 2021 +0200 phy: stm32: adopt dev_err_probe for regulators Change stm32-usbphyc driver to use dev_err_probe(), to benefit of devices_deferred debugfs in case of probe deferral. Signed-off-by: Fabrice Gasnier Reviewed-by: Amelie Delaunay Link: https://lore.kernel.org/r/1635172265-26219-1-git-send-email-fabrice.gasnier@foss.st.com Signed-off-by: Vinod Koul commit 330507fbc9d8c3bc4525ea2ae9c3774738bc0c80 Author: Stephan Müller Date: Sun Nov 21 16:10:33 2021 +0100 crypto: des - disallow des3 in FIPS mode On Dec 31 2023 NIST sunsets TDES for FIPS use. To prevent FIPS validations to be completed in the future to be affected by the TDES sunsetting, disallow TDES already now. Otherwise a FIPS validation would need to be "touched again" end 2023 to handle TDES accordingly. Signed-off-by: Stephan Mueller Signed-off-by: Herbert Xu commit 1e146c393b152a31771b49af5d104d9ed846da9b Author: Stephan Müller Date: Sun Nov 21 15:51:44 2021 +0100 crypto: dh - limit key size to 2048 in FIPS mode FIPS disallows DH with keys < 2048 bits. Thus, the kernel should consider the enforcement of this limit. Signed-off-by: Stephan Mueller Signed-off-by: Herbert Xu commit 1ce1bacc480965fab4420e561916ce45d2e90c05 Author: Stephan Müller Date: Sun Nov 21 15:31:27 2021 +0100 crypto: rsa - limit key size to 2048 in FIPS mode FIPS disallows RSA with keys < 2048 bits. Thus, the kernel should consider the enforcement of this limit. Signed-off-by: Stephan Mueller Signed-off-by: Herbert Xu commit 552d03a223eda3df84526ab2c1f4d82e15eaee7a Author: Stephan Müller Date: Sun Nov 21 15:14:20 2021 +0100 crypto: jitter - consider 32 LSB for APT The APT compares the current time stamp with a pre-set value. The current code only considered the 4 LSB only. Yet, after reviews by mathematicians of the user space Jitter RNG version >= 3.1.0, it was concluded that the APT can be calculated on the 32 LSB of the time delta. Thi change is applied to the kernel. This fixes a bug where an AMD EPYC fails this test as its RDTSC value contains zeros in the LSB. The most appropriate fix would have been to apply a GCD calculation and divide the time stamp by the GCD. Yet, this is a significant code change that will be considered for a future update. Note, tests showed that constantly the GCD always was 32 on these systems, i.e. the 5 LSB were always zero (thus failing the APT since it only considered the 4 LSB for its calculation). Signed-off-by: Stephan Mueller Signed-off-by: Herbert Xu commit 13389403fe8a978bfc0a866b6d598451feaca212 Author: Kai Ye Date: Sat Nov 20 12:47:39 2021 +0800 crypto: hisilicon/qm - simplified the calculation of qos shaper parameters Some optimize for the calculation of qos shaper parameters. and modify the comments. Signed-off-by: Kai Ye Signed-off-by: Herbert Xu commit 488f30d4b8b373cd1ed057bb689704d6fc2a9bc9 Author: Kai Ye Date: Sat Nov 20 12:47:38 2021 +0800 crypto: hisilicon/qm - some optimizations of ths qos write process 1. Optimize overly long functions. 2. Fix the format symbol does not match the actual type. 3. Use the PCI_DEVFN to get the function id. Signed-off-by: Kai Ye Signed-off-by: Herbert Xu commit ecc7169d4f7318512d70192ce03d899949b153b2 Author: Kai Ye Date: Sat Nov 20 12:47:37 2021 +0800 crypto: hisilicon/qm - modify the value of qos initialization The value of qos should be reset after flr resetting or device resetting. So set the max of qos value for every function. Then update the value of qos when user writing the alg_qos. Signed-off-by: Kai Ye Signed-off-by: Herbert Xu commit 376a5c3cdd7cf47d2436dd466548c0fff792f4c7 Author: Kai Ye Date: Sat Nov 20 12:47:36 2021 +0800 crypto: hisilicon - modify the value of engine type rate Modify the value of type rate from new QM spec. Signed-off-by: Kai Ye Signed-off-by: Herbert Xu commit d3b04a4398fe8022c9ca4b5ac6ab08059334b180 Author: Stephan Müller Date: Fri Nov 19 07:59:09 2021 +0100 security: DH - use KDF implementation from crypto API The kernel crypto API provides the SP800-108 counter KDF implementation. Thus, the separate implementation provided as part of the keys subsystem can be replaced with calls to the KDF offered by the kernel crypto API. The keys subsystem uses the counter KDF with a hash primitive. Thus, it only uses the call to crypto_kdf108_ctr_generate. Signed-off-by: Stephan Mueller Acked-by: Mat Martineau Signed-off-by: Herbert Xu commit d7921344234d15ce24a151d932aa0748797fc502 Author: Stephan Müller Date: Fri Nov 19 07:58:44 2021 +0100 security: DH - remove dead code for zero padding Remove the specific code that adds a zero padding that was intended to be invoked when the DH operation result was smaller than the modulus. However, this cannot occur any more these days because the function mpi_write_to_sgl is used in the code path that calculates the shared secret in dh_compute_value. This MPI service function guarantees that leading zeros are introduced as needed to ensure the resulting data is exactly as long as the modulus. This implies that the specific code to add zero padding is dead code which can be safely removed. Signed-off-by: Stephan Mueller Acked-by: Mat Martineau Signed-off-by: Herbert Xu commit 026a733e66592e743a0905c7fd6b5d3bf89b2d7e Author: Stephan Müller Date: Fri Nov 19 07:55:58 2021 +0100 crypto: kdf - add SP800-108 counter key derivation function SP800-108 defines three KDFs - this patch provides the counter KDF implementation. The KDF is implemented as a service function where the caller has to maintain the hash / HMAC state. Apart from this hash/HMAC state, no additional state is required to be maintained by either the caller or the KDF implementation. The key for the KDF is set with the crypto_kdf108_setkey function which is intended to be invoked before the caller requests a key derivation operation via crypto_kdf108_ctr_generate. SP800-108 allows the use of either a HMAC or a hash as crypto primitive for the KDF. When a HMAC primtive is intended to be used, crypto_kdf108_setkey must be used to set the HMAC key. Otherwise, for a hash crypto primitve crypto_kdf108_ctr_generate can be used immediately after allocating the hash handle. Signed-off-by: Stephan Mueller Signed-off-by: Herbert Xu commit b808f32023dd8127b0fa27f60fa69a959fd70388 Author: Stephan Müller Date: Fri Nov 19 07:55:33 2021 +0100 crypto: kdf - Add key derivation self-test support code As a preparation to add the key derivation implementations, the self-test data structure definition and the common test code is made available. The test framework follows the testing applied by the NIST CAVP test approach. The structure of the test code follows the implementations found in crypto/testmgr.c|h. In case the KDF implementations will be made available via a kernel crypto API templates, the test code is intended to be merged into testmgr.c|h. Signed-off-by: Stephan Mueller Signed-off-by: Herbert Xu commit 83f50f2948baef5fb5f2f547a573f113f03f2b15 Author: Corentin Labbe Date: Thu Nov 18 23:10:25 2021 -0600 crypto: sun8i-ce - Add support for the D1 variant The Allwinner D1 SoC has a crypto engine compatible with sun8i-ce. Add support for it. Signed-off-by: Corentin Labbe Signed-off-by: Samuel Holland Signed-off-by: Herbert Xu commit 8616b628ef697eff129b8319604058751eb3ebac Author: Marco Chiappero Date: Wed Nov 17 14:30:58 2021 +0000 crypto: qat - improve logging of PFVF messages Improve and simplify logging of PFVF messages. Signed-off-by: Marco Chiappero Reviewed-by: Giovanni Cabiddu Signed-off-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit 1d9a915fafabc27739ad6e19db6f86c233f676b2 Author: Marco Chiappero Date: Wed Nov 17 14:30:57 2021 +0000 crypto: qat - fix VF IDs in PFVF log messages PFVF debug messages use a mix of zero and one based VF IDs. Switch to zero based VF numbers in all log messages. Signed-off-by: Marco Chiappero Reviewed-by: Giovanni Cabiddu Signed-off-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit e669b4dedd899e8e4cad5ef91721d3387a3844fc Author: Marco Chiappero Date: Wed Nov 17 14:30:56 2021 +0000 crypto: qat - do not rely on min version Remove min_iov_compat_ver field as for now all versions are compatible. Compatibility is determined by a series of rules and dynamic conditions such as specific configurations. In any case the minimum version requirement for compatibility is an inadequate and obsolete approach which should be removed. At this time compatibility can be assured across the currently available versions. Signed-off-by: Marco Chiappero Reviewed-by: Giovanni Cabiddu Signed-off-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit c35c76c6919ebcaac590f5f3afa6b8924ad305f4 Author: Marco Chiappero Date: Wed Nov 17 14:30:55 2021 +0000 crypto: qat - refactor pfvf version request messages Refactor version handling logic for ADF_VF2PF_MSGTYPE_COMPAT_VER_REQ and ADF_VF2PF_MSGTYPE_VERSION_REQ on the PF. Response messages are now filled only after fully parsing the request, in a consisted way with the rest of the PFVF codebase. This patch also fixes a harmless double setting for VERSION in the response for ADF_VF2PF_MSGTYPE_VERSION_REQ. Signed-off-by: Marco Chiappero Co-developed-by: Giovanni Cabiddu Signed-off-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit 25110fd2e346449355cb795cd0d3e050ca5bdf11 Author: Marco Chiappero Date: Wed Nov 17 14:30:54 2021 +0000 crypto: qat - pass the PF2VF responses back to the callers Currently, any PF response to a VF request is fully parsed during the interrupt handling. This way the individual response values are stored into the accel_dev structure, preventing the caller to access and decode the full response message itself. Change this behavior, by letting the API return back the entire message to the caller, in order to: - keep correlated code together, that is, the (building of the) request and the (decoding of the) response; - avoid polluting the accel_dev data structure with unnecessary and at times temporary values; only the entire message is stored in a temporary buffer. Signed-off-by: Marco Chiappero Reviewed-by: Giovanni Cabiddu Signed-off-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit 1d4fde6c4e805f4cb5ecb54fb39c93686d3e5924 Author: Marco Chiappero Date: Wed Nov 17 14:30:53 2021 +0000 crypto: qat - use enums for PFVF protocol codes Replace PFVF constants with enumerations for valid protocol codes. Signed-off-by: Marco Chiappero Reviewed-by: Giovanni Cabiddu Signed-off-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit f6aff914989e9770ed96474e24570d6cab665162 Author: Marco Chiappero Date: Wed Nov 17 14:30:52 2021 +0000 crypto: qat - reorganize PFVF protocol definitions Organize PFVF protocol definitions by type rather than direction, by keeping related fields close. Also, make sure the order is consistent for both PF and VF definitions. Signed-off-by: Marco Chiappero Reviewed-by: Giovanni Cabiddu Signed-off-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit 09ce899a592f7a8ee19857ad0ef394e31be83c1d Author: Marco Chiappero Date: Wed Nov 17 14:30:51 2021 +0000 crypto: qat - reorganize PFVF code Reorganize the structure of the PFVF code by moving the content of adf_pf2vf_msg.c and adf_vf2pf_msg.c. The logic that handles high level messages has been moved to adf_pfvf_pf_msg.c and adf_pfvf_vf_msg.c. The implementation of low level communication primitives and the protocol is now included in adf_pfvf_pf_proto.c and adf_pfvf_vf_proto.c. In addition, the file adf_pf2vf_msg.h has been renamed in adf_pfvf_msg.h since it common to PF and VF and the copyright date for the touched files has been updated. Signed-off-by: Marco Chiappero Co-developed-by: Giovanni Cabiddu Signed-off-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit 1ea7c2beca5b200240f6480d36ebd6ca775a5fca Author: Giovanni Cabiddu Date: Wed Nov 17 14:30:50 2021 +0000 crypto: qat - abstract PFVF receive logic Refactor the PFVF receive logic so it is common between PF and VF and make it device specific. This is in preparation for the introduction of PFVF support in the qat_4xxx driver since the receive logic differs between QAT GEN2 and QAT GEN4 devices. Signed-off-by: Giovanni Cabiddu Co-developed-by: Marco Chiappero Signed-off-by: Marco Chiappero Signed-off-by: Herbert Xu commit 49c43538ce05115e3fe12752dc77aa1deed3b0d2 Author: Marco Chiappero Date: Wed Nov 17 14:30:49 2021 +0000 crypto: qat - abstract PFVF send function Make the PFVF send function device specific. This is in preparation for the introduction of PFVF support in the qat_4xxx driver since the send logic differs between QAT GEN2 and QAT GEN4 devices. Signed-off-by: Marco Chiappero Co-developed-by: Giovanni Cabiddu Signed-off-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit 9baf2de7ee4eeaca5cf95d1a399182ab83aa42b8 Author: Marco Chiappero Date: Wed Nov 17 14:30:48 2021 +0000 crypto: qat - differentiate between pf2vf and vf2pf offset Add the function get_vf2pf_offset() to adf_pfvf_ops to differentiate the CSRs used for pf2vf and vf2pf. Offsets may or may not be direction specific depending on QAT generation. Since in QAT GEN2 the CSR is not direction specific, i.e. there is a single mailbox register shared for pf2vf and vf2pf, both get_vf2pf_offset() and get_vf2pf_offset() will return the same offset. This change is to make the direction explicit, so it is easier to understand and debug and also in preparation for the introduction of PFVF support in the qat_4xxx driver since QAT GEN4 devices have a separate CSR for pf2vf and vf2pf communications. Signed-off-by: Marco Chiappero Reviewed-by: Giovanni Cabiddu Signed-off-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit bc63dabe525402b91320192ff1758f0d05b159c6 Author: Marco Chiappero Date: Wed Nov 17 14:30:47 2021 +0000 crypto: qat - add pfvf_ops Add pfvf_ops structure to isolate PFVF related functions inside the adf_hw_device_data structure. For GEN2, the structure is populated using one of the two helper functions, adf_gen2_init_pf_pfvf_ops() or adf_gen2_init_vf_pfvf_ops(), for the PF and VF driver respectively. For the DH895XCC PF driver, the structure is populated using adf_gen2_init_pf_pfvf_ops() but some of the functions are then overwritten. Signed-off-by: Marco Chiappero Co-developed-by: Giovanni Cabiddu Signed-off-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit 6f2e28015bacfa8793902eb39a1fb20feb19a011 Author: Giovanni Cabiddu Date: Wed Nov 17 14:30:46 2021 +0000 crypto: qat - relocate PFVF disabled function Move the function pfvf_comms_disabled() from the qat_4xxx module to intel_qat as it will be used by other components to keep the PFVF feature disabled. Signed-off-by: Giovanni Cabiddu Reviewed-by: Marco Chiappero Signed-off-by: Herbert Xu commit 7e00fb3f162cfb27d8ac72910d7132612f07ec9c Author: Marco Chiappero Date: Wed Nov 17 14:30:45 2021 +0000 crypto: qat - relocate PFVF VF related logic Move device specific PFVF logic related to the VF to the newly created adf_gen2_pfvf.c. This refactory is done to isolate the GEN2 PFVF code into its own file in preparation for the introduction of support for PFVF for GEN4 devices. Signed-off-by: Marco Chiappero Reviewed-by: Giovanni Cabiddu Signed-off-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit b85bd9457dc302749411a9b43f78fd493499f3ef Author: Marco Chiappero Date: Wed Nov 17 14:30:44 2021 +0000 crypto: qat - relocate PFVF PF related logic Move device specific PFVF logic related to the PF to the newly created adf_gen2_pfvf.c. This refactory is done to isolate the GEN2 PFVF code into its own file in preparation for the introduction of support for PFVF for GEN4 devices. In addition the PFVF PF logic for dh895xcc has been isolated to adf_dh895xcc_hw_data.c. Signed-off-by: Marco Chiappero Co-developed-by: Giovanni Cabiddu Signed-off-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit 1d6133123fb2626499e0e0a9d62e39bcdc5e593b Author: Marco Chiappero Date: Wed Nov 17 14:30:43 2021 +0000 crypto: qat - handle retries due to collisions in adf_iov_putmsg() Rework __adf_iov_putmsg() to handle retries due to collisions internally, removing the need for an external retry loop. The functions __adf_iov_putmsg() and adf_iov_putmsg() have been merged together maintaining the adf_iov_putmsg() name. This will allow to use this function only for GEN2 devices, since collision are peculiar of this generation and therefore should be confined to the actual implementation of the transport/medium access. Note that now adf_iov_putmsg() will retry to send a message only in case of collisions and will now fail if an ACK is not received from the remote function. Signed-off-by: Marco Chiappero Co-developed-by: Giovanni Cabiddu Signed-off-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit bd59b769ddac0db24d2d43ca5e40b29a58d7b205 Author: Marco Chiappero Date: Wed Nov 17 14:30:42 2021 +0000 crypto: qat - split PFVF message decoding from handling Refactor the receive and handle logic to separate the parsing and handling of the PFVF message from the initial retrieval and ACK. This is to allow the intoduction of the recv function in a subsequent patch. Signed-off-by: Marco Chiappero Co-developed-by: Giovanni Cabiddu Signed-off-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit 04cf47872c7edde7a11c634aef04b1dbcf9c26fa Author: Giovanni Cabiddu Date: Wed Nov 17 14:30:41 2021 +0000 crypto: qat - re-enable interrupts for legacy PFVF messages If a PFVF message with MSGORIGIN_SYSTEM not set is received, re-enable interrupts allowing the processing of new messages. This is to simplify the refactoring of the recv function in a subsequent patch. Signed-off-by: Giovanni Cabiddu Reviewed-by: Marco Chiappero Signed-off-by: Herbert Xu commit 956125e21f460ef94660019b6ec9de3f835f93ab Author: Giovanni Cabiddu Date: Wed Nov 17 14:30:40 2021 +0000 crypto: qat - change PFVF ACK behaviour Change the PFVF receipt flow on the VF side to read, ack and handle the message instead of read, handle and ack. This is done for (1) consistency with the PF side, see the function adf_recv_and_handle_vf2pf_msg() in adf_pf2vf_msg.c, and (2) performance reasons, to avoid keeping the CSR busy while parsing the message. In addition, do not ACK PFVF legacy messages, as this driver is not capable of handling PFVF legacy messages. If a PFVF message with MSGORIGIN not set is received, do nothing. Signed-off-by: Giovanni Cabiddu Reviewed-by: Marco Chiappero Signed-off-by: Herbert Xu commit 720aa72a77f402a8d33ad1ddef72a4bf6e973fdd Author: Marco Chiappero Date: Wed Nov 17 14:30:39 2021 +0000 crypto: qat - move interrupt code out of the PFVF handler Move the interrupt handling call from the PF specific protocol file, adf_pf2vf_msg.c, to adf_sriov.c to maintain the PFVF files focused on the protocol handling. The function adf_vf2pf_req_hndl() has been renamed as adf_recv_and_handle_vf2pf_msg() to reflect its actual purpose and maintain consistency with the VF side. This function now returns a boolean indicating to the caller if interrupts need to be re-enabled or not. Signed-off-by: Marco Chiappero Co-developed-by: Giovanni Cabiddu Signed-off-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit b7c13ee46cebfd106e7065cf5fee191b324d0ca9 Author: Marco Chiappero Date: Wed Nov 17 14:30:38 2021 +0000 crypto: qat - move VF message handler to adf_vf2pf_msg.c Move the reading and parsing of a PF2VF message from the bottom half function in adf_vf_isr.c, adf_pf2vf_bh_handler(), to the PFVF protocol file adf_vf2pf_msg.c, for better code organization. The receive and handle logic has been moved to a new function called adf_recv_and_handle_pf2vf_msg() which returns a boolean indicating if interrupts need to be re-enabled or not. A slight refactoring has been done to avoid calculating the PF2VF CSR offset twice and repeating the clearing of the PF2VFINT bit. The "PF restarting" logic, now defined in the function adf_pf2vf_handle_pf_restaring(), has been kept in adf_vf_isr.c due to the dependencies with the adf_vf_stop_wq workqueue. Signed-off-by: Marco Chiappero Co-developed-by: Giovanni Cabiddu Signed-off-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit 08ea97f48883a5d3178e09433b449bafc5f2a314 Author: Giovanni Cabiddu Date: Wed Nov 17 14:30:37 2021 +0000 crypto: qat - move vf2pf interrupt helpers Move vf2pf interrupt enable and disable functions from adf_pf2vf_msg.c to adf_isr.c This it to separate the interrupt related code from the PFVF protocol logic. With this change, the function adf_disable_vf2pf_interrupts_irq() is only called from adf_isr.c and it has been marked as static. Signed-off-by: Giovanni Cabiddu Reviewed-by: Marco Chiappero Signed-off-by: Herbert Xu commit 95b4d40ed256c5d36b1dee979b65c04c3edd2b23 Author: Marco Chiappero Date: Wed Nov 17 14:30:36 2021 +0000 crypto: qat - refactor PF top half for PFVF Move logic associated to handling VF2PF interrupt to its own function. This will simplify the handling of multiple interrupt sources in the function adf_msix_isr_ae() in the future. Signed-off-by: Marco Chiappero Co-developed-by: Giovanni Cabiddu Signed-off-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit 5002200b4fedd7e90e4fbc2e5c42a4b3351df814 Author: Giovanni Cabiddu Date: Wed Nov 17 14:30:35 2021 +0000 crypto: qat - fix undetected PFVF timeout in ACK loop If the remote function did not ACK the reception of a message, the function __adf_iov_putmsg() could detect it as a collision. This was due to the fact that the collision and the timeout checks after the ACK loop were in the wrong order. The timeout must be checked at the end of the loop, so fix by swapping the order of the two checks. Fixes: 9b768e8a3909 ("crypto: qat - detect PFVF collision after ACK") Signed-off-by: Giovanni Cabiddu Co-developed-by: Marco Chiappero Signed-off-by: Marco Chiappero Signed-off-by: Herbert Xu commit c79391c696da0151c6ec8cb8a31edfa8bbe68f24 Author: Giovanni Cabiddu Date: Wed Nov 17 14:30:34 2021 +0000 crypto: qat - do not handle PFVF sources for qat_4xxx The QAT driver does not have support for PFVF interrupts for GEN4 devices, therefore report the vf2pf sources as 0. This prevents a NULL pointer dereference in the function adf_msix_isr_ae() if the device triggers a spurious interrupt. Fixes: 993161d36ab5 ("crypto: qat - fix handling of VF to PF interrupts") Reported-by: Adam Guerin Signed-off-by: Giovanni Cabiddu Signed-off-by: Herbert Xu commit 8ea5ee00beb925d2aa0fed0eb3faf04715a3f2bd Author: Nicolai Stange Date: Mon Nov 15 15:18:09 2021 +0100 crypto: drbg - reseed 'nopr' drbgs periodically from get_random_bytes() In contrast to the fully prediction resistant 'pr' DRBGs, the 'nopr' variants get seeded once at boot and reseeded only rarely thereafter, namely only after 2^20 requests have been served each. AFAICT, this reseeding based on the number of requests served is primarily motivated by information theoretic considerations, c.f. NIST SP800-90Ar1, sec. 8.6.8 ("Reseeding"). However, given the relatively large seed lifetime of 2^20 requests, the 'nopr' DRBGs can hardly be considered to provide any prediction resistance whatsoever, i.e. to protect against threats like side channel leaks of the internal DRBG state (think e.g. leaked VM snapshots). This is expected and completely in line with the 'nopr' naming, but as e.g. the "drbg_nopr_hmac_sha512" implementation is potentially being used for providing the "stdrng" and thus, the crypto_default_rng serving the in-kernel crypto, it would certainly be desirable to achieve at least the same level of prediction resistance as get_random_bytes() does. Note that the chacha20 rngs underlying get_random_bytes() get reseeded every CRNG_RESEED_INTERVAL == 5min: the secondary, per-NUMA node rngs from the primary one and the primary rng in turn from the entropy pool, provided sufficient entropy is available. The 'nopr' DRBGs do draw randomness from get_random_bytes() for their initial seed already, so making them to reseed themselves periodically from get_random_bytes() in order to let them benefit from the latter's prediction resistance is not such a big change conceptually. In principle, it would have been also possible to make the 'nopr' DRBGs to periodically invoke a full reseeding operation, i.e. to also consider the jitterentropy source (if enabled) in addition to get_random_bytes() for the seed value. However, get_random_bytes() is relatively lightweight as compared to the jitterentropy generation process and thus, even though the 'nopr' reseeding is supposed to get invoked infrequently, it's IMO still worthwhile to avoid occasional latency spikes for drbg_generate() and stick to get_random_bytes() only. As an additional remark, note that drawing randomness from the non-SP800-90B-conforming get_random_bytes() only won't adversely affect SP800-90A conformance either: the very same is being done during boot via drbg_seed_from_random() already once rng_is_initialized() flips to true and it follows that if the DRBG implementation does conform to SP800-90A now, it will continue to do so. Make the 'nopr' DRBGs to reseed themselves periodically from get_random_bytes() every CRNG_RESEED_INTERVAL == 5min. More specifically, introduce a new member ->last_seed_time to struct drbg_state for recording in units of jiffies when the last seeding operation had taken place. Make __drbg_seed() maintain it and let drbg_generate() invoke a reseed from get_random_bytes() via drbg_seed_from_random() if more than 5min have passed by since the last seeding operation. Be careful to not to reseed if in testing mode though, or otherwise the drbg related tests in crypto/testmgr.c would fail to reproduce the expected output. In order to keep the formatting clean in drbg_generate() wrap the logic for deciding whether or not a reseed is due in a new helper, drbg_nopr_reseed_interval_elapsed(). Signed-off-by: Nicolai Stange Reviewed-by: Stephan Müller Signed-off-by: Herbert Xu commit 559edd47cce4cc407d606b4d7f376822816fd4b8 Author: Nicolai Stange Date: Mon Nov 15 15:18:08 2021 +0100 crypto: drbg - make drbg_prepare_hrng() handle jent instantiation errors Now that drbg_prepare_hrng() doesn't do anything but to instantiate a jitterentropy crypto_rng instance, it looks a little odd to have the related error handling at its only caller, drbg_instantiate(). Move the handling of jitterentropy allocation failures from drbg_instantiate() close to the allocation itself in drbg_prepare_hrng(). There is no change in behaviour. Signed-off-by: Nicolai Stange Reviewed-by: Stephan Müller Signed-off-by: Herbert Xu commit 074bcd4000e0d812bc253f86fedc40f81ed59ccc Author: Nicolai Stange Date: Mon Nov 15 15:18:07 2021 +0100 crypto: drbg - make reseeding from get_random_bytes() synchronous get_random_bytes() usually hasn't full entropy available by the time DRBG instances are first getting seeded from it during boot. Thus, the DRBG implementation registers random_ready_callbacks which would in turn schedule some work for reseeding the DRBGs once get_random_bytes() has sufficient entropy available. For reference, the relevant history around handling DRBG (re)seeding in the context of a not yet fully seeded get_random_bytes() is: commit 16b369a91d0d ("random: Blocking API for accessing nonblocking_pool") commit 4c7879907edd ("crypto: drbg - add async seeding operation") commit 205a525c3342 ("random: Add callback API for random pool readiness") commit 57225e679788 ("crypto: drbg - Use callback API for random readiness") commit c2719503f5e1 ("random: Remove kernel blocking API") However, some time later, the initialization state of get_random_bytes() has been made queryable via rng_is_initialized() introduced with commit 9a47249d444d ("random: Make crng state queryable"). This primitive now allows for streamlining the DRBG reseeding from get_random_bytes() by replacing that aforementioned asynchronous work scheduling from random_ready_callbacks with some simpler, synchronous code in drbg_generate() next to the related logic already present therein. Apart from improving overall code readability, this change will also enable DRBG users to rely on wait_for_random_bytes() for ensuring that the initial seeding has completed, if desired. The previous patches already laid the grounds by making drbg_seed() to record at each DRBG instance whether it was being seeded at a time when rng_is_initialized() still had been false as indicated by ->seeded == DRBG_SEED_STATE_PARTIAL. All that remains to be done now is to make drbg_generate() check for this condition, determine whether rng_is_initialized() has flipped to true in the meanwhile and invoke a reseed from get_random_bytes() if so. Make this move: - rename the former drbg_async_seed() work handler, i.e. the one in charge of reseeding a DRBG instance from get_random_bytes(), to "drbg_seed_from_random()", - change its signature as appropriate, i.e. make it take a struct drbg_state rather than a work_struct and change its return type from "void" to "int" in order to allow for passing error information from e.g. its __drbg_seed() invocation onwards to callers, - make drbg_generate() invoke this drbg_seed_from_random() once it encounters a DRBG instance with ->seeded == DRBG_SEED_STATE_PARTIAL by the time rng_is_initialized() has flipped to true and - prune everything related to the former, random_ready_callback based mechanism. As drbg_seed_from_random() is now getting invoked from drbg_generate() with the ->drbg_mutex being held, it must not attempt to recursively grab it once again. Remove the corresponding mutex operations from what is now drbg_seed_from_random(). Furthermore, as drbg_seed_from_random() can now report errors directly to its caller, there's no need for it to temporarily switch the DRBG's ->seeded state to DRBG_SEED_STATE_UNSEEDED so that a failure of the subsequently invoked __drbg_seed() will get signaled to drbg_generate(). Don't do it then. Signed-off-by: Nicolai Stange Signed-off-by: Herbert Xu commit 262d83a4290c331cd4f617a457408bdb82fbb738 Author: Nicolai Stange Date: Mon Nov 15 15:18:06 2021 +0100 crypto: drbg - move dynamic ->reseed_threshold adjustments to __drbg_seed() Since commit 42ea507fae1a ("crypto: drbg - reseed often if seedsource is degraded"), the maximum seed lifetime represented by ->reseed_threshold gets temporarily lowered if the get_random_bytes() source cannot provide sufficient entropy yet, as is common during boot, and restored back to the original value again once that has changed. More specifically, if the add_random_ready_callback() invoked from drbg_prepare_hrng() in the course of DRBG instantiation does not return -EALREADY, that is, if get_random_bytes() has not been fully initialized at this point yet, drbg_prepare_hrng() will lower ->reseed_threshold to a value of 50. The drbg_async_seed() scheduled from said random_ready_callback will eventually restore the original value. A future patch will replace the random_ready_callback based notification mechanism and thus, there will be no add_random_ready_callback() return value anymore which could get compared to -EALREADY. However, there's __drbg_seed() which gets invoked in the course of both, the DRBG instantiation as well as the eventual reseeding from get_random_bytes() in aforementioned drbg_async_seed(), if any. Moreover, it knows about the get_random_bytes() initialization state by the time the seed data had been obtained from it: the new_seed_state argument introduced with the previous patch would get set to DRBG_SEED_STATE_PARTIAL in case get_random_bytes() had not been fully initialized yet and to DRBG_SEED_STATE_FULL otherwise. Thus, __drbg_seed() provides a convenient alternative for managing that ->reseed_threshold lowering and restoring at a central place. Move all ->reseed_threshold adjustment code from drbg_prepare_hrng() and drbg_async_seed() respectively to __drbg_seed(). Make __drbg_seed() lower the ->reseed_threshold to 50 in case its new_seed_state argument equals DRBG_SEED_STATE_PARTIAL and let it restore the original value otherwise. There is no change in behaviour. Signed-off-by: Nicolai Stange Reviewed-by: Stephan Müller Signed-off-by: Herbert Xu commit 2bcd25443868aa8863779a6ebc6c9319633025d2 Author: Nicolai Stange Date: Mon Nov 15 15:18:05 2021 +0100 crypto: drbg - track whether DRBG was seeded with !rng_is_initialized() Currently, the DRBG implementation schedules asynchronous works from random_ready_callbacks for reseeding the DRBG instances with output from get_random_bytes() once the latter has sufficient entropy available. However, as the get_random_bytes() initialization state can get queried by means of rng_is_initialized() now, there is no real need for this asynchronous reseeding logic anymore and it's better to keep things simple by doing it synchronously when needed instead, i.e. from drbg_generate() once rng_is_initialized() has flipped to true. Of course, for this to work, drbg_generate() would need some means by which it can tell whether or not rng_is_initialized() has flipped to true since the last seeding from get_random_bytes(). Or equivalently, whether or not the last seed from get_random_bytes() has happened when rng_is_initialized() was still evaluating to false. As it currently stands, enum drbg_seed_state allows for the representation of two different DRBG seeding states: DRBG_SEED_STATE_UNSEEDED and DRBG_SEED_STATE_FULL. The former makes drbg_generate() to invoke a full reseeding operation involving both, the rather expensive jitterentropy as well as the get_random_bytes() randomness sources. The DRBG_SEED_STATE_FULL state on the other hand implies that no reseeding at all is required for a !->pr DRBG variant. Introduce the new DRBG_SEED_STATE_PARTIAL state to enum drbg_seed_state for representing the condition that a DRBG was being seeded when rng_is_initialized() had still been false. In particular, this new state implies that - the given DRBG instance has been fully seeded from the jitterentropy source (if enabled) - and drbg_generate() is supposed to reseed from get_random_bytes() *only* once rng_is_initialized() turns to true. Up to now, the __drbg_seed() helper used to set the given DRBG instance's ->seeded state to constant DRBG_SEED_STATE_FULL. Introduce a new argument allowing for the specification of the to be written ->seeded value instead. Make the first of its two callers, drbg_seed(), determine the appropriate value based on rng_is_initialized(). The remaining caller, drbg_async_seed(), is known to get invoked only once rng_is_initialized() is true, hence let it pass constant DRBG_SEED_STATE_FULL for the new argument to __drbg_seed(). There is no change in behaviour, except for that the pr_devel() in drbg_generate() would now report "unseeded" for ->pr DRBG instances which had last been seeded when rng_is_initialized() was still evaluating to false. Signed-off-by: Nicolai Stange Reviewed-by: Stephan Müller Signed-off-by: Herbert Xu commit ce8ce31b2c5c8b18667784b8c515650c65d57b4e Author: Nicolai Stange Date: Mon Nov 15 15:18:04 2021 +0100 crypto: drbg - prepare for more fine-grained tracking of seeding state There are two different randomness sources the DRBGs are getting seeded from, namely the jitterentropy source (if enabled) and get_random_bytes(). At initial DRBG seeding time during boot, the latter might not have collected sufficient entropy for seeding itself yet and thus, the DRBG implementation schedules a reseed work from a random_ready_callback once that has happened. This is particularly important for the !->pr DRBG instances, for which (almost) no further reseeds are getting triggered during their lifetime. Because collecting data from the jitterentropy source is a rather expensive operation, the aforementioned asynchronously scheduled reseed work restricts itself to get_random_bytes() only. That is, it in some sense amends the initial DRBG seed derived from jitterentropy output at full (estimated) entropy with fresh randomness obtained from get_random_bytes() once that has been seeded with sufficient entropy itself. With the advent of rng_is_initialized(), there is no real need for doing the reseed operation from an asynchronously scheduled work anymore and a subsequent patch will make it synchronous by moving it next to related logic already present in drbg_generate(). However, for tracking whether a full reseed including the jitterentropy source is required or a "partial" reseed involving only get_random_bytes() would be sufficient already, the boolean struct drbg_state's ->seeded member must become a tristate value. Prepare for this by introducing the new enum drbg_seed_state and change struct drbg_state's ->seeded member's type from bool to that type. For facilitating review, enum drbg_seed_state is made to only contain two members corresponding to the former ->seeded values of false and true resp. at this point: DRBG_SEED_STATE_UNSEEDED and DRBG_SEED_STATE_FULL. A third one for tracking the intermediate state of "seeded from jitterentropy only" will be introduced with a subsequent patch. There is no change in behaviour at this point. Signed-off-by: Nicolai Stange Reviewed-by: Stephan Müller Signed-off-by: Herbert Xu commit 35bf8c86eeb8ae609f61c43aeab3b530fedcf1b4 Merge: 703319094c9c2 29c3002644bdd Author: Jakub Kicinski Date: Thu Nov 25 21:03:33 2021 -0800 Merge branch 'net-small-csum-optimizations' Eric Dumazet says: ==================== net: small csum optimizations After recent x86 csum_partial() optimizations, we can more easily see in kernel profiles costs of add/adc operations that could be avoided, by feeding a non zero third argument to csum_partial() ==================== Link: https://lore.kernel.org/r/20211124202446.2917972-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit 29c3002644bdd653f6ec6407d25135d0a4f7cefb Author: Eric Dumazet Date: Wed Nov 24 12:24:46 2021 -0800 net: optimize skb_postpull_rcsum() Remove one pair of add/adc instructions and their dependency against carry flag. We can leverage third argument to csum_partial(): X = csum_block_sub(X, csum_partial(start, len, 0), 0); --> X = csum_block_add(X, ~csum_partial(start, len, 0), 0); --> X = ~csum_partial(start, len, ~X); Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 0bd28476f6363c7ccc841fe6a0ab0dd1fdb822f6 Author: Eric Dumazet Date: Wed Nov 24 12:24:45 2021 -0800 gro: optimize skb_gro_postpull_rcsum() We can leverage third argument to csum_partial(): X = csum_sub(X, csum_partial(start, len, 0)); --> X = csum_add(X, ~csum_partial(start, len, 0)); --> X = ~csum_partial(start, len, ~X); This removes one add/adc pair and its dependency against the carry flag. Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 703319094c9c2bf34f65d3496ccb350149fdd14b Author: Xin Long Date: Wed Nov 24 14:26:14 2021 -0500 sctp: make the raise timer more simple and accurate Currently, the probe timer is reused as the raise timer when PLPMTUD is in the Search Complete state. raise_count was introduced to count how many times the probe timer has timed out. When raise_count reaches to 30, the raise timer handler will be triggered. During the whole processing above, the timer keeps timing out every probe_ interval. It is a waste for the Search Complete state, as the raise timer only needs to time out after 30 * probe_interval. Since the raise timer and probe timer are never used at the same time, it is no need to keep probe timer 'alive' in the Search Complete state. This patch to introduce sctp_transport_reset_raise_timer() to start the timer as the raise timer when entering the Search Complete state. When entering the other states, sctp_transport_reset_probe_timer() will still be called to reset the timer to the probe timer. raise_count can be removed from sctp_transport as no need to count probe timer timeout for raise timer timeout. last_rtx_chunks can be removed as sctp_transport_reset_probe_timer() can be called in the place where asoc rtx_data_chunks is changed. Signed-off-by: Xin Long Acked-by: Marcelo Ricardo Leitner Link: https://lore.kernel.org/r/edb0e48988ea85997488478b705b11ddc1ba724a.1637781974.git.lucien.xin@gmail.com Signed-off-by: Jakub Kicinski commit 0c51dffcc8a2821cb18ef6fdf5b02ea891b850c4 Author: Xin Long Date: Wed Nov 24 12:11:12 2021 -0500 tipc: delete the unlikely branch in tipc_aead_encrypt When a skb comes to tipc_aead_encrypt(), it's always linear. The unlikely check 'skb_cloned(skb) && tailen <= skb_tailroom(skb)' can completely be taken care of in skb_cow_data() by the code in branch "if (!skb_has_frag_list())". Also, remove the 'TODO:' annotation, as the pages in skbs are not writable, see more on commit 3cf4375a0904 ("tipc: do not write skb_shinfo frags when doing decrytion"). Signed-off-by: Xin Long Acked-by: Jon Maloy Link: https://lore.kernel.org/r/47a478da0b6095b76e3cbe7a75cbd25d9da1df9a.1637773872.git.lucien.xin@gmail.com Signed-off-by: Jakub Kicinski commit 4e35a4f7db4b087816eeed1592e39d026bc61cdb Merge: 8e25fa5af89a5 fe68c43ce3886 Author: Jakub Kicinski Date: Thu Nov 25 20:05:34 2021 -0800 Merge branch 'net-ipa-gsi-channel-flow-control' Alex Elder says: ==================== net: ipa: GSI channel flow control Starting with IPA v4.2, endpoint DELAY mode (which prevents data transfer on TX endpoints) does not work properly. To address this, changes were made to allow underlying GSI channels to be put into a "flow controlled" state, which achieves a similar objective. The first patch in this series implements the flow controlled channel state and the commands used to control it. It arranges to use the new mechanism--instead of DELAY mode--for IPA v4.2+. In IPA v4.11, the notion of GSI channel flow control was enhanced, and implemented in a slightly different way. For the most part this doesn't affect the way the IPA driver uses flow control, but the second patch adds support for the newer mechanism. ==================== Link: https://lore.kernel.org/r/20211124194416.707007-1-elder@linaro.org Signed-off-by: Jakub Kicinski commit fe68c43ce38865299de03b691e5069d3daca015a Author: Alex Elder Date: Wed Nov 24 13:44:16 2021 -0600 net: ipa: support enhanced channel flow control IPA v4.2 introduced GSI channel flow control, used instead of IPA endpoint DELAY mode to prevent a TX channel from injecting packets into the IPA core. It used a new FLOW_CONTROLLED channel state which could be entered using GSI generic commands. IPA v4.11 extended the channel flow control model. Rather than having a distinct FLOW_CONTROLLED channel state, each channel has a "flow control" property that can be enabled or not--independent of the channel state. The AP (or modem) can modify this property using the same GSI generic commands as before. The AP only uses channel flow control on modem TX channels, and only when recovering from a modem crash. The AP has no way to discover the state of a modem channel, so the fact that (starting with IPA v4.11) flow control no longer uses a distinct channel state is invisible to the AP. So enhanced flow control generally does not change the way AP uses flow control. There are a few small differences, however: - There is a notion of "primary" or "secondary" flow control, and when enabling or disabling flow control that must be specified in a new field in the GSI generic command register. For now, we always specify 0 (meaning "primary"). - When disabling flow control, it's possible a request will need to be retried. We retry up to 5 times in this case. - Another new generic command allows the current flow control state to be queried. We do not use this. Other than the need for retries, the code essentially works the same way as before. Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski commit 4c9d631adbc277b33704a971cde6dd8ce44fbb8f Author: Alex Elder Date: Wed Nov 24 13:44:15 2021 -0600 net: ipa: introduce channel flow control One quirk for certain versions of IPA is that endpoint DELAY mode does not work properly. IPA DELAY mode prevents any packets from being delivered to the IPA core for processing on a TX endpoint. The AP uses DELAY mode when the modem crashes, to prevent modem TX endpoints from generating traffic during crash recovery. Without this, there is a chance the hardware will stall during recovery from a modem crash. To achieve a similar effect, a GSI FLOW_CONTROLLED channel state was created. A STARTED TX channel can be placed in FLOW_CONTROLLED state, which prevents the transfer of any more packets. A channel in FLOW_CONTROLLED state can be either returned to STARTED state, or can be transitioned to STOPPED state. Because this operates on GSI channels, two generic commands were added to allow the AP to control this state for modem channels (similar to the ALLOCATE and HALT channel commands). Previously the code assumed this quirk only applied to IPA v4.2. In fact, channel flow control (rather than endpoint DELAY mode) should be used for all versions *starting* with IPA v4.2. Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski commit 8e25fa5af89a54ad258ba90a17c90f9fc2b8c523 Merge: 342e5f9fc73f7 d1c99f365a1f5 Author: Jakub Kicinski Date: Thu Nov 25 19:40:41 2021 -0800 Merge branch 'mctp-serial-minor-fixes' Jeremy Kerr says: ==================== mctp serial minor fixes We had a few minor fixes queued for a v4 of the original series, so they're sent here as separate changes. v2: - fix ordering of cancel_work vs. unregister_netdev. ==================== Link: https://lore.kernel.org/r/20211125060739.3023442-1-jk@codeconstruct.com.au Signed-off-by: Jakub Kicinski commit d1c99f365a1f51f9c7e76ea3c52605cf740b3251 Author: Jeremy Kerr Date: Thu Nov 25 14:07:39 2021 +0800 mctp: serial: remove unnecessary ldisc data check Jiri assures me that a ldisc->open with tty->disc_data set should never happen, so this check doesn't do anything. Reported-by: Jiri Slaby Signed-off-by: Jeremy Kerr Signed-off-by: Jakub Kicinski commit d154cd078ac2d24374e872f3224bf44894867b0a Author: Jeremy Kerr Date: Thu Nov 25 14:07:38 2021 +0800 mctp: serial: enforce fixed MTU The current serial driver requires a maximum MTU of 68, and it doesn't make sense to set a MTU below the MCTP-required baseline (of 68) either. This change sets the min_mtu & max_mtu of the mctp netdev, essentially disallowing changes. By using these instead of a ndo_change_mtu op, we get the netlink extacks reported too. Signed-off-by: Jeremy Kerr Signed-off-by: Jakub Kicinski commit 7bd9890f3d74e96f0e1a898f68decfc711de3001 Author: Jeremy Kerr Date: Thu Nov 25 14:07:37 2021 +0800 mctp: serial: cancel tx work on ldisc close We want to ensure that the tx work has finished before returning from the ldisc close op, so do a synchronous cancel. Reported-by: Jiri Slaby Signed-off-by: Jeremy Kerr Signed-off-by: Jakub Kicinski commit 342e5f9fc73f7af0fa253c1ec8ea237512b5ebf5 Merge: 8abe19703825e faa88ecead2f3 Author: Jakub Kicinski Date: Thu Nov 25 19:37:37 2021 -0800 Merge branch 'net-ipa-small-collected-improvements' Alex Elder says: ==================== net: ipa: small collected improvements This series contains a somewhat unrelated set of changes, some inspired by some recent work posted for back-port. For the most part they're meant to improve the code without changing it's functionality. Each basically stands on its own. ==================== Link: https://lore.kernel.org/r/20211124202511.862588-1-elder@linaro.org Signed-off-by: Jakub Kicinski commit faa88ecead2f3f1326d6c753af6e700a49872482 Author: Alex Elder Date: Wed Nov 24 14:25:11 2021 -0600 net: ipa: rearrange GSI structure fields The dummy net_device is a large field in the GSI structure, but it is not at all interesting from the perspective of debugging. Move it to the end of the GSI structure so the other fields are easier to find in memory. The channel and event ring arrays are also very large, so move them near the end of the structure as well. Swap the position of the result and completion fields to improve structure packing. Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski commit 7ece9eaa3f16cec20f3138bab84f4fc98eff0ec8 Author: Alex Elder Date: Wed Nov 24 14:25:10 2021 -0600 net: ipa: GSI only needs one completion A mutex ensures we never submit more than one GSI command of any kind at once. This means the per-channel and per-event ring completion structures provide no benefit. Instead, just use the single (existing) GSI completion to signal the completion of GSI commands of all types. This makes gsi_evt_ring_init() a trivial function with no inverse, so open-code it in its sole caller and get rid of the function. Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski commit 1b65bbcc9a71012003511b23b02b32db5c2f1adb Author: Alex Elder Date: Wed Nov 24 14:25:09 2021 -0600 net: ipa: skip SKB copy if no netdev In ipa_endpoint_skb_copy(), a new socket buffer structure is allocated so that some data can be copied into it. However, after doing this, if the endpoint has a null netdev pointer, we just drop free the socket buffer. Instead, check endpoint->netdev pointer first, and just return early if it's null. Also return early if the SKB allocation fails, to avoid the deeper indentation in the normal path. Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski commit 01c36637aeaf5d3e74be4d8e00e8f4e62857dac0 Author: Alex Elder Date: Wed Nov 24 14:25:08 2021 -0600 net: ipa: explicitly disable HOLB drop during setup During setup, ipa_endpoint_program() programs each endpoint with various configuration parameters. One of those registers defines whether to drop packets when a head-of-line blocking condition is detected on an RX endpoint. We currently assume this is disabled; instead, explicitly set it to be disabled. Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski commit e6aab6b9b60050d4f635011213d488ee16e8234c Author: Alex Elder Date: Wed Nov 24 14:25:07 2021 -0600 net: ipa: rework how HOL_BLOCK handling is specified The head-of-line block (HOLB) drop timer is only meaningful when dropping packets due to blocking is enabled. Given that, redefine the interface so the timer is specified when enabling HOLB drop, and use a different function when disabling. To enable and disable HOLB drop, these functions will now be used: ipa_endpoint_init_hol_block_enable(endpoint, milliseconds) ipa_endpoint_init_hol_block_disable(endpoint) The existing ipa_endpoint_init_hol_block_enable() becomes a helper function, renamed ipa_endpoint_init_hol_block_en(), and used with ipa_endpoint_init_hol_block_timer() to enable HOLB block on an endpoint. Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski commit dc901505fd9820e2428dabb38f5c700d195ce2d3 Author: Alex Elder Date: Wed Nov 24 14:25:06 2021 -0600 net: ipa: zero unused portions of filter table memory Not all filter table entries are used. Only certain endpoints support filtering, and the table begins with a bitmap indicating which endpoints use the "slots" that follow for filter rules. Currently, unused filter table entries are not initialized. Instead, zero-fill the entire unused portion of the filter table memory regions, to make it more obvious that memory is unused (and not subsequently modified). This is not strictly necessary, but the result is reassuring when looking at filter table memory. Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski commit 76b5fbcd6b47e5c96daf4ae58a74613f3e0c58a7 Author: Alex Elder Date: Wed Nov 24 14:25:05 2021 -0600 net: ipa: kill ipa_modem_init() A recent commit made disabling the SMP2P "setup ready" interrupt unrelated to ipa_modem_stop(). Given that, it seems fitting to get rid of ipa_modem_init() and ipa_modem_exit() (which are trivial wrapper functions), and call ipa_smp2p_init() and ipa_smp2p_exit() directly instead. Signed-off-by: Alex Elder Signed-off-by: Jakub Kicinski commit 8abe19703825eda9c49f54624af57546c23af53f Author: Vladimir Oltean Date: Thu Nov 25 14:58:08 2021 +0200 net: dsa: felix: enable cut-through forwarding between ports by default The VSC9959 switch embedded within NXP LS1028A (and that version of Ocelot switches only) supports cut-through forwarding - meaning it can start the process of looking up the destination ports for a packet, and forward towards those ports, before the entire packet has been received (as opposed to the store-and-forward mode). The up side is having lower forwarding latency for large packets. The down side is that frames with FCS errors are forwarded instead of being dropped. However, erroneous frames do not result in incorrect updates of the FDB or incorrect policer updates, since these processes are deferred inside the switch to the end of frame. Since the switch starts the cut-through forwarding process after all packet headers (including IP, if any) have been processed, packets with large headers and small payload do not see the benefit of lower forwarding latency. There are two cases that need special attention. The first is when a packet is multicast (or flooded) to multiple destinations, one of which doesn't have cut-through forwarding enabled. The switch deals with this automatically by disabling cut-through forwarding for the frame towards all destination ports. The second is when a packet is forwarded from a port of lower link speed towards a port of higher link speed. This is not handled by the hardware and needs software intervention. Since we practically need to update the cut-through forwarding domain from paths that aren't serialized by the rtnl_mutex (phylink mac_link_down/mac_link_up ops), this means we need to serialize physical link events with user space updates of bonding/bridging domains. Enabling cut-through forwarding is done per {egress port, traffic class}. I don't see any reason why this would be a configurable option as long as it works without issues, and there doesn't appear to be any user space configuration tool to toggle this on/off, so this patch enables cut-through forwarding on all eligible ports and traffic classes. Signed-off-by: Vladimir Oltean Link: https://lore.kernel.org/r/20211125125808.2383984-2-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit a8bd9fa5b5272d8cac189b2bd5c64588431ee06a Author: Vladimir Oltean Date: Thu Nov 25 14:58:07 2021 +0200 net: ocelot: remove "bridge" argument from ocelot_get_bridge_fwd_mask The only called takes ocelot_port->bridge and passes it as the "bridge" argument to this function, which then compares it with ocelot_port->bridge. This is not useful. Instead, we would like this function to return 0 if ocelot_port->bridge is not present, which is what this patch does. Signed-off-by: Vladimir Oltean Link: https://lore.kernel.org/r/20211125125808.2383984-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski commit 4636440f913b2bd5051fae6006dd6f6c2456eb3b Author: Colin Ian King Date: Thu Nov 25 00:29:32 2021 +0000 net: dsa: qca8k: Fix spelling mistake "Mismateched" -> "Mismatched" There is a spelling mistake in a netdev_err error message. Fix it. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20211125002932.49217-1-colin.i.king@gmail.com Signed-off-by: Jakub Kicinski commit 61da6ac715700bcfeef50d187e15c6cc7c9d079b Author: Ong Boon Leong Date: Wed Nov 24 19:40:19 2021 +0800 net: stmmac: perserve TX and RX coalesce value during XDP setup When XDP program is loaded, it is desirable that the previous TX and RX coalesce values are not re-inited to its default value. This prevents unnecessary re-configurig the coalesce values that were working fine before. Fixes: ac746c8520d9 ("net: stmmac: enhance XDP ZC driver level switching performance") Signed-off-by: Ong Boon Leong Tested-by: Kurt Kanzenbach Link: https://lore.kernel.org/r/20211124114019.3949125-1-boon.leong.ong@intel.com Signed-off-by: Jakub Kicinski commit 739752d655b3a5fa6ea3d72c1b53cec082f86486 Author: Yang Yingliang Date: Wed Nov 24 16:40:48 2021 +0800 tsnep: Add missing of_node_put() in tsnep_mdio_init() The node pointer is returned by of_get_child_by_name() with refcount incremented in tsnep_mdio_init(). Calling of_node_put() to aovid the refcount leak in tsnep_mdio_init(). Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20211124084048.175456-1-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski commit a0341b73d843143afef52313b9f4470f5523941e Author: Tonghao Zhang Date: Thu Nov 25 10:54:44 2021 +0800 veth: use ethtool_sprintf instead of snprintf use ethtools api ethtool_sprintf to instead of snprintf. Signed-off-by: Tonghao Zhang Link: https://lore.kernel.org/r/20211125025444.13115-1-xiangxia.m.yue@gmail.com Signed-off-by: Jakub Kicinski commit cc0a75eb037539f68f7117a632673a75e39d8d6b Author: Russell King (Oracle) Date: Wed Nov 24 15:44:43 2021 +0000 net: macb: convert to phylink_generic_validate() Populate the supported interfaces bitmap and MAC capabilities mask for the macb driver and remove the old validate implementation. Signed-off-by: Russell King (Oracle) Link: https://lore.kernel.org/r/E1mpuRv-00D4rb-Lz@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski commit 4e9c91cf92ec3acee94e04425594aa3688a225e8 Author: Heiner Kallweit Date: Wed Nov 24 21:44:40 2021 +0100 r8169: disable detection of chip version 60 It seems only XID 609 made it to the mass market. Therefore let's disable detection of the other RTL8125a XID's. If nobody complains we can remove support for RTL_GIGA_MAC_VER_60 later. Signed-off-by: Heiner Kallweit Link: https://lore.kernel.org/r/2cd3df01-5f8b-08dd-6def-3f31a3014bde@gmail.com Signed-off-by: Jakub Kicinski commit deee705a1c9cce9c7eb699d529f1c0b3c80d339d Author: Dominik Kobinski Date: Thu Nov 25 22:56:26 2021 +0100 dt-bindings: pinctrl: qcom: pmic-gpio: Document pm8226 compatible Suggested-by: Ivaylo Ivanov Signed-off-by: Dominik Kobinski Link: https://lore.kernel.org/r/20211125215626.62447-1-dominikkobinski314@gmail.com Signed-off-by: Linus Walleij commit a1ee1c08fcd5af03187dcd41dcab12fd5b379555 Author: Chengfeng Ye Date: Fri Nov 5 06:45:07 2021 -0700 HSI: core: Fix return freed object in hsi_new_client cl is freed on error of calling device_register, but this object is return later, which will cause uaf issue. Fix it by return NULL on error. Signed-off-by: Chengfeng Ye Signed-off-by: Sebastian Reichel commit 8f6f41f39348f25db843f2fcb2f1c166b4bfa2d7 Author: Andrii Nakryiko Date: Tue Nov 23 16:23:25 2021 -0800 selftests/bpf: Fix misaligned accesses in xdp and xdp_bpf2bpf tests Similar to previous patch, just copy over necessary struct into local stack variable before checking its fields. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20211124002325.1737739-14-andrii@kernel.org commit 43080b7106db5bcdb4f09c2648e968151e1461b7 Author: Andrii Nakryiko Date: Tue Nov 23 16:23:24 2021 -0800 selftests/bpf: Fix misaligned memory accesses in xdp_bonding test Construct packet buffer explicitly for each packet to avoid unaligned memory accesses. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20211124002325.1737739-13-andrii@kernel.org commit 57428298b5acf2ba2dd98359c532774f6eaeecb3 Author: Andrii Nakryiko Date: Tue Nov 23 16:23:23 2021 -0800 selftests/bpf: Prevent out-of-bounds stack access in test_bpffs Buf can be not zero-terminated leading to strstr() to access data beyond the intended buf[] array. Fix by forcing zero termination. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20211124002325.1737739-12-andrii@kernel.org commit e2e0d90c550a2588ebed7aa2753adaac0f633989 Author: Andrii Nakryiko Date: Tue Nov 23 16:23:22 2021 -0800 selftests/bpf: Fix misaligned memory access in queue_stack_map test Copy over iphdr into a local variable before accessing its fields. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20211124002325.1737739-11-andrii@kernel.org commit 6c4dedb7550aafd094f7d803668fd039545f4e57 Author: Andrii Nakryiko Date: Tue Nov 23 16:23:21 2021 -0800 selftests/bpf: Prevent misaligned memory access in get_stack_raw_tp test Perfbuf doesn't guarantee 8-byte alignment of the data like BPF ringbuf does, so struct get_stack_trace_t can arrive not properly aligned for subsequent u64 accesses. Easiest fix is to just copy data locally. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20211124002325.1737739-10-andrii@kernel.org commit 3bd0233f388e061c44d36a1ac614a3bb4a851b7e Author: Andrii Nakryiko Date: Tue Nov 23 16:23:20 2021 -0800 selftests/bpf: Fix possible NULL passed to memcpy() with zero size Prevent sanitizer from complaining about passing NULL into memcpy(), even if it happens with zero size. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20211124002325.1737739-9-andrii@kernel.org commit 486e648cb2f170702fc05f777c7b6b3d8ec662ce Author: Andrii Nakryiko Date: Tue Nov 23 16:23:19 2021 -0800 selftests/bpf: Fix UBSan complaint about signed __int128 overflow Test is using __int128 variable as unsigned and highest order bit can be set to 1 after bit shift. Use unsigned __int128 explicitly and prevent UBSan from complaining. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20211124002325.1737739-8-andrii@kernel.org commit 593835377f24ca1bb98008ec1dc3baefe491ad6e Author: Andrii Nakryiko Date: Tue Nov 23 16:23:18 2021 -0800 libbpf: Fix using invalidated memory in bpf_linker add_dst_sec() can invalidate bpf_linker's section index making dst_symtab pointer pointing into unallocated memory. Reinitialize dst_symtab pointer on each iteration to make sure it's always valid. Fixes: faf6ed321cf6 ("libbpf: Add BPF static linker APIs") Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20211124002325.1737739-7-andrii@kernel.org commit 8cb125566c40b7141d8842c534f0ea5820ee3d5c Author: Andrii Nakryiko Date: Tue Nov 23 16:23:17 2021 -0800 libbpf: Fix glob_syms memory leak in bpf_linker glob_syms array wasn't freed on bpf_link__free(). Fix that. Fixes: a46349227cd8 ("libbpf: Add linker extern resolution support for functions and global variables") Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20211124002325.1737739-6-andrii@kernel.org commit 2a6a9bf26170b4e156c18706cd230934ebd2f95f Author: Andrii Nakryiko Date: Tue Nov 23 16:23:16 2021 -0800 libbpf: Don't call libc APIs with NULL pointers Sanitizer complains about qsort(), bsearch(), and memcpy() being called with NULL pointer. This can only happen when the associated number of elements is zero, so no harm should be done. But still prevent this from happening to keep sanitizer runs clean from extra noise. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20211124002325.1737739-5-andrii@kernel.org commit 401891a9debaf0a684502f2aaecf53448cee9414 Author: Andrii Nakryiko Date: Tue Nov 23 16:23:14 2021 -0800 libbpf: Fix potential misaligned memory access in btf_ext__new() Perform a memory copy before we do the sanity checks of btf_ext_hdr. This prevents misaligned memory access if raw btf_ext data is not 4-byte aligned ([0]). While at it, also add missing const qualifier. [0] Closes: https://github.com/libbpf/libbpf/issues/391 Fixes: 2993e0515bb4 ("tools/bpf: add support to read .BTF.ext sections") Reported-by: Evgeny Vereshchagin Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20211124002325.1737739-3-andrii@kernel.org commit 1144ab9bdf3430e1b5b3f22741e5283841951add Author: Andrii Nakryiko Date: Tue Nov 23 16:23:13 2021 -0800 tools/resolve_btf_ids: Close ELF file on error Fix one case where we don't do explicit clean up. Fixes: fbbb68de80a4 ("bpf: Add resolve_btfids tool to resolve BTF IDs in ELF object") Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20211124002325.1737739-2-andrii@kernel.org commit 2fe256a429cb6c0b0064563af4158470143a363c Author: Andrii Nakryiko Date: Wed Nov 24 11:32:33 2021 -0800 selftests/bpf: Migrate selftests to bpf_map_create() Conversion is straightforward for most cases. In few cases tests are using mutable map_flags and attribute structs, but bpf_map_create_opts can be used in the similar fashion, so there were no problems. Just lots of repetitive conversions. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20211124193233.3115996-5-andrii@kernel.org commit 99a12a32fee4f740af2f36bb8f64e11c026f3389 Author: Andrii Nakryiko Date: Wed Nov 24 11:32:32 2021 -0800 libbpf: Prevent deprecation warnings in xsk.c xsk.c is using own APIs that are marked for deprecation internally. Given xsk.c and xsk.h will be gone in libbpf 1.0, there is no reason to do public vs internal function split just to avoid deprecation warnings. So just add a pragma to silence deprecation warnings (until the code is removed completely). Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20211124193233.3115996-4-andrii@kernel.org commit a9606f405f2c8f24751b0a7326655a657a63ad60 Author: Andrii Nakryiko Date: Wed Nov 24 11:32:31 2021 -0800 libbpf: Use bpf_map_create() consistently internally Remove all the remaining uses of to-be-deprecated bpf_create_map*() APIs. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20211124193233.3115996-3-andrii@kernel.org commit 992c4225419a38663d6239bc2f525b4ac0429188 Author: Andrii Nakryiko Date: Wed Nov 24 11:32:30 2021 -0800 libbpf: Unify low-level map creation APIs w/ new bpf_map_create() Mark the entire zoo of low-level map creation APIs for deprecation in libbpf 0.7 ([0]) and introduce a new bpf_map_create() API that is OPTS-based (and thus future-proof) and matches the BPF_MAP_CREATE command name. While at it, ensure that gen_loader sends map_extra field. Also remove now unneeded btf_key_type_id/btf_value_type_id logic that libbpf is doing anyways. [0] Closes: https://github.com/libbpf/libbpf/issues/282 Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20211124193233.3115996-2-andrii@kernel.org commit e4f7ac90c2b09766e4acf771908987391c836413 Author: Andrii Nakryiko Date: Tue Nov 23 12:01:05 2021 -0800 selftests/bpf: Mix legacy (maps) and modern (vars) BPF in one test Add selftest that combines two BPF programs within single BPF object file such that one of the programs is using global variables, but can be skipped at runtime on old kernels that don't support global data. Another BPF program is written with the goal to be runnable on very old kernels and only relies on explicitly accessed BPF maps. Such test, run against old kernels (e.g., libbpf CI will run it against 4.9 kernel that doesn't support global data), allows to test the approach and ensure that libbpf doesn't make unnecessary assumption about necessary kernel features. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20211123200105.387855-2-andrii@kernel.org commit 16e0c35c6f7a2e90d52f3035ecf942af21417b7b Author: Andrii Nakryiko Date: Tue Nov 23 12:01:04 2021 -0800 libbpf: Load global data maps lazily on legacy kernels Load global data maps lazily, if kernel is too old to support global data. Make sure that programs are still correct by detecting if any of the to-be-loaded programs have relocation against any of such maps. This allows to solve the issue ([0]) with bpf_printk() and Clang generating unnecessary and unreferenced .rodata.strX.Y sections, but it also goes further along the CO-RE lines, allowing to have a BPF object in which some code can work on very old kernels and relies only on BPF maps explicitly, while other BPF programs might enjoy global variable support. If such programs are correctly set to not load at runtime on old kernels, bpf_object will load and function correctly now. [0] https://lore.kernel.org/bpf/CAK-59YFPU3qO+_pXWOH+c1LSA=8WA1yabJZfREjOEXNHAqgXNg@mail.gmail.com/ Fixes: aed659170a31 ("libbpf: Support multiple .rodata.* and .data.* BPF maps") Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: Song Liu Link: https://lore.kernel.org/bpf/20211123200105.387855-1-andrii@kernel.org commit be3dc15ffe644d1b8bfae4a05eae3dc413a7c5e7 Author: Andy Shevchenko Date: Tue Nov 23 12:18:37 2021 +0200 gpiolib: acpi: Unify debug and other messages format When ACPI device pointer available use it, otherwise take parent of GPIO chip. Signed-off-by: Andy Shevchenko commit bdfd6ab8fdccd8b138837efff66f4a1911496378 Author: Hans de Goede Date: Thu Nov 25 21:30:10 2021 +0100 gpiolib: acpi: Do not set the IRQ type if the IRQ is already in use If the IRQ is already in use, then acpi_dev_gpio_irq_get_by() really should not change the type underneath the current owner. I specifically hit an issue with this an a Chuwi Hi8 Super (CWI509) Bay Trail tablet, when the Boot OS selection in the BIOS is set to Android. In this case _STA for a MAX17047 ACPI I2C device wrongly returns 0xf and the _CRS resources for this device include a GpioInt pointing to a GPIO already in use by an _AEI handler, with a different type then specified in the _CRS for the MAX17047 device. Leading to the acpi_dev_gpio_irq_get() call done by the i2c-core-acpi.c code changing the type breaking the _AEI handler. Now this clearly is a bug in the DSDT of this tablet (in Android mode), but in general calling irq_set_irq_type() on an IRQ which already is in use seems like a bad idea. Signed-off-by: Hans de Goede Signed-off-by: Andy Shevchenko commit dbf6811abbfcc79d3cd5ce1ff53fe1c741167a1f Author: Archie Pusaka Date: Thu Nov 25 15:04:37 2021 +0800 Bluetooth: Limit duration of Remote Name Resolve When doing remote name request, we cannot scan. In the normal case it's OK since we can expect it to finish within a short amount of time. However, there is a possibility to scan lots of devices that (1) requires Remote Name Resolve (2) is unresponsive to Remote Name Resolve When this happens, we are stuck to do Remote Name Resolve until all is done before continue scanning. This patch adds a time limit to stop us spending too long on remote name request. Signed-off-by: Archie Pusaka Reviewed-by: Miao-chen Chou Signed-off-by: Marcel Holtmann commit ea13aed5e5dfbabd166759aaf9f4af3cb804875a Author: Archie Pusaka Date: Thu Nov 25 15:04:36 2021 +0800 Bluetooth: Send device found event on name resolve failure Introducing NAME_REQUEST_FAILED flag that will be sent together with device found event on name resolve failure. This will provide the userspace with an information so it can decide not to resolve the name for these devices in the future. Signed-off-by: Archie Pusaka Reviewed-by: Miao-chen Chou Signed-off-by: Marcel Holtmann commit 7978656caf2ad3963fb63797128ec8d71caa2798 Author: Luiz Augusto von Dentz Date: Wed Nov 24 16:16:13 2021 -0800 Bluetooth: HCI: Fix definition of hci_rp_delete_stored_link_key num_keys is actually 2 octects not 1: BLUETOOTH CORE SPECIFICATION Version 5.3 | Vol 4, Part E page 1989: Num_Keys_Deleted: Size: 2 octets 0xXXXX Number of Link Keys Deleted Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit e88422bccda86808359f0d4179e25e5c2191ab4f Author: Luiz Augusto von Dentz Date: Wed Nov 24 16:16:12 2021 -0800 Bluetooth: HCI: Fix definition of hci_rp_read_stored_link_key Both max_num_keys and num_key are 2 octects: BLUETOOTH CORE SPECIFICATION Version 5.3 | Vol 4, Part E page 1985: Max_Num_Keys: Size: 2 octets Range: 0x0000 to 0xFFFF Num_Keys_Read: Size: 2 octets Range: 0x0000 to 0xFFFF Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 028e083832b06fdeeb290e1e57dc1f6702c4c215 Author: Fugang Duan Date: Thu Nov 25 10:03:49 2021 +0800 tty: serial: imx: disable UCR4_OREN in .stop_rx() instead of .shutdown() The UCR4_OREN should be disabled before disabling the uart receiver in .stop_rx() instead of in the .shutdown(). Otherwise, if we have the overrun error during the receiver disable process, the overrun interrupt will keep trigging until we disable the OREN interrupt in the .shutdown(), because the ORE status can only be cleared when read the rx FIFO or reset the controller. Although the called time between the receiver disable and OREN disable in .shutdown() is very short, there is still the risk of endless interrupt during this short period of time. So here change to disable OREN before the receiver been disabled in .stop_rx(). Signed-off-by: Fugang Duan Signed-off-by: Sherry Sun Link: https://lore.kernel.org/r/20211125020349.4980-1-sherry.sun@nxp.com Signed-off-by: Greg Kroah-Hartman commit c67643b46c28fc8bb7d81c65bc7eef18c3fbe972 Author: Fugang Duan Date: Thu Nov 25 09:43:06 2021 +0800 tty: serial: imx: clear the RTSD status before enable the RTSD irq Clear RTSD status before enabling the irq event for RTSD in imx_uart_enable_wakeup function. Since RTSD can be set as the wakeup source, this can avoid any risk of false triggering of a wake-up interrupts. Acked-by: Uwe Kleine-König Signed-off-by: Fugang Duan Signed-off-by: Sherry Sun Link: https://lore.kernel.org/r/20211125014306.4432-1-sherry.sun@nxp.com Signed-off-by: Greg Kroah-Hartman commit d78328bcc4d0e677f2ff83f4ae1f43c933fbd143 Author: Jiri Slaby Date: Mon Nov 22 10:45:29 2021 +0100 tty: remove file from tty_ldisc_ops::ioctl and compat_ioctl After the previous patches, noone needs 'file' parameter in neither ioctl hook from tty_ldisc_ops. So remove 'file' from both of them. Cc: Marcel Holtmann Cc: Johan Hedberg Cc: Luiz Augusto von Dentz Cc: Wolfgang Grandegger Cc: Marc Kleine-Budde Cc: "David S. Miller" Cc: Jakub Kicinski Cc: Andreas Koensgen Cc: Paul Mackerras Acked-by: Krzysztof Kozlowski [NFC] Acked-by: Dmitry Torokhov Acked-by: Marc Kleine-Budde Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211122094529.24171-1-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 0e938533d96d656764fbd3fe0e2578873ec6d3e6 Author: Kamal Heib Date: Thu Nov 25 05:36:15 2021 +0200 RDMA/bnxt_re: Remove dynamic pkey table The RoCE spec requires RoCE devices to support only the default pkey. However the bnxt_re driver maintains a 0xFFFF entry pkey table and uses only the first entry. Remove the pkey table and hard code a table of length one hard wired with the default pkey. Link: https://lore.kernel.org/r/20211125033615.483750-1-kamalheib1@gmail.com Signed-off-by: Kamal Heib Reviewed-by: Devesh Sharma Signed-off-by: Jason Gunthorpe commit 5db96ef23bda6c2a61a51693c85b78b52d03f654 Author: Jiri Slaby Date: Mon Nov 22 12:16:48 2021 +0100 tty: drop tty_schedule_flip() Since commit a9c3f68f3cd8d (tty: Fix low_latency BUG) in 2014, tty_flip_buffer_push() is only a wrapper to tty_schedule_flip(). All users were converted in the previous patches, so remove tty_schedule_flip() completely while inlining its body into tty_flip_buffer_push(). One less exported function. Reviewed-by: Johan Hovold Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211122111648.30379-4-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit b68b914494df4f79b4e9b58953110574af1cb7a2 Author: Jiri Slaby Date: Mon Nov 22 12:16:47 2021 +0100 tty: the rest, stop using tty_schedule_flip() Since commit a9c3f68f3cd8d (tty: Fix low_latency BUG) in 2014, tty_flip_buffer_push() is only a wrapper to tty_schedule_flip(). We are going to remove the latter (as it is used less), so call the former in the rest of the users. Cc: Richard Henderson Cc: Ivan Kokshaysky Cc: Matt Turner Cc: William Hubbs Cc: Chris Brannon Cc: Kirk Reiser Cc: Samuel Thibault Cc: Heiko Carstens Cc: Vasily Gorbik Cc: Christian Borntraeger Cc: Alexander Gordeev Reviewed-by: Johan Hovold Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211122111648.30379-3-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 5f6a85158ccacc3f09744b3aafe8b11ab3b6c6f6 Author: Jiri Slaby Date: Mon Nov 22 12:16:46 2021 +0100 tty: drivers/tty/, stop using tty_schedule_flip() Since commit a9c3f68f3cd8d (tty: Fix low_latency BUG) in 2014, tty_flip_buffer_push() is only a wrapper to tty_schedule_flip(). We are going to remove the latter (as it is used less), so call the former in drivers/tty/. Cc: Vladimir Zapolskiy Reviewed-by: Johan Hovold Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211122111648.30379-2-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 0abfc79d724102ec91287e3e77ac8115fcf3ffe9 Author: Kamal Heib Date: Wed Nov 24 12:23:36 2021 +0200 RDMA/siw: Use helper function to set sys_image_guid Use the addrconf_addr_eui48() helper function to set the sys_image_guid, Also make sure the GUID is valid EUI-64 identifier. Link: https://lore.kernel.org/r/20211124102336.427637-1-kamalheib1@gmail.com Signed-off-by: Kamal Heib Acked-by: Bernard Metzler Signed-off-by: Jason Gunthorpe commit 925cac6358677d3d64f9b25f205eeb3d31c9f7f8 Author: Jack Wang Date: Wed Nov 24 09:10:40 2021 +0100 RDMA/rtrs-clt: Fix the initial value of min_latency The type of min_latency is ktime_t, so use KTIME_MAX to initialize the initial value. Fixes: dc3b66a0ce70 ("RDMA/rtrs-clt: Add a minimum latency multipath policy") Link: https://lore.kernel.org/r/20211124081040.19533-1-jinpu.wang@ionos.com Signed-off-by: Jack Wang Reviewed-by: Guoqing Jiang Signed-off-by: Jason Gunthorpe commit 57dcb6ec85d59e04285b7dcf10924bb819c8e46f Author: Emil Renner Berthing Date: Tue Nov 16 16:01:17 2021 +0100 serial: 8250_dw: Add StarFive JH7100 quirk On the StarFive JH7100 RISC-V SoC the UART core clocks can't be set to exactly 16 * 115200Hz and many other common bitrates. Trying this will only result in a higher input clock, but low enough that the UART's internal divisor can't come close enough to the baud rate target. So rather than try to set the input clock it's better to skip the clk_set_rate call and rely solely on the UART's internal divisor. Signed-off-by: Emil Renner Berthing Reviewed-by: Andy Shevchenko Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20211116150119.2171-15-kernel@esmil.dk Signed-off-by: Greg Kroah-Hartman commit c668d5676461b9449b7a3e11912db3fba9ace94d Author: Jiri Slaby Date: Thu Nov 18 08:31:25 2021 +0100 mxser: use PCI_DEVICE_DATA Now that we have all the PCI device IDs unified, we can use PCI_DEVICE_DATA() macro to simplify mxser's pci_device_id list, i.e. mxser_pcibrds. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211118073125.12283-20-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 4167bd25ec3bc221387ec6811c05eadfe3cf1d3e Author: Jiri Slaby Date: Thu Nov 18 08:31:24 2021 +0100 mxser: move ids from pci_ids.h here There is no point having MOXA PCI device IDs in include/linux/pci_ids.h. Move them to the driver and sort them all by the ID. Cc: Bjorn Helgaas Cc: linux-pci@vger.kernel.org Acked-by: Bjorn Helgaas Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211118073125.12283-19-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 16add04f7bff891eebc7d34bc404600c0fc41db1 Author: Jiri Slaby Date: Thu Nov 18 08:31:23 2021 +0100 mxser: add MOXA prefix to some PCI device IDs Some of the MOXA PCI device IDs contain _MOXA_, some don't. Add it to the latter, so that they are all unified. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211118073125.12283-18-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit eb68ac0462bffc2ceb63b3a76737d6c9f186e6de Author: Jiri Slaby Date: Thu Nov 18 08:31:22 2021 +0100 mxser: increase buf_overrun if tty_insert_flip_char() fails mxser doesn't increase port->icount.buf_overrun at all. Do so if overrun happens, so that it can be read from the stats. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211118073125.12283-17-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 9dd6f3063a733e0df2ff66f9c35419eb217d9af5 Author: Jiri Slaby Date: Thu Nov 18 08:31:21 2021 +0100 mxser: remove tty parameter from mxser_receive_chars_new() After the previous change (no plays with of tty->receive_room), the tty parameter is unused. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211118073125.12283-16-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit c6693e6e07805f1b7822b13a5b482bf2b6a1f312 Author: Jiri Slaby Date: Thu Nov 18 08:31:20 2021 +0100 mxser: don't throttle manually First, checking tty->receive_room to signalize whether there is enough space in the tty buffers does not make much sense. Provided the tty buffers are in tty_port and those are not checked at all. Second, if the rx path is throttled, with CRTSCTS, RTS is deasserted, but is never asserted again. This leads to port "lockup", not accepting any more input. So: 1) stty -F /dev/ttyMI0 crtscts # the mxser port 2) stty -F /dev/ttyS6 crtscts # the connected port 3) cat /dev/ttyMI0 4) "write in a loop" to /dev/ttyS6 5) cat from 3) produces the bytes from 4) 6) killall -STOP cat (the 3)'s one) 7) wait for RTS to drop on /dev/ttyMI0 8) killall -CONT cat (again the 3)'s one) cat erroneously produces no more output now (i.e. no data sent from ttyS6 to ttyMI can be seen). Note that the step 7) is performed twice: once from n_tty by tty_throttle_safe(), once by mxser_stoprx() from the receive path. Then after step 7), n_tty correctly unthrottles the input, but mxser calls mxser_stoprx() again as there is still only a little space in n_tty buffers (tty->receive_room mentioned at the beginning), but the device's FIFO is/can be already filled. After this patch, the output is correctly resumed, i.e. n_tty both throttles and unthrottles without interfering with mxser's attempts. This allows us to get rid of the non-standard ldisc_stop_rx flag from struct mxser_port. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211118073125.12283-15-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 49b798a69e2b1b8c9de6df66a5b8ccf090583551 Author: Jiri Slaby Date: Thu Nov 18 08:31:19 2021 +0100 mxser: clean up timeout handling in mxser_wait_until_sent() timeout cannot be zero at the point of use. So no need to check for zero. Also precompute the expiration time (into expire) and use it. This makes the code more clear. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211118073125.12283-14-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit fe74bc619b0db23c4b513141acd3e3e45694bb08 Author: Jiri Slaby Date: Thu Nov 18 08:31:18 2021 +0100 mxser: use msleep_interruptible() in mxser_wait_until_sent() Instead of schedule_timeout_interruptible(), because: 1) we don't have to bother with the task state, and 2) msleep* guarantees to sleep that time (if not interrupted). Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211118073125.12283-13-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 239ef19ef040698ccbabf25582b40c43554542fd Author: Jiri Slaby Date: Thu Nov 18 08:31:17 2021 +0100 mxser: extract TX empty check from mxser_wait_until_sent() And move it to new mxser_tx_empty(), because: 1) it simplifies the code (esp. the locking), and 2) serial_core needs such a hook anyway, so have it ready. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211118073125.12283-12-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit c7ec012f6c563a84fc5c3052d490292a129413b7 Author: Jiri Slaby Date: Thu Nov 18 08:31:16 2021 +0100 mxser: use tty_port_close() in mxser_close() Finally, the mxser_close() code in is mostly identical to tty_port_close(), so replace the code by a single call to the function. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211118073125.12283-11-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 467b4c47880dc8aaf26e31262d19271674fa862a Author: Jiri Slaby Date: Thu Nov 18 08:31:15 2021 +0100 mxser: don't flush buffer from mxser_close() directly I fail to see the point of calling mxser_flush_buffer() from mxser_close(): 1) The SW xmit buffer is freed in mxser_shutdown_port() right after the call to mxser_flush_buffer(). And all 'cnt', 'head', and 'tail' are properly initialized to 0 in mxser_activate(). 2) The HW buffer is flushed in mxser_shutdown_port() via mxser_disable_and_clear_FIFO() too. So the effect of doing it by mxser_flush_buffer() in mxser_close() is none. Hence remove it, so that when we use tty_port_close() later, the code is 1:1 identical. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211118073125.12283-10-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 47b722d473824e9c56b7487d47ea7423483258d9 Author: Jiri Slaby Date: Thu Nov 18 08:31:14 2021 +0100 mxser: call stop_rx from mxser_shutdown_port() mxser_stop_rx() should be called from mxser_shutdown_port() for several reasons: 1) info->slock is held while manipulating IER (as on other places), 2) hangup now stops rx too, 3) mxser_close() will use tty_port_close() and there is no place except tty_port_operations::shutdown() where this can be done, 4) this is the same sequence as serial_core does. So we can map this code 1:1 when switching the driver to it. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211118073125.12283-9-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 2fb19b957805e8d6b981cf339caecd7cb6a3893a Author: Jiri Slaby Date: Thu Nov 18 08:31:13 2021 +0100 mxser: remove tty->driver_data NULL check Noone sets tty->driver_data to NULL in the driver, so there is no point to check that in mxser_close(). Remove the check. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211118073125.12283-8-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 5c338fbf21ebf2206a4d5abf3bc077c9a9018a79 Author: Jiri Slaby Date: Thu Nov 18 08:31:12 2021 +0100 mxser: remove pointless xmit_buf checks xmit_buf is supposed to exist in all these functions. I.e. from tty_port_operations::activate() to ::shutdown(). So remove these checks. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211118073125.12283-7-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 3b88dbff1c4e7d8a78e11773f19869c598552fcb Author: Jiri Slaby Date: Thu Nov 18 08:31:11 2021 +0100 mxser: clean up tx handling in mxser_transmit_chars() The port->icount.tx is handled in a too complicated manner. Instead of remembering the original count and subtracting the new one from it, simply increase tx for each character in the loop. No need for cnt variable then. Change also the "X = X & Y" assignment to simpler "X &= Y". Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211118073125.12283-6-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 30f6027fe4643be955e4e9849f242e55ba993185 Author: Jiri Slaby Date: Thu Nov 18 08:31:10 2021 +0100 mxser: move MSR read to mxser_check_modem_status() The MSR read is currently performed on both places where mxser_check_modem_status() is called. So move it there to avoid code duplication. Rename the variable to msr while we move it, to actually see what "status" we are testing. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211118073125.12283-5-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 274ab58dc2b460cc474ffc7ccfcede4b2be1a3f5 Author: Jiri Slaby Date: Thu Nov 18 08:31:09 2021 +0100 mxser: keep only !tty test in ISR The others are superfluous with tty refcounting in place now. And they are racy in fact: * tty_port_initialized() reports false for a small moment after interrupts are enabled. * closing is 1 while the port is still alive. The queues are flushed later during close anyway. So there is no need for this special handling. Actually, the ISR should not flush the queues. It should behave as every other driver, just queue the chars into tty buffer and go on. But this will be changed later. There is still a lot code depending on having tty in ISR (and not only tty_port). Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211118073125.12283-4-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 568a2b9c1289dc090019d727b9af2285bc637353 Author: Jiri Slaby Date: Thu Nov 18 08:31:08 2021 +0100 mxser: rename mxser_close_port() to mxser_stop_rx() As it is the only thing it does now. This is one of the future serial_core hooks. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211118073125.12283-3-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit e25ed43b4b603c1f7727bfede684b165dc5cd18c Author: Jiri Slaby Date: Thu Nov 18 08:31:07 2021 +0100 mxser: remove wait for sent from mxser_close_port mxser_close() behaves like this: -> tty_port_close_start() -> tty_wait_until_sent() -> mxser_wait_until_sent() -> mxser_close_port -> wait for TEMT So it is already waited for TEMT through mxser_wait_until_sent() and there is another round of waiting in mxser_close_port(). The latter one is superfluous as nothing could be filled into the output FIFO. Remove the call. This helps unification among drivers (so that all behave the same) and future use of tty_port_close(). Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211118073125.12283-2-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 862f72187a41008df2cce3f8e97f57070cbc7060 Author: Lad Prabhakar Date: Wed Nov 10 23:29:20 2021 +0000 serial: sh-sci: Add support to deassert/assert reset line On RZ/G2L SoC we need to explicitly deassert the reset line for the device to work, use this opportunity to deassert/assert reset line in sh-sci driver. This patch adds support to read the "resets" property (if available) from DT and perform deassert/assert when required. Also, propagate the error to the caller of sci_parse_dt() instead of returning NULL in case of failure. Reviewed-by: Biju Das Reviewed-by: Philipp Zabel Reviewed-by: Geert Uytterhoeven Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211110232920.19198-4-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Greg Kroah-Hartman commit e1c0fc101340716fc1786b89f627425ecc6e5420 Author: Lad Prabhakar Date: Wed Nov 10 23:29:19 2021 +0000 dt-bindings: serial: renesas,sci: Document RZ/G2L SoC Add SCI binding documentation for Renesas RZ/G2L SoC. Also update the example node with RZ/G2L SCI0 node. Reviewed-by: Biju Das Reviewed-by: Geert Uytterhoeven Acked-by: Rob Herring Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211110232920.19198-3-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Greg Kroah-Hartman commit 0836150c26c4028be9bd77c9a3dc3e3493542815 Author: Lad Prabhakar Date: Wed Nov 10 23:29:18 2021 +0000 dt-bindings: serial: renesas,scif: Make resets as a required property Make "resets" as required property for RZ/G2L. On RZ/G2L the devices should be explicitly pulled out of reset for this reason make "resets" as required property. Reviewed-by: Biju Das Reviewed-by: Geert Uytterhoeven Acked-by: Rob Herring Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211110232920.19198-2-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Greg Kroah-Hartman commit 8d0d2b0f41b1b2add8a30dbd816051a964efa497 Author: Håkon Bugge Date: Tue Nov 23 11:06:18 2021 +0100 RDMA/cma: Remove open coding of overflow checking for private_data_len The existing tests are a little hard to comprehend. Use check_add_overflow() instead. Fixes: 04ded1672402 ("RDMA/cma: Verify private data length") Link: https://lore.kernel.org/r/1637661978-18770-1-git-send-email-haakon.bugge@oracle.com Signed-off-by: Håkon Bugge Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 2765852e74c8cfb5317cd22331800f00ab71ff46 Author: Jiri Slaby Date: Thu Nov 18 08:19:11 2021 +0100 tty: serial, join uport checks in uart_port_shutdown() There are two consequent checks of uport != NULL in uart_port_shutdown(). Join these two under a single block. De-multiline the comments when shuffling with them anyway. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211118071911.12059-5-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 954a0881a9d4f92bd645ebb06a5f939a19c82056 Author: Jiri Slaby Date: Thu Nov 18 08:19:10 2021 +0100 tty: clean up whitespace in __do_SAK() Remove spaces before the 'i' variable declaration and wrap parameters of group_send_sig_info(). Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211118071911.12059-4-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 8cb28417dd2ce46938fea9aca9f56fb1f7b1934a Author: Jiri Slaby Date: Thu Nov 18 08:19:09 2021 +0100 tty: remove tty NULL check from __do_SAK() Both do_SAK_work() and vc_SAK() provide a valid tty to __do_SAK(), so remove the check. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211118071911.12059-3-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 463d4c74bffd7209914bf1eefb6d2fa991422863 Author: Jiri Slaby Date: Thu Nov 18 08:19:08 2021 +0100 tty: remove TTY_SOFT_SAK part from __do_SAK() Remove the TTY_SOFT_SAK part. It is never defined, so this is only confusing. It was actually never defined since its introduction in 0.99.14g. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211118071911.12059-2-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit ea502201da45d3737a77d17e96d952d0a85cdc7d Author: Jiri Slaby Date: Thu Nov 18 08:17:16 2021 +0100 n_gsm: remove unused parameters from gsm_error() data and flag are unused in gsm_error(), so remove them. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20211118071716.11984-1-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman commit 635e4172bd0a43af943fb164799965fc9a9a705d Author: Lukas Bulwahn Date: Tue Nov 2 07:38:10 2021 +0100 arm: remove zte zx platform left-over Commit 89d4f98ae90d ("ARM: remove zte zx platform") missed to remove some definitions for this platform's debug and serial, e.g., code dependent on the config DEBUG_ZTE_ZX. Fortunately, ./scripts/checkkconfigsymbols.py detects this and warns: DEBUG_ZTE_ZX Referencing files: arch/arm/include/debug/pl01x.S Further review by Arnd Bergmann identified even more dead code in the amba serial driver. Remove all this left-over from the zte zx platform. Reviewed-by: Arnd Bergmann Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20211102063810.932-1-lukas.bulwahn@gmail.com Signed-off-by: Greg Kroah-Hartman commit 223b4d5c8702a92fb18d14e3f32953e474313e5b Author: Christophe JAILLET Date: Wed Nov 24 22:40:26 2021 +0100 RDMA/cxgb4: Use non-atomic bitmap functions when possible The accesses to the 'alloc->table' bitmap are protected by the 'alloc->lock' spinlock, so no concurrent accesses can happen. So prefer the non-atomic '__[set|clear]_bit()' functions to save a few cycles. Link: https://lore.kernel.org/r/0c1c4505ca32f5ba4126e3e324041da191513ef2.1637789139.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET Signed-off-by: Jason Gunthorpe commit 967a578af0c6d0c6c50ee5f9c48216cd2eebe4ef Author: Christophe JAILLET Date: Wed Nov 24 22:40:25 2021 +0100 RDMA/cxgb4: Use bitmap_set() when applicable The 'alloc->table' bitmap has just been allocated, so this is safe to use the faster and non-atomic 'bitmap_set()' function. There is no need to hand-write it. Link: https://lore.kernel.org/r/fd978b837935ed04863ffecfd495c4601a986df6.1637789139.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET Signed-off-by: Jason Gunthorpe commit d4fdc383c023efcdc88bcb9a30ea982e036758c1 Author: Christophe JAILLET Date: Wed Nov 24 22:40:24 2021 +0100 RDMA/cxgb4: Use bitmap_zalloc() when applicable Use 'bitmap_zalloc()' to simplify code, improve the semantic and avoid some open-coded arithmetic in allocator arguments. Using the 'zalloc' version of the allocator also saves a now useless 'bitmap_zero()' call. Also change the corresponding 'kfree()' into 'bitmap_free()' to keep consistency. While at it, remove an extra space in a statement just a few lines above. Link: https://lore.kernel.org/r/e396c4aa16cd8945d43877570a8f6d926cea555a.1637789139.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET Signed-off-by: Jason Gunthorpe commit 675e2694fc6c99effd6f07df296b1d806e49ec88 Author: Christophe JAILLET Date: Wed Nov 24 21:43:35 2021 +0100 IB/mthca: Use non-atomic bitmap functions when possible in 'mthca_mr.c' In 'mthca_buddy_init()', the 'buddy->bits[n]' bitmap has just been allocated, so no concurrent accesses can occur. The other accesses to the 'buddy->bits[n]' bitmap are protected by the 'buddy->lock' spinlock, so no concurrent accesses can occur. So prefer the non-atomic '__[set|clear]_bit()' functions to save a few cycles. Link: https://lore.kernel.org/r/a19b88ccdbc03972fd97306b998731814283041f.1637785902.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET Signed-off-by: Jason Gunthorpe commit 19453f34cf4916054cbbe499fd77715fde791622 Author: Christophe JAILLET Date: Wed Nov 24 21:42:32 2021 +0100 IB/mthca: Use non-atomic bitmap functions when possible in 'mthca_allocator.c' The accesses to the 'alloc->table' bitmap are protected by the 'alloc->lock' spinlock, so no concurrent accesses can happen. So prefer the non-atomic '__[set|clear]_bit()' functions to save a few cycles. Link: https://lore.kernel.org/r/5f909ca1284fa4d2cf13952b08b9e303b656c968.1637785902.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET Signed-off-by: Jason Gunthorpe commit a277f383217a2c03f96166c5b33304c8b939532e Author: Christophe JAILLET Date: Wed Nov 24 21:41:36 2021 +0100 IB/mthca: Use bitmap_set() when applicable The 'alloc->table' bitmap has just been allocated, so this is safe to use the faster and non-atomic 'bitmap_set()' function. There is no need to hand-write it. Link: https://lore.kernel.org/r/f1bd33f6ea6c8ad519a222db6e9aa17c55610557.1637785902.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET Signed-off-by: Jason Gunthorpe commit 12d1e2f3c5762df4ad72c75b2464a5b538f12aa9 Author: Christophe JAILLET Date: Wed Nov 24 21:40:51 2021 +0100 IB/mthca: Use bitmap_zalloc() when applicable Use 'bitmap_zalloc()' to simplify code, improve the semantic and avoid some open-coded arithmetic in allocator arguments. Using the 'zalloc' version of the allocator also saves a now useless 'bitmap_zero()' call. Also change the corresponding 'kfree()' into 'bitmap_free()' to keep consistency. Link: https://lore.kernel.org/r/ea9031e28f453bc179033740f66f0c19293fcf0b.1637785902.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET Signed-off-by: Jason Gunthorpe commit b88fea5faa0c903c858d9dd3a05930dc46039407 Author: Jacky Bai Date: Sat Nov 20 19:34:48 2021 +0800 dt-bindings: serial: fsl-lpuart: Add imx8ulp compatible string The lpuart on i.MX8ULP is derived from i.MX7ULP, it uses two compatible strings, so update the compatible string for i.MX8ULP. Reviewed-by: Dong Aisheng Acked-by: Rob Herring Signed-off-by: Jacky Bai Signed-off-by: Peng Fan Link: https://lore.kernel.org/r/20211120113454.785997-3-peng.fan@oss.nxp.com Signed-off-by: Greg Kroah-Hartman commit 7ee7482e60fd7a870ca7cd13f4c7bc3841f99815 Author: Jing Yao Date: Thu Nov 4 11:47:54 2021 +0000 serial: 8250: replace snprintf in show functions with sysfs_emit coccicheck complains about the use of snprintf() in sysfs show functions: WARNING use scnprintf or sprintf Use sysfs_emit instead of scnprintf or sprintf makes more sense. Reported-by: Zeal Robot Reviewed-by: Johan Hovold Signed-off-by: Jing Yao Link: https://lore.kernel.org/r/20211104114754.30983-1-yao.jing2@zte.com.cn Signed-off-by: Greg Kroah-Hartman commit 84c365f8ff8fc93a34d6cabe780d0b0f49c177e2 Author: Martin Kaiser Date: Thu Nov 25 17:25:12 2021 +0100 staging: r8188eu: remove the _cancel_workitem_sync wrapper Remove the _cancel_workitem_sync wrapper and call cancel_work_sync directly. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211125162513.25039-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 05b57e8c91ca5cf2af112c1a30ca97446f084232 Author: Martin Kaiser Date: Thu Nov 25 17:25:11 2021 +0100 staging: r8188eu: remove the _init_workitem wrapper Remove the _init_workitem wrapper and call INIT_WORK directly. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211125162513.25039-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 1875be81b5a86e1d83bbb624e3613eb2644cb9e3 Author: Martin Kaiser Date: Thu Nov 25 17:25:10 2021 +0100 staging: r8188eu: remove the _set_workitem wrapper Remove the _set_workitem wrapper and call schedule_work directly. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211125162513.25039-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit e3f6a0050663f68258b91f9fd1fdf8426e694aa1 Author: Martin Kaiser Date: Thu Nov 25 16:14:36 2021 +0100 staging: r8188eu: hal data's board type is unused BoardType in struct hal_data_8188e is not used. Remove the variable and the function to extract the board type from the efuses. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211125151436.5895-7-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 8da08f11ff5ad43d4c80ee65f37e87f193fc6951 Author: Martin Kaiser Date: Thu Nov 25 16:14:35 2021 +0100 staging: r8188eu: remove unused eeprom defines Remove a number of eeprom defines which are not used. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211125151436.5895-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit d0fe08b29ea66b6cbb7779cf609aca4c5d5bb47c Author: Martin Kaiser Date: Thu Nov 25 16:14:34 2021 +0100 staging: r8188eu: do not extract eeprom version from the fuses EEPROMVersion in struct hal_data_8188e is not used. There's no need to parse the fuses and extract the version. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211125151436.5895-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 445a740c0b10b157bc0d800799dd8bd356203de2 Author: Martin Kaiser Date: Thu Nov 25 16:14:33 2021 +0100 staging: r8188eu: remove unused efuse defines This patch removes some unused defines, macros and include statements related to efuses. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211125151436.5895-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit dfff95efa22e0b5998e127a92e1a094862ca7192 Author: Martin Kaiser Date: Thu Nov 25 16:14:32 2021 +0100 staging: r8188eu: efuse_WordEnableDataRead is not used The efuse_WordEnableDataRead function is not used and can be removed. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211125151436.5895-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 2c7517b1eff274075eb15f1a4607a6b2304e2cdb Author: Martin Kaiser Date: Thu Nov 25 16:14:31 2021 +0100 staging: r8188eu: Efuse_CalculateWordCnts is not used Remove the Efuse_CalculateWordCnts function, which is not used. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211125151436.5895-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit b3d893ab19026a1e9f808e10314b382cd904e95c Author: Vihas Mak Date: Thu Nov 25 00:34:36 2021 +0530 staging: r8188eu: use max() and min() macros use max() and min() macros to fix following cocci warnings: drivers/staging/r8188eu/core/rtw_wlan_util.c:719: WARNING opportunity for min() drivers/staging/r8188eu/core/rtw_wlan_util.c:724: WARNING opportunity for max() Reviewed-by: Dan Carpenter Signed-off-by: Vihas Mak Link: https://lore.kernel.org/r/20211124190436.251312-1-makvihas@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6d7cf7440063076ac45472ce28221a4ed8ea1298 Author: Alberto Merciai Date: Fri Nov 19 09:16:56 2021 +0100 staging: vt6655: refactor camelcase byMaxPwrLevel to max_pwr_level Replace hungarian notated variable "byMaxPwrLevel" with "max_pwr_level" compliant with linux kernel coding style. Signed-off-by: Alberto Merciai Link: https://lore.kernel.org/r/20211119081656.GA12982@alb3rt0-VirtualBox Signed-off-by: Greg Kroah-Hartman commit 9e861d3f4d84083e2cfcf590820b0a534b705bf5 Author: Alberto Merciai Date: Sun Nov 21 12:19:59 2021 +0100 staging: vt6655: rename variable bHWRadioOff Replace camelcase hungarian notated variable "bHWRadioOff" into linux kernel coding style equivalent variable "hw_radio_off". Tested-by: Tommaso Merciai Acked-by: Tommaso Merciai Acked-by: Tommaso Merciai Signed-off-by: Alberto Merciai Link: https://lore.kernel.org/r/20211121112000.632456-1-alb3rt0.m3rciai@gmail.com Signed-off-by: Greg Kroah-Hartman commit b0e160f02a7e927380e1e2d92629dd73c0ec4380 Author: Gaston Gonzalez Date: Mon Nov 22 10:09:26 2021 -0300 staging: vchiq_core: remove superfluous static_assert statement After removing the BITSET_T typedef in commit d8a364820e01 ("staging: vchiq_core: get rid of typedef") the static_assert statement becomes superfluous as now we are checking if the size of the u32 type is 4 bytes. Hence, just remove the static_assert statement. Suggested-by: Dan Carpenter Signed-off-by: Gaston Gonzalez Link: https://lore.kernel.org/r/20211122130926.342128-1-gascoar@gmail.com Signed-off-by: Greg Kroah-Hartman commit 8ee04b5613547d7f649b9b8172d29c5071e3799a Author: Michael Straube Date: Fri Nov 19 13:26:35 2021 +0100 staging: r8188eu: remove rf_type from HT_caps_handler() rf_type is always RF_1T1R. Remove it from HT_caps_handler() and remove related dead code. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211119122635.28435-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 57fd3205ddca020830917c094450be8e62a3f382 Author: Michael Straube Date: Fri Nov 19 13:26:34 2021 +0100 staging: r8188eu: remove rf_type from add_RATid() rf_type is always RF_1T1R. Remove it from add_RATid() and remove related dead code. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211119122635.28435-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 56f1cf0e3f021530846dd303705b795c19b5703c Author: Michael Straube Date: Thu Nov 18 22:50:52 2021 +0100 staging: r8188eu: remove rf_type from rtw_mcs_rate() rf_type is always RF_1T1R. Remove it from rtw_mcs_rate() and remove related dead code. Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211118215052.5215-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6723b283c44a3fdf9f922ae9788aab38bd909211 Author: Candy Febriyanto Date: Thu Nov 18 23:37:34 2021 +0700 staging: r8188eu: Remove support for devices with 8188FU chipset (0bda:f179) The new r8188eu driver doesn't actually support devices with vendor ID 0bda and product ID f179[0][1][2], remove the ID so owners of these devices don't have to blacklist the staging driver. [0] https://github.com/lwfinger/rtl8188eu/issues/366#issuecomment-888511731 [1] https://github.com/lwfinger/rtl8188eu/issues/385 [2] https://github.com/lwfinger/rtl8188eu/issues/385#issuecomment-973013539 Cc: Larry Finger CC: Phillip Potter Signed-off-by: Candy Febriyanto Link: https://lore.kernel.org/r/YZaBTq9vlMaJDFz2@mainframe.localdomain Signed-off-by: Greg Kroah-Hartman commit 5cf069f910c5c87055fb970a8103f0ad38ba7143 Author: Liu Junqi Date: Thu Nov 25 12:47:29 2021 +0800 staging: unisys: visornic: removed a blank line at the end of function Removed a blank line at the end of function to clear checkpatch warning and make it more like typical coding style. Signed-off-by: Liu Junqi Link: https://lore.kernel.org/r/20211125044729.594727-3-liujunqi@pku.edu.cn Signed-off-by: Greg Kroah-Hartman commit 4e4437d09cbeb1babbf7986414ff9f23679c76a6 Author: Liu Junqi Date: Thu Nov 25 12:47:28 2021 +0800 staging: unisys: visornic: reindent to avoid '(' at the end of line A change to make the code more like typical coding style. Signed-off-by: Liu Junqi Link: https://lore.kernel.org/r/20211125044729.594727-2-liujunqi@pku.edu.cn Signed-off-by: Greg Kroah-Hartman commit a70fc7d0d1beb4c6d3ce1eb1a18624fa59538f40 Author: Liu Junqi Date: Thu Nov 25 12:47:27 2021 +0800 staging: unisys: visornic: fixed a typo cant -> can't Fixed a typo: cant -> can't in visornic_main.c. Signed-off-by: Liu Junqi Link: https://lore.kernel.org/r/20211125044729.594727-1-liujunqi@pku.edu.cn Signed-off-by: Greg Kroah-Hartman commit 515f49702423f3a9b1bb6b6d89057bb47f799062 Author: Liu Junqi Date: Thu Nov 18 11:37:38 2021 +0800 staging: unisys: visorhba: use tab to indent instead of whitespace changed the whitespace to tab to comply with kernel coding style. Signed-off-by: Liu Junqi Link: https://lore.kernel.org/r/20211118033737.576775-1-liujunqi@pku.edu.cn Signed-off-by: Greg Kroah-Hartman commit b6c7db32183251204f124b10d6177d46558ca7b8 Author: Hao Xu Date: Thu Nov 25 17:21:03 2021 +0800 io_uring: better to use REQ_F_IO_DRAIN for req->flags It's better to use REQ_F_IO_DRAIN for req->flags rather than IOSQE_IO_DRAIN though they have same value. Signed-off-by: Hao Xu Link: https://lore.kernel.org/r/20211125092103.224502-3-haoxu@linux.alibaba.com Signed-off-by: Jens Axboe commit e302f1046f4c209291b07ff7bc4d15ca26891f16 Author: Hao Xu Date: Thu Nov 25 17:21:02 2021 +0800 io_uring: fix no lock protection for ctx->cq_extra ctx->cq_extra should be protected by completion lock so that the req_need_defer() does the right check. Cc: stable@vger.kernel.org Signed-off-by: Hao Xu Link: https://lore.kernel.org/r/20211125092103.224502-2-haoxu@linux.alibaba.com Signed-off-by: Jens Axboe commit f3dc3009c2edb1512e0fe6964f387045a36b2ff4 Author: Hans de Goede Date: Tue Nov 23 22:04:23 2021 +0100 platform/x86: thinkpad_acpi: Remove unused sensors_pdev_attrs_registered flag After the recent sysfs-attributes registration cleanups, the tp_features.sensors_pdev_attrs_registered flag only ever gets set and never gets read, remove it. Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211123210424.266607-6-hdegoede@redhat.com commit 526ac103dbc67291a071fc57aab0f85ad7298ef3 Author: Hans de Goede Date: Tue Nov 23 22:04:22 2021 +0100 platform/x86: thinkpad_acpi: Fix the hwmon sysfs-attr showing up in the wrong place The hwmon sysfs-attr should show up under the hwmon-classdev, not under the tpacpi_sensors_pdev. Pass the tpacpi_hwmon_groups attr-groups array to hwmon_device_register_with_groups() instead of setting tpacpi_hwmon_pdriver.driver.dev_groups to it to fix this. This also requires moving the hwmon_device_register_with_groups() call to after the subdriver init functions have run so that the is_visible() calls will work properly. Fixes: 79f960e29cfc ("platform/x86: thinkpad_acpi: Convert platform driver to use dev_groups") Cc: Len Baker Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211123210424.266607-5-hdegoede@redhat.com commit 5cd689683eb0507c67f825f1c29b17bb80612468 Author: Hans de Goede Date: Tue Nov 23 22:04:21 2021 +0100 platform/x86: thinkpad_acpi: tpacpi_attr_group contains driver attributes not device attrs Commit 79f960e29cfc ("platform/x86: thinkpad_acpi: Convert platform driver to use dev_groups") put the debug_level, interface_version, version and the THINKPAD_ACPI_DEBUGFACILITIES attributes in a new tpacpi_attr_group and added those to the tpacpi_groups groups-array which is used to initialize the driver.dev_groups member. But before this commit these attributes were registered with driver_create_file(), so they should be part of the groups-array which is used to initialize the driver.groups member instead. And also make the same change for the fan_watchdog hwmon driver attribute. Fixes: 79f960e29cfc ("platform/x86: thinkpad_acpi: Convert platform driver to use dev_groups") Cc: Len Baker Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211123210424.266607-4-hdegoede@redhat.com commit 2f5ad08f3eec8d4376b62f3fe708102f6aaea056 Author: Hans de Goede Date: Tue Nov 23 22:04:20 2021 +0100 platform/x86: thinkpad_acpi: Register tpacpi_pdriver after subdriver init Commit 79f960e29cfc ("platform/x86: thinkpad_acpi: Convert platform driver to use dev_groups") introduces the use of driver.dev_groups + attribute_group.is_visible callbacks replacing the conditional calling of driver_create_file() for optional attributes. The is_visible callbacks rely on various tp_features.has_foo flags, which get set by the subdriver init functions. But before this fix, thinkpad_acpi_module_init() would call the subdriver init functions after registering the platform_device and the tpacpi_pdriver. Which would cause the is_visible callbacks to get called before the subdriver init functions, which in turn would cause optional attributes to not get registered at all, even when the feature is actually present. Fix this by moving the platform_driver_register(&tpacpi_pdriver) to after the subdriver init calls; and do the same for the tpacpi_hmon_pdriver. Fixes: 79f960e29cfc ("platform/x86: thinkpad_acpi: Convert platform driver to use dev_groups") Cc: Len Baker Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211123210424.266607-3-hdegoede@redhat.com commit 910524004383863bb1d2888e510dd61fd00119d0 Author: Hans de Goede Date: Tue Nov 23 22:04:19 2021 +0100 platform/x86: thinkpad_acpi: Restore missing hotkey_tablet_mode and hotkey_radio_sw sysfs-attr Commit c99ca78d67a6 ("platform/x86: thinkpad_acpi: Switch to common use of attributes") removed the conditional adding of the hotkey_tablet_mode and hotkey_radio_sw sysfs-attributes, replacing this with a hotkey_attr_is_visible() callback which hides them when the feature is not present. But this commit forgot to add these 2 attributes to the default hotkey_attributes[] set, so they would now never get added at all. Add the 2 attributes to the default hotkey_attributes[] set so that they are available on systems with these features once more. Fixes: c99ca78d67a6 ("platform/x86: thinkpad_acpi: Switch to common use of attributes") Cc: Len Baker Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211123210424.266607-2-hdegoede@redhat.com commit 3a0abea60c6a39f5362db6d78cba7a932850fec2 Author: Hans de Goede Date: Sun Nov 21 20:11:29 2021 +0100 platform/x86: thinkpad_acpi: Fix thermal_temp_input_attr sorting Fix thermal_temp_input_attr sorting. Now that we use is_visible, rather then registering only part of the thermal_temp_input_attr array, putting attr 0-7 last is no longer needed. Reviewed-by: Andy Shevchenko Tested-by: Mark Pearson Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211121191129.256713-8-hdegoede@redhat.com commit cb97f5f01d383ff166d50e356d07ac38d6033ac8 Author: Hans de Goede Date: Sun Nov 21 20:11:28 2021 +0100 platform/x86: thinkpad_acpi: Remove "goto err_exit" from hotkey_init() The err_exit label just does a: return (res < 0) ? res : -ENODEV; And res is always < 0 when we go there (hotkey_mask_get() returns either 0 or -EIO), so the goto-s can simply be replaced with "return res". Reviewed-by: Andy Shevchenko Tested-by: Mark Pearson Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211121191129.256713-7-hdegoede@redhat.com commit 798682e236893a20e5674de02ede474373dd342d Author: Hans de Goede Date: Sun Nov 21 20:11:27 2021 +0100 platform/x86: thinkpad_acpi: Properly indent code in tpacpi_dytc_profile_init() The previous refactoring of some code in tpacpi_dytc_profile_init() left a weirdly indented code-block behind. Remove the unnecessary '{}' and reduce the indent level one step, other then changing the indentation the code is completely unchanged. Reviewed-by: Andy Shevchenko Tested-by: Mark Pearson Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211121191129.256713-6-hdegoede@redhat.com commit 0b0d2fba4f3302b601c429c9286e66b3af2d29cb Author: Hans de Goede Date: Sun Nov 21 20:11:26 2021 +0100 platform/x86: thinkpad_acpi: Cleanup dytc_profile_available Remove the dytc_profile_available check from dytc_profile_set(), that function only gets called if the platform_profile_handler was registered, so the check is not necessary. Make tpacpi_dytc_profile_init() return -ENODEV when it does not register the platform_profile() handler this will cause dytc_profile_driver_data.flags.init to not get set, which in turn will cause the dytc_profile_exit() call to get skipped. Together this avoids the need to have the dytc_profile_available variable at all, since the information is now duplicated in the dytc_profile_driver_data.flags.init flag. Note this leaves a weirdly indented code-block behind, this is deliberately done to make what actually changes in this commit clear. This will be fixed-up in the next commit. Reviewed-by: Andy Shevchenko Tested-by: Mark Pearson Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211121191129.256713-5-hdegoede@redhat.com commit 5a47ac0041678d3d610b3ac724bca8c4bda2ddff Author: Hans de Goede Date: Sun Nov 21 20:11:25 2021 +0100 platform/x86: thinkpad_acpi: Simplify dytc_version handling The only reason the proxysensor code needs dytc_version handling is for proxsensor_attr_is_visible() and that will only ever get called after all the subdrv init() callbacks have run. tpacpi_dytc_profile_init() already calls DYTC_CMD_QUERY and is the primary consumer of dytc_version, so simply let tpacpi_dytc_profile_init() set dytc_version and remove the now no longer necessary dytc_get_version() helper and its calls. Reviewed-by: Andy Shevchenko Tested-by: Mark Pearson Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211121191129.256713-4-hdegoede@redhat.com commit c7e1c782f2432cd4dc6c6ea930d99d93997a0edb Author: Hans de Goede Date: Sun Nov 21 20:11:24 2021 +0100 platform/x86: thinkpad_acpi: Make *_init() functions return -ENODEV instead of 1 Make ibm_init_struct.init() callbacks return -ENODEV instead of 1 when the subdevice / function is not available. Using -ENODEV clearly states what it going on where as a magic return of "1" requires a deep dive into the code to figure out what is going on. This also allows for some cleanups, avoiding the need to translate an -ENODEV return into "return 1" (which often mistakenly was "return 0"). Reviewed-by: Andy Shevchenko Tested-by: Mark Pearson Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211121191129.256713-3-hdegoede@redhat.com commit 28f645fc9424bf455528cb92bd6a7120281bca45 Author: Fabrice Gasnier Date: Mon Oct 25 17:17:50 2021 +0200 ARM: dts: stm32: tune the HS USB PHYs on stm32mp157c-ev1 This patch adds phy tuning parameters for usbphyc port0 (USBH controller) and usbphyc port1 (OTG controller). Phy tuning parameters are used to adjust the phy settings to compensate parasitics, which can be due to USB receptacle, routing, and ESD protection component. Signed-off-by: Amelie Delaunay Signed-off-by: Fabrice Gasnier Signed-off-by: Alexandre Torgue commit 2312a6e7b301f43f02fb30b1dee932df5a87a7d0 Author: Fabrice Gasnier Date: Mon Oct 25 17:17:49 2021 +0200 ARM: dts: stm32: tune the HS USB PHYs on stm32mp15xx-dkx This patch adds phy tuning parameters for usbphyc port0 (USBH controller) and usbphyc port1 (OTG controller). Phy tuning parameters are used to adjust the phy settings to compensate parasitics, which can be due to USB receptacle, routing, and ESD protection component. Signed-off-by: Amelie Delaunay Signed-off-by: Fabrice Gasnier Signed-off-by: Alexandre Torgue commit a2368f89660728284b749cc14537d7628e3fc318 Author: Erwan Le Ray Date: Wed Oct 20 17:02:30 2021 +0200 ARM: dts: stm32: clean uart4_idle_pins_a node for stm32mp15 Clean useless spaces in uart4_idle_pins_a node. Signed-off-by: Erwan Le Ray Signed-off-by: Alexandre Torgue commit 958b18a404152a982b511bc251768ca969a87630 Author: Erwan Le Ray Date: Wed Oct 20 17:03:11 2021 +0200 ARM: dts: stm32: add pull-up to USART3 and UART7 RX pins on STM32MP15 DKx boards Add pull-up to USART3 and UART7 RX pins to allow loop tests between USART3 and UART7 on stm32mp15 DKx boards. Signed-off-by: Erwan Le Ray Signed-off-by: Alexandre Torgue commit b046049e59dca5e5830dc75ed16acf7657a95161 Author: Dillon Min Date: Sat Jul 24 11:44:02 2021 +0800 ARM: dts: stm32: fix dtbs_check warning on ili9341 dts binding on stm32f429 disco Since the compatible string defined from ilitek,ili9341.yaml is "st,sf-tc240t-9370-t", "ilitek,ili9341" so, append "ilitek,ili9341" to avoid the below dtbs_check warning. arch/arm/boot/dts/stm32f429-disco.dt.yaml: display@1: compatible: ['st,sf-tc240t-9370-t'] is too short Fixes: a726e2f000ec ("ARM: dts: stm32: enable ltdc binding with ili9341, gyro l3gd20 on stm32429-disco board") Signed-off-by: Dillon Min Reported-by: kernel test robot Reviewed-by: Linus Walleij Signed-off-by: Alexandre Torgue commit 5c2625c4a08cf9b19cd070c1b30c75c9e5317853 Author: Maarten Lankhorst Date: Thu Oct 21 12:35:40 2021 +0200 drm/i915: Remove dma_resv_prune The signaled bit is already used for quick testing if a fence is signaled. On top of that, it's a terrible abuse of dma-fence api, and in the common case where the object is already locked by the caller, the trylock will fail. If it were useful, the core dma-api would have exposed the same functionality. The fact that i915 has a dma_resv_utils.c file should be a warning that the functionality either belongs in core, or is not very useful at all. In this case the latter. Signed-off-by: Maarten Lankhorst [mlankhorst: Improve commit message] Acked-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20211021103605.735002-3-maarten.lankhorst@linux.intel.com Reviewed-by: Matthew Auld #irc commit 3e2b6fdbdc9ab5a02d9d5676a005f30780b97553 Author: Vivek Goyal Date: Thu Nov 11 09:32:49 2021 -0500 fuse: send security context of inode on file When a new inode is created, send its security context to server along with creation request (FUSE_CREAT, FUSE_MKNOD, FUSE_MKDIR and FUSE_SYMLINK). This gives server an opportunity to create new file and set security context (possibly atomically). In all the configurations it might not be possible to set context atomically. Like nfs and ceph, use security_dentry_init_security() to dermine security context of inode and send it with create, mkdir, mknod, and symlink requests. Following is the information sent to server. fuse_sectx_header, fuse_secctx, xattr_name, security_context - struct fuse_secctx_header This contains total number of security contexts being sent and total size of all the security contexts (including size of fuse_secctx_header). - struct fuse_secctx This contains size of security context which follows this structure. There is one fuse_secctx instance per security context. - xattr name string This string represents name of xattr which should be used while setting security context. - security context This is the actual security context whose size is specified in fuse_secctx struct. Also add the FUSE_SECURITY_CTX flag for the `flags` field of the fuse_init_out struct. When this flag is set the kernel will append the security context for a newly created inode to the request (create, mkdir, mknod, and symlink). The server is responsible for ensuring that the inode appears atomically (preferrably) with the requested security context. For example, If the server is using SELinux and backed by a "real" linux file system that supports extended attributes it can write the security context value to /proc/thread-self/attr/fscreate before making the syscall to create the inode. This patch is based on patch from Chirantan Ekbote Signed-off-by: Vivek Goyal Signed-off-by: Miklos Szeredi commit 53db28933e952a8536b002ba8b8c9443ccc0e939 Author: Miklos Szeredi Date: Thu Nov 25 14:05:18 2021 +0100 fuse: extend init flags FUSE_INIT flags are close to running out, so add another 32bits worth of space. Add FUSE_INIT_EXT flag to the old flags field in fuse_init_in. If this flag is set, then fuse_init_in is extended by 48bytes, in which a flags_hi field is allocated to contain the high 32bits of the flags. A flags_hi field is also added to fuse_init_out, allocated out of the remaining unused fields. Known userspace implementations of the fuse protocol have been checked to accept the extended FUSE_INIT request, but this might cause problems with other implementations. If that happens to be the case, the protocol negotiation will have to be extended with an extra initialization request roundtrip. Signed-off-by: Miklos Szeredi commit 16d69a891970a8f97f0aac4e7ed0ccbf167a936b Merge: 5652df829b3c2 c18c8891111bb Author: Tvrtko Ursulin Date: Thu Nov 25 12:47:45 2021 +0000 Merge drm/drm-next into drm-intel-gt-next Maarten requested a backmerge due his work depending on subtle semantic changes introduced by: 7e2e69ed4678 ("drm/i915: Fix i915_request fence wait semantics") 2cbb8d4d6770 ("drm/i915: use new iterator in i915_gem_object_wait_reservation") Both should probably have been merged to drm-intel-gt-next anyway. Signed-off-by: Tvrtko Ursulin Acked-by: Daniel Vetter commit e10a6bb5f52de70c7798b720d16632d4042d2552 Author: Kamal Dasu Date: Wed Nov 24 14:33:53 2021 -0500 spi: bcm-qspi: set transfer parameter only if they change Check if the transfer parameters have changed from previous settings before applying new parameters. Signed-off-by: Kamal Dasu Link: https://lore.kernel.org/r/20211124193353.32311-3-kdasu.kdev@gmail.com Signed-off-by: Mark Brown commit c74526f947ab946273939757c72499c0a5b09826 Author: Kamal Dasu Date: Wed Nov 24 14:33:52 2021 -0500 spi: bcm-qspi: choose sysclk setting based on requested speed Check requested speed for a given transfer before setting 27MHz or 108Mhz sysclk on SoCs that support both. This way for baud rates below 212Khz we can use 27Mhz clock. Signed-off-by: Kamal Dasu Link: https://lore.kernel.org/r/20211124193353.32311-2-kdasu.kdev@gmail.com Signed-off-by: Mark Brown commit 2b9c8d2b3c89708d53b6124dc49c212dc5341840 Author: Oder Chiou Date: Thu Nov 25 13:58:12 2021 +0800 ASoC: rt5640: Add the HDA header support The patch adds the HDA header support. Signed-off-by: Oder Chiou Link: https://lore.kernel.org/r/20211125055812.8911-2-oder_chiou@realtek.com Signed-off-by: Mark Brown commit 083a7fba38885a8ffa03a2857e383421cefd36e6 Author: Oder Chiou Date: Thu Nov 25 13:58:11 2021 +0800 ASoC: rt5640: Add the binding include file for the HDA header support The patch adds the binding include file for the HDA header support. Signed-off-by: Oder Chiou Link: https://lore.kernel.org/r/20211125055812.8911-1-oder_chiou@realtek.com Signed-off-by: Mark Brown commit 2039cc1da4bee1fd0df644e26b28ed769cd32a81 Author: Lukas Bulwahn Date: Thu Nov 25 10:51:58 2021 +0100 ASoC: codecs: wcd938x: add SND_SOC_WCD938_SDW to codec list instead Commit 045442228868 ("ASoC: codecs: wcd938x: add audio routing and Kconfig") adds SND_SOC_WCD937X, which does not exist, and SND_SOC_WCD938X, which seems not really to be the intended config to be selected, but only a supporting config symbol to the actual config SND_SOC_WCD938X_SDW for the codec. Add SND_SOC_WCD938_SDW to the list instead of SND_SOC_WCD93{7,8}X. The issue was identified with ./scripts/checkkconfigsymbols.py. Fixes: 045442228868 ("ASoC: codecs: wcd938x: add audio routing and Kconfig") Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20211125095158.8394-3-lukas.bulwahn@gmail.com Signed-off-by: Mark Brown commit 49f893253ab43566e34332a969324531fea463f6 Author: Lukas Bulwahn Date: Thu Nov 25 10:51:57 2021 +0100 ASoC: uniphier: drop selecting non-existing SND_SOC_UNIPHIER_AIO_DMA Commit f37fe2f9987b ("ASoC: uniphier: add support for UniPhier AIO common driver") adds configs SND_SOC_UNIPHIER_{LD11,PXS2}, which select the non-existing config SND_SOC_UNIPHIER_AIO_DMA. Hence, ./scripts/checkkconfigsymbols.py warns: SND_SOC_UNIPHIER_AIO_DMA Referencing files: sound/soc/uniphier/Kconfig Probably, there is actually no further config intended to be selected here. So, just drop selecting the non-existing config. Fixes: f37fe2f9987b ("ASoC: uniphier: add support for UniPhier AIO common driver") Signed-off-by: Lukas Bulwahn Link: https://lore.kernel.org/r/20211125095158.8394-2-lukas.bulwahn@gmail.com Signed-off-by: Mark Brown commit fc6c62cf1cbf24c81ccb1d248120311336d5f3cc Author: Yang Yingliang Date: Thu Nov 25 15:16:08 2021 +0800 ASoC: SOF: mediatek: Add missing of_node_put() in platform_parse_resource() The node pointer is returned by of_parse_phandle() with refcount incremented in platform_parse_resource(). Calling of_node_put() to aovid the refcount leak. Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20211125071608.3056715-1-yangyingliang@huawei.com Signed-off-by: Mark Brown commit faf695517c1c77bb4a4b46d54007a283962eb00e Author: Jiaxin Yu Date: Thu Nov 25 12:24:22 2021 +0800 ASoC: mediatek: remove unnecessary CONFIG_PM The unnecessary conditional inclusion caused the following warning. Such as: >> sound/soc/mediatek/mt8192/mt8192-afe-pcm.c:2368:32: warning: unused >> variable 'mt8192_afe_pm_ops' [-Wunused-const-variable] static const struct dev_pm_ops mt8192_afe_pm_ops = { Because runtime_pm already handles the case without CONFIG_PM, we can remove CONFIG_PM condition. Signed-off-by: Jiaxin Yu Reported-by: kernel test robot Acked-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20211125042422.2349-1-jiaxin.yu@mediatek.com Signed-off-by: Mark Brown commit 11632d4aa2b3f126790e81a4415d6c23103cf8bb Author: Martyn Welch Date: Thu Nov 25 10:53:02 2021 +0000 drm/bridge: megachips: Ensure both bridges are probed before registration In the configuration used by the b850v3, the STDP2690 is used to read EDID data whilst it's the STDP4028 which can detect when monitors are connected. This can result in problems at boot with monitors connected when the STDP4028 is probed first, a monitor is detected and an attempt is made to read the EDID data before the STDP2690 has probed: [ 3.795721] Unable to handle kernel NULL pointer dereference at virtual address 00000018 [ 3.803845] pgd = (ptrval) [ 3.806581] [00000018] *pgd=00000000 [ 3.810180] Internal error: Oops: 5 [#1] SMP ARM [ 3.814813] Modules linked in: [ 3.817879] CPU: 0 PID: 64 Comm: kworker/u4:1 Not tainted 5.15.0 #1 [ 3.824161] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree) [ 3.830705] Workqueue: events_unbound deferred_probe_work_func [ 3.836565] PC is at stdp2690_get_edid+0x44/0x19c [ 3.841286] LR is at ge_b850v3_lvds_get_modes+0x2c/0x5c [ 3.846526] pc : [<805eae10>] lr : [<805eb138>] psr: 80000013 [ 3.852802] sp : 81c359d0 ip : 7dbb550b fp : 81c35a1c [ 3.858037] r10: 81c73840 r9 : 81c73894 r8 : 816d9800 [ 3.863270] r7 : 00000000 r6 : 81c34000 r5 : 00000000 r4 : 810c35f0 [ 3.869808] r3 : 80e3e294 r2 : 00000080 r1 : 00000cc0 r0 : 81401180 [ 3.876349] Flags: Nzcv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none [ 3.883499] Control: 10c5387d Table: 1000404a DAC: 00000051 [ 3.889254] Register r0 information: slab kmem_cache start 81401180 pointer offset 0 [ 3.897034] Register r1 information: non-paged memory [ 3.902097] Register r2 information: non-paged memory [ 3.907160] Register r3 information: non-slab/vmalloc memory [ 3.912832] Register r4 information: non-slab/vmalloc memory [ 3.918503] Register r5 information: NULL pointer [ 3.923217] Register r6 information: non-slab/vmalloc memory [ 3.928887] Register r7 information: NULL pointer [ 3.933601] Register r8 information: slab kmalloc-1k start 816d9800 pointer offset 0 size 1024 [ 3.942244] Register r9 information: slab kmalloc-2k start 81c73800 pointer offset 148 size 2048 [ 3.951058] Register r10 information: slab kmalloc-2k start 81c73800 pointer offset 64 size 2048 [ 3.959873] Register r11 information: non-slab/vmalloc memory [ 3.965632] Register r12 information: non-paged memory [ 3.970781] Process kworker/u4:1 (pid: 64, stack limit = 0x(ptrval)) [ 3.977148] Stack: (0x81c359d0 to 0x81c36000) [ 3.981517] 59c0: 80b2b668 80b2b5bc 000002e2 0000034e [ 3.989712] 59e0: 81c35a8c 816d98e8 81c35a14 7dbb550b 805bfcd0 810c35f0 81c73840 824addc0 [ 3.997906] 5a00: 00001000 816d9800 81c73894 81c73840 81c35a34 81c35a20 805eb138 805eadd8 [ 4.006099] 5a20: 810c35f0 00000045 81c35adc 81c35a38 80594188 805eb118 80d7c788 80dd1848 [ 4.014292] 5a40: 00000000 81c35a50 80dca950 811194d3 80dca7c4 80dca944 80dca91c 816d9800 [ 4.022485] 5a60: 81c34000 81c760a8 816d9800 80c58c98 810c35f0 816d98e8 00001000 00001000 [ 4.030678] 5a80: 00000000 00000000 8017712c 81c60000 00000002 00000001 00000000 00000000 [ 4.038870] 5aa0: 816d9900 816d9900 00000000 7dbb550b 805c700c 00000008 826282c8 826282c8 [ 4.047062] 5ac0: 00001000 81e1ce40 00001000 00000002 81c35bf4 81c35ae0 805d9694 80593fc0 [ 4.055255] 5ae0: 8017a970 80179ad8 00000179 00000000 81c35bcc 81c35b00 80177108 8017a950 [ 4.063447] 5b00: 00000000 81c35b10 81c34000 00000000 81004fd8 81010a38 00000000 00000059 [ 4.071639] 5b20: 816d98d4 81fbb718 00000013 826282c8 8017a940 81c35b40 81134448 00000400 [ 4.079831] 5b40: 00000178 00000000 e063b9c1 00000000 c2000049 00000040 00000000 00000008 [ 4.088024] 5b60: 82628300 82628380 00000000 00000000 81c34000 00000000 81fbb700 82628340 [ 4.096216] 5b80: 826283c0 00001000 00000000 00000010 816d9800 826282c0 801766f8 00000000 [ 4.104408] 5ba0: 00000000 81004fd8 00000049 00000000 00000000 00000001 80dcf940 80178de4 [ 4.112601] 5bc0: 81c35c0c 7dbb550b 80178de4 81fbb700 00000010 00000010 810c35f4 81e1ce40 [ 4.120793] 5be0: 81c40908 0000000c 81c35c64 81c35bf8 805a7f18 805d94a0 81c35c3c 816d9800 [ 4.128985] 5c00: 00000010 81c34000 81c35c2c 81c35c18 8012fce0 805be90c 81c35c3c 81c35c28 [ 4.137178] 5c20: 805be90c 80173210 81fbb600 81fbb6b4 81c35c5c 7dbb550b 81c35c64 81fbb700 [ 4.145370] 5c40: 816d9800 00000010 810c35f4 81e1ce40 81c40908 0000000c 81c35c84 81c35c68 [ 4.153565] 5c60: 805a8c78 805a7ed0 816d9800 81fbb700 00000010 00000000 81c35cac 81c35c88 [ 4.161758] 5c80: 805a8dc4 805a8b68 816d9800 00000000 816d9800 00000000 8179f810 810c42d0 [ 4.169950] 5ca0: 81c35ccc 81c35cb0 805e47b0 805a8d18 824aa240 81e1ea80 81c40908 81126b60 [ 4.178144] 5cc0: 81c35d14 81c35cd0 8060db1c 805e46cc 81c35d14 81c35ce0 80dd90f8 810c4d58 [ 4.186338] 5ce0: 80dd90dc 81fe9740 fffffffe 81fe9740 81e1ea80 00000000 810c4d6c 80c4b95c [ 4.194531] 5d00: 80dd9a3c 815c6810 81c35d34 81c35d18 8060dc9c 8060d8fc 8246b440 815c6800 [ 4.202724] 5d20: 815c6810 eefd8e00 81c35d44 81c35d38 8060dd80 8060dbec 81c35d6c 81c35d48 [ 4.210918] 5d40: 805e98a4 8060dd70 00000000 815c6810 810c45b0 81126e90 81126e90 80dd9a3c [ 4.219112] 5d60: 81c35d8c 81c35d70 80619574 805e9808 815c6810 00000000 810c45b0 81126e90 [ 4.227305] 5d80: 81c35db4 81c35d90 806168dc 80619514 80625df0 80623c80 815c6810 810c45b0 [ 4.235498] 5da0: 81c35e6c 815c6810 81c35dec 81c35db8 80616d04 80616800 81c35de4 81c35dc8 [ 4.243691] 5dc0: 808382b0 80b2f444 8116e310 8116e314 81c35e6c 815c6810 00000003 80dd9a3c [ 4.251884] 5de0: 81c35e14 81c35df0 80616ec8 80616c60 00000001 810c45b0 81c35e6c 815c6810 [ 4.260076] 5e00: 00000001 80dd9a3c 81c35e34 81c35e18 80617338 80616e90 00000000 81c35e6c [ 4.268269] 5e20: 80617284 81c34000 81c35e64 81c35e38 80614730 80617290 81c35e64 8171a06c [ 4.276461] 5e40: 81e220b8 7dbb550b 815c6810 81c34000 815c6854 81126e90 81c35e9c 81c35e68 [ 4.284654] 5e60: 8061673c 806146a8 8060f5e0 815c6810 00000001 7dbb550b 00000000 810c5080 [ 4.292847] 5e80: 810c5320 815c6810 81126e90 00000000 81c35eac 81c35ea0 80617554 80616650 [ 4.301040] 5ea0: 81c35ecc 81c35eb0 80615694 80617544 810c5080 810c5080 810c5094 81126e90 [ 4.309233] 5ec0: 81c35efc 81c35ed0 80615c6c 8061560c 80615bc0 810c50c0 817eeb00 81412800 [ 4.317425] 5ee0: 814c3000 00000000 814c300d 81119a60 81c35f3c 81c35f00 80141488 80615bcc [ 4.325618] 5f00: 81c60000 81c34000 81c35f24 81c35f18 80143078 817eeb00 81412800 817eeb18 [ 4.333811] 5f20: 81412818 81003d00 00000088 81412800 81c35f74 81c35f40 80141a48 80141298 [ 4.342005] 5f40: 81c35f74 81c34000 801481ac 817efa40 817efc00 801417d8 817eeb00 00000000 [ 4.350199] 5f60: 815a7e7c 81c34000 81c35fac 81c35f78 80149b1c 801417e4 817efc20 817efc20 [ 4.358391] 5f80: ffffe000 817efa40 801499a8 00000000 00000000 00000000 00000000 00000000 [ 4.366583] 5fa0: 00000000 81c35fb0 80100130 801499b4 00000000 00000000 00000000 00000000 [ 4.374774] 5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 4.382966] 5fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000 [ 4.391155] Backtrace: [ 4.393613] [<805eadcc>] (stdp2690_get_edid) from [<805eb138>] (ge_b850v3_lvds_get_modes+0x2c/0x5c) [ 4.402691] r10:81c73840 r9:81c73894 r8:816d9800 r7:00001000 r6:824addc0 r5:81c73840 [ 4.410534] r4:810c35f0 [ 4.413073] [<805eb10c>] (ge_b850v3_lvds_get_modes) from [<80594188>] (drm_helper_probe_single_connector_modes+0x1d4/0x84c) [ 4.424240] r5:00000045 r4:810c35f0 [ 4.427822] [<80593fb4>] (drm_helper_probe_single_connector_modes) from [<805d9694>] (drm_client_modeset_probe+0x200/0x1384) [ 4.439074] r10:00000002 r9:00001000 r8:81e1ce40 r7:00001000 r6:826282c8 r5:826282c8 [ 4.446917] r4:00000008 [ 4.449455] [<805d9494>] (drm_client_modeset_probe) from [<805a7f18>] (__drm_fb_helper_initial_config_and_unlock+0x54/0x5b4) [ 4.460713] r10:0000000c r9:81c40908 r8:81e1ce40 r7:810c35f4 r6:00000010 r5:00000010 [ 4.468556] r4:81fbb700 [ 4.471095] [<805a7ec4>] (__drm_fb_helper_initial_config_and_unlock) from [<805a8c78>] (drm_fbdev_client_hotplug+0x11c/0x1b0) [ 4.482434] r10:0000000c r9:81c40908 r8:81e1ce40 r7:810c35f4 r6:00000010 r5:816d9800 [ 4.490276] r4:81fbb700 [ 4.492814] [<805a8b5c>] (drm_fbdev_client_hotplug) from [<805a8dc4>] (drm_fbdev_generic_setup+0xb8/0x1a4) [ 4.502494] r7:00000000 r6:00000010 r5:81fbb700 r4:816d9800 [ 4.508160] [<805a8d0c>] (drm_fbdev_generic_setup) from [<805e47b0>] (imx_drm_bind+0xf0/0x130) [ 4.516805] r7:810c42d0 r6:8179f810 r5:00000000 r4:816d9800 [ 4.522474] [<805e46c0>] (imx_drm_bind) from [<8060db1c>] (try_to_bring_up_master+0x22c/0x2f0) [ 4.531116] r7:81126b60 r6:81c40908 r5:81e1ea80 r4:824aa240 [ 4.536783] [<8060d8f0>] (try_to_bring_up_master) from [<8060dc9c>] (__component_add+0xbc/0x184) [ 4.545597] r10:815c6810 r9:80dd9a3c r8:80c4b95c r7:810c4d6c r6:00000000 r5:81e1ea80 [ 4.553440] r4:81fe9740 [ 4.555980] [<8060dbe0>] (__component_add) from [<8060dd80>] (component_add+0x1c/0x20) [ 4.563921] r7:eefd8e00 r6:815c6810 r5:815c6800 r4:8246b440 [ 4.569589] [<8060dd64>] (component_add) from [<805e98a4>] (dw_hdmi_imx_probe+0xa8/0xe8) [ 4.577702] [<805e97fc>] (dw_hdmi_imx_probe) from [<80619574>] (platform_probe+0x6c/0xc8) [ 4.585908] r9:80dd9a3c r8:81126e90 r7:81126e90 r6:810c45b0 r5:815c6810 r4:00000000 [ 4.593662] [<80619508>] (platform_probe) from [<806168dc>] (really_probe+0xe8/0x460) [ 4.601524] r7:81126e90 r6:810c45b0 r5:00000000 r4:815c6810 [ 4.607191] [<806167f4>] (really_probe) from [<80616d04>] (__driver_probe_device+0xb0/0x230) [ 4.615658] r7:815c6810 r6:81c35e6c r5:810c45b0 r4:815c6810 [ 4.621326] [<80616c54>] (__driver_probe_device) from [<80616ec8>] (driver_probe_device+0x44/0xe0) [ 4.630313] r9:80dd9a3c r8:00000003 r7:815c6810 r6:81c35e6c r5:8116e314 r4:8116e310 [ 4.638068] [<80616e84>] (driver_probe_device) from [<80617338>] (__device_attach_driver+0xb4/0x12c) [ 4.647227] r9:80dd9a3c r8:00000001 r7:815c6810 r6:81c35e6c r5:810c45b0 r4:00000001 [ 4.654981] [<80617284>] (__device_attach_driver) from [<80614730>] (bus_for_each_drv+0x94/0xd8) [ 4.663794] r7:81c34000 r6:80617284 r5:81c35e6c r4:00000000 [ 4.669461] [<8061469c>] (bus_for_each_drv) from [<8061673c>] (__device_attach+0xf8/0x190) [ 4.677753] r7:81126e90 r6:815c6854 r5:81c34000 r4:815c6810 [ 4.683419] [<80616644>] (__device_attach) from [<80617554>] (device_initial_probe+0x1c/0x20) [ 4.691971] r8:00000000 r7:81126e90 r6:815c6810 r5:810c5320 r4:810c5080 [ 4.698681] [<80617538>] (device_initial_probe) from [<80615694>] (bus_probe_device+0x94/0x9c) [ 4.707318] [<80615600>] (bus_probe_device) from [<80615c6c>] (deferred_probe_work_func+0xac/0xf0) [ 4.716305] r7:81126e90 r6:810c5094 r5:810c5080 r4:810c5080 [ 4.721973] [<80615bc0>] (deferred_probe_work_func) from [<80141488>] (process_one_work+0x1fc/0x54c) [ 4.731139] r10:81119a60 r9:814c300d r8:00000000 r7:814c3000 r6:81412800 r5:817eeb00 [ 4.738981] r4:810c50c0 r3:80615bc0 [ 4.742563] [<8014128c>] (process_one_work) from [<80141a48>] (worker_thread+0x270/0x570) [ 4.750765] r10:81412800 r9:00000088 r8:81003d00 r7:81412818 r6:817eeb18 r5:81412800 [ 4.758608] r4:817eeb00 [ 4.761147] [<801417d8>] (worker_thread) from [<80149b1c>] (kthread+0x174/0x190) [ 4.768574] r10:81c34000 r9:815a7e7c r8:00000000 r7:817eeb00 r6:801417d8 r5:817efc00 [ 4.776417] r4:817efa40 [ 4.778955] [<801499a8>] (kthread) from [<80100130>] (ret_from_fork+0x14/0x24) [ 4.786201] Exception stack(0x81c35fb0 to 0x81c35ff8) [ 4.791266] 5fa0: 00000000 00000000 00000000 00000000 [ 4.799459] 5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 4.807651] 5fe0: 00000000 00000000 00000000 00000000 00000013 00000000 [ 4.814279] r10:00000000 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:801499a8 [ 4.822120] r4:817efa40 [ 4.824664] Code: e3a02080 e593001c e3a01d33 e3a05000 (e5979018) Split the registration from the STDP4028 probe routine and only perform registration once both the STDP4028 and STDP2690 have probed. Signed-off-by: Martyn Welch CC: Peter Senna Tschudin CC: Martyn Welch CC: Neil Armstrong CC: Robert Foss CC: Laurent Pinchart CC: Jonas Karlman CC: Jernej Skrabec Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/43552c3404e8fdf92d8bc5658fac24e9f03c2c57.1637836606.git.martyn.welch@collabora.com commit 3d030e301856da366380b3865fce6c03037b08a6 Author: Nicholas Piggin Date: Thu Nov 25 20:33:46 2021 +1000 powerpc/watchdog: Fix wd_smp_last_reset_tb reporting wd_smp_last_reset_tb now gets reset by watchdog_smp_panic() as part of marking CPUs stuck and removing them from the pending mask before it begins any printing. This causes last reset times reported to be off. Fix this by reading it into a local variable before it gets reset. Fixes: 76521c4b0291 ("powerpc/watchdog: Avoid holding wd_smp_lock over printk and smp_send_nmi_ipi") Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211125103346.1188958-1-npiggin@gmail.com commit 83ddd8069f98886ce1da2b506602220fb0e4a912 Author: Dan Carpenter Date: Wed Nov 24 17:52:19 2021 +0300 drm/bridge: anx7625: fix an error code in anx7625_register_audio() This code accidentally returns IS_ERR(), which is 1, instead of propagating the negative error code. The caller doesn't check for errors so it doesn't affect run time at all. Fixes: 566fef1226c1 ("drm/bridge: anx7625: add HDMI audio function") Signed-off-by: Dan Carpenter Reviewed-by: Tzung-Bi Shih Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20211124145219.GD13656@kili commit 5652df829b3c2cee92bd0903a0e70455868fa1a5 Author: Thomas Hellström Date: Mon Nov 22 22:45:54 2021 +0100 drm/i915/ttm: Update i915_gem_obj_copy_ttm() to be asynchronous Update the copy function i915_gem_obj_copy_ttm() to be asynchronous for future users and update the only current user to sync the objects as needed after this function. Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20211122214554.371864-7-thomas.hellstrom@linux.intel.com commit 6385eb7ad841bf938427f4fb4e7880ed385744bd Author: Thomas Hellström Date: Mon Nov 22 22:45:53 2021 +0100 drm/i915/ttm: Implement asynchronous TTM moves Don't wait sync while migrating, but rather make the GPU blit await the dependencies and add a moving fence to the object. This also enables asynchronous VRAM management in that on eviction, rather than waiting for the moving fence to expire before freeing VRAM, it is freed immediately and the fence is stored with the VRAM manager and handed out to newly allocated objects to await before clears and swapins, or for kernel objects before setting up gpu vmas or mapping. To collect dependencies before migrating, add a set of utilities that coalesce these to a single dma_fence. What is still missing for fully asynchronous operation is asynchronous vma unbinding, which is still to be implemented. This commit substantially reduces execution time in the gem_lmem_swapping test. v2: - Make a couple of functions static. v4: - Fix some style issues (Matthew Auld) - Audit and add more checks for ghost objects (Matthew Auld) - Add more documentation for the i915_deps utility (Mattew Auld) - Simplify the i915_deps_sync() function v6: - Re-check for fence signaled before returning -EBUSY (Matthew Auld) - Use dma_resv_iter_is_exclusive() (Matthew Auld) - Await all dma-resv fences before a migration blit (Matthew Auld) Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20211122214554.371864-6-thomas.hellstrom@linux.intel.com commit 004746e4b119a206c27c6ea0f4b6287bab16a9ad Author: Thomas Hellström Date: Mon Nov 22 22:45:52 2021 +0100 drm/i915/ttm: Correctly handle waiting for gpu when shrinking With async migration, the shrinker may end up wanting to release the pages of an object while the migration blit is still running, since the GT migration code doesn't set up VMAs and the shrinker is thus oblivious to the fact that the GPU is still using the pages. Add waiting for gpu in the shrinker_release_pages() op and an argument to that function indicating whether the shrinker expects it to not wait for gpu. In the latter case the shrinker_release_pages() op will return -EBUSY if the object is not idle. Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20211122214554.371864-5-thomas.hellstrom@linux.intel.com commit 8b1f7f92e57d7eff7a3503763dd2c8e0357c36ff Author: Thomas Hellström Date: Mon Nov 22 22:45:51 2021 +0100 drm/i915/ttm: Drop region reference counting There is an interesting refcounting loop: struct intel_memory_region has a struct ttm_resource_manager, ttm_resource_manager->move may hold a reference to i915_request, i915_request may hold a reference to intel_context, intel_context may hold a reference to drm_i915_gem_object, drm_i915_gem_object may hold a reference to intel_memory_region. Break this loop by dropping region reference counting. In addition, Have regions with a manager moving fence make sure that all region objects are released before freeing the region. v6: - Fix a code comment. Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20211122214554.371864-4-thomas.hellstrom@linux.intel.com commit 05d1c76107e33346fdc18fed95f28c9edde8a760 Author: Thomas Hellström Date: Mon Nov 22 22:45:50 2021 +0100 drm/i915/ttm: Move the i915_gem_obj_copy_ttm() function Move the i915_gem_obj_copy_ttm() function to i915_gem_ttm_move.h. This will help keep a number of functions static when introducing async moves. Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20211122214554.371864-3-thomas.hellstrom@linux.intel.com commit f6c466b84cfa78807b7f71b8adeaf209b4deb72f Author: Maarten Lankhorst Date: Mon Nov 22 22:45:49 2021 +0100 drm/i915: Add support for moving fence waiting For now, we will only allow async migration when TTM is used, so the paths we care about are related to TTM. The mmap path is handled by having the fence in ttm_bo->moving, when pinning, the binding only becomes available after the moving fence is signaled, and pinning a cpu map will only work after the moving fence signals. This should close all holes where userspace can read a buffer before it's fully migrated. v2: - Fix a couple of SPARSE warnings v3: - Fix a NULL pointer dereference v4: - Ditch the moving fence waiting for i915_vma_pin_iomap() and replace with a verification that the vma is already bound. (Matthew Auld) - Squash with a previous patch introducing moving fence waiting and accessing interfaces (Matthew Auld) - Rename to indicated that we also add support for sync waiting. v5: - Fix check for NULL and unreferencing i915_vma_verify_bind_complete() (Matthew Auld) - Fix compilation failure if !CONFIG_DRM_I915_DEBUG_GEM - Fix include ordering. (Matthew Auld) v7: - Fix yet another compilation failure with clang if !CONFIG_DRM_I915_DEBUG_GEM Co-developed-by: Thomas Hellström Signed-off-by: Thomas Hellström Signed-off-by: Maarten Lankhorst Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20211122214554.371864-2-thomas.hellstrom@linux.intel.com commit 3ed6dfbd3bb987b3d2de86304ae45972ebff5870 Author: Vladimir Zapolskiy Date: Thu Nov 11 17:48:08 2021 +0200 cpufreq: qcom-hw: Set CPU affinity of dcvsh interrupts In runtime CPU cluster specific dcvsh interrupts may be handled on unrelated CPU cores, it leads to an issue of too excessive number of received and handled interrupts, but this is not observed, if CPU affinity of the interrupt handler is set in accordance to CPU clusters. The change reduces a number of received interrupts in about 10-100 times. Signed-off-by: Vladimir Zapolskiy Reviewed-by: Matthias Kaehlcke Signed-off-by: Viresh Kumar commit e0e27c3d4e20dab861566f1c348ae44e4b498630 Author: Vladimir Zapolskiy Date: Thu Nov 11 17:48:07 2021 +0200 cpufreq: qcom-hw: Fix probable nested interrupt handling Re-enabling an interrupt from its own interrupt handler may cause an interrupt storm, if there is a pending interrupt and because its handling is disabled due to already done entrance into the handler above in the stack. Also, apparently it is improper to lock a mutex in an interrupt contex. Fixes: 275157b367f4 ("cpufreq: qcom-cpufreq-hw: Add dcvs interrupt support") Signed-off-by: Vladimir Zapolskiy Reviewed-by: Matthias Kaehlcke Reviewed-by: Bjorn Andersson Signed-off-by: Viresh Kumar commit be6592ed56a7cca8a001ff339cb9325bfa3c6e3f Author: Ard Biesheuvel Date: Thu Nov 11 17:48:06 2021 +0200 cpufreq: qcom-cpufreq-hw: Avoid stack buffer for IRQ name Registering an IRQ requires the string buffer containing the name to remain allocated, as the name is not copied into another buffer. So let's add a irq_name field to the data struct instead, which is guaranteed to have the appropriate lifetime. Cc: Thara Gopinath Cc: Bjorn Andersson Cc: Andy Gross Signed-off-by: Ard Biesheuvel Reviewed-by: Thara Gopinath Tested-by: Steev Klimaszewski Signed-off-by: Vladimir Zapolskiy Reviewed-by: Matthias Kaehlcke Reviewed-by: Bjorn Andersson Signed-off-by: Viresh Kumar commit 7eafa6eed7f1c6d0d7ed2f90792ab6bce462a750 Author: Jason Wang Date: Sun Nov 14 14:08:56 2021 +0800 dmaengine: ppc4xx: remove unused variable `rval' The variable used for returning status in `ppc440spe_adma_dma2rxor_prep_src' function is never changed and this function just need to return 0. Thus, the `rval' can be removed and return 0 from `ppc440spe_adma_dma2rxor_prep_src'. Signed-off-by: Jason Wang Link: https://lore.kernel.org/r/20211114060856.239314-1-wangborong@cdjrlc.com Signed-off-by: Vinod Koul commit 97ba12d3feca68dd240ba49c9559d9a3e13cf0cd Author: Rafał Miłecki Date: Tue Nov 23 23:15:21 2021 +0100 phy: bcm-ns-usb2: improve printing ref clk errors Improve message & use dev_err_probe() helper which prints actual error (helpful for debugging) and deals with -EPROBE_DEFER. Signed-off-by: Rafał Miłecki Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20211123221521.25323-1-zajec5@gmail.com Signed-off-by: Vinod Koul commit 83762cb5c7c464af4cbaba5679af31c7fe534979 Author: Dan Williams Date: Mon Nov 15 13:20:57 2021 -0800 dax: Kill DEV_DAX_PMEM_COMPAT The /sys/class/dax compatibility option has shipped in the kernel for 4 years now which should be sufficient time for tools to abandon the old ABI in favor of the /sys/bus/dax device-model. Delete it now and see if anyone screams. Since this compatibility option shipped there has been more reports of users being surprised by the compat ABI than surprised by the "new", so the compat infrastructure has outlived its usefulness. Recall that /sys/bus/dax device-model is required for the dax kmem driver which allows PMEM to be used as "System RAM". The following projects were known to have a dependency on /sys/class/dax and have dropped their dependency as of the listed version: - ndctl (including libndctl, daxctl, and libdaxctl): v64+ - fio: v3.13+ - pmdk: v1.5.2+ As further evidence this option is no longer needed some distributions have already stopped enabling CONFIG_DEV_DAX_PMEM_COMPAT. Cc: Ira Weiny Cc: Dave Jiang Reported-by: Vishal Verma Acked-by: Dave Hansen Reviewed-by: Jane Chu Link: https://lore.kernel.org/r/163701116195.3784476.726128179293466337.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit 305e95bb893cc50f7c59edf2b47d95effe73498a Author: Maciej Żenczykowski Date: Tue Nov 23 14:32:08 2021 -0800 net-ipv6: changes to ->tclass (via IPV6_TCLASS) should sk_dst_reset() This is to match ipv4 behaviour, see __ip_sock_set_tos() implementation. Technically for ipv6 this might not be required because normally we do not allow tclass to influence routing, yet the cli tooling does support it: lpk11:~# ip -6 rule add pref 5 tos 45 lookup 5 lpk11:~# ip -6 rule 5: from all tos 0x45 lookup 5 and in general dscp/tclass based routing does make sense. We already have cases where dscp can affect vlan priority and/or transmit queue (especially on wifi). So let's just make things match. Easier to reason about and no harm. Cc: Eric Dumazet Cc: Neal Cardwell Signed-off-by: Maciej Żenczykowski Link: https://lore.kernel.org/r/20211123223208.1117871-1-zenczykowski@gmail.com Signed-off-by: Jakub Kicinski commit 9f7b3a69c88daabaacc6596c6409ff52e57d3067 Author: Maciej Żenczykowski Date: Tue Nov 23 14:31:54 2021 -0800 net-ipv6: do not allow IPV6_TCLASS to muck with tcp's ECN This is to match ipv4 behaviour, see __ip_sock_set_tos() implementation at ipv4/ip_sockglue.c:579 void __ip_sock_set_tos(struct sock *sk, int val) { if (sk->sk_type == SOCK_STREAM) { val &= ~INET_ECN_MASK; val |= inet_sk(sk)->tos & INET_ECN_MASK; } if (inet_sk(sk)->tos != val) { inet_sk(sk)->tos = val; sk->sk_priority = rt_tos2priority(val); sk_dst_reset(sk); } } Cc: Neal Cardwell Signed-off-by: Maciej Żenczykowski Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/20211123223154.1117794-1-zenczykowski@gmail.com Signed-off-by: Jakub Kicinski commit 079925cce1d06fe6614b1559b0020497b5b83d6a Author: Maciej Żenczykowski Date: Tue Nov 23 12:37:15 2021 -0800 net: allow SO_MARK with CAP_NET_RAW A CAP_NET_RAW capable process can already spoof (on transmit) anything it desires via raw packet sockets... There is no good reason to not allow it to also be able to play routing tricks on packets from its own normal sockets. There is a desire to be able to use SO_MARK for routing table selection (via ip rule fwmark) from within a user process without having to run it as root. Granting it CAP_NET_RAW is much less dangerous than CAP_NET_ADMIN (CAP_NET_RAW doesn't permit persistent state change, while CAP_NET_ADMIN does - by for example allowing the reconfiguration of the routing tables and/or bringing up/down devices). Let's keep CAP_NET_ADMIN for persistent state changes, while using CAP_NET_RAW for non-configuration related stuff. Signed-off-by: Maciej Żenczykowski Link: https://lore.kernel.org/r/20211123203715.193413-1-zenczykowski@gmail.com Signed-off-by: Jakub Kicinski commit a1b519b745489a54189e05ee934ada1b6bc595a3 Author: Maciej Żenczykowski Date: Tue Nov 23 12:37:02 2021 -0800 net: allow CAP_NET_RAW to setsockopt SO_PRIORITY CAP_NET_ADMIN is and should continue to be about configuring the system as a whole, not about configuring per-socket or per-packet parameters. Sending and receiving raw packets is what CAP_NET_RAW is all about. It can already send packets with any VLAN tag, and any IPv4 TOS mark, and any IPv6 TCLASS mark, simply by virtue of building such a raw packet. Not to mention using any protocol and source/ /destination ip address/port tuple. These are the fields that networking gear uses to prioritize packets. Hence, a CAP_NET_RAW process is already capable of affecting traffic prioritization after it hits the wire. This change makes it capable of affecting traffic prioritization even in the host at the nic and before that in the queueing disciplines (provided skb->priority is actually being used for prioritization, and not the TOS/TCLASS field) Hence it makes sense to allow a CAP_NET_RAW process to set the priority of sockets and thus packets it sends. Signed-off-by: Maciej Żenczykowski Link: https://lore.kernel.org/r/20211123203702.193221-1-zenczykowski@gmail.com Signed-off-by: Jakub Kicinski commit 0898ca67b86e14207d4feb3f3fea8b87cec5aab1 Author: Ansuel Smith Date: Tue Nov 23 16:44:46 2021 +0100 net: dsa: qca8k: fix warning in LAG feature Fix warning reported by bot. Make sure hash is init to 0 and fix wrong logic for hash_type in qca8k_lag_can_offload. Reported-by: kernel test robot Fixes: def975307c01 ("net: dsa: qca8k: add LAG support") Signed-off-by: Ansuel Smith Reviewed-by: Florian Fainelli Link: https://lore.kernel.org/r/20211123154446.31019-1-ansuelsmth@gmail.com Signed-off-by: Jakub Kicinski commit e670e1e86beb82a6eef0d9b451829a32cfa23c81 Author: Rahul Lakkireddy Date: Tue Nov 23 21:17:17 2021 +0530 cxgb4: allow reading unrecognized port module eeprom Even if firmware fails to recognize the plugged-in port module type, allow reading port module EEPROM anyway. This helps in obtaining necessary diagnostics information for debugging and analysis. Signed-off-by: Manoj Malviya Signed-off-by: Rahul Lakkireddy Link: https://lore.kernel.org/r/1637682437-31407-1-git-send-email-rahul.lakkireddy@chelsio.com Signed-off-by: Jakub Kicinski commit 5a45ab3f248b3489af8b8440eb56b2ebaae59a6c Author: Ido Schimmel Date: Wed Nov 24 12:11:22 2021 +0200 net: bridge: Allow base 16 inputs in sysfs Cited commit converted simple_strtoul() to kstrtoul() as suggested by the former's documentation. However, it also forced all the inputs to be decimal resulting in user space breakage. Fix by setting the base to '0' so that the base is automatically detected. Before: # ip link add name br0 type bridge vlan_filtering 1 # echo "0x88a8" > /sys/class/net/br0/bridge/vlan_protocol bash: echo: write error: Invalid argument After: # ip link add name br0 type bridge vlan_filtering 1 # echo "0x88a8" > /sys/class/net/br0/bridge/vlan_protocol # echo $? 0 Fixes: 520fbdf7fb19 ("net/bridge: replace simple_strtoul to kstrtol") Signed-off-by: Ido Schimmel Acked-by: Nikolay Aleksandrov Link: https://lore.kernel.org/r/20211124101122.3321496-1-idosch@idosch.org Signed-off-by: Jakub Kicinski commit 80690a85f54f8588740ba5defa9754df8fab53f3 Merge: 1aad9634b94ef 627b94f75b82d Author: Jakub Kicinski Date: Wed Nov 24 17:21:46 2021 -0800 Merge branch 'gro-remove-redundant-rcu_read_lock' Eric Dumazet says: ==================== gro: remove redundant rcu_read_lock Recent trees got an increase of rcu_read_{lock|unlock} costs, it is time to get rid of the not needed pairs. ==================== Link: https://lore.kernel.org/r/20211123225608.2155163-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit 627b94f75b82d13d1530b59155a545fd99d807db Author: Eric Dumazet Date: Tue Nov 23 14:56:08 2021 -0800 gro: remove rcu_read_lock/rcu_read_unlock from gro_complete handlers All gro_complete() handlers are called from napi_gro_complete() while rcu_read_lock() has been called. There is no point stacking more rcu_read_lock() Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit fc1ca3348a74a1afaa7ffebc2b2f2cc149e11278 Author: Eric Dumazet Date: Tue Nov 23 14:56:07 2021 -0800 gro: remove rcu_read_lock/rcu_read_unlock from gro_receive handlers All gro_receive() handlers are called from dev_gro_receive() while rcu_read_lock() has been called. There is no point stacking more rcu_read_lock() Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 1aad9634b94ef65d72110a6fc6625c890db9667c Author: Gerhard Engleder Date: Wed Nov 24 21:52:25 2021 +0100 tsnep: Fix resource_size cocci warning The following warning is fixed, by removing the unused resource size: drivers/net/ethernet/engleder/tsnep_main.c:1155:21-24: WARNING: Suspicious code. resource_size is maybe missing with io Reported-by: kernel test robot Reported-by: Abaci Robot Signed-off-by: Gerhard Engleder Link: https://lore.kernel.org/r/20211124205225.13985-1-gerhard@engleder-embedded.com Signed-off-by: Jakub Kicinski commit 6a9d66a05b9b2d59bfef3d114812138aa880a6c7 Author: Yang Li Date: Wed Nov 24 10:36:24 2021 +0800 tsnep: fix platform_no_drv_owner.cocci warning Remove .owner field if calls are used which set it automatically Eliminate the following coccicheck warning: ./drivers/net/ethernet/engleder/tsnep_main.c:1263:3-8: No need to set .owner here. The core will do it. Reported-by: Abaci Robot Signed-off-by: Yang Li Reviewed-by: Gerhard Engleder Link: https://lore.kernel.org/r/1637721384-70836-2-git-send-email-yang.lee@linux.alibaba.com Signed-off-by: Jakub Kicinski commit 4afc78eae10cd74c5a0b70822b9754d1d094c5d6 Author: Michael Ellerman Date: Thu Nov 18 11:44:15 2021 +1100 powerpc/microwatt: Make microwatt_get_random_darn() static Make microwatt_get_random_darn() static, because it can be. Reported-by: kernel test robot Signed-off-by: Michael Ellerman Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211118004415.1706863-1-mpe@ellerman.id.au commit 1f01bf90765fa5f88fbae452c131c1edf5cda7ba Author: Nicholas Piggin Date: Wed Nov 10 12:50:56 2021 +1000 powerpc/watchdog: read TB close to where it is used When taking watchdog actions, printing messages, comparing and re-setting wd_smp_last_reset_tb, etc., read TB close to the point of use and under wd_smp_lock or printing lock (if applicable). This should keep timebase mostly monotonic with kernel log messages, and could prevent (in theory) a laggy CPU updating wd_smp_last_reset_tb to something a long way in the past, and causing other CPUs to appear to be stuck. These additional TB reads are all slowpath (lockup has been detected), so performance does not matter. Signed-off-by: Nicholas Piggin Reviewed-by: Laurent Dufour Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211110025056.2084347-5-npiggin@gmail.com commit 76521c4b0291ad25723638ade5a0ff4d5f659771 Author: Nicholas Piggin Date: Wed Nov 10 12:50:55 2021 +1000 powerpc/watchdog: Avoid holding wd_smp_lock over printk and smp_send_nmi_ipi There is a deadlock with the console_owner lock and the wd_smp_lock: CPU x takes the console_owner lock CPU y takes a watchdog timer interrupt and takes __wd_smp_lock CPU x takes a soft-NMI interrupt, detects deadlock, spins on __wd_smp_lock CPU y detects deadlock, tries to print something and spins on console_owner -> deadlock Change the watchdog locking scheme so wd_smp_lock protects the watchdog internal data, but "reporting" (printing, issuing NMI IPIs, taking any action outside of watchdog) uses a non-waiting exclusion. If a CPU detects a problem but can not take the reporting lock, it just returns because something else is already reporting. It will try again at some point. Typically hard lockup watchdog report usefulness is not impacted due to failure to spewing a large enough amount of data in as short a time as possible, but by messages getting garbled. Laurent debugged this and found the deadlock, and this patch is based on his general approach to avoid expensive operations while holding the lock. With the addition of the reporting exclusion. Signed-off-by: Laurent Dufour [np: rework to add reporting exclusion update changelog] Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211110025056.2084347-4-npiggin@gmail.com commit 858c93c31504ac1507084493d7eafbe7e2302dc2 Author: Nicholas Piggin Date: Wed Nov 10 12:50:54 2021 +1000 powerpc/watchdog: tighten non-atomic read-modify-write access Most updates to wd_smp_cpus_pending are under lock except the watchdog interrupt bit clear. This can race with non-atomic RMW updates to the mask under lock, which can happen in two instances: Firstly, if another CPU detects this one is stuck, removes it from the mask, mask becomes empty and is re-filled with non-atomic stores. This is okay because it would re-fill the mask with this CPU's bit clear anyway (because this CPU is now stuck), so it doesn't matter that the bit clear update got "lost". Add a comment for this. Secondly, if another CPU detects a different CPU is stuck and removes it from the pending mask with a non-atomic store to bytes which also include the bit of this CPU. This case can result in the bit clear being lost and the end result being the bit is set. This should be so rare it hardly matters, but to make things simpler to reason about just avoid the non-atomic access for that case. Signed-off-by: Nicholas Piggin Reviewed-by: Laurent Dufour Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211110025056.2084347-3-npiggin@gmail.com commit 5dad4ba68a2483fc80d70b9dc90bbe16e1f27263 Author: Nicholas Piggin Date: Wed Nov 10 12:50:53 2021 +1000 powerpc/watchdog: Fix missed watchdog reset due to memory ordering race It is possible for all CPUs to miss the pending cpumask becoming clear, and then nobody resetting it, which will cause the lockup detector to stop working. It will eventually expire, but watchdog_smp_panic will avoid doing anything if the pending mask is clear and it will never be reset. Order the cpumask clear vs the subsequent test to close this race. Add an extra check for an empty pending mask when the watchdog fires and finds its bit still clear, to try to catch any other possible races or bugs here and keep the watchdog working. The extra test in arch_touch_nmi_watchdog is required to prevent the new warning from firing off. Signed-off-by: Nicholas Piggin Reviewed-by: Laurent Dufour Debugged-by: Laurent Dufour Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211110025056.2084347-2-npiggin@gmail.com commit 869fb7e5aecbc163003f93f36dcc26d0554319f6 Author: Peiwei Hu Date: Fri Nov 19 17:12:18 2021 +0800 powerpc/prom_init: Fix improper check of prom_getprop() prom_getprop() can return PROM_ERROR. Binary operator can not identify it. Fixes: 94d2dde738a5 ("[POWERPC] Efika: prune fixups and make them more carefull") Signed-off-by: Peiwei Hu Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/tencent_BA28CC6897B7C95A92EB8C580B5D18589105@qq.com commit dd5cde457a5eb77088d1d9eecface47c0563cd43 Author: Nathan Lynch Date: Wed Nov 17 00:02:59 2021 -0600 powerpc/rtas: rtas_busy_delay_time() kernel-doc Provide API documentation for rtas_busy_delay_time(), explaining why we return the same value for 9900 and -2. Signed-off-by: Nathan Lynch Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211117060259.957178-3-nathanl@linux.ibm.com commit 38f7b7067dae0c101be573106018e8af22a90fdf Author: Nathan Lynch Date: Wed Nov 17 00:02:58 2021 -0600 powerpc/rtas: rtas_busy_delay() improvements Generally RTAS cannot block, and in PAPR it is required to return control to the OS within a few tens of microseconds. In order to support operations which may take longer to complete, many RTAS primitives can return intermediate -2 ("busy") or 990x ("extended delay") values, which indicate that the OS should reattempt the same call with the same arguments at some point in the future. Current versions of PAPR are less than clear about this, but the intended meanings of these values in more detail are: RTAS_BUSY (-2): RTAS has suspended a potentially long-running operation in order to meet its latency obligation and give the OS the opportunity to perform other work. RTAS can resume making progress as soon as the OS reattempts the call. RTAS_EXTENDED_DELAY_{MIN...MAX} (9900-9905): RTAS must wait for an external event to occur or for internal contention to resolve before it can complete the requested operation. The value encodes a non-binding hint as to roughly how long the OS should wait before calling again, but the OS is allowed to reattempt the call sooner or even immediately. Linux of course must take its own CPU scheduling obligations into account when handling these statuses; e.g. a task which receives an RTAS_BUSY status should check whether to reschedule before it attempts the RTAS call again to avoid starving other tasks. rtas_busy_delay() is a helper function that "consumes" a busy or extended delay status. Common usage: int rc; do { rc = rtas_call(rtas_token("some-function"), ...); } while (rtas_busy_delay(rc)); /* convert rc to Linux error value, etc */ If rc is a busy or extended delay status, the caller can rely on rtas_busy_delay() to perform an appropriate sleep or reschedule and return nonzero. Other statuses are handled normally by the caller. The current implementation of rtas_busy_delay() both oversleeps and overuses the CPU: * It performs msleep() for all 990x and even when no delay is suggested (-2), but this is understood to actually sleep for two jiffies minimum in practice (20ms with HZ=100). 9900 (1ms) and 9901 (10ms) appear to be the most common extended delay statuses, and the oversleeping measurably lengthens DLPAR operations, which perform many RTAS calls. * It does not sleep on 990x unless need_resched() is true, causing code like the loop above to needlessly retry, wasting CPU time. Alter the logic to align better with the intended meanings: * When passed RTAS_BUSY, perform cond_resched() and return without sleeping. The caller should reattempt immediately * Always sleep when passed an extended delay status, using usleep_range() for precise shorter sleeps. Limit the sleep time to one second even though there are higher architected values. Change rtas_busy_delay()'s return type to bool to better reflect its usage, and add kernel-doc. rtas_busy_delay_time() is unchanged, even though it "incorrectly" returns 1 for RTAS_BUSY. There are users of that API with open-coded delay loops in sensitive contexts that will have to be taken on an individual basis. Brief results for addition and removal of 5GB memory on a small P9 PowerVM partition follow. Load was generated with stress-ng --cpu N. For add, elapsed time is greatly reduced without significant change in the number of RTAS calls or time spent on CPU. For remove, elapsed time is modestly reduced, with significant reductions in RTAS calls and time spent on CPU. With no competing workload (- before, + after): Performance counter stats for 'bash -c echo "memory add count 20" > /sys/kernel/dlpar' (10 runs): - 1,935 probe:rtas_call # 0.003 M/sec ( +- 0.22% ) - 609.99 msec task-clock # 0.183 CPUs utilized ( +- 0.19% ) + 1,956 probe:rtas_call # 0.003 M/sec ( +- 0.17% ) + 618.56 msec task-clock # 0.278 CPUs utilized ( +- 0.11% ) - 3.3322 +- 0.0670 seconds time elapsed ( +- 2.01% ) + 2.2222 +- 0.0416 seconds time elapsed ( +- 1.87% ) Performance counter stats for 'bash -c echo "memory remove count 20" > /sys/kernel/dlpar' (10 runs): - 6,224 probe:rtas_call # 0.008 M/sec ( +- 2.57% ) - 750.36 msec task-clock # 0.190 CPUs utilized ( +- 2.01% ) + 843 probe:rtas_call # 0.003 M/sec ( +- 0.12% ) + 250.66 msec task-clock # 0.068 CPUs utilized ( +- 0.17% ) - 3.9394 +- 0.0890 seconds time elapsed ( +- 2.26% ) + 3.678 +- 0.113 seconds time elapsed ( +- 3.07% ) With all CPUs 100% busy (- before, + after): Performance counter stats for 'bash -c echo "memory add count 20" > /sys/kernel/dlpar' (10 runs): - 2,979 probe:rtas_call # 0.003 M/sec ( +- 0.12% ) - 1,096.62 msec task-clock # 0.105 CPUs utilized ( +- 0.10% ) + 2,981 probe:rtas_call # 0.003 M/sec ( +- 0.22% ) + 1,095.26 msec task-clock # 0.154 CPUs utilized ( +- 0.21% ) - 10.476 +- 0.104 seconds time elapsed ( +- 1.00% ) + 7.1124 +- 0.0865 seconds time elapsed ( +- 1.22% ) Performance counter stats for 'bash -c echo "memory remove count 20" > /sys/kernel/dlpar' (10 runs): - 2,702 probe:rtas_call # 0.004 M/sec ( +- 4.00% ) - 722.71 msec task-clock # 0.067 CPUs utilized ( +- 2.41% ) + 1,246 probe:rtas_call # 0.003 M/sec ( +- 0.25% ) + 487.73 msec task-clock # 0.049 CPUs utilized ( +- 0.20% ) - 10.829 +- 0.163 seconds time elapsed ( +- 1.51% ) + 9.9887 +- 0.0866 seconds time elapsed ( +- 0.87% ) Signed-off-by: Nathan Lynch Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211117060259.957178-2-nathanl@linux.ibm.com commit 22887f319a39929e357810a1f964fcba7ae42c59 Author: Nathan Lynch Date: Mon Sep 20 12:32:03 2021 -0500 powerpc/pseries: delete scanlog Remove the pseries scanlog driver. This code supports functions from Power4-era servers that are not present on targets currently supported by arch/powerpc. System manuals from this time have this description: Scan Dump data is a set of chip data that the service processor gathers after a system malfunction. It consists of chip scan rings, chip trace arrays, and Scan COM (SCOM) registers. This data is stored in the scan-log partition of the system’s Nonvolatile Random Access Memory (NVRAM). PowerVM partition firmware development doesn't recognize the associated function call or property, and they don't see any references to them in their codebase. It seems to have been specific to non-virtualized pseries. References: Historical Linux commit from February 2003 (interesting to note this seems to be the source of non-GPL exports for rtas_call etc): https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git/commit/?id=f92e361842d5251e50562b09664082dcbd0548bb IntelliStation and pSeries docs which refer to the feature: http://ps-2.retropc.se/basil.holloway/ALL%20PDF/380635.pdf http://ps-2.kev009.com/rs6000/manuals/p/p615-6C3-6E3/6C3_and_6E3_Users_Guide_SA38-0629.pdf Signed-off-by: Nathan Lynch Reviewed-by: Tyrel Datwyler Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210920173203.1800475-1-nathanl@linux.ibm.com commit 53cadf7deee0ce65d7c33770b7810c98a2a0ee6a Author: Nathan Lynch Date: Tue Nov 16 15:58:06 2021 -0600 powerpc/rtas: kernel-doc fixes Fix the following issues reported by kernel-doc: $ scripts/kernel-doc -v -none arch/powerpc/kernel/rtas.c arch/powerpc/kernel/rtas.c:810: info: Scanning doc for function rtas_activate_firmware arch/powerpc/kernel/rtas.c:818: warning: contents before sections arch/powerpc/kernel/rtas.c:841: info: Scanning doc for function rtas_call_reentrant arch/powerpc/kernel/rtas.c:893: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Find a specific pseries error log in an RTAS extended event log. Signed-off-by: Nathan Lynch Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211116215806.928235-1-nathanl@linux.ibm.com commit 8b8a8f0ab3f5519e45c526f826a655817486c5bb Author: Christophe Leroy Date: Mon Nov 15 11:12:22 2021 +0100 powerpc/code-patching: Improve verification of patchability Today, patch_instruction() assumes that it is called exclusively on valid addresses, and only checks that it is not called on an init address after init section has been freed. Improve verification by calling kernel_text_address() instead. kernel_text_address() already includes a verification of initmem release. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/bc683d499a411730504b132a924de0ccc2ef1f79.1636971137.git.christophe.leroy@csgroup.eu commit a3bcfc182b2c968fd740101322bd128844724961 Author: Jason Wang Date: Sun Nov 14 19:56:16 2021 +0800 powerpc/tsi108: make EXPORT_SYMBOL follow its function immediately EXPORT_SYMBOL(foo); should immediately follow its function/variable. Signed-off-by: Jason Wang Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211114115616.493815-1-wangborong@cdjrlc.com commit e919c0b2323bedec00e1ecc6280498ff81f59b15 Author: Hari Bathini Date: Tue Oct 12 18:00:56 2021 +0530 bpf ppc32: Access only if addr is kernel address With KUAP enabled, any kernel code which wants to access userspace needs to be surrounded by disable-enable KUAP. But that is not happening for BPF_PROBE_MEM load instruction. Though PPC32 does not support read protection, considering the fact that PTR_TO_BTF_ID (which uses BPF_PROBE_MEM mode) could either be a valid kernel pointer or NULL but should never be a pointer to userspace address, execute BPF_PROBE_MEM load only if addr is kernel address, otherwise set dst_reg=0 and move on. This will catch NULL, valid or invalid userspace pointers. Only bad kernel pointer will be handled by BPF exception table. [Alexei suggested for x86] Suggested-by: Alexei Starovoitov Signed-off-by: Hari Bathini Reviewed-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211012123056.485795-9-hbathini@linux.ibm.com commit 23b51916ee129833453d8a3d6bde0ff392f82fce Author: Hari Bathini Date: Tue Oct 12 18:00:55 2021 +0530 bpf ppc32: Add BPF_PROBE_MEM support for JIT BPF load instruction with BPF_PROBE_MEM mode can cause a fault inside kernel. Append exception table for such instructions within BPF program. Unlike other archs which uses extable 'fixup' field to pass dest_reg and nip, BPF exception table on PowerPC follows the generic PowerPC exception table design, where it populates both fixup and extable sections within BPF program. fixup section contains 3 instructions, first 2 instructions clear dest_reg (lower & higher 32-bit registers) and last instruction jumps to next instruction in the BPF code. extable 'insn' field contains relative offset of the instruction and 'fixup' field contains relative offset of the fixup entry. Example layout of BPF program with extable present: +------------------+ | | | | 0x4020 -->| lwz r28,4(r4) | | | | | 0x40ac -->| lwz r3,0(r24) | | lwz r4,4(r24) | | | | | |------------------| 0x4278 -->| li r28,0 | \ | li r27,0 | | fixup entry | b 0x4024 | / 0x4284 -->| li r4,0 | | li r3,0 | | b 0x40b4 | |------------------| 0x4290 -->| insn=0xfffffd90 | \ extable entry | fixup=0xffffffe4 | / 0x4298 -->| insn=0xfffffe14 | | fixup=0xffffffe8 | +------------------+ (Addresses shown here are chosen random, not real) Signed-off-by: Hari Bathini Reviewed-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211012123056.485795-8-hbathini@linux.ibm.com commit 9c70c7147ffec31de67d33243570a533b29f9759 Author: Ravi Bangoria Date: Tue Oct 12 18:00:54 2021 +0530 bpf ppc64: Access only if addr is kernel address On PPC64 with KUAP enabled, any kernel code which wants to access userspace needs to be surrounded by disable-enable KUAP. But that is not happening for BPF_PROBE_MEM load instruction. So, when BPF program tries to access invalid userspace address, page-fault handler considers it as bad KUAP fault: Kernel attempted to read user page (d0000000) - exploit attempt? (uid: 0) Considering the fact that PTR_TO_BTF_ID (which uses BPF_PROBE_MEM mode) could either be a valid kernel pointer or NULL but should never be a pointer to userspace address, execute BPF_PROBE_MEM load only if addr is kernel address, otherwise set dst_reg=0 and move on. This will catch NULL, valid or invalid userspace pointers. Only bad kernel pointer will be handled by BPF exception table. [Alexei suggested for x86] Suggested-by: Alexei Starovoitov Signed-off-by: Ravi Bangoria Signed-off-by: Hari Bathini Reviewed-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211012123056.485795-7-hbathini@linux.ibm.com commit 983bdc0245a29cdefcd30d9d484d3edbc4b6d787 Author: Ravi Bangoria Date: Tue Oct 12 18:00:53 2021 +0530 bpf ppc64: Add BPF_PROBE_MEM support for JIT BPF load instruction with BPF_PROBE_MEM mode can cause a fault inside kernel. Append exception table for such instructions within BPF program. Unlike other archs which uses extable 'fixup' field to pass dest_reg and nip, BPF exception table on PowerPC follows the generic PowerPC exception table design, where it populates both fixup and extable sections within BPF program. fixup section contains two instructions, first instruction clears dest_reg and 2nd jumps to next instruction in the BPF code. extable 'insn' field contains relative offset of the instruction and 'fixup' field contains relative offset of the fixup entry. Example layout of BPF program with extable present: +------------------+ | | | | 0x4020 -->| ld r27,4(r3) | | | | | 0x40ac -->| lwz r3,0(r4) | | | | | |------------------| 0x4280 -->| li r27,0 | \ fixup entry | b 0x4024 | / 0x4288 -->| li r3,0 | | b 0x40b0 | |------------------| 0x4290 -->| insn=0xfffffd90 | \ extable entry | fixup=0xffffffec | / 0x4298 -->| insn=0xfffffe14 | | fixup=0xffffffec | +------------------+ (Addresses shown here are chosen random, not real) Signed-off-by: Ravi Bangoria Signed-off-by: Hari Bathini Reviewed-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211012123056.485795-6-hbathini@linux.ibm.com commit f15a71b3880bf07b40810644e5ac6f177c2a7c8f Author: Hari Bathini Date: Tue Oct 12 18:00:52 2021 +0530 powerpc/ppc-opcode: introduce PPC_RAW_BRANCH() macro Define and use PPC_RAW_BRANCH() macro instead of open coding it. This macro is used while adding BPF_PROBE_MEM support. Signed-off-by: Hari Bathini Reviewed-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211012123056.485795-5-hbathini@linux.ibm.com commit efa95f031bf38c85cf865413335a3dc044e3194e Author: Hari Bathini Date: Tue Oct 12 18:00:51 2021 +0530 bpf powerpc: refactor JIT compiler code Refactor powerpc LDX JITing code to simplify adding BPF_PROBE_MEM support. Signed-off-by: Hari Bathini Reviewed-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211012123056.485795-4-hbathini@linux.ibm.com commit 04c04205bc35d0ecdc57146995ca9eb957d4f379 Author: Ravi Bangoria Date: Tue Oct 12 18:00:50 2021 +0530 bpf powerpc: Remove extra_pass from bpf_jit_build_body() In case of extra_pass, usual JIT passes are always skipped. So, extra_pass is always false while calling bpf_jit_build_body() and can be removed. Signed-off-by: Ravi Bangoria Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211012123056.485795-3-hbathini@linux.ibm.com commit c9ce7c36e4870bd307101ba7a00a39d9aad270f3 Author: Ravi Bangoria Date: Tue Oct 12 18:00:49 2021 +0530 bpf powerpc: Remove unused SEEN_STACK SEEN_STACK is unused on PowerPC. Remove it. Also, have SEEN_TAILCALL use 0x40000000. Signed-off-by: Ravi Bangoria Reviewed-by: Christophe Leroy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211012123056.485795-2-hbathini@linux.ibm.com commit 157616f3c2284f13ca7db9897293f944e6ab8199 Author: Oliver O'Halloran Date: Fri Oct 15 18:06:28 2021 +1100 powerpc/eeh: Use a goto for recovery failures The EEH recovery logic in eeh_handle_normal_event() has some pretty strange flow control. If we remove all the actual recovery logic we're left with the following skeleton: if (result != PCI_ERS_RESULT_DISCONNECT) { ... } if (result != PCI_ERS_RESULT_DISCONNECT) { ... } if (result == PCI_ERS_RESULT_NONE) { ... } if (result == PCI_ERS_RESULT_CAN_RECOVER) { ... } if (result == PCI_ERS_RESULT_CAN_RECOVER) { ... } if (result == PCI_ERS_RESULT_NEED_RESET) { ... } if ((result == PCI_ERS_RESULT_RECOVERED) || (result == PCI_ERS_RESULT_NONE)) { ... goto out; } /* * unsuccessful recovery / PCI_ERS_RESULT_DISCONECTED * handling is here. */ ... out: ... Most of the "if () { ... }" blocks above change "result" to PCI_ERS_RESULT_DISCONNECTED if an error occurs in that recovery step. This makes the control flow a bit confusing since it breaks the early-exit pattern that is generally used in Linux. In any case we end up handling the error in the final else block so why not just jump there directly? Doing so also allows us to de-indent a bunch of code. No functional changes. [dja: rebase on top of linux-next + my preceeding refactor, move clearing the EEH_DEV_NO_HANDLER bit above the first goto so that it is always clear in the error handler code as it was before.] Signed-off-by: Oliver O'Halloran Signed-off-by: Daniel Axtens Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211015070628.1331635-2-dja@axtens.net commit 10b34ece132ee46dc4e6459c765d180c422a09fa Author: Daniel Axtens Date: Fri Oct 15 18:06:27 2021 +1100 powerpc/eeh: Small refactor of eeh_handle_normal_event() The control flow of eeh_handle_normal_event() is a bit tricky. Break out one of the error handling paths - rather than be in an else block, we'll make it part of the regular body of the function and put a 'goto out;' in the true limb of the if. Signed-off-by: Daniel Axtens Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211015070628.1331635-1-dja@axtens.net commit 1e7684dc4fc70271c8bf86d397bd4fbfb3581e65 Author: Cédric Le Goater Date: Fri Nov 5 11:26:35 2021 +0100 powerpc/xive: Add a debugfs toggle for save-restore On POWER10, the automatic "save & restore" of interrupt context is always available. Provide a way to deactivate it for tests or performance. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211105102636.1016378-11-clg@kaod.org commit c21ee04f11ae068aa132cce56d09f618d4a66259 Author: Cédric Le Goater Date: Fri Nov 5 11:26:34 2021 +0100 powerpc/xive: Add a kernel parameter for StoreEOI StoreEOI is activated by default on platforms supporting the feature (POWER10) and will be used as soon as firmware advertises its availability. The kernel parameter provides a way to deactivate its use. It can be still be reactivated through debugfs. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211105102636.1016378-10-clg@kaod.org commit d7bc1e376cb786e9e8483455584d89cad4b5808f Author: Cédric Le Goater Date: Fri Nov 5 11:26:33 2021 +0100 powerpc/xive: Add a debugfs toggle for StoreEOI It can be used to deactivate temporarily StoreEOI for tests or performance on platforms supporting the feature (POWER10) Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211105102636.1016378-9-clg@kaod.org commit 08f3f610214f395561bbda03344e641579f6e917 Author: Cédric Le Goater Date: Fri Nov 5 11:26:32 2021 +0100 powerpc/xive: Add a debugfs file to dump EQs The XIVE driver under Linux uses a single interrupt priority and only one event queue is configured per CPU. Expose the contents under a 'xive/eqs/cpuX' debugfs file. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211105102636.1016378-8-clg@kaod.org commit 33e1d4a152ce55272b54a16884461218d12d4f1b Author: Cédric Le Goater Date: Fri Nov 5 11:26:31 2021 +0100 powerpc/xive: Rename the 'cpus' debugfs file to 'ipis' and remove the EQ entries output which is not very useful since only the next two events of the queue are taken into account. We will improve the dump of the EQ in the next patches. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211105102636.1016378-7-clg@kaod.org commit baed14de78b5ee3ca04eae43c5b16e3eeb6e33a8 Author: Cédric Le Goater Date: Fri Nov 5 11:26:30 2021 +0100 powerpc/xive: Change the debugfs file 'xive' into a directory Use a 'cpus' file to dump CPU states and 'interrupts' to dump IRQ states. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211105102636.1016378-6-clg@kaod.org commit 412877dfae3dc12733bc711ccbd3d02338803865 Author: Cédric Le Goater Date: Fri Nov 5 11:26:29 2021 +0100 powerpc/xive: Introduce xive_core_debugfs_create() and fix some compile issues when !CONFIG_DEBUG_FS. Signed-off-by: Cédric Le Goater [mpe: Add empty stub to fix !CONFIG_DEBUG_FS build] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211105102636.1016378-5-clg@kaod.org commit 756c52c632f5c2b054bb54b1ea9177329e4b8ce5 Author: Cédric Le Goater Date: Fri Nov 5 11:26:28 2021 +0100 powerpc/xive: Activate StoreEOI on P10 StoreEOI (the capability to EOI with a store) requires load-after-store ordering in some cases to be reliable. P10 introduced a new offset for load operations to enforce correct ordering and the XIVE driver has the required support since kernel 5.8, commit b1f9be9392f0 ("powerpc/xive: Enforce load-after-store ordering when StoreEOI is active") Since skiboot v7, StoreEOI support is advertised on P10 with a new flag on the PowerNV platform. See skiboot commit 4bd7d84afe46 ("xive/p10: Introduce a new OPAL_XIVE_IRQ_STORE_EOI2 flag"). When detected, activate the feature. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211105102636.1016378-4-clg@kaod.org commit bd5b00c6cf0c37fce1bcd94390044d7e1dd638e7 Author: Cédric Le Goater Date: Fri Nov 5 11:26:27 2021 +0100 powerpc/xive: Introduce an helper to print out interrupt characteristics and extend output of debugfs and xmon with addresses of the ESB management and trigger pages. Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211105102636.1016378-3-clg@kaod.org commit 44b9c8ddcbc351d47ead974f0870d09bfc74b3f7 Author: Cédric Le Goater Date: Fri Nov 5 11:26:26 2021 +0100 powerpc/xive: Replace pr_devel() by pr_debug() to ease debug These routines are not on hot code paths and pr_debug() is easier to activate. Also add a '0x' prefix to hex printed values (HW IRQ number). Signed-off-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211105102636.1016378-2-clg@kaod.org commit d02fa40d759ff9a53c93b10d8a4b591688982b26 Author: Nicholas Piggin Date: Mon May 3 23:02:43 2021 +1000 powerpc/powernv: Remove POWER9 PVR version check for entry and uaccess flushes These aren't necessarily POWER9 only, and it's not to say some new vulnerability may not get discovered on other processors for which we would like the flexibility of having the workaround enabled by firmware. Remove the restriction that the workarounds only apply to POWER9. However POWER7 and POWER8 are not affected, and they may not have older firmware that does not advertise this, so clear these workarounds manually. Signed-off-by: Nicholas Piggin Reviewed-by: Joel Stanley [mpe: Incorporate changes from Nick, reword comment slightly.] Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20210503130243.891868-5-npiggin@gmail.com commit a1d2b210ffa52d60acabbf7b6af3ef7e1e69cda0 Author: Julia Lawall Date: Fri Nov 20 20:33:23 2015 +0000 powerpc/btext: add missing of_node_put for_each_node_by_type performs an of_node_get on each iteration, so a break out of the loop requires an of_node_put. A simplified version of the semantic patch that fixes this problem is as follows (http://coccinelle.lip6.fr): // @@ local idexpression n; expression e; @@ for_each_node_by_type(n,...) { ... ( of_node_put(n); | e = n | + of_node_put(n); ? break; ) ... } ... when != n // Signed-off-by: Julia Lawall Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1448051604-25256-6-git-send-email-Julia.Lawall@lip6.fr commit a841fd009e51c8c0a8f07c942e9ab6bb48da8858 Author: Julia Lawall Date: Fri Nov 20 21:33:24 2015 +0100 powerpc/cell: add missing of_node_put for_each_node_by_name performs an of_node_get on each iteration, so a break out of the loop requires an of_node_put. A simplified version of the semantic patch that fixes this problem is as follows (http://coccinelle.lip6.fr): // @@ expression e,e1; local idexpression n; @@ for_each_node_by_name(n, e1) { ... when != of_node_put(n) when != e = n ( return n; | + of_node_put(n); ? return ...; ) ... } // Signed-off-by: Julia Lawall Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1448051604-25256-7-git-send-email-Julia.Lawall@lip6.fr commit 7d405a939ca960162eb30c1475759cb2fdf38f8c Author: Julia Lawall Date: Fri Nov 20 20:33:21 2015 +0000 powerpc/powernv: add missing of_node_put for_each_compatible_node performs an of_node_get on each iteration, so a break out of the loop requires an of_node_put. A simplified version of the semantic patch that fixes this problem is as follows (http://coccinelle.lip6.fr): // @@ local idexpression n; expression e; @@ for_each_compatible_node(n,...) { ... ( of_node_put(n); | e = n | + of_node_put(n); ? break; ) ... } ... when != n // Signed-off-by: Julia Lawall Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1448051604-25256-4-git-send-email-Julia.Lawall@lip6.fr commit f6e82647ff71d427d4148964b71f239fba9d7937 Author: Julia Lawall Date: Fri Nov 20 20:33:19 2015 +0000 powerpc/6xx: add missing of_node_put for_each_compatible_node performs an of_node_get on each iteration, so a break out of the loop requires an of_node_put. A simplified version of the semantic patch that fixes this problem is as follows (http://coccinelle.lip6.fr): // @@ expression e; local idexpression n; @@ @@ local idexpression n; expression e; @@ for_each_compatible_node(n,...) { ... ( of_node_put(n); | e = n | + of_node_put(n); ? break; ) ... } ... when != n // Signed-off-by: Julia Lawall Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1448051604-25256-2-git-send-email-Julia.Lawall@lip6.fr commit ff0d6be4bf9ad4daba024ba0157b97750c7ad1fb Merge: 136057256686d 9c5a432a55810 Author: Michael Ellerman Date: Thu Nov 25 11:23:59 2021 +1100 Merge branch 'topic/ppc-kvm' into next This merge's Nick's big P9 KVM series, original cover letter follows: KVM: PPC: Book3S HV P9: entry/exit optimisations This reduces radix guest full entry/exit latency on POWER9 and POWER10 by 2x. Nested HV guests should see smaller improvements in their L1 entry/exit, but this is also combined with most L0 speedups also applying to nested entry. nginx localhost throughput test in a SMP nested guest is improved about 10% (in a direct guest it doesn't change much because it uses XIVE for IPIs) when L0 and L1 are patched. It does this in several main ways: - Rearrange code to optimise SPR accesses. Mainly, avoid scoreboard stalls. - Test SPR values to avoid mtSPRs where possible. mtSPRs are expensive. - Reduce mftb. mftb is expensive. - Demand fault certain facilities to avoid saving and/or restoring them (at the cost of fault when they are used, but this is mitigated over a number of entries, like the facilities when context switching processes). PM, TM, and EBB so far. - Defer some sequences that are made just in case a guest is interrupted in the middle of a critical section to the case where the guest is scheduled on a different CPU, rather than every time (at the cost of an extra IPI in this case). Namely the tlbsync sequence for radix with GTSE, which is very expensive. - Reduce locking, barriers, atomics related to the vcpus-per-vcore > 1 handling that the P9 path does not require. commit 9c7e2634f647630db4e0719391dd80cd81132a66 Author: Andi Kleen Date: Thu Nov 18 19:58:03 2021 -0800 x86/cpu: Don't write CSTAR MSR on Intel CPUs Intel CPUs do not support SYSCALL in 32-bit mode, but the kernel initializes MSR_CSTAR unconditionally. That MSR write is normally ignored by the CPU, but in a TDX guest it raises a #VE trap. Exclude Intel CPUs from the MSR_CSTAR initialization. [ tglx: Fixed the subject line and removed the redundant comment. ] Signed-off-by: Andi Kleen Signed-off-by: Kuppuswamy Sathyanarayanan Signed-off-by: Thomas Gleixner Reviewed-by: Tony Luck Link: https://lore.kernel.org/r/20211119035803.4012145-1-sathyanarayanan.kuppuswamy@linux.intel.com commit 3297481d688a5cc2973ea58bd78e66b8639748b1 Author: Arnd Bergmann Date: Tue Oct 26 12:03:48 2021 +0200 futex: Remove futex_cmpxchg detection Now that all architectures have a working futex implementation in any configuration, remove the runtime detection code. Signed-off-by: Arnd Bergmann Signed-off-by: Thomas Gleixner Reviewed-by: Russell King (Oracle) Acked-by: Vineet Gupta Acked-by: Max Filippov Acked-by: Christian Borntraeger Link: https://lore.kernel.org/r/20211026100432.1730393-2-arnd@kernel.org commit 3f2bedabb62c6210df63b604dc988d2f7f56f947 Author: Arnd Bergmann Date: Tue Oct 26 12:03:47 2021 +0200 futex: Ensure futex_atomic_cmpxchg_inatomic() is present The boot-time detection of futex_atomic_cmpxchg_inatomic() has a bug on some 32-bit arm builds, and Thomas Gleixner suggested that setting CONFIG_HAVE_FUTEX_CMPXCHG would avoid the problem, as it is always present anyway. Looking into which other architectures could do the same showed that almost all architectures have it, the exceptions being: - some old 32-bit MIPS uniprocessor cores without ll/sc - one xtensa variant with no SMP - 32-bit SPARC when built for SMP Fix MIPS And Xtensa by rearranging the generic code to let it be used as a fallback. For SPARC, the SMP definition just ends up turning off futex anyway, so this can be done at Kconfig time instead. Note that sparc32 glibc requires the CASA instruction for its mutexes anyway, which is only available when running on SPARCv9 or LEON CPUs, but needs to be implemented in the sparc32 kernel for those. Signed-off-by: Arnd Bergmann Signed-off-by: Thomas Gleixner Acked-by: Max Filippov Acked-by: Geert Uytterhoeven Acked-by: Rich Felker Link: https://lore.kernel.org/r/20211026100432.1730393-1-arnd@kernel.org commit 1f5792549376b3c20639cef7b787cf6262177b66 Author: Alex Deucher Date: Tue Nov 23 10:44:48 2021 -0500 drm/amd/display: update bios scratch when setting backlight Update the bios scratch register when updating the backlight level. Some platforms apparently read this scratch register and do additional operations in their hotkey handlers. Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1518 Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit 081664ef3e43dce93710ed5ece326478edbe0934 Author: Alex Deucher Date: Tue Nov 23 11:36:01 2021 -0500 drm/amdgpu/pm: fix powerplay OD interface The overclocking interface currently appends data to a string. Revert back to using sprintf(). Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1774 Fixes: 6db0c87a0a8ee1 ("amdgpu/pm: Replace hwmgr smu usage of sprintf with sysfs_emit") Acked-by: Evan Quan Acked-by: Christian König Signed-off-by: Alex Deucher commit 6ff53495ceee08c5883ccdfba3b94a8f9e4d7f49 Author: Lijo Lazar Date: Wed Nov 24 19:26:38 2021 +0800 drm/amdgpu: Skip ASPM programming on aldebaran There is no need for additional programming, keep the default settings. Signed-off-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit cc7818d7091d0b07d564048ba5cd67b1210e8768 Author: Yang Wang Date: Wed Nov 24 12:26:02 2021 +0800 drm/amdgpu: fix byteorder error in amdgpu discovery fix some byteorder issues about amdgpu discovery. This will result in running errors on the big end system. (e.g:MIPS) Signed-off-by: Yang Wang Reviewed-by: Guchun Chen Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit 23eb49251bd6e169a57ed938c815f6f47a312479 Author: Philip Yang Date: Tue Nov 23 10:20:17 2021 -0500 drm/amdgpu: enable Navi retry fault wptr overflow If xnack is on, VM retry fault interrupt send to IH ring1, and ring1 will be full quickly. IH cannot receive other interrupts, this causes deadlock if migrating buffer using sdma and waiting for sdma done while handling retry fault. Remove VMC from IH storm client, enable ring1 write pointer overflow, then IH will drop retry fault interrupts and be able to receive other interrupts while driver is handling retry fault. IH ring1 write pointer doesn't writeback to memory by IH, and ring1 write pointer recorded by self-irq is not updated, so always read the latest ring1 write pointer from register. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 71ee9236ab9e7e7b76be3d106724c35c5f934b85 Author: Philip Yang Date: Tue Nov 23 09:59:46 2021 -0500 drm/amdgpu: enable Navi 48-bit IH timestamp counter By default this timestamp is 32 bit counter. It gets overflowed in around 10 minutes. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 2e4477282c8cff9fd2155710ed9168f38faa0b4f Author: Philip Yang Date: Fri Nov 19 17:02:50 2021 -0500 drm/amdkfd: simplify drain retry fault unmap range always increase atomic svms->drain_pagefaults to simplify both parent range and child range unmap, page fault handle ignores the retry fault if svms->drain_pagefaults is set to speed up interrupt handling. svm_range_drain_retry_fault restart draining if another range unmap from cpu. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 7ad153db5859e5e156307865d9df7f2a392c1686 Author: Philip Yang Date: Fri Nov 19 16:16:39 2021 -0500 drm/amdkfd: handle VMA remove race VMA may be removed before unmap notifier callback, and deferred list work remove range, return success for this special case as we are handling stale retry fault. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit a0c55ecee10055901c9c1b46d0d129cb6b51fa5d Author: Philip Yang Date: Tue Nov 16 11:45:32 2021 -0500 drm/amdkfd: process exit and retry fault race kfd_process_wq_release drain retry fault to ensure no retry fault comes after removing kfd process from the hash table, otherwise svm page fault handler will fail to recover the fault and dump GPU vm fault log. Refactor deferred list work to get_task_mm and take mmap write lock to handle all ranges, and avoid mm is gone while inserting mmu notifier. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 514f4a99c7a1b635f7336a6e4732e6fe3ec972a9 Author: Philip Yang Date: Fri Nov 12 19:05:08 2021 -0500 drm/amdgpu: IH process reset count when restart Otherwise when IH process restart, count is zero, the loop will not exit to wake_up_all after processing AMDGPU_IH_MAX_NUM_IVS interrupts. Signed-off-by: Philip Yang Reviewed-by: Christian König Signed-off-by: Alex Deucher commit 3a50403f8b119d6be4f9935cee97473a2c90840e Author: Surbhi Kakarya Date: Tue Nov 23 15:54:47 2021 -0500 drm/amd/pm: add new fields for Sienna Cichlid. Fill voltage fields in metrics table. Signed-off-by: Surbhi Kakarya Acked-by: Alexander Deucher Signed-off-by: Alex Deucher commit e771d71d8d588aa0c0f9ba3e1b81ac5989ffcccf Author: Luben Tuikov Date: Wed Nov 17 13:39:26 2021 -0500 drm/amd/pm: Print the error on command submission Print the error on command submission immediately after submitting to the SMU. This is rate-limited. It helps to immediately know there was an error on command submission, rather than leave it up to clients to report the error, as sometimes they do not. Cc: Alex Deucher Signed-off-by: Luben Tuikov Acked-by: Alex Deucher Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit dc78fea1e7fd895990179e2b32164193a9fd17d3 Author: Luben Tuikov Date: Wed Nov 17 10:58:09 2021 -0500 drm/amd/pm: Sienna: Print failed BTC Add a print in sienna_cichlid_run_btc() to help debug and to mirror other platforms, as no print is present in the caller, smu_smc_hw_setup(). Cc: Alex Deucher Signed-off-by: Luben Tuikov Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit ca4b32bb2d723c705fcce1cfb618a0cd19185f3d Author: Luben Tuikov Date: Wed Nov 17 10:58:09 2021 -0500 drm/amd/pm: Add debug prints Add prints where there are none and none are printed in the callee. Remove the word "previous" from comment and print to make it shorter and avoid confusion in various prints. Cc: Alex Deucher Signed-off-by: Luben Tuikov Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 1223c15c780bc967e150204ec11992f39fdc85d5 Author: Evan Quan Date: Fri Nov 12 15:51:25 2021 +0800 drm/amdgpu: update the domain flags for dumb buffer creation After switching to generic framebuffer framework, we rely on the ->dumb_create routine for frame buffer creation. However, the different domain flags used are not optimal. Add the contiguous flag to directly allocate the scanout BO as one linear buffer. Fixes: 087451f372bf76 ("drm/amdgpu: use generic fb helpers instead of setting up AMD own's.") Signed-off-by: Evan Quan Reviewed-by: Christian König Reviewed-by: Guchun Chen Signed-off-by: Alex Deucher commit 37ba5bbc89787aa6029266fef771ce1fc7f596ae Author: Ramesh Errabolu Date: Thu Nov 18 16:09:32 2021 -0600 drm/amdgpu: Declare Unpin BO api as static Fixes warning report from kernel test robot Reported-by: kernel test robot Signed-off-by: Ramesh Errabolu Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 7b37c7f8f505abc55da54a5a9d22135d77ff73bb Author: Alex Deucher Date: Thu Nov 18 14:50:37 2021 -0500 drm/amdgpu/gfx9: switch to golden tsc registers for renoir+ Renoir and newer gfx9 APUs have new TSC register that is not part of the gfxoff tile, so it can be read without needing to disable gfx off. Acked-by: Luben Tuikov Signed-off-by: Alex Deucher commit f75de8447511102698de011d318576432aebaa8f Author: Alex Deucher Date: Thu Nov 18 14:33:23 2021 -0500 drm/amdgpu/gfx10: add wraparound gpu counter check for APUs as well Apply the same check we do for dGPUs for APUs as well. Acked-by: Luben Tuikov Signed-off-by: Alex Deucher commit 4f30d920d123c58b6e55e6ccd061673751aab5f8 Author: shaoyunl Date: Thu Nov 18 11:43:16 2021 -0500 drm/amdgpu: move kfd post_reset out of reset_sriov function Fixes: 9f4f2c1a3524 ("drm/amd/amdgpu: fix the kfd pre_reset sequence in sriov") For sriov XGMI configuration, the host driver will handle the hive reset, so in guest side, the reset_sriov only be called once on one device. This will make kfd post_reset unblanced with kfd pre_reset since kfd pre_reset already been moved out of reset_sriov function. Move kfd post_reset out of reset_sriov function to make them balance . Signed-off-by: shaoyunl Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 8ab1d0923c2bdd708e041a765c6e7ca57e6121d8 Author: Aric Cyr Date: Sun Nov 14 19:05:52 2021 -0500 drm/amd/display: 3.2.163 This version brings along the following: - FW promotion to 0.0.94 - Enable seamless boot for DCN301 - Improvements in bandwidth validation - Fixes in flags update, link encoder assignments, DSC, ODM combine and more Acked-by: Qingqing Zhuo Signed-off-by: Aric Cyr Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 7f41c66070053e269b2082be964b6ce9f95776e2 Author: Anthony Koo Date: Sat Nov 13 21:11:12 2021 -0500 drm/amd/display: [FW Promotion] Release 0.0.94 [Why & How] - Remove tick count definition since it can be different per HW revision Acked-by: Qingqing Zhuo Signed-off-by: Anthony Koo Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 11dff0e871037a6ad978e52f826a2eb7f5fb274a Author: Martin Leung Date: Fri Nov 12 17:59:31 2021 -0500 drm/amd/display: add else to avoid double destroy clk_mgr [Why & How] when changing some code we accidentally changed else if-> if. reverting that. Reviewed-by: Aric Cyr Acked-by: Qingqing Zhuo Signed-off-by: Martin Leung Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 8acd97545008cb0aa916e6dea5e61f364de9eafb Author: sungwang Date: Wed Nov 10 14:52:18 2021 +0800 drm/amd/display: Fix ODM combine issue with fast boot [Why] When systme power up and eDP lit up by VBIOS, in the core_link_enable_stream(), the function will early return due to apply apply_edp_fast_boot_optimization, resulting the DP_PIXEL_COMBINE cannot get set in enc3_dp_set_odm_combine. [How] Check ODM PIPE to avoid early return. Reviewed-by: Dmytro Laktyushkin Acked-by: Qingqing Zhuo Signed-off-by: Danny Wang Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit ae6c9601da7addf1191bf54d5d279daa124b71df Author: Yi-Ling Chen Date: Wed Nov 10 14:26:53 2021 +0800 drm/amd/display: Fixed DSC would not PG after removing DSC stream [WHY] Due to pass the wrong parameter down to the enable_stream_gating(), it would cause the DSC of the removing stream would not be PG. [HOW] To pass the correct parameter down th the enable_stream_gating(). Reviewed-by: Anthony Koo Acked-by: Qingqing Zhuo Signed-off-by: Yi-Ling Chen Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit a5e00e1135b09ffb9404ee16701d20b6ee259b16 Author: Nevenko Stupar Date: Wed Nov 10 11:15:17 2021 -0500 drm/amd/display: Display object info table changes [Why] display_object_info_table_v1_5 with atom_display_object_path_v3 will be used. [How] Add bios parser support for display_object_info_table_v1_5 with atom_display_object_path_v3 for all existing, in use bios records as well as for new records: ATOM_CONNECTOR_CAP_RECORD_TYPE, ATOM_CONNECTOR_SPEED_UPTO and ATOM_BRACKET_LAYOUT_V2_RECORD_TYPE. Reviewed-by: Jun Lei Acked-by: Qingqing Zhuo Signed-off-by: Nevenko Stupar Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 16f0c500f05b029c37cfcba61da92611192c1a2d Author: Mikita Lipski Date: Wed Nov 10 11:44:21 2021 -0500 drm/amd/display: fix accidental casting enum to bool [why/how] Fixing -Wint-in-bool-context Clang Build Failure Reviewed-by: Nicholas Choi Acked-by: Qingqing Zhuo Signed-off-by: Mikita Lipski Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 0bb24555858403671657f6dc025d2931e3e857bb Author: Sung Joon Kim Date: Mon Nov 8 16:35:18 2021 -0500 drm/amd/display: retain/release at proper places in link_enc assignment [why] Need to keep track of number of references to stream pointer. [how] Call stream retain/release whenever necessary in link_enc table assignment sequence. Reviewed-by: Aric Cyr Acked-by: Qingqing Zhuo Signed-off-by: Sung Joon Kim Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 4f48034b7fceec6845233fd71a0106354bb0470b Author: Zhan Liu Date: Tue Nov 9 13:30:38 2021 -0500 drm/amd/display: Rename dcn_validate_bandwidth to dcn10_validate_bandwidth [Why] Rename function name so it aligns with other resource function names being used by dcn10. [How] Rename function name for consistency. Reviewed-by: Ahmad Othman Acked-by: Qingqing Zhuo Signed-off-by: Zhan Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 6d63fcc2a334f7bd15e4e9b1db50a19335d2af4f Author: Nicholas Kazlauskas Date: Tue Nov 9 16:03:21 2021 -0500 drm/amd/display: Reset link encoder assignments for GPU reset [Why] A warning appears in the log on GPU reset for link_enc_cfg_link_encs_assign for the following condition: ASSERT(state->res_ctx.link_enc_cfg_ctx.link_enc_assignments[i].valid == false); This is not expected behavior and may result in link encoders being incorrectly assigned. [How] The dc->current_state is backed up into dm->cached_dc_state before we commit 0 streams. DC will clear link encoder assignments on the real state but the changes won't propagate over to the copy we made before the 0 streams commit. DC expects that link encoder assignments are *not* valid when committing a state, so as a workaround it needs to be cleared before passing it back into DC. Reviewed-by: Harry Wentland Acked-by: Qingqing Zhuo Signed-off-by: Nicholas Kazlauskas Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit f53e191e2be811158f59024524b509d39808e454 Author: Guo, Bing Date: Mon Nov 8 17:17:46 2021 -0500 drm/amd/display: fixed an error related to 4:2:0/4:2:2 DSC [Why] OPTC_BYTES_PER_PIXEL calculation for 4:2:2 and 4:2:0 could have error. [How] Change to use following formula: OPTC_DSC_BYTES_PER_PIXEL = ceiling((chunk size * 2^28) / slice width) v2: squash in 64 bit divide fix (Alex) Reviewed-by: Wenjing Liu Acked-by: Qingqing Zhuo Signed-off-by: Bing Guo Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 5562a8d71aa32ea27133d8b10406b3dcd57c01a5 Author: Pavel Begunkov Date: Wed Nov 10 15:49:34 2021 +0000 io_uring: disable drain with cqe skip Current IOSQE_IO_DRAIN implementation doesn't work well with CQE skipping and it's not allowed, otherwise some requests might be not executed until the ring is destroyed and the userspace would hang. Let's fail all drain requests after seeing IOSQE_CQE_SKIP_SUCCESS at least once. All drained requests prior to that will get run normally, so there should be no stalls. However, even though such mixing wouldn't lead to issues at the moment, it's still not allowed as the behaviour may change. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/bcf7164f8bf3eb54b7bb7b4fd119907fa4d4d43b.1636559119.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 3d4aeb9f98058c3bdfef5286e240cf18c50fee89 Author: Pavel Begunkov Date: Wed Nov 10 15:49:33 2021 +0000 io_uring: don't spinlock when not posting CQEs When no of queued for the batch completion requests need to post an CQE, see IOSQE_CQE_SKIP_SUCCESS, avoid grabbing ->completion_lock and other commit/post. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/8d4b4a08bca022cbe19af00266407116775b3e4d.1636559119.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 04c76b41ca974b508522831441dd7e5b1b59cbb0 Author: Pavel Begunkov Date: Wed Nov 10 15:49:32 2021 +0000 io_uring: add option to skip CQE posting Emitting a CQE is expensive from the kernel perspective. Often, it's also not convenient for the userspace, spends some cycles on processing and just complicates the logic. A similar problems goes for linked requests, where we post an CQE for each request in the link. Introduce a new flags, IOSQE_CQE_SKIP_SUCCESS, trying to help with it. When set and a request completed successfully, it won't generate a CQE. When fails, it produces an CQE, but all following linked requests will be CQE-less, regardless whether they have IOSQE_CQE_SKIP_SUCCESS or not. The notion of "fail" is the same as for link failing-cancellation, where it's opcode dependent, and _usually_ result >= 0 is a success, but not always. Linked timeouts are a bit special. When the requests it's linked to was not attempted to be executed, e.g. failing linked requests, it follows the description above. Otherwise, whether a linked timeout will post a completion or not solely depends on IOSQE_CQE_SKIP_SUCCESS of that linked timeout request. Linked timeout never "fail" during execution, so for them it's unconditional. It's expected for users to not really care about the result of it but rely solely on the result of the master request. Another reason for such a treatment is that it's racy, and the timeout callback may be running awhile the master request posts its completion. use case 1: If one doesn't care about results of some requests, e.g. normal timeouts, just set IOSQE_CQE_SKIP_SUCCESS. Error result will still be posted and need to be handled. use case 2: Set IOSQE_CQE_SKIP_SUCCESS for all requests of a link but the last, and it'll post a completion only for the last one if everything goes right, otherwise there will be one only one CQE for the first failed request. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/0220fbe06f7cf99e6fc71b4297bb1cb6c0e89c2c.1636559119.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 913a571affedd17239c4d4ea90c8874b32fc2191 Author: Pavel Begunkov Date: Wed Nov 10 15:49:31 2021 +0000 io_uring: clean cqe filling functions Split io_cqring_fill_event() into a couple of more targeted functions. The first on is io_fill_cqe_aux() for completions that are not associated with request completions and doing the ->cq_extra accounting. Examples are additional CQEs from multishot poll and rsrc notifications. The second is io_fill_cqe_req(), should be called when it's a normal request completion. Nothing more to it at the moment, will be used in later patches. The last one is inlined __io_fill_cqe() for a finer grained control, should be used with caution and in hottest places. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/59a9117a4a44fc9efcf04b3afa51e0d080f5943c.1636559119.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit cd2f33e93d578e9e1c47ef8981ec69298da9cb38 Merge: 96da174024b9c 6c26b5054ce2b Author: Mark Brown Date: Wed Nov 24 17:33:54 2021 +0000 ASoC: SOF: Intel: power optimizations with HDaudio SPIB register Merge series from Pierre-Louis Bossart : The use of the SPIB register helps reduce power consumption - though to a smaller degree than DMI_L1. This hardware capability is however incompatible with userspace-initiated rewinds typically used by PulseAudio. In the past (2015..2017) Intel suggested an API extension to let applications disable rewinds. At the time the feedback was that such a capability was too Intel-specific and SPIB remained unused except for loading DSP code. We now see devices with smaller batteries being released, and it's time to revisit Linux support for SPIB to extend battery life. In this update the rewinds are disabled via an opt-in kernel parameter. In the previous reviews, there was consensus that a Kconfig option was too complicated for distributions to set, and we are missing a TBD API to expose such capabilities to user-space. The debate on whether or not to use rewinds, and the impact of disabling rewinds, will likely be closed when Intel releases the 'deep-buffer' support, currently under development [2][3]. With this solution, rewinds will not be needed, ever. When an application deals with content that is not latency-sensitive (e.g. music playback), it will be able to reduce power consumption by selecting a different PCM device with increased buffering capabilities. Low-latency streams will be handled by the 'regular' path. In other words, the impossible compromise between power and latency will be handled with different PCM devices/profiles for the same endpoint, and we can push the design of capability negotiation to a later time when all the building blocks (firmware topology, kernel, userspace) are ready - we still have firmware xruns, DPCM race conditions to solve, and a need to describe these alternate PCM devices with UCM using 'modifiers'. commit d5549e9a6b863fe10388a55ab5dfc12b0a1473d3 Author: Kees Cook Date: Thu Nov 18 12:24:16 2021 -0800 ath11k: Use memset_startat() for clearing queue descriptors In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Use memset_startat() so memset() doesn't get confused about writing beyond the destination member that is intended to be the starting point of zeroing through the end of the struct. Additionally split up a later field-spanning memset() so that memset() can reason about the size. Signed-off-by: Kees Cook Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211118202416.1286046-1-keescook@chromium.org commit c27506cc7733261bafd7a97e7990407eef433d32 Author: Colin Ian King Date: Tue Nov 23 09:04:31 2021 +0000 ath11k: Fix spelling mistake "detetction" -> "detection" There is a spelling mistake in an ath11k_warn message. Fix it. Signed-off-by: Colin Ian King Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211123090431.165103-1-colin.i.king@gmail.com commit 72f4124347724e3b8aa434f6bc4a2cd69f7bb336 Author: Kalle Valo Date: Wed Nov 24 11:43:16 2021 +0200 Revert "ath11k: add read variant from SMBIOS for download board data" This reverts commit 46e46db313a2bf3c48cac4eb8bdb613b762f301b. Mark reported that it breaks QCA6390 hw2.0 on Dell XPS 13 9310: [    5.537034] ath11k_pci 0000:72:00.0: chip_id 0x0 chip_family 0xb board_id 0xff soc_id 0xffffffff [    5.537038] ath11k_pci 0000:72:00.0: fw_version 0x101c06cc fw_build_timestamp 2020-06-24 19:50 fw_build_id [    5.537236] ath11k_pci 0000:72:00.0: failed to fetch board data for bus=pci,qmi-chip-id=0,qmi-board-id=255,variant=DE_1901 from ath11k/QCA6390/hw2.0/board-2.bin [    5.537255] ath11k_pci 0000:72:00.0: failed to fetch board-2.bin or board.bin from QCA6390/hw2.0 [    5.537257] ath11k_pci 0000:72:00.0: qmi failed to fetch board file: -2 [    5.537258] ath11k_pci 0000:72:00.0: failed to load board data file: -2 So we need to back to the drawing board and implement it so that backwards compatiblity is not broken. Reported-by: Mark Herbert Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211124094316.9096-1-kvalo@codeaurora.org commit e38f9ff63e6d403f8e52302d223e3c5c110872ee Author: Rafael J. Wysocki Date: Tue Oct 26 20:57:31 2021 +0200 ACPI: scan: Do not add device IDs from _CID if _HID is not valid Section 6.1.2 of ACPI 6.4 explicitly requires _HID to be present for _CID to be defined, so don't add device IDs from _CID to the device IDs list of a device if _HID is not valid. Link: https://uefi.org/specs/ACPI/6.4/06_Device_Configuration/Device_Configuration.html#cid-compatible-id Signed-off-by: Rafael J. Wysocki Reviewed-by: Andy Shevchenko Reviewed-by: Hans de Goede commit 0e6078c3c6737df7d0bd0c890fbadf24a27fffbb Author: Guo Zhengkui Date: Tue Nov 9 15:50:51 2021 +0800 ACPI: processor idle: Use swap() instead of open coding it Address the following coccicheck warning: ./drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c:914:40-41: WARNING opportunity for swap(). by using swap() for the swapping of variable values and drop the tmp variable that is not needed any more. Signed-off-by: Guo Zhengkui [ rjw: Subject and changelog rewrite ] Signed-off-by: Rafael J. Wysocki commit 6fd13452c1a2e6dfe5b9a4c84c1144383cc55472 Author: Andy Shevchenko Date: Wed Nov 10 13:16:40 2021 +0200 ACPI: processor: Replace kernel.h with the necessary inclusions When kernel.h is used in the headers it adds a lot into dependency hell, especially when there are circular dependencies are involved. Replace kernel.h inclusion with the list of what is really being used. Signed-off-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit 75f32fa3a6fbaed25ad741221ab60bb4b08d7656 Author: Sumeet Pawnikar Date: Fri Nov 12 17:30:29 2021 +0530 ACPI: DPTF: Update device ID in a comment There is a comment in dptf_pch_fivr.c which seemingly was added under the assumption that the PCH FIVR driver would be used on Tiger Lake platforms, but support for Alder Lake has been udded to it by commit 38748bcb940e ("ACPI: DPTF: Support Alder Lake"), so update the comment to cover a broader range of platforms by changing the device ID mentioned by it to INTC10xx. Signed-off-by: Sumeet Pawnikar [ rjw: Subject and changelog rewrite ] Signed-off-by: Rafael J. Wysocki commit 5b6a8f1445bc86e221da85bb67f389c3ab6d2037 Author: Rafael J. Wysocki Date: Tue Nov 16 21:06:17 2021 +0100 ACPI: PM: Emit debug messages when enabling/disabling wakeup power Print additional debug messages when enabling and disabling wakeup power for an ACPI device object to facilitate more fine-grained debugging of problems in that area. Signed-off-by: Rafael J. Wysocki commit 14e6c70671858401d7ffb93aeeb41e8dc4bb467e Author: Jason Wang Date: Sat Nov 13 14:06:18 2021 +0800 cpuidle: menu: Fix typo in a comment The word `these' in a comment is repeated, so drop one. Signed-off-by: Jason Wang [ rjw: Changelog edits ] Signed-off-by: Rafael J. Wysocki commit 899663be5e75dc0174dc8bda0b5e6826edf0b29a Author: Brian Gix Date: Wed Nov 24 12:16:28 2021 -0800 Bluetooth: refactor malicious adv data check Check for out-of-bound read was being performed at the end of while num_reports loop, and would fill journal with false positives. Added check to beginning of loop processing so that it doesn't get checked after ptr has been advanced. Signed-off-by: Brian Gix Signed-off-by: Marcel Holtmann commit d7fbdc575b33c374ce88ccfe3ab364f7eb240f8a Author: ran jianping Date: Fri Nov 12 09:09:46 2021 +0000 thermal: tools: tmon: remove unneeded local variable Fix the following coccicheck review: /tools/thermal/tmon/pid.c:57:5-8: Unneeded variable Remove unneeded variable used to store return value. Reported-by: Zeal Robot Signed-off-by: ran jianping Signed-off-by: Rafael J. Wysocki commit 21a241b3bc153b346987a28cc132674646589e02 Author: tjiang@codeaurora.org Date: Tue Nov 16 19:02:16 2021 +0800 Bluetooth: btusb: Add the new support IDs for WCN6855 Add the more IDs of HP to usb_device_id table for WCN6855. -Device(0489:e0cc) from /sys/kernel/debug/usb/devices T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=12 MxCh= 0 D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=0489 ProdID=e0cc Rev= 0.01 C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms I: If#= 1 Alt= 6 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 63 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 63 Ivl=1ms I: If#= 1 Alt= 7 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 65 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 65 Ivl=1ms -Device(0489:e0d6) from /sys/kernel/debug/usb/devices T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=12 MxCh= 0 D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=0489 ProdID=e0d6 Rev= 0.01 C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms I: If#= 1 Alt= 6 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 63 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 63 Ivl=1ms I: If#= 1 Alt= 7 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 65 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 65 Ivl=1ms Signed-off-by: Tim Jiang Signed-off-by: Marcel Holtmann commit 741268adb34061c28d8236dd67217f0df580c930 Author: tjiang@codeaurora.org Date: Tue Nov 16 12:48:49 2021 +0800 Bluetooth: btusb: re-definition for board_id in struct qca_version The board ID should be split into two bytes. The 1st byte is chip ID, and the 2nd byte is platform ID. For example, board ID 0x010A, 0x01 is platform ID. 0x0A is chip ID. we have several platforms, and platform IDs are continuously added. We would not distinguish different chips if we get these mixed up. Platform ID: 0x00 is for Mobile 0x01 is for X86 0x02 is for Automotive 0x03 is for Consumer electronic Signed-off-by: Tim Jiang Signed-off-by: Marcel Holtmann commit 27fe097bc60a344ccd8107522184c2750f45df5c Author: Larry Finger Date: Sun Nov 21 10:51:48 2021 -0600 Bluetooth: btusb: Add one more Bluetooth part for the Realtek RTL8852AE The Realtek RTL8852AE has both wifi and BT components. The latter reports a USB ID of 0bda:385a, which is not in the table. The portion of /sys/kernel/debug/usb/devices pertaining to this device is T: Bus=01 Lev=01 Prnt=01 Port=03 Cnt=02 Dev#= 3 Spd=12 MxCh= 0 D: Ver= 1.00 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=0bda ProdID=385a 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 d555b1f2c333d442ae9c84760d698f38796e459e Author: Sean Wang Date: Sat Nov 20 06:25:43 2021 +0800 Bluetooth: btmtksdio: drop the unnecessary variable created Use the existent variable to drop the unnecessary variable created. Signed-off-by: Sean Wang Signed-off-by: Marcel Holtmann commit db57b625912abc755b3172f59b13b947db69cc4c Author: Sean Wang Date: Sat Nov 20 06:25:46 2021 +0800 Bluetooth: btmtksdio: add support of processing firmware coredump and log Add support of processing the firmware coredump and log for the diagnostic purpose. Co-developed-by: Mark-yw Chen Signed-off-by: Mark-yw Chen Signed-off-by: Sean Wang Signed-off-by: Marcel Holtmann commit 2338e7bcef445059a99848a3eddde0b556277663 Author: Heikki Krogerus Date: Mon Nov 15 15:10:01 2021 +0300 device property: Remove device_add_properties() API There are no more users for it. Reviewed-by: Andy Shevchenko Signed-off-by: Heikki Krogerus Signed-off-by: Rafael J. Wysocki commit 982b94ba0983bee504cdd317428cc012c8405c78 Author: Heikki Krogerus Date: Mon Nov 15 15:10:00 2021 +0300 driver core: Don't call device_remove_properties() from device_del() All the drivers that relied on device_del() to call device_remove_properties() have now been converted to either use device_create_managed_software_node() instead of device_add_properties(), or to register the software node completely separately from the device. This will make it finally possible to share and reuse the software nodes that hold the additional device properties. Signed-off-by: Heikki Krogerus Reviewed-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki commit 0c9e032a45e777b707bd8ae282242a2b9be3ac91 Author: Heikki Krogerus Date: Mon Nov 15 15:09:59 2021 +0300 PCI: Convert to device_create_managed_software_node() In quirk_huawei_pcie_sva(), device_add_properties() is used to inject additional device properties, but there is no device_remove_properties() call anywhere to remove those properties. The assumption is most likely that the device is never removed, and the properties therefore do not also never need to be removed. Even though it is unlikely that the device is ever removed in this case, it is safer to make sure that the properties are also removed if the device ever does get unregistered. To achieve this, instead of adding a separate quirk for the case of device removal where device_remove_properties() is called, using device_create_managed_software_node() instead of device_add_properties(). Both functions create a software node (a type of fwnode) that holds the device properties, which is then assigned to the device very much the same way. The difference between the two functions is, that device_create_managed_software_node() guarantees that the software node (together with the properties) is removed when the device is removed. The function device_add_property() does not guarantee that, so the properties added with it should always be removed with device_remove_properties(). Reviewed-by: Andy Shevchenko Acked-by: Zhangfei Gao Acked-by: Bjorn Helgaas Signed-off-by: Heikki Krogerus Signed-off-by: Rafael J. Wysocki commit d156250018ab5adbcfcc9ea90455d5fba5df6769 Merge: 45932221bd948 db596298edbf1 Author: David S. Miller Date: Wed Nov 24 14:12:26 2021 +0000 Merge branch 'hns3-next' Guangbin Huang says: ==================== net: hns3: updates for -next This series includes some updates for the HNS3 ethernet driver. ==================== Signed-off-by: David S. Miller commit db596298edbf18c8a0d2778ca4d76ee09ed761f6 Author: Yufeng Mo Date: Wed Nov 24 09:06:54 2021 +0800 net: hns3: add dql info when tx timeout When tx timeout occurs, the info of dql maybe helpful, so print these info to hns3_get_tx_timeo_queue_info(). Signed-off-by: Yufeng Mo Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 8488e3c682147f60d592b03bc69eaea0fbe1ebcf Author: Jie Wang Date: Wed Nov 24 09:06:53 2021 +0800 net: hns3: debugfs add drop packet statistics of multicast and broadcast for igu Currently, there is no way to get drop packet number of multicast and broadcast in IGU hardware module, it is not convenient to find problem when multicast packet or broadcast packet is dropped in IGU, so this patch adds statistics for them in debugfs. Signed-off-by: Jie Wang Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 4f331fda35f1695af8ddd8180edc948880def74b Author: Yufeng Mo Date: Wed Nov 24 09:06:52 2021 +0800 net: hns3: format the output of the MAC address Printing the whole MAC addresse may bring security risks. Therefore, the MAC address is partially encrypted to improve security. Signed-off-by: Yufeng Mo Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit d9069dab207534d9f6f41993ee78a651733becea Author: Yufeng Mo Date: Wed Nov 24 09:06:51 2021 +0800 net: hns3: add log for workqueue scheduled late When the mbx or reset message arrives, the driver is informed through an interrupt. This task can be processed only after the workqueue is scheduled. In some cases, this workqueue scheduling takes a long time. As a result, the mbx or reset service task cannot be processed in time. So add some warning message to improve debugging efficiency for this case. Signed-off-by: Yufeng Mo Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 764cedc5638b0565de140575b90ce24983f2b664 Author: Kees Cook Date: Thu Nov 18 10:37:20 2021 -0800 thermal: int340x: Use struct_group() for memcpy() region In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memcpy(), avoid intentionally writing across neighboring fields. Use struct_group() in struct art around members weight, and ac[0-9]_max, so they can be referenced together. This will allow memcpy() and sizeof() to more easily reason about sizes, improve readability, and avoid future warnings about writing beyond the end of weight. "pahole" shows no size nor member offset changes to struct art. "objdump -d" shows no meaningful object code changes (i.e. only source line number induced differences). Signed-off-by: Kees Cook Reviewed-by: Srinivas Pandruvada Signed-off-by: Rafael J. Wysocki commit b79332ef9d61513d0ccda74a5161bb7c31851e9c Author: Andy Shevchenko Date: Tue Nov 23 19:00:32 2021 +0200 spi: Fix condition in the __spi_register_driver() The recent commit 3f07657506df ("spi: deduplicate spi_match_id() in __spi_register_driver()") inadvertently inverted a condition that provokes a (harmless) warning: WARNING KERN SPI driver mtd_dataflash has no spi_device_id for atmel,at45 Restore logic to avoid such warning to be issued. Fixes: 3f07657506df ("spi: deduplicate spi_match_id() in __spi_register_driver()") Reported-by: Jon Hunter Signed-off-by: Andy Shevchenko Tested-by: Jon Hunter Link: https://lore.kernel.org/r/20211123170034.41253-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit fffc84fd87d963a2ea77a125b8a6f5a3c9f3192d Author: Javier Martinez Canillas Date: Tue Nov 9 23:59:20 2021 +0100 spi: spidev: Make probe to fail early if a spidev compatible is used Some Device Trees don't use a real device name in the compatible string for SPI devices nodes, abusing the fact that the spidev driver name is used to match as a fallback when a SPI device ID table is not defined. But since commit 6840615f85f6 ("spi: spidev: Add SPI ID table") a table for SPI device IDs was added to the driver breaking the assumption that these DTs were relying on. There has been a warning message for some time since commit 956b200a846e ("spi: spidev: Warn loudly if instantiated from DT as "spidev""), making quite clear that this case is not really supported by the spidev driver. Since these devices won't match anyways after the mentioned commit, there is no point to continue if an spidev compatible is used. Let's just make the driver probe to fail early. Signed-off-by: Javier Martinez Canillas Link: https://lore.kernel.org/r/20211109225920.1158920-1-javierm@redhat.com Signed-off-by: Mark Brown commit 432dd1fc134ef902b049b26839edfd3fdc1f8dc0 Author: Matti Vaittinen Date: Wed Nov 24 07:57:49 2021 +0200 regulator: rohm-generic: remove unused dummies Function rohm_regulator_set_voltage_sel_restricted() and rohm_regulator_set_dvs_levels() had inlined dummy implementations for cases when the real implementation was not configured in. All of the drivers who issue the call to these functions do SELECT the real implementation from the Kconfig. There should be no cases where the real implementation was not selected by the drivers using these functions - such a situation is likely to be an error which deserves to be noticed at compile-time. These dummies could in theory be used for compile-testing the drivers only (without the generic rohm regulator pieces). However, for such compile testing we should manually drop the selection from KConfig - and I guess that if it does not work out-of-the-box, then it is not going to happen. Especially when there should be no reason to omit compile-testing the generic rohm_regulator part. Crash test dummies. Signed-off-by: Matti Vaittinen Link: https://lore.kernel.org/r/YZ3UXXrk/Efe7Scj@fedora Signed-off-by: Mark Brown commit a764ff77d697a4a13e69b3379cc613f7409c6b9a Author: Matti Vaittinen Date: Wed Nov 24 09:17:13 2021 +0200 regulator: irq_helper: Provide helper for trivial IRQ notifications Provide a generic map_event helper for regulators which have a notification IRQ with single, well defined purpose. Eg, IRQ always indicates exactly one event for exactly one regulator device. For such IRQs the mapping is trivial. Signed-off-by: Matti Vaittinen Link: https://lore.kernel.org/r/603b7ed1938013a00371c1e7ccc63dfb16982b87.1637736436.git.matti.vaittinen@fi.rohmeurope.com Signed-off-by: Mark Brown commit 6fadec4c5561e2fbe1dfa8a7da9bc58d094a8f04 Author: Matti Vaittinen Date: Wed Nov 24 09:16:45 2021 +0200 regulator: Add regulator_err2notif() helper Help drivers avoid storing both supported notification and supported error flags by supporting conversion from regulator error to notification. This may help saving some bytes. Add helper for finding the regulator notification corresponding to a regulator error. Signed-off-by: Matti Vaittinen Link: https://lore.kernel.org/r/eb1755ac0569ff07ffa466cf8912c6fd50e7c7c6.1637736436.git.matti.vaittinen@fi.rohmeurope.com Signed-off-by: Mark Brown commit 1b6ed6bf32fb22ef8e3572fc9c0f6454adf1ca40 Author: Matti Vaittinen Date: Wed Nov 24 09:17:37 2021 +0200 regulator: Drop unnecessary struct member The irq_flags from the regulator IRQ helper description struct was never used. The IRQ flags are passed as parameters to helper registration instead. Remove the unnecessary struct field. Fixes: 7111c6d1b31b ("regulator: IRQ based event/error notification helpers") Signed-off-by: Matti Vaittinen Link: https://lore.kernel.org/r/5f6371e178453fa2b165da50452f7db4e986debb.1637736436.git.matti.vaittinen@fi.rohmeurope.com Signed-off-by: Mark Brown commit 96da174024b9c63bd5d3358668d0bc12677be877 Author: Ranjani Sridharan Date: Tue Nov 23 19:16:06 2021 +0200 ASoC: SOF: handle paused streams during system suspend During system suspend, paused streams do not get suspended. Therefore, we need to explicitly free these PCMs in the DSP and free the associated DAPM widgets so that they can be set up again during resume. Fixes: 5fcdbb2d45df ("ASoC: SOF: Add support for dynamic pipelines") Signed-off-by: Ranjani Sridharan Reviewed-by: Paul Olaru Reviewed-by: Bard Liao Reviewed-by: Pierre-Louis Bossart Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20211123171606.129350-3-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit fb71d03b29bcbd8c03798d36e7b2a2297b6dea45 Author: Pierre-Louis Bossart Date: Tue Nov 23 19:16:05 2021 +0200 ASoC: SOF: topology: don't use list_for_each_entry_reverse() It's not clear why we would walk the list backwards. That makes no difference. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20211123171606.129350-2-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit 01429183f479c54c1b5d15453a8ce574ea43e525 Author: Pierre-Louis Bossart Date: Tue Nov 23 19:16:04 2021 +0200 ASoC: SOF: sof-audio: setup sched widgets during pipeline complete step Older firmware prior to ABI 3.19 has a dependency where the scheduler widgets need to be setup last. Moving the call to sof_widget_setup() before the pipeline_complete() call also helps remove the need for the 'reverse' direction when walking through the widget list - this was only working because of the topology macros but the topology does not require any order. Fixes: 5fcdbb2d45df ("ASoC: SOF: Add support for dynamic pipelines") Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20211123171606.129350-1-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit 6c26b5054ce2b822856e32f1840d13f777c6f295 Author: Ranjani Sridharan Date: Fri Nov 19 17:08:52 2021 -0600 ASoC: SOF: Intel: add .ack support for HDaudio platforms When we disable rewinds, then the .ack can be used to program SPIB with the application pointer, which allows the HDaudio DMA to save power by opportunistically bursting data transfers when the path to memory is enabled (and conversely to shut it down when there are no transfer requests). The SPIB register can only be programmed with incremental values with wrap-around after the DMA RUN bits are set. For simplicity, we set the INFO_NO_REWINDS flag in the .open callback when we already need to program the SNDRV_PCM_INFO_SYNC_APPLPTR flag. Rewinds are not used by many applications. One notable application using rewinds is PulseAudio. Practical experiments with Ubuntu/PulseAudio default settings did not show any audible issues, but the user may hear volume changes and notification with a delay, depending on the size of the ring buffer and latency constraints. The choice of disabling rewinds is exposed as a kernel parameter and not a Kconfig option to avoid any undesirable side-effects. Reviewed-by: Péter Ujfalusi Reviewed-by: Kai Vehmanen Co-developed-by: Pierre-Louis Bossart Signed-off-by: Pierre-Louis Bossart Signed-off-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20211119230852.206310-5-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 4a39ea3f07f14f21a6b97e78c972f71fc5761d3a Author: Ranjani Sridharan Date: Fri Nov 19 17:08:51 2021 -0600 ASoC: SOF: pcm: add .ack callback support Add the indirections required at the core level for platform-specific operations on ack. Note that on errors in the .ack the ALSA core will restore the previous appl_ptr. Reviewed-by: Péter Ujfalusi Reviewed-by: Kai Vehmanen Signed-off-by: Ranjani Sridharan Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20211119230852.206310-4-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit b456abe63f60ad93c83a526d33b71574bc32656c Author: Pierre-Louis Bossart Date: Fri Nov 19 17:08:50 2021 -0600 ALSA: pcm: introduce INFO_NO_REWINDS flag When the hardware can only deal with a monotonically increasing appl_ptr, this flag can be set. In case the application requests a rewind, be it with a snd_pcm_rewind() or with a direct change of a mmap'ed pointer followed by a SNDRV_PCM_IOCTL_SYNC_PTR, this patch checks if a rewind occurred and returns an error. Credits to Takashi Iwai for identifying the path with SYNC_PTR and suggesting the pointer checks. Suggested-by: Takashi Iwai Reviewed-by: Takashi Iwai Reviewed-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20211119230852.206310-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 0e888a74e52db369e19aec908131cf171079b306 Author: Pierre-Louis Bossart Date: Fri Nov 19 17:08:49 2021 -0600 ALSA: pcm: unconditionally check if appl_ptr is in 0..boundary range In some cases, the appl_ptr passed by userspace is not checked before being used. This patch adds an unconditional check and returns an error code should the appl_ptr exceed the ALSA 'boundary'. Suggested-by: Takashi Iwai Reviewed-by: Takashi Iwai Reviewed-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20211119230852.206310-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit 393c3714081a53795bbff0e985d24146def6f57f Author: Minchan Kim Date: Thu Nov 18 15:00:08 2021 -0800 kernfs: switch global kernfs_rwsem lock to per-fs lock The kernfs implementation has big lock granularity(kernfs_rwsem) so every kernfs-based(e.g., sysfs, cgroup) fs are able to compete the lock. It makes trouble for some cases to wait the global lock for a long time even though they are totally independent contexts each other. A general example is process A goes under direct reclaim with holding the lock when it accessed the file in sysfs and process B is waiting the lock with exclusive mode and then process C is waiting the lock until process B could finish the job after it gets the lock from process A. This patch switches the global kernfs_rwsem to per-fs lock, which put the rwsem into kernfs_root. Suggested-by: Tejun Heo Acked-by: Tejun Heo Signed-off-by: Minchan Kim Link: https://lore.kernel.org/r/20211118230008.2679780-1-minchan@kernel.org Signed-off-by: Greg Kroah-Hartman commit 0bae5687bc689b64343fd8b52db2ad9e448f3f16 Author: Hsin-Yi Wang Date: Fri Nov 19 03:30:02 2021 +0800 drm/bridge: anx7625: Fix edid_read break case in sp_tx_edid_read() edid_read() was assumed to return 0 on success. After commit 7f16d0f3b8e2("drm/bridge: anx7625: Propagate errors from sp_tx_rst_aux()"), the function will return > 0 for successful case, representing the i2c read bytes. Otherwise -EIO on failure cases. Update the g_edid_break break condition accordingly. Fixes: 7f16d0f3b8e2("drm/bridge: anx7625: Propagate errors from sp_tx_rst_aux()") Signed-off-by: Hsin-Yi Wang Reviewed-by: Robert Foss Reviewed-by: Xin Ji Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20211118193002.407168-1-hsinyi@chromium.org commit 45932221bd948c635a09a4075c189d25bfcc7449 Author: Jiapeng Chong Date: Wed Nov 24 18:09:56 2021 +0800 lan78xx: Clean up some inconsistent indenting Eliminate the follow smatch warning: drivers/net/usb/lan78xx.c:4961 lan78xx_resume() warn: inconsistent indenting. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: David S. Miller commit 86c82c8aeebf6db5df8ab73cec8333853c405070 Author: Stanislav Lisovskiy Date: Wed Nov 24 11:23:55 2021 +0200 Revert "drm/i915/dg2: Tile 4 plane format support" Tile4 patch still needs an ack from userspace, IGT tests and some essential fixes, related to new .plane_caps attribute being added. This reverts commit 3c542cfa8266e3364938d055b3d548b7bed7f08e. Signed-off-by: Stanislav Lisovskiy Acked-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20211124092355.16668-1-stanislav.lisovskiy@intel.com commit 9c5a432a558105d6145b058fad78eb6fcf3d4c38 Author: Nicholas Piggin Date: Tue Nov 23 19:52:31 2021 +1000 KVM: PPC: Book3S HV P9: Remove subcore HMI handling On POWER9 and newer, rather than the complex HMI synchronisation and subcore state, have each thread un-apply the guest TB offset before calling into the early HMI handler. This allows the subcore state to be avoided, including subcore enter / exit guest, which includes an expensive divide that shows up slightly in profiles. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-54-npiggin@gmail.com commit 6398326b9ba182936bdc9d66475c09e39b701aa2 Author: Nicholas Piggin Date: Tue Nov 23 19:52:30 2021 +1000 KVM: PPC: Book3S HV P9: Stop using vc->dpdes The P9 path uses vc->dpdes only for msgsndp / SMT emulation. This adds an ordering requirement between vcpu->doorbell_request and vc->dpdes for no real benefit. Use vcpu->doorbell_request directly. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-53-npiggin@gmail.com commit 617326ff01df30796d897895ebd18ce583c9b883 Author: Nicholas Piggin Date: Tue Nov 23 19:52:29 2021 +1000 KVM: PPC: Book3S HV P9: Tidy kvmppc_create_dtl_entry This goes further to removing vcores from the P9 path. Also avoid the memset in favour of explicitly initialising all fields. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-52-npiggin@gmail.com commit ecb6a7207f92e33c2b7a1271165ecf5d8f420bba Author: Nicholas Piggin Date: Tue Nov 23 19:52:28 2021 +1000 KVM: PPC: Book3S HV P9: Remove most of the vcore logic The P9 path always uses one vcpu per vcore, so none of the vcore, locks, stolen time, blocking logic, shared waitq, etc., is required. Remove most of it. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-51-npiggin@gmail.com commit 434398ab5eed03dbc0075af9436e871712bfb45a Author: Nicholas Piggin Date: Tue Nov 23 19:52:27 2021 +1000 KVM: PPC: Book3S HV P9: Avoid cpu_in_guest atomics on entry and exit cpu_in_guest is set to determine if a CPU needs to be IPI'ed to exit the guest and notice the need_tlb_flush bit. This can be implemented as a global per-CPU pointer to the currently running guest instead of per-guest cpumasks, saving 2 atomics per entry/exit. P7/8 doesn't require cpu_in_guest, nor does a nested HV (only the L0 does), so move it to the P9 HV path. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-50-npiggin@gmail.com commit 4c9a68914eab1f17f6c428c579ffd75c4448461e Author: Nicholas Piggin Date: Tue Nov 23 19:52:26 2021 +1000 KVM: PPC: Book3S HV P9: Add unlikely annotation for !mmu_ready The mmu will almost always be ready. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-49-npiggin@gmail.com commit f08cbf5c7d1f86f12143a1dce23740411b03a807 Author: Nicholas Piggin Date: Tue Nov 23 19:52:25 2021 +1000 KVM: PPC: Book3S HV P9: Avoid changing MSR[RI] in entry and exit kvm_hstate.in_guest provides the equivalent of MSR[RI]=0 protection, and it covers the existing MSR[RI]=0 section in late entry and early exit, so clearing and setting MSR[RI] in those cases does not actually do anything useful. Remove the RI manipulation and replace it with comments. Make the in_guest memory accesses a bit closer to a proper critical section pattern. This speeds up guest entry/exit performance. This also removes the MSR[RI] warnings which aren't very interesting and would cause crashes if they hit due to causing an interrupt in non-recoverable code. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-48-npiggin@gmail.com commit 241d1f19f0e5c257881a0661f201b51dc3e57f8c Author: Nicholas Piggin Date: Tue Nov 23 19:52:24 2021 +1000 KVM: PPC: Book3S HV P9: Optimise hash guest SLB saving slbmfee/slbmfev instructions are very expensive, moreso than a regular mfspr instruction, so minimising them significantly improves hash guest exit performance. The slbmfev is only required if slbmfee found a valid SLB entry. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-47-npiggin@gmail.com commit b49c65c5f9f1dac4ef1764578ad55bacf526eb38 Author: Nicholas Piggin Date: Tue Nov 23 19:52:23 2021 +1000 KVM: PPC: Book3S HV P9: Improve mfmsr performance on entry Rearrange the MSR saving on entry so it does not follow the mtmsrd to disable interrupts, avoiding a possible RAW scoreboard stall. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-46-npiggin@gmail.com commit 46dea77f790c1e7ab2e9f7452e34de0dc5da9b13 Author: Nicholas Piggin Date: Tue Nov 23 19:52:22 2021 +1000 KVM: PPC: Book3S HV Nested: Avoid extra mftb() in nested entry mftb() is expensive and one can be avoided on nested guest dispatch. If the time checking code distinguishes between the L0 timer and the nested HV timer, then both can be tested in the same place with the same mftb() value. This also nicely illustrates the relationship between the L0 and nested HV timers. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-45-npiggin@gmail.com commit d5c0e8332d82c04deee25dd6f28c5bbe84d49a73 Author: Nicholas Piggin Date: Tue Nov 23 19:52:21 2021 +1000 KVM: PPC: Book3S HV P9: Avoid tlbsync sequence on radix guest exit Use the existing TLB flushing logic to IPI the previous CPU and run the necessary barriers before running a guest vCPU on a new physical CPU, to do the necessary radix GTSE barriers for handling the case of an interrupted guest tlbie sequence. This requires the vCPU TLB flush sequence that is currently just done on one thread, to be expanded to ensure the other threads execute a ptesync, because causing them to exit the guest will no longer cause a ptesync by itself. This results in more IPIs than the TLB flush logic requires, but it's a significant win for common case scheduling when the vCPU remains on the same physical CPU. This saves about 520 cycles (nearly 10%) on a guest entry+exit micro benchmark on a POWER9. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-44-npiggin@gmail.com commit 0ba0e5d5a691806cca3d4f290dcc61f656049872 Author: Nicholas Piggin Date: Tue Nov 23 19:52:20 2021 +1000 KVM: PPC: Book3S HV: Split P8 from P9 path guest vCPU TLB flushing This creates separate functions for old and new paths for vCPU TLB flushing, which will reduce complexity of the next change. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-43-npiggin@gmail.com commit a089a6869e7f613a8d961ac65bafd127317e4c5c Author: Nicholas Piggin Date: Tue Nov 23 19:52:19 2021 +1000 KVM: PPC: Book3S HV P9: Don't restore PSSCR if not needed This also moves the PSSCR update in nested entry to avoid a SPR scoreboard stall. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-42-npiggin@gmail.com commit 9c75f65f3583b0cf467c378a1076f0b50bbc2fb1 Author: Nicholas Piggin Date: Tue Nov 23 19:52:18 2021 +1000 KVM: PPC: Book3S HV P9: Test dawr_enabled() before saving host DAWR SPRs Some of the DAWR SPR access is already predicated on dawr_enabled(), apply this to the remainder of the accesses. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-41-npiggin@gmail.com commit cf3b16cfa6503b1fe5e680f9711262e6a51ef097 Author: Nicholas Piggin Date: Tue Nov 23 19:52:17 2021 +1000 KVM: PPC: Book3S HV P9: Comment and fix MMU context switching code Tighten up partition switching code synchronisation and comments. In particular, hwsync ; isync is required after the last access that is performed in the context of a partition, before the partition is switched away from. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-40-npiggin@gmail.com commit 5236756d04454c7ce9f45e27b434d75b8d6f8759 Author: Nicholas Piggin Date: Tue Nov 23 19:52:16 2021 +1000 KVM: PPC: Book3S HV P9: Use Linux SPR save/restore to manage some host SPRs Linux implements SPR save/restore including storage space for registers in the task struct for process context switching. Make use of this similarly to the way we make use of the context switching fp/vec save restore. This improves code reuse, allows some stack space to be saved, and helps with avoiding VRSAVE updates if they are not required. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-39-npiggin@gmail.com commit 022ecb960c89faad42ff0b417a71d9255dd115a3 Author: Nicholas Piggin Date: Tue Nov 23 19:52:15 2021 +1000 KVM: PPC: Book3S HV P9: Demand fault TM facility registers Use HFSCR facility disabling to implement demand faulting for TM, with a hysteresis counter similar to the load_fp etc counters in context switching that implement the equivalent demand faulting for userspace facilities. This speeds up guest entry/exit by avoiding the register save/restore when a guest is not frequently using them. When a guest does use them often, there will be some additional demand fault overhead, but these are not commonly used facilities. Signed-off-by: Nicholas Piggin Reviewed-by: Fabiano Rosas Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-38-npiggin@gmail.com commit a3e18ca8ab6f7f2260978f0a3842845414d799c0 Author: Nicholas Piggin Date: Tue Nov 23 19:52:14 2021 +1000 KVM: PPC: Book3S HV P9: Demand fault EBB facility registers Use HFSCR facility disabling to implement demand faulting for EBB, with a hysteresis counter similar to the load_fp etc counters in context switching that implement the equivalent demand faulting for userspace facilities. This speeds up guest entry/exit by avoiding the register save/restore when a guest is not frequently using them. When a guest does use them often, there will be some additional demand fault overhead, but these are not commonly used facilities. Signed-off-by: Nicholas Piggin Reviewed-by: Fabiano Rosas Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-37-npiggin@gmail.com commit 34e02d555d8fa36cc756a083de1eeb56edab0e00 Author: Nicholas Piggin Date: Tue Nov 23 19:52:13 2021 +1000 KVM: PPC: Book3S HV P9: More SPR speed improvements This avoids more scoreboard stalls and reduces mtSPRs. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-36-npiggin@gmail.com commit d55b1eccc7aa14a1750aecf271806365478ca805 Author: Nicholas Piggin Date: Tue Nov 23 19:52:12 2021 +1000 KVM: PPC: Book3S HV P9: Restrict DSISR canary workaround to processors that require it Use CPU_FTR_P9_RADIX_PREFETCH_BUG to apply the workaround, to test for DD2.1 and below processors. This saves a mtSPR in guest entry. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-35-npiggin@gmail.com commit 3e7b3379023dad2e78c3200373a6368f5d0ee599 Author: Nicholas Piggin Date: Tue Nov 23 19:52:11 2021 +1000 KVM: PPC: Book3S HV P9: Switch PMU to guest as late as possible This moves PMU switch to guest as late as possible in entry, and switch back to host as early as possible at exit. This helps the host get the most perf coverage of KVM entry/exit code as possible. This is slightly suboptimal for SPR scheduling point of view when the PMU is enabled, but when perf is disabled there is no real difference. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-34-npiggin@gmail.com commit 3f9e2966d1b0dd81bcfaeb816335e0ddeedde3c1 Author: Nicholas Piggin Date: Tue Nov 23 19:52:10 2021 +1000 KVM: PPC: Book3S HV P9: Implement TM fastpath for guest entry/exit If TM is not active, only TM register state needs to be saved and restored, avoiding several mfmsr/mtmsrd instructions and improving performance. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-33-npiggin@gmail.com commit d5f480194577423731ee8413791a5486f26a95ab Author: Nicholas Piggin Date: Tue Nov 23 19:52:09 2021 +1000 KVM: PPC: Book3S HV P9: Move remaining SPR and MSR access into low level entry Move register saving and loading from kvmhv_p9_guest_entry() into the HV and nested entry handlers. Accesses are scheduled to reduce mtSPR / mfSPR interleaving which reduces SPR scoreboard stalls. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-32-npiggin@gmail.com commit 08b3f08af583c01b3cfdc15bda68063c2a401512 Author: Nicholas Piggin Date: Tue Nov 23 19:52:08 2021 +1000 KVM: PPC: Book3S HV P9: Move nested guest entry into its own function Move the part of the guest entry which is specific to nested HV into its own function. This is just refactoring. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-31-npiggin@gmail.com commit aabcaf6ae2a0912898bd243f0aec0ce6853983fc Author: Nicholas Piggin Date: Tue Nov 23 19:52:07 2021 +1000 KVM: PPC: Book3S HV P9: Move host OS save/restore functions to built-in Move the P9 guest/host register switching functions to the built-in P9 entry code, and export it for nested to use as well. This allows more flexibility in scheduling these supervisor privileged SPR accesses with the HV privileged and PR SPR accesses in the low level entry code. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-30-npiggin@gmail.com commit 516b334210b831827e0491676625323f484275dd Author: Nicholas Piggin Date: Tue Nov 23 19:52:06 2021 +1000 KVM: PPC: Book3S HV P9: Move vcpu register save/restore into functions This should be no functional difference but makes the caller easier to read. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-29-npiggin@gmail.com commit 0f3b6c4851aef7a98b435c6f08b2c9c88165d254 Author: Nicholas Piggin Date: Tue Nov 23 19:52:05 2021 +1000 KVM: PPC: Book3S HV P9: Juggle SPR switching around This juggles SPR switching on the entry and exit sides to be more symmetric, which makes the next refactoring patch possible with no functional change. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-28-npiggin@gmail.com commit 9dfe7aa7bc50556063c8658f59ad475131c09b65 Author: Nicholas Piggin Date: Tue Nov 23 19:52:04 2021 +1000 KVM: PPC: Book3S HV P9: Only execute mtSPR if the value changed Keep better track of the current SPR value in places where they are to be loaded with a new context, to reduce expensive mtSPR operations. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-27-npiggin@gmail.com commit 9a1e530bbbdaa2184993a7d7fc61d78871540ccd Author: Nicholas Piggin Date: Tue Nov 23 19:52:03 2021 +1000 KVM: PPC: Book3S HV P9: Avoid SPR scoreboard stalls Avoid interleaving mfSPR and mtSPR to reduce SPR scoreboard stalls. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-26-npiggin@gmail.com commit cb2553a093093ae46cfaee31321bcedcd0312c5d Author: Nicholas Piggin Date: Tue Nov 23 19:52:02 2021 +1000 KVM: PPC: Book3S HV P9: Optimise timebase reads Reduce the number of mfTB executed by passing the current timebase around entry and exit code rather than read it multiple times. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-25-npiggin@gmail.com commit 6547af3eba88e4806e853fee7547031b2cc6a560 Author: Nicholas Piggin Date: Tue Nov 23 19:52:01 2021 +1000 KVM: PPC: Book3S HV P9: Move TB updates Move the TB updates between saving and loading guest and host SPRs, to improve scheduling by keeping issue-NTC operations together as much as possible. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-24-npiggin@gmail.com commit 3c1a4322bba79aad2d3f6f996b7e1c336bd909b3 Author: Nicholas Piggin Date: Tue Nov 23 19:52:00 2021 +1000 KVM: PPC: Book3S HV: Change dec_expires to be relative to guest timebase Change dec_expires to be relative to the guest timebase, and allow it to be moved into low level P9 guest entry functions, to improve SPR access scheduling. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-23-npiggin@gmail.com commit cf99dedb4b2d2a18e004b1c84852fffa810dc44c Author: Nicholas Piggin Date: Tue Nov 23 19:51:59 2021 +1000 KVM: PPC: Book3S HV P9: Add kvmppc_stop_thread to match kvmppc_start_thread Small cleanup makes it a bit easier to match up entry and exit operations. Signed-off-by: Nicholas Piggin Reviewed-by: Fabiano Rosas Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-22-npiggin@gmail.com commit 2251fbe76395e4d89c31099984714c5f1135f052 Author: Nicholas Piggin Date: Tue Nov 23 19:51:58 2021 +1000 KVM: PPC: Book3S HV P9: Improve mtmsrd scheduling by delaying MSR[EE] disable Moving the mtmsrd after the host SPRs are saved and before the guest SPRs start to be loaded can prevent an SPR scoreboard stall (because the mtmsrd is L=1 type which does not cause context synchronisation. This is also now more convenient to combined with the mtmsrd L=0 instruction to enable facilities just below, but that is not done yet. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-21-npiggin@gmail.com commit 34e119c96b2b381278d1ddf6b1708678462daba4 Author: Nicholas Piggin Date: Tue Nov 23 19:51:57 2021 +1000 KVM: PPC: Book3S HV P9: Reduce mtmsrd instructions required to save host SPRs This reduces the number of mtmsrd required to enable facility bits when saving/restoring registers, by having the KVM code set all bits up front rather than using individual facility functions that set their particular MSR bits. Signed-off-by: Nicholas Piggin Reviewed-by: Fabiano Rosas Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-20-npiggin@gmail.com commit 174a3ab633392859888fc1a5cff278d5546d8474 Author: Nicholas Piggin Date: Tue Nov 23 19:51:56 2021 +1000 KVM: PPC: Book3S HV P9: Move SPRG restore to restore_p9_host_os_sprs Move the SPR update into its relevant helper function. This will help with SPR scheduling improvements in later changes. Signed-off-by: Nicholas Piggin Reviewed-by: Fabiano Rosas Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-19-npiggin@gmail.com commit a1a19e1154e4e9c6c1136474cb040657b1c17817 Author: Nicholas Piggin Date: Tue Nov 23 19:51:55 2021 +1000 KVM: PPC: Book3S HV: CTRL SPR does not require read-modify-write Processors that support KVM HV do not require read-modify-write of the CTRL SPR to set/clear their thread's runlatch. Just write 1 or 0 to it. Signed-off-by: Nicholas Piggin Reviewed-by: Fabiano Rosas Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-18-npiggin@gmail.com commit b1adcf57ceca7eab9bfdafc754802e05e634bfcc Author: Nicholas Piggin Date: Tue Nov 23 19:51:54 2021 +1000 KVM: PPC: Book3S HV P9: Factor out yield_count increment Factor duplicated code into a helper function. Signed-off-by: Nicholas Piggin Reviewed-by: Fabiano Rosas Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-17-npiggin@gmail.com commit 9d3ddb86d96d9f0314f3baaf0e37f987b40d3eee Author: Nicholas Piggin Date: Tue Nov 23 19:51:53 2021 +1000 KVM: PPC: Book3S HV P9: Demand fault PMU SPRs when marked not inuse The pmcregs_in_use field in the guest VPA can not be trusted to reflect what the guest is doing with PMU SPRs, so the PMU must always be managed (stopped) when exiting the guest, and SPR values set when entering the guest to ensure it can't cause a covert channel or otherwise cause other guests or the host to misbehave. So prevent guest access to the PMU with HFSCR[PM] if pmcregs_in_use is clear, and avoid the PMU SPR access on every partition switch. Guests that set pmcregs_in_use incorrectly or when first setting it and using the PMU will take a hypervisor facility unavailable interrupt that will bring in the PMU SPRs. Signed-off-by: Nicholas Piggin Reviewed-by: Athira Jajeev Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-16-npiggin@gmail.com commit 401e1ae372673664465d45a86975c006dc6a488d Author: Nicholas Piggin Date: Tue Nov 23 19:51:52 2021 +1000 KVM: PPC: Book3S HV P9: Factor PMU save/load into context switch functions Rather than guest/host save/retsore functions, implement context switch functions that take care of details like the VPA update for nested. The reason to split these kind of helpers into explicit save/load functions is mainly to schedule SPR access nicely, but PMU is a special case where the load requires mtSPR (to stop counters) and other difficulties, so there's less possibility to schedule those nicely. The SPR accesses also have side-effects if the PMU is running, and in later changes we keep the host PMU running as long as possible so this code can be better profiled, which also complicates scheduling. Signed-off-by: Nicholas Piggin Reviewed-by: Athira Jajeev Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-15-npiggin@gmail.com commit 57dc0eed73caa31bfe36ce8fed234e214e37a5ae Author: Nicholas Piggin Date: Tue Nov 23 19:51:51 2021 +1000 KVM: PPC: Book3S HV P9: Implement PMU save/restore in C Implement the P9 path PMU save/restore code in C, and remove the POWER9/10 code from the P7/8 path assembly. Signed-off-by: Nicholas Piggin Reviewed-by: Athira Jajeev Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-14-npiggin@gmail.com commit 0a4b4327ce867e3ac1b3ad15f4d2b686b516b3a2 Author: Nicholas Piggin Date: Tue Nov 23 19:51:50 2021 +1000 powerpc/64s: Implement PMU override command line option It can be useful in simulators (with very constrained environments) to allow some PMCs to run from boot so they can be sampled directly by a test harness, rather than having to run perf. A previous change freezes counters at boot by default, so provide a boot time option to un-freeze (plus a bit more flexibility). Signed-off-by: Nicholas Piggin Reviewed-by: Athira Jajeev Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-13-npiggin@gmail.com commit 245ebf8e7380b3d84c0aac37fbfd9306b45a3a7a Author: Nicholas Piggin Date: Tue Nov 23 19:51:49 2021 +1000 powerpc/64s: Always set PMU control registers to frozen/disabled when not in use KVM PMU management code looks for particular frozen/disabled bits in the PMU registers so it knows whether it must clear them when coming out of a guest or not. Setting this up helps KVM make these optimisations without getting confused. Longer term the better approach might be to move guest/host PMU switching to the perf subsystem. Signed-off-by: Nicholas Piggin Reviewed-by: Athira Jajeev Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-12-npiggin@gmail.com commit d3c8a2d3740d93778ea102d4c781746d284177bf Author: Nicholas Piggin Date: Tue Nov 23 19:51:48 2021 +1000 KVM: PPC: Book3S HV: Don't always save PMU for guest capable of nesting Provide a config option that controls the workaround added by commit 63279eeb7f93 ("KVM: PPC: Book3S HV: Always save guest pmu for guest capable of nesting"). The option defaults to y for now, but is expected to go away within a few releases. Nested capable guests running with the earlier commit 178266389794 ("KVM: PPC: Book3S HV Nested: Reflect guest PMU in-use to L0 when guest SPRs are live") will now indicate the PMU in-use status of their guests, which means the parent does not need to unconditionally save the PMU for nested capable guests. After this latest round of performance optimisations, this option costs about 540 cycles or 10% entry/exit performance on a POWER9 nested-capable guest. Signed-off-by: Nicholas Piggin Reviewed-by: Fabiano Rosas References: 178266389794 ("KVM: PPC: Book3S HV Nested: Reflect guest PMU in-use to L0 when guest SPRs are live") Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-11-npiggin@gmail.com commit 46f9caf1a246a5c0622fa8cc7e673658e925f97e Author: Nicholas Piggin Date: Tue Nov 23 19:51:47 2021 +1000 powerpc/64s: Keep AMOR SPR a constant ~0 at runtime This register controls supervisor SPR modifications, and as such is only relevant for KVM. KVM always sets AMOR to ~0 on guest entry, and never restores it coming back out to the host, so it can be kept constant and avoid the mtSPR in KVM guest entry. Signed-off-by: Nicholas Piggin Reviewed-by: Fabiano Rosas Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-10-npiggin@gmail.com commit eacc818864bb01828280f4d64334c4e5ae6a4daf Author: Nicholas Piggin Date: Tue Nov 23 19:51:46 2021 +1000 KVM: PPC: Book3S HV: POWER10 enable HAIL when running radix guests HV interrupts may be taken with the MMU enabled when radix guests are running. Enable LPCR[HAIL] on ISA v3.1 processors for radix guests. Make this depend on the host LPCR[HAIL] being enabled. Currently that is always enabled, but having this test means any issue that might require LPCR[HAIL] to be disabled in the host will not have to be duplicated in KVM. This optimisation takes 1380 cycles off a NULL hcall entry+exit micro benchmark on a POWER10. Signed-off-by: Nicholas Piggin Reviewed-by: Fabiano Rosas Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-9-npiggin@gmail.com commit 25aa145856cd0d94864bf501218be84a7c8062ae Author: Nicholas Piggin Date: Tue Nov 23 19:51:45 2021 +1000 powerpc/time: add API for KVM to re-arm the host timer/decrementer Rather than have KVM look up the host timer and fiddle with the irq-work internal details, have the powerpc/time.c code provide a function for KVM to re-arm the Linux timer code when exiting a guest. This is implementation has an improvement over existing code of marking a decrementer interrupt as soft-pending if a timer has expired, rather than setting DEC to a -ve value, which tended to cause host timers to take two interrupts (first hdec to exit the guest, then the immediate dec). Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-8-npiggin@gmail.com commit 34bf08a2079fffc7206a1ae93086ab8167e0afb6 Author: Nicholas Piggin Date: Tue Nov 23 19:51:44 2021 +1000 KVM: PPC: Book3S HV P9: Reduce mftb per guest entry/exit mftb is serialising (dispatch next-to-complete) so it is heavy weight for a mfspr. Avoid reading it multiple times in the entry or exit paths. A small number of cycles delay to timers is tolerable. Signed-off-by: Nicholas Piggin Reviewed-by: Fabiano Rosas Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-7-npiggin@gmail.com commit 9581991a60817abe311c2581ae4554b28bfa32f1 Author: Nicholas Piggin Date: Tue Nov 23 19:51:43 2021 +1000 KVM: PPC: Book3S HV P9: Use large decrementer for HDEC On processors that don't suppress the HDEC exceptions when LPCR[HDICE]=0, this could help reduce needless guest exits due to leftover exceptions on entering the guest. Signed-off-by: Nicholas Piggin Reviewed-by: Alexey Kardashevskiy Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-6-npiggin@gmail.com commit 4ebbd075bcde7884e078d4360510b989f559bfec Author: Nicholas Piggin Date: Tue Nov 23 19:51:42 2021 +1000 KVM: PPC: Book3S HV P9: Use host timer accounting to avoid decrementer read There is no need to save away the host DEC value, as it is derived from the host timer subsystem which maintains the next timer time, so it can be restored from there. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-5-npiggin@gmail.com commit 5955c7469a73033f607ebd6d418058943fe13dd3 Author: Nicholas Piggin Date: Tue Nov 23 19:51:41 2021 +1000 KMV: PPC: Book3S HV P9: Use set_dec to set decrementer to host The host Linux timer code arms the decrementer with the value 'decrementers_next_tb - current_tb' using set_dec(), which stores val - 1 on Book3S-64, which is not quite the same as what KVM does to re-arm the host decrementer when exiting the guest. This shouldn't be a significant change, but it makes the logic match and avoids this small extra change being brought into the next patch. Suggested-by: Alexey Kardashevskiy Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-4-npiggin@gmail.com commit 736df58fd5bcd02f811f7d474bbe02a35ffaa8f0 Author: Nicholas Piggin Date: Tue Nov 23 19:51:40 2021 +1000 powerpc/64s: guard optional TIDR SPR with CPU ftr test The TIDR SPR only exists on POWER9. Avoid accessing it when the feature bit for it is not set. Signed-off-by: Nicholas Piggin Reviewed-by: Fabiano Rosas Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-3-npiggin@gmail.com commit f53884b1bf28497e9596cac8b44ef1d41bd6dfc5 Author: Nicholas Piggin Date: Tue Nov 23 19:51:39 2021 +1000 powerpc/64s: Remove WORT SPR from POWER9/10 (take 2) This removes a missed remnant of the WORT SPR. Signed-off-by: Nicholas Piggin Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20211123095231.1036501-2-npiggin@gmail.com commit b6b56df519a73e35ac3f7d268affbae63221168b Author: Tvrtko Ursulin Date: Mon Nov 22 13:57:58 2021 +0000 Revert "drm/i915/dmabuf: fix broken build" This reverts commit 777226dac058 ("drm/i915/dmabuf: fix broken build"). Approach taken in the patch was rejected by Linus and the upstream tree now already contains the required include directive via 304ac8032d3f ("Merge tag 'drm-next-2021-11-12' of git://anongit.freedesktop.org/drm/drm"). Signed-off-by: Tvrtko Ursulin Fixes: 777226dac058 ("drm/i915/dmabuf: fix broken build") Cc: Matthew Auld Cc: Thomas Hellström Cc: Daniel Vetter Cc: Joonas Lahtinen Cc: Rodrigo Vivi Cc: Jani Nikula Acked-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20211122135758.85444-1-tvrtko.ursulin@linux.intel.com [tursulin: fixup commit message sha format] commit 91eddd309c679a96ad6c8d9b568e23af8fdb10a3 Merge: c6d5f1933085f b4a8e7493d741 Author: Jakub Kicinski Date: Tue Nov 23 20:16:22 2021 -0800 Merge branch 'dccp-tcp-minor-fixes-for-inet_csk_listen_start' Kuniyuki Iwashima says: ==================== dccp/tcp: Minor fixes for inet_csk_listen_start(). The first patch removes an unused argument, and the second removes a stale comment. ==================== Link: https://lore.kernel.org/r/20211122101622.50572-1-kuniyu@amazon.co.jp Signed-off-by: Jakub Kicinski commit b4a8e7493d74121093f2e1e024a9d3bb1a912912 Author: Kuniyuki Iwashima Date: Mon Nov 22 19:16:22 2021 +0900 dccp: Inline dccp_listen_start(). This patch inlines dccp_listen_start() and removes a stale comment in inet_dccp_listen() so that it looks like inet_listen(). Signed-off-by: Kuniyuki Iwashima Reviewed-by: Richard Sailer Signed-off-by: Jakub Kicinski commit e7049395b1c3085d12b5ba16d058c65598368853 Author: Kuniyuki Iwashima Date: Mon Nov 22 19:16:21 2021 +0900 dccp/tcp: Remove an unused argument in inet_csk_listen_start(). The commit 1295e2cf3065 ("inet: minor optimization for backlog setting in listen(2)") added change so that sk_max_ack_backlog is initialised earlier in inet_dccp_listen() and inet_listen(). Since then, we no longer use backlog in inet_csk_listen_start(), so let's remove it. Signed-off-by: Kuniyuki Iwashima Acked-by: Yafang Shao Reviewed-by: Richard Sailer Signed-off-by: Jakub Kicinski commit c6d5f1933085f9a92ed5c256a859ab31c7a35f88 Author: Kurt Kanzenbach Date: Mon Nov 22 12:19:31 2021 +0100 net: stmmac: Calculate CDC error only once The clock domain crossing error (CDC) is calculated at every fetch of Tx or Rx timestamps. It includes a division. Especially on arm32 based systems it is expensive. It also requires two conditionals in the hotpath. Add a compensation value cache to struct plat_stmmacenet_data and subtract it unconditionally in the RX/TX functions which spares the conditionals. The value is initialized to 0 and if supported calculated in the PTP initialization code. Suggested-by: Thomas Gleixner Signed-off-by: Kurt Kanzenbach Link: https://lore.kernel.org/r/20211122111931.135135-1-kurt@linutronix.de Signed-off-by: Jakub Kicinski commit 1a46061a2a4130a08841941ce6dcaa32be2ce312 Author: Rafał Miłecki Date: Tue Nov 23 10:03:33 2021 +0100 ARM: dts: BCM5301X: use non-deprecated USB 2.0 PHY binding The new binding covers a single reg and uses syscon to reference shared register. References: 55b9b741712d ("dt-bindings: phy: brcm,ns-usb2-phy: bind just a PHY block") Signed-off-by: Rafał Miłecki Signed-off-by: Florian Fainelli commit 11611eecb8aa1ab07f78e9bf0f2d8c40188e7826 Author: Linus Walleij Date: Tue Nov 23 11:23:11 2021 +0100 ARM: dts: ux500: Fixup Gavini magnetometer The Gavini device tree had the wrong magnetometer specified, this should be a YAS530. Signed-off-by: Linus Walleij commit d22d446f7a1ccd0db8c138749dde601388b2327d Author: Tejas Upadhyay Date: Wed Nov 17 11:33:21 2021 +0530 drm/i915/gt: Hold RPM wakelock during PXP suspend selftest --r live shows failure in suspend tests when RPM wakelock is not acquired during suspend. This changes addresses below error : <4> [154.177535] RPM wakelock ref not held during HW access <4> [154.177575] WARNING: CPU: 4 PID: 5772 at drivers/gpu/drm/i915/intel_runtime_pm.h:113 fwtable_write32+0x240/0x320 [i915] <4> [154.177974] Modules linked in: i915(+) vgem drm_shmem_helper fuse snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic ledtrig_audio mei_hdcp mei_pxp x86_pkg_temp_thermal coretemp crct10dif_pclmul crc32_pclmul ghash_clmulni_intel snd_intel_dspcfg snd_hda_codec snd_hwdep igc snd_hda_core ttm mei_me ptp snd_pcm prime_numbers mei i2c_i801 pps_core i2c_smbus intel_lpss_pci btusb btrtl btbcm btintel bluetooth ecdh_generic ecc [last unloaded: i915] <4> [154.178143] CPU: 4 PID: 5772 Comm: i915_selftest Tainted: G U 5.15.0-rc6-CI-Patchwork_21432+ #1 <4> [154.178154] Hardware name: ASUS System Product Name/TUF GAMING Z590-PLUS WIFI, BIOS 0811 04/06/2021 <4> [154.178160] RIP: 0010:fwtable_write32+0x240/0x320 [i915] <4> [154.178604] Code: 15 7b e1 0f 0b e9 34 fe ff ff 80 3d a9 89 31 00 00 0f 85 31 fe ff ff 48 c7 c7 88 9e 4f a0 c6 05 95 89 31 00 01 e8 c0 15 7b e1 <0f> 0b e9 17 fe ff ff 8b 05 0f 83 58 e2 85 c0 0f 85 8d 00 00 00 48 <4> [154.178614] RSP: 0018:ffffc900016279f0 EFLAGS: 00010286 <4> [154.178626] RAX: 0000000000000000 RBX: ffff888204fe0ee0 RCX: 0000000000000001 <4> [154.178634] RDX: 0000000080000001 RSI: ffffffff823142b5 RDI: 00000000ffffffff <4> [154.178641] RBP: 00000000000320f0 R08: 0000000000000000 R09: c0000000ffffcd5a <4> [154.178647] R10: 00000000000f8c90 R11: ffffc90001627808 R12: 0000000000000000 <4> [154.178654] R13: 0000000040000000 R14: ffffffffa04d12e0 R15: 0000000000000000 <4> [154.178660] FS: 00007f7390aa4c00(0000) GS:ffff88844f000000(0000) knlGS:0000000000000000 <4> [154.178669] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 <4> [154.178675] CR2: 000055bc40595028 CR3: 0000000204474005 CR4: 0000000000770ee0 <4> [154.178682] PKRU: 55555554 <4> [154.178687] Call Trace: <4> [154.178706] intel_pxp_fini_hw+0x23/0x30 [i915] <4> [154.179284] intel_pxp_suspend+0x1f/0x30 [i915] <4> [154.179807] live_gt_resume+0x5b/0x90 [i915] Changes since V2 : - Remove boolean in intel_pxp_runtime_preapre for non-pxp configs. Solves build error Changes since V2 : - Open-code intel_pxp_runtime_suspend - Daniele - Remove boolean in intel_pxp_runtime_preapre - Daniele Changes since V1 : - split the HW access parts in gt_suspend_late - Daniele - Remove default PXP configs Signed-off-by: Tejas Upadhyay Reviewed-by: Daniele Ceraolo Spurio Fixes: 0cfab4cb3c4e ("drm/i915/pxp: Enable PXP power management") Signed-off-by: Daniele Ceraolo Spurio Link: https://patchwork.freedesktop.org/patch/msgid/20211117060321.3729343-1-tejaskumarx.surendrakumar.upadhyay@intel.com commit 2ea537ca02b12e6e03dfcac82013ff289a75eed8 Author: Pavel Begunkov Date: Tue Nov 23 00:07:49 2021 +0000 io_uring: improve argument types of kiocb_done() kiocb_done() accepts a pointer to struct kiocb, pass struct io_kiocb (i.e. io_uring's request) instead so we can get rid of useless container_of(). Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/252016eed77806f58b48251a85cd8c645f900433.1637524285.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit f3251183b298912e09297cb22614361c63122e82 Author: Pavel Begunkov Date: Tue Nov 23 00:07:48 2021 +0000 io_uring: clean __io_import_iovec() Apparently, implicit 0 to NULL conversion with ERR_PTR is not recommended and makes some tooling like Smatch to complain. Handle it explicitly, compilers are perfectly capable to optimise it out. Link: https://lore.kernel.org/all/20211108134937.GA2863@kili/ Reported-by: Dan Carpenter Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/5c6ed369ad95075dab345df679f8677b8fe66656.1637524285.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 7297ce3d59449de49d3c9e1f64ae25488750a1fc Author: Pavel Begunkov Date: Tue Nov 23 00:07:47 2021 +0000 io_uring: improve send/recv error handling Hide all error handling under common if block, removes two extra ifs on the success path and keeps the handling more condensed. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/5761545158a12968f3caf30f747eea65ed75dfc1.1637524285.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 06bdea20c1076471f7ab7d3ad7f35cbcbd59a8e3 Author: Pavel Begunkov Date: Tue Nov 23 00:07:46 2021 +0000 io_uring: simplify reissue in kiocb_done Simplify failed resubmission prep in kiocb_done(), it's a bit ugly with conditional logic and hand handling cflags / select buffers. Instead, punt to tw and use io_req_task_complete() already handling all the cases. Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/667c33484b05b612e9420e1b1d5f4dc46d0ee9ce.1637524285.git.asml.silence@gmail.com Signed-off-by: Jens Axboe commit 5979873ebbb57b72a8f88ba26d3bd405981cd844 Author: Umesh Nerlige Ramappa Date: Mon Nov 15 14:16:40 2021 -0800 drm/i915/pmu: Increase the live_engine_busy_stats sample period Irrespective of the backend for request submissions, busyness for an engine with an active context is calculated using: busyness = total + (current_time - context_switch_in_time) In execlists mode of operation, the context switch events are handled by the CPU. Context switch in/out time and current_time are captured in CPU time domain using ktime_get(). In GuC mode of submission, context switch events are handled by GuC and the times in the above formula are captured in GT clock domain. This information is shared with the CPU through shared memory. This results in 2 caveats: 1) The time taken between start of a batch and the time that CPU is able to see the context_switch_in_time in shared memory is dependent on GuC and memory bandwidth constraints. 2) Determining current_time requires an MMIO read that can take anywhere between a few us to a couple ms. A reference CPU time is captured soon after reading the MMIO so that the caller can compare the cpu delta between 2 busyness samples. The issue here is that the CPU delta and the busyness delta can be skewed because of the time taken to read the register. These 2 factors affect the accuracy of the selftest - live_engine_busy_stats. For (1) the selftest waits until busyness stats are visible to the CPU. The effects of (2) are more prominent for the current busyness sample period of 100 us. Increase the busyness sample period from 100 us to 10 ms to overccome (2). v2: Fix checkpatch issues Signed-off-by: Umesh Nerlige Ramappa Reviewed-by: Matthew Brost Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20211115221640.30793-1-umesh.nerlige.ramappa@intel.com commit 7c72665c5667d4566e594ea362c50a6007b405fb Author: Takashi Iwai Date: Tue Nov 23 18:02:47 2021 +0100 ALSA: led: Use restricted type for iface assignment Fix a sparse warning that complains about the inconsistent type assignment for iface, which is a restricted type of snd_ctl_elem_iface_t. Fixes: a135dfb5de15 ("ALSA: led control - add sysfs kcontrol LED marking layer") Reported-by: kernel test robot Reviewed-by: Jaroslav Kysela Link: https://lore.kernel.org/r/202111201028.xduVYgH5-lkp@intel.com Link: https://lore.kernel.org/r/20211123170247.2962-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit be373fad541b60bb785ad59c6daabe0298b39cfb Author: Matthew Auld Date: Tue Nov 23 12:58:14 2021 +0000 drm/i915/ttm: fixup build failure drm-intel-gt-next fails to build with: drivers/gpu/drm/i915/gem/i915_gem_ttm.c: In function ‘vm_fault_ttm’: drivers/gpu/drm/i915/gem/i915_gem_ttm.c:862:23: error: too many arguments to function ‘ttm_bo_vm_fault_reserved’ 862 | ret = ttm_bo_vm_fault_reserved(vmf, vmf->vma->vm_page_prot, | ^~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Matthew Auld Cc: Tvrtko Ursulin Signed-off-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20211123125814.1703220-1-matthew.auld@intel.com commit 6b4542664c2d1fc7a770f0a4182ef5e36672d313 Author: Hans de Goede Date: Mon Nov 22 23:04:23 2021 +0100 pinctrl: baytrail: Set IRQCHIP_SET_TYPE_MASKED flag on the irqchip The byt_irq_type function ends with the IRQ masked, this means that calls to irq_set_irq_type() while the IRQ is enabled end up masking it, which is wrong. Add the IRQCHIP_SET_TYPE_MASKED flag to fix this. This will make the IRQ core call mask() + unmask() on the IRQ around a set_type() call when the IRQ is enabled at the type of the call. Note in practice irq_set_irq_type() getting called while the IRQ is enabled almost never happens. I hit this with a buggy DSDT where a wrongly active (_STA returns 0xf) I2C ACPI devices point to an IRQ already in use by an _AEI handler, leading to the irq_set_irq_type() call in acpi_dev_gpio_irq_get_by() getting called while the IRQ is enabled. Signed-off-by: Hans de Goede Acked-by: Mika Westerberg Signed-off-by: Andy Shevchenko commit c4bc515d73b5201d30f78b935accdd9e3988f05e Author: John Keeping Date: Mon Nov 22 12:31:07 2021 +0000 usb: dwc2: gadget: use existing helper All other checks of params.g_dma_desc in this file use the using_desc_dma() helper function. Use that helper in two more places for consistency throughout the file. Acked-by: Minas Harutyunyan Signed-off-by: John Keeping Link: https://lore.kernel.org/r/20211122123107.3147353-1-john@metanate.com Signed-off-by: Greg Kroah-Hartman commit 5284acccc4a501f38dbeceabaa0340401c107654 Author: Linyu Yuan Date: Thu Nov 18 12:53:33 2021 +0800 usb: gadget: configfs: use to_usb_function_instance() in cfg (un)link func replace open-coded container_of() with to_usb_function_instance() helper. Reviewed-by: Jack Pham Signed-off-by: Linyu Yuan Link: https://lore.kernel.org/r/1637211213-16400-5-git-send-email-quic_linyyuan@quicinc.com Signed-off-by: Greg Kroah-Hartman commit 5d143ec451429891385a21617b292f2ceaa684ea Author: Linyu Yuan Date: Thu Nov 18 12:53:32 2021 +0800 usb: gadget: configfs: use to_config_usb_cfg() in os_desc_link() replace open-coded container_of() with to_config_usb_cfg() helper. Reviewed-by: Jack Pham Signed-off-by: Linyu Yuan Link: https://lore.kernel.org/r/1637211213-16400-4-git-send-email-quic_linyyuan@quicinc.com Signed-off-by: Greg Kroah-Hartman commit ff5a938d12f213194d796d3018b102389b7d9f9c Author: Linyu Yuan Date: Thu Nov 18 12:53:31 2021 +0800 usb: gadget: configfs: remove os_desc_attr_release() it is not allow to create sub group under os_desc, /sys/kernel/config/usb_gadget/dummy/os_desc # mkdir dummy mkdir: can't create directory 'dummy': Operation not permitted no one will kmalloc() os_desc entry and kfree(os_desc) will never be called. static void os_desc_attr_release(struct config_item *item) { struct os_desc *os_desc = to_os_desc(item); kfree(os_desc); } remove struct os_desc definition, to_os_desc() and os_desc_attr_release(). Reviewed-by: Jack Pham Signed-off-by: Linyu Yuan Link: https://lore.kernel.org/r/1637211213-16400-3-git-send-email-quic_linyyuan@quicinc.com Signed-off-by: Greg Kroah-Hartman commit 167a799c6e88b700c386a010ba3c77ebdbd21a8e Author: Linyu Yuan Date: Thu Nov 18 12:53:30 2021 +0800 usb: gadget: configfs: simplify os_desc_item_to_gadget_info() helper since os_desc_group is already a member of struct gadget_info, we can simply just use container_of() to retrieve the latter, without needing to dereference the cg_item's parent pointer. use os_desc_item_to_gadget_info() helper in os_desc (un)link function. Reviewed-by: Jack Pham Signed-off-by: Linyu Yuan Link: https://lore.kernel.org/r/1637211213-16400-2-git-send-email-quic_linyyuan@quicinc.com Signed-off-by: Greg Kroah-Hartman commit e4ac5a40cec2ac0dcc050262ec9d97a8efa06b0b Author: Shubhrajyoti Datta Date: Thu Nov 18 17:31:43 2021 +0530 usb: xilinx: Add suspend resume support Add suspend resume support. In the suspend udc is suspended and it is set to ready at resume for it to be functional. Signed-off-by: Shubhrajyoti Datta Link: https://lore.kernel.org/r/20211118120143.1079-1-shubhrajyoti.datta@xilinx.com Signed-off-by: Greg Kroah-Hartman commit 8361b8b29f9389084b679db854cf733375c64763 Author: Adam Ford Date: Sat Nov 20 13:39:16 2021 -0600 soc: imx: gpcv2: keep i.MX8MM VPU-H1 bus clock active Enable the vpu-h1 clock when the domain is active because reading or writing to the VPU-H1 IP block cause the system to hang. Fixes: 656ade7aa42a ("soc: imx: gpcv2: keep i.MX8M* bus clocks enabled") Signed-off-by: Adam Ford Reviewed-by: Fabio Estevam Signed-off-by: Shawn Guo commit 2106efda785b55a8957efed9a52dfa28ee0d7280 Author: Jakub Kicinski Date: Mon Nov 22 17:24:47 2021 -0800 net: remove .ndo_change_proto_down .ndo_change_proto_down was added seemingly to enable out-of-tree implementations. Over 2.5yrs later we still have no real users upstream. Hardwire the generic implementation for now, we can revert once real users materialize. (rocker is a test vehicle, not a user.) We need to drop the optimization on the sysfs side, because unlike ndos priv_flags will be changed at runtime, so we'd need READ_ONCE/WRITE_ONCE everywhere.. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit c384cee14aa330ba2f5616fb821ba81f2ef42ccd Merge: 5f11542f13728 774a90c1e1a34 Author: David S. Miller Date: Tue Nov 23 12:17:24 2021 +0000 Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== 100GbE Intel Wired LAN Driver Updates 2021-11-22 Shiraz Saleem says: Currently E800 devices come up as RoCEv2 devices by default. This series add supports for users to configure iWARP or RoCEv2 functionality per PCI function. devlink parameters is used to realize this and is keyed off similar work in [1]. [1] https://lore.kernel.org/linux-rdma/20210810132424.9129-1-parav@nvidia.com/ ==================== Signed-off-by: David S. Miller commit 5f11542f13728d26e4d867fc95263d7f14d61bf3 Merge: 75e47206512bf 4043ec701c43c Author: David S. Miller Date: Tue Nov 23 12:14:49 2021 +0000 Merge branch 'mvpp2-5gbase-r-support' Marek Behún says: ==================== Add 5gbase-r support for mvpp2 this adds support for 5gbase-r for mvpp2 driver. Current versions of TF-A firmware support changing the PHY to 5gbase-r via SMC calls, at least on Macchiatobin. Tested on Macchiatobin. ==================== Signed-off-by: David S. Miller commit 4043ec701c43c7e61ad71c3afbd242d687fb6ecf Author: Marek Behún Date: Mon Nov 22 21:51:11 2021 +0100 net: marvell: mvpp2: Add support for 5gbase-r Add support for PHY_INTERFACE_MODE_5GBASER. Signed-off-by: Marek Behún Signed-off-by: David S. Miller commit a1fb410a57511b96d980a9a71b5af1873bf43171 Author: Marek Behún Date: Mon Nov 22 21:51:10 2021 +0100 phy: marvell: phy-mvebu-cp110-comphy: add support for 5gbase-r Add support for PHY_INTERFACE_MODE_5GBASER mode within the Marvell CP110 common PHY driver. This is currently only supported via SMC calls to TF-A. Legacy support may be added later, if needed. Signed-off-by: Marek Behún Signed-off-by: David S. Miller commit 75e47206512bf98ad3d5cd4ef18f3d92b9050a45 Author: Gerhard Engleder Date: Mon Nov 22 21:32:25 2021 +0100 tsnep: Fix set MAC address Commit 4dfb9982644b ("tsn: Fix build.") fixed compilation with const dev_addr. In tsnep_netdev_set_mac_address() the call of ether_addr_copy() was replaced with dev_set_mac_address(), which calls ndo_set_mac_address(). This results in an endless recursive loop because ndo_set_mac_address is set to tsnep_netdev_set_mac_address. Call eth_hw_addr_set() instead of dev_set_mac_address() in ndo_set_mac_address()/tsnep_netdev_set_mac_address() to copy the address as intended. [ 26.563303] Insufficient stack space to handle exception! [ 26.563312] ESR: 0x96000047 -- DABT (current EL) [ 26.563317] FAR: 0xffff80000a507fc0 [ 26.563320] Task stack: [0xffff80000a508000..0xffff80000a50c000] [ 26.563324] IRQ stack: [0xffff80000a0c0000..0xffff80000a0c4000] [ 26.563327] Overflow stack: [0xffff00007fbaf2b0..0xffff00007fbb02b0] [ 26.563333] CPU: 3 PID: 381 Comm: ifconfig Not tainted 5.16.0-rc1-zynqmp #60 [ 26.563340] Hardware name: TSN endpoint (DT) [ 26.563343] pstate: a0000005 (NzCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 26.563351] pc : inetdev_event+0x4/0x560 [ 26.563364] lr : raw_notifier_call_chain+0x54/0x78 [ 26.563372] sp : ffff80000a508040 [ 26.563374] x29: ffff80000a508040 x28: ffff00000132b800 x27: 0000000000000000 [ 26.563386] x26: 0000000000000000 x25: ffff800000ea5058 x24: 0904030201020001 [ 26.563396] x23: ffff800000ea5058 x22: ffff80000a5080e0 x21: 0000000000000009 [ 26.563405] x20: 00000000fffffffa x19: ffff80000a009510 x18: 0000000000000000 [ 26.563414] x17: 0000000000000000 x16: 0000000000000000 x15: 0000ffffd1341030 [ 26.563422] x14: ffffffffffffffff x13: 0000000000000020 x12: 0101010101010101 [ 26.563432] x11: 0000000000000020 x10: 0101010101010101 x9 : 7f7f7f7f7f7f7f7f [ 26.563441] x8 : 7f7f7f7f7f7f7f7f x7 : fefefeff30677364 x6 : 0000000080808080 [ 26.563450] x5 : 0000000000000000 x4 : ffff800008dee170 x3 : ffff80000a50bd42 [ 26.563459] x2 : ffff80000a5080e0 x1 : 0000000000000009 x0 : ffff80000a0092d0 [ 26.563470] Kernel panic - not syncing: kernel stack overflow [ 26.563474] CPU: 3 PID: 381 Comm: ifconfig Not tainted 5.16.0-rc1-zynqmp #60 [ 26.563481] Hardware name: TSN endpoint (DT) [ 26.563484] Call trace: [ 26.563486] dump_backtrace+0x0/0x1b0 [ 26.563497] show_stack+0x18/0x68 [ 26.563504] dump_stack_lvl+0x68/0x84 [ 26.563513] dump_stack+0x18/0x34 [ 26.563519] panic+0x164/0x324 [ 26.563524] nmi_panic+0x64/0x98 [ 26.563533] panic_bad_stack+0x108/0x128 [ 2k6.563539] handle_bad_stack+0x38/0x68 [ 26.563548] __bad_stack+0x88/0x8c [ 26.563553] inetdev_event+0x4/0x560 [ 26.563560] call_netdevice_notifiers_info+0x58/0xa8 [ 26.563569] dev_set_mac_address+0x78/0x110 [ 26.563576] tsnep_netdev_set_mac_address+0x38/0x60 [tsnep] [ 26.563591] dev_set_mac_address+0xc4/0x110 [ 26.563599] tsnep_netdev_set_mac_address+0x38/0x60 [tsnep] ... [ 26.565444] dev_set_mac_address+0xc4/0x110 [ 26.565452] tsnep_netdev_set_mac_address+0x38/0x60 [tsnep] [ 26.565462] dev_set_mac_address+0xc4/0x110 [ 26.565469] dev_set_mac_address_user+0x44/0x68 [ 26.565477] dev_ifsioc+0x30c/0x568 [ 26.565483] dev_ioctl+0x124/0x3f0 [ 26.565489] sock_do_ioctl+0xb4/0xf8 [ 26.565497] sock_ioctl+0x2f4/0x398 [ 26.565503] __arm64_sys_ioctl+0xa8/0xe8 [ 26.565511] invoke_syscall+0x44/0x108 [ 26.565520] el0_svc_common.constprop.3+0x94/0xf8 [ 26.565527] do_el0_svc+0x24/0x88 [ 26.565534] el0_svc+0x20/0x50 [ 26.565541] el0t_64_sync_handler+0x90/0xb8 [ 26.565548] el0t_64_sync+0x180/0x184 [ 26.565556] SMP: stopping secondary CPUs [ 26.565622] Kernel Offset: disabled [ 26.565624] CPU features: 0x0,00004002,00000846 [ 26.565628] Memory Limit: none [ 27.843428] ---[ end Kernel panic - not syncing: kernel stack overflow ]--- Fixes: 4dfb9982644b ("tsn: Fix build.") Signed-off-by: Gerhard Engleder Signed-off-by: David S. Miller commit 44ec41b7f7831f91c79a06de5e45f2d7ce6e4fbd Author: Andy Shevchenko Date: Mon Nov 22 22:06:22 2021 +0200 spi: pxa2xx: Remove redundant ->read() and ->write() in struct chip_data Since the commit 196b0e2cf237 ("spi: pxa2xx: Remove if statement that is always true in pump_transfers()") the ->read() and ->write() methods in the struct driver_data are reconfigured for each transfer. Hence no need to keep the intermediate state in the struct chip_data. The same applies to n_bytes member of the same data structure. Get rid of unneeded storage for good. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211122200622.43305-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit dd06a0c6b6f64f6610c0bb8f7651df3ebfb0f990 Author: Andy Shevchenko Date: Mon Nov 22 19:52:45 2021 +0200 spi: spidev: Use SPI_MODE_USER_MASK instead of casting Currently the 16-bit mode is what being used in user space. However assuming that is not fully correct. Instead we should use the respective mask, i.e. SPI_MODE_USER_MASK, which precisely defines what bits are available for user space apps. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211122175245.84691-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit 350de7ce26caba5c7ec0dd4ef1802c9a50a5d85d Author: Andy Shevchenko Date: Mon Nov 22 19:17:21 2021 +0200 spi: Fix multi-line comment style /* * Fix multi-line comment style as in this short example. Pay attention * to the capitalization, period and starting line of the text. */ While at it, split the (supposedly short) description of couple of functions to summary (short description) and (long) description. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211122171721.61553-3-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit b00bab9d48bbb6446a5cf366f5f8e501a16031a1 Author: Andy Shevchenko Date: Mon Nov 22 19:17:20 2021 +0200 spi: Replace memset() with __GFP_ZERO krealloc() as any other kernel memory allocation calls accepts GFP flags, one of which is __GFP_ZERO. Hence, no need to call memset() explicitly on the reallocated buffer. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211122171721.61553-2-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit cff6f593251cdf5398dc3c57f7032b8e9dcb633e Author: Matti Vaittinen Date: Tue Nov 23 12:36:47 2021 +0200 regulator: rohm-generic: iniline stub function The function rohm_regulator_set_voltage_sel_restricted() has a stub implementation. Linux-next testing spot following: include/linux/mfd/rohm-generic.h:93:12: error: 'rohm_regulator_set_voltage_sel_restricted' defined but not used Fix this by inlining the stub. Fixes: 8b6e88555971 ("regulator: rohm-regulator: add helper for restricted voltage setting") Signed-off-by: Matti Vaittinen Link: https://lore.kernel.org/r/YZzEP3S7U15bTDAI@fedora Signed-off-by: Mark Brown commit 1aa590c85ae4a66bd686146392708704828691a2 Author: Jason Wang Date: Sat Nov 13 11:21:56 2021 +0800 ARM: dts: imx: Fix typo in pinfunc comments Remove the repeated `configurable' in some comments in imx1-pinfunc.h and imx27-pinfunc.h. Signed-off-by: Jason Wang Signed-off-by: Shawn Guo commit 33e2ec523230c2ef38a87027b6d14f714f417520 Merge: 1e84dc6b7bbfc def975307c011 Author: David S. Miller Date: Tue Nov 23 11:53:16 2021 +0000 Merge branch 'qca8k-mirror-and-lag-support' Ansuel Smith says: ==================== Add mirror and LAG support to qca8k With the continue of adding 'Multiple feature to qca8k' The switch supports mirror mode and LAG. In mirror mode a port is set as mirror and other port are configured to both igress or egress mode. With no port configured for mirror, the mirror port is disabled and reverted to normal port. The switch supports max 4 LAG with 4 different member max. Current supported mode is Hash mode in both L2 or L2+3 mode. There is a problematic implementation for the hash mode where with multiple LAG configured, someone has to remove them to change the hash mode as it's global. When a member of the LAG is disconnected, the traffic is redirected to the other port. Some warning are present from checkpatch but can't really be fixed as it would result in making the regs less readable. (They really did their best with the LAG reg logic and complexity) ==================== Signed-off-by: David S. Miller commit def975307c01191b6f0170048c3724b0ed3348af Author: Ansuel Smith Date: Tue Nov 23 03:59:11 2021 +0100 net: dsa: qca8k: add LAG support Add LAG support to this switch. In Documentation this is described as trunk mode. A max of 4 LAGs are supported and each can support up to 4 port. The current tx mode supported is Hash mode with both L2 and L2+3 mode. When no port are present in the trunk, the trunk is disabled in the switch. When a port is disconnected, the traffic is redirected to the other available port. The hash mode is global and each LAG require to have the same hash mode set. To change the hash mode when multiple LAG are configured, it's required to remove each LAG and set the desired hash mode to the last. An error is printed when it's asked to set a not supported hadh mode. Signed-off-by: Ansuel Smith Signed-off-by: David S. Miller commit 2c1bdbc7e7560d7de754cad277d968d56bb1899e Author: Ansuel Smith Date: Tue Nov 23 03:59:10 2021 +0100 net: dsa: qca8k: add support for mirror mode The switch supports mirror mode. Only one port can set as mirror port and every other port can set to both ingress and egress mode. The mirror port is disabled and reverted to normal operation once every port is removed from sending packet to it. Signed-off-by: Ansuel Smith Signed-off-by: David S. Miller commit 1e84dc6b7bbfc4d1dd846decece4611b7e035772 Author: Yajun Deng Date: Tue Nov 23 10:54:30 2021 +0800 neigh: introduce neigh_confirm() helper function Add neigh_confirm() for the confirmed member in struct neighbour, it can be called as an independent unit by other functions. Signed-off-by: Yajun Deng Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller commit a0c2ccd9b5ad0a9e838158404e041b5a8ff762dd Author: Jeremy Kerr Date: Tue Nov 23 15:50:46 2021 +0800 mctp: Add MCTP-over-serial transport binding This change adds a MCTP Serial transport binding, as defined by DMTF specificiation DSP0253 - "MCTP Serial Transport Binding". This is implemented as a new serial line discipline, and can be attached to arbitrary tty devices. From the Kconfig description: This driver provides an MCTP-over-serial interface, through a serial line-discipline, as defined by DMTF specification "DSP0253 - MCTP Serial Transport Binding". By attaching the ldisc to a serial device, we get a new net device to transport MCTP packets. This allows communication with external MCTP endpoints which use serial as their transport. It can also be used as an easy way to provide MCTP connectivity between virtual machines, by forwarding data between simple virtual serial devices. Say y here if you need to connect to MCTP endpoints over serial. To compile as a module, use m; the module will be called mctp-serial. Once the N_MCTP line discipline is set [using ioctl(TCIOSETD)], we get a new netdev suitable for MCTP communication. The 'mctp' utility[1] provides a simple wrapper for this ioctl, using 'link serial ': # mctp link serial /dev/ttyS0 & # mctp link dev lo index 1 address 0x00:00:00:00:00:00 net 1 mtu 65536 up dev mctpserial0 index 5 address 0x(no-addr) net 1 mtu 68 down [1]: https://github.com/CodeConstruct/mctp Signed-off-by: Jeremy Kerr Signed-off-by: David S. Miller commit 25e2735de8613e5677e53730e751bbaf83998be5 Merge: 3b0e04140bc30 c1020d3cf4752 Author: David S. Miller Date: Tue Nov 23 11:44:31 2021 +0000 Merge branch 'mlxsw-updates' Ido Schimmel says: ==================== mlxsw: Various updates Patch #1 removes deadcode reported by Coverity. Patch #2 adds a shutdown method in the PCI driver to ensure the kexeced kernel starts working with a device that is in a sane state. ==================== Signed-off-by: David S. Miller commit c1020d3cf4752f61a6a413f632ea2ce2370e150d Author: Danielle Ratson Date: Tue Nov 23 09:54:47 2021 +0200 mlxsw: pci: Add shutdown method in PCI driver On an arm64 platform with the Spectrum ASIC, after loading and executing a new kernel via kexec, the following trace [1] is observed. This seems to be caused by the fact that the device is not properly shutdown before executing the new kernel. Fix this by implementing a shutdown method which mirrors the remove method, as recommended by the kexec maintainer [2][3]. [1] BUG: Bad page state in process devlink pfn:22f73d page:fffffe00089dcf40 refcount:-1 mapcount:0 mapping:0000000000000000 index:0x0 flags: 0x2ffff00000000000() raw: 2ffff00000000000 0000000000000000 ffffffff089d0201 0000000000000000 raw: 0000000000000000 0000000000000000 ffffffffffffffff 0000000000000000 page dumped because: nonzero _refcount Modules linked in: CPU: 1 PID: 16346 Comm: devlink Tainted: G B 5.8.0-rc6-custom-273020-gac6b365b1bf5 #44 Hardware name: Marvell Armada 7040 TX4810M (DT) Call trace: dump_backtrace+0x0/0x1d0 show_stack+0x1c/0x28 dump_stack+0xbc/0x118 bad_page+0xcc/0xf8 check_free_page_bad+0x80/0x88 __free_pages_ok+0x3f8/0x418 __free_pages+0x38/0x60 kmem_freepages+0x200/0x2a8 slab_destroy+0x28/0x68 slabs_destroy+0x60/0x90 ___cache_free+0x1b4/0x358 kfree+0xc0/0x1d0 skb_free_head+0x2c/0x38 skb_release_data+0x110/0x1a0 skb_release_all+0x2c/0x38 consume_skb+0x38/0x130 __dev_kfree_skb_any+0x44/0x50 mlxsw_pci_rdq_fini+0x8c/0xb0 mlxsw_pci_queue_fini.isra.0+0x28/0x58 mlxsw_pci_queue_group_fini+0x58/0x88 mlxsw_pci_aqs_fini+0x2c/0x60 mlxsw_pci_fini+0x34/0x50 mlxsw_core_bus_device_unregister+0x104/0x1d0 mlxsw_devlink_core_bus_device_reload_down+0x2c/0x48 devlink_reload+0x44/0x158 devlink_nl_cmd_reload+0x270/0x290 genl_rcv_msg+0x188/0x2f0 netlink_rcv_skb+0x5c/0x118 genl_rcv+0x3c/0x50 netlink_unicast+0x1bc/0x278 netlink_sendmsg+0x194/0x390 __sys_sendto+0xe0/0x158 __arm64_sys_sendto+0x2c/0x38 el0_svc_common.constprop.0+0x70/0x168 do_el0_svc+0x28/0x88 el0_sync_handler+0x88/0x190 el0_sync+0x140/0x180 [2] https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1195432.html [3] https://patchwork.kernel.org/project/linux-scsi/patch/20170212214920.28866-1-anton@ozlabs.org/#20116693 Cc: Eric Biederman Signed-off-by: Danielle Ratson Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit ed1607e2ddf4b3196703b209428cbce3de869ff8 Author: Danielle Ratson Date: Tue Nov 23 09:54:46 2021 +0200 mlxsw: spectrum_router: Remove deadcode in mlxsw_sp_rif_mac_profile_find The function idr_for_each_entry() already checks that the next entry in the IDR is not NULL. Therefore, checking that again in every iteration leads to deadcode. Remove the unnecessary check in order to avoid that. Addresses-Coverity: ("Logically dead code") Signed-off-by: Danielle Ratson Signed-off-by: Ido Schimmel Signed-off-by: David S. Miller commit bb349fd2d58062c69508414a9080d822b8d096b5 Author: Srinivas Kandagatla Date: Tue Nov 16 10:50:17 2021 +0000 soundwire: qcom: remove redundant version number read Controller version is already available in struct qcom_swrm_ctrl, Just make use of it instead of reading this again. Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20211116105017.12010-1-srinivas.kandagatla@linaro.org Signed-off-by: Vinod Koul commit 617ed6c2f0365a62f21936449ca1701937027339 Author: Jani Nikula Date: Mon Nov 22 13:15:04 2021 +0200 drm/i915/dsi: split out icl_dsi.h Follow the convention of corresponding .h for .c. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Reviewed-by: Hans de Goede Link: https://patchwork.freedesktop.org/patch/msgid/20211122111504.223248-4-jani.nikula@intel.com commit 7570d06db73f9e5a97cb55bcdfcc3b15f6f46b9b Author: Jani Nikula Date: Mon Nov 22 13:15:03 2021 +0200 drm/i915/dsi: split out vlv_dsi.h Follow the convention of corresponding .h for .c. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Reviewed-by: Hans de Goede Link: https://patchwork.freedesktop.org/patch/msgid/20211122111504.223248-3-jani.nikula@intel.com commit 01e526285a6a591900e7ed7266c1723fed366754 Author: Jani Nikula Date: Mon Nov 22 13:15:02 2021 +0200 drm/i915/dsi: split out vlv_dsi_pll.h Follow the convention of corresponding .h for .c. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Reviewed-by: Hans de Goede Link: https://patchwork.freedesktop.org/patch/msgid/20211122111504.223248-2-jani.nikula@intel.com commit aebdd7428c65a8e2e96c1fd2fd89b4ab90bad913 Author: Jani Nikula Date: Mon Nov 22 13:15:01 2021 +0200 drm/i915/dsi: split out intel_dsi_vbt.h Follow the convention of corresponding .h for .c. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Reviewed-by: Hans de Goede Link: https://patchwork.freedesktop.org/patch/msgid/20211122111504.223248-1-jani.nikula@intel.com commit a2fd6f6bc07f525eb5064ac8f0c2286a1138d59c Author: Andy Shevchenko Date: Mon Nov 15 17:42:01 2021 +0200 i2c: mux: gpio: Use array_size() helper Use array_size() helper to aid in 2-factor allocation instances. Signed-off-by: Andy Shevchenko Reviewed-by: Evan Green Acked-by: Peter Rosin Signed-off-by: Wolfram Sang commit 533f05f0abc05250dc82416863de711ca5550bd4 Author: Andy Shevchenko Date: Mon Nov 15 17:42:00 2021 +0200 i2c: mux: gpio: Don't dereference fwnode from struct device We have a special helper to get fwnode out of struct device. Moreover, dereferencing it directly prevents the fwnode modifications in the future. Signed-off-by: Andy Shevchenko Reviewed-by: Evan Green Acked-by: Peter Rosin Signed-off-by: Wolfram Sang commit 379920f5c013c49e0a740634972faf77e26d4ac3 Author: Andy Shevchenko Date: Mon Nov 15 17:41:59 2021 +0200 i2c: mux: gpio: Replace custom acpi_get_local_address() Recently ACPI gained the acpi_get_local_address() API which may be used instead of home grown i2c_mux_gpio_get_acpi_adr(). Signed-off-by: Andy Shevchenko Reviewed-by: Evan Green Acked-by: Peter Rosin Signed-off-by: Wolfram Sang commit 00b9773b128a509581555faef838b09468236d48 Author: Samuel Holland Date: Wed Nov 17 21:18:40 2021 -0600 arm64: dts: allwinner: a64: Update MBUS node In order to support memory dynamic frequency scaling (MDFS), the MBUS binding now requires enumerating more resources. Provide them in the device tree. Reviewed-by: Chanwoo Choi Signed-off-by: Samuel Holland Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20211118031841.42315-6-samuel@sholland.org commit c8f7b50785ca3a8b81f615da6e2f4e7b6380b20a Author: Samuel Holland Date: Wed Nov 17 21:18:39 2021 -0600 ARM: dts: sunxi: h3/h5: Update MBUS node In order to support memory dynamic frequency scaling (MDFS), the MBUS binding now requires enumerating more resources. Provide them in the device tree. Since the H3 and H5 have different clock divider limits, they need separate compatibles. Reviewed-by: Chanwoo Choi Signed-off-by: Samuel Holland Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20211118031841.42315-5-samuel@sholland.org commit 9f193dedd6efeb4e193d706856f26fcf11ae0ff2 Author: Samuel Holland Date: Wed Nov 17 21:18:38 2021 -0600 dt-bindings: arm: sunxi: Add H5 MBUS compatible The H5 SoC has a MBUS very similar to the H3 SoC, but it has a smaller MDFS divider range (1-4 instead of 1-16). Add a separate compatible for this variant. Acked-by: Rob Herring Signed-off-by: Samuel Holland Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20211118031841.42315-4-samuel@sholland.org commit 245578ba9f03e07132bcaf60cbdfeb0e89457104 Author: Samuel Holland Date: Wed Nov 17 21:18:37 2021 -0600 dt-bindings: arm: sunxi: Expand MBUS binding The MBUS provides more than address translation and bandwidth control. It also provides a PMU to measure bandwidth usage by certain masters, and it provides notification via IRQ when they are active or idle. The MBUS is also tightly integrated with the DRAM controller to provide a Memory Dynamic Frequency Scaling (MDFS) feature. In view of this, the MBUS binding needs to represent the hardware resources needed for MDFS, which include the clocks and MMIO range of the adjacent DRAM controller. Add the additional resources for the H3 and A64 compatibles, and a new example showing how they are used. Reviewed-by: Chanwoo Choi Signed-off-by: Samuel Holland Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20211118031841.42315-3-samuel@sholland.org commit 71b597ef5d46a326fb0d5cbfc1c6ff1d73cdc7f9 Author: Samuel Holland Date: Wed Nov 17 21:18:36 2021 -0600 dt-bindings: clock: sunxi: Export CLK_DRAM for devfreq The MBUS node needs to reference the CLK_DRAM clock, as the MBUS hardware implements memory dynamic frequency scaling using this clock. Export this clock for SoCs which will be getting a devfreq driver. Acked-by: Rob Herring Reviewed-by: Chanwoo Choi Signed-off-by: Samuel Holland Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20211118031841.42315-2-samuel@sholland.org commit f89bf95632b41695402996d96476c44c641d23d7 Author: Corey Minyard Date: Fri Nov 12 07:39:55 2021 -0600 i2c: imx: Add timer for handling the stop condition Most IMX I2C interfaces don't generate an interrupt on a stop condition, so it won't generate a timely stop event on a slave mode transfer. Some users, like IPMB, need a timely stop event to work properly. So, add a timer and add the proper handling to generate a stop event in slave mode if the interface goes idle. Signed-off-by: Corey Minyard Tested-by: Andrew Manley Reviewed-by: Andrew Manley Reviewed-by: Oleksij Rempel Signed-off-by: Wolfram Sang commit 95f04048325cb808f4ca98f0a4d075bbb23576f8 Author: Linus Walleij Date: Sun Jun 20 00:42:59 2021 +0200 ARM: dts: ux500: Add reset lines to IP blocks The new reset controller makes is possible to add reset lines to a host of IP blocks in the DB8500/U8500. Cc: Ulf Hansson Signed-off-by: Linus Walleij commit 7e97b3dc2556743dd02612c92a8de7026e8d7dc9 Author: Lukasz Luba Date: Tue Nov 9 19:57:14 2021 +0000 arch_topology: Remove unused topology_set_thermal_pressure() and related There is no need of this function (and related) since code has been converted to use the new arch_update_thermal_pressure() API. The old code can be removed. Signed-off-by: Lukasz Luba Signed-off-by: Viresh Kumar commit 0258cb19c77deb755747b97f690931193ced0c55 Author: Lukasz Luba Date: Tue Nov 9 19:57:13 2021 +0000 cpufreq: qcom-cpufreq-hw: Use new thermal pressure update function Thermal pressure provides a new API, which allows to use CPU frequency as an argument. That removes the need of local conversion to capacity. Use this new API and remove old local conversion code. The new arch_update_thermal_pressure() also accepts boost frequencies, which solves issue in the driver code with wrong reduced capacity calculation. The reduced capacity was calculated wrongly due to 'policy->cpuinfo.max_freq' used as a divider. The value present there was actually the boost frequency. Thus, even a normal maximum frequency value which corresponds to max CPU capacity (arch_scale_cpu_capacity(cpu_id)) is not able to remove the capping. The second side effect which is solved is that the reduced frequency wasn't properly translated into the right reduced capacity, e.g. boost frequency = 3000MHz (stored in policy->cpuinfo.max_freq) max normal frequency = 2500MHz (which is 1024 capacity) 2nd highest frequency = 2000MHz (which translates to 819 capacity) Then in a scenario when the 'throttled_freq' max allowed frequency was 2000MHz the driver translated it into 682 capacity: capacity = 1024 * 2000 / 3000 = 682 Then set the pressure value bigger than actually applied by the HW: max_capacity - capacity => 1024 - 682 = 342 (<- thermal pressure) Which was causing higher throttling and misleading task scheduler about available CPU capacity. A proper calculation in such case should be: capacity = 1024 * 2000 / 2500 = 819 1024 - 819 = 205 (<- thermal pressure) This patch relies on the new arch_update_thermal_pressure() handling correctly such use case (with boost frequencies). Signed-off-by: Lukasz Luba Reviewed-by: Thara Gopinath Signed-off-by: Viresh Kumar commit 93d9e6f93e1586fcc97498c764be2e8c8401f4bd Author: Lukasz Luba Date: Tue Nov 9 19:57:12 2021 +0000 cpufreq: qcom-cpufreq-hw: Update offline CPUs per-cpu thermal pressure The thermal pressure signal gives information to the scheduler about reduced CPU capacity due to thermal. It is based on a value stored in a per-cpu 'thermal_pressure' variable. The online CPUs will get the new value there, while the offline won't. Unfortunately, when the CPU is back online, the value read from per-cpu variable might be wrong (stale data). This might affect the scheduler decisions, since it sees the CPU capacity differently than what is actually available. Fix it by making sure that all online+offline CPUs would get the proper value in their per-cpu variable when there is throttling or throttling is removed. Fixes: 275157b367f479 ("cpufreq: qcom-cpufreq-hw: Add dcvs interrupt support") Reviewed-by: Thara Gopinath Signed-off-by: Lukasz Luba Signed-off-by: Viresh Kumar commit 5168b1be09055436cc9ff34509bda1719023baa8 Author: Lukasz Luba Date: Tue Nov 9 19:57:11 2021 +0000 thermal: cpufreq_cooling: Use new thermal pressure update function Thermal pressure provides a new API, which allows to use CPU frequency as an argument. That removes the need of local conversion to capacity. Use this new function and remove old conversion code. Signed-off-by: Lukasz Luba Signed-off-by: Viresh Kumar commit c214f124161d446b340597e7c968e0a2dc149142 Author: Lukasz Luba Date: Tue Nov 9 19:57:10 2021 +0000 arch_topology: Introduce thermal pressure update function The thermal pressure is a mechanism which is used for providing information about reduced CPU performance to the scheduler. Usually code has to convert the value from frequency units into capacity units, which are understandable by the scheduler. Create a common conversion code which can be just used via a handy API. Internally, the topology_update_thermal_pressure() operates on frequency in MHz and max CPU frequency is taken from 'freq_factor' (per-cpu). Signed-off-by: Lukasz Luba Reviewed-by: Thara Gopinath Signed-off-by: Viresh Kumar commit 0af4cbfa73afa814a80eb205a9cca8ea78bcc2b7 Author: Randy Dunlap Date: Mon Nov 22 21:09:28 2021 -0800 drm/i915/gem: placate scripts/kernel-doc Correct kernel-doc warnings in i915_drm_object.c: i915_gem_object.c:103: warning: expecting prototype for i915_gem_object_fini(). Prototype was for __i915_gem_object_fini() instead i915_gem_object.c:110: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Mark up the object's coherency levels for a given cache_level i915_gem_object.c:110: warning: missing initial short description on line: * Mark up the object's coherency levels for a given cache_level i915_gem_object.c:457: warning: No description found for return value of 'i915_gem_object_read_from_page' Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Thomas Hellström Cc: Matthew Auld Cc: Jani Nikula Cc: Joonas Lahtinen Cc: Rodrigo Vivi Cc: Tvrtko Ursulin Cc: intel-gfx@lists.freedesktop.org Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20211123050928.20434-1-rdunlap@infradead.org commit 35b97bb941110a20fea1f3125837a98fdf8de054 Author: Samuel Holland Date: Thu Nov 18 22:35:44 2021 -0600 clk: sunxi-ng: Add support for the D1 SoC clocks The D1 SoC contains a CCU and a R_CCU (PRCM CCU). Add support for them. Signed-off-by: Samuel Holland Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20211119043545.4010-7-samuel@sholland.org commit b30fc68e6ce543130cfcf69fb02bafbcf961a7d4 Author: Samuel Holland Date: Thu Nov 18 22:35:43 2021 -0600 clk: sunxi-ng: gate: Add macros for gates with fixed dividers It is possible to declare a gate with a fixed divider, by using the CCU_FEATURE_ALL_PREDIV flag. Since this is not obvious, add a macro for declaring this type of clock. Signed-off-by: Samuel Holland Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20211119043545.4010-6-samuel@sholland.org commit 8107c859a39159872ca45f751c4a70a89abe3321 Author: Samuel Holland Date: Thu Nov 18 22:35:42 2021 -0600 clk: sunxi-ng: mux: Add macros using clk_parent_data and clk_hw Referencing parents with clk_hw pointers is more efficient and removes the dependency on global clock names. clk_parent_data is needed when some parent clocks are provided from another driver. Add macros for declaring muxes that take advantage of these. Signed-off-by: Samuel Holland Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20211119043545.4010-5-samuel@sholland.org commit 639e1acb69b5fc0db3621799278033e954e84d25 Author: Samuel Holland Date: Thu Nov 18 22:35:41 2021 -0600 clk: sunxi-ng: mp: Add macros using clk_parent_data and clk_hw Referencing parents with clk_hw pointers is more efficient and removes the dependency on global clock names. clk_parent_data is needed when some parent clocks are provided from another driver. Add macros for declaring dividers that take advantage of these. Signed-off-by: Samuel Holland Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20211119043545.4010-4-samuel@sholland.org commit 3317cb17d5da8416e0a0d9fe3c87dc846f3eb953 Author: Samuel Holland Date: Thu Nov 18 22:35:40 2021 -0600 clk: sunxi-ng: div: Add macros using clk_parent_data and clk_hw Referencing parents with clk_hw pointers is more efficient and removes the dependency on global clock names. clk_parent_data is needed when some parent clocks are provided from another driver. Add macros for declaring dividers that take advantage of these. Signed-off-by: Samuel Holland Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20211119043545.4010-3-samuel@sholland.org commit c962f10f3931e8409f67dc52725df13e23c67d2d Author: Samuel Holland Date: Thu Nov 18 22:35:39 2021 -0600 dt-bindings: clk: Add compatibles for D1 CCUs The D1 has a CCU and a R_CCU (PRCM CCU) like most other sunxi SoCs, with 3 and 4 clock inputs, respectively. Add the compatibles and bindings. Signed-off-by: Samuel Holland Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20211119043545.4010-2-samuel@sholland.org commit 91389c390521a02ecfb91270f5b9d7fae4312ae5 Author: Samuel Holland Date: Thu Nov 18 21:33:37 2021 -0600 clk: sunxi-ng: Allow the CCU core to be built as a module Like the individual CCU drivers, it can be beneficial for memory consumption of cross-platform configurations to only load the CCU core on the relevant platform. For example, a generic arm64 kernel sees the following improvement when building the CCU core and drivers as modules: before: text data bss dec hex filename 13882360 5251670 360800 19494830 12977ae vmlinux after: text data bss dec hex filename 13734787 5086442 360800 19182029 124b1cd vmlinux So the result is a 390KB total reduction in kernel image size. The one early clock provider (sun5i) requires the core to be built in. Now that loading the MMC driver will trigger loading the CCU core, the MMC timing mode functions do not need a compile-time fallback. Signed-off-by: Samuel Holland Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20211119033338.25486-5-samuel@sholland.org commit 7ec03b588d2214d11bea91d5f9ffa444094d3cbd Author: Samuel Holland Date: Thu Nov 18 21:33:36 2021 -0600 clk: sunxi-ng: Convert early providers to platform drivers The PRCM CCU drivers depend on clocks provided by other CCU drivers. For example, the sun8i-r-ccu driver uses the "pll-periph" clock provided by the SoC's main CCU. However, sun8i-r-ccu is an early OF clock provider, and many of the main CCUs (e.g. sun50i-a64-ccu) use platform drivers. This means that the consumer clocks will be orphaned until the supplier driver is bound. This can be avoided by converting the remaining CCUs to use platform drivers. Then fw_devlink will ensure the drivers are bound in the optimal order. The sun5i CCU is the only one which actually needs to be an early clock provider, because it provides the clock for the system timer. That one is left alone. Signed-off-by: Samuel Holland Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20211119033338.25486-4-samuel@sholland.org commit ebd922967f33be0ace3f53b2143f77c167c7e99d Author: Peng Fan Date: Fri Nov 12 14:26:04 2021 +0800 arm64: dts: imx8qxp: add cache info i.MX8QXP A35 Cluster has 32KB Icache, 32KB Dcache and 512KB L2 Cache - Icache is 2-way set associative - Dcache is 4-way set associative - L2cache is 8-way set associative - Line size are 64bytes Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit b0b46118ed265592b935d7a39098c24f20c49620 Author: Peng Fan Date: Fri Nov 12 14:26:03 2021 +0800 arm64: dts: imx8qm: add cache info i.MX8QM A53 Cluster has 32KB Icache, 32KB Dcache and 1MB L2 Cache - Icache is 2-way set associative - Dcache is 4-way set associative - L2cache is 16-way set associative - Line size are 64bytes A72 Cluster has 48KB Icache, 32KB Dcache and 1MB L2 Cache - ICache is 3-way set-associative - Dcache is 2-way set-associative - L2Cache is 16-way set-associative - Line size are 64bytes Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit cb551b5e3bab54265f374a394e239f5e492a5742 Author: Peng Fan Date: Fri Nov 12 14:26:02 2021 +0800 arm64: dts: imx8m: add cache info i.MX8M Family use A53 Cores and has 32KB ICache with 32KB DCache. - Icache is 2-way set associative - Dcache is 4-way set associative - L2cache is 16-way set associative - Line size are 64bytes Except i.MX8MQ has 1MB L2 Cache, others has 512KB L2 Cache. So add the cache info in device tree and let use could see that from /sys/devices/system/cpu/cpu[x]/cache/ Signed-off-by: Peng Fan Signed-off-by: Shawn Guo commit 3c542cfa8266e3364938d055b3d548b7bed7f08e Author: Stanislav Lisovskiy Date: Mon Nov 22 23:14:20 2021 +0200 drm/i915/dg2: Tile 4 plane format support TileF(Tile4 in bspec) format is 4K tile organized into 64B subtiles with same basic shape as for legacy TileY which will be supported by Display13. v2: - Fixed wrong case condition(Jani Nikula) - Increased I915_FORMAT_MOD_F_TILED up to 12(Imre Deak) v3: - s/I915_TILING_F/TILING_4/g - s/I915_FORMAT_MOD_F_TILED/I915_FORMAT_MOD_4_TILED/g - Removed unneeded fencing code v4: - Rebased, fixed merge conflict with new table-oriented format modifier checking(Stan) - Replaced the rest of "Tile F" mentions to "Tile 4"(Stan) v5: - Still had to remove some Tile F mentionings - Moved has_4tile from adlp to DG2(Ramalingam C) - Check specifically for DG2, but not the Display13(Imre) v6: - Moved Tile4 associating struct for modifier/display to the beginning(Imre Deak) - Removed unneeded case I915_FORMAT_MOD_4_TILED modifier checks(Imre Deak) - Fixed I915_FORMAT_MOD_4_TILED to be 9 instead of 12 (Imre Deak) v7: - Fixed display_ver to { 13, 13 }(Imre Deak) - Removed redundant newline(Imre Deak) Reviewed-by: Imre Deak Cc: Imre Deak Cc: Matt Roper Cc: Maarten Lankhorst Signed-off-by: Stanislav Lisovskiy Signed-off-by: Matt Roper Signed-off-by: Juha-Pekka Heikkilä Link: https://patchwork.freedesktop.org/patch/msgid/20211122211420.31584-1-stanislav.lisovskiy@intel.com commit ec3bb890817e4398f2d46e12e2e205495b116be9 Author: Nicolas Dichtel Date: Mon Nov 22 11:33:13 2021 +0100 xfrm: fix dflt policy check when there is no policy configured When there is no policy configured on the system, the default policy is checked in xfrm_route_forward. However, it was done with the wrong direction (XFRM_POLICY_FWD instead of XFRM_POLICY_OUT). The default policy for XFRM_POLICY_FWD was checked just before, with a call to xfrm[46]_policy_check(). CC: stable@vger.kernel.org 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 bcf141b2eb551b3477b24997ebc09c65f117a803 Author: Ghalem Boudour Date: Fri Nov 19 18:20:16 2021 +0100 xfrm: fix policy lookup for ipv6 gre packets On egress side, xfrm lookup is called from __gre6_xmit() with the fl6_gre_key field not initialized leading to policies selectors check failure. Consequently, gre packets are sent without encryption. On ingress side, INET6_PROTO_NOPOLICY was set, thus packets were not checked against xfrm policies. Like for egress side, fl6_gre_key should be correctly set, this is now done in decode_session6(). Fixes: c12b395a4664 ("gre: Support GRE over IPv6") Cc: stable@vger.kernel.org Signed-off-by: Ghalem Boudour Signed-off-by: Nicolas Dichtel Signed-off-by: Steffen Klassert commit 77e0164630364ebd738f8cc1858f41e655acf38c Author: Rob Herring Date: Tue Nov 9 10:16:19 2021 -0600 i2c: Remove unused Netlogic/Sigma Designs XLR driver Commits 95b8a5e0111a ("MIPS: Remove NETLOGIC support") and edd4488aea9c ("ARM: remove tango platform") removed Netlogic XLR and Sigma Designs Tango platforms which means there are no platforms using the XLR I2C driver and it can be removed. Signed-off-by: Rob Herring Signed-off-by: Wolfram Sang commit ef99066c7dede6ed2b67661308c3f22d526afcdb Author: Rob Herring Date: Tue Nov 9 10:16:18 2021 -0600 i2c: Remove Netlogic XLP variant Netlogic XLP was removed in commit 95b8a5e0111a ("MIPS: Remove NETLOGIC support"). With those gone, the single platform left to support is Cavium ThunderX2. Remove the Netlogic variant and DT support. For simplicity, the existing kconfig name is retained. Signed-off-by: Rob Herring Acked-by George Cherian Signed-off-by: Wolfram Sang commit 8c92606ab81086db00cbb73347d124b4eb169b7e Author: Andrey Ryabinin Date: Mon Nov 15 19:46:07 2021 +0300 sched/cpuacct: Make user/system times in cpuacct.stat more precise cpuacct.stat shows user time based on raw random precision tick based counters. Use cputime_addjust() to scale these values against the total runtime accounted by the scheduler, like we already do for user/system times in /proc//stat. Signed-off-by: Andrey Ryabinin Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Daniel Jordan Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20211115164607.23784-4-arbn@yandex-team.com commit dd02d4234c9a2214a81c57a16484304a1a51872a Author: Andrey Ryabinin Date: Mon Nov 15 19:46:06 2021 +0300 sched/cpuacct: Fix user/system in shown cpuacct.usage* cpuacct has 2 different ways of accounting and showing user and system times. The first one uses cpuacct_account_field() to account times and cpuacct.stat file to expose them. And this one seems to work ok. The second one is uses cpuacct_charge() function for accounting and set of cpuacct.usage* files to show times. Despite some attempts to fix it in the past it still doesn't work. Sometimes while running KVM guest the cpuacct_charge() accounts most of the guest time as system time. This doesn't match with user&system times shown in cpuacct.stat or proc//stat. Demonstration: # git clone https://github.com/aryabinin/kvmsample # make # mkdir /sys/fs/cgroup/cpuacct/test # echo $$ > /sys/fs/cgroup/cpuacct/test/tasks # ./kvmsample & # for i in {1..5}; do cat /sys/fs/cgroup/cpuacct/test/cpuacct.usage_sys; sleep 1; done 1976535645 2979839428 3979832704 4983603153 5983604157 Use cpustats accounted in cpuacct_account_field() as the source of user/sys times for cpuacct.usage* files. Make cpuacct_charge() to account only summary execution time. Fixes: d740037fac70 ("sched/cpuacct: Split usage accounting into user_usage and sys_usage") Signed-off-by: Andrey Ryabinin Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Daniel Jordan Acked-by: Tejun Heo Cc: Link: https://lore.kernel.org/r/20211115164607.23784-3-arbn@yandex-team.com commit c7ccbf4b6174e32c130892570db06d0f496cfef0 Author: Andrey Ryabinin Date: Mon Nov 15 19:46:05 2021 +0300 cpuacct: Convert BUG_ON() to WARN_ON_ONCE() Replace fatal BUG_ON() with more safe WARN_ON_ONCE() in cpuacct_cpuusage_read(). Signed-off-by: Andrey Ryabinin Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Daniel Jordan Acked-by: Tejun Heo Link: https://lore.kernel.org/r/20211115164607.23784-2-arbn@yandex-team.com commit 9731698ecb9c851f353ce2496292ff9fcea39dff Author: Andrey Ryabinin Date: Mon Nov 15 19:46:04 2021 +0300 cputime, cpuacct: Include guest time in user time in cpuacct.stat cpuacct.stat in no-root cgroups shows user time without guest time included int it. This doesn't match with user time shown in root cpuacct.stat and /proc//stat. This also affects cgroup2's cpu.stat in the same way. Make account_guest_time() to add user time to cgroup's cpustat to fix this. Fixes: ef12fefabf94 ("cpuacct: add per-cgroup utime/stime statistics") Signed-off-by: Andrey Ryabinin Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Daniel Jordan Acked-by: Tejun Heo Cc: Link: https://lore.kernel.org/r/20211115164607.23784-1-arbn@yandex-team.com commit 16dd3bb5c190654854c0846ee433076139f71c6a Author: Wei Yongjun Date: Tue Nov 23 08:36:17 2021 +0000 pinctrl: samsung: Make symbol 'exynos7885_pin_ctrl' static The sparse tool complains as follows: drivers/pinctrl/samsung/pinctrl-exynos-arm64.c:490:31: warning: symbol 'exynos7885_pin_ctrl' was not declared. Should it be static? This symbol is not used outside of pinctrl-exynos-arm64.c, so marks it static. Fixes: b0ef7b1a7a07 ("pinctrl: samsung: Add Exynos7885 SoC specific data") Signed-off-by: Wei Yongjun Link: https://lore.kernel.org/r/20211123083617.2366756-1-weiyongjun1@huawei.com Signed-off-by: Krzysztof Kozlowski commit 97004c1a4c52b4357169290158a130ca0b7caae1 Author: Rashmi A Date: Wed Oct 27 17:25:16 2021 +0530 phy: intel: Add Thunder Bay eMMC PHY support Add support of eMMC PHY for Intel Thunder Bay SoC, uses the Arasan eMMC phy Signed-off-by: Rashmi A Reviewed-by: Adrian Hunter Link: https://lore.kernel.org/r/20211027115516.4475-5-rashmi.a@intel.com Signed-off-by: Vinod Koul commit efb6935dd786a9d213ee542ed77d47ece700357c Author: Rashmi A Date: Wed Oct 27 17:25:15 2021 +0530 dt-bindings: phy: intel: Add Thunder Bay eMMC PHY bindings Binding description for Intel Thunder Bay eMMC PHY. Added the newly introduced files into MAINTAINERS file-list Signed-off-by: Rashmi A Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211027115516.4475-4-rashmi.a@intel.com Signed-off-by: Vinod Koul commit 305524902a00455b61ddc44800ac5c39198e24f7 Author: Horatiu Vultur Date: Tue Nov 16 11:08:18 2021 +0100 phy: Add lan966x ethernet serdes PHY driver Add the Microchip lan966x ethernet serdes PHY driver for interfaces available in the lan966x SoC. Signed-off-by: Horatiu Vultur Link: https://lore.kernel.org/r/20211116100818.1615762-4-horatiu.vultur@microchip.com Signed-off-by: Vinod Koul commit ea8a163e02d6925773129e2dd86e419e491b791d Author: Horatiu Vultur Date: Tue Nov 16 11:08:17 2021 +0100 dt-bindings: phy: Add constants for lan966x serdes Lan966x has: 2 integrated PHYs, 3 SerDes and 2 RGMII interfaces. Which requires to be muxed based on the HW representation. So add constants for each interface to be able to distinguish them. Reviewed-by: Rob Herring Signed-off-by: Horatiu Vultur Link: https://lore.kernel.org/r/20211116100818.1615762-3-horatiu.vultur@microchip.com Signed-off-by: Vinod Koul commit fd66e57e46a3d1b73912e4a04b1f17d3369f8bfa Author: Horatiu Vultur Date: Tue Nov 16 11:08:16 2021 +0100 dt-bindings: phy: Add lan966x-serdes binding Document the lan966x ethernet serdes phy driver bindings. Reviewed-by: Rob Herring Signed-off-by: Horatiu Vultur Link: https://lore.kernel.org/r/20211116100818.1615762-2-horatiu.vultur@microchip.com Signed-off-by: Vinod Koul commit be24d24840ccb6f35ecd866005bf1b9498cddf97 Author: Aswath Govindraju Date: Tue Nov 2 16:51:20 2021 +0530 phy: phy-can-transceiver: Make devm_gpiod_get optional In some cases the standby/enable gpio can be pulled low/high and would not be connected to a gpio. The current driver implementation will return an error in these cases. Therefore, make devm_gpiod_get optional. Signed-off-by: Aswath Govindraju Acked-by: Marc Kleine-Budde Link: https://lore.kernel.org/r/20211102112120.23637-1-a-govindraju@ti.com Signed-off-by: Vinod Koul commit a463462998777af31995e309617918552983b890 Author: Yang Guang Date: Thu Nov 4 14:52:33 2021 +0800 phy: cadence-torrent: use swap() to make code cleaner Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid opencoding it. Reported-by: Zeal Robot Signed-off-by: Yang Guang Link: https://lore.kernel.org/r/20211104065233.1833499-1-yang.guang5@zte.com.cn Signed-off-by: Vinod Koul commit b1f9f4541e99a43e3d52bc65408d0b96a340c1df Author: Kunihiko Hayashi Date: Fri Oct 29 19:39:07 2021 +0900 phy: uniphier-ahci: Add support for Pro4 SoC Add support for PHY interface built into ahci controller implemented in UniPhier Pro4 SoC. Pro4 SoC distinguishes it from other SoCs as "legacy" SoC, which has GIO clock line. And Pro4 AHCI-PHY needs to control additional reset lines ("pm", "tx", and "rx"). Signed-off-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/1635503947-18250-9-git-send-email-hayashi.kunihiko@socionext.com Signed-off-by: Vinod Koul commit 34f92b67621fe933ed9a3ed5a6f432541d183851 Author: Kunihiko Hayashi Date: Fri Oct 29 19:39:06 2021 +0900 dt-bindings: phy: uniphier-ahci: Add bindings for Pro4 SoC Update AHCI-PHY binding document for UniPhier Pro4 SoC. Add a compatible string, clock and reset lines for the SoC to the document. Pro4 AHCI-PHY needs to control additional GIO clock line and reset lines ("pm", "tx", and "rx"). Signed-off-by: Kunihiko Hayashi Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/1635503947-18250-8-git-send-email-hayashi.kunihiko@socionext.com Signed-off-by: Vinod Koul commit 7f1abed4e9a5d0e0f565ae6c74bf258a97fa8f86 Author: Kunihiko Hayashi Date: Fri Oct 29 19:39:05 2021 +0900 phy: uniphier-pcie: Add dual-phy support for NX1 SoC NX1 SoC supports 2 lanes and has dual-phy. Should set appropriate configuration values to both PHY registers. Signed-off-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/1635503947-18250-7-git-send-email-hayashi.kunihiko@socionext.com Signed-off-by: Vinod Koul commit 25bba42f95f6ad22295c5a0204086ace9bff1e4a Author: Kunihiko Hayashi Date: Fri Oct 29 19:39:04 2021 +0900 phy: uniphier-pcie: Set VCOPLL clamp mode in PHY register Set VCOPLL clamp mode to mode 0 to avoid hardware unstable issue. Signed-off-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/1635503947-18250-6-git-send-email-hayashi.kunihiko@socionext.com Signed-off-by: Vinod Koul commit 1c1597c8027aa4a98a56e8b5b341ddc38451f0e8 Author: Kunihiko Hayashi Date: Fri Oct 29 19:39:03 2021 +0900 phy: uniphier-pcie: Add compatible string and SoC-dependent data for NX1 SoC Add basic support for UniPhier NX1 SoC. This includes a compatible string, SoC-dependent data, and a function that set to 2-lane mode. Signed-off-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/1635503947-18250-5-git-send-email-hayashi.kunihiko@socionext.com Signed-off-by: Vinod Koul commit 21db1010cd80763c622d2e5e3f084e2af8a4b682 Author: Kunihiko Hayashi Date: Fri Oct 29 19:39:02 2021 +0900 dt-bindings: phy: uniphier-pcie: Add bindings for NX1 SoC Update PCIe-PHY binding document for UniPhier NX1 SoC. Add a compatible string for the SoC to the document. Signed-off-by: Kunihiko Hayashi Acked-by: Rob Herring Link: https://lore.kernel.org/r/1635503947-18250-4-git-send-email-hayashi.kunihiko@socionext.com Signed-off-by: Vinod Koul commit 877e8d28bc840f1240852280850cdea5d97c1151 Author: Kunihiko Hayashi Date: Fri Oct 29 19:39:01 2021 +0900 phy: uniphier-usb3: Add compatible string for NX1 SoC Add basic support for UniPhier NX1 SoC. This includes a compatible string and the same SoC-dependent data as LD20/PXs3 SoCs. Signed-off-by: Kunihiko Hayashi Link: https://lore.kernel.org/r/1635503947-18250-3-git-send-email-hayashi.kunihiko@socionext.com Signed-off-by: Vinod Koul commit d0cfb865b363e6de30295348fca20d9c6810a0dc Author: Kunihiko Hayashi Date: Fri Oct 29 19:39:00 2021 +0900 dt-bindings: phy: uniphier-usb3: Add bindings for NX1 SoC Update USB3-PHY binding document for UniPhier NX1 SoC. Add SS-PHY and HS-PHY compatible strings for the SoC to the document. Signed-off-by: Kunihiko Hayashi Acked-by: Rob Herring Link: https://lore.kernel.org/r/1635503947-18250-2-git-send-email-hayashi.kunihiko@socionext.com Signed-off-by: Vinod Koul commit 5c2ecfce44b28aefeac4053a3680ae3a46e57f39 Author: David Heidelberg Date: Sun Oct 31 12:32:36 2021 +0100 dt-bindings: phy: Tegra194 P2U convert to YAML Convert Tegra194 P2U binding to the YAML format. Signed-off-by: David Heidelberg Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211031113236.29712-1-david@ixit.cz Signed-off-by: Vinod Koul commit e45dbd3a4b1111f622edcbbec00adae81659eba7 Author: Martin Blumenstingl Date: Wed Oct 20 21:51:07 2021 +0200 phy: amlogic: Add a new driver for the HDMI TX PHY on Meson8/8b/8m2 Amlogic Meson8/8b/8m2 have a built-in HDMI PHY in the HHI register region. Unfortunately only few register bits are documented. For HHI_HDMI_PHY_CNTL0 the magic numbers are taken from the 3.10 vendor kernel. Signed-off-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20211020195107.1564533-3-martin.blumenstingl@googlemail.com Signed-off-by: Vinod Koul commit 3870a48cd10c216213417e9929d9ffa85edb6ed5 Author: Martin Blumenstingl Date: Wed Oct 20 21:51:06 2021 +0200 dt-bindings: phy: Add the Amlogic Meson8 HDMI TX PHY bindings Amlogic Meson8, Meson8b and Meson8m2 all include an identical (or at least very similar) HDMI TX PHY. The PHY registers are part of the HHI register area. Signed-off-by: Martin Blumenstingl Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211020195107.1564533-2-martin.blumenstingl@googlemail.com Signed-off-by: Vinod Koul commit f199223cb490be108e3e44a6577fb76bc6ca8bbe Author: Bjorn Andersson Date: Wed Nov 3 16:44:10 2021 -0700 phy: qcom: Introduce new eDP PHY driver Many recent Qualcomm platforms comes with native DP and eDP support. This consists of a controller in the MDSS and a QMP-like PHY. While similar to the well known QMP block, the eDP PHY only has TX lanes and the programming sequences are slightly different. Rather than continuing the trend of parameterize the QMP driver to pieces, this introduces the support as a new driver. The registration of link and pixel clocks are borrowed from the QMP driver. The non-DP link frequencies are omitted for now. The eDP PHY is very similar to the dedicated (non-USB) DP PHY, but only the prior is supported for now. Signed-off-by: Bjorn Andersson Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/20211103234410.1352424-2-bjorn.andersson@linaro.org Signed-off-by: Vinod Koul commit 26379667d26f33083484f0df814afec3a955b974 Author: Bjorn Andersson Date: Wed Nov 3 16:44:09 2021 -0700 dt-bindings: phy: Introduce Qualcomm eDP PHY binding Introduce a binding for the eDP PHY hardware block found in several different Qualcomm platforms. Signed-off-by: Bjorn Andersson Reviewed-by: Stephen Boyd Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211103234410.1352424-1-bjorn.andersson@linaro.org Signed-off-by: Vinod Koul commit d3bc6269e21fc474763708e79c7a118740befb94 Author: Rafał Miłecki Date: Tue Oct 26 11:37:16 2021 +0200 phy: bcm-ns-usb2: support updated DT binding with PHY reg space Updated DT binding maps just a PHY's register space instead of the whole DMU block. Accessing a common CRU reg is handled using syscon & regmap. The old binding has been deprecated and remains supported as a fallback method. Signed-off-by: Rafał Miłecki Link: https://lore.kernel.org/r/20211026093716.5567-1-zajec5@gmail.com Signed-off-by: Vinod Koul commit fa721d4f0b91f525339996f4faef7bb072d70162 Author: Drew Fustini Date: Sun Nov 21 23:05:30 2021 -0800 selftests/bpf: Fix trivial typo Fix trivial typo in comment from 'oveflow' to 'overflow'. Reported-by: Gustavo A. R. Silva Signed-off-by: Drew Fustini Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211122070528.837806-1-dfustini@baylibre.com commit 7c1c1d36e83073aab18d3dd596b735bcc6ea7984 Author: Jason Wang Date: Sun Nov 14 13:53:33 2021 +0800 firmware: ti_sci: rm: remove unneeded semicolon The semicolon after `}' is unneeded. So, just remove it. Signed-off-by: Jason Wang Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/20211114055333.217919-1-wangborong@cdjrlc.com commit 8aa35e0bb5eaa42bac415ad0847985daa7b4890c Author: Jan Kiszka Date: Mon Jun 21 20:08:28 2021 +0200 soc: ti: pruss: fix referenced node in error message So far, "(null)" is reported for the node that is missing clocks. Signed-off-by: Jan Kiszka Acked-by: Suman Anna Signed-off-by: Nishanth Menon Link: https://lore.kernel.org/r/d6e24953-ea89-fd1c-6e16-7a0142118054@siemens.com commit 65c16dd2942f4476a3f96a2625b1475c6137c09a Merge: 6d86bdb391c74 3bf4cd8b747a2 Author: Mark Brown Date: Mon Nov 22 23:57:32 2021 +0000 ASoC: SOF: Add PM support for i.MX8/i.MX8X/i.MX8M Merge series from Daniel Baluta : This patch series adds support for System PM and Runtime PM with SOF for i.MX8 platforms. commit 6d86bdb391c7409a1783aabd2b05e5feb83cdd41 Merge: 21b159264d7d3 ac5e3efd55868 Author: Mark Brown Date: Mon Nov 22 23:56:02 2021 +0000 ASoC: stm32: add pm runtime support Merge series from Olivier Moysan : Enable support of pm runtime on STM32 SPDIFRX, I2S and DFSDM drivers to allow power state monitoring. commit 21b159264d7d3e745a1d5ff1351b287fcb73ad55 Merge: 277444544f457 8c9b9cfb77246 Author: Mark Brown Date: Mon Nov 22 23:56:00 2021 +0000 Support BCLK input clock in tlv320aic31xx Merge series from Ariel D'Alessandro : This patchset modifies the tlv320aic31xx driver to update its sysclk if BCLK is used as the input clock. This allows to be used by the generic fsl-asoc-card, without having to add a specific driver. commit 277444544f457ecb8b74317da952ed357eb7e66a Merge: fdd535283779e 05827a1537f35 Author: Mark Brown Date: Mon Nov 22 23:55:59 2021 +0000 ASoC: SOF: enable multicore with dynamic pipelines Merge series from Kai Vehmanen : When a pipeline is marked dynamic in the SOF DSP firmware topology definition (the tplg file kernel loads from filesystem), it means the pipeline resources are not allocated when DSP is booted (at driver probe, or at runtime resume), but rather delayed until the pipeline is actually used. commit c18c8891111bb5e014e144716044991112f16833 Merge: 136057256686d a713ca234ea9d Author: Dave Airlie Date: Tue Nov 23 09:38:29 2021 +1000 Merge tag 'drm-misc-next-2021-11-18' of git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next for 5.17: UAPI Changes: * Remove restrictions on DMA_BUF_SET_NAME ioctl * connector: State of privacy screen * sysfs: Send hotplug uevent Cross-subsystem Changes: * clk/bmc-2835: Fixes * dma-buf: Add dma_resv selftest; Error-handling fixes; Add debugfs helpers; Remove dma_resv_get_excl_unlocked(); Documentation fixes * pwm: Introduce of_pwm_single_xlate() Core Changes: * Support for privacy screens * Make drm_irq.c legacy * Fix __stack_depot_* name conflict * Documentation fixes * Fixes and cleanups * dp-helper: Reuse 8b/10b link-training delay helpers * format-helper: Update interfaces * fb-helper: Allocate shadow buffer of correct size * gem: Link GEM SHMEM and CMA helpers into separate modules; Use dma_resv iterator; Import DMA_BUF namespace into GEM-helper modules * gem/shmem-helper: Interface cleanups * scheduler: Grab fence in drm_sched_job_add_implicit_dependencies(); Lockdep fixes * kms-helpers: Link several files from core into the KMS-helper module Driver Changes: * Use dma_resv_iter in several places * Fixes and cleanups * amdgpu: Use drm_kms_helper_connector_hotplug_event(); Get all fences at once * bridge: Switch to managed MIPI DSI helpers in several places; Register and attach during probe in several places; Convert to YAML in several places * bridge/anx7625: Support MIPI DPI input; Support HDMI audio; Fixes * bridge/dw-hdmi: Allow interlace on bridge * bridge/ps8640: Enable PM; Support aux-bus * bridge/tc358768: Enabled reference clock; Support pulse mode; Modesetting fixes * bridge/ti-sn65dsi86: Use regmap_bulk_write(); Implement PWM * etnaviv: Get all fences at once * gma500: GEM object cleanups; Remove generic drivers in probe function * i915: Support VESA panel backlights * ingenic: Fixes and cleanups * kirin: Adjust probe order * kmb: Enable framebuffer console * lima: Kconfig fixes * meson: Refactoring to supperot DRM_BRIDGE_ATTACH_NO_ENCODER * msm: Fixes and cleanups * msm/dsi: Adjust probe order * omap: Fixes and cleanups * nouveau: CRC fixes; Validate LUTs in atomic check; Set HDMI AVI RGB quantization to FULL; Fixes and cleanups * panel: Support Innolux G070Y2-T02, Vivax TPC-9150, JDI R63452, Newhaven 1.8-128160EF, Wanchanglong W552964ABA, Novatek NT35950, BOE BF060Y8M, Sony Tulip Truly NT35521; Use dev_err_probe() throughout drivers; Fixes and cleanups * panel/ili9881c: Orientation fixes * radeon: Use dma_resv_wait_timeout() * rockchip: Add timeout for DSP hold; Suspend/resume fixes; PLL clock fixes; Implement mmap in GEM object functions * simpledrm: Support FB_DAMAGE_CLIPS and virtual screen sizes * sun4i: Use CMA helpers without vmap support * tidss: Fixes and cleanups * v3d: Cleanups * vc4: Fix HDMI-CEC hang when display is off; Power on HDMI controller while disabling; Support 4k@60 Hz modes; Fixes and cleanups * video: Convert to sysfs_emit() in several places * video/omapfb: Fix fall-through * virtio: Overflow fixes * xen: Implement mmap as GEM object functions Signed-off-by: Dave Airlie From: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/YZYZSypIrr+qcih3@linux-uq9g.fritz.box commit 6326948f940dc3f77066d5cdc44ba6afe67830c0 Author: Paul Moore Date: Wed Sep 29 11:01:21 2021 -0400 lsm: security_task_getsecid_subj() -> security_current_getsecid_subj() The security_task_getsecid_subj() LSM hook invites misuse by allowing callers to specify a task even though the hook is only safe when the current task is referenced. Fix this by removing the task_struct argument to the hook, requiring LSM implementations to use the current task. While we are changing the hook declaration we also rename the function to security_current_getsecid_subj() in an effort to reinforce that the hook captures the subjective credentials of the current task and not an arbitrary task on the system. Reviewed-by: Serge Hallyn Reviewed-by: Casey Schaufler Signed-off-by: Paul Moore commit bcda841f9bf2cddcf2f000cba96f2e27f6f2bdbf Author: Sam Protsenko Date: Mon Nov 22 16:42:06 2021 +0200 clk: samsung: exynos850: Register clocks early Some clocks must be registered before init calls. For example MCT clock (from CMU_PERI) is needed for MCT timer driver, which is registered with TIMER_OF_DECLARE(). By the time we get to core_initcall() used for clk-exynos850 platform driver init, it's already too late. Inability to get "mct" clock in MCT driver leads to kernel panic, as functions registered with *_OF_DECLARE() can't do deferred calls. MCT timer driver can't be fixed either, as it's acting as a clock source and it's essential to register it in start_kernel() -> time_init(). Let's register CMU_PERI clocks early, using CLK_OF_DECLARE(). CMU_TOP generates clocks needed for CMU_PERI, but it's already registered early. While at it, let's cleanup the code a bit, by extracting everything related to CMU initialization and registration to the separate function. Similar issue was discussed at [1] and addressed in commit 1f7db7bbf031 ("clk: renesas: cpg-mssr: Add early clock support"), as well as in drivers/clk/mediatek/clk-mt2712.c. [1] https://patchwork.kernel.org/project/linux-renesas-soc/patch/20180829132954.64862-2-chris.brandt@renesas.com/ Signed-off-by: Sam Protsenko Signed-off-by: Sylwester Nawrocki Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20211122144206.23134-1-semen.protsenko@linaro.org commit 7057474c83817cc707c4a0f08ed05774659a2fc9 Author: Randy Dunlap Date: Sun Nov 21 07:54:52 2021 -0800 drm: ttm: correct ttm_range_manager kernel-doc notation Fix kernel-doc warnings in ttm_range_manager.c: drivers/gpu/drm/ttm/ttm_range_manager.c:144: warning: expecting prototype for ttm_range_man_init(). Prototype was for ttm_range_man_init_nocheck() instead drivers/gpu/drm/ttm/ttm_range_manager.c:178: warning: expecting prototype for ttm_range_man_fini(). Prototype was for ttm_range_man_fini_nocheck() instead Also fix subsequent warnings from scripts/kernel-doc. Signed-off-by: Randy Dunlap Reported-by: kernel test robot Reviewed-by: Huang Rui Reviewed-by: Christian König Cc: Christian König Cc: Huang Rui Cc: dri-devel@lists.freedesktop.org Link: https://patchwork.freedesktop.org/patch/msgid/20211121155453.29736-1-rdunlap@infradead.org Signed-off-by: Christian König commit 11b4da982791dc11dde66e9f0954673cbbf4c690 Author: Christian König Date: Mon Nov 22 13:39:26 2021 +0100 drm/amdgpu: partially revert "svm bo enable_signal call condition" Partially revert commit 5f319c5c21b5909abb43d8aadc92a8aa549ee443. First of all this is illegal use of RCU to call dma_fence_enable_sw_signaling() since we don't hold a reference to the fence in question and can crash badly. Then the code doesn't seem to have the intended effect since only the exclusive fence is handled, but the KFD fences are always added as shared fence. Only keep the handling to throw away the content of SVM BOs. Signed-off-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20211122123926.385017-1-christian.koenig@amd.com Reviewed-by: Felix Kuehling commit 6984fa418b8efde7662af151bae4b8dc66e65fcf Author: Nicholas Kazlauskas Date: Tue Nov 9 11:24:10 2021 -0500 drm/amd/display: Set plane update flags for all planes in reset [Why] We're only setting the flags on stream[0]'s planes so this logic fails if we have more than one stream in the state. This can cause a page flip timeout with multiple displays in the configuration. [How] Index into the stream_status array using the stream index - it's a 1:1 mapping. Fixes: cdaae8371aa9 ("drm/amd/display: Handle GPU reset for DC block") Reviewed-by: Harry Wentland Acked-by: Qingqing Zhuo Signed-off-by: Nicholas Kazlauskas Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 1edf5ae1fdaffb67c1b93e98df670cbe535d13cf Author: Zhan Liu Date: Mon Nov 8 19:31:00 2021 -0500 drm/amd/display: enable seamless boot for DCN301 [Why] DCN301 is capable of running seamless boot if keep_stolen_vga_memory is not set. [How] Add a helper to check whether an ASIC can support seamless boot and set it based on base driver flags. Reviewed-by: Charlene Liu Acked-by: Qingqing Zhuo Signed-off-by: Zhan Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 85fb8bb9d4a5bae9d1abd0d21550517a40ba81e9 Author: Nicholas Kazlauskas Date: Mon Nov 8 13:33:12 2021 -0500 drm/amd/display: Run full global validation in dc_commit_state [Why] Dynamic link encoder assignment expects that it can modify DC current_state and the links associated with the incoming state when performing full validation. This does not align with our actual synchronization constraints in DM's atomic_check. [How] Since link encoder assignment only happens as part of full validation we can just use fast validation as part of atomic_check instead. This satisfy's DC interface requirements and skips the DML calculations needed for pipe programming - hopefully speeding up things a little bit to offset the cost of double validation during stream modification. We already do this as part of dc_commit_updates_for_stream() with validate_bandwidth(), so extend this to dc_commit_state() as well. Reviewed-by: Harry Wentland Acked-by: Qingqing Zhuo Signed-off-by: Nicholas Kazlauskas Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit f8fb5cd412e31d6277c5b0107bb37d677107cbc0 Author: Charlene Liu Date: Mon Nov 8 16:04:45 2021 -0500 drm/amd/display: based on flag reset z10 function pointer [Why & How] Per hardware requirements, add a flag to control z10 enable/disable. Reviewed-by: Sung joon Kim Acked-by: Qingqing Zhuo Signed-off-by: Charlene Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 524a0ba6fab955b14d4ae9a15edbb853e9cad426 Author: Nicholas Kazlauskas Date: Mon Nov 8 16:49:48 2021 -0500 drm/amd/display: Fix DPIA outbox timeout after GPU reset [Why] The HW interrupt gets disabled after GPU reset so we don't receive notifications for HPD or AUX from DMUB - leading to timeout and black screen with (or without) DPIA links connected. [How] Re-enable the interrupt after GPU reset like we do for the other DC interrupts. Fixes: 81927e2808be ("drm/amd/display: Support for DMUB AUX") Reviewed-by: Jude Shih Acked-by: Qingqing Zhuo Signed-off-by: Nicholas Kazlauskas Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 4aaea9d72e9aa01bfad7f48b3ad9d0ed591e7cb2 Author: xinhui pan Date: Fri Nov 19 18:08:31 2021 +0800 drm/amdgpu: Fix double free of dmabuf amdgpu_amdkfd_gpuvm_free_memory_of_gpu drop dmabuf reference increased in amdgpu_gem_prime_export. amdgpu_bo_destroy drop dmabuf reference increased in amdgpu_gem_prime_import. So remove this extra dma_buf_put to avoid double free. Signed-off-by: xinhui pan Tested-by: Felix Kuehling Reviewed-by: Felix Kuehling Acked-by: Christian König Signed-off-by: Alex Deucher commit a0e7e140b5b2cb76e9b455e548234c22585001b6 Author: Amber Lin Date: Thu Nov 18 14:05:51 2021 -0500 drm/amdkfd: Remove unused entries in table Remove unused entries in kfd_device_info table: num_xgmi_sdma_engines and num_sdma_queues_per_engine. They are calculated in kfd_get_num_sdma_engines and kfd_get_num_xgmi_sdma_engines instead. Signed-off-by: Amber Lin Reviewed-by: Graham Sider Signed-off-by: Alex Deucher commit 1f5fc7a50955e20c019ddc73575d8a663301d999 Author: Andrey Grodzovsky Date: Fri Sep 24 14:24:37 2021 -0400 drm/amd/pm: Add debugfs info for STB Add debugfs hook. Signed-off-by: Andrey Grodzovsky Reviewed-by: Lijo Lazar Reviewed-by: Luben Tuikov Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit db5b5c679e6cad2bb147337af6c378d278231b45 Author: Andrey Grodzovsky Date: Fri Sep 17 17:02:52 2021 -0400 drm/amd/pm: Add STB support in sienna_cichlid Add STB implementation for sienna_cichlid Signed-off-by: Andrey Grodzovsky Reviewed-by: Lijo Lazar Reviewed-by: Luben Tuikov Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 79aae67ef8bbc8df09099290fc2c3423dcdab224 Author: Andrey Grodzovsky Date: Thu Sep 23 18:17:53 2021 -0400 drm/amd/pm: Add STB accessors interface Add interface to collect STB logs. Signed-off-by: Andrey Grodzovsky Reviewed-by: Lijo Lazar Reviewed-by: Luben Tuikov Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit ae360bf1821917843c00637530da5b5f5c3c33c7 Author: Jiapeng Chong Date: Thu Nov 18 18:57:19 2021 +0800 drm/amdgpu/pm: clean up some inconsistent indenting Eliminate the follow smatch warning: drivers/gpu/drm/amd/amdgpu/../pm/powerplay/amd_powerplay.c:1554 pp_asic_reset_mode_2() warn: inconsistent indenting. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Alex Deucher commit ee2f17f4d02b14549272aa69da17bdcce2879d1b Author: Amber Lin Date: Thu Nov 18 00:38:59 2021 -0500 drm/amdkfd: Retrieve SDMA numbers from amdgpu Instead of hard coding the number of sdma engines and the number of sdma_xgmi engines in the device_info table, get the number of toal SDMA instances from amdgpu. The first two engines are sdma engines and the rest are sdma-xgmi engines unless the ASIC doesn't support XGMI. v2: add kfd_ prefix to non static function names Signed-off-by: Amber Lin Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit e39938117e781d0bd21ae45b6c15134f4a6958c5 Author: Felix Kuehling Date: Thu Nov 4 16:15:43 2021 -0400 drm/amdgpu: Fix MMIO HDP flush on SRIOV Disable HDP register remapping on SRIOV and set rmmio_remap.reg_offset to the fixed address of the VF register for hdp_v*_flush_hdp. Signed-off-by: Felix Kuehling Tested-by: Bokun Zhang Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit fdcb279d5b798d13b4365bdcf5548855f6c562a1 Author: Stanley.Yang Date: Thu Nov 18 16:30:43 2021 +0800 drm/amdgpu: query umc error info from ecc_table v2 if smu support ECCTABLE, driver can message smu to get ecc_table then query umc error info from ECCTABLE v2: optimize source code makes logical more reasonable Signed-off-by: Stanley.Yang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit edd7942085555cbf8da50c855f35b3fb84606c38 Author: Stanley.Yang Date: Tue Nov 16 21:07:56 2021 +0800 drm/amd/pm: add message smu to get ecc_table v2 support ECC TABLE message, this table include umc ras error count and error address v2: add smu version check to query whether support ecctable call smu_cmn_update_table to get ecctable directly Signed-off-by: Stanley.Yang Reviewed-by: Evan Quan Reviewed-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 8882f90a3fe2457c8b3f86bbbbef8754f704f5ef Author: Stanley.Yang Date: Tue Nov 16 20:44:58 2021 +0800 drm/amdgpu: add new query interface for umc block v2 add message smu to query error information v2: rename message_smu to ecc_info Signed-off-by: Stanley.Yang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 6edc8f8aff61a6512464a123c160aceff44f6a90 Author: Stanley.Yang Date: Tue Nov 16 15:37:19 2021 +0800 drm/amd/pm: Update smu driver interface for aldebaran update smu driver if version to 0x08 to avoid mismatch log A version mismatch can still happen with an older FW Signed-off-by: Stanley.Yang Reviewed-by: Evan Quan Reviewed-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit 92020e81ddbeac351ea4a19bcf01743f32b9c800 Author: Alex Deucher Date: Wed Nov 10 10:23:25 2021 -0500 drm/amdgpu/display: set vblank_disable_immediate for DC Disable vblanks immediately to save power. I think this was missed when we merged DC support. Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1781 Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit a689e8d1f80012f90384ebac9dcfac4201f9f77e Author: Yang Li Date: Mon Nov 15 16:10:19 2021 +0800 drm/amd/display: check top_pipe_to_program pointer Clang static analysis reports this error drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc.c:2870:7: warning: Dereference of null pointer [clang-analyzer-core.NullDereference] if (top_pipe_to_program->stream_res.tg->funcs->lock_doublebuffer_enable) { ^ top_pipe_to_program being NULL is caught as an error But then it is used to report the error. So add a check before using it. Reported-by: Abaci Robot Signed-off-by: Yang Li Signed-off-by: Alex Deucher commit 24adfaffd5adecceb0a2608d5ec2e47756b8a671 Author: Bernard Zhao Date: Mon Nov 15 17:34:35 2021 -0800 drm/amd/display: cleanup the code a bit In function dc_sink_destruct, kfree will check pointer, no need to check again. This change is to cleanup the code a bit. Acked-by: Christian König Signed-off-by: Bernard Zhao Signed-off-by: Alex Deucher commit 13d20aabd6ef501229ac002493c6f237482c47de Author: Bernard Zhao Date: Mon Nov 15 17:47:50 2021 -0800 drm/amd/display: remove no need NULL check before kfree This change is to cleanup the code a bit. Acked-by: Christian König Signed-off-by: Bernard Zhao Signed-off-by: Alex Deucher commit 7b833d680481f463276aedf500696ea25698deaa Author: Bernard Zhao Date: Sun Nov 14 18:58:50 2021 -0800 drm/amd/amdgpu: fix potential memleak In function amdgpu_get_xgmi_hive, when kobject_init_and_add failed There is a potential memleak if not call kobject_put. Reviewed-by: Felix Kuehling Signed-off-by: Bernard Zhao Signed-off-by: Alex Deucher commit 8b11e14bd5793cd0e5cb65055fe51588a779f05b Author: Bernard Zhao Date: Mon Nov 15 04:09:06 2021 -0800 drm/amd/amdgpu: cleanup the code style a bit This change is to cleanup the code style a bit. Signed-off-by: Bernard Zhao Signed-off-by: Alex Deucher commit 7b755d65100eacb63f81c35addbdb0a0ef5806b3 Author: Bernard Zhao Date: Sun Nov 14 23:14:27 2021 -0800 drm/amd/amdgpu: remove useless break after return This change is to remove useless break after return. Signed-off-by: Bernard Zhao Signed-off-by: Alex Deucher commit 88ac6df8af2c1fd02f2f8865257d8b632abeb688 Author: Ye Guojin Date: Fri Nov 12 06:16:51 2021 +0000 drm/amd/display: fix cond_no_effect.cocci warnings This was found by coccicheck: ./drivers/gpu/drm/amd/display/dc/core/dc_resource.c, 2516, 7-9, WARNING possible condition with no effect (if == else) hdmi_info.bits.YQ0_YQ1 is always YYC_QUANTIZATION_LIMITED_RANGE. Reported-by: Zeal Robot Signed-off-by: Ye Guojin Signed-off-by: Alex Deucher commit 1da2fcc435114ea5a65d7e15fc31b4d0ce11113c Author: Jiapeng Chong Date: Wed Nov 17 16:31:08 2021 -0500 drm/amd/display: Clean up some inconsistent indenting Eliminate the follow smatch warning: drivers/gpu/drm/amd/amdgpu/../display/dmub/src/dmub_srv.c:622 dmub_srv_cmd_execute() warn: inconsistent indenting. Reported-by: Abaci Robot Reviewed-by: Christian König Signed-off-by: Jiapeng Chong Signed-off-by: Alex Deucher commit 6c5af7d2f886bf1f1de9cca3310b24a8d7ceaa47 Author: hongao Date: Thu Nov 11 11:32:07 2021 +0800 drm/amdgpu: fix set scaling mode Full/Full aspect/Center not works on vga and dvi connectors amdgpu_connector_vga_get_modes missed function amdgpu_get_native_mode which assign amdgpu_encoder->native_mode with *preferred_mode result in amdgpu_encoder->native_mode.clock always be 0. That will cause amdgpu_connector_set_property returned early on: if ((rmx_type != DRM_MODE_SCALE_NONE) && (amdgpu_encoder->native_mode.clock == 0)) when we try to set scaling mode Full/Full aspect/Center. Add the missing function to amdgpu_connector_vga_get_mode can fix this. It also works on dvi connectors because amdgpu_connector_dvi_helper_funcs.get_mode use the same method. Signed-off-by: hongao Signed-off-by: Alex Deucher commit b295ce39912cb10d3bd34fba556e4009b67954db Author: Roman Li Date: Wed Nov 17 10:05:36 2021 -0500 drm/amd/display: Fix OLED brightness control on eDP [Why] After commit ("drm/amdgpu/display: add support for multiple backlights") number of eDPs is defined while registering backlight device. However the panel's extended caps get updated once before register call. That leads to regression with extended caps like oled brightness control. [How] Update connector ext caps after register_backlight_device Fixes: 7fd13baeb7a3a4 ("drm/amdgpu/display: add support for multiple backlights") Link: https://www.reddit.com/r/AMDLaptops/comments/qst0fm/after_updating_to_linux_515_my_brightness/ Signed-off-by: Roman Li Tested-by: Samuel Čavoj Acked-by: Alex Deucher Reviewed-by: Jasdeep Dhillon Signed-off-by: Alex Deucher commit d9a69fe512c5f032556764041760e8d5098fac26 Author: Candice Li Date: Tue Nov 16 14:13:11 2021 +0800 drm/amdgpu: Add recovery_lock to save bad pages function Fix race condition failure during UMC UE injection. Signed-off-by: Candice Li Reviewed-by: Tao Zhou Signed-off-by: Alex Deucher commit 3ebd8bf02380ddc32556ee87077db3917ccff40c Author: Tao Zhou Date: Fri Nov 12 18:19:22 2021 +0800 drm/amdgpu: support new mode-1 reset interface (v2) If gpu reset is triggered by ras fatal error, tell it to smu in mode-1 reset message. v2: move mode-1 reset function to aldebaran_ppt.c since it's aldebaran specific currently. Signed-off-by: Tao Zhou Reviewed-by: Evan Quan Reviewed-by: Lijo Lazar Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher commit c96cb65989036feaeaff371551b40910f32f3c6c Author: shaoyunl Date: Sun Nov 14 12:38:18 2021 -0500 drm/amd/amdkfd: Fix kernel panic when reset failed and been triggered again In SRIOV configuration, the reset may failed to bring asic back to normal but stop cpsch already been called, the start_cpsch will not be called since there is no resume in this case. When reset been triggered again, driver should avoid to do uninitialization again. Signed-off-by: shaoyunl Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 33155ce6e1a846759ba218ca8aa792305b351133 Author: Lijo Lazar Date: Mon Nov 15 15:23:27 2021 +0800 drm/amd/pm: Remove artificial freq level on Navi1x Print Navi1x fine grained clocks in a consistent manner with other SOCs. Don't show aritificial DPM level when the current clock equals min or max. Signed-off-by: Lijo Lazar Reviewed-by: Evan Quan Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit 6c08e0ef87b8b4c1c243719a561c354e893c415d Author: Evan Quan Date: Fri Nov 5 15:25:30 2021 +0800 drm/amd/pm: avoid duplicate powergate/ungate setting Just bail out if the target IP block is already in the desired powergate/ungate state. This can avoid some duplicate settings which sometimes may cause unexpected issues. Link: https://lore.kernel.org/all/YV81vidWQLWvATMM@zn.tnic/ Bug: https://bugzilla.kernel.org/show_bug.cgi?id=214921 Bug: https://bugzilla.kernel.org/show_bug.cgi?id=215025 Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1789 Signed-off-by: Evan Quan Tested-by: Borislav Petkov Reviewed-by: Lijo Lazar Signed-off-by: Alex Deucher commit ed12f3f198cedbb164129991766e1a42eecc0bac Author: Sung Joon Kim Date: Mon Nov 8 11:19:14 2021 -0500 drm/amd/display: Revert "retain/release stream pointer in link enc table" [why] Change causing issue. Need to revert the change. Reviewed-by: Aric Cyr Acked-by: Wayne Lin Signed-off-by: Sung Joon Kim Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit e90f0bb0c7c7099a0222b00f1dd882d349f9d857 Author: Aric Cyr Date: Mon Nov 8 08:49:44 2021 -0500 drm/amd/display: 3.2.162 This version brings along following fixes: - Fix issue that secondary display goes blank on Non DCN31. - Adjust flushing data in DMCUB - Revert patches which cause regression in hadnling MPO/Link encoder assignment - Correct the setting within MSA of DP2.0 - Adjustment for DML isolation - Fix FIFO erro in fast boot sequence - Enable DSC over eDP - Adjust the DSC power off sequence Reviewed-by: Aric Cyr Acked-by: Wayne Lin Signed-off-by: Aric Cyr Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 8fa6f4c5715cee5dfc04f98780a15eb6d1da5be8 Author: Yi-Ling Chen Date: Fri Nov 5 15:43:25 2021 +0800 drm/amd/display: fixed the DSC power off sequence during Driver PnP [WHY] After unloading driver, driver would not disable DSC function. At next loading driver, driver would power all DSC engines off. When driver powered the active DSC off, the screen would be gray until reprograming DSC relatived register correcntly. [HOW] 1. Remove DSC Power down code into init_pipes() 2. Depend on the OTG mapping information and DSC status to skip power off for the working DSC. Reviewed-by: Anthony Koo Acked-by: Wayne Lin Signed-off-by: Yi-Ling Chen Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 3f232a0fdbb17c64ee9afff1c16efe94514456c5 Author: Anthony Koo Date: Sat Nov 6 11:08:01 2021 -0400 drm/amd/display: [FW Promotion] Release 0.0.93 - Fix ARR39-C issue with scaled integer addition in rb func Reviewed-by: Aric Cyr Acked-by: Wayne Lin Signed-off-by: Anthony Koo Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 1f49355c4c5610b687cfa151ea29acb12e8bd72c Author: Anthony Koo Date: Sun Oct 31 12:25:16 2021 -0400 drm/amd/display: [FW Promotion] Release 0.0.92 Acked-by: Wayne Lin Signed-off-by: Anthony Koo Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 21f45a2363bb0c96ca3e942d7207e7172514b5d2 Author: hvanzyll Date: Fri Nov 5 10:08:25 2021 -0400 drm/amd/display: Visual Confirm Bar Height Adjust [What] This change allows adjustment to the Visual Confirm height border. [Why] Aids debugging and testing [How] Use the existing infrastructure to implement logic to draw borders Reviewed-by: Anthony Koo Acked-by: Wayne Lin Signed-off-by: Harry VanZyllDeJong Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 189789a15f77239d03caad68fe4245be92d7f71c Author: Brandon Syu Date: Wed Nov 3 12:11:28 2021 +0800 drm/amd/display: Fix eDP will flash when boot to OS [WHY] With eDP DSC enabled and set 4K 60Hz, there would be screen corruption when booting to OS or enabling the driver. [HOW] Avoid powering down VDD when we cannot apply eDP fast boot. Reviewed-by: Nicholas Kazlauskas Acked-by: Wayne Lin Signed-off-by: Brandon Syu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 2665f63a7364633ad90b2c58167ed7ae224e5d33 Author: Mikita Lipski Date: Wed Oct 20 08:51:04 2021 -0400 drm/amd/display: Enable DSC over eDP [why] - Adding a DM interface to enable DSC over eDP on Linux - DSC over eDP will allow to power savings by reducing the bandwidth required to support panel's modes - Apply link optimization algorithm to reduce link bandwidth when DSC is enabled [how] - Read eDP panel's DSC capabilities - Apply DSC policy on eDP panel based on its DSC capabilities - Enable DSC encoder's on the pipe - Enable DSC on panel's side by setting DSC_ENABLE DPCD register - Adding link optimization algorithm to reduce link rate or lane count based Reviewed-by: Nicholas Kazlauskas Acked-by: Wayne Lin Signed-off-by: Mikita Lipski Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit 2430be71c0176ef2757b63df5a25aa5c9e488e25 Author: Angus Wang Date: Fri Nov 12 12:13:48 2021 -0500 drm/amd/display: Fix LTTPR not Enabled [WHY] Previous LTTPR change has caused a regression that led to an issue where LTTPR is disabled [HOW] Extended changes from previous fix to DCN30X Reviewed-by: Wesley Chalmers Reviewed-by: Martin Leung Reviewed-by: Bhawanpreet Lakha Acked-by: Qingqing Zhuo Signed-off-by: Angus Wang Signed-off-by: Alex Deucher commit 430bb83dbdf3c86768fcf2f6fba2982823261f6d Author: Xu, Jinze Date: Thu Nov 4 13:47:35 2021 +0800 drm/amd/display: Reset fifo after enable otg [Why] In fast boot sequence, when change dispclk, otg is disabled but digfe is enabled. This may cause dig fifo error. [How] Reset dig fifo after enable otg. Reviewed-by: Jun Lei Reviewed-by: Anthony Koo Acked-by: Wayne Lin Signed-off-by: JinZe.Xu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit d26c4ffba6ac16b734749b8624124fdfced41453 Author: Jun Lei Date: Mon Jun 14 10:18:59 2021 -0400 drm/amd/display: Code change for DML isolation [why] DML itself is SW only, putting the logic as part of resource makes it hw dependent and thus impossible to compile separately from dc. Separate compilation is critical for unit testing as well as bbox tool development [how] create new dml wrapper. Copy logic from the validation functions into dml wrapper as base implementation. Dml wrapper has internal/static implementations for all helpers, and does not reference other functions. It may reference dc structures/types for convenience. This change now has all the changes for DML isolation squashed into one. Reviewed-by: Jun Lei Acked-by: Wayne Lin Signed-off-by: Jun Lei Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit ef9d5a54dae9be855352ead302a9659bb8610285 Author: Wenjing Liu Date: Tue Nov 2 12:43:47 2021 -0400 drm/amd/display: set MSA vsp/hsp to 0 for positive polarity for DP 128b/132b [why] There is a bug in MSA programming sequence that mistakenly set MSA vsp/hsp to 1 for positive polarity. This is incorrect. Reviewed-by: Ariel Bernstein Acked-by: Wayne Lin Signed-off-by: Wenjing Liu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit fd3b2e21b8816273ca7813a8c9455c41ff77a96a Author: Angus Wang Date: Wed Nov 3 11:54:32 2021 -0400 drm/amd/display: Revert changes for MPO underflow [WHY] The previous changes for fixing MPO underflow with multiple display connected caused a regression where the machine runs into a hang when doing multiple driver pnp with multiple displays connected [HOW] Reverted offending change Reviewed-by: Martin Leung Acked-by: Wayne Lin Signed-off-by: Angus Wang Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit a53b554b56e0326edb2ddbbf8c76743191f7819c Author: Nicholas Kazlauskas Date: Tue Nov 2 14:27:30 2021 -0400 drm/amd/display: Only flush delta from last command execution [Why] We're currently flushing commands that had been previously been flushed or are currently being processed by the DMCUB when we don't immediately wait for idle after command execution. [How] Avoiding reflushing the data by keeping track of the last wptr. We'll treat this as the actual rptr by creating a copy of the inbox and modifying the copy's rptr. Reviewed-by: Eric Yang Acked-by: Wayne Lin Signed-off-by: Nicholas Kazlauskas Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit c09bb36dd1230838d49a5ebf409df804a5ebfdaa Author: Ahmad Othman Date: Mon Nov 1 12:07:00 2021 -0400 drm/amd/display: Secondary display goes blank on Non DCN31 [Why] Due to integration issues with branch merging, a regression happened that prevented secondary displays from lighting up or enabling certain features [How] Separated the new logic to be for DCN31 only and retained pre DCN31 logic for all other ASICs Reviewed-by: Wenjing Liu Acked-by: Wayne Lin Signed-off-by: Ahmad Othman Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher commit d25e35bc26c3ca8cd728101545cfb3e86a5d7431 Author: Ramesh Errabolu Date: Mon Nov 8 23:44:16 2021 -0600 drm/amdgpu: Pin MMIO/DOORBELL BO's in GTT domain MMIO/DOORBELL BOs encode control data and should be pinned in GTT domain before enabling PCIe connected peer devices in accessing it Signed-off-by: Ramesh Errabolu Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit f441dd33db4a5ba306d507e70e97f4656d526e38 Author: Ramesh Errabolu Date: Mon Nov 8 23:37:27 2021 -0600 drm/amdgpu: Update BO memory accounting to rely on allocation flag Accounting system to track amount of available memory (system, TTM and VRAM of a device) relies on BO's domain. The change is to rely instead on allocation flag indicating BO type - VRAM, GTT, USERPTR, MMIO or DOORBELL Signed-off-by: Ramesh Errabolu Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 1d925758ba1a5d2716a847903e2fd04efcbd9862 Author: Leo (Hanghong) Ma Date: Fri Nov 12 10:11:35 2021 -0500 drm/amd/display: Reduce dmesg error to a debug print [Why & How] Dmesg errors are found on dcn3.1 during reset test, but it's not a really failure. So reduce it to a debug print. Signed-off-by: Leo (Hanghong) Ma Reviewed-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher commit 625097a9e0c614251cd9ba89b1a416a36495768f Author: Leo (Hanghong) Ma Date: Thu Nov 18 11:38:18 2021 -0500 drm/amd/display: Drop config guard for DC_LOG_DP2 [Why & How] It doesn't make sense to guard DC_LOG_DP2 by CONFIG_DRM_AMD_DCN, and this also caused build failure for allmodconfig; So drop the guard to fix the compile failure; Reviewed-by: Alex Deucher Signed-off-by: Leo (Hanghong) Ma Signed-off-by: Alex Deucher commit 774a90c1e1a340ebad7b1d8783356bed490ca02f Author: Shiraz Saleem Date: Mon Oct 18 18:16:03 2021 -0500 RDMA/irdma: Set protocol based on PF rdma_mode flag Set the RDMA protocol to use at driver bind time based on the ice PF's rdma_mode flag. Signed-off-by: Shiraz Saleem Tested-by: Leszek Kaliszczuk Signed-off-by: Tony Nguyen commit e523af4ee56090fbdd9cf474752448d35930bcd4 Author: Shiraz Saleem Date: Mon Oct 18 18:16:02 2021 -0500 net/ice: Add support for enable_iwarp and enable_roce devlink param Allow support for 'enable_iwarp' and 'enable_roce' devlink params to turn on/off iWARP or RoCE protocol support for E800 devices. For example, a user can turn on iWARP functionality with, devlink dev param set pci/0000:07:00.0 name enable_iwarp value true cmode runtime This add an iWARP auxiliary rdma device, ice.iwarp.<>, under this PF. A user request to enable both iWARP and RoCE under the same PF is rejected since this device does not support both protocols simultaneously on the same port. Signed-off-by: Shiraz Saleem Tested-by: Leszek Kaliszczuk Signed-off-by: Tony Nguyen commit 325e0d0aa683a96b9d9cd5802be524d4da5e2dd2 Author: Shiraz Saleem Date: Mon Oct 18 18:16:01 2021 -0500 devlink: Add 'enable_iwarp' generic device param Add a new device generic parameter to enable and disable iWARP functionality on a multi-protocol RDMA device. Signed-off-by: Shiraz Saleem Tested-by: Leszek Kaliszczuk Signed-off-by: Tony Nguyen commit 7add937f5222fe9a04a2ca3c43a322985219711f Author: Yassine Oudjana Date: Thu Oct 21 13:25:07 2021 +0000 interconnect: qcom: Add MSM8996 interconnect provider driver Add a driver for the MSM8996 NoCs. This chip is similar to SDM660 where some busses are controlled by RPM, while others directly by the AP with writes to QoS registers. Signed-off-by: Yassine Oudjana Link: https://lore.kernel.org/r/20211021132329.234942-5-y.oudjana@protonmail.com Reviewed-by: Dmitry Baryshkov Tested-by: Dmitry Baryshkov #db820c Signed-off-by: Georgi Djakov commit 3e9fdc6b73ca862e72ea8a563638cecdc11d26e2 Author: Yassine Oudjana Date: Thu Oct 21 13:24:54 2021 +0000 dt-bindings: interconnect: Add Qualcomm MSM8996 DT bindings Add bindings for interconnects on Qualcomm MSM8996. Signed-off-by: Yassine Oudjana Reviewed-by: Rob Herring Reviewed-by: Dmitry Baryshkov Tested-by: Dmitry Baryshkov #db820c Link: https://lore.kernel.org/r/20211021132329.234942-4-y.oudjana@protonmail.com Signed-off-by: Georgi Djakov commit 7de109c0abe9bb3f03b3500f3e1840b06c5fd853 Author: Yassine Oudjana Date: Thu Oct 21 13:24:42 2021 +0000 interconnect: icc-rpm: Add support for bus power domain Add support for attaching to a power domain. This is required for Aggregate 0 NoC on MSM8996, which is powered by a GDSC. Signed-off-by: Yassine Oudjana Reviewed-by: Dmitry Baryshkov Tested-by: Dmitry Baryshkov #db820c Link: https://lore.kernel.org/r/20211021132329.234942-3-y.oudjana@protonmail.com Signed-off-by: Georgi Djakov commit 45c548cc5baa047e59865bec5dfa0bd36b48ff17 Author: Yassine Oudjana Date: Thu Oct 21 13:24:25 2021 +0000 dt-bindings: interconnect: Combine SDM660 bindings into RPM schema SDM660 interconnect bindings are similar to other RPM interconnect providers, and now it shares the same common driver with them, so it is better to combine them into qcom,rpm.yaml. Signed-off-by: Yassine Oudjana Reviewed-by: Rob Herring Reviewed-by: Dmitry Baryshkov Tested-by: Dmitry Baryshkov #db820c Link: https://lore.kernel.org/r/20211021132329.234942-2-y.oudjana@protonmail.com Signed-off-by: Georgi Djakov commit 0525f34d02758b801619d5e7093003e66a7efe3c Author: Linus Walleij Date: Sat Nov 20 16:53:26 2021 +0100 power: supply: ab8500: Standardize capacity lookup The AB8500 charger only has one capacity table with unspecified temperature, so we assume this capacity is given for 20 degrees Celsius. Convert this table to use the OCV (open circuit voltage) tables in struct power_supply_battery_ocv_table. In the process, convert the fuel gauge driver to use microvolts and microamperes so we can use the same internals as the power supply subsystem without having to multiply and divide with 1000 in a few places. Also convert high_curr_threshold and lowbat_threshold to use microamperes and microvolts as these are closely related to these changes. Drop the unused overbat_threshold member in the custom struct ab8500_fg_parameters. Signed-off-by: Linus Walleij Signed-off-by: Sebastian Reichel commit 67acb291f3b6636cc52a3f859c91c05688992a15 Author: Linus Walleij Date: Sat Nov 20 16:53:25 2021 +0100 power: supply: ab8500: Standardize temp res lookup The lookup from battery temperature to internal resistance was using its own format. Rewrite this to use the table inside struct power_supply_battery_info:s resist_table. The supplied resistance table has to be rewritten to express the resistance in percent of the factory resistance as a side effect. We can then rely on the library function power_supply_temp2resist_simple() to interpolate the internal resistance percent from the temperature. Signed-off-by: Linus Walleij Signed-off-by: Sebastian Reichel commit bc6e0287140216011b99392fdf687a92707675ad Author: Linus Walleij Date: Sat Nov 20 16:53:24 2021 +0100 power: supply: ab8500: Standardize CV voltage The voltage used in the constant voltage phase of the charging exist in struct power_supply_battery_info as constant_charge_voltage_max_uv. Switch the custom property normal_vol_lvl to this and consequentially change everything that relates to this value over to using microvolts rather than millivolts so we align internal representation of current with the power core. Prefix every variable we change with *_uv to indicate the unit everywhere but also to make sure we do not miss any outlier. Signed-off-by: Linus Walleij Signed-off-by: Sebastian Reichel commit 83e5aa77d1120fd38101f757c4aeb985e9305700 Author: Linus Walleij Date: Sat Nov 20 16:53:23 2021 +0100 power: supply: ab8500: Standardize CC current The current used in the constant current phase of the charging exist in struct power_supply_battery_info as constant_charge_current_max_ua. Switch the custom property max_out_curr to this and consequentally change everything that relates to this value over to using microamperes rather than milliamperes so we align internal representation of current with the power core. Prefix every variable we change with *_ua to indicate the unit everywhere but also to make sure we do not miss any outlier. Drop some duplicate unused defines in a header. Signed-off-by: Linus Walleij Signed-off-by: Sebastian Reichel commit 1091ed7db0d2957e015a5650ed17ff7537c2b3f3 Author: Linus Walleij Date: Sat Nov 20 16:53:22 2021 +0100 power: supply: ab8500: Make recharge capacity a constant The recharge capacity is the hysteresis level for a charger to restart when a battery does not support maintenance charging. All products using the AB8500 have batteries supporting maintenace charging and all code has always set this to 95%. Turn it into a constant. Signed-off-by: Linus Walleij Signed-off-by: Sebastian Reichel commit 9c20899da46b85ed00e6f3b935b4bd9c9b34a571 Author: Linus Walleij Date: Sat Nov 20 16:53:21 2021 +0100 power: supply: ab8500: Standardize termination current The AB8500 custom termination current can be replaced by the corresponding struct power_supply_battery_info field. Remove the struct member and amend the code to use the standard property. Add *_ua suffix for clarity and to make sure we have changed all code sites using this member. Signed-off-by: Linus Walleij Signed-off-by: Sebastian Reichel commit 50425ccf2467db9f4134a60a95ef6b6a580222cb Author: Linus Walleij Date: Sat Nov 20 16:53:20 2021 +0100 power: supply: ab8500: Standardize internal resistance The nominal internal resistance isn't used by the AB8500 charging code, instead this resistance is measured continuously, but we anyways migrate this to the standard property in struct power_supply_battery_info. Signed-off-by: Linus Walleij Signed-off-by: Sebastian Reichel commit fc81c435a8a67c72939b44e851111b2991d5ac51 Author: Linus Walleij Date: Sat Nov 20 16:53:19 2021 +0100 power: supply: ab8500_fg: Init battery data in bind() We were assigning some battery data state in probe() but this is insecure as it depends on the proper probe order between the components: the charger must probe first so that the battery data is populated. Move the init to the bind() call which is certain to happen after the probe of the master and all components has happened. Signed-off-by: Linus Walleij Signed-off-by: Sebastian Reichel commit 2a5f41830aadc2d7f4145eae49381133da5df2a3 Author: Linus Walleij Date: Sat Nov 20 16:53:18 2021 +0100 power: supply: ab8500: Standardize voltages The nominal voltage in this charge driver corresponds to both the voltage_min_design_uv and voltage_max_design_uv of struct power_supply_battery_info so assign both if this is undefined. The overcharge max voltage (when the charger should cut off) is migrated at the same time so we move both voltages to struct power_supply_battery_info. Adjust the code to deal directly with the microvolt values instead of converting them to millivolts. Add *_uv suffixes for clarity and to make sure we have changed all code sites using this member. Signed-off-by: Linus Walleij Signed-off-by: Sebastian Reichel commit 2d3559a50ad6d21552ed2434889bc568acfa2a83 Author: Linus Walleij Date: Sat Nov 20 16:53:17 2021 +0100 power: supply: ab8500: Standardize technology The AB8500 custom battery type can be replaced by the corresponding struct power_supply_battery_info field. Remove the struct member and amend the code to use the standard property. Signed-off-by: Linus Walleij Signed-off-by: Sebastian Reichel commit 22be8d77c80dca59af004d4595699b2092670499 Author: Linus Walleij Date: Sat Nov 20 16:53:16 2021 +0100 power: supply: ab8500: Standardize design capacity Now that we know that we have only one battery type to deal with we can proceed to transfer properties to struct power_supply_battery_info. The designed capacity for the battery was in a custom field of the custom battery type in mAh, transfer this to the standard charge_full_design_uah property in struct power_supply_battery_info and augment the code accordingly. Signed-off-by: Linus Walleij Signed-off-by: Sebastian Reichel commit e5dff305ab5c539320f1e30db44604e9977c3504 Author: Linus Walleij Date: Sat Nov 20 16:53:15 2021 +0100 power: supply: ab8500: Use only one battery type The code was going through hoops and loops to detect what battery is connected and check the resistance for this battery etc. Skip this trouble: we will support one battery (currently "unknown") then we will find the connected battery in the device tree using a compatible string. The battery resistance may be used to double-check that the right battery is connected. Convert the array of battery types into one battery type so we can next move over the properties of this one type into the standard struct power_supply_battery_info. Signed-off-by: Linus Walleij Signed-off-by: Sebastian Reichel commit d8d26ac12e182f2e7f2697b09fabe817b4238c2c Author: Linus Walleij Date: Sat Nov 20 16:53:14 2021 +0100 power: supply: ab8500: Drop unused battery types The code tries to detect a lot of battery variants on the reference designs, but we are not using the reference designs in practice, we are using real products such as Samsung Phones. The reference design with no battery plugged in will be detected as a LIPO battery with a thermistor on the batctrl pin so we will assume this and later on we can support other types through the device tree if we want, just like the products do. Drop the tables for external thermistor, only keep the internal thermistor tables that we will use as default. We can delete the assignment of the temperature to resistance table since the default will be the only and correct option. Also get rid of some unused variables and unused exports. Signed-off-by: Linus Walleij Signed-off-by: Sebastian Reichel commit 6252c706cdb003da0046ced1a088b9f31af1fd9b Author: Linus Walleij Date: Sat Nov 20 16:53:13 2021 +0100 power: supply: ab8500: Standardize operating temperature Instead of storing the temperature limits in our custom struct struct ab8500_bm_data, make struct power_supply_battery_info a member of this and store the min and max temperatures inside that struct as the temp_min/temp_max and temp_alert_min/temp_alert_max respectively. The values can be assigned from the device tree, but if not present will be set to the same defaults as are currently in the code. This way we start to move over to using struct power_supply_battery_info and make it possible to move the data over to the device tree and we will move piece by piece toward using the standard info struct. Temperature hysteresis is currently not supported by the standard struct but we move the assignment here as well so that we have all parameterization in one spot. Signed-off-by: Linus Walleij Signed-off-by: Sebastian Reichel commit 3aca6ecdab44b30e812001ab4de19b79001a3fbd Author: Linus Walleij Date: Sat Nov 20 16:53:12 2021 +0100 power: supply: ab8500: Sink current tables into charger code The two tables for input and output current translation from register values does not need to be passed around from the battery manager data. Just push it down into the charger code where it is used, like other tables in that code. Signed-off-by: Linus Walleij Signed-off-by: Sebastian Reichel commit 59f1b854706d4d6830a3ed0f6b535a2ba5d425a6 Author: Linus Walleij Date: Sat Nov 20 16:53:11 2021 +0100 power: supply: ab8500: Use core battery parser This deploys the core battery DT parser to read the basic properties of the battery. We only use very little of it as we start out, but we will improve as we go along. Signed-off-by: Linus Walleij Signed-off-by: Sebastian Reichel commit 31aa126de88e1e9f562f708a9b0ec5917ba97dce Author: Marc Zyngier Date: Thu Oct 21 15:33:22 2021 +0100 arm64/fpsimd: Document the use of TIF_FOREIGN_FPSTATE by KVM The bit of documentation that talks about TIF_FOREIGN_FPSTATE does not mention the ungodly tricks that KVM plays with this flag. Try and document this for the posterity. Reviewed-by: Mark Brown Signed-off-by: Marc Zyngier commit bee14bca735a6f897a6ec3e42f3e5d2d8966e87e Author: Marc Zyngier Date: Thu Oct 21 14:18:00 2021 +0100 KVM: arm64: Stop mapping current thread_info at EL2 Now that we can track an equivalent of TIF_FOREIGN_FPSTATE, drop the mapping of current's thread_info at EL2. Signed-off-by: Marc Zyngier commit af9a0e21d817f40595aa629de32d3bd96582abef Author: Marc Zyngier Date: Thu Oct 21 14:10:35 2021 +0100 KVM: arm64: Introduce flag shadowing TIF_FOREIGN_FPSTATE We currently have to maintain a mapping the thread_info structure at EL2 in order to be able to check the TIF_FOREIGN_FPSTATE flag. In order to eventually get rid of this, start with a vcpu flag that shadows the thread flag on each entry into the hypervisor. Reviewed-by: Mark Brown Signed-off-by: Marc Zyngier commit e66425fc9ba33e9716d6e7c6bc78bb62f981d4df Author: Marc Zyngier Date: Mon Nov 22 15:59:23 2021 +0000 KVM: arm64: Remove unused __sve_save_state Now that we don't have any users left for __sve_save_state, remove it altogether. Should we ever need to save the SVE state from the hypervisor again, we can always re-introduce it. Suggested-by: Zenghui Yu Signed-off-by: Marc Zyngier commit 49cd1eb37b487036f51bd57b591f7b5760a10e02 Author: Jacky Bai Date: Sat Nov 20 19:34:49 2021 +0800 spi: fsl-lpspi: Add imx8ulp compatible string The lpspi on i.MX8ULP is derived from i.MX7ULP, it uses two compatible strings, so update the comaptible string for i.MX8ULP. Signed-off-by: Jacky Bai Reviewed-by: Dong Aisheng Acked-by: Rob Herring Link: https://lore.kernel.org/r/20211120113454.785997-4-peng.fan@oss.nxp.com Signed-off-by: Mark Brown commit 3f07657506df363709a37f99db04e9e0d0b1bce7 Author: Andy Shevchenko Date: Fri Nov 19 19:37:17 2021 +0200 spi: deduplicate spi_match_id() in __spi_register_driver() The same logic is used in spi_match_id() and in the __spi_register_driver(). By switching the former from taking struct spi_device * to const char * as the second parameter we may deduplicate the code. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211119173718.52938-1-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown commit d94758b344e3b6f16d31cb5b51b93e3e5a4c3567 Author: Linus Walleij Date: Sat Nov 20 02:17:15 2021 +0100 spi: Add resets to the PL022 bindings Some PL022 implementations provide a reset line to the silicon IP block, add a device tree property for this. Cc: devicetree@vger.kernel.org Signed-off-by: Linus Walleij Link: https://lore.kernel.org/r/20211120011715.2630873-1-linus.walleij@linaro.org Signed-off-by: Mark Brown commit f6f6a6320eeeb3e80e1393f727f898f8ca976bfd Author: Javier Martinez Canillas Date: Fri Nov 19 13:11:39 2021 +0100 spi: docs: improve the SPI userspace API documentation This doc is fairly outdated and only uses legacy device instantiation terminology. Let us update it and also mention the OF and ACPI device tables, to make easier for users to figure out how should be defined. Also, mention that devices bind could be done in user-space now using the "driver_override" sysfs entry. Suggested-by: Ralph Siemsen Signed-off-by: Javier Martinez Canillas Acked-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20211119121139.2412761-1-javierm@redhat.com Signed-off-by: Mark Brown commit 8c9b9cfb7724685ce705f511b882f30597596536 Author: Ariel D'Alessandro Date: Fri Nov 19 12:32:48 2021 -0300 ASoC: fsl-asoc-card: Support fsl,imx-audio-tlv320aic31xx codec Add entry for fsl,imx-audio-tlv320aic31xx audio codec. This codec is configured to use BCLK as clock input. Signed-off-by: Michael Trimarchi Signed-off-by: Ariel D'Alessandro Link: https://lore.kernel.org/r/20211119153248.419802-6-ariel.dalessandro@collabora.com Signed-off-by: Mark Brown commit c5d22d5e12e776fee4e346dc098fe51d00c2f983 Author: Ariel D'Alessandro Date: Fri Nov 19 12:32:47 2021 -0300 ASoC: tlv320aic31xx: Handle BCLK set as PLL input configuration If BCLK is used as PLL input, the sysclk is determined by the hw params. So it must be updated here to match the input frequency, based on sample rate, format and channels. Signed-off-by: Ariel D'Alessandro Signed-off-by: Michael Trimarchi Link: https://lore.kernel.org/r/20211119153248.419802-5-ariel.dalessandro@collabora.com Signed-off-by: Mark Brown commit 6e6752a9c78738e27bde6da5cefa393b589276bb Author: Ariel D'Alessandro Date: Fri Nov 19 12:32:46 2021 -0300 ASoC: tlv320aic31xx: Add divs for bclk as clk_in Add divisors for rates needed when the clk_in is set to BCLK. Signed-off-by: Michael Trimarchi Signed-off-by: Ariel D'Alessandro Link: https://lore.kernel.org/r/20211119153248.419802-4-ariel.dalessandro@collabora.com Signed-off-by: Mark Brown commit 2664b24a8c51c21b24c2b37b7f10d6485c35b7c1 Author: Ariel D'Alessandro Date: Fri Nov 19 12:32:45 2021 -0300 ASoC: tlv320aic31xx: Add support for pll_r coefficient When the clock used by the codec is BCLK, the operation parameters need to be calculated from input sample rate and format. Low frequency rates required different r multipliers, in order to achieve a higher PLL output frequency. Signed-off-by: Michael Trimarchi Signed-off-by: Ariel D'Alessandro Link: https://lore.kernel.org/r/20211119153248.419802-3-ariel.dalessandro@collabora.com Signed-off-by: Mark Brown commit 7016fd940adf2f4d86032339b546c6ecd737062f Author: Ariel D'Alessandro Date: Fri Nov 19 12:32:44 2021 -0300 ASoC: tlv320aic31xx: Fix typo in BCLK clock name Signed-off-by: Ariel D'Alessandro Link: https://lore.kernel.org/r/20211119153248.419802-2-ariel.dalessandro@collabora.com Signed-off-by: Mark Brown commit fdd535283779ec9f9c35fda352585c629121214f Author: Richard Fitzgerald Date: Fri Nov 19 12:48:54 2021 +0000 ASoC: cs42l42: Report initial jack state When a jack handler is registered in cs42l42_set_jack() the initial state should be reported if an attached headphone/headset has already been detected. The jack detect sequence takes around 1 second: typically long enough for the machine driver to probe and register the jack handler in time to receive the first report from the interrupt handler. So it is possible on some systems that the correct initial state was seen simply because of lucky timing. Modular builds were more likely to miss the reporting of the initial state. Signed-off-by: Richard Fitzgerald Fixes: 4ca239f33737 ("ASoC: cs42l42: Always enable TS_PLUG and TS_UNPLUG interrupts") Link: https://lore.kernel.org/r/20211119124854.58939-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit 405e52f412b85b581899f5e1b82d25a7c8959d89 Author: Pierre-Louis Bossart Date: Fri Nov 19 17:13:27 2021 -0600 ASoC: SOF: sof-pci-dev: use community key on all Up boards There are already 3 versions of the Up boards with support for the SOF community key (ApolloLake, WhiskyLake, TigerLake). Rather than continue to add quirks for each version, let's add a wildcard. For WHL and TGL, the authentication supports both the SOF community key and the firmware signed with the Intel production key. Given two choices, the community key is the preferred option to allow developers to sign their own firmware. The firmware signed with production key can still be selected if needed with a kernel module option (snd-sof-pci.fw_path="intel/sof") Tested-by: Péter Ujfalusi Signed-off-by: Pierre-Louis Bossart Reviewed-by: Bard Liao Reviewed-by: Péter Ujfalusi Link: https://lore.kernel.org/r/20211119231327.211946-1-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown commit ac5e3efd55868d8c12a178123b24616a22db274d Author: Olivier Moysan Date: Fri Nov 19 11:47:52 2021 +0100 ASoC: stm32: spdifrx: add pm_runtime support Enable support of pm_runtime on STM32 SPDIFRX driver to allow SPDIFRX power state monitoring. Signed-off-by: Olivier Moysan Link: https://lore.kernel.org/r/20211119104752.13564-4-olivier.moysan@foss.st.com Signed-off-by: Mark Brown commit 98e500a12f934531b0d44eac6bc53c3d4b66aa74 Author: Olivier Moysan Date: Fri Nov 19 11:47:51 2021 +0100 ASoC: stm32: dfsdm: add pm_runtime support for audio Enable support of pm_runtime on STM32 DFSDM audio driver to allow power state monitoring. Signed-off-by: Olivier Moysan Link: https://lore.kernel.org/r/20211119104752.13564-3-olivier.moysan@foss.st.com Signed-off-by: Mark Brown commit 32a956a1fadfd7d3924ab8ada2b7754054375903 Author: Olivier Moysan Date: Fri Nov 19 11:47:50 2021 +0100 ASoC: stm32: i2s: add pm_runtime support Enable support of pm_runtime on STM32 I2S driver to allow I2S power state monitoring. Signed-off-by: Olivier Moysan Link: https://lore.kernel.org/r/20211119104752.13564-2-olivier.moysan@foss.st.com Signed-off-by: Mark Brown commit 05827a1537f35221d84b8f5606f2f4c1371c69f3 Author: Ranjani Sridharan Date: Fri Nov 19 21:26:21 2021 +0200 ASoC: SOF: Intel: hda: free DAI widget during stop and suspend To keep the widget use_counts balanced, free the DAI widget during suspend and also during the stop trigger. Signed-off-by: Ranjani Sridharan Reviewed-by: Guennadi Liakhovetski Reviewed-by: Pierre-Louis Bossart Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20211119192621.4096077-11-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit 9ea807488cdaef83da702d4a02d54138b88f4377 Author: Ranjani Sridharan Date: Fri Nov 19 21:26:20 2021 +0200 ASoC: SOF: add support for dynamic pipelines with multi-core This patch adds support for dynamic pipelines with multi-core by using the platform-specific core_get/put() ops to power up/down a core when a widget is set up/freed. Along with this, a few redundant functions are removed: 1. sof_pipeline_core_enable() is no longer needed as the pipeline core will be set up when the pipeline widget is set up 2. sof_core_enable() is replaced with snd_sof_core_get() 4. core_power_up/down() DSP ops are deprecated and replaced with core get/put ops. 5. Core power down in sof_widget_unload() during topology removal is also removed as it is not really needed. For dynamic pipelines, the cores will be powered off when they are not used. For static pipelines, the cores will be powered off in the device remove callback. Signed-off-by: Ranjani Sridharan Reviewed-by: Guennadi Liakhovetski Reviewed-by: Pierre-Louis Bossart Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20211119192621.4096077-10-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit d416519982cb1d25358f558a4e68d9d254c9ca53 Author: Ranjani Sridharan Date: Fri Nov 19 21:26:19 2021 +0200 ASoC: SOF: hda: don't use the core op for power up/power down The core_power_up/down() ops will be deprecated. Use the HDA platform-specific functions for powering up/down the cores during probe/suspend/remove. The enabled_cores_mask and the core ref_count's are manually updated in each of these functions. Signed-off-by: Ranjani Sridharan Reviewed-by: Guennadi Liakhovetski Reviewed-by: Pierre-Louis Bossart Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20211119192621.4096077-9-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit b2ebcf42a48f4560862bb811f3268767d17ebdcd Author: Ranjani Sridharan Date: Fri Nov 19 21:26:18 2021 +0200 ASoC: SOF: free widgets in sof_tear_down_pipelines() for static pipelines Free widgets for static pipelines in sof_tear_down_pipelines(). But this feature is unavailable in older firmware with ABI < 3.19. Just reset widget use_count's for this case. This would ensure that the secondary cores enabled required for topology setup are powered down properly before the primary core is powered off during system suspend. Signed-off-by: Ranjani Sridharan Reviewed-by: Guennadi Liakhovetski Reviewed-by: Pierre-Louis Bossart Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20211119192621.4096077-8-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit 7cc7b9ba21d4978d19f0e3edc2b00d44c9d66ff6 Author: Ranjani Sridharan Date: Fri Nov 19 21:26:17 2021 +0200 ASoC: SOF: topology: remove sof_load_pipeline_ipc() Remove the function sof_load_pipeline_ipc() and directly send the IPC instead. The pipeline core is already enabled with the call to sof_pipeline_core_enable() in sof_widget_setup(). Signed-off-by: Ranjani Sridharan Reviewed-by: Guennadi Liakhovetski Reviewed-by: Pierre-Louis Bossart Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20211119192621.4096077-7-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit 9cdcbc9f6788661fb02fb2340032a5c8115aaf9b Author: Ranjani Sridharan Date: Fri Nov 19 21:26:16 2021 +0200 ASoC: SOF: Intel: CNL/ICL/APL: set core_get/core_put ops Set core_get/put ops for CNL/ICL platforms. These platforms do not support enabling/disabling secondary cores dynamically. So skip sending the IPC to power off the cores in the core_put op. Signed-off-by: Ranjani Sridharan Reviewed-by: Guennadi Liakhovetski Reviewed-by: Pierre-Louis Bossart Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20211119192621.4096077-6-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit 41dd63cccb42ec26f555cbb2495d85828a4b0e96 Author: Ranjani Sridharan Date: Fri Nov 19 21:26:15 2021 +0200 ASoC: SOF: Intel: TGL: set core_get/put ops Set core_get/put() ops for TGL. When core_get() is requested for a core, its ref_count is incremented and the PM_CORE_ENABLE IPC sent to the firmware to power up the core if the current ref_count is 1. Conversely, the ref_count is decremented in core_put() and an IPC is sent to the DSP to power off the core if the ref_count is 0. Signed-off-by: Ranjani Sridharan Reviewed-by: Guennadi Liakhovetski Reviewed-by: Pierre-Louis Bossart Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20211119192621.4096077-5-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit c414d5df9d05471aa47f50fca7fa4412daca7ac7 Author: Ranjani Sridharan Date: Fri Nov 19 21:26:14 2021 +0200 ASoC: SOF: Add ops for core_get and core_put Add ops to get/put a core that will be used to power up/down a core along with incrementing/decrementing its ref_count. Signed-off-by: Ranjani Sridharan Reviewed-by: Guennadi Liakhovetski Reviewed-by: Pierre-Louis Bossart Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20211119192621.4096077-4-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit 5974f6843203f0061d9df05c32262a10359740a6 Author: Ranjani Sridharan Date: Fri Nov 19 21:26:13 2021 +0200 ASoC: SOF: Introduce num_cores and ref count per core Add two fields num_cores and dsp_cores_ref_count to struct snd_sof_dev. These will be used to maintain the ref count for each core to determine when it should be powered up or down. Signed-off-by: Ranjani Sridharan Reviewed-by: Guennadi Liakhovetski Reviewed-by: Pierre-Louis Bossart Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20211119192621.4096077-3-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit 81ed6770ba67358b07e96a277206f6c742737dab Author: Ranjani Sridharan Date: Fri Nov 19 21:26:12 2021 +0200 ASoC: SOF: Intel: hda: expose get_chip_info() expose get_chip_info(). Signed-off-by: Ranjani Sridharan Reviewed-by: Guennadi Liakhovetski Reviewed-by: Pierre-Louis Bossart Signed-off-by: Kai Vehmanen Link: https://lore.kernel.org/r/20211119192621.4096077-2-kai.vehmanen@linux.intel.com Signed-off-by: Mark Brown commit 3bf4cd8b747a222f0f454f3220199c99f1c03da6 Author: Daniel Baluta Date: Fri Nov 19 11:43:19 2021 +0200 ASoC: SOF: imx8m: Implement reset callback Resume common flow (System PM / Runtime PM) is like this: sof_resume -> specific device resume -> snd_sof_load_firmware -> snd_sof_dsp_reset (1) -> load_modules() -> snd_sof_run_firmware (2) We need to implement dsp_reset callback (1) that will actually reset the DSP but keep it stalled. In order to implement this we do the following: -> put DSP into reset (assert CoreReset bit from PWRCTL) -> stall the DSP using RunStall bit from AudioDSP_REG2 mix -> take DSP out of reset (de-assert CoreReset bit from PWRCTL) At this moment the DSP is taken out of reset and Stalled! This means that we can load the firmware and then start the DSP (2). Until now we resetted the DSP by turning down the Audiomix PD. This doesn't work for Runtime PM if another IP is keeping Audiomix PD up. By introducing dsp_reset() we no longer rely on turning off the audiomix to reset the DSP. Signed-off-by: Daniel Baluta Reviewed-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Link: https://lore.kernel.org/r/20211119094319.81674-6-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit 9ba23717b2927071ddb49f3d6719244e3fe8f4c9 Author: Daniel Baluta Date: Fri Nov 19 11:43:18 2021 +0200 ASoC: SOF: imx8m: Implement DSP start On i.MX8M DSP is controlled via a set of registers from Audio MIX. This patches gets a reference (via regmap) to Audio Mix registers and implements DSP start. Signed-off-by: Daniel Baluta Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20211119094319.81674-5-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit a73b493d8e1b37acad686c15321d2eaab45567ce Author: Daniel Baluta Date: Fri Nov 19 11:43:17 2021 +0200 ASoC: SOF: imx8m: Add runtime PM / System PM support We make use of common imx8m_suspend / imx8m_resume functions for both system PM and runtime PM. imx8m_suspend: - frees the MU channels - disables the clocks imx8m_resume - enables the clocks - requests the MU channels On i.MX8MP there is no dedicated functionality to put the DSP in reset. The only way of doing this is to POWER DOWN the Audiomix domain. We are able to do this because turning off the clocks and freeing the channels makes the Audiomix to have no users thus PM kernel core turns it down. SOF core will not call system PM suspend handler if the DSP is already down, but at resume it will call the system PM resume. So, we need to keep track of the state via snd_sof_dsp_set_power_state Few insights on how SOF core handles the PM: - SOF core uses PM runtime autosuspend (with a timeout of 2 secs) - at probe, SOF core boots the DSP and lets the PM runtime suspend to turn it off, if there is no activity - when someone opens the ALSA sound card (aplay/arecord, etc) ALSA core calls PM runtime resume to turn on the DSP - when the ALSA sound card is closed SOF core make use of PM subsystem to call PM runtime suspend and thus turning off the DSP. Signed-off-by: Daniel Baluta Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20211119094319.81674-4-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit 6fc8515806dfd5b7d3198c189b51e7624aadafdc Author: Daniel Baluta Date: Fri Nov 19 11:43:16 2021 +0200 ASoC: SOF: imx8: Add runtime PM / System PM support Handle clocks and mailbox channels at runtime suspend/resume in order to save power. DSP runtime PM uses a timeout of 2s. If device is idle for 2s system will enter runtime suspend. Because SOF state machine assumes that even if the DSP wasn't previously active at a System resume, will re-load the firmware we need to make sure that all needed resources are active. Kernel core will take care of enabling the PD, we need to make sure that we request the MU channels. Signed-off-by: Daniel Baluta Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20211119094319.81674-3-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit 8253aa4700b37cef1ca3bbda0d986349357608d3 Author: Daniel Baluta Date: Fri Nov 19 11:43:15 2021 +0200 ASoC: SOF: imx: Add code to manage DSP related clocks We need at least 3 clocks in order to power up and access DSP core registers found on i.MX8QM, i.MX8QXP and i.MX8MP platforms. Add code to request these clocks and enable them at probe. Next patches will add PM support which will only activate clocks when DSP is used. DSP clocks are already documented in Documentation/devicetree/bindings/dsp/fsl,dsp.yaml We choose to add: * imx8_parse_clocks * imx8_enable_clocks * imx8_disable_clocks wrappers because in the future DSP will need to take care about the clocks of other related Audio IPs (e.g SAI, ESAI). Signed-off-by: Daniel Baluta Reviewed-by: Paul Olaru Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20211119094319.81674-2-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit 448cc2fb3a7b327823a9afd374808c37b8e6194f Merge: 527bab0473f28 136057256686d Author: Jani Nikula Date: Mon Nov 22 17:35:32 2021 +0200 Merge drm/drm-next into drm-intel-next Sync up with drm-next to get v5.16-rc2. Signed-off-by: Jani Nikula commit 3b0e04140bc30f9f5c254a68013a901e5390b0a8 Merge: 8ba71dbb7f37f ba8f870dfa635 Author: David S. Miller Date: Mon Nov 22 15:35:17 2021 +0000 Merge branch 'qca8k-next' Ansuel Smith says: ==================== Multiple cleanup and feature for qca8k This is a reduced version of the old massive series. Refer to the changelog to know what is removed from this. We clean and convert the driver to GENMASK FIELD_PREP to clean multiple use of various naming scheme. (example we have a mix of _MASK, _S _M, and various name) The idea is to ""simplify"" and remove some shift and data handling by using FIELD API. The patch contains various checkpatch warning and are ignored to not create more mess in the header file. (fixing the too long line warning would results in regs definition less readable) We conver the driver to regmap API as ipq40xx SoC is based on the same reg structure and we need to generilize the read/write access to split the driver to commond and specific code. The conversion to regmap is NOT done for the read/write/rmw operation, the function are reworked to use the regmap helper instead. This is done to keep the patch delta low but will come sooner or later when the code will be split. Any new feature will directly use the regmap helper and the reg set/clear and the busy wait function are migrated to regmap helper as the use of these function is low. We also add a minor patch for MIB counter as qca8337 is missing 2 extra counter, support for mdb and ageing settings. v3: - Try to reduce regmap conversion patch v2: - Move regmap init to sw_probe instead of moving switch id check. - Removed LAGs, mirror extra features will come later in another smaller series. - Squash 2 ageing patch - Add more description about the regmap patch - Rework mdb patch to do operation under the same lock ==================== Signed-off-by: David S. Miller commit ba8f870dfa635113ce6e8095a5eb1835ecde2e9e Author: Ansuel Smith Date: Mon Nov 22 16:23:48 2021 +0100 net: dsa: qca8k: add support for mdb_add/del Add support for mdb add/del function. The ARL table is used to insert the rule. The rule will be searched, deleted and reinserted with the port mask updated. The function will check if the rule has to be updated or insert directly with no deletion of the old rule. If every port is removed from the port mask, the rule is removed. The rule is set STATIC in the ARL table (aka it doesn't age) to not be flushed by fast age function. Signed-off-by: Ansuel Smith Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit 6a3bdc5209f45d2af83aa92433ab6e5cf2297aa4 Author: Ansuel Smith Date: Mon Nov 22 16:23:47 2021 +0100 net: dsa: qca8k: add set_ageing_time support qca8k support setting ageing time in step of 7s. Add support for it and set the max value accepted of 7645m. Documentation talks about support for 10000m but that values doesn't make sense as the value doesn't match the max value in the reg. Signed-off-by: Ansuel Smith Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit 4592538bfb0d5d3c3c8a1d7071724d081412ac91 Author: Ansuel Smith Date: Mon Nov 22 16:23:46 2021 +0100 net: dsa: qca8k: add support for port fast aging The switch supports fast aging by flushing any rule in the ARL table for a specific port. Signed-off-by: Ansuel Smith Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit c126f118b330ccf0db0dda4a4bd6c729865a205f Author: Ansuel Smith Date: Mon Nov 22 16:23:45 2021 +0100 net: dsa: qca8k: add additional MIB counter and make it dynamic We are currently missing 2 additionals MIB counter present in QCA833x switch. QC832x switch have 39 MIB counter and QCA833X have 41 MIB counter. Add the additional MIB counter and rework the MIB function to print the correct supported counter from the match_data struct. Signed-off-by: Ansuel Smith Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit 8b5f3f29a81a71934d004e21a1292c1148b05926 Author: Ansuel Smith Date: Mon Nov 22 16:23:44 2021 +0100 net: dsa: qca8k: initial conversion to regmap helper Convert any qca8k set/clear/pool to regmap helper and add missing config to regmap_config struct. Read/write/rmw operation are reworked to use the regmap helper internally to keep the delta of this patch low. These additional function will then be dropped when the code split will be proposed. Ipq40xx SoC have the internal switch based on the qca8k regmap but use mmio for read/write/rmw operation instead of mdio. In preparation for the support of this internal switch, convert the driver to regmap API to later split the driver to common and specific code. The overhead introduced by the use of regamp API is marginal as the internal mdio will bypass it by using its direct access and regmap will be used only by configuration functions or fdb access. Signed-off-by: Ansuel Smith Signed-off-by: David S. Miller commit 36b8af12f424e7a7f60a935c60a0fd4aa0822378 Author: Ansuel Smith Date: Mon Nov 22 16:23:43 2021 +0100 net: dsa: qca8k: move regmap init in probe and set it mandatory In preparation for regmap conversion, move regmap init in the probe function and make it mandatory as any read/write/rmw operation will be converted to regmap API. Signed-off-by: Ansuel Smith Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit 994c28b6f971fa5db8ae977daea37eee87d93d51 Author: Ansuel Smith Date: Mon Nov 22 16:23:42 2021 +0100 net: dsa: qca8k: remove extra mutex_init in qca8k_setup Mutex is already init in sw_probe. Remove the extra init in qca8k_setup. Signed-off-by: Ansuel Smith Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit 90ae68bfc2ffcb54a4ba4f64edbeb84a80cbb57c Author: Ansuel Smith Date: Mon Nov 22 16:23:41 2021 +0100 net: dsa: qca8k: convert to GENMASK/FIELD_PREP/FIELD_GET Convert and try to standardize bit fields using GENMASK/FIELD_PREP/FIELD_GET macros. Rework some logic to support the standard macro and tidy things up. No functional change intended. Signed-off-by: Ansuel Smith Signed-off-by: David S. Miller commit b9133f3ef5a2659730cf47a74bd0a9259f1cf8ff Author: Ansuel Smith Date: Mon Nov 22 16:23:40 2021 +0100 net: dsa: qca8k: remove redundant check in parse_port_config The very next check for port 0 and 6 already makes sure we don't go out of bounds with the ports_config delay table. Remove the redundant check. Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Ansuel Smith Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit 9dd81021084ff22cf88a180d720f4f4b47392059 Author: Hui Wang Date: Tue Nov 9 20:56:57 2021 +0800 clk: imx8mp: Fix the parent clk of the audio_root_clk Having the parent of the audio_root_clk set to ipg_root in the clk-imx8mp.c, there is a hang happening when the audiomix IP regs are accessed. Switch parent to audio_ahb. And we could also refer to the section "5.1.4 System Clocks" of the IMX8MPRM.pdf, the parent clk of CCGR101 (Audiomix) is the AUDIO_AHB_CLK_ROOT. Signed-off-by: Hui Wang Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20211109125657.63485-2-hui.wang@canonical.com Signed-off-by: Abel Vesa commit 8383741ab2e773a992f1f0f8acdca5e7a4687c49 Author: Marc Zyngier Date: Wed Oct 27 11:18:00 2021 +0100 KVM: arm64: Get rid of host SVE tracking/saving The SVE host tracking in KVM is pretty involved. It relies on a set of flags tracking the ownership of the SVE register, as well as that of the EL0 access. It is also pretty scary: __hyp_sve_save_host() computes a thread_struct pointer and obtains a sve_state which gets directly accessed without further ado, even on nVHE. How can this even work? The answer to that is that it doesn't, and that this is mostly dead code. Closer examination shows that on executing a syscall, userspace loses its SVE state entirely. This is part of the ABI. Another thing to notice is that although the kernel provides helpers such as kernel_neon_begin()/end(), they only deal with the FP/NEON state, and not SVE. Given that you can only execute a guest as the result of a syscall, and that the kernel cannot use SVE by itself, it becomes pretty obvious that there is never any host SVE state to save, and that this code is only there to increase confusion. Get rid of the TIF_SVE tracking and host save infrastructure altogether. Reviewed-by: Mark Brown Signed-off-by: Marc Zyngier commit 892fd259cbf6b1dc16116611b84f7f164a11fe2e Author: Marc Zyngier Date: Thu Oct 21 13:50:42 2021 +0100 KVM: arm64: Reorder vcpu flag definitions The vcpu arch flags are in an interesting, semi random order. As I have made the mistake of reusing a flag once, let's rework this in an order that I find a bit less confusing. Signed-off-by: Marc Zyngier commit 8ba71dbb7f37f59d96c3f0ccf4f696aa18e40943 Merge: cb902b332f954 03f61041c1791 Author: David S. Miller Date: Mon Nov 22 15:13:54 2021 +0000 Merge branch 'skbuff-struct-group' Kees Cook says: ==================== skbuff: Switch structure bounds to struct_group() This is a pair of patches to add struct_group() to struct sk_buff. The first is needed to work around sparse-specific complaints, and is new for v2. The second patch is the same as originally sent as v1. ==================== Signed-off-by: David S. Miller commit 03f61041c17914355dde7261be9ccdc821ddd454 Author: Kees Cook Date: Sat Nov 20 16:31:49 2021 -0800 skbuff: Switch structure bounds to struct_group() 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. Replace the existing empty member position markers "headers_start" and "headers_end" with a struct_group(). This will allow memcpy() and sizeof() to more easily reason about sizes, and improve readability. "pahole" shows no size nor member offset changes to struct sk_buff. "objdump -d" shows no object code changes (outside of WARNs affected by source line number changes). Signed-off-by: Kees Cook Reviewed-by: Gustavo A. R. Silva Reviewed-by: Jason A. Donenfeld # drivers/net/wireguard/* Link: https://lore.kernel.org/lkml/20210728035006.GD35706@embeddedor Signed-off-by: David S. Miller commit fba84957e2e2e201cf4e352efe0c7cac0fbb5d5d Author: Kees Cook Date: Sat Nov 20 16:31:48 2021 -0800 skbuff: Move conditional preprocessor directives out of struct sk_buff In preparation for using the struct_group() macro in struct sk_buff, move the conditional preprocessor directives out of the region of struct sk_buff that will be enclosed by struct_group(). While GCC and Clang are happy with conditional preprocessor directives here, sparse is not, even under -Wno-directive-within-macro[1], as would be seen under a C=1 build: net/core/filter.c: note: in included file (through include/linux/netlink.h, include/linux/sock_diag.h): ./include/linux/skbuff.h:820:1: warning: directive in macro's argument list ./include/linux/skbuff.h:822:1: warning: directive in macro's argument list ./include/linux/skbuff.h:846:1: warning: directive in macro's argument list ./include/linux/skbuff.h:848:1: warning: directive in macro's argument list Additionally remove empty macro argument definitions and usage. "objdump -d" shows no object code differences. [1] https://www.spinics.net/lists/linux-sparse/msg10857.html Signed-off-by: Kees Cook Signed-off-by: David S. Miller commit 6deb3fb22da19e21ca5372fb34fb868bfceaf74c Author: Hui Wang Date: Tue Nov 9 20:56:56 2021 +0800 clk: imx8mp: Remove IPG_AUDIO_ROOT from imx8mp-clock.h Since the commit b24e288d5063 ("clk: imx: Remove the audio ipg clock from imx8mp") removes the non-existing IPG_AUDIO_ROOT from the clk-imx8mp.c, and this definition is not used by anywhere, let us removed it in the imx8mp-clock.h as well. Signed-off-by: Hui Wang Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20211109125657.63485-1-hui.wang@canonical.com Signed-off-by: Abel Vesa commit 6a61d1d1491eea268c07c5a623b08d6d1d7ec237 Author: Odelu Kukatla Date: Thu Oct 21 16:10:56 2021 +0530 interconnect: qcom: Add EPSS L3 support on SC7280 Add Epoch Subsystem (EPSS) L3 interconnect provider support on SC7280 SoCs. Signed-off-by: Odelu Kukatla Reviewed-by: Stephen Boyd Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/1634812857-10676-3-git-send-email-okukatla@codeaurora.org Signed-off-by: Georgi Djakov commit 3b47746cd787d7130dda700e96a4503f7f315cbd Author: Odelu Kukatla Date: Thu Oct 21 16:10:55 2021 +0530 dt-bindings: interconnect: Add EPSS L3 DT binding on SC7280 Add Epoch Subsystem (EPSS) L3 interconnect provider binding on SC7280 SoCs. Signed-off-by: Odelu Kukatla Acked-by: Rob Herring Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/1634812857-10676-2-git-send-email-okukatla@codeaurora.org Signed-off-by: Georgi Djakov commit cb902b332f9545635911063b671927defa5866bf Author: Antoine Tenart Date: Mon Nov 22 15:24:56 2021 +0100 sections: global data can be in .bss When checking an address is located in a global data section also check for the .bss section as global variables initialized to 0 can be in there (-fzero-initialized-in-bss). This was found when looking at ensure_safe_net_sysctl which was failing to detect non-init sysctl pointing to a global data section when the data was in the .bss section. Signed-off-by: Antoine Tenart Acked-by: Steven Rostedt (VMware) Acked-by: Arnd Bergmann Signed-off-by: David S. Miller commit 09f16f7390f302937409738d6cb6ce99b265f455 Author: Anilkumar Kolli Date: Mon Nov 22 13:13:58 2021 +0200 ath11k: Fix mon status ring rx tlv processing In HE monitor capture, HAL_TLV_STATUS_PPDU_DONE is received on processing multiple skb. Do not clear the ppdu_info till the HAL_TLV_STATUS_PPDU_DONE is received. This fixes below warning and packet drops in monitor mode. "Rate marked as an HE rate but data is invalid: MCS: 6, NSS: 0" WARNING: at PC is at ieee80211_rx_napi+0x624/0x840 [mac80211] Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-01693-QCAHKSWPL_SILICONZ-1 Signed-off-by: Anilkumar Kolli Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1637249433-10316-1-git-send-email-akolli@codeaurora.org commit 46e46db313a2bf3c48cac4eb8bdb613b762f301b Author: Wen Gong Date: Mon Nov 22 13:13:58 2021 +0200 ath11k: add read variant from SMBIOS for download board data This is to read variant from SMBIOS such as read from DT, the variant string will be used to one part of string which used to search board data from board-2.bin. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211118100033.8384-1-quic_wgong@quicinc.com commit a4146249a33381f41f6d15eaa1797d7ba1820a31 Author: Wen Gong Date: Mon Nov 22 13:13:58 2021 +0200 ath11k: skip sending vdev down for channel switch The ath11k driver currently sends vdev down to the firmware before updating the channel context, which is followed by a vdev restart command. Sending vdev down is not required before sending a vdev restart, because the firmware internally does vdev down when ath11k sends a vdev restart command. Firmware will happen crash while channel switch without this change. Hence skip the vdev down command sending when updating the channel context and then fix the firmware crash issue. Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211118095901.8271-1-quic_wgong@quicinc.com commit e968b1b3e9b86c4751faea019a5d340fee9e9142 Author: Yajun Deng Date: Mon Nov 22 15:02:36 2021 +0800 arp: Remove #ifdef CONFIG_PROC_FS proc_create_net() and remove_proc_entry() already contain the case whether to define CONFIG_PROC_FS, so remove #ifdef CONFIG_PROC_FS. Signed-off-by: Yajun Deng Signed-off-by: David S. Miller commit 1370634054d4e1e4794057b06ac651b6366ce97d Author: Wen Gong Date: Mon Nov 22 13:13:58 2021 +0200 ath11k: fix read fail for htt_stats and htt_peer_stats for single pdev The pdev id is set to 0 for single pdev configured hardware, the real pdev id is not 0 in firmware, for example, its pdev id is 1 for 5G/6G phy and 2 for 2G band phy. For HTT_H2T_MSG_TYPE_EXT_STATS_CFG message, firmware parse the pdev_mask to its pdev id, ath11k set it to 0 for single pdev, it is not correct, need set it with the real pdev id of firmware. Save the real pdev id report by firmware and set it correctly. Below commands run success with this patch: cat /sys/kernel/debug/ieee80211/phy0/ath11k/htt_stats cat /sys/kernel/debug/ieee80211/phy0/netdev\:wls1/stations/00\:03\:7f\:75\:59\:85/htt_peer_stats Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211118095700.8149-1-quic_wgong@quicinc.com commit 3db26ecf7114370e451e296e33a0af3303d32819 Author: Wen Gong Date: Mon Nov 22 13:13:57 2021 +0200 ath11k: calculate the correct NSS of peer for HE capabilities When connected to 6G mode AP, it does not have VHT/HT capabilities, so the NSS is not set, then it is 1 by default. This patch is to calculate the NSS with supported HE-MCS and NSS set of HE capabilities. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01280-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211118095453.8030-1-quic_wgong@quicinc.com commit e9268a94399899a3ad797d37d611d9e41f65e8e7 Author: Christophe JAILLET Date: Sun Nov 21 22:56:39 2021 +0100 hv_netvsc: Use bitmap_zalloc() when applicable 'send_section_map' is a bitmap. So use 'bitmap_zalloc()' to simplify code, improve the semantic and avoid some open-coded arithmetic in allocator arguments. Also change the corresponding 'kfree()' into 'bitmap_free()' to keep consistency. While at it, change an '== NULL' test into a '!'. Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller commit f8108250e331b8f0273c53afb9e2db5068e59b2e Author: Wen Gong Date: Mon Nov 22 13:13:57 2021 +0200 ath11k: change to treat alpha code na as world wide regdomain Some firmware versions for WCN6855 report the default regdomain with alpha code "na" by default when load as a world wide regdomain, ath11k should treat it as a world wide alpha code. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211118094848.7776-1-quic_wgong@quicinc.com commit 5e6c7ccd3ea4b25dd6b4b0363859913f315deacb Author: Christophe JAILLET Date: Sun Nov 21 20:12:54 2021 +0100 qed: Use the bitmap API to simplify some functions 'cid_map' is a bitmap. So use 'bitmap_zalloc()' to simplify code, improve the semantic and avoid some open-coded arithmetic in allocator arguments. Also change the corresponding 'kfree()' into 'bitmap_free()' to keep consistency. Also change some 'memset()' into 'bitmap_zero()' to keep consistency. This is also much less verbose. Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller commit 08a7abf4aff1a42290fd20ff7a5fa8a3ff5f90e7 Author: Christophe JAILLET Date: Sun Nov 21 19:01:03 2021 +0100 net-sysfs: Slightly optimize 'xps_queue_show()' The 'mask' bitmap is local to this function. So the non-atomic '__set_bit()' can be used to save a few cycles. Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller commit db473c075f01befd9cf10154098267e7d6ee7d11 Author: Christophe JAILLET Date: Sun Nov 21 16:32:04 2021 +0100 rds: Fix a typo in a comment s/cold/could/ Signed-off-by: Christophe JAILLET Acked-By: Devesh Sharma Signed-off-by: David S. Miller commit ac9f66ff04a983974cb33dd207a5fcb3e5356d90 Author: Yacov Simhony Date: Sun Nov 21 17:02:53 2021 +0200 Fix coverity issue 'Uninitialized scalar variable" There are three boolean variable which were not initialized and later being used in the code. Signed-off-by: Yacov Simhony Signed-off-by: David S. Miller commit 6164807dd2989fd4c1435a6b3c61453e63c4e37e Author: Dan Carpenter Date: Mon Nov 22 10:41:47 2021 +0300 drm/i915/ttm: Fix error code in i915_ttm_eviction_valuable() This function returns a bool type so returning -EBUSY is equivalent to returning true. It should return false instead. Fixes: 7ae034590cea ("drm/i915/ttm: add tt shmem backend") Signed-off-by: Dan Carpenter Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20211122061438.GA2492@kili commit 527bab0473f28236e4587c7870586275c1ef5516 Author: Tilak Tangudu Date: Tue Nov 16 21:22:38 2021 +0530 drm/i915/rpm: Enable runtime pm autosuspend by default Let's enable runtime pm autosuspend by default everywhere. So, we can allow D3hot and bigger power savings on idle scenarios. But at this time let's not touch the autosuspend_delay time, what caused some regression on our previous attempt. Also, the latest identified issue on GuC PM has been fixed by commit 1a52faed3131 ("drm/i915/guc: Take GT PM ref when deregistering context") v1: Enable runtime pm autosuspend by default for Gen12 and later versions. v2: Enable runtime pm autosuspend by default for all platforms(Syrjala Ville) v3: Change commit message(Nikula Jani) Signed-off-by: Tilak Tangudu Reviewed-by: Rodrigo Vivi Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20211116155238.3226516-1-tilak.tangudu@intel.com commit bd4b827cec1d4eec7a916dc4da0ca65939f80f4b Author: Jakub Kicinski Date: Sat Nov 20 09:15:10 2021 -0800 pcmcia: hide the MAC address helpers if !NET pcmcia_get_mac_from_cis is only called from networking and recent changes made it call dev_addr_mod() which is itself only defined if NET. Reported-by: kernel test robot Fixes: adeef3e32146 ("net: constify netdev->dev_addr") Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 4dfb9982644b5bf7672fc6a0b51cf87503832b7e Author: David S. Miller Date: Mon Nov 22 13:56:22 2021 +0000 tsn: Fix build. Due to const dev_addr changes. Signed-off-by: David S. Miller commit 570727e9acfac1c2330a01dd5e1272e9c3acec08 Author: Adam Ford Date: Wed Nov 17 07:32:02 2021 -0600 clk: imx8mn: Fix imx8mn_clko1_sels When attempting to use sys_pll1_80m as the parent for clko1, the system hangs. This is due to the fact that the source select for sys_pll1_80m was incorrectly pointing to m7_alt_pll_clk, which doesn't yet exist. According to Rev 3 of the TRM, The imx8mn_clko1_sels also incorrectly references an osc_27m which does not exist, nor does an entry for source select bits 010b. Fix both by inserting a dummy clock into the missing space in the table and renaming the incorrectly name clock with dummy. Fixes: 96d6392b54db ("clk: imx: Add support for i.MX8MN clock driver") Signed-off-by: Adam Ford Reviewed-by: Fabio Estevam Link: https://lore.kernel.org/r/20211117133202.775633-1-aford173@gmail.com Signed-off-by: Abel Vesa commit c1b6ad9a902539f9c037b6b3c35cb134c5724022 Author: Changcheng Deng Date: Thu Nov 18 08:06:34 2021 +0000 clk: imx: Use div64_ul instead of do_div do_div() does a 64-by-32 division. Here the divisor is an unsigned long which on some platforms is 64 bit wide. So use div64_ul instead of do_div to avoid a possible truncation. Reported-by: Zeal Robot Signed-off-by: Changcheng Deng Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20211118080634.165275-1-deng.changcheng@zte.com.cn Signed-off-by: Abel Vesa commit 00ef32565b9bd03c63ed944bc27878fbbc1c4e0a Author: M Chetan Kumar Date: Sat Nov 20 21:51:55 2021 +0530 net: wwan: iosm: device trace collection using relayfs This patch brings in support for device trace collection. It implements relayfs interface for pushing device trace from kernel space to user space. Driver gets the debugfs base directory associated to WWAN Device and creates trace_control and trace debugfs for device tracing. Both trace_control & trace debugfs are created under /sys/kernel/debug/wwan/wwan0/. In order to collect device trace on trace0 interface, user need to write 1 to trace_ctl interface. Signed-off-by: M Chetan Kumar Signed-off-by: David S. Miller commit c4804670026b93f4ebddda30af89fd737bf93931 Author: M Chetan Kumar Date: Sat Nov 20 21:51:54 2021 +0530 net: wwan: common debugfs base dir for wwan device This patch set brings in a common debugfs base directory i.e. /sys/kernel/debugfs/wwan/ in WWAN Subsystem for a WWAN device instance. So that it avoids driver polluting debugfs root with unrelated directories & possible name collusion. Having a common debugfs base directory for WWAN drivers eases user to match control devices with debugfs entries. WWAN Subsystem creates dentry (/sys/kernel/debugfs/wwan) on module load & removes dentry on module unload. When driver registers a new wwan device, dentry (wwanX) is created for WWAN device instance & on driver unregister dentry is removed. New API is introduced to return the wwan device instance dentry so that driver can create debugfs entries under it. Signed-off-by: M Chetan Kumar Reviewed-by: Loic Poulain Signed-off-by: David S. Miller commit a9c2cf9e93335968e894c16921c151f016fa36c7 Author: Jakub Kicinski Date: Sat Nov 20 07:31:19 2021 -0800 octeon: constify netdev->dev_addr Argument of a helper is missing a const. Reported-by: kernel test robot Fixes: adeef3e32146 ("net: constify netdev->dev_addr") Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit ed5356b53f070dea5dff5a01b740561cb8222199 Author: Haiyang Zhang Date: Fri Nov 19 16:29:53 2021 -0800 net: mana: Add XDP support Add support of XDP for the MANA driver. Supported XDP actions: XDP_PASS, XDP_TX, XDP_DROP, XDP_ABORTED XDP actions not yet supported: XDP_REDIRECT Signed-off-by: Haiyang Zhang Signed-off-by: David S. Miller commit b8ac21d210dff3320366495d9c2dec6f93602e6d Merge: a18e6521a7d95 403f69bbdbadb Author: David S. Miller Date: Mon Nov 22 13:19:04 2021 +0000 Merge branch 'tsn-endpoint-driver' Gerhard Engleder says: ==================== TSN endpoint Ethernet MAC driver This series adds a driver for my FPGA based TSN endpoint Ethernet MAC. It also includes the device tree binding. The device is designed as Ethernet MAC for TSN networks. It will be used in PLCs with real-time requirements up to isochronous communication with protocols like OPC UA Pub/Sub. v3: - set MAC mode based on PHY information (Andrew Lunn) - remove/postpone loopback mode interface (Andrew Lunn) - add suppress_preamble node support (Andrew Lunn) - add mdio timeout (Andrew Lunn) - no need to call phy_start_aneg (Andrew Lunn) - remove unreachable code (Andrew Lunn) - move 'struct napi_struct' closer to queues (Vinicius Costa Gomes) - remove unused variable (kernel test robot) - switch from mdio interrupt to polling - mdio register without PHY address flag - thread safe interrupt enable register - add PTP_1588_CLOCK_OPTIONAL dependency to Kconfig - introduce dmadev for DMA allocation - mdiobus for platforms without device tree - prepare MAC address support for platforms without device tree - add missing interrupt disable to probe error path v2: - add C45 check (Andrew Lunn) - forward phy_connect_direct() return value (Andrew Lunn) - use phy_remove_link_mode() (Andrew Lunn) - do not touch PHY directly, use PHY subsystem (Andrew Lunn) - remove management data lock (Andrew Lunn) - use phy_loopback (Andrew Lunn) - remove GMII2RGMII handling, use xgmiitorgmii (Andrew Lunn) - remove char device for direct TX/RX queue access (Andrew Lunn) - mdio node for mdiobus (Rob Herring) - simplify compatible node (Rob Herring) - limit number of items of reg and interrupts nodes (Rob Herring) - restrict phy-connection-type node (Rob Herring) - reference to mdio.yaml under mdio node (Rob Herring) - remove device tree (Michal Simek) - fix %llx warning (kernel test robot) - fix unused tmp variable warning (kernel test robot) - add missing of_node_put() for of_parse_phandle() - use devm_mdiobus_alloc() - simplify mdiobus read/write - reduce required nodes - ethtool priv flags interface for loopback - add missing static for some functions - remove obsolete hardware defines ==================== Signed-off-by: David S. Miller commit 403f69bbdbadb2e601f725be2d00b4ccc7b61c9d Author: Gerhard Engleder Date: Fri Nov 19 23:58:26 2021 +0100 tsnep: Add TSN endpoint Ethernet MAC driver The TSN endpoint Ethernet MAC is a FPGA based network device for real-time communication. It is integrated as Ethernet controller with ethtool and PTP support. For real-time communcation TC_SETUP_QDISC_TAPRIO is supported. Signed-off-by: Gerhard Engleder Signed-off-by: David S. Miller commit 603094b2cdb788808102a28c45509300c66af2ca Author: Gerhard Engleder Date: Fri Nov 19 23:58:25 2021 +0100 dt-bindings: net: Add tsnep Ethernet controller The TSN endpoint Ethernet MAC is a FPGA based network device for real-time communication. It is integrated as normal Ethernet controller with ethernet-controller.yaml and mdio.yaml. Signed-off-by: Gerhard Engleder Reviewed-by: Rob Herring Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 2b34a288d200ef824faf3415898bb02ea81a7c45 Author: Gerhard Engleder Date: Fri Nov 19 23:58:24 2021 +0100 dt-bindings: Add vendor prefix for Engleder Engleder develops FPGA based controllers for real-time communication. Signed-off-by: Gerhard Engleder Acked-by: Rob Herring Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit a18e6521a7d95dae8c65b5b0ef6bbe624fbe808c Author: Russell King (Oracle) Date: Fri Nov 19 16:28:06 2021 +0000 net: phylink: handle NA interface mode in phylink_fwnode_phy_connect() Commit 4904b6ea1f9db ("net: phy: phylink: Use PHY device interface if N/A") introduced handling for the phy interface mode where this is not known at phylink creation time. This was never added to the OF/fwnode paths, but is necessary when the phy is present in DT, but the phy-mode is not specified. Add this handling. Signed-off-by: Russell King (Oracle) Acked-by: Florian Fainelli Signed-off-by: David S. Miller commit 291dcae39bc482f7edc91a50d97027327e0cf5f9 Author: Sean Anderson Date: Fri Nov 19 10:58:09 2021 -0500 net: phylink: Add helpers for c22 registers without MDIO Some devices expose memory-mapped c22-compliant PHYs. Because these devices do not have an MDIO bus, we cannot use the existing helpers. Refactor the existing helpers to allow supplying the values for c22 registers directly, instead of using MDIO to access them. Only get_state and set_advertisement are converted, since they contain the most complex logic. Because set_advertisement is never actually used outside phylink_mii_c22_pcs_config, move the MDIO-writing part into that function. Because some modes do not need the advertisement register set at all, we use -EINVAL for this purpose. Additionally, a new function phylink_pcs_enable_an is provided to determine whether to enable autonegotiation. Signed-off-by: Sean Anderson Reviewed-by: Russell King (Oracle) Signed-off-by: David S. Miller commit c15f86856bec5bbf9a5ea909ce5ccc5b05744eb1 Author: Hans de Goede Date: Sun Nov 21 20:11:23 2021 +0100 platform/x86: thinkpad_acpi: Accept ibm_init_struct.init() returning -ENODEV Commit 79f960e29cfc ("platform/x86: thinkpad_acpi: Convert platform driver to use dev_groups") accidentally modified tpacpi_kbdlang_init() causing it to return -ENODEV instead of 0 on machines without kbdlang support (which are most of them). ibm_init() sees this -ENODEV as an error causing the entire module to not load, not good. Note that technically tpacpi_kbdlang_init() was already buggy before, it should have returned 1 instead of 0 if the feature is not present. Rather then fixing tpacpi_kbdlang_init() though, IMHO it is bettter to just make ibm_init() treat -ENODEV as 1 to fix the issue; and then in a followup commit also change all the existing "return 1"s from ibm_init_struct.init() callbacks to "return -ENODEV" as -ENODEV clearly states what it going on where as a magic return of "1" requires a deep dive into the code to figure out what is going on. This will also allow removing some extra ifs to translate -ENODEV to return 1 in a couple of init() callbacks. Fixes: 79f960e29cfc ("platform/x86: thinkpad_acpi: Convert platform driver to use dev_groups") Cc: Len Baker Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211121191129.256713-2-hdegoede@redhat.com commit ff448bbaacfb6f216ae101c1f16d8c5142c16fdf Author: Hans de Goede Date: Thu Nov 18 12:41:50 2021 +0100 platform/x86: think-lmi: Simplify tlmi_analyze() error handling a bit Creating the tlmi_pwd_setting structs can only fail with -ENOMEM, set ret to this once and simplify the error handling a bit. Tested-by: Mark Pearson Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211118114150.271274-2-hdegoede@redhat.com commit 01df1385ec4ec699ad6a63007e7f1081089e83a0 Author: Hans de Goede Date: Thu Nov 18 12:41:49 2021 +0100 platform/x86: think-lmi: Move kobject_init() call into tlmi_create_auth() All callers of tlmi_create_auth() also call kobject_init(&pwd_setting->kobj, &tlmi_pwd_setting_ktype) on the returned tlmi_pwd_setting struct. Move this into tlmi_create_auth(). Tested-by: Mark Pearson Signed-off-by: Hans de Goede Link: https://lore.kernel.org/r/20211118114150.271274-1-hdegoede@redhat.com commit 69a25d34f377b5602d188a05827f6173c26ff0de Author: Sugaya Taichi Date: Mon Nov 15 18:30:55 2021 +0900 ARM: dts: milbeaut: set clock phandle to uart node Set clock phandle to uart node for Milbeaut M10V support. Signed-off-by: Sugaya Taichi Link: https://lore.kernel.org/r/1636968656-14033-4-git-send-email-sugaya.taichi@socionext.com' Signed-off-by: Arnd Bergmann commit 2fc4dfc294eef022889e56ebcd4f0c6c6e34e3c5 Author: Sugaya Taichi Date: Mon Nov 15 18:30:54 2021 +0900 ARM: dts: milbeaut: set clock phandle to timer node Set clock phandle to timer node for Milbeaut M10V support. Signed-off-by: Sugaya Taichi Link: https://lore.kernel.org/r/1636968656-14033-3-git-send-email-sugaya.taichi@socionext.com' Signed-off-by: Arnd Bergmann commit 8e0150fe5cf5b86df55257d800258e57d7d34202 Author: Sugaya Taichi Date: Mon Nov 15 18:30:53 2021 +0900 ARM: dts: milbeaut: add a clock node for M10V Add a clock node for the platform of the Milbeaut M10V. Signed-off-by: Sugaya Taichi Link: https://lore.kernel.org/r/1636968656-14033-2-git-send-email-sugaya.taichi@socionext.com' Signed-off-by: Arnd Bergmann commit 6d872df3e3b91532b142de9044e5b4984017a55f Author: Eric Dumazet Date: Fri Nov 19 07:43:32 2021 -0800 net: annotate accesses to dev->gso_max_segs dev->gso_max_segs is written under RTNL protection, or when the device is not yet visible, but is read locklessly. Add netif_set_gso_max_segs() helper. Add the READ_ONCE()/WRITE_ONCE() pairs, and use netif_set_gso_max_segs() where we can to better document what is going on. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 4b66d2161b8125b6caa6971815e85631cf3cf36f Author: Eric Dumazet Date: Fri Nov 19 07:43:31 2021 -0800 net: annotate accesses to dev->gso_max_size dev->gso_max_size is written under RTNL protection, or when the device is not yet visible, but is read locklessly. Add the READ_ONCE()/WRITE_ONCE() pairs, and use netif_set_gso_max_size() where we can to better document what is going on. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit b5e29cf7617cfae70a5d8b850b26cd3cdd7deaa0 Author: Peng Fan Date: Fri Oct 22 21:15:13 2021 +0800 clk: imx: imx8ulp: set suppress_bind_attrs to true The clock driver is registered as platform devices and it is possible to reloading the driver at runtime. But actually the clocks should never be removed to make system work, attempting to bind again would result in a crash, because almost all devices depends on clock to function well. Signed-off-by: Peng Fan Reviewed-by: Abel Vesa Link: https://lore.kernel.org/r/20211022131513.17381-1-peng.fan@oss.nxp.com Signed-off-by: Abel Vesa commit 8e2a2f90511aec3e076ecfac6de3bd96737f2282 Merge: 89f971182417c e175eb5fb0546 Author: David S. Miller Date: Mon Nov 22 12:31:50 2021 +0000 Merge branch 'ethtool-copybreak' Guangbin Huang says: ==================== ethtool: add support to set/get tx copybreak buf size and rx buf len This series add support to set/get tx copybreak buf size and rx buf len via ethtool and hns3 driver implements them. Tx copybreak buf size is used for tx copybreak feature which for small size packet or frag. Use ethtool --get-tunable command to get it, and ethtool --set-tunable command to set it, examples are as follow: 1. set tx spare buf size to 102400: $ ethtool --set-tunable eth1 tx-buf-size 102400 2. get tx spare buf size: $ ethtool --get-tunable eth1 tx-buf-size tx-buf-size: 102400 Rx buf len is buffer length of each rx BD. Use ethtool -g command to get it, and ethtool -G command to set it, examples are as follow: 1. set rx buf len to 4096 $ ethtool -G eth1 rx-buf-len 4096 2. get rx buf len $ ethtool -g eth1 ... RX Buf Len: 4096 Change log: V5 -> V6 1.Fix compile error for divers/s390. V4 -> V5 1.Change struct ethtool_ringparam_ext to kernel_ethtool_ringparam. 2.change "__u32 rx_buf_len" to "u32 rx_buf_len". V3 -> V4 1.Fix a few allmodconfig compile warning. 2.Add more '=' synbol to ethtool-netlink.rst to refine format. 3.Move definement of struct ethtool_ringparam_ext to include/linux/ethtool.h. 4.Move related modify of rings_fill_reply() from patch 4/6 to patch 3/6. V2 -> V3 1.Remove documentation for tx copybreak buf size, there is description for it in userspace ethtool. 2.Move extending parameters for get/set_ringparam function from patch3/6 to patch 4/6. V1 -> V2 1.Add documentation for rx buf len and tx copybreak buf size. 2.Extend structure ringparam_ext for extenal ring params. 3.Change type of ETHTOOL_A_RINGS_RX_BUF_LEN from NLA_U32 to NLA_POLICY_MIN(NLA_U32, 1). 4.Add supported_ring_params in ethtool_ops to indicate if support external params. ==================== Signed-off-by: David S. Miller commit e175eb5fb05462398452e31df5019d780badf45d Author: Hao Chen Date: Thu Nov 18 20:12:45 2021 +0800 net: hns3: remove the way to set tx spare buf via module parameter The way to set tx spare buf via module parameter is not such convenient as the way to set it via ethtool. So,remove the way to set tx spare buf via module parameter. Signed-off-by: Hao Chen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit e65a0231d2caf7d30548964c7bba4c3016dea1d2 Author: Hao Chen Date: Thu Nov 18 20:12:44 2021 +0800 net: hns3: add support to set/get rx buf len via ethtool for hns3 driver Rx buf len is for rx BD buffer size, support setting it via ethtool -G parameter and getting it via ethtool -g parameter. Signed-off-by: Hao Chen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 7462494408cd3de8b0bc1e79670bf213288501d0 Author: Hao Chen Date: Thu Nov 18 20:12:43 2021 +0800 ethtool: extend ringparam setting/getting API with rx_buf_len Add two new parameters kernel_ringparam and extack for .get_ringparam and .set_ringparam to extend more ring params through netlink. Signed-off-by: Hao Chen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 0b70c256eba8448b072d25c95ee65e59da8970de Author: Hao Chen Date: Thu Nov 18 20:12:42 2021 +0800 ethtool: add support to set/get rx buf len via ethtool Add support to set rx buf len via ethtool -G parameter and get rx buf len via ethtool -g parameter. Signed-off-by: Hao Chen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit e445f08af2b15035474439fbbb8649f466ad2501 Author: Hao Chen Date: Thu Nov 18 20:12:41 2021 +0800 net: hns3: add support to set/get tx copybreak buf size via ethtool for hns3 driver Tx copybreak buf size is used for tx copybreak feature, the feature is used for small size packet or frag. It adds a queue based tx shared bounce buffer to memcpy the small packet when the len of xmitted skb is below tx_copybreak(value to distinguish small size and normal size), and reduce the overhead of dma map and unmap when IOMMU is on. Support setting it via ethtool --set-tunable parameter and getting it via ethtool --get-tunable parameter. Signed-off-by: Hao Chen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 448f413a8bdc727d25d9a786ccbdb974fb85d973 Author: Hao Chen Date: Thu Nov 18 20:12:40 2021 +0800 ethtool: add support to set/get tx copybreak buf size via ethtool Add support for ethtool to set/get tx copybreak buf size. Signed-off-by: Hao Chen Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller commit 8626afb170dc44ed0512e04131e4d8eac0c5ec57 Merge: 865fbc0f8dc21 136057256686d Author: Tvrtko Ursulin Date: Mon Nov 22 12:18:15 2021 +0000 Merge drm/drm-next into drm-intel-gt-next Thomas needs the dma_resv_for_each_fence API for i915/ttm async migration work. Signed-off-by: Tvrtko Ursulin commit e94b07493da31705c3fdd0b2854f0cffe1dacb3c Author: Baochen Qiang Date: Fri Nov 19 15:36:26 2021 +0200 ath11k: Set IRQ affinity to CPU0 in case of one MSI vector With VT-d disabled on Intel platform, ath11k gets only one MSI vector. In that case, ath11k does not free IRQ when doing suspend, hence the kernel has to migrate it to CPU0 (if it was affine to other CPUs) and allocates a new MSI vector. However, ath11k has no chance to reconfig it to HW srngs during this phase, thus ath11k fails to resume. This issue can be fixed by setting IRQ affinity to CPU0 before request_irq is called. With such affinity, migration will not happen and thus the vector keeps unchanged during suspend/resume. Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Signed-off-by: Baochen Qiang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211026041732.5323-1-bqiang@codeaurora.org commit 915a081ff307d61d6551d6c16b542e03775353c4 Author: Carl Huang Date: Fri Nov 19 15:36:26 2021 +0200 ath11k: do not restore ASPM in case of single MSI vector Current code enables ASPM by default, it allows MHI to enter M2 state. In case of one MSI vector, system hang is observed if ath11k does MHI register reading in this state. The issue was reported on Dell XPS 13 9310 but is seen also on XPS 15 and XPS 17 laptops. The workaround here is to prevent MHI from entering M2 state, this can be done by disabling ASPM if only one MSI vector is used. When using 32 vectors ASPM is enabled as before. Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Signed-off-by: Carl Huang Signed-off-by: Kalle Valo Signed-off-by: Baochen Qiang Link: https://lore.kernel.org/r/20211026041722.5271-1-bqiang@codeaurora.org commit ac6e73483f7b4b5bde23b14fc3aaafc8341ae0c7 Author: Carl Huang Date: Fri Nov 19 15:36:26 2021 +0200 ath11k: add support one MSI vector On some platforms it's not possible to allocate 32 MSI vectors for various reasons, be it kernel configuration, VT-d disabled, buggy BIOS etc. So ath11k was not able to use QCA6390 PCI devices on those platforms. Add support for one MSI vector to solve that. In case of one MSI vector, interrupt migration needs to be disabled. This is because when interrupt migration happens, the msi_data may change. However, msi_data is already programmed to rings during initial phase and ath11k has no way to know that msi_data is changed during run time and reprogram again. In case of one MSI vector, MHI subsystem should not use IRQF_NO_SUSPEND as QCA6390 doesn't set this flag too. Ath11k doesn't need to leave IRQ enabled in suspend state. Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Signed-off-by: Carl Huang Signed-off-by: Kalle Valo Signed-off-by: Baochen Qiang Link: https://lore.kernel.org/r/20211026041714.5219-1-bqiang@codeaurora.org commit c41a6700b276ddf6ef93dcb43baca51ea0c4c7c1 Author: Carl Huang Date: Fri Nov 19 15:36:26 2021 +0200 ath11k: refactor multiple MSI vector implementation This is to prepare for one MSI vector support. IRQ enable and disable of CE and DP are done only in case of multiple MSI vectors. Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Signed-off-by: Carl Huang Signed-off-by: Kalle Valo Signed-off-by: Baochen Qiang Link: https://lore.kernel.org/r/20211026041705.5167-1-bqiang@codeaurora.org commit 4ab4693f327ad015c4637ae42dc53c8471aed9c8 Author: Carl Huang Date: Fri Nov 19 15:36:26 2021 +0200 ath11k: use ATH11K_PCI_IRQ_DP_OFFSET for DP IRQ Like ATH11K_PCI_IRQ_CE0_OFFSET, define ATH11K_PCI_IRQ_DP_OFFSET for DP to save the IRQ instead of base_vector from MSI config. Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Signed-off-by: Carl Huang Signed-off-by: Kalle Valo Signed-off-by: Baochen Qiang Link: https://lore.kernel.org/r/20211026041655.5112-1-bqiang@codeaurora.org commit 01279bcd01d965b6526d575e036841778d8e3c4e Author: Carl Huang Date: Fri Nov 19 15:36:26 2021 +0200 ath11k: add CE and ext IRQ flag to indicate irq_handler This change adds two flags to indicate whether IRQ handler for CE and DP can be called. This is because in one MSI vector case, interrupt is not disabled in hif_stop and hif_irq_disable. Otherwise, MHI interrupt is disabled too. Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Signed-off-by: Carl Huang Signed-off-by: Kalle Valo Signed-off-by: Baochen Qiang Link: https://lore.kernel.org/r/20211026041646.5060-1-bqiang@codeaurora.org commit 87b4072d7ef818e368b0f4162a1af2fb4727f51c Author: Carl Huang Date: Fri Nov 19 15:36:26 2021 +0200 ath11k: get msi_data again after request_irq is called The reservation mode of interrupts in kernel assigns a dummy vector when the interrupt is allocated and assigns a real vector when the request_irq is called. The reservation mode helps to ease vector pressure when devices with a large amount of queues/interrupts are initialized, but only a minimal subset of those queues/interrupts is actually used. So on reservation mode, the msi_data may change after request_irq is called, so ath11k reads msi_data again after request_irq is called, and then the correct msi_data is programmed into QCA6390 hardware components. Without this change, spurious interrupt occurs in case of one MSI vector. When VT-d in BIOS is enabled and ath11k can get 32 MSI vectors, ath11k always get the same msi_data before and after request_irq, that's why this change is only required when one MSI vector is to be supported. Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Signed-off-by: Carl Huang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211026041636.5008-1-bqiang@codeaurora.org commit 3542de6a5b159fac0e7ca84d77a57ea99125d6b1 Author: Wolfram Sang Date: Fri Nov 19 12:04:42 2021 +0100 memory: renesas-rpc-if: refactor MOIIO and IOFV macros Don't use _HIZ macros but also provide a val. This is more consistent with the other macros and, thus, easier to read. Also shorter. Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20211119110442.4946-1-wsa+renesas@sang-engineering.com Signed-off-by: Krzysztof Kozlowski commit 57ea9daad51f7707f61a602a743decf10cf9fea9 Author: Wolfram Sang Date: Wed Nov 17 10:37:10 2021 +0100 memory: renesas-rpc-if: avoid use of undocumented bits Instead of writing fixed values with undocumented bits which happen to be set on some SoCs, better switch to read-modify-write operations changing only bits which are documented. This is way more future-proof as we don't know yet how these bits may be on upcoming SoCs. Signed-off-by: Wolfram Sang Tested-by: Lad Prabhakar Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211117093710.14430-1-wsa+renesas@sang-engineering.com Signed-off-by: Krzysztof Kozlowski commit 2db468d6fda4c33d26ba9dde7c72e081b2b86ad1 Author: Wolfram Sang Date: Wed Nov 17 11:29:02 2021 +0100 memory: renesas-rpc-if: simplify register update No need to open code regmap_update_bits(). Signed-off-by: Wolfram Sang Tested-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211117102902.20062-1-wsa+renesas@sang-engineering.com Signed-off-by: Krzysztof Kozlowski commit 6904d7e5d3951d544aaf09ead6b0a5c943b17db7 Author: Sam Protsenko Date: Mon Nov 22 01:27:41 2021 +0200 clk: samsung: exynos850: Keep some crucial clocks running Some clocks shouldn't be automatically disabled in clk_disable_unused(), otherwise kernel hangs. Mark those clocks with: - CLK_IS_CRITICAL flag, when there won't be any consumers for that clock, but system can't function when it's gated - CLK_IGNORE_UNUSED flag, when consumer driver will be probably added later That makes it possible to run the kernel without passing the "clk_ignore_unused" param. Next clocks were modified: - "gout_dpu_cmu_dpu_pclk": CLK_IGNORE_UNUSED Will be enabled later in DSIM driver (Display Serial Interface Master). - "gout_gpio_peri_pclk": CLK_IGNORE_UNUSED "gout_gpio_cmgp_pclk": CLK_IGNORE_UNUSED "gout_gpio_hsi_pclk": CLK_IGNORE_UNUSED Should be probably enabled in corresponding GPIO driver later, or made CLK_IS_CRITICAL. "gout_gpio_peri_clk" is actually used by LEDs on Exynos850-based dev board, so kernel hangs if this clock is not running. Other clocks were marked as "ignore unused" to prevent similar issues for other use cases or boards that might be added later. - "gout_cci_aclk": CLK_IS_CRITICAL CCI (Cache Coherent Interconnect): obviously is critical. - "gout_gic_clk": CLK_IS_CRITICAL GIC (Generic Interrupt Controller): obviously is critical. Signed-off-by: Sam Protsenko Signed-off-by: Sylwester Nawrocki Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20211121232741.6967-7-semen.protsenko@linaro.org commit 2602dc10f9d930bcc537467d13de4cfbfaa2126d Author: Lad Prabhakar Date: Sun Nov 21 18:01:55 2021 +0000 memory: renesas-rpc-if: Silence clang warning This patch silences the following clang warning: | drivers/memory/renesas-rpc-if.c:253:14: warning: cast to smaller integer | type 'enum rpcif_type' from 'const void *' [-Wvoid-pointer-to-enum-cast] | rpc->type = (enum rpcif_type)of_device_get_match_data(dev); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fixes: b04cc0d912eb8 ("memory: renesas-rpc-if: Add support for RZ/G2L") Reported-by: kernel test robot Signed-off-by: Lad Prabhakar Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20211121180155.9062-1-prabhakar.mahadev-lad.rj@bp.renesas.com [krzysztof: drop enum rpcif_type cast] Signed-off-by: Krzysztof Kozlowski commit 865fbc0f8dc21e17dc3ad9f0f1ebf00a6696b2ca Author: Umesh Nerlige Ramappa Date: Fri Nov 19 17:42:01 2021 -0800 drm/i915/pmu: Avoid with_intel_runtime_pm within spinlock When guc timestamp ping worker runs it takes the spinlock and calls with_intel_runtime_pm. Since with_intel_runtime_pm may sleep, move the spinlock inside __update_guc_busyness_stats. Signed-off-by: Umesh Nerlige Ramappa Reviewed-by: Tvrtko Ursulin Signed-off-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20211120014201.26480-1-umesh.nerlige.ramappa@intel.com commit 62782ba856d1c89c03535e92c32c997e1ebfed0b Author: Sam Protsenko Date: Mon Nov 22 01:27:39 2021 +0200 clk: samsung: exynos850: Implement CMU_CMGP domain CMU_CMGP clock domain provides clocks for CMGP IP-core (Common GPIO). CMGP module encapsulates next blocks: - 8 GPIO lines - 1 GPADC - 2 USI blocks, each can be configured to provide one of UART/SPI/HSI2C serial interfaces Signed-off-by: Sam Protsenko Signed-off-by: Sylwester Nawrocki Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20211121232741.6967-5-semen.protsenko@linaro.org commit c2afeb79fdb24de4cea73f12d2ede84a5a68fa08 Author: Sam Protsenko Date: Mon Nov 22 01:27:38 2021 +0200 dt-bindings: clock: Add bindings for Exynos850 CMU_CMGP CMU_CMGP generates USI and ADC clocks for BLK_ALIVE. In particular USI clocks are needed for HSI2C_3 and HSI2C_4 instances. Add clock indices and bindings documentation for CMU_CMGP domain. Signed-off-by: Sam Protsenko Signed-off-by: Sylwester Nawrocki Reviewed-by: Krzysztof Kozlowski Acked-by: Chanwoo Choi Link: https://lore.kernel.org/r/20211121232741.6967-4-semen.protsenko@linaro.org commit 579839a918d71e955603e0b9ba5cc38efc740f05 Author: Sam Protsenko Date: Mon Nov 22 01:27:37 2021 +0200 clk: samsung: exynos850: Implement CMU_APM domain CMU_APM clock domain provides clocks for APM IP-core (Active Power Management). According to Exynos850 TRM, CMU_APM generates I3C, Mailbox, Speedy, Timer, WDT, RTC and PMU clocks for BLK_ALIVE. This patch adds next clocks: - bus clocks in CMU_TOP needed for CMU_APM - all internal CMU_APM clocks - leaf clocks for I3C, Speedy and RTC IP-cores - bus clocks for CMU_CMGP and CMU_CHUB CMU_APM doesn't belong to Power Domains, but platform driver is used for its registration to keep its bus clock always running. Otherwise rtc-s3c driver disables that clock and system freezes. Signed-off-by: Sam Protsenko Signed-off-by: Sylwester Nawrocki Reviewed-by: Krzysztof Kozlowski Acked-by: Chanwoo Choi Link: https://lore.kernel.org/r/20211121232741.6967-3-semen.protsenko@linaro.org commit 16e0c2474fcfaa8a6c61abfaa981994c4564a628 Author: Sam Protsenko Date: Mon Nov 22 01:27:36 2021 +0200 dt-bindings: clock: Add bindings for Exynos850 CMU_APM CMU_APM generates clocks for APM IP-core (Active Power Management). In particular it generates RTC clocks, which are needed to enable rtc-s3c driver on Exynos850 SoC. Add clock indices and binding documentation for CMU_APM. Signed-off-by: Sam Protsenko Signed-off-by: Sylwester Nawrocki Reviewed-by: Krzysztof Kozlowski Reviewed-by: Rob Herring Acked-by: Chanwoo Choi Link: https://lore.kernel.org/r/20211121232741.6967-2-semen.protsenko@linaro.org commit 34734edd06f84290a3fc6f2a4ae61969e9d25801 Author: Maxime Ripard Date: Tue Nov 16 15:32:55 2021 +0100 dt-bindings: crypto: Add optional dma properties Some platforms, like the v3s, have DMA channels assigned to the crypto engine, which were in the DTSI but were never documented. Let's make sure they are. Signed-off-by: Maxime Ripard Acked-by: Corentin Labbe Acked-by: Jernej Skrabec Link: https://lore.kernel.org/r/20211116143255.385480-1-maxime@cerno.tech commit bbdde16e5d7ebfd2e04bc41f800ebbd5468336b1 Author: Jernej Skrabec Date: Sat Nov 20 11:20:24 2021 +0100 ARM: dts: sun8i: h3: beelink-x2: Add GPIO CEC node Beelink X2 doesn't use HW CEC controller found in DW HDMI core. It has dedicated GPIO pin for that purpose. Add a node for it. Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20211120102024.439456-1-jernej.skrabec@gmail.com commit 38df5750962c61b96d4e53358f31955fe310d4f5 Author: Jernej Skrabec Date: Sat Nov 20 08:34:48 2021 +0100 ARM: dts: sunxi: Add CEC clock to DW-HDMI Experimentation determined that HDMI CEC controller inside DW HDMI block depends on 32k clock from RTC. If this clock is tampered with, HDMI CEC communication starts or stops working, depending on situation. SoC user manual doesn't say anything about CEC, so this was overlooked. Fix this by adding dependency to RTC 32k clock. Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20211120073448.32480-3-jernej.skrabec@gmail.com commit 3047444def125d9e1fb788541e8dc18a7058a47a Author: Jernej Skrabec Date: Sat Nov 20 08:34:47 2021 +0100 arm64: dts: allwinner: a64: Add CEC clock to HDMI Experimentation determined that HDMI CEC controller inside DW HDMI block depends on 32k clock from RTC. If this clock is tampered with, HDMI CEC communication starts or stops working, depending on situation. SoC user manual doesn't say anything about CEC, so this was overlooked. Fix this by adding dependency to RTC 32k clock. Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20211120073448.32480-2-jernej.skrabec@gmail.com commit 725bc607aa02d570c35c5f21c3eadc3342bf4e06 Author: Jernej Skrabec Date: Sun Nov 21 08:03:21 2021 +0100 ARM: dts: sun8i: h3: beelink-x2: Sort nodes Nodes are not sorted alphabetically. Do it. There is no functional change. Signed-off-by: Jernej Skrabec Acked-by: Chen-Yu Tsai Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20211121070321.601659-1-jernej.skrabec@gmail.com commit f7e47d85f3f5913bcf508589c8dabbfbd3f4fe56 Author: Jernej Skrabec Date: Sun Nov 21 12:50:02 2021 +0100 arm64: dts: allwinner: h6: tanix-tx6: Add I2C node Tanix TX6 has a LED display driven by FD650. Currently there is no Linux driver nor any binding for it. However, we can at least provide I2C node in DT, so user space scripts or programs can manually control it. Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20211121115002.693329-1-jernej.skrabec@gmail.com commit c8c525b06f532923d21d99811a7b80bf18ffd2be Author: Samuel Holland Date: Thu Nov 18 21:33:35 2021 -0600 clk: sunxi-ng: Allow drivers to be built as modules While it is useful to build all of the CCU drivers at once, only 1-3 of them will be loaded at a time, or possibly none of them if the kernel is booted on a non-sunxi platform. These CCU drivers are relatively large; 32-bit drivers have 30-50k of data each, while the 64-bit ones are 50-75k due to the increased pointer overhead. About half of that data comes from relocations. Let's allow the user to build these drivers as modules so only the necessary data is loaded. As a first step, convert the CCUs that are already platform drivers. When the drivers are built as modules, normally the file name becomes the module name. However, the current file names are inconsistent with the - name used everywhere else: the devicetree bindings, the platform driver names, and the Kconfig symbols. Use Makfile logic to rename the modules so they follow the usual pattern. Signed-off-by: Samuel Holland Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20211119033338.25486-3-samuel@sholland.org commit 551b62b1e4cb64d3b42da0fbfdcd26a5fcd684be Author: Samuel Holland Date: Thu Nov 18 21:33:34 2021 -0600 clk: sunxi-ng: Export symbols used by CCU drivers For the individual CCU drivers to be built as modules, the ops structs, helper functions, and callback registration functions must be exported. These symbols are intended for use only by the adjacent CCU drivers, so export them into the SUNXI_CCU namespace. of_sunxi_ccu_probe is not exported because it is only used by built-in OF clock providers. Signed-off-by: Samuel Holland Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20211119033338.25486-2-samuel@sholland.org commit 1f1517fafda598839a02e39968c5063ddcfa51fc Author: Mauro Carvalho Chehab Date: Mon Nov 22 08:32:02 2021 +0000 media: cx18: drop an unused macro The macro p_to_snd_cx18_card() is just a variant for container_of(), not actually used inside the code. So, drop it. This address a clang warning. Signed-off-by: Mauro Carvalho Chehab commit 9543b4e3206621e1e45f7e3a5841359a3a53686d Author: Mauro Carvalho Chehab Date: Mon Nov 22 08:29:50 2021 +0000 media: ivtv: drop an unused macro The macro p_to_snd_ivtv_card() is just a variant for container_of(), not actually used inside the code. So, drop it. This address a clang warning. Signed-off-by: Mauro Carvalho Chehab commit 140dfc36fbd3b759a47e972774b362894f43911f Author: Mauro Carvalho Chehab Date: Mon Nov 22 08:24:03 2021 +0000 media: cx25821: drop duplicated i2c_slave_did_ack() This function is defined twice, one at cx25821-i2c and the other inside cx25821-core. It turns that only the first is actually used inside the code. This causes a clang warning. Signed-off-by: Mauro Carvalho Chehab commit 0d2517b3765aa331aee0a95f9b8072062d6bb7e5 Author: Andrzej Pietrasiewicz Date: Tue Nov 16 14:38:42 2021 +0000 media: hantro: Support NV12 on the G2 core The G2 decoder block produces NV12 4x4 tiled format (NV12_4L4). Enable the G2 post-processor block, in order to produce regular NV12. The logic in hantro_postproc.c is leveraged to take care of allocating the extra buffers and configure the post-processor, which is significantly simpler than the one on the G1. Signed-off-by: Ezequiel Garcia Signed-off-by: Andrzej Pietrasiewicz Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit be1b49f576a80167162707b90151d8a55bf567be Author: Andrzej Pietrasiewicz Date: Tue Nov 16 14:38:41 2021 +0000 media: hantro: Staticize a struct in postprocessor code The struct is not used outside this file, so it can be static. Signed-off-by: Andrzej Pietrasiewicz Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit e2da465455ce48061f726f3a1aad2a3a5a6f547f Author: Andrzej Pietrasiewicz Date: Tue Nov 16 14:38:40 2021 +0000 media: hantro: Support VP9 on the G2 core VeriSilicon Hantro G2 core supports VP9 codec. [hverkuil: add kerneldoc line for HANTRO_MODE_VP9_DEC] Signed-off-by: Andrzej Pietrasiewicz Reviewed-by: Benjamin Gaignard Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit cb1bbbd4cffd55d166ec9fa5d0ea2afa749ca9cf Author: Andrzej Pietrasiewicz Date: Tue Nov 16 14:38:39 2021 +0000 media: hantro: Prepare for other G2 codecs VeriSilicon Hantro G2 core supports other codecs besides hevc. Factor out some common code in preparation for vp9 support. Signed-off-by: Andrzej Pietrasiewicz Reviewed-by: Benjamin Gaignard Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 82fb363d5e96bd87e5027d0d2bbecea75870707d Author: Andrzej Pietrasiewicz Date: Tue Nov 16 14:38:38 2021 +0000 media: hantro: Rename registers Add more consistency in the way registers are named. Signed-off-by: Andrzej Pietrasiewicz Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit f25709c4ff151fbc7dc2e0b7cf5962767a093f68 Author: Andrzej Pietrasiewicz Date: Wed Nov 17 11:52:56 2021 +0000 media: rkvdec: Add the VP9 backend The Rockchip VDEC supports VP9 profile 0 up to 4096x2304@30fps. Add a backend for this new format. Signed-off-by: Boris Brezillon Signed-off-by: Ezequiel Garcia Signed-off-by: Adrian Ratiu Co-developed-by: Andrzej Pietrasiewicz Signed-off-by: Andrzej Pietrasiewicz Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 3e3b1fb0e5d95c0cd7278717185ca3fb00f5d771 Author: Andrzej Pietrasiewicz Date: Tue Nov 16 14:38:36 2021 +0000 media: Add VP9 v4l2 library Provide code common to vp9 drivers in one central location. Signed-off-by: Andrzej Pietrasiewicz Signed-off-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit b88dbe38dca82425a273d126785866af39ba0770 Author: Andrzej Pietrasiewicz Date: Tue Nov 16 14:38:35 2021 +0000 media: uapi: Add VP9 stateless decoder controls Add the VP9 stateless decoder controls plus the documentation that goes with it. Signed-off-by: Boris Brezillon Co-developed-by: Ezequiel Garcia Signed-off-by: Ezequiel Garcia Signed-off-by: Adrian Ratiu Signed-off-by: Andrzej Pietrasiewicz Co-developed-by: Daniel Almeida Signed-off-by: Daniel Almeida Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit bb91e46eb017876689757cc208c047c518b4189b Author: Ezequiel Garcia Date: Tue Nov 16 14:38:34 2021 +0000 media: hantro: Add quirk for NV12/NV12_4L4 capture format The G2 core decoder engine produces NV12_4L4 format, which is a simple NV12 4x4 tiled format. The driver currently hides this format by always enabling the post-processor engine, and therefore offering NV12 directly. This is done without using the logic in hantro_postproc.c and therefore makes it difficult to add VP9 cleanly. Since fixing this is not easy, add a small quirk to force NV12 if HEVC was configured, but otherwise declare NV12_4L4 as the pixel format in imx8mq_vpu_g2_variant.dec_fmts. This will be used by the VP9 decoder which will be added soon. Signed-off-by: Ezequiel Garcia Signed-off-by: Andrzej Pietrasiewicz Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 53a3e71095c572333ceea30762565dbedec951ca Author: Ezequiel Garcia Date: Tue Nov 16 14:38:33 2021 +0000 media: hantro: Simplify postprocessor Add a 'postprocessed' boolean property to struct hantro_fmt to signal that a format is produced by the post-processor. This will allow to introduce the G2 post-processor in a simple way. Signed-off-by: Ezequiel Garcia Signed-off-by: Andrzej Pietrasiewicz Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 04dad52ee341c738adfd929d5f2b906001a2aeda Author: Ezequiel Garcia Date: Tue Nov 16 14:38:32 2021 +0000 media: hantro: postproc: Introduce struct hantro_postproc_ops Turns out the post-processor block on the G2 core is substantially different from the one on the G1 core. Introduce hantro_postproc_ops with .enable and .disable methods, which will allow to support the G2 post-processor cleanly. Signed-off-by: Ezequiel Garcia Signed-off-by: Andrzej Pietrasiewicz Reviewed-by: Benjamin Gaignard Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 9393761aec4c56b7f2f19d21f806d316731401c1 Author: Ezequiel Garcia Date: Tue Nov 16 14:38:31 2021 +0000 media: hantro: postproc: Fix motion vector space size When the post-processor hardware block is enabled, the driver allocates an internal queue of buffers for the decoder enginer, and uses the vb2 queue for the post-processor engine. For instance, on a G1 core, the decoder engine produces NV12 buffers and the post-processor engine can produce YUY2 buffers. The decoder engine expects motion vectors to be appended to the NV12 buffers, but this is only required for CODECs that need motion vectors, such as H.264. Fix the post-processor logic accordingly. Signed-off-by: Ezequiel Garcia Signed-off-by: Andrzej Pietrasiewicz Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit c61d7b2ef141abf81140756b45860a2306f395a2 Author: Daniel Thompson Date: Thu Nov 18 10:09:52 2021 +0000 Documentation: dmaengine: Correctly describe dmatest with channel unset Currently the documentation states that channels must be configured before running the dmatest. This has not been true since commit 6b41030fdc79 ("dmaengine: dmatest: Restore default for channel"). Fix accordingly. Fixes: 6b41030fdc79 ("dmaengine: dmatest: Restore default for channel") Signed-off-by: Daniel Thompson Link: https://lore.kernel.org/r/20211118100952.27268-3-daniel.thompson@linaro.org Signed-off-by: Vinod Koul commit 37829227f04247125894a7857e3299e8764c2d6f Author: Daniel Thompson Date: Thu Nov 18 10:09:51 2021 +0000 Documentation: dmaengine: Add a description of what dmatest does Currently it can difficult to determine what dmatest does without reading the source code. Let's add a description. The description is taken mostly from the patch header of commit 4a776f0aa922 ("dmatest: Simple DMA memcpy test client"). It has been edited and updated slightly. Nevertheless the new text was largely written by Haarvard Skinnemoen and was copied from another patch, already committed to the kernel, which has Haarvard's SoB: attached to it. Signed-off-by: Daniel Thompson Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211118100952.27268-2-daniel.thompson@linaro.org Signed-off-by: Vinod Koul commit 2bfab6f8b4f1814eabfcbf335c2fc451592e9fc5 Author: Xu Wang Date: Tue Nov 16 01:33:06 2021 +0000 dmaengine: qcom: gpi: Remove unnecessary print function dev_err() The print function dev_err() is redundant because platform_get_irq() already prints an error. Signed-off-by: Xu Wang Link: https://lore.kernel.org/r/20211116013306.784-1-vulab@iscas.ac.cn Signed-off-by: Vinod Koul commit 29cf37fa6dd9c4de81b745ad3ae77f3709931d1e Author: Adrian Larumbe Date: Mon Nov 1 18:08:25 2021 +0000 dmaengine: Add consumer for the new DMA_MEMCPY_SG API function. This new CDMA binding for device_prep_dma_memcpy_sg was partially borrowed from xlnx kernel tree, an expanded with extended address space support when linking descriptor segments and checking for incorrect zero transfer size. Signed-off-by: Adrian Larumbe Link: https://lore.kernel.org/r/20211101180825.241048-4-adrianml@alumnos.upm.es Signed-off-by: Vinod Koul commit 3218910fd5858842a1dd98ce92b602f0878f8210 Author: Adrian Larumbe Date: Mon Nov 1 18:08:24 2021 +0000 dmaengine: Add core function and capability check for DMA_MEMCPY_SG This is the old DMA_SG interface that was removed in commit c678fa66341c ("dmaengine: remove DMA_SG as it is dead code in kernel"). It has been renamed to DMA_MEMCPY_SG to better match the MEMSET and MEMSET_SG naming convention. It should only be used for mem2mem copies, either main system memory or CPU-addressable device memory (like video memory on a PCI graphics card). Bringing back this interface was prompted by the need to use the Xilinx CDMA device for mem2mem SG transfers. Signed-off-by: Adrian Larumbe Link: https://lore.kernel.org/r/20211101180825.241048-3-adrianml@alumnos.upm.es Signed-off-by: Vinod Koul commit 58fe107660483138a7a77acd673b911016e4ad31 Author: Adrian Larumbe Date: Mon Nov 1 18:08:23 2021 +0000 dmaengine: Add documentation for new memcpy scatter-gather function Documentation describes semantics, limitations and a typical use case scenario. Signed-off-by: Adrian Larumbe Link: https://lore.kernel.org/r/20211101180825.241048-2-adrianml@alumnos.upm.es Signed-off-by: Vinod Koul commit 56fc39f5a36794c4f27f5fee047b641eac3f5b89 Author: Dave Jiang Date: Tue Oct 26 14:36:41 2021 -0700 dmaengine: idxd: handle interrupt handle revoked event "Interrupt handle revoked" is an event that happens when the driver is running on a guest kernel and the VM is migrated to a new machine. The device will trigger an interrupt that signals to the guest driver that the interrupt handles need to be replaced. The misc irq thread function calls a helper function to handle the event. The function uses the WQ percpu_ref to quiesce the kernel submissions. It then replaces the interrupt handles by requesting interrupt handle command for each I/O MSIX vector. Once the handle is updated, the driver will unblock the submission path to allow new submissions. The submitter will attempt to acquire a percpu_ref before submission. When the request fails, it will wait on the wq_resurrect 'completion'. The driver does anticipate the possibility of descriptors being submitted before the WQ percpu_ref is killed. If a descriptor has already been submitted, it will return with incorrect interrupt handle status. The descriptor will be re-submitted with the new interrupt handle on the completion path. For descriptors with incorrect interrupt handles, completion interrupt won't be triggered. At the completion of the interrupt handle refresh, the handling function will call idxd_int_handle_refresh_drain() to issue drain descriptors to each of the wq with associated interrupt handle. The drain descriptor will have interrupt request set but without completion record. This will ensure all descriptors with incorrect interrupt completion handle get drained and a completion interrupt is triggered for the guest driver to process them. Reviewed-by: Kevin Tian Co-Developed-by: Sanjay Kumar Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/163528420189.3925689.18212568593220415551.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit f6d442f7088cbf5e2ac4561aca6888380239d5b9 Author: Dave Jiang Date: Tue Oct 26 14:36:36 2021 -0700 dmaengine: idxd: handle invalid interrupt handle descriptors Handle a descriptor that has been marked with invalid interrupt handle error in status. Create a work item that will resubmit the descriptor. This typically happens when the driver has handled the revoke interrupt handle event and has a new interrupt handle. Reviewed-by: Kevin Tian Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/163528419601.3925689.4166517602890523193.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit bd5970a0d01f8e45af9b2e2cf1d245b84ea757ba Author: Dave Jiang Date: Tue Oct 26 14:36:29 2021 -0700 dmaengine: idxd: create locked version of idxd_quiesce() call Add a locked version of idxd_quiesce() call so that the quiesce can be called with a lock in situations where the lock is not held by the caller. In the driver probe/remove path, the lock is already held, so the raw version can be called w/o locking. Reviewed-by: Kevin Tian Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/163528418980.3925689.5841907054957931211.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 46c6df1c958e55558212cfa94cad201eae48d684 Author: Dave Jiang Date: Tue Oct 26 14:36:23 2021 -0700 dmaengine: idxd: add helper for per interrupt handle drain The helper is called at the completion of the interrupt handle refresh event. It issues drain descriptors to each of the wq with associated interrupt handle. The drain descriptor will have interrupt request set but without completion record. This will ensure all descriptors with incorrect interrupt completion handle get drained and a completion interrupt is triggered for the guest driver to process them. Reviewed-by: Kevin Tian Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/163528418315.3925689.7944718440052849626.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit eb0cf33a91b46cd50b590d032471f7f977d5a92a Author: Dave Jiang Date: Tue Oct 26 14:36:17 2021 -0700 dmaengine: idxd: move interrupt handle assignment In preparation of supporting interrupt handle revoke event, move the interrupt handle assignment to right before the descriptor to be submitted. This allows the interrupt handle revoke logic to assign the latest interrupt handle on submission. Reviewed-by: Kevin Tian Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/163528417767.3925689.7730411152122952808.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 8b67426e05584e956775f4b134596b56bc0d35e0 Author: Dave Jiang Date: Tue Oct 26 14:36:10 2021 -0700 dmaengine: idxd: int handle management refactoring Attach int_handle to irq_entry. This removes the separate management of int handles and reduces the confusion of interating through int handles that is off by 1 count. Reviewed-by: Kevin Tian Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/163528417065.3925689.11505755433684476288.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 5d78abb6fbc974d601dd365b9ce39f320fb5ba79 Author: Dave Jiang Date: Tue Oct 26 14:36:02 2021 -0700 dmaengine: idxd: rework descriptor free path on failure Refactor the completion function to allow skipping of descriptor freeing on the submission failure path. This completely removes descriptor freeing from the submit failure path and leave the responsibility to the caller. Reviewed-by: Kevin Tian Signed-off-by: Dave Jiang Link: https://lore.kernel.org/r/163528416222.3925689.12859769271667814762.stgit@djiang5-desk3.ch.intel.com Signed-off-by: Vinod Koul commit 365fceecd66e2f4c9b4c4f636b506079052562ea Author: Christophe JAILLET Date: Thu Nov 18 20:28:02 2021 +0100 dmaengine: ti: edma: Use 'for_each_set_bit' when possible Use 'for_each_set_bit()' instead of hand wrinting it. It is much less version. Signed-off-by: Christophe JAILLET Acked-by: Peter Ujfalusi Link: https://lore.kernel.org/r/47a7415d3aff8dfb66780bd6f80b085db4503bf7.1637263609.git.christophe.jaillet@wanadoo.fr Signed-off-by: Vinod Koul commit c190510714df168b9d6387bc29844acbe9a39521 Author: Martin Kepplinger Date: Thu Nov 4 14:22:13 2021 +0100 arm64: dts: imx8mq-librem5-r3.dtsi: describe selfie cam XSHUTDOWN pin The r3 and later revisions of the Librem 5 phone include an additional switch to control the hi846 XSHUTDOWN pin. Describe it. Signed-off-by: Martin Kepplinger Signed-off-by: Shawn Guo commit fed7603597fa660219eb49ef7ed37fafd42f9869 Author: Martin Kepplinger Date: Thu Nov 4 14:22:12 2021 +0100 arm64: dts: imx8mq-librem5: describe the selfie cam Enable the CSI1 MIPI RX controller and CSI1 bridge on the SoC. Describe the Librem 5 front-facing camera, connected to the CSI1 MIPI. the following sets formats, streams 10 frames and saves one: #!/bin/bash WIDTH=1632 HEIGHT=1224 SKIP=10 media-ctl -d "platform:30a90000.csi" --set-v4l2 "'csi':0 [fmt:SGBRG10/${WIDTH}x${HEIGHT} colorspace:raw]" media-ctl -d "platform:30a90000.csi" --set-v4l2 "'imx8mq-mipi-csi2 30a70000.csi':0 [fmt:SGBRG10/${WIDTH}x${HEIGHT} colorspace:raw]" media-ctl -d "platform:30a90000.csi" --set-v4l2 "'hi846 2-0020':0 [fmt:SGBRG10/${WIDTH}x${HEIGHT} colorspace:raw]" media-ctl -d "platform:30a90000.csi" -l "'hi846 2-0020':0 -> 'imx8mq-mipi-csi2 30a70000.csi':0 [1]" v4l2-ctl -d "/dev/v4l/by-path/platform-30a90000.csi-video-index0" --set-fmt-video=width=${WIDTH},height=${HEIGHT},pixelformat=GB16 --stream-mmap --stream-to=$WIDTH.raw --stream-skip=$SKIP --stream-count=1 Signed-off-by: Martin Kepplinger Signed-off-by: Shawn Guo commit 1019b783696aa0705517d8a23f29dbbc8ec64048 Author: Martin Kepplinger Date: Thu Nov 4 14:22:11 2021 +0100 arm64: dts: imx8mq-librem5: describe power supply for cameras CAMERA_PWR_EN controls two different power supplies that cameras will use. The hardware killswitch controls a third one. Describe that appropriately. The pinctrl that describes the gpio that is used in 2 places here is added to the pmic. This is done because pmic is powered early enough to make sure this will work. When we would have put the same pinctrl property into the 2 regulator nodes (instead of the pmic), we'd get: imx8mq-pinctrl 30330000.pinctrl: pin MX8MQ_IOMUXC_GPIO1_IO00 already requested by regulator-csi-1v8; cannot claim for regulator-vcam-2v8 imx8mq-pinctrl 30330000.pinctrl: pin-10 (regulator-vcam-2v8) status -22 imx8mq-pinctrl 30330000.pinctrl: could not request pin 10 (MX8MQ_IOMUXC_GPIO1_IO00) from group camerapwrgrp on device 30330000.pinctrl Signed-off-by: Martin Kepplinger Signed-off-by: Shawn Guo commit b43e6c03a85423db959f88d96ddd682e5c09f8fd Author: Martin Kepplinger Date: Thu Nov 4 14:22:10 2021 +0100 arm64: dts: split out a shared imx8mq-librem5-r3.dtsi description The Librem 5 r3 ("Dogwood") and r4 ("Evergreen") revisions are quite similar. Add a shared imx8mq-librem5-r3.dtsi description to be included in r3 and later dts files in order to avoid duplication. This is no change in the descriptions but only refactoring. Signed-off-by: Martin Kepplinger Signed-off-by: Shawn Guo commit e3f775070e06bb9b5c29c499a98de95cb5cad7cf Author: Adam Ford Date: Thu Nov 4 07:34:11 2021 -0500 arm64: dts: imx8mm-beacon: Enable USB Controllers The i.MX8M Mini has two available USB controllers. On the imx8mm-beacon board, USB1 is routed to a mini-USB port with OTG functionality. USB2 is routed to a USB hub which has three host-only ports connected to it. Signed-off-by: Adam Ford Signed-off-by: Shawn Guo commit 2afbbab45c261abf5a03584b164a526933995efd Author: Colin Foster Date: Fri Nov 19 11:59:28 2021 -0800 pinctrl: microchip-sgpio: update to support regmap Adopt regmap instead of a direct memory map so that custom regmaps and other interfaces can be supported. Signed-off-by: Colin Foster Link: https://lore.kernel.org/r/20211119195928.2498441-5-colin.foster@in-advantage.com Signed-off-by: Linus Walleij commit 076d9e71bcf8a80c94bf1d46c424977472c97078 Author: Colin Foster Date: Fri Nov 19 11:59:27 2021 -0800 pinctrl: ocelot: convert pinctrl to regmap In order to allow external control via SPI, memory-mapped areas must be changed to use the generic regmap interface. This is step 1, and is followed by an implementation that allows a custom regmap. Signed-off-by: Colin Foster Link: https://lore.kernel.org/r/20211119195928.2498441-4-colin.foster@in-advantage.com Signed-off-by: Linus Walleij commit a159c2b4cb7517fe11f3ce698f792126e964fc7a Author: Colin Foster Date: Fri Nov 19 11:59:26 2021 -0800 pinctrl: ocelot: update pinctrl to automatic base address struct gpio_chip recommends passing -1 as base to gpiolib. Doing so avoids conflicts when the chip is external and gpiochip0 already exists. Signed-off-by: Colin Foster Tested-by: Clément Léger Link: https://lore.kernel.org/r/20211119195928.2498441-3-colin.foster@in-advantage.com Signed-off-by: Linus Walleij commit ad96111e658a959e55894863a758e6c2cf31bb5e Author: Colin Foster Date: Fri Nov 19 11:59:25 2021 -0800 pinctrl: ocelot: combine get resource and ioremap into single call Simple cleanup to make two function calls only one. Signed-off-by: Colin Foster Link: https://lore.kernel.org/r/20211119195928.2498441-2-colin.foster@in-advantage.com Signed-off-by: Linus Walleij commit 1dd19cae155208065277f01dc61fe8897b6d2a29 Author: Kunihiko Hayashi Date: Tue Nov 9 09:11:39 2021 +0900 dt-bindings: pinctrl: uniphier: Add child node definitions to describe pin mux and configuration In arch/arm/boot/dts/uniphier-pinctrl.dtsi, there are child nodes of pinctrl that defines pinmux and pincfg, however, there are no rules about that in dt-bindings. 'make dtbs_check' results an error with the following message: pinctrl: 'ain1', 'ain2', 'ainiec1', 'aout', 'aout1', 'aout2', ... ... 'usb2', 'usb3' do not match any of the regexes: 'pinctrl-[0-9]+' To avoid the issue, add the rules of pinmux and pincfg in each child node and grandchild node. Signed-off-by: Kunihiko Hayashi Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/1636416699-21033-1-git-send-email-hayashi.kunihiko@socionext.com Signed-off-by: Linus Walleij commit f35172c030dba5a1ff9dfe47cbeb123be45d75c7 Author: Loic Poulain Date: Tue Nov 16 16:35:15 2021 +0100 dt-bindings: qcom,pmic-gpio: Add pm2250 compatible string Add compatible strings for pm2250 SPMI GPIO to documentation. Signed-off-by: Loic Poulain Link: https://lore.kernel.org/r/1637076915-3280-2-git-send-email-loic.poulain@linaro.org Signed-off-by: Linus Walleij commit ef874e03a67dd3d07c0a135e32eaf84ab0445273 Author: Loic Poulain Date: Tue Nov 16 16:35:14 2021 +0100 pinctrl: spmi-gpio: Add support for PM2250 PM2250, commonly combined with QCM2290, provides ten SPMI GPIOs. Signed-off-by: Loic Poulain Link: https://lore.kernel.org/r/1637076915-3280-1-git-send-email-loic.poulain@linaro.org Signed-off-by: Linus Walleij commit 5277525edfd80ab65503bc13f9655509cfc463af Author: Rajendra Nayak Date: Tue Nov 16 11:08:04 2021 +0530 pinctrl: qcom: sc7280: Add egpio support sc7280 supports the egpio feature, GPIOs ranging from 144 to 174 (31 GPIOs) support it, we define gpio_func to 9, which is an unused function for all these pins on sc7280. Signed-off-by: Rajendra Nayak Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/1637041084-3299-2-git-send-email-rnayak@codeaurora.org Signed-off-by: Linus Walleij commit bebc49c1e5f64641831758d72a26a8dd2c61d38a Author: Prasad Sodagudi Date: Tue Nov 16 11:08:03 2021 +0530 pinctrl: qcom: Add egpio feature support egpio is a scheme which allows special power Island Domain IOs (LPASS,SSC) to be reused as regular chip GPIOs by muxing regular TLMM functions with Island Domain functions. With this scheme, an IO can be controlled both by the cpu running linux and the Island processor. This provides great flexibility to re-purpose the Island IOs for regular TLMM usecases. 2 new bits are added to ctl_reg, egpio_present is a read only bit which shows if egpio feature is available or not on a given gpio. egpio_enable is the read/write bit and only effective if egpio_present is 1. Once its set, the Island IO is controlled from Chip TLMM. egpio_enable when set to 0 means the GPIO is used as Island Domain IO. To support this we add a new function 'egpio' which can be used to set the egpio_enable to 0, for any other TLMM controlled functions we set the egpio_enable to 1. Signed-off-by: Prasad Sodagudi Signed-off-by: Rajendra Nayak Link: https://lore.kernel.org/r/1637041084-3299-1-git-send-email-rnayak@codeaurora.org Signed-off-by: Linus Walleij commit f347438356e1c69799b21bed7dc8654f58124592 Author: Konrad Dybcio Date: Fri Nov 12 12:53:41 2021 +0100 pinctrl: qcom-pmic-gpio: Add support for pm8019 PM8019 provides 6 GPIOs. Add a compatible to support that. Signed-off-by: Konrad Dybcio Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211112115342.17100-2-konrad.dybcio@somainline.org Signed-off-by: Linus Walleij commit e3da3323dabf27c4aa9a51c7832e7f976fe072f4 Author: Konrad Dybcio Date: Fri Nov 12 12:53:40 2021 +0100 dt-bindings: pinctrl: qcom,pmic-gpio: Add compatible for PM8019 Add pmic-gpio compatible string for pm8019 pmic. Signed-off-by: Konrad Dybcio Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211112115342.17100-1-konrad.dybcio@somainline.org Signed-off-by: Linus Walleij commit bdbf104f8ee6e9b32e9819a8d3b4d8a3f8f4f1f2 Author: Vamsi Krishna Lanka Date: Mon Nov 15 23:39:46 2021 -0800 pinctrl: qcom: Add SDX65 pincontrol driver Add initial Qualcomm SDX65 pinctrl driver to support pin configuration with pinctrl framework for SDX65 SoC. Signed-off-by: Vamsi Krishna Lanka Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/13acb3cb36349487dee9745ab040d8f1344d2096.1637048107.git.quic_vamslank@quicinc.com Signed-off-by: Linus Walleij commit 3fe59cc4ff641b106cc24930204d4cd2c82f318f Author: Vamsi Krishna Lanka Date: Mon Nov 15 23:39:45 2021 -0800 dt-bindings: pinctrl: qcom: Add SDX65 pinctrl bindings Add device tree binding Documentation details for Qualcomm SDX65 pinctrl driver. Signed-off-by: Vamsi Krishna Lanka Reviewed-by: Bjorn Andersson Link: https://lore.kernel.org/r/06234768890dc7572226f23d432e5a69a4d5b305.1637048107.git.quic_vamslank@quicinc.com Signed-off-by: Linus Walleij commit 531d6ab36571c2ffe698702e1f5748a7cfaa2c5d Author: Kavyasree Kotagiri Date: Thu Nov 18 16:55:48 2021 +0530 pinctrl: ocelot: Extend support for lan966x This patch extends pinctrl-ocelot driver to support also the lan966x. Register layout is same as ocelot. It has 78 GPIOs. Requires 3 registers ALT0, ALT1, ALT2 to configure ALT mode. Signed-off-by: Kavyasree Kotagiri Reviewed-by: Alexandre Belloni Link: https://lore.kernel.org/r/20211118112548.14582-3-kavyasree.kotagiri@microchip.com Signed-off-by: Linus Walleij commit 463201a784c45cd5413ecd0dfbe80224489b7ea5 Author: Kavyasree Kotagiri Date: Thu Nov 18 16:55:47 2021 +0530 dt-bindings: pinctrl: ocelot: add lan966x SoC support Add documentation for the compatible designated for lan966x. Signed-off-by: Kavyasree Kotagiri Acked-by: Rob Herring Link: https://lore.kernel.org/r/20211118112548.14582-2-kavyasree.kotagiri@microchip.com Signed-off-by: Linus Walleij commit 8169b9894dbd2d4e440cfbc5fe9f733e5876a564 Author: Florian Klink Date: Wed Oct 20 11:59:22 2021 +0200 arm64: dts: rockchip: Enable HDD power on helios64 This adds the hdd_{a,b}_power blocks present in the armbian helios64 dts. [1] Without those powered up, no HDDs will appear (except one connected via the m.2 slot). >From https://wiki.kobol.io/helios64/sata/#hdd-power: > The power delivery of the HDDs is divided into two group: > > HDD Rail A (Max. 3x Drives) > HDD Rail B (Max. 2x Drives) > > Helios64 implements a power staggering approach where HDD Rail A will be > powered up first, then few seconds later HDD Rail B will be powered up. > This power control scenario is performed to reduce the inrush current > during disk spin-up. In practice, this power staggering approach will be included in the bootloader (not in the kernel), as we might want to boot from a SATA drive. >From my experiments, if the bootloader doesn't implement the power staggering, only one HDD will get recognized (probably cause the others didn't boot due to few power). Still, it makes sense to expose this block in the device-tree, so the kernel can ensure both rails are on (and this can be shared with u-boot). [1] https://github.com/armbian/build/blob/744ea89a589d62cb6f409baab60fc6664520bc39/patch/kernel/archive/rockchip64-5.14/add-board-helios64.patch Signed-off-by: Florian Klink Tested-by: Dennis Gilmore Link: https://lore.kernel.org/r/20211020095926.735938-1-flokli@flokli.de Signed-off-by: Heiko Stuebner commit 755fff528b1b760c700dbf39928ff3dda825f748 Author: Dennis Gilmore Date: Thu Oct 28 19:53:19 2021 -0500 arm64: dts: rockchip: add variables for pcie completion to helios64 without ep-gpios defined u-boot does not initialise PCIe rockchip_pcie pcie@f8000000: failed to find ep-gpios property additionally set max-link-speed and pinctrl-names for completeness with this patch and the ones from Florian Klink applied to the dts file in u-boot sata drives show up in both u-boot and linux Signed-off-by: Dennis Gilmore Acked-By: Florian Klink Link: https://lore.kernel.org/r/20211029005323.144652-1-dgilmore@redhat.com Signed-off-by: Heiko Stuebner commit e92df2c61c1046d26379b97141e1e968f3ccc63d Author: Dennis Gilmore Date: Tue Oct 26 10:07:47 2021 -0500 arm64: dts: rockchip: define usb hub and 2.5GbE nic on helios64 Add the 4 ports on the internal hub and define and turn on the 2.5GbE nic. Signed-off-by: Dennis Gilmore Tested-by: Florian Klink Link: https://lore.kernel.org/r/20211026150751.70115-1-dgilmore@redhat.com Signed-off-by: Heiko Stuebner commit c681c6fcc5ddfa0492ca015b0bf325cd4881ce07 Author: Alex Bee Date: Wed Oct 27 16:37:26 2021 +0200 arm64: dts: rockchip: add interrupt and headphone-detection for Rock Pi4's audio codec As schematics at [1] and [2] show C- and plus-revisions have interrupt and headphone detection lines of ES8316 codec connected. Add them to the respective device trees. [1] https://dl.radxa.com/rockpi4/docs/hw/rockpi4/rockpi_4c_v12_sch_20200620.pdf [2] https://dl.radxa.com/rockpi4/docs/hw/rockpi4/rockpi4b_plus_v16_sch_20200628.pdf Signed-off-by: Alex Bee Link: https://lore.kernel.org/r/20211027143726.165809-2-knaerzche@gmail.com Signed-off-by: Heiko Stuebner commit 3ac5f9db26bb7a227ccbf160c36a5567b5394299 Author: Sam Protsenko Date: Sun Nov 21 17:05:58 2021 +0200 ARM: samsung: Remove HAVE_S3C2410_I2C and use direct dependencies A separate Kconfig option HAVE_S3C2410_I2C for Samsung SoCs is not really needed and the i2c-s3c24xx driver can depend on Samsung ARM architectures instead. This also enables i2c-s3c2410 for arm64 Exynos SoCs, which is required for example by Exynos850. This is basically continuation of work made in following commits: - commit d96890fca9fd ("rtc: s3c: remove HAVE_S3C_RTC in favor of direct dependencies") - commit 7dd3cae90d85 ("ARM: samsung: remove HAVE_S3C2410_WATCHDOG and use direct dependencies") Signed-off-by: Sam Protsenko Link: https://lore.kernel.org/r/20211121150558.21801-2-semen.protsenko@linaro.org Signed-off-by: Krzysztof Kozlowski commit 20287d56f52dab0790acb05f44cd2011bac0a431 Author: Ard Biesheuvel Date: Fri Nov 19 13:47:44 2021 +0200 efi/libstub: consolidate initrd handling across architectures Before adding TPM measurement of the initrd contents, refactor the initrd handling slightly to be more self-contained and consistent. Signed-off-by: Ard Biesheuvel Signed-off-by: Ilias Apalodimas Link: https://lore.kernel.org/r/20211119114745.1560453-4-ilias.apalodimas@linaro.org Signed-off-by: Ard Biesheuvel commit 44f155b4b07b8293472c9797d5b39839b91041ca Author: Ard Biesheuvel Date: Fri Nov 19 13:47:43 2021 +0200 efi/libstub: x86/mixed: increase supported argument count Increase the number of arguments supported by mixed mode calls, so that we will be able to call into the TCG2 protocol to measure the initrd and extend the associated PCR. This involves the TCG2 protocol's hash_log_extend_event() method, which takes five arguments, three of which are u64 and need to be split, producing a total of 8 outgoing Signed-off-by: Ard Biesheuvel Signed-off-by: Ilias Apalodimas Link: https://lore.kernel.org/r/20211119114745.1560453-3-ilias.apalodimas@linaro.org Signed-off-by: Ard Biesheuvel commit 4da87c51705815fe1fbd41cc61640bb80da5bc54 Author: Ard Biesheuvel Date: Fri Nov 19 13:47:42 2021 +0200 efi/libstub: add prototype of efi_tcg2_protocol::hash_log_extend_event() Define the right prototype for efi_tcg2_protocol::hash_log_extend_event() and add the required structs so we can start using it to measure the initrd into the TPM if it was loaded by the EFI stub itself. Signed-off-by: Ard Biesheuvel Signed-off-by: Ilias Apalodimas Link: https://lore.kernel.org/r/20211119114745.1560453-2-ilias.apalodimas@linaro.org Signed-off-by: Ard Biesheuvel commit f65b8132092699e4f672111836f3f51c00c354f2 Author: Elyes HAOUAS Date: Thu Oct 28 23:05:17 2021 +0200 include/linux/efi.h: Remove unneeded whitespaces before tabs Signed-off-by: Elyes HAOUAS Signed-off-by: Ard Biesheuvel commit baaf965f94308301d2dc554d72a87d7432cd5ce6 Author: George G. Davis Date: Fri Jul 16 16:49:35 2021 -0400 mtd: hyperbus: rpc-if: fix bug in rpcif_hb_remove The following KASAN BUG is observed when testing the rpc-if driver on rcar-gen3: root@rcar-gen3:~# modprobe -r rpc-if [ 101.930146] ================================================================== [ 101.937408] BUG: KASAN: slab-out-of-bounds in __lock_acquire+0x518/0x25d0 [ 101.944240] Read of size 8 at addr ffff0004c5be2750 by task modprobe/664 [ 101.950959] [ 101.952466] CPU: 2 PID: 664 Comm: modprobe Not tainted 5.14.0-rc1-00342-g1a1464d7aa31 #1 [ 101.960578] Hardware name: Renesas H3ULCB board based on r8a77951 (DT) [ 101.967120] Call trace: [ 101.969580] dump_backtrace+0x0/0x2c0 [ 101.973275] show_stack+0x1c/0x30 [ 101.976616] dump_stack_lvl+0x9c/0xd8 [ 101.980301] print_address_description.constprop.0+0x74/0x2b8 [ 101.986071] kasan_report+0x1f4/0x26c [ 101.989757] __asan_load8+0x98/0xd4 [ 101.993266] __lock_acquire+0x518/0x25d0 [ 101.997215] lock_acquire.part.0+0x18c/0x360 [ 102.001506] lock_acquire+0x74/0x90 [ 102.005013] _raw_spin_lock_irq+0x98/0x130 [ 102.009131] __pm_runtime_disable+0x30/0x210 [ 102.013427] rpcif_hb_remove+0x5c/0x70 [rpc_if] [ 102.018001] platform_remove+0x40/0x80 [ 102.021771] __device_release_driver+0x234/0x350 [ 102.026412] driver_detach+0x158/0x20c [ 102.030179] bus_remove_driver+0xa0/0x140 [ 102.034212] driver_unregister+0x48/0x80 [ 102.038153] platform_driver_unregister+0x18/0x24 [ 102.042879] rpcif_platform_driver_exit+0x1c/0x34 [rpc_if] [ 102.048400] __arm64_sys_delete_module+0x210/0x310 [ 102.053212] invoke_syscall+0x60/0x190 [ 102.056986] el0_svc_common+0x12c/0x144 [ 102.060844] do_el0_svc+0x88/0xac [ 102.064181] el0_svc+0x24/0x3c [ 102.067257] el0t_64_sync_handler+0x1a8/0x1b0 [ 102.071634] el0t_64_sync+0x198/0x19c [ 102.075315] [ 102.076815] Allocated by task 628: [ 102.080781] [ 102.082280] Last potentially related work creation: [ 102.087524] [ 102.089022] The buggy address belongs to the object at ffff0004c5be2000 [ 102.089022] which belongs to the cache kmalloc-2k of size 2048 [ 102.101555] The buggy address is located 1872 bytes inside of [ 102.101555] 2048-byte region [ffff0004c5be2000, ffff0004c5be2800) [ 102.113486] The buggy address belongs to the page: [ 102.118409] [ 102.119908] Memory state around the buggy address: [ 102.124711] ffff0004c5be2600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 102.131947] ffff0004c5be2680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 102.139181] >ffff0004c5be2700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 102.146412] ^ [ 102.152257] ffff0004c5be2780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 102.159491] ffff0004c5be2800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc [ 102.166723] ================================================================== The above bug is caused by use of the wrong pointer in the rpcif_disable_rpm() call. Fix the bug by using the correct pointer. Fixes: 5de15b610f78 ("mtd: hyperbus: add Renesas RPC-IF driver") Signed-off-by: George G. Davis Signed-off-by: Vignesh Raghavendra Link: https://lore.kernel.org/r/20210716204935.25859-1-george_davis@mentor.com commit 745fa3e40ff5245c8551f2ec9ad9d3c77c8065e7 Author: Meng Li Date: Wed Nov 3 11:38:38 2021 +0800 arm64: dts: fsl-ls1043a-rdb: add delay between CS and CLK signal for flash device Based on commit d59c90a2400f("spi: spi-fsl-dspi: Convert TCFQ users to XSPI FIFO mode ") and 6c1c26ecd9a3("spi: spi-fsl-dspi: Accelerate transfers using larger word size if possible"), on ls1043a-rdb platform, the spi work mode is changed from TCFQ mode to XSPI mode. In order to keep the transmission sequence matches with flash device, it is need to add delay between CS and CLK signal. The strategy of generating delay value refers to QorIQ LS1043A Reference Manual. Signed-off-by: Meng Li Signed-off-by: Shawn Guo commit b0100bce4ff82ec1ccd3c1f3d339fd2df6a81784 Author: Lukas Bulwahn Date: Thu Oct 28 16:19:33 2021 +0200 ARM: imx: rename DEBUG_IMX21_IMX27_UART to DEBUG_IMX27_UART Since commit 4b563a066611 ("ARM: imx: Remove imx21 support"), the config DEBUG_IMX21_IMX27_UART is really only debug support for IMX27. So, rename this option to DEBUG_IMX27_UART and adjust dependencies in Kconfig and rename the definitions to IMX27 as further clean-up. This issue was discovered with ./scripts/checkkconfigsymbols.py, which reported that DEBUG_IMX21_IMX27_UART depends on the non-existing config SOC_IMX21. Signed-off-by: Lukas Bulwahn Reviewed-by: Arnd Bergmann Signed-off-by: Shawn Guo commit efe33befc2ffc94248159978902a374c7b2882d0 Author: Lukas Bulwahn Date: Thu Oct 28 16:19:32 2021 +0200 ARM: imx: remove dead left-over from i.MX{27,31,35} removal The commits: commit 879c0e5e0ac7 ("ARM: imx: Remove i.MX27 board files") commit c93197b0041d ("ARM: imx: Remove i.MX31 board files") commit e1324ece2af4 ("ARM: imx: Remove i.MX35 board files") remove the config MACH_MX27_3DS, MACH_MX31_3DS and MACH_MX35_3DS. Commit a542fc18168c ("ARM: imx31: Remove remaining i.MX31 board code") further removes arch/arm/mach-imx/3ds_debugboard.{c,h}. So, only some dead left-over in Kconfig and Makefile remains. Remove this remaining left-over. This issue was identified with ./scripts/checkkconfigsymbols.py, which warns on references to the non-existing configs MACH_MX{27,31,35}_3DS in ./arch/arm/mach-imx/Kconfig. Signed-off-by: Lukas Bulwahn Reviewed-by: Arnd Bergmann Signed-off-by: Shawn Guo commit 52c612692848bbe6ae2feb31706911641b17afc9 Author: Russell King (Oracle) Date: Tue Oct 26 10:34:23 2021 +0100 ARM: dts: vf610-zii-dev-rev-b: specify phy-mode for external PHYs Specify the phy-mode for the external PHYs on the third switch on the ZII development rev B board so phylink and phylib knows what mode these interfaces are configured for. Signed-off-by: Russell King (Oracle) Reviewed-by: Andrew Lunn Signed-off-by: Shawn Guo commit f9d3b807daa69728e59a5171e8e7b40cfa848383 Author: Russell King (Oracle) Date: Wed Oct 20 16:50:13 2021 +0100 ARM: dts: vf610-zii-dev-rev-b: correct phy-mode for 6185 dsa link DT currently lists the port mode for the 88E6352 switch 1 to 88E6185 switch 2 as "rgmii-id" but referring to the schematics, it is in fact a serdes link. The 88E6352 is configured with P5_MODE=6, S_SEL=1 and S_MODE=1, which means port 5 is configured as 1000BASE-X. This is confirmed by the value in the 88E6352 port 5 status register, 0x4e09, where C_MODE=9 meaning 1000BASE-X. It is also confirmed by the 88E6185 port 9 status register, 0x5e8c, where C_MODE=4 meaning cross-chip SERDES mode is selected. Signed-off-by: Russell King (Oracle) Reviewed-by: Andrew Lunn Signed-off-by: Shawn Guo commit 38c0b9496127da7c8ea0e58fdd256a9e54b1ab8d Author: Geert Uytterhoeven Date: Mon Oct 18 15:59:02 2021 +0200 arm64: dts: imx: imx8mn-beacon: Drop undocumented clock-names reference The wlf,wm8962 Device Tree bindings do not specify a clock-names property. Drop it. Signed-off-by: Geert Uytterhoeven Signed-off-by: Shawn Guo commit f756f435f7dd823f2d4bd593ce1bf3168def1308 Author: Marek Vasut Date: Sat Oct 16 23:05:47 2021 +0200 soc: imx: gpcv2: Synchronously suspend MIX domains In case the following power domain sequence happens, iMX8M Mini always hangs: gpumix:on -> gpu:on -> gpu:off -> gpu:on This is likely due to another quirk of the GPC block. This situation can be prevented by always synchronously powering off both the domain and MIX domain. Make it so. This turns the aforementioned sequence into: gpumix:on -> gpu:on -> gpu:off -> gpumix:off -> gpumix:on -> gpu:on Signed-off-by: Marek Vasut Cc: Frieder Schrempf Cc: Lucas Stach Cc: NXP Linux Team Cc: Peng Fan Cc: Shawn Guo Acked-by: Lucas Stach Signed-off-by: Shawn Guo commit b70bf26a704c74b3b611e8ff639f1262de19aaef Author: Arnaud Ferraris Date: Sat Oct 16 12:20:23 2021 +0200 arm64: dts: freescale: add 'chassis-type' property A new 'chassis-type' root node property has recently been approved for the device-tree specification, in order to provide a simple way for userspace to detect the device form factor and adjust their behavior accordingly. This patch fills in this property for end-user devices (such as laptops, smartphones and tablets) based on NXP ARM64 processors. Signed-off-by: Arnaud Ferraris Reviewed-by: Guido Günther Signed-off-by: Shawn Guo commit e5d3e752b050e03d2046011a3865721a3f200216 Author: Alexey Min Date: Sun Nov 21 04:42:27 2021 +0700 arm64: dts: qcom: sdm660-xiaomi-lavender: Add USB Enable and configure DWC3 and QUSB2 PHY to enable USB functionality on the Redmi Note 7. Signed-off-by: Alexey Min Co-developed-by: Dang Huynh Signed-off-by: Dang Huynh Reviewed-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211120214227.779742-9-danct12@riseup.net commit e631e904e1d89650e3c8facdfb37cfca3491a52d Author: Dang Huynh Date: Sun Nov 21 04:42:26 2021 +0700 arm64: dts: qcom: sdm660-xiaomi-lavender: Enable Simple Framebuffer This lets the user sees the framebuffer console. Reviewed-by: Konrad Dybcio Signed-off-by: Dang Huynh Reviewed-by: Caleb Connolly Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211120214227.779742-8-danct12@riseup.net commit cf85e9aee210fefd7a85c1ced0a73382e5edcfd0 Author: Dang Huynh Date: Sun Nov 21 04:42:25 2021 +0700 arm64: dts: qcom: sdm660-xiaomi-lavender: Add eMMC and SD This commit enable the SD card slot and internal MMC. Signed-off-by: Dang Huynh Reviewed-by: Caleb Connolly Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211120214227.779742-7-danct12@riseup.net commit 4c420a0449ce0882f225e6e7ae3edc87becd2e85 Author: Dang Huynh Date: Sun Nov 21 04:42:23 2021 +0700 arm64: dts: qcom: sdm660-xiaomi-lavender: Add PWRKEY and RESIN This enables the volume down key as well as the power button. Reviewed-by: Konrad Dybcio Signed-off-by: Dang Huynh Reviewed-by: Caleb Connolly Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211120214227.779742-5-danct12@riseup.net commit 262a8ad19cdfd8e177d32bfbec1691a2069951b1 Author: Dang Huynh Date: Sun Nov 21 04:42:22 2021 +0700 arm64: dts: qcom: sdm660-xiaomi-lavender: Add RPM and fixed regulators Add most of the RPM PM660/PM660L regulators and the fixed ones, defining the common electrical part of this platform. Signed-off-by: Dang Huynh Reviewed-by: Caleb Connolly Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211120214227.779742-4-danct12@riseup.net commit 9f6cbe37a72fc9dafe8f560e557c93209cc100e7 Author: Dang Huynh Date: Sun Nov 21 04:42:21 2021 +0700 arm64: dts: qcom: sdm630-pm660: Move RESIN to pm660 dtsi It's not worth duplicating the same node over and over again, so let's keep the common bits in the pm660 DTSI, making only changing the status and keycode necessary. Also, disable RESIN/PWR by default just in case if there are devices that doesn't use them. Reviewed-by: Konrad Dybcio Signed-off-by: Dang Huynh Reviewed-by: Caleb Connolly Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211120214227.779742-3-danct12@riseup.net commit b139425115b801e56fe2d6dbcd2e798be87e2e06 Author: Dang Huynh Date: Sun Nov 21 04:42:20 2021 +0700 arm64: dts: qcom: sdm630: Assign numbers to eMMC and SD This makes eMMC/SD device number consistent. Reviewed-by: Martin Botka Signed-off-by: Dang Huynh Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211120214227.779742-2-danct12@riseup.net commit 66b788133030f0c69a0ecc7f72f7939b119c9a69 Author: Prasad Malisetty Date: Tue Nov 16 16:31:48 2021 +0530 arm64: dts: qcom: sc7280: Fix 'interrupt-map' parent address cells Update interrupt-map parent address cells for sc7280 Similar to existing Qcom SoCs. Fixes: 92e0ee9f8 ("arm64: dts: qcom: sc7280: Add PCIe and PHY related nodes") Signed-off-by: Prasad Malisetty Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1637060508-30375-4-git-send-email-pmaliset@codeaurora.org commit bd7d507935ca73fba6b6f0f52a3d08d77b143c58 Author: Prasad Malisetty Date: Tue Nov 16 16:31:47 2021 +0530 arm64: dts: qcom: sc7280: Add pcie clock support Add pcie clock phandle for sc7280 SoC. Signed-off-by: Prasad Malisetty Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1637060508-30375-3-git-send-email-pmaliset@codeaurora.org commit fa09b2248714c64644576d8064e9bd292a504a0e Author: Prasad Malisetty Date: Tue Nov 16 16:31:46 2021 +0530 arm64: dts: qcom: sc7280: Fix incorrect clock name Replace pcie_1_pipe-clk clock name with pcie_1_pipe_clk To match with dt binding. Fixes: ab7772de8612 ("arm64: dts: qcom: SC7280: Add rpmhcc clock controller node") Signed-off-by: Prasad Malisetty Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1637060508-30375-2-git-send-email-pmaliset@codeaurora.org commit 96e1e3a15273a99d89b1389e4487e734c7d37d8e Author: yangcong Date: Mon Nov 15 11:01:55 2021 +0800 arm64: dts: qcom: sc7180: Fix ps8640 power sequence for Homestar rev4 When powering up the ps8640, we need to deassert PD right after we turn on the vdd33 regulator. Unfortunately, the vdd33 regulator takes some time (~4ms) to turn on. Add in the delay for the vdd33 regulator so that when the driver deasserts PD that the regulator has had time to ramp. Signed-off-by: yangcong Reviewed-by: Stephen Boyd Reviewed-by: Douglas Anderson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211115030155.9395-1-yangcong5@huaqin.corp-partner.google.com commit 9ac8999e8d6c05826664a61bc89509824f45621d Author: Konrad Dybcio Date: Sun Nov 14 02:27:55 2021 +0100 arm64: dts: qcom: sm8350: Add LLCC node Configure the Last-Level Cache Controller for SM8350. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211114012755.112226-16-konrad.dybcio@somainline.org commit ce2762aec7378892d398b784a4bfd4856dd71043 Author: Konrad Dybcio Date: Sun Nov 14 02:27:54 2021 +0100 arm64: dts: qcom: sm8350-sagami: Configure remote processors Configure ADSP, CDSP, MPSS, SLPI and IPA on SoMC Sagami. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211114012755.112226-15-konrad.dybcio@somainline.org commit 1209e9246632d93f557c651110533bf44f8335f3 Author: Konrad Dybcio Date: Sun Nov 14 02:27:53 2021 +0100 arm64: dts: qcom: sm8350-sagami: Enable and populate I2C/SPI nodes Based on current driver availability, add either nodes or comments regarding peripherals connected via I2C/SPI. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211114012755.112226-14-konrad.dybcio@somainline.org commit c2721b0c23d975c73bce68d40435d66fbab19047 Author: Konrad Dybcio Date: Sun Nov 14 02:27:52 2021 +0100 arm64: dts: qcom: Add support for Xperia 1 III / 5 III Add support for SONY Xperia 1 III (PDX215) and 5 III (PDX214) smartphones. Both are based on the SM8350 Sagami platform and feature some really high-end specs, such as: - 4K (1 III / PRO-I) / 1080p (5 III), 120Hz HDR OLED 10-bit panels - USB-C 3.1 with HDMI in (yes, phone as display!) and DP out - 5G - 8 or 12 gigs of ram, 128/256/512 gigs of storage - A 3.5mm headphone jack, a RGB notification LED and a uSD card slot :) - IP65/68 dust/water resistance - Dual front-firing speakers and a lot of microphones - Crazy complex camera hardware (especially on the PRO-I), which includes 4 cameras, an RGBIR sensor and a 3D iToF The aforementioned PRO-I (PDX217) is not supported in this patch, because even though it shares most of the code with 1 III, nobody really has it (yet?) This only adds basic support for booting to a USB shell with a bootloader-enabled display, support for all the awesome hardware listed above will (hopefully) come (hopefully) soon. In order to get a working boot image, you need to run (e.g. for 1 III): cat arch/arm64/boot/Image.gz arch/arm64/boot/dts/qcom/sm8350-sony-xperia-\ sagami-pdx215.dtb > .Image.gz-dtb mkbootimg \ --kernel .Image.gz-dtb \ --ramdisk some_initrd.img \ --pagesize 4096 \ --base 0x0 \ --kernel_offset 0x8000 \ --ramdisk_offset 0x1000000 \ --tags_offset 0x100 \ --cmdline "SOME_CMDLINE" \ --dtb_offset 0x1f00000 \ --header_version 1 \ --os_version 11 \ --os_patch_level 2021-10 \ # or newer -o boot.img-sony-xperia-pdx215 Then, you need to flash it on the device and get rid of all the vendor_boot/dtbo mess: fastboot flash boot boot.img-sony-xperia-pdx215 fastboot erase vendor_boot fastboot flash dtbo emptydtbo.img fastboot reboot Where emptydtbo.img is a tiny file that consists of 2 bytes (all zeroes), doing a "fastboot erase" won't cut it, the bootloader will go crazy and things will fall apart when it tries to overlay random bytes from an empty partition onto a perfectly good appended DTB. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211114012755.112226-13-konrad.dybcio@somainline.org commit 9bc2c8fea55c12d3720a80a59f99fdf68b8de773 Author: Konrad Dybcio Date: Sun Nov 14 02:27:51 2021 +0100 arm64: dts: qcom: sm8350: Assign iommus property to QUP WRAPs Assign the iommus property to allow access to QUP hosts that were not set up by the bootloader. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211114012755.112226-12-konrad.dybcio@somainline.org commit 98374e6925b88cfc4e528faed230a835f91a576d Author: Konrad Dybcio Date: Sun Nov 14 02:27:50 2021 +0100 arm64: dts: qcom: sm8350: Set up WRAP2 QUPs Set up I2C&SPI hosts and UARTs connected to WRAP2 and their respective pins. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211114012755.112226-11-konrad.dybcio@somainline.org commit 8934535531c875e6ec67876905982a44e8306c1c Author: Konrad Dybcio Date: Sun Nov 14 02:27:49 2021 +0100 arm64: dts: qcom: sm8350: Set up WRAP1 QUPs Set up I2C&SPI hosts and UARTs connected to WRAP1 and their respective pins. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211114012755.112226-10-konrad.dybcio@somainline.org commit cf03cd7e12bdb43d624dbd55d8467b29e9b608c2 Author: Konrad Dybcio Date: Sun Nov 14 02:27:48 2021 +0100 arm64: dts: qcom: sm8350: Set up WRAP0 QUPs Set up I2C&SPI hosts and UARTs connected to WRAP0 and their respective pins. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211114012755.112226-9-konrad.dybcio@somainline.org commit 9ea9eb36b3c046fc48e737db4de69f7acd12f9be Author: Konrad Dybcio Date: Sun Nov 14 02:27:47 2021 +0100 arm64: dts: qcom: sm8350: Describe GCC dependency clocks Add all the clock names that the GCC driver expects to get via DT, so that the clock handles can be filled as the development progresses. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211114012755.112226-8-konrad.dybcio@somainline.org commit 2dab7aac493df72f57498044cb38ca0a6c18e7e1 Author: Konrad Dybcio Date: Sun Nov 14 02:27:46 2021 +0100 arm64: dts: qcom: *8350* Consolidate PON/RESIN usage Disable PON/RESIN keys by default and keep the RESIN keycode set-per-board, as these settings are not common between devices (one cannot even assume all devices have buttons nowadays..). Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211114012755.112226-7-konrad.dybcio@somainline.org commit f52dd33943ca5f84ae76890f352f6d9e12512c3f Author: Konrad Dybcio Date: Sun Nov 14 02:27:45 2021 +0100 arm64: dts: qcom: sm8350: Shorten camera-thermal-bottom name Thermal zone names should not be longer than 20 names, which is indicated by a message at boot. Change "camera-thermal-bottom" to "cam-thermal-bottom" to fix it. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211114012755.112226-6-konrad.dybcio@somainline.org commit 9e7f7b65c7f04c5cfda97d6bd0d452a49e60f24e Author: Konrad Dybcio Date: Sun Nov 14 02:27:44 2021 +0100 arm64: dts: qcom: sm[68]350: Use interrupts-extended with pdc interrupts Using interrupts = <&pdc X Y> makes the interrupt framework interpret this as the &pdc-nth range of the main interrupt controller (GIC). Fix it. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211114012755.112226-5-konrad.dybcio@somainline.org commit ed9500c1df59437856d43e657f185fb1eb5d817d Author: Konrad Dybcio Date: Sun Nov 14 02:27:43 2021 +0100 arm64: dts: qcom: sm8350: Specify clock-frequency for arch timer Arch timer runs at 19.2 MHz. Specify the rate in the timer node. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211114012755.112226-4-konrad.dybcio@somainline.org commit f4d4ca9f3934844b99af289cf38d4892c73f683e Author: Konrad Dybcio Date: Sun Nov 14 02:27:42 2021 +0100 arm64: dts: qcom: sm8350: Add redistributor stride to GICv3 The redistributor properties were missing. Add them. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211114012755.112226-3-konrad.dybcio@somainline.org commit e84d04a2b221153b88f644d98b5902c3705f5348 Author: Konrad Dybcio Date: Sun Nov 14 02:27:41 2021 +0100 arm64: dts: qcom: sm8350: Add missing QUPv3 ID2 Add the missing third QUPv3 master node. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211114012755.112226-2-konrad.dybcio@somainline.org commit f0360a7c1742681c390f2d94bb876ce80a8012b1 Author: Konrad Dybcio Date: Sun Nov 14 02:27:40 2021 +0100 arm64: dts: qcom: sm8350: Move gpio.h inclusion to SoC DTSI Almost any board that boots and has a way to interact with it (say for the rare cases of just-pstore or let's-rely-on-bootloader-setup) needs to set some GPIOs, so it makes no sense to include gpio.h separately each time. Hence move it to SoC DTSI. Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211114012755.112226-1-konrad.dybcio@somainline.org commit 5663ca59bb4f1dfd2501f2af0bfdca93c4d47b3a Author: Shawn Guo Date: Tue Sep 28 10:20:02 2021 +0800 arm64: dts: qcom: Add missing vdd-supply for QUSB2 PHY QUSB2 PHY requires vdd-supply for digital circuit operation. Add it for platforms that miss it. Signed-off-by: Shawn Guo Acked-by: Vinod Koul Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20210928022002.26286-4-shawn.guo@linaro.org commit de0a2ae359ef9ccbaab86cce44d442cd0ca36985 Author: Yassine Oudjana Date: Thu Nov 4 11:15:18 2021 +0000 arm64: dts: qcom: msm8996-xiaomi-common: Change TUSB320 to TUSB320L This platform actually doesn't have TUSB320, but rather TUSB320L. The TUSB320 compatible string was used due to lack of support for TUSB320L, and it was close enough to detect cable plug-in and direction, but it was limited to upstream facing port mode only. Now that support for TUSB320L is added[1], change node name and compatible to match and allow it to be properly reset and have its mode set to dual-role port. [1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=ce0320bd3872038569be360870e2d5251b975692 Signed-off-by: Yassine Oudjana Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211104111454.105875-1-y.oudjana@protonmail.com commit 25fdaae63a6927efad2f6c0428622712f0eb20dd Author: Yassine Oudjana Date: Thu Nov 4 10:49:58 2021 +0000 arm64: dts: qcom: msm8996-xiaomi-scorpio: Add touchkey controller Add a node and pin states for Cypress StreetFighter touchkey controller. Signed-off-by: Yassine Oudjana Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211104104932.104046-1-y.oudjana@protonmail.com commit 4c821bd42ccceca5e0fdc5491374e3d7e6941c2e Author: Dmitry Baryshkov Date: Thu Nov 4 03:29:49 2021 +0300 arm64: dts: qcom: msm8996-sony-xperia-tone: fix SPMI regulators declaration Device tree for the Sony Xperia tone family of devices specifies S9+S10+S11 SAW regulator as a part of the pmi8994_spmi_regulators device tree node. However PMI8994 does not have these regulators, they are part of the PM8994 device. All other MSM8996-based devices list them in the pm8994_spmi_regulators device tree node. Move them accordingly. Cc: AngeloGioacchino Del Regno Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211104002949.2204727-5-dmitry.baryshkov@linaro.org commit 227ee1583ba4b3bb973e2a3e32351c242fdfc49d Author: Dmitry Baryshkov Date: Thu Nov 4 03:29:48 2021 +0300 arm64: dts: qcom: msm8994-sony-xperia-kitakami: correct lvs1 and lvs2 supply property The qcom_rpm_smd_regulator driver uses vdd_lvs1_2-supply property to specify the supply regulator for LVS1 and LVS2 (following the pin name in the PMIC datasheet). Correct the board's device tree property, so that the regulator supply is setup properly. Cc: Konrad Dybcio Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211104002949.2204727-4-dmitry.baryshkov@linaro.org commit a49c3dd1f7827fa7ee3a861b4292dd7d1c346fb2 Author: Dmitry Baryshkov Date: Thu Nov 4 03:29:47 2021 +0300 arm64: dts: qcom: apq8096-db820c: correct lvs1 and lvs2 supply property The qcom_rpm_smd_regulator driver uses vdd_lvs1_2-supply property to specify the supply regulator for LVS1 and LVS2 (following the pin name in the PMIC datasheet). Correct the board's device tree property, so that the regulator supply is setup properly. Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211104002949.2204727-3-dmitry.baryshkov@linaro.org commit 7c57dcae949d1d39068f1e92233a9bc2dc7dcfba Author: Dmitry Baryshkov Date: Thu Nov 4 03:29:46 2021 +0300 arm64: dts: qcom: apq8096-db820c: add missing regulator details Specify that S11 (well, whole block of s8+s9+s10+s11) of pm8994 and S2 (s2 + s3) of pmi8994 are supplied by vph_pwr. While we are at it, add regulator name to S11, so that is displayed as VDD_APCC in the system. Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211104002949.2204727-2-dmitry.baryshkov@linaro.org commit e2bbebf3b04c62fc3f7e64525c43bf5118a3cc88 Author: Dmitry Baryshkov Date: Thu Nov 4 03:29:45 2021 +0300 arm64: dts: qcom: apq8096-db820c: specify adsp firmware name Specify firmware name to be used for the ADSP. Quoting Bjorn from the respective apq8016-sbc commit: The firmware for the modem and WiFi subsystems platform specific and is signed with a OEM specific key (or a test key). In order to support more than a single device it is therefor not possible to rely on the default path and stash these files directly in the firmware directory. Signed-off-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211104002949.2204727-1-dmitry.baryshkov@linaro.org commit 30a7f99befc655cb3eacdd3a0f2394a5209a492f Author: Konrad Dybcio Date: Thu Nov 11 19:46:28 2021 +0100 arm64: dts: qcom: Add support for SONY Xperia XZ2 / XZ2C / XZ3 (Tama platform) Add support for SONY Xperia XZ2, XZ2 Compact and XZ3 smartphones, all based on the Qualcomm SDM845 chipset. There also exists a fourth Tama device, the XZ2 Premium (Aurora) with a 4K display, but it's relatively rare. The devices are affected by a scary UFS behaviour where sending a certain UFS command (which is worked around on downstream) renders the device unbootable, by effectively erasing the bootloader. Therefore UFS AND UFSPHY are strictly disabled for now. Downstream workaround: https://github.com/kholk/kernel/commit/2e7a9ee1c91a016baa0b826a7752ec45663a0561 This platform's bootloader is not very nice either. To boot mainline you need to flash a bogus DTBO (fastboot erasing may cut it, but it takes an inhumane amount of time) - one that's just 4 bytes (all zeroes) seems to work just fine. Of course, one can also provide a "normal" DTBO (device-specific DT overlayed on top of the SoC DT), but that's not yet supported by the mainline kernel build system. Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Martin Botka Signed-off-by: Konrad Dybcio Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211111184630.605035-1-konrad.dybcio@somainline.org commit c41910f257a22dc406c60d8826b4a3b5398003a3 Author: David Heidelberg Date: Sat Oct 30 12:04:12 2021 +0200 arm64: dts: qcom: msm8996: drop not documented adreno properties These properties aren't documented nor implemented in the driver. Drop them. Fixes warnings as: $ make dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/display/msm/gpu.yaml ... arch/arm64/boot/dts/qcom/msm8996-mtp.dt.yaml: gpu@b00000: 'qcom,gpu-quirk-fault-detect-mask', 'qcom,gpu-quirk-two-pass-use-wfi' do not match any of the regexes: 'pinctrl-[0-9]+' From schema: Documentation/devicetree/bindings/display/msm/gpu.yaml ... Fixes: 69cc3114ab0f ("arm64: dts: Add Adreno GPU definitions") Signed-off-by: David Heidelberg Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211030100413.28370-1-david@ixit.cz commit 3922ccaed4ac9dab5087fc5f20d319cc55765afa Author: Philip Chen Date: Fri Oct 29 15:27:43 2021 -0700 arm64: dts: qcom: sc7180: Support Homestar rev4 Support Homestar rev4 board where Parade ps8640 is added as the second source edp bridge. Support different edp bridge chips in different board revisions, now we move the #incldue line of the edp bridge dts fragment (e.g. sc7180-trogdor-ti-sn65dsi86.dtsi) from "sc7180-trogdor-homestar.dtsi" to per-board-rev dts files. Since the edp bridge dts fragment overrides 'dsi0_out', which is defined in "sc7180.dtsi", move the #incldue line of "sc7180.dtsi" from "sc7180-trogdor-homestar.dtsi" to per-board-rev dts files too, before the #include line of the edp bridge dts fragment. Signed-off-by: Philip Chen Reviewed-by: Douglas Anderson Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211029152647.v3.4.If7aaa8e36f1269acae5488035bd62ce543756bf8@changeid commit 7624b41b3379e664f074137001fc2e44bc1f5eaf Author: Philip Chen Date: Fri Oct 29 15:27:42 2021 -0700 arm64: dts: qcom: sc7180: Support Lazor/Limozeen rev9 Support Lazor/Limozeen rev9 board where Parade ps8640 is added as the second source edp bridge. To support different edp bridge chips in different board revisions, now we move the #incldue line of the edp bridge dts fragment (e.g. sc7180-trogdor-ti-sn65dsi86.dtsi) from "sc7180-trogdor-lazor.dtsi" to per-board-rev dts files. Since the edp bridge dts fragment overrides 'dsi0_out', which is defined in "sc7180.dtsi", move the #incldue line of "sc7180.dtsi" from "sc7180-trogdor-lazor.dtsi" to per-board-rev dts files too, before the #include line of the edp bridge dts fragment. Signed-off-by: Philip Chen Reviewed-by: Stephen Boyd Reviewed-by: Douglas Anderson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211029152647.v3.3.Ie56f55924f5c7706fe3194e710bbef6fdb8b5bc6@changeid commit 0417a86b200b4da1dff73e9f4bd7743346e5565b Author: Philip Chen Date: Fri Oct 29 15:27:41 2021 -0700 arm64: dts: qcom: sc7180: Specify "data-lanes" for DSI host output MSM DSI host driver actually parses "data-lanes" in DT and compare it with the number of DSI lanes the bridge driver sets for mipi_dsi_device. So we need to always specify "data-lanes" for the DSI host output. As of now, "data-lanes" is added to ti-sn65dsi86 dts fragment, but missing in parade-ps8640 dts fragment, which requires a fixup. Since we'll do 4-lane DSI regardless of which bridge chip is used, instead of adding "data-lanes" to parade-ps8640 dts fragment, let's just move "data-lanes" from the bridge dts to sc7180-trogdor.dtsi. Signed-off-by: Philip Chen Reviewed-by: Stephen Boyd Reviewed-by: Douglas Anderson Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211029152647.v3.2.If23c83a786fc4d318a1986f43803f22b4b1d82cd@changeid commit 963070f762137cff817d33c102309ab0a345eb32 Author: Philip Chen Date: Fri Oct 29 15:27:40 2021 -0700 arm64: dts: qcom: sc7180: Include gpio.h in edp bridge dts The edp bridge dts fragment files use the macros defined in 'dt-bindings/gpio/gpio.h'. To help us more flexibly order the #include lines of dts files in a board-revision-specific dts file, let's include the gpio header in the bridge dts fragment files themselves. Signed-off-by: Philip Chen Reviewed-by: Stephen Boyd Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211029152647.v3.1.Ie17e51ad3eb91d72826ce651ca2786534a360210@changeid commit a9e6b3819b365fd1955fafad588a5c0ada569383 Author: Dinh Nguyen Date: Tue Oct 12 14:07:09 2021 -0500 dt-bindings: memory: Add entry for version 3.80a Add an entry for version 3.80a of the Synopsys DDR controller. Signed-off-by: Dinh Nguyen Signed-off-by: Borislav Petkov Acked-by: Rob Herring Link: https://lkml.kernel.org/r/20211012190709.1504152-4-dinguyen@kernel.org commit f6bc0d8bc2c5872e94e6d51472bd16fc4479622b Author: Dinh Nguyen Date: Tue Oct 12 14:07:08 2021 -0500 EDAC/synopsys: Enable the driver on Intel's N5X platform Intel's N5X platform is also using the Synopsys EDAC controller. Signed-off-by: Dinh Nguyen Signed-off-by: Borislav Petkov Acked-by: Michal Simek Link: https://lkml.kernel.org/r/20211012190709.1504152-3-dinguyen@kernel.org commit f7824ded41491d7ebc156a3a2f6fa05cd89da7c2 Author: Dinh Nguyen Date: Tue Oct 12 14:07:07 2021 -0500 EDAC/synopsys: Add support for version 3 of the Synopsys EDAC DDR Add support for version 3.80a of the Synopsys DDR controller. This version of the controller has the following differences: - UE/CE are auto cleared - Interrupts are supported by default Signed-off-by: Dinh Nguyen Signed-off-by: Borislav Petkov Reviewed-by: Michal Simek Link: https://lkml.kernel.org/r/20211012190709.1504152-2-dinguyen@kernel.org commit bd1d6da17c296bd005bfa656952710d256e77dd3 Author: Dinh Nguyen Date: Tue Oct 12 14:07:06 2021 -0500 EDAC/synopsys: Use the quirk for version instead of ddr version Version 2.40a supports DDR_ECC_INTR_SUPPORT for a quirk, so use that quirk to determine a call to setup_address_map(). Signed-off-by: Dinh Nguyen Signed-off-by: Borislav Petkov Reviewed-by: Michal Simek Link: https://lkml.kernel.org/r/20211012190709.1504152-1-dinguyen@kernel.org commit e5cc9840f08be46c701d88b81f06d37db516fe32 Author: Andy Shevchenko Date: Wed Oct 13 12:49:23 2021 +0300 iio: buffer: Use dedicated variable in iio_buffers_alloc_sysfs_and_mask() Use dedicated variable for index in the loop in the iio_buffers_alloc_sysfs_and_mask(). This will make code cleaner and less error prone as proved by previous changes done in this function. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211013094923.2473-3-andriy.shevchenko@linux.intel.com Signed-off-by: Jonathan Cameron commit 89f971182417cb27abd82cfc48a7f36b99352ddc Merge: 979594c5ff7b8 5fb62e9cd3ada Author: David S. Miller Date: Sat Nov 20 14:11:00 2021 +0000 Merge branch 'mptcp-more-socket-options' Mat Martineau says: ==================== mptcp: More socket option support These patches add MPTCP socket support for a few additional socket options: IP_TOS, IP_FREEBIND, IP_TRANSPARENT, IPV6_FREEBIND, and IPV6_TRANSPARENT. Patch 1 exposes __ip_sock_set_tos() for use in patch 2. Patch 2 adds IP_TOS support. Patches 3 and 4 add the freebind and transparent support, with a selftest for the latter. ==================== Signed-off-by: David S. Miller commit 5fb62e9cd3adadd95303447ee8e3f62ee98b0e73 Author: Florian Westphal Date: Fri Nov 19 12:41:37 2021 -0800 selftests: mptcp: add tproxy test case No hard dependencies here, just skip if test environ lacks nft binary or the needed kernel config options. The test case spawns listener in ns2 but ns1 will connect to the ip address of ns4. policy routing + tproxy rule will redirect packets to ns2 instead of forward. v3: - update mptcp/config (Mat Martineau) - more verbose SKIP messages in mptcp_connect.sh Signed-off-by: Florian Westphal Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit c9406a23c1161c3a9a672d055ec840b00d730a6f Author: Florian Westphal Date: Fri Nov 19 12:41:36 2021 -0800 mptcp: sockopt: add SOL_IP freebind & transparent options These options also need to be set before bind, so do the sync of msk to new ssk socket a bit earlier. Signed-off-by: Florian Westphal Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit ffcacff87cd65dc09b97982acf3a771713983a28 Author: Poorva Sonparote Date: Fri Nov 19 12:41:35 2021 -0800 mptcp: Support for IP_TOS for MPTCP setsockopt() SOL_IP provides a way to configure network layer attributes in a socket. This patch adds support for IP_TOS for setsockopt(.. ,SOL_IP, ..) Support for SOL_IP is added in mptcp_setsockopt() and IP_TOS is handled in a private function. The idea here is to take in the value passed for IP_TOS and set it to the current subflow, open subflows as well new subflows that might be created after the initial call to setsockopt(). This sync is done using sync_socket_options(.., ssk) and setting the value of tos using __ip_sock_set_tos(ssk,..). The patch has been tested using the packetdrill script here - https://github.com/multipath-tcp/mptcp_net-next/issues/220#issuecomment-947863717 Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/220 Signed-off-by: Poorva Sonparote Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit 4f47d5d507d6f211ebceac76a5f0b83c2eae154b Author: Poorva Sonparote Date: Fri Nov 19 12:41:34 2021 -0800 ipv4: Exposing __ip_sock_set_tos() in ip.h Making the static function __ip_sock_set_tos() from net/ipv4/ip_sockglue.c accessible by declaring it in include/net/ip.h The reason for doing this is to use this function to set IP_TOS value in mptcp_setsockopt() without the lock. Signed-off-by: Poorva Sonparote Signed-off-by: Mat Martineau Signed-off-by: David S. Miller commit ac48ea3b6737a3cf17bab141a1d64523911da482 Author: Will McVicker Date: Fri Oct 15 19:05:14 2021 +0000 clk: samsung: Update CPU clk registration Convert the remaining exynos clock drivers to use samsung_clk_register_cpu() or if possible use samsung_cmu_register_one(). With this we can now make exynos_register_cpu_clock() a static function so that future CPU clock registration changes will use the samsung common clock driver. The main benefit of this change is that it standardizes the CPU clock registration for the samsung clock drivers. Link: https://lore.kernel.org/r/20211015190515.3760577-1-willmcvicker@google.com Signed-off-by: Will McVicker Tested-by: Krzysztof Kozlowski Reviewed-by: Krzysztof Kozlowski [snawrocki@kernel.org: Fixed build break in clk-exynos4.c, clk-exynos5250.c] Reported-by: kernel test robot Signed-off-by: Sylwester Nawrocki commit 979594c5ff7b82e4787c8491680a2658bd88b780 Merge: 1388d4ad9d828 2c193f2cb1107 Author: David S. Miller Date: Sat Nov 20 12:26:09 2021 +0000 Merge branch 'dev_addr-const' Jakub Kicinski says: ==================== net: constify netdev->dev_addr Take care of a few stragglers and make netdev->dev_addr const. netdev->dev_addr can be held on the address tree like any other address now. ==================== Signed-off-by: David S. Miller commit 2c193f2cb11074bb7859605db3562ad653ab5ec7 Author: Jakub Kicinski Date: Fri Nov 19 06:21:55 2021 -0800 net: kunit: add a test for dev_addr_lists Add a KUnit test for the dev_addr API. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit a387ff8e5ddad4d9e4c8fed54bc99be09d501b78 Author: Jakub Kicinski Date: Fri Nov 19 06:21:54 2021 -0800 dev_addr_list: put the first addr on the tree Since all netdev->dev_addr modifications go via dev_addr_mod() we can put it on the list. When address is change remove it and add it back. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit d07b26f5bbea9ade34dfd6abea7b3ca056c03cd1 Author: Jakub Kicinski Date: Fri Nov 19 06:21:53 2021 -0800 dev_addr: add a modification check netdev->dev_addr should only be modified via helpers, but someone may be casting off the const. Add a runtime check to catch abuses. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 5f0b69238427f19a20063e90486754b1ea3ccd3b Author: Jakub Kicinski Date: Fri Nov 19 06:21:52 2021 -0800 net: unexport dev_addr_init() & dev_addr_flush() There are no module callers in-tree and it's hard to justify why anyone would init or flush addresses of a netdev (note the flush is more of a destructor, it frees netdev->dev_addr). Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit adeef3e32146a8d2a73c399dc6f5d76a449131b1 Author: Jakub Kicinski Date: Fri Nov 19 06:21:51 2021 -0800 net: constify netdev->dev_addr Commit 406f42fa0d3c ("net-next: When a bond have a massive amount of VLANs...") introduced a rbtree for faster Ethernet address look up. We converted all users to make modifications via appropriate helpers, make netdev->dev_addr const. The update helpers need to upcast from the buffer to struct netdev_hw_addr. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit c9646a18033ea2c3a6d27c951dedf4f60a290bf9 Author: Jakub Kicinski Date: Fri Nov 19 06:21:50 2021 -0800 bnx2x: constify static inline stub for dev_addr bnx2x_vfpf_config_mac() was constified by not its stub. Reported-by: kernel test robot Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 0f98d7e478430b64d9520a23585e02be5f8b1b2a Author: Jakub Kicinski Date: Fri Nov 19 06:21:49 2021 -0800 82596: use eth_hw_addr_set() Byte by byte assignments. Fixes build on m68k. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit de2f29c4394efa64c3a5ba1b15302eb558ed4c56 Author: Takashi Iwai Date: Fri Nov 19 17:27:30 2021 +0100 ALSA: hda: Remove redundant runtime PM calls The previous fix for more comprehensive runtime PM calls turned out to be not good as hoped; a few calls including pm_runtime_enable() and pm_runtime_disable() are rather utterly superfluous for PCI devices, even triggering a kernel error message. Better to drop those calls. Note that the problem we wanted to solve with that commit seems irrelevant with the fix itself; the original bug (a GPF at azx_remove()) was likely a regression by the recent PCI core cleanup, and the buggy PCI change has been already reverted. So basically we were scratching a wrong surface. OTOH, making the runtime PM calls symmetric for both probe and remove is more consistent, and maybe that's a sensible outcome. Fixes: 4f66a9ef37d3 ("ALSA: hda: intel: More comprehensive PM runtime setup for controller driver") Reported-by: Heiner Kallweit Link: https://lore.kernel.org/r/d9d76980-966a-e031-70d1-3254ba5be5eb@gmail.com Link: https://lore.kernel.org/r/20211119162730.24423-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 1388d4ad9d828f7d5ad8327d12fa2afb9abdf08a Author: Hari Nagalla Date: Thu Nov 18 04:25:32 2021 -0600 net: phy: add support for TI DP83561-SP phy Add support for the TI DP83561-SP Gigabit ethernet phy device. The dp83561-sp is a radiation hardened space grade gigabit ethernet PHY. It has been tested for single event latch upto 121 MeV, the critical reliability parameter for space designs. It interfaces directly to twisted pair media through an external transformer. And the device also interfaces directly to the MAC layer through Reduced GMII (RGMII) and MII. DP83867, DP83869 and DP83561-SP, all these parts support 1000Base-T/ 100Base-TX/ and 10Base-Te standards and have similar register map for the core functionality. The data sheet for this part is at https://www.ti.com/product/DP83561-SP Signed-off-by: Hari Nagalla Signed-off-by: Geet Modi Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/20211118102532.9835-1-hnagalla@ti.com Signed-off-by: Jakub Kicinski commit d9f31aeaa1e5aefa68130878af3c3513d41c1e2d Author: Yang Li Date: Thu Nov 18 17:48:03 2021 +0800 ethernet: renesas: Use div64_ul instead of do_div do_div() does a 64-by-32 division. Here the divisor is an unsigned long which on some platforms is 64 bit wide. So use div64_ul instead of do_div to avoid a possible truncation. Eliminate the following coccicheck warning: ./drivers/net/ethernet/renesas/ravb_main.c:2492:1-7: WARNING: do_div() does a 64-by-32 division, please consider using div64_ul instead. Reported-by: Abaci Robot Signed-off-by: Yang Li Reviewed-by: Geert Uytterhoeven Reviewed-by: Sergey Shtylyov Link: https://lore.kernel.org/r/1637228883-100100-1-git-send-email-yang.lee@linux.alibaba.com Signed-off-by: Jakub Kicinski commit 8d22679dc89a6d9e1d41b2514902e3f7ef51547a Author: Eric Dumazet Date: Thu Nov 18 18:23:55 2021 -0800 ipv6: ip6_skb_dst_mtu() cleanups Use const attribute where we can, and cache skb_dst() Signed-off-by: Eric Dumazet Link: https://lore.kernel.org/r/20211119022355.2985984-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit 370a40ee228340b5141e5d89dee3186452d9f5fb Author: Jason Wang Date: Sat Nov 13 14:30:23 2021 +0800 crypto: ccp - no need to initialise statics to 0 Static variables do not need to be initialized to 0. Signed-off-by: Jason Wang Signed-off-by: Herbert Xu commit 882ed23e103f2cc8222eb3d280ddf1af167fa9ea Author: Christophe JAILLET Date: Fri Nov 12 17:49:23 2021 +0100 crypto: ccree - remove redundant 'flush_workqueue()' calls 'destroy_workqueue()' already drains the queue before destroying it, so there is no need to flush it explicitly. Remove the redundant 'flush_workqueue()' calls. This was generated with coccinelle: @@ expression E; @@ - flush_workqueue(E); destroy_workqueue(E); Signed-off-by: Christophe JAILLET Reviewed-by: Cristian Marussi Acked-by: Gilad Ben-Yossef Signed-off-by: Herbert Xu commit 3121d5d1181885d9e01436fbdac78646617fb42f Author: chiminghao Date: Tue Nov 9 08:35:03 2021 +0000 crypto: octeontx2 - use swap() to make code cleaner Fix the following coccicheck REVIEW: ./drivers/crypto/marvell/octeontx2/otx2_cptvf_algs.c:1688:16-17 use swap() to make code cleaner Reported-by: Zeal Robot Signed-off-by: chiminghao Signed-off-by: Herbert Xu commit a9887010ed2da3fddaff83ceec80e2b71be8a966 Author: Lei He Date: Fri Nov 5 20:25:31 2021 +0800 crypto: testmgr - Fix wrong test case of RSA According to the BER encoding rules, integer value should be encoded as two's complement, and if the highest bit of a positive integer is 1, should add a leading zero-octet. The kernel's built-in RSA algorithm cannot recognize negative numbers when parsing keys, so it can pass this test case. Export the key to file and run the following command to verify the fix result: openssl asn1parse -inform DER -in /path/to/key/file Signed-off-by: Lei He Signed-off-by: Herbert Xu commit e9c195aaeed1b45c9012adbe29dedb6031e85aa8 Author: Chengfeng Ye Date: Thu Nov 4 06:46:42 2021 -0700 crypto: qce - fix uaf on qce_skcipher_register_one Pointer alg points to sub field of tmpl, it is dereferenced after tmpl is freed. Fix this by accessing alg before free tmpl. Fixes: ec8f5d8f ("crypto: qce - Qualcomm crypto engine driver") Signed-off-by: Chengfeng Ye Acked-by: Thara Gopinath Signed-off-by: Herbert Xu commit b4cb4d31631912842eb7dce02b4350cbb7562d5e Author: Chengfeng Ye Date: Thu Nov 4 06:38:31 2021 -0700 crypto: qce - fix uaf on qce_ahash_register_one Pointer base points to sub field of tmpl, it is dereferenced after tmpl is freed. Fix this by accessing base before free tmpl. Fixes: ec8f5d8f ("crypto: qce - Qualcomm crypto engine driver") Signed-off-by: Chengfeng Ye Acked-by: Thara Gopinath Signed-off-by: Herbert Xu commit 4a9dbd021970ffe1b92521328377b699acba7c52 Author: Chengfeng Ye Date: Thu Nov 4 06:28:07 2021 -0700 crypto: qce - fix uaf on qce_aead_register_one Pointer alg points to sub field of tmpl, it is dereferenced after tmpl is freed. Fix this by accessing alg before free tmpl. Fixes: 9363efb4 ("crypto: qce - Add support for AEAD algorithms") Signed-off-by: Chengfeng Ye Acked-by: Thara Gopinath Signed-off-by: Herbert Xu commit 574c833ef3a60dc5dff6c9e885a30ba13e88971e Author: Yang Guang Date: Thu Nov 4 14:19:10 2021 +0800 crypto: hisilicon/hpre - use swap() to make code cleaner Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid opencoding it. Reported-by: Zeal Robot Signed-off-by: Yang Guang Signed-off-by: Herbert Xu commit 7875506f7a755cdafe231ca310c8fbca793d262f Author: Lukas Bulwahn Date: Wed Nov 3 10:47:11 2021 +0100 MAINTAINERS: rectify entry for INTEL KEEM BAY OCS ECC CRYPTO DRIVER Commit c9f608c38009 ("crypto: keembay-ocs-ecc - Add Keem Bay OCS ECC Driver") only adds drivers/crypto/keembay/keembay-ocs-ecc.c, but adds a file entry drivers/crypto/keembay/ocs-ecc-curve-defs.h in MAINTAINERS. Hence, ./scripts/get_maintainer.pl --self-test=patterns warns: warning: no file matches F: drivers/crypto/keembay/ocs-ecc-curve-defs.h Assuming that this header is obsolete and will not be included in the repository, remove the unneeded file entry from MAINTAINERS. Signed-off-by: Lukas Bulwahn Reviewed-by: Daniele Alessandrelli Signed-off-by: Herbert Xu commit 94ad2d19a97efdb603a21fcad0625f466f1cdd0f Author: Wei Yongjun Date: Mon Nov 1 14:02:33 2021 +0000 crypto: keembay-ocs-ecc - Fix error return code in kmb_ocs_ecc_probe() Fix to return negative error code -ENOMEM from the error handling case instead of 0, as done elsewhere in this function. Fixes: c9f608c38009 ("crypto: keembay-ocs-ecc - Add Keem Bay OCS ECC Driver") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun Reviewed-by: Daniele Alessandrelli Signed-off-by: Herbert Xu commit efd21e10fc3bf4c6da122470a5ae89ec4ed8d180 Author: Meng Li Date: Mon Nov 1 11:13:53 2021 +0800 crypto: caam - replace this_cpu_ptr with raw_cpu_ptr When enable the kernel debug config, there is below calltrace detected: BUG: using smp_processor_id() in preemptible [00000000] code: cryptomgr_test/339 caller is debug_smp_processor_id+0x20/0x30 CPU: 9 PID: 339 Comm: cryptomgr_test Not tainted 5.10.63-yocto-standard #1 Hardware name: NXP Layerscape LX2160ARDB (DT) Call trace: dump_backtrace+0x0/0x1a0 show_stack+0x24/0x30 dump_stack+0xf0/0x13c check_preemption_disabled+0x100/0x110 debug_smp_processor_id+0x20/0x30 dpaa2_caam_enqueue+0x10c/0x25c ...... cryptomgr_test+0x38/0x60 kthread+0x158/0x164 ret_from_fork+0x10/0x38 According to the comment in commit ac5d15b4519f("crypto: caam/qi2 - use affine DPIOs "), because preemption is no longer disabled while trying to enqueue an FQID, it might be possible to run the enqueue on a different CPU(due to migration, when in process context), however this wouldn't be a functionality issue. But there will be above calltrace when enable kernel debug config. So, replace this_cpu_ptr with raw_cpu_ptr to avoid above call trace. Fixes: ac5d15b4519f ("crypto: caam/qi2 - use affine DPIOs") Cc: stable@vger.kernel.org Signed-off-by: Meng Li Reviewed-by: Horia Geantă Signed-off-by: Herbert Xu commit 680efb33546be8960ccbb2f4e0e43034d9c93b30 Author: Sunil Goutham Date: Fri Oct 29 22:49:59 2021 +0530 hwrng: cavium - Check health status while reading random data This RNG device is present on Marvell OcteonTx2 silicons as well and also provides entropy health status. HW continuously checks health condition of entropy and reports faults. Fault is in terms of co-processor cycles since last fault detected. This doesn't get cleared and only updated when new fault is detected. Also there are chances of detecting false positives. So to detect a entropy failure SW has to check if failures are persistent ie cycles elapsed is frequently updated by HW. This patch adds support to detect health failures using below algo. 1. Consider any fault detected before 10ms as a false positive and ignore. 10ms is chosen randomly, no significance. 2. Upon first failure detection make a note of cycles elapsed and when this error happened in realtime (cntvct). 3. Upon subsequent failure, check if this is new or a old one by comparing current cycles with the ones since last failure. cycles or time since last failure is calculated using cycles and time info captured at (2). HEALTH_CHECK status register is not available to VF, hence had to map PF registers. Also since cycles are in terms of co-processor cycles, had to retrieve co-processor clock rate from RST device. Signed-off-by: Sunil Goutham Signed-off-by: Herbert Xu commit 6d48de655917a9d782953eba65de4e3db593ddf0 Author: Tudor Ambarus Date: Wed Oct 27 16:30:01 2021 +0300 crypto: atmel-aes - Reestablish the correct tfm context at dequeue In case there were more requests from different tfms in the crypto queue, only the context of the last initialized tfm was considered. Fixes: ec2088b66f7a ("crypto: atmel-aes - Allocate aes dev at tfm init time") Reported-by: Wolfgang Ocker Signed-off-by: Tudor Ambarus Signed-off-by: Herbert Xu commit cc4dac3f5e3eff8d042b4d8712bed6f7ea75454c Merge: fa55b7dcdc43c f7c151d86487e Author: Linus Walleij Date: Sat Nov 20 03:44:07 2021 +0100 Merge tag 'intel-pinctrl-v5.17-2' of gitolite.kernel.org:pub/scm/linux/kernel/git/pinctrl/intel into devel intel-pinctrl for v5.17-2 * Introduce new generic kasprintf_strarray() API * Clean up and convert existing drivers to use the above The API will be needed in the future for new comers, including Intel ones. The following is an automated git shortlog grouped by driver: armada-37xx: - Switch to use devm_kasprintf_strarray() - Convert to use dev_err_probe() - Make use of the devm_platform_ioremap_resource() - Use temporary variable for struct device - Fix function name in the kernel doc gpio: - mockup: Switch to use kasprintf_strarray() lib/string_helpers: - Introduce managed variant of kasprintf_strarray() - Introduce kasprintf_strarray() pinctrl/rockchip: - Switch to use devm_kasprintf_strarray() - Convert to use dev_err_probe() - Make use of the devm_platform_get_and_ioremap_resource() - Use temporary variable for struct device - Drop wrong kernel doc annotation st: - Switch to use devm_kasprintf_strarray() - Convert to use dev_err_probe() - Make use of the devm_platform_ioremap_resource_byname() - Use temporary variable for struct device - Drop wrong kernel doc annotations zynqmp: - Unify pin naming commit fa285baf844303d119d657d4f97e0777acd51b8e Author: Saheed O. Bolarinwa Date: Fri Nov 19 20:37:32 2021 +0100 PCI/ASPM: Remove struct aspm_latency The struct aspm_latency is now used only inside pcie_aspm_check_latency(). Replace struct aspm_latency variables with u32 variables and remove struct aspm_latency. Link: https://lore.kernel.org/r/20211119193732.12343-5-refactormyself@gmail.com Signed-off-by: Saheed O. Bolarinwa Signed-off-by: Bjorn Helgaas Reviewed-by: Christoph Hellwig commit 6e332df7c380a7bc936275cba1ed356d9eb36b39 Author: Saheed O. Bolarinwa Date: Fri Nov 19 20:37:31 2021 +0100 PCI/ASPM: Stop caching device L0s, L1 acceptable exit latencies Previously we calculated the device's acceptable L0s and L1 exit latencies in pcie_aspm_cap_init() and cached them in struct pcie_link_state. These values are only used in pcie_aspm_check_latency() where they are compared with the actual exit latencies of the link. This path is used when removing or changing the D state of the device, so it's relatively low frequency. To reduce the amount of per-link data we store, remove the acceptable[] arrays from struct pcie_link_state and calculate them directly from the already-cached Device Capabilities register when needed. [bhelgaas: use endpoint->devcap instead of reading it again] Link: https://lore.kernel.org/r/20211119193732.12343-4-refactormyself@gmail.com Signed-off-by: Saheed O. Bolarinwa Signed-off-by: Bjorn Helgaas commit 222578dad4731cb8932471f42a0a606116ec5398 Author: Saheed O. Bolarinwa Date: Fri Nov 19 20:37:30 2021 +0100 PCI/ASPM: Stop caching link L0s, L1 exit latencies Previously we calculated the upstream and downstream L0s and L1 exit latencies of the link in pcie_aspm_cap_init() and cached them in struct pcie_link_state.latency_*. These values are only used in pcie_aspm_check_latency() where they are compared with the acceptable latencies on the link. This path is used when removing or changing the D state of the device, so it's relatively low frequency. To reduce the amount of per-link data we store, remove the latency_* entries from struct pcie_link_state and calculate the latencies directly where they are needed. Link: https://lore.kernel.org/r/20211119193732.12343-3-refactormyself@gmail.com Signed-off-by: Saheed O. Bolarinwa Signed-off-by: Bjorn Helgaas commit 8cccee9e91e19207671b94af40bacf7c1d2e74ef Author: Florent Revest Date: Fri Nov 19 19:00:35 2021 +0100 libbpf: Change bpf_program__set_extra_flags to bpf_program__set_flags bpf_program__set_extra_flags has just been introduced so we can still change it without breaking users. This new interface is a bit more flexible (for example if someone wants to clear a flag). Signed-off-by: Florent Revest Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211119180035.1396139-1-revest@chromium.org commit 43262f001b318a0c0531e252b47bc6b07794f356 Author: Bolarinwa O. Saheed Date: Fri Nov 19 20:37:29 2021 +0100 PCI/ASPM: Move pci_function_0() upward Move pci_function_0() earlier so we can use it from other functions. Link: https://lore.kernel.org/r/20211119193732.12343-2-refactormyself@gmail.com Signed-off-by: Bolarinwa O. Saheed Signed-off-by: Bjorn Helgaas Reviewed-by: Christoph Hellwig commit f53d4c109a666bf1a4883b45d546fba079258717 Author: Christian Eggers Date: Tue Nov 2 21:20:22 2021 +0100 mtd: rawnand: gpmi: Add ERR007117 protection for nfc_apply_timings gpmi_io clock needs to be gated off when changing the parent/dividers of enfc_clk_root (i.MX6Q/i.MX6UL) respectively qspi2_clk_root (i.MX6SX). Otherwise this rate change can lead to an unresponsive GPMI core which results in DMA timeouts and failed driver probe: [ 4.072318] gpmi-nand 112000.gpmi-nand: DMA timeout, last DMA ... [ 4.370355] gpmi-nand 112000.gpmi-nand: Chip: 0, Error -110 ... [ 4.375988] gpmi-nand 112000.gpmi-nand: Chip: 0, Error -22 [ 4.381524] gpmi-nand 112000.gpmi-nand: Error in ECC-based read: -22 [ 4.387988] gpmi-nand 112000.gpmi-nand: Chip: 0, Error -22 [ 4.393535] gpmi-nand 112000.gpmi-nand: Chip: 0, Error -22 ... Other than stated in i.MX 6 erratum ERR007117, it should be sufficient to gate only gpmi_io because all other bch/nand clocks are derived from different clock roots. The i.MX6 reference manuals state that changing clock muxers can cause glitches but are silent about changing dividers. But tests showed that these glitches can definitely happen on i.MX6ULL. For i.MX7D/8MM in turn, the manual guarantees that no glitches can happen when changing dividers. Co-developed-by: Stefan Riedmueller Signed-off-by: Stefan Riedmueller Signed-off-by: Christian Eggers Cc: stable@vger.kernel.org Acked-by: Han Xu Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20211102202022.15551-2-ceggers@arri.de commit aa1baa0e6c1aa4872e481dce4fc7fd6f3dd8496b Author: Stefan Riedmueller Date: Tue Nov 2 21:20:21 2021 +0100 mtd: rawnand: gpmi: Remove explicit default gpmi clock setting for i.MX6 There is no need to explicitly set the default gpmi clock rate during boot for the i.MX 6 since this is done during nand_detect anyway. Signed-off-by: Stefan Riedmueller Cc: stable@vger.kernel.org Acked-by: Han Xu Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20211102202022.15551-1-ceggers@arri.de commit 0171480007d64f663aae9226303f1b1e4621229e Author: Paul Cercueil Date: Sat Oct 16 14:22:28 2021 +0100 mtd: rawnand: ingenic: JZ4740 needs 'oob_first' read page function The ECC engine on the JZ4740 SoC requires the ECC data to be read before the page; using the default page reading function does not work. Indeed, the old JZ4740 NAND driver (removed in 5.4) did use the 'OOB first' flag that existed back then. Use the newly created nand_read_page_hwecc_oob_first() to address this issue. This issue was not found when the new ingenic-nand driver was developed, most likely because the Device Tree used had the nand-ecc-mode set to "hw_oob_first", which seems to not be supported anymore. Cc: # v5.2 Fixes: a0ac778eb82c ("mtd: rawnand: ingenic: Add support for the JZ4740") Signed-off-by: Paul Cercueil Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20211016132228.40254-5-paul@crapouillou.net commit d8466f73010faf71effb21228ae1cbf577dab130 Author: Paul Cercueil Date: Sat Oct 16 14:22:27 2021 +0100 mtd: rawnand: Export nand_read_page_hwecc_oob_first() Move the function nand_read_page_hwecc_oob_first() (previously nand_davinci_read_page_hwecc_oob_first()) to nand_base.c, and export it as a GPL symbol, so that it can be used by more modules. Cc: # v5.2 Fixes: a0ac778eb82c ("mtd: rawnand: ingenic: Add support for the JZ4740") Signed-off-by: Paul Cercueil Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20211016132228.40254-4-paul@crapouillou.net commit 0697f8441faad552fbeb02d74454b5e7bcc956a2 Author: Paul Cercueil Date: Sat Oct 16 14:22:26 2021 +0100 mtd: rawnand: davinci: Rewrite function description The original comment that describes the function nand_davinci_read_page_hwecc_oob_first() is very obscure and it is hard to understand what it is for. Cc: # v5.2 Fixes: a0ac778eb82c ("mtd: rawnand: ingenic: Add support for the JZ4740") Signed-off-by: Paul Cercueil Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20211016132228.40254-3-paul@crapouillou.net commit 9c9d709965385de5a99f84b14bd5860e1541729e Author: Paul Cercueil Date: Sat Oct 16 14:22:25 2021 +0100 mtd: rawnand: davinci: Avoid duplicated page read The function nand_davinci_read_page_hwecc_oob_first() first reads the OOB data, extracts the ECC information, programs the ECC hardware before reading the actual data in a loop. Right after the OOB data was read, it called nand_read_page_op() to reset the read cursor to the beginning of the page. This caused the first page to be read twice: in that call, and later in the loop. Address that issue by changing the call to nand_read_page_op() to nand_change_read_column_op(), which will only reset the read cursor. Cc: # v5.2 Fixes: a0ac778eb82c ("mtd: rawnand: ingenic: Add support for the JZ4740") Signed-off-by: Paul Cercueil Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20211016132228.40254-2-paul@crapouillou.net commit 71e89591502d737c10db2bd4d8fcfaa352552afb Author: Paul Cercueil Date: Sat Oct 16 14:22:24 2021 +0100 mtd: rawnand: davinci: Don't calculate ECC when reading page The function nand_davinci_read_page_hwecc_oob_first() does read the ECC data from the OOB area. Therefore it does not need to calculate the ECC as it is already available. Cc: # v5.2 Fixes: a0ac778eb82c ("mtd: rawnand: ingenic: Add support for the JZ4740") Signed-off-by: Paul Cercueil Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20211016132228.40254-1-paul@crapouillou.net commit 23584c1ed3e15a6f4bfab8dc5a88d94ab929ee12 Author: Lukas Wunner Date: Wed Nov 17 23:22:09 2021 +0100 PCI: pciehp: Fix infinite loop in IRQ handler upon power fault The Power Fault Detected bit in the Slot Status register differs from all other hotplug events in that it is sticky: It can only be cleared after turning off slot power. Per PCIe r5.0, sec. 6.7.1.8: If a power controller detects a main power fault on the hot-plug slot, it must automatically set its internal main power fault latch [...]. The main power fault latch is cleared when software turns off power to the hot-plug slot. The stickiness used to cause interrupt storms and infinite loops which were fixed in 2009 by commits 5651c48cfafe ("PCI pciehp: fix power fault interrupt storm problem") and 99f0169c17f3 ("PCI: pciehp: enable software notification on empty slots"). Unfortunately in 2020 the infinite loop issue was inadvertently reintroduced by commit 8edf5332c393 ("PCI: pciehp: Fix MSI interrupt race"): The hardirq handler pciehp_isr() clears the PFD bit until pciehp's power_fault_detected flag is set. That happens in the IRQ thread pciehp_ist(), which never learns of the event because the hardirq handler is stuck in an infinite loop. Fix by setting the power_fault_detected flag already in the hardirq handler. Link: https://bugzilla.kernel.org/show_bug.cgi?id=214989 Link: https://lore.kernel.org/linux-pci/DM8PR11MB5702255A6A92F735D90A4446868B9@DM8PR11MB5702.namprd11.prod.outlook.com Fixes: 8edf5332c393 ("PCI: pciehp: Fix MSI interrupt race") Link: https://lore.kernel.org/r/66eaeef31d4997ceea357ad93259f290ededecfd.1637187226.git.lukas@wunner.de Reported-by: Joseph Bao Tested-by: Joseph Bao Signed-off-by: Lukas Wunner Signed-off-by: Bjorn Helgaas Cc: stable@vger.kernel.org # v4.19+ Cc: Stuart Hayes commit 2fcde648f128f07504186016f3434b13e5a845d1 Author: Sylwester Nawrocki Date: Fri Oct 15 17:14:25 2021 +0200 clk: samsung: Remove meaningless __init and extern from header files Remove useless __init atrribute and unneeded extern qualifier in function declarations in header files. Signed-off-by: Sylwester Nawrocki Reviewed-by: Krzysztof Kozlowski Reviewed-by: Stephen Boyd Link: https://lore.kernel.org/r/20211015151425.29743-1-s.nawrocki@samsung.com commit 015e70585b317bfd90fced9bfd578fe57f9aa2cf Author: Marek Szyprowski Date: Mon Oct 18 14:54:56 2021 +0200 clk: samsung: remove __clk_lookup() usage __clk_lookup() interface is obsolete, so remove it from the Samsung clock drivers. This has been achieved by getting rid of custom _get_rate() helper and replacing it with clk_hw_get_rate(). Signed-off-by: Marek Szyprowski Acked-by: Krzysztof Kozlowski Acked-by: Chanwoo Choi Link: https://lore.kernel.org/r/20211018125456.8292-2-m.szyprowski@samsung.com Signed-off-by: Sylwester Nawrocki commit d68f50e6ad0ee7080b0244a15f2dd3d46040632a Author: Marek Szyprowski Date: Mon Oct 18 14:54:55 2021 +0200 dt-bindings: clock: samsung: add IDs for some core clocks Add IDs for some core clocks referenced during the boot process. Signed-off-by: Marek Szyprowski Link: https://lore.kernel.org/r/20211018125456.8292-1-m.szyprowski@samsung.com Signed-off-by: Sylwester Nawrocki commit b76521f6482d2a2a691e4eb1a496d55d73aea064 Author: Kelvin Cao Date: Thu Nov 18 16:38:03 2021 -0800 PCI/switchtec: Declare local state_names[] as static The local state_names[] array is constant and need not be allocated and populated each time we enter stuser_set_state(). Declare it as static. See the link below for the discussion. https://lore.kernel.org/r/20211014141859.11444-1-kelvin.cao@microchip.com/ [bhelgaas: simplify commit log] Suggested-by: Krzysztof Wilczyński Link: https://lore.kernel.org/r/20211119003803.2333-3-kelvin.cao@microchip.com Signed-off-by: Kelvin Cao Signed-off-by: Bjorn Helgaas Reviewed-by: Logan Gunthorpe commit bb17b15813eacc85ae8cb0c3901408ba051ebf91 Author: Kelvin Cao Date: Thu Nov 18 16:38:02 2021 -0800 PCI/switchtec: Add Gen4 automotive device IDs Advertise support of the Gen4 automotive variants in module's device ID table and add the same IDs to the list of switchtec quirks. Link: https://lore.kernel.org/r/20211119003803.2333-2-kelvin.cao@microchip.com Signed-off-by: Kelvin Cao Signed-off-by: Bjorn Helgaas Reviewed-by: Logan Gunthorpe commit 9c3631d17054a8766dbdc1abf8d29306260e7c7f Author: Xinhao Liu Date: Fri Nov 19 22:02:08 2021 +0800 RDMA/hns: Remove magic number Don't use unintelligible constants. Link: https://lore.kernel.org/r/20211119140208.40416-10-liangwenpeng@huawei.com Signed-off-by: Xinhao Liu Signed-off-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe commit 31835593763c99779016f0a8ba7cdf79cd6f05f1 Author: Yixing Liu Date: Fri Nov 19 22:02:07 2021 +0800 RDMA/hns: Remove macros that are no longer used These macros are no longer used, so remove them. Link: https://lore.kernel.org/r/20211119140208.40416-9-liangwenpeng@huawei.com Signed-off-by: Yixing Liu Signed-off-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe commit 6cb6a6cbcd7ff45042e6f35a5ee85ba5f83d120b Author: Xinhao Liu Date: Fri Nov 19 22:02:05 2021 +0800 RDMA/hns: Correctly initialize the members of Array[][] Each member of Array[][] should be initialized on a separate line. Link: https://lore.kernel.org/r/20211119140208.40416-7-liangwenpeng@huawei.com Signed-off-by: Xinhao Liu Signed-off-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe commit d147583ec8d009e456d794a7e33fe95e920a6535 Author: Xinhao Liu Date: Fri Nov 19 22:02:03 2021 +0800 RDMA/hns: Correct the type of variables participating in the shift operation The type of the variable participating in the shift operation should be an unsigned type instead of a signed type. Link: https://lore.kernel.org/r/20211119140208.40416-5-liangwenpeng@huawei.com Signed-off-by: Xinhao Liu Signed-off-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe commit 3aecfc3802d835fc47a317f9d8b01a5c918d8336 Author: Xinhao Liu Date: Fri Nov 19 22:02:02 2021 +0800 RDMA/hns: Replace tab with space in the right-side comments There should be a space between the code and the comment on the right. Link: https://lore.kernel.org/r/20211119140208.40416-4-liangwenpeng@huawei.com Signed-off-by: Xinhao Liu Signed-off-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe commit ea393549a3e10dd1ab84a8ad948772d12e667eca Author: Xinhao Liu Date: Fri Nov 19 22:02:01 2021 +0800 RDMA/hns: Correct the print format to be consistent with the variable type The print format should be consistent with the variable type. Link: https://lore.kernel.org/r/20211119140208.40416-3-liangwenpeng@huawei.com Signed-off-by: Xinhao Liu Signed-off-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe commit 994baacc6b4a59abc1769ad944e222da49d09486 Author: Xinhao Liu Date: Fri Nov 19 22:02:00 2021 +0800 RDMA/hns: Correct the hex print format The hex printf format should be "0xff" instead of "ff". Link: https://lore.kernel.org/r/20211119140208.40416-2-liangwenpeng@huawei.com Signed-off-by: Xinhao Liu Signed-off-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe commit 88f9335fa70f3389c62b78ae966b45cca3edc564 Author: Bob Pearson Date: Wed Nov 3 00:02:36 2021 -0500 RDMA/rxe: Remove some #defines from rxe_pool.h RXE_POOL_ALIGN is only used in rxe_pool.c so move RXE_POOL_ALIGN to rxe_pool.c from rxe_pool.h. RXE_POOL_CACHE_FLAGS is never used so it is deleted from rxe_pool.h Link: https://lore.kernel.org/r/20211103050241.61293-8-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe commit 38ee25a31126cb3a68b7775ba089428d5500eb9e Author: Bob Pearson Date: Wed Nov 3 00:02:35 2021 -0500 RDMA/rxe: Remove #include "rxe_loc.h" from rxe_pool.c rxe_loc.h is already included in rxe.h so do not include it in rxe_pool.c Link: https://lore.kernel.org/r/20211103050241.61293-7-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe commit 267c336349db0e624d217f9762bcc1da414f4b0a Author: Maarten Lankhorst Date: Wed Nov 17 14:20:24 2021 +0000 drm/i915: Drain the ttm delayed workqueue too Lets be thorough here. Users of the TTM backend would likely expect this behaviour. Signed-off-by: Maarten Lankhorst Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20211117142024.1043017-6-matthew.auld@intel.com commit 95c3d2758002d588d321ad231c04c6f7adbc4838 Author: Maarten Lankhorst Date: Wed Nov 17 14:20:23 2021 +0000 drm/i915: Remove resv from i915_vma It's just an alias to vma->obj->base.resv, no need to duplicate it. Signed-off-by: Maarten Lankhorst Reviewed-by: Niranjana Vishwanathapura Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20211117142024.1043017-5-matthew.auld@intel.com commit e6e1a304d759580d2dc0736d439b56e9866cf598 Author: Maarten Lankhorst Date: Wed Nov 17 14:20:22 2021 +0000 drm/i915: vma is always backed by an object. vma->obj and vma->resv are now never NULL, and some checks can be removed. Signed-off-by: Maarten Lankhorst Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20211117142024.1043017-4-matthew.auld@intel.com commit d03a29e0b1e10820631a9ba600ff669161001a84 Author: Maarten Lankhorst Date: Wed Nov 17 14:20:21 2021 +0000 drm/i915: Create a full object for mock_ring, v2. This allows us to finally get rid of all the assumptions that vma->obj is NULL. Changes since v1: - Ensure the mock_ring vma is pinned to prevent a fault. - Pin it high to avoid failure in evict_for_vma selftest. Signed-off-by: Maarten Lankhorst Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20211117142024.1043017-3-matthew.auld@intel.com commit b0b0f2d225da6fe58417fae37e3f797e2db27b62 Author: Maarten Lankhorst Date: Wed Nov 17 14:20:20 2021 +0000 drm/i915: Create a dummy object for gen6 ppgtt We currently have to special case vma->obj being NULL because of gen6 ppgtt and mock_engine. Fix gen6 ppgtt, so we may soon be able to remove a few checks. As the object only exists as a fake object pointing to ggtt, we have no backing storage, so no real object is created. It just has to look real enough. Also kill pin_mutex, it's not compatible with ww locking, and we can use the vm lock instead. v2: - Drop IS_SHRINKABLE and shorten overly long line v3: - Checkpatch fix for alignment Signed-off-by: Maarten Lankhorst Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20211117142024.1043017-2-matthew.auld@intel.com commit 10ceccb8d7b6d9770948da605b8da4cb5d3598d3 Author: Matthew Auld Date: Wed Nov 17 14:20:19 2021 +0000 drm/i915: move the pre_pin earlier In intel_context_do_pin_ww, when calling into the pre_pin hook(which is passed the ww context) it could in theory return -EDEADLK(which is very likely with debug kernels), once we start adding more ww locking in there, like in the next patch. If so then we need to be mindful of having to restart the do_pin at this point. If this is the kernel_context, or some other early in-kernel context where we have yet to setup the default_state, then we always inhibit the context restore, and instead rely on the delayed active_release to set the CONTEXT_VALID_BIT for us(if we even care), which should indicate that we have context switched away, and that our newly saved context state should now be valid. However, since we currently grab the active reference before the potential ww dance, we can end up setting the CONTEXT_VALID_BIT much too early, if we need to backoff, and then upon re-trying the do_pin, we could potentially cause the hardware to incorrectly load some garbage context state when later context switching to that context, but at the very least this will trigger the GEM_BUG_ON() in __engine_unpark. For now let's just move any ww dance stuff prior to arming the active reference. For normal user contexts this shouldn't be a concern, since we should already have the default_state ready when initialising the lrc state, and so there should be no concern with active_release somehow prematurely setting the CONTEXT_VALID_BIT. v2(Thomas): - Also re-order the onion unwind Signed-off-by: Matthew Auld Cc: Thomas Hellström Cc: Maarten Lankhorst Reviewed-by: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20211117142024.1043017-1-matthew.auld@intel.com commit b92d766c87022fc82cd6da774010b71ee92fc3d3 Author: Bob Pearson Date: Wed Nov 3 00:02:33 2021 -0500 RDMA/rxe: Save object pointer in pool element In rxe_pool.c currently there are many cases where it is necessary to compute the offset from a pool element struct to the object containing it in a type independent way where the offset is different for each type. By saving a pointer to the object when they are created extra work can be saved. Link: https://lore.kernel.org/r/20211103050241.61293-5-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe commit c95acedbff6757499fcd4a55b6776c1685d12801 Author: Bob Pearson Date: Wed Nov 3 00:02:32 2021 -0500 RDMA/rxe: Copy setup parameters into rxe_pool In rxe_pool.c copy remaining pool setup parameters from rxe_pool_info into rxe_pool. This saves looking up rxe_pool_info in the performance path. Link: https://lore.kernel.org/r/20211103050241.61293-4-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe commit 02827b6708516231cd5cc2b4b59b79690bf2a40c Author: Bob Pearson Date: Wed Nov 3 00:02:31 2021 -0500 RDMA/rxe: Cleanup rxe_pool_entry Currently three different names are used to describe rxe pool elements. They are referred to as entries, elems or pelems. This patch chooses one 'elem' and changes the other ones. Link: https://lore.kernel.org/r/20211103050241.61293-3-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe commit 21adfa7a3c4e7758a43dbfa33782dbef42c76ec5 Author: Bob Pearson Date: Wed Nov 3 00:02:30 2021 -0500 RDMA/rxe: Replace irqsave locks with bh locks Most of the locks in the rxe driver are _irqsave/restore locks but in fact there are no interrupt threads that run rxe code or share data with rxe. There are softirq threads and data sharing so the appropriate lock type is _bh. This patch replaces all irqsave type locks with bh type locks. Link: https://lore.kernel.org/r/20211103050241.61293-2-rpearsonhpe@gmail.com Signed-off-by: Bob Pearson Signed-off-by: Jason Gunthorpe commit e594cda5f8c8e34ac6444166418690c65bbda47f Author: Sudip Mukherjee Date: Sat Apr 17 00:53:36 2021 +0100 media: sp887x: drop unneeded assignment The pointer 'mem' was initialized to 'fw->data' but immediately after that it was assigned 'fw->data + 10'. Lets remove the extra assignement and initialize the pointer to the address its going to use. Link: https://lore.kernel.org/linux-media/20210416235336.1552102-1-sudipm.mukherjee@gmail.com Cc: Sudip Mukherjee Signed-off-by: Sudip Mukherjee Signed-off-by: Mauro Carvalho Chehab commit 51c2664ab051908dfb467b922e017a792c489cec Author: Lukas Middendorf Date: Sun Apr 18 01:12:04 2021 +0100 media: media si2168: fully initialize si2168 on resume only when necessary At connection time (or boot) in si2168_probe(), the firmware is not loaded to the device and the device is not fully activated. It is not useful or sensible to do this full initialization on resume in case it has not been previously initialized and is expected to be in this initialized state. Calling si2168_init() and therefore reading the firmware file for the first time during resume leads to problems and should be avoided. It is however safe to read the firmware file once it has already been read outside of a suspend/resume situation. Add a staus flag 'initialized' to store whether si2168_init() has successfully been called. If initialization fails (e.g. due to missing firmware file), the flag is not set. Register a separate si2168_resume callback which only calls si2168_init() once the 'initialized' flag has been set and it is safe to load the firmware at resume. The first call to si2168_init() will now always happen when the device is actually used for the first time and never during resume. This avoids the unsafe firmware file reading and should also speed up resume by skipping unnecessary device initialization. Link: https://lore.kernel.org/linux-media/20210418001204.7453-3-kernel@tuxforce.de [mchehab: fix several Coding Style issues] Cc: Antti Palosaari Signed-off-by: Lukas Middendorf Signed-off-by: Mauro Carvalho Chehab commit 40ae6eff068e32d727ad518a02574598c458a0c7 Author: Lukas Middendorf Date: Sun Apr 18 17:15:44 2021 +0100 media: si2168: drop support for old firmware file name for si2168 B40 The si2168 B40 firmware file name has been changed in or before 2014. During initialization, the new file name is preferred, but the old file name is used as a fallback when request_firmware with the new file name fails. Once reading the old file name has been attempted, only this name will be used on further firmware loading attempts. During resume, firmware reading with the new file name can (and likely will) fail even when it actually exists. So this permanent switch to the fallback firmware name happens even when not desired. Any system using a recent kernel version can be expected to have the firmware under the new name. The major distributions are either using the dvb firmware collection from LibreELEC, which has the new firmware file name, or do not package the firmware file but have documentation pointing towards a manual installation of the firmware file under the new name. If the firmware is available under the old name, it is severely outdated. If the switch to the old file name is performed, further firmware loading will either permanently fail (if it is not available) or an outdated firmware version will be used. Drop support for the fallback firmware file name and fail directly if the firmware is not available under its current name. On following attempts, the firmware read will then be retried with the correct current name instead of the old name. As reasoned above, there should be no negative effects of this change, while simplifying code (the B40 variant will be handled identical compared to the other variants of the si2168) and at the same time fixing possible problems if firmware loading fails on resume. Link: https://lore.kernel.org/linux-media/20210418161544.58858-1-kernel@tuxforce.de Signed-off-by: Lukas Middendorf Signed-off-by: Mauro Carvalho Chehab commit c50fdd1546ea1f3e085a955ab553008e8eb4d6a3 Author: Mauro Carvalho Chehab Date: Sun Sep 26 21:51:28 2021 +0100 media: dib0700: Only touch one bit when start/stop an adapter Only touch the right bit to enable/disable an adapter channel, without touching the other adapter's one. Tested on Nova-TD. Link: https://lore.kernel.org/linux-media/4214942f248baddec9cfd2b4b2424993ac356a51.1632689033.git.mchehab+huawei@kernel.org Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Mauro Carvalho Chehab , Michael Kuron , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, pb@linuxtv.org Signed-off-by: Mauro Carvalho Chehab commit e08d8f0fadad540ecd134724a7d6b519823e4637 Author: Mauro Carvalho Chehab Date: Sun Sep 26 21:51:27 2021 +0100 media: dib0700: cleanup start/stop streaming logic Having two different paths to start/stop streaming, depending weather the USB endpoints are 0x82/0x83 or not makes it more prune to errors. Unify the logic. Link: https://lore.kernel.org/linux-media/065a6fff925a42153671fa5202c81882ca12c59c.1632689033.git.mchehab+huawei@kernel.org Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Mauro Carvalho Chehab , Michael Kuron , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, pb@linuxtv.org Signed-off-by: Mauro Carvalho Chehab commit f7b77ebe6d2f49c7747b2d619586d1aa33f9ea91 Author: Michael Kuron Date: Sun Sep 26 21:51:26 2021 +0100 media: dib0700: fix undefined behavior in tuner shutdown This fixes a problem where closing the tuner would leave it in a state where it would not tune to any channel when reopened. This problem was discovered as part of https://github.com/hselasky/webcamd/issues/16. Since adap->id is 0 or 1, this bit-shift overflows, which is undefined behavior. The driver still worked in practice as the overflow would in most environments result in 0, which rendered the line a no-op. When running the driver as part of webcamd however, the overflow could lead to 0xff due to optimizations by the compiler, which would, in the end, improperly shut down the tuner. The bug is a regression introduced in the commit referenced below. The present patch causes identical behavior to before that commit for adap->id equal to 0 or 1. The driver does not contain support for dib0700 devices with more adapters, assuming such even exist. Tests have been performed with the Xbox One Digital TV Tuner on amd64. Not all dib0700 devices are expected to be affected by the regression; this code path is only taken by those with incorrect endpoint numbers. Link: https://lore.kernel.org/linux-media/1d2fc36d94ced6f67c7cc21dcc469d5e5bdd8201.1632689033.git.mchehab+huawei@kernel.org Cc: stable@vger.kernel.org Fixes: 7757ddda6f4f ("[media] DiB0700: add function to change I2C-speed") Signed-off-by: Michael Kuron Signed-off-by: Mauro Carvalho Chehab commit 4160420012b9b0a594793b6d644016ae4b8c9409 Author: Scott K Logan Date: Sun Oct 3 01:18:30 2021 +0100 media: s5h1411.c: Fix a typo in the VSB SNR table This looks like a typo. By manipulating the antenna on a device while monitoring the reported SNR, I was able to see the unexpected jump. After applying this patch, the spike was no longer present. Link: https://lore.kernel.org/linux-media/20211003001805.735092-1-logans@cottsay.net Signed-off-by: Scott K Logan Signed-off-by: Mauro Carvalho Chehab commit 40f45ab7a7edc76244cc67c3ae26df2e666088e2 Author: Colin Ian King Date: Thu Oct 14 16:12:35 2021 +0100 media: drivers: cx24113: remove redundant variable r Variable r is being assigned values but its value was never used, being overriden on its first usage. So, drop the initialization. Addresses-Coverity: ("Unused value") Link: https://lore.kernel.org/linux-media/20211014151235.62671-1-colin.king@canonical.com Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Signed-off-by: Colin Ian King Reviewed-by: Kieran Bingham Signed-off-by: Mauro Carvalho Chehab commit 32f4797d03b581aec1e20347e95bd36d6c2fd6cd Author: Colin Ian King Date: Thu Oct 14 16:32:53 2021 +0100 media: dvb-frontends/stv0367: remove redundant variable ADCClk_Hz GIT_AUTHOR_NAME=Colin King GIT_AUTHOR_EMAIL=colin.king@canonical.com Variable ADCClk_Hz is being initialised with a variable that is never read and then re-assigned immediately afterwards. Clean up the code by removing it and just returning the return value from the call to stv0367cab_get_mclk Addresses-Coverity: ("Unused value") Link: https://lore.kernel.org/linux-media/20211014153253.63527-1-colin.king@canonical.com Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Signed-off-by: Colin Ian King Reviewed-by: Kieran Bingham Signed-off-by: Mauro Carvalho Chehab commit e59a9e50ec8c421818c10df6e619cec9cc9ed4e8 Author: zhaoxiao Date: Wed Nov 17 03:06:56 2021 +0000 media: dib9000: Use min() instead of doing it manually Fix following coccicheck warning: drivers/media/dvb-frontends/dib9000.c:261:10-11: WARNING opportunity for min() drivers/media/dvb-frontends/dib9000.c:345:10-11: WARNING opportunity for min() Link: https://lore.kernel.org/linux-media/20211117030656.14984-1-zhaoxiao@uniontech.com Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, zhaoxiao Signed-off-by: zhaoxiao Signed-off-by: Mauro Carvalho Chehab commit 10f2d1cbf8f16c63ca3d746adb33d43f116dbb05 Author: Dan Carpenter Date: Thu Nov 18 14:39:24 2021 +0300 RDMA/usnic: Clean up usnic_ib_alloc_pd() Remove the unnecessary "umem_pd" variable. And usnic_uiom_alloc_pd() never returns NULL so remove the NULL check. Link: https://lore.kernel.org/r/20211118113924.GH1147@kili Signed-off-by: Dan Carpenter Reviewed-by: Leon Romanovsky Signed-off-by: Jason Gunthorpe commit 9a49afe6f5a516eb33bec24be0f81cb35ca79445 Author: Jiri Olsa Date: Wed Nov 17 11:41:14 2021 -0800 selftests/bpf: Add btf_dedup case with duplicated structs within CU Add an artificial minimal example simulating compilers producing two different types within a single CU that correspond to identical struct definitions. Signed-off-by: Jiri Olsa Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20211117194114.347675-2-andrii@kernel.org commit efdd3eb8015e7447095f02a26eaabd164cd18004 Author: Andrii Nakryiko Date: Wed Nov 17 11:41:13 2021 -0800 libbpf: Accommodate DWARF/compiler bug with duplicated structs According to [0], compilers sometimes might produce duplicate DWARF definitions for exactly the same struct/union within the same compilation unit (CU). We've had similar issues with identical arrays and handled them with a similar workaround in 6b6e6b1d09aa ("libbpf: Accomodate DWARF/compiler bug with duplicated identical arrays"). Do the same for struct/union by ensuring that two structs/unions are exactly the same, down to the integer values of field referenced type IDs. Solving this more generically (allowing referenced types to be equivalent, but using different type IDs, all within a single CU) requires a huge complexity increase to handle many-to-many mappings between canonidal and candidate type graphs. Before we invest in that, let's see if this approach handles all the instances of this issue in practice. Thankfully it's pretty rare, it seems. [0] https://lore.kernel.org/bpf/YXr2NFlJTAhHdZqq@krava/ Reported-by: Jiri Olsa Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20211117194114.347675-1-andrii@kernel.org commit 98a1ca29768aca6e06e93f2bc4439f01ba439ac4 Author: Lukas Middendorf Date: Sun Apr 18 01:12:03 2021 +0100 media: media dvb_frontend: add suspend and resume callbacks to dvb_frontend_ops While dvb_tuner_ops already has dedicated suspend and resume callbacks, dvb_frontend_ops currently does not have them. Add those callbacks and use them for suspend and resume. If they are not set, the old behavior of calling sleep or init is used. This allows dvb_frontend drivers to handle resume differently from init, and suspend differently from sleep. No change is required for drivers not needing this functionality. Link: https://lore.kernel.org/linux-media/20210418001204.7453-2-kernel@tuxforce.de Cc: Lukas Middendorf , Antti Palosaari , Mauro Carvalho Chehab , Luis Chamberlain Signed-off-by: Lukas Middendorf Signed-off-by: Mauro Carvalho Chehab commit 46c87b4277f58ecb4672aa7b8a1653d81b6b9379 Author: Kamal Heib Date: Thu Nov 18 12:04:56 2021 +0200 RDMA/cxgb4: Use helper function to set GUIDs Use the addrconf_addr_eui48() helper function to set the GUIDs, Also make sure the GUIDs are valid EUI-64 identifiers. Link: https://lore.kernel.org/r/20211118100456.45423-1-kamalheib1@gmail.com Signed-off-by: Kamal Heib Signed-off-by: Jason Gunthorpe commit b13203032e679674c7c518f52a7ec0801ca3a829 Author: Zheyu Ma Date: Tue May 11 10:00:03 2021 +0100 media: b2c2: Add missing check in flexcop_pci_isr: A out-of-bounds bug can be triggered by an interrupt, the reason for this bug is the lack of checking of register values. In flexcop_pci_isr, the driver reads value from a register and uses it as a dma address. Finally, this address will be passed to the count parameter of find_next_packet. If this value is larger than the size of dma, the index of buffer will be out-of-bounds. Fix this by adding a check after reading the value of the register. The following KASAN report reveals it: BUG: KASAN: slab-out-of-bounds in find_next_packet drivers/media/dvb-core/dvb_demux.c:528 [inline] BUG: KASAN: slab-out-of-bounds in _dvb_dmx_swfilter drivers/media/dvb-core/dvb_demux.c:572 [inline] BUG: KASAN: slab-out-of-bounds in dvb_dmx_swfilter+0x3fa/0x420 drivers/media/dvb-core/dvb_demux.c:603 Read of size 1 at addr ffff8880608c00a0 by task swapper/2/0 CPU: 2 PID: 0 Comm: swapper/2 Not tainted 4.19.177-gdba4159c14ef #25 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:77 [inline] dump_stack+0xec/0x156 lib/dump_stack.c:118 print_address_description+0x78/0x290 mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report+0x25b/0x380 mm/kasan/report.c:412 __asan_report_load1_noabort+0x19/0x20 mm/kasan/report.c:430 find_next_packet drivers/media/dvb-core/dvb_demux.c:528 [inline] _dvb_dmx_swfilter drivers/media/dvb-core/dvb_demux.c:572 [inline] dvb_dmx_swfilter+0x3fa/0x420 drivers/media/dvb-core/dvb_demux.c:603 flexcop_pass_dmx_data+0x2e/0x40 drivers/media/common/b2c2/flexcop.c:167 flexcop_pci_isr+0x3d1/0x5d0 drivers/media/pci/b2c2/flexcop-pci.c:212 __handle_irq_event_percpu+0xfb/0x770 kernel/irq/handle.c:149 handle_irq_event_percpu+0x79/0x150 kernel/irq/handle.c:189 handle_irq_event+0xac/0x140 kernel/irq/handle.c:206 handle_fasteoi_irq+0x232/0x5c0 kernel/irq/chip.c:725 generic_handle_irq_desc include/linux/irqdesc.h:155 [inline] handle_irq+0x230/0x3a0 arch/x86/kernel/irq_64.c:87 do_IRQ+0xa7/0x1e0 arch/x86/kernel/irq.c:247 common_interrupt+0xf/0xf arch/x86/entry/entry_64.S:670 RIP: 0010:native_safe_halt+0x28/0x30 arch/x86/include/asm/irqflags.h:61 Code: 00 00 55 be 04 00 00 00 48 c7 c7 00 62 2f 8c 48 89 e5 e8 fb 31 e8 f8 8b 05 75 4f 8e 03 85 c0 7e 07 0f 00 2d 8a 61 66 00 fb f4 <5d> c3 90 90 90 90 90 90 0f 1f 44 00 00 55 48 89 e5 41 57 41 56 41 RSP: 0018:ffff88806b71fcc8 EFLAGS: 00000246 ORIG_RAX: ffffffffffffffde RAX: 0000000000000000 RBX: ffffffff8bde44c8 RCX: ffffffff88a11285 RDX: 0000000000000000 RSI: 0000000000000004 RDI: ffffffff8c2f6200 RBP: ffff88806b71fcc8 R08: fffffbfff185ec40 R09: fffffbfff185ec40 R10: 0000000000000001 R11: fffffbfff185ec40 R12: 0000000000000002 R13: ffffffff8be9d6e0 R14: 0000000000000000 R15: 0000000000000000 arch_safe_halt arch/x86/include/asm/paravirt.h:94 [inline] default_idle+0x6f/0x360 arch/x86/kernel/process.c:557 arch_cpu_idle+0xf/0x20 arch/x86/kernel/process.c:548 default_idle_call+0x3b/0x60 kernel/sched/idle.c:93 cpuidle_idle_call kernel/sched/idle.c:153 [inline] do_idle+0x2ab/0x3c0 kernel/sched/idle.c:263 cpu_startup_entry+0xcb/0xe0 kernel/sched/idle.c:369 start_secondary+0x3b8/0x4e0 arch/x86/kernel/smpboot.c:271 secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:243 Allocated by task 1: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:553 kasan_slab_alloc+0x11/0x20 mm/kasan/kasan.c:490 slab_post_alloc_hook mm/slab.h:445 [inline] slab_alloc_node mm/slub.c:2741 [inline] slab_alloc mm/slub.c:2749 [inline] kmem_cache_alloc+0xeb/0x280 mm/slub.c:2754 kmem_cache_zalloc include/linux/slab.h:699 [inline] __kernfs_new_node+0xe2/0x6f0 fs/kernfs/dir.c:633 kernfs_new_node+0x9a/0x120 fs/kernfs/dir.c:693 __kernfs_create_file+0x5f/0x340 fs/kernfs/file.c:992 sysfs_add_file_mode_ns+0x22a/0x4e0 fs/sysfs/file.c:306 create_files fs/sysfs/group.c:63 [inline] internal_create_group+0x34e/0xc30 fs/sysfs/group.c:147 sysfs_create_group fs/sysfs/group.c:173 [inline] sysfs_create_groups+0x9c/0x140 fs/sysfs/group.c:200 driver_add_groups+0x3e/0x50 drivers/base/driver.c:129 bus_add_driver+0x3a5/0x790 drivers/base/bus.c:684 driver_register+0x1cd/0x410 drivers/base/driver.c:170 __pci_register_driver+0x197/0x200 drivers/pci/pci-driver.c:1411 cx88_audio_pci_driver_init+0x23/0x25 drivers/media/pci/cx88/cx88-alsa.c: 1017 do_one_initcall+0xe0/0x610 init/main.c:884 do_initcall_level init/main.c:952 [inline] do_initcalls init/main.c:960 [inline] do_basic_setup init/main.c:978 [inline] kernel_init_freeable+0x4d0/0x592 init/main.c:1145 kernel_init+0x18/0x190 init/main.c:1062 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 Freed by task 0: (stack is not available) The buggy address belongs to the object at ffff8880608c0000 which belongs to the cache kernfs_node_cache of size 160 The buggy address is located 0 bytes to the right of 160-byte region [ffff8880608c0000, ffff8880608c00a0) The buggy address belongs to the page: page:ffffea0001823000 count:1 mapcount:0 mapping:ffff88806bed1e00 index:0x0 compound_mapcount: 0 flags: 0x100000000008100(slab|head) raw: 0100000000008100 dead000000000100 dead000000000200 ffff88806bed1e00 raw: 0000000000000000 0000000000240024 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880608bff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880608c0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8880608c0080: 00 00 00 00 fc fc fc fc fc fc fc fc 00 00 00 00 ^ ffff8880608c0100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880608c0180: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00 ================================================================== Link: https://lore.kernel.org/linux-media/1620723603-30912-1-git-send-email-zheyuma97@gmail.com Reported-by: Zheyu Ma Signed-off-by: Zheyu Ma Signed-off-by: Mauro Carvalho Chehab commit 7615209f42a1976894cd0df97a380a034911656a Author: Andrii Nakryiko Date: Thu Nov 18 09:40:54 2021 -0800 libbpf: Add runtime APIs to query libbpf version Libbpf provided LIBBPF_MAJOR_VERSION and LIBBPF_MINOR_VERSION macros to check libbpf version at compilation time. This doesn't cover all the needs, though, because version of libbpf that application is compiled against doesn't necessarily match the version of libbpf at runtime, especially if libbpf is used as a shared library. Add libbpf_major_version() and libbpf_minor_version() returning major and minor versions, respectively, as integers. Also add a convenience libbpf_version_string() for various tooling using libbpf to print out libbpf version in a human-readable form. Currently it will return "v0.6", but in the future it can contains some extra information, so the format itself is not part of a stable API and shouldn't be relied upon. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Acked-by: John Fastabend Acked-by: Toke Høiland-Jørgensen Link: https://lore.kernel.org/bpf/20211118174054.2699477-1-andrii@kernel.org commit 8d395ce6f04b4af8d2b7397e0fa2f849bd22c231 Author: Cai Huoqing Date: Thu Sep 16 03:00:18 2021 +0100 media: dvb-core: Convert to SPDX identifier use SPDX-License-Identifier instead of a verbose license text and remove verbose license text. Link: https://lore.kernel.org/linux-media/20210916020018.8550-1-caihuoqing@baidu.com Signed-off-by: Cai Huoqing Signed-off-by: Mauro Carvalho Chehab commit ab599eb11882f834951c436cc080c3455ba32b9b Author: Wang Hai Date: Fri Oct 15 16:57:41 2021 +0800 media: dmxdev: fix UAF when dvb_register_device() fails I got a use-after-free report: dvbdev: dvb_register_device: failed to create device dvb1.dvr0 (-12) ... ================================================================== BUG: KASAN: use-after-free in dvb_dmxdev_release+0xce/0x2f0 ... Call Trace: dump_stack_lvl+0x6c/0x8b print_address_description.constprop.0+0x48/0x70 kasan_report.cold+0x82/0xdb __asan_load4+0x6b/0x90 dvb_dmxdev_release+0xce/0x2f0 ... Allocated by task 7666: kasan_save_stack+0x23/0x50 __kasan_kmalloc+0x83/0xa0 kmem_cache_alloc_trace+0x22e/0x470 dvb_register_device+0x12f/0x980 dvb_dmxdev_init+0x1f3/0x230 ... Freed by task 7666: kasan_save_stack+0x23/0x50 kasan_set_track+0x20/0x30 kasan_set_free_info+0x24/0x40 __kasan_slab_free+0xf2/0x130 kfree+0xd1/0x5c0 dvb_register_device.cold+0x1ac/0x1fa dvb_dmxdev_init+0x1f3/0x230 ... When dvb_register_device() in dvb_dmxdev_init() fails, dvb_dmxdev_init() does not return a failure, and the memory pointed to by dvbdev or dvr_dvbdev is invalid at this point. If they are used subsequently, it will result in UFA or null-ptr-deref. If dvb_register_device() in dvb_dmxdev_init() fails, fix the bug by making dvb_dmxdev_init() return an error as well. Link: https://lore.kernel.org/linux-media/20211015085741.1203283-1-wanghai38@huawei.com Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-by: Hulk Robot Signed-off-by: Wang Hai Signed-off-by: Mauro Carvalho Chehab commit 6e143293e17a73c9313f91c5ca3aaacbaef030cf Author: José Expósito Date: Thu Nov 18 08:29:55 2021 +0100 HID: apple: Report Magic Keyboard battery over USB When connected over USB, the Apple Magic Keyboard 2015 registers 3 different interfaces. One of them is used to report the battery level. However, unlike when connected over Bluetooth, the battery level is not reported automatically and it is required to fetch it manually. Add a new quirk to fix the battery report descriptor and a timer to fetch the battery level. Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit 7f52ece242e9714d94d3bab630ea1dd2236e7d54 Author: José Expósito Date: Thu Nov 18 08:29:54 2021 +0100 HID: apple: Use BIT to define quirks Replace the existing quirk hardcoded values with the BIT macro in order to simplify including new quirks. Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit a5fe7864d8ada170f19cc47d176bf8260ffb4263 Author: José Expósito Date: Thu Nov 18 08:29:53 2021 +0100 HID: apple: Do not reset quirks when the Fn key is not found When a keyboard without a function key is detected, instead of removing all quirks, remove only the APPLE_HAS_FN quirk. Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit 0b91b4e4dae63cd43871fc2012370b86ee588f91 Author: José Expósito Date: Thu Nov 18 17:52:08 2021 +0100 HID: magicmouse: Report battery level over USB When connected over USB, the Apple Magic Mouse 2 and the Apple Magic Trackpad 2 register multiple interfaces, one of them is used to report the battery level. However, unlike when connected over Bluetooth, the battery level is not reported automatically and it is required to fetch it manually. Fix the battery report descriptor and add a timer to fetch the battery level. Signed-off-by: José Expósito Signed-off-by: Jiri Kosina commit 03dada294d0830f3bc994909f2e74ecaa3aa92a4 Author: Filipe Laíns Date: Thu Nov 11 16:44:11 2021 +0000 HID: logitech: add myself as a reviewer Currently, I have to use a separate email address and maintain several filters to monitor changes to Logitech drivers, so that I can have an opportunity to review them. Since I am very interested in keeping up with the changes, as I have a lot of the hardware and maintain the main userspace stacks that depend on these drivers, I would like to mark myself as a reviewer. I would also be open to be marked as a maintainer if Benjamin thinks it makes sense. Signed-off-by: Filipe Laíns Signed-off-by: Jiri Kosina commit d951ae1ce8033dea91c532810536809d0e691615 Author: Matthias Kaehlcke Date: Tue Nov 2 11:40:25 2021 -0700 HID: i2c-hid: Report wakeup events The i2c-hid driver generally supports wakeup, bit it currently doesn't report wakeup events to the PM subsystem. Change that. Signed-off-by: Matthias Kaehlcke Acked-by: Hans de Goede Signed-off-by: Jiri Kosina commit 520fbdf7fb19b7744e370d36d9244a446299ceb7 Author: Bernard Zhao Date: Thu Nov 18 18:06:42 2021 -0800 net/bridge: replace simple_strtoul to kstrtol simple_strtoull is obsolete, use kstrtol instead. Signed-off-by: Bernard Zhao Signed-off-by: David S. Miller commit eaa54d66145e4314eb785a507341a7c8b13f6df8 Author: Yu Xiao Date: Fri Nov 19 09:58:01 2021 +0100 nfp: flower: correction of error handling Removing reduplicated error handling when running into error path of `nfp_compile_flow_metadata`. Signed-off-by: Yu Xiao Signed-off-by: Yinjun Zhang Signed-off-by: Simon Horman Signed-off-by: David S. Miller commit eeb04fa64af18cbe03d1067a435c6423da47b6fc Author: Stanislav Lisovskiy Date: Thu Nov 18 11:39:07 2021 +0200 drm/i915/dg2: Implement WM0 cursor WA for DG2 Bug in the register unit which results in WM1 register used when only WM0 is enabled on cursor. Software workaround is when only WM0 enabled on cursor, copy contents of CUR_WM_0[30:0] (exclude the enable bit) into CUR_WM_1[30:0]. v2: - s/dev_priv/i915/ (Ville Syrjälä) - Removed unneeded brackets (Ville Syrjälä) HSDES: 14012656716 Reviewed-by: Ville Syrjälä Signed-off-by: Stanislav Lisovskiy Link: https://patchwork.freedesktop.org/patch/msgid/20211118093907.18510-1-stanislav.lisovskiy@intel.com commit 2052287a74c95234eabe7a858f157a88d6880029 Author: Jani Nikula Date: Tue Nov 16 15:58:13 2021 +0200 drm/i915/pxp: fix includes for headers in include/drm Use <> not "" for including headers from include/drm. Signed-off-by: Jani Nikula Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20211116135813.19806-1-jani.nikula@intel.com commit 728e26c3ac89427de181c1e8400d27d7b6c3a8a5 Merge: 3b1abcf128946 5125b9a9c420e Author: Kalle Valo Date: Fri Nov 19 15:32:01 2021 +0200 Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git ath.git patches for v5.17. Major changes: ath10k * fetch (pre-)calibration data via nvmem subsystem ath11k * enable 802.11 power save mode in station mode for qca6390 and wcn6855 * trace log support * proper board file detection for WCN6855 based on PCI ids * BSS color change support commit 5ed597daa4202e92472953fbfd82105f10aa35e1 Author: Jani Nikula Date: Tue Nov 16 19:14:34 2021 +0200 drm/i915: drop intel_display.h include from intel_display_power.h Use forward declarations instead. Cc: Imre Deak Signed-off-by: Jani Nikula Reviewed-by: Daniel Vetter Reviewed-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20211116171434.20516-5-jani.nikula@intel.com commit de511df7254ab22ee777ef6049547c69c1b2c78b Author: Jani Nikula Date: Tue Nov 16 19:14:33 2021 +0200 drm/i915: move structs from intel_display_power.h to .c Anything internal to the implementation should be hidden away. Move the intel_display_power structs to the .c file. Cc: Imre Deak Signed-off-by: Jani Nikula Reviewed-by: Daniel Vetter Reviewed-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20211116171434.20516-4-jani.nikula@intel.com commit 6abf2fc0072b020cdbb9124ea935603b02502e6c Author: Jani Nikula Date: Tue Nov 16 19:14:32 2021 +0200 drm/i915/debugfs: move debug printing to intel_display_power.c The debugfs should have no special privileges to look into the implementation guts. Move the actual debug printing of power domains to intel_display_power.c. Cc: Imre Deak Signed-off-by: Jani Nikula Reviewed-by: Daniel Vetter Reviewed-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20211116171434.20516-3-jani.nikula@intel.com commit 497520ca1915a91188560a26c2dceb9b9c43db4e Author: Jani Nikula Date: Tue Nov 16 19:14:31 2021 +0200 drm/i915: drop intel_display.h include from intel_dpll_mgr.h Use forward declarations instead. Signed-off-by: Jani Nikula Reviewed-by: Daniel Vetter Reviewed-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20211116171434.20516-2-jani.nikula@intel.com commit 6f51260f0eda41a19dff4023d14d543907f0f967 Author: Jani Nikula Date: Tue Nov 16 19:14:30 2021 +0200 drm/i915: drop intel_display.h include from intel_ddi.h Use forward declarations instead. Signed-off-by: Jani Nikula Reviewed-by: Daniel Vetter Reviewed-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20211116171434.20516-1-jani.nikula@intel.com commit 812ad3d270cb900d156a1542360d81f749dbe040 Author: Kees Cook Date: Thu Nov 18 12:34:56 2021 -0800 ethtool: stats: Use struct_group() to clear all stats at once In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Add struct_group() to mark region of struct stats_reply_data that should be initialized, which can now be done in a single memset() call. Signed-off-by: Kees Cook Signed-off-by: David S. Miller commit b5d8cf0af167f3ab9f4cfe44918cde01e20a1222 Author: Kees Cook Date: Thu Nov 18 12:34:07 2021 -0800 net/af_iucv: Use struct_group() to zero struct iucv_sock region In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Add struct_group() to mark the region of struct iucv_sock that gets initialized to zero. Avoid the future warning: In function 'fortify_memset_chk', inlined from 'iucv_sock_alloc' at net/iucv/af_iucv.c:476:2: ./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(p_size_field, size); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Acked-by: Karsten Graul Link: https://lore.kernel.org/lkml/19ff61a0-0cda-6000-ce56-dc6b367c00d6@linux.ibm.com/ Signed-off-by: Kees Cook Signed-off-by: David S. Miller commit 8f2a83b454c9b17989843756313e0180827a7ace Author: Kees Cook Date: Thu Nov 18 12:32:41 2021 -0800 ipv6: Use memset_after() to zero rt6_info In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Use memset_after() to clear everything after the dst_entry member of struct rt6_info. Signed-off-by: Kees Cook Signed-off-by: David S. Miller commit c4f5b30dda01f2f6979a9681142de454991182ee Author: Biju Das Date: Fri Nov 12 18:44:10 2021 +0000 reset: Add of_reset_control_get_optional_exclusive() Add optional variant of of_reset_control_get_exclusive(). If the requested reset is not specified in the device tree, this function returns NULL instead of an error. Suggested-by: Philipp Zabel Signed-off-by: Biju Das Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20211112184413.4391-2-biju.das.jz@bp.renesas.com Signed-off-by: Philipp Zabel commit e3617433c3da3d0859a4bc67f3f975e87f650ebf Author: Kees Cook Date: Thu Nov 18 12:30:45 2021 -0800 net: 802: Use memset_startat() to clear struct fields In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Use memset_startat() so memset() doesn't get confused about writing beyond the destination member that is intended to be the starting point of zeroing through the end of the struct. Signed-off-by: Kees Cook Signed-off-by: David S. Miller commit f5455a1d9d499e4028b8ae8370758efad00b00e9 Author: Kees Cook Date: Thu Nov 18 12:30:19 2021 -0800 net: dccp: Use memset_startat() for TP zeroing In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memset(), avoid intentionally writing across neighboring fields. Use memset_startat() so memset() doesn't get confused about writing beyond the destination member that is intended to be the starting point of zeroing through the end of the struct. Signed-off-by: Kees Cook Signed-off-by: David S. Miller commit 92e888bc6f1b84cb4dee23d768777362221be1d4 Author: Heiner Kallweit Date: Thu Nov 18 21:04:23 2021 +0100 sky2: use PCI VPD API in eeprom ethtool ops Recently pci_read/write_vpd_any() have been added to the PCI VPD API. These functions allow to access VPD address space outside the auto-detected VPD, and they can be used to significantly simplify the eeprom ethtool ops. Tested with a 88E8070 card with 1KB EEPROM. Signed-off-by: Heiner Kallweit Reviewed-by: Stephen Hemminger Signed-off-by: David S. Miller commit a6366b13c165e5d8d8b06d8d732a4f98bfb8ef66 Author: Christophe JAILLET Date: Thu Nov 18 20:37:15 2021 +0100 net: ipa: Use 'for_each_clear_bit' when possible Use 'for_each_clear_bit()' instead of hand writing it. It is much less version. Signed-off-by: Christophe JAILLET Signed-off-by: David S. Miller commit 29fd0ec65e912613945c2d9fe7d551a842a26b0d Author: Kees Cook Date: Thu Nov 18 10:42:53 2021 -0800 bnx2x: Use struct_group() for memcpy() region 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. Use struct_group() in struct nig_stats around members egress_mac_pkt0_lo, egress_mac_pkt0_hi, egress_mac_pkt1_lo, and egress_mac_pkt1_hi (and the respective members in struct bnx2x_eth_stats), so they can be referenced together. This will allow memcpy() and sizeof() to more easily reason about sizes, improve readability, and avoid future warnings about writing beyond the end of struct bnx2x_eth_stats's rx_stat_ifhcinbadoctets_hi. "pahole" shows no size nor member offset changes to either struct. "objdump -d" shows no meaningful object code changes (i.e. only source line number induced differences and optimizations). Additionally adds BUILD_BUG_ON() to compare the separate struct group sizes. Reviewed-by: Prabhakar Kushwaha Link: https://lore.kernel.org/lkml/DM5PR18MB2229B0413C372CC6E49D59A3B2C59@DM5PR18MB2229.namprd18.prod.outlook.com Signed-off-by: Kees Cook Signed-off-by: David S. Miller commit 641d3ef00ce3982aadceeeba6c3e24bee43ce62e Author: Kees Cook Date: Thu Nov 18 10:42:35 2021 -0800 cxgb4: Use struct_group() for memcpy() region 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. Use struct_group() in struct fw_eth_tx_pkt_vm_wr around members ethmacdst, ethmacsrc, ethtype, and vlantci, so they can be referenced together. This will allow memcpy() and sizeof() to more easily reason about sizes, improve readability, and avoid future warnings about writing beyond the end of ethmacdst. "pahole" shows no size nor member offset changes to struct fw_eth_tx_pkt_vm_wr. "objdump -d" shows no object code changes. Signed-off-by: Kees Cook Signed-off-by: David S. Miller commit 88181f1d3474f59fb897ed01e4e4d8f77802fa4a Author: Kees Cook Date: Thu Nov 18 10:41:42 2021 -0800 cxgb3: Use struct_group() for memcpy() region 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. Use struct_group() in struct rss_hdr around members imm_data and intr_gen, so they can be referenced together. This will allow memcpy() and sizeof() to more easily reason about sizes, improve readability, and avoid future warnings about writing beyond the end of imm_data. "pahole" shows no size nor member offset changes to struct rss_hdr. "objdump -d" shows no object code changes. Signed-off-by: Kees Cook Signed-off-by: David S. Miller commit ec574d9ee5d2e74c913cb3e927e7706be7bfb64d Author: Russell King (Oracle) Date: Thu Nov 18 18:07:06 2021 +0000 net: phylink: add 1000base-KX to phylink_caps_to_linkmodes() 1000base-KX was missed in phylink_caps_to_linkmodes(), add it. This will be necessary to convert stmmac with xpcs to ensure we don't drop any supported linkmodes. Signed-off-by: Russell King (Oracle) Signed-off-by: David S. Miller commit 3572f57b43f6d189ff4ca2f510a898d5b839347a Merge: 2edc4bf666c1f 09ae598271f8c Author: David S. Miller Date: Fri Nov 19 11:12:30 2021 +0000 Merge branch 's390-next' Karsten Graul says: ==================== s390/net: updates 2021-11-18 Please apply the following patches to netdev's net-next tree. Heiko provided fixes for kernel doc comments and solved some other compiler warnings. Julians qeth patch simplifies the rx queue handling in the code. ==================== Signed-off-by: David S. Miller commit 09ae598271f8cfe46148cece8e03509b9da16334 Author: Heiko Carstens Date: Thu Nov 18 17:06:07 2021 +0100 s390/lcs: add braces around empty function body Fix allmodconfig + W=1 compile breakage: drivers/s390/net/lcs.c: In function ‘lcs_get_frames_cb’: drivers/s390/net/lcs.c:1823:25: error: suggest braces around empty body in an ‘else’ statement [-Werror=empty-body] 1823 | ; // FIXME: error message ? | ^ Acked-by: Julian Wiedmann Signed-off-by: Heiko Carstens Signed-off-by: Karsten Graul Signed-off-by: David S. Miller commit dddbf91387a04a03a8e071cb4857403df219382e Author: Heiko Carstens Date: Thu Nov 18 17:06:06 2021 +0100 s390/ctcm: add __printf format attribute to ctcm_dbf_longtext Allow the compiler to recognize and check format strings and parameters. As reported with allmodconfig and W=1: drivers/s390/net/ctcm_dbug.c: In function ‘ctcm_dbf_longtext’: drivers/s390/net/ctcm_dbug.c:73:9: error: function ‘ctcm_dbf_longtext’ might be a candidate for ‘gnu_printf’ format attribute [-Werror=suggest-attribute=format] 73 | vsnprintf(dbf_txt_buf, sizeof(dbf_txt_buf), fmt, args); | ^~~~~~~~~ Acked-by: Julian Wiedmann Signed-off-by: Heiko Carstens Signed-off-by: Karsten Graul Signed-off-by: David S. Miller commit 9961d6d50b7f53ab75049ebf3bea1ff560014bed Author: Heiko Carstens Date: Thu Nov 18 17:06:05 2021 +0100 s390/ctcm: fix format string The second parameter as specified by the format string is actually a string not an integer. Acked-by: Julian Wiedmann Signed-off-by: Heiko Carstens Signed-off-by: Karsten Graul Signed-off-by: David S. Miller commit 7c8e1a9155ef7db11672107ee99ad55a0815e3a6 Author: Heiko Carstens Date: Thu Nov 18 17:06:04 2021 +0100 net/af_iucv: fix kernel doc comments Fix kernel doc comments where appropriate, or remove incorrect kernel doc indicators. Acked-by: Julian Wiedmann Signed-off-by: Heiko Carstens Signed-off-by: Karsten Graul Signed-off-by: David S. Miller commit 682026a5e9344fc6d0e779c1d49edad91cc2fbdb Author: Heiko Carstens Date: Thu Nov 18 17:06:03 2021 +0100 net/iucv: fix kernel doc comments Fix kernel doc comments where appropriate or remove incorrect kernel doc indicators. Also move kernel doc comments directly before functions. Signed-off-by: Heiko Carstens Signed-off-by: Karsten Graul Signed-off-by: David S. Miller commit 832585d2172fdaa29ee6497a94c0b9da0ab97eec Author: Julian Wiedmann Date: Thu Nov 18 17:06:02 2021 +0100 s390/qeth: allocate RX queue at probe time We always need an RX queue, and there's no reconfig situation either where we would need to free & rebuild the queue. So allocate the RX queue right from the start, and avoid freeing it during unrelated qeth_free_qdio_queues() calls. Signed-off-by: Julian Wiedmann Signed-off-by: Karsten Graul Signed-off-by: David S. Miller commit 2edc4bf666c1f641ea524751c35657e76ce353d8 Merge: 82f60a011c5f7 bb52aff3e3214 Author: David S. Miller Date: Fri Nov 19 11:05:22 2021 +0000 Merge branch 'hw_addr_set-arch' Jakub Kicinski says: ==================== net: use eth_hw_addr_set() in arch-specific drivers Fixups for more arch-specific drivers. With these (and another patch which didn't fit) the build is more or less clean with all cross-compilers available on kernel.org. I say more or less because around half of the arches fail to build for unrelated reasons right now. Most of the changes here are for m68k, 32bit x86 and alpha. ==================== Signed-off-by: David S. Miller commit bb52aff3e32144ce7e59541302cbce58464a450e Author: Jakub Kicinski Date: Thu Nov 18 23:10:33 2021 -0800 natsemi: macsonic: use eth_hw_addr_set() Byte by byte assignments. Fixes build on m68k. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 9a962aedd30f7fceb828d3161a80e0526e358eb5 Author: Jakub Kicinski Date: Thu Nov 18 23:10:32 2021 -0800 cirrus: mac89x0: use eth_hw_addr_set() Byte by byte assignments. Fixes build on m68k. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit e217fc4affc8c7392e4db48488b36d2a5d446e9d Author: Jakub Kicinski Date: Thu Nov 18 23:10:31 2021 -0800 apple: macmace: use eth_hw_addr_set() Byte by byte assignments. Fixes build on m68k. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 5b6d5affd27486ec9152a66df1741cf67782712a Author: Jakub Kicinski Date: Thu Nov 18 23:10:30 2021 -0800 lasi_82594: use eth_hw_addr_set() dev_addr is set from IO reads, passed to an arch-specific helper. Note that the helper never reads it so uninitialized temp is fine. Fixes build on parisc. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 80db345e7df0c507a83bd12ac7766fb054443804 Author: Jakub Kicinski Date: Thu Nov 18 23:10:29 2021 -0800 smc9194: use eth_hw_addr_set() dev_addr is set from IO reads, and broken from a u16 value. Fixes build on Alpha. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit f95f8e890a2aa576425402fea44bfa657e8ccaa6 Author: Jakub Kicinski Date: Thu Nov 18 23:10:28 2021 -0800 8390: wd: use eth_hw_addr_set() IO reads, so save to an array then eth_hw_addr_set(). Fixes build on x86 (32bit). Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 973a34c087f43b61b26570110a284faf48d08d5d Author: Jakub Kicinski Date: Thu Nov 18 23:10:27 2021 -0800 8390: mac8390: use eth_hw_addr_set() Use temp to pass to the reading function, the function is generic so can't fix there. Fixes m68k build. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit d7d28e90e229a8af0472421015c5828f5cd1ad2e Author: Jakub Kicinski Date: Thu Nov 18 23:10:26 2021 -0800 8390: hydra: use eth_hw_addr_set() Loop with offsetting to every second byte, so use a temp buffer. Fixes m68k build. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 5114ddf8dd881f9059147d3f130e9415ce94125e Author: Jakub Kicinski Date: Thu Nov 18 23:10:25 2021 -0800 8390: smc-ultra: use eth_hw_addr_set() IO reads, so save to an array then eth_hw_addr_set(). Fixes build on Alpha. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit cc71b8b9376ff5072d23b191654408c144dac6aa Author: Jakub Kicinski Date: Thu Nov 18 23:10:24 2021 -0800 amd: mvme147: use eth_hw_addr_set() Byte by byte assignments. Fixes build on m68k. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit c3dc2f7196ca0f59d9baeb5d3b927e703944dc6c Author: Jakub Kicinski Date: Thu Nov 18 23:10:23 2021 -0800 amd: atarilance: use eth_hw_addr_set() Byte by byte assignments. Fixes build on m68k. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 21942eef062781429b356974589d7965952940fb Author: Jakub Kicinski Date: Thu Nov 18 23:10:22 2021 -0800 amd: hplance: use eth_hw_addr_set() Byte by byte assignments. Fixes build on m68k. Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 285e4c664d6461b175b4613fc77126b5006a1912 Author: Jakub Kicinski Date: Thu Nov 18 23:10:21 2021 -0800 amd: a2065/ariadne: use eth_hw_addr_set() dev_addr is initialized byte by byte from series. Fixes build on x86 (32bit). Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 69ede3097b871dbc793dd6e21f38fde56d273963 Author: Jakub Kicinski Date: Thu Nov 18 23:10:20 2021 -0800 amd: ni65: use eth_hw_addr_set() IO reads, so save to an array then eth_hw_addr_set(). Fixes build on x86 (32bit). Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 0222ee53c483df7572eea7ba8585dda59328d46e Author: Jakub Kicinski Date: Thu Nov 18 23:10:19 2021 -0800 amd: lance: use eth_hw_addr_set() IO reads, so save to an array then eth_hw_addr_set(). Fixes build on x86 (32bit). Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 82f60a011c5f7287f06241f7720739b51d5da6fc Merge: 3b1abcf128946 a608e6794b080 Author: David S. Miller Date: Fri Nov 19 10:46:04 2021 +0000 Merge branch 'dev_addr-const-x86' Jakub Kicinski says: ==================== net: constify netdev->dev_addr - x86 changes Resending these so they can get merged while I battle random cross builds. ==================== Signed-off-by: David S. Miller commit a608e6794b080594590c52d2e373068d5148954c Author: Jakub Kicinski Date: Thu Nov 18 06:27:20 2021 -0800 ipw2200: constify address in ipw_send_adapter_address Add const to the address param of ipw_send_adapter_address() all the functions down the chain have already been changed. Not sure how I lost this in the rebase. Acked-by: Kalle Valo Signed-off-by: Jakub Kicinski Acked-by: Stanislav Yakovlev Signed-off-by: David S. Miller commit b09d58025e3c6c78a874c234769cc95b9276e94e Author: Jakub Kicinski Date: Thu Nov 18 06:27:19 2021 -0800 wilc1000: copy address before calling wilc_set_mac_address wilc_set_mac_address() calls IO routines which don't guarantee the pointer won't be written to. Make a copy. Acked-by: Kalle Valo Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 54612b4a8bc78f4fc62f6c5639c89e4ea5a2ac79 Author: Jakub Kicinski Date: Thu Nov 18 06:27:18 2021 -0800 mlxsw: constify address in mlxsw_sp_port_dev_addr_set Argument comes from netdev->dev_addr directly, it needs a const. Reviewed-by: Ido Schimmel Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit e291422c8f008c47a04788e98d557dc961d72777 Author: Jakub Kicinski Date: Thu Nov 18 06:27:17 2021 -0800 net: ax88796c: don't write to netdev->dev_addr directly The future is here, convert the new driver as we are about to make netdev->dev_addr const. Acked-by: Lukasz Stelmach Signed-off-by: Jakub Kicinski Signed-off-by: David S. Miller commit 827fbac821a656b80b761e8e39a172669569cdcf Author: Yoshihiro Shimoda Date: Tue Nov 16 16:41:20 2021 +0900 dt-bindings: clock: renesas,cpg-mssr: Document r8a779f0 Add binding documentation for the R-Car S4-8 (R8A779F0) Clock Pulse Generator. Signed-off-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20211116074130.107554-7-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Geert Uytterhoeven commit 97c8d514af4e1f7384c722407d34c74fd677c138 Author: Lad Prabhakar Date: Wed Nov 17 11:51:01 2021 +0000 clk: renesas: cpg-mssr: propagate return value of_genpd_add_provider_simple() of_genpd_add_provider_simple() might fail, this patch makes sure we check the return value of of_genpd_add_provider_simple() by propagating the return value to the caller of cpg_mssr_add_clk_domain(). Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211117115101.28281-5-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit fa58e465542e48b6ab2336350dae76d1cf83ceb1 Author: Lad Prabhakar Date: Wed Nov 17 11:51:00 2021 +0000 clk: renesas: cpg-mssr: Check return value of pm_genpd_init() Make sure we check the return value of pm_genpd_init() which might fail. Also add a devres action to remove the power-domain in-case the probe callback fails further down in the code flow. Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211117115101.28281-4-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 33748744f15a110a233b6ae0380f476006e770f0 Author: Lad Prabhakar Date: Wed Nov 17 11:50:59 2021 +0000 clk: renesas: rzg2l: propagate return value of_genpd_add_provider_simple() of_genpd_add_provider_simple() might fail, this patch makes sure we check the return value of of_genpd_add_provider_simple() by propagating the return value to the caller of rzg2l_cpg_add_clk_domain(). Fixes: ef3c613ccd68a ("clk: renesas: Add CPG core wrapper for RZ/G2L SoC") Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211117115101.28281-3-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 27527a3d3b162e4512798c058c0e8a216c721187 Author: Lad Prabhakar Date: Wed Nov 17 11:50:58 2021 +0000 clk: renesas: rzg2l: Check return value of pm_genpd_init() Make sure we check the return value of pm_genpd_init() which might fail. Also add a devres action to remove the power-domain in-case the probe callback fails further down in the code flow. Fixes: ef3c613ccd68a ("clk: renesas: Add CPG core wrapper for RZ/G2L SoC") Signed-off-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211117115101.28281-2-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 51707f22744439f0ba009f0665faf7964b4e1b16 Author: Ville Syrjälä Date: Fri Nov 12 21:38:11 2021 +0200 drm/i915: Clean up CRC register defines Use REG_BIT() & co. for the CRC registers. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211112193813.8224-8-ville.syrjala@linux.intel.com Reviewed-by: Rodrigo Vivi commit e7d960cd6afd56d8c6d4408b6b8a59c91baafcc2 Author: Lad Prabhakar Date: Wed Nov 17 00:26:01 2021 +0000 clk: renesas: r9a07g044: Add RSPI clock and reset entries Add RSPI{0,1,2} clock and reset entries to CPG driver. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20211117002601.17971-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 7d938bc0119507d11dc02cc6ee47f386cd5d2f0a Author: Ville Syrjälä Date: Fri Nov 12 21:38:12 2021 +0200 drm/i915: Clean up DPINVGTT/VLV_DPFLIPSTAT bits Use REG_BIT() & co. for DPINVTT/VLV_DPFLIPSTAT bits. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211112193813.8224-9-ville.syrjala@linux.intel.com Reviewed-by: Rodrigo Vivi commit 7781083fd609f849adcab88bf7467614ed4d29a6 Author: Seiya Wang Date: Tue Nov 2 17:02:30 2021 +0800 arm64: dts: mt8183: support coresight-cpu-debug for mt8183 Add coresight-cpu-debug nodes to mt8183 for dumping EDPRSR, EDPCSR, EDCIDSR, EDVIDSR while kernel panic happens Signed-off-by: Seiya Wang Link: https://lore.kernel.org/r/20211102090230.25013-1-seiya.wang@mediatek.com Signed-off-by: Matthias Brugger commit d6dabaf678971733da56b2e84793348f714d42ff Author: Biju Das Date: Fri Nov 12 08:10:01 2021 +0000 clk: renesas: r9a07g044: Change core clock "I" from DEF_FIXED->DEF_DIV Core clock "I" is sourced from CPG_PL1_DDIV divider as per HW manual Rev.1.00. This patch adds clock divider table "dtable_1_8" and switches to DEF_DIV for "I" clock. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211112081003.15453-3-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 86e122c0754951094a3857870ad9f4022e056f6b Author: Biju Das Date: Fri Nov 12 08:10:00 2021 +0000 clk: renesas: rzg2l: Add CPG_PL1_DDIV macro Core clock "I" is sourced from CPG_PL1_DDIV which controls CPU frequency. Define CPG_PL1_DDIV, so that we can register it as a clock divider in later patch. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211112081003.15453-2-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 54337a96f31b87e34f62af4c510e2fa80a908400 Author: AngeloGioacchino Del Regno Date: Tue Nov 2 15:42:24 2021 +0100 arm64: dts: mediatek: mt8173-elm: Add backlight enable pin config Add the proper pinctrl for GPIO95 backlight enable pin and assign it to the pwm-backlight node. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20211102144224.457446-2-angelogioacchino.delregno@collabora.com Signed-off-by: Matthias Brugger commit 08c40de81b77bd030f2a065464e7362b7467ed78 Author: AngeloGioacchino Del Regno Date: Tue Nov 2 15:42:23 2021 +0100 arm64: dts: mediatek: mt8173-elm: Move pwm pinctrl to pwm0 node The PWM pinctrl belongs to the PWM0 node, as it's strictly pwm related. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20211102144224.457446-1-angelogioacchino.delregno@collabora.com Signed-off-by: Matthias Brugger commit 6bb0a0e0fd358d4f9f6ce4c2d36c1f80d7496f6a Author: Ville Syrjälä Date: Fri Nov 12 21:38:13 2021 +0200 drm/i915: Clean up FPGA_DBG/CLAIM_ER bits Use REG_BIT() & co. for FPGA_DBG/CLAIM_ER bits. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211112193813.8224-10-ville.syrjala@linux.intel.com Reviewed-by: Rodrigo Vivi commit e5f7e81ee430acb6d1fa9a6323fe645bd52e0b9c Author: Wolfram Sang Date: Wed Nov 10 20:16:09 2021 +0100 mmc: renesas_sdhi: Parse DT for SDnH If there is a SDnH clock provided in DT, let's use it instead of relying on the fallback. Signed-off-by: Wolfram Sang Acked-by: Ulf Hansson Link: https://lore.kernel.org/r/20211110191610.5664-21-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven commit 079e83b958a3c3d9c84e24b28478d57adc1cd7fe Author: Wolfram Sang Date: Wed Nov 10 20:16:08 2021 +0100 mmc: renesas_sdhi: Use dev_err_probe when getting clock fails This is to improve deferred probe in this driver and to keep consistent with an up-to-date handling of a soon to be added second clock. Signed-off-by: Wolfram Sang Acked-by: Ulf Hansson Link: https://lore.kernel.org/r/20211110191610.5664-20-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven commit d3a52bc41da0e4f7abd2df866a52b1e27c25aef5 Author: Wolfram Sang Date: Wed Nov 10 20:15:55 2021 +0100 clk: renesas: rcar-gen3: Remove outdated SD_SKIP_FIRST We handle it differently meanwhile. Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20211110191610.5664-7-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven commit bb6d3fa98a418b071c5f735e75558604f5f4af66 Author: Wolfram Sang Date: Wed Nov 10 20:15:54 2021 +0100 clk: renesas: rcar-gen3: Switch to new SD clock handling The old SD handling code was huge and could not handle all the details which showed up on R-Car Gen3 SoCs meanwhile. It is time to switch to another design. Have SDnH a separate clock, use the existing divider clocks and move the errata handling from the clock driver to the SDHI driver where it belongs. This patch removes the old SD handling code and switch to the new one. This updates the SDHI driver at the same time. Because the SDHI driver can only communicate with the clock driver via clk_set_rate(), I don't see an alternative to this flag-day-approach, so we cross subsystems here. The patch sadly looks messy for the CPG lib, but it is basically a huge chunk of code removed and smaller chunks added. It looks much better when you just view the resulting source file. Signed-off-by: Wolfram Sang Acked-by: Ulf Hansson # For MMC Link: https://lore.kernel.org/r/20211110191610.5664-6-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven commit 627151b4966fe68029cd14aa5fd81f5f0c67fa26 Author: Wolfram Sang Date: Wed Nov 10 20:15:53 2021 +0100 mmc: renesas_sdhi: Flag non-standard SDnH handling for V3M V3M handles SDnH differently than other Gen3 SoCs, so let's add a separate entry for that. This will allow better SDnH handling in the future. Signed-off-by: Wolfram Sang Acked-by: Ulf Hansson Link: https://lore.kernel.org/r/20211110191610.5664-5-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven commit 63494b6f98f26f45e0e7929654dd67d6715cc495 Author: Wolfram Sang Date: Wed Nov 10 20:15:52 2021 +0100 clk: renesas: r8a779a0: Add SDnH clock to V3U Currently a pass-through clock but we will make it a real divider clock in the next patches. Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20211110191610.5664-4-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven commit 1abd04480866cead7b4129bd03246315b4575334 Author: Wolfram Sang Date: Wed Nov 10 20:15:51 2021 +0100 clk: renesas: rcar-gen3: Add SDnH clock Currently a pass-through clock but we will make it a real divider clock in the next patches. Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20211110191610.5664-3-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven commit a31cf51bf6b4bf78ccb1c9fb40ea6231cf3df433 Author: Wolfram Sang Date: Wed Nov 10 20:15:50 2021 +0100 clk: renesas: rcar-gen3: Add dummy SDnH clock Currently, SDnH is handled together with SDn. This caused lots of problems, so we want SDnH as a separate clock. Introduce a dummy SDnH type here which creates a fixed-factor clock with factor 1. That allows us to convert the per-SoC CPG drivers while keeping the old behaviour for now. A later patch then will add the proper functionality. Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20211110191610.5664-2-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven commit c014e935596b2637e00dcd32077ac5019d9a7e64 Author: Yoshihiro Shimoda Date: Tue Nov 16 16:41:18 2021 +0900 dt-bindings: power: renesas,rcar-sysc: Document r8a779f0 SYSC bindings Document bindings for the R-Car S4-8 (aka R8A779F0) SYSC block. Signed-off-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20211116074130.107554-5-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Geert Uytterhoeven commit 06bd71cd2ebd98bb177fc7c35c10fed855781b82 Author: Yoshihiro Shimoda Date: Tue Nov 16 16:41:17 2021 +0900 dt-bindings: reset: renesas,rst: Document r8a779f0 reset module Document bindings for the R-Car S4-8 (R8A779F0) reset module. Signed-off-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20211116074130.107554-4-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Geert Uytterhoeven commit 663eede58f83783ff246573937615f0792788876 Author: Yoshihiro Shimoda Date: Tue Nov 16 16:41:15 2021 +0900 dt-bindings: arm: renesas: Document R-Car S4-8 SoC DT bindings Add device tree bindings documentation for Renesas R-Car S4-8 (r8a779f0). Signed-off-by: Yoshihiro Shimoda Link: https://lore.kernel.org/r/20211116074130.107554-2-yoshihiro.shimoda.uh@renesas.com Signed-off-by: Geert Uytterhoeven commit e051025efac3929ca7e3e2f2c8860d3447366ebc Author: Wolfram Sang Date: Mon Nov 15 17:06:00 2021 +0100 dt-bindings: mmc: renesas,sdhi: Add optional SDnH clock This only applies to R-Car Gen2 and later generations, so we need to distinguish. Signed-off-by: Wolfram Sang Acked-by: Ulf Hansson Link: https://lore.kernel.org/r/20211115160600.4455-1-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven commit 7c50a407b8687ae3589c740d2347d9ae73887889 Author: Geert Uytterhoeven Date: Wed Nov 17 10:59:32 2021 +0100 pinctrl: renesas: Remove unneeded locking around sh_pfc_read() calls There is no need to acquire the spinlock when reading from a pin controller register: 1. Reading a single MMIO register is an atomic operation, 2. While sh_pfc_phys_to_virt() inside sh_pfc_read() has to traverse all mapped windows to find the appropriate virtual address, this does not need any locking, as the window mappings are never changed. Signed-off-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/2008ca99f0079fd5d4e640b7ef78710c98cc9f77.1637143108.git.geert+renesas@glider.be commit 7dd4fdec402e196f7a5bf519ea1bdb14b358cfa2 Author: Lad Prabhakar Date: Wed Nov 17 01:12:47 2021 +0000 arm64: dts: renesas: rzg2l-smarc: Enable RSPI1 on carrier board RSPI1 (SPI1) interface is available on PMOD0 connector (J1) on the carrier board. This patch adds pinmux and spi1 nodes to the carrier board dtsi file. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20211117011247.27621-3-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit a5c29f61466995d0d2c1370c709ef7fda534d386 Author: Lad Prabhakar Date: Wed Nov 17 01:12:46 2021 +0000 arm64: dts: renesas: r9a07g044: Add RSPI{0,1,2} nodes Add RSPI{0,1,2} nodes to R9A07G044 (RZ/G2L) SoC DTSI. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20211117011247.27621-2-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit e1a9faddffe7e555304dc2e3284c84fbee0679ee Author: Biju Das Date: Mon Nov 15 14:28:30 2021 +0000 arm64: dts: renesas: cat875: Add rx/tx delays The CAT875 sub board from Silicon Linux uses a Realtek PHY. The phy driver commit bbc4d71d63549bcd003 ("net: phy: realtek: fix rtl8211e rx/tx delay config") introduced NFS mount failures. Now it needs both rx/tx delays for the NFS mount to work. This patch fixes the NFS mount failure issue by adding "rgmii-id" mode to the avb device node. Signed-off-by: Biju Das Fixes: bbc4d71d63549bcd ("net: phy: realtek: fix rtl8211e rx/tx delay config") Link: https://lore.kernel.org/r/20211115142830.12651-1-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit eca6ab6e362e3ae22b6c2769c4b6911bd0fb8ab1 Author: Wolfram Sang Date: Wed Nov 10 20:16:01 2021 +0100 arm64: dts: reneas: rcar-gen3: Add SDnH clocks Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20211110191610.5664-13-wsa+renesas@sang-engineering.com Link: https://lore.kernel.org/r/20211110191610.5664-14-wsa+renesas@sang-engineering.com Link: https://lore.kernel.org/r/20211110191610.5664-15-wsa+renesas@sang-engineering.com Link: https://lore.kernel.org/r/20211110191610.5664-16-wsa+renesas@sang-engineering.com Link: https://lore.kernel.org/r/20211110191610.5664-17-wsa+renesas@sang-engineering.com Link: https://lore.kernel.org/r/20211110191610.5664-18-wsa+renesas@sang-engineering.com Link: https://lore.kernel.org/r/20211110191610.5664-19-wsa+renesas@sang-engineering.com Link: https://lore.kernel.org/r/20211110191610.5664-22-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven commit 52e844ee9a6f460e6160736a43ef13317a91ca74 Author: Wolfram Sang Date: Wed Nov 10 20:15:57 2021 +0100 arm64: dts: reneas: rzg2: Add SDnH clocks Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20211110191610.5664-9-wsa+renesas@sang-engineering.com Link: https://lore.kernel.org/r/20211110191610.5664-10-wsa+renesas@sang-engineering.com Link: https://lore.kernel.org/r/20211110191610.5664-11-wsa+renesas@sang-engineering.com Link: https://lore.kernel.org/r/20211110191610.5664-12-wsa+renesas@sang-engineering.com Signed-off-by: Geert Uytterhoeven commit 1507b153198137dfa9cb4bec7c5dee07089ec3af Author: Lorenzo Bianconi Date: Wed Oct 27 11:03:42 2021 +0200 cfg80211: move offchan_cac_event to a dedicated work In order to make cfg80211_offchan_cac_abort() (renamed from cfg80211_offchan_cac_event) callable in other contexts and without so much locking restrictions, make it trigger a new work instead of operating directly. Do some other renames while at it to clarify. Signed-off-by: Lorenzo Bianconi Link: https://lore.kernel.org/r/6145c3d0f30400a568023f67981981d24c7c6133.1635325205.git.lorenzo@kernel.org [rewrite commit log] Signed-off-by: Johannes Berg commit f5d32a7b10713427655a14d4777af7f598d3c1fa Author: Colin Ian King Date: Tue Oct 26 10:40:00 2021 +0100 mac80211_hwsim: Fix spelling mistake "Droping" -> "Dropping" There is a spelling mistake in a comment, fix it. Signed-off-by: Colin Ian King Link: https://lore.kernel.org/r/20211026094000.209463-1-colin.i.king@gmail.com Signed-off-by: Johannes Berg commit 237337c230b94e78a5a0f88d1705259ab543fc40 Author: Lorenzo Bianconi Date: Sat Oct 23 11:10:51 2021 +0200 mac80211: introduce set_radar_offchan callback Similar to cfg80211, introduce set_radar_offchan callback in mac80211_ops in order to configure a dedicated offchannel chain available on some hw (e.g. mt7915) to perform offchannel CAC detection and avoid tx/rx downtime. Tested-by: Evelyn Tsai Signed-off-by: Lorenzo Bianconi Link: https://lore.kernel.org/r/201110606d4f3a7dfdf31440e351f2e2c375d4f0.1634979655.git.lorenzo@kernel.org Signed-off-by: Johannes Berg commit bc2dfc02836b1133d1bf4d22aa13d48ac98eabef Author: Lorenzo Bianconi Date: Sat Oct 23 11:10:50 2021 +0200 cfg80211: implement APIs for dedicated radar detection HW If a dedicated (off-channel) radar detection hardware (chain) is available in the hardware/driver, allow this to be used by calling the NL80211_CMD_RADAR_DETECT command with a new flag attribute requesting off-channel radar detection is used. Offchannel CAC (channel availability check) avoids the CAC downtime when switching to a radar channel or when turning on the AP. Drivers advertise support for this using the new feature flag NL80211_EXT_FEATURE_RADAR_OFFCHAN. Tested-by: Evelyn Tsai Signed-off-by: Lorenzo Bianconi Link: https://lore.kernel.org/r/7468e291ef5d05d692c1738d25b8f778d8ea5c3f.1634979655.git.lorenzo@kernel.org Link: https://lore.kernel.org/r/1e60e60fef00e14401adae81c3d49f3e5f307537.1634979655.git.lorenzo@kernel.org Link: https://lore.kernel.org/r/85fa50f57fc3adb2934c8d9ca0be30394de6b7e8.1634979655.git.lorenzo@kernel.org Link: https://lore.kernel.org/r/4b6c08671ad59aae0ac46fc94c02f31b1610eb72.1634979655.git.lorenzo@kernel.org Link: https://lore.kernel.org/r/241849ccaf2c228873c6f8495bf87b19159ba458.1634979655.git.lorenzo@kernel.org [remove offchan_mutex, fix cfg80211_stop_offchan_radar_detection(), remove gfp_t argument, fix documentation, fix tracing] Signed-off-by: Johannes Berg commit f7c151d86487eec720f52843133bce270b07fecc Author: Andy Shevchenko Date: Fri Nov 5 14:42:42 2021 +0200 gpio: mockup: Switch to use kasprintf_strarray() Since we have a generic helper, switch the module to use it. No functional change intended. Signed-off-by: Andy Shevchenko Acked-by: Bartosz Golaszewski Reviewed-by: Linus Walleij commit 54784ff24971ed5bd3f1056edce998148709d0a7 Author: Andy Shevchenko Date: Fri Nov 5 14:42:41 2021 +0200 pinctrl: zynqmp: Unify pin naming Since we have devm_kasprintf_strarray() helper, which is used in the rest of pin control drivers, it makes sense to switch this driver to it. The pin names are not part of any ABI and hence there will be no regression based on that. Otherwise all generated pin names will follow the same schema in the pin control subsystem. Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij commit 5c16f7ee03c011b0c6cd4c6deccaf0b269d054b2 Merge: 379e4de9e1408 ac5d272a0ad04 Author: Ingo Molnar Date: Fri Nov 19 09:31:55 2021 +0100 Merge branch 'x86/urgent' into x86/sgx, to resolve conflict Conflicts: arch/x86/kernel/cpu/sgx/main.c Signed-off-by: Ingo Molnar commit 5125b9a9c420ee91e2c258ea96a8261a49e7449d Author: Peter Seiderer Date: Tue Nov 16 23:07:20 2021 +0100 ath9k: fix intr_txqs setting The struct ath_hw member intr_txqs is never reset/assigned outside of ath9k_hw_init_queues() and with the used bitwise-or in the interrupt handling ar9002_hw_get_isr() accumulates all ever set interrupt flags. Fix this by using a pure assign instead of bitwise-or for the first line (note: intr_txqs is only evaluated in case ATH9K_INT_TX bit is set). Signed-off-by: Peter Seiderer Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211116220720.30145-1-ps.report@gmx.net commit 081e2d6476e30399433b509684d5da4d1844e430 Author: Seevalamuthu Mariappan Date: Wed Nov 17 09:39:41 2021 +0200 ath11k: add hw_param for wakeup_mhi Wakeup mhi is needed before pci_read/write only for QCA6390 and WCN6855. Since wakeup & release mhi is enabled for all hardwares, below mhi assert is seen in QCN9074 when doing 'rmmod ath11k_pci': Kernel panic - not syncing: dev_wake != 0 CPU: 2 PID: 13535 Comm: procd Not tainted 4.4.60 #1 Hardware name: Generic DT based system [<80316dac>] (unwind_backtrace) from [<80313700>] (show_stack+0x10/0x14) [<80313700>] (show_stack) from [<805135dc>] (dump_stack+0x7c/0x9c) [<805135dc>] (dump_stack) from [<8032136c>] (panic+0x84/0x1f8) [<8032136c>] (panic) from [<80549b24>] (mhi_pm_disable_transition+0x3b8/0x5b8) [<80549b24>] (mhi_pm_disable_transition) from [<80549ddc>] (mhi_power_down+0xb8/0x100) [<80549ddc>] (mhi_power_down) from [<7f5242b0>] (ath11k_mhi_op_status_cb+0x284/0x3ac [ath11k_pci]) [E][__mhi_device_get_sync] Did not enter M0 state, cur_state:RESET pm_state:SHUTDOWN Process [E][__mhi_device_get_sync] Did not enter M0 state, cur_state:RESET pm_state:SHUTDOWN Process [E][__mhi_device_get_sync] Did not enter M0 state, cur_state:RESET pm_state:SHUTDOWN Process [<7f5242b0>] (ath11k_mhi_op_status_cb [ath11k_pci]) from [<7f524878>] (ath11k_mhi_stop+0x10/0x20 [ath11k_pci]) [<7f524878>] (ath11k_mhi_stop [ath11k_pci]) from [<7f525b94>] (ath11k_pci_power_down+0x54/0x90 [ath11k_pci]) [<7f525b94>] (ath11k_pci_power_down [ath11k_pci]) from [<8056b2a8>] (pci_device_shutdown+0x30/0x44) [<8056b2a8>] (pci_device_shutdown) from [<805cfa0c>] (device_shutdown+0x124/0x174) [<805cfa0c>] (device_shutdown) from [<8033aaa4>] (kernel_restart+0xc/0x50) [<8033aaa4>] (kernel_restart) from [<8033ada8>] (SyS_reboot+0x178/0x1ec) [<8033ada8>] (SyS_reboot) from [<80301b80>] (ret_fast_syscall+0x0/0x34) Hence, disable wakeup/release mhi using hw_param for other hardwares. Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01060-QCAHKSWPL_SILICONZ-1 Fixes: a05bd8513335 ("ath11k: read and write registers below unwindowed address") Signed-off-by: Seevalamuthu Mariappan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1636702019-26142-1-git-send-email-quic_seevalam@quicinc.com commit dacef016c088f8f69fe1e6e5feab3543df3dab83 Author: Aurelien Jarno Date: Mon Nov 8 22:46:29 2021 +0100 riscv: dts: enable more DA9063 functions for the SiFive HiFive Unmatched The DA9063 PMIC found on the SiFive HiFive Unmatched also provides an RTC, a watchdog and the power button input. Signed-off-by: Aurelien Jarno Signed-off-by: Palmer Dabbelt commit ea8587d9de22aa08e1449779c59687407f7de21e Author: Martin Weber Date: Tue Nov 9 11:43:09 2021 +0000 media: coda: V4L2_PIX_FMT_GREY for coda960 JPEG Encoder support greyscale pix fmt input for coda9_jpeg_encoder. The hardware supports it, so allow V4L2 Mem2Mem JPEG Encoder use it as well. Tested on an i.MX6QP. [hverkuil: updated the Subject line as suggested by Philipp] Signed-off-by: Martin Weber Reviewed-by: Philipp Zabel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit dca7cc1cbd998f6765ba331c89eec5ed205b48d9 Author: Niklas Söderlund Date: Mon Nov 8 16:02:17 2021 +0000 media: rcar-vin: Free buffers with error if hardware stop fails The driver already has logic to detect if it fails to stop properly and report this error to the user. The driver however did not report the unused buffers or buffers given to the hardware (if any) with an error, the buffers where instead returned to user-space in the active state. Build on the existing detection of the error condition and correctly return the buffers with an error if it triggers. Signed-off-by: Niklas Söderlund Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 0bbaec386cc1f410f4deb8e0ec310096ec1fdef1 Author: Dorota Czaplejewicz Date: Thu Nov 4 11:41:53 2021 +0000 media: imx: Remove unused functions Neither imx_media_mbus_fmt_to_ipu_image nor imx_media_ipu_image_to_mbus_fmt were used anywhere. Signed-off-by: Dorota Czaplejewicz Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 6aa6e70cdb5b863a57bad61310bf89b6617a5d2d Author: Johan Hovold Date: Mon Oct 25 13:16:41 2021 +0100 media: stk1160: fix control-message timeouts USB control-message timeouts are specified in milliseconds and should specifically not vary with CONFIG_HZ. Fixes: 9cb2173e6ea8 ("[media] media: Add stk1160 new driver (easycap replacement)") Cc: stable@vger.kernel.org # 3.7 Signed-off-by: Johan Hovold Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit f71d272ad4e354097020a4e6b1dc6e4b59feb50f Author: Johan Hovold Date: Mon Oct 25 13:16:40 2021 +0100 media: s2255: fix control-message timeouts USB control-message timeouts are specified in milliseconds and should specifically not vary with CONFIG_HZ. Use the common control-message timeout define for the five-second timeouts. Fixes: 38f993ad8b1f ("V4L/DVB (8125): This driver adds support for the Sensoray 2255 devices.") Cc: stable@vger.kernel.org # 2.6.27 Signed-off-by: Johan Hovold Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit b82bf9b9dc305d7d3d93eab106d70dbf2171b43e Author: Johan Hovold Date: Mon Oct 25 13:16:39 2021 +0100 media: pvrusb2: fix control-message timeouts USB control-message timeouts are specified in milliseconds and should specifically not vary with CONFIG_HZ. Fixes: d855497edbfb ("V4L/DVB (4228a): pvrusb2 to kernel 2.6.18") Cc: stable@vger.kernel.org # 2.6.18 Signed-off-by: Johan Hovold Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d9b7e8df3aa9b8c10708aab60e72e79ac08237e4 Author: Johan Hovold Date: Mon Oct 25 13:16:38 2021 +0100 media: em28xx: fix control-message timeouts USB control-message timeouts are specified in milliseconds and should specifically not vary with CONFIG_HZ. Fixes: a6c2ba283565 ("[PATCH] v4l: 716: support for em28xx board family") Cc: stable@vger.kernel.org # 2.6.16 Signed-off-by: Johan Hovold Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 10729be03327f53258cb196362015ad5c6eabe02 Author: Johan Hovold Date: Mon Oct 25 13:16:37 2021 +0100 media: cpia2: fix control-message timeouts USB control-message timeouts are specified in milliseconds and should specifically not vary with CONFIG_HZ. Fixes: ab33d5071de7 ("V4L/DVB (3376): Add cpia2 camera support") Cc: stable@vger.kernel.org # 2.6.17 Signed-off-by: Johan Hovold Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit cd1798a387825cc4a51282f5a611ad05bb1ad75f Author: Johan Hovold Date: Mon Oct 25 13:16:36 2021 +0100 media: flexcop-usb: fix control-message timeouts USB control-message timeouts are specified in milliseconds and should specifically not vary with CONFIG_HZ. Note that the driver was multiplying some of the timeout values with HZ twice resulting in 3000-second timeouts with HZ=1000. Also note that two of the timeout defines are currently unused. Fixes: 2154be651b90 ("[media] redrat3: new rc-core IR transceiver device driver") Cc: stable@vger.kernel.org # 3.0 Signed-off-by: Johan Hovold Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 2adc965c8bfa224e11ecccf9c92fd458c4236428 Author: Johan Hovold Date: Mon Oct 25 13:16:35 2021 +0100 media: redrat3: fix control-message timeouts USB control-message timeouts are specified in milliseconds and should specifically not vary with CONFIG_HZ. Fixes: 2154be651b90 ("[media] redrat3: new rc-core IR transceiver device driver") Cc: stable@vger.kernel.org # 3.0 Signed-off-by: Johan Hovold Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 16394e998cbb050730536bdf7e89f5a70efbd974 Author: Johan Hovold Date: Mon Oct 25 13:16:34 2021 +0100 media: mceusb: fix control-message timeouts USB control-message timeouts are specified in milliseconds and should specifically not vary with CONFIG_HZ. Fixes: 66e89522aff7 ("V4L/DVB: IR: add mceusb IR receiver driver") Cc: stable@vger.kernel.org # 2.6.36 Signed-off-by: Johan Hovold Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 10d0f56800b31320d06ada90e64d374862544841 Author: Dafna Hirschfeld Date: Fri Oct 22 16:04:10 2021 +0100 media: mtk-vcodec: remove unused func parameter The prarameter bs_size to function vpu_enc_encode is not used. Remove it. Signed-off-by: Dafna Hirschfeld Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 37365b050d63b11727ffa43c58845cf71dcd698f Author: Dafna Hirschfeld Date: Fri Oct 22 16:04:08 2021 +0100 media: mtk-vcodec: enc: add vp8 profile ctrl In order for the encoder to work with gstreamer it needs to have the V4L2_CID_MPEG_VIDEO_VP8_PROFILE ctrl. This patch adds that ctrl with only profile 0 supported. Signed-off-by: Dafna Hirschfeld Acked-by: Nicolas Dufresne Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 659109a45c6c5a3c81a8ce35dea59318c44cfa6e Author: Geert Uytterhoeven Date: Sat Nov 6 17:47:41 2021 +0100 scsi: ufs: Fix double space in SCSI_UFS_HWMON description There's no reason to have a double space between "UFS" and "Temperature", hence drop it. Link: https://lore.kernel.org/r/20211106164741.1571206-1-geert@linux-m68k.org Fixes: e88e2d32200a ("scsi: ufs: core: Probe for temperature notification support") Signed-off-by: Geert Uytterhoeven Signed-off-by: Martin K. Petersen commit d28a78537d1d79f1ba6b9e68f5d44cc869045afe Author: Geert Uytterhoeven Date: Sat Nov 6 17:46:50 2021 +0100 scsi: ufs: Wrap Universal Flash Storage drivers in SCSI_UFSHCD The build only descends into drivers/scsi/ufs/ if SCSI_UFSHCD is enabled. Hence all later config symbols should depend on SCSI_UFSHCD to prevent asking the user about config symbols for driver code that won't be built anyway. Unfortunately not all symbols have that dependency. Fix this by wrapping them all into a big if/endif block. Remove the now superfluous explicit dependencies on SCSI_UFSHCD from all symbols that already had it. Link: https://lore.kernel.org/r/20211106164650.1571068-1-geert@linux-m68k.org Signed-off-by: Geert Uytterhoeven Signed-off-by: Martin K. Petersen commit 0137b129f215fb5d0209c5c91984b2f44f2d98cc Author: Changyuan Lyu Date: Mon Nov 15 13:57:50 2021 -0800 scsi: pm80xx: Add pm80xx_mpi_build_cmd() tracepoint pm8001_mpi_build_cmd() prepares and sends all commands to a controller. Having pm80xx_mpi_build_cmd tracepoint can help us with latency issues. this patch depends on patch "scsi: pm80xx: Add tracepoints". Link: https://lore.kernel.org/r/20211115215750.131696-3-changyuanl@google.com Acked-by: Jack Wang Co-developed-by: Igor Pylypiv Signed-off-by: Igor Pylypiv Signed-off-by: Changyuan Lyu Signed-off-by: Martin K. Petersen commit 8ceddda38d4272683fe0c5d8f310109affae0b63 Author: Changyuan Lyu Date: Mon Nov 15 13:57:49 2021 -0800 scsi: pm80xx: Add tracepoints Tracepoints for tracking controller and ATA commands issued and completed. Link: https://lore.kernel.org/r/20211115215750.131696-2-changyuanl@google.com Acked-by: Jack Wang Co-developed-by: Akshat Jain Signed-off-by: Akshat Jain Signed-off-by: Changyuan Lyu Signed-off-by: Martin K. Petersen commit 853615582d6f99c0a4b4424a63b4f01aa8fcebef Author: Igor Pylypiv Date: Mon Nov 1 16:28:25 2021 -0700 scsi: pm80xx: Use bitmap_zalloc() for tags bitmap allocation We used to allocate X bytes while we only need X bits. Link: https://lore.kernel.org/r/20211101232825.2350233-5-ipylypiv@google.com Reviewed-by: Vishakha Channapattan Acked-by: Jack Wang Signed-off-by: Igor Pylypiv Signed-off-by: Martin K. Petersen commit 606c54ae975ad3af540b505b46b55a687501711f Author: Igor Pylypiv Date: Mon Nov 1 16:28:24 2021 -0700 scsi: pm80xx: Update WARN_ON check in pm8001_mpi_build_cmd() Starting from commit 05c6c029a44d ("scsi: pm80xx: Increase number of supported queues") driver initializes only max_q_num queues. Do not use an invalid queue if the WARN_ON condition is true. Link: https://lore.kernel.org/r/20211101232825.2350233-4-ipylypiv@google.com Fixes: 7640e1eb8c5d ("scsi: pm80xx: Make mpi_build_cmd locking consistent") Reviewed-by: Vishakha Channapattan Acked-by: Jack Wang Signed-off-by: Igor Pylypiv Signed-off-by: Martin K. Petersen commit 60de1a67d66db11319a82bd95f11c2b12b75dee0 Author: Igor Pylypiv Date: Mon Nov 1 16:28:23 2021 -0700 scsi: pm80xx: Do not check the address-of value for NULL Address-of operator cannot return NULL. Link: https://lore.kernel.org/r/20211101232825.2350233-3-ipylypiv@google.com Reviewed-by: Vishakha Channapattan Acked-by: Jack Wang Signed-off-by: Igor Pylypiv Signed-off-by: Martin K. Petersen commit 744798fcd2b31b806ebf09f86989cbf2806fa9ea Author: Igor Pylypiv Date: Mon Nov 1 16:28:22 2021 -0700 scsi: pm80xx: Apply byte mask for phy ID in mpi_phy_start_resp() Phy ID is located in the least significant byte of the 4-byte field. mpi_phy_stop_resp() already applies such mask. Link: https://lore.kernel.org/r/20211101232825.2350233-2-ipylypiv@google.com Reviewed-by: Vishakha Channapattan Acked-by: Jack Wang Signed-off-by: Igor Pylypiv Signed-off-by: Martin K. Petersen commit adcc796b4f55c18ee5fca8190a592c84cf8682e0 Author: Chunguang Xu Date: Wed Nov 10 09:23:32 2021 +0800 scsi: core: Use eh_timeout for START STOP UNIT In some scenarios START STOP UNIT may time out. The default recovery time of 30 seconds is relatively large. Modifying rq_timeout to adjust the START STOP UNIT timeout value will affect the regular I/O. Commit 9728c0814ecb ("[SCSI] make scsi_eh_try_stu use block timeout") switched to rq_timeout for the START STOP UNIT command. However commit 0816c9251a71 ("[SCSI] Allow error handling timeout to be specified") introduced an explicit eh_timeout parameter. It makes more sense to use this value as the timeout for START STOP UNIT. Link: https://lore.kernel.org/r/1636507412-21678-1-git-send-email-brookxu.cn@gmail.com Reviewed-by: Christoph Hellwig Reviewed-by: Wu Bo Signed-off-by: Chunguang Xu Signed-off-by: Martin K. Petersen commit 0a84486d6c1da1c2738544d8fc1b07b1d3ce046f Author: Bart Van Assche Date: Tue Nov 16 14:31:15 2021 -0800 scsi: core: Remove Scsi_Host.shost_dev_attr_groups Simplify the scsi_host_alloc() implementation by setting the shost_class .dev_groups member instead of copying all host attribute group pointers into the shost_dev_attr_groups[] array. Link: https://lore.kernel.org/r/20211116223115.2103031-1-bvanassche@acm.org Cc: Steffen Maier Cc: Damien Le Moal Suggested-by: Benjamin Block Reviewed-by: Damien Le Moal Signed-off-by: Bart Van Assche Signed-off-by: Martin K. Petersen commit 54d816d3d36293728ffc8488fae14b002d4b4a64 Author: Ewan D. Milne Date: Fri Oct 29 15:43:11 2021 -0400 scsi: core: Simplify control flow in scmd_eh_abort_handler() Simplify the nested conditionals in the function by using a label for the error path. Introduce local "shost" to avoid repeated "sdev->shost" usage. Also remove scsi_eh_complete_abort() since there is now only one place it would be called. Link: https://lore.kernel.org/r/20211029194311.17504-3-emilne@redhat.com Signed-off-by: Ewan D. Milne Signed-off-by: Martin K. Petersen commit 3b1abcf1289466eca4c46db8b55c06422f0abf34 Merge: 50fc24944a2a0 02d6fdecb9c38 Author: Jakub Kicinski Date: Thu Nov 18 17:50:18 2021 -0800 Merge tag 'regmap-no-bus-update-bits' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap Mark Brown says: =================== regmap: Allow regmap_update_bits() to be offloaded with no bus Some hardware can do this so let's use that capability. =================== Link: https://lore.kernel.org/all/YZWDOidBOssP10yS@sirena.org.uk/ Signed-off-by: Jakub Kicinski commit b2e7d636d9ad5dc7e84a95b004345cdd2fc82b2d Author: Manasi Navare Date: Tue Nov 16 15:12:09 2021 -0800 drm/i915/: Extend VRR platform support to Gen 11 VRR is supported on Gen 11 HW , hence extend the support in the driver to enable this for Gen 11. Cc: Ville Syrjälä Signed-off-by: Manasi Navare Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211116231209.28621-1-manasi.d.navare@intel.com commit 1cd3921aa95ebf4a6d1f93fb736449441c530aa1 Author: Shawn Guo Date: Mon Nov 8 21:44:42 2021 +0800 soc: qcom: rpmpd: Add QCM2290 support QCM2290 has the same RPM power domains as SM6115. Add QCM2290 support by reusing SM6115 power domains. Signed-off-by: Shawn Guo Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211108134442.30051-4-shawn.guo@linaro.org commit 2475fcfbe4e383d586c5a58711e436d83a2bdfe6 Author: Shawn Guo Date: Mon Nov 8 21:44:41 2021 +0800 dt-bindings: power: rpmpd: Add QCM2290 support Add compatible and constants for the power domains exposed by the QCM2290 RPM. Signed-off-by: Shawn Guo Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211108134442.30051-3-shawn.guo@linaro.org commit 7ba9dd0d04a8af868bc0785d79bde4ac0240328f Author: Shawn Guo Date: Mon Nov 8 21:44:40 2021 +0800 soc: qcom: rpmpd: Drop unused res_name from struct rpmpd The res_name field in struct rpmpd is unused. Drop it. Signed-off-by: Shawn Guo Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211108134442.30051-2-shawn.guo@linaro.org commit 50fc24944a2a0ef5aab571dcac17f6c5f2613f56 Merge: bb8cecf8ba127 8d0112ac6fd00 Author: Jakub Kicinski Date: Thu Nov 18 13:13:16 2021 -0800 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net Signed-off-by: Jakub Kicinski commit c78b9a9cbde5fe07ae7c3cc3789e43349db8c437 Author: Naveen Naidu Date: Thu Nov 18 19:33:35 2021 +0530 PCI: xgene: Use PCI_ERROR_RESPONSE to identify config read errors Include PCI_ERROR_RESPONSE along with 0xffffffff in the comment about identifying config read errors. This makes checks for config read errors easier to find. Comment change only. Link: https://lore.kernel.org/r/388b9733bd55394581c447be9f3df42ca2c9759c.1637243717.git.naveennaidu479@gmail.com Signed-off-by: Naveen Naidu Signed-off-by: Bjorn Helgaas commit 14e04d0d5ed065ae712911589b94edff8e7d406b Author: Naveen Naidu Date: Thu Nov 18 19:33:34 2021 +0530 PCI: hv: Use PCI_ERROR_RESPONSE to identify config read errors Include PCI_ERROR_RESPONSE along with 0xFFFFFFFF in the comment about identifying config read errors. This makes checks for config read errors easier to find. Comment change only. Link: https://lore.kernel.org/r/12124f41cab7d8aa944de05f85d9567bfe157704.1637243717.git.naveennaidu479@gmail.com Signed-off-by: Naveen Naidu Signed-off-by: Bjorn Helgaas commit 3cfdef7a57a230c68aa981607d402fab428b662d Author: Naveen Naidu Date: Thu Nov 18 19:33:33 2021 +0530 PCI: keystone: Use PCI_ERROR_RESPONSE to identify config read errors Include PCI_ERROR_RESPONSE along with 0xffffffff in the comment about identifying config read errors. This makes checks for config read errors easier to find. Comment change only. Link: https://lore.kernel.org/r/6ae6b071d92052dc511407513e2a7c0035aff9e7.1637243717.git.naveennaidu479@gmail.com Signed-off-by: Naveen Naidu Signed-off-by: Bjorn Helgaas commit 289e3ea3a506e02f8d4a6a68d6cc0775f4d232c1 Author: Naveen Naidu Date: Thu Nov 18 19:33:32 2021 +0530 PCI: Use PCI_ERROR_RESPONSE to identify config read errors Include PCI_ERROR_RESPONSE along with 0xFFFF and 0xFFFFFFFF in the comment about identifying config read errors. This makes checks for config read errors easier to find. Comment change only. Link: https://lore.kernel.org/r/866e2db544df45af70df7e64659bf02e03998ae3.1637243717.git.naveennaidu479@gmail.com Signed-off-by: Naveen Naidu Signed-off-by: Bjorn Helgaas commit 99510e1afb4863a225207146bd988064c5fd0629 Author: Ville Syrjälä Date: Thu Oct 14 21:18:56 2021 +0300 drm/i915: Disable DSB usage for now Turns out the DSB has trouble correctly loading the gamma LUT. From a cursory look maybe like some entries do not load properly, or they get loaded with some gibberish. Unfortunately our current kms_color/etc. tests do not seem to catch this. I had a brief look at the generated DSB batch and it looked correct. Tried a few quick tricks like writing the index register twice/etc. but didn't see any improvement. Also tried switching to the 10bit gamma mode in case there is yet another issue with the multi-segment mode, but even the 10bit mode was showing issues. Switching to mmio fixes all of it. I suppose one theory is that maybe the DSB bangs on the LUT too quickly and it can't keep up and instead some data either gets dropped or corrupted. To confirm that someone should try to slow down the DSB's progress a bit. Another thought was that maybe the LUT has crappy dual porting and you get contention if you try to load it during active scanout. But why then would the mmio path work, unless it's just sufficiently slow? Whatever the case, this is currently busted so let's disable it until we get to the root of the problem. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/3916 Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211014181856.17581-2-ville.syrjala@linux.intel.com Reviewed-by: Uma Shankar commit a37795cbdff243c198d9cf9615bd5d016bbfd546 Author: Ville Syrjälä Date: Thu Oct 14 21:18:55 2021 +0300 drm/i915: Declare .(de)gamma_lut_tests for icl+ All interpolated gamma modes including the icl+ multi segment mode require non-decreasing entries for the interpolation to work correctly. For some reason we're forgetting to declare that for icl+. Let us do so. References: https://gitlab.freedesktop.org/drm/intel/-/issues/3916 Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211014181856.17581-1-ville.syrjala@linux.intel.com Reviewed-by: Uma Shankar commit 9cca74b51ea543f4f64464b0347ff5d43a4e57ba Author: Ville Syrjälä Date: Wed Nov 17 20:31:03 2021 +0200 drm/i915: Fix framestart_delay commens in VRR code Since I originally wrote these comments we decided to change our definition of framestart_delay from 0-3 to 1-4. Adjust the comments to match that new convention. The actual code was adjusted already. Cc: Manasi Navare Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211117183103.27418-3-ville.syrjala@linux.intel.com Reviewed-by: Manasi Navare commit 0088d39b6ad9f7d814c10e7188aba0ddbc737883 Author: Ville Syrjälä Date: Wed Nov 17 20:31:02 2021 +0200 drm/i915: Do vblank evasion correctly if vrr push has already been sent Let's adjust the vblank evasion to account for the case where a push has already been sent. In that case the vblank exit will start at vmin vblank start (as opposed to vmax vblank start when no push has been sent). This should minimize the effects of the tiny race between sampling the frame counter vs. intel_vrr_send_push() during the previous frame. This will also be required if we want to do mailbox style updates with vrr since then we'd definitely do multiple commits per frame. Currently mailbox updates are only used by the legacy cursor, but we don't do vrr push for those. Cc: Manasi Navare Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211117183103.27418-2-ville.syrjala@linux.intel.com Reviewed-by: Manasi Navare commit bd9ccaec6ac998196baa11380ad4651a7df62ef0 Author: Jason Wang Date: Sat Nov 13 13:53:58 2021 +0800 soc: qcom: qmi: Fix a typo in a comment The double word `client' in a comment is repeated, thus one of them should be removed. Signed-off-by: Jason Wang Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211113055358.206533-1-wangborong@cdjrlc.com commit a18a025c2fb5fbf2d1d0606ea0d7441ac90e9c39 Author: Naveen Naidu Date: Thu Nov 18 19:33:31 2021 +0530 PCI: cpqphp: Use PCI_POSSIBLE_ERROR() to check config reads When config pci_ops.read() can detect failed PCI transactions, the data returned to the CPU is PCI_ERROR_RESPONSE (~0 or 0xffffffff). Obviously a successful PCI config read may *also* return that data if a config register happens to contain ~0, so it doesn't definitively indicate an error unless we know the register cannot contain ~0. Use PCI_POSSIBLE_ERROR() to check the response we get when we read data from hardware. This unifies PCI error response checking and makes error checks consistent and easier to find. Link: https://lore.kernel.org/r/b12005c0d57bb9d4c8b486724d078b7bd92f8321.1637243717.git.naveennaidu479@gmail.com Signed-off-by: Naveen Naidu Signed-off-by: Bjorn Helgaas commit aa66ea10ba843d35582afaadc0b2f60af063b806 Author: Naveen Naidu Date: Thu Nov 18 19:33:30 2021 +0530 PCI/PME: Use PCI_POSSIBLE_ERROR() to check config reads When config pci_ops.read() can detect failed PCI transactions, the data returned to the CPU is PCI_ERROR_RESPONSE (~0 or 0xffffffff). Obviously a successful PCI config read may *also* return that data if a config register happens to contain ~0, so it doesn't definitively indicate an error unless we know the register cannot contain ~0. Use PCI_POSSIBLE_ERROR() to check the response we get when we read data from hardware. This unifies PCI error response checking and makes error checks consistent and easier to find. Compile tested only. Link: https://lore.kernel.org/r/679ce049bccf10df3ca9ef4918ee2c3235afdaea.1637243717.git.naveennaidu479@gmail.com Signed-off-by: Naveen Naidu Signed-off-by: Bjorn Helgaas commit 0242132da26a928801cbb6ab96daf77e7815e084 Author: Naveen Naidu Date: Thu Nov 18 19:33:29 2021 +0530 PCI/DPC: Use PCI_POSSIBLE_ERROR() to check config reads When config pci_ops.read() can detect failed PCI transactions, the data returned to the CPU is PCI_ERROR_RESPONSE (~0 or 0xffffffff). Obviously a successful PCI config read may *also* return that data if a config register happens to contain ~0, so it doesn't definitively indicate an error unless we know the register cannot contain ~0. Use PCI_POSSIBLE_ERROR() to check the response we get when we read data from hardware. This unifies PCI error response checking and makes error checks consistent and easier to find. Compile tested only. Link: https://lore.kernel.org/r/9b0632f1f183432149f495cf12bdd5a72cc597a4.1637243717.git.naveennaidu479@gmail.com Signed-off-by: Naveen Naidu Signed-off-by: Bjorn Helgaas commit a3b0f10db148f57591bd4559f01246a06a6a7e72 Author: Naveen Naidu Date: Thu Nov 18 19:33:28 2021 +0530 PCI: pciehp: Use PCI_POSSIBLE_ERROR() to check config reads When config pci_ops.read() can detect failed PCI transactions, the data returned to the CPU is PCI_ERROR_RESPONSE (~0 or 0xffffffff). Obviously a successful PCI config read may *also* return that data if a config register happens to contain ~0, so it doesn't definitively indicate an error unless we know the register cannot contain ~0. Use PCI_POSSIBLE_ERROR() to check the response we get when we read data from hardware. This unifies PCI error response checking and makes error checks consistent and easier to find. Compile tested only. Link: https://lore.kernel.org/r/e185b052fbfd530df703a36dd31126cb870eed95.1637243717.git.naveennaidu479@gmail.com Signed-off-by: Naveen Naidu Signed-off-by: Bjorn Helgaas Acked-by: Lukas Wunner commit 242f288e82a34b4c10f87e121b0755056675e55d Author: Naveen Naidu Date: Thu Nov 18 19:33:27 2021 +0530 PCI: vmd: Use PCI_POSSIBLE_ERROR() to check config reads When config pci_ops.read() can detect failed PCI transactions, the data returned to the CPU is PCI_ERROR_RESPONSE (~0 or 0xffffffff). Obviously a successful PCI config read may *also* return that data if a config register happens to contain ~0, so it doesn't definitively indicate an error unless we know the register cannot contain ~0. Use PCI_POSSIBLE_ERROR() to check the response we get when we read data from hardware. This unifies PCI error response checking and makes error checks consistent and easier to find. Link: https://lore.kernel.org/r/ed01cad87a2e35f3865275b5fb34290817a1ebf8.1637243717.git.naveennaidu479@gmail.com Signed-off-by: Naveen Naidu Signed-off-by: Bjorn Helgaas Reviewed-by: Jonathan Derrick commit fa52b6447ce1cc0157c89dac7762f1693deeb10e Author: Naveen Naidu Date: Thu Nov 18 19:33:26 2021 +0530 PCI/ERR: Use PCI_POSSIBLE_ERROR() to check config reads When config pci_ops.read() can detect failed PCI transactions, the data returned to the CPU is PCI_ERROR_RESPONSE (~0 or 0xffffffff). Obviously a successful PCI config read may *also* return that data if a config register happens to contain ~0, so it doesn't definitively indicate an error unless we know the register cannot contain ~0. Use PCI_POSSIBLE_ERROR() to check the response we get when we read data from hardware. This unifies PCI error response checking and makes error checks consistent and easier to find. Link: https://lore.kernel.org/r/f4d18d470cb90f9cb52ea155b01528ba2e76e8d6.1637243717.git.naveennaidu479@gmail.com Signed-off-by: Naveen Naidu Signed-off-by: Bjorn Helgaas commit 4765d061d50559ce3addc9a86433c35f48d76085 Author: Ville Syrjälä Date: Wed Nov 17 20:31:01 2021 +0200 drm/i915: Move vrr push after the frame counter sampling again Moving the vrr push to happen before sampling the frame counter was wrong. If we are already in vblank when the push is sent the vblank exit will start immediately which causes the sampled frame counter to correspond to the next frame instead of the current frame. So put things back into the original order (except we should keep the vrr push within the irq disable section to avoid pointless irq related delays here). We'll just have to accept the tiny race that exists between sampling the frame counter vs. vrr push. And let's at least document said race properly in a comment. I suppose we could try to minimize the race by sampling the frame counter just before sending the push, but that would require changing drm_crtc_arm_vblank_event() to accept a caller provided vblank counter value, so leave it be for now. Another thing we could do is change the vblank evasion to account for the case where a push was already sent. That would anyway be required for mailbox style updates. Currently mailbox updates are only used by the legacy cursor, but we don't do a vrr push for those. Cc: Manasi Navare Fixes: 6f9976bd1310 ("drm/i915: Do vrr push before sampling the frame counter") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211117183103.27418-1-ville.syrjala@linux.intel.com Reviewed-by: Manasi Navare commit ba25d181caaa230107531ed440c3163fc814d4b1 Author: Naveen Naidu Date: Thu Nov 18 19:33:25 2021 +0530 PCI: rockchip-host: Drop error data fabrication when config read fails If config pci_ops.read() methods return failure, the PCI_OP_READ() and PCI_USER_READ_CONFIG() wrappers use PCI_SET_ERROR_RESPONSE() to set the data value, so there's no need to set it in the pci_ops.read() methods themselves. Drop the unnecessary data value fabrication when pci_ops.read() fails. Link: https://lore.kernel.org/r/50f9a6fa16521a86cb24d2f27c1f66eb3568cb9a.1637243717.git.naveennaidu479@gmail.com Signed-off-by: Naveen Naidu Signed-off-by: Bjorn Helgaas commit 3741f5f4b2a56b232917006663f52c3a084884da Author: Naveen Naidu Date: Thu Nov 18 19:33:24 2021 +0530 PCI: rcar-host: Drop error data fabrication when config read fails If config pci_ops.read() methods return failure, the PCI_OP_READ() and PCI_USER_READ_CONFIG() wrappers use PCI_SET_ERROR_RESPONSE() to set the data value, so there's no need to set it in the pci_ops.read() methods themselves. Drop the unnecessary data value fabrication when pci_ops.read() fails. Link: https://lore.kernel.org/r/83540eb3ae76a0d28bbe03d69d685a6d549b456b.1637243717.git.naveennaidu479@gmail.com Signed-off-by: Naveen Naidu Signed-off-by: Bjorn Helgaas Reviewed-by: Geert Uytterhoeven commit 5f09342835ab8d8a811a27569170bbf35207bdff Author: Naveen Naidu Date: Thu Nov 18 19:33:23 2021 +0530 PCI: altera: Drop error data fabrication when config read fails If config pci_ops.read() methods return failure, the PCI_OP_READ() and PCI_USER_READ_CONFIG() wrappers use PCI_SET_ERROR_RESPONSE() to set the data value, so there's no need to set it in the pci_ops.read() methods themselves. Drop the unnecessary data value fabrication when pci_ops.read() fails. Link: https://lore.kernel.org/r/ed5020e5b008b28c33a90c9c1670cef2393d3b7e.1637243717.git.naveennaidu479@gmail.com Signed-off-by: Naveen Naidu Signed-off-by: Bjorn Helgaas commit d5da41c0c34a5b253dc1b21b058b3e972afffb87 Author: Naveen Naidu Date: Thu Nov 18 19:33:22 2021 +0530 PCI: mvebu: Drop error data fabrication when config read fails If config pci_ops.read() methods return failure, the PCI_OP_READ() and PCI_USER_READ_CONFIG() wrappers use PCI_SET_ERROR_RESPONSE() to set the data value, so there's no need to set it in the pci_ops.read() methods themselves. Drop the unnecessary data value fabrication when pci_ops.read() fails. Link: https://lore.kernel.org/r/f30264b137b1282ffda34d336e8060bb13d60b98.1637243717.git.naveennaidu479@gmail.com Signed-off-by: Naveen Naidu Signed-off-by: Bjorn Helgaas commit 5a50b8b1ea88d75f7088df468ce05778c13f9eb7 Author: Naveen Naidu Date: Thu Nov 18 19:33:21 2021 +0530 PCI: aardvark: Drop error data fabrication when config read fails If config pci_ops.read() methods return failure, the PCI_OP_READ() and PCI_USER_READ_CONFIG() wrappers use PCI_SET_ERROR_RESPONSE() to set the data value, so there's no need to set it in the pci_ops.read() methods themselves. Drop the unnecessary data value fabrication when pci_ops.read() fails. Link: https://lore.kernel.org/r/335014f2b44cdf24ed1e37cb7c88f6c5de896cc2.1637243717.git.naveennaidu479@gmail.com Signed-off-by: Naveen Naidu Signed-off-by: Bjorn Helgaas Reviewed-by: Pali Rohár commit 7dcd026fb70fe30308c8be8997799ca92a238e11 Author: Naveen Naidu Date: Thu Nov 18 19:33:20 2021 +0530 PCI: kirin: Drop error data fabrication when config read fails If config pci_ops.read() methods return failure, the PCI_OP_READ() and PCI_USER_READ_CONFIG() wrappers use PCI_SET_ERROR_RESPONSE() to set the data value, so there's no need to set it in the pci_ops.read() methods themselves. Drop the unnecessary data value fabrication when pci_ops.read() fails. Link: https://lore.kernel.org/r/f87e22bc09a471d2cf15ad05dfd6432f57739aed.1637243717.git.naveennaidu479@gmail.com Signed-off-by: Naveen Naidu Signed-off-by: Bjorn Helgaas commit f4a44c1e25822f58e38f26aa85f4aabf46b11072 Author: Naveen Naidu Date: Thu Nov 18 19:33:19 2021 +0530 PCI: histb: Drop error data fabrication when config read fails If config pci_ops.read() methods return failure, the PCI_OP_READ() and PCI_USER_READ_CONFIG() wrappers use PCI_SET_ERROR_RESPONSE() to set the data value, so there's no need to set it in the pci_ops.read() methods themselves. Drop the unnecessary data value fabrication when pci_ops.read() fails. Link: https://lore.kernel.org/r/7da7ea760abc5f85cad6e9b0d3e59eebd93f50d3.1637243717.git.naveennaidu479@gmail.com Signed-off-by: Naveen Naidu Signed-off-by: Bjorn Helgaas commit 8ed2196a0ac49dd957ea28105fe826d99f6265af Author: Naveen Naidu Date: Thu Nov 18 19:33:18 2021 +0530 PCI: exynos: Drop error data fabrication when config read fails If config pci_ops.read() methods return failure, the PCI_OP_READ() and PCI_USER_READ_CONFIG() wrappers use PCI_SET_ERROR_RESPONSE() to set the data value, so there's no need to set it in the pci_ops.read() methods themselves. Drop the unnecessary data value fabrication when pci_ops.read() fails. Link: https://lore.kernel.org/r/765c2f27d85fcee4eb137023dc0a8f864eee9e36.1637243717.git.naveennaidu479@gmail.com Signed-off-by: Naveen Naidu Signed-off-by: Bjorn Helgaas commit 7e9768539eb32e0fb5eb09f033b33dbd8a15e16d Author: Naveen Naidu Date: Thu Nov 18 19:33:17 2021 +0530 PCI: mediatek: Drop error data fabrication when config read fails If config pci_ops.read() methods return failure, the PCI_OP_READ() and PCI_USER_READ_CONFIG() wrappers use PCI_SET_ERROR_RESPONSE() to set the data value, so there's no need to set it in the pci_ops.read() methods themselves. Drop the unnecessary data value fabrication when pci_ops.read() fails. Link: https://lore.kernel.org/r/666127469482f9ca177805ff52aeb7bccb26e4c9.1637243717.git.naveennaidu479@gmail.com Signed-off-by: Naveen Naidu Signed-off-by: Bjorn Helgaas commit 814dccec67ef7319dcaf825da73e8d3bfcdc68f0 Author: Naveen Naidu Date: Thu Nov 18 19:33:16 2021 +0530 PCI: iproc: Drop error data fabrication when config read fails If config pci_ops.read() methods return failure, the PCI_OP_READ() and PCI_USER_READ_CONFIG() wrappers use PCI_SET_ERROR_RESPONSE() to set the data value, so there's no need to set it in the pci_ops.read() methods themselves. Drop the unnecessary data value fabrication when pci_ops.read() fails. Link: https://lore.kernel.org/r/b95defa3db834789a4207df5d6b0216c8b610524.1637243717.git.naveennaidu479@gmail.com Signed-off-by: Naveen Naidu Signed-off-by: Bjorn Helgaas commit 658f7ecd6785e4b4344216596ac432b8f6af0893 Author: Naveen Naidu Date: Thu Nov 18 19:33:15 2021 +0530 PCI: thunder: Drop error data fabrication when config read fails If config pci_ops.read() methods return failure, the PCI_OP_READ() and PCI_USER_READ_CONFIG() wrappers use PCI_SET_ERROR_RESPONSE() to set the data value, so there's no need to set it in the pci_ops.read() methods themselves. Drop the unnecessary data value fabrication when pci_ops.read() fails. Link: https://lore.kernel.org/r/22f471b638276422926c49f3d42ac41bc7b28b3d.1637243717.git.naveennaidu479@gmail.com Signed-off-by: Naveen Naidu Signed-off-by: Bjorn Helgaas commit 316df7062a7926e315507e2d5b7a23331a3bfa67 Author: Naveen Naidu Date: Thu Nov 18 19:33:14 2021 +0530 PCI: Drop error data fabrication when config read fails If config pci_ops.read() methods return failure, the PCI_OP_READ() and PCI_USER_READ_CONFIG() wrappers use PCI_SET_ERROR_RESPONSE() to set the data value, so there's no need to set it in the pci_ops.read() methods themselves. Drop the unnecessary data value fabrication when pci_ops.read() fails. Link: https://lore.kernel.org/r/1b2edb060cf19b45f70645b331e6c08c9ba798c0.1637243717.git.naveennaidu479@gmail.com Signed-off-by: Naveen Naidu Signed-off-by: Bjorn Helgaas Reviewed-by: Rob Herring commit 9bc9310c8f641234a81f139414fdb5b20b1df8c4 Author: Naveen Naidu Date: Thu Nov 18 19:33:13 2021 +0530 PCI: Use PCI_SET_ERROR_RESPONSE() for disconnected devices A config read from a PCI device that doesn't exist or doesn't respond causes a PCI error. There's no real data to return to satisfy the CPU read, so most hardware fabricates ~0 data. Use PCI_SET_ERROR_RESPONSE() to set the error response when we think the device has already been disconnected. This helps unify PCI error response checking and make error checks consistent and easier to find. Link: https://lore.kernel.org/r/29db0a6874716db80757e4e3cdd03562f13eb0cb.1637243717.git.naveennaidu479@gmail.com Signed-off-by: Naveen Naidu Signed-off-by: Bjorn Helgaas commit f4f7eb43c5238fd2636a8e310394ed9920627ab3 Author: Naveen Naidu Date: Thu Nov 18 19:33:12 2021 +0530 PCI: Set error response data when config read fails When a PCI config read fails, most PCI host bridges fabricate ~0 data to complete the CPU read. But some host bridges do not; their drivers may only return an error from the pci_ops.read() method. In PCI_OP_READ() and PCI_USER_READ_CONFIG(), use PCI_SET_ERROR_RESPONSE() to set the data value to indicate an error when pci_ops.read() fails. This means the host bridge driver no longer needs to fabricate error data when they detect errors. This makes error response fabrication consistent and helps in removal of a lot of repeated code. Suggested-by: Rob Herring Link: https://lore.kernel.org/r/4188fc5465631ce0d472d1423de3d9fb2f09b8ff.1637243717.git.naveennaidu479@gmail.com Signed-off-by: Naveen Naidu Signed-off-by: Bjorn Helgaas Reviewed-by: Rob Herring Reviewed-by: Pali Rohár commit 57bdeef4716689d9b0e3571034d65cf420f6efcd Author: Naveen Naidu Date: Thu Nov 18 19:33:11 2021 +0530 PCI: Add PCI_ERROR_RESPONSE and related definitions A config or MMIO read from a PCI device that doesn't exist or doesn't respond causes a PCI error. There's no real data to return to satisfy the CPU read, so most hardware fabricates ~0 data. Add a PCI_ERROR_RESPONSE definition for that and use it where appropriate to make these checks consistent and easier to find. Also add helper definitions PCI_SET_ERROR_RESPONSE() and PCI_POSSIBLE_ERROR() to make the code more readable. Suggested-by: Bjorn Helgaas Link: https://lore.kernel.org/r/55563bf4dfc5d3fdc96695373c659d099bf175b1.1637243717.git.naveennaidu479@gmail.com Signed-off-by: Naveen Naidu Signed-off-by: Bjorn Helgaas Reviewed-by: Pali Rohár commit 5ccd191cdd1d304fecc0d8ad6161b1e279f31aae Merge: 61f6e38ae8b6c 1d734f592e1a1 Author: Mark Brown Date: Thu Nov 18 19:15:19 2021 +0000 RSPI driver support for RZ/G2L Merge series from Lad Prabhakar : This patch series adds RSPI driver and dt binding support to RZ/G2L SoC. commit 626a3dfbdb5d11f92e709680135abf272057ef59 Merge: b38892b5b85ae 163fa3a5927e1 Author: Mark Brown Date: Thu Nov 18 18:57:42 2021 +0000 ASoC: SOF: Add support for Mediatek MT8195 Merge series from Daniel Baluta : This adds sound open firmware driver support for MT8915 platform. commit a5d05b07961a2df47d3b4aae3bdae61ac095a43c Author: Uwe Kleine-König Date: Thu Jun 10 10:21:34 2021 +0200 pstore/ftrace: Allow immediate recording Without a module param knob there was no way to enable pstore ftrace recording early enough to debug hangs happening during the boot process before userspace is up enough to enable it via the regular debugfs knobs. Signed-off-by: Uwe Kleine-König Co-developed-by: Kees Cook Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20210610082134.20636-1-u.kleine-koenig@pengutronix.de commit 2e1809208a4a52e883527c288b4fca61a90100b2 Author: luo penghao Date: Thu Nov 4 06:26:21 2021 +0000 xfrm: Remove duplicate assignment The statement in the switch is repeated with the statement at the beginning of the while loop, so this statement is meaningless. The clang_analyzer complains as follows: net/xfrm/xfrm_policy.c:3392:2 warning: Value stored to 'exthdr' is never read Reported-by: Zeal Robot Signed-off-by: luo penghao Signed-off-by: Steffen Klassert commit c6e7871894a3b975ae45995d69cf761566904595 Author: luo penghao Date: Thu Nov 4 03:19:31 2021 +0000 ipv6/esp6: Remove structure variables and alignment statements The definition of this variable is just to find the length of the structure after aligning the structure. The PTR alignment function is to optimize the size of the structure. In fact, it doesn't seem to be of much use, because both members of the structure are of type u32. So I think that the definition of the variable and the corresponding alignment can be deleted, the value of extralen can be directly passed in the size of the structure. The clang_analyzer complains as follows: net/ipv6/esp6.c:117:27 warning: Value stored to 'extra' during its initialization is never read Reported-by: Zeal Robot Signed-off-by: luo penghao Signed-off-by: Steffen Klassert commit 29ad850a5cae84757bcd4c60e0d74232ef8c5157 Author: Ilya Leoshkevich Date: Thu Nov 18 12:52:25 2021 +0100 selfetests/bpf: Adapt vmtest.sh to s390 libbpf CI changes [1] added s390 support to libbpf CI and added an ${ARCH} prefix to a number of paths and identifiers in libbpf GitHub repo, which vmtest.sh relies upon. Update these and make use of the new s390 support. [1] https://github.com/libbpf/libbpf/pull/204 Co-developed-by: Andrii Nakryiko Signed-off-by: Andrii Nakryiko Signed-off-by: Ilya Leoshkevich Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211118115225.1349726-1-iii@linux.ibm.com commit 631af6e0f41002dc63504efd2f6c3e1ab5f931c5 Author: Arnaud Pouliquen Date: Mon Nov 8 15:01:26 2021 +0100 rpmsg: Fix documentation return formatting kernel documentation specification: "The return value, if any, should be described in a dedicated section named Return." Signed-off-by: Arnaud Pouliquen Link: https://lore.kernel.org/r/20211108140126.3530-1-arnaud.pouliquen@foss.st.com Signed-off-by: Mathieu Poirier commit c572724406e3926502eccc930447f0affb604503 Author: Arnaud Pouliquen Date: Mon Nov 8 14:59:45 2021 +0100 rpmsg: char: Add pr_fmt() to prefix messages Make all messages to be prefixed in a unified way. Add pr_fmt() to achieve this. Signed-off-by: Arnaud Pouliquen Link: https://lore.kernel.org/r/20211108135945.3364-1-arnaud.pouliquen@foss.st.com Signed-off-by: Mathieu Poirier commit 66bd1333abd7fa191f13b929c9119d6cd3df27b0 Author: Mike Leach Date: Wed Nov 17 16:42:20 2021 +0000 Documentation: coresight: Fix documentation issue Fix the description of the directories and attributes used in cs_etm as used by perf. Drop the references to the 'configurations' sub-directory which had been removed in an earlier version of the patchset. Fixes: f71cd93d5ea4 ("Documentation: coresight: Add documentation for CoreSight config") Reported-by: German Gomex Signed-off-by: Mike Leach Link: https://lore.kernel.org/r/20211117164220.14883-1-mike.leach@linaro.org Signed-off-by: Mathieu Poirier commit 3956d6c85f26b5dd59cc6d3bf85a6a7341c68518 Author: Andy Shevchenko Date: Fri Nov 5 14:42:40 2021 +0200 pinctrl: st: Switch to use devm_kasprintf_strarray() Since we have a generic helper, switch the module to use it. As a side effect, add check for the memory allocation failures and cleanup it either in error case or when driver is unloading. Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij commit 3d4d3e0a7d67a9d49fb661c6ea3b51fc3696030f Author: Andy Shevchenko Date: Fri Nov 5 14:42:39 2021 +0200 pinctrl: st: Convert to use dev_err_probe() It's fine to call dev_err_probe() in ->probe() when error code is known. Convert the driver to use dev_err_probe(). Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij commit 3809671d95a1c400ecf8235d1dc3e5b352aee242 Author: Andy Shevchenko Date: Fri Nov 5 14:42:38 2021 +0200 pinctrl: st: Make use of the 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. Signed-off-by: Andy Shevchenko Acked-by: Linus Walleij commit f972707662dbaf066d055a507c0654e4bb6e659e Author: Andy Shevchenko Date: Fri Nov 5 14:42:37 2021 +0200 pinctrl: st: Use temporary variable for struct device Use temporary variable for struct device to make code neater. Signed-off-by: Andy Shevchenko commit e803ab971b5b2d8f8626a0b75fa40197a237440f Author: Andy Shevchenko Date: Fri Nov 5 14:42:36 2021 +0200 pinctrl: st: Drop wrong kernel doc annotations Kernel doc validator is not happy: .../pinctrl-st.c:59: warning: This comment starts with '/**', but isn't a kernel-doc comment. .../pinctrl-st.c:73: warning: This comment starts with '/**', but isn't a kernel-doc comment. Drop them as they are indeed not a kernel doc comments. Signed-off-by: Andy Shevchenko Acked-by: Linus Walleij commit b32b195d7f021f4c66a3de7b34ee648e56b824cd Author: Andy Shevchenko Date: Fri Nov 5 14:42:35 2021 +0200 pinctrl: armada-37xx: Switch to use devm_kasprintf_strarray() Since we have a generic helper, switch the module to use it. As a side effect, add check for the memory allocation failures and cleanup it either in error case or when driver is unloading. Signed-off-by: Andy Shevchenko Reviewed-by: Gregory CLEMENT commit 06cb10ea0cd5c5f4db9627a33ab47fec32cb5960 Author: Andy Shevchenko Date: Fri Nov 5 14:42:34 2021 +0200 pinctrl: armada-37xx: Convert to use dev_err_probe() It's fine to call dev_err_probe() in ->probe() when error code is known. Convert the driver to use dev_err_probe(). Signed-off-by: Andy Shevchenko Reviewed-by: Gregory CLEMENT commit 49bdef501728acbfadc7eeafafb4f6c3fea415eb Author: Andy Shevchenko Date: Fri Nov 5 14:42:33 2021 +0200 pinctrl: armada-37xx: Make use of the devm_platform_ioremap_resource() Use the devm_platform_ioremap_resource() helper instead of calling of_address_to_resource() and devm_ioremap_resource() separately. Signed-off-by: Andy Shevchenko Reviewed-by: Gregory CLEMENT commit 50cf2ed284e49028a885aa56c3ea50714c635879 Author: Andy Shevchenko Date: Fri Nov 5 14:42:32 2021 +0200 pinctrl: armada-37xx: Use temporary variable for struct device Use temporary variable for struct device to make code neater. Signed-off-by: Andy Shevchenko Reviewed-by: Gregory CLEMENT commit a6d93da40fe917582100fa0dafb8a59f402a34f9 Author: Andy Shevchenko Date: Fri Nov 5 14:42:31 2021 +0200 pinctrl: armada-37xx: Fix function name in the kernel doc Kernel doc validator is not happy: .../pinctrl-armada-37xx.c:926: warning: expecting prototype for armada_37xx_fill_funcs(). Prototype was for armada_37xx_fill_func() instead Fix this by updating function name in the kernel doc. Signed-off-by: Andy Shevchenko Reviewed-by: Gregory CLEMENT commit 069d7796c95be726655319ec2639aa0d75809add Author: Andy Shevchenko Date: Fri Nov 5 14:42:30 2021 +0200 pinctrl/rockchip: Switch to use devm_kasprintf_strarray() Since we have a generic helper, switch the module to use it. As a side effect, add check for the memory allocation failures and cleanup it either in error case or when driver is unloading. Signed-off-by: Andy Shevchenko Reviewed-by: Heiko Stuebner commit 0045028f318b58595596d7e53a88157923e83b0b Author: Andy Shevchenko Date: Fri Nov 5 14:42:29 2021 +0200 pinctrl/rockchip: Convert to use dev_err_probe() It's fine to call dev_err_probe() in ->probe() when error code is known. Convert the driver to use dev_err_probe(). Signed-off-by: Andy Shevchenko Reviewed-by: Heiko Stuebner commit fb17dcd73fa9c772188724b63cbf5a3fdbb4e605 Author: Andy Shevchenko Date: Fri Nov 5 14:42:28 2021 +0200 pinctrl/rockchip: Make use of the devm_platform_get_and_ioremap_resource() Use the devm_platform_get_and_ioremap_resource() helper instead of calling platform_get_resource() and devm_ioremap_resource() separately. Signed-off-by: Andy Shevchenko Reviewed-by: Heiko Stuebner commit e4dd7fd5ff0acb3f3ed290f52afe20fd840d22b0 Author: Andy Shevchenko Date: Fri Nov 5 14:42:27 2021 +0200 pinctrl/rockchip: Use temporary variable for struct device Use temporary variable for struct device to make code neater. Signed-off-by: Andy Shevchenko Reviewed-by: Heiko Stuebner commit 5a83227b3d4f9dd1c66beba13f53f31e981efd48 Author: Andy Shevchenko Date: Fri Nov 5 14:42:26 2021 +0200 pinctrl/rockchip: Drop wrong kernel doc annotation Kernel doc validator is not happy: .../pinctrl-rockchip.c:45: warning: This comment starts with '/**', but isn't a kernel-doc comment. Drop it as it's indeed not a kernel doc comment. Signed-off-by: Andy Shevchenko Reviewed-by: Heiko Stuebner commit acdb89b6c87a2d7b5c48a82756e6f5c6f599f60a Author: Andy Shevchenko Date: Fri Nov 5 14:42:25 2021 +0200 lib/string_helpers: Introduce managed variant of kasprintf_strarray() Some of the users want to have easy way to allocate array of strings that will be automatically cleaned when associated device is gone. Introduce managed variant of kasprintf_strarray() for such use cases. Signed-off-by: Andy Shevchenko commit 418e0a3551bbef5b221705b0e5b8412cdc0afd39 Author: Andy Shevchenko Date: Fri Nov 5 14:42:24 2021 +0200 lib/string_helpers: Introduce kasprintf_strarray() We have a few users already that basically want to have array of sequential strings to be allocated and filled. Provide a helper for them (basically adjusted version from gpio-mockup.c). Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij commit 3cd6bab2f81da960322227e4758c675b95c2895c Author: Ulf Hansson Date: Thu Sep 2 11:02:21 2021 +0200 of: property: fw_devlink: Fixup behaviour when 'node_not_dev' is set In the struct supplier_bindings the member 'node_not_dev' is described as "The consumer node containing the property is never a device.", but that is inconsistent with the behaviour of the code in of_link_property(), as it calls of_get_compat_node() that starts parsing for a compatible property from the node it gets passed to it. The proper behaviour is to start at the node's parent, so let's do that. While at it, let's take the opportunity to update the description of the 'node_not_dev' flag, as to clarify its purpose. Signed-off-by: Ulf Hansson Reviewed-by: Saravana Kannan Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20210902090221.820254-1-ulf.hansson@linaro.org commit 61f6e38ae8b6cbe140cfd320b3003a52147edef0 Author: Vinod Koul Date: Wed Nov 17 19:01:08 2021 +0530 spi: qcom: geni: remove unused defines Commit b59c122484ec ("spi: spi-geni-qcom: Add support for GPI dma") added GPI support but also added unused defines, so remove them Signed-off-by: Vinod Koul Reviewed-by: Douglas Anderson Link: https://lore.kernel.org/r/20211117133110.2682631-1-vkoul@kernel.org Signed-off-by: Mark Brown commit 1d734f592e1a1d41af80e90001d109cec1c98fb4 Author: Lad Prabhakar Date: Thu Nov 18 03:10:41 2021 +0000 spi: spi-rspi: Drop redeclaring ret variable in qspi_transfer_in() "ret" variable is already declared in qspi_transfer_in() at the beginning of function, drop redeclaring ret in the if block, fixing below: spi-rspi.c: In function ‘qspi_transfer_in’: spi-rspi.c:838:7: warning: declaration of ‘ret’ shadows a previous local 838 | int ret = rspi_dma_transfer(rspi, NULL, &xfer->rx_sg); | ^~~ spi-rspi.c:835:6: note: shadowed declaration is here 835 | int ret; Fixes: db30083813b55 ("spi: rspi: avoid uninitialized variable access") Signed-off-by: Lad Prabhakar Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20211118031041.2312-4-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Mark Brown commit aadbff4af5c90919cbe67e2c4d77c68cdefa454e Author: Lad Prabhakar Date: Thu Nov 18 03:10:40 2021 +0000 spi: spi-rspi: Add support to deassert/assert reset line On RZ/G2L SoC we need to explicitly deassert the reset line for the device to work, use this opportunity to deassert/assert reset line in spi-rspi driver. This patch adds support to read the "resets" property (if available) from DT and perform deassert/assert when required. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20211118031041.2312-3-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Mark Brown commit 5a8f8542e34b6469cd5c5a3d075fa5977d90775e Author: Lad Prabhakar Date: Thu Nov 18 03:10:39 2021 +0000 spi: dt-bindings: renesas,rspi: Document RZ/G2L SoC Add RSPI binding documentation for Renesas RZ/G2L SoC. RSPI block is identical to one found on RZ/A, so no driver changes are required. The fallback compatible string "renesas,rspi-rz" will be used on RZ/G2L. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20211118031041.2312-2-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Mark Brown commit 92b1348277f8893671e5354adde64fe3cf462821 Author: Matti Vaittinen Date: Thu Nov 18 13:49:30 2021 +0200 regulator: Add units to limit documentation The documentation for limits used at protection level setting did not mention the units. Fix the units in documentation to match values passed in from device-tree (uV, uA, Kelvin) to avoid confusion. Signed-off-by: Matti Vaittinen Link: https://lore.kernel.org/r/111114aca991e41e49a32f89b74e95285f07c1e3.1637233864.git.matti.vaittinen@fi.rohmeurope.com Signed-off-by: Mark Brown commit e7543e199591c24175c4a06beec15611ce4b5a5b Author: Matti Vaittinen Date: Thu Nov 18 13:49:08 2021 +0200 regulator: bd718x7: Use rohm generic restricted voltage setting Use common restricted voltage setting instead of implementing own. Signed-off-by: Matti Vaittinen Link: https://lore.kernel.org/r/5a0ee14852802690241568a29ed19ff9550b0b08.1637233864.git.matti.vaittinen@fi.rohmeurope.com Signed-off-by: Mark Brown commit 8b6e88555971eac384b89fb0bd6c72ee4e1e6a6a Author: Matti Vaittinen Date: Thu Nov 18 13:48:47 2021 +0200 regulator: rohm-regulator: add helper for restricted voltage setting Few ROHM PMICs have regulators where voltage setting can be done only when regulator is disabled. Add helper for those PMICs. Signed-off-by: Matti Vaittinen Link: https://lore.kernel.org/r/6f51871e9fea611d133b5dd2560f4a7ee1ede9cd.1637233864.git.matti.vaittinen@fi.rohmeurope.com Signed-off-by: Mark Brown commit b38892b5b85ae54b7b867313996f967122ede42e Author: Srinivasa Rao Mandadapu Date: Thu Nov 18 16:50:11 2021 +0530 ASoC: codecs: MBHC: Remove useless condition check Remove redundant conditional check and clean code in special headset support functions. Signed-off-by: Srinivasa Rao Mandadapu Co-developed-by: Venkata Prasad Potturu Signed-off-by: Venkata Prasad Potturu Link: https://lore.kernel.org/r/1637234411-554-1-git-send-email-srivasam@codeaurora.org Signed-off-by: Mark Brown commit 163fa3a5927e1d8f948ea1fc16c897944933a06a Author: YC Hung Date: Thu Nov 18 12:07:49 2021 +0200 ASoC: SOF: mediatek: Add DSP system PM callback for mt8195 Add DSP system PM callback for suspend and resume Signed-off-by: YC Hung Reviewed-by: Pierre-Louis Bossart Reviewed-by: Daniel Baluta Signed-off-by: Daniel Baluta Link: https://lore.kernel.org/r/20211118100749.54628-9-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit 424d6d1a9a51b7e6ab397132700a237082d64cf4 Author: YC Hung Date: Thu Nov 18 12:07:48 2021 +0200 ASoC: SOF: mediatek: Add mt8195 dsp clock support Add adsp clock on/off support on mt8195 platform. Signed-off-by: YC Hung Reviewed-by: Pierre-Louis Bossart Reviewed-by: Daniel Baluta Signed-off-by: Daniel Baluta Link: https://lore.kernel.org/r/20211118100749.54628-8-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit 24d75049c5ed5193bd12ce0d43c355c4ef74a7fa Author: YC Hung Date: Thu Nov 18 12:07:47 2021 +0200 ASoC: SOF: mediatek: Add dai driver dsp ops callback for mt8195 Add dsp ops callback to register AFE DL2/DL3/UL4/UL5 sof dai's with ALSA Signed-off-by: YC Hung Reviewed-by: Péter Ujfalusi Reviewed-by: Kai Vehmanen Reviewed-by: Daniel Baluta Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Reviewed-by: Guennadi Liakhovetski Signed-off-by: Daniel Baluta Link: https://lore.kernel.org/r/20211118100749.54628-7-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit 24281bc2bf1884e665dfbcd17aaaabbc5872e501 Author: YC Hung Date: Thu Nov 18 12:07:46 2021 +0200 ASoC: SOF: Add mt8195 device descriptor Add SOF device and DT descriptor for Mediatek mt8195 platform. Signed-off-by: YC Hung Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Reviewed-by: Guennadi Liakhovetski Reviewed-by: Daniel Baluta Signed-off-by: Daniel Baluta Link: https://lore.kernel.org/r/20211118100749.54628-6-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit b7f6503830cd8f3f7076635409460861b5ff6310 Author: YC Hung Date: Thu Nov 18 12:07:45 2021 +0200 ASoC: SOF: mediatek: Add fw loader and mt8195 dsp ops to load firmware Add mt8195-loader module with ops callback to load and run firmware on mt8195 platform. Signed-off-by: YC Hung Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Reviewed-by: Guennadi Liakhovetski Reviewed-by: Daniel Baluta Signed-off-by: Daniel Baluta Link: https://lore.kernel.org/r/20211118100749.54628-5-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit b72bfcffcfc11858a8fc92998733372606db485e Author: YC Hung Date: Thu Nov 18 12:07:44 2021 +0200 ASoC: SOF: topology: Add support for Mediatek AFE DAI Add new sof dai and config to pass topology file configuration to SOF firmware running on Mediatek platform DSP core. Add mediatek audio front end(AFE) to the list of supported sof_dais Signed-off-by: YC Hung Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Reviewed-by: Guennadi Liakhovetski Reviewed-by: Daniel Baluta Signed-off-by: Daniel Baluta Link: https://lore.kernel.org/r/20211118100749.54628-4-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit e6feefa541f309afed8aa54431681261bc57bcde Author: YC Hung Date: Thu Nov 18 12:07:43 2021 +0200 ASoC: SOF: tokens: add token for Mediatek AFE Add the definition for Mediatek audio front end(AFE) tokens,include AFE sampling rate, channels, and format. Signed-off-by: YC Hung Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Reviewed-by: Guennadi Liakhovetski Reviewed-by: Daniel Baluta Signed-off-by: Daniel Baluta Link: https://lore.kernel.org/r/20211118100749.54628-3-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit 32d7e03d26fd93187c87ed0fbf59ec7023a61404 Author: YC Hung Date: Thu Nov 18 12:07:42 2021 +0200 ASoC: SOF: mediatek: Add mt8195 hardware support This patch initialize to support SOF on Mediatek mt8195 platform. MT8195 has four Cortex A78 cores paired with four Cortex A55 cores. It also has Cadence HiFi-4 DSP single core. There are shared DRAM and mailbox interrupt between AP and DSP to use for IPC communication. Signed-off-by: YC Hung Reviewed-by: Péter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Reviewed-by: Guennadi Liakhovetski Reviewed-by: Daniel Baluta Signed-off-by: Daniel Baluta Link: https://lore.kernel.org/r/20211118100749.54628-2-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit cebbb5c46d0cb0615fd0c62dea9b44273d0a9780 Author: Dan Carpenter Date: Thu Nov 18 14:12:33 2021 +0300 drm/vboxvideo: fix a NULL vs IS_ERR() check The devm_gen_pool_create() function never returns NULL, it returns error pointers. Fixes: 4cc9b565454b ("drm/vboxvideo: Use devm_gen_pool_create") Signed-off-by: Dan Carpenter Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede Link: https://patchwork.freedesktop.org/patch/msgid/20211118111233.GA1147@kili commit bb8cecf8ba127abca8ccd102207a59c55fdae515 Merge: d091ec975b5af ec4c7e12396b1 Author: David S. Miller Date: Thu Nov 18 12:11:51 2021 +0000 Merge branch 'lan78xx-napi' John Efstathiades says: =================== lan78xx NAPI Performance Improvements This patch set introduces a set of changes to the lan78xx driver that were originally developed as part of an investigation into the performance of TCP and UDP transfers on an Android system. The changes increase the throughput of both UDP and TCP transfers and reduce the overall CPU load. These improvements are also seen on a standard Linux kernel. Typical results are included at the end of this document. The changes to the driver evolved over time. The patches presented here attempt to organise the changes in to coherent blocks that affect logically connected parts of the driver. The patches do not reflect the way in which the code evolved during the performance investigation. Each patch produces a working driver that has an incremental improvement but patches 2, 3 and 6 should be considered a single update. The changes affect the following parts of the driver: 1. Deferred URB processing The deferred URB processing that was originally done by a tasklet is now done by a NAPI polling routine. The NAPI cycle has a fixed work budget that controls how many received frames are passed to the network stack. Patch 6 introduces the NAPI polling but depends on preceding patches. The new NAPI polling routine is also responsible for submitting Rx and Tx URBs to the USB host controller. Moving the URB processing to a NAPI-based system "smoothed" incoming and outgoing data flows on the Android system under investigation. However, taken in isolation, moving from a tasklet approach to a NAPI approach made little or no difference to the overall performance. 2. URB buffer management The driver creates a pool of Tx and a pool of Rx URB buffers. Each buffer is large enough to accommodate a packet with the maximum MTU data. URBs are allocated from these pools as required. Patch 2 introduces the new Tx buffer pool. Patch 3 introduces the new Rx buffer pool. 3. Tx pending data SKBs containing data to be transmitted are added to a queue. The driver tracks free Tx URBs and the corresponding free Tx URB space. When new Tx URBs are submitted, pending data is copied into the URB buffer until the URB buffer is filled or there is no more pending data. This maximises utilisation the LAN78xx internal USB and network frame buffers. New Tx URBs are submitted to the USB host controller as part of the NAPI polling cycle. Patch 2 introduces these changes. 4. Rx URB completion A new URB is no longer submitted as part of the URB completion callback. New URBs are submitted during the NAPI polling cycle. Patch 3 introduces these changes. 5. Rx URB processing Completed URBs are put on to queue for processing (as is done in the current driver). Network packets in completed URBs are copied from the URB buffer in to dynamically allocated SKBs and passed to the network stack. The emptied URBs are resubmitted to the USB host controller. Patch 3 introduces this change. Patch 6 updates the change to use NAPI SKBs. Each packet passed to the network stack is a single NAPI work item. If the NAPI work budget is exhausted the remaining packets in the URB are put onto an overflow queue that is processed at the start of the next NAPI cycle. Patch 6 introduces this change. 6. Driver-specific hard_header_len The driver-specific hard_header_len adjustment was removed as it broke generic receive offload (GRO) processing. Moreover, it was no longer required due the change in Tx pending data management (see point 3. above). Patch 5 introduces this change. The modification has been tested on four different target machines: Target | CPU | ARCH | cores | kernel | RAM | -----------------+------------+---------+-------+--------+-------| Raspberry Pi 4B | Cortex-A72 | aarch64 | 4 | 64-bit | 2 GB | Nitrogen8M SBC | Cortex-A53 | aarch64 | 4 | 64-bit | 2 GB | Compaq Pressario | Pentium D | i686 | 2 | 32-bit | 4 GB | Dell T3620 | Core i3 | x86_64 | 2+2 | 64-bit | 16 GB | The targets, apart from the Compaq, each have an on-chip USB3 host controller. A PCIe-based USB3 host controller card was added to the Compaq to provide the necessary USB3 host interface. The network throughput was measured using iperf3. The peer device was a second Dell T3620 fitted with an Intel i210 network interface. The target machine and the peer device were connected via a Netgear GS105 gigabit switch. The CPU load was measured using mpstat running on the target machine. The tables below summarise the throughput and CPU load improvements achieved by the updated driver. The bandwidth is the average bandwidth reported by iperf3 at the end of a 60-second test. The percentage idle figure is the average idle reported across all CPU cores on the target machine for the duration of the test. TCP Rx (target receiving, peer transmitting) | Standard Driver | NAPI Driver | Target | Bandwidth | % Idle | Bandwidth | % Idle | -----------------+-----------+--------+--------------------| RPi4 Model B | 941 | 74.9 | 941 | 91.5 | Nitrogen8M | 941 | 76.2 | 941 | 92.7 | Compaq Pressario | 941 | 44.5 | 941 | 82.1 | Dell T3620 | 941 | 88.9 | 941 | 98.3 | TCP Tx (target transmitting, peer receiving) | Standard Driver | NAPI Driver | Target | Bandwidth | % Idle | Bandwidth | % Idle | -----------------+-----------+--------+--------------------| RPi4 Model B | 683 | 80.1 | 942 | 97.6 | Nitrogen8M | 942 | 97.8 | 942 | 97.3 | Compaq Pressario | 939 | 80.0 | 942 | 91.2 | Dell T3620 | 942 | 95.3 | 942 | 97.6 | UDP Rx (target receiving, peer transmitting) | Standard Driver | NAPI Driver | Target | Bandwidth | % Idle | Bandwidth | % Idle | -----------------+-----------+--------+--------------------| RPi4 Model B | - | - | 958 (0%) | 76.2 | Nitrogen8M | 690 (25%) | 57.7 | 937 (0%) | 68.5 | Compaq Pressario | 958 (0%) | 50.2 | 958 (0%) | 61.6 | Dell T3620 | 958 (0%) | 89.6 | 958 (0%) | 85.3 | The figure in brackets is the percentage packet loss. UDP Tx (target transmitting, peer receiving) | Standard Driver | NAPI Driver | Target | Bandwidth | % Idle | Bandwidth | % Idle | -----------------+-----------+--------+--------------------| RPi4 Model B | 370 | 75.0 | 886 | 78.9 | Nitrogen8M | 710 | 75.0 | 958 | 85.3 | Compaq Pressario | 958 | 65.5 | 958 | 76.6 | Dell T3620 | 958 | 97.0 | 958 | 97.3 | ==================== Signed-off-by: David S. Miller commit ec4c7e12396b1a30fbacfa68425118f5b46ea878 Author: John Efstathiades Date: Thu Nov 18 11:01:39 2021 +0000 lan78xx: Introduce NAPI polling support This patch introduces a NAPI-style approach for processing completed Rx URBs that contributes to improving driver throughput and reducing CPU load. Packets in completed URBs are copied to NAPI SKBs and passed to the network stack for processing. Each frame passed to the stack is one work item in the NAPI budget. If the NAPI budget is consumed and frames remain, they are added to an overflow queue that is processed at the start of the next NAPI polling cycle. The NAPI handler is also responsible for copying pending Tx data to Tx URBs and submitting them to the USB host controller for transmission. Signed-off-by: John Efstathiades Signed-off-by: David S. Miller commit 0dd87266c1337db64cd6d3bbd1503553b922aa88 Author: John Efstathiades Date: Thu Nov 18 11:01:38 2021 +0000 lan78xx: Remove hardware-specific header update Remove hardware-specific header length adjustment as it is no longer required. It also breaks generic receive offload (GRO) processing of received TCP frames that results in a TCP ACK being sent for each received frame. Signed-off-by: John Efstathiades Signed-off-by: David S. Miller commit 9d2da72189a8d233cdcf6ebe5ff0689730e93e1f Author: John Efstathiades Date: Thu Nov 18 11:01:37 2021 +0000 lan78xx: Re-order rx_submit() to remove forward declaration Move position of rx_submit() to remove forward declaration of rx_complete() which is now no longer required. Signed-off-by: John Efstathiades Signed-off-by: David S. Miller commit c450a8eb187a4d7ebe92e0afec54ac31ce403e79 Author: John Efstathiades Date: Thu Nov 18 11:01:36 2021 +0000 lan78xx: Introduce Rx URB processing improvements This patch introduces a new approach to allocating and managing Rx URBs that contributes to improving driver throughput and reducing CPU load. A pool of Rx URBs is created during driver instantiation. All the URBs are initially submitted to the USB host controller for processing. The default URB buffer size is different for each USB bus speed. The chosen sizes provide good USB utilisation with little impact on overall packet latency. Completed URBs are processed in the driver bottom half. The URB buffer contents are copied to a dynamically allocated SKB, which is then passed to the network stack. The URB is then re-submitted to the USB host controller. NOTE: the call to skb_copy() in rx_process() that copies the URB contents to a new SKB is a temporary change to make this patch work in its own right. This call will be removed when the NAPI processing is introduced by patch 6 in this patch set. Signed-off-by: John Efstathiades Signed-off-by: David S. Miller commit d383216a7efec3b38b8bd4925a208383b2492d84 Author: John Efstathiades Date: Thu Nov 18 11:01:35 2021 +0000 lan78xx: Introduce Tx URB processing improvements This patch introduces a new approach to allocating and managing Tx URBs that contributes to improving driver throughput and reducing CPU load. A pool of Tx URBs is created during driver instantiation. A URB is allocated from the pool when there is data to transmit. The URB is released back to the pool when the data has been transmitted by the device. The default URB buffer size is different for each USB bus speed. The chosen sizes provide good USB utilisation with little impact on overall packet latency. SKBs to be transmitted are added to a pending queue for processing. The driver tracks the available Tx URB buffer space and copies as much pending data as possible into each free URB. Each full URB is then submitted to the USB host controller for transmission. Signed-off-by: John Efstathiades Signed-off-by: David S. Miller commit a6df95cae40bee555e01a37b4023ce8e97ffa249 Author: John Efstathiades Date: Thu Nov 18 11:01:34 2021 +0000 lan78xx: Fix memory allocation bug Fix memory allocation that fails to check for NULL return. Signed-off-by: John Efstathiades Signed-off-by: David S. Miller commit d091ec975b5af484c1c4e823ec22546bbaf3e2cc Merge: f6ef47e5bdc6f a7e13edf37bee Author: David S. Miller Date: Thu Nov 18 12:07:24 2021 +0000 Merge branch 'dsa-felix-psfp' Xiaoliang Yang says: ==================== net: dsa: felix: psfp support on vsc9959 VSC9959 hardware supports Per-Stream Filtering and Policing(PSFP). This patch series add PSFP support on tc flower offload of ocelot driver. Use chain 30000 to distinguish PSFP from VCAP blocks. Add gate and police set to support PSFP in VSC9959 driver. v6-v7 changes: - Add a patch to restrict psfp rules on ingress port. - Using stats.drops to show the packet count discarded by the rule. v5->v6 changes: - Modify ocelot_mact_lookup() parameters. - Use parameters ssid and sfid instead of streamdata in ocelot_mact_learn_streamdata() function. - Serialize STREAMDATA and MAC table write. v4->v5 changes: - Add MAC table lock patch, and move stream data write in ocelot_mact_learn_streamdata(). - Add two sections of VCAP policers to Seville platform. v3->v4 changes: - Introduce vsc9959_psfp_sfi_table_get() function in patch where it is used to fix compile warning. v2->v3 changes: - Reorder first two patches. Export struct ocelot_mact_entry, then add ocelot_mact_lookup() and ocelot_mact_write() functions. - Add PSFP list to struct ocelot, and init it by using ocelot->ops->psfp_init(). v1->v2 changes: - Use tc flower offload of ocelot driver to support PSFP add and delete. - Add PSFP tables add/del functions in felix_vsc9959.c. ==================== Signed-off-by: David S. Miller commit a7e13edf37beee65f2c2ec60c42e5fb89a2958ce Author: Xiaoliang Yang Date: Thu Nov 18 18:12:04 2021 +0800 net: dsa: felix: restrict psfp rules on ingress port PSFP rules take effect on the streams from any port of VSC9959 switch. This patch use ingress port to limit the rule only active on this port. Each stream can only match two ingress source ports in VSC9959. Streams from lowest port gets the configuration of SFID pointed by MAC Table lookup and streams from highest port gets the configuration of (SFID+1) pointed by MAC Table lookup. This patch defines the PSFP rule on highest port as dummy rule, which means that it does not modify the MAC table. Signed-off-by: Xiaoliang Yang Signed-off-by: David S. Miller commit 76c13ede7120e55b5a31580d2231e30b26246212 Author: Xiaoliang Yang Date: Thu Nov 18 18:12:03 2021 +0800 net: dsa: felix: use vcap policer to set flow meter for psfp This patch add police action to set flow meter table which is defined in IEEE802.1Qci. Flow metering is two rates two buckets and three color marker to policing the frames, we only enable one rate one bucket in this patch. Flow metering shares a same policer pool with VCAP policers, so the PSFP policer calls ocelot_vcap_policer_add() and ocelot_vcap_policer_del() to set flow meter police. Signed-off-by: Xiaoliang Yang Signed-off-by: David S. Miller commit 77043c37096d4753b9f40e51445f31eb9dc40295 Author: Xiaoliang Yang Date: Thu Nov 18 18:12:02 2021 +0800 net: mscc: ocelot: use index to set vcap policer Policer was previously automatically assigned from the highest index to the lowest index from policer pool. But police action of tc flower now uses index to set an police entry. This patch uses the police index to set vcap policers, so that one policer can be shared by multiple rules. Signed-off-by: Xiaoliang Yang Signed-off-by: David S. Miller commit 23ae3a7877718931474684ef4fbbaf1d1511ee84 Author: Xiaoliang Yang Date: Thu Nov 18 18:12:01 2021 +0800 net: dsa: felix: add stream gate settings for psfp This patch adds stream gate settings for PSFP. Use SGI table to store stream gate entries. Disable the gate entry when it is not used by any stream. Signed-off-by: Xiaoliang Yang Signed-off-by: David S. Miller commit 7d4b564d6adde3167dd015f7dbb7aee1d7a4294e Author: Xiaoliang Yang Date: Thu Nov 18 18:12:00 2021 +0800 net: dsa: felix: support psfp filter on vsc9959 VSC9959 supports Per-Stream Filtering and Policing(PSFP) that complies with the IEEE 802.1Qci standard. The stream is identified by Null stream identification(DMAC and VLAN ID) defined in IEEE802.1CB. For PSFP, four tables need to be set up: stream table, stream filter table, stream gate table, and flow meter table. Identify the stream by parsing the tc flower keys and add it to the stream table. The stream filter table is automatically maintained, and its index is determined by SGID(flow gate index) and FMID(flow meter index). Signed-off-by: Xiaoliang Yang Signed-off-by: David S. Miller commit 23e2c506ad6c588b469e3d06cc20299434440d02 Author: Xiaoliang Yang Date: Thu Nov 18 18:11:59 2021 +0800 net: mscc: ocelot: add gate and police action offload to PSFP PSFP support gate and police action. This patch add the gate and police action to flower parse action, check chain ID to determine which block to offload. Adding psfp callback functions to add, delete and update gate and police in PSFP table if hardware supports it. Signed-off-by: Xiaoliang Yang Signed-off-by: David S. Miller commit 5b1918a54a9180fdb2276dd4a90976e066c410da Author: Xiaoliang Yang Date: Thu Nov 18 18:11:58 2021 +0800 net: mscc: ocelot: set vcap IS2 chain to goto PSFP chain Some chips in the ocelot series such as VSC9959 support Per-Stream Filtering and Policing(PSFP), which is processing after VCAP blocks. We set this block on chain 30000 and set vcap IS2 chain to goto PSFP chain if hardware support. Signed-off-by: Xiaoliang Yang Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit 0568c3bf3f34ad2f86e6b2dfaa0855aad9c1c562 Author: Xiaoliang Yang Date: Thu Nov 18 18:11:57 2021 +0800 net: mscc: ocelot: add MAC table stream learn and lookup operations ocelot_mact_learn_streamdata() can be used in VSC9959 to overwrite an FDB entry with stream data. The stream data includes SFID and SSID which can be used for PSFP and FRER set. ocelot_mact_lookup() can be used to check if the given {DMAC, VID} FDB entry is exist, and also can retrieve the DEST_IDX and entry type for the FDB entry. Signed-off-by: Xiaoliang Yang Signed-off-by: David S. Miller commit f6ef47e5bdc6f652176e433b02317fc83049f8d7 Author: Jeremy Kerr Date: Thu Nov 18 14:57:23 2021 +0800 mctp/test: Update refcount checking in route fragment tests In 99ce45d5e, we moved a route refcount decrement from mctp_do_fragment_route into the caller. This invalidates the assumption that the route test makes about refcount behaviour, so the route tests fail. This change fixes the test case to suit the new refcount behaviour. Fixes: 99ce45d5e7db ("mctp: Implement extended addressing") Signed-off-by: Jeremy Kerr Signed-off-by: David S. Miller commit 4cdf85ef2371e851d2a93602b7965fd5758e3ac4 Author: Yao Jing Date: Thu Nov 18 06:10:18 2021 +0000 ipv6: ah6: use swap() to make code cleaner Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid opencoding it. Reported-by: Zeal Robot Signed-off-by: Yao Jing Signed-off-by: David S. Miller commit df6160deb3debe6f964c16349f9431157ff67dda Author: Eric Dumazet Date: Wed Nov 17 17:57:29 2021 -0800 tcp: add missing htmldocs for skb->ll_node and sk->defer_list Add missing entries to fix these "make htmldocs" warnings. ./include/linux/skbuff.h:953: warning: Function parameter or member 'll_node' not described in 'sk_buff' ./include/net/sock.h:540: warning: Function parameter or member 'defer_list' not described in 'sock' Fixes: f35f821935d8 ("tcp: defer skb freeing after socket lock is released") Signed-off-by: Eric Dumazet Reported-by: Stephen Rothwell Signed-off-by: David S. Miller commit 4121113410fe16649d0a66c81715c8fab7740b14 Author: Hans de Goede Date: Sun Oct 24 17:50:20 2021 +0200 drm/i915/vlv_dsi: Double pixelclock on read-back for dual-link panels In intel_dsi_get_config() double the pclk returned by foo_dsi_get_pclk() for dual-link panels. This fixes the following WARN triggering: i915 0000:00:02.0: [drm] *ERROR* [CRTC:51:pipe A] mismatch in pixel_rate (expected 235710, found 118056) i915 0000:00:02.0: [drm] *ERROR* [CRTC:51:pipe A] mismatch in hw.pipe_mode.crtc_clock (expected 235710, found 118056) i915 0000:00:02.0: [drm] *ERROR* [CRTC:51:pipe A] mismatch in hw.adjusted_mode.crtc_clock (expected 235710, found 118056) i915 0000:00:02.0: [drm] *ERROR* [CRTC:51:pipe A] mismatch in port_clock (expected 235710, found 118056) ------------[ cut here ]------------ pipe state doesn't match! WARNING: CPU: 3 PID: 136 at drivers/gpu/drm/i915/display/intel_display.c:9125 intel_display_finish_reset+0x1bd3/0x2050 [i915] ... This has been tested on a Xiaomi Mi Pad 2 (with CHT x5-Z8500 SoC) tablet, with a 1536x2048 dual-link DSI panel. Note this fix was taken from icl_dsi.c which does the same in its get_config(). Cc: Tsuchiya Yuto Signed-off-by: Hans de Goede Acked-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20211024155020.126328-1-hdegoede@redhat.com commit 718cc29daa669cb1a8fee8f43309045018b0d4e0 Merge: 867ae8a7993b2 339f28964147d Author: David S. Miller Date: Thu Nov 18 11:49:52 2021 +0000 Merge branch '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue Tony Nguyen says: ==================== 10GbE Intel Wired LAN Driver Updates 2021-11-17 Radoslaw Tyl says: The change is a consequence of errors reported by the ixgbevf driver while starting several virtual guests at the same time on ESX host. During this, VF was not able to communicate correctly with the PF, as a result reported "PF still in reset state. Is the PF interface up?" and then goes to locked state. The only thing left was to reload the VF driver on the guest OS. The background of the problem is that the current PFU and VFU semaphore locking mechanism between sender and receiver may cause overriding Mailbox memory (VFMBMEM), in such scenario receiver of the original message will read the invalid, corrupted or one (or more) message may be lost. This change is actually as a support for communication with PF ESX driver and does not contains changes and support for ixgbe driver. For maintain backward compatibility, previous communication method has been preserved in the form of LEGACY functions. In the future there is a plan to add a support for a 1.5 mailbox API communication also to ixgbe driver. ==================== Signed-off-by: David S. Miller commit 867ae8a7993b26fc742703f748663cc2ac421db7 Author: Florian Fainelli Date: Wed Nov 17 09:36:29 2021 -0800 net: mdio: Replaced BUG_ON() with WARN() Killing the kernel because a certain MDIO bus object is not in the desired state at various points in the registration or unregistration paths is excessive and is not helping in troubleshooting or fixing issues. Replace the BUG_ON() with WARN() and print out the MDIO bus name to facilitate debugging. Signed-off-by: Florian Fainelli Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller commit 432b4941928b98fbe01f515fab6a7715c9dcebf6 Merge: 2228380135269 6d386f6613269 Author: David S. Miller Date: Thu Nov 18 11:38:45 2021 +0000 Merge branch 'dpaa2-phylink' Russell King says: ==================== net: dpaa2: phylink validate implementation updates This series converts dpaa2 to fill in the supported_interfaces member of phylink_config, cleans up the validate() implementation, and then converts to phylink_generic_validate(). Previous behaviour should be preserved. ==================== Signed-off-by: David S. Miller commit 6d386f6613269f53b9d21664e582d22e8cda7505 Author: Russell King (Oracle) Date: Wed Nov 17 17:24:13 2021 +0000 net: dpaa2-mac: use phylink_generic_validate() DPAA2 has no special behaviour in its validation implementation, so can be switched to phylink_generic_validate(). Signed-off-by: Russell King (Oracle) Signed-off-by: David S. Miller commit 22de481d23c90727510c9c4a37b89deb34e6ba3a Author: Russell King (Oracle) Date: Wed Nov 17 17:24:07 2021 +0000 net: dpaa2-mac: remove interface checks in dpaa2_mac_validate() As phylink checks the interface mode against the supported_interfaces bitmap, we no longer need to validate the interface mode, nor handle PHY_INTERFACE_MODE_NA in the validation function. Remove these to simplify the implementation. Signed-off-by: Russell King (Oracle) Signed-off-by: David S. Miller commit 15d0b14cec1c3ee3739d15fdcec3ebe1b847dd7c Author: Russell King Date: Wed Nov 17 17:24:02 2021 +0000 net: dpaa2-mac: populate supported_interfaces member Populate the phy interface mode bitmap for the Freescale DPAA2 driver with interfaces modes supported by the MAC. Signed-off-by: Russell King Signed-off-by: David S. Miller commit 222838013526923280fae9c466c755c01a792595 Merge: 6c950ca7c11c1 c8fa4bac30e1c Author: David S. Miller Date: Thu Nov 18 11:36:48 2021 +0000 Merge branch 'ag71xx-phylink' Russell King says: ==================== net: ag71xx: phylink validate implementation updates This series converts ag71xx to fill in the supported_interfaces member of phylink_config, cleans up the validate() implementation, and then converts to phylink_generic_validate(). The question over the port linkmode restriction has been answered by Oleksij - there is no reason for this restriction, so we can go the whole hog with this conversion. Thanks! ==================== Signed-off-by: David S. Miller commit c8fa4bac30e1ca4b0213f85fd868d0f14545d4c7 Author: Russell King (Oracle) Date: Wed Nov 17 16:46:31 2021 +0000 net: ag71xx: use phylink_generic_validate() ag71xx apparently only supports MII port type, which makes it different from other implementations. However, Oleksij says there is no special reason for this. Convert the driver to use phylink_generic_validate(), which will allow all ethtool port linkmodes instead of only MII, giving the driver consistent behaviour with other drivers. Signed-off-by: Russell King (Oracle) Signed-off-by: David S. Miller commit 5e20a8aa48a0c32dad6165b26d5030a6131a25ed Author: Russell King (Oracle) Date: Wed Nov 17 16:46:25 2021 +0000 net: ag71xx: remove interface checks in ag71xx_mac_validate() As phylink checks the interface mode against the supported_interfaces bitmap, we no longer need to validate the interface mode, nor handle PHY_INTERFACE_MODE_NA in the validation function. Remove these to simplify the implementation. Signed-off-by: Russell King (Oracle) Signed-off-by: David S. Miller commit 680e9d2cd4bf0d2a46e578aed5b330f946bd7620 Author: Russell King Date: Wed Nov 17 16:46:20 2021 +0000 net: ag71xx: populate supported_interfaces member Populate the phy_interface_t bitmap for the Atheros ag71xx driver with interfaces modes supported by the MAC. Signed-off-by: Russell King Signed-off-by: David S. Miller commit 6c950ca7c11c17e025326713b7668fd1fb2b996c Author: Bhupesh Sharma Date: Wed Nov 17 16:35:38 2021 +0530 net: stmmac: dwmac-qcom-ethqos: add platform level clocks management Split clocks settings from init callback into clks_config callback, which could support platform level clock management. Cc: David S. Miller Signed-off-by: Bhupesh Sharma Signed-off-by: David S. Miller commit 640a5fa50a42b99bfa2a0ec51b4ea9591d9bd055 Author: Mark Pearson Date: Wed Nov 17 13:44:53 2021 -0500 platform/x86: think-lmi: Opcode support Implement Opcode support. This is available on ThinkCenter and ThinkStations platforms and gives improved password setting capabilities Add options to configure System, HDD & NVMe passwords. HDD & NVMe passwords need a user level (user/master) along with drive index. Signed-off-by: Mark Pearson Link: https://lore.kernel.org/r/20211117184453.2476-2-markpearson@lenovo.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit b831281bb929ca6228ab898e1a97bb9284c07036 Author: NeilBrown Date: Wed Nov 17 15:34:42 2021 +1100 reiserfs: don't use congestion_wait() Block devices do not, in general, report congestion any more, so this congestion_wait() is effectively just a sleep. It isn't entirely clear what is being waited for, but as we only wait when j_async_throttle is elevated, it seems reasonable to stop waiting when j_async_throttle becomes zero - or after the same timeout. So change to use wait_event_event_timeout() for waiting, and wake_up_var() to signal an end to waiting. Link: https://lore.kernel.org/r/163712368225.13692.3419908086400748349@noble.neil.brown.name Signed-off-by: NeilBrown Signed-off-by: Jan Kara commit bc30c3b0c8a1904d83d5f0d60fb8650a334b207b Author: Hans de Goede Date: Sat Nov 6 14:02:27 2021 +0100 drm: panel-orientation-quirks: Add quirk for the Lenovo Yoga Book X91F/L The Lenovo Yoga Book X91F/L uses a panel which has been mounted 90 degrees rotated. Add a quirk for this. Cc: Yauhen Kharuzhy Signed-off-by: Hans de Goede Acked-by: Simon Ser Tested-by: Yauhen Kharuzhy Link: https://patchwork.freedesktop.org/patch/msgid/20211106130227.11927-1-hdegoede@redhat.com commit adca4b68713f3c2f9fc1b2b529296a5da6f1eb4b Author: Mark Pearson Date: Wed Nov 17 13:44:52 2021 -0500 Documentation: syfs-class-firmware-attributes: Lenovo Opcode support Newer Lenovo BIOS's have an opcode GUID support interface which provides - improved password setting control - ability to set System, hard drive and NVMe passwords Add the support for these new passwords, and the ability to select user/master mode and the drive index. Signed-off-by: Mark Pearson Link: https://lore.kernel.org/r/20211117184453.2476-1-markpearson@lenovo.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit a713ca234ea9d946235ac7248995c5fddfd9e523 Merge: 37fe0cf5fb803 fa55b7dcdc43c Author: Thomas Zimmermann Date: Thu Nov 18 09:36:39 2021 +0100 Merge drm/drm-next into drm-misc-next Backmerging from drm/drm-next for v5.16-rc1. Signed-off-by: Thomas Zimmermann commit 8ff978b8b222bc9d51dd109a46b51026336c95d8 Author: Riccardo Paolo Bestetti Date: Wed Nov 17 10:00:11 2021 +0100 ipv4/raw: support binding to nonlocal addresses Add support to inet v4 raw sockets for binding to nonlocal addresses through the IP_FREEBIND and IP_TRANSPARENT socket options, as well as the ipv4.ip_nonlocal_bind kernel parameter. Add helper function to inet_sock.h to check for bind address validity on the base of the address type and whether nonlocal address are enabled for the socket via any of the sockopts/sysctl, deduplicating checks in ipv4/ping.c, ipv4/af_inet.c, ipv6/af_inet6.c (for mapped v4->v6 addresses), and ipv4/raw.c. Add test cases with IP[V6]_FREEBIND verifying that both v4 and v6 raw sockets support binding to nonlocal addresses after the change. Add necessary support for the test cases to nettest. Signed-off-by: Riccardo Paolo Bestetti Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20211117090010.125393-1-pbl@bestov.io Signed-off-by: Jakub Kicinski commit 801cd261718e44adeb033c428390761adc03e2fc Author: David Heidelberg Date: Fri Oct 29 12:33:39 2021 +0200 ARM: dts: qcom: update USB nodes with new platform specific compatible To match dwc3 documentation, add compatible for platform. Signed-off-by: David Heidelberg Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211029103340.26828-2-david@ixit.cz commit d201f67714a302b12ad3d78b982963342939629c Author: Robert Marko Date: Thu Oct 7 13:58:46 2021 +0200 arm64: dts: qcom: ipq8074: add MDIO bus IPQ8074 uses an IPQ4019 compatible MDIO controller that is already supported in the kernel, so add the DT node in order to use it. Signed-off-by: Robert Marko Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211007115846.26255-1-robimarko@gmail.com commit 42dd1efffebd731e22623008058dd9c659812d1e Author: Kate Doeen Date: Thu Oct 28 12:20:16 2021 +0200 arm64: dts: qcom: sdm845-xiaomi-beryllium: set venus firmware path Enable loading the Qualcomm Venus video accelerator firmware on Xiaomi Pocophone F1. Signed-off-by: Kate Doeen Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211028102016.106063-1-jld3103yt@gmail.com commit 00128a57c0fe6ed90278cfec2adeccb83b7b49f4 Author: Kate Doeen Date: Thu Oct 28 12:19:57 2021 +0200 arm64: dts: qcom: sdm845-oneplus-common: set venus firmware path Enable loading the Qualcomm Venus video accelerator firmware on OnePlus sdm845 devices. Signed-off-by: Kate Doeen Reviewed-by: Caleb Connolly Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211028101957.106034-1-jld3103yt@gmail.com commit 37613aee217928dddf62d91d3db831827f860833 Author: Dikshita Agarwal Date: Tue Oct 26 20:22:02 2021 +0530 arm64: dts: qcom: sc7280: Add venus DT node Add DT entries for the sc7280 venus encoder/decoder. Co-developed-by: Mansur Alisha Shaik Signed-off-by: Mansur Alisha Shaik Signed-off-by: Dikshita Agarwal Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/1635259922-25378-1-git-send-email-quic_dikshita@quicinc.com commit 0112b06fde557d407c0d477ee7ed973e44e65c75 Author: Stephan Gerhold Date: Mon Oct 25 12:22:24 2021 +0200 arm64: dts: qcom: Add missing 'chassis-type's Add the "chassis-type" to msm8916-samsung-serranove and sm7225-fairphone-fp4 that were posted before the patch that added the chassis-type to existing device trees, but merged after it. Also, looks like sdm636-sony-xperia-ganges-mermaid was missing in commit eaa744b1c101 ("arm64: dts: qcom: add 'chassis-type' property") so add it there as well. Cc: Luca Weiss Cc: Arnaud Ferraris Signed-off-by: Stephan Gerhold Reviewed-by: Arnaud Ferraris Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211025102224.23746-1-stephan@gerhold.net commit fa244dca404c8b02999348098be7f2ae62670af0 Author: Srinivas Kandagatla Date: Wed Oct 6 17:47:12 2021 +0100 arm64: dts: qcom: sm8250-mtp: add sound card support This patch adds sound card support for MTP using WCD938x headset playback, capture, WSA8810 Speaker Playback and DMICs via VA macro. Signed-off-by: Srinivas Kandagatla Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211006164712.16078-5-srinivas.kandagatla@linaro.org commit 6fcda0b556cce2afee8322e3e01eeb9e3993eb6a Author: Srinivas Kandagatla Date: Wed Oct 6 17:47:11 2021 +0100 arm64: dts: qcom: sm8250-mtp: Add wsa8810 audio codec node SM8250-MTP has WSA8810 via wsa macro for Speaker playback use case. Add node for this device to be able to use it for sound card device. Signed-off-by: Srinivas Kandagatla Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211006164712.16078-4-srinivas.kandagatla@linaro.org commit 5a263cf629a85aa831081de4b9f85926bb067c08 Author: Srinivas Kandagatla Date: Wed Oct 6 17:47:10 2021 +0100 arm64: dts: qcom: sm8250-mtp: Add wcd9380 audio codec node SM8250-MTP has WCD9380 codec for headset playback and capture via rx and tx macro respectively. Add node for this device to be able to use it for sound card device. Signed-off-by: Srinivas Kandagatla Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211006164712.16078-3-srinivas.kandagatla@linaro.org commit 24f52ef0c4bfee3b18ca42bef47efa76abab56ab Author: Srinivas Kandagatla Date: Wed Oct 6 17:47:09 2021 +0100 arm64: dts: qcom: sm8250: Add nodes for tx and rx macros with soundwire masters SM8250 has TX and RX macros with SoundWire Controllers to attach with codecs like WCD938x. Add these nodes for sm8250 mtp audio use case. Signed-off-by: Srinivas Kandagatla Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211006164712.16078-2-srinivas.kandagatla@linaro.org commit 7f82d9c438797459c397d59209616469d9f5842c Author: Yongqiang Niu Date: Thu Oct 28 18:19:12 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: jason-jh.lin Signed-off-by: Chun-Kuang Hu commit 593b655f05238536d476b2f872b8a1488700fa18 Author: jason-jh.lin Date: Thu Oct 28 18:19:11 2021 +0800 drm/mediatek: Add mbox_free_channel in mtk_drm_crtc_destroy Add mbox_free_channel in mtk_drm_crtc_destroy. Signed-off-by: jason-jh.lin Signed-off-by: Chun-Kuang Hu commit 7627122fd1c06800a1fe624e9fb3c269796115e8 Author: Chun-Kuang Hu Date: Thu Oct 28 18:19:10 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 Signed-off-by: jason-jh.lin commit eaf80126aba6fd1754837eec91e4c8bbd58ae52e Author: Chun-Kuang Hu Date: Wed Oct 27 10:18:54 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 2 vblank. One vblank interrupt before send message (occasionally) and one vblank interrupt after cmdq done. If it fail to execute in next 3 vblank, tiemout happen. Signed-off-by: Chun-Kuang Hu Signed-off-by: jason-jh.lin commit 563c9d4a5b117552150efbecbaf0877947e98a32 Author: Chun-Kuang Hu Date: Thu Oct 28 18:19:08 2021 +0800 drm/mediatek: Remove the pointer of 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 the pointer of struct cmdq_client and let mtk_drm_crtc instance define cmdq_client as: struct mtk_drm_crtc { /* client instance data */ struct cmdq_client cmdq_client; }; and in rx_callback function, use struct mbox_client to get struct mtk_drm_crtc. Signed-off-by: Chun-Kuang Hu Signed-off-by: jason-jh.lin commit 1ee07a683b7e4e6ad9ad4f77fce4751741bc8ceb Author: Chun-Kuang Hu Date: Thu Oct 28 18:19:07 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 Signed-off-by: jason-jh.lin commit dd7f091fd22b1dce6c20e8f7769aa068ed88ac6d Author: Tirthendu Sarkar Date: Wed Nov 17 18:06:13 2021 +0530 selftests/bpf: Fix xdpxceiver failures for no hugepages xsk_configure_umem() needs hugepages to work in unaligned mode. So when hugepages are not configured, 'unaligned' tests should be skipped which is determined by the helper function hugepages_present(). This function erroneously returns true with MAP_NORESERVE flag even when no hugepages are configured. The removal of this flag fixes the issue. The test TEST_TYPE_UNALIGNED_INV_DESC also needs to be skipped when there are no hugepages. However, this was not skipped as there was no check for presence of hugepages and hence was failing. The check to skip the test has now been added. Fixes: a4ba98dd0c69 (selftests: xsk: Add test for unaligned mode) Signed-off-by: Tirthendu Sarkar Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20211117123613.22288-1-tirthendu.sarkar@intel.com commit 37fe0cf5fb803d98efd7feb64b408c9b029c1085 Author: Lyude Paul Date: Fri Nov 5 14:33:42 2021 -0400 drm/i915: Clarify probing order in intel_dp_aux_init_backlight_funcs() Hooray! We've managed to hit enough bugs upstream that I've been able to come up with a pretty solid explanation for how backlight controls are actually supposed to be detected and used these days. As well, having the rest of the PWM bits in VESA's backlight interface implemented seems to have fixed all of the problematic brightness controls laptop panels that we've hit so far. So, let's actually document this instead of just calling the laptop panels liars. As well, I would like to formally apologize to all of the laptop panels I called liars. I'm sorry laptop panels, hopefully you can all forgive me and we can move past this~ Signed-off-by: Lyude Paul Acked-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211105183342.130810-6-lyude@redhat.com commit f58a435311672305d8747f40e35235f7ed64ae69 Author: Lyude Paul Date: Fri Nov 5 14:33:41 2021 -0400 drm/dp, drm/i915: Add support for VESA backlights using PWM for brightness control Now that we've added support to i915 for controlling panel backlights that need PWM to be enabled/disabled, let's finalize this and add support for controlling brightness levels via PWM as well. This should hopefully put us towards the path of supporting _ALL_ backlights via VESA's DPCD interface which would allow us to finally start trusting the DPCD again. Note however that we still don't enable using this by default on i915 when it's not needed, primarily because I haven't yet had a chance to confirm if it's safe to do this on the one machine in Intel's CI that had an issue with this: samus-fi-bdw. I have done basic testing of this on other machines though, by manually patching i915 to force it into PWM-only mode on some of my laptops. v2: * Correct documentation (thanks Doug!) * Get rid of backlight caps Signed-off-by: Lyude Paul Reviewed-by: Doug Anderson Cc: Rajeev Nandan Cc: Satadru Pramanik Link: https://patchwork.freedesktop.org/patch/msgid/20211105183342.130810-5-lyude@redhat.com commit 646596485e1ed2182adf293dfd5aec4a96c46330 Author: Lyude Paul Date: Fri Nov 5 14:33:40 2021 -0400 drm/dp: Don't read back backlight mode in drm_edp_backlight_enable() As it turns out, apparently some machines will actually leave additional backlight functionality like dynamic backlight control on before the OS loads. Currently we don't take care to disable unsupported features when writing back the backlight mode, which can lead to some rather strange looking behavior when adjusting the backlight. So, let's fix this by just not reading back the current backlight mode on initial enable. I don't think there should really be any downsides to this, and this will ensure we don't leave any unsupported functionality enabled. This should fix at least one (but not all) of the issues seen with DPCD backlight support on fi-bdw-samus v5: * Just avoid reading back DPCD register - Doug Anderson Signed-off-by: Lyude Paul Fixes: 867cf9cd73c3 ("drm/dp: Extract i915's eDP backlight code into DRM helpers") Reviewed-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20211105183342.130810-4-lyude@redhat.com commit f5dee1283f6289342e720446ac777ce3aaf95f13 Author: Lyude Paul Date: Fri Nov 5 14:33:39 2021 -0400 drm/nouveau/kms/nv50-: Explicitly check DPCD backlights for aux enable/brightness Since we don't support hybrid AUX/PWM backlights in nouveau right now, let's add some explicit checks so that we don't break nouveau once we enable support for these backlights in other drivers. Reviewed-by: Karol Herbst Signed-off-by: Lyude Paul Link: https://patchwork.freedesktop.org/patch/msgid/20211105183342.130810-3-lyude@redhat.com commit 04f0d6cc62cc1eaf9242c081520c024a17ba86a3 Author: Lyude Paul Date: Fri Nov 5 14:33:38 2021 -0400 drm/i915: Add support for panels with VESA backlights with PWM enable/disable This simply adds proper support for panel backlights that can be controlled via VESA's backlight control protocol, but which also require that we enable and disable the backlight via PWM instead of via the DPCD interface. We also enable this by default, in order to fix some people's backlights that were broken by not having this enabled. For reference, backlights that require this and use VESA's backlight interface tend to be laptops with hybrid GPUs, but this very well may change in the future. v4: * Make sure that we call intel_backlight_level_to_pwm() in intel_dp_aux_vesa_enable_backlight() - vsyrjala Signed-off-by: Lyude Paul Link: https://gitlab.freedesktop.org/drm/intel/-/issues/3680 Fixes: fe7d52bccab6 ("drm/i915/dp: Don't use DPCD backlights that need PWM enable/disable") Reviewed-by: Ville Syrjälä Cc: # v5.12+ Link: https://patchwork.freedesktop.org/patch/msgid/20211105183342.130810-2-lyude@redhat.com commit b6a5f4f05592e79cad076767c8eac2aaf04fc61e Merge: 745a8e7cbea86 f063eba3e7a6a Author: Mark Brown Date: Wed Nov 17 22:29:46 2021 +0000 ASoC: SOF: Platform updates for AMD and Mediatek Merge series from Daniel Baluta : This patchseries adds AMD Renoir ACP HW support. commit 745a8e7cbea86eea1af441d6d039f8958bf30e36 Merge: 63eb462623d2c 2f0b1b013bbc5 Author: Mark Brown Date: Wed Nov 17 22:29:45 2021 +0000 ASoC: SOF: New debug feature: IPC message injector Merge series from Daniel Baluta : Add a test/debug feature allowing IPC messages to the DSP to be injected via debugfs. commit 63eb462623d2c95f7c7bad5d0d391e1825e39a68 Merge: 5c903f64ce971 bbf0e1d36519a Author: Mark Brown Date: Wed Nov 17 22:29:44 2021 +0000 ASoC: cs42l42: Remove redundant code Merge series from Richard Fitzgerald : Cleanups and code clarifications for the cs42l42 driver. commit 5931d9a3d0529dc803c792a10e52f0de1d0b9991 Author: Dave Tucker Date: Fri Nov 12 21:17:24 2021 +0000 bpf, docs: Fix ordering of bpf documentation This commit fixes the display of the BPF documentation in the sidebar when rendered as HTML. Before this patch, the sidebar would render as follows for some sections: | BPF Documentation |- BPF Type Format (BTF) |- BPF Type Format (BTF) This was due to creating a heading in index.rst followed by a sphinx toctree, where the file referenced carries the same title as the section heading. To fix this I applied a pattern that has been established in other subfolders of Documentation: 1. Re-wrote index.rst to have a single toctree 2. Split the sections out in to their own files Additionally maps.rst and programs.rst make use of a glob pattern to include map_* or prog_* rst files in their toctree, meaning future map or program type documentation will be automatically included. Signed-off-by: Dave Tucker Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/1a1eed800e7b9dc13b458de113a489641519b0cc.1636749493.git.dave@dtucker.co.uk commit f5b1c2ef43d79e054f471dc96996ac40bb262d8d Author: Dave Tucker Date: Fri Nov 12 21:17:23 2021 +0000 bpf, docs: Rename bpf_lsm.rst to prog_lsm.rst This allows for documentation relating to BPF Program Types to be matched by the glob pattern prog_* for inclusion in a sphinx toctree Signed-off-by: Dave Tucker Signed-off-by: Daniel Borkmann Acked-by: KP Singh Link: https://lore.kernel.org/bpf/49fe0f370a2b28500c1b60f1fdb6fb7ec90de28a.1636749493.git.dave@dtucker.co.uk commit 3ff36bffaf3545d46e7dedcd8b89e62591de246d Author: Dave Tucker Date: Fri Nov 12 21:17:22 2021 +0000 bpf, docs: Change underline in btf to match style guide This changes the type of underline used to follow the guidelines in Documentation/doc-guide/sphinx.rst which also ensures that the headings are rendered at the correct level in the HTML sidebar Signed-off-by: Dave Tucker Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/981b27485cc294206480df36fca46817e2553e39.1636749493.git.dave@dtucker.co.uk commit 5c903f64ce97172d63f7591cfa9e37cba58867b2 Author: Charles Keepax Date: Wed Nov 17 13:23:00 2021 +0000 firmware: cs_dsp: Allow creation of event controls Some firmwares contain controls intended to convey firmware state back to the host. Whilst more infrastructure will probably be needed for these in time, as a first step allow creation of the controls, so said firmwares arn't completely rejected. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20211117132300.1290-10-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit f444da38ac924748de696c393327a44c4b8d727e Author: Charles Keepax Date: Wed Nov 17 13:22:59 2021 +0000 firmware: cs_dsp: Add offset to cs_dsp read/write Provide a mechanism to access only part of a control through the cs_dsp interface. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20211117132300.1290-9-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit b329b3d39497a9fdb175d7e4fd77ae7170d5d26c Author: Charles Keepax Date: Wed Nov 17 13:22:58 2021 +0000 firmware: cs_dsp: Clarify some kernel doc comments Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20211117132300.1290-8-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 86c6080407740937ed2ba0ccd181e947f77e2154 Author: Charles Keepax Date: Wed Nov 17 13:22:57 2021 +0000 firmware: cs_dsp: Perform NULL check in cs_dsp_coeff_write/read_ctrl Add a NULL check to the cs_dsp_coeff_write/read_ctrl functions. This is a major convenience for users of the cs_dsp library as it allows the call to cs_dsp_get_ctl to be inlined with the call to read/write the control itself. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20211117132300.1290-7-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit dcee767667f44ed0d40a3debf507a3ba027a1994 Author: Charles Keepax Date: Wed Nov 17 13:22:56 2021 +0000 firmware: cs_dsp: Add support for rev 2 coefficient files Add support for the revision 2 coefficient file, this format is identical to revision 1 and was simply added by accident to some firmware. However unfortunately many firmwares have leaked into production using this and as such driver support really needs to be added for it. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20211117132300.1290-6-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 40a34ae7308682bbbf5827145afa23dcdfb1f090 Author: Charles Keepax Date: Wed Nov 17 13:22:55 2021 +0000 firmware: cs_dsp: Print messages from bin files The coefficient file contains various info strings, and the equivalent strings are printed from the WMFW file as it is loaded. Add support for printing these from the coefficient file as well. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20211117132300.1290-5-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 14055b5a3a23204c4702ae5d3f2a819ee081ce33 Author: Charles Keepax Date: Wed Nov 17 13:22:54 2021 +0000 firmware: cs_dsp: Add pre_run callback The code already has a post_run callback, add a matching pre_run callback to the client_ops that is called before execution is started. This callback provides a convenient place for the client code to set DSP controls or hardware that requires configuration before the DSP core actually starts execution. Note that placing this callback before cs_dsp_coeff_sync_controls is important to ensure that any control values are then correctly synced out to the chip. Co-authored-by: Simon Trimmer Signed-off-by: Simon Trimmer Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20211117132300.1290-4-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 2925748eadc33cba3bded7b69475a1b002b124ac Author: Charles Keepax Date: Wed Nov 17 13:22:53 2021 +0000 firmware: cs_dsp: Add version checks on coefficient loading The firmware coefficient files contain version information that is currently ignored by the cs_dsp code. This information specifies which version of the firmware the coefficient were generated for. Add a check into the code which prints a warning in the case the coefficient and firmware differ in version, in many cases this will be ok but it is not always, so best to let the user know there is a potential issue. Co-authored-by: Simon Trimmer Signed-off-by: Simon Trimmer Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20211117132300.1290-3-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 5065cfabec21a4acf562932f1d0a814c119e0a69 Author: Charles Keepax Date: Wed Nov 17 13:22:52 2021 +0000 firmware: cs_dsp: Add lockdep asserts to interface functions Some of the control functions exposed by the cs_dsp code require the pwr_lock to be held by the caller. Add lockdep_assert_held calls to ensure this is done correctly. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20211117132300.1290-2-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 56717d72f7a811799e8d138ff3d49325272c5cf6 Author: Charles Keepax Date: Wed Nov 17 13:22:51 2021 +0000 ASoC: wm_adsp: Remove the wmfw_add_ctl helper function The helper function wmfw_add_ctl is only called from one place and that place is a function with only 2 lines of code. Merge the helper function into the work function to simplify the code. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20211117132300.1290-1-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown commit 60630924bb5af8751adcecc896e7763c3783ca89 Author: Fabien Dessenne Date: Mon Oct 11 15:58:36 2021 +0200 hwspinlock: stm32: enable clock at probe Set the clock during probe and keep its control during suspend / resume operations. This fixes an issue when CONFIG_PM is not set and where the clock is never enabled. Make use of devm_ functions to simplify the code. Signed-off-by: Fabien Dessenne Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20211011135836.1045437-1-fabien.dessenne@foss.st.com commit 48c19a95f15e787bc46b274129da37bce06df259 Author: Perry Yuan Date: Thu Oct 28 06:05:42 2021 -0400 drm/amd/pm: add GFXCLK/SCLK clocks level print support for APUs add support that allow the userspace tool like RGP to get the GFX clock value at runtime, the fix follow the old way to show the min/current/max clocks level for compatible consideration. === Test === $ cat /sys/class/drm/card0/device/pp_dpm_sclk 0: 200Mhz * 1: 1100Mhz 2: 1600Mhz then run stress test on one APU system. $ cat /sys/class/drm/card0/device/pp_dpm_sclk 0: 200Mhz 1: 1040Mhz * 2: 1600Mhz The current GFXCLK value is updated at runtime. BugLink: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5260 Reviewed-by: Huang Ray Signed-off-by: Perry Yuan Signed-off-by: Alex Deucher commit 7eb0502ac0538ea9746481f3d7578940c8302c42 Author: Graham Sider Date: Wed Nov 10 18:19:30 2021 -0500 drm/amdkfd: replace asic_family with asic_type asic_family was a duplicate of asic_type, both of type amd_asic_type. Replace all instances of device_info->asic_family with adev->asic_type and remove asic_family from device_info. Signed-off-by: Graham Sider Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 046e674b961594e552fa6cd3cbbc34086b9580ac Author: Graham Sider Date: Tue Nov 9 16:25:24 2021 -0500 drm/amdkfd: convert misc checks to IP version checking Switch to IP version checking instead of asic_type on various KFD version checks. Signed-off-by: Graham Sider Reviewed-by: Alex Deucher Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit e4804a39ba5f72f0b8549445fe39725b2d1dff7e Author: Graham Sider Date: Thu Oct 28 14:49:31 2021 -0400 drm/amdkfd: convert switches to IP version checking Converts KFD switch statements to use IP version checking instead of asic_type. Signed-off-by: Graham Sider Reviewed-by: Alex Deucher Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit dd0ae064e71ada9cb2dd526607e140c7af690646 Author: Graham Sider Date: Tue Nov 9 16:22:44 2021 -0500 drm/amdkfd: convert KFD_IS_SOC to IP version checking Defined as GC HWIP >= IP_VERSION(9, 0, 1). Also defines KFD_GC_VERSION to return GC HWIP version. Signed-off-by: Graham Sider Reviewed-by: Alex Deucher Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 73729a7d079dff45fa906a5b8bdc4a5edd775ee5 Author: Guchun Chen Date: Thu Nov 11 11:15:08 2021 +0800 drm/amdgpu: add error print when failing to add IP block(v2) Driver initialization is driven by IP version from IP discovery table. So add error print when failing to add ip block during driver initialization, this will be more friendly to user to know which IP version is not correct. [ 40.467361] [drm] host supports REQ_INIT_DATA handshake [ 40.474076] [drm] add ip block number 0 [ 40.474090] [drm] add ip block number 1 [ 40.474101] [drm] add ip block number 2 [ 40.474103] [drm] add ip block number 3 [ 40.474114] [drm] add ip block number 4 [ 40.474119] [drm] add ip block number 5 [ 40.474134] [drm] add ip block number 6 [ 40.474143] [drm] add ip block number 7 [ 40.474147] amdgpu 0000:00:08.0: amdgpu: Fatal error during GPU init [ 40.474545] amdgpu 0000:00:08.0: amdgpu: amdgpu: finishing device. v2: use dev_err to multi-GPU system Signed-off-by: Guchun Chen Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit 8bd1b7c29b3c3fb537265a3891c1fb8e78e9da45 Author: Luben Tuikov Date: Wed Nov 10 14:58:55 2021 -0500 drm/amd/pm: Enhanced reporting also for a stuck command Also print the message index and parameter of the stuck command. Cc: Alex Deucher Signed-off-by: Luben Tuikov Acked-by: Alex Deucher Signed-off-by: Alex Deucher commit d3c983010f6faf59eeae1b92e2fcfe0696e80eaa Author: ran jianping Date: Wed Nov 10 05:53:03 2021 +0000 drm/amdgpu: remove unneeded variable Fix the following coccicheck review: ./drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c:1174:14-18 :Unneeded variable Remove unneeded variable used to store return value. Reported-by: Zeal Robot Signed-off-by: ran jianping Signed-off-by: Alex Deucher commit a6506cd845824fe92b1760aaf104011cc04dfa78 Author: Xu Wang Date: Wed Nov 10 09:42:42 2021 +0000 drm/radeon: correct indentation Correct indentation in radeon_driver_load_kms. Signed-off-by: Xu Wang Signed-off-by: Alex Deucher commit 02274fc0f6725988d4a67005cca6f40c50679499 Author: Graham Sider Date: Fri Nov 5 14:24:57 2021 -0400 drm/amdkfd: replace trivial funcs with direct access These get funcs simply return an adev field. Replace funcs/calls with direct field accesses instead. Signed-off-by: Graham Sider Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 68ca1c3e57c40a205de9d31518fd1dab5f47f520 Author: Shirish S Date: Tue Nov 9 10:41:26 2021 +0530 drm/amd/display: log amdgpu_dm_atomic_check() failure cause update developers with next level of info about unsupported display configuration query that led to atomic check failure. Signed-off-by: Shirish S Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher commit d493a0244fce12de22a220468e6628bb008a0e58 Author: Alvin Lee Date: Thu Nov 4 16:52:15 2021 -0400 drm/amd/display: Wait for ACK for INBOX0 HW Lock [Why] In DC we want to wait for the INBOX0 HW Lock command to ACK before continuing. This is to ensure that the lock has been successfully acquired before programming HW in DC. [How] Add interfaces to send messages on INBOX0, poll for their completation and clear the ack. Reviewed-by: Nicholas Kazlauskas Acked-by: Anson Jacob Tested-by: Daniel Wheeler Signed-off-by: Alvin Lee Signed-off-by: Alex Deucher commit 7a47c8820a1d97e6cb5bcef6b65529f1389b0e13 Author: Jimmy Kizito Date: Thu Nov 4 16:52:14 2021 -0400 drm/amd/display: Initialise encoder assignment when initialising dc_state [Why] Link encoder assignment tracking variables need to be (re)initialised whenever dc_state is (re)initialised. Otherwise variables used for dynamic encoder assignment (especially the link encoder availability pool) are out of sync with dc_state and future encoder assignments are invalid. [How] Initialise encoder assignment variables when creating new dc_state resource. Reviewed-by: Jun Lei Acked-by: Anson Jacob Tested-by: Daniel Wheeler Signed-off-by: Jimmy Kizito Signed-off-by: Alex Deucher commit aadb06f9c9729ee3af1543f54da966644ebc5be7 Author: Jimmy Kizito Date: Thu Nov 4 16:52:13 2021 -0400 drm/amd/display: Query all entries in assignment table during updates. [Why] Stream ordering and count can vary from one state to the next. Only checking a subset of entries in the encoder assignment table can lead to invalid encoder assignments. [How] Check all entries in encoder assignment table when querying it. Reviewed-by: Jun Lei Acked-by: Anson Jacob Tested-by: Daniel Wheeler Signed-off-by: Jimmy Kizito Signed-off-by: Alex Deucher commit 548f212514151b0d6ec911c87e61f189f530255b Author: Robin Chen Date: Thu Nov 4 16:52:12 2021 -0400 drm/amd/display: To support sending TPS3 pattern when restoring link [Why] Some panels require to use TPS3 pattern to wake up link in PSR mode. [How] To add TPS3 selection information in PSR settings command and pass to DMUB FW. Reviewed-by: Anthony Koo Acked-by: Anson Jacob Tested-by: Daniel Wheeler Signed-off-by: Robin Chen Signed-off-by: Alex Deucher commit ec581edc56d39d3a6450894f26583b36480acffa Author: Aric Cyr Date: Thu Nov 4 16:52:11 2021 -0400 drm/amd/display: 3.2.161 This version brings along following fixes: - Improvements to INBOX0 HW Lock - Add support for sending TPS3 pattern - Fix Coverity Issues - Fixes for DMUB - Fix RGB MPO underflow with multiple displays - WS fixes and code restructure Acked-by: Anson Jacob Signed-off-by: Aric Cyr Signed-off-by: Alex Deucher commit 0ec283cd043dbc65e0f17230695a6ccdb0f439d4 Author: Charlene Liu Date: Thu Nov 4 16:52:10 2021 -0400 drm/amd/display: Adjust code indentation Reviewed-by: Sung joon Kim Acked-by: Anson Jacob Tested-by: Daniel Wheeler Signed-off-by: Charlene Liu Signed-off-by: Alex Deucher commit 6ef86fa8ccc8a3200fc89e8c9b50f1b90144b65c Author: Meenakshikumar Somasundaram Date: Thu Nov 4 16:52:09 2021 -0400 drm/amd/display: Add hpd pending flag to indicate detection of new hpd [Why] For dpia link, link->hpd_status indicates current state, but driver fails to capture hpd transitions in certain scenarios such as during link training. [How] Added link->hpd_pending flag that captures arrival of new hpd. Reviewed-by: Jun Lei Acked-by: Anson Jacob Tested-by: Daniel Wheeler Signed-off-by: Meenakshikumar Somasundaram Signed-off-by: Alex Deucher commit 095041dbfa03a193c7e76c00b0cdd1cfcd45869e Author: Chris Park Date: Thu Nov 4 16:52:08 2021 -0400 drm/amd/display: Fix Coverity Issues [Why] Coverity discovers holes in logic that needs to be addressed for improved code integrity. [How] Address issues found by coverity without changing the actual logic. Reviewed-by: Aric Cyr Acked-by: Anson Jacob Tested-by: Daniel Wheeler Signed-off-by: Chris Park Signed-off-by: Alex Deucher commit 4cbe435dd68884a9f6669fceb20f3e70a70c7702 Author: Sung Joon Kim Date: Thu Nov 4 16:52:05 2021 -0400 drm/amd/display: retain/release stream pointer in link enc table [why] At every reference to stream pointer, we need to increment/decrement the kref_count. Not doing so will result in invalid stream pointer still alive after hibernate cycle. [how] Call stream retain/release whenever the link encoder assignment is set to true/false since it indicates if we want to reference the stream pointer or not. Reviewed-by: Jun Lei Acked-by: Anson Jacob Tested-by: Daniel Wheeler Signed-off-by: Sung Joon Kim Signed-off-by: Alex Deucher commit e43098f6abb033142810e695c1b3d9cf61e19849 Author: Roy Chan Date: Thu Nov 4 16:52:04 2021 -0400 drm/amd/display: fix stale info in link encoder assignment [Why] The link encoder assignment leaves the old stream data when it was unassigned. When the clear encoder assignment is called, it based on the old stale data to access the de-allocated stream. [How] There should be no need to explicitly clean up the link encoder assignment if the unassign loop does the work properly, the loop should base on the current state to clean up the assignment. Also, the unassignment should better clean up the values in the assignement slots as well. Reviewed-by: Jun Lei Acked-by: Anson Jacob Tested-by: Daniel Wheeler Signed-off-by: Roy Chan Signed-off-by: Alex Deucher commit 64266f0a45c8323861d3756cbe3dc419e973917c Author: Huang, ChiaWen Date: Thu Nov 4 16:52:03 2021 -0400 drm/amd/display: use link_rate_set above DPCD 1.3 (#1527) [Why & How] According to eDP spec, DPCD 1.3 is only for eDP DPCD v1.4 In dpcd_set_link_settings function, the driver is just above v1.3 Reviewed-by: Wenjing Liu Acked-by: Anson Jacob Tested-by: Daniel Wheeler Signed-off-by: ChiawenHuang Signed-off-by: Alex Deucher commit 426b4c4fe52c6983b40f4d904a4ef430409f315c Author: Charlene Liu Date: Thu Nov 4 16:52:02 2021 -0400 drm/amd/display: clean up some formats and log [why] reduce az indirect register dump. need add az clock_gating control field used in some project. [how] conditional output indrect register in the log. add clock_gating feild Reviewed-by: Sung joon Kim Acked-by: Anson Jacob Tested-by: Daniel Wheeler Signed-off-by: Charlene Liu Signed-off-by: Alex Deucher commit b57d16bdd62cc8c231aad8385d667249939cdfe3 Author: Dmytro Laktyushkin Date: Thu Nov 4 16:52:01 2021 -0400 drm/amd/display: bring dcn31 clk mgr in line with other version style Reviewed-by: Nicholas Kazlauskas Acked-by: Anson Jacob Tested-by: Daniel Wheeler Signed-off-by: Dmytro Laktyushkin Signed-off-by: Alex Deucher commit 1328e395fd62070a29dbf28435ef8da1ba780e6c Author: Nicholas Kazlauskas Date: Thu Nov 4 16:52:00 2021 -0400 drm/amd/display: Fix detection of aligned DMUB firmware meta info [Why] A built firmware binary may be aligned to 16-bytes with padding at the end as necessary. In the case that padding was applied the meta info will not be detected correctly and we won't be able to allocate the appropriate firmware and tracebuffer sizes. [How] To maintain compatibility with already released firmware where this occurs we need to try every meta offset from 0..15 inclusive. Extract out the meta info checker into a helper function that's called for each of these offsets and exit early when we've found it. Reviewed-by: Eric Yang Acked-by: Anson Jacob Tested-by: Daniel Wheeler Signed-off-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher commit cfd3f70ebd9e761754da8ab195ef7ff476d5cb25 Author: Jimmy Kizito Date: Thu Nov 4 16:51:59 2021 -0400 drm/amd/display: Use link_enc_cfg API for queries. [Why] The link_enc_cfg API operates in one of two modes depending on the stage of application of dc_state to hardware. The API is the safest way to query link encoder assignments. [How] Use results of link encoder assignment query using link_enc_cfg API. Reviewed-by: Jun Lei Acked-by: Anson Jacob Tested-by: Daniel Wheeler Signed-off-by: Jimmy Kizito Signed-off-by: Alex Deucher commit 80c5f69b94249dc1e0a600cbef3cc055ea432af9 Author: Angus Wang Date: Thu Nov 4 16:51:58 2021 -0400 drm/amd/display: Fix RGB MPO underflow with multiple displays [WHY] With RGB MPO enabled, playing a video with multiple displays connected results in underflow when closing the video window [HOW] Reverted the old change to fix this problem, which prevented pipe splits for multiple display configurations and caused high MCLK speeds during idle. Added a two step call to dc_update_planes_and_stream, first time with pipe split disabled and the second time with pipe split enabled, which fixed the underflow issue Reviewed-by: Aric Cyr Acked-by: Anson Jacob Tested-by: Daniel Wheeler Signed-off-by: Angus Wang Signed-off-by: Alex Deucher commit 1f6c9ab06f61d86a80056ab57f9c6b7beca3af27 Author: Charlene Liu Date: Thu Nov 4 16:51:56 2021 -0400 drm/amd/display: remove dmcub_support cap dependency [why] matching the dmcub_support with all other dcn version. Reviewed-by: Sung joon Kim Reviewed-by: Martin Leung Acked-by: Anson Jacob Tested-by: Daniel Wheeler Signed-off-by: Charlene Liu Signed-off-by: Alex Deucher commit f0d0c39149f817e5ecdff8fa164f44da455b3317 Author: Mikita Lipski Date: Thu Nov 4 16:51:55 2021 -0400 drm/amd/display: Pass panel inst to a PSR command [why] PSR set power command wasn't setting panel instance and command version which caused both streams to overwrite the same PSR state. [how] Pass panel instance to the set power command function and to DMUB and set command version enum Reviewed-by: Anthony Koo Acked-by: Anson Jacob Tested-by: Daniel Wheeler Signed-off-by: Mikita Lipski Signed-off-by: Alex Deucher commit ebd1e719695824ca2b9225094a669fef35620676 Author: Leo (Hanghong) Ma Date: Thu Nov 4 16:51:54 2021 -0400 drm/amd/display: Add helper for blanking all dp displays [Why & How] 1. The code to blank all dp display have been called many times, so add helpers in dc_link to make it more concise. 2. Add some check to fix the dmesg errors at boot and resume from S3 on dcn3.1 during DQE's promotion test. Reviewed-by: Alvin Lee Reviewed-by: Wesley Chalmers Reviewed-by: Aric Cyr Acked-by: Anson Jacob Tested-by: Daniel Wheeler Signed-off-by: Leo (Hanghong) Ma Signed-off-by: Alex Deucher commit b97788e504daf4ed455ec35047977a3016355571 Author: Ye Guojin Date: Tue Nov 2 07:01:25 2021 +0000 drm/amd/display: remove unnecessary conditional operators Since the variables named is_end_of_payload and hpd_status are already bool type, the ?: conditional operator is unnecessary any more. Clean them up here. Reported-by: Zeal Robot Reviewed-by: Simon Ser Signed-off-by: Ye Guojin Signed-off-by: Alex Deucher commit 26db557e35d6b229b31078ebd6939b4cad936f6f Author: Nirmoy Das Date: Fri Oct 29 16:06:04 2021 +0200 drm/amdgpu: return early on error while setting bar0 memtype We set WC memtype for aper_base but don't check return value of arch_io_reserve_memtype_wc(). Be more defensive and return early on error. Signed-off-by: Nirmoy Das Reviewed-by: Christian König Signed-off-by: Alex Deucher commit d5a28852e86ef486ee34e4cf72e8ad99a36f4fc3 Author: Nirmoy Das Date: Fri Oct 22 13:00:30 2021 +0200 drm/amdgpu: remove unnecessary checks amdgpu_ttm_backend_bind() only needed for TTM_PL_TT and AMDGPU_PL_PREEMPT. Signed-off-by: Nirmoy Das Acked-by: Christian König Signed-off-by: Alex Deucher commit b5f57384805a34f497edb8b04d694a8a1b3d81d4 Author: Felix Kuehling Date: Fri Sep 10 15:18:20 2021 -0400 drm/amdkfd: Add sysfs bitfields and enums to uAPI These bits are de-facto part of the uAPI, so declare them in a uAPI header. The corresponding bit-fields and enums in user mode are defined in https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface/blob/master/include/hsakmttypes.h HSA_CAP_... -> HSA_CAPABILITY HSA_MEM_HEAP_TYPE_... -> HSA_HEAPTYPE HSA_MEM_FLAGS_... -> HSA_MEMORYPROPERTY HSA_CACHE_TYPE_... -> HsaCacheType HSA_IOLINK_TYPE_... -> HSA_IOLINKTYPE HSA_IOLINK_FLAGS_... -> HSA_LINKPROPERTY Signed-off-by: Felix Kuehling Reviewed-by: Jonathan Kim Signed-off-by: Alex Deucher commit 087451f372bf76d971184caa258807b7c35aac8f Author: Evan Quan Date: Tue Oct 19 17:26:37 2021 -0400 drm/amdgpu: use generic fb helpers instead of setting up AMD own's. With the shadow buffer support from generic framebuffer emulation, it's possible now to have runpm kicked when no update for console. Signed-off-by: Evan Quan Acked-by: Christian König Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher commit b5d1d755c1344075d4f16a3e6183ed04b4d022ef Author: Graham Sider Date: Tue Oct 19 13:28:45 2021 -0400 drm/amdkfd: remove kgd_dev declaration and initialization Completes removal of kgd_dev. Direct references to amdgpu_device objects should now be used instead. Signed-off-by: Graham Sider Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 56c5977eae8799c9a71ee2112802fd1f1591dc3a Author: Graham Sider Date: Tue Oct 19 13:22:07 2021 -0400 drm/amdkfd: replace/remove remaining kgd_dev references Remove get_amdgpu_device and other remaining kgd_dev references aside from declaration/kfd struct entry and initialization. Signed-off-by: Graham Sider Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit dff63da93e458489d0ef7e3a92e1b14de450414f Author: Graham Sider Date: Tue Oct 19 11:46:58 2021 -0400 drm/amdkfd: replace kgd_dev in gpuvm amdgpu_amdkfd funcs Modified definitions: - amdgpu_amdkfd_gpuvm_acquire_process_vm - amdgpu_amdkfd_gpuvm_release_process_vm - amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu - amdgpu_amdkfd_gpuvm_free_memory_of_gpu - amdgpu_amdkfd_gpuvm_map_memory_to_gpu - amdgpu_amdkfd_gpuvm_unmap_memory_from_gpu - amdgpu_amdkfd_gpuvm_sync_memory - amdgpu_amdkfd_gpuvm_map_gtt_bo_to_kernel - amdgpu_amdkfd_gpuvm_unmap_gtt_bo_from_kernel - amdgpu_amdkfd_gpuvm_get_vm_fault_info - amdgpu_amdkfd_gpuvm_import_dmabuf - amdgpu_amdkfd_get_tile_config Removed: - get_amdgpu_device Signed-off-by: Graham Sider Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 574c4183ef75117f763e9f2b35e08c85f5dcad2d Author: Graham Sider Date: Tue Oct 19 10:42:38 2021 -0400 drm/amdkfd: replace kgd_dev in get amdgpu_amdkfd funcs Modified definitions: - amdgpu_amdkfd_get_fw_version - amdgpu_amdkfd_get_local_mem_info - amdgpu_amdkfd_get_gpu_clock_counter - amdgpu_amdkfd_get_max_engine_clock_in_mhz - amdgpu_amdkfd_get_cu_info - amdgpu_amdkfd_get_dmabuf_info - amdgpu_amdkfd_get_vram_usage - amdgpu_amdkfd_get_hive_id - amdgpu_amdkfd_get_unique_id - amdgpu_amdkfd_get_mmio_remap_phys_addr - amdgpu_amdkfd_get_num_gws - amdgpu_amdkfd_get_asic_rev_id - amdgpu_amdkfd_get_noretry - amdgpu_amdkfd_get_xgmi_hops_count - amdgpu_amdkfd_get_xgmi_bandwidth_mbytes - amdgpu_amdkfd_get_pcie_bandwidth_mbytes Also replaces kfd_device_by_kgd with kfd_device_by_adev, now searching via adev rather than kgd. Signed-off-by: Graham Sider Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 6bfc7c7e175e6ca8b827cbda382b6e1e6585954b Author: Graham Sider Date: Tue Oct 19 10:11:02 2021 -0400 drm/amdkfd: replace kgd_dev in various amgpu_amdkfd funcs Modified definitions: - amdgpu_amdkfd_submit_ib - amdgpu_amdkfd_set_compute_idle - amdgpu_amdkfd_have_atomics_support - amdgpu_amdkfd_flush_gpu_tlb_pasid - amdgpu_amdkfd_flush_gpu_tlb_pasid - amdgpu_amdkfd_gpu_reset - amdgpu_amdkfd_alloc_gtt_mem - amdgpu_amdkfd_free_gtt_mem - amdgpu_amdkfd_alloc_gws - amdgpu_amdkfd_free_gws - amdgpu_amdkfd_ras_poison_consumption_handler Signed-off-by: Graham Sider Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 3356c38dc1b6f74717a9c437b47e9362c8c96ba3 Author: Graham Sider Date: Thu Oct 14 11:13:33 2021 -0400 drm/amdkfd: replace kgd_dev in various kfd2kgd funcs Modified definitions: - program_sh_mem_settings - set_pasid_vmid_mapping - init_interrupts - address_watch_disable - address_watch_execute - wave_control_execute - address_watch_get_offset - get_atc_vmid_pasid_mapping_info - set_scratch_backing_va - set_vm_context_page_table_base - read_vmid_from_vmfault_reg - get_cu_occupancy - program_trap_handler_settings Signed-off-by: Graham Sider Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 420185fdadbf0f74cff90f466df5c44c1ff3dda0 Author: Graham Sider Date: Fri Oct 15 14:32:00 2021 -0400 drm/amdkfd: replace kgd_dev in hqd/mqd kfd2kgd funcs Modified definitions: - hqd_load - hiq_mqd_load - hqd_sdma_load - hqd_dump - hqd_sdma_dump - hqd_is_occupied - hqd_destroy - hqd_sdma_is_occupied - hqd_sdma_destroy Signed-off-by: Graham Sider Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit c531a58bb61bc7eca3d58f5adc08a246af262244 Author: Graham Sider Date: Thu Oct 14 10:57:11 2021 -0400 drm/amdkfd: replace kgd_dev in static gfx v10_3 funcs Static funcs in amdgpu_amdkfd_gfx_v10_3.c now using amdgpu_device. Signed-off-by: Graham Sider Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 4056b033774664fe878d25f6087a1c41c82d075e Author: Graham Sider Date: Thu Oct 14 10:55:16 2021 -0400 drm/amdkfd: replace kgd_dev in static gfx v10 funcs Static funcs in amdgpu_amdkfd_gfx_v10.c now using amdgpu_device. Signed-off-by: Graham Sider Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 9a17c9b79b4d112632ba44a821799281445eb28f Author: Graham Sider Date: Thu Oct 14 10:37:05 2021 -0400 drm/amdkfd: replace kgd_dev in static gfx v9 funcs Static funcs in amdgpu_amdkfd_gfx_v9.c now using amdgpu_device. Signed-off-by: Graham Sider Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 1cca6087422d84fee7450a8eb115a0b27ecc7e79 Author: Graham Sider Date: Thu Oct 14 10:52:06 2021 -0400 drm/amdkfd: replace kgd_dev in static gfx v8 funcs Static funcs in amdgpu_amdkfd_gfx_v8.c now using amdgpu_device. Signed-off-by: Graham Sider Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 9365fbf3d74bb6febfa7e31cd1c32d0d4d4b8393 Author: Graham Sider Date: Thu Oct 14 10:44:34 2021 -0400 drm/amdkfd: replace kgd_dev in static gfx v7 funcs Static funcs in amdgpu_amdkfd_gfx_v7.c now using amdgpu_device. Signed-off-by: Graham Sider Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit c6c57446383a3dea098fc324f0c7f696c451cf3d Author: Graham Sider Date: Tue Oct 12 12:16:15 2021 -0400 drm/amdkfd: add amdgpu_device entry to kfd_dev Patch series to remove kgd_dev struct and replace all instances with amdgpu_device objects. amdgpu_device needs to be declared in kgd_kfd_interface.h to be visible to kfd2kgd_calls. Signed-off-by: Graham Sider Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher commit 2a67fcfa0db6b4075515bd23497750849b88850f Author: Kamal Heib Date: Wed Nov 17 16:59:54 2021 +0200 RDMA/hns: Validate the pkey index Before query pkey, make sure that the queried index is valid. Fixes: 9a4435375cd1 ("IB/hns: Add driver files for hns RoCE driver") Link: https://lore.kernel.org/r/20211117145954.123893-1-kamalheib1@gmail.com Signed-off-by: Kamal Heib Signed-off-by: Jason Gunthorpe commit 679f2b7552b4f3c28ba54ef4c5e7ab28374e30d2 Author: Kamal Heib Date: Wed Nov 17 11:02:05 2021 +0200 RDMA/ocrdma: Use helper function to set GUIDs Use addrconf_addr_eui48() helper function to set the GUIDs and remove the driver specific version. Link: https://lore.kernel.org/r/20211117090205.96523-1-kamalheib1@gmail.com Signed-off-by: Kamal Heib Signed-off-by: Jason Gunthorpe commit 999ed03518cb01aa9ef55c025db79567eec6268c Author: Mauro Carvalho Chehab Date: Wed Nov 17 17:44:26 2021 +0000 media: atomisp: cleanup qbuf logic The logic there is meant to be used by newer firmwares. clean it up, in order to make compatible with the chosen firmware version. Signed-off-by: Mauro Carvalho Chehab commit 3c82bf0295252f6dd9af864770b1cbc583dde14c Author: Mauro Carvalho Chehab Date: Wed Nov 17 14:55:04 2021 +0000 media: atomisp: add YUVPP at __atomisp_get_pipe() logic Aligns it which the Intel Aero firmware. Signed-off-by: Mauro Carvalho Chehab commit 72fb16a130aca80ff3b7cc520078785a23651f26 Author: Mauro Carvalho Chehab Date: Wed Nov 17 18:41:06 2021 +0000 media: atomisp: frame.c: drop a now-unused function ia_css_frame_find_crop_resolution() is not used anymore. So, remove it. Signed-off-by: Mauro Carvalho Chehab commit c37ed67335518948ec21c4bce811f6aa847301b0 Author: Mauro Carvalho Chehab Date: Wed Nov 17 18:58:25 2021 +0000 media: atomisp: pipe_binarydesc: drop logic incompatible with firmware As we're using this firmware for ISP2401: https://github.com/intel-aero/meta-intel-aero-base/blob/master/recipes-kernel/linux/linux-yocto/shisp_2401a0_v21.bin Revert some changes that are not compatible with it, making the code close to the Intel Aero one. Signed-off-by: Mauro Carvalho Chehab commit 5c5a95385ad644b7d698718c2d8eae1f9fe9b678 Author: Mauro Carvalho Chehab Date: Wed Nov 17 18:32:09 2021 +0000 media: atomisp: binary.c: drop logic incompatible with firmware As we're using this firmware for ISP2401: https://github.com/intel-aero/meta-intel-aero-base/blob/master/recipes-kernel/linux/linux-yocto/shisp_2401a0_v21.bin It makes no sense to try to select a non-existing binary inside the firmware. So, revert it to reflect the Intel Aero device driver. Signed-off-by: Mauro Carvalho Chehab commit 4f948a3283809317389d54077cbc2b08bac536f4 Author: Mauro Carvalho Chehab Date: Wed Nov 17 17:44:26 2021 +0000 media: atomisp: simplify binary.c Signed-off-by: Mauro Carvalho Chehab commit 3f323bb4cfdf53ab6e23e6be7979066826cab7a9 Author: Mauro Carvalho Chehab Date: Wed Nov 17 17:15:09 2021 +0000 media: atomisp: get rid of set pipe version custom ctrl It doesn't make sense to have a control for that. Besides that, the Intel Aero implementation doesn't have, which means that even the custom control is not used in practice, at least outside Android. So, get rid of it. Signed-off-by: Mauro Carvalho Chehab commit 13d72e694271dcc67029dc5bb7709053b813fe2d Author: Mauro Carvalho Chehab Date: Wed Nov 17 14:13:11 2021 +0000 media: atomisp: atomisp_cmd: make it more compatible with firmware Change some recovery logic at the driver, in order to make it more compatible with ISP2401 Intel Aero firmware. Signed-off-by: Mauro Carvalho Chehab commit 3d697a4a6b7dab8fb8a8c928b640999af3a08d87 Author: Eric Biggers Date: Fri Jul 16 09:39:13 2021 -0500 f2fs: rework write preallocations f2fs_write_begin() assumes that all blocks were preallocated by default unless FI_NO_PREALLOC is explicitly set. This invites data corruption, as there are cases in which not all blocks are preallocated. Commit 47501f87c61a ("f2fs: preallocate DIO blocks when forcing buffered_io") fixed one case, but there are others remaining. Fix up this logic by replacing this flag with FI_PREALLOCATED_ALL, which only gets set if all blocks for the current write were preallocated. Also clean up f2fs_preallocate_blocks(), move it to file.c, and make it handle some of the logic that was previously in write_iter() directly. Signed-off-by: Eric Biggers Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 3271d7eb00f1df82d9ea26b359ed065129639f7c Author: Fengnan Chang Date: Wed Nov 10 10:37:13 2021 +0800 f2fs: compress: reduce one page array alloc and free when write compressed page Don't alloc new page pointers array to replace old, just use old, introduce valid_nr_cpages to indicate valid number of page pointers in array, try to reduce one page array alloc and free when write compress page. Signed-off-by: Fengnan Chang Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim commit 98c3384fa770da1e782c6e07e0077825ec46c23f Author: Ben Tseng Date: Wed Nov 3 11:30:44 2021 +0800 arm64: dts: mt8183-kukui: Update Tboard sensor mapping table According to auxadc change the readback value from raw data to Vsense. Update the tboard table that temperature map to Vsense. pull-up voltage: 1800 mv pull-up resistor: 75K Vsense = pull-up voltage * Rntc / ( pull-up resistor + Rntc ) Signed-off-by: Ben Tseng Tested-by: Hsin-Yi Wang Link: https://lore.kernel.org/r/20211103033044.2777-1-ben.tseng@mediatek.com Signed-off-by: Matthias Brugger commit 7d71d289e1ba86838bc908d5ce216a208815fd01 Author: Maslov Dmitry Date: Sat Nov 6 18:41:37 2021 +0100 iio: light: ltr501: Added ltr303 driver support Previously ltr501 driver supported a number of light and, proximity sensors including ltr501, ltr559 and ltr301. This adds support for another light sensor ltr303 used in Seeed Studio reTerminal, a carrier board for Raspberry Pi 4 CM. Signed-off-by: Maslov Dmitry Link: https://lore.kernel.org/r/20211106174137.6783-1-maslovdmitry@seeed.cc Signed-off-by: Jonathan Cameron commit 471d040defb243e59a2cee42069ca4e8d6d3e94b Author: Xu Wang Date: Fri Nov 5 01:55:04 2021 +0000 iio: adc: rzg2l_adc: Remove unnecessary print function dev_err() The print function dev_err() is redundant because platform_get_irq() already prints an error. Signed-off-by: Xu Wang Reviewed-by: Geert Uytterhoeven Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211105015504.39226-1-vulab@iscas.ac.cn Signed-off-by: Jonathan Cameron commit 7721c73d8018ee8a8588ab165a34032bec27de4d Author: Gwendal Grignou Date: Thu Nov 4 01:24:13 2021 -0700 iio: mpl3115: Use scan_type.shift and realbit in mpl3115_read_raw When processing raw data using channel scan_type.shift as source of trust to shift data appropriately. When processing the temperature channel, use a 16bit big endian variable as buffer to increase conversion readability. Signed-off-by: Gwendal Grignou Link: https://lore.kernel.org/r/20211104082413.3681212-14-gwendal@chromium.org Signed-off-by: Jonathan Cameron commit fb3e8bb47806a3e41d200841518726a9e700e283 Author: Gwendal Grignou Date: Thu Nov 4 01:24:12 2021 -0700 iio: xilinx-xadc-core: Use local variable in xadc_read_raw Minor cleanup: bit is already defined as chan->scan_type.realbits, use bit when needed. Signed-off-by: Gwendal Grignou Link: https://lore.kernel.org/r/20211104082413.3681212-13-gwendal@chromium.org Signed-off-by: Jonathan Cameron commit aad54091e1b50d725baa31c11358e6d6dcf44cf0 Author: Gwendal Grignou Date: Thu Nov 4 01:24:11 2021 -0700 iio: ti-ads1015: Remove shift variable ads1015_read_raw By using scan_type.realbits when processing raw data, we use scan_type.shit only once, thus we don't need to define a local variable for it anymore. Signed-off-by: Gwendal Grignou Link: https://lore.kernel.org/r/20211104082413.3681212-12-gwendal@chromium.org Signed-off-by: Jonathan Cameron commit 4d57fb548a1b086fc216c94cc186fba03c396190 Author: Gwendal Grignou Date: Thu Nov 4 01:24:10 2021 -0700 iio: mag3110: Use scan_type when processing raw data Use channel definition as root of trust and replace constant when reading elements directly using the raw sysfs attributes. Signed-off-by: Gwendal Grignou Link: https://lore.kernel.org/r/20211104082413.3681212-11-gwendal@chromium.org Signed-off-by: Jonathan Cameron commit a5cd0e7f5b3cda94b9f4029b8baef817a7a97226 Author: Gwendal Grignou Date: Thu Nov 4 01:24:09 2021 -0700 iio: ti-adc12138: Use scan_type when processing raw data Use channel definition as root of trust and replace constant when reading elements directly using the raw sysfs attributes. Signed-off-by: Gwendal Grignou Link: https://lore.kernel.org/r/20211104082413.3681212-10-gwendal@chromium.org Signed-off-by: Jonathan Cameron commit 4e9f4c12f1863b890965bfbf81d8d9bc85c12edb Author: Gwendal Grignou Date: Thu Nov 4 01:24:07 2021 -0700 iio: ad7266: Use scan_type when processing raw data Use channel definition as root of trust and replace constant when reading elements directly using the raw sysfs attributes. Signed-off-by: Gwendal Grignou Link: https://lore.kernel.org/r/20211104082413.3681212-8-gwendal@chromium.org Signed-off-by: Jonathan Cameron commit ded408b1135437540d27012da7b6f1afb4f4bf65 Author: Gwendal Grignou Date: Thu Nov 4 01:24:06 2021 -0700 iio: stk8ba50: Use scan_type when processing raw data Use channel definition as root of trust and replace constant when reading elements directly using the raw sysfs attributes. Signed-off-by: Gwendal Grignou Link: https://lore.kernel.org/r/20211104082413.3681212-7-gwendal@chromium.org Signed-off-by: Jonathan Cameron commit 571f8d006f39d8159d80f65eeb15603e649f6611 Author: Gwendal Grignou Date: Thu Nov 4 01:24:05 2021 -0700 iio: stk8312: Use scan_type when processing raw data Use channel definition as root of trust and replace constant when reading elements directly using the raw sysfs attributes. Signed-off-by: Gwendal Grignou Link: https://lore.kernel.org/r/20211104082413.3681212-6-gwendal@chromium.org Signed-off-by: Jonathan Cameron commit 5405c9b4074a93f01977f8b070c4d999aea00754 Author: Gwendal Grignou Date: Thu Nov 4 01:24:04 2021 -0700 iio: sca3000: Use scan_type when processing raw data Use channel definition as root of trust and replace constant when reading elements directly using the raw sysfs attributes. Signed-off-by: Gwendal Grignou Link: https://lore.kernel.org/r/20211104082413.3681212-5-gwendal@chromium.org Signed-off-by: Jonathan Cameron commit 1aa2f96abbcc7e68a13ce53deaf41cb2fd2debfa Author: Gwendal Grignou Date: Thu Nov 4 01:24:03 2021 -0700 iio: mma7455: Use scan_type when processing raw data Use channel definition as root of trust and replace constant when reading elements directly using the raw sysfs attributes. Signed-off-by: Gwendal Grignou Link: https://lore.kernel.org/r/20211104082413.3681212-4-gwendal@chromium.org Signed-off-by: Jonathan Cameron commit 9105079db67a64fa58c10e699aabfe4703f5ac3f Author: Gwendal Grignou Date: Thu Nov 4 01:24:02 2021 -0700 iio: kxcjk-1013: Use scan_type when processing raw data Use channel definition as root of trust and replace constant when reading elements directly using the raw sysfs attributes. Signed-off-by: Gwendal Grignou Link: https://lore.kernel.org/r/20211104082413.3681212-3-gwendal@chromium.org Signed-off-by: Jonathan Cameron commit f905772e8b16cde9858b9d775b215757d4d8db27 Author: Gwendal Grignou Date: Thu Nov 4 01:24:01 2021 -0700 iio: bma220: Use scan_type when processing raw data Use channel definition as root of trust and replace constant when reading elements directly using the raw sysfs attributes. Signed-off-by: Gwendal Grignou Link: https://lore.kernel.org/r/20211104082413.3681212-2-gwendal@chromium.org Signed-off-by: Jonathan Cameron commit 0d376dc9febb78eda0bc3121f66d4e4d868880c0 Author: Lars-Peter Clausen Date: Tue Oct 19 10:29:29 2021 +0200 iio: at91-sama5d2: Use dev_to_iio_dev() in sysfs callbacks Using `dev_get_drvdata()` in IIO sysfs callbacks to get a pointer to the IIO device is a relic from the very early days of IIO. The IIO core as well as most other drivers have switched over to using `dev_to_iio_dev()` instead. This driver is one of the last few drivers remaining that uses the outdated idiom, update it. This will allow to eventually update the IIO core to no longer set the drvdata for the IIO device and free it up for driver usage. Signed-off-by: Lars-Peter Clausen Link: https://lore.kernel.org/r/20211019082929.30503-2-lars@metafoo.de Signed-off-by: Jonathan Cameron commit 907b2ad8c9acad39ac1f0ccdbbe66c63856055e3 Author: Lars-Peter Clausen Date: Tue Oct 19 10:29:28 2021 +0200 iio: at91-sama5d2: Fix incorrect cast to platform_device The at91-sama5d2 driver calls `to_platform_device()` on a struct device that is part of a IIO device. This is incorrect since `to_platform_device()` must only be called on a struct device that is part of a platform device. The code still works by accident because non of the struct platform_device specific fields are accessed. Refactor the code a bit so that it behaves identically, but does not use the incorrect cast. This avoids accidentally adding undefined behavior in the future by assuming the `struct platform_device` is actually valid. Signed-off-by: Lars-Peter Clausen Tested-by: Eugen Hristev Link: https://lore.kernel.org/r/20211019082929.30503-1-lars@metafoo.de Signed-off-by: Jonathan Cameron commit eb0469894ba788ffdc81097b7dea822432e479d9 Author: Lars-Peter Clausen Date: Mon Nov 1 11:27:34 2021 +0100 iio: mma8452: Use correct type for return variable in IRQ handler The IRQ handler's return type is irqreturn_t. The mma8452 uses a variable to store the return value, but the variable is of type int. Change this to irqreturn_t. This makes it easier to verify that the code is correct. Signed-off-by: Lars-Peter Clausen Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211101102734.32291-1-lars@metafoo.de Signed-off-by: Jonathan Cameron commit 6a9a90364914d41a1a7456dd964af8dc2ab3ed4b Author: Lars-Peter Clausen Date: Sun Oct 31 15:21:30 2021 +0100 iio: lmp91000: Remove no-op trigger ops The IIO core handles a trigger ops with all NULL callbacks the same as if the trigger ops itself was NULL. Remove the empty trigger ops from the interrupt trigger driver to slightly reduce the boilerplate code. Object size of the driver module is also slightly reduced. Signed-off-by: Lars-Peter Clausen Link: https://lore.kernel.org/r/20211031142130.20791-9-lars@metafoo.de Signed-off-by: Jonathan Cameron commit 9662afc9059b79ed4efb8b90b2865f9c919c7fe4 Author: Lars-Peter Clausen Date: Sun Oct 31 15:21:29 2021 +0100 iio: gp2ap020a00f: Remove no-op trigger ops The IIO core handles a trigger ops with all NULL callbacks the same as if the trigger ops itself was NULL. Remove the empty trigger ops from the interrupt trigger driver to slightly reduce the boilerplate code. Object size of the driver module is also slightly reduced. Signed-off-by: Lars-Peter Clausen Link: https://lore.kernel.org/r/20211031142130.20791-8-lars@metafoo.de Signed-off-by: Jonathan Cameron commit f3df6c739a8513ab81dd9d49c0329933620cfaa7 Author: Lars-Peter Clausen Date: Sun Oct 31 15:21:28 2021 +0100 iio: atlas-sensor: Remove no-op trigger ops The IIO core handles a trigger ops with all NULL callbacks the same as if the trigger ops itself was NULL. Remove the empty trigger ops from the interrupt trigger driver to slightly reduce the boilerplate code. Object size of the driver module is also slightly reduced. Signed-off-by: Lars-Peter Clausen Link: https://lore.kernel.org/r/20211031142130.20791-7-lars@metafoo.de Signed-off-by: Jonathan Cameron commit 44c3bf8c1a4838115f5de5b66f84370b7aff2e21 Author: Lars-Peter Clausen Date: Sun Oct 31 15:21:27 2021 +0100 iio: as3935: Remove no-op trigger ops The IIO core handles a trigger ops with all NULL callbacks the same as if the trigger ops itself was NULL. Remove the empty trigger ops from the interrupt trigger driver to slightly reduce the boilerplate code. Object size of the driver module is also slightly reduced. Signed-off-by: Lars-Peter Clausen Link: https://lore.kernel.org/r/20211031142130.20791-6-lars@metafoo.de Signed-off-by: Jonathan Cameron commit 35ce398a554c9851f83730c186c7c325bb127e40 Author: Lars-Peter Clausen Date: Sun Oct 31 15:21:26 2021 +0100 iio: afe4404: Remove no-op trigger ops The IIO core handles a trigger ops with all NULL callbacks the same as if the trigger ops itself was NULL. Remove the empty trigger ops from the interrupt trigger driver to slightly reduce the boilerplate code. Object size of the driver module is also slightly reduced. Signed-off-by: Lars-Peter Clausen Link: https://lore.kernel.org/r/20211031142130.20791-5-lars@metafoo.de Signed-off-by: Jonathan Cameron commit 26ae5ed3fcda509ca46e28447bf0aa0fbff5bb88 Author: Lars-Peter Clausen Date: Sun Oct 31 15:21:25 2021 +0100 iio: afe4403: Remove no-op trigger ops The IIO core handles a trigger ops with all NULL callbacks the same as if the trigger ops itself was NULL. Remove the empty trigger ops from the interrupt trigger driver to slightly reduce the boilerplate code. Object size of the driver module is also slightly reduced. Signed-off-by: Lars-Peter Clausen Link: https://lore.kernel.org/r/20211031142130.20791-4-lars@metafoo.de Signed-off-by: Jonathan Cameron commit a3ab9c0622511bc8330ba9da0b406de6c7a0d645 Author: Lars-Peter Clausen Date: Sun Oct 31 15:21:24 2021 +0100 iio: ad_sigma_delta: Remove no-op trigger ops The IIO core handles a trigger ops with all NULL callbacks the same as if the trigger ops itself was NULL. Remove the empty trigger ops from the interrupt trigger driver to slightly reduce the boilerplate code. Object size of the driver module is also slightly reduced. Signed-off-by: Lars-Peter Clausen Link: https://lore.kernel.org/r/20211031142130.20791-3-lars@metafoo.de Signed-off-by: Jonathan Cameron commit e28309ad8a06da6b5bdd210b3c98efc3149f862c Author: Lars-Peter Clausen Date: Sun Oct 31 15:21:23 2021 +0100 iio: sysfs-trigger: Remove no-op trigger ops The IIO core handles a trigger ops with all NULL callbacks the same as if the trigger ops itself was NULL. Remove the empty trigger ops from the interrupt trigger driver to slightly reduce the boilerplate code. Object size of the driver module is also slightly reduced. Signed-off-by: Lars-Peter Clausen Link: https://lore.kernel.org/r/20211031142130.20791-2-lars@metafoo.de Signed-off-by: Jonathan Cameron commit 2d323927519c3ffbf4b0700459333bcc5528bb96 Author: Lars-Peter Clausen Date: Sun Oct 31 15:21:22 2021 +0100 iio: interrupt-trigger: Remove no-op trigger ops The IIO core handles a trigger ops with all NULL callbacks the same as if the trigger ops itself was NULL. Remove the empty trigger ops from the interrupt trigger driver to slightly reduce the boilerplate code. Object size of the driver module is also slightly reduced. Signed-off-by: Lars-Peter Clausen Link: https://lore.kernel.org/r/20211031142130.20791-1-lars@metafoo.de Signed-off-by: Jonathan Cameron commit 3c33b7b8267f0795d74f407e97f3eeec2acb0165 Author: Lars-Peter Clausen Date: Sun Oct 31 09:04:21 2021 +0100 iio: Mark iio_device_type as const The iio_device_type struct is never modified, mark it as const. This allows it to be placed in a read-only memory section, which will protect against accidental or deliberate modification. Signed-off-by: Lars-Peter Clausen Link: https://lore.kernel.org/r/20211031080421.2086-1-lars@metafoo.de Signed-off-by: Jonathan Cameron commit 1fd85607e1e52dc6f3ac1a993f9ab57e416aa9ab Author: Andriy Tryshnivskyy Date: Sun Oct 24 12:16:27 2021 +0300 iio/scmi: Add reading "raw" attribute. Add IIO_CHAN_INFO_RAW to the mask and implement corresponding reading "raw" attribute in scmi_iio_read_raw. Signed-off-by: Andriy Tryshnivskyy Acked-by: Jyoti Bhayana Link: https://lore.kernel.org/r/20211024091627.28031-3-andriy.tryshnivskyy@opensynergy.com Signed-off-by: Jonathan Cameron commit 6bb835f3d00467c9a5e35f4955afa29df96a404e Author: Andriy Tryshnivskyy Date: Sun Oct 24 12:16:26 2021 +0300 iio: core: Introduce IIO_VAL_INT_64. Introduce IIO_VAL_INT_64 to read 64-bit value for channel attribute. Val is used as lower 32 bits. Signed-off-by: Andriy Tryshnivskyy Link: https://lore.kernel.org/r/20211024091627.28031-2-andriy.tryshnivskyy@opensynergy.com Signed-off-by: Jonathan Cameron commit 2c4ce5041cd5d66875137a854b5e19672dce19a5 Author: Cai Huoqing Date: Thu Oct 21 20:42:54 2021 +0800 iio: adc: ina2xx: Avoid double reference counting from get_task_struct/put_task_struct() kthread_run() and kthread_stop() already do reference counting of the task, so remove get_task_struct/put_task_struct() to avoid double reference counting. Signed-off-by: Cai Huoqing Link: https://lore.kernel.org/r/20211021124254.3247-2-caihuoqing@baidu.com Signed-off-by: Jonathan Cameron commit 4bdc3e967dc6c22e32da0ddba099828415ac4b0e Author: Cai Huoqing Date: Thu Oct 21 20:42:53 2021 +0800 iio: adc: ina2xx: Make use of the helper macro kthread_run() Repalce kthread_create/wake_up_process() with kthread_run() to simplify the code. Reviewed-by: Lars-Peter Clausen Signed-off-by: Cai Huoqing Link: https://lore.kernel.org/r/20211021124254.3247-1-caihuoqing@baidu.com Signed-off-by: Jonathan Cameron commit dc19fa63ad80a636fdbc1a02153d1ab140cb901f Author: Lars-Peter Clausen Date: Wed Oct 20 16:21:10 2021 +0200 iio: ms5611: Simplify IO callback parameters The ms5611 passes &indio_dev->dev as a parameter to all its IO callbacks only to directly cast the struct device back to struct iio_dev. And the struct iio_dev is then only used to get the drivers state struct. Simplify this a bit by passing the state struct directly. This makes it a bit easier to follow what the code is doing. Signed-off-by: Lars-Peter Clausen Link: https://lore.kernel.org/r/20211020142110.7060-1-lars@metafoo.de Signed-off-by: Jonathan Cameron commit ba1287e73182f2521d4fc5c0809620ed06652796 Author: Lars-Peter Clausen Date: Wed Oct 20 10:57:54 2021 +0200 iio: imx7d_adc: Don't pass IIO device to imx7d_adc_{enable,disable}() The `imx7d_adc_enable()` and `imx7d_adc_disable()` functions are used as the suspend and resume callbacks for the device. When called as suspend/resume functions they are called with the platform_device's device as their parameter. In addition the functions are called on device probe and remove. In this case they are passed the struct device of the IIO device that the driver registers. This works because in the `imx7d_adc_{enable,disable}()` functions the passed struct device is only ever used as a parameter to `dev_get_drvdata()` and `dev_get_drvdata()` returns the same value for the platform device and the IIO device. But for consistency we should pass the same struct device to the `imx7d_adc_{enable,disable}()` in all cases. This will avoid accidental breakage if the device is ever used for something more than `dev_get_drvdata()`. Another motivation is that `dev_get_drvdata()` on the IIO device relies on the IIO core calling `dev_set_drvdata()`. Something we want to remove. Signed-off-by: Lars-Peter Clausen Link: https://lore.kernel.org/r/20211020085754.16654-1-lars@metafoo.de Signed-off-by: Jonathan Cameron commit 4498863cad7befbbd14006e033ae84784a33ae53 Author: Lars-Peter Clausen Date: Wed Oct 20 10:53:49 2021 +0200 iio: st-sensors: Use dev_to_iio_dev() in sysfs callbacks Using `dev_get_drvdata()` in IIO sysfs callbacks to get a pointer to the IIO device is a relic from the very early days of IIO. The IIO core as well as most other drivers have switched over to using `dev_to_iio_dev()` instead. This driver is one of the last few drivers remaining that uses the outdated idiom, update it. This will allow to eventually update the IIO core to no longer set the drvdata for the IIO device and free it up for driver usage. Signed-off-by: Lars-Peter Clausen Link: https://lore.kernel.org/r/20211020085349.16178-1-lars@metafoo.de Signed-off-by: Jonathan Cameron commit 8cf524be72fa8205754ed0ddc11a32aaf156c39f Author: Wan Jiabing Date: Thu Oct 21 08:18:23 2021 -0400 iio: adc: stm32-adc: Fix of_node_put() issue in stm32-adc Fix following coccicheck warning: ./drivers/iio/adc/stm32-adc.c:2014:1-33: WARNING: Function for_each_available_child_of_node should have of_node_put() before return. Early exits from for_each_available_child_of_node should decrement the node reference counter. Replace return by goto here. Reviewed-by: Fabrice Gasnier Signed-off-by: Wan Jiabing Link: https://lore.kernel.org/r/20211021121826.6339-1-wanjiabing@vivo.com Signed-off-by: Jonathan Cameron commit fb45c7a31ec1f772502867ea87a2315b57a9f439 Author: Lars-Peter Clausen Date: Thu Oct 21 14:59:50 2021 +0200 iio: xilinx-xadc: Make IRQ optional In some setups the IRQ signal of the XADC might not be wired to the host system. The driver currently requires that an interrupt is specified. Make the interrupt optional so the driver can be used in such setups where the interrupt is not connected. Since both the internal triggers as well as events depend on the interrupt being connected both are not available when the interrupt is not connected. Buffered access is still supported even without an interrupt since an external trigger can be used. The IRQ is only optional when using the AXI interface, since the PCAP interface needs the IRQ for reading and writing registers. Signed-off-by: Lars-Peter Clausen Link: https://lore.kernel.org/r/20211021125950.28707-1-lars@metafoo.de Signed-off-by: Jonathan Cameron commit e12653eb77b90fc33ff3e0b9caf21b02b026f552 Author: Uwe Kleine-König Date: Mon Oct 25 21:50:07 2021 +0200 iio: accel: mma7660: Warn about failure to put device in stand-by in .remove() Whan an i2c driver's remove function returns a non-zero error code nothing happens apart from emitting a generic error message. Make this error message more device specific and return zero instead. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20211025195007.84541-1-u.kleine-koenig@pengutronix.de Signed-off-by: Jonathan Cameron commit 8eebe6281ac1062764db23d181e3feb3305a3690 Author: André Gustavo Nakagomi Lopez Date: Mon Oct 25 09:19:50 2021 -0300 iio: adc: lpc18xx_adc: Reorder clk_get_rate() function call clk_get_rate() is not guaranteed to work if called before clk_prepare_enable(). Reorder clk_get_rate(), so it's called after clk_prepare_enable() and after devm_add_action_or_reset() of lpc18xx_clk_disable(). Not that this is not a problem on this particular device, but it is good to remove a case that might get copied elsewhere. Suggested-by: Jonathan Cameron Acked-by: Vladimir Zapolskiy Signed-off-by: André Gustavo Nakagomi Lopez Link: https://lore.kernel.org/r/YXag5l4xBkGQH3tq@Andryuu.br Signed-off-by: Jonathan Cameron commit ab0c1e34536c8077bf92ed9ec92941339acf9045 Author: AngeloGioacchino Del Regno Date: Thu Nov 4 14:52:54 2021 +0100 arm64: dts: mediatek: mt8173: Add gce-client-reg to display od/ufo In order to use CMDQ commands on these two IPs, we need to declare the appropriate mediatek,gce-client-reg for them. Signed-off-by: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20211104135254.580257-1-angelogioacchino.delregno@collabora.com Signed-off-by: Matthias Brugger commit 861a08874fdbf625fea5ac265ff6aabbf6b68c56 Author: Hsin-Yi Wang Date: Wed Nov 10 14:31:18 2021 +0800 dt-bindings: arm64: dts: mediatek: Add sku22 for mt8183 kakadu board Add sku22 which uses different audio codec than previous kakadu board. Signed-off-by: Hsin-Yi Wang Link: https://lore.kernel.org/r/20211110063118.3412564-7-hsinyi@chromium.org Signed-off-by: Matthias Brugger commit bf08726b34c18dc917d9155ee52ee9cba94fb9e1 Author: Hsin-Yi Wang Date: Wed Nov 10 14:31:17 2021 +0800 dt-bindings: arm64: dts: mediatek: Add more SKUs for mt8183 fennel board Add sku2 and sku7 which uses different audio codec than other fennel boards. Signed-off-by: Hsin-Yi Wang Link: https://lore.kernel.org/r/20211110063118.3412564-6-hsinyi@chromium.org Signed-off-by: Matthias Brugger commit 7358101393123aae68878fc05835f5add649ea6b Author: Hsin-Yi Wang Date: Wed Nov 10 14:31:16 2021 +0800 dt-bindings: arm64: dts: mediatek: Add mt8183-kukui-jacuzzi-cozmo Cozmo is known as Acer Chromebook 314 (CB314-2H/CB314-2HT) Chromebook. Signed-off-by: Hsin-Yi Wang Link: https://lore.kernel.org/r/20211110063118.3412564-5-hsinyi@chromium.org Signed-off-by: Matthias Brugger commit 3831b385147f9c1bc23f46ef156ffa165b8307f9 Author: Hsin-Yi Wang Date: Wed Nov 10 14:31:15 2021 +0800 arm64: dts: mt8183: Add kakadu sku22 Kakadu sku22 is using mediatek,mt8183_mt6358_ts3a227_rt1015p audio codec Signed-off-by: Hsin-Yi Wang Link: https://lore.kernel.org/r/20211110063118.3412564-4-hsinyi@chromium.org Signed-off-by: Matthias Brugger commit 1c1f350be884fcd8280913d10f18231b5faff4da Author: Hsin-Yi Wang Date: Wed Nov 10 14:31:14 2021 +0800 arm64: dts: mt8183: Add more fennel SKUs Add fennel sku7 and fennel14 sku2, which use different audio codec than previous fennel/fennel14 boards. Signed-off-by: Hsin-Yi Wang Link: https://lore.kernel.org/r/20211110063118.3412564-3-hsinyi@chromium.org Signed-off-by: Matthias Brugger commit 52e84f23345904e91ea35199033fe8b0772f2f39 Author: Hsin-Yi Wang Date: Wed Nov 10 14:31:13 2021 +0800 arm64: dts: mt8183: Add kukui-jacuzzi-cozmo board Cozmo is known as Acer Chromebook 314 (CB314-2H/CB314-2HT) Signed-off-by: Hsin-Yi Wang Link: https://lore.kernel.org/r/20211110063118.3412564-2-hsinyi@chromium.org Signed-off-by: Matthias Brugger commit 2706707b225d29aae6f79a21eff277b53b7b05e9 Author: Hsin-Yi Wang Date: Wed Nov 10 14:31:12 2021 +0800 arm64: dts: mt8183: jacuzzi: remove unused ddc-i2c-bus EDID is read from bridge, so the ddc-i2c-bus is unused. Signed-off-by: Hsin-Yi Wang Link: https://lore.kernel.org/r/20211110063118.3412564-1-hsinyi@chromium.org Signed-off-by: Matthias Brugger commit f063eba3e7a6aeec8e2abb00469e70c51432453b Author: Ajit Kumar Pandey Date: Wed Nov 17 11:37:26 2021 +0200 ASoC: SOF: amd: Add support for SOF firmware authentication Add callback to notify PSP after loading firmware on DSP. PSP will validate the loaded firmware and set qualifier bit to run firmware on secured AMD systems. Signed-off-by: Julian Schroeder Signed-off-by: Ajit Kumar Pandey Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Curtis Malainey Signed-off-by: Daniel Baluta Link: https://lore.kernel.org/r/20211117093734.17407-14-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit 4627421fb883928af5220c66a304bed1f9b77e8d Author: V sujith kumar Reddy Date: Wed Nov 17 11:37:25 2021 +0200 ASoC: SOF: amd: Add trace logger support Add trace support and configure trace stream for ACP firmware. Signed-off-by: Vishnuvardhanrao Ravuapati Signed-off-by: V sujith kumar Reddy Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Signed-off-by: Daniel Baluta Link: https://lore.kernel.org/r/20211117093734.17407-13-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit efb931cdc4b94a0f7ed17a76844f08cef1bdffe5 Author: Ajit Kumar Pandey Date: Wed Nov 17 11:37:24 2021 +0200 ASoC: SOF: topology: Add support for AMD ACP DAIs Add new sof dais and config to pass topology file configuration to SOF firmware running on ACP's DSP core. ACP firmware support I2S_BT, I2S_SP and DMIC controller hence add three new dais to the list of supported sof_dais Signed-off-by: Ajit Kumar Pandey Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Signed-off-by: Daniel Baluta Link: https://lore.kernel.org/r/20211117093734.17407-12-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit 63fba90fc88b6cee9f8bead761a419169ecda6cc Author: Ajit Kumar Pandey Date: Wed Nov 17 11:37:23 2021 +0200 ASoC: amd: acp-config: Remove legacy acpi based machine struct We have moved legacy based machine struct into platform driver to resolve module dependency with non-SOF ALSA build, hence removed it from acp-config driver module. Signed-off-by: Ajit Kumar Pandey Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Signed-off-by: Daniel Baluta Link: https://lore.kernel.org/r/20211117093734.17407-11-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit ec25a3b14261fcb05568a1fec15ca68152e9d208 Author: Ajit Kumar Pandey Date: Wed Nov 17 11:37:22 2021 +0200 ASoC: SOF: amd: Add Renoir PCI driver interface Add PCI driver module to enable sof pci device support for Renoir. If machine flag set to FLAG_SOF_ONLY_DMIC this pci driver register platform device for non dsp based I2S platform device. If machine flag is not enabled for SOF pci probe will return without invoking sof device probe and registration Signed-off-by: Ajit Kumar Pandey Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Signed-off-by: Daniel Baluta Link: https://lore.kernel.org/r/20211117093734.17407-10-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit 11ddd4e371810017faf7ff7cb2349f321e50d1d3 Author: Ajit Kumar Pandey Date: Wed Nov 17 11:37:21 2021 +0200 ASoC: SOF: amd: Add machine driver dsp ops for Renoir platform Add dsp ops callback to select and register machine driver. Signed-off-by: Ajit Kumar Pandey Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Signed-off-by: Daniel Baluta Link: https://lore.kernel.org/r/20211117093734.17407-9-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit f1bdd8d385a803565024c8feeedc17bf86aac4f5 Author: Ajit Kumar Pandey Date: Wed Nov 17 11:37:20 2021 +0200 ASoC: amd: Add module to determine ACP configuration ACP hw block configuration differs across various distributions and hence it's required to register different drivers module for distributions. For now we support three ACP drivers: * ACP without SOF use case * ACP with SOF use case * ACP with SOF use case for DMIC and non SOF for I2S endpoints As all above driver registers with common PCI ID for ACP hw block we need code to determine ACP configuration and auto select driver module. This patch expose function that return configuration flag based on dmi checks for a system. ACP driver module probe register platform device based on such configuration flag to avoid conflict with other ACP drivers probed for same PCI ID. Signed-off-by: Ajit Kumar Pandey Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Signed-off-by: Daniel Baluta Link: https://lore.kernel.org/r/20211117093734.17407-8-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit e8afccf8fb75bae9c3292a0e51593af92839415e Author: Ajit Kumar Pandey Date: Wed Nov 17 11:37:19 2021 +0200 ASoC: SOF: amd: Add PCM stream callback for Renoir dai's Add module to support ALSA pcm stream configurations for ACP I2S and DMIC endpoints Signed-off-by: Ajit Kumar Pandey Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Signed-off-by: Daniel Baluta Link: https://lore.kernel.org/r/20211117093734.17407-7-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit bda93076d184ad80a8cab09bf29ace7692de18f7 Author: Ajit Kumar Pandey Date: Wed Nov 17 11:37:18 2021 +0200 ASoC: SOF: amd: Add dai driver dsp ops callback for Renoir Add dsp ops callback to register I2S and DMIC sof dai's with ALSA Signed-off-by: Ajit Kumar Pandey Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Signed-off-by: Daniel Baluta Link: https://lore.kernel.org/r/20211117093734.17407-6-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit 738a2b5e2cc9fd63d48faac11c8d60a5a2313a9d Author: Ajit Kumar Pandey Date: Wed Nov 17 11:37:17 2021 +0200 ASoC: SOF: amd: Add IPC support for ACP IP block Add IPC module for generic ACP block and exposed ops callback for to synchronize SOF IPC message between host and DSP Signed-off-by: Balakishore Pati Signed-off-by: Ajit Kumar Pandey Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Signed-off-by: Daniel Baluta Link: https://lore.kernel.org/r/20211117093734.17407-5-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit 7e51a9e38ab204eba2844b8773486392d7444435 Author: Ajit Kumar Pandey Date: Wed Nov 17 11:37:16 2021 +0200 ASoC: SOF: amd: Add fw loader and renoir dsp ops to load firmware Add acp-loader module with ops callback to load and run firmware on ACP DSP block on Renoir platform. Signed-off-by: Ajit Kumar Pandey Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Signed-off-by: Daniel Baluta Link: https://lore.kernel.org/r/20211117093734.17407-4-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit 0e44572a28a49109eae23af1545c658b86c4bf00 Author: Ajit Kumar Pandey Date: Wed Nov 17 11:37:15 2021 +0200 ASoC: SOF: amd: Add helper callbacks for ACP's DMA configuration ACP DMA is used for loading SOF firmware into DSP memory and data transfer from system memory to DSP memory. Add helper callbacks to initialize and configure ACP DMA block for fw loading. Signed-off-by: Vijendar Mukunda Signed-off-by: Ajit Kumar Pandey Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Signed-off-by: Daniel Baluta Link: https://lore.kernel.org/r/20211117093734.17407-3-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit 846aef1d7cc05651e27c17c3b4e2b5ce5cdec97b Author: Ajit Kumar Pandey Date: Wed Nov 17 11:37:14 2021 +0200 ASoC: SOF: amd: Add Renoir ACP HW support This patch initializes ACP HW block to support SOF on AMD Renoir platform. Signed-off-by: Ajit Kumar Pandey Reviewed-by: Bard Liao Reviewed-by: Kai Vehmanen Signed-off-by: Daniel Baluta Link: https://lore.kernel.org/r/20211117093734.17407-2-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit ff9ea5c62279790eea8c0cd7295836db06da174d Author: Fabien Parent Date: Wed Nov 10 20:26:31 2021 +0100 arm64: dts: mediatek: mt8183-evb: Add node for thermistor Add node to be able to read the temperature for the thermistor connected to AUXIN0. Signed-off-by: Fabien Parent Link: https://lore.kernel.org/r/20211110192631.4182485-1-fparent@baylibre.com Signed-off-by: Matthias Brugger commit 9cf6a26ae352a6a150662c0c4ddff87664cc6e3c Author: Fabien Parent Date: Wed Nov 10 20:35:20 2021 +0100 arm64: dts: mediatek: mt8516: remove 2 invalid i2c clocks The two clocks "main-source" and "main-sel" are not present in the driver and not defined in the binding documentation. Remove them as they are not used and not described in the documentation. Signed-off-by: Fabien Parent Link: https://lore.kernel.org/r/20211110193520.488-1-fparent@baylibre.com Signed-off-by: Matthias Brugger commit 7f1a9f47df618f19c943e5673b3b42b849de7e8d Author: Fabien Parent Date: Wed Nov 10 20:49:59 2021 +0100 arm64: dts: mediatek: mt8192: fix i2c node names Fix the i2c node names to be compliant to the YAML schema. The I2C node name should match the following pattern: "^i2c@[0-9a-f]+$". Signed-off-by: Fabien Parent Link: https://lore.kernel.org/r/20211110194959.20611-4-fparent@baylibre.com Signed-off-by: Matthias Brugger commit a59308a5fb231aca72b9b070a6577fa49ec2d72a Author: Imre Deak Date: Mon Nov 15 20:11:21 2021 +0200 drm/i915: Fix fastsets on TypeC ports following a non-blocking modeset After a non-blocking modeset on a TypeC port's CRTC - possibly blocked later in drm_atomic_helper_wait_for_dependencies() - a fastset on the same CRTC may copy the state of CRTC before this gets updated to reflect the up-to-date DP-alt vs. TBT-alt TypeC mode DPLL used for the CRTC. In this case after the first (non-blocking) commit completes enabling the DPLL required for the up-to-date TypeC mode the following fastset will update the CRTC state pointing to the wrong DPLL. A subsequent disabling modeset will try to disable the wrong PLL, triggering a state checker WARN (and leaving the DPLL which is actually used active for good). Fix the above race by copying the DPLL state for fastset CRTCs from the old CRTC state at the point where it's guaranteed to be up-to-date already. This could be handled in the encoder's update_prepare() hook as well, but that's a bigger change, which is better done as a follow-up. v2: Copy dpll_hw_state as well. (Ville) Testcase: igt/kms_busy/extended-modeset-hang-newfb-with-reset Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/4308 Cc: Ville Syrjala Signed-off-by: Imre Deak Reviewed-by: Mika Kahola Link: https://patchwork.freedesktop.org/patch/msgid/20211115181121.156197-1-imre.deak@intel.com commit e0dbd7b0ed021fb9250f7ba4d759325678efefb5 Author: Linus Walleij Date: Tue Nov 16 23:44:28 2021 +0100 power: supply: core: Add kerneldoc to battery struct This complements the struct power_supply_battery_info with extensive kerneldoc explaining the different semantics of the fields, including an overview of the CC/CV charging concepts implicit in some of the struct members. This is done to first establish semantics before I can add more charging methods by breaking out the CC/CV parameters to its own struct. Tested-by: Randy Dunlap Acked-by: Randy Dunlap Reviewed-by: Matti Vaittinen Signed-off-by: Linus Walleij Signed-off-by: Sebastian Reichel commit 5ae9497dda62833a33c4f8817a52d91b4ae1a140 Merge: fa55b7dcdc43c b171f667f3787 Author: Eric W. Biederman Date: Wed Nov 17 10:47:15 2021 -0600 signal: requeuing undeliverable signals Kyle Huey recently reported[1] that rr gets confused if SIGKILL prevents ptrace_signal from delivering a signal, as the kernel setups up a signal frame for a signal that rr did not have a chance to observe with ptrace. In looking into it I found a couple of bugs and a quality of implementation issue. - The test for signal_group_exit should be inside the for loop in get_signal. - Signals should be requeued on the same queue they were dequeued from. - When a fatal signal is pending ptrace_signal should not return another signal for delivery. Kyle Huey has verified[2] an earlier version of this change. I have reworked things one more time to completely fix the issues raised, and to keep the code maintainable long term. I have smoke tested this code and combined with a careful review I expect this code to work fine. Kyle if you can double check that my last round of changes still works for rr I would appreciate it. Eric W. Biederman (3): signal: In get_signal test for signal_group_exit every time through the loop signal: Requeue signals in the appropriate queue signal: Requeue ptrace signals fs/signalfd.c | 5 +++-- include/linux/sched/signal.h | 7 ++++--- kernel/signal.c | 44 ++++++++++++++++++++++++++------------------ 3 files changed, 33 insertions(+), 23 deletions(-) [1] https://lkml.kernel.org/r/20211101034147.6203-1-khuey@kylehuey.com [2] https://lkml.kernel.org/r/CAP045ApAX725ZfujaK-jJNkfCo5s+oVFpBvNfPJk+DKY8K7d=Q@mail.gmail.com Tested-by: Kyle Huey Link: https://lkml.kernel.org/r/87bl2kekig.fsf_-_@email.froward.int.ebiederm.org Signed-off-by: "Eric W. Biederman" commit 1e66f04c14abdee103221518c4f7cfb73574d2b9 Author: Kieran Bingham Date: Wed Nov 17 16:32:39 2021 +0000 gpu: drm: panel-edp: Fix edp_panel_entry documentation The edp_panel_entry members 'delay' and 'name' are documented, but without the correct syntax for kernel doc. This generates the following warnings: drivers/gpu/drm/panel/panel-edp.c:204: warning: Function parameter or member 'delay' not described in 'edp_panel_entry' drivers/gpu/drm/panel/panel-edp.c:204: warning: Function parameter or member 'name' not described in 'edp_panel_entry' Fix them accordingly. Fixes: 5540cf8f3e8d ("drm/panel-edp: Implement generic "edp-panel"s probed by EDID") Signed-off-by: Kieran Bingham Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20211117163239.529781-1-kieran.bingham+renesas@ideasonboard.com commit aa70a0996b0ee5950237cfe5f039285eda0c1470 Author: yangcong Date: Fri Nov 12 16:43:02 2021 +0800 drm/bridge: parade-ps8640: Fix additional suspend/resume at bootup Through log and waveform, we can see that there will be additional suspend/resume when booting. This timing does not meet the ps8640 spec. It seems that the delay of 500ms does not satisfied drm_panel_get_modes. I increased it to 900ms and it seems that this problem can be solved. To be safe, I'd just round up to a full 1000. Signed-off-by: yangcong Reviewed-by: Stephen Boyd Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20211112084302.2447931-1-yangcong5@huaqin.corp-partner.google.com commit a4585ba2050f460f749bbaf2b67bd56c41e30283 Author: Linus Walleij Date: Wed Nov 17 00:02:33 2021 +0100 power: supply: core: Use library interpolation The power supply core appears to contain two open coded linear interpolations. Use the kernel fixpoint arithmetic interpolation library function instead. Cc: Chunyan Zhang Signed-off-by: Linus Walleij Reviewed-by: Baolin Wang Signed-off-by: Sebastian Reichel commit b171f667f3787946a8ba9644305339e93ae799c9 Author: Eric W. Biederman Date: Mon Nov 15 13:49:45 2021 -0600 signal: Requeue ptrace signals Kyle Huey writes: > rr, a userspace record and replay debugger[0], uses the recorded register > state at PTRACE_EVENT_EXIT to find the point in time at which to cease > executing the program during replay. > > If a SIGKILL races with processing another signal in get_signal, it is > possible for the kernel to decline to notify the tracer of the original > signal. But if the original signal had a handler, the kernel proceeds > with setting up a signal handler frame as if the tracer had chosen to > deliver the signal unmodified to the tracee. When the kernel goes to > execute the signal handler that it has now modified the stack and registers > for, it will discover the pending SIGKILL, and terminate the tracee > without executing the handler. When PTRACE_EVENT_EXIT is delivered to > the tracer, however, the effects of handler setup will be visible to > the tracer. > > Because rr (the tracer) was never notified of the signal, it is not aware > that a signal handler frame was set up and expects the state of the program > at PTRACE_EVENT_EXIT to be a state that will be reconstructed naturally > by allowing the program to execute from the last event. When that fails > to happen during replay, rr will assert and die. > > The following patches add an explicit check for a newly pending SIGKILL > after the ptracer has been notified and the siglock has been reacquired. > If this happens, we stop processing the current signal and proceed > immediately to handling the SIGKILL. This makes the state reported at > PTRACE_EVENT_EXIT the unmodified state of the program, and also avoids the > work to set up a signal handler frame that will never be used. > > [0] https://rr-project.org/ The problem is that while the traced process makes it into ptrace_stop, the tracee is killed before the tracer manages to wait for the tracee and discover which signal was about to be delivered. More generally the problem is that while siglock was dropped a signal with process wide effect is short cirucit delivered to the entire process killing it, but the process continues to try and deliver another signal. In general it impossible to avoid all cases where work is performed after the process has been killed. In particular if the process is killed after get_signal returns the code will simply not know it has been killed until after delivering the signal frame to userspace. On the other hand when the code has already discovered the process has been killed and taken user space visible action that shows the kernel knows the process has been killed, it is just silly to then write the signal frame to the user space stack. Instead of being silly detect the process has been killed in ptrace_signal and requeue the signal so the code can pretend it was simply never dequeued for delivery. To test the process has been killed I use fatal_signal_pending rather than signal_group_exit to match the test in signal_pending_state which is used in schedule which is where ptrace_stop detects the process has been killed. Requeuing the signal so the code can pretend it was simply never dequeued improves the user space visible behavior that has been present since ebf5ebe31d2c ("[PATCH] signal-fixes-2.5.59-A4"). Kyle Huey verified that this change in behavior and makes rr happy. Reported-by: Kyle Huey Reported-by: Marko Mäkelä History Tree: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.gi Reviewed-by: Kees Cook Link: https://lkml.kernel.org/r/87tugcd5p2.fsf_-_@email.froward.int.ebiederm.org Signed-off-by: "Eric W. Biederman" commit 5768d8906bc23d512b1a736c1e198aa833a6daa4 Author: Eric W. Biederman Date: Mon Nov 15 13:47:13 2021 -0600 signal: Requeue signals in the appropriate queue In the event that a tracer changes which signal needs to be delivered and that signal is currently blocked then the signal needs to be requeued for later delivery. With the advent of CLONE_THREAD the kernel has 2 signal queues per task. The per process queue and the per task queue. Update the code so that if the signal is removed from the per process queue it is requeued on the per process queue. This is necessary to make it appear the signal was never dequeued. The rr debugger reasonably believes that the state of the process from the last ptrace_stop it observed until PTRACE_EVENT_EXIT can be recreated by simply letting a process run. If a SIGKILL interrupts a ptrace_stop this is not true today. So return signals to their original queue in ptrace_signal so that signals that are not delivered appear like they were never dequeued. Fixes: 794aa320b79d ("[PATCH] sigfix-2.5.40-D6") History Tree: https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.gi Reviewed-by: Kees Cook Link: https://lkml.kernel.org/r/87zgq4d5r4.fsf_-_@email.froward.int.ebiederm.org Signed-off-by: "Eric W. Biederman" commit 876e0b26ccd211ca92607d83c87cc1f097784c6d Author: Peng Fan Date: Wed Nov 10 11:21:01 2021 +0800 remoteproc: coredump: Correct argument 2 type for memcpy_fromio Address the sparse check warning: >> drivers/remoteproc/remoteproc_coredump.c:169:53: sparse: warning: incorrect type in argument 2 (different address spaces) sparse: expected void const volatile [noderef] __iomem *src sparse: got void *[assigned] ptr Reported-by: kernel test robot Signed-off-by: Peng Fan Link: https://lore.kernel.org/r/20211110032101.517487-1-peng.fan@oss.nxp.com Signed-off-by: Mathieu Poirier commit 4da96175014be67c846fd274eace08066e525d75 Author: Christophe JAILLET Date: Sat Oct 16 08:44:28 2021 +0200 remoteproc: imx_rproc: Fix a resource leak in the remove function 'priv->workqueue' is destroyed in the error handling path of the probe but not in the remove function. Add the missing call to release some resources. Cc: stable Fixes: 2df7062002d0 ("remoteproc: imx_proc: enable virtio/mailbox") Signed-off-by: Christophe JAILLET Reviewed-by: Peng Fan Tested-by: Peng Fan Link: https://lore.kernel.org/r/d28ca94a4031bd7297d47c2164e18885a5a6ec19.1634366546.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mathieu Poirier commit 7efb14256dd306407cf8388a46a4a6c5c5c85774 Author: Mark-PK Tsai Date: Tue Nov 2 22:15:35 2021 +0800 remoteproc: Use %pe format string to print return error code Use %pe format string to print return error code which make the error message easier to understand. Signed-off-by: Mark-PK Tsai Link: https://lore.kernel.org/r/20211102141535.28372-1-mark-pk.tsai@mediatek.com Reviewed-by: Bjorn Andersson [Fixed capital letter in subject line] Signed-off-by: Mathieu Poirier commit 75082e7f46809432131749f4ecea66864d0f7438 Author: Eric Dumazet Date: Wed Nov 17 02:01:30 2021 -0800 net: add missing include in include/net/gro.h This is needed for some arches, as reported by Geert Uytterhoeven, Randy Dunlap and Stephen Rothwell Fixes: 4721031c3559 ("net: move gro definitions to include/net/gro.h") Signed-off-by: Eric Dumazet Cc: Stephen Rothwell Cc: Randy Dunlap Tested-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20211117100130.2368319-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit e7f7c99ba911f56bc338845c1cd72954ba591707 Author: Eric W. Biederman Date: Mon Nov 15 11:55:57 2021 -0600 signal: In get_signal test for signal_group_exit every time through the loop Recently while investigating a problem with rr and signals I noticed that siglock is dropped in ptrace_signal and get_signal does not jump to relock. Looking farther to see if the problem is anywhere else I see that do_signal_stop also returns if signal_group_exit is true. I believe that test can now never be true, but it is a bit hard to trace through and be certain. Testing signal_group_exit is not expensive, so move the test for signal_group_exit into the for loop inside of get_signal to ensure the test is never skipped improperly. This has been a potential problem since I added the test for signal_group_exit was added. Fixes: 35634ffa1751 ("signal: Always notice exiting tasks") Reviewed-by: Kees Cook Link: https://lkml.kernel.org/r/875yssekcd.fsf_-_@email.froward.int.ebiederm.org Signed-off-by: "Eric W. Biederman" commit b6ce2af8766c39a5b09afa466ed4d0ef2d8b5a65 Author: Uwe Kleine-König Date: Fri Nov 12 20:00:15 2021 +0100 pwm: img: Use only a single idiom to get a runtime PM reference Currently there are two very similar approaches in use by this driver: img_pwm_config() uses pm_runtime_get_sync() and calls pm_runtime_put_autosuspend() in the error path; img_pwm_enable() calls pm_runtime_resume_and_get() which already puts the reference in its own error path. Align pm_runtime usage and use the same idiom in both locations. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit e92af33e472cf3aa25fd14ae7760c113f5ac8c48 Author: Alexander Lobakin Date: Wed Nov 17 16:29:17 2021 +0100 stmmac: fix build due to brainos in trans_start changes txq_trans_cond_update() takes netdev_tx_queue *nq, not nq->trans_start. Fixes: 5337824f4dc4 ("net: annotate accesses to queue->trans_start") Signed-off-by: Alexander Lobakin Reviewed-by: Eric Dumazet Link: https://lore.kernel.org/r/20211117152917.3739-1-alexandr.lobakin@intel.com Signed-off-by: Jakub Kicinski commit 14d8956548ad48574138d8fd377d434083c3c3cd Author: Uwe Kleine-König Date: Tue Nov 2 10:28:03 2021 +0100 pwm: vt8500: Implement .apply() callback To eventually get rid of all legacy drivers convert this driver to the modern world implementing .apply(). This just pushes down a slightly optimized variant of how legacy drivers are handled in the core. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 0ee11b87c38b64c693881a53969056e16a03fcd1 Author: Uwe Kleine-König Date: Fri Oct 29 12:56:17 2021 +0200 pwm: img: Implement .apply() callback To eventually get rid of all legacy drivers convert this driver to the modern world implementing .apply(). This just pushes down a slightly optimized variant of how legacy drivers are handled in the core. Signed-off-by: Uwe Kleine-König Tested-by: Hauke Mehrtens Signed-off-by: Thierry Reding commit 5e93d7782f7fda242e0e696da918f720660854bf Author: Uwe Kleine-König Date: Thu Oct 28 12:09:42 2021 +0200 pwm: twl: Implement .apply() callback To eventually get rid of all legacy drivers convert this driver to the modern world implementing .apply(). This just pushes down a slightly optimized variant of how legacy drivers are handled in the core. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit e45a178e9e285c86265611a56705a1e6444037e3 Author: Uwe Kleine-König Date: Thu Jul 1 09:29:27 2021 +0200 pwm: Restore initial state if a legacy callback fails It is not entirely accurate to go back to the initial state after e.g. .enable() failed, as .config() still modified the hardware, but this same inconsistency exists for drivers that implement .apply(). Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 92f69e582e15bf281ff1ab3ccc7abdd8392550a3 Author: Uwe Kleine-König Date: Thu Jul 1 09:29:26 2021 +0200 pwm: Prevent a glitch for legacy drivers If a running PWM is reconfigured to disabled calling the ->config() callback before disabling the hardware might result in a glitch where the (maybe) new period and duty_cycle are visible on the output before disabling the hardware. So handle disabling before calling ->config(). Also exit early in this case which is possible because period and duty_cycle don't matter for disabled PWMs. In return however ->config has to be called even if state->period == pwm->state.period && state->duty_cycle != pwm->state.duty_cycle because setting these might have been skipped in the previous call. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 77965c98cffe41994dce3389c4aae80e2072f098 Author: Uwe Kleine-König Date: Thu Jul 1 09:29:25 2021 +0200 pwm: Move legacy driver handling into a dedicated function There is no change in behaviour, only some code is moved from pwm_apply_state to a separate function. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding commit 339f28964147db9cb5c45d84a9b9d86a8ceb9260 Author: Radoslaw Tyl Date: Wed Jun 30 10:15:32 2021 +0200 ixgbevf: Add support for new mailbox communication between PF and VF Provide improved mailbox communication, between PF and VF, which is defined as API version 1.5. Signed-off-by: Radoslaw Tyl Tested-by: Tony Brelinski Signed-off-by: Tony Nguyen commit c869259881a36fa86086efe661c74a6a9de5b169 Author: Radoslaw Tyl Date: Wed Jun 30 10:15:31 2021 +0200 ixgbevf: Mailbox improvements Improve reliability of the mailbox communication and remove its potential flaws that may lead to the undefined or faulty behavior. Recently some users reported issues on ESX with 10G Intel NICs which were found to be caused by incorrect implementation of the PF-VF mailbox communication. Technical investigation highlighted areas to improve in the communication between PF or VF that wants to send the message (sender) and the other part which receives the message (receiver): - Locking the mailbox when the sender wants to send a message - Releasing the mailbox when the communication ends - Returning the result of the mailbox message execution Signed-off-by: Radoslaw Tyl Tested-by: Tony Brelinski Signed-off-by: Tony Nguyen commit 9c9463c29d1b957f2e4cbe31ad88a4b6a3086199 Author: Radoslaw Tyl Date: Wed Jun 30 10:15:30 2021 +0200 ixgbevf: Add legacy suffix to old API mailbox functions Add legacy suffix to mailbox functions which should be backwards compatible with older PF drivers. Communication during API negotiation always has to be done using the earlier implementation. Signed-off-by: Radoslaw Tyl Tested-by: Tony Brelinski Signed-off-by: Tony Nguyen commit 887a32031a8ae5d9ad805973f28744ebe685c4e5 Author: Radoslaw Tyl Date: Wed Jun 30 10:15:29 2021 +0200 ixgbevf: Improve error handling in mailbox Add new handling for error codes: IXGBE_ERR_CONFIG - ixgbe_mbx_operations is not correctly set IXGBE_ERR_TIMEOUT - mailbox operation, e.g. poll for message, timeout Signed-off-by: Radoslaw Tyl Tested-by: Tony Brelinski Signed-off-by: Tony Nguyen commit 0edbecd5705728e803a56d646194f4ccdef5845f Author: Radoslaw Tyl Date: Wed Jun 30 10:15:28 2021 +0200 ixgbevf: Rename MSGTYPE to SUCCESS and FAILURE There is name similarity within IXGBE_VT_MSGTYPE_ACK and PFMAILBOX.ACK / VFMAILBOX.ACK. MSGTYPE macros are renamed to SUCCESS and FAILURE because they are not specified in datasheet and now will be easily distinguishable. Signed-off-by: Radoslaw Tyl Tested-by: Tony Brelinski Signed-off-by: Tony Nguyen commit fe69a2dd88b2c741bd55336d74dd484d7b848679 Author: Dan Carpenter Date: Tue Nov 16 14:49:16 2021 +0300 drm/i915/guc: fix NULL vs IS_ERR() checking The intel_engine_create_virtual() function does not return NULL. It returns error pointers. Fixes: e5e32171a2cf ("drm/i915/guc: Connect UAPI to GuC multi-lrc interface") Signed-off-by: Dan Carpenter Reviewed-by: Rodrigo Vivi Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20211116114916.GB11936@kili commit f4d77525679e289d4976ca03b620ac4cc5403205 Author: Abhyuday Godhasara Date: Mon Oct 25 21:25:22 2021 -0700 firmware: xilinx: export the feature check of zynqmp firmware Export the zynqmp_pm_feature(), so it can be use by other as to get API version available in firmware. Acked-by: Michal Simek Signed-off-by: Rajan Vaja Signed-off-by: Abhyuday Godhasara Link: https://lore.kernel.org/r/20211026042525.26612-4-abhyuday.godhasara@xilinx.com Signed-off-by: Greg Kroah-Hartman commit fbce9f14055e547d270046f61758c29c957e675d Author: Abhyuday Godhasara Date: Mon Oct 25 21:25:21 2021 -0700 firmware: xilinx: add macros of node ids for error event Add macros for the Node-Id of Error events. Move supported api callback ids from zynqmp-power to zynqmp-firmware. Acked-by: Michal Simek Signed-off-by: Rajan Vaja Signed-off-by: Abhyuday Godhasara Link: https://lore.kernel.org/r/20211026042525.26612-3-abhyuday.godhasara@xilinx.com Signed-off-by: Greg Kroah-Hartman commit 1881eadb2041889d74d60c074eb04189c4a07dad Author: Abhyuday Godhasara Date: Mon Oct 25 21:25:20 2021 -0700 firmware: xilinx: add register notifier in zynqmp firmware In zynqmp-firmware, register notifier is not supported, add support of register notifier in zynqmp-firmware. Acked-by: Michal Simek Signed-off-by: Tejas Patel Signed-off-by: Abhyuday Godhasara Link: https://lore.kernel.org/r/20211026042525.26612-2-abhyuday.godhasara@xilinx.com Signed-off-by: Greg Kroah-Hartman commit fbf3443f77503f68f244cd7afa050c19ac78511c Author: Longpeng Date: Sun Nov 7 22:09:17 2021 +0800 nitro_enclaves: Add KUnit tests for contiguous physical memory regions merging Add KUnit tests for the contiguous physical memory regions merging functionality from the Nitro Enclaves misc device logic. We can build the test binary with the following configuration: CONFIG_KUNIT=y CONFIG_NITRO_ENCLAVES=m CONFIG_NITRO_ENCLAVES_MISC_DEV_TEST=y and install the nitro_enclaves module to run the testcases. We'll see the following message using dmesg if everything goes well: [...] # Subtest: ne_misc_dev_test [...] 1..1 [...] (NULL device *): Physical mem region address is not 2 MiB aligned [...] (NULL device *): Physical mem region size is not multiple of 2 MiB [...] (NULL device *): Physical mem region address is not 2 MiB aligned [...] ok 1 - ne_misc_dev_test_merge_phys_contig_memory_regions [...] ok 1 - ne_misc_dev_test Reviewed-by: Andra Paraschiv Signed-off-by: Longpeng Link: https://lore.kernel.org/r/20211107140918.2106-5-longpeng2@huawei.com Signed-off-by: Greg Kroah-Hartman commit 07503b3c1e13fdeb66d4531c5dcba335eed9602a Author: Longpeng Date: Sun Nov 7 22:09:16 2021 +0800 nitro_enclaves: Add KUnit tests setup for the misc device functionality Add the initial setup for the KUnit tests that will target the Nitro Enclaves misc device functionality. Reviewed-by: Andra Paraschiv Signed-off-by: Longpeng Link: https://lore.kernel.org/r/20211107140918.2106-4-longpeng2@huawei.com Signed-off-by: Greg Kroah-Hartman commit 090ce7831d340e8be92e5f2a90617cca6e92156e Author: Longpeng Date: Sun Nov 7 22:09:15 2021 +0800 nitro_enclaves: Sanity check physical memory regions during merging Sanity check the physical memory regions during the merge of contiguous regions. Thus we can test the physical memory regions setup logic individually, including the error cases coming from the sanity checks. Reviewed-by: Andra Paraschiv Signed-off-by: Longpeng Link: https://lore.kernel.org/r/20211107140918.2106-3-longpeng2@huawei.com Signed-off-by: Greg Kroah-Hartman commit f6bdc0aafe88cf4c727e7bb00da1f480ecd80bee Author: Longpeng Date: Sun Nov 7 22:09:14 2021 +0800 nitro_enclaves: Merge contiguous physical memory regions There can be cases when there are more memory regions that need to be set for an enclave than the maximum supported number of memory regions per enclave. One example can be when the memory regions are backed by 2 MiB hugepages (the minimum supported hugepage size). Let's merge the adjacent regions if they are physically contiguous. This way the final number of memory regions is less than before merging and could potentially avoid reaching maximum. Reviewed-by: Andra Paraschiv Signed-off-by: Longpeng Link: https://lore.kernel.org/r/20211107140918.2106-2-longpeng2@huawei.com Signed-off-by: Greg Kroah-Hartman commit dc74e8cf2324ad61b050a55ec0ffa9db6f4fce33 Author: Christophe JAILLET Date: Fri Nov 12 18:09:54 2021 +0100 nitro_enclaves: Remove redundant 'flush_workqueue()' calls 'destroy_workqueue()' already drains the queue before destroying it, so there is no need to flush it explicitly. Remove the redundant 'flush_workqueue()' calls. This was generated with coccinelle: @@ expression E; @@ - flush_workqueue(E); destroy_workqueue(E); Reviewed-by: Andra Paraschiv Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/d57f5c7e362837a8dfcde0d726a76b56f114e619.1636736947.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman commit 17a7555bf21ce755219bf575b8a83adbf19580bd Merge: b32563b6ccbac bec251bc8b6ab Author: David S. Miller Date: Wed Nov 17 14:56:16 2021 +0000 Merge branch 'dev_watchdog-less-intrusive' Eric Dumazet says: ==================== net: make dev_watchdog() less intrusive dev_watchdog() is used on many NIC to periodically monitor TX queues to detect hangs. Problem is : It stops all queues, then check them, then 'unfreeze' them. Not only this stops feeding the NIC, it also migrates all qdiscs to be serviced on the cpu calling netif_tx_unlock(), causing a potential latency artifact. With many TX queues, this is becoming more visible. ==================== Signed-off-by: David S. Miller commit bec251bc8b6ab83464f6fca6842ad4ee47307d2e Author: Eric Dumazet Date: Tue Nov 16 19:29:24 2021 -0800 net: no longer stop all TX queues in dev_watchdog() There is no reason for stopping all TX queues from dev_watchdog() Not only this stops feeding the NIC, it also migrates all qdiscs to be serviced on the cpu calling netif_tx_unlock(), causing a potential latency artifact. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit dab8fe320726b38a6b1dc6a7ca6e386c5f7779e8 Author: Eric Dumazet Date: Tue Nov 16 19:29:23 2021 -0800 net: do not inline netif_tx_lock()/netif_tx_unlock() These are not fast path, there is no point in inlining them. Also provide netif_freeze_queues()/netif_unfreeze_queues() so that we can use them from dev_watchdog() in the following patch. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 5337824f4dc4bb26f38fbbba4ffb425a92803f15 Author: Eric Dumazet Date: Tue Nov 16 19:29:22 2021 -0800 net: annotate accesses to queue->trans_start In following patches, dev_watchdog() will no longer stop all queues. It will read queue->trans_start locklessly. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 8160fb43d55d26d64607fd32fe69185a5f5fe41f Author: Eric Dumazet Date: Tue Nov 16 19:29:21 2021 -0800 net: use an atomic_long_t for queue->trans_timeout tx_timeout_show() assumed dev_watchdog() would stop all the queues, to fetch queue->trans_timeout under protection of the queue->_xmit_lock. As we want to no longer disrupt transmits, we use an atomic_long_t instead. Signed-off-by: Eric Dumazet Cc: david decotigny Signed-off-by: David S. Miller commit b32563b6ccbacf2a1bf6fb7093b4fd2b7dc28612 Merge: 65483559dc0aa 28491d7ef4af4 Author: David S. Miller Date: Wed Nov 17 14:52:44 2021 +0000 Merge tag 'for-net-next-2021-11-16' 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 AOSP Bluetooth Quality Report - Enables AOSP extension for Mediatek Chip (MT7921 & MT7922) - Rework of HCI command execution serialization ==================== Signed-off-by: David S. Miller commit 1b9beda83e27a0c2cd75d1cb743c297c7b36c844 Author: Alexander Aring Date: Wed Nov 17 09:20:43 2021 -0500 fs: dlm: fix build with CONFIG_IPV6 disabled This patch will surround the AF_INET6 case in sk_error_report() of dlm with a #if IS_ENABLED(CONFIG_IPV6). The field sk->sk_v6_daddr is not defined when CONFIG_IPV6 is disabled. If CONFIG_IPV6 is disabled, the socket creation with AF_INET6 should already fail because a runtime check if AF_INET6 is registered. However if there is the possibility that AF_INET6 is set as sk_family the sk_error_report() callback will print then an invalid family type error. Reported-by: kernel test robot Fixes: 4c3d90570bcc ("fs: dlm: don't call kernel_getpeername() in error_report()") Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 379e4de9e140850cf699dd390f21ea4b923c955d Author: Reinette Chatre Date: Fri Oct 29 10:49:56 2021 -0700 x86/sgx: Fix minor documentation issues The SGX documentation has a few repeated or one-off issues: * Remove capitalization from regular words in the middle of a sentence. * Remove punctuation found in the middle of a sentence. * Fix name of SGX daemon to consistently be ksgxd. * Fix typo of SGX instruction: ENIT -> EINIT [ dhansen: tweaked subject and changelog ] Signed-off-by: Reinette Chatre Signed-off-by: Dave Hansen Reviewed-by: Jarkko Sakkinen Link: https://lkml.kernel.org/r/ab99a87368eef69e3fb96f073368becff3eff874.1635529506.git.reinette.chatre@intel.com commit 65483559dc0aa527652de43d0634736c7fc7c72f Author: Kurt Kanzenbach Date: Tue Nov 16 09:03:25 2021 +0100 net: ethernet: ti: cpsw: Enable PHY timestamping If the used PHYs also support hardware timestamping, all configuration requests should be forwared to the PHYs instead of being processed by the MAC driver itself. This enables PHY timestamping in combination with the cpsw driver. Tested with an am335x based board with two DP83640 PHYs connected to the cpsw switch. Signed-off-by: Kurt Kanzenbach Acked-by: Richard Cochran Signed-off-by: David S. Miller commit 2322b532ad9043336f36ba2634ab3620d5d5b4f5 Author: Zhaolong Zhang Date: Tue Nov 9 19:23:45 2021 +0800 x86/mce: Get rid of cpu_missing Get rid of cpu_missing because 7bb39313cd62 ("x86/mce: Make mce_timed_out() identify holdout CPUs") provides a more detailed message about which CPUs are missing. Suggested-by: Borislav Petkov Signed-off-by: Zhaolong Zhang Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20211109112345.2673403-1-zhangzl2013@126.com commit 738baea4970b36580cb1dd4f9b3fd5247aa1c7f5 Author: Vasudev Kamath Date: Tue Nov 16 12:51:48 2021 +0530 Documentation: networking: net_failover: Fix documentation Update net_failover documentation with missing and incomplete details to get a proper working setup. Signed-off-by: Vasudev Kamath Reviewed-by: Krishna Kumar Signed-off-by: David S. Miller commit 4616dddcfaf75cfbfbff7ce8a468038c697444ce Author: Saranya Gopal Date: Tue Nov 16 16:06:13 2021 +0530 usb: typec: ucsi: Expose number of alternate modes in partner Type-c class provides an option to expose the number of alternate modes in the port partner as a sysfs interface. Use that to expose the number of alternate modes in the port partner from the ucsi driver. Reviewed-by: Heikki Krogerus Signed-off-by: Rajaram Regupathy Signed-off-by: Saranya Gopal Link: https://lore.kernel.org/r/20211116103613.31349-1-saranya.gopal@intel.com Signed-off-by: Greg Kroah-Hartman commit 0d8cfeeef3f5a5966abce1903f80308be33280cb Author: Chunfeng Yun Date: Tue Nov 2 10:50:04 2021 +0800 usb: xhci-mtk: 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 function 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. Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/20211102025004.29156-2-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman commit 38269d2faddc26278edc99e14458c95dfd10455b Author: Chunfeng Yun Date: Tue Nov 2 10:50:03 2021 +0800 usb: xhci-mtk: remove unnecessary error check No need check the return value, just return it. Signed-off-by: Chunfeng Yun Link: https://lore.kernel.org/r/20211102025004.29156-1-chunfeng.yun@mediatek.com Signed-off-by: Greg Kroah-Hartman commit 6352f24ba40f4ebbb21cfa660ebb7a430c4fbdc5 Author: Philipp Hortmann Date: Sat Oct 30 13:25:10 2021 +0200 Docs: usb: update writesize, copy_from_user, usb_fill_bulk_urb, usb_submit_urb update code examples writesize, copy_from_user, usb_fill_bulk_urb, usb_submit_urb in skel_write() according to usb-skeleton.c Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/0c581a83dfc1a8c37e97dfa7279d333f367a9787.1635591623.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 925ed163abcfa0e27787a9989c12a5e98b7a12fd Author: Philipp Hortmann Date: Sat Oct 30 13:25:04 2021 +0200 Docs: usb: update comment and code near increment usage count update comment: increment our usage count .. and code according to usb-skeleton.c Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/38c6205d6b5c612902f9c187154c05e9cca51107.1635591623.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7ef0d85c87d15f62e0e8ae675ac3c027221bb72e Author: Philipp Hortmann Date: Sat Oct 30 13:24:55 2021 +0200 Docs: usb: update err() to pr_err() and replace __FILE__ update err() to pr_err() and replace __FILE__ Signed-off-by: Philipp Hortmann Link: https://lore.kernel.org/r/2c477cb0cf5214ae9abf9a4a9de28fcb38f90070.1635591623.git.philipp.g.hortmann@gmail.com Signed-off-by: Greg Kroah-Hartman commit a9f4a6e92b3b319296fb078da2615f618f6cd80c Author: Sean Christopherson Date: Thu Nov 11 02:07:38 2021 +0000 perf: Drop guest callback (un)register stubs Drop perf's stubs for (un)registering guest callbacks now that KVM registration of callbacks is hidden behind GUEST_PERF_EVENTS=y. The only other user is x86 XEN_PV, and x86 unconditionally selects PERF_EVENTS. No functional change intended. Signed-off-by: Sean Christopherson Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Paolo Bonzini Link: https://lore.kernel.org/r/20211111020738.2512932-18-seanjc@google.com commit 17ed14eba22b3a86e82fb6df28af00fb4cadfd77 Author: Sean Christopherson Date: Thu Nov 11 02:07:37 2021 +0000 KVM: arm64: Drop perf.c and fold its tiny bits of code into arm.c Call KVM's (un)register perf callbacks helpers directly from arm.c and delete perf.c No functional change intended. Signed-off-by: Sean Christopherson Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20211111020738.2512932-17-seanjc@google.com commit be399d824b432a85f8df86b566d2e5994fdf58b0 Author: Sean Christopherson Date: Thu Nov 11 02:07:36 2021 +0000 KVM: arm64: Hide kvm_arm_pmu_available behind CONFIG_HW_PERF_EVENTS=y Move the definition of kvm_arm_pmu_available to pmu-emul.c and, out of "necessity", hide it behind CONFIG_HW_PERF_EVENTS. Provide a stub for the key's wrapper, kvm_arm_support_pmu_v3(). Moving the key's definition out of perf.c will allow a future commit to delete perf.c entirely. Signed-off-by: Sean Christopherson Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20211111020738.2512932-16-seanjc@google.com commit 7b517831a1c6aceb0821860edb9c7bc7d4f803a2 Author: Sean Christopherson Date: Thu Nov 11 02:07:35 2021 +0000 KVM: arm64: Convert to the generic perf callbacks Drop arm64's version of the callbacks in favor of the callbacks provided by generic KVM, which are semantically identical. Signed-off-by: Sean Christopherson Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Marc Zyngier Link: https://lore.kernel.org/r/20211111020738.2512932-15-seanjc@google.com commit 33271a9e2b52e07e278a67c900d2d2afb5c55bd5 Author: Sean Christopherson Date: Thu Nov 11 02:07:34 2021 +0000 KVM: x86: Move Intel Processor Trace interrupt handler to vmx.c Now that all state needed for VMX's PT interrupt handler is exposed to vmx.c (specifically the currently running vCPU), move the handler into vmx.c where it belongs. Signed-off-by: Sean Christopherson Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20211111020738.2512932-14-seanjc@google.com commit e1bfc24577cc65c95dc519d7621a9c985b97e567 Author: Sean Christopherson Date: Thu Nov 11 02:07:33 2021 +0000 KVM: Move x86's perf guest info callbacks to generic KVM Move x86's perf guest callbacks into common KVM, as they are semantically identical to arm64's callbacks (the only other such KVM callbacks). arm64 will convert to the common versions in a future patch. Implement the necessary arm64 arch hooks now to avoid having to provide stubs or a temporary #define (from x86) to avoid arm64 compilation errors when CONFIG_GUEST_PERF_EVENTS=y. Signed-off-by: Sean Christopherson Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Paolo Bonzini Acked-by: Marc Zyngier Link: https://lore.kernel.org/r/20211111020738.2512932-13-seanjc@google.com commit db215756ae5970aec8ad50257d2eb1678b552b91 Author: Sean Christopherson Date: Thu Nov 11 02:07:32 2021 +0000 KVM: x86: More precisely identify NMI from guest when handling PMI Differentiate between IRQ and NMI for KVM's PMC overflow callback, which was originally invoked in response to an NMI that arrived while the guest was running, but was inadvertantly changed to fire on IRQs as well when support for perf without PMU/NMI was added to KVM. In practice, this should be a nop as the PMC overflow callback shouldn't be reached, but it's a cheap and easy fix that also better documents the situation. Note, this also doesn't completely prevent false positives if perf somehow ends up calling into KVM, e.g. an NMI can arrive in host after KVM sets its flag. Fixes: dd60d217062f ("KVM: x86: Fix perf timer mode IP reporting") Signed-off-by: Sean Christopherson Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Paolo Bonzini Link: https://lore.kernel.org/r/20211111020738.2512932-12-seanjc@google.com commit 73cd107b9685c5308e864061772e4a78a629e4a0 Author: Sean Christopherson Date: Thu Nov 11 02:07:31 2021 +0000 KVM: x86: Drop current_vcpu for kvm_running_vcpu + kvm_arch_vcpu variable Use the generic kvm_running_vcpu plus a new 'handling_intr_from_guest' variable in kvm_arch_vcpu instead of the semi-redundant current_vcpu. kvm_before/after_interrupt() must be called while the vCPU is loaded, (which protects against preemption), thus kvm_running_vcpu is guaranteed to be non-NULL when handling_intr_from_guest is non-zero. Switching to kvm_get_running_vcpu() will allows moving KVM's perf callbacks to generic code, and the new flag will be used in a future patch to more precisely identify the "NMI from guest" case. Signed-off-by: Sean Christopherson Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Paolo Bonzini Link: https://lore.kernel.org/r/20211111020738.2512932-11-seanjc@google.com commit 87b940a0675e25261f022ac3e53e0dfff9cdb995 Author: Sean Christopherson Date: Thu Nov 11 02:07:30 2021 +0000 perf/core: Use static_call to optimize perf_guest_info_callbacks Use static_call to optimize perf's guest callbacks on arm64 and x86, which are now the only architectures that define the callbacks. Use DEFINE_STATIC_CALL_RET0 as the default/NULL for all guest callbacks, as the callback semantics are that a return value '0' means "not in guest". static_call obviously avoids the overhead of CONFIG_RETPOLINE=y, but is also advantageous versus other solutions, e.g. per-cpu callbacks, in that a per-cpu memory load is not needed to detect the !guest case. Based on code from Peter and Like. Suggested-by: Peter Zijlstra (Intel) Signed-off-by: Sean Christopherson Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Paolo Bonzini Link: https://lore.kernel.org/r/20211111020738.2512932-10-seanjc@google.com commit 2aef6f306b39bbe74e2287d6e2ee07c4867d87d0 Author: Sean Christopherson Date: Thu Nov 11 02:07:29 2021 +0000 perf: Force architectures to opt-in to guest callbacks Introduce GUEST_PERF_EVENTS and require architectures to select it to allow registering and using guest callbacks in perf. This will hopefully make it more difficult for new architectures to add useless "support" for guest callbacks, e.g. via copy+paste. Stubbing out the helpers has the happy bonus of avoiding a load of perf_guest_cbs when GUEST_PERF_EVENTS=n on arm64/x86. Signed-off-by: Sean Christopherson Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Paolo Bonzini Link: https://lore.kernel.org/r/20211111020738.2512932-9-seanjc@google.com commit 1c3430516b0732d923de9fd3bfb3e2e537eeb235 Author: Sean Christopherson Date: Thu Nov 11 02:07:28 2021 +0000 perf: Add wrappers for invoking guest callbacks Add helpers for the guest callbacks to prepare for burying the callbacks behind a Kconfig (it's a lot easier to provide a few stubs than to #ifdef piles of code), and also to prepare for converting the callbacks to static_call(). perf_instruction_pointer() in particular will have subtle semantics with static_call(), as the "no callbacks" case will return 0 if the callbacks are unregistered between querying guest state and getting the IP. Implement the change now to avoid a functional change when adding static_call() support, and because the new helper needs to return _something_ in this case. Signed-off-by: Sean Christopherson Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Paolo Bonzini Link: https://lore.kernel.org/r/20211111020738.2512932-8-seanjc@google.com commit b9f5621c9547dd787900f005a9e1c3d5712de512 Author: Like Xu Date: Thu Nov 11 02:07:27 2021 +0000 perf/core: Rework guest callbacks to prepare for static_call support To prepare for using static_calls to optimize perf's guest callbacks, replace ->is_in_guest and ->is_user_mode with a new multiplexed hook ->state, tweak ->handle_intel_pt_intr to play nice with being called when there is no active guest, and drop "guest" from ->get_guest_ip. Return '0' from ->state and ->handle_intel_pt_intr to indicate "not in guest" so that DEFINE_STATIC_CALL_RET0 can be used to define the static calls, i.e. no callback == !guest. [sean: extracted from static_call patch, fixed get_ip() bug, wrote changelog] Suggested-by: Peter Zijlstra (Intel) Originally-by: Peter Zijlstra (Intel) Signed-off-by: Like Xu Signed-off-by: Zhu Lingshan Signed-off-by: Sean Christopherson Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Boris Ostrovsky Reviewed-by: Paolo Bonzini Link: https://lore.kernel.org/r/20211111020738.2512932-7-seanjc@google.com commit 84af21d850ee1ccc990df37dd47c13fdfe93be75 Author: Sean Christopherson Date: Thu Nov 11 02:07:26 2021 +0000 perf: Drop dead and useless guest "support" from arm, csky, nds32 and riscv Drop "support" for guest callbacks from architectures that don't implement the guest callbacks. Future patches will convert the callbacks to static_call; rather than churn a bunch of arch code (that was presumably copy+pasted from x86), remove it wholesale as it's useless and at best wasting cycles. A future patch will also add a Kconfig to force architcture to opt into the callbacks to make it more difficult for uses "support" to sneak in in the future. No functional change intended. Signed-off-by: Sean Christopherson Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Paolo Bonzini Link: https://lore.kernel.org/r/20211111020738.2512932-6-seanjc@google.com commit 2934e3d09350c1a7ca2433fbeabfcd831e48a575 Author: Sean Christopherson Date: Thu Nov 11 02:07:25 2021 +0000 perf: Stop pretending that perf can handle multiple guest callbacks Drop the 'int' return value from the perf (un)register callbacks helpers and stop pretending perf can support multiple callbacks. The 'int' returns are not future proofing anything as none of the callers take action on an error. It's also not obvious that there will ever be co-tenant hypervisors, and if there are, that allowing multiple callbacks to be registered is desirable or even correct. Opportunistically rename callbacks=>cbs in the affected declarations to match their definitions. No functional change intended. Signed-off-by: Sean Christopherson Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Paolo Bonzini Link: https://lore.kernel.org/r/20211111020738.2512932-5-seanjc@google.com commit f4b027c5c8199abd4fb6f00d67d380548dbfdfa8 Author: Sean Christopherson Date: Thu Nov 11 02:07:24 2021 +0000 KVM: x86: Register Processor Trace interrupt hook iff PT enabled in guest Override the Processor Trace (PT) interrupt handler for guest mode if and only if PT is configured for host+guest mode, i.e. is being used independently by both host and guest. If PT is configured for system mode, the host fully controls PT and must handle all events. Fixes: 8479e04e7d6b ("KVM: x86: Inject PMI for KVM guest") Reported-by: Alexander Shishkin Reported-by: Artem Kashkanov Signed-off-by: Sean Christopherson Signed-off-by: Peter Zijlstra (Intel) Acked-by: Paolo Bonzini Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20211111020738.2512932-4-seanjc@google.com commit 5c7df80e2ce4c954c80eb4ecf5fa002a5ff5d2d6 Author: Sean Christopherson Date: Thu Nov 11 02:07:23 2021 +0000 KVM: x86: Register perf callbacks after calling vendor's hardware_setup() Wait to register perf callbacks until after doing vendor hardaware setup. VMX's hardware_setup() configures Intel Processor Trace (PT) mode, and a future fix to register the Intel PT guest interrupt hook if and only if Intel PT is exposed to the guest will consume the configured PT mode. Delaying registration to hardware setup is effectively a nop as KVM's perf hooks all pivot on the per-CPU current_vcpu, which is non-NULL only when KVM is handling an IRQ/NMI in a VM-Exit path. I.e. current_vcpu will be NULL throughout both kvm_arch_init() and kvm_arch_hardware_setup(). Signed-off-by: Sean Christopherson Signed-off-by: Peter Zijlstra (Intel) Acked-by: Paolo Bonzini Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20211111020738.2512932-3-seanjc@google.com commit ff083a2d972f56bebfd82409ca62e5dfce950961 Author: Sean Christopherson Date: Thu Nov 11 02:07:22 2021 +0000 perf: Protect perf_guest_cbs with RCU Protect perf_guest_cbs with RCU to fix multiple possible errors. Luckily, all paths that read perf_guest_cbs already require RCU protection, e.g. to protect the callback chains, so only the direct perf_guest_cbs touchpoints need to be modified. Bug #1 is a simple lack of WRITE_ONCE/READ_ONCE behavior to ensure perf_guest_cbs isn't reloaded between a !NULL check and a dereference. Fixed via the READ_ONCE() in rcu_dereference(). Bug #2 is that on weakly-ordered architectures, updates to the callbacks themselves are not guaranteed to be visible before the pointer is made visible to readers. Fixed by the smp_store_release() in rcu_assign_pointer() when the new pointer is non-NULL. Bug #3 is that, because the callbacks are global, it's possible for readers to run in parallel with an unregisters, and thus a module implementing the callbacks can be unloaded while readers are in flight, resulting in a use-after-free. Fixed by a synchronize_rcu() call when unregistering callbacks. Bug #1 escaped notice because it's extremely unlikely a compiler will reload perf_guest_cbs in this sequence. perf_guest_cbs does get reloaded for future derefs, e.g. for ->is_user_mode(), but the ->is_in_guest() guard all but guarantees the consumer will win the race, e.g. to nullify perf_guest_cbs, KVM has to completely exit the guest and teardown down all VMs before KVM start its module unload / unregister sequence. This also makes it all but impossible to encounter bug #3. Bug #2 has not been a problem because all architectures that register callbacks are strongly ordered and/or have a static set of callbacks. But with help, unloading kvm_intel can trigger bug #1 e.g. wrapping perf_guest_cbs with READ_ONCE in perf_misc_flags() while spamming kvm_intel module load/unload leads to: 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 CPU: 6 PID: 1825 Comm: stress Not tainted 5.14.0-rc2+ #459 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015 RIP: 0010:perf_misc_flags+0x1c/0x70 Call Trace: perf_prepare_sample+0x53/0x6b0 perf_event_output_forward+0x67/0x160 __perf_event_overflow+0x52/0xf0 handle_pmi_common+0x207/0x300 intel_pmu_handle_irq+0xcf/0x410 perf_event_nmi_handler+0x28/0x50 nmi_handle+0xc7/0x260 default_do_nmi+0x6b/0x170 exc_nmi+0x103/0x130 asm_exc_nmi+0x76/0xbf Fixes: 39447b386c84 ("perf: Enhance perf to allow for guest statistic collection from host") Signed-off-by: Sean Christopherson Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Paolo Bonzini Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20211111020738.2512932-2-seanjc@google.com commit cb0e52b7748737b2cf6481fdd9b920ce7e1ebbdf Author: Brian Chen Date: Wed Nov 10 21:33:12 2021 +0000 psi: Fix PSI_MEM_FULL state when tasks are in memstall and doing reclaim We've noticed cases where tasks in a cgroup are stalled on memory but there is little memory FULL pressure since tasks stay on the runqueue in reclaim. A simple example involves a single threaded program that keeps leaking and touching large amounts of memory. It runs in a cgroup with swap enabled, memory.high set at 10M and cpu.max ratio set at 5%. Though there is significant CPU pressure and memory SOME, there is barely any memory FULL since the task enters reclaim and stays on the runqueue. However, this memory-bound task is effectively stalled on memory and we expect memory FULL to match memory SOME in this scenario. The code is confused about memstall && running, thinking there is a stalled task and a productive task when there's only one task: a reclaimer that's counted as both. To fix this, we redefine the condition for PSI_MEM_FULL to check that all running tasks are in an active memstall instead of checking that there are no running tasks. case PSI_MEM_FULL: - return unlikely(tasks[NR_MEMSTALL] && !tasks[NR_RUNNING]); + return unlikely(tasks[NR_MEMSTALL] && + tasks[NR_RUNNING] == tasks[NR_MEMSTALL_RUNNING]); This will capture reclaimers. It will also capture tasks that called psi_memstall_enter() and are about to sleep, but this should be negligible noise. Signed-off-by: Brian Chen Signed-off-by: Peter Zijlstra (Intel) Acked-by: Johannes Weiner Link: https://lore.kernel.org/r/20211110213312.310243-1-brianchen118@gmail.com commit 4feee7d12603deca8775f9f9ae5e121093837444 Author: Josh Don Date: Mon Oct 18 13:34:28 2021 -0700 sched/core: Forced idle accounting Adds accounting for "forced idle" time, which is time where a cookie'd task forces its SMT sibling to idle, despite the presence of runnable tasks. Forced idle time is one means to measure the cost of enabling core scheduling (ie. the capacity lost due to the need to force idle). Forced idle time is attributed to the thread responsible for causing the forced idle. A few details: - Forced idle time is displayed via /proc/PID/sched. It also requires that schedstats is enabled. - Forced idle is only accounted when a sibling hyperthread is held idle despite the presence of runnable tasks. No time is charged if a sibling is idle but has no runnable tasks. - Tasks with 0 cookie are never charged forced idle. - For SMT > 2, we scale the amount of forced idle charged based on the number of forced idle siblings. Additionally, we split the time up and evenly charge it to all running tasks, as each is equally responsible for the forced idle. Signed-off-by: Josh Don Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20211018203428.2025792-1-joshdon@google.com commit 2fb75e1b642f49253d8848c9e47e8942f5366221 Author: Liu Xinpeng Date: Mon Oct 25 11:46:26 2021 +0800 psi: Add a missing SPDX license header Add the missing SPDX license header to include/linux/psi.h include/linux/psi_types.h kernel/sched/psi.c Signed-off-by: Liu Xinpeng Signed-off-by: Peter Zijlstra (Intel) Acked-by: Johannes Weiner Link: https://lore.kernel.org/r/1635133586-84611-2-git-send-email-liuxp11@chinatelecom.cn commit 2d3791f116bb3d5b17571dadb8e085e12ae3a3cf Author: Liu Xinpeng Date: Mon Oct 25 11:46:25 2021 +0800 psi: Remove repeated verbose comment Comment in function psi_task_switch,there are two same lines. ... * runtime state, the cgroup that contains both tasks * runtime state, the cgroup that contains both tasks ... Signed-off-by: Liu Xinpeng Signed-off-by: Peter Zijlstra (Intel) Acked-by: Johannes Weiner Link: https://lore.kernel.org/r/1635133586-84611-1-git-send-email-liuxp11@chinatelecom.cn commit 2202e15b2b1a946ce760d96748cd7477589701ab Author: Sebastian Andrzej Siewior Date: Thu Nov 4 13:27:06 2021 +0100 kernel/locking: Use a pointer in ww_mutex_trylock(). mutex_acquire_nest() expects a pointer, pass the pointer. Fixes: 12235da8c80a1 ("kernel/locking: Add context to ww_mutex_trylock()") Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20211104122706.frk52zxbjorso2kv@linutronix.de commit 072927d1cebf47eb3020c26d2d2db3f51936c928 Author: Mauro Carvalho Chehab Date: Wed Nov 17 09:12:50 2021 +0000 media: atomisp: sh_css_sp: better support the current firmware As we're using Intel Aero firmware, make the code closer to the driver for such device. Signed-off-by: Mauro Carvalho Chehab commit 49c39ec4670a8f045729e3717af2e1a74caf89a5 Author: Christian König Date: Mon Sep 13 14:21:25 2021 +0200 dma-buf: nuke dma_resv_get_excl_unlocked Heureka, that's finally not used any more. Signed-off-by: Christian König Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20210917123513.1106-27-christian.koenig@amd.com commit 37c4fd0db7c961145d9d1909ecab386fdf703c26 Author: Takashi Iwai Date: Wed Nov 17 14:30:40 2021 +0100 ALSA: hda: Do disconnect jacks at codec unbind The HD-audio codec driver remove may happen also at dynamically unbinding during operation, hence it needs manual triggers of snd_device_disconnect() calls, while it's missing for the jack objects that are associated with the codec. This patch adds the manual disconnection call for jacks when the remove happens without card->shutdown (i.e. not under the full removal). Link: https://lore.kernel.org/r/20211117133040.20272-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 4a555f2b8d31d2dae523b56613a14360061e4c76 Author: Balamanikandan Gunasundar Date: Tue Oct 26 14:26:10 2021 +0530 usb: gadget: at91_udc: Convert to GPIO descriptors Replace the legacy GPIO APIs with gpio descriptor consumer interface. Remove all gpio inversion(active low) flags as it is already handled by the gpiod_set_value() and gpiod_get_value() functions. Reviewed-by: Dan Sneddon Signed-off-by: Balamanikandan Gunasundar Link: https://lore.kernel.org/r/20211026085610.25264-1-balamanikandan.gunasundar@microchip.com Signed-off-by: Greg Kroah-Hartman commit 16d42759207fc3d1bff7cfd330a08a225e470ba0 Author: Qihang Hu Date: Wed Nov 10 18:11:29 2021 +0800 usb: gadget: composite: Show warning if function driver's descriptors are incomplete. In the config_ep_by_speed_and_alt function, select the corresponding descriptor through g->speed. But some legacy or not well designed function drivers may not support the corresponding speed. So, we can directly display warnings instead of causing kernel panic. At the same time, it indicates the reasons in warning message. Reviewed-by: Peter Chen Signed-off-by: Qihang Hu Link: https://lore.kernel.org/r/20211110101129.462357-1-huqihang@oppo.com Signed-off-by: Greg Kroah-Hartman commit d429976170a5699ef2cc03e3e3abfc06098754cc Author: John Keeping Date: Fri Oct 29 14:41:14 2021 +0100 usb: gadget: f_midi: allow resetting index option Unlike the other integral options supported by the MIDI gadget, index is a signed integer and defaults to -1, which means "choose any sound card index". The generic store routine parses input into a u32 which fails to properly read -1 if an attempt is made to set the value to the default. Add a new macro block for signed values to fix this, and use the correct format string for unsigned values. Signed-off-by: John Keeping Link: https://lore.kernel.org/r/20211029134115.351008-1-john@metanate.com Signed-off-by: Greg Kroah-Hartman commit f057a1d4f0d2cf66f6a4b578c846bbb1d0eb0223 Author: Christophe JAILLET Date: Fri Nov 12 17:30:16 2021 +0100 usb: Remove redundant 'flush_workqueue()' calls 'destroy_workqueue()' already drains the queue before destroying it, so there is no need to flush it explicitly. Remove the redundant 'flush_workqueue()' calls. This was generated with coccinelle: @@ expression E; @@ - flush_workqueue(E); destroy_workqueue(E); Acked-by: Shuah Khan Acked-by: Peter Chen # for chipidea part Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/563123a8117d6cafae3f134e497587bd2b8bb7f4.1636734453.git.christophe.jaillet@wanadoo.fr Signed-off-by: Greg Kroah-Hartman commit c76ef96fc00eb398c8fc836b0eb2f82bcc619dc7 Author: Pavankumar Kondeti Date: Fri Nov 12 15:54:40 2021 +0530 usb: gadget: f_fs: Use stream_open() for endpoint files Function fs endpoint file operations are synchronized via an interruptible mutex wait. However we see threads that do ep file operations concurrently are getting blocked for the mutex lock in __fdget_pos(). This is an uninterruptible wait and we see hung task warnings and kernel panic if hung_task_panic systcl is enabled if host does not send/receive the data for long time. The reason for threads getting blocked in __fdget_pos() is due to the file position protection introduced by the commit 9c225f2655e3 ("vfs: atomic f_pos accesses as per POSIX"). Since function fs endpoint files does not have the notion of the file position, switch to the stream mode. This will bypass the file position mutex and threads will be blocked in interruptible state for the function fs mutex. It should not affects user space as we are only changing the task state changes the task state from UNINTERRUPTIBLE to INTERRUPTIBLE while waiting for the USB transfers to be finished. However there is a slight change to the O_NONBLOCK behavior. Earlier threads that are using O_NONBLOCK are also getting blocked inside fdget_pos(). Now they reach to function fs and error code is returned. The non blocking behavior is actually honoured now. Reviewed-by: John Keeping Signed-off-by: Pavankumar Kondeti Link: https://lore.kernel.org/r/1636712682-1226-1-git-send-email-quic_pkondeti@quicinc.com Signed-off-by: Greg Kroah-Hartman commit 9933698f6119886c110750e67c10ac66f12b730f Author: Haimin Zhang Date: Sat Nov 13 11:53:20 2021 -0500 USB: ehci_brcm_hub_control: Improve port index sanitizing Due to (wIndex & 0xff) - 1 can get an integer greater than 15, this can cause array index to be out of bounds since the size of array port_status is 15. This change prevents a possible out-of-bounds pointer computation by forcing the use of a valid port number. Reported-by: TCS Robot Signed-off-by: Haimin Zhang Signed-off-by: Alan Stern Link: https://lore.kernel.org/r/20211113165320.GA59686@rowland.harvard.edu Signed-off-by: Greg Kroah-Hartman commit fa78e367a24977d76832fda6790e9e1c35788f80 Author: Christian König Date: Wed Sep 22 14:13:13 2021 +0200 drm/amdgpu: stop getting excl fence separately Just grab all fences for the display flip in one go. Signed-off-by: Christian König Acked-by: Alex Deucher Link: https://patchwork.freedesktop.org/patch/msgid/20211028132630.2330-2-christian.koenig@amd.com commit 4ce3b45704d5ef46fb4b28083c8aba6716fabf3b Author: Amjad Ouled-Ameur Date: Fri Nov 12 17:28:26 2021 +0100 usb: dwc3: meson-g12a: fix shared reset control use reset_control_(de)assert() calls are called on a shared reset line when reset_control_reset has been used. This is not allowed by the reset framework. Use reset_control_rearm() call in suspend() and remove() as a way to state that the resource is no longer used, hence the shared reset line may be triggered again by other devices. Use reset_control_rearm() also in case probe fails after reset() has been called. reset_control_rearm() keeps use of triggered_count sane in the reset framework, use of reset_control_reset() on shared reset line should be balanced with reset_control_rearm(). Signed-off-by: Amjad Ouled-Ameur Reported-by: Jerome Brunet Link: https://lore.kernel.org/r/20211112162827.128319-3-aouledameur@baylibre.com Signed-off-by: Greg Kroah-Hartman commit 433ba26f40d468fdceb26a179cee129339b566bc Author: David Heidelberg Date: Fri Oct 29 12:33:38 2021 +0200 dt-bindings: usb: qcom,dwc3: add binding for IPQ4019 and IPQ8064 Add compatible string for Qualcomm IPQ4019 and IPQ8064 SoC. Acked-by: Rob Herring Signed-off-by: David Heidelberg Link: https://lore.kernel.org/r/20211029103340.26828-1-david@ixit.cz Signed-off-by: Greg Kroah-Hartman commit 2cbb8d4d67700b4ea7373a307676fe312251b257 Author: Christian König Date: Thu Oct 21 12:35:39 2021 +0200 drm/i915: use new iterator in i915_gem_object_wait_reservation Simplifying the code a bit. Signed-off-by: Christian König [mlankhorst: Handle timeout = 0 correctly, use new i915_request_wait_timeout.] Signed-off-by: Maarten Lankhorst Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20211116102431.198905-7-christian.koenig@amd.com commit 7e2e69ed4678a4c660c4727e625a396b06c0c372 Author: Maarten Lankhorst Date: Thu Oct 21 12:35:38 2021 +0200 drm/i915: Fix i915_request fence wait semantics The i915_request fence wait behaves differently for timeout = 0 compared to expected dma-fence behavior. i915 behavior: - Unsignaled: -ETIME - Signaled: 0 (= timeout) Expected: - Unsignaled: 0 - Signaled: 1 Signed-off-by: Maarten Lankhorst Acked-by: Daniel Vetter Acked-by: Christian König Link: https://patchwork.freedesktop.org/patch/msgid/20211116102431.198905-6-christian.koenig@amd.com Signed-off-by: Christian König commit ba67723f946165684fb82f367096ddd126b64d2d Author: Fabrice Gasnier Date: Wed Oct 27 14:12:32 2021 +0200 dt-bindings: usb: dwc2: document the port when usb-role-switch is used Document the "port" property, which is used with "usb-role-switch" to describe the bus connector. Definition is inspired from mediatek,mtu3.yaml. This fixes some errors seen when running "make dtbs_check": ... 'port' does not match any of the regexes: 'pinctrl-[0-9]+' From schema: ... Documentation/devicetree/bindings/usb/dwc2.yaml Note: add dependencies so that 'usb-role-switch' without port is valid or both must be present. Reviewed-by: Rob Herring Signed-off-by: Fabrice Gasnier Link: https://lore.kernel.org/r/1635336752-14796-1-git-send-email-fabrice.gasnier@foss.st.com Signed-off-by: Greg Kroah-Hartman commit 9c8846c73ec0014acaac1f2ff4134ab5a9cc2996 Author: Jason Wang Date: Sun Nov 14 13:51:40 2021 +0800 usb: cdnsp: Remove unneeded semicolon after `}' The semicolon after `}' is unneeded. So, just remove it. Signed-off-by: Jason Wang Link: https://lore.kernel.org/r/20211114055140.213945-1-wangborong@cdjrlc.com Signed-off-by: Greg Kroah-Hartman commit 5e9ddbdcf730a2671b9a07c6de45b53f139995af Author: Christian König Date: Mon Sep 13 13:24:08 2021 +0200 drm/i915: use new cursor in intel_prepare_plane_fb v2 Simplifying the code a bit. v2: rebased Signed-off-by: Christian König Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20211116102431.198905-5-christian.koenig@amd.com commit 1b5bdf071e62ac57ad699d60ddbd392b266f58b0 Author: Christian König Date: Mon Sep 13 11:45:31 2021 +0200 drm/i915: use the new iterator in i915_sw_fence_await_reservation v3 Simplifying the code a bit. v2: use dma_resv_for_each_fence instead, according to Tvrtko the lock is held here anyway. v3: back to using dma_resv_for_each_fence_unlocked. Signed-off-by: Christian König Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20211116102431.198905-4-christian.koenig@amd.com commit 73495209f645183c84a86bc067818a8c4ac20fdd Author: Christian König Date: Mon Sep 13 13:16:40 2021 +0200 drm/i915: use new iterator in i915_gem_object_wait_priority Simplifying the code a bit. Signed-off-by: Christian König Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20211116102431.198905-3-christian.koenig@amd.com commit 912ff2ebd695c582ca4cebf833ad73a378a99f23 Author: Christian König Date: Tue Jun 15 15:36:44 2021 +0200 drm/i915: use the new iterator in i915_gem_busy_ioctl v2 This makes the function much simpler since the complex retry logic is now handled else where. Signed-off-by: Christian König Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20211116102431.198905-2-christian.koenig@amd.com commit 6749e69c4dadd352bdfdb306513aa48cc15fbdd6 Author: Jens Wiklander Date: Tue Jun 15 22:23:54 2021 +0200 optee: add asynchronous notifications Adds support for asynchronous notifications from secure world to normal world. This allows a design with a top half and bottom half type of driver where the top half runs in secure interrupt context and a notifications tells normal world to schedule a yielding call to do the bottom half processing. The protocol is defined in optee_msg.h optee_rpc_cmd.h and optee_smc.h. A notification consists of a 32-bit value which normal world can retrieve using a fastcall into secure world. The value OPTEE_SMC_ASYNC_NOTIF_VALUE_DO_BOTTOM_HALF (0) has a special meaning. When this value is sent it means that normal world is supposed to make a yielding call OPTEE_MSG_CMD_DO_BOTTOM_HALF. Notification capability is negotiated while the driver is initialized. If both sides supports these notifications then they are enabled. An interrupt is used to notify the driver that there are asynchronous notifications pending. The maximum needed notification value is communicated at this stage. This allows scaling up when needed. Reviewed-by: Sumit Garg Acked-by: Ard Biesheuvel Signed-off-by: Jens Wiklander commit 787c80cc7b22804aa370f04a19f9fe0fa98b1e49 Author: Jens Wiklander Date: Tue Jun 15 22:23:53 2021 +0200 optee: separate notification functions Renames struct optee_wait_queue to struct optee_notif and all related functions to optee_notif_*(). The implementation is changed to allow sending a notification from an atomic state, that is from the top half of an interrupt handler. Waiting for keys is currently only used when secure world is waiting for a mutex or condition variable. The old implementation could handle any 32-bit key while this new implementation is restricted to only 8 bits or the maximum value 255. A upper value is needed since a bitmap is allocated to allow an interrupt handler to only set a bit in case the waiter hasn't had the time yet to allocate and register a completion. The keys are currently only representing secure world threads which number usually are never even close to 255 so it should be safe for now. In future ABI updates the maximum value of the key will be communicated while the driver is initializing. Reviewed-by: Sumit Garg Signed-off-by: Jens Wiklander commit 1e2c3ef0496e72ba9001da5fd1b7ed56ccb30597 Author: Jens Wiklander Date: Mon Oct 4 16:11:52 2021 +0200 tee: export teedev_open() and teedev_close_context() Exports the two functions teedev_open() and teedev_close_context() in order to make it easier to create a driver internal struct tee_context. Reviewed-by: Sumit Garg Signed-off-by: Jens Wiklander commit f18397ab3ae23e8e43bba9986e66af6d4497f2ad Author: Jens Wiklander Date: Tue Jun 15 22:23:50 2021 +0200 tee: fix put order in teedev_close_context() Prior to this patch was teedev_close_context() calling tee_device_put() before teedev_ctx_put() leading to teedev_ctx_release() accessing ctx->teedev just after the reference counter was decreased on the teedev. Fix this by calling teedev_ctx_put() before tee_device_put(). Fixes: 217e0250cccb ("tee: use reference counting for tee_context") Reviewed-by: Sumit Garg Signed-off-by: Jens Wiklander commit ff5fdc34d0aed9931c01e6d50f7f873ecf8df8d3 Author: Jens Wiklander Date: Tue Jun 15 22:23:48 2021 +0200 dt-bindings: arm: optee: add interrupt property Adds an optional interrupt property to the optee binding. Reviewed-by: Sumit Garg Reviewed-by: Rob Herring Acked-by: Marc Zyngier Signed-off-by: Jens Wiklander commit 63d5bc420f460162cc5318136c2bddba87cfbb29 Author: Jens Wiklander Date: Tue Jun 15 22:23:44 2021 +0200 docs: staging/tee.rst: add a section on OP-TEE notifications Adds a section on notifications used by OP-TEE, synchronous and asynchronous. Reviewed-by: Sumit Garg Acked-by: Marc Zyngier Signed-off-by: Jens Wiklander commit 40fafc8eca3f0d41b9dade5c10afb2dad723aad7 Author: oujiefeng Date: Wed Nov 17 09:21:19 2021 +0800 spi: hisi-kunpeng: Fix the debugfs directory name incorrect Change the debugfs directory name from hisi_spi65535 to hisi_spi0. Fixes: 2b2142f247eb ("spi: hisi-kunpeng: Add debugfs support") Signed-off-by: oujiefeng Signed-off-by: Jay Fang Link: https://lore.kernel.org/r/20211117012119.55558-1-f.fangjian@huawei.com Signed-off-by: Mark Brown commit 7fabe7fed182498cac568100d8e28d4b95f8a80e Author: Olivier Moysan Date: Wed Nov 17 12:00:31 2021 +0100 ASoC: stm32: sai: increase channels_max limit The SAI peripheral supports up to 16 channels in TDM mode (8L+8R). The driver currently supports TDM over two channels. Increase SAI DAI playback/record channels_max, to also allow up to 16 channels in TDM mode. Signed-off-by: Olivier Moysan Link: https://lore.kernel.org/r/20211117110031.19345-1-olivier.moysan@foss.st.com Signed-off-by: Mark Brown commit 2f0b1b013bbc5d6f4c7c386e12f423d6b4ef3245 Author: Peter Ujfalusi Date: Tue Nov 16 17:21:37 2021 +0200 ASoC: SOF: debug: Add support for IPC message injection In order to stress test the firmware's ability to handle (mis)crafted IPC messages this patch adds a debugfs interface where a binary file (message) can be written and the message is sent to the firmware as it is. Read on the same file will return the reply from the firmware if it is available as a binary. Signed-off-by: Peter Ujfalusi Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Reviewed-by: Guennadi Liakhovetski Signed-off-by: Daniel Baluta Link: https://lore.kernel.org/r/20211116152137.52129-5-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit 0bd2891bda4550774946abbfac88443a16c15d5a Author: Peter Ujfalusi Date: Tue Nov 16 17:21:36 2021 +0200 ASoC: SOF: intel: Use the generic helper to get the reply Make use of the generic snd_sof_ipc_process_reply() from the core instead the local implementation. snd_sof_ipc_process_reply() handles the reply retrieving and the ipc reply Signed-off-by: Peter Ujfalusi Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Reviewed-by: Guennadi Liakhovetski Signed-off-by: Daniel Baluta Link: https://lore.kernel.org/r/20211116152137.52129-4-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit 18c45f270352fb76c8b5b133b3ae3971769f8a22 Author: Peter Ujfalusi Date: Tue Nov 16 17:21:35 2021 +0200 ASoC: SOF: imx: Use the generic helper to get the reply Make use of the generic snd_sof_ipc_process_reply() from the core instead the local implementation. snd_sof_ipc_process_reply() handles the reply retrieving and the ipc reply Signed-off-by: Peter Ujfalusi Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Reviewed-by: Guennadi Liakhovetski Signed-off-by: Daniel Baluta Link: https://lore.kernel.org/r/20211116152137.52129-3-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit 8ae77801c81d16a09f6b67a6f8d91255d34f5f2c Author: Peter Ujfalusi Date: Tue Nov 16 17:21:34 2021 +0200 ASoC: SOF: utils: Add generic function to get the reply for a tx message The code to get the reply for a tx is identical in all but one place: imx8_get_reply(), imx8m_get_reply(), atom_get_reply(), bdw_get_reply(). hda_dsp_ipc_get_reply() have additional check in place for PROBES and special handling of PM messages. Add a generic implementation to the core which can be used as drop in replacement. The reply size check is changed to be able to handle cases when the reply size is not know beforehand (this is the case for PROBES and DEBUG_MEM_USAGE for example). Signed-off-by: Peter Ujfalusi Reviewed-by: Rander Wang Reviewed-by: Ranjani Sridharan Reviewed-by: Pierre-Louis Bossart Reviewed-by: Guennadi Liakhovetski Signed-off-by: Daniel Baluta Link: https://lore.kernel.org/r/20211116152137.52129-2-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit bbf0e1d36519a5cd2c08dc1348f997cd5240eb2e Author: Richard Fitzgerald Date: Tue Nov 16 16:39:01 2021 +0000 ASoC: cs42l42: Remove redundant pll_divout member Now that struct cs42l42_private has pll_config, the current PLL configuration can be looked up directly in pll_ratio_table. This makes the pll_divout member of cs42l42_private redundant since it was only a copy of the value from pll_ratio_table. Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20211116163901.45390-5-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit 3edde6de090617adea18f2068489086c0d8087e3 Author: Richard Fitzgerald Date: Tue Nov 16 16:39:00 2021 +0000 ASoC: cs42l42: Simplify reporting of jack unplug When reporting a jack unplug there's no need to make the reported flags conditional on which flags were reported during the plug event. It's perfectly safe to report all flags and buttons as not-present and let the higher code filter for changes. There's also no need to make two separate snd_soc_jack_report() calls for presence flags and button flags. It can all be done in one report. Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20211116163901.45390-4-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit f2dfbaaa5404cadf70213146a5b4b89b647d9092 Author: Richard Fitzgerald Date: Tue Nov 16 16:38:59 2021 +0000 ASoC: cs42l42: Remove redundant writes to RS_PLUG/RS_UNPLUG masks The RS_PLUG and RS_UNPLUG interrupt masks are always written as 1 so those writes are redundant and can be deleted. This makes it completely clear in the code that only the TS_PLUG and TS_UNPLUG masks are being changed. Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20211116163901.45390-3-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit 976001b10fa4441917f216452e70fd8c5aeccd94 Author: Richard Fitzgerald Date: Tue Nov 16 16:38:58 2021 +0000 ASoC: cs42l42: Remove redundant writes to DETECT_MODE There are multiple places where DETECT_MODE is included in a register write, but in every case it is written as 0. Removing these redundant writes makes the code less cluttered and also makes it obvious that DETECT_MODE is never changed. A single initialization to 0 is added to cs42l42_setup_hs_type_detect(). Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20211116163901.45390-2-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit 228e804599602555e15db467e41a11977757489f Author: Pratyush Yadav Date: Fri Oct 29 23:41:57 2021 +0530 MAINTAINERS: Add myself as SPI NOR co-maintainer I have been reviewing patches and contributing for over a year. I would like to help maintain the subsystem as well. Signed-off-by: Pratyush Yadav Signed-off-by: Tudor Ambarus Acked-by: Miquel Raynal Acked-by: Richard Weinberger Link: https://lore.kernel.org/r/20211029181157.20623-1-p.yadav@ti.com commit 1189d2fb15a4b09b2e8dd01d60a0817d985d933d Author: Zameer Manji Date: Tue Nov 16 19:35:41 2021 +0000 staging: r8188eu: delete unused header The iee80211_ext.h header is unused and can be removed. Signed-off-by: Zameer Manji Link: https://lore.kernel.org/r/20211116193557.1188939-1-zmanji@gmail.com Signed-off-by: Greg Kroah-Hartman commit 06e6885d6a1df66b84b1c757355556254943d7d5 Author: Michael Straube Date: Wed Nov 17 08:20:07 2021 +0100 staging: r8188eu: code indent should use tabs Replace spaces with tab to clear the following checkpatch issues. usb_intf.c:38: ERROR: code indent should use tabs where possible usb_intf.c:38: WARNING: please, no spaces at the start of a line Signed-off-by: Michael Straube Link: https://lore.kernel.org/r/20211117072007.19924-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman commit 8495a34094b49de2994fdf3a3cf2787227f3a253 Author: Zameer Manji Date: Tue Nov 16 01:14:33 2021 +0000 staging: r8188eu: remove unused defines in wifi.h None of these defines in wifi.h are used so they can be safely removed. Reviewed-by: Pavel Skripkin Signed-off-by: Zameer Manji Link: https://lore.kernel.org/r/20211116011451.896714-1-zmanji@gmail.com Signed-off-by: Greg Kroah-Hartman commit fce0490dcbeecee828f829a56201b1c5999edf81 Author: Guo Zhengkui Date: Tue Nov 16 14:41:07 2021 +0800 staging: r8188eu: fix array_size.cocci warning Fix following array_size.cocci warning: ./drivers/staging/r8188eu/core/rtw_rf.c:38:48-49: WARNING: Use ARRAY_SIZE. ARRAY_SIZE() defined in is safer because it uses __must_be_array(). Signed-off-by: Guo Zhengkui Link: https://lore.kernel.org/r/20211116064124.8833-2-guozhengkui@vivo.com Signed-off-by: Greg Kroah-Hartman commit 944f0f697acd674ed34cac284cb2d93a714e3e9d Author: Karolina Drobnik Date: Mon Nov 15 10:55:49 2021 +0000 staging: vt6655: Delete bogus check for `init_count` in AL7230 Remove an unnecessary check in `rf_write_wake_prog_syn` in `RF_AIROHA7230` switch case. This `if` conditional will never be true as `init_count` is equal to 18 and can't be bigger than `MISCFIFO_SYNDATASIZE - 0`, which is equal to 21. Suggested-by: Mike Rapoport Reviewed-by: Dan Carpenter Signed-off-by: Karolina Drobnik Link: https://lore.kernel.org/r/e10d2278975116e03a699260f2259f9ab87501a5.1636729147.git.karolinadrobnik@gmail.com Signed-off-by: Greg Kroah-Hartman commit 8026ee384a283bde5c7e3342049abb5abc890d4c Author: Karolina Drobnik Date: Mon Nov 15 10:55:48 2021 +0000 staging: vt6655: Delete bogus check for `init_count` in AL2230 Remove an unnecessary check in `rf_write_wake_prog_syn` in `RF_AL2230S` switch case. This `if` conditional will never be true as `init_count` is equal to 17 and can't be bigger than `MISCFIFO_SYNDATASIZE - 0`, which is equal to 21. Suggested-by: Mike Rapoport Reviewed-by: Dan Carpenter Signed-off-by: Karolina Drobnik Link: https://lore.kernel.org/r/29c758ba58b10bc1da7e864b3a4f377147fc4428.1636729147.git.karolinadrobnik@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6a141baa801b911b8ec61a4b19a4807e11e299b7 Author: Karolina Drobnik Date: Mon Nov 15 10:55:47 2021 +0000 staging: vt6655: Update comment for `rf_write_wake_prog_syn` Change the function description to include the actual parameters. Update the comment on the return type. Reviewed-by: Dan Carpenter Signed-off-by: Karolina Drobnik Link: https://lore.kernel.org/r/be06c8f0df043598f3280a15397ad66aabefeaf4.1636729147.git.karolinadrobnik@gmail.com Signed-off-by: Greg Kroah-Hartman commit 1d17faf5c998c728c15f3f32f2b01e7756cc3bf8 Author: Karolina Drobnik Date: Mon Nov 15 10:55:46 2021 +0000 staging: vt6655: Rename `RFvWriteWakeProgSyn` function To align with the kernel coding style, remove the type from the function name and do not use CamelCase. Fix issue detected by checkpatch.pl: CHECK: Avoid CamelCase: Reviewed-by: Dan Carpenter Signed-off-by: Karolina Drobnik Link: https://lore.kernel.org/r/29899f738b4f381a2b3f01fd0748e9b96f835239.1636729147.git.karolinadrobnik@gmail.com Signed-off-by: Greg Kroah-Hartman commit 9064cb02ee20a028675cedd2e30af3714e331866 Author: Karolina Drobnik Date: Mon Nov 15 10:55:45 2021 +0000 staging: vt6655: Rewrite conditional in AL7320 initialization Use conditional operator to determine which table for AL7320 initialization should be used. Introduce `init_table` variable to store this value. Reviewed-by: Dan Carpenter Signed-off-by: Karolina Drobnik Link: https://lore.kernel.org/r/28169210bc26d5fcc1080ed18dc8e043bc3ef30b.1636729147.git.karolinadrobnik@gmail.com Signed-off-by: Greg Kroah-Hartman commit 460228f19bbc0a40c03f154ffdf441d969ad59d1 Author: Karolina Drobnik Date: Mon Nov 15 10:55:44 2021 +0000 staging: vt6655: Use incrementation in `idx` Increment `idx` in a loop instead of adding the loop counter `i` to do so. Delete increments of `i` that were rendered unnecessary by this change. Reviewed-by: Dan Carpenter Signed-off-by: Karolina Drobnik Link: https://lore.kernel.org/r/9affeaf40ddb31e03b21db9acd099db4d80da179.1636729147.git.karolinadrobnik@gmail.com Signed-off-by: Greg Kroah-Hartman commit cfbfa0d3c35f7a8a77d57711dc13c30f0caf771a Author: Karolina Drobnik Date: Mon Nov 15 10:55:43 2021 +0000 staging: vt6655: Introduce `idx` variable Add a local variable to store `MISCFIFO_SYNDATA_IDX` offset. This change helps in shortening the lines in `rf.c` that are deemed too long by checkpatch.pl. Reviewed-by: Dan Carpenter Signed-off-by: Karolina Drobnik Link: https://lore.kernel.org/r/596ae9bc980379860b5b1785b3ecc88e18121103.1636729147.git.karolinadrobnik@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6a143ec198a6434fc67b35299d4aad087bae4966 Author: Karolina Drobnik Date: Mon Nov 15 10:55:42 2021 +0000 staging: vt6655: Remove unnecessary type casts Remove casts to unsigned short in `RFvWriteWakeProgSyn` function as they are not needed. Reviewed-by: Dan Carpenter Signed-off-by: Karolina Drobnik Link: https://lore.kernel.org/r/c9a5718479deda078b582cbc42a4e7b2f3a6cb39.1636729147.git.karolinadrobnik@gmail.com Signed-off-by: Greg Kroah-Hartman commit d396e735ba0c91911aac5d696b5da090e38e919b Author: Tudor Ambarus Date: Fri Oct 29 20:26:19 2021 +0300 mtd: spi-nor: spansion: Use manufacturer late_init() spansion_post_sfdp_fixups() was called regardless if the flash defined SFDP tables or not. A better place for this kind of parameters init is in manufacturer's late_init() hook. post_sfdp() should be called only when SFDP is defined. No functional change in this patch. Instead of doing the 4b opcodes settings at manufacturer level, thus also for every flash that will be introduced, this should be done just where it is needed, per flash. I'll let this for other patch. Signed-off-by: Tudor Ambarus Reviewed-by: Michael Walle Reviewed-by: Pratyush Yadav Link: https://lore.kernel.org/r/20211029172633.886453-12-tudor.ambarus@microchip.com commit f22a48dbd01b66c01403b6182ad871476c19a813 Author: Tudor Ambarus Date: Fri Oct 29 20:26:18 2021 +0300 mtd: spi-nor: sst: Use manufacturer late_init() to set _write() Setting the correct nor->mtd._write in a fixup hook was misleading, since this is not a fixup, just a specific setting for SST, that differs from the SPI NOR core default init. Signed-off-by: Tudor Ambarus Reviewed-by: Michael Walle Reviewed-by: Pratyush Yadav Link: https://lore.kernel.org/r/20211029172633.886453-11-tudor.ambarus@microchip.com commit 3fdad69e7fb298020a895cf7e1fc2f9c110ca1c9 Author: Tudor Ambarus Date: Fri Oct 29 20:26:17 2021 +0300 mtd: spi-nor: xilinx: Use manufacturer late_init() to set setup method post_sfdp was misleading in this case, as SFDP is not supported by xilinx. Plus, there's no fixup here, just setting the correct setup method, as required by xilinx parts. Signed-off-by: Tudor Ambarus Reviewed-by: Michael Walle Reviewed-by: Pratyush Yadav Link: https://lore.kernel.org/r/20211029172633.886453-10-tudor.ambarus@microchip.com commit 00947a9649497273ec315ab080dd309e2b36ee8e Author: Tudor Ambarus Date: Fri Oct 29 20:26:16 2021 +0300 mtd: spi-nor: winbond: Use manufacturer late_init() for OTP ops OTP is not described in the JESD216 SFDP standard, place the OTP ops init in late_init(). We can't get rid of the default_init() hook for winbond, as the 4byte_addr_mode is SFDP specific and will require to have all flashes at hand, in order to check which has the SFDP tables defined, in which case there's nothing to do if the SFDP tables are corect, and which of the flashes do not define the SFDP tables in which case each flash should declare a late_init() fixup. Signed-off-by: Tudor Ambarus Reviewed-by: Michael Walle Reviewed-by: Pratyush Yadav Link: https://lore.kernel.org/r/20211029172633.886453-9-tudor.ambarus@microchip.com commit 7d4ff0613fb537315c7a4214de74d32b2615c72a Author: Tudor Ambarus Date: Fri Oct 29 20:26:15 2021 +0300 mtd: spi-nor: sst: Use flash late_init() for locking Locking is not described in JESD216 SFDP standard, place the locking init in late_init(). Signed-off-by: Tudor Ambarus Reviewed-by: Michael Walle Reviewed-by: Pratyush Yadav Link: https://lore.kernel.org/r/20211029172633.886453-8-tudor.ambarus@microchip.com commit b0fa1db7d2f6803783707a8215e34616922ec3e7 Author: Tudor Ambarus Date: Fri Oct 29 20:26:14 2021 +0300 mtd: spi-nor: atmel: Use flash late_init() for locking Locking is not described in JESD216 SFDP standard, place the locking init in late_init(). Signed-off-by: Tudor Ambarus Reviewed-by: Michael Walle Reviewed-by: Pratyush Yadav Link: https://lore.kernel.org/r/20211029172633.886453-7-tudor.ambarus@microchip.com commit dacc8cfee493891b130507a4646806b3d0597ee7 Author: Tudor Ambarus Date: Fri Oct 29 20:26:13 2021 +0300 mtd: spi-nor: core: Introduce the late_init() hook Flash parameters init is done in a spaghetti way right now. There is the init based on the flash_info data, then there is the default_init() hook, then SFDP init, an intermediary post_bft(), then post_sfdp() and a spi_nor_late_init_params(). Each method can overwrite previuosly initialized parameters. We want to separate what is SFDP and non-SFDP specific. late_init() will replace the default_init() hook and will be used only to initialize flash parameters that are not declared in the JESD216 SFDP standard, or where SFDP tables are not defined at all. We cut a member in the chain of initializing parameters by getting rid of the default_init() hook, and we make it clear that everything that is in late_init() is not covered by the SFDP tables defined by the flash. Signed-off-by: Tudor Ambarus Reviewed-by: Michael Walle Reviewed-by: Pratyush Yadav Link: https://lore.kernel.org/r/20211029172633.886453-6-tudor.ambarus@microchip.com commit 5854d4a6cc356ba3e16d8593ac1c089a32d1759c Author: Tudor Ambarus Date: Fri Oct 29 20:26:12 2021 +0300 mtd: spi-nor: Get rid of nor->page_size nor->page_size duplicated what nor->params->page_size indicates for no good reason. page_size is a flash parameter of fixed value and it is better suited to be found in nor->params->page_size. Signed-off-by: Tudor Ambarus Reviewed-by: Pratyush Yadav Reviewed-by: Michael Walle Link: https://lore.kernel.org/r/20211029172633.886453-5-tudor.ambarus@microchip.com commit 7158c86e560789a4a07fe161cc284f8058d52ccc Author: Tudor Ambarus Date: Fri Oct 29 20:26:10 2021 +0300 mtd: spi-nor: core: Use container_of to get the pointer to struct spi_nor "struct mtd_info mtd" is member of "struct spi_nor", there's no need to use "mtd->priv". Get the pointer to the containing struct spi_nor by using container_of. While here, make the function inline and get rid of the __maybe_unused. Signed-off-by: Tudor Ambarus Reviewed-by: Michael Walle Reviewed-by: Pratyush Yadav Link: https://lore.kernel.org/r/20211029172633.886453-3-tudor.ambarus@microchip.com commit a360ae43217c45fb7ca37603ffb6c06aad2b3929 Author: Tudor Ambarus Date: Fri Oct 29 20:26:09 2021 +0300 mtd: spi-nor: core: Fix spi_nor_flash_parameter otp description Update the description of the otp member of the struct spi_nor_flash_parameter. Signed-off-by: Tudor Ambarus Reviewed-by: Pratyush Yadav Reviewed-by: Michael Walle Link: https://lore.kernel.org/r/20211029172633.886453-2-tudor.ambarus@microchip.com commit 2b425ef8c16ce523709e1d7c0a4c8c2e02eb441e Merge: c11239f3556c0 7258aa5094dbc Author: David S. Miller Date: Wed Nov 17 11:25:45 2021 +0000 Merge branch 'ocelot_net-phylink' Russell King says: ==================== net: ocelot_net: phylink validate implementation updates This series converts ocelot_net to fill in the supported_interfaces member of phylink_config, cleans up the validate() implementation, and then converts to phylink_generic_validate(). ==================== Signed-off-by: David S. Miller commit 7258aa5094dbc89919c13f9743571657cc99ed46 Author: Russell King (Oracle) Date: Tue Nov 16 10:09:41 2021 +0000 net: ocelot_net: use phylink_generic_validate() ocelot_net has no special behaviour in its validation implementation, so can be switched to phylink_generic_validate(). Signed-off-by: Russell King (Oracle) Signed-off-by: David S. Miller commit a6f5248bc0a36ea1cbd0e04a8a744dc449022503 Author: Russell King (Oracle) Date: Tue Nov 16 10:09:36 2021 +0000 net: ocelot_net: remove interface checks in macb_validate() As phylink checks the interface mode against the supported_interfaces bitmap, we no longer need to validate the interface mode in the validation function. Remove this to simplify it. Signed-off-by: Russell King (Oracle) Signed-off-by: David S. Miller commit 8ea8c5b492d4e593c64d71c986c320faade69e17 Author: Russell King (Oracle) Date: Tue Nov 16 10:09:31 2021 +0000 net: ocelot_net: populate supported_interfaces member Populate the phy interface mode bitmap for the MSCC Ocelot driver with the interface modes supported by the MAC. Signed-off-by: Russell King (Oracle) Signed-off-by: David S. Miller commit c11239f3556c0c83d1f8f646bdc9dd1cdaf6e42b Merge: 253d091cdf998 a4238f6ce151a Author: David S. Miller Date: Wed Nov 17 11:23:39 2021 +0000 Merge branch 'mtk_eth_soc-phylink' Russell King says: ==================== net: mtk_eth_soc: phylink validate implementation updates This series converts mtk_eth_soc to fill in the supported_interfaces member of phylink_config, cleans up the validate() implementation, and then converts to phylink_generic_validate(). ==================== Signed-off-by: David S. Miller commit a4238f6ce151afa331375d74a5033b76da637644 Author: Russell King (Oracle) Date: Tue Nov 16 10:06:58 2021 +0000 net: mtk_eth_soc: use phylink_generic_validate() mtk_eth_soc has no special behaviour in its validation implementation, so can be switched to phylink_generic_validate(). Signed-off-by: Russell King (Oracle) Signed-off-by: David S. Miller commit 71d927494463c4f016d828e1134da26b7e961af5 Author: Russell King (Oracle) Date: Tue Nov 16 10:06:53 2021 +0000 net: mtk_eth_soc: drop use of phylink_helper_basex_speed() Now that we have a better method to select SFP interface modes, we no longer need to use phylink_helper_basex_speed() in a driver's validation function, and we can also get rid of our hack to indicate both 1000base-X and 2500base-X if the comphy is present to make that work. Remove this hack and use of phylink_helper_basex_speed(). Signed-off-by: Russell King (Oracle) Signed-off-by: David S. Miller commit db81ca153814475d7e07365d46a4d1134bd122e2 Author: Russell King (Oracle) Date: Tue Nov 16 10:06:48 2021 +0000 net: mtk_eth_soc: remove interface checks in mtk_validate() As phylink checks the interface mode against the supported_interfaces bitmap, we no longer need to validate the interface mode, nor handle PHY_INTERFACE_MODE_NA in the validation function. Remove these to simplify the implementation. Signed-off-by: Russell King (Oracle) Signed-off-by: David S. Miller commit 83800d29f0c578e82554e7d4c6bfdbdf9b6cf428 Author: Russell King (Oracle) Date: Tue Nov 16 10:06:43 2021 +0000 net: mtk_eth_soc: populate supported_interfaces member Populate the phy interface mode bitmap for the Mediatek driver with interfaces modes supported by the MAC. Signed-off-by: Russell King (Oracle) Signed-off-by: David S. Miller commit 253d091cdf998711b96f770d2f2bf58df986e9c3 Merge: d3a410001e670 319faa90b724c Author: David S. Miller Date: Wed Nov 17 11:21:42 2021 +0000 Merge branch 'sparx5-phylink' Russell King says: ==================== net: sparx5: phylink validate implementation updates This series converts sparx5 to fill in the supported_interfaces member of phylink_config, cleans up the validate() implementation, and then converts to phylink_generic_validate(). ==================== Signed-off-by: David S. Miller commit 319faa90b724ce68b3dccd24161c65feb4a77988 Author: Russell King (Oracle) Date: Tue Nov 16 10:02:11 2021 +0000 net: sparx5: use phylink_generic_validate() Sparx5 has no special behaviour in its validation implementation, so can be switched to phylink_generic_validate(). Signed-off-by: Russell King (Oracle) Signed-off-by: David S. Miller commit 9b5cc05fd91c1ea0f6eb4765464449a519d1eea4 Author: Russell King (Oracle) Date: Tue Nov 16 10:02:06 2021 +0000 net: sparx5: clean up sparx5_phylink_validate() sparx5_phylink_validate() no longer needs to check for PHY_INTERFACE_MODE_NA as phylink will walk the supported interface types to discover the link mode capabilities. Neither is it necessary to check the device capabilities as we will not be called for unsupported interface modes. Remove these checks. Signed-off-by: Russell King (Oracle) Signed-off-by: David S. Miller commit ae089a8191764ba39d2867293eab5e7a9627f12c Author: Russell King (Oracle) Date: Tue Nov 16 10:02:01 2021 +0000 net: sparx5: populate supported_interfaces member Populate the phy_interface_t bitmap for the Microchip Sparx5 driver with interfaces modes supported by the MAC. Signed-off-by: Russell King (Oracle) Signed-off-by: David S. Miller commit d3a410001e670540936a6bac3ea7e36c69dd7158 Merge: 02ccdd9ddc106 75021cf02ff8f Author: David S. Miller Date: Wed Nov 17 11:19:28 2021 +0000 Merge branch 'enetc-phylink' Russell King says: ==================== net: enetc: phylink validate implementation updates This series converts enetc to fill in the supported_interfaces member of phylink_config, cleans up the validate() implementation, and then converts to phylink_generic_validate(). ==================== Signed-off-by: David S. Miller commit 75021cf02ff8ff999e8d3000b3473c7f7f25a873 Author: Russell King (Oracle) Date: Tue Nov 16 09:59:08 2021 +0000 net: enetc: use phylink_generic_validate() enetc has no special behaviour in its validation implementation, so can be switched to phylink_generic_validate(). Signed-off-by: Russell King (Oracle) Signed-off-by: David S. Miller commit 5a94c1ba8e33564c50ca9ce71add12a949fca82c Author: Russell King (Oracle) Date: Tue Nov 16 09:59:03 2021 +0000 net: enetc: remove interface checks in enetc_pl_mac_validate() As phylink checks the interface mode against the supported_interfaces bitmap, we no longer need to validate the interface mode in the validation function. Remove this to simplify it. Signed-off-by: Russell King (Oracle) Signed-off-by: David S. Miller commit 4e5015df5211918242fd009014ddee10610b959d Author: Russell King (Oracle) Date: Tue Nov 16 09:58:58 2021 +0000 net: enetc: populate supported_interfaces member Populate the phy_interface_t bitmap for the Freescale enetc driver with interfaces modes supported by the MAC. Signed-off-by: Russell King (Oracle) Signed-off-by: David S. Miller commit 02ccdd9ddc106ad8054c40340bbd66ad2c61530b Merge: 01dd74246c75e 72a47e1aaf2e0 Author: David S. Miller Date: Wed Nov 17 11:17:44 2021 +0000 Merge branch 'xilinx-phylink' Russell King says: ==================== net: xilinx: phylink validate implementation updates This series converts axienet to fill in the supported_interfaces member of phylink_config, cleans up the validate() implementation, and then converts to phylink_generic_validate(). ==================== Signed-off-by: David S. Miller commit 72a47e1aaf2e05e7b2be7feadc06396c87463ccb Author: Russell King (Oracle) Date: Tue Nov 16 09:55:32 2021 +0000 net: axienet: use phylink_generic_validate() axienet has no special behaviour in its validation implementation, so can be switched to phylink_generic_validate(). Signed-off-by: Russell King (Oracle) Signed-off-by: David S. Miller commit 5703a4b664569e37d283dae067d97ea01fa80311 Author: Russell King (Oracle) Date: Tue Nov 16 09:55:27 2021 +0000 net: axienet: remove interface checks in axienet_validate() As phylink checks the interface mode against the supported_interfaces bitmap, we no longer need to validate the interface mode in the validation function. Remove this to simplify it. Signed-off-by: Russell King (Oracle) Signed-off-by: David S. Miller commit 136a3fa28a9f562e2d693e78b902bf8e5cfa1658 Author: Russell King (Oracle) Date: Tue Nov 16 09:55:22 2021 +0000 net: axienet: populate supported_interfaces member Populate the phy_interface_t bitmap for the Xilinx axienet driver with interfaces modes supported by the MAC. Signed-off-by: Russell King (Oracle) Signed-off-by: David S. Miller commit 01dd74246c75ed0992a5f4ed83e8527a7197f720 Merge: b9241f54138ca 85c5f7c9200e5 Author: David S. Miller Date: Wed Nov 17 11:03:43 2021 +0000 Merge tag 'mlx5-updates-2021-11-16' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux Saeed Mahameed says: ==================== mlx5-updates-2021-11-16 Updates for mlx5 driver: 1) Support ethtool cq mode 2) Static allocation of mod header object for the common case 3) TC support for when local and remote VTEPs are in the same 4) Create E-Switch QoS objects on demand to save on resources 5) Minor code improvements ==================== Signed-off-by: David S. Miller commit 3b941c5a19680ea9d42527152b56685acd681b09 Author: Mauro Carvalho Chehab Date: Wed Nov 17 08:38:30 2021 +0000 media: atomisp: sh_css_param_shading: fix comments coding style The comments are not following Kernel coding style. Also, there are two missing comments that are found at the Intel Aero device driver code. Add them. No functional changes. Signed-off-by: Mauro Carvalho Chehab commit b8d65b8a5aea3309c14cb899149ad5ce93589f58 Author: Jani Nikula Date: Thu Nov 11 12:13:04 2021 +0200 drm/i915/driver: add i915_driver_ prefix to functions Add the i915_driver_ prefix to the switcheroo functions in i915_driver.[ch]. Signed-off-by: Jani Nikula Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20211111101304.13094-3-jani.nikula@intel.com commit 4588d7eb3b530b471104d78a19f82df701ec8c25 Author: Jani Nikula Date: Thu Nov 11 12:13:03 2021 +0200 drm/i915/driver: rename driver to i915_drm_driver As a name, "driver" is too generic and short to be easily located in a file this size. Rename it to i915_drm_driver. Signed-off-by: Jani Nikula Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20211111101304.13094-2-jani.nikula@intel.com commit 50f1d9343b915a7c3480c0aff9f6a01aea034987 Author: Mauro Carvalho Chehab Date: Wed Nov 17 08:28:51 2021 +0000 media: atomisp: get rid of sctbl_legacy_* Those seem to be used only on certain ISP2401 firmwares that aren't supported by the driver. So, get rid of them. Signed-off-by: Mauro Carvalho Chehab commit 58471f6384fd8f807d3ff2e771c34f71c473f6b0 Author: Jani Nikula Date: Thu Nov 11 12:13:02 2021 +0200 drm/i915/driver: rename i915_drv.c to i915_driver.c This is more about trimming i915_drv.h than the renamed i915_driver.[ch]. Split out i915_driver.[ch] out of i915_drv.h as a feasible thing to do. Signed-off-by: Jani Nikula Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20211111101304.13094-1-jani.nikula@intel.com commit c0a7df148e9d641c622c5ef807da449c99b7fabf Author: Mauro Carvalho Chehab Date: Wed Nov 17 08:02:39 2021 +0000 media: atomisp: get rid of #ifdef HAS_BL This does nothing but declare extern to a non-existing var. Signed-off-by: Mauro Carvalho Chehab commit d7ab37bcddc7d7e13681dbb9841b455b0c0bdfe4 Author: Mauro Carvalho Chehab Date: Wed Nov 17 07:24:40 2021 +0000 media: atomisp: get rid of USE_WINDOWS_BINNING_FACTOR tests This is meant to select a platform-dependent factor between Linux and Windows. It makes no sense to keep it on Kernel. Signed-off-by: Mauro Carvalho Chehab commit 63705da3dfc8922a2dbfc3c805a5faadb4416954 Author: Mauro Carvalho Chehab Date: Wed Nov 17 07:19:06 2021 +0000 media: atomisp: remove #ifdef HAS_NO_HMEM This is not defined anywhere, so, solve the ifdefs, getting rid of them. Signed-off-by: Mauro Carvalho Chehab commit 35009261b9e9d02190afad4c8485cf6d2a8b80aa Author: Mauro Carvalho Chehab Date: Wed Nov 17 06:44:29 2021 +0000 media: atomisp: sh_css_params: cleanup the code Now that the tests for the new ISP2401 input system were dropped, simplify the code, making it closer to the Intel Aero device driver. Signed-off-by: Mauro Carvalho Chehab commit 037de9f2b2c1a1c250f166134b9aec47c1298f83 Author: Mauro Carvalho Chehab Date: Wed Nov 17 06:40:52 2021 +0000 media: atomisp: sh_css_params: remove tests for ISP2401 Those tests are related to the input system, which is the same for the chosen firmware, so both ISP2400 and ISP2401 will be identical with that regards. Signed-off-by: Mauro Carvalho Chehab commit b541d4c9923154be7ae0518d01ce994acbef3f9b Author: Mauro Carvalho Chehab Date: Tue Nov 16 14:45:55 2021 +0000 media: atomisp: sh_css_mipi: cleanup the code With the ISP2401 firmware we're using, the code differences are not that much from ISP2400. Cleanup the code in order to make it closer to Intel Aero driver. Signed-off-by: Mauro Carvalho Chehab commit ef3f3627ff1b2cdb0960a95b8a93299cd36fd86c Author: Mauro Carvalho Chehab Date: Tue Nov 16 13:31:59 2021 +0000 media: atomisp: sh_css_metrics: drop some unused code There are two #ifdefs there which aren't defined anywhere. So, just drop the dead code. Signed-off-by: Mauro Carvalho Chehab commit 839467839ca0a664da0d1e16d402b61c7cea1bbc Author: Mauro Carvalho Chehab Date: Tue Nov 16 12:39:37 2021 +0000 media: atomisp: simplify sh_css_defs.h There are several unused macros. Simplify the logic there, making it closer to the Intel Aero driver and the corresponding firmware, as this is what we have widely available for this device. Signed-off-by: Mauro Carvalho Chehab commit da8fdf490b954f04af6c254f51c29e4e305fc1b9 Author: Mauro Carvalho Chehab Date: Tue Nov 16 13:29:44 2021 +0000 media: atomisp: drop empty files There's nothing inside such files. Just drop them. Signed-off-by: Mauro Carvalho Chehab commit 64bc3aa02ae78b1fcb1b850e0eb1f0622002bfaa Author: Karthikeyan Kathirvel Date: Mon Nov 15 11:04:41 2021 +0100 ath11k: reset RSN/WPA present state for open BSS The ath11k driver is caching the information about RSN/WPA IE in the configured beacon template. The cached information is used during associations to figure out whether 4-way PKT/2-way GTK peer flags need to be set or not. But the code never cleared the state when no such IE was found. This can for example happen when moving from an WPA/RSN to an open setup. The (seemingly connected) peer was then not able to communicate over the link because the firmware assumed a different (encryption enabled) state for the peer. Tested-on: IPQ6018 hw1.0 AHB WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1 Fixes: 01e34233c645 ("ath11k: fix wmi peer flags in peer assoc command") Cc: Venkateswara Naralasetty Reported-by: Sven Eckelmann Signed-off-by: Karthikeyan Kathirvel [sven@narfation.org: split into separate patches, clean up commit message] Signed-off-by: Sven Eckelmann Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211115100441.33771-2-sven@narfation.org commit 436a4e88659842a7cf634d7cc088c8f2cc94ebf5 Author: Karthikeyan Kathirvel Date: Mon Nov 15 11:04:40 2021 +0100 ath11k: clear the keys properly via DISABLE_KEY DISABLE_KEY sets the key_len to 0, firmware will not delete the keys if key_len is 0. Changing from security mode to open mode will cause mcast to be still encrypted without vdev restart. Set the proper key_len for DISABLE_KEY cmd to clear the keys in firmware. Tested-on: IPQ6018 hw1.0 AHB WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1 Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices") Reported-by: Sven Eckelmann Signed-off-by: Karthikeyan Kathirvel [sven@narfation.org: split into separate patches, clean up commit message] Signed-off-by: Sven Eckelmann Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211115100441.33771-1-sven@narfation.org commit 886433a984254c6d2c2074688dc8f48c40b1c070 Author: John Crispin Date: Mon Oct 25 21:40:54 2021 +0530 ath11k: add support for BSS color change Whenever the MAC detects a color collision, or any of its associated stations detects one, the firmware will send out an event. Add the code to parse and handle this event and pass the data up to mac80211. The firmware does not provide an offload feature such as the one used for CSA. The color change process is hence triggered via the beacon offload tx completion events sent out by firmware. BSS color feature is enabled depending on service flag advertised by firmware, based on which color change functionality is invoked. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-00680-QCAHKSWPL_SILICONZ-1 Signed-off-by: John Crispin Co-developed-by: Lavanya Suresh Signed-off-by: Lavanya Suresh Signed-off-by: Rameshkumar Sundaram Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1635178254-17732-1-git-send-email-quic_ramess@quicinc.com commit fc95d10ac41d75c14a81afcc8722333d8b2cf80f Author: Wen Gong Date: Mon Nov 15 11:29:55 2021 +0200 ath11k: add string type to search board data in board-2.bin for WCN6855 Currently ath11k only support string type with bus, chip id and board id such as "bus=ahb,qmi-chip-id=1,qmi-board-id=4" for ahb bus chip and "bus=pci,qmi-chip-id=0,qmi-board-id=255" for PCIe bus chip in board-2.bin. For WCN6855, it is not enough to distinguish all different chips. This is to add a new string type which include bus, chip id, board id, vendor, device, subsystem-vendor and subsystem-device for WCN6855. ath11k will first load board-2.bin and search in it for the board data with the above parameters, if matched one board data, then download it to firmware, if not matched any one, then ath11k will download the file board.bin to firmware. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Signed-off-by: Wen Gong Signed-off-by: Jouni Malinen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211111065340.20187-1-quic_wgong@quicinc.com commit 273703ebdb01b6c5f1aaf4b98fb57b177609055c Author: Baochen Qiang Date: Tue Oct 26 09:16:05 2021 +0800 ath11k: Fix crash caused by uninitialized TX ring Commit 31582373a4a8 ("ath11k: Change number of TCL rings to one for QCA6390") avoids initializing the other entries of dp->tx_ring cause the corresponding TX rings on QCA6390/WCN6855 are not used, but leaves those ring masks in ath11k_hw_ring_mask_qca6390.tx unchanged. Normally this is OK because we will only get interrupts from the first TX ring on these chips and thus only the first entry of dp->tx_ring is involved. In case of one MSI vector, all DP rings share the same IRQ. For each interrupt, all rings have to be checked, which means the other entries of dp->tx_ring are involved. However since they are not initialized, system crashes. Fix this issue by simply removing those ring masks. crash stack: [ 102.907438] BUG: kernel NULL pointer dereference, address: 0000000000000028 [ 102.907447] #PF: supervisor read access in kernel mode [ 102.907451] #PF: error_code(0x0000) - not-present page [ 102.907453] PGD 1081f0067 P4D 1081f0067 PUD 1081f1067 PMD 0 [ 102.907460] Oops: 0000 [#1] SMP DEBUG_PAGEALLOC NOPTI [ 102.907465] CPU: 0 PID: 3511 Comm: apt-check Kdump: loaded Tainted: G E 5.15.0-rc4-wt-ath+ #20 [ 102.907470] Hardware name: AMD Celadon-RN/Celadon-RN, BIOS RCD1005E 10/08/2020 [ 102.907472] RIP: 0010:ath11k_dp_tx_completion_handler+0x201/0x830 [ath11k] [ 102.907497] Code: 3c 24 4e 8d ac 37 10 04 00 00 4a 8d bc 37 68 04 00 00 48 89 3c 24 48 63 c8 89 83 84 18 00 00 48 c1 e1 05 48 03 8b 78 18 00 00 <8b> 51 08 89 d6 83 e6 07 89 74 24 24 83 fe 03 74 04 85 f6 75 63 41 [ 102.907501] RSP: 0000:ffff9b7340003e08 EFLAGS: 00010202 [ 102.907505] RAX: 0000000000000001 RBX: ffff8e21530c0100 RCX: 0000000000000020 [ 102.907508] RDX: 0000000000000000 RSI: 00000000fffffe00 RDI: ffff8e21530c1938 [ 102.907511] RBP: ffff8e21530c0000 R08: 0000000000000001 R09: 0000000000000000 [ 102.907513] R10: ffff8e2145534c10 R11: 0000000000000001 R12: ffff8e21530c2938 [ 102.907515] R13: ffff8e21530c18e0 R14: 0000000000000100 R15: ffff8e21530c2978 [ 102.907518] FS: 00007f5d4297e740(0000) GS:ffff8e243d600000(0000) knlGS:0000000000000000 [ 102.907521] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 102.907524] CR2: 0000000000000028 CR3: 00000001034ea000 CR4: 0000000000350ef0 [ 102.907527] Call Trace: [ 102.907531] [ 102.907537] ath11k_dp_service_srng+0x5c/0x2f0 [ath11k] [ 102.907556] ath11k_pci_ext_grp_napi_poll+0x21/0x70 [ath11k_pci] [ 102.907562] __napi_poll+0x2c/0x160 [ 102.907570] net_rx_action+0x251/0x310 [ 102.907576] __do_softirq+0x107/0x2fc [ 102.907585] irq_exit_rcu+0x74/0x90 [ 102.907593] common_interrupt+0x83/0xa0 [ 102.907600] [ 102.907601] asm_common_interrupt+0x1e/0x40 Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Signed-off-by: Baochen Qiang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211026011605.58615-1-quic_bqiang@quicinc.com commit fb12305aff12e735e599c79514dde5dac40f5a59 Author: Venkateswara Naralasetty Date: Tue Nov 9 12:05:55 2021 +0530 ath11k: add trace log support This change is to add trace log support for, * WMI events * WMI commands * ath11k_dbg messages * ath11k_dbg_dump messages * ath11k_log_info messages * ath11k_log_warn messages * ath11k_log_err messages Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-00652-QCAHKSWPL_SILICONZ-1 Signed-off-by: Venkateswara Naralasetty Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1636439755-30419-1-git-send-email-quic_vnaralas@quicinc.com commit 1ad6e4b00f29d017b196dda7ab96d1cfcbabd7d2 Author: Anilkumar Kolli Date: Tue Nov 2 18:22:38 2021 +0530 ath11k: Add missing qmi_txn_cancel() Currently many functions do not follow this guidance when qmi_send_request() fails, therefore add missing qmi_txn_cancel() in the qmi_send_request() error path. Also remove initialization on 'struct qmi_txn' since qmi_tx_init() performs all necessary initialization. Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.4.0.1-01838-QCAHKSWPL_SILICONZ-1 Signed-off-by: Anilkumar Kolli Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1635857558-21733-1-git-send-email-akolli@codeaurora.org commit bd77f6b1d7104cf6451399a7c67d08afecb9a7c7 Author: Rameshkumar Sundaram Date: Tue Nov 2 11:11:33 2021 +0530 ath11k: use cache line aligned buffers for dbring The DMA buffers of dbring which is used for spectral/cfr starts at certain offset from original kmalloc() returned buffer. This is not cache line aligned. And also driver tries to access the data that is immediately before this offset address (i.e. buff->paddr) after doing dma map. This will cause cache line sharing issues and data corruption, if CPU happen to write back cache after HW has dma'ed the data. Fix this by mapping a cache line aligned buffer to dma. Tested on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1 Signed-off-by: Rameshkumar Sundaram Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1635831693-15962-1-git-send-email-quic_ramess@quicinc.com commit f951380a6022440335f668f85296096ba13071ba Author: P Praneesh Date: Mon Nov 15 11:50:52 2021 +0200 ath11k: Disabling credit flow for WMI path Firmware credit flow control is enabled for WMI control services, which expects available tokens should be acquired before sending a command to the target. Also the token gets released when firmware receives the command. This credit-based flow limits driver to send WMI command only when the token available which is causing WMI commands to timeout and return -EAGAIN, whereas firmware has enough capability to process the WMI command. To fix this Tx starvation issue, introduce the ability to disable the credit flow for the WMI path. The driver sends WMI configuration for disabling credit flow to firmware by two ways. 1. By using a global flag (HTC_MSG_SETUP_COMPLETE_EX_ID msg type flags) 2. By using a local flag (ATH11K_HTC_CONN_FLAGS_DISABLE_CREDIT_FLOW_CTRL = 1 << 3) Ath11k uses both these configurations to disable credit flow for the WMI path completely. Also added a hw_param member for credit flow control by which we can enable or disable it based on per-target basis. Currently we are disabling credit flow for IPQ8074, IPQ6018, and QCN9074 as recommended by firmware. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-01492-QCAHKSWPL_SILICONZ-1 Tested-on: IPQ6018 hw1.0 AHB WLAN.HK.2.4.0.1-00330-QCAHKSWPL_SILICONZ-1 Co-developed-by: Pravas Kumar Panda Signed-off-by: Pravas Kumar Panda Signed-off-by: P Praneesh Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1635156494-20059-1-git-send-email-quic_ppranees@quicinc.com commit 086c921a354089f209318501038d43c98d3f409f Author: Sven Eckelmann Date: Mon Nov 15 11:29:55 2021 +0200 ath11k: Fix ETSI regd with weather radar overlap Some ETSI countries have a small overlap in the wireless-regdb with an ETSI channel (5590-5650). A good example is Australia: country AU: DFS-ETSI (2400 - 2483.5 @ 40), (36) (5150 - 5250 @ 80), (23), NO-OUTDOOR, AUTO-BW (5250 - 5350 @ 80), (20), NO-OUTDOOR, AUTO-BW, DFS (5470 - 5600 @ 80), (27), DFS (5650 - 5730 @ 80), (27), DFS (5730 - 5850 @ 80), (36) (57000 - 66000 @ 2160), (43), NO-OUTDOOR If the firmware (or the BDF) is shipped with these rules then there is only a 10 MHz overlap with the weather radar: * below: 5470 - 5590 * weather radar: 5590 - 5600 * above: (none for the rule "5470 - 5600 @ 80") There are several wrong assumption in the ath11k code: * there is always a valid range below the weather radar (actually: there could be no range below the weather radar range OR range could be smaller than 20 MHz) * intersected range in the weather radar range is valid (actually: the range could be smaller than 20 MHz) * range above weather radar is either empty or valid (actually: the range could be smaller than 20 MHz) These wrong assumption will lead in this example to a rule (5590 - 5600 @ 20), (N/A, 27), (600000 ms), DFS, AUTO-BW which is invalid according to is_valid_reg_rule() because the freq_diff is only 10 MHz but the max_bandwidth is set to 20 MHz. Which results in a rejection like: WARNING: at backports-20210222_001-4.4.60-b157d2276/net/wireless/reg.c:3984 [...] Call trace: [] reg_get_max_bandwidth+0x300/0x3a8 [cfg80211] [] regulatory_set_wiphy_regd_sync+0x3c/0x98 [cfg80211] [] ath11k_regd_update+0x1a8/0x210 [ath11k] [] ath11k_regd_update_work+0x18/0x20 [ath11k] [] process_one_work+0x1f8/0x340 [] worker_thread+0x25c/0x448 [] kthread+0xd0/0xd8 [] ret_from_fork+0x10/0x40 ath11k c000000.wifi: failed to perform regd update : -22 Invalid regulatory domain detected To avoid this, the algorithm has to be changed slightly. Instead of splitting a rule which overlaps with the weather radar range into 3 pieces and accepting the first two parts blindly, it must actually be checked for each piece whether it is a valid range. And only if it is valid, add it to the output array. When these checks are in place, the processed rules for AU would end up as country AU: DFS-ETSI (2400 - 2483 @ 40), (N/A, 36), (N/A) (5150 - 5250 @ 80), (6, 23), (N/A), NO-OUTDOOR, AUTO-BW (5250 - 5350 @ 80), (6, 20), (0 ms), NO-OUTDOOR, DFS, AUTO-BW (5470 - 5590 @ 80), (6, 27), (0 ms), DFS, AUTO-BW (5650 - 5730 @ 80), (6, 27), (0 ms), DFS, AUTO-BW (5730 - 5850 @ 80), (6, 36), (N/A), AUTO-BW and will be accepted by the wireless regulatory code. Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices") Signed-off-by: Sven Eckelmann Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211112153116.1214421-1-sven@narfation.org commit db813d7bd919c521b869d657dc4a2a2335974cc4 Author: Yucong Sun Date: Fri Nov 12 11:25:34 2021 -0800 selftests/bpf: Mark variable as static Fix warnings from checkstyle.pl Signed-off-by: Yucong Sun Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211112192535.898352-4-fallentree@fb.com commit 67d61d30b8a8f33d2a4f269f3a548409827d7b01 Author: Yucong Sun Date: Fri Nov 12 11:25:33 2021 -0800 selftests/bpf: Variable naming fix Change log_fd to log_fp to reflect its type correctly. Signed-off-by: Yucong Sun Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211112192535.898352-3-fallentree@fb.com commit ea78548e0f98951fa7641037ad98a750137d6b6a Author: Yucong Sun Date: Fri Nov 12 11:25:32 2021 -0800 selftests/bpf: Move summary line after the error logs Makes it easier to find the summary line when there is a lot of logs to scroll back. Signed-off-by: Yucong Sun Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211112192535.898352-2-fallentree@fb.com commit 85c5f7c9200e5ce89f0c188d0c24ab4e731b6a51 Author: Dmytro Linkin Date: Tue Sep 21 19:08:38 2021 +0300 net/mlx5: E-switch, Create QoS on demand Don't create eswitch QoS (root TSAR) on switch mode change. Create it on first child TSAR object creation - vport or rate group. Keep track root TSAR references and release root TSAR with last object deletion. No need to check for QoS is enabled when installing tc matchall filter. Remove related helper function due to no users of it. Signed-off-by: Dmytro Linkin Reviewed-by: Parav Pandit Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit d7df09f5e7b46af0eb927c065113faa57411d100 Author: Dmytro Linkin Date: Tue Sep 21 18:45:42 2021 +0300 net/mlx5: E-switch, Enable vport QoS on demand Vports' QoS is not commonly used but consume SW/HW resources, which becomes an issue on BlueField SoC systems. Don't enable QoS on vports by default on eswitch mode change and enable when it's going to be used by one of the top level users: - configuring TC matchall filter with police action; - setting rate with legacy NDO API; - calling devlink ops->rate_leaf_*() callbacks. Disable vport QoS on vport cleanup. Signed-off-by: Dmytro Linkin Reviewed-by: Parav Pandit Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit e9d491a64755d11812b532fcf10b93b2f9535e45 Author: Parav Pandit Date: Thu Oct 21 18:21:30 2021 +0300 net/mlx5: E-switch, move offloads mode callbacks to offloads file eswitch.c is mainly for common code between legacy and offloads mode. MAC address get and set via devlink is applicable only in offloads mode. Hence, move it to eswitch_offloads.c file. Signed-off-by: Parav Pandit Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit b22fd4381d15ae66e42a7fab6eedfbb72d714ebb Author: Parav Pandit Date: Thu Oct 21 18:17:52 2021 +0300 net/mlx5: E-switch, Reuse mlx5_eswitch_set_vport_mac mlx5_eswitch_set_vport_mac() routine already does necessary checks which are duplicated in implementation of mlx5_devlink_port_function_hw_addr_set(). Hence, reuse mlx5_eswitch_set_vport_mac() and cut down the code. Signed-off-by: Parav Pandit Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit fcf8ec54b0477293ecf5a4a01bfe88d5dea6c8c0 Author: Parav Pandit Date: Wed Oct 20 07:56:01 2021 +0300 net/mlx5: E-switch, Remove vport enabled check An eswitch vport of the devlink port is always enabled before a devlink port is registered. And a eswitch vport is always disabled after a devlink port is unregistered. Hence avoid the vport enabled check in the devlink callback routine. Such check is only applicable in the legacy SR-IOV callbacks. Signed-off-by: Parav Pandit Reviewed-by: Sunil Sudhakar Rani Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed commit 819c319c8c919307fa764ff02a228c06e727501c Author: Chris Mi Date: Tue Oct 26 17:08:24 2021 +0800 net/mlx5e: Specify out ifindex when looking up decap route There is a use case that the local and remote VTEPs are in the same host. Currently, the out ifindex is not specified when looking up the decap route for offloads. So in this case, a local route is returned and the route dev is lo. Actual tunnel interface can be created with a parameter "dev" [1], which specifies the physical device to use for tunnel endpoint communication. Pass this parameter to driver when looking up decap route for offloads. So that a unicast route will be returned. [1] ip link add name vxlan1 type vxlan id 100 dev enp4s0f0 remote 1.1.1.1 dstport 4789 Signed-off-by: Chris Mi Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit fc3a879aea35fba713ae2d0fd42f2f2e7eaac1d9 Author: Roi Dayan Date: Wed Nov 10 16:19:41 2021 +0200 net/mlx5e: TC, Move comment about mod header flag to correct place Move the comment to the correct place where the driver actually removes the flag and not in the check that maybe pedit actions exists. Signed-off-by: Roi Dayan Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed commit 88d974860412f2ca337086aa25e12b1094d55c6c Author: Roi Dayan Date: Mon Nov 1 18:13:02 2021 +0200 net/mlx5e: TC, Move kfree() calls after destroying all resources When deleting fdb/nic flow rules first release all resources and then call the kfree() calls instead of sparse them around the function. Signed-off-by: Roi Dayan Reviewed-by: Vlad Buslov Signed-off-by: Saeed Mahameed commit 972fe492e847c7ed9679a4b4aa79f9fe06b9ae7b Author: Roi Dayan Date: Mon Nov 1 18:02:00 2021 +0200 net/mlx5e: TC, Destroy nic flow counter if exists Counter is only added if counter flag exists. So check the counter fag exists for deleting the counter. This is the same as in add/del fdb flow. Signed-off-by: Roi Dayan Reviewed-by: Vlad Buslov Signed-off-by: Saeed Mahameed commit 0164a9bd9d63c56925cf0aae2731730778fae3f6 Author: Yihao Han Date: Tue Nov 2 23:21:09 2021 -0700 net/mlx5: TC, using swap() instead of tmp variable swap() was used instead of the tmp variable to swap values Signed-off-by: Yihao Han Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit 1cfd3490f2780edb3f1b2f3f64c5c80c67c64075 Author: Paul Blakey Date: Wed Aug 25 16:46:41 2021 +0300 net/mlx5: CT: Allow static allocation of mod headers As each CT rule uses at least 4 modify header actions, each rule causes at least 3 reallocations by the mod header actions api. Allow initial static allocation of the mod acts array, and use it for CT rules. If the static allocation is exceeded go back to dynamic allocation. Signed-off-by: Saeed Mahameed Signed-off-by: Paul Blakey Reviewed-by: Oz Shlomo Reviewed-by: Roi Dayan commit 2c0e5cf5206ecd5da3c6bc5799671c2172713d71 Author: Paul Blakey Date: Mon Jul 5 11:31:47 2021 +0300 net/mlx5e: Refactor mod header management API For all mod hdr related functions to reside in a single self contained component (mod_hdr.c), refactor alloc() and add get_id() so that user won't rely on internal implementation, and move both to mod_hdr component. Rename the prefix to mlx5e_mod_hdr_* as other mod hdr functions. Signed-off-by: Paul Blakey Reviewed-by: Oz Shlomo Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed commit f28a14c1dcb0dbdae719a05b71ed30ce31221e75 Author: Aya Levin Date: Tue Nov 9 15:44:58 2021 +0200 net/mlx5: Avoid printing health buffer when firmware is unavailable Use firmware version field as an indication to health buffer's sanity. When firmware version is 0xFFFFFFFF, deduce that firmware is unavailable and avoid printing the health buffer to dmesg as it doesn't provide debug info. Signed-off-by: Aya Levin Reviewed-by: Gal Pressman Signed-off-by: Saeed Mahameed commit aef0f8c67d752ed68cc18582711ac6accf0ad9b6 Author: Saeed Mahameed Date: Wed Nov 3 14:01:05 2021 -0700 net/mlx5: Fix format-security build warnings Treat the string as an argument to avoid this. drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c:482:5: error: format string is not a string literal (potentially insecure) name); ^~~~ drivers/net/ethernet/mellanox/mlx5/core/en_stats.c:2079:4: error: format string is not a string literal (potentially insecure) ptp_ch_stats_desc[i].format); ^~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Saeed Mahameed Reviewed-by: Shay Drory Reviewed-by: Moshe Shemesh commit bc541621f8ba18cc8aeed4c48b63aec181d6c20f Author: Saeed Mahameed Date: Tue Sep 14 23:26:17 2021 -0700 net/mlx5e: Support ethtool cq mode Add support for ethtool coalesce cq mode set and get. Signed-off-by: Saeed Mahameed Reviewed-by: Tariq Toukan commit b9241f54138ca5af4d3c5ca6db56be83d7491508 Author: Russell King (Oracle) Date: Mon Nov 15 17:11:17 2021 +0000 net: document SMII and correct phylink's new validation mechanism SMII has not been documented in the kernel, but information on this PHY interface mode has been recently found. Document it, and correct the recently introduced phylink handling for this interface mode. Signed-off-by: Russell King (Oracle) Reviewed-by: Andrew Lunn Link: https://lore.kernel.org/r/E1mmfVl-0075nP-14@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski commit be0f6c4100acc38129c9578ddc11b6a9dd7fb4ef Merge: 4b5f82f6aaef3 364ef1f378578 Author: Jakub Kicinski Date: Tue Nov 16 19:10:34 2021 -0800 Merge branch 'r8169-disable-detection-of-further-chip-versions-that-didn-t-make-it-to-the-mass-market' Heiner Kallweit says: ==================== r8169: disable detection of further chip versions that didn't make it to the mass market There's no sign of life from further chip versions. Seems they didn't make it to the mass market. Let's disable detection and if nobody complains remove support a few kernel versions later. ==================== Link: https://lore.kernel.org/r/7708d13a-4a2b-090d-fadf-ecdd0fff5d2e@gmail.com Signed-off-by: Jakub Kicinski commit 364ef1f3785785404473e02c6a020dae9d44fc4c Author: Heiner Kallweit Date: Mon Nov 15 21:52:35 2021 +0100 r8169: disable detection of chip version 41 It seems this chip version never made it to the wild. Therefore disable detection and if nobody complains remove support completely later. Signed-off-by: Heiner Kallweit Signed-off-by: Jakub Kicinski commit 6c8a5cf97c3f9d4c1a322c095ca60acf691d0226 Author: Heiner Kallweit Date: Mon Nov 15 21:51:52 2021 +0100 r8169: disable detection of chip version 45 It seems this chip version never made it to the wild. Therefore disable detection and if nobody complains remove support completely later. Signed-off-by: Heiner Kallweit Signed-off-by: Jakub Kicinski commit 2d6600c754f8e4e52c392c3b5aecc554145e2524 Author: Heiner Kallweit Date: Mon Nov 15 21:51:14 2021 +0100 r8169: disable detection of chip versions 49 and 50 It seems these chip versions never made it to the wild. Therefore disable detection and if nobody complains remove support completely later. Signed-off-by: Heiner Kallweit Signed-off-by: Jakub Kicinski commit 4b5f82f6aaef3fa95cce52deb8510f55ddda6a71 Author: Heiner Kallweit Date: Mon Nov 15 21:17:56 2021 +0100 r8169: enable ASPM L1/L1.1 from RTL8168h With newer chip versions ASPM-related issues seem to occur only if L1.2 is enabled. I have a test system with RTL8168h that gives a number of rx_missed errors when running iperf and L1.2 is enabled. With L1.2 disabled (and L1 + L1.1 active) everything is fine. See also [0]. Can't test this, but L1 + L1.1 being active should be sufficient to reach higher package power saving states. [0] https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1942830 Signed-off-by: Heiner Kallweit Link: https://lore.kernel.org/r/36feb8c4-a0b6-422a-899c-e61f2e869dfe@gmail.com Signed-off-by: Jakub Kicinski commit c60c34a9104eddc0ef055436db8b19481931892c Merge: 62803fec52f80 49ecc2e9c3abd Author: Jakub Kicinski Date: Tue Nov 16 19:07:57 2021 -0800 Merge branch 'net-better-packing-of-global-vars' Eric Dumazet says: ==================== net: better packing of global vars First two patches avoid holes in data section, and last patch makes sure some siphash keys are contained in a single cache line. ==================== Link: https://lore.kernel.org/r/20211115172303.3732746-1-eric.dumazet@gmail.com Signed-off-by: Jakub Kicinski commit 49ecc2e9c3abd269951972fa8b23a4d081111b80 Author: Eric Dumazet Date: Mon Nov 15 09:23:03 2021 -0800 net: align static siphash keys siphash keys use 16 bytes. Define siphash_aligned_key_t macro so that we can make sure they are not crossing a cache line boundary. Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit 7071732c26fe2cf141185ed16a8a85d02495ae8c Author: Eric Dumazet Date: Mon Nov 15 09:23:02 2021 -0800 net: use .data.once section in netdev_level_once() Same rationale than prior patch : using the dedicated section avoid holes and pack all these bool values. Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit c2c60ea37e5b6be58c9dd7aff0b2e86ba0f18e0b Author: Eric Dumazet Date: Mon Nov 15 09:23:01 2021 -0800 once: use __section(".data.once") .data.once contains nicely packed bool variables. It is used already by DO_ONCE_LITE(). Using it also in DO_ONCE() removes holes in .data section. Signed-off-by: Eric Dumazet Signed-off-by: Jakub Kicinski commit fc12b70d12d07598cde27cc17dbfafc2a2a33ff8 Author: Dan Carpenter Date: Tue Nov 16 14:49:16 2021 +0300 drm/i915/guc: fix NULL vs IS_ERR() checking The intel_engine_create_virtual() function does not return NULL. It returns error pointers. Fixes: e5e32171a2cf ("drm/i915/guc: Connect UAPI to GuC multi-lrc interface") Signed-off-by: Dan Carpenter Reviewed-by: Rodrigo Vivi Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20211116114916.GB11936@kili commit e5b5d25444e9ee3ae439720e62769517d331fa39 Author: Adam Borowski Date: Mon Nov 15 18:32:08 2021 +0100 ACPI: thermal: drop an always true check Address of a field inside a struct can't possibly be null; gcc-12 warns about this. Signed-off-by: Adam Borowski Signed-off-by: Rafael J. Wysocki commit a917dfb66c0a1fa1caacf3d71edcafcab48e6ff0 Author: Christophe JAILLET Date: Fri Nov 12 09:59:04 2021 +0100 RDMA/bnxt_re: Scan the whole bitmap when checking if "disabling RCFW with pending cmd-bit" The 'cmdq->cmdq_bitmap' bitmap is 'rcfw->cmdq_depth' bits long. The size stored in 'cmdq->bmap_size' is the size of the bitmap in bytes. Remove this erroneous 'bmap_size' and use 'rcfw->cmdq_depth' directly in 'bnxt_qplib_disable_rcfw_channel()'. Otherwise some error messages may be missing. Other uses of 'cmdq_bitmap' already take into account 'rcfw->cmdq_depth' directly. Fixes: 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver") Link: https://lore.kernel.org/r/47ed717c3070a1d0f53e7b4c768a4fd11caf365d.1636707421.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET Acked-by: Selvin Xavier Signed-off-by: Jason Gunthorpe commit dd566d586fbadc36431c730d71856eb45443e40b Author: Changcheng Deng Date: Tue Nov 9 11:32:27 2021 +0000 RDMA/bnxt_re: Remove unneeded variable Fix the following coccicheck review: ./drivers/infiniband/hw/bnxt_re/main.c: 896: 5-7: Unneeded variable Remove unneeded variable used to store return value. Link: https://lore.kernel.org/r/20211109113227.132596-1-deng.changcheng@zte.com.cn Reported-by: Zeal Robot Signed-off-by: Changcheng Deng Reviewed-by: Devesh Sharma Signed-off-by: Jason Gunthorpe commit fc9d19e18aaac489e6ea86fd5bb59d50d151515b Author: Kamal Heib Date: Sun Nov 7 23:22:27 2021 +0200 RDMA/irdma: Use helper function to set GUIDs Use the addrconf_addr_eui48() helper function to set the GUIDs for both RoCE and iWARP modes, Also make sure the GUIDs are valid EUI-64 identifiers. Link: https://lore.kernel.org/r/20211107212227.44610-1-kamalheib1@gmail.com Signed-off-by: Kamal Heib Reviewed-by: Shiraz Saleem Signed-off-by: Jason Gunthorpe commit 934a5dc1546b1c637999bfcebcdd1598eaab4818 Author: Christophe JAILLET Date: Wed Nov 3 19:39:18 2021 +0100 coresight: Use devm_bitmap_zalloc when applicable 'drvdata->chs.guaranteed' is a bitmap. So use 'devm_bitmap_kzalloc()' to simplify code, improve the semantic and avoid some open-coded arithmetic in allocator arguments. Signed-off-by: Christophe JAILLET Link: https://lore.kernel.org/r/a4b8454f560b70cedf0e4d06275787f08d576ee5.1635964610.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mathieu Poirier commit 0fe4ff885f8a50082d9dc241b657472894caba16 Author: Noah Goldstein Date: Tue Nov 16 17:14:21 2021 +0100 x86/fpu: Correct AVX512 state tracking Add a separate, local mask for tracking AVX512 usage which does not include the opmask xfeature set. Opmask registers usage does not cause frequency throttling so it is a completely unnecessary false positive. While at it, carve it out into a separate function to keep that abomination extracted out. [ bp: Rediff and cleanup ontop of 5.16-rc1. ] Signed-off-by: Noah Goldstein Signed-off-by: Borislav Petkov Link: https://lore.kernel.org/r/20210920053951.4093668-1-goldstein.w.n@gmail.com commit 28491d7ef4af471841e454f8c1f77384f93c6fef Author: mark-yw.chen Date: Fri Nov 5 02:26:05 2021 +0800 Bluetooth: btusb: enable Mediatek to support AOSP extension This patch enables AOSP extension for Mediatek Chip (MT7921 & MT7922). Signed-off-by: mark-yw.chen Signed-off-by: Marcel Holtmann commit e927f53f7dd9b3cd389696161b72c8c079770941 Author: Jernej Skrabec Date: Mon Nov 15 21:11:12 2021 +0100 arm64: dts: allwinner: h6: tanix-tx6: Add SPDIF Tanix TX6 board has SPDIF connector in form of 3.5 mm jack. Add support for it. Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20211115201112.452696-1-jernej.skrabec@gmail.com commit 7cd925a8823d16de5614d3f0aabea9948747accd Author: Marek Szyprowski Date: Mon Nov 1 21:35:30 2021 +0200 clocksource/drivers/exynos_mct: Refactor resources allocation Move interrupts allocation from exynos4_timer_resources() into separate function together with the interrupt number parsing code from mct_init_dt(), so the code for managing interrupts is kept together. While touching exynos4_timer_resources() function, move of_iomap() to it. No functional changes. Signed-off-by: Marek Szyprowski Reviewed-by: Chanwoo Choi Tested-by: Chanwoo Choi Reviewed-by: Krzysztof Kozlowski Signed-off-by: Sam Protsenko Link: https://lore.kernel.org/r/20211101193531.15078-2-semen.protsenko@linaro.org Signed-off-by: Daniel Lezcano commit 715ecbc10d6a77cce1c3bec8ba10e59be5233b4f Author: Luca Ceresoli Date: Mon Nov 8 17:27:06 2021 +0100 power: supply: max77976: add Maxim MAX77976 charger driver Add support for the MAX77976 3.5/5.5A 1-Cell Li+ Battery Charger. This is a simple implementation enough to be used as a simple battery charger without OTG and boost. Signed-off-by: Luca Ceresoli Signed-off-by: Sebastian Reichel commit 77d641baa3c8e18a1056bec6c64c6103c1a17b1e Author: Luca Ceresoli Date: Mon Nov 8 17:27:05 2021 +0100 power: supply: core: add POWER_SUPPLY_HEALTH_NO_BATTERY Some chargers can keep the system powered from the mains even when no battery is present. It this case none of the currently defined health statuses applies. Add a new status to report that no battery is present. Suggested-by: Sebastian Reichel Signed-off-by: Luca Ceresoli Signed-off-by: Sebastian Reichel commit f9a09de33b47a8ac9a128fea54a549dddf87c6b4 Author: Luca Ceresoli Date: Mon Nov 8 17:27:04 2021 +0100 dt-bindings: power: supply: add Maxim MAX77976 battery charger Add bindings for the Maxim MAX77976 I2C-controlled battery charger. Signed-off-by: Luca Ceresoli Signed-off-by: Sebastian Reichel commit 1a085e23411de188ad0615f40a9399d80d1f7368 Author: Tilak Tangudu Date: Mon Nov 15 21:10:54 2021 +0530 drm/i915: Disable D3Cold in s2idle and runtime pm s2idle and runtime pm puts the pci gfx device in D3Hot, ACPI runtime monitors the pci tree,if it sees complete tree as D3Hot,it transitions the device to D3Cold.But i915 do not have D3Cold support in S2idle or in runtime pm. so disabling D3cold in above flows and its FIXME. Added pci D3Cold enable/disable in s2idle and runtime suspend/resume flows. Signed-off-by: Tilak Tangudu Reviewed-by: Rodrigo Vivi Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20211115154054.3220476-1-tilak.tangudu@intel.com commit 5b49e068beada2b5d9707acb2307f62fc5d7b197 Author: Mauro Carvalho Chehab Date: Tue Nov 16 11:16:54 2021 +0000 media: atomisp: get rid of #ifdef ISP_VEC_NELEMS This is defined as 64 for the devices/firmware that were chosen. So, evaluate the macros accordingly. Signed-off-by: Mauro Carvalho Chehab commit 912680064f94e37cf4a5c26e699d1da0e555e1f0 Author: Mauro Carvalho Chehab Date: Mon Nov 15 17:32:45 2021 +0000 media: atomisp: make sh_css similar to Intel Aero driver As we're using the firmware from Intel Aero, ensure that the logic inside sh_css as similar as possible to such driver. Signed-off-by: Mauro Carvalho Chehab commit ec1804dadf362882f526b2f7e18893d8eb2bd1dd Author: Mauro Carvalho Chehab Date: Tue Nov 16 09:13:32 2021 +0000 media: atomisp: warn if mipi de-allocation failed There's a note at the uninit function that warns about issues with mipi frames de-allocation. print a warning if the problem ever happens. Signed-off-by: Mauro Carvalho Chehab commit dc41f7df78af19ba56c689c6deb7efe5aa7e22b6 Author: Mauro Carvalho Chehab Date: Mon Nov 15 18:54:50 2021 +0000 media: atomisp: drop check_pipe_resolutions() logic Such function doesn't exist on Intel Aero driver. As we're using its firmware, it may mean that this is not compatible with the current file. So, drop it. Signed-off-by: Mauro Carvalho Chehab commit 37746513f6821e32c0c2dbac50985802ed556c32 Author: Mauro Carvalho Chehab Date: Mon Nov 15 18:43:22 2021 +0000 media: atomisp: get rid of some weird warn-suppress logic There are some dead code meant to suppress "C_RUN" warnings. Drop it from sh_css.c, as it doesn't make much sense. Signed-off-by: Mauro Carvalho Chehab commit e05b3bbbf12f2a1352b375ea6d16dae92f70bb7c Author: Mauro Carvalho Chehab Date: Tue Nov 16 09:13:38 2021 +0000 media: atomisp: drop a dead code There's a commented dead code related to some future thing to be implemented. As this won't happen, as it would require a newer firmware, just drop the code. Signed-off-by: Mauro Carvalho Chehab commit 1de7694155a7615b17b14af79ce9bd4abfba7f15 Author: Mauro Carvalho Chehab Date: Mon Nov 15 22:34:08 2021 +0000 media: atomisp: drop ia_css_pipe_update_qos_ext_mapped_arg This function is not used. Drop it. Signed-off-by: Mauro Carvalho Chehab commit 6a28541ff52f30bded470fdf68b8d196ea17403d Author: Mauro Carvalho Chehab Date: Mon Nov 15 19:40:26 2021 +0000 media: atomisp: unify ia_css_stream stop logic There are two versions of those functions. It turns that the choosen firmware use the old version. So, drop the unused ones and ensure that all devices will use the right functions. Signed-off-by: Mauro Carvalho Chehab commit 802dfce3b96e538a101fd1ba413ea1db11ba1df0 Author: Mauro Carvalho Chehab Date: Mon Nov 15 19:35:02 2021 +0000 media: atomisp: get rid of ia_css_stream_load() This function is marked as obsolete and nobody calls it. Signed-off-by: Mauro Carvalho Chehab commit 0a9e6351ea709249e7bd1796ffe832ebb81befde Author: Mauro Carvalho Chehab Date: Mon Nov 15 18:48:50 2021 +0000 media: atomisp: drop crop code at stream create function The firmware chosen for ISP2401 doesn't support it. Signed-off-by: Mauro Carvalho Chehab commit 2a01213bfa104ab90d861d86fcee5dea1a865592 Author: Mauro Carvalho Chehab Date: Mon Nov 15 23:33:01 2021 +0000 media: atomisp: solve #ifdef HAS_NO_PACKED_RAW_PIXELS This was never defined, so remove the #ifdefs, keeping the code. Signed-off-by: Mauro Carvalho Chehab commit 9e22032e9c9e801514daf0fdaba2ad587dc88497 Author: Mauro Carvalho Chehab Date: Mon Nov 15 22:19:50 2021 +0000 media: atomisp: remove #ifdef SH_CSS_ENABLE_METADATA The chosen firmware has it enabled, so, drop this symbol. Signed-off-by: Mauro Carvalho Chehab commit 52481d4d319c0179dfdf7c0ccd1b25ee435e303c Author: Mauro Carvalho Chehab Date: Mon Nov 15 15:46:36 2021 +0000 media: atomisp: drop #ifdef WITH_PC_MONITORING This is not needed for the driver to work. So, just drop it. Signed-off-by: Mauro Carvalho Chehab commit 16d0c92ef8a5e30cce5954c2a4c4f9aa179dbb0d Author: Mauro Carvalho Chehab Date: Mon Nov 15 12:13:13 2021 +0000 media: atomisp: drop #ifdef SH_CSS_ENABLE_PER_FRAME_PARAMS This is enabled for the firmware we're using. So, just drop the if's. Signed-off-by: Mauro Carvalho Chehab commit 29a3764a76ede92fc7dda648f4e2ae1a32597671 Author: Mauro Carvalho Chehab Date: Mon Nov 15 18:12:56 2021 +0000 media: atomisp: remove #ifdef HAS_OUTPUT_SYSTEM None of the firmwares we use has support for it. So, drop the unused code. Signed-off-by: Mauro Carvalho Chehab commit 7bedd01849d64e2b9c4b873342b5a3d0e45812eb Author: Mauro Carvalho Chehab Date: Mon Nov 15 16:05:51 2021 +0000 media: atomisp: drop an useless #ifdef ISP2401 The Yocto Aero driver for ISP2401 sets my_css_save.loaded_fw. As we're using the same firmware, remove the ifdef there. Signed-off-by: Mauro Carvalho Chehab commit 47f6b6d498ec12e669c283799e7f7f5ca89cda0a Author: Mauro Carvalho Chehab Date: Mon Nov 15 15:53:12 2021 +0000 media: atomisp: drop two vars that are currently ignored Those two vars are meaningful only with some ISP2401 firmwares. The one we chose to support doesn't use, so simply drop the extra code. Signed-off-by: Mauro Carvalho Chehab commit c35abde30ac69383328c21d368dbff8811ff8d89 Author: Mauro Carvalho Chehab Date: Mon Nov 15 12:18:52 2021 +0000 media: atomisp: Avoid some {} just to define new vars There are a couple of places where {} are used just to define a new var. Just move the var to the top of the function and get rid of that ugly blocks. Signed-off-by: Mauro Carvalho Chehab commit 0badc300c03aeff5c038eb852122f6e95df64821 Author: Mauro Carvalho Chehab Date: Mon Nov 15 12:05:25 2021 +0000 media: atomisp: fix comments coding style at sh_css.c Use the coding style for the comments at this file. While here, drop a do-nothing if logic. Signed-off-by: Mauro Carvalho Chehab commit 55e14acd99fd1ae3f624cdf75ec6ffe163007c81 Author: Mauro Carvalho Chehab Date: Sun Nov 14 11:44:37 2021 +0000 media: atomisp: ia_css_stream.h: remove ifdefs from the header Now that the input system always declare rx_cfg_t, we can remove the ifdef ISP2401 from this header. Signed-off-by: Mauro Carvalho Chehab commit 4005ecee616a51cb0305d8e3664af45376e7cf65 Author: Mauro Carvalho Chehab Date: Sun Nov 14 11:06:24 2021 +0000 media: atomisp: shift some structs from input_system_local There are several stucts under ISP2400 that could be moved to the global file without causing any build issues. Move those to the common header, in order to reduce the number of things that are #ifdef dependent. Signed-off-by: Mauro Carvalho Chehab commit 77db47351071a1e1b53b17510480ae2eefb4f074 Author: Mauro Carvalho Chehab Date: Sun Nov 14 09:23:21 2021 +0000 media: atomisp: get rid of if CONFIG_ON_FRAME_ENQUEUE This is not used with supported firmwares, so get rid of such code. Signed-off-by: Mauro Carvalho Chehab commit bcc3ba664931f1213bfc96f3fe7cfbfc20d49d49 Author: Mauro Carvalho Chehab Date: Fri Nov 12 11:43:17 2021 +0000 media: atomisp: get rid of phys event abstractions ia_css_dequeue_event() is just an alias to ia_css_dequeue_psys_event(), and atomisp_css_dequeue_event() do nothing but calling the event dequeue logic. Get rid of both abstractions, calling the function directly. Signed-off-by: Mauro Carvalho Chehab commit 58043dbf6d1ae9deab4f5aa1e039c70112017682 Author: Mauro Carvalho Chehab Date: Thu Nov 11 23:04:09 2021 +0000 media: atomisp: handle errors at sh_css_create_isp_params() The succ var tracks memory allocation erros on this function. Fix it, in order to stop this W=1 Werror in clang: drivers/staging/media/atomisp/pci/sh_css_params.c:2430:7: error: variable 'succ' set but not used [-Werror,-Wunused-but-set-variable] bool succ = true; ^ Reviewed-by: Nathan Chancellor Signed-off-by: Mauro Carvalho Chehab commit 363d50b73dd8189615994877953f02adbe6fcf02 Author: Mauro Carvalho Chehab Date: Thu Nov 11 11:04:31 2021 +0000 media: atomisp: implement enum framesize/frameinterval Add logic to enumerate sensor's frame size and interval. Signed-off-by: Mauro Carvalho Chehab commit d45d97873b8e4a005701bdbc3d916f368f95bc60 Author: Mauro Carvalho Chehab Date: Thu Nov 11 10:15:44 2021 +0000 media: atomisp-ov2680: implement enum frame intervals Allow the sensor to report the per-resolution frame interval. It should be noticed that, despite the ov2680 datasheet says that, for resolutions <= 1280x720, the sensor supports 60fps, the data at ov2680.h tells otherwise, limiting it to 30fps. Not sure yet if this is a limitation of atomisp or if it is just because the tables are incorrect. Signed-off-by: Mauro Carvalho Chehab commit dd8e6adb9b5dff3b01813dbc1216e438ed1414cf Author: Mauro Carvalho Chehab Date: Thu Nov 11 10:21:22 2021 +0000 media: atomisp-ov2680: adjust the maximum frame rate The ov2680 supports a maximum bandwidth of 660Mbps and allows up to 60fps when the resolution is below 720p. Adjust the sensor's table to reflect that. Signed-off-by: Mauro Carvalho Chehab commit 04da0010c097ae01187a530f8717890ac6b6a41f Author: Mauro Carvalho Chehab Date: Thu Nov 11 08:50:53 2021 +0000 media: atomisp-ov2680: remove some unused fields The sensor resolution arrays have two unused fields. Drop them. Reviewed-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 8734c1d948f4ea7025c4ebce7f5c332ee1692697 Author: Mauro Carvalho Chehab Date: Thu Nov 11 08:46:37 2021 +0000 media: atomisp-ov2680: uncomment other resolutions There are several resolutions defined for this sensor, but just two are currently uncommented. Change the driver to allow other resolutions to also be used. Reviewed-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit ea3e24ca30123b6060d6d52a5c74206f0e07e62b Author: Mauro Carvalho Chehab Date: Thu Nov 11 22:58:38 2021 +0000 media: atomisp-gc2235: drop an unused var Fix this clang Werror with W=1: drivers/staging/media/atomisp/i2c/atomisp-gc2235.c:573:6: error: variable 'ret' set but not used [-Werror,-Wunused-but-set-variable] int ret = -1; ^ Reviewed-by: Nathan Chancellor Signed-off-by: Mauro Carvalho Chehab commit 652af08aad4223742b43addbc6193428489b8586 Author: Mauro Carvalho Chehab Date: Thu Nov 11 22:57:05 2021 +0000 media: ipu3: drop an unused variable Fix this clang Werror with W=1: drivers/staging/media/ipu3/ipu3-css-params.c:774:8: error: variable 'pin_scale' set but not used [-Werror,-Wunused-but-set-variable] int pin_scale = 0; ^ Reviewed-by: Nathan Chancellor Acked-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 44ebcb44584f81d1d38fafb45cf57d651f44616e Author: Serge Semin Date: Mon Nov 15 21:19:17 2021 +0300 spi: dw: Define the capabilities in a continuous bit-flags set Since the DW_SPI_CAP_DWC_HSSI capability has just been replaced with using the DW SSI IP-core versions interface, the DW SPI capability flags are now represented with a gap. Let's fix it by redefining the DW_SPI_CAP_DFS32 macro to setting BIT(2) of the capabilities field. Signed-off-by: Serge Semin Suggested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211115181917.7521-8-Sergey.Semin@baikalelectronics.ru Signed-off-by: Mark Brown commit 2b8a47e0b6984b9795baa20ddcbd37e9ea9b2a91 Author: Serge Semin Date: Mon Nov 15 21:19:16 2021 +0300 spi: dw: Replace DWC_HSSI capability with IP-core version checker Since there is a common IP-core and component versions interface available we can use it to differentiate the DW HSSI device features in the code. Let's remove the corresponding DWC_HSSI capability flag then and use the dw_spi_ip_is() macro instead. Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211115181917.7521-7-Sergey.Semin@baikalelectronics.ru Signed-off-by: Mark Brown commit 2cc8d9227bbba7d6f3790a86f1ff0d665a75f3b8 Author: Serge Semin Date: Mon Nov 15 21:19:15 2021 +0300 spi: dw: Introduce Synopsys IP-core versions interface The driver currently supports two IP-core versions. It's DW APB SSI which is older version of the controller with APB system bus interface, and DW SSI controller with AHB bus interface. The later one is supposed to be a new generation high-speed SSI. Even though both of these IP-cores have got an almost identical registers space there are some differences. The driver differentiates these distinctions by the DW_SPI_CAP_DWC_HSSI capability flag. In addition to that each DW SSI IP-core is equipped with a Synopsys Component version register, which encodes the IP-core release ID the has been synthesized from. Seeing we are going to need the later one to differentiate some controller peculiarities it would be better to have a unified interface for both IP-core line and release versions instead of using each of them separately. Introduced here IP-core versioning interface consists of two parts: 1) IDs of the IP-core (virtual) and component versions. 2) a set of macro helpers to identify current IP-core and component versions. So the platform code is supposed to assign a proper IP-core version based on it's platform -knowledge. The main driver initialization method reads the IP-core release ID from the SSI component version register. That data is used by the helpers to distinguish one IP-core release from another. Thus the rest of the driver can use these macros to implement the conditional code execution based on the specified IP-core and version IDs. Collect the IP-core versions interface and the defined capabilities at the top of the header file since they represent a common device description data and so to immediately available for the driver hackers. Signed-off-by: Serge Semin Suggested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211115181917.7521-6-Sergey.Semin@baikalelectronics.ru Signed-off-by: Mark Brown commit ec77c086dc5b2eb422ff588f91cc011137fa9ea3 Author: Serge Semin Date: Mon Nov 15 21:19:14 2021 +0300 spi: dw: Convert to using the Bitfield access macros The driver has been using the offset/bitwise-shift-based approach for the CSR fields R/W operations since it was merged into the kernel. It can be simplified by using the macros defined in the linux/bitfield.h and linux/bit.h header files like BIT(), GENMASK(), FIELD_PREP(), FIELD_GET(), etc where it is required, for instance in the cached cr0 preparation method. Thus in order to have the FIELD_*()-macros utilized we just need to convert the macros with the CSR-fields offsets to the masks with the corresponding registers fields definition. That's where the GENMASK() and BIT() macros come in handy. After that the masks can be used in the FIELD_*()-macros where it's appropriate. We also need to convert the macros with the CRS-bit flags using the manual bitwise shift operations (x << y) to using the BIT() macro. Thus we'll have a more coherent set of the CSR-related macros. Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211115181917.7521-5-Sergey.Semin@baikalelectronics.ru Signed-off-by: Mark Brown commit 725b0e3ea899ff1cb799756ade302e7bc13a8559 Author: Serge Semin Date: Mon Nov 15 21:19:13 2021 +0300 spi: dw: Put the driver entities naming in order Mostly due to a long driver history it's methods and macro names look a bit messy. In particularly that concerns the code their prefixes. A biggest part of the driver functions and macros have got the dw_spi/DW_SPI prefixes. But there are some entities which have been just "spi_/SPI_"-prefixed. Especially that concerns the CSR and their fields macro definitions. It makes the code harder to comprehend since such methods and macros can be easily confused with the global SPI-subsystem exports. In this case the only possible way to more or less quickly distinguish one naming space from another is either by context or by the argument type, which most of the times isn't that easy anyway. In addition to that a new DW SSI IP-core support has been added in the framework of commit e539f435cb9c ("spi: dw: Add support for DesignWare DWC_ssi"), which introduced a new set or macro-prefixes to describe CTRLR0-specific fields and worsen the situation. Finally there are methods with no DW SPI driver-reference prefix at all, that make the code reading even harder. So in order to ease the driver hacking let's bring the code naming to a common base: 1) Each method is supposed to have "dw_spi_" prefix so to be easily distinguished from the kernel API, e.g. SPI-subsystem methods and macros. (Exception is the local implementation of the readl/writel methods since being just the regspace accessors.) 2) Each generically used macro should have DW_SPI_-prefix thus being easily comprehended as the local driver definition. 3) DW APB SSI and DW SSI specific macros should have prefixes as DW_PSSI_ and DW_HSSI_ respectively so referring to the system buses they support (APB and AHB similarly to the DT clocks naming like pclk, hclk). Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211115181917.7521-4-Sergey.Semin@baikalelectronics.ru Signed-off-by: Mark Brown commit 21b6b3809b840ad3d3f0689aac227929c04e9518 Author: Serge Semin Date: Mon Nov 15 21:19:12 2021 +0300 spi: dw: Discard redundant DW SSI Frame Formats enumeration The dw_ssi_type enumeration describes the SPI frame formats the controller supports, like Motorola SPI, Texas Instruments SSP and National Semiconductors Microwire, that is the serial protocol utilized for the SPI-transfers. Depending on the DW SSI IP-core configuration the protocol could be either fixed or selectable. If it is changebale the protocol can be selected by means of the CTRL0.FRF field, which possible values encoded by the dw_ssi_type enumeration. Aside with the denoted enum the field values are also described by a set of SPI_FRF_{SPI,SSP,MICROWIRE} macros. Thus currently the DW SPI driver has got two entities describing the same data. Let's get rid of the enumeration one then, since first it hasn't been used as enumeration-type but merely as a parametrized values set and second that would unify the macro-based CSR read/write interface of the driver. While at it convert the macro names to be more descriptive about the protocols they represent. Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211115181917.7521-3-Sergey.Semin@baikalelectronics.ru Signed-off-by: Mark Brown commit a62bacba81c477a6fd8f15da593ad02305a3d6da Author: Serge Semin Date: Mon Nov 15 21:19:11 2021 +0300 spi: dw: Add a symbols namespace for the core module The exported from the DW SPI driver core/DMA symbols are only used by the spi-dw-{mmio,pci,bt1}.o objects. Add these symbols to a separate namespace then and make sure the depended modules have it imported. Signed-off-by: Serge Semin Suggested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211115181917.7521-2-Sergey.Semin@baikalelectronics.ru Signed-off-by: Mark Brown commit 4950486cd86f450baa847bfc13557244d834526c Author: Uwe Kleine-König Date: Tue Nov 16 12:09:51 2021 +0100 regulator: da9121: Emit only one error message in .remove() When an i2c remove callback fails, the i2c core emits a generic error message and still removes the device. Apart from the message there the return value isn't further used. So don't return an error code after having already emitted a driver specific warning about the problem to prevent two messages about the same issue. Signed-off-by: Uwe Kleine-König Link: https://lore.kernel.org/r/20211116110951.1213566-1-u.kleine-koenig@pengutronix.de Signed-off-by: Mark Brown commit 7548a391c53cab2af0954d252cc5a9a793fd4c0e Author: Pierre-Louis Bossart Date: Tue Nov 16 14:41:31 2021 +0200 ASoC: SOF: i.MX: simplify Kconfig Follow the Intel example and simplify the Kconfig a) start from the end-product for 'select' chains b) use 'depends on' to filter out configurations. c) use snd-sof-of as a common module without any 'select' Signed-off-by: Pierre-Louis Bossart Reviewed-by: Daniel Baluta Signed-off-by: Daniel Baluta Link: https://lore.kernel.org/r/20211116124131.46414-1-daniel.baluta@oss.nxp.com Signed-off-by: Mark Brown commit 5f55c9693a222ee1b8ec62a57fbcff59af0c4837 Author: Srinivas Kandagatla Date: Tue Nov 16 11:50:21 2021 +0000 ASoC: qcom: sdm845: only setup slim ports once Currently same slim channel map setup for every dai link, which is redundant. Fix this by adding a flag and conditionally setting these channel maps. Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20211116115021.14213-1-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown commit 1f9d56574334590b836695cfec78dad029f36dba Author: Archie Pusaka Date: Thu Nov 11 13:20:54 2021 +0800 Bluetooth: Attempt to clear HCI_LE_ADV on adv set terminated error event We should clear the flag if the adv instance removed due to receiving this error status is the last one we have. Signed-off-by: Archie Pusaka Reviewed-by: Miao-chen Chou Signed-off-by: Marcel Holtmann commit 0f281a5e5b673698c246da5d7bf0d5fa427c47c5 Author: Archie Pusaka Date: Thu Nov 11 13:20:53 2021 +0800 Bluetooth: Ignore HCI_ERROR_CANCELLED_BY_HOST on adv set terminated event This event is received when the controller stops advertising, specifically for these three reasons: (a) Connection is successfully created (success). (b) Timeout is reached (error). (c) Number of advertising events is reached (error). (*) This event is NOT generated when the host stops the advertisement. Refer to the BT spec ver 5.3 vol 4 part E sec 7.7.65.18. Note that the section was revised from BT spec ver 5.0 vol 2 part E sec 7.7.65.18 which was ambiguous about (*). Some chips (e.g. RTL8822CE) send this event when the host stops the advertisement with status = HCI_ERROR_CANCELLED_BY_HOST (due to (*) above). This is treated as an error and the advertisement will be removed and userspace will be informed via MGMT event. On suspend, we are supposed to temporarily disable advertisements, and continue advertising on resume. However, due to the behavior above, the advertisements are removed instead. This patch returns early if HCI_ERROR_CANCELLED_BY_HOST is received. Btmon snippet of the unexpected behavior: @ MGMT Command: Remove Advertising (0x003f) plen 1 Instance: 1 < HCI Command: LE Set Extended Advertising Enable (0x08|0x0039) plen 6 Extended advertising: Disabled (0x00) Number of sets: 1 (0x01) Entry 0 Handle: 0x01 Duration: 0 ms (0x00) Max ext adv events: 0 > HCI Event: LE Meta Event (0x3e) plen 6 LE Advertising Set Terminated (0x12) Status: Operation Cancelled by Host (0x44) Handle: 1 Connection handle: 0 Number of completed extended advertising events: 5 > HCI Event: Command Complete (0x0e) plen 4 LE Set Extended Advertising Enable (0x08|0x0039) ncmd 2 Status: Success (0x00) Signed-off-by: Archie Pusaka Signed-off-by: Marcel Holtmann commit 9482c5074a7d0bec682cc35a12d687f185684f31 Author: Luiz Augusto von Dentz Date: Thu Nov 11 16:48:44 2021 -0800 Bluetooth: hci_request: Remove bg_scan_update work This work is no longer necessary since all the code using it has been converted to use hci_passive_scan/hci_passive_scan_sync. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit f056a65783cce9c1279c1635d92768ce5962e4d6 Author: Luiz Augusto von Dentz Date: Thu Nov 11 16:48:43 2021 -0800 Bluetooth: hci_sync: Convert MGMT_OP_SET_CONNECTABLE to use cmd_sync This makes MGMT_OP_SET_CONNEABLE use hci_cmd_sync_queue instead of use a dedicated connetable_update work. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 2bd1b237616bd91a3f4f0cd94dc53cd6cba7aff9 Author: Luiz Augusto von Dentz Date: Thu Nov 11 16:48:42 2021 -0800 Bluetooth: hci_sync: Convert MGMT_OP_SET_DISCOVERABLE to use cmd_sync This makes MGMT_OP_SET_DISCOVERABLE use hci_cmd_sync_queue instead of use a dedicated discoverable_update work. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit be6c5ba2b00a24883162aae90a59429441b97619 Author: Randy Dunlap Date: Sun Nov 14 19:05:17 2021 -0800 Bluetooth: btmrvl_main: repair a non-kernel-doc comment Do not use "/**" to begin a non-kernel-doc comment. Fixes this build warning: drivers/bluetooth/btmrvl_main.c:2: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst Signed-off-by: Randy Dunlap Reported-by: kernel test robot Cc: Marcel Holtmann Cc: Johan Hedberg Cc: Luiz Augusto von Dentz Cc: linux-bluetooth@vger.kernel.org Signed-off-by: Marcel Holtmann commit f8ae9bb51670ea74b92102e5befc6223c0b45041 Author: David Heidelberg Date: Thu Oct 28 18:50:08 2021 +0200 dt-bindings: power: reset: gpio-poweroff: Convert txt bindings to yaml Convert power-off action connected to the GPIO documentation to the YAML syntax. Signed-off-by: David Heidelberg Reviewed-by: Rob Herring Signed-off-by: Sebastian Reichel commit d41bc48bfab2076f7db88d079a3a3203dd9c4a54 Author: Andrii Nakryiko Date: Mon Nov 15 17:30:41 2021 -0800 selftests/bpf: Add uprobe triggering overhead benchmarks Add benchmark to measure overhead of uprobes and uretprobes. Also have a baseline (no uprobe attached) benchmark. On my dev machine, baseline benchmark can trigger 130M user_target() invocations. When uprobe is attached, this falls to just 700K. With uretprobe, we get down to 520K: $ sudo ./bench trig-uprobe-base -a Summary: hits 131.289 ± 2.872M/s # UPROBE $ sudo ./bench -a trig-uprobe-without-nop Summary: hits 0.729 ± 0.007M/s $ sudo ./bench -a trig-uprobe-with-nop Summary: hits 1.798 ± 0.017M/s # URETPROBE $ sudo ./bench -a trig-uretprobe-without-nop Summary: hits 0.508 ± 0.012M/s $ sudo ./bench -a trig-uretprobe-with-nop Summary: hits 0.883 ± 0.008M/s So there is almost 2.5x performance difference between probing nop vs non-nop instruction for entry uprobe. And 1.7x difference for uretprobe. This means that non-nop uprobe overhead is around 1.4 microseconds for uprobe and 2 microseconds for non-nop uretprobe. For nop variants, uprobe and uretprobe overhead is down to 0.556 and 1.13 microseconds, respectively. For comparison, just doing a very low-overhead syscall (with no BPF programs attached anywhere) gives: $ sudo ./bench trig-base -a Summary: hits 4.830 ± 0.036M/s So uprobes are about 2.67x slower than pure context switch. Signed-off-by: Andrii Nakryiko Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20211116013041.4072571-1-andrii@kernel.org commit 62803fec52f80e4dd375de2dd76510c405792928 Merge: abc3342a09a74 b3cb764aa1d75 Author: David S. Miller Date: Tue Nov 16 13:20:45 2021 +0000 Merge branch 'inuse-cleanups' Eric Dumazet says: ==================== net: prot_inuse and sock_inuse cleanups Small series cleaning and optimizing sock_prot_inuse_add() and sock_inuse_add(). ==================== Signed-off-by: David S. Miller commit b3cb764aa1d753cf6a58858f9e2097ba71e8100b Author: Eric Dumazet Date: Mon Nov 15 09:11:50 2021 -0800 net: drop nopreempt requirement on sock_prot_inuse_add() This is distracting really, let's make this simpler, because many callers had to take care of this by themselves, even if on x86 this adds more code than really needed. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 4199bae10c49e24bc2c5d8c06a68820d56640000 Author: Eric Dumazet Date: Mon Nov 15 09:11:49 2021 -0800 net: merge net->core.prot_inuse and net->core.sock_inuse net->core.sock_inuse is a per cpu variable (int), while net->core.prot_inuse is another per cpu variable of 64 integers. per cpu allocator tend to place them in very different places. Grouping them together makes sense, since it makes updates potentially faster, if hitting the same cache line. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit d477eb9004845cb2dc92ad5eed79a437738a868a Author: Eric Dumazet Date: Mon Nov 15 09:11:48 2021 -0800 net: make sock_inuse_add() available MPTCP hard codes it, let us instead provide this helper. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 2a12ae5d433df3d3c3f1a930799ec09cb2b8058f Author: Eric Dumazet Date: Mon Nov 15 09:11:47 2021 -0800 net: inline sock_prot_inuse_add() sock_prot_inuse_add() is very small, we can inline it. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit abc3342a09a74dcaaf11e6560c2ae859171f1167 Merge: 6fcc06205c15b 587652bbdd06a Author: David S. Miller Date: Tue Nov 16 13:16:54 2021 +0000 Merge branch 'gro-out-of-core-files' Eric Dumazet says: ==================== gro: get out of core files Move GRO related content into net/core/gro.c and include/net/gro.h. This reduces GRO scope to where it is really needed, and shrinks too big files (include/linux/netdevice.h and net/core/dev.c) ==================== Signed-off-by: David S. Miller commit 587652bbdd06ab38a4c1b85e40f933d2cf4a1147 Author: Eric Dumazet Date: Mon Nov 15 09:05:54 2021 -0800 net: gro: populate net/core/gro.c Move gro code and data from net/core/dev.c to net/core/gro.c to ease maintenance. gro_normal_list() and gro_normal_one() are inlined because they are called from both files. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit e456a18a390b96f22b0de2acd4d0f49c72ed2280 Author: Eric Dumazet Date: Mon Nov 15 09:05:53 2021 -0800 net: gro: move skb_gro_receive into net/core/gro.c net/core/gro.c will contain all core gro functions, to shrink net/core/skbuff.c and net/core/dev.c Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 0b935d7f8c07bf0a192712bdbf76dbf45ef8b115 Author: Eric Dumazet Date: Mon Nov 15 09:05:52 2021 -0800 net: gro: move skb_gro_receive_list to udp_offload.c This helper is used once, no need to keep it in fat net/core/skbuff.c Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 4721031c3559db8eae61df305f10c00099a7c1d0 Author: Eric Dumazet Date: Mon Nov 15 09:05:51 2021 -0800 net: move gro definitions to include/net/gro.h include/linux/netdevice.h became too big, move gro stuff into include/net/gro.h Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 6fcc06205c15bf1bb90896efdf5967028c154aba Merge: 3ad4b7c81a992 43f51df417295 Author: David S. Miller Date: Tue Nov 16 13:10:35 2021 +0000 Merge branch 'tcp-optimizations' Eric Dumazet says: ==================== tcp: optimizations for linux-5.17 Mostly small improvements in this series. The notable change is in "defer skb freeing after socket lock is released" in recvmsg() (and RX zerocopy) The idea is to try to let skb freeing to BH handler, whenever possible, or at least perform the freeing outside of the socket lock section, for much improved performance. This idea can probably be extended to other protocols. Tests on a 100Gbit NIC Max throughput for one TCP_STREAM flow, over 10 runs. MTU : 1500 (1428 bytes of TCP payload per MSS) Before: 55 Gbit After: 66 Gbit MTU : 4096+ (4096 bytes of TCP payload, plus TCP/IPv6 headers) Before: 82 Gbit After: 95 Gbit ==================== Acked-by: Soheil Hassas Yeganeh Signed-off-by: David S. Miller commit 43f51df4172955971ef5498f09308a9dc0291766 Author: Eric Dumazet Date: Mon Nov 15 11:02:49 2021 -0800 net: move early demux fields close to sk_refcnt sk_rx_dst/sk_rx_dst_ifindex/sk_rx_dst_cookie are read in early demux, and currently spans two cache lines. Moving them close to sk_refcnt makes more sense, as only one cache line is needed. New layout for this hot cache line is : struct sock { struct sock_common __sk_common; /* 0 0x88 */ /* --- cacheline 2 boundary (128 bytes) was 8 bytes ago --- */ struct dst_entry * sk_rx_dst; /* 0x88 0x8 */ int sk_rx_dst_ifindex; /* 0x90 0x4 */ u32 sk_rx_dst_cookie; /* 0x94 0x4 */ socket_lock_t sk_lock; /* 0x98 0x20 */ atomic_t sk_drops; /* 0xb8 0x4 */ int sk_rcvlowat; /* 0xbc 0x4 */ /* --- cacheline 3 boundary (192 bytes) --- */ Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 29fbc26e6dfc7be351c23261938de3f93f5cde57 Author: Eric Dumazet Date: Mon Nov 15 11:02:48 2021 -0800 tcp: do not call tcp_cleanup_rbuf() if we have a backlog Under pressure, tcp recvmsg() has logic to process the socket backlog, but calls tcp_cleanup_rbuf() right before. Avoiding sending ACK right before processing new segments makes a lot of sense, as this decrease the number of ACK packets, with no impact on effective ACK clocking. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 8bd172b787298124ef75c0e466101107c036d54d Author: Eric Dumazet Date: Mon Nov 15 11:02:47 2021 -0800 tcp: check local var (timeo) before socket fields in one test Testing timeo before sk_err/sk_state/sk_shutdown makes more sense. Modern applications use non-blocking IO, while a socket is terminated only once during its life time. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit f35f821935d8df76f9c92e2431a225bdff938169 Author: Eric Dumazet Date: Mon Nov 15 11:02:46 2021 -0800 tcp: defer skb freeing after socket lock is released tcp recvmsg() (or rx zerocopy) spends a fair amount of time freeing skbs after their payload has been consumed. A typical ~64KB GRO packet has to release ~45 page references, eventually going to page allocator for each of them. Currently, this freeing is performed while socket lock is held, meaning that there is a high chance that BH handler has to queue incoming packets to tcp socket backlog. This can cause additional latencies, because the user thread has to process the backlog at release_sock() time, and while doing so, additional frames can be added by BH handler. This patch adds logic to defer these frees after socket lock is released, or directly from BH handler if possible. Being able to free these skbs from BH handler helps a lot, because this avoids the usual alloc/free assymetry, when BH handler and user thread do not run on same cpu or NUMA node. One cpu can now be fully utilized for the kernel->user copy, and another cpu is handling BH processing and skb/page allocs/frees (assuming RFS is not forcing use of a single CPU) Tested: 100Gbit NIC Max throughput for one TCP_STREAM flow, over 10 runs MTU : 1500 Before: 55 Gbit After: 66 Gbit MTU : 4096+(headers) Before: 82 Gbit After: 95 Gbit Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 3df684c1a3d08a4f649689053a3d527b3b5fda9e Author: Eric Dumazet Date: Mon Nov 15 11:02:45 2021 -0800 tcp: avoid indirect calls to sock_rfree TCP uses sk_eat_skb() when skbs can be removed from receive queue. However, the call to skb_orphan() from __kfree_skb() incurs an indirect call so sock_rfee(), which is more expensive than a direct call, especially for CONFIG_RETPOLINE=y. Add tcp_eat_recv_skb() function to make the call before __kfree_skb(). Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit b96c51bd3bd826a3391cbf4b1281a1e0bf9df90a Author: Eric Dumazet Date: Mon Nov 15 11:02:44 2021 -0800 tcp: tp->urg_data is unlikely to be set Use some unlikely() hints in the fast path. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 7b6a893a5991f5e8a56795155ae86333b03080b7 Author: Eric Dumazet Date: Mon Nov 15 11:02:43 2021 -0800 tcp: annotate races around tp->urg_data tcp_poll() and tcp_ioctl() are reading tp->urg_data without socket lock owned. Also, it is faster to first check tp->urg_data in tcp_poll(), then tp->urg_seq == tp->copied_seq, because tp->urg_seq is located in a different/cold cache line. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 0307a0b74b3af6ecb1c8b7f727376130b15bbf44 Author: Eric Dumazet Date: Mon Nov 15 11:02:42 2021 -0800 tcp: annotate data-races on tp->segs_in and tp->data_segs_in tcp_segs_in() can be called from BH, while socket spinlock is held but socket owned by user, eventually reading these fields from tcp_get_info() Found by code inspection, no need to backport this patch to older kernels. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit d2489c7b6d7d5ed4b32b56703c57c47bfbfe7fa5 Author: Eric Dumazet Date: Mon Nov 15 11:02:41 2021 -0800 tcp: add RETPOLINE mitigation to sk_backlog_rcv Use INDIRECT_CALL_INET() to avoid an indirect call when/if CONFIG_RETPOLINE=y Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 93afcfd1db35882921b2521a637c78755c27b02c Author: Eric Dumazet Date: Mon Nov 15 11:02:40 2021 -0800 tcp: small optimization in tcp recvmsg() When reading large chunks of data, incoming packets might be added to the backlog from BH. tcp recvmsg() detects the backlog queue is not empty, and uses a release_sock()/lock_sock() pair to process this backlog. We now have __sk_flush_backlog() to perform this a bit faster. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 91b6d325635617540b6a1646ddb138bb17cbd569 Author: Eric Dumazet Date: Mon Nov 15 11:02:39 2021 -0800 net: cache align tcp_memory_allocated, tcp_sockets_allocated tcp_memory_allocated and tcp_sockets_allocated often share a common cache line, source of false sharing. Also take care of udp_memory_allocated and mptcp_sockets_allocated. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 6c302e799a0d4be1362f505453b714fe05d91f2a Author: Eric Dumazet Date: Mon Nov 15 11:02:38 2021 -0800 net: forward_alloc_get depends on CONFIG_MPTCP (struct proto)->sk_forward_alloc is currently only used by MPTCP. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 1ace2b4d2b4e1db8fc62d872ab54ab48f6215ecd Author: Eric Dumazet Date: Mon Nov 15 11:02:37 2021 -0800 net: shrink struct sock by 8 bytes Move sk_bind_phc next to sk_peer_lock to fill a hole. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 1b31debca83284486cd736757b5f26d51719ef80 Author: Eric Dumazet Date: Mon Nov 15 11:02:36 2021 -0800 ipv6: shrink struct ipcm6_cookie gso_size can be moved after tclass, to use an existing hole. (8 bytes saved on 64bit arches) Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit aba546565b613e74b84b8261999ea82b5561d3f1 Author: Eric Dumazet Date: Mon Nov 15 11:02:35 2021 -0800 net: remove sk_route_nocaps Instead of using a full netdev_features_t, we can use a single bit, as sk_route_nocaps is only used to remove NETIF_F_GSO_MASK from sk->sk_route_cap. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit d0d598ca86bd9e595f16a39097707c90841afe80 Author: Eric Dumazet Date: Mon Nov 15 11:02:34 2021 -0800 net: remove sk_route_forced_caps We were only using one bit, and we can replace it by sk_is_tcp() Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 42f67eea3ba36cef2dce2e853de6ddcb2e89eb39 Author: Eric Dumazet Date: Mon Nov 15 11:02:33 2021 -0800 net: use sk_is_tcp() in more places Move sk_is_tcp() to include/net/sock.h and use it where we can. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 373544020024668ea552a7699c9c9f100b6bc9d9 Author: Eric Dumazet Date: Mon Nov 15 11:02:32 2021 -0800 tcp: small optimization in tcp_v6_send_check() For TCP flows, inet6_sk(sk)->saddr has the same value than sk->sk_v6_rcv_saddr. Using sk->sk_v6_rcv_saddr increases data locality. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit 283c6b54bca13313a4f437719f600a3ad2135847 Author: Eric Dumazet Date: Mon Nov 15 11:02:31 2021 -0800 tcp: remove dead code in __tcp_v6_send_check() For some reason, I forgot to change __tcp_v6_send_check() at the same time I removed (ip_summed == CHECKSUM_PARTIAL) check in __tcp_v4_send_check() Fixes: 98be9b12096f ("tcp: remove dead code after CHECKSUM_PARTIAL adoption") Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit d519f350967a60b85a574ad8aeac43f2b4384746 Author: Eric Dumazet Date: Mon Nov 15 11:02:30 2021 -0800 tcp: minor optimization in tcp_add_backlog() If packet is going to be coalesced, sk_sndbuf/sk_rcvbuf values are not used. Defer their access to the point we need them. Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller commit ebf7f6f0a6cdcc17a3da52b81e4b3a98c4005028 Author: Tiezhu Yang Date: Fri Nov 5 09:30:00 2021 +0800 bpf: Change value of MAX_TAIL_CALL_CNT from 32 to 33 In the current code, the actual max tail call count is 33 which is greater than MAX_TAIL_CALL_CNT (defined as 32). The actual limit is not consistent with the meaning of MAX_TAIL_CALL_CNT and thus confusing at first glance. We can see the historical evolution from commit 04fd61ab36ec ("bpf: allow bpf programs to tail-call other bpf programs") and commit f9dabe016b63 ("bpf: Undo off-by-one in interpreter tail call count limit"). In order to avoid changing existing behavior, the actual limit is 33 now, this is reasonable. After commit 874be05f525e ("bpf, tests: Add tail call test suite"), we can see there exists failed testcase. On all archs when CONFIG_BPF_JIT_ALWAYS_ON is not set: # echo 0 > /proc/sys/net/core/bpf_jit_enable # modprobe test_bpf # dmesg | grep -w FAIL Tail call error path, max count reached jited:0 ret 34 != 33 FAIL On some archs: # echo 1 > /proc/sys/net/core/bpf_jit_enable # modprobe test_bpf # dmesg | grep -w FAIL Tail call error path, max count reached jited:1 ret 34 != 33 FAIL Although the above failed testcase has been fixed in commit 18935a72eb25 ("bpf/tests: Fix error in tail call limit tests"), it would still be good to change the value of MAX_TAIL_CALL_CNT from 32 to 33 to make the code more readable. The 32-bit x86 JIT was using a limit of 32, just fix the wrong comments and limit to 33 tail calls as the constant MAX_TAIL_CALL_CNT updated. For the mips64 JIT, use "ori" instead of "addiu" as suggested by Johan Almbladh. For the riscv JIT, use RV_REG_TCC directly to save one register move as suggested by Björn Töpel. For the other implementations, no function changes, it does not change the current limit 33, the new value of MAX_TAIL_CALL_CNT can reflect the actual max tail call count, the related tail call testcases in test_bpf module and selftests can work well for the interpreter and the JIT. Here are the test results on x86_64: # uname -m x86_64 # echo 0 > /proc/sys/net/core/bpf_jit_enable # modprobe test_bpf test_suite=test_tail_calls # dmesg | tail -1 test_bpf: test_tail_calls: Summary: 8 PASSED, 0 FAILED, [0/8 JIT'ed] # rmmod test_bpf # echo 1 > /proc/sys/net/core/bpf_jit_enable # modprobe test_bpf test_suite=test_tail_calls # dmesg | tail -1 test_bpf: test_tail_calls: Summary: 8 PASSED, 0 FAILED, [8/8 JIT'ed] # rmmod test_bpf # ./test_progs -t tailcalls #142 tailcalls:OK Summary: 1/11 PASSED, 0 SKIPPED, 0 FAILED Signed-off-by: Tiezhu Yang Signed-off-by: Daniel Borkmann Tested-by: Johan Almbladh Tested-by: Ilya Leoshkevich Acked-by: Björn Töpel Acked-by: Johan Almbladh Acked-by: Ilya Leoshkevich Link: https://lore.kernel.org/bpf/1636075800-3264-1-git-send-email-yangtiezhu@loongson.cn commit 385315decf65902768a0062b4e594f59f013025e Author: Jesse Melhuish Date: Mon Nov 15 22:00:52 2021 +0000 Bluetooth: Don't initialize msft/aosp when using user channel A race condition is triggered when usermode control is given to userspace before the kernel's MSFT query responds, resulting in an unexpected response to userspace's reset command. Issue can be observed in btmon: < HCI Command: Vendor (0x3f|0x001e) plen 2 #3 [hci0] 05 01 .. @ USER Open: bt_stack_manage (privileged) version 2.22 {0x0002} [hci0] < HCI Command: Reset (0x03|0x0003) plen 0 #4 [hci0] > HCI Event: Command Complete (0x0e) plen 5 #5 [hci0] Vendor (0x3f|0x001e) ncmd 1 Status: Command Disallowed (0x0c) 05 . > HCI Event: Command Complete (0x0e) plen 4 #6 [hci0] Reset (0x03|0x0003) ncmd 2 Status: Success (0x00) Reviewed-by: Abhishek Pandit-Subedi Reviewed-by: Sonny Sasaka Signed-off-by: Jesse Melhuish Signed-off-by: Marcel Holtmann commit a27c519a816437ec92f0ffa3adbc168c2c08725b Author: Jackie Liu Date: Tue Nov 16 09:17:17 2021 +0800 Bluetooth: fix uninitialized variables notify_evt Coverity Scan report: [...] *** CID 1493985: Uninitialized variables (UNINIT) /net/bluetooth/hci_event.c: 4535 in hci_sync_conn_complete_evt() 4529 4530 /* Notify only in case of SCO over HCI transport data path which 4531 * is zero and non-zero value shall be non-HCI transport data path 4532 */ 4533 if (conn->codec.data_path == 0) { 4534 if (hdev->notify) >>> CID 1493985: Uninitialized variables (UNINIT) >>> Using uninitialized value "notify_evt" when calling "*hdev->notify". 4535 hdev->notify(hdev, notify_evt); 4536 } 4537 4538 hci_connect_cfm(conn, ev->status); 4539 if (ev->status) 4540 hci_conn_del(conn); [...] Although only btusb uses air_mode, and he only handles HCI_NOTIFY_ENABLE_SCO_CVSD and HCI_NOTIFY_ENABLE_SCO_TRANSP, there is still a very small chance that ev->air_mode is not equal to 0x2 and 0x3, but notify_evt is initialized to HCI_NOTIFY_ENABLE_SCO_CVSD or HCI_NOTIFY_ENABLE_SCO_TRANSP. the context is maybe not correct. Let us directly use the required function instead of re-initializing it, so as to restore the original logic and make the code more correct. Addresses-Coverity: ("Uninitialized variables") Fixes: f4f9fa0c07bb ("Bluetooth: Allow usb to auto-suspend when SCO use non-HCI transport") Suggested-by: Marcel Holtmann Signed-off-by: Jackie Liu Signed-off-by: Marcel Holtmann commit 3a56ef719f0b9682afb8a86d64b2399e36faa4e6 Author: Pavel Skripkin Date: Mon Nov 1 10:12:12 2021 +0300 Bluetooth: stop proccessing malicious adv data Syzbot reported slab-out-of-bounds read in hci_le_adv_report_evt(). The problem was in missing validaion check. We should check if data is not malicious and we can read next data block. If we won't check ptr validness, code can read a way beyond skb->end and it can cause problems, of course. Fixes: e95beb414168 ("Bluetooth: hci_le_adv_report_evt code refactoring") Reported-and-tested-by: syzbot+e3fcb9c4f3c2a931dc40@syzkaller.appspotmail.com Signed-off-by: Pavel Skripkin Signed-off-by: Marcel Holtmann commit dd2ac1d6d4954522c67279e42e7069b91f67f151 Author: Zijun Hu Date: Tue Nov 16 16:51:38 2021 +0800 Bluetooth: hci_h4: Fix padding calculation error within h4_recv_buf() it is erroneous to calculate padding by subtracting length of type indication from skb->len, it will cause data analysis error for alignment which is greater than 1, so fixed by adding length of type indication with skb->len. Signed-off-by: Zijun Hu Signed-off-by: Marcel Holtmann commit e12cd158c8a45b3926cc2f42151384a2d7fdcec3 Author: Quentin Monnet Date: Mon Nov 15 22:58:44 2021 +0000 selftests/bpf: Configure dir paths via env in test_bpftool_synctypes.py Script test_bpftool_synctypes.py parses a number of files in the bpftool directory (or even elsewhere in the repo) to make sure that the list of types or options in those different files are consistent. Instead of having fixed paths, let's make the directories configurable through environment variable. This should make easier in the future to run the script in a different setup, for example on an out-of-tree bpftool mirror with a different layout. Signed-off-by: Quentin Monnet Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20211115225844.33943-4-quentin@isovalent.com commit b623181520404ef48f7421333561bd294c6c6b11 Author: Quentin Monnet Date: Mon Nov 15 22:58:43 2021 +0000 bpftool: Update doc (use susbtitutions) and test_bpftool_synctypes.py test_bpftool_synctypes.py helps detecting inconsistencies in bpftool between the different list of types and options scattered in the sources, the documentation, and the bash completion. For options that apply to all bpftool commands, the script had a hardcoded list of values, and would use them to check whether the man pages are up-to-date. When writing the script, it felt acceptable to have this list in order to avoid to open and parse bpftool's main.h every time, and because the list of global options in bpftool doesn't change so often. However, this is prone to omissions, and we recently added a new -l|--legacy option which was described in common_options.rst, but not listed in the options summary of each manual page. The script did not complain, because it keeps comparing the hardcoded list to the (now) outdated list in the header file. To address the issue, this commit brings the following changes: - Options that are common to all bpftool commands (--json, --pretty, and --debug) are moved to a dedicated file, and used in the definition of a RST substitution. This substitution is used in the sources of all the man pages. - This list of common options is updated, with the addition of the new -l|--legacy option. - The script test_bpftool_synctypes.py is updated to compare: - Options specific to a command, found in C files, for the interactive help messages, with the same specific options from the relevant man page for that command. - Common options, checked just once: the list in main.h is compared with the new list in substitutions.rst. Signed-off-by: Quentin Monnet Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20211115225844.33943-3-quentin@isovalent.com commit 4344842836e9b9a7b695dc84956cdecd83ac02e9 Author: Quentin Monnet Date: Mon Nov 15 22:58:42 2021 +0000 bpftool: Add SPDX tags to RST documentation files Most files in the kernel repository have a SPDX tags. The files that don't have such a tag (or another license boilerplate) tend to fall under the GPL-2.0 license. In the past, bpftool's Makefile (for example) has been marked as GPL-2.0 for that reason, when in fact all bpftool is dual-licensed. To prevent a similar confusion from happening with the RST documentation files for bpftool, let's explicitly mark all files as dual-licensed. Signed-off-by: Quentin Monnet Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20211115225844.33943-2-quentin@isovalent.com commit 4746158305e98c91c479539d53ef9bf8c520dd66 Author: Yonghong Song Date: Mon Nov 15 08:39:43 2021 -0800 selftests/bpf: Add a dedup selftest with equivalent structure types Without previous libbpf patch, the following error will occur: $ ./test_progs -t btf ... do_test_dedup:FAIL:check btf_dedup failed errno:-22#13/205 btf/dedup: btf_type_tag #5, struct:FAIL And the previous libbpf patch fixed the issue. Signed-off-by: Yonghong Song Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20211115163943.3922547-1-yhs@fb.com commit 69a055d546156adc6f7727ec981f721d5ba9231a Author: Yonghong Song Date: Mon Nov 15 08:39:37 2021 -0800 libbpf: Fix a couple of missed btf_type_tag handling in btf.c Commit 2dc1e488e5cd ("libbpf: Support BTF_KIND_TYPE_TAG") added the BTF_KIND_TYPE_TAG support. But to test vmlinux build with ... #define __user __attribute__((btf_type_tag("user"))) ... I needed to sync libbpf repo and manually copy libbpf sources to pahole. To simplify process, I used BTF_KIND_RESTRICT to simulate the BTF_KIND_TYPE_TAG with vmlinux build as "restrict" modifier is barely used in kernel. But this approach missed one case in dedup with structures where BTF_KIND_RESTRICT is handled and BTF_KIND_TYPE_TAG is not handled in btf_dedup_is_equiv(), and this will result in a pahole dedup failure. This patch fixed this issue and a selftest is added in the subsequent patch to test this scenario. The other missed handling is in btf__resolve_size(). Currently the compiler always emit like PTR->TYPE_TAG->... so in practice we don't hit the missing BTF_KIND_TYPE_TAG handling issue with compiler generated code. But lets add case BTF_KIND_TYPE_TAG in the switch statement to be future proof. Fixes: 2dc1e488e5cd ("libbpf: Support BTF_KIND_TYPE_TAG") Signed-off-by: Yonghong Song Signed-off-by: Daniel Borkmann Link: https://lore.kernel.org/bpf/20211115163937.3922235-1-yhs@fb.com commit b04cc0d912eb80d3c438b11d96ca847c3e77e8ab Author: Lad Prabhakar Date: Mon Oct 25 21:56:31 2021 +0100 memory: renesas-rpc-if: Add support for RZ/G2L SPI Multi I/O Bus Controller on RZ/G2L SoC is almost identical to the RPC-IF interface found on R-Car Gen3 SoC's. This patch adds a new compatible string for the RZ/G2L family so that the timing values on RZ/G2L can be adjusted. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Reviewed-by: Wolfram Sang Link: https://lore.kernel.org/r/20211025205631.21151-8-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Krzysztof Kozlowski commit 9a7fc952717ea63d13eb9d42581af52ba34c3914 Author: Tvrtko Ursulin Date: Thu Nov 11 13:06:34 2021 +0000 drm/i915: Skip error capture when wedged on init Trying to capture uninitialised engines when we wedged on init ends in tears. Skip that together with uC capture, since failure to initialise the latter can actually be one of the reasons for wedging on init. v2: * Use i915_disable_error_state when wedging on init/fini. v3: * Handle mock tests. Signed-off-by: Tvrtko Ursulin Reviewed-by: Matthew Auld # v1 Link: https://patchwork.freedesktop.org/patch/msgid/20211111130634.266098-1-tvrtko.ursulin@linux.intel.com commit 5da9b59b23d8112709034a07338e03dcc65fa11f Author: Lad Prabhakar Date: Mon Oct 25 21:56:30 2021 +0100 memory: renesas-rpc-if: Drop usage of RPCIF_DIRMAP_SIZE macro RPCIF_DIRMAP_SIZE may differ on various SoC's. Instead of using RPCIF_DIRMAP_SIZE macro use resource size to get dirmap size which is already part of struct rpcif. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Reviewed-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20211025205631.21151-7-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Krzysztof Kozlowski commit 818fdfa89baac77a8df5a2c30f4fb798cc937aa0 Author: Lad Prabhakar Date: Mon Oct 25 21:56:29 2021 +0100 memory: renesas-rpc-if: Return error in case devm_ioremap_resource() fails Make sure we return error in case devm_ioremap_resource() fails for dirmap resource. Fixes: ca7d8b980b67 ("memory: add Renesas RPC-IF driver") Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Reviewed-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20211025205631.21151-6-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Krzysztof Kozlowski commit 4b5a231ff617d5cdc9e99f39a7268ad491400195 Author: Lad Prabhakar Date: Mon Oct 25 21:56:26 2021 +0100 dt-bindings: memory: renesas,rpc-if: Add optional interrupts property For completeness add optional interrupts property. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Reviewed-by: Wolfram Sang Reviewed-by: Rob Herring Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20211025205631.21151-3-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Krzysztof Kozlowski commit c271aa1f73515bcb35f977f30825832d41a2f504 Author: Lad Prabhakar Date: Mon Oct 25 21:56:25 2021 +0100 dt-bindings: memory: renesas,rpc-if: Add support for the R9A07G044 SPI Multi I/O Bus Controller on RZ/G2L SoC is almost identical to the RPC-IF interface found on R-Car Gen3 SoC's. This patch adds a new compatible string to identify the RZ/G2L family so that the timing values on RZ/G2L can be adjusted. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Reviewed-by: Rob Herring Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20211025205631.21151-2-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Krzysztof Kozlowski commit b0ef7b1a7a07dde54c5849e0ca94070a1ed08d04 Author: David Virag Date: Mon Nov 1 00:17:19 2021 +0100 pinctrl: samsung: Add Exynos7885 SoC specific data Add Samsung Exynos7885 SoC specific data to enable pinctrl support for all platforms based on Exynos7885. Signed-off-by: David Virag Link: https://lore.kernel.org/r/20211031231720.46994-1-virag.david003@gmail.com Signed-off-by: Krzysztof Kozlowski commit 1e6a58ad39a638f29f9d3e8c8128a2ab355ad1ac Author: David Virag Date: Mon Nov 1 00:15:11 2021 +0100 dt-bindings: pinctrl: samsung: Document Exynos7885 Document compatible string for Exynos7885 SoC. Signed-off-by: David Virag Acked-by: Rob Herring Link: https://lore.kernel.org/r/20211031231511.46856-1-virag.david003@gmail.com Signed-off-by: Krzysztof Kozlowski commit 7f9ec9b59c278f31b0c2c8fabcf564e6fc02d4d8 Author: Arnd Bergmann Date: Tue Nov 16 10:20:42 2021 +0100 ARM: s3c: add one more "fallthrough" statement in Jive clang warns about one missing fallthrough that gcc ignores: arch/arm/mach-s3c/mach-jive.c:250:2: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough] Add it here as well. Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20211116092053.4042799-1-arnd@kernel.org Signed-off-by: Krzysztof Kozlowski commit b3c3d5881e0ede0526fc996c98949cffac697295 Author: Maximilian Luz Date: Thu Oct 28 02:22:43 2021 +0200 platform/surface: aggregator_registry: Rename device registration function Rename the device registration function to better align names with the newly introduced device removal function. Signed-off-by: Maximilian Luz Link: https://lore.kernel.org/r/20211028002243.1586083-4-luzmaximilian@gmail.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit acff7091df0eae74fe40917b961588a444d1d60e Author: Maximilian Luz Date: Thu Oct 28 02:22:42 2021 +0200 platform/surface: aggregator_registry: Use generic client removal function Use generic client removal function introduced in the previous commit instead of defining our own one. Signed-off-by: Maximilian Luz Link: https://lore.kernel.org/r/20211028002243.1586083-3-luzmaximilian@gmail.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 38543b72fbe52b7eec0dedd420d80a06c652d8e4 Author: Maximilian Luz Date: Thu Oct 28 02:22:41 2021 +0200 platform/surface: aggregator: Make client device removal more generic Currently, there are similar functions defined in the Aggregator Registry and the controller core. Make client device removal more generic and export it. We can then use this function later on to remove client devices from device hubs as well as the controller and avoid re-defining similar things. Signed-off-by: Maximilian Luz Link: https://lore.kernel.org/r/20211028002243.1586083-2-luzmaximilian@gmail.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 0f0ac158d28ff78e75c334e869b1cb8e69372a1f Author: Luke D. Jones Date: Sun Oct 24 16:37:05 2021 +1300 platform/x86: asus-wmi: Add support for custom fan curves Add support for custom fan curves found on some ASUS ROG laptops. These laptops have the ability to set a custom curve for the CPU and GPU fans via two ACPI methods. This patch adds two pwm attributes to the hwmon sysfs, pwm1 for CPU fan, pwm2 for GPU fan. Both are under the hwmon of the name `asus_custom_fan_curve`. There is no safety check of the set fan curves - this must be done in userspace. The fans have settings [1,2,3] under pwm_enable: 1. Enable and write settings out 2. Disable and use factory fan mode 3. Same as 2, additionally restoring default factory curve. Use of 2 means that the curve the user has set is still stored and won't be erased, but the laptop will be using its default auto-fan mode. Re-enabling the manual mode then activates the curves again. Notes: - pwm_enable = 0 is an invalid setting. - pwm is actually a percentage and is scaled on writing to device. Signed-off-by: Luke D. Jones Link: https://lore.kernel.org/r/20211024033705.5595-2-luke@ljones.dev Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit 79f960e29cfc87db324479ef982a3f97025328dc Author: Len Baker Date: Sat Oct 23 17:40:36 2021 +0200 platform/x86: thinkpad_acpi: Convert platform driver to use dev_groups Platform drivers have the option of having the platform core create and remove any needed sysfs attribute files. So take advantage of that and refactor the attributes management to avoid to register them "by hand". Also, due to some attributes are optionals, refactor the code and move the logic inside the "is_visible" callbacks of the attribute_group structures. Suggested-by: Greg Kroah-Hartman Acked-by: Greg Kroah-Hartman Signed-off-by: Len Baker Link: https://lore.kernel.org/r/20211023154036.6800-1-len.baker@gmx.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede commit e47d0bf800e8d7f4de501987b2788c7f2ce22cd1 Author: Stanislav Fomichev Date: Mon Nov 15 16:04:48 2021 -0800 bpftool: Add current libbpf_strict mode to version output + bpftool --legacy --version bpftool v5.15.0 features: libbfd, skeletons + bpftool --version bpftool v5.15.0 features: libbfd, libbpf_strict, skeletons + bpftool --legacy --help Usage: bpftool [OPTIONS] OBJECT { COMMAND | help } bpftool batch file FILE bpftool version OBJECT := { prog | map | link | cgroup | perf | net | feature | btf | gen | struct_ops | iter } OPTIONS := { {-j|--json} [{-p|--pretty}] | {-d|--debug} | {-l|--legacy} | {-V|--version} } + bpftool --help Usage: bpftool [OPTIONS] OBJECT { COMMAND | help } bpftool batch file FILE bpftool version OBJECT := { prog | map | link | cgroup | perf | net | feature | btf | gen | struct_ops | iter } OPTIONS := { {-j|--json} [{-p|--pretty}] | {-d|--debug} | {-l|--legacy} | {-V|--version} } + bpftool --legacy Usage: bpftool [OPTIONS] OBJECT { COMMAND | help } bpftool batch file FILE bpftool version OBJECT := { prog | map | link | cgroup | perf | net | feature | btf | gen | struct_ops | iter } OPTIONS := { {-j|--json} [{-p|--pretty}] | {-d|--debug} | {-l|--legacy} | {-V|--version} } + bpftool Usage: bpftool [OPTIONS] OBJECT { COMMAND | help } bpftool batch file FILE bpftool version OBJECT := { prog | map | link | cgroup | perf | net | feature | btf | gen | struct_ops | iter } OPTIONS := { {-j|--json} [{-p|--pretty}] | {-d|--debug} | {-l|--legacy} | {-V|--version} } + bpftool --legacy version bpftool v5.15.0 features: libbfd, skeletons + bpftool version bpftool v5.15.0 features: libbfd, libbpf_strict, skeletons + bpftool --json --legacy version {"version":"5.15.0","features":{"libbfd":true,"libbpf_strict":false,"skeletons":true}} + bpftool --json version {"version":"5.15.0","features":{"libbfd":true,"libbpf_strict":true,"skeletons":true}} Suggested-by: Quentin Monnet Signed-off-by: Stanislav Fomichev Signed-off-by: Daniel Borkmann Reviewed-by: Quentin Monnet Link: https://lore.kernel.org/bpf/20211116000448.2918854-1-sdf@google.com commit 2c95b92ecd92e784785b1db8cccc4f0f2bfa850c Author: Takashi Iwai Date: Tue Nov 16 08:33:58 2021 +0100 ALSA: memalloc: Unify x86 SG-buffer handling (take#3) This is a second attempt to unify the x86-specific SG-buffer handling code with the new standard non-contiguous page handler. The first try (in commit 2d9ea39917a4) failed due to the wrong page and address calculations, hence reverted. (And the second try failed due to a copy&paste error.) Now it's corrected with the previous fix for noncontig pages, and the proper sg page iteration by this patch. After the migration, SNDRV_DMA_TYPE_DMA_SG becomes identical with SNDRV_DMA_TYPE_NONCONTIG on x86, while others still fall back to SNDRV_DMA_TYPE_DEV. Tested-by: Alex Xu (Hello71) Tested-by: Harald Arnesen Link: https://lore.kernel.org/r/20211017074859.24112-4-tiwai@suse.de Link: https://lore.kernel.org/r/20211109062235.22310-1-tiwai@suse.de Link: https://lore.kernel.org/r/20211116073358.19741-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 7206998f578d5553989bc01ea2e544b622e79539 Author: Takashi Iwai Date: Tue Nov 16 08:24:59 2021 +0100 ALSA: hda: Fix potential deadlock at codec unbinding When a codec is unbound dynamically via sysfs while its stream is in use, we may face a potential deadlock at the proc remove or a UAF. This happens since the hda_pcm is managed by a linked list, as it handles the hda_pcm object release via kref. When a PCM is opened at the unbinding time, the release of hda_pcm gets delayed and it ends up with the close of the PCM stream releasing the associated hda_pcm object of its own. The hda_pcm destructor contains the PCM device release that includes the removal of procfs entries. And, this removal has the sync of the close of all in-use files -- which would never finish because it's called from the PCM file descriptor itself, i.e. it's trying to shoot its foot. For addressing the deadlock above, this patch changes the way to manage and release the hda_pcm object. The kref of hda_pcm is dropped, and instead a simple refcount is introduced in hda_codec for keeping the track of the active PCM streams, and at each PCM open and close, this refcount is adjusted accordingly. At unbinding, the driver calls snd_device_disconnect() for each PCM stream, then synchronizes with the refcount finish, and finally releases the object resources. Fixes: bbbc7e8502c9 ("ALSA: hda - Allocate hda_pcm objects dynamically") Link: https://lore.kernel.org/r/20211116072459.18930-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 80bd64af75b4bb11c0329bc66c35da2ddfb66d88 Author: Takashi Iwai Date: Tue Nov 16 08:13:14 2021 +0100 ALSA: hda: Add missing rwsem around snd_ctl_remove() calls snd_ctl_remove() has to be called with card->controls_rwsem held (when called after the card instantiation). This patch add the missing rwsem calls around it. Fixes: d13bd412dce2 ("ALSA: hda - Manage kcontrol lists") Link: https://lore.kernel.org/r/20211116071314.15065-3-tiwai@suse.de Signed-off-by: Takashi Iwai commit 5471e9762e1af4b7df057a96bfd46cc250979b88 Author: Takashi Iwai Date: Tue Nov 16 08:13:13 2021 +0100 ALSA: PCM: Add missing rwsem around snd_ctl_remove() calls snd_ctl_remove() has to be called with card->controls_rwsem held (when called after the card instantiation). This patch add the missing rwsem calls around it. Fixes: a8ff48cb7083 ("ALSA: pcm: Free chmap at PCM free callback, too") Link: https://lore.kernel.org/r/20211116071314.15065-2-tiwai@suse.de Signed-off-by: Takashi Iwai commit 06764dc931848c3a9bc01a63bbf76a605408bb54 Author: Takashi Iwai Date: Tue Nov 16 08:13:12 2021 +0100 ALSA: jack: Add missing rwsem around snd_ctl_remove() calls snd_ctl_remove() has to be called with card->controls_rwsem held (when called after the card instantiation). This patch add the missing rwsem calls around it. Fixes: 9058cbe1eed2 ("ALSA: jack: implement kctl creating for jack devices") Link: https://lore.kernel.org/r/20211116071314.15065-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit 02eb1d098e26f34c8f047b0b1cee6f4433a34bd1 Author: Takashi Iwai Date: Tue Nov 16 07:54:15 2021 +0100 ALSA: usb-audio: Fix dB level of Bose Revolve+ SoundLink Bose Revolve+ SoundLink (0a57:40fa) advertises invalid dB level for the speaker volume. This patch provides the correction in the mixer map quirk table entry. Note that this requires the prerequisite change to add min_mute flag to the dB map table. BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1192375 Link: https://lore.kernel.org/r/20211116065415.11159-4-tiwai@suse.de Signed-off-by: Takashi Iwai commit 85b741c1cb6854478fd1aa13ac231e2c1baf4c4b Author: Takashi Iwai Date: Tue Nov 16 07:54:14 2021 +0100 ALSA: usb-audio: Add minimal-mute notion in dB mapping table Some devices do mute the volume at the minimal volume, and for such devices, we need to set SNDRV_CTL_TLVT_DB_MINMAX_MUTE to the TLV information. It corresponds to setting usb_mixer_elem_info.min_mute flag in the USB-audio driver. This patch adds a new field min_mute in usbmix_dB_map so that the mixer map entry can pass the flag. Link: https://lore.kernel.org/r/20211116065415.11159-3-tiwai@suse.de Signed-off-by: Takashi Iwai commit fd23116d7b8dffa05f42a857eee6ee9cce238d24 Author: Takashi Iwai Date: Tue Nov 16 07:54:13 2021 +0100 ALSA: usb-audio: Use int for dB map values The values in usbmix_dB_map should be rather signed while we're using u32. As the copied target (usb_mixer_elem_info.dBmin and dBmax) is int, let's make them also int. Link: https://lore.kernel.org/r/20211116065415.11159-2-tiwai@suse.de Signed-off-by: Takashi Iwai commit 16d6dc8d8030dfe88104616cd3dea4e055af506d Author: Quan Nguyen Date: Tue Oct 19 13:01:55 2021 +0700 ARM: dts: aspeed: mtjade: Add uefi partition Add SPI NOR partition for uefi. Signed-off-by: Thang Q. Nguyen Signed-off-by: Quan Nguyen Reviewed-by: Joel Stanley Link: https://lore.kernel.org/r/20211019060155.945-4-quan@os.amperecomputing.com Signed-off-by: Joel Stanley commit 8189162c66b7bc2d91224269b472aae57fc699e1 Author: Quan Nguyen Date: Tue Oct 19 13:01:54 2021 +0700 ARM: dts: aspeed: mtjade: Add I2C buses for NVMe devices This commit adds configuration i2c busses for 24 NVMe slots and 2 M2 NVMe slots found on Mt.Jade hardware reference platform with Ampere's Altra processor family. Signed-off-by: Quan Nguyen Reviewed-by: Joel Stanley Link: https://lore.kernel.org/r/20211019060155.945-3-quan@os.amperecomputing.com Signed-off-by: Joel Stanley commit 82099d76cb6ff6738306e90e816754a5d6b046ce Author: Oskar Senft Date: Thu Nov 4 23:29:10 2021 -0400 ARM: dts: aspeed: tyan-s7106: Update nct7802 config This change updates the configuration for the nct7802 hardware monitor to correctly configure its temperature sensors. Signed-off-by: Oskar Senft Link: https://lore.kernel.org/r/20211105032910.446492-1-osk@google.com Signed-off-by: Joel Stanley commit 3ad4b7c81a992463c29ae130332c217607fe4452 Author: Sean Anderson Date: Fri Nov 12 14:04:00 2021 -0500 net: macb: Fix several edge cases in validate There were several cases where validate() would return bogus supported modes with unusual combinations of interfaces and capabilities. For example, if state->interface was 10GBASER and the macb had HIGH_SPEED and PCS but not GIGABIT MODE, then 10/100 modes would be set anyway. In another case, SGMII could be enabled even if the mac was not a GEM (despite this being checked for later on in mac_config()). These inconsistencies make it difficult to refactor this function cleanly. There is still the open question of what exactly the requirements for SGMII and 10GBASER are, and what SGMII actually supports. If someone from Cadence (or anyone else with access to the GEM/MACB datasheet) could comment on this, it would be greatly appreciated. In particular, what is supported by Cadence vs. vendor extension/limitation? To address this, the current logic is split into three parts. First, we determine what we support, then we eliminate unsupported interfaces, and finally we set the appropriate link modes. There is still some cruft related to NA, but this can be removed in a future patch. Signed-off-by: Sean Anderson Reviewed-by: Parshuram Thombare Reviewed-by: Russell King (Oracle) Link: https://lore.kernel.org/r/20211112190400.1937855-1-sean.anderson@seco.com Signed-off-by: Jakub Kicinski commit 5ecc573d0c542c0f95497ba4586a6226814e4e18 Author: David Heidelberg Date: Thu Oct 28 14:46:38 2021 +0200 ASoC: wm8903: Convert txt bindings to yaml Convert the Wolfson WM8903 Ultra-Low Power Stereo CODEC Device Tree binding documentation to json-schema. Signed-off-by: David Heidelberg Acked-by: Charles Keepax Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211028124639.38420-1-david@ixit.cz Signed-off-by: Mark Brown commit 3c8a3ad4019126f06016ab0128dde11817502f52 Author: Srinivasa Rao Mandadapu Date: Mon Nov 15 12:41:28 2021 +0530 ASoC: codecs: MBHC: Add support for special headset Update MBHC driver to support special headset such as apple and huwawei headsets. Signed-off-by: Srinivasa Rao Mandadapu Co-developed-by: Venkata Prasad Potturu Signed-off-by: Venkata Prasad Potturu Reviewed-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/1636960288-27537-1-git-send-email-srivasam@codeaurora.org Signed-off-by: Mark Brown commit 01365f549c8899a60bd6d30f31602b15f4270629 Author: Yongqiang Niu Date: Thu Sep 30 23:52:22 2021 +0800 drm/mediatek: Add support for Mediatek SoC MT8192 Add support for Mediatek SoC MT8192 Signed-off-by: Yongqiang Niu Signed-off-by: Hsin-Yi Wang Signed-off-by: Chun-Kuang Hu commit f4cca88efd1ad9642b64a181aaa6ebd4ff24a389 Author: Yongqiang Niu Date: Thu Sep 30 23:52:20 2021 +0800 drm/mediatek: Add component RDMA4 This patch add component RDMA4 Signed-off-by: Yongqiang Niu Signed-off-by: Hsin-Yi Wang Signed-off-by: Chun-Kuang Hu commit 8c9f215a31c6e7fd284a4b4f363ee30e6dcc2a69 Author: Yongqiang Niu Date: Thu Sep 30 23:52:19 2021 +0800 drm/mediatek: Add component POSTMASK This patch add component POSTMASK. Signed-off-by: Yongqiang Niu Signed-off-by: Hsin-Yi Wang Signed-off-by: Chun-Kuang Hu commit 787a7a871c6f402a32d556b7a53d0d4e0d4f8913 Author: Yongqiang Niu Date: Thu Sep 30 23:52:18 2021 +0800 drm/mediatek: Add component OVL_2L2 This patch add component OVL_2L2 Signed-off-by: Yongqiang Niu Signed-off-by: Hsin-Yi Wang Signed-off-by: Chun-Kuang Hu commit eda09706b240ca9129ac4e1fbb4eb1e2bc67aadc Author: Michal Koutný Date: Wed Nov 3 17:58:45 2021 +0100 cgroup: rstat: Mark benign data race to silence KCSAN There is a race between updaters and flushers (flush can possibly miss the latest update(s)). This is expected as explained in cgroup_rstat_updated() comment, add also machine readable annotation so that KCSAN results aren't noisy. Reported-by: Hao Sun Link: https://lore.kernel.org/r/CACkBjsbPVdkub=e-E-p1WBOLxS515ith-53SFdmFHWV_QMo40w@mail.gmail.com Suggested-by: Hao Sun Signed-off-by: Michal Koutný Reviewed-by: Shakeel Butt Signed-off-by: Tejun Heo commit 75cc9a84c9eb36e436e3fcee5158fe31d1dfd78f Author: Borislav Petkov Date: Wed Nov 10 16:06:53 2021 -0600 x86/sev: Remove do_early_exception() forward declarations There's a perfectly fine prototype in the asm/setup.h header. Use it. No functional changes. Signed-off-by: Borislav Petkov Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20211110220731.2396491-8-brijesh.singh@amd.com commit 5ed0a99b12aa2dd09afe7ba485145529b89f26e6 Author: Borislav Petkov Date: Wed Nov 10 16:06:52 2021 -0600 x86/head64: Carve out the guest encryption postprocessing into a helper Carve it out so that it is abstracted out of the main boot path. All other encrypted guest-relevant processing should be placed in there. No functional changes. Signed-off-by: Borislav Petkov Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20211110220731.2396491-7-brijesh.singh@amd.com commit d2c64f98c3878b25e987b6b8f5100732c6426640 Author: Andy Shevchenko Date: Mon Nov 15 13:29:02 2021 +0200 PCI: Use pci_find_vsec_capability() when looking for TBT devices Currently set_pcie_thunderbolt() open-codes pci_find_vsec_capability(). Refactor the former to use the latter. No functional change intended. Link: https://lore.kernel.org/r/20211115112902.24033-1-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Signed-off-by: Bjorn Helgaas Reviewed-by: Krzysztof Wilczyński commit dbc4c70e3cdfe204a67dd66bed78709ee3000ec0 Author: Borislav Petkov Date: Wed Nov 10 16:06:51 2021 -0600 x86/sev: Get rid of excessive use of defines Remove all the defines of masks and bit positions for the GHCB MSR protocol and use comments instead which correspond directly to the spec so that following those can be a lot easier and straightforward with the spec opened in parallel to the code. Aligh vertically while at it. No functional changes. Signed-off-by: Borislav Petkov Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20211110220731.2396491-6-brijesh.singh@amd.com commit 552a23a0e5d0a84cecd4687043d8030673981d30 Author: Gustavo A. R. Silva Date: Wed Sep 29 16:18:03 2021 -0500 Makefile: Enable -Wcast-function-type In order to make sure new function cast mismatches are not introduced in the kernel (to avoid tripping CFI checking), the kernel should be globally built with -Wcast-function-type. Link: https://github.com/KSPP/linux/issues/20 Co-developed-by: Kees Cook Signed-off-by: Kees Cook Signed-off-by: Gustavo A. R. Silva commit 688542e29fae655a8be25832f6a9959bdd308dd8 Author: Reinette Chatre Date: Mon Nov 15 10:35:26 2021 -0800 selftests/sgx: Add test for multiple TCS entry Each thread executing in an enclave is associated with a Thread Control Structure (TCS). The SGX test enclave contains two hardcoded TCS, thus supporting two threads in the enclave. Add a test to ensure it is possible to enter enclave at both entrypoints. Signed-off-by: Reinette Chatre Signed-off-by: Dave Hansen Reviewed-by: Jarkko Sakkinen Acked-by: Dave Hansen Link: https://lkml.kernel.org/r/7be151a57b4c7959a2364753b995e0006efa3da1.1636997631.git.reinette.chatre@intel.com commit 26e688f1263a3c226f3bb5e3441c310ae11e8001 Author: Reinette Chatre Date: Mon Nov 15 10:35:25 2021 -0800 selftests/sgx: Enable multiple thread support Each thread executing in an enclave is associated with a Thread Control Structure (TCS). The test enclave contains two hardcoded TCS. Each TCS contains meta-data used by the hardware to save and restore thread specific information when entering/exiting the enclave. The two TCS structures within the test enclave share their SSA (State Save Area) resulting in the threads clobbering each other's data. Fix this by providing each TCS their own SSA area. Additionally, there is an 8K stack space and its address is computed from the enclave entry point which is correctly done for TCS #1 that starts on the first address inside the enclave but results in out of bounds memory when entering as TCS #2. Split 8K stack space into two separate pages with offset symbol between to ensure the current enclave entry calculation can continue to be used for both threads. While using the enclave with multiple threads requires these fixes the impact is not apparent because every test up to this point enters the enclave from the first TCS. More detail about the stack fix: ------------------------------- Before this change the test enclave (test_encl) looks as follows: .tcs (2 pages): (page 1) TCS #1 (page 2) TCS #2 .text (1 page) One page of code .data (5 pages) (page 1) encl_buffer (page 2) encl_buffer (page 3) SSA (page 4 and 5) STACK encl_stack: As shown above there is a symbol, encl_stack, that points to the end of the .data segment (pointing to the end of page 5 in .data) which is also the end of the enclave. The enclave entry code computes the stack address by adding encl_stack to the pointer to the TCS that entered the enclave. When entering at TCS #1 the stack is computed correctly but when entering at TCS #2 the stack pointer would point to one page beyond the end of the enclave and a #PF would result when TCS #2 attempts to enter the enclave. The fix involves moving the encl_stack symbol between the two stack pages. Doing so enables the stack address computation in the entry code to compute the correct stack address for each TCS. Signed-off-by: Reinette Chatre Signed-off-by: Dave Hansen Reviewed-by: Jarkko Sakkinen Acked-by: Dave Hansen Link: https://lkml.kernel.org/r/a49dc0d85401db788a0a3f0d795e848abf3b1f44.1636997631.git.reinette.chatre@intel.com commit abc5cec4735080d12d644c2d39f96cf98c0a367c Author: Reinette Chatre Date: Mon Nov 15 10:35:24 2021 -0800 selftests/sgx: Add page permission and exception test The Enclave Page Cache Map (EPCM) is a secure structure used by the processor to track the contents of the enclave page cache. The EPCM contains permissions with which enclave pages can be accessed. SGX support allows EPCM and PTE page permissions to differ - as long as the PTE permissions do not exceed the EPCM permissions. Add a test that: (1) Creates an SGX enclave page with writable EPCM permission. (2) Changes the PTE permission on the page to read-only. This should be permitted because the permission does not exceed the EPCM permission. (3) Attempts a write to the page. This should generate a page fault (#PF) because of the read-only PTE even though the EPCM permissions allow the page to be written to. This introduces the first test of SGX exception handling. In this test the issue that caused the exception (PTE page permissions) can be fixed from outside the enclave and after doing so it is possible to re-enter enclave at original entrypoint with ERESUME. Signed-off-by: Reinette Chatre Signed-off-by: Dave Hansen Reviewed-by: Jarkko Sakkinen Acked-by: Dave Hansen Link: https://lkml.kernel.org/r/3bcc73a4b9fe8780bdb40571805e7ced59e01df7.1636997631.git.reinette.chatre@intel.com commit c085dfc7685c8c36698b851b03990b75a3226e97 Author: Reinette Chatre Date: Mon Nov 15 10:35:23 2021 -0800 selftests/sgx: Rename test properties in preparation for more enclave tests SGX selftests prepares a data structure outside of the enclave with the type of and data for the operation that needs to be run within the enclave. At this time only two complementary operations are supported by the enclave: copying a value from outside the enclave into a default buffer within the enclave and reading a value from the enclave's default buffer into a variable accessible outside the enclave. In preparation for more operations supported by the enclave the names of the current enclave operations are changed to more accurately reflect the operations and more easily distinguish it from future operations: * The enums ENCL_OP_PUT and ENCL_OP_GET are renamed to ENCL_OP_PUT_TO_BUFFER and ENCL_OP_GET_FROM_BUFFER respectively. * The structs encl_op_put and encl_op_get are renamed to encl_op_put_to_buf and encl_op_get_from_buf respectively. * The enclave functions do_encl_op_put and do_encl_op_get are renamed to do_encl_op_put_to_buf and do_encl_op_get_from_buf respectively. No functional changes. Suggested-by: Jarkko Sakkinen Signed-off-by: Reinette Chatre Signed-off-by: Dave Hansen Acked-by: Jarkko Sakkinen Acked-by: Dave Hansen Link: https://lkml.kernel.org/r/023fda047c787cf330b88ed9337705edae6a0078.1636997631.git.reinette.chatre@intel.com commit 41493a095e487c207b4b702aee2f8c59a7294e4f Author: Jarkko Sakkinen Date: Mon Nov 15 10:35:22 2021 -0800 selftests/sgx: Provide per-op parameter structs for the test enclave To add more operations to the test enclave, the protocol needs to allow to have operations with varying parameters. Create a separate parameter struct for each existing operation, with the shared parameters in struct encl_op_header. [reinette: rebased to apply on top of oversubscription test series] Signed-off-by: Jarkko Sakkinen Signed-off-by: Reinette Chatre Signed-off-by: Dave Hansen Acked-by: Dave Hansen Link: https://lkml.kernel.org/r/f9a4a8c436b538003b8ebddaa66083992053cef1.1636997631.git.reinette.chatre@intel.com commit f0ff2447b8613b883f41ae845b6cc7540d6e5f71 Author: Jarkko Sakkinen Date: Mon Nov 15 10:35:21 2021 -0800 selftests/sgx: Add a new kselftest: Unclobbered_vdso_oversubscribed Add a variation of the unclobbered_vdso test. In the new test, create a heap for the test enclave, which has the same size as all available Enclave Page Cache (EPC) pages in the system. This will guarantee that all test_encl.elf pages *and* SGX Enclave Control Structure (SECS) have been swapped out by the page reclaimer during the load time. This test will trigger both the page reclaimer and the page fault handler. The page reclaimer triggered, while the heap is being created during the load time. The page fault handler is triggered for all the required pages, while the test case is executing. Signed-off-by: Jarkko Sakkinen Signed-off-by: Reinette Chatre Signed-off-by: Dave Hansen Acked-by: Dave Hansen Link: https://lkml.kernel.org/r/41f7c508eea79a3198b5014d7691903be08f9ff1.1636997631.git.reinette.chatre@intel.com commit 065825db1fd60aa7695565613a69ed086a831869 Author: Jarkko Sakkinen Date: Mon Nov 15 10:35:20 2021 -0800 selftests/sgx: Move setup_test_encl() to each TEST_F() Create the test enclave inside each TEST_F(), instead of FIXTURE_SETUP(), so that the heap size can be defined per test. Signed-off-by: Jarkko Sakkinen Signed-off-by: Reinette Chatre Signed-off-by: Dave Hansen Acked-by: Dave Hansen Link: https://lkml.kernel.org/r/70ca264535d2ca0dc8dcaf2281e7d6965f8d4a24.1636997631.git.reinette.chatre@intel.com commit 1b35eb719549ab5143d61f9e09b0771cd3d00d94 Author: Jarkko Sakkinen Date: Mon Nov 15 10:35:19 2021 -0800 selftests/sgx: Encpsulate the test enclave creation Introduce setup_test_encl() so that the enclave creation can be moved to TEST_F()'s. This is required for a reclaimer test where the heap size needs to be set large enough to triger the page reclaimer. Signed-off-by: Jarkko Sakkinen Signed-off-by: Reinette Chatre Signed-off-by: Dave Hansen Acked-by: Dave Hansen Link: https://lkml.kernel.org/r/bee0ca867a95828a569c1ba2a8e443a44047dc71.1636997631.git.reinette.chatre@intel.com commit 1471721489090515f9f0f059b25124898928e559 Author: Jarkko Sakkinen Date: Mon Nov 15 10:35:18 2021 -0800 selftests/sgx: Dump segments and /proc/self/maps only on failure Logging is always a compromise between clarity and detail. The main use case for dumping VMA's is when FIXTURE_SETUP() fails, and is less important for enclaves that do initialize correctly. Therefore, print the segments and /proc/self/maps only in the error case. Finally, if a single test ever creates multiple enclaves, the amount of log lines would become enormous. Signed-off-by: Jarkko Sakkinen Signed-off-by: Reinette Chatre Signed-off-by: Dave Hansen Acked-by: Dave Hansen Link: https://lkml.kernel.org/r/23cef0ae1de3a8a74cbfbbe74eca48ca3f300fde.1636997631.git.reinette.chatre@intel.com commit 3200505d4de6436af799d7be743d9dc87450ee5a Author: Jarkko Sakkinen Date: Mon Nov 15 10:35:17 2021 -0800 selftests/sgx: Create a heap for the test enclave Create a heap for the test enclave, which is allocated from /dev/null, and left unmeasured. This is beneficial by its own because it verifies that an enclave built from multiple choices, works properly. If LSM hooks are added for SGX some day, a multi source enclave has higher probability to trigger bugs on access control checks. The immediate need comes from the need to implement page reclaim tests. In order to trigger the page reclaimer, one can just set the size of the heap to high enough. Signed-off-by: Jarkko Sakkinen Signed-off-by: Reinette Chatre Signed-off-by: Dave Hansen Acked-by: Dave Hansen Link: https://lkml.kernel.org/r/e070c5f23578c29608051cab879b1d276963a27a.1636997631.git.reinette.chatre@intel.com commit 5f0ce664d8c6c160ce4333e809545a8a57fe2baf Author: Jarkko Sakkinen Date: Mon Nov 15 10:35:16 2021 -0800 selftests/sgx: Make data measurement for an enclave segment optional For a heap makes sense to leave its contents "unmeasured" in the SGX enclave build process, meaning that they won't contribute to the cryptographic signature (a RSA-3072 signed SHA56 hash) of the enclave. Enclaves are signed blobs where the signature is calculated both from page data and also from "structural properties" of the pages. For instance a page offset of *every* page added to the enclave is hashed. For data, this is optional, not least because hashing a page has a significant contribution to the enclave load time. Thus, where there is no reason to hash, do not. The SGX ioctl interface supports this with SGX_PAGE_MEASURE flag. Only when the flag is *set*, data is measured. Add seg->measure boolean flag to struct encl_segment. Only when the flag is set, include the segment data to the signature (represented by SIGSTRUCT architectural structure). Signed-off-by: Jarkko Sakkinen Signed-off-by: Reinette Chatre Signed-off-by: Dave Hansen Acked-by: Dave Hansen Link: https://lkml.kernel.org/r/625b6fe28fed76275e9238ec4e15ec3c0d87de81.1636997631.git.reinette.chatre@intel.com commit 39f62536be2f6160bba7294b5208e240d34703c3 Author: Jarkko Sakkinen Date: Mon Nov 15 10:35:15 2021 -0800 selftests/sgx: Assign source for each segment Define source per segment so that enclave pages can be added from different sources, e.g. anonymous VMA for zero pages. In other words, add 'src' field to struct encl_segment, and assign it to 'encl->src' for pages inherited from the enclave binary. Signed-off-by: Jarkko Sakkinen Signed-off-by: Reinette Chatre Signed-off-by: Dave Hansen Acked-by: Dave Hansen Link: https://lkml.kernel.org/r/7850709c3089fe20e4bcecb8295ba87c54cc2b4a.1636997631.git.reinette.chatre@intel.com commit 5064343fb155487362708bacc8c6ab9dc2c52bb8 Author: Sean Christopherson Date: Mon Nov 15 10:35:14 2021 -0800 selftests/sgx: Fix a benign linker warning The enclave binary (test_encl.elf) is built with only three sections (tcs, text, and data) as controlled by its custom linker script. If gcc is built with "--enable-linker-build-id" (this appears to be a common configuration even if it is by default off) then gcc will pass "--build-id" to the linker that will prompt it (the linker) to write unique bits identifying the linked file to a ".note.gnu.build-id" section. The section ".note.gnu.build-id" does not exist in the test enclave resulting in the following warning emitted by the linker: /usr/bin/ld: warning: .note.gnu.build-id section discarded, --build-id ignored The test enclave does not use the build id within the binary so fix the warning by passing a build id of "none" to the linker that will disable the setting from any earlier "--build-id" options and thus disable the attempt to write the build id to a ".note.gnu.build-id" section that does not exist. Link: https://lore.kernel.org/linux-sgx/20191017030340.18301-2-sean.j.christopherson@intel.com/ Suggested-by: Cedric Xing Signed-off-by: Sean Christopherson Signed-off-by: Reinette Chatre Signed-off-by: Dave Hansen Reviewed-by: Jarkko Sakkinen Acked-by: Dave Hansen Link: https://lkml.kernel.org/r/ca0f8a81fc1e78af9bdbc6a88e0f9c37d82e53f2.1636997631.git.reinette.chatre@intel.com commit 18c3933c1983157df9dc06d4f3bfc764f161ed7a Author: Brijesh Singh Date: Wed Nov 10 16:06:50 2021 -0600 x86/sev: Shorten GHCB terminate macro names Shorten macro names for improved readability. Suggested-by: Borislav Petkov Signed-off-by: Brijesh Singh Signed-off-by: Borislav Petkov Reviewed-by: Venu Busireddy Link: https://lkml.kernel.org/r/20211110220731.2396491-5-brijesh.singh@amd.com commit 5b59289bfdbe287d0756e5ccadf039329147de67 Author: Peter Ujfalusi Date: Tue Nov 2 11:47:56 2021 +0200 ASoC: SOF: core: Unregister machine driver before IPC and debugfs To ensure clean unload of the machine driver, components and topology, do the unregister before we free IPC and debugfs. It is a possibility that part of the unregister we would have IPC communication with the firmware. Suggested-by: Pierre-Louis Bossart Signed-off-by: Peter Ujfalusi Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/20211102094756.9317-1-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 5dbec393cd23ecfdeddced217f8a1c11228139c4 Author: Maíra Canal Date: Sun Oct 24 15:42:07 2021 -0300 ASoC: adau1701: Replace legacy gpio interface for gpiod Considering the current transition of the GPIO subsystem, remove all dependencies of the legacy GPIO interface (linux/gpio.h and linux /of_gpio.h) and replace it with the descriptor-based GPIO approach. Signed-off-by: Maíra Canal Link: https://lore.kernel.org/r/YXWo/9o7ye9a11aR@fedora Signed-off-by: Mark Brown commit 749303055b78bc38ec0790ccc596cae235446367 Author: Simon Trimmer Date: Mon Nov 15 12:02:15 2021 +0000 firmware: cs_dsp: tidy includes in cs_dsp.c and cs_dsp.h This patch removes unused included header files and moves others into cs_dsp.h to ensure that types referenced in the header file are properly described to prevent compiler warnings. Signed-off-by: Simon Trimmer Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20211115120215.56824-1-simont@opensource.cirrus.com Signed-off-by: Mark Brown commit 7ec4a058c16f3da9c2c0c66506f45c083198ed30 Author: Richard Fitzgerald Date: Mon Nov 1 10:10:06 2021 +0000 ASoC: cs42l42: Add control for audio slow-start switch This adds an ALSA control so that the slow-start audio ramp feature can be disabled. This is useful for high-definition audio applications. The register field is unusual in that it is a 3-bit field with only two valid values, 000=off and 111=on. Signed-off-by: Richard Fitzgerald Link: https://lore.kernel.org/r/20211101101006.13092-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit 8d0872f6239f9d067d538d8368bdec643bb0d255 Author: Mac Chiang Date: Tue Nov 9 08:38:08 2021 -0500 ASoC: Intel: add sof-nau8825 machine driver The machine driver is a generic machine driver for SOF with nau8825 codec w or w/o speaker additionally. Depending on the SOC HDMI, DMIC, Bluetooth offload support are added dynamically. Only add information related to SOF since the machine driver was only tested with SOF. There are currently 4 i2s machine variants of ADL. This supports the headphone NUA8825(SSP0) alone or with smart or dumb speakers. Board 2,3,4 use SSP2 for Bluetooth offload support except board 1. Board 1 : NAU8825 + RT1019P(SSP2) Board 2 : NAU8825 + MAX98373(SSP1) Board 3 : NAU8825 + MAX98360A(SSP1) Board 4 : NAU8825 Signed-off-by: David Lin Co-developed-by: Mac Chiang Signed-off-by: Mac Chiang Acked-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20211109133808.8729-1-mac.chiang@intel.com Signed-off-by: Mark Brown commit 95cead06866a95baf0f8355bba81a8142d5908cf Author: Christophe JAILLET Date: Wed Nov 3 20:19:27 2021 +0100 ASoC: codecs: Axe some dead code in 'wcd_mbhc_adc_hs_rem_irq()' 'hphpa_on' is know to be false, so this is just dead code that should be removed. Suggested-by: Srinivas Kandagatla Signed-off-by: Christophe JAILLET Reviewed-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/57a89cc31eb2312addd3c77896d7df8206aef138.1635967035.git.christophe.jaillet@wanadoo.fr Signed-off-by: Mark Brown commit bae9e13fc55cbc5ae25409385b2f1ba9187082d0 Author: David Rhodes Date: Fri Oct 29 16:40:28 2021 -0500 ASoC: cs35l41: DSP Support Support for HALO DSP and firmware Signed-off-by: David Rhodes Reviewed-by: Charles Keepax Link: https://lore.kernel.org/r/20211029214028.401284-2-drhodes@opensource.cirrus.com Signed-off-by: Mark Brown commit 0f9710603e803ae9b64ed3b54019170b323968d7 Author: Richard Fitzgerald Date: Thu Oct 28 15:09:02 2021 +0100 ASoC: dt-bindings: cs42l42: Convert binding to yaml Replace the old .txt binding with a new schema binding. At the same time, some of the descriptions are updated to make them clearer, fix errors, or just make them fit better into the style of schema binding. The cirrus,hs-bias-ramp-rate property was missing from the old .txt binding and has been added to the yaml. Signed-off-by: Richard Fitzgerald Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211028140902.11786-4-rf@opensource.cirrus.com Signed-off-by: Mark Brown commit 0c61ac2786ff0c355c2eeaa884ef9d75a969eaff Merge: a4832f80271b1 296c789ce1e50 Author: Mark Brown Date: Mon Nov 15 19:23:56 2021 +0000 Merge series "ASoC: Intel: sof_sdw: Use fixed DAI link id" from Bard Liao : This series provides a way to use constant dailink numbers for different devices. So that we don't need to renumber them in topologies. Some patches with different purpose are sent together in this series since they are dependent. Bard Liao (8): ASoC: intel: sof_sdw: return the original error number ASoC: intel: sof_sdw: rename be_index/link_id to link_index ASoC: intel: sof_sdw: Use a fixed DAI link id for AMP ASoC: intel: sof_sdw: move DMIC link id overwrite to create_sdw_dailink ASoC: intel: sof_sdw: remove SOF_RT715_DAI_ID_FIX quirk ASoC: intel: sof_sdw: remove sof_sdw_mic_codec_mockup_init ASoC: intel: sof_sdw: remove get_next_be_id ASoC: intel: sof_sdw: add link adr order check Pierre-Louis Bossart (2): ASoC: Intel: sof_sdw: fix jack detection on HP Spectre x360 convertible ASoC: Intel: sof_sdw: add SKU for Dell Latitude 9520 sound/soc/intel/boards/sof_sdw.c | 152 ++++++++++---------- sound/soc/intel/boards/sof_sdw_common.h | 7 +- sound/soc/intel/boards/sof_sdw_rt715.c | 7 - sound/soc/intel/boards/sof_sdw_rt715_sdca.c | 7 - 4 files changed, 85 insertions(+), 88 deletions(-) -- 2.17.1 commit a4832f80271b123ae08855aea1344d0fd446f8c9 Merge: 48b5b6a560025 9da52c39b33e7 Author: Mark Brown Date: Mon Nov 15 19:23:54 2021 +0000 Merge series "Add tfa9897 rcv-gpios support" from Vincent Knecht : This is the continuation of a previous series [1] where - patch 1/4 is removed in favor of using pin switch This will be posted independently of tfa989x support, since it mainly require changes to sound/soc/qcom/common.c and device DTS. - patch 2/4 is already merged so here are reworked patch 3/4 (bindings fixed and example added) and patch 4/4 unchanged. [1] https://patchwork.kernel.org/project/alsa-devel/cover/20211024085840.1536438-1-vincent.knecht@mailoo.org/ Vincent Knecht (2): ASoC: dt-bindings: nxp, tfa989x: Add rcv-gpios property for tfa9897 ASoC: codecs: tfa989x: Add support for tfa9897 optional rcv-gpios .../bindings/sound/nxp,tfa989x.yaml | 41 +++++++++++++++++++ sound/soc/codecs/tfa989x.c | 20 ++++++++- 2 files changed, 60 insertions(+), 1 deletion(-) -- 2.31.1 commit 3ad6fd77a2d62e8f4465b429b65805eaf88e1b9e Author: Tony Luck Date: Tue Oct 26 15:00:50 2021 -0700 x86/sgx: Add check for SGX pages to ghes_do_memory_failure() SGX EPC pages do not have a "struct page" associated with them so the pfn_valid() sanity check fails and results in a warning message to the console. Add an additional check to skip the warning if the address of the error is in an SGX EPC page. Signed-off-by: Tony Luck Signed-off-by: Dave Hansen Reviewed-by: Jarkko Sakkinen Tested-by: Reinette Chatre Link: https://lkml.kernel.org/r/20211026220050.697075-8-tony.luck@intel.com commit c6acb1e7bf4656b9434335c72b8245cc84575fde Author: Tony Luck Date: Tue Oct 26 15:00:49 2021 -0700 x86/sgx: Add hook to error injection address validation SGX reserved memory does not appear in the standard address maps. Add hook to call into the SGX code to check if an address is located in SGX memory. There are other challenges in injecting errors into SGX. Update the documentation with a sequence of operations to inject. Signed-off-by: Tony Luck Signed-off-by: Dave Hansen Reviewed-by: Jarkko Sakkinen Tested-by: Reinette Chatre Link: https://lkml.kernel.org/r/20211026220050.697075-7-tony.luck@intel.com commit 03b122da74b22fbe7cd98184fa5657a9ce13970c Author: Tony Luck Date: Tue Oct 26 15:00:48 2021 -0700 x86/sgx: Hook arch_memory_failure() into mainline code Add a call inside memory_failure() to call the arch specific code to check if the address is an SGX EPC page and handle it. Note the SGX EPC pages do not have a "struct page" entry, so the hook goes in at the same point as the device mapping hook. Pull the call to acquire the mutex earlier so the SGX errors are also protected. Make set_mce_nospec() skip SGX pages when trying to adjust the 1:1 map. Signed-off-by: Tony Luck Signed-off-by: Dave Hansen Reviewed-by: Jarkko Sakkinen Reviewed-by: Naoya Horiguchi Tested-by: Reinette Chatre Link: https://lkml.kernel.org/r/20211026220050.697075-6-tony.luck@intel.com commit a495cbdffa30558b34f3c95555cecc4fd9688039 Author: Tony Luck Date: Tue Oct 26 15:00:47 2021 -0700 x86/sgx: Add SGX infrastructure to recover from poison Provide a recovery function sgx_memory_failure(). If the poison was consumed synchronously then send a SIGBUS. Note that the virtual address of the access is not included with the SIGBUS as is the case for poison outside of SGX enclaves. This doesn't matter as addresses of code/data inside an enclave is of little to no use to code executing outside the (now dead) enclave. Poison found in a free page results in the page being moved from the free list to the per-node poison page list. Signed-off-by: Tony Luck Signed-off-by: Dave Hansen Reviewed-by: Jarkko Sakkinen Tested-by: Reinette Chatre Link: https://lkml.kernel.org/r/20211026220050.697075-5-tony.luck@intel.com commit 992801ae92431761b3d8ec88abd5793d154d34ac Author: Tony Luck Date: Tue Oct 26 15:00:46 2021 -0700 x86/sgx: Initial poison handling for dirty and free pages A memory controller patrol scrubber can report poison in a page that isn't currently being used. Add "poison" field in the sgx_epc_page that can be set for an sgx_epc_page. Check for it: 1) When sanitizing dirty pages 2) When freeing epc pages Poison is a new field separated from flags to avoid having to make all updates to flags atomic, or integrate poison state changes into some other locking scheme to protect flags (Currently just sgx_reclaimer_lock which protects the SGX_EPC_PAGE_RECLAIMER_TRACKED bit in page->flags). In both cases place the poisoned page on a per-node list of poisoned epc pages to make sure it will not be reallocated. Signed-off-by: Tony Luck Signed-off-by: Dave Hansen Reviewed-by: Jarkko Sakkinen Tested-by: Reinette Chatre Link: https://lkml.kernel.org/r/20211026220050.697075-4-tony.luck@intel.com commit 40e0e7843e23d164625b9031514f5672f8758bf4 Author: Tony Luck Date: Tue Oct 26 15:00:45 2021 -0700 x86/sgx: Add infrastructure to identify SGX EPC pages X86 machine check architecture reports a physical address when there is a memory error. Handling that error requires a method to determine whether the physical address reported is in any of the areas reserved for EPC pages by BIOS. SGX EPC pages do not have Linux "struct page" associated with them. Keep track of the mapping from ranges of EPC pages to the sections that contain them using an xarray. N.B. adds CONFIG_XARRAY_MULTI to the SGX dependecies. So "select" that in arch/x86/Kconfig for X86/SGX. Create a function arch_is_platform_page() that simply reports whether an address is an EPC page for use elsewhere in the kernel. The ACPI error injection code needs this function and is typically built as a module, so export it. Note that arch_is_platform_page() will be slower than other similar "what type is this page" functions that can simply check bits in the "struct page". If there is some future performance critical user of this function it may need to be implemented in a more efficient way. Note also that the current implementation of xarray allocates a few hundred kilobytes for this usage on a system with 4GB of SGX EPC memory configured. This isn't ideal, but worth it for the code simplicity. Signed-off-by: Tony Luck Signed-off-by: Dave Hansen Reviewed-by: Jarkko Sakkinen Tested-by: Reinette Chatre Link: https://lkml.kernel.org/r/20211026220050.697075-3-tony.luck@intel.com commit d6d261bded8a57aed4faa12d08a5b193418d3aa4 Author: Tony Luck Date: Tue Oct 26 15:00:44 2021 -0700 x86/sgx: Add new sgx_epc_page flag bit to mark free pages SGX EPC pages go through the following life cycle: DIRTY ---> FREE ---> IN-USE --\ ^ | \-----------------/ Recovery action for poison for a DIRTY or FREE page is simple. Just make sure never to allocate the page. IN-USE pages need some extra handling. Add a new flag bit SGX_EPC_PAGE_IS_FREE that is set when a page is added to a free list and cleared when the page is allocated. Notes: 1) These transitions are made while holding the node->lock so that future code that checks the flags while holding the node->lock can be sure that if the SGX_EPC_PAGE_IS_FREE bit is set, then the page is on the free list. 2) Initially while the pages are on the dirty list the SGX_EPC_PAGE_IS_FREE bit is cleared. Signed-off-by: Tony Luck Signed-off-by: Dave Hansen Reviewed-by: Jarkko Sakkinen Tested-by: Reinette Chatre Link: https://lkml.kernel.org/r/20211026220050.697075-2-tony.luck@intel.com commit 53989fad1286e652ea3655ae3367ba698da8d2ff Author: Dan Williams Date: Thu Nov 11 10:19:05 2021 -0800 cxl/pmem: Fix module reload vs workqueue state A test of the form: while true; do modprobe -r cxl_pmem; modprobe cxl_pmem; done May lead to a crash signature of the form: BUG: unable to handle page fault for address: ffffffffc0660030 #PF: supervisor instruction fetch in kernel mode #PF: error_code(0x0010) - not-present page [..] Workqueue: cxl_pmem 0xffffffffc0660030 RIP: 0010:0xffffffffc0660030 Code: Unable to access opcode bytes at RIP 0xffffffffc0660006. [..] Call Trace: ? process_one_work+0x4ec/0x9c0 ? pwq_dec_nr_in_flight+0x100/0x100 ? rwlock_bug.part.0+0x60/0x60 ? worker_thread+0x2eb/0x700 In that report the 0xffffffffc0660030 address corresponds to the former function address of cxl_nvb_update_state() from a previous load of the module, not the current address. Fix that by arranging for ->state_work in the 'struct cxl_nvdimm_bridge' object to be reinitialized on cxl_pmem module reload. Details: Recall that CXL subsystem wants to link a CXL memory expander device to an NVDIMM sub-hierarchy when both a persistent memory range has been registered by the CXL platform driver (cxl_acpi) *and* when that CXL memory expander has published persistent memory capacity (Get Partition Info). To this end the cxl_nvdimm_bridge driver arranges to rescan the CXL bus when either of those conditions change. The helper bus_rescan_devices() can not be called underneath the device_lock() for any device on that bus, so the cxl_nvdimm_bridge driver uses a workqueue for the rescan. Typically a driver allocates driver data to hold a 'struct work_struct' for a driven device, but for a workqueue that may run after ->remove() returns, driver data will have been freed. The 'struct cxl_nvdimm_bridge' object holds the state and work_struct directly. Unfortunately it was only arranging for that infrastructure to be initialized once per device creation rather than the necessary once per workqueue (cxl_pmem_wq) creation. Introduce is_cxl_nvdimm_bridge() and cxl_nvdimm_bridge_reset() in support of invalidating stale references to a recently destroyed cxl_pmem_wq. Cc: Fixes: 8fdcb1704f61 ("cxl/pmem: Add initial infrastructure for pmem support") Reported-by: Vishal Verma Tested-by: Vishal Verma Link: https://lore.kernel.org/r/163665474585.3505991.8397182770066720755.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit fd49f99c180996cef2d707ad71bee4f060dbe367 Author: Alison Schofield Date: Fri Oct 29 12:51:59 2021 -0700 ACPI: NUMA: Add a node and memblk for each CFMWS not in SRAT During NUMA init, CXL memory defined in the SRAT Memory Affinity subtable may be assigned to a NUMA node. Since there is no requirement that the SRAT be comprehensive for CXL memory another mechanism is needed to assign NUMA nodes to CXL memory not identified in the SRAT. Use the CXL Fixed Memory Window Structure (CFMWS) of the ACPI CXL Early Discovery Table (CEDT) to find all CXL memory ranges. Create a NUMA node for each CFMWS that is not already assigned to a NUMA node. Add a memblk attaching its host physical address range to the node. Note that these ranges may not actually map any memory at boot time. They may describe persistent capacity or may be present to enable hot-plug. Consumers can use phys_to_target_node() to discover the NUMA node. Signed-off-by: Alison Schofield Acked-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/163553711933.2509508.2203471175679990.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit 814dff9ae234d70003b8733a637fec621c90f0bc Author: Dan Williams Date: Fri Oct 29 12:51:53 2021 -0700 cxl/test: Mock acpi_table_parse_cedt() Now that cxl_acpi has been converted to use the core ACPI CEDT sub-table parser, update cxl_test to inject CFMWS and CHBS data directly into cxl_acpi's handlers. Cc: Alison Schofield Acked-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/163553711363.2509508.17428994087868269952.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit f4ce1f766f1ebf39161b3b9447a83f4f1dfe593b Author: Dan Williams Date: Fri Oct 29 12:51:48 2021 -0700 cxl/acpi: Convert CFMWS parsing to ACPI sub-table helpers The cxl_acpi driver originally open-coded its table parsing since the ACPI subtable helpers were marked __init and only used in early NUMA initialization. Now that those helpers have been exported for driver usage replace the open-coded solution with the common one. Cc: Alison Schofield Acked-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/163553710810.2509508.14686373989517930921.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit 2d03e46a4bad20191d07b83ec1242d5f002577be Author: Dan Williams Date: Fri Oct 29 12:51:42 2021 -0700 ACPI: Add a context argument for table parsing handlers In preparation for drivers reusing the core table parsing infrastructure, arrange for handlers to take a context argument. This allows driver table parsing to wrap ACPI table entries in driver-specific data. The first consumer of this infrastructure is the CEDT parsing that happens in the cxl_acpi driver, add a conditional (CONFIG_ACPI_TABLE_LIB=y) export of a acpi_table_parse_cedt() helper for this case. Cc: "Rafael J. Wysocki" Cc: Len Brown Tested-by: Alison Schofield Reviewed-by: Alison Schofield Acked-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/163553710257.2509508.14310494417463866020.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit ad2f63971e9655e3987db32dac85aa50658790eb Author: Dan Williams Date: Fri Oct 29 12:51:37 2021 -0700 ACPI: Teach ACPI table parsing about the CEDT header format The CEDT adds yet one more unique subtable header type where the length is a 16-bit value. Extend the subtable helpers to detect this scenario. Cc: "Rafael J. Wysocki" Cc: Len Brown Tested-by: Alison Schofield Reviewed-by: Alison Schofield Acked-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/163553709742.2509508.5177761945441327574.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit f64bd790b750dd281406964af40d16adfc88a074 Author: Dan Williams Date: Fri Oct 29 12:51:32 2021 -0700 ACPI: Keep sub-table parsing infrastructure available for modules The NFIT driver and now the CXL ACPI driver have both open-coded ACPI table parsing. Before another instance is added arrange for the core ACPI sub-table parsing to be optionally available to drivers via the CONFIG_ACPI_TABLE_LIB symbol. If no drivers select the symbol then the infrastructure reverts back to being tagged __init via the __init_or_acpilib annotation. For now, only tag the core sub-table routines and data that the CEDT parsing in the cxl_acpi driver would want to reuse, a CEDT parsing helper is added in a later change. Cc: "Rafael J. Wysocki" Cc: Len Brown Cc: Alison Schofield Acked-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/163553709227.2509508.8215196520233473814.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit 09eac2ca988a866225a174212765f77c85702206 Author: Vishal Verma Date: Sun Oct 17 23:12:51 2021 -0600 tools/testing/cxl: add mock output for the GET_HEALTH_INFO command Add mocked health information for cxl_test memdevs. This allows cxl-cli's 'list' command to display the canned health_info fields. Cc: Dan Williams Reviewed-by: Jonathan Cameron Signed-off-by: Vishal Verma Link: https://lore.kernel.org/r/20211018051251.2289112-1-vishal.l.verma@intel.com Signed-off-by: Dan Williams commit a91bd78967c49b43d2835695c7b53b11170c98f4 Author: Ira Weiny Date: Wed Nov 3 16:48:57 2021 -0700 cxl/memdev: Remove unused cxlmd field This field was left over when the connection between the cxl_memdev and cxl_mem was tighter. It is no longer set nor used so remove it.[1] Link: https://lore.kernel.org/r/CAPcyv4hcgh2gb8qsS_UXTBSGqYfMPnC6p5kkvNUjm+V6kVKM5g@mail.gmail.com/ Suggested-by: Jonathan.Cameron@huawei.com Signed-off-by: Ira Weiny Link: https://lore.kernel.org/r/20211103234857.3689354-1-ira.weiny@intel.com Signed-off-by: Dan Williams commit affec782742e08a7469ef81d7d0a4ae9d1345dfd Author: Dan Williams Date: Fri Nov 12 16:32:58 2021 -0800 cxl/core: Convert to EXPORT_SYMBOL_NS_GPL It turns out that the usb example of specifying the subsystem namespace at build time is not preferred. The rationale for that preference has become more apparent as CXL patches with plain EXPORT_SYMBOL_GPL beg the question, "why would any code other than CXL care about this symbol?". Make the namespace explicit. Reviewed-by: Jonathan Cameron Link: https://lore.kernel.org/r/163676356810.3618264.601632777702192938.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit 5e2411ae8071612396cd25017e29f9ce0662a5ff Author: Ira Weiny Date: Tue Nov 2 13:29:01 2021 -0700 cxl/memdev: Change cxl_mem to a more descriptive name The 'struct cxl_mem' object actually represents the state of a CXL device within the driver. Comments indicating that 'struct cxl_mem' is a device itself are incorrect. It is data layered on top of a CXL Memory Expander class device. Rename it 'struct cxl_dev_state'. The 'struct' cxl_memdev' structure represents a Linux CXL memory device object, and it uses services and information provided by 'struct cxl_dev_state'. Update the structure name, function names, and the kdocs to reflect the real uses of this structure. Some helper functions that were previously prefixed "cxl_mem_" are renamed to just "cxl_". Acked-by: Ben Widawsky Signed-off-by: Ira Weiny Link: https://lore.kernel.org/r/20211102202901.3675568-3-ira.weiny@intel.com Signed-off-by: Dan Williams commit 888e034a74f41643dee6a8142c98946b8be00bf0 Author: Ira Weiny Date: Tue Nov 2 13:29:00 2021 -0700 cxl/mbox: Remove bad comment __cxl_mem_mbox_send_cmd() no longer exists. Remove the reference. Acked-by: Ben Widawsky Signed-off-by: Ira Weiny Link: https://lore.kernel.org/r/20211102202901.3675568-2-ira.weiny@intel.com Signed-off-by: Dan Williams commit 08b9e0ab8af48895337192e683de44ab1e1b7427 Author: Dan Williams Date: Fri Oct 29 12:55:47 2021 -0700 cxl/pmem: Fix reference counting for delayed work There is a potential race between queue_work() returning and the queued-work running that could result in put_device() running before get_device(). Introduce the cxl_nvdimm_bridge_state_work() helper that takes the reference unconditionally, but drops it if no new work was queued, to keep the references balanced. Fixes: 8fdcb1704f61 ("cxl/pmem: Add initial infrastructure for pmem support") Cc: Reviewed-by: Jonathan Cameron Reviewed-by: Ben Widawsky Link: https://lore.kernel.org/r/163553734757.2509761.3305231863616785470.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams commit fac73543fff0ff23622c98879c66d069778c114a Author: Matt Roper Date: Fri Nov 12 08:01:07 2021 -0800 drm/i915: Don't read query SSEU for non-existent slice 0 on old platforms Pre-HSW platforms don't use the gt SSEU structures; this means that calling intel_sseu_get_subslices() on slice 0 for these platforms will trip a GEM_BUG_ON(slice >= sseu->max_slices) warning. Let's move the DSS lookup for a DG2 workaround into a helper function that will only get called after we've already decided that we're on a DG2 platform. Fixes: 645cc0b9d972 ("drm/i915/dg2: Add initial gt/ctx/engine workarounds") Signed-off-by: Matt Roper Reviewed-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20211112160107.1593906-1-matthew.d.roper@intel.com commit f5029f62d9ba9b99fd712514784f91f920a63d21 Author: Wan Jiabing Date: Fri Oct 15 02:49:23 2021 -0400 soc: bcm: brcmstb: Add of_node_put() in pm-mips Fix following coccicheck warning: ./drivers/soc/bcm/brcmstb/pm/pm-mips.c:404:1-23: WARNING: Function for_each_matching_node should have of_node_put() before goto or break Early exits from for_each_matching_node should decrement the node reference counter. Signed-off-by: Wan Jiabing Signed-off-by: Florian Fainelli commit d0e68d354f345873e15876a7b35be1baaf5e3ec9 Author: Rafał Miłecki Date: Fri Nov 5 11:14:13 2021 +0100 arm64: dts: broadcom: bcm4908: add DT for Netgear RAXE500 It's a home router based on BCM4908 SoC. It has: 1 GiB of RAM, 512 MiB NAND flash, 6 Ethernet ports and 3 x BCM43684 (WiFi). One of Ethernet ports is "2.5 G Multi-Gig port" that isn't described yet (it isn't known how it's wired up). Signed-off-by: Rafał Miłecki Signed-off-by: Florian Fainelli commit 92c44605381418b01af44c63fd27185cac368866 Author: Alexander Aring Date: Mon Nov 15 08:57:06 2021 -0500 fs: dlm: replace use of socket sk_callback_lock with sock_lock This patch will replace the use of socket sk_callback_lock lock and uses socket lock instead. Some users like sunrpc, see commit ea9afca88bbe ("SUNRPC: Replace use of socket sk_callback_lock with sock_lock") moving from sk_callback_lock to sock_lock which seems to be held when the socket callbacks are called. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 4c3d90570bcc2b338f70f61f01110268e281ca3c Author: Alexander Aring Date: Mon Nov 15 08:57:05 2021 -0500 fs: dlm: don't call kernel_getpeername() in error_report() In some cases kernel_getpeername() will held the socket lock which is already held when the socket layer calls error_report() callback. Since commit 9dfc685e0262 ("inet: remove races in inet{6}_getname()") this problem becomes more likely because the socket lock will be held always. You will see something like: bob9-u5 login: [ 562.316860] BUG: spinlock recursion on CPU#7, swapper/7/0 [ 562.318562] lock: 0xffff8f2284720088, .magic: dead4ead, .owner: swapper/7/0, .owner_cpu: 7 [ 562.319522] CPU: 7 PID: 0 Comm: swapper/7 Not tainted 5.15.0+ #135 [ 562.320346] Hardware name: Red Hat KVM/RHEL-AV, BIOS 1.13.0-2.module+el8.3.0+7353+9de0a3cc 04/01/2014 [ 562.321277] Call Trace: [ 562.321529] [ 562.321734] dump_stack_lvl+0x33/0x42 [ 562.322282] do_raw_spin_lock+0x8b/0xc0 [ 562.322674] lock_sock_nested+0x1e/0x50 [ 562.323057] inet_getname+0x39/0x110 [ 562.323425] ? sock_def_readable+0x80/0x80 [ 562.323838] lowcomms_error_report+0x63/0x260 [dlm] [ 562.324338] ? wait_for_completion_interruptible_timeout+0xd2/0x120 [ 562.324949] ? lock_timer_base+0x67/0x80 [ 562.325330] ? do_raw_spin_unlock+0x49/0xc0 [ 562.325735] ? _raw_spin_unlock_irqrestore+0x1e/0x40 [ 562.326218] ? del_timer+0x54/0x80 [ 562.326549] sk_error_report+0x12/0x70 [ 562.326919] tcp_validate_incoming+0x3c8/0x530 [ 562.327347] ? kvm_clock_read+0x14/0x30 [ 562.327718] ? ktime_get+0x3b/0xa0 [ 562.328055] tcp_rcv_established+0x121/0x660 [ 562.328466] tcp_v4_do_rcv+0x132/0x260 [ 562.328835] tcp_v4_rcv+0xcea/0xe20 [ 562.329173] ip_protocol_deliver_rcu+0x35/0x1f0 [ 562.329615] ip_local_deliver_finish+0x54/0x60 [ 562.330050] ip_local_deliver+0xf7/0x110 [ 562.330431] ? inet_rtm_getroute+0x211/0x840 [ 562.330848] ? ip_protocol_deliver_rcu+0x1f0/0x1f0 [ 562.331310] ip_rcv+0xe1/0xf0 [ 562.331603] ? ip_local_deliver+0x110/0x110 [ 562.332011] __netif_receive_skb_core+0x46a/0x1040 [ 562.332476] ? inet_gro_receive+0x263/0x2e0 [ 562.332885] __netif_receive_skb_list_core+0x13b/0x2c0 [ 562.333383] netif_receive_skb_list_internal+0x1c8/0x2f0 [ 562.333896] ? update_load_avg+0x7e/0x5e0 [ 562.334285] gro_normal_list.part.149+0x19/0x40 [ 562.334722] napi_complete_done+0x67/0x160 [ 562.335134] virtnet_poll+0x2ad/0x408 [virtio_net] [ 562.335644] __napi_poll+0x28/0x140 [ 562.336012] net_rx_action+0x23d/0x300 [ 562.336414] __do_softirq+0xf2/0x2ea [ 562.336803] irq_exit_rcu+0xc1/0xf0 [ 562.337173] common_interrupt+0xb9/0xd0 It is and was always forbidden to call kernel_getpeername() in context of error_report(). To get rid of the problem we access the destination address for the peer over the socket structure. While on it we fix to print out the destination port of the inet socket. Fixes: 1a31833d085a ("DLM: Replace nodeid_to_addr with kernel_getpeername") Reported-by: Bob Peterson Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit d5e781a2e50fefbcde81f10e0e9e2669fadc9b01 Author: Jani Nikula Date: Mon Nov 15 16:05:49 2021 +0200 drm/i915/fbc: fix the FBC kernel-doc warnings Fix the recently introduced 'make htmldocs' warnings: $ make htmldocs 2>&1 > /dev/null | grep i915 ./drivers/gpu/drm/i915/display/intel_fbc.c:635: warning: Excess function parameter 'i915' description in 'intel_fbc_is_active' ./drivers/gpu/drm/i915/display/intel_fbc.c:1638: warning: Excess function parameter 'i915' description in 'intel_fbc_handle_fifo_underrun_irq' ./drivers/gpu/drm/i915/display/intel_fbc.c:635: warning: Function parameter or member 'fbc' not described in 'intel_fbc_is_active' ./drivers/gpu/drm/i915/display/intel_fbc.c:635: warning: Excess function parameter 'i915' description in 'intel_fbc_is_active' ./drivers/gpu/drm/i915/display/intel_fbc.c:1638: warning: Function parameter or member 'fbc' not described in 'intel_fbc_handle_fifo_underrun_irq' ./drivers/gpu/drm/i915/display/intel_fbc.c:1638: warning: Excess function parameter 'i915' description in 'intel_fbc_handle_fifo_underrun_irq' Fixes: e49a656b924e ("drm/i915/fbc: Start passing around intel_fbc") Cc: Ville Syrjälä Signed-off-by: Jani Nikula Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211115140549.27629-1-jani.nikula@intel.com commit 7b0c9ca7f18e8d2e2cf3c342d91f037d436777bf Author: Rafał Miłecki Date: Fri Nov 5 11:14:12 2021 +0100 dt-bindings: arm: bcm: document Netgear RAXE500 binding One more BCM4908 based device. Signed-off-by: Rafał Miłecki Acked-by: Rob Herring Signed-off-by: Florian Fainelli commit 31fd9b79dc580301c53a001482755ba7e88c2809 Author: Rafał Miłecki Date: Fri Oct 29 18:05:23 2021 +0200 ARM: dts: BCM5301X: update CRU block description This describes CRU in a way matching documentation and fixes: arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dt.yaml: cru@100: $nodename:0: 'cru@100' does not match '^([a-z][a-z0-9\\-]+-bus|bus|soc|axi|ahb|apb)(@[0-9a-f]+)?$' From schema: /lib/python3.6/site-packages/dtschema/schemas/simple-bus.yaml Signed-off-by: Rafał Miłecki Signed-off-by: Florian Fainelli commit de7880016665afe7fa7d40e1fafa859260d53ba1 Author: Christian Lamparter Date: Thu Oct 28 09:03:44 2021 +0200 ARM: BCM53016: MR32: convert to Broadcom iProc I2C Driver replaces the bit-banged i2c-gpio provided i2c functionality with the hardware in the SoC. During review of the MR32, Florian Fainelli pointed out that the SoC has a real I2C-controller. Furthermore, the connected pins (SDA and SCL) would line up perfectly for use. Back then I couldn't get it working though and I left it with i2c-gpio (which worked). Now we know the reason: the interrupt was incorrectly specified. (Hence, this patch depends on Florian Fainelli's "ARM: dts: BCM5301X: Fix I2C controller interrupt" patch). Cc: Florian Fainelli Cc: Rafał Miłecki Cc: Matthew Hagan Signed-off-by: Christian Lamparter Signed-off-by: Florian Fainelli commit 3d2d52a0d1835b56f6bd67d268f6c39df0e41692 Author: Arınç ÜNAL Date: Wed Oct 27 00:57:06 2021 +0800 ARM: dts: BCM5301X: define RTL8365MB switch on Asus RT-AC88U Define the Realtek RTL8365MB switch without interrupt support on the device tree of Asus RT-AC88U. Signed-off-by: Arınç ÜNAL Acked-by: Alvin Šipraga Signed-off-by: Florian Fainelli commit 8c9f00d4b05134164e462f27b21c8295255ffa64 Author: Arınç ÜNAL Date: Wed Oct 27 00:57:03 2021 +0800 ARM: dts: BCM5301X: remove unnecessary address & size cells from Asus RT-AC88U Remove the unnecessary #address-cells & #size-cells in the gpio-keys node from the device tree of Asus RT-AC88U. Signed-off-by: Arınç ÜNAL Signed-off-by: Florian Fainelli commit 5f9cfe9e94a6eef576f89bbf5a946f8ae63c0f71 Author: Matthew Hagan Date: Fri Oct 15 23:50:22 2021 +0100 ARM: dts: NSP: MX65: add qca8k falling-edge, PLL properties This patch enables two properties for the QCA8337 switches on the MX65. Set the SGMII transmit clock to falling edge "qca,sgmii-txclk-falling-edge" to conform to the OEM configuration [1]. The new explicit PLL enable option "qca,sgmii-enable-pll" is required [2]. [1] https://git.kernel.org/netdev/net-next/c/6c43809bf1be [2] https://git.kernel.org/netdev/net-next/c/bbc4799e8bb6 Signed-off-by: Matthew Hagan Signed-off-by: Florian Fainelli commit 7e78153aef7f9efcb935487402151de31e0836ad Author: Jani Nikula Date: Mon Nov 15 13:53:13 2021 +0200 agp/intel-gtt: reduce intel-gtt dependencies more Don't include stuff on behalf of users if they're not strictly necessary for the header. Cc: Andy Shevchenko Signed-off-by: Jani Nikula Acked-by: Daniel Vetter Acked-by: Andy Shevchenko Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/7bcaa1684587b9b008d3c41468fb40e63c54fbc7.1636977089.git.jani.nikula@intel.com commit ce6838afc9244171cd07620bbb82e18695c491e9 Author: Andy Shevchenko Date: Mon Nov 15 13:53:12 2021 +0200 agp/intel-gtt: Replace kernel.h with the necessary inclusions When kernel.h is used in the headers it adds a lot into dependency hell, especially when there are circular dependencies are involved. Replace kernel.h inclusion with the list of what is really being used. Signed-off-by: Andy Shevchenko Signed-off-by: Jani Nikula Acked-by: Daniel Vetter Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/4d6a976459547407979f4b4c05a52785523e6bd8.1636977089.git.jani.nikula@intel.com commit dd54575a83d85c031d9c1c4a78607ec3c95696ac Author: Jani Nikula Date: Mon Nov 15 13:53:11 2021 +0200 drm/i915: include intel-gtt.h only where needed Only intel_gt.c and intel_ggtt.c need the interface. Cc: Andy Shevchenko Signed-off-by: Jani Nikula Acked-by: Daniel Vetter Acked-by: Andy Shevchenko Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/034f57db24d6936ac2e4e6830261d791240cdd79.1636977089.git.jani.nikula@intel.com commit a5bdc36354cbf1a1a91396f4da548ff484686305 Merge: 2f6a470d65458 e5043894b21f7 Author: Jakub Kicinski Date: Mon Nov 15 08:49:20 2021 -0800 Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next Daniel Borkmann says: ==================== pull-request: bpf-next 2021-11-15 We've added 72 non-merge commits during the last 13 day(s) which contain a total of 171 files changed, 2728 insertions(+), 1143 deletions(-). The main changes are: 1) Add btf_type_tag attributes to bring kernel annotations like __user/__rcu to BTF such that BPF verifier will be able to detect misuse, from Yonghong Song. 2) Big batch of libbpf improvements including various fixes, future proofing APIs, and adding a unified, OPTS-based bpf_prog_load() low-level API, from Andrii Nakryiko. 3) Add ingress_ifindex to BPF_SK_LOOKUP program type for selectively applying the programmable socket lookup logic to packets from a given netdev, from Mark Pashmfouroush. 4) Remove the 128M upper JIT limit for BPF programs on arm64 and add selftest to ensure exception handling still works, from Russell King and Alan Maguire. 5) Add a new bpf_find_vma() helper for tracing to map an address to the backing file such as shared library, from Song Liu. 6) Batch of various misc fixes to bpftool, fixing a memory leak in BPF program dump, updating documentation and bash-completion among others, from Quentin Monnet. 7) Deprecate libbpf bpf_program__get_prog_info_linear() API and migrate its users as the API is heavily tailored around perf and is non-generic, from Dave Marchevsky. 8) Enable libbpf's strict mode by default in bpftool and add a --legacy option as an opt-out for more relaxed BPF program requirements, from Stanislav Fomichev. 9) Fix bpftool to use libbpf_get_error() to check for errors, from Hengqi Chen. * https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next: (72 commits) bpftool: Use libbpf_get_error() to check error bpftool: Fix mixed indentation in documentation bpftool: Update the lists of names for maps and prog-attach types bpftool: Fix indent in option lists in the documentation bpftool: Remove inclusion of utilities.mak from Makefiles bpftool: Fix memory leak in prog_dump() selftests/bpf: Fix a tautological-constant-out-of-range-compare compiler warning selftests/bpf: Fix an unused-but-set-variable compiler warning bpf: Introduce btf_tracing_ids bpf: Extend BTF_ID_LIST_GLOBAL with parameter for number of IDs bpftool: Enable libbpf's strict mode by default docs/bpf: Update documentation for BTF_KIND_TYPE_TAG support selftests/bpf: Clarify llvm dependency with btf_tag selftest selftests/bpf: Add a C test for btf_type_tag selftests/bpf: Rename progs/tag.c to progs/btf_decl_tag.c selftests/bpf: Test BTF_KIND_DECL_TAG for deduplication selftests/bpf: Add BTF_KIND_TYPE_TAG unit tests selftests/bpf: Test libbpf API function btf__add_type_tag() bpftool: Support BTF_KIND_TYPE_TAG libbpf: Support BTF_KIND_TYPE_TAG ... ==================== Link: https://lore.kernel.org/r/20211115162008.25916-1-daniel@iogearbox.net Signed-off-by: Jakub Kicinski commit aa67bacb482ae66bdb18b78ddccf7b9180441588 Author: Luca Weiss Date: Sun Oct 24 10:45:35 2021 +0200 arm: dts: mt6589: Add device tree for Fairphone 1 Add rudimentary support for the Fairphone 1, based on MT6589 to boot to UART console. The recently added SMP support needs to be disabled for this board as the kernel panics executing /init with it, even though the CPUs seem to start up fine - maybe a stability issue. [ 0.072010] smp: Bringing up secondary CPUs ... [ 0.131888] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001 [ 0.191889] CPU2: thread -1, cpu 2, socket 0, mpidr 80000002 [ 0.251890] CPU3: thread -1, cpu 3, socket 0, mpidr 80000003 [ 0.251982] smp: Brought up 1 node, 4 CPUs [ 0.254745] SMP: Total of 4 processors activated (7982.28 BogoMIPS). [ 0.255582] CPU: All CPU(s) started in SVC mode. [ 0.472039] Run /init as init process [ 0.473317] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000004 Signed-off-by: Luca Weiss Link: https://lore.kernel.org/r/20211024084535.30959-1-luca@z3ntu.xyz Signed-off-by: Matthias Brugger commit 5ebea8244afb6ad50108f0550baae7954c0af538 Author: Guo Ren Date: Wed Nov 3 10:09:21 2021 +0800 dt-bindings: vendor-prefixes: add T-Head Semiconductor Add vendor prefix for T-Head Semiconductor [1] [2] [1] https://github.com/T-head-Semi [2] https://www.t-head.cn/ Signed-off-by: Guo Ren Cc: Rob Herring Cc: Rob Herring Cc: devicetree Link: https://lore.kernel.org/r/20211103020921.3870764-1-guoren@kernel.org Signed-off-by: Rob Herring commit 2f6a470d6545841cf1891b87e360d3998ef024c8 Author: Jakub Kicinski Date: Mon Nov 15 07:49:46 2021 -0800 Revert "Merge branch 'mctp-i2c-driver'" This reverts commit 71812af7234f30362b43ccff33f93890ae4c0655, reversing changes made to cc0be1ad686fb29a4d127948486f40b17fb34b50. Wolfram Sang says: Please revert. Besides the driver in net, it modifies the I2C core code. This has not been acked by the I2C maintainer (in this case me). So, please don't pull this in via the net tree. The question raised here (extending SMBus calls to 255 byte) is complicated because we need ABI backwards compatibility. Link: https://lore.kernel.org/all/YZJ9H4eM%2FM7OXVN0@shikoro/ Signed-off-by: Jakub Kicinski commit 6d3b1b069946e8a9dbb5e6ea45c3aeee1d56ea44 Merge: 5cf46d8e741f3 5038ffea0c6c9 Author: David S. Miller Date: Mon Nov 15 14:31:00 2021 +0000 Merge branch 'generic-phylink-validation' Russell King says: ==================== introduce generic phylink validation The various validate method implementations we have in phylink users have been quite repetitive but also prone to bugs. These patches introduce a generic implementation which relies solely on the supported_interfaces bitmap introduced during last cycle, and in the first patch, a bit array of MAC capabilities. MAC drivers are free to continue to do their own thing if they have special requirements - such as mvneta and mvpp2 which do not support 1000base-X without AN enabled. Most implementations currently in the kernel can be converted to call phylink_generic_validate() directly from the phylink MAC operations structure once they fill in the supported_interfaces and mac_capabilities members of phylink_config. This series introduces the generic implementation, and converts mvneta and mvpp2 to use it. ==================== Signed-off-by: David S. Miller commit 5038ffea0c6c9476f1a8288b112609ac5a49f51b Author: Russell King (Oracle) Date: Mon Nov 15 10:00:37 2021 +0000 net: mvpp2: use phylink_generic_validate() Convert mvpp2 to use phylink_generic_validate() for the bulk of its validate() implementation. This network adapter has a restriction that for 802.3z links, autonegotiation must be enabled. Signed-off-by: Russell King (Oracle) Signed-off-by: David S. Miller commit 02a0988b98930491db95966fb8086072e47dabb6 Author: Russell King (Oracle) Date: Mon Nov 15 10:00:32 2021 +0000 net: mvneta: use phylink_generic_validate() Convert mvneta to use phylink_generic_validate() for the bulk of its validate() implementation. This network adapter has a restriction that for 802.3z links, autonegotiation must be enabled. Signed-off-by: Russell King (Oracle) Signed-off-by: David S. Miller commit 34ae2c09d46a2d0abd907e139b466f798e4095a8 Author: Russell King (Oracle) Date: Mon Nov 15 10:00:27 2021 +0000 net: phylink: add generic validate implementation Add a generic validate() implementation using the supported_interfaces and a bitmask of MAC pause/speed/duplex capabilities. This allows us to entirely eliminate many driver private validate() implementations. We expose the underlying phylink_get_linkmodes() function so that drivers which have special needs can still benefit from conversion. Signed-off-by: Russell King (Oracle) Signed-off-by: David S. Miller commit 5cf46d8e741f3876222f11b0a0bcbdcddfd8754e Author: Christophe Leroy Date: Mon Nov 15 12:08:59 2021 +0100 net/wan/fsl_ucc_hdlc: fix sparse warnings CHECK drivers/net/wan/fsl_ucc_hdlc.c drivers/net/wan/fsl_ucc_hdlc.c:309:57: warning: incorrect type in argument 2 (different address spaces) drivers/net/wan/fsl_ucc_hdlc.c:309:57: expected void [noderef] __iomem * drivers/net/wan/fsl_ucc_hdlc.c:309:57: got restricted __be16 * drivers/net/wan/fsl_ucc_hdlc.c:311:46: warning: incorrect type in argument 2 (different address spaces) drivers/net/wan/fsl_ucc_hdlc.c:311:46: expected void [noderef] __iomem * drivers/net/wan/fsl_ucc_hdlc.c:311:46: got restricted __be32 * drivers/net/wan/fsl_ucc_hdlc.c:320:57: warning: incorrect type in argument 2 (different address spaces) drivers/net/wan/fsl_ucc_hdlc.c:320:57: expected void [noderef] __iomem * drivers/net/wan/fsl_ucc_hdlc.c:320:57: got restricted __be16 * drivers/net/wan/fsl_ucc_hdlc.c:322:46: warning: incorrect type in argument 2 (different address spaces) drivers/net/wan/fsl_ucc_hdlc.c:322:46: expected void [noderef] __iomem * drivers/net/wan/fsl_ucc_hdlc.c:322:46: got restricted __be32 * drivers/net/wan/fsl_ucc_hdlc.c:372:29: warning: incorrect type in assignment (different base types) drivers/net/wan/fsl_ucc_hdlc.c:372:29: expected unsigned short [usertype] drivers/net/wan/fsl_ucc_hdlc.c:372:29: got restricted __be16 [usertype] drivers/net/wan/fsl_ucc_hdlc.c:379:36: warning: restricted __be16 degrades to integer drivers/net/wan/fsl_ucc_hdlc.c:402:12: warning: incorrect type in assignment (different address spaces) drivers/net/wan/fsl_ucc_hdlc.c:402:12: expected struct qe_bd [noderef] __iomem *bd drivers/net/wan/fsl_ucc_hdlc.c:402:12: got struct qe_bd *curtx_bd drivers/net/wan/fsl_ucc_hdlc.c:425:20: warning: incorrect type in assignment (different address spaces) drivers/net/wan/fsl_ucc_hdlc.c:425:20: expected struct qe_bd [noderef] __iomem *[assigned] bd drivers/net/wan/fsl_ucc_hdlc.c:425:20: got struct qe_bd *tx_bd_base drivers/net/wan/fsl_ucc_hdlc.c:427:16: error: incompatible types in comparison expression (different address spaces): drivers/net/wan/fsl_ucc_hdlc.c:427:16: struct qe_bd [noderef] __iomem * drivers/net/wan/fsl_ucc_hdlc.c:427:16: struct qe_bd * drivers/net/wan/fsl_ucc_hdlc.c:462:33: warning: incorrect type in argument 1 (different address spaces) drivers/net/wan/fsl_ucc_hdlc.c:506:41: warning: incorrect type in argument 1 (different address spaces) drivers/net/wan/fsl_ucc_hdlc.c:528:33: warning: incorrect type in argument 1 (different address spaces) drivers/net/wan/fsl_ucc_hdlc.c:552:38: warning: incorrect type in argument 1 (different address spaces) drivers/net/wan/fsl_ucc_hdlc.c:596:67: warning: incorrect type in argument 2 (different address spaces) drivers/net/wan/fsl_ucc_hdlc.c:611:41: warning: incorrect type in argument 1 (different address spaces) drivers/net/wan/fsl_ucc_hdlc.c:851:38: warning: incorrect type in initializer (different address spaces) drivers/net/wan/fsl_ucc_hdlc.c:854:40: warning: incorrect type in argument 1 (different address spaces) drivers/net/wan/fsl_ucc_hdlc.c:855:40: warning: incorrect type in argument 1 (different address spaces) drivers/net/wan/fsl_ucc_hdlc.c:858:39: warning: incorrect type in argument 1 (different address spaces) drivers/net/wan/fsl_ucc_hdlc.c:861:37: warning: incorrect type in argument 2 (different address spaces) drivers/net/wan/fsl_ucc_hdlc.c:866:38: warning: incorrect type in initializer (different address spaces) drivers/net/wan/fsl_ucc_hdlc.c:868:21: warning: incorrect type in argument 1 (different address spaces) drivers/net/wan/fsl_ucc_hdlc.c:870:40: warning: incorrect type in argument 2 (different address spaces) drivers/net/wan/fsl_ucc_hdlc.c:871:40: warning: incorrect type in argument 2 (different address spaces) drivers/net/wan/fsl_ucc_hdlc.c:873:39: warning: incorrect type in argument 2 (different address spaces) drivers/net/wan/fsl_ucc_hdlc.c:993:57: warning: incorrect type in argument 2 (different address spaces) drivers/net/wan/fsl_ucc_hdlc.c:995:46: warning: incorrect type in argument 2 (different address spaces) drivers/net/wan/fsl_ucc_hdlc.c:1004:57: warning: incorrect type in argument 2 (different address spaces) drivers/net/wan/fsl_ucc_hdlc.c:1006:46: warning: incorrect type in argument 2 (different address spaces) drivers/net/wan/fsl_ucc_hdlc.c:412:35: warning: dereference of noderef expression drivers/net/wan/fsl_ucc_hdlc.c:412:35: warning: dereference of noderef expression drivers/net/wan/fsl_ucc_hdlc.c:724:29: warning: dereference of noderef expression drivers/net/wan/fsl_ucc_hdlc.c:815:21: warning: dereference of noderef expression drivers/net/wan/fsl_ucc_hdlc.c:1021:29: warning: dereference of noderef expression Most of the warnings are due to DMA memory being incorrectly handled as IO memory. Fix it by doing direct read/write and doing proper dma_rmb() / dma_wmb(). Other problems are type mismatches or lack of use of IO accessors. Cc: Rasmus Villemoes Reported-by: kernel test robot Link: https://lkml.org/lkml/2021/11/12/647 Signed-off-by: Christophe Leroy Signed-off-by: David S. Miller commit 311107bdecd158870ab8556fd1289a56a6087bad Author: Yihao Han Date: Sun Nov 14 22:58:16 2021 -0800 net: fddi: use swap() to make code cleaner Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid opencoding it. Signed-off-by: Yihao Han Signed-off-by: David S. Miller commit 9ed941178ce9894ecd0e06aebf7a3c43841817aa Author: Guo Zhengkui Date: Mon Nov 15 13:00:10 2021 +0800 hinic: use ARRAY_SIZE instead of ARRAY_LEN ARRAY_SIZE defined in is safer than self-defined macros to get size of an array such as ARRAY_LEN used here. Because ARRAY_SIZE uses __must_be_array(arr) to ensure arr is really an array. Reported-by: Alejandro Colomar Signed-off-by: Guo Zhengkui Signed-off-by: David S. Miller commit 16b1c4e01c89ba07367461e0bc4cb84993c2d027 Author: Jacky Chou Date: Mon Nov 15 11:49:41 2021 +0800 net: usb: ax88179_178a: add TSO feature On low-effciency embedded platforms, transmission performance is poor due to on Bulk-out with single packet. Adding TSO feature improves the transmission performance and reduces the number of interrupt caused by Bulk-out complete. Reference to module, net: usb: aqc111. Signed-off-by: Jacky Chou Signed-off-by: David S. Miller commit 71812af7234f30362b43ccff33f93890ae4c0655 Merge: cc0be1ad686fb 80be9b2c0d93d Author: David S. Miller Date: Mon Nov 15 14:11:25 2021 +0000 Merge branch 'mctp-i2c-driver' Matt Johnston says: ==================== MCTP I2C driver This patch series adds a netdev driver providing MCTP transport over I2C. It applies against net-next using recent MCTP changes there, though also has I2C core changes for review. I'll leave it to maintainers where it should be applied - please let me know if it needs to be submitted differently. The I2C patches were previously sent as RFC though the only feedback there was an ack to 255 bytes for aspeed. The dt-bindings patch went through review on the list. ==================== Signed-off-by: David S. Miller commit 80be9b2c0d93dabe5dc0b4ee41da12422ed25d71 Author: Matt Johnston Date: Mon Nov 15 10:49:26 2021 +0800 mctp i2c: MCTP I2C binding driver Provides MCTP network transport over an I2C bus, as specified in DMTF DSP0237. All messages between nodes are sent as SMBus Block Writes. Each I2C bus to be used for MCTP is flagged in devicetree by a 'mctp-controller' property on the bus node. Each flagged bus gets a mctpi2cX net device created based on the bus number. A 'mctp-i2c-controller' I2C client needs to be added under the adapter. In an I2C mux situation the mctp-i2c-controller node must be attached only to the root I2C bus. The I2C client will handle incoming I2C slave block write data for subordinate busses as well as its own bus. In configurations without devicetree a driver instance can be attached to a bus using the I2C slave new_device mechanism. The MCTP core will hold/release the MCTP I2C device while responses are pending (a 6 second timeout or once a socket is closed, response received etc). While held the MCTP I2C driver will lock the I2C bus so that the correct I2C mux remains selected while responses are received. (Ideally we would just lock the mux to keep the current bus selected for the response rather than a full I2C bus lock, but that isn't exposed in the I2C mux API) This driver requires I2C adapters that allow 255 byte transfers (SMBus 3.0) as the specification requires a minimum MTU of 68 bytes. Signed-off-by: Matt Johnston Signed-off-by: Jeremy Kerr Signed-off-by: David S. Miller commit 0b6141eb2b14b0df03f48bd129182900078e7f90 Author: Matt Johnston Date: Mon Nov 15 10:49:25 2021 +0800 dt-bindings: net: New binding mctp-i2c-controller Used to define a local endpoint to communicate with MCTP peripherals attached to an I2C bus. This I2C endpoint can communicate with remote MCTP devices on the I2C bus. In the example I2C topology below (matching the second yaml example) we have MCTP devices on busses i2c1 and i2c6. MCTP-supporting busses are indicated by the 'mctp-controller' DT property on an I2C bus node. A mctp-i2c-controller I2C client DT node is placed at the top of the mux topology, since only the root I2C adapter will support I2C slave functionality. .-------. |eeprom | .------------. .------. /'-------' | adapter | | mux --@0,i2c5------' | i2c1 ----.*| --@1,i2c6--.--. |............| \'------' \ \ ......... | mctp-i2c- | \ \ \ .mctpB . | controller | \ \ '.0x30 . | | \ ......... \ '.......' | 0x50 | \ .mctpA . \ ......... '------------' '.0x1d . '.mctpC . '.......' '.0x31 . '.......' (mctpX boxes above are remote MCTP devices not included in the DT at present, they can be hotplugged/probed at runtime. A DT binding for specific fixed MCTP devices could be added later if required) Signed-off-by: Matt Johnston Reviewed-by: Rob Herring Signed-off-by: David S. Miller commit 3ef2de27a05a2dc7425431d9aa780e08e56ddb7f Author: Matt Johnston Date: Mon Nov 15 10:49:24 2021 +0800 i2c: npcm7xx: Allow 255 byte block SMBus transfers 255 byte support has been tested on a npcm750 board Signed-off-by: Matt Johnston Reviewed-by: Tali Perry Reviewed-by: Patrick Venture Signed-off-by: David S. Miller commit 1b2ba1f591c9d083cc1928f8337fcbf6a749e935 Author: Matt Johnston Date: Mon Nov 15 10:49:23 2021 +0800 i2c: aspeed: Allow 255 byte block transfers 255 byte transfers have been tested on an AST2500 board Signed-off-by: Matt Johnston Reviewed-by: Brendan Higgins Signed-off-by: David S. Miller commit 84a107e68b34217eff536e81a6a6f419ee0d0f7e Author: Matt Johnston Date: Mon Nov 15 10:49:22 2021 +0800 i2c: dev: Handle 255 byte blocks for i2c ioctl I2C_SMBUS is limited to 32 bytes due to compatibility with the 32 byte i2c_smbus_data.block I2C_RDWR allows larger transfers if sufficient sized buffers are passed. Signed-off-by: Matt Johnston Signed-off-by: David S. Miller commit 13cae4a104d2b7205696229ba85d34cc035f8c84 Author: Matt Johnston Date: Mon Nov 15 10:49:21 2021 +0800 i2c: core: Allow 255 byte transfers for SMBus 3.x SMBus 3.0 increased the maximum block transfer size from 32 bytes to 255 bytes. We increase the size of struct i2c_smbus_data's block[] member. i2c_smbus_xfer() and i2c_smbus_xfer_emulated() now support 255 byte block operations, other block functions remain limited to 32 bytes for compatibility with existing callers. We allow adapters to indicate support for the larger size with I2C_FUNC_SMBUS_V3_BLOCK. Most emulated drivers should be able to use 255 byte blocks by replacing I2C_SMBUS_BLOCK_MAX with I2C_SMBUS_V3_BLOCK_MAX though some will have hardware limitations that need testing. Signed-off-by: Matt Johnston Signed-off-by: David S. Miller commit cc0be1ad686fb29a4d127948486f40b17fb34b50 Author: Christophe JAILLET Date: Sun Nov 14 20:02:35 2021 +0100 net: bridge: Slightly optimize 'find_portno()' The 'inuse' bitmap is local to this function. So we can use the non-atomic '__set_bit()' to save a few cycles. While at it, also remove some useless {}. Signed-off-by: Christophe JAILLET Acked-by: Nikolay Aleksandrov Signed-off-by: David S. Miller commit e05cab34e417eb9051cd2e40c63f0bf37e7dac1b Author: Gene Chen Date: Fri Jul 16 16:17:30 2021 +0800 dt-bindings: leds: Add bindings for MT6360 LED Add bindings document for LED support on MT6360 PMIC Signed-off-by: Gene Chen Reviewed-by: Rob Herring Signed-off-by: Pavel Machek commit f5dc0140d483fcc6417d1d655481f0ff1de390b0 Author: Sam Protsenko Date: Thu Oct 28 17:43:13 2021 +0300 soc: samsung: exynos-pmu: Add Exynos850 support Exynos850 SoC can reuse PMU driver functionality. Add corresponding compatible string. Signed-off-by: Sam Protsenko Link: https://lore.kernel.org/r/20211028144313.9444-2-semen.protsenko@linaro.org Signed-off-by: Krzysztof Kozlowski commit a67cce83945170994fcef241b934699b6018b707 Author: Sam Protsenko Date: Thu Oct 28 17:43:12 2021 +0300 dt-bindings: samsung: pmu: Document Exynos850 Exynos850 SoC can reuse PMU driver functionality. Add corresponding compatible string to PMU bindings documentation. Signed-off-by: Sam Protsenko Acked-by: Rob Herring Link: https://lore.kernel.org/r/20211028144313.9444-1-semen.protsenko@linaro.org Signed-off-by: Krzysztof Kozlowski commit 214f78060713fe13e3ba3701dff51e46d9576a9c Author: David Virag Date: Mon Nov 1 01:48:53 2021 +0100 soc: samsung: exynos-chipid: add Exynos7885 SoC support Exynos 7885 has product ID "0xE7885000". Add this ID to the IDs with the name. Signed-off-by: David Virag Link: https://lore.kernel.org/r/20211101004853.55810-1-virag.david003@gmail.com Signed-off-by: Krzysztof Kozlowski commit 569e45a1135497d8dddc647bc615e26c49b070a8 Author: Krzysztof Kozlowski Date: Sun Oct 31 21:52:12 2021 +0100 soc: samsung: exynos-chipid: describe which SoCs go with compatibles The Exynos ChipID driver, like most of the Exynos drivers, uses one compatible for entire family of compatible devices using one devicetree "compatible". The compatibility is here described by programming interface (register layout), not by actual values, so the product ID register on one family of devices has different values for different SoCs. Describe which SoC goes with which compatible for documentation purposes, if the DTS is not available in mainline. Signed-off-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20211031205212.59505-1-krzysztof.kozlowski@canonical.com commit f7d344f2188c9f16e434cadf2a954b5d40365c14 Author: Rob Herring Date: Tue Nov 9 10:13:25 2021 -0600 spi: xlp: Remove Netlogic XLP variants Netlogic XLP was removed in commit 95b8a5e0111a ("MIPS: Remove NETLOGIC support"). With those gone, the single platform left to support is Cavium ThunderX2. Remove the Netlogic variant and DT support. For simplicity, the existing kconfig name is retained. Cc: Mark Brown Cc: linux-spi@vger.kernel.org Signed-off-by: Rob Herring Link: https://lore.kernel.org/r/20211109161325.2203564-1-robh@kernel.org Signed-off-by: Mark Brown commit f02bff30114f385d53ae3e45141db602923bca5d Author: Alexander Stein Date: Tue Nov 9 11:31:34 2021 +0100 spi: lpspi: release requested DMA channels The requested DMA channels are never released. Do this in .remove as well as in .probe. spi_register_controller() can return -EPROBE_DEFER if cs-gpios are not probed yet. Signed-off-by: Alexander Stein Link: https://lore.kernel.org/r/20211109103134.184216-1-alexander.stein@ew.tq-group.com Signed-off-by: Mark Brown commit 45971bdd8ca8b5a99a49f4db86737401c45e246f Author: Jonathan Corbet Date: Tue Nov 2 16:02:02 2021 -0600 spi: remove unused header file Commit 6acaadc852f1 ("spi: clps711x: Driver refactor") removed the only use of , but left the header file behind. This file is unused, delete it. Cc: Signed-off-by: Arnd Bergmann Cc: Signed-off-by: Mark Brown Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Jonathan Corbet Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/20211102220203.940290-9-corbet@lwn.net Signed-off-by: Mark Brown commit 02d6fdecb9c38de19065f6bed8d5214556fd061d Author: Ansuel Smith Date: Thu Nov 4 16:00:40 2021 +0100 regmap: allow to define reg_update_bits for no bus configuration Some device requires a special handling for reg_update_bits and can't use the normal regmap read write logic. An example is when locking is handled by the device and rmw operations requires to do atomic operations. Allow to declare a dedicated function in regmap_config for reg_update_bits in no bus configuration. Signed-off-by: Ansuel Smith Link: https://lore.kernel.org/r/20211104150040.1260-1-ansuelsmth@gmail.com Signed-off-by: Mark Brown commit 296c789ce1e501be8b46ebb24da4ba53063cc10a Author: Bard Liao Date: Wed Oct 27 10:18:24 2021 +0800 ASoC: intel: sof_sdw: add link adr order check We assume the adr order described in a snd_soc_acpi_link_adr array is jack -> amp -> mic. We follow the same order to implement the topology. We will need a special topology if we configure a snd_soc_acpi_link_adr array with different order. Adding a check and a warning message can remind people to keep the order when adding a new snd_soc_acpi_link_adr array. Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20211027021824.24776-11-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit 4ed65d6ead29a992c4803e1138a6042caa6ec2a3 Author: Bard Liao Date: Wed Oct 27 10:18:23 2021 +0800 ASoC: intel: sof_sdw: remove get_next_be_id DAI link id will not be set from sdw codec init feedback function, and be_id is changed by create_sdw_dailink() now. So we don't need get_next_be_id() anymore. Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20211027021824.24776-10-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit bd98394a811c7dc39bcd189cf5f33925f0c30ae2 Author: Bard Liao Date: Wed Oct 27 10:18:22 2021 +0800 ASoC: intel: sof_sdw: remove sof_sdw_mic_codec_mockup_init Now, we set DAI link id as SDW_DMIC_DAI_ID for all DMICs. No need to set it in sof_sdw_mic_codec_mockup_init. Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20211027021824.24776-9-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit f8f8312263e2d0c38dd0330a4503dcdcc94d0cd5 Author: Bard Liao Date: Wed Oct 27 10:18:21 2021 +0800 ASoC: intel: sof_sdw: remove SOF_RT715_DAI_ID_FIX quirk SOF_RT715_DAI_ID_FIX is not used anywhere. Remove it. Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20211027021824.24776-8-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit bf605cb042307d162fbcb094738bab5d767f1261 Author: Bard Liao Date: Wed Oct 27 10:18:20 2021 +0800 ASoC: intel: sof_sdw: move DMIC link id overwrite to create_sdw_dailink We can apply the fixed dai link id for DMICs in create_sdw_dailink(). No need to set it in each DMIC's callback. The fixed dai link id is not only for rt715 and rt715-sdca, but for all DMICs, therefore we remove the SOF_RT715_DAI_ID_FIX check as well. Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20211027021824.24776-7-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit d471c034f83201f84330e9ed46ad5139d32e77ce Author: Bard Liao Date: Wed Oct 27 10:18:19 2021 +0800 ASoC: intel: sof_sdw: Use a fixed DAI link id for AMP Currently, we assign SoundWire DAI link id according to the order in the link address table, with the assumption that the headset codec is listed first, then amplifiers and last capture devices. If the headset codec is not present in a platform, the dai link for amplifiers will be shifted, which can be handled in two ways a) modify the topology to renumber the dailink changes b) keep the dailink numbers constant in topology but also avoid the variations in the machine driver. This patch adds support for option b), the dailink index for amplifiers and capture devices becomes fixed. Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20211027021824.24776-6-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit b63137cf5167b73d9d68a2334b835996bfc3b941 Author: Bard Liao Date: Wed Oct 27 10:18:18 2021 +0800 ASoC: intel: sof_sdw: rename be_index/link_id to link_index The link_id variable in sof_card_dai_links_create() and be_index argument in create_sdw_dailink() is actually links' index. Rename them to link_index to be consistent. Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20211027021824.24776-5-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit 1071f2415b6b4ee653869acabfb26de1a27da9cd Author: Pierre-Louis Bossart Date: Wed Oct 27 10:18:17 2021 +0800 ASoC: Intel: sof_sdw: add SKU for Dell Latitude 9520 Different SKUs seem to be used for the same design. BugLink: https://github.com/thesofproject/linux/issues/3206 Signed-off-by: Pierre-Louis Bossart Reviewed-by: Kai Vehmanen Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20211027021824.24776-4-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit 0527b19fa4f390a6054612e1fa1dd4f8efc96739 Author: Pierre-Louis Bossart Date: Wed Oct 27 10:18:16 2021 +0800 ASoC: Intel: sof_sdw: fix jack detection on HP Spectre x360 convertible Tests on device show the JD2 mode does not work at all, the 'Headphone Jack' and 'Headset Mic Jack' are shown as 'on' always. JD1 seems to be the better option, with at least a change between the two cases. Jack not plugged-in: [root@fedora ~]# amixer -Dhw:0 cget numid=12 numid=12,iface=CARD,name='Headphone Jack' ; type=BOOLEAN,access=r-------,values=1 : values=off [root@fedora ~]# amixer -Dhw:0 cget numid=13 numid=13,iface=CARD,name='Headset Mic Jack' ; type=BOOLEAN,access=r-------,values=1 : values=off Jack plugged-in: [root@fedora ~]# amixer -Dhw:0 cget numid=13 numid=13,iface=CARD,name='Headset Mic Jack' ; type=BOOLEAN,access=r-------,values=1 : values=on [root@fedora ~]# amixer -Dhw:0 cget numid=13 numid=13,iface=CARD,name='Headset Mic Jack' ; type=BOOLEAN,access=r-------,values=1 : values=on The 'Headset Mic Jack' is updated with a delay which seems normal with additional calibration needed. Fixes: d92e279dee56 ('ASoC: Intel: sof_sdw: add quirk for HP Spectre x360 convertible') Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao Link: https://lore.kernel.org/r/20211027021824.24776-3-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit dd31ddd81904070d0a9cafd5499d3210a322f8af Author: Bard Liao Date: Wed Oct 27 10:18:15 2021 +0800 ASoC: intel: sof_sdw: return the original error number We don't want to convert create_sdw_dailink()'s return value to -ENOMEM. Signed-off-by: Bard Liao Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Rander Wang Link: https://lore.kernel.org/r/20211027021824.24776-2-yung-chuan.liao@linux.intel.com Signed-off-by: Mark Brown commit 48b5b6a56002569881d18be56deaddad045df918 Author: Ranjani Sridharan Date: Tue Nov 2 12:10:19 2021 +0200 ASoC: SOF: trace: send DMA_TRACE_FREE IPC during release Send the DMA_TRACE_FREE IPC during release to stop and free the trace DMA in the DSP. Signed-off-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20211102101019.14037-4-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit b4e2d7ce132bc4337916662f8e699420377132d9 Author: Ranjani Sridharan Date: Tue Nov 2 12:10:18 2021 +0200 ASoC: SOF: IPC: update ipc_log_header() Parse all the trace DMA IPC commands in ipc_log_header(). Signed-off-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20211102101019.14037-3-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 168eed447129899611098219b70ef97b605bc6e1 Author: Ranjani Sridharan Date: Tue Nov 2 12:10:17 2021 +0200 ASoC: SOF: IPC: Add new IPC command to free trace DMA Add a new SOF_IPC_TRACE_DMA_FREE IPC command to stop and free trace DMA in the FW. Signed-off-by: Ranjani Sridharan Reviewed-by: Kai Vehmanen Reviewed-by: Pierre-Louis Bossart Signed-off-by: Peter Ujfalusi Link: https://lore.kernel.org/r/20211102101019.14037-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown commit 9da52c39b33e7bd9c1f56175c0466fa468d7f145 Author: Vincent Knecht Date: Sun Oct 31 22:09:56 2021 +0100 ASoC: codecs: tfa989x: Add support for tfa9897 optional rcv-gpios Some OEM use a GPIO in addition to the tfa9897 RCV bit to switch between loudspeaker and earpiece/receiver mode. Add support for the GPIO switching by specifying rcv-gpios in DT. Signed-off-by: Vincent Knecht Link: https://lore.kernel.org/r/20211031210956.812101-3-vincent.knecht@mailoo.org Signed-off-by: Mark Brown commit 77fffb83933ad9e514ea0c7fd93b28cabcdea311 Author: Vincent Knecht Date: Sun Oct 31 22:09:55 2021 +0100 ASoC: dt-bindings: nxp, tfa989x: Add rcv-gpios property for tfa9897 Add optional rcv-gpios property specific to tfa9897 receiver mode. Signed-off-by: Vincent Knecht Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211031210956.812101-2-vincent.knecht@mailoo.org Signed-off-by: Mark Brown commit 642fc4fa0487dd76b9c840e217c2269d352bed41 Merge: fa55b7dcdc43c 6c53b45c71b49 Author: Mark Brown Date: Mon Nov 15 13:25:22 2021 +0000 Merge existing fixes from spi/for-5.16 into new branch commit 79a7a5ac3e53f459664701f1ca25066052dea6ae Merge: fa55b7dcdc43c 58da0d84fdd25 Author: Mark Brown Date: Mon Nov 15 13:25:03 2021 +0000 Merge existing fixes from asoc/for-5.16 into new branch commit cb3ef7b00042479277cda7871d899378ad91f081 Author: Harshit Mogalapalli Date: Fri Nov 12 13:36:47 2021 -0800 net: sched: sch_netem: Refactor code in 4-state loss generator Fixed comments to match description with variable names and refactored code to match the convention as per [1]. To match the convention mapping is done as follows: State 3 - LOST_IN_BURST_PERIOD State 4 - LOST_IN_GAP_PERIOD [1] S. Salsano, F. Ludovici, A. Ordine, "Definition of a general and intuitive loss model for packet networks and its implementation in the Netem module in the Linux kernel" Fixes: a6e2fe17eba4 ("sch_netem: replace magic numbers with enumerate") Signed-off-by: Harshit Mogalapalli Acked-by: Stephen Hemminger Signed-off-by: David S. Miller commit e99fa4230fa89f9e76073dd6af3dd85c33ba70b8 Author: Uwe Kleine-König Date: Fri Nov 12 15:53:52 2021 +0100 net: dsa: vsc73xxx: Make vsc73xx_remove() return void vsc73xx_remove() returns zero unconditionally and no caller checks the returned value. So convert the function to return no value. Signed-off-by: Uwe Kleine-König Reviewed-by: Vladimir Oltean Signed-off-by: David S. Miller commit 8e14b530f8c90346eab43c7b59b03ff9fec7d171 Author: Paul Cercueil Date: Sun Oct 31 23:41:37 2021 +0000 ARM: dts: exynos: Use interrupt for BCM4330 host wakeup in I9100 Switch away from using the deprecated 'host-wakeup-gpios' property, and use a 'host-wakeup' interrupt instead, as suggested by the binding documentation. Signed-off-by: Paul Cercueil Link: https://lore.kernel.org/r/20211031234137.87070-2-paul@crapouillou.net Signed-off-by: Krzysztof Kozlowski commit 9cb6de45a006a9799ec399bce60d64b6d4fcc4af Author: Paul Cercueil Date: Sun Oct 31 23:41:36 2021 +0000 ARM: dts: exynos: Fix BCM4330 Bluetooth reset polarity in I9100 The reset GPIO was marked active-high, which is against what's specified in the documentation. Mark the reset GPIO as active-low. With this change, Bluetooth can now be used on the i9100. Fixes: 8620cc2f99b7 ("ARM: dts: exynos: Add devicetree file for the Galaxy S2") Cc: stable@vger.kernel.org Signed-off-by: Paul Cercueil Link: https://lore.kernel.org/r/20211031234137.87070-1-paul@crapouillou.net Signed-off-by: Krzysztof Kozlowski commit 90dc0df9168b6c1ddb339481b440d7c13cc4417c Author: Krzysztof Kozlowski Date: Thu Nov 11 10:11:23 2021 +0100 ARM: s3c: include header for prototype of s3c2410_modify_misccr Include the header with prototype of s3c2410_modify_misccr to fix W=1 warning: arch/arm/mach-s3c/gpio-samsung.c:1309:14: warning: no previous prototype for ‘s3c2410_modify_misccr’ [-Wmissing-prototypes] Reported-by: kernel test robot Signed-off-by: Krzysztof Kozlowski Reviewed-by: Alim Akhtar Acked-by: Arnd Bergmann Link: https://lore.kernel.org/r/20211111091123.50853-1-krzysztof.kozlowski@canonical.com commit ac746c8520d9d056b6963ecca8ff1da9929d02f1 Author: Ong Boon Leong Date: Thu Nov 11 22:39:49 2021 +0800 net: stmmac: enhance XDP ZC driver level switching performance The previous stmmac_xdp_set_prog() implementation uses stmmac_release() and stmmac_open() which tear down the PHY device and causes undesirable autonegotiation which causes a delay whenever AFXDP ZC is setup. This patch introduces two new functions that just sufficiently tear down DMA descriptors, buffer, NAPI process, and IRQs and reestablish them accordingly in both stmmac_xdp_release() and stammac_xdp_open(). As the results of this enhancement, we get rid of transient state introduced by the link auto-negotiation: $ ./xdpsock -i eth0 -t -z sock0@eth0:0 txonly xdp-drv pps pkts 1.00 rx 0 0 tx 634444 634560 sock0@eth0:0 txonly xdp-drv pps pkts 1.00 rx 0 0 tx 632330 1267072 sock0@eth0:0 txonly xdp-drv pps pkts 1.00 rx 0 0 tx 632438 1899584 sock0@eth0:0 txonly xdp-drv pps pkts 1.00 rx 0 0 tx 632502 2532160 Reported-by: Kurt Kanzenbach Signed-off-by: Ong Boon Leong Tested-by: Kurt Kanzenbach Signed-off-by: David S. Miller commit 5d978f8ad2ae14b6aaae00dc5520b9657675aeef Author: Tinghan Shen Date: Fri Sep 24 11:39:35 2021 +0800 arm64: dts: mt8183: change rpmsg property name The the rpmsg property name is changed to "mediatek," to sync with the vendor name defined in vendor-prefixes.yaml. Signed-off-by: Tinghan Shen Reviewed-By: AngeloGioacchino Del Regno Link: https://lore.kernel.org/r/20210924033935.2127-7-tinghan.shen@mediatek.com Signed-off-by: Matthias Brugger commit 70aeb807cf8649dedbcd59b70dfc38fb89bdf1bd Author: Yazen Ghannam Date: Thu Oct 28 17:56:59 2021 +0000 EDAC/amd64: Add context struct Define an address translation context struct. This will hold values that will be passed between multiple functions. Save return address, Node ID, and the Instance ID number to start. Currently, the UMC number is used as the Instance ID, but future DF versions may use another value. Also include a "tmp" field to use when reading registers. This is to avoid having to define a temporary variable in multiple functions. Signed-off-by: Yazen Ghannam Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20211028175728.121452-5-yazen.ghannam@amd.com commit 448c3d6085b71aad58cd515469560ee76c982007 Author: Yazen Ghannam Date: Thu Oct 28 17:56:58 2021 +0000 EDAC/amd64: Allow for DF Indirect Broadcast reads The DF Indirect Access method allows for "Broadcast" accesses in which case no specific instance is targeted. Add support using a reserved instance ID of 0xFF to indicate a broadcast access. Set the FICAA register appropriately. Define helpers functions for instance and broadcast reads and use them where appropriate. Drop the "amd_" prefix since these functions are all static. Signed-off-by: Yazen Ghannam Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20211028175728.121452-4-yazen.ghannam@amd.com commit b3218ae47771f943b3e222f35fc46afacba39929 Author: Yazen Ghannam Date: Thu Oct 28 17:56:57 2021 +0000 x86/amd_nb, EDAC/amd64: Move DF Indirect Read to AMD64 EDAC df_indirect_read() is used only for address translation. Move it to EDAC along with the translation code. Signed-off-by: Yazen Ghannam Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20211028175728.121452-3-yazen.ghannam@amd.com commit 0b746e8c1e1e3fcc9e4036efe8d3ea3fd3e5d4c3 Author: Yazen Ghannam Date: Thu Oct 28 17:56:56 2021 +0000 x86/MCE/AMD, EDAC/amd64: Move address translation to AMD64 EDAC The address translation code used for current AMD systems is non-architectural. So move it to EDAC. Signed-off-by: Yazen Ghannam Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/20211028175728.121452-2-yazen.ghannam@amd.com commit 2ff64a84bbb3ea0281899766d9a944fd18db7013 Author: Andy Shevchenko Date: Wed Nov 10 15:47:43 2021 +0200 gpiolib: acpi: shrink devm_acpi_dev_add_driver_gpios() If all we want to manage is a single pointer, there's no need to manually allocate and add a new devres. We can simply use devm_add_action_or_reset() and shrink the code by a good bit. Signed-off-by: Andy Shevchenko Reviewed-by: Mika Westerberg commit 507805b83ff108473dba9d4909e41abd50cf07f5 Author: Andy Shevchenko Date: Wed Nov 10 15:47:42 2021 +0200 gpiolib: acpi: Remove never used devm_acpi_dev_remove_driver_gpios() Remove never used devm_acpi_dev_remove_driver_gpios(). Signed-off-by: Andy Shevchenko Reviewed-by: Mika Westerberg commit ea708ac5bf419d9735354f9deada384c1059700f Author: Rob Herring Date: Tue Nov 9 10:12:53 2021 -0600 gpio: xlp: Remove Netlogic XLP variants Netlogic XLP was removed in commit 95b8a5e0111a ("MIPS: Remove NETLOGIC support"). With those gone, the single platform left to support is Cavium ThunderX2. Remove all the Netlogic variants and DT support. For simplicity, the existing kconfig name is retained. Cc: Linus Walleij Cc: Bartosz Golaszewski Cc: linux-gpio@vger.kernel.org Signed-off-by: Rob Herring Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski commit 9057d6c23e7388ee9d037fccc9a7bc8557ce277b Author: Linus Lüssing Date: Sun Oct 31 22:30:12 2021 +0100 batman-adv: allow netlink usage in unprivileged containers Currently, creating a batman-adv interface in an unprivileged LXD container and attaching secondary interfaces to it with "ip" or "batctl" works fine. However all batctl debug and configuration commands fail: root@container:~# batctl originators Error received: Operation not permitted root@container:~# batctl orig_interval 1000 root@container:~# batctl orig_interval 2000 root@container:~# batctl orig_interval 1000 To fix this change the generic netlink permissions from GENL_ADMIN_PERM to GENL_UNS_ADMIN_PERM. This way a batman-adv interface is fully maintainable as root from within a user namespace, from an unprivileged container. All except one batman-adv netlink setting are per interface and do not leak information or change settings from the host system and are therefore save to retrieve or modify as root from within an unprivileged container. "batctl routing_algo" / BATADV_CMD_GET_ROUTING_ALGOS is the only exception: It provides the batman-adv kernel module wide default routing algorithm. However it is read-only from netlink and an unprivileged container is still not allowed to modify /sys/module/batman_adv/parameters/routing_algo. Instead it is advised to use the newly introduced "batctl if create routing_algo RA_NAME" / IFLA_BATADV_ALGO_NAME to set the routing algorithm on interface creation, which already works fine in an unprivileged container. Cc: Tycho Andersen Signed-off-by: Linus Lüssing Signed-off-by: Sven Eckelmann Signed-off-by: Simon Wunderlich commit c2262123cc49063a8ebc75525d0ab1d13a605608 Author: Simon Wunderlich Date: Thu Sep 2 09:16:00 2021 +0200 batman-adv: Start new development cycle This version will contain all the (major or even only minor) changes for Linux 5.17. 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 c61d8b5791abbc8b1aa51593d45dc88ef8804e4a Author: Jacky Bai Date: Fri Nov 12 15:18:58 2021 +0800 dt-bindings: gpio: gpio-vf610: Add imx8ulp compatible string Add the compatible string for i.MX8ULP. Reviewed-by: Linus Walleij Reviewed-by: Dong Aisheng Acked-by: Rob Herring Signed-off-by: Jacky Bai Signed-off-by: Peng Fan Signed-off-by: Bartosz Golaszewski commit a193f3b4e050e35c506a34d0870c838d8e0b0449 Author: Thomas Zimmermann Date: Mon Nov 8 10:31:49 2021 +0100 drm/shmem-helper: Pass GEM shmem object in public interfaces Change all GEM SHMEM object functions that receive a GEM object of type struct drm_gem_object to expect an object of type struct drm_gem_shmem_object instead. This change reduces the number of upcasts from struct drm_gem_object by moving them into callers. The C compiler can now verify that the GEM SHMEM functions are called with the correct type. For consistency, the patch also renames drm_gem_shmem_free_object to drm_gem_shmem_free. It further updates documentation for a number of functions. v3: * fix docs for drm_gem_shmem_object_free() v2: * mention _object_ callbacks in docs (Daniel) Signed-off-by: Thomas Zimmermann Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20211108093149.7226-4-tzimmermann@suse.de commit c7fbcb7149ff9321bbbcc93c9920de534ea8102c Author: Thomas Zimmermann Date: Mon Nov 8 10:31:48 2021 +0100 drm/shmem-helper: Export dedicated wrappers for GEM object functions Wrap GEM SHMEM functions for struct drm_gem_object_funcs and update all callers. This will allow for an update of the public interfaces of the GEM SHMEM helper library. v2: * fix docs for drm_gem_shmem_object_print_info() Signed-off-by: Thomas Zimmermann Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20211108093149.7226-3-tzimmermann@suse.de commit 5a363c20673308e968b6640deb73d7bf77e8b463 Author: Thomas Zimmermann Date: Mon Nov 8 10:31:47 2021 +0100 drm/shmem-helper: Unexport drm_gem_shmem_create_with_handle() Turn drm_gem_shmem_create_with_handle() into an internal helper function. It's not used outside of the compilation unit. Signed-off-by: Thomas Zimmermann Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20211108093149.7226-2-tzimmermann@suse.de commit 161450134ae9bab3778c5f5732941162626d0eaa Author: Biju Das Date: Wed Nov 10 08:20:19 2021 +0000 clk: renesas: r9a07g044: Add OSTM clock and reset entries Add OSTM{0,1,2} clock and reset entries to CPG driver. Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211110082019.28554-2-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit dc446cba4301bbe2dbe16711091635d987626410 Author: Biju Das Date: Wed Nov 10 08:20:18 2021 +0000 clk: renesas: r9a07g044: Rename CLK_PLL2_DIV16 and CLK_PLL2_DIV20 macros Rename the macros CLK_PLL2_DIV16->CLK_PLL2_DIV2_8 and CLK_PLL2_DIV20->CLK_PLL2_DIV2_10 to match the clock tree mentioned in the hardware manual(Rev.1.00 Sep, 2021). Signed-off-by: Biju Das Reviewed-by: Lad Prabhakar Link: https://lore.kernel.org/r/20211110082019.28554-1-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 073da9e7c768b0d81f9ce22cc907227450612d88 Author: Biju Das Date: Thu Nov 4 16:08:57 2021 +0000 clk: renesas: r9a07g044: Add WDT clock and reset entries Add WDT{0,1,2} clock and reset entries to CPG driver. Signed-off-by: Biju Das Link: https://lore.kernel.org/r/20211104160858.15550-4-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit a0d2a2c6736c849463b424a7203f5e0e40949c03 Author: Lad Prabhakar Date: Wed Nov 3 16:05:37 2021 +0000 clk: renesas: r9a07g044: Add clock and reset entry for SCI1 Add clock and reset entry for SCI1 interface. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20211103160537.32253-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit adb613f84a9e3638dfcc85975c7d58a4e80eef02 Author: Lad Prabhakar Date: Wed Nov 10 22:46:22 2021 +0000 pinctrl: renesas: rzg2l: Add support to get/set drive-strength and output-impedance-ohms RZ/G2L supports two groups of pins Group-A and Group-B. For Group-A pins drive-strength can be configured and for Group-B output-impedance can be configured. This patch splits PIN_CFG_IOLH macro to PIN_CFG_IOLH_A/B and adds support to get/set drive-strength and output-impedance-ohms for the supported pins. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20211110224622.16022-7-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 22972a2d5bc4bae3db9521580cea8971c96204bc Author: Lad Prabhakar Date: Wed Nov 10 22:46:21 2021 +0000 pinctrl: renesas: rzg2l: Rename PIN_CFG_* macros to match HW manual Rename the below macros to match the HW manual (Rev.1.00): PIN_CFG_IOLH_SD0 -> PIN_CFG_IO_VMC_SD0 PIN_CFG_IOLH_SD1 -> PIN_CFG_IO_VMC_SD1 PIN_CFG_IOLH_QSPI -> PIN_CFG_IO_VMC_QSPI PIN_CFG_IOLH_ETH0 -> PIN_CFG_IO_VMC_ETH0 PIN_CFG_IOLH_ETH1 -> PIN_CFG_IO_VMC_ETH1 Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20211110224622.16022-6-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 7f13a4297be04a1d5e6f025a44531d3c85c02524 Author: Lad Prabhakar Date: Wed Nov 10 22:46:20 2021 +0000 pinctrl: renesas: rzg2l: Add support to get/set pin config for GPIO port pins Add support to get/set pin config for GPIO port pins. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20211110224622.16022-5-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit d1189991c823b50990291c8157b56fb141c47155 Author: Lad Prabhakar Date: Wed Nov 10 22:46:19 2021 +0000 pinctrl: renesas: rzg2l: Add helper functions to read/write pin config Add helper functions to read/read modify write pin config. Switch to use helper functions for pins supporting PIN_CONFIG_INPUT_ENABLE capabilities. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20211110224622.16022-4-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit c76629a63b9c7cc52bb661aa36081c0c87780c3b Author: Lad Prabhakar Date: Wed Nov 10 22:46:18 2021 +0000 pinctrl: renesas: rzg2l: Rename RZG2L_SINGLE_PIN_GET_PORT macro Rename RZG2L_SINGLE_PIN_GET_PORT -> RZG2L_SINGLE_PIN_GET_PORT_OFFSET. Also, rename port -> port_offset in rzg2l_pinctrl_pinconf_set/get for readability. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20211110224622.16022-3-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 272958bf8ec342c65bf732213f65f8e6e9b6ec6a Author: Martin Kaiser Date: Sat Nov 13 19:55:18 2021 +0100 staging: r8188eu: remove the efuse_hal structure struct efuse_hal is not used and can be removed. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211113185518.23941-16-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 232ee4d19ed59bd59fd3695bcd02a45065e51a47 Author: Martin Kaiser Date: Sat Nov 13 19:55:17 2021 +0100 staging: r8188eu: remove fake efuse variables We removed the pseudo read code. This patch removes the fake efuse arrays that were used by pseudo reads. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211113185518.23941-15-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 70919f64ea0fa9997173f179a5315226e80006ea Author: Martin Kaiser Date: Sat Nov 13 19:55:16 2021 +0100 staging: r8188eu: remove bt efuse definitions This driver does not use bt efuses. Remove global variables and definitions related to bt efuses. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211113185518.23941-14-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit d53ad62518d4abad3f38c1ec173ee4d4ead1f724 Author: Martin Kaiser Date: Sat Nov 13 19:55:15 2021 +0100 staging: r8188eu: efuse_OneByteWrite is unused Remove the efuse_OneByteWrite function, which is no longer used. Remove resulting dead code as well. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211113185518.23941-13-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 0f4504dc5dc7689a5b7f9f9a20e64780f7acef9c Author: Martin Kaiser Date: Sat Nov 13 19:55:14 2021 +0100 staging: r8188eu: efuse_OneByteRead is unused Remove the efuse_OneByteRead function, which is no longer used. Remove resulting dead code as well. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211113185518.23941-12-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit dd657639326d7c96e009ab02096f40acbb6761e0 Author: Martin Kaiser Date: Sat Nov 13 19:55:13 2021 +0100 staging: r8188eu: remove defines for efuse type We've removed all code to handle efuse types. The last step is to remove the defines for bt and wifi efuse types. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211113185518.23941-11-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit a98e3bd77eadbda9d744c5d2ad716a15983d7176 Author: Martin Kaiser Date: Sat Nov 13 19:55:12 2021 +0100 staging: r8188eu: rtl8188e_EFUSE_GetEfuseDefinition is unused Now that we use the map length directly, rtl8188e_EFUSE_GetEfuseDefinition is no longer needed and can be removed. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211113185518.23941-10-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 36c6b1eb57c0dbf73c34d56a241a72b30406a6f3 Author: Martin Kaiser Date: Sat Nov 13 19:55:11 2021 +0100 staging: r8188eu: use efuse map length define directly The length of the efuse data section is constant. We can use the corresponding define directly, there's no need to get the length from rtl8188e_EFUSE_GetEfuseDefinition. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211113185518.23941-9-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit a15aed66338c97a757aebe1f08ab74b82e6e28cd Author: Martin Kaiser Date: Sat Nov 13 19:55:10 2021 +0100 staging: r8188eu: merge Efuse_ReadAllMap into EFUSE_ShadowMapUpdate Efuse_ReadAllMap is small, it's called only by EFUSE_ShadowMapUpdate. This patch merges the two functions. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211113185518.23941-8-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 304c8253164821023e181dfc3c41eb74486abf9b Author: Martin Kaiser Date: Sat Nov 13 19:55:09 2021 +0100 staging: r8188eu: rtl8188e_Efuse_PgPacketRead is now unused After we removed efuse write support, rtl8188e_Efuse_PgPacketRead is no longer needed. Remove this function and its internal helpers. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211113185518.23941-7-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit ec00db06a10ac618eee9511d03d087a2834bd87e Author: Martin Kaiser Date: Sat Nov 13 19:55:08 2021 +0100 staging: r8188eu: rtl8188e_EfuseGetCurrentSize is now unused After we removed efuse write support, rtl8188e_EfuseGetCurrentSize is no longer needed. Remove this function and its internal helpers. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211113185518.23941-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 2267ac01628b3c062215afd0036215bf50318de2 Author: Martin Kaiser Date: Sat Nov 13 19:55:07 2021 +0100 staging: r8188eu: merge small adapter info helpers ReadAdapterInfo8188EU calls Hal_InitPGData88E and readAdapterInfo_8188EU, both of which are small and have no other callers. Merge the two latter functions into ReadAdapterInfo8188EU. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211113185518.23941-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 6f520d1f50e9c7606a607a116b59b634b3a9a891 Author: Martin Kaiser Date: Sat Nov 13 19:55:06 2021 +0100 staging: r8188eu: remove test code for efuse shadow map The EFUSE_ShadowMapUpdate function has a parameter to replace the actual read operations with test reads. The only caller of EFUSE_ShadowMapUpdate does not use this test mode. Remove the read test code from EFUSE_ShadowMapUpdate and the low-level functions that it calls. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211113185518.23941-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 3a6a68888b6c98898f34ac83e51ef50156a88f6d Author: Martin Kaiser Date: Sat Nov 13 19:55:05 2021 +0100 staging: r8188eu: remove efuse type from read functions Efuse_ReadAllMap, ReadEFuseByIC and ReadEFuse_Pseudo do not use their efuseType parameter. Remove the parameter from these functions and from their callers. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211113185518.23941-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 8e162342589a19b3f823808d97f4ca921be067c1 Author: Martin Kaiser Date: Sat Nov 13 19:55:04 2021 +0100 staging: r8188eu: remove efuse type from definition functions Hal_EFUSEGetEfuseDefinition88E and Hal_EFUSEGetEfuseDefinition_Pseudo88E do not use their efuseType parameter. Remove the parameter from these functions and from their callers. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211113185518.23941-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 53a2f33caaeacb820f554899f0780387b1b4381b Author: Sergio Paracuellos Date: Sat Nov 13 20:20:45 2021 +0100 staging: mt7621-dts: remove 'gdma' and 'hsdma' nodes Drivers related with 'gdma' and 'hsdma' nodes are not in-tree. Remove them from the device tree file. Signed-off-by: Sergio Paracuellos Link: https://lore.kernel.org/r/20211113192045.32153-4-sergio.paracuellos@gmail.com Signed-off-by: Greg Kroah-Hartman commit 87dd67f496f71c3693431a236b2b542793d786ff Author: Sergio Paracuellos Date: Sat Nov 13 20:20:44 2021 +0100 staging: mt7621-dma: remove driver from tree This driver was a added a time ago and there is no special effort or work to clean it and any progress at all to mainline it. Also, there is already a driver from Mediatek in 'drivers/dma/mediatek/mtk-hsdma.c' which looks pretty similar to this. So the way of supporting HSDMA for mt7621 would be to modify that driver instead. Signed-off-by: Sergio Paracuellos Link: https://lore.kernel.org/r/20211113192045.32153-3-sergio.paracuellos@gmail.com Signed-off-by: Greg Kroah-Hartman commit 5bfc10690c6c590a972be014ed8595e77e1e2dea Author: Sergio Paracuellos Date: Sat Nov 13 20:20:43 2021 +0100 staging: ralink-gdma: remove driver from tree This driver was a added a time ago and there is no special effort or work to clean it and any progress at all to mainline it. Also, the main user of this dma controller seems to be 'i2s' in mt7621 SoCs. There is no in-tree driver at all for the 'i2s' and its related device tree node has also been deleted from main device tree file. Hence, remove this driver also for completeness. Signed-off-by: Sergio Paracuellos Link: https://lore.kernel.org/r/20211113192045.32153-2-sergio.paracuellos@gmail.com Signed-off-by: Greg Kroah-Hartman commit 1e9fc71213d784dfbd153289daf08fdfc87f32ba Author: Christian Hewitt Date: Tue Oct 12 05:25:22 2021 +0000 arm64: dts: meson-gxbb-wetek: use updated LED bindings Update the dts to use the newer style of LED bindings. Signed-off-by: Christian Hewitt Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20211012052522.30873-4-christianshewitt@gmail.com commit c019abb2feba3cbbd7cf7178f8e6499c4fa6fced Author: Christian Hewitt Date: Tue Oct 12 05:25:21 2021 +0000 arm64: dts: meson-gxbb-wetek: fix missing GPIO binding The absence of this binding appears to be harmless in Linux but it breaks Ethernet support in mainline u-boot. So add the binding (which is present in all other u-boot supported GXBB device-trees). Fixes: fb72c03e0e32 ("ARM64: dts: meson-gxbb-wetek: add a wetek specific dtsi to cleanup hub and play2") Signed-off-by: Christian Hewitt Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20211012052522.30873-3-christianshewitt@gmail.com commit 8182a35868db5f053111d5d9d4da8fcb3f99259d Author: Christian Hewitt Date: Tue Oct 12 05:25:20 2021 +0000 arm64: dts: meson-gxbb-wetek: fix HDMI in early boot Mark the VDDIO_AO18 regulator always-on and set hdmi-supply for the hdmi_tx node to ensure HDMI is powered in the early stages of boot. Fixes: fb72c03e0e32 ("ARM64: dts: meson-gxbb-wetek: add a wetek specific dtsi to cleanup hub and play2") Signed-off-by: Christian Hewitt Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20211012052522.30873-2-christianshewitt@gmail.com commit c0b0d2e87d91ce283c8766b4b3c2ec9ac90ebf96 Author: P Praneesh Date: Mon Oct 25 18:54:42 2021 +0530 ath11k: Increment pending_mgmt_tx count before tx send invoke There is a race condition whereby the tx completion handler can be invoked before the 'num_pending_mgmt_tx" count is incremented. If that occurs, we could get warning trace indicating that 'num_pending_mgmt_tx' is 0 (because it was not yet incremented). Ideally, this trace should be seen only if mgmt tx has not happened but tx completion is received, and it is not expected in this race condition. Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.4.0.1-01386-QCAHKSWPL_SILICONZ-1 Co-developed-by: Lavanya Suresh Signed-off-by: Lavanya Suresh Signed-off-by: P Praneesh Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1635168282-8845-1-git-send-email-quic_ppranees@quicinc.com commit 9212c1b9e80a869e732769a4fe7f82d392b219be Author: P Praneesh Date: Mon Oct 25 17:47:09 2021 +0530 ath11k: send proper txpower and maxregpower values to firmware Set proper values for max_regpower, max_power, max_antenna_gain as it is because firmware will convert power values to 0.5dbm steps by multiplying it with 2. If txpower is not set, it will lead to cca stuck resulting in latency issues for QCN9074. Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.4.0.1-01386-QCAHKSWPL_SILICONZ-1 Co-developed-by: Lavanya Suresh Signed-off-by: Lavanya Suresh Signed-off-by: P Praneesh Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1635164229-22880-1-git-send-email-quic_ppranees@quicinc.com commit 787264893c69ed091a46335dfd0f50dabb457718 Author: P Praneesh Date: Mon Oct 25 17:44:20 2021 +0530 ath11k: fix FCS_ERR flag in radio tap header In radio tap header, BAD FCS flag is not updated properly because driver failed to update FCS_ERR flag in monitor mode. In rx_desc, FCS_ERR information is available in rx_attention structure and presence of this field indicates corresponding frame failed FCS check. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-01695-QCAHKSWPL_SILICONZ-1 Signed-off-by: P Praneesh Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1635164060-18423-1-git-send-email-quic_ppranees@quicinc.com commit b4a0f54156ac7720de1750b6ea06657c91c52163 Author: Wen Gong Date: Wed Oct 27 05:38:25 2021 -0400 ath11k: move peer delete after vdev stop of station for QCA6390 and WCN6855 When station connect to AP, the wmi command sequence is: peer_create->vdev_start->vdev_up and sequence of station disconnect fo AP is: peer_delete->vdev_down->vdev_stop The sequence of disconnect is not opposite of connect, it caused firmware crash when it handle wmi vdev stop cmd when the AP is support TWT of 802.11 ax, because firmware need access the bss peer for vdev stop cmd. [ 390.438564] ath11k_pci 0000:05:00.0: wmi cmd send 0x6001 ret 0 [ 390.438567] ath11k_pci 0000:05:00.0: WMI peer create vdev_id 0 peer_addr c4:04:15:3b:e0:39 [ 390.472724] ath11k_pci 0000:05:00.0: mac vdev 0 start center_freq 2437 phymode 11ax-he20-2g [ 390.472731] ath11k_pci 0000:05:00.0: wmi cmd send 0x5003 ret 0 [ 390.560849] ath11k_pci 0000:05:00.0: wmi cmd send 0x5005 ret 0 [ 390.560850] ath11k_pci 0000:05:00.0: WMI mgmt vdev up id 0x0 assoc id 1 bssid c4:04:15:3b:e0:39 [ 399.432896] ath11k_pci 0000:05:00.0: WMI peer delete vdev_id 0 peer_addr c4:04:15:3b:e0:39 [ 399.432902] ath11k_pci 0000:05:00.0: wmi cmd send 0x6002 ret 0 [ 399.441380] ath11k_pci 0000:05:00.0: wmi cmd send 0x5007 ret 0 [ 399.441381] ath11k_pci 0000:05:00.0: WMI vdev down id 0x0 [ 399.454681] ath11k_pci 0000:05:00.0: wmi cmd send 0x5006 ret 0 [ 399.454682] ath11k_pci 0000:05:00.0: WMI vdev stop id 0x0 The opposite sequence of disconnect should be: vdev_down->vdev_stop->peer_delete This patch change the sequence of disconnect for station as above opposite sequence for QCA6390, firmware not crash again with this patch. Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211027093825.12167-1-quic_wgong@quicinc.com commit c8f2d41bbff6794329d681d108a817366aed0ba7 Author: Wen Gong Date: Mon Oct 25 23:20:14 2021 -0400 ath11k: fix the value of msecs_to_jiffies in ath11k_debugfs_fw_stats_request parameter of msecs_to_jiffies should be (3 * 1000) instead of (3 * HZ) Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211026032014.27010-1-quic_wgong@quicinc.com commit 95d35256b564aca33fb661eac77dc94bfcffc8df Author: Alexander Stein Date: Tue Oct 26 20:28:13 2021 +0200 arm64: dts: amlogic: Fix SPI NOR flash node name for ODROID N2/N2+ Fix the schema warning: "spi-flash@0: $nodename:0: 'spi-flash@0' does not match '^flash(@.*)?$'" from jedec,spi-nor.yaml Fixes: a084eaf3096c ("arm64: dts: meson-g12b-odroid-n2: add SPIFC controller node") Reviewed-by: Neil Armstrong Signed-off-by: Alexander Stein Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20211026182813.900775-3-alexander.stein@mailbox.org commit bb98a6fd0b0e227cefb2ba91cea2b55455f203b7 Author: Alexander Stein Date: Tue Oct 26 20:28:12 2021 +0200 arm64: dts: amlogic: meson-g12: Fix GPU operating point table node name Starting with commit 94274f20f6bf ("dt-bindings: opp: Convert to DT schema") the opp node name has a mandatory pattern. This change fixes the dtbs_check warning: gpu-opp-table: $nodename:0: 'gpu-opp-table' does not match '^opp-table(-[a-z0-9]+)?$' Put the 'gpu' part at the end to match the pattern. Fixes: 916a0edc43f0 ("arm64: dts: amlogic: meson-g12: add the Mali OPP table and use DVFS") Reviewed-by: Neil Armstrong Signed-off-by: Alexander Stein Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20211026182813.900775-2-alexander.stein@mailbox.org commit cdc5091694595606f0e38d651135d5d67fd397d0 Author: Alexander Stein Date: Tue Oct 26 20:28:11 2021 +0200 arm64: dts: amlogic: meson-g12: Fix thermal-zones indent This node is currently at /soc/thermal-zones, but the later introduced bindings in commit 1202a442a31f ("dt-bindings: thermal: Add yaml bindings for thermal zones") put this at /thermal-zones. Fix dtb_check warning by moving the thermal-zones node to / Signed-off-by: Alexander Stein Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20211026182813.900775-1-alexander.stein@mailbox.org commit 1d795645e1eef97fe5d409e3dd5747a942f00e08 Author: Wen Gong Date: Mon Oct 11 04:49:57 2021 -0400 ath11k: remove return for empty tx bitrate in mac_op_sta_statistics Currently in ath11k_mac_op_sta_statistics() there is the following logic: if (!arsta->txrate.legacy && !arsta->txrate.nss) return; Unfortunately if this condition is true then the function returns without setting parameters that follow the txrate. To address this issue remove the return and instead invert the logic to set the txrate logic if (arsta->txrate.legacy || arsta->txrate.nss). The same was done also in ath10k in commit 1cd6ba8ae33e ("ath10k: remove return for NL80211_STA_INFO_TX_BITRATE"). Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211011084957.31024-1-wgong@codeaurora.org commit 78406044bdd0cc8987bc082b76867c63ab1c6af8 Author: Wen Gong Date: Wed Oct 13 03:37:04 2021 -0400 ath11k: enable IEEE80211_VHT_EXT_NSS_BW_CAPABLE if NSS ratio enabled When NSS ratio enabled reported by firmware, SUPPORTS_VHT_EXT_NSS_BW is set in ath11k, meanwhile IEEE80211_VHT_EXT_NSS_BW_CAPABLE also need to be set, otherwise it is invalid because spec in IEEE Std 802.11™‐2020 as below. Table 9-273-Supported VHT-MCS and NSS Set subfields, it has subfield VHT Extended NSS BW Capable, its definition is: Indicates whether the STA is capable of interpreting the Extended NSS BW Support subfield of the VHT Capabilities Information field. dmesg have a message without this patch: ieee80211 phy0: copying sband (band 1) due to VHT EXT NSS BW flag It means mac80211 will set IEEE80211_VHT_EXT_NSS_BW_CAPABLE if ath11k not set it in ieee80211_register_hw(). So it is better to set it in ath11k. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Signed-off-by: Wen Gong Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211013073704.15888-1-wgong@codeaurora.org commit 4f66a9ef37d3c09917a1edc065ff68b895e0b163 Author: Takashi Iwai Date: Mon Nov 15 08:59:44 2021 +0100 ALSA: hda: intel: More comprehensive PM runtime setup for controller driver Currently we haven't explicitly enable and allow/forbid the runtime PM at the probe and the remove phases of HD-audio controller driver, and this was the reason of a GPF mentioned in the commit e81478bbe7a1 ("ALSA: hda: fix general protection fault in azx_runtime_idle"); namely, even after the resources are released, the runtime PM might be still invoked by the bound graphics driver during the remove of the controller driver. Although we've fixed it by clearing the drvdata reference, it'd be also better to cover the runtime PM issue more properly. This patch adds a few more pm_runtime_*() calls at the probe and the remove time for setting and cleaning up the runtime PM. Particularly, now more explicitly pm_runtime_enable() and _disable() get called as well as pm_runtime_forbid() call at the remove callback, so that a use-after-free should be avoided. Reported-by: Kai Vehmanen Reviewed-by: Kai Vehmanen Tested-by: Kai Vehmanen Link: https://lore.kernel.org/r/20211110210307.1172004-1-kai.vehmanen@linux.intel.com Link: https://lore.kernel.org/r/20211115075944.6972-1-tiwai@suse.de Signed-off-by: Takashi Iwai commit be8867cb47652418e488170785bd9ffbadae3f1f Author: P Praneesh Date: Fri Nov 12 11:06:11 2021 +0200 ath11k: avoid unnecessary lock contention in tx_completion path Avoid unnecessary idr_find calls before the idr_remove calls. Because idr_remove gives the valid ptr if id is valid otherwise return NULL ptr. So removed the idr_find before idr_remove in tx completion path. Also no need to disable the bottom half preempt if it is already in the bottom half context, so modify the spin_lock_bh to spin_lock in the data tx completion path. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-01734-QCAHKSWPL_SILICONZ-1 v2 Co-developed-by: Karthikeyan Periyasamy Signed-off-by: Karthikeyan Periyasamy Signed-off-by: Jouni Malinen Signed-off-by: P Praneesh Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1630560820-21905-13-git-send-email-ppranees@codeaurora.org commit bcef57ea400cc20a5389fa0e38d61063331558f8 Author: P Praneesh Date: Fri Nov 12 11:06:04 2021 +0200 ath11k: add branch predictors in dp_tx path Add branch prediction in dp_tx code path in tx and tx completion handlers. Also in ath11k_dp_tx_complete_msdu , the pointer that is returned by rcu_dereference() is not dereferenced. so it is preferable to use rcu_access_pointer() here. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-01734-QCAHKSWPL_SILICONZ-1 v2 Co-developed-by: Sriram R Signed-off-by: Sriram R Signed-off-by: Jouni Malinen Signed-off-by: P Praneesh Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1630560820-21905-12-git-send-email-ppranees@codeaurora.org commit cbfbed495d3289d5a0bc7c614cea639008086cfe Author: P Praneesh Date: Fri Nov 12 11:05:58 2021 +0200 ath11k: avoid while loop in ring selection of tx completion interrupt Currently while loop is used to find the tx completion ring number and it is not required since the tx ring mask and the group id can be combined to directly fetch the ring number. Hence remove the while loop and directly get the ring number from tx mask and group id. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-01734-QCAHKSWPL_SILICONZ-1 v2 Co-developed-by: Sriram R Signed-off-by: Sriram R Signed-off-by: Jouni Malinen Signed-off-by: P Praneesh Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1630560820-21905-11-git-send-email-ppranees@codeaurora.org commit a8508bf7ced2e43f30b46333f09cbc79a1675616 Author: P Praneesh Date: Fri Nov 12 11:02:45 2021 +0200 ath11k: remove mod operator in dst ring processing Replace use of mod operator with a manual wrap around to avoid additional cost of using mod operation. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-01734-QCAHKSWPL_SILICONZ-1 v2 Co-developed-by: Sriram R Signed-off-by: Sriram R Signed-off-by: Jouni Malinen Signed-off-by: P Praneesh Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1630560820-21905-10-git-send-email-ppranees@codeaurora.org commit d0e2523bfa9cb391fe966b0b6948c7e438981361 Author: P Praneesh Date: Fri Nov 12 11:02:38 2021 +0200 ath11k: allocate HAL_WBM2SW_RELEASE ring from cacheable memory Similar to REO destination ring, also allocate HAL_WBM2SW_RELEASE from cacheable memory so that descriptors could be prefetched during tx completion handling. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-01734-QCAHKSWPL_SILICONZ-1 v2 Co-developed-by: Sriram R Signed-off-by: Sriram R Signed-off-by: Jouni Malinen Signed-off-by: P Praneesh Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1630560820-21905-9-git-send-email-ppranees@codeaurora.org commit 400588039a17a460292eb974ebba5811b8cbdb91 Author: P Praneesh Date: Fri Nov 12 11:02:31 2021 +0200 ath11k: add branch predictors in process_rx In datapath, add branch predictors where required in the process rx(). This protects high value rx path without having performance overhead. Also while processing rx packets, the pointer that is returned by rcu_dereference() is not dereferenced. so it is preferable to use rcu_access_pointer() here. Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.4.0.1.r2-00012-QCAHKSWPL_SILICONZ-1 Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-01695-QCAHKSWPL_SILICONZ-1 Co-developed-by: Sriram R Signed-off-by: Sriram R Signed-off-by: Jouni Malinen Signed-off-by: P Praneesh Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1630560820-21905-8-git-send-email-ppranees@codeaurora.org commit db2ecf9f0567a8f1a96f23a392cc5a30eaec4369 Author: P Praneesh Date: Fri Nov 12 11:02:24 2021 +0200 ath11k: remove usage quota while processing rx packets The usage of quota variable inside ath11k_dp_rx_process_received_packets() is redundant. Since we would queue only max packets to the list before calling this function so it would never exceed quota. Hence removing usage of quota variable. Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.4.0.1.r2-00012-QCAHKSWPL_SILICONZ-1 Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-01695-QCAHKSWPL_SILICONZ-1 Co-developed-by: Sriram R Signed-off-by: Sriram R Signed-off-by: Jouni Malinen Signed-off-by: P Praneesh Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1630560820-21905-7-git-send-email-ppranees@codeaurora.org commit c4d12cb37ea2e6c2b70880350d7bf1bbbd825c6c Author: P Praneesh Date: Fri Nov 12 11:02:18 2021 +0200 ath11k: avoid active pdev check for each msdu The Active Pdev and CAC check are done for each msdu in ath11k_dp_rx_process_received_packets which is a overhead. To avoid this overhead, collect all msdus in a per mac msdu list and pass to function. Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.4.0.1.r2-00012-QCAHKSWPL_SILICONZ-1 Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-01695-QCAHKSWPL_SILICONZ-1 Co-developed-by: Sriram R Signed-off-by: Sriram R Signed-off-by: Jouni Malinen Signed-off-by: P Praneesh Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1630560820-21905-6-git-send-email-ppranees@codeaurora.org commit a1775e732eb90486519de3813b83a11b7fcee2d0 Author: P Praneesh Date: Fri Nov 12 11:02:12 2021 +0200 ath11k: avoid additional access to ath11k_hal_srng_dst_num_free In ath11k_dp_process_rx(), after processing rx_desc from ath11k_hal_srng_dst_get_next_entry(), ath11k_hal_srng_dst_num_free() is accessed everytime because of done flag is not set. To avoid this additional access to ath11k_hal_srng_dst_num_free(), increment total_msdu_reaped only when continuation is not set and update done flag correspondingly. Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.4.0.1.r2-00012-QCAHKSWPL_SILICONZ-1 Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-01695-QCAHKSWPL_SILICONZ-1 Co-developed-by: Sriram R Signed-off-by: Sriram R Signed-off-by: Jouni Malinen Signed-off-by: P Praneesh Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1630560820-21905-5-git-send-email-ppranees@codeaurora.org commit 5e76fe03dbf9f9dbc4fd454283b02594226c0718 Author: P Praneesh Date: Fri Nov 12 11:02:03 2021 +0200 ath11k: modify dp_rx desc access wrapper calls inline In data path, to reduce the CPU cycles spending on descriptor access wrapper function, changed those functions as static inline. Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.4.0.1.r2-00012-QCAHKSWPL_SILICONZ-1 Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-01695-QCAHKSWPL_SILICONZ-1 Co-developed-by: Sriram R Signed-off-by: Sriram R Signed-off-by: Jouni Malinen Signed-off-by: P Praneesh Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1630560820-21905-4-git-send-email-ppranees@codeaurora.org commit 6452f0a3d5651bb7edfd9c709e78973aaa4d3bfc Author: P Praneesh Date: Fri Nov 12 11:01:26 2021 +0200 ath11k: allocate dst ring descriptors from cacheable memory tcl_data and reo_dst rings are currently being allocated using dma_allocate_coherent() which is non cacheable. Allocating ring memory from cacheable memory area allows cached descriptor access and prefetch next descriptors to optimize CPU usage during descriptor processing on NAPI. Based on the hardware param we can enable or disable this feature for the corresponding platform. Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.4.0.1.r2-00012-QCAHKSWPL_SILICONZ-1 Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-01695-QCAHKSWPL_SILICONZ-1 Co-developed-by: Pradeep Kumar Chitrapu Signed-off-by: Pradeep Kumar Chitrapu Co-developed-by: Sriram R Signed-off-by: Sriram R Signed-off-by: Jouni Malinen Signed-off-by: P Praneesh Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1630560820-21905-3-git-send-email-ppranees@codeaurora.org commit 2c5545bfa29dd5305fa770959890a23ea39b5e69 Author: P Praneesh Date: Fri Nov 12 11:01:18 2021 +0200 ath11k: disable unused CE8 interrupts for ipq8074 Host driver doesn't need to process CE8 interrupts (used by target independently) The volume of interrupts is huge within short interval, CPU0 CPU1 CPU2 CPU3 14022188 0 0 0 GIC 71 Edge ce8 Hence disabling unused CE8 interrupt will improve CPU usage. Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.4.0.1.r2-00012-QCAHKSWPL_SILICONZ-1 Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-01695-QCAHKSWPL_SILICONZ-1 Co-developed-by: Sriram R Signed-off-by: Sriram R Signed-off-by: Jouni Malinen Signed-off-by: P Praneesh Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1630560820-21905-2-git-send-email-ppranees@codeaurora.org commit f187fe8e3bc65cc4d7b0916947e2d6cd65d9cd3a Author: Venkateswara Naralasetty Date: Thu Nov 11 20:50:02 2021 +0530 ath11k: fix firmware crash during channel switch Currently the updated bandwidth for the peer will be configured to the firmware after channel switch from the sta_rc_update_wk. If the updated bandwidth is greater than the configured peer phymode during the peer assoc may result firmware assert. For example, initially AP is in HE40 mode and the peer phymode is configured as MODE_11AX_HE40 during peer assoc. Now user change the channel width to HE80 then, the peer bandwidth will be updated as HE80 to the firmware. This will trigger firmware assert due to peer bandwidth is greater than the peer phymode. Fix this issue by sending peer assoc command before setting the updated peer bandwith to firmware. Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1 Signed-off-by: Venkateswara Naralasetty Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1636644002-25446-1-git-send-email-quic_vnaralas@quicinc.com commit 83c9eee72603adbaaf0420eb2c4d537a9d65d5fe Author: Dmitry Shmidt Date: Thu Oct 7 11:01:30 2021 -0700 arm64: dts: meson-sm1-odroid: add cec nodes Enable CEC in same way it is done for other meson odroid devices Signed-off-by: Dmitry Shmidt Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20211007180130.805401-1-dimitrysh@google.com commit 624e0a3170309eeb5b729f7a43c1ba3234325f02 Author: Seevalamuthu Mariappan Date: Thu Nov 11 11:22:47 2021 +0530 ath11k: Fix 'unused-but-set-parameter' error Below compilation error is reported when built with W=1, drivers/net/wireless/ath/ath11k/mac.c:5408:22: error: parameter 'changed_flags' set but not used [-Werror,-Wunused-but-set-parameter] changed_flags is set, but left unused. So, remove unnecessary set. Compile tested only. Reported-by: kernel test robot Signed-off-by: Seevalamuthu Mariappan Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1636609967-5114-1-git-send-email-quic_seevalam@quicinc.com commit 31aeaf547d7e3b64ba5d5442dabc530bdb9e216e Author: Karthikeyan Periyasamy Date: Wed Nov 10 21:51:30 2021 +0530 ath11k: fix DMA memory free in CE pipe cleanup In CE pipe cleanup, DMA memory gets freed by the aligned address (base_addr_owner_space) which is wrong. It needs to be freed by the address (base_addr_owner_space_unaligned) returned by dma_alloc. So free the dma memory by the proper address. This was found in code review. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-00729-QCAHKSWPL_SILICONZ-3 v2 Signed-off-by: Karthikeyan Periyasamy Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1636561290-18966-1-git-send-email-quic_periyasa@quicinc.com commit 4c375743c5fe1ef84d1dd7269dd12585957f403e Author: Karthikeyan Periyasamy Date: Wed Nov 10 21:36:28 2021 +0530 ath11k: avoid unnecessary BH disable lock in STA kickout event In STA kickout event processing, the peer object is protected under spin lock BH. Release this lock after picking up the vdev_id from the peer object instead after ieee80211_report_low_ack(). This will minimize the lock hold period which will improve performance since base_lock is used across the data path. This was found in code review. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-00729-QCAHKSWPL_SILICONZ-3 v2 Signed-off-by: Karthikeyan Periyasamy Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1636560388-24955-1-git-send-email-quic_periyasa@quicinc.com commit aa52b008441fb5a5df01c1d016e5172d2ebc6579 Author: Lad Prabhakar Date: Wed Nov 10 22:46:17 2021 +0000 dt-bindings: pinctrl: renesas,rzg2l-pinctrl: Add output-impedance-ohms property RZ/G2L SoC has two groups of pins, Group-A and Group-B. RZ/G2L SoC supports configuring Output Impedance for Group-B pins (valid values 33/50/66/100). Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Reviewed-by: Rob Herring Link: https://lore.kernel.org/r/20211110224622.16022-2-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 4ea03443ecdac6920eb7aa3a9da2cd0b8cc6dfc8 Author: Karthikeyan Periyasamy Date: Wed Nov 10 21:05:57 2021 +0530 ath11k: fix error routine when fallback of add interface fails When there is an error in add interface process from ath11k_mac_set_kickout(), the code attempts to handle a fallback for add_interface. When this fallback succeeds, the driver returns zero rather than error code. This leads to success for the non created VAP. In cleanup, driver gets remove interface callback for the non created VAP and proceeds to self peer delete request which leads to FW assert. Since it was already deleted on the fallback of add interface, return the actual error code instead of fallback return code. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-00729-QCAHKSWPL_SILICONZ-3 v2 Signed-off-by: Karthikeyan Periyasamy Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1636558557-2874-1-git-send-email-quic_periyasa@quicinc.com commit 85f36923be47b6990215ad444545a6a85133a0c6 Author: Karthikeyan Periyasamy Date: Fri Nov 12 10:03:40 2021 +0200 ath11k: fix fw crash due to peer get authorized before key install Firmware expects host to authorize the peer after the successful key install. But host authorize the peer before the key install, this trigger the firmware assert which leads to Q6 crash. To avoid this Q6 crash, host should authorize the peer after the key install. So introduce is_authorized in peer object to identify that peer is authorize or not. When IEEE80211_STA_CONTROL_PORT flag is unset, peer move to authorize state before the vdev up. When the same flag is set then peer move to authorize state after vdev up. So added authorise check in ath11k_bss_assoc() to handle the earlier state transition case. Also added the WMI authorize procedure in ath11k_mac_op_sta_state() to handle the non-earlier state transition case. Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-01492-QCAHKSWPL_SILICONZ-1 Signed-off-by: Karthikeyan Periyasamy Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1636554200-12345-1-git-send-email-quic_periyasa@quicinc.com commit 032816fbbfafe3198bb5c71fbbe4e8e5be33b352 Author: Lad Prabhakar Date: Wed Oct 27 14:45:07 2021 +0100 pinctrl: pinconf-generic: Add support for "output-impedance-ohms" to be extracted from DT files Add "output-impedance-ohms" property to generic options used for DT parsing files. This enables drivers, which use generic pin configurations, to get the value passed to this property. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20211027134509.5036-3-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 7388fa8acfce2c3b41babc53c3f3d0b247b098af Author: Lad Prabhakar Date: Wed Oct 27 14:45:06 2021 +0100 dt-bindings: pincfg-node: Add "output-impedance-ohms" property On RZ/G2L SoC for Group-B pins, output impedance can be configured. This patch documents "output-impedance-ohms" property in pincfg-node.yaml so that other platforms requiring such feature can make use of this property. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Acked-by: Rob Herring Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20211027134509.5036-2-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit fea2538025fefb8f0f9fea558154e293df2f7464 Author: Geert Uytterhoeven Date: Tue Oct 19 14:34:22 2021 +0200 pinctrl: renesas: rza1: Fix kerneldoc function names make W=1: drivers/pinctrl/renesas/pinctrl-rza1.c:770: warning: expecting prototype for rza1_gpio_disable_free(). Prototype was for rza1_gpio_free() instead drivers/pinctrl/renesas/pinctrl-rza1.c:889: warning: expecting prototype for rza1_parse_pmx_function(). Prototype was for rza1_parse_pinmux_node() instead Fixes: 5a49b644b3075f88 ("pinctrl: Renesas RZ/A1 pin and gpio controller") Signed-off-by: Geert Uytterhoeven Reviewed-by: Jacopo Mondi Link: https://lore.kernel.org/r/2188ede78110c64b8a3bfbfa794a085dac0e4cd2.1634645735.git.geert+renesas@glider.be commit f9a2adcc9e908907129c18518d4ea6195c44bf00 Author: Lad Prabhakar Date: Tue Nov 9 12:31:10 2021 +0000 arm64: dts: renesas: r9a07g044: Add SCI[0-1] nodes Add SCI[0-1] nodes to r9a07g044 (RZ/G2L) SoC DTSI. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20211109123110.8543-1-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 5a8aa63c9bca800e6049d90422abe5404227a703 Author: Lad Prabhakar Date: Wed Nov 3 19:56:00 2021 +0000 arm64: dts: renesas: rzg2l-smarc: Enable SCIF2 on carrier board SCIF2 interface is available on PMOD1 connector (CN7) on carrier board, This patch adds pinmux and scif2 node to carrier board dtsi file. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20211103195600.23964-4-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit 68f8eb19c18a377181622e58c1fd2ca0f5c0d15d Author: Lad Prabhakar Date: Wed Nov 3 19:55:58 2021 +0000 arm64: dts: renesas: r9a07g044: Add SCIF[1-4] nodes Add SCIF[1-4] nodes to r9a07g044 (RZ/G2L) SoC DTSI. Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das Link: https://lore.kernel.org/r/20211103195600.23964-2-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven commit ac0c9be91ae82c281637d3413bf321d3f8920230 Author: Gabriel Goller Date: Fri Nov 12 21:35:52 2021 +0100 staging: wlan-ng: Removed unused comments Removed commented-out code pieces that are unnecessary. Signed-off-by: Gabriel Goller Link: https://lore.kernel.org/r/YY7QKNB7egKuTC36@desktop Signed-off-by: Greg Kroah-Hartman commit fca00dc456bd9ee1fdc4b507f8a8d953cc479966 Author: Tommaso Merciai Date: Sat Nov 13 11:21:20 2021 +0100 staging: vt6655: fix camelcase in bRadioOff Replace camel case variable bRadioOff with snake case variable radio_off. Drop Hungarian notation prefix in `bRadioOff` variable. Change it to use snake case. Signed-off-by: Tommaso Merciai Link: https://lore.kernel.org/r/20211113102126.82904-1-tomm.merciai@gmail.com Signed-off-by: Greg Kroah-Hartman commit 74b1dc3630636ef87b9d74b913e686769a8643cd Author: Martin Kaiser Date: Thu Nov 11 22:26:44 2021 +0100 staging: r8188eu: simplify two boolean assignments There's no need to use the ? operator and to set true and false explicitly. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211111212644.9011-7-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 80d21b0a5d6560c481082254ec934a0369c324fd Author: Martin Kaiser Date: Thu Nov 11 22:26:43 2021 +0100 staging: r8188eu: merge three small functions ReadAdapterInfo8188EU calls _ReadAdapterInfo8188EU. _ReadAdapterInfo8188EU calls _ReadPROMContent. Each of these functions is small and has only one caller. Move all their code into ReadAdapterInfo8188EU. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211111212644.9011-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 216506a986b25051e5a536e6c3d35ccf004a6bcd Author: Martin Kaiser Date: Thu Nov 11 22:26:42 2021 +0100 staging: r8188eu: rf_chip is constant For this driver, rf_chip is always RF_6052. Remove the rf_chip component from struct hal_data_8188e and resulting dead code. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211111212644.9011-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 9f784c8214e1d905f30da25159815095c0b2df4e Author: Martin Kaiser Date: Thu Nov 11 22:26:41 2021 +0100 staging: r8188eu: remove autoload check In Hal_InitPGData88E, the same code is run, regardless of bautoload_fail_flag. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211111212644.9011-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit c4120aaefbeabfbbcb4c6a30cc031dc5495abecf Author: Martin Kaiser Date: Thu Nov 11 22:26:40 2021 +0100 staging: r8188eu: remove haldata's EEPROMSubCustomerID It is used only in a (disabled) debug print. We can now remove two functions that parsed eeprom info and populated haldata components. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211111212644.9011-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 704a47655e79ed640a71442bd1673660672ef817 Author: Martin Kaiser Date: Thu Nov 11 22:26:39 2021 +0100 staging: r8188eu: remove haldata's EEPROMCustomerID It is used only in a (disabled) debug print. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211111212644.9011-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 49ee664299ec6c9eef489dd823d39648a02070e7 Author: Martin Kaiser Date: Thu Nov 11 22:26:38 2021 +0100 staging: r8188eu: remove haldata's EEPROMVID / PID They are used only in a (disabled) debug print. In practice, lsusb can be used to read the actual vid and pid. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211111212644.9011-1-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit d8a5b29b3d75464f5f83ed1b29951483121e744d Author: Saurav Girepunje Date: Mon Nov 8 09:41:22 2021 +0530 staging: rtl8192u: remove the if condition without effect In function rtl8192_adapter_start priv->pFirmware->firmware_status is assign to FW_STATUS_0_INIT just after assignment variable is again get check for same value. Therefore if condition will be always be true. So remove the if condition ,else if section and else section which will never get execute. Signed-off-by: Saurav Girepunje Link: https://lore.kernel.org/r/YYijapuGOmObwM3S@Sauravs-MacBook-Air.local Signed-off-by: Greg Kroah-Hartman commit 01d80b6ed2e3dd534709856a1bc4a5c18672e47c Author: Saurav Girepunje Date: Sun Nov 7 23:38:30 2021 +0530 staging: rtl8723bs: core: avoid unnecessary if condition In function rtw_lps_change_dtim_hdl remove the if condition check to compare the pwrpriv->dtim to dtim . If both are not equal dtim is getting assign to pwrpriv->dtim. But if both are equal assigning dtim to pwrpriv->dtim will not make any difference on value. So remove the unnecessary if condition check. Signed-off-by: Saurav Girepunje Link: https://lore.kernel.org/r/YYgWHt+PpyqOv40R@Sauravs-MacBook-Air.local Signed-off-by: Greg Kroah-Hartman commit d79c38617440b1f30d5a2936961fb7adbc46fcc4 Author: Saurav Girepunje Date: Sun Nov 7 22:13:10 2021 +0530 staging: r8188eu: os_dep: Change the return type of function Change the return type of rtw_init_default_value function from u8 to void. This function always return success. This is called from rtw_init_drv_sw where the return value from this function is assign to local variable but the local variable value is never checked. After change the return type to void remove the local variable ret8 in rtw_init_drv_sw function. Signed-off-by: Saurav Girepunje Link: https://lore.kernel.org/r/YYgCHkVXFQ4r9dVp@Sauravs-MacBook-Air.local Signed-off-by: Greg Kroah-Hartman commit 4b99dd7d212bd8bd539bfc7d689d8b6e366f22a7 Author: Martin Kaiser Date: Sun Nov 7 17:16:24 2021 +0100 staging: r8188eu: remove efuse write functions The r8188eu driver in its current state does not need write access to the efuses. Only read access is required to get the chip id, the mac address and other settings. This patch removes a lot of unused code for writing the efuses. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211107161624.9452-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 7e90e57307dfa93cc381f134d9012c0a670d7597 Author: Martin Kaiser Date: Sun Nov 7 17:16:23 2021 +0100 staging: r8188eu: remove write support from rtl8188e_EfusePowerSwitch The rtl8188e_EfusePowerSwitch function has a write parameter that is set to false by its callers. Remove the parameter and resulting dead code. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211107161624.9452-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 1a7b609415df0086c56da64af207194cb20f9694 Author: Martin Kaiser Date: Sun Nov 7 15:31:00 2021 +0100 staging: r8188eu: clean up _PHY_PathADDAOn The only caller sets isPathAOn = true and is2t = false. Remove the parameters and resulting dead code. Make the function static, it's used only inside HalPhyRf_8188e.c. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211107143100.9047-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit ddf8a086433b87719b108c6c9d8920f08b11cd76 Author: Martin Kaiser Date: Sun Nov 7 15:30:59 2021 +0100 staging: r8188eu: remove constant phy_IQCalibrate_8188E parameter The only caller of phy_IQCalibrate_8188E sets the is2t parameter to false. Remove the parameter and resulting dead code. This includes the phy_PathB_IQK_8188E and _PHY_PathAStandBy functions. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211107143100.9047-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 057957d998ada8f57435762cbec6e01b173c9fd8 Author: Martin Kaiser Date: Sun Nov 7 15:30:58 2021 +0100 staging: r8188eu: remove unused phy_PathA_RxIQK parameter phy_PathA_RxIQK does not use its configPathB parameter. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211107143100.9047-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 6304daa08728fd138b27f8877948dbe9c4e459c2 Author: Martin Kaiser Date: Sun Nov 7 15:30:57 2021 +0100 staging: r8188eu: remove unused phy_PathA_IQK_8188E parameter The phy_PathA_IQK_8188E function does not use its configPathB parameter. It can be removed. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211107143100.9047-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 2e90094fb72038dd977b1cee67e2104692f9fbf3 Author: Sidong Yang Date: Sun Nov 7 10:59:47 2021 +0000 staging: pi433: print rf69 debug message more detail When pi433 failed for rf69 configuration, Debug message should help for finding which value is incorrect. But it's hard to know because it just prints "illegal value". This patch make print message more detail. Signed-off-by: Sidong Yang Link: https://lore.kernel.org/r/20211107105947.21928-1-realwakka@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6332e45626981a74cd35b6e558f21d46e3a469a4 Author: Phillip Potter Date: Sat Nov 6 23:16:36 2021 +0000 staging: r8188eu: remove MSG_88E macro Remove MSG_88E macro from include/rtw_debug.h, as it no longer has any callers within the driver. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20211106231636.894-3-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit 8b3312cac072309d6c6d38119ee36cebd5a71ef6 Author: Phillip Potter Date: Sat Nov 6 23:16:35 2021 +0000 staging: r8188eu: convert final two MSG_88E calls to netdev_dbg Convert final two MSG_88E calls to use netdev_dbg instead. They seem to contain useful information so rather than delete them outright, it makes sense to convert them over to use the kernel's dynamic debugging/logging facility as other network drivers do. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20211106231636.894-2-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit eb3bdf59803905c40c7b32650b12258995dab69a Author: Tommaso Merciai Date: Sat Nov 6 19:48:19 2021 +0100 staging: vt6655: fix camelcase byData in card.c Replace camelcase variable "byData" into linux kernel coding style equivalent variable "data" in card.c. "by" prefix in hungarian notation stands for byte or unsigned char References: https://www.kernel.org/doc/html/latest/process/coding-style.html https://www.cse.iitk.ac.in/users/dsrkg/cs245/html/Guide.htm Signed-off-by: Tommaso Merciai Link: https://lore.kernel.org/r/20211106184822.24242-1-tomm.merciai@gmail.com Signed-off-by: Greg Kroah-Hartman commit f3f23022a01fbbf8b0f3a61c02ac910d542a0433 Author: Saurav Girepunje Date: Fri Nov 5 22:23:30 2021 +0530 staging: rtl8723bs: core: remove unused local variable padapter Remove the unused variable padapter from Efuse_Write1ByteToFakeContent This variable is not used in the function. Signed-off-by: Saurav Girepunje Link: https://lore.kernel.org/r/20211105165330.78524-3-saurav.girepunje@gmail.com Signed-off-by: Greg Kroah-Hartman commit ed8f72e55451efa7a1b5614c427ab1b19e8ef842 Author: Saurav Girepunje Date: Fri Nov 5 22:23:29 2021 +0530 staging: rtl8723bs: core: remove unused variable pAdapter Remove the unused variable pAdapter from Efuse_Read1ByteFromFakeContent This variable is not used in the function. Signed-off-by: Saurav Girepunje Link: https://lore.kernel.org/r/20211105165330.78524-2-saurav.girepunje@gmail.com Signed-off-by: Greg Kroah-Hartman commit afa9755e359dcabc3f9127c1869a50e37777cdcc Author: Noralf Trønnes Date: Fri Nov 5 21:24:48 2021 +0100 staging: fbtft: Remove fb_watterott driver This driver was made for a prototype and as far as I know it never went into production because it was too slow. So let's remove it. Acked-by: Sam Ravnborg Signed-off-by: Noralf Trønnes Link: https://lore.kernel.org/r/20211105202448.62518-1-noralf@tronnes.org Signed-off-by: Greg Kroah-Hartman commit 0de963e2f9feea88124f23b24ed4e55db209d949 Author: Phillip Potter Date: Fri Nov 5 00:28:07 2021 +0000 staging: r8188eu: remove MSG_88E call from odm_TXPowerTrackingThermalMeterInit Remove unnecessary MSG_88E macro call from hal/odm.c, within the function odm_TXPowerTrackingThermalMeterInit. All it does is print a struct member, during initialization, that is then immediately set on the following line. It is therefore surplus to requirements. Signed-off-by: Phillip Potter Link: https://lore.kernel.org/r/20211105002807.6628-1-phil@philpotter.co.uk Signed-off-by: Greg Kroah-Hartman commit e4a5be23b835d015f06a419c09cb5eded84316c1 Author: Saurav Girepunje Date: Thu Nov 4 08:52:42 2021 +0530 staging: r8188eu: core: remove the unused variable pAdapter Remove the unused variable pAdapter from Efuse_Write1ByteToFakeContent This variable is not used in the function. Signed-off-by: Saurav Girepunje Link: https://lore.kernel.org/r/YYNSAqGgDPhV1IE1@Sauravs-MacBook-Air.local Signed-off-by: Greg Kroah-Hartman commit 46cf602a65209608a1291eea3597e1cde86488bc Author: Saurav Girepunje Date: Thu Nov 4 08:32:58 2021 +0530 staging: r8188eu: core: remove unused variable sz Remove the unused variable sz from function dynamic_chk_wk_hdl. This variable is not used on function. Signed-off-by: Saurav Girepunje Link: https://lore.kernel.org/r/YYNNDXtkICWpk6qj@Sauravs-MacBook-Air.local Signed-off-by: Greg Kroah-Hartman commit 70f15d205468fd148cb4c61c70146da1a177e09d Author: Saurav Girepunje Date: Thu Nov 4 08:16:35 2021 +0530 staging: r8188eu: core: remove the function __nat25_timeout Remove the function __nat25_timeout from rtw_br_ext.c file. This function can be replace by single statement jiffies - NAT25_AGEING_TIME*HZ. Signed-off-by: Saurav Girepunje Link: https://lore.kernel.org/r/YYNJPCQ5hX8BTzwy@Sauravs-MacBook-Air.local Signed-off-by: Greg Kroah-Hartman commit b865f36cadaf2e1c94059849cfeff9959568e2cb Author: Saurav Girepunje Date: Wed Nov 3 21:18:41 2021 +0530 staging: r8188eu: os_dep: remove the goto statement Remove the goto statement from rtw_init_drv_sw(). In this function goto can be replace by return statement. As on goto label exit, function only return it is not performing any cleanup. Avoiding goto will improve the function readability. Signed-off-by: Saurav Girepunje Link: https://lore.kernel.org/r/YYKvWeyqd71pYSqM@Sauravs-MacBook-Air.local Signed-off-by: Greg Kroah-Hartman commit a9413afabf35bc3e6512a998f7075c54ace12d42 Author: Martin Kaiser Date: Tue Nov 2 09:18:33 2021 +0100 staging: r8188eu: remove ODM_Write4Byte Remove the ODM_Write4Byte wrapper and call rtw_write32 directly. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211102081833.18054-6-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit c4073f2b3df89704687ac43f781a8cdc67be50f0 Author: Martin Kaiser Date: Tue Nov 2 09:18:32 2021 +0100 staging: r8188eu: remove ODM_Write2Byte Remove the ODM_Write2Byte wrapper and call rtw_write16 directly. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211102081833.18054-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit f02cbfd17a884c9184c50146cdeb7a7f73680a32 Author: Martin Kaiser Date: Tue Nov 2 09:18:31 2021 +0100 staging: r8188eu: remove ODM_Write1Byte Remove the ODM_Write1Byte wrapper and call rtw_write8 directly. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211102081833.18054-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 28ea10d5600480271825cecacdd7483655ad37be Author: Martin Kaiser Date: Tue Nov 2 09:18:30 2021 +0100 staging: r8188eu: remove ODM_Read4Byte Remove the ODM_Read4Byte wrapper and call rtw_read32 directly. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211102081833.18054-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit a6bf4b882702a91536ec9aaadb97e9c1b2446911 Author: Martin Kaiser Date: Tue Nov 2 09:18:29 2021 +0100 staging: r8188eu: remove ODM_Read1Byte This is just a wrapper that calls rtw_read8. Remove the wrapper and call rtw_read8 directly. Signed-off-by: Martin Kaiser Link: https://lore.kernel.org/r/20211102081833.18054-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman commit 4c7924fb905b02323ff6d9d20f370892615dccfa Author: Julien Massot Date: Fri Oct 22 14:21:01 2021 +0200 soc: renesas: rcar-rst: Add support to set rproc boot address R-Car Gen3 SoC series has a realtime processor, the boot address of this processor can be set thanks to CR7BAR register of the reset module. Export this function so that it's possible to set the boot address from a remoteproc driver. Also drop the __initdata qualifier on rcar_rst_base, since we will use this address later than init time. Signed-off-by: Julien Massot Link: https://lore.kernel.org/r/20211022122101.66998-1-julien.massot@iot.bzh Signed-off-by: Geert Uytterhoeven commit 099ee03271208c880aa33b8833edfacd5010a89a Author: Geert Uytterhoeven Date: Tue Oct 19 14:35:36 2021 +0200 clk: renesas: rzg2l: Add missing kerneldoc for resets make W=1: drivers/clk/renesas/rzg2l-cpg.c:95: warning: Function parameter or member 'num_resets' not described in 'rzg2l_cpg_priv' Add the missing kerneldoc for fields in struct rzg2l_cpg_priv and struct rzg2l_cpg_info related to Module Resets. Fixes: c3e67ad6f5a2c698 ("dt-bindings: clock: r9a07g044-cpg: Update clock/reset definitions") Signed-off-by: Geert Uytterhoeven Reviewed-by: Niklas Söderlund Link: https://lore.kernel.org/r/39c2c5fd4232b6620a4a56dba4e2b0d61476ee36.1634646869.git.geert+renesas@glider.be commit 1ab0a62f28c9347a5abb9ff9ba544271deb45f87 Author: Geert Uytterhoeven Date: Thu Oct 14 16:44:12 2021 +0200 ARM: dts: r8a7742-iwg21d-q7-dbcm-ca: Add missing camera regulators make dtbs_check: arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dt.yaml: ov5640@3c: 'AVDD-supply' is a required property From schema: Documentation/devicetree/bindings/media/i2c/ovti,ov5640.yaml arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dt.yaml: ov5640@3c: 'DVDD-supply' is a required property From schema: Documentation/devicetree/bindings/media/i2c/ovti,ov5640.yaml arch/arm/boot/dts/r8a7742-iwg21d-q7-dbcm-ca.dt.yaml: ov5640@3c: 'DOVDD-supply' is a required property From schema: Documentation/devicetree/bindings/media/i2c/ovti,ov5640.yaml Fix this by describing the missing regulators. Signed-off-by: Geert Uytterhoeven Reviewed-by: Kieran Bingham Link: https://lore.kernel.org/r/300149c730931914b77e17df6bcce89b67c3005f.1634222546.git.geert+renesas@glider.be commit 85744f2d938c5f3cfc44cb6533c157469634da93 Author: Wan Jiabing Date: Sun Oct 17 21:45:03 2021 -0400 ARM: shmobile: rcar-gen2: Add missing of_node_put() Fix following coccicheck warning: ./arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c:156:1-33: Function for_each_matching_node_and_match should have of_node_put() before break and goto. Early exits from for_each_matching_node_and_match() should decrement the node reference counter. Signed-off-by: Wan Jiabing Link: https://lore.kernel.org/r/20211018014503.7598-1-wanjiabing@vivo.com Signed-off-by: Geert Uytterhoeven commit 5efe5721c18c326036ca71bec4fb56472e1f9350 Author: Cai Huoqing Date: Tue Nov 9 12:55:20 2021 +0000 media: rc: ir-hix5hd2: Add the dependency on HAS_IOMEM The helper function devm_platform_ioremap_resource() needs HAS_IOMEM enabled, so add the dependency on HAS_IOMEM. Signed-off-by: Cai Huoqing Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 99076cd117c4cb51c684c066fb6bb85e23cb0624 Author: Maíra Canal Date: Thu Nov 4 18:50:18 2021 +0000 media: ir-rx51: Switch to atomic PWM API Remove legacy PWM interface (pwm_config, pwm_enable, pwm_disable) and replace it for the atomic PWM API. Signed-off-by: Maíra Canal Reviewed-by: Uwe Kleine-König Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 8985696ad985f5311975d177f83e95127f0523c7 Author: Maíra Canal Date: Wed Oct 27 16:34:30 2021 +0100 media: rc: pwm-ir-tx: Switch to atomic PWM API Remove legacy PWM interface (pwm_config, pwm_enable, pwm_disable) and replace it for the atomic PWM API. Signed-off-by: Maíra Canal Acked-by: Uwe Kleine-König Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit 220546727ab5acd61d6f307cf4d11998c873db4f Author: Uwe Kleine-König Date: Wed Oct 20 13:59:32 2021 +0100 media: rc: ir-spi: Drop empty spi_driver remove callback A driver with a remove callback that just returns 0 behaves identically to a driver with no remove callback at all. So simplify accordingly. Signed-off-by: Uwe Kleine-König Reviewed-by: Kieran Bingham Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab commit f1af0c562f74b67d8752005a1d92ff3b855fa99a Author: Christophe JAILLET Date: Thu Oct 14 19:12:35 2021 +0100 media: mtk-vcodec: Remove redundant 'flush_workqueue()' calls 'destroy_workqueue()' already drains the queue before destroying it, so there is no need to flush it explicitly. Remove the redundant 'flush_workqueue()' calls. This was generated with coccinelle: @@ expression E; @@ - flush_workqueue(E); destroy_workqueue(E); Signed-off-by: Christophe JAILLET Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 360c887a39cb56e75be4f558b16f1b6409ecb93f Author: Christophe JAILLET Date: Thu Oct 14 19:21:43 2021 +0100 media: mtk-vpu: Remove redundant 'flush_workqueue()' calls 'destroy_workqueue()' already drains the queue before destroying it, so there is no need to flush it explicitly. Remove the redundant 'flush_workqueue()' calls. This was generated with coccinelle: @@ expression E; @@ - flush_workqueue(E); destroy_workqueue(E); Signed-off-by: Christophe JAILLET Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 09f4d1513267d0ab712f5d29e7bd136535748709 Author: Randy Dunlap Date: Sun Nov 7 18:19:23 2021 +0000 media: correct MEDIA_TEST_SUPPORT help text Fix grammar/wording in the help text for MEDIA_TEST_SUPPORT. Fixes: 4b32216adb01 ("media: split test drivers from platform directory") Signed-off-by: Randy Dunlap Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 4eb684bd22a2b43f17dd8c9fcbd60ab612512297 Author: Tzung-Bi Shih Date: Wed Nov 10 07:56:11 2021 +0000 media: mtk-vcodec: vdec: remove redundant 'pfb' assignment A clang-analyzer warning was reported. >> drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_stateless.c:133:18: warning: Value stored to 'pfb' during its initialization is never read [clang-analyzer-deadcode.DeadStores] struct vdec_fb *pfb = &framebuf->frame_buffer; ^~~ ~~~~~~~~~~~~~~~~~~~~~~~ Removes the redundant 'pfb' assignment to fix. Reported-by: kernel test robot Signed-off-by: Tzung-Bi Shih Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d9fbdedc56eabb9c5d49b37d8b1f8189fa48a4c8 Author: Dillon Min Date: Thu Oct 28 07:40:20 2021 +0100 media: stm32-dma2d: fix compile-testing failed get compile-test failed report from lkp@intel.com after the driver submitted. "ld.lld: error: undefined symbol: v4l2_fh_init" so, make CONFIG_STM32_DMA2D depends on CONFIG_VIDEO_DEV and CONFIG_VIDEO_V4L2 to fix this compile error. Fixes: bff6e3e2f4c9 ("media: stm32-dma2d: STM32 DMA2D driver") Reported-by: kernel test robot Signed-off-by: Dillon Min Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 147907e9322406beb5d0da7fd9ff4e789fc38b9f Author: Dillon Min Date: Sun Nov 7 14:41:44 2021 +0000 media: stm32-dma2d: fix compile errors when W=1 remove unused functions to avoid compile errors when W=1. >> drivers/media/platform/stm32/dma2d/dma2d-hw.c:29:20: error: unused function 'reg_set' [-Werror,-Wunused-function] static inline void reg_set(void __iomem *base, u32 reg, u32 mask) >> drivers/media/platform/stm32/dma2d/dma2d-hw.c:34:20: error: unused function 'reg_clear' [-Werror,-Wunused-function] static inline void reg_clear(void __iomem *base, u32 reg, u32 mask) Fixes: bff6e3e2f4c9 ("media: stm32-dma2d: STM32 DMA2D driver") Reported-by: kernel test robot Signed-off-by: Dillon Min Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit af6d1bde395cac174ee71adcd3fa43f6435c7206 Author: Jammy Huang Date: Tue Nov 9 03:12:27 2021 +0000 media: aspeed: Update signal status immediately to ensure sane hw state If res-chg, VE_INTERRUPT_MODE_DETECT_WD irq will be raised. But v4l2_input_status won't be updated to no-signal immediately until aspeed_video_get_resolution() in aspeed_video_resolution_work(). During the period of time, aspeed_video_start_frame() could be called because it doesn't know signal becomes unstable now. If it goes with aspeed_video_init_regs() of aspeed_video_irq_res_change() simultaneously, it will mess up hw state. To fix this problem, v4l2_input_status is updated to no-signal immediately for VE_INTERRUPT_MODE_DETECT_WD irq. Fixes: d2b4387f3bdf ("media: platform: Add Aspeed Video Engine driver") Signed-off-by: Jammy Huang Acked-by: Paul Menzel Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 29ba42670900ed57e6bf79d57d5dd31abc85bc48 Author: Hans Verkuil Date: Mon Nov 8 12:06:52 2021 +0000 media: drivers/index.rst: add missing rkisp1 entry The Documentation/driver-api/media/drivers/rkisp1.rst file wasn't referenced in the index.rst file, so it was never included. Add it. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit b5150b6ec1cf45c2f499b501b6622a562437ee37 Author: Yunfei Dong Date: Thu Nov 4 12:24:26 2021 +0000 media: mtk-vcodec: Align width and height to 64 bytes Width and height need to 64 bytes aligned when setting the format. Need to make sure all is 64 bytes align when use width and height to calculate buffer size. Signed-off-by: Yunfei Dong Acked-by: Nicolas Dufresne Tested-by: Steve Cho Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit cd9d9377ed235b294a492a094e1666178a5e78fd Author: Hans Verkuil Date: Wed Nov 3 12:28:31 2021 +0000 media: v4l2-ioctl.c: readbuffers depends on V4L2_CAP_READWRITE If V4L2_CAP_READWRITE is not set, then readbuffers must be set to 0, otherwise v4l2-compliance will complain. A note on the Fixes tag below: this patch does not really fix that commit, but it can be applied from that commit onwards. For older code there is no guarantee that device_caps is set, so even though this patch would apply, it will not work reliably. Signed-off-by: Hans Verkuil Fixes: 049e684f2de9 (media: v4l2-dev: fix WARN_ON(!vdev->device_caps)) Cc: Signed-off-by: Mauro Carvalho Chehab commit 0a1c80c6570005ddc516cf649e0ced76c3d680e5 Author: Hans Verkuil Date: Tue Nov 2 12:24:27 2021 +0000 media: cec-ioc-receive.rst: clarify sequence and status fields Improve the documentation for CEC_RECEIVE/TRANSMIT w.r.t. the sequence and tx/rx_status fields. Also remove a duplicate tx_status description. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d7894721f73bf5f135233625985a17043fa836a2 Author: Kwang Son Date: Tue Nov 2 11:17:47 2021 +0000 media: docs: Fix newline typo Fix example code which has missing or double backslash typo. Signed-off-by: Kwang Son Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 22be5a10d0b24eec9e45decd15d7e6112b25f080 Author: Dongliang Mu Date: Mon Nov 1 09:55:39 2021 +0000 media: em28xx: fix memory leak in em28xx_init_dev In the em28xx_init_rev, if em28xx_audio_setup fails, this function fails to deallocate the media_dev allocated in the em28xx_media_device_init. Fix this by adding em28xx_unregister_media_device to free media_dev. BTW, this patch is tested in my local syzkaller instance, and it can prevent the memory leak from occurring again. CC: Pavel Skripkin Fixes: 37ecc7b1278f ("[media] em28xx: add media controller support") Signed-off-by: Dongliang Mu Reported-by: syzkaller Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 91bd11a4a56895a9bf03c0be4ff15bd7caaaee0d Author: Niklas Söderlund Date: Thu Oct 28 10:37:49 2021 +0100 media: dt-bindings: adv748x: Convert bindings to json-schema Convert ADV748X analog video decoder documentation to json-schema. While converting the bindings extend it to enforce that all port@n nodes shall be encapsulated inside a ports node. This change does not have an effect on drivers parsing the ports@n nodes. Signed-off-by: Niklas Söderlund Reviewed-by: Geert Uytterhoeven Reviewed-by: Kieran Bingham Reviewed-by: Rob Herring Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 019b48989f2223320a7ffc4f6631d8b9354051fb Author: Christophe JAILLET Date: Sat Oct 23 11:10:48 2021 +0100 media: s5p-mfc: Use 'bitmap_zalloc()' when applicable 'mfc_dev->mem_bitmap' is a bitmap. So use 'bitmap_zalloc()' to simplify code and improve the semantic. Also change the corresponding 'kfree()' into 'bitmap_free()' to keep consistency. Signed-off-by: Christophe JAILLET Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 4406c813050727fce157e416851ddee389d0b135 Author: Kieran Bingham Date: Fri Oct 22 11:06:44 2021 +0100 media: tw5864: Disable PCI device when finished The cleanup in tw5864_finidev() neglected to disable the PCI device after enabling it in tw5864_initdev(). Call pci_disable_device() after releasing the associated resources. Signed-off-by: Kieran Bingham Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 901181b7ff1659893f8714a7752465a9b719f19f Author: Christophe JAILLET Date: Sat Oct 16 09:40:29 2021 +0100 media: tw5864: Simplify 'tw5864_finidev()' Some resources are allocated with 'pci_request_regions()', so use 'pci_release_regions()' to free them, instead of a verbose 'release_mem_region()'. There is no point in calling 'devm_kfree()'. The corresponding resource is managed, so it will be fried automatically. Signed-off-by: Christophe JAILLET Reviewed-by: Kieran Bingham Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 20c82fffd6d2bcc35ae63bad81df150b20301ec7 Author: Cai Huoqing Date: Thu Oct 21 09:41:42 2021 +0100 media: gspca: Make use of the helper macro kthread_run() Repalce kthread_create/wake_up_process() with kthread_run() to simplify the code. Signed-off-by: Cai Huoqing Reviewed-by: Kieran Bingham Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 62cea52ad4bead0ae4be2cfe1142eb0aae0e9fbd Author: Jammy Huang Date: Wed Nov 3 08:23:54 2021 +0000 media: aspeed: fix mode-detect always time out at 2nd run aspeed_video_get_resolution() will try to do res-detect again if the timing got in last try is invalid. But it will always time out because VE_SEQ_CTRL_TRIG_MODE_DET is only cleared after 1st mode-detect. To fix the problem, just clear VE_SEQ_CTRL_TRIG_MODE_DET before setting it in aspeed_video_enable_mode_detect(). Fixes: d2b4387f3bdf ("media: platform: Add Aspeed Video Engine driver") Signed-off-by: Jammy Huang Acked-by: Paul Menzel Reviewed-by: Joel Stanley Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 352ff3f3d449554f5259f75d77f65e638ea9d4a1 Author: Xu Wang Date: Wed Nov 10 09:49:10 2021 +0000 media: atomisp: Remove unneeded null check In ia_css_frame_map, the check of 'err' is unneeded to be done twice. Link: https://lore.kernel.org/linux-media/20211110094910.67951-1-vulab@iscas.ac.cn Signed-off-by: Xu Wang Signed-off-by: Mauro Carvalho Chehab commit b467d97ff37c456297c828c4e433c74b65488af1 Author: Mauro Carvalho Chehab Date: Wed Nov 10 11:43:46 2021 +0000 media: atomisp: get rid of atomisp_get_frame_pgnr() abstraction Simplify the code by getting rid of this function, as it ends being just a single line of code. Link: https://lore.kernel.org/linux-media/80ea920d14379124ba92aab2e6a6d12a92d79b2b.1636544620.git.mchehab+huawei@kernel.org Signed-off-by: Mauro Carvalho Chehab commit 245f6f4a32fe7f60260f8ffdf4d5173bf3bebbca Author: Mauro Carvalho Chehab Date: Wed Nov 10 13:08:28 2021 +0000 media: atomisp: simplify asd check on open() fops The open() fops support two types of devices: "acc" and normal ones. the acc works on a different way, using a different pipe struct. Not sure yet if it would make sense to setup a run_mode there. Also, As default_run_mode exists only on normal modes, we can simplify the logic to check if the device is in normal mode. That solves this warning: ../drivers/staging/media/atomisp/pci/atomisp_fops.c:904 atomisp_open() warn: variable dereferenced before check 'asd' (see line 807) Signed-off-by: Mauro Carvalho Chehab commit 71665d816214124d6bc4eb80314ac8f84ecacd78 Author: Mauro Carvalho Chehab Date: Wed Nov 10 12:59:11 2021 +0000 media: atomisp: check before deference asd variable The asd->isp was referenced before checking if asd is not NULL. This fixes this warning: ../drivers/staging/media/atomisp/pci/atomisp_cmd.c:5548 atomisp_set_fmt_to_snr() warn: variable dereferenced before check 'asd' (see line 5540) While here, avoid getting the pipe pointer twice. Signed-off-by: Mauro Carvalho Chehab commit e5e59f81840be21c6c996c783effb8744958414e Author: Mauro Carvalho Chehab Date: Mon Nov 8 09:40:25 2021 +0000 media: atomisp: only initialize mode if pipe is not null During atomisp register, udev tries to open all devices. For some, pipe is NULL, at least during register time, causing the driver to try to access a NULL pointer. So, add an extra check to avoid such condition. Link: https://lore.kernel.org/linux-media/6406265f2d5f3791d5c7cbd1364186217f19524c.1636364423.git.mchehab+huawei@kernel.org Signed-off-by: Mauro Carvalho Chehab commit cb4d67a998e97365afdf34965b069601da1dae60 Author: Dan Carpenter Date: Tue Oct 12 09:21:50 2021 +0100 media: atomisp: fix uninitialized bug in gmin_get_pmic_id_and_addr() The "power" pointer is not initialized on the else path and that would lead to an Oops. Link: https://lore.kernel.org/linux-media/20211012082150.GA31086@kili Fixes: c30f4cb2d4c7 ("media: atomisp: Refactor PMIC detection to a separate function") Signed-off-by: Dan Carpenter Reviewed-by: Kieran Bingham Signed-off-by: Mauro Carvalho Chehab commit 22f2cac62dea739d395007b3ce68def36adafd6c Author: Mauro Carvalho Chehab Date: Wed Nov 10 10:55:39 2021 +0000 media: atomisp-ov2680: properly set the vts value The vts value should be set before being checked, as otherwise a warning will arise: drivers/staging/media/atomisp/i2c/atomisp-ov2680.c: In function 'ov2680_set_fmt': drivers/staging/media/atomisp/i2c/atomisp-ov2680.c:873:33: warning: 'vts' may be used uninitialized [-Wmaybe-uninitialized] 873 | if (dev->exposure > vts - OV2680_INTEGRATION_TIME_MARGIN) Reported-by: Hans Verkuil Reviewed-by: Hans de Goede Fixes: 62b984359b6f ("media: atomisp-ov2680: Fix ov2680_set_fmt() messing up high exposure settings") Signed-off-by: Mauro Carvalho Chehab commit d9916e7c87c97781579c3d3d47e52c564e321c21 Author: Mauro Carvalho Chehab Date: Wed Nov 10 10:54:41 2021 +0000 media: atomisp-ov2680: initialize return var As the settings are only applied when the device is powered on, it should return 0 when the device is not powered. Not doing that causes a warning: drivers/staging/media/atomisp/i2c/atomisp-ov2680.c: In function 'ov2680_ioctl': drivers/staging/media/atomisp/i2c/atomisp-ov2680.c:390:16: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized] 390 | return ov2680_set_exposure(sd, coarse_itg, analog_gain, digital_gain); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/staging/media/atomisp/i2c/atomisp-ov2680.c:359:13: note: 'ret' was declared here 359 | int ret; | ^~~ Reported-by: Hans Verkuil Reviewed-by: Hans de Goede Fixes: 6b5b60687ada ("media: atomisp-ov2680: Save/restore exposure and gain over sensor power-down") Signed-off-by: Mauro Carvalho Chehab commit 29400b5063db69fbed9ff483a44d635b15d847cc Author: Hans de Goede Date: Sun Nov 7 17:15:49 2021 +0000 media: atomisp-ov2680: Fix ov2680_set_fmt() messing up high exposure settings For exposure settings > (lines_per_frame - vts_margin) the VTS register needs to be programmed to (exposure + vts_margin) rather then being set to lines_per_frame. The res->regs register array was clobbering this higher setting causing high exposure settings to not work. Fix this by letting ov2680_set_fmt() calculate the vts value, instead of hardcoding it. This is the last in a series of fixes which fixes exposure and gain settings not working, with this everything works, so drop the comment that it does not work. Link: https://lore.kernel.org/linux-media/20211107171549.267583-12-hdegoede@redhat.com Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 4492289c31364d28c2680b43b18883385a5d216c Author: Hans de Goede Date: Sun Nov 7 17:15:48 2021 +0000 media: atomisp-ov2680: Fix ov2680_set_fmt() clobbering the exposure Now that we restore the default or last user set exposure setting on power_up() there is no need for the registers written by ov2680_set_fmt() to write to the exposure register. Not doing so fixes the exposure always being reset to the value from the res->regs array after a set_fmt(). Link: https://lore.kernel.org/linux-media/20211107171549.267583-11-hdegoede@redhat.com Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 9f7b638637da7b1785659fd963d79dbca5caaa69 Author: Hans de Goede Date: Sun Nov 7 17:15:47 2021 +0000 media: atomisp-ov2680: Fix ov2680_write_reg() always writing 0 to 16 bit registers The shift << 16 of the value in the code path for 16 bit values is bogus, put_unaligned_be16() takes the lower 16 bits which will not always be 0. This was causing __ov2680_set_exposure() to always set the OV2680_AGC and OV2680_TIMING_VTS registers to 0. Link: https://lore.kernel.org/linux-media/20211107171549.267583-10-hdegoede@redhat.com Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit bc53e5bdbc7b5044079506990b76b39511ee1582 Author: Hans de Goede Date: Sun Nov 7 17:15:46 2021 +0000 media: atomisp-ov2680: Fix and simplify ov2680_q_exposure() Switch to ov2680_read_reg() to read all 24 bits in one go; and the exposure value sits in bits 4-19 of the 24 bit exposure register, so we need to shift the read value by 4 to report the correct value. Link: https://lore.kernel.org/linux-media/20211107171549.267583-9-hdegoede@redhat.com Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 3aa39a49359c7049db8189cbec1aa1668f5a4583 Author: Hans de Goede Date: Sun Nov 7 17:15:45 2021 +0000 media: atomisp-ov2680: Make ov2680_read_reg() support 24 bit registers Some ov2680 registers like exposure are 24 bit, ov2680_read_reg() already mostly supports this, we just need to change the return type from u16 to u32. Link: https://lore.kernel.org/linux-media/20211107171549.267583-8-hdegoede@redhat.com Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 4ed2caf8533753547364d22246a9c5c7d1e5943e Author: Hans de Goede Date: Sun Nov 7 17:15:44 2021 +0000 media: atomisp-ov2680: Save/restore exposure and gain over sensor power-down Save/restore exposure and gain over sensor power-down and don't write them to the sensor when ov2680_set_exposure() is called while the sensor is off. Link: https://lore.kernel.org/linux-media/20211107171549.267583-7-hdegoede@redhat.com Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 8eed52e182eeade19329a849c60a8150a101ac1e Author: Hans de Goede Date: Sun Nov 7 17:15:43 2021 +0000 media: atomisp-ov2680: Move ov2680_init_registers() call to power_up() Move ov2680_init_registers() call to power_up(), so that we also init the registers on code-paths which do not call ov2680_s_power() like running camorama. Link: https://lore.kernel.org/linux-media/20211107171549.267583-6-hdegoede@redhat.com Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit b821cea597f84e37dc6d2df720a3dccb4eedf8b6 Author: Hans de Goede Date: Sun Nov 7 17:15:42 2021 +0000 media: atomisp-ov2680: Remove the ov2680_res and N_RES global variables The ov2680_res and N_RES global variables are just hardcoded as aliases for ov2680_res_preview and N_RES_PREVIEW, remove them. Link: https://lore.kernel.org/linux-media/20211107171549.267583-5-hdegoede@redhat.com Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit e9174a6438adada772abdb16901280289aa4c3b2 Author: Hans de Goede Date: Sun Nov 7 17:15:41 2021 +0000 media: atomisp-ov2680: Push the input_lock taking up into ov2680_s_power() ov2680_s_power() is the only caller of ov2680_init(), push the input_lock taking from ov2680_init() up into ov2680_s_power(), this way the new power_on bool is also protected by it. Link: https://lore.kernel.org/linux-media/20211107171549.267583-4-hdegoede@redhat.com Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 12350633a8dbdcf7d8e0b1f726a4b58aa21e25db Author: Hans de Goede Date: Sun Nov 7 17:15:40 2021 +0000 media: atomisp-ov2680: Turn on power only once Add a power_on bool to track if the power is on, and make power_up() a no-op if the power is already on. This also removes a power_down() call from ov2680_s_config() since that is a no-op now, this is ok because s_config() is only called once on probe and the sensor is off at boot. Besides avoiding to the work in power_up() multiple times this patch is also a preparation for switching to the clk and regulator frameworks which keep an enable count, so there we must call enable() and disable() only once per power-cycle. Link: https://lore.kernel.org/linux-media/20211107171549.267583-3-hdegoede@redhat.com Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 83b1e1efe5ed113df37d0841683aafd69a19988b Author: Hans de Goede Date: Sun Nov 7 17:15:39 2021 +0000 media: atomisp-ov2680: Remove a bunch of unused vars from ov2680_device Remove a couple of variables which where either completely unused, or only ever got a value assigned to them but were never read. Link: https://lore.kernel.org/linux-media/20211107171549.267583-2-hdegoede@redhat.com Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab commit 88f4f81e8c8e3e5c637602fe02ee9a102b67b7b0 Author: Mauro Carvalho Chehab Date: Sat Nov 6 11:26:20 2021 +0000 media: atomisp: register first the preview devnode The atomisp currenyl registers 5 pairs of devices each one for one different run_mode, plus one for "ACC". The only one that behaves like a normal V4L2 device is the preview one. The others are doing weird things, and perhaps are using some proprietary extensions to the API. Change the device order to start with the preview one, e. g: /dev/video0: ATOMISP ISP PREVIEW output /dev/video1: ATOMISP ISP CAPTURE output /dev/video2: ATOMISP ISP VIEWFINDER output /dev/video3: ATOMISP ISP VIDEO output /dev/video4: ATOMISP ACC This way, a normal V4L2 application will get the right device, as the first one will be the one they should use. Signed-off-by: Mauro Carvalho Chehab commit 2c45e343c581091835c9047ed5298518aa133163 Author: Mauro Carvalho Chehab Date: Fri Oct 29 08:09:39 2021 +0100 media: atomisp: set per-device's default mode The atomisp driver originally used the s_parm command to initialize the run_mode type to the driver. So, before start setting up the streaming, s_parm should be called. So, even having 5 "normal" video devices, one meant to be used for each type, the run_mode was actually selected when s_parm is called. Without setting the run mode, applications that don't call VIDIOC_SET_PARM with a custom atomisp parameters won't work, as the pipeline won't be set: atomisp-isp2 0000:00:03.0: can't create streams atomisp-isp2 0000:00:03.0: __get_frame_info 1600x1200 (padded to 0) returned -22 However, commit 8a7c5594c020 ("media: v4l2-ioctl: clear fields in s_parm") broke support for it, with a good reason, as drivers shoudn't be extending the API for their own purposes. So, as an step to allow generic apps to use this driver, put the device's run_mode in preview after open. After this patch, using v4l2grab starts to work on preview mode (/dev/video2): $ v4l2grab -f YUYV -x 1600 -y 1200 -d /dev/video2 -n 1 -u $ feh out000.pnm So, let's just setup the default run_mode that each video devnode should assume, setting it at open() time. Reported-by: Tsuchiya Yuto Signed-off-by: Mauro Carvalho Chehab commit 4a62b5cca5f04838854992eea720744928bec0f3 Author: Mauro Carvalho Chehab Date: Fri Nov 5 18:09:13 2021 +0000 media: atomisp: get rid of ISP2401_NEW_INPUT_SYSTEM All ISP2401 devices use the new input system. So, get rid of the remaining definitions, replacing them by runtime checks for BYT/CHT when applicable. Signed-off-by: Mauro Carvalho Chehab commit 62596705730e62671c61b93c42c3bb64375d941a Author: Mauro Carvalho Chehab Date: Fri Nov 5 16:30:48 2021 +0000 media: atomisp: return errors from ia_css_dma_configure_from_info() Now that the pipeline config functions can return errors, change ia_css_dma_configure_from_info() and callers in order for them to return errors at pipelines instead of using assert(). Signed-off-by: Mauro Carvalho Chehab commit 874da1fd1df2428154f160a1b99cdbf2cab32058 Author: Mauro Carvalho Chehab Date: Fri Nov 5 16:29:14 2021 +0000 media: atomisp: add return codes for pipeline config functions Those functions can internally break, but, as they don't return errors, internally there are some assert() calls, which is bad, as it hangs the driver. So, add return codes there, in preparation for removing such assert() calls. Signed-off-by: Mauro Carvalho Chehab commit f88520495b85ac0a0edb3410d5edb337e1699046 Author: Mauro Carvalho Chehab Date: Fri Nov 5 13:44:34 2021 +0000 media: atomisp: sh_css_sp: better handle pipeline config errors If something gets wrong while setup a pipeline, return an error code. Signed-off-by: Mauro Carvalho Chehab commit f21e49be240ffc064a0ada822f3f1b316728eaa8 Author: Mauro Carvalho Chehab Date: Fri Nov 5 12:18:02 2021 +0000 media: atomisp: propagate errors at ia_css_*_configure() Propagate the lower lever ia_css config errors to the next level. Signed-off-by: Mauro Carvalho Chehab commit 08ae0ffdd6c4ff121d3f9f677ef61f58cf4a6313 Author: Mauro Carvalho Chehab Date: Fri Nov 5 12:08:37 2021 +0000 media: atomisp: cleanup ia_css_isp_configs() code The auto-generated code inside ia_css_isp_configs() is more complex than it should be. Also, it doesn't return any errors. However, the functions called by it can mis-configure the pipelines, but, as there's no way to return errors, it internally calls the assert() macro. So, add a return parameter to each routine there, in order to prepare the code to be more robust. Signed-off-by: Mauro Carvalho Chehab commit 2aa384962a7f83924c5c049f89ab4eb4d22224d3 Author: Mauro Carvalho Chehab Date: Fri Nov 5 11:17:05 2021 +0000 media: atomisp: unify ia_css_isp_params.c The contents of ia_css_isp_params.c is almost identical for 2400 and 2401. The only difference is that, on 2400, there are some duplicated assignments. So, drop it, unifying this file. While here, simplify the Makefile's logic by dropping an unused define. Signed-off-by: Mauro Carvalho Chehab commit 3a9559d8f679c8c66f58a9138c4695f2420d891c Author: Mauro Carvalho Chehab Date: Fri Nov 5 11:09:02 2021 +0000 media: atomisp: drop duplicated ia_css_isp_states.c Both 2400 and 2401 have this file, but they're identical. So, drop one of them. Signed-off-by: Mauro Carvalho Chehab commit 9df9ee659cae6eb0451a022fa73223b529c24534 Author: Mauro Carvalho Chehab Date: Fri Nov 5 07:50:15 2021 +0000 media: atomisp: drop duplicated ia_css_isp_configs.c Both 2400 and 2401 have this file, but they're identical. So, drop one of them. Signed-off-by: Mauro Carvalho Chehab commit 821e6f16125a0e363d3ae7acebad78ee24badd9e Author: Mauro Carvalho Chehab Date: Fri Nov 5 07:50:15 2021 +0000 media: atomisp: allocate a v4l2_fh at open time This avoids an OOPS when VIDIOC_*_PRIORITY calls are used. [ 90.820011] BUG: kernel NULL pointer dereference, address: 0000000000000020 [ 90.820021] #PF: supervisor read access in kernel mode [ 90.820026] #PF: error_code(0x0000) - not-present page [ 90.820030] PGD 1221bc067 P4D 1221bc067 PUD 1221bd067 PMD 0 [ 90.820042] Oops: 0000 [#1] SMP [ 90.820048] CPU: 0 PID: 2007 Comm: qv4l2 Tainted: G C 5.15.0-rc4+ #77 [ 90.820055] Hardware name: ASUSTeK COMPUTER INC. T101HA/T101HA, BIOS T101HA.306 04/23/2019 [ 90.820059] RIP: 0010:v4l2_prio_change+0xf/0x40 [videodev] [ 90.820096] Code: 48 8b 47 20 8b 40 44 25 ff ff 0f 00 48 8b 04 c5 20 58 44 c0 c3 66 0f 1f 44 00 00 0f 1f 44 00 00 8d 42 ff 83 f8 02 77 21 31 c0 <39> 16 74 20 8d 02 f0 ff 04 87 8b 06 89 c1 83 e9 01 83 f9 02 77 04 [ 90.820103] RSP: 0018:ffffb348c142fd70 EFLAGS: 00010246 [ 90.820109] RAX: 0000000000000000 RBX: ffff95575fbe2760 RCX: ffffb348c142fe48 [ 90.820114] RDX: 0000000000000002 RSI: 0000000000000020 RDI: ffff955740996088 [ 90.820118] RBP: 0000000040045644 R08: ffffffffc070da80 R09: 0000000000004000 [ 90.820122] R10: 0000000000000000 R11: 0000000000000000 R12: ffff955766725300 [ 90.820126] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000044 [ 90.820131] FS: 00007f848526b900(0000) GS:ffff9557bbe00000(0000) knlGS:0000000000000000 [ 90.820137] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 90.820141] CR2: 0000000000000020 CR3: 00000001221bf000 CR4: 00000000001006f0 [ 90.820146] Call Trace: [ 90.820155] __video_do_ioctl+0x37d/0x3b0 [videodev] [ 90.820189] video_usercopy+0x188/0x7a0 [videodev] [ 90.820218] ? v4l_print_control+0x20/0x20 [videodev] [ 90.820247] ? swake_up_one+0x39/0x70 [ 90.820258] ? rcu_core+0xff/0x2e0 [ 90.820267] ? sched_clock_cpu+0x9/0xa0 [ 90.820275] ? irqtime_account_irq+0x38/0xb0 [ 90.820282] v4l2_ioctl+0x46/0x50 [videodev] Signed-off-by: Mauro Carvalho Chehab commit 8cc0f5cfd543750b82895616f139d252021761fe Author: Mauro Carvalho Chehab Date: Thu Nov 4 14:29:34 2021 +0000 media: atomisp-mt9m114: use v4l2_find_nearest_size() Instead of reinventing the wheel, use v4l2_find_nearest_size() in order to get the closest resolution. This should address a bug where the wrong resolution was selected. Signed-off-by: Mauro Carvalho Chehab commit c286a3a0286bf70590720541b8408dbc3cd930a5 Author: Mauro Carvalho Chehab Date: Thu Nov 4 13:57:35 2021 +0000 media: atomisp-gc2235: use v4l2_find_nearest_size() Instead of reinventing the wheel, use v4l2_find_nearest_size() in order to get the closest resolution. This should address a bug where the wrong resolution was selected. Signed-off-by: Mauro Carvalho Chehab commit e3b14bf8d660c28c8af37320830061ad1c6e9f08 Author: Mauro Carvalho Chehab Date: Thu Nov 4 13:47:34 2021 +0000 media: atomisp-gc0310: use v4l2_find_nearest_size() Instead of reinventing the wheel, use v4l2_find_nearest_size() in order to get the closest resolution. This should address a bug where the wrong resolution was selected. Signed-off-by: Mauro Carvalho Chehab commit b4e281666cb2ea1134e0f20445d4a6acbc810e38 Author: Mauro Carvalho Chehab Date: Thu Nov 4 13:17:50 2021 +0000 media: atomisp-ov2722: use v4l2_find_nearest_size() Instead of reinventing the wheel, use v4l2_find_nearest_size() in order to get the closest resolution. This should address a bug where the wrong resolution was selected. Signed-off-by: Mauro Carvalho Chehab commit b7573661282c92c8a186e7bf99a7cb3119daaf80 Author: Mauro Carvalho Chehab Date: Wed Nov 3 15:58:39 2021 +0000 media: atomisp-ov2680: use v4l2_find_nearest_size() Instead of reinventing the wheel, use v4l2_find_nearest_size() in order to get the closest resolution. This should address a bug where the wrong resolution was selected. Signed-off-by: Mauro Carvalho Chehab commit 0fbca1028567aa42133198e08d1a4421e133f1a5 Author: Mauro Carvalho Chehab Date: Thu Nov 4 11:47:10 2021 +0000 media: atomisp: fix g_fmt logic The g_fmt logic is currently broken, as it is not returning the same imagesize as previoulsy calculated by s_fmt. Fix it by just re-using whatever it was defined at s_fmt, if this was called before. Signed-off-by: Mauro Carvalho Chehab commit c9e9094c4e42124af909b2f5f6ded0498e0854ac Author: Mauro Carvalho Chehab Date: Thu Nov 4 11:45:27 2021 +0000 media: atomisp: fix try_fmt logic The internal try_fmt logic is not meant to provide everything that the V4L2 API should provide. Also, it doesn't decrement the pads that are used only internally by the driver, but aren't part of the device's output. Fix it. Signed-off-by: Mauro Carvalho Chehab commit e0d42fc0ddbc4660afd6c725e1e75af3ce229f7d Author: Mauro Carvalho Chehab Date: Thu Nov 4 11:32:13 2021 +0000 media: atomisp: move atomisp_g_fmt_cap() move atomisp_g_fmt_cap() for it to be after try_fmt, as we'll re-use try_fmt there. No functional changes. Signed-off-by: Mauro Carvalho Chehab commit cc55907585f54bc748ebaf29a5427478de8304cc Author: Mauro Carvalho Chehab Date: Thu Nov 4 11:27:55 2021 +0000 media: atomisp: fix enum_fmt logic Currently, the enum lists the sensor's native format as a supported format. However, trying to setup a pipeline using it doesn't work. So, exclude such formats from the enum. Signed-off-by: Mauro Carvalho Chehab commit f5f3cedf2b5a48af3092e7bc865ad65284503f5e Author: Mauro Carvalho Chehab Date: Thu Nov 4 11:23:14 2021 +0000 media: atomisp: fix VIDIOC_S_FMT logic There are several issues on S_FMT implementation: - it doesn't properly handle pad_h/pad_w; - it reports a wrong visible size to userspace; - it allows setting the format to a raw mode, which currently causes the pipeline to break. Address such issues, for it to start working with generic apps. Signed-off-by: Mauro Carvalho Chehab commit 9a542497cc887d2278689ee576c57c34072080f0 Author: Mauro Carvalho Chehab Date: Thu Nov 4 11:20:37 2021 +0000 media: atomisp: move a debug printf to a better place The sensor width/height report is alread being printed after its calculus. The only reason for an extra debug printk is when dis is used. So, change its message to reflect and move it to be inside the if checks. Signed-off-by: Mauro Carvalho Chehab commit 7474731541118aa32eaff38f4fb669f4a5208d22 Author: Mauro Carvalho Chehab Date: Tue Nov 2 07:39:18 2021 +0000 media: atomisp: align sizes returned by g_fmt Repeat the same round logic used inside s_fmt here, for the sake of sanity. Signed-off-by: Mauro Carvalho Chehab commit fcb10617f4654abdc7382abb8ee73bc7972fb268 Author: Mauro Carvalho Chehab Date: Mon Nov 1 11:35:29 2021 +0000 media: atomisp: TODO: make it updated to the current issues Now that this driver starting to show signals of real progress, let's update its TODO list. Signed-off-by: Mauro Carvalho Chehab commit b2598d9fa6e14a50b932201effe00299162bc06e Author: Mauro Carvalho Chehab Date: Tue Nov 2 06:49:21 2021 +0000 media: atomisp: add a default case at __get_frame_info() The switch() logic there misses a break and a default case. That makes it more prone to problems as the code change. Suggested-by: Andy Shevchenko Signed-off-by: Mauro Carvalho Chehab commit 5814f32fef137e34577c4f053272c53e7ca33cd9 Author: Niklas Söderlund Date: Sun Sep 12 17:51:40 2021 +0100 media: staging: max96712: Add basic support for MAX96712 GMSL2 deserializer Add basic support for Maxim MAX96712 quad GMSL2 deserializers. The driver is capable of powering on the device and configuring the MIPI CSI-2 bus in a DPHY 4-lane configuration as well as operating the internal VTG (Video Timing Generator) and VPG (Video Pattern Generator). Using these features the driver is able to act as a 1080p @ 30 fps V4L2 video source. Producing either a checkerboard or gradient pattern on the CSI-2 bus, selectable thru a V4L2 control. While the driver is useful as-is and have been used to prove the correct operation of the MAX96712 itself and "downstream" devices using the MAX96712 as a video source there are a lot of features missing. Most notably the ability to operate the GMSL bus. Signed-off-by: Niklas Söderlund Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 819d679b58bc4f3171b838c7914d55aff65a9f0d Author: Mauro Carvalho Chehab Date: Sun Oct 31 10:56:10 2021 +0000 media: atomisp: comment-out JPEG format This is already disabled on some parts of the code, and trying to use it with current firmware causes an error: [ 53.799946] atomisp-isp2 0000:00:03.0: can't create streams [ 53.799962] atomisp-isp2 0000:00:03.0: __get_frame_info 1600x900 (padded to 0) returned -22 So, completely disable reporting it. Signed-off-by: Mauro Carvalho Chehab commit 03723b924867718ca7f357668c414e2a218c18d4 Author: Mauro Carvalho Chehab Date: Sun Oct 31 09:38:51 2021 +0000 media: atomisp: report the visible resolution The atomisp sensors and logic adds an extra pad lines/columns, called "dvs envelope". It also uses an extra 12 lines/columns at the sensor for BYT. As those are not visible to userspace, the V4L2 API should decrement such values when reporting the current resolution. Signed-off-by: Mauro Carvalho Chehab commit 5380c4cfeb8e069b0ec1e2aae73c65229d76d18e Author: Mauro Carvalho Chehab Date: Sat Oct 30 13:08:05 2021 +0100 media: atomisp: don't print errors for ignored MBUS formats The bayer formats aren't currently available for userspace to select: those are marked as IA_CSS_FRAME_FORMAT_RAW and trying to get them result on binary firmware load errors: [74625.258097] atomisp-isp2 0000:00:03.0: Using binary isp_preview_var_isp2 (id 22), type 0, mode 1, continuous true [74625.258146] atomisp-isp2 0000:00:03.0: Seeking for binary failed at: [74625.258161] CPU: 3 PID: 2792 Comm: v4l2grab Tainted: G C 5.15.0-rc4+ #77 [74625.258190] Hardware name: ASUSTeK COMPUTER INC. T101HA/T101HA, BIOS T101HA.306 04/23/2019 [74625.258208] Call Trace: [74625.258231] dump_stack_lvl+0x46/0x5a [74625.258272] ia_css_binary_find+0xa7d/0xcf0 [atomisp] [74625.258570] load_preview_binaries+0x323/0x3c0 [atomisp] ... [74625.265892] atomisp-isp2 0000:00:03.0: can't create streams [74625.265937] atomisp-isp2 0000:00:03.0: __get_frame_info 1604x1200 (padded to 0) returned -22 [74625.265962] atomisp-isp2 0000:00:03.0: Can't set format on ISP. Error -22 As those formats are ignored by purpose, it doesn't make any sense to print a message like: atomisp_enum_fmt_cap(): format for code 3007 not found. for those. Yet, some day it would be interesting to also report the bayer formats, letting userspace to decode them on a different way. Signed-off-by: Mauro Carvalho Chehab commit 2b806251a5b03ec3c95310253682be2351e6505b Author: Mauro Carvalho Chehab Date: Sat Oct 30 12:01:30 2021 +0100 media: atomisp: report colorspace information While different sensors could have different colorspaces, the colorspace V4L2 support didn't exist by the time atomisp driver was written. So, the sensors won't have any data about that. So, let's report what Asus T101HA uses (ov2680 sensor). It may require further changes, if other sensors used on this driver have different colorspaces. Signed-off-by: Mauro Carvalho Chehab commit 6c84a35d781525696fcbeeed8c60d96a63811067 Author: Mauro Carvalho Chehab Date: Tue Oct 26 14:53:22 2021 +0100 media: atomisp: properly implement g_fmt The current logic only initializes pipe->pix after setting up a pipeline - e. g. after start streaming. While it makes sense to get the format of the pipeline, when it is set, this breaks support for generic applications, as they rely on getting the current sensor format (which is usually the highest resolution format). So, implement a call to the sensor's get_fmt, when this is called before setting up a pipeline. Signed-off-by: Mauro Carvalho Chehab commit 331adc2f4081886a6f12392dbcfb17e3512a7160 Author: Mauro Carvalho Chehab Date: Fri Oct 29 07:06:38 2021 +0100 media: atomisp: better describe get_frame_info issues When atomisp is used by a normal client, it fails to get frame info. However, the information is confusing and misleading, as there are several wrappers for such function, and the error could be on different places. So, improve the error log in order to allow narrowing down where the error is actually occuring. Signed-off-by: Mauro Carvalho Chehab commit fae46cb0531b45c789e39128f676f2bafa3a7b47 Author: Mauro Carvalho Chehab Date: Mon Oct 25 09:06:52 2021 +0100 media: atomisp: fix enum formats logic Changeset 374d62e7aa50 ("media: v4l2-subdev: Verify v4l2_subdev_call() pad config argument") added an extra verification for a pads parameter for enum mbus format code. Such change broke atomisp, because now the V4L2 core refuses to enum MBUS formats if the state is empty. So, add .which field in order to select the active formats, in order to make it work again. While here, improve error messages. Fixes: 374d62e7aa50 ("media: v4l2-subdev: Verify v4l2_subdev_call() pad config argument") Signed-off-by: Mauro Carvalho Chehab commit c10bcb13462e9cf43111d17f1e08b4bb4d4401b0 Author: Tsuchiya Yuto Date: Mon Oct 18 01:23:34 2021 +0900 media: atomisp: add NULL check for asd obtained from atomisp_video_pipe This is almost a BUG report with RFC patch that just avoids kernel oopses. Thus, prefixed with [BUG][RFC]. Here is the kernel log after running `v4l2-compliance -d /dev/video4` with this patch applied: kern :err : [25507.580392] atomisp-isp2 0000:00:03.0: can't change power state from D3cold to D0 (config space inaccessible) kern :warn : [25507.592343] isys dma store at addr(0xcd408) val(0) kern :err : [25507.592995] atomisp-isp2 0000:00:03.0: atomisp_queryctl(): asd is NULL, device is ATOMISP ISP ACC kern :err : [25507.593685] atomisp-isp2 0000:00:03.0: atomisp_g_input(): asd is NULL, device is ATOMISP ISP ACC kern :err : [25507.593719] atomisp-isp2 0000:00:03.0: atomisp_g_parm(): asd is NULL, device is ATOMISP ISP ACC kern :err : [25507.593727] atomisp-isp2 0000:00:03.0: atomisp_queryctl(): asd is NULL, device is ATOMISP ISP ACC [omitting 42 same messages] kern :err : [25507.593976] atomisp-isp2 0000:00:03.0: atomisp_queryctl(): asd is NULL, device is ATOMISP ISP ACC kern :err : [25507.594191] atomisp-isp2 0000:00:03.0: atomisp_g_input(): asd is NULL, device is ATOMISP ISP ACC kern :err : [25507.594449] atomisp-isp2 0000:00:03.0: atomisp_queryctl(): asd is NULL, device is ATOMISP ISP ACC [omitting 43 same messages] kern :err : [25507.594756] atomisp-isp2 0000:00:03.0: atomisp_queryctl(): asd is NULL, device is ATOMISP ISP ACC kern :err : [25507.594779] atomisp-isp2 0000:00:03.0: atomisp_g_ctrl(): asd is NULL, device is ATOMISP ISP ACC kern :err : [25507.594787] atomisp-isp2 0000:00:03.0: atomisp_s_ctrl(): asd is NULL, device is ATOMISP ISP ACC kern :err : [25507.594803] atomisp-isp2 0000:00:03.0: atomisp_camera_g_ext_ctrls(): asd is NULL, device is ATOMISP ISP ACC kern :err : [25507.594880] atomisp-isp2 0000:00:03.0: atomisp_enum_fmt_cap(): asd is NULL, device is ATOMISP ISP ACC kern :err : [25507.594915] atomisp-isp2 0000:00:03.0: atomisp_g_parm(): asd is NULL, device is ATOMISP ISP ACC kern :err : [25507.595058] atomisp-isp2 0000:00:03.0: atomisp_try_fmt(): asd is NULL, device is ATOMISP ISP ACC kern :err : [25507.595089] atomisp-isp2 0000:00:03.0: atomisp_set_fmt(): asd is NULL, device is ATOMISP ISP ACC kern :err : [25507.595124] atomisp-isp2 0000:00:03.0: atomisp_set_fmt(): asd is NULL, device is ATOMISP ISP ACC kern :err : [25507.595221] atomisp-isp2 0000:00:03.0: atomisp_set_fmt(): asd is NULL, device is ATOMISP ISP ACC kern :err : [25507.595241] atomisp-isp2 0000:00:03.0: atomisp_set_fmt(): asd is NULL, device is ATOMISP ISP ACC kern :err : [25507.601571] atomisp-isp2 0000:00:03.0: can't change power state from D3cold to D0 (config space inaccessible) kern :warn : [25507.607496] isys dma store at addr(0xcd408) val(0) kern :err : [25507.608604] atomisp-isp2 0000:00:03.0: atomisp_queryctl(): asd is NULL, device is ATOMISP ISP ACC kern :err : [25507.611988] atomisp-isp2 0000:00:03.0: can't change power state from D3cold to D0 (config space inaccessible) kern :warn : [25507.617420] isys dma store at addr(0xcd408) val(0) kern :err : [25507.618429] atomisp-isp2 0000:00:03.0: atomisp_queryctl(): asd is NULL, device is ATOMISP ISP ACC kern :err : [25507.618811] atomisp-isp2 0000:00:03.0: atomisp_g_parm(): asd is NULL, device is ATOMISP ISP ACC kern :err : [25507.622193] atomisp-isp2 0000:00:03.0: can't change power state from D3cold to D0 (config space inaccessible) kern :warn : [25507.627355] isys dma store at addr(0xcd408) val(0) kern :err : [25507.628391] atomisp-isp2 0000:00:03.0: atomisp_queryctl(): asd is NULL, device is ATOMISP ISP ACC kern :err : [25507.631143] atomisp-isp2 0000:00:03.0: can't change power state from D3cold to D0 (config space inaccessible) kern :warn : [25507.635813] isys dma store at addr(0xcd408) val(0) kern :err : [25507.636489] atomisp-isp2 0000:00:03.0: atomisp_queryctl(): asd is NULL, device is ATOMISP ISP ACC kern :err : [25507.636504] atomisp-isp2 0000:00:03.0: atomisp_s_input(): asd is NULL, device is ATOMISP ISP ACC kern :err : [25507.636516] atomisp-isp2 0000:00:03.0: atomisp_set_fmt(): asd is NULL, device is ATOMISP ISP ACC kern :err : [25507.639111] atomisp-isp2 0000:00:03.0: can't change power state from D3cold to D0 (config space inaccessible) kern :warn : [25507.646152] isys dma store at addr(0xcd408) val(0) kern :err : [25507.646831] atomisp-isp2 0000:00:03.0: atomisp_queryctl(): asd is NULL, device is ATOMISP ISP ACC kern :err : [25507.646847] atomisp-isp2 0000:00:03.0: atomisp_s_input(): asd is NULL, device is ATOMISP ISP ACC kern :err : [25507.650079] atomisp-isp2 0000:00:03.0: can't change power state from D3cold to D0 (config space inaccessible) kern :warn : [25507.657476] isys dma store at addr(0xcd408) val(0) kern :err : [25507.658741] atomisp-isp2 0000:00:03.0: atomisp_queryctl(): asd is NULL, device is ATOMISP ISP ACC kern :err : [25507.658759] atomisp-isp2 0000:00:03.0: atomisp_s_input(): asd is NULL, device is ATOMISP ISP ACC kern :err : [25507.658771] atomisp-isp2 0000:00:03.0: atomisp_set_fmt(): asd is NULL, device is ATOMISP ISP ACC kern :err : [25507.660959] atomisp-isp2 0000:00:03.0: can't change power state from D3cold to D0 (config space inaccessible) kern :warn : [25507.666665] isys dma store at addr(0xcd408) val(0) kern :err : [25507.667397] atomisp-isp2 0000:00:03.0: atomisp_queryctl(): asd is NULL, device is ATOMISP ISP ACC [mchehab: fix coding style] Signed-off-by: Tsuchiya Yuto Signed-off-by: Mauro Carvalho Chehab commit 59a27d5c98f7f6702c4d9d176eb6019a4d28fdac Author: Alan Date: Mon Nov 6 23:36:36 2017 +0000 media: atomisp: Fix up the open v load race Date: Mon, 06 Nov 2017 23:36:36 +0000 This isn't the ideal final solution but it stops the main problem for now where an open (often from udev) races the device initialization and we try and load the firmware twice at the same time. This needless to say doesn't usually end well. [kitakar: ported to upstream Kernel] [mchehab: make comments to use our coding style] Signed-off-by: Alan Cox Signed-off-by: Tsuchiya Yuto Signed-off-by: Mauro Carvalho Chehab commit 634557be5aead60c87af3eb0a922e22d10bb44fb Author: Tsuchiya Yuto Date: Mon Oct 18 01:19:55 2021 +0900 media: atomisp: add Microsoft Surface 3 ACPI vars Microsoft Surface 3 does not describe CsiPort/CsiLanes in DSDT [1] or EFI, or at least not desctibed in the forms the current atomisp driver expects. This results in the default values (port: 0 lanes: 1) to be used, which does not work. So, define them ourselves in the driver. The user-facing camera is AR0330 (2-lane) and the world-facing camera is OV8835 (4-lane). According to the portconfigs definition in atomisp_csi_lane_config() [atomisp_v4l2.c]: } portconfigs[] = { /* Tangier/Merrifield available lane configurations */ { 0x00, { 4, 1, 0 } }, /* 00000 */ { 0x01, { 3, 1, 0 } }, /* 00001 */ { 0x02, { 2, 1, 0 } }, /* 00010 */ { 0x03, { 1, 1, 0 } }, /* 00011 */ { 0x04, { 2, 1, 2 } }, /* 00100 */ { 0x08, { 3, 1, 1 } }, /* 01000 */ { 0x09, { 2, 1, 1 } }, /* 01001 */ { 0x0a, { 1, 1, 1 } }, /* 01010 */ /* Anniedale/Moorefield only configurations */ { 0x10, { 4, 2, 0 } }, /* 10000 */ { 0x11, { 3, 2, 0 } }, /* 10001 */ { 0x12, { 2, 2, 0 } }, /* 10010 */ { 0x13, { 1, 2, 0 } }, /* 10011 */ { 0x14, { 2, 2, 2 } }, /* 10100 */ { 0x18, { 3, 2, 1 } }, /* 11000 */ { 0x19, { 2, 2, 1 } }, /* 11001 */ { 0x1a, { 1, 2, 1 } }, /* 11010 */ }; 4-lane camera is always connected to the PRIMARY (port1) port [2]. In this case, 2-lane camera can be connected to the only SECONDARY (port0) port. So, add these data accordingly as the gmin_cfg_var ACPI variables for Surface 3. [1] https://github.com/linux-surface/acpidumps/blob/7da48a392b4085c2021952290def1fc28505a643/surface_3/dsdt.dsl#L5879-L6278 [2] Yes, the PRIMARY port is port1 according to atomisp_camera_port [atomisp.h]: enum atomisp_camera_port { ATOMISP_CAMERA_PORT_SECONDARY, ATOMISP_CAMERA_PORT_PRIMARY, ATOMISP_CAMERA_PORT_TERTIARY, ATOMISP_CAMERA_NR_PORTS }; Signed-off-by: Tsuchiya Yuto Signed-off-by: Mauro Carvalho Chehab commit bb4924c215f26c4bbb0008d1ae13f98066ed2952 Author: Tsuchiya Yuto Date: Mon Oct 18 01:19:53 2021 +0900 media: atomisp: pci: release_version is now irci_stable_candrpv_0415_20150521_0458 Now that we made atomisp work with firmware version irci_stable_candrpv_0415_20150521_0458 also for ISP2401, the release_version for ISP2401 is not irci_ecr-master_20150911_0724 anymore. So, use the same release_version for both ISP2400 and ISP2401 (i.e., irci_stable_candrpv_0415_20150521_0458). Referred to the following diff to make this patch: - https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/diff/drivers/staging/media/atomisp/pci/sh_css_firmware.c?id=3c0538fbad9f1d07d588f631e380256d941e3d3a ("media: atomisp: get rid of most checks for ISP2401 version") changes for file sh_css_firmware.c Signed-off-by: Tsuchiya Yuto Signed-off-by: Mauro Carvalho Chehab commit b37bca2eba67da5eb5f7a4a30279e9b464eebdc6 Author: Tsuchiya Yuto Date: Mon Oct 18 01:19:52 2021 +0900 media: atomisp: make fw ver irci_stable_candrpv_0415_20150521_0458 work This patch removes the unnamed struct `shading` from `struct sh_css_sp_pipeline` as well as its usage [1]. [1] added on updating css version to irci_master_20150701_0213 https://raw.githubusercontent.com/intel/ProductionKernelQuilts/cht-m1stable-2016_ww31/uefi/cht-m1stable/patches/cam-0439-atomisp2-css2401-and-2401_legacy-irci_master_2015070.patch ("atomisp2: css2401 and 2401_legacy-irci_master_20150701_0213") This patch, together with the 4 patches applied before it revert incompatible changes in the current css version for ISP2401 (irci_ecr-master_20150911_0724) back to irci_stable_candrpv_0415_20150521_0458. Some `struct`s are `sizeof()`ed in sh_css_firmware.c file. So, I guess issues will happen if these sizes are changed. Therefore, keep them the same as css version irci_stable_candrpv_0415_20150521_0458 to make atomisp work for firmware made for such css version since we don't have firmware made for the current css version. Signed-off-by: Tsuchiya Yuto Signed-off-by: Mauro Carvalho Chehab commit bbaa836b530101380f1a003c642b4a5fc92900aa Author: Tsuchiya Yuto Date: Mon Oct 18 01:19:51 2021 +0900 media: atomisp: remove polling_mode and subscr_index This patch removes polling_mode and subscr_index from `struct virtual_input_system_stream_s` as well as its usage [1]. Note that for subscr_index, only the definition were removed because it was not used anywhere. [1] added on updating css version to irci_master_20150701_0213 https://raw.githubusercontent.com/intel/ProductionKernelQuilts/cht-m1stable-2016_ww31/uefi/cht-m1stable/patches/cam-0439-atomisp2-css2401-and-2401_legacy-irci_master_2015070.patch ("atomisp2: css2401 and 2401_legacy-irci_master_20150701_0213") Signed-off-by: Tsuchiya Yuto Signed-off-by: Mauro Carvalho Chehab commit c665ccf1ffeaddb51d668e792ce443d08e01e65a Author: Tsuchiya Yuto Date: Mon Oct 18 01:19:50 2021 +0900 media: atomisp: remove struct ia_css_isp_parameter xnr3 This patch removes `struct ia_css_isp_parameter xnr3` from `struct ia_css_memory_offsets` as well as its usage [1]. [1] added on updating css version to irci_master_20150701_0213 https://raw.githubusercontent.com/intel/ProductionKernelQuilts/cht-m1stable-2016_ww31/uefi/cht-m1stable/patches/cam-0439-atomisp2-css2401-and-2401_legacy-irci_master_2015070.patch ("atomisp2: css2401 and 2401_legacy-irci_master_20150701_0213") Signed-off-by: Tsuchiya Yuto Signed-off-by: Mauro Carvalho Chehab commit 66262818195d906b154eef941441d347b8ef5f79 Author: Tsuchiya Yuto Date: Mon Oct 18 01:19:49 2021 +0900 media: atomisp: remove struct ia_css_isp_parameter This patch removes `struct ia_css_isp_parameter sc` from `struct ia_css_config_memory_offsets` as well as its usage [1]. [1] added on updating css version to irci_master_20150701_0213 https://raw.githubusercontent.com/intel/ProductionKernelQuilts/cht-m1stable-2016_ww31/uefi/cht-m1stable/patches/cam-0439-atomisp2-css2401-and-2401_legacy-irci_master_2015070.patch ("atomisp2: css2401 and 2401_legacy-irci_master_20150701_0213") Signed-off-by: Tsuchiya Yuto Signed-off-by: Mauro Carvalho Chehab commit fc3b36a783a49928c5f9c463f40cbb7715c91559 Author: Tsuchiya Yuto Date: Mon Oct 18 01:19:48 2021 +0900 media: atomisp: drop luma_only, input_yuv and input_raw from ISP2401 This patch removes luma_only, input_yuv and input_raw from `struct ia_css_binary_info` as well as its usage [1]. Note that for input_yuv and input_raw, only the definitions were removed because these were not used anywhere. [1] added on updating css version to irci_master_20150701_0213 https://raw.githubusercontent.com/intel/ProductionKernelQuilts/cht-m1stable-2016_ww31/uefi/cht-m1stable/patches/cam-0439-atomisp2-css2401-and-2401_legacy-irci_master_2015070.patch ("atomisp2: css2401 and 2401_legacy-irci_master_20150701_0213") Signed-off-by: Tsuchiya Yuto Signed-off-by: Mauro Carvalho Chehab commit 5a1b2725558f8a3b4cbf0504f53cffae8e163034 Author: Tsuchiya Yuto Date: Mon Oct 18 01:19:47 2021 +0900 media: atomisp: fix ifdefs in sh_css.c ## `if (pipe->stream->config.mode == IA_CSS_INPUT_MODE_TPG) {` case The intel-aero atomisp has `#if defined(IS_ISP_2400_SYSTEM)` [1]. It is to be defined in the following two places [2]: - css/hive_isp_css_common/system_global.h - css/css_2401_csi2p_system/system_global.h and the former file is to be included on ISP2400 devices, too. So, it is to be defined for both ISP2400 and ISP2401 devices. Because the upstreamed atomisp driver now supports only ISP2400 and ISP2401, just remove the ISP version test again. This matches the other upstream commits like 3c0538fbad9f ("media: atomisp: get rid of most checks for ISP2401 version"). While here, moved the comment for define GP_ISEL_TPG_MODE to the appropriate place. [1] https://github.com/intel-aero/linux-kernel/blob/a1b673258feb915268377275130c5c5df0eafc82/drivers/media/pci/atomisp/css/sh_css.c#L552-L558 [2] https://github.com/intel-aero/linux-kernel/search?q=IS_ISP_2400_SYSTEM ## `isys_stream_descr->polling_mode` case This does not exist on the intel-aero atomisp. This is because it is based on css version irci_stable_candrpv_0415_20150521_0458. On the other hand, the upstreamed atomisp is based on the following css version depending on the ISP version using ifdefs: - ISP2400: irci_stable_candrpv_0415_20150521_0458 - ISP2401: irci_master_20150911_0724 The `isys_stream_descr->polling_mode` usage was added on updating css version to irci_master_20150701_0213 [3]. So, it is not a ISP version specific thing, but css version specific thing. Because the upstreamed atomisp driver uses irci_master_20150911_0724 for ISP2401, re-add the ISP version check for now. I say "for now" because ISP2401 should eventually use the same css version with ISP2400 (i.e., irci_stable_candrpv_0415_20150521_0458) [3] https://raw.githubusercontent.com/intel/ProductionKernelQuilts/cht-m1stable-2016_ww31/uefi/cht-m1stable/patches/cam-0439-atomisp2-css2401-and-2401_legacy-irci_master_2015070.patch ("atomisp2: css2401 and 2401_legacy-irci_master_20150701_0213") Link to Intel's Android kernel patch. ## `coord = &me->config.internal_frame_origin_bqs_on_sctbl;` case it was added on commit 4f744a573db3 ("media: atomisp: make sh_css_sp_init_pipeline() ISP version independent") for ISP2401. Because the upstreamed atomisp for the ISP2401 part is based on irci_master_20150911_0724, hence the difference. Because the upstreamed atomisp driver uses irci_master_20150911_0724 for ISP2401, revert the test back to `if (IS_ISP2401)`. Fixes: 27333dadef57 ("media: atomisp: adjust some code at sh_css that could be broken") Signed-off-by: Tsuchiya Yuto Signed-off-by: Mauro Carvalho Chehab commit 6fb5d718b08c8bb9b60cfbf5a0a19fa4f77ca29d Author: Tsuchiya Yuto Date: Mon Oct 18 01:19:46 2021 +0900 media: atomisp: use IA_CSS_ERROR() for error messages in sh_css_mipi.c Some debug messages for error cases (messages contain "error: ") use IA_CSS_DEBUG_TRACE_PRIVATE debug level. This causes these error messages not to appear unless users raise debug output level to 7 or higher (using module parameter, dbg_level=7). So, use IA_CSS_DEBUG_ERROR debug level (dbg_level=1) instead considering that these are error messages. There is already a macro IA_CSS_ERROR() for this use case. Let's use it. It automatically appends "error: " at the beginning and a newline to a message. Therefore, we can remove them from these messages. While here, remove the unnecessary newline from one IA_CSS_ERROR() occurrence in the same file. Signed-off-by: Tsuchiya Yuto Signed-off-by: Mauro Carvalho Chehab commit d21ce8c2f7bf6d737b60c09f86db141b9e8e47f0 Author: Tsuchiya Yuto Date: Mon Oct 18 01:19:45 2021 +0900 media: atomisp: fix inverted error check for ia_css_mipi_is_source_port_valid() The function ia_css_mipi_is_source_port_valid() returns true if the port is valid. So, we can't use the existing err variable as is. To fix this issue while reusing that variable, invert the return value when assigning it to the variable. Fixes: 3c0538fbad9f ("media: atomisp: get rid of most checks for ISP2401 version") Signed-off-by: Tsuchiya Yuto Signed-off-by: Mauro Carvalho Chehab commit 9f6b4fa2d2dfbff4b8a57eeb39b1128a6094ee20 Author: Tsuchiya Yuto Date: Mon Oct 18 01:19:44 2021 +0900 media: atomisp: do not use err var when checking port validity for ISP2400 Currently, the `port >= N_CSI_PORTS || err` checks for ISP2400 are always evaluated as true because the err variable is set to `-EINVAL` on declaration but the variable is never used until the evaluation. Looking at the diff of commit 3c0538fbad9f ("media: atomisp: get rid of most checks for ISP2401 version"), the `port >= N_CSI_PORTS` check is for ISP2400 and the err variable check is for ISP2401. Fix this issue by adding ISP version test there accordingly. Fixes: 3c0538fbad9f ("media: atomisp: get rid of most checks for ISP2401 version") Signed-off-by: Tsuchiya Yuto Signed-off-by: Mauro Carvalho Chehab commit e1921cd14640f0f4d1fad5eb8e448c58a536415d Author: Tsuchiya Yuto Date: Mon Oct 18 01:19:43 2021 +0900 media: atomisp: fix inverted logic in buffers_needed() When config.mode is IA_CSS_INPUT_MODE_BUFFERED_SENSOR, it rather needs buffers. Fix it by inverting the return value. Fixes: 3c0538fbad9f ("media: atomisp: get rid of most checks for ISP2401 version") Signed-off-by: Tsuchiya Yuto Signed-off-by: Mauro Carvalho Chehab commit 5bfbf65fcca7325e4d89d289b3c286e11220e386 Author: Tsuchiya Yuto Date: Mon Oct 18 01:19:42 2021 +0900 media: atomisp: fix punit_ddr_dvfs_enable() argument for mrfld_power up case When comparing with intel-aero atomisp [1], it looks like punit_ddr_dvfs_enable() should take `false` as an argument on mrfld_power up case. Code from the intel-aero kernel [1]: int atomisp_mrfld_power_down(struct atomisp_device *isp) { [...] /*WA:Enable DVFS*/ if (IS_CHT) punit_ddr_dvfs_enable(true); int atomisp_mrfld_power_up(struct atomisp_device *isp) { [...] /*WA for PUNIT, if DVFS enabled, ISP timeout observed*/ if (IS_CHT) punit_ddr_dvfs_enable(false); This patch fixes the inverted argument as per the intel-aero code, as well as its comment. While here, fix space issues for comments in atomisp_mrfld_power(). Note that it does not seem to be possible to unify the up/down cases for punit_ddr_dvfs_enable(), i.e., we can't do something like the following: if (IS_CHT) punit_ddr_dvfs_enable(!enable); because according to the intel-aero code [1], the DVFS is disabled before "writing 0x0 to ISPSSPM0 bit[1:0]" and the DVFS is enabled after "writing 0x3 to ISPSSPM0 bit[1:0]". [1] https://github.com/intel-aero/linux-kernel/blob/a1b673258feb915268377275130c5c5df0eafc82/drivers/media/pci/atomisp/atomisp_driver/atomisp_v4l2.c#L431-L514 Fixes: 0f441fd70b1e ("media: atomisp: simplify the power down/up code") Signed-off-by: Tsuchiya Yuto Signed-off-by: Mauro Carvalho Chehab commit ce3015b7212e96db426d0c36f80fd159c91155d1 Author: Tsuchiya Yuto Date: Mon Oct 18 01:19:41 2021 +0900 media: atomisp: add missing media_device_cleanup() in atomisp_unregister_entities() After the commit 9832e155f1ed ("[media] media-device: split media initialization and registration"), calling media_device_cleanup() is needed it seems. However, currently it is missing for the module unload path. Note that for the probe failure path, it is already added in atomisp_register_entities(). This patch adds the missing call of media_device_cleanup() in atomisp_unregister_entities(). Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2") Signed-off-by: Tsuchiya Yuto Signed-off-by: Mauro Carvalho Chehab commit c09d776eaa060534a1663e3b89d842db3e1d9076 Author: Bingbu Cao Date: Fri Oct 15 07:08:39 2021 +0100 media: dw9768: activate runtime PM and turn off device When dw9768 working with ACPI systems, the dw9768 was turned by i2c-core during probe, driver need activate the PM runtime and ask runtime PM to turn off the device. Signed-off-by: Bingbu Cao Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 2a998392403f746e9320c3b836303f8720651e5c Author: Qing Wang Date: Mon Oct 18 09:00:36 2021 +0100 media: i2c: ccs: replace snprintf in show functions with sysfs_emit show() should not use snprintf() when formatting the value to be returned to user space. Fix the following coccicheck warning: drivers/media/i2c/ccs/ccs-core.c:3761: WARNING: use scnprintf or sprintf. Signed-off-by: Qing Wang Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 85db29d22cc521d9d06de2f5c7832981a55df157 Author: Dan Carpenter Date: Wed Oct 13 08:53:19 2021 +0100 media: ipu3-cio2: fix error code in cio2_bridge_connect_sensor() Return -ENODEV if acpi_get_physical_device_location() fails. Don't return success. Fixes: 485aa3df0dff ("media: ipu3-cio2: Parse sensor orientation and rotation") Signed-off-by: Dan Carpenter Reviewed-by: Daniel Scally Reviewed-by: Kieran Bingham Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit 9b005ce90628b6cb7702dcd7d4d512a8b3943519 Author: Bingbu Cao Date: Mon Oct 18 03:48:15 2021 +0100 media: staging: ipu3-imgu: clarify the limitation of grid config There are some grid configuration limitations for ImgU, which was not described clearly in current uAPI header file, add the description to help user to set the grid configuration correctly. Signed-off-by: Bingbu Cao Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham Reviewed-by: Jean-Michel Hautbois Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab commit cffd616086fd03a8e586fc863109697a2431567a Author: Mauro Carvalho Chehab Date: Thu Oct 28 10:24:09 2021 +0100 media: atomisp: get rid of two unused functions Those cause build to break with -Werror with clang-12: drivers/staging/media/atomisp/pci/hive_isp_css_common/host/gdc.c:121:24: error: unused function 'gdc_reg_load' [-Werror,-Wunused-function] drivers/staging/media/atomisp/pci/isp/kernels/raw/raw_1.0/ia_css_raw.host.c:33:1: error: unused function 'sh_css_elems_bytes_from_info' [-Werror,-Wunused-function] Signed-off-by: Mauro Carvalho Chehab commit 002e8f0d59277375154a054df15f925685c01a5c Author: Dillon Min Date: Tue Oct 19 09:43:23 2021 +0100 media: stm32-dma2d: STM32 DMA2D driver This V4L2 subdev m2m driver enables Chrom-Art Accelerator unit of STMicroelectronics STM32 SoC series. Currently support r2m, m2m, m2m_pfc functions. - r2m, Filling a part or the whole of a destination image with a specific color. - m2m, Copying a part or the whole of a source image into a part or the whole of a destination. - m2m_pfc, Copying a part or the whole of a source image into a part or the whole of a destination image with a pixel format conversion. [hverkuil: fix typo in commit log] Signed-off-by: Dillon Min Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit ef9f18a9e3a04126cf017216193166abe03dedef Author: Dillon Min Date: Tue Oct 19 09:43:21 2021 +0100 media: v4l2-ctrls: Add RGB color effects control Add V4L2_COLORFX_SET_RGB color effects control, V4L2_CID_COLORFX_RGB for RGB color setting. with two mirror changes: - change 0xFFFFFF to 0xffffff - fix comments 2^24 to 2^24 - 1 [hverkuil: dropped spaces around + with V4L2_CID_BASE for consistency] Signed-off-by: Dillon Min Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit ee4a929e0eb299491c53f3c6dc235048a3edcdc2 Author: Dillon Min Date: Tue Oct 19 09:43:20 2021 +0100 media: v4l2-ctrls: Add V4L2_CID_COLORFX_CBCR max setting The max of V4L2_CID_COLORFX_CBCR is 0xffff, so add it to v4l2_ctrl_fill() to sure not beyond that. Signed-off-by: Dillon Min Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit c9ee220d76775e42f35d634479c978d9350077d3 Author: Dillon Min Date: Tue Oct 19 09:43:19 2021 +0100 media: videobuf2: Fix the size printk format Since the type of parameter size is unsigned long, it should printk by %lu, instead of %ld, fix it. Fixes: 7952be9b6ece ("media: drivers/media/common/videobuf2: rename from videobuf") Signed-off-by: Dillon Min Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 0a08088f82c2db9cd6bce3258c79a76980c77651 Author: Dillon Min Date: Tue Oct 19 09:43:18 2021 +0100 media: v4l2-mem2mem: add v4l2_m2m_get_unmapped_area for no-mmu platform For platforms without MMU the m2m provides a helper method v4l2_m2m_get_unmapped_area(), The mmap() routines will call this to get a proposed address for the mapping. More detailed information about get_unmapped_area can be found in Documentation/nommu-mmap.txt Signed-off-by: Dillon Min Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit 68dda3e02522aae867f4d526e44e1a87a6cec52a Author: Dillon Min Date: Tue Oct 19 09:43:15 2021 +0100 media: dt-bindings: media: add document for STM32 DMA2d bindings This adds documentation of device tree bindings for the STM32 DMA2D Signed-off-by: Dillon Min Reviewed-by: Rob Herring Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit c9c9e2ab0375a8dd788a8f0587bff0133015290c Author: Dillon Min Date: Tue Oct 19 09:43:14 2021 +0100 media: admin-guide: add stm32-dma2d description add stm32-dma2d description for dma2d driver Signed-off-by: Dillon Min Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab commit d900a1cd310de097fb94796ca575c118b2637b3b Author: Arnaud Ferraris Date: Sat Oct 16 12:20:22 2021 +0200 arm64: dts: allwinner: add 'chassis-type' property A new 'chassis-type' root node property has recently been approved for the device-tree specification, in order to provide a simple way for userspace to detect the device form factor and adjust their behavior accordingly. This patch fills in this property for end-user devices (such as laptops, smartphones and tablets) based on Allwinner ARM64 processors. Signed-off-by: Arnaud Ferraris Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20211016102025.23346-2-arnaud.ferraris@collabora.com commit b15c90153fd906af6e70821a301e78d379bd482d Author: Johan Hovold Date: Fri Jan 8 12:22:33 2021 +0100 gnss: drop stray semicolons Drop semicolons after function definitions that have managed to sneak in and get reproduced. Signed-off-by: Johan Hovold commit 981387ed06b96908223a607f5fba6efa42728fc2 Author: Lad Prabhakar Date: Mon Oct 25 21:56:28 2021 +0100 mtd: hyperbus: rpc-if: Check return value of rpcif_sw_init() rpcif_sw_init() can fail so make sure we check the return value of it and on error exit rpcif_hb_probe() callback with error code. Fixes: 5de15b610f78 ("mtd: hyperbus: add Renesas RPC-IF driver") Signed-off-by: Lad Prabhakar Signed-off-by: Vignesh Raghavendra Reviewed-by: Biju Das Reviewed-by: Wolfram Sang Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20211025205631.21151-5-prabhakar.mahadev-lad.rj@bp.renesas.com commit 5a06f68dbe0fb9cc08db9cfae310c7933aebd6d2 Author: Vandita Kulkarni Date: Tue Oct 19 20:44:34 2021 +0530 drm/i915/dsi/xelpd: Disable DC states in Video mode MIPI DSI transcoder cannot be in video mode to support any of the display C states. Bspec: 49195 (For DC*co DSI transcoders cannot be in video mode) Bspec: 49193 (Hardware does not support DC5 or DC6 with MIPI DSI enabled) Bspec: 49188 (desc of DSI_DCSTATE_CTL talks about cmd mode PM control v2: Align to the power domain ordering (Jani) Add bspec references (Imre) Signed-off-by: Vandita Kulkarni Reviewed-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20211019151435.20477-4-vandita.kulkarni@intel.com commit 09eea212653304522e9ec74cdda59721af8d4969 Author: Vandita Kulkarni Date: Tue Oct 19 20:44:33 2021 +0530 drm/i915/dsi/xelpd: Add DSI transcoder support Update ADL_P device info to support DSI0, DSI1 v2: Re-define cpu_transcoder_mask only (Jani) Signed-off-by: Vandita Kulkarni Reviewed-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20211019151435.20477-3-vandita.kulkarni@intel.com commit 6f07707fa09e1dc58c431d57c25ef2e68b9bec47 Author: Vandita Kulkarni Date: Tue Oct 19 20:44:32 2021 +0530 drm/i915/dsi/xelpd: Fix the bit mask for wakeup GB v2: Fix the typo, move out the hardcoding from macro(Jani, Ville) Fixes: f87c46c43175 ("drm/i915/dsi/xelpd: Add WA to program LP to HS wakeup guardband") Signed-off-by: Vandita Kulkarni Reviewed-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20211019151435.20477-2-vandita.kulkarni@intel.com commit e5043894b21f7d99d3db31ad06308d6c5726caa6 Author: Hengqi Chen Date: Mon Nov 15 09:24:36 2021 +0800 bpftool: Use libbpf_get_error() to check error Currently, LIBBPF_STRICT_ALL mode is enabled by default for bpftool which means on error cases, some libbpf APIs would return NULL pointers. This makes IS_ERR check failed to detect such cases and result in segfault error. Use libbpf_get_error() instead like we do in libbpf itself. Signed-off-by: Hengqi Chen Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211115012436.3143318-1-hengqi.chen@gmail.com commit c874dff452f34056315b01d7954ce613ce6c18ab Merge: 325d956d67178 b06be5651f08b Author: Andrii Nakryiko Date: Sun Nov 14 18:34:10 2021 -0800 Merge branch 'bpftool: miscellaneous fixes' Quentin Monnet says: ==================== This set contains several independent minor fixes for bpftool, its Makefile, and its documentation. Please refer to individual commits for details. ==================== Signed-off-by: Andrii Nakryiko commit b06be5651f08bc5bc305e2a3c722ddb33b783ee5 Author: Quentin Monnet Date: Wed Nov 10 11:46:32 2021 +0000 bpftool: Fix mixed indentation in documentation Some paragraphs in bpftool's documentation have a mix of tabs and spaces for indentation. Let's make it consistent. This patch brings no change to the text content. Signed-off-by: Quentin Monnet Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211110114632.24537-7-quentin@isovalent.com commit 3811e2753a39efb8aa5b8c133dc24f6d26f6cd96 Author: Quentin Monnet Date: Wed Nov 10 11:46:31 2021 +0000 bpftool: Update the lists of names for maps and prog-attach types To support the different BPF map or attach types, bpftool must remain up-to-date with the types supported by the kernel. Let's update the lists, by adding the missing Bloom filter map type and the perf_event attach type. Both missing items were found with test_bpftool_synctypes.py. Signed-off-by: Quentin Monnet Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211110114632.24537-6-quentin@isovalent.com commit 986dec18bbf41f50edc2e0aa4ac5ef8e0f64f328 Author: Quentin Monnet Date: Wed Nov 10 11:46:30 2021 +0000 bpftool: Fix indent in option lists in the documentation Mixed indentation levels in the lists of options in bpftool's documentation produces some unexpected results. For the "bpftool" man page, it prints a warning: $ make -C bpftool.8 GEN bpftool.8 :26: (ERROR/3) Unexpected indentation. For other pages, there is no warning, but it results in a line break appearing in the option lists in the generated man pages. RST paragraphs should have a uniform indentation level. Let's fix it. Fixes: c07ba629df97 ("tools: bpftool: Update and synchronise option list in doc and help msg") Fixes: 8cc8c6357c8f ("tools: bpftool: Document and add bash completion for -L, -B options") Signed-off-by: Quentin Monnet Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211110114632.24537-5-quentin@isovalent.com commit 48f5aef4c458c19ab337eed8c95a6486cc014aa3 Author: Quentin Monnet Date: Wed Nov 10 11:46:28 2021 +0000 bpftool: Remove inclusion of utilities.mak from Makefiles Bpftool's Makefile, and the Makefile for its documentation, both include scripts/utilities.mak, but they use none of the items defined in this file. Remove the includes. Fixes: 71bb428fe2c1 ("tools: bpf: add bpftool") Signed-off-by: Quentin Monnet Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211110114632.24537-3-quentin@isovalent.com commit ebbd7f64a3fbe9e0f235e39fc244ee9735e2a52a Author: Quentin Monnet Date: Wed Nov 10 11:46:27 2021 +0000 bpftool: Fix memory leak in prog_dump() Following the extraction of prog_dump() from do_dump(), the struct btf allocated in prog_dump() is no longer freed on error; the struct bpf_prog_linfo is not freed at all. Make sure we release them before exiting the function. Fixes: ec2025095cf6 ("bpftool: Match several programs with same tag") Signed-off-by: Quentin Monnet Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211110114632.24537-2-quentin@isovalent.com commit 1274a4eb318debe33e395bb8bcf8b98e6eb4670f Author: luo penghao Date: Thu Nov 11 15:09:24 2021 +0000 ipv6: Remove duplicate statements This statement is repeated with the initialization statement Reported-by: Zeal Robot Signed-off-by: luo penghao Signed-off-by: David S. Miller commit 0de3521500cfdc91f49441a054ed892fc408d73f Author: luo penghao Date: Thu Nov 11 09:20:47 2021 +0000 ipv4: Remove duplicate assignments there is a same action when the variable is initialized Reported-by: Zeal Robot Signed-off-by: luo penghao Signed-off-by: David S. Miller commit ef14102914f3f6a86d105e9fc2941d97de69c389 Author: luo penghao Date: Thu Nov 11 09:18:09 2021 +0000 ipv4: drop unused assignment The assignment in the if statement will be overwritten by the following statement Reported-by: Zeal Robot Signed-off-by: luo penghao Signed-off-by: David S. Miller commit 393534f291d821779203cb74896abc26e07160d6 Author: Hans Verkuil Date: Wed Nov 10 16:58:42 2021 +0100 drm/nouveau: set RGB quantization range to FULL The nouveau driver outputs full range RGB, but the AVI InfoFrame just says 'Default' instead of 'Full'. Call drm_hdmi_avi_infoframe_quant_range to fill in the quantization field of the AVI InfoFrame correctly. Now displays that advertise RGB Selectable Quantization Range in their EDID will understand that full range is transmitted by the HDMI output. This is consistent to how the Nvidia's driver behaves. Signed-off-by: Hans Verkuil Reviewed-by: Ben Skeggs Signed-off-by: Karol Herbst Link: https://patchwork.freedesktop.org/patch/msgid/e9a4a58a-0500-50f6-58cc-938a253cedeb@xs4all.nl commit d50d16036fb395aaa3c4ca0333b55cceadc81874 Author: Luo Jiaxing Date: Thu Feb 25 15:51:42 2021 +0800 drm/nouveau/kms: delete an useless function call in nouveau_framebuffer_new() nouveau_framebuffer_new() call drm_format_info_plane_width() to get a width of plane, but width is not used then, so it's a useless function call here. Signed-off-by: Luo Jiaxing Signed-off-by: Ben Skeggs Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://gitlab.freedesktop.org/drm/nouveau/-/merge_requests/10 commit 606be062c2e5324ade705e463b45d9262adabcab Author: Luo Jiaxing Date: Thu Feb 25 15:27:06 2021 +0800 drm/nouveau/kms/nv50-: Remove several set but not used variables "ret" in disp.c Fixes the following warning when using W=1 to build kernel: drivers/gpu/drm/nouveau/dispnv50/disp.c: In function ‘nv50_mstm_cleanup’: drivers/gpu/drm/nouveau/dispnv50/disp.c:1389:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] 1389 | int ret; | ^~~ drivers/gpu/drm/nouveau/dispnv50/disp.c: In function ‘nv50_mstm_prepare’: drivers/gpu/drm/nouveau/dispnv50/disp.c:1413:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable] 1413 | int ret; | ^~~ Signed-off-by: Luo Jiaxing Signed-off-by: Ben Skeggs Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://gitlab.freedesktop.org/drm/nouveau/-/merge_requests/10 commit 170dcb67a208b6ba93dc18be607b90f82520749a Author: Jiapeng Chong Date: Fri Feb 26 18:07:15 2021 +0800 drm/nouveau/fifo: make tu102_fifo_runlist static Fix the following sparse warning: drivers/gpu/drm/nouveau/nvkm/engine/fifo/tu102.c:53:1: warning: symbol 'tu102_fifo_runlist' was not declared. Should it be static? Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Ben Skeggs Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://gitlab.freedesktop.org/drm/nouveau/-/merge_requests/10 commit f9325afc23268567d9a6a7452252200cf79def84 Author: Lee Jones Date: Wed Mar 3 13:42:43 2021 +0000 drm/nouveau/dispnv50/headc57d: Make local function 'headc57d_olut' static Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/nouveau/dispnv50/headc57d.c:173:1: warning: no previous prototype for ‘headc57d_olut’ [-Wmissing-prototypes] Cc: Ben Skeggs Cc: David Airlie Cc: Daniel Vetter Cc: Lyude Paul Cc: dri-devel@lists.freedesktop.org Cc: nouveau@lists.freedesktop.org Signed-off-by: Lee Jones Reviewed-by: Lyude Paul Signed-off-by: Ben Skeggs Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://gitlab.freedesktop.org/drm/nouveau/-/merge_requests/10 commit 22da19f900be6b90b6984522708b203ac9bce1e6 Author: Luo Jiaxing Date: Mon Mar 8 16:32:52 2021 +0800 drm/nouveau/device: use snprintf() to replace strncpy() to avoid NUL-terminated string loss Following warning is found when using W=1 to build kernel: In function ‘nvkm_udevice_info’, inlined from ‘nvkm_udevice_mthd’ at drivers/gpu/drm/nouveau/nvkm/engine/device/user.c:195:10: drivers/gpu/drm/nouveau/nvkm/engine/device/user.c:164:2: warning: ‘strncpy’ specified bound 16 equals destination size [-Wstringop-truncation] 164 | strncpy(args->v0.chip, device->chip->name, sizeof(args->v0.chip)); drivers/gpu/drm/nouveau/nvkm/engine/device/user.c:165:2: warning: ‘strncpy’ specified bound 64 equals destination size [-Wstringop-truncation] 165 | strncpy(args->v0.name, device->name, sizeof(args->v0.name)); The reason of this warning is strncpy() does not guarantee that the destination buffer will be NUL terminated. If the length of source string is bigger than number we set by third input parameter, only a part of characters is copied to the destination, and no NUL-terminated string is automatically added. There are some potential risks. So use snprintf() to replace strncpy(). Signed-off-by: Luo Jiaxing Signed-off-by: Ben Skeggs Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://gitlab.freedesktop.org/drm/nouveau/-/merge_requests/10 commit bd6e07e72f37f34535bec7eebc807e5fcfe37b43 Author: Ilia Mirkin Date: Sun Mar 7 12:48:53 2021 -0500 drm/nouveau/kms/nv04: use vzalloc for nv04_display The struct is giant, and triggers an order-7 allocation (512K). There is no reason for this to be kmalloc-type memory, so switch to vmalloc. This should help loading nouveau on low-memory and/or long-running systems. Reported-by: Nathan E. Egge Signed-off-by: Ilia Mirkin Cc: stable@vger.kernel.org Signed-off-by: Ben Skeggs Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://gitlab.freedesktop.org/drm/nouveau/-/merge_requests/10 commit 5d96a01549ec6eb5515b735301a7f1c6c4d481a6 Author: tangchunyou Date: Wed Mar 17 17:35:45 2021 +0800 nouveau/nvkm/subdev/devinit/mcp89.c:Unneeded variable disable,delete disable and return 0 Signed-off-by: tangchunyou Signed-off-by: Ben Skeggs Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://gitlab.freedesktop.org/drm/nouveau/-/merge_requests/10 commit 79af598a5baefc3a92b31ebc5b7aff00b38dc633 Author: Lyude Paul Date: Wed Mar 17 19:01:46 2021 -0400 drm/nouveau/kms/nv50-: Always validate LUTs in nv50_head_atomic_check_lut() When it comes to gamma or degamma luts, nouveau will actually skip the calculation of certain LUTs depending on the head and plane states. For instance, when the head is disabled we don't perform any error checking on the gamma LUT, and likewise if no planes are present and enabled in our atomic state we will skip error checking the degamma LUT. This is a bit of a problem though, since the per-head gamma and degamma props in DRM can be changed even while a head is disabled - a situation which can be triggered by the igt testcase mentioned down below. Originally I thought this was a bit silly and was tempted to just fix the igt test to only set gamma/degamma with the head enabled. After a bit of thinking though I realized we should fix this in nouveau. This is because if a program decides to set an invalid LUT for a head before enabling the head, such a property change would succeed while also making it impossible to turn the head back on until the LUT is removed or corrected - something that could be painful for a user to figure out. So, fix this checking both degamma and gamma LUTs unconditionally during atomic checks. We start by calling nv50_head_atomic_check_lut() regardless of whether the head is active or not in nv50_head_atomic_check(). Then we move the ilut error checking into nv50_head_atomic_check_lut() and add a per-head hook for it, primarily because as a per-CRTC property DRM we want the LUT to be error checked by the head any time it's included in an atomic state. Of course though, actual programming of the degamma lut to hardware is still handled in each plane's atomic check and commit. Signed-off-by: Lyude Paul Testcase: igt/kms_color/pipe-invalid-*-lut-sizes Signed-off-by: Ben Skeggs Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://gitlab.freedesktop.org/drm/nouveau/-/merge_requests/10 commit 372b8307a6288265fc06f2d7a6ccc85e21167d37 Author: Lyude Paul Date: Wed Mar 17 19:01:45 2021 -0400 drm/nouveau/kms/nv50-: Use NV_ATOMIC() in nv50_head_atomic_check_lut() Since this is used in the atomic check, we should use the right debug macro for it. Signed-off-by: Lyude Paul Cc: Martin Peres Cc: Jeremy Cline Signed-off-by: Ben Skeggs Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://gitlab.freedesktop.org/drm/nouveau/-/merge_requests/10 commit 78ad449dc5c88dc540f8cc07d87ce2024686cbb3 Author: Jiapeng Chong Date: Fri Mar 19 16:40:40 2021 +0800 drm/nouveau: Remove unused variable ret Fix the following coccicheck warnings: ./drivers/gpu/drm/nouveau/nouveau_bios.c:2048:5-8: Unneeded variable: "ret". Return "0" on line 2061. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Signed-off-by: Ben Skeggs Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://gitlab.freedesktop.org/drm/nouveau/-/merge_requests/10 commit c0a808b06939a39f6f90c3a33436365e6ede0618 Author: Lyude Paul Date: Thu Mar 18 19:03:49 2021 -0400 drm/nouveau/kms/nv50-: Correct size checks for cursors Found this while trying to make some changes to the kms_cursor_crc test. curs507a_acquire checks that the width and height of the cursor framebuffer are equal (asyw->image.{w,h}). This isn't entirely correct though, as the height of the cursor can be larger than the size of the cursor, as long as the width is the same as the cursor size and there's no framebuffer offset. Note that I'm not entirely sure why this wasn't previously breaking kms_cursor_crc tests - they all set up cursors with the height being one pixel larger than the actual size of the cursor. But this seems to fix things, and the code before was definitely incorrect - so it's not really worth looking into further imho. Changes since v1: * Don't use crtc_w everywhere for determining cursor layout, just use fb size again * Change check so that we only check that the w/h of the cursor plane is the same, the width of the scanout surface is the same as the framebuffer width, and that there's no offset being used for the cursor surface. Signed-off-by: Lyude Paul Cc: Martin Peres Cc: Jeremy Cline Signed-off-by: Ben Skeggs Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://gitlab.freedesktop.org/drm/nouveau/-/merge_requests/10 commit c5dac1f62153d08a2404bcd6292d72f8290c2c1d Author: Bhaskar Chowdhury Date: Wed Mar 24 12:04:40 2021 +0530 drm/nouveau/bios/init: A typo fix s/conditon/condition/ Signed-off-by: Bhaskar Chowdhury Acked-by: Randy Dunlap Signed-off-by: Ben Skeggs Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://gitlab.freedesktop.org/drm/nouveau/-/merge_requests/10 commit 5e18b9737004ef6f34862f6fb39d3c9027a4044a Author: Zou Wei Date: Tue Mar 23 07:48:57 2021 +0000 drm/nouveau/core/client: Mark nvkm_uclient_sclass with static keyword Fix the following sparse warning: drivers/gpu/drm/nouveau/nvkm/core/client.c:64:1: warning: symbol 'nvkm_uclient_sclass' was not declared. Should it be static? Signed-off-by: Zou Wei Signed-off-by: Ben Skeggs Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://gitlab.freedesktop.org/drm/nouveau/-/merge_requests/10 commit 4cdd2450bf739bada353e82d27b00db9af8c3001 Author: Ben Skeggs Date: Thu Feb 25 14:54:59 2021 +1000 drm/nouveau/pmu/gm200-: use alternate falcon reset sequence Signed-off-by: Ben Skeggs Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://gitlab.freedesktop.org/drm/nouveau/-/merge_requests/10 commit 1d2271d2fb85e54bfc9630a6c30ac0feb9ffb983 Author: Ben Skeggs Date: Wed Feb 24 19:29:52 2021 +1000 drm/nouveau/pmu/gm200-: avoid touching PMU outside of DEVINIT/PREOS/ACR There have been reports of the WFI timing out on some boards, and a patch was proposed to just remove it. This stuff is rather fragile, and I believe the WFI might be needed with our FW prior to GM200. However, we probably should not be touching PMU during init on GPUs where we depend on NVIDIA FW, outside of limited circumstances, so this should be a somewhat safer change that achieves the desired result. Reported-by: Diego Viola Signed-off-by: Ben Skeggs Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://gitlab.freedesktop.org/drm/nouveau/-/merge_requests/10 commit 6040308ffc9039d30a34bc40021e19d6da3683b1 Author: Lyude Paul Date: Mon Jan 18 20:48:49 2021 -0500 drm/nouveau/kms/nv140-: Add CRC methods to gv100_disp_core_mthd_head Noticed this while trying to figure out the bit that we need to set in order to get cursor CRCs to come up correctly on volta+: we never actually went and added these methods to gv100_disp_core_mthd_head in drm/nouveau/nvkm/engine/disp/coregv100.c which means we don't trace their values when disp tracing is enabled in nvkm. So, fix that. Cc: Martin Peres Cc: Jeremy Cline Cc: Simon Ser Signed-off-by: Lyude Paul Signed-off-by: Ben Skeggs Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://gitlab.freedesktop.org/drm/nouveau/-/merge_requests/10 commit 23244f67ed96c76428bfdfc63eef642e4d627825 Author: Lyude Paul Date: Tue Feb 23 18:56:47 2021 -0500 drm/nouveau/kms/nvd9-nv138: Fix CRC calculation for the cursor channel Something that didn't get noticed until I started running cursor tests: we're accidentally disabling an option for CRC calculation that's enabled by default: WidePipeCrc, which controls whether we use the full width of the data in the display pipe in order calculate CRCs. Having this disabled apparently causes frames with the cursor plane enabled to generate different CRCs than frames without the cursor plane enabled, even if the frames are pixel-equivalent. So, let's make sure to enable this and fix a bunch of cursor related tests in IGT. v2: * Nvidia added the specific bit we were using to fix this issues to open-gpu-docs, so pull in the actual macro definitions for it Cc: Martin Peres Cc: Jeremy Cline Cc: Simon Ser Signed-off-by: Lyude Paul Signed-off-by: Ben Skeggs Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://gitlab.freedesktop.org/drm/nouveau/-/merge_requests/10 commit 57cbdbe65e5f9ba9bfd67b66bc3ce24ef1c54643 Author: Lyude Paul Date: Mon Jan 18 20:48:47 2021 -0500 drm/nouveau/kms/nv140-: Use hard-coded wndws or core channel for CRC channel Originally it was assumed based on Nvidia's open-gpu-docs and testing that NVDisplay required that at least one wndw which belongs to a given head to be used as the controlling channel (NVC37D_HEAD_SET_CRC_CONTROL_CONTROLLING_CHANNEL) in order for CRC capture to function. While this is the case on Volta, Turing actually adds the ability to instead use the core channel as the controlling channel. For Turing this is quite useful, as it means that we can always default to the core channel as the controlling channel and we don't need to be concerned about ensuring we have at least one wndw channel owned by a head with CRC output enabled. While Volta lacks this ability, Volta conveniently also lacks flexible wndw mapping - meaning that we can always rely on each head having four wndw channels mapped to it regardless of the atomic state. So, simply use the hard-coded wndw mappings we're guaranteed to have on Volta as the controlling channel, and use the core channel as the controlling channel for Turing+. As a result this also renders the plane ownership logic in nv50_crc_atomic_check() unnessecary, which gives us one less thing to implement when we get support for flexible wndw mapping. We also can entirely drop the wndw parameter from our set_src callbacks, and the atomic state. v2 (Karol): put prackets around complex macro definition removed spaces before :32 in structs Cc: Martin Peres Cc: Jeremy Cline Cc: Simon Ser Signed-off-by: Lyude Paul Signed-off-by: Ben Skeggs Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://gitlab.freedesktop.org/drm/nouveau/-/merge_requests/10 commit 4f232990dd83564ff41d6186ff268a9eeeb118a9 Author: Lyude Paul Date: Mon Jan 18 20:48:46 2021 -0500 drm/nouveau/kms/nv50-: Check vbl count after CRC context flip While I haven't seen us take too long in nv50_crc_ctx_flip_work() outside of users with kernel logging on a serial port, it probably would be a good idea to check how long we take just in case we need to go faster in the future. Cc: Martin Peres Cc: Jeremy Cline Cc: Simon Ser Signed-off-by: Lyude Paul Signed-off-by: Ben Skeggs Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://gitlab.freedesktop.org/drm/nouveau/-/merge_requests/10 commit bc4c7fa02b5f9439db0d16a5071620747e43736e Author: Lyude Paul Date: Mon Jan 18 20:48:45 2021 -0500 drm/nouveau/kms/nv50-: Use drm_dbg_kms() in crc.c Cc: Martin Peres Cc: Jeremy Cline Cc: Simon Ser Signed-off-by: Lyude Paul Reviewed-by: Simon Ser Signed-off-by: Ben Skeggs Reviewed-by: Karol Herbst Signed-off-by: Karol Herbst Link: https://gitlab.freedesktop.org/drm/nouveau/-/merge_requests/10 commit 94bdb32aa2b251b6a21b1893435856d048ecabf0 Author: Karol Herbst Date: Wed Nov 10 14:31:57 2021 +0100 MAINTAINERS: update information for nouveau Some side notes on this. Atm we do want to use gitlab for bug tracking and merge requests. But due to the nature of the current linux kernel development, we can only do so for nouveau internal changes. Everything else still needs to be sent as emails and this is also includes changes to UAPI etc. Anyway, if somebody wants to submit patches via gitlab, they are free to do so and this should just make this more official and documented. People listed as maintainers are such that have push access to drm-misc (where changes are pushed to after landing in gitlab) and are known nouveau developers. We did this already for some trivial changes and critical bug fixes already, we just weren't thinking about updating the MAINTAINERS file. Cc: Ben Skeggs Cc: Lyude Paul Cc: David Airlie Cc: Daniel Vetter Cc: dri-devel@lists.freedesktop.org Cc: nouveau@lists.freedesktop.org Signed-off-by: Karol Herbst Acked-by: Daniel Vetter Acked-by: Lyude Paul Signed-off-by: Ben Skeggs Link: https://patchwork.freedesktop.org/patch/msgid/20211110133157.553251-1-kherbst@redhat.com commit 325d956d67178af92b5b12ff950a2f93a433f2c4 Author: Yonghong Song Date: Fri Nov 12 12:48:38 2021 -0800 selftests/bpf: Fix a tautological-constant-out-of-range-compare compiler warning When using clang to build selftests with LLVM=1 in make commandline, I hit the following compiler warning: benchs/bench_bloom_filter_map.c:84:46: warning: result of comparison of constant 256 with expression of type '__u8' (aka 'unsigned char') is always false [-Wtautological-constant-out-of-range-compare] if (args.value_size < 2 || args.value_size > 256) { ~~~~~~~~~~~~~~~ ^ ~~~ The reason is arg.vaue_size has type __u8, so comparison "args.value_size > 256" is always false. This patch fixed the issue by doing proper comparison before assigning the value to args.value_size. The patch also fixed the same issue in two other places. Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211112204838.3579953-1-yhs@fb.com commit 21c6ec3d5275a77348b1af0e78cbbed0ee1558d4 Author: Yonghong Song Date: Fri Nov 12 12:48:33 2021 -0800 selftests/bpf: Fix an unused-but-set-variable compiler warning When using clang to build selftests with LLVM=1 in make commandline, I hit the following compiler warning: xdpxceiver.c:747:6: warning: variable 'total' set but not used [-Wunused-but-set-variable] u32 total = 0; ^ This patch fixed the issue by removing that declaration and its assocatied unused operation. Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211112204833.3579457-1-yhs@fb.com commit 58da0d84fdd2563939dafa48334e190fad1b536c Merge: 2ce1b21cb3326 dbe638f71eaed Author: Mark Brown Date: Fri Nov 12 21:25:21 2021 +0000 Merge series "" from : Changes from ChiYuan Huang to fix a couple of bugs and add a new device ID/quirk for the rt9120s to the driver. commit 5f1176b419f9468f05dabdc8352bfa9b15427377 Author: Vinay Belgaumkar Date: Thu Nov 11 23:10:16 2021 -0800 drm/i915/guc/slpc: Check GuC status before freq boost It's possible that i915 might get wedged between a boost and un-boost. Validate the i915-GuC connection before trying to send a H2G to change the min frequency. Bug: https://gitlab.freedesktop.org/drm/intel/-/issues/4464 Cc: Ashutosh Dixit Signed-off-by: Vinay Belgaumkar Reviewed-by: Ashutosh Dixit Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20211112071016.9640-1-vinay.belgaumkar@intel.com commit 7cc595a60187bcfaf8a8013539900154eccb4d3f Merge: 314f14abdeca7 d19ddb476a539 Author: Alexei Starovoitov Date: Fri Nov 12 10:19:10 2021 -0800 Merge branch 'introduce btf_tracing_ids' Song Liu says: ==================== Changes v2 => v3: 1. Fix bug in task_iter.c. (Kernel test robot ) Changes v1 => v2: 1. Add patch 2/2. (Alexei) 1/2 fixes issue with btf_task_struct_ids w/o CONFIG_DEBUG_INFO_BTF. 2/2 replaces btf_task_struct_ids with easier to understand btf_tracing_ids. ==================== Signed-off-by: Alexei Starovoitov commit d19ddb476a539fd78ad1028ae13bb38506286931 Author: Song Liu Date: Fri Nov 12 07:02:43 2021 -0800 bpf: Introduce btf_tracing_ids Similar to btf_sock_ids, btf_tracing_ids provides btf ID for task_struct, file, and vm_area_struct via easy to understand format like btf_tracing_ids[BTF_TRACING_TYPE_[TASK|file|VMA]]. Suggested-by: Alexei Starovoitov Signed-off-by: Song Liu Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20211112150243.1270987-3-songliubraving@fb.com commit 9e2ad638ae3632ef916ceb39f70e3104bf8fdc97 Author: Song Liu Date: Fri Nov 12 07:02:42 2021 -0800 bpf: Extend BTF_ID_LIST_GLOBAL with parameter for number of IDs syzbot reported the following BUG w/o CONFIG_DEBUG_INFO_BTF BUG: KASAN: global-out-of-bounds in task_iter_init+0x212/0x2e7 kernel/bpf/task_iter.c:661 Read of size 4 at addr ffffffff90297404 by task swapper/0/1 CPU: 1 PID: 1 Comm: swapper/0 Not tainted 5.15.0-syzkaller #0 Hardware name: ... 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_address_description.constprop.0.cold+0xf/0x309 mm/kasan/report.c:256 __kasan_report mm/kasan/report.c:442 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:459 task_iter_init+0x212/0x2e7 kernel/bpf/task_iter.c:661 do_one_initcall+0x103/0x650 init/main.c:1295 do_initcall_level init/main.c:1368 [inline] do_initcalls init/main.c:1384 [inline] do_basic_setup init/main.c:1403 [inline] kernel_init_freeable+0x6b1/0x73a init/main.c:1606 kernel_init+0x1a/0x1d0 init/main.c:1497 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 This is caused by hard-coded name[1] in BTF_ID_LIST_GLOBAL (w/o CONFIG_DEBUG_INFO_BTF). Fix this by adding a parameter n to BTF_ID_LIST_GLOBAL. This avoids ifdef CONFIG_DEBUG_INFO_BTF in btf.c and filter.c. Fixes: 7c7e3d31e785 ("bpf: Introduce helper bpf_find_vma") Reported-by: syzbot+e0d81ec552a21d9071aa@syzkaller.appspotmail.com Reported-by: Eric Dumazet Suggested-by: Eric Dumazet Signed-off-by: Song Liu Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20211112150243.1270987-2-songliubraving@fb.com commit ad253b3dd79851d926154ef747a69427573233e4 Author: Johan Jonker Date: Tue Aug 24 11:56:37 2021 +0200 dt-bindings: timer: remove rockchip,rk3066-timer compatible string from rockchip,rk-timer.yaml The Rockchip rk3066 timers have a different register layout then rk3288 with only a 32 vs 64 bits timer channel. The timers in rk3066a.dtsi have "snps,dw-apb-timer" as compatible string, so remove the "rockchip,rk3066-timer" from rockchip,rk-timer.yaml Signed-off-by: Johan Jonker Acked-by: Rob Herring Link: https://lore.kernel.org/r/20210824095637.2547-1-jbx6244@gmail.com Signed-off-by: Daniel Lezcano commit 314f14abdeca78de6b16f97d796a9966ce4b90ae Author: Stanislav Fomichev Date: Wed Nov 10 11:23:24 2021 -0800 bpftool: Enable libbpf's strict mode by default Otherwise, attaching with bpftool doesn't work with strict section names. Also: - Add --legacy option to switch back to pre-1.0 behavior - Print a warning when program fails to load in strict mode to point to --legacy flag - By default, don't append / to the section name; in strict mode it's relevant only for a small subset of prog types + bpftool --legacy prog loadall tools/testing/selftests/bpf/test_cgroup_link.o /sys/fs/bpf/kprobe type kprobe libbpf: failed to pin program: File exists Error: failed to pin all programs + bpftool prog loadall tools/testing/selftests/bpf/test_cgroup_link.o /sys/fs/bpf/kprobe type kprobe v1 -> v2: - strict by default (Quentin Monnet) - add more info to --legacy description (Quentin Monnet) - add bash completion (Quentin Monnet) Signed-off-by: Stanislav Fomichev Signed-off-by: Daniel Borkmann Reviewed-by: Quentin Monnet Link: https://lore.kernel.org/bpf/20211110192324.920934-1-sdf@google.com commit 6a628fa43810f861da50c593c69f2ead1c829231 Author: Alexander Aring Date: Fri Nov 12 10:08:01 2021 -0500 fs: dlm: fix potential buffer overflow This patch fixes an potential overflow in sscanf and the maximum declared string parsing length which seems to be excluding the null termination symbol. This patch will just add one byte to be prepared on a string with length of DLM_RESNAME_MAXLEN including the null termination symbol. Fixes: 5054e79de999 ("fs: dlm: add lkb debugfs functionality") Reported-by: kernel test robot Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 2a2d23b68c4e4cd71c9999ea8b8608700c3f9ead Author: Colin Ian King Date: Wed Sep 15 12:27:02 2021 +0100 drm/i915: make array states static const Don't populate the read-only array states on the stack but instead it static. Also makes the object code smaller. Signed-off-by: Colin Ian King Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20210915112702.12783-1-colin.king@canonical.com commit 318ba02cd8a8bacd20a4fe29edff3c0931d17ded Author: Neil Armstrong Date: Wed Oct 20 14:39:47 2021 +0200 drm/meson: encoder_cvbs: switch to bridge with ATTACH_NO_CONNECTOR Drop the local connector and move all callback to bridge funcs in order to leverage the generic CVBS display connector. This will also permit adding custom cvbs connectors for ADC based HPD detection on some Amlogic SoC based boards. Signed-off-by: Neil Armstrong Acked-by: Sam Ravnborg Acked-by: Martin Blumenstingl [narmstrong: fixed diplay typo in commit log] Link: https://patchwork.freedesktop.org/patch/msgid/20211020123947.2585572-7-narmstrong@baylibre.com commit 72317eaa23b146ca550492c812106d474bd31bdd Author: Neil Armstrong Date: Wed Oct 20 14:39:46 2021 +0200 drm/meson: rename venc_cvbs to encoder_cvbs Rename the cvbs encoder to match the newly introduced meson_encoder_hdmi. Signed-off-by: Neil Armstrong Acked-by: Sam Ravnborg Acked-by: Martin Blumenstingl Link: https://patchwork.freedesktop.org/patch/msgid/20211020123947.2585572-6-narmstrong@baylibre.com commit 0af5e0b41110e2da872030395231ab19c45be931 Author: Neil Armstrong Date: Wed Oct 20 14:39:45 2021 +0200 drm/meson: encoder_hdmi: switch to bridge DRM_BRIDGE_ATTACH_NO_CONNECTOR This implements the necessary change to no more use the embedded connector in dw-hdmi and use the dedicated bridge connector driver by passing DRM_BRIDGE_ATTACH_NO_CONNECTOR to the bridge attach call. The necessary connector properties are added to handle the same functionalities as the embedded dw-hdmi connector, i.e. the HDR metadata, the CEC notifier & other flags. The dw-hdmi output_port is set to 1 in order to look for a connector next bridge in order to get DRM_BRIDGE_ATTACH_NO_CONNECTOR working. Signed-off-by: Neil Armstrong Acked-by: Sam Ravnborg Acked-by: Martin Blumenstingl Link: https://patchwork.freedesktop.org/patch/msgid/20211020123947.2585572-5-narmstrong@baylibre.com commit e67f6037ae1be34b2b686bab72caa41d57714534 Author: Neil Armstrong Date: Wed Oct 20 14:39:44 2021 +0200 drm/meson: split out encoder from meson_dw_hdmi This moves all the non-DW-HDMI code where it should be: an encoder in the drm/meson core driver. The bridge functions are copied as-is, except: - the encoder init uses the simple kms helper - the mode_set has been moved to atomic_enable() - debug prints are converted to dev_debg() For now the bridge attach flags is 0, DRM_BRIDGE_ATTACH_NO_CONNECTOR will be handled later. The meson dw-hdmi glue is slightly fixed to live without the encoder in the same driver. Signed-off-by: Neil Armstrong Acked-by: Sam Ravnborg Acked-by: Martin Blumenstingl [narmstrong: fixed warning because missing meson_encoder_hdmi.h include] Link: https://patchwork.freedesktop.org/patch/msgid/20211020123947.2585572-4-narmstrong@baylibre.com commit d235a7c426b1a4867d2db8f640b46843251edd26 Author: Neil Armstrong Date: Wed Oct 20 14:39:43 2021 +0200 drm/meson: remove useless recursive components matching The initial design was recursive to cover all port/endpoints, but only the first layer of endpoints should be covered by the components list. This also breaks the MIPI-DSI init/bridge attach sequence, thus only parse the first endpoints instead of recursing. Signed-off-by: Neil Armstrong Acked-by: Sam Ravnborg Acked-by: Martin Blumenstingl Link: https://patchwork.freedesktop.org/patch/msgid/20211020123947.2585572-3-narmstrong@baylibre.com commit 7cd70656d1285b79c001f041a017fcfee4292ff9 Author: Neil Armstrong Date: Wed Oct 20 14:39:42 2021 +0200 drm/bridge: display-connector: implement bus fmts callbacks Since this bridge is tied to the connector, it acts like a passthrough, so concerning the output & input bus formats, either pass the bus formats from the previous bridge or return fallback data like done in the bridge function: drm_atomic_bridge_chain_select_bus_fmts() & select_bus_fmt_recursive. This permits avoiding skipping the negociation if the remaining bridge chain has all the bits in place. Without this bus fmt negociation breaks on drm/meson HDMI pipeline when attaching dw-hdmi with DRM_BRIDGE_ATTACH_NO_CONNECTOR, because the last bridge of the display-connector doesn't implement buf fmt callbacks and MEDIA_BUS_FMT_FIXED is used leading to select an unsupported default bus format from dw-hdmi. Signed-off-by: Neil Armstrong Reviewed-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20211020123947.2585572-2-narmstrong@baylibre.com commit 3f2532d65a571ca02258b547b5b68ab2e9406fdb Author: Neil Armstrong Date: Fri Oct 29 15:59:47 2021 +0200 drm/bridge: dw-hdmi: handle ELD when DRM_BRIDGE_ATTACH_NO_CONNECTOR The current ELD handling takes the internal connector ELD buffer and shares it to the I2S and AHB sub-driver. But with DRM_BRIDGE_ATTACH_NO_CONNECTOR, the connector is created elsewhere (or not), and an eventual connector is known only if the bridge chain up to a connector is enabled. The current dw-hdmi code gets the current connector from atomic_enable() so use the already stored connector pointer and replace the buffer pointer with a callback returning the current connector ELD buffer. Since a connector is not always available, either pass an empty ELD to the alsa HDMI driver or don't call snd_pcm_hw_constraint_eld() in AHB driver. Reported-by: Martin Blumenstingl Signed-off-by: Neil Armstrong [narmstrong: fixed typo in commit log] Acked-by: Jernej Skrabec Link: https://patchwork.freedesktop.org/patch/msgid/20211029135947.3022875-1-narmstrong@baylibre.com commit c802b6d7815d7c3f556efea28d0b79ef57ebcfd4 Author: Rameshkumar Sundaram Date: Mon Oct 25 21:33:06 2021 +0530 ath11k: Clear auth flag only for actual association in security mode AUTH flag is needed when peer assoc command is sent from host in security mode for non-assoc cases. Firmware will handle AUTH flag when client is associating as AUTH flag will be set after key exchange. For internally provided peer assoc commands from host, there won't be any key exchange, so AUTH flag is expected to be set in host. Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.4.0.1-01838-QCAHKSWPL_SILICONZ-1 Co-developed-by: Lavanya Suresh Signed-off-by: Lavanya Suresh Signed-off-by: Rameshkumar Sundaram Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/1635177786-20854-1-git-send-email-quic_ramess@quicinc.com commit 16a2c3d5406f95ef6139de52669c60a39443f5f7 Author: Rameshkumar Sundaram Date: Wed Nov 10 17:10:48 2021 +0200 ath11k: Send PPDU_STATS_CFG with proper pdev mask to firmware HTT_PPDU_STATS_CFG_PDEV_ID bit mask for target FW PPDU stats request message was set as bit 8 to 15. Bit 8 is reserved for soc stats and pdev id starts from bit 9. Hence change the bitmask as bit 9 to 15 and fill the proper pdev id in the request message. In commit 701e48a43e15 ("ath11k: add packet log support for QCA6390"), both HTT_PPDU_STATS_CFG_PDEV_ID and pdev_mask were changed, but this pdev_mask calculation is not valid for platforms which has multiple pdevs with 1 rxdma per pdev, as this is writing same value(i.e. 2) for all pdevs. Hence fixed it to consider pdev_idx as well, to make it compatible for both single and multi pd cases. Tested on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-01092-QCAHKSWPL_SILICONZ-1 Tested on: IPQ6018 hw1.0 WLAN.HK.2.5.0.1-01067-QCAHKSWPL_SILICONZ-1 Fixes: 701e48a43e15 ("ath11k: add packet log support for QCA6390") Co-developed-by: Sathishkumar Muruganandam Signed-off-by: Sathishkumar Muruganandam Signed-off-by: Rameshkumar Sundaram Signed-off-by: Jouni Malinen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210721212029.142388-10-jouni@codeaurora.org commit ae80b6033834342601e99f74f6a62ff5092b1cee Author: Zekun Shen Date: Thu Oct 28 18:37:49 2021 -0400 ar5523: Fix null-ptr-deref with unexpected WDCMSG_TARGET_START reply Unexpected WDCMSG_TARGET_START replay can lead to null-ptr-deref when ar->tx_cmd->odata is NULL. The patch adds a null check to prevent such case. KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] ar5523_cmd+0x46a/0x581 [ar5523] ar5523_probe.cold+0x1b7/0x18da [ar5523] ? ar5523_cmd_rx_cb+0x7a0/0x7a0 [ar5523] ? __pm_runtime_set_status+0x54a/0x8f0 ? _raw_spin_trylock_bh+0x120/0x120 ? pm_runtime_barrier+0x220/0x220 ? __pm_runtime_resume+0xb1/0xf0 usb_probe_interface+0x25b/0x710 really_probe+0x209/0x5d0 driver_probe_device+0xc6/0x1b0 device_driver_attach+0xe2/0x120 I found the bug using a custome USBFuzz port. It's a research work to fuzz USB stack/drivers. I modified it to fuzz ath9k driver only, providing hand-crafted usb descriptors to QEMU. After fixing the code (fourth byte in usb packet) to WDCMSG_TARGET_START, I got the null-ptr-deref bug. I believe the bug is triggerable whenever cmd->odata is NULL. After patching, I tested with the same input and no longer see the KASAN report. This was NOT tested on a real device. Signed-off-by: Zekun Shen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/YXsmPQ3awHFLuAj2@10-18-43-117.dynapool.wireless.nyu.edu commit 9faaffbe85edcbdc54096f7f87baa3bc4842a7e2 Merge: 2326ff8d5c662 d52f5c639dd86 Author: Alexei Starovoitov Date: Thu Nov 11 17:41:12 2021 -0800 Merge branch 'Support BTF_KIND_TYPE_TAG for btf_type_tag attributes' Yonghong Song says: ==================== LLVM patches ([1] for clang, [2] and [3] for BPF backend) added support for btf_type_tag attributes. This patch added support for the kernel. The main motivation for btf_type_tag is to bring kernel annotations __user, __rcu etc. to btf. With such information available in btf, bpf verifier can detect mis-usages and reject the program. For example, for __user tagged pointer, developers can then use proper helper like bpf_probe_read_kernel() etc. to read the data. BTF_KIND_TYPE_TAG may also useful for other tracing facility where instead of to require user to specify kernel/user address type, the kernel can detect it by itself with btf. Patch 1 added support in kernel, Patch 2 for libbpf and Patch 3 for bpftool. Patches 4-9 are for bpf selftests and Patch 10 updated docs/bpf/btf.rst file with new btf kind. [1] https://reviews.llvm.org/D111199 [2] https://reviews.llvm.org/D113222 [3] https://reviews.llvm.org/D113496 Changelogs: v2 -> v3: - rebase to resolve merge conflicts. v1 -> v2: - add more dedup tests. - remove build requirement for LLVM=1. - remove testing macro __has_attribute in bpf programs as it is always defined in recent clang compilers. ==================== Signed-off-by: Alexei Starovoitov commit d52f5c639dd8605d2563b77b190e278f615a2b8a Author: Yonghong Song Date: Thu Nov 11 17:26:56 2021 -0800 docs/bpf: Update documentation for BTF_KIND_TYPE_TAG support Add BTF_KIND_TYPE_TAG documentation in btf.rst. Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211112012656.1509082-1-yhs@fb.com commit 3f1d0dc0ba290aab357083a0abfe267c8cffdc8d Author: Yonghong Song Date: Thu Nov 11 17:26:51 2021 -0800 selftests/bpf: Clarify llvm dependency with btf_tag selftest btf_tag selftest needs certain llvm versions (>= llvm14). Make it clear in the selftests README.rst file. Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211112012651.1508549-1-yhs@fb.com commit 5698a42a73a1d9cb7efd31ca1bf35daa87f5e1a9 Author: Yonghong Song Date: Thu Nov 11 17:26:46 2021 -0800 selftests/bpf: Add a C test for btf_type_tag The following is the main btf_type_tag usage in the C test: #define __tag1 __attribute__((btf_type_tag("tag1"))) #define __tag2 __attribute__((btf_type_tag("tag2"))) struct btf_type_tag_test { int __tag1 * __tag1 __tag2 *p; } g; The bpftool raw dump with related types: [4] INT 'int' size=4 bits_offset=0 nr_bits=32 encoding=SIGNED [11] STRUCT 'btf_type_tag_test' size=8 vlen=1 'p' type_id=14 bits_offset=0 [12] TYPE_TAG 'tag1' type_id=16 [13] TYPE_TAG 'tag2' type_id=12 [14] PTR '(anon)' type_id=13 [15] TYPE_TAG 'tag1' type_id=4 [16] PTR '(anon)' type_id=15 [17] VAR 'g' type_id=11, linkage=global With format C dump, we have struct btf_type_tag_test { int __attribute__((btf_type_tag("tag1"))) * __attribute__((btf_type_tag("tag1"))) __attribute__((btf_type_tag("tag2"))) *p; }; The result C code is identical to the original definition except macro's are gone. Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211112012646.1508231-1-yhs@fb.com commit 26c79fcbfa64b18ca1407a3be7ac3442aef51073 Author: Yonghong Song Date: Thu Nov 11 17:26:41 2021 -0800 selftests/bpf: Rename progs/tag.c to progs/btf_decl_tag.c Rename progs/tag.c to progs/btf_decl_tag.c so we can introduce progs/btf_type_tag.c in the next patch. Also create a subtest for btf_decl_tag in prog_tests/btf_tag.c so we can introduce btf_type_tag subtest in the next patch. I also took opportunity to remove the check whether __has_attribute is defined or not in progs/btf_decl_tag.c since all recent clangs should already support this macro. Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211112012641.1507144-1-yhs@fb.com commit 846f4826d18e660ab668eb26e83c6adf0ceb24d2 Author: Yonghong Song Date: Thu Nov 11 17:26:35 2021 -0800 selftests/bpf: Test BTF_KIND_DECL_TAG for deduplication Add BTF_KIND_TYPE_TAG duplication unit tests. Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211112012635.1506853-1-yhs@fb.com commit 6aa5dabc9d0ef722905e4ca4f9751d70cf3ec8a4 Author: Yonghong Song Date: Thu Nov 11 17:26:30 2021 -0800 selftests/bpf: Add BTF_KIND_TYPE_TAG unit tests Add BTF_KIND_TYPE_TAG unit tests. Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211112012630.1506095-1-yhs@fb.com commit 0dc85872203bf7b15c56c7eb228b8f3fabb17ac2 Author: Yonghong Song Date: Thu Nov 11 17:26:25 2021 -0800 selftests/bpf: Test libbpf API function btf__add_type_tag() Add unit tests for btf__add_type_tag(). Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211112012625.1505748-1-yhs@fb.com commit 3da5ba6f0509ace03cad38b554c89797129e90be Author: Yonghong Song Date: Thu Nov 11 17:26:20 2021 -0800 bpftool: Support BTF_KIND_TYPE_TAG Add bpftool support for BTF_KIND_TYPE_TAG. Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211112012620.1505506-1-yhs@fb.com commit 2dc1e488e5cdfd937554ca81fd46ad874d244b3f Author: Yonghong Song Date: Thu Nov 11 17:26:14 2021 -0800 libbpf: Support BTF_KIND_TYPE_TAG Add libbpf support for BTF_KIND_TYPE_TAG. Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211112012614.1505315-1-yhs@fb.com commit 8c42d2fa4eeab6c37a0b1b1aa7a2715248ef4f34 Author: Yonghong Song Date: Thu Nov 11 17:26:09 2021 -0800 bpf: Support BTF_KIND_TYPE_TAG for btf_type_tag attributes LLVM patches ([1] for clang, [2] and [3] for BPF backend) added support for btf_type_tag attributes. This patch added support for the kernel. The main motivation for btf_type_tag is to bring kernel annotations __user, __rcu etc. to btf. With such information available in btf, bpf verifier can detect mis-usages and reject the program. For example, for __user tagged pointer, developers can then use proper helper like bpf_probe_read_user() etc. to read the data. BTF_KIND_TYPE_TAG may also useful for other tracing facility where instead of to require user to specify kernel/user address type, the kernel can detect it by itself with btf. [1] https://reviews.llvm.org/D111199 [2] https://reviews.llvm.org/D113222 [3] https://reviews.llvm.org/D113496 Signed-off-by: Yonghong Song Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211112012609.1505032-1-yhs@fb.com commit 2326ff8d5c6628e581c87f37a8f6db1db7dc00ee Merge: 3a75111d8a430 164b04f27fbd7 Author: Alexei Starovoitov Date: Thu Nov 11 16:54:06 2021 -0800 Merge branch 'Future-proof more tricky libbpf APIs' Andrii Nakryiko says: ==================== This patch set continues the work of revamping libbpf APIs that are not extensible, as they were added before we figured out all the intricacies of building APIs that can preserve ABI compatibility (both backward and forward). What makes them tricky is that (most of) these APIs are actively used by multiple applications, so we need to be careful about refactoring them. See individual patches for details, but the general approach is similar to previous bpf_prog_load() API revamp. The biggest different and complexity is in changing btf_dump__new(), because function overloading through macro magic doesn't work based on number of arguments, as both new and old APIs have 4 arguments. Because of that, another overloading approach is taken; overload happens based on argument types. I've validated manually (by using local test_progs-shared flavor that is compiling test_progs against libbpf as a shared library) that compiling "old application" (selftests before being adapted to using new variants of revamped APIs) are compiled and successfully run against newest libbpf version as well as the older libbpf version (provided no new variants are used). All these scenarios seem to be working as expected. v1->v2: - add explicit printf_fn NULL check in btf_dump__new() (Alexei); - replaced + with || in __builtin_choose_expr() (Alexei); - dropped test_progs-shared flavor (Alexei). ==================== Signed-off-by: Alexei Starovoitov commit 164b04f27fbd769f57905dfddd2a8953974eeef4 Author: Andrii Nakryiko Date: Wed Nov 10 21:36:24 2021 -0800 bpftool: Update btf_dump__new() and perf_buffer__new_raw() calls Use v1.0-compatible variants of btf_dump and perf_buffer "constructors". This is also a demonstration of reusing struct perf_buffer_raw_opts as OPTS-style option struct for new perf_buffer__new_raw() API. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211111053624.190580-10-andrii@kernel.org commit eda8bfa5b7c76d332ece1f24a3662ca843fd880a Author: Andrii Nakryiko Date: Wed Nov 10 21:36:23 2021 -0800 tools/runqslower: Update perf_buffer__new() calls Use v1.0+ compatible variant of perf_buffer__new() call to prepare for deprecation. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211111053624.190580-9-andrii@kernel.org commit 60ba87bb6bafaaa6e8ef9a73834cf701194d1923 Author: Andrii Nakryiko Date: Wed Nov 10 21:36:22 2021 -0800 selftests/bpf: Update btf_dump__new() uses to v1.0+ variant Update to-be-deprecated forms of btf_dump__new(). Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211111053624.190580-8-andrii@kernel.org commit 0b52a5f4b994c05070237271c7fac3265b640ffb Author: Andrii Nakryiko Date: Wed Nov 10 21:36:21 2021 -0800 selftests/bpf: Migrate all deprecated perf_buffer uses Migrate all old-style perf_buffer__new() and perf_buffer__new_raw() calls to new v1.0+ variants. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211111053624.190580-7-andrii@kernel.org commit 4178893465774f91dcd49465ae6f4e3cc036b7b2 Author: Andrii Nakryiko Date: Wed Nov 10 21:36:20 2021 -0800 libbpf: Make perf_buffer__new() use OPTS-based interface Add new variants of perf_buffer__new() and perf_buffer__new_raw() that use OPTS-based options for future extensibility ([0]). Given all the currently used API names are best fits, re-use them and use ___libbpf_override() approach and symbol versioning to preserve ABI and source code compatibility. struct perf_buffer_opts and struct perf_buffer_raw_opts are kept as well, but they are restructured such that they are OPTS-based when used with new APIs. For struct perf_buffer_raw_opts we keep few fields intact, so we have to also preserve the memory location of them both when used as OPTS and for legacy API variants. This is achieved with anonymous padding for OPTS "incarnation" of the struct. These pads can be eventually used for new options. [0] Closes: https://github.com/libbpf/libbpf/issues/311 Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211111053624.190580-6-andrii@kernel.org commit 6084f5dc928f2ada4331ba9eda65542e94d86bc6 Author: Andrii Nakryiko Date: Wed Nov 10 21:36:19 2021 -0800 libbpf: Ensure btf_dump__new() and btf_dump_opts are future-proof Change btf_dump__new() and corresponding struct btf_dump_ops structure to be extensible by using OPTS "framework" ([0]). Given we don't change the names, we use a similar approach as with bpf_prog_load(), but this time we ended up with two APIs with the same name and same number of arguments, so overloading based on number of arguments with ___libbpf_override() doesn't work. Instead, use "overloading" based on types. In this particular case, print callback has to be specified, so we detect which argument is a callback. If it's 4th (last) argument, old implementation of API is used by user code. If not, it must be 2nd, and thus new implementation is selected. The rest is handled by the same symbol versioning approach. btf_ext argument is dropped as it was never used and isn't necessary either. If in the future we'll need btf_ext, that will be added into OPTS-based struct btf_dump_opts. struct btf_dump_opts is reused for both old API and new APIs. ctx field is marked deprecated in v0.7+ and it's put at the same memory location as OPTS's sz field. Any user of new-style btf_dump__new() will have to set sz field and doesn't/shouldn't use ctx, as ctx is now passed along the callback as mandatory input argument, following the other APIs in libbpf that accept callbacks consistently. Again, this is quite ugly in implementation, but is done in the name of backwards compatibility and uniform and extensible future APIs (at the same time, sigh). And it will be gone in libbpf 1.0. [0] Closes: https://github.com/libbpf/libbpf/issues/283 Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211111053624.190580-5-andrii@kernel.org commit 957d350a8b94133d114a9b1ac3e79f1f77100681 Author: Andrii Nakryiko Date: Wed Nov 10 21:36:18 2021 -0800 libbpf: Turn btf_dedup_opts into OPTS-based struct btf__dedup() and struct btf_dedup_opts were added before we figured out OPTS mechanism. As such, btf_dedup_opts is non-extensible without breaking an ABI and potentially crashing user application. Unfortunately, btf__dedup() and btf_dedup_opts are short and succinct names that would be great to preserve and use going forward. So we use ___libbpf_override() macro approach, used previously for bpf_prog_load() API, to define a new btf__dedup() variant that accepts only struct btf * and struct btf_dedup_opts * arguments, and rename the old btf__dedup() implementation into btf__dedup_deprecated(). This keeps both source and binary compatibility with old and new applications. The biggest problem was struct btf_dedup_opts, which wasn't OPTS-based, and as such doesn't have `size_t sz;` as a first field. But btf__dedup() is a pretty rarely used API and I believe that the only currently known users (besides selftests) are libbpf's own bpf_linker and pahole. Neither use case actually uses options and just passes NULL. So instead of doing extra hacks, just rewrite struct btf_dedup_opts into OPTS-based one, move btf_ext argument into those opts (only bpf_linker needs to dedup btf_ext, so it's not a typical thing to specify), and drop never used `dont_resolve_fwds` option (it was never used anywhere, AFAIK, it makes BTF dedup much less useful and efficient). Just in case, for old implementation, btf__dedup_deprecated(), detect non-NULL options and error out with helpful message, to help users migrate, if there are any user playing with btf__dedup(). The last remaining piece is dedup_table_size, which is another anachronism from very early days of BTF dedup. Since then it has been reduced to the only valid value, 1, to request forced hash collisions. This is only used during testing. So instead introduce a bool flag to force collisions explicitly. This patch also adapts selftests to new btf__dedup() and btf_dedup_opts use to avoid selftests breakage. [0] Closes: https://github.com/libbpf/libbpf/issues/281 Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211111053624.190580-4-andrii@kernel.org commit de29e6bbb9ee674d639cd42fe565f28757208614 Author: Andrii Nakryiko Date: Wed Nov 10 21:36:17 2021 -0800 selftests/bpf: Minor cleanups and normalization of Makefile Few clean ups and single-line simplifications. Also split CLEAN command into multiple $(RM) invocations as it gets dangerously close to too long argument list. Make sure that -o is used always as the last argument for saner verbose make output. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211111053624.190580-3-andrii@kernel.org commit 6501182c08f76e4118177b42614174547e1bd149 Author: Andrii Nakryiko Date: Wed Nov 10 21:36:16 2021 -0800 bpftool: Normalize compile rules to specify output file last When dealing with verbose Makefile output, it's extremely confusing when compiler invocation commands don't specify -o as the last argument. Normalize bpftool's Makefile to do just that, as most other BPF-related Makefiles are already doing that. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211111053624.190580-2-andrii@kernel.org commit 3a75111d8a430ac6684e04172c9f84e9b1b1454e Merge: 04f8cb6d6b675 50dee7078b66d Author: Alexei Starovoitov Date: Thu Nov 11 16:44:26 2021 -0800 Merge branch 'selftests/bpf: fix test_progs' log_level logic' Andrii Nakryiko says: ==================== Fix the ability to request verbose (log_level=1) or very verbose (log_level=2) logs with test_progs's -vv or -vvv parameters. This ability regressed during recent bpf_prog_load() API refactoring. Also add bpf_program__set_extra_flags() API to allow setting extra testing flags (BPF_F_TEST_RND_HI32), which was also dropped during recent changes. ==================== Signed-off-by: Alexei Starovoitov commit 50dee7078b66d881c62f6177844d625f7ead6003 Author: Andrii Nakryiko Date: Wed Nov 10 21:17:58 2021 -0800 selftests/bpf: Fix bpf_prog_test_load() logic to pass extra log level After recent refactoring bpf_prog_test_load(), used across multiple selftests, lost ability to specify extra log_level 1 or 2 (for -vv and -vvv, respectively). Fix that problem by using bpf_object__load_xattr() API that supports extra log_level flags. Also restore BPF_F_TEST_RND_HI32 prog_flags by utilizing new bpf_program__set_extra_flags() API. Fixes: f87c1930ac29 ("selftests/bpf: Merge test_stub.c into testing_helpers.c") Reported-by: Alexei Starovoitov Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211111051758.92283-3-andrii@kernel.org commit a6ca71583137300f207343d5d950cb1c365ab911 Author: Andrii Nakryiko Date: Wed Nov 10 21:17:57 2021 -0800 libbpf: Add ability to get/set per-program load flags Add bpf_program__flags() API to retrieve prog_flags that will be (or were) supplied to BPF_PROG_LOAD command. Also add bpf_program__set_extra_flags() API to allow to set *extra* flags, in addition to those determined by program's SEC() definition. Such flags are logically OR'ed with libbpf-derived flags. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211111051758.92283-2-andrii@kernel.org commit 212e6562f33becbab1996261677a0b89c5ab8b54 Author: Matt Roper Date: Tue Nov 2 15:25:11 2021 -0700 drm/i915/dg2: Program recommended HW settings The bspec's performance guide suggests programming specific values into a few registers for optimal performance. Although these aren't workarounds, it's easiest to handle them inside the GT workaround functions (which will also ensure that the values set here are properly melded with other bits in the same registers that _are_ set by workarounds). Bspec: 68331, 45395 Cc: Matt Atwood Cc: Lucas De Marchi Cc: Siddiqui Ayaz A Signed-off-by: Matt Roper Reviewed-by: Clint Taylor Link: https://patchwork.freedesktop.org/patch/msgid/20211102222511.534310-4-matthew.d.roper@intel.com commit 645cc0b9d972b8bfaa983623950c3a53ccd0c57a Author: Matt Roper Date: Tue Nov 2 15:25:10 2021 -0700 drm/i915/dg2: Add initial gt/ctx/engine workarounds Bspec: 54077,68173,54833 Cc: Anusha Srivatsa Signed-off-by: Matt Roper Reviewed-by: Anusha Srivatsa Link: https://patchwork.freedesktop.org/patch/msgid/20211102222511.534310-3-matthew.d.roper@intel.com commit d73dd1f4e40c095bf2f9824a42fc3608d7d188eb Author: Stuart Summers Date: Tue Nov 2 15:25:09 2021 -0700 drm/i915/xehpsdv: Add initial workarounds Add the initial set of workarounds for Xe_HP SDV. There are some additional workarounds specific to the compute engines that we're holding back for now. Those will be added later, after general compute engine support lands. Cc: Lucas De Marchi Signed-off-by: Stuart Summers Signed-off-by: Matt Roper Reviewed-by: Clint Taylor Link: https://patchwork.freedesktop.org/patch/msgid/20211102222511.534310-2-matthew.d.roper@intel.com commit c582ffadbe6cf64be4544d9d168bcc520bd0c984 Author: José Roberto de Souza Date: Mon Nov 8 13:38:07 2021 -0800 drm/i915/psr: Fix PSR2 handling of multiplanar format When a plane with a multiplanar format is added to the state by drm_atomic_add_affected_planes(), only the UV plane is added, so a intel_atomic_get_new_plane_state() call to get the Y plane state can return a null pointer. To fix this, intel_atomic_get_plane_state() should be called and the return needs to be checked for errors, as it could return a EAGAIN as other atomic state could be holding the lock for the Y plane. Other issue with the patch being fixed is that the Y plane is not being committed to hardware because the corresponded plane bit is not set in update_planes when UV and Y planes are added to the state by drm_atomic_add_affected_planes(). Cc: Jouni Högander Cc: Mika Kahola Fixes: 3809991ff5f4 ("drm/i915/display: Add initial selective fetch support for biplanar formats") Signed-off-by: José Roberto de Souza Reviewed-by: Jouni Högander Link: https://patchwork.freedesktop.org/patch/msgid/20211108213807.39865-1-jose.souza@intel.com commit e9d9f9582c3d90bced286a63d1f718d4aae60a03 Author: Philip Chen Date: Thu Oct 28 10:58:11 2021 -0700 drm/bridge: parade-ps8640: Populate devices on aux-bus Conventionally, panel is listed under the root of the device tree. When userland asks for display mode, ps8640 bridge is responsible for returning EDID when ps8640_bridge_get_edid() is called. Now enable a new option of listing panel under "aux-bus" of ps8640 bridge node in the device tree. In this case, panel driver can retrieve EDID by triggering AUX transactions, without ps8640_bridge_get_edid() calls at all. To prevent the "old" and "new" options from interfering with each other's logic flow, disable DRM_BRIDGE_OP_EDID when the new option is taken. Signed-off-by: Philip Chen Reviewed-by: Stephen Boyd Reviewed-by: Douglas Anderson Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20211028105754.v5.2.I09899dea340f11feab97d719cb4b62bef3179e4b@changeid commit 826cff3f7ebba460d3db61f135798ce76b0d26ed Author: Philip Chen Date: Thu Oct 28 10:58:10 2021 -0700 drm/bridge: parade-ps8640: Enable runtime power management Fit ps8640 driver into runtime power management framework: First, break _poweron() to 3 parts: (1) turn on power and wait for ps8640's internal MCU to finish init (2) check panel HPD (which is proxied by GPIO9) (3) the other configs. As runtime_resume() can be called before panel is powered, we only add (1) to _resume() and leave (2)(3) to _pre_enable(). We also add (2) to _aux_transfer() as we want to ensure panel HPD is asserted before we start AUX CH transactions. Second, the original driver has a mysterious delay of 50 ms between (2) and (3). Since Parade's support can't explain what the delay is for, and we don't see removing the delay break any boards at hand, remove the delay to fit into this driver change. In addition, rename "powered" to "pre_enabled" and don't check for it in the pm_runtime calls. The pm_runtime calls are already refcounted so there's no reason to check there. The other user of "powered", _get_edid(), only cares if pre_enable() has already been called. Lastly, change some existing DRM_...() logging to dev_...() along the way, since DRM_...() seem to be deprecated in [1]. [1] https://patchwork.freedesktop.org/patch/454760/ Signed-off-by: Philip Chen Reviewed-by: Douglas Anderson Reviewed-by: Stephen Boyd [dianders: fixed whitespace warning reported by dim tool] Signed-off-by: Douglas Anderson Link: https://patchwork.freedesktop.org/patch/msgid/20211028105754.v5.1.I828f5db745535fb7e36e8ffdd62d546f6d08b6d1@changeid commit 02689a2055d8a78b7cd0b722a591d1acff8b1e4d Author: Ville Syrjälä Date: Thu Nov 4 16:45:20 2021 +0200 drm/1915/fbc: Replace plane->has_fbc with a pointer to the fbc instance With multiple fbc instances we need to find the right one for each plane. Rather than going looking for the right instance every time let's just replace the has_fbc boolean with a pointer that gets us there straight away. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211104144520.22605-18-ville.syrjala@linux.intel.com Acked-by: Jani Nikula Reviewed-by: Mika Kahola commit e49a656b924ef125a2b00945a60df39cd09b8c86 Author: Ville Syrjälä Date: Thu Nov 4 16:45:19 2021 +0200 drm/i915/fbc: Start passing around intel_fbc In preparation for multiple FBC instances start passing around intel_fbc pointers rather than i915 pointers. And once there are multiple of these we can't rely on container_of() to get back to the i915, so we toss in a fbc->i915 pointer already. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211104144520.22605-17-ville.syrjala@linux.intel.com Acked-by: Jani Nikula Reviewed-by: Mika Kahola commit d061882344279ebedb343d463a885118d7dc8978 Author: Ville Syrjälä Date: Thu Nov 4 16:45:18 2021 +0200 drm/i915/fbc: s/dev_priv/i915/ Rename 'dev_priv' to 'i915' to match modern style. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211104144520.22605-16-ville.syrjala@linux.intel.com Acked-by: Jani Nikula Reviewed-by: Mika Kahola commit 9ddfa5a084f65115844e9248903be547a7610a53 Author: Ville Syrjälä Date: Thu Nov 4 16:45:17 2021 +0200 drm/i915: Relocate FBC_LLC_READ_CTRL In the case of FBC_LLC_READ_CTRL the "FBC" stands for frame buffer _caching_, not frame buffer compression. Move the register definition out from the middle of the frame buffer compression register definitions. Let's just stick it somewhere with similar looking register offsets. And while at it switch it over to REG_BIT(). Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211104144520.22605-15-ville.syrjala@linux.intel.com Acked-by: Jani Nikula Reviewed-by: Mika Kahola commit a4b17f757d0b6b4cd4aa2fdc88ae7458235806f6 Author: Ville Syrjälä Date: Thu Nov 4 16:45:16 2021 +0200 drm/i915/fbc: Finish polishing FBC1 registers Switch all the FBC1 registers over to REG_BTT()/etc. And while at it add a few more registers/bits that escaped the net previously. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211104144520.22605-14-ville.syrjala@linux.intel.com Acked-by: Jani Nikula Reviewed-by: Mika Kahola commit 73ab6ec90922f50b99c189088f100025a44d8ec1 Author: Ville Syrjälä Date: Thu Nov 4 16:45:15 2021 +0200 drm/i915/fbc: Clean up all register defines The FBC register defines are a mess: - namespace changes between DPFC_, FBC_, and some platform specific prefix at a whim - ilk+ reuses most g4x bits but still has some separate bit defines elsewhere - it's not clear from the defines that the bit defines are shared So let's clean it up: - both g4x and ilk register share the same defines now - only defines which conflict have a _PLATFORM suffix, everyone else just gets comments to indicate which platforms do what - namespace is consistent DPFC_ now - SNB system agent fence registers also get a consistent namespace - REG_BIT() & co. for everything Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211104144520.22605-13-ville.syrjala@linux.intel.com Acked-by: Jani Nikula Reviewed-by: Mika Kahola commit a46553837056d3a6119f4ac350afff8c2a99daf2 Author: Ville Syrjälä Date: Thu Nov 4 16:45:14 2021 +0200 drm/i915/fbc: Nuke BDW_FBC_COMP_SEG_MASK Just use a same mask for ivb/hsw as for bdw+. The extra bit in the bdw mask is mbz on ivb/hsw anyway so this is just pointless complexity. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211104144520.22605-12-ville.syrjala@linux.intel.com Acked-by: Jani Nikula Reviewed-by: Mika Kahola commit a61cf3883c83d02cc27b18c4cf8f639279587bb0 Author: Ville Syrjälä Date: Thu Nov 4 16:45:13 2021 +0200 drm/i915/fbc: Introduce intel_fbc_set_false_color() Pull the direct FBC register frobbing out from the debugfs code into the fbc code. Also add a vfunc for this so we don't need extra platforms checks. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211104144520.22605-11-ville.syrjala@linux.intel.com Acked-by: Jani Nikula Reviewed-by: Mika Kahola commit 8f8c61038768526d894e02b10ee1e4ace94e55df Author: Ville Syrjälä Date: Thu Nov 4 16:45:12 2021 +0200 drm/i915/fbc: Introduce .program_cfb() vfunc Eliminate the last if-ladder by pulling the CFB/LLB programming into a vfunc as well. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211104144520.22605-10-ville.syrjala@linux.intel.com Acked-by: Jani Nikula Reviewed-by: Mika Kahola commit 11a6b88b8cf2ff6e93a5b136ac04fd851a2d935d Author: Ville Syrjälä Date: Thu Nov 4 16:45:11 2021 +0200 drm/i915/fbc: s/gen7/ivb/ "gen7" in display code is not really sensible. We shall call these things "ivb". Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211104144520.22605-9-ville.syrjala@linux.intel.com Acked-by: Jani Nikula Reviewed-by: Mika Kahola commit 0242cd3a538f8393cb811d79806ab519228e7cbc Author: Ville Syrjälä Date: Thu Nov 4 16:45:10 2021 +0200 drm/i915/fbc: Introduce .nuke() vfunc Eliminate yet another if-ladder by adding .nuke() vfunc. We also rename all *_recompress() stuff to *_nuke() since that's the terminology the spec uses. Also "recompress" is a bit confusing by perhaps implying that this triggers an immediate recompression. Depending on the hardware that may definitely not be the case, and in general we don't specifically know when the hardware decides to compress. So all we do is "nuke" the current compressed framebuffer and leave it up to the hardware to recompress later if it so chooses. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211104144520.22605-8-ville.syrjala@linux.intel.com Acked-by: Jani Nikula Reviewed-by: Mika Kahola commit 41b85a5202b775ce7eece34648a4b592ed18f5d2 Author: Ville Syrjälä Date: Thu Nov 4 16:45:09 2021 +0200 drm/i915/fbc: Introduce intel_fbc_funcs Replace the "if-ladders everywhere" approach with vfuncs. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211104144520.22605-7-ville.syrjala@linux.intel.com Acked-by: Jani Nikula Reviewed-by: Mika Kahola commit 6874f95816da4af4eb6a395ae434b823c4d7d356 Author: Ville Syrjälä Date: Thu Nov 4 16:45:08 2021 +0200 drm/i915/fbc: Extract helpers to compute FBC control register values Declutter the *_fbc_activate() functions by pulling all the control register value computations into helpers. I left the enable bit in *_fbc_activate() in the hopes of maybe using the helpers in the *_fbc_deactivate() paths as well instead of the current rmw approach. That won't be possible at least quite yet since we clobber the fbc->params before deactivating FBC so we could end up changing some of the values live, which given FBC's lack of/poor double buffering would likely not go so well. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211104144520.22605-6-ville.syrjala@linux.intel.com Acked-by: Jani Nikula Reviewed-by: Mika Kahola commit 74e0457a62c697d388b832b0a52dd1e716204019 Author: Ville Syrjälä Date: Thu Nov 4 16:45:07 2021 +0200 drm/i915/fbc: Introduce intel_fbc_is_compressing() Move the direct FBC status register reads from the debugfs code behind an abstract api. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211104144520.22605-5-ville.syrjala@linux.intel.com Acked-by: Jani Nikula Reviewed-by: Mika Kahola commit ef9600ffd447ca3da6660b1f5932179a67292e09 Author: Ville Syrjälä Date: Thu Nov 4 16:45:06 2021 +0200 drm/i915/fbc: Just use params->fence_y_offset always No need to tiptoe around programming DPFC_FENCE_YOFF with params->fence_y_offset vs. 0. If the fence is not enabled it doesn't even matter what we program here. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211104144520.22605-4-ville.syrjala@linux.intel.com Acked-by: Jani Nikula Reviewed-by: Mika Kahola commit 2013ab184971c4a92c42f2bc401163e5b105abf3 Author: Ville Syrjälä Date: Thu Nov 4 16:45:05 2021 +0200 drm/i915/fbc: Extract {skl,glk}_fbc_program_cfb_stride() Declutter gen7_fbc_activate() by sucking the override stride programming stuff into helpers. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211104144520.22605-3-ville.syrjala@linux.intel.com Acked-by: Jani Nikula Reviewed-by: Mika Kahola commit b50364af7af47bd2107394b8faabffab59329af4 Author: Ville Syrjälä Date: Thu Nov 4 16:45:04 2021 +0200 drm/i915/fbc: Extract snb_fbc_program_fence() We have two identical copies of the snb+ system agent CPU fence programming code. Extract into a helper. Also there's no real point in insisting that we program 0 into DPFC_CPU_FENCE_OFFSET when the fence is disabled. So just always stick the computed Y offset there whether or not the fence is actually used or not. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211104144520.22605-2-ville.syrjala@linux.intel.com Acked-by: Jani Nikula Reviewed-by: Mika Kahola commit 84e9dfd5185285df55ae9068c89cde1a88baa7b7 Author: Thomas Zimmermann Date: Wed Nov 10 11:37:02 2021 +0100 drm: Clarify semantics of struct drm_mode_config.{min, max}_{width, height} Add additional information on the semantics of the size fields in struct drm_mode_config. Also add a TODO to review all driver for correct usage of these fields. Signed-off-by: Thomas Zimmermann Acked-by: Noralf Trønnes Link: https://patchwork.freedesktop.org/patch/msgid/20211110103702.374-10-tzimmermann@suse.de commit 9239f3e1807c282e3c6bced510640910e9b25c60 Author: Thomas Zimmermann Date: Wed Nov 10 11:37:01 2021 +0100 drm/simpledrm: Support virtual screen sizes Add constants for the maximum size of the shadow-plane surface size. Useful for shadow planes with virtual screen sizes. The current sizes are 4096 scanlines with 4096 pixels each. This seems reasonable for current hardware, but can be increased as necessary. In simpledrm, set the maximum framebuffer size from the constants for shadow planes. Implements support for virtual screen sizes and page flipping on the fbdev console. v3: * use decimal numbers for shadow-plane constants (Noralf) Signed-off-by: Thomas Zimmermann Acked-by: Noralf Trønnes Link: https://patchwork.freedesktop.org/patch/msgid/20211110103702.374-9-tzimmermann@suse.de commit 0dd80b483b95abdbc3919cb360d17179a5f85d2c Author: Thomas Zimmermann Date: Wed Nov 10 11:37:00 2021 +0100 drm/simpledrm: Enable FB_DAMAGE_CLIPS property Enable the FB_DAMAGE_CLIPS property to reduce display-update overhead. Also fixes a warning in the kernel log. simple-framebuffer simple-framebuffer.0: [drm] drm_plane_enable_fb_damage_clips() not called Fix the computation of the blit rectangle. This wasn't an issue so far, as simpledrm always blitted the full framebuffer. The code now supports damage clipping and virtual screen sizes. v3: * fix drm_dev_enter() error path (Noralf) * remove unnecessary clipping from update function (Noralf) Signed-off-by: Thomas Zimmermann Reviewed-by: Noralf Trønnes Link: https://patchwork.freedesktop.org/patch/msgid/20211110103702.374-8-tzimmermann@suse.de commit 18ac700d75e81b7892c6377f6d8b917453ac69fd Author: Thomas Zimmermann Date: Wed Nov 10 11:36:59 2021 +0100 drm/fb-helper: Allocate shadow buffer of surface height Allocating a shadow buffer of the height of the buffer object does not support fbdev overallocation. Use surface height instead. Signed-off-by: Thomas Zimmermann Reviewed-by: Noralf Trønnes Link: https://patchwork.freedesktop.org/patch/msgid/20211110103702.374-7-tzimmermann@suse.de commit 19b20a8021315fce38ae95607e5de389913471a7 Author: Thomas Zimmermann Date: Wed Nov 10 11:36:58 2021 +0100 drm/format-helper: Streamline blit-helper interface Move destination-buffer clipping from format-helper blit function into caller. Rename drm_fb_blit_rect_dstclip() to drm_fb_blit_toio(). Done for consistency with the rest of the interface. Remove drm_fb_blit_dstclip(), which isn't required. Signed-off-by: Thomas Zimmermann Reviewed-by: Noralf Trønnes Link: https://patchwork.freedesktop.org/patch/msgid/20211110103702.374-6-tzimmermann@suse.de commit 53bc2098d2b6ccff25fe13f9345cbb5c0ef34a99 Author: Thomas Zimmermann Date: Wed Nov 10 11:36:57 2021 +0100 drm/format-helper: Rework format-helper conversion functions Move destination-buffer clipping from all format-helper conversion functions into callers. Support destination-buffer pitch. Only distinguish between system and I/O memory, but use same logic everywhere. Simply harmonize the interface and semantics of the existing code. Not all conversion helpers support all combinations of parameters. We have to add additional features when we need them. v2: * fix default destination pitch in drm_fb_xrgb8888_to_gray8() (Noralf) Signed-off-by: Thomas Zimmermann Tested-by: Noralf Trønnes Reviewed-by: Noralf Trønnes Link: https://patchwork.freedesktop.org/patch/msgid/20211110103702.374-5-tzimmermann@suse.de commit 3e3543c8a19cade02cefde83ee97233d5d90e7e5 Author: Thomas Zimmermann Date: Wed Nov 10 11:36:56 2021 +0100 drm/format-helper: Add destination-buffer pitch to drm_fb_swab() Add destination-buffer pitch as argument to drm_fb_swab(). Done for consistency with the rest of the interface. v2: * update documentation (Noralf) Signed-off-by: Thomas Zimmermann Tested-by: Noralf Trønnes Reviewed-by: Noralf Trønnes Link: https://patchwork.freedesktop.org/patch/msgid/20211110103702.374-4-tzimmermann@suse.de commit 27bd66dd6419c45e320f34ed419cd80833de1161 Author: Thomas Zimmermann Date: Wed Nov 10 11:36:55 2021 +0100 drm/format-helper: Rework format-helper memcpy functions Move destination-buffer clipping from all format-helper memcpy function into callers. Support destination-buffer pitch. Only distinguish between system and I/O memory, but use same logic everywhere. Signed-off-by: Thomas Zimmermann Tested-by: Noralf Trønnes Reviewed-by: Noralf Trønnes Link: https://patchwork.freedesktop.org/patch/msgid/20211110103702.374-3-tzimmermann@suse.de commit 452290f354f04fca53cba810bd241f4307502f1e Author: Thomas Zimmermann Date: Wed Nov 10 11:36:54 2021 +0100 drm/format-helper: Export drm_fb_clip_offset() Provide a function that computes the offset into a blit destination buffer. This will allow to move destination-buffer clipping into the format-helper callers. v4: * add missing '@' for parameter documentation * fix typo 'frambuffer' v2: * provide documentation (Sam) * return 'unsigned int' (Sam, Noralf) Signed-off-by: Thomas Zimmermann Reviewed-by: Noralf Trønnes Link: https://patchwork.freedesktop.org/patch/msgid/20211110103702.374-2-tzimmermann@suse.de commit 396d9b9a48723995416a05f0dab80c1dd6c21e80 Author: Thomas Zimmermann Date: Mon Nov 8 11:28:46 2021 +0100 drm: Update documentation and TODO of gem_prime_mmap hook The hook gem_prime_mmap in struct drm_driver is deprecated. Document the new requirements. Signed-off-by: Thomas Zimmermann Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20211108102846.309-4-tzimmermann@suse.de commit 3153c6486008061297bfb0ec5cfd3aa4f8df66d9 Author: Thomas Zimmermann Date: Mon Nov 8 11:28:45 2021 +0100 drm/xen: 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 xen 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 Reviewed-by: Oleksandr Andrushchenko Link: https://patchwork.freedesktop.org/patch/msgid/20211108102846.309-3-tzimmermann@suse.de commit d1260be706752dc01699b72222bbba48f42adabf Author: William Tseng Date: Wed Nov 10 09:02:17 2021 +0800 drm/i915/dsi: transmit brightness command in HS state In Video Mode, if DSI transcoder is set to transmit packets in LP Escape mode, screen flickering would be obseved when brightness commands are continuously and quickly transmitted to a panel. The problem may be resolved by changing the mode to transmit packets from Low Power to HS. Cc: Ville Syrjala Cc: Jani Nikula Cc: Vandita Kulkarni Cc: Lee Shawn C Cc: Cooper Chiou Signed-off-by: William Tseng Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20211110010217.26759-1-william.tseng@intel.com commit f35294e13c19bf890f26bc1ec964b2d29c82f0ec Author: Ankit Nautiyal Date: Wed Nov 10 12:59:47 2021 +0530 drm/i915/dp: For PCON TMDS mode set only the relavant bits in config DPCD Currently we reset the whole PCON linkConfig DPCD to set the TMDS mode. This also resets the Source control bit and HDMI link enable bit and goes to autonomous mode of operation, which is seen to spoil the PCONs internal state. This patch avoids resetting the PCON link config register and sets only the source control bit, with FRL Enable bit set to 0 (TMDS mode) in the configuration DPCD. It then enables the HDMI Link Enable bit. v2: Removed the redundant resetting of the bits as the buffer is already initialized to 0. (Uma) Updated comments and commit message. v3: Rebase Signed-off-by: Ankit Nautiyal Reviewed-by: Uma Shankar Signed-off-by: Uma Shankar Link: https://patchwork.freedesktop.org/patch/msgid/20211110072947.171659-3-ankit.k.nautiyal@intel.com commit 078e2bb2585a05df787be74642f12354a66a0534 Author: Ankit Nautiyal Date: Wed Nov 10 12:59:46 2021 +0530 drm/i915/dp: Optimize the FRL configuration for HDMI2.1 PCON Currently the HDMI2.1 PCON's frl link config DPCD registers are reset and configured even if they are already configured. Also the HDMI Link Mode does not settle to FRL MODE immediately after HDMI Link Status is active. This patch: -Checks if the PCON is already configured for FRL. -Include HDMI Link Mode in wait for loop along with HDMI Link status DPCD. v2: Rebase Signed-off-by: Ankit Nautiyal Reviewed-by: Uma Shankar Signed-off-by: Uma Shankar Link: https://patchwork.freedesktop.org/patch/msgid/20211110072947.171659-2-ankit.k.nautiyal@intel.com commit 790f27e0f7c16b162fef29f584d8a85bf9323da5 Author: Christian König Date: Fri Sep 24 08:54:57 2021 +0200 drm/etnaviv: use dma_resv_describe Instead of dumping the fence info manually. Signed-off-by: Christian König Reviewed-by: Rob Clark Link: https://patchwork.freedesktop.org/patch/msgid/20211103081231.18578-4-christian.koenig@amd.com commit f19ee2f35d100cbd7354c1254790c067554b7880 Author: Christian König Date: Thu Sep 23 15:02:37 2021 +0200 drm/msm: use the new dma_resv_describe Instead of hand rolling pretty much the same code. Signed-off-by: Christian König Reviewed-by: Rob Clark Link: https://patchwork.freedesktop.org/patch/msgid/20211103081231.18578-3-christian.koenig@amd.com commit a25efb3863d068929f0bbeb87a995df11507e691 Author: Christian König Date: Thu Sep 23 13:57:42 2021 +0200 dma-buf: add dma_fence_describe and dma_resv_describe v2 Add functions to dump dma_fence and dma_resv objects into a seq_file and use them for printing the debugfs information. v2: fix missing include reported by test robot. Signed-off-by: Christian König Reviewed-by: Rob Clark Link: https://patchwork.freedesktop.org/patch/msgid/20211103081231.18578-2-christian.koenig@amd.com commit 781050b0a3164934857c300bb0bc291e38c26b6f Author: xinhui pan Date: Wed Nov 10 12:31:48 2021 +0800 drm/ttm: Put BO in its memory manager's lru list After we move BO to a new memory region, we should put it to the new memory manager's lru list regardless we unlock the resv or not. Cc: stable@vger.kernel.org Reviewed-by: Christian König Signed-off-by: xinhui pan Link: https://patchwork.freedesktop.org/patch/msgid/20211110043149.57554-1-xinhui.pan@amd.com Signed-off-by: Christian König commit d3cb30f8dcbcb797bb4dd62dc8e85dd2334c3475 Author: Thomas Hellström Date: Wed Nov 10 09:55:27 2021 +0100 drm/i915/ttm: Fix illegal addition to shrinker list There's a small window of opportunity during which the adjust_lru() function can be called with a GEM refcount of zero from the TTM eviction code. This results in a kernel BUG(). Ensure that we don't attempt to modify the GEM shrinker lists unless we have a GEM refcount. Fixes: ebd4a8ec7799 ("drm/i915/ttm: move shrinker management into adjust_lru") Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20211110085527.1033475-1-thomas.hellstrom@linux.intel.com commit 498f02b657b7a591c61cf269f7b02dc136231ea1 Author: Daniele Ceraolo Spurio Date: Thu Oct 28 20:28:09 2021 -0700 drm/i915: split general MMIO setup from per-GT uncore init In coming patches we'll be doing the actual tile initialization between these two uncore init phases. Signed-off-by: Daniele Ceraolo Spurio Signed-off-by: Matt Roper Reviewed-by: Lucas De Marchi Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20211029032817.3747750-3-matthew.d.roper@intel.com commit fd4d7904f5e38e4ff8e1267a53476cfa4a225708 Author: Paulo Zanoni Date: Thu Oct 28 20:28:08 2021 -0700 drm/i915: rework some irq functions to take intel_gt as argument We'll be adding multi-tile support soon; on multi-tile platforms interrupts are per-tile and every tile has the full set of interrupt registers. In this commit we start passing intel_gt instead of dev_priv for the functions that are related to Xe_HP irq handling. Right now we're still passing tile 0 everywhere, but in later patches we'll start actually passing the correct tile. Signed-off-by: Paulo Zanoni Co-authored-by: Tvrtko Ursulin Signed-off-by: Tvrtko Ursulin Signed-off-by: Radhakrishna Sripada Signed-off-by: Matt Roper Reviewed-by: Lucas De Marchi Reviewed-by: Andi Shyti Link: https://patchwork.freedesktop.org/patch/msgid/20211029032817.3747750-2-matthew.d.roper@intel.com commit 04f8cb6d6b6752ed14dbf91c616717fa30655ef6 Merge: 1a8b597ddabe7 8b4fd2bf1f47c Author: Alexei Starovoitov Date: Wed Nov 10 16:29:59 2021 -0800 Merge branch 'Get ingress_ifindex in BPF_SK_LOOKUP prog type' Mark Pashmfouroush says: ==================== BPF_SK_LOOKUP users may want to have access to the ifindex of the skb which triggered the socket lookup. This may be useful for selectively applying programmable socket lookup logic to packets that arrive on a specific interface, or excluding packets from an interface. v3: - Rename ifindex field to ingress_ifindex for consistency. (Yonghong) v2: - Fix inaccurate comment (Alexei) - Add more details to commit messages (John) ==================== Revieview-by: Lorenz Bauer Signed-off-by: Alexei Starovoitov commit 8b4fd2bf1f47c3e3a63c327fca2ad5c4e2691ef8 Author: Mark Pashmfouroush Date: Wed Nov 10 11:10:16 2021 +0000 selftests/bpf: Add tests for accessing ingress_ifindex in bpf_sk_lookup A new field was added to the bpf_sk_lookup data that users can access. Add tests that validate that the new ingress_ifindex field contains the right data. Signed-off-by: Mark Pashmfouroush Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211110111016.5670-3-markpash@cloudflare.com commit f89315650ba34ec6c91a8bded72796980bee2a4d Author: Mark Pashmfouroush Date: Wed Nov 10 11:10:15 2021 +0000 bpf: Add ingress_ifindex to bpf_sk_lookup It may be helpful to have access to the ifindex during bpf socket lookup. An example may be to scope certain socket lookup logic to specific interfaces, i.e. an interface may be made exempt from custom lookup code. Add the ifindex of the arriving connection to the bpf_sk_lookup API. Signed-off-by: Mark Pashmfouroush Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211110111016.5670-2-markpash@cloudflare.com commit 1a8b597ddabe7dc25aa9defd33949d455ee9cde8 Author: Quentin Monnet Date: Fri Nov 5 22:19:04 2021 +0000 bpftool: Fix SPDX tag for Makefiles and .gitignore Bpftool is dual-licensed under GPLv2 and BSD-2-Clause. In commit 907b22365115 ("tools: bpftool: dual license all files") we made sure that all its source files were indeed covered by the two licenses, and that they had the correct SPDX tags. However, bpftool's Makefile, the Makefile for its documentation, and the .gitignore file were skipped at the time (their GPL-2.0-only tag was added later). Let's update the tags. Signed-off-by: Quentin Monnet Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Acked-by: Tobias Klauser Acked-by: Joe Stringer Acked-by: Song Liu Acked-by: Jean-Philippe Brucker Acked-by: Jesper Dangaard Brouer Acked-by: Jakub Kicinski Link: https://lore.kernel.org/bpf/20211105221904.3536-1-quentin@isovalent.com commit b2beffa7d9a67b59b085616a27f1d10b1e80784f Author: Carl Huang Date: Mon Nov 8 14:38:26 2021 +0200 ath11k: enable 802.11 power save mode in station mode To reduce power consumption enable 802.11 power save mode in station mode. This allows both radio and CPU to sleep more. Only enable the mode on QCA6390 and WCN6855, it's unknown how other hardware families support this feature. To test that power save mode is running run "iw dev wls1 set power_save off", check there is no NULL Data frame seen by a sniffer. And run "iw dev wls1 set power_save on" and check there is a NULL Data frame in sniffer. Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Signed-off-by: Carl Huang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211108123826.8463-2-kvalo@codeaurora.org commit af3d89649bb69bd5be273cf6c001cd19c2604ca2 Author: Kalle Valo Date: Mon Nov 8 14:38:25 2021 +0200 ath11k: convert ath11k_wmi_pdev_set_ps_mode() to use enum wmi_sta_ps_mode It's more descriptive to use the actual enum used by the firmware instead of a boolean so change ath11k_wmi_pdev_set_ps_mode() to use a boolean. Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211108123826.8463-1-kvalo@codeaurora.org commit 6e120594631fdcfd83e5e0a1351730dae46d9d24 Author: Cai Huoqing Date: Tue Sep 7 11:35:26 2021 +0800 drm/tidss: Make use of the helper macro SET_RUNTIME_PM_OPS() Use the helper macro SET_RUNTIME_PM_OPS() instead of the verbose operators ".runtime_suspend/.runtime_resume", because the SET_RUNTIME_PM_OPS() is a nice helper macro that could be brought in to make code a little more concise. Signed-off-by: Cai Huoqing Reviewed-by: Tomi Valkeinen Signed-off-by: Tomi Valkeinen Link: https://patchwork.freedesktop.org/patch/msgid/20210907033526.1612-1-caihuoqing@baidu.com commit 1f366c6856e942f61d4ecef709ac952c8dc58d23 Author: Tomi Valkeinen Date: Tue Oct 12 15:39:39 2021 +0200 drm/omap: increase DSS5 max tv pclk to 192MHz DSS5's maximum tv pclk rate (i.e. HDMI) is set to 186MHz, which comes from the TRM (DPLL_HDMI_CLK1 frequency must be lower than 186 MHz). To support DRA76's wide screen HDMI feature, we need to increase this maximum rate. Testing shows that the PLL seems to work fine even with ~240MHz clocks, and even the HDMI output at that clock is stable enough for monitors to show a picture. This holds true for all DRA7 and AM5 SoCs (and probably also for OMAP5). However, the highest we can go without big refactoring to the clocking code is 192MHz, as that is the DSS func clock we get from the PRCM. So, increase the max HDMI pixel clock to 192MHz for now, to allow some more 2k+ modes to work. This patch never had a clear confirmation from HW people, but this change stayed on production trees for multiple years without any report on an eventual breakage. Signed-off-by: Tomi Valkeinen Signed-off-by: Neil Armstrong Reviewed-by: Tomi Valkeinen Signed-off-by: Tomi Valkeinen Link: https://patchwork.freedesktop.org/patch/msgid/20211012133939.2145462-1-narmstrong@baylibre.com commit ed8414ab041fc7c517532e90d00ce09ed528dadc Author: Cai Huoqing Date: Tue Aug 31 21:57:06 2021 +0800 drm/omap: Make use of the helper function 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 Reviewed-by: Tomi Valkeinen Signed-off-by: Tomi Valkeinen Link: https://patchwork.freedesktop.org/patch/msgid/20210831135707.4676-1-caihuoqing@baidu.com commit b92f7ea556f8b74ba08cdc27258941e293400050 Author: Cai Huoqing Date: Sat Aug 28 16:48:11 2021 +0800 drm/omap: dss: Make use of the helper macro SET_RUNTIME_PM_OPS() Use the helper macro SET_RUNTIME_PM_OPS() instead of the verbose operators ".runtime_suspend/.runtime_resume", because the SET_RUNTIME_PM_OPS() is a nice helper macro that could be brought in to make code a little clearer, a little more concise. Signed-off-by: Cai Huoqing Reviewed-by: Tomi Valkeinen Signed-off-by: Tomi Valkeinen Link: https://patchwork.freedesktop.org/patch/msgid/20210828084811.104-1-caihuoqing@baidu.com commit b94b7353d7fe819cee61bff805e677f3d30f8e7c Author: Cai Huoqing Date: Sun Aug 22 15:23:23 2021 +0800 drm/omapdrm: Convert to SPDX identifier use SPDX-License-Identifier instead of a verbose license text Signed-off-by: Cai Huoqing Reviewed-by: Tomi Valkeinen Signed-off-by: Tomi Valkeinen Link: https://patchwork.freedesktop.org/patch/msgid/20210822072323.408-1-caihuoqing@baidu.com commit 4579509ef181480f4e4510d436c691519167c5c2 Author: Vandita Kulkarni Date: Tue Nov 9 17:34:28 2021 +0530 Revert "drm/i915/tgl/dsi: Gate the ddi clocks after pll mapping" This reverts commit 991d9557b0c4 ("drm/i915/tgl/dsi: Gate the ddi clocks after pll mapping"). The Bspec was updated recently with the pll ungate sequence similar to that of icl dsi enable sequence. Hence reverting. Bspec: 49187 Fixes: 991d9557b0c4 ("drm/i915/tgl/dsi: Gate the ddi clocks after pll mapping") Cc: # v5.4+ Signed-off-by: Vandita Kulkarni Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20211109120428.15211-1-vandita.kulkarni@intel.com commit 9030e39cd115db3a93a6a5eebd70f5f9c462e4eb Author: Thomas Hellström Date: Fri Nov 5 16:01:45 2021 +0100 drm/i915/selftests: Use clear_and_wake_up_bit() for the per-engine reset bitlocks Some selftests assume that nothing will attempt to grab these bitlocks while they are held by the selftests. With GuC, for example, that is not true because the hanging workloads may cause the GuC code to attempt to grab them for a global reset, and that may cause it to end up sleeping on the bit never waking up. Regardless whether that will be the final solution for GuC, use clear_and_wake_up_bit() pending a more thorough investigation on how this should be handled moving forward. To be clear this needs to be a temporary solution. If we can't find an in-kernel locking primitive to use here, we should at the very least add lockdep annotation to these bitlocks with a thorough explanation as to why we need to use bits. v3: - Use GEM_BUG_ON(test_and_set_bit()) rather than set_bit() to verify the assumption that nothing is holding the reset locks when we attempt to grab them. (Chris Wilson) Signed-off-by: Thomas Hellström Reviewed-by: Matthew Brost Link: https://patchwork.freedesktop.org/patch/msgid/20211105150146.834052-1-thomas.hellstrom@linux.intel.com commit 775affb06a5bc6051f48c935c86c99f849e2da09 Author: Thomas Hellström Date: Mon Nov 8 13:36:37 2021 +0100 drm/i915/gem: Fix gem_madvise for ttm+shmem objects Gem-TTM objects that are backed by shmem might have populated page-vectors without having the GEM pages set. Those objects aren't moved to the correct shrinker / purge list by gem_madvise. For such objects, identified by having the _SELF_MANAGED_SHRINK_LIST set, make sure they end up on the correct list. v2: - Revert a change that made swapped-out objects inaccessible for truncating. (Matthew Auld) Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20211108123637.929617-1-thomas.hellstrom@linux.intel.com commit 08d1ecd98a8fe653d24644f072a87549e8503447 Author: John Harrison Date: Mon Nov 8 08:40:54 2021 -0800 drm/i915/guc: Refcount context during error capture When i915 receives a context reset notification from GuC, it triggers an error capture before resetting any outstanding requsts of that context. Unfortunately, the error capture is not a time bound operation. In certain situations it can take a long time, particularly when multiple large LMEM buffers must be read back and eoncoded. If this delay is longer than other timeouts (heartbeat, test recovery, etc.) then a full GT reset can be triggered in the middle. That can result in the context being reset by GuC actually being destroyed before the error capture completes and the GuC submission code resumes. Thus, the GuC side can start dereferencing stale pointers and Bad Things ensue. So add a refcount get of the context during the entire reset operation. That way, the context can't be destroyed part way through no matter what other resets or user interactions occur. v2: (Matthew Brost) - Update patch to work with async error capture v3: (Matthew Brost) - Drop async capture support as that hasn't landed yet Signed-off-by: John Harrison Signed-off-by: Matthew Brost Reviewed-by: Matthew Brost Link: https://patchwork.freedesktop.org/patch/msgid/20211108164054.23588-1-matthew.brost@intel.com commit 6cff894e4991a5e80324ba39369288fad1e3ed1a Author: Dan Carpenter Date: Tue Nov 9 14:48:50 2021 +0300 drm/i915: pin: delete duplicate check in intel_pin_and_fence_fb_obj() The "ret" variable is checked on the previous line so we know it's zero. No need to check again. Signed-off-by: Dan Carpenter Reviewed-by: Rodrigo Vivi Signed-off-by: Rodrigo Vivi Link: https://patchwork.freedesktop.org/patch/msgid/20211109114850.GB16587@kili commit c68dac968c460b89a4f6e3617ee5defbcd96eead Author: Ville Syrjälä Date: Fri Nov 5 23:21:56 2021 +0200 drm/i915: Call intel_update_active_dpll() for both bigjoiner pipes Currently we're only calling intel_update_active_dpll() for the bigjoiner master pipe but not for the slave. With TC ports this leads to the two pipes end up trying to use different PLLs (TC vs. TBT). What's worse we're enabling the PLL that didn't get intel_update_active_dpll() called on it at the spot where we need the clocks turned on. So we turn on the wrong PLL and the DDI is now trying to source its clock from the other PLL which is still disabled. Naturally that doesn't end so well and the DDI fails to start up. The state checker also gets a bit unhappy (which is a good thing) when it notices that one of the pipes was using the wrong PLL. Let's fix this by remembering to call intel_update_active_dpll() for both pipes. That should get the correct PLL turned on when we need it, and the state checker should also be happy. Cc: Imre Deak Cc: Manasi Navare Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/4434 Fixes: e12d6218fda2 ("drm/i915: Reduce bigjoiner special casing") Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211105212156.5697-1-ville.syrjala@linux.intel.com Reviewed-by: Imre Deak commit 115e0f687d29649b8805e3417e089e785b0ea61d Author: Ville Syrjälä Date: Thu Oct 21 01:33:39 2021 +0300 drm/i915: Use unlocked register accesses for LUT loads We have to bash in a lot of registers to load the higher precision LUT modes. The locking overhead is significant, especially as we have to get this done as quickly as possible during vblank. So let's switch to unlocked accesses for these. Fortunately the LUT registers are mostly spread around such that two pipes do not have any registers on the same cacheline. So as long as commits on the same pipe are serialized (which they are) we should get away with this without angering the hardware. The only exceptions are the PREC_PIPEGCMAX registers on ilk/snb which we don't use atm as they are only used in the 12bit gamma mode. If/when we add support for that we may need to remember to still serialize those registers, though I'm not sure ilk/snb are actually affected by the same cacheline issue. I think ivb/hsw at least were, but they use a different set of registers for the precision LUT. I have a test case which is updating the LUTs on two pipes from a single atomic commit. Running that in a loop for a minute I get the following worst case with the locks in place: intel_crtc_vblank_work_start: pipe B, frame=10037, scanline=1081 intel_crtc_vblank_work_start: pipe A, frame=12274, scanline=769 intel_crtc_vblank_work_end: pipe A, frame=12274, scanline=58 intel_crtc_vblank_work_end: pipe B, frame=10037, scanline=74 And here's the worst case with the locks removed: intel_crtc_vblank_work_start: pipe B, frame=5869, scanline=1081 intel_crtc_vblank_work_start: pipe A, frame=7616, scanline=769 intel_crtc_vblank_work_end: pipe B, frame=5869, scanline=1096 intel_crtc_vblank_work_end: pipe A, frame=7616, scanline=777 The test was done on a snb using the 10bit 1024 entry LUT mode. The vtotals for the two displays are 793 and 1125. So we can see that with the locks ripped out the LUT updates are pretty nicely confined within the vblank, whereas with the locks in place we're routinely blasting past the vblank end which causes visual artifacts near the top of the screen. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211020223339.669-5-ville.syrjala@linux.intel.com Reviewed-by: Uma Shankar commit 2bbc6fcaf8c58a7a59900512be11b1775a611381 Author: Ville Syrjälä Date: Thu Oct 21 01:33:38 2021 +0300 drm/i915: Use vblank workers for gamma updates The pipe gamma registers are single buffered so they should only be updated during the vblank to avoid screen tearing. In fact they really should only be updated between start of vblank and frame start because that is the only time the pipe is guaranteed to be empty. Already at frame start the pipe begins to fill up with data for the next frame. Unfortunately frame start happens ~1 scanline after the start of vblank which in practice doesn't always leave us enough time to finish the gamma update in time (gamma LUTs can be several KiB of data we have to bash into the registers). However we must try our best and so we'll add a vblank work for each pipe from where we can do the gamma update. Additionally we could consider pushing frame start forward to the max of ~4 scanlines after start of vblank. But not sure that's exactly a validated configuration. As it stands the ~100 first pixels tend to make it through with the old gamma values. Even though the vblank worker is running on a high prority thread we still have to contend with C-states. If the CPU happens be in a deep C-state when the vblank interrupt arrives even the irq handler gets delayed massively (I've observed dozens of scanlines worth of latency). To avoid that problem we'll use the qos mechanism to keep the CPU awake while the vblank work is scheduled. With all this hooked up we can finally enjoy near atomic gamma updates. It even works across several pipes from the same atomic commit which previously was a total fail because we did the gamma updates for each pipe serially after waiting for all pipes to have latched the double buffered registers. In the future the DSB should take over this responsibility which will hopefully avoid some of these issues. Kudos to Lyude for finishing the actual vblank workers. Works like the proverbial train toilet. v2: Add missing intel_atomic_state fwd declaration v3: Clean up properly when not scheduling the worker v4: Clean up the rest and add tracepoints v5: s/intel_wait_for_vblank_works/intel_wait_for_vblank_workers/ (Jani,Uma) CC: Lyude Paul Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211020223339.669-4-ville.syrjala@linux.intel.com Reviewed-by: Uma Shankar commit 6f9976bd1310d123921ba2c20e8c101057087285 Author: Ville Syrjälä Date: Thu Oct 21 01:33:37 2021 +0300 drm/i915: Do vrr push before sampling the frame counter Do the vrr push before we sample the frame counter to know when the commit has been latched. Doing these in the wrong order could lead us to complete the flip before it has actually happened. Cc: Manasi Navare Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211020223339.669-3-ville.syrjala@linux.intel.com Reviewed-by: Uma Shankar commit 03f060b73f9ad9555f6251cac21c692df8112a68 Author: Matthew Brost Date: Thu Oct 28 15:42:24 2021 -0700 drm/i915/resets: Don't set / test for per-engine reset bits with GuC submission Don't set, test for, or clear per-engine reset bits with GuC submission as the GuC owns the per engine resets not the i915. Setting, testing for, and clearing these bits is causing issues with the hangcheck selftest. Rather than change to test to not use these bits, rip the use of these bits out from the reset code. Signed-off-by: Matthew Brost Reviewed-by: John Harrison Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20211028224224.32693-1-matthew.brost@intel.com commit 3a74ac2d1159716f35c944639f71b33fa16084c8 Author: Kumar Kartikeya Dwivedi Date: Sat Nov 6 05:12:40 2021 +0530 libbpf: Compile using -std=gnu89 The minimum supported C standard version is C89, with use of GNU extensions, hence make sure to catch any instances that would break the build for this mode by passing -std=gnu89. Signed-off-by: Kumar Kartikeya Dwivedi Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211105234243.390179-4-memxor@gmail.com commit 38a1b50c0389f1ae385d007b02dec5f812b3e5ef Author: William Tseng Date: Tue Nov 9 11:41:25 2021 +0800 drm/i915/dsi: disable lpdt if it is not enabled Avoid setting LP_DATA_TRANSFER when enable_lpdt is false Cc: Ville Syrjala Cc: Jani Nikula Cc: Vandita Kulkarni Cc: Lee Shawn C Cc: Cooper Chiou Signed-off-by: William Tseng Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20211109034125.11291-1-william.tseng@intel.com commit cf9420cb122d055840848b039cbbc303882bc445 Author: Radhakrishna Sripada Date: Fri Nov 5 17:37:14 2021 -0700 drm/i915: Fix Memory BW formulae for ADL-P The earlier update to BW formulae broke ADL-P. Include display 13 to use TGL path for BW parameters. Fixes: c64a9a7c05be ("drm/i915: Update memory bandwidth formulae") Cc: Matt Roper Reported-by: José Roberto de Souza Signed-off-by: Radhakrishna Sripada Reviewed-by: Caz Yokoyama Reviewed-by: José Roberto de Souza Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20211106003714.17894-1-radhakrishna.sripada@intel.com commit c23551c9c36ae394f9c53a5adf1944a943c65e0b Author: Alan Maguire Date: Fri Nov 5 16:50:46 2021 +0000 selftests/bpf: Add exception handling selftests for tp_bpf program Exception handling is triggered in BPF tracing programs when a NULL pointer is dereferenced; the exception handler zeroes the target register and execution of the BPF program progresses. To test exception handling then, we need to trigger a NULL pointer dereference for a field which should never be zero; if it is, the only explanation is the exception handler ran. task->task_works is the NULL pointer chosen (for a new task from fork() no work is associated), and the task_works->func field should not be zero if task_works is non-NULL. The test verifies that task_works and task_works->func are 0. Signed-off-by: Alan Maguire Signed-off-by: Daniel Borkmann Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/1636131046-5982-3-git-send-email-alan.maguire@oracle.com commit b89ddf4cca43f1269093942cf5c4e457fd45c335 Author: Russell King Date: Fri Nov 5 16:50:45 2021 +0000 arm64/bpf: Remove 128MB limit for BPF JIT programs Commit 91fc957c9b1d ("arm64/bpf: don't allocate BPF JIT programs in module memory") restricts BPF JIT program allocation to a 128MB region to ensure BPF programs are still in branching range of each other. However this restriction should not apply to the aarch64 JIT, since BPF_JMP | BPF_CALL are implemented as a 64-bit move into a register and then a BLR instruction - which has the effect of being able to call anything without proximity limitation. The practical reason to relax this restriction on JIT memory is that 128MB of JIT memory can be quickly exhausted, especially where PAGE_SIZE is 64KB - one page is needed per program. In cases where seccomp filters are applied to multiple VMs on VM launch - such filters are classic BPF but converted to BPF - this can severely limit the number of VMs that can be launched. In a world where we support BPF JIT always on, turning off the JIT isn't always an option either. Fixes: 91fc957c9b1d ("arm64/bpf: don't allocate BPF JIT programs in module memory") Suggested-by: Ard Biesheuvel Signed-off-by: Russell King Signed-off-by: Daniel Borkmann Tested-by: Alan Maguire Link: https://lore.kernel.org/bpf/1636131046-5982-2-git-send-email-alan.maguire@oracle.com commit cfdf6b19e750f7de8ae71a26932f63b52e3bf74c Author: Benjamin Li Date: Wed Nov 3 18:05:48 2021 -0700 wcn36xx: fix RX BD rate mapping for 5GHz legacy rates The linear mapping between the BD rate field and the driver's 5GHz legacy rates table (wcn_5ghz_rates) does not only apply for the latter four rates -- it applies to all eight rates. Fixes: 6ea131acea98 ("wcn36xx: Fix warning due to bad rate_idx") Signed-off-by: Benjamin Li Tested-by: Loic Poulain Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211104010548.1107405-3-benl@squareup.com commit c9c5608fafe4dae975c9644c7d14c51ad3b0ed73 Author: Benjamin Li Date: Wed Nov 3 18:05:47 2021 -0700 wcn36xx: populate band before determining rate on RX status.band is used in determination of status.rate -- for 5GHz on legacy rates there is a linear shift between the BD descriptor's rate field and the wcn36xx driver's rate table (wcn_5ghz_rates). We have a special clause to populate status.band for hardware scan offload frames. However, this block occurs after status.rate is already populated. Correctly handle this dependency by moving the band block before the rate block. This patch addresses kernel warnings & missing scan results for 5GHz APs that send their beacons/probe responses at the higher four legacy rates (24-54 Mbps), when using hardware scan offload: ------------[ cut here ]------------ WARNING: CPU: 0 PID: 0 at net/mac80211/rx.c:4532 ieee80211_rx_napi+0x744/0x8d8 Modules linked in: wcn36xx [...] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G W 4.19.107-g73909fa #1 Hardware name: Square, Inc. T2 (all variants) (DT) Call trace: dump_backtrace+0x0/0x148 show_stack+0x14/0x1c dump_stack+0xb8/0xf0 __warn+0x2ac/0x2d8 warn_slowpath_null+0x44/0x54 ieee80211_rx_napi+0x744/0x8d8 ieee80211_tasklet_handler+0xa4/0xe0 tasklet_action_common+0xe0/0x118 tasklet_action+0x20/0x28 __do_softirq+0x108/0x1ec irq_exit+0xd4/0xd8 __handle_domain_irq+0x84/0xbc gic_handle_irq+0x4c/0xb8 el1_irq+0xe8/0x190 lpm_cpuidle_enter+0x220/0x260 cpuidle_enter_state+0x114/0x1c0 cpuidle_enter+0x34/0x48 do_idle+0x150/0x268 cpu_startup_entry+0x20/0x24 rest_init+0xd4/0xe0 start_kernel+0x398/0x430 ---[ end trace ae28cb759352b403 ]--- Fixes: 8a27ca394782 ("wcn36xx: Correct band/freq reporting on RX") Signed-off-by: Benjamin Li Tested-by: Loic Poulain Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211104010548.1107405-2-benl@squareup.com commit ed04ea76e69e7194f7489cebe23a32a68f39218d Author: Bryan O'Donoghue Date: Fri Nov 5 12:21:52 2021 +0000 wcn36xx: Put DXE block into reset before freeing memory When deiniting the DXE hardware we should reset the block to ensure there is no spurious DMA write transaction from the downstream WCNSS to upstream MSM at a skbuff address we will have released. Fixes: 8e84c2582169 ("wcn36xx: mac80211 driver for Qualcomm WCN3660/WCN3680 hardware") Signed-off-by: Bryan O'Donoghue Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211105122152.1580542-4-bryan.odonoghue@linaro.org commit 3652096e5263ad67604b0323f71d133485f410e5 Author: Bryan O'Donoghue Date: Fri Nov 5 12:21:51 2021 +0000 wcn36xx: Release DMA channel descriptor allocations When unloading the driver we are not releasing the DMA descriptors which we previously allocated. Fixes: 8e84c2582169 ("wcn36xx: mac80211 driver for Qualcomm WCN3660/WCN3680 hardware") Signed-off-by: Bryan O'Donoghue Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211105122152.1580542-3-bryan.odonoghue@linaro.org commit 89dcb1da611d9b3ff0728502d58372fdaae9ebff Author: Bryan O'Donoghue Date: Fri Nov 5 12:21:50 2021 +0000 wcn36xx: Fix DMA channel enable/disable cycle Right now we have a broken sequence where we enable DMA channel interrupts which can be left enabled and never disabled if we hit an error path. Worse still when we unload the driver, the DMA channel interrupt bits are left intact. About the only saving grace here is that we do remember to disable the wcnss interrupt when unload the driver. Fixes: 8e84c2582169 ("wcn36xx: mac80211 driver for Qualcomm WCN3660/WCN3680 hardware") Signed-off-by: Bryan O'Donoghue Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211105122152.1580542-2-bryan.odonoghue@linaro.org commit 0cc78dcca36de43f6ec4a94ddf64ddfa9bb36024 Merge: 5fd79ed9bed19 f108662b27c96 Author: Alexei Starovoitov Date: Sun Nov 7 11:54:51 2021 -0800 Merge branch 'introduce bpf_find_vma' Song Liu says: ==================== Changes v4 => v5: 1. Clean up and style change in 2/2. (Andrii) Changes v3 => v4: 1. Move mmap_unlock_work to task_iter.c to fix build for .config without !CONFIG_PERF_EVENTS. (kernel test robot ) Changes v2 => v3: 1. Avoid using x86 only function in selftests. (Yonghong) 2. Add struct file and struct vm_area_struct to btf_task_struct_ids, and use it in bpf_find_vma and stackmap.c. (Yonghong) 3. Fix inaccurate comments. (Yonghong) Changes v1 => v2: 1. Share irq_work with stackmap.c. (Daniel) 2. Add tests for illegal writes to task/vma from the callback function. (Daniel) 3. Other small fixes. Add helper bpf_find_vma. This can be used in some profiling use cases. It might also be useful for LSM. ==================== Signed-off-by: Alexei Starovoitov commit f108662b27c96cdadfadd39f0c0d650704cd593d Author: Song Liu Date: Fri Nov 5 16:23:30 2021 -0700 selftests/bpf: Add tests for bpf_find_vma Add tests for bpf_find_vma in perf_event program and kprobe program. The perf_event program is triggered from NMI context, so the second call of bpf_find_vma() will return -EBUSY (irq_work busy). The kprobe program, on the other hand, does not have this constraint. Also add tests for illegal writes to task or vma from the callback function. The verifier should reject both cases. Signed-off-by: Song Liu Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20211105232330.1936330-3-songliubraving@fb.com commit 7c7e3d31e7856a8260a254f8c71db416f7f9f5a1 Author: Song Liu Date: Fri Nov 5 16:23:29 2021 -0700 bpf: Introduce helper bpf_find_vma In some profiler use cases, it is necessary to map an address to the backing file, e.g., a shared library. bpf_find_vma helper provides a flexible way to achieve this. bpf_find_vma maps an address of a task to the vma (vm_area_struct) for this address, and feed the vma to an callback BPF function. The callback function is necessary here, as we need to ensure mmap_sem is unlocked. It is necessary to lock mmap_sem for find_vma. To lock and unlock mmap_sem safely when irqs are disable, we use the same mechanism as stackmap with build_id. Specifically, when irqs are disabled, the unlocked is postponed in an irq_work. Refactor stackmap.c so that the irq_work is shared among bpf_find_vma and stackmap helpers. Signed-off-by: Song Liu Signed-off-by: Alexei Starovoitov Tested-by: Hengqi Chen Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20211105232330.1936330-2-songliubraving@fb.com commit 5fd79ed9bed1934de0ba0024e62eacaedb3c4c8a Merge: 5577f24cb04a3 8c7a95520184b Author: Alexei Starovoitov Date: Sun Nov 7 09:14:15 2021 -0800 Merge branch 'Fix leaks in libbpf and selftests' Andrii Nakryiko says: ==================== Fix all the memory leaks reported by ASAN. All but one are just improper resource clean up in selftests. But one memory leak was discovered in libbpf, leaving inner map's name leaked. First patch fixes selftests' Makefile by passing through SAN_CFLAGS to linker. Without that compiling with SAN_CFLAGS=-fsanitize=address kept failing. Running selftests under ASAN in BPF CI is the next step, we just need to make sure all the necessary libraries (libasan and liblsan) are installed on the host and inside the VM. Would be great to get some help with that, but for now make sure that test_progs run is clean from leak sanitizer errors. v3->v4: - rebase on latest bpf-next; v2->v3: - fix per-cpu array memory leaks in btf_iter.c selftests (Hengqi); v1->v2: - call bpf_map__destroy() conditionally if map->inner_map is present. ==================== Signed-off-by: Alexei Starovoitov commit 8c7a95520184b6677ca6075e12df9c208d57d088 Author: Andrii Nakryiko Date: Sun Nov 7 08:55:21 2021 -0800 selftests/bpf: Fix bpf_object leak in skb_ctx selftest skb_ctx selftest didn't close bpf_object implicitly allocated by bpf_prog_test_load() helper. Fix the problem by explicitly calling bpf_object__close() at the end of the test. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Reviewed-by: Hengqi Chen Link: https://lore.kernel.org/bpf/20211107165521.9240-10-andrii@kernel.org commit f91231eeeed752119f49eb6620cae44ec745a007 Author: Andrii Nakryiko Date: Sun Nov 7 08:55:20 2021 -0800 selftests/bpf: Destroy XDP link correctly bpf_link__detach() was confused with bpf_link__destroy() and leaves leaked FD in the process. Fix the problem. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Reviewed-by: Hengqi Chen Link: https://lore.kernel.org/bpf/20211107165521.9240-9-andrii@kernel.org commit f92321d706a810b89a905e04658e38931c4bb0e0 Author: Andrii Nakryiko Date: Sun Nov 7 08:55:19 2021 -0800 selftests/bpf: Avoid duplicate btf__parse() call btf__parse() is repeated after successful setup, leaving the first instance leaked. Remove redundant and premature call. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Reviewed-by: Hengqi Chen Link: https://lore.kernel.org/bpf/20211107165521.9240-8-andrii@kernel.org commit f79587520a6007a3734b23a3c2eb4c62aa457533 Author: Andrii Nakryiko Date: Sun Nov 7 08:55:18 2021 -0800 selftests/bpf: Clean up btf and btf_dump in dump_datasec test Free up used resources at the end and on error. Also make it more obvious that there is btf__parse() call that creates struct btf instance. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Reviewed-by: Hengqi Chen Link: https://lore.kernel.org/bpf/20211107165521.9240-7-andrii@kernel.org commit 5309b516bcc6f76dda0e44a7a1824324277093d6 Author: Andrii Nakryiko Date: Sun Nov 7 08:55:17 2021 -0800 selftests/bpf: Free inner strings index in btf selftest Inner array of allocated strings wasn't freed on success. Now it's always freed. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Reviewed-by: Hengqi Chen Link: https://lore.kernel.org/bpf/20211107165521.9240-6-andrii@kernel.org commit b8b26e585f3a0fbcee1032c622f046787da57390 Author: Andrii Nakryiko Date: Sun Nov 7 08:55:16 2021 -0800 selftests/bpf: Free per-cpu values array in bpf_iter selftest Array holding per-cpu values wasn't freed. Fix that. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211107165521.9240-5-andrii@kernel.org commit 8ba285874913da21ca39a46376e9cc5ce0f45f94 Author: Andrii Nakryiko Date: Sun Nov 7 08:55:15 2021 -0800 selftests/bpf: Fix memory leaks in btf_type_c_dump() helper Free up memory and resources used by temporary allocated memstream and btf_dump instance. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Reviewed-by: Hengqi Chen Link: https://lore.kernel.org/bpf/20211107165521.9240-4-andrii@kernel.org commit 8f7b239ea8cfdc8e64c875ee417fed41431a1f37 Author: Andrii Nakryiko Date: Sun Nov 7 08:55:14 2021 -0800 libbpf: Free up resources used by inner map definition It's not enough to just free(map->inner_map), as inner_map itself can have extra memory allocated, like map name. Fixes: 646f02ffdd49 ("libbpf: Add BTF-defined map-in-map support") Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Reviewed-by: Hengqi Chen Link: https://lore.kernel.org/bpf/20211107165521.9240-3-andrii@kernel.org commit 2a2cb45b727b7a1041f3d3d93414b774e66454bb Author: Andrii Nakryiko Date: Sun Nov 7 08:55:13 2021 -0800 selftests/bpf: Pass sanitizer flags to linker through LDFLAGS When adding -fsanitize=address to SAN_CFLAGS, it has to be passed both to compiler through CFLAGS as well as linker through LDFLAGS. Add SAN_CFLAGS into LDFLAGS to allow building selftests with ASAN. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Reviewed-by: Hengqi Chen Link: https://lore.kernel.org/bpf/20211107165521.9240-2-andrii@kernel.org commit 5577f24cb04a38a227d536e0e8fdaaa6401dba01 Merge: b8b5cb55f5d3f f19ddfe0360a1 Author: Alexei Starovoitov Date: Sun Nov 7 08:34:24 2021 -0800 Merge branch 'libbpf: add unified bpf_prog_load() low-level API' Andrii Nakryiko says: ==================== This patch set adds unified OPTS-based low-level bpf_prog_load() API for loading BPF programs directly into kernel without utilizing libbpf's bpf_object abstractions. This OPTS-based interface allows for future extensions without breaking backwards or forward API and ABI compatibility. Similar approach will be used for other low-level APIs that require extensive sets of parameters, like BPF_MAP_CREATE command. First half of the patch set adds libbpf API, cleans up internal usage of to-be-deprecated APIs, etc. Second half cleans up and converts selftests away from using deprecated APIs. See individual patches for more details. v1->v2: - dropped exposing sys_bpf() into public API (Alexei, Daniel); - also dropped bpftool/cgroup.c fix for unistd.h include because it's not necessary due to sys_bpf() staying as is. Cc: Hengqi Chen ==================== Signed-off-by: Alexei Starovoitov commit f19ddfe0360a1aa64db0b4a41f59e1ade3f6d288 Author: Andrii Nakryiko Date: Wed Nov 3 15:08:45 2021 -0700 selftests/bpf: Use explicit bpf_test_load_program() helper calls Remove the second part of prog loading testing helper re-definition: -Dbpf_load_program=bpf_test_load_program This completes the clean up of deprecated libbpf program loading APIs. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Acked-by: Dave Marchevsky Link: https://lore.kernel.org/bpf/20211103220845.2676888-13-andrii@kernel.org commit cbdb1461dcf45765a036e9f6975ffe19e69bdc33 Author: Andrii Nakryiko Date: Wed Nov 3 15:08:44 2021 -0700 selftests/bpf: Use explicit bpf_prog_test_load() calls everywhere -Dbpf_prog_load_deprecated=bpf_prog_test_load trick is both ugly and breaks when deprecation goes into effect due to macro magic. Convert all the uses to explicit bpf_prog_test_load() calls which avoid deprecation errors and makes everything less magical. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Acked-by: Dave Marchevsky Link: https://lore.kernel.org/bpf/20211103220845.2676888-12-andrii@kernel.org commit f87c1930ac2951d7fb3bacb523c24046c81015ed Author: Andrii Nakryiko Date: Wed Nov 3 15:08:43 2021 -0700 selftests/bpf: Merge test_stub.c into testing_helpers.c Move testing prog and object load wrappers (bpf_prog_test_load and bpf_test_load_program) into testing_helpers.{c,h} and get rid of otherwise useless test_stub.c. Make testing_helpers.c available to non-test_progs binaries as well. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Acked-by: Dave Marchevsky Link: https://lore.kernel.org/bpf/20211103220845.2676888-11-andrii@kernel.org commit d8e86407e5fc6c3da1e336f89bd3e9bbc1c0cf60 Author: Andrii Nakryiko Date: Wed Nov 3 15:08:42 2021 -0700 selftests/bpf: Convert legacy prog load APIs to bpf_prog_load() Convert all the uses of legacy low-level BPF program loading APIs (mostly bpf_load_program_xattr(), but also some bpf_verify_program()) to bpf_prog_load() uses. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211103220845.2676888-10-andrii@kernel.org commit 3d1d62397f4a12dedee09727b26cd5a4b254ebb7 Author: Andrii Nakryiko Date: Wed Nov 3 15:08:41 2021 -0700 selftests/bpf: Fix non-strict SEC() program sections Fix few more SEC() definitions that were previously missed. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Acked-by: Dave Marchevsky Link: https://lore.kernel.org/bpf/20211103220845.2676888-9-andrii@kernel.org commit 5c5edcdebfcf3a95257b0d8ef27a60af0e0ea03a Author: Andrii Nakryiko Date: Wed Nov 3 15:08:40 2021 -0700 libbpf: Remove deprecation attribute from struct bpf_prog_prep_result This deprecation annotation has no effect because for struct deprecation attribute has to be declared after struct definition. But instead of moving it to the end of struct definition, remove it. When deprecation will go in effect at libbpf v0.7, this deprecation attribute will cause libbpf's own source code compilation to trigger deprecation warnings, which is unavoidable because libbpf still has to support that API. So keep deprecation of APIs, but don't mark structs used in API as deprecated. Fixes: e21d585cb3db ("libbpf: Deprecate multi-instance bpf_program APIs") Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Acked-by: Dave Marchevsky Link: https://lore.kernel.org/bpf/20211103220845.2676888-8-andrii@kernel.org commit a3c7c7e8050fc299b42fa3d89bac253a8dfa5c0c Author: Andrii Nakryiko Date: Wed Nov 3 15:08:39 2021 -0700 bpftool: Stop using deprecated bpf_load_program() Switch to bpf_prog_load() instead. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211103220845.2676888-7-andrii@kernel.org commit bcc40fc0021d4b7c016f8bcf62bd4e21251fdee8 Author: Andrii Nakryiko Date: Wed Nov 3 15:08:38 2021 -0700 libbpf: Stop using to-be-deprecated APIs Remove all the internal uses of libbpf APIs that are slated to be deprecated in v0.7. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211103220845.2676888-6-andrii@kernel.org commit e32660ac6fd6bd3c9d249644330d968c6ef61b07 Author: Andrii Nakryiko Date: Wed Nov 3 15:08:37 2021 -0700 libbpf: Remove internal use of deprecated bpf_prog_load() variants Remove all the internal uses of bpf_load_program_xattr(), which is slated for deprecation in v0.7. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211103220845.2676888-5-andrii@kernel.org commit d10ef2b825cffd0807dd733fdfd6a5bea32270d7 Author: Andrii Nakryiko Date: Wed Nov 3 15:08:36 2021 -0700 libbpf: Unify low-level BPF_PROG_LOAD APIs into bpf_prog_load() Add a new unified OPTS-based low-level API for program loading, bpf_prog_load() ([0]). bpf_prog_load() accepts few "mandatory" parameters as input arguments (program type, name, license, instructions) and all the other optional (as in not required to specify for all types of BPF programs) fields into struct bpf_prog_load_opts. This makes all the other non-extensible APIs variant for BPF_PROG_LOAD obsolete and they are slated for deprecation in libbpf v0.7: - bpf_load_program(); - bpf_load_program_xattr(); - bpf_verify_program(). Implementation-wise, internal helper libbpf__bpf_prog_load is refactored to become a public bpf_prog_load() API. struct bpf_prog_load_params used internally is replaced by public struct bpf_prog_load_opts. Unfortunately, while conceptually all this is pretty straightforward, the biggest complication comes from the already existing bpf_prog_load() *high-level* API, which has nothing to do with BPF_PROG_LOAD command. We try really hard to have a new API named bpf_prog_load(), though, because it maps naturally to BPF_PROG_LOAD command. For that, we rename old bpf_prog_load() into bpf_prog_load_deprecated() and mark it as COMPAT_VERSION() for shared library users compiled against old version of libbpf. Statically linked users and shared lib users compiled against new version of libbpf headers will get "rerouted" to bpf_prog_deprecated() through a macro helper that decides whether to use new or old bpf_prog_load() based on number of input arguments (see ___libbpf_overload in libbpf_common.h). To test that existing bpf_prog_load()-using code compiles and works as expected, I've compiled and ran selftests as is. I had to remove (locally) selftest/bpf/Makefile -Dbpf_prog_load=bpf_prog_test_load hack because it was conflicting with the macro-based overload approach. I don't expect anyone else to do something like this in practice, though. This is testing-specific way to replace bpf_prog_load() calls with special testing variant of it, which adds extra prog_flags value. After testing I kept this selftests hack, but ensured that we use a new bpf_prog_load_deprecated name for this. This patch also marks bpf_prog_load() and bpf_prog_load_xattr() as deprecated. bpf_object interface has to be used for working with struct bpf_program. Libbpf doesn't support loading just a bpf_program. The silver lining is that when we get to libbpf 1.0 all these complication will be gone and we'll have one clean bpf_prog_load() low-level API with no backwards compatibility hackery surrounding it. [0] Closes: https://github.com/libbpf/libbpf/issues/284 Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211103220845.2676888-4-andrii@kernel.org commit 45493cbaf59e3c9482e0e6a2646b362fff45db8b Author: Andrii Nakryiko Date: Wed Nov 3 15:08:35 2021 -0700 libbpf: Pass number of prog load attempts explicitly Allow to control number of BPF_PROG_LOAD attempts from outside the sys_bpf_prog_load() helper. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Acked-by: Dave Marchevsky Link: https://lore.kernel.org/bpf/20211103220845.2676888-3-andrii@kernel.org commit be80e9cdbca8ac66d09e0e24e0bd41d992362a0b Author: Andrii Nakryiko Date: Wed Nov 3 15:08:34 2021 -0700 libbpf: Rename DECLARE_LIBBPF_OPTS into LIBBPF_OPTS It's confusing that libbpf-provided helper macro doesn't start with LIBBPF. Also "declare" vs "define" is confusing terminology, I can never remember and always have to look up previous examples. Bypass both issues by renaming DECLARE_LIBBPF_OPTS into a short and clean LIBBPF_OPTS. To avoid breaking existing code, provide: #define DECLARE_LIBBPF_OPTS LIBBPF_OPTS in libbpf_legacy.h. We can decide later if we ever want to remove it or we'll keep it forever because it doesn't add any maintainability burden. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Acked-by: Dave Marchevsky Link: https://lore.kernel.org/bpf/20211103220845.2676888-2-andrii@kernel.org commit b8b5cb55f5d3f03cc1479a3768d68173a10359ad Author: Andrii Nakryiko Date: Fri Nov 5 12:10:55 2021 -0700 libbpf: Fix non-C89 loop variable declaration in gen_loader.c Fix the `int i` declaration inside the for statement. This is non-C89 compliant. See [0] for user report breaking BCC build. [0] https://github.com/libbpf/libbpf/issues/403 Fixes: 18f4fccbf314 ("libbpf: Update gen_loader to emit BTF_KIND_FUNC relocations") Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Acked-by: Kumar Kartikeya Dwivedi Link: https://lore.kernel.org/bpf/20211105191055.3324874-1-andrii@kernel.org commit 89636a06fa2ee7826a19c39c19a9bc99ab9340a9 Author: Qiang Yu Date: Sun Oct 31 12:16:04 2021 +0800 drm/lima: fix warning when CONFIG_DEBUG_SG=y & CONFIG_DMA_API_DEBUG=y Otherwise get following warning: DMA-API: lima 1c40000.gpu: mapping sg segment longer than device claims to support [len=4149248] [max=65536] See: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5496 Reviewed-by: Vasily Khoruzhick Reported-by: Roman Stratiienko Signed-off-by: Qiang Yu Link: https://patchwork.freedesktop.org/patch/msgid/20211031041604.187216-1-yuq825@gmail.com commit 4fe7907f3775034140a518d1582580926da98ee2 Author: José Roberto de Souza Date: Wed Nov 3 18:08:58 2021 -0700 drm/i915/display/adlp: Disable underrun recovery It was also defeatured for ADL-P and other platforms. BSpec: 55424 Signed-off-by: José Roberto de Souza Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211104010858.43559-1-jose.souza@intel.com commit c8b9f34e223fcad1e9980f343587f38624331bbc Author: Zhang Mingyu Date: Fri Nov 5 01:43:20 2021 +0000 fs: dlm:Remove unneeded semicolon Eliminate the following coccinelle check warning: fs/dlm/midcomms.c:972:2-3 Reported-by: Zeal Robot Signed-off-by: Zhang Mingyu Signed-off-by: David Teigland commit 1998646129fae2909f588079f09f8e54c5c5decc Author: Maxime Ripard Date: Mon Oct 25 16:11:13 2021 +0200 drm/vc4: hdmi: Introduce a scdc_enabled flag We currently rely on two functions, vc4_hdmi_supports_scrambling() and vc4_hdmi_mode_needs_scrambling() to determine if we should enable and disable the scrambler for any given mode. Since we might need to disable the controller at boot, we also always run vc4_hdmi_disable_scrambling() and thus call those functions without a mode yet, which in turns need to make some special casing in order for it to work. Instead of duplicating the check for whether or not we need to take care of the scrambler in both vc4_hdmi_enable_scrambling() and vc4_hdmi_disable_scrambling(), we can do that check only when we enable it and store whether or not it's been enabled in our private structure. We also need to initialize that flag at true to make sure we disable the scrambler at boot since we can't really know its state yet. This allows to simplify a bit that part of the driver, and removes one user of our copy of the CRTC adjusted mode outside of KMS (since vc4_hdmi_disable_scrambling() might be called from the hotplug interrupt handler). It also removes our last user of the legacy encoder->crtc pointer. Link: https://lore.kernel.org/r/20211025141113.702757-10-maxime@cerno.tech Acked-by: Daniel Vetter Signed-off-by: Maxime Ripard commit ebae26d61809af09bdf81b55abb63335f2b2724b Author: Maxime Ripard Date: Mon Oct 25 16:11:12 2021 +0200 drm/vc4: hdmi: Introduce an output_enabled flag We currently poke at encoder->crtc in the ALSA code path to determine whether the HDMI output is enabled or not, and thus whether we should allow the audio output. However, that pointer is deprecated and shouldn't really be used by atomic drivers anymore. Since we have the infrastructure in place now, let's just create a flag that we toggle to report whether the controller is currently enabled and use that instead of encoder->crtc in ALSA. Link: https://lore.kernel.org/r/20211025141113.702757-9-maxime@cerno.tech Acked-by: Daniel Vetter Signed-off-by: Maxime Ripard commit a64ff88cb5eb0b9a6855a24ff326e948931e3a8e Author: Maxime Ripard Date: Mon Oct 25 16:11:11 2021 +0200 drm/vc4: hdmi: Check the device state in prepare() Even though we already check that the encoder->crtc pointer is there during in startup(), which is part of the open() path in ASoC, nothing guarantees that our encoder state won't change between the time when we open the device and the time we prepare it. Move the sanity checks we do in startup() to a helper and call it from prepare(). Link: https://lore.kernel.org/r/20211025141113.702757-8-maxime@cerno.tech Fixes: 91e99e113929 ("drm/vc4: hdmi: Register HDMI codec") Acked-by: Daniel Vetter Signed-off-by: Maxime Ripard commit 633be8c3c0c5e0cf176ce904083a4728ae8e4025 Author: Maxime Ripard Date: Mon Oct 25 16:11:10 2021 +0200 drm/vc4: hdmi: Prevent access to crtc->state outside of KMS Accessing the crtc->state pointer from outside the modesetting context is not allowed. We thus need to copy whatever we need from the KMS state to our structure in order to access it. However, in the vc4 HDMI driver we do use that pointer in the ALSA code path, and potentially in the hotplug interrupt handler path. These paths both need access to the CRTC adjusted mode in order for the proper dividers to be set for ALSA, and the scrambler state to be reinstated properly for hotplug. Let's copy this mode into our private encoder structure and reference it from there when needed. Since that part is shared between KMS and other paths, we need to protect it using our mutex. Link: https://lore.kernel.org/all/YWgteNaNeaS9uWDe@phenom.ffwll.local/ Link: https://lore.kernel.org/r/20211025141113.702757-7-maxime@cerno.tech Fixes: bb7d78568814 ("drm/vc4: Add HDMI audio support") Acked-by: Daniel Vetter Signed-off-by: Maxime Ripard commit 82cb88af12d29eaa5350d9ba83f9c376f65b7fec Author: Maxime Ripard Date: Mon Oct 25 16:11:09 2021 +0200 drm/vc4: hdmi: Use a mutex to prevent concurrent framework access The vc4 HDMI controller registers into the KMS, CEC and ALSA frameworks. However, no particular care is done to prevent the concurrent execution of different framework hooks from happening at the same time. In order to protect against that scenario, let's introduce a mutex that relevant ALSA and KMS hooks will need to take to prevent concurrent execution. CEC is left out at the moment though, since the .get_modes and .detect KMS hooks, when running cec_s_phys_addr_from_edid, can end up calling CEC's .adap_enable hook. This introduces some reentrancy that isn't easy to deal with properly. The CEC hooks also don't share much state with the rest of the driver: the registers are entirely separate, we don't share any variable, the only thing that can conflict is the CEC clock divider setup that can be affected by a mode set. However, after discussing it, it looks like CEC should be able to recover from this if it was to happen. Link: https://lore.kernel.org/r/20211025141113.702757-6-maxime@cerno.tech Fixes: bb7d78568814 ("drm/vc4: Add HDMI audio support") Acked-by: Daniel Vetter Signed-off-by: Maxime Ripard commit 81fb55e500a82a070da20f02b2e252d6a09a34c3 Author: Maxime Ripard Date: Mon Oct 25 16:11:08 2021 +0200 drm/vc4: hdmi: Add a spinlock to protect register access The vc4 HDMI driver has multiple path shared between the CEC, ALSA and KMS frameworks, plus two interrupt handlers (CEC and hotplug) that will read and modify a number of registers. Even though not bug has been reported so far, it's definitely unsafe, so let's just add a spinlock to protect the register access of the HDMI controller. Link: https://lore.kernel.org/r/20211025141113.702757-5-maxime@cerno.tech Fixes: c8b75bca92cb ("drm/vc4: Add KMS support for Raspberry Pi.") Acked-by: Daniel Vetter Signed-off-by: Maxime Ripard commit eeb6ab4639590130d25670204ab7b6011333d685 Author: Maxime Ripard Date: Mon Oct 25 16:11:07 2021 +0200 drm/vc4: crtc: Copy assigned channel to the CRTC Accessing the crtc->state pointer from outside the modesetting context is not allowed. We thus need to copy whatever we need from the KMS state to our structure in order to access it. In VC4, a number of users of that pointers have crept in over the years, and the previous commits removed them all but the HVS channel a CRTC has been assigned. Let's move this channel in struct vc4_crtc at atomic_begin() time, drop it from our private state structure, and remove our use of crtc->state from our vblank handler entirely. Link: https://lore.kernel.org/all/YWgteNaNeaS9uWDe@phenom.ffwll.local/ Link: https://lore.kernel.org/r/20211025141113.702757-4-maxime@cerno.tech Fixes: 87ebcd42fb7b ("drm/vc4: crtc: Assign output to channel automatically") Acked-by: Daniel Vetter Signed-off-by: Maxime Ripard commit 0c250c150c74a90db298bf2a8bcd0a1dabed2e2f Author: Maxime Ripard Date: Mon Oct 25 16:11:06 2021 +0200 drm/vc4: Fix non-blocking commit getting stuck forever In some situation, we can end up being stuck on a non-blocking that went through properly. The situation that seems to trigger it reliably is to first start a non-blocking commit, and then right after, and before we had any vblank interrupt), start a blocking commit. This will lead to the first commit workqueue to be scheduled, setup the display, while the second commit is waiting for the first one to be completed. The vblank interrupt will then be raised, vc4_crtc_handle_vblank() will run and will compare the active dlist in the HVS channel to the one associated with the crtc->state. However, at that point, the second commit is waiting using drm_atomic_helper_wait_for_dependencies that occurs after drm_atomic_helper_swap_state has been called, so crtc->state points to the second commit state. vc4_crtc_handle_vblank() will compare the two dlist addresses and since they don't match will ignore the interrupt. The vblank event will never be reported, and the first and second commit will wait for the first commit completion until they timeout. The underlying reason is that it was never safe to do so. Indeed, accessing the ->state pointer access synchronization is based on ownership guarantees that can only occur within the functions and hooks defined as part of the KMS framework, and obviously the irq handler isn't one of them. The rework to move to generic helpers only uncovered the underlying issue. However, since the code path between drm_atomic_helper_wait_for_dependencies() and drm_atomic_helper_wait_for_vblanks() is serialised and we can't get two commits in that path at the same time, we can work around this issue by setting a variable associated to struct drm_crtc to the dlist we expect, and then using it from the vc4_crtc_handle_vblank() function. Since that state is shared with the modesetting path, we also need to introduce a spinlock to protect the code shared between the interrupt handler and the modesetting path, protecting only our new variable for now. Link: https://lore.kernel.org/all/YWgteNaNeaS9uWDe@phenom.ffwll.local/ Link: https://lore.kernel.org/r/20211025141113.702757-3-maxime@cerno.tech Fixes: 56d1fe0979dc ("drm/vc4: Make pageflip completion handling more robust.") Acked-by: Daniel Vetter Signed-off-by: Maxime Ripard commit a16c66401fd831f70a02d33e9bcaac585637c29f Author: Maxime Ripard Date: Mon Oct 25 16:11:05 2021 +0200 drm/vc4: crtc: Drop feed_txp from state Accessing the crtc->state pointer from outside the modesetting context is not allowed. We thus need to copy whatever we need from the KMS state to our structure in order to access it. In VC4, a number of users of that pointers have crept in over the years, the first one being whether or not the downstream controller of the pixelvalve is our writeback controller. Fortunately for us, Since commit 39fcb2808376 ("drm/vc4: txp: Turn the TXP into a CRTC of its own") this is no longer something that can change from one commit to the other and is hardcoded. Let's set this flag in struct vc4_crtc if we happen to be the TXP, and drop the flag from our private state structure. Link: https://lore.kernel.org/all/YWgteNaNeaS9uWDe@phenom.ffwll.local/ Link: https://lore.kernel.org/r/20211025141113.702757-2-maxime@cerno.tech Fixes: 008095e065a8 ("drm/vc4: Add support for the transposer block") Acked-by: Daniel Vetter Signed-off-by: Maxime Ripard commit f47a0e35846740ca72b8ba6be84b5b518abcebce Author: Jani Nikula Date: Thu Nov 4 18:18:58 2021 +0200 drm/i915/audio: rename intel_init_audio_hooks to intel_audio_hooks_init Follow the filename based prefix naming. Reviewed-by: Ville Syrjälä Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20211104161858.21786-6-jani.nikula@intel.com commit 5d4537463fc2eb1245093e0b62e200ed9229d00b Author: Jani Nikula Date: Thu Nov 4 18:18:56 2021 +0200 drm/i915/audio: move intel_audio_funcs internal to intel_audio.c It's all internal to intel_audio.c. Cc: Dave Airlie Reviewed-by: Ville Syrjälä Reviewed-by: Lucas De Marchi Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20211104161858.21786-4-jani.nikula@intel.com commit 37388c0192bf1474ffaaaf38024dab49d0150f12 Author: Jani Nikula Date: Thu Nov 4 18:18:55 2021 +0200 drm/i915/audio: define the audio struct separately from drm_i915_private Add a standalone definition of struct intel_audio_private, and note that all of it is private to intel_audio.c. v2: Rebase Cc: Dave Airlie Reviewed-by: Ville Syrjälä Reviewed-by: Lucas De Marchi Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20211104161858.21786-3-jani.nikula@intel.com commit ca3cfb9d9b5edffbea1464079abaa89714e7abd6 Author: Jani Nikula Date: Thu Nov 4 18:18:54 2021 +0200 drm/i915/audio: name the audio sub-struct in drm_i915_private Add name to the audio sub-struct in drm_i915_private, and remove the tautologies and other inconsistencies in the member names. v2: Call the mutex member mutex, not lock. (Ville) Cc: Dave Airlie Reviewed-by: Ville Syrjälä Reviewed-by: Lucas De Marchi Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20211104161858.21786-2-jani.nikula@intel.com commit fe9b286bd063791c7842c4caf6efb2825b537031 Author: Jani Nikula Date: Thu Nov 4 18:18:53 2021 +0200 drm/i915/audio: group audio under anonymous struct in drm_i915_private With an anonymous struct, this can be pure hierarchical organization without code changes. We'll follow up with adding a name to the sub-struct separately. Cc: Dave Airlie Reviewed-by: Ville Syrjälä Reviewed-by: Lucas De Marchi Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20211104161858.21786-1-jani.nikula@intel.com commit c10a652e239e21492525fab295dc2fc303338ef1 Author: Maarten Lankhorst Date: Thu Oct 28 13:58:53 2021 +0100 drm/i915/selftests: Rework context handling in hugepages selftests In the next commit, we don't evict when refcount = 0, so we need to call drain freed objects, because we want to pin new bo's in the same place, causing a test failure. Furthermore, since each subtest is separated, it's a lot better to use i915_live_selftests, so each subtest starts with a clean slate, and a clean address space. v2(Reported-by: kernel test robot ): - Make hugepage_ctx static. Signed-off-by: Maarten Lankhorst Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20211028125855.3281674-9-matthew.auld@intel.com commit 52a743f1c114727cfd51aefe584c7a4d82375acc Author: Maarten Lankhorst Date: Thu Oct 28 13:58:47 2021 +0100 drm/i915: Remove gen6_ppgtt_unpin_all gen6_ppgtt_unpin_all is unused, kill it. Signed-off-by: Maarten Lankhorst Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20211028125855.3281674-3-matthew.auld@intel.com commit 2b0a750caf332a24f62f6960820d24d885f2efc2 Author: Thomas Hellström Date: Thu Nov 4 12:07:18 2021 +0100 drm/i915/ttm: Failsafe migration blits If the initial fill blit or copy blit of an object fails, the old content of the data might be exposed and read as soon as either CPU- or GPU PTEs are set up to point at the pages. Intercept the blit fence with an async callback that checks the blit fence for errors and if there are errors performs an async cpu blit instead. If there is a failure to allocate the async dma_fence_work, allocate it on the stack and sync wait for the blit to complete. Add selftests that simulate gpu blit failures and failure to allocate the async dma_fence_work. A previous version of this pach used dma_fence_work, now that's opencoded which adds more code but might lower the latency somewhat in the common non-error case. v3: - Style fixes (Matthew Auld) v4: - Use "#if IS_ENABLED()" instead of #ifdef (Matthew Auld) v5: - Fix an issue where we, if the dependency was already signaled, might end up waiting for a memcpy fence that would never signal. v6: - Add a missing i915_ttm_memcpy_release() (Matthew Auld) Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20211104110718.688420-3-thomas.hellstrom@linux.intel.com commit 3589fdbd3b2085e273b6ea1e9f27a211e0ef74f8 Author: Thomas Hellström Date: Thu Nov 4 12:07:17 2021 +0100 drm/i915/ttm: Reorganize the ttm move code We are about to introduce failsafe- and asynchronous migration and ttm moves. This will add complexity and code to the TTM move code so it makes sense to split it out to a separate file to make the i915 TTM code easer to digest. Split the i915 TTM move code out and since we will have to change the name of the gpu_binds_iomem() and cpu_maps_iomem() functions anyway, we alter the name of gpu_binds_iomem() to i915_ttm_gtt_binds_lmem() which is more reflecting what it is used for. With this we also add some more documentation. Otherwise there should be no functional change. Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20211104110718.688420-2-thomas.hellstrom@linux.intel.com commit c64a9a7c05beb2b71b7496d873654f88e1a08593 Author: Radhakrishna Sripada Date: Fri Oct 15 14:00:41 2021 -0700 drm/i915: Update memory bandwidth formulae The formulae has been updated to include more variables. Make sure the code carries the same. Bspec: 64631, 54023 v2: Make GEN11 follow the default route and fix calculation of maxdebw(RK) v3: Fix div by zero on default case Correct indent for fallthrough(Jani) v4: Fix div by zero on gen11. v5: Fix 0 max_numchannels case v6: - Split gen11/gen12 algorithms - Fix RKL deburst value - Fix difference b/ween ICL and TGL algorithms - Protect deinterleave from being 0 - Warn when numchannels exceeds max_numchannels - Fix scaling of clk_max from different units - s/deinterleave/channelwidth/ in calculating peakbw - Fix off by one for num_planes TGL+ - Fix SAGV check v7: Fix div by zero error on gen11 v8: Even though the algorithm for gen11 says that we need to return derated bw for a qgv point whose planes are less than no of active planes, we return 0 for deratedbw when only one plane is allowed. We modify the algorithm to accommodate the case where no of active planes are same as the min no of planes supported by a qgv point. v9: Fix dclk scaling for dg1 Cc: Ville Syrjälä Suggested-by: Matt Roper Signed-off-by: Radhakrishna Sripada Reviewed-by: Anusha Srivatsa Signed-off-by: Matt Roper Link: https://patchwork.freedesktop.org/patch/msgid/20211015210041.16858-1-radhakrishna.sripada@intel.com commit a14fef80ebb3efa5755b02790e067fe259bc8c63 Author: Ville Syrjälä Date: Mon Oct 18 14:50:30 2021 +0300 drm/i915: Split vlv/chv sprite plane update into noarm+arm pair Chop vlv_sprite_update() into two halves. Fist half becomes the _noarm() variant, second part the _arm() variant. Fortunately I have already previously grouped the register writes into roughtly the correct order, so the split looks surprisingly clean. Looks like most of the hardware logic was copied from the pre-ctg sprite C, so SPSTRIDE/POS/SIZE are armed by SPSURF, while the rest are self arming. SPCONSTALPHA is the one entirely new register that didn't exist in the old sprite C, and looks like that one is self arming. The CHV pipe B CSC is also self arming, like the rest of the CHV pipe B additions. I didn't have time to capture i915_update_info numbers for these, but since all the other platforms generally showed improvements, and crucially no regression, I am fairly confident this should behave similarly. Cc: Stanislav Lisovskiy Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211018115030.3547-10-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy commit 50105a3ad16cac406494038ce4edb91769911434 Author: Ville Syrjälä Date: Mon Oct 18 14:50:29 2021 +0300 drm/i915: Split ivb+ sprite plane update into noarm+arm pair Chop ivb_sprite_update() into two halves. Fist half becomes the _noarm() variant, second part the _arm() variant. Fortunately I have already previously grouped the register writes into roughtly the correct order, so the split looks surprisingly clean. Didn't bother with i915_update_info numbers for this one. I expect the results to be pretty much identical to the snb numbers from the corresponding g4x+ sprite modification. Cc: Stanislav Lisovskiy Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211018115030.3547-9-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy commit 120542e2c1d12e7d3594ceeaa6e02296af52cc80 Author: Ville Syrjälä Date: Mon Oct 18 14:50:28 2021 +0300 drm/i915: Split g4x+ sprite plane update into noarm+arm pair Chop g4x_sprite_update() into two halves. Fist half becomes the _noarm() variant, second part the _arm() variant. Fortunately I have already previously grouped the register writes into roughtly the correct order, so the split looks surprisingly clean. Not much of a change in i915_update_info on these older platforms that don't have so many planes or registers to begin with. Here are the numbers from snb (totally unpatched vs. both primary plane and sprite patched applied) running kms_atomic_transition --r plane-all-transition --extended: w/o patch w/ patch Updates: 5404 Updates: 5405 | | 1us |****** 1us |****** |********* |********* 4us |*********** 4us |*********** |********** |********** 16us |** 16us |** | | 66us | 66us | | | 262us | 262us | | | 1ms | 1ms | | | 4ms | 4ms | | | 17ms | 17ms | | | Min update: 1400ns Min update: 1307ns Max update: 19809ns Max update: 20194ns Average update: 6957ns Average update: 6432ns Overruns > 100us: 0 Overruns > 100us: 0 But there seems to be a slight improvement with lockdep enabled: w/o patch w/ patch Updates: 17612 Updates: 16364 | | 1us | 1us | |****** |****** 4us |********** 4us |********** |************ |************* 16us |************* 16us |************ |*** |* 66us | 66us | | | 262us | 262us | | | 1ms | 1ms | | | 4ms | 4ms | | | 17ms | 17ms | | | Min update: 3141ns Min update: 3562ns Max update: 126450ns Max update: 73354ns Average update: 16373ns Average update: 15153ns Overruns > 250us: 0 Overruns > 250us: 0 Cc: Stanislav Lisovskiy Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211018115030.3547-8-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy commit 4d0d77de9af455aa949766ecad1ac3232e322020 Author: Ville Syrjälä Date: Thu Oct 21 00:27:57 2021 +0300 drm/i915: Split pre-skl primary plane update into noarm+arm pair Chop i9xx_plane_update() into two halves. Fist half becomes the _noarm() variant, second part the _arm() variant. Fortunately I have already previously grouped the register writes into roughtly the correct order, so the split looks surprisingly clean. One slightly surprising fact was that the CHV pipe B PRIMPOS/SIZE registers are self arming unlike their pre-ctg DSPPOS/SIZE counterparts. In fact all the new CHV pipe B registers are self arming. Also we must remind ourselves that i830/i845 are a bit borked in that all of their plane registers are self-arming. I didn't do any i915_update_info measurements for this one alone. I'll get total numbers with the corrsponding sprite plane changes. v2: Don't break my precious i830/i845 Cc: Stanislav Lisovskiy Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211020212757.13517-1-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy commit 890b6ec4a522799d36bd10aee993059d771c06f4 Author: Ville Syrjälä Date: Mon Oct 18 14:50:26 2021 +0300 drm/i915: Split skl+ plane update into noarm+arm pair Chop skl_program_plane() into two halves. Fist half becomes the _noarm() variant, second part the _arm() variant. Fortunately I have already previously grouped the register writes into roughtly the correct order, so the split looks surprisingly clean. A few notable oddities I did not realize were self arming are AUX_DIST and COLOR_CTL. i915_update_info doesn't look too terrible on my cfl running kms_atomic_transition --r plane-all-transition --extended: w/o patch w/ patch Updates: 2178 Updates: 2018 | | 1us | 1us | | | 4us | 4us |***** |********* |********** 16us |********** 16us |******* |*** | 66us | 66us | | | 262us | 262us | | | 1ms | 1ms | | | 4ms | 4ms | | | 17ms | 17ms | | | Min update: 8332ns Min update: 6164ns Max update: 48758ns Max update: 31808ns Average update: 19959ns Average update: 13159ns Overruns > 100us: 0 Overruns > 100us: 0 And with lockdep enabled: w/o patch w/ patch Updates: 2177 Updates: 2172 | | 1us | 1us | | | 4us | 4us | |******* |********* 16us |********** 16us |********** |******* |* 66us | 66us | | | 262us | 262us | | | 1ms | 1ms | | | 4ms | 4ms | | | 17ms | 17ms | | | Min update: 12645ns Min update: 9980ns Max update: 50153ns Max update: 33533ns Average update: 25337ns Average update: 18245ns Overruns > 250us: 0 Overruns > 250us: 0 TODO: On icl+ everything seems to be armed by PLANE_SURF, so we can optimize this even further on modern platforms. But I think there's a bit of refactoring to be done first to figure out the best way to go about it (eg. just reusing the current skl+ functions, or doing a lower level split). TODO: Split scaler programming as well, but IIRC the scaler has some oddball double buffering behaviour on some platforms, so needs proper reverse engineering Cc: Stanislav Lisovskiy Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211018115030.3547-6-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy commit 8ac80733cf6f08b9fdac9bf6800dd81e9304b4c6 Author: Ville Syrjälä Date: Mon Oct 18 14:50:25 2021 +0300 drm/i915: Split update_plane() into update_noarm() + update_arm() The amount of plane registers we have to write has been steadily increasing, putting more pressure on the vblank evasion mechanism and forcing us to increase its time budget. Let's try to take some of the pressure off by splitting plane updates into two parts: 1) write all non-self arming plane registers, ie. the registers where the write actually does nothing until a separate arming register is also written which will cause the hardware to latch the new register values at the next start of vblank 2) write all self arming plane registers, ie. registers which always just latch at the next start of vblank, and registers which also arm other registers to do so Here we just provide the mechanism, but don't actually implement the split on any platform yet. so everything stays now in the _arm() hooks. Subsequently we can move a whole bunch of stuff into the _noarm() part, especially in more modern platforms where the number of registers we have to write is also the greatest. On older platforms this is less beneficial probably, but no real reason to deviate from a common behaviour. And let's sprinkle some TODOs around the areas that will need adapting. Cc: Stanislav Lisovskiy Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211018115030.3547-5-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy commit e56b80d9fd291481e55c1e7b3483db83ec44b680 Author: Ville Syrjälä Date: Mon Oct 18 14:50:24 2021 +0300 drm/i915: Fix up the sprite namespacing Give all sprite exclusive functions/etc. a proper namespace. Cc: Stanislav Lisovskiy Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211018115030.3547-4-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy commit 50faf7a194b80c2f9a6f919b03036880e6620b0a Author: Ville Syrjälä Date: Mon Oct 18 14:50:23 2021 +0300 drm/i915: Fix async flip with decryption and/or DPT We're currently forgetting to set the PLANE_SURF_DECRYPT flag in the async flip path. So if the hardware were to latch that bit despite this being an async flip we'd start scanning out garbage. And if it doesn't latch it then I guess we'd just end up with a weird register value that doesn't actually match the hardware state, which isn't great for anyone staring at register dumps. Similarly the async flip path also forgets to call skl_surf_address() which means the DPT address space to GGTT address space downshift is not being applied to the offset. Which means we are pointing PLANE_SURF at some random location in GGTT instead of the correct DPT page. So let's fix two birds with one stone and extract the PLANE_SURF calculation from skl_program_plane() into a small helper and use it in the async flip path as well. Cc: Anshuman Gupta Cc: Daniele Ceraolo Spurio Cc: Juston Li Cc: Rodrigo Vivi Cc: Uma Shankar Cc: Karthik B S Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211018115030.3547-3-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy commit aaec72ee90bcccfffeb33feb8be826efa4065a7c Author: Ville Syrjälä Date: Mon Oct 18 14:50:22 2021 +0300 drm/i915: Reject planar formats when doing async flips Async flips are only capable of changing PLANE_SURF, hence we they can't easily be used with planar formats. Older platforms could require updating AUX_DIST as well, which is not possible. We'd have to make sure AUX_DIST doesn't change before allowing the async flip through. If we could get async flips with CCS then that might be interesting, but since the hw doesn't allow async flips with CCS I don't see much point in allowing this for planar formats either. No one renders their game content in YUV anyway. icl+ could in theory do this I suppose since each color plane has its own PLANE_SURF register, but I don't know if there is some magic to guarantee that both the Y and UV plane would async flip synchronously if you will. Ie. beyond just a clean tear we'd potentially get some kind of weird tear with some random mix of luma and chroma from the old and new frames. So let's just say no to async flips when scanning out planar formats. Cc: Karthik B S Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211018115030.3547-2-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy commit c4c6ef229593366ab593d4d424addc7025b54a76 Author: Brian Norris Date: Wed Nov 3 13:52:00 2021 -0700 drm/bridge: analogix_dp: Make PSR-exit block less Prior to commit 6c836d965bad ("drm/rockchip: Use the helpers for PSR"), "PSR exit" used non-blocking analogix_dp_send_psr_spd(). The refactor started using the blocking variant, for a variety of reasons -- quoting Sean Paul's potentially-faulty memory: """ - To avoid racing a subsequent PSR entry (if exit takes a long time) - To avoid racing disable/modeset - We're not displaying new content while exiting PSR anyways, so there is minimal utility in allowing frames to be submitted - We're lying to userspace telling them frames are on the screen when we're just dropping them on the floor """ However, I'm finding that this blocking transition is causing upwards of 60+ ms of unneeded latency on PSR-exit, to the point that initial cursor movements when leaving PSR are unbearably jumpy. It turns out that we need to meet in the middle somewhere: Sean is right that we were "lying to userspace" with a non-blocking PSR-exit, but the new blocking behavior is also waiting too long: According to the eDP specification, the sink device must support PSR entry transitions from both state 4 (ACTIVE_RESYNC) and state 0 (INACTIVE). It also states that in ACTIVE_RESYNC, "the Sink device must display the incoming active frames from the Source device with no visible glitches and/or artifacts." Thus, for our purposes, we only need to wait for ACTIVE_RESYNC before moving on; we are ready to display video, and subsequent PSR-entry is safe. Tested on a Samsung Chromebook Plus (i.e., Rockchip RK3399 Gru Kevin), where this saves about 60ms of latency, for PSR-exit that used to take about 80ms. Fixes: 6c836d965bad ("drm/rockchip: Use the helpers for PSR") Cc: Cc: Zain Wang Cc: Tomasz Figa Cc: Heiko Stuebner Cc: Sean Paul Signed-off-by: Brian Norris Reviewed-by: Sean Paul Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20211103135112.v3.1.I67612ea073c3306c71b46a87be894f79707082df@changeid commit 566fef1226c1df5a7e71718f9ae012d4c1cd13f7 Author: Xin Ji Date: Thu Nov 4 11:38:57 2021 +0800 drm/bridge: anx7625: add HDMI audio function Add audio HDMI codec function support, enable it through device true flag "analogix,audio-enable". Reviewed-by: Robert Foss Signed-off-by: Xin Ji Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20211104033857.2634562-1-xji@analogixsemi.com commit fd0310b6fe7db694e553a5407594d1361e68ce1e Author: Xin Ji Date: Thu Nov 4 11:36:39 2021 +0800 drm/bridge: anx7625: add MIPI DPI input feature The basic anx7625 driver only support MIPI DSI rx signal input. This patch add MIPI DPI rx input configuration support, after apply this patch, the driver can support DSI rx or DPI rx by adding 'bus-type' in DT. Reviewed-by: Robert Foss Signed-off-by: Xin Ji Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20211104033639.2634502-1-xji@analogixsemi.com commit 9a7e49bd7992fca8cae11d21ffe5ebe73a2f4c18 Author: Xin Ji Date: Thu Nov 4 11:36:09 2021 +0800 drm/bridge: anx7625: fix not correct return value At some time, the original code may return non zero value, force return 0 if operation finished. Reviewed-by: Robert Foss Signed-off-by: Xin Ji Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20211104033609.2634452-1-xji@analogixsemi.com commit a43661e7e819b100e1f833a35018560a1d9abb39 Author: Xin Ji Date: Thu Nov 4 11:34:44 2021 +0800 dt-bindings:drm/bridge:anx7625:add vendor define Add 'bus-type' and 'data-lanes' define for port0. Add DP tx lane0, lane1 swing register setting array, and audio enable flag. The device which cannot pass DP tx PHY CTS caused by long PCB trace or embedded MUX, adjusting ANX7625 PHY parameters can pass the CTS test. The adjusting type include Pre-emphasis, Vp-p, Rterm(Resistor Termination) and Rsel(Driven Strength). Each lane has maximum 20 registers for these settings. Signed-off-by: Xin Ji Reviewed-by: Rob Herring Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20211104033444.2634397-1-xji@analogixsemi.com commit fbd4cf3bfe1557b80774670d19c0a68d7d40fb18 Author: Matthew Auld Date: Tue Nov 2 15:50:55 2021 +0000 drm/i915: fixup dma_fence_wait usage dma_fence_wait expects a boolean for whether it should be interruptible, not a timeout value. Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20211102155055.100138-1-matthew.auld@intel.com commit 16e101051f329f5f3f2dd810f3687d166580aa3a Author: Maxime Ripard Date: Mon Oct 25 17:29:03 2021 +0200 drm/vc4: Increase the core clock based on HVS load Depending on a given HVS output (HVS to PixelValves) and input (planes attached to a channel) load, the HVS needs for the core clock to be raised above its boot time default. Failing to do so will result in a vblank timeout and a stalled display pipeline. Signed-off-by: Maxime Ripard Reviewed-by: Dave Stevenson Link: https://lore.kernel.org/r/20211025152903.1088803-11-maxime@cerno.tech commit b7551457c5d0b3505b0be247d47919c1ee30506d Author: Maxime Ripard Date: Mon Oct 25 17:29:02 2021 +0200 drm/vc4: hdmi: Enable the scrambler on reconnection If we have a state already and disconnect/reconnect the display, the SCDC messages won't be sent again since we didn't go through a disable / enable cycle. In order to fix this, let's call the vc4_hdmi_enable_scrambling function in the detect callback if there is a mode and it needs the scrambler to be enabled. Fixes: c85695a2016e ("drm/vc4: hdmi: Enable the scrambler") Signed-off-by: Maxime Ripard Reviewed-by: Dave Stevenson Link: https://lore.kernel.org/r/20211025152903.1088803-10-maxime@cerno.tech commit bd43e22bf28eadd69c176740da0fa9a9499aa872 Author: Maxime Ripard Date: Mon Oct 25 17:29:01 2021 +0200 drm/vc4: hdmi: Raise the maximum clock rate Now that we have the infrastructure in place, we can raise the maximum pixel rate we can reach for HDMI0 on the BCM2711. HDMI1 is left untouched since its pixelvalve has a smaller FIFO and would need a clock faster than what we can provide to support the same modes. Acked-by: Thomas Zimmermann Reviewed-by: Dave Stevenson Signed-off-by: Maxime Ripard Link: https://lore.kernel.org/r/20211025152903.1088803-9-maxime@cerno.tech commit 7f817159c3310bb36aefd74f365228ff5891b7a2 Author: Maxime Ripard Date: Mon Oct 25 17:29:00 2021 +0200 drm/vc4: Leverage the load tracker on the BCM2711 The load tracker was initially designed to report and warn about a load too high for the HVS. To do so, it computes for each plane the impact it's going to have on the HVS, and will warn (if it's enabled) if we go over what the hardware can process. While the limits being used are a bit irrelevant to the BCM2711, the algorithm to compute the HVS load will be one component used in order to compute the core clock rate on the BCM2711. Let's remove the hooks to prevent the load tracker to do its computation, but since we don't have the same limits, don't check them against them, and prevent the debugfs file to enable it from being created. Signed-off-by: Maxime Ripard Reviewed-by: Dave Stevenson Link: https://lore.kernel.org/r/20211025152903.1088803-8-maxime@cerno.tech commit e1a7094b58c0d9123c9e80fa56d68cc7222ad6c4 Author: Maxime Ripard Date: Mon Oct 25 17:28:59 2021 +0200 drm/vc4: crtc: Add some logging The encoder retrieval code has been a source of bugs and glitches in the past and the crtc <-> encoder association been wrong in a number of different ways. Add some logging to quickly spot issues if they occur. Signed-off-by: Maxime Ripard Reviewed-by: Dave Stevenson Link: https://lore.kernel.org/r/20211025152903.1088803-7-maxime@cerno.tech commit 94c1adc4c1241d1cc4cf29e3da15a65ad04171c4 Author: Maxime Ripard Date: Mon Oct 25 17:28:58 2021 +0200 drm/vc4: crtc: Rework the encoder retrieval code (again) It turns out the encoder retrieval code, in addition to being unnecessarily complicated, has a bug when only the planes and crtcs are affected by a given atomic commit. Indeed, in such a case, either drm_atomic_get_old_connector_state or drm_atomic_get_new_connector_state will return NULL and thus our encoder retrieval code will not match on anything. We can however simplify the code by using drm_for_each_encoder_mask, the drm_crtc_state storing the encoders a given CRTC is connected to directly and without relying on any other state. Signed-off-by: Maxime Ripard Reviewed-by: Dave Stevenson Link: https://lore.kernel.org/r/20211025152903.1088803-6-maxime@cerno.tech commit d6faf94a68ae83c565cd6df1426d3a9dc277a372 Author: Maxime Ripard Date: Mon Oct 25 17:28:57 2021 +0200 drm/vc4: crtc: Add encoder to vc4_crtc_config_pv prototype vc4_crtc_config_pv() retrieves the encoder again, even though its only caller, vc4_crtc_atomic_enable(), already did. Pass the encoder pointer as an argument instead of going through all the connectors to retrieve it again. Signed-off-by: Maxime Ripard Reviewed-by: Dave Stevenson Link: https://lore.kernel.org/r/20211025152903.1088803-5-maxime@cerno.tech commit d0229c360a42439c2a7c40c977455a4f9fc387de Author: Maxime Ripard Date: Mon Oct 25 17:28:56 2021 +0200 drm/vc4: Make vc4_crtc_get_encoder public We'll need that function in vc4_kms to compute the core clock rate requirements. Signed-off-by: Maxime Ripard Reviewed-by: Dave Stevenson Link: https://lore.kernel.org/r/20211025152903.1088803-4-maxime@cerno.tech commit e32e5723256a99c5324824503572f743377dd0fe Author: Maxime Ripard Date: Mon Oct 25 17:28:55 2021 +0200 drm/vc4: hdmi: Fix HPD GPIO detection Prior to commit 6800234ceee0 ("drm/vc4: hdmi: Convert to gpiod"), in the detect hook, if we had an HPD GPIO we would only rely on it and return whatever state it was in. However, that commit changed that by mistake to only consider the case where we have a GPIO and it returns a logical high, and would fall back to the other methods otherwise. Since we can read the EDIDs when the HPD signal is low on some displays, we changed the detection status from disconnected to connected, and we would ignore an HPD pulse. Fixes: 6800234ceee0 ("drm/vc4: hdmi: Convert to gpiod") Signed-off-by: Maxime Ripard Reviewed-by: Dave Stevenson Link: https://lore.kernel.org/r/20211025152903.1088803-3-maxime@cerno.tech commit cc5f1cbbc1e12ad5b11d594159fe793eb03c70fa Author: Maxime Ripard Date: Mon Oct 25 17:28:54 2021 +0200 drm/vc4: hdmi: Remove the DDC probing for status detection Commit 9d44abbbb8d5 ("drm/vc4: Fall back to using an EDID probe in the absence of a GPIO.") added some code to read the EDID through DDC in the HDMI driver detect hook since the Pi3 had no HPD GPIO back then. However, commit b1b8f45b3130 ("ARM: dts: bcm2837: Add missing GPIOs of Expander") changed that a couple of years later. This causes an issue though since some TV (like the LG 55C8) when it comes out of standy will deassert the HPD line, but the EDID will remain readable. It causes an issues nn platforms without an HPD GPIO, like the Pi4, where the DDC probing will be our primary mean to detect a display, and thus we will never detect the HPD pulse. This was fine before since the pulse was small enough that we would never detect it, and we also didn't have anything (like the scrambler) that needed to be set up in the display. However, now that we have both, the display during the HPD pulse will clear its scrambler status, and since we won't detect the disconnect/reconnect cycle we will never enable the scrambler back. As our main reason for that DDC probing is gone, let's just remove it. Signed-off-by: Maxime Ripard Reviewed-by: Dave Stevenson Link: https://lore.kernel.org/r/20211025152903.1088803-2-maxime@cerno.tech commit 89aae41d740f67a7c8b8ee015c44645d218de754 Author: Christian König Date: Wed Oct 27 13:30:40 2021 +0200 drm/radeon: use dma_resv_wait_timeout() instead of manually waiting Don't touch the exclusive fence manually here, but rather use the general dma_resv function. We did that for better hw reset handling but this doesn't necessary work correctly. Signed-off-by: Christian König Reviewed-by: Alex Deuche Acked-by: Nirmoy Das Link: https://patchwork.freedesktop.org/patch/msgid/20211028132630.2330-6-christian.koenig@amd.com commit 1448d5c47e6a26150d885bb4a5764a8d75b9c707 Author: Vinay Belgaumkar Date: Mon Nov 1 18:26:08 2021 -0700 drm/i915/guc/slpc: Update boost sysfs hooks for SLPC Add a helper to sort through the SLPC/RPS paths of get/set methods. Boost frequency will be modified as long as it is within the constraints of RP0 and if it is different from the existing one. We will set min freq to boost only if there is at least one active waiter. v2: Add num_boosts to guc_slpc_info and changes for worker function v3: Review comments (Ashutosh) Cc: Ashutosh Dixit Signed-off-by: Vinay Belgaumkar Reviewed-by: Ashutosh Dixit Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20211102012608.8609-4-vinay.belgaumkar@intel.com commit 493043feed006f75f43a1990ae2ae1178f277628 Author: Vinay Belgaumkar Date: Mon Nov 1 18:26:07 2021 -0700 drm/i915/guc/slpc: Add waitboost functionality for SLPC Add helper in RPS code for handling SLPC and non-SLPC paths. When boost is requested in the SLPC path, we can ask GuC to ramp up the frequency req by setting the minimum frequency to boost freq. Reset freq back to the min softlimit when there are no more waiters. v2: Schedule a worker thread which can boost freq from within an interrupt context as well. v3: No need to check against requested freq before scheduling boost work (Ashutosh) Cc: Ashutosh Dixit Signed-off-by: Vinay Belgaumkar Reviewed-by: Ashutosh Dixit Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20211102012608.8609-3-vinay.belgaumkar@intel.com commit 292e4fb05f14d54c90cb165335c6d4dfaf1cfb32 Author: Vinay Belgaumkar Date: Mon Nov 1 18:26:06 2021 -0700 drm/i915/guc/slpc: Define and initialize boost frequency Define helpers and struct members required to record boost info. Boost frequency is initialized to RP0 at SLPC init. Also define num_waiters which can track the pending boost requests. Boost will be done by scheduling a worker thread. This will avoid the need to make H2G calls inside an interrupt context. Initialize the worker function during SLPC init as well. Had to move intel_guc_slpc_init a few lines below to accommodate this. v2: Add a workqueue to handle waitboost v3: Code review comments (Ashutosh) Cc: Ashutosh Dixit Signed-off-by: Vinay Belgaumkar Reviewed-by: Ashutosh Dixit Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20211102012608.8609-2-vinay.belgaumkar@intel.com commit be2f2d1680dfb36793ea8d3110edd4a1db496352 Author: Andrii Nakryiko Date: Tue Nov 2 22:14:49 2021 -0700 libbpf: Deprecate bpf_program__load() API Mark bpf_program__load() as deprecated ([0]) since v0.6. Also rename few internal program loading bpf_object helper functions to have more consistent naming. [0] Closes: https://github.com/libbpf/libbpf/issues/301 Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Link: https://lore.kernel.org/bpf/20211103051449.1884903-1-andrii@kernel.org commit b87b1883efe385e56384ff48e6f3108a33fde508 Author: Alexander Aring Date: Wed Nov 3 17:04:18 2021 -0400 fs: dlm: remove double list_first_entry call This patch removes a list_first_entry() call which is already done by the previous con_next_wq() call. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit d6b973acd7566e326e22459e827ea9a871e85a7d Merge: 8388092b2551f b7332d2820d39 Author: Alexei Starovoitov Date: Wed Nov 3 13:25:37 2021 -0700 Merge branch 'libbpf ELF sanity checking improvements' Andrii Nakryiko says: ==================== Few patches fixing various issues discovered by oss-fuzz project fuzzing bpf_object__open() call. Fixes are mostly focused around additional simple sanity checks of ELF format: symbols, relos, etc. v1->v2: - address Yonghong's feedback. ==================== Signed-off-by: Alexei Starovoitov commit b7332d2820d394dd2ac127df1567b4da597355a1 Author: Andrii Nakryiko Date: Wed Nov 3 10:32:13 2021 -0700 libbpf: Improve ELF relo sanitization Add few sanity checks for relocations to prevent div-by-zero and out-of-bounds array accesses in libbpf. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20211103173213.1376990-6-andrii@kernel.org commit 0d6988e16a12ebd41d3e268992211b0ceba44ed7 Author: Andrii Nakryiko Date: Wed Nov 3 10:32:12 2021 -0700 libbpf: Fix section counting logic e_shnum does include section #0 and as such is exactly the number of ELF sections that we need to allocate memory for to use section indices as array indices. Fix the off-by-one error. This is purely accounting fix, previously we were overallocating one too many array items. But no correctness errors otherwise. Fixes: 25bbbd7a444b ("libbpf: Remove assumptions about uniqueness of .rodata/.data/.bss maps") Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20211103173213.1376990-5-andrii@kernel.org commit 62554d52e71797eefa3fc15b54008038837bb2d4 Author: Andrii Nakryiko Date: Wed Nov 3 10:32:11 2021 -0700 libbpf: Validate that .BTF and .BTF.ext sections contain data .BTF and .BTF.ext ELF sections should have SHT_PROGBITS type and contain data. If they are not, ELF is invalid or corrupted, so bail out. Otherwise this can lead to data->d_buf being NULL and SIGSEGV later on. Reported by oss-fuzz project. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20211103173213.1376990-4-andrii@kernel.org commit 88918dc12dc357a06d8d722a684617b1c87a4654 Author: Andrii Nakryiko Date: Wed Nov 3 10:32:10 2021 -0700 libbpf: Improve sanity checking during BTF fix up If BTF is corrupted DATASEC's variable type ID might be incorrect. Prevent this easy to detect situation with extra NULL check. Reported by oss-fuzz project. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20211103173213.1376990-3-andrii@kernel.org commit 833907876be55205d0ec153dcd819c014404ee16 Author: Andrii Nakryiko Date: Wed Nov 3 10:32:09 2021 -0700 libbpf: Detect corrupted ELF symbols section Prevent divide-by-zero if ELF is corrupted and has zero sh_entsize. Reported by oss-fuzz project. Signed-off-by: Andrii Nakryiko Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20211103173213.1376990-2-andrii@kernel.org commit 1e6d69c7b9cd7735bbf4c6754ccbb9cce8bd8ff4 Author: Kees Cook Date: Wed Nov 3 09:30:39 2021 -0700 selftests/seccomp: Report event mismatches more clearly When running under tracer, more explicitly report the status and event mismatches to help with debugging. Additionally add an "immediate kill" test when under tracing to verify that fatal SIGSYS behaves the same under ptrace or seccomp tracing. Cc: Andy Lutomirski Cc: Will Drewry Cc: linux-kselftest@vger.kernel.org Signed-off-by: Kees Cook Acked-by: "Eric W. Biederman" Link: https://lore.kernel.org/r/20211103163039.2104830-3-keescook@chromium.org commit 48d5fd06453de57f9d9385c7ebcdf3b50658a962 Author: Kees Cook Date: Wed Nov 3 09:30:38 2021 -0700 selftests/seccomp: Stop USER_NOTIF test if kcmp() fails If kcmp() fails during the USER_NOTIF test, the test is likely to hang, so switch from EXPECT to ASSERT. Cc: Andy Lutomirski Cc: Will Drewry Cc: linux-kselftest@vger.kernel.org Signed-off-by: Kees Cook Acked-by: "Eric W. Biederman" Link: https://lore.kernel.org/r/20211103163039.2104830-2-keescook@chromium.org commit 8388092b2551f7ae34dad800ce828779f7c948c9 Merge: cc0356d6a02e0 f5aafbc2af519 Author: Andrii Nakryiko Date: Wed Nov 3 11:21:42 2021 -0700 Merge branch 'libbpf: deprecate bpf_program__get_prog_info_linear' Dave Marchevsky says: ==================== bpf_program__get_prog_info_linear is a helper which wraps the bpf_obj_get_info_by_fd BPF syscall with some niceties that put all dynamic-length bpf_prog_info in one buffer contiguous with struct bpf_prog_info, and simplify the selection of which dynamic data to grab. The resultant combined struct, bpf_prog_info_linear, is persisted to file by 'perf' to enable later annotation of BPF prog data. libbpf includes some vaddr <-> offset conversion helpers for struct bpf_prog_info_linear to simplify this. This functionality is heavily tailored to perf's usecase, so its use as a general prog info API should be deemphasized in favor of just calling bpf_obj_get_info_by_fd, which can be more easily fit to purpose. Some examples from caller migrations in this series: * Some callers weren't requesting or using dynamic-sized prog info and are well served by a simple get_info_by_fd call (e.g. dump_prog_id_as_func_ptr in bpftool) * Some callers were requesting all of a specific dynamic info type but only using the first record, so can avoid unnecessary malloc by only requesting 1 (e.g. profile_target_name in bpftool) * bpftool's do_dump saves some malloc/free by growing and reusing its dynamic prog_info buf as it loops over progs to grab info and dump. Perf does need the full functionality of bpf_program__get_prog_info_linear and its accompanying structs + helpers, so copy the code to its codebase, migrate all other uses in the tree, and deprecate the helper in libbpf. Since the deprecated symbols continue to be included in perf some renaming was necessary in perf's copy, otherwise functionality is unchanged. This work was previously discussed in libbpf's issue tracker [0]. [0]: https://github.com/libbpf/libbpf/issues/313 v2->v3: * Remove v2's patch 1 ("libbpf: Migrate internal use of bpf_program__get_prog_info_linear"), which was applied [Andrii] * Add new patch 1 migrating error checking of libbpf calls to new scheme [Andrii, Quentin] * In patch 2, fix != -1 error check of libbpf call, improper realloc handling, and get rid of confusing macros [Andrii] * In patch 4, deprecate starting from 0.6 instead of 0.7 [Andrii] v1->v2: fix bpftool do_dump changes to clear bpf_prog_info after use and correctly pass realloc'd ptr back (patch 2) ==================== Signed-off-by: Andrii Nakryiko commit f5aafbc2af51931668799a9c5080c8e35cbb571f Author: Dave Marchevsky Date: Mon Nov 1 15:43:57 2021 -0700 libbpf: Deprecate bpf_program__get_prog_info_linear As part of the road to libbpf 1.0, and discussed in libbpf issue tracker [0], bpf_program__get_prog_info_linear and its associated structs and helper functions should be deprecated. The functionality is too specific to the needs of 'perf', and there's little/no out-of-tree usage to preclude introduction of a more general helper in the future. [0] Closes: https://github.com/libbpf/libbpf/issues/313 Signed-off-by: Dave Marchevsky Signed-off-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20211101224357.2651181-5-davemarchevsky@fb.com commit 199e06fe832ddca80c2167661acab0e9dec657c4 Author: Dave Marchevsky Date: Mon Nov 1 15:43:56 2021 -0700 perf: Pull in bpf_program__get_prog_info_linear To prepare for impending deprecation of libbpf's bpf_program__get_prog_info_linear, pull in the function and associated helpers into the perf codebase and migrate existing uses to the perf copy. Since libbpf's deprecated definitions will still be visible to perf, it is necessary to rename perf's definitions. Signed-off-by: Dave Marchevsky Signed-off-by: Andrii Nakryiko Acked-by: Song Liu Acked-by: Quentin Monnet Link: https://lore.kernel.org/bpf/20211101224357.2651181-4-davemarchevsky@fb.com commit c59765cfd193382b00454b1a4424cb78d4c065e2 Author: Dave Marchevsky Date: Mon Nov 1 15:43:55 2021 -0700 bpftool: Use bpf_obj_get_info_by_fd directly To prepare for impending deprecation of libbpf's bpf_program__get_prog_info_linear, migrate uses of this function to use bpf_obj_get_info_by_fd. Since the profile_target_name and dump_prog_id_as_func_ptr helpers were only looking at the first func_info, avoid grabbing the rest to save a malloc. For do_dump, add a more full-featured helper, but avoid free/realloc of buffer when possible for multi-prog dumps. Signed-off-by: Dave Marchevsky Signed-off-by: Andrii Nakryiko Acked-by: Quentin Monnet Link: https://lore.kernel.org/bpf/20211101224357.2651181-3-davemarchevsky@fb.com commit 60f270753960291895cdd07d360c4e09c56c4596 Author: Dave Marchevsky Date: Mon Nov 1 15:43:54 2021 -0700 bpftool: Migrate -1 err checks of libbpf fn calls Per [0], callers of libbpf functions with LIBBPF_STRICT_DIRECT_ERRS set should handle negative error codes of various values (e.g. -EINVAL). Migrate two callsites which were explicitly checking for -1 only to handle the new scheme. [0]: https://github.com/libbpf/libbpf/wiki/Libbpf-1.0-migration-guide#direct-error-code-returning-libbpf_strict_direct_errs Signed-off-by: Dave Marchevsky Signed-off-by: Andrii Nakryiko Acked-by: Quentin Monnet Link: https://lore.kernel.org/bpf/20211101224357.2651181-2-davemarchevsky@fb.com commit c1d53cbd83b87bdce318f45d4fa5505c3008389f Author: Ville Syrjälä Date: Wed Oct 6 23:49:36 2021 +0300 drm/i915: Use intel_de_rmw() for icl combo phy programming Streamline the code by using intel_de_rmw(). Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211006204937.30774-16-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza commit d4e0f16325026eb001c48a6a619886048286cc42 Author: Ville Syrjälä Date: Wed Oct 6 23:49:35 2021 +0300 drm/i915: Use intel_de_rmw() for icl mg phy programming Streamline the code by using intel_de_rmw(). Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211006204937.30774-15-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza commit c86e187372da0967a82994fef7cecd4806cd2baa Author: Ville Syrjälä Date: Wed Oct 6 23:49:34 2021 +0300 drm/i915: Use intel_de_rmw() for tgl dkl phy programming Streamline the code by using intel_de_rmw(). Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211006204937.30774-14-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza commit 88a24415220990d41834838d54ba028399649ec9 Author: Ville Syrjälä Date: Wed Oct 6 23:49:33 2021 +0300 drm/i915: Enable per-lane drive settings for icl+ Now that the link buf_trans, link training, and the combo/mg/dkl/snps phy programming are all fixed up we can allow per-lane DP drive settings on icl+. Make it so. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211006204937.30774-13-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza commit 3e9cf8f055fcb42776156fa5f5eb9a5326f160c9 Author: Ville Syrjälä Date: Wed Oct 6 23:49:32 2021 +0300 drm/i915: Query the vswing levels per-lane for snps phy Prepare for per-lane drive settings by querying the desired vswing level per-lane. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211006204937.30774-12-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza commit a905ced613095c1ca406c179b2f0d44219d82381 Author: Ville Syrjälä Date: Wed Oct 6 23:49:31 2021 +0300 drm/i915: Query the vswing levels per-lane for tgl dkl phy Prepare for per-lane drive settings by querying the desired vswing level per-lane. Note that the code only does two loops, with each one writing the levels for two TX lanes. The register offsets also look a bit funny because each time through the loop we write to the exact same register offsets. The crucial bit is the HIP_INDEX_REG write that steers the same mmio window into different places. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211006204937.30774-11-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza commit 305448e55745dd4634272794c8c01edc872bcf63 Author: Ville Syrjälä Date: Wed Oct 6 23:49:30 2021 +0300 drm/i915: Query the vswing levels per-lane for icl mg phy Prepare for per-lane drive settings by querying the desired vswing level per-lane. Note that the code only does two loops, with each one writing the levels for two TX lanes. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211006204937.30774-10-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza commit 31e914a2307a29dfde8027cffa70292341bd379d Author: Ville Syrjälä Date: Wed Oct 6 23:49:29 2021 +0300 drm/i915: Query the vswing levels per-lane for icl combo phy Prepare for per-lane drive settings by querying the desired vswing level per-lane. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211006204937.30774-9-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza commit f20ca899a7c9e7ba48a5daec778607572fca5f6e Author: Ville Syrjälä Date: Wed Oct 6 23:49:28 2021 +0300 drm/i915: Stop using group access when progrmming icl combo phy TX Program each TX lane individually so that we can start to use per-lane drive settings. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211006204937.30774-8-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza commit 565edeee70db754e2e337ccd941f2dc10d276691 Author: Javier Martinez Canillas Date: Wed Nov 3 13:28:05 2021 +0100 drm/i915: Fix comment about modeset parameters The comment mentions that the KMS is enabled by default unless either the i915.modeset module parameter or vga_text_mode_force boot option are used. But the latter does not exist and instead the nomodeset option was meant. Signed-off-by: Javier Martinez Canillas Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20211103122809.1040754-2-javierm@redhat.com commit 9755f055f5121c40c481c1d5dd02a1c3fb0e7953 Author: Imre Deak Date: Mon Nov 1 20:35:51 2021 +0200 drm/i915: Restore memory mapping for DPT FBs across system suspend/resume At least during hibernation the DPT mappings are lost with all stolen memory content, so suspend/resume these mappings similarly to GGTT mappings. This fixes a problem where the restoring modeset during system resume fails with pipe faults if a tiled framebuffer was active before suspend. v2: Clarify the way restore works in intel_dpt_resume()'s Docbook entry. (Chris) Cc: Chris Wilson Cc: Ville Syrjälä Cc: Vunny Sodhi Reported-and-tested-by: Vunny Sodhi Signed-off-by: Imre Deak Reviewed-by: Chris Wilson Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211101183551.3580546-2-imre.deak@intel.com commit 8d2f683f1c49b3a3c56ab92437722eda7e85bac2 Author: Imre Deak Date: Mon Nov 1 20:35:50 2021 +0200 drm/i915: Factor out i915_ggtt_suspend_vm/i915_ggtt_resume_vm() Factor out functions that are needed by the next patch to suspend/resume the memory mappings for DPT FBs. No functional change, except reordering during suspend the ggtt->invalidate(ggtt) call wrt. atomic_set(&ggtt->vm.open, open) and mutex_unlock(&ggtt->vm.mutex). This shouldn't matter due to the i915 suspend sequence being single threaded. Cc: Chris Wilson Cc: Ville Syrjälä Signed-off-by: Imre Deak Reviewed-by: Chris Wilson Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211101183551.3580546-1-imre.deak@intel.com commit c29d6797228b673c5051d3ed7ef36ae66fe99ac7 Author: Christian König Date: Wed Sep 22 14:16:25 2021 +0200 drm/etnaviv: stop getting the excl fence separately here Just grab all fences in one go. Signed-off-by: Christian König Reviewed-by: Lucas Stach Link: https://patchwork.freedesktop.org/patch/msgid/20211028132630.2330-3-christian.koenig@amd.com commit c1f110eeb2a58df95bac8c11e5687c1761333952 Author: José Roberto de Souza Date: Tue Oct 19 17:23:53 2021 -0700 drm/i915: Rename GT_STEP to GRAPHICS_STEP As now graphics and media can have different steppings this patch is renaming all _GT_STEP macros to _GRAPHICS_STEP. Future platforms will properly choose between _MEDIA_STEP and _GRAPHICS_STEP for each new workaround. Cc: Matt Atwood Cc: Radhakrishna Sripada Signed-off-by: José Roberto de Souza Reviewed-by: Caz Yokoyama Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20211020002353.193893-3-jose.souza@intel.com commit e181fa1ddfd5fce939e419dce3e5baeb32125987 Author: José Roberto de Souza Date: Tue Oct 19 17:23:52 2021 -0700 drm/i915: Track media IP stepping separated from GT Graphics and media IPs can have different stepping so a new field is needed in intel_step_info. The next patch will take care of rename gt_step to graphics_step. Cc: Radhakrishna Sripada Cc: Matt Atwood Signed-off-by: José Roberto de Souza Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20211020002353.193893-2-jose.souza@intel.com commit a5b7ef27da60c90bad5b2d41af3aa82da480a188 Author: José Roberto de Souza Date: Tue Oct 19 17:23:51 2021 -0700 drm/i915: Add struct to hold IP version Adding a structure to standardize access to IP versioning as future platforms will have this information populated at runtime. The constant platform display version is not using this new struct but the runtime variant will definitely use it. Cc: Radhakrishna Sripada Cc: Matt Atwood Signed-off-by: José Roberto de Souza Reviewed-by: Caz Yokoyama Reviewed-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20211020002353.193893-1-jose.souza@intel.com commit 6c2e3bf68f3e5e5a647aa52be246d5f552d7496d Author: Alexander Aring Date: Tue Nov 2 15:17:24 2021 -0400 fs: dlm: filter user dlm messages for kernel locks This patch fixes the following crash by receiving a invalid message: [ 160.672220] ================================================================== [ 160.676206] BUG: KASAN: user-memory-access in dlm_user_add_ast+0xc3/0x370 [ 160.679659] Read of size 8 at addr 00000000deadbeef by task kworker/u32:13/319 [ 160.681447] [ 160.681824] CPU: 10 PID: 319 Comm: kworker/u32:13 Not tainted 5.14.0-rc2+ #399 [ 160.683472] Hardware name: Red Hat KVM/RHEL-AV, BIOS 1.14.0-1.module+el8.6.0+12648+6ede71a5 04/01/2014 [ 160.685574] Workqueue: dlm_recv process_recv_sockets [ 160.686721] Call Trace: [ 160.687310] dump_stack_lvl+0x56/0x6f [ 160.688169] ? dlm_user_add_ast+0xc3/0x370 [ 160.689116] kasan_report.cold.14+0x116/0x11b [ 160.690138] ? dlm_user_add_ast+0xc3/0x370 [ 160.690832] dlm_user_add_ast+0xc3/0x370 [ 160.691502] _receive_unlock_reply+0x103/0x170 [ 160.692241] _receive_message+0x11df/0x1ec0 [ 160.692926] ? rcu_read_lock_sched_held+0xa1/0xd0 [ 160.693700] ? rcu_read_lock_bh_held+0xb0/0xb0 [ 160.694427] ? lock_acquire+0x175/0x400 [ 160.695058] ? do_purge.isra.51+0x200/0x200 [ 160.695744] ? lock_acquired+0x360/0x5d0 [ 160.696400] ? lock_contended+0x6a0/0x6a0 [ 160.697055] ? lock_release+0x21d/0x5e0 [ 160.697686] ? lock_is_held_type+0xe0/0x110 [ 160.698352] ? lock_is_held_type+0xe0/0x110 [ 160.699026] ? ___might_sleep+0x1cc/0x1e0 [ 160.699698] ? dlm_wait_requestqueue+0x94/0x140 [ 160.700451] ? dlm_process_requestqueue+0x240/0x240 [ 160.701249] ? down_write_killable+0x2b0/0x2b0 [ 160.701988] ? do_raw_spin_unlock+0xa2/0x130 [ 160.702690] dlm_receive_buffer+0x1a5/0x210 [ 160.703385] dlm_process_incoming_buffer+0x726/0x9f0 [ 160.704210] receive_from_sock+0x1c0/0x3b0 [ 160.704886] ? dlm_tcp_shutdown+0x30/0x30 [ 160.705561] ? lock_acquire+0x175/0x400 [ 160.706197] ? rcu_read_lock_sched_held+0xa1/0xd0 [ 160.706941] ? rcu_read_lock_bh_held+0xb0/0xb0 [ 160.707681] process_recv_sockets+0x32/0x40 [ 160.708366] process_one_work+0x55e/0xad0 [ 160.709045] ? pwq_dec_nr_in_flight+0x110/0x110 [ 160.709820] worker_thread+0x65/0x5e0 [ 160.710423] ? process_one_work+0xad0/0xad0 [ 160.711087] kthread+0x1ed/0x220 [ 160.711628] ? set_kthread_struct+0x80/0x80 [ 160.712314] ret_from_fork+0x22/0x30 The issue is that we received a DLM message for a user lock but the destination lock is a kernel lock. Note that the address which is trying to derefence is 00000000deadbeef, which is in a kernel lock lkb->lkb_astparam, this field should never be derefenced by the DLM kernel stack. In case of a user lock lkb->lkb_astparam is lkb->lkb_ua (memory is shared by a union field). The struct lkb_ua will be handled by the DLM kernel stack but on a kernel lock it will contain invalid data and ends in most likely crashing the kernel. It can be reproduced with two cluster nodes. node 2: dlm_tool join test echo "862 fooobaar 1 2 1" > /sys/kernel/debug/dlm/test_locks echo "862 3 1" > /sys/kernel/debug/dlm/test_waiters node 1: dlm_tool join test python: foo = DLM(h_cmd=3, o_nextcmd=1, h_nodeid=1, h_lockspace=0x77222027, \ m_type=7, m_flags=0x1, m_remid=0x862, m_result=0xFFFEFFFE) newFile = open("/sys/kernel/debug/dlm/comms/2/rawmsg", "wb") newFile.write(bytes(foo)) Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 63eab2b00bcff620682e8570367458c9619a9970 Author: Alexander Aring Date: Tue Nov 2 15:17:23 2021 -0400 fs: dlm: add lkb waiters debugfs functionality This patch adds functionality to put a lkb to the waiters state. It can be useful to combine this feature with the "rawmsg" debugfs functionality. It will bring the DLM lkb into a state that a message will be parsed by the kernel. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 5054e79de99984b4f39a073534526bc7c827b1e0 Author: Alexander Aring Date: Tue Nov 2 15:17:22 2021 -0400 fs: dlm: add lkb debugfs functionality This patch adds functionality to add an lkb during runtime. This is a highly debugging feature only, wrong input can crash the kernel. It is a early state feature as well. The goal is to provide a user interface for manipulate dlm state and combine it with the rawmsg feature. It is debugfs functionality, we don't care about UAPI breakage. Even it's possible to add lkb's/rsb's which could never be exists in such wat by using normal DLM operation. The user of this interface always need to think before using this feature, not every crash which happens can really occur during normal dlm operation. Future there should be more functionality to add a more realistic lkb which reflects normal DLM state inside the kernel. For now this is enough. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 75d25ffe380a01b88cb3bf604a6b8dc5a562a2e5 Author: Alexander Aring Date: Tue Nov 2 15:17:21 2021 -0400 fs: dlm: allow create lkb with specific id range This patch adds functionality to add a lkb with a specific id range. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 9af5b8f0ead7cd90161b0555ed8e85ee38f79fa5 Author: Alexander Aring Date: Tue Nov 2 15:17:20 2021 -0400 fs: dlm: add debugfs rawmsg send functionality This patch adds a dlm functionality to send a raw dlm message to a specific cluster node. This raw message can be build by user space and send out by writing the message to "rawmsg" dlm debugfs file. There is a in progress scapy dlm module which provides a easy build of DLM messages in user space. For example: DLM(h_cmd=3, o_nextcmd=1, h_nodeid=1, h_lockspace=0xe4f48a18, ...) The goal is to provide an easy reproducable state to crash DLM or to fuzz the DLM kernel stack if there are possible ways to crash it. Note: that if the sequence number is zero and dlm version is not set to 3.1 the kernel will automatic will set a right sequence number, otherwise DLM stack testing is not possible. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 5c16febbc19bb463bfb8e80cb5b24ec6ff1a439f Author: Alexander Aring Date: Tue Nov 2 15:17:19 2021 -0400 fs: dlm: let handle callback data as void This patch changes the dlm_lowcomms_new_msg() function pointer private data from "struct mhandle *" to "void *" to provide different structures than just "struct mhandle". Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 3cb5977c5214c219b2859f926ed547480d53fdde Author: Alexander Aring Date: Tue Nov 2 15:17:18 2021 -0400 fs: dlm: ls_count busy wait to event based wait This patch changes the ls_count busy wait to use atomic counter values and wait_event() to wait until ls_count reach zero. It will slightly reduce the number of holding lslist_lock. At remove lockspace we need to retry the wait because it a lockspace get could interefere between wait_event() and holding the lock which deletes the lockspace list entry. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 164d88abd7608e869b7617d5ff8893344fdda759 Author: Alexander Aring Date: Tue Nov 2 15:17:17 2021 -0400 fs: dlm: requestqueue busy wait to event based wait This patch changes the requestqueue busy waiting algorithm to use atomic counter values and wait_event() to wait until the requestqueue is empty. It will slightly reduce the number of holding ls_requestqueue_mutex mutex. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 92732376fd29462b502f41486bcef55f49c5713e Author: Alexander Aring Date: Tue Nov 2 15:17:16 2021 -0400 fs: dlm: trace socket handling This patch adds tracepoints for dlm socket receive and send functionality. We can use it to track how much data was send or received to or from a specific nodeid. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit f1d3b8f91d965c4fd900ac5dd06240cc9df0c7a7 Author: Alexander Aring Date: Tue Nov 2 15:17:15 2021 -0400 fs: dlm: initial support for tracepoints This patch adds initial support for dlm tracepoints. It will introduce tracepoints to dlm main functionality dlm_lock()/dlm_unlock() and their complete ast() callback or blocking bast() callback. The lock/unlock functionality has a start and end tracepoint, this is because there exists a race in case if would have a tracepoint at the end position only the complete/blocking callbacks could occur before. To work with eBPF tracing and using their lookup hash functionality there could be problems that an entry was not inserted yet. However use the start functionality for hash insert and check again in end functionality if there was an dlm internal error so there is no ast callback. In further it might also that locks with local masters will occur those callbacks immediately so we must have such functionality. I did not make everything accessible yet, although it seems eBPF can be used to access a lot of internal datastructures if it's aware of the struct definitions of the running kernel instance. We still can change it, if you do eBPF experiments e.g. time measurements between lock and callback functionality you can simple use the local lkb_id field as hash value in combination with the lockspace id if you have multiple lockspaces. Otherwise you can simple use trace-cmd for some functionality, e.g. `trace-cmd record -e dlm` and `trace-cmd report` afterwards. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 2f05ec4327ffaa34877de67fc5bb5eb3ab3767f0 Author: Alexander Aring Date: Tue Nov 2 15:17:14 2021 -0400 fs: dlm: make dlm_callback_resume quite This patch makes dlm_callback_resume info printout less noisy by accumulate all callback queues into one printout not in 25 times steps. It seems this printout became lately quite noisy in relationship with gfs2. Before: [241767.849302] dlm: bin: dlm_callback_resume 25 [241767.854846] dlm: bin: dlm_callback_resume 25 [241767.860373] dlm: bin: dlm_callback_resume 25 ... [241767.865920] dlm: bin: dlm_callback_resume 25 [241767.871352] dlm: bin: dlm_callback_resume 25 [241767.876733] dlm: bin: dlm_callback_resume 25 After the patch: [ 385.485728] dlm: gfs2: dlm_callback_resume 175 if zero it will not be printed out. Reported-by: Barry Marson Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit e10249b1902d3b0b71e99f518a695c2c39ab4fe6 Author: Alexander Aring Date: Tue Nov 2 15:17:13 2021 -0400 fs: dlm: use dlm_recovery_stopped in condition This patch will change to evaluate the dlm_recovery_stopped() in the condition of the if branch instead fetch it before evaluating the condition. As this is an atomic test-set operation it should be evaluated in the condition itself. Reported-by: Andreas Gruenbacher Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 3e9736713d0cb2877b11ec7185b231bba7b21936 Author: Alexander Aring Date: Tue Nov 2 15:17:12 2021 -0400 fs: dlm: use dlm_recovery_stopped instead of test_bit This patch will change to use dlm_recovery_stopped() which is the dlm way to check if the LSFL_RECOVER_STOP flag in ls_flags by using the helper. It is an atomic operation but the check is still as before to fetch the value if ls_recover_lock is held. There might be more further investigations if the value can be changed afterwards and if it has any side effects. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 658bd576f95ed597e519cdadf1c86ac87c17aea5 Author: Alexander Aring Date: Tue Nov 2 15:17:11 2021 -0400 fs: dlm: move version conversion to compile time This patch moves version conversion to little endian from a runtime variable to compile time constant. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit fe93367541bcedaba1dd5cb9cf138eec0267ea56 Author: Alexander Aring Date: Tue Nov 2 15:17:10 2021 -0400 fs: dlm: remove check SCTP is loaded message Since commit 764ff4011424 ("fs: dlm: auto load sctp module") we try load the sctp module before we try to create a sctp kernel socket. That a socket creation fails now has more likely other reasons. This patch removes the part of error to load the sctp module and instead printout the error code. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 1aafd9c231919dea9b10e654107e24d5c553c60d Author: Alexander Aring Date: Tue Nov 2 15:17:09 2021 -0400 fs: dlm: debug improvements print nodeid This patch improves the debug output for midcomms layer by also printing out the nodeid where users counter belongs to. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit bb6866a5bdc5ff0236147c01394f6a264978a16c Author: Alexander Aring Date: Tue Nov 2 15:17:08 2021 -0400 fs: dlm: fix small lockspace typo This patch fixes a typo from lockspace to lockspace. Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit dea450c90f463de57d7f351711a6ac7e89090843 Author: Alexander Aring Date: Tue Nov 2 15:17:07 2021 -0400 fs: dlm: remove obsolete INBUF define This patch removes an obsolete define for some length for an temporary buffer which is not being used anymore. The use of this define is not necessary anymore since commit 4798cbbfbd00 ("fs: dlm: rework receive handling"). Signed-off-by: Alexander Aring Signed-off-by: David Teigland commit 258f56d11bbbf39df5bc5faf0119d28be528f27d Author: Joseph Hwang Date: Tue Nov 2 15:19:29 2021 +0800 Bluetooth: aosp: Support AOSP Bluetooth Quality Report This patch adds the support of the AOSP Bluetooth Quality Report (BQR) events. Multiple vendors have supported the AOSP Bluetooth Quality Report. When a Bluetooth controller supports the capability, it can enable the aosp capability through hci_set_aosp_capable. Then hci_core will set up the hdev->aosp_set_quality_report callback through aosp_do_open if the controller responds to support the quality report capability. Note that Intel also supports a distinct telemetry quality report specification. Intel sets up the hdev->set_quality_report callback in the btusb driver module. Reviewed-by: Miao-chen Chou Signed-off-by: Joseph Hwang Signed-off-by: Marcel Holtmann commit 749a6c594203b0e9ac59e3d8da492a8ac6a80510 Author: Joseph Hwang Date: Tue Nov 2 15:19:28 2021 +0800 Bluetooth: Add struct of reading AOSP vendor capabilities This patch adds the struct of reading AOSP vendor capabilities. New capabilities are added incrementally. Note that the version_supported octets will be used to determine whether a capability has been defined for the version. Signed-off-by: Joseph Hwang Signed-off-by: Marcel Holtmann commit e6d6f689435aaebc2e407026d9fdfc2d89bd7902 Author: Imre Deak Date: Wed Oct 27 01:51:05 2021 +0300 drm/i915/adlp/fb: Remove restriction on CCS AUX plane strides As opposed to other GEN12 platforms ADLP provides a way to program the stride of CCS surfaces independently of the main surface stride (within the corresponding limit of the preceding and succeeding power-of-two values of the main surface stride). Using this HW feature we can remove the POT stride restriction on CCS surfaces, making the ADLP CCS FB uAPI (FB modifiers) identical to that of TGL. The HW makes the CCS stride flexible programming possible by deriving the stride from the value programmed to the PLANE_STRIDE register. After that the HW rounds up this value to the next power-of-two value and uses this for walking the pages of the main surface mapped to GTT/DPT. To align with the above scheme, introduce a scanout_stride view parameter which will be programmed to the PLANE_STRIDE register and use the mapping_stride view param to store the POT aligned value of the same. By requiring userspace to pass in FBs with a CCS stride that aligns with the main surface stride (matching the requirement of all GEN12 platforms), the scanout_stride will be the userspace main surface stride and the mapping_stride will be the POT rounded value of the same. Cc: Ville Syrjälä Cc: Juha-Pekka Heikkila Cc: Nanley G Chery Cc: Sameer Lattannavar Signed-off-by: Imre Deak Reviewed-by: Juha-Pekka Heikkila Link: https://patchwork.freedesktop.org/patch/msgid/20211026225105.2783797-8-imre.deak@intel.com commit 17749ece0142c7c368834b6fb35d86bafecef69f Author: Imre Deak Date: Wed Oct 27 01:51:04 2021 +0300 drm/i915/adlp/fb: Remove restriction on semiplanar UV plane offset Since the surfaces of tiled FBs on ADLP are remapped it's pointless to require an alignment in the allocated object. The necessary tile-row alignment (to be programmed to the surface start register) will be ensured later when flipping to the FB. Signed-off-by: Imre Deak Reviewed-by: Juha-Pekka Heikkila Link: https://patchwork.freedesktop.org/patch/msgid/20211026225105.2783797-7-imre.deak@intel.com commit be6c1dd5ac074defdfb1471d28e0bb6eedfe3ae5 Author: Imre Deak Date: Wed Oct 27 01:51:03 2021 +0300 drm/i915/fb: Rename i915_color_plane_view::stride to mapping_stride The next patch needs to distinguish between a view's mapping and scanout stride. Rename the current stride parameter to mapping_stride with the script below. mapping_stride will keep the same meaning as stride had on all platforms so far, while the meaning of it will change on ADLP. No functional changes. @@ identifier intel_fb_view; identifier i915_color_plane_view; identifier color_plane; expression e; type T; @@ struct intel_fb_view { ... struct i915_color_plane_view { ... - T stride; + T mapping_stride; ... } color_plane[e]; ... }; @@ struct i915_color_plane_view pv; @@ pv. - stride + mapping_stride @@ struct i915_color_plane_view *pvp; @@ pvp-> - stride + mapping_stride Signed-off-by: Imre Deak Reviewed-by: Juha-Pekka Heikkila Link: https://patchwork.freedesktop.org/patch/msgid/20211026225105.2783797-6-imre.deak@intel.com commit 96837e8beeefe5181adabab2da6e08c51dc0cf5d Author: Imre Deak Date: Wed Oct 27 01:51:02 2021 +0300 drm/i915/adlp/fb: Fix remapping of linear CCS AUX surfaces During remapping CCS FBs the CCS AUX surface mapped size and offset->x,y coordinate calculations assumed a tiled layout. This works as long as the CCS surface height is aligned to 64 lines (ensuring a 4k bytes CCS surface tile layout). However this alignment is not required by the HW (and the driver doesn't enforces it either). Add the remapping logic required to remap the pages of CCS surfaces without the above alignment, assuming the natural linear layout of the CCS surface (vs. tiled main surface layout). Cc: Juha-Pekka Heikkila Cc: Ville Syrjälä Fixes: 3d1adc3d64cf ("drm/i915/adlp: Add support for remapping CCS FBs") Signed-off-by: Imre Deak Reviewed-by: Juha-Pekka Heikkila Link: https://patchwork.freedesktop.org/patch/msgid/20211026225105.2783797-5-imre.deak@intel.com commit dd5ba4ff4e924b14cb3c91335636baa6bacaf817 Author: Imre Deak Date: Wed Oct 27 01:51:01 2021 +0300 drm/i915/fb: Factor out functions to remap contiguous FB obj pages Factor out functions needed to map contiguous FB obj pages to a GTT/DPT VMA view in the next patch. While at it s/4096/I915_GTT_PAGE_SIZE/ in add_padding_pages(). No functional changes. v2: s/4096/I915_GTT_PAGE_SIZE/ (Matthew) Signed-off-by: Imre Deak Reviewed-by: Matthew Auld Reviewed-by: Juha-Pekka Heikkila Link: https://patchwork.freedesktop.org/patch/msgid/20211026225105.2783797-4-imre.deak@intel.com commit 6b6636e17649d75b4d0cc55d3dff9e44511a442a Author: Imre Deak Date: Wed Oct 27 01:51:00 2021 +0300 drm/i915/adlp/fb: Prevent the mapping of redundant trailing padding NULL pages So far the remapped view size in GTT/DPT was padded to the next aligned offset unnecessarily after the last color plane with an unaligned size. Remove the unnecessary padding. Cc: Juha-Pekka Heikkila Fixes: 3d1adc3d64cf ("drm/i915/adlp: Add support for remapping CCS FBs") Signed-off-by: Imre Deak Reviewed-by: Juha-Pekka Heikkila Link: https://patchwork.freedesktop.org/patch/msgid/20211026225105.2783797-3-imre.deak@intel.com commit 2ee5ef9c934ad26376c9282171e731e6c0339815 Author: Imre Deak Date: Wed Oct 27 01:50:59 2021 +0300 drm/i915/fb: Fix rounding error in subsampled plane size calculation For NV12 FBs with odd main surface tile-row height the CCS surface height was incorrectly calculated 1 less than the actual value. Fix this by rounding up the result of divison. For consistency do the same for the CCS surface width calculation. Fixes: b3e57bccd68a ("drm/i915/tgl: Gen-12 render decompression") Signed-off-by: Imre Deak Reviewed-by: Juha-Pekka Heikkila Link: https://patchwork.freedesktop.org/patch/msgid/20211026225105.2783797-2-imre.deak@intel.com commit 23c50968399f270098f1fd0bc1ad83244dafb659 Author: Simon Ser Date: Mon Oct 18 08:47:31 2021 +0000 i915/display/dp: send a more fine-grained link-status uevent When link-status changes, send a hotplug uevent which contains the connector ID. That way, user-space can more easily figure out that only this connector has been updated. Changes in v4: avoid sending two uevents (Ville) Signed-off-by: Simon Ser Reviewed-by: Ville Syrjälä Acked-by: Pekka Paalanen Link: https://patchwork.freedesktop.org/patch/msgid/20211018084707.32253-7-contact@emersion.fr commit d35d4dbcc80dfbd58a3ef18cee2b92f49a6a92c4 Author: Simon Ser Date: Mon Oct 18 08:47:30 2021 +0000 drm/probe-helper: use drm_kms_helper_connector_hotplug_event If an hotplug event only updates a single connector, use drm_kms_helper_connector_hotplug_event instead of drm_kms_helper_hotplug_event. Changes in v4: - Simplify loop logic (Ville, Sam) - Update drm_connector_helper_hpd_irq_event (Maxime) Signed-off-by: Simon Ser Cc: Ville Syrjala Reviewed-by: Maxime Ripard Reviewed-by: Sam Ravnborg Acked-by: Pekka Paalanen Link: https://patchwork.freedesktop.org/patch/msgid/20211018084707.32253-6-contact@emersion.fr commit fc320a6f64044f12128519ca98404b641340d136 Author: Simon Ser Date: Mon Oct 18 08:47:28 2021 +0000 amdgpu: use drm_kms_helper_connector_hotplug_event When updating a single connector, use drm_kms_helper_connector_hotplug_event instead of drm_kms_helper_hotplug_event. Signed-off-by: Simon Ser Reviewed-by: Harry Wentland Acked-by: Pekka Paalanen Link: https://patchwork.freedesktop.org/patch/msgid/20211018084707.32253-5-contact@emersion.fr commit ad935754dd865ffe9be39e366071275c99366285 Author: Simon Ser Date: Mon Oct 18 08:47:27 2021 +0000 drm/connector: use drm_sysfs_connector_hotplug_event In drm_connector_register, use drm_sysfs_connector_hotplug_event instead of drm_sysfs_hotplug_event, because the hotplug event only updates a single connector. Signed-off-by: Simon Ser Reviewed-by: Sam Ravnborg Acked-by: Harry Wentland Acked-by: Pekka Paalanen Link: https://patchwork.freedesktop.org/patch/msgid/20211018084707.32253-4-contact@emersion.fr commit 710074bb8ab0efac425a43473b8a3e057d645f82 Author: Simon Ser Date: Mon Oct 18 08:47:26 2021 +0000 drm/probe-helper: add drm_kms_helper_connector_hotplug_event This function is the same as drm_kms_helper_hotplug_event, but takes a connector instead of a device. Signed-off-by: Simon Ser Reviewed-by: Sam Ravnborg Acked-by: Harry Wentland Acked-by: Pekka Paalanen Link: https://patchwork.freedesktop.org/patch/msgid/20211018084707.32253-3-contact@emersion.fr commit 0d6a8c5e96833f644b91528de6a3a4398214fb9c Author: Simon Ser Date: Mon Oct 18 08:47:25 2021 +0000 drm/sysfs: introduce drm_sysfs_connector_hotplug_event This function sends a hotplug uevent with a CONNECTOR property. Signed-off-by: Simon Ser Reviewed-by: Sam Ravnborg Acked-by: Harry Wentland Acked-by: Pekka Paalanen Link: https://patchwork.freedesktop.org/patch/msgid/20211018084707.32253-2-contact@emersion.fr commit 112a87c48e83cf226325735009712b515f48c495 Author: Kai Vehmanen Date: Thu Oct 21 13:59:15 2021 +0300 drm/i915/display: program audio CDCLK-TS for keepalives XE_LPD display adds support for display audio codec keepalive feature. This feature works also when display codec is in D3 state and the audio link is off (BCLK off). To enable this functionality, display driver must update the AUD_TS_CDCLK_M/N registers whenever CDCLK is changed. Actual timestamps are generated only when the audio codec driver specifically enables the KeepAlive (KAE) feature. This patch adds new hooks to intel_set_cdclk() in order to inform display audio driver when CDCLK change is started and when it is complete. Bspec: 53679 Signed-off-by: Kai Vehmanen Reviewed-by: Uma Shankar Acked-by: Ville Syrjälä Signed-off-by: Uma Shankar Link: https://patchwork.freedesktop.org/patch/msgid/20211021105915.4128635-1-kai.vehmanen@linux.intel.com commit 57d9898bee4fa8afcde83c158b441cef634ee47c Author: Matthew Auld Date: Fri Oct 29 13:21:37 2021 +0100 drm/i915/dmabuf: drop the flush on discrete We were overzealous here; even though discrete is non-LLC, it should still be always coherent. v2(Thomas & Daniel) - Be extra cautious and limit to DG1 - Add some more commentary Signed-off-by: Matthew Auld Cc: Thomas Hellström Cc: Daniel Vetter Reviewed-by: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20211029122137.3484203-1-matthew.auld@intel.com commit 068b1bd0925387ff3a2900726a681ce697e4c1a9 Author: Matthew Auld Date: Wed Oct 27 17:18:13 2021 +0100 drm/i915: stop setting cache_dirty on discrete Should not be needed. Even with non-coherent display, we should be using device local-memory there, and not system memory. v2: also add a warning in i915_gem_clflush_object Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström #v1 Link: https://patchwork.freedesktop.org/patch/msgid/20211027161813.3094681-4-matthew.auld@intel.com commit 2ea6ec76430b87c49f3d82e284722dfbdf137bb9 Author: Matthew Auld Date: Wed Oct 27 17:18:12 2021 +0100 drm/i915: move cpu_write_needs_clflush Move it next to its partner in crime; gpu_write_needs_clflush. For better readability lets keep gpu vs cpu at least in the same file. Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20211027161813.3094681-3-matthew.auld@intel.com commit c52b3b489783b3b244c8134204d542a4d07030b7 Author: Matthew Auld Date: Wed Oct 27 17:18:11 2021 +0100 drm/i915/clflush: disallow on discrete We seem to have an unfortunate issue where we arrive from: i915_gem_object_flush_if_display+0x86/0xd0 [i915] intel_user_framebuffer_dirty+0x1a/0x50 [i915] drm_mode_dirtyfb_ioctl+0xfb/0x1b0 which can be before the pages are populated(and pinned for display), and so i915_gem_object_has_struct_page() might still return true, as per the ttm backend. We could re-order the later get_pages() call here, but since on discrete everything should already be coherent, with the exception of the display engine, and even there display surfaces must be allocated in device local-memory anyway, so there should in theory be no conceivable reason to ever call i915_gem_clflush_object() on discrete. References: https://gitlab.freedesktop.org/drm/intel/-/issues/4320 Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20211027161813.3094681-2-matthew.auld@intel.com commit 3ea355b234d7d3e543b89e55c66d57db50ef1581 Author: Matthew Auld Date: Wed Oct 27 17:18:10 2021 +0100 drm/i915/clflush: fixup handling of cache_dirty In theory if clflush_work_create() somehow fails here, and we don't yet have mm.pages populated then we end up resetting cache_dirty, which is likely wrong, since that will potentially skip the flush-on-acquire, if it was needed. It looks like intel_user_framebuffer_dirty() can arrive here before the pages are populated. v2(Thomas): - Move setting cache_dirty out of the async portion, also add a comment for why that should still be safe. v3: - Add Thomas' irc r-b Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20211027161813.3094681-1-matthew.auld@intel.com commit 557804a81d256b15952dcd179280ede92a5bfae1 Author: Michal Simek Date: Fri Oct 15 10:29:14 2021 +0200 dt-bindings: timer: cadence_ttc: Add power-domains Describe optional power-domain property to fix dts_check warnings. The similar change was done by commit 8c0aa567146b ("dt-bindings: gpio: fsl-imx-gpio: Add power-domains"). Signed-off-by: Michal Simek Acked-by: Rob Herring Link: https://lore.kernel.org/r/cc655a72b20790f6d7408b1aaf81c4bf878aafb4.1634286552.git.michal.simek@xilinx.com Signed-off-by: Daniel Lezcano commit f16a491c65d9eb19398b25aefc10c2d3313d17b3 Author: Luiz Augusto von Dentz Date: Mon Nov 1 15:14:41 2021 -0700 Bluetooth: hci_sync: Fix not setting adv set duration 10bbffa3e88e attempted to fix the use of rotation duration as advertising duration but it didn't change the if condition which still uses the duration instead of the timeout. Fixes: 10bbffa3e88e ("Bluetooth: Fix using advertising instance duration as timeout") Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 27592ca1fadf2d2a44bb24ecc5da604fd840d633 Author: Luiz Augusto von Dentz Date: Mon Nov 1 09:52:40 2021 -0700 Bluetooth: hci_sync: Fix missing static warnings This fixes the following warnings: >> net/bluetooth/hci_sync.c:1333:5: warning: no previous prototype for 'hci_scan_disable_sync' [-Wmissing-prototypes] 1333 | int hci_scan_disable_sync(struct hci_dev *hdev, bool rpa_le_conn) | ^~~~~~~~~~~~~~~~~~~~~ >> net/bluetooth/hci_sync.c:1762:5: warning: no previous prototype for 'hci_passive_scan_sync' [-Wmissing-prototypes] 1762 | int hci_passive_scan_sync(struct hci_dev *hdev) | ^~~~~~~~~~~~~~~~~~~~~ Fixes: e8907f76544f ("Bluetooth: hci_sync: Make use of hci_cmd_sync_queue set 3") Reported-by: kernel test robot Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 0826edb6a5e5b32d38b89d2df3d74c4dac8828dc Author: José Roberto de Souza Date: Fri Oct 29 13:24:32 2021 -0700 drm/i915/display: Check async flip state of every crtc and plane once For every crtc in state, intel_atomic_check_async() was checking all the crtc and plane states again. v2: comparing pipe ids instead of crtc pointers when iterating over planes Cc: Karthik B S Cc: Vandita Kulkarni Cc: Ville Syrjälä Signed-off-by: José Roberto de Souza Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211029202432.140745-1-jose.souza@intel.com commit cad7109a2b5e7d48466b77728aa16ce55415eea0 Author: Thomas Hellström Date: Mon Nov 1 13:24:44 2021 +0100 drm/i915: Introduce refcounted sg-tables As we start to introduce asynchronous failsafe object migration, where we update the object state and then submit asynchronous commands we need to record what memory resources are actually used by various part of the command stream. Initially for three purposes: 1) Error capture. 2) Asynchronous migration error recovery. 3) Asynchronous vma bind. At the time where these happens, the object state may have been updated to be several migrations ahead and object sg-tables discarded. In order to make it possible to keep sg-tables with memory resource information for these operations, introduce refcounted sg-tables that aren't freed until the last user is done with them. The alternative would be to reference information sitting on the corresponding ttm_resources which typically have the same lifetime as these refcountes sg_tables, but that leads to other awkward constructs: Due to the design direction chosen for ttm resource managers that would lead to diamond-style inheritance, the LMEM resources may sometimes be prematurely freed, and finally the subclassed struct ttm_resource would have to bleed into the asynchronous vma bind code. v3: - Address a number of style issues (Matthew Auld) v4: - Dont check for st->sgl being NULL in i915_ttm_tt__shmem_unpopulate(), that should never happen. (Matthew Auld) v5: - Fix a Potential double-free (Matthew Auld) Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20211101122444.114607-1-thomas.hellstrom@linux.intel.com commit 542cff7893a37445f98ece26aeb3c9c1055e9ea4 Author: Andrey Grodzovsky Date: Thu Oct 28 12:24:03 2021 -0400 drm/sched: Avoid lockdep spalt on killing a processes Probelm: Singlaning one sched fence from within another's sched fence singal callback generates lockdep splat because the both have same lockdep class of their fence->lock Fix: Fix bellow stack by rescheduling to irq work of signaling and killing of jobs that left when entity is killed. [11176.741181] dump_stack+0x10/0x12 [11176.741186] __lock_acquire.cold+0x208/0x2df [11176.741197] lock_acquire+0xc6/0x2d0 [11176.741204] ? dma_fence_signal+0x28/0x80 [11176.741212] _raw_spin_lock_irqsave+0x4d/0x70 [11176.741219] ? dma_fence_signal+0x28/0x80 [11176.741225] dma_fence_signal+0x28/0x80 [11176.741230] drm_sched_fence_finished+0x12/0x20 [gpu_sched] [11176.741240] drm_sched_entity_kill_jobs_cb+0x1c/0x50 [gpu_sched] [11176.741248] dma_fence_signal_timestamp_locked+0xac/0x1a0 [11176.741254] dma_fence_signal+0x3b/0x80 [11176.741260] drm_sched_fence_finished+0x12/0x20 [gpu_sched] [11176.741268] drm_sched_job_done.isra.0+0x7f/0x1a0 [gpu_sched] [11176.741277] drm_sched_job_done_cb+0x12/0x20 [gpu_sched] [11176.741284] dma_fence_signal_timestamp_locked+0xac/0x1a0 [11176.741290] dma_fence_signal+0x3b/0x80 [11176.741296] amdgpu_fence_process+0xd1/0x140 [amdgpu] [11176.741504] sdma_v4_0_process_trap_irq+0x8c/0xb0 [amdgpu] [11176.741731] amdgpu_irq_dispatch+0xce/0x250 [amdgpu] [11176.741954] amdgpu_ih_process+0x81/0x100 [amdgpu] [11176.742174] amdgpu_irq_handler+0x26/0xa0 [amdgpu] [11176.742393] __handle_irq_event_percpu+0x4f/0x2c0 [11176.742402] handle_irq_event_percpu+0x33/0x80 [11176.742408] handle_irq_event+0x39/0x60 [11176.742414] handle_edge_irq+0x93/0x1d0 [11176.742419] __common_interrupt+0x50/0xe0 [11176.742426] common_interrupt+0x80/0x90 Signed-off-by: Andrey Grodzovsky Suggested-by: Daniel Vetter Suggested-by: Christian König Tested-by: Christian König Reviewed-by: Christian König Link: https://www.spinics.net/lists/dri-devel/msg321250.html commit 22f9ba7fee107903ec9a4f8f150ced196f6a1615 Author: Yang Guang Date: Thu Oct 28 01:04:51 2021 +0000 ath9k: use swap() to make code cleaner Using swap() make it more readable. Reported-by: Zeal Robot Signed-off-by: Yang Guang Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211028010451.7754-1-yang.guang5@zte.com.cn commit 588b45c88ae130fe373a8c50edaf54735c3f4fe3 Author: Bryan O'Donoghue Date: Thu Oct 28 00:25:29 2021 +0100 wcn36xx: Indicate beacon not connection loss on MISSED_BEACON_IND Firmware can trigger a missed beacon indication, this is not the same as a lost signal. Flag to Linux the missed beacon and let the WiFi stack decide for itself if the link is up or down by sending its own probe to determine this. We should only be signalling the link is lost when the firmware indicates Fixes: 8e84c2582169 ("wcn36xx: mac80211 driver for Qualcomm WCN3660/WCN3680 hardware") Signed-off-by: Bryan O'Donoghue Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211027232529.657764-1-bryan.odonoghue@linaro.org commit 8f1ba8b0ee2679f0b3d22d2a5c1bc70c436fd872 Author: Benjamin Li Date: Wed Oct 27 10:03:05 2021 -0700 wcn36xx: ensure pairing of init_scan/finish_scan and start_scan/end_scan An SMD capture from the downstream prima driver on WCN3680B shows the following command sequence for connected scans: - init_scan_req - start_scan_req, channel 1 - end_scan_req, channel 1 - start_scan_req, channel 2 - ... - end_scan_req, channel 3 - finish_scan_req - init_scan_req - start_scan_req, channel 4 - ... - end_scan_req, channel 6 - finish_scan_req - ... - end_scan_req, channel 165 - finish_scan_req Upstream currently never calls wcn36xx_smd_end_scan, and in some cases[1] still sends finish_scan_req twice in a row or before init_scan_req. A typical connected scan looks like this: - init_scan_req - start_scan_req, channel 1 - finish_scan_req - init_scan_req - start_scan_req, channel 2 - ... - start_scan_req, channel 165 - finish_scan_req - finish_scan_req This patch cleans up scanning so that init/finish and start/end are always paired together and correctly nested. - init_scan_req - start_scan_req, channel 1 - end_scan_req, channel 1 - finish_scan_req - init_scan_req - start_scan_req, channel 2 - end_scan_req, channel 2 - ... - start_scan_req, channel 165 - end_scan_req, channel 165 - finish_scan_req Note that upstream will not do batching of 3 active-probe scans before returning to the operating channel, and this patch does not change that. To match downstream in this aspect, adjust IEEE80211_PROBE_DELAY and/or the 125ms max off-channel time in ieee80211_scan_state_decision. [1]: commit d195d7aac09b ("wcn36xx: Ensure finish scan is not requested before start scan") addressed one case of finish_scan_req being sent without a preceding init_scan_req (the case of the operating channel coinciding with the first scan channel); two other cases are: 1) if SW scan is started and aborted immediately, without scanning any channels, we send a finish_scan_req without ever sending init_scan_req, and 2) as SW scan logic always returns us to the operating channel before calling wcn36xx_sw_scan_complete, finish_scan_req is always sent twice at the end of a SW scan Fixes: 8e84c2582169 ("wcn36xx: mac80211 driver for Qualcomm WCN3660/WCN3680 hardware") Signed-off-by: Benjamin Li Tested-by: Bryan O'Donoghue Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211027170306.555535-4-benl@squareup.com commit f02e1cc2a84693a649d94a7584291d88f31fd5fa Author: Benjamin Li Date: Wed Oct 27 10:03:04 2021 -0700 wcn36xx: implement flush op to speed up connected scan Without ieee80211_ops->flush implemented to empty HW queues, mac80211 will do a 100ms dead wait after stopping SW queues, before leaving the operating channel to resume a software connected scan[1]. (see ieee80211_scan_state_resume) This wait is correctly included in the calculation for whether or not we've exceeded max off-channel time, as it occurs after sending the null frame with PS bit set. Thus, with 125 ms max off-channel time we only have 25 ms of scan time, which technically isn't even enough to scan one channel (although mac80211 always scans at least one channel per off- channel window). Moreover, for passive probes we end up spending at least 100 ms + 111 ms (IEEE80211_PASSIVE_CHANNEL_TIME) "off-channel"[2], which exceeds the listen interval of 200 ms that we provide in our association request frame. That's technically out-of-spec. [1]: Until recently, wcn36xx performed software (rather than FW-offloaded) scanning when 5GHz channels are requested. This apparent limitation is now resolved -- see commit 1395f8a6a4d5 ("wcn36xx: Enable hardware scan offload for 5Ghz band"). [2]: in quotes because about 100 ms of it is still on-channel but with PS set Signed-off-by: Benjamin Li Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211027170306.555535-3-benl@squareup.com commit df008741dd62bd3bc8733fe568415fb01b3e65c5 Author: Benjamin Li Date: Wed Oct 27 10:03:03 2021 -0700 wcn36xx: add debug prints for sw_scan start/complete Add some MAC debug prints for more easily demarcating a software scan when parsing logs. Signed-off-by: Benjamin Li Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211027170306.555535-2-benl@squareup.com commit 27deb0f1570b0dbf465443857ce10ac6443d141d Author: Christian Lamparter Date: Thu Oct 28 10:46:28 2021 +0300 ath10k: fetch (pre-)calibration data via nvmem subsystem ATH10K chips are used it wide range of routers, accesspoints, range extenders, network appliances. On these embedded devices, calibration data is often stored on the main system's flash and was out of reach for the driver. To bridge this gap, ath10k is getting extended to pull the (pre-)calibration data through nvmem subsystem. To do this, a nvmem-cell containing the information can either be specified in the platform data or via device-tree. Tested with: Netgear EX6150v2 (IPQ4018 - pre-calibration method) TP-Link Archer C7 v2 (QCA9880v2 - old calibration method) Cc: Robert Marko Cc: Thibaut VARÈNE Signed-off-by: Christian Lamparter Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20211016234609.1568317-1-chunkeey@gmail.com commit 82c434c103408842a87404e873992b7698b6df2b Author: Wen Gong Date: Thu Oct 28 10:46:28 2021 +0300 ath11k: set correct NL80211_FEATURE_DYNAMIC_SMPS for WCN6855 Commit 6f4d70308e5e ("ath11k: support SMPS configuration for 6 GHz") changed "if (ht_cap & WMI_HT_CAP_DYNAMIC_SMPS)" to "if (ht_cap & WMI_HT_CAP_DYNAMIC_SMPS || ar->supports_6ghz)" which means NL80211_FEATURE_DYNAMIC_SMPS is enabled for all chips which support 6 GHz. However, WCN6855 supports 6 GHz but it does not support feature NL80211_FEATURE_DYNAMIC_SMPS, and this can lead to MU-MIMO test failures for WCN6855. Disable NL80211_FEATURE_DYNAMIC_SMPS for WCN6855 since its ht_cap does not support WMI_HT_CAP_DYNAMIC_SMPS. Enable the feature only on QCN9074 as that's the only other device supporting 6 GHz band. Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1 Signed-off-by: Wen Gong Signed-off-by: Jouni Malinen Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210914163726.38604-3-jouni@codeaurora.org commit 49c55f7b035b87371a6d3c53d9af9f92ddc962db Author: Ville Syrjälä Date: Fri Oct 29 22:18:02 2021 +0300 drm/i915/hdmi: Turn DP++ TMDS output buffers back on in encoder->shutdown() Looks like our VBIOS/GOP generally fail to turn the DP dual mode adater TMDS output buffers back on after a reboot. This leads to a black screen after reboot if we turned the TMDS output buffers off prior to reboot. And if i915 decides to do a fastboot the black screen will persist even after i915 takes over. Apparently this has been a problem ever since commit b2ccb822d376 ("drm/i915: Enable/disable TMDS output buffers in DP++ adaptor as needed") if one rebooted while the display was turned off. And things became worse with commit fe0f1e3bfdfe ("drm/i915: Shut down displays gracefully on reboot") since now we always turn the display off before a reboot. This was reported on a RKL, but I confirmed the same behaviour on my SNB as well. So looks pretty universal. Let's fix this by explicitly turning the TMDS output buffers back on in the encoder->shutdown() hook. Note that this gets called after irqs have been disabled, so the i2c communication with the DP dual mode adapter has to be performed via polling (which the gmbus code is perfectly happy to do for us). We also need a bit of care in handling DDI encoders which may or may not be set up for HDMI output. Specifically ddc_pin will not be populated for a DP only DDI encoder, in which case we don't want to call intel_gmbus_get_adapter(). We can handle that by simply doing the dual mode adapter type check before calling intel_gmbus_get_adapter(). Cc: # v5.11+ Fixes: fe0f1e3bfdfe ("drm/i915: Shut down displays gracefully on reboot") Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/4371 Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211029191802.18448-2-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy commit fa2a6c5b9cfb0dfbd1b811b154a036df1017ce66 Author: Ville Syrjälä Date: Fri Oct 29 22:18:01 2021 +0300 drm/i915: Don't request GMBUS to generate irqs when called while irqs are off We will need to do some i2c poking from the encoder->shutdown() hook. Currently that gets called after irqs have been turned off. We still poll the gmbus status bits even if the interrupt never arrives so things will work just fine. But seems like asking gmbus to generate interrupts we will never see is a bit pointless, so don't. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211029191802.18448-1-ville.syrjala@linux.intel.com Reviewed-by: Stanislav Lisovskiy commit f2787d8779b1b00768f8f397b3699698ed84300a Author: Anusha Srivatsa Date: Wed Oct 6 13:45:47 2021 -0700 i915/display/dmc: Add Support for PipeC and PipeD DMC So far we had support for main, PipeA and PipeB DMC. If we find a binary from PipeA-D, lets load it. Cc: Imre Deak Signed-off-by: Anusha Srivatsa Signed-off-by: Imre Deak Reviewed-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20211006204547.669464-1-anusha.srivatsa@intel.com commit c7d561cfcf8661ef02218655c923a0eadbbd7520 Author: Cooper Chiou Date: Mon Oct 25 12:26:23 2021 +0800 drm/i915: Enable WaProgramMgsrForCorrectSliceSpecificMmioReads for Gen9 This implements WaProgramMgsrForCorrectSliceSpecificMmioReads which was omitted by mistake from Gen9 documentation, while it is actually applicable to fused off parts. Workaround consists of making sure MCR packet control register is programmed to point to enabled slice/subslice pair before doing any MMIO reads from the affected registers. Failure do to this can result in complete system hangs when running certain workloads. Two known cases which can cause system hangs are: 1. "test_basic progvar_prog_scope_uninit" test which is part of Khronos OpenCL conformance suite (https://github.com/KhronosGroup/OpenCL-CTS) with the Intel OpenCL driver (https://github.com/intel/compute-runtime). 2. VP8 media hardware encoding using the full-feature build of the Intel media-driver (https://github.com/intel/media-driver) and ffmpeg. For the former case patch was verified to fix the hard system hang when executing the OCL test on Intel Pentium CPU 6405U which contains fused off GT1 graphics. Reference: HSD#1508045018,1405586840, BSID#0575 Cc: Ville Syrjälä Cc: Rodrigo Vivi Cc: Jani Nikula Cc: Chris Wilson Cc: Tvrtko Ursulin Cc: William Tseng Cc: Shawn C Lee Cc: Pawel Wilma Signed-off-by: Cooper Chiou Reviewed-by: Tvrtko Ursulin Acked-by: Joonas Lahtinen Signed-off-by: Tvrtko Ursulin Link: https://patchwork.freedesktop.org/patch/msgid/20211025042623.3876-1-cooper.chiou@intel.com commit f99413e4e1ceb23976207a8ad33a4fb65055092f Author: Paul Cercueil Date: Sat Oct 30 11:00:32 2021 +0100 drm/ingenic: Remove bogus register write Commit 1bdb542da736 ("drm/ingenic: Simplify code by using hwdescs array") caused the dma_hwdesc_phys_f{0,1} variables to be used while uninitialized in a mmio register write, which most certainly broke the ingenic-drm driver. However, the very same patchset also submitted commit 6055466203df ("drm/ingenic: Upload palette before frame"), which restored a correct behaviour by doing the register writes in a different place in the code. What's left of this, is just to remove the bogus register writes in the probe function. Signed-off-by: Paul Cercueil Reported-by: kernel test robot Link: https://patchwork.freedesktop.org/patch/msgid/20211030100032.42066-1-paul@crapouillou.net Acked-by: Sam Ravnborg commit dded00395bdbd45a16d1504a1da77103522b28af Author: Paul Cercueil Date: Tue Oct 26 19:12:40 2021 +0100 drm/ingenic: Attach bridge chain to encoders Attach a top-level bridge to each encoder, which will be used for negociating the bus format and flags. All the bridges are now attached with DRM_BRIDGE_ATTACH_NO_CONNECTOR. Signed-off-by: Paul Cercueil Link: https://patchwork.freedesktop.org/patch/msgid/20211026181240.213806-7-paul@crapouillou.net Tested-by: Nikolaus Schaller Reviewed-by: Christophe Branchereau commit 6055466203df46a44987f97020a4dd9100379f84 Author: Paul Cercueil Date: Tue Oct 26 19:12:39 2021 +0100 drm/ingenic: Upload palette before frame When using C8 color mode, make sure that the palette is always uploaded before a frame; otherwise the very first frame will have wrong colors. Do that by changing the link order of the DMA descriptors. v3: Fix ingenic_drm_get_new_priv_state() called instead of ingenic_drm_get_priv_state() Signed-off-by: Paul Cercueil Link: https://patchwork.freedesktop.org/patch/msgid/20211026181240.213806-6-paul@crapouillou.net Tested-by: Nikolaus Schaller Reviewed-by: Christophe Branchereau commit 5410345f7acb4e84825e7e02f68480c95f3b7b15 Author: Paul Cercueil Date: Tue Oct 26 19:12:38 2021 +0100 drm/ingenic: Set DMA descriptor chain register when starting CRTC Setting the DMA descriptor chain register in the probe function has been fine until now, because we only ever had one descriptor per foreground. As the driver will soon have real descriptor chains, and the DMA descriptor chain register updates itself to point to the current descriptor being processed, this register needs to be reset after a full modeset to point to the first descriptor of the chain. Signed-off-by: Paul Cercueil Link: https://patchwork.freedesktop.org/patch/msgid/20211026181240.213806-5-paul@crapouillou.net Tested-by: Nikolaus Schaller Reviewed-by: Christophe Branchereau commit 9361329d57129ab2e7a47e11962088dd540be47d Author: Paul Cercueil Date: Tue Oct 26 19:12:37 2021 +0100 drm/ingenic: Move IPU scale settings to private state The IPU scaling information is computed in the plane's ".atomic_check" callback, and used in the ".atomic_update" callback. As such, it is state-specific, and should be moved to a private state structure. Signed-off-by: Paul Cercueil Link: https://patchwork.freedesktop.org/patch/msgid/20211026181240.213806-4-paul@crapouillou.net Tested-by: Nikolaus Schaller Reviewed-by: Christophe Branchereau commit 8040ca086eb2f4709a75bb3ad469d7697f2d2450 Author: Paul Cercueil Date: Tue Oct 26 19:12:36 2021 +0100 drm/ingenic: Add support for private objects Until now, the ingenic-drm as well as the ingenic-ipu drivers used to put state-specific information in their respective private structure. Add boilerplate code to support private objects in the two drivers, so that state-specific information can be put in the state-specific private structure. Signed-off-by: Paul Cercueil Link: https://patchwork.freedesktop.org/patch/msgid/20211026181240.213806-3-paul@crapouillou.net Tested-by: Nikolaus Schaller Reviewed-by: Christophe Branchereau commit 1bdb542da736e299a3fb291e5905a14dc955b938 Author: Paul Cercueil Date: Tue Oct 26 19:12:35 2021 +0100 drm/ingenic: Simplify code by using hwdescs array Instead of having one 'hwdesc' variable for the plane #0, one for the plane #1 and one for the palette, use a 'hwdesc[3]' array, where the DMA hardware descriptors are indexed by the plane's number. v2: dma_hwdesc_addr() extended to support palette hwdesc. The palette hwdesc is now hwdesc[3] to simplify things. Add ingenic_drm_configure_hwdesc*() functions to factorize code. Signed-off-by: Paul Cercueil Link: https://patchwork.freedesktop.org/patch/msgid/20211026181240.213806-2-paul@crapouillou.net Tested-by: Nikolaus Schaller Reviewed-by: Christophe Branchereau commit 9556829ce4d0618ae4295af8e4b3dd7e38f43598 Author: José Roberto de Souza Date: Thu Oct 28 16:04:49 2021 -0700 drm/i915/adlp: Implement workaround 16013190616 New workaround added to specification, requiring bit 15 of GEN8_CHICKEN_DCPR_1 to be programed before power well 1 is enabled. BSpec: 54369 Signed-off-by: José Roberto de Souza Reviewed-by: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20211028230449.115832-1-jose.souza@intel.com commit d6cba4e6d0e202276b81117b96106859a4e2d56e Author: Tim Jiang Date: Fri Oct 29 11:21:21 2021 +0800 Bluetooth: btusb: Add support using different nvm for variant WCN6855 controller the RF performance of wcn6855 soc chip from different foundries will be difference, so we should use different nvm to configure them. Signed-off-by: Tim Jiang Reviewed-by: Matthias Kaehlcke Signed-off-by: Marcel Holtmann commit c34c1c4cd68f3ffcd13c7169e7a2c35e267e34f8 Author: Jouni Högander Date: Thu Oct 21 13:10:24 2021 +0300 Revert "drm/i915/display/psr: Do full fetch when handling multi-planar formats" This reverts commit 1f61f0655b95d5b89589390e6f83c4a61d9b1e8d. Now we are supporting selective fetch for biplanar formats. We can revert WA patch which forced using full fetch for biplanar formats. Signed-off-by: Jouni Högander Reviewed-by: José Roberto de Souza Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20211021101024.13112-3-jouni.hogander@intel.com commit 3809991ff5f461cabccd9b5aa39f7561f10918b5 Author: Jouni Högander Date: Thu Oct 21 13:10:23 2021 +0300 drm/i915/display: Add initial selective fetch support for biplanar formats Biplanar formats are using two planes (Y and UV). This patch adds handling of Y selective fetch area by utilizing existing linked plane mechanism. Also UV plane Y offset configuration is modified according to Bspec. Signed-off-by: Jouni Högander Reviewed-by: José Roberto de Souza Signed-off-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20211021101024.13112-2-jouni.hogander@intel.com commit 675053115e4e809643e12ca817dc9147562a70d6 Author: Marcel Ziswiler Date: Wed Oct 27 23:25:05 2021 +0200 drm: import DMA_BUF module namespace Today's -next fails building arm64 defconfig as follows: ERROR: modpost: module drm_cma_helper uses symbol dma_buf_vunmap from namespace DMA_BUF, but does not import it. ERROR: modpost: module drm_cma_helper uses symbol dma_buf_vmap from namespace DMA_BUF, but does not import it. Fix this by importing DMA_BUF namespace into drm_cma_helper.ko. Also fix the problem with drm_shmem_helper.ko. Reported-by: Linux Kernel Functional Testing Fixes: 4b2b5e142ff4 ("drm: Move GEM memory managers into modules") Signed-off-by: Marcel Ziswiler Signed-off-by: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20211027212506.3418521-1-marcel@ziswiler.com commit fe6089c138e477d0b1a8bf369ae6643466fd7c2d Author: Daniel Vetter Date: Fri Oct 22 10:22:00 2021 +0200 drm/i915: Remove some dead struct fwd decl from i915_drv.h Gone with userptr rewrite by Maarten in ed29c2691188 ("drm/i915: Fix userptr so we do not have to worry about obj->mm.lock, v7.") Reviewed-by: Matthew Auld Signed-off-by: Daniel Vetter Cc: Maarten Lankhorst Link: https://patchwork.freedesktop.org/patch/msgid/20211022082200.2684194-1-daniel.vetter@ffwll.ch commit 182ee45da083db4e3e621541ccf255bfa9652214 Author: Luiz Augusto von Dentz Date: Wed Oct 27 16:59:00 2021 -0700 Bluetooth: hci_sync: Rework hci_suspend_notifier This makes hci_suspend_notifier use the hci_*_sync which can be executed synchronously which is allowed in the suspend_notifier and simplifies a lot of the handling since the status of each command can be checked inline so no other work need to be scheduled thus can be performed without using of a state machine. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit d0b137062b2de75b264b84143d21c98abc5f5ad2 Author: Luiz Augusto von Dentz Date: Wed Oct 27 16:58:59 2021 -0700 Bluetooth: hci_sync: Rework init stages This moves the init stages to use the hci_sync infra and in addition to that have the stages as function tables so it is easier to change the command sequence. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 3244845c6307fa6f4fa2eabe5259d2c93c837dce Author: Brian Gix Date: Wed Oct 27 16:58:58 2021 -0700 Bluetooth: hci_sync: Convert MGMT_OP_SSP mgmt-tester paths: Set SSP on - Success 2 Set Device ID - SSP off and Power on Signed-off-by: Brian Gix Signed-off-by: Marcel Holtmann commit 5e233ed59cc4e1c5f2fa44a7eb77151ee1ded8e3 Author: Brian Gix Date: Wed Oct 27 16:58:57 2021 -0700 Bluetooth: hci_sync: Convert adv_expire mgmt-test paths: Set Advertising on - Appearance 1 Set Advertising on - Local name 1 Set Advertising on - Name + Appear 1 Set Local Name - Success 2 Set Local Name - Success 3 Add Advertising - Success (Empty ScRsp) Add Advertising - Success (ScRsp appear) Add Advertising - Invalid Params (ScRsp appear long) Add Advertising - Success (Complete name) Add Advertising - Success (Shortened name) Add Advertising - Success (Short name) Add Advertising - Success (Name + data) Add Advertising - Invalid Params (Name + data) Add Advertising - Success (Name+data+appear) Set appearance - BR/EDR LE Set appearance - LE only Add Ext Advertising - Success (Empty ScRsp) Add Ext Advertising - Success (ScRsp appear) Add Ext Advertising - Invalid Params (ScRsp appear long) Add Ext Advertising - Success (Complete name) Add Ext Advertising - Success (Shortened name) Add Ext Advertising - Success (Short name) Add Ext Advertising - Success (Name + data) Add Ext Advertising - Invalid Params (Name + data) Add Ext Advertising - Success (Name+data+appear) Signed-off-by: Brian Gix Signed-off-by: Marcel Holtmann commit 26ac4c56f03f64a6634c5f2323c22e550b7e76b4 Author: Brian Gix Date: Wed Oct 27 16:58:56 2021 -0700 Bluetooth: hci_sync: Convert MGMT_OP_SET_ADVERTISING mgmt-test paths: Set powered on - Privacy and Advertising Set Advertising on - Success 2 Set Advertising on - Appearance 1 Set Advertising on - Local name 1 Set Advertising on - Name + Appear 1 Add Advertising - Success 4 Add Advertising - Success 5 Add Ext Advertising - Success 4 Add Ext Advertising - Success 5 Signed-off-by: Brian Gix Signed-off-by: Marcel Holtmann commit 71efbb08b538d925733e0e07d4f48d996292ac5e Author: Brian Gix Date: Wed Oct 27 16:58:55 2021 -0700 Bluetooth: hci_sync: Convert MGMT_OP_SET_PHY_CONFIGURATION mgmt-test paths: Set PHY 2m Success Set PHY coded Succcess Set PHY 1m 2m coded Succcess Set PHY 2m tx success Set PHY 2m rx success Set PHY Invalid Param Start Discovery - (2m, Scan Param) Start Discovery - (coded, Scan Param) Start Discovery - (1m, 2m, coded, Scan Param) Signed-off-by: Brian Gix Signed-off-by: Marcel Holtmann commit 6f6ff38a1e140d7ca3a733556b0027eec1fe4ef1 Author: Brian Gix Date: Wed Oct 27 16:58:54 2021 -0700 Bluetooth: hci_sync: Convert MGMT_OP_SET_LOCAL_NAME Uses existing *_sync functions, but made hci_update_name_sync non-static. mgmt-test paths: Set Advertising on - Local name 1 Set Advertising on - Name + Appear 1 Set Local Name - Success 1 Set Local Name - Success 2 Set Local Name - Success 3 Add Advertising - Success (Empty ScRsp) Add Advertising - Success (Complete name) Add Advertising - Success (Shortened name) Add Advertising - Success (Short name) Add Advertising - Success (Name + data) Add Advertising - Invalid Params (Name + data) Add Advertising - Success (Name+data+appear) Read Ext Controller Info 3 Read Ext Controller Info 4 Read Ext Controller Info 5 Add Ext Advertising - Success (Empty ScRsp) Add Ext Advertising - Success (Complete name) Add Ext Advertising - Success (Shortened name) Add Ext Advertising - Success (Short name) Add Ext Advertising - Success (Name + data) Add Ext Advertising - Invalid Params (Name + data) Add Ext Advertising - Success (Name+data+appear) Signed-off-by: Brian Gix Signed-off-by: Marcel Holtmann commit 177e77a30e469af96e301658facf6a12a6e9e200 Author: Brian Gix Date: Wed Oct 27 16:58:53 2021 -0700 Bluetooth: hci_sync: Convert MGMT_OP_READ_LOCAL_OOB_EXT_DATA Uses existing *_sync functions mgmt-test paths: Read Local OOB Ext Data - Invalid index Read Local OOB Ext Data - Legacy pairing Read Local OOB Ext Data - Success SSP Read Local OOB Ext Data - Success SC Signed-off-by: Brian Gix Signed-off-by: Marcel Holtmann commit f892244b05bf6a99e48db14f8bbd96db16bcfa69 Author: Brian Gix Date: Wed Oct 27 16:58:52 2021 -0700 Bluetooth: hci_sync: Convert MGMT_OP_READ_LOCAL_OOB_DATA New functions: hci_read_local_oob_data_sync This function requires all of the data from the cmd cmplt event to be passed up to the caller via the skb. mgmt-tester paths: Read Local OOB Data - Not powered Read Local OOB Data - Legacy pairing Read Local OOB Data - Success SSP Read Local OOB Data - Success SC Signed-off-by: Brian Gix Signed-off-by: Marcel Holtmann commit d81a494c43df66f053f7d1ec612e057eb99f34d4 Author: Brian Gix Date: Wed Oct 27 16:58:51 2021 -0700 Bluetooth: hci_sync: Convert MGMT_OP_SET_LE Uses: hci_disable_advertising_sync hci_remove_ext_adv_instance_sync hci_write_le_host_supported_sync hci_setup_ext_adv_instance_sync hci_update_scan_rsp_data_sync Signed-off-by: Brian Gix Signed-off-by: Marcel Holtmann commit 5a750137466400276560458db040c143cbc254ed Author: Brian Gix Date: Wed Oct 27 16:58:50 2021 -0700 Bluetooth: hci_sync: Convert MGMT_OP_GET_CLOCK_INFO Synchronous version of MGMT_OP_GET_CLOCK_INFO. Signed-off-by: Brian Gix Signed-off-by: Marcel Holtmann commit 2f2eb0c9de2eb69969aaf04feffb69310d3804b2 Author: Brian Gix Date: Wed Oct 27 16:58:49 2021 -0700 Bluetooth: hci_sync: Convert MGMT_OP_SET_SECURE_CONN Synchronous version of MGMT_OP_SET_SECURE_CONN. Signed-off-by: Brian Gix Signed-off-by: Marcel Holtmann commit 47db6b42991e6d5645d0938e43085aaf88cdfba4 Author: Brian Gix Date: Wed Oct 27 16:58:48 2021 -0700 Bluetooth: hci_sync: Convert MGMT_OP_GET_CONN_INFO Synchronous version of MGMT_OP_GET_CONN_INFO Implements: hci_read_rssi_sync hci_read_tx_power_sync Signed-off-by: Brian Gix Signed-off-by: Marcel Holtmann commit 451d95a98c5a350da2f2c5447cc17115a5b94c8e Author: Brian Gix Date: Wed Oct 27 16:58:47 2021 -0700 Bluetooth: hci_sync: Enable synch'd set_bredr Uses previously written: hci_write_fast_connectable_sync hci_update_scan_sync hci_update_adv_data_sync Signed-off-by: Brian Gix Signed-off-by: Marcel Holtmann commit 353a0249c3f60365c55d53e2d068de4f43669a22 Author: Brian Gix Date: Wed Oct 27 16:58:46 2021 -0700 Bluetooth: hci_sync: Convert MGMT_OP_SET_FAST_CONNECTABLE This creates a synchronized Write Fast Connectable call and attaches it to the MGMT_OP_SET_FAST_CONNECTABLE management opcode. Signed-off-by: Brian Gix Signed-off-by: Marcel Holtmann commit abfeea476c68afea54c9c050a2d3b19d5d2ee873 Author: Luiz Augusto von Dentz Date: Wed Oct 27 16:58:45 2021 -0700 Bluetooth: hci_sync: Convert MGMT_OP_START_DISCOVERY This make use of hci_cmd_sync_queue for MGMT_OP_START_DISCOVERY, MGMT_OP_START_SERVICE_DISCOVERY and MGMT_OP_STOP_DISCOVERY to use hci_cmd_sync_queue so they no longer depend on hdev->discov_update work to send any commands. Tested with: tools/mgmt-tester -s "Start Discovery" Test Summary ------------ Start Discovery - Not powered 1 Passed Start Discovery - Invalid parameters 1 Passed Start Discovery - Not supported 1 Passed Start Discovery - Success 1 Passed Start Discovery - Success 2 Passed Start Discovery - Power Off 1 Passed Start Discovery BREDR LE - (Ext Scan Enable) Passed Start Discovery LE - (Ext Scan Enable) Passed Start Discovery LE - (Ext Scan Param) Passed Start Discovery - (2m, Scan Param) Passed Start Discovery - (coded, Scan Param) Passed Start Discovery - (1m, 2m, coded, Scan Param) Passed LL Privacy - Start Discovery 1 (Disable RL) Passed LL Privacy - Start Discovery 2 (Disable RL) Passed Total: 14, Passed: 14 (100.0%), Failed: 0, Not Run: 0 tools/mgmt-tester -s "Start Service" Test Summary ------------ Start Service Discovery - Not powered 1 Passed Start Service Discovery - Invalid parameters 1 Passed Start Service Discovery - Not supported 1 Passed Start Service Discovery - Success 1 Passed Start Service Discovery - Success 2 Passed Total: 5, Passed: 5 (100.0%), Failed: 0, Not Run: 0 tools/mgmt-tester -s "Stop Discovery" Test Summary ------------ Stop Discovery - Success 1 Passed Stop Discovery - BR/EDR (Inquiry) Success 1 Passed Stop Discovery - Rejected 1 Passed Stop Discovery - Invalid parameters 1 Passed Stop Discovery - (Ext Scan Disable) Passed Total: 5, Passed: 5 (100.0%), Failed: 0, Not Run: 0 Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit cf75ad8b41d2aa06f98f365d42a3ae8b059daddd Author: Luiz Augusto von Dentz Date: Wed Oct 27 16:58:44 2021 -0700 Bluetooth: hci_sync: Convert MGMT_SET_POWERED This make use of hci_cmd_sync_queue when MGMT_SET_POWERED is used so all commands are run within hdev->cmd_sync_work instead of hdev->power_on_work and hdev->power_off_work. In addition to that the power on sequence now takes into account if local IRK needs to be programmed in the resolving list. Tested with: tools/mgmt-tester -s "Set powered" Test Summary ------------ Set powered on - Success Passed Set powered on - Invalid parameters 1 Passed Set powered on - Invalid parameters 2 Passed Set powered on - Invalid parameters 3 Passed Set powered on - Invalid index Passed Set powered on - Privacy and Advertising Passed Set powered off - Success Passed Set powered off - Class of Device Passed Set powered off - Invalid parameters 1 Passed Set powered off - Invalid parameters 2 Passed Set powered off - Invalid parameters 3 Passed Total: 11, Passed: 11 (100.0%), Failed: 0, Not Run: 0 Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 5bee2fd6bcaaaa9f8f415afc48ed8c1083d8a303 Author: Luiz Augusto von Dentz Date: Wed Oct 27 16:58:43 2021 -0700 Bluetooth: hci_sync: Rework background scan This replaces the use of hci_update_background_scan with hci_update_passive_scan which runs from cmd_work_sync and deal properly with resolving list when LL privacy is enabled. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit ad383c2c65a5baf16e334cd40a013cc302176891 Author: Luiz Augusto von Dentz Date: Wed Oct 27 16:58:42 2021 -0700 Bluetooth: hci_sync: Enable advertising when LL privacy is enabled This enables advertising when LL privacy is enabled and changes the command sequence when resolving list is updated to also account for when advertising is enabled using the following sequence: If there are devices to scan: Disable Scanning -> Update Accept List -> use_ll_privacy((Disable Advertising) -> Disable Resolving List -> Update Resolving List -> Enable Resolving List -> (Enable Advertising)) -> Enable Scanning Otherwise: Disable Scanning Errors during the Update Accept List stage are handled gracefully by restoring any previous state (e.g. advertising) and disabling the use of accept list as either accept list or resolving list could not be updated. Tested with: mgmt-tester -s "LL Privacy" Test Summary ------------ LL Privacy - Add Device 1 (Add to WL) Passed LL Privacy - Add Device 2 (Add to RL) Passed LL Privacy - Add Device 3 (Enable RL) Passed LL Privacy - Add Device 4 (2 Devices to WL) Passed LL Privacy - Add Device 5 (2 Devices to RL) Passed LL Privacy - Add Device 6 (RL is full) Passed LL Privacy - Add Device 7 (WL is full) Passed LL Privacy - Add Device 8 (Disable Adv) Passed LL Privacy - Add Device 9 (Multi Adv) Passed LL Privacy - Add Device 10 (Multi Dev and Multi Adv) Passed LL Privacy - Remove Device 1 (Remove from WL) Passed LL Privacy - Remove Device 2 (Remove from RL) Passed LL Privacy - Remove Device 3 (Disable RL) Passed LL Privacy - Remove Device 4 (Disable Adv) Passed LL Privacy - Remove Device 5 (Multi Adv) Passed LL Privacy - Start Discovery 1 (Disable RL) Passed LL Privacy - Start Discovery 2 (Disable RL) Passed Total: 18, Passed: 18 (100.0%), Failed: 0, Not Run: 0 Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit e8907f76544ffe225ab95d70f7313267b1d0c76d Author: Luiz Augusto von Dentz Date: Wed Oct 27 16:58:41 2021 -0700 Bluetooth: hci_sync: Make use of hci_cmd_sync_queue set 3 This make use of hci_cmd_sync_queue for the following MGMT commands: Add Device Remove Device Tested with: mgmt-tester -s "Add Device" Test Summary ------------ Add Device - Invalid Params 1 Passed Add Device - Invalid Params 2 Passed Add Device - Invalid Params 3 Passed Add Device - Invalid Params 4 Passed Add Device - Success 1 Passed Add Device - Success 2 Passed Add Device - Success 3 Passed Add Device - Success 4 Passed Add Device - Success 5 Passed Add Device - Success 6 - Add to whitelist Passed Add Device - Success 7 - Add to resolv list Passed Add Device - Success 8 - Enable resolv list Passed Total: 12, Passed: 12 (100.0%), Failed: 0, Not Run: 0 Overall execution time: 0.209 seconds mgmt-tester -s "Remove Device" Test Summary ------------ Remove Device - Invalid Params 1 Passed Remove Device - Invalid Params 2 Passed Remove Device - Invalid Params 3 Passed Remove Device - Success 1 Passed Remove Device - Success 2 Passed Remove Device - Success 3 Passed Remove Device - Success 4 Passed Remove Device - Success 5 Passed Remove Device - Success 6 - All Devices Passed Remove Device - Success 7 - Remove from whitelist Passed Remove Device - Success 8 - Remove from resolv list Passed Total: 11, Passed: 11 (100.0%), Failed: 0, Not Run: 0 Overall execution time: 4.26 seconds Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit cba6b758711cab946c787f7c15be92cc749b8e1f Author: Luiz Augusto von Dentz Date: Wed Oct 27 16:58:40 2021 -0700 Bluetooth: hci_sync: Make use of hci_cmd_sync_queue set 2 This make use of hci_cmd_sync_queue for the following MGMT commands: Add Advertising Remove Advertising Add Extended Advertising Parameters Add Extended Advertising Data mgmt-tester -s "Add Advertising" Test Summary ------------ Add Advertising - Failure: LE off Passed Add Advertising - Invalid Params 1 (AD too long) Passed Add Advertising - Invalid Params 2 (Malformed len) Passed Add Advertising - Invalid Params 3 (Malformed len) Passed Add Advertising - Invalid Params 4 (Malformed len) Passed Add Advertising - Invalid Params 5 (AD too long) Passed Add Advertising - Invalid Params 6 (ScRsp too long) Passed Add Advertising - Invalid Params 7 (Malformed len) Passed Add Advertising - Invalid Params 8 (Malformed len) Passed Add Advertising - Invalid Params 9 (Malformed len) Passed Add Advertising - Invalid Params 10 (ScRsp too long) Passed Add Advertising - Rejected (Timeout, !Powered) Passed Add Advertising - Success 1 (Powered, Add Adv Inst) Passed Add Advertising - Success 2 (!Powered, Add Adv Inst) Passed Add Advertising - Success 3 (!Powered, Adv Enable) Passed Add Advertising - Success 4 (Set Adv on override) Passed Add Advertising - Success 5 (Set Adv off override) Passed Add Advertising - Success 6 (Scan Rsp Dta, Adv ok) Passed Add Advertising - Success 7 (Scan Rsp Dta, Scan ok) Passed Add Advertising - Success 8 (Connectable Flag) Passed Add Advertising - Success 9 (General Discov Flag) Passed Add Advertising - Success 10 (Limited Discov Flag) Passed Add Advertising - Success 11 (Managed Flags) Passed Add Advertising - Success 12 (TX Power Flag) Passed Add Advertising - Success 13 (ADV_SCAN_IND) Passed Add Advertising - Success 14 (ADV_NONCONN_IND) Passed Add Advertising - Success 15 (ADV_IND) Passed Add Advertising - Success 16 (Connectable -> on) Passed Add Advertising - Success 17 (Connectable -> off) Passed Add Advertising - Success 18 (Power -> off, Remove) Passed Add Advertising - Success 19 (Power -> off, Keep) Passed Add Advertising - Success 20 (Add Adv override) Passed Add Advertising - Success 21 (Timeout expires) Passed Add Advertising - Success 22 (LE -> off, Remove) Passed Add Advertising - Success (Empty ScRsp) Passed Add Advertising - Success (ScRsp only) Passed Add Advertising - Invalid Params (ScRsp too long) Passed Add Advertising - Success (ScRsp appear) Passed Add Advertising - Invalid Params (ScRsp appear long) Passed Add Advertising - Success (Appear is null) Passed Add Advertising - Success (Name is null) Passed Add Advertising - Success (Complete name) Passed Add Advertising - Success (Shortened name) Passed Add Advertising - Success (Short name) Passed Add Advertising - Success (Name + data) Passed Add Advertising - Invalid Params (Name + data) Passed Add Advertising - Success (Name+data+appear) Passed Total: 47, Passed: 47 (100.0%), Failed: 0, Not Run: 0 Overall execution time: 2.17 seconds mgmt-tester -s "Remove Advertising" Test Summary ------------ Remove Advertising - Invalid Params 1 Passed Remove Advertising - Success 1 Passed Remove Advertising - Success 2 Passed Total: 3, Passed: 3 (100.0%), Failed: 0, Not Run: 0 Overall execution time: 0.0585 seconds mgmt-tester -s "Ext Adv MGMT Params" Test Summary: ------------ Ext Adv MGMT Params - Unpowered Passed Ext Adv MGMT Params - Invalid parameters Passed Ext Adv MGMT Params - Success Passed Ext Adv MGMT Params - (5.0) Success Passed Total: 4, Passed: 4 (100.0%), Failed: 0, Not Run: 0 Overall execution time: 0.0746 seconds mgmt-tester -s "Ext Adv MGMT -" Test Summary ------------ Ext Adv MGMT - Data set without Params Passed Ext Adv MGMT - AD Data (5.0) Invalid parameters Passed Ext Adv MGMT - AD Data (5.0) Success Passed Ext Adv MGMT - AD Scan Response (5.0) Success Passed Total: 4, Passed: 4 (100.0%), Failed: 0, Not Run: 0 Overall execution time: 0.0805 seconds Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 161510ccf91c961638940b03abb1ee804be53a97 Author: Luiz Augusto von Dentz Date: Wed Oct 27 16:58:39 2021 -0700 Bluetooth: hci_sync: Make use of hci_cmd_sync_queue set 1 This make use of hci_cmd_sync_queue for the following MGMT commands: Set Device Class Set Device ID Add UUID Remove UUID tools/mgmt-tester -s "Set Device Class" Test Summary ------------ Set Device Class - Success 1 Passed Set Device Class - Success 2 Passed Set Device Class - Invalid parameters 1 Passed Total: 3, Passed: 3 (100.0%), Failed: 0, Not Run: 0 Overall execution time: 0.0599 seconds tools/mgmt-tester -s "Set Device ID" Test Summary ------------ Set Device ID - Success 1 Passed Set Device ID - Success 2 Passed Set Device ID - Disable Passed Set Device ID - Power off and Power on Passed Set Device ID - SSP off and Power on Passed Set Device ID - Invalid Parameter Passed Total: 6, Passed: 6 (100.0%), Failed: 0, Not Run: 0 Overall execution time: 0.107 seconds tools/mgmt-tester -s "Add UUID" Test Summary ------------ Add UUID - UUID-16 1 Passed Add UUID - UUID-16 multiple 1 Passed Add UUID - UUID-16 partial 1 Passed Add UUID - UUID-32 1 Passed Add UUID - UUID-32 multiple 1 Passed Add UUID - UUID-32 partial 1 Passed Add UUID - UUID-128 1 Passed Add UUID - UUID-128 multiple 1 Passed Add UUID - UUID-128 partial 1 Passed Add UUID - UUID mix Passed Total: 10, Passed: 10 (100.0%), Failed: 0, Not Run: 0 Overall execution time: 0.198 seconds tools/mgmt-tester -s "Remove UUID" Test Summary ------------ Remove UUID - Success 1 Passed Remove UUID - All UUID - Success 2 Passed Remove UUID - Power Off - Success 3 Passed Remove UUID - Power Off and On - Success 4 Passed Remove UUID - Not Exist - Invalid Params 1 Passed Total: 5, Passed: 5 (100.0%), Failed: 0, Not Run: 0 Overall execution time: 0.0908 seconds Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 6a98e3836fa2077b169f10a35c2ca9952d53f987 Author: Marcel Holtmann Date: Wed Oct 27 16:58:38 2021 -0700 Bluetooth: Add helper for serialized HCI command execution The usage of __hci_cmd_sync() within the hdev->setup() callback allows for a nice and simple serialized execution of HCI commands. More importantly it allows for result processing before issueing the next command. With the current usage of hci_req_run() it is possible to batch up commands and execute them, but it is impossible to react to their results or errors. This is an attempt to generalize the hdev->setup() handling and provide a simple way of running multiple HCI commands from a single function context. There are multiple struct work that are decdicated to certain tasks already used right now. It is add a lot of bloat to hci_dev struct and extra handling code. So it might be possible to put all of these behind a common HCI command infrastructure and just execute the HCI commands from the same work context in a serialized fashion. For example updating the white list and resolving list can be done now without having to know the list size ahead of time. Also preparing for suspend or resume shouldn't require a state machine anymore. There are other tasks that should be simplified as well. Signed-off-by: Marcel Holtmann Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 10a657dd4cbc34ba9f1bf16140a96789688f6cd5 Author: Imre Deak Date: Wed Oct 27 15:51:50 2021 +0300 drm/i915/fb: Fold modifier CCS type/tiling attribute to plane caps By using the modifier plane capability flags to encode the modifiers' CCS type and tiling attributes, it becomes simpler to the check for any of these capabilities when providing the list of supported modifiers. This also allows distinguishing modifiers on future platforms where platforms with the same display version support different modifiers. An example is DG2 and ADLP, both being D13, where DG2 supports only F and X tiling, while ADLP supports only Y and X tiling. With the INTEL_PLANE_CAP_TILING_* flags added in this patch we can provide the correct modifiers for each platform. v2: - Define PLANE_HAS_* with macros instead of an enum. (Jani) - Rename PLANE_HAS_*_ANY to PLANE_HAS_*_MASK. (Jani) - Rename PLANE_HAS_* to INTEL_PLANE_CAP_*. - Set the CCS_RC_CC cap only for DISPLAY_VER >= 12. - Set the TILING_Y cap only for DISPLAY_VER < 13 || ADLP. - Simplify the SKL plane cap display version checks and move them to a separate function. Cc: Juha-Pekka Heikkila Cc: Ville Syrjälä Cc: Jani Nikula Signed-off-by: Imre Deak Reviewed-by: Juha-Pekka Heikkila Link: https://patchwork.freedesktop.org/patch/msgid/20211027125150.2891371-1-imre.deak@intel.com commit 7df7bca56902e4d96c7b17b84378774f2254b707 Author: Imre Deak Date: Tue Oct 26 19:15:16 2021 +0300 drm/i915/fb: Don't store bitmasks in the intel_plane_caps enum Variables of enum types can contain only the values listed at the enums definition, so don't store bitmasks in intel_plane_caps enum variables. Cc: Juha-Pekka Heikkila Signed-off-by: Imre Deak Reviewed-by: Juha-Pekka Heikkila Link: https://patchwork.freedesktop.org/patch/msgid/20211026161517.2694067-3-imre.deak@intel.com commit da0c3e2c907aaa4c6818aabc2691a667e3578063 Author: Imre Deak Date: Tue Oct 26 19:15:15 2021 +0300 drm/i915/fb: Don't report MC CCS plane capability on GEN<12 Remove the MC CCS plane capability on GEN<12, since it's not present there. This didn't cause a problem, since the display version check filtered out the MC CCS modifiers before GEN12. Cc: Juha-Pekka Heikkila Signed-off-by: Imre Deak Reviewed-by: Juha-Pekka Heikkila Link: https://patchwork.freedesktop.org/patch/msgid/20211026161517.2694067-2-imre.deak@intel.com commit c1bb3a463dac815598362fb642a2746ff0e8f2f8 Merge: ead3ea12e1334 31fa8cbce4664 Author: Jani Nikula Date: Fri Oct 29 13:38:34 2021 +0300 Merge drm/drm-next into drm-intel-next Backmerge to get the DP 2.0 MST changes merged to drm-next. This also syncs us up to v5.15-rc7. Signed-off-by: Jani Nikula commit bdf6aa22204e1250e217e79e77db38753a6731de Author: Christian König Date: Mon Sep 13 14:08:13 2021 +0200 drm/nouveau: use the new interator in nv50_wndw_prepare_fb Makes the handling a bit more complex, but avoids the use of dma_resv_get_excl_unlocked(). Signed-off-by: Christian König Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20211005113742.1101-27-christian.koenig@amd.com commit b0cc4dca4f1066f385a92baf6214d7f313353d76 Author: Matthew Auld Date: Thu Oct 28 10:26:38 2021 +0100 drm/i915/gtt: stop caching the scratch page Normal users shouldn't be hitting this, likely this would indicate a userspace bug. So don't bother caching, which should be safe now that we manually flush the page. Suggested-by: Chris Wilson Signed-off-by: Matthew Auld Cc: Thomas Hellström Cc: Chris Wilson Cc: Ramalingam C Reviewed-by: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20211028092638.3142258-2-matthew.auld@intel.com commit 2ca776068f1f9ece3ab093f1be39c87653fbff16 Author: Matthew Auld Date: Thu Oct 28 10:26:37 2021 +0100 drm/i915/gtt: flush the scratch page The scratch page is directly visible in the users address space, and while this is forced as CACHE_LLC, by the kernel, we still have to contend with things like "Bypass-LLC" MOCS. So just flush no matter what. v2(Thomas): - Make sure we use drm_clflush_virt_range here, in case clflush support is missing. Signed-off-by: Matthew Auld Cc: Thomas Hellström Cc: Chris Wilson Cc: Ramalingam C Reviewed-by: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20211028092638.3142258-1-matthew.auld@intel.com commit 74c1bda2f3fa79a93e1c910008649b49b02dc09d Author: Colin Ian King Date: Thu Sep 30 11:27:48 2021 +0100 drm/virtio: fix another potential integer overflow on shift of a int The left shift of unsigned int 32 bit integer constant 1 is evaluated using 32 bit arithmetic and then assigned to a signed 64 bit integer. In the case where value is 32 or more this can lead to an overflow (value can be in range 0..MAX_CAPSET_ID (63). Fix this by shifting the value 1ULL instead. Addresses-Coverity: ("Uninitentional integer overflow") Fixes: 4fb530e5caf7 ("drm/virtio: implement context init: support init ioctl") Signed-off-by: Colin Ian King Link: http://patchwork.freedesktop.org/patch/msgid/20210930102748.16922-1-colin.king@canonical.com Signed-off-by: Gerd Hoffmann commit 8f4502fa284478a5264afa8a5a95511276fa9b80 Author: Colin Ian King Date: Thu Sep 30 11:19:41 2021 +0100 drm/virtio: fix potential integer overflow on shift of a int The left shift of unsigned int 32 bit integer constant 1 is evaluated using 32 bit arithmetic and then assigned to a signed 64 bit integer. In the case where i is 32 or more this can lead to an overflow. Fix this by shifting the value 1ULL instead. Addresses-Coverity: ("Uninitentional integer overflow") Fixes: 8d6b006e1f51 ("drm/virtio: implement context init: handle VIRTGPU_CONTEXT_PARAM_POLL_RINGS_MASK") Signed-off-by: Colin Ian King Link: http://patchwork.freedesktop.org/patch/msgid/20210930101941.16546-1-colin.king@canonical.com Signed-off-by: Gerd Hoffmann commit 7cf09865885793f57003492f1cd3b76cf4cf0eb1 Author: Chia-I Wu Date: Thu Oct 28 14:34:46 2021 -0700 MAINTAINERS: add reviewers for virtio-gpu Add Gurchetan Singh and me as reviewers for virtio-gpu. Signed-off-by: Chia-I Wu Acked-by: Gurchetan Singh Cc: David Airlie Cc: Gerd Hoffmann Acked-by: Daniel Stone Link: http://patchwork.freedesktop.org/patch/msgid/20211028213446.955338-1-olvaffe@gmail.com Signed-off-by: Gerd Hoffmann commit 2128939fe2e771645dd88e1938c27fdf96bd1cd0 Author: Archie Pusaka Date: Thu Oct 28 19:17:25 2021 +0800 Bluetooth: Fix removing adv when processing cmd complete If we remove one instance of adv using Set Extended Adv Enable, there is a possibility of issue occurs when processing the Command Complete event. Especially, the adv_info might not be found since we already remove it in hci_req_clear_adv_instance() -> hci_remove_adv_instance(). If that's the case, we will mistakenly proceed to remove all adv instances instead of just one single instance. This patch fixes the issue by checking the content of the HCI command instead of checking whether the adv_info is found. Signed-off-by: Archie Pusaka Reviewed-by: Sonny Sasaka Signed-off-by: Luiz Augusto von Dentz commit ead3ea12e133416fbd800eedb2fb5d0faf2df431 Author: Ville Syrjälä Date: Wed Oct 6 23:49:37 2021 +0300 drm/i915: Fix icl+ combo phy static lane power down setup Our lane power down defines already include the necessary shift, don't shift them a second time. Fortunately we masked off the correct bits, so we accidentally left all lanes powered up all the time. Bits 8-11 where we end up writing our misdirected lane mask are documented as MBZ, but looks like you can actually write there so they're not read only bits. No idea what side effect the bogus register write might have. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/4151 Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211006204937.30774-17-ville.syrjala@linux.intel.com Reviewed-by: Imre Deak commit 32c2bc89c7420fad2959ee23ef5b6be8b05d2bde Author: Ville Syrjälä Date: Mon Oct 25 17:21:47 2021 +0300 drm/i915: Fix type1 DVI DP dual mode adapter heuristic for modern platforms Looks like we never updated intel_bios_is_port_dp_dual_mode() when the VBT port mapping became erratic on modern platforms. This is causing us to look up the wrong child device and thus throwing the heuristic off (ie. we might end looking at a child device for a genuine DP++ port when we were supposed to look at one for a native HDMI port). Fix it up by not using the outdated port_mapping[] in intel_bios_is_port_dp_dual_mode() and rely on intel_bios_encoder_data_lookup() instead. Cc: stable@vger.kernel.org Tested-by: Randy Dunlap Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/4138 Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211025142147.23897-1-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 77cdd054dd2ced6cb6f3420a998d6a0a65d6076e Author: Umesh Nerlige Ramappa Date: Tue Oct 26 17:48:21 2021 -0700 drm/i915/pmu: Connect engine busyness stats from GuC to pmu With GuC handling scheduling, i915 is not aware of the time that a context is scheduled in and out of the engine. Since i915 pmu relies on this info to provide engine busyness to the user, GuC shares this info with i915 for all engines using shared memory. For each engine, this info contains: - total busyness: total time that the context was running (total) - id: id of the running context (id) - start timestamp: timestamp when the context started running (start) At the time (now) of sampling the engine busyness, if the id is valid (!= ~0), and start is non-zero, then the context is considered to be active and the engine busyness is calculated using the below equation engine busyness = total + (now - start) All times are obtained from the gt clock base. For inactive contexts, engine busyness is just equal to the total. The start and total values provided by GuC are 32 bits and wrap around in a few minutes. Since perf pmu provides busyness as 64 bit monotonically increasing values, there is a need for this implementation to account for overflows and extend the time to 64 bits before returning busyness to the user. In order to do that, a worker runs periodically at frequency = 1/8th the time it takes for the timestamp to wrap. As an example, that would be once in 27 seconds for a gt clock frequency of 19.2 MHz. Note: There might be an over-accounting of busyness due to the fact that GuC may be updating the total and start values while kmd is reading them. (i.e kmd may read the updated total and the stale start). In such a case, user may see higher busyness value followed by smaller ones which would eventually catch up to the higher value. v2: (Tvrtko) - Include details in commit message - Move intel engine busyness function into execlist code - Use union inside engine->stats - Use natural type for ping delay jiffies - Drop active_work condition checks - Use for_each_engine if iterating all engines - Drop seq locking, use spinlock at GuC level to update engine stats - Document worker specific details v3: (Tvrtko/Umesh) - Demarcate GuC and execlist stat objects with comments - Document known over-accounting issue in commit - Provide a consistent view of GuC state - Add hooks to gt park/unpark for GuC busyness - Stop/start worker in gt park/unpark path - Drop inline - Move spinlock and worker inits to GuC initialization - Drop helpers that are called only once v4: (Tvrtko/Matt/Umesh) - Drop addressed opens from commit message - Get runtime pm in ping, remove from the park path - Use cancel_delayed_work_sync in disable_submission path - Update stats during reset prepare - Skip ping if reset in progress - Explicitly name execlists and GuC stats objects - Since disable_submission is called from many places, move resetting stats to intel_guc_submission_reset_prepare v5: (Tvrtko) - Add a trylock helper that does not sleep and synchronize PMU event callbacks and worker with gt reset v6: (CI BAT failures) - DUTs using execlist submission failed to boot since __gt_unpark is called during i915 load. This ends up calling the GuC busyness unpark hook and results in kick-starting an uninitialized worker. Let park/unpark hooks check if GuC submission has been initialized. - drop cant_sleep() from trylock helper since rcu_read_lock takes care of that. v7: (CI) Fix igt@i915_selftest@live@gt_engines - For GuC mode of submission the engine busyness is derived from gt time domain. Use gt time elapsed as reference in the selftest. - Increase busyness calculation to 10ms duration to ensure batch runs longer and falls within the busyness tolerances in selftest. v8: - Use ktime_get in selftest as before - intel_reset_trylock_no_wait results in a lockdep splat that is not trivial to fix since the PMU callback runs in irq context and the reset paths are tightly knit into the driver. The test that uncovers this is igt@perf_pmu@faulting-read. Drop intel_reset_trylock_no_wait, instead use the reset_count to synchronize with gt reset during pmu callback. For the ping, continue to use intel_reset_trylock since ping is not run in irq context. - GuC PM timestamp does not tick when GuC is idle. This can potentially result in wrong busyness values when a context is active on the engine, but GuC is idle. Use the RING TIMESTAMP as GPU timestamp to process the GuC busyness stats. This works since both GuC timestamp and RING timestamp are synced with the same clock. - The busyness stats may get updated after the batch starts running. This delay causes the busyness reported for 100us duration to fall below 95% in the selftest. The only option at this time is to wait for GuC busyness to change from idle to active before we sample busyness over a 100us period. Signed-off-by: John Harrison Signed-off-by: Umesh Nerlige Ramappa Acked-by: Tvrtko Ursulin Reviewed-by: Matthew Brost Link: https://patchwork.freedesktop.org/patch/msgid/20211027004821.66097-2-umesh.nerlige.ramappa@intel.com commit 344e694722b7612c00890ff29d402de8f49ffcd9 Author: Umesh Nerlige Ramappa Date: Tue Oct 26 17:48:20 2021 -0700 drm/i915/pmu: Add a name to the execlists stats In preparation for GuC pmu stats, add a name to the execlists stats structure so that it can be differentiated from the GuC stats. Signed-off-by: Umesh Nerlige Ramappa Reviewed-by: Matthew Brost Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20211027004821.66097-1-umesh.nerlige.ramappa@intel.com commit 4c3d005307c87c7a35e85a307b8bcf49f1d56114 Author: José Roberto de Souza Date: Wed Oct 27 11:05:45 2021 -0700 drm/i915/adlp: Extend PSR2 support in transcoder B PSR2 is supported in transcoder A and B on Alderlake-P. v2: - explicity checking for transcoder A and B to avoid invalid transcoder BSpec: 49185 Reviewed-by: Jouni Högander # v1 Cc: Jani Nikula Cc: Mika Kahola Cc: Jouni Hogander Signed-off-by: José Roberto de Souza Reviewed-by: Mika Kahola # v2 Link: https://patchwork.freedesktop.org/patch/msgid/20211027180545.55660-1-jose.souza@intel.com commit 2b3374306b315be02db0f67d3102a0d1e1357270 Author: Bjorn Andersson Date: Thu Oct 28 09:35:48 2021 -0700 drm/bridge: sn65dsi86: ti_sn65dsi86_read_u16() __maybe_unused When built without CONFIG_PWM there are no references to ti_sn65dsi86_read_u16(), avoid the W=1 build warning by marking the function as __maybe_unused. __maybe_unused is used insted of a #ifdef guard as it looks slighly cleaner and it avoids issues if in the future other permutations of the config options would use the function. Reported-by: kernel test robot Fixes: cea86c5bb442 ("drm/bridge: ti-sn65dsi86: Implement the pwm_chip") Signed-off-by: Bjorn Andersson Reviewed-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20211028163548.273736-1-bjorn.andersson@linaro.org Signed-off-by: Robert Foss commit e73c317efbf9a6ab2d1c18eff8343958ab6df73a Author: Guangming Cao Date: Thu Oct 14 18:25:51 2021 +0800 dma-buf: remove restriction of IOCTL:DMA_BUF_SET_NAME In this patch(https://patchwork.freedesktop.org/patch/310349), it add a new IOCTL to support dma-buf user to set debug name. But it also added a limitation of this IOCTL, it needs the attachments of dmabuf should be empty, otherwise it will fail. For the original series, the idea was that allowing name change mid-use could confuse the users about the dma-buf. However, the rest of the series also makes sure each dma-buf have a unique inode(https://patchwork.freedesktop.org/patch/310387/), and any accounting should probably use that, without relying on the name as much. So, removing this restriction will let dma-buf userspace users to use it more comfortably and without any side effect. Signed-off-by: Guangming Cao Link: https://patchwork.freedesktop.org/patch/msgid/20211014102551.54983-1-guangming.cao@mediatek.com Reviewed-by: Christian König Signed-off-by: Christian König commit 16aea0f32f1de320550ec3488bff9ca86b3848bf Author: Jani Nikula Date: Wed Oct 27 16:59:00 2021 +0300 drm/i915/dsc: demote noisy drm_info() to drm_kms_dbg() The PPS, RC_RANGE_PARAM, and RC_BUF_THRESH logging are clearly for debugging, and should not be info level messages. Reviewed-by: Manasi Navare Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20211027135900.6329-1-jani.nikula@intel.com commit 099afadc533febb0ad789ee61eef41a3d5d8bab2 Author: Anitha Chrisanthus Date: Wed Oct 6 16:27:21 2021 -0700 drm/kmb: Enable support for framebuffer console Enable support for fbcon (framebuffer console). v2: added missing static clk_enable v3: removed module parameter, use fbdev_emulation instead. Use preferred depth of 24 for color depth. (Thomas Z.) Signed-off-by: Anitha Chrisanthus Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20211019230719.789958-2-anitha.chrisanthus@intel.com commit 8f59ee9a570c2e9dec2b934d924264a64230d5d0 Author: Rob Clark Date: Mon Oct 25 17:15:36 2021 +0200 drm/msm/dsi: Adjust probe order Switch to the documented order dsi-host vs bridge probe. Tested-by: Amit Pundir Tested-by: Caleb Connolly Tested-by: John Stultz Signed-off-by: Rob Clark Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20211025151536.1048186-22-maxime@cerno.tech commit 4280e1a0ba1dca1e7c4c35d0c790dc8977d840a0 Author: Maxime Ripard Date: Mon Oct 25 17:15:35 2021 +0200 drm/kirin: dsi: Adjust probe order Without proper care and an agreement between how DSI hosts and devices drivers register their MIPI-DSI entities and potential components, we can end up in a situation where the drivers can never probe. Most drivers were taking evasive maneuvers to try to workaround this, but not all of them were following the same conventions, resulting in various incompatibilities between DSI hosts and devices. Now that we have a sequence agreed upon and documented, let's convert kirin to it. Acked-by: John Stultz Tested-by: John Stultz Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20211025151536.1048186-21-maxime@cerno.tech commit 4d77688ff27c7d030b5113f0cf0b0a2a433b2a62 Author: Maxime Ripard Date: Mon Oct 25 17:15:34 2021 +0200 drm/bridge: tc358775: Register and attach our DSI device at probe In order to avoid any probe ordering issue, the best practice is to move the secondary MIPI-DSI device registration and attachment to the MIPI-DSI host at probe time. Let's do this. Acked-by: Sam Ravnborg Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20211025151536.1048186-20-maxime@cerno.tech commit 526dcedf877fab36d2847fa1446975ab4285f226 Author: Maxime Ripard Date: Mon Oct 25 17:15:33 2021 +0200 drm/bridge: tc358775: Switch to devm MIPI-DSI helpers Let's switch to the new devm MIPI-DSI function to register and attach our secondary device. This also avoids leaking the device when we detach the bridge. Acked-by: Sam Ravnborg Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20211025151536.1048186-19-maxime@cerno.tech commit c3b75d4734cb82f7dfd42b0a8243f37bca85bd95 Author: Maxime Ripard Date: Mon Oct 25 17:15:32 2021 +0200 drm/bridge: sn65dsi86: Register and attach our DSI device at probe In order to avoid any probe ordering issue, the best practice is to move the secondary MIPI-DSI device registration and attachment to the MIPI-DSI host at probe time. Let's do this. Acked-by: Sam Ravnborg Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20211025151536.1048186-18-maxime@cerno.tech commit 77d2a71b94e3dd2966d8c595fc6443951f1e06f4 Author: Maxime Ripard Date: Mon Oct 25 17:15:31 2021 +0200 drm/bridge: sn65dsi86: Switch to devm MIPI-DSI helpers Let's switch to the new devm MIPI-DSI function to register and attach our secondary device. This also avoids leaking the device when we detach the bridge. Acked-by: Sam Ravnborg Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20211025151536.1048186-17-maxime@cerno.tech commit 6ef7ee48765fa3067858d11ecdf3acbc7c19df80 Author: Maxime Ripard Date: Mon Oct 25 17:15:30 2021 +0200 drm/bridge: sn65dsi83: Register and attach our DSI device at probe In order to avoid any probe ordering issue, the best practice is to move the secondary MIPI-DSI device registration and attachment to the MIPI-DSI host at probe time. Let's do this. Acked-by: Sam Ravnborg Tested-by: Laurent Pinchart Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20211025151536.1048186-16-maxime@cerno.tech commit 6cae235e9cd112da0a33dd261e2a01c93c825799 Author: Maxime Ripard Date: Mon Oct 25 17:15:29 2021 +0200 drm/bridge: sn65dsi83: Switch to devm MIPI-DSI helpers Let's switch to the new devm MIPI-DSI function to register and attach our secondary device. This also avoids leaking the device when we detach the bridge but don't remove its driver. Acked-by: Sam Ravnborg Tested-by: Laurent Pinchart Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20211025151536.1048186-15-maxime@cerno.tech commit c05f1a4e2c4b8a217b448828c4e59fb47454dc75 Author: Maxime Ripard Date: Mon Oct 25 17:15:28 2021 +0200 drm/bridge: sn65dsi83: Fix bridge removal Commit 24417d5b0c00 ("drm/bridge: ti-sn65dsi83: Implement .detach callback") moved the unregistration of the bridge DSI device and bridge itself to the detach callback. While this is correct for the DSI device detach and unregistration, the bridge is added in the driver probe, and should thus be removed as part of its remove callback. Acked-by: Sam Ravnborg Reviewed-by: Marek Vasut Fixes: 24417d5b0c00 ("drm/bridge: ti-sn65dsi83: Implement .detach callback") Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20211025151536.1048186-14-maxime@cerno.tech commit 7abbc26fd6673bd04d0044e001a7ce543427ff4b Author: Maxime Ripard Date: Mon Oct 25 17:15:27 2021 +0200 drm/bridge: ps8640: Register and attach our DSI device at probe In order to avoid any probe ordering issue, the best practice is to move the secondary MIPI-DSI device registration and attachment to the MIPI-DSI host at probe time. Let's do this. Acked-by: Sam Ravnborg Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20211025151536.1048186-13-maxime@cerno.tech commit fe93ae800eb846d435359b2d689410fdfc03f868 Author: Maxime Ripard Date: Mon Oct 25 17:15:26 2021 +0200 drm/bridge: ps8640: Switch to devm MIPI-DSI helpers Let's switch to the new devm MIPI-DSI function to register and attach our secondary device. This also avoids leaking the device on removal. Acked-by: Sam Ravnborg Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20211025151536.1048186-12-maxime@cerno.tech commit 4a46ace5ac621c0f84b3910bc3c93acf6c93963b Author: Maxime Ripard Date: Mon Oct 25 17:15:25 2021 +0200 drm/bridge: lt9611uxc: Register and attach our DSI device at probe In order to avoid any probe ordering issue, the best practice is to move the secondary MIPI-DSI device registration and attachment to the MIPI-DSI host at probe time. Let's do this. Acked-by: Sam Ravnborg Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20211025151536.1048186-11-maxime@cerno.tech commit 293ada7b058e536d9d53d0d8840c6ba8c2f718e4 Author: Maxime Ripard Date: Mon Oct 25 17:15:24 2021 +0200 drm/bridge: lt9611uxc: Switch to devm MIPI-DSI helpers Let's switch to the new devm MIPI-DSI function to register and attach our secondary device. Acked-by: Sam Ravnborg Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20211025151536.1048186-10-maxime@cerno.tech commit fef604db231230a0f2f376fa223fe296731b6333 Author: Maxime Ripard Date: Mon Oct 25 17:15:23 2021 +0200 drm/bridge: lt9611: Register and attach our DSI device at probe In order to avoid any probe ordering issue, the best practice is to move the secondary MIPI-DSI device registration and attachment to the MIPI-DSI host at probe time. Let's do this. Acked-by: Sam Ravnborg Tested-by: John Stultz Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20211025151536.1048186-9-maxime@cerno.tech commit b91df118e4ff36904d5e35db27dd0d0cee4deb45 Author: Maxime Ripard Date: Mon Oct 25 17:15:22 2021 +0200 drm/bridge: lt9611: Switch to devm MIPI-DSI helpers Let's switch to the new devm MIPI-DSI function to register and attach our secondary device. Acked-by: Sam Ravnborg Tested-by: John Stultz Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20211025151536.1048186-8-maxime@cerno.tech commit d89078c37b10f05fa4f4791b71db2572db361b68 Author: Maxime Ripard Date: Mon Oct 25 17:15:21 2021 +0200 drm/bridge: lt8912b: Register and attach our DSI device at probe In order to avoid any probe ordering issue, the best practice is to move the secondary MIPI-DSI device registration and attachment to the MIPI-DSI host at probe time. Let's do this. Acked-by: Sam Ravnborg Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20211025151536.1048186-7-maxime@cerno.tech commit 1fdbf66e3d40257902b4c5cdf872730dae24004f Author: Maxime Ripard Date: Mon Oct 25 17:15:20 2021 +0200 drm/bridge: lt8912b: Switch to devm MIPI-DSI helpers Let's switch to the new devm MIPI-DSI function to register and attach our secondary device. Acked-by: Sam Ravnborg Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20211025151536.1048186-6-maxime@cerno.tech commit 49e61bee26f746aaf2eba84ba3c9a90ab950ea05 Author: Maxime Ripard Date: Mon Oct 25 17:15:19 2021 +0200 drm/bridge: anx7625: Register and attach our DSI device at probe In order to avoid any probe ordering issue, the best practice is to move the secondary MIPI-DSI device registration and attachment to the MIPI-DSI host at probe time. Let's do this. Acked-by: Sam Ravnborg Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20211025151536.1048186-5-maxime@cerno.tech commit 25a390a9aadbf0c87b461e416c27c8838b35ae25 Author: Maxime Ripard Date: Mon Oct 25 17:15:18 2021 +0200 drm/bridge: anx7625: Switch to devm MIPI-DSI helpers Let's switch to the new devm MIPI-DSI function to register and attach our secondary device. Acked-by: Sam Ravnborg Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20211025151536.1048186-4-maxime@cerno.tech commit 864c49a31d6b84fd20748a003523fc2181fd54b1 Author: Maxime Ripard Date: Mon Oct 25 17:15:17 2021 +0200 drm/bridge: adv7511: Register and attach our DSI device at probe In order to avoid any probe ordering issue, the best practice is to move the secondary MIPI-DSI device registration and attachment to the MIPI-DSI host at probe time. Let's do this. Acked-by: Sam Ravnborg Tested-by: John Stultz Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20211025151536.1048186-3-maxime@cerno.tech commit ee9418808bcce77e2c31dbbfc58621ea99a05597 Author: Maxime Ripard Date: Mon Oct 25 17:15:16 2021 +0200 drm/bridge: adv7533: Switch to devm MIPI-DSI helpers Let's switch to the new devm MIPI-DSI function to register and attach our secondary device. This also avoids leaking the device when we detach the bridge. Acked-by: Sam Ravnborg Tested-by: John Stultz Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20211025151536.1048186-2-maxime@cerno.tech commit b9971e549adf85278a680f75dc78e4a734975e90 Author: Thomas Zimmermann Date: Tue Oct 26 19:57:00 2021 +0200 drm: Link CMA framebuffer helpers into KMS helper library Linking the CMA framebuffer helpers into a CMA helper library in commit 4b2b5e142ff4 ("drm: Move GEM memory managers into modules") results in linker errors: arm-linux-gnueabihf-ld: drivers/gpu/drm/drm_fb_cma_helper.o: \ in function `drm_fb_cma_get_gem_obj': \ drivers/gpu/drm/drm_fb_cma_helper.c:46: undefined reference \ to `drm_gem_fb_get_obj' arm-linux-gnueabihf-ld: drivers/gpu/drm/drm_fb_cma_helper.c:46: \ undefined reference to `drm_gem_fb_get_obj' arm-linux-gnueabihf-ld: drivers/gpu/drm/drm_fb_cma_helper.c:46: \ undefined reference to `drm_gem_fb_get_obj' arm-linux-gnueabihf-ld: drivers/gpu/drm/drm_fb_cma_helper.o: in \ function `drm_fb_cma_sync_non_coherent': \ drivers/gpu/drm/drm_fb_cma_helper.c:133: undefined reference \ to `drm_atomic_helper_damage_iter_init' arm-linux-gnueabihf-ld: drivers/gpu/drm/drm_fb_cma_helper.c:135: \ undefined reference to `drm_atomic_helper_damage_iter_next' Link the CMA framebuffer helpers into the KMS helper library to fix the problem. Signed-off-by: Thomas Zimmermann Fixes: 4b2b5e142ff4 ("drm: Move GEM memory managers into modules") Reviewed-by: Sam Ravnborg Tested-by: Naresh Kamboju Reported-by: Naresh Kamboju Reported-by: Linux Kernel Functional Testing Cc: Daniel Vetter Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: David Airlie Cc: Daniel Vetter Cc: dri-devel@lists.freedesktop.org Link: https://patchwork.freedesktop.org/patch/msgid/20211026175700.27664-1-tzimmermann@suse.de commit cea86c5bb4425cbbd0a690d1671b8a7db1cee9fc Author: Bjorn Andersson Date: Mon Oct 25 10:09:25 2021 -0700 drm/bridge: ti-sn65dsi86: Implement the pwm_chip The SN65DSI86 provides the ability to supply a PWM signal on GPIO 4, with the primary purpose of controlling the backlight of the attached panel. Add an implementation that exposes this using the standard PWM framework, to allow e.g. pwm-backlight to expose this to the user. Signed-off-by: Bjorn Andersson Reviewed-by: Uwe Kleine-König Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20211025170925.3096444-3-bjorn.andersson@linaro.org commit 3c7a8600dec9858da9e76adb622d161f27652b00 Author: Bjorn Andersson Date: Mon Oct 25 10:09:24 2021 -0700 drm/bridge: ti-sn65dsi86: Use regmap_bulk_write API The multi-register u16 write operation can use regmap_bulk_write() instead of two separate regmap_write() calls. It's uncertain if this has any effect on the actual updates of the underlying registers, but this at least gives the hardware the opportunity and saves us one transation on the bus. Signed-off-by: Bjorn Andersson Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20211025170925.3096444-2-bjorn.andersson@linaro.org commit 3ab7b6ac5d829e60c3b89d415811ff1c9f358c8e Author: Bjorn Andersson Date: Mon Oct 25 10:09:23 2021 -0700 pwm: Introduce single-PWM of_xlate function The existing pxa driver and the upcoming addition of PWM support in the TI sn565dsi86 DSI/eDP bridge driver both has a single PWM channel and thereby a need for a of_xlate function with the period as its single argument. Introduce a common helper function in the core that can be used as of_xlate by such drivers and migrate the pxa driver to use this. Signed-off-by: Bjorn Andersson Acked-by: Uwe Kleine-König Tested-by: Steev Klimaszewski Tested-By: Steev Klimaszewski Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20211025170925.3096444-1-bjorn.andersson@linaro.org commit 086b90c76fc18246b03aaf728d2f30a1a018a1b4 Author: Christian König Date: Mon Sep 13 14:20:13 2021 +0200 drm/etnaviv: replace dma_resv_get_excl_unlocked We certainly hold the reservation lock here, no need for the RCU dance. Signed-off-by: Christian König Acked-by: Nirmoy Das Link: https://patchwork.freedesktop.org/patch/msgid/20211025080532.177424-3-christian.koenig@amd.com commit 0e994828ec8819c1f22d651cf53f1b0c728bb0bb Author: Christian König Date: Tue Jun 15 18:54:34 2021 +0200 drm/etnaviv: use new iterator in etnaviv_gem_describe Instead of hand rolling the logic. Signed-off-by: Christian König Acked-by: Nirmoy Das Link: https://patchwork.freedesktop.org/patch/msgid/20211025080532.177424-2-christian.koenig@amd.com commit 64512a66b67e6546e2db15192b3603cd6d58b75c 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 commit 04bc1667cd031e4a4f74fc7b1d111af03b31dbe5 Author: Joonas Lahtinen Date: Mon Oct 25 16:49:07 2021 +0300 MAINTAINERS: Add Tvrtko as drm/i915 co-maintainer Add Tvrtko Ursulin as a co-maintainer for drm/i915 driver. Tvrtko will bring added bandwidth and focus to the GT/GEM domain (drm-intel-gt-next). This will help with the increased driver maintenance efforts, allows alternating the drm-intel-gt-next pull requests and also should increase the coverage for the maintenance in general. Signed-off-by: Joonas Lahtinen Cc: David Airlie Cc: Daniel Vetter Acked-by: Jani Nikula Acked-by: Rodrigo Vivi Acked-by: Tvrtko Ursulin Cc: Sean Paul Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: dri-devel@lists.freedesktop.org Acked-by: Daniel Vetter Acked-by: Dave Airlie Link: https://patchwork.freedesktop.org/patch/msgid/20211025134907.20078-1-joonas.lahtinen@linux.intel.com commit 818a1968a73188451fd1c16604b4e47ab5a40d6c Author: Ville Syrjälä Date: Fri Oct 22 13:33:04 2021 +0300 drm/i915: Nuke PIPE_CONFIG_QUIRK_BIGJOINER_SLAVE Now that the bigjoiner state readout/computation has been made to do the right thing nuke the related state checker quirk. Reviewed-by: Manasi Navare Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211022103304.24164-10-ville.syrjala@linux.intel.com commit e12d6218fda20d03960f3f2cca44741ba8d5e9a8 Author: Ville Syrjälä Date: Fri Oct 22 13:33:03 2021 +0300 drm/i915: Reduce bigjoiner special casing Try to make bigjoiner pipes less special. The main things here are that each pipe now does full clock computation/readout with its own shared_dpll reference. Also every pipe's cpu_transcoder always points correctly at the master transcoder. Due to the above changes state readout is now complete and all the related hacks can go away. The actual modeset sequence code is still a mess, but I think in order to clean that up properly we're probably going to have to redesign the modeset logic to treat transcoders vs. pipes separately. That is going to require significant amounts of work. Reviewed-by: Manasi Navare Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211022103304.24164-9-ville.syrjala@linux.intel.com commit 723559f379af5cd200bc981a723aaf3971f7a166 Author: Ville Syrjälä Date: Fri Oct 22 13:33:02 2021 +0300 drm/i915: Perform correct cpu_transcoder readout for bigjoiner Read out cpu_transcoder correctly for the bigjoiner slave pipes. Reviewed-by: Manasi Navare Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211022103304.24164-8-ville.syrjala@linux.intel.com commit 3126977d43079866aa0ea351863a7496feec98d2 Author: Ville Syrjälä Date: Fri Oct 22 13:33:01 2021 +0300 drm/i915: Split PPS write from DSC enable The PPS SDP is fed into the transcoder whereas the DSC block is (or at least can be) per pipe. Let's split these into two distinct operations in an effort to untagle the bigjoiner mess where we have two pipes feeding a single transcoder. Reviewed-by: Manasi Navare Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211022103304.24164-7-ville.syrjala@linux.intel.com commit e0bf3e23e2002461b0bff09c1cc0b92ddb8eafd8 Author: Ville Syrjälä Date: Fri Oct 22 13:33:00 2021 +0300 drm/i915: Simplify intel_crtc_copy_uapi_to_hw_state_nomodeset() Rewrite intel_crtc_copy_uapi_to_hw_state_nomodeset() in a slightly more straightforward manner. Reviewed-by: Manasi Navare Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211022103304.24164-6-ville.syrjala@linux.intel.com commit f2e19b586637a2e84f56b08d9f60de30373a0a01 Author: Ville Syrjälä Date: Fri Oct 22 13:32:59 2021 +0300 drm/i915: Introduce intel_master_crtc() Add a helper to determine the master crtc for bigjoiner usage. Also name the variables consistently. Reviewed-by: Manasi Navare Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211022103304.24164-5-ville.syrjala@linux.intel.com commit 39919997322f21d367347943ffd5ba8c4007c9ae Author: Ville Syrjälä Date: Fri Oct 22 13:32:58 2021 +0300 drm/i915: Disable all planes before modesetting any pipes Let's disable planes on all pipes affected by the modeset before we start doing the actual modeset. This means we have less random planes enabled during the modeset, and it also mirrors what we already do when enabling pipes on skl+ since we enable planes on all pipes as the very last step. As a bonus we also nuke a bunch og bigjoiner special casing. I've occasionally pondered about going even furher here and doing the pre_plane_update() stuff for all pipes first, then actually disabling the planes, and finally running the rest of the modeset sequence. This would potentially allow parallelizing all the extra vblank waits across multiple pipes, and would make the plane disable even more atomic. But let's go one step a time here. Cc: José Roberto de Souza Reviewed-by: Manasi Navare Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211022103304.24164-4-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza commit f28c5950d57b280f17b950f04125ed556252403e Author: Ville Syrjälä Date: Fri Oct 22 13:32:57 2021 +0300 Revert "drm/i915/display: Disable audio, DRRS and PSR before planes" Disabling planes in the middle of the modeset seuqnece does not make sense since userspace can anyway disable planes before the modeset even starts. So when the modeset seuqence starts the set of enabled planes is entirely arbitrary. Trying to sprinkle the plane disabling into the modeset sequence just means more randomness and potential for hard to reproduce bugs. So it makes most sense to just disable all planes first so that the rest of the modeset sequence remains identical regardless of which planes happen to be enabled by userspace at the time. This reverts commit 84030adb9e27d202a66022488bf0349a8bd45213. Cc: José Roberto de Souza Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211022103304.24164-3-ville.syrjala@linux.intel.com Reviewed-by: José Roberto de Souza commit 765972cb8564fb92f8cef6fac21995907d132e8c Author: Ville Syrjälä Date: Fri Oct 22 13:32:56 2021 +0300 drm/i915/psr: Disable PSR before modesets turn off all planes PSR2 apparently requires some planes to be enabled for some silly reason, and so we are now trying to turn PSR off before planes go off. Except during a full modeset that is handled less clearly through reorganization of the modeset sequence. That is not great as it makes the code mode complex, and prevents us from doing nice things such as just turning off all the planes at the very start of the modeset. So let's move the PSR pre_plane_update() thing to a spot where it will handle both full modesets and everything else. Cc: José Roberto de Souza Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211022103304.24164-2-ville.syrjala@linux.intel.com Reviewed-by: Jouni Högander commit f0e204e0d32159d783577a4041331fbe49e8beca Author: Mullati, Siva Date: Sat Oct 23 00:57:56 2021 +0530 drm/i915: abstraction for iosf to compile on all archs The asm/iosf_mbi.h header is x86-only. Let's make IOSF_MBI kconfig selection conditional to x86 and provide a header with stubs for other architectures. This helps getting i915 available for other architectures in future. Signed-off-by: Mullati, Siva Reviewed-by: Lucas De Marchi Signed-off-by: Lucas De Marchi Link: https://patchwork.freedesktop.org/patch/msgid/20211022192756.1228354-1-siva.mullati@intel.com commit fed98c16f13f4c68fc507384d3429516ef5c3b6d Author: José Roberto de Souza Date: Tue Oct 5 16:18:51 2021 -0700 drm/i915/display: Wait PSR2 get out of deep sleep to update pipe Alderlake-P was getting 'max time under evasion' messages when PSR2 is enabled, this is due PIPE_SCANLINE/PIPEDSL returning 0 over a period of time longer than VBLANK_EVASION_TIME_US. For PSR1 we had the same issue so intel_psr_wait_for_idle() was implemented to wait for PSR1 to get into idle state but nothing was done for PSR2. For PSR2 we can't only wait for idle state as PSR2 tends to keep into sleep state(ready to send selective updates). Waiting for any state below deep sleep proved to be effective in avoiding the evasion messages and also not wasted a lot of time. v2: - dropping the additional wait_for loops, only the _wait_for_atomic() is necessary - waiting for states below EDP_PSR2_STATUS_STATE_DEEP_SLEEP v3: - dropping intel_wait_for_condition_atomic() function 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/20211005231851.67698-1-jose.souza@intel.com commit bf0d608b55d9b7f426031dfd9f08d9df36c94728 Author: Jani Nikula Date: Tue Oct 26 12:34:07 2021 +0300 drm/i915/dp: fix integer overflow in 128b/132b data rate calculation The intermediate value 1000000 * 10 * 9671 overflows 32 bits, so force promotion to a bigger type. From the logs: [drm:intel_dp_compute_config [i915]] DP link rate required 3657063 available -580783288 v2: Use mul_u32_u32() (Ville) Fixes: 48efd014f0ea ("drm/i915/dp: add max data rate calculation for UHBR rates") Cc: Manasi Navare Cc: Ville Syrjälä Reviewed-by: Ville Syrjälä Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20211026093407.11381-1-jani.nikula@intel.com commit 55d5e4f98fde7f695fc6c08f46f85ab677f690a2 Author: Arnd Bergmann Date: Tue Oct 26 10:34:37 2021 +0200 dma-buf: st: fix error handling in test_get_fences() The new driver incorrectly unwinds after errors, as clang points out: drivers/dma-buf/st-dma-resv.c:295:7: error: variable 'i' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized] if (r) { ^ drivers/dma-buf/st-dma-resv.c:336:9: note: uninitialized use occurs here while (i--) ^ drivers/dma-buf/st-dma-resv.c:295:3: note: remove the 'if' if its condition is always false if (r) { ^~~~~~~~ drivers/dma-buf/st-dma-resv.c:288:6: error: variable 'i' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized] if (r) { ^ drivers/dma-buf/st-dma-resv.c:336:9: note: uninitialized use occurs here while (i--) ^ drivers/dma-buf/st-dma-resv.c:288:2: note: remove the 'if' if its condition is always false if (r) { ^~~~~~~~ drivers/dma-buf/st-dma-resv.c:280:10: note: initialize the variable 'i' to silence this warning int r, i; ^ = 0 Skip cleaning up the bits that have not been allocated at this point. Fixes: 1d51775cd3f5 ("dma-buf: add dma_resv selftest v4") Signed-off-by: Arnd Bergmann Reviewed-by: Arnd Bergmann Link: https://patchwork.freedesktop.org/patch/msgid/20211026083448.3471055-1-arnd@kernel.org Signed-off-by: Christian König commit 44653c400615a3fa3658caa72d765233cc897d80 Author: Yang Li Date: Tue Oct 19 15:37:26 2021 +0800 drm/panel: novatek-nt35950: remove unneeded semicolon Eliminate the following coccicheck warning: ./drivers/gpu/drm/panel/panel-novatek-nt35950.c:639:2-3: Unneeded semicolon Reported-by: Abaci Robot Fixes: 623a3531e9cf ("drm/panel: Add driver for Novatek NT35950 DSI DriverIC panels") Signed-off-by: Yang Li Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/1634629046-116842-1-git-send-email-yang.lee@linux.alibaba.com commit e15623cdce6fca662dbecd311f9d74bc61d0e1f2 Author: chongjiapeng Date: Tue Oct 19 18:40:29 2021 +0800 drm/panel: make sharp_ls055d1sx04 static This symbol is not used outside of panel-novatek-nt35950.c, so marks it static. Fixes the following sparse warning: drivers/gpu/drm/panel/panel-novatek-nt35950.c:671:33: warning: symbol 'sharp_ls055d1sx04' was not declared. Should it be static? Reported-by: Abaci Robot Fixes: 623a3531e9cf ("drm/panel: Add driver for Novatek NT35950 DSI DriverIC panels") Signed-off-by: chongjiapeng Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/1634640029-12335-1-git-send-email-jiapeng.chong@linux.alibaba.com commit d9c022d5dfea9f0b550a3d24ec786d39ff55ad6b Author: John Keeping Date: Wed Oct 20 16:34:30 2021 +0100 drm/panel: ilitek-ili9881c: Read panel orientation The panel orientation needs to parsed from a device-tree and assigned to the panel's connector in order to make orientation property available to userspace. That's what this patch does for ILI9881C based panels. Signed-off-by: John Keeping Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20211020153432.383845-4-john@metanate.com commit f4b2e66967bc4869cbc039a5417be4d8ad7ad1b4 Author: John Keeping Date: Wed Oct 20 16:34:29 2021 +0100 dt-bindings: ili9881c: add rotation property Allow the standard rotation property from panel-common for ILI9881C based panels. Signed-off-by: John Keeping Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20211020153432.383845-3-john@metanate.com commit 62b51e4be63cdbfb30d8009f9955ad8d644e930e Author: John Keeping Date: Wed Oct 20 16:34:28 2021 +0100 dt-bindings: ili9881c: add missing panel-common inheritance The properties below refer to items in panel-common.yaml, which means that needs to be referenced in the schema. Signed-off-by: John Keeping Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20211020153432.383845-2-john@metanate.com commit 86752bd613c9a8deb6e7de499f0c3ac139b58b6f Author: Wan Jiabing Date: Mon Oct 25 07:32:50 2021 -0400 drm/i915: Use ERR_CAST instead of ERR_PTR(PTR_ERR()) Fix following coccicheck warning: ./drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:3117:15-22: WARNING: ERR_CAST can be used with eb->requests[i]. Signed-off-by: Wan Jiabing Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20211025113316.24424-1-wanjiabing@vivo.com commit c4ae82a0e9222d275e3e4dd91c1cc3931ac0eca1 Author: He Ying Date: Thu Oct 21 22:22:43 2021 -0400 drm: Small optimization to intel_dp_mst_atomic_master_trans_check If we want to return from for_each_intel_connector_iter(), one way is calling drm_connector_list_iter_end() before returning to avoid memleak. The other way is just breaking from the bracket and then returning after the outside drm_connector_list_iter_end(). Obviously, the second way makes code smaller and more clear. Apply it to the function intel_dp_mst_atomic_master_trans_check(). Signed-off-by: He Ying Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211022022243.138860-1-heying24@huawei.com commit c603bf1f94d0ef8ce3ef081112eae13cd744ef17 Author: Sean Wang Date: Tue Oct 19 05:30:21 2021 +0800 Bluetooth: btmtksdio: add MT7921s Bluetooth support add MT7921s Bluetooth support Co-developed-by: Mark-yw Chen Signed-off-by: Mark-yw Chen Signed-off-by: Sean Wang Signed-off-by: Marcel Holtmann commit 1705643faecde95bdeb11bea5ab5baed084e9f91 Author: Sean Wang Date: Tue Oct 19 05:30:20 2021 +0800 mmc: add MT7921 SDIO identifiers for MediaTek Bluetooth devices The MT7961 SDIO identifier for MediaTek Bluetooth devices were being referred in the MediaTek Bluetooth driver. Co-developed-by: Mark-yw Chen Signed-off-by: Mark-yw Chen Signed-off-by: Sean Wang Signed-off-by: Marcel Holtmann commit 10fe40e1d70a6a6e5210281cebb124d87c41581b Author: Mark-yw Chen Date: Tue Oct 19 05:30:19 2021 +0800 Bluetooth: btmtksdio: transmit packet according to status TX_EMPTY Each packet should be sent out until the device emits the TX_EMPTY signal to the host, that is firmware people suggested to add to meet the actual firmware behavior and that is compatible among all the devices. Co-developed-by: Sean Wang Signed-off-by: Sean Wang Signed-off-by: Mark-yw Chen Signed-off-by: Marcel Holtmann commit 184ea403ccfc1ba04b75908de4eace979ce2ce4e Author: Sean Wang Date: Tue Oct 19 05:30:18 2021 +0800 Bluetooth: btmtksdio: use register CRPLR to read packet length That is a preliminary patch to introduce mt7921s support. Use the register CRPLR to read packet length to make all the devices share the common logic. Co-developed-by: Mark-yw Chen Signed-off-by: Mark-yw Chen Signed-off-by: Sean Wang Signed-off-by: Marcel Holtmann commit 5b23ac1adbc55fc0cda3553a12a6ec4785af748a Author: Sean Wang Date: Tue Oct 19 05:30:17 2021 +0800 Bluetooth: btmtksdio: update register CSDIOCSR operation That is a preliminary patch to introduce mt7921s support. Update register CSDIOCSR operation that is suggested from the vendor driver and is compatible to the all devices. Co-developed-by: Mark-yw Chen Signed-off-by: Mark-yw Chen Signed-off-by: Sean Wang Signed-off-by: Marcel Holtmann commit 26270bc189ea4b5a8356ec99561357fc87f00b32 Author: Sean Wang Date: Tue Oct 19 05:30:16 2021 +0800 Bluetooth: btmtksdio: move interrupt service to work btmtksdio belongs to WIFI/BT combo chip that would serve two radios in one sdio_irq so that we have to move interrupt service to worker to ensure ISR as short as possible. The worker would serve the both Tx and Rx in a batch to effectively reduce many interrupts to the host and to avoid excessive sdio lock contention between various context (even from WiFi driver) and help to be more efficient to complete command/event transation. Co-developed-by: Mark-yw Chen Signed-off-by: Mark-yw Chen Signed-off-by: Sean Wang Signed-off-by: Marcel Holtmann commit 77b210d1ae7870159f4ec9ab10b0c29d661b7f99 Author: Sean Wang Date: Tue Oct 19 05:30:15 2021 +0800 Bluetooth: btmtksdio: explicitly set WHISR as write-1-clear That is a preliminary patch to introduce mt7921s support. Explicitly set WHISR as write-1-clear method to all devices that is the expected behavior the driver rely on. Co-developed-by: Mark-yw Chen Signed-off-by: Mark-yw Chen Signed-off-by: Sean Wang Signed-off-by: Marcel Holtmann commit 877ec9e1d07b631587dbaf205ed929fa08579adf Author: Sean Wang Date: Tue Oct 19 05:30:14 2021 +0800 Bluetooth: btmtksdio: add .set_bdaddr support add .set_bdaddr support Signed-off-by: Sean Wang Signed-off-by: Marcel Holtmann commit 3a722044aacf7f8524226951515dbc0390e030e0 Author: Sean Wang Date: Tue Oct 19 05:30:13 2021 +0800 Bluetooth: btmtksido: rely on BT_MTK module Rely on btmtk module to reduce duplicated code Signed-off-by: Sean Wang Signed-off-by: Marcel Holtmann commit 8c0d17b6b06c5bef45de7e08c5c3cab8367f6cbc Author: Sean Wang Date: Tue Oct 19 05:30:12 2021 +0800 Bluetooth: mediatek: add BT_MTK module Add BT_MTK module that is a preliminary patch to introduce mt7921s support to share the logic betweem btusb and btmtksdio. Signed-off-by: Sean Wang Signed-off-by: Marcel Holtmann commit bca10db67bdaf15997a5a2a276e7aa9b6eea1393 Author: Maxime Ripard Date: Thu Sep 23 20:50:13 2021 +0200 drm/vc4: crtc: Make sure the HDMI controller is powered when disabling Since commit 875a4d536842 ("drm/vc4: drv: Disable the CRTC at boot time"), during the initial setup of the driver we call into the VC4 HDMI controller hooks to make sure the controller is properly disabled. However, we were never making sure that the device was properly powered while doing so. This never resulted in any (reported) issue in practice, but since the introduction of commit 4209f03fcb8e ("drm/vc4: hdmi: Warn if we access the controller while disabled") we get a loud complaint when we do that kind of access. Let's make sure we have the HDMI controller properly powered while disabling it. Fixes: 875a4d536842 ("drm/vc4: drv: Disable the CRTC at boot time") Signed-off-by: Maxime Ripard Reviewed-by: Nicolas Saenz Julienne Tested-by: Nicolas Saenz Julienne Link: https://patchwork.freedesktop.org/patch/msgid/20210923185013.826679-1-maxime@cerno.tech commit 14e193b95604182a338e3721385e3d8a56d3c5a8 Author: Maxime Ripard Date: Thu Aug 19 15:59:31 2021 +0200 drm/vc4: hdmi: Warn if we access the controller while disabled We've had many silent hangs where the kernel would look like it just stalled due to the access to one of the HDMI registers while the controller was disabled. Add a warning if we're about to do that so that it's at least not silent anymore. Reviewed-by: Dave Stevenson Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20210819135931.895976-7-maxime@cerno.tech commit 20b0dfa86bef0e80b41b0e5ac38b92f23b6f27f9 Author: Maxime Ripard Date: Thu Aug 19 15:59:30 2021 +0200 drm/vc4: hdmi: Make sure the device is powered with CEC Similarly to what we encountered with the detect hook with DRM, nothing actually prevents any of the CEC callback from being run while the HDMI output is disabled. However, this is an issue since any register access to the controller when it's powered down will result in a silent hang. Let's make sure we run the runtime_pm hooks when the CEC adapter is opened and closed by the userspace to avoid that issue. Fixes: 15b4511a4af6 ("drm/vc4: add HDMI CEC support") Reviewed-by: Dave Stevenson Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20210819135931.895976-6-maxime@cerno.tech commit 724fc856c09e9ee6ca85d701231c69ae587ef179 Author: Maxime Ripard Date: Thu Aug 19 15:59:29 2021 +0200 drm/vc4: hdmi: Split the CEC disable / enable functions in two In order to ease further additions to the CEC enable and disable, let's split the function into two functions, one to enable and the other to disable. Reviewed-by: Dave Stevenson Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20210819135931.895976-5-maxime@cerno.tech commit caa51a4c11f1cadba9bcf61ed9e0105711952ce7 Author: Maxime Ripard Date: Thu Aug 19 15:59:28 2021 +0200 drm/vc4: hdmi: Rework the pre_crtc_configure error handling Since our pre_crtc_configure hook returned void, we didn't implement a goto-based error path handling, leading to errors like failing to put back the device in pm_runtime in all the error paths, but also failing to disable the pixel clock if clk_set_min_rate on the HSM clock fails. Move to a goto-based implementation to have an easier consitency. Fixes: 4f6e3d66ac52 ("drm/vc4: Add runtime PM support to the HDMI encoder driver") Link: https://patchwork.freedesktop.org/patch/msgid/20210819135931.895976-4-maxime@cerno.tech Reviewed-by: Dave Stevenson Signed-off-by: Maxime Ripard commit 9c6e4f6ed1d61d5f46946e5c151ceb279eedadb1 Author: Maxime Ripard Date: Thu Aug 19 15:59:27 2021 +0200 drm/vc4: hdmi: Make sure the controller is powered up during bind In the bind hook, we actually need the device to have the HSM clock running during the final part of the display initialisation where we reset the controller and initialise the CEC component. Failing to do so will result in a complete, silent, hang of the CPU. Fixes: 411efa18e4b0 ("drm/vc4: hdmi: Move the HSM clock enable to runtime_pm") Link: https://patchwork.freedesktop.org/patch/msgid/20210819135931.895976-3-maxime@cerno.tech Reviewed-by: Dave Stevenson Signed-off-by: Maxime Ripard commit 0f5251339eda7f7eb7bd4467607ae1d01b24e129 Author: Maxime Ripard Date: Wed Sep 22 14:54:19 2021 +0200 drm/vc4: hdmi: Make sure the controller is powered in detect If the HPD GPIO is not available and drm_probe_ddc fails, we end up reading the HDMI_HOTPLUG register, but the controller might be powered off resulting in a CPU hang. Make sure we have the power domain and the HSM clock powered during the detect cycle to prevent the hang from happening. Fixes: 4f6e3d66ac52 ("drm/vc4: Add runtime PM support to the HDMI encoder driver") Signed-off-by: Maxime Ripard Reviewed-by: Dave Stevenson Reviewed-by: Nicolas Saenz Julienne Tested-by: Nicolas Saenz Julienne Tested-by: Michael Stapelberg Link: https://patchwork.freedesktop.org/patch/msgid/20210922125419.4125779-6-maxime@cerno.tech commit c86b41214362e8e715e1343e16d5d6af0562db05 Author: Maxime Ripard Date: Wed Sep 22 14:54:18 2021 +0200 drm/vc4: hdmi: Move the HSM clock enable to runtime_pm In order to access the HDMI controller, we need to make sure the HSM clock is enabled. If we were to access it with the clock disabled, the CPU would completely hang, resulting in an hard crash. Since we have different code path that would require it, let's move that clock enable / disable to runtime_pm that will take care of the reference counting for us. Since we also want to change the HSM clock rate and it's only valid while the clock is disabled, we need to move the clk_set_min_rate() call on the HSM clock above pm_runtime_get_and_sync(). Fixes: 4f6e3d66ac52 ("drm/vc4: Add runtime PM support to the HDMI encoder driver") Signed-off-by: Maxime Ripard Reviewed-by: Dave Stevenson Reviewed-by: Nicolas Saenz Julienne Tested-by: Nicolas Saenz Julienne Tested-by: Michael Stapelberg Link: https://patchwork.freedesktop.org/patch/msgid/20210922125419.4125779-5-maxime@cerno.tech Link: https://lore.kernel.org/linux-arm-kernel/20210924152334.1342630-1-maxime@cerno.tech/ commit 3e85b81591609bb794bb00cd619b20965b5b38cd Author: Maxime Ripard Date: Wed Sep 22 14:54:17 2021 +0200 drm/vc4: hdmi: Set a default HSM rate When the firmware doesn't setup the HSM rate (such as when booting without an HDMI cable plugged in), its rate is 0 and thus any register access results in a CPU stall, even though HSM is enabled. Let's enforce a minimum rate at boot to avoid this issue. Fixes: 4f6e3d66ac52 ("drm/vc4: Add runtime PM support to the HDMI encoder driver") Signed-off-by: Maxime Ripard Reviewed-by: Nicolas Saenz Julienne Tested-by: Nicolas Saenz Julienne Tested-by: Michael Stapelberg Link: https://patchwork.freedesktop.org/patch/msgid/20210922125419.4125779-4-maxime@cerno.tech commit 8ca011ef4af48a7af7b15afd8a4a44039dd04cea Author: Maxime Ripard Date: Wed Sep 22 14:54:16 2021 +0200 clk: bcm-2835: Remove rounding up the dividers The driver, once it found a divider, tries to round it up by increasing the least significant bit of the fractional part by one when the round_up argument is set and there's a remainder. However, since it increases the divider it will actually reduce the clock rate below what we were asking for, leading to issues with clk_set_min_rate() that will complain that our rounded clock rate is below the minimum of the rate. Since the dividers are fairly precise already, let's remove that part so that we can have clk_set_min_rate() working. This is effectively a revert of 9c95b32ca093 ("clk: bcm2835: add a round up ability to the clock divisor"). Fixes: 9c95b32ca093 ("clk: bcm2835: add a round up ability to the clock divisor") Signed-off-by: Maxime Ripard Acked-by: Stephen Boyd Reviewed-by: Nicolas Saenz Julienne Tested-by: Nicolas Saenz Julienne # boot and basic functionality Tested-by: Michael Stapelberg Link: https://patchwork.freedesktop.org/patch/msgid/20210922125419.4125779-3-maxime@cerno.tech commit 5517357a4733d7cf7c17fc79d0530cfa47add372 Author: Maxime Ripard Date: Wed Sep 22 14:54:15 2021 +0200 clk: bcm-2835: Pick the closest clock rate The driver currently tries to pick the closest rate that is lower than the rate being requested. This causes an issue with clk_set_min_rate() since it actively checks for the rounded rate to be above the minimum that was just set. Let's change the logic a bit to pick the closest rate to the requested rate, no matter if it's actually higher or lower. Fixes: 6d18b8adbe67 ("clk: bcm2835: Support for clock parent selection") Signed-off-by: Maxime Ripard Acked-by: Stephen Boyd Reviewed-by: Nicolas Saenz Julienne Tested-by: Nicolas Saenz Julienne # boot and basic functionality Tested-by: Michael Stapelberg Link: https://patchwork.freedesktop.org/patch/msgid/20210922125419.4125779-2-maxime@cerno.tech commit 736638246ec215f999dd132334d2d7c49bcb85c7 Merge: 525bbf72dbe00 6f2f7c83303d2 Author: Maxime Ripard Date: Mon Oct 25 15:27:56 2021 +0200 Merge drm/drm-next into drm-misc-next drm-misc-next hasn't been updated in a while and I need a post -rc2 state to merge some vc4 patches. Signed-off-by: Maxime Ripard commit 2d6d4089ea894cf8eb481b10769160a35c181360 Author: Paul Cercueil Date: Sat Oct 23 11:10:27 2021 +0100 Bluetooth: hci_bcm: Remove duplicated entry in OF table The entry "brcm,bcm4330-bt" was listed twice in the table. Signed-off-by: Paul Cercueil Signed-off-by: Marcel Holtmann commit b5e6fa7a12572c82f1e7f2f51fbb02a322291291 Author: Johan Hovold Date: Mon Oct 25 13:39:44 2021 +0200 Bluetooth: bfusb: fix division by zero in send path Add the missing bulk-out endpoint sanity check to probe() to avoid division by zero in bfusb_send_frame() 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")). Cc: stable@vger.kernel.org Signed-off-by: Johan Hovold Signed-off-by: Marcel Holtmann commit 2a7ca7459d905febf519163bd9e3eed894de6bb7 Author: Wang Hai Date: Mon Oct 25 21:10:12 2021 +0800 Bluetooth: cmtp: fix possible panic when cmtp_init_sockets() fails I got a kernel BUG report when doing fault injection test: ------------[ cut here ]------------ kernel BUG at lib/list_debug.c:45! ... RIP: 0010:__list_del_entry_valid.cold+0x12/0x4d ... Call Trace: proto_unregister+0x83/0x220 cmtp_cleanup_sockets+0x37/0x40 [cmtp] cmtp_exit+0xe/0x1f [cmtp] do_syscall_64+0x35/0xb0 entry_SYSCALL_64_after_hwframe+0x44/0xae If cmtp_init_sockets() in cmtp_init() fails, cmtp_init() still returns success. This will cause a kernel bug when accessing uncreated ctmp related data when the module exits. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-by: Hulk Robot Signed-off-by: Wang Hai Signed-off-by: Marcel Holtmann commit fc7bf4c0d65a342b29fe38c332db3fe900b481b9 Author: Kai Song Date: Fri Oct 22 20:06:55 2021 +0800 drm/i915/selftests: Fix inconsistent IS_ERR and PTR_ERR Fix inconsistent IS_ERR and PTR_ERR in i915_gem_dmabuf.c Signed-off-by: Kai Song Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20211022120655.22173-1-songkai01@inspur.com commit 525bbf72dbe0004a009dc39b239dec74e8007f6f Author: Christian König Date: Mon Sep 13 13:47:53 2021 +0200 drm: use new iterator in drm_gem_plane_helper_prepare_fb v3 Makes the handling a bit more complex, but avoids the use of dma_resv_get_excl_unlocked(). v2: improve coding and documentation v3: adjust the TODO comment as suggested by Daniel Signed-off-by: Christian König Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20211005113742.1101-25-christian.koenig@amd.com commit 12a9917e9e84fef4efa73c09b32870df0b1ed795 Author: Matthew Brost Date: Wed Oct 20 12:21:47 2021 -0700 drm/i915/guc: Fix recursive lock in GuC submission Use __release_guc_id (lock held) rather than release_guc_id (acquires lock), add lockdep annotations. 213.280129] i915: Running i915_perf_live_selftests/live_noa_gpr [ 213.283459] ============================================ [ 213.283462] WARNING: possible recursive locking detected {{[ 213.283466] 5.15.0-rc6+ #18 Tainted: G U W }} [ 213.283470] -------------------------------------------- [ 213.283472] kworker/u24:0/8 is trying to acquire lock: [ 213.283475] ffff8ffc4f6cc1e8 (&guc->submission_state.lock){....}-{2:2}, at: destroyed_worker_func+0x2df/0x350 [i915] {{[ 213.283618] }} {{ but task is already holding lock:}} [ 213.283621] ffff8ffc4f6cc1e8 (&guc->submission_state.lock){....}-{2:2}, at: destroyed_worker_func+0x4f/0x350 [i915] {{[ 213.283720] }} {{ other info that might help us debug this:}} [ 213.283724] Possible unsafe locking scenario:[ 213.283727] CPU0 [ 213.283728] ---- [ 213.283730] lock(&guc->submission_state.lock); [ 213.283734] lock(&guc->submission_state.lock); {{[ 213.283737] }} {{ *** DEADLOCK ***}}[ 213.283740] May be due to missing lock nesting notation[ 213.283744] 3 locks held by kworker/u24:0/8: [ 213.283747] #0: ffff8ffb80059d38 ((wq_completion)events_unbound){..}-{0:0}, at: process_one_work+0x1f3/0x550 [ 213.283757] #1: ffffb509000e3e78 ((work_completion)(&guc->submission_state.destroyed_worker)){..}-{0:0}, at: process_one_work+0x1f3/0x550 [ 213.283766] #2: ffff8ffc4f6cc1e8 (&guc->submission_state.lock){....}-{2:2}, at: destroyed_worker_func+0x4f/0x350 [i915] {{[ 213.283860] }} {{ stack backtrace:}} [ 213.283863] CPU: 8 PID: 8 Comm: kworker/u24:0 Tainted: G U W 5.15.0-rc6+ #18 [ 213.283868] Hardware name: ASUS System Product Name/PRIME B560M-A AC, BIOS 0403 01/26/2021 [ 213.283873] Workqueue: events_unbound destroyed_worker_func [i915] [ 213.283957] Call Trace: [ 213.283960] dump_stack_lvl+0x57/0x72 [ 213.283966] __lock_acquire.cold+0x191/0x2d3 [ 213.283972] lock_acquire+0xb5/0x2b0 [ 213.283978] ? destroyed_worker_func+0x2df/0x350 [i915] [ 213.284059] ? destroyed_worker_func+0x2d7/0x350 [i915] [ 213.284139] ? lock_release+0xb9/0x280 [ 213.284143] _raw_spin_lock_irqsave+0x48/0x60 [ 213.284148] ? destroyed_worker_func+0x2df/0x350 [i915] [ 213.284226] destroyed_worker_func+0x2df/0x350 [i915] [ 213.284310] process_one_work+0x270/0x550 [ 213.284315] worker_thread+0x52/0x3b0 [ 213.284319] ? process_one_work+0x550/0x550 [ 213.284322] kthread+0x135/0x160 [ 213.284326] ? set_kthread_struct+0x40/0x40 [ 213.284331] ret_from_fork+0x1f/0x30 and a bit later in the trace: {{ 227.499864] do_raw_spin_lock+0x94/0xa0}} [ 227.499868] _raw_spin_lock_irqsave+0x50/0x60 [ 227.499871] ? guc_flush_destroyed_contexts+0x4f/0xf0 [i915] [ 227.499995] guc_flush_destroyed_contexts+0x4f/0xf0 [i915] [ 227.500104] intel_guc_submission_reset_prepare+0x99/0x4b0 [i915] [ 227.500209] ? mark_held_locks+0x49/0x70 [ 227.500212] intel_uc_reset_prepare+0x46/0x50 [i915] [ 227.500320] reset_prepare+0x78/0x90 [i915] [ 227.500412] __intel_gt_set_wedged.part.0+0x13/0xe0 [i915] [ 227.500485] intel_gt_set_wedged.part.0+0x54/0x100 [i915] [ 227.500556] intel_gt_set_wedged_on_fini+0x1a/0x30 [i915] [ 227.500622] intel_gt_driver_unregister+0x1e/0x60 [i915] [ 227.500694] i915_driver_remove+0x4a/0xf0 [i915] [ 227.500767] i915_pci_probe+0x84/0x170 [i915] [ 227.500838] local_pci_probe+0x42/0x80 [ 227.500842] pci_device_probe+0xd9/0x190 [ 227.500844] really_probe+0x1f2/0x3f0 [ 227.500847] __driver_probe_device+0xfe/0x180 [ 227.500848] driver_probe_device+0x1e/0x90 [ 227.500850] __driver_attach+0xc4/0x1d0 [ 227.500851] ? __device_attach_driver+0xe0/0xe0 [ 227.500853] ? __device_attach_driver+0xe0/0xe0 [ 227.500854] bus_for_each_dev+0x64/0x90 [ 227.500856] bus_add_driver+0x12e/0x1f0 [ 227.500857] driver_register+0x8f/0xe0 [ 227.500859] i915_init+0x1d/0x8f [i915] [ 227.500934] ? 0xffffffffc144a000 [ 227.500936] do_one_initcall+0x58/0x2d0 [ 227.500938] ? rcu_read_lock_sched_held+0x3f/0x80 [ 227.500940] ? kmem_cache_alloc_trace+0x238/0x2d0 [ 227.500944] do_init_module+0x5c/0x270 [ 227.500946] __do_sys_finit_module+0x95/0xe0 [ 227.500949] do_syscall_64+0x38/0x90 [ 227.500951] entry_SYSCALL_64_after_hwframe+0x44/0xae [ 227.500953] RIP: 0033:0x7ffa59d2ae0d [ 227.500954] Code: c8 0c 00 0f 05 eb a9 66 0f 1f 44 00 00 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 3b 80 0c 00 f7 d8 64 89 01 48 [ 227.500955] RSP: 002b:00007fff320bbf48 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 [ 227.500956] RAX: ffffffffffffffda RBX: 00000000022ea710 RCX: 00007ffa59d2ae0d [ 227.500957] RDX: 0000000000000000 RSI: 00000000022e1d90 RDI: 0000000000000004 [ 227.500958] RBP: 0000000000000020 R08: 00007ffa59df3a60 R09: 0000000000000070 [ 227.500958] R10: 00000000022e1d90 R11: 0000000000000246 R12: 00000000022e1d90 [ 227.500959] R13: 00000000022e58e0 R14: 0000000000000043 R15: 00000000022e42c0 v2: (CI build) - Fix build error Fixes: 1a52faed31311 ("drm/i915/guc: Take GT PM ref when deregistering context") Signed-off-by: Matthew Brost Cc: stable@vger.kernel.org Reviewed-by: Thomas Hellström Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20211020192147.8048-1-matthew.brost@intel.com commit 393211e118eb8c3946cdee18e97fddb396f11ef5 Author: Matthew Brost Date: Thu Oct 21 14:40:40 2021 -0700 drm/i915/selftests: Update live.evict to wait on requests / idle GPU after each loop Update live.evict to wait on last request and idle GPU after each loop. This not only enhances the test to fill the GGTT on each engine class but also avoid timeouts from igt_flush_test when using GuC submission. igt_flush_test (idle GPU) can take a long time with GuC submission if losts of contexts are created due to H2G / G2H required to destroy contexts. Signed-off-by: Matthew Brost Reviewed-by: Thomas Hellström Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20211021214040.33292-1-matthew.brost@intel.com commit 7c287113f1c83b238068bd4b550cc8b0a73528a1 Author: Matthew Brost Date: Mon Oct 11 10:57:04 2021 -0700 drm/i915/selftests: Increase timeout in requests perf selftest perf_parallel_engines is micro benchmark to test i915 request scheduling. The test creates a thread per physical engine and submits NOP requests and waits the requests to complete in a loop. In execlists mode this works perfectly fine as powerful CPU has enough cores to feed each engine and process the CSBs. With GuC submission the uC gets overwhelmed as all threads feed into a single CTB channel and the GuC gets bombarded with CSBs as contexts are immediately switched in and out on the engines due to the zero runtime of the requests. When the GuC is overwhelmed scheduling of contexts is unfair due to the nature of the GuC scheduling algorithm. This behavior is understood and deemed acceptable as this micro benchmark isn't close to real world use case. Increasing the timeout of wait period for requests to complete. This makes the test understand that is ok for contexts to get starved in this scenario. A future patch / cleanup may just delete these micro benchmark tests as they basically mean nothing. We care about real workloads not made up ones. Signed-off-by: Matthew Brost Reviewed-by: John Harrison Reviewed-by: Thomas Hellström Signed-off-by: John Harrison Link: https://patchwork.freedesktop.org/patch/msgid/20211011175704.28509-1-matthew.brost@intel.com commit 4b2b5e142ff499a2bef2b8db0272bbda1088a3fe Author: Thomas Zimmermann Date: Wed Oct 20 15:19:41 2021 +0200 drm: Move GEM memory managers into modules DRM core uses the GEM base object to access GEM functionality. It does not depend on individual implementations. Move the code into modules. Also move the CMA framebuffer helpers into the CMA's module, as they're not usable without CMA. Signed-off-by: Thomas Zimmermann Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20211020131941.15367-4-tzimmermann@suse.de commit 72071beec8fbf760945c6f155fd4db394dd2fdda Author: Thomas Zimmermann Date: Wed Oct 20 15:19:40 2021 +0200 drm: Link several object files into drm_kms_helper.ko Several core DRM functions are not used by the DRM core. Link the object files into the KMS helper library. Signed-off-by: Thomas Zimmermann Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20211020131941.15367-3-tzimmermann@suse.de commit 9d27478c7c01c9a04938a751fe2345cb951a3a0c Author: Thomas Zimmermann Date: Wed Oct 20 15:19:39 2021 +0200 drm: Build drm_irq.o only if CONFIG_DRM_LEGACY has been set All code in drm_irq.o is for legacy UMs drivers. Only build and link the file if CONFIG_DRM_LEGACY has been enabled. Signed-off-by: Thomas Zimmermann Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20211020131941.15367-2-tzimmermann@suse.de commit 25b8a14e88d9cd80ba34f5310cf1e11c4eadc647 Author: Christian König Date: Tue Jun 15 20:30:10 2021 +0200 drm/amdgpu: use new iterator in amdgpu_ttm_bo_eviction_valuable Simplifying the code a bit. Signed-off-by: Christian König Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20211005113742.1101-13-christian.koenig@amd.com commit 930ca2a7cbb6df5e5377938a372d8896d669f086 Author: Christian König Date: Tue Jun 15 20:26:00 2021 +0200 drm/amdgpu: use the new iterator in amdgpu_sync_resv Simplifying the code a bit. Signed-off-by: Christian König Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20211005113742.1101-12-christian.koenig@amd.com commit 1d51775cd3f51899ce85afab686c7f641ff32d4e Author: Christian König Date: Fri Sep 24 17:10:19 2021 +0200 dma-buf: add dma_resv selftest v4 Just exercising a very minor subset of the functionality, but already proven useful. v2: add missing locking v3: some more cleanup and consolidation, add unlocked test as well v4: add a dma_resv_get_fences selftest Signed-off-by: Christian König Reviewed-by: Tvrtko Ursulin (v3) Reviewed-by: Daniel Vetter (v3) Link: https://patchwork.freedesktop.org/patch/msgid/20211005113742.1101-4-christian.koenig@amd.com commit 5d12ffe6bedb0e86b22dd436bb2245fdc540f780 Author: Matthew Auld Date: Mon Oct 18 10:10:55 2021 +0100 drm/i915/ttm: enable shmem tt backend Turn on the shmem tt backend, and enable shrinking. Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20211018091055.1998191-8-matthew.auld@intel.com commit 2eda4fc6d005b51271642ebfae4ac00e15618a23 Author: Matthew Auld Date: Mon Oct 18 10:10:54 2021 +0100 drm/i915/ttm: use cached system pages when evicting lmem This should let us do an accelerated copy directly to the shmem pages when temporarily moving lmem-only objects, where the i915-gem shrinker can later kick in to swap out the pages, if needed. Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20211018091055.1998191-7-matthew.auld@intel.com commit ebd4a8ec7799b1ce6969acf04432f4980179986a Author: Matthew Auld Date: Mon Oct 18 10:10:53 2021 +0100 drm/i915/ttm: move shrinker management into adjust_lru We currently just evict lmem objects to system memory when under memory pressure. For this case we might lack the usual object mm.pages, which effectively hides the pages from the i915-gem shrinker, until we actually "attach" the TT to the object, or in the case of lmem-only objects it just gets migrated back to lmem when touched again. For all cases we can just adjust the i915 shrinker LRU each time we also adjust the TTM LRU. The two cases we care about are: 1) When something is moved by TTM, including when initially populating an object. Importantly this covers the case where TTM moves something from lmem <-> smem, outside of the normal get_pages() interface, which should still ensure the shmem pages underneath are reclaimable. 2) When calling into i915_gem_object_unlock(). The unlock should ensure the object is removed from the shinker LRU, if it was indeed swapped out, or just purged, when the shrinker drops the object lock. v2(Thomas): - Handle managing the shrinker LRU in adjust_lru, where it is always safe to touch the object. v3(Thomas): - Pretty much a re-write. This time piggy back off the shrink_pin stuff, which actually seems to fit quite well for what we want here. v4(Thomas): - Just use a simple boolean for tracking ttm_shrinkable. v5: - Ensure we call adjust_lru when faulting the object, to ensure the pages are visible to the shrinker, if needed. - Add back the adjust_lru when in i915_ttm_move (Thomas) v6(Reported-by: kernel test robot ): - Remove unused i915_tt Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström #v4 Link: https://patchwork.freedesktop.org/patch/msgid/20211018091055.1998191-6-matthew.auld@intel.com commit e25d1ea4b1dc6a0f11a24bac85d5e3673845d365 Author: Matthew Auld Date: Mon Oct 18 10:10:52 2021 +0100 drm/i915: add some kernel-doc for shrink_pin and friends Attempt to document shrink_pin and the other relevant interfaces that interact with it, before we start messing with it. Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20211018091055.1998191-5-matthew.auld@intel.com commit 893f11f0c73365b31068081ffa3e67af5cd474e7 Author: Matthew Auld Date: Mon Oct 18 10:10:51 2021 +0100 drm/i915: drop unneeded make_unshrinkable in free_object The comment here is no longer accurate, since the current shrinker code requires a full ref before touching any objects. Also unset_pages() should already do the required make_unshrinkable() for us, if needed, which is also nicely balanced with set_pages(). Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20211018091055.1998191-4-matthew.auld@intel.com commit 5926ff80c9035638ed8ff6ee1f820392248270e7 Author: Matthew Auld Date: Mon Oct 18 10:10:50 2021 +0100 drm/i915/gtt: drop unneeded make_unshrinkable We already do this when mapping the pages. Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20211018091055.1998191-3-matthew.auld@intel.com commit 7ae034590ceaefd4d37465e3434877acfbadf411 Author: Matthew Auld Date: Mon Oct 18 10:10:49 2021 +0100 drm/i915/ttm: add tt shmem backend For cached objects we can allocate our pages directly in shmem. This should make it possible(in a later patch) to utilise the existing i915-gem shrinker code for such objects. For now this is still disabled. v2(Thomas): - Add optional try_to_writeback hook for objects. Importantly we need to check if the object is even still shrinkable; in between us dropping the shrinker LRU lock and acquiring the object lock it could for example have been moved. Also we need to differentiate between "lazy" shrinking and the immediate writeback mode. Also later we need to handle objects which don't even have mm.pages, so bundling this into put_pages() would require somehow handling that edge case, hence just letting the ttm backend handle everything in try_to_writeback doesn't seem too bad. v3(Thomas): - Likely a bad idea to touch the object from the unpopulate hook, since it's not possible to hold a reference, without also creating circular dependency, so likely this is too fragile. For now just ensure we at least mark the pages as dirty/accessed when called from the shrinker on WILLNEED objects. - s/try_to_writeback/shrinker_release_pages, since this can do more than just writeback. - Get rid of do_backup boolean and just set the SWAPPED flag prior to calling unpopulate. - Keep shmem_tt as lowest priority for the TTM LRU bo_swapout walk, since these just get skipped anyway. We can try to come up with something better later. v4(Thomas): - s/PCI_DMA/DMA/. Also drop NO_KERNEL_MAPPING and NO_WARN, which apparently doesn't do anything with streaming mappings. - Just pass along the error for ->truncate, and assume nothing. Signed-off-by: Matthew Auld Cc: Thomas Hellström Cc: Christian König Cc: Oak Zeng Reviewed-by: Thomas Hellström Acked-by: Oak Zeng Link: https://patchwork.freedesktop.org/patch/msgid/20211018091055.1998191-2-matthew.auld@intel.com commit f05b985e6f76eb9e57f36d0960a8beb46d5b46a8 Author: Thomas Hellström Date: Mon Oct 18 10:10:48 2021 +0100 drm/i915/gem: Break out some shmem backend utils Break out some shmem backend utils for future reuse by the TTM backend: shmem_alloc_st(), shmem_free_st() and __shmem_writeback() which we can use to provide a shmem-backed TTM page pool for cached-only TTM buffer objects. Main functional change here is that we now compute the page sizes using the dma segments rather than using the physical page address segments. v2(Reported-by: kernel test robot ) - Make sure we initialise the mapping on the error path in shmem_get_pages() Signed-off-by: Thomas Hellström Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20211018091055.1998191-1-matthew.auld@intel.com commit 40298cb45071e98c2c6465e2ef25dd8f8af77918 Author: Christian König Date: Wed Jun 16 09:20:56 2021 +0200 drm/nouveau: use the new iterator in nouveau_fence_sync Simplifying the code a bit. The new implementation unifies the handling between drivers and so results in waiting for all shared fernces in all cases. Signed-off-by: Christian König Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20211005113742.1101-26-christian.koenig@amd.com commit dd66f56caea6bb1a3703fb3bfc3106444d05a930 Author: Christian König Date: Thu Oct 21 08:55:24 2021 +0200 dma-buf: fix kerneldoc for renamed members Those members where renamed, update the kerneldoc as well. Signed-off-by: Christian König Reviewed-by: Alex Deucher Acked-by: Sumit Semwal Link: https://patchwork.freedesktop.org/patch/msgid/20211021141945.84023-1-christian.koenig@amd.com commit ef3e619221248a7ea5fc711a2bf9017c94d2f644 Merge: 777226dac058d 6f2f7c83303d2 Author: Joonas Lahtinen Date: Fri Oct 22 13:10:02 2021 +0300 Merge drm/drm-next into drm-intel-gt-next Backmerging to pull in the new dma_resv iterators requested by Maarten and Matt. Signed-off-by: Joonas Lahtinen commit 877d074939a5f82b099da2db3bcccc6c418b9c39 Author: Jani Nikula Date: Thu Oct 21 16:34:08 2021 +0300 drm/i915/cdclk: put the cdclk vtables in const data Add the const that was accidentally left out from the vtables. Fixes: 6b4cd9cba620 ("drm/i915: constify the cdclk vtable") Cc: Dave Airlie Reviewed-by: Ville Syrjälä Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20211021133408.32166-1-jani.nikula@intel.com commit 777226dac058d119286b4081953cb5aa2cb7394b Author: Matthew Auld Date: Thu Oct 21 13:53:31 2021 +0100 drm/i915/dmabuf: fix broken build wbinvd_on_all_cpus() is only defined on x86 it seems, plus we need to include asm/smp.h here. Reported-by: kernel test robot Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Ashutosh Dixit Link: https://patchwork.freedesktop.org/patch/msgid/20211021125332.2455288-1-matthew.auld@intel.com commit 6eaecf014807f34acf1303fcdc35833998595db4 Author: Lucas De Marchi Date: Thu Oct 21 11:18:47 2021 -0700 drm/i915: remove CNL leftover We left the definition IS_CANNONLAKE() macro while removing it from the tree due to having to merge the changes in different branches. Now that everything is back in sync and nobody is using IS_CANNONLAKE(), we can safely ditch it. Signed-off-by: Lucas De Marchi Reviewed-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211021181847.1543341-1-lucas.demarchi@intel.com commit f33b0068cdaf2b9998fa3662585858ef30bc4b9e Author: Luiz Augusto von Dentz Date: Thu Oct 21 11:44:35 2021 -0700 Bluetooth: vhci: Fix checking of msft_opcode msft_opcode shall be use a vendor ogf (0x3f) but the check was swifting the bits in the wrong order due to a missing parantesis over val & 0xffff, but since the code already checks for values over 0xffff it shall not be necessary to perform that operation it now just removes which makes it work properly when setting opcodes like 0xfce1. Fixes: b8f5482c9638 ("Bluetooth: vhci: Add support for setting msft_opcode and aosp_capable") Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 81148c266f6a51f4e149afbc52fff9a04d274310 Author: Ville Syrjälä Date: Fri Oct 15 16:39:06 2021 +0300 drm/i915/hdmi: Extract intel_hdmi_output_format() Reorganize the HDMI 4:2:0 handling a bit by introducing intel_hdmi_output_format(). We already have the DP counterpart and I want to unify the 4:2:0 handling across both a bit. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211015133921.4609-6-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit f4fdf37684ebf8ca122723ab6074d74299921064 Author: Ville Syrjälä Date: Fri Oct 15 16:39:05 2021 +0300 drm/i915/hdmi: Unify "4:2:0 also" logic between .mode_valid() and .compute_config() Currently .mode_valid() and .compute_config() have their "4:2:0 also" logic inverted. Unify things so that we use the same logic on both sides. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211015133921.4609-5-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 59908256d8101da0f051a4687438b744b24b9059 Author: Ville Syrjälä Date: Fri Oct 15 16:39:04 2021 +0300 drm/i915/hdmi: Introduce intel_hdmi_tmds_clock() Rename intel_hdmi_port_clock() into intel_hdmi_tmds_clock(), and move the 4:2:0 TMDS clock halving into intel_hdmi_tmds_clock() so the callers don't have to worry about such details. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211015133921.4609-4-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit bb115220d248e394a65a52e128dbb8096c9c8868 Author: Ville Syrjälä Date: Fri Oct 15 16:39:03 2021 +0300 drm/i915/hdmi: Introduce intel_hdmi_is_ycbr420() Introduce a small helper which given the crtc state tells us whether we're output YCbCr 4:2:0 or not. For native HDMI this is rather simple as we just look at the output_format. But I think the helper is beneficial since with DP HDMI DFPs we're going to need a more complex variant, and I want to unify the DP and HDMI sides of that as much as possible. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211015133921.4609-3-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 3cf460bd683df848c3df90b9bd6c28bc86acea8a Author: Ville Syrjälä Date: Fri Oct 15 16:39:02 2021 +0300 drm/i915/hdmi: Split intel_hdmi_bpc_possible() to source vs. sink pair intel_hdmi_bpc_possible() is used by the DP code as well where the native HDMI source limits do not apply. So let's split this into a pair of functions: one for the source vs. one for the sink. This is basically reverting some of commit 41828125acd6 ("drm/i915: Move platform checks into intel_hdmi_bpc_possible()") slightly, but in a nicer form. I guess I forgot at the time that the DP side uses this too. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211015133921.4609-2-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 09f8fe4cae5ee8eb2ac44e437d4295357f3cdb36 Author: Ville Syrjälä Date: Thu Oct 21 01:33:36 2021 +0300 drm/i915: Move function prototypes to the correct header A bunch of function prototypes were left behind when the plane/crtc code got reshuffled to new files. Move the prototypes as well. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211020223339.669-2-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula commit 0b2c31dd8868651d878af4c60b235dfb52909e74 Author: Imre Deak Date: Wed Oct 20 22:51:38 2021 +0300 drm/i915: Add functions to check for RC CCS CC and MC CCS modifiers Instead of open-coding the checks add functions for this, simplifying the handling of CCS modifiers on future platforms. Cc: Juha-Pekka Heikkila Signed-off-by: Imre Deak Reviewed-by: Juha-Pekka Heikkila Link: https://patchwork.freedesktop.org/patch/msgid/20211020195138.1841242-12-imre.deak@intel.com commit e359c47bfa6155b56d378864b7cc4a0d4e680c1b Author: Imre Deak Date: Wed Oct 20 22:51:37 2021 +0300 drm/i915: Move is_ccs_modifier() to intel_fb.c Move the function to intel_fb.c and rename it adding the intel_fb_ prefix following the naming of exported functions. Cc: Juha-Pekka Heikkila Signed-off-by: Imre Deak Reviewed-by: Juha-Pekka Heikkila Link: https://patchwork.freedesktop.org/patch/msgid/20211020195138.1841242-11-imre.deak@intel.com commit f50423436105e136e2409b500719334188a77aa6 Author: Imre Deak Date: Wed Oct 20 22:51:36 2021 +0300 drm/i915: Add a platform independent way to check for CCS AUX planes Future platforms change the location of CCS AUX planes in CCS framebuffers, so add intel_fb_is_ccs_aux_plane() to query for these planes independently of the platform. This function can be used everywhere instead of is_ccs_plane() (or is_ccs_plane() && !cc_plane()), since all the callers are only interested in CCS AUX planes (and not CCS color-clear planes). Add the corresponding intel_fb_is_gen12_ccs_aux_plane(), which can be used everywhere instead of is_gen12_ccs_plane(), based on the above explanation. This change also unexports the is_gen12_ccs_modifier(), is_gen12_ccs_plane(), is_gen12_ccs_cc_plane() functions as they are only used in intel_fb.c v1-v2: Unchanged v3: (Ville) - Use ccs_aux instead of the ccs_ctrl term everywhere. - Use color_plane instead of plane term for FB plane indicies. v4: Fix version range check. (Jani) Cc: Juha-Pekka Heikkila Cc: Ville Syrjälä Cc: Jani Nikula Signed-off-by: Imre Deak Reviewed-by: Juha-Pekka Heikkila Link: https://patchwork.freedesktop.org/patch/msgid/20211020195138.1841242-10-imre.deak@intel.com commit df63860da913e6afc0d725a87f99e930ee237451 Author: Imre Deak Date: Wed Oct 20 22:51:35 2021 +0300 drm/i915: Handle CCS CC planes separately from CCS AUX planes CCS CC planes are quite different from CCS AUX planes, even though we regard the CC planes as a linear buffer having a 64 byte stride. Thus it's clearer to check for either CCS plane types explicitly when we need to handle them; add the required CCS CC planes check here, while the next patch will change all is_ccs_plane()/is_gen12_ccs_plane() checks to consider only the CCS AUX planes. Cc: Juha-Pekka Heikkila Signed-off-by: Imre Deak Reviewed-by: Juha-Pekka Heikkila Link: https://patchwork.freedesktop.org/patch/msgid/20211020195138.1841242-9-imre.deak@intel.com commit b0f1670d22ce1e192f29e931069297ff16156026 Author: Imre Deak Date: Wed Oct 20 22:51:34 2021 +0300 drm/i915: Add a platform independent way to get the RC CCS CC plane On future platforms the index of the color-clear plane will change from the one used by the GEN12 RC CCS CC modifier, so add a way to retrieve the index independently of the platform/modifier. Cc: Juha-Pekka Heikkila Signed-off-by: Imre Deak Reviewed-by: Juha-Pekka Heikkila Link: https://patchwork.freedesktop.org/patch/msgid/20211020195138.1841242-8-imre.deak@intel.com commit 0f2922ef48484ca4687319d03f72afdda2172e97 Author: Imre Deak Date: Wed Oct 20 22:51:33 2021 +0300 drm/i915: Move intel_format_info_is_yuv_semiplanar() to intel_fb.c Move intel_format_info_is_yuv_semiplanar() to intel_fb.c . The number of planes for YUV semiplanar formats using CCS modifiers will change on future platforms. We can use the modifier descriptors to simplify getting the plane numbers for all modifiers, prepare for that here. Cc: Juha-Pekka Heikkila Signed-off-by: Imre Deak Reviewed-by: Juha-Pekka Heikkila Link: https://patchwork.freedesktop.org/patch/msgid/20211020195138.1841242-7-imre.deak@intel.com commit b1562f0f0f69120225285977eb2bd488c7eb5482 Author: Imre Deak Date: Wed Oct 20 22:51:32 2021 +0300 drm/i915: Unexport is_semiplanar_uv_plane() This function is only used by intel_fb.c, so unexport it. Cc: Juha-Pekka Heikkila Signed-off-by: Imre Deak Reviewed-by: Juha-Pekka Heikkila Link: https://patchwork.freedesktop.org/patch/msgid/20211020195138.1841242-6-imre.deak@intel.com commit d89357ded55e1294e172cec176f49e1685dca06d Author: Imre Deak Date: Wed Oct 20 22:51:31 2021 +0300 drm/i915: Simplify the modifier check for interlaced scanout support Checking the modifiers that support interlacing makes the condition simpler and avoids us having to add new modifiers to the list (presuming all/most of the new modifiers won't support interlacing). Cc: Juha-Pekka Heikkila Signed-off-by: Imre Deak Reviewed-by: Juha-Pekka Heikkila Link: https://patchwork.freedesktop.org/patch/msgid/20211020195138.1841242-5-imre.deak@intel.com commit 3dfb2d6b489f7f1a627774f84a6341c18785f43f Author: Imre Deak Date: Wed Oct 20 22:51:30 2021 +0300 drm/i915: Add tiling attribute to the modifier descriptor Add a tiling atttribute to the modifier descriptor, which let's us get the tiling without listing the modifiers twice. v1-v2: Unchanged. v3: - Initialize .tiling to I915_TILING_NONE explicitly (Ville) - Move from previous patch lookup_modifier() to here, where it's first used. Cc: Juha-Pekka Heikkila Cc: Ville Syrjälä Signed-off-by: Imre Deak Reviewed-by: Juha-Pekka Heikkila Link: https://patchwork.freedesktop.org/patch/msgid/20211020195138.1841242-4-imre.deak@intel.com commit 672d07517e728acf15c1e39c3dfb7052000b434e Author: Imre Deak Date: Wed Oct 20 22:51:29 2021 +0300 drm/i915: Move intel_get_format_info() to intel_fb.c Move the function retrieving the format override information for a given format/modifier to intel_fb.c. We can store a pointer to the format list in each modifier's descriptor instead of the corresponding switch/case logic, avoiding the listing of the modifiers twice. v1: Unchanged. v2: Handle invalid modifiers in intel_fb_get_format_info() passed from userspace. (CI/igt_kms_addfb_basic/addfb25-bad-modifier) v3: Move lookup_modifier() to the next patch, where it's first used. Cc: Juha-Pekka Heikkila Cc: Ville Syrjälä Signed-off-by: Imre Deak Reviewed-by: Juha-Pekka Heikkila Link: https://patchwork.freedesktop.org/patch/msgid/20211020195138.1841242-3-imre.deak@intel.com commit e2b8329432b880f3821f85e1253a9b6b9d714a86 Author: Imre Deak Date: Wed Oct 20 22:51:28 2021 +0300 drm/i915: Add a table with a descriptor for all i915 modifiers Add a table describing all the framebuffer modifiers used by i915 at one place. This has the benefit of deduplicating the listing of supported modifiers for each platform and checking the support of these modifiers on a given plane. This also simplifies in a similar way getting some attribute for a modifier, for instance checking if the modifier is a CCS modifier type. While at it drop the cursor plane filtering from skl_plane_has_rc_ccs(), as the cursor plane is registered with DRM core elsewhere. v1: Unchanged. v2: - Keep the plane caps calculation in the plane code and pass an enum with these caps to intel_fb_get_modifiers(). (Ville) - Get the modifiers calling intel_fb_get_modifiers() in i9xx_plane.c as well. v3: - s/.id/.modifier/ (Ville) - Keep modifier_desc vs. plane_cap filter conditions consistent. (Ville) - Drop redundant cursor plane check from skl_plane_has_rc_ccs(). (Ville) - Use from, until display version fields in modifier_desc instead of a mask. (Jani) - Unexport struct intel_modifier_desc, separate its decl and init. (Jani) - Remove enum pipe, plane_id forward decls from intel_fb.h, which are not needed after v2. v4: - Reuse IS_DISPLAY_VER() instead of open-coding it. (Jani) - Preserve the current modifier order exposed to user space. (Ville) v5: Use }, { on one line to seperate the descriptor array elements. (Jani) Cc: Ville Syrjälä Cc: Juha-Pekka Heikkila Cc: Jani Nikula Signed-off-by: Imre Deak Reviewed-by: Juha-Pekka Heikkila (v3) Link: https://patchwork.freedesktop.org/patch/msgid/20211020195138.1841242-2-imre.deak@intel.com commit f8b5307074f8be80a9806d85b01e5ba933dd0360 Author: Thomas Zimmermann Date: Thu Jun 24 11:55:02 2021 +0200 drm/rockchip: 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 rockchip 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 [On rk3288 (pinky), rk3399 (gru-kevin, puma) and rk3328 (rock64)] Tested-by: Heiko Stuebner [On RK3188/RK3066 (without iommu)] Tested-by: Alex Bee Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20210624095502.8945-1-tzimmermann@suse.de commit 171c555c2c2664a250cd35680c34c31a6d233dc7 Author: Jani Nikula Date: Tue Oct 19 14:43:34 2021 +0300 Revert "drm/i915/bios: gracefully disable dual eDP for now" This reverts commit 05734ca2a8f76c9eb3890b3c9dfc3467f03105c1. It's not graceful, instead it leads to boot time warning splats in the case it is supposed to handle gracefully. Apparently the BIOS/GOP enabling the port we end up skipping leads to state readout problems. Back to the drawing board. References: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_21255/bat-adlp-4/boot0.txt Fixes: 05734ca2a8f7 ("drm/i915/bios: gracefully disable dual eDP for now") Cc: José Roberto de Souza Cc: Uma Shankar Cc: Ville Syrjälä Cc: Swati Sharma Reviewed-by: José Roberto de Souza Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20211019114334.24643-1-jani.nikula@intel.com commit a3c09a02ef9f7d77c35c8bdcf91a97de6784d2f5 Author: Jernej Skrabec Date: Tue Oct 19 20:10:28 2021 +0200 drm/sun4i: virtual CMA addresses are not needed Driver never uses virtual address of DRM CMA buffers. Switch to CMA helpers which don't deal with virtual mapping. This was actually already the case before commit ad408c766cef ("drm/sun4i: Use DRM_GEM_CMA_VMAP_DRIVER_OPS for GEM operations"), but only convenient macro at the time used helpers with virtual mapping. Signed-off-by: Jernej Skrabec Signed-off-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20211019181028.4190737-1-jernej.skrabec@gmail.com commit 035f79f9b77d5bbeca7c5befcfaa7560e846ac6d Author: Thomas Zimmermann Date: Tue Oct 19 10:09:42 2021 +0200 drm/gma500: Remove generic DRM drivers in probe function Gma500 currently removes generic fbdev drivers, but ignores generic DRM drivers. Use aperture helpers to remove all generic graphics drivers before loading gma500. Makes gma500 compatible with simpledrm. Signed-off-by: Thomas Zimmermann Acked-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20211019080942.24356-1-tzimmermann@suse.de commit 1af10a97b3a629f5f5b361f1870070c1d6e0308b Author: José Roberto de Souza Date: Tue Oct 19 17:35:58 2021 -0700 drm/i915/display: Add warn_on in intel_psr_pause() Right now the only user of psr_pause/resume is intel_cdclk but additional users will be added in the future and we may need do reference counting for PSR pause and resume, for now only adding a warn_on so this cases do not go unnoticed. Cc: Mika Kahola Cc: Jouni Hogander Cc: Radhakrishna Sripada Signed-off-by: José Roberto de Souza Reviewed-by: Mika Kahola Link: https://patchwork.freedesktop.org/patch/msgid/20211020003558.222198-2-jose.souza@intel.com commit 808b79eb8165d4dbd5e731f98a4f5f4a0817ee4e Author: José Roberto de Souza Date: Tue Oct 19 17:35:57 2021 -0700 drm/i915/display: Rename POWER_DOMAIN_DPLL_DC_OFF to POWER_DOMAIN_DC_OFF This power domain to disable DC states will be used in places outside of DPLL, so making the name more generic. Cc: Radhakrishna Sripada Cc: Imre Deak Signed-off-by: José Roberto de Souza Reviewed-by: Caz Yokoyama Link: https://patchwork.freedesktop.org/patch/msgid/20211020003558.222198-1-jose.souza@intel.com commit 7a517ac9c00bab519770c0790b47845b8f5ecebb Author: Kyle Copperfield Date: Wed Oct 20 13:00:22 2021 +0000 Bluetooth: btsdio: Do not bind to non-removable BCM4345 and BCM43455 BCM4345 and BCM43455 devices soldered onto the PCB (non-removable), use an UART connection for Bluetooth, such as in the Pinebook Pro, and the advertised btsdio support as an SDIO function is ignored. Reviewed-by: Dragan Simic Signed-off-by: Kyle Copperfield Signed-off-by: Marcel Holtmann commit 1d0688421449718c6c5f46e458a378c9b530ba18 Author: Soenke Huster Date: Wed Oct 20 10:14:44 2021 +0200 Bluetooth: virtio_bt: fix memory leak in virtbt_rx_handle() On the reception of packets with an invalid packet type, the memory of the allocated socket buffers is never freed. Add a default case that frees these to avoid a memory leak. Fixes: afd2daa26c7a ("Bluetooth: Add support for virtio transport driver") Signed-off-by: Soenke Huster Signed-off-by: Marcel Holtmann commit 0597ca7b43e41c509bd0feb143bdfb7278496397 Author: Christian König Date: Wed Jun 16 09:23:50 2021 +0200 drm/radeon: use new iterator in radeon_sync_resv Simplifying the code a bit. Signed-off-by: Christian König Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20211005113742.1101-16-christian.koenig@amd.com commit 8315e2975e8e15725e18bea0d81e3233b48aed6d Author: Christian König Date: Wed Jun 16 09:19:37 2021 +0200 drm/msm: use new iterator in msm_gem_describe Simplifying the code a bit. Also drop the RCU read side lock since the object is locked anyway. Untested since I can't get the driver to compile on !ARM. Signed-off-by: Christian König Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20211005113742.1101-15-christian.koenig@amd.com commit a0a8e75948117f37a1f849c44d026d0775ca59a7 Author: Christian König Date: Wed Sep 22 14:14:01 2021 +0200 drm/amdgpu: use new iterator in amdgpu_vm_prt_fini No need to actually allocate an array of fences here. Signed-off-by: Christian König Reviewed-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20211005113742.1101-14-christian.koenig@amd.com commit ce679dea955e1b6670a8d92b8ac4c17b22db3fa0 Author: Imre Deak Date: Mon Oct 18 12:41:54 2021 +0300 drm/i915/dp: Sanitize link common rate array lookups Add an assert that lookups from the intel_dp->common_rates[] array are always valid. Cc: Ville Syrjälä Signed-off-by: Imre Deak Reviewed-by: Ville Syrjälä Acked-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20211018094154.1407705-7-imre.deak@intel.com commit caae4fb537d8437b9290d8a1010adfaf174b29e6 Author: Imre Deak Date: Mon Oct 18 12:41:53 2021 +0300 drm/i915/dp: Sanitize sink rate DPCD register values If the DPCD sink rate values read from the sink are invalid, the driver will sanitize this in intel_dp_set_common_rates(), by setting a default 162000 link rate in common rates and printing a WARN(). WARN()s should only be triggered by bugs in the code and not by external factors like the above (an invalid DPCD injected maliciously or read from a buggy monitor). So fixup the invalid DPCD sink rate values already and print an error in this case (since it's still a user visible problem). Cc: Ville Syrjälä Signed-off-by: Imre Deak Reviewed-by: Ville Syrjälä Acked-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20211018094154.1407705-6-imre.deak@intel.com commit bedcaddadd22da82fc2590569ff81a31045176b1 Author: Imre Deak Date: Mon Oct 18 12:41:52 2021 +0300 drm/i915/dp: Ensure sink/link max lane count values are always valid Print an error if the DPCD sink max lane count is invalid and fix it up. While at it also add an assert that the link max lane count (derived from intel_dp_max_common_lane_count(), potentially reduced by the LT fallback logic) value is also valid. Cc: Ville Syrjälä Signed-off-by: Imre Deak Reviewed-by: Ville Syrjälä Acked-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20211018094154.1407705-5-imre.deak@intel.com commit 9ad87de4735620ffc555592e8c5f580478fa3ed0 Author: Imre Deak Date: Mon Oct 18 12:41:51 2021 +0300 drm/i915/dp: Ensure max link params are always valid Atm until the DPCD for a connector is read the max link rate and lane count params are invalid. If the connector is modeset, in intel_dp_compute_config(), intel_dp_common_len_rate_limit(max_link_rate) will return 0, leading to a intel_dp->common_rates[-1] access. Fix the above by making sure the max link params are always valid. The above access leads to an undefined behaviour by definition, though not causing a user visible problem to my best knowledge, see the previous patch why. Nevertheless it is an undefined behaviour and it triggers a BUG() in CONFIG_UBSAN builds, hence CC:stable. 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-4-imre.deak@intel.com commit 3f61ef9777c0ab0f03f4af0ed6fd3e5250537a8d Author: Imre Deak Date: Mon Oct 18 17:34:17 2021 +0300 drm/i915/dp: Ensure sink rate values are always valid Atm, there are no sink rate values set for DP (vs. eDP) sinks until the DPCD capabilities are successfully read from the sink. During this time intel_dp->num_common_rates is 0 which can lead to a intel_dp->common_rates[-1] (*) access, which is an undefined behaviour, in the following cases: - In intel_dp_sync_state(), if the encoder is enabled without a sink connected to the encoder's connector (BIOS enabled a monitor, but the user unplugged the monitor until the driver loaded). - In intel_dp_sync_state() if the encoder is enabled with a sink connected, but for some reason the DPCD read has failed. - In intel_dp_compute_link_config() if modesetting a connector without a sink connected on it. - In intel_dp_compute_link_config() if modesetting a connector with a a sink connected on it, but before probing the connector first. To avoid the (*) access in all the above cases, make sure that the sink rate table - and hence the common rate table - is always valid, by setting a default minimum sink rate when registering the connector before anything could use it. I also considered setting all the DP link rates by default, so that modesetting with higher resolution modes also succeeds in the last two cases above. However in case a sink is not connected that would stop working after the first modeset, due to the LT fallback logic. So this would need more work, beyond the scope of this fix. As I mentioned in the previous patch, I don't think the issue this patch fixes is user visible, however it is an undefined behaviour by definition and triggers a BUG() in CONFIG_UBSAN builds, hence CC:stable. v2: Clear the default sink rates, before initializing these for eDP. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/4297 References: https://gitlab.freedesktop.org/drm/intel/-/issues/4298 Suggested-by: Ville Syrjälä 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/20211018143417.1452632-1-imre.deak@intel.com commit 4ec5ffc341cecbea060739aea1d53398ac2ec3f8 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 commit b7d5abda8e64fb9cbbd219e667ccb34e4761ce2f Author: Jani Nikula Date: Thu Oct 14 18:00:59 2021 +0300 drm/i915/dp: use new link training delay helpers Use the new link training delay helpers, fixing the delays for 128b/132b. For existing 8b/10b functionality, this will cause additional 1-byte DPCD reads for LTTPR delays instead of using the cached values. It's just too complicated to combine generic helpers with local caching in a sensible way. Cc: Ville Syrjälä Reviewed-by: Ville Syrjälä Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20211014150059.28957-3-jani.nikula@intel.com commit babc8db30132ba59cecca9587e73104741f0be6d Merge: 718cc87e1669d 02ed47aa6cc69 Author: Jani Nikula Date: Tue Oct 19 18:15:27 2021 +0300 Merge tag 'topic/drm-dp-training-delay-helpers-2021-10-19' of git://anongit.freedesktop.org/drm/drm-intel into drm-intel-next Core Changes: - drm dp helpers for figuring out link training delays Merge to drm-intel-next as well after c93ce6a6dfbd ("Merge tag 'topic/drm-dp-training-delay-helpers-2021-10-19' of git://anongit.freedesktop.org/drm/drm-intel into drm-misc-next"). Signed-off-by: Jani Nikula From: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/878ryps5b6.fsf@intel.com commit c93ce6a6dfbd3e258186ab10f95472ee571583b3 Merge: 13e9e30cafea1 02ed47aa6cc69 Author: Maxime Ripard Date: Tue Oct 19 15:26:26 2021 +0200 Merge tag 'topic/drm-dp-training-delay-helpers-2021-10-19' of git://anongit.freedesktop.org/drm/drm-intel into drm-misc-next Core Changes: - drm dp helpers for figuring out link training delays Signed-off-by: Maxime Ripard From: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/878ryps5b6.fsf@intel.com commit 13e9e30cafea10dff6bc8d63a38a61249e83fd65 Author: Christian König Date: Mon Oct 18 21:27:55 2021 +0200 drm/scheduler: fix drm_sched_job_add_implicit_dependencies Trivial fix since we now need to grab a reference to the fence we have added. Previously the dma_resv function where doing that for us. Signed-off-by: Christian König Fixes: 9c2ba265352a ("drm/scheduler: use new iterator in drm_sched_job_add_implicit_dependencies v2") Link: https://patchwork.freedesktop.org/patch/msgid/20211019112706.27769-1-christian.koenig@amd.com Reviewed-by: Daniel Vetter Reported-by: Nicolas Frattaroli References: https://lore.kernel.org/dri-devel/2023306.UmlnhvANQh@archbook/ Tested-by: Nicolas Frattaroli commit c4f08d7246a520da5f2b1068f635da0678485e33 Author: Stephen Rothwell Date: Mon Oct 18 11:51:13 2021 +0300 drm/locking: fix __stack_depot_* name conflict Commit cd06ab2fd48f ("drm/locking: add backtrace for locking contended locks without backoff") added functions named __stack_depot_* in drm which conflict with stack depot. Rename to __drm_stack_depot_*. v2 by Jani: - Also rename __stack_depot_print References: https://lore.kernel.org/r/20211015202648.258445ef@canb.auug.org.au Fixes: cd06ab2fd48f ("drm/locking: add backtrace for locking contended locks without backoff") Cc: Daniel Vetter Reviewed-by: Daniel Vetter Signed-off-by: Stephen Rothwell Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20211018085113.27033-1-jani.nikula@intel.com commit 43a1f1467cd4bcf248925fd7b3fdf49d73917443 Author: Dmitry Osipenko Date: Sun Oct 3 02:34:47 2021 +0300 drm/bridge: tc358768: Correct BTACNTRL1 programming TXTAGOCNT and RXTASURECNT bitfields of BTACNTRL1 register are swapped in the code, correct them. Driver doesn't implement low power mode for now, so this change doesn't make a practical difference yet. Tested-by: Andreas Westman Dorcsak # Asus TF700T Tested-by: Maxim Schwalm #TF700T Signed-off-by: Dmitry Osipenko Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20211002233447.1105-6-digetx@gmail.com commit fbc5a90e82c1131869e76ce5b082693b8a75c121 Author: Dmitry Osipenko Date: Sun Oct 3 02:34:46 2021 +0300 drm/bridge: tc358768: Disable non-continuous clock mode Non-continuous clock mode doesn't work because driver doesn't support it properly. The bridge driver programs wrong bitfields that are required by the non-continuous mode (BTACNTRL1 register bitfields are swapped in the code), but fixing them doesn't help. Display panel of ASUS Transformer TF700T tablet supports non-continuous mode and display doesn't work at all using that mode. There are no device-trees that are actively using this DSI bridge in upstream yet, so clearly the broken mode wasn't ever tested properly. It's a bit too difficult to get LP mode working, hence let's disable the offending mode for now and fall back to continuous mode. Tested-by: Andreas Westman Dorcsak # Asus TF700T Tested-by: Maxim Schwalm #TF700T Signed-off-by: Dmitry Osipenko Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20211002233447.1105-5-digetx@gmail.com commit b93e947664a1a63a3e6cb5d94f38d5579e41d951 Author: Dmitry Osipenko Date: Sun Oct 3 02:34:45 2021 +0300 drm/bridge: tc358768: Calculate video start delay Calculate video start delay based on the display timing instead of hardcoding it to a default value. This fixes "trembling" display output on Asus Transformer TF700T which uses Panasonic VVX10F004B00 display panel. Tested-by: Andreas Westman Dorcsak # Asus TF700T Tested-by: Maxim Schwalm #TF700T Signed-off-by: Dmitry Osipenko Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20211002233447.1105-4-digetx@gmail.com commit 0bcdfabfcbe230fbd9f03c297486f013333892c7 Author: Dmitry Osipenko Date: Sun Oct 3 02:34:44 2021 +0300 drm/bridge: tc358768: Support pulse mode Support pulse-mode synchronization which is supported and used by simple DSI panels like Panasonic VVX10F004B00. Tested-by: Andreas Westman Dorcsak # Asus TF700T Tested-by: Maxim Schwalm #TF700T Signed-off-by: Dmitry Osipenko Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20211002233447.1105-3-digetx@gmail.com commit 45a44b01faa6ef92788b2067631deb486cef8a4d Author: Dmitry Osipenko Date: Sun Oct 3 02:34:43 2021 +0300 drm/bridge: tc358768: Enable reference clock The driver assumes that reference clock is always-enabled, but this is hardware-dependent and not true for ASUS Transformer TF700T. Make driver enable / disable the reference clock. Tested-by: Andreas Westman Dorcsak # Asus TF700T Tested-by: Maxim Schwalm #TF700T Signed-off-by: Dmitry Osipenko Reviewed-by: Robert Foss Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20211002233447.1105-2-digetx@gmail.com commit f2d061ed01b3f0e0c7a4daebed91e26f54de4086 Author: Thomas Zimmermann Date: Fri Oct 15 10:40:53 2021 +0200 drm/gma500: Rename struct gtt_range to struct psb_gem_object struct gtt_range represents a GEM object. Rename the structure to struct psb_gem_object and update all users. No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20211015084053.13708-11-tzimmermann@suse.de commit e1f80341e312088f0e6c46107db7098e30e6d764 Author: Thomas Zimmermann Date: Fri Oct 15 10:40:52 2021 +0200 drm/gma500: Rewrite GTT page insert/remove without struct gtt_range struct gtt_range represents a GEM object and should not be used for GTT setup. Change psb_gtt_insert() and psb_gtt_remove() to receive all necessary parameters from their caller. This also eliminates possible failure from psb_gtt_insert(). There's one exception in psb_gtt_restore(), which requires an upcast from struct resource to struct gtt_range when restoring the GTT after hibernation. A possible solution would track the GEM objects that need restoration separately from the GTT resource. Rename the functions to psb_gtt_insert_pages() and psb_gtt_remove_pages() to reflect their similarity to MMU interfaces. v3: * restore the comments about locking rules (Patrik) Signed-off-by: Thomas Zimmermann Acked-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20211015084053.13708-10-tzimmermann@suse.de commit 33e079bc1530df4596181ccbfded8752bbedb92c Author: Thomas Zimmermann Date: Fri Oct 15 10:40:51 2021 +0200 drm/gma500: Set page-caching flags in GEM pin/unpin Caching of the GEM object's backing pages are unrelated to GTT management. Move the respective calls from GTT code to GEM code. Signed-off-by: Thomas Zimmermann Acked-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20211015084053.13708-9-tzimmermann@suse.de commit 3c101135baf2dcfa64081239818039a1fcc7767a Author: Thomas Zimmermann Date: Fri Oct 15 10:40:50 2021 +0200 drm/gma500: Inline psb_gtt_{alloc,free}_range() into rsp callers psb_gtt_alloc_range() allocates struct gtt_range, create the GTT resource and performs some half-baked initialization. Inline the function into its only caller psb_gem_create(). For creating the GTT resource, introduce a new helper, psb_gtt_alloc_resource() that hides the details of the GTT. For psb_gtt_free_range(), inline the function into its only caller psb_gem_free_object(). While at it, remove the explicit invocation of drm_gem_free_mmap_offset(). The mmap offset is already released by drm_gem_object_release(). v3: * replace offset[static 1] with pointer notation (Patrik) Signed-off-by: Thomas Zimmermann Acked-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20211015084053.13708-8-tzimmermann@suse.de commit 0b80214b64e38f33d359c0e121773357060b992f Author: Thomas Zimmermann Date: Fri Oct 15 10:40:49 2021 +0200 drm/gma500: Inline psb_gtt_attach_pages() and psb_gtt_detach_pages() psb_gtt_attach_pages() are not GTT functions but deal with the GEM object's SHMEM pages. The only callers of psb_gtt_attach_pages() and psb_gtt_detach_pages() are the GEM pin helpers. Inline the calls and cleanup the resulting code. v2: * unlock gtt_mutex in pin-error handling (Patrik) Signed-off-by: Thomas Zimmermann Acked-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20211015084053.13708-7-tzimmermann@suse.de commit 2671075b322746ec68c49396c5c17ad8ad236dce Author: Thomas Zimmermann Date: Fri Oct 15 10:40:48 2021 +0200 drm/gma500: Rename psb_gtt_{pin,unpin}() to psb_gem_{pin,unpin}() Rename psb_gtt_pin() to psb_gem_pin() to reflect the semantics of the function. Same for psb_gtt_unpin(). No functional changes. Signed-off-by: Thomas Zimmermann Acked-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20211015084053.13708-6-tzimmermann@suse.de commit 957a2d0e7ea38d84d4b3cf9a951bccadeb803a24 Author: Thomas Zimmermann Date: Fri Oct 15 10:40:47 2021 +0200 drm/gma500: Allocate GTT ranges in stolen memory with psb_gem_create() Support private objects for stolen memory in psb_gem_create() and convert users to psb_gem_create(). For stolen memory, psb_gem_create() now initializes the GEM object via drm_gem_private_object_init(). In the fbdev setup, replace the open-coded initialization of struct gtt_range with a call to psb_gem_create(). Use drm_gem_object_put() for release. In the cursor setup, use psb_gem_create() and get a real GEM object. Previously the allocated instance of struct gtt_range was only partially initialized. Release the cursor GEM object in gma_crtc_destroy(). The release was missing from the original code. With the conversion of all callers to psb_gem_create(), the extern declarations of psb_gtt_alloc_range, psb_gtt_free_range and psb_gem_object_func are not required any longer. Declare them as static. Signed-off-by: Thomas Zimmermann Acked-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20211015084053.13708-5-tzimmermann@suse.de commit 576d4d2d90310270c1d463577f0a075e88cf6c4a Author: Thomas Zimmermann Date: Fri Oct 15 10:40:46 2021 +0200 drm/gma500: Reimplement psb_gem_create() Implement psb_gem_create() for general use. Create the GEM handle in psb_gem_create_dumb(). Allows to use psb_gem_create() for creating all of the GEM objects. While at it, clean-up drm_gem_dumb_create() to make it more readable. Signed-off-by: Thomas Zimmermann Acked-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20211015084053.13708-4-tzimmermann@suse.de commit 9f40dbd4416f14657d9b354b7ec855244d97a91c Author: Thomas Zimmermann Date: Fri Oct 15 10:40:45 2021 +0200 drm/gma500: Use to_gtt_range() everywhere Convert upcasts from struct drm_gem_object to struct gtt_range to to_gtt_range(). Some places used container_of() directly. Signed-off-by: Thomas Zimmermann Acked-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20211015084053.13708-3-tzimmermann@suse.de commit 1f9f6790cc62eeaa973d05a9a2f16ca0f3b80b36 Author: Thomas Zimmermann Date: Fri Oct 15 10:40:44 2021 +0200 drm/gma500: Move helpers for struct gtt_range from gtt.c to gem.c Allocation and pinning helpers for struct gtt_range are GEM functions, so move them to gem.c. No functional changes. v2: * keep docs for psb_gtt_{attach,detach}_pages() (Patrik) Signed-off-by: Thomas Zimmermann Acked-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20211015084053.13708-2-tzimmermann@suse.de commit 02ed47aa6cc697fc34053c011fe72984a86273cb Author: Jani Nikula Date: Thu Oct 14 18:00:58 2021 +0300 drm/dp: reuse the 8b/10b link training delay helpers Reuse the 8b/10b link training delay helpers. Functionally this skips the check for invalid values for DPCD 1.4 and later at clock recovery delay (as it's a fixed delay and bypasses the rd_interval) but the same value will be checked and invalid values reported at channel equalization. Reviewed-by: Ville Syrjälä Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20211014150059.28957-2-jani.nikula@intel.com commit ba3078dad1401131293664733c15f6f066079de9 Author: Jani Nikula Date: Thu Oct 14 18:00:57 2021 +0300 drm/dp: add helpers to read link training delays The link training delays are different and/or available in different DPCD offsets depending on: - Clock recovery vs. channel equalization - DPRX vs. LTTPR - 128b/132b vs. 8b/10b - DPCD 1.4+ vs. earlier Add helpers to get the correct delays in us, reading DPCD if necessary. This is more straightforward than trying to retrofit the existing helpers to take 128b/132b into account. Having to pass in the DPCD receiver cap field seems unavoidable, because reading it involves checking the revision and reading extended receiver cap. So unfortunately the interface is mixed cached and read as needed. v2: Remove delay_us < 0 check and the whole local var (Ville) Cc: Ville Syrjälä Reviewed-by: Ville Syrjälä Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20211014150059.28957-1-jani.nikula@intel.com commit 718cc87e1669dafe65ddd3720a5526c6d7e1705a Author: Ville Syrjälä Date: Fri Oct 15 10:16:25 2021 +0300 drm/i915: Introduce lpt_pch_disable() Let's add lpt_pch_disable() as the counterpart to lpt_pch_enable(). Note that unlike the ilk+ code the fdi_link_train() and fdi_disable() calls are still left directly in intel_crt.c. If we wanted to move those we'd need to add lpt_pch_pre_enable(). But the two fdi direct fdi calls are pretry symmetric so it doesn't seem too bad to just keep them as is. v2: Make lpt_disable_pch_transcoder() static (lkp@intel.com) Cc: Dave Airlie Cc: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211015071625.593-10-ville.syrjala@linux.intel.com Reviewed-by: Dave Airlie commit d39ef5d5c076377d41c65b69f8452eada2db724d Author: Ville Syrjälä Date: Fri Oct 15 10:16:24 2021 +0300 drm/i915: Move intel_ddi_fdi_post_disable() to fdi code Reanme intel_ddi_fdi_post_disable() to hsw_fdi_disable() and relocate it next to all the other code dealing with FDI_RX. intel_ddi.c has now been cleansed of FDI_RX. In order to avoid exposing intel_disable_ddi_buf() outside intel_ddi.c we can just open code the DDI_BUF_CTL write. The enable side already has all that stuff open coded so this actually is more symmetric. But we do need to remeber to bring the intel_wait_ddi_buf_idle() call over from inside intel_disable_ddi_buf(). Cc: Dave Airlie Cc: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211015071625.593-9-ville.syrjala@linux.intel.com Reviewed-by: Dave Airlie commit 976c68f46d7cba02ccc80fbd67a4e9731e23e8a7 Author: Ville Syrjälä Date: Fri Oct 15 10:16:23 2021 +0300 drm/i915: Introduce ilk_pch_disable() and ilk_pch_post_disable() Hoover the remaining open coded PCH modeset sequence bits out from ilk_crtc_disable(). Somewhat annoyingly the enable vs. disable is a bit asymmetric so we need two functions for the disable case. Cc: Dave Airlie Cc: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211015071625.593-8-ville.syrjala@linux.intel.com Reviewed-by: Dave Airlie commit 9e68fa88b85910091be186f9022b36f4fa83b31c Author: Ville Syrjälä Date: Fri Oct 15 10:16:22 2021 +0300 drm/i915: Move iCLKIP readout to the pch code Move the lpt_get_iclkip() call from hsw_crt_get_config() since that's where we have the lpt_program_iclkip() call as well. Tehcnically this isn't perhaps quite right since iCLKIP is providing the CRT dotclock. So one can argue all of it should be directly in intel_crt.c. But since the CRT port is the only one on the PCH sticking it all into the PCH code seems OK. Cc: Dave Airlie Cc: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211015071625.593-7-ville.syrjala@linux.intel.com Reviewed-by: Dave Airlie commit 7d9ae6332e77c1dd57cd5679a27d6690d2e8215d Author: Ville Syrjälä Date: Fri Oct 15 10:16:21 2021 +0300 drm/i915: Extract ilk_pch_get_config() Pull the ilk+ PCH state readout into its own function and relocate to the appropriate file. The clock readout parts are perhaps a bit iffy since we depend on the gmch DPLL readout code. But we can think about the clock readout big picture later. Cc: Dave Airlie Cc: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211015071625.593-6-ville.syrjala@linux.intel.com Reviewed-by: Dave Airlie commit f45d2252ee10b036d539d93a752a2434a54a0d2b Author: Ville Syrjälä Date: Mon Oct 18 18:35:25 2021 +0300 drm/i915: Move LPT PCH readout code Nuke the hsw_get_ddi_port_state() eyesore by putting the readout code into intel_pch_display.c, and calling it directly from hsw_crt_get_config(). Note that the nuked TRANS_DDI_FUNC_CTL readout from hsw_get_ddi_port_state() is now etirely redundant since we get called from the encoder->get_config() so we already know we're dealing with the correct DDI port. Previously the code was called from a place where that wasn't known so it had to checked manually. v2: Clarify the TRANS_DDI_FUNC_CTL change (Dave) Nuke the now unused *TRANS_DDI_FUNC_CTL_VAL_TO_PORT() (Dave) Cc: Dave Airlie Cc: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211018153525.21597-1-ville.syrjala@linux.intel.com Reviewed-by: Dave Airlie commit ccebd0e4021084361d1549f4e83688b1fae89c3e Author: Ville Syrjälä Date: Fri Oct 15 10:16:19 2021 +0300 drm/i915: Clean up the {ilk,lpt}_pch_enable() calling convention Use the clean "atomic_state+crtc" approach of passing arguments to the top level PCH modeset code. And while at it we can also just pass the whole crtc to ilk_disable_pch_transcoder(). v2: Elimiate double space between function args (Dave) Cc: Dave Airlie Cc: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211015071625.593-4-ville.syrjala@linux.intel.com Reviewed-by: Dave Airlie commit b2de2d006dfa6bf48b141a2a51ca078ed1047b63 Author: Ville Syrjälä Date: Fri Oct 15 10:16:18 2021 +0300 drm/i915: Move PCH modeset code to its own file Start moving the code for PCH modeset sequence/etc. to its own file. Still not sure about the file name though... Cc: Dave Airlie Cc: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211015071625.593-3-ville.syrjala@linux.intel.com Reviewed-by: Dave Airlie commit ae880cd02c547cf474cca976c39c76b629921b26 Author: Ville Syrjälä Date: Fri Oct 15 10:16:17 2021 +0300 drm/i915: Move PCH refclock stuff into its own file Move the PCH refclk stuff (including all the LPT/WPT iCLKIP/CLKOUT_DP things) to its own file. We also suck in the mPHY programming from intel_fdi.c since we're the only caller. Cc: Dave Airlie Cc: Jani Nikula Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211015071625.593-2-ville.syrjala@linux.intel.com Reviewed-by: Dave Airlie commit 91909d57169dd587b11d9e1607faaea07393696f Author: Shunsuke Mie Date: Fri Oct 8 20:20:09 2021 +0900 dma-buf: Update obsoluted comments on dma_buf_vmap/vunmap() A comment for the dma_buf_vmap/vunmap() is not catching up a corresponding implementation. Signed-off-by: Shunsuke Mie Link: https://patchwork.freedesktop.org/patch/msgid/20211008112009.118996-1-mie@igel.co.jp Reviewed-by: Christian König Signed-off-by: Christian König commit 7a279c14df56c741b99085108a643f2dae078773 Author: Rodrigo Vivi Date: Fri Oct 15 05:16:50 2021 -0400 drm/i915: Don't propagate the gen split confusion further There's no such thing as gen13. It is either display 13 or graphics 13. Don't propagate the gen12 confusion further. Cc: Joonas Lahtinen Cc: Jani Nikula Signed-off-by: Rodrigo Vivi Reviewed-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20211015091650.87270-1-rodrigo.vivi@intel.com commit 2c85034db194ead0595445cbdd70414d3634fcea Author: Rodrigo Vivi Date: Fri Oct 15 05:11:29 2021 -0400 drm/i915: Clean-up bonding debug message. We should stop using the gen name and the "+" to reference the newer platforms. And on this case specifically we can simplify the debug message even further. Cc: Jani Nikula Cc: Matthew Brost Signed-off-by: Rodrigo Vivi Reviewed-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20211015091129.83226-1-rodrigo.vivi@intel.com commit 17dbbe7b25446f7ce4af4c5186b60427cdd770a7 Author: Ville Syrjälä Date: Thu Oct 7 02:57:04 2021 +0300 drm/i915: Rename intel_load_plane_csc_black() intel_load_plane_csc_black() is specific to icl+ so deserves a name reflecting that fact. Also rename the variables to standard form so I won't get confused reading the code. v2: icl+ not glk+ Cc: Anshuman Gupta Cc: Daniele Ceraolo Spurio Cc: Juston Li Cc: Rodrigo Vivi Cc: Uma Shankar Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211006235704.28894-5-ville.syrjala@linux.intel.com Reviewed-by: Juston Li commit 63d7d05678af5cdc616718806971041ecacf4897 Author: Ville Syrjälä Date: Thu Oct 7 02:57:03 2021 +0300 drm/i915: Remove the drm_dbg() from the vblank evade critical section We are inside the vblank evade critical section here, racing against the raster beam. There is no time to print debug messages. Cc: Anshuman Gupta Cc: Daniele Ceraolo Spurio Cc: Juston Li Cc: Rodrigo Vivi Cc: Uma Shankar Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211006235704.28894-4-ville.syrjala@linux.intel.com Reviewed-by: Juston Li commit 841f262e74a7c209055152026041bbe486c962b9 Author: Ville Syrjälä Date: Thu Oct 7 02:57:02 2021 +0300 drm/i915: Fix up skl_program_plane() pxp stuff There's lots of expensive stuff inserted between the PLANE_CTL and PLANE_SURF writes even though the comment before the PLANE_CTL write says not to put stuff there. Move it all to a more apporiate place. There's also a weird PLANE_COLOR_CTL RMW in there. I guess because force_black was computed way too late originally, but that is now sorted. Cc: Anshuman Gupta Cc: Daniele Ceraolo Spurio Cc: Juston Li Cc: Rodrigo Vivi Cc: Uma Shankar Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211006235704.28894-3-ville.syrjala@linux.intel.com Reviewed-by: Rodrigo Vivi commit f9a7b19c484067fdcc5972c88ab6f06898adc40d Author: Ville Syrjälä Date: Thu Oct 7 02:57:01 2021 +0300 drm/i915: Move the pxp plane state computation No real reason to have this pxp state computation in intel_atomic_check_planes(). Just stuff it into skl_plane_check(). There was also some funny state copying being done from the old plane state to the new plane state when the plane is anyway disabled. The one thing we presumably must remember to do is copy over the decrypt state when assigning a Y plane for planar YCbCr scanout, so that the Y plane's PLANE_SURF will get the appropriate bit set. The force_black thing should not matter as I'm pretty sure all that stuff is ignored for the Y plane. I suppose this was the reason for the odd placement for the state computation, but I see no reason to deviate from the standard way of doing these things. This also guarantees that we don't calculate things differently between the linked UV and Y plane. v2: Only do stuff for icl+ since 'force_black' depends on the plane CSC which is an icl+ feature Cc: Anshuman Gupta Cc: Daniele Ceraolo Spurio Cc: Juston Li Cc: Rodrigo Vivi Cc: Uma Shankar Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211006235704.28894-2-ville.syrjala@linux.intel.com Reviewed-by: Juston Li #v1 commit 2e70570656adfe1c5d9a29940faa348d5f132199 Author: Nathan Chancellor Date: Thu Oct 14 14:19:16 2021 -0700 drm/i915: Avoid bitwise vs logical OR warning in snb_wm_latency_quirk() A new warning in clang points out a place in this file where a bitwise OR is being used with boolean types: drivers/gpu/drm/i915/intel_pm.c:3066:12: warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical] changed = ilk_increase_wm_latency(dev_priv, dev_priv->wm.pri_latency, 12) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This construct is intentional, as it allows every one of the calls to ilk_increase_wm_latency() to occur (instead of short circuiting with logical OR) while still caring about the result of each call. To make this clearer to the compiler, use the '|=' operator to assign the result of each ilk_increase_wm_latency() call to changed, which keeps the meaning of the code the same but makes it obvious that every one of these calls is expected to happen. Link: https://github.com/ClangBuiltLinux/linux/issues/1473 Reported-by: Nick Desaulniers Signed-off-by: Nathan Chancellor Suggested-by: Dávid Bolvanský Reviewed-by: Nick Desaulniers Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20211014211916.3550122-1-nathan@kernel.org commit 5a614570172e1c9f59035d259dd735acd4f1c01b Author: Brian Norris Date: Tue Sep 28 14:35:52 2021 -0700 drm/rockchip: dsi: Disable PLL clock on bind error Fix some error handling here noticed in review of other changes. Fixes: 2d4f7bdafd70 ("drm/rockchip: dsi: migrate to use dw-mipi-dsi bridge driver") Signed-off-by: Brian Norris Reported-by: Chen-Yu Tsai Reviewed-by: Chen-Yu Tsai Tested-by: Nícolas F. R. A. Prado Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20210928143413.v3.4.I8bb7a91ecc411d56bc155763faa15f289d7fc074@changeid commit 251888398753924059f3bb247a44153a2853137f Author: Brian Norris Date: Tue Sep 28 14:35:51 2021 -0700 drm/rockchip: dsi: Fix unbalanced clock on probe error Our probe() function never enabled this clock, so we shouldn't disable it if we fail to probe the bridge. Noted by inspection. Fixes: 2d4f7bdafd70 ("drm/rockchip: dsi: migrate to use dw-mipi-dsi bridge driver") Signed-off-by: Brian Norris Reviewed-by: Chen-Yu Tsai Tested-by: Nícolas F. R. A. Prado Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20210928143413.v3.3.Ie8ceefb51ab6065a1151869b6fcda41a467d4d2c@changeid commit e584cdc1549932f87a2707b56bc588cfac5d89e0 Author: Brian Norris Date: Tue Sep 28 14:35:50 2021 -0700 drm/rockchip: dsi: Reconfigure hardware on resume() Since commit 43c2de1002d2 ("drm/rockchip: dsi: move all lane config except LCDC mux to bind()"), we perform most HW configuration in the bind() function. This configuration may be lost on suspend/resume, so we need to call it again. That may lead to errors like this after system suspend/resume: dw-mipi-dsi-rockchip ff968000.mipi: failed to write command FIFO panel-kingdisplay-kd097d04 ff960000.mipi.0: failed write init cmds: -110 Tested on Acer Chromebook Tab 10 (RK3399 Gru-Scarlet). Note that early mailing list versions of this driver borrowed Rockchip's downstream/BSP solution, to do HW configuration in mode_set() (which *is* called at the appropriate pre-enable() times), but that was discarded along the way. I've avoided that still, because mode_set() documentation doesn't suggest this kind of purpose as far as I can tell. Fixes: 43c2de1002d2 ("drm/rockchip: dsi: move all lane config except LCDC mux to bind()") Cc: Signed-off-by: Brian Norris Reviewed-by: Chen-Yu Tsai Tested-by: Nícolas F. R. A. Prado Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20210928143413.v3.2.I4e9d93aadb00b1ffc7d506e3186a25492bf0b732@changeid commit 514db871922f103886ad4d221cf406b4fcc5e74a Author: Brian Norris Date: Tue Sep 28 14:35:49 2021 -0700 drm/rockchip: dsi: Hold pm-runtime across bind/unbind In commit 43c2de1002d2 ("drm/rockchip: dsi: move all lane config except LCDC mux to bind()"), we moved most HW configuration to bind(), but we didn't move the runtime PM management. Therefore, depending on initial boot state, runtime-PM workqueue delays, and other timing factors, we may disable our power domain in between the hardware configuration (bind()) and when we enable the display. This can cause us to lose hardware state and fail to configure our display. For example: dw-mipi-dsi-rockchip ff968000.mipi: failed to write command FIFO panel-innolux-p079zca ff960000.mipi.0: failed to write command 0 or: dw-mipi-dsi-rockchip ff968000.mipi: failed to write command FIFO panel-kingdisplay-kd097d04 ff960000.mipi.0: failed write init cmds: -110 We should match the runtime PM to the lifetime of the bind()/unbind() cycle. Tested on Acer Chrometab 10 (RK3399 Gru-Scarlet), with panel drivers built either as modules or built-in. Side notes: it seems one is more likely to see this problem when the panel driver is built into the kernel. I've also seen this problem bisect down to commits that simply changed Kconfig dependencies, because it changed the order in which driver init functions were compiled into the kernel, and therefore the ordering and timing of built-in device probe. Fixes: 43c2de1002d2 ("drm/rockchip: dsi: move all lane config except LCDC mux to bind()") Link: https://lore.kernel.org/linux-rockchip/9aedfb528600ecf871885f7293ca4207c84d16c1.camel@gmail.com/ Reported-by: Cc: Signed-off-by: Brian Norris Tested-by: Nícolas F. R. A. Prado Reviewed-by: Chen-Yu Tsai Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20210928143413.v3.1.Ic2904d37f30013a7f3d8476203ad3733c186827e@changeid commit 085af7d28897deb08a4f64a29e55525f963cc041 Author: Brian Norris Date: Fri Oct 8 15:31:04 2021 -0700 drm/rockchip: vop: Add timeout for DSP hold If hardware is malfunctioning (e.g., misconfigured clocks?), we can get stuck here forever, holding various DRM locks and eventually locking up the entire system. It's better to complain loudly and move on, than to lock up the system. In local tests, this operation takes less than 20ms. Signed-off-by: Brian Norris Signed-off-by: Heiko Stuebner Link: https://patchwork.freedesktop.org/patch/msgid/20211008153102.1.I2a5dbaaada35023a9703a8db7af501528fbb6e31@changeid commit 75ad021f21927311b8d454939eb248a50df92525 Author: Yang Li Date: Fri Oct 15 15:14:41 2021 +0800 drm/v3d: nullify pointer se with a NULL Currently a plain integer is being used to nullify the pointer struct v3d_submit_ext *se. Use NULL instead. Cleans up sparse warnings: drivers/gpu/drm/v3d/v3d_gem.c:777:53: warning: Using plain integer as NULL pointer drivers/gpu/drm/v3d/v3d_gem.c:1010:45: warning: Using plain integer as NULL pointer Reported-by: Abaci Robot Signed-off-by: Yang Li Reviewed-by: Melissa Wen Signed-off-by: Melissa Wen Link: https://patchwork.freedesktop.org/patch/msgid/1634282081-72255-1-git-send-email-yang.lee@linux.alibaba.com commit 9aa2c2320e6fb50d8f80963e786d0b564d0695ab Author: Shawn Guo Date: Mon Aug 9 13:10:08 2021 +0800 drm/panel: Add Sony Tulip Truly NT35521 driver It adds a DRM panel driver for Sony Tulip Truly NT35521 5.24" 1280x720 DSI panel, which can be found on Sony Xperia M4 Aqua phone. The panel backlight is managed through DSI link. The driver is built using linux-mdss-dsi-panel-driver-generator[1], and additionally modeling the 5V control GPIOs with regulators and adding Backlight GPIO support. [1] https://github.com/msm8916-mainline/linux-mdss-dsi-panel-driver-generator Signed-off-by: Shawn Guo Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210809051008.6172-3-shawn.guo@linaro.org commit 3d61e450f99a4513c719832e8346830dca03140d Author: Shawn Guo Date: Mon Aug 9 13:10:07 2021 +0800 dt-bindings: display: Add Sony Tulip Truly NT35521 panel support The Sony Tulip Truly NT35521 is a 5.24" 1280x720 DSI panel, which can be found on Sony Xperia M4 Aqua phone. The backlight is managed through DSI link. Signed-off-by: Shawn Guo Reviewed-by: Rob Herring Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210809051008.6172-2-shawn.guo@linaro.org commit a19125a281128c836faae249c1001eb8d7a18b48 Author: AngeloGioacchino Del Regno Date: Wed Sep 1 19:31:14 2021 +0200 drm/panel: Add BOE BF060Y8M-AJ0 5.99" AMOLED panel driver This adds support for the BOE BF060Y8M-AJ0 5.99" AMOLED module that can be found in some F(x)Tec Pro1 and Elephone U1 devices. Signed-off-by: AngeloGioacchino Del Regno Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210901173115.998628-1-angelogioacchino.delregno@somainline.org commit 8bf632fe19d00f4393fa5f9316a91a331e8b19fb Author: AngeloGioacchino Del Regno Date: Wed Sep 1 19:31:15 2021 +0200 dt-bindings: display: Document BOE BF060Y8M-AJ0 panel compatible Document the boe,bf060y8m-aj0 panel. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Rob Herring Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210901173115.998628-2-angelogioacchino.delregno@somainline.org commit 623a3531e9cfcb95de55f0e4a38668705eeec8ad Author: AngeloGioacchino Del Regno Date: Wed Sep 1 19:31:26 2021 +0200 drm/panel: Add driver for Novatek NT35950 DSI DriverIC panels Add a driver for panels using the Novatek NT35950 Display Driver IC, including support for the Sharp LS055D1SX04, found in some Sony Xperia Z5 Premium and XZ Premium smartphones. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Marijn Suijten Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210901173127.998901-1-angelogioacchino.delregno@somainline.org commit dafa38c728b15540aca05fc7f3b63b3ac2419074 Author: AngeloGioacchino Del Regno Date: Wed Sep 1 19:31:27 2021 +0200 dt-bindings: display: Add bindings for Novatek NT35950 The nt35950 IC from Novatek is a Driver IC used to drive MIPI-DSI panels, with Static RAM for content retention in command mode and also supports video mode with VESA Frame Buffer Compression or Display Stream Compression on single, or dual dsi port(s). This DDIC is also capable of upscaling an input image to the panel's native resolution, for example it can upscale a 1920x1080 input to 3840x2160 with either bilinear interpolation or pixel duplication. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Rob Herring Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210901173127.998901-2-angelogioacchino.delregno@somainline.org commit 30a46873941f1422e9169c9e38d4874365054c13 Author: Marek Vasut Date: Sat Oct 16 23:04:02 2021 +0200 drm/bridge: ti-sn65dsi83: Optimize reset line toggling Current code always sets reset line low in .pre_enable callback and holds it low for 10ms. This is sub-optimal and increases the time between enablement of the DSI83 and valid LVDS clock. Rework the reset handling such that the reset line is held low for 10ms both in probe() of the driver and .disable callback, which guarantees that the reset line was always held low for more than 10ms and therefore the reset line timing requirement is satisfied. Furthermore, move the reset handling into .enable callback so the entire DSI83 initialization is now in one place. This reduces DSI83 enablement delay by up to 10ms. Signed-off-by: Marek Vasut Reviewed-by: Linus Walleij Cc: Laurent Pinchart Cc: Linus Walleij Cc: Robert Foss Cc: Sam Ravnborg Cc: dri-devel@lists.freedesktop.org Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20211016210402.171595-1-marex@denx.de commit 40e8c0198a51656086b746597af8c36f291b53d1 Author: Michael Trimarchi Date: Sat Oct 16 10:22:31 2021 +0000 drm/panel: ilitek-ili9881c: Make gpio-reset optional Depends in how logic is connected to the board the gpio is not stricly required. Signed-off-by: Michael Trimarchi Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20211016102232.202119-5-michael@amarulasolutions.com commit 19febe662d0b31b717655041cd67df524d19a5ac Author: Michael Trimarchi Date: Sat Oct 16 10:22:29 2021 +0000 drm/panel: ilitek-ili9881d: add support for Wanchanglong W552946ABA panel W552946ABA is a panel by Wanchanglong. This panel utilizes the Ilitek ILI9881D controller. Add this panel's initialzation sequence and timing to ILI9881D driver. Tested on px30-evb v11 Signed-off-by: Michael Trimarchi Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20211016102232.202119-3-michael@amarulasolutions.com commit 89c6577a527e3de5a34c47036deeeba572f44125 Author: Michael Trimarchi Date: Sat Oct 16 10:22:30 2021 +0000 dt-bindings: ili9881c: add compatible string for Wanchanglong w552946aba It utilizes an Ilitek ILI9881D controller chip, but its compatible with ili9881c so should be added to ilitek,ili9881c file. Add the compatible string for it. Signed-off-by: Michael Trimarchi Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20211016102232.202119-4-michael@amarulasolutions.com commit acec93f2f04b364620122ca8375200610bc8797b Author: Michael Trimarchi Date: Sat Oct 16 10:22:28 2021 +0000 dt-bindings: vendor-prefix: add Wanchanglong Electronics Technology Wanchanglong Electronics Technology is a company to provide LCD modules. Signed-off-by: Michael Trimarchi Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20211016102232.202119-2-michael@amarulasolutions.com commit c9a9dc49dc1fb7e57b134c2bf8bcb6bba9ca3377 Author: AngeloGioacchino Del Regno Date: Wed Oct 6 17:21:58 2021 +0200 dt-bindings: display/bridge: sil, sii9234: Convert to YAML binding Convert the Silicon Image SiI9234 HDMI/MHL bridge documentation to YAML. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Rob Herring Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20211006152158.601856-1-angelogioacchino.delregno@collabora.com commit cc83ff247be6aaabb3a45e8c0fb048e91afe7b8a Author: Qing Wang Date: Tue Oct 12 20:28:13 2021 -0700 video: omapfb: replace snprintf in show functions with sysfs_emit coccicheck complains about the use of snprintf() in sysfs show functions. Fix the coccicheck warning: WARNING: use scnprintf or sprintf. Use sysfs_emit instead of scnprintf or sprintf makes more sense. Signed-off-by: Qing Wang Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/1634095693-4428-1-git-send-email-wangqing@vivo.com commit 4701a0dd413c5779848137d758ab2ed5b920bd5f Author: Qing Wang Date: Tue Oct 12 20:28:00 2021 -0700 video: fbdev: replace snprintf in show functions with sysfs_emit coccicheck complains about the use of snprintf() in sysfs show functions. Fix the coccicheck warning: WARNING: use scnprintf or sprintf. Use sysfs_emit instead of scnprintf or sprintf makes more sense. Signed-off-by: Qing Wang Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/1634095680-4377-1-git-send-email-wangqing@vivo.com commit 26bc3371e648f44dda154ad848add07430afd42f Author: AngeloGioacchino Del Regno Date: Thu Oct 7 09:58:22 2021 +0200 dt-bindings: display/bridge: ptn3460: Convert to YAML binding Convert the NXP PTN3460 eDP to LVDS bridge documentation to YAML. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Rob Herring Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20211007075822.62411-1-angelogioacchino.delregno@collabora.com commit 6eab8224ed3daf26b5fae36dc8663d32e5cd9c21 Author: Sam Ravnborg Date: Fri Oct 15 20:35:00 2021 +0200 drm/tiny: ili9163: fix build Commit build fix that I forgot to amend :-( Fixes: 50848e3787ad ("drm/tiny: add driver for newhaven, 1.8-128160EF") Signed-off-by: Sam Ravnborg Acked-by: Sam Ravnborg Cc: Daniel Mack Link: https://patchwork.freedesktop.org/patch/msgid/20211015150131.1020878-3-daniel@zonque.org commit 50848e3787ad9eaae38889fcb7f4aa1f4b42f4eb Author: Daniel Mack Date: Fri Oct 15 17:01:31 2021 +0200 drm/tiny: add driver for newhaven, 1.8-128160EF This patch adds support for Newhaven's NHD-1.8-128160EF display, featuring an Ilitek ILI9163 controller. Signed-off-by: Daniel Mack Acked-by: Daniel Vetter Acked-by: Thomas Zimmermann Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20211015150131.1020878-3-daniel@zonque.org commit 893e46a9ae874e9953c57334d38acd2ec89748c0 Author: Daniel Mack Date: Fri Oct 15 17:01:30 2021 +0200 dt-bindings: display: add bindings for newhaven, 1.8-128160EF This adds documentation for a new ILI9163 based, SPI connected display. Signed-off-by: Daniel Mack Reviewed-by: Rob Herring Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20211015150131.1020878-2-daniel@zonque.org commit 5f9741f53a3e0e84befc60cc1491272d18564ea0 Author: Qing Wang Date: Thu Oct 14 23:48:10 2021 -0700 drm/panel: dsi-cm: replace snprintf in show functions with sysfs_emit show() must not use snprintf() when formatting the value to be returned to user space. Fix the following coccicheck warning: drivers/gpu/drm/panel/panel-dsi-cm.c:251: WARNING: use scnprintf or sprintf. drivers/gpu/drm/panel/panel-dsi-cm.c:271: WARNING: use scnprintf or sprintf. Use sysfs_emit instead of scnprintf or sprintf makes more sense. Signed-off-by: Qing Wang Reviewed-by: Sebastian Reichel Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/1634280490-4429-1-git-send-email-wangqing@vivo.com commit f6632721cd6231e1bf28b5317dcc7543e43359f7 Author: Neil Armstrong Date: Thu Oct 14 17:26:03 2021 +0200 drm/bridge: synopsys: dw-hdmi: also allow interlace on bridge Since we allow interlace on the encoder, also allow it on the bridge so we can allow interlaced modes when using DRM_BRIDGE_ATTACH_NO_CONNECTOR. Signed-off-by: Neil Armstrong Acked-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20211014152606.2289528-5-narmstrong@baylibre.com commit 566b651cc53154d6fe88ebd61c86b996d6621d09 Author: Cai Huoqing Date: Thu Sep 16 18:46:57 2021 +0800 drm/panel: y030xx067a: Make use of the helper function dev_err_probe() When possible use dev_err_probe help to properly deal with the PROBE_DEFER error, the benefit is that DEFER issue will be logged in the devices_deferred debugfs file. And using dev_err_probe() can reduce code size, the error value gets printed. Signed-off-by: Cai Huoqing Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210916104658.11834-1-caihuoqing@baidu.com commit e82ef424eec8e412cc1ca9170c49633316b29f07 Author: Cai Huoqing Date: Thu Sep 16 18:46:49 2021 +0800 drm/panel: xpp055c272: Make use of the helper function dev_err_probe() When possible use dev_err_probe help to properly deal with the PROBE_DEFER error, the benefit is that DEFER issue will be logged in the devices_deferred debugfs file. And using dev_err_probe() can reduce code size, the error value gets printed. Signed-off-by: Cai Huoqing Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210916104650.11781-1-caihuoqing@baidu.com commit a8daf03fa2d49c8892c3de924742b1a47b62f3e6 Author: Cai Huoqing Date: Thu Sep 16 18:46:42 2021 +0800 drm/panel: td043mtea1: Make use of the helper function dev_err_probe() When possible use dev_err_probe help to properly deal with the PROBE_DEFER error, the benefit is that DEFER issue will be logged in the devices_deferred debugfs file. And using dev_err_probe() can reduce code size, the error value gets printed. Signed-off-by: Cai Huoqing Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210916104642.11728-1-caihuoqing@baidu.com commit d60b93917a66414aaee5704dd07c845aa6cf9645 Author: Cai Huoqing Date: Thu Sep 16 18:46:34 2021 +0800 drm/panel: sofef00: Make use of the helper function dev_err_probe() When possible use dev_err_probe help to properly deal with the PROBE_DEFER error, the benefit is that DEFER issue will be logged in the devices_deferred debugfs file. And using dev_err_probe() can reduce code size, the error value gets printed. Signed-off-by: Cai Huoqing Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210916104635.11675-1-caihuoqing@baidu.com commit 94f9b9525c0a2e8aac741f8e0a2d71c4e2771ba9 Author: Cai Huoqing Date: Thu Sep 16 18:46:27 2021 +0800 drm/panel: s6e63j0x03: Make use of the helper function dev_err_probe() When possible use dev_err_probe help to properly deal with the PROBE_DEFER error, the benefit is that DEFER issue will be logged in the devices_deferred debugfs file. And using dev_err_probe() can reduce code size, the error value gets printed. Signed-off-by: Cai Huoqing Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210916104627.11622-1-caihuoqing@baidu.com commit d41af761dbc137051ffe82fe4f23db54ebb1d523 Author: Cai Huoqing Date: Thu Sep 16 18:46:19 2021 +0800 drm/panel: nt39016: Make use of the helper function dev_err_probe() When possible use dev_err_probe help to properly deal with the PROBE_DEFER error, the benefit is that DEFER issue will be logged in the devices_deferred debugfs file. And using dev_err_probe() can reduce code size, the error value gets printed. Signed-off-by: Cai Huoqing Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210916104620.11569-1-caihuoqing@baidu.com commit ef41af47e40ed69e439cfedf74068bf797c62fd1 Author: Cai Huoqing Date: Thu Sep 16 18:46:11 2021 +0800 drm/panel: ls037v7dw01: Make use of the helper function dev_err_probe() When possible use dev_err_probe help to properly deal with the PROBE_DEFER error, the benefit is that DEFER issue will be logged in the devices_deferred debugfs file. And using dev_err_probe() can reduce code size, the error value gets printed. Signed-off-by: Cai Huoqing Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210916104612.11516-1-caihuoqing@baidu.com commit a30fc787a1d3ba317e4736483ec8ae50043e6fa7 Author: Cai Huoqing Date: Thu Sep 16 18:42:47 2021 +0800 drm/panel: k101-im2ba02: Make use of the helper function dev_err_probe() When possible use dev_err_probe help to properly deal with the PROBE_DEFER error, the benefit is that DEFER issue will be logged in the devices_deferred debugfs file. And using dev_err_probe() can reduce code size, and the error value gets printed. Signed-off-by: Cai Huoqing Acked-by: Icenowy Zheng Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210916104247.11270-1-caihuoqing@baidu.com commit 386e1c180f1f06acb64205c37f0fccc4f8885a73 Author: Cai Huoqing Date: Thu Sep 16 18:42:39 2021 +0800 drm/panel: ili9881c: Make use of the helper function dev_err_probe() When possible use dev_err_probe help to properly deal with the PROBE_DEFER error, the benefit is that DEFER issue will be logged in the devices_deferred debugfs file. And using dev_err_probe() can reduce code size, and the error value gets printed. Signed-off-by: Cai Huoqing Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210916104240.11217-1-caihuoqing@baidu.com commit 5ddc1e27e03298c433b0c889c2a431432abc2cc0 Author: Cai Huoqing Date: Thu Sep 16 18:42:32 2021 +0800 drm/panel: fy07024di26a30d: Make use of the helper function dev_err_probe() When possible use dev_err_probe help to properly deal with the PROBE_DEFER error, the benefit is that DEFER issue will be logged in the devices_deferred debugfs file. And using dev_err_probe() can reduce code size, and the error value gets printed. Signed-off-by: Cai Huoqing Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210916104232.11164-1-caihuoqing@baidu.com commit 6b1a69bcb23fbcc65b0b086063f608e3509dfd0f Author: Cai Huoqing Date: Thu Sep 16 18:42:24 2021 +0800 drm/panel: ej030na: Make use of the helper function dev_err_probe() When possible use dev_err_probe help to properly deal with the PROBE_DEFER error, the benefit is that DEFER issue will be logged in the devices_deferred debugfs file. And using dev_err_probe() can reduce code size, and the error value gets printed. Signed-off-by: Cai Huoqing Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210916104225.11111-1-caihuoqing@baidu.com commit 7f44a1166c8aa69f1bcc9096dc07b7096f7822df Author: Cai Huoqing Date: Thu Sep 16 15:37:05 2021 +0800 drm: panel: nt36672a: Removed extra whitespace. Removed extra whitespace before dev_err_probe() according to coding style. Signed-off-by: Cai Huoqing Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210916073706.9004-1-caihuoqing@baidu.com commit 9bf7123bb07f98dc76acb5daa91248e6f95713cb Author: Brian Norris Date: Thu Sep 23 17:33:55 2021 -0700 drm/panel: Delete panel on mipi_dsi_attach() failure Many DSI panel drivers fail to clean up their panel references on mipi_dsi_attach() failure, so we're leaving a dangling drm_panel reference to freed memory. Clean that up on failure. Noticed by inspection, after seeing similar problems on other drivers. Therefore, I'm not marking Fixes/stable. Signed-off-by: Brian Norris Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210923173336.3.If9e74fa9b1d6eaa9e0e5b95b2b957b992740251c@changeid commit 32a267e9c057e1636e7afdd20599aa5741a73079 Author: Brian Norris Date: Thu Sep 23 17:33:54 2021 -0700 drm/panel: innolux-p079zca: Delete panel on attach() failure If we fail to attach (e.g., because 1 of 2 dual-DSI controllers aren't ready), we leave a dangling drm_panel reference to freed memory. Clean that up on failure. This problem exists since the driver's introduction, but is especially relevant after refactored for dual-DSI variants. Fixes: 14c8f2e9f8ea ("drm/panel: add Innolux P079ZCA panel driver") Fixes: 7ad4e4636c54 ("drm/panel: p079zca: Refactor panel driver to support multiple panels") Signed-off-by: Brian Norris Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210923173336.2.I9023cf8811a3abf4964ed84eb681721d8bb489d6@changeid commit 5f31dbeae8a88f31c3eb4eb526ab4807c40da241 Author: Brian Norris Date: Thu Sep 23 17:33:53 2021 -0700 drm/panel: kingdisplay-kd097d04: Delete panel on attach() failure If we fail to attach (e.g., because 1 of 2 dual-DSI controllers aren't ready), we leave a dangling drm_panel reference to freed memory. Clean that up on failure. Fixes: 2a994cbed6b2 ("drm/panel: Add Kingdisplay KD097D04 panel driver") Signed-off-by: Brian Norris Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210923173336.1.Icb4d9dbc1817f4e826361a4f1cea7461541668f0@changeid commit 437c3d87590e7c1d901c66d8916e7a58f0fc7ff7 Author: Raffaele Tranquillini Date: Sat Sep 25 12:29:09 2021 +0200 drm/panel: Add JDI R63452 MIPI DSI panel driver This adds support for the JDI R63452 Full HD LCD panel used on the Xiaomi Mi 5 smartphone, in MIPI DSI command mode. Signed-off-by: Raffaele Tranquillini Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210925102911.518038-1-raffaele.tranquillini@gmail.com commit b7d4ce477ea950b6f0000b8c5d0e0fdbff312f6e Author: Raffaele Tranquillini Date: Sat Sep 25 12:31:33 2021 +0200 dt-bindings: panel-simple-dsi: add JDI R63452 panel bindings This add the bindings for the JDI FHD_R63452 1080x1920 5.2" LCD DSI panel used on the Xiaomi Mi 5 smartphone. Signed-off-by: Raffaele Tranquillini Acked-by: Rob Herring Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20210925103135.518443-1-raffaele.tranquillini@gmail.com commit acf20ed020ffa4d6cc8347e8d356509b95df3cbe Author: Wang Hai Date: Wed Oct 13 19:41:39 2021 +0800 drm: fix null-ptr-deref in drm_dev_init_release() I got a null-ptr-deref report: [drm:drm_dev_init [drm]] *ERROR* Cannot allocate anonymous inode: -12 ================================================================== BUG: KASAN: null-ptr-deref in iput+0x3c/0x4a0 ... Call Trace: dump_stack_lvl+0x6c/0x8b kasan_report.cold+0x64/0xdb __asan_load8+0x69/0x90 iput+0x3c/0x4a0 drm_dev_init_release+0x39/0xb0 [drm] drm_managed_release+0x158/0x2d0 [drm] drm_dev_init+0x3a7/0x4c0 [drm] __devm_drm_dev_alloc+0x55/0xd0 [drm] mi0283qt_probe+0x8a/0x2b5 [mi0283qt] spi_probe+0xeb/0x130 ... entry_SYSCALL_64_after_hwframe+0x44/0xae If drm_fs_inode_new() fails in drm_dev_init(), dev->anon_inode will point to PTR_ERR(...) instead of NULL. This will result in null-ptr-deref when drm_fs_inode_free(dev->anon_inode) is called. drm_dev_init() drm_fs_inode_new() // fail, dev->anon_inode = PTR_ERR(...) drm_managed_release() drm_dev_init_release() drm_fs_inode_free() // access non-existent anon_inode Define a temp variable and assign it to dev->anon_inode if the temp variable is not PTR_ERR. Fixes: 2cbf7fc6718b ("drm: Use drmm_ for drm_dev_init cleanup") Reported-by: Hulk Robot Signed-off-by: Wang Hai Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20211013114139.4042207-1-wanghai38@huawei.com commit 1a84a308acda285cf9fae548262b8e199845b2d1 Author: Nikola Pavlica Date: Mon Oct 11 23:27:31 2021 +0200 drm/panel-simple: Add Vivax TPC-9150 panel v6 The model and make of the LCD panel of the Vivax TPC-9150 is unknown, hence the panel settings that were retrieved with a FEX dump are named after the device NOT the actual panel. The LCD in question is a 50 pin MISO TFT LCD panel of the resolution 1024x600 used by the aforementioned device. Version 2, as Thierry kindly suggested that I fix the order in which the panel was ordered compared to others. Version 3, filling in the required info suggested by Sam. Plus some factual issues that I've corrected myself (tested working) Version 4, rearranged the display parameters and fix invalid bit format issue. (Thanks Sam) Version 5, referred to FEX file instead of manual debugging for information. Version 6, same as above. This time, it'll be documented. A bit of context first: I experimented with this a long time ago whilst I was first learning how to get Linux running on Allwinner boards, I didn't have many resources at hand so this was quite slow. Anyways, I stumbled upon this guide (https://linux-sunxi.org/LCD) and was reading about how to setup the LCD for my tablet. Since I was able to make a proper FEX dump, I was also able to read the correct parameters for myself without relying on leaked documents or part numbers and whatnot. In the FEX dump the value lcd_frm IS SET to 1, which means, at least according to the document, that this display is INDEED an 18 bit per pixel panel. Compiling U-Boot and seeing the tux in proper colors confirmed this. As per Sam Ravnborg's suggestion, I've changed the panel to his format "MEDIA_BUS_FMT_RGB666_1X7X3_SPWG", however this does not lead to any actual change in regards to the functionality since the sunxi panel driver just ignores this value. However, hopefully this clears up any errors down the road as either the driver becomes advanced enough to not ignore this value or that some other piece of software relies on this value being known. PS: Apologies to the maintainers that have to endure my misjudgement about how these things work. As for the concerns about a single patch series, I wasn't sure where to send the patches as they clearly aren't dt-bindings related and my previous patches have ended up in drm-misc-fixes anyway. So I'm guessing I'll be fine if I just post them in the list from last time??? Signed-off-by: Nikola Pavlica Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20211011212731.77763-1-pavlica.nikola@gmail.com commit 7c4dd0a266527ffa7ed8d424facaba171618820a Author: Marek Vasut Date: Wed Oct 13 00:42:52 2021 +0200 drm: of: Add drm_of_lvds_get_data_mapping Add helper function to convert DT "data-mapping" property string value into media bus format value, and deduplicate the code in panel-lvds.c and lvds-codec.c . Signed-off-by: Marek Vasut Cc: Laurent Pinchart Cc: Sam Ravnborg To: dri-devel@lists.freedesktop.org Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20211012224252.29185-1-marex@denx.de commit 189723fbe9aca18d6f7d638c59a40288030932b5 Author: Dan Carpenter Date: Wed Oct 13 11:08:25 2021 +0300 drm/bridge: display-connector: fix an uninitialized pointer in probe() The "label" pointer is used for debug output. The code assumes that it is either NULL or valid, but it is never set to NULL. It is either valid or uninitialized. Fixes: 0c275c30176b ("drm/bridge: Add bridge driver for display connectors") Signed-off-by: Dan Carpenter Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20211013080825.GE6010@kili commit 57a06e907c07b17308f9e6e6ce91402ee7ee03e6 Author: Oleksij Rempel Date: Thu Oct 14 11:52:02 2021 +0200 drm: panel-simple: Add support for the Innolux G070Y2-T02 panel Add compatible and timings for the Innolux G070Y2-T02 panel. It is 7" WVGA (800x480) TFT LCD panel with TTL interface and a backlight unit. Co-Developed-by: Robin van der Gracht Signed-off-by: Robin van der Gracht Signed-off-by: Oleksij Rempel Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20211014095202.16716-2-o.rempel@pengutronix.de commit b7490aade5d251ad20e7a820f6f8d3eb87aa581e Author: Gustavo A. R. Silva Date: Thu Oct 14 11:53:20 2021 -0500 video: omapfb: Fix fall-through warning for Clang Fix the following fallthrough warnings: drivers/video/fbdev/omap/omapfb_main.c:1558:2: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] case 0: ^ drivers/video/fbdev/omap/omapfb_main.c:1558:2: note: insert 'break;' to avoid fall-through case 0: ^ break; 1 warning generated. This helps with the ongoing efforts to globally enable -Wimplicit-fallthrough for Clang. Link: https://github.com/KSPP/linux/issues/115 Link: https://lore.kernel.org/lkml/202110141005.hUjaYMEi-lkp@intel.com/ Reported-by: kernel test robot Signed-off-by: Gustavo A. R. Silva Signed-off-by: Sam Ravnborg Link: https://patchwork.freedesktop.org/patch/msgid/20211014165320.GA1145571@embeddedor commit b8f5482c9638915c19963f06d2f4094e276aaab6 Author: Luiz Augusto von Dentz Date: Wed Oct 13 15:17:01 2021 -0700 Bluetooth: vhci: Add support for setting msft_opcode and aosp_capable This adds a debugfs entries to set msft_opcode and aosp_capable enabling vhci to emulate controllers with MSFT/AOSP extension support. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit f809891ee51b706e1a2a42998d8766c120660796 Author: Hans de Goede Date: Tue Oct 5 22:23:20 2021 +0200 platform/x86: thinkpad_acpi: Register a privacy-screen device Register a privacy-screen device on laptops with a privacy-screen, this exports the PrivacyGuard features to user-space using a standardized vendor-agnostic sysfs interface. Note the sysfs interface is read-only. Registering a privacy-screen device with the new privacy-screen class code will also allow the GPU driver to get a handle to it and export the privacy-screen setting as a property on the DRM connector object for the LCD panel. This DRM connector property is a new standardized interface which all user-space code should use to query and control the privacy-screen. Reviewed-by: Emil Velikov Reviewed-by: Lyude Paul Reviewed-by: Mark Pearson Signed-off-by: Hans de Goede Link: https://patchwork.freedesktop.org/patch/msgid/20211005202322.700909-9-hdegoede@redhat.com commit e8b7eb66738f559da1688ef3e4038180d7343547 Author: Hans de Goede Date: Tue Oct 5 22:23:19 2021 +0200 platform/x86: thinkpad_acpi: Get privacy-screen / lcdshadow ACPI handles only once Get the privacy-screen / lcdshadow ACPI handles once and cache them, instead of retrieving them every time we need them. Reviewed-by: Emil Velikov Reviewed-by: Lyude Paul Reviewed-by: Mark Pearson Signed-off-by: Hans de Goede Link: https://patchwork.freedesktop.org/patch/msgid/20211005202322.700909-8-hdegoede@redhat.com commit 1b8101d51873d4644f0ff15f6eac46614542a76b Author: Hans de Goede Date: Tue Oct 5 22:23:18 2021 +0200 platform/x86: thinkpad_acpi: Add hotkey_notify_extended_hotkey() helper Factor the extended hotkey handling out of hotkey_notify_hotkey() and into a new hotkey_notify_extended_hotkey() helper. This is a preparation patch for adding support the privacy-screen hotkey toggle (which needs some special handling, it should NOT send an evdev key-event to userspace...). Reviewed-by: Emil Velikov Reviewed-by: Lyude Paul Reviewed-by: Mark Pearson Signed-off-by: Hans de Goede Link: https://patchwork.freedesktop.org/patch/msgid/20211005202322.700909-7-hdegoede@redhat.com commit 334f74ee85dc26a50c1a2b0da82517595191f92f Author: Hans de Goede Date: Tue Oct 5 22:23:17 2021 +0200 drm/connector: Add a drm_connector privacy-screen helper functions (v2) Add 2 drm_connector privacy-screen helper functions: 1. drm_connector_attach_privacy_screen_provider(), this function creates and attaches the standard privacy-screen properties and registers a generic notifier for generating sysfs-connector-status-events on external changes to the privacy-screen status. 2. drm_connector_update_privacy_screen(), update the privacy-screen's sw_state if the connector has a privacy-screen. Changes in v2: - Do not update connector->state->privacy_screen_sw_state on atomic-commits. - Change drm_connector_update_privacy_screen() to take drm_connector_state as argument instead of a full drm_atomic_state. This allows the helper to be called by drivers when they are enabling crtcs/encoders/connectors. Reviewed-by: Emil Velikov Reviewed-by: Lyude Paul Signed-off-by: Hans de Goede Link: https://patchwork.freedesktop.org/patch/msgid/20211005202322.700909-6-hdegoede@redhat.com commit 8a12b170558aabb31cc98fda0da6a56b518cadaa Author: Hans de Goede Date: Tue Oct 5 22:23:16 2021 +0200 drm/privacy-screen: Add notifier support (v2) Add support for privacy-screen consumers to register a notifier to be notified of external (e.g. done by the hw itself on a hotkey press) state changes. Changes in v2: - Drop WARN_ON(mutex_is_locked(&priv->lock)) check in drm_privacy_screen_call_notifier_chain() it may be locked by another thread, which would lead to a false-positive triggering of the check Reviewed-by: Emil Velikov Reviewed-by: Lyude Paul Signed-off-by: Hans de Goede Link: https://patchwork.freedesktop.org/patch/msgid/20211005202322.700909-5-hdegoede@redhat.com commit befe5404a00b3b1547c944738df4a9229909bdc9 Author: Hans de Goede Date: Tue Oct 5 22:23:15 2021 +0200 drm/privacy-screen: Add X86 specific arch init code Add X86 specific arch init code, which fills the privacy-screen lookup table by checking for various vendor specific ACPI interfaces for controlling the privacy-screen. This initial version only checks for the Lenovo Thinkpad specific ACPI methods for privacy-screen control. Reviewed-by: Emil Velikov Reviewed-by: Lyude Paul Signed-off-by: Hans de Goede Link: https://patchwork.freedesktop.org/patch/msgid/20211005202322.700909-4-hdegoede@redhat.com commit a1a98689301b9af0313e4c1ba44558e8b67ff76e Author: Hans de Goede Date: Tue Oct 5 22:23:14 2021 +0200 drm: Add privacy-screen class (v4) On some new laptops the LCD panel has a builtin electronic privacy-screen. We want to export this functionality as a property on the drm connector object. But often this functionality is not exposed on the GPU but on some other (ACPI) device. This commit adds a privacy-screen class allowing the driver for these other devices to register themselves as a privacy-screen provider; and allowing the drm/kms code to get a privacy-screen provider associated with a specific GPU/connector combo. Changes in v2: - Make CONFIG_DRM_PRIVACY_SCREEN a bool which controls if the drm_privacy code gets built as part of the main drm module rather then making it a tristate which builds its own module. - Add a #if IS_ENABLED(CONFIG_DRM_PRIVACY_SCREEN) check to drm_privacy_screen_consumer.h and define stubs when the check fails. Together these 2 changes fix several dependency issues. - Remove module related code now that this is part of the main drm.ko - Use drm_class as class for the privacy-screen devices instead of adding a separate class for this Changes in v3: - Make the static inline drm_privacy_screen_get_state() stub set sw_state and hw_state to PRIVACY_SCREEN_DISABLED to squelch an uninitialized variable warning when CONFIG_DRM_PRIVICAY_SCREEN is not set Changes in v4: - Make drm_privacy_screen_set_sw_state() skip calling out to the hw if hw_state == new_sw_state Reviewed-by: Emil Velikov Reviewed-by: Lyude Paul Signed-off-by: Hans de Goede Link: https://patchwork.freedesktop.org/patch/msgid/20211005202322.700909-3-hdegoede@redhat.com commit 107fe904302092c683cf5462b4af3cb3cfa40998 Author: Rajat Jain Date: Tue Oct 5 22:23:13 2021 +0200 drm/connector: Add support for privacy-screen properties (v4) Add support for generic electronic privacy screen properties, that can be added by systems that have an integrated EPS. Changes in v2 (Hans de Goede) - Create 2 properties, "privacy-screen sw-state" and "privacy-screen hw-state", to deal with devices where the OS might be locked out of making state changes - Write kerneldoc explaining how the 2 properties work together, what happens when changes to the state are made outside of the DRM code's control, etc. Changes in v3 (Hans de Goede) - Some small tweaks to the kerneldoc describing the 2 properties Changes in v4 (Hans de Goede) - Change the "Enabled, locked" and "Disabled, locked" hw-state enum value names to "Enabled-locked" and "Disabled-locked". The xrandr command shows all possible enum values separated by commas in its output, so having a comma in an enum name is not a good idea. - Do not add a privacy_screen_hw_state member to drm_connector_state since this property is immutable its value must be directly stored in the obj->properties->values array Signed-off-by: Rajat Jain Acked-by: Pekka Paalanen Reviewed-by: Mario Limonciello Reviewed-by: Emil Velikov Reviewed-by: Lyude Paul Co-developed-by: Hans de Goede Signed-off-by: Hans de Goede Link: https://patchwork.freedesktop.org/patch/msgid/20211005202322.700909-2-hdegoede@redhat.com commit 60c6a63a3d3080a62f3e0e20084f58dbeff16748 Author: Mark-YW.Chen Date: Thu Oct 14 00:22:04 2021 +0800 Bluetooth: btusb: fix memory leak in btusb_mtk_submit_wmt_recv_urb() Driver should free `usb->setup_packet` to avoid the leak. $ cat /sys/kernel/debug/kmemleak unreferenced object 0xffffffa564a58080 (size 128): backtrace: [<000000007eb8dd70>] kmem_cache_alloc_trace+0x22c/0x384 [<000000008a44191d>] btusb_mtk_hci_wmt_sync+0x1ec/0x994 [btusb] [<00000000ca7189a3>] btusb_mtk_setup+0x6b8/0x13cc [btusb] [<00000000c6105069>] hci_dev_do_open+0x290/0x974 [bluetooth] [<00000000a583f8b8>] hci_power_on+0xdc/0x3cc [bluetooth] [<000000005d80e687>] process_one_work+0x514/0xc80 [<00000000f4d57637>] worker_thread+0x818/0xd0c [<00000000dc7bdb55>] kthread+0x2f8/0x3b8 [<00000000f9999513>] ret_from_fork+0x10/0x30 Fixes: a1c49c434e150 ("Bluetooth: btusb: Add protocol support for MediaTek MT7668U USB devices") Signed-off-by: Mark-YW.Chen Signed-off-by: Marcel Holtmann commit 75d9b8559ac36e059238ee4f8e33cd86086586ba Author: Wei Yongjun Date: Wed Oct 13 16:55:01 2021 +0800 Bluetooth: Fix memory leak of hci device Fault injection test reported memory leak of hci device as follows: unreferenced object 0xffff88800b858000 (size 8192): comm "kworker/0:2", pid 167, jiffies 4294955747 (age 557.148s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 ad 4e ad de .............N.. backtrace: [<0000000070eb1059>] kmem_cache_alloc_trace mm/slub.c:3208 [<00000000015eb521>] hci_alloc_dev_priv include/linux/slab.h:591 [<00000000dcfc1e21>] bpa10x_probe include/net/bluetooth/hci_core.h:1240 [<000000005d3028c7>] usb_probe_interface drivers/usb/core/driver.c:397 [<00000000cbac9243>] really_probe drivers/base/dd.c:517 [<0000000024cab3f0>] __driver_probe_device drivers/base/dd.c:751 [<00000000202135cb>] driver_probe_device drivers/base/dd.c:782 [<000000000761f2bc>] __device_attach_driver drivers/base/dd.c:899 [<00000000f7d63134>] bus_for_each_drv drivers/base/bus.c:427 [<00000000c9551f0b>] __device_attach drivers/base/dd.c:971 [<000000007f79bd16>] bus_probe_device drivers/base/bus.c:487 [<000000007bb8b95a>] device_add drivers/base/core.c:3364 [<000000009564d9ea>] usb_set_configuration drivers/usb/core/message.c:2171 [<00000000e4657087>] usb_generic_driver_probe drivers/usb/core/generic.c:239 [<0000000071ede518>] usb_probe_device drivers/usb/core/driver.c:294 [<00000000cbac9243>] really_probe drivers/base/dd.c:517 hci_alloc_dev() do not init the device's flag. And hci_free_dev() using put_device() to free the memory allocated for this device, but it calls just put_device(dev) only in case of HCI_UNREGISTER flag is set, So any error handing before hci_register_dev() success will cause memory leak. To avoid this behaviour we can using kfree() to release dev before hci_register_dev() success. Signed-off-by: Wei Yongjun Signed-off-by: Marcel Holtmann commit 893505319c74cf3faa45a5ed9d5338ff03b66949 Author: Kiran K Date: Wed Oct 13 13:35:11 2021 +0530 Bluetooth: btintel: Fix bdaddress comparison with garbage value Intel Read Verision(TLV) data is parsed into a local structure variable and it contains a field for bd address. Bd address is returned only in bootloader mode and hence bd address in TLV structure needs to be validated only if controller is present in boot loader mode. Signed-off-by: Kiran K Reviewed-by: Tedd Ho-Jeong An Signed-off-by: Marcel Holtmann commit 5a4bb6a8e981d3d0d492aa38412ee80b21033177 Author: Wei Yongjun Date: Wed Oct 13 16:55:46 2021 +0800 Bluetooth: Fix debugfs entry leak in hci_register_dev() Fault injection test report debugfs entry leak as follows: debugfs: Directory 'hci0' with parent 'bluetooth' already present! When register_pm_notifier() failed in hci_register_dev(), the debugfs create by debugfs_create_dir() do not removed in the error handing path. Add the remove debugfs code to fix it. Signed-off-by: Wei Yongjun Signed-off-by: Marcel Holtmann commit dc1650fc94a8566fb89f3fd14a26d1cec7865f16 Author: David Yang Date: Wed Oct 13 08:56:33 2021 +0800 Bluetooth: btusb: Fix application of sizeof to pointer The coccinelle check report: "./drivers/bluetooth/btusb.c:2239:36-42: ERROR: application of sizeof to pointer". Using the real size to fix it. Fixes: 5a87679ffd443 ("Bluetooth: btusb: Support public address configuration for MediaTek Chip.") Reported-by: Zeal Robot Signed-off-by: David Yang Signed-off-by: Marcel Holtmann commit f5ff291098f70a70b344df1e388596755c3c8315 Author: Luiz Augusto von Dentz Date: Thu Oct 7 13:26:25 2021 -0700 Bluetooth: L2CAP: Fix not initializing sk_peer_pid In order to group sockets being connected using L2CAP_MODE_EXT_FLOWCTL the pid is used but sk_peer_pid was not being initialized as it is currently only done for af_unix. Fixes: b48596d1dc25 ("Bluetooth: L2CAP: Add get_peer_pid callback") Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit 709fca500067524381e28a5f481882930eebac88 Author: Nguyen Dinh Phi Date: Fri Oct 8 03:04:24 2021 +0800 Bluetooth: hci_sock: purge socket queues in the destruct() callback The receive path may take the socket right before hci_sock_release(), but it may enqueue the packets to the socket queues after the call to skb_queue_purge(), therefore the socket can be destroyed without clear its queues completely. Moving these skb_queue_purge() to the hci_sock_destruct() will fix this issue, because nothing is referencing the socket at this point. Signed-off-by: Nguyen Dinh Phi Reported-by: syzbot+4c4ffd1e1094dae61035@syzkaller.appspotmail.com Signed-off-by: Marcel Holtmann commit e2a58d2d3416aceeae63dfc7bf680dd390ff331d Author: Christoph Hellwig Date: Wed Sep 15 09:00:06 2021 +0200 unicode: only export internal symbols for the selftests The exported symbols in utf8-norm.c are not needed for normal file system consumers, so move them to conditional _GPL exports just for the selftest. Signed-off-by: Christoph Hellwig Signed-off-by: Gabriel Krisman Bertazi commit 2b3d047870120bcd46d7cc257d19ff49328fd585 Author: Christoph Hellwig Date: Wed Sep 15 09:00:05 2021 +0200 unicode: Add utf8-data module utf8data.h contains a large database table which is an auto-generated decodification trie for the unicode normalization functions. Allow building it into a separate module. Based on a patch from Shreeya Patel . Signed-off-by: Christoph Hellwig Signed-off-by: Gabriel Krisman Bertazi commit 6ca99ce756c27852d1ea1e555045de1c920f30ed Author: Christoph Hellwig Date: Wed Sep 15 09:00:04 2021 +0200 unicode: cache the normalization tables in struct unicode_map Instead of repeatedly looking up the version add pointers to the NFD and NFD+CF tables to struct unicode_map, and pass a unicode_map plus index to the functions using the normalization tables. Signed-off-by: Christoph Hellwig Signed-off-by: Gabriel Krisman Bertazi commit fbc59d65059ecfea8b746715e920c325cc16cede Author: Christoph Hellwig Date: Wed Sep 15 09:00:03 2021 +0200 unicode: move utf8cursor to utf8-selftest.c Only used by the tests, so no need to keep it in the core. Signed-off-by: Christoph Hellwig Signed-off-by: Gabriel Krisman Bertazi commit 9012d79cf0c760eb69d54163ee5152c1b504f7aa Author: Christoph Hellwig Date: Wed Sep 15 09:00:02 2021 +0200 unicode: simplify utf8len Just use the utf8nlen implementation with a (size_t)-1 len argument, similar to utf8_lookup. Also move the function to utf8-selftest.c, as it isn't used anywhere else. Signed-off-by: Christoph Hellwig Signed-off-by: Gabriel Krisman Bertazi commit 379210db489c562cd40e9913067149869245a1a0 Author: Christoph Hellwig Date: Wed Sep 15 09:00:01 2021 +0200 unicode: remove the unused utf8{,n}age{min,max} functions No actually used anywhere. Signed-off-by: Christoph Hellwig Signed-off-by: Gabriel Krisman Bertazi commit 49bd03cc7e95cb78420305ca2f5ef67497b6fa80 Author: Christoph Hellwig Date: Wed Sep 15 09:00:00 2021 +0200 unicode: pass a UNICODE_AGE() tripple to utf8_load Don't bother with pointless string parsing when the caller can just pass the version in the format that the core expects. Also remove the fallback to the latest version that none of the callers actually uses. Signed-off-by: Christoph Hellwig Signed-off-by: Gabriel Krisman Bertazi commit f3a9c82396006a5664f6e398d6928799d29de76e Author: Christoph Hellwig Date: Wed Sep 15 08:59:59 2021 +0200 unicode: mark the version field in struct unicode_map unsigned unicode version tripplets are always unsigned. Signed-off-by: Christoph Hellwig Reviewed-by: Gabriel Krisman Bertazi Signed-off-by: Gabriel Krisman Bertazi commit a440943e68cd1b5a853a6f60865967b7cc2539eb Author: Christoph Hellwig Date: Wed Sep 15 08:59:58 2021 +0200 unicode: remove the charset field from struct unicode_map It is hardcoded and only used for a f2fs sysfs file where it can be hardcoded just as easily. Signed-off-by: Christoph Hellwig Reviewed-by: Gabriel Krisman Bertazi Signed-off-by: Gabriel Krisman Bertazi commit 86e8057579780b4ec0fa04774dce2855344bf62d Author: Christoph Hellwig Date: Wed Sep 15 08:59:57 2021 +0200 f2fs: simplify f2fs_sb_read_encoding Return the encoding table as the return value instead of as an argument, and don't bother with the encoding flags as the caller can handle that trivially. Signed-off-by: Christoph Hellwig Reviewed-by: Gabriel Krisman Bertazi Reviewed-by: Chao Yu Signed-off-by: Gabriel Krisman Bertazi commit aa8bf298a96acaaaa3af07d09cf7ffeb9798e48a Author: Christoph Hellwig Date: Wed Sep 15 08:59:56 2021 +0200 ext4: simplify ext4_sb_read_encoding Return the encoding table as the return value instead of as an argument, and don't bother with the encoding flags as the caller can handle that trivially. Signed-off-by: Christoph Hellwig Reviewed-by: Gabriel Krisman Bertazi Acked-by: Theodore Ts'o Signed-off-by: Gabriel Krisman Bertazi commit b15bfa4df63529150df9ff0585675f728436e0c1 Author: Tedd Ho-Jeong An Date: Wed Oct 6 09:32:28 2021 -0700 Bluetooth: mgmt: Fix Experimental Feature Changed event This patch fixes the controller index in the Experimental Features Changed event for the offload_codec and the quality_report features to use the actual hdev index instead of non-controller index(0xffff) so the client can receive the event and know which controller the event is for. Fixes: ad93315183285 ("Bluetooth: Add offload feature under experimental flag") Fixes: ae7d925b5c043 ("Bluetooth: Support the quality report events") Signed-off-by: Tedd Ho-Jeong An Signed-off-by: Marcel Holtmann commit 8b89637dbac2d73d9f3dadf91b4a7dcdb1fc23af Author: Tedd Ho-Jeong An Date: Mon Oct 4 10:01:26 2021 -0700 Bluetooth: hci_vhci: Fix to set the force_wakeup value This patch sets the wakeup state of the vhci driver when the force_wakeup is updated. Fixes: 60edfad4fd0b6 ("Bluetooth: hci_vhci: Add force_prevent_wake entry") Signed-off-by: Tedd Ho-Jeong An Signed-off-by: Marcel Holtmann commit 107fe0482b549a0e43a971e5fd104719c6e495ef Author: Kiran K Date: Tue Oct 5 20:15:56 2021 +0530 Bluetooth: Read codec capabilities only if supported Read codec capabilities only if HCI_READ_LOCAL_CODEC_CAPABILITIES command is supported. If capablities are not supported, then cache codec data without caps. Signed-off-by: Kiran K Signed-off-by: Marcel Holtmann commit 83775456504c251e6e4e1ee50c470e77202b8d21 Author: Luiz Augusto von Dentz Date: Tue Oct 5 18:09:34 2021 -0700 Bluetooth: Fix handling of SUSPEND_DISCONNECTING When SUSPEND_DISCONNECTING bit is set that means Disconnect is pending but the code was evaluating if the list is empty before calling hci_conn_del which does the actual cleanup and remove the connection from the list thus the bit is never cleared causing the suspend procedure to always timeout when there are connections to be disconnected: Suspend/Resume - Success 5 (Pairing - Legacy) - waiting done Set the system into Suspend via force_suspend = mgmt-tester: Suspend/Resume - Success 5 (Pairing -.. 17:03:13.200458 = mgmt-tester: Set the system into Suspend via force_suspend 17:03:13.205812 < HCI Command: Write Scan E.. (0x03|0x001a) plen 1 #122 [hci0] 17:03:13.213561 Scan enable: No Scans (0x00) > HCI Event: Command Complete (0x0e) plen 4 #123 [hci0] 17:03:13.214710 Write Scan Enable (0x03|0x001a) ncmd 1 Status: Success (0x00) < HCI Command: Disconnect (0x01|0x0006) plen 3 #124 [hci0] 17:03:13.215830 Handle: 42 Reason: Remote Device Terminated due to Power Off (0x15) > HCI Event: Command Status (0x0f) plen 4 #125 [hci0] 17:03:13.216602 Disconnect (0x01|0x0006) ncmd 1 Status: Success (0x00) > HCI Event: Disconnect Complete (0x05) plen 4 #126 [hci0] 17:03:13.217342 Status: Success (0x00) Handle: 42 Reason: Remote Device Terminated due to Power Off (0x15) @ MGMT Event: Device Disconn.. (0x000c) plen 8 {0x0002} [hci0] 17:03:13.217688 BR/EDR Address: 00:AA:01:01:00:00 (Intel Corporation) Reason: Connection terminated by local host for suspend (0x05) @ MGMT Event: Device Disconn.. (0x000c) plen 8 {0x0001} [hci0] 17:03:13.217688 BR/EDR Address: 00:AA:01:01:00:00 (Intel Corporation) Reason: Connection terminated by local host for suspend (0x05) Suspend/Resume - Success 5 (Pairing - Legacy) - test timed out = mgmt-tester: Suspend/Resume - Success 5 (Pairing -.. 17:03:13.939317 Suspend/Resume - Success 5 (Pairing - Legacy) - teardown = mgmt-tester: Suspend/Resume - Success 5 (Pairing -.. 17:03:13.947267 [ 13.284291] Bluetooth: hci0: Timed out waiting for suspend events [ 13.287324] Bluetooth: hci0: Suspend timeout bit: 6 Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann commit d16e6d19ccc6d3aa6b96d6a8fdb9e04fb9dffdbd Author: Luiz Augusto von Dentz Date: Tue Oct 5 18:09:33 2021 -0700 Bluetooth: hci_vhci: Fix calling hci_{suspend,resume}_dev Defer calls to hci_{suspend,resume}_dev to work so it doesn't block the processing of the events. Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Marcel Holtmann